From: Andrea Amorese Date: Tue, 18 Jan 2022 14:19:11 +0000 (+0100) Subject: Built motion from commit 6b365f78.|2.5.48 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22card-image.png//%27?a=commitdiff_plain;h=1bf39bba9879c25dc2bdacd2d2a032fbb3f4d425;p=motion2.git Built motion from commit 6b365f78.|2.5.48 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index b73b732..8992a13 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-18T08:32:58.639Z", + "time": "2022-01-18T13:45:36.079Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index af5da7e..1d9dd9d 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-18T08:32:58.639Z", + "time": "2022-01-18T13:45:36.079Z", "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 ee8f18a..048b16e 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 _0x7fcf=['action','contactManager','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL'];(function(_0x49ee70,_0x115b1e){var _0x3a7254=function(_0x1bc688){while(--_0x1bc688){_0x49ee70['push'](_0x49ee70['shift']());}};_0x3a7254(++_0x115b1e);}(_0x7fcf,0xce));var _0xf7fc=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x7fcf[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require('sequelize');module[_0xf7fc('0x0')]={'name':{'type':Sequelize[_0xf7fc('0x1')],'get':function(_0x340c94){return this['getDataValue'](_0xf7fc('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xf7fc('0x3'),'integration','motionbar',_0xf7fc('0x4'),_0xf7fc('0x5'),_0xf7fc('0x6'),'bot',_0xf7fc('0x7')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xf7fc('0x8')},'data1':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comment':_0xf7fc('0xa')},'data2':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comment':_0xf7fc('0xb')},'data4':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comments':_0xf7fc('0xc')},'data6':{'type':Sequelize[_0xf7fc('0x9')],'comments':_0xf7fc('0xd')},'data7':{'type':Sequelize[_0xf7fc('0xe')],'comments':_0xf7fc('0xf')}}; \ No newline at end of file +var _0x8593=['jscripty','browser','bot','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)]','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','motionbar'];(function(_0x1b62c1,_0x3d5b59){var _0x2229c2=function(_0x4f9c86){while(--_0x4f9c86){_0x1b62c1['push'](_0x1b62c1['shift']());}};_0x2229c2(++_0x3d5b59);}(_0x8593,0x107));var _0x3859=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x8593[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0x3859('0x0'));module[_0x3859('0x1')]={'name':{'type':Sequelize[_0x3859('0x2')],'get':function(_0x19acaa){return this[_0x3859('0x3')](_0x3859('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x3859('0x5'),'integration',_0x3859('0x6'),_0x3859('0x7'),'urlForward',_0x3859('0x8'),_0x3859('0x9'),'script']],'msg':_0x3859('0xa')}},'comment':_0x3859('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x3859('0xb')},'data2':{'type':Sequelize[_0x3859('0xc')](0x1000),'comment':_0x3859('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x3859('0xc')](0x1000),'comments':_0x3859('0xe')},'data5':{'type':Sequelize[_0x3859('0xc')](0x1000),'comments':_0x3859('0xf')},'data6':{'type':Sequelize['STRING'],'comments':_0x3859('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':_0x3859('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 2376e7e..0deb8e7 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 _0xf622=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','name','send','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x21f7c2,_0x1b2426){var _0x3f3279=function(_0xaa480f){while(--_0xaa480f){_0x21f7c2['push'](_0x21f7c2['shift']());}};_0x3f3279(++_0x1b2426);}(_0xf622,0xfa));var _0x2f62=function(_0x3d9956,_0x3afd72){_0x3d9956=_0x3d9956-0x0;var _0x7cf682=_0xf622[_0x3d9956];return _0x7cf682;};'use strict';var emlformat=require(_0x2f62('0x0'));var rimraf=require(_0x2f62('0x1'));var zipdir=require(_0x2f62('0x2'));var jsonpatch=require(_0x2f62('0x3'));var rp=require(_0x2f62('0x4'));var moment=require(_0x2f62('0x5'));var BPromise=require(_0x2f62('0x6'));var Mustache=require('mustache');var util=require(_0x2f62('0x7'));var path=require(_0x2f62('0x8'));var sox=require(_0x2f62('0x9'));var csv=require(_0x2f62('0xa'));var ejs=require(_0x2f62('0xb'));var fs=require('fs');var fs_extra=require(_0x2f62('0xc'));var _=require(_0x2f62('0xd'));var squel=require(_0x2f62('0xe'));var crypto=require(_0x2f62('0xf'));var jsforce=require(_0x2f62('0x10'));var deskjs=require(_0x2f62('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2f62('0x12'));var Papa=require(_0x2f62('0x13'));var Redis=require(_0x2f62('0x14'));var authService=require(_0x2f62('0x15'));var qs=require(_0x2f62('0x16'));var as=require(_0x2f62('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f62('0x18'))(_0x2f62('0x19'));var utils=require(_0x2f62('0x1a'));var config=require(_0x2f62('0x1b'));var licenseUtil=require(_0x2f62('0x1c'));var db=require(_0x2f62('0x1d'))['db'];function respondWithStatusCode(_0x58345c,_0x39f8fa){_0x39f8fa=_0x39f8fa||0xcc;return function(_0x4a2315){if(_0x4a2315){return _0x58345c['sendStatus'](_0x39f8fa);}return _0x58345c[_0x2f62('0x1e')](_0x39f8fa)[_0x2f62('0x1f')]();};}function respondWithResult(_0xc5077c,_0x20bfe3){_0x20bfe3=_0x20bfe3||0xc8;return function(_0x15043c){if(_0x15043c){return _0xc5077c[_0x2f62('0x1e')](_0x20bfe3)[_0x2f62('0x20')](_0x15043c);}};}function respondWithFilteredResult(_0x27000f,_0x480a57){return function(_0x59cff0){if(_0x59cff0){var _0x1ae546=typeof _0x480a57['offset']===_0x2f62('0x21')&&typeof _0x480a57[_0x2f62('0x22')]===_0x2f62('0x21');var _0xbfd199=_0x59cff0[_0x2f62('0x23')];var _0x5bbe94=_0x1ae546?0x0:_0x480a57[_0x2f62('0x24')];var _0x3c35c9=_0x1ae546?_0x59cff0[_0x2f62('0x23')]:_0x480a57['offset']+_0x480a57[_0x2f62('0x22')];var _0xce062b;if(_0x3c35c9>=_0xbfd199){_0x3c35c9=_0xbfd199;_0xce062b=0xc8;}else{_0xce062b=0xce;}_0x27000f[_0x2f62('0x1e')](_0xce062b);return _0x27000f['set'](_0x2f62('0x25'),_0x5bbe94+'-'+_0x3c35c9+'/'+_0xbfd199)[_0x2f62('0x20')](_0x59cff0);}return null;};}function patchUpdates(_0x2dcaa2){return function(_0x2fc5d8){try{jsonpatch[_0x2f62('0x26')](_0x2fc5d8,_0x2dcaa2,!![]);}catch(_0x114a6a){return BPromise[_0x2f62('0x27')](_0x114a6a);}return _0x2fc5d8['save']();};}function saveUpdates(_0x18b34d,_0x37d4c3){return function(_0x2e34d7){if(_0x2e34d7){return _0x2e34d7['update'](_0x18b34d)[_0x2f62('0x28')](function(_0x1f6203){return _0x1f6203;});}return null;};}function removeEntity(_0x1b9771,_0x68a9d1){return function(_0x417e79){if(_0x417e79){return _0x417e79[_0x2f62('0x29')]()[_0x2f62('0x28')](function(){_0x1b9771[_0x2f62('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x243da7,_0x25260b){return function(_0x46016a){if(!_0x46016a){_0x243da7[_0x2f62('0x2a')](0x194);}return _0x46016a;};}function handleError(_0xa20a80,_0x52ae02){_0x52ae02=_0x52ae02||0x1f4;return function(_0x7706b9){logger[_0x2f62('0x2b')](_0x7706b9[_0x2f62('0x2c')]);if(_0x7706b9['name']){delete _0x7706b9[_0x2f62('0x2d')];}_0xa20a80[_0x2f62('0x1e')](_0x52ae02)[_0x2f62('0x2e')](_0x7706b9);};}exports[_0x2f62('0x2f')]=function(_0x5c5cf8,_0x3d9ad7){if(_0x5c5cf8['body']['id']){delete _0x5c5cf8[_0x2f62('0x30')]['id'];}return db[_0x2f62('0x31')][_0x2f62('0x32')]({'where':{'id':_0x5c5cf8[_0x2f62('0x33')]['id']}})[_0x2f62('0x28')](handleEntityNotFound(_0x3d9ad7,null))[_0x2f62('0x28')](saveUpdates(_0x5c5cf8[_0x2f62('0x30')],null))[_0x2f62('0x28')](respondWithResult(_0x3d9ad7,null))[_0x2f62('0x34')](handleError(_0x3d9ad7,null));};exports[_0x2f62('0x29')]=function(_0x4daae7,_0xa5fb67){return db[_0x2f62('0x31')][_0x2f62('0x32')]({'where':{'id':_0x4daae7['params']['id']}})[_0x2f62('0x28')](handleEntityNotFound(_0xa5fb67,null))['then'](removeEntity(_0xa5fb67,null))[_0x2f62('0x34')](handleError(_0xa5fb67,null));}; \ No newline at end of file +var _0x3193=['body','find','params','catch','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send'];(function(_0x55ebbc,_0x1cdbe3){var _0x1d93d4=function(_0x590c1a){while(--_0x590c1a){_0x55ebbc['push'](_0x55ebbc['shift']());}};_0x1d93d4(++_0x1cdbe3);}(_0x3193,0xc5));var _0x3319=function(_0x2a924b,_0x4253c8){_0x2a924b=_0x2a924b-0x0;var _0x585f69=_0x3193[_0x2a924b];return _0x585f69;};'use strict';var emlformat=require(_0x3319('0x0'));var rimraf=require(_0x3319('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3319('0x2'));var rp=require(_0x3319('0x3'));var moment=require(_0x3319('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3319('0x5'));var util=require(_0x3319('0x6'));var path=require(_0x3319('0x7'));var sox=require(_0x3319('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3319('0x9'));var squel=require(_0x3319('0xa'));var crypto=require(_0x3319('0xb'));var jsforce=require(_0x3319('0xc'));var deskjs=require(_0x3319('0xd'));var toCsv=require(_0x3319('0xe'));var querystring=require(_0x3319('0xf'));var Papa=require(_0x3319('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3319('0x11'));var as=require(_0x3319('0x12'));var hardwareService=require(_0x3319('0x13'));var logger=require(_0x3319('0x14'))(_0x3319('0x15'));var utils=require(_0x3319('0x16'));var config=require(_0x3319('0x17'));var licenseUtil=require(_0x3319('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7c50d6,_0x59b6c9){_0x59b6c9=_0x59b6c9||0xcc;return function(_0x190a8c){if(_0x190a8c){return _0x7c50d6['sendStatus'](_0x59b6c9);}return _0x7c50d6[_0x3319('0x19')](_0x59b6c9)[_0x3319('0x1a')]();};}function respondWithResult(_0x5b32a4,_0x2640d6){_0x2640d6=_0x2640d6||0xc8;return function(_0x4089c2){if(_0x4089c2){return _0x5b32a4['status'](_0x2640d6)['json'](_0x4089c2);}};}function respondWithFilteredResult(_0x17551b,_0xf8bde1){return function(_0x453e94){if(_0x453e94){var _0x1124d4=typeof _0xf8bde1['offset']===_0x3319('0x1b')&&typeof _0xf8bde1['limit']==='undefined';var _0x58eafd=_0x453e94[_0x3319('0x1c')];var _0x554f92=_0x1124d4?0x0:_0xf8bde1[_0x3319('0x1d')];var _0x41949c=_0x1124d4?_0x453e94['count']:_0xf8bde1[_0x3319('0x1d')]+_0xf8bde1[_0x3319('0x1e')];var _0x5e7c4c;if(_0x41949c>=_0x58eafd){_0x41949c=_0x58eafd;_0x5e7c4c=0xc8;}else{_0x5e7c4c=0xce;}_0x17551b[_0x3319('0x19')](_0x5e7c4c);return _0x17551b[_0x3319('0x1f')](_0x3319('0x20'),_0x554f92+'-'+_0x41949c+'/'+_0x58eafd)[_0x3319('0x21')](_0x453e94);}return null;};}function patchUpdates(_0x1e58fd){return function(_0x28ee19){try{jsonpatch[_0x3319('0x22')](_0x28ee19,_0x1e58fd,!![]);}catch(_0x227011){return BPromise[_0x3319('0x23')](_0x227011);}return _0x28ee19[_0x3319('0x24')]();};}function saveUpdates(_0x447582,_0x8658b9){return function(_0x110919){if(_0x110919){return _0x110919[_0x3319('0x25')](_0x447582)[_0x3319('0x26')](function(_0x181dff){return _0x181dff;});}return null;};}function removeEntity(_0xdc6ea4,_0x29d6ad){return function(_0x2ce55f){if(_0x2ce55f){return _0x2ce55f['destroy']()[_0x3319('0x26')](function(){_0xdc6ea4[_0x3319('0x19')](0xcc)[_0x3319('0x1a')]();});}};}function handleEntityNotFound(_0x342a3f,_0x2775b3){return function(_0x261892){if(!_0x261892){_0x342a3f[_0x3319('0x27')](0x194);}return _0x261892;};}function handleError(_0x224e8a,_0x2fc9dd){_0x2fc9dd=_0x2fc9dd||0x1f4;return function(_0x425e9e){logger['error'](_0x425e9e[_0x3319('0x28')]);if(_0x425e9e[_0x3319('0x29')]){delete _0x425e9e[_0x3319('0x29')];}_0x224e8a[_0x3319('0x19')](_0x2fc9dd)[_0x3319('0x2a')](_0x425e9e);};}exports['update']=function(_0x203ecd,_0x4aaf06){if(_0x203ecd[_0x3319('0x2b')]['id']){delete _0x203ecd[_0x3319('0x2b')]['id'];}return db['Action'][_0x3319('0x2c')]({'where':{'id':_0x203ecd[_0x3319('0x2d')]['id']}})[_0x3319('0x26')](handleEntityNotFound(_0x4aaf06,null))[_0x3319('0x26')](saveUpdates(_0x203ecd[_0x3319('0x2b')],null))[_0x3319('0x26')](respondWithResult(_0x4aaf06,null))[_0x3319('0x2e')](handleError(_0x4aaf06,null));};exports[_0x3319('0x2f')]=function(_0x44340e,_0x237134){return db['Action']['find']({'where':{'id':_0x44340e['params']['id']}})['then'](handleEntityNotFound(_0x237134,null))[_0x3319('0x26')](removeEntity(_0x237134,null))['catch'](handleError(_0x237134,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index b91a172..c4763b7 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 _0x18b1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','tools_actions'];(function(_0x253f2a,_0x2c51f2){var _0x1c15f5=function(_0x446493){while(--_0x446493){_0x253f2a['push'](_0x253f2a['shift']());}};_0x1c15f5(++_0x2c51f2);}(_0x18b1,0x9a));var _0x118b=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x18b1[_0x257642];return _0x3d813b;};'use strict';var _=require(_0x118b('0x0'));var util=require(_0x118b('0x1'));var logger=require(_0x118b('0x2'))(_0x118b('0x3'));var moment=require(_0x118b('0x4'));var BPromise=require(_0x118b('0x5'));var rp=require(_0x118b('0x6'));var fs=require('fs');var path=require(_0x118b('0x7'));var rimraf=require(_0x118b('0x8'));var config=require(_0x118b('0x9'));var attributes=require(_0x118b('0xa'));module[_0x118b('0xb')]=function(_0x5f5084,_0x3d63ef){return _0x5f5084[_0x118b('0xc')]('Action',attributes,{'tableName':_0x118b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66d6=['exports','Action','tools_actions','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./action.attributes'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x66d6,0xf5));var _0x666d=function(_0x5a452e,_0x355a90){_0x5a452e=_0x5a452e-0x0;var _0x2c4c43=_0x66d6[_0x5a452e];return _0x2c4c43;};'use strict';var _=require(_0x666d('0x0'));var util=require(_0x666d('0x1'));var logger=require(_0x666d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x666d('0x3'));var rp=require(_0x666d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x666d('0x5'));var config=require(_0x666d('0x6'));var attributes=require(_0x666d('0x7'));module[_0x666d('0x8')]=function(_0x324c9a,_0x1764c2){return _0x324c9a['define'](_0x666d('0x9'),attributes,{'tableName':_0x666d('0xa'),'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 0e4822e..b59e46d 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x52f934,_0x424005){var _0x41dcad=function(_0x31d98c){while(--_0x31d98c){_0x52f934['push'](_0x52f934['shift']());}};_0x41dcad(++_0x424005);}(_0x5fc3,0xa8));var _0x35fc=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0x5fc3[_0x136a0d];return _0x212ea5;};'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')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\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']('Action,\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);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x118da3,_0x2b8050){var _0x2b9916=function(_0xaad730){while(--_0xaad730){_0x118da3['push'](_0x118da3['shift']());}};_0x2b9916(++_0x2b8050);}(_0xe14b,0x93));var _0xbe14=function(_0x5ea538,_0x37bdb5){_0x5ea538=_0x5ea538-0x0;var _0x37ff5e=_0xe14b[_0x5ea538];return _0x37ff5e;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 42810ce..10b21c1 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 _0xbb18=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','exports','util','path'];(function(_0x2ad7fb,_0x457a39){var _0x4e63d1=function(_0x45fd63){while(--_0x45fd63){_0x2ad7fb['push'](_0x2ad7fb['shift']());}};_0x4e63d1(++_0x457a39);}(_0xbb18,0x16a));var _0x8bb1=function(_0x4f96b4,_0x22cc57){_0x4f96b4=_0x4f96b4-0x0;var _0x67821b=_0xbb18[_0x4f96b4];return _0x67821b;};'use strict';var multer=require('multer');var util=require(_0x8bb1('0x0'));var path=require(_0x8bb1('0x1'));var timeout=require('connect-timeout');var express=require(_0x8bb1('0x2'));var router=express['Router']();var fs_extra=require(_0x8bb1('0x3'));var auth=require(_0x8bb1('0x4'));var interaction=require(_0x8bb1('0x5'));var config=require(_0x8bb1('0x6'));var controller=require(_0x8bb1('0x7'));router[_0x8bb1('0x8')](_0x8bb1('0x9'),auth[_0x8bb1('0xa')](),controller[_0x8bb1('0xb')]);router['delete'](_0x8bb1('0x9'),auth[_0x8bb1('0xa')](),controller['destroy']);module[_0x8bb1('0xc')]=router; \ No newline at end of file +var _0x4857=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x4857,0x16a));var _0x7485=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x4857[_0x5a3cf0];return _0x5a64ee;};'use strict';var multer=require(_0x7485('0x0'));var util=require(_0x7485('0x1'));var path=require(_0x7485('0x2'));var timeout=require('connect-timeout');var express=require(_0x7485('0x3'));var router=express[_0x7485('0x4')]();var fs_extra=require(_0x7485('0x5'));var auth=require(_0x7485('0x6'));var interaction=require(_0x7485('0x7'));var config=require(_0x7485('0x8'));var controller=require(_0x7485('0x9'));router['put'](_0x7485('0xa'),auth[_0x7485('0xb')](),controller[_0x7485('0xc')]);router[_0x7485('0xd')](_0x7485('0xa'),auth['isAuthenticated'](),controller[_0x7485('0xe')]);module[_0x7485('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 0a6dc68..29f7319 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 _0x4819=['TEXT','exports','STRING'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0x4819,0xcd));var _0x9481=function(_0x344e99,_0x530098){_0x344e99=_0x344e99-0x0;var _0x172d28=_0x4819[_0x344e99];return _0x172d28;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}}; \ No newline at end of file +var _0xee14=['STRING','TEXT'];(function(_0x8c1cbb,_0x329764){var _0x2ce944=function(_0x3cfe33){while(--_0x3cfe33){_0x8c1cbb['push'](_0x8c1cbb['shift']());}};_0x2ce944(++_0x329764);}(_0xee14,0x13a));var _0x4ee1=function(_0x5c699e,_0x35ca34){_0x5c699e=_0x5c699e-0x0;var _0x253361=_0xee14[_0x5c699e];return _0x253361;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index fb4bb28..8f20e0a 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 _0xeae6=['sequelize','SELECT','join','cross_join','COUNT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','Sequelize','from','MetricId','output','web','%s-%s.%s','randomstring','generate','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','ROUND(%s)','keyBy','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','sendStatus','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','left_join','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','operator','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xeae6,0xc3));var _0x6eae=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeae6[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x6eae('0x0'));var rimraf=require(_0x6eae('0x1'));var zipdir=require(_0x6eae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6eae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6eae('0x4'));var util=require(_0x6eae('0x5'));var path=require(_0x6eae('0x6'));var sox=require(_0x6eae('0x7'));var csv=require(_0x6eae('0x8'));var ejs=require(_0x6eae('0x9'));var fs=require('fs');var fs_extra=require(_0x6eae('0xa'));var _=require(_0x6eae('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6eae('0xc'));var deskjs=require(_0x6eae('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6eae('0xe'));var Papa=require(_0x6eae('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6eae('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6eae('0x11'));var utils=require(_0x6eae('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x6eae('0x13'));var db=require(_0x6eae('0x14'))['db'];var dbH=require(_0x6eae('0x14'))[_0x6eae('0x15')];function respondWithStatusCode(_0x118bc0,_0x1d86ac){_0x1d86ac=_0x1d86ac||0xcc;return function(_0x18f2ee){if(_0x18f2ee){return _0x118bc0['sendStatus'](_0x1d86ac);}return _0x118bc0[_0x6eae('0x16')](_0x1d86ac)[_0x6eae('0x17')]();};}function respondWithResult(_0x147b90,_0x275024){_0x275024=_0x275024||0xc8;return function(_0x18c008){if(_0x18c008){return _0x147b90[_0x6eae('0x16')](_0x275024)[_0x6eae('0x18')](_0x18c008);}};}function respondWithFilteredResult(_0x350393,_0x1157c1){return function(_0x18cb2d){if(_0x18cb2d){var _0x36b0fd=typeof _0x1157c1[_0x6eae('0x19')]===_0x6eae('0x1a')&&typeof _0x1157c1[_0x6eae('0x1b')]===_0x6eae('0x1a');var _0x455a62=_0x18cb2d[_0x6eae('0x1c')];var _0x220e49=_0x36b0fd?0x0:_0x1157c1[_0x6eae('0x19')];var _0x227e4d=_0x36b0fd?_0x18cb2d[_0x6eae('0x1c')]:_0x1157c1[_0x6eae('0x19')]+_0x1157c1[_0x6eae('0x1b')];var _0x1834b8;if(_0x227e4d>=_0x455a62){_0x227e4d=_0x455a62;_0x1834b8=0xc8;}else{_0x1834b8=0xce;}_0x350393[_0x6eae('0x16')](_0x1834b8);return _0x350393[_0x6eae('0x1d')](_0x6eae('0x1e'),_0x220e49+'-'+_0x227e4d+'/'+_0x455a62)[_0x6eae('0x18')](_0x18cb2d);}return null;};}function patchUpdates(_0x4ecd58){return function(_0x2ca50c){try{jsonpatch[_0x6eae('0x1f')](_0x2ca50c,_0x4ecd58,!![]);}catch(_0xbf38cc){return BPromise[_0x6eae('0x20')](_0xbf38cc);}return _0x2ca50c[_0x6eae('0x21')]();};}function saveUpdates(_0x1b3061,_0x5a43c1){return function(_0x1d89c4){if(_0x1d89c4){return _0x1d89c4[_0x6eae('0x22')](_0x1b3061)[_0x6eae('0x23')](function(_0x15adf2){return _0x15adf2;});}return null;};}function removeEntity(_0x39e6d0,_0x4468db){return function(_0x4367eb){if(_0x4367eb){return _0x4367eb[_0x6eae('0x24')]()[_0x6eae('0x23')](function(){var _0x34b2b8=_0x4367eb['get']({'plain':!![]});var _0x15628e=_0x6eae('0x25');return db['UserProfileResource'][_0x6eae('0x24')]({'where':{'type':_0x15628e,'resourceId':_0x34b2b8['id']}})['then'](function(){return _0x4367eb;});})[_0x6eae('0x23')](function(){_0x39e6d0['status'](0xcc)[_0x6eae('0x17')]();});}};}function handleEntityNotFound(_0x3242b1,_0x152cb3){return function(_0x399b1e){if(!_0x399b1e){_0x3242b1[_0x6eae('0x26')](0x194);}return _0x399b1e;};}function handleError(_0x18e50b,_0x501143){_0x501143=_0x501143||0x1f4;return function(_0x4d1253){logger[_0x6eae('0x27')](_0x4d1253['stack']);if(_0x4d1253['name']){delete _0x4d1253[_0x6eae('0x28')];}_0x18e50b['status'](_0x501143)[_0x6eae('0x29')](_0x4d1253);};}exports[_0x6eae('0x2a')]=function(_0x4b3bb6,_0x5931fc){var _0x433c13={},_0x510800={},_0x3421a7={'count':0x0,'rows':[]};var _0x32a0ea=_[_0x6eae('0x2b')](db[_0x6eae('0x2c')][_0x6eae('0x2d')],function(_0x33bd3a){return{'name':_0x33bd3a[_0x6eae('0x2e')],'type':_0x33bd3a['type'][_0x6eae('0x2f')]};});_0x510800[_0x6eae('0x30')]=_[_0x6eae('0x2b')](_0x32a0ea,_0x6eae('0x28'));_0x510800[_0x6eae('0x31')]=_[_0x6eae('0x32')](_0x4b3bb6[_0x6eae('0x31')]);_0x510800['filters']=_[_0x6eae('0x33')](_0x510800[_0x6eae('0x30')],_0x510800[_0x6eae('0x31')]);_0x433c13['attributes']=_['intersection'](_0x510800[_0x6eae('0x30')],qs[_0x6eae('0x34')](_0x4b3bb6['query'][_0x6eae('0x34')]));_0x433c13[_0x6eae('0x35')]=_0x433c13[_0x6eae('0x35')]['length']?_0x433c13[_0x6eae('0x35')]:_0x510800[_0x6eae('0x30')];if(!_0x4b3bb6[_0x6eae('0x31')]['hasOwnProperty']('nolimit')){_0x433c13['limit']=qs['limit'](_0x4b3bb6[_0x6eae('0x31')][_0x6eae('0x1b')]);_0x433c13[_0x6eae('0x19')]=qs[_0x6eae('0x19')](_0x4b3bb6[_0x6eae('0x31')][_0x6eae('0x19')]);}_0x433c13[_0x6eae('0x36')]=qs['sort'](_0x4b3bb6[_0x6eae('0x31')][_0x6eae('0x37')]);_0x433c13[_0x6eae('0x38')]=qs[_0x6eae('0x39')](_[_0x6eae('0x3a')](_0x4b3bb6['query'],_0x510800['filters']),_0x32a0ea);if(_0x4b3bb6[_0x6eae('0x31')][_0x6eae('0x3b')]){_0x433c13[_0x6eae('0x38')]=_[_0x6eae('0x3c')](_0x433c13[_0x6eae('0x38')],{'$or':_[_0x6eae('0x2b')](_0x32a0ea,function(_0x17a4a6){if(_0x17a4a6[_0x6eae('0x3d')]!==_0x6eae('0x3e')){var _0x36eb46={};_0x36eb46[_0x17a4a6[_0x6eae('0x28')]]={'$like':'%'+_0x4b3bb6['query'][_0x6eae('0x3b')]+'%'};return _0x36eb46;}})});}_0x433c13=_[_0x6eae('0x3c')]({},_0x433c13,_0x4b3bb6['options']);var _0x38b269={'where':_0x433c13['where']};return db[_0x6eae('0x2c')][_0x6eae('0x1c')](_0x38b269)['then'](function(_0x5b53eb){_0x3421a7[_0x6eae('0x1c')]=_0x5b53eb;if(_0x4b3bb6[_0x6eae('0x31')][_0x6eae('0x3f')]){_0x433c13[_0x6eae('0x40')]=[{'all':!![]}];}return db[_0x6eae('0x2c')][_0x6eae('0x41')](_0x433c13);})[_0x6eae('0x23')](function(_0x579b68){_0x3421a7[_0x6eae('0x42')]=_0x579b68;return _0x3421a7;})[_0x6eae('0x23')](respondWithFilteredResult(_0x5931fc,_0x433c13))[_0x6eae('0x43')](handleError(_0x5931fc,null));};exports[_0x6eae('0x44')]=function(_0xf7c81f,_0x3fa6e6){var _0x4ab749={'raw':![],'where':{'id':_0xf7c81f['params']['id']}},_0x268632={};_0x268632[_0x6eae('0x30')]=_[_0x6eae('0x32')](db[_0x6eae('0x2c')][_0x6eae('0x2d')]);_0x268632[_0x6eae('0x31')]=_['keys'](_0xf7c81f[_0x6eae('0x31')]);_0x268632[_0x6eae('0x39')]=_['intersection'](_0x268632[_0x6eae('0x30')],_0x268632['query']);_0x4ab749[_0x6eae('0x35')]=_['intersection'](_0x268632['model'],qs[_0x6eae('0x34')](_0xf7c81f[_0x6eae('0x31')][_0x6eae('0x34')]));_0x4ab749['attributes']=_0x4ab749[_0x6eae('0x35')][_0x6eae('0x45')]?_0x4ab749['attributes']:_0x268632[_0x6eae('0x30')];if(_0xf7c81f[_0x6eae('0x31')]['includeAll']){_0x4ab749[_0x6eae('0x40')]=[{'all':!![]}];}_0x4ab749=_[_0x6eae('0x3c')]({},_0x4ab749,_0xf7c81f[_0x6eae('0x46')]);return db[_0x6eae('0x2c')]['find'](_0x4ab749)[_0x6eae('0x23')](handleEntityNotFound(_0x3fa6e6,null))[_0x6eae('0x23')](respondWithResult(_0x3fa6e6,null))['catch'](handleError(_0x3fa6e6,null));};exports['create']=function(_0x2ff08e,_0x2adfcd){return db[_0x6eae('0x2c')][_0x6eae('0x47')](_0x2ff08e[_0x6eae('0x48')],{})['then'](function(_0x3644a0){var _0x1fb293=_0x2ff08e[_0x6eae('0x49')][_0x6eae('0x4a')]({'plain':!![]});if(!_0x1fb293)throw new Error(_0x6eae('0x4b'));if(_0x1fb293['role']===_0x6eae('0x49')){var _0xd6d447=_0x3644a0[_0x6eae('0x4a')]({'plain':!![]});var _0x4dfbca=_0x6eae('0x4c');return db['UserProfileSection'][_0x6eae('0x4d')]({'where':{'name':_0x4dfbca,'userProfileId':_0x1fb293[_0x6eae('0x4e')]},'raw':!![]})[_0x6eae('0x23')](function(_0x570ea3){if(_0x570ea3&&_0x570ea3[_0x6eae('0x4f')]===0x0){return db[_0x6eae('0x50')]['create']({'name':_0xd6d447['name'],'resourceId':_0xd6d447['id'],'type':_0x6eae('0x25'),'sectionId':_0x570ea3['id']},{})[_0x6eae('0x23')](function(){return _0x3644a0;});}else{return _0x3644a0;}})[_0x6eae('0x43')](function(_0x22cce2){logger[_0x6eae('0x27')](_0x6eae('0x51'),_0x22cce2);throw _0x22cce2;});}return _0x3644a0;})['then'](respondWithResult(_0x2adfcd,0xc9))['catch'](handleError(_0x2adfcd,null));};exports[_0x6eae('0x22')]=function(_0x3cdc31,_0x4358d7){if(_0x3cdc31[_0x6eae('0x48')]['id']){delete _0x3cdc31[_0x6eae('0x48')]['id'];}return db[_0x6eae('0x2c')][_0x6eae('0x4d')]({'where':{'id':_0x3cdc31[_0x6eae('0x52')]['id']}})[_0x6eae('0x23')](handleEntityNotFound(_0x4358d7,null))[_0x6eae('0x23')](saveUpdates(_0x3cdc31[_0x6eae('0x48')],null))[_0x6eae('0x23')](respondWithResult(_0x4358d7,null))['catch'](handleError(_0x4358d7,null));};exports[_0x6eae('0x24')]=function(_0x45922a,_0x435c89){return db['AnalyticCustomReport'][_0x6eae('0x4d')]({'where':{'id':_0x45922a['params']['id']}})[_0x6eae('0x23')](handleEntityNotFound(_0x435c89,null))[_0x6eae('0x23')](removeEntity(_0x435c89,null))[_0x6eae('0x43')](handleError(_0x435c89,null));};exports['preview']=function(_0x16d57a,_0x315f29){var _0xe312bd=0xa;var _0x45a9e6=['join',_0x6eae('0x53'),_0x6eae('0x54'),'cross_join'];var _0x4fca10={'SUM':_0x6eae('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6eae('0x56'),'MAX':_0x6eae('0x57'),'MIN':_0x6eae('0x58'),'AVG':_0x6eae('0x59'),'GROUP_CONCAT':_0x6eae('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6eae('0x5b')};var _0x4568b4={'SEC_TO_TIME':_0x6eae('0x5c'),'DATE':'DATE(%s)','HOUR':_0x6eae('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x6eae('0x5e')};var _0x30a4a=function(_0x3af90c){return!_[_0x6eae('0x5f')]([_0x6eae('0x60'),_0x6eae('0x61'),_0x6eae('0x62'),'IS\x20NOT\x20EMPTY'],_0x3af90c);};var _0xb9f0a1=function(_0x1e97ad){if(!_0x1e97ad||!_0x1e97ad['rules'][_0x6eae('0x45')]){return'';}for(var _0x6af0ba='(',_0x33086e=0x0;_0x33086e<_0x1e97ad['rules'][_0x6eae('0x45')];_0x33086e+=0x1){_0x33086e>0x0&&(_0x6af0ba+='\x20'+_0x1e97ad[_0x6eae('0x63')]+'\x20');_0x6af0ba+=_0x1e97ad[_0x6eae('0x64')][_0x33086e][_0x6eae('0x65')]?_0xb9f0a1(_0x1e97ad[_0x6eae('0x64')][_0x33086e]['group']):_0x1e97ad[_0x6eae('0x64')][_0x33086e][_0x6eae('0x66')]+'\x20'+_0x1e97ad[_0x6eae('0x64')][_0x33086e][_0x6eae('0x67')]+(_0x30a4a(_0x1e97ad[_0x6eae('0x64')][_0x33086e]['condition'])?'\x20'+_0x1e97ad[_0x6eae('0x64')][_0x33086e]['value']:'');}return _0x6af0ba+')';};var _0x27b20d={'where':{'id':_0x16d57a[_0x6eae('0x52')]['id']}},_0x5356ab,_0x532118,_0x285b58,_0x3e8d10,_0xa895f8;_0x27b20d=_[_0x6eae('0x3c')]({},_0x27b20d,_0x16d57a[_0x6eae('0x46')]);return db[_0x6eae('0x2c')][_0x6eae('0x4d')](_0x27b20d)['then'](function(_0x4f94ab){if(_0x4f94ab){_0x5356ab=_0x4f94ab;return _0x4f94ab[_0x6eae('0x68')]();}return null;})[_0x6eae('0x23')](function(_0x4adfaa){if(_0x4adfaa){if(!_0x4adfaa[_0x6eae('0x45')]){throw new db['Sequelize'][(_0x6eae('0x69'))](_0x6eae('0x6a'),0x193);}_0x532118=_0x4adfaa;return db[_0x6eae('0x6b')][_0x6eae('0x41')]({'raw':!![]});}return null;})[_0x6eae('0x23')](function(_0xdb991c){if(_0xdb991c){_0x285b58=_['keyBy'](_0xdb991c,'id');var _0xe741e0;var _0xa42ac7=squel[_0x6eae('0x6c')]();_0xa42ac7['from'](_0x5356ab['table']);for(var _0x422ac1=0x0;_0x422ac1<_0x532118[_0x6eae('0x45')];_0x422ac1+=0x1){_0xe741e0=_0x532118[_0x422ac1]['MetricId']?_0x285b58[_0x532118[_0x422ac1]['MetricId']][_0x6eae('0x6d')]:_0x532118[_0x422ac1][_0x6eae('0x66')];_0xe741e0=_0x532118[_0x422ac1][_0x6eae('0x6e')]?_[_0x6eae('0x6f')](_0x4fca10[_0x532118[_0x422ac1]['function']],'%s',_0xe741e0):_0xe741e0;_0xe741e0=_0x532118[_0x422ac1][_0x6eae('0x70')]?_[_0x6eae('0x6f')](_0x4568b4[_0x532118[_0x422ac1]['format']],'%s',_0xe741e0):_0xe741e0;if(_0x532118[_0x422ac1][_0x6eae('0x71')]){_0xa42ac7[_0x6eae('0x65')](_0xe741e0);}_0x532118[_0x422ac1][_0x6eae('0x72')]&&_0xa42ac7[_0x6eae('0x36')](_0xe741e0,_0x532118[_0x422ac1][_0x6eae('0x72')]===_0x6eae('0x73')?![]:!![]);_0xa42ac7[_0x6eae('0x66')](_0xe741e0,_0x532118[_0x422ac1][_0x6eae('0x74')]||_0xe741e0);}if(_0x5356ab[_0x6eae('0x75')]){_0x5356ab[_0x6eae('0x75')]=JSON[_0x6eae('0x76')](_0x5356ab[_0x6eae('0x75')]);for(var _0x162ae7=0x0;_0x162ae7<_0x5356ab[_0x6eae('0x75')][_0x6eae('0x45')];_0x162ae7+=0x1){if(_0x5356ab[_0x6eae('0x75')][_0x162ae7][_0x6eae('0x3d')]&&_['includes'](_0x45a9e6,_0x5356ab[_0x6eae('0x75')][_0x162ae7]['type'])&&_0x5356ab[_0x6eae('0x75')][_0x162ae7][_0x6eae('0x77')]&&_0x5356ab[_0x6eae('0x75')][_0x162ae7][_0x6eae('0x78')]&&_0x5356ab[_0x6eae('0x75')][_0x162ae7][_0x6eae('0x79')]){_0xa42ac7[_0x5356ab[_0x6eae('0x75')][_0x162ae7][_0x6eae('0x3d')]](_0x5356ab[_0x6eae('0x75')][_0x162ae7][_0x6eae('0x78')],null,util[_0x6eae('0x70')](_0x6eae('0x7a'),_0x5356ab[_0x6eae('0x7b')],_0x5356ab[_0x6eae('0x75')][_0x162ae7]['parentKey'],_0x5356ab[_0x6eae('0x75')][_0x162ae7]['foreignTable'],_0x5356ab[_0x6eae('0x75')][_0x162ae7][_0x6eae('0x79')]));}}}if(_0x5356ab[_0x6eae('0x7c')]){_0x5356ab[_0x6eae('0x7c')]=JSON[_0x6eae('0x76')](_0x5356ab[_0x6eae('0x7c')]);_0xa42ac7[_0x6eae('0x38')](_0xb9f0a1(_0x5356ab[_0x6eae('0x7c')][_0x6eae('0x65')]));}_0xa895f8=_0xa42ac7[_0x6eae('0x7d')]();_0xa42ac7[_0x6eae('0x1b')](_0xe312bd);_0xa42ac7[_0x6eae('0x19')](0x0);logger[_0x6eae('0x7e')](_0x6eae('0x7f'),_0xa42ac7[_0x6eae('0x80')]());return dbH[_0x6eae('0x81')][_0x6eae('0x31')](_0xa42ac7[_0x6eae('0x80')](),{'type':dbH['sequelize']['QueryTypes'][_0x6eae('0x82')]});}})['then'](respondWithResult(_0x315f29,null))[_0x6eae('0x43')](handleError(_0x315f29,null));};function runReport(_0x189e05,_0x486b4c,_0x1b7f76){var _0x2d7bde=_0x486b4c['name'];var _0x4b1992=0xa;var _0x2eeee4=[_0x6eae('0x83'),'left_join',_0x6eae('0x54'),_0x6eae('0x84')];var _0x341ddd={'SUM':_0x6eae('0x55'),'COUNT':_0x6eae('0x85'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x6eae('0x57'),'MIN':_0x6eae('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x6eae('0x5a'),'GROUP_CONCAT ASC':_0x6eae('0x86'),'GROUP_CONCAT DESC':_0x6eae('0x5b')};var _0x5f3fa6={'SEC_TO_TIME':_0x6eae('0x5c'),'DATE':_0x6eae('0x87'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x6eae('0x5e')};var _0x588184=function(_0x53fac3){return!_[_0x6eae('0x5f')]([_0x6eae('0x60'),_0x6eae('0x61'),_0x6eae('0x62'),'IS\x20NOT\x20EMPTY'],_0x53fac3);};var _0x4323d7=function(_0x5158a2){if(!_0x5158a2||!_0x5158a2[_0x6eae('0x64')][_0x6eae('0x45')]){return'';}for(var _0x335b54='(',_0x527999=0x0;_0x527999<_0x5158a2['rules'][_0x6eae('0x45')];_0x527999+=0x1){_0x527999>0x0&&(_0x335b54+='\x20'+_0x5158a2[_0x6eae('0x63')]+'\x20');_0x335b54+=_0x5158a2[_0x6eae('0x64')][_0x527999]['group']?_0x4323d7(_0x5158a2['rules'][_0x527999][_0x6eae('0x65')]):_0x5158a2[_0x6eae('0x64')][_0x527999][_0x6eae('0x66')]+'\x20'+_0x5158a2[_0x6eae('0x64')][_0x527999][_0x6eae('0x67')]+(_0x588184(_0x5158a2['rules'][_0x527999][_0x6eae('0x67')])?'\x20'+_0x5158a2['rules'][_0x527999]['value']:'');}return _0x335b54+')';};var _0x2689d4={'where':{'id':_0x189e05['id']}},_0x486145,_0x224a01,_0x23eba8,_0x708638,_0x4107f0;_0x2689d4=_[_0x6eae('0x3c')]({},_0x2689d4,_0x1b7f76);return db[_0x6eae('0x2c')]['find'](_0x2689d4)[_0x6eae('0x23')](function(_0x196133){if(_0x196133){_0x486145=_0x196133;return _0x196133[_0x6eae('0x68')]();}return null;})[_0x6eae('0x23')](function(_0x4bc4de){if(_0x4bc4de){if(!_0x4bc4de[_0x6eae('0x45')]){throw new db[(_0x6eae('0x88'))][(_0x6eae('0x69'))](_0x6eae('0x6a'),0x193);}_0x224a01=_0x4bc4de;return db[_0x6eae('0x6b')][_0x6eae('0x41')]({'raw':!![]});}return null;})[_0x6eae('0x23')](function(_0x1568b3){if(_0x1568b3){_0x23eba8=_['keyBy'](_0x1568b3,'id');var _0x1dff82;var _0x5e4ed0=squel[_0x6eae('0x6c')]();_0x5e4ed0[_0x6eae('0x89')](_0x486145[_0x6eae('0x7b')]);for(var _0x525b25=0x0;_0x525b25<_0x224a01[_0x6eae('0x45')];_0x525b25+=0x1){_0x1dff82=_0x224a01[_0x525b25]['MetricId']?_0x23eba8[_0x224a01[_0x525b25][_0x6eae('0x8a')]][_0x6eae('0x6d')]:_0x224a01[_0x525b25][_0x6eae('0x66')];_0x1dff82=_0x224a01[_0x525b25]['function']?_[_0x6eae('0x6f')](_0x341ddd[_0x224a01[_0x525b25]['function']],'%s',_0x1dff82):_0x1dff82;_0x1dff82=_0x224a01[_0x525b25][_0x6eae('0x70')]?_[_0x6eae('0x6f')](_0x5f3fa6[_0x224a01[_0x525b25][_0x6eae('0x70')]],'%s',_0x1dff82):_0x1dff82;if(_0x224a01[_0x525b25][_0x6eae('0x71')]){_0x5e4ed0[_0x6eae('0x65')](_0x1dff82);}_0x224a01[_0x525b25][_0x6eae('0x72')]&&_0x5e4ed0[_0x6eae('0x36')](_0x1dff82,_0x224a01[_0x525b25]['orderBy']===_0x6eae('0x73')?![]:!![]);_0x5e4ed0['field'](_0x1dff82,_0x224a01[_0x525b25][_0x6eae('0x74')]||_0x1dff82);}if(_0x486145['joins']){_0x486145[_0x6eae('0x75')]=JSON['parse'](_0x486145[_0x6eae('0x75')]);for(var _0x507c62=0x0;_0x507c62<_0x486145[_0x6eae('0x75')][_0x6eae('0x45')];_0x507c62+=0x1){if(_0x486145[_0x6eae('0x75')][_0x507c62][_0x6eae('0x3d')]&&_['includes'](_0x2eeee4,_0x486145[_0x6eae('0x75')][_0x507c62][_0x6eae('0x3d')])&&_0x486145[_0x6eae('0x75')][_0x507c62]['parentKey']&&_0x486145[_0x6eae('0x75')][_0x507c62][_0x6eae('0x78')]&&_0x486145[_0x6eae('0x75')][_0x507c62]['foreignKey']){_0x5e4ed0[_0x486145[_0x6eae('0x75')][_0x507c62][_0x6eae('0x3d')]](_0x486145['joins'][_0x507c62][_0x6eae('0x78')],null,util[_0x6eae('0x70')](_0x6eae('0x7a'),_0x486145[_0x6eae('0x7b')],_0x486145['joins'][_0x507c62][_0x6eae('0x77')],_0x486145[_0x6eae('0x75')][_0x507c62][_0x6eae('0x78')],_0x486145[_0x6eae('0x75')][_0x507c62]['foreignKey']));}}}if(_0x486145[_0x6eae('0x7c')]){_0x486145[_0x6eae('0x7c')]=JSON[_0x6eae('0x76')](_0x486145[_0x6eae('0x7c')]);_0x5e4ed0['where'](_0x4323d7(_0x486145[_0x6eae('0x7c')]['group']));}_0x4107f0=_0x5e4ed0[_0x6eae('0x7d')]();_0x5e4ed0['limit'](_0x4b1992);_0x5e4ed0[_0x6eae('0x19')](0x0);return;}})['then'](function(){if(_0x486b4c[_0x6eae('0x8b')]===_0x6eae('0x8c')){return null;}var _0x3d9412=_['merge'](_0x486b4c,{'name':_0x486b4c['fullPath']||_0x486b4c[_0x6eae('0x28')]||_0x486145['name'],'basename':_0x2d7bde,'savename':util[_0x6eae('0x70')](_0x6eae('0x8d'),_0x486b4c['name']||_0x486145['name'],require(_0x6eae('0x8e'))[_0x6eae('0x8f')](0x4),_0x486b4c[_0x6eae('0x8b')]||'csv'),'reportId':_0x486145['id'],'reportType':'custom'});return db[_0x6eae('0x90')][_0x6eae('0x47')](_0x3d9412,{'raw':!![]});})['then'](function(_0x1d639f){if(_0x486145[_0x6eae('0x7b')]===_0x6eae('0x91')){_0x4107f0[_0x6eae('0x38')](_0x486145[_0x6eae('0x7b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x486b4c[_0x6eae('0x92')],_0x486b4c[_0x6eae('0x93')]);}else{_0x4107f0[_0x6eae('0x38')](_0x486145[_0x6eae('0x7b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x486b4c[_0x6eae('0x92')],_0x486b4c[_0x6eae('0x93')]);}if(_0x1d639f){logger[_0x6eae('0x94')](_0x6eae('0x95'),_0x4107f0[_0x6eae('0x80')]());require(_0x6eae('0x96'))[_0x6eae('0x97')](path[_0x6eae('0x83')](__dirname,_0x6eae('0x98'),_0x1d639f['output']),[_0x1d639f['id'],_0x4107f0['toString'](),path[_0x6eae('0x83')](__dirname,_0x6eae('0x99'),_0x1d639f[_0x6eae('0x9a')]),_0x2d7bde]);return _0x1d639f;}else{var _0x20c13c=squel[_0x6eae('0x6c')]();_0x20c13c[_0x6eae('0x89')]('('+_0x4107f0[_0x6eae('0x80')]()+')',_0x6eae('0x9b'));_0x20c13c[_0x6eae('0x66')](_0x6eae('0x9c'),_0x6eae('0x1c'));_0x4107f0['limit'](_0x486b4c[_0x6eae('0x1b')]||_0x4b1992);_0x4107f0[_0x6eae('0x19')](_0x486b4c[_0x6eae('0x19')]||0x0);return dbH[_0x6eae('0x81')][_0x6eae('0x31')](_0x20c13c[_0x6eae('0x80')](),{'type':dbH[_0x6eae('0x81')]['QueryTypes'][_0x6eae('0x82')]})[_0x6eae('0x23')](function(_0x5644f9){if(!_0x5644f9[_0x6eae('0x45')]){_0x708638=0x0;}else{_0x708638=_0x5644f9[0x0][_0x6eae('0x1c')]||0x0;}return dbH[_0x6eae('0x81')]['query'](_0x4107f0[_0x6eae('0x80')](),{'type':dbH[_0x6eae('0x81')][_0x6eae('0x9d')]['SELECT']});})[_0x6eae('0x23')](function(_0x136f3){return{'rows':_0x136f3||[],'count':_0x708638};});}});}exports[_0x6eae('0x9e')]=function(_0x101e3d,_0x2f6a0b){return runReport(_0x101e3d[_0x6eae('0x52')],_0x101e3d[_0x6eae('0x31')],_0x101e3d['options'])[_0x6eae('0x23')](respondWithResult(_0x2f6a0b,null))[_0x6eae('0x43')](handleError(_0x2f6a0b,null));};exports[_0x6eae('0x9f')]=runReport;exports['query']=function(_0x11ff36,_0x33e1ae){var _0xd61c4d=0xa;var _0x1c062d=[_0x6eae('0x83'),_0x6eae('0x53'),_0x6eae('0x54'),'cross_join'];var _0x241c69={'SUM':_0x6eae('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6eae('0x56'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x6eae('0x59'),'GROUP_CONCAT':_0x6eae('0x5a'),'GROUP_CONCAT ASC':_0x6eae('0x86'),'GROUP_CONCAT DESC':_0x6eae('0x5b')};var _0x52aea1={'SEC_TO_TIME':_0x6eae('0x5c'),'DATE':_0x6eae('0x87'),'HOUR':'HOUR(%s)','ROUND':_0x6eae('0xa0'),'UNIX_TIMESTAMP':_0x6eae('0x5e')};var _0x5613e1=function(_0x5cd75c){return!_[_0x6eae('0x5f')]([_0x6eae('0x60'),_0x6eae('0x61'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x5cd75c);};var _0x2483f8=function(_0x2b62d4){if(!_0x2b62d4||!_0x2b62d4[_0x6eae('0x64')][_0x6eae('0x45')]){return'';}for(var _0x4c3a6e='(',_0xd41514=0x0;_0xd41514<_0x2b62d4[_0x6eae('0x64')][_0x6eae('0x45')];_0xd41514+=0x1){_0xd41514>0x0&&(_0x4c3a6e+='\x20'+_0x2b62d4[_0x6eae('0x63')]+'\x20');_0x4c3a6e+=_0x2b62d4[_0x6eae('0x64')][_0xd41514][_0x6eae('0x65')]?_0x2483f8(_0x2b62d4[_0x6eae('0x64')][_0xd41514][_0x6eae('0x65')]):_0x2b62d4[_0x6eae('0x64')][_0xd41514]['field']+'\x20'+_0x2b62d4[_0x6eae('0x64')][_0xd41514][_0x6eae('0x67')]+(_0x5613e1(_0x2b62d4[_0x6eae('0x64')][_0xd41514]['condition'])?'\x20'+_0x2b62d4[_0x6eae('0x64')][_0xd41514]['value']:'');}return _0x4c3a6e+')';};var _0x536252={'where':{'id':_0x11ff36[_0x6eae('0x52')]['id']}},_0x5216e9,_0x456c00,_0xfb2b5a,_0x5ca9d9,_0x127f08;_0x536252=_[_0x6eae('0x3c')]({},_0x536252,_0x11ff36[_0x6eae('0x46')]);return db[_0x6eae('0x2c')][_0x6eae('0x4d')](_0x536252)[_0x6eae('0x23')](function(_0x1df945){if(_0x1df945){_0x5216e9=_0x1df945;return _0x1df945[_0x6eae('0x68')]();}return null;})[_0x6eae('0x23')](function(_0x19097b){if(_0x19097b){if(!_0x19097b[_0x6eae('0x45')]){throw new db[(_0x6eae('0x88'))][(_0x6eae('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x456c00=_0x19097b;return db[_0x6eae('0x6b')][_0x6eae('0x41')]({'raw':!![]});}return null;})[_0x6eae('0x23')](function(_0x45fb75){if(_0x45fb75){_0xfb2b5a=_[_0x6eae('0xa1')](_0x45fb75,'id');var _0x55664e;var _0x249e30=squel[_0x6eae('0x6c')]();_0x249e30[_0x6eae('0x89')](_0x5216e9[_0x6eae('0x7b')]);for(var _0x409207=0x0;_0x409207<_0x456c00[_0x6eae('0x45')];_0x409207+=0x1){_0x55664e=_0x456c00[_0x409207][_0x6eae('0x8a')]?_0xfb2b5a[_0x456c00[_0x409207][_0x6eae('0x8a')]][_0x6eae('0x6d')]:_0x456c00[_0x409207][_0x6eae('0x66')];_0x55664e=_0x456c00[_0x409207][_0x6eae('0x6e')]?_[_0x6eae('0x6f')](_0x241c69[_0x456c00[_0x409207]['function']],'%s',_0x55664e):_0x55664e;_0x55664e=_0x456c00[_0x409207][_0x6eae('0x70')]?_[_0x6eae('0x6f')](_0x52aea1[_0x456c00[_0x409207][_0x6eae('0x70')]],'%s',_0x55664e):_0x55664e;if(_0x456c00[_0x409207][_0x6eae('0x71')]){_0x249e30[_0x6eae('0x65')](_0x55664e);}_0x456c00[_0x409207][_0x6eae('0x72')]&&_0x249e30[_0x6eae('0x36')](_0x55664e,_0x456c00[_0x409207][_0x6eae('0x72')]==='DESC'?![]:!![]);_0x249e30[_0x6eae('0x66')](_0x55664e,_0x456c00[_0x409207][_0x6eae('0x74')]||_0x55664e);}if(_0x5216e9['joins']){_0x5216e9['joins']=JSON[_0x6eae('0x76')](_0x5216e9['joins']);for(var _0x3f7919=0x0;_0x3f7919<_0x5216e9['joins']['length'];_0x3f7919+=0x1){if(_0x5216e9[_0x6eae('0x75')][_0x3f7919]['type']&&_[_0x6eae('0x5f')](_0x1c062d,_0x5216e9[_0x6eae('0x75')][_0x3f7919]['type'])&&_0x5216e9['joins'][_0x3f7919][_0x6eae('0x77')]&&_0x5216e9[_0x6eae('0x75')][_0x3f7919][_0x6eae('0x78')]&&_0x5216e9['joins'][_0x3f7919][_0x6eae('0x79')]){_0x249e30[_0x5216e9[_0x6eae('0x75')][_0x3f7919][_0x6eae('0x3d')]](_0x5216e9['joins'][_0x3f7919]['foreignTable'],null,util[_0x6eae('0x70')](_0x6eae('0x7a'),_0x5216e9[_0x6eae('0x7b')],_0x5216e9[_0x6eae('0x75')][_0x3f7919][_0x6eae('0x77')],_0x5216e9[_0x6eae('0x75')][_0x3f7919][_0x6eae('0x78')],_0x5216e9[_0x6eae('0x75')][_0x3f7919][_0x6eae('0x79')]));}}}if(_0x5216e9['conditions']){_0x5216e9[_0x6eae('0x7c')]=JSON[_0x6eae('0x76')](_0x5216e9[_0x6eae('0x7c')]);_0x249e30['where'](_0x2483f8(_0x5216e9[_0x6eae('0x7c')][_0x6eae('0x65')]));}_0x127f08=_0x249e30[_0x6eae('0x7d')]();_0x249e30[_0x6eae('0x1b')](_0xd61c4d);_0x249e30[_0x6eae('0x19')](0x0);logger[_0x6eae('0x7e')](_0x6eae('0x7f'),_0x249e30[_0x6eae('0x80')]());return dbH[_0x6eae('0x81')][_0x6eae('0x31')](_0x249e30['toString'](),{'type':dbH[_0x6eae('0x81')][_0x6eae('0x9d')][_0x6eae('0x82')]});}})['then'](function(){return{'sql':_0x127f08[_0x6eae('0x80')]()};})[_0x6eae('0x23')](respondWithResult(_0x33e1ae,null))[_0x6eae('0x43')](handleError(_0x33e1ae,null));}; \ No newline at end of file +var _0x1d28=['IS\x20NOT\x20NULL','condition','getFields','from','alias','output','web','fullPath','randomstring','generate','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','cross_join','AVG(%s)','Limited\x20Query:','eml-format','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','../../config/environment','../../config/license/util','dbH','sendStatus','status','json','offset','count','set','Content-Range','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','end','error','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','fields','length','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','metric','field','replace','function','format','groupBy','orderBy','DESC','parse','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','debug','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)'];(function(_0x3b4af6,_0x1072a7){var _0x3ddbbc=function(_0x2bbd9f){while(--_0x2bbd9f){_0x3b4af6['push'](_0x3b4af6['shift']());}};_0x3ddbbc(++_0x1072a7);}(_0x1d28,0x164));var _0x81d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d28[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x81d2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x81d2('0x1'));var rp=require(_0x81d2('0x2'));var moment=require(_0x81d2('0x3'));var BPromise=require(_0x81d2('0x4'));var Mustache=require(_0x81d2('0x5'));var util=require(_0x81d2('0x6'));var path=require(_0x81d2('0x7'));var sox=require(_0x81d2('0x8'));var csv=require('to-csv');var ejs=require(_0x81d2('0x9'));var fs=require('fs');var fs_extra=require(_0x81d2('0xa'));var _=require(_0x81d2('0xb'));var squel=require(_0x81d2('0xc'));var crypto=require(_0x81d2('0xd'));var jsforce=require(_0x81d2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x81d2('0xf'));var querystring=require(_0x81d2('0x10'));var Papa=require(_0x81d2('0x11'));var Redis=require(_0x81d2('0x12'));var authService=require(_0x81d2('0x13'));var qs=require(_0x81d2('0x14'));var as=require(_0x81d2('0x15'));var hardwareService=require(_0x81d2('0x16'));var logger=require(_0x81d2('0x17'))(_0x81d2('0x18'));var utils=require(_0x81d2('0x19'));var config=require(_0x81d2('0x1a'));var licenseUtil=require(_0x81d2('0x1b'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x81d2('0x1c')];function respondWithStatusCode(_0x2b2116,_0x578ced){_0x578ced=_0x578ced||0xcc;return function(_0x2b41a7){if(_0x2b41a7){return _0x2b2116[_0x81d2('0x1d')](_0x578ced);}return _0x2b2116[_0x81d2('0x1e')](_0x578ced)['end']();};}function respondWithResult(_0x203893,_0x1da13f){_0x1da13f=_0x1da13f||0xc8;return function(_0x1b4c19){if(_0x1b4c19){return _0x203893[_0x81d2('0x1e')](_0x1da13f)[_0x81d2('0x1f')](_0x1b4c19);}};}function respondWithFilteredResult(_0xe362d2,_0x57b507){return function(_0x2429fe){if(_0x2429fe){var _0x9123a3=typeof _0x57b507[_0x81d2('0x20')]==='undefined'&&typeof _0x57b507['limit']==='undefined';var _0x40b23f=_0x2429fe[_0x81d2('0x21')];var _0x376ae2=_0x9123a3?0x0:_0x57b507['offset'];var _0x33bdb3=_0x9123a3?_0x2429fe[_0x81d2('0x21')]:_0x57b507[_0x81d2('0x20')]+_0x57b507['limit'];var _0x4a0816;if(_0x33bdb3>=_0x40b23f){_0x33bdb3=_0x40b23f;_0x4a0816=0xc8;}else{_0x4a0816=0xce;}_0xe362d2[_0x81d2('0x1e')](_0x4a0816);return _0xe362d2[_0x81d2('0x22')](_0x81d2('0x23'),_0x376ae2+'-'+_0x33bdb3+'/'+_0x40b23f)['json'](_0x2429fe);}return null;};}function patchUpdates(_0x271853){return function(_0x3f4ac8){try{jsonpatch[_0x81d2('0x24')](_0x3f4ac8,_0x271853,!![]);}catch(_0x54395f){return BPromise[_0x81d2('0x25')](_0x54395f);}return _0x3f4ac8[_0x81d2('0x26')]();};}function saveUpdates(_0x2634c8,_0x1f77d2){return function(_0x39cabc){if(_0x39cabc){return _0x39cabc['update'](_0x2634c8)[_0x81d2('0x27')](function(_0x18cf0c){return _0x18cf0c;});}return null;};}function removeEntity(_0x58e64b,_0x144077){return function(_0x3be692){if(_0x3be692){return _0x3be692[_0x81d2('0x28')]()[_0x81d2('0x27')](function(){var _0x110d24=_0x3be692[_0x81d2('0x29')]({'plain':!![]});var _0x3ac6d2=_0x81d2('0x2a');return db[_0x81d2('0x2b')][_0x81d2('0x28')]({'where':{'type':_0x3ac6d2,'resourceId':_0x110d24['id']}})[_0x81d2('0x27')](function(){return _0x3be692;});})[_0x81d2('0x27')](function(){_0x58e64b[_0x81d2('0x1e')](0xcc)[_0x81d2('0x2c')]();});}};}function handleEntityNotFound(_0x45a614,_0x1b10ce){return function(_0x312371){if(!_0x312371){_0x45a614[_0x81d2('0x1d')](0x194);}return _0x312371;};}function handleError(_0x1032ad,_0x822fc6){_0x822fc6=_0x822fc6||0x1f4;return function(_0x2a187a){logger[_0x81d2('0x2d')](_0x2a187a['stack']);if(_0x2a187a[_0x81d2('0x2e')]){delete _0x2a187a[_0x81d2('0x2e')];}_0x1032ad[_0x81d2('0x1e')](_0x822fc6)[_0x81d2('0x2f')](_0x2a187a);};}exports['index']=function(_0x5bcb8a,_0x377afd){var _0x4bdcbb={},_0x29bf46={},_0x5d6bb1={'count':0x0,'rows':[]};var _0x26cdf6=_[_0x81d2('0x30')](db['AnalyticCustomReport'][_0x81d2('0x31')],function(_0x27a247){return{'name':_0x27a247['fieldName'],'type':_0x27a247[_0x81d2('0x32')][_0x81d2('0x33')]};});_0x29bf46[_0x81d2('0x34')]=_[_0x81d2('0x30')](_0x26cdf6,'name');_0x29bf46[_0x81d2('0x35')]=_[_0x81d2('0x36')](_0x5bcb8a[_0x81d2('0x35')]);_0x29bf46[_0x81d2('0x37')]=_[_0x81d2('0x38')](_0x29bf46['model'],_0x29bf46[_0x81d2('0x35')]);_0x4bdcbb[_0x81d2('0x39')]=_[_0x81d2('0x38')](_0x29bf46[_0x81d2('0x34')],qs['fields'](_0x5bcb8a[_0x81d2('0x35')]['fields']));_0x4bdcbb['attributes']=_0x4bdcbb['attributes']['length']?_0x4bdcbb[_0x81d2('0x39')]:_0x29bf46['model'];if(!_0x5bcb8a[_0x81d2('0x35')][_0x81d2('0x3a')](_0x81d2('0x3b'))){_0x4bdcbb[_0x81d2('0x3c')]=qs['limit'](_0x5bcb8a[_0x81d2('0x35')][_0x81d2('0x3c')]);_0x4bdcbb['offset']=qs['offset'](_0x5bcb8a['query'][_0x81d2('0x20')]);}_0x4bdcbb[_0x81d2('0x3d')]=qs[_0x81d2('0x3e')](_0x5bcb8a[_0x81d2('0x35')][_0x81d2('0x3e')]);_0x4bdcbb[_0x81d2('0x3f')]=qs['filters'](_[_0x81d2('0x40')](_0x5bcb8a[_0x81d2('0x35')],_0x29bf46[_0x81d2('0x37')]),_0x26cdf6);if(_0x5bcb8a['query']['filter']){_0x4bdcbb[_0x81d2('0x3f')]=_[_0x81d2('0x41')](_0x4bdcbb[_0x81d2('0x3f')],{'$or':_[_0x81d2('0x30')](_0x26cdf6,function(_0x86c4d){if(_0x86c4d[_0x81d2('0x32')]!=='VIRTUAL'){var _0x406963={};_0x406963[_0x86c4d[_0x81d2('0x2e')]]={'$like':'%'+_0x5bcb8a[_0x81d2('0x35')][_0x81d2('0x42')]+'%'};return _0x406963;}})});}_0x4bdcbb=_[_0x81d2('0x41')]({},_0x4bdcbb,_0x5bcb8a[_0x81d2('0x43')]);var _0x3b9f76={'where':_0x4bdcbb[_0x81d2('0x3f')]};return db[_0x81d2('0x44')][_0x81d2('0x21')](_0x3b9f76)['then'](function(_0x13996d){_0x5d6bb1[_0x81d2('0x21')]=_0x13996d;if(_0x5bcb8a['query'][_0x81d2('0x45')]){_0x4bdcbb[_0x81d2('0x46')]=[{'all':!![]}];}return db[_0x81d2('0x44')][_0x81d2('0x47')](_0x4bdcbb);})[_0x81d2('0x27')](function(_0x594c47){_0x5d6bb1[_0x81d2('0x48')]=_0x594c47;return _0x5d6bb1;})[_0x81d2('0x27')](respondWithFilteredResult(_0x377afd,_0x4bdcbb))[_0x81d2('0x49')](handleError(_0x377afd,null));};exports[_0x81d2('0x4a')]=function(_0x5bb195,_0x2896d0){var _0x1c858a={'raw':![],'where':{'id':_0x5bb195[_0x81d2('0x4b')]['id']}},_0x466c11={};_0x466c11['model']=_[_0x81d2('0x36')](db[_0x81d2('0x44')][_0x81d2('0x31')]);_0x466c11[_0x81d2('0x35')]=_[_0x81d2('0x36')](_0x5bb195[_0x81d2('0x35')]);_0x466c11[_0x81d2('0x37')]=_[_0x81d2('0x38')](_0x466c11[_0x81d2('0x34')],_0x466c11['query']);_0x1c858a[_0x81d2('0x39')]=_[_0x81d2('0x38')](_0x466c11[_0x81d2('0x34')],qs['fields'](_0x5bb195['query'][_0x81d2('0x4c')]));_0x1c858a['attributes']=_0x1c858a[_0x81d2('0x39')][_0x81d2('0x4d')]?_0x1c858a[_0x81d2('0x39')]:_0x466c11[_0x81d2('0x34')];if(_0x5bb195[_0x81d2('0x35')]['includeAll']){_0x1c858a[_0x81d2('0x46')]=[{'all':!![]}];}_0x1c858a=_[_0x81d2('0x41')]({},_0x1c858a,_0x5bb195[_0x81d2('0x43')]);return db['AnalyticCustomReport'][_0x81d2('0x4e')](_0x1c858a)[_0x81d2('0x27')](handleEntityNotFound(_0x2896d0,null))[_0x81d2('0x27')](respondWithResult(_0x2896d0,null))['catch'](handleError(_0x2896d0,null));};exports['create']=function(_0xa294b2,_0x5cdf10){return db[_0x81d2('0x44')]['create'](_0xa294b2[_0x81d2('0x4f')],{})[_0x81d2('0x27')](function(_0x3b2228){var _0x26a06c=_0xa294b2['user'][_0x81d2('0x29')]({'plain':!![]});if(!_0x26a06c)throw new Error(_0x81d2('0x50'));if(_0x26a06c[_0x81d2('0x51')]==='user'){var _0x5b2ad0=_0x3b2228['get']({'plain':!![]});var _0x29cc0b=_0x81d2('0x52');return db[_0x81d2('0x53')][_0x81d2('0x4e')]({'where':{'name':_0x29cc0b,'userProfileId':_0x26a06c['userProfileId']},'raw':!![]})[_0x81d2('0x27')](function(_0x30aef7){if(_0x30aef7&&_0x30aef7['autoAssociation']===0x0){return db[_0x81d2('0x2b')][_0x81d2('0x54')]({'name':_0x5b2ad0[_0x81d2('0x2e')],'resourceId':_0x5b2ad0['id'],'type':'CustomReports','sectionId':_0x30aef7['id']},{})[_0x81d2('0x27')](function(){return _0x3b2228;});}else{return _0x3b2228;}})[_0x81d2('0x49')](function(_0xa0bc4a){logger[_0x81d2('0x2d')](_0x81d2('0x55'),_0xa0bc4a);throw _0xa0bc4a;});}return _0x3b2228;})[_0x81d2('0x27')](respondWithResult(_0x5cdf10,0xc9))[_0x81d2('0x49')](handleError(_0x5cdf10,null));};exports[_0x81d2('0x56')]=function(_0x342489,_0x572e9b){if(_0x342489[_0x81d2('0x4f')]['id']){delete _0x342489['body']['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x342489[_0x81d2('0x4b')]['id']}})[_0x81d2('0x27')](handleEntityNotFound(_0x572e9b,null))[_0x81d2('0x27')](saveUpdates(_0x342489['body'],null))[_0x81d2('0x27')](respondWithResult(_0x572e9b,null))[_0x81d2('0x49')](handleError(_0x572e9b,null));};exports[_0x81d2('0x28')]=function(_0x3b626c,_0xcb25b){return db[_0x81d2('0x44')][_0x81d2('0x4e')]({'where':{'id':_0x3b626c[_0x81d2('0x4b')]['id']}})[_0x81d2('0x27')](handleEntityNotFound(_0xcb25b,null))[_0x81d2('0x27')](removeEntity(_0xcb25b,null))[_0x81d2('0x49')](handleError(_0xcb25b,null));};exports['preview']=function(_0x552ef2,_0x2bd249){var _0x422a26=0xa;var _0x2322de=[_0x81d2('0x57'),'left_join',_0x81d2('0x58'),'cross_join'];var _0x587790={'SUM':_0x81d2('0x59'),'COUNT':_0x81d2('0x5a'),'COUNT DISTINCT':_0x81d2('0x5b'),'MAX':_0x81d2('0x5c'),'MIN':_0x81d2('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x81d2('0x5e'),'GROUP_CONCAT ASC':_0x81d2('0x5f'),'GROUP_CONCAT DESC':_0x81d2('0x60')};var _0x27d6ee={'SEC_TO_TIME':_0x81d2('0x61'),'DATE':_0x81d2('0x62'),'HOUR':'HOUR(%s)','ROUND':_0x81d2('0x63'),'UNIX_TIMESTAMP':_0x81d2('0x64')};var _0x2856a7=function(_0x21a7dc){return!_[_0x81d2('0x65')]([_0x81d2('0x66'),'IS\x20NOT\x20NULL',_0x81d2('0x67'),_0x81d2('0x68')],_0x21a7dc);};var _0x5598b1=function(_0x1a9f10){if(!_0x1a9f10||!_0x1a9f10[_0x81d2('0x69')]['length']){return'';}for(var _0x257a7b='(',_0x36ca00=0x0;_0x36ca00<_0x1a9f10[_0x81d2('0x69')][_0x81d2('0x4d')];_0x36ca00+=0x1){_0x36ca00>0x0&&(_0x257a7b+='\x20'+_0x1a9f10[_0x81d2('0x6a')]+'\x20');_0x257a7b+=_0x1a9f10[_0x81d2('0x69')][_0x36ca00][_0x81d2('0x6b')]?_0x5598b1(_0x1a9f10[_0x81d2('0x69')][_0x36ca00][_0x81d2('0x6b')]):_0x1a9f10[_0x81d2('0x69')][_0x36ca00]['field']+'\x20'+_0x1a9f10[_0x81d2('0x69')][_0x36ca00]['condition']+(_0x2856a7(_0x1a9f10[_0x81d2('0x69')][_0x36ca00]['condition'])?'\x20'+_0x1a9f10[_0x81d2('0x69')][_0x36ca00][_0x81d2('0x6c')]:'');}return _0x257a7b+')';};var _0x17f778={'where':{'id':_0x552ef2[_0x81d2('0x4b')]['id']}},_0x399e4a,_0x473178,_0x4ceba6,_0x56bc32,_0x47b660;_0x17f778=_[_0x81d2('0x41')]({},_0x17f778,_0x552ef2[_0x81d2('0x43')]);return db[_0x81d2('0x44')][_0x81d2('0x4e')](_0x17f778)['then'](function(_0x27c8a2){if(_0x27c8a2){_0x399e4a=_0x27c8a2;return _0x27c8a2['getFields']();}return null;})['then'](function(_0x46426f){if(_0x46426f){if(!_0x46426f[_0x81d2('0x4d')]){throw new db[(_0x81d2('0x6d'))][(_0x81d2('0x6e'))](_0x81d2('0x6f'),0x193);}_0x473178=_0x46426f;return db[_0x81d2('0x70')][_0x81d2('0x47')]({'raw':!![]});}return null;})['then'](function(_0x202d67){if(_0x202d67){_0x4ceba6=_[_0x81d2('0x71')](_0x202d67,'id');var _0x5ef9a6;var _0x39f6b0=squel[_0x81d2('0x72')]();_0x39f6b0['from'](_0x399e4a['table']);for(var _0x3375b9=0x0;_0x3375b9<_0x473178[_0x81d2('0x4d')];_0x3375b9+=0x1){_0x5ef9a6=_0x473178[_0x3375b9][_0x81d2('0x73')]?_0x4ceba6[_0x473178[_0x3375b9]['MetricId']][_0x81d2('0x74')]:_0x473178[_0x3375b9][_0x81d2('0x75')];_0x5ef9a6=_0x473178[_0x3375b9]['function']?_[_0x81d2('0x76')](_0x587790[_0x473178[_0x3375b9][_0x81d2('0x77')]],'%s',_0x5ef9a6):_0x5ef9a6;_0x5ef9a6=_0x473178[_0x3375b9][_0x81d2('0x78')]?_[_0x81d2('0x76')](_0x27d6ee[_0x473178[_0x3375b9][_0x81d2('0x78')]],'%s',_0x5ef9a6):_0x5ef9a6;if(_0x473178[_0x3375b9][_0x81d2('0x79')]){_0x39f6b0[_0x81d2('0x6b')](_0x5ef9a6);}_0x473178[_0x3375b9][_0x81d2('0x7a')]&&_0x39f6b0['order'](_0x5ef9a6,_0x473178[_0x3375b9][_0x81d2('0x7a')]===_0x81d2('0x7b')?![]:!![]);_0x39f6b0['field'](_0x5ef9a6,_0x473178[_0x3375b9]['alias']||_0x5ef9a6);}if(_0x399e4a['joins']){_0x399e4a['joins']=JSON[_0x81d2('0x7c')](_0x399e4a['joins']);for(var _0x14e906=0x0;_0x14e906<_0x399e4a[_0x81d2('0x7d')][_0x81d2('0x4d')];_0x14e906+=0x1){if(_0x399e4a[_0x81d2('0x7d')][_0x14e906][_0x81d2('0x32')]&&_['includes'](_0x2322de,_0x399e4a[_0x81d2('0x7d')][_0x14e906]['type'])&&_0x399e4a[_0x81d2('0x7d')][_0x14e906][_0x81d2('0x7e')]&&_0x399e4a['joins'][_0x14e906][_0x81d2('0x7f')]&&_0x399e4a[_0x81d2('0x7d')][_0x14e906]['foreignKey']){_0x39f6b0[_0x399e4a[_0x81d2('0x7d')][_0x14e906]['type']](_0x399e4a[_0x81d2('0x7d')][_0x14e906]['foreignTable'],null,util[_0x81d2('0x78')](_0x81d2('0x80'),_0x399e4a[_0x81d2('0x81')],_0x399e4a[_0x81d2('0x7d')][_0x14e906]['parentKey'],_0x399e4a[_0x81d2('0x7d')][_0x14e906][_0x81d2('0x7f')],_0x399e4a['joins'][_0x14e906][_0x81d2('0x82')]));}}}if(_0x399e4a['conditions']){_0x399e4a[_0x81d2('0x83')]=JSON[_0x81d2('0x7c')](_0x399e4a[_0x81d2('0x83')]);_0x39f6b0[_0x81d2('0x3f')](_0x5598b1(_0x399e4a[_0x81d2('0x83')][_0x81d2('0x6b')]));}_0x47b660=_0x39f6b0['clone']();_0x39f6b0[_0x81d2('0x3c')](_0x422a26);_0x39f6b0[_0x81d2('0x20')](0x0);logger[_0x81d2('0x84')]('Limited\x20Query:',_0x39f6b0[_0x81d2('0x85')]());return dbH[_0x81d2('0x86')][_0x81d2('0x35')](_0x39f6b0[_0x81d2('0x85')](),{'type':dbH[_0x81d2('0x86')][_0x81d2('0x87')][_0x81d2('0x88')]});}})[_0x81d2('0x27')](respondWithResult(_0x2bd249,null))[_0x81d2('0x49')](handleError(_0x2bd249,null));};function runReport(_0x5689fe,_0x6a80ae,_0x59b42d){var _0x4b2573=_0x6a80ae[_0x81d2('0x2e')];var _0x397b35=0xa;var _0x3ea460=[_0x81d2('0x57'),_0x81d2('0x89'),'right_join','cross_join'];var _0x4c01da={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x81d2('0x5b'),'MAX':_0x81d2('0x5c'),'MIN':_0x81d2('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x81d2('0x5e'),'GROUP_CONCAT ASC':_0x81d2('0x5f'),'GROUP_CONCAT DESC':_0x81d2('0x60')};var _0x9ceb51={'SEC_TO_TIME':_0x81d2('0x61'),'DATE':'DATE(%s)','HOUR':_0x81d2('0x8a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x81d2('0x64')};var _0x3aea4b=function(_0x122e5b){return!_[_0x81d2('0x65')]([_0x81d2('0x66'),_0x81d2('0x8b'),_0x81d2('0x67'),_0x81d2('0x68')],_0x122e5b);};var _0xfea347=function(_0x293838){if(!_0x293838||!_0x293838[_0x81d2('0x69')][_0x81d2('0x4d')]){return'';}for(var _0x37a740='(',_0x475fdb=0x0;_0x475fdb<_0x293838['rules'][_0x81d2('0x4d')];_0x475fdb+=0x1){_0x475fdb>0x0&&(_0x37a740+='\x20'+_0x293838[_0x81d2('0x6a')]+'\x20');_0x37a740+=_0x293838[_0x81d2('0x69')][_0x475fdb][_0x81d2('0x6b')]?_0xfea347(_0x293838['rules'][_0x475fdb][_0x81d2('0x6b')]):_0x293838[_0x81d2('0x69')][_0x475fdb][_0x81d2('0x75')]+'\x20'+_0x293838['rules'][_0x475fdb][_0x81d2('0x8c')]+(_0x3aea4b(_0x293838[_0x81d2('0x69')][_0x475fdb][_0x81d2('0x8c')])?'\x20'+_0x293838[_0x81d2('0x69')][_0x475fdb]['value']:'');}return _0x37a740+')';};var _0x314f23={'where':{'id':_0x5689fe['id']}},_0x3b4e4a,_0x2820af,_0xaf2d0f,_0x8203ae,_0xd72e0c;_0x314f23=_[_0x81d2('0x41')]({},_0x314f23,_0x59b42d);return db[_0x81d2('0x44')][_0x81d2('0x4e')](_0x314f23)['then'](function(_0x2a7309){if(_0x2a7309){_0x3b4e4a=_0x2a7309;return _0x2a7309[_0x81d2('0x8d')]();}return null;})[_0x81d2('0x27')](function(_0x4fc13e){if(_0x4fc13e){if(!_0x4fc13e[_0x81d2('0x4d')]){throw new db[(_0x81d2('0x6d'))][(_0x81d2('0x6e'))](_0x81d2('0x6f'),0x193);}_0x2820af=_0x4fc13e;return db[_0x81d2('0x70')][_0x81d2('0x47')]({'raw':!![]});}return null;})[_0x81d2('0x27')](function(_0x1b2705){if(_0x1b2705){_0xaf2d0f=_['keyBy'](_0x1b2705,'id');var _0x471a34;var _0x4f6ab6=squel['select']();_0x4f6ab6[_0x81d2('0x8e')](_0x3b4e4a['table']);for(var _0x1c90b4=0x0;_0x1c90b4<_0x2820af[_0x81d2('0x4d')];_0x1c90b4+=0x1){_0x471a34=_0x2820af[_0x1c90b4]['MetricId']?_0xaf2d0f[_0x2820af[_0x1c90b4][_0x81d2('0x73')]][_0x81d2('0x74')]:_0x2820af[_0x1c90b4]['field'];_0x471a34=_0x2820af[_0x1c90b4][_0x81d2('0x77')]?_[_0x81d2('0x76')](_0x4c01da[_0x2820af[_0x1c90b4]['function']],'%s',_0x471a34):_0x471a34;_0x471a34=_0x2820af[_0x1c90b4][_0x81d2('0x78')]?_[_0x81d2('0x76')](_0x9ceb51[_0x2820af[_0x1c90b4]['format']],'%s',_0x471a34):_0x471a34;if(_0x2820af[_0x1c90b4][_0x81d2('0x79')]){_0x4f6ab6[_0x81d2('0x6b')](_0x471a34);}_0x2820af[_0x1c90b4][_0x81d2('0x7a')]&&_0x4f6ab6[_0x81d2('0x3d')](_0x471a34,_0x2820af[_0x1c90b4]['orderBy']==='DESC'?![]:!![]);_0x4f6ab6['field'](_0x471a34,_0x2820af[_0x1c90b4][_0x81d2('0x8f')]||_0x471a34);}if(_0x3b4e4a[_0x81d2('0x7d')]){_0x3b4e4a['joins']=JSON[_0x81d2('0x7c')](_0x3b4e4a[_0x81d2('0x7d')]);for(var _0x3e37e3=0x0;_0x3e37e3<_0x3b4e4a[_0x81d2('0x7d')][_0x81d2('0x4d')];_0x3e37e3+=0x1){if(_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3]['type']&&_[_0x81d2('0x65')](_0x3ea460,_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3]['type'])&&_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3][_0x81d2('0x7e')]&&_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3][_0x81d2('0x7f')]&&_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3][_0x81d2('0x82')]){_0x4f6ab6[_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3][_0x81d2('0x32')]](_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3][_0x81d2('0x7f')],null,util[_0x81d2('0x78')](_0x81d2('0x80'),_0x3b4e4a[_0x81d2('0x81')],_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3][_0x81d2('0x7e')],_0x3b4e4a['joins'][_0x3e37e3][_0x81d2('0x7f')],_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3][_0x81d2('0x82')]));}}}if(_0x3b4e4a[_0x81d2('0x83')]){_0x3b4e4a[_0x81d2('0x83')]=JSON['parse'](_0x3b4e4a[_0x81d2('0x83')]);_0x4f6ab6['where'](_0xfea347(_0x3b4e4a[_0x81d2('0x83')]['group']));}_0xd72e0c=_0x4f6ab6['clone']();_0x4f6ab6[_0x81d2('0x3c')](_0x397b35);_0x4f6ab6[_0x81d2('0x20')](0x0);return;}})[_0x81d2('0x27')](function(){if(_0x6a80ae[_0x81d2('0x90')]===_0x81d2('0x91')){return null;}var _0x172b3c=_['merge'](_0x6a80ae,{'name':_0x6a80ae[_0x81d2('0x92')]||_0x6a80ae[_0x81d2('0x2e')]||_0x3b4e4a[_0x81d2('0x2e')],'basename':_0x4b2573,'savename':util['format']('%s-%s.%s',_0x6a80ae[_0x81d2('0x2e')]||_0x3b4e4a['name'],require(_0x81d2('0x93'))[_0x81d2('0x94')](0x4),_0x6a80ae[_0x81d2('0x90')]||'csv'),'reportId':_0x3b4e4a['id'],'reportType':'custom'});return db[_0x81d2('0x95')][_0x81d2('0x54')](_0x172b3c,{'raw':!![]});})[_0x81d2('0x27')](function(_0x2a5402){if(_0x3b4e4a['table']===_0x81d2('0x96')){_0xd72e0c[_0x81d2('0x3f')](_0x3b4e4a[_0x81d2('0x81')]+_0x81d2('0x97'),_0x6a80ae[_0x81d2('0x98')],_0x6a80ae[_0x81d2('0x99')]);}else{_0xd72e0c['where'](_0x3b4e4a['table']+_0x81d2('0x9a'),_0x6a80ae[_0x81d2('0x98')],_0x6a80ae[_0x81d2('0x99')]);}if(_0x2a5402){logger[_0x81d2('0x9b')]('Run\x20Query:',_0xd72e0c['toString']());require(_0x81d2('0x9c'))[_0x81d2('0x9d')](path[_0x81d2('0x57')](__dirname,_0x81d2('0x9e'),_0x2a5402[_0x81d2('0x90')]),[_0x2a5402['id'],_0xd72e0c[_0x81d2('0x85')](),path['join'](__dirname,'../../files/reports',_0x2a5402[_0x81d2('0x9f')]),_0x4b2573]);return _0x2a5402;}else{var _0x7b3448=squel[_0x81d2('0x72')]();_0x7b3448[_0x81d2('0x8e')]('('+_0xd72e0c[_0x81d2('0x85')]()+')',_0x81d2('0xa0'));_0x7b3448['field'](_0x81d2('0xa1'),_0x81d2('0x21'));_0xd72e0c['limit'](_0x6a80ae[_0x81d2('0x3c')]||_0x397b35);_0xd72e0c[_0x81d2('0x20')](_0x6a80ae[_0x81d2('0x20')]||0x0);return dbH['sequelize'][_0x81d2('0x35')](_0x7b3448[_0x81d2('0x85')](),{'type':dbH[_0x81d2('0x86')]['QueryTypes']['SELECT']})[_0x81d2('0x27')](function(_0x1dca58){if(!_0x1dca58[_0x81d2('0x4d')]){_0x8203ae=0x0;}else{_0x8203ae=_0x1dca58[0x0]['count']||0x0;}return dbH[_0x81d2('0x86')][_0x81d2('0x35')](_0xd72e0c['toString'](),{'type':dbH[_0x81d2('0x86')]['QueryTypes'][_0x81d2('0x88')]});})[_0x81d2('0x27')](function(_0x4dd243){return{'rows':_0x4dd243||[],'count':_0x8203ae};});}});}exports['run']=function(_0x48dd96,_0x3594b4){return runReport(_0x48dd96['params'],_0x48dd96[_0x81d2('0x35')],_0x48dd96[_0x81d2('0x43')])[_0x81d2('0x27')](respondWithResult(_0x3594b4,null))['catch'](handleError(_0x3594b4,null));};exports['runReport']=runReport;exports[_0x81d2('0x35')]=function(_0x26123d,_0x2fd2bf){var _0x446228=0xa;var _0x47bc65=[_0x81d2('0x57'),'left_join',_0x81d2('0x58'),_0x81d2('0xa2')];var _0x4a2c48={'SUM':_0x81d2('0x59'),'COUNT':_0x81d2('0x5a'),'COUNT DISTINCT':_0x81d2('0x5b'),'MAX':_0x81d2('0x5c'),'MIN':_0x81d2('0x5d'),'AVG':_0x81d2('0xa3'),'GROUP_CONCAT':_0x81d2('0x5e'),'GROUP_CONCAT ASC':_0x81d2('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4235a8={'SEC_TO_TIME':_0x81d2('0x61'),'DATE':_0x81d2('0x62'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x81d2('0x64')};var _0x149ec6=function(_0xd96412){return!_[_0x81d2('0x65')]([_0x81d2('0x66'),_0x81d2('0x8b'),_0x81d2('0x67'),_0x81d2('0x68')],_0xd96412);};var _0x5788d2=function(_0x268b53){if(!_0x268b53||!_0x268b53['rules'][_0x81d2('0x4d')]){return'';}for(var _0x545d1a='(',_0xb074c8=0x0;_0xb074c8<_0x268b53['rules'][_0x81d2('0x4d')];_0xb074c8+=0x1){_0xb074c8>0x0&&(_0x545d1a+='\x20'+_0x268b53[_0x81d2('0x6a')]+'\x20');_0x545d1a+=_0x268b53[_0x81d2('0x69')][_0xb074c8][_0x81d2('0x6b')]?_0x5788d2(_0x268b53['rules'][_0xb074c8]['group']):_0x268b53[_0x81d2('0x69')][_0xb074c8][_0x81d2('0x75')]+'\x20'+_0x268b53[_0x81d2('0x69')][_0xb074c8]['condition']+(_0x149ec6(_0x268b53[_0x81d2('0x69')][_0xb074c8][_0x81d2('0x8c')])?'\x20'+_0x268b53['rules'][_0xb074c8]['value']:'');}return _0x545d1a+')';};var _0xb0ed13={'where':{'id':_0x26123d[_0x81d2('0x4b')]['id']}},_0x451704,_0x30f059,_0x4598df,_0x28ecfe,_0x1282ba;_0xb0ed13=_[_0x81d2('0x41')]({},_0xb0ed13,_0x26123d[_0x81d2('0x43')]);return db[_0x81d2('0x44')]['find'](_0xb0ed13)[_0x81d2('0x27')](function(_0x4808c1){if(_0x4808c1){_0x451704=_0x4808c1;return _0x4808c1[_0x81d2('0x8d')]();}return null;})[_0x81d2('0x27')](function(_0x77b719){if(_0x77b719){if(!_0x77b719[_0x81d2('0x4d')]){throw new db[(_0x81d2('0x6d'))]['ValidationErrorItem'](_0x81d2('0x6f'),0x193);}_0x30f059=_0x77b719;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x81d2('0x27')](function(_0x28ea5b){if(_0x28ea5b){_0x4598df=_['keyBy'](_0x28ea5b,'id');var _0x3d3b3d;var _0x267853=squel[_0x81d2('0x72')]();_0x267853[_0x81d2('0x8e')](_0x451704[_0x81d2('0x81')]);for(var _0x5b7601=0x0;_0x5b7601<_0x30f059[_0x81d2('0x4d')];_0x5b7601+=0x1){_0x3d3b3d=_0x30f059[_0x5b7601][_0x81d2('0x73')]?_0x4598df[_0x30f059[_0x5b7601][_0x81d2('0x73')]][_0x81d2('0x74')]:_0x30f059[_0x5b7601][_0x81d2('0x75')];_0x3d3b3d=_0x30f059[_0x5b7601][_0x81d2('0x77')]?_[_0x81d2('0x76')](_0x4a2c48[_0x30f059[_0x5b7601][_0x81d2('0x77')]],'%s',_0x3d3b3d):_0x3d3b3d;_0x3d3b3d=_0x30f059[_0x5b7601][_0x81d2('0x78')]?_[_0x81d2('0x76')](_0x4235a8[_0x30f059[_0x5b7601][_0x81d2('0x78')]],'%s',_0x3d3b3d):_0x3d3b3d;if(_0x30f059[_0x5b7601][_0x81d2('0x79')]){_0x267853[_0x81d2('0x6b')](_0x3d3b3d);}_0x30f059[_0x5b7601]['orderBy']&&_0x267853['order'](_0x3d3b3d,_0x30f059[_0x5b7601]['orderBy']===_0x81d2('0x7b')?![]:!![]);_0x267853[_0x81d2('0x75')](_0x3d3b3d,_0x30f059[_0x5b7601][_0x81d2('0x8f')]||_0x3d3b3d);}if(_0x451704[_0x81d2('0x7d')]){_0x451704[_0x81d2('0x7d')]=JSON['parse'](_0x451704[_0x81d2('0x7d')]);for(var _0x5ec9f3=0x0;_0x5ec9f3<_0x451704[_0x81d2('0x7d')][_0x81d2('0x4d')];_0x5ec9f3+=0x1){if(_0x451704['joins'][_0x5ec9f3][_0x81d2('0x32')]&&_[_0x81d2('0x65')](_0x47bc65,_0x451704['joins'][_0x5ec9f3][_0x81d2('0x32')])&&_0x451704['joins'][_0x5ec9f3][_0x81d2('0x7e')]&&_0x451704[_0x81d2('0x7d')][_0x5ec9f3][_0x81d2('0x7f')]&&_0x451704['joins'][_0x5ec9f3][_0x81d2('0x82')]){_0x267853[_0x451704[_0x81d2('0x7d')][_0x5ec9f3][_0x81d2('0x32')]](_0x451704[_0x81d2('0x7d')][_0x5ec9f3][_0x81d2('0x7f')],null,util[_0x81d2('0x78')](_0x81d2('0x80'),_0x451704['table'],_0x451704[_0x81d2('0x7d')][_0x5ec9f3][_0x81d2('0x7e')],_0x451704['joins'][_0x5ec9f3]['foreignTable'],_0x451704[_0x81d2('0x7d')][_0x5ec9f3][_0x81d2('0x82')]));}}}if(_0x451704[_0x81d2('0x83')]){_0x451704[_0x81d2('0x83')]=JSON[_0x81d2('0x7c')](_0x451704[_0x81d2('0x83')]);_0x267853['where'](_0x5788d2(_0x451704['conditions'][_0x81d2('0x6b')]));}_0x1282ba=_0x267853['clone']();_0x267853[_0x81d2('0x3c')](_0x446228);_0x267853[_0x81d2('0x20')](0x0);logger[_0x81d2('0x84')](_0x81d2('0xa4'),_0x267853['toString']());return dbH[_0x81d2('0x86')][_0x81d2('0x35')](_0x267853['toString'](),{'type':dbH[_0x81d2('0x86')][_0x81d2('0x87')][_0x81d2('0x88')]});}})[_0x81d2('0x27')](function(){return{'sql':_0x1282ba[_0x81d2('0x85')]()};})[_0x81d2('0x27')](respondWithResult(_0x2fd2bf,null))[_0x81d2('0x49')](handleError(_0x2fd2bf,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 6f1da1a..a87b178 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 _0x7e58=['../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x168dfe,_0x300f07){var _0x2e00c9=function(_0x30fc67){while(--_0x30fc67){_0x168dfe['push'](_0x168dfe['shift']());}};_0x2e00c9(++_0x300f07);}(_0x7e58,0x1f2));var _0x87e5=function(_0x403314,_0x18c1d3){_0x403314=_0x403314-0x0;var _0x48731c=_0x7e58[_0x403314];return _0x48731c;};'use strict';var _=require('lodash');var util=require(_0x87e5('0x0'));var logger=require(_0x87e5('0x1'))(_0x87e5('0x2'));var moment=require('moment');var BPromise=require(_0x87e5('0x3'));var rp=require(_0x87e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x87e5('0x5'));var config=require(_0x87e5('0x6'));var attributes=require(_0x87e5('0x7'));module[_0x87e5('0x8')]=function(_0x5a8621,_0x3df93a){return _0x5a8621[_0x87e5('0x9')](_0x87e5('0xa'),attributes,{'tableName':_0x87e5('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d2c=['bluebird','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4d2c,0x1d3));var _0xc4d2=function(_0xecb387,_0x1d5fc3){_0xecb387=_0xecb387-0x0;var _0x416301=_0x4d2c[_0xecb387];return _0x416301;};'use strict';var _=require(_0xc4d2('0x0'));var util=require('util');var logger=require(_0xc4d2('0x1'))('api');var moment=require(_0xc4d2('0x2'));var BPromise=require(_0xc4d2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc4d2('0x4'));var attributes=require(_0xc4d2('0x5'));module[_0xc4d2('0x6')]=function(_0x32c48c,_0x2a8a8f){return _0x32c48c[_0xc4d2('0x7')](_0xc4d2('0x8'),attributes,{'tableName':_0xc4d2('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 3e2c543..a50bb8c 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 _0xf887=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf887,0x73));var _0x7f88=function(_0x4c1c5a,_0xcf5444){_0x4c1c5a=_0x4c1c5a-0x0;var _0x2896f0=_0xf887[_0x4c1c5a];return _0x2896f0;};'use strict';var _=require(_0x7f88('0x0'));var util=require(_0x7f88('0x1'));var moment=require(_0x7f88('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f88('0x3'));var fs=require('fs');var Redis=require(_0x7f88('0x4'));var db=require(_0x7f88('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f88('0x6'))(_0x7f88('0x7'));var config=require(_0x7f88('0x8'));var jayson=require(_0x7f88('0x9'));var client=jayson[_0x7f88('0xa')][_0x7f88('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x231bb1,_0x3b0be3,_0x214e3a){return new BPromise(function(_0x21f261,_0x5e0dd6){return client[_0x7f88('0xc')](_0x231bb1,_0x214e3a)[_0x7f88('0xd')](function(_0x5cdb35){logger['info'](_0x7f88('0xe'),_0x3b0be3,_0x7f88('0xf'));logger[_0x7f88('0x10')](_0x7f88('0x11'),_0x3b0be3,_0x7f88('0xf'),JSON['stringify'](_0x5cdb35));if(_0x5cdb35[_0x7f88('0x12')]){if(_0x5cdb35[_0x7f88('0x12')][_0x7f88('0x13')]===0x1f4){logger[_0x7f88('0x12')](_0x7f88('0xe'),_0x3b0be3,_0x5cdb35[_0x7f88('0x12')][_0x7f88('0x14')]);return _0x5e0dd6(_0x5cdb35[_0x7f88('0x12')][_0x7f88('0x14')]);}logger['error'](_0x7f88('0xe'),_0x3b0be3,_0x5cdb35[_0x7f88('0x12')]['message']);return _0x21f261(_0x5cdb35['error']['message']);}else{logger[_0x7f88('0x15')](_0x7f88('0xe'),_0x3b0be3,_0x7f88('0xf'));_0x21f261(_0x5cdb35[_0x7f88('0x16')][_0x7f88('0x14')]);}})[_0x7f88('0x17')](function(_0x59dc37){logger[_0x7f88('0x12')](_0x7f88('0xe'),_0x3b0be3,_0x59dc37);_0x5e0dd6(_0x59dc37);});});} \ No newline at end of file +var _0xcd81=['code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xcd81,0x163));var _0x1cd8=function(_0x2bd3f7,_0x3a05d6){_0x2bd3f7=_0x2bd3f7-0x0;var _0x3d9751=_0xcd81[_0x2bd3f7];return _0x3d9751;};'use strict';var _=require('lodash');var util=require(_0x1cd8('0x0'));var moment=require(_0x1cd8('0x1'));var BPromise=require(_0x1cd8('0x2'));var rs=require(_0x1cd8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cd8('0x4'))['db'];var utils=require(_0x1cd8('0x5'));var logger=require(_0x1cd8('0x6'))(_0x1cd8('0x7'));var config=require(_0x1cd8('0x8'));var jayson=require(_0x1cd8('0x9'));var client=jayson[_0x1cd8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39db7f,_0x7d6af6,_0x344ec8){return new BPromise(function(_0x3dbb18,_0x1de2e0){return client[_0x1cd8('0xb')](_0x39db7f,_0x344ec8)[_0x1cd8('0xc')](function(_0x37e70e){logger[_0x1cd8('0xd')](_0x1cd8('0xe'),_0x7d6af6,_0x1cd8('0xf'));logger[_0x1cd8('0x10')](_0x1cd8('0x11'),_0x7d6af6,_0x1cd8('0xf'),JSON['stringify'](_0x37e70e));if(_0x37e70e[_0x1cd8('0x12')]){if(_0x37e70e['error'][_0x1cd8('0x13')]===0x1f4){logger[_0x1cd8('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x7d6af6,_0x37e70e[_0x1cd8('0x12')][_0x1cd8('0x14')]);return _0x1de2e0(_0x37e70e['error'][_0x1cd8('0x14')]);}logger[_0x1cd8('0x12')](_0x1cd8('0xe'),_0x7d6af6,_0x37e70e[_0x1cd8('0x12')]['message']);return _0x3dbb18(_0x37e70e['error'][_0x1cd8('0x14')]);}else{logger[_0x1cd8('0xd')](_0x1cd8('0xe'),_0x7d6af6,'request\x20sent');_0x3dbb18(_0x37e70e['result'][_0x1cd8('0x14')]);}})[_0x1cd8('0x15')](function(_0x23a6c7){logger[_0x1cd8('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x7d6af6,_0x23a6c7);_0x1de2e0(_0x23a6c7);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index f963ca0..f84b940 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 _0x1a3c=['/:id/run','/:id/query','query','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id/preview','preview'];(function(_0x285d8f,_0x3c464e){var _0x2a3a2d=function(_0x57b7c0){while(--_0x57b7c0){_0x285d8f['push'](_0x285d8f['shift']());}};_0x2a3a2d(++_0x3c464e);}(_0x1a3c,0x69));var _0xc1a3=function(_0x2c8783,_0x50955d){_0x2c8783=_0x2c8783-0x0;var _0x129d02=_0x1a3c[_0x2c8783];return _0x129d02;};'use strict';var multer=require('multer');var util=require(_0xc1a3('0x0'));var path=require('path');var timeout=require(_0xc1a3('0x1'));var express=require('express');var router=express[_0xc1a3('0x2')]();var fs_extra=require(_0xc1a3('0x3'));var auth=require(_0xc1a3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xc1a3('0x5')]('/',auth[_0xc1a3('0x6')](),controller['index']);router[_0xc1a3('0x5')]('/:id',auth[_0xc1a3('0x6')](),controller['show']);router[_0xc1a3('0x5')](_0xc1a3('0x7'),auth['isAuthenticated'](),controller[_0xc1a3('0x8')]);router[_0xc1a3('0x5')](_0xc1a3('0x9'),auth[_0xc1a3('0x6')](),controller['run']);router[_0xc1a3('0x5')](_0xc1a3('0xa'),auth[_0xc1a3('0x6')](),controller[_0xc1a3('0xb')]);router['post']('/',auth[_0xc1a3('0x6')](),controller[_0xc1a3('0xc')]);router[_0xc1a3('0xd')](_0xc1a3('0xe'),auth[_0xc1a3('0x6')](),controller[_0xc1a3('0xf')]);router[_0xc1a3('0x10')](_0xc1a3('0xe'),auth[_0xc1a3('0x6')](),controller[_0xc1a3('0x11')]);module[_0xc1a3('0x12')]=router; \ No newline at end of file +var _0xb8f2=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','/:id/preview','preview','/:id/run','/:id/query','create','put','update'];(function(_0x5b94e4,_0x3997cc){var _0x569446=function(_0x10c701){while(--_0x10c701){_0x5b94e4['push'](_0x5b94e4['shift']());}};_0x569446(++_0x3997cc);}(_0xb8f2,0xbb));var _0x2b8f=function(_0x5811d5,_0x420ad8){_0x5811d5=_0x5811d5-0x0;var _0x8e3a88=_0xb8f2[_0x5811d5];return _0x8e3a88;};'use strict';var multer=require(_0x2b8f('0x0'));var util=require(_0x2b8f('0x1'));var path=require(_0x2b8f('0x2'));var timeout=require('connect-timeout');var express=require(_0x2b8f('0x3'));var router=express[_0x2b8f('0x4')]();var fs_extra=require(_0x2b8f('0x5'));var auth=require(_0x2b8f('0x6'));var interaction=require(_0x2b8f('0x7'));var config=require('../../config/environment');var controller=require(_0x2b8f('0x8'));router['get']('/',auth[_0x2b8f('0x9')](),controller[_0x2b8f('0xa')]);router[_0x2b8f('0xb')](_0x2b8f('0xc'),auth[_0x2b8f('0x9')](),controller['show']);router['get'](_0x2b8f('0xd'),auth[_0x2b8f('0x9')](),controller[_0x2b8f('0xe')]);router[_0x2b8f('0xb')](_0x2b8f('0xf'),auth[_0x2b8f('0x9')](),controller['run']);router[_0x2b8f('0xb')](_0x2b8f('0x10'),auth[_0x2b8f('0x9')](),controller['query']);router['post']('/',auth[_0x2b8f('0x9')](),controller[_0x2b8f('0x11')]);router[_0x2b8f('0x12')](_0x2b8f('0xc'),auth[_0x2b8f('0x9')](),controller[_0x2b8f('0x13')]);router[_0x2b8f('0x14')]('/:id',auth[_0x2b8f('0x9')](),controller[_0x2b8f('0x15')]);module[_0x2b8f('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 0957ef1..b1d3077 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 _0x24ca=['sequelize','STRING','TEXT'];(function(_0xf61c79,_0x43c6fa){var _0x127d26=function(_0x598bf6){while(--_0x598bf6){_0xf61c79['push'](_0xf61c79['shift']());}};_0x127d26(++_0x43c6fa);}(_0x24ca,0x1bc));var _0xa24c=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0x24ca[_0x4843f9];return _0x193c6a;};'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 +var _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x1cb60e,_0x19a170){var _0x1fc03d=function(_0x24f7ce){while(--_0x24f7ce){_0x1cb60e['push'](_0x1cb60e['shift']());}};_0x1fc03d(++_0x19a170);}(_0xd8fb,0x99));var _0xbd8f=function(_0x32ea5c,_0x2d910c){_0x32ea5c=_0x32ea5c-0x0;var _0x54f42c=_0xd8fb[_0x32ea5c];return _0x54f42c;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index c717167..53e2c03 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 _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xabce[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));}; \ No newline at end of file +var _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x4a0c1f,_0x4eab1d){var _0x5f4f57=function(_0x1b07fb){while(--_0x1b07fb){_0x4a0c1f['push'](_0x4a0c1f['shift']());}};_0x5f4f57(++_0x4eab1d);}(_0x31f0,0xb7));var _0x031f=function(_0x52ade5,_0x158a01){_0x52ade5=_0x52ade5-0x0;var _0x14db7f=_0x31f0[_0x52ade5];return _0x14db7f;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 992b273..5078342 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 _0x69b4=['../../config/environment','./analyticDefaultReport.attributes','AnalyticDefaultReport','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x255850,_0x5511dd){var _0x5ceacf=function(_0x260ecf){while(--_0x260ecf){_0x255850['push'](_0x255850['shift']());}};_0x5ceacf(++_0x5511dd);}(_0x69b4,0xd5));var _0x469b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x69b4[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x469b('0x0'));var util=require(_0x469b('0x1'));var logger=require(_0x469b('0x2'))(_0x469b('0x3'));var moment=require('moment');var BPromise=require(_0x469b('0x4'));var rp=require(_0x469b('0x5'));var fs=require('fs');var path=require(_0x469b('0x6'));var rimraf=require('rimraf');var config=require(_0x469b('0x7'));var attributes=require(_0x469b('0x8'));module['exports']=function(_0x4be5ca,_0x509527){return _0x4be5ca['define'](_0x469b('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffd4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api'];(function(_0x5935f8,_0x2dbca4){var _0x39b19a=function(_0x2c8dc9){while(--_0x2c8dc9){_0x5935f8['push'](_0x5935f8['shift']());}};_0x39b19a(++_0x2dbca4);}(_0xffd4,0xf8));var _0x4ffd=function(_0x474628,_0x34a081){_0x474628=_0x474628-0x0;var _0x1e7717=_0xffd4[_0x474628];return _0x1e7717;};'use strict';var _=require(_0x4ffd('0x0'));var util=require(_0x4ffd('0x1'));var logger=require(_0x4ffd('0x2'))(_0x4ffd('0x3'));var moment=require(_0x4ffd('0x4'));var BPromise=require(_0x4ffd('0x5'));var rp=require(_0x4ffd('0x6'));var fs=require('fs');var path=require(_0x4ffd('0x7'));var rimraf=require(_0x4ffd('0x8'));var config=require(_0x4ffd('0x9'));var attributes=require(_0x4ffd('0xa'));module[_0x4ffd('0xb')]=function(_0x3744a5,_0x1f9b13){return _0x3744a5['define'](_0x4ffd('0xc'),attributes,{'tableName':_0x4ffd('0xd'),'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 ca5ce20..f5a99b5 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 _0x262b=['jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x262b,0x91));var _0xb262=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x262b[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xb262('0x0'));var moment=require(_0xb262('0x1'));var BPromise=require(_0xb262('0x2'));var rs=require(_0xb262('0x3'));var fs=require('fs');var Redis=require(_0xb262('0x4'));var db=require(_0xb262('0x5'))['db'];var utils=require(_0xb262('0x6'));var logger=require(_0xb262('0x7'))('rpc');var config=require(_0xb262('0x8'));var jayson=require(_0xb262('0x9'));var client=jayson[_0xb262('0xa')][_0xb262('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa5e3e0,_0x3a2d14,_0x3ff761){return new BPromise(function(_0x209fd3,_0x3e738f){return client['request'](_0xa5e3e0,_0x3ff761)[_0xb262('0xc')](function(_0x599903){logger[_0xb262('0xd')](_0xb262('0xe'),_0x3a2d14,_0xb262('0xf'));logger[_0xb262('0x10')](_0xb262('0x11'),_0x3a2d14,'request\x20sent',JSON[_0xb262('0x12')](_0x599903));if(_0x599903[_0xb262('0x13')]){if(_0x599903[_0xb262('0x13')]['code']===0x1f4){logger[_0xb262('0x13')](_0xb262('0xe'),_0x3a2d14,_0x599903[_0xb262('0x13')][_0xb262('0x14')]);return _0x3e738f(_0x599903[_0xb262('0x13')][_0xb262('0x14')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x3a2d14,_0x599903[_0xb262('0x13')]['message']);return _0x209fd3(_0x599903[_0xb262('0x13')]['message']);}else{logger[_0xb262('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3a2d14,'request\x20sent');_0x209fd3(_0x599903[_0xb262('0x15')][_0xb262('0x14')]);}})['catch'](function(_0x353bf6){logger['error'](_0xb262('0xe'),_0x3a2d14,_0x353bf6);_0x3e738f(_0x353bf6);});});} \ No newline at end of file +var _0x0f89=['info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x34f545,_0x4c7765){var _0x2c2a68=function(_0x4c20cc){while(--_0x4c20cc){_0x34f545['push'](_0x34f545['shift']());}};_0x2c2a68(++_0x4c7765);}(_0x0f89,0x1e5));var _0x90f8=function(_0xa0d7ba,_0x303316){_0xa0d7ba=_0xa0d7ba-0x0;var _0x58fa94=_0x0f89[_0xa0d7ba];return _0x58fa94;};'use strict';var _=require(_0x90f8('0x0'));var util=require(_0x90f8('0x1'));var moment=require('moment');var BPromise=require(_0x90f8('0x2'));var rs=require(_0x90f8('0x3'));var fs=require('fs');var Redis=require(_0x90f8('0x4'));var db=require(_0x90f8('0x5'))['db'];var utils=require(_0x90f8('0x6'));var logger=require(_0x90f8('0x7'))(_0x90f8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x90f8('0x9')][_0x90f8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b332b,_0x373008,_0x37c045){return new BPromise(function(_0xbf46a3,_0x1d6be8){return client[_0x90f8('0xb')](_0x3b332b,_0x37c045)[_0x90f8('0xc')](function(_0x424da4){logger['info'](_0x90f8('0xd'),_0x373008,_0x90f8('0xe'));logger['debug'](_0x90f8('0xf'),_0x373008,_0x90f8('0xe'),JSON['stringify'](_0x424da4));if(_0x424da4[_0x90f8('0x10')]){if(_0x424da4[_0x90f8('0x10')][_0x90f8('0x11')]===0x1f4){logger[_0x90f8('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x373008,_0x424da4[_0x90f8('0x10')]['message']);return _0x1d6be8(_0x424da4[_0x90f8('0x10')][_0x90f8('0x12')]);}logger[_0x90f8('0x10')](_0x90f8('0xd'),_0x373008,_0x424da4[_0x90f8('0x10')][_0x90f8('0x12')]);return _0xbf46a3(_0x424da4[_0x90f8('0x10')]['message']);}else{logger[_0x90f8('0x13')](_0x90f8('0xd'),_0x373008,_0x90f8('0xe'));_0xbf46a3(_0x424da4[_0x90f8('0x14')][_0x90f8('0x12')]);}})['catch'](function(_0x24e0ac){logger[_0x90f8('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x373008,_0x24e0ac);_0x1d6be8(_0x24e0ac);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index ec4da07..fb00889 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 _0xf11e=['put','update','destroy','multer','path','connect-timeout','express','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','/:id/query','query','post','create'];(function(_0x43dec6,_0x39ef22){var _0x5b9e47=function(_0xfb75a4){while(--_0xfb75a4){_0x43dec6['push'](_0x43dec6['shift']());}};_0x5b9e47(++_0x39ef22);}(_0xf11e,0x11b));var _0xef11=function(_0x5d375c,_0x3ccb1e){_0x5d375c=_0x5d375c-0x0;var _0x1fd6ed=_0xf11e[_0x5d375c];return _0x1fd6ed;};'use strict';var multer=require(_0xef11('0x0'));var util=require('util');var path=require(_0xef11('0x1'));var timeout=require(_0xef11('0x2'));var express=require(_0xef11('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xef11('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef11('0x5'));router[_0xef11('0x6')]('/',auth[_0xef11('0x7')](),controller[_0xef11('0x8')]);router[_0xef11('0x6')](_0xef11('0x9'),auth[_0xef11('0x7')](),controller['show']);router[_0xef11('0x6')](_0xef11('0xa'),auth[_0xef11('0x7')](),controller[_0xef11('0xb')]);router[_0xef11('0x6')](_0xef11('0xc'),auth['isAuthenticated'](),controller['run']);router[_0xef11('0x6')](_0xef11('0xd'),auth['isAuthenticated'](),controller[_0xef11('0xe')]);router[_0xef11('0xf')]('/',auth['isAuthenticated'](),controller[_0xef11('0x10')]);router[_0xef11('0x11')](_0xef11('0x9'),auth[_0xef11('0x7')](),controller[_0xef11('0x12')]);router['delete'](_0xef11('0x9'),auth['isAuthenticated'](),controller[_0xef11('0x13')]);module['exports']=router; \ No newline at end of file +var _0x8926=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated','index','show','preview','/:id/run','run','/:id/query','query','post'];(function(_0x2fb732,_0x1aa142){var _0x477de3=function(_0x1299fa){while(--_0x1299fa){_0x2fb732['push'](_0x2fb732['shift']());}};_0x477de3(++_0x1aa142);}(_0x8926,0x18d));var _0x6892=function(_0x2a7e6f,_0x3418c5){_0x2a7e6f=_0x2a7e6f-0x0;var _0x4e4167=_0x8926[_0x2a7e6f];return _0x4e4167;};'use strict';var multer=require(_0x6892('0x0'));var util=require(_0x6892('0x1'));var path=require(_0x6892('0x2'));var timeout=require(_0x6892('0x3'));var express=require(_0x6892('0x4'));var router=express[_0x6892('0x5')]();var fs_extra=require(_0x6892('0x6'));var auth=require(_0x6892('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6892('0x8'));router[_0x6892('0x9')]('/',auth[_0x6892('0xa')](),controller[_0x6892('0xb')]);router[_0x6892('0x9')]('/:id',auth[_0x6892('0xa')](),controller[_0x6892('0xc')]);router[_0x6892('0x9')]('/:id/preview',auth[_0x6892('0xa')](),controller[_0x6892('0xd')]);router[_0x6892('0x9')](_0x6892('0xe'),auth[_0x6892('0xa')](),controller[_0x6892('0xf')]);router[_0x6892('0x9')](_0x6892('0x10'),auth[_0x6892('0xa')](),controller[_0x6892('0x11')]);router[_0x6892('0x12')]('/',auth[_0x6892('0xa')](),controller[_0x6892('0x13')]);router[_0x6892('0x14')](_0x6892('0x15'),auth['isAuthenticated'](),controller[_0x6892('0x16')]);router[_0x6892('0x17')](_0x6892('0x15'),auth['isAuthenticated'](),controller[_0x6892('0x18')]);module[_0x6892('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 892f952..47c2ad1 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 _0x3f1c=['csv','pdf','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','STRING','ENUM'];(function(_0x53eff4,_0x55b2c0){var _0x1fa828=function(_0x50da64){while(--_0x50da64){_0x53eff4['push'](_0x53eff4['shift']());}};_0x1fa828(++_0x55b2c0);}(_0x3f1c,0x6c));var _0xc3f1=function(_0x595b93,_0x1c35e9){_0x595b93=_0x595b93-0x0;var _0x12133a=_0x3f1c[_0x595b93];return _0x12133a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xc3f1('0x0')],'allowNull':![]},'output':{'type':Sequelize[_0xc3f1('0x1')](_0xc3f1('0x2'),_0xc3f1('0x3'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xc3f1('0x4')]},'endDate':{'type':Sequelize[_0xc3f1('0x4')]},'status':{'type':Sequelize[_0xc3f1('0x0')],'defaultValue':_0xc3f1('0x5')},'type':{'type':Sequelize[_0xc3f1('0x1')](_0xc3f1('0x6'),_0xc3f1('0x7')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xc3f1('0x8')](0xb)[_0xc3f1('0x9')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa64b=['ENUM','manual','moment','STRING','csv','DATE','Loading'];(function(_0x1f502b,_0x489686){var _0x1a93e8=function(_0x10f433){while(--_0x10f433){_0x1f502b['push'](_0x1f502b['shift']());}};_0x1a93e8(++_0x489686);}(_0xa64b,0x175));var _0xba64=function(_0x43ec80,_0x463baa){_0x43ec80=_0x43ec80-0x0;var _0x3713bc=_0xa64b[_0x43ec80];return _0x3713bc;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xba64('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xba64('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0xba64('0x2')},'savename':{'type':Sequelize[_0xba64('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xba64('0x3')]},'endDate':{'type':Sequelize[_0xba64('0x3')]},'status':{'type':Sequelize[_0xba64('0x1')],'defaultValue':_0xba64('0x4')},'type':{'type':Sequelize[_0xba64('0x5')](_0xba64('0x6'),'scheduled'),'allowNull':![],'defaultValue':_0xba64('0x6')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'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 7af405b..3396801 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 _0xee13=['ValidationError','exists','root','format','%s.%s','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','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','ExtractedReports','end','stack','name','send','index','map','AnalyticExtractedReport','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','user','get','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','existsSync','join','server/files/reports'];(function(_0x425051,_0x3c1854){var _0x126b92=function(_0x3d3702){while(--_0x3d3702){_0x425051['push'](_0x425051['shift']());}};_0x126b92(++_0x3c1854);}(_0xee13,0x1e5));var _0x3ee1=function(_0xe9ca7c,_0x45f2d3){_0xe9ca7c=_0xe9ca7c-0x0;var _0x17775e=_0xee13[_0xe9ca7c];return _0x17775e;};'use strict';var emlformat=require(_0x3ee1('0x0'));var rimraf=require(_0x3ee1('0x1'));var zipdir=require(_0x3ee1('0x2'));var jsonpatch=require(_0x3ee1('0x3'));var rp=require(_0x3ee1('0x4'));var moment=require(_0x3ee1('0x5'));var BPromise=require(_0x3ee1('0x6'));var Mustache=require(_0x3ee1('0x7'));var util=require(_0x3ee1('0x8'));var path=require(_0x3ee1('0x9'));var sox=require(_0x3ee1('0xa'));var csv=require(_0x3ee1('0xb'));var ejs=require(_0x3ee1('0xc'));var fs=require('fs');var fs_extra=require(_0x3ee1('0xd'));var _=require(_0x3ee1('0xe'));var squel=require(_0x3ee1('0xf'));var crypto=require(_0x3ee1('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x3ee1('0x11'));var toCsv=require(_0x3ee1('0xb'));var querystring=require('querystring');var Papa=require(_0x3ee1('0x12'));var Redis=require(_0x3ee1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3ee1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ee1('0x15'))(_0x3ee1('0x16'));var utils=require(_0x3ee1('0x17'));var config=require(_0x3ee1('0x18'));var licenseUtil=require(_0x3ee1('0x19'));var db=require(_0x3ee1('0x1a'))['db'];function respondWithStatusCode(_0x1a035f,_0x572a58){_0x572a58=_0x572a58||0xcc;return function(_0x18c304){if(_0x18c304){return _0x1a035f[_0x3ee1('0x1b')](_0x572a58);}return _0x1a035f[_0x3ee1('0x1c')](_0x572a58)['end']();};}function respondWithResult(_0x1eb87c,_0x4b92fc){_0x4b92fc=_0x4b92fc||0xc8;return function(_0x4f63f3){if(_0x4f63f3){return _0x1eb87c[_0x3ee1('0x1c')](_0x4b92fc)[_0x3ee1('0x1d')](_0x4f63f3);}};}function respondWithFilteredResult(_0x526ddc,_0x31a7d2){return function(_0x326c14){if(_0x326c14){var _0x39328e=typeof _0x31a7d2[_0x3ee1('0x1e')]===_0x3ee1('0x1f')&&typeof _0x31a7d2['limit']===_0x3ee1('0x1f');var _0x2849a0=_0x326c14[_0x3ee1('0x20')];var _0x3fea7a=_0x39328e?0x0:_0x31a7d2['offset'];var _0x34a5c5=_0x39328e?_0x326c14['count']:_0x31a7d2[_0x3ee1('0x1e')]+_0x31a7d2[_0x3ee1('0x21')];var _0x20e39f;if(_0x34a5c5>=_0x2849a0){_0x34a5c5=_0x2849a0;_0x20e39f=0xc8;}else{_0x20e39f=0xce;}_0x526ddc[_0x3ee1('0x1c')](_0x20e39f);return _0x526ddc[_0x3ee1('0x22')](_0x3ee1('0x23'),_0x3fea7a+'-'+_0x34a5c5+'/'+_0x2849a0)[_0x3ee1('0x1d')](_0x326c14);}return null;};}function patchUpdates(_0x383599){return function(_0x1480d6){try{jsonpatch[_0x3ee1('0x24')](_0x1480d6,_0x383599,!![]);}catch(_0x501ada){return BPromise['reject'](_0x501ada);}return _0x1480d6[_0x3ee1('0x25')]();};}function saveUpdates(_0x3fc493,_0x5ddd9a){return function(_0x157940){if(_0x157940){return _0x157940['update'](_0x3fc493)[_0x3ee1('0x26')](function(_0x32890c){return _0x32890c;});}return null;};}function removeEntity(_0x58e419,_0x268813){return function(_0x30714f){if(_0x30714f){return _0x30714f[_0x3ee1('0x27')]()['then'](function(){var _0x5c51ae=_0x30714f['get']({'plain':!![]});var _0x2d3cd0=_0x3ee1('0x28');return db['UserProfileResource'][_0x3ee1('0x27')]({'where':{'type':_0x2d3cd0,'resourceId':_0x5c51ae['id']}})[_0x3ee1('0x26')](function(){return _0x30714f;});})[_0x3ee1('0x26')](function(){_0x58e419[_0x3ee1('0x1c')](0xcc)[_0x3ee1('0x29')]();});}};}function handleEntityNotFound(_0x1b84b0,_0x5a9b5b){return function(_0x532abd){if(!_0x532abd){_0x1b84b0[_0x3ee1('0x1b')](0x194);}return _0x532abd;};}function handleError(_0xfa06a2,_0x2c18a7){_0x2c18a7=_0x2c18a7||0x1f4;return function(_0x329d08){logger['error'](_0x329d08[_0x3ee1('0x2a')]);if(_0x329d08[_0x3ee1('0x2b')]){delete _0x329d08[_0x3ee1('0x2b')];}_0xfa06a2[_0x3ee1('0x1c')](_0x2c18a7)[_0x3ee1('0x2c')](_0x329d08);};}exports[_0x3ee1('0x2d')]=function(_0x30ded3,_0x156998){var _0x3fe690={},_0x5d235a={},_0x55ced1={'count':0x0,'rows':[]};var _0x3bbbb3=_[_0x3ee1('0x2e')](db[_0x3ee1('0x2f')]['rawAttributes'],function(_0x4f674c){return{'name':_0x4f674c['fieldName'],'type':_0x4f674c[_0x3ee1('0x30')][_0x3ee1('0x31')]};});_0x5d235a[_0x3ee1('0x32')]=_[_0x3ee1('0x2e')](_0x3bbbb3,'name');_0x5d235a[_0x3ee1('0x33')]=_[_0x3ee1('0x34')](_0x30ded3['query']);_0x5d235a['filters']=_[_0x3ee1('0x35')](_0x5d235a[_0x3ee1('0x32')],_0x5d235a['query']);_0x3fe690['attributes']=_[_0x3ee1('0x35')](_0x5d235a['model'],qs[_0x3ee1('0x36')](_0x30ded3[_0x3ee1('0x33')]['fields']));_0x3fe690[_0x3ee1('0x37')]=_0x3fe690[_0x3ee1('0x37')][_0x3ee1('0x38')]?_0x3fe690[_0x3ee1('0x37')]:_0x5d235a[_0x3ee1('0x32')];if(!_0x30ded3['query']['hasOwnProperty'](_0x3ee1('0x39'))){_0x3fe690['limit']=qs['limit'](_0x30ded3[_0x3ee1('0x33')]['limit']);_0x3fe690[_0x3ee1('0x1e')]=qs[_0x3ee1('0x1e')](_0x30ded3[_0x3ee1('0x33')]['offset']);}_0x3fe690['order']=qs[_0x3ee1('0x3a')](_0x30ded3['query'][_0x3ee1('0x3a')]);_0x3fe690['where']=qs[_0x3ee1('0x3b')](_[_0x3ee1('0x3c')](_0x30ded3['query'],_0x5d235a['filters']),_0x3bbbb3);if(_0x30ded3['query'][_0x3ee1('0x3d')]){_0x3fe690['where']=_[_0x3ee1('0x3e')](_0x3fe690[_0x3ee1('0x3f')],{'$or':_[_0x3ee1('0x2e')](_0x3bbbb3,function(_0x66c8d1){if(_0x66c8d1['type']!==_0x3ee1('0x40')){var _0x32d482={};_0x32d482[_0x66c8d1['name']]={'$like':'%'+_0x30ded3[_0x3ee1('0x33')][_0x3ee1('0x3d')]+'%'};return _0x32d482;}})});}_0x3fe690=_[_0x3ee1('0x3e')]({},_0x3fe690,_0x30ded3[_0x3ee1('0x41')]);var _0x4f8923={'where':_0x3fe690['where']};return db[_0x3ee1('0x2f')][_0x3ee1('0x20')](_0x4f8923)[_0x3ee1('0x26')](function(_0x165ab0){_0x55ced1[_0x3ee1('0x20')]=_0x165ab0;if(_0x30ded3['query'][_0x3ee1('0x42')]){_0x3fe690['include']=[{'all':!![]}];}return db[_0x3ee1('0x2f')][_0x3ee1('0x43')](_0x3fe690);})[_0x3ee1('0x26')](function(_0x19c9f9){_0x55ced1[_0x3ee1('0x44')]=_0x19c9f9;return _0x55ced1;})[_0x3ee1('0x26')](respondWithFilteredResult(_0x156998,_0x3fe690))[_0x3ee1('0x45')](handleError(_0x156998,null));};exports['show']=function(_0x4fb825,_0x2c2760){var _0x3d2d41={'raw':!![],'where':{'id':_0x4fb825[_0x3ee1('0x46')]['id']}},_0x10996d={};_0x10996d['model']=_[_0x3ee1('0x34')](db[_0x3ee1('0x2f')][_0x3ee1('0x47')]);_0x10996d[_0x3ee1('0x33')]=_['keys'](_0x4fb825[_0x3ee1('0x33')]);_0x10996d[_0x3ee1('0x3b')]=_['intersection'](_0x10996d[_0x3ee1('0x32')],_0x10996d[_0x3ee1('0x33')]);_0x3d2d41[_0x3ee1('0x37')]=_['intersection'](_0x10996d[_0x3ee1('0x32')],qs[_0x3ee1('0x36')](_0x4fb825[_0x3ee1('0x33')][_0x3ee1('0x36')]));_0x3d2d41['attributes']=_0x3d2d41[_0x3ee1('0x37')][_0x3ee1('0x38')]?_0x3d2d41[_0x3ee1('0x37')]:_0x10996d[_0x3ee1('0x32')];if(_0x4fb825[_0x3ee1('0x33')][_0x3ee1('0x42')]){_0x3d2d41[_0x3ee1('0x48')]=[{'all':!![]}];}_0x3d2d41=_[_0x3ee1('0x3e')]({},_0x3d2d41,_0x4fb825[_0x3ee1('0x41')]);return db['AnalyticExtractedReport'][_0x3ee1('0x49')](_0x3d2d41)['then'](handleEntityNotFound(_0x2c2760,null))[_0x3ee1('0x26')](respondWithResult(_0x2c2760,null))['catch'](handleError(_0x2c2760,null));};exports[_0x3ee1('0x4a')]=function(_0x25fda7,_0x2ed3ac){return db[_0x3ee1('0x2f')][_0x3ee1('0x4a')](_0x25fda7[_0x3ee1('0x4b')],{})['then'](function(_0x104d05){var _0x46493e=_0x25fda7[_0x3ee1('0x4c')][_0x3ee1('0x4d')]({'plain':!![]});if(!_0x46493e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46493e['role']===_0x3ee1('0x4c')){var _0x21cbbb=_0x104d05[_0x3ee1('0x4d')]({'plain':!![]});var _0x48997c=_0x3ee1('0x28');return db['UserProfileSection'][_0x3ee1('0x49')]({'where':{'name':_0x48997c,'userProfileId':_0x46493e[_0x3ee1('0x4e')]},'raw':!![]})[_0x3ee1('0x26')](function(_0x4e484c){if(_0x4e484c&&_0x4e484c[_0x3ee1('0x4f')]===0x0){return db[_0x3ee1('0x50')][_0x3ee1('0x4a')]({'name':_0x21cbbb[_0x3ee1('0x2b')],'resourceId':_0x21cbbb['id'],'type':_0x4e484c[_0x3ee1('0x2b')],'sectionId':_0x4e484c['id']},{})[_0x3ee1('0x26')](function(){return _0x104d05;});}else{return _0x104d05;}})[_0x3ee1('0x45')](function(_0xf744b7){logger[_0x3ee1('0x51')](_0x3ee1('0x52'),_0xf744b7);throw _0xf744b7;});}return _0x104d05;})[_0x3ee1('0x26')](respondWithResult(_0x2ed3ac,0xc9))['catch'](handleError(_0x2ed3ac,null));};exports[_0x3ee1('0x53')]=function(_0x40fd7f,_0x1ddb10){if(_0x40fd7f[_0x3ee1('0x4b')]['id']){delete _0x40fd7f[_0x3ee1('0x4b')]['id'];}return db[_0x3ee1('0x2f')]['find']({'where':{'id':_0x40fd7f[_0x3ee1('0x46')]['id']}})[_0x3ee1('0x26')](handleEntityNotFound(_0x1ddb10,null))[_0x3ee1('0x26')](saveUpdates(_0x40fd7f[_0x3ee1('0x4b')],null))[_0x3ee1('0x26')](respondWithResult(_0x1ddb10,null))[_0x3ee1('0x45')](handleError(_0x1ddb10,null));};exports['destroy']=function(_0x18049a,_0x1a0cb5){return db['AnalyticExtractedReport'][_0x3ee1('0x49')]({'where':{'id':_0x18049a[_0x3ee1('0x46')]['id']}})[_0x3ee1('0x26')](handleEntityNotFound(_0x1a0cb5,null))['then'](removeEntity(_0x1a0cb5,null))[_0x3ee1('0x45')](handleError(_0x1a0cb5,null));};exports[_0x3ee1('0x54')]=function(_0x5a936f,_0x31464a,_0xac3d9a){return db[_0x3ee1('0x2f')][_0x3ee1('0x49')]({'where':{'id':_0x5a936f[_0x3ee1('0x46')]['id']},'attributes':[_0x3ee1('0x2b'),_0x3ee1('0x55'),_0x3ee1('0x56'),_0x3ee1('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x31464a,null))[_0x3ee1('0x26')](function(_0x2bc0f0){if(_0x2bc0f0){if(!fs[_0x3ee1('0x58')](path[_0x3ee1('0x59')](config['root'],_0x3ee1('0x5a'),_0x2bc0f0[_0x3ee1('0x56')]))){throw new db['Sequelize'][(_0x3ee1('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x5a936f[_0x3ee1('0x33')][_0x3ee1('0x5c')]){return _0x31464a['sendStatus'](0xc8);}return _0x31464a[_0x3ee1('0x54')](path[_0x3ee1('0x59')](config[_0x3ee1('0x5d')],_0x3ee1('0x5a'),_0x2bc0f0['savename']),util[_0x3ee1('0x5e')](_0x3ee1('0x5f'),_0x2bc0f0[_0x3ee1('0x55')]||_0x2bc0f0[_0x3ee1('0x2b')],_0x2bc0f0[_0x3ee1('0x57')]['toLowerCase']()));}})[_0x3ee1('0x45')](handleError(_0x31464a,null));}; \ No newline at end of file +var _0x7e2d=['save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','AnalyticExtractedReport','rawAttributes','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','download','basename','savename','existsSync','join','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','root','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7e2d,0x9b));var _0xd7e2=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x7e2d[_0x23e7c1];return _0x1add43;};'use strict';var emlformat=require(_0xd7e2('0x0'));var rimraf=require(_0xd7e2('0x1'));var zipdir=require(_0xd7e2('0x2'));var jsonpatch=require(_0xd7e2('0x3'));var rp=require(_0xd7e2('0x4'));var moment=require(_0xd7e2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd7e2('0x6'));var path=require(_0xd7e2('0x7'));var sox=require(_0xd7e2('0x8'));var csv=require('to-csv');var ejs=require(_0xd7e2('0x9'));var fs=require('fs');var fs_extra=require(_0xd7e2('0xa'));var _=require(_0xd7e2('0xb'));var squel=require(_0xd7e2('0xc'));var crypto=require(_0xd7e2('0xd'));var jsforce=require(_0xd7e2('0xe'));var deskjs=require(_0xd7e2('0xf'));var toCsv=require(_0xd7e2('0x10'));var querystring=require(_0xd7e2('0x11'));var Papa=require(_0xd7e2('0x12'));var Redis=require(_0xd7e2('0x13'));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(_0xd7e2('0x14'))('api');var utils=require(_0xd7e2('0x15'));var config=require(_0xd7e2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd7e2('0x17'))['db'];function respondWithStatusCode(_0x285cf1,_0x265461){_0x265461=_0x265461||0xcc;return function(_0x2aa12e){if(_0x2aa12e){return _0x285cf1[_0xd7e2('0x18')](_0x265461);}return _0x285cf1[_0xd7e2('0x19')](_0x265461)[_0xd7e2('0x1a')]();};}function respondWithResult(_0x3f8de4,_0x5ea61c){_0x5ea61c=_0x5ea61c||0xc8;return function(_0x4cd056){if(_0x4cd056){return _0x3f8de4[_0xd7e2('0x19')](_0x5ea61c)['json'](_0x4cd056);}};}function respondWithFilteredResult(_0xe8f604,_0x3a1f52){return function(_0x6b8c2){if(_0x6b8c2){var _0x193c5f=typeof _0x3a1f52[_0xd7e2('0x1b')]==='undefined'&&typeof _0x3a1f52[_0xd7e2('0x1c')]===_0xd7e2('0x1d');var _0x33ee30=_0x6b8c2['count'];var _0x18f47b=_0x193c5f?0x0:_0x3a1f52[_0xd7e2('0x1b')];var _0x1b5de5=_0x193c5f?_0x6b8c2[_0xd7e2('0x1e')]:_0x3a1f52['offset']+_0x3a1f52['limit'];var _0x4fcc6e;if(_0x1b5de5>=_0x33ee30){_0x1b5de5=_0x33ee30;_0x4fcc6e=0xc8;}else{_0x4fcc6e=0xce;}_0xe8f604[_0xd7e2('0x19')](_0x4fcc6e);return _0xe8f604[_0xd7e2('0x1f')](_0xd7e2('0x20'),_0x18f47b+'-'+_0x1b5de5+'/'+_0x33ee30)['json'](_0x6b8c2);}return null;};}function patchUpdates(_0x1207a1){return function(_0x4238bd){try{jsonpatch[_0xd7e2('0x21')](_0x4238bd,_0x1207a1,!![]);}catch(_0x5a6a87){return BPromise[_0xd7e2('0x22')](_0x5a6a87);}return _0x4238bd[_0xd7e2('0x23')]();};}function saveUpdates(_0x44daf3,_0x553401){return function(_0xeca21f){if(_0xeca21f){return _0xeca21f['update'](_0x44daf3)[_0xd7e2('0x24')](function(_0x4a9a0c){return _0x4a9a0c;});}return null;};}function removeEntity(_0x554c1f,_0x479328){return function(_0x3c2925){if(_0x3c2925){return _0x3c2925[_0xd7e2('0x25')]()[_0xd7e2('0x24')](function(){var _0x33db2e=_0x3c2925[_0xd7e2('0x26')]({'plain':!![]});var _0x52d15a=_0xd7e2('0x27');return db[_0xd7e2('0x28')]['destroy']({'where':{'type':_0x52d15a,'resourceId':_0x33db2e['id']}})[_0xd7e2('0x24')](function(){return _0x3c2925;});})[_0xd7e2('0x24')](function(){_0x554c1f[_0xd7e2('0x19')](0xcc)[_0xd7e2('0x1a')]();});}};}function handleEntityNotFound(_0x54d936,_0x737033){return function(_0x49e409){if(!_0x49e409){_0x54d936[_0xd7e2('0x18')](0x194);}return _0x49e409;};}function handleError(_0x5a67c2,_0x2fe540){_0x2fe540=_0x2fe540||0x1f4;return function(_0x210916){logger[_0xd7e2('0x29')](_0x210916[_0xd7e2('0x2a')]);if(_0x210916[_0xd7e2('0x2b')]){delete _0x210916['name'];}_0x5a67c2[_0xd7e2('0x19')](_0x2fe540)['send'](_0x210916);};}exports[_0xd7e2('0x2c')]=function(_0x1c796e,_0xc1623e){var _0x52f0be={},_0x19dc5c={},_0x572793={'count':0x0,'rows':[]};var _0x3f6e1d=_['map'](db[_0xd7e2('0x2d')][_0xd7e2('0x2e')],function(_0x3d412b){return{'name':_0x3d412b['fieldName'],'type':_0x3d412b[_0xd7e2('0x2f')][_0xd7e2('0x30')]};});_0x19dc5c['model']=_[_0xd7e2('0x31')](_0x3f6e1d,_0xd7e2('0x2b'));_0x19dc5c[_0xd7e2('0x32')]=_[_0xd7e2('0x33')](_0x1c796e[_0xd7e2('0x32')]);_0x19dc5c[_0xd7e2('0x34')]=_[_0xd7e2('0x35')](_0x19dc5c[_0xd7e2('0x36')],_0x19dc5c[_0xd7e2('0x32')]);_0x52f0be['attributes']=_[_0xd7e2('0x35')](_0x19dc5c[_0xd7e2('0x36')],qs[_0xd7e2('0x37')](_0x1c796e[_0xd7e2('0x32')][_0xd7e2('0x37')]));_0x52f0be['attributes']=_0x52f0be[_0xd7e2('0x38')][_0xd7e2('0x39')]?_0x52f0be[_0xd7e2('0x38')]:_0x19dc5c[_0xd7e2('0x36')];if(!_0x1c796e[_0xd7e2('0x32')]['hasOwnProperty'](_0xd7e2('0x3a'))){_0x52f0be[_0xd7e2('0x1c')]=qs[_0xd7e2('0x1c')](_0x1c796e[_0xd7e2('0x32')][_0xd7e2('0x1c')]);_0x52f0be['offset']=qs[_0xd7e2('0x1b')](_0x1c796e[_0xd7e2('0x32')][_0xd7e2('0x1b')]);}_0x52f0be[_0xd7e2('0x3b')]=qs[_0xd7e2('0x3c')](_0x1c796e['query'][_0xd7e2('0x3c')]);_0x52f0be[_0xd7e2('0x3d')]=qs[_0xd7e2('0x34')](_[_0xd7e2('0x3e')](_0x1c796e[_0xd7e2('0x32')],_0x19dc5c[_0xd7e2('0x34')]),_0x3f6e1d);if(_0x1c796e['query'][_0xd7e2('0x3f')]){_0x52f0be['where']=_['merge'](_0x52f0be[_0xd7e2('0x3d')],{'$or':_[_0xd7e2('0x31')](_0x3f6e1d,function(_0x5f54b1){if(_0x5f54b1[_0xd7e2('0x2f')]!==_0xd7e2('0x40')){var _0x15bb78={};_0x15bb78[_0x5f54b1[_0xd7e2('0x2b')]]={'$like':'%'+_0x1c796e[_0xd7e2('0x32')]['filter']+'%'};return _0x15bb78;}})});}_0x52f0be=_[_0xd7e2('0x41')]({},_0x52f0be,_0x1c796e[_0xd7e2('0x42')]);var _0x432c9b={'where':_0x52f0be['where']};return db[_0xd7e2('0x2d')][_0xd7e2('0x1e')](_0x432c9b)[_0xd7e2('0x24')](function(_0x30da3d){_0x572793['count']=_0x30da3d;if(_0x1c796e['query'][_0xd7e2('0x43')]){_0x52f0be['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xd7e2('0x44')](_0x52f0be);})[_0xd7e2('0x24')](function(_0x4bf905){_0x572793['rows']=_0x4bf905;return _0x572793;})['then'](respondWithFilteredResult(_0xc1623e,_0x52f0be))['catch'](handleError(_0xc1623e,null));};exports[_0xd7e2('0x45')]=function(_0x52e800,_0x3f4a6a){var _0x4fd2f5={'raw':!![],'where':{'id':_0x52e800[_0xd7e2('0x46')]['id']}},_0x3ae74f={};_0x3ae74f[_0xd7e2('0x36')]=_['keys'](db[_0xd7e2('0x2d')][_0xd7e2('0x2e')]);_0x3ae74f['query']=_[_0xd7e2('0x33')](_0x52e800['query']);_0x3ae74f[_0xd7e2('0x34')]=_[_0xd7e2('0x35')](_0x3ae74f['model'],_0x3ae74f[_0xd7e2('0x32')]);_0x4fd2f5[_0xd7e2('0x38')]=_[_0xd7e2('0x35')](_0x3ae74f[_0xd7e2('0x36')],qs[_0xd7e2('0x37')](_0x52e800[_0xd7e2('0x32')][_0xd7e2('0x37')]));_0x4fd2f5[_0xd7e2('0x38')]=_0x4fd2f5[_0xd7e2('0x38')][_0xd7e2('0x39')]?_0x4fd2f5[_0xd7e2('0x38')]:_0x3ae74f['model'];if(_0x52e800[_0xd7e2('0x32')]['includeAll']){_0x4fd2f5[_0xd7e2('0x47')]=[{'all':!![]}];}_0x4fd2f5=_[_0xd7e2('0x41')]({},_0x4fd2f5,_0x52e800[_0xd7e2('0x42')]);return db['AnalyticExtractedReport'][_0xd7e2('0x48')](_0x4fd2f5)[_0xd7e2('0x24')](handleEntityNotFound(_0x3f4a6a,null))[_0xd7e2('0x24')](respondWithResult(_0x3f4a6a,null))[_0xd7e2('0x49')](handleError(_0x3f4a6a,null));};exports[_0xd7e2('0x4a')]=function(_0x2045f9,_0x2300ee){return db[_0xd7e2('0x2d')][_0xd7e2('0x4a')](_0x2045f9[_0xd7e2('0x4b')],{})[_0xd7e2('0x24')](function(_0x26e039){var _0x4d7210=_0x2045f9[_0xd7e2('0x4c')]['get']({'plain':!![]});if(!_0x4d7210)throw new Error(_0xd7e2('0x4d'));if(_0x4d7210[_0xd7e2('0x4e')]===_0xd7e2('0x4c')){var _0x32b292=_0x26e039[_0xd7e2('0x26')]({'plain':!![]});var _0x927633=_0xd7e2('0x27');return db[_0xd7e2('0x4f')][_0xd7e2('0x48')]({'where':{'name':_0x927633,'userProfileId':_0x4d7210[_0xd7e2('0x50')]},'raw':!![]})['then'](function(_0x5ab4a1){if(_0x5ab4a1&&_0x5ab4a1[_0xd7e2('0x51')]===0x0){return db[_0xd7e2('0x28')][_0xd7e2('0x4a')]({'name':_0x32b292[_0xd7e2('0x2b')],'resourceId':_0x32b292['id'],'type':_0x5ab4a1[_0xd7e2('0x2b')],'sectionId':_0x5ab4a1['id']},{})[_0xd7e2('0x24')](function(){return _0x26e039;});}else{return _0x26e039;}})[_0xd7e2('0x49')](function(_0x4b0090){logger[_0xd7e2('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b0090);throw _0x4b0090;});}return _0x26e039;})['then'](respondWithResult(_0x2300ee,0xc9))[_0xd7e2('0x49')](handleError(_0x2300ee,null));};exports[_0xd7e2('0x52')]=function(_0x3d1542,_0x5c52b8){if(_0x3d1542[_0xd7e2('0x4b')]['id']){delete _0x3d1542['body']['id'];}return db[_0xd7e2('0x2d')]['find']({'where':{'id':_0x3d1542[_0xd7e2('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c52b8,null))[_0xd7e2('0x24')](saveUpdates(_0x3d1542[_0xd7e2('0x4b')],null))['then'](respondWithResult(_0x5c52b8,null))[_0xd7e2('0x49')](handleError(_0x5c52b8,null));};exports[_0xd7e2('0x25')]=function(_0x457bba,_0x3082ab){return db['AnalyticExtractedReport'][_0xd7e2('0x48')]({'where':{'id':_0x457bba[_0xd7e2('0x46')]['id']}})[_0xd7e2('0x24')](handleEntityNotFound(_0x3082ab,null))[_0xd7e2('0x24')](removeEntity(_0x3082ab,null))[_0xd7e2('0x49')](handleError(_0x3082ab,null));};exports[_0xd7e2('0x53')]=function(_0x110bb5,_0x377625,_0x55ea1a){return db[_0xd7e2('0x2d')][_0xd7e2('0x48')]({'where':{'id':_0x110bb5['params']['id']},'attributes':['name',_0xd7e2('0x54'),_0xd7e2('0x55'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x377625,null))[_0xd7e2('0x24')](function(_0x1e43e2){if(_0x1e43e2){if(!fs[_0xd7e2('0x56')](path[_0xd7e2('0x57')](config['root'],_0xd7e2('0x58'),_0x1e43e2[_0xd7e2('0x55')]))){throw new db['Sequelize'][(_0xd7e2('0x59'))](_0xd7e2('0x5a'));}if(_0x110bb5[_0xd7e2('0x32')]['exists']){return _0x377625[_0xd7e2('0x18')](0xc8);}return _0x377625['download'](path[_0xd7e2('0x57')](config[_0xd7e2('0x5b')],_0xd7e2('0x58'),_0x1e43e2[_0xd7e2('0x55')]),util['format'](_0xd7e2('0x5c'),_0x1e43e2[_0xd7e2('0x54')]||_0x1e43e2[_0xd7e2('0x2b')],_0x1e43e2[_0xd7e2('0x5d')][_0xd7e2('0x5e')]()));}})[_0xd7e2('0x49')](handleError(_0x377625,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index bc6d1a3..ee6373d 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 _0x25e9=['../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','api','moment','request-promise','path','rimraf'];(function(_0x25900d,_0x1d3576){var _0x292ad9=function(_0x4a7ccc){while(--_0x4a7ccc){_0x25900d['push'](_0x25900d['shift']());}};_0x292ad9(++_0x1d3576);}(_0x25e9,0xaf));var _0x925e=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x25e9[_0x1147ab];return _0x55cb5a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x925e('0x0'));var moment=require(_0x925e('0x1'));var BPromise=require('bluebird');var rp=require(_0x925e('0x2'));var fs=require('fs');var path=require(_0x925e('0x3'));var rimraf=require(_0x925e('0x4'));var config=require(_0x925e('0x5'));var attributes=require(_0x925e('0x6'));module[_0x925e('0x7')]=function(_0x1049d5,_0x12e5f1){return _0x1049d5[_0x925e('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0x925e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3aba=['path','../../config/environment','exports','define','analytics_extracted_reports','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3103ed,_0x179ff1){var _0x221e31=function(_0x3c8931){while(--_0x3c8931){_0x3103ed['push'](_0x3103ed['shift']());}};_0x221e31(++_0x179ff1);}(_0x3aba,0x1de));var _0xa3ab=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0x3aba[_0x3ceb54];return _0x26d8a6;};'use strict';var _=require(_0xa3ab('0x0'));var util=require(_0xa3ab('0x1'));var logger=require('../../config/logger')(_0xa3ab('0x2'));var moment=require(_0xa3ab('0x3'));var BPromise=require(_0xa3ab('0x4'));var rp=require(_0xa3ab('0x5'));var fs=require('fs');var path=require(_0xa3ab('0x6'));var rimraf=require('rimraf');var config=require(_0xa3ab('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0xa3ab('0x8')]=function(_0x4ecf6c,_0x548e68){return _0x4ecf6c[_0xa3ab('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0xa3ab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 50d667f..d8146a3 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 _0xa71a=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','info','catch','lodash'];(function(_0x3873b0,_0x455688){var _0x6fa204=function(_0x560e95){while(--_0x560e95){_0x3873b0['push'](_0x3873b0['shift']());}};_0x6fa204(++_0x455688);}(_0xa71a,0xf1));var _0xaa71=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa71a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xaa71('0x0'));var util=require(_0xaa71('0x1'));var moment=require(_0xaa71('0x2'));var BPromise=require(_0xaa71('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa71('0x4'));var db=require(_0xaa71('0x5'))['db'];var utils=require(_0xaa71('0x6'));var logger=require('../../config/logger')(_0xaa71('0x7'));var config=require('../../config/environment');var jayson=require(_0xaa71('0x8'));var client=jayson[_0xaa71('0x9')][_0xaa71('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5893aa,_0x274dce,_0x35b8cf){return new BPromise(function(_0x5a0dca,_0x50ad8f){return client[_0xaa71('0xb')](_0x5893aa,_0x35b8cf)[_0xaa71('0xc')](function(_0xc26148){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x274dce,_0xaa71('0xd'));logger[_0xaa71('0xe')](_0xaa71('0xf'),_0x274dce,_0xaa71('0xd'),JSON[_0xaa71('0x10')](_0xc26148));if(_0xc26148[_0xaa71('0x11')]){if(_0xc26148['error']['code']===0x1f4){logger['error'](_0xaa71('0x12'),_0x274dce,_0xc26148[_0xaa71('0x11')][_0xaa71('0x13')]);return _0x50ad8f(_0xc26148['error'][_0xaa71('0x13')]);}logger[_0xaa71('0x11')](_0xaa71('0x12'),_0x274dce,_0xc26148[_0xaa71('0x11')][_0xaa71('0x13')]);return _0x5a0dca(_0xc26148[_0xaa71('0x11')]['message']);}else{logger[_0xaa71('0x14')](_0xaa71('0x12'),_0x274dce,_0xaa71('0xd'));_0x5a0dca(_0xc26148['result'][_0xaa71('0x13')]);}})[_0xaa71('0x15')](function(_0x25a7ac){logger[_0xaa71('0x11')](_0xaa71('0x12'),_0x274dce,_0x25a7ac);_0x50ad8f(_0x25a7ac);});});} \ No newline at end of file +var _0x4f37=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4c4d00,_0x4b1cad){var _0x1a2a84=function(_0x4f6913){while(--_0x4f6913){_0x4c4d00['push'](_0x4c4d00['shift']());}};_0x1a2a84(++_0x4b1cad);}(_0x4f37,0xa4));var _0x74f3=function(_0x328965,_0x1e92ea){_0x328965=_0x328965-0x0;var _0x1b5415=_0x4f37[_0x328965];return _0x1b5415;};'use strict';var _=require(_0x74f3('0x0'));var util=require(_0x74f3('0x1'));var moment=require(_0x74f3('0x2'));var BPromise=require(_0x74f3('0x3'));var rs=require(_0x74f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74f3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x74f3('0x6'))(_0x74f3('0x7'));var config=require(_0x74f3('0x8'));var jayson=require(_0x74f3('0x9'));var client=jayson['client'][_0x74f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f7004,_0x15c735,_0x1a566a){return new BPromise(function(_0x4c025a,_0x40f01b){return client[_0x74f3('0xb')](_0x1f7004,_0x1a566a)[_0x74f3('0xc')](function(_0x30dc29){logger[_0x74f3('0xd')](_0x74f3('0xe'),_0x15c735,_0x74f3('0xf'));logger[_0x74f3('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x15c735,_0x74f3('0xf'),JSON['stringify'](_0x30dc29));if(_0x30dc29[_0x74f3('0x11')]){if(_0x30dc29['error']['code']===0x1f4){logger[_0x74f3('0x11')](_0x74f3('0xe'),_0x15c735,_0x30dc29['error'][_0x74f3('0x12')]);return _0x40f01b(_0x30dc29[_0x74f3('0x11')][_0x74f3('0x12')]);}logger['error'](_0x74f3('0xe'),_0x15c735,_0x30dc29['error']['message']);return _0x4c025a(_0x30dc29[_0x74f3('0x11')][_0x74f3('0x12')]);}else{logger[_0x74f3('0xd')](_0x74f3('0xe'),_0x15c735,_0x74f3('0xf'));_0x4c025a(_0x30dc29[_0x74f3('0x13')][_0x74f3('0x12')]);}})[_0x74f3('0x14')](function(_0x9553ee){logger['error'](_0x74f3('0xe'),_0x15c735,_0x9553ee);_0x40f01b(_0x9553ee);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 68d5e0a..1718766 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 _0x599f=['get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x12aa5b,_0x36424a){var _0x34fb62=function(_0x59fa6d){while(--_0x59fa6d){_0x12aa5b['push'](_0x12aa5b['shift']());}};_0x34fb62(++_0x36424a);}(_0x599f,0x167));var _0xf599=function(_0x57f6db,_0x28c6c5){_0x57f6db=_0x57f6db-0x0;var _0x44d061=_0x599f[_0x57f6db];return _0x44d061;};'use strict';var multer=require(_0xf599('0x0'));var util=require(_0xf599('0x1'));var path=require('path');var timeout=require(_0xf599('0x2'));var express=require(_0xf599('0x3'));var router=express[_0xf599('0x4')]();var fs_extra=require(_0xf599('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf599('0x6'));var config=require(_0xf599('0x7'));var controller=require(_0xf599('0x8'));router[_0xf599('0x9')]('/',auth[_0xf599('0xa')](),controller[_0xf599('0xb')]);router['get'](_0xf599('0xc'),auth[_0xf599('0xa')](),controller[_0xf599('0xd')]);router[_0xf599('0x9')](_0xf599('0xe'),auth['isAuthenticated'](),controller[_0xf599('0xf')]);router[_0xf599('0x10')]('/',auth[_0xf599('0xa')](),controller[_0xf599('0x11')]);router[_0xf599('0x12')](_0xf599('0xc'),auth[_0xf599('0xa')](),controller[_0xf599('0x13')]);router[_0xf599('0x14')](_0xf599('0xc'),auth[_0xf599('0xa')](),controller[_0xf599('0x15')]);module[_0xf599('0x16')]=router; \ No newline at end of file +var _0x2de3=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/download','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x32cdda,_0x301ef2){var _0x4db898=function(_0x3f1378){while(--_0x3f1378){_0x32cdda['push'](_0x32cdda['shift']());}};_0x4db898(++_0x301ef2);}(_0x2de3,0x7f));var _0x32de=function(_0x5d2b3d,_0x261350){_0x5d2b3d=_0x5d2b3d-0x0;var _0x58dd7c=_0x2de3[_0x5d2b3d];return _0x58dd7c;};'use strict';var multer=require(_0x32de('0x0'));var util=require(_0x32de('0x1'));var path=require(_0x32de('0x2'));var timeout=require(_0x32de('0x3'));var express=require(_0x32de('0x4'));var router=express[_0x32de('0x5')]();var fs_extra=require(_0x32de('0x6'));var auth=require(_0x32de('0x7'));var interaction=require(_0x32de('0x8'));var config=require(_0x32de('0x9'));var controller=require('./analyticExtractedReport.controller');router[_0x32de('0xa')]('/',auth['isAuthenticated'](),controller[_0x32de('0xb')]);router[_0x32de('0xa')](_0x32de('0xc'),auth[_0x32de('0xd')](),controller[_0x32de('0xe')]);router[_0x32de('0xa')](_0x32de('0xf'),auth[_0x32de('0xd')](),controller['download']);router[_0x32de('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32de('0x11')](_0x32de('0xc'),auth[_0x32de('0xd')](),controller[_0x32de('0x12')]);router[_0x32de('0x13')](_0x32de('0xc'),auth[_0x32de('0xd')](),controller[_0x32de('0x14')]);module[_0x32de('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 900eeb0..a4d79af 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 _0xc582=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0xe84d45,_0x59d7cf){var _0x41d88e=function(_0x270741){while(--_0x270741){_0xe84d45['push'](_0xe84d45['shift']());}};_0x41d88e(++_0x59d7cf);}(_0xc582,0x7d));var _0x2c58=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xc582[_0x725b8e];return _0x43ac45;};'use strict';var Sequelize=require(_0x2c58('0x0'));module[_0x2c58('0x1')]={'field':{'type':Sequelize[_0x2c58('0x2')]},'alias':{'type':Sequelize[_0x2c58('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x2c58('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2c58('0x3')]},'custom':{'type':Sequelize[_0x2c58('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x7ba6=['sequelize','STRING','BOOLEAN'];(function(_0x442f5e,_0x702585){var _0xdd19c5=function(_0x3b1d26){while(--_0x3b1d26){_0x442f5e['push'](_0x442f5e['shift']());}};_0xdd19c5(++_0x702585);}(_0x7ba6,0x9f));var _0x67ba=function(_0x138644,_0x429855){_0x138644=_0x138644-0x0;var _0x5c2f82=_0x7ba6[_0x138644];return _0x5c2f82;};'use strict';var Sequelize=require(_0x67ba('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x67ba('0x1')]},'function':{'type':Sequelize[_0x67ba('0x1')]},'format':{'type':Sequelize[_0x67ba('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x67ba('0x1')]},'custom':{'type':Sequelize[_0x67ba('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 7f9387f..57e9f6e 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 _0x1b89=['apply','save','update','destroy','error','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','VIRTUAL','name','options','where','then','include','findAll','catch','show','params','fields','includeAll','find','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count'];(function(_0x3392df,_0x53b20f){var _0x3e5a91=function(_0xb90478){while(--_0xb90478){_0x3392df['push'](_0x3392df['shift']());}};_0x3e5a91(++_0x53b20f);}(_0x1b89,0xd4));var _0x91b8=function(_0x53b78f,_0x397490){_0x53b78f=_0x53b78f-0x0;var _0x2241a9=_0x1b89[_0x53b78f];return _0x2241a9;};'use strict';var emlformat=require(_0x91b8('0x0'));var rimraf=require(_0x91b8('0x1'));var zipdir=require(_0x91b8('0x2'));var jsonpatch=require(_0x91b8('0x3'));var rp=require('request-promise');var moment=require(_0x91b8('0x4'));var BPromise=require(_0x91b8('0x5'));var Mustache=require(_0x91b8('0x6'));var util=require(_0x91b8('0x7'));var path=require(_0x91b8('0x8'));var sox=require(_0x91b8('0x9'));var csv=require(_0x91b8('0xa'));var ejs=require(_0x91b8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x91b8('0xc'));var crypto=require(_0x91b8('0xd'));var jsforce=require(_0x91b8('0xe'));var deskjs=require(_0x91b8('0xf'));var toCsv=require(_0x91b8('0xa'));var querystring=require(_0x91b8('0x10'));var Papa=require(_0x91b8('0x11'));var Redis=require(_0x91b8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x91b8('0x13'));var as=require(_0x91b8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x91b8('0x15'));var utils=require(_0x91b8('0x16'));var config=require(_0x91b8('0x17'));var licenseUtil=require(_0x91b8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b095f,_0x2cb198){_0x2cb198=_0x2cb198||0xcc;return function(_0x2d5e0f){if(_0x2d5e0f){return _0x2b095f[_0x91b8('0x19')](_0x2cb198);}return _0x2b095f[_0x91b8('0x1a')](_0x2cb198)[_0x91b8('0x1b')]();};}function respondWithResult(_0x5461e9,_0x291607){_0x291607=_0x291607||0xc8;return function(_0x12c107){if(_0x12c107){return _0x5461e9[_0x91b8('0x1a')](_0x291607)['json'](_0x12c107);}};}function respondWithFilteredResult(_0x4522e6,_0x1f7dff){return function(_0x16a4fb){if(_0x16a4fb){var _0x3b5b7e=typeof _0x1f7dff[_0x91b8('0x1c')]===_0x91b8('0x1d')&&typeof _0x1f7dff['limit']===_0x91b8('0x1d');var _0x34a60a=_0x16a4fb[_0x91b8('0x1e')];var _0x5e7e93=_0x3b5b7e?0x0:_0x1f7dff[_0x91b8('0x1c')];var _0x3f5881=_0x3b5b7e?_0x16a4fb[_0x91b8('0x1e')]:_0x1f7dff['offset']+_0x1f7dff['limit'];var _0x5eb50a;if(_0x3f5881>=_0x34a60a){_0x3f5881=_0x34a60a;_0x5eb50a=0xc8;}else{_0x5eb50a=0xce;}_0x4522e6[_0x91b8('0x1a')](_0x5eb50a);return _0x4522e6['set']('Content-Range',_0x5e7e93+'-'+_0x3f5881+'/'+_0x34a60a)['json'](_0x16a4fb);}return null;};}function patchUpdates(_0x50a20e){return function(_0x3b22b0){try{jsonpatch[_0x91b8('0x1f')](_0x3b22b0,_0x50a20e,!![]);}catch(_0x5c7195){return BPromise['reject'](_0x5c7195);}return _0x3b22b0[_0x91b8('0x20')]();};}function saveUpdates(_0x46f5f8,_0x191dd2){return function(_0x168644){if(_0x168644){return _0x168644[_0x91b8('0x21')](_0x46f5f8)['then'](function(_0x1e9a9f){return _0x1e9a9f;});}return null;};}function removeEntity(_0x1710b4,_0x41d557){return function(_0xe1d4e5){if(_0xe1d4e5){return _0xe1d4e5[_0x91b8('0x22')]()['then'](function(){_0x1710b4[_0x91b8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f2129,_0x505430){return function(_0x14efb2){if(!_0x14efb2){_0x4f2129[_0x91b8('0x19')](0x194);}return _0x14efb2;};}function handleError(_0x5a6d3c,_0x26ff69){_0x26ff69=_0x26ff69||0x1f4;return function(_0x2e2d2d){logger[_0x91b8('0x23')](_0x2e2d2d['stack']);if(_0x2e2d2d['name']){delete _0x2e2d2d['name'];}_0x5a6d3c['status'](_0x26ff69)[_0x91b8('0x24')](_0x2e2d2d);};}exports[_0x91b8('0x25')]=function(_0x4fa69e,_0x3557e9){var _0x4114b2={},_0x3daa35={},_0x2d6570={'count':0x0,'rows':[]};var _0x498832=_[_0x91b8('0x26')](db[_0x91b8('0x27')][_0x91b8('0x28')],function(_0x5d0b8d){return{'name':_0x5d0b8d[_0x91b8('0x29')],'type':_0x5d0b8d[_0x91b8('0x2a')]['key']};});_0x3daa35[_0x91b8('0x2b')]=_[_0x91b8('0x26')](_0x498832,'name');_0x3daa35[_0x91b8('0x2c')]=_[_0x91b8('0x2d')](_0x4fa69e[_0x91b8('0x2c')]);_0x3daa35[_0x91b8('0x2e')]=_[_0x91b8('0x2f')](_0x3daa35[_0x91b8('0x2b')],_0x3daa35[_0x91b8('0x2c')]);_0x4114b2[_0x91b8('0x30')]=_[_0x91b8('0x2f')](_0x3daa35[_0x91b8('0x2b')],qs['fields'](_0x4fa69e[_0x91b8('0x2c')]['fields']));_0x4114b2[_0x91b8('0x30')]=_0x4114b2['attributes'][_0x91b8('0x31')]?_0x4114b2[_0x91b8('0x30')]:_0x3daa35[_0x91b8('0x2b')];if(!_0x4fa69e['query'][_0x91b8('0x32')](_0x91b8('0x33'))){_0x4114b2['limit']=qs[_0x91b8('0x34')](_0x4fa69e[_0x91b8('0x2c')][_0x91b8('0x34')]);_0x4114b2[_0x91b8('0x1c')]=qs[_0x91b8('0x1c')](_0x4fa69e[_0x91b8('0x2c')]['offset']);}_0x4114b2[_0x91b8('0x35')]=qs['sort'](_0x4fa69e['query'][_0x91b8('0x36')]);_0x4114b2['where']=qs[_0x91b8('0x2e')](_[_0x91b8('0x37')](_0x4fa69e['query'],_0x3daa35['filters']),_0x498832);if(_0x4fa69e['query'][_0x91b8('0x38')]){_0x4114b2['where']=_[_0x91b8('0x39')](_0x4114b2['where'],{'$or':_[_0x91b8('0x26')](_0x498832,function(_0x2dafc1){if(_0x2dafc1[_0x91b8('0x2a')]!==_0x91b8('0x3a')){var _0xa1b59e={};_0xa1b59e[_0x2dafc1[_0x91b8('0x3b')]]={'$like':'%'+_0x4fa69e[_0x91b8('0x2c')][_0x91b8('0x38')]+'%'};return _0xa1b59e;}})});}_0x4114b2=_[_0x91b8('0x39')]({},_0x4114b2,_0x4fa69e[_0x91b8('0x3c')]);var _0x162a3e={'where':_0x4114b2[_0x91b8('0x3d')]};return db[_0x91b8('0x27')][_0x91b8('0x1e')](_0x162a3e)[_0x91b8('0x3e')](function(_0x47b1db){_0x2d6570['count']=_0x47b1db;if(_0x4fa69e['query']['includeAll']){_0x4114b2[_0x91b8('0x3f')]=[{'all':!![]}];}return db[_0x91b8('0x27')][_0x91b8('0x40')](_0x4114b2);})[_0x91b8('0x3e')](function(_0x5afcdb){_0x2d6570['rows']=_0x5afcdb;return _0x2d6570;})[_0x91b8('0x3e')](respondWithFilteredResult(_0x3557e9,_0x4114b2))[_0x91b8('0x41')](handleError(_0x3557e9,null));};exports[_0x91b8('0x42')]=function(_0x5b3cfb,_0x2d7671){var _0x206bc6={'raw':![],'where':{'id':_0x5b3cfb[_0x91b8('0x43')]['id']}},_0x407b0e={};_0x407b0e[_0x91b8('0x2b')]=_[_0x91b8('0x2d')](db[_0x91b8('0x27')][_0x91b8('0x28')]);_0x407b0e[_0x91b8('0x2c')]=_[_0x91b8('0x2d')](_0x5b3cfb[_0x91b8('0x2c')]);_0x407b0e['filters']=_['intersection'](_0x407b0e['model'],_0x407b0e[_0x91b8('0x2c')]);_0x206bc6[_0x91b8('0x30')]=_['intersection'](_0x407b0e['model'],qs['fields'](_0x5b3cfb[_0x91b8('0x2c')][_0x91b8('0x44')]));_0x206bc6[_0x91b8('0x30')]=_0x206bc6[_0x91b8('0x30')]['length']?_0x206bc6['attributes']:_0x407b0e[_0x91b8('0x2b')];if(_0x5b3cfb['query'][_0x91b8('0x45')]){_0x206bc6['include']=[{'all':!![]}];}_0x206bc6=_[_0x91b8('0x39')]({},_0x206bc6,_0x5b3cfb[_0x91b8('0x3c')]);return db[_0x91b8('0x27')][_0x91b8('0x46')](_0x206bc6)[_0x91b8('0x3e')](handleEntityNotFound(_0x2d7671,null))[_0x91b8('0x3e')](respondWithResult(_0x2d7671,null))[_0x91b8('0x41')](handleError(_0x2d7671,null));};exports[_0x91b8('0x47')]=function(_0x16db68,_0x1c8e8c){return db[_0x91b8('0x27')][_0x91b8('0x47')](_0x16db68[_0x91b8('0x48')],{})[_0x91b8('0x3e')](respondWithResult(_0x1c8e8c,0xc9))[_0x91b8('0x41')](handleError(_0x1c8e8c,null));};exports[_0x91b8('0x49')]=function(_0x192469,_0x4b1419){return db[_0x91b8('0x27')]['bulkCreate'](_0x192469[_0x91b8('0x48')],{'raw':![],'individualHooks':!![]})[_0x91b8('0x3e')](respondWithResult(_0x4b1419,0xc9))[_0x91b8('0x41')](handleError(_0x4b1419,null));};exports['update']=function(_0x4b957c,_0x7c30e3){if(_0x4b957c['body']['id']){delete _0x4b957c['body']['id'];}return db[_0x91b8('0x27')][_0x91b8('0x46')]({'where':{'id':_0x4b957c[_0x91b8('0x43')]['id']}})[_0x91b8('0x3e')](handleEntityNotFound(_0x7c30e3,null))[_0x91b8('0x3e')](saveUpdates(_0x4b957c[_0x91b8('0x48')],null))['then'](respondWithResult(_0x7c30e3,null))['catch'](handleError(_0x7c30e3,null));};exports['destroy']=function(_0x471827,_0x5989bc){return db[_0x91b8('0x27')]['find']({'where':{'id':_0x471827['params']['id']}})[_0x91b8('0x3e')](handleEntityNotFound(_0x5989bc,null))[_0x91b8('0x3e')](removeEntity(_0x5989bc,null))[_0x91b8('0x41')](handleError(_0x5989bc,null));};exports[_0x91b8('0x4a')]=function(_0x1fe784,_0x1cb0f2){return db[_0x91b8('0x27')][_0x91b8('0x22')]({'where':{'id':_0x1fe784[_0x91b8('0x2c')][_0x91b8('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1cb0f2,0xcc))['catch'](handleError(_0x1cb0f2,null));};exports['addFields']=function(_0x1c5866,_0x7ff183,_0x5a63fc){return db[_0x91b8('0x4c')][_0x91b8('0x4d')]({'where':{'id':_0x1c5866[_0x91b8('0x43')]['id']}})[_0x91b8('0x3e')](handleEntityNotFound(_0x7ff183,null))[_0x91b8('0x3e')](function(_0x3d5272){if(_0x3d5272){return db[_0x91b8('0x4e')][_0x91b8('0x4f')](function(_0x4c24a0){return db[_0x91b8('0x27')][_0x91b8('0x22')]({'where':{'CustomReportId':_0x1c5866[_0x91b8('0x43')]['id']},'transaction':_0x4c24a0})['then'](function(_0x48821b){var _0x180631=_[_0x91b8('0x26')](_0x1c5866['body'],function(_0x400380){delete _0x400380['id'];_0x400380[_0x91b8('0x50')]=_0x1c5866[_0x91b8('0x43')]['id'];return _0x400380;});return db[_0x91b8('0x27')][_0x91b8('0x49')](_0x180631,{'transaction':_0x4c24a0});});})['then'](function(){return db[_0x91b8('0x27')][_0x91b8('0x40')]({'where':{'CustomReportId':_0x1c5866['params']['id']}});});}})[_0x91b8('0x3e')](respondWithResult(_0x7ff183,null))[_0x91b8('0x41')](handleError(_0x7ff183,null));}; \ No newline at end of file +var _0x05b2=['mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','AnalyticFieldReport','include','findAll','rows','show','params','catch','create','bulkCreate','body','find','addFields','AnalyticCustomReport','findOne','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x43612a,_0x1f32e8){var _0x2e8dc3=function(_0x56b916){while(--_0x56b916){_0x43612a['push'](_0x43612a['shift']());}};_0x2e8dc3(++_0x1f32e8);}(_0x05b2,0x9d));var _0x205b=function(_0x3d45c8,_0x48c603){_0x3d45c8=_0x3d45c8-0x0;var _0x3957a1=_0x05b2[_0x3d45c8];return _0x3957a1;};'use strict';var emlformat=require(_0x205b('0x0'));var rimraf=require(_0x205b('0x1'));var zipdir=require(_0x205b('0x2'));var jsonpatch=require(_0x205b('0x3'));var rp=require(_0x205b('0x4'));var moment=require(_0x205b('0x5'));var BPromise=require(_0x205b('0x6'));var Mustache=require(_0x205b('0x7'));var util=require(_0x205b('0x8'));var path=require(_0x205b('0x9'));var sox=require(_0x205b('0xa'));var csv=require('to-csv');var ejs=require(_0x205b('0xb'));var fs=require('fs');var fs_extra=require(_0x205b('0xc'));var _=require('lodash');var squel=require(_0x205b('0xd'));var crypto=require('crypto');var jsforce=require(_0x205b('0xe'));var deskjs=require(_0x205b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x205b('0x10'));var Papa=require(_0x205b('0x11'));var Redis=require(_0x205b('0x12'));var authService=require(_0x205b('0x13'));var qs=require(_0x205b('0x14'));var as=require(_0x205b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x205b('0x16'))('api');var utils=require(_0x205b('0x17'));var config=require(_0x205b('0x18'));var licenseUtil=require(_0x205b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x102f7a,_0x580658){_0x580658=_0x580658||0xcc;return function(_0x3913e4){if(_0x3913e4){return _0x102f7a[_0x205b('0x1a')](_0x580658);}return _0x102f7a['status'](_0x580658)[_0x205b('0x1b')]();};}function respondWithResult(_0x3d03be,_0x359a6a){_0x359a6a=_0x359a6a||0xc8;return function(_0xa3fbac){if(_0xa3fbac){return _0x3d03be[_0x205b('0x1c')](_0x359a6a)['json'](_0xa3fbac);}};}function respondWithFilteredResult(_0x2cba03,_0x1ef505){return function(_0xb6843d){if(_0xb6843d){var _0x373fe1=typeof _0x1ef505[_0x205b('0x1d')]===_0x205b('0x1e')&&typeof _0x1ef505[_0x205b('0x1f')]===_0x205b('0x1e');var _0x1ae54d=_0xb6843d[_0x205b('0x20')];var _0x12c923=_0x373fe1?0x0:_0x1ef505[_0x205b('0x1d')];var _0x5cb262=_0x373fe1?_0xb6843d[_0x205b('0x20')]:_0x1ef505[_0x205b('0x1d')]+_0x1ef505[_0x205b('0x1f')];var _0x655763;if(_0x5cb262>=_0x1ae54d){_0x5cb262=_0x1ae54d;_0x655763=0xc8;}else{_0x655763=0xce;}_0x2cba03[_0x205b('0x1c')](_0x655763);return _0x2cba03[_0x205b('0x21')](_0x205b('0x22'),_0x12c923+'-'+_0x5cb262+'/'+_0x1ae54d)[_0x205b('0x23')](_0xb6843d);}return null;};}function patchUpdates(_0x41ad31){return function(_0x232ef9){try{jsonpatch[_0x205b('0x24')](_0x232ef9,_0x41ad31,!![]);}catch(_0x3d80f9){return BPromise[_0x205b('0x25')](_0x3d80f9);}return _0x232ef9[_0x205b('0x26')]();};}function saveUpdates(_0x41532a,_0x1fbb99){return function(_0x2e07e1){if(_0x2e07e1){return _0x2e07e1[_0x205b('0x27')](_0x41532a)['then'](function(_0x5ed6ff){return _0x5ed6ff;});}return null;};}function removeEntity(_0x2cb125,_0xffafc5){return function(_0xe973e0){if(_0xe973e0){return _0xe973e0[_0x205b('0x28')]()[_0x205b('0x29')](function(){_0x2cb125[_0x205b('0x1c')](0xcc)[_0x205b('0x1b')]();});}};}function handleEntityNotFound(_0x4c7be8,_0x3e3bf4){return function(_0x413804){if(!_0x413804){_0x4c7be8[_0x205b('0x1a')](0x194);}return _0x413804;};}function handleError(_0xc358d,_0x2c0533){_0x2c0533=_0x2c0533||0x1f4;return function(_0x3c3627){logger[_0x205b('0x2a')](_0x3c3627[_0x205b('0x2b')]);if(_0x3c3627[_0x205b('0x2c')]){delete _0x3c3627[_0x205b('0x2c')];}_0xc358d[_0x205b('0x1c')](_0x2c0533)[_0x205b('0x2d')](_0x3c3627);};}exports[_0x205b('0x2e')]=function(_0x235f15,_0x43f598){var _0x33fbaa={},_0x415f94={},_0x398afd={'count':0x0,'rows':[]};var _0x347324=_[_0x205b('0x2f')](db['AnalyticFieldReport']['rawAttributes'],function(_0x3d1a95){return{'name':_0x3d1a95[_0x205b('0x30')],'type':_0x3d1a95[_0x205b('0x31')][_0x205b('0x32')]};});_0x415f94['model']=_[_0x205b('0x2f')](_0x347324,'name');_0x415f94['query']=_[_0x205b('0x33')](_0x235f15[_0x205b('0x34')]);_0x415f94[_0x205b('0x35')]=_[_0x205b('0x36')](_0x415f94[_0x205b('0x37')],_0x415f94[_0x205b('0x34')]);_0x33fbaa[_0x205b('0x38')]=_[_0x205b('0x36')](_0x415f94[_0x205b('0x37')],qs[_0x205b('0x39')](_0x235f15[_0x205b('0x34')]['fields']));_0x33fbaa['attributes']=_0x33fbaa[_0x205b('0x38')][_0x205b('0x3a')]?_0x33fbaa[_0x205b('0x38')]:_0x415f94[_0x205b('0x37')];if(!_0x235f15[_0x205b('0x34')][_0x205b('0x3b')]('nolimit')){_0x33fbaa[_0x205b('0x1f')]=qs[_0x205b('0x1f')](_0x235f15['query'][_0x205b('0x1f')]);_0x33fbaa[_0x205b('0x1d')]=qs[_0x205b('0x1d')](_0x235f15['query'][_0x205b('0x1d')]);}_0x33fbaa[_0x205b('0x3c')]=qs[_0x205b('0x3d')](_0x235f15[_0x205b('0x34')][_0x205b('0x3d')]);_0x33fbaa[_0x205b('0x3e')]=qs[_0x205b('0x35')](_[_0x205b('0x3f')](_0x235f15['query'],_0x415f94[_0x205b('0x35')]),_0x347324);if(_0x235f15[_0x205b('0x34')][_0x205b('0x40')]){_0x33fbaa[_0x205b('0x3e')]=_[_0x205b('0x41')](_0x33fbaa[_0x205b('0x3e')],{'$or':_['map'](_0x347324,function(_0x1210e5){if(_0x1210e5['type']!=='VIRTUAL'){var _0x34231d={};_0x34231d[_0x1210e5['name']]={'$like':'%'+_0x235f15[_0x205b('0x34')][_0x205b('0x40')]+'%'};return _0x34231d;}})});}_0x33fbaa=_[_0x205b('0x41')]({},_0x33fbaa,_0x235f15[_0x205b('0x42')]);var _0x9755c7={'where':_0x33fbaa[_0x205b('0x3e')]};return db[_0x205b('0x43')][_0x205b('0x20')](_0x9755c7)['then'](function(_0x336f04){_0x398afd[_0x205b('0x20')]=_0x336f04;if(_0x235f15[_0x205b('0x34')]['includeAll']){_0x33fbaa[_0x205b('0x44')]=[{'all':!![]}];}return db[_0x205b('0x43')][_0x205b('0x45')](_0x33fbaa);})[_0x205b('0x29')](function(_0x429076){_0x398afd[_0x205b('0x46')]=_0x429076;return _0x398afd;})[_0x205b('0x29')](respondWithFilteredResult(_0x43f598,_0x33fbaa))['catch'](handleError(_0x43f598,null));};exports[_0x205b('0x47')]=function(_0x2dda47,_0x4e631e){var _0x2834f2={'raw':![],'where':{'id':_0x2dda47[_0x205b('0x48')]['id']}},_0x271583={};_0x271583['model']=_[_0x205b('0x33')](db['AnalyticFieldReport']['rawAttributes']);_0x271583[_0x205b('0x34')]=_[_0x205b('0x33')](_0x2dda47[_0x205b('0x34')]);_0x271583[_0x205b('0x35')]=_['intersection'](_0x271583['model'],_0x271583[_0x205b('0x34')]);_0x2834f2[_0x205b('0x38')]=_['intersection'](_0x271583[_0x205b('0x37')],qs[_0x205b('0x39')](_0x2dda47['query']['fields']));_0x2834f2[_0x205b('0x38')]=_0x2834f2[_0x205b('0x38')]['length']?_0x2834f2['attributes']:_0x271583[_0x205b('0x37')];if(_0x2dda47['query']['includeAll']){_0x2834f2[_0x205b('0x44')]=[{'all':!![]}];}_0x2834f2=_['merge']({},_0x2834f2,_0x2dda47[_0x205b('0x42')]);return db[_0x205b('0x43')]['find'](_0x2834f2)[_0x205b('0x29')](handleEntityNotFound(_0x4e631e,null))[_0x205b('0x29')](respondWithResult(_0x4e631e,null))[_0x205b('0x49')](handleError(_0x4e631e,null));};exports[_0x205b('0x4a')]=function(_0x197633,_0x37433d){return db[_0x205b('0x43')][_0x205b('0x4a')](_0x197633['body'],{})[_0x205b('0x29')](respondWithResult(_0x37433d,0xc9))['catch'](handleError(_0x37433d,null));};exports[_0x205b('0x4b')]=function(_0x2686c5,_0x269faf){return db['AnalyticFieldReport'][_0x205b('0x4b')](_0x2686c5[_0x205b('0x4c')],{'raw':![],'individualHooks':!![]})[_0x205b('0x29')](respondWithResult(_0x269faf,0xc9))['catch'](handleError(_0x269faf,null));};exports[_0x205b('0x27')]=function(_0x56445b,_0x1b455c){if(_0x56445b['body']['id']){delete _0x56445b[_0x205b('0x4c')]['id'];}return db['AnalyticFieldReport'][_0x205b('0x4d')]({'where':{'id':_0x56445b[_0x205b('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b455c,null))[_0x205b('0x29')](saveUpdates(_0x56445b[_0x205b('0x4c')],null))[_0x205b('0x29')](respondWithResult(_0x1b455c,null))['catch'](handleError(_0x1b455c,null));};exports[_0x205b('0x28')]=function(_0x1d0a42,_0x36c67d){return db[_0x205b('0x43')][_0x205b('0x4d')]({'where':{'id':_0x1d0a42[_0x205b('0x48')]['id']}})[_0x205b('0x29')](handleEntityNotFound(_0x36c67d,null))[_0x205b('0x29')](removeEntity(_0x36c67d,null))[_0x205b('0x49')](handleError(_0x36c67d,null));};exports['bulkDestroy']=function(_0x39e515,_0x49babb){return db['AnalyticFieldReport'][_0x205b('0x28')]({'where':{'id':_0x39e515[_0x205b('0x34')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x49babb,0xcc))[_0x205b('0x49')](handleError(_0x49babb,null));};exports[_0x205b('0x4e')]=function(_0x8b0045,_0x33151c,_0x4ba454){return db[_0x205b('0x4f')][_0x205b('0x50')]({'where':{'id':_0x8b0045[_0x205b('0x48')]['id']}})[_0x205b('0x29')](handleEntityNotFound(_0x33151c,null))[_0x205b('0x29')](function(_0x1c1a1f){if(_0x1c1a1f){return db[_0x205b('0x51')]['transaction'](function(_0x39b869){return db[_0x205b('0x43')][_0x205b('0x28')]({'where':{'CustomReportId':_0x8b0045[_0x205b('0x48')]['id']},'transaction':_0x39b869})[_0x205b('0x29')](function(_0x314c48){var _0x3db47a=_[_0x205b('0x2f')](_0x8b0045[_0x205b('0x4c')],function(_0x15facc){delete _0x15facc['id'];_0x15facc['CustomReportId']=_0x8b0045['params']['id'];return _0x15facc;});return db[_0x205b('0x43')][_0x205b('0x4b')](_0x3db47a,{'transaction':_0x39b869});});})['then'](function(){return db[_0x205b('0x43')][_0x205b('0x45')]({'where':{'CustomReportId':_0x8b0045[_0x205b('0x48')]['id']}});});}})[_0x205b('0x29')](respondWithResult(_0x33151c,null))['catch'](handleError(_0x33151c,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index c5181e0..348855f 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 _0x8ae4=['exports','define','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x8ae4,0x199));var _0x48ae=function(_0x519040,_0x297eeb){_0x519040=_0x519040-0x0;var _0x4a107b=_0x8ae4[_0x519040];return _0x4a107b;};'use strict';var _=require('lodash');var util=require(_0x48ae('0x0'));var logger=require(_0x48ae('0x1'))(_0x48ae('0x2'));var moment=require(_0x48ae('0x3'));var BPromise=require('bluebird');var rp=require(_0x48ae('0x4'));var fs=require('fs');var path=require(_0x48ae('0x5'));var rimraf=require(_0x48ae('0x6'));var config=require(_0x48ae('0x7'));var attributes=require(_0x48ae('0x8'));module[_0x48ae('0x9')]=function(_0x46037a,_0x5c5b6f){return _0x46037a[_0x48ae('0xa')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8351=['exports','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x3d9b04,_0x1e851a){var _0x557936=function(_0x3bf3ae){while(--_0x3bf3ae){_0x3d9b04['push'](_0x3d9b04['shift']());}};_0x557936(++_0x1e851a);}(_0x8351,0x15f));var _0x1835=function(_0x171da3,_0x5d50c5){_0x171da3=_0x171da3-0x0;var _0x3e0fb7=_0x8351[_0x171da3];return _0x3e0fb7;};'use strict';var _=require('lodash');var util=require(_0x1835('0x0'));var logger=require(_0x1835('0x1'))(_0x1835('0x2'));var moment=require(_0x1835('0x3'));var BPromise=require(_0x1835('0x4'));var rp=require(_0x1835('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1835('0x6'));var config=require(_0x1835('0x7'));var attributes=require(_0x1835('0x8'));module[_0x1835('0x9')]=function(_0x51dd95,_0x4d2e25){return _0x51dd95['define']('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','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 1f1909b..e31210a 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 _0x9f39=['rpc','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','AnalyticFieldReport,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xa5302,_0x356b3c){var _0x45dc96=function(_0x390c6d){while(--_0x390c6d){_0xa5302['push'](_0xa5302['shift']());}};_0x45dc96(++_0x356b3c);}(_0x9f39,0x181));var _0x99f3=function(_0x20cfe8,_0x2c0b5b){_0x20cfe8=_0x20cfe8-0x0;var _0x3c4d66=_0x9f39[_0x20cfe8];return _0x3c4d66;};'use strict';var _=require(_0x99f3('0x0'));var util=require(_0x99f3('0x1'));var moment=require(_0x99f3('0x2'));var BPromise=require('bluebird');var rs=require(_0x99f3('0x3'));var fs=require('fs');var Redis=require(_0x99f3('0x4'));var db=require(_0x99f3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x99f3('0x6'));var config=require('../../config/environment');var jayson=require(_0x99f3('0x7'));var client=jayson[_0x99f3('0x8')][_0x99f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12ab8e,_0x143a47,_0x2f77e5){return new BPromise(function(_0x3244d0,_0x1e601a){return client[_0x99f3('0xa')](_0x12ab8e,_0x2f77e5)[_0x99f3('0xb')](function(_0x29ea88){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x143a47,_0x99f3('0xc'));logger[_0x99f3('0xd')](_0x99f3('0xe'),_0x143a47,_0x99f3('0xc'),JSON[_0x99f3('0xf')](_0x29ea88));if(_0x29ea88['error']){if(_0x29ea88['error'][_0x99f3('0x10')]===0x1f4){logger[_0x99f3('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x143a47,_0x29ea88['error'][_0x99f3('0x12')]);return _0x1e601a(_0x29ea88[_0x99f3('0x11')]['message']);}logger[_0x99f3('0x11')](_0x99f3('0x13'),_0x143a47,_0x29ea88['error'][_0x99f3('0x12')]);return _0x3244d0(_0x29ea88['error'][_0x99f3('0x12')]);}else{logger[_0x99f3('0x14')](_0x99f3('0x13'),_0x143a47,'request\x20sent');_0x3244d0(_0x29ea88[_0x99f3('0x15')][_0x99f3('0x12')]);}})[_0x99f3('0x16')](function(_0x3d3df8){logger['error'](_0x99f3('0x13'),_0x143a47,_0x3d3df8);_0x1e601a(_0x3d3df8);});});} \ No newline at end of file +var _0x27f3=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x27f3,0x11e));var _0x327f=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0x27f3[_0x2cfb48];return _0xc4594f;};'use strict';var _=require(_0x327f('0x0'));var util=require(_0x327f('0x1'));var moment=require(_0x327f('0x2'));var BPromise=require(_0x327f('0x3'));var rs=require(_0x327f('0x4'));var fs=require('fs');var Redis=require(_0x327f('0x5'));var db=require(_0x327f('0x6'))['db'];var utils=require(_0x327f('0x7'));var logger=require(_0x327f('0x8'))(_0x327f('0x9'));var config=require(_0x327f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x327f('0xb')][_0x327f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11c911,_0x52837d,_0x550b49){return new BPromise(function(_0x3a3b6a,_0x5b1ff2){return client[_0x327f('0xd')](_0x11c911,_0x550b49)[_0x327f('0xe')](function(_0x2cc6a9){logger['info'](_0x327f('0xf'),_0x52837d,_0x327f('0x10'));logger[_0x327f('0x11')](_0x327f('0x12'),_0x52837d,_0x327f('0x10'),JSON[_0x327f('0x13')](_0x2cc6a9));if(_0x2cc6a9[_0x327f('0x14')]){if(_0x2cc6a9[_0x327f('0x14')][_0x327f('0x15')]===0x1f4){logger[_0x327f('0x14')](_0x327f('0xf'),_0x52837d,_0x2cc6a9[_0x327f('0x14')][_0x327f('0x16')]);return _0x5b1ff2(_0x2cc6a9['error']['message']);}logger[_0x327f('0x14')](_0x327f('0xf'),_0x52837d,_0x2cc6a9[_0x327f('0x14')][_0x327f('0x16')]);return _0x3a3b6a(_0x2cc6a9['error'][_0x327f('0x16')]);}else{logger[_0x327f('0x17')](_0x327f('0xf'),_0x52837d,_0x327f('0x10'));_0x3a3b6a(_0x2cc6a9[_0x327f('0x18')][_0x327f('0x16')]);}})[_0x327f('0x19')](function(_0xbf4e96){logger['error'](_0x327f('0xf'),_0x52837d,_0xbf4e96);_0x5b1ff2(_0xbf4e96);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 7db6517..8195ed1 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(_0x50c11b,_0x848d6f){var _0x46d2d0=function(_0x18061c){while(--_0x18061c){_0x50c11b['push'](_0x50c11b['shift']());}};_0x46d2d0(++_0x848d6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x161365,_0x5cf127){var _0x2aa8ee=function(_0x21b41d){while(--_0x21b41d){_0x161365['push'](_0x161365['shift']());}};_0x2aa8ee(++_0x5cf127);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 aeab067..92e080c 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 _0xd136=['TEXT','exports','STRING'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xd136,0x94));var _0x6d13=function(_0xc3cd30,_0x49fce6){_0xc3cd30=_0xc3cd30-0x0;var _0x87cfdb=_0xd136[_0xc3cd30];return _0x87cfdb;};'use strict';var Sequelize=require('sequelize');module[_0x6d13('0x0')]={'name':{'type':Sequelize[_0x6d13('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x6d13('0x1')]},'metric':{'type':Sequelize[_0x6d13('0x2')]},'description':{'type':Sequelize[_0x6d13('0x1')]}}; \ No newline at end of file +var _0xe0dd=['sequelize','exports','name','STRING','TEXT'];(function(_0x30aa4d,_0x2b360f){var _0x16fc87=function(_0x5c8565){while(--_0x5c8565){_0x30aa4d['push'](_0x30aa4d['shift']());}};_0x16fc87(++_0x2b360f);}(_0xe0dd,0x163));var _0xde0d=function(_0x4191af,_0x5783da){_0x4191af=_0x4191af-0x0;var _0x27bebf=_0xe0dd[_0x4191af];return _0x27bebf;};'use strict';var Sequelize=require(_0xde0d('0x0'));module[_0xde0d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xde0d('0x2')},'table':{'type':Sequelize[_0xde0d('0x3')]},'metric':{'type':Sequelize[_0xde0d('0x4')]},'description':{'type':Sequelize[_0xde0d('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index bfcbdd8..9f1e9b2 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x27fdcc,_0x421cb5){var _0x17c2de=function(_0x2fa372){while(--_0x2fa372){_0x27fdcc['push'](_0x27fdcc['shift']());}};_0x17c2de(++_0x421cb5);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5833aa,_0x2cc4b1){_0x5833aa=_0x5833aa-0x0;var _0x3a76cd=_0x8d0e[_0x5833aa];return _0x3a76cd;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));}; \ No newline at end of file +var _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x37d58b,_0x3d5801){var _0x34376d=function(_0x127847){while(--_0x127847){_0x37d58b['push'](_0x37d58b['shift']());}};_0x34376d(++_0x3d5801);}(_0xdc97,0x13b));var _0x7dc9=function(_0x191b27,_0x8dde7){_0x191b27=_0x191b27-0x0;var _0x3f2793=_0xdc97[_0x191b27];return _0x3f2793;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index da61479..0cd12d0 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 _0xc029=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0x5d370a,_0x55fa3f){var _0x3777a0=function(_0x9c9467){while(--_0x9c9467){_0x5d370a['push'](_0x5d370a['shift']());}};_0x3777a0(++_0x55fa3f);}(_0xc029,0x1df));var _0x9c02=function(_0x242d17,_0x30a922){_0x242d17=_0x242d17-0x0;var _0x501a6d=_0xc029[_0x242d17];return _0x501a6d;};'use strict';var _=require(_0x9c02('0x0'));var util=require(_0x9c02('0x1'));var logger=require(_0x9c02('0x2'))(_0x9c02('0x3'));var moment=require(_0x9c02('0x4'));var BPromise=require(_0x9c02('0x5'));var rp=require(_0x9c02('0x6'));var fs=require('fs');var path=require(_0x9c02('0x7'));var rimraf=require(_0x9c02('0x8'));var config=require(_0x9c02('0x9'));var attributes=require(_0x9c02('0xa'));module[_0x9c02('0xb')]=function(_0x18792d,_0x14c7f8){return _0x18792d[_0x9c02('0xc')](_0x9c02('0xd'),attributes,{'tableName':_0x9c02('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51f2=['analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports','define'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0x51f2,0xeb));var _0x251f=function(_0x140229,_0x1d3313){_0x140229=_0x140229-0x0;var _0x1d61b4=_0x51f2[_0x140229];return _0x1d61b4;};'use strict';var _=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var logger=require(_0x251f('0x2'))(_0x251f('0x3'));var moment=require(_0x251f('0x4'));var BPromise=require(_0x251f('0x5'));var rp=require(_0x251f('0x6'));var fs=require('fs');var path=require(_0x251f('0x7'));var rimraf=require(_0x251f('0x8'));var config=require('../../config/environment');var attributes=require(_0x251f('0x9'));module[_0x251f('0xa')]=function(_0x145630,_0xd9d8e1){return _0x145630[_0x251f('0xb')]('AnalyticMetric',attributes,{'tableName':_0x251f('0xc'),'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 0128c58..82410d8 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 _0xf762=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util'];(function(_0x43daa8,_0x2b964e){var _0x42a182=function(_0x16a94b){while(--_0x16a94b){_0x43daa8['push'](_0x43daa8['shift']());}};_0x42a182(++_0x2b964e);}(_0xf762,0xc4));var _0x2f76=function(_0x5d1ab5,_0x10d200){_0x5d1ab5=_0x5d1ab5-0x0;var _0x5a8844=_0xf762[_0x5d1ab5];return _0x5a8844;};'use strict';var _=require(_0x2f76('0x0'));var util=require(_0x2f76('0x1'));var moment=require(_0x2f76('0x2'));var BPromise=require(_0x2f76('0x3'));var rs=require(_0x2f76('0x4'));var fs=require('fs');var Redis=require(_0x2f76('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f76('0x6'));var logger=require(_0x2f76('0x7'))(_0x2f76('0x8'));var config=require(_0x2f76('0x9'));var jayson=require(_0x2f76('0xa'));var client=jayson['client'][_0x2f76('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xacff24,_0x27dcd2,_0x54fce7){return new BPromise(function(_0x5327c6,_0x32ee8d){return client[_0x2f76('0xc')](_0xacff24,_0x54fce7)[_0x2f76('0xd')](function(_0x54dc6a){logger[_0x2f76('0xe')](_0x2f76('0xf'),_0x27dcd2,_0x2f76('0x10'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x27dcd2,_0x2f76('0x10'),JSON[_0x2f76('0x11')](_0x54dc6a));if(_0x54dc6a[_0x2f76('0x12')]){if(_0x54dc6a[_0x2f76('0x12')][_0x2f76('0x13')]===0x1f4){logger['error'](_0x2f76('0xf'),_0x27dcd2,_0x54dc6a[_0x2f76('0x12')][_0x2f76('0x14')]);return _0x32ee8d(_0x54dc6a[_0x2f76('0x12')]['message']);}logger[_0x2f76('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x27dcd2,_0x54dc6a[_0x2f76('0x12')]['message']);return _0x5327c6(_0x54dc6a[_0x2f76('0x12')]['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x27dcd2,'request\x20sent');_0x5327c6(_0x54dc6a['result']['message']);}})[_0x2f76('0x15')](function(_0x804a23){logger[_0x2f76('0x12')](_0x2f76('0xf'),_0x27dcd2,_0x804a23);_0x32ee8d(_0x804a23);});});} \ No newline at end of file +var _0x3a91=['client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x3a91,0x109));var _0x13a9=function(_0x4353cd,_0x45e37e){_0x4353cd=_0x4353cd-0x0;var _0xa3479e=_0x3a91[_0x4353cd];return _0xa3479e;};'use strict';var _=require(_0x13a9('0x0'));var util=require(_0x13a9('0x1'));var moment=require(_0x13a9('0x2'));var BPromise=require(_0x13a9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13a9('0x4'));var db=require(_0x13a9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x13a9('0x6'));var config=require('../../config/environment');var jayson=require(_0x13a9('0x7'));var client=jayson[_0x13a9('0x8')][_0x13a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x645573,_0x48a2c1,_0x4a589f){return new BPromise(function(_0x4fedc0,_0x3b3912){return client[_0x13a9('0xa')](_0x645573,_0x4a589f)[_0x13a9('0xb')](function(_0x30d65e){logger[_0x13a9('0xc')](_0x13a9('0xd'),_0x48a2c1,_0x13a9('0xe'));logger[_0x13a9('0xf')](_0x13a9('0x10'),_0x48a2c1,_0x13a9('0xe'),JSON[_0x13a9('0x11')](_0x30d65e));if(_0x30d65e[_0x13a9('0x12')]){if(_0x30d65e[_0x13a9('0x12')]['code']===0x1f4){logger[_0x13a9('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x48a2c1,_0x30d65e[_0x13a9('0x12')][_0x13a9('0x13')]);return _0x3b3912(_0x30d65e[_0x13a9('0x12')][_0x13a9('0x13')]);}logger[_0x13a9('0x12')](_0x13a9('0xd'),_0x48a2c1,_0x30d65e[_0x13a9('0x12')][_0x13a9('0x13')]);return _0x4fedc0(_0x30d65e[_0x13a9('0x12')][_0x13a9('0x13')]);}else{logger[_0x13a9('0xc')](_0x13a9('0xd'),_0x48a2c1,_0x13a9('0xe'));_0x4fedc0(_0x30d65e[_0x13a9('0x14')][_0x13a9('0x13')]);}})['catch'](function(_0x225489){logger[_0x13a9('0x12')](_0x13a9('0xd'),_0x48a2c1,_0x225489);_0x3b3912(_0x225489);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index e8b55d2..ad0d5d3 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 _0x8ba0=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x545df9,_0x316006){var _0x1e9330=function(_0x3643a5){while(--_0x3643a5){_0x545df9['push'](_0x545df9['shift']());}};_0x1e9330(++_0x316006);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x3e8455,_0x401fa1){_0x3e8455=_0x3e8455-0x0;var _0x5537bf=_0x8ba0[_0x3e8455];return _0x5537bf;};'use strict';var multer=require(_0x08ba('0x0'));var util=require(_0x08ba('0x1'));var path=require(_0x08ba('0x2'));var timeout=require(_0x08ba('0x3'));var express=require(_0x08ba('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x08ba('0x5'));var interaction=require(_0x08ba('0x6'));var config=require(_0x08ba('0x7'));var controller=require(_0x08ba('0x8'));router[_0x08ba('0x9')]('/',auth[_0x08ba('0xa')](),controller['index']);router[_0x08ba('0x9')](_0x08ba('0xb'),auth[_0x08ba('0xa')](),controller[_0x08ba('0xc')]);router[_0x08ba('0xd')]('/',auth['isAuthenticated'](),controller[_0x08ba('0xe')]);router['put'](_0x08ba('0xb'),auth['isAuthenticated'](),controller[_0x08ba('0xf')]);router[_0x08ba('0x10')](_0x08ba('0xb'),auth[_0x08ba('0xa')](),controller[_0x08ba('0x11')]);module[_0x08ba('0x12')]=router; \ No newline at end of file +var _0xf3ff=['../../components/auth/service','../../config/environment','./analyticMetric.controller','get','index','isAuthenticated','show','put','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0xf3ff,0xae));var _0xff3f=function(_0x47d662,_0x4f328d){_0x47d662=_0x47d662-0x0;var _0x348d6e=_0xf3ff[_0x47d662];return _0x348d6e;};'use strict';var multer=require(_0xff3f('0x0'));var util=require('util');var path=require(_0xff3f('0x1'));var timeout=require(_0xff3f('0x2'));var express=require(_0xff3f('0x3'));var router=express[_0xff3f('0x4')]();var fs_extra=require(_0xff3f('0x5'));var auth=require(_0xff3f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xff3f('0x7'));var controller=require(_0xff3f('0x8'));router[_0xff3f('0x9')]('/',auth['isAuthenticated'](),controller[_0xff3f('0xa')]);router[_0xff3f('0x9')]('/:id',auth[_0xff3f('0xb')](),controller[_0xff3f('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xff3f('0xd')]('/:id',auth[_0xff3f('0xb')](),controller['update']);router[_0xff3f('0xe')](_0xff3f('0xf'),auth[_0xff3f('0xb')](),controller[_0xff3f('0x10')]);module[_0xff3f('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 0710458..73b7003 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 _0x056e=['exports'];(function(_0x55b7f5,_0x156133){var _0x16e474=function(_0x5951ad){while(--_0x5951ad){_0x55b7f5['push'](_0x55b7f5['shift']());}};_0x16e474(++_0x156133);}(_0x056e,0xb9));var _0xe056=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0x056e[_0x243217];return _0x478029;};'use strict';var Sequelize=require('sequelize');module[_0xe056('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x9a6c=['exports','TEXT','sequelize'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9a6c,0xb0));var _0xc9a6=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9a6c[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require(_0xc9a6('0x0'));module[_0xc9a6('0x1')]={'tree':{'type':Sequelize[_0xc9a6('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index a4a1d4a..2c0ae59 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 _0x2920=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','index','map','AnalyticTreeReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x462805,_0x330178){var _0x13a39e=function(_0xbbaaa7){while(--_0xbbaaa7){_0x462805['push'](_0x462805['shift']());}};_0x13a39e(++_0x330178);}(_0x2920,0x11f));var _0x0292=function(_0x5896bb,_0x6e6003){_0x5896bb=_0x5896bb-0x0;var _0xebb9d1=_0x2920[_0x5896bb];return _0xebb9d1;};'use strict';var emlformat=require(_0x0292('0x0'));var rimraf=require(_0x0292('0x1'));var zipdir=require(_0x0292('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0292('0x3'));var moment=require(_0x0292('0x4'));var BPromise=require(_0x0292('0x5'));var Mustache=require(_0x0292('0x6'));var util=require('util');var path=require(_0x0292('0x7'));var sox=require(_0x0292('0x8'));var csv=require(_0x0292('0x9'));var ejs=require(_0x0292('0xa'));var fs=require('fs');var fs_extra=require(_0x0292('0xb'));var _=require(_0x0292('0xc'));var squel=require(_0x0292('0xd'));var crypto=require('crypto');var jsforce=require(_0x0292('0xe'));var deskjs=require(_0x0292('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0292('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0292('0x11'));var hardwareService=require(_0x0292('0x12'));var logger=require(_0x0292('0x13'))(_0x0292('0x14'));var utils=require(_0x0292('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0292('0x16'));var db=require(_0x0292('0x17'))['db'];function respondWithStatusCode(_0x3596e7,_0x1b00f9){_0x1b00f9=_0x1b00f9||0xcc;return function(_0x52cb0d){if(_0x52cb0d){return _0x3596e7[_0x0292('0x18')](_0x1b00f9);}return _0x3596e7['status'](_0x1b00f9)[_0x0292('0x19')]();};}function respondWithResult(_0x331bff,_0x4a6713){_0x4a6713=_0x4a6713||0xc8;return function(_0x8e9fb2){if(_0x8e9fb2){return _0x331bff[_0x0292('0x1a')](_0x4a6713)[_0x0292('0x1b')](_0x8e9fb2);}};}function respondWithFilteredResult(_0x64a46b,_0x12f046){return function(_0x45aff3){if(_0x45aff3){var _0x3d46f6=typeof _0x12f046[_0x0292('0x1c')]===_0x0292('0x1d')&&typeof _0x12f046[_0x0292('0x1e')]==='undefined';var _0x235f97=_0x45aff3[_0x0292('0x1f')];var _0x322aab=_0x3d46f6?0x0:_0x12f046[_0x0292('0x1c')];var _0x12ce10=_0x3d46f6?_0x45aff3[_0x0292('0x1f')]:_0x12f046[_0x0292('0x1c')]+_0x12f046[_0x0292('0x1e')];var _0x294834;if(_0x12ce10>=_0x235f97){_0x12ce10=_0x235f97;_0x294834=0xc8;}else{_0x294834=0xce;}_0x64a46b[_0x0292('0x1a')](_0x294834);return _0x64a46b[_0x0292('0x20')](_0x0292('0x21'),_0x322aab+'-'+_0x12ce10+'/'+_0x235f97)['json'](_0x45aff3);}return null;};}function patchUpdates(_0x198652){return function(_0x1a682c){try{jsonpatch['apply'](_0x1a682c,_0x198652,!![]);}catch(_0x6e494c){return BPromise[_0x0292('0x22')](_0x6e494c);}return _0x1a682c[_0x0292('0x23')]();};}function saveUpdates(_0x5872fb,_0x280644){return function(_0x12e420){if(_0x12e420){return _0x12e420[_0x0292('0x24')](_0x5872fb)[_0x0292('0x25')](function(_0x5dc40e){return _0x5dc40e;});}return null;};}function removeEntity(_0x135d84,_0x2af1bc){return function(_0x2972e9){if(_0x2972e9){return _0x2972e9[_0x0292('0x26')]()[_0x0292('0x25')](function(){_0x135d84[_0x0292('0x1a')](0xcc)[_0x0292('0x19')]();});}};}function handleEntityNotFound(_0x3600d4,_0x77cf35){return function(_0xc6236f){if(!_0xc6236f){_0x3600d4[_0x0292('0x18')](0x194);}return _0xc6236f;};}function handleError(_0x274bb0,_0x2d598e){_0x2d598e=_0x2d598e||0x1f4;return function(_0x1e1a6e){logger['error'](_0x1e1a6e[_0x0292('0x27')]);if(_0x1e1a6e[_0x0292('0x28')]){delete _0x1e1a6e[_0x0292('0x28')];}_0x274bb0[_0x0292('0x1a')](_0x2d598e)['send'](_0x1e1a6e);};}exports[_0x0292('0x29')]=function(_0x55175a,_0xbd676a){var _0x199bb1={},_0x2d398e={},_0x4c0dd0={'count':0x0,'rows':[]};var _0x4fab88=_[_0x0292('0x2a')](db[_0x0292('0x2b')]['rawAttributes'],function(_0x6b94a9){return{'name':_0x6b94a9[_0x0292('0x2c')],'type':_0x6b94a9[_0x0292('0x2d')][_0x0292('0x2e')]};});_0x2d398e[_0x0292('0x2f')]=_['map'](_0x4fab88,_0x0292('0x28'));_0x2d398e['query']=_[_0x0292('0x30')](_0x55175a[_0x0292('0x31')]);_0x2d398e[_0x0292('0x32')]=_[_0x0292('0x33')](_0x2d398e[_0x0292('0x2f')],_0x2d398e['query']);_0x199bb1[_0x0292('0x34')]=_[_0x0292('0x33')](_0x2d398e['model'],qs[_0x0292('0x35')](_0x55175a[_0x0292('0x31')][_0x0292('0x35')]));_0x199bb1['attributes']=_0x199bb1[_0x0292('0x34')]['length']?_0x199bb1[_0x0292('0x34')]:_0x2d398e[_0x0292('0x2f')];if(!_0x55175a[_0x0292('0x31')][_0x0292('0x36')](_0x0292('0x37'))){_0x199bb1[_0x0292('0x1e')]=qs[_0x0292('0x1e')](_0x55175a[_0x0292('0x31')]['limit']);_0x199bb1[_0x0292('0x1c')]=qs[_0x0292('0x1c')](_0x55175a[_0x0292('0x31')][_0x0292('0x1c')]);}_0x199bb1['order']=qs[_0x0292('0x38')](_0x55175a[_0x0292('0x31')]['sort']);_0x199bb1[_0x0292('0x39')]=qs[_0x0292('0x32')](_[_0x0292('0x3a')](_0x55175a['query'],_0x2d398e[_0x0292('0x32')]),_0x4fab88);if(_0x55175a['query'][_0x0292('0x3b')]){_0x199bb1[_0x0292('0x39')]=_['merge'](_0x199bb1[_0x0292('0x39')],{'$or':_['map'](_0x4fab88,function(_0x1d18af){if(_0x1d18af[_0x0292('0x2d')]!==_0x0292('0x3c')){var _0x20e6bf={};_0x20e6bf[_0x1d18af[_0x0292('0x28')]]={'$like':'%'+_0x55175a['query'][_0x0292('0x3b')]+'%'};return _0x20e6bf;}})});}_0x199bb1=_[_0x0292('0x3d')]({},_0x199bb1,_0x55175a[_0x0292('0x3e')]);var _0x3c700c={'where':_0x199bb1[_0x0292('0x39')]};return db[_0x0292('0x2b')]['count'](_0x3c700c)[_0x0292('0x25')](function(_0x49fcd1){_0x4c0dd0[_0x0292('0x1f')]=_0x49fcd1;if(_0x55175a['query'][_0x0292('0x3f')]){_0x199bb1[_0x0292('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x0292('0x41')](_0x199bb1);})['then'](function(_0x4eec88){_0x4c0dd0[_0x0292('0x42')]=_0x4eec88;return _0x4c0dd0;})[_0x0292('0x25')](respondWithFilteredResult(_0xbd676a,_0x199bb1))[_0x0292('0x43')](handleError(_0xbd676a,null));};exports[_0x0292('0x44')]=function(_0x5174aa,_0x22f98){var _0x403067={'raw':!![],'where':{'id':_0x5174aa[_0x0292('0x45')]['id']}},_0x54aaf1={};_0x54aaf1[_0x0292('0x2f')]=_[_0x0292('0x30')](db[_0x0292('0x2b')]['rawAttributes']);_0x54aaf1[_0x0292('0x31')]=_['keys'](_0x5174aa['query']);_0x54aaf1[_0x0292('0x32')]=_[_0x0292('0x33')](_0x54aaf1[_0x0292('0x2f')],_0x54aaf1[_0x0292('0x31')]);_0x403067[_0x0292('0x34')]=_[_0x0292('0x33')](_0x54aaf1[_0x0292('0x2f')],qs[_0x0292('0x35')](_0x5174aa[_0x0292('0x31')][_0x0292('0x35')]));_0x403067[_0x0292('0x34')]=_0x403067[_0x0292('0x34')][_0x0292('0x46')]?_0x403067[_0x0292('0x34')]:_0x54aaf1[_0x0292('0x2f')];if(_0x5174aa['query']['includeAll']){_0x403067[_0x0292('0x40')]=[{'all':!![]}];}_0x403067=_['merge']({},_0x403067,_0x5174aa[_0x0292('0x3e')]);return db[_0x0292('0x2b')][_0x0292('0x47')](_0x403067)[_0x0292('0x25')](handleEntityNotFound(_0x22f98,null))['then'](respondWithResult(_0x22f98,null))[_0x0292('0x43')](handleError(_0x22f98,null));};exports[_0x0292('0x48')]=function(_0xa46447,_0x4bb355){return db[_0x0292('0x2b')][_0x0292('0x48')](_0xa46447[_0x0292('0x49')],{})['then'](respondWithResult(_0x4bb355,0xc9))[_0x0292('0x43')](handleError(_0x4bb355,null));};exports['update']=function(_0x3dab1c,_0x18d2d4){if(_0x3dab1c[_0x0292('0x49')]['id']){delete _0x3dab1c[_0x0292('0x49')]['id'];}return db[_0x0292('0x2b')][_0x0292('0x47')]({'where':{'id':_0x3dab1c[_0x0292('0x45')]['id']}})['then'](handleEntityNotFound(_0x18d2d4,null))[_0x0292('0x25')](saveUpdates(_0x3dab1c[_0x0292('0x49')],null))['then'](respondWithResult(_0x18d2d4,null))[_0x0292('0x43')](handleError(_0x18d2d4,null));};exports[_0x0292('0x26')]=function(_0x509125,_0x4869f6){return db['AnalyticTreeReport']['find']({'where':{'id':_0x509125[_0x0292('0x45')]['id']}})[_0x0292('0x25')](handleEntityNotFound(_0x4869f6,null))[_0x0292('0x25')](removeEntity(_0x4869f6,null))[_0x0292('0x43')](handleError(_0x4869f6,null));}; \ No newline at end of file +var _0x582d=['create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','then','destroy','name','send','index','map','AnalyticTreeReport','fieldName','type','key','model','filters','intersection','query','fields','attributes','length','order','sort','filter','where','merge','options','findAll','rows','catch','params','keys','rawAttributes','includeAll','include','find'];(function(_0x56b95c,_0x18564c){var _0x2552a8=function(_0xc144d5){while(--_0xc144d5){_0x56b95c['push'](_0x56b95c['shift']());}};_0x2552a8(++_0x18564c);}(_0x582d,0x95));var _0xd582=function(_0x50e33c,_0xa63b2e){_0x50e33c=_0x50e33c-0x0;var _0x5f0498=_0x582d[_0x50e33c];return _0x5f0498;};'use strict';var emlformat=require(_0xd582('0x0'));var rimraf=require(_0xd582('0x1'));var zipdir=require(_0xd582('0x2'));var jsonpatch=require(_0xd582('0x3'));var rp=require('request-promise');var moment=require(_0xd582('0x4'));var BPromise=require(_0xd582('0x5'));var Mustache=require(_0xd582('0x6'));var util=require(_0xd582('0x7'));var path=require(_0xd582('0x8'));var sox=require(_0xd582('0x9'));var csv=require(_0xd582('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd582('0xb'));var _=require(_0xd582('0xc'));var squel=require(_0xd582('0xd'));var crypto=require('crypto');var jsforce=require(_0xd582('0xe'));var deskjs=require(_0xd582('0xf'));var toCsv=require(_0xd582('0xa'));var querystring=require(_0xd582('0x10'));var Papa=require(_0xd582('0x11'));var Redis=require(_0xd582('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd582('0x13'));var as=require(_0xd582('0x14'));var hardwareService=require(_0xd582('0x15'));var logger=require(_0xd582('0x16'))(_0xd582('0x17'));var utils=require(_0xd582('0x18'));var config=require(_0xd582('0x19'));var licenseUtil=require(_0xd582('0x1a'));var db=require(_0xd582('0x1b'))['db'];function respondWithStatusCode(_0x2be23b,_0x592915){_0x592915=_0x592915||0xcc;return function(_0xc7018a){if(_0xc7018a){return _0x2be23b['sendStatus'](_0x592915);}return _0x2be23b[_0xd582('0x1c')](_0x592915)[_0xd582('0x1d')]();};}function respondWithResult(_0x2a7a2c,_0x215e64){_0x215e64=_0x215e64||0xc8;return function(_0x1716db){if(_0x1716db){return _0x2a7a2c[_0xd582('0x1c')](_0x215e64)['json'](_0x1716db);}};}function respondWithFilteredResult(_0x2c4d04,_0x572c34){return function(_0x2f9479){if(_0x2f9479){var _0x1e0be3=typeof _0x572c34[_0xd582('0x1e')]===_0xd582('0x1f')&&typeof _0x572c34['limit']==='undefined';var _0x90245f=_0x2f9479[_0xd582('0x20')];var _0x5d446e=_0x1e0be3?0x0:_0x572c34[_0xd582('0x1e')];var _0x3e0ff9=_0x1e0be3?_0x2f9479[_0xd582('0x20')]:_0x572c34[_0xd582('0x1e')]+_0x572c34[_0xd582('0x21')];var _0x414b29;if(_0x3e0ff9>=_0x90245f){_0x3e0ff9=_0x90245f;_0x414b29=0xc8;}else{_0x414b29=0xce;}_0x2c4d04['status'](_0x414b29);return _0x2c4d04[_0xd582('0x22')](_0xd582('0x23'),_0x5d446e+'-'+_0x3e0ff9+'/'+_0x90245f)[_0xd582('0x24')](_0x2f9479);}return null;};}function patchUpdates(_0x207048){return function(_0x43359c){try{jsonpatch['apply'](_0x43359c,_0x207048,!![]);}catch(_0x292dea){return BPromise[_0xd582('0x25')](_0x292dea);}return _0x43359c['save']();};}function saveUpdates(_0x209780,_0x1154a4){return function(_0x2c9f55){if(_0x2c9f55){return _0x2c9f55['update'](_0x209780)[_0xd582('0x26')](function(_0x22d53a){return _0x22d53a;});}return null;};}function removeEntity(_0x2a93d9,_0x4070b4){return function(_0x3d56d4){if(_0x3d56d4){return _0x3d56d4[_0xd582('0x27')]()[_0xd582('0x26')](function(){_0x2a93d9[_0xd582('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49559f,_0x1d43e5){return function(_0x518457){if(!_0x518457){_0x49559f['sendStatus'](0x194);}return _0x518457;};}function handleError(_0x137446,_0x4784ea){_0x4784ea=_0x4784ea||0x1f4;return function(_0x8d67d5){logger['error'](_0x8d67d5['stack']);if(_0x8d67d5[_0xd582('0x28')]){delete _0x8d67d5[_0xd582('0x28')];}_0x137446['status'](_0x4784ea)[_0xd582('0x29')](_0x8d67d5);};}exports[_0xd582('0x2a')]=function(_0x20ff3c,_0x50c0d9){var _0x49c197={},_0x1d955e={},_0x3128ea={'count':0x0,'rows':[]};var _0x4809c0=_[_0xd582('0x2b')](db[_0xd582('0x2c')]['rawAttributes'],function(_0x4fbe63){return{'name':_0x4fbe63[_0xd582('0x2d')],'type':_0x4fbe63[_0xd582('0x2e')][_0xd582('0x2f')]};});_0x1d955e[_0xd582('0x30')]=_['map'](_0x4809c0,_0xd582('0x28'));_0x1d955e['query']=_['keys'](_0x20ff3c['query']);_0x1d955e[_0xd582('0x31')]=_[_0xd582('0x32')](_0x1d955e[_0xd582('0x30')],_0x1d955e[_0xd582('0x33')]);_0x49c197['attributes']=_[_0xd582('0x32')](_0x1d955e[_0xd582('0x30')],qs[_0xd582('0x34')](_0x20ff3c['query'][_0xd582('0x34')]));_0x49c197[_0xd582('0x35')]=_0x49c197[_0xd582('0x35')][_0xd582('0x36')]?_0x49c197[_0xd582('0x35')]:_0x1d955e[_0xd582('0x30')];if(!_0x20ff3c[_0xd582('0x33')]['hasOwnProperty']('nolimit')){_0x49c197['limit']=qs[_0xd582('0x21')](_0x20ff3c[_0xd582('0x33')][_0xd582('0x21')]);_0x49c197[_0xd582('0x1e')]=qs[_0xd582('0x1e')](_0x20ff3c[_0xd582('0x33')][_0xd582('0x1e')]);}_0x49c197[_0xd582('0x37')]=qs['sort'](_0x20ff3c[_0xd582('0x33')][_0xd582('0x38')]);_0x49c197['where']=qs[_0xd582('0x31')](_['pick'](_0x20ff3c['query'],_0x1d955e[_0xd582('0x31')]),_0x4809c0);if(_0x20ff3c[_0xd582('0x33')][_0xd582('0x39')]){_0x49c197[_0xd582('0x3a')]=_[_0xd582('0x3b')](_0x49c197[_0xd582('0x3a')],{'$or':_[_0xd582('0x2b')](_0x4809c0,function(_0x16bf73){if(_0x16bf73[_0xd582('0x2e')]!=='VIRTUAL'){var _0x216b77={};_0x216b77[_0x16bf73[_0xd582('0x28')]]={'$like':'%'+_0x20ff3c[_0xd582('0x33')]['filter']+'%'};return _0x216b77;}})});}_0x49c197=_[_0xd582('0x3b')]({},_0x49c197,_0x20ff3c[_0xd582('0x3c')]);var _0xf67078={'where':_0x49c197[_0xd582('0x3a')]};return db['AnalyticTreeReport'][_0xd582('0x20')](_0xf67078)[_0xd582('0x26')](function(_0x2178f1){_0x3128ea[_0xd582('0x20')]=_0x2178f1;if(_0x20ff3c[_0xd582('0x33')]['includeAll']){_0x49c197['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xd582('0x3d')](_0x49c197);})['then'](function(_0x5ad195){_0x3128ea[_0xd582('0x3e')]=_0x5ad195;return _0x3128ea;})[_0xd582('0x26')](respondWithFilteredResult(_0x50c0d9,_0x49c197))[_0xd582('0x3f')](handleError(_0x50c0d9,null));};exports['show']=function(_0x4a1f19,_0x4aff98){var _0x5f511b={'raw':!![],'where':{'id':_0x4a1f19[_0xd582('0x40')]['id']}},_0x5c075c={};_0x5c075c[_0xd582('0x30')]=_[_0xd582('0x41')](db['AnalyticTreeReport'][_0xd582('0x42')]);_0x5c075c[_0xd582('0x33')]=_[_0xd582('0x41')](_0x4a1f19[_0xd582('0x33')]);_0x5c075c[_0xd582('0x31')]=_[_0xd582('0x32')](_0x5c075c['model'],_0x5c075c[_0xd582('0x33')]);_0x5f511b[_0xd582('0x35')]=_[_0xd582('0x32')](_0x5c075c[_0xd582('0x30')],qs[_0xd582('0x34')](_0x4a1f19['query'][_0xd582('0x34')]));_0x5f511b['attributes']=_0x5f511b[_0xd582('0x35')]['length']?_0x5f511b[_0xd582('0x35')]:_0x5c075c[_0xd582('0x30')];if(_0x4a1f19[_0xd582('0x33')][_0xd582('0x43')]){_0x5f511b[_0xd582('0x44')]=[{'all':!![]}];}_0x5f511b=_[_0xd582('0x3b')]({},_0x5f511b,_0x4a1f19[_0xd582('0x3c')]);return db[_0xd582('0x2c')][_0xd582('0x45')](_0x5f511b)[_0xd582('0x26')](handleEntityNotFound(_0x4aff98,null))['then'](respondWithResult(_0x4aff98,null))['catch'](handleError(_0x4aff98,null));};exports[_0xd582('0x46')]=function(_0x357d99,_0x28dc6e){return db[_0xd582('0x2c')][_0xd582('0x46')](_0x357d99[_0xd582('0x47')],{})['then'](respondWithResult(_0x28dc6e,0xc9))['catch'](handleError(_0x28dc6e,null));};exports[_0xd582('0x48')]=function(_0xaaa9e3,_0x1713d3){if(_0xaaa9e3[_0xd582('0x47')]['id']){delete _0xaaa9e3[_0xd582('0x47')]['id'];}return db[_0xd582('0x2c')]['find']({'where':{'id':_0xaaa9e3[_0xd582('0x40')]['id']}})['then'](handleEntityNotFound(_0x1713d3,null))[_0xd582('0x26')](saveUpdates(_0xaaa9e3[_0xd582('0x47')],null))[_0xd582('0x26')](respondWithResult(_0x1713d3,null))[_0xd582('0x3f')](handleError(_0x1713d3,null));};exports['destroy']=function(_0x1fc77a,_0x51425e){return db[_0xd582('0x2c')][_0xd582('0x45')]({'where':{'id':_0x1fc77a[_0xd582('0x40')]['id']}})[_0xd582('0x26')](handleEntityNotFound(_0x51425e,null))[_0xd582('0x26')](removeEntity(_0x51425e,null))['catch'](handleError(_0x51425e,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 09bebeb..d1b4c2b 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 _0xf8eb=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf8eb,0x167));var _0xbf8e=function(_0x4f926d,_0x10b231){_0x4f926d=_0x4f926d-0x0;var _0x4982a0=_0xf8eb[_0x4f926d];return _0x4982a0;};'use strict';var _=require(_0xbf8e('0x0'));var util=require('util');var logger=require(_0xbf8e('0x1'))(_0xbf8e('0x2'));var moment=require(_0xbf8e('0x3'));var BPromise=require(_0xbf8e('0x4'));var rp=require(_0xbf8e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf8e('0x6'));var config=require(_0xbf8e('0x7'));var attributes=require(_0xbf8e('0x8'));module[_0xbf8e('0x9')]=function(_0x6edd01,_0x277aef){return _0x6edd01[_0xbf8e('0xa')](_0xbf8e('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fb6=['util','moment','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x148f4b,_0xf90d3e){var _0x53f206=function(_0x6d2eed){while(--_0x6d2eed){_0x148f4b['push'](_0x148f4b['shift']());}};_0x53f206(++_0xf90d3e);}(_0x2fb6,0x78));var _0x62fb=function(_0x3182fc,_0x2f3cd9){_0x3182fc=_0x3182fc-0x0;var _0x4ca431=_0x2fb6[_0x3182fc];return _0x4ca431;};'use strict';var _=require(_0x62fb('0x0'));var util=require(_0x62fb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x62fb('0x2'));var BPromise=require('bluebird');var rp=require(_0x62fb('0x3'));var fs=require('fs');var path=require(_0x62fb('0x4'));var rimraf=require(_0x62fb('0x5'));var config=require('../../config/environment');var attributes=require(_0x62fb('0x6'));module[_0x62fb('0x7')]=function(_0x51cb30,_0x2a471e){return _0x51cb30[_0x62fb('0x8')](_0x62fb('0x9'),attributes,{'tableName':_0x62fb('0xa'),'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 334a53a..f7ee851 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x40bc19,_0x51be0c){var _0x5b575a=function(_0x12d7a1){while(--_0x12d7a1){_0x40bc19['push'](_0x40bc19['shift']());}};_0x5b575a(++_0x51be0c);}(_0x1261,0x144));var _0x1126=function(_0x15fa77,_0x93eaff){_0x15fa77=_0x15fa77-0x0;var _0x1385ff=_0x1261[_0x15fa77];return _0x1385ff;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2a8972,_0x249cdf){var _0x48a94d=function(_0x1f52e6){while(--_0x1f52e6){_0x2a8972['push'](_0x2a8972['shift']());}};_0x48a94d(++_0x249cdf);}(_0x1261,0x144));var _0x1126=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0x1261[_0x117f4c];return _0x2b24e9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 1fd6409..3d0d793 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 _0xc87b=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc87b,0x1a0));var _0xbc87=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc87b[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xbc87('0x0'));var util=require('util');var path=require(_0xbc87('0x1'));var timeout=require(_0xbc87('0x2'));var express=require('express');var router=express[_0xbc87('0x3')]();var fs_extra=require(_0xbc87('0x4'));var auth=require(_0xbc87('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0xbc87('0x6')]('/',auth[_0xbc87('0x7')](),controller[_0xbc87('0x8')]);router[_0xbc87('0x6')]('/:id',auth[_0xbc87('0x7')](),controller[_0xbc87('0x9')]);router[_0xbc87('0xa')]('/',auth[_0xbc87('0x7')](),controller[_0xbc87('0xb')]);router[_0xbc87('0xc')](_0xbc87('0xd'),auth['isAuthenticated'](),controller[_0xbc87('0xe')]);router[_0xbc87('0xf')](_0xbc87('0xd'),auth['isAuthenticated'](),controller[_0xbc87('0x10')]);module[_0xbc87('0x11')]=router; \ No newline at end of file +var _0x5ecc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x4d05fe,_0x3fbdff){var _0x4251e4=function(_0x49aa2b){while(--_0x49aa2b){_0x4d05fe['push'](_0x4d05fe['shift']());}};_0x4251e4(++_0x3fbdff);}(_0x5ecc,0x1c8));var _0xc5ec=function(_0x2e24e0,_0x541639){_0x2e24e0=_0x2e24e0-0x0;var _0x25849f=_0x5ecc[_0x2e24e0];return _0x25849f;};'use strict';var multer=require('multer');var util=require(_0xc5ec('0x0'));var path=require(_0xc5ec('0x1'));var timeout=require(_0xc5ec('0x2'));var express=require(_0xc5ec('0x3'));var router=express[_0xc5ec('0x4')]();var fs_extra=require(_0xc5ec('0x5'));var auth=require(_0xc5ec('0x6'));var interaction=require(_0xc5ec('0x7'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0xc5ec('0x8')](),controller[_0xc5ec('0x9')]);router[_0xc5ec('0xa')](_0xc5ec('0xb'),auth[_0xc5ec('0x8')](),controller[_0xc5ec('0xc')]);router[_0xc5ec('0xd')]('/',auth[_0xc5ec('0x8')](),controller[_0xc5ec('0xe')]);router[_0xc5ec('0xf')]('/:id',auth[_0xc5ec('0x8')](),controller[_0xc5ec('0x10')]);router[_0xc5ec('0x11')](_0xc5ec('0xb'),auth[_0xc5ec('0x8')](),controller[_0xc5ec('0x12')]);module[_0xc5ec('0x13')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 5a52716..57d7893 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 _0x0487=['exports','STRING','sequelize'];(function(_0x5d21d1,_0x18196d){var _0x5dbb7a=function(_0x3c993d){while(--_0x3c993d){_0x5d21d1['push'](_0x5d21d1['shift']());}};_0x5dbb7a(++_0x18196d);}(_0x0487,0x14f));var _0x7048=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0487[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7048('0x0'));module[_0x7048('0x1')]={'name':{'type':Sequelize[_0x7048('0x2')]},'basename':{'type':Sequelize[_0x7048('0x2')]},'type':{'type':Sequelize[_0x7048('0x2')]}}; \ No newline at end of file +var _0x0e9f=['exports','STRING','sequelize'];(function(_0x1e97f0,_0x23e4c1){var _0x5b09e1=function(_0x1597fe){while(--_0x1597fe){_0x1e97f0['push'](_0x1e97f0['shift']());}};_0x5b09e1(++_0x23e4c1);}(_0x0e9f,0x116));var _0xf0e9=function(_0x3c626a,_0xa3bc94){_0x3c626a=_0x3c626a-0x0;var _0x336d75=_0x0e9f[_0x3c626a];return _0x336d75;};'use strict';var Sequelize=require(_0xf0e9('0x0'));module[_0xf0e9('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf0e9('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 1d9219d..3cfc488 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 _0x7ed1=['includeAll','include','findAll','show','length','find','catch','clone','get','createdAt','updatedAt','omit','body','create','update','params','file','originalname','basename','filename','mimetype','download','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Attachment'];(function(_0xda1099,_0x53d61c){var _0x23661e=function(_0x198d25){while(--_0x198d25){_0xda1099['push'](_0xda1099['shift']());}};_0x23661e(++_0x53d61c);}(_0x7ed1,0x75));var _0x17ed=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x7ed1[_0x1caf6a];return _0x1bf493;};'use strict';var emlformat=require(_0x17ed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x17ed('0x1'));var jsonpatch=require(_0x17ed('0x2'));var rp=require(_0x17ed('0x3'));var moment=require(_0x17ed('0x4'));var BPromise=require(_0x17ed('0x5'));var Mustache=require(_0x17ed('0x6'));var util=require('util');var path=require(_0x17ed('0x7'));var sox=require(_0x17ed('0x8'));var csv=require(_0x17ed('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x17ed('0xa'));var squel=require(_0x17ed('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x17ed('0xc'));var toCsv=require(_0x17ed('0x9'));var querystring=require(_0x17ed('0xd'));var Papa=require('papaparse');var Redis=require(_0x17ed('0xe'));var authService=require(_0x17ed('0xf'));var qs=require(_0x17ed('0x10'));var as=require(_0x17ed('0x11'));var hardwareService=require(_0x17ed('0x12'));var logger=require(_0x17ed('0x13'))(_0x17ed('0x14'));var utils=require('../../config/utils');var config=require(_0x17ed('0x15'));var licenseUtil=require(_0x17ed('0x16'));var db=require(_0x17ed('0x17'))['db'];function respondWithStatusCode(_0x4d12d5,_0x397d6d){_0x397d6d=_0x397d6d||0xcc;return function(_0x100c96){if(_0x100c96){return _0x4d12d5['sendStatus'](_0x397d6d);}return _0x4d12d5[_0x17ed('0x18')](_0x397d6d)['end']();};}function respondWithResult(_0x2de563,_0x3ee7f5){_0x3ee7f5=_0x3ee7f5||0xc8;return function(_0x51719e){if(_0x51719e){return _0x2de563[_0x17ed('0x18')](_0x3ee7f5)[_0x17ed('0x19')](_0x51719e);}};}function respondWithFilteredResult(_0x4fb02f,_0x4f3d62){return function(_0xf6bc9e){if(_0xf6bc9e){var _0x16c84a=typeof _0x4f3d62['offset']==='undefined'&&typeof _0x4f3d62[_0x17ed('0x1a')]===_0x17ed('0x1b');var _0x514a42=_0xf6bc9e['count'];var _0x1a32f3=_0x16c84a?0x0:_0x4f3d62[_0x17ed('0x1c')];var _0x2b788d=_0x16c84a?_0xf6bc9e[_0x17ed('0x1d')]:_0x4f3d62['offset']+_0x4f3d62[_0x17ed('0x1a')];var _0x391c21;if(_0x2b788d>=_0x514a42){_0x2b788d=_0x514a42;_0x391c21=0xc8;}else{_0x391c21=0xce;}_0x4fb02f['status'](_0x391c21);return _0x4fb02f[_0x17ed('0x1e')](_0x17ed('0x1f'),_0x1a32f3+'-'+_0x2b788d+'/'+_0x514a42)[_0x17ed('0x19')](_0xf6bc9e);}return null;};}function patchUpdates(_0xec308f){return function(_0x35e692){try{jsonpatch[_0x17ed('0x20')](_0x35e692,_0xec308f,!![]);}catch(_0x14f0c8){return BPromise[_0x17ed('0x21')](_0x14f0c8);}return _0x35e692[_0x17ed('0x22')]();};}function saveUpdates(_0x1ee76c,_0x5c9b6c){return function(_0x3d6cfe){if(_0x3d6cfe){return _0x3d6cfe['update'](_0x1ee76c)[_0x17ed('0x23')](function(_0x358c4e){return _0x358c4e;});}return null;};}function removeEntity(_0x2f0460,_0xf332cf){return function(_0x20c38b){if(_0x20c38b){return _0x20c38b[_0x17ed('0x24')]()[_0x17ed('0x23')](function(){_0x2f0460[_0x17ed('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x218b1d,_0x297dac){return function(_0x2baa56){if(!_0x2baa56){_0x218b1d[_0x17ed('0x25')](0x194);}return _0x2baa56;};}function handleError(_0x58b5eb,_0x7f2ca4){_0x7f2ca4=_0x7f2ca4||0x1f4;return function(_0x2260f8){logger[_0x17ed('0x26')](_0x2260f8[_0x17ed('0x27')]);if(_0x2260f8['name']){delete _0x2260f8[_0x17ed('0x28')];}_0x58b5eb['status'](_0x7f2ca4)[_0x17ed('0x29')](_0x2260f8);};}exports[_0x17ed('0x2a')]=function(_0x128c53,_0x26f616){var _0x2652b5={},_0x113b17={},_0x28acc6={'count':0x0,'rows':[]};var _0x34a5a4=_[_0x17ed('0x2b')](db['Attachment'][_0x17ed('0x2c')],function(_0x46e521){return{'name':_0x46e521['fieldName'],'type':_0x46e521[_0x17ed('0x2d')][_0x17ed('0x2e')]};});_0x113b17[_0x17ed('0x2f')]=_['map'](_0x34a5a4,_0x17ed('0x28'));_0x113b17[_0x17ed('0x30')]=_[_0x17ed('0x31')](_0x128c53[_0x17ed('0x30')]);_0x113b17[_0x17ed('0x32')]=_[_0x17ed('0x33')](_0x113b17['model'],_0x113b17[_0x17ed('0x30')]);_0x2652b5['attributes']=_[_0x17ed('0x33')](_0x113b17['model'],qs[_0x17ed('0x34')](_0x128c53[_0x17ed('0x30')]['fields']));_0x2652b5['attributes']=_0x2652b5[_0x17ed('0x35')]['length']?_0x2652b5[_0x17ed('0x35')]:_0x113b17[_0x17ed('0x2f')];if(!_0x128c53['query'][_0x17ed('0x36')](_0x17ed('0x37'))){_0x2652b5[_0x17ed('0x1a')]=qs[_0x17ed('0x1a')](_0x128c53[_0x17ed('0x30')][_0x17ed('0x1a')]);_0x2652b5[_0x17ed('0x1c')]=qs[_0x17ed('0x1c')](_0x128c53[_0x17ed('0x30')]['offset']);}_0x2652b5[_0x17ed('0x38')]=qs[_0x17ed('0x39')](_0x128c53[_0x17ed('0x30')][_0x17ed('0x39')]);_0x2652b5[_0x17ed('0x3a')]=qs[_0x17ed('0x32')](_[_0x17ed('0x3b')](_0x128c53[_0x17ed('0x30')],_0x113b17['filters']),_0x34a5a4);if(_0x128c53[_0x17ed('0x30')][_0x17ed('0x3c')]){_0x2652b5[_0x17ed('0x3a')]=_['merge'](_0x2652b5[_0x17ed('0x3a')],{'$or':_['map'](_0x34a5a4,function(_0x3a28b9){if(_0x3a28b9[_0x17ed('0x2d')]!==_0x17ed('0x3d')){var _0x359373={};_0x359373[_0x3a28b9['name']]={'$like':'%'+_0x128c53[_0x17ed('0x30')][_0x17ed('0x3c')]+'%'};return _0x359373;}})});}_0x2652b5=_[_0x17ed('0x3e')]({},_0x2652b5,_0x128c53[_0x17ed('0x3f')]);var _0x35e53c={'where':_0x2652b5[_0x17ed('0x3a')]};return db[_0x17ed('0x40')]['count'](_0x35e53c)['then'](function(_0x4fdce3){_0x28acc6[_0x17ed('0x1d')]=_0x4fdce3;if(_0x128c53['query'][_0x17ed('0x41')]){_0x2652b5[_0x17ed('0x42')]=[{'all':!![]}];}return db['Attachment'][_0x17ed('0x43')](_0x2652b5);})[_0x17ed('0x23')](function(_0x318d1d){_0x28acc6['rows']=_0x318d1d;return _0x28acc6;})[_0x17ed('0x23')](respondWithFilteredResult(_0x26f616,_0x2652b5))['catch'](handleError(_0x26f616,null));};exports[_0x17ed('0x44')]=function(_0x4edc7a,_0x4843f3){var _0x5b6e00={'raw':!![],'where':{'id':_0x4edc7a['params']['id']}},_0x55fbf2={};_0x55fbf2[_0x17ed('0x2f')]=_['keys'](db[_0x17ed('0x40')][_0x17ed('0x2c')]);_0x55fbf2[_0x17ed('0x30')]=_[_0x17ed('0x31')](_0x4edc7a[_0x17ed('0x30')]);_0x55fbf2[_0x17ed('0x32')]=_['intersection'](_0x55fbf2[_0x17ed('0x2f')],_0x55fbf2[_0x17ed('0x30')]);_0x5b6e00[_0x17ed('0x35')]=_['intersection'](_0x55fbf2[_0x17ed('0x2f')],qs[_0x17ed('0x34')](_0x4edc7a[_0x17ed('0x30')][_0x17ed('0x34')]));_0x5b6e00[_0x17ed('0x35')]=_0x5b6e00[_0x17ed('0x35')][_0x17ed('0x45')]?_0x5b6e00['attributes']:_0x55fbf2[_0x17ed('0x2f')];if(_0x4edc7a[_0x17ed('0x30')][_0x17ed('0x41')]){_0x5b6e00[_0x17ed('0x42')]=[{'all':!![]}];}_0x5b6e00=_['merge']({},_0x5b6e00,_0x4edc7a[_0x17ed('0x3f')]);return db[_0x17ed('0x40')][_0x17ed('0x46')](_0x5b6e00)[_0x17ed('0x23')](handleEntityNotFound(_0x4843f3,null))[_0x17ed('0x23')](respondWithResult(_0x4843f3,null))[_0x17ed('0x47')](handleError(_0x4843f3,null));};exports[_0x17ed('0x48')]=function(_0x5ef02f,_0x47df27){var _0xa1a40d={'where':{'id':_0x5ef02f['params']['id']}},_0x2dcb71={};_0x2dcb71['model']=_[_0x17ed('0x31')](db[_0x17ed('0x40')][_0x17ed('0x2c')]);_0xa1a40d[_0x17ed('0x35')]=_[_0x17ed('0x33')](_0x2dcb71[_0x17ed('0x2f')],qs[_0x17ed('0x34')](_0x5ef02f[_0x17ed('0x30')]['fields']));_0xa1a40d[_0x17ed('0x35')]=_0xa1a40d[_0x17ed('0x35')][_0x17ed('0x45')]?_0xa1a40d['attributes']:_0x2dcb71[_0x17ed('0x2f')];if(_0x5ef02f[_0x17ed('0x30')][_0x17ed('0x41')]){_0xa1a40d[_0x17ed('0x42')]=[{'all':!![]}];}_0xa1a40d=_[_0x17ed('0x3e')]({},_0xa1a40d,_0x5ef02f[_0x17ed('0x3f')]);return db['Attachment'][_0x17ed('0x46')](_0xa1a40d)[_0x17ed('0x23')](handleEntityNotFound(_0x47df27,null))[_0x17ed('0x23')](function(_0x2bae98){if(_0x2bae98){var _0x564ca7=_0x2bae98[_0x17ed('0x49')]({'plain':!![]});_0x564ca7=qs['omit'](_0x564ca7,['id',_0x17ed('0x4a'),_0x17ed('0x4b')]);_0x5ef02f['body']=_[_0x17ed('0x4c')](_0x5ef02f[_0x17ed('0x4d')],['id',_0x17ed('0x4a'),_0x17ed('0x4b')]);return db['Attachment'][_0x17ed('0x4e')](_[_0x17ed('0x3e')](_0x564ca7,_0x5ef02f[_0x17ed('0x4d')]),{'include':_0x5ef02f['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x17ed('0x23')](respondWithResult(_0x47df27,0xc9))[_0x17ed('0x47')](handleError(_0x47df27,null));};exports[_0x17ed('0x4f')]=function(_0x5d68c8,_0x376580){if(_0x5d68c8[_0x17ed('0x4d')]['id']){delete _0x5d68c8['body']['id'];}return db[_0x17ed('0x40')][_0x17ed('0x46')]({'where':{'id':_0x5d68c8[_0x17ed('0x50')]['id']}})['then'](handleEntityNotFound(_0x376580,null))[_0x17ed('0x23')](saveUpdates(_0x5d68c8[_0x17ed('0x4d')],null))[_0x17ed('0x23')](respondWithResult(_0x376580,null))['catch'](handleError(_0x376580,null));};exports[_0x17ed('0x24')]=function(_0x3af35d,_0x4c8d0a){return db[_0x17ed('0x40')]['find']({'where':{'id':_0x3af35d['params']['id']}})[_0x17ed('0x23')](handleEntityNotFound(_0x4c8d0a,null))[_0x17ed('0x23')](removeEntity(_0x4c8d0a,null))[_0x17ed('0x47')](handleError(_0x4c8d0a,null));};exports[_0x17ed('0x4e')]=function(_0x26d374,_0x37c50c,_0x488539){_0x26d374[_0x17ed('0x4d')][_0x17ed('0x28')]=_0x26d374[_0x17ed('0x51')][_0x17ed('0x52')];_0x26d374[_0x17ed('0x4d')][_0x17ed('0x53')]=_0x26d374['file'][_0x17ed('0x54')];_0x26d374[_0x17ed('0x4d')]['type']=_0x26d374[_0x17ed('0x51')][_0x17ed('0x55')];return db[_0x17ed('0x40')][_0x17ed('0x4e')](_0x26d374[_0x17ed('0x4d')])[_0x17ed('0x23')](respondWithResult(_0x37c50c,0xc9))[_0x17ed('0x47')](handleError(_0x37c50c,null));};exports[_0x17ed('0x56')]=function(_0x26b826,_0x3b7882,_0x18d900){return db[_0x17ed('0x40')]['findOne']({'where':{'id':_0x26b826['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3b7882,null))[_0x17ed('0x23')](function(_0x18c23b){if(_0x18c23b){var _0x296af6=_0x18c23b['ChatOfflineMessageId']!==null;var _0x40c64c=path[_0x17ed('0x57')](config[_0x17ed('0x58')],_0x17ed('0x59'));if(_0x296af6){_0x40c64c=path['join'](_0x40c64c,_0x17ed('0x5a'));}var _0x309ea0=path[_0x17ed('0x57')](_0x40c64c,_0x18c23b[_0x17ed('0x53')]);return _0x3b7882[_0x17ed('0x56')](_0x309ea0);}})[_0x17ed('0x47')](handleError(_0x3b7882,null));}; \ No newline at end of file +var _0xb247=['filter','merge','options','Attachment','includeAll','findAll','rows','catch','params','include','find','get','omit','createdAt','updatedAt','body','update','create','file','originalname','basename','filename','mimetype','download','findOne','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','VIRTUAL'];(function(_0x4d5f9e,_0x183a41){var _0x2fc732=function(_0x3efa39){while(--_0x3efa39){_0x4d5f9e['push'](_0x4d5f9e['shift']());}};_0x2fc732(++_0x183a41);}(_0xb247,0x72));var _0x7b24=function(_0x42676f,_0x4c3299){_0x42676f=_0x42676f-0x0;var _0x2b884e=_0xb247[_0x42676f];return _0x2b884e;};'use strict';var emlformat=require(_0x7b24('0x0'));var rimraf=require(_0x7b24('0x1'));var zipdir=require(_0x7b24('0x2'));var jsonpatch=require(_0x7b24('0x3'));var rp=require(_0x7b24('0x4'));var moment=require(_0x7b24('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7b24('0x6'));var util=require('util');var path=require(_0x7b24('0x7'));var sox=require(_0x7b24('0x8'));var csv=require(_0x7b24('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b24('0xa'));var _=require('lodash');var squel=require(_0x7b24('0xb'));var crypto=require(_0x7b24('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7b24('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7b24('0xe'));var Redis=require(_0x7b24('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7b24('0x10'));var as=require(_0x7b24('0x11'));var hardwareService=require(_0x7b24('0x12'));var logger=require(_0x7b24('0x13'))('api');var utils=require(_0x7b24('0x14'));var config=require(_0x7b24('0x15'));var licenseUtil=require(_0x7b24('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33f6b4,_0x59f9ab){_0x59f9ab=_0x59f9ab||0xcc;return function(_0x160273){if(_0x160273){return _0x33f6b4[_0x7b24('0x17')](_0x59f9ab);}return _0x33f6b4[_0x7b24('0x18')](_0x59f9ab)[_0x7b24('0x19')]();};}function respondWithResult(_0x72617d,_0x2b0941){_0x2b0941=_0x2b0941||0xc8;return function(_0x1ebecd){if(_0x1ebecd){return _0x72617d['status'](_0x2b0941)[_0x7b24('0x1a')](_0x1ebecd);}};}function respondWithFilteredResult(_0x36124c,_0x46fa43){return function(_0x3db620){if(_0x3db620){var _0x5bb73f=typeof _0x46fa43[_0x7b24('0x1b')]===_0x7b24('0x1c')&&typeof _0x46fa43[_0x7b24('0x1d')]==='undefined';var _0x39b348=_0x3db620['count'];var _0x45573f=_0x5bb73f?0x0:_0x46fa43['offset'];var _0x5516e3=_0x5bb73f?_0x3db620[_0x7b24('0x1e')]:_0x46fa43[_0x7b24('0x1b')]+_0x46fa43['limit'];var _0x476d53;if(_0x5516e3>=_0x39b348){_0x5516e3=_0x39b348;_0x476d53=0xc8;}else{_0x476d53=0xce;}_0x36124c[_0x7b24('0x18')](_0x476d53);return _0x36124c[_0x7b24('0x1f')](_0x7b24('0x20'),_0x45573f+'-'+_0x5516e3+'/'+_0x39b348)['json'](_0x3db620);}return null;};}function patchUpdates(_0x2a6e88){return function(_0x5042f2){try{jsonpatch['apply'](_0x5042f2,_0x2a6e88,!![]);}catch(_0x325fe7){return BPromise[_0x7b24('0x21')](_0x325fe7);}return _0x5042f2[_0x7b24('0x22')]();};}function saveUpdates(_0x31f424,_0x1a3b3e){return function(_0x236672){if(_0x236672){return _0x236672['update'](_0x31f424)[_0x7b24('0x23')](function(_0x330630){return _0x330630;});}return null;};}function removeEntity(_0xaf41d5,_0x21bc19){return function(_0x1d262c){if(_0x1d262c){return _0x1d262c[_0x7b24('0x24')]()[_0x7b24('0x23')](function(){_0xaf41d5[_0x7b24('0x18')](0xcc)[_0x7b24('0x19')]();});}};}function handleEntityNotFound(_0x266c1c,_0x148358){return function(_0x57e384){if(!_0x57e384){_0x266c1c[_0x7b24('0x17')](0x194);}return _0x57e384;};}function handleError(_0x507dbe,_0x53d75f){_0x53d75f=_0x53d75f||0x1f4;return function(_0xfe23af){logger[_0x7b24('0x25')](_0xfe23af[_0x7b24('0x26')]);if(_0xfe23af[_0x7b24('0x27')]){delete _0xfe23af[_0x7b24('0x27')];}_0x507dbe['status'](_0x53d75f)['send'](_0xfe23af);};}exports[_0x7b24('0x28')]=function(_0x27831d,_0x42a2c4){var _0x27b0c7={},_0x443cc3={},_0x43f909={'count':0x0,'rows':[]};var _0x4888a5=_[_0x7b24('0x29')](db['Attachment'][_0x7b24('0x2a')],function(_0x2b2d04){return{'name':_0x2b2d04[_0x7b24('0x2b')],'type':_0x2b2d04[_0x7b24('0x2c')]['key']};});_0x443cc3[_0x7b24('0x2d')]=_[_0x7b24('0x29')](_0x4888a5,_0x7b24('0x27'));_0x443cc3[_0x7b24('0x2e')]=_[_0x7b24('0x2f')](_0x27831d[_0x7b24('0x2e')]);_0x443cc3[_0x7b24('0x30')]=_[_0x7b24('0x31')](_0x443cc3[_0x7b24('0x2d')],_0x443cc3['query']);_0x27b0c7['attributes']=_['intersection'](_0x443cc3[_0x7b24('0x2d')],qs['fields'](_0x27831d['query'][_0x7b24('0x32')]));_0x27b0c7[_0x7b24('0x33')]=_0x27b0c7[_0x7b24('0x33')][_0x7b24('0x34')]?_0x27b0c7['attributes']:_0x443cc3[_0x7b24('0x2d')];if(!_0x27831d[_0x7b24('0x2e')][_0x7b24('0x35')]('nolimit')){_0x27b0c7[_0x7b24('0x1d')]=qs[_0x7b24('0x1d')](_0x27831d[_0x7b24('0x2e')][_0x7b24('0x1d')]);_0x27b0c7['offset']=qs[_0x7b24('0x1b')](_0x27831d['query'][_0x7b24('0x1b')]);}_0x27b0c7[_0x7b24('0x36')]=qs['sort'](_0x27831d['query'][_0x7b24('0x37')]);_0x27b0c7[_0x7b24('0x38')]=qs[_0x7b24('0x30')](_['pick'](_0x27831d[_0x7b24('0x2e')],_0x443cc3[_0x7b24('0x30')]),_0x4888a5);if(_0x27831d['query']['filter']){_0x27b0c7[_0x7b24('0x38')]=_['merge'](_0x27b0c7[_0x7b24('0x38')],{'$or':_[_0x7b24('0x29')](_0x4888a5,function(_0x2c18d4){if(_0x2c18d4['type']!==_0x7b24('0x39')){var _0x5db6f5={};_0x5db6f5[_0x2c18d4[_0x7b24('0x27')]]={'$like':'%'+_0x27831d[_0x7b24('0x2e')][_0x7b24('0x3a')]+'%'};return _0x5db6f5;}})});}_0x27b0c7=_[_0x7b24('0x3b')]({},_0x27b0c7,_0x27831d[_0x7b24('0x3c')]);var _0x138995={'where':_0x27b0c7[_0x7b24('0x38')]};return db[_0x7b24('0x3d')][_0x7b24('0x1e')](_0x138995)['then'](function(_0x125683){_0x43f909[_0x7b24('0x1e')]=_0x125683;if(_0x27831d[_0x7b24('0x2e')][_0x7b24('0x3e')]){_0x27b0c7['include']=[{'all':!![]}];}return db[_0x7b24('0x3d')][_0x7b24('0x3f')](_0x27b0c7);})[_0x7b24('0x23')](function(_0x59a828){_0x43f909[_0x7b24('0x40')]=_0x59a828;return _0x43f909;})[_0x7b24('0x23')](respondWithFilteredResult(_0x42a2c4,_0x27b0c7))[_0x7b24('0x41')](handleError(_0x42a2c4,null));};exports['show']=function(_0x73bc13,_0x39154d){var _0x29f20f={'raw':!![],'where':{'id':_0x73bc13[_0x7b24('0x42')]['id']}},_0x121e13={};_0x121e13[_0x7b24('0x2d')]=_[_0x7b24('0x2f')](db['Attachment'][_0x7b24('0x2a')]);_0x121e13['query']=_[_0x7b24('0x2f')](_0x73bc13[_0x7b24('0x2e')]);_0x121e13[_0x7b24('0x30')]=_[_0x7b24('0x31')](_0x121e13['model'],_0x121e13[_0x7b24('0x2e')]);_0x29f20f['attributes']=_[_0x7b24('0x31')](_0x121e13[_0x7b24('0x2d')],qs[_0x7b24('0x32')](_0x73bc13['query'][_0x7b24('0x32')]));_0x29f20f[_0x7b24('0x33')]=_0x29f20f[_0x7b24('0x33')]['length']?_0x29f20f[_0x7b24('0x33')]:_0x121e13[_0x7b24('0x2d')];if(_0x73bc13[_0x7b24('0x2e')][_0x7b24('0x3e')]){_0x29f20f[_0x7b24('0x43')]=[{'all':!![]}];}_0x29f20f=_[_0x7b24('0x3b')]({},_0x29f20f,_0x73bc13[_0x7b24('0x3c')]);return db[_0x7b24('0x3d')][_0x7b24('0x44')](_0x29f20f)[_0x7b24('0x23')](handleEntityNotFound(_0x39154d,null))[_0x7b24('0x23')](respondWithResult(_0x39154d,null))['catch'](handleError(_0x39154d,null));};exports['clone']=function(_0x1b28ff,_0x27d45a){var _0x25dea2={'where':{'id':_0x1b28ff['params']['id']}},_0x14ef9f={};_0x14ef9f[_0x7b24('0x2d')]=_[_0x7b24('0x2f')](db[_0x7b24('0x3d')][_0x7b24('0x2a')]);_0x25dea2[_0x7b24('0x33')]=_[_0x7b24('0x31')](_0x14ef9f[_0x7b24('0x2d')],qs['fields'](_0x1b28ff[_0x7b24('0x2e')][_0x7b24('0x32')]));_0x25dea2[_0x7b24('0x33')]=_0x25dea2[_0x7b24('0x33')][_0x7b24('0x34')]?_0x25dea2[_0x7b24('0x33')]:_0x14ef9f['model'];if(_0x1b28ff[_0x7b24('0x2e')][_0x7b24('0x3e')]){_0x25dea2[_0x7b24('0x43')]=[{'all':!![]}];}_0x25dea2=_[_0x7b24('0x3b')]({},_0x25dea2,_0x1b28ff[_0x7b24('0x3c')]);return db[_0x7b24('0x3d')][_0x7b24('0x44')](_0x25dea2)[_0x7b24('0x23')](handleEntityNotFound(_0x27d45a,null))['then'](function(_0x34f282){if(_0x34f282){var _0x6cbf4f=_0x34f282[_0x7b24('0x45')]({'plain':!![]});_0x6cbf4f=qs[_0x7b24('0x46')](_0x6cbf4f,['id',_0x7b24('0x47'),_0x7b24('0x48')]);_0x1b28ff[_0x7b24('0x49')]=_[_0x7b24('0x46')](_0x1b28ff[_0x7b24('0x49')],['id','createdAt',_0x7b24('0x48')]);return db[_0x7b24('0x3d')]['create'](_['merge'](_0x6cbf4f,_0x1b28ff[_0x7b24('0x49')]),{'include':_0x1b28ff['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x7b24('0x23')](respondWithResult(_0x27d45a,0xc9))['catch'](handleError(_0x27d45a,null));};exports[_0x7b24('0x4a')]=function(_0x2c723c,_0x307ef2){if(_0x2c723c[_0x7b24('0x49')]['id']){delete _0x2c723c[_0x7b24('0x49')]['id'];}return db[_0x7b24('0x3d')][_0x7b24('0x44')]({'where':{'id':_0x2c723c[_0x7b24('0x42')]['id']}})[_0x7b24('0x23')](handleEntityNotFound(_0x307ef2,null))['then'](saveUpdates(_0x2c723c[_0x7b24('0x49')],null))['then'](respondWithResult(_0x307ef2,null))['catch'](handleError(_0x307ef2,null));};exports['destroy']=function(_0x4f0f23,_0x475da7){return db[_0x7b24('0x3d')][_0x7b24('0x44')]({'where':{'id':_0x4f0f23['params']['id']}})[_0x7b24('0x23')](handleEntityNotFound(_0x475da7,null))[_0x7b24('0x23')](removeEntity(_0x475da7,null))[_0x7b24('0x41')](handleError(_0x475da7,null));};exports[_0x7b24('0x4b')]=function(_0x46ebe3,_0x1ca9a1,_0x584c87){_0x46ebe3[_0x7b24('0x49')]['name']=_0x46ebe3[_0x7b24('0x4c')][_0x7b24('0x4d')];_0x46ebe3[_0x7b24('0x49')][_0x7b24('0x4e')]=_0x46ebe3[_0x7b24('0x4c')][_0x7b24('0x4f')];_0x46ebe3[_0x7b24('0x49')][_0x7b24('0x2c')]=_0x46ebe3[_0x7b24('0x4c')][_0x7b24('0x50')];return db[_0x7b24('0x3d')][_0x7b24('0x4b')](_0x46ebe3['body'])[_0x7b24('0x23')](respondWithResult(_0x1ca9a1,0xc9))[_0x7b24('0x41')](handleError(_0x1ca9a1,null));};exports[_0x7b24('0x51')]=function(_0x3ce286,_0x3192be,_0x5b011d){return db[_0x7b24('0x3d')][_0x7b24('0x52')]({'where':{'id':_0x3ce286[_0x7b24('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3192be,null))['then'](function(_0x3d27a4){if(_0x3d27a4){var _0x724716=_0x3d27a4['ChatOfflineMessageId']!==null;var _0x1d4050=path[_0x7b24('0x53')](config[_0x7b24('0x54')],_0x7b24('0x55'));if(_0x724716){_0x1d4050=path[_0x7b24('0x53')](_0x1d4050,'offline-chat/');}var _0x4c0b24=path[_0x7b24('0x53')](_0x1d4050,_0x3d27a4[_0x7b24('0x4e')]);return _0x3192be[_0x7b24('0x51')](_0x4c0b24);}})[_0x7b24('0x41')](handleError(_0x3192be,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 644fce2..193f36f 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 _0xb911=['exports','define','Attachment','attachments','lodash','util','../../config/logger','api','../../config/environment'];(function(_0x122c2e,_0x4a0110){var _0x560a4e=function(_0x55fb16){while(--_0x55fb16){_0x122c2e['push'](_0x122c2e['shift']());}};_0x560a4e(++_0x4a0110);}(_0xb911,0x79));var _0x1b91=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xb911[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0x1b91('0x0'));var util=require(_0x1b91('0x1'));var logger=require(_0x1b91('0x2'))(_0x1b91('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b91('0x4'));var attributes=require('./attachment.attributes');module[_0x1b91('0x5')]=function(_0x11c6d0,_0x5a79bf){return _0x11c6d0[_0x1b91('0x6')](_0x1b91('0x7'),attributes,{'tableName':_0x1b91('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc8a9=['define','Attachment','attachments','lodash','util','../../config/logger','request-promise','path','../../config/environment','./attachment.attributes','exports'];(function(_0x5930b3,_0x2e9b5c){var _0x5a0700=function(_0x143cd1){while(--_0x143cd1){_0x5930b3['push'](_0x5930b3['shift']());}};_0x5a0700(++_0x2e9b5c);}(_0xc8a9,0x18f));var _0x9c8a=function(_0x239c21,_0x56729d){_0x239c21=_0x239c21-0x0;var _0x433cbc=_0xc8a9[_0x239c21];return _0x433cbc;};'use strict';var _=require(_0x9c8a('0x0'));var util=require(_0x9c8a('0x1'));var logger=require(_0x9c8a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9c8a('0x3'));var fs=require('fs');var path=require(_0x9c8a('0x4'));var rimraf=require('rimraf');var config=require(_0x9c8a('0x5'));var attributes=require(_0x9c8a('0x6'));module[_0x9c8a('0x7')]=function(_0x2b9fa7,_0x1c0b53){return _0x2b9fa7[_0x9c8a('0x8')](_0x9c8a('0x9'),attributes,{'tableName':_0x9c8a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 7670291..2ff5373 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 _0xc964=['request\x20sent','stringify','error','Attachment,\x20%s,\x20%s','message','result','Attachment','create','body','options','raw','then','catch','CreateAttachment','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x5b101b,_0xfc548d){var _0xa1eae7=function(_0x15e59){while(--_0x15e59){_0x5b101b['push'](_0x5b101b['shift']());}};_0xa1eae7(++_0xfc548d);}(_0xc964,0x7e));var _0x4c96=function(_0x32f4d5,_0x3f4ed6){_0x32f4d5=_0x32f4d5-0x0;var _0x79f05c=_0xc964[_0x32f4d5];return _0x79f05c;};'use strict';var _=require(_0x4c96('0x0'));var util=require(_0x4c96('0x1'));var moment=require('moment');var BPromise=require(_0x4c96('0x2'));var rs=require(_0x4c96('0x3'));var fs=require('fs');var Redis=require(_0x4c96('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c96('0x5'));var logger=require('../../config/logger')(_0x4c96('0x6'));var config=require(_0x4c96('0x7'));var jayson=require(_0x4c96('0x8'));var client=jayson[_0x4c96('0x9')][_0x4c96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fa8a0,_0x4070a5,_0x493618){return new BPromise(function(_0x19ed76,_0xaa3f20){return client[_0x4c96('0xb')](_0x1fa8a0,_0x493618)['then'](function(_0x208911){logger[_0x4c96('0xc')]('Attachment,\x20%s,\x20%s',_0x4070a5,'request\x20sent');logger['debug'](_0x4c96('0xd'),_0x4070a5,_0x4c96('0xe'),JSON[_0x4c96('0xf')](_0x208911));if(_0x208911['error']){if(_0x208911[_0x4c96('0x10')]['code']===0x1f4){logger['error'](_0x4c96('0x11'),_0x4070a5,_0x208911[_0x4c96('0x10')][_0x4c96('0x12')]);return _0xaa3f20(_0x208911['error']['message']);}logger[_0x4c96('0x10')](_0x4c96('0x11'),_0x4070a5,_0x208911[_0x4c96('0x10')]['message']);return _0x19ed76(_0x208911[_0x4c96('0x10')][_0x4c96('0x12')]);}else{logger[_0x4c96('0xc')](_0x4c96('0x11'),_0x4070a5,_0x4c96('0xe'));_0x19ed76(_0x208911[_0x4c96('0x13')][_0x4c96('0x12')]);}})['catch'](function(_0x388237){logger['error'](_0x4c96('0x11'),_0x4070a5,_0x388237);_0xaa3f20(_0x388237);});});}exports['CreateAttachment']=function(_0x2453e0){var _0x494a26=this;return new Promise(function(_0x17891b,_0x1807b6){return db[_0x4c96('0x14')][_0x4c96('0x15')](_0x2453e0[_0x4c96('0x16')],{'raw':_0x2453e0[_0x4c96('0x17')]?_0x2453e0[_0x4c96('0x17')][_0x4c96('0x18')]===undefined?!![]:![]:!![]})[_0x4c96('0x19')](function(_0x9546c5){logger[_0x4c96('0xc')]('CreateAttachment',_0x2453e0);logger['debug']('CreateAttachment',_0x2453e0,JSON[_0x4c96('0xf')](_0x9546c5));_0x17891b(_0x9546c5);})[_0x4c96('0x1a')](function(_0x29f3a3){logger[_0x4c96('0x10')](_0x4c96('0x1b'),_0x29f3a3[_0x4c96('0x12')],_0x2453e0);_0x1807b6(_0x494a26['error'](0x1f4,_0x29f3a3[_0x4c96('0x12')]));});});}; \ No newline at end of file +var _0x8b7c=['stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','options','raw'];(function(_0x2558ee,_0x2a2574){var _0x431306=function(_0x32cb67){while(--_0x32cb67){_0x2558ee['push'](_0x2558ee['shift']());}};_0x431306(++_0x2a2574);}(_0x8b7c,0x119));var _0xc8b7=function(_0x5e6c33,_0x4f157a){_0x5e6c33=_0x5e6c33-0x0;var _0x142bc9=_0x8b7c[_0x5e6c33];return _0x142bc9;};'use strict';var _=require(_0xc8b7('0x0'));var util=require(_0xc8b7('0x1'));var moment=require(_0xc8b7('0x2'));var BPromise=require(_0xc8b7('0x3'));var rs=require(_0xc8b7('0x4'));var fs=require('fs');var Redis=require(_0xc8b7('0x5'));var db=require(_0xc8b7('0x6'))['db'];var utils=require(_0xc8b7('0x7'));var logger=require('../../config/logger')(_0xc8b7('0x8'));var config=require(_0xc8b7('0x9'));var jayson=require(_0xc8b7('0xa'));var client=jayson['client'][_0xc8b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x90cb38,_0x42d65e,_0x2c7807){return new BPromise(function(_0x9e4763,_0x2f149d){return client['request'](_0x90cb38,_0x2c7807)[_0xc8b7('0xc')](function(_0x504550){logger[_0xc8b7('0xd')](_0xc8b7('0xe'),_0x42d65e,_0xc8b7('0xf'));logger[_0xc8b7('0x10')](_0xc8b7('0x11'),_0x42d65e,'request\x20sent',JSON['stringify'](_0x504550));if(_0x504550['error']){if(_0x504550[_0xc8b7('0x12')][_0xc8b7('0x13')]===0x1f4){logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x504550['error']['message']);return _0x2f149d(_0x504550['error'][_0xc8b7('0x14')]);}logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x504550['error'][_0xc8b7('0x14')]);return _0x9e4763(_0x504550[_0xc8b7('0x12')][_0xc8b7('0x14')]);}else{logger[_0xc8b7('0xd')](_0xc8b7('0xe'),_0x42d65e,'request\x20sent');_0x9e4763(_0x504550[_0xc8b7('0x15')][_0xc8b7('0x14')]);}})[_0xc8b7('0x16')](function(_0x3323de){logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x3323de);_0x2f149d(_0x3323de);});});}exports[_0xc8b7('0x17')]=function(_0x485415){var _0x5ae36a=this;return new Promise(function(_0x1cf47c,_0x403659){return db[_0xc8b7('0x18')]['create'](_0x485415['body'],{'raw':_0x485415[_0xc8b7('0x19')]?_0x485415['options'][_0xc8b7('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x462cce){logger[_0xc8b7('0xd')]('CreateAttachment',_0x485415);logger[_0xc8b7('0x10')]('CreateAttachment',_0x485415,JSON[_0xc8b7('0x1b')](_0x462cce));_0x1cf47c(_0x462cce);})[_0xc8b7('0x16')](function(_0x456eea){logger['error'](_0xc8b7('0x17'),_0x456eea[_0xc8b7('0x14')],_0x485415);_0x403659(_0x5ae36a[_0xc8b7('0x12')](0x1f4,_0x456eea['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a929d2b..23f20db 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(_0x1058bc,_0x42c035){var _0x3b50b4=function(_0x51aa51){while(--_0x51aa51){_0x1058bc['push'](_0x1058bc['shift']());}};_0x3b50b4(++_0x42c035);}(_0xb10b,0x12a));var _0xbb10=function(_0x15c068,_0x441624){_0x15c068=_0x15c068-0x0;var _0x369daf=_0xb10b[_0x15c068];return _0x369daf;};'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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0x0b0e[_0x35fb56];return _0x2fd52c;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index cefc9a4..c9cb634 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 _0xc503=['admin','user','agent','domain','blocked','minutes','clearBlockUser','getLicense','status','send','ad-login','role','online','use','User','passport','passport-local','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/logger','activedirectory','undefined','baseDN','url','authenticate','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','disabled','blockedAt'];(function(_0x23fdb2,_0x1e71e9){var _0x353754=function(_0x2f1b63){while(--_0x2f1b63){_0x23fdb2['push'](_0x23fdb2['shift']());}};_0x353754(++_0x1e71e9);}(_0xc503,0x111));var _0x3c50=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0xc503[_0x31e5cb];return _0x4170df;};'use strict';var passport=require(_0x3c50('0x0'));var LocalStrategy=require(_0x3c50('0x1'))['Strategy'];var moment=require(_0x3c50('0x2'));var ActiveDirectory=require(_0x3c50('0x3'));var BPromise=require(_0x3c50('0x4'));var util=require(_0x3c50('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x3c50('0x6'));var utils=require(_0x3c50('0x7'));var config=require('../../config/environment');var logger=require(_0x3c50('0x8'))('api');function isActiveDirectoryConfigured(_0x2bf1a9){var _0x2b76ac=![];if(typeof _0x2bf1a9[_0x3c50('0x9')]!==_0x3c50('0xa')){_0x2b76ac=_0x2bf1a9[_0x3c50('0x9')][_0x3c50('0xb')]&&_0x2bf1a9['activedirectory'][_0x3c50('0xc')]&&_0x2bf1a9[_0x3c50('0x9')]['domain'];}return _0x2b76ac;}function adAuthenticate(_0x201d1b,_0x1d92e1,_0x4cbe21){return new BPromise(function(_0x2a21bd,_0x63d884){try{var _0x1eb63a=new ActiveDirectory(_0x201d1b);_0x1eb63a[_0x3c50('0xd')](_0x1d92e1,_0x4cbe21,function(_0x375805,_0x2c7da9){if(_0x375805){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x1d92e1,util[_0x3c50('0xe')](_0x375805,{'showHidden':![],'depth':null}));_0x63d884('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x2c7da9){logger['error'](_0x3c50('0xf'),_0x1d92e1);_0x63d884('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2a21bd(_0x2c7da9);}});}catch(_0x5cff26){_0x63d884(_0x5cff26);}});}function ActiveDirectoryAuthenticate(_0x3ff04d,_0x4f6249,_0x438ba5,_0x5094ff){var _0x542b8a,_0xcad7ec;if(!isActiveDirectoryConfigured(config)){logger[_0x3c50('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x4f6249);return _0x5094ff(null,![],{'message':_0x3c50('0x11')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x3c50('0x12'),_0x3c50('0x13')],'raw':!![]})[_0x3c50('0x14')](function(_0x1631d0){_0x542b8a=_0x1631d0;if(!_0x542b8a[_0x3c50('0x12')]){logger['error'](_0x3c50('0x15'),_0x4f6249);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x3ff04d[_0x3c50('0x16')]({'logging':!![],'attributes':['id',_0x3c50('0x17'),_0x3c50('0x18'),_0x3c50('0x19'),'role',_0x3c50('0x1a'),'blocked',_0x3c50('0x1b'),'online'],'where':{'name':_0x4f6249,'role':{'$or':[_0x3c50('0x1c'),_0x3c50('0x1d'),_0x3c50('0x1e')]},'adSsoEnabled':!![]}});})[_0x3c50('0x14')](function(_0x30fc2b){if(!_0x30fc2b||_0x30fc2b&&_0x30fc2b['name']!==_0x4f6249){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0xcad7ec=_0x30fc2b;var _0x1f0944=_0xcad7ec[_0x3c50('0x17')]+'@'+config[_0x3c50('0x9')][_0x3c50('0x1f')];return adAuthenticate(config[_0x3c50('0x9')],_0x1f0944,_0x438ba5);})[_0x3c50('0x14')](function(_0x50338c){if(_0xcad7ec[_0x3c50('0x1a')]){throw new Error(_0x3c50('0x11'));}if(_0x542b8a['blockDuration']>0x0){if(_0xcad7ec[_0x3c50('0x20')]){if(moment(_0xcad7ec['blockedAt'])['add'](_0x542b8a[_0x3c50('0x13')],_0x3c50('0x21'))>moment()){throw new Error(_0x3c50('0x11'));}return utils[_0x3c50('0x22')](_0xcad7ec,0x0,![],null)[_0x3c50('0x14')](function(){return utils['getLicense'](_0xcad7ec);})['then'](function(){return _0x5094ff(null,_0xcad7ec);});}else{return utils[_0x3c50('0x23')](_0xcad7ec)[_0x3c50('0x14')](function(){return _0x5094ff(null,_0xcad7ec);});}}else{return utils['getLicense'](_0xcad7ec)[_0x3c50('0x14')](function(){return _0x5094ff(null,_0xcad7ec);});}})['catch'](function(_0x449cfa){return _0x5094ff(null,![],_0x449cfa);});}function handleError(_0x3c0b62,_0x8f671d,_0x1dd0bc){return _0x3c0b62[_0x3c50('0x24')](_0x8f671d||0x1f4)[_0x3c50('0x25')]({'message':_0x1dd0bc?_0x1dd0bc['message']||_0x1dd0bc:''});}exports['login']=function(_0x53b3e7,_0x427882,_0x102640){passport['authenticate'](_0x3c50('0x26'),function(_0x224082,_0x411e04,_0x184342){var _0x136e1a=_0x224082||_0x184342;if(_0x136e1a){return handleError(_0x427882,0x191,_0x136e1a);}if(!_0x411e04){return handleError(_0x427882,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2c6878={'payload':{'id':_0x411e04['id'],'role':_0x411e04[_0x3c50('0x27')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2c6878)[_0x3c50('0x14')](function(_0x2268f7){_0x427882['json']({'id':_0x411e04['id'],'token':_0x2268f7,'statusCall':'','isAlreadyLogged':_0x411e04[_0x3c50('0x28')]});});}})(_0x53b3e7,_0x427882,_0x102640);};passport[_0x3c50('0x29')]('ad-login',new LocalStrategy({'usernameField':_0x3c50('0x17'),'passwordField':_0x3c50('0x18')},function(_0x3f4831,_0x2babc9,_0x30e6de){return ActiveDirectoryAuthenticate(db[_0x3c50('0x2a')],_0x3f4831,_0x2babc9,_0x30e6de);})); \ No newline at end of file +var _0x02e6=['blocked','online','user','agent','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','signToken','json','use','User','passport','Strategy','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled'];(function(_0x97ad61,_0x181ead){var _0x8054be=function(_0x4df205){while(--_0x4df205){_0x97ad61['push'](_0x97ad61['shift']());}};_0x8054be(++_0x181ead);}(_0x02e6,0xa9));var _0x602e=function(_0x2139a0,_0x4346bb){_0x2139a0=_0x2139a0-0x0;var _0x5d51e6=_0x02e6[_0x2139a0];return _0x5d51e6;};'use strict';var passport=require(_0x602e('0x0'));var LocalStrategy=require('passport-local')[_0x602e('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x602e('0x2'));var BPromise=require(_0x602e('0x3'));var util=require(_0x602e('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x602e('0x5'));var utils=require(_0x602e('0x6'));var config=require(_0x602e('0x7'));var logger=require(_0x602e('0x8'))(_0x602e('0x9'));function isActiveDirectoryConfigured(_0x258cc1){var _0x1dd22c=![];if(typeof _0x258cc1[_0x602e('0xa')]!==_0x602e('0xb')){_0x1dd22c=_0x258cc1[_0x602e('0xa')][_0x602e('0xc')]&&_0x258cc1[_0x602e('0xa')][_0x602e('0xd')]&&_0x258cc1[_0x602e('0xa')][_0x602e('0xe')];}return _0x1dd22c;}function adAuthenticate(_0x292cea,_0x5ed6ef,_0x20b142){return new BPromise(function(_0x309e0f,_0x5af72d){try{var _0x18b5b2=new ActiveDirectory(_0x292cea);_0x18b5b2[_0x602e('0xf')](_0x5ed6ef,_0x20b142,function(_0x154563,_0x261ab7){if(_0x154563){logger['error'](_0x602e('0x10'),_0x5ed6ef,util[_0x602e('0x11')](_0x154563,{'showHidden':![],'depth':null}));_0x5af72d('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x261ab7){logger[_0x602e('0x12')](_0x602e('0x13'),_0x5ed6ef);_0x5af72d(_0x602e('0x14'));}else{_0x309e0f(_0x261ab7);}});}catch(_0x58c179){_0x5af72d(_0x58c179);}});}function ActiveDirectoryAuthenticate(_0x2766f5,_0x502f08,_0x448eb9,_0xdfc008){var _0x114d37,_0x5c604e;if(!isActiveDirectoryConfigured(config)){logger[_0x602e('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x502f08);return _0xdfc008(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x602e('0x15')][_0x602e('0x16')]({'where':{'id':0x1},'attributes':[_0x602e('0x17'),_0x602e('0x18')],'raw':!![]})[_0x602e('0x19')](function(_0xcda370){_0x114d37=_0xcda370;if(!_0x114d37[_0x602e('0x17')]){logger[_0x602e('0x12')](_0x602e('0x1a'),_0x502f08);throw new Error(_0x602e('0x14'));}return _0x2766f5[_0x602e('0x16')]({'logging':!![],'attributes':['id',_0x602e('0x1b'),_0x602e('0x1c'),'salt',_0x602e('0x1d'),_0x602e('0x1e'),_0x602e('0x1f'),'blockedAt',_0x602e('0x20')],'where':{'name':_0x502f08,'role':{'$or':['admin',_0x602e('0x21'),_0x602e('0x22')]},'adSsoEnabled':!![]}});})['then'](function(_0x3a1e73){if(!_0x3a1e73||_0x3a1e73&&_0x3a1e73['name']!==_0x502f08){throw new Error(_0x602e('0x14'));}_0x5c604e=_0x3a1e73;var _0x26ce16=_0x5c604e[_0x602e('0x1b')]+'@'+config[_0x602e('0xa')][_0x602e('0xe')];return adAuthenticate(config['activedirectory'],_0x26ce16,_0x448eb9);})[_0x602e('0x19')](function(_0x18d356){if(_0x5c604e[_0x602e('0x1e')]){throw new Error(_0x602e('0x14'));}if(_0x114d37['blockDuration']>0x0){if(_0x5c604e[_0x602e('0x1f')]){if(moment(_0x5c604e[_0x602e('0x23')])[_0x602e('0x24')](_0x114d37['blockDuration'],_0x602e('0x25'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x602e('0x26')](_0x5c604e,0x0,![],null)[_0x602e('0x19')](function(){return utils[_0x602e('0x27')](_0x5c604e);})['then'](function(){return _0xdfc008(null,_0x5c604e);});}else{return utils[_0x602e('0x27')](_0x5c604e)[_0x602e('0x19')](function(){return _0xdfc008(null,_0x5c604e);});}}else{return utils[_0x602e('0x27')](_0x5c604e)[_0x602e('0x19')](function(){return _0xdfc008(null,_0x5c604e);});}})[_0x602e('0x28')](function(_0x50a913){return _0xdfc008(null,![],_0x50a913);});}function handleError(_0x12716b,_0x497590,_0x5fcbac){return _0x12716b[_0x602e('0x29')](_0x497590||0x1f4)[_0x602e('0x2a')]({'message':_0x5fcbac?_0x5fcbac[_0x602e('0x2b')]||_0x5fcbac:''});}exports[_0x602e('0x2c')]=function(_0x12b906,_0x19f918,_0x39a0a8){passport['authenticate'](_0x602e('0x2d'),function(_0x4d573f,_0x42c1db,_0x18d4fc){var _0x211567=_0x4d573f||_0x18d4fc;if(_0x211567){return handleError(_0x19f918,0x191,_0x211567);}if(!_0x42c1db){return handleError(_0x19f918,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x26c5a7={'payload':{'id':_0x42c1db['id'],'role':_0x42c1db[_0x602e('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x602e('0x2e')](_0x26c5a7)[_0x602e('0x19')](function(_0x423380){_0x19f918[_0x602e('0x2f')]({'id':_0x42c1db['id'],'token':_0x423380,'statusCall':'','isAlreadyLogged':_0x42c1db[_0x602e('0x20')]});});}})(_0x12b906,_0x19f918,_0x39a0a8);};passport[_0x602e('0x30')](_0x602e('0x2d'),new LocalStrategy({'usernameField':_0x602e('0x1b'),'passwordField':_0x602e('0x1c')},function(_0x531296,_0x500176,_0x13fb73){return ActiveDirectoryAuthenticate(db[_0x602e('0x31')],_0x531296,_0x500176,_0x13fb73);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 95d91d5..254a676 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 _0xb5f6=['login','exports','express','Router'];(function(_0x591e16,_0x5aefc1){var _0x543b35=function(_0x81e3be){while(--_0x81e3be){_0x591e16['push'](_0x591e16['shift']());}};_0x543b35(++_0x5aefc1);}(_0xb5f6,0x96));var _0x6b5f=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0xb5f6[_0x149ca0];return _0x56b6b9;};'use strict';var express=require(_0x6b5f('0x0'));var router=express[_0x6b5f('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x6b5f('0x2')]);module[_0x6b5f('0x3')]=router; \ No newline at end of file +var _0x2786=['exports','express','./authActiveDirectory.controller','post','login'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2786,0x1a5));var _0x6278=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2786[_0x1facfa];return _0x9ec701;};'use strict';var express=require(_0x6278('0x0'));var router=express['Router']();var controller=require(_0x6278('0x1'));router[_0x6278('0x2')]('/',controller[_0x6278('0x3')]);module[_0x6278('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index ffdec93..9f0fc5a 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7a54,0x106));var _0x47a5=function(_0x27125b,_0x2ea463){_0x27125b=_0x27125b-0x0;var _0x183f15=_0x7a54[_0x27125b];return _0x183f15;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x7a54,0x106));var _0x47a5=function(_0x3ad5be,_0x30c4f7){_0x3ad5be=_0x3ad5be-0x0;var _0x40f25c=_0x7a54[_0x3ad5be];return _0x40f25c;};'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 1a51c4a..6debef1 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 _0x2d48=['login','callback','isMiddleware','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x2f0f22,_0x3f4b8d){var _0x44f705=function(_0x187475){while(--_0x187475){_0x2f0f22['push'](_0x2f0f22['shift']());}};_0x44f705(++_0x3f4b8d);}(_0x2d48,0x143));var _0x82d4=function(_0x14a54a,_0x38a5c0){_0x14a54a=_0x14a54a-0x0;var _0x4d1dbe=_0x2d48[_0x14a54a];return _0x4d1dbe;};'use strict';var express=require(_0x82d4('0x0'));var passport=require(_0x82d4('0x1'));var router=express[_0x82d4('0x2')]();var controller=require(_0x82d4('0x3'));var userController=require(_0x82d4('0x4'));var authService=require(_0x82d4('0x5'));router[_0x82d4('0x6')]('/',controller[_0x82d4('0x7')]);router[_0x82d4('0x6')]('/callback',controller[_0x82d4('0x8')],authService[_0x82d4('0x9')],userController[_0x82d4('0x7')],authService['setTokenCookie']);module[_0x82d4('0xa')]=router; \ No newline at end of file +var _0xeccb=['express','./authGoogle.controller','../../components/auth/service','get','/callback','callback','isMiddleware'];(function(_0xbf7121,_0x847a81){var _0x1eaeba=function(_0x546bc0){while(--_0x546bc0){_0xbf7121['push'](_0xbf7121['shift']());}};_0x1eaeba(++_0x847a81);}(_0xeccb,0x16c));var _0xbecc=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xeccb[_0x4ea69d];return _0x5318e0;};'use strict';var express=require(_0xbecc('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0xbecc('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0xbecc('0x2'));router[_0xbecc('0x3')]('/',controller['login']);router[_0xbecc('0x3')](_0xbecc('0x4'),controller[_0xbecc('0x5')],authService[_0xbecc('0x6')],userController['login'],authService['setTokenCookie']);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 3d83522..eab5db0 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 _0xb7d6=['blocked','add','blockDuration','minutes','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','email','user','request','error','message','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','https://','headers','host','/reset/','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','resetPasswordToken','use','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','name','role','disabled','blockedAt','loginAttempts','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate'];(function(_0x16f04e,_0x379d5d){var _0x51735a=function(_0x391a14){while(--_0x391a14){_0x16f04e['push'](_0x16f04e['shift']());}};_0x51735a(++_0x379d5d);}(_0xb7d6,0xca));var _0x6b7d=function(_0x1e79d8,_0x3f2aa7){_0x1e79d8=_0x1e79d8-0x0;var _0x3c2e1c=_0xb7d6[_0x1e79d8];return _0x3c2e1c;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require('passport-local')[_0x6b7d('0x0')];var jayson=require(_0x6b7d('0x1'));var _=require(_0x6b7d('0x2'));var rs=require('randomstring');var moment=require(_0x6b7d('0x3'));var db=require(_0x6b7d('0x4'))['db'];var authService=require(_0x6b7d('0x5'));var utils=require(_0x6b7d('0x6'));var client=jayson['client'][_0x6b7d('0x7')]({'port':0x232b});function localAuthenticate(_0x34bd61,_0x2452d3,_0x3aaf9e,_0x36be9d){var _0x10b6df,_0x4c1bce;return db[_0x6b7d('0x8')][_0x6b7d('0x9')]({'where':{'id':0x1},'attributes':[_0x6b7d('0xa'),'blockDuration'],'raw':!![]})['then'](function(_0x5919b3){_0x10b6df=_0x5919b3;return _0x34bd61[_0x6b7d('0x9')]({'attributes':['id',_0x6b7d('0xb'),'password','salt',_0x6b7d('0xc'),_0x6b7d('0xd'),'blocked',_0x6b7d('0xe'),_0x6b7d('0xf')],'where':{'name':_0x2452d3,'role':{'$or':['admin','user',_0x6b7d('0x10')]}}});})[_0x6b7d('0x11')](function(_0x16dd6){if(!_0x16dd6||_0x16dd6&&_0x16dd6[_0x6b7d('0xb')]!==_0x2452d3){throw new Error(_0x6b7d('0x12'));}else{_0x4c1bce=_0x16dd6;return _0x4c1bce;}})[_0x6b7d('0x11')](function(){_0x4c1bce[_0x6b7d('0x13')](_0x3aaf9e,function(_0x3af0cd,_0xc34722){var _0x524d8a=_0x4c1bce[_0x6b7d('0xf')]+0x1;if(_0x3af0cd){return _0x36be9d(_0x3af0cd);}else if(!_0xc34722){if(_0x4c1bce['disabled']){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});}else if(_0x10b6df[_0x6b7d('0xa')]>0x0){if(_0x4c1bce[_0x6b7d('0x14')]){if(_0x10b6df['blockDuration']>0x0){if(moment(_0x4c1bce[_0x6b7d('0xe')])[_0x6b7d('0x15')](_0x10b6df[_0x6b7d('0x16')],_0x6b7d('0x17'))>moment()){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});}else{return utils[_0x6b7d('0x18')](_0x4c1bce,_0x524d8a,![],null)[_0x6b7d('0x11')](function(){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});});}}else{return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});}}else{if(_0x524d8a>=_0x10b6df[_0x6b7d('0xa')]){return utils[_0x6b7d('0x18')](_0x4c1bce,0x0,!![],moment())[_0x6b7d('0x11')](function(){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});});}else{return utils[_0x6b7d('0x18')](_0x4c1bce,_0x524d8a,![],null)[_0x6b7d('0x11')](function(){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});});}}}else{return _0x36be9d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4c1bce['disabled']){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});}else if(_0x10b6df['allowedLoginAttempts']>0x0){if(_0x4c1bce[_0x6b7d('0x14')]){if(_0x10b6df[_0x6b7d('0x16')]>0x0){if(moment(_0x4c1bce[_0x6b7d('0xe')])[_0x6b7d('0x15')](_0x10b6df['blockDuration'],_0x6b7d('0x17'))>moment()){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});}else{return utils[_0x6b7d('0x18')](_0x4c1bce,0x0,![],null)[_0x6b7d('0x11')](function(){return utils[_0x6b7d('0x19')](_0x4c1bce);})[_0x6b7d('0x11')](function(){return _0x36be9d(null,_0x4c1bce);});}}else{return _0x36be9d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x6b7d('0x18')](_0x4c1bce,0x0,![],null)[_0x6b7d('0x11')](function(){return utils[_0x6b7d('0x19')](_0x4c1bce);})['then'](function(){return _0x36be9d(null,_0x4c1bce);})[_0x6b7d('0x1a')](function(_0x2701de){return _0x36be9d(null,![],_0x2701de);});}}else{if(_0x4c1bce[_0x6b7d('0x14')]){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});}else{return utils[_0x6b7d('0x19')](_0x4c1bce)['then'](function(){return _0x36be9d(null,_0x4c1bce);});}}}});})[_0x6b7d('0x1a')](function(_0x45ade3){return _0x36be9d(null,![],_0x45ade3);});}function sendServiceMail(_0xc2aef){return db[_0x6b7d('0x1b')][_0x6b7d('0x1c')]({'where':{'service':!![]},'attributes':['id',_0x6b7d('0xb'),'email'],'include':[{'model':db[_0x6b7d('0x1d')],'as':_0x6b7d('0x1e'),'include':[{'model':db[_0x6b7d('0x1f')],'as':_0x6b7d('0x1f')}]}]})[_0x6b7d('0x11')](function(_0x55d341){if(!_0x55d341){throw new Error(_0x6b7d('0x20'));}var _0x5056e8=_0x55d341[_0x6b7d('0x21')]();var _0x38130c={'account':_0x5056e8,'message':_['merge']({'from':util[_0x6b7d('0x22')]('\x22%s\x22\x20<%s>',_0x55d341[_0x6b7d('0xb')],_0x55d341[_0x6b7d('0x23')]||_0x55d341[_0x6b7d('0x1e')][_0x6b7d('0x24')])},_0xc2aef)};return client[_0x6b7d('0x25')]('SendMail',_0x38130c);})[_0x6b7d('0x11')](function(_0xd25b2b){if(_0xd25b2b[_0x6b7d('0x26')]){throw new Error(util[_0x6b7d('0x22')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0xd25b2b[_0x6b7d('0x26')][_0x6b7d('0x27')]||JSON['stringify'](_0xd25b2b[_0x6b7d('0x26')])));}return!![];});}function handleError(_0x30db81,_0x36fdeb,_0xe54b7e){return _0x30db81['status'](_0x36fdeb||0x1f4)[_0x6b7d('0x28')]({'message':_0xe54b7e?_0xe54b7e[_0x6b7d('0x27')]||_0xe54b7e:''});}exports['login']=function(_0x4f2894,_0x10d6fd,_0x5bb6ee){passport[_0x6b7d('0x13')](_0x6b7d('0x29'),function(_0x4e5e42,_0x337af8,_0x390146){var _0x3ae271=_0x4e5e42||_0x390146;if(_0x3ae271){return handleError(_0x10d6fd,0x191,_0x3ae271);}if(!_0x337af8){return handleError(_0x10d6fd,0x194,{'message':_0x6b7d('0x2a')});}else{var _0x5a71b2={'payload':{'id':_0x337af8['id'],'role':_0x337af8['role']},'options':{'expiresIn':0x15180}};return authService[_0x6b7d('0x2b')](_0x5a71b2)[_0x6b7d('0x11')](function(_0x15b7d7){_0x10d6fd['json']({'id':_0x337af8['id'],'token':_0x15b7d7,'statusCall':'','isAlreadyLogged':_0x337af8[_0x6b7d('0x2c')]});});}})(_0x4f2894,_0x10d6fd,_0x5bb6ee);};exports[_0x6b7d('0x2d')]=function(_0x148a9f,_0x4cefd0){if(!_0x148a9f[_0x6b7d('0x2e')][_0x6b7d('0x23')]){return handleError(_0x4cefd0,0x1f4,{'message':_0x6b7d('0x2f')});}var _0x8bb2ff=rs['generate']();_0x148a9f[_0x6b7d('0x2e')][_0x6b7d('0x23')]=_0x148a9f['body']['email'][_0x6b7d('0x30')]()[_0x6b7d('0x31')]();var _0x38e9e0;return db[_0x6b7d('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0x6b7d('0xa'),_0x6b7d('0x16')],'raw':!![]})[_0x6b7d('0x11')](function(_0x10d40c){_0x38e9e0=_0x10d40c;return db[_0x6b7d('0x32')]['find']({'where':{'email':_0x148a9f[_0x6b7d('0x2e')]['email']}});})['then'](function(_0x42e9dd){if(!_0x42e9dd){throw new Error(_0x6b7d('0x33'));}if(_0x42e9dd['disabled']){throw new Error(_0x6b7d('0x34'));}if(_0x42e9dd[_0x6b7d('0x14')]){if(moment(_0x42e9dd[_0x6b7d('0xe')])[_0x6b7d('0x15')](_0x38e9e0[_0x6b7d('0x16')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x42e9dd[_0x6b7d('0x14')]=![];_0x42e9dd[_0x6b7d('0xe')]=null;}}_0x42e9dd['resetPasswordToken']=_0x8bb2ff;_0x42e9dd[_0x6b7d('0x35')]=Date[_0x6b7d('0x36')]()+0x36ee80;return _0x42e9dd[_0x6b7d('0x37')]();})[_0x6b7d('0x11')](function(){return sendServiceMail({'to':_0x148a9f['body'][_0x6b7d('0x23')],'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'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x6b7d('0x38')+_0x148a9f[_0x6b7d('0x39')][_0x6b7d('0x3a')]+_0x6b7d('0x3b')+_0x8bb2ff+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x6b7d('0x11')](function(){_0x4cefd0[_0x6b7d('0x3c')](0xc8)[_0x6b7d('0x28')]({'message':_0x6b7d('0x3d')});})[_0x6b7d('0x1a')](function(_0x8b5e2e){return handleError(_0x4cefd0,0x1f4,_0x8b5e2e);});};exports[_0x6b7d('0x3e')]=function(_0x3e2751,_0x5793c3){return db[_0x6b7d('0x32')][_0x6b7d('0x1c')]({'where':{'resetPasswordToken':_0x3e2751[_0x6b7d('0x3f')][_0x6b7d('0x40')],'resetPasswordExpires':{'$gt':Date[_0x6b7d('0x36')]()}}})['then'](function(_0x144e8d){if(!_0x144e8d){throw new Error(_0x6b7d('0x41'));}return db[_0x6b7d('0x8')]['findOne']({'attributes':['id',_0x6b7d('0x42'),_0x6b7d('0x43'),'passwordHistoryLimit']})[_0x6b7d('0x11')](function(_0x10c167){if(_0x10c167[_0x6b7d('0x42')])authService[_0x6b7d('0x44')](_0x3e2751[_0x6b7d('0x2e')][_0x6b7d('0x45')]);if(!_0x10c167[_0x6b7d('0x43')]||!_0x144e8d[_0x6b7d('0x46')])return _0x144e8d;authService[_0x6b7d('0x47')](_0x3e2751[_0x6b7d('0x2e')][_0x6b7d('0x45')],_0x144e8d[_0x6b7d('0x46')],_0x10c167['passwordHistoryLimit']);return _0x144e8d;})[_0x6b7d('0x11')](function(){_0x144e8d[_0x6b7d('0x45')]=_0x3e2751['body'][_0x6b7d('0x45')];_0x144e8d[_0x6b7d('0x48')]=null;_0x144e8d['resetPasswordExpires']=null;return _0x144e8d[_0x6b7d('0x37')]();});})[_0x6b7d('0x11')](function(){_0x5793c3[_0x6b7d('0x3c')](0xc8)[_0x6b7d('0x28')]({'message':'Password\x20reset!'});})[_0x6b7d('0x1a')](function(_0x44ff3f){return handleError(_0x5793c3,0x1f4,_0x44ff3f);});};passport[_0x6b7d('0x49')](_0x6b7d('0x29'),new LocalStrategy({'usernameField':_0x6b7d('0xb'),'passwordField':_0x6b7d('0x45')},function(_0x6e765c,_0x53aae2,_0xc95376){return localAuthenticate(db['User'],_0x6e765c,_0x53aae2,_0xc95376);})); \ No newline at end of file +var _0xb986=['admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','name','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','local-login','role','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','password','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../config/utils','client','Setting','blockDuration','then','findOne','salt','disabled','blockedAt','loginAttempts'];(function(_0x31dabc,_0x4762d4){var _0x22c853=function(_0x5d81b2){while(--_0x5d81b2){_0x31dabc['push'](_0x31dabc['shift']());}};_0x22c853(++_0x4762d4);}(_0xb986,0x89));var _0x6b98=function(_0x38062,_0x5f2b18){_0x38062=_0x38062-0x0;var _0x166bc6=_0xb986[_0x38062];return _0x166bc6;};'use strict';var util=require(_0x6b98('0x0'));var passport=require(_0x6b98('0x1'));var LocalStrategy=require(_0x6b98('0x2'))[_0x6b98('0x3')];var jayson=require(_0x6b98('0x4'));var _=require(_0x6b98('0x5'));var rs=require('randomstring');var moment=require(_0x6b98('0x6'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x6b98('0x7'));var client=jayson[_0x6b98('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x55fe8a,_0x310090,_0x503ff7,_0xa9a827){var _0x5d391f,_0x4ac3e0;return db[_0x6b98('0x9')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x6b98('0xa')],'raw':!![]})[_0x6b98('0xb')](function(_0xf78df){_0x5d391f=_0xf78df;return _0x55fe8a[_0x6b98('0xc')]({'attributes':['id','name','password',_0x6b98('0xd'),'role',_0x6b98('0xe'),'blocked',_0x6b98('0xf'),_0x6b98('0x10')],'where':{'name':_0x310090,'role':{'$or':[_0x6b98('0x11'),_0x6b98('0x12'),_0x6b98('0x13')]}}});})[_0x6b98('0xb')](function(_0x294127){if(!_0x294127||_0x294127&&_0x294127['name']!==_0x310090){throw new Error(_0x6b98('0x14'));}else{_0x4ac3e0=_0x294127;return _0x4ac3e0;}})[_0x6b98('0xb')](function(){_0x4ac3e0[_0x6b98('0x15')](_0x503ff7,function(_0x5df258,_0x3a785c){var _0x1a60e7=_0x4ac3e0[_0x6b98('0x10')]+0x1;if(_0x5df258){return _0xa9a827(_0x5df258);}else if(!_0x3a785c){if(_0x4ac3e0[_0x6b98('0xe')]){return _0xa9a827(null,![],{'message':_0x6b98('0x14')});}else if(_0x5d391f[_0x6b98('0x16')]>0x0){if(_0x4ac3e0[_0x6b98('0x17')]){if(_0x5d391f[_0x6b98('0xa')]>0x0){if(moment(_0x4ac3e0[_0x6b98('0xf')])[_0x6b98('0x18')](_0x5d391f[_0x6b98('0xa')],_0x6b98('0x19'))>moment()){return _0xa9a827(null,![],{'message':_0x6b98('0x14')});}else{return utils[_0x6b98('0x1a')](_0x4ac3e0,_0x1a60e7,![],null)[_0x6b98('0xb')](function(){return _0xa9a827(null,![],{'message':_0x6b98('0x14')});});}}else{return _0xa9a827(null,![],{'message':_0x6b98('0x14')});}}else{if(_0x1a60e7>=_0x5d391f[_0x6b98('0x16')]){return utils['clearBlockUser'](_0x4ac3e0,0x0,!![],moment())[_0x6b98('0xb')](function(){return _0xa9a827(null,![],{'message':_0x6b98('0x14')});});}else{return utils[_0x6b98('0x1a')](_0x4ac3e0,_0x1a60e7,![],null)[_0x6b98('0xb')](function(){return _0xa9a827(null,![],{'message':_0x6b98('0x14')});});}}}else{return _0xa9a827(null,![],{'message':_0x6b98('0x14')});}}else{if(_0x4ac3e0[_0x6b98('0xe')]){return _0xa9a827(null,![],{'message':_0x6b98('0x14')});}else if(_0x5d391f['allowedLoginAttempts']>0x0){if(_0x4ac3e0['blocked']){if(_0x5d391f[_0x6b98('0xa')]>0x0){if(moment(_0x4ac3e0['blockedAt'])[_0x6b98('0x18')](_0x5d391f[_0x6b98('0xa')],'minutes')>moment()){return _0xa9a827(null,![],{'message':_0x6b98('0x14')});}else{return utils[_0x6b98('0x1a')](_0x4ac3e0,0x0,![],null)[_0x6b98('0xb')](function(){return utils['getLicense'](_0x4ac3e0);})[_0x6b98('0xb')](function(){return _0xa9a827(null,_0x4ac3e0);});}}else{return _0xa9a827(null,![],{'message':_0x6b98('0x14')});}}else{return utils[_0x6b98('0x1a')](_0x4ac3e0,0x0,![],null)[_0x6b98('0xb')](function(){return utils[_0x6b98('0x1b')](_0x4ac3e0);})[_0x6b98('0xb')](function(){return _0xa9a827(null,_0x4ac3e0);})[_0x6b98('0x1c')](function(_0x1d3955){return _0xa9a827(null,![],_0x1d3955);});}}else{if(_0x4ac3e0[_0x6b98('0x17')]){return _0xa9a827(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x6b98('0x1b')](_0x4ac3e0)[_0x6b98('0xb')](function(){return _0xa9a827(null,_0x4ac3e0);});}}}});})[_0x6b98('0x1c')](function(_0x3aa0e2){return _0xa9a827(null,![],_0x3aa0e2);});}function sendServiceMail(_0x2db890){return db[_0x6b98('0x1d')][_0x6b98('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x6b98('0x1f'),_0x6b98('0x20')],'include':[{'model':db['MailServerOut'],'as':_0x6b98('0x21'),'include':[{'model':db[_0x6b98('0x22')],'as':_0x6b98('0x22')}]}]})['then'](function(_0x40077a){if(!_0x40077a){throw new Error(_0x6b98('0x23'));}var _0x12af06=_0x40077a[_0x6b98('0x24')]();var _0x3b660c={'account':_0x12af06,'message':_['merge']({'from':util['format'](_0x6b98('0x25'),_0x40077a[_0x6b98('0x1f')],_0x40077a[_0x6b98('0x20')]||_0x40077a[_0x6b98('0x21')][_0x6b98('0x12')])},_0x2db890)};return client[_0x6b98('0x26')](_0x6b98('0x27'),_0x3b660c);})['then'](function(_0x305229){if(_0x305229[_0x6b98('0x28')]){throw new Error(util['format'](_0x6b98('0x29'),_0x305229['error'][_0x6b98('0x2a')]||JSON[_0x6b98('0x2b')](_0x305229['error'])));}return!![];});}function handleError(_0x2751c7,_0x564361,_0x1fbd80){return _0x2751c7[_0x6b98('0x2c')](_0x564361||0x1f4)['send']({'message':_0x1fbd80?_0x1fbd80[_0x6b98('0x2a')]||_0x1fbd80:''});}exports[_0x6b98('0x2d')]=function(_0x285164,_0x375eb0,_0x3862a9){passport['authenticate'](_0x6b98('0x2e'),function(_0x39cf36,_0x1cbc81,_0x3fc58b){var _0x208b1a=_0x39cf36||_0x3fc58b;if(_0x208b1a){return handleError(_0x375eb0,0x191,_0x208b1a);}if(!_0x1cbc81){return handleError(_0x375eb0,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x17bcce={'payload':{'id':_0x1cbc81['id'],'role':_0x1cbc81[_0x6b98('0x2f')]},'options':{'expiresIn':0x15180}};return authService[_0x6b98('0x30')](_0x17bcce)[_0x6b98('0xb')](function(_0x5bcd9d){_0x375eb0[_0x6b98('0x31')]({'id':_0x1cbc81['id'],'token':_0x5bcd9d,'statusCall':'','isAlreadyLogged':_0x1cbc81[_0x6b98('0x32')]});});}})(_0x285164,_0x375eb0,_0x3862a9);};exports[_0x6b98('0x33')]=function(_0x17fbd3,_0x4ff8da){if(!_0x17fbd3[_0x6b98('0x34')][_0x6b98('0x20')]){return handleError(_0x4ff8da,0x1f4,{'message':_0x6b98('0x35')});}var _0x21d042=rs[_0x6b98('0x36')]();_0x17fbd3[_0x6b98('0x34')][_0x6b98('0x20')]=_0x17fbd3[_0x6b98('0x34')][_0x6b98('0x20')][_0x6b98('0x37')]()['toLowerCase']();var _0x1f58fc;return db[_0x6b98('0x9')][_0x6b98('0xc')]({'where':{'id':0x1},'attributes':[_0x6b98('0x16'),_0x6b98('0xa')],'raw':!![]})[_0x6b98('0xb')](function(_0x191a4c){_0x1f58fc=_0x191a4c;return db[_0x6b98('0x38')][_0x6b98('0x1e')]({'where':{'email':_0x17fbd3['body'][_0x6b98('0x20')]}});})['then'](function(_0x243624){if(!_0x243624){throw new Error(_0x6b98('0x39'));}if(_0x243624['disabled']){throw new Error(_0x6b98('0x3a'));}if(_0x243624[_0x6b98('0x17')]){if(moment(_0x243624[_0x6b98('0xf')])[_0x6b98('0x18')](_0x1f58fc[_0x6b98('0xa')],_0x6b98('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x243624[_0x6b98('0x17')]=![];_0x243624['blockedAt']=null;}}_0x243624[_0x6b98('0x3b')]=_0x21d042;_0x243624[_0x6b98('0x3c')]=Date['now']()+0x36ee80;return _0x243624[_0x6b98('0x3d')]();})[_0x6b98('0xb')](function(){return sendServiceMail({'to':_0x17fbd3[_0x6b98('0x34')][_0x6b98('0x20')],'subject':_0x6b98('0x3e'),'text':_0x6b98('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x17fbd3['headers'][_0x6b98('0x40')]+_0x6b98('0x41')+_0x21d042+'\x0a\x0a'+_0x6b98('0x42')});})['then'](function(){_0x4ff8da['status'](0xc8)[_0x6b98('0x43')]({'message':'Reset\x20Email\x20sent!'});})[_0x6b98('0x1c')](function(_0x2bed66){return handleError(_0x4ff8da,0x1f4,_0x2bed66);});};exports[_0x6b98('0x44')]=function(_0x4dbdd4,_0x1c1228){return db['User'][_0x6b98('0x1e')]({'where':{'resetPasswordToken':_0x4dbdd4['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x6b98('0xb')](function(_0x2eeda0){if(!_0x2eeda0){throw new Error(_0x6b98('0x45'));}return db[_0x6b98('0x9')][_0x6b98('0xc')]({'attributes':['id',_0x6b98('0x46'),_0x6b98('0x47'),_0x6b98('0x48')]})[_0x6b98('0xb')](function(_0x25bf0e){if(_0x25bf0e[_0x6b98('0x46')])authService[_0x6b98('0x49')](_0x4dbdd4[_0x6b98('0x34')]['password']);if(!_0x25bf0e[_0x6b98('0x47')]||!_0x2eeda0['previousPasswords'])return _0x2eeda0;authService[_0x6b98('0x4a')](_0x4dbdd4[_0x6b98('0x34')]['password'],_0x2eeda0[_0x6b98('0x4b')],_0x25bf0e[_0x6b98('0x48')]);return _0x2eeda0;})['then'](function(){_0x2eeda0['password']=_0x4dbdd4[_0x6b98('0x34')][_0x6b98('0x4c')];_0x2eeda0[_0x6b98('0x3b')]=null;_0x2eeda0[_0x6b98('0x3c')]=null;return _0x2eeda0[_0x6b98('0x3d')]();});})[_0x6b98('0xb')](function(){_0x1c1228[_0x6b98('0x2c')](0xc8)[_0x6b98('0x43')]({'message':'Password\x20reset!'});})[_0x6b98('0x1c')](function(_0x1ef892){return handleError(_0x1c1228,0x1f4,_0x1ef892);});};passport['use'](_0x6b98('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':_0x6b98('0x4c')},function(_0x1904fc,_0x23fd1b,_0x5695a3){return localAuthenticate(db[_0x6b98('0x38')],_0x1904fc,_0x23fd1b,_0x5695a3);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 7f22007..20701cb 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 _0x5c2d=['/forgot','/reset/:token','reset','Router','./authLocal.controller','post'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x5c2d,0x135));var _0xd5c2=function(_0x4429aa,_0x72d291){_0x4429aa=_0x4429aa-0x0;var _0x480074=_0x5c2d[_0x4429aa];return _0x480074;};'use strict';var express=require('express');var router=express[_0xd5c2('0x0')]();var controller=require(_0xd5c2('0x1'));router[_0xd5c2('0x2')]('/',controller['login']);router['post'](_0xd5c2('0x3'),controller['forgot']);router[_0xd5c2('0x2')](_0xd5c2('0x4'),controller[_0xd5c2('0x5')]);module['exports']=router; \ No newline at end of file +var _0x0731=['express','post','login','/forgot','forgot','/reset/:token','exports'];(function(_0x4e3cfa,_0xf8d93e){var _0x36adad=function(_0x991058){while(--_0x991058){_0x4e3cfa['push'](_0x4e3cfa['shift']());}};_0x36adad(++_0xf8d93e);}(_0x0731,0x7e));var _0x1073=function(_0x4814c1,_0x542a95){_0x4814c1=_0x4814c1-0x0;var _0x255b76=_0x0731[_0x4814c1];return _0x255b76;};'use strict';var express=require(_0x1073('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0x1073('0x1')]('/',controller[_0x1073('0x2')]);router[_0x1073('0x1')](_0x1073('0x3'),controller[_0x1073('0x4')]);router[_0x1073('0x1')](_0x1073('0x5'),controller['reset']);module[_0x1073('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index da0c608..a3ae11d 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 _0xed20=['STRING','INTEGER','sequelize','exports'];(function(_0x24e952,_0x4850cb){var _0xc8c26d=function(_0x11c8d0){while(--_0x11c8d0){_0x24e952['push'](_0x24e952['shift']());}};_0xc8c26d(++_0x4850cb);}(_0xed20,0x14e));var _0x0ed2=function(_0x1db2f5,_0x42111e){_0x1db2f5=_0x1db2f5-0x0;var _0x5ec281=_0xed20[_0x1db2f5];return _0x5ec281;};'use strict';var Sequelize=require(_0x0ed2('0x0'));module[_0x0ed2('0x1')]={'name':{'type':Sequelize[_0x0ed2('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0ed2('0x2')]},'description':{'type':Sequelize[_0x0ed2('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0ed2('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xe9c8=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe9c8,0x10a));var _0x8e9c=function(_0x1343fe,_0x1b99ab){_0x1343fe=_0x1343fe-0x0;var _0x354bc7=_0xe9c8[_0x1343fe];return _0x354bc7;};'use strict';var Sequelize=require(_0x8e9c('0x0'));module[_0x8e9c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8e9c('0x2')]},'status':{'type':Sequelize[_0x8e9c('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8e9c('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 7f585d9..3395baf 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 _0x2bf6=['addActions','Action','order','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','addConditions','Condition','omit','ids','findOne','getConditions'];(function(_0x37d90a,_0xd8683e){var _0x365635=function(_0xcbcd2a){while(--_0xcbcd2a){_0x37d90a['push'](_0x37d90a['shift']());}};_0x365635(++_0xd8683e);}(_0x2bf6,0xae));var _0x62bf=function(_0x257951,_0x1e0bcf){_0x257951=_0x257951-0x0;var _0x23a7fa=_0x2bf6[_0x257951];return _0x23a7fa;};'use strict';var emlformat=require(_0x62bf('0x0'));var rimraf=require(_0x62bf('0x1'));var zipdir=require(_0x62bf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x62bf('0x3'));var moment=require(_0x62bf('0x4'));var BPromise=require(_0x62bf('0x5'));var Mustache=require('mustache');var util=require(_0x62bf('0x6'));var path=require('path');var sox=require(_0x62bf('0x7'));var csv=require(_0x62bf('0x8'));var ejs=require(_0x62bf('0x9'));var fs=require('fs');var fs_extra=require(_0x62bf('0xa'));var _=require('lodash');var squel=require(_0x62bf('0xb'));var crypto=require('crypto');var jsforce=require(_0x62bf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x62bf('0x8'));var querystring=require(_0x62bf('0xd'));var Papa=require(_0x62bf('0xe'));var Redis=require(_0x62bf('0xf'));var authService=require(_0x62bf('0x10'));var qs=require(_0x62bf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62bf('0x12'));var logger=require(_0x62bf('0x13'))(_0x62bf('0x14'));var utils=require(_0x62bf('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x62bf('0x16'));var db=require(_0x62bf('0x17'))['db'];function respondWithStatusCode(_0x34d5da,_0x3ace1d){_0x3ace1d=_0x3ace1d||0xcc;return function(_0xfccae2){if(_0xfccae2){return _0x34d5da[_0x62bf('0x18')](_0x3ace1d);}return _0x34d5da[_0x62bf('0x19')](_0x3ace1d)[_0x62bf('0x1a')]();};}function respondWithResult(_0x2716f3,_0x4e89cb){_0x4e89cb=_0x4e89cb||0xc8;return function(_0x209b95){if(_0x209b95){return _0x2716f3[_0x62bf('0x19')](_0x4e89cb)[_0x62bf('0x1b')](_0x209b95);}};}function respondWithFilteredResult(_0xa27d01,_0x430871){return function(_0x3ecaaf){if(_0x3ecaaf){var _0x1883a1=typeof _0x430871[_0x62bf('0x1c')]===_0x62bf('0x1d')&&typeof _0x430871[_0x62bf('0x1e')]===_0x62bf('0x1d');var _0x2e0e88=_0x3ecaaf[_0x62bf('0x1f')];var _0x1f05c5=_0x1883a1?0x0:_0x430871[_0x62bf('0x1c')];var _0x2c6656=_0x1883a1?_0x3ecaaf[_0x62bf('0x1f')]:_0x430871['offset']+_0x430871[_0x62bf('0x1e')];var _0x51d64d;if(_0x2c6656>=_0x2e0e88){_0x2c6656=_0x2e0e88;_0x51d64d=0xc8;}else{_0x51d64d=0xce;}_0xa27d01[_0x62bf('0x19')](_0x51d64d);return _0xa27d01[_0x62bf('0x20')](_0x62bf('0x21'),_0x1f05c5+'-'+_0x2c6656+'/'+_0x2e0e88)[_0x62bf('0x1b')](_0x3ecaaf);}return null;};}function patchUpdates(_0x4aa49a){return function(_0x3c21c9){try{jsonpatch[_0x62bf('0x22')](_0x3c21c9,_0x4aa49a,!![]);}catch(_0x450c1d){return BPromise[_0x62bf('0x23')](_0x450c1d);}return _0x3c21c9['save']();};}function saveUpdates(_0x16e2e5,_0x141743){return function(_0x1994e3){if(_0x1994e3){return _0x1994e3[_0x62bf('0x24')](_0x16e2e5)['then'](function(_0x12bd62){return _0x12bd62;});}return null;};}function removeEntity(_0x2b9d41,_0xd00e66){return function(_0x4d1c37){if(_0x4d1c37){return _0x4d1c37[_0x62bf('0x25')]()['then'](function(){_0x2b9d41[_0x62bf('0x19')](0xcc)[_0x62bf('0x1a')]();});}};}function handleEntityNotFound(_0x3a8b71,_0x1ec4c9){return function(_0x53f3ee){if(!_0x53f3ee){_0x3a8b71[_0x62bf('0x18')](0x194);}return _0x53f3ee;};}function handleError(_0x4ee477,_0x4682a4){_0x4682a4=_0x4682a4||0x1f4;return function(_0x142ec9){logger['error'](_0x142ec9[_0x62bf('0x26')]);if(_0x142ec9[_0x62bf('0x27')]){delete _0x142ec9[_0x62bf('0x27')];}_0x4ee477[_0x62bf('0x19')](_0x4682a4)[_0x62bf('0x28')](_0x142ec9);};}exports[_0x62bf('0x29')]=function(_0x4ea586,_0x2a295c){var _0x4b3170={},_0x25eeaf={},_0x337643={'count':0x0,'rows':[]};var _0x2e4a7f=_[_0x62bf('0x2a')](db[_0x62bf('0x2b')][_0x62bf('0x2c')],function(_0x689901){return{'name':_0x689901[_0x62bf('0x2d')],'type':_0x689901[_0x62bf('0x2e')][_0x62bf('0x2f')]};});_0x25eeaf[_0x62bf('0x30')]=_[_0x62bf('0x2a')](_0x2e4a7f,'name');_0x25eeaf[_0x62bf('0x31')]=_['keys'](_0x4ea586[_0x62bf('0x31')]);_0x25eeaf[_0x62bf('0x32')]=_[_0x62bf('0x33')](_0x25eeaf[_0x62bf('0x30')],_0x25eeaf['query']);_0x4b3170['attributes']=_[_0x62bf('0x33')](_0x25eeaf['model'],qs[_0x62bf('0x34')](_0x4ea586['query'][_0x62bf('0x34')]));_0x4b3170[_0x62bf('0x35')]=_0x4b3170[_0x62bf('0x35')]['length']?_0x4b3170['attributes']:_0x25eeaf[_0x62bf('0x30')];if(!_0x4ea586[_0x62bf('0x31')][_0x62bf('0x36')](_0x62bf('0x37'))){_0x4b3170['limit']=qs[_0x62bf('0x1e')](_0x4ea586['query']['limit']);_0x4b3170[_0x62bf('0x1c')]=qs['offset'](_0x4ea586['query']['offset']);}_0x4b3170['order']=qs[_0x62bf('0x38')](_0x4ea586['query'][_0x62bf('0x38')]);_0x4b3170[_0x62bf('0x39')]=qs[_0x62bf('0x32')](_[_0x62bf('0x3a')](_0x4ea586['query'],_0x25eeaf[_0x62bf('0x32')]),_0x2e4a7f);if(_0x4ea586[_0x62bf('0x31')][_0x62bf('0x3b')]){_0x4b3170[_0x62bf('0x39')]=_['merge'](_0x4b3170[_0x62bf('0x39')],{'$or':_['map'](_0x2e4a7f,function(_0x291081){if(_0x291081[_0x62bf('0x2e')]!=='VIRTUAL'){var _0x418598={};_0x418598[_0x291081[_0x62bf('0x27')]]={'$like':'%'+_0x4ea586[_0x62bf('0x31')][_0x62bf('0x3b')]+'%'};return _0x418598;}})});}_0x4b3170=_[_0x62bf('0x3c')]({},_0x4b3170,_0x4ea586[_0x62bf('0x3d')]);var _0x477fbd={'where':_0x4b3170[_0x62bf('0x39')]};return db[_0x62bf('0x2b')][_0x62bf('0x1f')](_0x477fbd)[_0x62bf('0x3e')](function(_0x22c2b6){_0x337643[_0x62bf('0x1f')]=_0x22c2b6;if(_0x4ea586[_0x62bf('0x31')][_0x62bf('0x3f')]){_0x4b3170[_0x62bf('0x40')]=[{'all':!![]}];}return db[_0x62bf('0x2b')][_0x62bf('0x41')](_0x4b3170);})['then'](function(_0x258fc2){_0x337643[_0x62bf('0x42')]=_0x258fc2;return _0x337643;})[_0x62bf('0x3e')](respondWithFilteredResult(_0x2a295c,_0x4b3170))[_0x62bf('0x43')](handleError(_0x2a295c,null));};exports[_0x62bf('0x44')]=function(_0x5e5461,_0x1e61ec){var _0x36b15b={'raw':![],'where':{'id':_0x5e5461[_0x62bf('0x45')]['id']}},_0x3176e9={};_0x3176e9[_0x62bf('0x30')]=_['keys'](db[_0x62bf('0x2b')][_0x62bf('0x2c')]);_0x3176e9['query']=_[_0x62bf('0x46')](_0x5e5461[_0x62bf('0x31')]);_0x3176e9[_0x62bf('0x32')]=_[_0x62bf('0x33')](_0x3176e9[_0x62bf('0x30')],_0x3176e9['query']);_0x36b15b['attributes']=_[_0x62bf('0x33')](_0x3176e9[_0x62bf('0x30')],qs[_0x62bf('0x34')](_0x5e5461[_0x62bf('0x31')]['fields']));_0x36b15b[_0x62bf('0x35')]=_0x36b15b[_0x62bf('0x35')][_0x62bf('0x47')]?_0x36b15b['attributes']:_0x3176e9['model'];if(_0x5e5461['query'][_0x62bf('0x3f')]){_0x36b15b[_0x62bf('0x40')]=[{'all':!![]}];}_0x36b15b=_['merge']({},_0x36b15b,_0x5e5461[_0x62bf('0x3d')]);return db['Automation'][_0x62bf('0x48')](_0x36b15b)[_0x62bf('0x3e')](handleEntityNotFound(_0x1e61ec,null))['then'](respondWithResult(_0x1e61ec,null))[_0x62bf('0x43')](handleError(_0x1e61ec,null));};exports[_0x62bf('0x49')]=function(_0x4e92b6,_0x5abce7){return db[_0x62bf('0x2b')][_0x62bf('0x49')](_0x4e92b6[_0x62bf('0x4a')],{})[_0x62bf('0x3e')](respondWithResult(_0x5abce7,0xc9))[_0x62bf('0x43')](handleError(_0x5abce7,null));};exports[_0x62bf('0x24')]=function(_0x4ee924,_0x521648){if(_0x4ee924[_0x62bf('0x4a')]['id']){delete _0x4ee924[_0x62bf('0x4a')]['id'];}return db['Automation'][_0x62bf('0x48')]({'where':{'id':_0x4ee924[_0x62bf('0x45')]['id']}})[_0x62bf('0x3e')](handleEntityNotFound(_0x521648,null))[_0x62bf('0x3e')](saveUpdates(_0x4ee924[_0x62bf('0x4a')],null))[_0x62bf('0x3e')](respondWithResult(_0x521648,null))[_0x62bf('0x43')](handleError(_0x521648,null));};exports[_0x62bf('0x25')]=function(_0x3f71d5,_0x25dc99){return db['Automation']['find']({'where':{'id':_0x3f71d5[_0x62bf('0x45')]['id']}})['then'](handleEntityNotFound(_0x25dc99,null))[_0x62bf('0x3e')](removeEntity(_0x25dc99,null))[_0x62bf('0x43')](handleError(_0x25dc99,null));};exports[_0x62bf('0x4b')]=function(_0x263ab2,_0x5d8217,_0x3bf47c){return db[_0x62bf('0x4c')][_0x62bf('0x48')]({'where':{'id':_0x263ab2[_0x62bf('0x45')]['id']}})[_0x62bf('0x3e')](handleEntityNotFound(_0x5d8217,null))['then'](function(_0x1c3aba){if(_0x1c3aba){return _0x1c3aba[_0x62bf('0x4b')](_0x263ab2[_0x62bf('0x4a')]['ids'],_[_0x62bf('0x4d')](_0x263ab2['body'],[_0x62bf('0x4e'),'id'])||{});}})[_0x62bf('0x3e')](respondWithResult(_0x5d8217,null))[_0x62bf('0x43')](handleError(_0x5d8217,null));};exports['getConditions']=function(_0x5e1add,_0x1d9f49,_0x168a73){var _0x300067={};var _0x2679c4={};var _0x2dcd99;var _0x182566;return db[_0x62bf('0x2b')][_0x62bf('0x4f')]({'where':{'id':_0x5e1add[_0x62bf('0x45')]['id']}})[_0x62bf('0x3e')](handleEntityNotFound(_0x1d9f49,null))[_0x62bf('0x3e')](function(_0x4e1e33){if(_0x4e1e33){_0x2dcd99=_0x4e1e33;_0x2679c4['model']=_[_0x62bf('0x46')](db[_0x62bf('0x4c')][_0x62bf('0x2c')]);_0x2679c4['query']=_[_0x62bf('0x46')](_0x5e1add[_0x62bf('0x31')]);_0x2679c4['filters']=_['intersection'](_0x2679c4['model'],_0x2679c4[_0x62bf('0x31')]);_0x300067[_0x62bf('0x35')]=_['intersection'](_0x2679c4[_0x62bf('0x30')],qs[_0x62bf('0x34')](_0x5e1add[_0x62bf('0x31')]['fields']));_0x300067[_0x62bf('0x35')]=_0x300067['attributes']['length']?_0x300067[_0x62bf('0x35')]:_0x2679c4[_0x62bf('0x30')];_0x300067['order']=qs['sort'](_0x5e1add[_0x62bf('0x31')][_0x62bf('0x38')]);_0x300067[_0x62bf('0x39')]=qs[_0x62bf('0x32')](_[_0x62bf('0x3a')](_0x5e1add[_0x62bf('0x31')],_0x2679c4[_0x62bf('0x32')]));if(_0x5e1add[_0x62bf('0x31')][_0x62bf('0x3b')]){_0x300067[_0x62bf('0x39')]=_[_0x62bf('0x3c')](_0x300067[_0x62bf('0x39')],{'$or':_['map'](_0x300067[_0x62bf('0x35')],function(_0x2bf91b){var _0x3f84ea={};_0x3f84ea[_0x2bf91b]={'$like':'%'+_0x5e1add[_0x62bf('0x31')][_0x62bf('0x3b')]+'%'};return _0x3f84ea;})});}_0x300067=_['merge']({},_0x300067,_0x5e1add[_0x62bf('0x3d')]);return _0x2dcd99[_0x62bf('0x50')](_0x300067);}})['then'](function(_0x36745b){if(_0x36745b){_0x182566=_0x36745b[_0x62bf('0x47')];if(!_0x5e1add['query']['hasOwnProperty']('nolimit')){_0x300067[_0x62bf('0x1e')]=qs[_0x62bf('0x1e')](_0x5e1add[_0x62bf('0x31')][_0x62bf('0x1e')]);_0x300067[_0x62bf('0x1c')]=qs[_0x62bf('0x1c')](_0x5e1add[_0x62bf('0x31')][_0x62bf('0x1c')]);}return _0x2dcd99[_0x62bf('0x50')](_0x300067);}})[_0x62bf('0x3e')](function(_0x2931e4){if(_0x2931e4){return _0x2931e4?{'count':_0x182566,'rows':_0x2931e4}:null;}})[_0x62bf('0x3e')](respondWithResult(_0x1d9f49,null))[_0x62bf('0x43')](handleError(_0x1d9f49,null));};exports[_0x62bf('0x51')]=function(_0x4ba6ec,_0x4a800d,_0x1cb261){return db['Action'][_0x62bf('0x48')]({'where':{'id':_0x4ba6ec[_0x62bf('0x45')]['id']}})[_0x62bf('0x3e')](handleEntityNotFound(_0x4a800d,null))[_0x62bf('0x3e')](function(_0x4ef3c5){if(_0x4ef3c5){return _0x4ef3c5[_0x62bf('0x51')](_0x4ba6ec[_0x62bf('0x4a')][_0x62bf('0x4e')],_[_0x62bf('0x4d')](_0x4ba6ec[_0x62bf('0x4a')],[_0x62bf('0x4e'),'id'])||{});}})[_0x62bf('0x3e')](respondWithResult(_0x4a800d,null))[_0x62bf('0x43')](handleError(_0x4a800d,null));};exports['getActions']=function(_0x1b88b8,_0x48c24a,_0x17a395){var _0xd78c58={};var _0x302894={};var _0x25f8e0;var _0x4d5835;return db[_0x62bf('0x2b')][_0x62bf('0x4f')]({'where':{'id':_0x1b88b8[_0x62bf('0x45')]['id']}})[_0x62bf('0x3e')](handleEntityNotFound(_0x48c24a,null))['then'](function(_0x3fc299){if(_0x3fc299){_0x25f8e0=_0x3fc299;_0x302894[_0x62bf('0x30')]=_[_0x62bf('0x46')](db[_0x62bf('0x52')][_0x62bf('0x2c')]);_0x302894[_0x62bf('0x31')]=_[_0x62bf('0x46')](_0x1b88b8[_0x62bf('0x31')]);_0x302894[_0x62bf('0x32')]=_[_0x62bf('0x33')](_0x302894[_0x62bf('0x30')],_0x302894['query']);_0xd78c58[_0x62bf('0x35')]=_['intersection'](_0x302894['model'],qs[_0x62bf('0x34')](_0x1b88b8[_0x62bf('0x31')][_0x62bf('0x34')]));_0xd78c58[_0x62bf('0x35')]=_0xd78c58[_0x62bf('0x35')][_0x62bf('0x47')]?_0xd78c58[_0x62bf('0x35')]:_0x302894[_0x62bf('0x30')];_0xd78c58[_0x62bf('0x53')]=qs[_0x62bf('0x38')](_0x1b88b8['query'][_0x62bf('0x38')]);_0xd78c58['where']=qs[_0x62bf('0x32')](_[_0x62bf('0x3a')](_0x1b88b8[_0x62bf('0x31')],_0x302894[_0x62bf('0x32')]));if(_0x1b88b8[_0x62bf('0x31')][_0x62bf('0x3b')]){_0xd78c58[_0x62bf('0x39')]=_[_0x62bf('0x3c')](_0xd78c58[_0x62bf('0x39')],{'$or':_['map'](_0xd78c58['attributes'],function(_0x410893){var _0x3a0734={};_0x3a0734[_0x410893]={'$like':'%'+_0x1b88b8[_0x62bf('0x31')][_0x62bf('0x3b')]+'%'};return _0x3a0734;})});}_0xd78c58=_[_0x62bf('0x3c')]({},_0xd78c58,_0x1b88b8[_0x62bf('0x3d')]);return _0x25f8e0[_0x62bf('0x54')](_0xd78c58);}})['then'](function(_0x2eee6a){if(_0x2eee6a){_0x4d5835=_0x2eee6a[_0x62bf('0x47')];if(!_0x1b88b8[_0x62bf('0x31')][_0x62bf('0x36')](_0x62bf('0x37'))){_0xd78c58[_0x62bf('0x1e')]=qs['limit'](_0x1b88b8[_0x62bf('0x31')][_0x62bf('0x1e')]);_0xd78c58[_0x62bf('0x1c')]=qs[_0x62bf('0x1c')](_0x1b88b8[_0x62bf('0x31')][_0x62bf('0x1c')]);}return _0x25f8e0['getActions'](_0xd78c58);}})[_0x62bf('0x3e')](function(_0x3f2db8){if(_0x3f2db8){return _0x3f2db8?{'count':_0x4d5835,'rows':_0x3f2db8}:null;}})[_0x62bf('0x3e')](respondWithResult(_0x48c24a,null))['catch'](handleError(_0x48c24a,null));}; \ No newline at end of file +var _0x5216=['lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','update','then','destroy','error','name','send','index','map','Automation','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','rows','catch','params','rawAttributes','merge','options','create','body','find','Condition','addConditions','omit','ids','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv'];(function(_0x50bd4d,_0x4177a4){var _0x497e46=function(_0x23be8e){while(--_0x23be8e){_0x50bd4d['push'](_0x50bd4d['shift']());}};_0x497e46(++_0x4177a4);}(_0x5216,0x1c7));var _0x6521=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5216[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x6521('0x0'));var rimraf=require(_0x6521('0x1'));var zipdir=require(_0x6521('0x2'));var jsonpatch=require(_0x6521('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6521('0x4'));var Mustache=require(_0x6521('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6521('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6521('0x7'));var squel=require('squel');var crypto=require(_0x6521('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x6521('0x9'));var toCsv=require(_0x6521('0x6'));var querystring=require(_0x6521('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6521('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x6521('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6521('0xd'))(_0x6521('0xe'));var utils=require(_0x6521('0xf'));var config=require(_0x6521('0x10'));var licenseUtil=require(_0x6521('0x11'));var db=require(_0x6521('0x12'))['db'];function respondWithStatusCode(_0x180a5c,_0x2ca936){_0x2ca936=_0x2ca936||0xcc;return function(_0x5f19ae){if(_0x5f19ae){return _0x180a5c['sendStatus'](_0x2ca936);}return _0x180a5c['status'](_0x2ca936)[_0x6521('0x13')]();};}function respondWithResult(_0x3300d6,_0x1bc8ea){_0x1bc8ea=_0x1bc8ea||0xc8;return function(_0x204884){if(_0x204884){return _0x3300d6[_0x6521('0x14')](_0x1bc8ea)['json'](_0x204884);}};}function respondWithFilteredResult(_0x477ea3,_0x4d93c0){return function(_0x32dab0){if(_0x32dab0){var _0x509f20=typeof _0x4d93c0[_0x6521('0x15')]==='undefined'&&typeof _0x4d93c0[_0x6521('0x16')]===_0x6521('0x17');var _0x197307=_0x32dab0['count'];var _0x295d25=_0x509f20?0x0:_0x4d93c0[_0x6521('0x15')];var _0x3457b1=_0x509f20?_0x32dab0[_0x6521('0x18')]:_0x4d93c0[_0x6521('0x15')]+_0x4d93c0['limit'];var _0x366a8a;if(_0x3457b1>=_0x197307){_0x3457b1=_0x197307;_0x366a8a=0xc8;}else{_0x366a8a=0xce;}_0x477ea3[_0x6521('0x14')](_0x366a8a);return _0x477ea3[_0x6521('0x19')](_0x6521('0x1a'),_0x295d25+'-'+_0x3457b1+'/'+_0x197307)[_0x6521('0x1b')](_0x32dab0);}return null;};}function patchUpdates(_0x5eb42b){return function(_0x289671){try{jsonpatch[_0x6521('0x1c')](_0x289671,_0x5eb42b,!![]);}catch(_0x2bfb21){return BPromise['reject'](_0x2bfb21);}return _0x289671['save']();};}function saveUpdates(_0x4a0c76,_0x3a7ed0){return function(_0x526c44){if(_0x526c44){return _0x526c44[_0x6521('0x1d')](_0x4a0c76)[_0x6521('0x1e')](function(_0x490869){return _0x490869;});}return null;};}function removeEntity(_0xe079cd,_0x5a66aa){return function(_0x4a1411){if(_0x4a1411){return _0x4a1411[_0x6521('0x1f')]()[_0x6521('0x1e')](function(){_0xe079cd[_0x6521('0x14')](0xcc)[_0x6521('0x13')]();});}};}function handleEntityNotFound(_0x356e31,_0x458ee9){return function(_0xd4fef5){if(!_0xd4fef5){_0x356e31['sendStatus'](0x194);}return _0xd4fef5;};}function handleError(_0x1bbe9c,_0x2da9eb){_0x2da9eb=_0x2da9eb||0x1f4;return function(_0x21c472){logger[_0x6521('0x20')](_0x21c472['stack']);if(_0x21c472[_0x6521('0x21')]){delete _0x21c472[_0x6521('0x21')];}_0x1bbe9c['status'](_0x2da9eb)[_0x6521('0x22')](_0x21c472);};}exports[_0x6521('0x23')]=function(_0x86164c,_0x296c42){var _0x571716={},_0x878a66={},_0x5f38d0={'count':0x0,'rows':[]};var _0x433176=_[_0x6521('0x24')](db[_0x6521('0x25')]['rawAttributes'],function(_0x46a549){return{'name':_0x46a549[_0x6521('0x26')],'type':_0x46a549[_0x6521('0x27')][_0x6521('0x28')]};});_0x878a66[_0x6521('0x29')]=_[_0x6521('0x24')](_0x433176,_0x6521('0x21'));_0x878a66[_0x6521('0x2a')]=_[_0x6521('0x2b')](_0x86164c[_0x6521('0x2a')]);_0x878a66[_0x6521('0x2c')]=_['intersection'](_0x878a66['model'],_0x878a66[_0x6521('0x2a')]);_0x571716[_0x6521('0x2d')]=_[_0x6521('0x2e')](_0x878a66['model'],qs[_0x6521('0x2f')](_0x86164c[_0x6521('0x2a')]['fields']));_0x571716[_0x6521('0x2d')]=_0x571716[_0x6521('0x2d')][_0x6521('0x30')]?_0x571716[_0x6521('0x2d')]:_0x878a66['model'];if(!_0x86164c[_0x6521('0x2a')]['hasOwnProperty'](_0x6521('0x31'))){_0x571716[_0x6521('0x16')]=qs[_0x6521('0x16')](_0x86164c[_0x6521('0x2a')]['limit']);_0x571716[_0x6521('0x15')]=qs['offset'](_0x86164c[_0x6521('0x2a')][_0x6521('0x15')]);}_0x571716[_0x6521('0x32')]=qs['sort'](_0x86164c['query'][_0x6521('0x33')]);_0x571716[_0x6521('0x34')]=qs['filters'](_[_0x6521('0x35')](_0x86164c[_0x6521('0x2a')],_0x878a66[_0x6521('0x2c')]),_0x433176);if(_0x86164c['query'][_0x6521('0x36')]){_0x571716[_0x6521('0x34')]=_['merge'](_0x571716[_0x6521('0x34')],{'$or':_[_0x6521('0x24')](_0x433176,function(_0x506b76){if(_0x506b76[_0x6521('0x27')]!=='VIRTUAL'){var _0x546cf8={};_0x546cf8[_0x506b76['name']]={'$like':'%'+_0x86164c['query'][_0x6521('0x36')]+'%'};return _0x546cf8;}})});}_0x571716=_['merge']({},_0x571716,_0x86164c['options']);var _0x1a602c={'where':_0x571716[_0x6521('0x34')]};return db['Automation'][_0x6521('0x18')](_0x1a602c)[_0x6521('0x1e')](function(_0x1fa7a4){_0x5f38d0[_0x6521('0x18')]=_0x1fa7a4;if(_0x86164c[_0x6521('0x2a')][_0x6521('0x37')]){_0x571716[_0x6521('0x38')]=[{'all':!![]}];}return db[_0x6521('0x25')][_0x6521('0x39')](_0x571716);})['then'](function(_0xd532b5){_0x5f38d0[_0x6521('0x3a')]=_0xd532b5;return _0x5f38d0;})['then'](respondWithFilteredResult(_0x296c42,_0x571716))[_0x6521('0x3b')](handleError(_0x296c42,null));};exports['show']=function(_0x381a07,_0x41a2f1){var _0x2c6486={'raw':![],'where':{'id':_0x381a07[_0x6521('0x3c')]['id']}},_0x475b58={};_0x475b58['model']=_[_0x6521('0x2b')](db['Automation'][_0x6521('0x3d')]);_0x475b58[_0x6521('0x2a')]=_[_0x6521('0x2b')](_0x381a07[_0x6521('0x2a')]);_0x475b58[_0x6521('0x2c')]=_['intersection'](_0x475b58[_0x6521('0x29')],_0x475b58[_0x6521('0x2a')]);_0x2c6486['attributes']=_['intersection'](_0x475b58[_0x6521('0x29')],qs[_0x6521('0x2f')](_0x381a07[_0x6521('0x2a')][_0x6521('0x2f')]));_0x2c6486[_0x6521('0x2d')]=_0x2c6486[_0x6521('0x2d')][_0x6521('0x30')]?_0x2c6486[_0x6521('0x2d')]:_0x475b58['model'];if(_0x381a07[_0x6521('0x2a')][_0x6521('0x37')]){_0x2c6486[_0x6521('0x38')]=[{'all':!![]}];}_0x2c6486=_[_0x6521('0x3e')]({},_0x2c6486,_0x381a07[_0x6521('0x3f')]);return db['Automation']['find'](_0x2c6486)[_0x6521('0x1e')](handleEntityNotFound(_0x41a2f1,null))[_0x6521('0x1e')](respondWithResult(_0x41a2f1,null))['catch'](handleError(_0x41a2f1,null));};exports['create']=function(_0x32da28,_0x34f367){return db[_0x6521('0x25')][_0x6521('0x40')](_0x32da28['body'],{})['then'](respondWithResult(_0x34f367,0xc9))[_0x6521('0x3b')](handleError(_0x34f367,null));};exports[_0x6521('0x1d')]=function(_0x3f650f,_0x333ff9){if(_0x3f650f['body']['id']){delete _0x3f650f[_0x6521('0x41')]['id'];}return db[_0x6521('0x25')]['find']({'where':{'id':_0x3f650f[_0x6521('0x3c')]['id']}})[_0x6521('0x1e')](handleEntityNotFound(_0x333ff9,null))[_0x6521('0x1e')](saveUpdates(_0x3f650f[_0x6521('0x41')],null))[_0x6521('0x1e')](respondWithResult(_0x333ff9,null))[_0x6521('0x3b')](handleError(_0x333ff9,null));};exports['destroy']=function(_0x1ab4c5,_0x50410a){return db[_0x6521('0x25')][_0x6521('0x42')]({'where':{'id':_0x1ab4c5['params']['id']}})['then'](handleEntityNotFound(_0x50410a,null))['then'](removeEntity(_0x50410a,null))[_0x6521('0x3b')](handleError(_0x50410a,null));};exports['addConditions']=function(_0x21c9ad,_0x139eac,_0x3bb84a){return db[_0x6521('0x43')][_0x6521('0x42')]({'where':{'id':_0x21c9ad['params']['id']}})['then'](handleEntityNotFound(_0x139eac,null))[_0x6521('0x1e')](function(_0x34d189){if(_0x34d189){return _0x34d189[_0x6521('0x44')](_0x21c9ad[_0x6521('0x41')]['ids'],_[_0x6521('0x45')](_0x21c9ad['body'],[_0x6521('0x46'),'id'])||{});}})[_0x6521('0x1e')](respondWithResult(_0x139eac,null))['catch'](handleError(_0x139eac,null));};exports[_0x6521('0x47')]=function(_0xd6e659,_0x31a500,_0x5c83fc){var _0x7dee67={};var _0x27b325={};var _0x165e1c;var _0x46c403;return db[_0x6521('0x25')][_0x6521('0x48')]({'where':{'id':_0xd6e659[_0x6521('0x3c')]['id']}})['then'](handleEntityNotFound(_0x31a500,null))[_0x6521('0x1e')](function(_0xc416af){if(_0xc416af){_0x165e1c=_0xc416af;_0x27b325[_0x6521('0x29')]=_['keys'](db[_0x6521('0x43')][_0x6521('0x3d')]);_0x27b325['query']=_[_0x6521('0x2b')](_0xd6e659[_0x6521('0x2a')]);_0x27b325[_0x6521('0x2c')]=_[_0x6521('0x2e')](_0x27b325['model'],_0x27b325[_0x6521('0x2a')]);_0x7dee67['attributes']=_[_0x6521('0x2e')](_0x27b325[_0x6521('0x29')],qs[_0x6521('0x2f')](_0xd6e659[_0x6521('0x2a')]['fields']));_0x7dee67[_0x6521('0x2d')]=_0x7dee67[_0x6521('0x2d')][_0x6521('0x30')]?_0x7dee67['attributes']:_0x27b325[_0x6521('0x29')];_0x7dee67['order']=qs['sort'](_0xd6e659[_0x6521('0x2a')][_0x6521('0x33')]);_0x7dee67[_0x6521('0x34')]=qs[_0x6521('0x2c')](_[_0x6521('0x35')](_0xd6e659['query'],_0x27b325[_0x6521('0x2c')]));if(_0xd6e659['query']['filter']){_0x7dee67[_0x6521('0x34')]=_[_0x6521('0x3e')](_0x7dee67[_0x6521('0x34')],{'$or':_['map'](_0x7dee67[_0x6521('0x2d')],function(_0x5f22ed){var _0x395002={};_0x395002[_0x5f22ed]={'$like':'%'+_0xd6e659[_0x6521('0x2a')][_0x6521('0x36')]+'%'};return _0x395002;})});}_0x7dee67=_[_0x6521('0x3e')]({},_0x7dee67,_0xd6e659[_0x6521('0x3f')]);return _0x165e1c[_0x6521('0x47')](_0x7dee67);}})[_0x6521('0x1e')](function(_0x4f03de){if(_0x4f03de){_0x46c403=_0x4f03de[_0x6521('0x30')];if(!_0xd6e659[_0x6521('0x2a')][_0x6521('0x49')]('nolimit')){_0x7dee67[_0x6521('0x16')]=qs[_0x6521('0x16')](_0xd6e659[_0x6521('0x2a')][_0x6521('0x16')]);_0x7dee67['offset']=qs[_0x6521('0x15')](_0xd6e659[_0x6521('0x2a')][_0x6521('0x15')]);}return _0x165e1c[_0x6521('0x47')](_0x7dee67);}})[_0x6521('0x1e')](function(_0x2a7470){if(_0x2a7470){return _0x2a7470?{'count':_0x46c403,'rows':_0x2a7470}:null;}})[_0x6521('0x1e')](respondWithResult(_0x31a500,null))[_0x6521('0x3b')](handleError(_0x31a500,null));};exports[_0x6521('0x4a')]=function(_0x3d16e8,_0x12294b,_0x3e6f3e){return db[_0x6521('0x4b')]['find']({'where':{'id':_0x3d16e8['params']['id']}})[_0x6521('0x1e')](handleEntityNotFound(_0x12294b,null))[_0x6521('0x1e')](function(_0x37956a){if(_0x37956a){return _0x37956a[_0x6521('0x4a')](_0x3d16e8['body'][_0x6521('0x46')],_['omit'](_0x3d16e8[_0x6521('0x41')],['ids','id'])||{});}})[_0x6521('0x1e')](respondWithResult(_0x12294b,null))[_0x6521('0x3b')](handleError(_0x12294b,null));};exports[_0x6521('0x4c')]=function(_0x1e3aa3,_0x291779,_0x7919){var _0x131ba7={};var _0x4ac82f={};var _0x184ff8;var _0x5529f7;return db[_0x6521('0x25')]['findOne']({'where':{'id':_0x1e3aa3[_0x6521('0x3c')]['id']}})['then'](handleEntityNotFound(_0x291779,null))[_0x6521('0x1e')](function(_0x56e727){if(_0x56e727){_0x184ff8=_0x56e727;_0x4ac82f['model']=_[_0x6521('0x2b')](db[_0x6521('0x4b')][_0x6521('0x3d')]);_0x4ac82f['query']=_[_0x6521('0x2b')](_0x1e3aa3['query']);_0x4ac82f[_0x6521('0x2c')]=_[_0x6521('0x2e')](_0x4ac82f[_0x6521('0x29')],_0x4ac82f[_0x6521('0x2a')]);_0x131ba7[_0x6521('0x2d')]=_[_0x6521('0x2e')](_0x4ac82f[_0x6521('0x29')],qs[_0x6521('0x2f')](_0x1e3aa3[_0x6521('0x2a')][_0x6521('0x2f')]));_0x131ba7[_0x6521('0x2d')]=_0x131ba7[_0x6521('0x2d')][_0x6521('0x30')]?_0x131ba7[_0x6521('0x2d')]:_0x4ac82f[_0x6521('0x29')];_0x131ba7[_0x6521('0x32')]=qs['sort'](_0x1e3aa3[_0x6521('0x2a')]['sort']);_0x131ba7[_0x6521('0x34')]=qs[_0x6521('0x2c')](_['pick'](_0x1e3aa3[_0x6521('0x2a')],_0x4ac82f[_0x6521('0x2c')]));if(_0x1e3aa3[_0x6521('0x2a')][_0x6521('0x36')]){_0x131ba7[_0x6521('0x34')]=_[_0x6521('0x3e')](_0x131ba7['where'],{'$or':_['map'](_0x131ba7[_0x6521('0x2d')],function(_0x5ee9cd){var _0x203dfc={};_0x203dfc[_0x5ee9cd]={'$like':'%'+_0x1e3aa3['query'][_0x6521('0x36')]+'%'};return _0x203dfc;})});}_0x131ba7=_[_0x6521('0x3e')]({},_0x131ba7,_0x1e3aa3[_0x6521('0x3f')]);return _0x184ff8[_0x6521('0x4c')](_0x131ba7);}})['then'](function(_0x44daf3){if(_0x44daf3){_0x5529f7=_0x44daf3['length'];if(!_0x1e3aa3['query']['hasOwnProperty']('nolimit')){_0x131ba7[_0x6521('0x16')]=qs['limit'](_0x1e3aa3['query'][_0x6521('0x16')]);_0x131ba7['offset']=qs[_0x6521('0x15')](_0x1e3aa3['query'][_0x6521('0x15')]);}return _0x184ff8[_0x6521('0x4c')](_0x131ba7);}})[_0x6521('0x1e')](function(_0x23cffb){if(_0x23cffb){return _0x23cffb?{'count':_0x5529f7,'rows':_0x23cffb}:null;}})['then'](respondWithResult(_0x291779,null))[_0x6521('0x3b')](handleError(_0x291779,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 00894ec..f915382 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 _0x942c=['path','rimraf','../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','../../config/logger','moment','request-promise'];(function(_0x565d65,_0x436914){var _0x3797e1=function(_0x113817){while(--_0x113817){_0x565d65['push'](_0x565d65['shift']());}};_0x3797e1(++_0x436914);}(_0x942c,0x10f));var _0xc942=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x942c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc942('0x0'));var util=require('util');var logger=require(_0xc942('0x1'))('api');var moment=require(_0xc942('0x2'));var BPromise=require('bluebird');var rp=require(_0xc942('0x3'));var fs=require('fs');var path=require(_0xc942('0x4'));var rimraf=require(_0xc942('0x5'));var config=require(_0xc942('0x6'));var attributes=require(_0xc942('0x7'));module[_0xc942('0x8')]=function(_0x2ba0b9,_0x366a15){return _0x2ba0b9[_0xc942('0x9')]('Automation',attributes,{'tableName':_0xc942('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9ff=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation'];(function(_0x52d0bd,_0x8663cc){var _0x43e4d5=function(_0x2f7046){while(--_0x2f7046){_0x52d0bd['push'](_0x52d0bd['shift']());}};_0x43e4d5(++_0x8663cc);}(_0xe9ff,0x1c7));var _0xfe9f=function(_0x35eb7b,_0x35f97b){_0x35eb7b=_0x35eb7b-0x0;var _0x5ae9ff=_0xe9ff[_0x35eb7b];return _0x5ae9ff;};'use strict';var _=require(_0xfe9f('0x0'));var util=require(_0xfe9f('0x1'));var logger=require(_0xfe9f('0x2'))(_0xfe9f('0x3'));var moment=require(_0xfe9f('0x4'));var BPromise=require(_0xfe9f('0x5'));var rp=require(_0xfe9f('0x6'));var fs=require('fs');var path=require(_0xfe9f('0x7'));var rimraf=require(_0xfe9f('0x8'));var config=require(_0xfe9f('0x9'));var attributes=require(_0xfe9f('0xa'));module['exports']=function(_0x184907,_0xac1757){return _0x184907[_0xfe9f('0xb')](_0xfe9f('0xc'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index d70e1c3..ca83d5a 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 _0x3f72=['request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s'];(function(_0x381606,_0x53382c){var _0x31c4ca=function(_0x310493){while(--_0x310493){_0x381606['push'](_0x381606['shift']());}};_0x31c4ca(++_0x53382c);}(_0x3f72,0xaf));var _0x23f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f72[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x23f7('0x0'));var util=require(_0x23f7('0x1'));var moment=require(_0x23f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x23f7('0x3'));var db=require(_0x23f7('0x4'))['db'];var utils=require(_0x23f7('0x5'));var logger=require(_0x23f7('0x6'))(_0x23f7('0x7'));var config=require('../../config/environment');var jayson=require(_0x23f7('0x8'));var client=jayson['client'][_0x23f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cc54a,_0x23e468,_0x2db48b){return new BPromise(function(_0x412d29,_0x258026){return client[_0x23f7('0xa')](_0x5cc54a,_0x2db48b)[_0x23f7('0xb')](function(_0x3a048c){logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));logger['debug'](_0x23f7('0xf'),_0x23e468,_0x23f7('0xe'),JSON[_0x23f7('0x10')](_0x3a048c));if(_0x3a048c['error']){if(_0x3a048c['error'][_0x23f7('0x11')]===0x1f4){logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);return _0x258026(_0x3a048c['error'][_0x23f7('0x13')]);}logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')]['message']);return _0x412d29(_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);}else{logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));_0x412d29(_0x3a048c[_0x23f7('0x14')][_0x23f7('0x13')]);}})['catch'](function(_0x2669ab){logger[_0x23f7('0x12')]('Automation,\x20%s,\x20%s',_0x23e468,_0x2669ab);_0x258026(_0x2669ab);});});} \ No newline at end of file +var _0x4639=['client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x22e295,_0xb0c78d){var _0x9575d1=function(_0x458914){while(--_0x458914){_0x22e295['push'](_0x22e295['shift']());}};_0x9575d1(++_0xb0c78d);}(_0x4639,0x115));var _0x9463=function(_0x498d4f,_0x6e928e){_0x498d4f=_0x498d4f-0x0;var _0x1c81a8=_0x4639[_0x498d4f];return _0x1c81a8;};'use strict';var _=require(_0x9463('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9463('0x1'));var rs=require(_0x9463('0x2'));var fs=require('fs');var Redis=require(_0x9463('0x3'));var db=require(_0x9463('0x4'))['db'];var utils=require(_0x9463('0x5'));var logger=require(_0x9463('0x6'))(_0x9463('0x7'));var config=require('../../config/environment');var jayson=require(_0x9463('0x8'));var client=jayson[_0x9463('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494a02,_0x3b5e95,_0x500f5d){return new BPromise(function(_0x58d09c,_0x465758){return client[_0x9463('0xa')](_0x494a02,_0x500f5d)[_0x9463('0xb')](function(_0x49e617){logger[_0x9463('0xc')](_0x9463('0xd'),_0x3b5e95,_0x9463('0xe'));logger[_0x9463('0xf')](_0x9463('0x10'),_0x3b5e95,_0x9463('0xe'),JSON[_0x9463('0x11')](_0x49e617));if(_0x49e617[_0x9463('0x12')]){if(_0x49e617[_0x9463('0x12')][_0x9463('0x13')]===0x1f4){logger[_0x9463('0x12')](_0x9463('0xd'),_0x3b5e95,_0x49e617[_0x9463('0x12')][_0x9463('0x14')]);return _0x465758(_0x49e617[_0x9463('0x12')][_0x9463('0x14')]);}logger[_0x9463('0x12')](_0x9463('0xd'),_0x3b5e95,_0x49e617[_0x9463('0x12')]['message']);return _0x58d09c(_0x49e617[_0x9463('0x12')]['message']);}else{logger[_0x9463('0xc')](_0x9463('0xd'),_0x3b5e95,_0x9463('0xe'));_0x58d09c(_0x49e617[_0x9463('0x15')][_0x9463('0x14')]);}})['catch'](function(_0x3d5a81){logger[_0x9463('0x12')](_0x9463('0xd'),_0x3b5e95,_0x3d5a81);_0x465758(_0x3d5a81);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index d56bf2e..0697a3f 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 _0xb0b4=['create','addConditions','addActions','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','post'];(function(_0x80bc0f,_0x2f084a){var _0x29685c=function(_0x377326){while(--_0x377326){_0x80bc0f['push'](_0x80bc0f['shift']());}};_0x29685c(++_0x2f084a);}(_0xb0b4,0xb6));var _0x4b0b=function(_0x2eabb7,_0x57cb12){_0x2eabb7=_0x2eabb7-0x0;var _0x27186f=_0xb0b4[_0x2eabb7];return _0x27186f;};'use strict';var multer=require(_0x4b0b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4b0b('0x1'));var express=require(_0x4b0b('0x2'));var router=express['Router']();var fs_extra=require(_0x4b0b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4b0b('0x4'));var config=require(_0x4b0b('0x5'));var controller=require(_0x4b0b('0x6'));router[_0x4b0b('0x7')]('/',auth[_0x4b0b('0x8')](),controller[_0x4b0b('0x9')]);router[_0x4b0b('0x7')](_0x4b0b('0xa'),auth[_0x4b0b('0x8')](),controller[_0x4b0b('0xb')]);router[_0x4b0b('0x7')](_0x4b0b('0xc'),auth[_0x4b0b('0x8')](),controller[_0x4b0b('0xd')]);router[_0x4b0b('0x7')](_0x4b0b('0xe'),auth[_0x4b0b('0x8')](),controller['getActions']);router[_0x4b0b('0xf')]('/',auth['isAuthenticated'](),controller[_0x4b0b('0x10')]);router[_0x4b0b('0xf')]('/:id/conditions',auth[_0x4b0b('0x8')](),controller[_0x4b0b('0x11')]);router[_0x4b0b('0xf')](_0x4b0b('0xe'),auth[_0x4b0b('0x8')](),controller[_0x4b0b('0x12')]);router['put'](_0x4b0b('0xa'),auth[_0x4b0b('0x8')](),controller[_0x4b0b('0x13')]);router[_0x4b0b('0x14')](_0x4b0b('0xa'),auth[_0x4b0b('0x8')](),controller['destroy']);module[_0x4b0b('0x15')]=router; \ No newline at end of file +var _0x9009=['addActions','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','/:id','show','/:id/conditions','isAuthenticated','/:id/actions','getActions','post'];(function(_0x8f33c2,_0x475dd9){var _0x2a63b1=function(_0x1a9848){while(--_0x1a9848){_0x8f33c2['push'](_0x8f33c2['shift']());}};_0x2a63b1(++_0x475dd9);}(_0x9009,0x1d4));var _0x9900=function(_0x33b889,_0x29e0d6){_0x33b889=_0x33b889-0x0;var _0x54ccbe=_0x9009[_0x33b889];return _0x54ccbe;};'use strict';var multer=require(_0x9900('0x0'));var util=require('util');var path=require(_0x9900('0x1'));var timeout=require(_0x9900('0x2'));var express=require('express');var router=express[_0x9900('0x3')]();var fs_extra=require(_0x9900('0x4'));var auth=require(_0x9900('0x5'));var interaction=require(_0x9900('0x6'));var config=require('../../config/environment');var controller=require(_0x9900('0x7'));router[_0x9900('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9900('0x8')](_0x9900('0x9'),auth['isAuthenticated'](),controller[_0x9900('0xa')]);router[_0x9900('0x8')](_0x9900('0xb'),auth[_0x9900('0xc')](),controller['getConditions']);router[_0x9900('0x8')](_0x9900('0xd'),auth[_0x9900('0xc')](),controller[_0x9900('0xe')]);router[_0x9900('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9900('0xf')](_0x9900('0xb'),auth['isAuthenticated'](),controller['addConditions']);router[_0x9900('0xf')]('/:id/actions',auth[_0x9900('0xc')](),controller[_0x9900('0x10')]);router[_0x9900('0x11')](_0x9900('0x9'),auth[_0x9900('0xc')](),controller[_0x9900('0x12')]);router[_0x9900('0x13')](_0x9900('0x9'),auth[_0x9900('0xc')](),controller[_0x9900('0x14')]);module[_0x9900('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 6f82fcd..069a743 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 _0xd027=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x144a2e,_0x341bfc){var _0x590814=function(_0x55f82e){while(--_0x55f82e){_0x144a2e['push'](_0x144a2e['shift']());}};_0x590814(++_0x341bfc);}(_0xd027,0x197));var _0x7d02=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd027[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x7d02('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7d02('0x1')](_0x7d02('0x2')),'allowNull':![],'defaultValue':_0x7d02('0x2')},'description':{'type':Sequelize[_0x7d02('0x3')]},'active':{'type':Sequelize[_0x7d02('0x4')],'defaultValue':0x0,'comment':_0x7d02('0x5')},'limitCalls':{'type':Sequelize[_0x7d02('0x6')](0x4)[_0x7d02('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x7d02('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7d02('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0x7d02('0x6')](0x3)[_0x7d02('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d02('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7d02('0x6')](0x3)[_0x7d02('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d02('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)[_0x7d02('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7d02('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x7d02('0x6')](0x3)[_0x7d02('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)[_0x7d02('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7d02('0x6')](0x3)[_0x7d02('0x7')],'defaultValue':0x3,'comment':_0x7d02('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7d02('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7d02('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7d02('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7d02('0x3')],'defaultValue':_0x7d02('0xe')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x7d02('0xf'),_0x7d02('0x10'),_0x7d02('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x7d02('0x4')],'defaultValue':0x0,'comment':_0x7d02('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7d02('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7d02('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7d02('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7d02('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7d02('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7d02('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7d02('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7d02('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7d02('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7d02('0x1')](_0x7d02('0x1b'),_0x7d02('0x1c')),'defaultValue':_0x7d02('0x1b')},'dialPrefix':{'type':Sequelize[_0x7d02('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7d02('0x6')](0x3)[_0x7d02('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x7d02('0x6')](0x3)[_0x7d02('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7d02('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d02('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)[_0x7d02('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7d02('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x7d02('0x6')](0x3)[_0x7d02('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d02('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7d02('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d02('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)[_0x7d02('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x7d02('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)[_0x7d02('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7d02('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7d02('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d02('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)[_0x7d02('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x4d5f=['Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x17c216,_0x1eed2a){var _0x2b2b39=function(_0x26a65a){while(--_0x26a65a){_0x17c216['push'](_0x17c216['shift']());}};_0x2b2b39(++_0x1eed2a);}(_0x4d5f,0x82));var _0xf4d5=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x4d5f[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0xf4d5('0x0'));module[_0xf4d5('0x1')]={'name':{'type':Sequelize[_0xf4d5('0x2')],'unique':_0xf4d5('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf4d5('0x4')](_0xf4d5('0x5')),'allowNull':![],'defaultValue':_0xf4d5('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xf4d5('0x6')],'defaultValue':0x0,'comment':_0xf4d5('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xf4d5('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf4d5('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf4d5('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf4d5('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xf4d5('0xa')](0x3)[_0xf4d5('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4d5('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf4d5('0xa')](0x3)[_0xf4d5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4d5('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf4d5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4d5('0xd')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf4d5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4d5('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf4d5('0xa')](0x5)[_0xf4d5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4d5('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf4d5('0xa')](0x3)[_0xf4d5('0x8')],'defaultValue':0x3,'comment':_0xf4d5('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf4d5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4d5('0x11')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf4d5('0xa')](0x3)[_0xf4d5('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf4d5('0x12')},'dialTimezone':{'type':Sequelize[_0xf4d5('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf4d5('0x2')],'defaultValue':_0xf4d5('0x13')},'dialCheckDuplicateType':{'type':Sequelize[_0xf4d5('0x4')](_0xf4d5('0x14'),_0xf4d5('0x15'),_0xf4d5('0x16')),'defaultValue':_0xf4d5('0x14')},'dialAMDActive':{'type':Sequelize[_0xf4d5('0x6')],'defaultValue':0x0,'comment':_0xf4d5('0x17')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf4d5('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xf4d5('0xa')](0x9)[_0xf4d5('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf4d5('0x18')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf4d5('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf4d5('0x19')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf4d5('0xa')](0x9)[_0xf4d5('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf4d5('0x1a')},'dialAMDMinWordLength':{'type':Sequelize[_0xf4d5('0xa')](0x9)[_0xf4d5('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf4d5('0x1b')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf4d5('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf4d5('0xa')](0x9)[_0xf4d5('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf4d5('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf4d5('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf4d5('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf4d5('0x1e')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf4d5('0x4')](_0xf4d5('0x1f'),_0xf4d5('0x20')),'defaultValue':_0xf4d5('0x1f')},'dialPrefix':{'type':Sequelize[_0xf4d5('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf4d5('0xa')](0x3)[_0xf4d5('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf4d5('0x21')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xf4d5('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf4d5('0x22')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf4d5('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4d5('0x23')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf4d5('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xf4d5('0xa')](0x3)[_0xf4d5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf4d5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4d5('0x24')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf4d5('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf4d5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4d5('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf4d5('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4d5('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf4d5('0xa')](0x3)[_0xf4d5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4d5('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf4d5('0xa')](0x5)[_0xf4d5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4d5('0x28')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 3e38e21..68cb9da 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 _0xd48a=['count','limit','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','error','name','send','index','map','Campaign','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','include','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','user','role','findOne','CmHopper','hasOwnProperty','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','ContactId','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined'];(function(_0x484060,_0xce9823){var _0x295784=function(_0x312b8a){while(--_0x312b8a){_0x484060['push'](_0x484060['shift']());}};_0x295784(++_0xce9823);}(_0xd48a,0x6b));var _0xad48=function(_0x5617f4,_0x2ef726){_0x5617f4=_0x5617f4-0x0;var _0x1fd7ab=_0xd48a[_0x5617f4];return _0x1fd7ab;};'use strict';var emlformat=require(_0xad48('0x0'));var rimraf=require(_0xad48('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad48('0x2'));var rp=require(_0xad48('0x3'));var moment=require(_0xad48('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xad48('0x5'));var util=require(_0xad48('0x6'));var path=require(_0xad48('0x7'));var sox=require(_0xad48('0x8'));var csv=require(_0xad48('0x9'));var ejs=require(_0xad48('0xa'));var fs=require('fs');var fs_extra=require(_0xad48('0xb'));var _=require(_0xad48('0xc'));var squel=require('squel');var crypto=require(_0xad48('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xad48('0xe'));var toCsv=require('to-csv');var querystring=require(_0xad48('0xf'));var Papa=require(_0xad48('0x10'));var Redis=require(_0xad48('0x11'));var authService=require(_0xad48('0x12'));var qs=require(_0xad48('0x13'));var as=require(_0xad48('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad48('0x15'))('api');var utils=require(_0xad48('0x16'));var config=require(_0xad48('0x17'));var licenseUtil=require(_0xad48('0x18'));var db=require(_0xad48('0x19'))['db'];function respondWithStatusCode(_0x1675b2,_0x6aae75){_0x6aae75=_0x6aae75||0xcc;return function(_0x2f26c0){if(_0x2f26c0){return _0x1675b2[_0xad48('0x1a')](_0x6aae75);}return _0x1675b2['status'](_0x6aae75)[_0xad48('0x1b')]();};}function respondWithResult(_0x4f0f8f,_0x6636db){_0x6636db=_0x6636db||0xc8;return function(_0x513c5e){if(_0x513c5e){return _0x4f0f8f[_0xad48('0x1c')](_0x6636db)[_0xad48('0x1d')](_0x513c5e);}};}function respondWithFilteredResult(_0x5da27d,_0x37e221){return function(_0x1474bb){if(_0x1474bb){var _0x45087d=typeof _0x37e221[_0xad48('0x1e')]===_0xad48('0x1f')&&typeof _0x37e221['limit']===_0xad48('0x1f');var _0x545eaa=_0x1474bb[_0xad48('0x20')];var _0x4fa318=_0x45087d?0x0:_0x37e221[_0xad48('0x1e')];var _0x22eb94=_0x45087d?_0x1474bb[_0xad48('0x20')]:_0x37e221[_0xad48('0x1e')]+_0x37e221[_0xad48('0x21')];var _0x3109fc;if(_0x22eb94>=_0x545eaa){_0x22eb94=_0x545eaa;_0x3109fc=0xc8;}else{_0x3109fc=0xce;}_0x5da27d['status'](_0x3109fc);return _0x5da27d[_0xad48('0x22')](_0xad48('0x23'),_0x4fa318+'-'+_0x22eb94+'/'+_0x545eaa)[_0xad48('0x1d')](_0x1474bb);}return null;};}function patchUpdates(_0x55e627){return function(_0x3cf2d9){try{jsonpatch['apply'](_0x3cf2d9,_0x55e627,!![]);}catch(_0x5e0e88){return BPromise[_0xad48('0x24')](_0x5e0e88);}return _0x3cf2d9[_0xad48('0x25')]();};}function saveUpdates(_0x4c122b,_0x364a23){return function(_0x18750e){if(_0x18750e){return _0x18750e[_0xad48('0x26')](_0x4c122b)[_0xad48('0x27')](function(_0x25b44c){return _0x25b44c;});}return null;};}function removeEntity(_0x3c800d,_0x5cefa3){return function(_0x573ede){if(_0x573ede){return _0x573ede[_0xad48('0x28')]()['then'](function(){var _0x4bfa73=_0x573ede[_0xad48('0x29')]({'plain':!![]});var _0x1fb0be=_0xad48('0x2a');return db['UserProfileResource'][_0xad48('0x28')]({'where':{'type':_0x1fb0be,'resourceId':_0x4bfa73['id']}})['then'](function(){return _0x573ede;});})[_0xad48('0x27')](function(){_0x3c800d[_0xad48('0x1c')](0xcc)[_0xad48('0x1b')]();});}};}function handleEntityNotFound(_0x19d45c,_0xe83e14){return function(_0x64577d){if(!_0x64577d){_0x19d45c[_0xad48('0x1a')](0x194);}return _0x64577d;};}function handleError(_0x29ef74,_0x56c654){_0x56c654=_0x56c654||0x1f4;return function(_0x36cb14){logger[_0xad48('0x2b')](_0x36cb14['stack']);if(_0x36cb14['name']){delete _0x36cb14[_0xad48('0x2c')];}_0x29ef74[_0xad48('0x1c')](_0x56c654)[_0xad48('0x2d')](_0x36cb14);};}exports[_0xad48('0x2e')]=function(_0x216d8e,_0x209bcc){var _0x434d9d={},_0x36b646={},_0x822b0a={'count':0x0,'rows':[]};var _0x3be64f=_[_0xad48('0x2f')](db[_0xad48('0x30')]['rawAttributes'],function(_0x189d39){return{'name':_0x189d39[_0xad48('0x31')],'type':_0x189d39[_0xad48('0x32')]['key']};});_0x36b646[_0xad48('0x33')]=_[_0xad48('0x2f')](_0x3be64f,_0xad48('0x2c'));_0x36b646[_0xad48('0x34')]=_[_0xad48('0x35')](_0x216d8e['query']);_0x36b646[_0xad48('0x36')]=_['intersection'](_0x36b646['model'],_0x36b646[_0xad48('0x34')]);_0x434d9d[_0xad48('0x37')]=_[_0xad48('0x38')](_0x36b646[_0xad48('0x33')],qs[_0xad48('0x39')](_0x216d8e[_0xad48('0x34')][_0xad48('0x39')]));_0x434d9d[_0xad48('0x37')]=_0x434d9d['attributes'][_0xad48('0x3a')]?_0x434d9d['attributes']:_0x36b646[_0xad48('0x33')];if(!_0x216d8e[_0xad48('0x34')]['hasOwnProperty'](_0xad48('0x3b'))){_0x434d9d[_0xad48('0x21')]=qs[_0xad48('0x21')](_0x216d8e[_0xad48('0x34')][_0xad48('0x21')]);_0x434d9d[_0xad48('0x1e')]=qs['offset'](_0x216d8e[_0xad48('0x34')][_0xad48('0x1e')]);}_0x434d9d[_0xad48('0x3c')]=qs[_0xad48('0x3d')](_0x216d8e[_0xad48('0x34')][_0xad48('0x3d')]);_0x434d9d[_0xad48('0x3e')]=qs[_0xad48('0x36')](_[_0xad48('0x3f')](_0x216d8e[_0xad48('0x34')],_0x36b646[_0xad48('0x36')]),_0x3be64f);if(_0x216d8e[_0xad48('0x34')]['filter']){_0x434d9d[_0xad48('0x3e')]=_['merge'](_0x434d9d[_0xad48('0x3e')],{'$or':_[_0xad48('0x2f')](_0x3be64f,function(_0x39e6c8){if(_0x39e6c8[_0xad48('0x32')]!==_0xad48('0x40')){var _0x37303a={};_0x37303a[_0x39e6c8['name']]={'$like':'%'+_0x216d8e[_0xad48('0x34')][_0xad48('0x41')]+'%'};return _0x37303a;}})});}_0x434d9d=_[_0xad48('0x42')]({},_0x434d9d,_0x216d8e[_0xad48('0x43')]);var _0x281cf1={'where':_0x434d9d[_0xad48('0x3e')]};return db[_0xad48('0x30')][_0xad48('0x20')](_0x281cf1)[_0xad48('0x27')](function(_0x235bba){_0x822b0a['count']=_0x235bba;if(_0x216d8e['query'][_0xad48('0x44')]){_0x434d9d['include']=[{'all':!![]}];}return db['Campaign'][_0xad48('0x45')](_0x434d9d);})[_0xad48('0x27')](function(_0x3926ec){_0x822b0a['rows']=_0x3926ec;return _0x822b0a;})[_0xad48('0x27')](respondWithFilteredResult(_0x209bcc,_0x434d9d))[_0xad48('0x46')](handleError(_0x209bcc,null));};exports[_0xad48('0x47')]=function(_0x517c82,_0xff0554){var _0x19d352={'raw':![],'where':{'id':_0x517c82[_0xad48('0x48')]['id']}},_0x51523e={};_0x51523e[_0xad48('0x33')]=_['keys'](db[_0xad48('0x30')][_0xad48('0x49')]);_0x51523e[_0xad48('0x34')]=_[_0xad48('0x35')](_0x517c82[_0xad48('0x34')]);_0x51523e['filters']=_[_0xad48('0x38')](_0x51523e[_0xad48('0x33')],_0x51523e[_0xad48('0x34')]);_0x19d352[_0xad48('0x37')]=_[_0xad48('0x38')](_0x51523e[_0xad48('0x33')],qs['fields'](_0x517c82['query']['fields']));_0x19d352['attributes']=_0x19d352['attributes'][_0xad48('0x3a')]?_0x19d352[_0xad48('0x37')]:_0x51523e[_0xad48('0x33')];if(_0x517c82['query']['includeAll']){_0x19d352[_0xad48('0x4a')]=[{'all':!![]}];}_0x19d352=_['merge']({},_0x19d352,_0x517c82[_0xad48('0x43')]);return db['Campaign']['find'](_0x19d352)[_0xad48('0x27')](handleEntityNotFound(_0xff0554,null))['then'](respondWithResult(_0xff0554,null))['catch'](handleError(_0xff0554,null));};exports['create']=function(_0x30aab3,_0x43a804){return db[_0xad48('0x30')]['create'](_0x30aab3['body'],{})[_0xad48('0x27')](function(_0x32ab78){var _0x54403f=_0x30aab3['user']['get']({'plain':!![]});if(!_0x54403f)throw new Error(_0xad48('0x4b'));if(_0x54403f['role']==='user'){var _0x4061f8=_0x32ab78[_0xad48('0x29')]({'plain':!![]});var _0xb39084=_0xad48('0x2a');return db[_0xad48('0x4c')][_0xad48('0x4d')]({'where':{'name':_0xb39084,'userProfileId':_0x54403f[_0xad48('0x4e')]},'raw':!![]})['then'](function(_0x2ff50c){if(_0x2ff50c&&_0x2ff50c[_0xad48('0x4f')]===0x0){return db[_0xad48('0x50')][_0xad48('0x51')]({'name':_0x4061f8['name'],'resourceId':_0x4061f8['id'],'type':_0x2ff50c[_0xad48('0x2c')],'sectionId':_0x2ff50c['id']},{})['then'](function(){return _0x32ab78;});}else{return _0x32ab78;}})['catch'](function(_0x21ff2a){logger[_0xad48('0x2b')](_0xad48('0x52'),_0x21ff2a);throw _0x21ff2a;});}return _0x32ab78;})[_0xad48('0x27')](respondWithResult(_0x43a804,0xc9))[_0xad48('0x46')](handleError(_0x43a804,null));};exports[_0xad48('0x53')]=function(_0x5a75e9,_0x31ec70){var _0x2eea17={'where':{'id':_0x5a75e9[_0xad48('0x48')]['id']}},_0x4cc2c5={};_0x4cc2c5[_0xad48('0x33')]=_['keys'](db[_0xad48('0x30')]['rawAttributes']);_0x2eea17[_0xad48('0x37')]=_[_0xad48('0x38')](_0x4cc2c5[_0xad48('0x33')],qs[_0xad48('0x39')](_0x5a75e9[_0xad48('0x34')]['fields']));_0x2eea17[_0xad48('0x37')]=_0x2eea17[_0xad48('0x37')]['length']?_0x2eea17[_0xad48('0x37')]:_0x4cc2c5[_0xad48('0x33')];if(_0x5a75e9[_0xad48('0x34')]['includeAll']){_0x2eea17[_0xad48('0x4a')]=[{'all':!![]}];}_0x2eea17=_[_0xad48('0x42')]({},_0x2eea17,_0x5a75e9[_0xad48('0x43')]);return db[_0xad48('0x30')][_0xad48('0x4d')](_0x2eea17)['then'](handleEntityNotFound(_0x31ec70,null))[_0xad48('0x27')](function(_0x4fefe2){if(_0x4fefe2){var _0x29e03a=_0x4fefe2[_0xad48('0x29')]({'plain':!![]});_0x29e03a=qs[_0xad48('0x54')](_0x29e03a,['id',_0xad48('0x55'),'updatedAt']);_0x5a75e9[_0xad48('0x56')]=_[_0xad48('0x54')](_0x5a75e9[_0xad48('0x56')],['id',_0xad48('0x55'),_0xad48('0x57')]);return db[_0xad48('0x30')]['create'](_[_0xad48('0x42')](_0x29e03a,_0x5a75e9['body']),{'include':_0x5a75e9['query'][_0xad48('0x44')]?[{'all':!![]}]:undefined})[_0xad48('0x27')](function(_0x37e763){var _0x5e1dfa=_0x5a75e9[_0xad48('0x58')][_0xad48('0x29')]({'plain':!![]});if(!_0x5e1dfa)throw new Error(_0xad48('0x4b'));if(_0x5e1dfa[_0xad48('0x59')]===_0xad48('0x58')){var _0x1a9329=_0x37e763['get']({'plain':!![]});var _0x422b92=_0xad48('0x2a');return db[_0xad48('0x4c')][_0xad48('0x4d')]({'where':{'name':_0x422b92,'userProfileId':_0x5e1dfa[_0xad48('0x4e')]},'raw':!![]})['then'](function(_0x4f8cb6){if(_0x4f8cb6&&_0x4f8cb6['autoAssociation']===0x0){return db[_0xad48('0x50')][_0xad48('0x51')]({'name':_0x1a9329[_0xad48('0x2c')],'resourceId':_0x1a9329['id'],'type':_0x4f8cb6['name'],'sectionId':_0x4f8cb6['id']},{})[_0xad48('0x27')](function(){return _0x37e763;});}else{return _0x37e763;}})[_0xad48('0x46')](function(_0x4c509f){logger[_0xad48('0x2b')](_0xad48('0x52'),_0x4c509f);throw _0x4c509f;});}return _0x37e763;});}})[_0xad48('0x27')](respondWithResult(_0x31ec70,0xc9))['catch'](handleError(_0x31ec70,null));};exports['update']=function(_0xf6fe84,_0x241fd3){if(_0xf6fe84['body']['id']){delete _0xf6fe84[_0xad48('0x56')]['id'];}return db[_0xad48('0x30')][_0xad48('0x4d')]({'where':{'id':_0xf6fe84[_0xad48('0x48')]['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x241fd3,null))['then'](saveUpdates(_0xf6fe84['body'],null))[_0xad48('0x27')](respondWithResult(_0x241fd3,null))[_0xad48('0x46')](handleError(_0x241fd3,null));};exports[_0xad48('0x28')]=function(_0x5ccc87,_0x2997ea){return db[_0xad48('0x30')][_0xad48('0x4d')]({'where':{'id':_0x5ccc87[_0xad48('0x48')]['id']}})['then'](handleEntityNotFound(_0x2997ea,null))[_0xad48('0x27')](removeEntity(_0x2997ea,null))[_0xad48('0x46')](handleError(_0x2997ea,null));};exports['getHoppers']=function(_0xa9b7b0,_0x209ea6,_0x44950e){var _0x4eb292={'raw':!![],'where':{}};var _0x1bd650={};var _0xbb643d={'count':0x0,'rows':[]};return db[_0xad48('0x30')][_0xad48('0x5a')]({'where':{'id':_0xa9b7b0[_0xad48('0x48')]['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x209ea6,null))['then'](function(_0x347d63){if(_0x347d63){_0x1bd650[_0xad48('0x33')]=_[_0xad48('0x35')](db[_0xad48('0x5b')]['rawAttributes']);_0x1bd650['query']=_['keys'](_0xa9b7b0[_0xad48('0x34')]);_0x1bd650[_0xad48('0x36')]=_['intersection'](_0x1bd650[_0xad48('0x33')],_0x1bd650[_0xad48('0x34')]);_0x4eb292[_0xad48('0x37')]=_[_0xad48('0x38')](_0x1bd650[_0xad48('0x33')],qs[_0xad48('0x39')](_0xa9b7b0['query'][_0xad48('0x39')]));_0x4eb292['attributes']=_0x4eb292[_0xad48('0x37')][_0xad48('0x3a')]?_0x4eb292[_0xad48('0x37')]:_0x1bd650['model'];if(!_0xa9b7b0[_0xad48('0x34')][_0xad48('0x5c')](_0xad48('0x3b'))){_0x4eb292[_0xad48('0x21')]=qs[_0xad48('0x21')](_0xa9b7b0[_0xad48('0x34')][_0xad48('0x21')]);_0x4eb292[_0xad48('0x1e')]=qs[_0xad48('0x1e')](_0xa9b7b0[_0xad48('0x34')][_0xad48('0x1e')]);}_0x4eb292[_0xad48('0x3c')]=qs['sort'](_0xa9b7b0[_0xad48('0x34')][_0xad48('0x3d')]);_0x4eb292[_0xad48('0x3e')]=qs[_0xad48('0x36')](_[_0xad48('0x3f')](_0xa9b7b0['query'],_0x1bd650[_0xad48('0x36')]));_0x4eb292['where'][_0xad48('0x5d')]=_0x347d63['id'];if(_0xa9b7b0['query'][_0xad48('0x41')]){_0x4eb292[_0xad48('0x3e')]=_[_0xad48('0x42')](_0x4eb292['where'],{'$or':_[_0xad48('0x2f')](_0x4eb292['attributes'],function(_0x40587d){var _0x5d62e9={};_0x5d62e9[_0x40587d]={'$like':'%'+_0xa9b7b0['query'][_0xad48('0x41')]+'%'};return _0x5d62e9;})});}_0x4eb292=_[_0xad48('0x42')]({},_0x4eb292,_0xa9b7b0[_0xad48('0x43')]);return db[_0xad48('0x5b')]['count']({'where':_0x4eb292[_0xad48('0x3e')]})[_0xad48('0x27')](function(_0x16e5b4){_0xbb643d[_0xad48('0x20')]=_0x16e5b4;if(_0xa9b7b0[_0xad48('0x34')][_0xad48('0x44')]){_0x4eb292[_0xad48('0x4a')]=[{'all':!![]}];}return db['CmHopper'][_0xad48('0x45')](_0x4eb292);})[_0xad48('0x27')](function(_0x5f471a){_0xbb643d[_0xad48('0x5e')]=_0x5f471a;return _0xbb643d;});}})[_0xad48('0x27')](respondWithFilteredResult(_0x209ea6,_0x4eb292))[_0xad48('0x46')](handleError(_0x209ea6,null));};exports[_0xad48('0x5f')]=function(_0x439294,_0x3580ab,_0x405388){var _0x588fb8={'raw':!![],'where':{}};var _0x27dd1f={};var _0x1a136c={'count':0x0,'rows':[]};return db[_0xad48('0x30')][_0xad48('0x5a')]({'where':{'id':_0x439294['params']['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x3580ab,null))[_0xad48('0x27')](function(_0x1ac4e6){if(_0x1ac4e6){_0x27dd1f[_0xad48('0x33')]=_['keys'](db[_0xad48('0x60')]['rawAttributes']);_0x27dd1f[_0xad48('0x34')]=_[_0xad48('0x35')](_0x439294[_0xad48('0x34')]);_0x27dd1f['filters']=_[_0xad48('0x38')](_0x27dd1f[_0xad48('0x33')],_0x27dd1f['query']);_0x588fb8[_0xad48('0x37')]=_[_0xad48('0x38')](_0x27dd1f['model'],qs[_0xad48('0x39')](_0x439294['query'][_0xad48('0x39')]));_0x588fb8[_0xad48('0x37')]=_0x588fb8[_0xad48('0x37')]['length']?_0x588fb8[_0xad48('0x37')]:_0x27dd1f['model'];if(!_0x439294[_0xad48('0x34')]['hasOwnProperty'](_0xad48('0x3b'))){_0x588fb8[_0xad48('0x21')]=qs[_0xad48('0x21')](_0x439294[_0xad48('0x34')]['limit']);_0x588fb8[_0xad48('0x1e')]=qs[_0xad48('0x1e')](_0x439294['query'][_0xad48('0x1e')]);}_0x588fb8[_0xad48('0x3c')]=qs[_0xad48('0x3d')](_0x439294['query'][_0xad48('0x3d')]);_0x588fb8['where']=qs[_0xad48('0x36')](_['pick'](_0x439294[_0xad48('0x34')],_0x27dd1f[_0xad48('0x36')]));_0x588fb8['where'][_0xad48('0x5d')]=_0x1ac4e6['id'];if(_0x439294[_0xad48('0x34')][_0xad48('0x41')]){_0x588fb8[_0xad48('0x3e')]=_[_0xad48('0x42')](_0x588fb8['where'],{'$or':_[_0xad48('0x2f')](_0x588fb8[_0xad48('0x37')],function(_0x2ee9c1){var _0x37aa36={};_0x37aa36[_0x2ee9c1]={'$like':'%'+_0x439294[_0xad48('0x34')]['filter']+'%'};return _0x37aa36;})});}_0x588fb8=_[_0xad48('0x42')]({},_0x588fb8,_0x439294['options']);return db[_0xad48('0x60')][_0xad48('0x20')]({'where':_0x588fb8[_0xad48('0x3e')]})[_0xad48('0x27')](function(_0x20478e){_0x1a136c[_0xad48('0x20')]=_0x20478e;if(_0x439294[_0xad48('0x34')][_0xad48('0x44')]){_0x588fb8[_0xad48('0x4a')]=[{'all':!![]}];}return db[_0xad48('0x60')][_0xad48('0x45')](_0x588fb8);})['then'](function(_0x28c34d){_0x1a136c[_0xad48('0x5e')]=_0x28c34d;return _0x1a136c;});}})['then'](respondWithFilteredResult(_0x3580ab,_0x588fb8))[_0xad48('0x46')](handleError(_0x3580ab,null));};exports[_0xad48('0x61')]=function(_0x17e623,_0x4dfc9b,_0x40ed2d){var _0x2f29cc={'raw':!![],'where':{}};var _0x41d956={};var _0x34f81c={'count':0x0,'rows':[]};return db[_0xad48('0x30')][_0xad48('0x5a')]({'where':{'id':_0x17e623[_0xad48('0x48')]['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x4dfc9b,null))['then'](function(_0x21c771){if(_0x21c771){_0x41d956[_0xad48('0x33')]=_[_0xad48('0x35')](db[_0xad48('0x62')][_0xad48('0x49')]);_0x41d956['query']=_[_0xad48('0x35')](_0x17e623[_0xad48('0x34')]);_0x41d956[_0xad48('0x36')]=_[_0xad48('0x38')](_0x41d956['model'],_0x41d956[_0xad48('0x34')]);_0x2f29cc[_0xad48('0x37')]=_[_0xad48('0x38')](_0x41d956[_0xad48('0x33')],qs['fields'](_0x17e623['query'][_0xad48('0x39')]));_0x2f29cc[_0xad48('0x37')]=_0x2f29cc[_0xad48('0x37')][_0xad48('0x3a')]?_0x2f29cc[_0xad48('0x37')]:_0x41d956[_0xad48('0x33')];if(!_0x17e623[_0xad48('0x34')][_0xad48('0x5c')]('nolimit')){_0x2f29cc[_0xad48('0x21')]=qs['limit'](_0x17e623[_0xad48('0x34')]['limit']);_0x2f29cc[_0xad48('0x1e')]=qs['offset'](_0x17e623[_0xad48('0x34')][_0xad48('0x1e')]);}_0x2f29cc['order']=qs['sort'](_0x17e623[_0xad48('0x34')][_0xad48('0x3d')]);_0x2f29cc[_0xad48('0x3e')]=qs['filters'](_[_0xad48('0x3f')](_0x17e623[_0xad48('0x34')],_0x41d956[_0xad48('0x36')]));_0x2f29cc[_0xad48('0x3e')]['CampaignId']=_0x21c771['id'];if(_0x17e623[_0xad48('0x34')][_0xad48('0x41')]){_0x2f29cc[_0xad48('0x3e')]=_[_0xad48('0x42')](_0x2f29cc[_0xad48('0x3e')],{'$or':_[_0xad48('0x2f')](_0x2f29cc[_0xad48('0x37')],function(_0x253f26){var _0x145ed0={};_0x145ed0[_0x253f26]={'$like':'%'+_0x17e623[_0xad48('0x34')][_0xad48('0x41')]+'%'};return _0x145ed0;})});}_0x2f29cc=_[_0xad48('0x42')]({},_0x2f29cc,_0x17e623[_0xad48('0x43')]);return db[_0xad48('0x62')][_0xad48('0x20')]({'where':_0x2f29cc['where']})['then'](function(_0x1f52f6){_0x34f81c['count']=_0x1f52f6;if(_0x17e623[_0xad48('0x34')][_0xad48('0x44')]){_0x2f29cc[_0xad48('0x4a')]=[{'all':!![]}];}return db[_0xad48('0x62')][_0xad48('0x45')](_0x2f29cc);})[_0xad48('0x27')](function(_0x387cb5){_0x34f81c['rows']=_0x387cb5;return _0x34f81c;});}})[_0xad48('0x27')](respondWithFilteredResult(_0x4dfc9b,_0x2f29cc))[_0xad48('0x46')](handleError(_0x4dfc9b,null));};exports[_0xad48('0x63')]=function(_0x75e9c8,_0x12c1bc,_0x4c0c6b){var _0x1d8028={'raw':!![],'where':{}};var _0xc6193={};var _0x57651a={'count':0x0,'rows':[]};return db['Campaign'][_0xad48('0x5a')]({'where':{'id':_0x75e9c8[_0xad48('0x48')]['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x12c1bc,null))[_0xad48('0x27')](function(_0x213567){if(_0x213567){_0xc6193[_0xad48('0x33')]=_[_0xad48('0x35')](db[_0xad48('0x64')][_0xad48('0x49')]);_0xc6193['query']=_[_0xad48('0x35')](_0x75e9c8['query']);_0xc6193[_0xad48('0x36')]=_[_0xad48('0x38')](_0xc6193[_0xad48('0x33')],_0xc6193[_0xad48('0x34')]);_0x1d8028[_0xad48('0x37')]=_[_0xad48('0x38')](_0xc6193[_0xad48('0x33')],qs[_0xad48('0x39')](_0x75e9c8[_0xad48('0x34')][_0xad48('0x39')]));_0x1d8028['attributes']=_0x1d8028[_0xad48('0x37')][_0xad48('0x3a')]?_0x1d8028['attributes']:_0xc6193['model'];if(!_0x75e9c8[_0xad48('0x34')][_0xad48('0x5c')](_0xad48('0x3b'))){_0x1d8028[_0xad48('0x21')]=qs['limit'](_0x75e9c8[_0xad48('0x34')][_0xad48('0x21')]);_0x1d8028[_0xad48('0x1e')]=qs[_0xad48('0x1e')](_0x75e9c8['query']['offset']);}_0x1d8028[_0xad48('0x3c')]=qs['sort'](_0x75e9c8[_0xad48('0x34')][_0xad48('0x3d')]);_0x1d8028[_0xad48('0x3e')]=qs[_0xad48('0x36')](_['pick'](_0x75e9c8['query'],_0xc6193['filters']));_0x1d8028['where'][_0xad48('0x5d')]=_0x213567['id'];if(_0x75e9c8[_0xad48('0x34')][_0xad48('0x41')]){_0x1d8028[_0xad48('0x3e')]=_[_0xad48('0x42')](_0x1d8028[_0xad48('0x3e')],{'$or':_[_0xad48('0x2f')](_0x1d8028[_0xad48('0x37')],function(_0x791a22){var _0xe4e7dd={};_0xe4e7dd[_0x791a22]={'$like':'%'+_0x75e9c8[_0xad48('0x34')][_0xad48('0x41')]+'%'};return _0xe4e7dd;})});}_0x1d8028=_['merge']({},_0x1d8028,_0x75e9c8[_0xad48('0x43')]);return db[_0xad48('0x64')][_0xad48('0x20')]({'where':_0x1d8028[_0xad48('0x3e')]})[_0xad48('0x27')](function(_0x1cebe6){_0x57651a[_0xad48('0x20')]=_0x1cebe6;if(_0x75e9c8[_0xad48('0x34')]['includeAll']){_0x1d8028[_0xad48('0x4a')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xad48('0x45')](_0x1d8028);})[_0xad48('0x27')](function(_0x428077){_0x57651a[_0xad48('0x5e')]=_0x428077;return _0x57651a;});}})[_0xad48('0x27')](respondWithFilteredResult(_0x12c1bc,_0x1d8028))[_0xad48('0x46')](handleError(_0x12c1bc,null));};exports[_0xad48('0x65')]=function(_0x374723,_0x343025,_0x473ef0){var _0x5886ff={};var _0xa7764a={};var _0x30cebd;var _0x48f32e;return db[_0xad48('0x30')][_0xad48('0x5a')]({'where':{'id':_0x374723['params']['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x343025,null))[_0xad48('0x27')](function(_0x226690){if(_0x226690){_0x30cebd=_0x226690;_0xa7764a['model']=_[_0xad48('0x35')](db[_0xad48('0x66')][_0xad48('0x49')]);_0xa7764a['query']=_[_0xad48('0x35')](_0x374723[_0xad48('0x34')]);_0xa7764a[_0xad48('0x36')]=_[_0xad48('0x38')](_0xa7764a[_0xad48('0x33')],_0xa7764a[_0xad48('0x34')]);_0x5886ff[_0xad48('0x37')]=_[_0xad48('0x38')](_0xa7764a['model'],qs[_0xad48('0x39')](_0x374723[_0xad48('0x34')]['fields']));_0x5886ff[_0xad48('0x37')]=_0x5886ff[_0xad48('0x37')][_0xad48('0x3a')]?_0x5886ff[_0xad48('0x37')]:_0xa7764a['model'];_0x5886ff['order']=qs['sort'](_0x374723[_0xad48('0x34')]['sort']);_0x5886ff[_0xad48('0x3e')]=qs['filters'](_[_0xad48('0x3f')](_0x374723['query'],_0xa7764a[_0xad48('0x36')]));if(_0x374723[_0xad48('0x34')][_0xad48('0x41')]){_0x5886ff[_0xad48('0x3e')]=_[_0xad48('0x42')](_0x5886ff[_0xad48('0x3e')],{'$or':_['map'](_0x5886ff[_0xad48('0x37')],function(_0x3c43e0){var _0x576320={};_0x576320[_0x3c43e0]={'$like':'%'+_0x374723['query'][_0xad48('0x41')]+'%'};return _0x576320;})});}_0x5886ff=_[_0xad48('0x42')]({},_0x5886ff,_0x374723[_0xad48('0x43')]);return _0x30cebd[_0xad48('0x65')](_0x5886ff);}})[_0xad48('0x27')](function(_0x543492){if(_0x543492){_0x48f32e=_0x543492['length'];if(!_0x374723[_0xad48('0x34')][_0xad48('0x5c')](_0xad48('0x3b'))){_0x5886ff[_0xad48('0x21')]=qs[_0xad48('0x21')](_0x374723[_0xad48('0x34')][_0xad48('0x21')]);_0x5886ff['offset']=qs['offset'](_0x374723['query'][_0xad48('0x1e')]);}return _0x30cebd['getLists'](_0x5886ff);}})[_0xad48('0x27')](function(_0x5025e6){if(_0x5025e6){return _0x5025e6?{'count':_0x48f32e,'rows':_0x5025e6}:null;}})['then'](respondWithResult(_0x343025,null))[_0xad48('0x46')](handleError(_0x343025,null));};exports[_0xad48('0x67')]=function(_0x4145d4,_0x1289c6,_0x544028){var _0x43d7e3,_0x4c4734;return db[_0xad48('0x30')][_0xad48('0x4d')]({'where':{'id':_0x4145d4[_0xad48('0x48')]['id']}})['then'](handleEntityNotFound(_0x1289c6,null))[_0xad48('0x27')](function(_0x1b48b3){if(_0x1b48b3){_0x4c4734=_0x1b48b3;return _0x1b48b3['addLists'](_0x4145d4[_0xad48('0x56')]['ids'],_[_0xad48('0x54')](_0x4145d4[_0xad48('0x56')],[_0xad48('0x68'),'id'])||{});}return null;})[_0xad48('0x69')](function(_0x49b608){var _0x5c4a78;_0x43d7e3=_0x49b608||[];var _0x11de19=[];if(_0x49b608){for(var _0xac3803=0x0;_0xac3803<_0x49b608[_0xad48('0x3a')];_0xac3803+=0x1){var _0x3967d6=_0x49b608[_0xac3803][_0xad48('0x29')]({'plain':!![]});_0x4c4734[_0xad48('0x6a')]=_0x4145d4[_0xad48('0x56')]['dialCheckDuplicateType']?_0x4145d4['body'][_0xad48('0x6a')]:_0x4c4734['dialCheckDuplicateType'];switch(_0x4c4734['dialCheckDuplicateType']){case _0xad48('0x6b'):_0x5c4a78=squel[_0xad48('0x6c')]()['into'](_0xad48('0x6d'))[_0xad48('0x6e')]([_0xad48('0x6f'),_0xad48('0x70'),'ContactId',_0xad48('0x71'),_0xad48('0x5d'),_0xad48('0x55'),_0xad48('0x57')],squel[_0xad48('0x72')]()[_0xad48('0x73')](_0xad48('0x6f'),_0xad48('0x6f'))[_0xad48('0x73')]('NOW()',_0xad48('0x70'))[_0xad48('0x73')]('id','ContactId')['field'](_0x3967d6['CmListId'][_0xad48('0x74')](),_0xad48('0x71'))[_0xad48('0x73')](_0x4145d4['params']['id']['toString'](),'CampaignId')[_0xad48('0x73')]('NOW()','createdAt')['field'](_0xad48('0x75'),_0xad48('0x57'))[_0xad48('0x76')](_0xad48('0x77'))['where'](_0xad48('0x78'))[_0xad48('0x3e')](_0xad48('0x79'),_0x3967d6[_0xad48('0x7a')][_0xad48('0x74')]())[_0xad48('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0xad48('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xad48('0x72')]()[_0xad48('0x73')](_0xad48('0x7b'))[_0xad48('0x76')](_0xad48('0x7c'))[_0xad48('0x3e')](_0xad48('0x7d'),_0x4145d4[_0xad48('0x48')]['id'][_0xad48('0x74')]()))[_0xad48('0x3e')](_0xad48('0x7e'),squel['select']()[_0xad48('0x73')](_0xad48('0x7f'))[_0xad48('0x76')](_0xad48('0x6d'))[_0xad48('0x3e')](_0xad48('0x7d'),_0x4145d4[_0xad48('0x48')]['id'][_0xad48('0x74')]())))[_0xad48('0x74')]();break;case _0xad48('0x80'):_0x5c4a78=squel['insert']()[_0xad48('0x81')](_0xad48('0x6d'))[_0xad48('0x6e')]([_0xad48('0x6f'),_0xad48('0x70'),_0xad48('0x82'),_0xad48('0x71'),_0xad48('0x5d'),'createdAt',_0xad48('0x57')],squel[_0xad48('0x72')]()[_0xad48('0x73')]('phone',_0xad48('0x6f'))['field'](_0xad48('0x75'),_0xad48('0x70'))['field']('id',_0xad48('0x82'))['field'](_0x3967d6['CmListId'][_0xad48('0x74')](),'ListId')[_0xad48('0x73')](_0x4145d4[_0xad48('0x48')]['id'][_0xad48('0x74')](),'CampaignId')[_0xad48('0x73')](_0xad48('0x75'),_0xad48('0x55'))[_0xad48('0x73')](_0xad48('0x75'),_0xad48('0x57'))[_0xad48('0x76')](_0xad48('0x77'))[_0xad48('0x3e')](_0xad48('0x78'))[_0xad48('0x3e')](_0xad48('0x79'),_0x3967d6[_0xad48('0x7a')]['toString']())[_0xad48('0x3e')](_0xad48('0x83'))[_0xad48('0x3e')](_0xad48('0x7e'),squel['select']()[_0xad48('0x73')](_0xad48('0x7f'))[_0xad48('0x76')](_0xad48('0x6d'))[_0xad48('0x3e')](_0xad48('0x7d'),_0x4145d4[_0xad48('0x48')]['id'][_0xad48('0x74')]())))[_0xad48('0x74')]();break;default:_0x5c4a78=squel[_0xad48('0x6c')]()[_0xad48('0x81')]('cm_hopper')[_0xad48('0x6e')](['phone',_0xad48('0x70'),_0xad48('0x82'),'ListId',_0xad48('0x5d'),_0xad48('0x55'),_0xad48('0x57')],squel[_0xad48('0x72')]()[_0xad48('0x73')](_0xad48('0x6f'),_0xad48('0x6f'))[_0xad48('0x73')](_0xad48('0x75'),_0xad48('0x70'))[_0xad48('0x73')]('id','ContactId')['field'](_0x3967d6['CmListId']['toString'](),_0xad48('0x71'))[_0xad48('0x73')](_0x4145d4['params']['id'][_0xad48('0x74')](),_0xad48('0x5d'))[_0xad48('0x73')]('NOW()',_0xad48('0x55'))['field'](_0xad48('0x75'),'updatedAt')[_0xad48('0x76')](_0xad48('0x77'))[_0xad48('0x3e')](_0xad48('0x78'))[_0xad48('0x3e')](_0xad48('0x79'),_0x3967d6[_0xad48('0x7a')][_0xad48('0x74')]())[_0xad48('0x3e')](_0xad48('0x83')))[_0xad48('0x74')]();}_0x11de19[_0xad48('0x84')](db[_0xad48('0x85')][_0xad48('0x34')](_0x5c4a78));}return BPromise[_0xad48('0x86')](_0x11de19);}})['then'](function(){return _0x43d7e3;})[_0xad48('0x27')](respondWithResult(_0x1289c6,null))[_0xad48('0x46')](handleError(_0x1289c6,null));};exports[_0xad48('0x87')]=function(_0x4eb165,_0x357ae6,_0x11d576){return db[_0xad48('0x30')][_0xad48('0x4d')]({'where':{'id':_0x4eb165[_0xad48('0x48')]['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x357ae6,null))['then'](function(_0x2daab1){if(_0x2daab1){return _0x2daab1[_0xad48('0x87')](_0x4eb165['query'][_0xad48('0x68')]);}})[_0xad48('0x27')](function(_0x4da66d){if(_0x4da66d){return db[_0xad48('0x5b')][_0xad48('0x28')]({'where':{'ListId':_0x4eb165[_0xad48('0x34')][_0xad48('0x68')],'CampaignId':_0x4eb165['params']['id']}})[_0xad48('0x27')](function(){return _0x4da66d;});}})[_0xad48('0x27')](respondWithStatusCode(_0x357ae6,null))[_0xad48('0x46')](handleError(_0x357ae6,null));};exports[_0xad48('0x88')]=function(_0x189605,_0x2751ad,_0x4ca0b8){var _0x226786={};var _0x11be61={};var _0x5f089a;var _0x29beea;return db[_0xad48('0x30')][_0xad48('0x5a')]({'where':{'id':_0x189605[_0xad48('0x48')]['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x2751ad,null))['then'](function(_0x4f2283){if(_0x4f2283){_0x5f089a=_0x4f2283;_0x11be61[_0xad48('0x33')]=_[_0xad48('0x35')](db[_0xad48('0x66')][_0xad48('0x49')]);_0x11be61[_0xad48('0x34')]=_['keys'](_0x189605[_0xad48('0x34')]);_0x11be61[_0xad48('0x36')]=_[_0xad48('0x38')](_0x11be61['model'],_0x11be61['query']);_0x226786['attributes']=_[_0xad48('0x38')](_0x11be61[_0xad48('0x33')],qs[_0xad48('0x39')](_0x189605[_0xad48('0x34')][_0xad48('0x39')]));_0x226786[_0xad48('0x37')]=_0x226786['attributes'][_0xad48('0x3a')]?_0x226786[_0xad48('0x37')]:_0x11be61['model'];_0x226786['order']=qs[_0xad48('0x3d')](_0x189605[_0xad48('0x34')][_0xad48('0x3d')]);_0x226786['where']=qs['filters'](_[_0xad48('0x3f')](_0x189605['query'],_0x11be61[_0xad48('0x36')]));if(_0x189605[_0xad48('0x34')][_0xad48('0x41')]){_0x226786[_0xad48('0x3e')]=_[_0xad48('0x42')](_0x226786[_0xad48('0x3e')],{'$or':_[_0xad48('0x2f')](_0x226786[_0xad48('0x37')],function(_0x4d144d){var _0x393507={};_0x393507[_0x4d144d]={'$like':'%'+_0x189605[_0xad48('0x34')][_0xad48('0x41')]+'%'};return _0x393507;})});}_0x226786=_[_0xad48('0x42')]({},_0x226786,_0x189605['options']);return _0x5f089a[_0xad48('0x88')](_0x226786);}})[_0xad48('0x27')](function(_0x348621){if(_0x348621){_0x29beea=_0x348621['length'];if(!_0x189605[_0xad48('0x34')]['hasOwnProperty']('nolimit')){_0x226786[_0xad48('0x21')]=qs[_0xad48('0x21')](_0x189605[_0xad48('0x34')][_0xad48('0x21')]);_0x226786[_0xad48('0x1e')]=qs[_0xad48('0x1e')](_0x189605['query'][_0xad48('0x1e')]);}return _0x5f089a[_0xad48('0x88')](_0x226786);}})[_0xad48('0x27')](function(_0xe3955){if(_0xe3955){return _0xe3955?{'count':_0x29beea,'rows':_0xe3955}:null;}})[_0xad48('0x27')](respondWithResult(_0x2751ad,null))[_0xad48('0x46')](handleError(_0x2751ad,null));};exports[_0xad48('0x89')]=function(_0x112501,_0x1b6243,_0x21b9e3){var _0x30dd81,_0xd8ae5;return db['Campaign'][_0xad48('0x4d')]({'where':{'id':_0x112501[_0xad48('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b6243,null))[_0xad48('0x27')](function(_0x3432f9){if(_0x3432f9){_0xd8ae5=_0x3432f9;return _0x3432f9['addBlackLists'](_0x112501[_0xad48('0x56')][_0xad48('0x68')],_[_0xad48('0x54')](_0x112501[_0xad48('0x56')],[_0xad48('0x68'),'id'])||{});}return null;})[_0xad48('0x69')](function(_0x364d0b){var _0x1bf56a;_0x30dd81=_0x364d0b||[];var _0x2f241c=[];if(_0x364d0b){for(var _0x5a8951=0x0;_0x5a8951<_0x364d0b[_0xad48('0x3a')];_0x5a8951+=0x1){var _0x81589d=_0x364d0b[_0x5a8951][_0xad48('0x29')]({'plain':!![]});_0x1bf56a=squel[_0xad48('0x6c')]()[_0xad48('0x81')]('cm_hopper_black')[_0xad48('0x6e')]([_0xad48('0x6f'),_0xad48('0x82'),_0xad48('0x71'),'CampaignId',_0xad48('0x55'),_0xad48('0x57')],squel['select']()[_0xad48('0x73')]('phone','phone')['field']('id',_0xad48('0x82'))['field'](_0x81589d[_0xad48('0x7a')][_0xad48('0x74')](),_0xad48('0x71'))[_0xad48('0x73')](_0x112501[_0xad48('0x48')]['id']['toString'](),_0xad48('0x5d'))[_0xad48('0x73')](_0xad48('0x75'),_0xad48('0x55'))[_0xad48('0x73')](_0xad48('0x75'),_0xad48('0x57'))[_0xad48('0x76')](_0xad48('0x77'))[_0xad48('0x3e')]('deletedAt\x20IS\x20NULL')[_0xad48('0x3e')](_0xad48('0x79'),_0x81589d[_0xad48('0x7a')][_0xad48('0x74')]())['where'](_0xad48('0x83')))[_0xad48('0x74')]();_0x2f241c[_0xad48('0x84')](db['sequelize'][_0xad48('0x34')](_0x1bf56a));}return BPromise[_0xad48('0x86')](_0x2f241c);}})[_0xad48('0x27')](function(){return _0x30dd81;})['then'](respondWithResult(_0x1b6243,null))[_0xad48('0x46')](handleError(_0x1b6243,null));};exports[_0xad48('0x8a')]=function(_0x4de900,_0x1d013e,_0x5ab481){return db[_0xad48('0x30')][_0xad48('0x4d')]({'where':{'id':_0x4de900[_0xad48('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d013e,null))[_0xad48('0x27')](function(_0x270546){if(_0x270546){return _0x270546[_0xad48('0x8a')](_0x4de900[_0xad48('0x34')]['ids']);}})[_0xad48('0x27')](function(_0x2e7e49){if(_0x2e7e49){return db[_0xad48('0x64')]['destroy']({'where':{'ListId':_0x4de900['query'][_0xad48('0x68')],'CampaignId':_0x4de900[_0xad48('0x48')]['id']}})[_0xad48('0x27')](function(){return _0x2e7e49;});}})[_0xad48('0x27')](respondWithStatusCode(_0x1d013e,null))['catch'](handleError(_0x1d013e,null));}; \ No newline at end of file +var _0x84f1=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','update','findOne','CmHopper','order','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','NOW()','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','deletedAt\x20IS\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','all','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','rawAttributes','fieldName','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','Campaign','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId'];(function(_0x2b2714,_0x2231cf){var _0x2dec74=function(_0x5c6311){while(--_0x5c6311){_0x2b2714['push'](_0x2b2714['shift']());}};_0x2dec74(++_0x2231cf);}(_0x84f1,0xbe));var _0x184f=function(_0x3d54b5,_0x4e7b54){_0x3d54b5=_0x3d54b5-0x0;var _0x5cbcaa=_0x84f1[_0x3d54b5];return _0x5cbcaa;};'use strict';var emlformat=require(_0x184f('0x0'));var rimraf=require(_0x184f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x184f('0x2'));var rp=require(_0x184f('0x3'));var moment=require(_0x184f('0x4'));var BPromise=require(_0x184f('0x5'));var Mustache=require(_0x184f('0x6'));var util=require(_0x184f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x184f('0x8'));var ejs=require(_0x184f('0x9'));var fs=require('fs');var fs_extra=require(_0x184f('0xa'));var _=require(_0x184f('0xb'));var squel=require(_0x184f('0xc'));var crypto=require('crypto');var jsforce=require(_0x184f('0xd'));var deskjs=require(_0x184f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x184f('0xf'));var Papa=require(_0x184f('0x10'));var Redis=require('ioredis');var authService=require(_0x184f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x184f('0x12'));var hardwareService=require(_0x184f('0x13'));var logger=require(_0x184f('0x14'))(_0x184f('0x15'));var utils=require(_0x184f('0x16'));var config=require(_0x184f('0x17'));var licenseUtil=require(_0x184f('0x18'));var db=require(_0x184f('0x19'))['db'];function respondWithStatusCode(_0x4bed3d,_0x48230e){_0x48230e=_0x48230e||0xcc;return function(_0x1eb64a){if(_0x1eb64a){return _0x4bed3d[_0x184f('0x1a')](_0x48230e);}return _0x4bed3d[_0x184f('0x1b')](_0x48230e)['end']();};}function respondWithResult(_0x3a78fc,_0x1756d2){_0x1756d2=_0x1756d2||0xc8;return function(_0x5d1af7){if(_0x5d1af7){return _0x3a78fc[_0x184f('0x1b')](_0x1756d2)['json'](_0x5d1af7);}};}function respondWithFilteredResult(_0x44d24c,_0x5b2124){return function(_0x329850){if(_0x329850){var _0x566118=typeof _0x5b2124[_0x184f('0x1c')]===_0x184f('0x1d')&&typeof _0x5b2124[_0x184f('0x1e')]===_0x184f('0x1d');var _0x3580f1=_0x329850[_0x184f('0x1f')];var _0x3aa9af=_0x566118?0x0:_0x5b2124[_0x184f('0x1c')];var _0x37ffa2=_0x566118?_0x329850[_0x184f('0x1f')]:_0x5b2124[_0x184f('0x1c')]+_0x5b2124[_0x184f('0x1e')];var _0x13dd74;if(_0x37ffa2>=_0x3580f1){_0x37ffa2=_0x3580f1;_0x13dd74=0xc8;}else{_0x13dd74=0xce;}_0x44d24c['status'](_0x13dd74);return _0x44d24c[_0x184f('0x20')](_0x184f('0x21'),_0x3aa9af+'-'+_0x37ffa2+'/'+_0x3580f1)['json'](_0x329850);}return null;};}function patchUpdates(_0x57df67){return function(_0x31b842){try{jsonpatch[_0x184f('0x22')](_0x31b842,_0x57df67,!![]);}catch(_0x26eec5){return BPromise[_0x184f('0x23')](_0x26eec5);}return _0x31b842[_0x184f('0x24')]();};}function saveUpdates(_0x1b1433,_0x502d09){return function(_0x4915c1){if(_0x4915c1){return _0x4915c1['update'](_0x1b1433)[_0x184f('0x25')](function(_0x161258){return _0x161258;});}return null;};}function removeEntity(_0x3bf224,_0xd7846d){return function(_0x4cd64c){if(_0x4cd64c){return _0x4cd64c[_0x184f('0x26')]()[_0x184f('0x25')](function(){var _0x45c102=_0x4cd64c[_0x184f('0x27')]({'plain':!![]});var _0x51bc96='IvrCampaigns';return db[_0x184f('0x28')][_0x184f('0x26')]({'where':{'type':_0x51bc96,'resourceId':_0x45c102['id']}})['then'](function(){return _0x4cd64c;});})[_0x184f('0x25')](function(){_0x3bf224[_0x184f('0x1b')](0xcc)[_0x184f('0x29')]();});}};}function handleEntityNotFound(_0x35dbaa,_0x372149){return function(_0xf8302e){if(!_0xf8302e){_0x35dbaa[_0x184f('0x1a')](0x194);}return _0xf8302e;};}function handleError(_0x3ba061,_0x22282e){_0x22282e=_0x22282e||0x1f4;return function(_0x4d1de1){logger[_0x184f('0x2a')](_0x4d1de1[_0x184f('0x2b')]);if(_0x4d1de1[_0x184f('0x2c')]){delete _0x4d1de1[_0x184f('0x2c')];}_0x3ba061[_0x184f('0x1b')](_0x22282e)[_0x184f('0x2d')](_0x4d1de1);};}exports[_0x184f('0x2e')]=function(_0x4346b6,_0x5d23d8){var _0x520679={},_0xe053e4={},_0x4ab3d9={'count':0x0,'rows':[]};var _0x19a8a4=_['map'](db['Campaign'][_0x184f('0x2f')],function(_0x68079f){return{'name':_0x68079f[_0x184f('0x30')],'type':_0x68079f['type']['key']};});_0xe053e4['model']=_[_0x184f('0x31')](_0x19a8a4,_0x184f('0x2c'));_0xe053e4[_0x184f('0x32')]=_[_0x184f('0x33')](_0x4346b6[_0x184f('0x32')]);_0xe053e4[_0x184f('0x34')]=_[_0x184f('0x35')](_0xe053e4['model'],_0xe053e4[_0x184f('0x32')]);_0x520679[_0x184f('0x36')]=_[_0x184f('0x35')](_0xe053e4[_0x184f('0x37')],qs[_0x184f('0x38')](_0x4346b6[_0x184f('0x32')][_0x184f('0x38')]));_0x520679[_0x184f('0x36')]=_0x520679[_0x184f('0x36')][_0x184f('0x39')]?_0x520679['attributes']:_0xe053e4[_0x184f('0x37')];if(!_0x4346b6[_0x184f('0x32')][_0x184f('0x3a')](_0x184f('0x3b'))){_0x520679[_0x184f('0x1e')]=qs['limit'](_0x4346b6[_0x184f('0x32')][_0x184f('0x1e')]);_0x520679[_0x184f('0x1c')]=qs[_0x184f('0x1c')](_0x4346b6['query'][_0x184f('0x1c')]);}_0x520679['order']=qs[_0x184f('0x3c')](_0x4346b6['query']['sort']);_0x520679[_0x184f('0x3d')]=qs[_0x184f('0x34')](_[_0x184f('0x3e')](_0x4346b6['query'],_0xe053e4[_0x184f('0x34')]),_0x19a8a4);if(_0x4346b6[_0x184f('0x32')][_0x184f('0x3f')]){_0x520679[_0x184f('0x3d')]=_['merge'](_0x520679['where'],{'$or':_[_0x184f('0x31')](_0x19a8a4,function(_0x57b741){if(_0x57b741[_0x184f('0x40')]!==_0x184f('0x41')){var _0x275de9={};_0x275de9[_0x57b741[_0x184f('0x2c')]]={'$like':'%'+_0x4346b6['query'][_0x184f('0x3f')]+'%'};return _0x275de9;}})});}_0x520679=_[_0x184f('0x42')]({},_0x520679,_0x4346b6[_0x184f('0x43')]);var _0x13be0b={'where':_0x520679[_0x184f('0x3d')]};return db[_0x184f('0x44')][_0x184f('0x1f')](_0x13be0b)[_0x184f('0x25')](function(_0x3bd57e){_0x4ab3d9[_0x184f('0x1f')]=_0x3bd57e;if(_0x4346b6[_0x184f('0x32')][_0x184f('0x45')]){_0x520679[_0x184f('0x46')]=[{'all':!![]}];}return db[_0x184f('0x44')][_0x184f('0x47')](_0x520679);})[_0x184f('0x25')](function(_0x12dbe2){_0x4ab3d9['rows']=_0x12dbe2;return _0x4ab3d9;})['then'](respondWithFilteredResult(_0x5d23d8,_0x520679))[_0x184f('0x48')](handleError(_0x5d23d8,null));};exports[_0x184f('0x49')]=function(_0x4eb9d2,_0x3d47b1){var _0x7e098c={'raw':![],'where':{'id':_0x4eb9d2[_0x184f('0x4a')]['id']}},_0x305f39={};_0x305f39[_0x184f('0x37')]=_['keys'](db[_0x184f('0x44')][_0x184f('0x2f')]);_0x305f39[_0x184f('0x32')]=_[_0x184f('0x33')](_0x4eb9d2[_0x184f('0x32')]);_0x305f39[_0x184f('0x34')]=_[_0x184f('0x35')](_0x305f39[_0x184f('0x37')],_0x305f39[_0x184f('0x32')]);_0x7e098c[_0x184f('0x36')]=_[_0x184f('0x35')](_0x305f39[_0x184f('0x37')],qs['fields'](_0x4eb9d2[_0x184f('0x32')][_0x184f('0x38')]));_0x7e098c[_0x184f('0x36')]=_0x7e098c[_0x184f('0x36')][_0x184f('0x39')]?_0x7e098c[_0x184f('0x36')]:_0x305f39[_0x184f('0x37')];if(_0x4eb9d2[_0x184f('0x32')][_0x184f('0x45')]){_0x7e098c['include']=[{'all':!![]}];}_0x7e098c=_[_0x184f('0x42')]({},_0x7e098c,_0x4eb9d2[_0x184f('0x43')]);return db[_0x184f('0x44')][_0x184f('0x4b')](_0x7e098c)[_0x184f('0x25')](handleEntityNotFound(_0x3d47b1,null))['then'](respondWithResult(_0x3d47b1,null))[_0x184f('0x48')](handleError(_0x3d47b1,null));};exports[_0x184f('0x4c')]=function(_0x198d58,_0x225516){return db['Campaign'][_0x184f('0x4c')](_0x198d58[_0x184f('0x4d')],{})[_0x184f('0x25')](function(_0x29dc5d){var _0x53dc0f=_0x198d58[_0x184f('0x4e')]['get']({'plain':!![]});if(!_0x53dc0f)throw new Error(_0x184f('0x4f'));if(_0x53dc0f[_0x184f('0x50')]===_0x184f('0x4e')){var _0x2d9dc0=_0x29dc5d[_0x184f('0x27')]({'plain':!![]});var _0x50a244=_0x184f('0x51');return db[_0x184f('0x52')][_0x184f('0x4b')]({'where':{'name':_0x50a244,'userProfileId':_0x53dc0f[_0x184f('0x53')]},'raw':!![]})[_0x184f('0x25')](function(_0x289f6a){if(_0x289f6a&&_0x289f6a[_0x184f('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x2d9dc0['name'],'resourceId':_0x2d9dc0['id'],'type':_0x289f6a[_0x184f('0x2c')],'sectionId':_0x289f6a['id']},{})['then'](function(){return _0x29dc5d;});}else{return _0x29dc5d;}})[_0x184f('0x48')](function(_0x4b9b69){logger['error'](_0x184f('0x55'),_0x4b9b69);throw _0x4b9b69;});}return _0x29dc5d;})['then'](respondWithResult(_0x225516,0xc9))[_0x184f('0x48')](handleError(_0x225516,null));};exports[_0x184f('0x56')]=function(_0x2bd552,_0x1bf2a4){var _0x21c00b={'where':{'id':_0x2bd552['params']['id']}},_0x1fa8a3={};_0x1fa8a3['model']=_[_0x184f('0x33')](db[_0x184f('0x44')][_0x184f('0x2f')]);_0x21c00b['attributes']=_['intersection'](_0x1fa8a3[_0x184f('0x37')],qs[_0x184f('0x38')](_0x2bd552[_0x184f('0x32')][_0x184f('0x38')]));_0x21c00b[_0x184f('0x36')]=_0x21c00b[_0x184f('0x36')][_0x184f('0x39')]?_0x21c00b[_0x184f('0x36')]:_0x1fa8a3[_0x184f('0x37')];if(_0x2bd552[_0x184f('0x32')][_0x184f('0x45')]){_0x21c00b[_0x184f('0x46')]=[{'all':!![]}];}_0x21c00b=_[_0x184f('0x42')]({},_0x21c00b,_0x2bd552[_0x184f('0x43')]);return db[_0x184f('0x44')]['find'](_0x21c00b)[_0x184f('0x25')](handleEntityNotFound(_0x1bf2a4,null))['then'](function(_0x3db867){if(_0x3db867){var _0x1d5835=_0x3db867['get']({'plain':!![]});_0x1d5835=qs[_0x184f('0x57')](_0x1d5835,['id',_0x184f('0x58'),_0x184f('0x59')]);_0x2bd552[_0x184f('0x4d')]=_[_0x184f('0x57')](_0x2bd552[_0x184f('0x4d')],['id',_0x184f('0x58'),_0x184f('0x59')]);return db[_0x184f('0x44')][_0x184f('0x4c')](_['merge'](_0x1d5835,_0x2bd552[_0x184f('0x4d')]),{'include':_0x2bd552[_0x184f('0x32')][_0x184f('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0xbf3a61){var _0x5ba389=_0x2bd552[_0x184f('0x4e')][_0x184f('0x27')]({'plain':!![]});if(!_0x5ba389)throw new Error(_0x184f('0x4f'));if(_0x5ba389[_0x184f('0x50')]===_0x184f('0x4e')){var _0x221810=_0xbf3a61['get']({'plain':!![]});var _0x511f07='IvrCampaigns';return db[_0x184f('0x52')][_0x184f('0x4b')]({'where':{'name':_0x511f07,'userProfileId':_0x5ba389[_0x184f('0x53')]},'raw':!![]})[_0x184f('0x25')](function(_0x29e14e){if(_0x29e14e&&_0x29e14e[_0x184f('0x54')]===0x0){return db[_0x184f('0x28')][_0x184f('0x4c')]({'name':_0x221810[_0x184f('0x2c')],'resourceId':_0x221810['id'],'type':_0x29e14e['name'],'sectionId':_0x29e14e['id']},{})[_0x184f('0x25')](function(){return _0xbf3a61;});}else{return _0xbf3a61;}})['catch'](function(_0x4c4fd6){logger[_0x184f('0x2a')](_0x184f('0x55'),_0x4c4fd6);throw _0x4c4fd6;});}return _0xbf3a61;});}})[_0x184f('0x25')](respondWithResult(_0x1bf2a4,0xc9))[_0x184f('0x48')](handleError(_0x1bf2a4,null));};exports[_0x184f('0x5a')]=function(_0x47cf48,_0x2a750a){if(_0x47cf48[_0x184f('0x4d')]['id']){delete _0x47cf48[_0x184f('0x4d')]['id'];}return db[_0x184f('0x44')][_0x184f('0x4b')]({'where':{'id':_0x47cf48['params']['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x2a750a,null))[_0x184f('0x25')](saveUpdates(_0x47cf48['body'],null))['then'](respondWithResult(_0x2a750a,null))[_0x184f('0x48')](handleError(_0x2a750a,null));};exports[_0x184f('0x26')]=function(_0x443c46,_0x7c744f){return db['Campaign'][_0x184f('0x4b')]({'where':{'id':_0x443c46[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x7c744f,null))['then'](removeEntity(_0x7c744f,null))[_0x184f('0x48')](handleError(_0x7c744f,null));};exports['getHoppers']=function(_0x5a7481,_0x3c1d43,_0x535741){var _0x1892b2={'raw':!![],'where':{}};var _0x54f15b={};var _0x16d88b={'count':0x0,'rows':[]};return db['Campaign'][_0x184f('0x5b')]({'where':{'id':_0x5a7481[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x3c1d43,null))[_0x184f('0x25')](function(_0x180e74){if(_0x180e74){_0x54f15b[_0x184f('0x37')]=_[_0x184f('0x33')](db[_0x184f('0x5c')]['rawAttributes']);_0x54f15b['query']=_['keys'](_0x5a7481['query']);_0x54f15b[_0x184f('0x34')]=_[_0x184f('0x35')](_0x54f15b[_0x184f('0x37')],_0x54f15b['query']);_0x1892b2[_0x184f('0x36')]=_[_0x184f('0x35')](_0x54f15b['model'],qs[_0x184f('0x38')](_0x5a7481[_0x184f('0x32')]['fields']));_0x1892b2[_0x184f('0x36')]=_0x1892b2[_0x184f('0x36')]['length']?_0x1892b2['attributes']:_0x54f15b[_0x184f('0x37')];if(!_0x5a7481[_0x184f('0x32')]['hasOwnProperty'](_0x184f('0x3b'))){_0x1892b2[_0x184f('0x1e')]=qs['limit'](_0x5a7481[_0x184f('0x32')][_0x184f('0x1e')]);_0x1892b2[_0x184f('0x1c')]=qs[_0x184f('0x1c')](_0x5a7481['query'][_0x184f('0x1c')]);}_0x1892b2[_0x184f('0x5d')]=qs[_0x184f('0x3c')](_0x5a7481['query'][_0x184f('0x3c')]);_0x1892b2[_0x184f('0x3d')]=qs[_0x184f('0x34')](_[_0x184f('0x3e')](_0x5a7481[_0x184f('0x32')],_0x54f15b[_0x184f('0x34')]));_0x1892b2[_0x184f('0x3d')][_0x184f('0x5e')]=_0x180e74['id'];if(_0x5a7481[_0x184f('0x32')]['filter']){_0x1892b2[_0x184f('0x3d')]=_['merge'](_0x1892b2[_0x184f('0x3d')],{'$or':_[_0x184f('0x31')](_0x1892b2[_0x184f('0x36')],function(_0x32b265){var _0x526a1e={};_0x526a1e[_0x32b265]={'$like':'%'+_0x5a7481[_0x184f('0x32')][_0x184f('0x3f')]+'%'};return _0x526a1e;})});}_0x1892b2=_[_0x184f('0x42')]({},_0x1892b2,_0x5a7481[_0x184f('0x43')]);return db[_0x184f('0x5c')][_0x184f('0x1f')]({'where':_0x1892b2['where']})[_0x184f('0x25')](function(_0x303b69){_0x16d88b[_0x184f('0x1f')]=_0x303b69;if(_0x5a7481[_0x184f('0x32')][_0x184f('0x45')]){_0x1892b2[_0x184f('0x46')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x1892b2);})[_0x184f('0x25')](function(_0x257a1d){_0x16d88b[_0x184f('0x5f')]=_0x257a1d;return _0x16d88b;});}})[_0x184f('0x25')](respondWithFilteredResult(_0x3c1d43,_0x1892b2))[_0x184f('0x48')](handleError(_0x3c1d43,null));};exports[_0x184f('0x60')]=function(_0xadcafd,_0xf30057,_0x585542){var _0x5eb810={'raw':!![],'where':{}};var _0x3892c0={};var _0x2f23c0={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xadcafd[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0xf30057,null))['then'](function(_0xefadb3){if(_0xefadb3){_0x3892c0[_0x184f('0x37')]=_[_0x184f('0x33')](db[_0x184f('0x61')][_0x184f('0x2f')]);_0x3892c0[_0x184f('0x32')]=_[_0x184f('0x33')](_0xadcafd[_0x184f('0x32')]);_0x3892c0[_0x184f('0x34')]=_[_0x184f('0x35')](_0x3892c0[_0x184f('0x37')],_0x3892c0['query']);_0x5eb810[_0x184f('0x36')]=_[_0x184f('0x35')](_0x3892c0[_0x184f('0x37')],qs[_0x184f('0x38')](_0xadcafd[_0x184f('0x32')][_0x184f('0x38')]));_0x5eb810[_0x184f('0x36')]=_0x5eb810['attributes'][_0x184f('0x39')]?_0x5eb810[_0x184f('0x36')]:_0x3892c0[_0x184f('0x37')];if(!_0xadcafd[_0x184f('0x32')][_0x184f('0x3a')](_0x184f('0x3b'))){_0x5eb810[_0x184f('0x1e')]=qs[_0x184f('0x1e')](_0xadcafd[_0x184f('0x32')][_0x184f('0x1e')]);_0x5eb810['offset']=qs[_0x184f('0x1c')](_0xadcafd[_0x184f('0x32')]['offset']);}_0x5eb810[_0x184f('0x5d')]=qs[_0x184f('0x3c')](_0xadcafd[_0x184f('0x32')][_0x184f('0x3c')]);_0x5eb810[_0x184f('0x3d')]=qs[_0x184f('0x34')](_[_0x184f('0x3e')](_0xadcafd['query'],_0x3892c0['filters']));_0x5eb810[_0x184f('0x3d')]['CampaignId']=_0xefadb3['id'];if(_0xadcafd[_0x184f('0x32')][_0x184f('0x3f')]){_0x5eb810[_0x184f('0x3d')]=_[_0x184f('0x42')](_0x5eb810[_0x184f('0x3d')],{'$or':_[_0x184f('0x31')](_0x5eb810[_0x184f('0x36')],function(_0x144e90){var _0x494597={};_0x494597[_0x144e90]={'$like':'%'+_0xadcafd[_0x184f('0x32')][_0x184f('0x3f')]+'%'};return _0x494597;})});}_0x5eb810=_[_0x184f('0x42')]({},_0x5eb810,_0xadcafd[_0x184f('0x43')]);return db[_0x184f('0x61')][_0x184f('0x1f')]({'where':_0x5eb810[_0x184f('0x3d')]})[_0x184f('0x25')](function(_0x1b3de8){_0x2f23c0[_0x184f('0x1f')]=_0x1b3de8;if(_0xadcafd['query'][_0x184f('0x45')]){_0x5eb810[_0x184f('0x46')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x184f('0x47')](_0x5eb810);})['then'](function(_0x403166){_0x2f23c0[_0x184f('0x5f')]=_0x403166;return _0x2f23c0;});}})[_0x184f('0x25')](respondWithFilteredResult(_0xf30057,_0x5eb810))['catch'](handleError(_0xf30057,null));};exports[_0x184f('0x62')]=function(_0xdf67ff,_0x78617f,_0x2890c2){var _0x22d888={'raw':!![],'where':{}};var _0x54444e={};var _0x639f90={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xdf67ff[_0x184f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x78617f,null))['then'](function(_0x39e609){if(_0x39e609){_0x54444e[_0x184f('0x37')]=_['keys'](db['CmHopperFinal'][_0x184f('0x2f')]);_0x54444e[_0x184f('0x32')]=_[_0x184f('0x33')](_0xdf67ff[_0x184f('0x32')]);_0x54444e[_0x184f('0x34')]=_[_0x184f('0x35')](_0x54444e[_0x184f('0x37')],_0x54444e['query']);_0x22d888[_0x184f('0x36')]=_[_0x184f('0x35')](_0x54444e[_0x184f('0x37')],qs[_0x184f('0x38')](_0xdf67ff[_0x184f('0x32')][_0x184f('0x38')]));_0x22d888[_0x184f('0x36')]=_0x22d888[_0x184f('0x36')]['length']?_0x22d888[_0x184f('0x36')]:_0x54444e[_0x184f('0x37')];if(!_0xdf67ff[_0x184f('0x32')][_0x184f('0x3a')](_0x184f('0x3b'))){_0x22d888[_0x184f('0x1e')]=qs['limit'](_0xdf67ff['query']['limit']);_0x22d888[_0x184f('0x1c')]=qs['offset'](_0xdf67ff['query'][_0x184f('0x1c')]);}_0x22d888[_0x184f('0x5d')]=qs[_0x184f('0x3c')](_0xdf67ff[_0x184f('0x32')]['sort']);_0x22d888[_0x184f('0x3d')]=qs[_0x184f('0x34')](_[_0x184f('0x3e')](_0xdf67ff[_0x184f('0x32')],_0x54444e[_0x184f('0x34')]));_0x22d888[_0x184f('0x3d')][_0x184f('0x5e')]=_0x39e609['id'];if(_0xdf67ff[_0x184f('0x32')][_0x184f('0x3f')]){_0x22d888['where']=_[_0x184f('0x42')](_0x22d888[_0x184f('0x3d')],{'$or':_['map'](_0x22d888['attributes'],function(_0x17860a){var _0x28960f={};_0x28960f[_0x17860a]={'$like':'%'+_0xdf67ff['query'][_0x184f('0x3f')]+'%'};return _0x28960f;})});}_0x22d888=_[_0x184f('0x42')]({},_0x22d888,_0xdf67ff[_0x184f('0x43')]);return db[_0x184f('0x63')][_0x184f('0x1f')]({'where':_0x22d888[_0x184f('0x3d')]})[_0x184f('0x25')](function(_0x403c2d){_0x639f90[_0x184f('0x1f')]=_0x403c2d;if(_0xdf67ff['query'][_0x184f('0x45')]){_0x22d888[_0x184f('0x46')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x184f('0x47')](_0x22d888);})[_0x184f('0x25')](function(_0x238287){_0x639f90[_0x184f('0x5f')]=_0x238287;return _0x639f90;});}})[_0x184f('0x25')](respondWithFilteredResult(_0x78617f,_0x22d888))[_0x184f('0x48')](handleError(_0x78617f,null));};exports['getHopperBlacks']=function(_0x63cad5,_0x3f68ee,_0x260a9a){var _0x43b70a={'raw':!![],'where':{}};var _0x291b4f={};var _0x26d1fe={'count':0x0,'rows':[]};return db[_0x184f('0x44')][_0x184f('0x5b')]({'where':{'id':_0x63cad5[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x3f68ee,null))[_0x184f('0x25')](function(_0x20072c){if(_0x20072c){_0x291b4f[_0x184f('0x37')]=_['keys'](db[_0x184f('0x64')][_0x184f('0x2f')]);_0x291b4f[_0x184f('0x32')]=_['keys'](_0x63cad5[_0x184f('0x32')]);_0x291b4f[_0x184f('0x34')]=_[_0x184f('0x35')](_0x291b4f[_0x184f('0x37')],_0x291b4f[_0x184f('0x32')]);_0x43b70a[_0x184f('0x36')]=_[_0x184f('0x35')](_0x291b4f['model'],qs[_0x184f('0x38')](_0x63cad5[_0x184f('0x32')][_0x184f('0x38')]));_0x43b70a[_0x184f('0x36')]=_0x43b70a[_0x184f('0x36')]['length']?_0x43b70a[_0x184f('0x36')]:_0x291b4f[_0x184f('0x37')];if(!_0x63cad5['query'][_0x184f('0x3a')](_0x184f('0x3b'))){_0x43b70a[_0x184f('0x1e')]=qs['limit'](_0x63cad5['query'][_0x184f('0x1e')]);_0x43b70a[_0x184f('0x1c')]=qs[_0x184f('0x1c')](_0x63cad5[_0x184f('0x32')][_0x184f('0x1c')]);}_0x43b70a['order']=qs[_0x184f('0x3c')](_0x63cad5[_0x184f('0x32')]['sort']);_0x43b70a['where']=qs['filters'](_[_0x184f('0x3e')](_0x63cad5[_0x184f('0x32')],_0x291b4f[_0x184f('0x34')]));_0x43b70a[_0x184f('0x3d')][_0x184f('0x5e')]=_0x20072c['id'];if(_0x63cad5[_0x184f('0x32')][_0x184f('0x3f')]){_0x43b70a[_0x184f('0x3d')]=_[_0x184f('0x42')](_0x43b70a[_0x184f('0x3d')],{'$or':_['map'](_0x43b70a[_0x184f('0x36')],function(_0x47340f){var _0x4b47fc={};_0x4b47fc[_0x47340f]={'$like':'%'+_0x63cad5[_0x184f('0x32')][_0x184f('0x3f')]+'%'};return _0x4b47fc;})});}_0x43b70a=_[_0x184f('0x42')]({},_0x43b70a,_0x63cad5[_0x184f('0x43')]);return db[_0x184f('0x64')][_0x184f('0x1f')]({'where':_0x43b70a[_0x184f('0x3d')]})[_0x184f('0x25')](function(_0xf5d341){_0x26d1fe[_0x184f('0x1f')]=_0xf5d341;if(_0x63cad5['query'][_0x184f('0x45')]){_0x43b70a[_0x184f('0x46')]=[{'all':!![]}];}return db[_0x184f('0x64')][_0x184f('0x47')](_0x43b70a);})['then'](function(_0x1cdc50){_0x26d1fe[_0x184f('0x5f')]=_0x1cdc50;return _0x26d1fe;});}})[_0x184f('0x25')](respondWithFilteredResult(_0x3f68ee,_0x43b70a))[_0x184f('0x48')](handleError(_0x3f68ee,null));};exports[_0x184f('0x65')]=function(_0x9a49ad,_0xc6a9a2,_0xec2894){var _0x2ae7a9={};var _0x2af28b={};var _0xd42d9d;var _0x5dc8f1;return db[_0x184f('0x44')][_0x184f('0x5b')]({'where':{'id':_0x9a49ad[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0xc6a9a2,null))[_0x184f('0x25')](function(_0x1d4385){if(_0x1d4385){_0xd42d9d=_0x1d4385;_0x2af28b['model']=_['keys'](db[_0x184f('0x66')]['rawAttributes']);_0x2af28b[_0x184f('0x32')]=_[_0x184f('0x33')](_0x9a49ad[_0x184f('0x32')]);_0x2af28b[_0x184f('0x34')]=_[_0x184f('0x35')](_0x2af28b['model'],_0x2af28b['query']);_0x2ae7a9[_0x184f('0x36')]=_[_0x184f('0x35')](_0x2af28b['model'],qs[_0x184f('0x38')](_0x9a49ad['query'][_0x184f('0x38')]));_0x2ae7a9['attributes']=_0x2ae7a9[_0x184f('0x36')]['length']?_0x2ae7a9['attributes']:_0x2af28b['model'];_0x2ae7a9[_0x184f('0x5d')]=qs[_0x184f('0x3c')](_0x9a49ad['query'][_0x184f('0x3c')]);_0x2ae7a9['where']=qs['filters'](_[_0x184f('0x3e')](_0x9a49ad[_0x184f('0x32')],_0x2af28b[_0x184f('0x34')]));if(_0x9a49ad[_0x184f('0x32')][_0x184f('0x3f')]){_0x2ae7a9[_0x184f('0x3d')]=_[_0x184f('0x42')](_0x2ae7a9[_0x184f('0x3d')],{'$or':_['map'](_0x2ae7a9[_0x184f('0x36')],function(_0x312800){var _0x558678={};_0x558678[_0x312800]={'$like':'%'+_0x9a49ad[_0x184f('0x32')][_0x184f('0x3f')]+'%'};return _0x558678;})});}_0x2ae7a9=_[_0x184f('0x42')]({},_0x2ae7a9,_0x9a49ad[_0x184f('0x43')]);return _0xd42d9d[_0x184f('0x65')](_0x2ae7a9);}})[_0x184f('0x25')](function(_0x20230c){if(_0x20230c){_0x5dc8f1=_0x20230c[_0x184f('0x39')];if(!_0x9a49ad[_0x184f('0x32')][_0x184f('0x3a')]('nolimit')){_0x2ae7a9[_0x184f('0x1e')]=qs[_0x184f('0x1e')](_0x9a49ad[_0x184f('0x32')][_0x184f('0x1e')]);_0x2ae7a9[_0x184f('0x1c')]=qs[_0x184f('0x1c')](_0x9a49ad[_0x184f('0x32')][_0x184f('0x1c')]);}return _0xd42d9d[_0x184f('0x65')](_0x2ae7a9);}})[_0x184f('0x25')](function(_0x59b6b0){if(_0x59b6b0){return _0x59b6b0?{'count':_0x5dc8f1,'rows':_0x59b6b0}:null;}})['then'](respondWithResult(_0xc6a9a2,null))['catch'](handleError(_0xc6a9a2,null));};exports['addLists']=function(_0x5adf5e,_0x2fd956,_0x59b8cf){var _0x23227b,_0x20ce77;return db[_0x184f('0x44')][_0x184f('0x4b')]({'where':{'id':_0x5adf5e[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x2fd956,null))[_0x184f('0x25')](function(_0x27f1f7){if(_0x27f1f7){_0x20ce77=_0x27f1f7;return _0x27f1f7[_0x184f('0x67')](_0x5adf5e[_0x184f('0x4d')][_0x184f('0x68')],_[_0x184f('0x57')](_0x5adf5e[_0x184f('0x4d')],[_0x184f('0x68'),'id'])||{});}return null;})[_0x184f('0x69')](function(_0x140cd6){var _0x4587d5;_0x23227b=_0x140cd6||[];var _0xe7ad5b=[];if(_0x140cd6){for(var _0x49f0a1=0x0;_0x49f0a1<_0x140cd6['length'];_0x49f0a1+=0x1){var _0x5baf04=_0x140cd6[_0x49f0a1][_0x184f('0x27')]({'plain':!![]});_0x20ce77['dialCheckDuplicateType']=_0x5adf5e['body'][_0x184f('0x6a')]?_0x5adf5e[_0x184f('0x4d')][_0x184f('0x6a')]:_0x20ce77[_0x184f('0x6a')];switch(_0x20ce77[_0x184f('0x6a')]){case _0x184f('0x6b'):_0x4587d5=squel[_0x184f('0x6c')]()[_0x184f('0x6d')](_0x184f('0x6e'))[_0x184f('0x6f')]([_0x184f('0x70'),_0x184f('0x71'),_0x184f('0x72'),_0x184f('0x73'),'CampaignId',_0x184f('0x58'),_0x184f('0x59')],squel[_0x184f('0x74')]()[_0x184f('0x75')](_0x184f('0x70'),_0x184f('0x70'))[_0x184f('0x75')]('NOW()','scheduledAt')[_0x184f('0x75')]('id',_0x184f('0x72'))[_0x184f('0x75')](_0x5baf04[_0x184f('0x76')][_0x184f('0x77')](),_0x184f('0x73'))[_0x184f('0x75')](_0x5adf5e[_0x184f('0x4a')]['id'][_0x184f('0x77')](),_0x184f('0x5e'))['field'](_0x184f('0x78'),'createdAt')['field'](_0x184f('0x78'),_0x184f('0x59'))[_0x184f('0x79')](_0x184f('0x7a'))[_0x184f('0x3d')]('deletedAt\x20IS\x20NULL')[_0x184f('0x3d')](_0x184f('0x7b'),_0x5baf04[_0x184f('0x76')]['toString']())['where'](_0x184f('0x7c'))[_0x184f('0x3d')](_0x184f('0x7d'),squel[_0x184f('0x74')]()[_0x184f('0x75')](_0x184f('0x7e'))[_0x184f('0x79')](_0x184f('0x7f'))['where'](_0x184f('0x80'),_0x5adf5e[_0x184f('0x4a')]['id'][_0x184f('0x77')]()))[_0x184f('0x3d')](_0x184f('0x7d'),squel[_0x184f('0x74')]()['field']('COALESCE(phone,\x27\x27)')[_0x184f('0x79')]('cm_hopper')[_0x184f('0x3d')](_0x184f('0x80'),_0x5adf5e['params']['id'][_0x184f('0x77')]())))[_0x184f('0x77')]();break;case'onlyIfOpen':_0x4587d5=squel['insert']()['into'](_0x184f('0x6e'))[_0x184f('0x6f')]([_0x184f('0x70'),_0x184f('0x71'),'ContactId',_0x184f('0x73'),'CampaignId',_0x184f('0x58'),_0x184f('0x59')],squel[_0x184f('0x74')]()['field'](_0x184f('0x70'),_0x184f('0x70'))[_0x184f('0x75')](_0x184f('0x78'),_0x184f('0x71'))[_0x184f('0x75')]('id',_0x184f('0x72'))[_0x184f('0x75')](_0x5baf04[_0x184f('0x76')][_0x184f('0x77')](),_0x184f('0x73'))[_0x184f('0x75')](_0x5adf5e[_0x184f('0x4a')]['id'][_0x184f('0x77')](),_0x184f('0x5e'))[_0x184f('0x75')](_0x184f('0x78'),_0x184f('0x58'))[_0x184f('0x75')](_0x184f('0x78'),_0x184f('0x59'))[_0x184f('0x79')]('cm_contacts')[_0x184f('0x3d')](_0x184f('0x81'))[_0x184f('0x3d')]('ListId\x20=\x20?',_0x5baf04[_0x184f('0x76')]['toString']())[_0x184f('0x3d')](_0x184f('0x7c'))[_0x184f('0x3d')](_0x184f('0x7d'),squel[_0x184f('0x74')]()['field']('COALESCE(phone,\x27\x27)')[_0x184f('0x79')](_0x184f('0x6e'))[_0x184f('0x3d')]('CampaignId\x20=\x20?',_0x5adf5e[_0x184f('0x4a')]['id']['toString']())))['toString']();break;default:_0x4587d5=squel['insert']()[_0x184f('0x6d')]('cm_hopper')[_0x184f('0x6f')]([_0x184f('0x70'),_0x184f('0x71'),_0x184f('0x72'),'ListId',_0x184f('0x5e'),_0x184f('0x58'),_0x184f('0x59')],squel[_0x184f('0x74')]()[_0x184f('0x75')](_0x184f('0x70'),'phone')[_0x184f('0x75')](_0x184f('0x78'),_0x184f('0x71'))[_0x184f('0x75')]('id',_0x184f('0x72'))['field'](_0x5baf04[_0x184f('0x76')]['toString'](),_0x184f('0x73'))[_0x184f('0x75')](_0x5adf5e[_0x184f('0x4a')]['id']['toString'](),_0x184f('0x5e'))[_0x184f('0x75')](_0x184f('0x78'),_0x184f('0x58'))[_0x184f('0x75')](_0x184f('0x78'),'updatedAt')[_0x184f('0x79')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x184f('0x3d')](_0x184f('0x7b'),_0x5baf04[_0x184f('0x76')][_0x184f('0x77')]())[_0x184f('0x3d')](_0x184f('0x7c')))[_0x184f('0x77')]();}_0xe7ad5b['push'](db['sequelize'][_0x184f('0x32')](_0x4587d5));}return BPromise['all'](_0xe7ad5b);}})[_0x184f('0x25')](function(){return _0x23227b;})[_0x184f('0x25')](respondWithResult(_0x2fd956,null))[_0x184f('0x48')](handleError(_0x2fd956,null));};exports['removeLists']=function(_0x3a46fb,_0x11953a,_0x247f94){return db[_0x184f('0x44')][_0x184f('0x4b')]({'where':{'id':_0x3a46fb[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x11953a,null))[_0x184f('0x25')](function(_0xb792b5){if(_0xb792b5){return _0xb792b5[_0x184f('0x82')](_0x3a46fb[_0x184f('0x32')]['ids']);}})[_0x184f('0x25')](function(_0x1cc8db){if(_0x1cc8db){return db[_0x184f('0x5c')][_0x184f('0x26')]({'where':{'ListId':_0x3a46fb[_0x184f('0x32')]['ids'],'CampaignId':_0x3a46fb[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](function(){return _0x1cc8db;});}})['then'](respondWithStatusCode(_0x11953a,null))[_0x184f('0x48')](handleError(_0x11953a,null));};exports['getBlackLists']=function(_0x2aa293,_0x3d4b41,_0x3ce237){var _0x584caf={};var _0x345098={};var _0x2164d2;var _0x5e834a;return db[_0x184f('0x44')][_0x184f('0x5b')]({'where':{'id':_0x2aa293[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x3d4b41,null))[_0x184f('0x25')](function(_0x5ae188){if(_0x5ae188){_0x2164d2=_0x5ae188;_0x345098['model']=_[_0x184f('0x33')](db[_0x184f('0x66')]['rawAttributes']);_0x345098[_0x184f('0x32')]=_[_0x184f('0x33')](_0x2aa293[_0x184f('0x32')]);_0x345098[_0x184f('0x34')]=_[_0x184f('0x35')](_0x345098['model'],_0x345098[_0x184f('0x32')]);_0x584caf[_0x184f('0x36')]=_[_0x184f('0x35')](_0x345098[_0x184f('0x37')],qs[_0x184f('0x38')](_0x2aa293['query'][_0x184f('0x38')]));_0x584caf[_0x184f('0x36')]=_0x584caf['attributes'][_0x184f('0x39')]?_0x584caf[_0x184f('0x36')]:_0x345098[_0x184f('0x37')];_0x584caf[_0x184f('0x5d')]=qs[_0x184f('0x3c')](_0x2aa293[_0x184f('0x32')][_0x184f('0x3c')]);_0x584caf[_0x184f('0x3d')]=qs[_0x184f('0x34')](_['pick'](_0x2aa293[_0x184f('0x32')],_0x345098[_0x184f('0x34')]));if(_0x2aa293['query'][_0x184f('0x3f')]){_0x584caf['where']=_['merge'](_0x584caf[_0x184f('0x3d')],{'$or':_[_0x184f('0x31')](_0x584caf['attributes'],function(_0x67bf2a){var _0x1a4dfb={};_0x1a4dfb[_0x67bf2a]={'$like':'%'+_0x2aa293[_0x184f('0x32')][_0x184f('0x3f')]+'%'};return _0x1a4dfb;})});}_0x584caf=_['merge']({},_0x584caf,_0x2aa293['options']);return _0x2164d2[_0x184f('0x83')](_0x584caf);}})[_0x184f('0x25')](function(_0x5d8e1f){if(_0x5d8e1f){_0x5e834a=_0x5d8e1f[_0x184f('0x39')];if(!_0x2aa293[_0x184f('0x32')][_0x184f('0x3a')](_0x184f('0x3b'))){_0x584caf[_0x184f('0x1e')]=qs['limit'](_0x2aa293['query'][_0x184f('0x1e')]);_0x584caf['offset']=qs[_0x184f('0x1c')](_0x2aa293[_0x184f('0x32')][_0x184f('0x1c')]);}return _0x2164d2[_0x184f('0x83')](_0x584caf);}})[_0x184f('0x25')](function(_0x13ad88){if(_0x13ad88){return _0x13ad88?{'count':_0x5e834a,'rows':_0x13ad88}:null;}})[_0x184f('0x25')](respondWithResult(_0x3d4b41,null))[_0x184f('0x48')](handleError(_0x3d4b41,null));};exports['addBlackLists']=function(_0x464371,_0x5797da,_0x59baf5){var _0x462814,_0x5d0003;return db['Campaign'][_0x184f('0x4b')]({'where':{'id':_0x464371[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x5797da,null))['then'](function(_0x256785){if(_0x256785){_0x5d0003=_0x256785;return _0x256785[_0x184f('0x84')](_0x464371['body']['ids'],_['omit'](_0x464371[_0x184f('0x4d')],['ids','id'])||{});}return null;})[_0x184f('0x69')](function(_0x52258f){var _0x550943;_0x462814=_0x52258f||[];var _0x4db14b=[];if(_0x52258f){for(var _0x2e24d9=0x0;_0x2e24d9<_0x52258f[_0x184f('0x39')];_0x2e24d9+=0x1){var _0x493bd3=_0x52258f[_0x2e24d9][_0x184f('0x27')]({'plain':!![]});_0x550943=squel[_0x184f('0x6c')]()['into'](_0x184f('0x85'))[_0x184f('0x6f')](['phone','ContactId','ListId',_0x184f('0x5e'),_0x184f('0x58'),_0x184f('0x59')],squel['select']()['field']('phone','phone')[_0x184f('0x75')]('id',_0x184f('0x72'))[_0x184f('0x75')](_0x493bd3[_0x184f('0x76')]['toString'](),_0x184f('0x73'))['field'](_0x464371[_0x184f('0x4a')]['id']['toString'](),'CampaignId')[_0x184f('0x75')](_0x184f('0x78'),'createdAt')[_0x184f('0x75')](_0x184f('0x78'),_0x184f('0x59'))[_0x184f('0x79')]('cm_contacts')[_0x184f('0x3d')](_0x184f('0x81'))[_0x184f('0x3d')](_0x184f('0x7b'),_0x493bd3[_0x184f('0x76')][_0x184f('0x77')]())[_0x184f('0x3d')](_0x184f('0x7c')))[_0x184f('0x77')]();_0x4db14b[_0x184f('0x86')](db['sequelize'][_0x184f('0x32')](_0x550943));}return BPromise[_0x184f('0x87')](_0x4db14b);}})[_0x184f('0x25')](function(){return _0x462814;})[_0x184f('0x25')](respondWithResult(_0x5797da,null))[_0x184f('0x48')](handleError(_0x5797da,null));};exports[_0x184f('0x88')]=function(_0x10714a,_0x21de9e,_0x5b07a2){return db[_0x184f('0x44')][_0x184f('0x4b')]({'where':{'id':_0x10714a[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x21de9e,null))[_0x184f('0x25')](function(_0x2c4834){if(_0x2c4834){return _0x2c4834[_0x184f('0x88')](_0x10714a[_0x184f('0x32')][_0x184f('0x68')]);}})['then'](function(_0x31a8d4){if(_0x31a8d4){return db[_0x184f('0x64')][_0x184f('0x26')]({'where':{'ListId':_0x10714a[_0x184f('0x32')][_0x184f('0x68')],'CampaignId':_0x10714a[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](function(){return _0x31a8d4;});}})['then'](respondWithStatusCode(_0x21de9e,null))[_0x184f('0x48')](handleError(_0x21de9e,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 1713365..64f6013 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x7371d,_0x5d145a){var _0x238e70=function(_0x46b5e2){while(--_0x46b5e2){_0x7371d['push'](_0x7371d['shift']());}};_0x238e70(++_0x5d145a);}(_0x7a54,0x106));var _0x47a5=function(_0x44c691,_0x15daf2){_0x44c691=_0x44c691-0x0;var _0x4996ff=_0x7a54[_0x44c691];return _0x4996ff;};'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 dc9286b..90c3190 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 _0x0834=['attributes','limit','map','model','include','GetCampaign','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0834,0x18e));var _0x4083=function(_0x2ef8ad,_0x1d81cd){_0x2ef8ad=_0x2ef8ad-0x0;var _0x4fec0a=_0x0834[_0x2ef8ad];return _0x4fec0a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4083('0x0'));var BPromise=require(_0x4083('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4083('0x2'));var logger=require(_0x4083('0x3'))('rpc');var config=require(_0x4083('0x4'));var jayson=require(_0x4083('0x5'));var client=jayson['client'][_0x4083('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5c5a54,_0x31c7ef,_0x26ed53){return new BPromise(function(_0x2c42bb,_0x1d56dd){return client[_0x4083('0x7')](_0x5c5a54,_0x26ed53)[_0x4083('0x8')](function(_0x3cee37){logger[_0x4083('0x9')](_0x4083('0xa'),_0x31c7ef,_0x4083('0xb'));logger[_0x4083('0xc')](_0x4083('0xd'),_0x31c7ef,_0x4083('0xb'),JSON[_0x4083('0xe')](_0x3cee37));if(_0x3cee37[_0x4083('0xf')]){if(_0x3cee37['error']['code']===0x1f4){logger[_0x4083('0xf')](_0x4083('0xa'),_0x31c7ef,_0x3cee37['error'][_0x4083('0x10')]);return _0x1d56dd(_0x3cee37[_0x4083('0xf')][_0x4083('0x10')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x31c7ef,_0x3cee37[_0x4083('0xf')][_0x4083('0x10')]);return _0x2c42bb(_0x3cee37['error'][_0x4083('0x10')]);}else{logger[_0x4083('0x9')](_0x4083('0xa'),_0x31c7ef,_0x4083('0xb'));_0x2c42bb(_0x3cee37[_0x4083('0x11')]['message']);}})[_0x4083('0x12')](function(_0x10cadd){logger[_0x4083('0xf')](_0x4083('0xa'),_0x31c7ef,_0x10cadd);_0x1d56dd(_0x10cadd);});});}exports['GetCampaign']=function(_0x4e7d59){var _0x4d6089=this;return new Promise(function(_0xafda0c,_0x53d525){return db['Campaign'][_0x4083('0x13')]({'raw':_0x4e7d59['options']?_0x4e7d59[_0x4083('0x14')][_0x4083('0x15')]===undefined?!![]:![]:!![],'where':_0x4e7d59[_0x4083('0x14')]?_0x4e7d59[_0x4083('0x14')]['where']||null:null,'attributes':_0x4e7d59[_0x4083('0x14')]?_0x4e7d59['options'][_0x4083('0x16')]||null:null,'limit':_0x4e7d59[_0x4083('0x14')]?_0x4e7d59[_0x4083('0x14')][_0x4083('0x17')]||null:null,'include':_0x4e7d59['options']?_0x4e7d59[_0x4083('0x14')]['include']?_[_0x4083('0x18')](_0x4e7d59[_0x4083('0x14')]['include'],function(_0x52a440){return{'model':db[_0x52a440[_0x4083('0x19')]],'as':_0x52a440['as'],'attributes':_0x52a440['attributes'],'include':_0x52a440['include']?_['map'](_0x52a440[_0x4083('0x1a')],function(_0xb2fbb5){return{'model':db[_0xb2fbb5[_0x4083('0x19')]],'as':_0xb2fbb5['as'],'attributes':_0xb2fbb5['attributes'],'include':_0xb2fbb5[_0x4083('0x1a')]?_[_0x4083('0x18')](_0xb2fbb5[_0x4083('0x1a')],function(_0x552534){return{'model':db[_0x552534[_0x4083('0x19')]],'as':_0x552534['as'],'attributes':_0x552534[_0x4083('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x315458){logger[_0x4083('0x9')](_0x4083('0x1b'),_0x4e7d59);logger[_0x4083('0xc')](_0x4083('0x1b'),_0x4e7d59,JSON[_0x4083('0xe')](_0x315458));_0xafda0c(_0x315458);})[_0x4083('0x12')](function(_0x1534e9){logger[_0x4083('0xf')]('GetCampaign',_0x1534e9['message'],_0x4e7d59);_0x53d525(_0x4d6089[_0x4083('0xf')](0x1f4,_0x1534e9[_0x4083('0x10')]));});});}; \ No newline at end of file +var _0xee53=['error','code','message','GetCampaign','Campaign','findAll','options','where','include','map','model','attributes','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x316acc,_0x1578dd){var _0x5c4664=function(_0x4eb96b){while(--_0x4eb96b){_0x316acc['push'](_0x316acc['shift']());}};_0x5c4664(++_0x1578dd);}(_0xee53,0xa8));var _0x3ee5=function(_0x50d84b,_0x1d7ea7){_0x50d84b=_0x50d84b-0x0;var _0x6d4270=_0xee53[_0x50d84b];return _0x6d4270;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3ee5('0x0'));var BPromise=require(_0x3ee5('0x1'));var rs=require(_0x3ee5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ee5('0x3'))['db'];var utils=require(_0x3ee5('0x4'));var logger=require(_0x3ee5('0x5'))(_0x3ee5('0x6'));var config=require(_0x3ee5('0x7'));var jayson=require(_0x3ee5('0x8'));var client=jayson[_0x3ee5('0x9')][_0x3ee5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6ff422,_0x2657de,_0x34ebf4){return new BPromise(function(_0x40b821,_0x14d96d){return client['request'](_0x6ff422,_0x34ebf4)[_0x3ee5('0xb')](function(_0xc344f){logger[_0x3ee5('0xc')](_0x3ee5('0xd'),_0x2657de,'request\x20sent');logger[_0x3ee5('0xe')](_0x3ee5('0xf'),_0x2657de,_0x3ee5('0x10'),JSON[_0x3ee5('0x11')](_0xc344f));if(_0xc344f['error']){if(_0xc344f[_0x3ee5('0x12')][_0x3ee5('0x13')]===0x1f4){logger['error'](_0x3ee5('0xd'),_0x2657de,_0xc344f['error'][_0x3ee5('0x14')]);return _0x14d96d(_0xc344f['error']['message']);}logger[_0x3ee5('0x12')](_0x3ee5('0xd'),_0x2657de,_0xc344f[_0x3ee5('0x12')][_0x3ee5('0x14')]);return _0x40b821(_0xc344f[_0x3ee5('0x12')][_0x3ee5('0x14')]);}else{logger[_0x3ee5('0xc')](_0x3ee5('0xd'),_0x2657de,_0x3ee5('0x10'));_0x40b821(_0xc344f['result'][_0x3ee5('0x14')]);}})['catch'](function(_0xab5013){logger[_0x3ee5('0x12')](_0x3ee5('0xd'),_0x2657de,_0xab5013);_0x14d96d(_0xab5013);});});}exports[_0x3ee5('0x15')]=function(_0x3a7356){var _0x19435e=this;return new Promise(function(_0x6a8b6b,_0x4f1b5f){return db[_0x3ee5('0x16')][_0x3ee5('0x17')]({'raw':_0x3a7356[_0x3ee5('0x18')]?_0x3a7356[_0x3ee5('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3a7356[_0x3ee5('0x18')]?_0x3a7356[_0x3ee5('0x18')][_0x3ee5('0x19')]||null:null,'attributes':_0x3a7356[_0x3ee5('0x18')]?_0x3a7356[_0x3ee5('0x18')]['attributes']||null:null,'limit':_0x3a7356[_0x3ee5('0x18')]?_0x3a7356[_0x3ee5('0x18')]['limit']||null:null,'include':_0x3a7356['options']?_0x3a7356[_0x3ee5('0x18')][_0x3ee5('0x1a')]?_[_0x3ee5('0x1b')](_0x3a7356['options'][_0x3ee5('0x1a')],function(_0x4d7114){return{'model':db[_0x4d7114[_0x3ee5('0x1c')]],'as':_0x4d7114['as'],'attributes':_0x4d7114[_0x3ee5('0x1d')],'include':_0x4d7114['include']?_[_0x3ee5('0x1b')](_0x4d7114[_0x3ee5('0x1a')],function(_0x31d980){return{'model':db[_0x31d980[_0x3ee5('0x1c')]],'as':_0x31d980['as'],'attributes':_0x31d980[_0x3ee5('0x1d')],'include':_0x31d980[_0x3ee5('0x1a')]?_[_0x3ee5('0x1b')](_0x31d980[_0x3ee5('0x1a')],function(_0x415f50){return{'model':db[_0x415f50[_0x3ee5('0x1c')]],'as':_0x415f50['as'],'attributes':_0x415f50[_0x3ee5('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f6f4f){logger['info'](_0x3ee5('0x15'),_0x3a7356);logger[_0x3ee5('0xe')](_0x3ee5('0x15'),_0x3a7356,JSON['stringify'](_0x2f6f4f));_0x6a8b6b(_0x2f6f4f);})[_0x3ee5('0x1e')](function(_0x10cd45){logger[_0x3ee5('0x12')](_0x3ee5('0x15'),_0x10cd45['message'],_0x3a7356);_0x4f1b5f(_0x19435e[_0x3ee5('0x12')](0x1f4,_0x10cd45[_0x3ee5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 5d1a891..199c990 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 _0xa93a=['exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getLists','/:id/blacklists','getBlackLists','post','create','clone','/:id/lists','addLists','/:id','delete','removeLists','removeBlackLists'];(function(_0xa1de8d,_0x1399a8){var _0x478b44=function(_0x3c8db7){while(--_0x3c8db7){_0xa1de8d['push'](_0xa1de8d['shift']());}};_0x478b44(++_0x1399a8);}(_0xa93a,0x16c));var _0xaa93=function(_0xc662e0,_0x34bc95){_0xc662e0=_0xc662e0-0x0;var _0x5c7c2c=_0xa93a[_0xc662e0];return _0x5c7c2c;};'use strict';var multer=require(_0xaa93('0x0'));var util=require(_0xaa93('0x1'));var path=require(_0xaa93('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa93('0x3'));var router=express[_0xaa93('0x4')]();var fs_extra=require(_0xaa93('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaa93('0x6'));var config=require(_0xaa93('0x7'));var controller=require(_0xaa93('0x8'));router['get']('/',auth[_0xaa93('0x9')](),controller[_0xaa93('0xa')]);router[_0xaa93('0xb')]('/:id',auth[_0xaa93('0x9')](),controller[_0xaa93('0xc')]);router['get'](_0xaa93('0xd'),auth[_0xaa93('0x9')](),controller[_0xaa93('0xe')]);router['get'](_0xaa93('0xf'),auth['isAuthenticated'](),controller[_0xaa93('0x10')]);router['get'](_0xaa93('0x11'),auth[_0xaa93('0x9')](),controller[_0xaa93('0x12')]);router['get'](_0xaa93('0x13'),auth[_0xaa93('0x9')](),controller['getHopperBlacks']);router[_0xaa93('0xb')]('/:id/lists',auth[_0xaa93('0x9')](),controller[_0xaa93('0x14')]);router[_0xaa93('0xb')](_0xaa93('0x15'),auth[_0xaa93('0x9')](),controller[_0xaa93('0x16')]);router[_0xaa93('0x17')]('/',auth['isAuthenticated'](),controller[_0xaa93('0x18')]);router[_0xaa93('0x17')]('/:id/clone',auth[_0xaa93('0x9')](),controller[_0xaa93('0x19')]);router[_0xaa93('0x17')](_0xaa93('0x1a'),auth[_0xaa93('0x9')](),controller[_0xaa93('0x1b')]);router[_0xaa93('0x17')]('/:id/blacklists',auth[_0xaa93('0x9')](),controller['addBlackLists']);router['put'](_0xaa93('0x1c'),auth[_0xaa93('0x9')](),controller['update']);router[_0xaa93('0x1d')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xaa93('0x1d')](_0xaa93('0x1a'),auth[_0xaa93('0x9')](),controller[_0xaa93('0x1e')]);router[_0xaa93('0x1d')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xaa93('0x1f')]);module[_0xaa93('0x20')]=router; \ No newline at end of file +var _0x0723=['/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','removeLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./campaign.controller','get','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create'];(function(_0x433690,_0x30b411){var _0x11b9a5=function(_0x7fc4ed){while(--_0x7fc4ed){_0x433690['push'](_0x433690['shift']());}};_0x11b9a5(++_0x30b411);}(_0x0723,0x101));var _0x3072=function(_0x2e4fe1,_0x4ea20f){_0x2e4fe1=_0x2e4fe1-0x0;var _0x5de9d3=_0x0723[_0x2e4fe1];return _0x5de9d3;};'use strict';var multer=require(_0x3072('0x0'));var util=require('util');var path=require(_0x3072('0x1'));var timeout=require(_0x3072('0x2'));var express=require(_0x3072('0x3'));var router=express[_0x3072('0x4')]();var fs_extra=require(_0x3072('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3072('0x6'));var controller=require(_0x3072('0x7'));router[_0x3072('0x8')]('/',auth[_0x3072('0x9')](),controller['index']);router['get']('/:id',auth[_0x3072('0x9')](),controller['show']);router[_0x3072('0x8')](_0x3072('0xa'),auth[_0x3072('0x9')](),controller[_0x3072('0xb')]);router[_0x3072('0x8')](_0x3072('0xc'),auth['isAuthenticated'](),controller[_0x3072('0xd')]);router['get'](_0x3072('0xe'),auth[_0x3072('0x9')](),controller[_0x3072('0xf')]);router[_0x3072('0x8')]('/:id/hopper_black',auth[_0x3072('0x9')](),controller[_0x3072('0x10')]);router[_0x3072('0x8')](_0x3072('0x11'),auth[_0x3072('0x9')](),controller['getLists']);router[_0x3072('0x8')](_0x3072('0x12'),auth[_0x3072('0x9')](),controller[_0x3072('0x13')]);router[_0x3072('0x14')]('/',auth[_0x3072('0x9')](),controller[_0x3072('0x15')]);router['post'](_0x3072('0x16'),auth[_0x3072('0x9')](),controller[_0x3072('0x17')]);router[_0x3072('0x14')](_0x3072('0x11'),auth[_0x3072('0x9')](),controller[_0x3072('0x18')]);router['post'](_0x3072('0x12'),auth[_0x3072('0x9')](),controller[_0x3072('0x19')]);router['put']('/:id',auth[_0x3072('0x9')](),controller[_0x3072('0x1a')]);router[_0x3072('0x1b')]('/:id',auth[_0x3072('0x9')](),controller[_0x3072('0x1c')]);router[_0x3072('0x1b')](_0x3072('0x11'),auth['isAuthenticated'](),controller[_0x3072('0x1d')]);router[_0x3072('0x1b')](_0x3072('0x12'),auth[_0x3072('0x9')](),controller['removeBlackLists']);module[_0x3072('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 6db5bd5..6213eef 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 _0xe0f3=['VIRTUAL','key','sequelize','STRING','TEXT'];(function(_0x1df796,_0x4394c1){var _0x5df53f=function(_0x144a68){while(--_0x144a68){_0x1df796['push'](_0x1df796['shift']());}};_0x5df53f(++_0x4394c1);}(_0xe0f3,0x142));var _0x3e0f=function(_0x577b01,_0x3770f0){_0x577b01=_0x577b01-0x0;var _0x380469=_0xe0f3[_0x577b01];return _0x380469;};'use strict';var Sequelize=require(_0x3e0f('0x0'));module['exports']={'key':{'type':Sequelize[_0x3e0f('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x3e0f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3e0f('0x1')]},'name':{'type':Sequelize[_0x3e0f('0x3')],'get':function(){return this['getDataValue'](_0x3e0f('0x4'));}}}; \ No newline at end of file +var _0xe828=['getDataValue','key','exports','STRING','TEXT'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0xe828,0x1e2));var _0x8e82=function(_0x1cce35,_0x4fd31a){_0x1cce35=_0x1cce35-0x0;var _0x172b90=_0xe828[_0x1cce35];return _0x172b90;};'use strict';var Sequelize=require('sequelize');module[_0x8e82('0x0')]={'key':{'type':Sequelize[_0x8e82('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x8e82('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8e82('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8e82('0x3')](_0x8e82('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index d1ad8c9..ecc886f 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 _0x246b=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','catch','show','keys','length','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','CannedAnswers','then','error','name','send','index','fieldName','key','model'];(function(_0x3b4c8f,_0xa8bb0c){var _0x4a580f=function(_0x137d62){while(--_0x137d62){_0x3b4c8f['push'](_0x3b4c8f['shift']());}};_0x4a580f(++_0xa8bb0c);}(_0x246b,0x88));var _0xb246=function(_0x1fb3de,_0x175d08){_0x1fb3de=_0x1fb3de-0x0;var _0x2769d9=_0x246b[_0x1fb3de];return _0x2769d9;};'use strict';var emlformat=require(_0xb246('0x0'));var rimraf=require(_0xb246('0x1'));var zipdir=require(_0xb246('0x2'));var jsonpatch=require(_0xb246('0x3'));var rp=require(_0xb246('0x4'));var moment=require('moment');var BPromise=require(_0xb246('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb246('0x6'));var sox=require(_0xb246('0x7'));var csv=require('to-csv');var ejs=require(_0xb246('0x8'));var fs=require('fs');var fs_extra=require(_0xb246('0x9'));var _=require(_0xb246('0xa'));var squel=require(_0xb246('0xb'));var crypto=require(_0xb246('0xc'));var jsforce=require(_0xb246('0xd'));var deskjs=require(_0xb246('0xe'));var toCsv=require(_0xb246('0xf'));var querystring=require(_0xb246('0x10'));var Papa=require(_0xb246('0x11'));var Redis=require(_0xb246('0x12'));var authService=require(_0xb246('0x13'));var qs=require(_0xb246('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb246('0x15'));var logger=require(_0xb246('0x16'))(_0xb246('0x17'));var utils=require(_0xb246('0x18'));var config=require(_0xb246('0x19'));var licenseUtil=require(_0xb246('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cc60a,_0x174e98){_0x174e98=_0x174e98||0xcc;return function(_0x2597f3){if(_0x2597f3){return _0x5cc60a[_0xb246('0x1b')](_0x174e98);}return _0x5cc60a[_0xb246('0x1c')](_0x174e98)[_0xb246('0x1d')]();};}function respondWithResult(_0x26370e,_0x3d0184){_0x3d0184=_0x3d0184||0xc8;return function(_0x18de52){if(_0x18de52){return _0x26370e[_0xb246('0x1c')](_0x3d0184)[_0xb246('0x1e')](_0x18de52);}};}function respondWithFilteredResult(_0x3d865c,_0x32ff18){return function(_0xd7a294){if(_0xd7a294){var _0x479e02=typeof _0x32ff18[_0xb246('0x1f')]===_0xb246('0x20')&&typeof _0x32ff18[_0xb246('0x21')]==='undefined';var _0x31bfc6=_0xd7a294['count'];var _0x44c33d=_0x479e02?0x0:_0x32ff18[_0xb246('0x1f')];var _0x5c8ec8=_0x479e02?_0xd7a294[_0xb246('0x22')]:_0x32ff18['offset']+_0x32ff18[_0xb246('0x21')];var _0x4081a1;if(_0x5c8ec8>=_0x31bfc6){_0x5c8ec8=_0x31bfc6;_0x4081a1=0xc8;}else{_0x4081a1=0xce;}_0x3d865c['status'](_0x4081a1);return _0x3d865c[_0xb246('0x23')](_0xb246('0x24'),_0x44c33d+'-'+_0x5c8ec8+'/'+_0x31bfc6)['json'](_0xd7a294);}return null;};}function patchUpdates(_0x4d392f){return function(_0x507074){try{jsonpatch[_0xb246('0x25')](_0x507074,_0x4d392f,!![]);}catch(_0x1511af){return BPromise[_0xb246('0x26')](_0x1511af);}return _0x507074[_0xb246('0x27')]();};}function saveUpdates(_0x2d73b,_0x401928){return function(_0x280a71){if(_0x280a71){return _0x280a71[_0xb246('0x28')](_0x2d73b)['then'](function(_0x3ef9cb){return _0x3ef9cb;});}return null;};}function removeEntity(_0x442f75,_0x14de86){return function(_0x2d8c15){if(_0x2d8c15){return _0x2d8c15[_0xb246('0x29')]()['then'](function(){var _0x2eb348=_0x2d8c15[_0xb246('0x2a')]({'plain':!![]});var _0x57d96d=_0xb246('0x2b');return db['UserProfileResource'][_0xb246('0x29')]({'where':{'type':_0x57d96d,'resourceId':_0x2eb348['id']}})[_0xb246('0x2c')](function(){return _0x2d8c15;});})[_0xb246('0x2c')](function(){_0x442f75['status'](0xcc)[_0xb246('0x1d')]();});}};}function handleEntityNotFound(_0x5bb0ad,_0x1bee28){return function(_0x5603f5){if(!_0x5603f5){_0x5bb0ad[_0xb246('0x1b')](0x194);}return _0x5603f5;};}function handleError(_0x4d862b,_0x4533be){_0x4533be=_0x4533be||0x1f4;return function(_0x1f3970){logger[_0xb246('0x2d')](_0x1f3970['stack']);if(_0x1f3970[_0xb246('0x2e')]){delete _0x1f3970[_0xb246('0x2e')];}_0x4d862b[_0xb246('0x1c')](_0x4533be)[_0xb246('0x2f')](_0x1f3970);};}exports[_0xb246('0x30')]=function(_0x38fe7b,_0x54ba28){var _0x5666de={},_0x30bffb={},_0x40d1b7={'count':0x0,'rows':[]};var _0x33e030=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x5ddaca){return{'name':_0x5ddaca[_0xb246('0x31')],'type':_0x5ddaca['type'][_0xb246('0x32')]};});_0x30bffb[_0xb246('0x33')]=_['map'](_0x33e030,'name');_0x30bffb[_0xb246('0x34')]=_['keys'](_0x38fe7b['query']);_0x30bffb[_0xb246('0x35')]=_[_0xb246('0x36')](_0x30bffb[_0xb246('0x33')],_0x30bffb['query']);_0x5666de[_0xb246('0x37')]=_[_0xb246('0x36')](_0x30bffb[_0xb246('0x33')],qs['fields'](_0x38fe7b['query'][_0xb246('0x38')]));_0x5666de['attributes']=_0x5666de[_0xb246('0x37')]['length']?_0x5666de['attributes']:_0x30bffb['model'];if(!_0x38fe7b[_0xb246('0x34')][_0xb246('0x39')](_0xb246('0x3a'))){_0x5666de['limit']=qs[_0xb246('0x21')](_0x38fe7b[_0xb246('0x34')][_0xb246('0x21')]);_0x5666de['offset']=qs[_0xb246('0x1f')](_0x38fe7b[_0xb246('0x34')][_0xb246('0x1f')]);}_0x5666de[_0xb246('0x3b')]=qs['sort'](_0x38fe7b[_0xb246('0x34')][_0xb246('0x3c')]);_0x5666de[_0xb246('0x3d')]=qs[_0xb246('0x35')](_[_0xb246('0x3e')](_0x38fe7b[_0xb246('0x34')],_0x30bffb[_0xb246('0x35')]),_0x33e030);if(_0x38fe7b['query'][_0xb246('0x3f')]){_0x5666de[_0xb246('0x3d')]=_[_0xb246('0x40')](_0x5666de[_0xb246('0x3d')],{'$or':[{'key':{'$like':'%'+_0x38fe7b[_0xb246('0x34')][_0xb246('0x3f')]+'%'}},{'value':{'$like':'%'+_0x38fe7b[_0xb246('0x34')][_0xb246('0x3f')]+'%'}}]});}_0x5666de=_[_0xb246('0x40')]({},_0x5666de,_0x38fe7b[_0xb246('0x41')]);var _0x894c27={'where':_0x5666de[_0xb246('0x3d')]};return db[_0xb246('0x42')][_0xb246('0x22')](_0x894c27)[_0xb246('0x2c')](function(_0x53f6f3){_0x40d1b7[_0xb246('0x22')]=_0x53f6f3;if(_0x38fe7b[_0xb246('0x34')][_0xb246('0x43')]){_0x5666de[_0xb246('0x44')]=[{'all':!![]}];}return db[_0xb246('0x42')][_0xb246('0x45')](_0x5666de);})[_0xb246('0x2c')](function(_0x35eb3a){_0x40d1b7[_0xb246('0x46')]=_0x35eb3a;return _0x40d1b7;})[_0xb246('0x2c')](respondWithFilteredResult(_0x54ba28,_0x5666de))[_0xb246('0x47')](handleError(_0x54ba28,null));};exports[_0xb246('0x48')]=function(_0x29fdb0,_0x5bb20b){var _0x225cc4={'raw':!![],'where':{'id':_0x29fdb0['params']['id']}},_0x3d93b5={};_0x3d93b5[_0xb246('0x33')]=_[_0xb246('0x49')](db[_0xb246('0x42')]['rawAttributes']);_0x3d93b5['query']=_[_0xb246('0x49')](_0x29fdb0['query']);_0x3d93b5['filters']=_[_0xb246('0x36')](_0x3d93b5[_0xb246('0x33')],_0x3d93b5[_0xb246('0x34')]);_0x225cc4[_0xb246('0x37')]=_[_0xb246('0x36')](_0x3d93b5['model'],qs[_0xb246('0x38')](_0x29fdb0[_0xb246('0x34')][_0xb246('0x38')]));_0x225cc4['attributes']=_0x225cc4[_0xb246('0x37')][_0xb246('0x4a')]?_0x225cc4[_0xb246('0x37')]:_0x3d93b5[_0xb246('0x33')];if(_0x29fdb0[_0xb246('0x34')][_0xb246('0x43')]){_0x225cc4[_0xb246('0x44')]=[{'all':!![]}];}_0x225cc4=_[_0xb246('0x40')]({},_0x225cc4,_0x29fdb0[_0xb246('0x41')]);return db['CannedAnswer'][_0xb246('0x4b')](_0x225cc4)[_0xb246('0x2c')](handleEntityNotFound(_0x5bb20b,null))[_0xb246('0x2c')](respondWithResult(_0x5bb20b,null))['catch'](handleError(_0x5bb20b,null));};exports[_0xb246('0x28')]=function(_0x4edfe1,_0x2139d0){if(_0x4edfe1[_0xb246('0x4c')]['id']){delete _0x4edfe1['body']['id'];}return db[_0xb246('0x42')][_0xb246('0x4b')]({'where':{'id':_0x4edfe1[_0xb246('0x4d')]['id']}})[_0xb246('0x2c')](handleEntityNotFound(_0x2139d0,null))[_0xb246('0x2c')](saveUpdates(_0x4edfe1[_0xb246('0x4c')],null))[_0xb246('0x2c')](respondWithResult(_0x2139d0,null))[_0xb246('0x47')](handleError(_0x2139d0,null));};exports[_0xb246('0x29')]=function(_0x3727f7,_0x2042ac){return db[_0xb246('0x42')]['find']({'where':{'id':_0x3727f7[_0xb246('0x4d')]['id']}})[_0xb246('0x2c')](handleEntityNotFound(_0x2042ac,null))[_0xb246('0x2c')](removeEntity(_0x2042ac,null))[_0xb246('0x47')](handleError(_0x2042ac,null));};exports[_0xb246('0x4e')]=function(_0x464ffe,_0x452b14){var _0x434a5a={'key':_0x464ffe[_0xb246('0x4c')][_0xb246('0x32')]};if(_0x464ffe[_0xb246('0x4c')][_0xb246('0x4f')]){_0x434a5a[_0xb246('0x4f')]=_0x464ffe[_0xb246('0x4c')][_0xb246('0x4f')];}else if(_0x464ffe[_0xb246('0x4c')][_0xb246('0x50')]){_0x434a5a[_0xb246('0x50')]=_0x464ffe[_0xb246('0x4c')][_0xb246('0x50')];}else if(_0x464ffe[_0xb246('0x4c')][_0xb246('0x51')]){_0x434a5a[_0xb246('0x51')]=_0x464ffe[_0xb246('0x4c')][_0xb246('0x51')];}else if(_0x464ffe[_0xb246('0x4c')][_0xb246('0x52')]){_0x434a5a['ChatWebsiteId']=_0x464ffe[_0xb246('0x4c')][_0xb246('0x52')];}return db[_0xb246('0x42')]['find']({'where':_0x434a5a})[_0xb246('0x2c')](function(_0x4492cb){if(_0x4492cb){throw new db[(_0xb246('0x53'))][(_0xb246('0x54'))](_0xb246('0x55'));}return db[_0xb246('0x42')][_0xb246('0x4e')](_0x464ffe[_0xb246('0x4c')]);})[_0xb246('0x2c')](function(_0x43be5c){var _0x51188c=_0x464ffe[_0xb246('0x56')]['get']({'plain':!![]});if(!_0x51188c)throw new Error(_0xb246('0x57'));if(_0x51188c[_0xb246('0x58')]===_0xb246('0x56')){var _0x43ddc2=_0x43be5c[_0xb246('0x2a')]({'plain':!![]});return db[_0xb246('0x59')][_0xb246('0x4b')]({'where':{'name':'CannedAnswers','userProfileId':_0x51188c[_0xb246('0x5a')]},'raw':!![]})[_0xb246('0x2c')](function(_0x5d67f9){if(_0x5d67f9&&_0x5d67f9[_0xb246('0x5b')]===0x0){return db[_0xb246('0x5c')][_0xb246('0x4e')]({'name':_0x43ddc2['name'],'resourceId':_0x43ddc2['id'],'type':_0x5d67f9[_0xb246('0x2e')],'sectionId':_0x5d67f9['id']},{})[_0xb246('0x2c')](function(){return _0x43be5c;});}else{return _0x43be5c;}})[_0xb246('0x47')](function(_0x533186){logger[_0xb246('0x2d')](_0xb246('0x5d'),_0x533186);throw _0x533186;});}return _0x43be5c;})[_0xb246('0x2c')](respondWithResult(_0x452b14,0xc9))[_0xb246('0x47')](handleError(_0x452b14,null));}; \ No newline at end of file +var _0xc660=['ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','findAll','rows','catch','show','params','intersection','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x4a0000,_0x114c27){var _0xfb5f62=function(_0x199c06){while(--_0x199c06){_0x4a0000['push'](_0x4a0000['shift']());}};_0xfb5f62(++_0x114c27);}(_0xc660,0xb2));var _0x0c66=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc660[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x0c66('0x0'));var rimraf=require(_0x0c66('0x1'));var zipdir=require(_0x0c66('0x2'));var jsonpatch=require(_0x0c66('0x3'));var rp=require(_0x0c66('0x4'));var moment=require(_0x0c66('0x5'));var BPromise=require(_0x0c66('0x6'));var Mustache=require(_0x0c66('0x7'));var util=require(_0x0c66('0x8'));var path=require(_0x0c66('0x9'));var sox=require(_0x0c66('0xa'));var csv=require(_0x0c66('0xb'));var ejs=require(_0x0c66('0xc'));var fs=require('fs');var fs_extra=require(_0x0c66('0xd'));var _=require('lodash');var squel=require(_0x0c66('0xe'));var crypto=require(_0x0c66('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x0c66('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0c66('0x11'));var Papa=require(_0x0c66('0x12'));var Redis=require(_0x0c66('0x13'));var authService=require(_0x0c66('0x14'));var qs=require(_0x0c66('0x15'));var as=require(_0x0c66('0x16'));var hardwareService=require(_0x0c66('0x17'));var logger=require(_0x0c66('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x0c66('0x19'));var licenseUtil=require(_0x0c66('0x1a'));var db=require(_0x0c66('0x1b'))['db'];function respondWithStatusCode(_0x1d2989,_0x1b256a){_0x1b256a=_0x1b256a||0xcc;return function(_0x249c2a){if(_0x249c2a){return _0x1d2989[_0x0c66('0x1c')](_0x1b256a);}return _0x1d2989[_0x0c66('0x1d')](_0x1b256a)[_0x0c66('0x1e')]();};}function respondWithResult(_0x52b66c,_0x5c26ed){_0x5c26ed=_0x5c26ed||0xc8;return function(_0x1b76e6){if(_0x1b76e6){return _0x52b66c[_0x0c66('0x1d')](_0x5c26ed)[_0x0c66('0x1f')](_0x1b76e6);}};}function respondWithFilteredResult(_0x13a6f9,_0x52d08b){return function(_0xe82cf8){if(_0xe82cf8){var _0x307f13=typeof _0x52d08b[_0x0c66('0x20')]===_0x0c66('0x21')&&typeof _0x52d08b[_0x0c66('0x22')]===_0x0c66('0x21');var _0x11ed16=_0xe82cf8[_0x0c66('0x23')];var _0x2d434c=_0x307f13?0x0:_0x52d08b[_0x0c66('0x20')];var _0x1f7491=_0x307f13?_0xe82cf8[_0x0c66('0x23')]:_0x52d08b[_0x0c66('0x20')]+_0x52d08b[_0x0c66('0x22')];var _0x335804;if(_0x1f7491>=_0x11ed16){_0x1f7491=_0x11ed16;_0x335804=0xc8;}else{_0x335804=0xce;}_0x13a6f9[_0x0c66('0x1d')](_0x335804);return _0x13a6f9['set'](_0x0c66('0x24'),_0x2d434c+'-'+_0x1f7491+'/'+_0x11ed16)[_0x0c66('0x1f')](_0xe82cf8);}return null;};}function patchUpdates(_0x10dfb2){return function(_0x16eca2){try{jsonpatch[_0x0c66('0x25')](_0x16eca2,_0x10dfb2,!![]);}catch(_0x5dc3ff){return BPromise[_0x0c66('0x26')](_0x5dc3ff);}return _0x16eca2[_0x0c66('0x27')]();};}function saveUpdates(_0x233677,_0x35fd07){return function(_0x49a8e5){if(_0x49a8e5){return _0x49a8e5[_0x0c66('0x28')](_0x233677)[_0x0c66('0x29')](function(_0x42ca63){return _0x42ca63;});}return null;};}function removeEntity(_0x41c3cc,_0x53fb5c){return function(_0x5effa7){if(_0x5effa7){return _0x5effa7[_0x0c66('0x2a')]()['then'](function(){var _0x3d85b2=_0x5effa7[_0x0c66('0x2b')]({'plain':!![]});var _0x513ddd=_0x0c66('0x2c');return db[_0x0c66('0x2d')]['destroy']({'where':{'type':_0x513ddd,'resourceId':_0x3d85b2['id']}})[_0x0c66('0x29')](function(){return _0x5effa7;});})[_0x0c66('0x29')](function(){_0x41c3cc[_0x0c66('0x1d')](0xcc)[_0x0c66('0x1e')]();});}};}function handleEntityNotFound(_0x29e85e,_0x209483){return function(_0x20824a){if(!_0x20824a){_0x29e85e[_0x0c66('0x1c')](0x194);}return _0x20824a;};}function handleError(_0x5ce68a,_0x4c929c){_0x4c929c=_0x4c929c||0x1f4;return function(_0x9bb927){logger[_0x0c66('0x2e')](_0x9bb927[_0x0c66('0x2f')]);if(_0x9bb927[_0x0c66('0x30')]){delete _0x9bb927['name'];}_0x5ce68a['status'](_0x4c929c)['send'](_0x9bb927);};}exports[_0x0c66('0x31')]=function(_0xb8c40e,_0x39b07e){var _0x33bf93={},_0x5ebb8b={},_0x33fb7a={'count':0x0,'rows':[]};var _0x5ea5a1=_[_0x0c66('0x32')](db['CannedAnswer'][_0x0c66('0x33')],function(_0xa5630a){return{'name':_0xa5630a[_0x0c66('0x34')],'type':_0xa5630a[_0x0c66('0x35')][_0x0c66('0x36')]};});_0x5ebb8b[_0x0c66('0x37')]=_[_0x0c66('0x32')](_0x5ea5a1,'name');_0x5ebb8b[_0x0c66('0x38')]=_[_0x0c66('0x39')](_0xb8c40e[_0x0c66('0x38')]);_0x5ebb8b[_0x0c66('0x3a')]=_['intersection'](_0x5ebb8b['model'],_0x5ebb8b['query']);_0x33bf93[_0x0c66('0x3b')]=_['intersection'](_0x5ebb8b[_0x0c66('0x37')],qs[_0x0c66('0x3c')](_0xb8c40e['query'][_0x0c66('0x3c')]));_0x33bf93[_0x0c66('0x3b')]=_0x33bf93[_0x0c66('0x3b')][_0x0c66('0x3d')]?_0x33bf93[_0x0c66('0x3b')]:_0x5ebb8b['model'];if(!_0xb8c40e[_0x0c66('0x38')][_0x0c66('0x3e')](_0x0c66('0x3f'))){_0x33bf93['limit']=qs[_0x0c66('0x22')](_0xb8c40e['query'][_0x0c66('0x22')]);_0x33bf93[_0x0c66('0x20')]=qs['offset'](_0xb8c40e[_0x0c66('0x38')][_0x0c66('0x20')]);}_0x33bf93[_0x0c66('0x40')]=qs[_0x0c66('0x41')](_0xb8c40e[_0x0c66('0x38')][_0x0c66('0x41')]);_0x33bf93[_0x0c66('0x42')]=qs[_0x0c66('0x3a')](_[_0x0c66('0x43')](_0xb8c40e['query'],_0x5ebb8b[_0x0c66('0x3a')]),_0x5ea5a1);if(_0xb8c40e[_0x0c66('0x38')][_0x0c66('0x44')]){_0x33bf93[_0x0c66('0x42')]=_[_0x0c66('0x45')](_0x33bf93[_0x0c66('0x42')],{'$or':[{'key':{'$like':'%'+_0xb8c40e[_0x0c66('0x38')]['filter']+'%'}},{'value':{'$like':'%'+_0xb8c40e[_0x0c66('0x38')]['filter']+'%'}}]});}_0x33bf93=_['merge']({},_0x33bf93,_0xb8c40e[_0x0c66('0x46')]);var _0x5e8a89={'where':_0x33bf93[_0x0c66('0x42')]};return db[_0x0c66('0x47')][_0x0c66('0x23')](_0x5e8a89)[_0x0c66('0x29')](function(_0x42f0){_0x33fb7a[_0x0c66('0x23')]=_0x42f0;if(_0xb8c40e[_0x0c66('0x38')][_0x0c66('0x48')]){_0x33bf93['include']=[{'all':!![]}];}return db[_0x0c66('0x47')][_0x0c66('0x49')](_0x33bf93);})[_0x0c66('0x29')](function(_0x2361e6){_0x33fb7a[_0x0c66('0x4a')]=_0x2361e6;return _0x33fb7a;})[_0x0c66('0x29')](respondWithFilteredResult(_0x39b07e,_0x33bf93))[_0x0c66('0x4b')](handleError(_0x39b07e,null));};exports[_0x0c66('0x4c')]=function(_0x1b565f,_0x3bbe26){var _0x22d10a={'raw':!![],'where':{'id':_0x1b565f[_0x0c66('0x4d')]['id']}},_0xb30152={};_0xb30152[_0x0c66('0x37')]=_[_0x0c66('0x39')](db[_0x0c66('0x47')][_0x0c66('0x33')]);_0xb30152[_0x0c66('0x38')]=_[_0x0c66('0x39')](_0x1b565f['query']);_0xb30152[_0x0c66('0x3a')]=_[_0x0c66('0x4e')](_0xb30152[_0x0c66('0x37')],_0xb30152[_0x0c66('0x38')]);_0x22d10a[_0x0c66('0x3b')]=_['intersection'](_0xb30152[_0x0c66('0x37')],qs[_0x0c66('0x3c')](_0x1b565f[_0x0c66('0x38')][_0x0c66('0x3c')]));_0x22d10a['attributes']=_0x22d10a['attributes'][_0x0c66('0x3d')]?_0x22d10a[_0x0c66('0x3b')]:_0xb30152['model'];if(_0x1b565f[_0x0c66('0x38')][_0x0c66('0x48')]){_0x22d10a[_0x0c66('0x4f')]=[{'all':!![]}];}_0x22d10a=_['merge']({},_0x22d10a,_0x1b565f['options']);return db['CannedAnswer'][_0x0c66('0x50')](_0x22d10a)[_0x0c66('0x29')](handleEntityNotFound(_0x3bbe26,null))[_0x0c66('0x29')](respondWithResult(_0x3bbe26,null))['catch'](handleError(_0x3bbe26,null));};exports[_0x0c66('0x28')]=function(_0xa80608,_0x6c0301){if(_0xa80608[_0x0c66('0x51')]['id']){delete _0xa80608['body']['id'];}return db[_0x0c66('0x47')]['find']({'where':{'id':_0xa80608[_0x0c66('0x4d')]['id']}})[_0x0c66('0x29')](handleEntityNotFound(_0x6c0301,null))[_0x0c66('0x29')](saveUpdates(_0xa80608[_0x0c66('0x51')],null))[_0x0c66('0x29')](respondWithResult(_0x6c0301,null))[_0x0c66('0x4b')](handleError(_0x6c0301,null));};exports[_0x0c66('0x2a')]=function(_0xb40e4,_0x4406d5){return db[_0x0c66('0x47')][_0x0c66('0x50')]({'where':{'id':_0xb40e4[_0x0c66('0x4d')]['id']}})[_0x0c66('0x29')](handleEntityNotFound(_0x4406d5,null))['then'](removeEntity(_0x4406d5,null))[_0x0c66('0x4b')](handleError(_0x4406d5,null));};exports[_0x0c66('0x52')]=function(_0x33f209,_0x4f5b72){var _0x25085f={'key':_0x33f209['body'][_0x0c66('0x36')]};if(_0x33f209[_0x0c66('0x51')][_0x0c66('0x53')]){_0x25085f[_0x0c66('0x53')]=_0x33f209[_0x0c66('0x51')]['MailAccountId'];}else if(_0x33f209['body']['SmsAccountId']){_0x25085f['SmsAccountId']=_0x33f209[_0x0c66('0x51')][_0x0c66('0x54')];}else if(_0x33f209['body'][_0x0c66('0x55')]){_0x25085f[_0x0c66('0x55')]=_0x33f209[_0x0c66('0x51')]['OpenchannelAccountId'];}else if(_0x33f209[_0x0c66('0x51')][_0x0c66('0x56')]){_0x25085f[_0x0c66('0x56')]=_0x33f209['body']['ChatWebsiteId'];}return db[_0x0c66('0x47')][_0x0c66('0x50')]({'where':_0x25085f})[_0x0c66('0x29')](function(_0xd6f66c){if(_0xd6f66c){throw new db[(_0x0c66('0x57'))][(_0x0c66('0x58'))](_0x0c66('0x59'));}return db[_0x0c66('0x47')][_0x0c66('0x52')](_0x33f209['body']);})['then'](function(_0x13c9ae){var _0x30c339=_0x33f209[_0x0c66('0x5a')][_0x0c66('0x2b')]({'plain':!![]});if(!_0x30c339)throw new Error(_0x0c66('0x5b'));if(_0x30c339['role']===_0x0c66('0x5a')){var _0x4d8ae5=_0x13c9ae[_0x0c66('0x2b')]({'plain':!![]});return db[_0x0c66('0x5c')][_0x0c66('0x50')]({'where':{'name':_0x0c66('0x2c'),'userProfileId':_0x30c339[_0x0c66('0x5d')]},'raw':!![]})[_0x0c66('0x29')](function(_0x1f4d5f){if(_0x1f4d5f&&_0x1f4d5f['autoAssociation']===0x0){return db[_0x0c66('0x2d')][_0x0c66('0x52')]({'name':_0x4d8ae5[_0x0c66('0x30')],'resourceId':_0x4d8ae5['id'],'type':_0x1f4d5f['name'],'sectionId':_0x1f4d5f['id']},{})[_0x0c66('0x29')](function(){return _0x13c9ae;});}else{return _0x13c9ae;}})[_0x0c66('0x4b')](function(_0x32b443){logger[_0x0c66('0x2e')](_0x0c66('0x5e'),_0x32b443);throw _0x32b443;});}return _0x13c9ae;})[_0x0c66('0x29')](respondWithResult(_0x4f5b72,0xc9))[_0x0c66('0x4b')](handleError(_0x4f5b72,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 21b7505..607481a 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 _0x987f=['utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','path','../../config/environment','define','tools_canned_answers','utf8mb4'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0x987f,0x169));var _0xf987=function(_0x3ec122,_0x55150a){_0x3ec122=_0x3ec122-0x0;var _0x4ecf41=_0x987f[_0x3ec122];return _0x4ecf41;};'use strict';var _=require(_0xf987('0x0'));var util=require('util');var logger=require(_0xf987('0x1'))(_0xf987('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf987('0x3'));var fs=require('fs');var path=require(_0xf987('0x4'));var rimraf=require('rimraf');var config=require(_0xf987('0x5'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x4765dd,_0xc48d78){return _0x4765dd[_0xf987('0x6')]('CannedAnswer',attributes,{'tableName':_0xf987('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf987('0x8'),'collate':_0xf987('0x9')});}; \ No newline at end of file +var _0xebff=['path','../../config/environment','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0xd25354,_0x176e9a){var _0x35913b=function(_0x5adcda){while(--_0x5adcda){_0xd25354['push'](_0xd25354['shift']());}};_0x35913b(++_0x176e9a);}(_0xebff,0xf8));var _0xfebf=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xebff[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xfebf('0x0'));var util=require('util');var logger=require(_0xfebf('0x1'))('api');var moment=require(_0xfebf('0x2'));var BPromise=require(_0xfebf('0x3'));var rp=require(_0xfebf('0x4'));var fs=require('fs');var path=require(_0xfebf('0x5'));var rimraf=require('rimraf');var config=require(_0xfebf('0x6'));var attributes=require(_0xfebf('0x7'));module['exports']=function(_0x4a98a9,_0x4c5f06){return _0x4a98a9[_0xfebf('0x8')]('CannedAnswer',attributes,{'tableName':_0xfebf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfebf('0xa'),'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 eee6dd0..4876415 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(_0x2bed02,_0x45ac1a){var _0x471c08=function(_0x5f0fe1){while(--_0x5f0fe1){_0x2bed02['push'](_0x2bed02['shift']());}};_0x471c08(++_0x45ac1a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x1df3d9,_0x38ec23){var _0x162ca9=function(_0x523640){while(--_0x523640){_0x1df3d9['push'](_0x1df3d9['shift']());}};_0x162ca9(++_0x38ec23);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 7ceca76..8d2f80e 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 _0xa81d=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy'];(function(_0x44db7c,_0x5d9498){var _0x1dbd04=function(_0x1efecb){while(--_0x1efecb){_0x44db7c['push'](_0x44db7c['shift']());}};_0x1dbd04(++_0x5d9498);}(_0xa81d,0x65));var _0xda81=function(_0x38a162,_0x4396b2){_0x38a162=_0x38a162-0x0;var _0x1f622b=_0xa81d[_0x38a162];return _0x1f622b;};'use strict';var multer=require(_0xda81('0x0'));var util=require(_0xda81('0x1'));var path=require(_0xda81('0x2'));var timeout=require(_0xda81('0x3'));var express=require(_0xda81('0x4'));var router=express['Router']();var fs_extra=require(_0xda81('0x5'));var auth=require(_0xda81('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xda81('0x7'));var controller=require(_0xda81('0x8'));router[_0xda81('0x9')]('/',auth[_0xda81('0xa')](),controller[_0xda81('0xb')]);router[_0xda81('0x9')](_0xda81('0xc'),auth[_0xda81('0xa')](),controller[_0xda81('0xd')]);router[_0xda81('0xe')]('/',auth[_0xda81('0xa')](),controller[_0xda81('0xf')]);router['put'](_0xda81('0xc'),auth[_0xda81('0xa')](),controller[_0xda81('0x10')]);router[_0xda81('0x11')](_0xda81('0xc'),auth[_0xda81('0xa')](),controller[_0xda81('0x12')]);module[_0xda81('0x13')]=router; \ No newline at end of file +var _0x7a78=['index','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1f99a0,_0x50b73d){var _0x1e0849=function(_0x41e764){while(--_0x41e764){_0x1f99a0['push'](_0x1f99a0['shift']());}};_0x1e0849(++_0x50b73d);}(_0x7a78,0x13b));var _0x87a7=function(_0x2dfa21,_0x3b4dd8){_0x2dfa21=_0x2dfa21-0x0;var _0x5ac953=_0x7a78[_0x2dfa21];return _0x5ac953;};'use strict';var multer=require('multer');var util=require(_0x87a7('0x0'));var path=require(_0x87a7('0x1'));var timeout=require(_0x87a7('0x2'));var express=require(_0x87a7('0x3'));var router=express['Router']();var fs_extra=require(_0x87a7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x87a7('0x5'));var config=require(_0x87a7('0x6'));var controller=require('./cannedAnswer.controller');router[_0x87a7('0x7')]('/',auth[_0x87a7('0x8')](),controller[_0x87a7('0x9')]);router[_0x87a7('0x7')](_0x87a7('0xa'),auth[_0x87a7('0x8')](),controller[_0x87a7('0xb')]);router[_0x87a7('0xc')]('/',auth[_0x87a7('0x8')](),controller[_0x87a7('0xd')]);router[_0x87a7('0xe')](_0x87a7('0xa'),auth[_0x87a7('0x8')](),controller[_0x87a7('0xf')]);router[_0x87a7('0x10')](_0x87a7('0xa'),auth['isAuthenticated'](),controller[_0x87a7('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 2564466..f800df0 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 _0x3294=['INTEGER','1970-01-01\x2000:00:01','STRING'];(function(_0x52802a,_0x108434){var _0x35f54e=function(_0x17be04){while(--_0x17be04){_0x52802a['push'](_0x52802a['shift']());}};_0x35f54e(++_0x108434);}(_0x3294,0x1db));var _0x4329=function(_0x1ca701,_0x3360ae){_0x1ca701=_0x1ca701-0x0;var _0x1bf070=_0x3294[_0x1ca701];return _0x1bf070;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x4329('0x0')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x4329('0x1')]},'dst':{'type':Sequelize[_0x4329('0x1')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4329('0x1')]},'dstchannel':{'type':Sequelize[_0x4329('0x1')]},'lastapp':{'type':Sequelize[_0x4329('0x1')]},'lastdata':{'type':Sequelize[_0x4329('0x1')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x4329('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x4329('0x1')]},'uniqueid':{'type':Sequelize[_0x4329('0x1')]},'linkedid':{'type':Sequelize[_0x4329('0x1')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x4329('0x1')]}}; \ No newline at end of file +var _0x9efb=['DATE','STRING','INTEGER','exports'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x9efb,0x143));var _0xb9ef=function(_0x4ef87a,_0x4854a1){_0x4ef87a=_0x4ef87a-0x0;var _0x254c26=_0x9efb[_0x4ef87a];return _0x254c26;};'use strict';var Sequelize=require('sequelize');module[_0xb9ef('0x0')]={'calldate':{'type':Sequelize[_0xb9ef('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xb9ef('0x2')]},'src':{'type':Sequelize[_0xb9ef('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xb9ef('0x2')]},'channel':{'type':Sequelize[_0xb9ef('0x2')]},'dstchannel':{'type':Sequelize[_0xb9ef('0x2')]},'lastapp':{'type':Sequelize[_0xb9ef('0x2')]},'lastdata':{'type':Sequelize[_0xb9ef('0x2')]},'duration':{'type':Sequelize[_0xb9ef('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb9ef('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb9ef('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xb9ef('0x2')]},'sequence':{'type':Sequelize[_0xb9ef('0x2')]},'peeraccount':{'type':Sequelize[_0xb9ef('0x2')]},'type':{'type':Sequelize[_0xb9ef('0x2')]},'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 b830150..39032d5 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 _0x25fa=['json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','Cdr','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25fa,0x109));var _0xa25f=function(_0x3c5a5a,_0x4b2212){_0x3c5a5a=_0x3c5a5a-0x0;var _0x288b40=_0x25fa[_0x3c5a5a];return _0x288b40;};'use strict';var emlformat=require(_0xa25f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa25f('0x1'));var jsonpatch=require(_0xa25f('0x2'));var rp=require('request-promise');var moment=require(_0xa25f('0x3'));var BPromise=require(_0xa25f('0x4'));var Mustache=require(_0xa25f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa25f('0x6'));var csv=require('to-csv');var ejs=require(_0xa25f('0x7'));var fs=require('fs');var fs_extra=require(_0xa25f('0x8'));var _=require(_0xa25f('0x9'));var squel=require(_0xa25f('0xa'));var crypto=require(_0xa25f('0xb'));var jsforce=require(_0xa25f('0xc'));var deskjs=require(_0xa25f('0xd'));var toCsv=require(_0xa25f('0xe'));var querystring=require(_0xa25f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa25f('0x10'));var authService=require(_0xa25f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa25f('0x12'));var hardwareService=require(_0xa25f('0x13'));var logger=require(_0xa25f('0x14'))(_0xa25f('0x15'));var utils=require('../../config/utils');var config=require(_0xa25f('0x16'));var licenseUtil=require(_0xa25f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e970c,_0x465e41){_0x465e41=_0x465e41||0xcc;return function(_0x50bb78){if(_0x50bb78){return _0x3e970c[_0xa25f('0x18')](_0x465e41);}return _0x3e970c[_0xa25f('0x19')](_0x465e41)[_0xa25f('0x1a')]();};}function respondWithResult(_0x4b3792,_0x199e18){_0x199e18=_0x199e18||0xc8;return function(_0x2a627f){if(_0x2a627f){return _0x4b3792[_0xa25f('0x19')](_0x199e18)[_0xa25f('0x1b')](_0x2a627f);}};}function respondWithFilteredResult(_0x465809,_0x2d2417){return function(_0x1e5836){if(_0x1e5836){var _0x1859ba=typeof _0x2d2417['offset']===_0xa25f('0x1c')&&typeof _0x2d2417[_0xa25f('0x1d')]===_0xa25f('0x1c');var _0x451a6e=_0x1e5836[_0xa25f('0x1e')];var _0x427105=_0x1859ba?0x0:_0x2d2417['offset'];var _0x292171=_0x1859ba?_0x1e5836['count']:_0x2d2417[_0xa25f('0x1f')]+_0x2d2417['limit'];var _0x559c89;if(_0x292171>=_0x451a6e){_0x292171=_0x451a6e;_0x559c89=0xc8;}else{_0x559c89=0xce;}_0x465809[_0xa25f('0x19')](_0x559c89);return _0x465809['set'](_0xa25f('0x20'),_0x427105+'-'+_0x292171+'/'+_0x451a6e)[_0xa25f('0x1b')](_0x1e5836);}return null;};}function patchUpdates(_0x2aaf3a){return function(_0x3c2665){try{jsonpatch[_0xa25f('0x21')](_0x3c2665,_0x2aaf3a,!![]);}catch(_0x504135){return BPromise[_0xa25f('0x22')](_0x504135);}return _0x3c2665[_0xa25f('0x23')]();};}function saveUpdates(_0x371716,_0x14b7f6){return function(_0x5d2803){if(_0x5d2803){return _0x5d2803[_0xa25f('0x24')](_0x371716)[_0xa25f('0x25')](function(_0x248c0c){return _0x248c0c;});}return null;};}function removeEntity(_0x3675b5,_0x4c6f4d){return function(_0x2b710f){if(_0x2b710f){return _0x2b710f[_0xa25f('0x26')]()[_0xa25f('0x25')](function(){_0x3675b5[_0xa25f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2812d7,_0x898446){return function(_0x53f011){if(!_0x53f011){_0x2812d7[_0xa25f('0x18')](0x194);}return _0x53f011;};}function handleError(_0x51dbf8,_0x2df893){_0x2df893=_0x2df893||0x1f4;return function(_0x4eb7b7){logger[_0xa25f('0x27')](_0x4eb7b7[_0xa25f('0x28')]);if(_0x4eb7b7['name']){delete _0x4eb7b7[_0xa25f('0x29')];}_0x51dbf8[_0xa25f('0x19')](_0x2df893)['send'](_0x4eb7b7);};}exports[_0xa25f('0x2a')]=function(_0x5d39c7,_0x1030c4){var _0x41a847={},_0x472114={},_0x208518={'count':0x0,'rows':[]};var _0x334629=_['map'](db[_0xa25f('0x2b')][_0xa25f('0x2c')],function(_0x119ffc){return{'name':_0x119ffc[_0xa25f('0x2d')],'type':_0x119ffc[_0xa25f('0x2e')]['key']};});_0x472114[_0xa25f('0x2f')]=_[_0xa25f('0x30')](_0x334629,_0xa25f('0x29'));_0x472114[_0xa25f('0x31')]=_[_0xa25f('0x32')](_0x5d39c7[_0xa25f('0x31')]);_0x472114[_0xa25f('0x33')]=_[_0xa25f('0x34')](_0x472114[_0xa25f('0x2f')],_0x472114['query']);_0x41a847['attributes']=_['intersection'](_0x472114[_0xa25f('0x2f')],qs[_0xa25f('0x35')](_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x35')]));_0x41a847[_0xa25f('0x36')]=_0x41a847[_0xa25f('0x36')][_0xa25f('0x37')]?_0x41a847[_0xa25f('0x36')]:_0x472114[_0xa25f('0x2f')];if(!_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x38')]('nolimit')){_0x41a847['limit']=qs[_0xa25f('0x1d')](_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x1d')]);_0x41a847['offset']=qs['offset'](_0x5d39c7['query'][_0xa25f('0x1f')]);}_0x41a847[_0xa25f('0x39')]=qs[_0xa25f('0x3a')](_0x5d39c7['query']['sort']);_0x41a847[_0xa25f('0x3b')]=qs[_0xa25f('0x33')](_['pick'](_0x5d39c7['query'],_0x472114[_0xa25f('0x33')]),_0x334629);if(_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x3c')]){_0x41a847['where']=_[_0xa25f('0x3d')](_0x41a847[_0xa25f('0x3b')],{'$or':_[_0xa25f('0x30')](_0x334629,function(_0x49556e){if(_0x49556e['type']!==_0xa25f('0x3e')){var _0x44c9c8={};_0x44c9c8[_0x49556e[_0xa25f('0x29')]]={'$like':'%'+_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x3c')]+'%'};return _0x44c9c8;}})});}_0x41a847=_[_0xa25f('0x3d')]({},_0x41a847,_0x5d39c7[_0xa25f('0x3f')]);var _0x3382f4={'where':_0x41a847['where']};return db[_0xa25f('0x2b')][_0xa25f('0x1e')](_0x3382f4)[_0xa25f('0x25')](function(_0x2e886f){_0x208518[_0xa25f('0x1e')]=_0x2e886f;if(_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x40')]){_0x41a847[_0xa25f('0x41')]=[{'all':!![]}];}return db[_0xa25f('0x2b')][_0xa25f('0x42')](_0x41a847);})[_0xa25f('0x25')](function(_0x3267a0){_0x208518[_0xa25f('0x43')]=_0x3267a0;return _0x208518;})['then'](respondWithFilteredResult(_0x1030c4,_0x41a847))[_0xa25f('0x44')](handleError(_0x1030c4,null));};exports['show']=function(_0xace015,_0x320119){var _0x36afe4={'raw':!![],'where':{'id':_0xace015[_0xa25f('0x45')]['id']}},_0x559874={};_0x559874[_0xa25f('0x2f')]=_[_0xa25f('0x32')](db[_0xa25f('0x2b')]['rawAttributes']);_0x559874[_0xa25f('0x31')]=_[_0xa25f('0x32')](_0xace015[_0xa25f('0x31')]);_0x559874[_0xa25f('0x33')]=_[_0xa25f('0x34')](_0x559874[_0xa25f('0x2f')],_0x559874['query']);_0x36afe4[_0xa25f('0x36')]=_[_0xa25f('0x34')](_0x559874['model'],qs[_0xa25f('0x35')](_0xace015[_0xa25f('0x31')][_0xa25f('0x35')]));_0x36afe4[_0xa25f('0x36')]=_0x36afe4[_0xa25f('0x36')][_0xa25f('0x37')]?_0x36afe4[_0xa25f('0x36')]:_0x559874[_0xa25f('0x2f')];if(_0xace015[_0xa25f('0x31')][_0xa25f('0x40')]){_0x36afe4[_0xa25f('0x41')]=[{'all':!![]}];}_0x36afe4=_[_0xa25f('0x3d')]({},_0x36afe4,_0xace015[_0xa25f('0x3f')]);return db['Cdr'][_0xa25f('0x46')](_0x36afe4)[_0xa25f('0x25')](handleEntityNotFound(_0x320119,null))[_0xa25f('0x25')](respondWithResult(_0x320119,null))[_0xa25f('0x44')](handleError(_0x320119,null));};exports['create']=function(_0x34717c,_0x43888b){return db[_0xa25f('0x2b')]['create'](_0x34717c[_0xa25f('0x47')],{})[_0xa25f('0x25')](respondWithResult(_0x43888b,0xc9))[_0xa25f('0x44')](handleError(_0x43888b,null));};exports[_0xa25f('0x24')]=function(_0x18c9f2,_0x3b6d34){if(_0x18c9f2[_0xa25f('0x47')]['id']){delete _0x18c9f2[_0xa25f('0x47')]['id'];}return db['Cdr'][_0xa25f('0x46')]({'where':{'id':_0x18c9f2[_0xa25f('0x45')]['id']}})[_0xa25f('0x25')](handleEntityNotFound(_0x3b6d34,null))[_0xa25f('0x25')](saveUpdates(_0x18c9f2[_0xa25f('0x47')],null))[_0xa25f('0x25')](respondWithResult(_0x3b6d34,null))[_0xa25f('0x44')](handleError(_0x3b6d34,null));};exports[_0xa25f('0x26')]=function(_0x26a096,_0xe04d67){return db[_0xa25f('0x2b')][_0xa25f('0x46')]({'where':{'id':_0x26a096[_0xa25f('0x45')]['id']}})[_0xa25f('0x25')](handleEntityNotFound(_0xe04d67,null))[_0xa25f('0x25')](removeEntity(_0xe04d67,null))[_0xa25f('0x44')](handleError(_0xe04d67,null));};exports[_0xa25f('0x48')]=function(_0x2fedba,_0x32f719){return db[_0xa25f('0x2b')][_0xa25f('0x48')]()[_0xa25f('0x25')](respondWithResult(_0x32f719,null))['catch'](handleError(_0x32f719,null));}; \ No newline at end of file +var _0xb138=['filters','pick','VIRTUAL','merge','includeAll','include','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where'];(function(_0x592fbd,_0x2b0540){var _0x79fc1b=function(_0x136cb6){while(--_0x136cb6){_0x592fbd['push'](_0x592fbd['shift']());}};_0x79fc1b(++_0x2b0540);}(_0xb138,0x1dd));var _0x8b13=function(_0x396178,_0x5acfb3){_0x396178=_0x396178-0x0;var _0x4229a3=_0xb138[_0x396178];return _0x4229a3;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['map'](_0x35fdca,_0x8b13('0x2b'));_0x2bb51d[_0x8b13('0x35')]=_[_0x8b13('0x36')](_0x3475d8[_0x8b13('0x35')]);_0x2bb51d['filters']=_['intersection'](_0x2bb51d[_0x8b13('0x34')],_0x2bb51d['query']);_0x114b01['attributes']=_[_0x8b13('0x37')](_0x2bb51d['model'],qs[_0x8b13('0x38')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x38')]));_0x114b01[_0x8b13('0x39')]=_0x114b01[_0x8b13('0x39')][_0x8b13('0x3a')]?_0x114b01[_0x8b13('0x39')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8[_0x8b13('0x35')][_0x8b13('0x3b')]('nolimit')){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3c')](_0x3475d8['query'][_0x8b13('0x3c')]);_0x114b01[_0x8b13('0x3d')]=qs[_0x8b13('0x3e')](_[_0x8b13('0x3f')](_0x3475d8[_0x8b13('0x35')],_0x2bb51d[_0x8b13('0x3e')]),_0x35fdca);if(_0x3475d8['query']['filter']){_0x114b01[_0x8b13('0x3d')]=_['merge'](_0x114b01[_0x8b13('0x3d')],{'$or':_['map'](_0x35fdca,function(_0x590a23){if(_0x590a23[_0x8b13('0x32')]!==_0x8b13('0x40')){var _0x2bc877={};_0x2bc877[_0x590a23[_0x8b13('0x2b')]]={'$like':'%'+_0x3475d8['query']['filter']+'%'};return _0x2bc877;}})});}_0x114b01=_[_0x8b13('0x41')]({},_0x114b01,_0x3475d8['options']);var _0x6ba2f3={'where':_0x114b01[_0x8b13('0x3d')]};return db['Cdr'][_0x8b13('0x20')](_0x6ba2f3)[_0x8b13('0x26')](function(_0x35c1d6){_0x5ab161[_0x8b13('0x20')]=_0x35c1d6;if(_0x3475d8[_0x8b13('0x35')][_0x8b13('0x42')]){_0x114b01[_0x8b13('0x43')]=[{'all':!![]}];}return db['Cdr']['findAll'](_0x114b01);})['then'](function(_0x3eb3c5){_0x5ab161[_0x8b13('0x44')]=_0x3eb3c5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x45')](handleError(_0x1511bf,null));};exports[_0x8b13('0x46')]=function(_0x271507,_0x492f7d){var _0x4342db={'raw':!![],'where':{'id':_0x271507[_0x8b13('0x47')]['id']}},_0x50e535={};_0x50e535['model']=_[_0x8b13('0x36')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x50e535[_0x8b13('0x35')]=_[_0x8b13('0x36')](_0x271507[_0x8b13('0x35')]);_0x50e535[_0x8b13('0x3e')]=_['intersection'](_0x50e535['model'],_0x50e535['query']);_0x4342db[_0x8b13('0x39')]=_[_0x8b13('0x37')](_0x50e535[_0x8b13('0x34')],qs[_0x8b13('0x38')](_0x271507['query']['fields']));_0x4342db[_0x8b13('0x39')]=_0x4342db['attributes'][_0x8b13('0x3a')]?_0x4342db[_0x8b13('0x39')]:_0x50e535[_0x8b13('0x34')];if(_0x271507[_0x8b13('0x35')][_0x8b13('0x42')]){_0x4342db['include']=[{'all':!![]}];}_0x4342db=_[_0x8b13('0x41')]({},_0x4342db,_0x271507[_0x8b13('0x48')]);return db[_0x8b13('0x2f')][_0x8b13('0x49')](_0x4342db)[_0x8b13('0x26')](handleEntityNotFound(_0x492f7d,null))[_0x8b13('0x26')](respondWithResult(_0x492f7d,null))[_0x8b13('0x45')](handleError(_0x492f7d,null));};exports[_0x8b13('0x4a')]=function(_0x3e192b,_0x518298){return db[_0x8b13('0x2f')]['create'](_0x3e192b[_0x8b13('0x4b')],{})[_0x8b13('0x26')](respondWithResult(_0x518298,0xc9))[_0x8b13('0x45')](handleError(_0x518298,null));};exports['update']=function(_0x148efb,_0x35f612){if(_0x148efb[_0x8b13('0x4b')]['id']){delete _0x148efb[_0x8b13('0x4b')]['id'];}return db[_0x8b13('0x2f')][_0x8b13('0x49')]({'where':{'id':_0x148efb[_0x8b13('0x47')]['id']}})['then'](handleEntityNotFound(_0x35f612,null))[_0x8b13('0x26')](saveUpdates(_0x148efb['body'],null))[_0x8b13('0x26')](respondWithResult(_0x35f612,null))[_0x8b13('0x45')](handleError(_0x35f612,null));};exports[_0x8b13('0x27')]=function(_0x435867,_0x2be640){return db[_0x8b13('0x2f')][_0x8b13('0x49')]({'where':{'id':_0x435867[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x2be640,null))[_0x8b13('0x26')](removeEntity(_0x2be640,null))[_0x8b13('0x45')](handleError(_0x2be640,null));};exports[_0x8b13('0x4c')]=function(_0xd55f3b,_0x2bdfae){return db[_0x8b13('0x2f')][_0x8b13('0x4c')]()[_0x8b13('0x26')](respondWithResult(_0x2bdfae,null))['catch'](handleError(_0x2bdfae,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index fd5525a..7efe5a0 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(_0x49e762,_0x4593f3){var _0x2bbfaa=function(_0x531645){while(--_0x531645){_0x49e762['push'](_0x49e762['shift']());}};_0x2bbfaa(++_0x4593f3);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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(_0x480f34,_0x2f37df){var _0x245d27=function(_0x5e5b9e){while(--_0x5e5b9e){_0x480f34['push'](_0x480f34['shift']());}};_0x245d27(++_0x2f37df);}(_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 7d64ca0..8b93e76 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 _0x1735=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','util','moment'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0x1735,0x140));var _0x5173=function(_0x833b9,_0x59368e){_0x833b9=_0x833b9-0x0;var _0x36fd8f=_0x1735[_0x833b9];return _0x36fd8f;};'use strict';var _=require('lodash');var util=require(_0x5173('0x0'));var moment=require(_0x5173('0x1'));var BPromise=require(_0x5173('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5173('0x3'));var db=require(_0x5173('0x4'))['db'];var utils=require(_0x5173('0x5'));var logger=require(_0x5173('0x6'))(_0x5173('0x7'));var config=require(_0x5173('0x8'));var jayson=require(_0x5173('0x9'));var client=jayson[_0x5173('0xa')][_0x5173('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d841b,_0x120f7f,_0x477d03){return new BPromise(function(_0x1d134a,_0x4383ff){return client[_0x5173('0xc')](_0x1d841b,_0x477d03)[_0x5173('0xd')](function(_0x5080d0){logger[_0x5173('0xe')](_0x5173('0xf'),_0x120f7f,_0x5173('0x10'));logger[_0x5173('0x11')](_0x5173('0x12'),_0x120f7f,_0x5173('0x10'),JSON[_0x5173('0x13')](_0x5080d0));if(_0x5080d0['error']){if(_0x5080d0['error'][_0x5173('0x14')]===0x1f4){logger[_0x5173('0x15')]('Cdr,\x20%s,\x20%s',_0x120f7f,_0x5080d0['error'][_0x5173('0x16')]);return _0x4383ff(_0x5080d0[_0x5173('0x15')][_0x5173('0x16')]);}logger[_0x5173('0x15')](_0x5173('0xf'),_0x120f7f,_0x5080d0[_0x5173('0x15')][_0x5173('0x16')]);return _0x1d134a(_0x5080d0[_0x5173('0x15')][_0x5173('0x16')]);}else{logger[_0x5173('0xe')](_0x5173('0xf'),_0x120f7f,_0x5173('0x10'));_0x1d134a(_0x5080d0['result'][_0x5173('0x16')]);}})['catch'](function(_0x43732e){logger['error'](_0x5173('0xf'),_0x120f7f,_0x43732e);_0x4383ff(_0x43732e);});});} \ No newline at end of file +var _0x9e71=['info','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x30bed8,_0x3d7980){var _0x53d3c4=function(_0x4fb52f){while(--_0x4fb52f){_0x30bed8['push'](_0x30bed8['shift']());}};_0x53d3c4(++_0x3d7980);}(_0x9e71,0x1e4));var _0x19e7=function(_0x46f732,_0x5efa6f){_0x46f732=_0x46f732-0x0;var _0x3e3bb8=_0x9e71[_0x46f732];return _0x3e3bb8;};'use strict';var _=require(_0x19e7('0x0'));var util=require(_0x19e7('0x1'));var moment=require('moment');var BPromise=require(_0x19e7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x19e7('0x3'));var db=require(_0x19e7('0x4'))['db'];var utils=require(_0x19e7('0x5'));var logger=require(_0x19e7('0x6'))(_0x19e7('0x7'));var config=require(_0x19e7('0x8'));var jayson=require(_0x19e7('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1eec43,_0x341dc2,_0x2c427b){return new BPromise(function(_0x2ca205,_0x16a40d){return client['request'](_0x1eec43,_0x2c427b)['then'](function(_0x333625){logger[_0x19e7('0xa')](_0x19e7('0xb'),_0x341dc2,'request\x20sent');logger['debug'](_0x19e7('0xc'),_0x341dc2,_0x19e7('0xd'),JSON[_0x19e7('0xe')](_0x333625));if(_0x333625[_0x19e7('0xf')]){if(_0x333625[_0x19e7('0xf')][_0x19e7('0x10')]===0x1f4){logger[_0x19e7('0xf')]('Cdr,\x20%s,\x20%s',_0x341dc2,_0x333625[_0x19e7('0xf')][_0x19e7('0x11')]);return _0x16a40d(_0x333625[_0x19e7('0xf')][_0x19e7('0x11')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x341dc2,_0x333625[_0x19e7('0xf')]['message']);return _0x2ca205(_0x333625['error'][_0x19e7('0x11')]);}else{logger[_0x19e7('0xa')](_0x19e7('0xb'),_0x341dc2,_0x19e7('0xd'));_0x2ca205(_0x333625[_0x19e7('0x12')][_0x19e7('0x11')]);}})['catch'](function(_0x5799f3){logger[_0x19e7('0xf')]('Cdr,\x20%s,\x20%s',_0x341dc2,_0x5799f3);_0x16a40d(_0x5799f3);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 646dec4..52e6e37 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _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(_0xc75e69,_0x19ac94){var _0x447f25=function(_0x25125c){while(--_0x25125c){_0xc75e69['push'](_0xc75e69['shift']());}};_0x447f25(++_0x19ac94);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 0130083..540e682 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 _0x4e9b=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x1cea7e,_0x4e9be8){var _0xdb85fa=function(_0x356113){while(--_0x356113){_0x1cea7e['push'](_0x1cea7e['shift']());}};_0xdb85fa(++_0x4e9be8);}(_0x4e9b,0x11a));var _0xb4e9=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x4e9b[_0x2642cb];return _0xe6e41;};'use strict';var Sequelize=require(_0xb4e9('0x0'));module[_0xb4e9('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb4e9('0x2')],'allowNull':![],'defaultValue':_0xb4e9('0x3')},'appdata':{'type':Sequelize[_0xb4e9('0x4')]()},'description':{'type':Sequelize[_0xb4e9('0x2')]},'interval':{'type':Sequelize[_0xb4e9('0x2')],'defaultValue':_0xb4e9('0x5')}}; \ No newline at end of file +var _0x1c63=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x58c687,_0x3fec26){var _0x5e9c26=function(_0x25dac7){while(--_0x25dac7){_0x58c687['push'](_0x58c687['shift']());}};_0x5e9c26(++_0x3fec26);}(_0x1c63,0xea));var _0x31c6=function(_0xf37b8d,_0x42ce54){_0xf37b8d=_0xf37b8d-0x0;var _0x3b0b62=_0x1c63[_0xf37b8d];return _0x3b0b62;};'use strict';var Sequelize=require(_0x31c6('0x0'));module[_0x31c6('0x1')]={'priority':{'type':Sequelize[_0x31c6('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x31c6('0x3')},'appdata':{'type':Sequelize[_0x31c6('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x31c6('0x5')],'defaultValue':_0x31c6('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 49c0060..37d18ad 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 _0xb98f=['lodash','crypto','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','query','keys','intersection','model','attributes','fields','includeAll','include','merge','options','ChatApplication','find','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra'];(function(_0x3ed225,_0x1f57fb){var _0x5f46fa=function(_0x59dd4e){while(--_0x59dd4e){_0x3ed225['push'](_0x3ed225['shift']());}};_0x5f46fa(++_0x1f57fb);}(_0xb98f,0xce));var _0xfb98=function(_0x3e061d,_0xbcdea2){_0x3e061d=_0x3e061d-0x0;var _0x4e8fcd=_0xb98f[_0x3e061d];return _0x4e8fcd;};'use strict';var emlformat=require(_0xfb98('0x0'));var rimraf=require(_0xfb98('0x1'));var zipdir=require(_0xfb98('0x2'));var jsonpatch=require(_0xfb98('0x3'));var rp=require(_0xfb98('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfb98('0x5'));var path=require(_0xfb98('0x6'));var sox=require(_0xfb98('0x7'));var csv=require(_0xfb98('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb98('0x9'));var _=require(_0xfb98('0xa'));var squel=require('squel');var crypto=require(_0xfb98('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfb98('0xc'));var authService=require(_0xfb98('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb98('0xe'));var logger=require('../../config/logger')(_0xfb98('0xf'));var utils=require(_0xfb98('0x10'));var config=require(_0xfb98('0x11'));var licenseUtil=require(_0xfb98('0x12'));var db=require(_0xfb98('0x13'))['db'];function respondWithStatusCode(_0x3cc48e,_0x77a949){_0x77a949=_0x77a949||0xcc;return function(_0x1c9933){if(_0x1c9933){return _0x3cc48e[_0xfb98('0x14')](_0x77a949);}return _0x3cc48e[_0xfb98('0x15')](_0x77a949)[_0xfb98('0x16')]();};}function respondWithResult(_0x3cdeb9,_0x14c9a3){_0x14c9a3=_0x14c9a3||0xc8;return function(_0x201b04){if(_0x201b04){return _0x3cdeb9['status'](_0x14c9a3)[_0xfb98('0x17')](_0x201b04);}};}function respondWithFilteredResult(_0x515864,_0x3e7e25){return function(_0x2d4efd){if(_0x2d4efd){var _0x3c6ca5=typeof _0x3e7e25[_0xfb98('0x18')]===_0xfb98('0x19')&&typeof _0x3e7e25['limit']===_0xfb98('0x19');var _0x174e4d=_0x2d4efd[_0xfb98('0x1a')];var _0x14b206=_0x3c6ca5?0x0:_0x3e7e25[_0xfb98('0x18')];var _0x15c4fa=_0x3c6ca5?_0x2d4efd[_0xfb98('0x1a')]:_0x3e7e25[_0xfb98('0x18')]+_0x3e7e25[_0xfb98('0x1b')];var _0x15932f;if(_0x15c4fa>=_0x174e4d){_0x15c4fa=_0x174e4d;_0x15932f=0xc8;}else{_0x15932f=0xce;}_0x515864[_0xfb98('0x15')](_0x15932f);return _0x515864[_0xfb98('0x1c')](_0xfb98('0x1d'),_0x14b206+'-'+_0x15c4fa+'/'+_0x174e4d)[_0xfb98('0x17')](_0x2d4efd);}return null;};}function patchUpdates(_0x23bc24){return function(_0x46a120){try{jsonpatch[_0xfb98('0x1e')](_0x46a120,_0x23bc24,!![]);}catch(_0x50c0d6){return BPromise[_0xfb98('0x1f')](_0x50c0d6);}return _0x46a120[_0xfb98('0x20')]();};}function saveUpdates(_0x14eaff,_0x284b59){return function(_0x4c3f10){if(_0x4c3f10){return _0x4c3f10[_0xfb98('0x21')](_0x14eaff)[_0xfb98('0x22')](function(_0xfa10fc){return _0xfa10fc;});}return null;};}function removeEntity(_0x5078aa,_0x568d6c){return function(_0x433fce){if(_0x433fce){return _0x433fce[_0xfb98('0x23')]()['then'](function(){_0x5078aa[_0xfb98('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x383057,_0x3f97fb){return function(_0x5727b4){if(!_0x5727b4){_0x383057['sendStatus'](0x194);}return _0x5727b4;};}function handleError(_0x25480d,_0x18e638){_0x18e638=_0x18e638||0x1f4;return function(_0x5136a3){logger[_0xfb98('0x24')](_0x5136a3['stack']);if(_0x5136a3[_0xfb98('0x25')]){delete _0x5136a3[_0xfb98('0x25')];}_0x25480d[_0xfb98('0x15')](_0x18e638)[_0xfb98('0x26')](_0x5136a3);};}exports['show']=function(_0x239705,_0x106602){var _0x5cdb18={'raw':!![],'where':{'id':_0x239705['params']['id']}},_0x3c6e77={};_0x3c6e77['model']=_['keys'](db['ChatApplication']['rawAttributes']);_0x3c6e77[_0xfb98('0x27')]=_[_0xfb98('0x28')](_0x239705[_0xfb98('0x27')]);_0x3c6e77['filters']=_[_0xfb98('0x29')](_0x3c6e77[_0xfb98('0x2a')],_0x3c6e77['query']);_0x5cdb18[_0xfb98('0x2b')]=_[_0xfb98('0x29')](_0x3c6e77[_0xfb98('0x2a')],qs[_0xfb98('0x2c')](_0x239705['query'][_0xfb98('0x2c')]));_0x5cdb18[_0xfb98('0x2b')]=_0x5cdb18[_0xfb98('0x2b')]['length']?_0x5cdb18['attributes']:_0x3c6e77[_0xfb98('0x2a')];if(_0x239705['query'][_0xfb98('0x2d')]){_0x5cdb18[_0xfb98('0x2e')]=[{'all':!![]}];}_0x5cdb18=_[_0xfb98('0x2f')]({},_0x5cdb18,_0x239705[_0xfb98('0x30')]);return db[_0xfb98('0x31')][_0xfb98('0x32')](_0x5cdb18)[_0xfb98('0x22')](handleEntityNotFound(_0x106602,null))[_0xfb98('0x22')](respondWithResult(_0x106602,null))[_0xfb98('0x33')](handleError(_0x106602,null));};exports[_0xfb98('0x21')]=function(_0x35bbd4,_0x35100d){if(_0x35bbd4[_0xfb98('0x34')]['id']){delete _0x35bbd4['body']['id'];}return db[_0xfb98('0x31')][_0xfb98('0x32')]({'where':{'id':_0x35bbd4[_0xfb98('0x35')]['id']}})[_0xfb98('0x22')](handleEntityNotFound(_0x35100d,null))[_0xfb98('0x22')](saveUpdates(_0x35bbd4[_0xfb98('0x34')],null))['then'](respondWithResult(_0x35100d,null))['catch'](handleError(_0x35100d,null));};exports[_0xfb98('0x23')]=function(_0x5063aa,_0x538782){return db['ChatApplication']['find']({'where':{'id':_0x5063aa[_0xfb98('0x35')]['id']}})[_0xfb98('0x22')](handleEntityNotFound(_0x538782,null))['then'](removeEntity(_0x538782,null))[_0xfb98('0x33')](handleError(_0x538782,null));}; \ No newline at end of file +var _0x33d2=['fields','length','includeAll','merge','options','find','catch','body','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','show','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33d2,0x7f));var _0x233d=function(_0x39580c,_0x22425c){_0x39580c=_0x39580c-0x0;var _0x1a4cd8=_0x33d2[_0x39580c];return _0x1a4cd8;};'use strict';var emlformat=require(_0x233d('0x0'));var rimraf=require(_0x233d('0x1'));var zipdir=require(_0x233d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x233d('0x3'));var moment=require(_0x233d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x233d('0x5'));var util=require(_0x233d('0x6'));var path=require(_0x233d('0x7'));var sox=require(_0x233d('0x8'));var csv=require(_0x233d('0x9'));var ejs=require(_0x233d('0xa'));var fs=require('fs');var fs_extra=require(_0x233d('0xb'));var _=require(_0x233d('0xc'));var squel=require('squel');var crypto=require(_0x233d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x233d('0xe'));var toCsv=require(_0x233d('0x9'));var querystring=require(_0x233d('0xf'));var Papa=require('papaparse');var Redis=require(_0x233d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x233d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x233d('0x12'));var logger=require(_0x233d('0x13'))(_0x233d('0x14'));var utils=require('../../config/utils');var config=require(_0x233d('0x15'));var licenseUtil=require(_0x233d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d36d3,_0x19f04c){_0x19f04c=_0x19f04c||0xcc;return function(_0x51c461){if(_0x51c461){return _0x2d36d3[_0x233d('0x17')](_0x19f04c);}return _0x2d36d3[_0x233d('0x18')](_0x19f04c)[_0x233d('0x19')]();};}function respondWithResult(_0x50a166,_0x36627d){_0x36627d=_0x36627d||0xc8;return function(_0x294703){if(_0x294703){return _0x50a166[_0x233d('0x18')](_0x36627d)[_0x233d('0x1a')](_0x294703);}};}function respondWithFilteredResult(_0xda6da2,_0x59b818){return function(_0xd7624c){if(_0xd7624c){var _0x552bbd=typeof _0x59b818[_0x233d('0x1b')]===_0x233d('0x1c')&&typeof _0x59b818[_0x233d('0x1d')]===_0x233d('0x1c');var _0x2b5bb0=_0xd7624c['count'];var _0x4f96c8=_0x552bbd?0x0:_0x59b818[_0x233d('0x1b')];var _0x409637=_0x552bbd?_0xd7624c[_0x233d('0x1e')]:_0x59b818[_0x233d('0x1b')]+_0x59b818[_0x233d('0x1d')];var _0x1b70da;if(_0x409637>=_0x2b5bb0){_0x409637=_0x2b5bb0;_0x1b70da=0xc8;}else{_0x1b70da=0xce;}_0xda6da2[_0x233d('0x18')](_0x1b70da);return _0xda6da2[_0x233d('0x1f')](_0x233d('0x20'),_0x4f96c8+'-'+_0x409637+'/'+_0x2b5bb0)[_0x233d('0x1a')](_0xd7624c);}return null;};}function patchUpdates(_0x3fa180){return function(_0x3ff3e3){try{jsonpatch[_0x233d('0x21')](_0x3ff3e3,_0x3fa180,!![]);}catch(_0x5aa707){return BPromise[_0x233d('0x22')](_0x5aa707);}return _0x3ff3e3[_0x233d('0x23')]();};}function saveUpdates(_0x5dd0e0,_0x12f8e8){return function(_0x19f575){if(_0x19f575){return _0x19f575[_0x233d('0x24')](_0x5dd0e0)[_0x233d('0x25')](function(_0x4f4c2a){return _0x4f4c2a;});}return null;};}function removeEntity(_0xe38aea,_0x19749f){return function(_0x3c3cba){if(_0x3c3cba){return _0x3c3cba[_0x233d('0x26')]()[_0x233d('0x25')](function(){_0xe38aea[_0x233d('0x18')](0xcc)[_0x233d('0x19')]();});}};}function handleEntityNotFound(_0x586f62,_0x517d61){return function(_0x507b5a){if(!_0x507b5a){_0x586f62['sendStatus'](0x194);}return _0x507b5a;};}function handleError(_0x24087a,_0x14cda3){_0x14cda3=_0x14cda3||0x1f4;return function(_0x1609ed){logger['error'](_0x1609ed[_0x233d('0x27')]);if(_0x1609ed[_0x233d('0x28')]){delete _0x1609ed[_0x233d('0x28')];}_0x24087a[_0x233d('0x18')](_0x14cda3)['send'](_0x1609ed);};}exports[_0x233d('0x29')]=function(_0xf10fbe,_0x3db64c){var _0x332962={'raw':!![],'where':{'id':_0xf10fbe['params']['id']}},_0x23f4a0={};_0x23f4a0['model']=_[_0x233d('0x2a')](db[_0x233d('0x2b')][_0x233d('0x2c')]);_0x23f4a0[_0x233d('0x2d')]=_[_0x233d('0x2a')](_0xf10fbe[_0x233d('0x2d')]);_0x23f4a0[_0x233d('0x2e')]=_[_0x233d('0x2f')](_0x23f4a0[_0x233d('0x30')],_0x23f4a0['query']);_0x332962[_0x233d('0x31')]=_[_0x233d('0x2f')](_0x23f4a0[_0x233d('0x30')],qs['fields'](_0xf10fbe['query'][_0x233d('0x32')]));_0x332962['attributes']=_0x332962['attributes'][_0x233d('0x33')]?_0x332962[_0x233d('0x31')]:_0x23f4a0[_0x233d('0x30')];if(_0xf10fbe[_0x233d('0x2d')][_0x233d('0x34')]){_0x332962['include']=[{'all':!![]}];}_0x332962=_[_0x233d('0x35')]({},_0x332962,_0xf10fbe[_0x233d('0x36')]);return db[_0x233d('0x2b')][_0x233d('0x37')](_0x332962)['then'](handleEntityNotFound(_0x3db64c,null))[_0x233d('0x25')](respondWithResult(_0x3db64c,null))[_0x233d('0x38')](handleError(_0x3db64c,null));};exports[_0x233d('0x24')]=function(_0xa82d72,_0x116578){if(_0xa82d72[_0x233d('0x39')]['id']){delete _0xa82d72[_0x233d('0x39')]['id'];}return db[_0x233d('0x2b')][_0x233d('0x37')]({'where':{'id':_0xa82d72[_0x233d('0x3a')]['id']}})[_0x233d('0x25')](handleEntityNotFound(_0x116578,null))[_0x233d('0x25')](saveUpdates(_0xa82d72[_0x233d('0x39')],null))[_0x233d('0x25')](respondWithResult(_0x116578,null))[_0x233d('0x38')](handleError(_0x116578,null));};exports[_0x233d('0x26')]=function(_0x573921,_0x5ec9a3){return db[_0x233d('0x2b')][_0x233d('0x37')]({'where':{'id':_0x573921[_0x233d('0x3a')]['id']}})[_0x233d('0x25')](handleEntityNotFound(_0x5ec9a3,null))[_0x233d('0x25')](removeEntity(_0x5ec9a3,null))[_0x233d('0x38')](handleError(_0x5ec9a3,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 94d0b60..17ae1c0 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 _0xa854=['request-promise','rimraf','./chatApplication.attributes','exports','define','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xa854,0x103));var _0x4a85=function(_0x3a5683,_0x185ca2){_0x3a5683=_0x3a5683-0x0;var _0x1e3c0d=_0xa854[_0x3a5683];return _0x1e3c0d;};'use strict';var _=require(_0x4a85('0x0'));var util=require(_0x4a85('0x1'));var logger=require(_0x4a85('0x2'))(_0x4a85('0x3'));var moment=require(_0x4a85('0x4'));var BPromise=require('bluebird');var rp=require(_0x4a85('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4a85('0x6'));var config=require('../../config/environment');var attributes=require(_0x4a85('0x7'));module[_0x4a85('0x8')]=function(_0x494d91,_0x445a95){return _0x494d91[_0x4a85('0x9')]('ChatApplication',attributes,{'tableName':_0x4a85('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4a85('0xb')});}; \ No newline at end of file +var _0x5511=['api','moment','path','rimraf','./chatApplication.attributes','exports','utf8mb4','lodash','util','../../config/logger'];(function(_0x46ae88,_0x1a29e7){var _0xa7b68a=function(_0x34707a){while(--_0x34707a){_0x46ae88['push'](_0x46ae88['shift']());}};_0xa7b68a(++_0x1a29e7);}(_0x5511,0x10b));var _0x1551=function(_0x1bbf6c,_0x42422d){_0x1bbf6c=_0x1bbf6c-0x0;var _0x1105cd=_0x5511[_0x1bbf6c];return _0x1105cd;};'use strict';var _=require(_0x1551('0x0'));var util=require(_0x1551('0x1'));var logger=require(_0x1551('0x2'))(_0x1551('0x3'));var moment=require(_0x1551('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1551('0x5'));var rimraf=require(_0x1551('0x6'));var config=require('../../config/environment');var attributes=require(_0x1551('0x7'));module[_0x1551('0x8')]=function(_0x249c5f,_0x2bf2f9){return _0x249c5f['define']('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1551('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index a11fbe3..3d80328 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 _0x2f16=['../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2f16,0x13f));var _0x62f1=function(_0x688c0e,_0xc9e8e8){_0x688c0e=_0x688c0e-0x0;var _0x351de9=_0x2f16[_0x688c0e];return _0x351de9;};'use strict';var _=require(_0x62f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x62f1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62f1('0x2'));var db=require(_0x62f1('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x62f1('0x4'));var jayson=require(_0x62f1('0x5'));var client=jayson[_0x62f1('0x6')][_0x62f1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3b18e1,_0x19db9f,_0x53d811){return new BPromise(function(_0x4af4eb,_0x548d47){return client[_0x62f1('0x8')](_0x3b18e1,_0x53d811)[_0x62f1('0x9')](function(_0x1f49d0){logger[_0x62f1('0xa')](_0x62f1('0xb'),_0x19db9f,'request\x20sent');logger[_0x62f1('0xc')](_0x62f1('0xd'),_0x19db9f,'request\x20sent',JSON['stringify'](_0x1f49d0));if(_0x1f49d0['error']){if(_0x1f49d0[_0x62f1('0xe')][_0x62f1('0xf')]===0x1f4){logger[_0x62f1('0xe')](_0x62f1('0xb'),_0x19db9f,_0x1f49d0['error']['message']);return _0x548d47(_0x1f49d0[_0x62f1('0xe')]['message']);}logger[_0x62f1('0xe')]('ChatApplication,\x20%s,\x20%s',_0x19db9f,_0x1f49d0[_0x62f1('0xe')][_0x62f1('0x10')]);return _0x4af4eb(_0x1f49d0['error']['message']);}else{logger['info'](_0x62f1('0xb'),_0x19db9f,'request\x20sent');_0x4af4eb(_0x1f49d0[_0x62f1('0x11')][_0x62f1('0x10')]);}})[_0x62f1('0x12')](function(_0x540f48){logger['error']('ChatApplication,\x20%s,\x20%s',_0x19db9f,_0x540f48);_0x548d47(_0x540f48);});});} \ No newline at end of file +var _0x6775=['ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug'];(function(_0x270dfc,_0x561f21){var _0x1e0223=function(_0x30658a){while(--_0x30658a){_0x270dfc['push'](_0x270dfc['shift']());}};_0x1e0223(++_0x561f21);}(_0x6775,0xf8));var _0x5677=function(_0x3075ca,_0x57e4c3){_0x3075ca=_0x3075ca-0x0;var _0x3928ff=_0x6775[_0x3075ca];return _0x3928ff;};'use strict';var _=require(_0x5677('0x0'));var util=require(_0x5677('0x1'));var moment=require(_0x5677('0x2'));var BPromise=require('bluebird');var rs=require(_0x5677('0x3'));var fs=require('fs');var Redis=require(_0x5677('0x4'));var db=require(_0x5677('0x5'))['db'];var utils=require(_0x5677('0x6'));var logger=require(_0x5677('0x7'))(_0x5677('0x8'));var config=require(_0x5677('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5677('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x592759,_0x9a48da,_0x407448){return new BPromise(function(_0x5a7c36,_0x400fa5){return client[_0x5677('0xb')](_0x592759,_0x407448)[_0x5677('0xc')](function(_0x4d9c30){logger[_0x5677('0xd')]('ChatApplication,\x20%s,\x20%s',_0x9a48da,_0x5677('0xe'));logger[_0x5677('0xf')](_0x5677('0x10'),_0x9a48da,_0x5677('0xe'),JSON[_0x5677('0x11')](_0x4d9c30));if(_0x4d9c30[_0x5677('0x12')]){if(_0x4d9c30[_0x5677('0x12')][_0x5677('0x13')]===0x1f4){logger[_0x5677('0x12')](_0x5677('0x14'),_0x9a48da,_0x4d9c30[_0x5677('0x12')][_0x5677('0x15')]);return _0x400fa5(_0x4d9c30['error']['message']);}logger[_0x5677('0x12')]('ChatApplication,\x20%s,\x20%s',_0x9a48da,_0x4d9c30[_0x5677('0x12')][_0x5677('0x15')]);return _0x5a7c36(_0x4d9c30[_0x5677('0x12')][_0x5677('0x15')]);}else{logger[_0x5677('0xd')](_0x5677('0x14'),_0x9a48da,_0x5677('0xe'));_0x5a7c36(_0x4d9c30[_0x5677('0x16')]['message']);}})[_0x5677('0x17')](function(_0x1a1659){logger['error'](_0x5677('0x14'),_0x9a48da,_0x1a1659);_0x400fa5(_0x1a1659);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 64a2a2d..5c8a995 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 _0x6590=['./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x6590,0x127));var _0x0659=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0x6590[_0x215dc8];return _0x583ea3;};'use strict';var multer=require(_0x0659('0x0'));var util=require(_0x0659('0x1'));var path=require(_0x0659('0x2'));var timeout=require('connect-timeout');var express=require(_0x0659('0x3'));var router=express[_0x0659('0x4')]();var fs_extra=require(_0x0659('0x5'));var auth=require(_0x0659('0x6'));var interaction=require(_0x0659('0x7'));var config=require(_0x0659('0x8'));var controller=require(_0x0659('0x9'));router[_0x0659('0xa')](_0x0659('0xb'),auth[_0x0659('0xc')](),controller[_0x0659('0xd')]);router[_0x0659('0xe')](_0x0659('0xb'),auth[_0x0659('0xc')](),controller[_0x0659('0xf')]);router[_0x0659('0x10')](_0x0659('0xb'),auth[_0x0659('0xc')](),controller[_0x0659('0x11')]);module[_0x0659('0x12')]=router; \ No newline at end of file +var _0xf532=['../../components/interaction/service','get','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xf206fa,_0x593446){var _0x45def5=function(_0x59558c){while(--_0x59558c){_0xf206fa['push'](_0xf206fa['shift']());}};_0x45def5(++_0x593446);}(_0xf532,0x1a9));var _0x2f53=function(_0x3b247d,_0xbe4218){_0x3b247d=_0x3b247d-0x0;var _0x131bcf=_0xf532[_0x3b247d];return _0x131bcf;};'use strict';var multer=require(_0x2f53('0x0'));var util=require(_0x2f53('0x1'));var path=require(_0x2f53('0x2'));var timeout=require(_0x2f53('0x3'));var express=require(_0x2f53('0x4'));var router=express[_0x2f53('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2f53('0x6'));var interaction=require(_0x2f53('0x7'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x2f53('0x8')](_0x2f53('0x9'),auth[_0x2f53('0xa')](),controller['show']);router[_0x2f53('0xb')](_0x2f53('0x9'),auth[_0x2f53('0xa')](),controller[_0x2f53('0xc')]);router[_0x2f53('0xd')](_0x2f53('0x9'),auth[_0x2f53('0xa')](),controller[_0x2f53('0xe')]);module[_0x2f53('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 9fd228e..a8176b4 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 _0x649e=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4c837a,_0x49e506){var _0x32864a=function(_0x82a74){while(--_0x82a74){_0x4c837a['push'](_0x4c837a['shift']());}};_0x32864a(++_0x49e506);}(_0x649e,0xdd));var _0xe649=function(_0x13680f,_0x5cb289){_0x13680f=_0x13680f-0x0;var _0x1573f1=_0x649e[_0x13680f];return _0x1573f1;};'use strict';var Sequelize=require(_0xe649('0x0'));module[_0xe649('0x1')]={'name':{'type':Sequelize[_0xe649('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe649('0x2')]},'write':{'type':Sequelize[_0xe649('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5d5c=['BOOLEAN','sequelize','exports'];(function(_0xd7f994,_0xcf10b8){var _0xd4de0c=function(_0x232114){while(--_0x232114){_0xd7f994['push'](_0xd7f994['shift']());}};_0xd4de0c(++_0xcf10b8);}(_0x5d5c,0xee));var _0xc5d5=function(_0x3c116d,_0x2b1377){_0x3c116d=_0x3c116d-0x0;var _0x5dbfd6=_0x5d5c[_0x3c116d];return _0x5dbfd6;};'use strict';var Sequelize=require(_0xc5d5('0x0'));module[_0xc5d5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xc5d5('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 8a1147b..3c1321f 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 _0x975e=['options','includeAll','include','rows','catch','params','fields','find','create','body','destroy','describe','ChatInternalMessage','toInteger','addMembers','omit','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','moment','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','then','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x1ff4e5,_0x350e42){var _0x7adf31=function(_0x4756ed){while(--_0x4756ed){_0x1ff4e5['push'](_0x1ff4e5['shift']());}};_0x7adf31(++_0x350e42);}(_0x975e,0xd0));var _0xe975=function(_0x1c5629,_0x5a0b4b){_0x1c5629=_0x1c5629-0x0;var _0x2c9f01=_0x975e[_0x1c5629];return _0x2c9f01;};'use strict';var emlformat=require(_0xe975('0x0'));var rimraf=require(_0xe975('0x1'));var zipdir=require(_0xe975('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe975('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe975('0x4'));var util=require(_0xe975('0x5'));var path=require(_0xe975('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe975('0x7'));var _=require('lodash');var squel=require(_0xe975('0x8'));var crypto=require(_0xe975('0x9'));var jsforce=require(_0xe975('0xa'));var deskjs=require(_0xe975('0xb'));var toCsv=require(_0xe975('0xc'));var querystring=require(_0xe975('0xd'));var Papa=require(_0xe975('0xe'));var Redis=require(_0xe975('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe975('0x10'));var as=require(_0xe975('0x11'));var hardwareService=require(_0xe975('0x12'));var logger=require(_0xe975('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe975('0x14'));var db=require(_0xe975('0x15'))['db'];config['redis']=_['defaults'](config[_0xe975('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xe975('0x17'))(new Redis(config[_0xe975('0x16')]));require(_0xe975('0x18'))['register'](socket);function respondWithStatusCode(_0x33e699,_0x1496c5){_0x1496c5=_0x1496c5||0xcc;return function(_0x52a36a){if(_0x52a36a){return _0x33e699[_0xe975('0x19')](_0x1496c5);}return _0x33e699['status'](_0x1496c5)['end']();};}function respondWithResult(_0x3fe5bd,_0x6d280f){_0x6d280f=_0x6d280f||0xc8;return function(_0x35bb4c){if(_0x35bb4c){return _0x3fe5bd[_0xe975('0x1a')](_0x6d280f)[_0xe975('0x1b')](_0x35bb4c);}};}function respondWithFilteredResult(_0x59edbd,_0x56a4ec){return function(_0x5866fe){if(_0x5866fe){var _0x34acdc=typeof _0x56a4ec[_0xe975('0x1c')]==='undefined'&&typeof _0x56a4ec[_0xe975('0x1d')]==='undefined';var _0x2f25fc=_0x5866fe[_0xe975('0x1e')];var _0x111882=_0x34acdc?0x0:_0x56a4ec['offset'];var _0x3a8b99=_0x34acdc?_0x5866fe['count']:_0x56a4ec['offset']+_0x56a4ec['limit'];var _0x2563d3;if(_0x3a8b99>=_0x2f25fc){_0x3a8b99=_0x2f25fc;_0x2563d3=0xc8;}else{_0x2563d3=0xce;}_0x59edbd['status'](_0x2563d3);return _0x59edbd['set'](_0xe975('0x1f'),_0x111882+'-'+_0x3a8b99+'/'+_0x2f25fc)[_0xe975('0x1b')](_0x5866fe);}return null;};}function patchUpdates(_0x82c825){return function(_0x6c896a){try{jsonpatch[_0xe975('0x20')](_0x6c896a,_0x82c825,!![]);}catch(_0x127ca6){return BPromise[_0xe975('0x21')](_0x127ca6);}return _0x6c896a[_0xe975('0x22')]();};}function saveUpdates(_0x5557c4,_0x397266){return function(_0x2ba823){if(_0x2ba823){return _0x2ba823['update'](_0x5557c4)[_0xe975('0x23')](function(_0x20aaf8){return _0x20aaf8;});}return null;};}function removeEntity(_0x4f55bf,_0x1a737e){return function(_0x40eca0){if(_0x40eca0){return _0x40eca0['destroy']()[_0xe975('0x23')](function(){_0x4f55bf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe5e512,_0x48add6){return function(_0x48fb33){if(!_0x48fb33){_0xe5e512[_0xe975('0x19')](0x194);}return _0x48fb33;};}function handleError(_0x2dec32,_0x245bb1){_0x245bb1=_0x245bb1||0x1f4;return function(_0x28ff85){logger[_0xe975('0x24')](_0x28ff85[_0xe975('0x25')]);if(_0x28ff85['name']){delete _0x28ff85[_0xe975('0x26')];}_0x2dec32[_0xe975('0x1a')](_0x245bb1)['send'](_0x28ff85);};}exports[_0xe975('0x27')]=function(_0x3adf0d,_0x40e753){var _0x17abc8={},_0x30ed6e={},_0x26f702={'count':0x0,'rows':[]};var _0x5d88b7=_[_0xe975('0x28')](db[_0xe975('0x29')][_0xe975('0x2a')],function(_0x2b1908){return{'name':_0x2b1908[_0xe975('0x2b')],'type':_0x2b1908[_0xe975('0x2c')][_0xe975('0x2d')]};});_0x30ed6e[_0xe975('0x2e')]=_[_0xe975('0x28')](_0x5d88b7,'name');_0x30ed6e[_0xe975('0x2f')]=_[_0xe975('0x30')](_0x3adf0d[_0xe975('0x2f')]);_0x30ed6e[_0xe975('0x31')]=_[_0xe975('0x32')](_0x30ed6e['model'],_0x30ed6e['query']);_0x17abc8[_0xe975('0x33')]=_[_0xe975('0x32')](_0x30ed6e[_0xe975('0x2e')],qs['fields'](_0x3adf0d[_0xe975('0x2f')]['fields']));_0x17abc8[_0xe975('0x33')]=_0x17abc8[_0xe975('0x33')][_0xe975('0x34')]?_0x17abc8[_0xe975('0x33')]:_0x30ed6e[_0xe975('0x2e')];if(!_0x3adf0d[_0xe975('0x2f')][_0xe975('0x35')](_0xe975('0x36'))){_0x17abc8[_0xe975('0x1d')]=qs[_0xe975('0x1d')](_0x3adf0d['query']['limit']);_0x17abc8[_0xe975('0x1c')]=qs[_0xe975('0x1c')](_0x3adf0d[_0xe975('0x2f')]['offset']);}_0x17abc8[_0xe975('0x37')]=qs[_0xe975('0x38')](_0x3adf0d['query'][_0xe975('0x38')]);_0x17abc8['where']=qs[_0xe975('0x31')](_[_0xe975('0x39')](_0x3adf0d['query'],_0x30ed6e['filters']),_0x5d88b7);if(_0x3adf0d[_0xe975('0x2f')][_0xe975('0x3a')]){_0x17abc8[_0xe975('0x3b')]=_[_0xe975('0x3c')](_0x17abc8[_0xe975('0x3b')],{'$or':_[_0xe975('0x28')](_0x5d88b7,function(_0x527fc0){if(_0x527fc0[_0xe975('0x2c')]!==_0xe975('0x3d')){var _0x2f37d5={};_0x2f37d5[_0x527fc0['name']]={'$like':'%'+_0x3adf0d[_0xe975('0x2f')][_0xe975('0x3a')]+'%'};return _0x2f37d5;}})});}_0x17abc8=_[_0xe975('0x3c')]({},_0x17abc8,_0x3adf0d[_0xe975('0x3e')]);var _0x122163={'where':_0x17abc8[_0xe975('0x3b')]};return db[_0xe975('0x29')]['count'](_0x122163)[_0xe975('0x23')](function(_0x318528){_0x26f702['count']=_0x318528;if(_0x3adf0d[_0xe975('0x2f')][_0xe975('0x3f')]){_0x17abc8[_0xe975('0x40')]=[{'all':!![]}];}return db[_0xe975('0x29')]['findAll'](_0x17abc8);})[_0xe975('0x23')](function(_0x56976b){_0x26f702[_0xe975('0x41')]=_0x56976b;return _0x26f702;})[_0xe975('0x23')](respondWithFilteredResult(_0x40e753,_0x17abc8))[_0xe975('0x42')](handleError(_0x40e753,null));};exports['show']=function(_0xebdce2,_0x51f9a0){var _0x988699={'raw':!![],'where':{'id':_0xebdce2[_0xe975('0x43')]['id']}},_0x5e9c28={};_0x5e9c28[_0xe975('0x2e')]=_[_0xe975('0x30')](db[_0xe975('0x29')]['rawAttributes']);_0x5e9c28[_0xe975('0x2f')]=_[_0xe975('0x30')](_0xebdce2[_0xe975('0x2f')]);_0x5e9c28[_0xe975('0x31')]=_[_0xe975('0x32')](_0x5e9c28[_0xe975('0x2e')],_0x5e9c28['query']);_0x988699[_0xe975('0x33')]=_[_0xe975('0x32')](_0x5e9c28[_0xe975('0x2e')],qs[_0xe975('0x44')](_0xebdce2['query'][_0xe975('0x44')]));_0x988699[_0xe975('0x33')]=_0x988699[_0xe975('0x33')][_0xe975('0x34')]?_0x988699[_0xe975('0x33')]:_0x5e9c28[_0xe975('0x2e')];if(_0xebdce2[_0xe975('0x2f')]['includeAll']){_0x988699[_0xe975('0x40')]=[{'all':!![]}];}_0x988699=_['merge']({},_0x988699,_0xebdce2[_0xe975('0x3e')]);return db['ChatGroup'][_0xe975('0x45')](_0x988699)['then'](handleEntityNotFound(_0x51f9a0,null))[_0xe975('0x23')](respondWithResult(_0x51f9a0,null))['catch'](handleError(_0x51f9a0,null));};exports[_0xe975('0x46')]=function(_0x2b95d8,_0x142c93){return db[_0xe975('0x29')][_0xe975('0x46')](_0x2b95d8[_0xe975('0x47')],{})[_0xe975('0x23')](respondWithResult(_0x142c93,0xc9))['catch'](handleError(_0x142c93,null));};exports['update']=function(_0x4d1eb0,_0x5211b3){if(_0x4d1eb0[_0xe975('0x47')]['id']){delete _0x4d1eb0[_0xe975('0x47')]['id'];}return db['ChatGroup'][_0xe975('0x45')]({'where':{'id':_0x4d1eb0['params']['id']}})[_0xe975('0x23')](handleEntityNotFound(_0x5211b3,null))[_0xe975('0x23')](saveUpdates(_0x4d1eb0[_0xe975('0x47')],null))[_0xe975('0x23')](respondWithResult(_0x5211b3,null))[_0xe975('0x42')](handleError(_0x5211b3,null));};exports[_0xe975('0x48')]=function(_0x1fa51e,_0x302677){return db['ChatGroup'][_0xe975('0x45')]({'where':{'id':_0x1fa51e[_0xe975('0x43')]['id']}})[_0xe975('0x23')](handleEntityNotFound(_0x302677,null))[_0xe975('0x23')](removeEntity(_0x302677,null))['catch'](handleError(_0x302677,null));};exports[_0xe975('0x49')]=function(_0x25d66a,_0x215ca3){return db['ChatGroup'][_0xe975('0x49')]()[_0xe975('0x23')](respondWithResult(_0x215ca3,null))[_0xe975('0x42')](handleError(_0x215ca3,null));};exports['getUnread']=function(_0x38f034,_0x39ce2a,_0x21ef59){return db[_0xe975('0x4a')][_0xe975('0x1e')]({'where':{'ChatGroupId':_0x38f034[_0xe975('0x43')]['id'],'ToId':_0x38f034['user']['id'],'read':![]}})[_0xe975('0x23')](function(_0x1a814a){return{'id':_[_0xe975('0x4b')](_0x38f034[_0xe975('0x43')]['id']),'count':_0x1a814a};})[_0xe975('0x23')](respondWithResult(_0x39ce2a,null))['catch'](handleError(_0x39ce2a,null));};exports[_0xe975('0x4c')]=function(_0xe614fe,_0x1630b9,_0x5070f9){return db[_0xe975('0x29')][_0xe975('0x45')]({'where':{'id':_0xe614fe[_0xe975('0x43')]['id']}})[_0xe975('0x23')](handleEntityNotFound(_0x1630b9,null))[_0xe975('0x23')](function(_0x1264d3){if(_0x1264d3){return _0x1264d3[_0xe975('0x4c')](_0xe614fe['body']['ids'],_[_0xe975('0x4d')](_0xe614fe['body'],[_0xe975('0x4e'),'id'])||{});}})[_0xe975('0x23')](respondWithResult(_0x1630b9,null))[_0xe975('0x42')](handleError(_0x1630b9,null));};exports[_0xe975('0x4f')]=function(_0x19a51b,_0x3adea1,_0x4f7656){var _0x120064={};var _0x4b3cff={};var _0x5dfd2f;var _0x183555;return db[_0xe975('0x29')][_0xe975('0x50')]({'where':{'id':_0x19a51b[_0xe975('0x43')]['id']}})[_0xe975('0x23')](handleEntityNotFound(_0x3adea1,null))[_0xe975('0x23')](function(_0x214485){if(_0x214485){_0x5dfd2f=_0x214485;_0x4b3cff['model']=_[_0xe975('0x30')](db[_0xe975('0x51')][_0xe975('0x2a')]);_0x4b3cff[_0xe975('0x2f')]=_['keys'](_0x19a51b['query']);_0x4b3cff[_0xe975('0x31')]=_[_0xe975('0x32')](_0x4b3cff[_0xe975('0x2e')],_0x4b3cff[_0xe975('0x2f')]);_0x120064[_0xe975('0x33')]=_[_0xe975('0x32')](_0x4b3cff[_0xe975('0x2e')],qs[_0xe975('0x44')](_0x19a51b['query'][_0xe975('0x44')]));_0x120064[_0xe975('0x33')]=_0x120064[_0xe975('0x33')][_0xe975('0x34')]?_0x120064['attributes']:_0x4b3cff[_0xe975('0x2e')];_0x120064[_0xe975('0x37')]=qs[_0xe975('0x38')](_0x19a51b[_0xe975('0x2f')][_0xe975('0x38')]);_0x120064[_0xe975('0x3b')]=qs[_0xe975('0x31')](_[_0xe975('0x39')](_0x19a51b[_0xe975('0x2f')],_0x4b3cff[_0xe975('0x31')]));if(_0x19a51b[_0xe975('0x2f')][_0xe975('0x3a')]){_0x120064['where']=_[_0xe975('0x3c')](_0x120064[_0xe975('0x3b')],{'$or':_[_0xe975('0x28')](_0x120064[_0xe975('0x33')],function(_0x2db5bc){var _0x302689={};_0x302689[_0x2db5bc]={'$like':'%'+_0x19a51b['query']['filter']+'%'};return _0x302689;})});}_0x120064=_[_0xe975('0x3c')]({},_0x120064,_0x19a51b[_0xe975('0x3e')]);return _0x5dfd2f[_0xe975('0x4f')](_0x120064);}})['then'](function(_0x41fe4d){if(_0x41fe4d){_0x183555=_0x41fe4d[_0xe975('0x34')];if(!_0x19a51b[_0xe975('0x2f')][_0xe975('0x35')](_0xe975('0x36'))){_0x120064[_0xe975('0x1d')]=qs[_0xe975('0x1d')](_0x19a51b[_0xe975('0x2f')]['limit']);_0x120064[_0xe975('0x1c')]=qs['offset'](_0x19a51b[_0xe975('0x2f')][_0xe975('0x1c')]);}return _0x5dfd2f[_0xe975('0x4f')](_0x120064);}})[_0xe975('0x23')](function(_0x1190fe){if(_0x1190fe){return _0x1190fe?{'count':_0x183555,'rows':_0x1190fe}:null;}})[_0xe975('0x23')](respondWithResult(_0x3adea1,null))[_0xe975('0x42')](handleError(_0x3adea1,null));};exports[_0xe975('0x52')]=function(_0x3157dc,_0x5c335e,_0x17ac6e){return db[_0xe975('0x29')][_0xe975('0x45')]({'where':{'id':_0x3157dc[_0xe975('0x43')]['id']}})[_0xe975('0x23')](handleEntityNotFound(_0x5c335e,null))[_0xe975('0x23')](function(_0x1ecb74){if(_0x1ecb74){return _0x1ecb74[_0xe975('0x52')](_0x3157dc[_0xe975('0x2f')]['ids']);}})['then'](respondWithStatusCode(_0x5c335e,null))[_0xe975('0x42')](handleError(_0x5c335e,null));};exports[_0xe975('0x53')]=function(_0x3a758d,_0x2706f4,_0x5cb8b6){if(_0x3a758d[_0xe975('0x47')]['id']){delete _0x3a758d[_0xe975('0x47')]['id'];}return db['ChatGroup'][_0xe975('0x45')]({'where':{'id':_0x3a758d[_0xe975('0x43')]['id']}})[_0xe975('0x23')](handleEntityNotFound(_0x2706f4,null))[_0xe975('0x23')](function(_0x5cef6a){if(_0x5cef6a){_0x3a758d[_0xe975('0x47')][_0xe975('0x54')]=_0x5cef6a['id'];return db['ChatInternalMessage'][_0xe975('0x46')](_0x3a758d[_0xe975('0x47')]);}})['then'](respondWithResult(_0x2706f4,null))['catch'](handleError(_0x2706f4,null));};exports['getMessages']=function(_0x38ecab,_0xfa1616,_0x4bb304){var _0xd48106={};var _0x388f39={};var _0x204c5a;var _0x3d8573;return db[_0xe975('0x29')][_0xe975('0x50')]({'where':{'id':_0x38ecab[_0xe975('0x43')]['id']}})[_0xe975('0x23')](handleEntityNotFound(_0xfa1616,null))[_0xe975('0x23')](function(_0x3be28b){if(_0x3be28b){_0x204c5a=_0x3be28b;_0x388f39[_0xe975('0x2e')]=_['keys'](db[_0xe975('0x4a')][_0xe975('0x2a')]);_0x388f39[_0xe975('0x2f')]=_[_0xe975('0x30')](_0x38ecab[_0xe975('0x2f')]);_0x388f39[_0xe975('0x31')]=_['intersection'](_0x388f39[_0xe975('0x2e')],_0x388f39[_0xe975('0x2f')]);_0xd48106[_0xe975('0x33')]=_[_0xe975('0x32')](_0x388f39['model'],qs[_0xe975('0x44')](_0x38ecab[_0xe975('0x2f')][_0xe975('0x44')]));_0xd48106[_0xe975('0x33')]=_0xd48106['attributes'][_0xe975('0x34')]?_0xd48106[_0xe975('0x33')]:_0x388f39[_0xe975('0x2e')];_0xd48106[_0xe975('0x37')]=qs['sort'](_0x38ecab['query'][_0xe975('0x38')]);_0xd48106[_0xe975('0x3b')]=qs['filters'](_['pick'](_0x38ecab[_0xe975('0x2f')],_0x388f39[_0xe975('0x31')]));if(_0x38ecab[_0xe975('0x2f')][_0xe975('0x3a')]){_0xd48106[_0xe975('0x3b')]=_[_0xe975('0x3c')](_0xd48106['where'],{'$or':_['map'](_0xd48106[_0xe975('0x33')],function(_0x2ec25f){var _0x5a10e5={};_0x5a10e5[_0x2ec25f]={'$like':'%'+_0x38ecab[_0xe975('0x2f')][_0xe975('0x3a')]+'%'};return _0x5a10e5;})});}if(_0x38ecab[_0xe975('0x2f')][_0xe975('0x55')]){var _0x11e41b=_0x38ecab['query'][_0xe975('0x55')][_0xe975('0x56')](',');var _0x21d32e={};_0x21d32e[_0x11e41b[0x0]]={'$gte':moment(_0x11e41b[0x1])[_0xe975('0x57')](_0xe975('0x58'))};_0xd48106[_0xe975('0x3b')]=_['merge'](_0xd48106['where'],_0x21d32e);}_0xd48106=_[_0xe975('0x3c')]({},_0xd48106,_0x38ecab[_0xe975('0x3e')]);return _0x204c5a[_0xe975('0x59')](_0xd48106);}})[_0xe975('0x23')](function(_0x48400f){if(_0x48400f){_0x3d8573=_0x48400f[_0xe975('0x34')];if(!_0x38ecab[_0xe975('0x2f')][_0xe975('0x35')]('nolimit')){_0xd48106[_0xe975('0x1d')]=qs[_0xe975('0x1d')](_0x38ecab[_0xe975('0x2f')][_0xe975('0x1d')]);_0xd48106[_0xe975('0x1c')]=qs[_0xe975('0x1c')](_0x38ecab[_0xe975('0x2f')][_0xe975('0x1c')]);}return _0x204c5a[_0xe975('0x59')](_0xd48106);}})['then'](function(_0x6cdcaa){if(_0x6cdcaa){return _0x6cdcaa?{'count':_0x3d8573,'rows':_0x6cdcaa}:null;}})[_0xe975('0x23')](respondWithResult(_0xfa1616,null))[_0xe975('0x42')](handleError(_0xfa1616,null));}; \ No newline at end of file +var _0xd519=['ids','findOne','User','getMembers','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','keys','query','intersection','fields','attributes','length','model','nolimit','order','sort','pick','filters','where','merge','filter','includeAll','include','rows','show','params','options','find','create','body','catch','describe','getUnread','ChatInternalMessage','toInteger','addMembers'];(function(_0x96ee3d,_0x4a4214){var _0x151415=function(_0x1f3a3c){while(--_0x1f3a3c){_0x96ee3d['push'](_0x96ee3d['shift']());}};_0x151415(++_0x4a4214);}(_0xd519,0x198));var _0x9d51=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd519[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x9d51('0x0'));var rimraf=require(_0x9d51('0x1'));var zipdir=require(_0x9d51('0x2'));var jsonpatch=require(_0x9d51('0x3'));var rp=require(_0x9d51('0x4'));var moment=require(_0x9d51('0x5'));var BPromise=require(_0x9d51('0x6'));var Mustache=require('mustache');var util=require(_0x9d51('0x7'));var path=require(_0x9d51('0x8'));var sox=require(_0x9d51('0x9'));var csv=require('to-csv');var ejs=require(_0x9d51('0xa'));var fs=require('fs');var fs_extra=require(_0x9d51('0xb'));var _=require('lodash');var squel=require(_0x9d51('0xc'));var crypto=require(_0x9d51('0xd'));var jsforce=require(_0x9d51('0xe'));var deskjs=require(_0x9d51('0xf'));var toCsv=require(_0x9d51('0x10'));var querystring=require(_0x9d51('0x11'));var Papa=require('papaparse');var Redis=require(_0x9d51('0x12'));var authService=require(_0x9d51('0x13'));var qs=require(_0x9d51('0x14'));var as=require(_0x9d51('0x15'));var hardwareService=require(_0x9d51('0x16'));var logger=require(_0x9d51('0x17'))(_0x9d51('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9d51('0x19'));var db=require(_0x9d51('0x1a'))['db'];config['redis']=_['defaults'](config[_0x9d51('0x1b')],{'host':_0x9d51('0x1c'),'port':0x18eb});var socket=require(_0x9d51('0x1d'))(new Redis(config[_0x9d51('0x1b')]));require(_0x9d51('0x1e'))[_0x9d51('0x1f')](socket);function respondWithStatusCode(_0x2f70db,_0x365a4a){_0x365a4a=_0x365a4a||0xcc;return function(_0x3b60bc){if(_0x3b60bc){return _0x2f70db['sendStatus'](_0x365a4a);}return _0x2f70db[_0x9d51('0x20')](_0x365a4a)[_0x9d51('0x21')]();};}function respondWithResult(_0x3a5b0c,_0x47c8f0){_0x47c8f0=_0x47c8f0||0xc8;return function(_0x25b698){if(_0x25b698){return _0x3a5b0c[_0x9d51('0x20')](_0x47c8f0)[_0x9d51('0x22')](_0x25b698);}};}function respondWithFilteredResult(_0x509f31,_0x29b19e){return function(_0x43afd1){if(_0x43afd1){var _0x4d4b1b=typeof _0x29b19e[_0x9d51('0x23')]===_0x9d51('0x24')&&typeof _0x29b19e[_0x9d51('0x25')]===_0x9d51('0x24');var _0x313d9f=_0x43afd1[_0x9d51('0x26')];var _0x54db62=_0x4d4b1b?0x0:_0x29b19e[_0x9d51('0x23')];var _0x3fdf18=_0x4d4b1b?_0x43afd1[_0x9d51('0x26')]:_0x29b19e['offset']+_0x29b19e[_0x9d51('0x25')];var _0x2c5faf;if(_0x3fdf18>=_0x313d9f){_0x3fdf18=_0x313d9f;_0x2c5faf=0xc8;}else{_0x2c5faf=0xce;}_0x509f31[_0x9d51('0x20')](_0x2c5faf);return _0x509f31[_0x9d51('0x27')](_0x9d51('0x28'),_0x54db62+'-'+_0x3fdf18+'/'+_0x313d9f)['json'](_0x43afd1);}return null;};}function patchUpdates(_0x19a4cd){return function(_0xb78f40){try{jsonpatch[_0x9d51('0x29')](_0xb78f40,_0x19a4cd,!![]);}catch(_0xfd3e24){return BPromise[_0x9d51('0x2a')](_0xfd3e24);}return _0xb78f40[_0x9d51('0x2b')]();};}function saveUpdates(_0x547550,_0x14b666){return function(_0x32aa78){if(_0x32aa78){return _0x32aa78[_0x9d51('0x2c')](_0x547550)[_0x9d51('0x2d')](function(_0x526776){return _0x526776;});}return null;};}function removeEntity(_0x289d78,_0x63892e){return function(_0x5ebe2e){if(_0x5ebe2e){return _0x5ebe2e[_0x9d51('0x2e')]()[_0x9d51('0x2d')](function(){_0x289d78[_0x9d51('0x20')](0xcc)[_0x9d51('0x21')]();});}};}function handleEntityNotFound(_0x2dc2ea,_0x1d5ada){return function(_0x51a225){if(!_0x51a225){_0x2dc2ea[_0x9d51('0x2f')](0x194);}return _0x51a225;};}function handleError(_0xb8cde7,_0x32c197){_0x32c197=_0x32c197||0x1f4;return function(_0x18bbdc){logger['error'](_0x18bbdc['stack']);if(_0x18bbdc[_0x9d51('0x30')]){delete _0x18bbdc[_0x9d51('0x30')];}_0xb8cde7[_0x9d51('0x20')](_0x32c197)[_0x9d51('0x31')](_0x18bbdc);};}exports[_0x9d51('0x32')]=function(_0x4f3da6,_0x349bdf){var _0x247446={},_0x2cf528={},_0x361931={'count':0x0,'rows':[]};var _0xdc3837=_[_0x9d51('0x33')](db[_0x9d51('0x34')][_0x9d51('0x35')],function(_0x33246c){return{'name':_0x33246c[_0x9d51('0x36')],'type':_0x33246c[_0x9d51('0x37')][_0x9d51('0x38')]};});_0x2cf528['model']=_['map'](_0xdc3837,_0x9d51('0x30'));_0x2cf528['query']=_[_0x9d51('0x39')](_0x4f3da6[_0x9d51('0x3a')]);_0x2cf528['filters']=_[_0x9d51('0x3b')](_0x2cf528['model'],_0x2cf528[_0x9d51('0x3a')]);_0x247446['attributes']=_[_0x9d51('0x3b')](_0x2cf528['model'],qs[_0x9d51('0x3c')](_0x4f3da6[_0x9d51('0x3a')][_0x9d51('0x3c')]));_0x247446[_0x9d51('0x3d')]=_0x247446[_0x9d51('0x3d')][_0x9d51('0x3e')]?_0x247446[_0x9d51('0x3d')]:_0x2cf528[_0x9d51('0x3f')];if(!_0x4f3da6[_0x9d51('0x3a')]['hasOwnProperty'](_0x9d51('0x40'))){_0x247446[_0x9d51('0x25')]=qs[_0x9d51('0x25')](_0x4f3da6[_0x9d51('0x3a')][_0x9d51('0x25')]);_0x247446[_0x9d51('0x23')]=qs['offset'](_0x4f3da6[_0x9d51('0x3a')][_0x9d51('0x23')]);}_0x247446[_0x9d51('0x41')]=qs[_0x9d51('0x42')](_0x4f3da6[_0x9d51('0x3a')][_0x9d51('0x42')]);_0x247446['where']=qs['filters'](_[_0x9d51('0x43')](_0x4f3da6[_0x9d51('0x3a')],_0x2cf528[_0x9d51('0x44')]),_0xdc3837);if(_0x4f3da6[_0x9d51('0x3a')]['filter']){_0x247446[_0x9d51('0x45')]=_[_0x9d51('0x46')](_0x247446[_0x9d51('0x45')],{'$or':_['map'](_0xdc3837,function(_0x40abee){if(_0x40abee[_0x9d51('0x37')]!=='VIRTUAL'){var _0x3e2184={};_0x3e2184[_0x40abee[_0x9d51('0x30')]]={'$like':'%'+_0x4f3da6[_0x9d51('0x3a')][_0x9d51('0x47')]+'%'};return _0x3e2184;}})});}_0x247446=_[_0x9d51('0x46')]({},_0x247446,_0x4f3da6['options']);var _0x29fb72={'where':_0x247446['where']};return db[_0x9d51('0x34')][_0x9d51('0x26')](_0x29fb72)['then'](function(_0x1dbc9e){_0x361931[_0x9d51('0x26')]=_0x1dbc9e;if(_0x4f3da6[_0x9d51('0x3a')][_0x9d51('0x48')]){_0x247446[_0x9d51('0x49')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x247446);})[_0x9d51('0x2d')](function(_0x2cc34b){_0x361931[_0x9d51('0x4a')]=_0x2cc34b;return _0x361931;})[_0x9d51('0x2d')](respondWithFilteredResult(_0x349bdf,_0x247446))['catch'](handleError(_0x349bdf,null));};exports[_0x9d51('0x4b')]=function(_0x5b921f,_0x419ae8){var _0x87947f={'raw':!![],'where':{'id':_0x5b921f[_0x9d51('0x4c')]['id']}},_0x372151={};_0x372151[_0x9d51('0x3f')]=_['keys'](db[_0x9d51('0x34')][_0x9d51('0x35')]);_0x372151[_0x9d51('0x3a')]=_['keys'](_0x5b921f[_0x9d51('0x3a')]);_0x372151['filters']=_[_0x9d51('0x3b')](_0x372151[_0x9d51('0x3f')],_0x372151['query']);_0x87947f[_0x9d51('0x3d')]=_['intersection'](_0x372151[_0x9d51('0x3f')],qs['fields'](_0x5b921f[_0x9d51('0x3a')][_0x9d51('0x3c')]));_0x87947f[_0x9d51('0x3d')]=_0x87947f[_0x9d51('0x3d')][_0x9d51('0x3e')]?_0x87947f[_0x9d51('0x3d')]:_0x372151['model'];if(_0x5b921f[_0x9d51('0x3a')][_0x9d51('0x48')]){_0x87947f[_0x9d51('0x49')]=[{'all':!![]}];}_0x87947f=_[_0x9d51('0x46')]({},_0x87947f,_0x5b921f[_0x9d51('0x4d')]);return db[_0x9d51('0x34')][_0x9d51('0x4e')](_0x87947f)[_0x9d51('0x2d')](handleEntityNotFound(_0x419ae8,null))['then'](respondWithResult(_0x419ae8,null))['catch'](handleError(_0x419ae8,null));};exports['create']=function(_0x43370f,_0x3d2ea6){return db[_0x9d51('0x34')][_0x9d51('0x4f')](_0x43370f[_0x9d51('0x50')],{})[_0x9d51('0x2d')](respondWithResult(_0x3d2ea6,0xc9))['catch'](handleError(_0x3d2ea6,null));};exports[_0x9d51('0x2c')]=function(_0x597ece,_0x22e50d){if(_0x597ece[_0x9d51('0x50')]['id']){delete _0x597ece[_0x9d51('0x50')]['id'];}return db[_0x9d51('0x34')][_0x9d51('0x4e')]({'where':{'id':_0x597ece[_0x9d51('0x4c')]['id']}})[_0x9d51('0x2d')](handleEntityNotFound(_0x22e50d,null))[_0x9d51('0x2d')](saveUpdates(_0x597ece[_0x9d51('0x50')],null))['then'](respondWithResult(_0x22e50d,null))[_0x9d51('0x51')](handleError(_0x22e50d,null));};exports[_0x9d51('0x2e')]=function(_0x1c1967,_0x29321f){return db['ChatGroup'][_0x9d51('0x4e')]({'where':{'id':_0x1c1967[_0x9d51('0x4c')]['id']}})[_0x9d51('0x2d')](handleEntityNotFound(_0x29321f,null))[_0x9d51('0x2d')](removeEntity(_0x29321f,null))[_0x9d51('0x51')](handleError(_0x29321f,null));};exports[_0x9d51('0x52')]=function(_0x1b3224,_0x3edf84){return db['ChatGroup'][_0x9d51('0x52')]()[_0x9d51('0x2d')](respondWithResult(_0x3edf84,null))['catch'](handleError(_0x3edf84,null));};exports[_0x9d51('0x53')]=function(_0x43aa8d,_0x284aa4,_0x424495){return db[_0x9d51('0x54')][_0x9d51('0x26')]({'where':{'ChatGroupId':_0x43aa8d[_0x9d51('0x4c')]['id'],'ToId':_0x43aa8d['user']['id'],'read':![]}})['then'](function(_0xb38315){return{'id':_[_0x9d51('0x55')](_0x43aa8d[_0x9d51('0x4c')]['id']),'count':_0xb38315};})[_0x9d51('0x2d')](respondWithResult(_0x284aa4,null))['catch'](handleError(_0x284aa4,null));};exports[_0x9d51('0x56')]=function(_0x1b892e,_0x426399,_0x4564fc){return db[_0x9d51('0x34')][_0x9d51('0x4e')]({'where':{'id':_0x1b892e[_0x9d51('0x4c')]['id']}})[_0x9d51('0x2d')](handleEntityNotFound(_0x426399,null))[_0x9d51('0x2d')](function(_0x9f3f39){if(_0x9f3f39){return _0x9f3f39[_0x9d51('0x56')](_0x1b892e[_0x9d51('0x50')]['ids'],_['omit'](_0x1b892e[_0x9d51('0x50')],[_0x9d51('0x57'),'id'])||{});}})[_0x9d51('0x2d')](respondWithResult(_0x426399,null))[_0x9d51('0x51')](handleError(_0x426399,null));};exports['getMembers']=function(_0x24e8c7,_0x574a4f,_0x55c43a){var _0x55bdc4={};var _0x42ef3f={};var _0x3fcf8f;var _0x534c57;return db[_0x9d51('0x34')][_0x9d51('0x58')]({'where':{'id':_0x24e8c7[_0x9d51('0x4c')]['id']}})['then'](handleEntityNotFound(_0x574a4f,null))[_0x9d51('0x2d')](function(_0x2a5180){if(_0x2a5180){_0x3fcf8f=_0x2a5180;_0x42ef3f['model']=_[_0x9d51('0x39')](db[_0x9d51('0x59')][_0x9d51('0x35')]);_0x42ef3f[_0x9d51('0x3a')]=_[_0x9d51('0x39')](_0x24e8c7['query']);_0x42ef3f[_0x9d51('0x44')]=_[_0x9d51('0x3b')](_0x42ef3f['model'],_0x42ef3f[_0x9d51('0x3a')]);_0x55bdc4[_0x9d51('0x3d')]=_['intersection'](_0x42ef3f['model'],qs[_0x9d51('0x3c')](_0x24e8c7[_0x9d51('0x3a')][_0x9d51('0x3c')]));_0x55bdc4[_0x9d51('0x3d')]=_0x55bdc4[_0x9d51('0x3d')][_0x9d51('0x3e')]?_0x55bdc4[_0x9d51('0x3d')]:_0x42ef3f[_0x9d51('0x3f')];_0x55bdc4[_0x9d51('0x41')]=qs['sort'](_0x24e8c7['query'][_0x9d51('0x42')]);_0x55bdc4[_0x9d51('0x45')]=qs['filters'](_['pick'](_0x24e8c7['query'],_0x42ef3f[_0x9d51('0x44')]));if(_0x24e8c7[_0x9d51('0x3a')][_0x9d51('0x47')]){_0x55bdc4['where']=_[_0x9d51('0x46')](_0x55bdc4['where'],{'$or':_[_0x9d51('0x33')](_0x55bdc4['attributes'],function(_0x5b7d05){var _0xdedfe8={};_0xdedfe8[_0x5b7d05]={'$like':'%'+_0x24e8c7[_0x9d51('0x3a')][_0x9d51('0x47')]+'%'};return _0xdedfe8;})});}_0x55bdc4=_['merge']({},_0x55bdc4,_0x24e8c7[_0x9d51('0x4d')]);return _0x3fcf8f[_0x9d51('0x5a')](_0x55bdc4);}})[_0x9d51('0x2d')](function(_0x271d4f){if(_0x271d4f){_0x534c57=_0x271d4f[_0x9d51('0x3e')];if(!_0x24e8c7['query'][_0x9d51('0x5b')]('nolimit')){_0x55bdc4[_0x9d51('0x25')]=qs[_0x9d51('0x25')](_0x24e8c7[_0x9d51('0x3a')][_0x9d51('0x25')]);_0x55bdc4[_0x9d51('0x23')]=qs[_0x9d51('0x23')](_0x24e8c7[_0x9d51('0x3a')][_0x9d51('0x23')]);}return _0x3fcf8f[_0x9d51('0x5a')](_0x55bdc4);}})[_0x9d51('0x2d')](function(_0x42b862){if(_0x42b862){return _0x42b862?{'count':_0x534c57,'rows':_0x42b862}:null;}})[_0x9d51('0x2d')](respondWithResult(_0x574a4f,null))[_0x9d51('0x51')](handleError(_0x574a4f,null));};exports[_0x9d51('0x5c')]=function(_0x3a254d,_0x2e0118,_0x1e3fb1){return db[_0x9d51('0x34')][_0x9d51('0x4e')]({'where':{'id':_0x3a254d[_0x9d51('0x4c')]['id']}})[_0x9d51('0x2d')](handleEntityNotFound(_0x2e0118,null))['then'](function(_0x31a283){if(_0x31a283){return _0x31a283[_0x9d51('0x5c')](_0x3a254d[_0x9d51('0x3a')][_0x9d51('0x57')]);}})[_0x9d51('0x2d')](respondWithStatusCode(_0x2e0118,null))[_0x9d51('0x51')](handleError(_0x2e0118,null));};exports[_0x9d51('0x5d')]=function(_0x3966d5,_0x2c6e12,_0x56b11b){if(_0x3966d5[_0x9d51('0x50')]['id']){delete _0x3966d5[_0x9d51('0x50')]['id'];}return db[_0x9d51('0x34')]['find']({'where':{'id':_0x3966d5['params']['id']}})['then'](handleEntityNotFound(_0x2c6e12,null))[_0x9d51('0x2d')](function(_0x50ec45){if(_0x50ec45){_0x3966d5[_0x9d51('0x50')][_0x9d51('0x5e')]=_0x50ec45['id'];return db['ChatInternalMessage'][_0x9d51('0x4f')](_0x3966d5[_0x9d51('0x50')]);}})[_0x9d51('0x2d')](respondWithResult(_0x2c6e12,null))[_0x9d51('0x51')](handleError(_0x2c6e12,null));};exports[_0x9d51('0x5f')]=function(_0x487a04,_0x4f8e79,_0x1f223a){var _0x10ec9e={};var _0x54c7ae={};var _0x50b73c;var _0x3c7cf8;return db[_0x9d51('0x34')][_0x9d51('0x58')]({'where':{'id':_0x487a04['params']['id']}})[_0x9d51('0x2d')](handleEntityNotFound(_0x4f8e79,null))['then'](function(_0x21da52){if(_0x21da52){_0x50b73c=_0x21da52;_0x54c7ae[_0x9d51('0x3f')]=_[_0x9d51('0x39')](db[_0x9d51('0x54')][_0x9d51('0x35')]);_0x54c7ae[_0x9d51('0x3a')]=_[_0x9d51('0x39')](_0x487a04[_0x9d51('0x3a')]);_0x54c7ae[_0x9d51('0x44')]=_['intersection'](_0x54c7ae[_0x9d51('0x3f')],_0x54c7ae[_0x9d51('0x3a')]);_0x10ec9e[_0x9d51('0x3d')]=_[_0x9d51('0x3b')](_0x54c7ae[_0x9d51('0x3f')],qs[_0x9d51('0x3c')](_0x487a04[_0x9d51('0x3a')][_0x9d51('0x3c')]));_0x10ec9e[_0x9d51('0x3d')]=_0x10ec9e[_0x9d51('0x3d')][_0x9d51('0x3e')]?_0x10ec9e[_0x9d51('0x3d')]:_0x54c7ae[_0x9d51('0x3f')];_0x10ec9e[_0x9d51('0x41')]=qs[_0x9d51('0x42')](_0x487a04['query'][_0x9d51('0x42')]);_0x10ec9e['where']=qs[_0x9d51('0x44')](_['pick'](_0x487a04[_0x9d51('0x3a')],_0x54c7ae[_0x9d51('0x44')]));if(_0x487a04[_0x9d51('0x3a')]['filter']){_0x10ec9e[_0x9d51('0x45')]=_[_0x9d51('0x46')](_0x10ec9e[_0x9d51('0x45')],{'$or':_['map'](_0x10ec9e[_0x9d51('0x3d')],function(_0x30204e){var _0x4a220f={};_0x4a220f[_0x30204e]={'$like':'%'+_0x487a04['query'][_0x9d51('0x47')]+'%'};return _0x4a220f;})});}if(_0x487a04['query'][_0x9d51('0x60')]){var _0x27af55=_0x487a04[_0x9d51('0x3a')][_0x9d51('0x60')][_0x9d51('0x61')](',');var _0x3ffc92={};_0x3ffc92[_0x27af55[0x0]]={'$gte':moment(_0x27af55[0x1])['format'](_0x9d51('0x62'))};_0x10ec9e[_0x9d51('0x45')]=_[_0x9d51('0x46')](_0x10ec9e['where'],_0x3ffc92);}_0x10ec9e=_[_0x9d51('0x46')]({},_0x10ec9e,_0x487a04['options']);return _0x50b73c['getMessages'](_0x10ec9e);}})[_0x9d51('0x2d')](function(_0x28b3fa){if(_0x28b3fa){_0x3c7cf8=_0x28b3fa[_0x9d51('0x3e')];if(!_0x487a04[_0x9d51('0x3a')][_0x9d51('0x5b')]('nolimit')){_0x10ec9e[_0x9d51('0x25')]=qs[_0x9d51('0x25')](_0x487a04['query'][_0x9d51('0x25')]);_0x10ec9e[_0x9d51('0x23')]=qs['offset'](_0x487a04[_0x9d51('0x3a')][_0x9d51('0x23')]);}return _0x50b73c[_0x9d51('0x5f')](_0x10ec9e);}})[_0x9d51('0x2d')](function(_0x7fcb32){if(_0x7fcb32){return _0x7fcb32?{'count':_0x3c7cf8,'rows':_0x7fcb32}:null;}})['then'](respondWithResult(_0x4f8e79,null))[_0x9d51('0x51')](handleError(_0x4f8e79,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 885e5e1..3d2d8b8 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 _0x4d1d=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x3d4774,_0x498991){var _0x187f99=function(_0x34079f){while(--_0x34079f){_0x3d4774['push'](_0x3d4774['shift']());}};_0x187f99(++_0x498991);}(_0x4d1d,0x1cb));var _0xd4d1=function(_0x2368ed,_0x52e15a){_0x2368ed=_0x2368ed-0x0;var _0xfdccbd=_0x4d1d[_0x2368ed];return _0xfdccbd;};'use strict';var EventEmitter=require(_0xd4d1('0x0'));var ChatGroup=require(_0xd4d1('0x1'))['db'][_0xd4d1('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd4d1('0x3')](0x0);var events={'afterCreate':_0xd4d1('0x4'),'afterUpdate':_0xd4d1('0x5'),'afterDestroy':_0xd4d1('0x6')};function emitEvent(_0x372ea9){return function(_0x4191ca,_0x4845c6,_0x57ad17){ChatGroupEvents[_0xd4d1('0x7')](_0x372ea9+':'+_0x4191ca['id'],_0x4191ca);ChatGroupEvents[_0xd4d1('0x7')](_0x372ea9,_0x4191ca);_0x57ad17(null);};}for(var e in events){if(events[_0xd4d1('0x8')](e)){var event=events[e];ChatGroup[_0xd4d1('0x9')](e,emitEvent(event));}}module[_0xd4d1('0xa')]=ChatGroupEvents; \ No newline at end of file +var _0x2d06=['ChatGroup','setMaxListeners','save','remove','emit','hook','exports','../../mysqldb'];(function(_0x2a573d,_0x284675){var _0x370c3f=function(_0x1ddb31){while(--_0x1ddb31){_0x2a573d['push'](_0x2a573d['shift']());}};_0x370c3f(++_0x284675);}(_0x2d06,0x157));var _0x62d0=function(_0x5e875b,_0x38b586){_0x5e875b=_0x5e875b-0x0;var _0x3e2185=_0x2d06[_0x5e875b];return _0x3e2185;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x62d0('0x0'))['db'][_0x62d0('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x62d0('0x2')](0x0);var events={'afterCreate':_0x62d0('0x3'),'afterUpdate':'update','afterDestroy':_0x62d0('0x4')};function emitEvent(_0x32be50){return function(_0x2487bb,_0x984713,_0x5cf315){ChatGroupEvents[_0x62d0('0x5')](_0x32be50+':'+_0x2487bb['id'],_0x2487bb);ChatGroupEvents[_0x62d0('0x5')](_0x32be50,_0x2487bb);_0x5cf315(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x62d0('0x6')](e,emitEvent(event));}}module[_0x62d0('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index facb409..8afe831 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 _0xfdfd=['util','../../config/logger','api','request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xfdfd,0x14f));var _0xdfdf=function(_0x47bc6f,_0x17205b){_0x47bc6f=_0x47bc6f-0x0;var _0x168545=_0xfdfd[_0x47bc6f];return _0x168545;};'use strict';var _=require(_0xdfdf('0x0'));var util=require(_0xdfdf('0x1'));var logger=require(_0xdfdf('0x2'))(_0xdfdf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdfdf('0x4'));var fs=require('fs');var path=require(_0xdfdf('0x5'));var rimraf=require('rimraf');var config=require(_0xdfdf('0x6'));var attributes=require(_0xdfdf('0x7'));module[_0xdfdf('0x8')]=function(_0x559d10,_0x2e6e1e){return _0x559d10[_0xdfdf('0x9')](_0xdfdf('0xa'),attributes,{'tableName':_0xdfdf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x119d=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','lodash','util'];(function(_0x497cef,_0xdc5a30){var _0x34da0f=function(_0x39add5){while(--_0x39add5){_0x497cef['push'](_0x497cef['shift']());}};_0x34da0f(++_0xdc5a30);}(_0x119d,0x172));var _0xd119=function(_0x382147,_0x48a2f1){_0x382147=_0x382147-0x0;var _0x34bc80=_0x119d[_0x382147];return _0x34bc80;};'use strict';var _=require(_0xd119('0x0'));var util=require(_0xd119('0x1'));var logger=require(_0xd119('0x2'))(_0xd119('0x3'));var moment=require(_0xd119('0x4'));var BPromise=require('bluebird');var rp=require(_0xd119('0x5'));var fs=require('fs');var path=require(_0xd119('0x6'));var rimraf=require(_0xd119('0x7'));var config=require(_0xd119('0x8'));var attributes=require(_0xd119('0x9'));module['exports']=function(_0x50f547,_0x3fc87a){return _0x50f547[_0xd119('0xa')](_0xd119('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index bab27a6..b857490 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 _0x1f89=['socket.io-emitter','register','request','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x3a9534,_0x104c89){var _0x15c911=function(_0x472617){while(--_0x472617){_0x3a9534['push'](_0x3a9534['shift']());}};_0x15c911(++_0x104c89);}(_0x1f89,0x14c));var _0x91f8=function(_0x44a9cf,_0x11ddb5){_0x44a9cf=_0x44a9cf-0x0;var _0x5d67c2=_0x1f89[_0x44a9cf];return _0x5d67c2;};'use strict';var _=require(_0x91f8('0x0'));var util=require(_0x91f8('0x1'));var moment=require(_0x91f8('0x2'));var BPromise=require(_0x91f8('0x3'));var rs=require(_0x91f8('0x4'));var fs=require('fs');var Redis=require(_0x91f8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x91f8('0x6'));var logger=require('../../config/logger')(_0x91f8('0x7'));var config=require(_0x91f8('0x8'));var jayson=require(_0x91f8('0x9'));var client=jayson['client'][_0x91f8('0xa')]({'port':0x232a});config[_0x91f8('0xb')]=_[_0x91f8('0xc')](config[_0x91f8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x91f8('0xd'))(new Redis(config[_0x91f8('0xb')]));require('./chatGroup.socket')[_0x91f8('0xe')](socket);function respondWithRpcPromise(_0x5a508e,_0x43d6ad,_0x38a402){return new BPromise(function(_0x3dc8b0,_0x103ed5){return client[_0x91f8('0xf')](_0x5a508e,_0x38a402)['then'](function(_0x1c25e7){logger['info'](_0x91f8('0x10'),_0x43d6ad,'request\x20sent');logger['debug'](_0x91f8('0x11'),_0x43d6ad,_0x91f8('0x12'),JSON['stringify'](_0x1c25e7));if(_0x1c25e7[_0x91f8('0x13')]){if(_0x1c25e7[_0x91f8('0x13')][_0x91f8('0x14')]===0x1f4){logger[_0x91f8('0x13')]('ChatGroup,\x20%s,\x20%s',_0x43d6ad,_0x1c25e7['error']['message']);return _0x103ed5(_0x1c25e7['error'][_0x91f8('0x15')]);}logger[_0x91f8('0x13')](_0x91f8('0x10'),_0x43d6ad,_0x1c25e7[_0x91f8('0x13')][_0x91f8('0x15')]);return _0x3dc8b0(_0x1c25e7[_0x91f8('0x13')]['message']);}else{logger['info'](_0x91f8('0x10'),_0x43d6ad,_0x91f8('0x12'));_0x3dc8b0(_0x1c25e7['result']['message']);}})[_0x91f8('0x16')](function(_0x2ad8e8){logger[_0x91f8('0x13')](_0x91f8('0x10'),_0x43d6ad,_0x2ad8e8);_0x103ed5(_0x2ad8e8);});});} \ No newline at end of file +var _0x4350=['error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x115616,_0x59a994){var _0x16869c=function(_0x1bd34c){while(--_0x1bd34c){_0x115616['push'](_0x115616['shift']());}};_0x16869c(++_0x59a994);}(_0x4350,0x1d0));var _0x0435=function(_0x361b96,_0x2ce9fc){_0x361b96=_0x361b96-0x0;var _0x40d8a3=_0x4350[_0x361b96];return _0x40d8a3;};'use strict';var _=require(_0x0435('0x0'));var util=require(_0x0435('0x1'));var moment=require('moment');var BPromise=require(_0x0435('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0435('0x3'));var db=require(_0x0435('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0435('0x5'))(_0x0435('0x6'));var config=require(_0x0435('0x7'));var jayson=require(_0x0435('0x8'));var client=jayson['client'][_0x0435('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0435('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0435('0xa')]));require('./chatGroup.socket')[_0x0435('0xb')](socket);function respondWithRpcPromise(_0xd72d22,_0x53f1d0,_0x15893a){return new BPromise(function(_0x518b5d,_0x3154d5){return client[_0x0435('0xc')](_0xd72d22,_0x15893a)[_0x0435('0xd')](function(_0x2f27b5){logger[_0x0435('0xe')](_0x0435('0xf'),_0x53f1d0,_0x0435('0x10'));logger[_0x0435('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x53f1d0,'request\x20sent',JSON[_0x0435('0x12')](_0x2f27b5));if(_0x2f27b5['error']){if(_0x2f27b5[_0x0435('0x13')]['code']===0x1f4){logger[_0x0435('0x13')](_0x0435('0xf'),_0x53f1d0,_0x2f27b5['error'][_0x0435('0x14')]);return _0x3154d5(_0x2f27b5[_0x0435('0x13')]['message']);}logger[_0x0435('0x13')]('ChatGroup,\x20%s,\x20%s',_0x53f1d0,_0x2f27b5[_0x0435('0x13')][_0x0435('0x14')]);return _0x518b5d(_0x2f27b5[_0x0435('0x13')][_0x0435('0x14')]);}else{logger[_0x0435('0xe')]('ChatGroup,\x20%s,\x20%s',_0x53f1d0,'request\x20sent');_0x518b5d(_0x2f27b5[_0x0435('0x15')][_0x0435('0x14')]);}})[_0x0435('0x16')](function(_0x227ff2){logger[_0x0435('0x13')](_0x0435('0xf'),_0x53f1d0,_0x227ff2);_0x3154d5(_0x227ff2);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 6d66bfa..cbbef91 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 _0x4889=['save','emit','removeListener','register','length'];(function(_0x2ec6ce,_0x1a22f8){var _0x528b51=function(_0x2546c1){while(--_0x2546c1){_0x2ec6ce['push'](_0x2ec6ce['shift']());}};_0x528b51(++_0x1a22f8);}(_0x4889,0x1ef));var _0x9488=function(_0x149db1,_0x25f28b){_0x149db1=_0x149db1-0x0;var _0x2059a8=_0x4889[_0x149db1];return _0x2059a8;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x9488('0x0'),'remove','update'];function createListener(_0xa9af12,_0xe5b843){return function(_0x428dcb){_0xe5b843[_0x9488('0x1')](_0xa9af12,_0x428dcb);};}function removeListener(_0x3d1ab7,_0x193a6c){return function(){ChatGroupEvents[_0x9488('0x2')](_0x3d1ab7,_0x193a6c);};}exports[_0x9488('0x3')]=function(_0x1f55ff){for(var _0x6a381=0x0,_0x43f02e=events[_0x9488('0x4')];_0x6a381<_0x43f02e;_0x6a381++){var _0x55ff41=events[_0x6a381];var _0x44e589=createListener('chatGroup:'+_0x55ff41,_0x1f55ff);ChatGroupEvents['on'](_0x55ff41,_0x44e589);}}; \ No newline at end of file +var _0x794f=['save','remove','emit','removeListener','length','chatGroup:','./chatGroup.events'];(function(_0x4d96d8,_0x31e935){var _0x43ed07=function(_0xb0524b){while(--_0xb0524b){_0x4d96d8['push'](_0x4d96d8['shift']());}};_0x43ed07(++_0x31e935);}(_0x794f,0x15d));var _0xf794=function(_0x5f012f,_0xd4083f){_0x5f012f=_0x5f012f-0x0;var _0x588d9d=_0x794f[_0x5f012f];return _0x588d9d;};'use strict';var ChatGroupEvents=require(_0xf794('0x0'));var events=[_0xf794('0x1'),_0xf794('0x2'),'update'];function createListener(_0x1e1c21,_0x187667){return function(_0x2f728a){_0x187667[_0xf794('0x3')](_0x1e1c21,_0x2f728a);};}function removeListener(_0x41d742,_0x4303f5){return function(){ChatGroupEvents[_0xf794('0x4')](_0x41d742,_0x4303f5);};}exports['register']=function(_0x112e12){for(var _0x38bcf5=0x0,_0x34918c=events[_0xf794('0x5')];_0x38bcf5<_0x34918c;_0x38bcf5++){var _0x7d3175=events[_0x38bcf5];var _0x3fba2f=createListener(_0xf794('0x6')+_0x7d3175,_0x112e12);ChatGroupEvents['on'](_0x7d3175,_0x3fba2f);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index ab0fc87..867cf55 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 _0x3a56=['getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','update','delete','destroy','removeMembers','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','show','/:id/unread','getUnread','/:id/members'];(function(_0x4e135d,_0x5f54d1){var _0x466163=function(_0x26d68b){while(--_0x26d68b){_0x4e135d['push'](_0x4e135d['shift']());}};_0x466163(++_0x5f54d1);}(_0x3a56,0x143));var _0x63a5=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x3a56[_0x513aa5];return _0x1a1a7c;};'use strict';var multer=require(_0x63a5('0x0'));var util=require('util');var path=require(_0x63a5('0x1'));var timeout=require(_0x63a5('0x2'));var express=require(_0x63a5('0x3'));var router=express[_0x63a5('0x4')]();var fs_extra=require(_0x63a5('0x5'));var auth=require(_0x63a5('0x6'));var interaction=require(_0x63a5('0x7'));var config=require(_0x63a5('0x8'));var controller=require('./chatGroup.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x63a5('0x9')]);router[_0x63a5('0xa')](_0x63a5('0xb'),auth[_0x63a5('0xc')](),controller[_0x63a5('0xd')]);router[_0x63a5('0xa')]('/:id',auth[_0x63a5('0xc')](),controller[_0x63a5('0xe')]);router[_0x63a5('0xa')](_0x63a5('0xf'),auth['isAuthenticated'](),controller[_0x63a5('0x10')]);router['get'](_0x63a5('0x11'),auth['isAuthenticated'](),controller[_0x63a5('0x12')]);router['get'](_0x63a5('0x13'),auth[_0x63a5('0xc')](),controller[_0x63a5('0x14')]);router[_0x63a5('0x15')]('/',auth[_0x63a5('0xc')](),controller[_0x63a5('0x16')]);router[_0x63a5('0x15')](_0x63a5('0x11'),auth['isAuthenticated'](),controller[_0x63a5('0x17')]);router[_0x63a5('0x15')](_0x63a5('0x13'),auth[_0x63a5('0xc')](),controller[_0x63a5('0x18')]);router[_0x63a5('0x19')](_0x63a5('0x1a'),auth['isAuthenticated'](),controller[_0x63a5('0x1b')]);router[_0x63a5('0x1c')](_0x63a5('0x1a'),auth[_0x63a5('0xc')](),controller[_0x63a5('0x1d')]);router[_0x63a5('0x1c')](_0x63a5('0x11'),auth[_0x63a5('0xc')](),controller[_0x63a5('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x715b=['/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','/:id/messages','addMessage','put','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe'];(function(_0xfd9b19,_0x21d75f){var _0x514918=function(_0x52e212){while(--_0x52e212){_0xfd9b19['push'](_0xfd9b19['shift']());}};_0x514918(++_0x21d75f);}(_0x715b,0x15f));var _0xb715=function(_0x506371,_0x176091){_0x506371=_0x506371-0x0;var _0x1ccc19=_0x715b[_0x506371];return _0x1ccc19;};'use strict';var multer=require(_0xb715('0x0'));var util=require(_0xb715('0x1'));var path=require('path');var timeout=require(_0xb715('0x2'));var express=require(_0xb715('0x3'));var router=express[_0xb715('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb715('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb715('0x6'));var controller=require(_0xb715('0x7'));router[_0xb715('0x8')]('/',auth[_0xb715('0x9')](),controller[_0xb715('0xa')]);router[_0xb715('0x8')](_0xb715('0xb'),auth[_0xb715('0x9')](),controller[_0xb715('0xc')]);router[_0xb715('0x8')](_0xb715('0xd'),auth[_0xb715('0x9')](),controller[_0xb715('0xe')]);router[_0xb715('0x8')](_0xb715('0xf'),auth['isAuthenticated'](),controller[_0xb715('0x10')]);router[_0xb715('0x8')](_0xb715('0x11'),auth[_0xb715('0x9')](),controller[_0xb715('0x12')]);router[_0xb715('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0xb715('0x13')]);router[_0xb715('0x14')]('/',auth[_0xb715('0x9')](),controller[_0xb715('0x15')]);router[_0xb715('0x14')]('/:id/members',auth[_0xb715('0x9')](),controller[_0xb715('0x16')]);router['post'](_0xb715('0x17'),auth[_0xb715('0x9')](),controller[_0xb715('0x18')]);router[_0xb715('0x19')](_0xb715('0xd'),auth['isAuthenticated'](),controller[_0xb715('0x1a')]);router[_0xb715('0x1b')](_0xb715('0xd'),auth[_0xb715('0x9')](),controller['destroy']);router[_0xb715('0x1b')]('/:id/members',auth['isAuthenticated'](),controller['removeMembers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 1d05bf4..d690643 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 _0xe511=['DATE','long','ENUM','out','sequelize','exports','INTEGER','star','thumb','TEXT','STRING'];(function(_0xb42aba,_0x5c15fc){var _0x4cf479=function(_0x543b57){while(--_0x543b57){_0xb42aba['push'](_0xb42aba['shift']());}};_0x4cf479(++_0x5c15fc);}(_0xe511,0x16f));var _0x1e51=function(_0x272d90,_0x5e70ff){_0x272d90=_0x272d90-0x0;var _0x2bf4a2=_0xe511[_0x272d90];return _0x2bf4a2;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1e51('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x1e51('0x3'),_0x1e51('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x1e51('0x5')]},'pathTranscript':{'type':Sequelize[_0x1e51('0x5')]},'mailTranscript':{'type':Sequelize[_0x1e51('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1e51('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1e51('0x6')]},'thirdDisposition':{'type':Sequelize[_0x1e51('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x1e51('0x6')]},'osName':{'type':Sequelize[_0x1e51('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x1e51('0x6')]},'deviceType':{'type':Sequelize[_0x1e51('0x6')]},'referer':{'type':Sequelize[_0x1e51('0x5')]},'customerIp':{'type':Sequelize[_0x1e51('0x6')]},'formData':{'type':Sequelize[_0x1e51('0x5')](_0x1e51('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x1e51('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x1e51('0x9')]('in',_0x1e51('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1e51('0x6')]},'customerPort':{'type':Sequelize[_0x1e51('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x1e51('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1cc3=['TEXT','STRING','DATE','long','ENUM','out','BOOLEAN','sequelize','exports','INTEGER','star','thumb'];(function(_0x4abecb,_0x862916){var _0x581432=function(_0x435cc6){while(--_0x435cc6){_0x4abecb['push'](_0x4abecb['shift']());}};_0x581432(++_0x862916);}(_0x1cc3,0x11b));var _0x31cc=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1cc3[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x31cc('0x0'));module[_0x31cc('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x31cc('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x31cc('0x3'),_0x31cc('0x4')),'defaultValue':_0x31cc('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x31cc('0x5')]},'mailTranscript':{'type':Sequelize[_0x31cc('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x31cc('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x31cc('0x6')]},'thirdDisposition':{'type':Sequelize[_0x31cc('0x6')]},'note':{'type':Sequelize[_0x31cc('0x6')]},'browserName':{'type':Sequelize[_0x31cc('0x6')]},'browserVersion':{'type':Sequelize[_0x31cc('0x6')]},'osName':{'type':Sequelize[_0x31cc('0x6')]},'osVersion':{'type':Sequelize[_0x31cc('0x6')]},'deviceModel':{'type':Sequelize[_0x31cc('0x6')]},'deviceVendor':{'type':Sequelize[_0x31cc('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x31cc('0x5')]},'customerIp':{'type':Sequelize[_0x31cc('0x6')]},'formData':{'type':Sequelize[_0x31cc('0x5')](_0x31cc('0x8'))},'read1stAt':{'type':Sequelize[_0x31cc('0x7')]},'lastMsgAt':{'type':Sequelize[_0x31cc('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x31cc('0x9')]('in',_0x31cc('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x31cc('0x6')]},'customerPort':{'type':Sequelize[_0x31cc('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x31cc('0xb')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 32a4210..6a50dd4 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 _0x34e8=['ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','status','end','offset','limit','undefined','count','set','json','update','then','destroy','sendStatus','stack','name','send','render','body','contact','account','Users','TagIds','split','forEach','Tags','talking','unmanaged','abandoned','UserId','waiting','closed','disposition','answered','total','index','map','ChatInteraction','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','field','color','select','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','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','type','text','start','Tag','$substring','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`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)','getFullTextValue','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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.*','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','show','params','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','follow','isNull','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','file','filename','mimetype','Attachment','Unauthorized','attachId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','ChatMessage','User','Messages','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','findAll','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x384695,_0x24e26f){var _0x3b4309=function(_0x2fb958){while(--_0x2fb958){_0x384695['push'](_0x384695['shift']());}};_0x3b4309(++_0x24e26f);}(_0x34e8,0x12c));var _0x834e=function(_0x6f9174,_0x48e9c3){_0x6f9174=_0x6f9174-0x0;var _0x5c904a=_0x34e8[_0x6f9174];return _0x5c904a;};'use strict';var rimraf=require(_0x834e('0x0'));var zipdir=require(_0x834e('0x1'));var rp=require(_0x834e('0x2'));var moment=require(_0x834e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x834e('0x4'));var util=require(_0x834e('0x5'));var path=require(_0x834e('0x6'));var ejs=require(_0x834e('0x7'));var fs=require('fs');var _=require(_0x834e('0x8'));var squel=require(_0x834e('0x9'));var Redis=require(_0x834e('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0x834e('0xb'));var pdf=require('../../components/export/pdf');var logger=require(_0x834e('0xc'))(_0x834e('0xd'));var config=require(_0x834e('0xe'));var db=require(_0x834e('0xf'))['db'];config[_0x834e('0x10')]=_[_0x834e('0x11')](config[_0x834e('0x10')],{'host':_0x834e('0x12'),'port':0x18eb});var socket=require(_0x834e('0x13'))(new Redis(config[_0x834e('0x10')]));require(_0x834e('0x14'))[_0x834e('0x15')](socket);var jayson=require(_0x834e('0x16'));var client=jayson[_0x834e('0x17')][_0x834e('0x18')]({'port':0x232b});var client9004=jayson[_0x834e('0x17')][_0x834e('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x538bb3,_0x5e5b6d,_0x6cd9b9,_0x58a27e){return new BPromise(function(_0x23848e,_0x2d95f2){var _0x28e659=_0x58a27e||client;return _0x28e659[_0x834e('0x19')](_0x538bb3,_0x6cd9b9)['then'](function(_0x43156c){logger[_0x834e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x834e('0x1b'));logger['debug'](_0x834e('0x1c'),_0x5e5b6d,_0x834e('0x1b'),JSON['stringify'](_0x43156c));if(_0x43156c[_0x834e('0x1d')]){if(_0x43156c[_0x834e('0x1d')][_0x834e('0x1e')]===0x1f4){logger['error'](_0x834e('0x1f'),_0x5e5b6d,_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);return _0x2d95f2(_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);}logger[_0x834e('0x1d')](_0x834e('0x1f'),_0x5e5b6d,_0x43156c['error'][_0x834e('0x20')]);return _0x23848e(_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);}else{logger[_0x834e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x834e('0x1b'));_0x23848e(_0x43156c[_0x834e('0x21')]['message']);}})[_0x834e('0x22')](function(_0x28d687){logger[_0x834e('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x28d687);_0x2d95f2(_0x28d687);});});}function respondWithStatusCode(_0x4e3f48,_0x231619){_0x231619=_0x231619||0xcc;return function(_0x34563b){if(_0x34563b){return _0x4e3f48['sendStatus'](_0x231619);}return _0x4e3f48[_0x834e('0x23')](_0x231619)[_0x834e('0x24')]();};}function respondWithResult(_0x58f4fd,_0x3bc4f7){_0x3bc4f7=_0x3bc4f7||0xc8;return function(_0x2e1983){if(_0x2e1983){return _0x58f4fd[_0x834e('0x23')](_0x3bc4f7)['json'](_0x2e1983);}};}function respondWithFilteredResult(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(_0x5e1cc5){var _0x5bef62=typeof _0x3e310f[_0x834e('0x25')]==='undefined'&&typeof _0x3e310f[_0x834e('0x26')]===_0x834e('0x27');var _0x3db026=_0x5e1cc5[_0x834e('0x28')];var _0x3cd928=_0x5bef62?0x0:_0x3e310f[_0x834e('0x25')];var _0x491919=_0x5bef62?_0x5e1cc5['count']:_0x3e310f['offset']+_0x3e310f['limit'];var _0x2c7a8d;if(_0x491919>=_0x3db026){_0x491919=_0x3db026;_0x2c7a8d=0xc8;}else{_0x2c7a8d=0xce;}_0x24fcf7[_0x834e('0x23')](_0x2c7a8d);return _0x24fcf7[_0x834e('0x29')]('Content-Range',_0x3cd928+'-'+_0x491919+'/'+_0x3db026)[_0x834e('0x2a')](_0x5e1cc5);}return null;};}function saveUpdates(_0x11f1ce){return function(_0x1f3671){if(_0x1f3671){return _0x1f3671[_0x834e('0x2b')](_0x11f1ce)[_0x834e('0x2c')](function(_0x390119){return _0x390119;});}return null;};}function removeEntity(_0x3d149d){return function(_0xfaf716){if(_0xfaf716){return _0xfaf716[_0x834e('0x2d')]()['then'](function(){_0x3d149d[_0x834e('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c75c2){return function(_0x3787b0){if(!_0x3787b0){_0x2c75c2[_0x834e('0x2e')](0x194);}return _0x3787b0;};}function handleError(_0x2b3418,_0x444366){_0x444366=_0x444366||0x1f4;return function(_0x4689c2){logger[_0x834e('0x1d')](_0x4689c2[_0x834e('0x2f')]);if(_0x4689c2[_0x834e('0x30')]){delete _0x4689c2[_0x834e('0x30')];}_0x2b3418['status'](_0x444366)[_0x834e('0x31')](_0x4689c2);};}function getMustacheRender(_0x2f408a,_0x24a9df){return Mustache[_0x834e('0x32')](_0x2f408a,_['merge'](_0x24a9df[_0x834e('0x33')],{'contact':_0x24a9df[_0x834e('0x34')],'message':_0x24a9df['message'],'agent':_0x24a9df['agent'],'interaction':_0x24a9df['interaction'],'account':_0x24a9df[_0x834e('0x35')]}))||'';}function getInteractionUsers(_0x41bf4d,_0x20c6ae){return new BPromise(function(_0x34fefb,_0x339e28){try{if(_0x20c6ae[_0x41bf4d['id']]){_0x41bf4d[_0x834e('0x36')]=_['map'](_0x20c6ae[_0x41bf4d['id']],function(_0x2c2d94){return{'id':_0x2c2d94['id'],'fullname':_0x2c2d94['fullname']};});}}catch(_0xe103fe){_0x339e28(_0xe103fe);}_0x34fefb(_0x41bf4d);});}function getInteractionTags(_0x6a3ac,_0x47abed){return new BPromise(function(_0x18ac3b,_0x2f56c7){try{if(_0x6a3ac['TagIds']){_0x6a3ac['Tags']=[];_0x6a3ac[_0x834e('0x37')][_0x834e('0x38')](',')[_0x834e('0x39')](function(_0x130c23){_0x6a3ac[_0x834e('0x3a')]['push'](_0x47abed[_0x130c23]);});}delete _0x6a3ac[_0x834e('0x37')];}catch(_0x548d1d){_0x2f56c7(_0x548d1d);}_0x18ac3b(_0x6a3ac);});}function updateChatInteraction(_0x50c243,_0x1b2edf,_0x4a7f76){return new BPromise(function(_0x2e5239,_0x1ba66d){return getInteractionUsers(_0x50c243,_0x4a7f76)[_0x834e('0x2c')](function(_0x3c59af){return getInteractionTags(_0x3c59af,_0x1b2edf);})[_0x834e('0x2c')](function(_0x574ea8){return getStateInteraction(_0x574ea8);})[_0x834e('0x2c')](function(_0x26b847){_0x2e5239(_0x26b847);})[_0x834e('0x22')](function(_0x58c5fb){_0x1ba66d(_0x58c5fb);});});}function getStateInteraction(_0x35380e){return new BPromise(function(_0x16ac45){_0x35380e['waiting']=0x0;_0x35380e[_0x834e('0x3b')]=0x0;_0x35380e['answered']=0x0;_0x35380e[_0x834e('0x3c')]=0x0;_0x35380e[_0x834e('0x3d')]=0x0;_0x35380e['total']=0x0;if(!_0x35380e['closed']&&!_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x3f')]+=0x1;}if(!_0x35380e[_0x834e('0x40')]&&_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x3b')]+=0x1;if(_0x35380e[_0x834e('0x3f')]){_0x35380e[_0x834e('0x3f')]-=0x1;}}if(_0x35380e['closed']&&_0x35380e[_0x834e('0x41')]==='abandoned'){_0x35380e[_0x834e('0x3d')]+=0x1;if(_0x35380e['waiting']){_0x35380e[_0x834e('0x3f')]-=0x1;}}else if(_0x35380e['closed']&&!_0x35380e[_0x834e('0x3e')]&&_0x35380e[_0x834e('0x41')]){_0x35380e['unmanaged']+=0x1;if(_0x35380e[_0x834e('0x3f')]){_0x35380e[_0x834e('0x3f')]-=0x1;}}else if(_0x35380e[_0x834e('0x40')]&&_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x42')]+=0x1;if(_0x35380e[_0x834e('0x3b')]){_0x35380e[_0x834e('0x3b')]-=0x1;}}_0x35380e[_0x834e('0x43')]+=0x1;_0x16ac45(_0x35380e);});}exports[_0x834e('0x44')]=function(_0x279ea1,_0x5f3943){var _0x3124be={},_0x6fff27={},_0x47a8a9={'count':0x0,'rows':[]};var _0x112306=_[_0x834e('0x45')](db[_0x834e('0x46')][_0x834e('0x47')],function(_0x19b5ef){return{'name':_0x19b5ef[_0x834e('0x48')],'type':_0x19b5ef['type']['key']};});_0x6fff27[_0x834e('0x49')]=_[_0x834e('0x45')](_0x112306,_0x834e('0x30'));_0x6fff27[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x279ea1[_0x834e('0x4a')]);_0x6fff27[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x6fff27[_0x834e('0x49')],_0x6fff27[_0x834e('0x4a')]);_0x3124be[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x6fff27[_0x834e('0x49')],qs[_0x834e('0x4f')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x4f')]));_0x3124be[_0x834e('0x4e')]=_0x3124be[_0x834e('0x4e')][_0x834e('0x50')]?_0x3124be[_0x834e('0x4e')]:_0x6fff27['model'];if(!_0x279ea1[_0x834e('0x4a')][_0x834e('0x51')]('nolimit')){_0x3124be[_0x834e('0x26')]=qs[_0x834e('0x26')](_0x279ea1['query'][_0x834e('0x26')]);_0x3124be[_0x834e('0x25')]=qs[_0x834e('0x25')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x25')]);}_0x3124be[_0x834e('0x52')]=qs[_0x834e('0x53')](_0x279ea1['query'][_0x834e('0x53')]);_0x3124be[_0x834e('0x54')]=qs[_0x834e('0x4c')](_[_0x834e('0x55')](_0x279ea1[_0x834e('0x4a')],_0x6fff27[_0x834e('0x4c')]),_0x112306);var _0x344b51=[];var _0x1bc975=squel['select']()[_0x834e('0x56')]('id')['field'](_0x834e('0x30'))['field'](_0x834e('0x57'))['from']('tools_tags');var _0x6c0b29=squel[_0x834e('0x58')]()['field']('u.id')[_0x834e('0x56')](_0x834e('0x59'))[_0x834e('0x56')](_0x834e('0x5a'))[_0x834e('0x5b')](_0x834e('0x5c'),'ui')[_0x834e('0x5d')](_0x834e('0x5e'),'u','u.id\x20=\x20ui.UserId');var _0x142334=squel[_0x834e('0x58')]()['from'](_0x834e('0x5f'),'i')['left_join'](_0x834e('0x60'),'c',_0x834e('0x61'))['left_join'](_0x834e('0x5e'),'o',_0x834e('0x62'))[_0x834e('0x5d')](_0x834e('0x63'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x834e('0x5d')](_0x834e('0x64'),'me',_0x834e('0x65'))['left_join'](_0x834e('0x66'),'it',_0x834e('0x67'))[_0x834e('0x5d')](_0x834e('0x68'),'t',_0x834e('0x69'));var _0x125f37=squel[_0x834e('0x6a')]();var _0x1def00=[];var _0x208c21=squel[_0x834e('0x6a')]();var _0x1e4310;if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x6b')]){_0x1e4310=as[_0x834e('0x6c')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x6b')]);var _0x297cce=_0x1e4310[_0x834e('0x6d')];for(var _0x193a15=0x0;_0x193a15<_0x1e4310[_0x834e('0x6e')][_0x834e('0x50')];_0x193a15++){var _0x2cb233=_0x1e4310['conditions'][_0x193a15];var _0x2145cf='i';var _0x25d6f4=_[_0x834e('0x6f')](_0x112306,[_0x834e('0x30'),_0x2cb233['field']]);if(!_0x25d6f4){switch(_0x2cb233[_0x834e('0x56')]){case'unreadMessages':if(_0x2cb233['value']==0x1){_0x142334[_0x834e('0x70')]('`'+_0x2cb233[_0x834e('0x56')]+_0x834e('0x71'));}else{_0x142334[_0x834e('0x70')]('`'+_0x2cb233[_0x834e('0x56')]+_0x834e('0x72'));}break;case _0x834e('0x73'):if(_0x2cb233[_0x834e('0x74')]==='$substring'){if(_0x2cb233[_0x834e('0x75')]['split']('\x20')[_0x834e('0x50')]>0x1){_0x125f37[_0x297cce](_0x834e('0x76'),qs['getFullTextValue'](_0x2cb233['value']),null);}else{var _0x4a4def='%'+_0x2cb233[_0x834e('0x75')]+'%';_0x125f37[_0x297cce](_0x834e('0x77'),_0x4a4def,_0x4a4def,_0x4a4def);}}else{_0x25d6f4=_[_0x834e('0x6f')](_0x112306,[_0x834e('0x30'),'ContactId']);_0x2cb233[_0x834e('0x56')]=_0x834e('0x78');_0x11f6f0=as[_0x834e('0x79')](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x24')]);}break;case _0x834e('0x7d'):var _0x5b2bf6=_0x2cb233[_0x834e('0x75')][_0x834e('0x38')](',')[_0x834e('0x45')](function(_0x5b5d6f){return Number(_0x5b5d6f);});_0x5b2bf6['forEach'](function(_0x46fa0d){_0x208c21['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x46fa0d+',%');});_0x1def00=_['union'](_0x1def00,_0x5b2bf6);break;case'User':if(_0x2cb233[_0x834e('0x74')]===_0x834e('0x7e')){_0x125f37[_0x297cce]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2cb233[_0x834e('0x75')]+'%',null);}else{_0x25d6f4=_[_0x834e('0x6f')](_0x112306,['name',_0x834e('0x3e')]);_0x2cb233[_0x834e('0x56')]='UserId';_0x11f6f0=as['buildExpression'](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0[_0x834e('0x75')]['end']);}break;case _0x834e('0x33'):_0x11f6f0=as['buildExpression']('me',null,_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0['value'][_0x834e('0x24')]);break;}}else{var _0x11f6f0=as['buildExpression'](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')]['start'],_0x11f6f0[_0x834e('0x75')][_0x834e('0x24')]);}}}else{var _0x402692=_(_0x279ea1[_0x834e('0x4a')])[_0x834e('0x4b')]()[_0x834e('0x45')](function(_0x1372dd){return _[_0x834e('0x7f')](_0x112306,[_0x834e('0x30'),_0x1372dd])?_0x1372dd:undefined;})[_0x834e('0x80')]()['value']();if(!_['isEmpty'](_0x402692)){_0x402692['forEach'](function(_0x36ede9){if(_0x36ede9===_0x834e('0x81')){_0x142334[_0x834e('0x54')](_0x834e('0x82'),[][_0x834e('0x83')](_0x279ea1['query'][_0x36ede9]));}else if(_0x36ede9==='createdAt'){var _0x4520fc=JSON[_0x834e('0x84')](_0x279ea1[_0x834e('0x4a')][_0x36ede9])[_0x834e('0x85')];var _0x40a705=JSON['parse'](_0x279ea1[_0x834e('0x4a')][_0x36ede9])[_0x834e('0x86')];_0x142334[_0x834e('0x54')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4520fc,_0x40a705);}else{if(_0x279ea1[_0x834e('0x4a')][_0x36ede9]===_0x834e('0x87')){_0x142334[_0x834e('0x54')]('i.'+_0x36ede9+_0x834e('0x88'));}else{_0x142334[_0x834e('0x54')]('i.'+_0x36ede9+'\x20=\x20?',_0x279ea1['query'][_0x36ede9]);}}});}if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x89')]){if(_0x279ea1['query'][_0x834e('0x89')]==0x1){_0x142334['having'](_0x834e('0x8a'));}else{_0x142334[_0x834e('0x70')](_0x834e('0x8b'));}}if(_0x279ea1['query'][_0x834e('0x8c')]){_0x1def00=_['isArray'](_0x279ea1['query']['tag'])?_0x279ea1[_0x834e('0x4a')][_0x834e('0x8c')]:new Array(_0x279ea1[_0x834e('0x4a')][_0x834e('0x8c')]);_0x1def00[_0x834e('0x39')](function(_0x2dad55){_0x208c21['or'](_0x834e('0x8d'),'%,'+_0x2dad55+',%');});}if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x8e')]){var _0x53f6e3=_0x279ea1[_0x834e('0x4a')]['filter'][_0x834e('0x8f')]('\x5c','\x5c\x5c')[_0x834e('0x8f')](/'/g,'\x27\x27');if(qs[_0x834e('0x90')](_0x53f6e3)){_0x125f37['or'](_0x834e('0x91'),_0x53f6e3+'%');}else{_0x125f37['or'](_0x834e('0x92'),qs[_0x834e('0x93')](_0x53f6e3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x53f6e3+'%');}}}_0x142334['where'](_0x125f37);_0x142334[_0x834e('0x94')](_0x834e('0x95'));var _0x4eff8d={'type':db[_0x834e('0x96')][_0x834e('0x97')][_0x834e('0x98')],'raw':!![]};var _0x1e225f=_0x142334[_0x834e('0x99')]();_0x1e225f['field'](_0x834e('0x95'));_0x1e225f[_0x834e('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3124be['order']){_0x3124be[_0x834e('0x52')][_0x834e('0x39')](function(_0x4f716d){var _0x23ce49=_0x4f716d[0x0]===_0x834e('0x9a')?_0x4f716d[0x0]:'i.'+_0x4f716d[0x0];_0x142334['order'](_0x23ce49,_0x4f716d[0x1]===_0x834e('0x9b')?![]:!![]);});}if(!_['isEmpty'](_0x1def00)){_0x142334['having'](_0x208c21);_0x1e225f[_0x834e('0x54')](_0x834e('0x9c'),_0x1def00);}BPromise[_0x834e('0x9d')]()[_0x834e('0x2c')](function(){if(!_0x1e4310){if(_0x279ea1['query'][_0x834e('0x81')])return;_0x1e225f[_0x834e('0x54')](_0x834e('0x9e'));_0x142334[_0x834e('0x54')](_0x834e('0x9e'));return;}if(_0x279ea1[_0x834e('0x9f')][_0x834e('0xa0')]!==_0x834e('0xa1'))return;return _0x279ea1[_0x834e('0x9f')][_0x834e('0xa2')]({'attributes':['id'],'raw':!![]})[_0x834e('0x2c')](function(_0x261e3d){if(_[_0x834e('0xa3')](_0x261e3d)){_0x1e225f[_0x834e('0x54')](_0x834e('0xa4'));_0x142334[_0x834e('0x54')](_0x834e('0xa4'));}else{_0x1e225f[_0x834e('0x54')](_0x834e('0x82'),_[_0x834e('0x45')](_0x261e3d,'id'));_0x142334[_0x834e('0x54')](_0x834e('0x82'),_['map'](_0x261e3d,'id'));}});})[_0x834e('0x2c')](function(){if(_0x279ea1[_0x834e('0x9f')][_0x834e('0xa0')]===_0x834e('0xa1')&&!_0x1e4310&&!_0x279ea1[_0x834e('0x4a')][_0x834e('0x81')])return[];return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x1e225f[_0x834e('0xa6')](),_0x4eff8d);})['then'](function(_0x5ce790){_0x47a8a9['count']=_0x5ce790[_0x834e('0x50')];if(_0x47a8a9['count']===0x0)return[];return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x1bc975[_0x834e('0xa6')](),_0x4eff8d)['then'](function(_0xae00f){_0x344b51=_[_0x834e('0xa7')](_0xae00f,'id');_0x4eff8d=_[_0x834e('0xa8')](_0x4eff8d,{'model':db[_0x834e('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x4f')]){_0x3124be['attributes'][_0x834e('0x39')](function(_0x27bd2e){_0x142334[_0x834e('0x56')]('i.'+_0x27bd2e);});}else{_0x142334[_0x834e('0x56')](_0x834e('0xa9'),'unreadMessages');_0x142334['field']('a.key','Account.key');_0x142334[_0x834e('0x56')](_0x834e('0xaa'),'Account.mandatoryDisposition');_0x142334[_0x834e('0x56')](_0x834e('0xab'),'contactName');_0x142334[_0x834e('0x56')](_0x834e('0xac'));_0x142334[_0x834e('0x56')](_0x834e('0xad'),_0x834e('0xae'));_0x142334[_0x834e('0x56')]('c.lastName','Contact.lastName');_0x142334[_0x834e('0x56')](_0x834e('0xaf'),_0x834e('0xb0'));_0x142334['field'](_0x834e('0xb1'),_0x834e('0xb2'));_0x142334['field'](_0x834e('0xb3'),_0x834e('0xb4'));_0x142334[_0x834e('0x56')](_0x834e('0xb5'),'Contact.fax');_0x142334[_0x834e('0x56')]('o.fullname','Owner.fullname');_0x142334[_0x834e('0x56')](_0x834e('0xb6'),_0x834e('0xb7'));_0x142334[_0x834e('0x56')](_0x834e('0xb8'),_0x834e('0x37'));}if(_0x3124be['limit'])_0x142334['limit'](_0x3124be[_0x834e('0x26')]);if(_0x3124be[_0x834e('0x25')])_0x142334[_0x834e('0x25')](_0x3124be[_0x834e('0x25')]);return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x142334[_0x834e('0xa6')](),_0x4eff8d);})['then'](function(_0x435a75){if(_0x435a75[_0x834e('0x50')]>0x0)_0x6c0b29['where'](_0x834e('0xb9'),_[_0x834e('0x45')](_0x435a75,'id'));return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x6c0b29[_0x834e('0xa6')](),_0x4eff8d)[_0x834e('0x2c')](function(_0x231f0b){var _0x3b44f3=_[_0x834e('0xba')](_0x231f0b,_0x834e('0xbb'));var _0x496709=[];_0x435a75[_0x834e('0x39')](function(_0x17e922){_0x496709[_0x834e('0xbc')](updateChatInteraction(_0x17e922,_0x344b51,_0x3b44f3));});return BPromise['all'](_0x496709);});});})[_0x834e('0x2c')](function(_0x20fdfd){_0x47a8a9['rows']=_0x20fdfd;return _0x47a8a9;})[_0x834e('0x2c')](respondWithFilteredResult(_0x5f3943,_0x3124be))['catch'](handleError(_0x5f3943,null));};exports[_0x834e('0xbd')]=function(_0x53c483,_0x16a42b){var _0x560d10={'raw':![],'where':{'id':_0x53c483[_0x834e('0xbe')]['id']}},_0x2b6d1={};_0x2b6d1[_0x834e('0x49')]=_[_0x834e('0x4b')](db['ChatInteraction'][_0x834e('0x47')]);_0x2b6d1[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x53c483[_0x834e('0x4a')]);_0x2b6d1[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x2b6d1[_0x834e('0x49')],_0x2b6d1[_0x834e('0x4a')]);_0x560d10[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x2b6d1[_0x834e('0x49')],qs[_0x834e('0x4f')](_0x53c483[_0x834e('0x4a')][_0x834e('0x4f')]));_0x560d10[_0x834e('0x4e')]=_0x560d10[_0x834e('0x4e')][_0x834e('0x50')]?_0x560d10['attributes']:_0x2b6d1['model'];if(_0x53c483[_0x834e('0x4a')][_0x834e('0xbf')]){_0x560d10[_0x834e('0xc0')]=[{'all':!![]}];}_0x560d10=_[_0x834e('0xa8')]({},_0x560d10,_0x53c483[_0x834e('0xc1')]);return db[_0x834e('0x46')][_0x834e('0x6f')](_0x560d10)[_0x834e('0x2c')](handleEntityNotFound(_0x16a42b,null))[_0x834e('0x2c')](respondWithResult(_0x16a42b,null))[_0x834e('0x22')](handleError(_0x16a42b,null));};exports[_0x834e('0xc2')]=function(_0x32645e,_0x513d9e){return db[_0x834e('0x46')]['create'](_0x32645e[_0x834e('0x33')],{})[_0x834e('0x2c')](respondWithResult(_0x513d9e,0xc9))[_0x834e('0x22')](handleError(_0x513d9e,null));};exports['update']=function(_0x1a65b4,_0x23a386){if(_0x1a65b4['body']['id']){delete _0x1a65b4['body']['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x1a65b4['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x23a386,null))[_0x834e('0x2c')](saveUpdates(_0x1a65b4[_0x834e('0x33')],null))[_0x834e('0x2c')](respondWithResult(_0x23a386,null))[_0x834e('0x22')](handleError(_0x23a386,null));};exports['destroy']=function(_0x4e7545,_0x453e58){return db['ChatInteraction']['find']({'where':{'id':_0x4e7545['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x453e58,null))[_0x834e('0x2c')](removeEntity(_0x453e58,null))['catch'](handleError(_0x453e58,null));};exports[_0x834e('0xc3')]=function(_0x66cbdc,_0x470568){return db[_0x834e('0x46')]['describe']()[_0x834e('0x2c')](respondWithResult(_0x470568,null))[_0x834e('0x22')](handleError(_0x470568,null));};exports[_0x834e('0xc4')]=function(_0x5633f4,_0x3d8af7){var _0x5f3b7d=_0x5633f4[_0x834e('0xbe')]['id'];var _0x4af2a2;var _0x461420;var _0x108100;return db['ChatInteraction'][_0x834e('0xc5')]({'where':{'id':_0x5f3b7d}})[_0x834e('0x2c')](function(_0x41e7a8){_0x4af2a2=_0x41e7a8;return db[_0x834e('0xc6')][_0x834e('0xc5')]({'where':{'id':_0x41e7a8[_0x834e('0x81')]},'attributes':['id','vidaooApiKey',_0x834e('0xc7'),_0x834e('0xc8'),_0x834e('0xc9'),_0x834e('0xca')],'raw':!![]});})[_0x834e('0x2c')](function(_0x1b8e67){if(_0x1b8e67&&_0x1b8e67['vidaooApiKey']&&_0x1b8e67[_0x834e('0xc7')]){_0x461420=_0x1b8e67;var _0x490a57={'interaction':{'id':_0x5f3b7d},'agent':{'id':_0x5633f4['user']['id'],'name':_0x5633f4[_0x834e('0x9f')]['name'],'fullname':_0x5633f4['user'][_0x834e('0xcb')],'email':_0x5633f4[_0x834e('0x9f')][_0x834e('0xcc')]},'contact':_0x5633f4[_0x834e('0x33')][_0x834e('0x34')],'account':_0x5633f4[_0x834e('0x33')][_0x834e('0x35')]};var _0x155f2d={'rejectUnauthorized':![],'method':_0x834e('0xcd'),'url':_0x834e('0xce'),'headers':{'X-APIKEY':_0x1b8e67[_0x834e('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5633f4[_0x834e('0x9f')][_0x834e('0xcc')]],'buttons':null,'topic':_0x461420[_0x834e('0xc8')],'note':_['isNull'](_0x461420[_0x834e('0xc9')])?null:getMustacheRender(_0x461420['vidaooNote'],_0x490a57),'metadata':null},'redirect':_0x834e('0xd0'),'json':!![]};try{if(!_[_0x834e('0xd1')](_0x461420[_0x834e('0xca')])){var _0x2cdbe0=getMustacheRender(_0x461420['vidaooMetadata'],_0x490a57);var _0x5f558a=JSON[_0x834e('0x84')](_0x2cdbe0);_0x155f2d[_0x834e('0x33')]['metadata']=_0x5f558a;}}catch(_0x375c35){throw new db[(_0x834e('0x96'))]['ValidationError'](_0x834e('0xd2'));}return rp(_0x155f2d);}else{throw new db[(_0x834e('0x96'))][(_0x834e('0xd3'))](_0x834e('0xd4'));}})['then'](function(_0x57ff06){_0x108100=_0x57ff06;if(_0x108100['id']){var _0x4ead1d={'body':_0x108100['join_url'],'ChatWebsiteId':_0x461420['id'],'ChatInteractionId':_0x4af2a2['id'],'direction':_0x834e('0xd5'),'UserId':_0x5633f4[_0x834e('0x9f')]['id']};return db['ChatMessage'][_0x834e('0xc2')](_0x4ead1d,{});}else{throw new db['Sequelize'][(_0x834e('0xd3'))](_0x834e('0xd6'));}})[_0x834e('0x2c')](function(){return _0x4af2a2[_0x834e('0xd7')]({'vidaooSessionId':_0x108100['id']});})[_0x834e('0x2c')](respondWithResult(_0x3d8af7,null))[_0x834e('0x22')](handleError(_0x3d8af7,null));};exports[_0x834e('0xd8')]=function(_0x4fc61d,_0x12a0f3){if(_0x4fc61d[_0x834e('0x33')]['id']){delete _0x4fc61d['body']['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x4fc61d['params']['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x834e('0x2c')](handleEntityNotFound(_0x12a0f3,null))[_0x834e('0x2c')](saveUpdates(_0x4fc61d[_0x834e('0x33')],null))['then'](respondWithResult(_0x12a0f3,null))[_0x834e('0x22')](handleError(_0x12a0f3,null));};exports[_0x834e('0xd9')]=function(_0xbd0346,_0x17e729){if(_0xbd0346[_0x834e('0x33')]['id']){delete _0xbd0346[_0x834e('0x33')]['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0xbd0346[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](function(_0x48b6c4){if(!_0x48b6c4){logger['error'](_0x834e('0xda'),_0x834e('0xd9'),0x194,_0x834e('0xdb'));_0x17e729[_0x834e('0x2e')](0x194);}else{if(_0x48b6c4[_0x834e('0x3e')]){throw new db[(_0x834e('0x96'))][(_0x834e('0xd3'))](_0x834e('0xdc'));}}return _0x48b6c4;})[_0x834e('0x2c')](function(_0x97a4b2){if(_0x97a4b2){return _0x97a4b2[_0x834e('0x2b')]({'closed':_0xbd0346[_0x834e('0x33')][_0x834e('0x40')],'disposition':_0xbd0346['body'][_0x834e('0x41')]})[_0x834e('0x2c')](function(_0x3f5b2e){return _0x3f5b2e;});}})[_0x834e('0x2c')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0xbd0346['body'],client9004);})[_0x834e('0x2c')](respondWithResult(_0x17e729,null))[_0x834e('0x22')](handleError(_0x17e729,null));};exports[_0x834e('0xdd')]=function(_0x23d7e6,_0x181ecd){_0x23d7e6[_0x834e('0x33')][_0x834e('0x30')]=_0x23d7e6[_0x834e('0xde')]['originalname'];_0x23d7e6['body']['basename']=_0x23d7e6['file'][_0x834e('0xdf')];_0x23d7e6[_0x834e('0x33')][_0x834e('0x7a')]=_0x23d7e6[_0x834e('0xde')][_0x834e('0xe0')];return db[_0x834e('0xe1')][_0x834e('0xc2')](_0x23d7e6[_0x834e('0x33')])[_0x834e('0x2c')](respondWithResult(_0x181ecd,0xc9))['catch'](handleError(_0x181ecd,null));};exports['attachmentDownload']=function(_0x4d1545,_0x5dc651){return db[_0x834e('0x46')][_0x834e('0xc5')]({'where':{'id':_0x4d1545[_0x834e('0xbe')]['id']},'raw':!![]})[_0x834e('0x2c')](handleEntityNotFound(_0x5dc651,null))[_0x834e('0x2c')](function(_0xcb9751){if(_0xcb9751){if(_0xcb9751[_0x834e('0x40')]){return _0x5dc651[_0x834e('0x23')](0x193)[_0x834e('0x2a')]({'status':0x193,'message':_0x834e('0xe2')});}return db[_0x834e('0xe1')][_0x834e('0xc5')]({'where':{'id':_0x4d1545[_0x834e('0x4a')][_0x834e('0xe3')]},'raw':!![]})[_0x834e('0x2c')](handleEntityNotFound(_0x5dc651,null));}})[_0x834e('0x2c')](function(_0x5022f2){if(_0x5022f2){var _0x13f473=_0x5022f2['ChatOfflineMessageId']!==null;var _0x1f6bb9=path[_0x834e('0xe4')](config[_0x834e('0xe5')],'server/files/attachments/');if(_0x13f473){_0x1f6bb9=path[_0x834e('0xe4')](_0x1f6bb9,_0x834e('0xe6'));}var _0x4d7fef=path['join'](_0x1f6bb9,_0x5022f2[_0x834e('0xe7')]);return _0x5dc651[_0x834e('0xe8')](_0x4d7fef);}})[_0x834e('0x22')](handleError(_0x5dc651,null));};exports[_0x834e('0xe9')]=function(_0x12d468,_0x2e9116){var _0x3eb2e8=null;var _0x239a4e=null;var _0x569a80=null;if(_0x12d468[_0x834e('0x33')]['id']){delete _0x12d468[_0x834e('0x33')]['id'];}if(_0x12d468[_0x834e('0x33')][_0x834e('0xea')]){_0x569a80=path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0xeb'),util['format'](_0x834e('0xec'),Date['now']()));_0x12d468['body'][_0x834e('0xed')]=_0x569a80;}return db[_0x834e('0x46')]['find']({'where':{'id':_0x12d468[_0x834e('0xbe')]['id']},'include':[{'model':db[_0x834e('0xee')],'as':'Messages','include':[{'model':db[_0x834e('0xef')],'as':_0x834e('0xef')}]}]})['then'](handleEntityNotFound(_0x2e9116,null))['then'](saveUpdates(_0x12d468[_0x834e('0x33')],null))[_0x834e('0x2c')](function(_0x4e6525){if(_0x4e6525){_0x3eb2e8=_0x4e6525;return db['ChatWebsite'][_0x834e('0x6f')]({'where':{'id':_0x3eb2e8[_0x834e('0x81')]}});}})['then'](function(_0x480290){if(_0x480290){_0x239a4e=_0x480290;return db['CmContact']['find']({'where':{'id':_0x3eb2e8[_0x834e('0x78')]}});}})['then'](function(_0x3be4c3){if(_0x3be4c3){if(_0x569a80){var _0x52cdcc=null;for(var _0x343348=0x1;_0x343348<_0x3eb2e8[_0x834e('0xf0')][_0x834e('0x50')];++_0x343348){_0x52cdcc=_0x3eb2e8[_0x834e('0xf0')][_0x343348];var _0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e[_0x834e('0xf3')],_0x52cdcc[_0x834e('0x3e')]):_0x834e('0xf4');var _0x3d8abb=_0x12d468[_0x834e('0x33')][_0x834e('0xf5')]||util[_0x834e('0xf1')]('%s%d',_0x834e('0xf6'),_0x52cdcc['ContactId']);switch(_0x239a4e[_0x834e('0xf7')]){case _0x834e('0xf8'):_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e['agentAlias'],_0x52cdcc[_0x834e('0x3e')]):'System';break;case'agent_alias':_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?_0x52cdcc[_0x834e('0xef')][_0x834e('0xf9')]||_0x52cdcc['User'][_0x834e('0xcb')]:_0x834e('0xf4');break;case _0x834e('0xfa'):_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?_0x52cdcc[_0x834e('0xef')][_0x834e('0xcb')]:_0x834e('0xf4');break;default:_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e[_0x834e('0xf3')],_0x52cdcc['UserId']):_0x834e('0xf4');}var _0x121d87=util[_0x834e('0xf1')](_0x834e('0xfb'),moment(_0x52cdcc[_0x834e('0xfc')])[_0x834e('0xf1')]('MM/DD/YYYY\x20HH:mm:ss'),_0x52cdcc[_0x834e('0xfd')]==='in'?_0x3d8abb:_0x4fabe6,_0x52cdcc[_0x834e('0x33')]);if(!_0x52cdcc[_0x834e('0xfe')]){fs[_0x834e('0xff')](_0x569a80,_0x121d87);}}return db[_0x834e('0x100')][_0x834e('0xc5')]({'where':{'service':!![]},'include':[{'model':db[_0x834e('0x101')],'as':_0x834e('0x102'),'raw':!![],'include':[{'model':db[_0x834e('0x103')],'as':_0x834e('0x103'),'raw':!![]}]}]});}}})['then'](function(_0x571645){if(!_0x571645||!_0x571645[_0x834e('0x102')]||!_0x12d468['body'])return _0x3eb2e8;var _0x4094d5=_0x571645[_0x834e('0x104')]();return respondWithRpcPromise(_0x834e('0x105'),_0x834e('0x106'),{'account':_0x4094d5,'message':{'from':util[_0x834e('0xf1')](_0x834e('0x107'),_0x571645['name'],_0x571645[_0x834e('0xcc')]||_0x571645['Smtp']['user']),'to':_0x12d468['body'][_0x834e('0xea')],'subject':_0x834e('0x108'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x12d468['body'][_0x834e('0xea')]),'attachments':[{'path':_0x569a80}]}})[_0x834e('0x2c')](function(){return _0x3eb2e8;})[_0x834e('0x22')](function(_0x5e0bfe){logger[_0x834e('0x1d')](_0x5e0bfe);});})[_0x834e('0x2c')](respondWithStatusCode(_0x2e9116,0xc8))[_0x834e('0x22')](handleError(_0x2e9116,null));};exports[_0x834e('0x109')]=function(_0xb9635a,_0x3c1a19){return db['ChatMessage']['find']({'where':{'id':_0xb9635a['params']['id']}})['then'](handleEntityNotFound(_0x3c1a19,null))[_0x834e('0x2c')](function(_0xf82ca8){if(_0xf82ca8){return _0xf82ca8[_0x834e('0x109')](_0xb9635a[_0x834e('0x33')][_0x834e('0x10a')],_[_0x834e('0x10b')](_0xb9635a[_0x834e('0x33')],[_0x834e('0x10a'),'id'])||{});}})[_0x834e('0x2c')](respondWithResult(_0x3c1a19,null))[_0x834e('0x22')](handleError(_0x3c1a19,null));};exports[_0x834e('0x10c')]=function(_0x18735a,_0x3446ff){var _0x1e11e0={'raw':![],'where':{}};var _0x38796c={};var _0x59bd0e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x834e('0xc5')]({'where':{'id':_0x18735a[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x3446ff,null))['then'](function(_0xf89b9e){if(_0xf89b9e){_0x38796c[_0x834e('0x49')]=_[_0x834e('0x4b')](db[_0x834e('0xee')][_0x834e('0x47')]);_0x38796c[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x18735a[_0x834e('0x4a')]);_0x38796c[_0x834e('0x4c')]=_['intersection'](_0x38796c[_0x834e('0x49')],_0x38796c[_0x834e('0x4a')]);_0x1e11e0[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x38796c['model'],qs[_0x834e('0x4f')](_0x18735a[_0x834e('0x4a')][_0x834e('0x4f')]));_0x1e11e0[_0x834e('0x4e')]=_0x1e11e0[_0x834e('0x4e')][_0x834e('0x50')]?_0x1e11e0[_0x834e('0x4e')]:_0x38796c[_0x834e('0x49')];if(!_0x18735a[_0x834e('0x4a')]['hasOwnProperty'](_0x834e('0x10d'))){_0x1e11e0['limit']=qs[_0x834e('0x26')](_0x18735a['query'][_0x834e('0x26')]);_0x1e11e0[_0x834e('0x25')]=qs[_0x834e('0x25')](_0x18735a[_0x834e('0x4a')][_0x834e('0x25')]);}_0x1e11e0['order']=qs[_0x834e('0x53')](_0x18735a[_0x834e('0x4a')]['sort']);_0x1e11e0['where']=qs[_0x834e('0x4c')](_['pick'](_0x18735a['query'],_0x38796c['filters']));_0x1e11e0[_0x834e('0x54')][_0x834e('0xbb')]=_0xf89b9e['id'];if(_0x18735a[_0x834e('0x4a')][_0x834e('0x8e')]){_0x1e11e0[_0x834e('0x54')]=_[_0x834e('0xa8')](_0x1e11e0[_0x834e('0x54')],{'$or':_['map'](_0x1e11e0[_0x834e('0x4e')],function(_0x278052){var _0x4a428c={};_0x4a428c[_0x278052]={'$like':'%'+_0x18735a['query'][_0x834e('0x8e')]+'%'};return _0x4a428c;})});}if(_0x18735a[_0x834e('0x4a')]['$gte']){var _0x5920f3=_0x18735a[_0x834e('0x4a')][_0x834e('0x85')][_0x834e('0x38')](',');var _0x599664={};_0x599664[_0x5920f3[0x0]]={'$gte':moment(_0x5920f3[0x1])[_0x834e('0xf1')](_0x834e('0x10e'))};_0x1e11e0[_0x834e('0x54')]=_['merge'](_0x1e11e0[_0x834e('0x54')],_0x599664);}_0x1e11e0=_['merge']({},_0x1e11e0,_0x18735a[_0x834e('0xc1')]);return db[_0x834e('0xee')][_0x834e('0x28')]({'where':_0x1e11e0[_0x834e('0x54')]})[_0x834e('0x2c')](function(_0x516a53){_0x59bd0e[_0x834e('0x28')]=_0x516a53;if(_0x18735a[_0x834e('0x4a')][_0x834e('0xbf')]){_0x1e11e0[_0x834e('0xc0')]=[{'all':!![]}];}return db[_0x834e('0xee')]['findAll'](_0x1e11e0);})['then'](function(_0x2ca127){_0x59bd0e[_0x834e('0x10f')]=_0x2ca127;return _0x59bd0e;});}})[_0x834e('0x2c')](respondWithFilteredResult(_0x3446ff,_0x1e11e0))['catch'](handleError(_0x3446ff,null));};exports[_0x834e('0x110')]=function(_0x2e3294,_0x28d9c3){var _0x386b73={'where':{}},_0x53faec={},_0x3cc563={'count':0x0,'rows':[]};return db[_0x834e('0x46')]['findOne']({'where':{'id':_0x2e3294[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x28d9c3,null))[_0x834e('0x2c')](function(_0x3e408c){if(_0x3e408c){_0x53faec['model']=_[_0x834e('0x4b')](db['ChatMessage'][_0x834e('0x47')]);_0x53faec[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x2e3294[_0x834e('0x4a')]);_0x53faec[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x53faec['model'],_0x53faec['query']);_0x386b73[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x53faec['model'],qs[_0x834e('0x4f')](_0x2e3294['query'][_0x834e('0x4f')]));_0x386b73[_0x834e('0x4e')]=_0x386b73[_0x834e('0x4e')][_0x834e('0x50')]?_0x386b73[_0x834e('0x4e')]:_0x53faec[_0x834e('0x49')];if(!_0x2e3294[_0x834e('0x4a')]['hasOwnProperty'](_0x834e('0x10d'))){_0x386b73[_0x834e('0x26')]=qs[_0x834e('0x26')](_0x2e3294[_0x834e('0x4a')][_0x834e('0x26')]);_0x386b73['offset']=qs[_0x834e('0x25')](_0x2e3294[_0x834e('0x4a')][_0x834e('0x25')]);}_0x386b73['order']=qs['sort'](_0x2e3294['query'][_0x834e('0x53')]);_0x386b73[_0x834e('0x54')]=qs[_0x834e('0x4c')](_[_0x834e('0x55')](_0x2e3294[_0x834e('0x4a')],_0x53faec[_0x834e('0x4c')]));_0x386b73[_0x834e('0x54')][_0x834e('0xbb')]=_0x3e408c['id'];if(_0x2e3294[_0x834e('0x4a')][_0x834e('0x8e')]){_0x386b73[_0x834e('0x54')]=_['merge'](_0x386b73[_0x834e('0x54')],{'$or':_[_0x834e('0x45')](_0x386b73[_0x834e('0x4e')],function(_0x26534d){var _0x4081a1={};_0x4081a1[_0x26534d]={'$like':'%'+_0x2e3294[_0x834e('0x4a')][_0x834e('0x8e')]+'%'};return _0x4081a1;})});}_0x386b73[_0x834e('0x54')]['secret']=![];if(_0x2e3294[_0x834e('0x4a')]['id']){_0x386b73[_0x834e('0x54')]['id']={'$gt':_0x2e3294['query']['id']};}_0x386b73=_[_0x834e('0xa8')]({},_0x386b73,_0x2e3294[_0x834e('0xc1')]);return db[_0x834e('0xee')][_0x834e('0x28')]({'where':_0x386b73['where']})['then'](function(_0x3d37c8){_0x3cc563['count']=_0x3d37c8;_0x386b73[_0x834e('0xc0')]=[];if(_0x2e3294[_0x834e('0x4a')][_0x834e('0x111')]){_0x386b73[_0x834e('0xc0')][_0x834e('0xbc')]({'model':db['User'],'as':_0x834e('0xef'),'attributes':['id','fullname','alias']});}if(_0x2e3294[_0x834e('0x4a')][_0x834e('0xbf')]){_0x386b73[_0x834e('0xc0')]=[{'all':!![]}];}return db[_0x834e('0xee')][_0x834e('0x112')](_0x386b73);})[_0x834e('0x2c')](function(_0x5912ee){_0x3cc563[_0x834e('0x10f')]=_0x5912ee;return _0x3cc563;});}})[_0x834e('0x2c')](respondWithFilteredResult(_0x28d9c3,_0x386b73))['catch'](handleError(_0x28d9c3,null));};exports[_0x834e('0x113')]=function(_0x3b4264,_0x4b070a){return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x3b4264['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x4b070a,null))[_0x834e('0x2c')](function(_0x164170){if(_0x164170){return _0x164170[_0x834e('0x114')](_0x3b4264[_0x834e('0x33')][_0x834e('0x10a')],_[_0x834e('0x10b')](_0x3b4264[_0x834e('0x33')],[_0x834e('0x10a'),'id'])||{})[_0x834e('0x115')](function(){return db['Tag'][_0x834e('0x112')]({'attributes':['id',_0x834e('0x30'),_0x834e('0x57')],'where':{'id':_0x3b4264[_0x834e('0x33')][_0x834e('0x10a')]}});})[_0x834e('0x2c')](function(_0x2d61c1){socket[_0x834e('0x116')](_0x834e('0x117'),{'id':Number(_0x3b4264[_0x834e('0xbe')]['id']),'tags':_0x2d61c1||[]});return{'id':Number(_0x3b4264[_0x834e('0xbe')]['id']),'tags':_0x2d61c1||[]};});}})[_0x834e('0x2c')](respondWithResult(_0x4b070a,null))['catch'](handleError(_0x4b070a,null));};exports[_0x834e('0x118')]=function(_0x1cd122,_0x49be08){return db['ChatInteraction']['find']({'where':{'id':_0x1cd122[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x49be08,null))[_0x834e('0x2c')](function(_0x3530bc){if(_0x3530bc){return _0x3530bc[_0x834e('0x118')](_0x1cd122[_0x834e('0x4a')][_0x834e('0x10a')]);}})['then'](respondWithStatusCode(_0x49be08,null))['catch'](handleError(_0x49be08,null));};exports['download']=function(_0x47947b,_0x684a97){var _0x3c8fc2=moment()[_0x834e('0x119')]()['toString']();var _0x5776c5=path['join'](config[_0x834e('0xe5')],'server','files',_0x834e('0x11a'));var _0x378bf3=path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0x11b'),_0x834e('0x11c'),_0x834e('0x11d'));var _0x59a706=path[_0x834e('0xe4')](_0x5776c5,_0x3c8fc2);var _0x11f472=util[_0x834e('0xf1')](_0x834e('0x11e'),_0x47947b[_0x834e('0xbe')]['id'],_0x3c8fc2);var _0x488f82=path[_0x834e('0xe4')](_0x5776c5,_0x11f472);var _0x5a3876=[];_0x5a3876[_0x834e('0xbc')]({'model':db[_0x834e('0xef')],'as':_0x834e('0xef'),'attributes':['id','fullname'],'raw':!![]});_0x5a3876['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x834e('0x11f'),_0x834e('0x120')],'raw':!![]});if(_0x47947b['query']['attachments']){_0x5a3876[_0x834e('0xbc')]({'model':db[_0x834e('0xe1')],'as':_0x834e('0xe1'),'raw':!![]});}var _0x51f527=[{'model':db[_0x834e('0xee')],'as':_0x834e('0xf0'),'attributes':['id',_0x834e('0x33'),'createdAt',_0x834e('0xfd'),_0x834e('0xfe'),_0x834e('0x89')],'include':_0x5a3876}];_0x51f527[_0x834e('0xbc')]({'model':db[_0x834e('0xc6')],'as':_0x834e('0x121'),'attributes':['id',_0x834e('0x30')]});_0x51f527['push']({'model':db[_0x834e('0xef')],'as':_0x834e('0x122'),'attributes':['id',_0x834e('0xcb')]});return db['ChatInteraction'][_0x834e('0x6f')]({'where':{'id':_0x47947b[_0x834e('0xbe')]['id']},'include':_0x51f527})[_0x834e('0x2c')](handleEntityNotFound(_0x684a97,null))[_0x834e('0x2c')](function(_0x2bbb1a){if(_0x2bbb1a){var _0x1ffed9=_0x2bbb1a[_0x834e('0x123')]({'plain':!![]});fs[_0x834e('0x124')](_0x59a706);var _0x25fa75={'channel':_0x834e('0x125'),'account':_0x1ffed9[_0x834e('0x121')][_0x834e('0x30')],'agent':_0x1ffed9['Owner']?_0x1ffed9[_0x834e('0x122')]['fullname']:_0x834e('0x126'),'createdAt':moment(_0x1ffed9['createdAt'])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')](),'closedAt':_0x1ffed9[_0x834e('0x40')]?moment(_0x1ffed9[_0x834e('0x127')])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')]():'','disposition':_0x1ffed9['disposition'],'chatInfo':{'browser':_0x1ffed9['browserName'],'os':_0x1ffed9['osName'],'referer':_0x1ffed9[_0x834e('0x128')],'customerIp':_0x1ffed9[_0x834e('0x129')],'customerPort':_0x1ffed9[_0x834e('0x12a')]?_0x1ffed9[_0x834e('0x12a')]:_0x834e('0x126')},'messages':_(_0x1ffed9[_0x834e('0xf0')])[_0x834e('0x12b')]()[_0x834e('0x8e')]({'secret':![]})['map'](function(_0x5a312e){if(_0x5a312e[_0x834e('0xe1')]){var _0x42e5ee=path[_0x834e('0xe4')](_0x378bf3,_0x5a312e['Attachment']['basename']);if(fs[_0x834e('0x12c')](_0x42e5ee)){fs['createReadStream'](_0x42e5ee)[_0x834e('0x12d')](fs[_0x834e('0x12e')](path[_0x834e('0xe4')](_0x59a706,_0x5a312e['Attachment'][_0x834e('0xe7')])));}}return{'date':moment(_0x5a312e[_0x834e('0xfc')])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')](),'sender':_0x5a312e[_0x834e('0xfd')]===_0x834e('0xd5')?_0x5a312e['User']?_0x5a312e[_0x834e('0xef')][_0x834e('0xcb')]:_0x834e('0xf4'):_0x5a312e[_0x834e('0x73')][_0x834e('0x11f')]+(_0x5a312e[_0x834e('0x73')][_0x834e('0x120')]?'\x20'+_0x5a312e['Contact']['lastName']:''),'body':_0x5a312e[_0x834e('0xe1')]?_0x5a312e['Attachment']['basename']:_0x5a312e[_0x834e('0x33')],'direction':_0x5a312e[_0x834e('0xfd')]==='out'?'A':'C','secret':_0x5a312e[_0x834e('0xfe')],'read':_0x5a312e['read'],'attachment':_0x5a312e['Attachment']};})[_0x834e('0x75')]()};return ejs['renderFile'](path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0x11b'),_0x834e('0x12f'),_0x834e('0x130')),{'interaction':_0x25fa75})[_0x834e('0x2c')](function(_0x1a48f9){var _0x196f86=path[_0x834e('0xe4')](_0x59a706,'transcript-'+_0x1ffed9['id']+'-'+_0x3c8fc2+_0x834e('0x131'));var _0x19a42c={'path':_0x196f86,'channel':_0x834e('0x125'),'interactionId':_0x1ffed9['id']};return pdf[_0x834e('0x132')](_0x1a48f9,_0x19a42c);})['then'](function(){return new Promise(function(_0x4b1178,_0x46e533){zipdir(_0x59a706,{'saveTo':_0x488f82},function(_0x13a7e1,_0x5d801a){if(_0x13a7e1)return _0x46e533(_0x13a7e1);return _0x4b1178(_0x5d801a);});})[_0x834e('0x2c')](function(){return new BPromise(function(_0x505821,_0x2f46cf){rimraf(_0x59a706,function(_0x884f38){if(_0x884f38)_0x2f46cf(_0x884f38);return _0x505821();});});})[_0x834e('0x2c')](function(){return _0x684a97[_0x834e('0xe8')](_0x488f82,_0x11f472,function(_0xd7026f){if(_0xd7026f){logger[_0x834e('0x1d')]('err',_0xd7026f);}else{fs['unlinkSync'](_0x488f82);}});});});}else{return _0x684a97['sendStatus'](0xc8);}})[_0x834e('0x22')](handleError(_0x684a97,null));}; \ No newline at end of file +var _0xd0bb=['CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','text','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$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?','filter','replace','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','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','toString','count','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','includeAll','include','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','file','originalname','basename','attachmentDownload','Unauthorized','Attachment','ChatOfflineMessageId','join','root','offline-chat/','download','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','agentAlias','customer','Visitor','System','agent_alias','alias','agent_fullname','%s%d','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','server','files','transcript-%d-%s.zip','firstName','attachments','Owner','Chat','Account','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','./chatInteraction.socket','jayson/promise','client','http','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','update','destroy','stack','name','send','render','merge','body','contact','interaction','account','Users','map','TagIds','split','forEach','catch','waiting','talking','answered','abandoned','total','closed','UserId','disposition','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','u.fullname','user_has_chat_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','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','union'];(function(_0x35524d,_0x210701){var _0x56d59b=function(_0x45aa91){while(--_0x45aa91){_0x35524d['push'](_0x35524d['shift']());}};_0x56d59b(++_0x210701);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x2e1d7c,_0x1742f0){_0x2e1d7c=_0x2e1d7c-0x0;var _0x4508b9=_0xd0bb[_0x2e1d7c];return _0x4508b9;};'use strict';var rimraf=require(_0xbd0b('0x0'));var zipdir=require(_0xbd0b('0x1'));var rp=require(_0xbd0b('0x2'));var moment=require('moment');var BPromise=require(_0xbd0b('0x3'));var Mustache=require('mustache');var util=require(_0xbd0b('0x4'));var path=require(_0xbd0b('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbd0b('0x6'));var squel=require('squel');var Redis=require(_0xbd0b('0x7'));var qs=require(_0xbd0b('0x8'));var as=require(_0xbd0b('0x9'));var pdf=require(_0xbd0b('0xa'));var logger=require(_0xbd0b('0xb'))('api');var config=require(_0xbd0b('0xc'));var db=require(_0xbd0b('0xd'))['db'];config[_0xbd0b('0xe')]=_[_0xbd0b('0xf')](config[_0xbd0b('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd0b('0xe')]));require(_0xbd0b('0x10'))['register'](socket);var jayson=require(_0xbd0b('0x11'));var client=jayson[_0xbd0b('0x12')]['http']({'port':0x232b});var client9004=jayson[_0xbd0b('0x12')][_0xbd0b('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x3a4b28,_0x315ed9,_0x2621bf,_0x42a96b){return new BPromise(function(_0x420f96,_0x1f25b6){var _0x1a55ab=_0x42a96b||client;return _0x1a55ab[_0xbd0b('0x14')](_0x3a4b28,_0x2621bf)[_0xbd0b('0x15')](function(_0x57077a){logger[_0xbd0b('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x315ed9,'request\x20sent');logger[_0xbd0b('0x17')](_0xbd0b('0x18'),_0x315ed9,_0xbd0b('0x19'),JSON[_0xbd0b('0x1a')](_0x57077a));if(_0x57077a[_0xbd0b('0x1b')]){if(_0x57077a['error']['code']===0x1f4){logger[_0xbd0b('0x1b')](_0xbd0b('0x1c'),_0x315ed9,_0x57077a[_0xbd0b('0x1b')][_0xbd0b('0x1d')]);return _0x1f25b6(_0x57077a[_0xbd0b('0x1b')][_0xbd0b('0x1d')]);}logger['error'](_0xbd0b('0x1c'),_0x315ed9,_0x57077a['error'][_0xbd0b('0x1d')]);return _0x420f96(_0x57077a[_0xbd0b('0x1b')][_0xbd0b('0x1d')]);}else{logger[_0xbd0b('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x315ed9,_0xbd0b('0x19'));_0x420f96(_0x57077a[_0xbd0b('0x1e')][_0xbd0b('0x1d')]);}})['catch'](function(_0x1c5b52){logger['error'](_0xbd0b('0x1c'),_0x315ed9,_0x1c5b52);_0x1f25b6(_0x1c5b52);});});}function respondWithStatusCode(_0x3c4938,_0x3bbc03){_0x3bbc03=_0x3bbc03||0xcc;return function(_0x17a92a){if(_0x17a92a){return _0x3c4938[_0xbd0b('0x1f')](_0x3bbc03);}return _0x3c4938['status'](_0x3bbc03)[_0xbd0b('0x20')]();};}function respondWithResult(_0x58a721,_0x3e7e9c){_0x3e7e9c=_0x3e7e9c||0xc8;return function(_0x18b9dc){if(_0x18b9dc){return _0x58a721[_0xbd0b('0x21')](_0x3e7e9c)[_0xbd0b('0x22')](_0x18b9dc);}};}function respondWithFilteredResult(_0xfd9f82,_0xb06342){return function(_0x4fe9ed){if(_0x4fe9ed){var _0x382f76=typeof _0xb06342[_0xbd0b('0x23')]===_0xbd0b('0x24')&&typeof _0xb06342[_0xbd0b('0x25')]===_0xbd0b('0x24');var _0x122893=_0x4fe9ed['count'];var _0x149403=_0x382f76?0x0:_0xb06342[_0xbd0b('0x23')];var _0x82d326=_0x382f76?_0x4fe9ed['count']:_0xb06342['offset']+_0xb06342[_0xbd0b('0x25')];var _0x684b09;if(_0x82d326>=_0x122893){_0x82d326=_0x122893;_0x684b09=0xc8;}else{_0x684b09=0xce;}_0xfd9f82[_0xbd0b('0x21')](_0x684b09);return _0xfd9f82[_0xbd0b('0x26')](_0xbd0b('0x27'),_0x149403+'-'+_0x82d326+'/'+_0x122893)[_0xbd0b('0x22')](_0x4fe9ed);}return null;};}function saveUpdates(_0x41e083){return function(_0x4bc752){if(_0x4bc752){return _0x4bc752[_0xbd0b('0x28')](_0x41e083)[_0xbd0b('0x15')](function(_0x5e1cb3){return _0x5e1cb3;});}return null;};}function removeEntity(_0x5e5e69){return function(_0x206c6a){if(_0x206c6a){return _0x206c6a[_0xbd0b('0x29')]()['then'](function(){_0x5e5e69[_0xbd0b('0x21')](0xcc)[_0xbd0b('0x20')]();});}};}function handleEntityNotFound(_0x431e51){return function(_0x417e25){if(!_0x417e25){_0x431e51[_0xbd0b('0x1f')](0x194);}return _0x417e25;};}function handleError(_0x27c478,_0x5f224e){_0x5f224e=_0x5f224e||0x1f4;return function(_0x2c8e69){logger[_0xbd0b('0x1b')](_0x2c8e69[_0xbd0b('0x2a')]);if(_0x2c8e69[_0xbd0b('0x2b')]){delete _0x2c8e69[_0xbd0b('0x2b')];}_0x27c478[_0xbd0b('0x21')](_0x5f224e)[_0xbd0b('0x2c')](_0x2c8e69);};}function getMustacheRender(_0x1029a0,_0x10e06b){return Mustache[_0xbd0b('0x2d')](_0x1029a0,_[_0xbd0b('0x2e')](_0x10e06b[_0xbd0b('0x2f')],{'contact':_0x10e06b[_0xbd0b('0x30')],'message':_0x10e06b[_0xbd0b('0x1d')],'agent':_0x10e06b['agent'],'interaction':_0x10e06b[_0xbd0b('0x31')],'account':_0x10e06b[_0xbd0b('0x32')]}))||'';}function getInteractionUsers(_0x545f59,_0x44b09e){return new BPromise(function(_0x1145b6,_0x19957a){try{if(_0x44b09e[_0x545f59['id']]){_0x545f59[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0x44b09e[_0x545f59['id']],function(_0x288715){return{'id':_0x288715['id'],'fullname':_0x288715['fullname']};});}}catch(_0x327425){_0x19957a(_0x327425);}_0x1145b6(_0x545f59);});}function getInteractionTags(_0x11cf5a,_0x3b5098){return new BPromise(function(_0x2597ab,_0x6ef6ed){try{if(_0x11cf5a['TagIds']){_0x11cf5a['Tags']=[];_0x11cf5a[_0xbd0b('0x35')][_0xbd0b('0x36')](',')[_0xbd0b('0x37')](function(_0x2ac653){_0x11cf5a['Tags']['push'](_0x3b5098[_0x2ac653]);});}delete _0x11cf5a[_0xbd0b('0x35')];}catch(_0x4d8237){_0x6ef6ed(_0x4d8237);}_0x2597ab(_0x11cf5a);});}function updateChatInteraction(_0x27f973,_0x27bdc5,_0x3f34dc){return new BPromise(function(_0x297ddb,_0x3e2ad9){return getInteractionUsers(_0x27f973,_0x3f34dc)[_0xbd0b('0x15')](function(_0x43115e){return getInteractionTags(_0x43115e,_0x27bdc5);})[_0xbd0b('0x15')](function(_0x2acc9f){return getStateInteraction(_0x2acc9f);})[_0xbd0b('0x15')](function(_0x16a40c){_0x297ddb(_0x16a40c);})[_0xbd0b('0x38')](function(_0x2a6e4a){_0x3e2ad9(_0x2a6e4a);});});}function getStateInteraction(_0x425c8a){return new BPromise(function(_0x11b1a0){_0x425c8a[_0xbd0b('0x39')]=0x0;_0x425c8a[_0xbd0b('0x3a')]=0x0;_0x425c8a[_0xbd0b('0x3b')]=0x0;_0x425c8a['unmanaged']=0x0;_0x425c8a[_0xbd0b('0x3c')]=0x0;_0x425c8a[_0xbd0b('0x3d')]=0x0;if(!_0x425c8a[_0xbd0b('0x3e')]&&!_0x425c8a[_0xbd0b('0x3f')]){_0x425c8a[_0xbd0b('0x39')]+=0x1;}if(!_0x425c8a[_0xbd0b('0x3e')]&&_0x425c8a[_0xbd0b('0x3f')]){_0x425c8a[_0xbd0b('0x3a')]+=0x1;if(_0x425c8a[_0xbd0b('0x39')]){_0x425c8a[_0xbd0b('0x39')]-=0x1;}}if(_0x425c8a[_0xbd0b('0x3e')]&&_0x425c8a[_0xbd0b('0x40')]==='abandoned'){_0x425c8a[_0xbd0b('0x3c')]+=0x1;if(_0x425c8a['waiting']){_0x425c8a['waiting']-=0x1;}}else if(_0x425c8a[_0xbd0b('0x3e')]&&!_0x425c8a[_0xbd0b('0x3f')]&&_0x425c8a[_0xbd0b('0x40')]){_0x425c8a['unmanaged']+=0x1;if(_0x425c8a[_0xbd0b('0x39')]){_0x425c8a[_0xbd0b('0x39')]-=0x1;}}else if(_0x425c8a[_0xbd0b('0x3e')]&&_0x425c8a[_0xbd0b('0x3f')]){_0x425c8a[_0xbd0b('0x3b')]+=0x1;if(_0x425c8a['talking']){_0x425c8a[_0xbd0b('0x3a')]-=0x1;}}_0x425c8a[_0xbd0b('0x3d')]+=0x1;_0x11b1a0(_0x425c8a);});}exports[_0xbd0b('0x41')]=function(_0x43e626,_0x102147){var _0xaaefaa={},_0x480c00={},_0x335728={'count':0x0,'rows':[]};var _0xaeb8b6=_[_0xbd0b('0x34')](db[_0xbd0b('0x42')][_0xbd0b('0x43')],function(_0x35bed3){return{'name':_0x35bed3[_0xbd0b('0x44')],'type':_0x35bed3[_0xbd0b('0x45')][_0xbd0b('0x46')]};});_0x480c00[_0xbd0b('0x47')]=_[_0xbd0b('0x34')](_0xaeb8b6,_0xbd0b('0x2b'));_0x480c00[_0xbd0b('0x48')]=_[_0xbd0b('0x49')](_0x43e626[_0xbd0b('0x48')]);_0x480c00[_0xbd0b('0x4a')]=_[_0xbd0b('0x4b')](_0x480c00[_0xbd0b('0x47')],_0x480c00[_0xbd0b('0x48')]);_0xaaefaa[_0xbd0b('0x4c')]=_[_0xbd0b('0x4b')](_0x480c00[_0xbd0b('0x47')],qs[_0xbd0b('0x4d')](_0x43e626['query'][_0xbd0b('0x4d')]));_0xaaefaa[_0xbd0b('0x4c')]=_0xaaefaa['attributes']['length']?_0xaaefaa['attributes']:_0x480c00[_0xbd0b('0x47')];if(!_0x43e626['query'][_0xbd0b('0x4e')](_0xbd0b('0x4f'))){_0xaaefaa[_0xbd0b('0x25')]=qs[_0xbd0b('0x25')](_0x43e626['query'][_0xbd0b('0x25')]);_0xaaefaa['offset']=qs[_0xbd0b('0x23')](_0x43e626['query']['offset']);}_0xaaefaa[_0xbd0b('0x50')]=qs[_0xbd0b('0x51')](_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x51')]);_0xaaefaa[_0xbd0b('0x52')]=qs[_0xbd0b('0x4a')](_[_0xbd0b('0x53')](_0x43e626[_0xbd0b('0x48')],_0x480c00['filters']),_0xaeb8b6);var _0x48a78c=[];var _0x2d13fd=squel[_0xbd0b('0x54')]()['field']('id')['field'](_0xbd0b('0x2b'))[_0xbd0b('0x55')](_0xbd0b('0x56'))[_0xbd0b('0x57')]('tools_tags');var _0x444f7d=squel[_0xbd0b('0x54')]()[_0xbd0b('0x55')](_0xbd0b('0x58'))['field'](_0xbd0b('0x59'))[_0xbd0b('0x55')]('ui.ChatInteractionId')[_0xbd0b('0x57')](_0xbd0b('0x5a'),'ui')[_0xbd0b('0x5b')](_0xbd0b('0x5c'),'u',_0xbd0b('0x5d'));var _0x2c86eb=squel[_0xbd0b('0x54')]()[_0xbd0b('0x57')]('chat_interactions','i')[_0xbd0b('0x5b')](_0xbd0b('0x5e'),'c',_0xbd0b('0x5f'))[_0xbd0b('0x5b')](_0xbd0b('0x5c'),'o',_0xbd0b('0x60'))['left_join']('chat_websites','a',_0xbd0b('0x61'))[_0xbd0b('0x5b')]('chat_messages','me',_0xbd0b('0x62'))[_0xbd0b('0x5b')](_0xbd0b('0x63'),'it',_0xbd0b('0x64'))[_0xbd0b('0x5b')]('tools_tags','t',_0xbd0b('0x65'));var _0xcc2012=squel[_0xbd0b('0x66')]();var _0x26a7d9=[];var _0x3fe55a=squel[_0xbd0b('0x66')]();var _0x19e3c0;if(_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x67')]){_0x19e3c0=as[_0xbd0b('0x68')](_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x67')]);var _0x20502d=_0x19e3c0[_0xbd0b('0x69')];for(var _0x164a2e=0x0;_0x164a2e<_0x19e3c0[_0xbd0b('0x6a')][_0xbd0b('0x6b')];_0x164a2e++){var _0x5363eb=_0x19e3c0[_0xbd0b('0x6a')][_0x164a2e];var _0x3f6f14='i';var _0x319ee8=_[_0xbd0b('0x6c')](_0xaeb8b6,['name',_0x5363eb['field']]);if(!_0x319ee8){switch(_0x5363eb[_0xbd0b('0x55')]){case _0xbd0b('0x6d'):if(_0x5363eb[_0xbd0b('0x6e')]==0x1){_0x2c86eb[_0xbd0b('0x6f')]('`'+_0x5363eb[_0xbd0b('0x55')]+'`\x20=\x200');}else{_0x2c86eb[_0xbd0b('0x6f')]('`'+_0x5363eb['field']+_0xbd0b('0x70'));}break;case _0xbd0b('0x71'):if(_0x5363eb[_0xbd0b('0x72')]===_0xbd0b('0x73')){if(_0x5363eb[_0xbd0b('0x6e')][_0xbd0b('0x36')]('\x20')['length']>0x1){_0xcc2012[_0x20502d](_0xbd0b('0x74'),qs[_0xbd0b('0x75')](_0x5363eb[_0xbd0b('0x6e')]),null);}else{var _0x33313a='%'+_0x5363eb['value']+'%';_0xcc2012[_0x20502d](_0xbd0b('0x76'),_0x33313a,_0x33313a,_0x33313a);}}else{_0x319ee8=_[_0xbd0b('0x6c')](_0xaeb8b6,[_0xbd0b('0x2b'),_0xbd0b('0x77')]);_0x5363eb[_0xbd0b('0x55')]='ContactId';_0x3dd85f=as['buildExpression'](_0x3f6f14,_0x319ee8[_0xbd0b('0x45')],_0x5363eb);_0xcc2012[_0x20502d](_0x3dd85f['text'],_0x3dd85f[_0xbd0b('0x6e')][_0xbd0b('0x78')],_0x3dd85f[_0xbd0b('0x6e')][_0xbd0b('0x20')]);}break;case _0xbd0b('0x79'):var _0x42d8ed=_0x5363eb['value'][_0xbd0b('0x36')](',')['map'](function(_0x271463){return Number(_0x271463);});_0x42d8ed['forEach'](function(_0x4f2d7c){_0x3fe55a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4f2d7c+',%');});_0x26a7d9=_[_0xbd0b('0x7a')](_0x26a7d9,_0x42d8ed);break;case'User':if(_0x5363eb['operator']===_0xbd0b('0x73')){_0xcc2012[_0x20502d](_0xbd0b('0x7b'),'%'+_0x5363eb['value']+'%',null);}else{_0x319ee8=_[_0xbd0b('0x6c')](_0xaeb8b6,['name','UserId']);_0x5363eb[_0xbd0b('0x55')]=_0xbd0b('0x3f');_0x3dd85f=as[_0xbd0b('0x7c')](_0x3f6f14,_0x319ee8[_0xbd0b('0x45')],_0x5363eb);_0xcc2012[_0x20502d](_0x3dd85f[_0xbd0b('0x7d')],_0x3dd85f[_0xbd0b('0x6e')][_0xbd0b('0x78')],_0x3dd85f[_0xbd0b('0x6e')]['end']);}break;case'body':_0x3dd85f=as[_0xbd0b('0x7c')]('me',null,_0x5363eb);_0xcc2012[_0x20502d](_0x3dd85f['text'],_0x3dd85f[_0xbd0b('0x6e')][_0xbd0b('0x78')],_0x3dd85f[_0xbd0b('0x6e')]['end']);break;}}else{var _0x3dd85f=as[_0xbd0b('0x7c')](_0x3f6f14,_0x319ee8['type'],_0x5363eb);_0xcc2012[_0x20502d](_0x3dd85f[_0xbd0b('0x7d')],_0x3dd85f[_0xbd0b('0x6e')][_0xbd0b('0x78')],_0x3dd85f[_0xbd0b('0x6e')][_0xbd0b('0x20')]);}}}else{var _0x5e7d6a=_(_0x43e626[_0xbd0b('0x48')])[_0xbd0b('0x49')]()[_0xbd0b('0x34')](function(_0x2db3a0){return _['some'](_0xaeb8b6,[_0xbd0b('0x2b'),_0x2db3a0])?_0x2db3a0:undefined;})[_0xbd0b('0x7e')]()['value']();if(!_[_0xbd0b('0x7f')](_0x5e7d6a)){_0x5e7d6a['forEach'](function(_0x39c327){if(_0x39c327===_0xbd0b('0x80')){_0x2c86eb[_0xbd0b('0x52')](_0xbd0b('0x81'),[][_0xbd0b('0x82')](_0x43e626['query'][_0x39c327]));}else if(_0x39c327==='createdAt'){var _0x4ccc9e=JSON[_0xbd0b('0x83')](_0x43e626[_0xbd0b('0x48')][_0x39c327])[_0xbd0b('0x84')];var _0x4f3b37=JSON[_0xbd0b('0x83')](_0x43e626[_0xbd0b('0x48')][_0x39c327])[_0xbd0b('0x85')];_0x2c86eb[_0xbd0b('0x52')](_0xbd0b('0x86'),_0x4ccc9e,_0x4f3b37);}else{if(_0x43e626['query'][_0x39c327]===_0xbd0b('0x87')){_0x2c86eb['where']('i.'+_0x39c327+_0xbd0b('0x88'));}else{_0x2c86eb[_0xbd0b('0x52')]('i.'+_0x39c327+_0xbd0b('0x89'),_0x43e626[_0xbd0b('0x48')][_0x39c327]);}}});}if(_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x8a')]){if(_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x8a')]==0x1){_0x2c86eb[_0xbd0b('0x6f')](_0xbd0b('0x8b'));}else{_0x2c86eb['having'](_0xbd0b('0x8c'));}}if(_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x8d')]){_0x26a7d9=_[_0xbd0b('0x8e')](_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x8d')])?_0x43e626[_0xbd0b('0x48')]['tag']:new Array(_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x8d')]);_0x26a7d9[_0xbd0b('0x37')](function(_0x568ce5){_0x3fe55a['or'](_0xbd0b('0x8f'),'%,'+_0x568ce5+',%');});}if(_0x43e626['query'][_0xbd0b('0x90')]){var _0x1c81d6=_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x90')][_0xbd0b('0x91')]('\x5c','\x5c\x5c')[_0xbd0b('0x91')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1c81d6)){_0xcc2012['or'](_0xbd0b('0x92'),_0x1c81d6+'%');}else{_0xcc2012['or'](_0xbd0b('0x93'),qs[_0xbd0b('0x75')](_0x1c81d6))['or'](_0xbd0b('0x94'),_0x1c81d6+'%');}}}_0x2c86eb['where'](_0xcc2012);_0x2c86eb[_0xbd0b('0x95')]('i.id');var _0x17dd54={'type':db[_0xbd0b('0x96')][_0xbd0b('0x97')][_0xbd0b('0x98')],'raw':!![]};var _0x107275=_0x2c86eb[_0xbd0b('0x99')]();_0x107275[_0xbd0b('0x55')](_0xbd0b('0x9a'));_0x107275[_0xbd0b('0x55')](_0xbd0b('0x9b'),_0xbd0b('0x6d'));if(_0xaaefaa[_0xbd0b('0x50')]){_0xaaefaa[_0xbd0b('0x50')]['forEach'](function(_0x39740c){var _0x2a86f5=_0x39740c[0x0]===_0xbd0b('0x9c')?_0x39740c[0x0]:'i.'+_0x39740c[0x0];_0x2c86eb[_0xbd0b('0x50')](_0x2a86f5,_0x39740c[0x1]===_0xbd0b('0x9d')?![]:!![]);});}if(!_[_0xbd0b('0x7f')](_0x26a7d9)){_0x2c86eb[_0xbd0b('0x6f')](_0x3fe55a);_0x107275[_0xbd0b('0x52')](_0xbd0b('0x9e'),_0x26a7d9);}BPromise[_0xbd0b('0x9f')]()[_0xbd0b('0x15')](function(){if(!_0x19e3c0){if(_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x80')])return;_0x107275['where'](_0xbd0b('0xa0'));_0x2c86eb[_0xbd0b('0x52')](_0xbd0b('0xa0'));return;}if(_0x43e626[_0xbd0b('0xa1')]['role']!==_0xbd0b('0xa2'))return;return _0x43e626[_0xbd0b('0xa1')][_0xbd0b('0xa3')]({'attributes':['id'],'raw':!![]})[_0xbd0b('0x15')](function(_0x114906){if(_['isEmpty'](_0x114906)){_0x107275['where'](_0xbd0b('0xa4'));_0x2c86eb[_0xbd0b('0x52')](_0xbd0b('0xa4'));}else{_0x107275['where'](_0xbd0b('0x81'),_[_0xbd0b('0x34')](_0x114906,'id'));_0x2c86eb[_0xbd0b('0x52')]('i.ChatWebsiteId\x20IN\x20?',_[_0xbd0b('0x34')](_0x114906,'id'));}});})['then'](function(){if(_0x43e626['user'][_0xbd0b('0xa5')]==='agent'&&!_0x19e3c0&&!_0x43e626['query'][_0xbd0b('0x80')])return[];return db['sequelize'][_0xbd0b('0x48')](_0x107275[_0xbd0b('0xa6')](),_0x17dd54);})['then'](function(_0x1ddc8c){_0x335728[_0xbd0b('0xa7')]=_0x1ddc8c[_0xbd0b('0x6b')];if(_0x335728[_0xbd0b('0xa7')]===0x0)return[];return db[_0xbd0b('0xa8')]['query'](_0x2d13fd[_0xbd0b('0xa6')](),_0x17dd54)[_0xbd0b('0x15')](function(_0x534b7b){_0x48a78c=_[_0xbd0b('0xa9')](_0x534b7b,'id');_0x17dd54=_[_0xbd0b('0x2e')](_0x17dd54,{'model':db[_0xbd0b('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x4d')]){_0xaaefaa[_0xbd0b('0x4c')]['forEach'](function(_0x3d3ab8){_0x2c86eb[_0xbd0b('0x55')]('i.'+_0x3d3ab8);});}else{_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0x9b'),_0xbd0b('0x6d'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xaa'),_0xbd0b('0xab'));_0x2c86eb[_0xbd0b('0x55')]('a.mandatoryDisposition',_0xbd0b('0xac'));_0x2c86eb['field'](_0xbd0b('0xad'),_0xbd0b('0x9c'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xae'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xaf'),_0xbd0b('0xb0'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xb1'),_0xbd0b('0xb2'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xb3'),'Contact.email');_0x2c86eb[_0xbd0b('0x55')]('c.phone',_0xbd0b('0xb4'));_0x2c86eb[_0xbd0b('0x55')]('c.mobile',_0xbd0b('0xb5'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xb6'),_0xbd0b('0xb7'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xb8'),_0xbd0b('0xb9'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xba'),_0xbd0b('0xbb'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xbc'),'TagIds');}if(_0xaaefaa[_0xbd0b('0x25')])_0x2c86eb[_0xbd0b('0x25')](_0xaaefaa['limit']);if(_0xaaefaa[_0xbd0b('0x23')])_0x2c86eb[_0xbd0b('0x23')](_0xaaefaa['offset']);return db[_0xbd0b('0xa8')]['query'](_0x2c86eb[_0xbd0b('0xa6')](),_0x17dd54);})['then'](function(_0x240a5a){if(_0x240a5a[_0xbd0b('0x6b')]>0x0)_0x444f7d[_0xbd0b('0x52')](_0xbd0b('0xbd'),_[_0xbd0b('0x34')](_0x240a5a,'id'));return db[_0xbd0b('0xa8')]['query'](_0x444f7d['toString'](),_0x17dd54)[_0xbd0b('0x15')](function(_0x2d8514){var _0x1bd048=_[_0xbd0b('0xbe')](_0x2d8514,_0xbd0b('0xbf'));var _0x21ce06=[];_0x240a5a[_0xbd0b('0x37')](function(_0x5f5205){_0x21ce06[_0xbd0b('0xc0')](updateChatInteraction(_0x5f5205,_0x48a78c,_0x1bd048));});return BPromise[_0xbd0b('0xc1')](_0x21ce06);});});})[_0xbd0b('0x15')](function(_0x4d14f7){_0x335728[_0xbd0b('0xc2')]=_0x4d14f7;return _0x335728;})[_0xbd0b('0x15')](respondWithFilteredResult(_0x102147,_0xaaefaa))[_0xbd0b('0x38')](handleError(_0x102147,null));};exports['show']=function(_0x37e5d9,_0x535609){var _0x1131ab={'raw':![],'where':{'id':_0x37e5d9[_0xbd0b('0xc3')]['id']}},_0x198f62={};_0x198f62[_0xbd0b('0x47')]=_['keys'](db['ChatInteraction'][_0xbd0b('0x43')]);_0x198f62['query']=_[_0xbd0b('0x49')](_0x37e5d9['query']);_0x198f62['filters']=_[_0xbd0b('0x4b')](_0x198f62[_0xbd0b('0x47')],_0x198f62[_0xbd0b('0x48')]);_0x1131ab[_0xbd0b('0x4c')]=_['intersection'](_0x198f62[_0xbd0b('0x47')],qs[_0xbd0b('0x4d')](_0x37e5d9[_0xbd0b('0x48')][_0xbd0b('0x4d')]));_0x1131ab['attributes']=_0x1131ab[_0xbd0b('0x4c')][_0xbd0b('0x6b')]?_0x1131ab[_0xbd0b('0x4c')]:_0x198f62[_0xbd0b('0x47')];if(_0x37e5d9['query'][_0xbd0b('0xc4')]){_0x1131ab[_0xbd0b('0xc5')]=[{'all':!![]}];}_0x1131ab=_[_0xbd0b('0x2e')]({},_0x1131ab,_0x37e5d9['options']);return db[_0xbd0b('0x42')][_0xbd0b('0x6c')](_0x1131ab)[_0xbd0b('0x15')](handleEntityNotFound(_0x535609,null))[_0xbd0b('0x15')](respondWithResult(_0x535609,null))[_0xbd0b('0x38')](handleError(_0x535609,null));};exports[_0xbd0b('0xc6')]=function(_0x367240,_0x2bd438){return db[_0xbd0b('0x42')][_0xbd0b('0xc6')](_0x367240['body'],{})['then'](respondWithResult(_0x2bd438,0xc9))[_0xbd0b('0x38')](handleError(_0x2bd438,null));};exports[_0xbd0b('0x28')]=function(_0x49a091,_0x269f34){if(_0x49a091[_0xbd0b('0x2f')]['id']){delete _0x49a091[_0xbd0b('0x2f')]['id'];}return db[_0xbd0b('0x42')]['find']({'where':{'id':_0x49a091['params']['id']}})[_0xbd0b('0x15')](handleEntityNotFound(_0x269f34,null))[_0xbd0b('0x15')](saveUpdates(_0x49a091[_0xbd0b('0x2f')],null))['then'](respondWithResult(_0x269f34,null))[_0xbd0b('0x38')](handleError(_0x269f34,null));};exports[_0xbd0b('0x29')]=function(_0x1ce516,_0x29f888){return db[_0xbd0b('0x42')]['find']({'where':{'id':_0x1ce516[_0xbd0b('0xc3')]['id']}})[_0xbd0b('0x15')](handleEntityNotFound(_0x29f888,null))[_0xbd0b('0x15')](removeEntity(_0x29f888,null))['catch'](handleError(_0x29f888,null));};exports[_0xbd0b('0xc7')]=function(_0x744ad0,_0x4d285e){return db[_0xbd0b('0x42')][_0xbd0b('0xc7')]()[_0xbd0b('0x15')](respondWithResult(_0x4d285e,null))[_0xbd0b('0x38')](handleError(_0x4d285e,null));};exports[_0xbd0b('0xc8')]=function(_0x54f668,_0x3e7a0a){var _0xfe0025=_0x54f668[_0xbd0b('0xc3')]['id'];var _0x3b6b99;var _0x4b94d1;var _0x2fc4f8;return db[_0xbd0b('0x42')][_0xbd0b('0xc9')]({'where':{'id':_0xfe0025}})[_0xbd0b('0x15')](function(_0xb96caa){_0x3b6b99=_0xb96caa;return db[_0xbd0b('0xca')][_0xbd0b('0xc9')]({'where':{'id':_0xb96caa[_0xbd0b('0x80')]},'attributes':['id','vidaooApiKey',_0xbd0b('0xcb'),'vidaooTopic',_0xbd0b('0xcc'),_0xbd0b('0xcd')],'raw':!![]});})[_0xbd0b('0x15')](function(_0x38bcd0){if(_0x38bcd0&&_0x38bcd0[_0xbd0b('0xce')]&&_0x38bcd0['vidaooEscalation']){_0x4b94d1=_0x38bcd0;var _0x3f96b9={'interaction':{'id':_0xfe0025},'agent':{'id':_0x54f668['user']['id'],'name':_0x54f668[_0xbd0b('0xa1')]['name'],'fullname':_0x54f668['user'][_0xbd0b('0xcf')],'email':_0x54f668[_0xbd0b('0xa1')]['email']},'contact':_0x54f668[_0xbd0b('0x2f')]['contact'],'account':_0x54f668[_0xbd0b('0x2f')]['account']};var _0x151b30={'rejectUnauthorized':![],'method':_0xbd0b('0xd0'),'url':_0xbd0b('0xd1'),'headers':{'X-APIKEY':_0x38bcd0[_0xbd0b('0xce')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x54f668[_0xbd0b('0xa1')]['email']],'buttons':null,'topic':_0x4b94d1['vidaooTopic'],'note':_[_0xbd0b('0xd2')](_0x4b94d1[_0xbd0b('0xcc')])?null:getMustacheRender(_0x4b94d1[_0xbd0b('0xcc')],_0x3f96b9),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xbd0b('0xd2')](_0x4b94d1[_0xbd0b('0xcd')])){var _0x618588=getMustacheRender(_0x4b94d1[_0xbd0b('0xcd')],_0x3f96b9);var _0x4acf00=JSON[_0xbd0b('0x83')](_0x618588);_0x151b30[_0xbd0b('0x2f')][_0xbd0b('0xd3')]=_0x4acf00;}}catch(_0x50bac5){throw new db[(_0xbd0b('0x96'))][(_0xbd0b('0xd4'))](_0xbd0b('0xd5'));}return rp(_0x151b30);}else{throw new db['Sequelize'][(_0xbd0b('0xd4'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xbd0b('0x15')](function(_0x392920){_0x2fc4f8=_0x392920;if(_0x2fc4f8['id']){var _0xe38274={'body':_0x2fc4f8[_0xbd0b('0xd6')],'ChatWebsiteId':_0x4b94d1['id'],'ChatInteractionId':_0x3b6b99['id'],'direction':_0xbd0b('0xd7'),'UserId':_0x54f668[_0xbd0b('0xa1')]['id']};return db[_0xbd0b('0xd8')][_0xbd0b('0xc6')](_0xe38274,{});}else{throw new db['Sequelize']['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xbd0b('0x15')](function(){return _0x3b6b99[_0xbd0b('0xd9')]({'vidaooSessionId':_0x2fc4f8['id']});})[_0xbd0b('0x15')](respondWithResult(_0x3e7a0a,null))[_0xbd0b('0x38')](handleError(_0x3e7a0a,null));};exports['customUpdate']=function(_0x33103a,_0x16f90f){if(_0x33103a[_0xbd0b('0x2f')]['id']){delete _0x33103a[_0xbd0b('0x2f')]['id'];}return db[_0xbd0b('0x42')][_0xbd0b('0x6c')]({'where':{'id':_0x33103a[_0xbd0b('0xc3')]['id']},'include':[{'model':db[_0xbd0b('0xda')],'as':_0xbd0b('0x71')}]})['then'](handleEntityNotFound(_0x16f90f,null))[_0xbd0b('0x15')](saveUpdates(_0x33103a['body'],null))['then'](respondWithResult(_0x16f90f,null))[_0xbd0b('0x38')](handleError(_0x16f90f,null));};exports[_0xbd0b('0xdb')]=function(_0x34de02,_0x126c50){if(_0x34de02[_0xbd0b('0x2f')]['id']){delete _0x34de02['body']['id'];}return db[_0xbd0b('0x42')][_0xbd0b('0x6c')]({'where':{'id':_0x34de02[_0xbd0b('0xc3')]['id']}})[_0xbd0b('0x15')](function(_0x1dbfe6){if(!_0x1dbfe6){logger[_0xbd0b('0x1b')](_0xbd0b('0xdc'),_0xbd0b('0xdb'),0x194,_0xbd0b('0xdd'));_0x126c50[_0xbd0b('0x1f')](0x194);}else{if(_0x1dbfe6[_0xbd0b('0x3f')]){throw new db[(_0xbd0b('0x96'))][(_0xbd0b('0xd4'))](_0xbd0b('0xde'));}}return _0x1dbfe6;})[_0xbd0b('0x15')](function(_0x36b990){if(_0x36b990){return _0x36b990['update']({'closed':_0x34de02[_0xbd0b('0x2f')][_0xbd0b('0x3e')],'disposition':_0x34de02['body'][_0xbd0b('0x40')]})[_0xbd0b('0x15')](function(_0x489988){return _0x489988;});}})[_0xbd0b('0x15')](function(){return respondWithRpcPromise('AbandonInteraction',_0xbd0b('0xdb'),_0x34de02[_0xbd0b('0x2f')],client9004);})[_0xbd0b('0x15')](respondWithResult(_0x126c50,null))[_0xbd0b('0x38')](handleError(_0x126c50,null));};exports[_0xbd0b('0xdf')]=function(_0x127fa5,_0x57c3b4){_0x127fa5['body']['name']=_0x127fa5[_0xbd0b('0xe0')][_0xbd0b('0xe1')];_0x127fa5[_0xbd0b('0x2f')][_0xbd0b('0xe2')]=_0x127fa5[_0xbd0b('0xe0')]['filename'];_0x127fa5[_0xbd0b('0x2f')][_0xbd0b('0x45')]=_0x127fa5[_0xbd0b('0xe0')]['mimetype'];return db['Attachment'][_0xbd0b('0xc6')](_0x127fa5['body'])[_0xbd0b('0x15')](respondWithResult(_0x57c3b4,0xc9))[_0xbd0b('0x38')](handleError(_0x57c3b4,null));};exports[_0xbd0b('0xe3')]=function(_0x35ac14,_0x2cf9c5){return db[_0xbd0b('0x42')][_0xbd0b('0xc9')]({'where':{'id':_0x35ac14[_0xbd0b('0xc3')]['id']},'raw':!![]})[_0xbd0b('0x15')](handleEntityNotFound(_0x2cf9c5,null))['then'](function(_0x51a3a7){if(_0x51a3a7){if(_0x51a3a7['closed']){return _0x2cf9c5[_0xbd0b('0x21')](0x193)[_0xbd0b('0x22')]({'status':0x193,'message':_0xbd0b('0xe4')});}return db[_0xbd0b('0xe5')][_0xbd0b('0xc9')]({'where':{'id':_0x35ac14['query']['attachId']},'raw':!![]})[_0xbd0b('0x15')](handleEntityNotFound(_0x2cf9c5,null));}})[_0xbd0b('0x15')](function(_0x268c6d){if(_0x268c6d){var _0x309ce2=_0x268c6d[_0xbd0b('0xe6')]!==null;var _0x34bb0d=path[_0xbd0b('0xe7')](config[_0xbd0b('0xe8')],'server/files/attachments/');if(_0x309ce2){_0x34bb0d=path[_0xbd0b('0xe7')](_0x34bb0d,_0xbd0b('0xe9'));}var _0x48f4e9=path[_0xbd0b('0xe7')](_0x34bb0d,_0x268c6d[_0xbd0b('0xe2')]);return _0x2cf9c5[_0xbd0b('0xea')](_0x48f4e9);}})[_0xbd0b('0x38')](handleError(_0x2cf9c5,null));};exports['close']=function(_0x479ad9,_0x491b2a){var _0xf0ad9e=null;var _0x34eb67=null;var _0x211868=null;if(_0x479ad9[_0xbd0b('0x2f')]['id']){delete _0x479ad9[_0xbd0b('0x2f')]['id'];}if(_0x479ad9[_0xbd0b('0x2f')]['mailTranscript']){_0x211868=path[_0xbd0b('0xe7')](config[_0xbd0b('0xe8')],_0xbd0b('0xeb'),util[_0xbd0b('0xec')](_0xbd0b('0xed'),Date[_0xbd0b('0xee')]()));_0x479ad9[_0xbd0b('0x2f')][_0xbd0b('0xef')]=_0x211868;}return db[_0xbd0b('0x42')][_0xbd0b('0x6c')]({'where':{'id':_0x479ad9[_0xbd0b('0xc3')]['id']},'include':[{'model':db[_0xbd0b('0xd8')],'as':_0xbd0b('0xf0'),'include':[{'model':db[_0xbd0b('0xf1')],'as':_0xbd0b('0xf1')}]}]})['then'](handleEntityNotFound(_0x491b2a,null))[_0xbd0b('0x15')](saveUpdates(_0x479ad9[_0xbd0b('0x2f')],null))[_0xbd0b('0x15')](function(_0x1956ad){if(_0x1956ad){_0xf0ad9e=_0x1956ad;return db[_0xbd0b('0xca')][_0xbd0b('0x6c')]({'where':{'id':_0xf0ad9e[_0xbd0b('0x80')]}});}})[_0xbd0b('0x15')](function(_0x37d028){if(_0x37d028){_0x34eb67=_0x37d028;return db[_0xbd0b('0xda')][_0xbd0b('0x6c')]({'where':{'id':_0xf0ad9e['ContactId']}});}})[_0xbd0b('0x15')](function(_0x41ef22){if(_0x41ef22){if(_0x211868){var _0x1d966f=null;for(var _0x3828f0=0x1;_0x3828f0<_0xf0ad9e[_0xbd0b('0xf0')][_0xbd0b('0x6b')];++_0x3828f0){_0x1d966f=_0xf0ad9e[_0xbd0b('0xf0')][_0x3828f0];var _0x5a1ce3=_0x1d966f['UserId']?util[_0xbd0b('0xec')]('%s%d',_0x34eb67[_0xbd0b('0xf2')],_0x1d966f[_0xbd0b('0x3f')]):'System';var _0x49b7fd=_0x479ad9[_0xbd0b('0x2f')][_0xbd0b('0xf3')]||util[_0xbd0b('0xec')]('%s%d',_0xbd0b('0xf4'),_0x1d966f['ContactId']);switch(_0x34eb67['agentIdentifier']){case'website_alias':_0x5a1ce3=_0x1d966f[_0xbd0b('0x3f')]?util[_0xbd0b('0xec')]('%s%d',_0x34eb67[_0xbd0b('0xf2')],_0x1d966f[_0xbd0b('0x3f')]):_0xbd0b('0xf5');break;case _0xbd0b('0xf6'):_0x5a1ce3=_0x1d966f[_0xbd0b('0x3f')]?_0x1d966f[_0xbd0b('0xf1')][_0xbd0b('0xf7')]||_0x1d966f[_0xbd0b('0xf1')]['fullname']:_0xbd0b('0xf5');break;case _0xbd0b('0xf8'):_0x5a1ce3=_0x1d966f[_0xbd0b('0x3f')]?_0x1d966f[_0xbd0b('0xf1')][_0xbd0b('0xcf')]:_0xbd0b('0xf5');break;default:_0x5a1ce3=_0x1d966f['UserId']?util[_0xbd0b('0xec')](_0xbd0b('0xf9'),_0x34eb67[_0xbd0b('0xf2')],_0x1d966f[_0xbd0b('0x3f')]):'System';}var _0x487a04=util['format'](_0xbd0b('0xfa'),moment(_0x1d966f[_0xbd0b('0xfb')])['format'](_0xbd0b('0xfc')),_0x1d966f[_0xbd0b('0xfd')]==='in'?_0x49b7fd:_0x5a1ce3,_0x1d966f[_0xbd0b('0x2f')]);if(!_0x1d966f[_0xbd0b('0xfe')]){fs[_0xbd0b('0xff')](_0x211868,_0x487a04);}}return db[_0xbd0b('0x100')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xbd0b('0x101')],'as':_0xbd0b('0x102'),'raw':!![],'include':[{'model':db[_0xbd0b('0x103')],'as':_0xbd0b('0x103'),'raw':!![]}]}]});}}})[_0xbd0b('0x15')](function(_0x379097){if(!_0x379097||!_0x379097[_0xbd0b('0x102')]||!_0x479ad9[_0xbd0b('0x2f')])return _0xf0ad9e;var _0x350b16=_0x379097['getSmtpOptions']();return respondWithRpcPromise(_0xbd0b('0x104'),'sendMail',{'account':_0x350b16,'message':{'from':util[_0xbd0b('0xec')](_0xbd0b('0x105'),_0x379097[_0xbd0b('0x2b')],_0x379097[_0xbd0b('0x106')]||_0x379097['Smtp'][_0xbd0b('0xa1')]),'to':_0x479ad9[_0xbd0b('0x2f')][_0xbd0b('0x107')],'subject':_0xbd0b('0x108'),'text':util['format'](_0xbd0b('0x109'),_0x479ad9['body'][_0xbd0b('0x107')]),'attachments':[{'path':_0x211868}]}})[_0xbd0b('0x15')](function(){return _0xf0ad9e;})[_0xbd0b('0x38')](function(_0x317171){logger['error'](_0x317171);});})[_0xbd0b('0x15')](respondWithStatusCode(_0x491b2a,0xc8))[_0xbd0b('0x38')](handleError(_0x491b2a,null));};exports[_0xbd0b('0x10a')]=function(_0xb4cfe6,_0x21e92b){return db[_0xbd0b('0xd8')][_0xbd0b('0x6c')]({'where':{'id':_0xb4cfe6[_0xbd0b('0xc3')]['id']}})[_0xbd0b('0x15')](handleEntityNotFound(_0x21e92b,null))[_0xbd0b('0x15')](function(_0x301f75){if(_0x301f75){return _0x301f75[_0xbd0b('0x10a')](_0xb4cfe6[_0xbd0b('0x2f')][_0xbd0b('0x10b')],_[_0xbd0b('0x10c')](_0xb4cfe6[_0xbd0b('0x2f')],[_0xbd0b('0x10b'),'id'])||{});}})[_0xbd0b('0x15')](respondWithResult(_0x21e92b,null))['catch'](handleError(_0x21e92b,null));};exports[_0xbd0b('0x10d')]=function(_0x2daea0,_0x5ace8b){var _0x153d7a={'raw':![],'where':{}};var _0x222290={};var _0x64b5f2={'count':0x0,'rows':[]};return db[_0xbd0b('0x42')][_0xbd0b('0xc9')]({'where':{'id':_0x2daea0[_0xbd0b('0xc3')]['id']}})['then'](handleEntityNotFound(_0x5ace8b,null))[_0xbd0b('0x15')](function(_0x2b5201){if(_0x2b5201){_0x222290[_0xbd0b('0x47')]=_[_0xbd0b('0x49')](db['ChatMessage']['rawAttributes']);_0x222290[_0xbd0b('0x48')]=_['keys'](_0x2daea0[_0xbd0b('0x48')]);_0x222290['filters']=_['intersection'](_0x222290[_0xbd0b('0x47')],_0x222290[_0xbd0b('0x48')]);_0x153d7a[_0xbd0b('0x4c')]=_[_0xbd0b('0x4b')](_0x222290['model'],qs[_0xbd0b('0x4d')](_0x2daea0[_0xbd0b('0x48')]['fields']));_0x153d7a[_0xbd0b('0x4c')]=_0x153d7a[_0xbd0b('0x4c')][_0xbd0b('0x6b')]?_0x153d7a['attributes']:_0x222290[_0xbd0b('0x47')];if(!_0x2daea0[_0xbd0b('0x48')][_0xbd0b('0x4e')](_0xbd0b('0x4f'))){_0x153d7a['limit']=qs[_0xbd0b('0x25')](_0x2daea0[_0xbd0b('0x48')][_0xbd0b('0x25')]);_0x153d7a['offset']=qs[_0xbd0b('0x23')](_0x2daea0[_0xbd0b('0x48')][_0xbd0b('0x23')]);}_0x153d7a[_0xbd0b('0x50')]=qs[_0xbd0b('0x51')](_0x2daea0[_0xbd0b('0x48')][_0xbd0b('0x51')]);_0x153d7a[_0xbd0b('0x52')]=qs[_0xbd0b('0x4a')](_[_0xbd0b('0x53')](_0x2daea0[_0xbd0b('0x48')],_0x222290[_0xbd0b('0x4a')]));_0x153d7a[_0xbd0b('0x52')]['ChatInteractionId']=_0x2b5201['id'];if(_0x2daea0[_0xbd0b('0x48')][_0xbd0b('0x90')]){_0x153d7a[_0xbd0b('0x52')]=_[_0xbd0b('0x2e')](_0x153d7a[_0xbd0b('0x52')],{'$or':_['map'](_0x153d7a[_0xbd0b('0x4c')],function(_0x17779e){var _0xb14185={};_0xb14185[_0x17779e]={'$like':'%'+_0x2daea0['query'][_0xbd0b('0x90')]+'%'};return _0xb14185;})});}if(_0x2daea0['query'][_0xbd0b('0x84')]){var _0x9d3adb=_0x2daea0['query']['$gte'][_0xbd0b('0x36')](',');var _0x4ad616={};_0x4ad616[_0x9d3adb[0x0]]={'$gte':moment(_0x9d3adb[0x1])[_0xbd0b('0xec')](_0xbd0b('0x10e'))};_0x153d7a[_0xbd0b('0x52')]=_[_0xbd0b('0x2e')](_0x153d7a[_0xbd0b('0x52')],_0x4ad616);}_0x153d7a=_[_0xbd0b('0x2e')]({},_0x153d7a,_0x2daea0[_0xbd0b('0x10f')]);return db[_0xbd0b('0xd8')][_0xbd0b('0xa7')]({'where':_0x153d7a[_0xbd0b('0x52')]})[_0xbd0b('0x15')](function(_0x569043){_0x64b5f2['count']=_0x569043;if(_0x2daea0[_0xbd0b('0x48')]['includeAll']){_0x153d7a[_0xbd0b('0xc5')]=[{'all':!![]}];}return db[_0xbd0b('0xd8')][_0xbd0b('0x110')](_0x153d7a);})['then'](function(_0x20e8f9){_0x64b5f2[_0xbd0b('0xc2')]=_0x20e8f9;return _0x64b5f2;});}})[_0xbd0b('0x15')](respondWithFilteredResult(_0x5ace8b,_0x153d7a))[_0xbd0b('0x38')](handleError(_0x5ace8b,null));};exports[_0xbd0b('0x111')]=function(_0x556126,_0x1b764f){var _0x33d449={'where':{}},_0x447fe3={},_0x51e87b={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xbd0b('0xc9')]({'where':{'id':_0x556126[_0xbd0b('0xc3')]['id']}})['then'](handleEntityNotFound(_0x1b764f,null))[_0xbd0b('0x15')](function(_0x19f0ad){if(_0x19f0ad){_0x447fe3[_0xbd0b('0x47')]=_[_0xbd0b('0x49')](db['ChatMessage'][_0xbd0b('0x43')]);_0x447fe3[_0xbd0b('0x48')]=_[_0xbd0b('0x49')](_0x556126[_0xbd0b('0x48')]);_0x447fe3['filters']=_[_0xbd0b('0x4b')](_0x447fe3['model'],_0x447fe3[_0xbd0b('0x48')]);_0x33d449[_0xbd0b('0x4c')]=_['intersection'](_0x447fe3[_0xbd0b('0x47')],qs['fields'](_0x556126['query'][_0xbd0b('0x4d')]));_0x33d449['attributes']=_0x33d449[_0xbd0b('0x4c')][_0xbd0b('0x6b')]?_0x33d449[_0xbd0b('0x4c')]:_0x447fe3['model'];if(!_0x556126['query'][_0xbd0b('0x4e')](_0xbd0b('0x4f'))){_0x33d449[_0xbd0b('0x25')]=qs[_0xbd0b('0x25')](_0x556126[_0xbd0b('0x48')][_0xbd0b('0x25')]);_0x33d449[_0xbd0b('0x23')]=qs[_0xbd0b('0x23')](_0x556126[_0xbd0b('0x48')][_0xbd0b('0x23')]);}_0x33d449['order']=qs[_0xbd0b('0x51')](_0x556126[_0xbd0b('0x48')]['sort']);_0x33d449[_0xbd0b('0x52')]=qs['filters'](_[_0xbd0b('0x53')](_0x556126[_0xbd0b('0x48')],_0x447fe3[_0xbd0b('0x4a')]));_0x33d449[_0xbd0b('0x52')]['ChatInteractionId']=_0x19f0ad['id'];if(_0x556126[_0xbd0b('0x48')][_0xbd0b('0x90')]){_0x33d449[_0xbd0b('0x52')]=_[_0xbd0b('0x2e')](_0x33d449['where'],{'$or':_[_0xbd0b('0x34')](_0x33d449[_0xbd0b('0x4c')],function(_0x53e0cc){var _0x1e0816={};_0x1e0816[_0x53e0cc]={'$like':'%'+_0x556126[_0xbd0b('0x48')][_0xbd0b('0x90')]+'%'};return _0x1e0816;})});}_0x33d449[_0xbd0b('0x52')]['secret']=![];if(_0x556126[_0xbd0b('0x48')]['id']){_0x33d449[_0xbd0b('0x52')]['id']={'$gt':_0x556126[_0xbd0b('0x48')]['id']};}_0x33d449=_['merge']({},_0x33d449,_0x556126[_0xbd0b('0x10f')]);return db[_0xbd0b('0xd8')][_0xbd0b('0xa7')]({'where':_0x33d449['where']})[_0xbd0b('0x15')](function(_0x265840){_0x51e87b[_0xbd0b('0xa7')]=_0x265840;_0x33d449[_0xbd0b('0xc5')]=[];if(_0x556126['query']['includeAgent']){_0x33d449[_0xbd0b('0xc5')]['push']({'model':db[_0xbd0b('0xf1')],'as':_0xbd0b('0xf1'),'attributes':['id',_0xbd0b('0xcf'),'alias']});}if(_0x556126['query']['includeAll']){_0x33d449['include']=[{'all':!![]}];}return db[_0xbd0b('0xd8')][_0xbd0b('0x110')](_0x33d449);})[_0xbd0b('0x15')](function(_0x34c91c){_0x51e87b[_0xbd0b('0xc2')]=_0x34c91c;return _0x51e87b;});}})[_0xbd0b('0x15')](respondWithFilteredResult(_0x1b764f,_0x33d449))['catch'](handleError(_0x1b764f,null));};exports[_0xbd0b('0x112')]=function(_0x11b961,_0x31846a){return db['ChatInteraction'][_0xbd0b('0x6c')]({'where':{'id':_0x11b961[_0xbd0b('0xc3')]['id']}})[_0xbd0b('0x15')](handleEntityNotFound(_0x31846a,null))[_0xbd0b('0x15')](function(_0x207ff3){if(_0x207ff3){return _0x207ff3[_0xbd0b('0x113')](_0x11b961['body'][_0xbd0b('0x10b')],_[_0xbd0b('0x10c')](_0x11b961[_0xbd0b('0x2f')],[_0xbd0b('0x10b'),'id'])||{})['spread'](function(){return db['Tag'][_0xbd0b('0x110')]({'attributes':['id',_0xbd0b('0x2b'),_0xbd0b('0x56')],'where':{'id':_0x11b961[_0xbd0b('0x2f')][_0xbd0b('0x10b')]}});})[_0xbd0b('0x15')](function(_0x13aaf1){socket[_0xbd0b('0x114')](_0xbd0b('0x115'),{'id':Number(_0x11b961['params']['id']),'tags':_0x13aaf1||[]});return{'id':Number(_0x11b961[_0xbd0b('0xc3')]['id']),'tags':_0x13aaf1||[]};});}})[_0xbd0b('0x15')](respondWithResult(_0x31846a,null))[_0xbd0b('0x38')](handleError(_0x31846a,null));};exports[_0xbd0b('0x116')]=function(_0x2c06c8,_0x335b2f){return db[_0xbd0b('0x42')][_0xbd0b('0x6c')]({'where':{'id':_0x2c06c8['params']['id']}})[_0xbd0b('0x15')](handleEntityNotFound(_0x335b2f,null))[_0xbd0b('0x15')](function(_0xb2d193){if(_0xb2d193){return _0xb2d193[_0xbd0b('0x116')](_0x2c06c8[_0xbd0b('0x48')][_0xbd0b('0x10b')]);}})[_0xbd0b('0x15')](respondWithStatusCode(_0x335b2f,null))[_0xbd0b('0x38')](handleError(_0x335b2f,null));};exports[_0xbd0b('0xea')]=function(_0x58c16c,_0x1ad62d){var _0x24971c=moment()[_0xbd0b('0x117')]()[_0xbd0b('0xa6')]();var _0x312865=path[_0xbd0b('0xe7')](config[_0xbd0b('0xe8')],_0xbd0b('0x118'),_0xbd0b('0x119'),'tmp');var _0x4fe50b=path['join'](config[_0xbd0b('0xe8')],_0xbd0b('0x118'),_0xbd0b('0x119'),'attachments');var _0x145e57=path[_0xbd0b('0xe7')](_0x312865,_0x24971c);var _0x5408ab=util[_0xbd0b('0xec')](_0xbd0b('0x11a'),_0x58c16c[_0xbd0b('0xc3')]['id'],_0x24971c);var _0x576316=path[_0xbd0b('0xe7')](_0x312865,_0x5408ab);var _0x97fbc=[];_0x97fbc[_0xbd0b('0xc0')]({'model':db[_0xbd0b('0xf1')],'as':'User','attributes':['id',_0xbd0b('0xcf')],'raw':!![]});_0x97fbc[_0xbd0b('0xc0')]({'model':db[_0xbd0b('0xda')],'as':'Contact','attributes':['id',_0xbd0b('0x11b'),'lastName'],'raw':!![]});if(_0x58c16c['query'][_0xbd0b('0x11c')]){_0x97fbc[_0xbd0b('0xc0')]({'model':db['Attachment'],'as':_0xbd0b('0xe5'),'raw':!![]});}var _0x1a9120=[{'model':db[_0xbd0b('0xd8')],'as':_0xbd0b('0xf0'),'attributes':['id',_0xbd0b('0x2f'),_0xbd0b('0xfb'),_0xbd0b('0xfd'),_0xbd0b('0xfe'),_0xbd0b('0x8a')],'include':_0x97fbc}];_0x1a9120[_0xbd0b('0xc0')]({'model':db[_0xbd0b('0xca')],'as':'Account','attributes':['id',_0xbd0b('0x2b')]});_0x1a9120['push']({'model':db[_0xbd0b('0xf1')],'as':_0xbd0b('0x11d'),'attributes':['id',_0xbd0b('0xcf')]});return db['ChatInteraction'][_0xbd0b('0x6c')]({'where':{'id':_0x58c16c[_0xbd0b('0xc3')]['id']},'include':_0x1a9120})[_0xbd0b('0x15')](handleEntityNotFound(_0x1ad62d,null))[_0xbd0b('0x15')](function(_0x2ee1c3){if(_0x2ee1c3){var _0x509ab1=_0x2ee1c3['get']({'plain':!![]});fs['mkdirSync'](_0x145e57);var _0x273e61={'channel':_0xbd0b('0x11e'),'account':_0x509ab1[_0xbd0b('0x11f')][_0xbd0b('0x2b')],'agent':_0x509ab1[_0xbd0b('0x11d')]?_0x509ab1[_0xbd0b('0x11d')][_0xbd0b('0xcf')]:_0xbd0b('0x120'),'createdAt':moment(_0x509ab1[_0xbd0b('0xfb')])[_0xbd0b('0xec')](_0xbd0b('0x10e'))['toString'](),'closedAt':_0x509ab1['closed']?moment(_0x509ab1[_0xbd0b('0x121')])[_0xbd0b('0xec')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbd0b('0xa6')]():'','disposition':_0x509ab1[_0xbd0b('0x40')],'chatInfo':{'browser':_0x509ab1[_0xbd0b('0x122')],'os':_0x509ab1[_0xbd0b('0x123')],'referer':_0x509ab1[_0xbd0b('0x124')],'customerIp':_0x509ab1[_0xbd0b('0x125')],'customerPort':_0x509ab1[_0xbd0b('0x126')]?_0x509ab1[_0xbd0b('0x126')]:_0xbd0b('0x120')},'messages':_(_0x509ab1[_0xbd0b('0xf0')])[_0xbd0b('0x127')]()[_0xbd0b('0x90')]({'secret':![]})[_0xbd0b('0x34')](function(_0x450447){if(_0x450447[_0xbd0b('0xe5')]){var _0x33867c=path['join'](_0x4fe50b,_0x450447[_0xbd0b('0xe5')]['basename']);if(fs[_0xbd0b('0x128')](_0x33867c)){fs[_0xbd0b('0x129')](_0x33867c)[_0xbd0b('0x12a')](fs[_0xbd0b('0x12b')](path[_0xbd0b('0xe7')](_0x145e57,_0x450447[_0xbd0b('0xe5')][_0xbd0b('0xe2')])));}}return{'date':moment(_0x450447[_0xbd0b('0xfb')])[_0xbd0b('0xec')](_0xbd0b('0x10e'))[_0xbd0b('0xa6')](),'sender':_0x450447[_0xbd0b('0xfd')]==='out'?_0x450447['User']?_0x450447[_0xbd0b('0xf1')][_0xbd0b('0xcf')]:_0xbd0b('0xf5'):_0x450447[_0xbd0b('0x71')]['firstName']+(_0x450447['Contact'][_0xbd0b('0x12c')]?'\x20'+_0x450447[_0xbd0b('0x71')]['lastName']:''),'body':_0x450447[_0xbd0b('0xe5')]?_0x450447[_0xbd0b('0xe5')][_0xbd0b('0xe2')]:_0x450447[_0xbd0b('0x2f')],'direction':_0x450447[_0xbd0b('0xfd')]===_0xbd0b('0xd7')?'A':'C','secret':_0x450447[_0xbd0b('0xfe')],'read':_0x450447[_0xbd0b('0x8a')],'attachment':_0x450447[_0xbd0b('0xe5')]};})[_0xbd0b('0x6e')]()};return ejs[_0xbd0b('0x12d')](path[_0xbd0b('0xe7')](config[_0xbd0b('0xe8')],_0xbd0b('0x118'),_0xbd0b('0x12e'),'downloadInteraction.ejs'),{'interaction':_0x273e61})[_0xbd0b('0x15')](function(_0x32d480){var _0x17f198=path[_0xbd0b('0xe7')](_0x145e57,'transcript-'+_0x509ab1['id']+'-'+_0x24971c+_0xbd0b('0x12f'));var _0x11ee69={'path':_0x17f198,'channel':_0xbd0b('0x11e'),'interactionId':_0x509ab1['id']};return pdf[_0xbd0b('0x130')](_0x32d480,_0x11ee69);})['then'](function(){return new Promise(function(_0x44aa74,_0x373868){zipdir(_0x145e57,{'saveTo':_0x576316},function(_0x2d361f,_0xd80e5b){if(_0x2d361f)return _0x373868(_0x2d361f);return _0x44aa74(_0xd80e5b);});})[_0xbd0b('0x15')](function(){return new BPromise(function(_0x52c132,_0x81e7e6){rimraf(_0x145e57,function(_0x5e8c8c){if(_0x5e8c8c)_0x81e7e6(_0x5e8c8c);return _0x52c132();});});})[_0xbd0b('0x15')](function(){return _0x1ad62d[_0xbd0b('0xea')](_0x576316,_0x5408ab,function(_0x45b33e){if(_0x45b33e){logger['error'](_0xbd0b('0x131'),_0x45b33e);}else{fs[_0xbd0b('0x132')](_0x576316);}});});});}else{return _0x1ad62d[_0xbd0b('0x1f')](0xc8);}})[_0xbd0b('0x38')](handleError(_0x1ad62d,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 2f9a2a1..1fd9414 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 _0xbbab=['catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit'];(function(_0x5e0823,_0x146024){var _0x592fbb=function(_0x5ec112){while(--_0x5ec112){_0x5e0823['push'](_0x5e0823['shift']());}};_0x592fbb(++_0x146024);}(_0xbbab,0xe7));var _0xbbba=function(_0x1fd732,_0x1c33ff){_0x1fd732=_0x1fd732-0x0;var _0x5d2cda=_0xbbab[_0x1fd732];return _0x5d2cda;};'use strict';var EventEmitter=require(_0xbbba('0x0'));var ChatInteraction=require(_0xbbba('0x1'))['db'][_0xbbba('0x2')];var ChatMessage=require(_0xbbba('0x1'))['db'][_0xbbba('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xbbba('0x4')](0x0);var events={'afterCreate':_0xbbba('0x5'),'afterUpdate':_0xbbba('0x6'),'afterDestroy':_0xbbba('0x7')};function emitEvent(_0x835182){return function(_0x30dd5b,_0x3d134b,_0x1dd068){_0x30dd5b[_0xbbba('0x8')]({'attributes':['id'],'raw':!![]})[_0xbbba('0x9')](function(_0x5c473b){_0x30dd5b['setDataValue'](_0xbbba('0xa'),_0x5c473b[_0xbbba('0xb')](function(_0x3a1589){return{'id':_0x3a1589['id']};}));return ChatMessage[_0xbbba('0xc')]({'where':{'ChatInteractionId':_0x30dd5b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5eaad1){_0x30dd5b[_0xbbba('0xd')](_0xbbba('0xe'),_0x5eaad1['length']);ChatInteractionEvents[_0xbbba('0xf')](_0x835182+':'+_0x30dd5b['id'],_0x30dd5b);ChatInteractionEvents[_0xbbba('0xf')](_0x835182,_0x30dd5b);_0x1dd068(null);})[_0xbbba('0x10')](_0x1dd068(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xbbba('0x11')](e,emitEvent(event));}}module[_0xbbba('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0x1656=['update','remove','getUsers','setDataValue','Users','map','then','unreadMessages','length','emit','hasOwnProperty','hook','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1656,0x12d));var _0x6165=function(_0x432044,_0x35d99b){_0x432044=_0x432044-0x0;var _0x108d8d=_0x1656[_0x432044];return _0x108d8d;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x6165('0x0'))['db'][_0x6165('0x1')];var ChatMessage=require(_0x6165('0x0'))['db'][_0x6165('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6165('0x3')](0x0);var events={'afterCreate':_0x6165('0x4'),'afterUpdate':_0x6165('0x5'),'afterDestroy':_0x6165('0x6')};function emitEvent(_0x47dc46){return function(_0x21361d,_0x479321,_0x1c25b0){_0x21361d[_0x6165('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x542338){_0x21361d[_0x6165('0x8')](_0x6165('0x9'),_0x542338[_0x6165('0xa')](function(_0xfa81c7){return{'id':_0xfa81c7['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x21361d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6165('0xb')](function(_0x1bdbcc){_0x21361d[_0x6165('0x8')](_0x6165('0xc'),_0x1bdbcc[_0x6165('0xd')]);ChatInteractionEvents[_0x6165('0xe')](_0x47dc46+':'+_0x21361d['id'],_0x21361d);ChatInteractionEvents[_0x6165('0xe')](_0x47dc46,_0x21361d);_0x1c25b0(null);})['catch'](_0x1c25b0(null));};}for(var e in events){if(events[_0x6165('0xf')](e)){var event=events[e];ChatInteraction[_0x6165('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 70b16a3..4597f9a 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 _0xaed7=['./chatInteraction.attributes','ChatInteraction','closed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5d6d8f,_0x4ae47d){var _0x4e27cf=function(_0x467f58){while(--_0x467f58){_0x5d6d8f['push'](_0x5d6d8f['shift']());}};_0x4e27cf(++_0x4ae47d);}(_0xaed7,0x147));var _0x7aed=function(_0x340d92,_0x4722a3){_0x340d92=_0x340d92-0x0;var _0x1b86db=_0xaed7[_0x340d92];return _0x1b86db;};'use strict';var _=require(_0x7aed('0x0'));var util=require(_0x7aed('0x1'));var logger=require(_0x7aed('0x2'))(_0x7aed('0x3'));var moment=require(_0x7aed('0x4'));var BPromise=require(_0x7aed('0x5'));var rp=require(_0x7aed('0x6'));var fs=require('fs');var path=require(_0x7aed('0x7'));var rimraf=require('rimraf');var config=require(_0x7aed('0x8'));var attributes=require(_0x7aed('0x9'));module['exports']=function(_0x44f3fc,_0xe897b8){return _0x44f3fc['define'](_0x7aed('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3331f3,_0x8851a5,_0x51ddd3){if(_0x3331f3['changed'](_0x7aed('0xb'))){_0x3331f3[_0x7aed('0xc')]=moment()[_0x7aed('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x51ddd3(null,_0x3331f3);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x785c=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x785c,0x1c9));var _0xc785=function(_0x531ffd,_0xe6e95){_0x531ffd=_0x531ffd-0x0;var _0x58eb1f=_0x785c[_0x531ffd];return _0x58eb1f;};'use strict';var _=require(_0xc785('0x0'));var util=require(_0xc785('0x1'));var logger=require(_0xc785('0x2'))(_0xc785('0x3'));var moment=require(_0xc785('0x4'));var BPromise=require('bluebird');var rp=require(_0xc785('0x5'));var fs=require('fs');var path=require(_0xc785('0x6'));var rimraf=require(_0xc785('0x7'));var config=require(_0xc785('0x8'));var attributes=require(_0xc785('0x9'));module[_0xc785('0xa')]=function(_0x2048ac,_0x27f121){return _0x2048ac[_0xc785('0xb')](_0xc785('0xc'),attributes,{'tableName':_0xc785('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33c01e,_0x20e39d,_0x29c370){if(_0x33c01e[_0xc785('0xe')](_0xc785('0xf'))){_0x33c01e[_0xc785('0x10')]=moment()[_0xc785('0x11')](_0xc785('0x12'));}_0x29c370(null,_0x33c01e);}},'charset':_0xc785('0x13'),'collate':_0xc785('0x14')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index fdd25ed..a4896cf 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 _0xd20d=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','defaults','redis','socket.io-emitter','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ChatInteraction','update','body','options','raw','where','attributes','UpdateChatInteraction','find','addTags','ids','omit','spread','AddTags'];(function(_0x2905c,_0x408ef3){var _0x5631e0=function(_0x5e7d24){while(--_0x5e7d24){_0x2905c['push'](_0x2905c['shift']());}};_0x5631e0(++_0x408ef3);}(_0xd20d,0x118));var _0xdd20=function(_0x4ebae2,_0x236be8){_0x4ebae2=_0x4ebae2-0x0;var _0x4586ae=_0xd20d[_0x4ebae2];return _0x4586ae;};'use strict';var _=require(_0xdd20('0x0'));var util=require(_0xdd20('0x1'));var moment=require('moment');var BPromise=require(_0xdd20('0x2'));var rs=require(_0xdd20('0x3'));var fs=require('fs');var Redis=require(_0xdd20('0x4'));var db=require(_0xdd20('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd20('0x6'))(_0xdd20('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdd20('0x8')]['http']({'port':0x232a});config['redis']=_[_0xdd20('0x9')](config[_0xdd20('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd20('0xb'))(new Redis(config[_0xdd20('0xa')]));require('./chatInteraction.socket')[_0xdd20('0xc')](socket);function respondWithRpcPromise(_0x58aa37,_0x33faa2,_0xa918ab){return new BPromise(function(_0x3beb01,_0x204846){return client[_0xdd20('0xd')](_0x58aa37,_0xa918ab)[_0xdd20('0xe')](function(_0x52c062){logger['info'](_0xdd20('0xf'),_0x33faa2,'request\x20sent');logger[_0xdd20('0x10')](_0xdd20('0x11'),_0x33faa2,_0xdd20('0x12'),JSON[_0xdd20('0x13')](_0x52c062));if(_0x52c062['error']){if(_0x52c062[_0xdd20('0x14')][_0xdd20('0x15')]===0x1f4){logger[_0xdd20('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x33faa2,_0x52c062[_0xdd20('0x14')][_0xdd20('0x16')]);return _0x204846(_0x52c062[_0xdd20('0x14')][_0xdd20('0x16')]);}logger[_0xdd20('0x14')](_0xdd20('0xf'),_0x33faa2,_0x52c062[_0xdd20('0x14')][_0xdd20('0x16')]);return _0x3beb01(_0x52c062[_0xdd20('0x14')][_0xdd20('0x16')]);}else{logger[_0xdd20('0x17')](_0xdd20('0xf'),_0x33faa2,_0xdd20('0x12'));_0x3beb01(_0x52c062[_0xdd20('0x18')][_0xdd20('0x16')]);}})[_0xdd20('0x19')](function(_0x43a756){logger[_0xdd20('0x14')](_0xdd20('0xf'),_0x33faa2,_0x43a756);_0x204846(_0x43a756);});});}exports['UpdateChatInteraction']=function(_0x14a949){var _0x3cf728=this;return new Promise(function(_0x3e8ec0,_0x5cd7ba){return db[_0xdd20('0x1a')][_0xdd20('0x1b')](_0x14a949[_0xdd20('0x1c')],{'raw':_0x14a949[_0xdd20('0x1d')]?_0x14a949['options'][_0xdd20('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14a949['options']?_0x14a949[_0xdd20('0x1d')][_0xdd20('0x1f')]||null:null,'attributes':_0x14a949[_0xdd20('0x1d')]?_0x14a949['options'][_0xdd20('0x20')]||null:null,'limit':_0x14a949[_0xdd20('0x1d')]?_0x14a949['options']['limit']||null:null})[_0xdd20('0xe')](function(_0x3f3411){logger[_0xdd20('0x17')](_0xdd20('0x21'),_0x14a949);logger[_0xdd20('0x10')]('UpdateChatInteraction',_0x14a949,JSON[_0xdd20('0x13')](_0x3f3411));_0x3e8ec0(_0x3f3411);})[_0xdd20('0x19')](function(_0x536736){logger[_0xdd20('0x14')](_0xdd20('0x21'),_0x536736['message'],_0x14a949);_0x5cd7ba(_0x3cf728[_0xdd20('0x14')](0x1f4,_0x536736[_0xdd20('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x350703){return new Promise(function(_0x16af6d,_0x4f315b){return db[_0xdd20('0x1a')][_0xdd20('0x22')]({'where':_0x350703[_0xdd20('0x1d')]?_0x350703[_0xdd20('0x1d')][_0xdd20('0x1f')]||null:null})[_0xdd20('0xe')](function(_0x3a67b5){if(_0x3a67b5){return _0x3a67b5[_0xdd20('0x23')](_0x350703[_0xdd20('0x1c')][_0xdd20('0x24')],_[_0xdd20('0x25')](_0x350703['body'],[_0xdd20('0x24'),'id'])||{});}})[_0xdd20('0x26')](function(_0x1b0351){logger[_0xdd20('0x17')](_0xdd20('0x27'),_0x350703);logger[_0xdd20('0x10')](_0xdd20('0x27'),_0x350703,JSON[_0xdd20('0x13')](_0x1b0351));_0x16af6d(_0x1b0351);})[_0xdd20('0x19')](function(_0x4397b8){logger['error']('AddTags',_0x4397b8[_0xdd20('0x16')],_0x350703);_0x4f315b(_this[_0xdd20('0x14')](0x1f4,_0x4397b8[_0xdd20('0x16')]));});});}; \ No newline at end of file +var _0x0600=['where','attributes','limit','AddTagsToChatInteraction','find','addTags','omit','ids','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options'];(function(_0x1c3f44,_0x3b9db4){var _0x1bc285=function(_0x4f1781){while(--_0x4f1781){_0x1c3f44['push'](_0x1c3f44['shift']());}};_0x1bc285(++_0x3b9db4);}(_0x0600,0x18f));var _0x0060=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0x0600[_0x13843f];return _0x1063ae;};'use strict';var _=require(_0x0060('0x0'));var util=require('util');var moment=require(_0x0060('0x1'));var BPromise=require(_0x0060('0x2'));var rs=require(_0x0060('0x3'));var fs=require('fs');var Redis=require(_0x0060('0x4'));var db=require(_0x0060('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0060('0x6'));var config=require('../../config/environment');var jayson=require(_0x0060('0x7'));var client=jayson[_0x0060('0x8')]['http']({'port':0x232a});config[_0x0060('0x9')]=_[_0x0060('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0060('0xb'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x0060('0xc')](socket);function respondWithRpcPromise(_0xfc1316,_0x47c888,_0x30d8eb){return new BPromise(function(_0x249dd2,_0x248092){return client[_0x0060('0xd')](_0xfc1316,_0x30d8eb)[_0x0060('0xe')](function(_0x3e49ef){logger[_0x0060('0xf')](_0x0060('0x10'),_0x47c888,_0x0060('0x11'));logger[_0x0060('0x12')](_0x0060('0x13'),_0x47c888,_0x0060('0x11'),JSON[_0x0060('0x14')](_0x3e49ef));if(_0x3e49ef['error']){if(_0x3e49ef[_0x0060('0x15')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x47c888,_0x3e49ef[_0x0060('0x15')][_0x0060('0x16')]);return _0x248092(_0x3e49ef['error'][_0x0060('0x16')]);}logger[_0x0060('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x47c888,_0x3e49ef[_0x0060('0x15')][_0x0060('0x16')]);return _0x249dd2(_0x3e49ef[_0x0060('0x15')][_0x0060('0x16')]);}else{logger[_0x0060('0xf')](_0x0060('0x10'),_0x47c888,_0x0060('0x11'));_0x249dd2(_0x3e49ef[_0x0060('0x17')][_0x0060('0x16')]);}})[_0x0060('0x18')](function(_0x4acfad){logger[_0x0060('0x15')](_0x0060('0x10'),_0x47c888,_0x4acfad);_0x248092(_0x4acfad);});});}exports[_0x0060('0x19')]=function(_0xaf8e4b){var _0x47354c=this;return new Promise(function(_0x56a6c5,_0x18eb61){return db[_0x0060('0x1a')][_0x0060('0x1b')](_0xaf8e4b[_0x0060('0x1c')],{'raw':_0xaf8e4b['options']?_0xaf8e4b[_0x0060('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xaf8e4b[_0x0060('0x1d')]?_0xaf8e4b[_0x0060('0x1d')][_0x0060('0x1e')]||null:null,'attributes':_0xaf8e4b['options']?_0xaf8e4b['options'][_0x0060('0x1f')]||null:null,'limit':_0xaf8e4b[_0x0060('0x1d')]?_0xaf8e4b['options'][_0x0060('0x20')]||null:null})[_0x0060('0xe')](function(_0x3546b9){logger[_0x0060('0xf')](_0x0060('0x19'),_0xaf8e4b);logger[_0x0060('0x12')](_0x0060('0x19'),_0xaf8e4b,JSON[_0x0060('0x14')](_0x3546b9));_0x56a6c5(_0x3546b9);})[_0x0060('0x18')](function(_0x18b3fd){logger['error'](_0x0060('0x19'),_0x18b3fd['message'],_0xaf8e4b);_0x18eb61(_0x47354c[_0x0060('0x15')](0x1f4,_0x18b3fd[_0x0060('0x16')]));});});};exports[_0x0060('0x21')]=function(_0x2a4145){return new Promise(function(_0x583930,_0x1c2097){return db[_0x0060('0x1a')][_0x0060('0x22')]({'where':_0x2a4145[_0x0060('0x1d')]?_0x2a4145[_0x0060('0x1d')]['where']||null:null})['then'](function(_0x3292f8){if(_0x3292f8){return _0x3292f8[_0x0060('0x23')](_0x2a4145[_0x0060('0x1c')]['ids'],_[_0x0060('0x24')](_0x2a4145[_0x0060('0x1c')],[_0x0060('0x25'),'id'])||{});}})['spread'](function(_0x5f13d2){logger[_0x0060('0xf')](_0x0060('0x26'),_0x2a4145);logger[_0x0060('0x12')]('AddTags',_0x2a4145,JSON['stringify'](_0x5f13d2));_0x583930(_0x5f13d2);})['catch'](function(_0xcbd01a){logger[_0x0060('0x15')](_0x0060('0x26'),_0xcbd01a['message'],_0x2a4145);_0x1c2097(_this['error'](0x1f4,_0xcbd01a[_0x0060('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index ccf6373..ba32a0b 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 _0x5ddc=['emit','removeListener','register','length','chatInteraction:','save','remove','update'];(function(_0x2b305c,_0x5ae303){var _0x5d8c85=function(_0x33129f){while(--_0x33129f){_0x2b305c['push'](_0x2b305c['shift']());}};_0x5d8c85(++_0x5ae303);}(_0x5ddc,0x13d));var _0xc5dd=function(_0x1d1281,_0x1b3c7d){_0x1d1281=_0x1d1281-0x0;var _0x5e8c2e=_0x5ddc[_0x1d1281];return _0x5e8c2e;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xc5dd('0x0'),_0xc5dd('0x1'),_0xc5dd('0x2')];function createListener(_0x224962,_0x38ece4){return function(_0x1282b3){_0x38ece4[_0xc5dd('0x3')](_0x224962,_0x1282b3);};}function removeListener(_0x363b02,_0x205800){return function(){ChatInteractionEvents[_0xc5dd('0x4')](_0x363b02,_0x205800);};}exports[_0xc5dd('0x5')]=function(_0x3d64a8){for(var _0x2bfe44=0x0,_0x71db7b=events[_0xc5dd('0x6')];_0x2bfe44<_0x71db7b;_0x2bfe44++){var _0x42a979=events[_0x2bfe44];var _0xc9d03a=createListener(_0xc5dd('0x7')+_0x42a979,_0x3d64a8);ChatInteractionEvents['on'](_0x42a979,_0xc9d03a);}}; \ No newline at end of file +var _0xafb4=['remove','emit','register','length','./chatInteraction.events','save'];(function(_0x306381,_0x5348bf){var _0x2333a4=function(_0xfb4d05){while(--_0xfb4d05){_0x306381['push'](_0x306381['shift']());}};_0x2333a4(++_0x5348bf);}(_0xafb4,0x124));var _0x4afb=function(_0x302027,_0x49d4bc){_0x302027=_0x302027-0x0;var _0x992bcb=_0xafb4[_0x302027];return _0x992bcb;};'use strict';var ChatInteractionEvents=require(_0x4afb('0x0'));var events=[_0x4afb('0x1'),_0x4afb('0x2'),'update'];function createListener(_0x531e8d,_0x49c1c6){return function(_0x632af4){_0x49c1c6[_0x4afb('0x3')](_0x531e8d,_0x632af4);};}function removeListener(_0x4319b2,_0x857858){return function(){ChatInteractionEvents['removeListener'](_0x4319b2,_0x857858);};}exports[_0x4afb('0x4')]=function(_0x4e3207){for(var _0xa88fc5=0x0,_0x47e938=events[_0x4afb('0x5')];_0xa88fc5<_0x47e938;_0xa88fc5++){var _0x1a35ed=events[_0xa88fc5];var _0x18b62c=createListener('chatInteraction:'+_0x1a35ed,_0x4e3207);ChatInteractionEvents['on'](_0x1a35ed,_0x18b62c);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 66da13b..54a307a 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 _0x86a8=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','/describe','describe','isChatInteractionAuthorized','show','get','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','/:id','chat','chatinteraction:update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','delete','removeTags','exports','multer'];(function(_0x8b76d8,_0x3b4a33){var _0x124649=function(_0x3fa55c){while(--_0x3fa55c){_0x8b76d8['push'](_0x8b76d8['shift']());}};_0x124649(++_0x3b4a33);}(_0x86a8,0xa1));var _0x886a=function(_0x457f1e,_0x5c883b){_0x457f1e=_0x457f1e-0x0;var _0x2afbbe=_0x86a8[_0x457f1e];return _0x2afbbe;};'use strict';var multer=require(_0x886a('0x0'));var util=require(_0x886a('0x1'));var path=require(_0x886a('0x2'));var timeout=require('connect-timeout');var express=require(_0x886a('0x3'));var router=express[_0x886a('0x4')]();var fs_extra=require(_0x886a('0x5'));var auth=require(_0x886a('0x6'));var interaction=require(_0x886a('0x7'));var config=require('../../config/environment');var controller=require(_0x886a('0x8'));router['get']('/',auth[_0x886a('0x9')](),controller['index']);router['get'](_0x886a('0xa'),auth[_0x886a('0x9')](),controller[_0x886a('0xb')]);router['get']('/:id',auth[_0x886a('0xc')](),controller[_0x886a('0xd')]);router[_0x886a('0xe')](_0x886a('0xf'),auth[_0x886a('0xc')](),controller[_0x886a('0x10')]);router[_0x886a('0xe')](_0x886a('0x11'),auth['isAuthenticated'](),controller['getMessages']);router[_0x886a('0xe')](_0x886a('0x12'),auth[_0x886a('0xc')](),controller[_0x886a('0x13')]);router[_0x886a('0xe')](_0x886a('0x14'),auth[_0x886a('0x9')](),controller[_0x886a('0x15')]);router[_0x886a('0x16')]('/',auth[_0x886a('0x9')](),controller[_0x886a('0x17')]);router[_0x886a('0x16')]('/:id/vidaoo',auth[_0x886a('0x9')](),controller[_0x886a('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4f270d,_0x6d564c,_0x1840ae){_0x1840ae(null,path['join'](config[_0x886a('0x19')],_0x886a('0x1a')));},'filename':function(_0x2ad188,_0xbf11e6,_0x1a679e){_0x1a679e(null,util[_0x886a('0x1b')](_0x886a('0x1c'),Date[_0x886a('0x1d')](),_0xbf11e6[_0x886a('0x1e')][_0x886a('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x886a('0x16')](_0x886a('0x20'),upload[_0x886a('0x21')](_0x886a('0x22')),controller[_0x886a('0x23')]);router['post']('/:id/messages',auth[_0x886a('0xc')](),controller[_0x886a('0x24')]);router[_0x886a('0x16')](_0x886a('0x25'),auth[_0x886a('0x9')](),interaction[_0x886a('0x26')]('chat',_0x886a('0x27')),controller[_0x886a('0x28')]);router[_0x886a('0x29')](_0x886a('0x2a'),auth[_0x886a('0x9')](),interaction[_0x886a('0x26')](_0x886a('0x2b'),_0x886a('0x2c')),controller['update']);router['put']('/:id/custom_update',controller[_0x886a('0x2d')]);router[_0x886a('0x29')](_0x886a('0x2e'),auth[_0x886a('0xc')](),controller[_0x886a('0x2f')]);router[_0x886a('0x29')](_0x886a('0x30'),controller[_0x886a('0x31')]);router['delete'](_0x886a('0x2a'),auth[_0x886a('0x9')](),interaction[_0x886a('0x26')](_0x886a('0x2b'),_0x886a('0x32')),controller['destroy']);router[_0x886a('0x33')](_0x886a('0x25'),auth[_0x886a('0x9')](),controller[_0x886a('0x34')]);module[_0x886a('0x35')]=router; \ No newline at end of file +var _0xf5e9=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','get','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','file','attachmentUpload','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','tracked','chatinteraction:destroy','destroy','removeTags','exports','multer','util'];(function(_0x294f1b,_0x3f792c){var _0x15f86d=function(_0x367d30){while(--_0x367d30){_0x294f1b['push'](_0x294f1b['shift']());}};_0x15f86d(++_0x3f792c);}(_0xf5e9,0x9d));var _0x9f5e=function(_0x58fcda,_0x1c3d13){_0x58fcda=_0x58fcda-0x0;var _0x8e4b88=_0xf5e9[_0x58fcda];return _0x8e4b88;};'use strict';var multer=require(_0x9f5e('0x0'));var util=require(_0x9f5e('0x1'));var path=require(_0x9f5e('0x2'));var timeout=require(_0x9f5e('0x3'));var express=require(_0x9f5e('0x4'));var router=express['Router']();var fs_extra=require(_0x9f5e('0x5'));var auth=require(_0x9f5e('0x6'));var interaction=require(_0x9f5e('0x7'));var config=require('../../config/environment');var controller=require(_0x9f5e('0x8'));router['get']('/',auth[_0x9f5e('0x9')](),controller[_0x9f5e('0xa')]);router[_0x9f5e('0xb')]('/describe',auth[_0x9f5e('0x9')](),controller[_0x9f5e('0xc')]);router[_0x9f5e('0xb')](_0x9f5e('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x9f5e('0xe')]);router[_0x9f5e('0xb')](_0x9f5e('0xf'),auth[_0x9f5e('0x10')](),controller['attachmentDownload']);router[_0x9f5e('0xb')](_0x9f5e('0x11'),auth[_0x9f5e('0x9')](),controller[_0x9f5e('0x12')]);router[_0x9f5e('0xb')](_0x9f5e('0x13'),auth[_0x9f5e('0x10')](),controller[_0x9f5e('0x14')]);router['get'](_0x9f5e('0x15'),auth[_0x9f5e('0x9')](),controller['download']);router[_0x9f5e('0x16')]('/',auth[_0x9f5e('0x9')](),controller[_0x9f5e('0x17')]);router[_0x9f5e('0x16')](_0x9f5e('0x18'),auth['isAuthenticated'](),controller[_0x9f5e('0x19')]);var upload=multer({'storage':multer[_0x9f5e('0x1a')]({'destination':function(_0x2ec16c,_0x2210ad,_0x4e6499){_0x4e6499(null,path[_0x9f5e('0x1b')](config[_0x9f5e('0x1c')],_0x9f5e('0x1d')));},'filename':function(_0x125221,_0x387035,_0x566fd1){_0x566fd1(null,util[_0x9f5e('0x1e')](_0x9f5e('0x1f'),Date[_0x9f5e('0x20')](),_0x387035[_0x9f5e('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9f5e('0x16')]('/:id/attachment_upload',upload['single'](_0x9f5e('0x22')),controller[_0x9f5e('0x23')]);router[_0x9f5e('0x16')](_0x9f5e('0x11'),auth[_0x9f5e('0x10')](),controller['addMessage']);router[_0x9f5e('0x16')](_0x9f5e('0x24'),auth[_0x9f5e('0x9')](),interaction['tracked'](_0x9f5e('0x25'),_0x9f5e('0x26')),controller[_0x9f5e('0x27')]);router[_0x9f5e('0x28')](_0x9f5e('0xd'),auth[_0x9f5e('0x9')](),interaction['tracked'](_0x9f5e('0x25'),_0x9f5e('0x29')),controller['update']);router[_0x9f5e('0x28')](_0x9f5e('0x2a'),controller[_0x9f5e('0x2b')]);router['put'](_0x9f5e('0x2c'),auth[_0x9f5e('0x10')](),controller[_0x9f5e('0x2d')]);router[_0x9f5e('0x28')](_0x9f5e('0x2e'),controller['close']);router[_0x9f5e('0x2f')](_0x9f5e('0xd'),auth[_0x9f5e('0x9')](),interaction[_0x9f5e('0x30')](_0x9f5e('0x25'),_0x9f5e('0x31')),controller[_0x9f5e('0x32')]);router[_0x9f5e('0x2f')]('/:id/tags',auth[_0x9f5e('0x9')](),controller[_0x9f5e('0x33')]);module[_0x9f5e('0x34')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 7bdfb60..e550e32 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 _0x1237=['medium','BOOLEAN','sequelize','exports','TEXT'];(function(_0x370841,_0x1eb3bf){var _0x282f9a=function(_0x3b6ea4){while(--_0x3b6ea4){_0x370841['push'](_0x370841['shift']());}};_0x282f9a(++_0x1eb3bf);}(_0x1237,0x19c));var _0x7123=function(_0x341dd3,_0x458bce){_0x341dd3=_0x341dd3-0x0;var _0x21c6f2=_0x1237[_0x341dd3];return _0x21c6f2;};'use strict';var Sequelize=require(_0x7123('0x0'));module[_0x7123('0x1')]={'body':{'type':Sequelize[_0x7123('0x2')](_0x7123('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7123('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x7126=['BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x39f488,_0x4b73e3){var _0x10d29b=function(_0x2e1b5f){while(--_0x2e1b5f){_0x39f488['push'](_0x39f488['shift']());}};_0x10d29b(++_0x4b73e3);}(_0x7126,0x11f));var _0x6712=function(_0x3abbf7,_0x4a2b98){_0x3abbf7=_0x3abbf7-0x0;var _0x3ed4c4=_0x7126[_0x3abbf7];return _0x3ed4c4;};'use strict';var Sequelize=require(_0x6712('0x0'));module[_0x6712('0x1')]={'body':{'type':Sequelize[_0x6712('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x6712('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x6712('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 5311dd9..2632178 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 _0x63d5=['util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','params','rawAttributes','includeAll','options','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','User','agent','admin','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','role','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x63d5,0x155));var _0x563d=function(_0x50faaa,_0x59d114){_0x50faaa=_0x50faaa-0x0;var _0x48300e=_0x63d5[_0x50faaa];return _0x48300e;};'use strict';var emlformat=require(_0x563d('0x0'));var rimraf=require(_0x563d('0x1'));var zipdir=require(_0x563d('0x2'));var jsonpatch=require(_0x563d('0x3'));var rp=require(_0x563d('0x4'));var moment=require(_0x563d('0x5'));var BPromise=require(_0x563d('0x6'));var Mustache=require('mustache');var util=require(_0x563d('0x7'));var path=require('path');var sox=require(_0x563d('0x8'));var csv=require(_0x563d('0x9'));var ejs=require(_0x563d('0xa'));var fs=require('fs');var fs_extra=require(_0x563d('0xb'));var _=require(_0x563d('0xc'));var squel=require(_0x563d('0xd'));var crypto=require(_0x563d('0xe'));var jsforce=require(_0x563d('0xf'));var deskjs=require(_0x563d('0x10'));var toCsv=require(_0x563d('0x9'));var querystring=require(_0x563d('0x11'));var Papa=require(_0x563d('0x12'));var Redis=require(_0x563d('0x13'));var authService=require(_0x563d('0x14'));var qs=require(_0x563d('0x15'));var as=require(_0x563d('0x16'));var hardwareService=require(_0x563d('0x17'));var logger=require(_0x563d('0x18'))(_0x563d('0x19'));var utils=require(_0x563d('0x1a'));var config=require(_0x563d('0x1b'));var licenseUtil=require(_0x563d('0x1c'));var db=require(_0x563d('0x1d'))['db'];config[_0x563d('0x1e')]=_['defaults'](config[_0x563d('0x1e')],{'host':_0x563d('0x1f'),'port':0x18eb});var socket=require(_0x563d('0x20'))(new Redis(config[_0x563d('0x1e')]));require(_0x563d('0x21'))[_0x563d('0x22')](socket);function respondWithStatusCode(_0x2c779e,_0x3dcf2d){_0x3dcf2d=_0x3dcf2d||0xcc;return function(_0x1f8ca4){if(_0x1f8ca4){return _0x2c779e[_0x563d('0x23')](_0x3dcf2d);}return _0x2c779e[_0x563d('0x24')](_0x3dcf2d)[_0x563d('0x25')]();};}function respondWithResult(_0x54d57c,_0x9d84b1){_0x9d84b1=_0x9d84b1||0xc8;return function(_0x11209d){if(_0x11209d){return _0x54d57c['status'](_0x9d84b1)[_0x563d('0x26')](_0x11209d);}};}function respondWithFilteredResult(_0x2591a2,_0x5da478){return function(_0x5bf130){if(_0x5bf130){var _0x451d38=typeof _0x5da478[_0x563d('0x27')]==='undefined'&&typeof _0x5da478[_0x563d('0x28')]===_0x563d('0x29');var _0x3c37bd=_0x5bf130[_0x563d('0x2a')];var _0x2b4260=_0x451d38?0x0:_0x5da478[_0x563d('0x27')];var _0xb97bdc=_0x451d38?_0x5bf130['count']:_0x5da478[_0x563d('0x27')]+_0x5da478[_0x563d('0x28')];var _0x441738;if(_0xb97bdc>=_0x3c37bd){_0xb97bdc=_0x3c37bd;_0x441738=0xc8;}else{_0x441738=0xce;}_0x2591a2[_0x563d('0x24')](_0x441738);return _0x2591a2[_0x563d('0x2b')](_0x563d('0x2c'),_0x2b4260+'-'+_0xb97bdc+'/'+_0x3c37bd)['json'](_0x5bf130);}return null;};}function patchUpdates(_0x4c40b5){return function(_0x49c12d){try{jsonpatch[_0x563d('0x2d')](_0x49c12d,_0x4c40b5,!![]);}catch(_0xcde284){return BPromise[_0x563d('0x2e')](_0xcde284);}return _0x49c12d[_0x563d('0x2f')]();};}function saveUpdates(_0x35686f,_0x41ed08){return function(_0x24a7fb){if(_0x24a7fb){return _0x24a7fb[_0x563d('0x30')](_0x35686f)[_0x563d('0x31')](function(_0x19269d){return _0x19269d;});}return null;};}function removeEntity(_0x33c404,_0x5ac9a7){return function(_0x22e2a6){if(_0x22e2a6){return _0x22e2a6[_0x563d('0x32')]()['then'](function(){_0x33c404[_0x563d('0x24')](0xcc)[_0x563d('0x25')]();});}};}function handleEntityNotFound(_0xa666ba,_0x1fc8c4){return function(_0x5de75c){if(!_0x5de75c){_0xa666ba[_0x563d('0x23')](0x194);}return _0x5de75c;};}function handleError(_0x2493b0,_0x2e2427){_0x2e2427=_0x2e2427||0x1f4;return function(_0x46b1d9){logger[_0x563d('0x33')](_0x46b1d9[_0x563d('0x34')]);if(_0x46b1d9[_0x563d('0x35')]){delete _0x46b1d9[_0x563d('0x35')];}_0x2493b0[_0x563d('0x24')](_0x2e2427)[_0x563d('0x36')](_0x46b1d9);};}exports[_0x563d('0x37')]=function(_0x3d36bc,_0x42f30f){var _0x3db5b1={},_0x4863f2={},_0x3c922b={'count':0x0,'rows':[]};var _0x3aed99=_[_0x563d('0x38')](db[_0x563d('0x39')]['rawAttributes'],function(_0x3a9094){return{'name':_0x3a9094['fieldName'],'type':_0x3a9094[_0x563d('0x3a')]['key']};});_0x4863f2[_0x563d('0x3b')]=_['map'](_0x3aed99,_0x563d('0x35'));_0x4863f2[_0x563d('0x3c')]=_[_0x563d('0x3d')](_0x3d36bc[_0x563d('0x3c')]);_0x4863f2[_0x563d('0x3e')]=_[_0x563d('0x3f')](_0x4863f2[_0x563d('0x3b')],_0x4863f2[_0x563d('0x3c')]);_0x3db5b1[_0x563d('0x40')]=_[_0x563d('0x3f')](_0x4863f2['model'],qs[_0x563d('0x41')](_0x3d36bc['query'][_0x563d('0x41')]));_0x3db5b1['attributes']=_0x3db5b1[_0x563d('0x40')][_0x563d('0x42')]?_0x3db5b1[_0x563d('0x40')]:_0x4863f2[_0x563d('0x3b')];if(!_0x3d36bc['query'][_0x563d('0x43')](_0x563d('0x44'))){_0x3db5b1['limit']=qs['limit'](_0x3d36bc[_0x563d('0x3c')]['limit']);_0x3db5b1[_0x563d('0x27')]=qs[_0x563d('0x27')](_0x3d36bc[_0x563d('0x3c')][_0x563d('0x27')]);}_0x3db5b1[_0x563d('0x45')]=qs['sort'](_0x3d36bc[_0x563d('0x3c')][_0x563d('0x46')]);_0x3db5b1[_0x563d('0x47')]=qs[_0x563d('0x3e')](_[_0x563d('0x48')](_0x3d36bc[_0x563d('0x3c')],_0x4863f2['filters']),_0x3aed99);if(_0x3d36bc[_0x563d('0x3c')][_0x563d('0x49')]){_0x3db5b1['where']=_[_0x563d('0x4a')](_0x3db5b1[_0x563d('0x47')],{'$or':_[_0x563d('0x38')](_0x3aed99,function(_0x1d1fbd){if(_0x1d1fbd[_0x563d('0x3a')]!=='VIRTUAL'){var _0x182613={};_0x182613[_0x1d1fbd[_0x563d('0x35')]]={'$like':'%'+_0x3d36bc[_0x563d('0x3c')][_0x563d('0x49')]+'%'};return _0x182613;}})});}_0x3db5b1=_['merge']({},_0x3db5b1,_0x3d36bc['options']);var _0x29feb4={'where':_0x3db5b1[_0x563d('0x47')]};return db['ChatInternalMessage'][_0x563d('0x2a')](_0x29feb4)[_0x563d('0x31')](function(_0x41a798){_0x3c922b[_0x563d('0x2a')]=_0x41a798;if(_0x3d36bc[_0x563d('0x3c')]['includeAll']){_0x3db5b1[_0x563d('0x4b')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x563d('0x4c')](_0x3db5b1);})[_0x563d('0x31')](function(_0x34d9d4){_0x3c922b[_0x563d('0x4d')]=_0x34d9d4;return _0x3c922b;})['then'](respondWithFilteredResult(_0x42f30f,_0x3db5b1))[_0x563d('0x4e')](handleError(_0x42f30f,null));};exports['show']=function(_0x1acbc4,_0x2ed804){var _0x381af4={'raw':!![],'where':{'id':_0x1acbc4[_0x563d('0x4f')]['id']}},_0x4b2e21={};_0x4b2e21['model']=_[_0x563d('0x3d')](db[_0x563d('0x39')][_0x563d('0x50')]);_0x4b2e21[_0x563d('0x3c')]=_[_0x563d('0x3d')](_0x1acbc4[_0x563d('0x3c')]);_0x4b2e21['filters']=_[_0x563d('0x3f')](_0x4b2e21[_0x563d('0x3b')],_0x4b2e21[_0x563d('0x3c')]);_0x381af4[_0x563d('0x40')]=_[_0x563d('0x3f')](_0x4b2e21[_0x563d('0x3b')],qs['fields'](_0x1acbc4[_0x563d('0x3c')][_0x563d('0x41')]));_0x381af4['attributes']=_0x381af4[_0x563d('0x40')][_0x563d('0x42')]?_0x381af4[_0x563d('0x40')]:_0x4b2e21[_0x563d('0x3b')];if(_0x1acbc4['query'][_0x563d('0x51')]){_0x381af4['include']=[{'all':!![]}];}_0x381af4=_[_0x563d('0x4a')]({},_0x381af4,_0x1acbc4[_0x563d('0x52')]);return db[_0x563d('0x39')][_0x563d('0x53')](_0x381af4)[_0x563d('0x31')](handleEntityNotFound(_0x2ed804,null))[_0x563d('0x31')](respondWithResult(_0x2ed804,null))[_0x563d('0x4e')](handleError(_0x2ed804,null));};exports[_0x563d('0x54')]=function(_0x111cfe,_0x106db7){return db['ChatInternalMessage'][_0x563d('0x54')](_0x111cfe['body'],{})['then'](respondWithResult(_0x106db7,0xc9))[_0x563d('0x4e')](handleError(_0x106db7,null));};exports['update']=function(_0x1c3f21,_0x56b2a5){if(_0x1c3f21[_0x563d('0x55')]['id']){delete _0x1c3f21[_0x563d('0x55')]['id'];}return db[_0x563d('0x39')][_0x563d('0x53')]({'where':{'id':_0x1c3f21['params']['id']}})['then'](handleEntityNotFound(_0x56b2a5,null))[_0x563d('0x31')](saveUpdates(_0x1c3f21[_0x563d('0x55')],null))[_0x563d('0x31')](respondWithResult(_0x56b2a5,null))[_0x563d('0x4e')](handleError(_0x56b2a5,null));};exports[_0x563d('0x32')]=function(_0x3e9f96,_0x1bb095){return db[_0x563d('0x39')]['find']({'where':{'id':_0x3e9f96[_0x563d('0x4f')]['id']}})[_0x563d('0x31')](handleEntityNotFound(_0x1bb095,null))['then'](removeEntity(_0x1bb095,null))[_0x563d('0x4e')](handleError(_0x1bb095,null));};exports['describe']=function(_0x117b2e,_0x4cda51){return db[_0x563d('0x39')][_0x563d('0x56')]()[_0x563d('0x31')](respondWithResult(_0x4cda51,null))['catch'](handleError(_0x4cda51,null));};function wrapUser(_0xb40c87){return function(_0x4e7bb4){var _0x2ca552=_0xb40c87[_0x563d('0x57')]({'plain':!![]});_0x2ca552['messages']=[];if(_0x4e7bb4){_0x2ca552[_0x563d('0x58')]=_0x4e7bb4[_0x563d('0x59')];_0x2ca552[_0x563d('0x5a')]=_0x4e7bb4;}else{_0x2ca552[_0x563d('0x58')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2ca552['lastMessage']={};}return _0x2ca552;};}exports['getUsers']=function(_0x59f546,_0x18023a,_0x10a13a){var _0x3530a4=[];return db[_0x563d('0x5b')][_0x563d('0x4c')]({'where':{'role':[_0x563d('0x5c'),_0x563d('0x5d'),'user']},'attributes':['id',_0x563d('0x5e'),_0x563d('0x35'),'role',_0x563d('0x5f'),_0x563d('0x60'),_0x563d('0x61'),_0x563d('0x62'),_0x563d('0x63'),_0x563d('0x64')],'order':qs[_0x563d('0x46')](_0x563d('0x65')),'include':[{'model':db[_0x563d('0x66')],'as':_0x563d('0x67'),'attributes':['id','name',_0x563d('0x3a')],'through':{'attributes':[]}}]})[_0x563d('0x31')](function(_0x6bf38e){if(_0x6bf38e){var _0x2a627a=_0x59f546[_0x563d('0x68')][_0x563d('0x57')]({'plain':!![]});if(!_0x2a627a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a627a[_0x563d('0x69')]===_0x563d('0x68')){return db[_0x563d('0x6a')][_0x563d('0x53')]({'where':{'name':_0x563d('0x6b'),'userProfileId':_0x2a627a[_0x563d('0x6c')]},'raw':!![]})[_0x563d('0x31')](function(_0x3019c9){if(_0x3019c9){if(_0x3019c9['autoAssociation']===0x0){return db[_0x563d('0x6d')][_0x563d('0x4c')]({'where':{'sectionId':_0x3019c9['id']},'raw':!![]})['then'](function(_0x357a20){var _0x4f06b8=[];if(_[_0x563d('0x6e')](_0x357a20)){_0x4f06b8=_[_0x563d('0x49')](_0x6bf38e,function(_0x3e209c){if(_0x3e209c['role']!==_0x563d('0x5c')){return _0x3e209c;}});return _0x4f06b8;}else{for(var _0x146686=0x0;_0x146686<_0x6bf38e[_0x563d('0x42')];_0x146686++){var _0x5cfa03=_0x6bf38e[_0x146686];if(_0x5cfa03[_0x563d('0x69')]===_0x563d('0x5c')){var _0x235528=_[_0x563d('0x53')](_0x357a20,function(_0x2d943f){return _0x2d943f[_0x563d('0x6f')]===_0x5cfa03['id'];});if(_0x235528)_0x4f06b8[_0x563d('0x70')](_0x5cfa03);}else{_0x4f06b8[_0x563d('0x70')](_0x5cfa03);}}return _0x4f06b8;}});}else{return _0x6bf38e;}}else{var _0x2bcd7d=_[_0x563d('0x49')](_0x6bf38e,function(_0x1f93e2){if(_0x1f93e2[_0x563d('0x69')]!==_0x563d('0x5c')){return _0x1f93e2;}});return _0x2bcd7d;}});}else{return _0x6bf38e;}}})['then'](function(_0x182422){var _0x58dcd6=[];if(_0x182422){_0x3530a4=_0x182422;for(var _0x4bf460=0x0;_0x4bf460<_0x182422[_0x563d('0x42')];_0x4bf460+=0x1){_0x3530a4[_0x4bf460]['messages']=[];_0x58dcd6['push'](db['ChatInternalMessage'][_0x563d('0x53')]({'where':{'FromId':[_0x59f546[_0x563d('0x68')]['id'],_0x182422[_0x4bf460]['id']],'ToId':[_0x59f546[_0x563d('0x68')]['id'],_0x182422[_0x4bf460]['id']],'ChatGroupId':null},'attributes':['id',_0x563d('0x59'),'FromId','ToId',_0x563d('0x71'),'body'],'order':qs[_0x563d('0x46')](_0x563d('0x72')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x182422[_0x4bf460])));}return BPromise[_0x563d('0x73')](_0x58dcd6);}return[];})[_0x563d('0x31')](function(_0x1fb434){return{'rows':_0x1fb434,'count':_0x1fb434[_0x563d('0x42')]};})[_0x563d('0x31')](respondWithResult(_0x18023a,null))['catch'](handleError(_0x18023a,null));}; \ No newline at end of file +var _0xdf91=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','ChatInternalMessage','include','findAll','rows','catch','rawAttributes','includeAll','options','find','create','body','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','User','agent','admin','user','fullname','userpic','lastLoginAt','allowmessenger','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','-createdAt','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x375492,_0x4ed149){var _0x18ba5b=function(_0x154a12){while(--_0x154a12){_0x375492['push'](_0x375492['shift']());}};_0x18ba5b(++_0x4ed149);}(_0xdf91,0x1ae));var _0x1df9=function(_0x1efa9,_0x1774fc){_0x1efa9=_0x1efa9-0x0;var _0x30157e=_0xdf91[_0x1efa9];return _0x30157e;};'use strict';var emlformat=require(_0x1df9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1df9('0x1'));var jsonpatch=require(_0x1df9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1df9('0x3'));var Mustache=require(_0x1df9('0x4'));var util=require(_0x1df9('0x5'));var path=require(_0x1df9('0x6'));var sox=require(_0x1df9('0x7'));var csv=require(_0x1df9('0x8'));var ejs=require(_0x1df9('0x9'));var fs=require('fs');var fs_extra=require(_0x1df9('0xa'));var _=require(_0x1df9('0xb'));var squel=require(_0x1df9('0xc'));var crypto=require(_0x1df9('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1df9('0x8'));var querystring=require(_0x1df9('0xe'));var Papa=require(_0x1df9('0xf'));var Redis=require(_0x1df9('0x10'));var authService=require(_0x1df9('0x11'));var qs=require(_0x1df9('0x12'));var as=require(_0x1df9('0x13'));var hardwareService=require(_0x1df9('0x14'));var logger=require(_0x1df9('0x15'))(_0x1df9('0x16'));var utils=require(_0x1df9('0x17'));var config=require(_0x1df9('0x18'));var licenseUtil=require(_0x1df9('0x19'));var db=require(_0x1df9('0x1a'))['db'];config[_0x1df9('0x1b')]=_[_0x1df9('0x1c')](config[_0x1df9('0x1b')],{'host':_0x1df9('0x1d'),'port':0x18eb});var socket=require(_0x1df9('0x1e'))(new Redis(config[_0x1df9('0x1b')]));require(_0x1df9('0x1f'))['register'](socket);function respondWithStatusCode(_0x4f7965,_0x22297d){_0x22297d=_0x22297d||0xcc;return function(_0x4d2948){if(_0x4d2948){return _0x4f7965[_0x1df9('0x20')](_0x22297d);}return _0x4f7965[_0x1df9('0x21')](_0x22297d)[_0x1df9('0x22')]();};}function respondWithResult(_0x2805cc,_0x1b9347){_0x1b9347=_0x1b9347||0xc8;return function(_0x42f221){if(_0x42f221){return _0x2805cc[_0x1df9('0x21')](_0x1b9347)[_0x1df9('0x23')](_0x42f221);}};}function respondWithFilteredResult(_0x582b43,_0x1f967c){return function(_0x4668ad){if(_0x4668ad){var _0x5ddb1c=typeof _0x1f967c[_0x1df9('0x24')]===_0x1df9('0x25')&&typeof _0x1f967c[_0x1df9('0x26')]===_0x1df9('0x25');var _0x7ac859=_0x4668ad['count'];var _0x545d1c=_0x5ddb1c?0x0:_0x1f967c[_0x1df9('0x24')];var _0xe1e29e=_0x5ddb1c?_0x4668ad[_0x1df9('0x27')]:_0x1f967c[_0x1df9('0x24')]+_0x1f967c['limit'];var _0x3e8319;if(_0xe1e29e>=_0x7ac859){_0xe1e29e=_0x7ac859;_0x3e8319=0xc8;}else{_0x3e8319=0xce;}_0x582b43[_0x1df9('0x21')](_0x3e8319);return _0x582b43['set'](_0x1df9('0x28'),_0x545d1c+'-'+_0xe1e29e+'/'+_0x7ac859)[_0x1df9('0x23')](_0x4668ad);}return null;};}function patchUpdates(_0x144440){return function(_0x398460){try{jsonpatch[_0x1df9('0x29')](_0x398460,_0x144440,!![]);}catch(_0x39acb7){return BPromise[_0x1df9('0x2a')](_0x39acb7);}return _0x398460[_0x1df9('0x2b')]();};}function saveUpdates(_0x53b4da,_0x2fc140){return function(_0x1f76d2){if(_0x1f76d2){return _0x1f76d2[_0x1df9('0x2c')](_0x53b4da)[_0x1df9('0x2d')](function(_0x2a964e){return _0x2a964e;});}return null;};}function removeEntity(_0x22a32a,_0x24b178){return function(_0x27e242){if(_0x27e242){return _0x27e242[_0x1df9('0x2e')]()[_0x1df9('0x2d')](function(){_0x22a32a['status'](0xcc)[_0x1df9('0x22')]();});}};}function handleEntityNotFound(_0x101913,_0xfe433b){return function(_0x304d9b){if(!_0x304d9b){_0x101913[_0x1df9('0x20')](0x194);}return _0x304d9b;};}function handleError(_0x5db4c6,_0x5d7e98){_0x5d7e98=_0x5d7e98||0x1f4;return function(_0x143ad8){logger[_0x1df9('0x2f')](_0x143ad8[_0x1df9('0x30')]);if(_0x143ad8[_0x1df9('0x31')]){delete _0x143ad8[_0x1df9('0x31')];}_0x5db4c6[_0x1df9('0x21')](_0x5d7e98)[_0x1df9('0x32')](_0x143ad8);};}exports[_0x1df9('0x33')]=function(_0x201b61,_0x5f79ae){var _0x4a1e91={},_0x2efeb4={},_0x534b1f={'count':0x0,'rows':[]};var _0x22448b=_[_0x1df9('0x34')](db['ChatInternalMessage']['rawAttributes'],function(_0x88dbcb){return{'name':_0x88dbcb[_0x1df9('0x35')],'type':_0x88dbcb[_0x1df9('0x36')]['key']};});_0x2efeb4[_0x1df9('0x37')]=_['map'](_0x22448b,_0x1df9('0x31'));_0x2efeb4[_0x1df9('0x38')]=_[_0x1df9('0x39')](_0x201b61['query']);_0x2efeb4[_0x1df9('0x3a')]=_[_0x1df9('0x3b')](_0x2efeb4[_0x1df9('0x37')],_0x2efeb4['query']);_0x4a1e91['attributes']=_['intersection'](_0x2efeb4[_0x1df9('0x37')],qs[_0x1df9('0x3c')](_0x201b61['query']['fields']));_0x4a1e91[_0x1df9('0x3d')]=_0x4a1e91[_0x1df9('0x3d')][_0x1df9('0x3e')]?_0x4a1e91[_0x1df9('0x3d')]:_0x2efeb4[_0x1df9('0x37')];if(!_0x201b61[_0x1df9('0x38')][_0x1df9('0x3f')](_0x1df9('0x40'))){_0x4a1e91[_0x1df9('0x26')]=qs[_0x1df9('0x26')](_0x201b61[_0x1df9('0x38')][_0x1df9('0x26')]);_0x4a1e91[_0x1df9('0x24')]=qs[_0x1df9('0x24')](_0x201b61[_0x1df9('0x38')][_0x1df9('0x24')]);}_0x4a1e91['order']=qs[_0x1df9('0x41')](_0x201b61['query'][_0x1df9('0x41')]);_0x4a1e91['where']=qs['filters'](_[_0x1df9('0x42')](_0x201b61[_0x1df9('0x38')],_0x2efeb4['filters']),_0x22448b);if(_0x201b61[_0x1df9('0x38')][_0x1df9('0x43')]){_0x4a1e91[_0x1df9('0x44')]=_[_0x1df9('0x45')](_0x4a1e91[_0x1df9('0x44')],{'$or':_[_0x1df9('0x34')](_0x22448b,function(_0x12994b){if(_0x12994b['type']!==_0x1df9('0x46')){var _0x357df2={};_0x357df2[_0x12994b['name']]={'$like':'%'+_0x201b61[_0x1df9('0x38')][_0x1df9('0x43')]+'%'};return _0x357df2;}})});}_0x4a1e91=_['merge']({},_0x4a1e91,_0x201b61['options']);var _0xc30831={'where':_0x4a1e91[_0x1df9('0x44')]};return db[_0x1df9('0x47')][_0x1df9('0x27')](_0xc30831)[_0x1df9('0x2d')](function(_0x5912f7){_0x534b1f[_0x1df9('0x27')]=_0x5912f7;if(_0x201b61[_0x1df9('0x38')]['includeAll']){_0x4a1e91[_0x1df9('0x48')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x1df9('0x49')](_0x4a1e91);})[_0x1df9('0x2d')](function(_0x32f827){_0x534b1f[_0x1df9('0x4a')]=_0x32f827;return _0x534b1f;})['then'](respondWithFilteredResult(_0x5f79ae,_0x4a1e91))[_0x1df9('0x4b')](handleError(_0x5f79ae,null));};exports['show']=function(_0x49bb61,_0x1d2bc9){var _0x2f669c={'raw':!![],'where':{'id':_0x49bb61['params']['id']}},_0x45aa58={};_0x45aa58[_0x1df9('0x37')]=_[_0x1df9('0x39')](db[_0x1df9('0x47')][_0x1df9('0x4c')]);_0x45aa58[_0x1df9('0x38')]=_[_0x1df9('0x39')](_0x49bb61[_0x1df9('0x38')]);_0x45aa58[_0x1df9('0x3a')]=_[_0x1df9('0x3b')](_0x45aa58[_0x1df9('0x37')],_0x45aa58[_0x1df9('0x38')]);_0x2f669c[_0x1df9('0x3d')]=_[_0x1df9('0x3b')](_0x45aa58[_0x1df9('0x37')],qs['fields'](_0x49bb61['query'][_0x1df9('0x3c')]));_0x2f669c[_0x1df9('0x3d')]=_0x2f669c[_0x1df9('0x3d')][_0x1df9('0x3e')]?_0x2f669c[_0x1df9('0x3d')]:_0x45aa58[_0x1df9('0x37')];if(_0x49bb61[_0x1df9('0x38')][_0x1df9('0x4d')]){_0x2f669c[_0x1df9('0x48')]=[{'all':!![]}];}_0x2f669c=_['merge']({},_0x2f669c,_0x49bb61[_0x1df9('0x4e')]);return db[_0x1df9('0x47')][_0x1df9('0x4f')](_0x2f669c)[_0x1df9('0x2d')](handleEntityNotFound(_0x1d2bc9,null))[_0x1df9('0x2d')](respondWithResult(_0x1d2bc9,null))[_0x1df9('0x4b')](handleError(_0x1d2bc9,null));};exports[_0x1df9('0x50')]=function(_0x512be5,_0x1bc4b2){return db['ChatInternalMessage'][_0x1df9('0x50')](_0x512be5[_0x1df9('0x51')],{})[_0x1df9('0x2d')](respondWithResult(_0x1bc4b2,0xc9))['catch'](handleError(_0x1bc4b2,null));};exports[_0x1df9('0x2c')]=function(_0x46d58a,_0x482da3){if(_0x46d58a[_0x1df9('0x51')]['id']){delete _0x46d58a['body']['id'];}return db[_0x1df9('0x47')][_0x1df9('0x4f')]({'where':{'id':_0x46d58a[_0x1df9('0x52')]['id']}})[_0x1df9('0x2d')](handleEntityNotFound(_0x482da3,null))['then'](saveUpdates(_0x46d58a[_0x1df9('0x51')],null))[_0x1df9('0x2d')](respondWithResult(_0x482da3,null))[_0x1df9('0x4b')](handleError(_0x482da3,null));};exports[_0x1df9('0x2e')]=function(_0xcb7866,_0x2597e9){return db['ChatInternalMessage'][_0x1df9('0x4f')]({'where':{'id':_0xcb7866[_0x1df9('0x52')]['id']}})['then'](handleEntityNotFound(_0x2597e9,null))[_0x1df9('0x2d')](removeEntity(_0x2597e9,null))['catch'](handleError(_0x2597e9,null));};exports[_0x1df9('0x53')]=function(_0x5d1117,_0x365892){return db[_0x1df9('0x47')][_0x1df9('0x53')]()[_0x1df9('0x2d')](respondWithResult(_0x365892,null))[_0x1df9('0x4b')](handleError(_0x365892,null));};function wrapUser(_0x4591b5){return function(_0x3ba9c8){var _0x2d9548=_0x4591b5[_0x1df9('0x54')]({'plain':!![]});_0x2d9548[_0x1df9('0x55')]=[];if(_0x3ba9c8){_0x2d9548[_0x1df9('0x56')]=_0x3ba9c8[_0x1df9('0x57')];_0x2d9548[_0x1df9('0x58')]=_0x3ba9c8;}else{_0x2d9548['lastMessageAt']=moment(0x0)[_0x1df9('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d9548['lastMessage']={};}return _0x2d9548;};}exports['getUsers']=function(_0x30a5b1,_0x1215e0,_0x509daf){var _0x48d35e=[];return db[_0x1df9('0x5a')][_0x1df9('0x49')]({'where':{'role':[_0x1df9('0x5b'),_0x1df9('0x5c'),_0x1df9('0x5d')]},'attributes':['id',_0x1df9('0x5e'),_0x1df9('0x31'),'role',_0x1df9('0x5f'),'internal','online',_0x1df9('0x60'),_0x1df9('0x61'),'showWebBar'],'order':qs['sort'](_0x1df9('0x62')),'include':[{'model':db['VoiceQueue'],'as':_0x1df9('0x63'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x1df9('0x2d')](function(_0x280f6f){if(_0x280f6f){var _0x464bf1=_0x30a5b1[_0x1df9('0x5d')][_0x1df9('0x54')]({'plain':!![]});if(!_0x464bf1)throw new Error(_0x1df9('0x64'));if(_0x464bf1[_0x1df9('0x65')]===_0x1df9('0x5d')){return db[_0x1df9('0x66')][_0x1df9('0x4f')]({'where':{'name':'Agents','userProfileId':_0x464bf1[_0x1df9('0x67')]},'raw':!![]})[_0x1df9('0x2d')](function(_0x3f02da){if(_0x3f02da){if(_0x3f02da[_0x1df9('0x68')]===0x0){return db[_0x1df9('0x69')]['findAll']({'where':{'sectionId':_0x3f02da['id']},'raw':!![]})[_0x1df9('0x2d')](function(_0x2ca515){var _0x4c7385=[];if(_[_0x1df9('0x6a')](_0x2ca515)){_0x4c7385=_[_0x1df9('0x43')](_0x280f6f,function(_0x446631){if(_0x446631[_0x1df9('0x65')]!=='agent'){return _0x446631;}});return _0x4c7385;}else{for(var _0xc08845=0x0;_0xc08845<_0x280f6f[_0x1df9('0x3e')];_0xc08845++){var _0x1d8713=_0x280f6f[_0xc08845];if(_0x1d8713[_0x1df9('0x65')]===_0x1df9('0x5b')){var _0x474014=_[_0x1df9('0x4f')](_0x2ca515,function(_0x3ca67c){return _0x3ca67c[_0x1df9('0x6b')]===_0x1d8713['id'];});if(_0x474014)_0x4c7385[_0x1df9('0x6c')](_0x1d8713);}else{_0x4c7385[_0x1df9('0x6c')](_0x1d8713);}}return _0x4c7385;}});}else{return _0x280f6f;}}else{var _0x3141f9=_['filter'](_0x280f6f,function(_0x437428){if(_0x437428[_0x1df9('0x65')]!==_0x1df9('0x5b')){return _0x437428;}});return _0x3141f9;}});}else{return _0x280f6f;}}})[_0x1df9('0x2d')](function(_0x7413e2){var _0x6b8c8=[];if(_0x7413e2){_0x48d35e=_0x7413e2;for(var _0x623278=0x0;_0x623278<_0x7413e2['length'];_0x623278+=0x1){_0x48d35e[_0x623278][_0x1df9('0x55')]=[];_0x6b8c8[_0x1df9('0x6c')](db['ChatInternalMessage'][_0x1df9('0x4f')]({'where':{'FromId':[_0x30a5b1[_0x1df9('0x5d')]['id'],_0x7413e2[_0x623278]['id']],'ToId':[_0x30a5b1[_0x1df9('0x5d')]['id'],_0x7413e2[_0x623278]['id']],'ChatGroupId':null},'attributes':['id',_0x1df9('0x57'),_0x1df9('0x6d'),_0x1df9('0x6e'),'read','body'],'order':qs[_0x1df9('0x41')](_0x1df9('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x7413e2[_0x623278])));}return BPromise['all'](_0x6b8c8);}return[];})[_0x1df9('0x2d')](function(_0x579aef){return{'rows':_0x579aef,'count':_0x579aef[_0x1df9('0x3e')]};})[_0x1df9('0x2d')](respondWithResult(_0x1215e0,null))[_0x1df9('0x4b')](handleError(_0x1215e0,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 17672a3..d9df775 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 _0x1666=['emit','exports','events','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x235e66,_0x4bef96){var _0x36019b=function(_0x3674f3){while(--_0x3674f3){_0x235e66['push'](_0x235e66['shift']());}};_0x36019b(++_0x4bef96);}(_0x1666,0xbf));var _0x6166=function(_0x160c44,_0x1deaf1){_0x160c44=_0x160c44-0x0;var _0x518efd=_0x1666[_0x160c44];return _0x518efd;};'use strict';var EventEmitter=require(_0x6166('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x6166('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6166('0x2')](0x0);var events={'afterCreate':_0x6166('0x3'),'afterUpdate':_0x6166('0x4'),'afterDestroy':'remove'};function emitEvent(_0x489f2d){return function(_0x255767,_0x411db1,_0x55c2b5){ChatInternalMessageEvents[_0x6166('0x5')](_0x489f2d+':'+_0x255767['id'],_0x255767);ChatInternalMessageEvents[_0x6166('0x5')](_0x489f2d,_0x255767);_0x55c2b5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x6166('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xe408=['emit','hasOwnProperty','hook','exports','events','save','update','remove'];(function(_0x10db6b,_0x319505){var _0xa0fb99=function(_0x35fa67){while(--_0x35fa67){_0x10db6b['push'](_0x10db6b['shift']());}};_0xa0fb99(++_0x319505);}(_0xe408,0x74));var _0x8e40=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xe408[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0x8e40('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8e40('0x1'),'afterUpdate':_0x8e40('0x2'),'afterDestroy':_0x8e40('0x3')};function emitEvent(_0x539421){return function(_0x5e5bae,_0x7f5126,_0x32f527){ChatInternalMessageEvents[_0x8e40('0x4')](_0x539421+':'+_0x5e5bae['id'],_0x5e5bae);ChatInternalMessageEvents['emit'](_0x539421,_0x5e5bae);_0x32f527(null);};}for(var e in events){if(events[_0x8e40('0x5')](e)){var event=events[e];ChatInternalMessage[_0x8e40('0x6')](e,emitEvent(event));}}module[_0x8e40('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 30a4e10..6704b1f 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 _0xe90b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x5175b8,_0x20b486){var _0x25085d=function(_0x407b08){while(--_0x407b08){_0x5175b8['push'](_0x5175b8['shift']());}};_0x25085d(++_0x20b486);}(_0xe90b,0x107));var _0xbe90=function(_0xf89ad3,_0x4a4a05){_0xf89ad3=_0xf89ad3-0x0;var _0x324449=_0xe90b[_0xf89ad3];return _0x324449;};'use strict';var _=require(_0xbe90('0x0'));var util=require('util');var logger=require(_0xbe90('0x1'))(_0xbe90('0x2'));var moment=require(_0xbe90('0x3'));var BPromise=require(_0xbe90('0x4'));var rp=require(_0xbe90('0x5'));var fs=require('fs');var path=require(_0xbe90('0x6'));var rimraf=require(_0xbe90('0x7'));var config=require(_0xbe90('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0xbe90('0x9')]=function(_0x2a2c5e,_0x450bff){return _0x2a2c5e['define'](_0xbe90('0xa'),attributes,{'tableName':_0xbe90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbe90('0xc'),'collate':_0xbe90('0xd')});}; \ No newline at end of file +var _0x4e5d=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x102fe7,_0x2329d7){var _0x28baeb=function(_0x5c8475){while(--_0x5c8475){_0x102fe7['push'](_0x102fe7['shift']());}};_0x28baeb(++_0x2329d7);}(_0x4e5d,0x6c));var _0xd4e5=function(_0x1d1918,_0x9b060b){_0x1d1918=_0x1d1918-0x0;var _0x40242b=_0x4e5d[_0x1d1918];return _0x40242b;};'use strict';var _=require(_0xd4e5('0x0'));var util=require(_0xd4e5('0x1'));var logger=require(_0xd4e5('0x2'))(_0xd4e5('0x3'));var moment=require('moment');var BPromise=require(_0xd4e5('0x4'));var rp=require(_0xd4e5('0x5'));var fs=require('fs');var path=require(_0xd4e5('0x6'));var rimraf=require(_0xd4e5('0x7'));var config=require(_0xd4e5('0x8'));var attributes=require(_0xd4e5('0x9'));module[_0xd4e5('0xa')]=function(_0x17a134,_0x2e3997){return _0x17a134[_0xd4e5('0xb')](_0xd4e5('0xc'),attributes,{'tableName':_0xd4e5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd4e5('0xe'),'collate':_0xd4e5('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index b4c60f1..5b0ee2b 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 _0x093d=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','socket.io-emitter','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x58482e,_0x370ce6){var _0x43e87d=function(_0x5ddda8){while(--_0x5ddda8){_0x58482e['push'](_0x58482e['shift']());}};_0x43e87d(++_0x370ce6);}(_0x093d,0x1c9));var _0xd093=function(_0x5be46a,_0x2fb035){_0x5be46a=_0x5be46a-0x0;var _0x1ce3b8=_0x093d[_0x5be46a];return _0x1ce3b8;};'use strict';var _=require(_0xd093('0x0'));var util=require(_0xd093('0x1'));var moment=require(_0xd093('0x2'));var BPromise=require(_0xd093('0x3'));var rs=require(_0xd093('0x4'));var fs=require('fs');var Redis=require(_0xd093('0x5'));var db=require(_0xd093('0x6'))['db'];var utils=require(_0xd093('0x7'));var logger=require(_0xd093('0x8'))(_0xd093('0x9'));var config=require(_0xd093('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xd093('0xb')](config[_0xd093('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd093('0xd'))(new Redis(config[_0xd093('0xc')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3b7f9e,_0x27f19b,_0x354827){return new BPromise(function(_0x93a722,_0x55939d){return client[_0xd093('0xe')](_0x3b7f9e,_0x354827)['then'](function(_0xc77895){logger['info'](_0xd093('0xf'),_0x27f19b,_0xd093('0x10'));logger[_0xd093('0x11')](_0xd093('0x12'),_0x27f19b,_0xd093('0x10'),JSON[_0xd093('0x13')](_0xc77895));if(_0xc77895['error']){if(_0xc77895[_0xd093('0x14')]['code']===0x1f4){logger[_0xd093('0x14')](_0xd093('0xf'),_0x27f19b,_0xc77895[_0xd093('0x14')][_0xd093('0x15')]);return _0x55939d(_0xc77895[_0xd093('0x14')]['message']);}logger['error'](_0xd093('0xf'),_0x27f19b,_0xc77895[_0xd093('0x14')]['message']);return _0x93a722(_0xc77895[_0xd093('0x14')][_0xd093('0x15')]);}else{logger[_0xd093('0x16')](_0xd093('0xf'),_0x27f19b,_0xd093('0x10'));_0x93a722(_0xc77895[_0xd093('0x17')]['message']);}})['catch'](function(_0x2f19a9){logger[_0xd093('0x14')](_0xd093('0xf'),_0x27f19b,_0x2f19a9);_0x55939d(_0x2f19a9);});});} \ No newline at end of file +var _0x0c74=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x370802,_0x2f1062){var _0x508d1e=function(_0x635a0e){while(--_0x635a0e){_0x370802['push'](_0x370802['shift']());}};_0x508d1e(++_0x2f1062);}(_0x0c74,0x1cd));var _0x40c7=function(_0x25510b,_0x46fc92){_0x25510b=_0x25510b-0x0;var _0x5a07e9=_0x0c74[_0x25510b];return _0x5a07e9;};'use strict';var _=require('lodash');var util=require(_0x40c7('0x0'));var moment=require(_0x40c7('0x1'));var BPromise=require(_0x40c7('0x2'));var rs=require(_0x40c7('0x3'));var fs=require('fs');var Redis=require(_0x40c7('0x4'));var db=require(_0x40c7('0x5'))['db'];var utils=require(_0x40c7('0x6'));var logger=require('../../config/logger')(_0x40c7('0x7'));var config=require(_0x40c7('0x8'));var jayson=require(_0x40c7('0x9'));var client=jayson[_0x40c7('0xa')]['http']({'port':0x232a});config[_0x40c7('0xb')]=_[_0x40c7('0xc')](config[_0x40c7('0xb')],{'host':_0x40c7('0xd'),'port':0x18eb});var socket=require(_0x40c7('0xe'))(new Redis(config[_0x40c7('0xb')]));require(_0x40c7('0xf'))[_0x40c7('0x10')](socket);function respondWithRpcPromise(_0x2106a1,_0x429402,_0x292b85){return new BPromise(function(_0x5854d6,_0x1df969){return client['request'](_0x2106a1,_0x292b85)[_0x40c7('0x11')](function(_0x5ccadb){logger[_0x40c7('0x12')](_0x40c7('0x13'),_0x429402,_0x40c7('0x14'));logger['debug'](_0x40c7('0x15'),_0x429402,_0x40c7('0x14'),JSON[_0x40c7('0x16')](_0x5ccadb));if(_0x5ccadb['error']){if(_0x5ccadb[_0x40c7('0x17')]['code']===0x1f4){logger['error'](_0x40c7('0x13'),_0x429402,_0x5ccadb[_0x40c7('0x17')]['message']);return _0x1df969(_0x5ccadb['error']['message']);}logger[_0x40c7('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x429402,_0x5ccadb['error'][_0x40c7('0x18')]);return _0x5854d6(_0x5ccadb[_0x40c7('0x17')][_0x40c7('0x18')]);}else{logger[_0x40c7('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x429402,_0x40c7('0x14'));_0x5854d6(_0x5ccadb[_0x40c7('0x19')][_0x40c7('0x18')]);}})[_0x40c7('0x1a')](function(_0x4e6d4a){logger['error'](_0x40c7('0x13'),_0x429402,_0x4e6d4a);_0x1df969(_0x4e6d4a);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index e9de56a..243fc06 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 _0xb175=['remove','emit','removeListener','register','length','chatInternalMessage:','save'];(function(_0x4c0619,_0x58dd6b){var _0x40ee84=function(_0x507ec6){while(--_0x507ec6){_0x4c0619['push'](_0x4c0619['shift']());}};_0x40ee84(++_0x58dd6b);}(_0xb175,0x1e9));var _0x5b17=function(_0x12f1e9,_0x5e4b21){_0x12f1e9=_0x12f1e9-0x0;var _0x2dc2de=_0xb175[_0x12f1e9];return _0x2dc2de;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x5b17('0x0'),_0x5b17('0x1'),'update'];function createListener(_0x15f6fa,_0x363647){return function(_0x316e2f){_0x363647[_0x5b17('0x2')](_0x15f6fa,_0x316e2f);};}function removeListener(_0x1be9da,_0x3e190d){return function(){ChatInternalMessageEvents[_0x5b17('0x3')](_0x1be9da,_0x3e190d);};}exports[_0x5b17('0x4')]=function(_0x5c560a){for(var _0x51006a=0x0,_0xd49f93=events[_0x5b17('0x5')];_0x51006a<_0xd49f93;_0x51006a++){var _0x59d155=events[_0x51006a];var _0x5d81d6=createListener(_0x5b17('0x6')+_0x59d155,_0x5c560a);ChatInternalMessageEvents['on'](_0x59d155,_0x5d81d6);}}; \ No newline at end of file +var _0x828f=['save','remove','update','emit','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x39768c,_0x46b47d){var _0x17f06c=function(_0xc08ab4){while(--_0xc08ab4){_0x39768c['push'](_0x39768c['shift']());}};_0x17f06c(++_0x46b47d);}(_0x828f,0x12b));var _0xf828=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0x828f[_0x5eef05];return _0x56d4b8;};'use strict';var ChatInternalMessageEvents=require(_0xf828('0x0'));var events=[_0xf828('0x1'),_0xf828('0x2'),_0xf828('0x3')];function createListener(_0x1e571d,_0x4ae3b3){return function(_0x14ea31){_0x4ae3b3[_0xf828('0x4')](_0x1e571d,_0x14ea31);};}function removeListener(_0x588942,_0x3319b7){return function(){ChatInternalMessageEvents['removeListener'](_0x588942,_0x3319b7);};}exports['register']=function(_0x4d0ec8){for(var _0x2f9dc5=0x0,_0x1a63dd=events['length'];_0x2f9dc5<_0x1a63dd;_0x2f9dc5++){var _0x2f1d26=events[_0x2f9dc5];var _0x48fa7c=createListener(_0xf828('0x5')+_0x2f1d26,_0x4d0ec8);ChatInternalMessageEvents['on'](_0x2f1d26,_0x48fa7c);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index d1d27c2..c67d04d 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 _0x4beb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','destroy','exports','util','express','Router'];(function(_0x59556b,_0x3db7cb){var _0x3f3150=function(_0x22fed7){while(--_0x22fed7){_0x59556b['push'](_0x59556b['shift']());}};_0x3f3150(++_0x3db7cb);}(_0x4beb,0x14d));var _0xb4be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4beb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xb4be('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb4be('0x1'));var router=express[_0xb4be('0x2')]();var fs_extra=require(_0xb4be('0x3'));var auth=require(_0xb4be('0x4'));var interaction=require(_0xb4be('0x5'));var config=require(_0xb4be('0x6'));var controller=require(_0xb4be('0x7'));router[_0xb4be('0x8')]('/',auth['isAuthenticated'](),controller[_0xb4be('0x9')]);router[_0xb4be('0x8')](_0xb4be('0xa'),auth[_0xb4be('0xb')](),controller['describe']);router['get'](_0xb4be('0xc'),auth['isAuthenticated'](),controller[_0xb4be('0xd')]);router[_0xb4be('0x8')](_0xb4be('0xe'),auth[_0xb4be('0xb')](),controller['show']);router[_0xb4be('0xf')]('/',auth[_0xb4be('0xb')](),controller[_0xb4be('0x10')]);router[_0xb4be('0x11')]('/:id',controller[_0xb4be('0x12')]);router['delete'](_0xb4be('0xe'),auth[_0xb4be('0xb')](),controller[_0xb4be('0x13')]);module[_0xb4be('0x14')]=router; \ No newline at end of file +var _0x8c04=['isAuthenticated','/describe','describe','getUsers','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x5159fd,_0x4b760b){var _0x409bae=function(_0x30f5f0){while(--_0x30f5f0){_0x5159fd['push'](_0x5159fd['shift']());}};_0x409bae(++_0x4b760b);}(_0x8c04,0x155));var _0x48c0=function(_0x12aa5f,_0x1a6cc9){_0x12aa5f=_0x12aa5f-0x0;var _0x1302d1=_0x8c04[_0x12aa5f];return _0x1302d1;};'use strict';var multer=require(_0x48c0('0x0'));var util=require(_0x48c0('0x1'));var path=require(_0x48c0('0x2'));var timeout=require(_0x48c0('0x3'));var express=require(_0x48c0('0x4'));var router=express['Router']();var fs_extra=require(_0x48c0('0x5'));var auth=require(_0x48c0('0x6'));var interaction=require(_0x48c0('0x7'));var config=require(_0x48c0('0x8'));var controller=require(_0x48c0('0x9'));router[_0x48c0('0xa')]('/',auth[_0x48c0('0xb')](),controller['index']);router['get'](_0x48c0('0xc'),auth[_0x48c0('0xb')](),controller[_0x48c0('0xd')]);router[_0x48c0('0xa')]('/users',auth['isAuthenticated'](),controller[_0x48c0('0xe')]);router['get'](_0x48c0('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x48c0('0x10')]('/',auth[_0x48c0('0xb')](),controller[_0x48c0('0x11')]);router[_0x48c0('0x12')](_0x48c0('0xf'),controller[_0x48c0('0x13')]);router[_0x48c0('0x14')]('/:id',auth[_0x48c0('0xb')](),controller['destroy']);module[_0x48c0('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 494f32f..833f9dc 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 _0xbcff=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x1aae33,_0x110a80){var _0x2e91e9=function(_0x218767){while(--_0x218767){_0x1aae33['push'](_0x1aae33['shift']());}};_0x2e91e9(++_0x110a80);}(_0xbcff,0x12e));var _0xfbcf=function(_0x541037,_0x582f95){_0x541037=_0x541037-0x0;var _0x225dd7=_0xbcff[_0x541037];return _0x225dd7;};'use strict';var Sequelize=require(_0xfbcf('0x0'));module[_0xfbcf('0x1')]={'body':{'type':Sequelize[_0xfbcf('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfbcf('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfbcf('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfbcf('0x4')]('in','out'),'defaultValue':_0xfbcf('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xfbcf('0x6')]},'providerName':{'type':Sequelize[_0xfbcf('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x71f4=['ENUM','out','STRING','TEXT','medium','BOOLEAN'];(function(_0x596e17,_0x401b1e){var _0x220436=function(_0x11cbde){while(--_0x11cbde){_0x596e17['push'](_0x596e17['shift']());}};_0x220436(++_0x401b1e);}(_0x71f4,0xf9));var _0x471f=function(_0x523d5e,_0x3ce2d2){_0x523d5e=_0x523d5e-0x0;var _0x432c25=_0x71f4[_0x523d5e];return _0x432c25;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x471f('0x0')](_0x471f('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x471f('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x471f('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x471f('0x3')]('in','out'),'defaultValue':_0x471f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x471f('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 13ad7a7..92fec3f 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 _0xae0d=['order','sort','merge','where','VIRTUAL','filter','ChatMessage','findAll','rows','catch','show','keys','rawAttributes','length','includeAll','include','find','create','body','params','describe','chat-interactions','accept','chat','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','format','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','interaction','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','interface','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x385472,_0x194f20){var _0x2dc2f0=function(_0x5580ca){while(--_0x5580ca){_0x385472['push'](_0x385472['shift']());}};_0x2dc2f0(++_0x194f20);}(_0xae0d,0x14e));var _0xdae0=function(_0x4f3f68,_0x2a4010){_0x4f3f68=_0x4f3f68-0x0;var _0x141010=_0xae0d[_0x4f3f68];return _0x141010;};'use strict';var emlformat=require(_0xdae0('0x0'));var rimraf=require(_0xdae0('0x1'));var zipdir=require(_0xdae0('0x2'));var jsonpatch=require(_0xdae0('0x3'));var rp=require('request-promise');var moment=require(_0xdae0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdae0('0x5'));var util=require(_0xdae0('0x6'));var path=require(_0xdae0('0x7'));var sox=require('sox');var csv=require(_0xdae0('0x8'));var ejs=require(_0xdae0('0x9'));var fs=require('fs');var fs_extra=require(_0xdae0('0xa'));var _=require(_0xdae0('0xb'));var squel=require('squel');var crypto=require(_0xdae0('0xc'));var jsforce=require(_0xdae0('0xd'));var deskjs=require(_0xdae0('0xe'));var toCsv=require(_0xdae0('0x8'));var querystring=require('querystring');var Papa=require(_0xdae0('0xf'));var Redis=require(_0xdae0('0x10'));var authService=require(_0xdae0('0x11'));var qs=require(_0xdae0('0x12'));var as=require(_0xdae0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdae0('0x14'))(_0xdae0('0x15'));var utils=require('../../config/utils');var config=require(_0xdae0('0x16'));var licenseUtil=require(_0xdae0('0x17'));var db=require(_0xdae0('0x18'))['db'];config[_0xdae0('0x19')]=_['defaults'](config[_0xdae0('0x19')],{'host':_0xdae0('0x1a'),'port':0x18eb});var socket=require(_0xdae0('0x1b'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xdae0('0x1c')](socket);var jayson=require(_0xdae0('0x1d'));var client=jayson[_0xdae0('0x1e')][_0xdae0('0x1f')]({'port':0x232c});var client9002=jayson[_0xdae0('0x1e')][_0xdae0('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4d7bce,_0x42c54c,_0x7f388a,_0x3db4c1){return new BPromise(function(_0xc43acb,_0x1983fc){var _0x22bccf=_0x3db4c1||client;return _0x22bccf['request'](_0x4d7bce,_0x7f388a)[_0xdae0('0x20')](function(_0x4c4637){logger[_0xdae0('0x21')](_0xdae0('0x22'),_0x42c54c,_0xdae0('0x23'));logger['debug'](_0xdae0('0x24'),_0x42c54c,'request\x20sent',JSON[_0xdae0('0x25')](_0x4c4637));if(_0x4c4637['error']){if(_0x4c4637['error']['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x42c54c,_0x4c4637[_0xdae0('0x26')]['message']);return _0x1983fc(_0x4c4637['error'][_0xdae0('0x27')]);}logger[_0xdae0('0x26')]('ChatMessage,\x20%s,\x20%s',_0x42c54c,_0x4c4637[_0xdae0('0x26')][_0xdae0('0x27')]);return _0xc43acb(_0x4c4637[_0xdae0('0x26')][_0xdae0('0x27')]);}else{logger['info'](_0xdae0('0x22'),_0x42c54c,_0xdae0('0x23'));_0xc43acb(_0x4c4637[_0xdae0('0x28')][_0xdae0('0x27')]);}})['catch'](function(_0x163605){logger[_0xdae0('0x26')]('ChatMessage,\x20%s,\x20%s',_0x42c54c,_0x163605);_0x1983fc(_0x163605);});});}function respondWithStatusCode(_0x4ae881,_0x2a81fd){_0x2a81fd=_0x2a81fd||0xcc;return function(_0x3f718e){if(_0x3f718e){return _0x4ae881[_0xdae0('0x29')](_0x2a81fd);}return _0x4ae881[_0xdae0('0x2a')](_0x2a81fd)[_0xdae0('0x2b')]();};}function respondWithResult(_0x1c404c,_0x6f49de){_0x6f49de=_0x6f49de||0xc8;return function(_0x9c0df7){if(_0x9c0df7){return _0x1c404c['status'](_0x6f49de)[_0xdae0('0x2c')](_0x9c0df7);}};}function respondWithFilteredResult(_0xd55123,_0x233b04){return function(_0xebd483){if(_0xebd483){var _0x49f72b=typeof _0x233b04[_0xdae0('0x2d')]==='undefined'&&typeof _0x233b04[_0xdae0('0x2e')]===_0xdae0('0x2f');var _0x4ff905=_0xebd483['count'];var _0x3f7188=_0x49f72b?0x0:_0x233b04['offset'];var _0x4174ba=_0x49f72b?_0xebd483[_0xdae0('0x30')]:_0x233b04[_0xdae0('0x2d')]+_0x233b04['limit'];var _0x1a2e9a;if(_0x4174ba>=_0x4ff905){_0x4174ba=_0x4ff905;_0x1a2e9a=0xc8;}else{_0x1a2e9a=0xce;}_0xd55123[_0xdae0('0x2a')](_0x1a2e9a);return _0xd55123['set'](_0xdae0('0x31'),_0x3f7188+'-'+_0x4174ba+'/'+_0x4ff905)[_0xdae0('0x2c')](_0xebd483);}return null;};}function patchUpdates(_0x116921){return function(_0x5ac294){try{jsonpatch[_0xdae0('0x32')](_0x5ac294,_0x116921,!![]);}catch(_0x1101e7){return BPromise[_0xdae0('0x33')](_0x1101e7);}return _0x5ac294[_0xdae0('0x34')]();};}function saveUpdates(_0x29089e,_0x1db575){return function(_0x4308df){if(_0x4308df){return _0x4308df[_0xdae0('0x35')](_0x29089e)['then'](function(_0x2b4a18){return _0x2b4a18;});}return null;};}function removeEntity(_0x5b9600,_0x321818){return function(_0x1ba6b0){if(_0x1ba6b0){return _0x1ba6b0[_0xdae0('0x36')]()['then'](function(){_0x5b9600['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c26f0,_0x477ae7){return function(_0x5067ba){if(!_0x5067ba){_0x1c26f0[_0xdae0('0x29')](0x194);}return _0x5067ba;};}function handleError(_0x46d113,_0x166d60){_0x166d60=_0x166d60||0x1f4;return function(_0x4b2b33){logger['error'](_0x4b2b33[_0xdae0('0x37')]);if(_0x4b2b33[_0xdae0('0x38')]){delete _0x4b2b33[_0xdae0('0x38')];}_0x46d113[_0xdae0('0x2a')](_0x166d60)[_0xdae0('0x39')](_0x4b2b33);};}exports[_0xdae0('0x3a')]=function(_0x542900,_0x896cc4){var _0x2e8a27={},_0x5c876f={},_0x21c502={'count':0x0,'rows':[]};var _0x2c159f=_[_0xdae0('0x3b')](db['ChatMessage']['rawAttributes'],function(_0x2ecf0e){return{'name':_0x2ecf0e[_0xdae0('0x3c')],'type':_0x2ecf0e[_0xdae0('0x3d')][_0xdae0('0x3e')]};});_0x5c876f[_0xdae0('0x3f')]=_[_0xdae0('0x3b')](_0x2c159f,_0xdae0('0x38'));_0x5c876f[_0xdae0('0x40')]=_['keys'](_0x542900['query']);_0x5c876f[_0xdae0('0x41')]=_[_0xdae0('0x42')](_0x5c876f[_0xdae0('0x3f')],_0x5c876f[_0xdae0('0x40')]);_0x2e8a27['attributes']=_[_0xdae0('0x42')](_0x5c876f[_0xdae0('0x3f')],qs[_0xdae0('0x43')](_0x542900['query'][_0xdae0('0x43')]));_0x2e8a27[_0xdae0('0x44')]=_0x2e8a27[_0xdae0('0x44')]['length']?_0x2e8a27[_0xdae0('0x44')]:_0x5c876f[_0xdae0('0x3f')];if(!_0x542900[_0xdae0('0x40')][_0xdae0('0x45')](_0xdae0('0x46'))){_0x2e8a27['limit']=qs[_0xdae0('0x2e')](_0x542900[_0xdae0('0x40')]['limit']);_0x2e8a27[_0xdae0('0x2d')]=qs[_0xdae0('0x2d')](_0x542900['query'][_0xdae0('0x2d')]);}_0x2e8a27[_0xdae0('0x47')]=qs['sort'](_0x542900[_0xdae0('0x40')][_0xdae0('0x48')]);_0x2e8a27['where']=qs[_0xdae0('0x41')](_['pick'](_0x542900[_0xdae0('0x40')],_0x5c876f[_0xdae0('0x41')]),_0x2c159f);if(_0x542900[_0xdae0('0x40')]['filter']){_0x2e8a27['where']=_[_0xdae0('0x49')](_0x2e8a27[_0xdae0('0x4a')],{'$or':_['map'](_0x2c159f,function(_0x903bab){if(_0x903bab[_0xdae0('0x3d')]!==_0xdae0('0x4b')){var _0x36d81d={};_0x36d81d[_0x903bab[_0xdae0('0x38')]]={'$like':'%'+_0x542900[_0xdae0('0x40')][_0xdae0('0x4c')]+'%'};return _0x36d81d;}})});}_0x2e8a27=_[_0xdae0('0x49')]({},_0x2e8a27,_0x542900['options']);var _0x4081d6={'where':_0x2e8a27[_0xdae0('0x4a')]};return db[_0xdae0('0x4d')][_0xdae0('0x30')](_0x4081d6)[_0xdae0('0x20')](function(_0x530392){_0x21c502[_0xdae0('0x30')]=_0x530392;if(_0x542900['query']['includeAll']){_0x2e8a27['include']=[{'all':!![]}];}return db[_0xdae0('0x4d')][_0xdae0('0x4e')](_0x2e8a27);})[_0xdae0('0x20')](function(_0x2589f4){_0x21c502[_0xdae0('0x4f')]=_0x2589f4;return _0x21c502;})[_0xdae0('0x20')](respondWithFilteredResult(_0x896cc4,_0x2e8a27))[_0xdae0('0x50')](handleError(_0x896cc4,null));};exports[_0xdae0('0x51')]=function(_0x29b981,_0x33ee45){var _0x37624f={'raw':!![],'where':{'id':_0x29b981['params']['id']}},_0x173d6c={};_0x173d6c[_0xdae0('0x3f')]=_[_0xdae0('0x52')](db[_0xdae0('0x4d')][_0xdae0('0x53')]);_0x173d6c[_0xdae0('0x40')]=_[_0xdae0('0x52')](_0x29b981[_0xdae0('0x40')]);_0x173d6c[_0xdae0('0x41')]=_[_0xdae0('0x42')](_0x173d6c[_0xdae0('0x3f')],_0x173d6c[_0xdae0('0x40')]);_0x37624f[_0xdae0('0x44')]=_[_0xdae0('0x42')](_0x173d6c[_0xdae0('0x3f')],qs[_0xdae0('0x43')](_0x29b981[_0xdae0('0x40')][_0xdae0('0x43')]));_0x37624f[_0xdae0('0x44')]=_0x37624f[_0xdae0('0x44')][_0xdae0('0x54')]?_0x37624f[_0xdae0('0x44')]:_0x173d6c[_0xdae0('0x3f')];if(_0x29b981['query'][_0xdae0('0x55')]){_0x37624f[_0xdae0('0x56')]=[{'all':!![]}];}_0x37624f=_[_0xdae0('0x49')]({},_0x37624f,_0x29b981['options']);return db['ChatMessage'][_0xdae0('0x57')](_0x37624f)[_0xdae0('0x20')](handleEntityNotFound(_0x33ee45,null))[_0xdae0('0x20')](respondWithResult(_0x33ee45,null))[_0xdae0('0x50')](handleError(_0x33ee45,null));};exports[_0xdae0('0x58')]=function(_0x36f46e,_0x50375e){return db[_0xdae0('0x4d')][_0xdae0('0x58')](_0x36f46e[_0xdae0('0x59')],{})[_0xdae0('0x20')](respondWithResult(_0x50375e,0xc9))[_0xdae0('0x50')](handleError(_0x50375e,null));};exports[_0xdae0('0x35')]=function(_0x108b11,_0x16fc7c){if(_0x108b11[_0xdae0('0x59')]['id']){delete _0x108b11[_0xdae0('0x59')]['id'];}return db[_0xdae0('0x4d')][_0xdae0('0x57')]({'where':{'id':_0x108b11[_0xdae0('0x5a')]['id']}})[_0xdae0('0x20')](handleEntityNotFound(_0x16fc7c,null))[_0xdae0('0x20')](saveUpdates(_0x108b11[_0xdae0('0x59')],null))[_0xdae0('0x20')](respondWithResult(_0x16fc7c,null))[_0xdae0('0x50')](handleError(_0x16fc7c,null));};exports[_0xdae0('0x36')]=function(_0x295f91,_0x2370b1){return db[_0xdae0('0x4d')][_0xdae0('0x57')]({'where':{'id':_0x295f91[_0xdae0('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2370b1,null))['then'](removeEntity(_0x2370b1,null))[_0xdae0('0x50')](handleError(_0x2370b1,null));};exports[_0xdae0('0x5b')]=function(_0x24eee7,_0x86dd92){return db[_0xdae0('0x4d')]['describe']()[_0xdae0('0x20')](respondWithResult(_0x86dd92,null))[_0xdae0('0x50')](handleError(_0x86dd92,null));};var interaction_log=require(_0xdae0('0x14'))(_0xdae0('0x5c'));exports[_0xdae0('0x5d')]=function(_0x2204de,_0x2b303b,_0x61d75b){var _0x4d76e7={'agent':{},'channel':_0xdae0('0x5e')};if(_0x2204de[_0xdae0('0x59')]['id']){delete _0x2204de[_0xdae0('0x59')]['id'];}_0x2204de[_0xdae0('0x59')][_0xdae0('0x5f')]=!![];_0x2204de['body']['readAt']=moment()['format'](_0xdae0('0x60'));_0x2204de[_0xdae0('0x59')][_0xdae0('0x61')]=_0x2204de[_0xdae0('0x59')][_0xdae0('0x61')]||_0x2204de[_0xdae0('0x62')]['id'];_0x4d76e7[_0xdae0('0x63')]['id']=_0x2204de[_0xdae0('0x59')]['UserId'];return db[_0xdae0('0x4d')]['find']({'where':{'id':_0x2204de['params']['id'],'UserId':null}})[_0xdae0('0x20')](handleEntityNotFound(_0x2b303b,null))['then'](saveUpdates(_0x2204de[_0xdae0('0x59')],null))[_0xdae0('0x20')](function(_0x310189){if(_0x310189){_0x4d76e7['message']=_0x310189[_0xdae0('0x64')]({'plain':!![]});return db[_0xdae0('0x65')][_0xdae0('0x57')]({'where':{'id':_0x310189[_0xdae0('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x2b303b,null))[_0xdae0('0x20')](function(_0x5add62){if(_0x5add62){return _0x5add62[_0xdae0('0x35')]({'UserId':_0x2204de[_0xdae0('0x59')][_0xdae0('0x61')],'read1stAt':_['isNil'](_0x5add62[_0xdae0('0x67')])?moment()[_0xdae0('0x68')](_0xdae0('0x60')):undefined});}return null;})['then'](function(_0x1eff88){if(_0x1eff88){_0x4d76e7['interaction']=_0x1eff88[_0xdae0('0x64')]({'plain':!![]});interaction_log[_0xdae0('0x21')](_0xdae0('0x69'),_0x2204de[_0xdae0('0x62')]['id'],_0x2204de[_0xdae0('0x62')]['name'],_0x2204de[_0xdae0('0x62')][_0xdae0('0x6a')],_0x4d76e7['interaction']['id'],_0x2204de[_0xdae0('0x59')]?JSON['stringify'](_0x2204de[_0xdae0('0x59')]):_0xdae0('0x6b'));return respondWithRpcPromise(_0xdae0('0x6c'),_0xdae0('0x6d'),_0x4d76e7);}return null;})[_0xdae0('0x20')](function(_0x179e2a){var _0x136e1e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x179e2a[_0xdae0('0x27')][_0xdae0('0x6e')];return db['sequelize'][_0xdae0('0x40')](_0x136e1e,{'type':db[_0xdae0('0x6f')][_0xdae0('0x70')][_0xdae0('0x71')],'raw':!![]})[_0xdae0('0x20')](function(_0x44b4ba){return _0x44b4ba;});})['then'](function(_0x679c9){if(_0x679c9){_0x4d76e7[_0xdae0('0x27')][_0xdae0('0x72')]=_0x679c9[0x0];if(!_0x2204de['body'][_0xdae0('0x61')])return;return db[_0xdae0('0x73')][_0xdae0('0x57')]({'where':{'id':_0x2204de['body'][_0xdae0('0x61')],'role':'agent'},'attributes':['id',_0xdae0('0x38'),_0xdae0('0x74'),_0xdae0('0x75'),_0xdae0('0x76')],'raw':!![]});}return null;})[_0xdae0('0x20')](function(_0x3015ae){if(!_0x3015ae)return null;_0x4d76e7['message']['agent']=_0x3015ae;return _0x4d76e7;})[_0xdae0('0x20')](function(_0x39dc44){if(_0x39dc44){if(_0x2204de['body'][_0xdae0('0x77')]){_0x4d76e7['message']['interface']=util[_0xdae0('0x68')](_0xdae0('0x78'),_0x2204de[_0xdae0('0x62')][_0xdae0('0x38')]);_0x4d76e7[_0xdae0('0x27')]['channel']=_0x4d76e7[_0xdae0('0x79')];_0x4d76e7[_0xdae0('0x27')][_0xdae0('0x7a')]=_0x4d76e7['channel'];_0x4d76e7[_0xdae0('0x27')][_0xdae0('0x7b')]=_0xdae0('0x5d');return respondWithRpcPromise(_0xdae0('0x7c'),_0xdae0('0x7c'),{'event':_0xdae0('0x7d'),'message':_['merge'](_0x4d76e7[_0xdae0('0x27')],JSON['parse'](_0x4d76e7[_0xdae0('0x7e')][_0xdae0('0x7f')]))},client9002)[_0xdae0('0x20')](function(){return _0x4d76e7;});}return _0x4d76e7;}return null;})[_0xdae0('0x20')](respondWithResult(_0x2b303b,null))[_0xdae0('0x50')](handleError(_0x2b303b,null));};var interaction_log=require(_0xdae0('0x14'))(_0xdae0('0x5c'));exports[_0xdae0('0x33')]=function(_0x346503,_0x364ff0,_0x15859b){var _0x1a171d={'agent':{},'channel':_0xdae0('0x5e')};if(_0x346503[_0xdae0('0x59')]['id']){delete _0x346503['body']['id'];}_0x346503[_0xdae0('0x59')][_0xdae0('0x61')]=_0x346503[_0xdae0('0x59')][_0xdae0('0x61')]||_0x346503[_0xdae0('0x62')]['id'];_0x1a171d[_0xdae0('0x63')]['id']=_0x346503[_0xdae0('0x59')][_0xdae0('0x61')];return db[_0xdae0('0x4d')][_0xdae0('0x57')]({'where':{'id':_0x346503['params']['id'],'UserId':null}})[_0xdae0('0x20')](handleEntityNotFound(_0x364ff0,null))[_0xdae0('0x20')](function(_0x431244){if(_0x431244){_0x1a171d[_0xdae0('0x27')]=_0x431244[_0xdae0('0x64')]({'plain':!![]});return db['ChatInteraction'][_0xdae0('0x57')]({'where':{'id':_0x431244['ChatInteractionId']}});}return null;})[_0xdae0('0x20')](handleEntityNotFound(_0x364ff0,null))[_0xdae0('0x20')](function(_0x134a71){if(_0x134a71){_0x1a171d[_0xdae0('0x7e')]=_0x134a71[_0xdae0('0x64')]({'plain':!![]});interaction_log[_0xdae0('0x21')](_0xdae0('0x80'),_0x346503[_0xdae0('0x62')]['id'],_0x346503[_0xdae0('0x62')][_0xdae0('0x38')],_0x346503[_0xdae0('0x62')][_0xdae0('0x6a')],_0x1a171d[_0xdae0('0x7e')]['id'],_0x346503[_0xdae0('0x59')]?JSON['stringify'](_0x346503[_0xdae0('0x59')]):_0xdae0('0x6b'));return respondWithRpcPromise(_0xdae0('0x81'),_0xdae0('0x82'),_0x1a171d);}return null;})['then'](function(_0x2bd4bd){var _0x2e7854=_0xdae0('0x83')+_0x2bd4bd['message']['ContactId'];return db[_0xdae0('0x84')][_0xdae0('0x40')](_0x2e7854,{'type':db['Sequelize'][_0xdae0('0x70')][_0xdae0('0x71')],'raw':!![]})[_0xdae0('0x20')](function(_0x2ec906){return _0x2ec906;});})[_0xdae0('0x20')](function(_0x5718ca){if(_0x5718ca){_0x1a171d[_0xdae0('0x27')][_0xdae0('0x72')]=_0x5718ca[0x0];if(!_0x346503[_0xdae0('0x59')][_0xdae0('0x61')])return;return db[_0xdae0('0x73')][_0xdae0('0x57')]({'where':{'id':_0x346503['body']['UserId'],'role':_0xdae0('0x63')},'attributes':['id',_0xdae0('0x38'),_0xdae0('0x74'),_0xdae0('0x75'),_0xdae0('0x76')],'raw':!![]});}return null;})[_0xdae0('0x20')](function(_0x4936ae){if(!_0x4936ae)return null;_0x1a171d[_0xdae0('0x27')][_0xdae0('0x63')]=_0x4936ae;return _0x1a171d;})[_0xdae0('0x20')](function(_0x173bdf){if(_0x173bdf){_0x173bdf['message'][_0xdae0('0x85')]=util[_0xdae0('0x68')](_0xdae0('0x78'),_0x346503['user']['name']);_0x173bdf[_0xdae0('0x27')][_0xdae0('0x79')]=_0x1a171d['channel'];_0x173bdf[_0xdae0('0x27')][_0xdae0('0x7a')]=_0x1a171d[_0xdae0('0x79')];_0x173bdf[_0xdae0('0x27')][_0xdae0('0x7b')]=_0xdae0('0x33');respondWithRpcPromise(_0xdae0('0x7c'),'EventManager',{'event':_0xdae0('0x86'),'message':_[_0xdae0('0x49')](_0x1a171d['message'],JSON['parse'](_0x1a171d[_0xdae0('0x7e')]['formData']))},client9002);return _0x1a171d;}return null;})[_0xdae0('0x20')](respondWithResult(_0x364ff0,null))[_0xdae0('0x50')](handleError(_0x364ff0,null));}; \ No newline at end of file +var _0xe217=['ChatMessage','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','describe','chat-interactions','read','readAt','format','UserId','agent','ChatInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','acceptMessage','sequelize','Sequelize','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','parse','formData','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','SELECT','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','destroy','sendStatus','stack','name','map'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xe217,0xc7));var _0x7e21=function(_0x373cfa,_0xaa057d){_0x373cfa=_0x373cfa-0x0;var _0x58a029=_0xe217[_0x373cfa];return _0x58a029;};'use strict';var emlformat=require(_0x7e21('0x0'));var rimraf=require(_0x7e21('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e21('0x2'));var rp=require(_0x7e21('0x3'));var moment=require(_0x7e21('0x4'));var BPromise=require(_0x7e21('0x5'));var Mustache=require(_0x7e21('0x6'));var util=require(_0x7e21('0x7'));var path=require(_0x7e21('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7e21('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e21('0xa'));var squel=require(_0x7e21('0xb'));var crypto=require(_0x7e21('0xc'));var jsforce=require(_0x7e21('0xd'));var deskjs=require(_0x7e21('0xe'));var toCsv=require(_0x7e21('0xf'));var querystring=require(_0x7e21('0x10'));var Papa=require(_0x7e21('0x11'));var Redis=require(_0x7e21('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7e21('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e21('0x14'))(_0x7e21('0x15'));var utils=require(_0x7e21('0x16'));var config=require(_0x7e21('0x17'));var licenseUtil=require(_0x7e21('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7e21('0x19')](config['redis'],{'host':_0x7e21('0x1a'),'port':0x18eb});var socket=require(_0x7e21('0x1b'))(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x7e21('0x1c'));var client=jayson[_0x7e21('0x1d')][_0x7e21('0x1e')]({'port':0x232c});var client9002=jayson[_0x7e21('0x1d')][_0x7e21('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4f033d,_0x1df5d3,_0x3b3467,_0x49e180){return new BPromise(function(_0x397647,_0x3368fb){var _0x283d1e=_0x49e180||client;return _0x283d1e[_0x7e21('0x1f')](_0x4f033d,_0x3b3467)[_0x7e21('0x20')](function(_0x56dae1){logger[_0x7e21('0x21')](_0x7e21('0x22'),_0x1df5d3,_0x7e21('0x23'));logger['debug'](_0x7e21('0x24'),_0x1df5d3,_0x7e21('0x23'),JSON[_0x7e21('0x25')](_0x56dae1));if(_0x56dae1[_0x7e21('0x26')]){if(_0x56dae1[_0x7e21('0x26')][_0x7e21('0x27')]===0x1f4){logger[_0x7e21('0x26')]('ChatMessage,\x20%s,\x20%s',_0x1df5d3,_0x56dae1[_0x7e21('0x26')][_0x7e21('0x28')]);return _0x3368fb(_0x56dae1[_0x7e21('0x26')][_0x7e21('0x28')]);}logger['error'](_0x7e21('0x22'),_0x1df5d3,_0x56dae1[_0x7e21('0x26')]['message']);return _0x397647(_0x56dae1['error'][_0x7e21('0x28')]);}else{logger['info'](_0x7e21('0x22'),_0x1df5d3,_0x7e21('0x23'));_0x397647(_0x56dae1['result'][_0x7e21('0x28')]);}})[_0x7e21('0x29')](function(_0xfe189f){logger['error'](_0x7e21('0x22'),_0x1df5d3,_0xfe189f);_0x3368fb(_0xfe189f);});});}function respondWithStatusCode(_0x16830a,_0x1abe28){_0x1abe28=_0x1abe28||0xcc;return function(_0x465a98){if(_0x465a98){return _0x16830a['sendStatus'](_0x1abe28);}return _0x16830a[_0x7e21('0x2a')](_0x1abe28)['end']();};}function respondWithResult(_0x47c9c5,_0x12cea3){_0x12cea3=_0x12cea3||0xc8;return function(_0x5393da){if(_0x5393da){return _0x47c9c5['status'](_0x12cea3)['json'](_0x5393da);}};}function respondWithFilteredResult(_0x7afb7a,_0x3ee78a){return function(_0xde7bcb){if(_0xde7bcb){var _0x3388a0=typeof _0x3ee78a[_0x7e21('0x2b')]===_0x7e21('0x2c')&&typeof _0x3ee78a[_0x7e21('0x2d')]===_0x7e21('0x2c');var _0x27bbfb=_0xde7bcb[_0x7e21('0x2e')];var _0x16c46b=_0x3388a0?0x0:_0x3ee78a['offset'];var _0x173ade=_0x3388a0?_0xde7bcb[_0x7e21('0x2e')]:_0x3ee78a['offset']+_0x3ee78a[_0x7e21('0x2d')];var _0x718130;if(_0x173ade>=_0x27bbfb){_0x173ade=_0x27bbfb;_0x718130=0xc8;}else{_0x718130=0xce;}_0x7afb7a['status'](_0x718130);return _0x7afb7a[_0x7e21('0x2f')](_0x7e21('0x30'),_0x16c46b+'-'+_0x173ade+'/'+_0x27bbfb)[_0x7e21('0x31')](_0xde7bcb);}return null;};}function patchUpdates(_0x54430a){return function(_0x20556b){try{jsonpatch['apply'](_0x20556b,_0x54430a,!![]);}catch(_0x5eaa78){return BPromise[_0x7e21('0x32')](_0x5eaa78);}return _0x20556b['save']();};}function saveUpdates(_0x17e810,_0x4fe150){return function(_0x478dfb){if(_0x478dfb){return _0x478dfb[_0x7e21('0x33')](_0x17e810)[_0x7e21('0x20')](function(_0xd2e9b8){return _0xd2e9b8;});}return null;};}function removeEntity(_0x578182,_0x245fe5){return function(_0x48740b){if(_0x48740b){return _0x48740b[_0x7e21('0x34')]()[_0x7e21('0x20')](function(){_0x578182[_0x7e21('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x380731,_0x3ebafd){return function(_0xf60a3d){if(!_0xf60a3d){_0x380731[_0x7e21('0x35')](0x194);}return _0xf60a3d;};}function handleError(_0x2f96e2,_0x392b46){_0x392b46=_0x392b46||0x1f4;return function(_0x1c7b8e){logger[_0x7e21('0x26')](_0x1c7b8e[_0x7e21('0x36')]);if(_0x1c7b8e[_0x7e21('0x37')]){delete _0x1c7b8e[_0x7e21('0x37')];}_0x2f96e2[_0x7e21('0x2a')](_0x392b46)['send'](_0x1c7b8e);};}exports['index']=function(_0x525a50,_0x44b399){var _0x50dcb3={},_0x44fce8={},_0x1ec647={'count':0x0,'rows':[]};var _0xc33e2c=_[_0x7e21('0x38')](db[_0x7e21('0x39')]['rawAttributes'],function(_0x262d47){return{'name':_0x262d47[_0x7e21('0x3a')],'type':_0x262d47['type']['key']};});_0x44fce8[_0x7e21('0x3b')]=_[_0x7e21('0x38')](_0xc33e2c,_0x7e21('0x37'));_0x44fce8[_0x7e21('0x3c')]=_[_0x7e21('0x3d')](_0x525a50[_0x7e21('0x3c')]);_0x44fce8[_0x7e21('0x3e')]=_[_0x7e21('0x3f')](_0x44fce8[_0x7e21('0x3b')],_0x44fce8[_0x7e21('0x3c')]);_0x50dcb3[_0x7e21('0x40')]=_['intersection'](_0x44fce8['model'],qs[_0x7e21('0x41')](_0x525a50['query'][_0x7e21('0x41')]));_0x50dcb3[_0x7e21('0x40')]=_0x50dcb3[_0x7e21('0x40')][_0x7e21('0x42')]?_0x50dcb3[_0x7e21('0x40')]:_0x44fce8[_0x7e21('0x3b')];if(!_0x525a50[_0x7e21('0x3c')][_0x7e21('0x43')](_0x7e21('0x44'))){_0x50dcb3[_0x7e21('0x2d')]=qs[_0x7e21('0x2d')](_0x525a50[_0x7e21('0x3c')]['limit']);_0x50dcb3[_0x7e21('0x2b')]=qs[_0x7e21('0x2b')](_0x525a50[_0x7e21('0x3c')]['offset']);}_0x50dcb3[_0x7e21('0x45')]=qs[_0x7e21('0x46')](_0x525a50[_0x7e21('0x3c')][_0x7e21('0x46')]);_0x50dcb3[_0x7e21('0x47')]=qs['filters'](_[_0x7e21('0x48')](_0x525a50[_0x7e21('0x3c')],_0x44fce8['filters']),_0xc33e2c);if(_0x525a50['query'][_0x7e21('0x49')]){_0x50dcb3[_0x7e21('0x47')]=_[_0x7e21('0x4a')](_0x50dcb3['where'],{'$or':_[_0x7e21('0x38')](_0xc33e2c,function(_0x4e1e3c){if(_0x4e1e3c[_0x7e21('0x4b')]!==_0x7e21('0x4c')){var _0x4dbc61={};_0x4dbc61[_0x4e1e3c[_0x7e21('0x37')]]={'$like':'%'+_0x525a50['query'][_0x7e21('0x49')]+'%'};return _0x4dbc61;}})});}_0x50dcb3=_['merge']({},_0x50dcb3,_0x525a50[_0x7e21('0x4d')]);var _0x3404bf={'where':_0x50dcb3[_0x7e21('0x47')]};return db[_0x7e21('0x39')][_0x7e21('0x2e')](_0x3404bf)['then'](function(_0x4812eb){_0x1ec647[_0x7e21('0x2e')]=_0x4812eb;if(_0x525a50['query'][_0x7e21('0x4e')]){_0x50dcb3[_0x7e21('0x4f')]=[{'all':!![]}];}return db[_0x7e21('0x39')][_0x7e21('0x50')](_0x50dcb3);})[_0x7e21('0x20')](function(_0x55370a){_0x1ec647[_0x7e21('0x51')]=_0x55370a;return _0x1ec647;})['then'](respondWithFilteredResult(_0x44b399,_0x50dcb3))[_0x7e21('0x29')](handleError(_0x44b399,null));};exports[_0x7e21('0x52')]=function(_0x56618a,_0x307b77){var _0x97f48c={'raw':!![],'where':{'id':_0x56618a[_0x7e21('0x53')]['id']}},_0x5c92f7={};_0x5c92f7['model']=_[_0x7e21('0x3d')](db['ChatMessage'][_0x7e21('0x54')]);_0x5c92f7['query']=_[_0x7e21('0x3d')](_0x56618a[_0x7e21('0x3c')]);_0x5c92f7[_0x7e21('0x3e')]=_[_0x7e21('0x3f')](_0x5c92f7[_0x7e21('0x3b')],_0x5c92f7[_0x7e21('0x3c')]);_0x97f48c[_0x7e21('0x40')]=_[_0x7e21('0x3f')](_0x5c92f7[_0x7e21('0x3b')],qs['fields'](_0x56618a[_0x7e21('0x3c')][_0x7e21('0x41')]));_0x97f48c[_0x7e21('0x40')]=_0x97f48c[_0x7e21('0x40')]['length']?_0x97f48c['attributes']:_0x5c92f7[_0x7e21('0x3b')];if(_0x56618a[_0x7e21('0x3c')]['includeAll']){_0x97f48c['include']=[{'all':!![]}];}_0x97f48c=_['merge']({},_0x97f48c,_0x56618a[_0x7e21('0x4d')]);return db['ChatMessage'][_0x7e21('0x55')](_0x97f48c)[_0x7e21('0x20')](handleEntityNotFound(_0x307b77,null))[_0x7e21('0x20')](respondWithResult(_0x307b77,null))[_0x7e21('0x29')](handleError(_0x307b77,null));};exports[_0x7e21('0x56')]=function(_0x302829,_0x3753f2){return db[_0x7e21('0x39')][_0x7e21('0x56')](_0x302829[_0x7e21('0x57')],{})[_0x7e21('0x20')](respondWithResult(_0x3753f2,0xc9))[_0x7e21('0x29')](handleError(_0x3753f2,null));};exports[_0x7e21('0x33')]=function(_0x37cfe3,_0x36b839){if(_0x37cfe3[_0x7e21('0x57')]['id']){delete _0x37cfe3['body']['id'];}return db[_0x7e21('0x39')][_0x7e21('0x55')]({'where':{'id':_0x37cfe3[_0x7e21('0x53')]['id']}})[_0x7e21('0x20')](handleEntityNotFound(_0x36b839,null))[_0x7e21('0x20')](saveUpdates(_0x37cfe3[_0x7e21('0x57')],null))[_0x7e21('0x20')](respondWithResult(_0x36b839,null))[_0x7e21('0x29')](handleError(_0x36b839,null));};exports[_0x7e21('0x34')]=function(_0x52a639,_0x1018ae){return db[_0x7e21('0x39')][_0x7e21('0x55')]({'where':{'id':_0x52a639['params']['id']}})[_0x7e21('0x20')](handleEntityNotFound(_0x1018ae,null))[_0x7e21('0x20')](removeEntity(_0x1018ae,null))['catch'](handleError(_0x1018ae,null));};exports['describe']=function(_0x2202a7,_0xb756ff){return db[_0x7e21('0x39')][_0x7e21('0x58')]()[_0x7e21('0x20')](respondWithResult(_0xb756ff,null))[_0x7e21('0x29')](handleError(_0xb756ff,null));};var interaction_log=require(_0x7e21('0x14'))(_0x7e21('0x59'));exports['accept']=function(_0x6ff838,_0x3d0d94,_0x12147a){var _0x5cdae6={'agent':{},'channel':'chat'};if(_0x6ff838[_0x7e21('0x57')]['id']){delete _0x6ff838['body']['id'];}_0x6ff838[_0x7e21('0x57')][_0x7e21('0x5a')]=!![];_0x6ff838[_0x7e21('0x57')][_0x7e21('0x5b')]=moment()[_0x7e21('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x6ff838[_0x7e21('0x57')][_0x7e21('0x5d')]=_0x6ff838[_0x7e21('0x57')][_0x7e21('0x5d')]||_0x6ff838['user']['id'];_0x5cdae6[_0x7e21('0x5e')]['id']=_0x6ff838[_0x7e21('0x57')][_0x7e21('0x5d')];return db[_0x7e21('0x39')]['find']({'where':{'id':_0x6ff838['params']['id'],'UserId':null}})[_0x7e21('0x20')](handleEntityNotFound(_0x3d0d94,null))[_0x7e21('0x20')](saveUpdates(_0x6ff838[_0x7e21('0x57')],null))[_0x7e21('0x20')](function(_0x20d1cd){if(_0x20d1cd){_0x5cdae6[_0x7e21('0x28')]=_0x20d1cd['get']({'plain':!![]});return db[_0x7e21('0x5f')][_0x7e21('0x55')]({'where':{'id':_0x20d1cd['ChatInteractionId']}});}return null;})[_0x7e21('0x20')](handleEntityNotFound(_0x3d0d94,null))[_0x7e21('0x20')](function(_0x3e8614){if(_0x3e8614){return _0x3e8614['update']({'UserId':_0x6ff838[_0x7e21('0x57')]['UserId'],'read1stAt':_[_0x7e21('0x60')](_0x3e8614[_0x7e21('0x61')])?moment()['format'](_0x7e21('0x62')):undefined});}return null;})[_0x7e21('0x20')](function(_0x3a80fd){if(_0x3a80fd){_0x5cdae6[_0x7e21('0x63')]=_0x3a80fd[_0x7e21('0x64')]({'plain':!![]});interaction_log['info'](_0x7e21('0x65'),_0x6ff838[_0x7e21('0x66')]['id'],_0x6ff838[_0x7e21('0x66')][_0x7e21('0x37')],_0x6ff838[_0x7e21('0x66')][_0x7e21('0x67')],_0x5cdae6['interaction']['id'],_0x6ff838[_0x7e21('0x57')]?JSON[_0x7e21('0x25')](_0x6ff838[_0x7e21('0x57')]):'null');return respondWithRpcPromise('AcceptMessage',_0x7e21('0x68'),_0x5cdae6);}return null;})[_0x7e21('0x20')](function(_0x3e54f9){var _0x47d367='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3e54f9['message']['ContactId'];return db[_0x7e21('0x69')][_0x7e21('0x3c')](_0x47d367,{'type':db[_0x7e21('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})[_0x7e21('0x20')](function(_0x965b22){return _0x965b22;});})[_0x7e21('0x20')](function(_0x224f8a){if(_0x224f8a){_0x5cdae6[_0x7e21('0x28')][_0x7e21('0x6b')]=_0x224f8a[0x0];if(!_0x6ff838[_0x7e21('0x57')]['UserId'])return;return db['User']['find']({'where':{'id':_0x6ff838['body'][_0x7e21('0x5d')],'role':_0x7e21('0x5e')},'attributes':['id',_0x7e21('0x37'),_0x7e21('0x6c'),_0x7e21('0x6d'),_0x7e21('0x6e')],'raw':!![]});}return null;})['then'](function(_0x497ac4){if(!_0x497ac4)return null;_0x5cdae6['message'][_0x7e21('0x5e')]=_0x497ac4;return _0x5cdae6;})[_0x7e21('0x20')](function(_0x102d57){if(_0x102d57){if(_0x6ff838[_0x7e21('0x57')][_0x7e21('0x6f')]){_0x5cdae6[_0x7e21('0x28')][_0x7e21('0x70')]=util[_0x7e21('0x5c')](_0x7e21('0x71'),_0x6ff838[_0x7e21('0x66')][_0x7e21('0x37')]);_0x5cdae6['message'][_0x7e21('0x72')]=_0x5cdae6[_0x7e21('0x72')];_0x5cdae6[_0x7e21('0x28')][_0x7e21('0x73')]=_0x5cdae6[_0x7e21('0x72')];_0x5cdae6['message'][_0x7e21('0x74')]=_0x7e21('0x75');return respondWithRpcPromise(_0x7e21('0x76'),'EventManager',{'event':'acceptmessage','message':_[_0x7e21('0x4a')](_0x5cdae6[_0x7e21('0x28')],JSON[_0x7e21('0x77')](_0x5cdae6[_0x7e21('0x63')][_0x7e21('0x78')]))},client9002)[_0x7e21('0x20')](function(){return _0x5cdae6;});}return _0x5cdae6;}return null;})[_0x7e21('0x20')](respondWithResult(_0x3d0d94,null))[_0x7e21('0x29')](handleError(_0x3d0d94,null));};var interaction_log=require(_0x7e21('0x14'))(_0x7e21('0x59'));exports[_0x7e21('0x32')]=function(_0x4e01f9,_0x10a1a4,_0x474a1d){var _0x27fa39={'agent':{},'channel':'chat'};if(_0x4e01f9['body']['id']){delete _0x4e01f9[_0x7e21('0x57')]['id'];}_0x4e01f9['body'][_0x7e21('0x5d')]=_0x4e01f9[_0x7e21('0x57')]['UserId']||_0x4e01f9[_0x7e21('0x66')]['id'];_0x27fa39[_0x7e21('0x5e')]['id']=_0x4e01f9['body'][_0x7e21('0x5d')];return db[_0x7e21('0x39')][_0x7e21('0x55')]({'where':{'id':_0x4e01f9[_0x7e21('0x53')]['id'],'UserId':null}})[_0x7e21('0x20')](handleEntityNotFound(_0x10a1a4,null))['then'](function(_0x1fa1c8){if(_0x1fa1c8){_0x27fa39[_0x7e21('0x28')]=_0x1fa1c8[_0x7e21('0x64')]({'plain':!![]});return db['ChatInteraction'][_0x7e21('0x55')]({'where':{'id':_0x1fa1c8['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x10a1a4,null))[_0x7e21('0x20')](function(_0x246333){if(_0x246333){_0x27fa39[_0x7e21('0x63')]=_0x246333[_0x7e21('0x64')]({'plain':!![]});interaction_log[_0x7e21('0x21')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e01f9[_0x7e21('0x66')]['id'],_0x4e01f9['user'][_0x7e21('0x37')],_0x4e01f9[_0x7e21('0x66')]['role'],_0x27fa39[_0x7e21('0x63')]['id'],_0x4e01f9[_0x7e21('0x57')]?JSON[_0x7e21('0x25')](_0x4e01f9[_0x7e21('0x57')]):_0x7e21('0x79'));return respondWithRpcPromise(_0x7e21('0x7a'),_0x7e21('0x7b'),_0x27fa39);}return null;})['then'](function(_0x134e9f){var _0x390ab1=_0x7e21('0x7c')+_0x134e9f[_0x7e21('0x28')][_0x7e21('0x7d')];return db['sequelize'][_0x7e21('0x3c')](_0x390ab1,{'type':db[_0x7e21('0x6a')]['QueryTypes'][_0x7e21('0x7e')],'raw':!![]})[_0x7e21('0x20')](function(_0x5a4ed7){return _0x5a4ed7;});})[_0x7e21('0x20')](function(_0x2addc4){if(_0x2addc4){_0x27fa39['message'][_0x7e21('0x6b')]=_0x2addc4[0x0];if(!_0x4e01f9[_0x7e21('0x57')]['UserId'])return;return db['User'][_0x7e21('0x55')]({'where':{'id':_0x4e01f9[_0x7e21('0x57')]['UserId'],'role':_0x7e21('0x5e')},'attributes':['id',_0x7e21('0x37'),_0x7e21('0x6c'),_0x7e21('0x6d'),_0x7e21('0x6e')],'raw':!![]});}return null;})['then'](function(_0x223604){if(!_0x223604)return null;_0x27fa39[_0x7e21('0x28')][_0x7e21('0x5e')]=_0x223604;return _0x27fa39;})['then'](function(_0x279f9f){if(_0x279f9f){_0x279f9f[_0x7e21('0x28')][_0x7e21('0x70')]=util['format'](_0x7e21('0x71'),_0x4e01f9[_0x7e21('0x66')]['name']);_0x279f9f[_0x7e21('0x28')]['channel']=_0x27fa39['channel'];_0x279f9f[_0x7e21('0x28')][_0x7e21('0x73')]=_0x27fa39[_0x7e21('0x72')];_0x279f9f[_0x7e21('0x28')][_0x7e21('0x74')]=_0x7e21('0x32');respondWithRpcPromise(_0x7e21('0x76'),_0x7e21('0x76'),{'event':_0x7e21('0x7f'),'message':_['merge'](_0x27fa39[_0x7e21('0x28')],JSON[_0x7e21('0x77')](_0x27fa39[_0x7e21('0x63')][_0x7e21('0x78')]))},client9002);return _0x27fa39;}return null;})[_0x7e21('0x20')](respondWithResult(_0x10a1a4,null))[_0x7e21('0x29')](handleError(_0x10a1a4,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 3d0d259..3aacf3c 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 _0xda9b=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x3b134c,_0x15d0d0){var _0x7def28=function(_0x208b6c){while(--_0x208b6c){_0x3b134c['push'](_0x3b134c['shift']());}};_0x7def28(++_0x15d0d0);}(_0xda9b,0x7e));var _0xbda9=function(_0x38df46,_0x477780){_0x38df46=_0x38df46-0x0;var _0x47dace=_0xda9b[_0x38df46];return _0x47dace;};'use strict';var EventEmitter=require(_0xbda9('0x0'));var ChatMessage=require(_0xbda9('0x1'))['db'][_0xbda9('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xbda9('0x3')](0x0);var events={'afterCreate':_0xbda9('0x4'),'afterUpdate':_0xbda9('0x5'),'afterDestroy':_0xbda9('0x6')};function emitEvent(_0x5a4a28){return function(_0x34d820,_0x518aed,_0xc1e14e){ChatMessageEvents[_0xbda9('0x7')](_0x5a4a28+':'+_0x34d820['id'],_0x34d820);ChatMessageEvents[_0xbda9('0x7')](_0x5a4a28,_0x34d820);_0xc1e14e(null);};}for(var e in events){if(events[_0xbda9('0x8')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xbda9('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0x59c1=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x20658e,_0x404a03){var _0xb901=function(_0x72e736){while(--_0x72e736){_0x20658e['push'](_0x20658e['shift']());}};_0xb901(++_0x404a03);}(_0x59c1,0x90));var _0x159c=function(_0x4f8ca0,_0xe8b643){_0x4f8ca0=_0x4f8ca0-0x0;var _0x4287a4=_0x59c1[_0x4f8ca0];return _0x4287a4;};'use strict';var EventEmitter=require(_0x159c('0x0'));var ChatMessage=require(_0x159c('0x1'))['db'][_0x159c('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x159c('0x3')](0x0);var events={'afterCreate':_0x159c('0x4'),'afterUpdate':_0x159c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4e5954){return function(_0x539e13,_0x120476,_0x56a77a){ChatMessageEvents[_0x159c('0x6')](_0x4e5954+':'+_0x539e13['id'],_0x539e13);ChatMessageEvents[_0x159c('0x6')](_0x4e5954,_0x539e13);_0x56a77a(null);};}for(var e in events){if(events[_0x159c('0x7')](e)){var event=events[e];ChatMessage[_0x159c('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 4261453..2a303e2 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 _0xfc7b=['moment','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','api'];(function(_0x3fbdde,_0x2b5a7a){var _0x10bf7b=function(_0x4ef0aa){while(--_0x4ef0aa){_0x3fbdde['push'](_0x3fbdde['shift']());}};_0x10bf7b(++_0x2b5a7a);}(_0xfc7b,0xc1));var _0xbfc7=function(_0xc4a89a,_0x322f6a){_0xc4a89a=_0xc4a89a-0x0;var _0x13f7bc=_0xfc7b[_0xc4a89a];return _0x13f7bc;};'use strict';var _=require(_0xbfc7('0x0'));var util=require(_0xbfc7('0x1'));var logger=require('../../config/logger')(_0xbfc7('0x2'));var moment=require(_0xbfc7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfc7('0x4'));var rimraf=require('rimraf');var config=require(_0xbfc7('0x5'));var attributes=require(_0xbfc7('0x6'));module[_0xbfc7('0x7')]=function(_0x56b76b,_0x243a2f){return _0x56b76b[_0xbfc7('0x8')](_0xbfc7('0x9'),attributes,{'tableName':_0xbfc7('0xa'),'paranoid':![],'indexes':[{'name':_0xbfc7('0xb'),'fields':[_0xbfc7('0xc')],'type':_0xbfc7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x597b35,_0x15857e,_0x296553){var _0x4afdaf=_0x56b76b['models'];var _0x1dc9a4=_0x597b35[_0xbfc7('0xe')]({'plain':!![]});if(_0x1dc9a4['direction']['toLowerCase']()==='in'||_0x1dc9a4[_0xbfc7('0xf')]['toLowerCase']()===_0xbfc7('0x10')&&!_0x1dc9a4[_0xbfc7('0x11')]&&!_[_0xbfc7('0x12')](_0x1dc9a4[_0xbfc7('0x13')])){_0x4afdaf[_0xbfc7('0x14')]['findOne']({'where':{'id':_0x1dc9a4[_0xbfc7('0x15')]}})[_0xbfc7('0x16')](function(_0x1d566b){if(_0x1d566b){_0x1d566b[_0xbfc7('0x17')]({'lastMsgAt':_0x1dc9a4[_0xbfc7('0x18')],'lastMsgDirection':_0x1dc9a4[_0xbfc7('0xf')]['toLowerCase']()});}})[_0xbfc7('0x19')](function(_0x5b5c62){console[_0xbfc7('0x1a')](_0x5b5c62);});}_0x296553();}},'charset':_0xbfc7('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd521=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xd521,0x184));var _0x1d52=function(_0x4ba97e,_0x194ab6){_0x4ba97e=_0x4ba97e-0x0;var _0x31730d=_0xd521[_0x4ba97e];return _0x31730d;};'use strict';var _=require('lodash');var util=require(_0x1d52('0x0'));var logger=require(_0x1d52('0x1'))(_0x1d52('0x2'));var moment=require(_0x1d52('0x3'));var BPromise=require(_0x1d52('0x4'));var rp=require(_0x1d52('0x5'));var fs=require('fs');var path=require(_0x1d52('0x6'));var rimraf=require(_0x1d52('0x7'));var config=require(_0x1d52('0x8'));var attributes=require(_0x1d52('0x9'));module[_0x1d52('0xa')]=function(_0x34d49f,_0x2b76c4){return _0x34d49f[_0x1d52('0xb')](_0x1d52('0xc'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x1d52('0xd')],'type':_0x1d52('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x20df4e,_0x33a00d,_0x2100d7){var _0x59ecc1=_0x34d49f[_0x1d52('0xf')];var _0x5cf940=_0x20df4e[_0x1d52('0x10')]({'plain':!![]});if(_0x5cf940[_0x1d52('0x11')][_0x1d52('0x12')]()==='in'||_0x5cf940[_0x1d52('0x11')][_0x1d52('0x12')]()==='out'&&!_0x5cf940[_0x1d52('0x13')]&&!_[_0x1d52('0x14')](_0x5cf940[_0x1d52('0x15')])){_0x59ecc1[_0x1d52('0x16')]['findOne']({'where':{'id':_0x5cf940[_0x1d52('0x17')]}})[_0x1d52('0x18')](function(_0x90d74c){if(_0x90d74c){_0x90d74c[_0x1d52('0x19')]({'lastMsgAt':_0x5cf940['createdAt'],'lastMsgDirection':_0x5cf940['direction']['toLowerCase']()});}})[_0x1d52('0x1a')](function(_0x2cf137){console[_0x1d52('0x1b')](_0x2cf137);});}_0x2100d7();}},'charset':_0x1d52('0x1c'),'collate':_0x1d52('0x1d')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index e9b1653..91be68d 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 _0x1d34=['raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','body','options'];(function(_0x4a411b,_0xa4fbb1){var _0x4f415f=function(_0x494204){while(--_0x494204){_0x4a411b['push'](_0x4a411b['shift']());}};_0x4f415f(++_0xa4fbb1);}(_0x1d34,0x1c8));var _0x41d3=function(_0x367f08,_0x37adf2){_0x367f08=_0x367f08-0x0;var _0x2382a4=_0x1d34[_0x367f08];return _0x2382a4;};'use strict';var _=require(_0x41d3('0x0'));var util=require(_0x41d3('0x1'));var moment=require(_0x41d3('0x2'));var BPromise=require(_0x41d3('0x3'));var rs=require(_0x41d3('0x4'));var fs=require('fs');var Redis=require(_0x41d3('0x5'));var db=require(_0x41d3('0x6'))['db'];var utils=require(_0x41d3('0x7'));var logger=require(_0x41d3('0x8'))(_0x41d3('0x9'));var config=require(_0x41d3('0xa'));var jayson=require(_0x41d3('0xb'));var client=jayson[_0x41d3('0xc')][_0x41d3('0xd')]({'port':0x232a});config[_0x41d3('0xe')]=_[_0x41d3('0xf')](config['redis'],{'host':_0x41d3('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0x41d3('0x11')](socket);function respondWithRpcPromise(_0x37d82d,_0x2da160,_0x3dbc88){return new BPromise(function(_0x584117,_0x242788){return client[_0x41d3('0x12')](_0x37d82d,_0x3dbc88)[_0x41d3('0x13')](function(_0x87b09d){logger[_0x41d3('0x14')](_0x41d3('0x15'),_0x2da160,_0x41d3('0x16'));logger[_0x41d3('0x17')](_0x41d3('0x18'),_0x2da160,_0x41d3('0x16'),JSON[_0x41d3('0x19')](_0x87b09d));if(_0x87b09d[_0x41d3('0x1a')]){if(_0x87b09d['error']['code']===0x1f4){logger[_0x41d3('0x1a')](_0x41d3('0x15'),_0x2da160,_0x87b09d[_0x41d3('0x1a')][_0x41d3('0x1b')]);return _0x242788(_0x87b09d['error'][_0x41d3('0x1b')]);}logger[_0x41d3('0x1a')](_0x41d3('0x15'),_0x2da160,_0x87b09d[_0x41d3('0x1a')][_0x41d3('0x1b')]);return _0x584117(_0x87b09d[_0x41d3('0x1a')][_0x41d3('0x1b')]);}else{logger[_0x41d3('0x14')]('ChatMessage,\x20%s,\x20%s',_0x2da160,_0x41d3('0x16'));_0x584117(_0x87b09d[_0x41d3('0x1c')][_0x41d3('0x1b')]);}})[_0x41d3('0x1d')](function(_0x1d3690){logger[_0x41d3('0x1a')]('ChatMessage,\x20%s,\x20%s',_0x2da160,_0x1d3690);_0x242788(_0x1d3690);});});}exports[_0x41d3('0x1e')]=function(_0x4bec68){var _0x34e676=this;return new Promise(function(_0x1ee1c0,_0x1da237){return db[_0x41d3('0x1f')]['create'](_0x4bec68[_0x41d3('0x20')],{'raw':_0x4bec68['options']?_0x4bec68[_0x41d3('0x21')][_0x41d3('0x22')]===undefined?!![]:![]:!![]})[_0x41d3('0x13')](function(_0x51fa58){logger['info'](_0x41d3('0x1e'),_0x4bec68);logger[_0x41d3('0x17')]('CreateChatMessage',_0x4bec68,JSON[_0x41d3('0x19')](_0x51fa58));_0x1ee1c0(_0x51fa58);})['catch'](function(_0x2937d8){logger['error'](_0x41d3('0x1e'),_0x2937d8[_0x41d3('0x1b')],_0x4bec68);_0x1da237(_0x34e676[_0x41d3('0x1a')](0x1f4,_0x2937d8[_0x41d3('0x1b')]));});});}; \ No newline at end of file +var _0xa806=['redis','localhost','socket.io-emitter','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa806,0xf5));var _0x6a80=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0xa806[_0x49c68e];return _0x33032b;};'use strict';var _=require(_0x6a80('0x0'));var util=require(_0x6a80('0x1'));var moment=require(_0x6a80('0x2'));var BPromise=require(_0x6a80('0x3'));var rs=require(_0x6a80('0x4'));var fs=require('fs');var Redis=require(_0x6a80('0x5'));var db=require(_0x6a80('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6a80('0x7'));var config=require(_0x6a80('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6a80('0x9')][_0x6a80('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6a80('0xb')],{'host':_0x6a80('0xc'),'port':0x18eb});var socket=require(_0x6a80('0xd'))(new Redis(config[_0x6a80('0xb')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x181479,_0x3d9cc1,_0x159d29){return new BPromise(function(_0x4455c7,_0x3a3a42){return client[_0x6a80('0xe')](_0x181479,_0x159d29)[_0x6a80('0xf')](function(_0x4b4969){logger[_0x6a80('0x10')](_0x6a80('0x11'),_0x3d9cc1,_0x6a80('0x12'));logger[_0x6a80('0x13')](_0x6a80('0x14'),_0x3d9cc1,_0x6a80('0x12'),JSON[_0x6a80('0x15')](_0x4b4969));if(_0x4b4969[_0x6a80('0x16')]){if(_0x4b4969[_0x6a80('0x16')][_0x6a80('0x17')]===0x1f4){logger[_0x6a80('0x16')](_0x6a80('0x11'),_0x3d9cc1,_0x4b4969[_0x6a80('0x16')]['message']);return _0x3a3a42(_0x4b4969['error'][_0x6a80('0x18')]);}logger[_0x6a80('0x16')](_0x6a80('0x11'),_0x3d9cc1,_0x4b4969[_0x6a80('0x16')][_0x6a80('0x18')]);return _0x4455c7(_0x4b4969[_0x6a80('0x16')]['message']);}else{logger[_0x6a80('0x10')](_0x6a80('0x11'),_0x3d9cc1,'request\x20sent');_0x4455c7(_0x4b4969[_0x6a80('0x19')]['message']);}})[_0x6a80('0x1a')](function(_0x189d56){logger[_0x6a80('0x16')](_0x6a80('0x11'),_0x3d9cc1,_0x189d56);_0x3a3a42(_0x189d56);});});}exports[_0x6a80('0x1b')]=function(_0x4336c7){var _0x1db01f=this;return new Promise(function(_0x507b25,_0x51cc2e){return db['ChatMessage'][_0x6a80('0x1c')](_0x4336c7[_0x6a80('0x1d')],{'raw':_0x4336c7[_0x6a80('0x1e')]?_0x4336c7[_0x6a80('0x1e')][_0x6a80('0x1f')]===undefined?!![]:![]:!![]})[_0x6a80('0xf')](function(_0x3be32a){logger[_0x6a80('0x10')](_0x6a80('0x1b'),_0x4336c7);logger[_0x6a80('0x13')](_0x6a80('0x1b'),_0x4336c7,JSON['stringify'](_0x3be32a));_0x507b25(_0x3be32a);})[_0x6a80('0x1a')](function(_0x2c3fd4){logger[_0x6a80('0x16')]('CreateChatMessage',_0x2c3fd4[_0x6a80('0x18')],_0x4336c7);_0x51cc2e(_0x1db01f[_0x6a80('0x16')](0x1f4,_0x2c3fd4[_0x6a80('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index bb5ad7f..7fec954 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 _0xd9ef=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','update'];(function(_0x25f3bd,_0x508d5a){var _0x2581ff=function(_0x5a1cd9){while(--_0x5a1cd9){_0x25f3bd['push'](_0x25f3bd['shift']());}};_0x2581ff(++_0x508d5a);}(_0xd9ef,0x95));var _0xfd9e=function(_0x394cb0,_0x5c4eee){_0x394cb0=_0x394cb0-0x0;var _0x3f2409=_0xd9ef[_0x394cb0];return _0x3f2409;};'use strict';var ChatMessageEvents=require(_0xfd9e('0x0'));var events=[_0xfd9e('0x1'),'remove',_0xfd9e('0x2')];function createListener(_0x55d1e2,_0x57c743){return function(_0x505f7f){_0x57c743[_0xfd9e('0x3')](_0x55d1e2,_0x505f7f);};}function removeListener(_0x28cfac,_0xe6990b){return function(){ChatMessageEvents[_0xfd9e('0x4')](_0x28cfac,_0xe6990b);};}exports[_0xfd9e('0x5')]=function(_0x178ceb){for(var _0x2d549f=0x0,_0x3c3dec=events[_0xfd9e('0x6')];_0x2d549f<_0x3c3dec;_0x2d549f++){var _0x302795=events[_0x2d549f];var _0xb61585=createListener(_0xfd9e('0x7')+_0x302795,_0x178ceb);ChatMessageEvents['on'](_0x302795,_0xb61585);}}; \ No newline at end of file +var _0x7d55=['emit','removeListener','register','length','./chatMessage.events','save','remove','update'];(function(_0x41ba41,_0x145412){var _0x22d385=function(_0x571d2a){while(--_0x571d2a){_0x41ba41['push'](_0x41ba41['shift']());}};_0x22d385(++_0x145412);}(_0x7d55,0x1bc));var _0x57d5=function(_0x3369f6,_0x4ad4f2){_0x3369f6=_0x3369f6-0x0;var _0x5f521a=_0x7d55[_0x3369f6];return _0x5f521a;};'use strict';var ChatMessageEvents=require(_0x57d5('0x0'));var events=[_0x57d5('0x1'),_0x57d5('0x2'),_0x57d5('0x3')];function createListener(_0x517d62,_0x541e22){return function(_0x3ce441){_0x541e22[_0x57d5('0x4')](_0x517d62,_0x3ce441);};}function removeListener(_0x2b6dc5,_0x48b5aa){return function(){ChatMessageEvents[_0x57d5('0x5')](_0x2b6dc5,_0x48b5aa);};}exports[_0x57d5('0x6')]=function(_0x15c349){for(var _0x30fcfe=0x0,_0x4393ed=events[_0x57d5('0x7')];_0x30fcfe<_0x4393ed;_0x30fcfe++){var _0x599ec5=events[_0x30fcfe];var _0x50bc50=createListener('chatMessage:'+_0x599ec5,_0x15c349);ChatMessageEvents['on'](_0x599ec5,_0x50bc50);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 8bccb76..556668a 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 _0xf4ae=['/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chatmessage:create','put','update','/:id/accept'];(function(_0x2cc86e,_0x5e9be8){var _0x3c43e1=function(_0x522ecc){while(--_0x522ecc){_0x2cc86e['push'](_0x2cc86e['shift']());}};_0x3c43e1(++_0x5e9be8);}(_0xf4ae,0x75));var _0xef4a=function(_0x263f76,_0x2ee49f){_0x263f76=_0x263f76-0x0;var _0x4112de=_0xf4ae[_0x263f76];return _0x4112de;};'use strict';var multer=require(_0xef4a('0x0'));var util=require(_0xef4a('0x1'));var path=require(_0xef4a('0x2'));var timeout=require(_0xef4a('0x3'));var express=require(_0xef4a('0x4'));var router=express[_0xef4a('0x5')]();var fs_extra=require(_0xef4a('0x6'));var auth=require(_0xef4a('0x7'));var interaction=require(_0xef4a('0x8'));var config=require('../../config/environment');var controller=require(_0xef4a('0x9'));router[_0xef4a('0xa')]('/',auth[_0xef4a('0xb')](),controller[_0xef4a('0xc')]);router[_0xef4a('0xa')](_0xef4a('0xd'),auth['isAuthenticated'](),controller[_0xef4a('0xe')]);router[_0xef4a('0xa')](_0xef4a('0xf'),auth[_0xef4a('0xb')](),controller[_0xef4a('0x10')]);router[_0xef4a('0x11')]('/',auth[_0xef4a('0xb')](),interaction[_0xef4a('0x12')]('chat',_0xef4a('0x13')),controller['create']);router[_0xef4a('0x14')](_0xef4a('0xf'),controller[_0xef4a('0x15')]);router[_0xef4a('0x14')](_0xef4a('0x16'),auth['isAuthenticated'](),controller['accept']);router[_0xef4a('0x14')](_0xef4a('0x17'),auth[_0xef4a('0xb')](),controller[_0xef4a('0x18')]);router[_0xef4a('0x19')](_0xef4a('0xf'),auth[_0xef4a('0xb')](),controller[_0xef4a('0x1a')]);module[_0xef4a('0x1b')]=router; \ No newline at end of file +var _0x2f96=['chatmessage:create','create','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','describe','/:id','post','tracked','chat'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x2f96,0x1be));var _0x62f9=function(_0x215cd8,_0x186835){_0x215cd8=_0x215cd8-0x0;var _0x52685b=_0x2f96[_0x215cd8];return _0x52685b;};'use strict';var multer=require(_0x62f9('0x0'));var util=require(_0x62f9('0x1'));var path=require(_0x62f9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x62f9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x62f9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x62f9('0x5'));var controller=require(_0x62f9('0x6'));router[_0x62f9('0x7')]('/',auth[_0x62f9('0x8')](),controller['index']);router[_0x62f9('0x7')]('/describe',auth[_0x62f9('0x8')](),controller[_0x62f9('0x9')]);router[_0x62f9('0x7')](_0x62f9('0xa'),auth[_0x62f9('0x8')](),controller['show']);router[_0x62f9('0xb')]('/',auth[_0x62f9('0x8')](),interaction[_0x62f9('0xc')](_0x62f9('0xd'),_0x62f9('0xe')),controller[_0x62f9('0xf')]);router[_0x62f9('0x10')](_0x62f9('0xa'),controller['update']);router[_0x62f9('0x10')](_0x62f9('0x11'),auth[_0x62f9('0x8')](),controller['accept']);router[_0x62f9('0x10')](_0x62f9('0x12'),auth[_0x62f9('0x8')](),controller[_0x62f9('0x13')]);router[_0x62f9('0x14')]('/:id',auth[_0x62f9('0x8')](),controller[_0x62f9('0x15')]);module[_0x62f9('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 a63853a..ccde130 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 _0x5f66=['medium','TEXT','exports'];(function(_0x484cf3,_0x511df2){var _0x38173e=function(_0x5db4af){while(--_0x5db4af){_0x484cf3['push'](_0x484cf3['shift']());}};_0x38173e(++_0x511df2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x5f66=['medium','TEXT','exports'];(function(_0x1944f2,_0x212cd8){var _0x5934b7=function(_0x2e7aba){while(--_0x2e7aba){_0x1944f2['push'](_0x1944f2['shift']());}};_0x5934b7(++_0x212cd8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 4fc70fa..4e19971 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x7a54,0x106));var _0x47a5=function(_0x35187b,_0x5e1982){_0x35187b=_0x35187b-0x0;var _0x5be486=_0x7a54[_0x35187b];return _0x5be486;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x525868,_0x4c72b5){var _0x3cc38a=function(_0x469743){while(--_0x469743){_0x525868['push'](_0x525868['shift']());}};_0x3cc38a(++_0x4c72b5);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){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 bf151f2..bf8d2ee 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 _0x15a0=['hook','events','ChatOfflineMessage','setMaxListeners','save','remove','emit'];(function(_0x54c71e,_0x5a2938){var _0x572e6d=function(_0x260b79){while(--_0x260b79){_0x54c71e['push'](_0x54c71e['shift']());}};_0x572e6d(++_0x5a2938);}(_0x15a0,0x8d));var _0x015a=function(_0x2f8530,_0x5cbd67){_0x2f8530=_0x2f8530-0x0;var _0x5e814e=_0x15a0[_0x2f8530];return _0x5e814e;};'use strict';var EventEmitter=require(_0x015a('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x015a('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x015a('0x2')](0x0);var events={'afterCreate':_0x015a('0x3'),'afterUpdate':'update','afterDestroy':_0x015a('0x4')};function emitEvent(_0x6bec6f){return function(_0x47e028,_0x346473,_0x24b1ba){ChatOfflineMessageEvents[_0x015a('0x5')](_0x6bec6f+':'+_0x47e028['id'],_0x47e028);ChatOfflineMessageEvents[_0x015a('0x5')](_0x6bec6f,_0x47e028);_0x24b1ba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x015a('0x6')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0xcec8=['remove','emit','hasOwnProperty','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xcec8,0x10c));var _0x8cec=function(_0xd9f102,_0x5a0d28){_0xd9f102=_0xd9f102-0x0;var _0x2652e4=_0xcec8[_0xd9f102];return _0x2652e4;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x8cec('0x0'))['db'][_0x8cec('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x8cec('0x2')](0x0);var events={'afterCreate':_0x8cec('0x3'),'afterUpdate':'update','afterDestroy':_0x8cec('0x4')};function emitEvent(_0x5cce98){return function(_0x3063a5,_0x18dcea,_0x28abdd){ChatOfflineMessageEvents['emit'](_0x5cce98+':'+_0x3063a5['id'],_0x3063a5);ChatOfflineMessageEvents[_0x8cec('0x5')](_0x5cce98,_0x3063a5);_0x28abdd(null);};}for(var e in events){if(events[_0x8cec('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x8cec('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 51c3a62..8804e66 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 _0x29bf=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x5ea797,_0x2d39dd){var _0x500783=function(_0x4923f2){while(--_0x4923f2){_0x5ea797['push'](_0x5ea797['shift']());}};_0x500783(++_0x2d39dd);}(_0x29bf,0x6e));var _0xf29b=function(_0x4dc3d0,_0xf6dbe1){_0x4dc3d0=_0x4dc3d0-0x0;var _0x2c7cd8=_0x29bf[_0x4dc3d0];return _0x2c7cd8;};'use strict';var attributes=require(_0xf29b('0x0'));module[_0xf29b('0x1')]=function(_0xa310de){return _0xa310de[_0xf29b('0x2')](_0xf29b('0x3'),attributes,{'tableName':_0xf29b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf29b('0x5'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1244=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x1244,0x169));var _0x4124=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x1244[_0x543084];return _0x306a57;};'use strict';var attributes=require(_0x4124('0x0'));module[_0x4124('0x1')]=function(_0x32ed3d){return _0x32ed3d[_0x4124('0x2')](_0x4124('0x3'),attributes,{'tableName':_0x4124('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4124('0x5'),'collate':_0x4124('0x6')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 2444b5e..a934b37 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 _0x01ad=['then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3791a3,_0x237ad1){var _0x5e5d6f=function(_0x171b91){while(--_0x171b91){_0x3791a3['push'](_0x3791a3['shift']());}};_0x5e5d6f(++_0x237ad1);}(_0x01ad,0xd2));var _0xd01a=function(_0x23c2b7,_0x57b41a){_0x23c2b7=_0x23c2b7-0x0;var _0x4c7225=_0x01ad[_0x23c2b7];return _0x4c7225;};'use strict';var _=require(_0xd01a('0x0'));var util=require('util');var moment=require(_0xd01a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd01a('0x2'));var db=require(_0xd01a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd01a('0x4'))(_0xd01a('0x5'));var config=require(_0xd01a('0x6'));var jayson=require(_0xd01a('0x7'));var client=jayson['client'][_0xd01a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26f150,_0x1df345,_0x5be6a1){return new BPromise(function(_0x24895f,_0x4f1b67){return client[_0xd01a('0x9')](_0x26f150,_0x5be6a1)[_0xd01a('0xa')](function(_0x3087d7){logger[_0xd01a('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1df345,_0xd01a('0xc'));logger[_0xd01a('0xd')](_0xd01a('0xe'),_0x1df345,_0xd01a('0xc'),JSON[_0xd01a('0xf')](_0x3087d7));if(_0x3087d7[_0xd01a('0x10')]){if(_0x3087d7[_0xd01a('0x10')]['code']===0x1f4){logger[_0xd01a('0x10')](_0xd01a('0x11'),_0x1df345,_0x3087d7['error'][_0xd01a('0x12')]);return _0x4f1b67(_0x3087d7[_0xd01a('0x10')][_0xd01a('0x12')]);}logger[_0xd01a('0x10')](_0xd01a('0x11'),_0x1df345,_0x3087d7[_0xd01a('0x10')][_0xd01a('0x12')]);return _0x24895f(_0x3087d7[_0xd01a('0x10')][_0xd01a('0x12')]);}else{logger[_0xd01a('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1df345,'request\x20sent');_0x24895f(_0x3087d7['result'][_0xd01a('0x12')]);}})[_0xd01a('0x13')](function(_0x1bf3a7){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x1df345,_0x1bf3a7);_0x4f1b67(_0x1bf3a7);});});} \ No newline at end of file +var _0x7cf6=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x25f01d,_0x463b20){var _0x55f403=function(_0x388972){while(--_0x388972){_0x25f01d['push'](_0x25f01d['shift']());}};_0x55f403(++_0x463b20);}(_0x7cf6,0x143));var _0x67cf=function(_0x1b7529,_0x2daff6){_0x1b7529=_0x1b7529-0x0;var _0x542bfb=_0x7cf6[_0x1b7529];return _0x542bfb;};'use strict';var _=require('lodash');var util=require(_0x67cf('0x0'));var moment=require(_0x67cf('0x1'));var BPromise=require(_0x67cf('0x2'));var rs=require(_0x67cf('0x3'));var fs=require('fs');var Redis=require(_0x67cf('0x4'));var db=require(_0x67cf('0x5'))['db'];var utils=require(_0x67cf('0x6'));var logger=require(_0x67cf('0x7'))(_0x67cf('0x8'));var config=require(_0x67cf('0x9'));var jayson=require(_0x67cf('0xa'));var client=jayson[_0x67cf('0xb')][_0x67cf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e0d72,_0x15ffd0,_0x4c5006){return new BPromise(function(_0x26900a,_0xb46df4){return client[_0x67cf('0xd')](_0x1e0d72,_0x4c5006)[_0x67cf('0xe')](function(_0x29c6b5){logger['info'](_0x67cf('0xf'),_0x15ffd0,_0x67cf('0x10'));logger[_0x67cf('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x15ffd0,_0x67cf('0x10'),JSON[_0x67cf('0x12')](_0x29c6b5));if(_0x29c6b5[_0x67cf('0x13')]){if(_0x29c6b5[_0x67cf('0x13')]['code']===0x1f4){logger[_0x67cf('0x13')](_0x67cf('0xf'),_0x15ffd0,_0x29c6b5['error']['message']);return _0xb46df4(_0x29c6b5[_0x67cf('0x13')][_0x67cf('0x14')]);}logger[_0x67cf('0x13')](_0x67cf('0xf'),_0x15ffd0,_0x29c6b5[_0x67cf('0x13')][_0x67cf('0x14')]);return _0x26900a(_0x29c6b5[_0x67cf('0x13')][_0x67cf('0x14')]);}else{logger['info'](_0x67cf('0xf'),_0x15ffd0,_0x67cf('0x10'));_0x26900a(_0x29c6b5['result'][_0x67cf('0x14')]);}})[_0x67cf('0x15')](function(_0x1d90ad){logger[_0x67cf('0x13')](_0x67cf('0xf'),_0x15ffd0,_0x1d90ad);_0xb46df4(_0x1d90ad);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 5f9b234..25e2832 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 _0x5785=['get','isAuthenticated','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5785,0xd2));var _0x5578=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x5785[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0x5578('0x0'));var util=require(_0x5578('0x1'));var path=require(_0x5578('0x2'));var timeout=require(_0x5578('0x3'));var express=require(_0x5578('0x4'));var router=express[_0x5578('0x5')]();var fs_extra=require(_0x5578('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5578('0x7'));var config=require(_0x5578('0x8'));var controller=require(_0x5578('0x9'));router[_0x5578('0xa')]('/',auth[_0x5578('0xb')](),controller['index']);router[_0x5578('0xa')](_0x5578('0xc'),auth['isAuthenticated'](),controller[_0x5578('0xd')]);router[_0x5578('0xa')]('/:id',auth[_0x5578('0xb')](),controller[_0x5578('0xe')]);router[_0x5578('0xf')]('/',auth[_0x5578('0xb')](),controller['create']);router[_0x5578('0x10')](_0x5578('0x11'),auth[_0x5578('0xb')](),controller[_0x5578('0x12')]);router[_0x5578('0x13')](_0x5578('0x11'),auth[_0x5578('0xb')](),controller[_0x5578('0x14')]);module[_0x5578('0x15')]=router; \ No newline at end of file +var _0x51a2=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x575283,_0x3f1c36){var _0x7ce7df=function(_0x4133c5){while(--_0x4133c5){_0x575283['push'](_0x575283['shift']());}};_0x7ce7df(++_0x3f1c36);}(_0x51a2,0x11c));var _0x251a=function(_0x13179f,_0x21f5dd){_0x13179f=_0x13179f-0x0;var _0x51b9e3=_0x51a2[_0x13179f];return _0x51b9e3;};'use strict';var multer=require(_0x251a('0x0'));var util=require(_0x251a('0x1'));var path=require(_0x251a('0x2'));var timeout=require(_0x251a('0x3'));var express=require('express');var router=express[_0x251a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x251a('0x5'));var config=require(_0x251a('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x251a('0x7')]('/',auth[_0x251a('0x8')](),controller[_0x251a('0x9')]);router[_0x251a('0x7')](_0x251a('0xa'),auth[_0x251a('0x8')](),controller[_0x251a('0xb')]);router[_0x251a('0x7')](_0x251a('0xc'),auth['isAuthenticated'](),controller[_0x251a('0xd')]);router[_0x251a('0xe')]('/',auth['isAuthenticated'](),controller[_0x251a('0xf')]);router[_0x251a('0x10')](_0x251a('0xc'),auth['isAuthenticated'](),controller[_0x251a('0x11')]);router[_0x251a('0x12')](_0x251a('0xc'),auth[_0x251a('0x8')](),controller[_0x251a('0x13')]);module[_0x251a('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 0d63aef..7199107 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 _0x6c71=['ENUM','mouseOver','exports','STRING'];(function(_0x5c090b,_0x2d5e53){var _0x13e6b6=function(_0xcf49f9){while(--_0xcf49f9){_0x5c090b['push'](_0x5c090b['shift']());}};_0x13e6b6(++_0x2d5e53);}(_0x6c71,0x8e));var _0x16c7=function(_0x3a4c3d,_0x2cca41){_0x3a4c3d=_0x3a4c3d-0x0;var _0x3d7710=_0x6c71[_0x3a4c3d];return _0x3d7710;};'use strict';var Sequelize=require('sequelize');module[_0x16c7('0x0')]={'name':{'type':Sequelize[_0x16c7('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x16c7('0x2')](_0x16c7('0x3'),'timeout'),'defaultValue':_0x16c7('0x3')},'selector':{'type':Sequelize[_0x16c7('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x0930=['sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x5e06c2,_0x56b454){var _0x379fe9=function(_0x3db971){while(--_0x3db971){_0x5e06c2['push'](_0x5e06c2['shift']());}};_0x379fe9(++_0x56b454);}(_0x0930,0x19e));var _0x0093=function(_0x5caf77,_0x44bd89){_0x5caf77=_0x5caf77-0x0;var _0xa4056d=_0x0930[_0x5caf77];return _0xa4056d;};'use strict';var Sequelize=require(_0x0093('0x0'));module[_0x0093('0x1')]={'name':{'type':Sequelize[_0x0093('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0093('0x3')](_0x0093('0x4'),_0x0093('0x5')),'defaultValue':_0x0093('0x4')},'selector':{'type':Sequelize[_0x0093('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 1721498..2293256 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 _0xdbf7=['params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','options','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','show'];(function(_0xac0a6f,_0x55ae26){var _0x4a1e61=function(_0x46a679){while(--_0x46a679){_0xac0a6f['push'](_0xac0a6f['shift']());}};_0x4a1e61(++_0x55ae26);}(_0xdbf7,0x8d));var _0x7dbf=function(_0xe36578,_0x167e63){_0xe36578=_0xe36578-0x0;var _0x55b8ad=_0xdbf7[_0xe36578];return _0x55b8ad;};'use strict';var emlformat=require(_0x7dbf('0x0'));var rimraf=require(_0x7dbf('0x1'));var zipdir=require(_0x7dbf('0x2'));var jsonpatch=require(_0x7dbf('0x3'));var rp=require(_0x7dbf('0x4'));var moment=require(_0x7dbf('0x5'));var BPromise=require(_0x7dbf('0x6'));var Mustache=require(_0x7dbf('0x7'));var util=require('util');var path=require(_0x7dbf('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x7dbf('0xa'));var _=require(_0x7dbf('0xb'));var squel=require(_0x7dbf('0xc'));var crypto=require(_0x7dbf('0xd'));var jsforce=require(_0x7dbf('0xe'));var deskjs=require(_0x7dbf('0xf'));var toCsv=require(_0x7dbf('0x10'));var querystring=require(_0x7dbf('0x11'));var Papa=require(_0x7dbf('0x12'));var Redis=require(_0x7dbf('0x13'));var authService=require(_0x7dbf('0x14'));var qs=require(_0x7dbf('0x15'));var as=require(_0x7dbf('0x16'));var hardwareService=require(_0x7dbf('0x17'));var logger=require('../../config/logger')(_0x7dbf('0x18'));var utils=require(_0x7dbf('0x19'));var config=require(_0x7dbf('0x1a'));var licenseUtil=require(_0x7dbf('0x1b'));var db=require(_0x7dbf('0x1c'))['db'];function respondWithStatusCode(_0x2254d7,_0x50bddb){_0x50bddb=_0x50bddb||0xcc;return function(_0x54bb0a){if(_0x54bb0a){return _0x2254d7['sendStatus'](_0x50bddb);}return _0x2254d7['status'](_0x50bddb)['end']();};}function respondWithResult(_0x524ed4,_0x201d38){_0x201d38=_0x201d38||0xc8;return function(_0x35686a){if(_0x35686a){return _0x524ed4[_0x7dbf('0x1d')](_0x201d38)['json'](_0x35686a);}};}function respondWithFilteredResult(_0x3dd291,_0x4492c8){return function(_0x38be73){if(_0x38be73){var _0x4a3cd3=typeof _0x4492c8[_0x7dbf('0x1e')]===_0x7dbf('0x1f')&&typeof _0x4492c8[_0x7dbf('0x20')]===_0x7dbf('0x1f');var _0x1d6b88=_0x38be73[_0x7dbf('0x21')];var _0xc47749=_0x4a3cd3?0x0:_0x4492c8['offset'];var _0x3abe64=_0x4a3cd3?_0x38be73['count']:_0x4492c8[_0x7dbf('0x1e')]+_0x4492c8['limit'];var _0x3dfcb8;if(_0x3abe64>=_0x1d6b88){_0x3abe64=_0x1d6b88;_0x3dfcb8=0xc8;}else{_0x3dfcb8=0xce;}_0x3dd291[_0x7dbf('0x1d')](_0x3dfcb8);return _0x3dd291[_0x7dbf('0x22')](_0x7dbf('0x23'),_0xc47749+'-'+_0x3abe64+'/'+_0x1d6b88)['json'](_0x38be73);}return null;};}function patchUpdates(_0xe2b82){return function(_0x104025){try{jsonpatch[_0x7dbf('0x24')](_0x104025,_0xe2b82,!![]);}catch(_0x56d108){return BPromise[_0x7dbf('0x25')](_0x56d108);}return _0x104025[_0x7dbf('0x26')]();};}function saveUpdates(_0x8b988d,_0xd2460c){return function(_0x4638b8){if(_0x4638b8){return _0x4638b8['update'](_0x8b988d)[_0x7dbf('0x27')](function(_0x26a5e2){return _0x26a5e2;});}return null;};}function removeEntity(_0x29f89f,_0x502014){return function(_0x48d753){if(_0x48d753){return _0x48d753[_0x7dbf('0x28')]()[_0x7dbf('0x27')](function(){_0x29f89f[_0x7dbf('0x1d')](0xcc)[_0x7dbf('0x29')]();});}};}function handleEntityNotFound(_0x205a70,_0x2360a3){return function(_0x35d4d2){if(!_0x35d4d2){_0x205a70['sendStatus'](0x194);}return _0x35d4d2;};}function handleError(_0x5a68fb,_0xba1115){_0xba1115=_0xba1115||0x1f4;return function(_0x2403d7){logger['error'](_0x2403d7[_0x7dbf('0x2a')]);if(_0x2403d7[_0x7dbf('0x2b')]){delete _0x2403d7[_0x7dbf('0x2b')];}_0x5a68fb[_0x7dbf('0x1d')](_0xba1115)['send'](_0x2403d7);};}exports[_0x7dbf('0x2c')]=function(_0x5dcdf4,_0x36d433){var _0x55c1f6={'raw':!![],'where':{'id':_0x5dcdf4[_0x7dbf('0x2d')]['id']}},_0x3c0515={};_0x3c0515[_0x7dbf('0x2e')]=_[_0x7dbf('0x2f')](db[_0x7dbf('0x30')][_0x7dbf('0x31')]);_0x3c0515[_0x7dbf('0x32')]=_[_0x7dbf('0x2f')](_0x5dcdf4[_0x7dbf('0x32')]);_0x3c0515[_0x7dbf('0x33')]=_[_0x7dbf('0x34')](_0x3c0515[_0x7dbf('0x2e')],_0x3c0515[_0x7dbf('0x32')]);_0x55c1f6[_0x7dbf('0x35')]=_[_0x7dbf('0x34')](_0x3c0515['model'],qs[_0x7dbf('0x36')](_0x5dcdf4[_0x7dbf('0x32')][_0x7dbf('0x36')]));_0x55c1f6[_0x7dbf('0x35')]=_0x55c1f6[_0x7dbf('0x35')]['length']?_0x55c1f6[_0x7dbf('0x35')]:_0x3c0515[_0x7dbf('0x2e')];if(_0x5dcdf4[_0x7dbf('0x32')][_0x7dbf('0x37')]){_0x55c1f6[_0x7dbf('0x38')]=[{'all':!![]}];}_0x55c1f6=_['merge']({},_0x55c1f6,_0x5dcdf4[_0x7dbf('0x39')]);return db[_0x7dbf('0x30')]['find'](_0x55c1f6)[_0x7dbf('0x27')](handleEntityNotFound(_0x36d433,null))['then'](respondWithResult(_0x36d433,null))[_0x7dbf('0x3a')](handleError(_0x36d433,null));};exports[_0x7dbf('0x3b')]=function(_0x431c00,_0x4ab0eb){return db[_0x7dbf('0x30')][_0x7dbf('0x3b')](_0x431c00['body'],{})[_0x7dbf('0x27')](respondWithResult(_0x4ab0eb,0xc9))[_0x7dbf('0x3a')](handleError(_0x4ab0eb,null));};exports['update']=function(_0x1a1362,_0x4fda6f){if(_0x1a1362[_0x7dbf('0x3c')]['id']){delete _0x1a1362['body']['id'];}return db[_0x7dbf('0x30')][_0x7dbf('0x3d')]({'where':{'id':_0x1a1362[_0x7dbf('0x2d')]['id']}})[_0x7dbf('0x27')](handleEntityNotFound(_0x4fda6f,null))[_0x7dbf('0x27')](saveUpdates(_0x1a1362[_0x7dbf('0x3c')],null))['then'](respondWithResult(_0x4fda6f,null))['catch'](handleError(_0x4fda6f,null));};exports[_0x7dbf('0x28')]=function(_0x1d2d5d,_0x5dda39){return db[_0x7dbf('0x30')][_0x7dbf('0x3d')]({'where':{'id':_0x1d2d5d[_0x7dbf('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5dda39,null))[_0x7dbf('0x27')](removeEntity(_0x5dda39,null))[_0x7dbf('0x3a')](handleError(_0x5dda39,null));}; \ No newline at end of file +var _0xed08=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','then','destroy','error','name','send','show','params','rawAttributes','query','intersection','model','fields','attributes','length','include','options','ChatProactiveAction','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x231448,_0x998fea){var _0x45a17c=function(_0x381e9f){while(--_0x381e9f){_0x231448['push'](_0x231448['shift']());}};_0x45a17c(++_0x998fea);}(_0xed08,0x67));var _0x8ed0=function(_0x1cbf5b,_0x4aa7ad){_0x1cbf5b=_0x1cbf5b-0x0;var _0x5a93c6=_0xed08[_0x1cbf5b];return _0x5a93c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ed0('0x0'));var zipdir=require(_0x8ed0('0x1'));var jsonpatch=require(_0x8ed0('0x2'));var rp=require(_0x8ed0('0x3'));var moment=require(_0x8ed0('0x4'));var BPromise=require(_0x8ed0('0x5'));var Mustache=require(_0x8ed0('0x6'));var util=require(_0x8ed0('0x7'));var path=require(_0x8ed0('0x8'));var sox=require(_0x8ed0('0x9'));var csv=require(_0x8ed0('0xa'));var ejs=require(_0x8ed0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ed0('0xc'));var squel=require(_0x8ed0('0xd'));var crypto=require(_0x8ed0('0xe'));var jsforce=require(_0x8ed0('0xf'));var deskjs=require(_0x8ed0('0x10'));var toCsv=require(_0x8ed0('0xa'));var querystring=require(_0x8ed0('0x11'));var Papa=require('papaparse');var Redis=require(_0x8ed0('0x12'));var authService=require(_0x8ed0('0x13'));var qs=require(_0x8ed0('0x14'));var as=require(_0x8ed0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ed0('0x16'))(_0x8ed0('0x17'));var utils=require(_0x8ed0('0x18'));var config=require(_0x8ed0('0x19'));var licenseUtil=require(_0x8ed0('0x1a'));var db=require(_0x8ed0('0x1b'))['db'];function respondWithStatusCode(_0x1b2161,_0x431018){_0x431018=_0x431018||0xcc;return function(_0x3ed67b){if(_0x3ed67b){return _0x1b2161[_0x8ed0('0x1c')](_0x431018);}return _0x1b2161['status'](_0x431018)[_0x8ed0('0x1d')]();};}function respondWithResult(_0x14d46a,_0x5e4ea7){_0x5e4ea7=_0x5e4ea7||0xc8;return function(_0x1e729a){if(_0x1e729a){return _0x14d46a[_0x8ed0('0x1e')](_0x5e4ea7)['json'](_0x1e729a);}};}function respondWithFilteredResult(_0x469354,_0x21f4fd){return function(_0x5eda69){if(_0x5eda69){var _0x72bf7a=typeof _0x21f4fd[_0x8ed0('0x1f')]==='undefined'&&typeof _0x21f4fd[_0x8ed0('0x20')]===_0x8ed0('0x21');var _0xb255c=_0x5eda69['count'];var _0x55a134=_0x72bf7a?0x0:_0x21f4fd['offset'];var _0x12fb2c=_0x72bf7a?_0x5eda69[_0x8ed0('0x22')]:_0x21f4fd[_0x8ed0('0x1f')]+_0x21f4fd[_0x8ed0('0x20')];var _0x3548a2;if(_0x12fb2c>=_0xb255c){_0x12fb2c=_0xb255c;_0x3548a2=0xc8;}else{_0x3548a2=0xce;}_0x469354[_0x8ed0('0x1e')](_0x3548a2);return _0x469354[_0x8ed0('0x23')](_0x8ed0('0x24'),_0x55a134+'-'+_0x12fb2c+'/'+_0xb255c)[_0x8ed0('0x25')](_0x5eda69);}return null;};}function patchUpdates(_0x5b8dcb){return function(_0x55726a){try{jsonpatch[_0x8ed0('0x26')](_0x55726a,_0x5b8dcb,!![]);}catch(_0x23e6c2){return BPromise['reject'](_0x23e6c2);}return _0x55726a[_0x8ed0('0x27')]();};}function saveUpdates(_0x28351a,_0x322e90){return function(_0xcba4d4){if(_0xcba4d4){return _0xcba4d4['update'](_0x28351a)[_0x8ed0('0x28')](function(_0x397b51){return _0x397b51;});}return null;};}function removeEntity(_0x5f19e9,_0x1bf9ef){return function(_0xf6208a){if(_0xf6208a){return _0xf6208a[_0x8ed0('0x29')]()[_0x8ed0('0x28')](function(){_0x5f19e9[_0x8ed0('0x1e')](0xcc)[_0x8ed0('0x1d')]();});}};}function handleEntityNotFound(_0x551c91,_0x5165c3){return function(_0x2a35b1){if(!_0x2a35b1){_0x551c91[_0x8ed0('0x1c')](0x194);}return _0x2a35b1;};}function handleError(_0x3a17d4,_0x158364){_0x158364=_0x158364||0x1f4;return function(_0x108f04){logger[_0x8ed0('0x2a')](_0x108f04['stack']);if(_0x108f04[_0x8ed0('0x2b')]){delete _0x108f04[_0x8ed0('0x2b')];}_0x3a17d4['status'](_0x158364)[_0x8ed0('0x2c')](_0x108f04);};}exports[_0x8ed0('0x2d')]=function(_0x29c986,_0x25617c){var _0x15eec2={'raw':!![],'where':{'id':_0x29c986[_0x8ed0('0x2e')]['id']}},_0xec3bd2={};_0xec3bd2['model']=_['keys'](db['ChatProactiveAction'][_0x8ed0('0x2f')]);_0xec3bd2[_0x8ed0('0x30')]=_['keys'](_0x29c986[_0x8ed0('0x30')]);_0xec3bd2['filters']=_[_0x8ed0('0x31')](_0xec3bd2[_0x8ed0('0x32')],_0xec3bd2['query']);_0x15eec2['attributes']=_[_0x8ed0('0x31')](_0xec3bd2[_0x8ed0('0x32')],qs[_0x8ed0('0x33')](_0x29c986['query'][_0x8ed0('0x33')]));_0x15eec2['attributes']=_0x15eec2[_0x8ed0('0x34')][_0x8ed0('0x35')]?_0x15eec2[_0x8ed0('0x34')]:_0xec3bd2[_0x8ed0('0x32')];if(_0x29c986[_0x8ed0('0x30')]['includeAll']){_0x15eec2[_0x8ed0('0x36')]=[{'all':!![]}];}_0x15eec2=_['merge']({},_0x15eec2,_0x29c986[_0x8ed0('0x37')]);return db[_0x8ed0('0x38')][_0x8ed0('0x39')](_0x15eec2)[_0x8ed0('0x28')](handleEntityNotFound(_0x25617c,null))[_0x8ed0('0x28')](respondWithResult(_0x25617c,null))[_0x8ed0('0x3a')](handleError(_0x25617c,null));};exports[_0x8ed0('0x3b')]=function(_0x44f82e,_0x3714f6){return db[_0x8ed0('0x38')][_0x8ed0('0x3b')](_0x44f82e[_0x8ed0('0x3c')],{})[_0x8ed0('0x28')](respondWithResult(_0x3714f6,0xc9))['catch'](handleError(_0x3714f6,null));};exports[_0x8ed0('0x3d')]=function(_0x58b2b6,_0x3aacf9){if(_0x58b2b6['body']['id']){delete _0x58b2b6[_0x8ed0('0x3c')]['id'];}return db[_0x8ed0('0x38')][_0x8ed0('0x39')]({'where':{'id':_0x58b2b6['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x3aacf9,null))[_0x8ed0('0x28')](saveUpdates(_0x58b2b6[_0x8ed0('0x3c')],null))['then'](respondWithResult(_0x3aacf9,null))['catch'](handleError(_0x3aacf9,null));};exports[_0x8ed0('0x29')]=function(_0x2c155a,_0x7e32b0){return db[_0x8ed0('0x38')]['find']({'where':{'id':_0x2c155a[_0x8ed0('0x2e')]['id']}})['then'](handleEntityNotFound(_0x7e32b0,null))[_0x8ed0('0x28')](removeEntity(_0x7e32b0,null))[_0x8ed0('0x3a')](handleError(_0x7e32b0,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 1aebc03..2ebeb1c 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 _0x8498=['moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','api'];(function(_0x53b659,_0x445f5f){var _0x57e1fd=function(_0x170be3){while(--_0x170be3){_0x53b659['push'](_0x53b659['shift']());}};_0x57e1fd(++_0x445f5f);}(_0x8498,0x9a));var _0x8849=function(_0x353736,_0x2a1699){_0x353736=_0x353736-0x0;var _0x3764eb=_0x8498[_0x353736];return _0x3764eb;};'use strict';var _=require(_0x8849('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8849('0x1'));var moment=require(_0x8849('0x2'));var BPromise=require('bluebird');var rp=require(_0x8849('0x3'));var fs=require('fs');var path=require(_0x8849('0x4'));var rimraf=require(_0x8849('0x5'));var config=require(_0x8849('0x6'));var attributes=require(_0x8849('0x7'));module[_0x8849('0x8')]=function(_0x1accc0,_0x16a447){return _0x1accc0[_0x8849('0x9')](_0x8849('0xa'),attributes,{'tableName':_0x8849('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd66c=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','api','moment','bluebird','request-promise','path'];(function(_0x52ca43,_0x311547){var _0xeb374=function(_0x464854){while(--_0x464854){_0x52ca43['push'](_0x52ca43['shift']());}};_0xeb374(++_0x311547);}(_0xd66c,0x12e));var _0xcd66=function(_0x53001c,_0x27ac34){_0x53001c=_0x53001c-0x0;var _0x2b9c6d=_0xd66c[_0x53001c];return _0x2b9c6d;};'use strict';var _=require('lodash');var util=require(_0xcd66('0x0'));var logger=require('../../config/logger')(_0xcd66('0x1'));var moment=require(_0xcd66('0x2'));var BPromise=require(_0xcd66('0x3'));var rp=require(_0xcd66('0x4'));var fs=require('fs');var path=require(_0xcd66('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcd66('0x6'));module[_0xcd66('0x7')]=function(_0x25399b,_0x1b35d6){return _0x25399b[_0xcd66('0x8')](_0xcd66('0x9'),attributes,{'tableName':_0xcd66('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 296ebcb..555ac7a 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 _0x61c2=['result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x61c2,0x1a6));var _0x261c=function(_0x3136ed,_0x123cc0){_0x3136ed=_0x3136ed-0x0;var _0x3d7fd4=_0x61c2[_0x3136ed];return _0x3d7fd4;};'use strict';var _=require(_0x261c('0x0'));var util=require('util');var moment=require(_0x261c('0x1'));var BPromise=require(_0x261c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x261c('0x3'))['db'];var utils=require(_0x261c('0x4'));var logger=require(_0x261c('0x5'))(_0x261c('0x6'));var config=require(_0x261c('0x7'));var jayson=require(_0x261c('0x8'));var client=jayson[_0x261c('0x9')][_0x261c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5470f7,_0x1eb0ae,_0x980710){return new BPromise(function(_0x59f685,_0x2cf803){return client[_0x261c('0xb')](_0x5470f7,_0x980710)['then'](function(_0x53fce5){logger[_0x261c('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x1eb0ae,_0x261c('0xd'));logger['debug'](_0x261c('0xe'),_0x1eb0ae,_0x261c('0xd'),JSON['stringify'](_0x53fce5));if(_0x53fce5['error']){if(_0x53fce5[_0x261c('0xf')][_0x261c('0x10')]===0x1f4){logger[_0x261c('0xf')](_0x261c('0x11'),_0x1eb0ae,_0x53fce5['error']['message']);return _0x2cf803(_0x53fce5[_0x261c('0xf')][_0x261c('0x12')]);}logger[_0x261c('0xf')](_0x261c('0x11'),_0x1eb0ae,_0x53fce5[_0x261c('0xf')]['message']);return _0x59f685(_0x53fce5[_0x261c('0xf')]['message']);}else{logger[_0x261c('0xc')](_0x261c('0x11'),_0x1eb0ae,'request\x20sent');_0x59f685(_0x53fce5[_0x261c('0x13')][_0x261c('0x12')]);}})[_0x261c('0x14')](function(_0x25207d){logger[_0x261c('0xf')](_0x261c('0x11'),_0x1eb0ae,_0x25207d);_0x2cf803(_0x25207d);});});} \ No newline at end of file +var _0xc885=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x5d6a0e,_0x170b9d){var _0xcf13e8=function(_0x1fd02f){while(--_0x1fd02f){_0x5d6a0e['push'](_0x5d6a0e['shift']());}};_0xcf13e8(++_0x170b9d);}(_0xc885,0xc7));var _0x5c88=function(_0x291449,_0x52117d){_0x291449=_0x291449-0x0;var _0x569795=_0xc885[_0x291449];return _0x569795;};'use strict';var _=require(_0x5c88('0x0'));var util=require('util');var moment=require(_0x5c88('0x1'));var BPromise=require(_0x5c88('0x2'));var rs=require(_0x5c88('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c88('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c88('0x5'))(_0x5c88('0x6'));var config=require('../../config/environment');var jayson=require(_0x5c88('0x7'));var client=jayson['client'][_0x5c88('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xddab06,_0x1d7edb,_0x20565c){return new BPromise(function(_0x499555,_0x2c28b2){return client[_0x5c88('0x9')](_0xddab06,_0x20565c)[_0x5c88('0xa')](function(_0x49ce28){logger[_0x5c88('0xb')](_0x5c88('0xc'),_0x1d7edb,'request\x20sent');logger[_0x5c88('0xd')](_0x5c88('0xe'),_0x1d7edb,_0x5c88('0xf'),JSON[_0x5c88('0x10')](_0x49ce28));if(_0x49ce28[_0x5c88('0x11')]){if(_0x49ce28[_0x5c88('0x11')][_0x5c88('0x12')]===0x1f4){logger[_0x5c88('0x11')](_0x5c88('0xc'),_0x1d7edb,_0x49ce28[_0x5c88('0x11')][_0x5c88('0x13')]);return _0x2c28b2(_0x49ce28[_0x5c88('0x11')]['message']);}logger['error'](_0x5c88('0xc'),_0x1d7edb,_0x49ce28[_0x5c88('0x11')][_0x5c88('0x13')]);return _0x499555(_0x49ce28['error'][_0x5c88('0x13')]);}else{logger[_0x5c88('0xb')](_0x5c88('0xc'),_0x1d7edb,_0x5c88('0xf'));_0x499555(_0x49ce28[_0x5c88('0x14')][_0x5c88('0x13')]);}})[_0x5c88('0x15')](function(_0x16a819){logger[_0x5c88('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x1d7edb,_0x16a819);_0x2c28b2(_0x16a819);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index d1e010b..6bde240 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 _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0x5280b0,_0x17a850){var _0x490826=function(_0x2cc0fe){while(--_0x2cc0fe){_0x5280b0['push'](_0x5280b0['shift']());}};_0x490826(++_0x17a850);}(_0xf494,0x1c6));var _0x4f49=function(_0x449041,_0x5d1a18){_0x449041=_0x449041-0x0;var _0x26dc8b=_0xf494[_0x449041];return _0x26dc8b;};'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')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=router; \ No newline at end of file +var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2eb2,0x19f));var _0x22eb=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x2eb2[_0x5317b5];return _0x3b7ce2;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 62bbe0c..a810e74 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 _0xd7a7=['roundrobin','sequelize','exports','STRING','INTEGER','rrmemory','beepall'];(function(_0x19e58e,_0x540b5a){var _0x5c4d79=function(_0xad26a){while(--_0xad26a){_0x19e58e['push'](_0x19e58e['shift']());}};_0x5c4d79(++_0x540b5a);}(_0xd7a7,0xb0));var _0x7d7a=function(_0x480760,_0x5689df){_0x480760=_0x480760-0x0;var _0x429b49=_0xd7a7[_0x480760];return _0x429b49;};'use strict';var Sequelize=require(_0x7d7a('0x0'));module[_0x7d7a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7d7a('0x2')]},'timeout':{'type':Sequelize[_0x7d7a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7d7a('0x4'),_0x7d7a('0x5'),_0x7d7a('0x6'))}}; \ No newline at end of file +var _0x0fcc=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x3c4ed9,_0x4b3eea){var _0x4f5bb7=function(_0x482742){while(--_0x482742){_0x3c4ed9['push'](_0x3c4ed9['shift']());}};_0x4f5bb7(++_0x4b3eea);}(_0x0fcc,0x11d));var _0xc0fc=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x0fcc[_0x23e7c1];return _0x1add43;};'use strict';var Sequelize=require(_0xc0fc('0x0'));module[_0xc0fc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc0fc('0x2')]},'timeout':{'type':Sequelize[_0xc0fc('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc0fc('0x4')](_0xc0fc('0x5'),_0xc0fc('0x6'),_0xc0fc('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 2eb140a..ec22e9c 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 _0xacd9=['ids','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','every','TeamId','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','ChatQueues','UserProfileResource','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','body','describe','getMembers','findOne','UserChatQueue','findAll','User','findAndCountAll','UserId','agent','chatPause','%s/%s','SIP','createdAt','updatedAt','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams'];(function(_0x810e4d,_0x909ef4){var _0x13f01c=function(_0x12fd89){while(--_0x12fd89){_0x810e4d['push'](_0x810e4d['shift']());}};_0x13f01c(++_0x909ef4);}(_0xacd9,0x150));var _0x9acd=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xacd9[_0x934425];return _0x31d596;};'use strict';var emlformat=require(_0x9acd('0x0'));var rimraf=require(_0x9acd('0x1'));var zipdir=require(_0x9acd('0x2'));var jsonpatch=require(_0x9acd('0x3'));var rp=require(_0x9acd('0x4'));var moment=require(_0x9acd('0x5'));var BPromise=require(_0x9acd('0x6'));var Mustache=require(_0x9acd('0x7'));var util=require(_0x9acd('0x8'));var path=require(_0x9acd('0x9'));var sox=require('sox');var csv=require(_0x9acd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9acd('0xb'));var _=require(_0x9acd('0xc'));var squel=require('squel');var crypto=require(_0x9acd('0xd'));var jsforce=require(_0x9acd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9acd('0xa'));var querystring=require('querystring');var Papa=require(_0x9acd('0xf'));var Redis=require(_0x9acd('0x10'));var authService=require(_0x9acd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9acd('0x12'));var hardwareService=require(_0x9acd('0x13'));var logger=require(_0x9acd('0x14'))(_0x9acd('0x15'));var utils=require(_0x9acd('0x16'));var config=require(_0x9acd('0x17'));var licenseUtil=require(_0x9acd('0x18'));var db=require(_0x9acd('0x19'))['db'];config[_0x9acd('0x1a')]=_[_0x9acd('0x1b')](config[_0x9acd('0x1a')],{'host':_0x9acd('0x1c'),'port':0x18eb});var socket=require(_0x9acd('0x1d'))(new Redis(config[_0x9acd('0x1a')]));require(_0x9acd('0x1e'))['register'](socket);var jayson=require(_0x9acd('0x1f'));var client=jayson[_0x9acd('0x20')][_0x9acd('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x56293b,_0x4c369b,_0x436e3f,_0x726eb9){return new BPromise(function(_0x115a5b,_0x394993){var _0x14d92c=_0x726eb9||client;return _0x14d92c[_0x9acd('0x22')](_0x56293b,_0x436e3f)[_0x9acd('0x23')](function(_0x5afed0){logger[_0x9acd('0x24')](_0x9acd('0x25'),_0x4c369b,_0x9acd('0x26'));logger[_0x9acd('0x27')](_0x9acd('0x28'),_0x4c369b,_0x9acd('0x26'),JSON[_0x9acd('0x29')](_0x5afed0));if(_0x5afed0[_0x9acd('0x2a')]){if(_0x5afed0[_0x9acd('0x2a')][_0x9acd('0x2b')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4c369b,_0x5afed0[_0x9acd('0x2a')][_0x9acd('0x2c')]);return _0x394993(_0x5afed0['error'][_0x9acd('0x2c')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x4c369b,_0x5afed0[_0x9acd('0x2a')][_0x9acd('0x2c')]);return _0x115a5b(_0x5afed0['error']['message']);}else{logger[_0x9acd('0x24')](_0x9acd('0x25'),_0x4c369b,_0x9acd('0x26'));_0x115a5b(_0x5afed0['result'][_0x9acd('0x2c')]);}})[_0x9acd('0x2d')](function(_0x5cb1fb){logger[_0x9acd('0x2a')](_0x9acd('0x25'),_0x4c369b,_0x5cb1fb);_0x394993(_0x5cb1fb);});});}function respondWithStatusCode(_0x2487b2,_0x2ba3c5){_0x2ba3c5=_0x2ba3c5||0xcc;return function(_0x1c15aa){if(_0x1c15aa){return _0x2487b2['sendStatus'](_0x2ba3c5);}return _0x2487b2[_0x9acd('0x2e')](_0x2ba3c5)[_0x9acd('0x2f')]();};}function respondWithResult(_0x3a4c0a,_0x5eea3f){_0x5eea3f=_0x5eea3f||0xc8;return function(_0x1225ac){if(_0x1225ac){return _0x3a4c0a['status'](_0x5eea3f)[_0x9acd('0x30')](_0x1225ac);}};}function respondWithFilteredResult(_0x2f8132,_0x3245c5){return function(_0x3f8d3b){if(_0x3f8d3b){var _0x3fb80f=typeof _0x3245c5[_0x9acd('0x31')]===_0x9acd('0x32')&&typeof _0x3245c5[_0x9acd('0x33')]===_0x9acd('0x32');var _0x36400a=_0x3f8d3b[_0x9acd('0x34')];var _0x209d58=_0x3fb80f?0x0:_0x3245c5['offset'];var _0x55c31b=_0x3fb80f?_0x3f8d3b[_0x9acd('0x34')]:_0x3245c5[_0x9acd('0x31')]+_0x3245c5[_0x9acd('0x33')];var _0x1e94e6;if(_0x55c31b>=_0x36400a){_0x55c31b=_0x36400a;_0x1e94e6=0xc8;}else{_0x1e94e6=0xce;}_0x2f8132['status'](_0x1e94e6);return _0x2f8132[_0x9acd('0x35')](_0x9acd('0x36'),_0x209d58+'-'+_0x55c31b+'/'+_0x36400a)[_0x9acd('0x30')](_0x3f8d3b);}return null;};}function patchUpdates(_0x4599a9){return function(_0x5a59c4){try{jsonpatch[_0x9acd('0x37')](_0x5a59c4,_0x4599a9,!![]);}catch(_0x50b2d2){return BPromise[_0x9acd('0x38')](_0x50b2d2);}return _0x5a59c4['save']();};}function saveUpdates(_0x3c639c,_0x49df31){return function(_0x21b84e){if(_0x21b84e){return _0x21b84e['update'](_0x3c639c)[_0x9acd('0x23')](function(_0x2d3a79){return _0x2d3a79;});}return null;};}function removeEntity(_0x1f1847,_0x270b61){return function(_0x11a0cf){if(_0x11a0cf){return _0x11a0cf[_0x9acd('0x39')]()[_0x9acd('0x23')](function(){var _0x25d9e4=_0x11a0cf['get']({'plain':!![]});var _0x141659=_0x9acd('0x3a');return db[_0x9acd('0x3b')][_0x9acd('0x39')]({'where':{'type':_0x141659,'resourceId':_0x25d9e4['id']}})[_0x9acd('0x23')](function(){return _0x11a0cf;});})[_0x9acd('0x23')](function(){_0x1f1847[_0x9acd('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b646c,_0x4fe471){return function(_0x17064d){if(!_0x17064d){_0x2b646c['sendStatus'](0x194);}return _0x17064d;};}function handleError(_0x17a31a,_0x545c47){_0x545c47=_0x545c47||0x1f4;return function(_0x11867e){logger['error'](_0x11867e['stack']);if(_0x11867e[_0x9acd('0x3c')]){delete _0x11867e[_0x9acd('0x3c')];}_0x17a31a[_0x9acd('0x2e')](_0x545c47)['send'](_0x11867e);};}exports[_0x9acd('0x3d')]=function(_0x3a9e41,_0x11c0e1){var _0x3a7033={},_0x52e40a={},_0xf0aa8f={'count':0x0,'rows':[]};var _0x145bd0=_[_0x9acd('0x3e')](db[_0x9acd('0x3f')][_0x9acd('0x40')],function(_0x330516){return{'name':_0x330516[_0x9acd('0x41')],'type':_0x330516[_0x9acd('0x42')][_0x9acd('0x43')]};});_0x52e40a[_0x9acd('0x44')]=_['map'](_0x145bd0,_0x9acd('0x3c'));_0x52e40a[_0x9acd('0x45')]=_[_0x9acd('0x46')](_0x3a9e41[_0x9acd('0x45')]);_0x52e40a[_0x9acd('0x47')]=_[_0x9acd('0x48')](_0x52e40a[_0x9acd('0x44')],_0x52e40a[_0x9acd('0x45')]);_0x3a7033['attributes']=_['intersection'](_0x52e40a[_0x9acd('0x44')],qs[_0x9acd('0x49')](_0x3a9e41[_0x9acd('0x45')][_0x9acd('0x49')]));_0x3a7033[_0x9acd('0x4a')]=_0x3a7033[_0x9acd('0x4a')][_0x9acd('0x4b')]?_0x3a7033[_0x9acd('0x4a')]:_0x52e40a[_0x9acd('0x44')];if(!_0x3a9e41[_0x9acd('0x45')][_0x9acd('0x4c')](_0x9acd('0x4d'))){_0x3a7033[_0x9acd('0x33')]=qs[_0x9acd('0x33')](_0x3a9e41[_0x9acd('0x45')][_0x9acd('0x33')]);_0x3a7033[_0x9acd('0x31')]=qs[_0x9acd('0x31')](_0x3a9e41['query'][_0x9acd('0x31')]);}_0x3a7033[_0x9acd('0x4e')]=qs[_0x9acd('0x4f')](_0x3a9e41[_0x9acd('0x45')][_0x9acd('0x4f')]);_0x3a7033[_0x9acd('0x50')]=qs[_0x9acd('0x47')](_[_0x9acd('0x51')](_0x3a9e41[_0x9acd('0x45')],_0x52e40a[_0x9acd('0x47')]),_0x145bd0);if(_0x3a9e41[_0x9acd('0x45')][_0x9acd('0x52')]){_0x3a7033[_0x9acd('0x50')]=_[_0x9acd('0x53')](_0x3a7033[_0x9acd('0x50')],{'$or':_['map'](_0x145bd0,function(_0x35680a){if(_0x35680a[_0x9acd('0x42')]!=='VIRTUAL'){var _0x5793d1={};_0x5793d1[_0x35680a[_0x9acd('0x3c')]]={'$like':'%'+_0x3a9e41['query']['filter']+'%'};return _0x5793d1;}})});}_0x3a7033=_[_0x9acd('0x53')]({},_0x3a7033,_0x3a9e41[_0x9acd('0x54')]);var _0x45d17c={'where':_0x3a7033['where']};return db['ChatQueue'][_0x9acd('0x34')](_0x45d17c)['then'](function(_0x31b63e){_0xf0aa8f['count']=_0x31b63e;if(_0x3a9e41[_0x9acd('0x45')][_0x9acd('0x55')]){_0x3a7033[_0x9acd('0x56')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x3a7033);})[_0x9acd('0x23')](function(_0x12c66d){_0xf0aa8f[_0x9acd('0x57')]=_0x12c66d;return _0xf0aa8f;})['then'](respondWithFilteredResult(_0x11c0e1,_0x3a7033))[_0x9acd('0x2d')](handleError(_0x11c0e1,null));};exports[_0x9acd('0x58')]=function(_0x5ab0be,_0x4a7b4f){var _0x437b33={'raw':!![],'where':{'id':_0x5ab0be[_0x9acd('0x59')]['id']}},_0x2b95a2={};_0x2b95a2[_0x9acd('0x44')]=_[_0x9acd('0x46')](db[_0x9acd('0x3f')][_0x9acd('0x40')]);_0x2b95a2[_0x9acd('0x45')]=_[_0x9acd('0x46')](_0x5ab0be['query']);_0x2b95a2[_0x9acd('0x47')]=_[_0x9acd('0x48')](_0x2b95a2['model'],_0x2b95a2[_0x9acd('0x45')]);_0x437b33[_0x9acd('0x4a')]=_['intersection'](_0x2b95a2['model'],qs[_0x9acd('0x49')](_0x5ab0be[_0x9acd('0x45')][_0x9acd('0x49')]));_0x437b33['attributes']=_0x437b33[_0x9acd('0x4a')][_0x9acd('0x4b')]?_0x437b33['attributes']:_0x2b95a2['model'];if(_0x5ab0be['query'][_0x9acd('0x55')]){_0x437b33[_0x9acd('0x56')]=[{'all':!![]}];}_0x437b33=_[_0x9acd('0x53')]({},_0x437b33,_0x5ab0be[_0x9acd('0x54')]);return db[_0x9acd('0x3f')][_0x9acd('0x5a')](_0x437b33)[_0x9acd('0x23')](handleEntityNotFound(_0x4a7b4f,null))[_0x9acd('0x23')](respondWithResult(_0x4a7b4f,null))[_0x9acd('0x2d')](handleError(_0x4a7b4f,null));};exports['create']=function(_0xedf774,_0x366815){return db[_0x9acd('0x3f')][_0x9acd('0x5b')](_0xedf774['body'],{})[_0x9acd('0x23')](function(_0x5628ac){var _0x24fcef=_0xedf774[_0x9acd('0x5c')][_0x9acd('0x5d')]({'plain':!![]});if(!_0x24fcef)throw new Error(_0x9acd('0x5e'));if(_0x24fcef['role']===_0x9acd('0x5c')){var _0x1a10f5=_0x5628ac[_0x9acd('0x5d')]({'plain':!![]});var _0x4958f5=_0x9acd('0x3a');return db[_0x9acd('0x5f')]['find']({'where':{'name':_0x4958f5,'userProfileId':_0x24fcef[_0x9acd('0x60')]},'raw':!![]})['then'](function(_0x4c02db){if(_0x4c02db&&_0x4c02db[_0x9acd('0x61')]===0x0){return db['UserProfileResource'][_0x9acd('0x5b')]({'name':_0x1a10f5[_0x9acd('0x3c')],'resourceId':_0x1a10f5['id'],'type':_0x4c02db['name'],'sectionId':_0x4c02db['id']},{})[_0x9acd('0x23')](function(){return _0x5628ac;});}else{return _0x5628ac;}})[_0x9acd('0x2d')](function(_0x249ee5){logger[_0x9acd('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x249ee5);throw _0x249ee5;});}return _0x5628ac;})[_0x9acd('0x23')](respondWithResult(_0x366815,0xc9))[_0x9acd('0x2d')](handleError(_0x366815,null));};exports[_0x9acd('0x62')]=function(_0xa4faa6,_0x388ae2){if(_0xa4faa6[_0x9acd('0x63')]['id']){delete _0xa4faa6[_0x9acd('0x63')]['id'];}return db[_0x9acd('0x3f')]['find']({'where':{'id':_0xa4faa6[_0x9acd('0x59')]['id']}})[_0x9acd('0x23')](handleEntityNotFound(_0x388ae2,null))[_0x9acd('0x23')](saveUpdates(_0xa4faa6['body'],null))[_0x9acd('0x23')](respondWithResult(_0x388ae2,null))[_0x9acd('0x2d')](handleError(_0x388ae2,null));};exports['destroy']=function(_0xbaa1fd,_0x2ca32c){return db[_0x9acd('0x3f')][_0x9acd('0x5a')]({'where':{'id':_0xbaa1fd[_0x9acd('0x59')]['id']}})[_0x9acd('0x23')](handleEntityNotFound(_0x2ca32c,null))[_0x9acd('0x23')](removeEntity(_0x2ca32c,null))['catch'](handleError(_0x2ca32c,null));};exports[_0x9acd('0x64')]=function(_0x5e24e3,_0x327dce){return db[_0x9acd('0x3f')]['describe']()[_0x9acd('0x23')](respondWithResult(_0x327dce,null))[_0x9acd('0x2d')](handleError(_0x327dce,null));};exports[_0x9acd('0x65')]=function(_0x28071c,_0x2a7df0,_0x331bb2){var _0x341333={'raw':!![],'where':{}},_0x519fd9={},_0x4dc4e8;return db[_0x9acd('0x3f')][_0x9acd('0x66')]({'where':{'id':_0x28071c['params']['id']}})[_0x9acd('0x23')](handleEntityNotFound(_0x2a7df0,null))[_0x9acd('0x23')](function(_0x4d39cd){if(_0x4d39cd){_0x4dc4e8=_0x4d39cd['get']({'plain':!![]});_0x519fd9[_0x9acd('0x44')]=_[_0x9acd('0x46')](db[_0x9acd('0x67')][_0x9acd('0x40')]);_0x519fd9[_0x9acd('0x45')]=_[_0x9acd('0x46')](_0x28071c[_0x9acd('0x45')]);_0x519fd9['filters']=_[_0x9acd('0x48')](_0x519fd9['model'],_0x519fd9[_0x9acd('0x45')]);_0x341333[_0x9acd('0x4a')]=_[_0x9acd('0x48')](_0x519fd9[_0x9acd('0x44')],qs['fields'](_0x28071c[_0x9acd('0x45')][_0x9acd('0x49')]));_0x341333['attributes']=_0x341333[_0x9acd('0x4a')][_0x9acd('0x4b')]?_0x341333[_0x9acd('0x4a')]:_0x519fd9[_0x9acd('0x44')];if(!_0x28071c['query'][_0x9acd('0x4c')](_0x9acd('0x4d'))){_0x341333['limit']=qs[_0x9acd('0x33')](_0x28071c['query'][_0x9acd('0x33')]);_0x341333[_0x9acd('0x31')]=qs['offset'](_0x28071c['query'][_0x9acd('0x31')]);}_0x341333[_0x9acd('0x4e')]=qs[_0x9acd('0x4f')](_0x28071c['query'][_0x9acd('0x4f')]);_0x341333['where']=qs[_0x9acd('0x47')](_[_0x9acd('0x51')](_0x28071c[_0x9acd('0x45')],_0x519fd9[_0x9acd('0x47')]));_0x341333[_0x9acd('0x50')]['ChatQueueId']=_0x4d39cd['id'];if(_0x28071c[_0x9acd('0x45')][_0x9acd('0x52')]){_0x341333[_0x9acd('0x50')]=_['merge'](_0x341333[_0x9acd('0x50')],{'$or':_[_0x9acd('0x3e')](_0x341333['attributes'],function(_0xfcb899){var _0x1ab597={};_0x1ab597[_0xfcb899]={'$like':'%'+_0x28071c[_0x9acd('0x45')][_0x9acd('0x52')]+'%'};return _0x1ab597;})});}_0x341333=_[_0x9acd('0x53')]({},_0x341333,_0x28071c[_0x9acd('0x54')]);return db[_0x9acd('0x67')][_0x9acd('0x68')](_0x341333);}})[_0x9acd('0x23')](function(_0x5c6b7d){if(_0x5c6b7d){return db[_0x9acd('0x69')][_0x9acd('0x6a')]({'where':{'id':_['map'](_0x5c6b7d,_0x9acd('0x6b')),'role':_0x9acd('0x6c')},'attributes':['id',_0x9acd('0x3c'),_0x9acd('0x6d'),'updatedAt','createdAt']});}})[_0x9acd('0x23')](function(_0x37b046){if(_0x37b046){return{'count':_0x37b046['count'],'rows':_['map'](_0x37b046[_0x9acd('0x57')],function(_0x3b3466){return{'membername':_0x3b3466[_0x9acd('0x3c')],'UserId':_0x3b3466['id'],'queue_name':_0x4dc4e8[_0x9acd('0x3c')],'ChatQueueId':_0x4dc4e8['id'],'interface':util['format'](_0x9acd('0x6e'),_0x9acd('0x6f'),_0x3b3466[_0x9acd('0x3c')]),'penalty':0x0,'paused':_0x3b3466[_0x9acd('0x6d')],'createdAt':_0x3b3466[_0x9acd('0x70')],'updatedAt':_0x3b3466[_0x9acd('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9acd('0x23')](respondWithFilteredResult(_0x2a7df0,_0x341333))[_0x9acd('0x2d')](handleError(_0x2a7df0,null));};exports['getTeams']=function(_0x3a8ed6,_0x3523c6,_0xadffb7){var _0x282418={};var _0x25027e={};var _0x1f29ca;var _0x4479f9;return db[_0x9acd('0x3f')][_0x9acd('0x66')]({'where':{'id':_0x3a8ed6[_0x9acd('0x59')]['id']}})[_0x9acd('0x23')](handleEntityNotFound(_0x3523c6,null))[_0x9acd('0x23')](function(_0xd9a09c){if(_0xd9a09c){_0x1f29ca=_0xd9a09c;_0x25027e[_0x9acd('0x44')]=_[_0x9acd('0x46')](db[_0x9acd('0x72')][_0x9acd('0x40')]);_0x25027e[_0x9acd('0x45')]=_[_0x9acd('0x46')](_0x3a8ed6[_0x9acd('0x45')]);_0x25027e['filters']=_[_0x9acd('0x48')](_0x25027e[_0x9acd('0x44')],_0x25027e['query']);_0x282418[_0x9acd('0x4a')]=_[_0x9acd('0x48')](_0x25027e[_0x9acd('0x44')],qs[_0x9acd('0x49')](_0x3a8ed6[_0x9acd('0x45')]['fields']));_0x282418[_0x9acd('0x4a')]=_0x282418['attributes'][_0x9acd('0x4b')]?_0x282418['attributes']:_0x25027e[_0x9acd('0x44')];_0x282418[_0x9acd('0x4e')]=qs[_0x9acd('0x4f')](_0x3a8ed6[_0x9acd('0x45')][_0x9acd('0x4f')]);_0x282418[_0x9acd('0x50')]=qs[_0x9acd('0x47')](_[_0x9acd('0x51')](_0x3a8ed6[_0x9acd('0x45')],_0x25027e[_0x9acd('0x47')]));if(_0x3a8ed6[_0x9acd('0x45')][_0x9acd('0x52')]){_0x282418[_0x9acd('0x50')]=_[_0x9acd('0x53')](_0x282418[_0x9acd('0x50')],{'$or':_[_0x9acd('0x3e')](_0x282418['attributes'],function(_0x13d9d8){var _0x2d456b={};_0x2d456b[_0x13d9d8]={'$like':'%'+_0x3a8ed6[_0x9acd('0x45')][_0x9acd('0x52')]+'%'};return _0x2d456b;})});}_0x282418=_[_0x9acd('0x53')]({},_0x282418,_0x3a8ed6['options']);return _0x1f29ca['getTeams'](_0x282418);}})[_0x9acd('0x23')](function(_0x5aef6e){if(_0x5aef6e){_0x4479f9=_0x5aef6e[_0x9acd('0x4b')];if(!_0x3a8ed6[_0x9acd('0x45')][_0x9acd('0x4c')]('nolimit')){_0x282418[_0x9acd('0x33')]=qs[_0x9acd('0x33')](_0x3a8ed6[_0x9acd('0x45')][_0x9acd('0x33')]);_0x282418[_0x9acd('0x31')]=qs[_0x9acd('0x31')](_0x3a8ed6[_0x9acd('0x45')][_0x9acd('0x31')]);}return _0x1f29ca[_0x9acd('0x73')](_0x282418);}})['then'](function(_0x14974e){if(_0x14974e){return _0x14974e?{'count':_0x4479f9,'rows':_0x14974e}:null;}})[_0x9acd('0x23')](respondWithResult(_0x3523c6,null))[_0x9acd('0x2d')](handleError(_0x3523c6,null));};exports[_0x9acd('0x74')]=function(_0x272271,_0x59c36a,_0x293461){var _0x5dad9a=_0x272271[_0x9acd('0x63')]['ids'];return db[_0x9acd('0x72')][_0x9acd('0x68')]({'where':{'id':_0x5dad9a},'attributes':['id'],'include':[{'model':db[_0x9acd('0x69')],'as':_0x9acd('0x75'),'attributes':['id',_0x9acd('0x3c'),_0x9acd('0x76'),_0x9acd('0x77'),_0x9acd('0x78')],'raw':!![]}]})[_0x9acd('0x23')](function(_0x5b0c13){if(_0x5b0c13){var _0x3d64ef=_[_0x9acd('0x79')](_0x5b0c13,function(_0x42f8b7){var _0x4b999d=_0x42f8b7['get']({'plain':!![]});return _0x4b999d[_0x9acd('0x75')];});return db[_0x9acd('0x3f')][_0x9acd('0x5a')]({'where':{'id':_0x272271[_0x9acd('0x59')]['id']}})[_0x9acd('0x23')](function(_0x25bcd4){return db['sequelize'][_0x9acd('0x7a')](function(_0x4d52f0){return _0x25bcd4[_0x9acd('0x74')](_0x5dad9a,{'transaction':_0x4d52f0})[_0x9acd('0x23')](function(){return BPromise[_0x9acd('0x7b')](_0x3d64ef,function(_0xbbaf19){return db['UserChatQueue'][_0x9acd('0x7c')]({'where':{'UserId':_0xbbaf19['id'],'ChatQueueId':_0x272271[_0x9acd('0x59')]['id']},'transaction':_0x4d52f0});});})[_0x9acd('0x23')](function(){_0x3d64ef[_0x9acd('0x7d')](function(_0x581b2c){socket[_0x9acd('0x7e')](_0x9acd('0x7f'),{'UserId':_0x581b2c['id'],'ChatQueueId':_0x25bcd4['id']});});});});});}})[_0x9acd('0x23')](respondWithStatusCode(_0x59c36a,null))[_0x9acd('0x2d')](handleError(_0x59c36a,null));};exports[_0x9acd('0x80')]=function(_0x5af89f,_0x1e8b2b,_0x3183b5){return db[_0x9acd('0x72')]['findAll']({'where':{'id':_0x5af89f[_0x9acd('0x45')][_0x9acd('0x81')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9acd('0x75'),'attributes':['id'],'raw':!![]}]})[_0x9acd('0x23')](handleEntityNotFound(_0x1e8b2b,null))['then'](function(_0x8c0163){var _0x21a02b=_['map'](_0x8c0163,'id');var _0x978369=[];var _0x46bef8=[];var _0x521666=squel['select']();_0x521666[_0x9acd('0x82')](_0x9acd('0x83'))[_0x9acd('0x84')]('team_has_chat_queues','tq')[_0x9acd('0x85')](_0x9acd('0x86'),'ut',_0x9acd('0x87'))[_0x9acd('0x50')](_0x9acd('0x88'),_0x5af89f[_0x9acd('0x59')]['id']);for(var _0x1c27eb=0x0;_0x1c27eb<_0x8c0163[_0x9acd('0x4b')];_0x1c27eb+=0x1){let _0x15e778=_0x8c0163[_0x1c27eb];for(var _0x5483f5=0x0;_0x5483f5<_0x15e778['Agents']['length'];_0x5483f5+=0x1){let _0x188da7=_0x15e778['Agents'][_0x5483f5];var _0x386552=_0x521666[_0x9acd('0x89')]();_0x386552[_0x9acd('0x50')]('ut.UserId\x20=\x20?',_0x188da7['id']);_0x46bef8[_0x9acd('0x8a')](db[_0x9acd('0x8b')][_0x9acd('0x45')](_0x386552['toString'](),{'type':db['sequelize'][_0x9acd('0x8c')]['SELECT']})[_0x9acd('0x23')](function(_0x10f8b6){if(_0x10f8b6[_0x9acd('0x4b')]===0x1){return _0x188da7['id'];}else{var _0x4c8fea=_[_0x9acd('0x8d')](_[_0x9acd('0x3e')](_0x10f8b6,_0x9acd('0x8e')),function(_0x2788cb){return _['includes'](_0x21a02b,_0x2788cb);});if(_0x4c8fea){return _0x188da7['id'];}}}));}}return BPromise[_0x9acd('0x8f')](_0x46bef8)['then'](function(_0x12f589){_0x978369=_(_0x978369)[_0x9acd('0x90')](_0x12f589)[_0x9acd('0x91')]()[_0x9acd('0x92')]();return db[_0x9acd('0x3f')]['find']({'where':{'id':_0x5af89f[_0x9acd('0x59')]['id']}})['then'](function(_0x284b0a){return db['sequelize'][_0x9acd('0x7a')](function(_0x29a830){return _0x284b0a[_0x9acd('0x80')](_0x5af89f['query'][_0x9acd('0x81')],{'transaction':_0x29a830})[_0x9acd('0x23')](function(){if(!_[_0x9acd('0x93')](_0x978369)){return _0x284b0a[_0x9acd('0x94')](_0x978369,{'transaction':_0x29a830});}})['then'](function(){_0x978369[_0x9acd('0x7d')](function(_0x2c578e){socket[_0x9acd('0x7e')]('userChatQueue:remove',{'UserId':_0x2c578e,'ChatQueueId':_0x284b0a['id']});});});});});});})[_0x9acd('0x23')](respondWithStatusCode(_0x1e8b2b,null))[_0x9acd('0x2d')](handleError(_0x1e8b2b,null));};exports[_0x9acd('0x95')]=function(_0x5ec909,_0x5f1189,_0x9d5db7){return db[_0x9acd('0x3f')][_0x9acd('0x5a')]({'where':{'id':_0x5ec909[_0x9acd('0x59')]['id']}})['then'](handleEntityNotFound(_0x5f1189,null))['then'](function(_0xa3038c){if(_0xa3038c){return _0xa3038c[_0x9acd('0x95')](_0x5ec909[_0x9acd('0x63')][_0x9acd('0x81')],_[_0x9acd('0x96')](_0x5ec909[_0x9acd('0x63')],[_0x9acd('0x81'),'id'])||{})[_0x9acd('0x97')](function(_0x514e24){for(var _0x3029ca=0x0;_0x3029ca<_0x5ec909['body'][_0x9acd('0x81')]['length'];_0x3029ca+=0x1){socket[_0x9acd('0x7e')](_0x9acd('0x7f'),{'UserId':Number(_0x5ec909[_0x9acd('0x63')][_0x9acd('0x81')][_0x3029ca]),'ChatQueueId':Number(_0x5ec909[_0x9acd('0x59')]['id'])});}return _0x514e24;});}})[_0x9acd('0x23')](respondWithResult(_0x5f1189,null))[_0x9acd('0x2d')](handleError(_0x5f1189,null));};exports['removeAgents']=function(_0x6b594,_0x2a5a83,_0x548bbf){return db[_0x9acd('0x3f')][_0x9acd('0x5a')]({'where':{'id':_0x6b594[_0x9acd('0x59')]['id']}})[_0x9acd('0x23')](handleEntityNotFound(_0x2a5a83,null))[_0x9acd('0x23')](function(_0x78ee31){if(_0x78ee31){return _0x78ee31['removeAgents'](_0x6b594[_0x9acd('0x45')][_0x9acd('0x81')])['then'](function(){if(_[_0x9acd('0x98')](_0x6b594[_0x9acd('0x45')]['ids'])){for(var _0x431ea3=0x0;_0x431ea3<_0x6b594[_0x9acd('0x45')][_0x9acd('0x81')][_0x9acd('0x4b')];_0x431ea3+=0x1){socket['emit'](_0x9acd('0x99'),{'UserId':Number(_0x6b594[_0x9acd('0x45')][_0x9acd('0x81')][_0x431ea3]),'ChatQueueId':Number(_0x6b594['params']['id'])});}}else{socket[_0x9acd('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x6b594[_0x9acd('0x45')][_0x9acd('0x81')]),'ChatQueueId':Number(_0x6b594[_0x9acd('0x59')]['id'])});}});}})[_0x9acd('0x23')](respondWithStatusCode(_0x2a5a83,null))[_0x9acd('0x2d')](handleError(_0x2a5a83,null));};exports[_0x9acd('0x9a')]=function(_0xc6dbac,_0x394970,_0x22a4cc){var _0x166ff5={};var _0x1b4420={};var _0x4d470f;var _0x2c3594;return db[_0x9acd('0x3f')][_0x9acd('0x66')]({'where':{'id':_0xc6dbac[_0x9acd('0x59')]['id']}})['then'](handleEntityNotFound(_0x394970,null))[_0x9acd('0x23')](function(_0x182edd){if(_0x182edd){_0x4d470f=_0x182edd;_0x1b4420[_0x9acd('0x44')]=_[_0x9acd('0x46')](db[_0x9acd('0x69')]['rawAttributes']);_0x1b4420[_0x9acd('0x45')]=_[_0x9acd('0x46')](_0xc6dbac[_0x9acd('0x45')]);_0x1b4420[_0x9acd('0x47')]=_['intersection'](_0x1b4420['model'],_0x1b4420[_0x9acd('0x45')]);_0x166ff5[_0x9acd('0x4a')]=_['intersection'](_0x1b4420[_0x9acd('0x44')],qs[_0x9acd('0x49')](_0xc6dbac[_0x9acd('0x45')][_0x9acd('0x49')]));_0x166ff5[_0x9acd('0x4a')]=_0x166ff5[_0x9acd('0x4a')][_0x9acd('0x4b')]?_0x166ff5[_0x9acd('0x4a')]:_0x1b4420[_0x9acd('0x44')];_0x166ff5[_0x9acd('0x4e')]=qs['sort'](_0xc6dbac[_0x9acd('0x45')][_0x9acd('0x4f')]);_0x166ff5[_0x9acd('0x50')]=qs[_0x9acd('0x47')](_['pick'](_0xc6dbac[_0x9acd('0x45')],_0x1b4420['filters']));if(_0xc6dbac[_0x9acd('0x45')][_0x9acd('0x52')]){_0x166ff5[_0x9acd('0x50')]=_[_0x9acd('0x53')](_0x166ff5[_0x9acd('0x50')],{'$or':_['map'](_0x166ff5[_0x9acd('0x4a')],function(_0x1eafec){var _0x374cfe={};_0x374cfe[_0x1eafec]={'$like':'%'+_0xc6dbac[_0x9acd('0x45')][_0x9acd('0x52')]+'%'};return _0x374cfe;})});}_0x166ff5=_[_0x9acd('0x53')]({},_0x166ff5,_0xc6dbac[_0x9acd('0x54')]);return _0x4d470f[_0x9acd('0x9a')](_0x166ff5);}})[_0x9acd('0x23')](function(_0x3e50a4){if(_0x3e50a4){_0x2c3594=_0x3e50a4[_0x9acd('0x4b')];if(!_0xc6dbac[_0x9acd('0x45')]['hasOwnProperty']('nolimit')){_0x166ff5[_0x9acd('0x33')]=qs[_0x9acd('0x33')](_0xc6dbac[_0x9acd('0x45')][_0x9acd('0x33')]);_0x166ff5[_0x9acd('0x31')]=qs['offset'](_0xc6dbac['query'][_0x9acd('0x31')]);}return _0x4d470f[_0x9acd('0x9a')](_0x166ff5);}})['then'](function(_0x1eb21c){if(_0x1eb21c){return _0x1eb21c?{'count':_0x2c3594,'rows':_0x1eb21c}:null;}})['then'](respondWithResult(_0x394970,null))['catch'](handleError(_0x394970,null));}; \ No newline at end of file +var _0xf8db=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','options','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','find','describe','getMembers','findOne','UserChatQueue','length','hasOwnProperty','nolimit','ChatQueueId','findAll','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','SELECT','TeamId','includes','compact','isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:save','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xf8db,0x11c));var _0xbf8d=function(_0x1d246a,_0x49be62){_0x1d246a=_0x1d246a-0x0;var _0x4f233b=_0xf8db[_0x1d246a];return _0x4f233b;};'use strict';var emlformat=require(_0xbf8d('0x0'));var rimraf=require(_0xbf8d('0x1'));var zipdir=require(_0xbf8d('0x2'));var jsonpatch=require(_0xbf8d('0x3'));var rp=require(_0xbf8d('0x4'));var moment=require(_0xbf8d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbf8d('0x6'));var util=require('util');var path=require('path');var sox=require(_0xbf8d('0x7'));var csv=require(_0xbf8d('0x8'));var ejs=require(_0xbf8d('0x9'));var fs=require('fs');var fs_extra=require(_0xbf8d('0xa'));var _=require(_0xbf8d('0xb'));var squel=require(_0xbf8d('0xc'));var crypto=require(_0xbf8d('0xd'));var jsforce=require(_0xbf8d('0xe'));var deskjs=require(_0xbf8d('0xf'));var toCsv=require(_0xbf8d('0x8'));var querystring=require(_0xbf8d('0x10'));var Papa=require(_0xbf8d('0x11'));var Redis=require(_0xbf8d('0x12'));var authService=require(_0xbf8d('0x13'));var qs=require(_0xbf8d('0x14'));var as=require(_0xbf8d('0x15'));var hardwareService=require(_0xbf8d('0x16'));var logger=require('../../config/logger')(_0xbf8d('0x17'));var utils=require('../../config/utils');var config=require(_0xbf8d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf8d('0x19'))['db'];config[_0xbf8d('0x1a')]=_[_0xbf8d('0x1b')](config[_0xbf8d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xbf8d('0x1c'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xbf8d('0x1d')](socket);var jayson=require(_0xbf8d('0x1e'));var client=jayson[_0xbf8d('0x1f')][_0xbf8d('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x356a23,_0x551cba,_0x91408b,_0x1c67ef){return new BPromise(function(_0x448a68,_0x45a024){var _0x4e6e5f=_0x1c67ef||client;return _0x4e6e5f[_0xbf8d('0x21')](_0x356a23,_0x91408b)[_0xbf8d('0x22')](function(_0xae5f75){logger[_0xbf8d('0x23')](_0xbf8d('0x24'),_0x551cba,'request\x20sent');logger[_0xbf8d('0x25')](_0xbf8d('0x26'),_0x551cba,_0xbf8d('0x27'),JSON[_0xbf8d('0x28')](_0xae5f75));if(_0xae5f75['error']){if(_0xae5f75[_0xbf8d('0x29')][_0xbf8d('0x2a')]===0x1f4){logger[_0xbf8d('0x29')](_0xbf8d('0x24'),_0x551cba,_0xae5f75[_0xbf8d('0x29')][_0xbf8d('0x2b')]);return _0x45a024(_0xae5f75[_0xbf8d('0x29')][_0xbf8d('0x2b')]);}logger[_0xbf8d('0x29')](_0xbf8d('0x24'),_0x551cba,_0xae5f75[_0xbf8d('0x29')]['message']);return _0x448a68(_0xae5f75[_0xbf8d('0x29')][_0xbf8d('0x2b')]);}else{logger[_0xbf8d('0x23')]('ChatQueue,\x20%s,\x20%s',_0x551cba,'request\x20sent');_0x448a68(_0xae5f75[_0xbf8d('0x2c')][_0xbf8d('0x2b')]);}})[_0xbf8d('0x2d')](function(_0x1f0a17){logger[_0xbf8d('0x29')]('ChatQueue,\x20%s,\x20%s',_0x551cba,_0x1f0a17);_0x45a024(_0x1f0a17);});});}function respondWithStatusCode(_0x4356df,_0x79c3eb){_0x79c3eb=_0x79c3eb||0xcc;return function(_0x3da427){if(_0x3da427){return _0x4356df[_0xbf8d('0x2e')](_0x79c3eb);}return _0x4356df[_0xbf8d('0x2f')](_0x79c3eb)[_0xbf8d('0x30')]();};}function respondWithResult(_0x7aef2d,_0x33ab5a){_0x33ab5a=_0x33ab5a||0xc8;return function(_0x14d5a5){if(_0x14d5a5){return _0x7aef2d['status'](_0x33ab5a)[_0xbf8d('0x31')](_0x14d5a5);}};}function respondWithFilteredResult(_0x14ac7f,_0x16d673){return function(_0x38375b){if(_0x38375b){var _0x511f90=typeof _0x16d673[_0xbf8d('0x32')]===_0xbf8d('0x33')&&typeof _0x16d673[_0xbf8d('0x34')]===_0xbf8d('0x33');var _0x30c2f8=_0x38375b[_0xbf8d('0x35')];var _0x4504a3=_0x511f90?0x0:_0x16d673[_0xbf8d('0x32')];var _0x28d18d=_0x511f90?_0x38375b[_0xbf8d('0x35')]:_0x16d673['offset']+_0x16d673[_0xbf8d('0x34')];var _0x1bf02e;if(_0x28d18d>=_0x30c2f8){_0x28d18d=_0x30c2f8;_0x1bf02e=0xc8;}else{_0x1bf02e=0xce;}_0x14ac7f[_0xbf8d('0x2f')](_0x1bf02e);return _0x14ac7f['set']('Content-Range',_0x4504a3+'-'+_0x28d18d+'/'+_0x30c2f8)[_0xbf8d('0x31')](_0x38375b);}return null;};}function patchUpdates(_0x22cd4a){return function(_0x966091){try{jsonpatch[_0xbf8d('0x36')](_0x966091,_0x22cd4a,!![]);}catch(_0x282700){return BPromise[_0xbf8d('0x37')](_0x282700);}return _0x966091[_0xbf8d('0x38')]();};}function saveUpdates(_0x577dba,_0x510e57){return function(_0xa3bcf4){if(_0xa3bcf4){return _0xa3bcf4[_0xbf8d('0x39')](_0x577dba)[_0xbf8d('0x22')](function(_0x38c7f4){return _0x38c7f4;});}return null;};}function removeEntity(_0x4611dd,_0x1fa375){return function(_0x14b8b8){if(_0x14b8b8){return _0x14b8b8[_0xbf8d('0x3a')]()['then'](function(){var _0x2f661a=_0x14b8b8[_0xbf8d('0x3b')]({'plain':!![]});var _0x5f0fc7=_0xbf8d('0x3c');return db[_0xbf8d('0x3d')][_0xbf8d('0x3a')]({'where':{'type':_0x5f0fc7,'resourceId':_0x2f661a['id']}})[_0xbf8d('0x22')](function(){return _0x14b8b8;});})[_0xbf8d('0x22')](function(){_0x4611dd[_0xbf8d('0x2f')](0xcc)[_0xbf8d('0x30')]();});}};}function handleEntityNotFound(_0x2b4a71,_0x19b2c1){return function(_0x4ad14a){if(!_0x4ad14a){_0x2b4a71[_0xbf8d('0x2e')](0x194);}return _0x4ad14a;};}function handleError(_0x200777,_0x1fd08a){_0x1fd08a=_0x1fd08a||0x1f4;return function(_0x2df4f8){logger[_0xbf8d('0x29')](_0x2df4f8['stack']);if(_0x2df4f8[_0xbf8d('0x3e')]){delete _0x2df4f8['name'];}_0x200777[_0xbf8d('0x2f')](_0x1fd08a)[_0xbf8d('0x3f')](_0x2df4f8);};}exports[_0xbf8d('0x40')]=function(_0x30c8ec,_0x58e672){var _0x200ad7={},_0x5ea1d2={},_0x111034={'count':0x0,'rows':[]};var _0xc7e5d4=_[_0xbf8d('0x41')](db[_0xbf8d('0x42')][_0xbf8d('0x43')],function(_0x2c118b){return{'name':_0x2c118b['fieldName'],'type':_0x2c118b[_0xbf8d('0x44')][_0xbf8d('0x45')]};});_0x5ea1d2[_0xbf8d('0x46')]=_[_0xbf8d('0x41')](_0xc7e5d4,_0xbf8d('0x3e'));_0x5ea1d2[_0xbf8d('0x47')]=_[_0xbf8d('0x48')](_0x30c8ec['query']);_0x5ea1d2[_0xbf8d('0x49')]=_[_0xbf8d('0x4a')](_0x5ea1d2['model'],_0x5ea1d2[_0xbf8d('0x47')]);_0x200ad7[_0xbf8d('0x4b')]=_['intersection'](_0x5ea1d2[_0xbf8d('0x46')],qs[_0xbf8d('0x4c')](_0x30c8ec[_0xbf8d('0x47')]['fields']));_0x200ad7[_0xbf8d('0x4b')]=_0x200ad7[_0xbf8d('0x4b')]['length']?_0x200ad7[_0xbf8d('0x4b')]:_0x5ea1d2[_0xbf8d('0x46')];if(!_0x30c8ec[_0xbf8d('0x47')]['hasOwnProperty']('nolimit')){_0x200ad7[_0xbf8d('0x34')]=qs[_0xbf8d('0x34')](_0x30c8ec[_0xbf8d('0x47')][_0xbf8d('0x34')]);_0x200ad7[_0xbf8d('0x32')]=qs[_0xbf8d('0x32')](_0x30c8ec['query'][_0xbf8d('0x32')]);}_0x200ad7[_0xbf8d('0x4d')]=qs['sort'](_0x30c8ec['query'][_0xbf8d('0x4e')]);_0x200ad7[_0xbf8d('0x4f')]=qs['filters'](_[_0xbf8d('0x50')](_0x30c8ec[_0xbf8d('0x47')],_0x5ea1d2[_0xbf8d('0x49')]),_0xc7e5d4);if(_0x30c8ec[_0xbf8d('0x47')]['filter']){_0x200ad7[_0xbf8d('0x4f')]=_[_0xbf8d('0x51')](_0x200ad7[_0xbf8d('0x4f')],{'$or':_['map'](_0xc7e5d4,function(_0x431a29){if(_0x431a29['type']!==_0xbf8d('0x52')){var _0x117d1a={};_0x117d1a[_0x431a29['name']]={'$like':'%'+_0x30c8ec[_0xbf8d('0x47')][_0xbf8d('0x53')]+'%'};return _0x117d1a;}})});}_0x200ad7=_[_0xbf8d('0x51')]({},_0x200ad7,_0x30c8ec['options']);var _0x4a2641={'where':_0x200ad7[_0xbf8d('0x4f')]};return db[_0xbf8d('0x42')][_0xbf8d('0x35')](_0x4a2641)[_0xbf8d('0x22')](function(_0x1c6ac4){_0x111034['count']=_0x1c6ac4;if(_0x30c8ec[_0xbf8d('0x47')][_0xbf8d('0x54')]){_0x200ad7[_0xbf8d('0x55')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x200ad7);})[_0xbf8d('0x22')](function(_0x58d8e6){_0x111034[_0xbf8d('0x56')]=_0x58d8e6;return _0x111034;})[_0xbf8d('0x22')](respondWithFilteredResult(_0x58e672,_0x200ad7))[_0xbf8d('0x2d')](handleError(_0x58e672,null));};exports['show']=function(_0xbe2ffc,_0x24a9b6){var _0x5d4220={'raw':!![],'where':{'id':_0xbe2ffc['params']['id']}},_0x25cf83={};_0x25cf83[_0xbf8d('0x46')]=_['keys'](db[_0xbf8d('0x42')][_0xbf8d('0x43')]);_0x25cf83['query']=_['keys'](_0xbe2ffc[_0xbf8d('0x47')]);_0x25cf83['filters']=_['intersection'](_0x25cf83[_0xbf8d('0x46')],_0x25cf83[_0xbf8d('0x47')]);_0x5d4220[_0xbf8d('0x4b')]=_[_0xbf8d('0x4a')](_0x25cf83[_0xbf8d('0x46')],qs['fields'](_0xbe2ffc[_0xbf8d('0x47')][_0xbf8d('0x4c')]));_0x5d4220['attributes']=_0x5d4220[_0xbf8d('0x4b')]['length']?_0x5d4220['attributes']:_0x25cf83[_0xbf8d('0x46')];if(_0xbe2ffc[_0xbf8d('0x47')][_0xbf8d('0x54')]){_0x5d4220['include']=[{'all':!![]}];}_0x5d4220=_[_0xbf8d('0x51')]({},_0x5d4220,_0xbe2ffc[_0xbf8d('0x57')]);return db[_0xbf8d('0x42')]['find'](_0x5d4220)[_0xbf8d('0x22')](handleEntityNotFound(_0x24a9b6,null))[_0xbf8d('0x22')](respondWithResult(_0x24a9b6,null))[_0xbf8d('0x2d')](handleError(_0x24a9b6,null));};exports['create']=function(_0x5b5b60,_0x48f69f){return db[_0xbf8d('0x42')][_0xbf8d('0x58')](_0x5b5b60[_0xbf8d('0x59')],{})[_0xbf8d('0x22')](function(_0x20d024){var _0x372b18=_0x5b5b60[_0xbf8d('0x5a')][_0xbf8d('0x3b')]({'plain':!![]});if(!_0x372b18)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x372b18[_0xbf8d('0x5b')]===_0xbf8d('0x5a')){var _0x5b477a=_0x20d024[_0xbf8d('0x3b')]({'plain':!![]});var _0x142aef=_0xbf8d('0x3c');return db[_0xbf8d('0x5c')]['find']({'where':{'name':_0x142aef,'userProfileId':_0x372b18['userProfileId']},'raw':!![]})[_0xbf8d('0x22')](function(_0x368100){if(_0x368100&&_0x368100[_0xbf8d('0x5d')]===0x0){return db[_0xbf8d('0x3d')]['create']({'name':_0x5b477a[_0xbf8d('0x3e')],'resourceId':_0x5b477a['id'],'type':_0x368100['name'],'sectionId':_0x368100['id']},{})[_0xbf8d('0x22')](function(){return _0x20d024;});}else{return _0x20d024;}})['catch'](function(_0xc5317f){logger['error'](_0xbf8d('0x5e'),_0xc5317f);throw _0xc5317f;});}return _0x20d024;})['then'](respondWithResult(_0x48f69f,0xc9))[_0xbf8d('0x2d')](handleError(_0x48f69f,null));};exports['update']=function(_0x258951,_0x46f271){if(_0x258951[_0xbf8d('0x59')]['id']){delete _0x258951[_0xbf8d('0x59')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x258951[_0xbf8d('0x5f')]['id']}})[_0xbf8d('0x22')](handleEntityNotFound(_0x46f271,null))[_0xbf8d('0x22')](saveUpdates(_0x258951[_0xbf8d('0x59')],null))[_0xbf8d('0x22')](respondWithResult(_0x46f271,null))[_0xbf8d('0x2d')](handleError(_0x46f271,null));};exports[_0xbf8d('0x3a')]=function(_0x3433e9,_0x4aed1b){return db['ChatQueue'][_0xbf8d('0x60')]({'where':{'id':_0x3433e9[_0xbf8d('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4aed1b,null))['then'](removeEntity(_0x4aed1b,null))[_0xbf8d('0x2d')](handleError(_0x4aed1b,null));};exports[_0xbf8d('0x61')]=function(_0x5e4b02,_0x584575){return db['ChatQueue'][_0xbf8d('0x61')]()[_0xbf8d('0x22')](respondWithResult(_0x584575,null))[_0xbf8d('0x2d')](handleError(_0x584575,null));};exports[_0xbf8d('0x62')]=function(_0x3d6d35,_0x31939c,_0x217a9d){var _0x480599={'raw':!![],'where':{}},_0x36c0c6={},_0x37b1f8;return db[_0xbf8d('0x42')][_0xbf8d('0x63')]({'where':{'id':_0x3d6d35[_0xbf8d('0x5f')]['id']}})['then'](handleEntityNotFound(_0x31939c,null))[_0xbf8d('0x22')](function(_0x71ce4f){if(_0x71ce4f){_0x37b1f8=_0x71ce4f[_0xbf8d('0x3b')]({'plain':!![]});_0x36c0c6[_0xbf8d('0x46')]=_[_0xbf8d('0x48')](db[_0xbf8d('0x64')][_0xbf8d('0x43')]);_0x36c0c6[_0xbf8d('0x47')]=_[_0xbf8d('0x48')](_0x3d6d35[_0xbf8d('0x47')]);_0x36c0c6['filters']=_[_0xbf8d('0x4a')](_0x36c0c6[_0xbf8d('0x46')],_0x36c0c6[_0xbf8d('0x47')]);_0x480599[_0xbf8d('0x4b')]=_[_0xbf8d('0x4a')](_0x36c0c6[_0xbf8d('0x46')],qs[_0xbf8d('0x4c')](_0x3d6d35[_0xbf8d('0x47')][_0xbf8d('0x4c')]));_0x480599[_0xbf8d('0x4b')]=_0x480599['attributes'][_0xbf8d('0x65')]?_0x480599[_0xbf8d('0x4b')]:_0x36c0c6['model'];if(!_0x3d6d35[_0xbf8d('0x47')][_0xbf8d('0x66')](_0xbf8d('0x67'))){_0x480599[_0xbf8d('0x34')]=qs[_0xbf8d('0x34')](_0x3d6d35[_0xbf8d('0x47')][_0xbf8d('0x34')]);_0x480599['offset']=qs[_0xbf8d('0x32')](_0x3d6d35[_0xbf8d('0x47')][_0xbf8d('0x32')]);}_0x480599[_0xbf8d('0x4d')]=qs[_0xbf8d('0x4e')](_0x3d6d35[_0xbf8d('0x47')]['sort']);_0x480599[_0xbf8d('0x4f')]=qs['filters'](_[_0xbf8d('0x50')](_0x3d6d35[_0xbf8d('0x47')],_0x36c0c6['filters']));_0x480599[_0xbf8d('0x4f')][_0xbf8d('0x68')]=_0x71ce4f['id'];if(_0x3d6d35[_0xbf8d('0x47')][_0xbf8d('0x53')]){_0x480599['where']=_['merge'](_0x480599['where'],{'$or':_[_0xbf8d('0x41')](_0x480599['attributes'],function(_0x55f248){var _0x5ae4aa={};_0x5ae4aa[_0x55f248]={'$like':'%'+_0x3d6d35['query'][_0xbf8d('0x53')]+'%'};return _0x5ae4aa;})});}_0x480599=_['merge']({},_0x480599,_0x3d6d35['options']);return db[_0xbf8d('0x64')][_0xbf8d('0x69')](_0x480599);}})[_0xbf8d('0x22')](function(_0x434914){if(_0x434914){return db['User'][_0xbf8d('0x6a')]({'where':{'id':_[_0xbf8d('0x41')](_0x434914,_0xbf8d('0x6b')),'role':'agent'},'attributes':['id',_0xbf8d('0x3e'),_0xbf8d('0x6c'),_0xbf8d('0x6d'),_0xbf8d('0x6e')]});}})['then'](function(_0x4be0e5){if(_0x4be0e5){return{'count':_0x4be0e5[_0xbf8d('0x35')],'rows':_[_0xbf8d('0x41')](_0x4be0e5[_0xbf8d('0x56')],function(_0x2575e8){return{'membername':_0x2575e8[_0xbf8d('0x3e')],'UserId':_0x2575e8['id'],'queue_name':_0x37b1f8[_0xbf8d('0x3e')],'ChatQueueId':_0x37b1f8['id'],'interface':util[_0xbf8d('0x6f')]('%s/%s',_0xbf8d('0x70'),_0x2575e8[_0xbf8d('0x3e')]),'penalty':0x0,'paused':_0x2575e8['chatPause'],'createdAt':_0x2575e8[_0xbf8d('0x6e')],'updatedAt':_0x2575e8[_0xbf8d('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbf8d('0x22')](respondWithFilteredResult(_0x31939c,_0x480599))[_0xbf8d('0x2d')](handleError(_0x31939c,null));};exports[_0xbf8d('0x71')]=function(_0x450306,_0x12724b,_0x381bde){var _0x41f004={};var _0x4d17af={};var _0x3f2d59;var _0x5888ef;return db[_0xbf8d('0x42')][_0xbf8d('0x63')]({'where':{'id':_0x450306[_0xbf8d('0x5f')]['id']}})[_0xbf8d('0x22')](handleEntityNotFound(_0x12724b,null))['then'](function(_0x27f139){if(_0x27f139){_0x3f2d59=_0x27f139;_0x4d17af['model']=_[_0xbf8d('0x48')](db[_0xbf8d('0x72')]['rawAttributes']);_0x4d17af[_0xbf8d('0x47')]=_['keys'](_0x450306[_0xbf8d('0x47')]);_0x4d17af['filters']=_[_0xbf8d('0x4a')](_0x4d17af[_0xbf8d('0x46')],_0x4d17af[_0xbf8d('0x47')]);_0x41f004[_0xbf8d('0x4b')]=_[_0xbf8d('0x4a')](_0x4d17af[_0xbf8d('0x46')],qs['fields'](_0x450306[_0xbf8d('0x47')][_0xbf8d('0x4c')]));_0x41f004[_0xbf8d('0x4b')]=_0x41f004[_0xbf8d('0x4b')][_0xbf8d('0x65')]?_0x41f004[_0xbf8d('0x4b')]:_0x4d17af['model'];_0x41f004[_0xbf8d('0x4d')]=qs['sort'](_0x450306['query'][_0xbf8d('0x4e')]);_0x41f004[_0xbf8d('0x4f')]=qs[_0xbf8d('0x49')](_[_0xbf8d('0x50')](_0x450306[_0xbf8d('0x47')],_0x4d17af[_0xbf8d('0x49')]));if(_0x450306[_0xbf8d('0x47')]['filter']){_0x41f004[_0xbf8d('0x4f')]=_[_0xbf8d('0x51')](_0x41f004[_0xbf8d('0x4f')],{'$or':_['map'](_0x41f004[_0xbf8d('0x4b')],function(_0x52ec46){var _0x10cdf4={};_0x10cdf4[_0x52ec46]={'$like':'%'+_0x450306['query']['filter']+'%'};return _0x10cdf4;})});}_0x41f004=_['merge']({},_0x41f004,_0x450306[_0xbf8d('0x57')]);return _0x3f2d59[_0xbf8d('0x71')](_0x41f004);}})[_0xbf8d('0x22')](function(_0x504f5f){if(_0x504f5f){_0x5888ef=_0x504f5f[_0xbf8d('0x65')];if(!_0x450306['query']['hasOwnProperty'](_0xbf8d('0x67'))){_0x41f004['limit']=qs[_0xbf8d('0x34')](_0x450306[_0xbf8d('0x47')][_0xbf8d('0x34')]);_0x41f004[_0xbf8d('0x32')]=qs[_0xbf8d('0x32')](_0x450306['query'][_0xbf8d('0x32')]);}return _0x3f2d59['getTeams'](_0x41f004);}})[_0xbf8d('0x22')](function(_0x42ae61){if(_0x42ae61){return _0x42ae61?{'count':_0x5888ef,'rows':_0x42ae61}:null;}})['then'](respondWithResult(_0x12724b,null))['catch'](handleError(_0x12724b,null));};exports[_0xbf8d('0x73')]=function(_0x5810e5,_0x50afd9,_0xcf654e){var _0x367f5d=_0x5810e5['body'][_0xbf8d('0x74')];return db['Team'][_0xbf8d('0x69')]({'where':{'id':_0x367f5d},'attributes':['id'],'include':[{'model':db[_0xbf8d('0x75')],'as':_0xbf8d('0x76'),'attributes':['id',_0xbf8d('0x3e'),_0xbf8d('0x77'),_0xbf8d('0x78'),_0xbf8d('0x79')],'raw':!![]}]})['then'](function(_0x1ba170){if(_0x1ba170){var _0x153432=_['flatMap'](_0x1ba170,function(_0x44f83d){var _0x35c7fd=_0x44f83d[_0xbf8d('0x3b')]({'plain':!![]});return _0x35c7fd['Agents'];});return db[_0xbf8d('0x42')]['find']({'where':{'id':_0x5810e5[_0xbf8d('0x5f')]['id']}})['then'](function(_0x5ab875){return db[_0xbf8d('0x7a')][_0xbf8d('0x7b')](function(_0x46e517){return _0x5ab875[_0xbf8d('0x73')](_0x367f5d,{'transaction':_0x46e517})[_0xbf8d('0x22')](function(){return BPromise[_0xbf8d('0x7c')](_0x153432,function(_0x304085){return db[_0xbf8d('0x64')][_0xbf8d('0x7d')]({'where':{'UserId':_0x304085['id'],'ChatQueueId':_0x5810e5[_0xbf8d('0x5f')]['id']},'transaction':_0x46e517});});})[_0xbf8d('0x22')](function(){_0x153432[_0xbf8d('0x7e')](function(_0x3fe35f){socket[_0xbf8d('0x7f')]('userChatQueue:save',{'UserId':_0x3fe35f['id'],'ChatQueueId':_0x5ab875['id']});});});});});}})[_0xbf8d('0x22')](respondWithStatusCode(_0x50afd9,null))[_0xbf8d('0x2d')](handleError(_0x50afd9,null));};exports[_0xbf8d('0x80')]=function(_0x75b1c9,_0x58c941,_0x21d847){return db['Team'][_0xbf8d('0x69')]({'where':{'id':_0x75b1c9[_0xbf8d('0x47')][_0xbf8d('0x74')]},'attributes':['id'],'include':[{'model':db[_0xbf8d('0x75')],'as':_0xbf8d('0x76'),'attributes':['id'],'raw':!![]}]})[_0xbf8d('0x22')](handleEntityNotFound(_0x58c941,null))[_0xbf8d('0x22')](function(_0x4f5d3b){var _0x1ae52c=_[_0xbf8d('0x41')](_0x4f5d3b,'id');var _0x1f6afb=[];var _0x49b266=[];var _0x398ee0=squel[_0xbf8d('0x81')]();_0x398ee0['field'](_0xbf8d('0x82'))[_0xbf8d('0x83')](_0xbf8d('0x84'),'tq')['join']('user_has_teams','ut',_0xbf8d('0x85'))[_0xbf8d('0x4f')](_0xbf8d('0x86'),_0x75b1c9['params']['id']);for(var _0x394212=0x0;_0x394212<_0x4f5d3b[_0xbf8d('0x65')];_0x394212+=0x1){let _0x48dd10=_0x4f5d3b[_0x394212];for(var _0x44bfe9=0x0;_0x44bfe9<_0x48dd10[_0xbf8d('0x76')][_0xbf8d('0x65')];_0x44bfe9+=0x1){let _0xaad19b=_0x48dd10[_0xbf8d('0x76')][_0x44bfe9];var _0x80d5be=_0x398ee0[_0xbf8d('0x87')]();_0x80d5be[_0xbf8d('0x4f')]('ut.UserId\x20=\x20?',_0xaad19b['id']);_0x49b266[_0xbf8d('0x88')](db['sequelize'][_0xbf8d('0x47')](_0x80d5be[_0xbf8d('0x89')](),{'type':db['sequelize']['QueryTypes'][_0xbf8d('0x8a')]})[_0xbf8d('0x22')](function(_0x268107){if(_0x268107[_0xbf8d('0x65')]===0x1){return _0xaad19b['id'];}else{var _0x484cd3=_['every'](_[_0xbf8d('0x41')](_0x268107,_0xbf8d('0x8b')),function(_0x2af40c){return _[_0xbf8d('0x8c')](_0x1ae52c,_0x2af40c);});if(_0x484cd3){return _0xaad19b['id'];}}}));}}return BPromise['all'](_0x49b266)[_0xbf8d('0x22')](function(_0x3c8fbd){_0x1f6afb=_(_0x1f6afb)['union'](_0x3c8fbd)[_0xbf8d('0x8d')]()['value']();return db[_0xbf8d('0x42')][_0xbf8d('0x60')]({'where':{'id':_0x75b1c9[_0xbf8d('0x5f')]['id']}})['then'](function(_0x774d2a){return db[_0xbf8d('0x7a')][_0xbf8d('0x7b')](function(_0x624c81){return _0x774d2a[_0xbf8d('0x80')](_0x75b1c9[_0xbf8d('0x47')]['ids'],{'transaction':_0x624c81})[_0xbf8d('0x22')](function(){if(!_[_0xbf8d('0x8e')](_0x1f6afb)){return _0x774d2a[_0xbf8d('0x8f')](_0x1f6afb,{'transaction':_0x624c81});}})[_0xbf8d('0x22')](function(){_0x1f6afb[_0xbf8d('0x7e')](function(_0x37c616){socket[_0xbf8d('0x7f')]('userChatQueue:remove',{'UserId':_0x37c616,'ChatQueueId':_0x774d2a['id']});});});});});});})[_0xbf8d('0x22')](respondWithStatusCode(_0x58c941,null))[_0xbf8d('0x2d')](handleError(_0x58c941,null));};exports['addAgents']=function(_0x61346c,_0x209e4c,_0x3ff226){return db[_0xbf8d('0x42')]['find']({'where':{'id':_0x61346c[_0xbf8d('0x5f')]['id']}})['then'](handleEntityNotFound(_0x209e4c,null))[_0xbf8d('0x22')](function(_0x379843){if(_0x379843){return _0x379843[_0xbf8d('0x90')](_0x61346c[_0xbf8d('0x59')][_0xbf8d('0x74')],_[_0xbf8d('0x91')](_0x61346c[_0xbf8d('0x59')],['ids','id'])||{})[_0xbf8d('0x92')](function(_0xf70e31){for(var _0x432ec5=0x0;_0x432ec5<_0x61346c[_0xbf8d('0x59')][_0xbf8d('0x74')][_0xbf8d('0x65')];_0x432ec5+=0x1){socket[_0xbf8d('0x7f')](_0xbf8d('0x93'),{'UserId':Number(_0x61346c[_0xbf8d('0x59')][_0xbf8d('0x74')][_0x432ec5]),'ChatQueueId':Number(_0x61346c[_0xbf8d('0x5f')]['id'])});}return _0xf70e31;});}})[_0xbf8d('0x22')](respondWithResult(_0x209e4c,null))[_0xbf8d('0x2d')](handleError(_0x209e4c,null));};exports[_0xbf8d('0x8f')]=function(_0x48e00b,_0x520cfc,_0x3a5899){return db[_0xbf8d('0x42')][_0xbf8d('0x60')]({'where':{'id':_0x48e00b[_0xbf8d('0x5f')]['id']}})[_0xbf8d('0x22')](handleEntityNotFound(_0x520cfc,null))['then'](function(_0x263a84){if(_0x263a84){return _0x263a84[_0xbf8d('0x8f')](_0x48e00b['query'][_0xbf8d('0x74')])[_0xbf8d('0x22')](function(){if(_['isArray'](_0x48e00b[_0xbf8d('0x47')]['ids'])){for(var _0x1489d7=0x0;_0x1489d7<_0x48e00b[_0xbf8d('0x47')]['ids'][_0xbf8d('0x65')];_0x1489d7+=0x1){socket[_0xbf8d('0x7f')](_0xbf8d('0x94'),{'UserId':Number(_0x48e00b[_0xbf8d('0x47')][_0xbf8d('0x74')][_0x1489d7]),'ChatQueueId':Number(_0x48e00b['params']['id'])});}}else{socket['emit'](_0xbf8d('0x94'),{'UserId':Number(_0x48e00b[_0xbf8d('0x47')][_0xbf8d('0x74')]),'ChatQueueId':Number(_0x48e00b[_0xbf8d('0x5f')]['id'])});}});}})[_0xbf8d('0x22')](respondWithStatusCode(_0x520cfc,null))[_0xbf8d('0x2d')](handleError(_0x520cfc,null));};exports[_0xbf8d('0x95')]=function(_0x2692f6,_0xc7f7b4,_0x261aeb){var _0x327fbb={};var _0x274411={};var _0x5cedf3;var _0x1e767e;return db[_0xbf8d('0x42')][_0xbf8d('0x63')]({'where':{'id':_0x2692f6[_0xbf8d('0x5f')]['id']}})[_0xbf8d('0x22')](handleEntityNotFound(_0xc7f7b4,null))[_0xbf8d('0x22')](function(_0x2e6e57){if(_0x2e6e57){_0x5cedf3=_0x2e6e57;_0x274411[_0xbf8d('0x46')]=_[_0xbf8d('0x48')](db[_0xbf8d('0x75')][_0xbf8d('0x43')]);_0x274411[_0xbf8d('0x47')]=_[_0xbf8d('0x48')](_0x2692f6['query']);_0x274411[_0xbf8d('0x49')]=_[_0xbf8d('0x4a')](_0x274411['model'],_0x274411[_0xbf8d('0x47')]);_0x327fbb[_0xbf8d('0x4b')]=_[_0xbf8d('0x4a')](_0x274411['model'],qs[_0xbf8d('0x4c')](_0x2692f6[_0xbf8d('0x47')][_0xbf8d('0x4c')]));_0x327fbb[_0xbf8d('0x4b')]=_0x327fbb[_0xbf8d('0x4b')][_0xbf8d('0x65')]?_0x327fbb['attributes']:_0x274411[_0xbf8d('0x46')];_0x327fbb[_0xbf8d('0x4d')]=qs[_0xbf8d('0x4e')](_0x2692f6[_0xbf8d('0x47')]['sort']);_0x327fbb[_0xbf8d('0x4f')]=qs['filters'](_['pick'](_0x2692f6[_0xbf8d('0x47')],_0x274411[_0xbf8d('0x49')]));if(_0x2692f6[_0xbf8d('0x47')][_0xbf8d('0x53')]){_0x327fbb['where']=_[_0xbf8d('0x51')](_0x327fbb[_0xbf8d('0x4f')],{'$or':_[_0xbf8d('0x41')](_0x327fbb[_0xbf8d('0x4b')],function(_0x5bed5d){var _0x5e0734={};_0x5e0734[_0x5bed5d]={'$like':'%'+_0x2692f6[_0xbf8d('0x47')][_0xbf8d('0x53')]+'%'};return _0x5e0734;})});}_0x327fbb=_[_0xbf8d('0x51')]({},_0x327fbb,_0x2692f6[_0xbf8d('0x57')]);return _0x5cedf3[_0xbf8d('0x95')](_0x327fbb);}})[_0xbf8d('0x22')](function(_0xc9e4e2){if(_0xc9e4e2){_0x1e767e=_0xc9e4e2[_0xbf8d('0x65')];if(!_0x2692f6[_0xbf8d('0x47')]['hasOwnProperty'](_0xbf8d('0x67'))){_0x327fbb[_0xbf8d('0x34')]=qs[_0xbf8d('0x34')](_0x2692f6[_0xbf8d('0x47')]['limit']);_0x327fbb[_0xbf8d('0x32')]=qs[_0xbf8d('0x32')](_0x2692f6[_0xbf8d('0x47')][_0xbf8d('0x32')]);}return _0x5cedf3[_0xbf8d('0x95')](_0x327fbb);}})[_0xbf8d('0x22')](function(_0x15aa32){if(_0x15aa32){return _0x15aa32?{'count':_0x1e767e,'rows':_0x15aa32}:null;}})[_0xbf8d('0x22')](respondWithResult(_0xc7f7b4,null))[_0xbf8d('0x2d')](handleError(_0xc7f7b4,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index eb1a52f..7382db6 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 _0xc9b7=['emit','exports','events','ChatQueue','setMaxListeners','save','update','remove'];(function(_0x43bcbf,_0x4d6833){var _0x5af252=function(_0x97043b){while(--_0x97043b){_0x43bcbf['push'](_0x43bcbf['shift']());}};_0x5af252(++_0x4d6833);}(_0xc9b7,0x1f2));var _0x7c9b=function(_0x5459b0,_0x4d2ef8){_0x5459b0=_0x5459b0-0x0;var _0x675a35=_0xc9b7[_0x5459b0];return _0x675a35;};'use strict';var EventEmitter=require(_0x7c9b('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x7c9b('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7c9b('0x2')](0x0);var events={'afterCreate':_0x7c9b('0x3'),'afterUpdate':_0x7c9b('0x4'),'afterDestroy':_0x7c9b('0x5')};function emitEvent(_0x7be78a){return function(_0x3077f3,_0x30ab65,_0x2118b9){ChatQueueEvents[_0x7c9b('0x6')](_0x7be78a+':'+_0x3077f3['id'],_0x3077f3);ChatQueueEvents[_0x7c9b('0x6')](_0x7be78a,_0x3077f3);_0x2118b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x7c9b('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x4a3f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue'];(function(_0x4da5ed,_0x16ff89){var _0x48e8bd=function(_0x3cd060){while(--_0x3cd060){_0x4da5ed['push'](_0x4da5ed['shift']());}};_0x48e8bd(++_0x16ff89);}(_0x4a3f,0x101));var _0xf4a3=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0x4a3f[_0x52666e];return _0x515330;};'use strict';var EventEmitter=require(_0xf4a3('0x0'));var ChatQueue=require(_0xf4a3('0x1'))['db'][_0xf4a3('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf4a3('0x3')](0x0);var events={'afterCreate':_0xf4a3('0x4'),'afterUpdate':_0xf4a3('0x5'),'afterDestroy':_0xf4a3('0x6')};function emitEvent(_0x38c500){return function(_0x4c54da,_0x99d2a4,_0x24b182){ChatQueueEvents[_0xf4a3('0x7')](_0x38c500+':'+_0x4c54da['id'],_0x4c54da);ChatQueueEvents[_0xf4a3('0x7')](_0x38c500,_0x4c54da);_0x24b182(null);};}for(var e in events){if(events[_0xf4a3('0x8')](e)){var event=events[e];ChatQueue[_0xf4a3('0x9')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index e070772..1647194 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 _0x506e=['chat_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','define','ChatQueue'];(function(_0x47fb85,_0xdc3d2e){var _0x26f4fe=function(_0x35cd1d){while(--_0x35cd1d){_0x47fb85['push'](_0x47fb85['shift']());}};_0x26f4fe(++_0xdc3d2e);}(_0x506e,0x85));var _0xe506=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x506e[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xe506('0x0'));var util=require(_0xe506('0x1'));var logger=require(_0xe506('0x2'))('api');var moment=require(_0xe506('0x3'));var BPromise=require(_0xe506('0x4'));var rp=require(_0xe506('0x5'));var fs=require('fs');var path=require(_0xe506('0x6'));var rimraf=require(_0xe506('0x7'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module['exports']=function(_0x3ce62b,_0x3a7637){return _0x3ce62b[_0xe506('0x8')](_0xe506('0x9'),attributes,{'tableName':_0xe506('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0091=['api','moment','request-promise','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x0091,0x1e9));var _0x1009=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0091[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x1009('0x0'));var util=require(_0x1009('0x1'));var logger=require(_0x1009('0x2'))(_0x1009('0x3'));var moment=require(_0x1009('0x4'));var BPromise=require('bluebird');var rp=require(_0x1009('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1009('0x6'));var config=require(_0x1009('0x7'));var attributes=require('./chatQueue.attributes');module[_0x1009('0x8')]=function(_0x4c5934,_0x1bf095){return _0x4c5934[_0x1009('0x9')](_0x1009('0xa'),attributes,{'tableName':_0x1009('0xb'),'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 e2b3f00..ae9d9b3 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 _0x0cfa=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','catch','model','ShowChatQueue','lodash','util'];(function(_0x329389,_0x468c67){var _0x56182f=function(_0xe14c9){while(--_0xe14c9){_0x329389['push'](_0x329389['shift']());}};_0x56182f(++_0x468c67);}(_0x0cfa,0x73));var _0xa0cf=function(_0x2e6db3,_0xb1a20e){_0x2e6db3=_0x2e6db3-0x0;var _0x3d08e6=_0x0cfa[_0x2e6db3];return _0x3d08e6;};'use strict';var _=require(_0xa0cf('0x0'));var util=require(_0xa0cf('0x1'));var moment=require(_0xa0cf('0x2'));var BPromise=require(_0xa0cf('0x3'));var rs=require(_0xa0cf('0x4'));var fs=require('fs');var Redis=require(_0xa0cf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0cf('0x6'));var logger=require('../../config/logger')(_0xa0cf('0x7'));var config=require(_0xa0cf('0x8'));var jayson=require(_0xa0cf('0x9'));var client=jayson[_0xa0cf('0xa')][_0xa0cf('0xb')]({'port':0x232a});config[_0xa0cf('0xc')]=_[_0xa0cf('0xd')](config[_0xa0cf('0xc')],{'host':_0xa0cf('0xe'),'port':0x18eb});var socket=require(_0xa0cf('0xf'))(new Redis(config[_0xa0cf('0xc')]));require(_0xa0cf('0x10'))[_0xa0cf('0x11')](socket);function respondWithRpcPromise(_0x369815,_0xdab099,_0x4e8490){return new BPromise(function(_0x21c01f,_0x2b2424){return client['request'](_0x369815,_0x4e8490)[_0xa0cf('0x12')](function(_0x434795){logger[_0xa0cf('0x13')](_0xa0cf('0x14'),_0xdab099,_0xa0cf('0x15'));logger[_0xa0cf('0x16')](_0xa0cf('0x17'),_0xdab099,_0xa0cf('0x15'),JSON[_0xa0cf('0x18')](_0x434795));if(_0x434795[_0xa0cf('0x19')]){if(_0x434795['error']['code']===0x1f4){logger[_0xa0cf('0x19')](_0xa0cf('0x14'),_0xdab099,_0x434795[_0xa0cf('0x19')][_0xa0cf('0x1a')]);return _0x2b2424(_0x434795[_0xa0cf('0x19')][_0xa0cf('0x1a')]);}logger[_0xa0cf('0x19')](_0xa0cf('0x14'),_0xdab099,_0x434795['error'][_0xa0cf('0x1a')]);return _0x21c01f(_0x434795['error']['message']);}else{logger[_0xa0cf('0x13')](_0xa0cf('0x14'),_0xdab099,_0xa0cf('0x15'));_0x21c01f(_0x434795['result'][_0xa0cf('0x1a')]);}})['catch'](function(_0x3732fb){logger[_0xa0cf('0x19')](_0xa0cf('0x14'),_0xdab099,_0x3732fb);_0x2b2424(_0x3732fb);});});}exports[_0xa0cf('0x1b')]=function(_0x213a6a){var _0x1837b3=this;return new Promise(function(_0x103600,_0x3fa556){return db['ChatQueue'][_0xa0cf('0x1c')]({'raw':_0x213a6a['options']?_0x213a6a[_0xa0cf('0x1d')][_0xa0cf('0x1e')]===undefined?!![]:![]:!![],'where':_0x213a6a[_0xa0cf('0x1d')]?_0x213a6a[_0xa0cf('0x1d')][_0xa0cf('0x1f')]||null:null,'attributes':_0x213a6a[_0xa0cf('0x1d')]?_0x213a6a['options'][_0xa0cf('0x20')]||null:null,'limit':_0x213a6a[_0xa0cf('0x1d')]?_0x213a6a['options'][_0xa0cf('0x21')]||null:null,'include':_0x213a6a[_0xa0cf('0x1d')]?_0x213a6a[_0xa0cf('0x1d')][_0xa0cf('0x22')]?_[_0xa0cf('0x23')](_0x213a6a['options'][_0xa0cf('0x22')],function(_0x5dc98c){return{'model':db[_0x5dc98c['model']],'as':_0x5dc98c['as'],'attributes':_0x5dc98c[_0xa0cf('0x20')],'include':_0x5dc98c[_0xa0cf('0x22')]?_[_0xa0cf('0x23')](_0x5dc98c['include'],function(_0x4d2aab){return{'model':db[_0x4d2aab['model']],'as':_0x4d2aab['as'],'attributes':_0x4d2aab[_0xa0cf('0x20')],'include':_0x4d2aab[_0xa0cf('0x22')]?_['map'](_0x4d2aab[_0xa0cf('0x22')],function(_0xf58a40){return{'model':db[_0xf58a40['model']],'as':_0xf58a40['as'],'attributes':_0xf58a40['attributes']};}):[]};}):[]};}):[]:[]})[_0xa0cf('0x12')](function(_0x5d837d){logger[_0xa0cf('0x13')]('GetChatQueue',_0x213a6a);logger['debug'](_0xa0cf('0x1b'),_0x213a6a,JSON[_0xa0cf('0x18')](_0x5d837d));_0x103600(_0x5d837d);})[_0xa0cf('0x24')](function(_0x1c1770){logger[_0xa0cf('0x19')](_0xa0cf('0x1b'),_0x1c1770[_0xa0cf('0x1a')],_0x213a6a);_0x3fa556(_0x1837b3['error'](0x1f4,_0x1c1770[_0xa0cf('0x1a')]));});});};exports['ShowChatQueue']=function(_0x40764f){var _0x9b8f78=this;return new Promise(function(_0x493768,_0x109dd7){return db['ChatQueue']['find']({'raw':_0x40764f[_0xa0cf('0x1d')]?_0x40764f[_0xa0cf('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x40764f[_0xa0cf('0x1d')]?_0x40764f[_0xa0cf('0x1d')]['where']||null:null,'attributes':_0x40764f['options']?_0x40764f[_0xa0cf('0x1d')][_0xa0cf('0x20')]||null:null,'include':_0x40764f[_0xa0cf('0x1d')]?_0x40764f[_0xa0cf('0x1d')]['include']?_[_0xa0cf('0x23')](_0x40764f[_0xa0cf('0x1d')]['include'],function(_0x4cb083){return{'model':db[_0x4cb083[_0xa0cf('0x25')]],'as':_0x4cb083['as'],'attributes':_0x4cb083[_0xa0cf('0x20')],'include':_0x4cb083[_0xa0cf('0x22')]?_[_0xa0cf('0x23')](_0x4cb083[_0xa0cf('0x22')],function(_0x1bc4e9){return{'model':db[_0x1bc4e9[_0xa0cf('0x25')]],'as':_0x1bc4e9['as'],'attributes':_0x1bc4e9[_0xa0cf('0x20')],'include':_0x1bc4e9[_0xa0cf('0x22')]?_[_0xa0cf('0x23')](_0x1bc4e9[_0xa0cf('0x22')],function(_0x58c111){return{'model':db[_0x58c111[_0xa0cf('0x25')]],'as':_0x58c111['as'],'attributes':_0x58c111['attributes']};}):[]};}):[]};}):[]:[]})[_0xa0cf('0x12')](function(_0x1bbec7){logger[_0xa0cf('0x13')](_0xa0cf('0x26'),_0x40764f);logger[_0xa0cf('0x16')](_0xa0cf('0x26'),_0x40764f,JSON[_0xa0cf('0x18')](_0x1bbec7));_0x493768(_0x1bbec7);})[_0xa0cf('0x24')](function(_0x42e51){logger['error']('ShowChatQueue',_0x42e51[_0xa0cf('0x1a')],_0x40764f);_0x109dd7(_0x9b8f78['error'](0x1f4,_0x42e51[_0xa0cf('0x1a')]));});});}; \ No newline at end of file +var _0x9c9b=['include','map','model','debug','stringify','catch','find','ShowChatQueue','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','message','GetChatQueue','ChatQueue','findAll','options','raw','attributes'];(function(_0x27faf3,_0x5bc98c){var _0x3a4167=function(_0x41a972){while(--_0x41a972){_0x27faf3['push'](_0x27faf3['shift']());}};_0x3a4167(++_0x5bc98c);}(_0x9c9b,0x194));var _0xb9c9=function(_0x1bd7ba,_0x648456){_0x1bd7ba=_0x1bd7ba-0x0;var _0x57bd66=_0x9c9b[_0x1bd7ba];return _0x57bd66;};'use strict';var _=require('lodash');var util=require(_0xb9c9('0x0'));var moment=require(_0xb9c9('0x1'));var BPromise=require(_0xb9c9('0x2'));var rs=require(_0xb9c9('0x3'));var fs=require('fs');var Redis=require(_0xb9c9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9c9('0x5'));var logger=require(_0xb9c9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb9c9('0x7')][_0xb9c9('0x8')]({'port':0x232a});config[_0xb9c9('0x9')]=_[_0xb9c9('0xa')](config[_0xb9c9('0x9')],{'host':_0xb9c9('0xb'),'port':0x18eb});var socket=require(_0xb9c9('0xc'))(new Redis(config[_0xb9c9('0x9')]));require(_0xb9c9('0xd'))[_0xb9c9('0xe')](socket);function respondWithRpcPromise(_0x286ad3,_0x2a70ad,_0xfe2780){return new BPromise(function(_0x5a2fb6,_0x490d67){return client[_0xb9c9('0xf')](_0x286ad3,_0xfe2780)[_0xb9c9('0x10')](function(_0x1e06a4){logger[_0xb9c9('0x11')](_0xb9c9('0x12'),_0x2a70ad,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2a70ad,_0xb9c9('0x13'),JSON['stringify'](_0x1e06a4));if(_0x1e06a4[_0xb9c9('0x14')]){if(_0x1e06a4[_0xb9c9('0x14')]['code']===0x1f4){logger['error'](_0xb9c9('0x12'),_0x2a70ad,_0x1e06a4[_0xb9c9('0x14')][_0xb9c9('0x15')]);return _0x490d67(_0x1e06a4['error'][_0xb9c9('0x15')]);}logger[_0xb9c9('0x14')](_0xb9c9('0x12'),_0x2a70ad,_0x1e06a4[_0xb9c9('0x14')][_0xb9c9('0x15')]);return _0x5a2fb6(_0x1e06a4['error'][_0xb9c9('0x15')]);}else{logger[_0xb9c9('0x11')](_0xb9c9('0x12'),_0x2a70ad,'request\x20sent');_0x5a2fb6(_0x1e06a4['result']['message']);}})['catch'](function(_0x9ff31e){logger[_0xb9c9('0x14')](_0xb9c9('0x12'),_0x2a70ad,_0x9ff31e);_0x490d67(_0x9ff31e);});});}exports[_0xb9c9('0x16')]=function(_0x155c29){var _0x2346e3=this;return new Promise(function(_0x1836b6,_0x2faa66){return db[_0xb9c9('0x17')][_0xb9c9('0x18')]({'raw':_0x155c29[_0xb9c9('0x19')]?_0x155c29[_0xb9c9('0x19')][_0xb9c9('0x1a')]===undefined?!![]:![]:!![],'where':_0x155c29['options']?_0x155c29[_0xb9c9('0x19')]['where']||null:null,'attributes':_0x155c29[_0xb9c9('0x19')]?_0x155c29[_0xb9c9('0x19')][_0xb9c9('0x1b')]||null:null,'limit':_0x155c29[_0xb9c9('0x19')]?_0x155c29[_0xb9c9('0x19')]['limit']||null:null,'include':_0x155c29[_0xb9c9('0x19')]?_0x155c29[_0xb9c9('0x19')][_0xb9c9('0x1c')]?_[_0xb9c9('0x1d')](_0x155c29['options'][_0xb9c9('0x1c')],function(_0x55abcf){return{'model':db[_0x55abcf['model']],'as':_0x55abcf['as'],'attributes':_0x55abcf['attributes'],'include':_0x55abcf[_0xb9c9('0x1c')]?_[_0xb9c9('0x1d')](_0x55abcf[_0xb9c9('0x1c')],function(_0x4e8152){return{'model':db[_0x4e8152[_0xb9c9('0x1e')]],'as':_0x4e8152['as'],'attributes':_0x4e8152[_0xb9c9('0x1b')],'include':_0x4e8152[_0xb9c9('0x1c')]?_[_0xb9c9('0x1d')](_0x4e8152[_0xb9c9('0x1c')],function(_0x3bfc70){return{'model':db[_0x3bfc70[_0xb9c9('0x1e')]],'as':_0x3bfc70['as'],'attributes':_0x3bfc70[_0xb9c9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb9c9('0x10')](function(_0x482cb1){logger[_0xb9c9('0x11')](_0xb9c9('0x16'),_0x155c29);logger[_0xb9c9('0x1f')]('GetChatQueue',_0x155c29,JSON[_0xb9c9('0x20')](_0x482cb1));_0x1836b6(_0x482cb1);})[_0xb9c9('0x21')](function(_0x46d421){logger[_0xb9c9('0x14')]('GetChatQueue',_0x46d421[_0xb9c9('0x15')],_0x155c29);_0x2faa66(_0x2346e3[_0xb9c9('0x14')](0x1f4,_0x46d421[_0xb9c9('0x15')]));});});};exports['ShowChatQueue']=function(_0x38bacd){var _0x225051=this;return new Promise(function(_0x58a8cc,_0x34ff7c){return db[_0xb9c9('0x17')][_0xb9c9('0x22')]({'raw':_0x38bacd[_0xb9c9('0x19')]?_0x38bacd[_0xb9c9('0x19')][_0xb9c9('0x1a')]===undefined?!![]:![]:!![],'where':_0x38bacd[_0xb9c9('0x19')]?_0x38bacd[_0xb9c9('0x19')]['where']||null:null,'attributes':_0x38bacd[_0xb9c9('0x19')]?_0x38bacd['options'][_0xb9c9('0x1b')]||null:null,'include':_0x38bacd['options']?_0x38bacd[_0xb9c9('0x19')][_0xb9c9('0x1c')]?_[_0xb9c9('0x1d')](_0x38bacd[_0xb9c9('0x19')][_0xb9c9('0x1c')],function(_0x56003f){return{'model':db[_0x56003f[_0xb9c9('0x1e')]],'as':_0x56003f['as'],'attributes':_0x56003f[_0xb9c9('0x1b')],'include':_0x56003f['include']?_[_0xb9c9('0x1d')](_0x56003f[_0xb9c9('0x1c')],function(_0x26d75b){return{'model':db[_0x26d75b[_0xb9c9('0x1e')]],'as':_0x26d75b['as'],'attributes':_0x26d75b[_0xb9c9('0x1b')],'include':_0x26d75b['include']?_[_0xb9c9('0x1d')](_0x26d75b[_0xb9c9('0x1c')],function(_0x304f69){return{'model':db[_0x304f69[_0xb9c9('0x1e')]],'as':_0x304f69['as'],'attributes':_0x304f69[_0xb9c9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb9c9('0x10')](function(_0x2b8ba3){logger[_0xb9c9('0x11')](_0xb9c9('0x23'),_0x38bacd);logger['debug'](_0xb9c9('0x23'),_0x38bacd,JSON[_0xb9c9('0x20')](_0x2b8ba3));_0x58a8cc(_0x2b8ba3);})[_0xb9c9('0x21')](function(_0x2774da){logger['error'](_0xb9c9('0x23'),_0x2774da[_0xb9c9('0x15')],_0x38bacd);_0x34ff7c(_0x225051['error'](0x1f4,_0x2774da['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 84bb570..e65f6a5 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 _0x5089=['length','chatQueue:','./chatQueue.events','save','update','emit','register'];(function(_0x1a0054,_0x4f93b6){var _0x1b3084=function(_0x1b1efc){while(--_0x1b1efc){_0x1a0054['push'](_0x1a0054['shift']());}};_0x1b3084(++_0x4f93b6);}(_0x5089,0x1bb));var _0x9508=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0x5089[_0x21af3a];return _0x268a49;};'use strict';var ChatQueueEvents=require(_0x9508('0x0'));var events=[_0x9508('0x1'),'remove',_0x9508('0x2')];function createListener(_0x35878a,_0x7dd13d){return function(_0x100d7e){_0x7dd13d[_0x9508('0x3')](_0x35878a,_0x100d7e);};}function removeListener(_0x59d3ee,_0x86540d){return function(){ChatQueueEvents['removeListener'](_0x59d3ee,_0x86540d);};}exports[_0x9508('0x4')]=function(_0x4538dd){for(var _0x257318=0x0,_0x4ab3c6=events[_0x9508('0x5')];_0x257318<_0x4ab3c6;_0x257318++){var _0x42d13a=events[_0x257318];var _0x55a5de=createListener(_0x9508('0x6')+_0x42d13a,_0x4538dd);ChatQueueEvents['on'](_0x42d13a,_0x55a5de);}}; \ No newline at end of file +var _0x55e0=['emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x121350,_0x361f4d){var _0x2e21c7=function(_0x3b6d51){while(--_0x3b6d51){_0x121350['push'](_0x121350['shift']());}};_0x2e21c7(++_0x361f4d);}(_0x55e0,0xdc));var _0x055e=function(_0x36c5be,_0x1032d6){_0x36c5be=_0x36c5be-0x0;var _0x28d11e=_0x55e0[_0x36c5be];return _0x28d11e;};'use strict';var ChatQueueEvents=require(_0x055e('0x0'));var events=[_0x055e('0x1'),_0x055e('0x2'),_0x055e('0x3')];function createListener(_0x5b82b9,_0x578882){return function(_0x3a2ee6){_0x578882[_0x055e('0x4')](_0x5b82b9,_0x3a2ee6);};}function removeListener(_0x33cd7b,_0x2773e4){return function(){ChatQueueEvents[_0x055e('0x5')](_0x33cd7b,_0x2773e4);};}exports[_0x055e('0x6')]=function(_0x490ee1){for(var _0x5239f6=0x0,_0x4384ff=events['length'];_0x5239f6<_0x4384ff;_0x5239f6++){var _0x8e7824=events[_0x5239f6];var _0x3c4cf=createListener(_0x055e('0x7')+_0x8e7824,_0x490ee1);ChatQueueEvents['on'](_0x8e7824,_0x3c4cf);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index dd255e1..2bf65e9 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5d9df0,_0x5ee28f){var _0x446354=function(_0x24474f){while(--_0x24474f){_0x5d9df0['push'](_0x5d9df0['shift']());}};_0x446354(++_0x5ee28f);}(_0x7217,0x19e));var _0x7721=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x7217[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5872f1,_0x5e9352){var _0x601f14=function(_0x3cea1b){while(--_0x3cea1b){_0x5872f1['push'](_0x5872f1['shift']());}};_0x601f14(++_0x5e9352);}(_0xe14b,0x93));var _0xbe14=function(_0x231962,_0x382414){_0x231962=_0x231962-0x0;var _0x40a960=_0xe14b[_0x231962];return _0x40a960;};'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 8e69ce3..42506e7 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 _0x43b0=['moment','sequelize','STRING','DATE'];(function(_0x339a72,_0x30e232){var _0xe76438=function(_0x1c42b3){while(--_0x1c42b3){_0x339a72['push'](_0x339a72['shift']());}};_0xe76438(++_0x30e232);}(_0x43b0,0x19c));var _0x043b=function(_0x6eb608,_0x4bfdcb){_0x6eb608=_0x6eb608-0x0;var _0x142f47=_0x43b0[_0x6eb608];return _0x142f47;};'use strict';var moment=require(_0x043b('0x0'));var Sequelize=require(_0x043b('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x043b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x043b('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x043b('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7b17=['DATE','moment','sequelize','exports','STRING'];(function(_0x33499b,_0x21025b){var _0xec56b=function(_0x1680b2){while(--_0x1680b2){_0x33499b['push'](_0x33499b['shift']());}};_0xec56b(++_0x21025b);}(_0x7b17,0x9c));var _0x77b1=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x7b17[_0x164eca];return _0x2ce562;};'use strict';var moment=require(_0x77b1('0x0'));var Sequelize=require(_0x77b1('0x1'));module[_0x77b1('0x2')]={'uniqueid':{'type':Sequelize[_0x77b1('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x77b1('0x3')]},'joinAt':{'type':Sequelize[_0x77b1('0x4')]},'leaveAt':{'type':Sequelize[_0x77b1('0x4')]},'acceptAt':{'type':Sequelize[_0x77b1('0x4')]},'exitAt':{'type':Sequelize[_0x77b1('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 1f86ca2..d15b6a7 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 _0xaee6=['filter','merge','where','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x1f2b0e,_0xc804dc){var _0x23b334=function(_0x138ed9){while(--_0x138ed9){_0x1f2b0e['push'](_0x1f2b0e['shift']());}};_0x23b334(++_0xc804dc);}(_0xaee6,0x187));var _0x6aee=function(_0x4620e3,_0x1e0755){_0x4620e3=_0x4620e3-0x0;var _0xbbc011=_0xaee6[_0x4620e3];return _0xbbc011;};'use strict';var emlformat=require(_0x6aee('0x0'));var rimraf=require(_0x6aee('0x1'));var zipdir=require(_0x6aee('0x2'));var jsonpatch=require(_0x6aee('0x3'));var rp=require(_0x6aee('0x4'));var moment=require(_0x6aee('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6aee('0x6'));var util=require(_0x6aee('0x7'));var path=require(_0x6aee('0x8'));var sox=require('sox');var csv=require(_0x6aee('0x9'));var ejs=require(_0x6aee('0xa'));var fs=require('fs');var fs_extra=require(_0x6aee('0xb'));var _=require(_0x6aee('0xc'));var squel=require(_0x6aee('0xd'));var crypto=require(_0x6aee('0xe'));var jsforce=require(_0x6aee('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6aee('0x10'));var Papa=require('papaparse');var Redis=require(_0x6aee('0x11'));var authService=require(_0x6aee('0x12'));var qs=require(_0x6aee('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6aee('0x14'));var logger=require(_0x6aee('0x15'))(_0x6aee('0x16'));var utils=require(_0x6aee('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6aee('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b4551,_0x46e458){_0x46e458=_0x46e458||0xcc;return function(_0x25eddf){if(_0x25eddf){return _0x5b4551[_0x6aee('0x19')](_0x46e458);}return _0x5b4551[_0x6aee('0x1a')](_0x46e458)['end']();};}function respondWithResult(_0x2d13f5,_0x238b4d){_0x238b4d=_0x238b4d||0xc8;return function(_0x5a7fc5){if(_0x5a7fc5){return _0x2d13f5['status'](_0x238b4d)[_0x6aee('0x1b')](_0x5a7fc5);}};}function respondWithFilteredResult(_0x10a0c8,_0x658ef){return function(_0x18b259){if(_0x18b259){var _0x16cc61=typeof _0x658ef[_0x6aee('0x1c')]===_0x6aee('0x1d')&&typeof _0x658ef[_0x6aee('0x1e')]==='undefined';var _0x124794=_0x18b259[_0x6aee('0x1f')];var _0x511486=_0x16cc61?0x0:_0x658ef[_0x6aee('0x1c')];var _0x29f71c=_0x16cc61?_0x18b259['count']:_0x658ef[_0x6aee('0x1c')]+_0x658ef[_0x6aee('0x1e')];var _0x39a9c1;if(_0x29f71c>=_0x124794){_0x29f71c=_0x124794;_0x39a9c1=0xc8;}else{_0x39a9c1=0xce;}_0x10a0c8[_0x6aee('0x1a')](_0x39a9c1);return _0x10a0c8[_0x6aee('0x20')](_0x6aee('0x21'),_0x511486+'-'+_0x29f71c+'/'+_0x124794)[_0x6aee('0x1b')](_0x18b259);}return null;};}function patchUpdates(_0x5969b2){return function(_0x25c43f){try{jsonpatch['apply'](_0x25c43f,_0x5969b2,!![]);}catch(_0x495ec5){return BPromise[_0x6aee('0x22')](_0x495ec5);}return _0x25c43f[_0x6aee('0x23')]();};}function saveUpdates(_0x409295,_0x4619b1){return function(_0x2f9a08){if(_0x2f9a08){return _0x2f9a08[_0x6aee('0x24')](_0x409295)[_0x6aee('0x25')](function(_0x1ffa47){return _0x1ffa47;});}return null;};}function removeEntity(_0x57b997,_0xc1b66c){return function(_0x511ea6){if(_0x511ea6){return _0x511ea6['destroy']()[_0x6aee('0x25')](function(){_0x57b997[_0x6aee('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3445b1,_0x166dcd){return function(_0x56716f){if(!_0x56716f){_0x3445b1[_0x6aee('0x19')](0x194);}return _0x56716f;};}function handleError(_0x43f0bb,_0x1c110c){_0x1c110c=_0x1c110c||0x1f4;return function(_0x1f1b19){logger[_0x6aee('0x26')](_0x1f1b19[_0x6aee('0x27')]);if(_0x1f1b19[_0x6aee('0x28')]){delete _0x1f1b19[_0x6aee('0x28')];}_0x43f0bb[_0x6aee('0x1a')](_0x1c110c)[_0x6aee('0x29')](_0x1f1b19);};}exports[_0x6aee('0x2a')]=function(_0x3376d1,_0x3d06bb){var _0x7327d4={},_0x15e0db={},_0x2fc285={'count':0x0,'rows':[]};var _0x52244f=_['map'](db[_0x6aee('0x2b')][_0x6aee('0x2c')],function(_0x2822b9){return{'name':_0x2822b9[_0x6aee('0x2d')],'type':_0x2822b9['type'][_0x6aee('0x2e')]};});_0x15e0db['model']=_[_0x6aee('0x2f')](_0x52244f,_0x6aee('0x28'));_0x15e0db[_0x6aee('0x30')]=_[_0x6aee('0x31')](_0x3376d1[_0x6aee('0x30')]);_0x15e0db[_0x6aee('0x32')]=_[_0x6aee('0x33')](_0x15e0db[_0x6aee('0x34')],_0x15e0db[_0x6aee('0x30')]);_0x7327d4[_0x6aee('0x35')]=_[_0x6aee('0x33')](_0x15e0db[_0x6aee('0x34')],qs[_0x6aee('0x36')](_0x3376d1['query'][_0x6aee('0x36')]));_0x7327d4[_0x6aee('0x35')]=_0x7327d4[_0x6aee('0x35')][_0x6aee('0x37')]?_0x7327d4[_0x6aee('0x35')]:_0x15e0db[_0x6aee('0x34')];if(!_0x3376d1[_0x6aee('0x30')][_0x6aee('0x38')]('nolimit')){_0x7327d4[_0x6aee('0x1e')]=qs[_0x6aee('0x1e')](_0x3376d1[_0x6aee('0x30')][_0x6aee('0x1e')]);_0x7327d4[_0x6aee('0x1c')]=qs[_0x6aee('0x1c')](_0x3376d1[_0x6aee('0x30')][_0x6aee('0x1c')]);}_0x7327d4[_0x6aee('0x39')]=qs[_0x6aee('0x3a')](_0x3376d1[_0x6aee('0x30')]['sort']);_0x7327d4['where']=qs[_0x6aee('0x32')](_['pick'](_0x3376d1['query'],_0x15e0db[_0x6aee('0x32')]),_0x52244f);if(_0x3376d1[_0x6aee('0x30')][_0x6aee('0x3b')]){_0x7327d4['where']=_[_0x6aee('0x3c')](_0x7327d4[_0x6aee('0x3d')],{'$or':_[_0x6aee('0x2f')](_0x52244f,function(_0x39784e){if(_0x39784e['type']!==_0x6aee('0x3e')){var _0x3b8fda={};_0x3b8fda[_0x39784e[_0x6aee('0x28')]]={'$like':'%'+_0x3376d1[_0x6aee('0x30')][_0x6aee('0x3b')]+'%'};return _0x3b8fda;}})});}_0x7327d4=_['merge']({},_0x7327d4,_0x3376d1[_0x6aee('0x3f')]);var _0x43fbd={'where':_0x7327d4[_0x6aee('0x3d')]};return db[_0x6aee('0x2b')][_0x6aee('0x1f')](_0x43fbd)['then'](function(_0x3e01e1){_0x2fc285['count']=_0x3e01e1;if(_0x3376d1[_0x6aee('0x30')][_0x6aee('0x40')]){_0x7327d4[_0x6aee('0x41')]=[{'all':!![]}];}return db[_0x6aee('0x2b')][_0x6aee('0x42')](_0x7327d4);})[_0x6aee('0x25')](function(_0x5ba53b){_0x2fc285['rows']=_0x5ba53b;return _0x2fc285;})[_0x6aee('0x25')](respondWithFilteredResult(_0x3d06bb,_0x7327d4))['catch'](handleError(_0x3d06bb,null));};exports[_0x6aee('0x43')]=function(_0x2cfa2a,_0x285b9f){var _0x3c58a3={'raw':!![],'where':{'id':_0x2cfa2a[_0x6aee('0x44')]['id']}},_0x5029d3={};_0x5029d3['model']=_[_0x6aee('0x31')](db['ChatQueueReport'][_0x6aee('0x2c')]);_0x5029d3[_0x6aee('0x30')]=_[_0x6aee('0x31')](_0x2cfa2a[_0x6aee('0x30')]);_0x5029d3[_0x6aee('0x32')]=_[_0x6aee('0x33')](_0x5029d3[_0x6aee('0x34')],_0x5029d3[_0x6aee('0x30')]);_0x3c58a3['attributes']=_[_0x6aee('0x33')](_0x5029d3[_0x6aee('0x34')],qs['fields'](_0x2cfa2a['query'][_0x6aee('0x36')]));_0x3c58a3[_0x6aee('0x35')]=_0x3c58a3['attributes'][_0x6aee('0x37')]?_0x3c58a3['attributes']:_0x5029d3[_0x6aee('0x34')];if(_0x2cfa2a[_0x6aee('0x30')][_0x6aee('0x40')]){_0x3c58a3[_0x6aee('0x41')]=[{'all':!![]}];}_0x3c58a3=_['merge']({},_0x3c58a3,_0x2cfa2a['options']);return db[_0x6aee('0x2b')][_0x6aee('0x45')](_0x3c58a3)[_0x6aee('0x25')](handleEntityNotFound(_0x285b9f,null))[_0x6aee('0x25')](respondWithResult(_0x285b9f,null))['catch'](handleError(_0x285b9f,null));};exports[_0x6aee('0x46')]=function(_0x573005,_0x40ea5e){return db[_0x6aee('0x2b')][_0x6aee('0x46')](_0x573005[_0x6aee('0x47')],{})['then'](respondWithResult(_0x40ea5e,0xc9))[_0x6aee('0x48')](handleError(_0x40ea5e,null));};exports[_0x6aee('0x24')]=function(_0x316f51,_0x23a7ed){if(_0x316f51[_0x6aee('0x47')]['id']){delete _0x316f51[_0x6aee('0x47')]['id'];}return db[_0x6aee('0x2b')][_0x6aee('0x45')]({'where':{'id':_0x316f51['params']['id']}})[_0x6aee('0x25')](handleEntityNotFound(_0x23a7ed,null))[_0x6aee('0x25')](saveUpdates(_0x316f51['body'],null))[_0x6aee('0x25')](respondWithResult(_0x23a7ed,null))[_0x6aee('0x48')](handleError(_0x23a7ed,null));};exports[_0x6aee('0x49')]=function(_0x132aa9,_0x5b9036){return db['ChatQueueReport'][_0x6aee('0x45')]({'where':{'id':_0x132aa9[_0x6aee('0x44')]['id']}})[_0x6aee('0x25')](handleEntityNotFound(_0x5b9036,null))[_0x6aee('0x25')](removeEntity(_0x5b9036,null))['catch'](handleError(_0x5b9036,null));};exports[_0x6aee('0x4a')]=function(_0x56587e,_0x44e3ea){return db['ChatQueueReport'][_0x6aee('0x4a')]()[_0x6aee('0x25')](respondWithResult(_0x44e3ea,null))[_0x6aee('0x48')](handleError(_0x44e3ea,null));}; \ No newline at end of file +var _0xcddb=['nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','body','update','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','save','then','destroy','end','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xcddb,0x1c4));var _0xbcdd=function(_0x1a91a6,_0x486ff7){_0x1a91a6=_0x1a91a6-0x0;var _0x21e0a=_0xcddb[_0x1a91a6];return _0x21e0a;};'use strict';var emlformat=require(_0xbcdd('0x0'));var rimraf=require(_0xbcdd('0x1'));var zipdir=require(_0xbcdd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbcdd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbcdd('0x4'));var util=require(_0xbcdd('0x5'));var path=require(_0xbcdd('0x6'));var sox=require(_0xbcdd('0x7'));var csv=require('to-csv');var ejs=require(_0xbcdd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbcdd('0x9'));var squel=require(_0xbcdd('0xa'));var crypto=require('crypto');var jsforce=require(_0xbcdd('0xb'));var deskjs=require(_0xbcdd('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbcdd('0xd'));var Redis=require(_0xbcdd('0xe'));var authService=require(_0xbcdd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xbcdd('0x10'));var hardwareService=require(_0xbcdd('0x11'));var logger=require(_0xbcdd('0x12'))(_0xbcdd('0x13'));var utils=require('../../config/utils');var config=require(_0xbcdd('0x14'));var licenseUtil=require(_0xbcdd('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33cb85,_0x948ca6){_0x948ca6=_0x948ca6||0xcc;return function(_0x5a84c4){if(_0x5a84c4){return _0x33cb85[_0xbcdd('0x16')](_0x948ca6);}return _0x33cb85[_0xbcdd('0x17')](_0x948ca6)['end']();};}function respondWithResult(_0x59da7a,_0x3be98b){_0x3be98b=_0x3be98b||0xc8;return function(_0x34e4cb){if(_0x34e4cb){return _0x59da7a[_0xbcdd('0x17')](_0x3be98b)[_0xbcdd('0x18')](_0x34e4cb);}};}function respondWithFilteredResult(_0x377448,_0x5b66cb){return function(_0x87eb1e){if(_0x87eb1e){var _0x408055=typeof _0x5b66cb['offset']===_0xbcdd('0x19')&&typeof _0x5b66cb['limit']===_0xbcdd('0x19');var _0x2e7eeb=_0x87eb1e[_0xbcdd('0x1a')];var _0x47ae02=_0x408055?0x0:_0x5b66cb[_0xbcdd('0x1b')];var _0x39d865=_0x408055?_0x87eb1e[_0xbcdd('0x1a')]:_0x5b66cb[_0xbcdd('0x1b')]+_0x5b66cb[_0xbcdd('0x1c')];var _0x5ad171;if(_0x39d865>=_0x2e7eeb){_0x39d865=_0x2e7eeb;_0x5ad171=0xc8;}else{_0x5ad171=0xce;}_0x377448[_0xbcdd('0x17')](_0x5ad171);return _0x377448[_0xbcdd('0x1d')](_0xbcdd('0x1e'),_0x47ae02+'-'+_0x39d865+'/'+_0x2e7eeb)[_0xbcdd('0x18')](_0x87eb1e);}return null;};}function patchUpdates(_0x45ae83){return function(_0x1b8c70){try{jsonpatch['apply'](_0x1b8c70,_0x45ae83,!![]);}catch(_0x224a84){return BPromise['reject'](_0x224a84);}return _0x1b8c70[_0xbcdd('0x1f')]();};}function saveUpdates(_0x1d9e2d,_0x26798d){return function(_0x23bbd5){if(_0x23bbd5){return _0x23bbd5['update'](_0x1d9e2d)[_0xbcdd('0x20')](function(_0x2cd0dd){return _0x2cd0dd;});}return null;};}function removeEntity(_0x1e4db6,_0x19e183){return function(_0x527e71){if(_0x527e71){return _0x527e71[_0xbcdd('0x21')]()[_0xbcdd('0x20')](function(){_0x1e4db6[_0xbcdd('0x17')](0xcc)[_0xbcdd('0x22')]();});}};}function handleEntityNotFound(_0x3cfd0f,_0x5441a9){return function(_0x1f334d){if(!_0x1f334d){_0x3cfd0f[_0xbcdd('0x16')](0x194);}return _0x1f334d;};}function handleError(_0x14a34b,_0x3f57a5){_0x3f57a5=_0x3f57a5||0x1f4;return function(_0x37f2a9){logger['error'](_0x37f2a9[_0xbcdd('0x23')]);if(_0x37f2a9[_0xbcdd('0x24')]){delete _0x37f2a9['name'];}_0x14a34b[_0xbcdd('0x17')](_0x3f57a5)[_0xbcdd('0x25')](_0x37f2a9);};}exports[_0xbcdd('0x26')]=function(_0x18b13b,_0x3f6487){var _0x553e98={},_0x163a3e={},_0x485696={'count':0x0,'rows':[]};var _0x5d6234=_[_0xbcdd('0x27')](db[_0xbcdd('0x28')]['rawAttributes'],function(_0x2dc944){return{'name':_0x2dc944[_0xbcdd('0x29')],'type':_0x2dc944[_0xbcdd('0x2a')][_0xbcdd('0x2b')]};});_0x163a3e[_0xbcdd('0x2c')]=_[_0xbcdd('0x27')](_0x5d6234,_0xbcdd('0x24'));_0x163a3e[_0xbcdd('0x2d')]=_[_0xbcdd('0x2e')](_0x18b13b['query']);_0x163a3e[_0xbcdd('0x2f')]=_[_0xbcdd('0x30')](_0x163a3e['model'],_0x163a3e['query']);_0x553e98[_0xbcdd('0x31')]=_[_0xbcdd('0x30')](_0x163a3e['model'],qs[_0xbcdd('0x32')](_0x18b13b['query'][_0xbcdd('0x32')]));_0x553e98['attributes']=_0x553e98[_0xbcdd('0x31')]['length']?_0x553e98[_0xbcdd('0x31')]:_0x163a3e[_0xbcdd('0x2c')];if(!_0x18b13b['query'][_0xbcdd('0x33')](_0xbcdd('0x34'))){_0x553e98[_0xbcdd('0x1c')]=qs[_0xbcdd('0x1c')](_0x18b13b[_0xbcdd('0x2d')]['limit']);_0x553e98[_0xbcdd('0x1b')]=qs['offset'](_0x18b13b[_0xbcdd('0x2d')][_0xbcdd('0x1b')]);}_0x553e98['order']=qs['sort'](_0x18b13b[_0xbcdd('0x2d')]['sort']);_0x553e98[_0xbcdd('0x35')]=qs[_0xbcdd('0x2f')](_[_0xbcdd('0x36')](_0x18b13b['query'],_0x163a3e[_0xbcdd('0x2f')]),_0x5d6234);if(_0x18b13b[_0xbcdd('0x2d')][_0xbcdd('0x37')]){_0x553e98[_0xbcdd('0x35')]=_[_0xbcdd('0x38')](_0x553e98[_0xbcdd('0x35')],{'$or':_[_0xbcdd('0x27')](_0x5d6234,function(_0xd646d1){if(_0xd646d1[_0xbcdd('0x2a')]!==_0xbcdd('0x39')){var _0x40d4fd={};_0x40d4fd[_0xd646d1[_0xbcdd('0x24')]]={'$like':'%'+_0x18b13b['query'][_0xbcdd('0x37')]+'%'};return _0x40d4fd;}})});}_0x553e98=_[_0xbcdd('0x38')]({},_0x553e98,_0x18b13b[_0xbcdd('0x3a')]);var _0x2a9568={'where':_0x553e98[_0xbcdd('0x35')]};return db[_0xbcdd('0x28')]['count'](_0x2a9568)[_0xbcdd('0x20')](function(_0x57ab36){_0x485696[_0xbcdd('0x1a')]=_0x57ab36;if(_0x18b13b['query'][_0xbcdd('0x3b')]){_0x553e98[_0xbcdd('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xbcdd('0x3d')](_0x553e98);})[_0xbcdd('0x20')](function(_0x41721d){_0x485696[_0xbcdd('0x3e')]=_0x41721d;return _0x485696;})['then'](respondWithFilteredResult(_0x3f6487,_0x553e98))['catch'](handleError(_0x3f6487,null));};exports[_0xbcdd('0x3f')]=function(_0xd41482,_0x41fc62){var _0x4b184b={'raw':!![],'where':{'id':_0xd41482[_0xbcdd('0x40')]['id']}},_0x3e65ce={};_0x3e65ce['model']=_[_0xbcdd('0x2e')](db[_0xbcdd('0x28')][_0xbcdd('0x41')]);_0x3e65ce['query']=_[_0xbcdd('0x2e')](_0xd41482[_0xbcdd('0x2d')]);_0x3e65ce[_0xbcdd('0x2f')]=_['intersection'](_0x3e65ce[_0xbcdd('0x2c')],_0x3e65ce[_0xbcdd('0x2d')]);_0x4b184b[_0xbcdd('0x31')]=_[_0xbcdd('0x30')](_0x3e65ce[_0xbcdd('0x2c')],qs[_0xbcdd('0x32')](_0xd41482[_0xbcdd('0x2d')][_0xbcdd('0x32')]));_0x4b184b[_0xbcdd('0x31')]=_0x4b184b[_0xbcdd('0x31')][_0xbcdd('0x42')]?_0x4b184b[_0xbcdd('0x31')]:_0x3e65ce['model'];if(_0xd41482[_0xbcdd('0x2d')]['includeAll']){_0x4b184b[_0xbcdd('0x3c')]=[{'all':!![]}];}_0x4b184b=_[_0xbcdd('0x38')]({},_0x4b184b,_0xd41482['options']);return db[_0xbcdd('0x28')][_0xbcdd('0x43')](_0x4b184b)[_0xbcdd('0x20')](handleEntityNotFound(_0x41fc62,null))[_0xbcdd('0x20')](respondWithResult(_0x41fc62,null))[_0xbcdd('0x44')](handleError(_0x41fc62,null));};exports['create']=function(_0xb1f54d,_0x6f4939){return db['ChatQueueReport']['create'](_0xb1f54d[_0xbcdd('0x45')],{})[_0xbcdd('0x20')](respondWithResult(_0x6f4939,0xc9))[_0xbcdd('0x44')](handleError(_0x6f4939,null));};exports[_0xbcdd('0x46')]=function(_0x26535a,_0x6708f5){if(_0x26535a[_0xbcdd('0x45')]['id']){delete _0x26535a['body']['id'];}return db[_0xbcdd('0x28')][_0xbcdd('0x43')]({'where':{'id':_0x26535a['params']['id']}})[_0xbcdd('0x20')](handleEntityNotFound(_0x6708f5,null))['then'](saveUpdates(_0x26535a[_0xbcdd('0x45')],null))[_0xbcdd('0x20')](respondWithResult(_0x6708f5,null))[_0xbcdd('0x44')](handleError(_0x6708f5,null));};exports[_0xbcdd('0x21')]=function(_0x282450,_0x304966){return db[_0xbcdd('0x28')][_0xbcdd('0x43')]({'where':{'id':_0x282450['params']['id']}})['then'](handleEntityNotFound(_0x304966,null))[_0xbcdd('0x20')](removeEntity(_0x304966,null))[_0xbcdd('0x44')](handleError(_0x304966,null));};exports['describe']=function(_0x2242bd,_0x312832){return db[_0xbcdd('0x28')][_0xbcdd('0x47')]()[_0xbcdd('0x20')](respondWithResult(_0x312832,null))['catch'](handleError(_0x312832,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 16a881b..65483d5 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x156c49,_0x421fef){var _0x3fcf3f=function(_0x2dfd82){while(--_0x2dfd82){_0x156c49['push'](_0x156c49['shift']());}};_0x3fcf3f(++_0x421fef);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x2e983f,_0x40731b){var _0x296a34=function(_0x369bdb){while(--_0x369bdb){_0x2e983f['push'](_0x2e983f['shift']());}};_0x296a34(++_0x40731b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index ebe9229..c6edef4 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 _0xd4a4=['../../config/utils','jayson/promise','http','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','UpdateChatQueueReport','update','where','attributes','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x4756c7,_0x1e9983){var _0x59e006=function(_0x7d08ad){while(--_0x7d08ad){_0x4756c7['push'](_0x4756c7['shift']());}};_0x59e006(++_0x1e9983);}(_0xd4a4,0x112));var _0x4d4a=function(_0x549a81,_0x28f9c7){_0x549a81=_0x549a81-0x0;var _0x514df1=_0xd4a4[_0x549a81];return _0x514df1;};'use strict';var _=require(_0x4d4a('0x0'));var util=require('util');var moment=require(_0x4d4a('0x1'));var BPromise=require(_0x4d4a('0x2'));var rs=require(_0x4d4a('0x3'));var fs=require('fs');var Redis=require(_0x4d4a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d4a('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4d4a('0x6'));var client=jayson['client'][_0x4d4a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34c2f0,_0x374dbf,_0x185c6c){return new BPromise(function(_0xccd933,_0x3f2621){return client[_0x4d4a('0x8')](_0x34c2f0,_0x185c6c)[_0x4d4a('0x9')](function(_0x438da5){logger[_0x4d4a('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x374dbf,_0x4d4a('0xb'));logger[_0x4d4a('0xc')](_0x4d4a('0xd'),_0x374dbf,_0x4d4a('0xb'),JSON['stringify'](_0x438da5));if(_0x438da5[_0x4d4a('0xe')]){if(_0x438da5['error'][_0x4d4a('0xf')]===0x1f4){logger[_0x4d4a('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x374dbf,_0x438da5[_0x4d4a('0xe')][_0x4d4a('0x10')]);return _0x3f2621(_0x438da5[_0x4d4a('0xe')][_0x4d4a('0x10')]);}logger[_0x4d4a('0xe')](_0x4d4a('0x11'),_0x374dbf,_0x438da5[_0x4d4a('0xe')][_0x4d4a('0x10')]);return _0xccd933(_0x438da5['error'][_0x4d4a('0x10')]);}else{logger[_0x4d4a('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x374dbf,'request\x20sent');_0xccd933(_0x438da5[_0x4d4a('0x12')][_0x4d4a('0x10')]);}})[_0x4d4a('0x13')](function(_0x4f2117){logger[_0x4d4a('0xe')](_0x4d4a('0x11'),_0x374dbf,_0x4f2117);_0x3f2621(_0x4f2117);});});}exports[_0x4d4a('0x14')]=function(_0x1b194a){var _0x4b721a=this;return new Promise(function(_0x16f543,_0x519c10){return db[_0x4d4a('0x15')][_0x4d4a('0x16')](_0x1b194a[_0x4d4a('0x17')],{'raw':_0x1b194a[_0x4d4a('0x18')]?_0x1b194a[_0x4d4a('0x18')][_0x4d4a('0x19')]===undefined?!![]:![]:!![]})[_0x4d4a('0x9')](function(_0xeb6656){logger[_0x4d4a('0xa')]('CreateChatQueueReport',_0x1b194a);logger[_0x4d4a('0xc')](_0x4d4a('0x14'),_0x1b194a,JSON[_0x4d4a('0x1a')](_0xeb6656));_0x16f543(_0xeb6656);})[_0x4d4a('0x13')](function(_0x1c0fa4){logger['error']('CreateChatQueueReport',_0x1c0fa4['message'],_0x1b194a);_0x519c10(_0x4b721a[_0x4d4a('0xe')](0x1f4,_0x1c0fa4[_0x4d4a('0x10')]));});});};exports[_0x4d4a('0x1b')]=function(_0x3f20e4){var _0xf625b8=this;return new Promise(function(_0x1e4859,_0x1707b8){return db[_0x4d4a('0x15')][_0x4d4a('0x1c')](_0x3f20e4[_0x4d4a('0x17')],{'raw':_0x3f20e4[_0x4d4a('0x18')]?_0x3f20e4[_0x4d4a('0x18')][_0x4d4a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f20e4['options']?_0x3f20e4['options'][_0x4d4a('0x1d')]||null:null,'attributes':_0x3f20e4[_0x4d4a('0x18')]?_0x3f20e4['options'][_0x4d4a('0x1e')]||null:null,'limit':_0x3f20e4[_0x4d4a('0x18')]?_0x3f20e4[_0x4d4a('0x18')]['limit']||null:null})[_0x4d4a('0x9')](function(_0x40c3b0){logger[_0x4d4a('0xa')](_0x4d4a('0x1b'),_0x3f20e4);logger[_0x4d4a('0xc')](_0x4d4a('0x1b'),_0x3f20e4,JSON[_0x4d4a('0x1a')](_0x40c3b0));_0x1e4859(_0x40c3b0);})[_0x4d4a('0x13')](function(_0x283b27){logger[_0x4d4a('0xe')](_0x4d4a('0x1b'),_0x283b27[_0x4d4a('0x10')],_0x3f20e4);_0x1707b8(_0xf625b8[_0x4d4a('0xe')](0x1f4,_0x283b27[_0x4d4a('0x10')]));});});}; \ No newline at end of file +var _0x7462=['raw','info','update','body','where','attributes','lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateChatQueueReport','create','options'];(function(_0x20f381,_0x31f26e){var _0x599f25=function(_0x35e69d){while(--_0x35e69d){_0x20f381['push'](_0x20f381['shift']());}};_0x599f25(++_0x31f26e);}(_0x7462,0x165));var _0x2746=function(_0xcfd89f,_0x106e8f){_0xcfd89f=_0xcfd89f-0x0;var _0x59acd4=_0x7462[_0xcfd89f];return _0x59acd4;};'use strict';var _=require(_0x2746('0x0'));var util=require(_0x2746('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2746('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2746('0x3'));var logger=require(_0x2746('0x4'))('rpc');var config=require(_0x2746('0x5'));var jayson=require(_0x2746('0x6'));var client=jayson[_0x2746('0x7')][_0x2746('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a2f42,_0x2940d8,_0x1447bc){return new BPromise(function(_0x40ad2b,_0x283327){return client['request'](_0x2a2f42,_0x1447bc)[_0x2746('0x9')](function(_0x2e4713){logger['info'](_0x2746('0xa'),_0x2940d8,_0x2746('0xb'));logger[_0x2746('0xc')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x2940d8,_0x2746('0xb'),JSON[_0x2746('0xd')](_0x2e4713));if(_0x2e4713[_0x2746('0xe')]){if(_0x2e4713[_0x2746('0xe')][_0x2746('0xf')]===0x1f4){logger[_0x2746('0xe')](_0x2746('0xa'),_0x2940d8,_0x2e4713[_0x2746('0xe')][_0x2746('0x10')]);return _0x283327(_0x2e4713[_0x2746('0xe')][_0x2746('0x10')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x2940d8,_0x2e4713[_0x2746('0xe')][_0x2746('0x10')]);return _0x40ad2b(_0x2e4713[_0x2746('0xe')][_0x2746('0x10')]);}else{logger['info'](_0x2746('0xa'),_0x2940d8,_0x2746('0xb'));_0x40ad2b(_0x2e4713['result']['message']);}})[_0x2746('0x11')](function(_0x43f06c){logger[_0x2746('0xe')](_0x2746('0xa'),_0x2940d8,_0x43f06c);_0x283327(_0x43f06c);});});}exports[_0x2746('0x12')]=function(_0x232108){var _0x3556b5=this;return new Promise(function(_0x6102f3,_0x25c122){return db['ChatQueueReport'][_0x2746('0x13')](_0x232108['body'],{'raw':_0x232108[_0x2746('0x14')]?_0x232108[_0x2746('0x14')][_0x2746('0x15')]===undefined?!![]:![]:!![]})[_0x2746('0x9')](function(_0xa64e76){logger[_0x2746('0x16')](_0x2746('0x12'),_0x232108);logger[_0x2746('0xc')](_0x2746('0x12'),_0x232108,JSON['stringify'](_0xa64e76));_0x6102f3(_0xa64e76);})['catch'](function(_0x7390b3){logger[_0x2746('0xe')](_0x2746('0x12'),_0x7390b3['message'],_0x232108);_0x25c122(_0x3556b5[_0x2746('0xe')](0x1f4,_0x7390b3[_0x2746('0x10')]));});});};exports['UpdateChatQueueReport']=function(_0x2b4652){var _0x5cf1fb=this;return new Promise(function(_0x4bbe26,_0x5bc3c8){return db['ChatQueueReport'][_0x2746('0x17')](_0x2b4652[_0x2746('0x18')],{'raw':_0x2b4652['options']?_0x2b4652[_0x2746('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b4652[_0x2746('0x14')]?_0x2b4652[_0x2746('0x14')][_0x2746('0x19')]||null:null,'attributes':_0x2b4652[_0x2746('0x14')]?_0x2b4652[_0x2746('0x14')][_0x2746('0x1a')]||null:null,'limit':_0x2b4652[_0x2746('0x14')]?_0x2b4652[_0x2746('0x14')]['limit']||null:null})[_0x2746('0x9')](function(_0x6c2ef9){logger['info']('UpdateChatQueueReport',_0x2b4652);logger['debug']('UpdateChatQueueReport',_0x2b4652,JSON['stringify'](_0x6c2ef9));_0x4bbe26(_0x6c2ef9);})[_0x2746('0x11')](function(_0x1305b8){logger['error']('UpdateChatQueueReport',_0x1305b8[_0x2746('0x10')],_0x2b4652);_0x5bc3c8(_0x5cf1fb[_0x2746('0xe')](0x1f4,_0x1305b8['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 8e8aea7..b31757c 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 _0x9637=['isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x45ba02,_0x557589){var _0x176288=function(_0x43bcdd){while(--_0x43bcdd){_0x45ba02['push'](_0x45ba02['shift']());}};_0x176288(++_0x557589);}(_0x9637,0x6e));var _0x7963=function(_0xac6b8a,_0xe7f580){_0xac6b8a=_0xac6b8a-0x0;var _0x551ae7=_0x9637[_0xac6b8a];return _0x551ae7;};'use strict';var multer=require(_0x7963('0x0'));var util=require(_0x7963('0x1'));var path=require('path');var timeout=require(_0x7963('0x2'));var express=require(_0x7963('0x3'));var router=express[_0x7963('0x4')]();var fs_extra=require(_0x7963('0x5'));var auth=require(_0x7963('0x6'));var interaction=require(_0x7963('0x7'));var config=require(_0x7963('0x8'));var controller=require('./chatQueueReport.controller');router[_0x7963('0x9')]('/',auth[_0x7963('0xa')](),controller[_0x7963('0xb')]);router[_0x7963('0x9')](_0x7963('0xc'),auth[_0x7963('0xa')](),controller[_0x7963('0xd')]);router[_0x7963('0x9')](_0x7963('0xe'),auth[_0x7963('0xa')](),controller[_0x7963('0xf')]);router['post']('/',auth[_0x7963('0xa')](),controller['create']);router[_0x7963('0x10')](_0x7963('0xe'),auth[_0x7963('0xa')](),controller[_0x7963('0x11')]);router[_0x7963('0x12')](_0x7963('0xe'),auth[_0x7963('0xa')](),controller['destroy']);module[_0x7963('0x13')]=router; \ No newline at end of file +var _0xd176=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1f4ee6,_0x309a2f){var _0x547538=function(_0x4c89f0){while(--_0x4c89f0){_0x1f4ee6['push'](_0x1f4ee6['shift']());}};_0x547538(++_0x309a2f);}(_0xd176,0x1c7));var _0x6d17=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0xd176[_0x37cc52];return _0x2b4a90;};'use strict';var multer=require(_0x6d17('0x0'));var util=require(_0x6d17('0x1'));var path=require(_0x6d17('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d17('0x3'));var router=express[_0x6d17('0x4')]();var fs_extra=require(_0x6d17('0x5'));var auth=require(_0x6d17('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6d17('0x7'));var controller=require('./chatQueueReport.controller');router[_0x6d17('0x8')]('/',auth[_0x6d17('0x9')](),controller[_0x6d17('0xa')]);router[_0x6d17('0x8')](_0x6d17('0xb'),auth['isAuthenticated'](),controller[_0x6d17('0xc')]);router[_0x6d17('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6d17('0xd')]);router[_0x6d17('0xe')]('/',auth['isAuthenticated'](),controller[_0x6d17('0xf')]);router['put'](_0x6d17('0x10'),auth[_0x6d17('0x9')](),controller[_0x6d17('0x11')]);router[_0x6d17('0x12')](_0x6d17('0x10'),auth['isAuthenticated'](),controller[_0x6d17('0x13')]);module[_0x6d17('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 2e38b03..17d5d20 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x139a25,_0x1707d7){var _0x330a62=function(_0x3092b4){while(--_0x3092b4){_0x139a25['push'](_0x139a25['shift']());}};_0x330a62(++_0x1707d7);}(_0x008c,0x188));var _0xc008=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0x008c[_0x575a38];return _0x5a7bdd;};'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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x34e8,0x12c));var _0x834e=function(_0x2cdad4,_0x212e48){_0x2cdad4=_0x2cdad4-0x0;var _0x41ad25=_0x34e8[_0x2cdad4];return _0x41ad25;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 5a10d00..dcefe98 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 _0xd6ff=['destroy','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then'];(function(_0x37b23c,_0x33b39e){var _0x59dd00=function(_0x5dc82c){while(--_0x5dc82c){_0x37b23c['push'](_0x37b23c['shift']());}};_0x59dd00(++_0x33b39e);}(_0xd6ff,0xbf));var _0xfd6f=function(_0x4e69c6,_0x5878eb){_0x4e69c6=_0x4e69c6-0x0;var _0x2643ac=_0xd6ff[_0x4e69c6];return _0x2643ac;};'use strict';var emlformat=require(_0xfd6f('0x0'));var rimraf=require(_0xfd6f('0x1'));var zipdir=require(_0xfd6f('0x2'));var jsonpatch=require(_0xfd6f('0x3'));var rp=require(_0xfd6f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfd6f('0x5'));var path=require(_0xfd6f('0x6'));var sox=require(_0xfd6f('0x7'));var csv=require(_0xfd6f('0x8'));var ejs=require(_0xfd6f('0x9'));var fs=require('fs');var fs_extra=require(_0xfd6f('0xa'));var _=require(_0xfd6f('0xb'));var squel=require(_0xfd6f('0xc'));var crypto=require('crypto');var jsforce=require(_0xfd6f('0xd'));var deskjs=require(_0xfd6f('0xe'));var toCsv=require(_0xfd6f('0x8'));var querystring=require(_0xfd6f('0xf'));var Papa=require(_0xfd6f('0x10'));var Redis=require(_0xfd6f('0x11'));var authService=require(_0xfd6f('0x12'));var qs=require(_0xfd6f('0x13'));var as=require(_0xfd6f('0x14'));var hardwareService=require(_0xfd6f('0x15'));var logger=require(_0xfd6f('0x16'))(_0xfd6f('0x17'));var utils=require(_0xfd6f('0x18'));var config=require(_0xfd6f('0x19'));var licenseUtil=require(_0xfd6f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5185de,_0x559ecd){_0x559ecd=_0x559ecd||0xcc;return function(_0x5ec60c){if(_0x5ec60c){return _0x5185de['sendStatus'](_0x559ecd);}return _0x5185de['status'](_0x559ecd)[_0xfd6f('0x1b')]();};}function respondWithResult(_0x510adb,_0x312a38){_0x312a38=_0x312a38||0xc8;return function(_0x4169f7){if(_0x4169f7){return _0x510adb['status'](_0x312a38)[_0xfd6f('0x1c')](_0x4169f7);}};}function respondWithFilteredResult(_0x247a51,_0x134151){return function(_0x5202f5){if(_0x5202f5){var _0x161795=typeof _0x134151[_0xfd6f('0x1d')]===_0xfd6f('0x1e')&&typeof _0x134151[_0xfd6f('0x1f')]===_0xfd6f('0x1e');var _0x28d1f7=_0x5202f5[_0xfd6f('0x20')];var _0x5a3633=_0x161795?0x0:_0x134151[_0xfd6f('0x1d')];var _0x2e8dbf=_0x161795?_0x5202f5['count']:_0x134151[_0xfd6f('0x1d')]+_0x134151['limit'];var _0x4fd616;if(_0x2e8dbf>=_0x28d1f7){_0x2e8dbf=_0x28d1f7;_0x4fd616=0xc8;}else{_0x4fd616=0xce;}_0x247a51[_0xfd6f('0x21')](_0x4fd616);return _0x247a51[_0xfd6f('0x22')](_0xfd6f('0x23'),_0x5a3633+'-'+_0x2e8dbf+'/'+_0x28d1f7)['json'](_0x5202f5);}return null;};}function patchUpdates(_0x4e2561){return function(_0x2492ef){try{jsonpatch[_0xfd6f('0x24')](_0x2492ef,_0x4e2561,!![]);}catch(_0x49f145){return BPromise['reject'](_0x49f145);}return _0x2492ef[_0xfd6f('0x25')]();};}function saveUpdates(_0x367a5a,_0x25b23f){return function(_0x8bd20){if(_0x8bd20){return _0x8bd20[_0xfd6f('0x26')](_0x367a5a)[_0xfd6f('0x27')](function(_0xcbbfd3){return _0xcbbfd3;});}return null;};}function removeEntity(_0x5541c6,_0x363a61){return function(_0x527cb7){if(_0x527cb7){return _0x527cb7[_0xfd6f('0x28')]()['then'](function(){_0x5541c6[_0xfd6f('0x21')](0xcc)[_0xfd6f('0x1b')]();});}};}function handleEntityNotFound(_0x579971,_0x4baf41){return function(_0x1684f7){if(!_0x1684f7){_0x579971['sendStatus'](0x194);}return _0x1684f7;};}function handleError(_0x51edc6,_0x457035){_0x457035=_0x457035||0x1f4;return function(_0x3909ad){logger[_0xfd6f('0x29')](_0x3909ad[_0xfd6f('0x2a')]);if(_0x3909ad[_0xfd6f('0x2b')]){delete _0x3909ad[_0xfd6f('0x2b')];}_0x51edc6[_0xfd6f('0x21')](_0x457035)[_0xfd6f('0x2c')](_0x3909ad);};}exports[_0xfd6f('0x2d')]=function(_0x348a88,_0x5e532e){var _0x2587f9={},_0x24e139={},_0x200ce={'count':0x0,'rows':[]};var _0x3e0071=_[_0xfd6f('0x2e')](db[_0xfd6f('0x2f')]['rawAttributes'],function(_0x8d0c6b){return{'name':_0x8d0c6b[_0xfd6f('0x30')],'type':_0x8d0c6b[_0xfd6f('0x31')][_0xfd6f('0x32')]};});_0x24e139['model']=_[_0xfd6f('0x2e')](_0x3e0071,_0xfd6f('0x2b'));_0x24e139[_0xfd6f('0x33')]=_[_0xfd6f('0x34')](_0x348a88[_0xfd6f('0x33')]);_0x24e139[_0xfd6f('0x35')]=_[_0xfd6f('0x36')](_0x24e139['model'],_0x24e139['query']);_0x2587f9[_0xfd6f('0x37')]=_[_0xfd6f('0x36')](_0x24e139[_0xfd6f('0x38')],qs[_0xfd6f('0x39')](_0x348a88[_0xfd6f('0x33')]['fields']));_0x2587f9['attributes']=_0x2587f9[_0xfd6f('0x37')][_0xfd6f('0x3a')]?_0x2587f9['attributes']:_0x24e139[_0xfd6f('0x38')];if(!_0x348a88['query'][_0xfd6f('0x3b')](_0xfd6f('0x3c'))){_0x2587f9[_0xfd6f('0x1f')]=qs[_0xfd6f('0x1f')](_0x348a88[_0xfd6f('0x33')][_0xfd6f('0x1f')]);_0x2587f9[_0xfd6f('0x1d')]=qs['offset'](_0x348a88[_0xfd6f('0x33')][_0xfd6f('0x1d')]);}_0x2587f9[_0xfd6f('0x3d')]=qs[_0xfd6f('0x3e')](_0x348a88[_0xfd6f('0x33')][_0xfd6f('0x3e')]);_0x2587f9[_0xfd6f('0x3f')]=qs['filters'](_['pick'](_0x348a88[_0xfd6f('0x33')],_0x24e139[_0xfd6f('0x35')]),_0x3e0071);if(_0x348a88[_0xfd6f('0x33')]['filter']){_0x2587f9[_0xfd6f('0x3f')]=_[_0xfd6f('0x40')](_0x2587f9[_0xfd6f('0x3f')],{'$or':_[_0xfd6f('0x2e')](_0x3e0071,function(_0x259b6c){if(_0x259b6c[_0xfd6f('0x31')]!=='VIRTUAL'){var _0x4011f1={};_0x4011f1[_0x259b6c[_0xfd6f('0x2b')]]={'$like':'%'+_0x348a88[_0xfd6f('0x33')]['filter']+'%'};return _0x4011f1;}})});}_0x2587f9=_[_0xfd6f('0x40')]({},_0x2587f9,_0x348a88[_0xfd6f('0x41')]);var _0x40542b={'where':_0x2587f9[_0xfd6f('0x3f')]};return db['ChatTransferReport']['count'](_0x40542b)[_0xfd6f('0x27')](function(_0x5046c7){_0x200ce[_0xfd6f('0x20')]=_0x5046c7;if(_0x348a88[_0xfd6f('0x33')][_0xfd6f('0x42')]){_0x2587f9[_0xfd6f('0x43')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x2587f9);})[_0xfd6f('0x27')](function(_0x2677b9){_0x200ce[_0xfd6f('0x44')]=_0x2677b9;return _0x200ce;})[_0xfd6f('0x27')](respondWithFilteredResult(_0x5e532e,_0x2587f9))[_0xfd6f('0x45')](handleError(_0x5e532e,null));};exports[_0xfd6f('0x46')]=function(_0x3eb2af,_0x2a89ec){var _0x2ed6b0={'raw':!![],'where':{'id':_0x3eb2af[_0xfd6f('0x47')]['id']}},_0x5122a0={};_0x5122a0[_0xfd6f('0x38')]=_['keys'](db['ChatTransferReport'][_0xfd6f('0x48')]);_0x5122a0['query']=_[_0xfd6f('0x34')](_0x3eb2af[_0xfd6f('0x33')]);_0x5122a0[_0xfd6f('0x35')]=_[_0xfd6f('0x36')](_0x5122a0[_0xfd6f('0x38')],_0x5122a0[_0xfd6f('0x33')]);_0x2ed6b0['attributes']=_['intersection'](_0x5122a0['model'],qs[_0xfd6f('0x39')](_0x3eb2af[_0xfd6f('0x33')][_0xfd6f('0x39')]));_0x2ed6b0[_0xfd6f('0x37')]=_0x2ed6b0[_0xfd6f('0x37')][_0xfd6f('0x3a')]?_0x2ed6b0['attributes']:_0x5122a0[_0xfd6f('0x38')];if(_0x3eb2af[_0xfd6f('0x33')][_0xfd6f('0x42')]){_0x2ed6b0[_0xfd6f('0x43')]=[{'all':!![]}];}_0x2ed6b0=_['merge']({},_0x2ed6b0,_0x3eb2af[_0xfd6f('0x41')]);return db[_0xfd6f('0x2f')][_0xfd6f('0x49')](_0x2ed6b0)['then'](handleEntityNotFound(_0x2a89ec,null))[_0xfd6f('0x27')](respondWithResult(_0x2a89ec,null))[_0xfd6f('0x45')](handleError(_0x2a89ec,null));};exports[_0xfd6f('0x4a')]=function(_0x1df252,_0x28ef06){return db[_0xfd6f('0x2f')][_0xfd6f('0x4a')](_0x1df252['body'],{})[_0xfd6f('0x27')](respondWithResult(_0x28ef06,0xc9))[_0xfd6f('0x45')](handleError(_0x28ef06,null));};exports[_0xfd6f('0x26')]=function(_0x4c0fcb,_0x288cb6){if(_0x4c0fcb[_0xfd6f('0x4b')]['id']){delete _0x4c0fcb[_0xfd6f('0x4b')]['id'];}return db[_0xfd6f('0x2f')][_0xfd6f('0x49')]({'where':{'id':_0x4c0fcb[_0xfd6f('0x47')]['id']}})[_0xfd6f('0x27')](handleEntityNotFound(_0x288cb6,null))[_0xfd6f('0x27')](saveUpdates(_0x4c0fcb[_0xfd6f('0x4b')],null))[_0xfd6f('0x27')](respondWithResult(_0x288cb6,null))[_0xfd6f('0x45')](handleError(_0x288cb6,null));};exports[_0xfd6f('0x28')]=function(_0x5d0328,_0x22fb78){return db[_0xfd6f('0x2f')][_0xfd6f('0x49')]({'where':{'id':_0x5d0328[_0xfd6f('0x47')]['id']}})[_0xfd6f('0x27')](handleEntityNotFound(_0x22fb78,null))[_0xfd6f('0x27')](removeEntity(_0x22fb78,null))[_0xfd6f('0x45')](handleError(_0x22fb78,null));};exports[_0xfd6f('0x4c')]=function(_0x2d3956,_0x394633){return db[_0xfd6f('0x2f')]['describe']()[_0xfd6f('0x27')](respondWithResult(_0x394633,null))[_0xfd6f('0x45')](handleError(_0x394633,null));}; \ No newline at end of file +var _0x9c7c=['../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','create','body','catch','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x119a2a,_0x52a94f){var _0x22d268=function(_0x40714c){while(--_0x40714c){_0x119a2a['push'](_0x119a2a['shift']());}};_0x22d268(++_0x52a94f);}(_0x9c7c,0x84));var _0xc9c7=function(_0x31378c,_0x19a853){_0x31378c=_0x31378c-0x0;var _0x11c9a6=_0x9c7c[_0x31378c];return _0x11c9a6;};'use strict';var emlformat=require(_0xc9c7('0x0'));var rimraf=require(_0xc9c7('0x1'));var zipdir=require(_0xc9c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9c7('0x3'));var moment=require('moment');var BPromise=require(_0xc9c7('0x4'));var Mustache=require(_0xc9c7('0x5'));var util=require(_0xc9c7('0x6'));var path=require(_0xc9c7('0x7'));var sox=require('sox');var csv=require(_0xc9c7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9c7('0x9'));var _=require(_0xc9c7('0xa'));var squel=require(_0xc9c7('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc9c7('0xc'));var Papa=require(_0xc9c7('0xd'));var Redis=require(_0xc9c7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc9c7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9c7('0x10'));var logger=require(_0xc9c7('0x11'))(_0xc9c7('0x12'));var utils=require(_0xc9c7('0x13'));var config=require(_0xc9c7('0x14'));var licenseUtil=require(_0xc9c7('0x15'));var db=require(_0xc9c7('0x16'))['db'];function respondWithStatusCode(_0x563c66,_0x2007eb){_0x2007eb=_0x2007eb||0xcc;return function(_0x1244af){if(_0x1244af){return _0x563c66['sendStatus'](_0x2007eb);}return _0x563c66[_0xc9c7('0x17')](_0x2007eb)['end']();};}function respondWithResult(_0x2420f2,_0x30142d){_0x30142d=_0x30142d||0xc8;return function(_0x371c12){if(_0x371c12){return _0x2420f2[_0xc9c7('0x17')](_0x30142d)[_0xc9c7('0x18')](_0x371c12);}};}function respondWithFilteredResult(_0xbab1d1,_0x4ea191){return function(_0x4d5a79){if(_0x4d5a79){var _0x2b3244=typeof _0x4ea191[_0xc9c7('0x19')]==='undefined'&&typeof _0x4ea191[_0xc9c7('0x1a')]===_0xc9c7('0x1b');var _0xf295cc=_0x4d5a79[_0xc9c7('0x1c')];var _0x3e1966=_0x2b3244?0x0:_0x4ea191[_0xc9c7('0x19')];var _0x526965=_0x2b3244?_0x4d5a79[_0xc9c7('0x1c')]:_0x4ea191[_0xc9c7('0x19')]+_0x4ea191[_0xc9c7('0x1a')];var _0x61f871;if(_0x526965>=_0xf295cc){_0x526965=_0xf295cc;_0x61f871=0xc8;}else{_0x61f871=0xce;}_0xbab1d1[_0xc9c7('0x17')](_0x61f871);return _0xbab1d1[_0xc9c7('0x1d')](_0xc9c7('0x1e'),_0x3e1966+'-'+_0x526965+'/'+_0xf295cc)[_0xc9c7('0x18')](_0x4d5a79);}return null;};}function patchUpdates(_0x92912e){return function(_0x2c2c74){try{jsonpatch[_0xc9c7('0x1f')](_0x2c2c74,_0x92912e,!![]);}catch(_0x2b08a8){return BPromise[_0xc9c7('0x20')](_0x2b08a8);}return _0x2c2c74[_0xc9c7('0x21')]();};}function saveUpdates(_0x47bbb4,_0x50d5a0){return function(_0x56ca34){if(_0x56ca34){return _0x56ca34[_0xc9c7('0x22')](_0x47bbb4)[_0xc9c7('0x23')](function(_0x596dc6){return _0x596dc6;});}return null;};}function removeEntity(_0x4deec1,_0x22e623){return function(_0x53659c){if(_0x53659c){return _0x53659c[_0xc9c7('0x24')]()['then'](function(){_0x4deec1[_0xc9c7('0x17')](0xcc)[_0xc9c7('0x25')]();});}};}function handleEntityNotFound(_0x168051,_0x10f202){return function(_0x1fa7af){if(!_0x1fa7af){_0x168051[_0xc9c7('0x26')](0x194);}return _0x1fa7af;};}function handleError(_0x2e897d,_0x174cb3){_0x174cb3=_0x174cb3||0x1f4;return function(_0x278987){logger['error'](_0x278987[_0xc9c7('0x27')]);if(_0x278987['name']){delete _0x278987['name'];}_0x2e897d[_0xc9c7('0x17')](_0x174cb3)['send'](_0x278987);};}exports[_0xc9c7('0x28')]=function(_0x3dfb7e,_0x5a6335){var _0x32dc9b={},_0x1389de={},_0x57fd30={'count':0x0,'rows':[]};var _0x3c3893=_[_0xc9c7('0x29')](db[_0xc9c7('0x2a')][_0xc9c7('0x2b')],function(_0x391120){return{'name':_0x391120[_0xc9c7('0x2c')],'type':_0x391120[_0xc9c7('0x2d')][_0xc9c7('0x2e')]};});_0x1389de[_0xc9c7('0x2f')]=_[_0xc9c7('0x29')](_0x3c3893,_0xc9c7('0x30'));_0x1389de[_0xc9c7('0x31')]=_['keys'](_0x3dfb7e['query']);_0x1389de[_0xc9c7('0x32')]=_[_0xc9c7('0x33')](_0x1389de[_0xc9c7('0x2f')],_0x1389de[_0xc9c7('0x31')]);_0x32dc9b[_0xc9c7('0x34')]=_[_0xc9c7('0x33')](_0x1389de[_0xc9c7('0x2f')],qs[_0xc9c7('0x35')](_0x3dfb7e[_0xc9c7('0x31')][_0xc9c7('0x35')]));_0x32dc9b['attributes']=_0x32dc9b[_0xc9c7('0x34')][_0xc9c7('0x36')]?_0x32dc9b[_0xc9c7('0x34')]:_0x1389de[_0xc9c7('0x2f')];if(!_0x3dfb7e[_0xc9c7('0x31')][_0xc9c7('0x37')](_0xc9c7('0x38'))){_0x32dc9b[_0xc9c7('0x1a')]=qs['limit'](_0x3dfb7e['query'][_0xc9c7('0x1a')]);_0x32dc9b[_0xc9c7('0x19')]=qs[_0xc9c7('0x19')](_0x3dfb7e[_0xc9c7('0x31')][_0xc9c7('0x19')]);}_0x32dc9b[_0xc9c7('0x39')]=qs[_0xc9c7('0x3a')](_0x3dfb7e[_0xc9c7('0x31')]['sort']);_0x32dc9b[_0xc9c7('0x3b')]=qs[_0xc9c7('0x32')](_[_0xc9c7('0x3c')](_0x3dfb7e[_0xc9c7('0x31')],_0x1389de[_0xc9c7('0x32')]),_0x3c3893);if(_0x3dfb7e[_0xc9c7('0x31')][_0xc9c7('0x3d')]){_0x32dc9b['where']=_[_0xc9c7('0x3e')](_0x32dc9b[_0xc9c7('0x3b')],{'$or':_['map'](_0x3c3893,function(_0x151c7d){if(_0x151c7d[_0xc9c7('0x2d')]!==_0xc9c7('0x3f')){var _0x1e85f2={};_0x1e85f2[_0x151c7d[_0xc9c7('0x30')]]={'$like':'%'+_0x3dfb7e[_0xc9c7('0x31')]['filter']+'%'};return _0x1e85f2;}})});}_0x32dc9b=_['merge']({},_0x32dc9b,_0x3dfb7e[_0xc9c7('0x40')]);var _0x1d6d27={'where':_0x32dc9b[_0xc9c7('0x3b')]};return db[_0xc9c7('0x2a')][_0xc9c7('0x1c')](_0x1d6d27)[_0xc9c7('0x23')](function(_0x275afb){_0x57fd30[_0xc9c7('0x1c')]=_0x275afb;if(_0x3dfb7e[_0xc9c7('0x31')][_0xc9c7('0x41')]){_0x32dc9b[_0xc9c7('0x42')]=[{'all':!![]}];}return db[_0xc9c7('0x2a')][_0xc9c7('0x43')](_0x32dc9b);})[_0xc9c7('0x23')](function(_0x4a09b3){_0x57fd30[_0xc9c7('0x44')]=_0x4a09b3;return _0x57fd30;})[_0xc9c7('0x23')](respondWithFilteredResult(_0x5a6335,_0x32dc9b))['catch'](handleError(_0x5a6335,null));};exports['show']=function(_0x467cb2,_0x1c2dc8){var _0x468b83={'raw':!![],'where':{'id':_0x467cb2[_0xc9c7('0x45')]['id']}},_0x26671a={};_0x26671a[_0xc9c7('0x2f')]=_[_0xc9c7('0x46')](db[_0xc9c7('0x2a')][_0xc9c7('0x2b')]);_0x26671a[_0xc9c7('0x31')]=_[_0xc9c7('0x46')](_0x467cb2[_0xc9c7('0x31')]);_0x26671a['filters']=_[_0xc9c7('0x33')](_0x26671a[_0xc9c7('0x2f')],_0x26671a['query']);_0x468b83['attributes']=_[_0xc9c7('0x33')](_0x26671a['model'],qs[_0xc9c7('0x35')](_0x467cb2[_0xc9c7('0x31')]['fields']));_0x468b83[_0xc9c7('0x34')]=_0x468b83[_0xc9c7('0x34')][_0xc9c7('0x36')]?_0x468b83[_0xc9c7('0x34')]:_0x26671a[_0xc9c7('0x2f')];if(_0x467cb2[_0xc9c7('0x31')]['includeAll']){_0x468b83[_0xc9c7('0x42')]=[{'all':!![]}];}_0x468b83=_[_0xc9c7('0x3e')]({},_0x468b83,_0x467cb2[_0xc9c7('0x40')]);return db['ChatTransferReport'][_0xc9c7('0x47')](_0x468b83)[_0xc9c7('0x23')](handleEntityNotFound(_0x1c2dc8,null))[_0xc9c7('0x23')](respondWithResult(_0x1c2dc8,null))['catch'](handleError(_0x1c2dc8,null));};exports[_0xc9c7('0x48')]=function(_0x3bf36a,_0x6b75b){return db[_0xc9c7('0x2a')][_0xc9c7('0x48')](_0x3bf36a[_0xc9c7('0x49')],{})['then'](respondWithResult(_0x6b75b,0xc9))[_0xc9c7('0x4a')](handleError(_0x6b75b,null));};exports[_0xc9c7('0x22')]=function(_0x54c9a8,_0x295507){if(_0x54c9a8[_0xc9c7('0x49')]['id']){delete _0x54c9a8[_0xc9c7('0x49')]['id'];}return db[_0xc9c7('0x2a')]['find']({'where':{'id':_0x54c9a8[_0xc9c7('0x45')]['id']}})[_0xc9c7('0x23')](handleEntityNotFound(_0x295507,null))[_0xc9c7('0x23')](saveUpdates(_0x54c9a8[_0xc9c7('0x49')],null))[_0xc9c7('0x23')](respondWithResult(_0x295507,null))[_0xc9c7('0x4a')](handleError(_0x295507,null));};exports[_0xc9c7('0x24')]=function(_0x23153a,_0x122348){return db[_0xc9c7('0x2a')][_0xc9c7('0x47')]({'where':{'id':_0x23153a['params']['id']}})['then'](handleEntityNotFound(_0x122348,null))['then'](removeEntity(_0x122348,null))['catch'](handleError(_0x122348,null));};exports[_0xc9c7('0x4b')]=function(_0x6f1cd8,_0x333c2b){return db['ChatTransferReport'][_0xc9c7('0x4b')]()['then'](respondWithResult(_0x333c2b,null))[_0xc9c7('0x4a')](handleError(_0x333c2b,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 85482b2..433fc6e 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 _0x8d74=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport'];(function(_0x11ac40,_0x375c63){var _0x45b544=function(_0x1e41c2){while(--_0x1e41c2){_0x11ac40['push'](_0x11ac40['shift']());}};_0x45b544(++_0x375c63);}(_0x8d74,0x152));var _0x48d7=function(_0x34b63b,_0x3601e0){_0x34b63b=_0x34b63b-0x0;var _0x3fc0b9=_0x8d74[_0x34b63b];return _0x3fc0b9;};'use strict';var _=require(_0x48d7('0x0'));var util=require(_0x48d7('0x1'));var logger=require(_0x48d7('0x2'))(_0x48d7('0x3'));var moment=require(_0x48d7('0x4'));var BPromise=require(_0x48d7('0x5'));var rp=require(_0x48d7('0x6'));var fs=require('fs');var path=require(_0x48d7('0x7'));var rimraf=require(_0x48d7('0x8'));var config=require(_0x48d7('0x9'));var attributes=require(_0x48d7('0xa'));module[_0x48d7('0xb')]=function(_0x5af388,_0x3ee7d6){return _0x5af388[_0x48d7('0xc')](_0x48d7('0xd'),attributes,{'tableName':_0x48d7('0xe'),'paranoid':![],'indexes':[{'name':_0x48d7('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e8d=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x46b22a,_0x5bf83a){var _0x44c2e8=function(_0x21b6fc){while(--_0x21b6fc){_0x46b22a['push'](_0x46b22a['shift']());}};_0x44c2e8(++_0x5bf83a);}(_0x9e8d,0x103));var _0xd9e8=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x9e8d[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xd9e8('0x0'));var util=require(_0xd9e8('0x1'));var logger=require(_0xd9e8('0x2'))(_0xd9e8('0x3'));var moment=require(_0xd9e8('0x4'));var BPromise=require(_0xd9e8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9e8('0x6'));var rimraf=require(_0xd9e8('0x7'));var config=require(_0xd9e8('0x8'));var attributes=require(_0xd9e8('0x9'));module[_0xd9e8('0xa')]=function(_0x2467ce,_0x587b5c){return _0x2467ce[_0xd9e8('0xb')](_0xd9e8('0xc'),attributes,{'tableName':_0xd9e8('0xd'),'paranoid':![],'indexes':[{'name':_0xd9e8('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 43c57d8..cda7073 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 _0xa9ff=['jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x52af14,_0x450fa2){var _0x5068b0=function(_0x18a797){while(--_0x18a797){_0x52af14['push'](_0x52af14['shift']());}};_0x5068b0(++_0x450fa2);}(_0xa9ff,0x1f2));var _0xfa9f=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0xa9ff[_0x46a38b];return _0x346e75;};'use strict';var _=require(_0xfa9f('0x0'));var util=require(_0xfa9f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfa9f('0x2'));var fs=require('fs');var Redis=require(_0xfa9f('0x3'));var db=require(_0xfa9f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfa9f('0x5'));var config=require('../../config/environment');var jayson=require(_0xfa9f('0x6'));var client=jayson[_0xfa9f('0x7')][_0xfa9f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b5c3b,_0x42c426,_0x48cdc7){return new BPromise(function(_0x2ceefa,_0xdc8fb4){return client[_0xfa9f('0x9')](_0x2b5c3b,_0x48cdc7)[_0xfa9f('0xa')](function(_0x32d9fe){logger[_0xfa9f('0xb')](_0xfa9f('0xc'),_0x42c426,_0xfa9f('0xd'));logger[_0xfa9f('0xe')](_0xfa9f('0xf'),_0x42c426,'request\x20sent',JSON[_0xfa9f('0x10')](_0x32d9fe));if(_0x32d9fe['error']){if(_0x32d9fe['error'][_0xfa9f('0x11')]===0x1f4){logger[_0xfa9f('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x42c426,_0x32d9fe['error'][_0xfa9f('0x13')]);return _0xdc8fb4(_0x32d9fe[_0xfa9f('0x12')][_0xfa9f('0x13')]);}logger[_0xfa9f('0x12')](_0xfa9f('0xc'),_0x42c426,_0x32d9fe['error'][_0xfa9f('0x13')]);return _0x2ceefa(_0x32d9fe[_0xfa9f('0x12')][_0xfa9f('0x13')]);}else{logger[_0xfa9f('0xb')](_0xfa9f('0xc'),_0x42c426,'request\x20sent');_0x2ceefa(_0x32d9fe[_0xfa9f('0x14')][_0xfa9f('0x13')]);}})['catch'](function(_0x432c62){logger['error'](_0xfa9f('0xc'),_0x42c426,_0x432c62);_0xdc8fb4(_0x432c62);});});} \ No newline at end of file +var _0x8460=['request\x20sent','debug','error','message','ChatTransferReport,\x20%s,\x20%s','result','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x59e023,_0x4af4bf){var _0x4f561b=function(_0x11053b){while(--_0x11053b){_0x59e023['push'](_0x59e023['shift']());}};_0x4f561b(++_0x4af4bf);}(_0x8460,0x1da));var _0x0846=function(_0x5a1e40,_0x172118){_0x5a1e40=_0x5a1e40-0x0;var _0x494eec=_0x8460[_0x5a1e40];return _0x494eec;};'use strict';var _=require(_0x0846('0x0'));var util=require(_0x0846('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0846('0x2'));var fs=require('fs');var Redis=require(_0x0846('0x3'));var db=require(_0x0846('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0846('0x5'));var config=require(_0x0846('0x6'));var jayson=require(_0x0846('0x7'));var client=jayson[_0x0846('0x8')][_0x0846('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ab178,_0x208dd0,_0x194509){return new BPromise(function(_0x4f8c19,_0x4c3cf4){return client[_0x0846('0xa')](_0x4ab178,_0x194509)['then'](function(_0x134140){logger[_0x0846('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x208dd0,_0x0846('0xc'));logger[_0x0846('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x208dd0,'request\x20sent',JSON['stringify'](_0x134140));if(_0x134140[_0x0846('0xe')]){if(_0x134140[_0x0846('0xe')]['code']===0x1f4){logger[_0x0846('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x208dd0,_0x134140[_0x0846('0xe')][_0x0846('0xf')]);return _0x4c3cf4(_0x134140[_0x0846('0xe')][_0x0846('0xf')]);}logger[_0x0846('0xe')](_0x0846('0x10'),_0x208dd0,_0x134140[_0x0846('0xe')][_0x0846('0xf')]);return _0x4f8c19(_0x134140['error'][_0x0846('0xf')]);}else{logger[_0x0846('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x208dd0,_0x0846('0xc'));_0x4f8c19(_0x134140[_0x0846('0x11')][_0x0846('0xf')]);}})['catch'](function(_0x160404){logger[_0x0846('0xe')](_0x0846('0x10'),_0x208dd0,_0x160404);_0x4c3cf4(_0x160404);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 4d50dff..337eb1e 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 _0x038e=['express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','util','path'];(function(_0x1559ca,_0x3242fc){var _0x603f00=function(_0x3134cc){while(--_0x3134cc){_0x1559ca['push'](_0x1559ca['shift']());}};_0x603f00(++_0x3242fc);}(_0x038e,0x1ce));var _0xe038=function(_0x38ae35,_0x16c078){_0x38ae35=_0x38ae35-0x0;var _0x4b3e8f=_0x038e[_0x38ae35];return _0x4b3e8f;};'use strict';var multer=require('multer');var util=require(_0xe038('0x0'));var path=require(_0xe038('0x1'));var timeout=require('connect-timeout');var express=require(_0xe038('0x2'));var router=express[_0xe038('0x3')]();var fs_extra=require(_0xe038('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe038('0x5'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0xe038('0x6')]('/',auth[_0xe038('0x7')](),controller[_0xe038('0x8')]);router['get'](_0xe038('0x9'),auth[_0xe038('0x7')](),controller[_0xe038('0xa')]);router[_0xe038('0x6')](_0xe038('0xb'),auth[_0xe038('0x7')](),controller[_0xe038('0xc')]);router[_0xe038('0xd')]('/',auth[_0xe038('0x7')](),controller['create']);router[_0xe038('0xe')](_0xe038('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xe038('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xea3c=['/describe','describe','/:id','show','post','isAuthenticated','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','index'];(function(_0x560623,_0x5c748a){var _0x2a9089=function(_0x565d41){while(--_0x565d41){_0x560623['push'](_0x560623['shift']());}};_0x2a9089(++_0x5c748a);}(_0xea3c,0x1ad));var _0xcea3=function(_0x319493,_0x7b9841){_0x319493=_0x319493-0x0;var _0x12e05a=_0xea3c[_0x319493];return _0x12e05a;};'use strict';var multer=require(_0xcea3('0x0'));var util=require(_0xcea3('0x1'));var path=require(_0xcea3('0x2'));var timeout=require(_0xcea3('0x3'));var express=require(_0xcea3('0x4'));var router=express[_0xcea3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcea3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcea3('0x7'));var controller=require(_0xcea3('0x8'));router[_0xcea3('0x9')]('/',auth['isAuthenticated'](),controller[_0xcea3('0xa')]);router['get'](_0xcea3('0xb'),auth['isAuthenticated'](),controller[_0xcea3('0xc')]);router[_0xcea3('0x9')](_0xcea3('0xd'),auth['isAuthenticated'](),controller[_0xcea3('0xe')]);router[_0xcea3('0xf')]('/',auth[_0xcea3('0x10')](),controller[_0xcea3('0x11')]);router[_0xcea3('0x12')](_0xcea3('0xd'),auth[_0xcea3('0x10')](),controller[_0xcea3('0x13')]);router[_0xcea3('0x14')](_0xcea3('0xd'),auth[_0xcea3('0x10')](),controller['destroy']);module[_0xcea3('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 5a609a8..9a80fd8 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 _0x2745=['TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','INTEGER','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','CHAT','System','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us'];(function(_0x243b84,_0x57739f){var _0x57ee61=function(_0x28db02){while(--_0x28db02){_0x243b84['push'](_0x243b84['shift']());}};_0x57ee61(++_0x57739f);}(_0x2745,0x13a));var _0x5274=function(_0x59d25d,_0x56affa){_0x59d25d=_0x59d25d-0x0;var _0x2f9508=_0x2745[_0x59d25d];return _0x2f9508;};'use strict';var Sequelize=require(_0x5274('0x0'));var rs=require(_0x5274('0x1'));module[_0x5274('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x5274('0x3')],'allowNull':![],'unique':_0x5274('0x4')},'description':{'type':Sequelize[_0x5274('0x3')]},'mapKey':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0x5')},'key':{'type':Sequelize[_0x5274('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x6')},'customerAlias':{'type':Sequelize[_0x5274('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5274('0x3')],'allowNull':![],'defaultValue':_0x5274('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5274('0x3')],'allowNull':![],'defaultValue':_0x5274('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5274('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5274('0x3')]},'animation':{'type':Sequelize[_0x5274('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5274('0x9')](_0x5274('0xa'),_0x5274('0xb')),'defaultValue':_0x5274('0xa')},'header_online':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0xc')},'start_chat_button':{'type':Sequelize[_0x5274('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0xe')},'download_transcript':{'type':Sequelize[_0x5274('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5274('0xf')]},'closingQuestion':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x5274('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0x13')},'closingMessage':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0xd')},'skipMessageButton':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0x16')},'ratingType':{'type':Sequelize[_0x5274('0x9')]('star','thumb'),'defaultValue':_0x5274('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x5274('0x18')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x5274('0xf')],'defaultValue':function(){return JSON[_0x5274('0x19')]({'items':[{'type':_0x5274('0x1a'),'variable':null,'config':{'placeholder':_0x5274('0x1b'),'type':_0x5274('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x5274('0x1a'),'props':{'title':_0x5274('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x5274('0x5'),'type':_0x5274('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5274('0x1d')](_0x5274('0x1e'))?JSON[_0x5274('0x1f')](this[_0x5274('0x1d')](_0x5274('0x1e'))):{};},'set':function(_0x3577ea){return this['setDataValue'](_0x5274('0x1e'),JSON[_0x5274('0x19')](_0x3577ea));}},'offlineForm':{'type':Sequelize[_0x5274('0xf')],'defaultValue':function(){return JSON[_0x5274('0x19')]({'items':[{'type':_0x5274('0x1a'),'props':{'title':_0x5274('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x5274('0x5'),'type':_0x5274('0x5')},'variable':null},{'type':_0x5274('0x20'),'config':{'placeholder':_0x5274('0x21')},'props':{'title':_0x5274('0x21'),'helpText':_0x5274('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x5274('0x1d')](_0x5274('0x23'))?JSON[_0x5274('0x1f')](this['getDataValue']('offlineForm')):{};},'set':function(_0x5dd222){return this[_0x5274('0x24')](_0x5274('0x23'),JSON[_0x5274('0x19')](_0x5dd222));}},'token':{'type':Sequelize[_0x5274('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x5274('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x5274('0x3')]},'forwardOffline':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x5274('0x3')]},'waitingTitle':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x26')},'offlineMessageBody':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x5274('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0x15')},'sendUnmanaged':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5274('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5274('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x5274('0x18')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x2a')},'messagesAlignment':{'type':Sequelize[_0x5274('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x5274('0x3')]},'customerAvatar':{'type':Sequelize[_0x5274('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5274('0x18')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x5274('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5274('0x18')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5274('0x18')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x2b')},'systemAvatar':{'type':Sequelize[_0x5274('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2d9b49){if(!_0x2d9b49)this['setDataValue'](_0x5274('0x2c'),null);this[_0x5274('0x24')](_0x5274('0x2d'),_0x2d9b49);}},'vidaooEscalation':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5274('0x3')]},'vidaooTopic':{'type':Sequelize[_0x5274('0x3')],'allowNull':![],'defaultValue':_0x5274('0x2e')},'vidaooNote':{'type':Sequelize[_0x5274('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x5274('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x5274('0xf')]}}; \ No newline at end of file +var _0xb7de=['stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','INTEGER'];(function(_0xe3d5cb,_0x16d4c5){var _0x4f60f1=function(_0x641e89){while(--_0x641e89){_0xe3d5cb['push'](_0xe3d5cb['shift']());}};_0x4f60f1(++_0x16d4c5);}(_0xb7de,0x70));var _0xeb7d=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xb7de[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0xeb7d('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xeb7d('0x1')],'allowNull':![],'unique':_0xeb7d('0x2')},'description':{'type':Sequelize[_0xeb7d('0x1')]},'mapKey':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x3')},'mapKeyOffline':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x3')},'key':{'type':Sequelize[_0xeb7d('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x4')},'customerAlias':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xeb7d('0x1')],'allowNull':![],'defaultValue':_0xeb7d('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xeb7d('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xeb7d('0x1')]},'animation':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xeb7d('0x8')]('rounded',_0xeb7d('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0xa')},'header_offline':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0xb')},'download_transcript':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0xc')},'defaultWhiteLabel':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xeb7d('0xd')]},'closingQuestion':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0xe')},'noteTitle':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xeb7d('0xf')},'closingMessageButton':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x10')},'conditionAgreement':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0xeb7d('0x11'),_0xeb7d('0x12')),'defaultValue':_0xeb7d('0x11')},'ratingStarsNumber':{'type':Sequelize[_0xeb7d('0x13')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xeb7d('0xd')],'defaultValue':function(){return JSON[_0xeb7d('0x14')]({'items':[{'type':_0xeb7d('0x15'),'variable':null,'config':{'placeholder':_0xeb7d('0x16'),'type':_0xeb7d('0x17'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xeb7d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xeb7d('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xeb7d('0x18')](_0xeb7d('0x19'))?JSON[_0xeb7d('0x1a')](this[_0xeb7d('0x18')](_0xeb7d('0x19'))):{};},'set':function(_0x127e47){return this[_0xeb7d('0x1b')](_0xeb7d('0x19'),JSON['stringify'](_0x127e47));}},'offlineForm':{'type':Sequelize[_0xeb7d('0xd')],'defaultValue':function(){return JSON[_0xeb7d('0x14')]({'items':[{'type':_0xeb7d('0x15'),'props':{'title':_0xeb7d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xeb7d('0x3'),'type':_0xeb7d('0x3')},'variable':null},{'type':_0xeb7d('0x1c'),'config':{'placeholder':_0xeb7d('0x1d')},'props':{'title':_0xeb7d('0x1d'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xeb7d('0x18')](_0xeb7d('0x1e'))?JSON[_0xeb7d('0x1a')](this['getDataValue'](_0xeb7d('0x1e'))):{};},'set':function(_0x1a4163){return this['setDataValue'](_0xeb7d('0x1e'),JSON[_0xeb7d('0x14')](_0x1a4163));}},'token':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xeb7d('0x1')]},'forwardOffline':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xeb7d('0x1')]},'waitingTitle':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x1f')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xeb7d('0x20')},'offlineMessageBody':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x21')},'enableUnmanagedNote':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x22')},'skipUnmanaged':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xeb7d('0xd')]},'showAgentAvatar':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xeb7d('0xd')],'defaultValue':function(){return _0xeb7d('0x23');}},'notificationSound':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x24')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x25')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xeb7d('0x13')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xeb7d('0x1')],'allowNull':![],'defaultValue':_0xeb7d('0x26'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeb7d('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xeb7d('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x27')},'systemAvatar':{'type':Sequelize[_0xeb7d('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeb7d('0x13')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![],'comment':_0xeb7d('0x28'),'set':function(_0x39bee7){if(!_0x39bee7)this[_0xeb7d('0x1b')](_0xeb7d('0x29'),null);this[_0xeb7d('0x1b')](_0xeb7d('0x2a'),_0x39bee7);}},'vidaooEscalation':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xeb7d('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':function(){return _0xeb7d('0x2b');}},'vidaooMetadata':{'type':Sequelize[_0xeb7d('0xd')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xeb7d('0xd')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index a66ae81..73ad0ec 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 _0x00b8=['ids','addAnswer','getAnswers','CannedAnswer','options','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','getResult','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','DESC','ChatApplication','Applications','List','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','format','version','unknown','%s\x20%s','device','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','notify','offline','files','no\x20available\x20attributes','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','user','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','addInteraction','omit','getInteractions','Owner','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','readFileSync','remote','x-real-ip','remoteAddress','replace','labelText','color_button','backgroundColor','IntervalId','addApplications','transaction','Transaction','READ_COMMITTED','findAndCountAll','getApplications','chatProactiveAction','online','false','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','Attachments','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','get','ChatWebsites','stack','name','send','Pause','ChatWebsite','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','rows','catch','params','mandatoryDispositionPause','keys','includeAll','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','describe','addDisposition','ChatWebsiteId','Disposition','findOne','findAll','removeDispositions'];(function(_0x2c3b7f,_0x4e448a){var _0x22d6b6=function(_0x179b98){while(--_0x179b98){_0x2c3b7f['push'](_0x2c3b7f['shift']());}};_0x22d6b6(++_0x4e448a);}(_0x00b8,0x1e0));var _0x800b=function(_0x16a25e,_0x500f8c){_0x16a25e=_0x16a25e-0x0;var _0x342478=_0x00b8[_0x16a25e];return _0x342478;};'use strict';var BPromise=require(_0x800b('0x0'));var Mustache=require(_0x800b('0x1'));var util=require(_0x800b('0x2'));var path=require(_0x800b('0x3'));var ejs=require(_0x800b('0x4'));var fs=require('fs');var fs_extra=require(_0x800b('0x5'));var _=require('lodash');var querystring=require(_0x800b('0x6'));var Redis=require('ioredis');var qs=require(_0x800b('0x7'));var logger=require(_0x800b('0x8'))(_0x800b('0x9'));var config=require(_0x800b('0xa'));var db=require(_0x800b('0xb'))['db'];config[_0x800b('0xc')]=_[_0x800b('0xd')](config[_0x800b('0xc')],{'host':_0x800b('0xe'),'port':0x18eb});var socket=require(_0x800b('0xf'))(new Redis(config[_0x800b('0xc')]));require(_0x800b('0x10'))[_0x800b('0x11')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x800b('0x12'));var client=jayson[_0x800b('0x13')][_0x800b('0x14')]({'port':0x232c});var client9002=jayson[_0x800b('0x13')]['http']({'port':0x232a});var client9003=jayson[_0x800b('0x13')][_0x800b('0x14')]({'port':0x232b});var client9001=jayson[_0x800b('0x13')][_0x800b('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x355ed8,_0x471316,_0x363ec0,_0x1512e8){return new BPromise(function(_0x1d7520,_0x1e6964){var _0x149764=_0x1512e8||client;return _0x149764[_0x800b('0x15')](_0x355ed8,_0x363ec0)[_0x800b('0x16')](function(_0x1c4546){logger[_0x800b('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x471316,_0x800b('0x18'));logger[_0x800b('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x471316,_0x800b('0x18'),JSON[_0x800b('0x1a')](_0x1c4546));if(_0x1c4546[_0x800b('0x1b')]){if(_0x1c4546[_0x800b('0x1b')][_0x800b('0x1c')]===0x1f4){logger[_0x800b('0x1b')](_0x800b('0x1d'),_0x471316,_0x1c4546['error'][_0x800b('0x1e')]);return _0x1e6964(_0x1c4546[_0x800b('0x1b')]['message']);}logger[_0x800b('0x1b')](_0x800b('0x1d'),_0x471316,_0x1c4546[_0x800b('0x1b')][_0x800b('0x1e')]);return _0x1d7520(_0x1c4546['error'][_0x800b('0x1e')]);}else{logger[_0x800b('0x17')](_0x800b('0x1d'),_0x471316,_0x800b('0x18'));_0x1d7520(_0x1c4546['result']['message']);}})['catch'](function(_0x78dbff){logger[_0x800b('0x1b')](_0x800b('0x1d'),_0x471316,_0x78dbff);_0x1e6964(_0x78dbff);});});}function respondWithStatusCode(_0x4611e5,_0x1d1bd7){_0x1d1bd7=_0x1d1bd7||0xcc;return function(_0x279dd9){if(_0x279dd9){return _0x4611e5[_0x800b('0x1f')](_0x1d1bd7);}return _0x4611e5[_0x800b('0x20')](_0x1d1bd7)[_0x800b('0x21')]();};}function respondWithResult(_0xcde909,_0x2713f4){_0x2713f4=_0x2713f4||0xc8;return function(_0x252c96){if(_0x252c96){return _0xcde909['status'](_0x2713f4)[_0x800b('0x22')](_0x252c96);}};}function respondWithFilteredResult(_0x52d4cd,_0x1aa519){return function(_0x59ea97){if(_0x59ea97){var _0xa0e7e5=typeof _0x1aa519[_0x800b('0x23')]===_0x800b('0x24')&&typeof _0x1aa519['limit']===_0x800b('0x24');var _0x3fa609=_0x59ea97[_0x800b('0x25')];var _0x26e23b=_0xa0e7e5?0x0:_0x1aa519[_0x800b('0x23')];var _0x447b2e=_0xa0e7e5?_0x59ea97[_0x800b('0x25')]:_0x1aa519['offset']+_0x1aa519['limit'];var _0x5dcd20;if(_0x447b2e>=_0x3fa609){_0x447b2e=_0x3fa609;_0x5dcd20=0xc8;}else{_0x5dcd20=0xce;}_0x52d4cd['status'](_0x5dcd20);return _0x52d4cd[_0x800b('0x26')](_0x800b('0x27'),_0x26e23b+'-'+_0x447b2e+'/'+_0x3fa609)['json'](_0x59ea97);}return null;};}function saveUpdates(_0x5d560a){return function(_0x3e3d8e){if(_0x3e3d8e){return _0x3e3d8e[_0x800b('0x28')](_0x5d560a)[_0x800b('0x16')](function(_0x1cad56){return _0x1cad56;});}return null;};}function removeEntity(_0x1a57bd){return function(_0x1072c2){if(_0x1072c2){return _0x1072c2[_0x800b('0x29')]()['then'](function(){var _0x43d0f9=_0x1072c2[_0x800b('0x2a')]({'plain':!![]});var _0x5dd92e=_0x800b('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x5dd92e,'resourceId':_0x43d0f9['id']}})[_0x800b('0x16')](function(){return _0x1072c2;});})[_0x800b('0x16')](function(){_0x1a57bd[_0x800b('0x20')](0xcc)[_0x800b('0x21')]();});}};}function handleEntityNotFound(_0x2c72d0){return function(_0x5445c1){if(!_0x5445c1){_0x2c72d0[_0x800b('0x1f')](0x194);}return _0x5445c1;};}function handleError(_0x2afe8c,_0x408d9a){_0x408d9a=_0x408d9a||0x1f4;return function(_0x238108){logger[_0x800b('0x1b')](_0x238108[_0x800b('0x2c')]);if(_0x238108[_0x800b('0x2d')]){delete _0x238108[_0x800b('0x2d')];}_0x2afe8c[_0x800b('0x20')](_0x408d9a)[_0x800b('0x2e')](_0x238108);};}exports['index']=function(_0x48d20b,_0x55dc33){var _0x3e24a4={'include':[{'model':db[_0x800b('0x2f')],'as':'mandatoryDispositionPause'}]},_0x357fa={},_0x94f0eb={'count':0x0,'rows':[]};var _0xf462d3=_['map'](db[_0x800b('0x30')][_0x800b('0x31')],function(_0x780563){return{'name':_0x780563[_0x800b('0x32')],'type':_0x780563['type'][_0x800b('0x33')]};});_0x357fa[_0x800b('0x34')]=_['map'](_0xf462d3,_0x800b('0x2d'));_0x357fa[_0x800b('0x35')]=_['keys'](_0x48d20b[_0x800b('0x35')]);_0x357fa[_0x800b('0x36')]=_[_0x800b('0x37')](_0x357fa[_0x800b('0x34')],_0x357fa[_0x800b('0x35')]);_0x3e24a4['attributes']=_[_0x800b('0x37')](_0x357fa[_0x800b('0x34')],qs[_0x800b('0x38')](_0x48d20b[_0x800b('0x35')]['fields']));_0x3e24a4[_0x800b('0x39')]=_0x3e24a4[_0x800b('0x39')][_0x800b('0x3a')]?_0x3e24a4['attributes']:_0x357fa[_0x800b('0x34')];if(!_0x48d20b[_0x800b('0x35')][_0x800b('0x3b')](_0x800b('0x3c'))){_0x3e24a4[_0x800b('0x3d')]=qs[_0x800b('0x3d')](_0x48d20b['query'][_0x800b('0x3d')]);_0x3e24a4['offset']=qs['offset'](_0x48d20b[_0x800b('0x35')][_0x800b('0x23')]);}_0x3e24a4[_0x800b('0x3e')]=qs[_0x800b('0x3f')](_0x48d20b[_0x800b('0x35')][_0x800b('0x3f')]);_0x3e24a4[_0x800b('0x40')]=qs['filters'](_[_0x800b('0x41')](_0x48d20b[_0x800b('0x35')],_0x357fa[_0x800b('0x36')]),_0xf462d3);if(_0x48d20b[_0x800b('0x35')][_0x800b('0x42')]){_0x3e24a4[_0x800b('0x40')]=_[_0x800b('0x43')](_0x3e24a4[_0x800b('0x40')],{'$or':_[_0x800b('0x44')](_0xf462d3,function(_0x410599){if(_0x410599[_0x800b('0x45')]!==_0x800b('0x46')){var _0x4e7db2={};_0x4e7db2[_0x410599[_0x800b('0x2d')]]={'$like':'%'+_0x48d20b[_0x800b('0x35')][_0x800b('0x42')]+'%'};return _0x4e7db2;}})});}_0x3e24a4=_['merge']({},_0x3e24a4,_0x48d20b['options']);var _0x24cd57={'where':_0x3e24a4[_0x800b('0x40')]};return db['ChatWebsite'][_0x800b('0x25')](_0x24cd57)[_0x800b('0x16')](function(_0x5c2f40){_0x94f0eb[_0x800b('0x25')]=_0x5c2f40;if(_0x48d20b[_0x800b('0x35')]['includeAll']){_0x3e24a4['include']=[{'all':!![]}];}return db[_0x800b('0x30')]['findAll'](_0x3e24a4);})['then'](function(_0x2482a4){_0x94f0eb[_0x800b('0x47')]=_0x2482a4;return _0x94f0eb;})[_0x800b('0x16')](respondWithFilteredResult(_0x55dc33,_0x3e24a4))[_0x800b('0x48')](handleError(_0x55dc33,null));};exports['show']=function(_0x5b89d9,_0x3837fc){var _0x2b799f={'raw':![],'where':{'id':_0x5b89d9[_0x800b('0x49')]['id']},'include':[{'model':db[_0x800b('0x2f')],'as':_0x800b('0x4a')}]},_0x314d45={};_0x314d45[_0x800b('0x34')]=_[_0x800b('0x4b')](db['ChatWebsite']['rawAttributes']);_0x314d45['query']=_['keys'](_0x5b89d9['query']);_0x314d45[_0x800b('0x36')]=_[_0x800b('0x37')](_0x314d45[_0x800b('0x34')],_0x314d45[_0x800b('0x35')]);_0x2b799f[_0x800b('0x39')]=_[_0x800b('0x37')](_0x314d45[_0x800b('0x34')],qs[_0x800b('0x38')](_0x5b89d9[_0x800b('0x35')][_0x800b('0x38')]));_0x2b799f['attributes']=_0x2b799f[_0x800b('0x39')][_0x800b('0x3a')]?_0x2b799f[_0x800b('0x39')]:_0x314d45['model'];if(_0x5b89d9[_0x800b('0x35')][_0x800b('0x4c')]){_0x2b799f[_0x800b('0x4d')]=[{'all':!![]}];}_0x2b799f=_[_0x800b('0x43')]({},_0x2b799f,_0x5b89d9['options']);return db['ChatWebsite']['find'](_0x2b799f)['then'](handleEntityNotFound(_0x3837fc,null))[_0x800b('0x16')](respondWithResult(_0x3837fc,null))['catch'](handleError(_0x3837fc,null));};exports['create']=function(_0x432e2d,_0x5e8ae3){return db[_0x800b('0x30')][_0x800b('0x4e')](_0x432e2d[_0x800b('0x4f')],{})['then'](function(_0x5d02c5){var _0x3aa513=_0x432e2d['user'][_0x800b('0x2a')]({'plain':!![]});if(!_0x3aa513)throw new Error(_0x800b('0x50'));if(_0x3aa513[_0x800b('0x51')]==='user'){var _0x2b13fd=_0x5d02c5['get']({'plain':!![]});var _0x56ca50=_0x800b('0x2b');return db['UserProfileSection'][_0x800b('0x52')]({'where':{'name':_0x56ca50,'userProfileId':_0x3aa513['userProfileId']},'raw':!![]})[_0x800b('0x16')](function(_0x2e7d96){if(_0x2e7d96&&_0x2e7d96[_0x800b('0x53')]===0x0){return db[_0x800b('0x54')][_0x800b('0x4e')]({'name':_0x2b13fd[_0x800b('0x2d')],'resourceId':_0x2b13fd['id'],'type':_0x2e7d96[_0x800b('0x2d')],'sectionId':_0x2e7d96['id']},{})['then'](function(){return _0x5d02c5;});}else{return _0x5d02c5;}})[_0x800b('0x48')](function(_0x29dd3d){logger[_0x800b('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29dd3d);throw _0x29dd3d;});}return _0x5d02c5;})[_0x800b('0x16')](respondWithResult(_0x5e8ae3,0xc9))[_0x800b('0x48')](handleError(_0x5e8ae3,null));};exports[_0x800b('0x28')]=function(_0x5dea28,_0x33311c){if(_0x5dea28[_0x800b('0x4f')]['id']){delete _0x5dea28[_0x800b('0x4f')]['id'];}return db[_0x800b('0x30')]['find']({'where':{'id':_0x5dea28['params']['id']},'include':[{'model':db['Pause'],'as':_0x800b('0x4a')}]})[_0x800b('0x16')](handleEntityNotFound(_0x33311c,null))[_0x800b('0x16')](saveUpdates(_0x5dea28[_0x800b('0x4f')],null))[_0x800b('0x16')](respondWithResult(_0x33311c,null))[_0x800b('0x48')](handleError(_0x33311c,null));};exports[_0x800b('0x29')]=function(_0x4e3d93,_0xbc2ae){return db[_0x800b('0x30')][_0x800b('0x52')]({'where':{'id':_0x4e3d93[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0xbc2ae,null))['then'](removeEntity(_0xbc2ae,null))['catch'](handleError(_0xbc2ae,null));};exports[_0x800b('0x55')]=function(_0x514c0d,_0x3cc55e){return db[_0x800b('0x30')][_0x800b('0x55')]()[_0x800b('0x16')](respondWithResult(_0x3cc55e,null))['catch'](handleError(_0x3cc55e,null));};exports[_0x800b('0x56')]=function(_0x1cce6b,_0x18fc10){if(_0x1cce6b[_0x800b('0x4f')]['id']){delete _0x1cce6b[_0x800b('0x4f')]['id'];}return db[_0x800b('0x30')][_0x800b('0x52')]({'where':{'id':_0x1cce6b['params']['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x18fc10,null))[_0x800b('0x16')](function(_0x18d4d8){if(_0x18d4d8){_0x1cce6b[_0x800b('0x4f')][_0x800b('0x57')]=_0x18d4d8['id'];return db[_0x800b('0x58')][_0x800b('0x4e')](_0x1cce6b[_0x800b('0x4f')]);}})[_0x800b('0x16')](respondWithResult(_0x18fc10,null))[_0x800b('0x48')](handleError(_0x18fc10,null));};exports['getDispositions']=function(_0x5a12da,_0xe5f554){var _0x5a7041={'raw':![],'where':{}};var _0x4c2ec6={};var _0x1b20a1={'count':0x0,'rows':[]};return db[_0x800b('0x30')][_0x800b('0x59')]({'where':{'id':_0x5a12da[_0x800b('0x49')]['id']}})['then'](handleEntityNotFound(_0xe5f554,null))[_0x800b('0x16')](function(_0x4291a5){if(_0x4291a5){_0x4c2ec6[_0x800b('0x34')]=_[_0x800b('0x4b')](db['Disposition']['rawAttributes']);_0x4c2ec6['query']=_[_0x800b('0x4b')](_0x5a12da[_0x800b('0x35')]);_0x4c2ec6[_0x800b('0x36')]=_[_0x800b('0x37')](_0x4c2ec6['model'],_0x4c2ec6[_0x800b('0x35')]);_0x5a7041[_0x800b('0x39')]=_[_0x800b('0x37')](_0x4c2ec6['model'],qs[_0x800b('0x38')](_0x5a12da[_0x800b('0x35')][_0x800b('0x38')]));_0x5a7041[_0x800b('0x39')]=_0x5a7041[_0x800b('0x39')][_0x800b('0x3a')]?_0x5a7041[_0x800b('0x39')]:_0x4c2ec6[_0x800b('0x34')];if(!_0x5a12da[_0x800b('0x35')][_0x800b('0x3b')](_0x800b('0x3c'))){_0x5a7041[_0x800b('0x3d')]=qs['limit'](_0x5a12da[_0x800b('0x35')]['limit']);_0x5a7041['offset']=qs[_0x800b('0x23')](_0x5a12da[_0x800b('0x35')][_0x800b('0x23')]);}_0x5a7041[_0x800b('0x3e')]=qs[_0x800b('0x3f')](_0x5a12da[_0x800b('0x35')][_0x800b('0x3f')]);_0x5a7041[_0x800b('0x40')]=qs[_0x800b('0x36')](_[_0x800b('0x41')](_0x5a12da[_0x800b('0x35')],_0x4c2ec6['filters']));_0x5a7041[_0x800b('0x40')][_0x800b('0x57')]=_0x4291a5['id'];if(_0x5a12da[_0x800b('0x35')]['filter']){_0x5a7041['where']=_['merge'](_0x5a7041['where'],{'$or':_[_0x800b('0x44')](_0x5a7041['attributes'],function(_0x3dbd96){var _0x1723e4={};_0x1723e4[_0x3dbd96]={'$like':'%'+_0x5a12da[_0x800b('0x35')][_0x800b('0x42')]+'%'};return _0x1723e4;})});}_0x5a7041=_[_0x800b('0x43')]({},_0x5a7041,_0x5a12da['options']);return db[_0x800b('0x58')]['count']({'where':_0x5a7041[_0x800b('0x40')]})[_0x800b('0x16')](function(_0x27ae64){_0x1b20a1[_0x800b('0x25')]=_0x27ae64;if(_0x5a12da['query'][_0x800b('0x4c')]){_0x5a7041[_0x800b('0x4d')]=[{'all':!![]}];}return db[_0x800b('0x58')][_0x800b('0x5a')](_0x5a7041);})[_0x800b('0x16')](function(_0x131a55){_0x1b20a1[_0x800b('0x47')]=_0x131a55;return _0x1b20a1;});}})[_0x800b('0x16')](respondWithFilteredResult(_0xe5f554,_0x5a7041))[_0x800b('0x48')](handleError(_0xe5f554,null));};exports[_0x800b('0x5b')]=function(_0x85c124,_0x24545e){return db[_0x800b('0x30')][_0x800b('0x52')]({'where':{'id':_0x85c124[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x24545e,null))[_0x800b('0x16')](function(_0xe9497c){if(_0xe9497c){return _0xe9497c[_0x800b('0x5b')](_0x85c124['query'][_0x800b('0x5c')]);}})[_0x800b('0x16')](respondWithStatusCode(_0x24545e,null))[_0x800b('0x48')](handleError(_0x24545e,null));};exports[_0x800b('0x5d')]=function(_0xa90ce1,_0x1d906b){if(_0xa90ce1[_0x800b('0x4f')]['id']){delete _0xa90ce1['body']['id'];}return db['ChatWebsite'][_0x800b('0x52')]({'where':{'id':_0xa90ce1[_0x800b('0x49')]['id']}})['then'](handleEntityNotFound(_0x1d906b,null))[_0x800b('0x16')](function(_0x393cb7){if(_0x393cb7){_0xa90ce1['body'][_0x800b('0x57')]=_0x393cb7['id'];return db['CannedAnswer'][_0x800b('0x4e')](_0xa90ce1[_0x800b('0x4f')]);}})[_0x800b('0x16')](respondWithResult(_0x1d906b,null))[_0x800b('0x48')](handleError(_0x1d906b,null));};exports[_0x800b('0x5e')]=function(_0x1c1dda,_0x586e27){var _0x26e3fa={'raw':![],'where':{}};var _0x2495ea={};var _0x2caff3={'count':0x0,'rows':[]};return db[_0x800b('0x30')]['findOne']({'where':{'id':_0x1c1dda[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x586e27,null))['then'](function(_0x5adb08){if(_0x5adb08){_0x2495ea[_0x800b('0x34')]=_['keys'](db[_0x800b('0x5f')][_0x800b('0x31')]);_0x2495ea[_0x800b('0x35')]=_[_0x800b('0x4b')](_0x1c1dda[_0x800b('0x35')]);_0x2495ea[_0x800b('0x36')]=_[_0x800b('0x37')](_0x2495ea[_0x800b('0x34')],_0x2495ea['query']);_0x26e3fa['attributes']=_[_0x800b('0x37')](_0x2495ea[_0x800b('0x34')],qs['fields'](_0x1c1dda[_0x800b('0x35')][_0x800b('0x38')]));_0x26e3fa[_0x800b('0x39')]=_0x26e3fa[_0x800b('0x39')]['length']?_0x26e3fa[_0x800b('0x39')]:_0x2495ea[_0x800b('0x34')];if(!_0x1c1dda[_0x800b('0x35')][_0x800b('0x3b')](_0x800b('0x3c'))){_0x26e3fa['limit']=qs['limit'](_0x1c1dda[_0x800b('0x35')][_0x800b('0x3d')]);_0x26e3fa['offset']=qs[_0x800b('0x23')](_0x1c1dda[_0x800b('0x35')][_0x800b('0x23')]);}_0x26e3fa[_0x800b('0x3e')]=qs[_0x800b('0x3f')](_0x1c1dda['query']['sort']);_0x26e3fa[_0x800b('0x40')]=qs['filters'](_['pick'](_0x1c1dda['query'],_0x2495ea[_0x800b('0x36')]));_0x26e3fa['where'][_0x800b('0x57')]=_0x5adb08['id'];if(_0x1c1dda[_0x800b('0x35')][_0x800b('0x42')]){_0x26e3fa['where']=_['merge'](_0x26e3fa[_0x800b('0x40')],{'$or':_[_0x800b('0x44')](_0x26e3fa['attributes'],function(_0x16014b){var _0x2a6e8d={};_0x2a6e8d[_0x16014b]={'$like':'%'+_0x1c1dda['query'][_0x800b('0x42')]+'%'};return _0x2a6e8d;})});}_0x26e3fa=_[_0x800b('0x43')]({},_0x26e3fa,_0x1c1dda[_0x800b('0x60')]);return db[_0x800b('0x5f')][_0x800b('0x25')]({'where':_0x26e3fa[_0x800b('0x40')]})[_0x800b('0x16')](function(_0x250ae7){_0x2caff3[_0x800b('0x25')]=_0x250ae7;if(_0x1c1dda[_0x800b('0x35')]['includeAll']){_0x26e3fa[_0x800b('0x4d')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x26e3fa);})[_0x800b('0x16')](function(_0x14f713){_0x2caff3['rows']=_0x14f713;return _0x2caff3;});}})[_0x800b('0x16')](respondWithFilteredResult(_0x586e27,_0x26e3fa))[_0x800b('0x48')](handleError(_0x586e27,null));};exports[_0x800b('0x61')]=function(_0x231a0d,_0x558bcb){return db['ChatWebsite'][_0x800b('0x52')]({'where':{'id':_0x231a0d['params']['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x558bcb,null))[_0x800b('0x16')](function(_0x3081dd){if(_0x3081dd){return _0x3081dd['removeAnswers'](_0x231a0d[_0x800b('0x35')]['ids']);}})[_0x800b('0x16')](respondWithStatusCode(_0x558bcb,null))[_0x800b('0x48')](handleError(_0x558bcb,null));};exports['addLogo']=function(_0x3df3c3,_0x804ef7){_0x3df3c3['body'][_0x800b('0x62')]=_0x3df3c3[_0x800b('0x63')][_0x800b('0x64')];return db[_0x800b('0x30')]['find']({'where':{'id':_0x3df3c3[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x804ef7,null))[_0x800b('0x16')](saveUpdates(_0x3df3c3[_0x800b('0x4f')],null))[_0x800b('0x16')](respondWithResult(_0x804ef7,null))[_0x800b('0x48')](handleError(_0x804ef7,null));};exports[_0x800b('0x65')]=function(_0x48d37f,_0x3f654b){_0x48d37f[_0x800b('0x4f')][_0x800b('0x66')]=_0x48d37f[_0x800b('0x63')][_0x800b('0x64')];return db[_0x800b('0x30')][_0x800b('0x52')]({'where':{'id':_0x48d37f[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x3f654b,null))['then'](saveUpdates(_0x48d37f[_0x800b('0x4f')],null))[_0x800b('0x16')](respondWithResult(_0x3f654b,null))['catch'](handleError(_0x3f654b,null));};exports[_0x800b('0x67')]=function(_0xd53d86,_0xc111d3){_0xd53d86['body']['customerAvatar']=_0xd53d86[_0x800b('0x63')]['filename'];return db[_0x800b('0x30')][_0x800b('0x52')]({'where':{'id':_0xd53d86[_0x800b('0x49')]['id']}})['then'](handleEntityNotFound(_0xc111d3,null))[_0x800b('0x16')](saveUpdates(_0xd53d86['body'],null))[_0x800b('0x16')](respondWithResult(_0xc111d3,null))[_0x800b('0x48')](handleError(_0xc111d3,null));};exports[_0x800b('0x68')]=function(_0x387cef,_0x38e24e){_0x387cef[_0x800b('0x4f')][_0x800b('0x69')]=_0x387cef[_0x800b('0x63')]['filename'];return db[_0x800b('0x30')]['find']({'where':{'id':_0x387cef['params']['id']}})['then'](handleEntityNotFound(_0x38e24e,null))[_0x800b('0x16')](saveUpdates(_0x387cef[_0x800b('0x4f')],null))[_0x800b('0x16')](respondWithResult(_0x38e24e,null))[_0x800b('0x48')](handleError(_0x38e24e,null));};exports['getLogo']=function(_0x49208c,_0x7c31eb){var _0x5cf398=path['join'](config[_0x800b('0x6a')],_0x800b('0x6b'));var _0x513b8a={'where':{'id':_0x49208c[_0x800b('0x49')]['id']},'attributes':['id',_0x800b('0x62')],'raw':!![]};var _0x50e641=![];return require(_0x800b('0x6c'))[_0x800b('0x6d')]()['then'](function(_0x46c24d){if(_0x46c24d){_0x50e641=_0x46c24d['custom'];}})[_0x800b('0x16')](function(){return db['ChatWebsite'][_0x800b('0x52')](_0x513b8a);})[_0x800b('0x16')](handleEntityNotFound(_0x7c31eb,null))[_0x800b('0x16')](function(_0x22baf4){if(_0x22baf4){if(!_[_0x800b('0x6e')](_0x22baf4[_0x800b('0x62')])){if(fs['existsSync'](path[_0x800b('0x6f')](config[_0x800b('0x6a')],'server/files/images/logos/',_0x22baf4[_0x800b('0x62')]))&&_0x50e641){_0x5cf398=path['join'](config[_0x800b('0x6a')],_0x800b('0x70'),_0x22baf4['sitepic']);}}return _0x7c31eb[_0x800b('0x71')](_0x5cf398);}})[_0x800b('0x48')](handleError(_0x7c31eb,null));};exports['getAvatar']=function(_0x84b1ef,_0x18c365){var _0x3cfe61=path[_0x800b('0x6f')](config['root'],_0x800b('0x72'));var _0x2ead07={'where':{'id':_0x84b1ef[_0x800b('0x49')]['id']},'attributes':['id',_0x800b('0x66')],'raw':!![]};return db['ChatWebsite'][_0x800b('0x52')](_0x2ead07)[_0x800b('0x16')](handleEntityNotFound(_0x18c365,null))['then'](function(_0x4dc27b){if(_0x4dc27b){if(!_[_0x800b('0x6e')](_0x4dc27b[_0x800b('0x66')])){if(fs['existsSync'](path['join'](config[_0x800b('0x6a')],_0x800b('0x73'),_0x4dc27b['agentAvatar']))){_0x3cfe61=path[_0x800b('0x6f')](config['root'],_0x800b('0x73'),_0x4dc27b['agentAvatar']);}}return _0x18c365[_0x800b('0x71')](_0x3cfe61);}})[_0x800b('0x48')](handleError(_0x18c365,null));};exports[_0x800b('0x74')]=function(_0x506d0d,_0x1b0503){var _0x24c25a=path[_0x800b('0x6f')](config[_0x800b('0x6a')],_0x800b('0x75'));var _0x9068a2={'where':{'id':_0x506d0d[_0x800b('0x49')]['id']},'attributes':['id',_0x800b('0x76'),_0x800b('0x77')],'raw':!![]};return db['ChatWebsite'][_0x800b('0x52')](_0x9068a2)[_0x800b('0x16')](handleEntityNotFound(_0x1b0503,null))[_0x800b('0x16')](function(_0x62c5c6){if(_0x62c5c6){if(!_[_0x800b('0x6e')](_0x62c5c6[_0x800b('0x76')])){if(fs[_0x800b('0x78')](path[_0x800b('0x6f')](config[_0x800b('0x6a')],'server/files/images/avatars/',_0x62c5c6['customerAvatar']))&&_0x62c5c6[_0x800b('0x77')]){_0x24c25a=path[_0x800b('0x6f')](config[_0x800b('0x6a')],_0x800b('0x73'),_0x62c5c6[_0x800b('0x76')]);}}return _0x1b0503[_0x800b('0x71')](_0x24c25a);}})['catch'](handleError(_0x1b0503,null));};exports[_0x800b('0x79')]=function(_0x211ac,_0x150e42){var _0x537fb7=path['join'](config[_0x800b('0x6a')],_0x800b('0x7a'));var _0x38c053={'where':{'id':_0x211ac[_0x800b('0x49')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x800b('0x30')]['find'](_0x38c053)['then'](handleEntityNotFound(_0x150e42,null))[_0x800b('0x16')](function(_0x1bc8e1){if(_0x1bc8e1){if(!_[_0x800b('0x6e')](_0x1bc8e1['systemAvatar'])){if(fs[_0x800b('0x78')](path[_0x800b('0x6f')](config['root'],_0x800b('0x73'),_0x1bc8e1['systemAvatar']))){_0x537fb7=path[_0x800b('0x6f')](config['root'],_0x800b('0x73'),_0x1bc8e1[_0x800b('0x69')]);}}return _0x150e42[_0x800b('0x71')](_0x537fb7);}})[_0x800b('0x48')](handleError(_0x150e42,null));};exports['notify']=function(_0x271716,_0x281807){var _0x7e8e95=require(_0x800b('0x7b'));var _0x4afd16=new _0x7e8e95();var _0x6f6ac=_0x4afd16[_0x800b('0x7c')](_0x271716[_0x800b('0x7d')]['user-agent'])[_0x800b('0x7e')]();var _0x3c8349={'body':_0x271716[_0x800b('0x4f')],'channel':'chat'};var _0x8f246c=[];var _0x5d949e=[];var _0x1e9505={};var _0x1aa349=![];return db[_0x800b('0x7f')][_0x800b('0x55')]()['then'](function(_0x21ea27){if(!_0x21ea27){throw new db[(_0x800b('0x80'))][(_0x800b('0x81'))]('no\x20available\x20attributes');}_0x8f246c=_[_0x800b('0x82')](_[_0x800b('0x4b')](_0x21ea27),[_0x800b('0x83'),_0x800b('0x84')]);_0x5d949e=_[_0x800b('0x82')](_[_0x800b('0x4b')](_0x21ea27),[_0x800b('0x83'),'updatedAt',_0x800b('0x85'),_0x800b('0x86')]);if(_0x271716[_0x800b('0x4f')]['id']){delete _0x271716[_0x800b('0x4f')]['id'];}if(_[_0x800b('0x6e')](_0x271716[_0x800b('0x4f')]['from'])){throw new db[(_0x800b('0x80'))][(_0x800b('0x81'))](_0x800b('0x87'));}if(_[_0x800b('0x6e')](_0x271716[_0x800b('0x4f')]['body'])||_0x271716[_0x800b('0x4f')][_0x800b('0x4f')]===''){throw new db[(_0x800b('0x80'))][(_0x800b('0x81'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x800b('0x6e')](_0x271716[_0x800b('0x4f')][_0x800b('0x88')])){throw new db[(_0x800b('0x80'))][(_0x800b('0x81'))](_0x800b('0x89')+_0x5d949e);}if(!_['includes'](_0x5d949e,_0x271716[_0x800b('0x4f')][_0x800b('0x88')])){throw new db[(_0x800b('0x80'))][(_0x800b('0x81'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5d949e);}_0x1e9505[_0x271716['body'][_0x800b('0x88')]]=_0x271716[_0x800b('0x4f')][_0x800b('0x8a')];})['then'](function(){return db[_0x800b('0x30')]['find']({'where':{'id':_0x271716['params']['id']},'include':[{'model':db[_0x800b('0x8b')],'as':'List','include':[{'model':db[_0x800b('0x7f')],'as':_0x800b('0x8c'),'where':_0x1e9505,'limit':0x1,'order':[[_0x800b('0x84'),_0x800b('0x8d')]]}]},{'model':db[_0x800b('0x8e')],'as':_0x800b('0x8f')}]});})[_0x800b('0x16')](handleEntityNotFound(_0x281807,null))[_0x800b('0x16')](function(_0x4d0812){if(_0x4d0812&&_0x4d0812[_0x800b('0x90')]){_0x3c8349[_0x800b('0x91')]=_0x4d0812;_0x3c8349[_0x800b('0x92')]=_0x4d0812[_0x800b('0x8f')];_0x3c8349[_0x800b('0x93')]=_0x4d0812[_0x800b('0x90')];_0x3c8349['applications']=_[_0x800b('0x94')](_0x3c8349[_0x800b('0x92')],[_0x800b('0x95')],[_0x800b('0x96')]);if(_0x3c8349['account'][_0x800b('0x8f')]){delete _0x3c8349['account']['Applications'];}if(_0x3c8349[_0x800b('0x91')][_0x800b('0x90')]&&_0x3c8349[_0x800b('0x91')]['List'][_0x800b('0x8c')][_0x800b('0x3a')]){return _0x3c8349[_0x800b('0x91')]['List'][_0x800b('0x8c')][0x0];}var _0x3c4705=_[_0x800b('0xd')](_0x271716[_0x800b('0x4f')],{'firstName':_0x271716[_0x800b('0x4f')][_0x800b('0x8a')],'ListId':_0x4d0812[_0x800b('0x86')]});_0x3c4705[_0x271716[_0x800b('0x4f')][_0x800b('0x88')]]=_0x271716[_0x800b('0x4f')][_0x800b('0x8a')];return db[_0x800b('0x7f')][_0x800b('0x4e')](_0x3c4705,{'fields':_0x8f246c,'raw':!![]});}})[_0x800b('0x16')](handleEntityNotFound(_0x281807,null))[_0x800b('0x16')](function(_0x54ae6d){_0x3c8349[_0x800b('0x97')]=_0x54ae6d;var _0x268e0a=_0x271716[_0x800b('0x4f')][_0x800b('0x98')];if(_0x271716[_0x800b('0x7d')][_0x800b('0x99')]){_0x268e0a=_0x271716[_0x800b('0x7d')][_0x800b('0x99')];}else if(_0x271716[_0x800b('0x7d')][_0x800b('0x9a')]){_0x268e0a=_['first'](_0x271716[_0x800b('0x7d')]['x-forwarded-for']['split'](','));}if(_0x54ae6d){var _0xb696d4={'ContactId':_0x54ae6d['id'],'ChatWebsiteId':_0x271716[_0x800b('0x49')]['id'],'from':(_0x54ae6d[_0x800b('0x9b')]||'')+'\x20'+(_0x54ae6d[_0x800b('0x9c')]||''),'customerIp':_0x268e0a,'customerPort':_0x271716[_0x800b('0x7d')][_0x800b('0x9d')]?_0x271716[_0x800b('0x7d')][_0x800b('0x9d')]:null,'referer':_0x271716[_0x800b('0x4f')][_0x800b('0x9e')],'browserName':_0x6f6ac[_0x800b('0x9f')][_0x800b('0x2d')]&&_0x6f6ac[_0x800b('0x9f')]['version']?util[_0x800b('0xa0')]('%s\x20%s',_0x6f6ac['browser'][_0x800b('0x2d')],_0x6f6ac['browser'][_0x800b('0xa1')]):'unknown','browserVersion':_0x6f6ac[_0x800b('0x9f')]['version']||_0x800b('0xa2'),'osName':util[_0x800b('0xa0')](_0x800b('0xa3'),_0x6f6ac['os'][_0x800b('0x2d')],_0x6f6ac['os'][_0x800b('0xa1')]),'osVersion':_0x6f6ac['os'][_0x800b('0xa1')],'deviceModel':_0x6f6ac[_0x800b('0xa4')]['model']&&_0x6f6ac[_0x800b('0xa4')][_0x800b('0xa5')]?util[_0x800b('0xa0')]('%s\x20%s\x20%s',_0x6f6ac['device']['model'],_0x6f6ac[_0x800b('0xa4')][_0x800b('0xa5')],_0x6f6ac['device'][_0x800b('0x45')]):null,'deviceVendor':_0x6f6ac[_0x800b('0xa4')][_0x800b('0xa5')],'deviceType':_0x6f6ac[_0x800b('0xa4')][_0x800b('0x45')],'formData':JSON[_0x800b('0x1a')](_0x271716['body'])};var _0x5dc1a3={'ChatWebsiteId':_0x271716[_0x800b('0x49')]['id'],'closed':![]};if(_0x271716[_0x800b('0x4f')][_0x800b('0xa6')]){_0x5dc1a3[_0x800b('0xa6')]=_0x271716[_0x800b('0x4f')][_0x800b('0xa6')];return db['ChatInteraction'][_0x800b('0x52')]({'where':_0x5dc1a3})[_0x800b('0x16')](function(_0x468c6b){if(_0x468c6b){return[_0x468c6b,![]];}_0xb696d4['threadId']=_0x271716[_0x800b('0x4f')][_0x800b('0xa6')];_0xb696d4['externalUrl']=_0x271716['body'][_0x800b('0xa7')];return db[_0x800b('0xa8')][_0x800b('0x4e')](_0xb696d4)['then'](function(_0x39b323){return[_0x39b323,!![]];});});}_0x5dc1a3[_0x800b('0xa9')]=_0x54ae6d['id'];if(_0x271716['body']['interaction']&&_0x271716[_0x800b('0x4f')][_0x800b('0xaa')]['id']){_0x5dc1a3['id']=_0x271716[_0x800b('0x4f')][_0x800b('0xaa')]['id'];return db[_0x800b('0xa8')]['find']({'where':_0x5dc1a3})[_0x800b('0x16')](function(_0x5217d7){if(_0x5217d7){return[_0x5217d7,![]];}return db[_0x800b('0xa8')][_0x800b('0x4e')](_0xb696d4)[_0x800b('0x16')](function(_0x1f58e4){return[_0x1f58e4,!![]];});});}return db[_0x800b('0xa8')][_0x800b('0x4e')](_0xb696d4)[_0x800b('0x16')](function(_0x4b12b4){return[_0x4b12b4,!![]];});}})[_0x800b('0xab')](function(_0x4e2b1c,_0x6ede9f){if(_0x4e2b1c){_0x1aa349=_0x6ede9f;if(!_0x6ede9f){var _0x221634={'from':(_0x3c8349[_0x800b('0x97')]['firstName']||'')+'\x20'+(_0x3c8349[_0x800b('0x97')][_0x800b('0x9c')]||'')};if(_0x271716[_0x800b('0x4f')][_0x800b('0xa6')]&&_0x271716[_0x800b('0x4f')][_0x800b('0xac')]&&_0x271716[_0x800b('0x4f')]['threadId']!=_0x271716[_0x800b('0x4f')][_0x800b('0xac')]){_0x221634[_0x800b('0xa6')]=_0x271716[_0x800b('0x4f')][_0x800b('0xac')];}return _0x4e2b1c[_0x800b('0x28')](_0x221634);}else{return _0x4e2b1c;}}})[_0x800b('0x16')](function(_0x41a1c7){_0x3c8349[_0x800b('0xaa')]=_0x41a1c7['get']({'plain':!![]});_0x3c8349[_0x800b('0xaa')][_0x800b('0xad')]=_0x1aa349;if(_0x3c8349[_0x800b('0xaa')]['created']){if(_0x3c8349['account'][_0x800b('0xae')]){_0x3c8349[_0x800b('0x92')][_0x800b('0xaf')]({'id':0x0,'priority':_0x3c8349[_0x800b('0x92')][_0x800b('0x3a')]+0x1,'app':'close','appdata':_0x800b('0xb0'),'interval':_0x800b('0xb1')});}}return db['ChatMessage'][_0x800b('0x4e')]({'body':_0x271716[_0x800b('0x4f')][_0x800b('0x4f')],'ChatWebsiteId':_0x271716[_0x800b('0x49')]['id'],'ChatInteractionId':_0x41a1c7['id'],'direction':'in','ContactId':_0x3c8349[_0x800b('0x97')]['id'],'AttachmentId':_0x271716[_0x800b('0x4f')][_0x800b('0xb2')]});})[_0x800b('0x16')](function(_0x2d2a15){_0x3c8349['message']=_0x2d2a15;if(_0x3c8349[_0x800b('0xaa')][_0x800b('0xb3')]){return db[_0x800b('0xb4')][_0x800b('0x52')]({'attributes':['id',_0x800b('0x2d')],'where':{'id':_0x3c8349[_0x800b('0xaa')]['UserId']}})[_0x800b('0x16')](function(_0x3fd231){if(_0x3fd231){_0x3c8349[_0x800b('0x92')][_0x800b('0xb5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3fd231['name']+','+(_0x3c8349[_0x800b('0x91')][_0x800b('0xb6')]||0xa),'interval':_0x800b('0xb1')});_0x3c8349[_0x800b('0xb7')]=!![];}return respondWithRpcPromise(_0x800b('0xb8'),'startRouting',_0x3c8349);});}return respondWithRpcPromise(_0x800b('0xb8'),'startRouting',_0x3c8349);})[_0x800b('0x16')](function(_0x1feef3){respondWithRpcPromise(_0x800b('0xb9'),'EventManager',{'event':_0x800b('0xba'),'message':_0x1feef3},client9002);return _0x1feef3;})[_0x800b('0x16')](respondWithResult(_0x281807,null))['catch'](handleError(_0x281807,null));};exports[_0x800b('0xbb')]=function(_0x4b680c,_0x366fe9){var _0x10b52d,_0x53cc76,_0x56f939;var _0x46ce6f=[];var _0x5accf8={};var _0x27a628=_0x4b680c[_0x800b('0xbc')]||[];var _0xe92df1=[];var _0x3554cb;return db[_0x800b('0x7f')][_0x800b('0x55')]()['then'](function(_0xf50179){if(!_0xf50179){throw new db['Sequelize'][(_0x800b('0x81'))](_0x800b('0xbd'));}_0x46ce6f=_[_0x800b('0x82')](_[_0x800b('0x4b')](_0xf50179),[_0x800b('0x83'),'updatedAt','CompanyId',_0x800b('0x86')]);if(_0x4b680c[_0x800b('0x4f')]['id']){delete _0x4b680c[_0x800b('0x4f')]['id'];}if(_[_0x800b('0x6e')](_0x4b680c[_0x800b('0x4f')]['from'])){throw _0x366fe9['status'](0x1f4)[_0x800b('0x2e')](new db[(_0x800b('0x80'))][(_0x800b('0x81'))](_0x800b('0x87')));}if(_[_0x800b('0x6e')](_0x4b680c[_0x800b('0x4f')][_0x800b('0x4f')])||_0x4b680c[_0x800b('0x4f')][_0x800b('0x4f')]===''){throw _0x366fe9[_0x800b('0x20')](0x1f4)[_0x800b('0x2e')](new db[(_0x800b('0x80'))]['ValidationError'](_0x800b('0xbe')));}if(_[_0x800b('0x6e')](_0x4b680c[_0x800b('0x4f')]['mapKeyOffline'])){throw _0x366fe9[_0x800b('0x20')](0x1f4)[_0x800b('0x2e')](new db[(_0x800b('0x80'))][(_0x800b('0x81'))](_0x800b('0xbf')+_0x46ce6f));}if(!_[_0x800b('0xc0')](_0x46ce6f,_0x4b680c[_0x800b('0x4f')][_0x800b('0xc1')])){throw _0x366fe9[_0x800b('0x20')](0x1f4)[_0x800b('0x2e')](new db['Sequelize'][(_0x800b('0x81'))](_0x800b('0xc2')+_0x46ce6f));}_0x5accf8[_0x4b680c[_0x800b('0x4f')][_0x800b('0xc1')]]=_0x4b680c[_0x800b('0x4f')][_0x800b('0x8a')];})[_0x800b('0x16')](function(){return db[_0x800b('0x30')]['find']({'where':{'id':_0x4b680c[_0x800b('0x49')]['id']},'include':[{'model':db[_0x800b('0x8b')],'as':_0x800b('0x90')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x800b('0x16')](handleEntityNotFound(_0x366fe9,null))[_0x800b('0x16')](function(_0x2a282c){if(_0x2a282c&&_0x2a282c[_0x800b('0x90')]){_0x53cc76=_0x2a282c;var _0x3971d9=_['defaults'](_0x4b680c['body'],{'firstName':_0x4b680c['body'][_0x800b('0x8a')],'phone':_0x4b680c[_0x800b('0x4f')][_0x800b('0x8a')],'ListId':_0x2a282c[_0x800b('0x86')]});_0x3971d9[_0x4b680c[_0x800b('0x4f')]['mapKeyOffline']]=_0x4b680c[_0x800b('0x4f')][_0x800b('0x8a')];return db[_0x800b('0x7f')][_0x800b('0xc3')]({'where':_0x5accf8,'defaults':_0x3971d9});}})['spread'](function(_0x3b2517){if(_0x3b2517){_0x56f939=_0x3b2517;var _0x2af5b9=fs['readFileSync'](path['join'](config['root'],_0x800b('0xc4')),_0x800b('0xc5'));var _0x21c93f=ejs[_0x800b('0xc6')](_0x2af5b9,{'body':_[_0x800b('0xc7')](_0x4b680c[_0x800b('0x4f')][_0x800b('0x4f')]),'bodyTitle':_0x53cc76[_0x800b('0xc8')]});return db['ChatOfflineMessage'][_0x800b('0x4e')]({'body':_0x21c93f,'plainBody':htmlToText['fromString'](_0x21c93f),'ContactId':_0x3b2517['id'],'ChatWebsiteId':_0x53cc76['id']});}})[_0x800b('0x16')](function(_0x2a9f39){_0x3554cb=_0x2a9f39;if(_0x27a628['length']){var _0x1e05cb=_0x27a628[_0x800b('0x44')](function(_0x15bf69){return{'name':_0x15bf69[_0x800b('0xc9')],'basename':_0x15bf69[_0x800b('0x64')],'type':_0x15bf69[_0x800b('0xca')],'ChatOfflineMessageId':_0x2a9f39['id']};});_0xe92df1=_0x1e05cb[_0x800b('0x44')](_0x209c20=>{var _0xc8519c={'filename':_0x209c20[_0x800b('0x2d')],'path':path['join'](config[_0x800b('0x6a')],_0x800b('0xcb'),_0x800b('0xbc'),_0x800b('0xcc'),_0x800b('0xcd'),_0x209c20[_0x800b('0xce')])};return _0xc8519c;});if(!_0x53cc76[_0x800b('0xcf')]){return db[_0x800b('0xd0')]['transaction'](function(_0x19b1c7){return db[_0x800b('0xd1')][_0x800b('0xd2')](_0x1e05cb,{'transaction':_0x19b1c7});});}}})[_0x800b('0x16')](function(){if(_0x3554cb){_0x10b52d=_0x3554cb;return db[_0x800b('0xd3')][_0x800b('0x59')]({'where':{'active':!![]},'include':[{'model':db[_0x800b('0xd4')],'as':_0x800b('0xd5'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}})[_0x800b('0x16')](function(_0x20de10){if(_0x20de10&&_0x20de10['Smtp']&&_0x53cc76[_0x800b('0xd6')]&&_0x53cc76[_0x800b('0xd7')]){var _0x35feae=_0x20de10[_0x800b('0xd8')]();return respondWithRpcPromise('SendMail',_0x800b('0xd9'),{'account':_0x35feae,'message':{'from':util[_0x800b('0xa0')](_0x800b('0xda'),_0x20de10[_0x800b('0x2d')],_0x20de10[_0x800b('0xdb')]||_0x20de10[_0x800b('0xd5')][_0x800b('0xdc')]),'to':_0x53cc76[_0x800b('0xd7')],'subject':_0x53cc76[_0x800b('0xdd')],'html':_0x10b52d['body'],'attachments':_0xe92df1}},client9003)[_0x800b('0x16')](function(){return _0x10b52d;})[_0x800b('0x48')](function(_0x597348){logger[_0x800b('0x1b')](_0x597348);});}})[_0x800b('0x16')](function(){if(_0x53cc76&&_0x53cc76[_0x800b('0xcf')]&&_0x53cc76[_0x800b('0xde')]){var _0x3538ef=[];if(_0x27a628['length']){_0x3538ef=_0x27a628[_0x800b('0x44')](function(_0x1a5426){return{'name':_0x1a5426[_0x800b('0xc9')],'basename':_0x1a5426['filename'],'type':_0x1a5426[_0x800b('0xca')],'ChatOfflineMessageId':_0x3554cb['id']};});}var _0x37c33e;if(!_[_0x800b('0x6e')](_0x53cc76[_0x800b('0xdf')])){var _0x435b0d=_['map'](_0x4b680c[_0x800b('0x4f')],function(_0x3b5279){return _0x3b5279;});var _0x1a5c6f=_[_0x800b('0xe0')](_0x435b0d)[0x0];var _0x155b35=_[_0x800b('0xe1')](_0x1a5c6f,function(_0x460709){return _0x460709;});_0x37c33e=_0x155b35[0x1][_0x53cc76[_0x800b('0xdf')]];}var _0x895c26={'from':_0x56f939['email'],'firstName':_0x56f939[_0x800b('0x9b')],'lastName':_0x56f939[_0x800b('0x9c')],'mapKey':'email','message':{'from':_0x56f939[_0x800b('0xdb')],'to':_0x53cc76[_0x800b('0xd3')][_0x800b('0xdb')],'cc':'','subject':_['isNil'](_0x37c33e)?_0x53cc76[_0x800b('0xdd')]:_0x37c33e,'messageId':'','sentAt':new Date(),'attach':_0x3538ef[_0x800b('0x3a')],'attachments':_0x3538ef,'originChannel':'Chat','ChatWebsiteId':_0x53cc76['id'],'ChatOfflineMessageId':_0x10b52d['id'],'originTo':_0x53cc76[_0x800b('0xd3')][_0x800b('0xdb')]},'body':_0x10b52d[_0x800b('0x4f')]};var _0x106dd6={'account':{'id':_0x53cc76[_0x800b('0xde')]},'body':_0x895c26,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x800b('0xe2'),_0x800b('0xe3'),_0x106dd6,client9001)['then'](function(){return _0x10b52d;})[_0x800b('0x48')](function(_0x4c3435){logger['error'](_0x4c3435);});}return;})['then'](function(){if(_0x10b52d){return _0x10b52d;}})[_0x800b('0x16')](respondWithResult(_0x366fe9,null))[_0x800b('0x48')](function(_0x3175a7){logger[_0x800b('0x1b')]('catch',_0x3175a7);for(var _0x35d5db of _0x27a628){var _0x49f18b=path[_0x800b('0x6f')](config[_0x800b('0x6a')],'server',_0x800b('0xbc'),'attachments',_0x800b('0xcd'),_0x35d5db['filename']);fs_extra['remove'](_0x49f18b)[_0x800b('0x48')](function(_0x453c2e){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x49f18b,_0x453c2e);});}});};exports[_0x800b('0xe4')]=function(_0x35424d,_0x3c4c51){return db['ChatInteraction'][_0x800b('0x52')]({'where':{'id':_0x35424d[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x3c4c51,null))[_0x800b('0x16')](function(_0x3d823f){if(_0x3d823f){return _0x3d823f[_0x800b('0xe4')](_0x35424d[_0x800b('0x4f')][_0x800b('0x5c')],_[_0x800b('0xe5')](_0x35424d[_0x800b('0x4f')],[_0x800b('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x3c4c51,null))['catch'](handleError(_0x3c4c51,null));};exports[_0x800b('0xe6')]=function(_0x53de7f,_0x2b2ded){var _0x164164={'raw':![],'where':{}};var _0x4e1c21={};var _0x6c616={'count':0x0,'rows':[]};return db[_0x800b('0x30')]['findOne']({'where':{'id':_0x53de7f['params']['id']}})['then'](handleEntityNotFound(_0x2b2ded,null))[_0x800b('0x16')](function(_0xe674b7){if(_0xe674b7){_0x4e1c21['model']=_[_0x800b('0x4b')](db['ChatInteraction'][_0x800b('0x31')]);_0x4e1c21[_0x800b('0x35')]=_[_0x800b('0x4b')](_0x53de7f[_0x800b('0x35')]);_0x4e1c21['filters']=_[_0x800b('0x37')](_0x4e1c21[_0x800b('0x34')],_0x4e1c21[_0x800b('0x35')]);_0x164164[_0x800b('0x39')]=_[_0x800b('0x37')](_0x4e1c21[_0x800b('0x34')],qs[_0x800b('0x38')](_0x53de7f[_0x800b('0x35')][_0x800b('0x38')]));_0x164164['attributes']=_0x164164[_0x800b('0x39')][_0x800b('0x3a')]?_0x164164[_0x800b('0x39')]:_0x4e1c21[_0x800b('0x34')];if(!_0x53de7f[_0x800b('0x35')]['hasOwnProperty'](_0x800b('0x3c'))){_0x164164['limit']=qs['limit'](_0x53de7f['query'][_0x800b('0x3d')]);_0x164164['offset']=qs[_0x800b('0x23')](_0x53de7f[_0x800b('0x35')][_0x800b('0x23')]);}_0x164164[_0x800b('0x3e')]=qs[_0x800b('0x3f')](_0x53de7f[_0x800b('0x35')]['sort']);_0x164164[_0x800b('0x40')]=qs['filters'](_[_0x800b('0x41')](_0x53de7f[_0x800b('0x35')],_0x4e1c21['filters']));_0x164164[_0x800b('0x40')][_0x800b('0x57')]=_0xe674b7['id'];if(_0x53de7f[_0x800b('0x35')][_0x800b('0x42')]){_0x164164[_0x800b('0x40')]=_[_0x800b('0x43')](_0x164164[_0x800b('0x40')],{'$or':_[_0x800b('0x44')](_0x164164['attributes'],function(_0xadbc1c){var _0x57bea8={};_0x57bea8[_0xadbc1c]={'$like':'%'+_0x53de7f[_0x800b('0x35')][_0x800b('0x42')]+'%'};return _0x57bea8;})});}_0x164164=_[_0x800b('0x43')]({},_0x164164,_0x53de7f[_0x800b('0x60')]);return db[_0x800b('0xa8')]['count']({'where':_0x164164[_0x800b('0x40')]})[_0x800b('0x16')](function(_0x1d4e07){_0x6c616[_0x800b('0x25')]=_0x1d4e07;if(_0x53de7f[_0x800b('0x35')]['includeAll']){_0x164164[_0x800b('0x4d')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x800b('0xb4')],'as':_0x800b('0xe7'),'attributes':[_0x800b('0x2d'),'fullname','internal'],'required':![]},{'model':db[_0x800b('0xe8')],'as':_0x800b('0xe9'),'attributes':['id',_0x800b('0x2d'),_0x800b('0xea')],'where':_0x53de7f['query'][_0x800b('0xeb')]?{'id':_0x53de7f[_0x800b('0x35')]['tag']}:undefined,'required':_0x53de7f[_0x800b('0x35')][_0x800b('0xeb')]?!![]:![]}];}return db[_0x800b('0xa8')][_0x800b('0x5a')](_0x164164);})[_0x800b('0x16')](function(_0x11dd48){_0x6c616[_0x800b('0x47')]=_0x11dd48;return _0x6c616;});}})[_0x800b('0x16')](respondWithFilteredResult(_0x2b2ded,_0x164164))[_0x800b('0x48')](handleError(_0x2b2ded,null));};function iftimePromise(_0x31cb03,_0x537cab){return respondWithRpcPromise('Command',_0x800b('0xec'),{'command':_0x537cab[_0x800b('0xed')]?util['format'](_0x800b('0xee'),_0x31cb03[_0x800b('0xef')],_0x537cab[_0x800b('0xed')]):util[_0x800b('0xa0')](_0x800b('0xf0'),_0x31cb03[_0x800b('0xef')])},client9002)[_0x800b('0x16')](function(_0x578892){var _0x476d90=_0x578892&&_0x578892['indexOf'](_0x800b('0xf1'))>=0x0?!![]:![];logger[_0x800b('0x17')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x537cab['id'],_0x31cb03['id'],_0x31cb03['interval'],_0x476d90?_0x800b('0xf2'):_0x800b('0xf3'),_0x537cab[_0x800b('0xed')]?_0x537cab['timezone']:_0x800b('0xf4'));return _0x476d90;})['catch'](function(_0x5b51b9){logger[_0x800b('0x1b')](_0x800b('0xf5'),_0x537cab['id'],_0x31cb03['id'],_0x31cb03[_0x800b('0xef')],util[_0x800b('0xf6')](_0x5b51b9,{'showHidden':![],'depth':null}),_0x537cab['timezone']?_0x537cab[_0x800b('0xed')]:_0x800b('0xf4'));return![];});}exports[_0x800b('0xec')]=function(_0x6113f7,_0x593408){var _0x5e6064=0x0;var _0x319f5d=0x0;var _0x1c5a0f=![];var _0x5a677f;var _0x504b94;return db[_0x800b('0x30')][_0x800b('0x52')]({'where':{'id':_0x6113f7[_0x800b('0x49')]['id']},'include':[{'model':db[_0x800b('0xf7')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x800b('0xf8'),'attributes':['id',_0x800b('0xef')],'raw':!![]}]}]})[_0x800b('0x16')](handleEntityNotFound(_0x593408,null))[_0x800b('0x16')](function(_0x588e6c){if(_0x588e6c){_0x5a677f=_0x588e6c;return _0x588e6c[_0x800b('0xf9')]({'raw':!![]});}})[_0x800b('0x16')](function(_0x1db454){if(_0x5a677f){if(_0x1db454){_0x504b94=_0x1db454;}}return require(_0x800b('0x6c'))[_0x800b('0x6d')]();})['then'](function(_0x3e4e68){if(_0x3e4e68){_0x319f5d=_0x3e4e68[_0x800b('0xfa')];_0x1c5a0f=_0x3e4e68['custom'];}})[_0x800b('0x16')](function(){return db[_0x800b('0xa8')]['count']({'where':{'closed':![]}});})[_0x800b('0x16')](function(_0x1d0e75){_0x5e6064=_0x1d0e75;if(_0x319f5d&&_0x1d0e75>_0x319f5d){return db[_0x800b('0xfb')][_0x800b('0x59')]({'where':{'id':0x1}})[_0x800b('0x16')](function(_0x16e7f2){if(_0x16e7f2){_0x16e7f2[_0x800b('0xfc')](_0x800b('0xfd'));}});}})[_0x800b('0x16')](function(){if(_0x5a677f[_0x800b('0xf7')]&&_0x5a677f[_0x800b('0xf7')][_0x800b('0xf8')]){var _0x554d34=[];for(var _0x3c0888=0x0;_0x3c0888<_0x5a677f[_0x800b('0xf7')]['Intervals'][_0x800b('0x3a')];_0x3c0888++){var _0x28ed30=_0x5a677f['Interval'][_0x800b('0xf8')][_0x3c0888][_0x800b('0x2a')]({'plain':!![]});_0x554d34[_0x800b('0xaf')](iftimePromise(_0x28ed30,_0x5a677f));}return BPromise[_0x800b('0xfe')](_0x554d34)[_0x800b('0x16')](function(_0x7c427f){return _['some'](_0x7c427f);});}else{return!![];}})[_0x800b('0x16')](function(_0x12fa53){var _0x44077c=fs[_0x800b('0xff')](path[_0x800b('0x6f')](config[_0x800b('0x6a')],'server/files/chat/iframe.ejs'),'utf8');var _0x199d52={'remote':_0x5a677f[_0x800b('0x100')],'query':querystring[_0x800b('0x1a')](_[_0x800b('0x43')](_0x5a677f[_0x800b('0x2a')]({'plain':!![]}),{'customerIp':_0x6113f7[_0x800b('0x7d')][_0x800b('0x9a')]||_0x6113f7[_0x800b('0x7d')][_0x800b('0x101')]||_0x6113f7['connection'][_0x800b('0x102')]||_0x6113f7['ip'],'referer':_0x6113f7['headers'][_0x800b('0x9e')],'openedInteractions':_0x5e6064,'maxInteractions':_0x319f5d,'virtual':_0x1c5a0f[_0x800b('0xfa')],'online':_0x12fa53,'custom':_0x1c5a0f}))[_0x800b('0x103')](/'/g,'\x5c\x27')};_0x593408[_0x800b('0x2e')](ejs['render'](Mustache[_0x800b('0xc6')](_0x44077c,_0x199d52),{'proactiveActions':_0x504b94,'alignment':_0x5a677f['alignment'],'verticalAlignment':_0x5a677f['verticalAlignment'],'div_color':_0x5a677f[_0x800b('0xea')],'labelText':_0x5a677f[_0x800b('0x104')],'text_color':_0x5a677f['textColor'],'button_color':_0x5a677f[_0x800b('0x105')],'background_color':_0x5a677f[_0x800b('0x106')],'hideWhenOffline':_0x5a677f['hideWhenOffline'],'interval':_0x5a677f[_0x800b('0x107')]}));})[_0x800b('0x48')](handleError(_0x593408,null));};exports[_0x800b('0x108')]=function(_0x1f213c,_0x4d5288){var _0x353ecc=_0x1f213c['params']['id'];var _0x2e5301=_0x1f213c['body'];var _0x1fed60=0xc8;var _0x5220d7=null;return db[_0x800b('0xd0')][_0x800b('0x109')]({'isolationLevel':db[_0x800b('0xd0')][_0x800b('0x10a')]['ISOLATION_LEVELS'][_0x800b('0x10b')]},function(_0x46d4b6){return db[_0x800b('0x30')]['findOne']({'where':{'id':_0x353ecc},'transaction':_0x46d4b6})[_0x800b('0x16')](function(_0x3af3db){if(_0x3af3db){return db['ChatApplication'][_0x800b('0x29')]({'where':{'ChatWebsiteId':_0x353ecc},'transaction':_0x46d4b6})[_0x800b('0x16')](function(){var _0x19d9d7=_['map'](_0x2e5301,function(_0x3529ee){_0x3529ee[_0x800b('0x57')]=_0x353ecc;return _0x3529ee;});return db[_0x800b('0x8e')]['bulkCreate'](_0x19d9d7,{'transaction':_0x46d4b6});});}else{_0x1fed60=0x194;_0x5220d7=[];}});})[_0x800b('0x16')](function(){if(_0x1fed60!==0x194){return db[_0x800b('0x8e')][_0x800b('0x10c')]({'where':{'ChatWebsiteId':_0x353ecc},'order':_0x800b('0x95')})[_0x800b('0x16')](function(_0x1fbfe5){_0x5220d7=_0x1fbfe5;});}})[_0x800b('0x48')](function(_0x1e36f9){_0x1fed60=0x1f4;logger[_0x800b('0x1b')](_0x1e36f9[_0x800b('0x2c')]);if(_0x1e36f9[_0x800b('0x2d')]){delete _0x1e36f9['name'];}_0x5220d7=_0x1e36f9;})['finally'](function(){if(_0x5220d7===null){_0x4d5288[_0x800b('0x1f')](_0x1fed60);}else{if(_0x1fed60===0x1f4){_0x4d5288[_0x800b('0x20')](_0x1fed60)[_0x800b('0x2e')](_0x5220d7);}else{_0x4d5288['status'](_0x1fed60)[_0x800b('0x22')](_0x5220d7);}}});};exports[_0x800b('0x10d')]=function(_0xde8e90,_0xf0a301){var _0x2bbe9e={};var _0x1786b0={};var _0x341030;var _0x1472a8;return db[_0x800b('0x30')][_0x800b('0x59')]({'where':{'id':_0xde8e90[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0xf0a301,null))[_0x800b('0x16')](function(_0xf575a2){if(_0xf575a2){_0x341030=_0xf575a2;_0x1786b0['model']=_['keys'](db[_0x800b('0x8e')][_0x800b('0x31')]);_0x1786b0[_0x800b('0x35')]=_['keys'](_0xde8e90[_0x800b('0x35')]);_0x1786b0[_0x800b('0x36')]=_['intersection'](_0x1786b0[_0x800b('0x34')],_0x1786b0['query']);_0x2bbe9e[_0x800b('0x39')]=_['intersection'](_0x1786b0[_0x800b('0x34')],qs[_0x800b('0x38')](_0xde8e90[_0x800b('0x35')][_0x800b('0x38')]));_0x2bbe9e[_0x800b('0x39')]=_0x2bbe9e[_0x800b('0x39')][_0x800b('0x3a')]?_0x2bbe9e[_0x800b('0x39')]:_0x1786b0[_0x800b('0x34')];_0x2bbe9e[_0x800b('0x3e')]=qs[_0x800b('0x3f')](_0xde8e90[_0x800b('0x35')]['sort']);_0x2bbe9e['where']=qs[_0x800b('0x36')](_[_0x800b('0x41')](_0xde8e90[_0x800b('0x35')],_0x1786b0[_0x800b('0x36')]));if(_0xde8e90[_0x800b('0x35')][_0x800b('0x42')]){_0x2bbe9e[_0x800b('0x40')]=_[_0x800b('0x43')](_0x2bbe9e[_0x800b('0x40')],{'$or':_[_0x800b('0x44')](_0x2bbe9e[_0x800b('0x39')],function(_0x3a9c9c){var _0x3de1fa={};_0x3de1fa[_0x3a9c9c]={'$like':'%'+_0xde8e90[_0x800b('0x35')]['filter']+'%'};return _0x3de1fa;})});}_0x2bbe9e=_[_0x800b('0x43')]({},_0x2bbe9e,_0xde8e90[_0x800b('0x60')]);return _0x341030[_0x800b('0x10d')](_0x2bbe9e);}})[_0x800b('0x16')](function(_0x389f97){if(_0x389f97){_0x1472a8=_0x389f97[_0x800b('0x3a')];if(!_0xde8e90['query'][_0x800b('0x3b')](_0x800b('0x3c'))){_0x2bbe9e[_0x800b('0x3d')]=qs['limit'](_0xde8e90[_0x800b('0x35')][_0x800b('0x3d')]);_0x2bbe9e[_0x800b('0x23')]=qs['offset'](_0xde8e90[_0x800b('0x35')][_0x800b('0x23')]);}return _0x341030['getApplications'](_0x2bbe9e);}})[_0x800b('0x16')](function(_0x64fbd5){if(_0x64fbd5){return _0x64fbd5?{'count':_0x1472a8,'rows':_0x64fbd5}:null;}})[_0x800b('0x16')](respondWithResult(_0xf0a301,null))[_0x800b('0x48')](handleError(_0xf0a301,null));};exports['addProactiveActions']=function(_0x1e99e6,_0xbfbf63){return db[_0x800b('0x10e')]['find']({'where':{'id':_0x1e99e6[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0xbfbf63,null))['then'](function(_0x33b434){if(_0x33b434){return _0x33b434['addProactiveActions'](_0x1e99e6['body']['ids'],_[_0x800b('0xe5')](_0x1e99e6[_0x800b('0x4f')],['ids','id'])||{});}})[_0x800b('0x16')](respondWithResult(_0xbfbf63,null))['catch'](handleError(_0xbfbf63,null));};exports[_0x800b('0xf9')]=function(_0x7d912,_0x4346a5){var _0x1708f8={};var _0x47e662={};var _0x464897;var _0x588e41;return db['ChatWebsite']['findOne']({'where':{'id':_0x7d912['params']['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x4346a5,null))['then'](function(_0x31dc89){if(_0x31dc89){_0x464897=_0x31dc89;_0x47e662['model']=_[_0x800b('0x4b')](db['ChatProactiveAction']['rawAttributes']);_0x47e662['query']=_[_0x800b('0x4b')](_0x7d912[_0x800b('0x35')]);_0x47e662[_0x800b('0x36')]=_[_0x800b('0x37')](_0x47e662[_0x800b('0x34')],_0x47e662[_0x800b('0x35')]);_0x1708f8[_0x800b('0x39')]=_[_0x800b('0x37')](_0x47e662['model'],qs['fields'](_0x7d912[_0x800b('0x35')][_0x800b('0x38')]));_0x1708f8['attributes']=_0x1708f8[_0x800b('0x39')][_0x800b('0x3a')]?_0x1708f8[_0x800b('0x39')]:_0x47e662[_0x800b('0x34')];_0x1708f8['order']=qs[_0x800b('0x3f')](_0x7d912[_0x800b('0x35')][_0x800b('0x3f')]);_0x1708f8[_0x800b('0x40')]=qs['filters'](_['pick'](_0x7d912['query'],_0x47e662[_0x800b('0x36')]));if(_0x7d912['query'][_0x800b('0x42')]){_0x1708f8[_0x800b('0x40')]=_[_0x800b('0x43')](_0x1708f8[_0x800b('0x40')],{'$or':_[_0x800b('0x44')](_0x1708f8['attributes'],function(_0x41c20e){var _0x2af076={};_0x2af076[_0x41c20e]={'$like':'%'+_0x7d912[_0x800b('0x35')][_0x800b('0x42')]+'%'};return _0x2af076;})});}_0x1708f8=_[_0x800b('0x43')]({},_0x1708f8,_0x7d912[_0x800b('0x60')]);return _0x464897['getProactiveActions'](_0x1708f8);}})[_0x800b('0x16')](function(_0x1c4138){if(_0x1c4138){_0x588e41=_0x1c4138[_0x800b('0x3a')];if(!_0x7d912[_0x800b('0x35')][_0x800b('0x3b')](_0x800b('0x3c'))){_0x1708f8['limit']=qs[_0x800b('0x3d')](_0x7d912[_0x800b('0x35')]['limit']);_0x1708f8['offset']=qs[_0x800b('0x23')](_0x7d912[_0x800b('0x35')][_0x800b('0x23')]);}return _0x464897['getProactiveActions'](_0x1708f8);}})[_0x800b('0x16')](function(_0x27b428){if(_0x27b428){return _0x27b428?{'count':_0x588e41,'rows':_0x27b428}:null;}})[_0x800b('0x16')](respondWithResult(_0x4346a5,null))[_0x800b('0x48')](handleError(_0x4346a5,null));};exports['getFields']=function(_0x156804,_0x2f8253){var _0x5c5f70=_0x156804['query'][_0x800b('0x10f')]===_0x800b('0x110')?'offlineForm':_0x800b('0x111');return db['ChatWebsite'][_0x800b('0x52')]({'attributes':['id',_0x5c5f70],'where':{'id':_0x156804[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x2f8253,null))[_0x800b('0x16')](function(_0x516777){if(_0x516777){var _0x15e5f0=_0x516777[_0x5c5f70];var _0x45385d=_0x15e5f0&&_0x15e5f0[_0x800b('0x112')]?_0x15e5f0['items']:[];_0x2f8253[_0x800b('0x2e')]({'fromKey':_['isNil'](_0x15e5f0['fromKey'])?undefined:_0x15e5f0[_0x800b('0x113')],'count':_0x45385d[_0x800b('0x3a')],'rows':_0x45385d});}})[_0x800b('0x48')](handleError(_0x2f8253,null));};exports[_0x800b('0x114')]=function(_0x527ede,_0x1c9860){var _0x102f61={'raw':![],'where':{}};var _0x1dcd7a={};var _0x1e5e34={'count':0x0,'rows':[]};return db[_0x800b('0x30')]['findOne']({'where':{'id':_0x527ede[_0x800b('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c9860,null))[_0x800b('0x16')](function(_0x309b52){if(_0x309b52){_0x1dcd7a[_0x800b('0x34')]=_[_0x800b('0x4b')](db[_0x800b('0x115')]['rawAttributes']);_0x1dcd7a[_0x800b('0x35')]=_[_0x800b('0x4b')](_0x527ede[_0x800b('0x35')]);_0x1dcd7a[_0x800b('0x36')]=_['intersection'](_0x1dcd7a[_0x800b('0x34')],_0x1dcd7a[_0x800b('0x35')]);_0x102f61['attributes']=_[_0x800b('0x37')](_0x1dcd7a[_0x800b('0x34')],qs[_0x800b('0x38')](_0x527ede[_0x800b('0x35')]['fields']));_0x102f61['attributes']=_0x102f61['attributes'][_0x800b('0x3a')]?_0x102f61[_0x800b('0x39')]:_0x1dcd7a[_0x800b('0x34')];if(!_0x527ede[_0x800b('0x35')][_0x800b('0x3b')](_0x800b('0x3c'))){_0x102f61['limit']=qs['limit'](_0x527ede[_0x800b('0x35')]['limit']);_0x102f61[_0x800b('0x23')]=qs[_0x800b('0x23')](_0x527ede[_0x800b('0x35')][_0x800b('0x23')]);}_0x102f61[_0x800b('0x3e')]=qs[_0x800b('0x3f')](_0x527ede['query'][_0x800b('0x3f')]);_0x102f61[_0x800b('0x40')]=qs[_0x800b('0x36')](_['pick'](_0x527ede['query'],_0x1dcd7a[_0x800b('0x36')]));_0x102f61[_0x800b('0x40')]['ChatWebsiteId']=_0x309b52['id'];if(_0x527ede['query']['filter']){_0x102f61[_0x800b('0x40')]=_[_0x800b('0x43')](_0x102f61[_0x800b('0x40')],{'$or':_['map'](_0x102f61[_0x800b('0x39')],function(_0xc5e418){var _0x3c9ec7={};_0x3c9ec7[_0xc5e418]={'$like':'%'+_0x527ede['query'][_0x800b('0x42')]+'%'};return _0x3c9ec7;})});}_0x102f61=_[_0x800b('0x43')]({},_0x102f61,_0x527ede[_0x800b('0x60')]);return db[_0x800b('0x115')][_0x800b('0x25')]({'where':_0x102f61[_0x800b('0x40')]})[_0x800b('0x16')](function(_0x558f51){_0x1e5e34[_0x800b('0x25')]=_0x558f51;if(_0x527ede[_0x800b('0x35')][_0x800b('0x4c')]){_0x102f61[_0x800b('0x4d')]=[{'all':!![]}];}else{_0x102f61['include']=[{'model':db[_0x800b('0x7f')],'as':_0x800b('0x116'),'required':![]},{'model':db[_0x800b('0xd1')],'as':_0x800b('0x117'),'required':![]}];}return db[_0x800b('0x115')][_0x800b('0x5a')](_0x102f61);})['then'](function(_0x5dce72){_0x1e5e34[_0x800b('0x47')]=_0x5dce72;return _0x1e5e34;});}})['then'](respondWithFilteredResult(_0x1c9860,_0x102f61))[_0x800b('0x48')](handleError(_0x1c9860,null));};exports[_0x800b('0x118')]=function(_0x4e615b,_0x205bb7){return db[_0x800b('0x30')]['find']({'where':{'id':_0x4e615b[_0x800b('0x49')]['id']}})['then'](handleEntityNotFound(_0x205bb7,null))[_0x800b('0x16')](function(_0x125970){if(_0x125970){return _0x125970[_0x800b('0x118')](_0x4e615b[_0x800b('0x4f')][_0x800b('0x5c')],_[_0x800b('0xe5')](_0x4e615b[_0x800b('0x4f')],['ids','id'])||{})[_0x800b('0xab')](function(_0xd974c5){for(var _0x40d1a2=0x0;_0x40d1a2<_0x4e615b[_0x800b('0x4f')]['ids'][_0x800b('0x3a')];_0x40d1a2+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x4e615b['body'][_0x800b('0x5c')][_0x40d1a2]),'ChatWebsiteId':Number(_0x4e615b[_0x800b('0x49')]['id'])});}return _0xd974c5;});}})[_0x800b('0x16')](respondWithResult(_0x205bb7,null))[_0x800b('0x48')](handleError(_0x205bb7,null));};exports[_0x800b('0x119')]=function(_0x372429,_0xaa5ee5){return db['ChatWebsite'][_0x800b('0x52')]({'where':{'id':_0x372429[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0xaa5ee5,null))[_0x800b('0x16')](function(_0x272535){if(_0x272535){return _0x272535[_0x800b('0x119')](_0x372429[_0x800b('0x35')][_0x800b('0x5c')])['then'](function(){if(_[_0x800b('0x11a')](_0x372429['query'][_0x800b('0x5c')])){for(var _0x3ee256=0x0;_0x3ee256<_0x372429['query'][_0x800b('0x5c')][_0x800b('0x3a')];_0x3ee256+=0x1){socket[_0x800b('0x11b')](_0x800b('0x11c'),{'UserId':Number(_0x372429[_0x800b('0x35')][_0x800b('0x5c')][_0x3ee256]),'ChatWebsiteId':Number(_0x372429[_0x800b('0x49')]['id'])});}}else{socket[_0x800b('0x11b')](_0x800b('0x11c'),{'UserId':Number(_0x372429['query'][_0x800b('0x5c')]),'ChatWebsiteId':Number(_0x372429[_0x800b('0x49')]['id'])});}});}})[_0x800b('0x16')](respondWithStatusCode(_0xaa5ee5,null))['catch'](handleError(_0xaa5ee5,null));};exports[_0x800b('0x11d')]=function(_0x55c699,_0x337e8e){var _0x437c59={};var _0x171303={};var _0x3056d9;var _0x290889;return db[_0x800b('0x30')]['findOne']({'where':{'id':_0x55c699['params']['id']}})['then'](handleEntityNotFound(_0x337e8e,null))[_0x800b('0x16')](function(_0x20f8c8){if(_0x20f8c8){_0x3056d9=_0x20f8c8;_0x171303['model']=_[_0x800b('0x4b')](db['User'][_0x800b('0x31')]);_0x171303[_0x800b('0x35')]=_[_0x800b('0x4b')](_0x55c699[_0x800b('0x35')]);_0x171303['filters']=_[_0x800b('0x37')](_0x171303[_0x800b('0x34')],_0x171303['query']);_0x437c59[_0x800b('0x39')]=_[_0x800b('0x37')](_0x171303[_0x800b('0x34')],qs[_0x800b('0x38')](_0x55c699[_0x800b('0x35')][_0x800b('0x38')]));_0x437c59[_0x800b('0x39')]=_0x437c59[_0x800b('0x39')][_0x800b('0x3a')]?_0x437c59[_0x800b('0x39')]:_0x171303[_0x800b('0x34')];_0x437c59['order']=qs[_0x800b('0x3f')](_0x55c699[_0x800b('0x35')][_0x800b('0x3f')]);_0x437c59['where']=qs[_0x800b('0x36')](_[_0x800b('0x41')](_0x55c699[_0x800b('0x35')],_0x171303[_0x800b('0x36')]));if(_0x55c699['query'][_0x800b('0x42')]){_0x437c59[_0x800b('0x40')]=_[_0x800b('0x43')](_0x437c59['where'],{'$or':_[_0x800b('0x44')](_0x437c59[_0x800b('0x39')],function(_0x4e7d4f){var _0x5e60ad={};_0x5e60ad[_0x4e7d4f]={'$like':'%'+_0x55c699[_0x800b('0x35')][_0x800b('0x42')]+'%'};return _0x5e60ad;})});}_0x437c59=_[_0x800b('0x43')]({},_0x437c59,_0x55c699[_0x800b('0x60')]);return _0x3056d9[_0x800b('0x11d')](_0x437c59);}})[_0x800b('0x16')](function(_0x59224d){if(_0x59224d){_0x290889=_0x59224d[_0x800b('0x3a')];if(!_0x55c699['query'][_0x800b('0x3b')](_0x800b('0x3c'))){_0x437c59['limit']=qs[_0x800b('0x3d')](_0x55c699[_0x800b('0x35')][_0x800b('0x3d')]);_0x437c59['offset']=qs['offset'](_0x55c699[_0x800b('0x35')][_0x800b('0x23')]);}return _0x3056d9[_0x800b('0x11d')](_0x437c59);}})[_0x800b('0x16')](function(_0x1c7f7e){if(_0x1c7f7e){return _0x1c7f7e?{'count':_0x290889,'rows':_0x1c7f7e}:null;}})['then'](respondWithResult(_0x337e8e,null))[_0x800b('0x48')](handleError(_0x337e8e,null));}; \ No newline at end of file +var _0x73e9=['priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','omit','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','register','html-to-text','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','include','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','Pause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','chat','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','ChatApplication','Applications','account','applications','List','orderBy','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','x-real-port','browser','version','%s\x20%s','device','format','%s\x20%s\x20%s','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose','close','unmanaged','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','CompanyId','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','render','toPairs','offlineMessageBody','fromString','mimetype','server','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','utf8','virtual','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS'];(function(_0x1885d3,_0x538bd0){var _0x14d4d1=function(_0x4cb895){while(--_0x4cb895){_0x1885d3['push'](_0x1885d3['shift']());}};_0x14d4d1(++_0x538bd0);}(_0x73e9,0x13e));var _0x973e=function(_0x64bbb9,_0x909c76){_0x64bbb9=_0x64bbb9-0x0;var _0x5c3707=_0x73e9[_0x64bbb9];return _0x5c3707;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x973e('0x0'));var util=require('util');var path=require(_0x973e('0x1'));var ejs=require(_0x973e('0x2'));var fs=require('fs');var fs_extra=require(_0x973e('0x3'));var _=require(_0x973e('0x4'));var querystring=require(_0x973e('0x5'));var Redis=require(_0x973e('0x6'));var qs=require(_0x973e('0x7'));var logger=require(_0x973e('0x8'))('api');var config=require(_0x973e('0x9'));var db=require(_0x973e('0xa'))['db'];config[_0x973e('0xb')]=_[_0x973e('0xc')](config[_0x973e('0xb')],{'host':_0x973e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x973e('0xe')](socket);var htmlToText=require(_0x973e('0xf'));var jayson=require(_0x973e('0x10'));var client=jayson[_0x973e('0x11')][_0x973e('0x12')]({'port':0x232c});var client9002=jayson['client'][_0x973e('0x12')]({'port':0x232a});var client9003=jayson['client'][_0x973e('0x12')]({'port':0x232b});var client9001=jayson[_0x973e('0x11')][_0x973e('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x2d3399,_0x2e31b4,_0x286bc3,_0x3ce85c){return new BPromise(function(_0x52b7f3,_0x406e73){var _0x1c26bf=_0x3ce85c||client;return _0x1c26bf[_0x973e('0x13')](_0x2d3399,_0x286bc3)['then'](function(_0x39ddc2){logger[_0x973e('0x14')](_0x973e('0x15'),_0x2e31b4,'request\x20sent');logger[_0x973e('0x16')](_0x973e('0x17'),_0x2e31b4,'request\x20sent',JSON['stringify'](_0x39ddc2));if(_0x39ddc2[_0x973e('0x18')]){if(_0x39ddc2[_0x973e('0x18')][_0x973e('0x19')]===0x1f4){logger[_0x973e('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x2e31b4,_0x39ddc2[_0x973e('0x18')][_0x973e('0x1a')]);return _0x406e73(_0x39ddc2[_0x973e('0x18')]['message']);}logger['error'](_0x973e('0x15'),_0x2e31b4,_0x39ddc2[_0x973e('0x18')]['message']);return _0x52b7f3(_0x39ddc2[_0x973e('0x18')][_0x973e('0x1a')]);}else{logger[_0x973e('0x14')](_0x973e('0x15'),_0x2e31b4,_0x973e('0x1b'));_0x52b7f3(_0x39ddc2[_0x973e('0x1c')][_0x973e('0x1a')]);}})['catch'](function(_0x19f4f5){logger[_0x973e('0x18')](_0x973e('0x15'),_0x2e31b4,_0x19f4f5);_0x406e73(_0x19f4f5);});});}function respondWithStatusCode(_0x5c5d38,_0xe762c8){_0xe762c8=_0xe762c8||0xcc;return function(_0x552ce7){if(_0x552ce7){return _0x5c5d38[_0x973e('0x1d')](_0xe762c8);}return _0x5c5d38[_0x973e('0x1e')](_0xe762c8)[_0x973e('0x1f')]();};}function respondWithResult(_0x3aa99f,_0xf7d091){_0xf7d091=_0xf7d091||0xc8;return function(_0x3b6b3e){if(_0x3b6b3e){return _0x3aa99f[_0x973e('0x1e')](_0xf7d091)[_0x973e('0x20')](_0x3b6b3e);}};}function respondWithFilteredResult(_0x15bf3b,_0x38d7e4){return function(_0x26f28b){if(_0x26f28b){var _0x43d91c=typeof _0x38d7e4[_0x973e('0x21')]===_0x973e('0x22')&&typeof _0x38d7e4[_0x973e('0x23')]===_0x973e('0x22');var _0x194075=_0x26f28b['count'];var _0x1f7cf7=_0x43d91c?0x0:_0x38d7e4[_0x973e('0x21')];var _0x41c930=_0x43d91c?_0x26f28b[_0x973e('0x24')]:_0x38d7e4[_0x973e('0x21')]+_0x38d7e4['limit'];var _0xc4f7c8;if(_0x41c930>=_0x194075){_0x41c930=_0x194075;_0xc4f7c8=0xc8;}else{_0xc4f7c8=0xce;}_0x15bf3b[_0x973e('0x1e')](_0xc4f7c8);return _0x15bf3b[_0x973e('0x25')](_0x973e('0x26'),_0x1f7cf7+'-'+_0x41c930+'/'+_0x194075)['json'](_0x26f28b);}return null;};}function saveUpdates(_0x1c2207){return function(_0x5262b3){if(_0x5262b3){return _0x5262b3[_0x973e('0x27')](_0x1c2207)[_0x973e('0x28')](function(_0x14f6a3){return _0x14f6a3;});}return null;};}function removeEntity(_0x51392c){return function(_0x1b3f0f){if(_0x1b3f0f){return _0x1b3f0f[_0x973e('0x29')]()[_0x973e('0x28')](function(){var _0x3ee27b=_0x1b3f0f[_0x973e('0x2a')]({'plain':!![]});var _0x16fb7a='ChatWebsites';return db['UserProfileResource'][_0x973e('0x29')]({'where':{'type':_0x16fb7a,'resourceId':_0x3ee27b['id']}})[_0x973e('0x28')](function(){return _0x1b3f0f;});})['then'](function(){_0x51392c['status'](0xcc)[_0x973e('0x1f')]();});}};}function handleEntityNotFound(_0x3e00e3){return function(_0x53f931){if(!_0x53f931){_0x3e00e3[_0x973e('0x1d')](0x194);}return _0x53f931;};}function handleError(_0x485e75,_0x25da5f){_0x25da5f=_0x25da5f||0x1f4;return function(_0x323d7c){logger[_0x973e('0x18')](_0x323d7c[_0x973e('0x2b')]);if(_0x323d7c['name']){delete _0x323d7c[_0x973e('0x2c')];}_0x485e75[_0x973e('0x1e')](_0x25da5f)[_0x973e('0x2d')](_0x323d7c);};}exports[_0x973e('0x2e')]=function(_0x5c1fa0,_0x1480ad){var _0x3dee98={'include':[{'model':db['Pause'],'as':_0x973e('0x2f')}]},_0x268d96={},_0x32f2a1={'count':0x0,'rows':[]};var _0xf3e928=_[_0x973e('0x30')](db[_0x973e('0x31')][_0x973e('0x32')],function(_0x127efe){return{'name':_0x127efe['fieldName'],'type':_0x127efe[_0x973e('0x33')][_0x973e('0x34')]};});_0x268d96[_0x973e('0x35')]=_[_0x973e('0x30')](_0xf3e928,_0x973e('0x2c'));_0x268d96[_0x973e('0x36')]=_[_0x973e('0x37')](_0x5c1fa0[_0x973e('0x36')]);_0x268d96[_0x973e('0x38')]=_[_0x973e('0x39')](_0x268d96[_0x973e('0x35')],_0x268d96[_0x973e('0x36')]);_0x3dee98[_0x973e('0x3a')]=_[_0x973e('0x39')](_0x268d96[_0x973e('0x35')],qs[_0x973e('0x3b')](_0x5c1fa0['query'][_0x973e('0x3b')]));_0x3dee98[_0x973e('0x3a')]=_0x3dee98[_0x973e('0x3a')][_0x973e('0x3c')]?_0x3dee98[_0x973e('0x3a')]:_0x268d96[_0x973e('0x35')];if(!_0x5c1fa0[_0x973e('0x36')][_0x973e('0x3d')](_0x973e('0x3e'))){_0x3dee98[_0x973e('0x23')]=qs[_0x973e('0x23')](_0x5c1fa0[_0x973e('0x36')][_0x973e('0x23')]);_0x3dee98[_0x973e('0x21')]=qs[_0x973e('0x21')](_0x5c1fa0[_0x973e('0x36')][_0x973e('0x21')]);}_0x3dee98[_0x973e('0x3f')]=qs['sort'](_0x5c1fa0[_0x973e('0x36')][_0x973e('0x40')]);_0x3dee98['where']=qs[_0x973e('0x38')](_['pick'](_0x5c1fa0[_0x973e('0x36')],_0x268d96['filters']),_0xf3e928);if(_0x5c1fa0[_0x973e('0x36')][_0x973e('0x41')]){_0x3dee98[_0x973e('0x42')]=_[_0x973e('0x43')](_0x3dee98[_0x973e('0x42')],{'$or':_[_0x973e('0x30')](_0xf3e928,function(_0x36c917){if(_0x36c917[_0x973e('0x33')]!==_0x973e('0x44')){var _0x5bbe6f={};_0x5bbe6f[_0x36c917[_0x973e('0x2c')]]={'$like':'%'+_0x5c1fa0[_0x973e('0x36')]['filter']+'%'};return _0x5bbe6f;}})});}_0x3dee98=_[_0x973e('0x43')]({},_0x3dee98,_0x5c1fa0['options']);var _0x14b7ab={'where':_0x3dee98[_0x973e('0x42')]};return db[_0x973e('0x31')]['count'](_0x14b7ab)[_0x973e('0x28')](function(_0x4e7e20){_0x32f2a1[_0x973e('0x24')]=_0x4e7e20;if(_0x5c1fa0['query']['includeAll']){_0x3dee98[_0x973e('0x45')]=[{'all':!![]}];}return db[_0x973e('0x31')]['findAll'](_0x3dee98);})[_0x973e('0x28')](function(_0x50bc46){_0x32f2a1['rows']=_0x50bc46;return _0x32f2a1;})[_0x973e('0x28')](respondWithFilteredResult(_0x1480ad,_0x3dee98))['catch'](handleError(_0x1480ad,null));};exports['show']=function(_0x71d11c,_0x4e86e7){var _0xb7a268={'raw':![],'where':{'id':_0x71d11c['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x35ef49={};_0x35ef49[_0x973e('0x35')]=_[_0x973e('0x37')](db['ChatWebsite'][_0x973e('0x32')]);_0x35ef49[_0x973e('0x36')]=_[_0x973e('0x37')](_0x71d11c[_0x973e('0x36')]);_0x35ef49['filters']=_[_0x973e('0x39')](_0x35ef49[_0x973e('0x35')],_0x35ef49[_0x973e('0x36')]);_0xb7a268[_0x973e('0x3a')]=_[_0x973e('0x39')](_0x35ef49[_0x973e('0x35')],qs[_0x973e('0x3b')](_0x71d11c[_0x973e('0x36')][_0x973e('0x3b')]));_0xb7a268[_0x973e('0x3a')]=_0xb7a268['attributes'][_0x973e('0x3c')]?_0xb7a268[_0x973e('0x3a')]:_0x35ef49[_0x973e('0x35')];if(_0x71d11c['query'][_0x973e('0x46')]){_0xb7a268[_0x973e('0x45')]=[{'all':!![]}];}_0xb7a268=_[_0x973e('0x43')]({},_0xb7a268,_0x71d11c[_0x973e('0x47')]);return db['ChatWebsite'][_0x973e('0x48')](_0xb7a268)['then'](handleEntityNotFound(_0x4e86e7,null))[_0x973e('0x28')](respondWithResult(_0x4e86e7,null))[_0x973e('0x49')](handleError(_0x4e86e7,null));};exports[_0x973e('0x4a')]=function(_0x390d1e,_0x1b0a1b){return db['ChatWebsite'][_0x973e('0x4a')](_0x390d1e[_0x973e('0x4b')],{})[_0x973e('0x28')](function(_0x3f3ccb){var _0x45484a=_0x390d1e[_0x973e('0x4c')]['get']({'plain':!![]});if(!_0x45484a)throw new Error(_0x973e('0x4d'));if(_0x45484a[_0x973e('0x4e')]===_0x973e('0x4c')){var _0x33140d=_0x3f3ccb[_0x973e('0x2a')]({'plain':!![]});var _0x335a05=_0x973e('0x4f');return db[_0x973e('0x50')][_0x973e('0x48')]({'where':{'name':_0x335a05,'userProfileId':_0x45484a[_0x973e('0x51')]},'raw':!![]})['then'](function(_0x48627b){if(_0x48627b&&_0x48627b[_0x973e('0x52')]===0x0){return db[_0x973e('0x53')]['create']({'name':_0x33140d['name'],'resourceId':_0x33140d['id'],'type':_0x48627b[_0x973e('0x2c')],'sectionId':_0x48627b['id']},{})[_0x973e('0x28')](function(){return _0x3f3ccb;});}else{return _0x3f3ccb;}})[_0x973e('0x49')](function(_0x52396e){logger[_0x973e('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52396e);throw _0x52396e;});}return _0x3f3ccb;})[_0x973e('0x28')](respondWithResult(_0x1b0a1b,0xc9))[_0x973e('0x49')](handleError(_0x1b0a1b,null));};exports[_0x973e('0x27')]=function(_0x262e11,_0x2da4a4){if(_0x262e11[_0x973e('0x4b')]['id']){delete _0x262e11[_0x973e('0x4b')]['id'];}return db['ChatWebsite'][_0x973e('0x48')]({'where':{'id':_0x262e11[_0x973e('0x54')]['id']},'include':[{'model':db[_0x973e('0x55')],'as':_0x973e('0x2f')}]})['then'](handleEntityNotFound(_0x2da4a4,null))[_0x973e('0x28')](saveUpdates(_0x262e11[_0x973e('0x4b')],null))[_0x973e('0x28')](respondWithResult(_0x2da4a4,null))['catch'](handleError(_0x2da4a4,null));};exports[_0x973e('0x29')]=function(_0x5a5032,_0x126710){return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x5a5032[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x126710,null))['then'](removeEntity(_0x126710,null))[_0x973e('0x49')](handleError(_0x126710,null));};exports[_0x973e('0x56')]=function(_0x4a65ee,_0x21ad9e){return db[_0x973e('0x31')][_0x973e('0x56')]()['then'](respondWithResult(_0x21ad9e,null))[_0x973e('0x49')](handleError(_0x21ad9e,null));};exports[_0x973e('0x57')]=function(_0x5bf4e0,_0x51f069){if(_0x5bf4e0[_0x973e('0x4b')]['id']){delete _0x5bf4e0[_0x973e('0x4b')]['id'];}return db[_0x973e('0x31')]['find']({'where':{'id':_0x5bf4e0[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x51f069,null))[_0x973e('0x28')](function(_0x2d9026){if(_0x2d9026){_0x5bf4e0[_0x973e('0x4b')][_0x973e('0x58')]=_0x2d9026['id'];return db[_0x973e('0x59')][_0x973e('0x4a')](_0x5bf4e0[_0x973e('0x4b')]);}})[_0x973e('0x28')](respondWithResult(_0x51f069,null))['catch'](handleError(_0x51f069,null));};exports[_0x973e('0x5a')]=function(_0x15282d,_0x128729){var _0x20ed23={'raw':![],'where':{}};var _0xd64b35={};var _0x551fd7={'count':0x0,'rows':[]};return db[_0x973e('0x31')]['findOne']({'where':{'id':_0x15282d[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x128729,null))['then'](function(_0x388f00){if(_0x388f00){_0xd64b35['model']=_['keys'](db[_0x973e('0x59')][_0x973e('0x32')]);_0xd64b35['query']=_[_0x973e('0x37')](_0x15282d['query']);_0xd64b35[_0x973e('0x38')]=_[_0x973e('0x39')](_0xd64b35[_0x973e('0x35')],_0xd64b35[_0x973e('0x36')]);_0x20ed23[_0x973e('0x3a')]=_[_0x973e('0x39')](_0xd64b35[_0x973e('0x35')],qs['fields'](_0x15282d['query'][_0x973e('0x3b')]));_0x20ed23['attributes']=_0x20ed23[_0x973e('0x3a')][_0x973e('0x3c')]?_0x20ed23[_0x973e('0x3a')]:_0xd64b35[_0x973e('0x35')];if(!_0x15282d[_0x973e('0x36')][_0x973e('0x3d')](_0x973e('0x3e'))){_0x20ed23['limit']=qs[_0x973e('0x23')](_0x15282d[_0x973e('0x36')][_0x973e('0x23')]);_0x20ed23['offset']=qs['offset'](_0x15282d[_0x973e('0x36')][_0x973e('0x21')]);}_0x20ed23['order']=qs['sort'](_0x15282d[_0x973e('0x36')][_0x973e('0x40')]);_0x20ed23[_0x973e('0x42')]=qs[_0x973e('0x38')](_[_0x973e('0x5b')](_0x15282d[_0x973e('0x36')],_0xd64b35[_0x973e('0x38')]));_0x20ed23['where'][_0x973e('0x58')]=_0x388f00['id'];if(_0x15282d[_0x973e('0x36')][_0x973e('0x41')]){_0x20ed23[_0x973e('0x42')]=_[_0x973e('0x43')](_0x20ed23[_0x973e('0x42')],{'$or':_[_0x973e('0x30')](_0x20ed23['attributes'],function(_0x186e6a){var _0x23df2e={};_0x23df2e[_0x186e6a]={'$like':'%'+_0x15282d['query'][_0x973e('0x41')]+'%'};return _0x23df2e;})});}_0x20ed23=_[_0x973e('0x43')]({},_0x20ed23,_0x15282d[_0x973e('0x47')]);return db['Disposition'][_0x973e('0x24')]({'where':_0x20ed23[_0x973e('0x42')]})[_0x973e('0x28')](function(_0xdc7001){_0x551fd7[_0x973e('0x24')]=_0xdc7001;if(_0x15282d[_0x973e('0x36')][_0x973e('0x46')]){_0x20ed23['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x20ed23);})[_0x973e('0x28')](function(_0x1f42c2){_0x551fd7[_0x973e('0x5c')]=_0x1f42c2;return _0x551fd7;});}})[_0x973e('0x28')](respondWithFilteredResult(_0x128729,_0x20ed23))[_0x973e('0x49')](handleError(_0x128729,null));};exports['removeDispositions']=function(_0x591869,_0x24f9d1){return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x591869[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x24f9d1,null))['then'](function(_0x109e56){if(_0x109e56){return _0x109e56[_0x973e('0x5d')](_0x591869[_0x973e('0x36')][_0x973e('0x5e')]);}})[_0x973e('0x28')](respondWithStatusCode(_0x24f9d1,null))[_0x973e('0x49')](handleError(_0x24f9d1,null));};exports[_0x973e('0x5f')]=function(_0x42ad54,_0x5c2f80){if(_0x42ad54[_0x973e('0x4b')]['id']){delete _0x42ad54[_0x973e('0x4b')]['id'];}return db['ChatWebsite'][_0x973e('0x48')]({'where':{'id':_0x42ad54[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x5c2f80,null))[_0x973e('0x28')](function(_0x5bf337){if(_0x5bf337){_0x42ad54['body'][_0x973e('0x58')]=_0x5bf337['id'];return db[_0x973e('0x60')]['create'](_0x42ad54['body']);}})[_0x973e('0x28')](respondWithResult(_0x5c2f80,null))[_0x973e('0x49')](handleError(_0x5c2f80,null));};exports[_0x973e('0x61')]=function(_0x15ccb9,_0x16a311){var _0x4a275b={'raw':![],'where':{}};var _0x213826={};var _0x13be66={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x973e('0x62')]({'where':{'id':_0x15ccb9[_0x973e('0x54')]['id']}})['then'](handleEntityNotFound(_0x16a311,null))[_0x973e('0x28')](function(_0x537e0e){if(_0x537e0e){_0x213826[_0x973e('0x35')]=_[_0x973e('0x37')](db[_0x973e('0x60')][_0x973e('0x32')]);_0x213826[_0x973e('0x36')]=_[_0x973e('0x37')](_0x15ccb9[_0x973e('0x36')]);_0x213826['filters']=_[_0x973e('0x39')](_0x213826[_0x973e('0x35')],_0x213826[_0x973e('0x36')]);_0x4a275b['attributes']=_['intersection'](_0x213826['model'],qs[_0x973e('0x3b')](_0x15ccb9['query'][_0x973e('0x3b')]));_0x4a275b[_0x973e('0x3a')]=_0x4a275b[_0x973e('0x3a')]['length']?_0x4a275b['attributes']:_0x213826[_0x973e('0x35')];if(!_0x15ccb9['query']['hasOwnProperty'](_0x973e('0x3e'))){_0x4a275b['limit']=qs[_0x973e('0x23')](_0x15ccb9[_0x973e('0x36')][_0x973e('0x23')]);_0x4a275b['offset']=qs[_0x973e('0x21')](_0x15ccb9[_0x973e('0x36')]['offset']);}_0x4a275b['order']=qs['sort'](_0x15ccb9[_0x973e('0x36')][_0x973e('0x40')]);_0x4a275b['where']=qs[_0x973e('0x38')](_['pick'](_0x15ccb9[_0x973e('0x36')],_0x213826['filters']));_0x4a275b['where'][_0x973e('0x58')]=_0x537e0e['id'];if(_0x15ccb9[_0x973e('0x36')][_0x973e('0x41')]){_0x4a275b['where']=_['merge'](_0x4a275b[_0x973e('0x42')],{'$or':_['map'](_0x4a275b[_0x973e('0x3a')],function(_0x3eca70){var _0x3880b7={};_0x3880b7[_0x3eca70]={'$like':'%'+_0x15ccb9[_0x973e('0x36')]['filter']+'%'};return _0x3880b7;})});}_0x4a275b=_['merge']({},_0x4a275b,_0x15ccb9[_0x973e('0x47')]);return db[_0x973e('0x60')][_0x973e('0x24')]({'where':_0x4a275b['where']})[_0x973e('0x28')](function(_0x3b4ba6){_0x13be66[_0x973e('0x24')]=_0x3b4ba6;if(_0x15ccb9[_0x973e('0x36')][_0x973e('0x46')]){_0x4a275b[_0x973e('0x45')]=[{'all':!![]}];}return db[_0x973e('0x60')][_0x973e('0x63')](_0x4a275b);})[_0x973e('0x28')](function(_0x2f2a22){_0x13be66['rows']=_0x2f2a22;return _0x13be66;});}})['then'](respondWithFilteredResult(_0x16a311,_0x4a275b))[_0x973e('0x49')](handleError(_0x16a311,null));};exports['removeAnswers']=function(_0x559298,_0x3ed8e7){return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x559298['params']['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x3ed8e7,null))[_0x973e('0x28')](function(_0x95f65){if(_0x95f65){return _0x95f65[_0x973e('0x64')](_0x559298[_0x973e('0x36')][_0x973e('0x5e')]);}})['then'](respondWithStatusCode(_0x3ed8e7,null))[_0x973e('0x49')](handleError(_0x3ed8e7,null));};exports[_0x973e('0x65')]=function(_0x5ca247,_0x127bd4){_0x5ca247[_0x973e('0x4b')][_0x973e('0x66')]=_0x5ca247[_0x973e('0x67')][_0x973e('0x68')];return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x5ca247[_0x973e('0x54')]['id']}})['then'](handleEntityNotFound(_0x127bd4,null))[_0x973e('0x28')](saveUpdates(_0x5ca247[_0x973e('0x4b')],null))[_0x973e('0x28')](respondWithResult(_0x127bd4,null))['catch'](handleError(_0x127bd4,null));};exports[_0x973e('0x69')]=function(_0x2d3819,_0x123da2){_0x2d3819[_0x973e('0x4b')]['agentAvatar']=_0x2d3819[_0x973e('0x67')][_0x973e('0x68')];return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x2d3819[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x123da2,null))['then'](saveUpdates(_0x2d3819[_0x973e('0x4b')],null))[_0x973e('0x28')](respondWithResult(_0x123da2,null))[_0x973e('0x49')](handleError(_0x123da2,null));};exports[_0x973e('0x6a')]=function(_0xba73b9,_0x9e17f8){_0xba73b9[_0x973e('0x4b')][_0x973e('0x6b')]=_0xba73b9[_0x973e('0x67')][_0x973e('0x68')];return db['ChatWebsite']['find']({'where':{'id':_0xba73b9[_0x973e('0x54')]['id']}})['then'](handleEntityNotFound(_0x9e17f8,null))['then'](saveUpdates(_0xba73b9[_0x973e('0x4b')],null))['then'](respondWithResult(_0x9e17f8,null))['catch'](handleError(_0x9e17f8,null));};exports['addSystemAvatar']=function(_0xae8b1a,_0x62af6b){_0xae8b1a[_0x973e('0x4b')][_0x973e('0x6c')]=_0xae8b1a[_0x973e('0x67')][_0x973e('0x68')];return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0xae8b1a[_0x973e('0x54')]['id']}})['then'](handleEntityNotFound(_0x62af6b,null))[_0x973e('0x28')](saveUpdates(_0xae8b1a[_0x973e('0x4b')],null))[_0x973e('0x28')](respondWithResult(_0x62af6b,null))[_0x973e('0x49')](handleError(_0x62af6b,null));};exports[_0x973e('0x6d')]=function(_0x36d412,_0x3288e8){var _0xd1e0d5=path[_0x973e('0x6e')](config[_0x973e('0x6f')],'server/files/images/logos/default_logo.svg');var _0x1d6bcb={'where':{'id':_0x36d412[_0x973e('0x54')]['id']},'attributes':['id',_0x973e('0x66')],'raw':!![]};var _0x23ab3c=![];return require(_0x973e('0x70'))[_0x973e('0x71')]()[_0x973e('0x28')](function(_0x1997ff){if(_0x1997ff){_0x23ab3c=_0x1997ff[_0x973e('0x72')];}})['then'](function(){return db['ChatWebsite']['find'](_0x1d6bcb);})[_0x973e('0x28')](handleEntityNotFound(_0x3288e8,null))['then'](function(_0x40f670){if(_0x40f670){if(!_[_0x973e('0x73')](_0x40f670[_0x973e('0x66')])){if(fs[_0x973e('0x74')](path[_0x973e('0x6e')](config[_0x973e('0x6f')],'server/files/images/logos/',_0x40f670[_0x973e('0x66')]))&&_0x23ab3c){_0xd1e0d5=path['join'](config[_0x973e('0x6f')],'server/files/images/logos/',_0x40f670[_0x973e('0x66')]);}}return _0x3288e8[_0x973e('0x75')](_0xd1e0d5);}})[_0x973e('0x49')](handleError(_0x3288e8,null));};exports[_0x973e('0x76')]=function(_0x1ec7e6,_0x5a70fa){var _0x3c2ac0=path[_0x973e('0x6e')](config[_0x973e('0x6f')],_0x973e('0x77'));var _0x13c15d={'where':{'id':_0x1ec7e6[_0x973e('0x54')]['id']},'attributes':['id',_0x973e('0x78')],'raw':!![]};return db[_0x973e('0x31')][_0x973e('0x48')](_0x13c15d)[_0x973e('0x28')](handleEntityNotFound(_0x5a70fa,null))[_0x973e('0x28')](function(_0x30e8a3){if(_0x30e8a3){if(!_['isNil'](_0x30e8a3[_0x973e('0x78')])){if(fs[_0x973e('0x74')](path[_0x973e('0x6e')](config['root'],_0x973e('0x79'),_0x30e8a3['agentAvatar']))){_0x3c2ac0=path['join'](config['root'],_0x973e('0x79'),_0x30e8a3[_0x973e('0x78')]);}}return _0x5a70fa[_0x973e('0x75')](_0x3c2ac0);}})[_0x973e('0x49')](handleError(_0x5a70fa,null));};exports[_0x973e('0x7a')]=function(_0x141d0a,_0x1790b9){var _0x357c00=path[_0x973e('0x6e')](config[_0x973e('0x6f')],'server/files/images/avatars/customer_avatar.png');var _0x364cb2={'where':{'id':_0x141d0a[_0x973e('0x54')]['id']},'attributes':['id',_0x973e('0x6b'),_0x973e('0x7b')],'raw':!![]};return db['ChatWebsite'][_0x973e('0x48')](_0x364cb2)[_0x973e('0x28')](handleEntityNotFound(_0x1790b9,null))[_0x973e('0x28')](function(_0x3836eb){if(_0x3836eb){if(!_['isNil'](_0x3836eb[_0x973e('0x6b')])){if(fs[_0x973e('0x74')](path[_0x973e('0x6e')](config[_0x973e('0x6f')],'server/files/images/avatars/',_0x3836eb[_0x973e('0x6b')]))&&_0x3836eb[_0x973e('0x7b')]){_0x357c00=path['join'](config[_0x973e('0x6f')],_0x973e('0x79'),_0x3836eb[_0x973e('0x6b')]);}}return _0x1790b9[_0x973e('0x75')](_0x357c00);}})[_0x973e('0x49')](handleError(_0x1790b9,null));};exports[_0x973e('0x7c')]=function(_0x3db24c,_0x591d81){var _0x504c4c=path[_0x973e('0x6e')](config[_0x973e('0x6f')],_0x973e('0x7d'));var _0x1f07e4={'where':{'id':_0x3db24c['params']['id']},'attributes':['id',_0x973e('0x6c')],'raw':!![]};return db[_0x973e('0x31')][_0x973e('0x48')](_0x1f07e4)['then'](handleEntityNotFound(_0x591d81,null))[_0x973e('0x28')](function(_0x1891bd){if(_0x1891bd){if(!_[_0x973e('0x73')](_0x1891bd[_0x973e('0x6c')])){if(fs[_0x973e('0x74')](path[_0x973e('0x6e')](config[_0x973e('0x6f')],'server/files/images/avatars/',_0x1891bd['systemAvatar']))){_0x504c4c=path[_0x973e('0x6e')](config[_0x973e('0x6f')],_0x973e('0x79'),_0x1891bd[_0x973e('0x6c')]);}}return _0x591d81[_0x973e('0x75')](_0x504c4c);}})['catch'](handleError(_0x591d81,null));};exports[_0x973e('0x7e')]=function(_0xf6f22,_0x3423fb){var _0x2e80f9=require(_0x973e('0x7f'));var _0x541a76=new _0x2e80f9();var _0x439b08=_0x541a76[_0x973e('0x80')](_0xf6f22[_0x973e('0x81')]['user-agent'])['getResult']();var _0x57d5e8={'body':_0xf6f22[_0x973e('0x4b')],'channel':_0x973e('0x82')};var _0x14a693=[];var _0x1f5a33=[];var _0x4ea6c7={};var _0x349d2d=![];return db[_0x973e('0x83')]['describe']()[_0x973e('0x28')](function(_0x10efcf){if(!_0x10efcf){throw new db[(_0x973e('0x84'))][(_0x973e('0x85'))]('no\x20available\x20attributes');}_0x14a693=_[_0x973e('0x86')](_['keys'](_0x10efcf),['createdAt',_0x973e('0x87')]);_0x1f5a33=_['difference'](_[_0x973e('0x37')](_0x10efcf),[_0x973e('0x88'),_0x973e('0x87'),'CompanyId',_0x973e('0x89')]);if(_0xf6f22[_0x973e('0x4b')]['id']){delete _0xf6f22[_0x973e('0x4b')]['id'];}if(_[_0x973e('0x73')](_0xf6f22['body'][_0x973e('0x8a')])){throw new db[(_0x973e('0x84'))]['ValidationError'](_0x973e('0x8b'));}if(_['isNil'](_0xf6f22[_0x973e('0x4b')][_0x973e('0x4b')])||_0xf6f22[_0x973e('0x4b')]['body']===''){throw new db[(_0x973e('0x84'))][(_0x973e('0x85'))](_0x973e('0x8c'));}if(_[_0x973e('0x73')](_0xf6f22[_0x973e('0x4b')][_0x973e('0x8d')])){throw new db['Sequelize'][(_0x973e('0x85'))](_0x973e('0x8e')+_0x1f5a33);}if(!_[_0x973e('0x8f')](_0x1f5a33,_0xf6f22[_0x973e('0x4b')]['mapKey'])){throw new db[(_0x973e('0x84'))][(_0x973e('0x85'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f5a33);}_0x4ea6c7[_0xf6f22[_0x973e('0x4b')][_0x973e('0x8d')]]=_0xf6f22[_0x973e('0x4b')]['from'];})[_0x973e('0x28')](function(){return db[_0x973e('0x31')]['find']({'where':{'id':_0xf6f22['params']['id']},'include':[{'model':db[_0x973e('0x90')],'as':'List','include':[{'model':db[_0x973e('0x83')],'as':_0x973e('0x91'),'where':_0x4ea6c7,'limit':0x1,'order':[[_0x973e('0x87'),_0x973e('0x92')]]}]},{'model':db[_0x973e('0x93')],'as':_0x973e('0x94')}]});})[_0x973e('0x28')](handleEntityNotFound(_0x3423fb,null))[_0x973e('0x28')](function(_0x452635){if(_0x452635&&_0x452635['List']){_0x57d5e8[_0x973e('0x95')]=_0x452635;_0x57d5e8[_0x973e('0x96')]=_0x452635[_0x973e('0x94')];_0x57d5e8['list']=_0x452635[_0x973e('0x97')];_0x57d5e8[_0x973e('0x96')]=_[_0x973e('0x98')](_0x57d5e8[_0x973e('0x96')],['priority'],[_0x973e('0x99')]);if(_0x57d5e8[_0x973e('0x95')]['Applications']){delete _0x57d5e8[_0x973e('0x95')][_0x973e('0x94')];}if(_0x57d5e8['account'][_0x973e('0x97')]&&_0x57d5e8['account'][_0x973e('0x97')]['Contacts'][_0x973e('0x3c')]){return _0x57d5e8[_0x973e('0x95')][_0x973e('0x97')][_0x973e('0x91')][0x0];}var _0x2d3ee5=_[_0x973e('0xc')](_0xf6f22[_0x973e('0x4b')],{'firstName':_0xf6f22[_0x973e('0x4b')][_0x973e('0x8a')],'ListId':_0x452635[_0x973e('0x89')]});_0x2d3ee5[_0xf6f22[_0x973e('0x4b')][_0x973e('0x8d')]]=_0xf6f22[_0x973e('0x4b')]['from'];return db['CmContact'][_0x973e('0x4a')](_0x2d3ee5,{'fields':_0x14a693,'raw':!![]});}})[_0x973e('0x28')](handleEntityNotFound(_0x3423fb,null))['then'](function(_0x87a746){_0x57d5e8[_0x973e('0x9a')]=_0x87a746;var _0x2f8185=_0xf6f22[_0x973e('0x4b')][_0x973e('0x9b')];if(_0xf6f22['headers']['cf-connecting-ip']){_0x2f8185=_0xf6f22[_0x973e('0x81')][_0x973e('0x9c')];}else if(_0xf6f22['headers'][_0x973e('0x9d')]){_0x2f8185=_['first'](_0xf6f22[_0x973e('0x81')]['x-forwarded-for'][_0x973e('0x9e')](','));}if(_0x87a746){var _0x4bc92a={'ContactId':_0x87a746['id'],'ChatWebsiteId':_0xf6f22['params']['id'],'from':(_0x87a746['firstName']||'')+'\x20'+(_0x87a746['lastName']||''),'customerIp':_0x2f8185,'customerPort':_0xf6f22[_0x973e('0x81')]['x-real-port']?_0xf6f22['headers'][_0x973e('0x9f')]:null,'referer':_0xf6f22[_0x973e('0x4b')]['referer'],'browserName':_0x439b08['browser'][_0x973e('0x2c')]&&_0x439b08[_0x973e('0xa0')][_0x973e('0xa1')]?util['format']('%s\x20%s',_0x439b08[_0x973e('0xa0')][_0x973e('0x2c')],_0x439b08['browser'][_0x973e('0xa1')]):'unknown','browserVersion':_0x439b08[_0x973e('0xa0')][_0x973e('0xa1')]||'unknown','osName':util['format'](_0x973e('0xa2'),_0x439b08['os']['name'],_0x439b08['os'][_0x973e('0xa1')]),'osVersion':_0x439b08['os'][_0x973e('0xa1')],'deviceModel':_0x439b08[_0x973e('0xa3')][_0x973e('0x35')]&&_0x439b08[_0x973e('0xa3')]['vendor']?util[_0x973e('0xa4')](_0x973e('0xa5'),_0x439b08[_0x973e('0xa3')][_0x973e('0x35')],_0x439b08[_0x973e('0xa3')][_0x973e('0xa6')],_0x439b08[_0x973e('0xa3')][_0x973e('0x33')]):null,'deviceVendor':_0x439b08['device'][_0x973e('0xa6')],'deviceType':_0x439b08[_0x973e('0xa3')][_0x973e('0x33')],'formData':JSON[_0x973e('0xa7')](_0xf6f22[_0x973e('0x4b')])};var _0xe99b76={'ChatWebsiteId':_0xf6f22[_0x973e('0x54')]['id'],'closed':![]};if(_0xf6f22['body'][_0x973e('0xa8')]){_0xe99b76[_0x973e('0xa8')]=_0xf6f22['body']['threadId'];return db[_0x973e('0xa9')][_0x973e('0x48')]({'where':_0xe99b76})[_0x973e('0x28')](function(_0x314f07){if(_0x314f07){return[_0x314f07,![]];}_0x4bc92a[_0x973e('0xa8')]=_0xf6f22[_0x973e('0x4b')][_0x973e('0xa8')];_0x4bc92a[_0x973e('0xaa')]=_0xf6f22[_0x973e('0x4b')][_0x973e('0xaa')];return db['ChatInteraction'][_0x973e('0x4a')](_0x4bc92a)['then'](function(_0x1f87ab){return[_0x1f87ab,!![]];});});}_0xe99b76[_0x973e('0xab')]=_0x87a746['id'];if(_0xf6f22['body'][_0x973e('0xac')]&&_0xf6f22[_0x973e('0x4b')][_0x973e('0xac')]['id']){_0xe99b76['id']=_0xf6f22[_0x973e('0x4b')][_0x973e('0xac')]['id'];return db[_0x973e('0xa9')][_0x973e('0x48')]({'where':_0xe99b76})[_0x973e('0x28')](function(_0x12c162){if(_0x12c162){return[_0x12c162,![]];}return db[_0x973e('0xa9')]['create'](_0x4bc92a)['then'](function(_0x5b36ad){return[_0x5b36ad,!![]];});});}return db['ChatInteraction'][_0x973e('0x4a')](_0x4bc92a)[_0x973e('0x28')](function(_0x286d9a){return[_0x286d9a,!![]];});}})[_0x973e('0xad')](function(_0x31d39d,_0x408b33){if(_0x31d39d){_0x349d2d=_0x408b33;if(!_0x408b33){var _0x44e500={'from':(_0x57d5e8[_0x973e('0x9a')][_0x973e('0xae')]||'')+'\x20'+(_0x57d5e8['contact']['lastName']||'')};if(_0xf6f22[_0x973e('0x4b')][_0x973e('0xa8')]&&_0xf6f22['body'][_0x973e('0xaf')]&&_0xf6f22['body']['threadId']!=_0xf6f22[_0x973e('0x4b')][_0x973e('0xaf')]){_0x44e500[_0x973e('0xa8')]=_0xf6f22['body'][_0x973e('0xaf')];}return _0x31d39d[_0x973e('0x27')](_0x44e500);}else{return _0x31d39d;}}})[_0x973e('0x28')](function(_0x1df3fd){_0x57d5e8['interaction']=_0x1df3fd[_0x973e('0x2a')]({'plain':!![]});_0x57d5e8[_0x973e('0xac')][_0x973e('0xb0')]=_0x349d2d;if(_0x57d5e8[_0x973e('0xac')][_0x973e('0xb0')]){if(_0x57d5e8[_0x973e('0x95')][_0x973e('0xb1')]){_0x57d5e8[_0x973e('0x96')]['push']({'id':0x0,'priority':_0x57d5e8[_0x973e('0x96')]['length']+0x1,'app':_0x973e('0xb2'),'appdata':_0x973e('0xb3'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0x973e('0x4a')]({'body':_0xf6f22[_0x973e('0x4b')]['body'],'ChatWebsiteId':_0xf6f22[_0x973e('0x54')]['id'],'ChatInteractionId':_0x1df3fd['id'],'direction':'in','ContactId':_0x57d5e8[_0x973e('0x9a')]['id'],'AttachmentId':_0xf6f22[_0x973e('0x4b')][_0x973e('0xb4')]});})[_0x973e('0x28')](function(_0x2babf4){_0x57d5e8['message']=_0x2babf4;if(_0x57d5e8[_0x973e('0xac')]['UserId']){return db[_0x973e('0xb5')]['find']({'attributes':['id','name'],'where':{'id':_0x57d5e8['interaction'][_0x973e('0xb6')]}})['then'](function(_0x5d62b3){if(_0x5d62b3){_0x57d5e8['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x973e('0xb7'),'appdata':_0x5d62b3[_0x973e('0x2c')]+','+(_0x57d5e8['account'][_0x973e('0xb8')]||0xa),'interval':_0x973e('0xb9')});_0x57d5e8[_0x973e('0xba')]=!![];}return respondWithRpcPromise(_0x973e('0xbb'),_0x973e('0xbc'),_0x57d5e8);});}return respondWithRpcPromise(_0x973e('0xbb'),_0x973e('0xbc'),_0x57d5e8);})['then'](function(_0x24ab80){respondWithRpcPromise(_0x973e('0xbd'),_0x973e('0xbd'),{'event':_0x973e('0x7e'),'message':_0x24ab80},client9002);return _0x24ab80;})[_0x973e('0x28')](respondWithResult(_0x3423fb,null))[_0x973e('0x49')](handleError(_0x3423fb,null));};exports[_0x973e('0xbe')]=function(_0x240a35,_0x1cb4b9){var _0x359cd3,_0x296b0a,_0x186f21;var _0x52851f=[];var _0x217fef={};var _0x344ed7=_0x240a35[_0x973e('0xbf')]||[];var _0x2dfdc7=[];var _0x3ec6db;return db[_0x973e('0x83')][_0x973e('0x56')]()[_0x973e('0x28')](function(_0x3d72d4){if(!_0x3d72d4){throw new db['Sequelize']['ValidationError'](_0x973e('0xc0'));}_0x52851f=_[_0x973e('0x86')](_[_0x973e('0x37')](_0x3d72d4),[_0x973e('0x88'),_0x973e('0x87'),_0x973e('0xc1'),_0x973e('0x89')]);if(_0x240a35['body']['id']){delete _0x240a35[_0x973e('0x4b')]['id'];}if(_[_0x973e('0x73')](_0x240a35[_0x973e('0x4b')][_0x973e('0x8a')])){throw _0x1cb4b9[_0x973e('0x1e')](0x1f4)[_0x973e('0x2d')](new db[(_0x973e('0x84'))][(_0x973e('0x85'))](_0x973e('0x8b')));}if(_['isNil'](_0x240a35[_0x973e('0x4b')][_0x973e('0x4b')])||_0x240a35[_0x973e('0x4b')]['body']===''){throw _0x1cb4b9[_0x973e('0x1e')](0x1f4)[_0x973e('0x2d')](new db[(_0x973e('0x84'))]['ValidationError'](_0x973e('0x8c')));}if(_[_0x973e('0x73')](_0x240a35['body'][_0x973e('0xc2')])){throw _0x1cb4b9[_0x973e('0x1e')](0x1f4)[_0x973e('0x2d')](new db[(_0x973e('0x84'))]['ValidationError'](_0x973e('0xc3')+_0x52851f));}if(!_[_0x973e('0x8f')](_0x52851f,_0x240a35['body']['mapKeyOffline'])){throw _0x1cb4b9[_0x973e('0x1e')](0x1f4)[_0x973e('0x2d')](new db[(_0x973e('0x84'))][(_0x973e('0x85'))](_0x973e('0xc4')+_0x52851f));}_0x217fef[_0x240a35[_0x973e('0x4b')][_0x973e('0xc2')]]=_0x240a35[_0x973e('0x4b')]['from'];})[_0x973e('0x28')](function(){return db[_0x973e('0x31')]['find']({'where':{'id':_0x240a35['params']['id']},'include':[{'model':db[_0x973e('0x90')],'as':_0x973e('0x97')},{'model':db[_0x973e('0xc5')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x1cb4b9,null))['then'](function(_0x4ffae0){if(_0x4ffae0&&_0x4ffae0['List']){_0x296b0a=_0x4ffae0;var _0x40ff19=_[_0x973e('0xc')](_0x240a35['body'],{'firstName':_0x240a35[_0x973e('0x4b')][_0x973e('0x8a')],'phone':_0x240a35[_0x973e('0x4b')]['from'],'ListId':_0x4ffae0[_0x973e('0x89')]});_0x40ff19[_0x240a35[_0x973e('0x4b')][_0x973e('0xc2')]]=_0x240a35[_0x973e('0x4b')][_0x973e('0x8a')];return db[_0x973e('0x83')][_0x973e('0xc6')]({'where':_0x217fef,'defaults':_0x40ff19});}})[_0x973e('0xad')](function(_0x2c38ed){if(_0x2c38ed){_0x186f21=_0x2c38ed;var _0x5d219f=fs[_0x973e('0xc7')](path[_0x973e('0x6e')](config[_0x973e('0x6f')],_0x973e('0xc8')),'utf8');var _0x2445c3=ejs[_0x973e('0xc9')](_0x5d219f,{'body':_[_0x973e('0xca')](_0x240a35[_0x973e('0x4b')][_0x973e('0x4b')]),'bodyTitle':_0x296b0a[_0x973e('0xcb')]});return db['ChatOfflineMessage'][_0x973e('0x4a')]({'body':_0x2445c3,'plainBody':htmlToText[_0x973e('0xcc')](_0x2445c3),'ContactId':_0x2c38ed['id'],'ChatWebsiteId':_0x296b0a['id']});}})['then'](function(_0x51f478){_0x3ec6db=_0x51f478;if(_0x344ed7['length']){var _0x88ac1=_0x344ed7[_0x973e('0x30')](function(_0x23d994){return{'name':_0x23d994['originalname'],'basename':_0x23d994[_0x973e('0x68')],'type':_0x23d994[_0x973e('0xcd')],'ChatOfflineMessageId':_0x51f478['id']};});_0x2dfdc7=_0x88ac1[_0x973e('0x30')](_0x407e9b=>{var _0x19fb14={'filename':_0x407e9b[_0x973e('0x2c')],'path':path[_0x973e('0x6e')](config[_0x973e('0x6f')],_0x973e('0xce'),_0x973e('0xbf'),'attachments',_0x973e('0xcf'),_0x407e9b['basename'])};return _0x19fb14;});if(!_0x296b0a[_0x973e('0xd0')]){return db[_0x973e('0xd1')][_0x973e('0xd2')](function(_0x3ebfe5){return db[_0x973e('0xd3')][_0x973e('0xd4')](_0x88ac1,{'transaction':_0x3ebfe5});});}}})[_0x973e('0x28')](function(){if(_0x3ec6db){_0x359cd3=_0x3ec6db;return db[_0x973e('0xc5')][_0x973e('0x62')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x973e('0xd5'),'raw':!![],'include':[{'model':db[_0x973e('0xd6')],'as':_0x973e('0xd6'),'raw':!![]}]}]});}})[_0x973e('0x28')](function(_0x2ddc96){if(_0x2ddc96&&_0x2ddc96[_0x973e('0xd5')]&&_0x296b0a[_0x973e('0xd7')]&&_0x296b0a['forwardOfflineAddress']){var _0x5dc443=_0x2ddc96[_0x973e('0xd8')]();return respondWithRpcPromise(_0x973e('0xd9'),_0x973e('0xda'),{'account':_0x5dc443,'message':{'from':util['format'](_0x973e('0xdb'),_0x2ddc96[_0x973e('0x2c')],_0x2ddc96[_0x973e('0xdc')]||_0x2ddc96['Smtp'][_0x973e('0x4c')]),'to':_0x296b0a[_0x973e('0xdd')],'subject':_0x296b0a['offlineMessageSubject'],'html':_0x359cd3[_0x973e('0x4b')],'attachments':_0x2dfdc7}},client9003)[_0x973e('0x28')](function(){return _0x359cd3;})[_0x973e('0x49')](function(_0x2bed03){logger[_0x973e('0x18')](_0x2bed03);});}})[_0x973e('0x28')](function(){if(_0x296b0a&&_0x296b0a[_0x973e('0xd0')]&&_0x296b0a[_0x973e('0xde')]){var _0x1630a3=[];if(_0x344ed7['length']){_0x1630a3=_0x344ed7[_0x973e('0x30')](function(_0x498c7b){return{'name':_0x498c7b[_0x973e('0xdf')],'basename':_0x498c7b['filename'],'type':_0x498c7b[_0x973e('0xcd')],'ChatOfflineMessageId':_0x3ec6db['id']};});}var _0x4a5744;if(!_[_0x973e('0x73')](_0x296b0a[_0x973e('0xe0')])){var _0x361608=_[_0x973e('0x30')](_0x240a35[_0x973e('0x4b')],function(_0x5e0237){return _0x5e0237;});var _0x7ad4ed=_[_0x973e('0xe1')](_0x361608)[0x0];var _0x2529cf=_[_0x973e('0xe2')](_0x7ad4ed,function(_0x538205){return _0x538205;});_0x4a5744=_0x2529cf[0x1][_0x296b0a[_0x973e('0xe0')]];}var _0x3c406b={'from':_0x186f21[_0x973e('0xdc')],'firstName':_0x186f21[_0x973e('0xae')],'lastName':_0x186f21['lastName'],'mapKey':_0x973e('0xdc'),'message':{'from':_0x186f21[_0x973e('0xdc')],'to':_0x296b0a[_0x973e('0xc5')][_0x973e('0xdc')],'cc':'','subject':_['isNil'](_0x4a5744)?_0x296b0a['offlineMessageSubject']:_0x4a5744,'messageId':'','sentAt':new Date(),'attach':_0x1630a3[_0x973e('0x3c')],'attachments':_0x1630a3,'originChannel':_0x973e('0xe3'),'ChatWebsiteId':_0x296b0a['id'],'ChatOfflineMessageId':_0x359cd3['id'],'originTo':_0x296b0a['MailAccount']['email']},'body':_0x359cd3['body']};var _0x24bbe0={'account':{'id':_0x296b0a[_0x973e('0xde')]},'body':_0x3c406b,'log':_0x973e('0xe4')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x24bbe0,client9001)[_0x973e('0x28')](function(){return _0x359cd3;})[_0x973e('0x49')](function(_0x142de8){logger[_0x973e('0x18')](_0x142de8);});}return;})['then'](function(){if(_0x359cd3){return _0x359cd3;}})[_0x973e('0x28')](respondWithResult(_0x1cb4b9,null))[_0x973e('0x49')](function(_0x3c53f1){logger['error']('catch',_0x3c53f1);for(var _0xe2e15a of _0x344ed7){var _0x1a9a4d=path['join'](config[_0x973e('0x6f')],_0x973e('0xce'),_0x973e('0xbf'),'attachments',_0x973e('0xcf'),_0xe2e15a[_0x973e('0x68')]);fs_extra[_0x973e('0xe5')](_0x1a9a4d)[_0x973e('0x49')](function(_0x29ec58){logger[_0x973e('0x18')](_0x973e('0xe6'),_0x1a9a4d,_0x29ec58);});}});};exports[_0x973e('0xe7')]=function(_0x2e8361,_0x45dced){return db[_0x973e('0xa9')][_0x973e('0x48')]({'where':{'id':_0x2e8361[_0x973e('0x54')]['id']}})['then'](handleEntityNotFound(_0x45dced,null))[_0x973e('0x28')](function(_0x102561){if(_0x102561){return _0x102561[_0x973e('0xe7')](_0x2e8361[_0x973e('0x4b')][_0x973e('0x5e')],_['omit'](_0x2e8361[_0x973e('0x4b')],[_0x973e('0x5e'),'id'])||{});}})[_0x973e('0x28')](respondWithResult(_0x45dced,null))[_0x973e('0x49')](handleError(_0x45dced,null));};exports[_0x973e('0xe8')]=function(_0xd29d5a,_0x34436b){var _0x3d3a3a={'raw':![],'where':{}};var _0xc56ba9={};var _0x17c897={'count':0x0,'rows':[]};return db[_0x973e('0x31')][_0x973e('0x62')]({'where':{'id':_0xd29d5a['params']['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x34436b,null))[_0x973e('0x28')](function(_0x468491){if(_0x468491){_0xc56ba9['model']=_[_0x973e('0x37')](db[_0x973e('0xa9')][_0x973e('0x32')]);_0xc56ba9[_0x973e('0x36')]=_[_0x973e('0x37')](_0xd29d5a[_0x973e('0x36')]);_0xc56ba9[_0x973e('0x38')]=_[_0x973e('0x39')](_0xc56ba9['model'],_0xc56ba9[_0x973e('0x36')]);_0x3d3a3a['attributes']=_[_0x973e('0x39')](_0xc56ba9['model'],qs[_0x973e('0x3b')](_0xd29d5a[_0x973e('0x36')][_0x973e('0x3b')]));_0x3d3a3a[_0x973e('0x3a')]=_0x3d3a3a['attributes']['length']?_0x3d3a3a[_0x973e('0x3a')]:_0xc56ba9['model'];if(!_0xd29d5a[_0x973e('0x36')][_0x973e('0x3d')](_0x973e('0x3e'))){_0x3d3a3a[_0x973e('0x23')]=qs[_0x973e('0x23')](_0xd29d5a['query'][_0x973e('0x23')]);_0x3d3a3a[_0x973e('0x21')]=qs[_0x973e('0x21')](_0xd29d5a[_0x973e('0x36')]['offset']);}_0x3d3a3a[_0x973e('0x3f')]=qs[_0x973e('0x40')](_0xd29d5a['query'][_0x973e('0x40')]);_0x3d3a3a[_0x973e('0x42')]=qs['filters'](_[_0x973e('0x5b')](_0xd29d5a[_0x973e('0x36')],_0xc56ba9[_0x973e('0x38')]));_0x3d3a3a[_0x973e('0x42')][_0x973e('0x58')]=_0x468491['id'];if(_0xd29d5a[_0x973e('0x36')][_0x973e('0x41')]){_0x3d3a3a['where']=_[_0x973e('0x43')](_0x3d3a3a[_0x973e('0x42')],{'$or':_[_0x973e('0x30')](_0x3d3a3a[_0x973e('0x3a')],function(_0x371c71){var _0x3b66b1={};_0x3b66b1[_0x371c71]={'$like':'%'+_0xd29d5a[_0x973e('0x36')]['filter']+'%'};return _0x3b66b1;})});}_0x3d3a3a=_[_0x973e('0x43')]({},_0x3d3a3a,_0xd29d5a[_0x973e('0x47')]);return db[_0x973e('0xa9')][_0x973e('0x24')]({'where':_0x3d3a3a[_0x973e('0x42')]})['then'](function(_0x15abaf){_0x17c897['count']=_0x15abaf;if(_0xd29d5a[_0x973e('0x36')][_0x973e('0x46')]){_0x3d3a3a[_0x973e('0x45')]=[{'model':db[_0x973e('0x83')],'as':_0x973e('0xe9'),'required':![]},{'model':db[_0x973e('0xb5')],'as':'Owner','attributes':[_0x973e('0x2c'),_0x973e('0xea'),_0x973e('0xeb')],'required':![]},{'model':db[_0x973e('0xec')],'as':_0x973e('0xed'),'attributes':['id',_0x973e('0x2c'),_0x973e('0xee')],'where':_0xd29d5a[_0x973e('0x36')][_0x973e('0xef')]?{'id':_0xd29d5a[_0x973e('0x36')]['tag']}:undefined,'required':_0xd29d5a['query'][_0x973e('0xef')]?!![]:![]}];}return db[_0x973e('0xa9')][_0x973e('0x63')](_0x3d3a3a);})[_0x973e('0x28')](function(_0xc3191a){_0x17c897['rows']=_0xc3191a;return _0x17c897;});}})[_0x973e('0x28')](respondWithFilteredResult(_0x34436b,_0x3d3a3a))['catch'](handleError(_0x34436b,null));};function iftimePromise(_0x8c695f,_0x445012){return respondWithRpcPromise('Command',_0x973e('0xf0'),{'command':_0x445012[_0x973e('0xf1')]?util[_0x973e('0xa4')]('iftime\x20%s,%s',_0x8c695f[_0x973e('0xf2')],_0x445012[_0x973e('0xf1')]):util[_0x973e('0xa4')](_0x973e('0xf3'),_0x8c695f[_0x973e('0xf2')])},client9002)['then'](function(_0x14609d){var _0x2d1686=_0x14609d&&_0x14609d[_0x973e('0xf4')]('true')>=0x0?!![]:![];logger[_0x973e('0x14')](_0x973e('0xf5'),_0x445012['id'],_0x8c695f['id'],_0x8c695f[_0x973e('0xf2')],_0x2d1686?_0x973e('0xf6'):_0x973e('0xf7'),_0x445012[_0x973e('0xf1')]?_0x445012['timezone']:_0x973e('0xf8'));return _0x2d1686;})[_0x973e('0x49')](function(_0x18ce43){logger['error'](_0x973e('0xf5'),_0x445012['id'],_0x8c695f['id'],_0x8c695f[_0x973e('0xf2')],util[_0x973e('0xf9')](_0x18ce43,{'showHidden':![],'depth':null}),_0x445012[_0x973e('0xf1')]?_0x445012['timezone']:_0x973e('0xf8'));return![];});}exports[_0x973e('0xf0')]=function(_0x4f61c9,_0x110b9a){var _0x78ef25=0x0;var _0x3f8a2f=0x0;var _0x30e961=![];var _0xd0ff5c;var _0x406de3;return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x4f61c9[_0x973e('0x54')]['id']},'include':[{'model':db[_0x973e('0xfa')],'as':_0x973e('0xfa'),'include':[{'model':db[_0x973e('0xfa')],'as':_0x973e('0xfb'),'attributes':['id',_0x973e('0xf2')],'raw':!![]}]}]})[_0x973e('0x28')](handleEntityNotFound(_0x110b9a,null))['then'](function(_0x15bb20){if(_0x15bb20){_0xd0ff5c=_0x15bb20;return _0x15bb20[_0x973e('0xfc')]({'raw':!![]});}})['then'](function(_0x445a49){if(_0xd0ff5c){if(_0x445a49){_0x406de3=_0x445a49;}}return require(_0x973e('0x70'))['getLicense']();})[_0x973e('0x28')](function(_0x2f26c0){if(_0x2f26c0){_0x3f8a2f=_0x2f26c0['virtual'];_0x30e961=_0x2f26c0['custom'];}})[_0x973e('0x28')](function(){return db[_0x973e('0xa9')][_0x973e('0x24')]({'where':{'closed':![]}});})[_0x973e('0x28')](function(_0x17a96d){_0x78ef25=_0x17a96d;if(_0x3f8a2f&&_0x17a96d>_0x3f8a2f){return db[_0x973e('0xfd')]['findOne']({'where':{'id':0x1}})[_0x973e('0x28')](function(_0x5b1db5){if(_0x5b1db5){_0x5b1db5[_0x973e('0xfe')](_0x973e('0xff'));}});}})['then'](function(){if(_0xd0ff5c[_0x973e('0xfa')]&&_0xd0ff5c[_0x973e('0xfa')][_0x973e('0xfb')]){var _0x1a6240=[];for(var _0x59d3a0=0x0;_0x59d3a0<_0xd0ff5c[_0x973e('0xfa')][_0x973e('0xfb')]['length'];_0x59d3a0++){var _0x5b82b8=_0xd0ff5c['Interval'][_0x973e('0xfb')][_0x59d3a0]['get']({'plain':!![]});_0x1a6240['push'](iftimePromise(_0x5b82b8,_0xd0ff5c));}return BPromise[_0x973e('0x100')](_0x1a6240)['then'](function(_0x3f2099){return _[_0x973e('0x101')](_0x3f2099);});}else{return!![];}})[_0x973e('0x28')](function(_0x553139){var _0x53163c=fs[_0x973e('0xc7')](path['join'](config[_0x973e('0x6f')],_0x973e('0x102')),_0x973e('0x103'));var _0x4a76a9={'remote':_0xd0ff5c['remote'],'query':querystring[_0x973e('0xa7')](_[_0x973e('0x43')](_0xd0ff5c[_0x973e('0x2a')]({'plain':!![]}),{'customerIp':_0x4f61c9[_0x973e('0x81')][_0x973e('0x9d')]||_0x4f61c9['headers']['x-real-ip']||_0x4f61c9['connection']['remoteAddress']||_0x4f61c9['ip'],'referer':_0x4f61c9[_0x973e('0x81')]['referer'],'openedInteractions':_0x78ef25,'maxInteractions':_0x3f8a2f,'virtual':_0x30e961[_0x973e('0x104')],'online':_0x553139,'custom':_0x30e961}))[_0x973e('0x105')](/'/g,'\x5c\x27')};_0x110b9a[_0x973e('0x2d')](ejs[_0x973e('0xc9')](Mustache['render'](_0x53163c,_0x4a76a9),{'proactiveActions':_0x406de3,'alignment':_0xd0ff5c[_0x973e('0x106')],'verticalAlignment':_0xd0ff5c[_0x973e('0x107')],'div_color':_0xd0ff5c['color'],'labelText':_0xd0ff5c[_0x973e('0x108')],'text_color':_0xd0ff5c[_0x973e('0x109')],'button_color':_0xd0ff5c[_0x973e('0x10a')],'background_color':_0xd0ff5c[_0x973e('0x10b')],'hideWhenOffline':_0xd0ff5c['hideWhenOffline'],'interval':_0xd0ff5c[_0x973e('0x10c')]}));})[_0x973e('0x49')](handleError(_0x110b9a,null));};exports[_0x973e('0x10d')]=function(_0x4cc435,_0x4b808d){var _0xb4202e=_0x4cc435[_0x973e('0x54')]['id'];var _0x29b058=_0x4cc435['body'];var _0x81080a=0xc8;var _0x3da563=null;return db[_0x973e('0xd1')][_0x973e('0xd2')]({'isolationLevel':db[_0x973e('0xd1')][_0x973e('0x10e')][_0x973e('0x10f')]['READ_COMMITTED']},function(_0xb2ab7b){return db[_0x973e('0x31')][_0x973e('0x62')]({'where':{'id':_0xb4202e},'transaction':_0xb2ab7b})[_0x973e('0x28')](function(_0x2b64c7){if(_0x2b64c7){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0xb4202e},'transaction':_0xb2ab7b})[_0x973e('0x28')](function(){var _0x3f68aa=_['map'](_0x29b058,function(_0x1637c0){_0x1637c0[_0x973e('0x58')]=_0xb4202e;return _0x1637c0;});return db[_0x973e('0x93')]['bulkCreate'](_0x3f68aa,{'transaction':_0xb2ab7b});});}else{_0x81080a=0x194;_0x3da563=[];}});})['then'](function(){if(_0x81080a!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0xb4202e},'order':_0x973e('0x110')})['then'](function(_0x531c86){_0x3da563=_0x531c86;});}})['catch'](function(_0x241bf6){_0x81080a=0x1f4;logger[_0x973e('0x18')](_0x241bf6[_0x973e('0x2b')]);if(_0x241bf6['name']){delete _0x241bf6[_0x973e('0x2c')];}_0x3da563=_0x241bf6;})[_0x973e('0x111')](function(){if(_0x3da563===null){_0x4b808d[_0x973e('0x1d')](_0x81080a);}else{if(_0x81080a===0x1f4){_0x4b808d['status'](_0x81080a)['send'](_0x3da563);}else{_0x4b808d[_0x973e('0x1e')](_0x81080a)[_0x973e('0x20')](_0x3da563);}}});};exports[_0x973e('0x112')]=function(_0x1146af,_0x3e675c){var _0x48f673={};var _0x2f5eb4={};var _0x44fdf5;var _0x50e0a9;return db['ChatWebsite'][_0x973e('0x62')]({'where':{'id':_0x1146af['params']['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x3e675c,null))[_0x973e('0x28')](function(_0xf37d31){if(_0xf37d31){_0x44fdf5=_0xf37d31;_0x2f5eb4[_0x973e('0x35')]=_['keys'](db[_0x973e('0x93')]['rawAttributes']);_0x2f5eb4[_0x973e('0x36')]=_[_0x973e('0x37')](_0x1146af[_0x973e('0x36')]);_0x2f5eb4[_0x973e('0x38')]=_[_0x973e('0x39')](_0x2f5eb4[_0x973e('0x35')],_0x2f5eb4[_0x973e('0x36')]);_0x48f673[_0x973e('0x3a')]=_[_0x973e('0x39')](_0x2f5eb4[_0x973e('0x35')],qs['fields'](_0x1146af[_0x973e('0x36')]['fields']));_0x48f673[_0x973e('0x3a')]=_0x48f673[_0x973e('0x3a')]['length']?_0x48f673[_0x973e('0x3a')]:_0x2f5eb4['model'];_0x48f673[_0x973e('0x3f')]=qs[_0x973e('0x40')](_0x1146af[_0x973e('0x36')][_0x973e('0x40')]);_0x48f673[_0x973e('0x42')]=qs[_0x973e('0x38')](_['pick'](_0x1146af[_0x973e('0x36')],_0x2f5eb4[_0x973e('0x38')]));if(_0x1146af[_0x973e('0x36')]['filter']){_0x48f673[_0x973e('0x42')]=_['merge'](_0x48f673[_0x973e('0x42')],{'$or':_[_0x973e('0x30')](_0x48f673[_0x973e('0x3a')],function(_0x119bd8){var _0x17c7d6={};_0x17c7d6[_0x119bd8]={'$like':'%'+_0x1146af[_0x973e('0x36')]['filter']+'%'};return _0x17c7d6;})});}_0x48f673=_[_0x973e('0x43')]({},_0x48f673,_0x1146af['options']);return _0x44fdf5['getApplications'](_0x48f673);}})[_0x973e('0x28')](function(_0x2ad9d9){if(_0x2ad9d9){_0x50e0a9=_0x2ad9d9[_0x973e('0x3c')];if(!_0x1146af['query'][_0x973e('0x3d')](_0x973e('0x3e'))){_0x48f673[_0x973e('0x23')]=qs[_0x973e('0x23')](_0x1146af[_0x973e('0x36')][_0x973e('0x23')]);_0x48f673[_0x973e('0x21')]=qs[_0x973e('0x21')](_0x1146af[_0x973e('0x36')][_0x973e('0x21')]);}return _0x44fdf5[_0x973e('0x112')](_0x48f673);}})[_0x973e('0x28')](function(_0x120258){if(_0x120258){return _0x120258?{'count':_0x50e0a9,'rows':_0x120258}:null;}})['then'](respondWithResult(_0x3e675c,null))['catch'](handleError(_0x3e675c,null));};exports[_0x973e('0x113')]=function(_0x3f8dae,_0x31e4eb){return db[_0x973e('0x114')][_0x973e('0x48')]({'where':{'id':_0x3f8dae[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x31e4eb,null))[_0x973e('0x28')](function(_0x5f8737){if(_0x5f8737){return _0x5f8737[_0x973e('0x113')](_0x3f8dae['body'][_0x973e('0x5e')],_['omit'](_0x3f8dae[_0x973e('0x4b')],[_0x973e('0x5e'),'id'])||{});}})[_0x973e('0x28')](respondWithResult(_0x31e4eb,null))['catch'](handleError(_0x31e4eb,null));};exports['getProactiveActions']=function(_0xac15c9,_0x2e08cf){var _0x4ebaa4={};var _0x315670={};var _0x1c4fba;var _0x17c83b;return db[_0x973e('0x31')][_0x973e('0x62')]({'where':{'id':_0xac15c9[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x2e08cf,null))['then'](function(_0x35f4f9){if(_0x35f4f9){_0x1c4fba=_0x35f4f9;_0x315670[_0x973e('0x35')]=_[_0x973e('0x37')](db[_0x973e('0x115')][_0x973e('0x32')]);_0x315670[_0x973e('0x36')]=_[_0x973e('0x37')](_0xac15c9[_0x973e('0x36')]);_0x315670[_0x973e('0x38')]=_[_0x973e('0x39')](_0x315670[_0x973e('0x35')],_0x315670['query']);_0x4ebaa4[_0x973e('0x3a')]=_[_0x973e('0x39')](_0x315670[_0x973e('0x35')],qs[_0x973e('0x3b')](_0xac15c9[_0x973e('0x36')][_0x973e('0x3b')]));_0x4ebaa4[_0x973e('0x3a')]=_0x4ebaa4[_0x973e('0x3a')]['length']?_0x4ebaa4[_0x973e('0x3a')]:_0x315670['model'];_0x4ebaa4[_0x973e('0x3f')]=qs[_0x973e('0x40')](_0xac15c9['query'][_0x973e('0x40')]);_0x4ebaa4[_0x973e('0x42')]=qs['filters'](_['pick'](_0xac15c9['query'],_0x315670['filters']));if(_0xac15c9[_0x973e('0x36')][_0x973e('0x41')]){_0x4ebaa4[_0x973e('0x42')]=_[_0x973e('0x43')](_0x4ebaa4[_0x973e('0x42')],{'$or':_[_0x973e('0x30')](_0x4ebaa4['attributes'],function(_0x17e925){var _0xa511df={};_0xa511df[_0x17e925]={'$like':'%'+_0xac15c9['query'][_0x973e('0x41')]+'%'};return _0xa511df;})});}_0x4ebaa4=_[_0x973e('0x43')]({},_0x4ebaa4,_0xac15c9[_0x973e('0x47')]);return _0x1c4fba[_0x973e('0xfc')](_0x4ebaa4);}})['then'](function(_0x3bd1af){if(_0x3bd1af){_0x17c83b=_0x3bd1af['length'];if(!_0xac15c9[_0x973e('0x36')]['hasOwnProperty'](_0x973e('0x3e'))){_0x4ebaa4[_0x973e('0x23')]=qs[_0x973e('0x23')](_0xac15c9[_0x973e('0x36')]['limit']);_0x4ebaa4[_0x973e('0x21')]=qs[_0x973e('0x21')](_0xac15c9[_0x973e('0x36')][_0x973e('0x21')]);}return _0x1c4fba[_0x973e('0xfc')](_0x4ebaa4);}})[_0x973e('0x28')](function(_0x5a9aae){if(_0x5a9aae){return _0x5a9aae?{'count':_0x17c83b,'rows':_0x5a9aae}:null;}})[_0x973e('0x28')](respondWithResult(_0x2e08cf,null))['catch'](handleError(_0x2e08cf,null));};exports[_0x973e('0x116')]=function(_0x2818cb,_0x942d82){var _0xcea677=_0x2818cb[_0x973e('0x36')]['online']===_0x973e('0x117')?_0x973e('0x118'):_0x973e('0x119');return db[_0x973e('0x31')][_0x973e('0x48')]({'attributes':['id',_0xcea677],'where':{'id':_0x2818cb[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x942d82,null))[_0x973e('0x28')](function(_0x1b88e1){if(_0x1b88e1){var _0x307e48=_0x1b88e1[_0xcea677];var _0xf64f23=_0x307e48&&_0x307e48['items']?_0x307e48[_0x973e('0x11a')]:[];_0x942d82[_0x973e('0x2d')]({'fromKey':_[_0x973e('0x73')](_0x307e48['fromKey'])?undefined:_0x307e48[_0x973e('0x11b')],'count':_0xf64f23['length'],'rows':_0xf64f23});}})[_0x973e('0x49')](handleError(_0x942d82,null));};exports[_0x973e('0x11c')]=function(_0x368b96,_0x5f2862){var _0xc80d8c={'raw':![],'where':{}};var _0x5c6153={};var _0x4ad7ec={'count':0x0,'rows':[]};return db[_0x973e('0x31')][_0x973e('0x62')]({'where':{'id':_0x368b96[_0x973e('0x54')]['id']}})['then'](handleEntityNotFound(_0x5f2862,null))[_0x973e('0x28')](function(_0x5ed665){if(_0x5ed665){_0x5c6153[_0x973e('0x35')]=_[_0x973e('0x37')](db[_0x973e('0x11d')][_0x973e('0x32')]);_0x5c6153[_0x973e('0x36')]=_['keys'](_0x368b96[_0x973e('0x36')]);_0x5c6153['filters']=_[_0x973e('0x39')](_0x5c6153['model'],_0x5c6153[_0x973e('0x36')]);_0xc80d8c[_0x973e('0x3a')]=_[_0x973e('0x39')](_0x5c6153['model'],qs[_0x973e('0x3b')](_0x368b96[_0x973e('0x36')][_0x973e('0x3b')]));_0xc80d8c[_0x973e('0x3a')]=_0xc80d8c[_0x973e('0x3a')]['length']?_0xc80d8c[_0x973e('0x3a')]:_0x5c6153['model'];if(!_0x368b96[_0x973e('0x36')][_0x973e('0x3d')](_0x973e('0x3e'))){_0xc80d8c[_0x973e('0x23')]=qs[_0x973e('0x23')](_0x368b96['query'][_0x973e('0x23')]);_0xc80d8c[_0x973e('0x21')]=qs[_0x973e('0x21')](_0x368b96[_0x973e('0x36')]['offset']);}_0xc80d8c['order']=qs[_0x973e('0x40')](_0x368b96[_0x973e('0x36')]['sort']);_0xc80d8c['where']=qs['filters'](_['pick'](_0x368b96['query'],_0x5c6153['filters']));_0xc80d8c[_0x973e('0x42')]['ChatWebsiteId']=_0x5ed665['id'];if(_0x368b96[_0x973e('0x36')][_0x973e('0x41')]){_0xc80d8c[_0x973e('0x42')]=_[_0x973e('0x43')](_0xc80d8c[_0x973e('0x42')],{'$or':_[_0x973e('0x30')](_0xc80d8c[_0x973e('0x3a')],function(_0x3506fc){var _0x101537={};_0x101537[_0x3506fc]={'$like':'%'+_0x368b96[_0x973e('0x36')]['filter']+'%'};return _0x101537;})});}_0xc80d8c=_[_0x973e('0x43')]({},_0xc80d8c,_0x368b96['options']);return db['ChatOfflineMessage'][_0x973e('0x24')]({'where':_0xc80d8c[_0x973e('0x42')]})[_0x973e('0x28')](function(_0x8cc3ac){_0x4ad7ec[_0x973e('0x24')]=_0x8cc3ac;if(_0x368b96[_0x973e('0x36')][_0x973e('0x46')]){_0xc80d8c[_0x973e('0x45')]=[{'all':!![]}];}else{_0xc80d8c['include']=[{'model':db['CmContact'],'as':_0x973e('0xe9'),'required':![]},{'model':db[_0x973e('0xd3')],'as':_0x973e('0x11e'),'required':![]}];}return db[_0x973e('0x11d')][_0x973e('0x63')](_0xc80d8c);})['then'](function(_0x229730){_0x4ad7ec[_0x973e('0x5c')]=_0x229730;return _0x4ad7ec;});}})[_0x973e('0x28')](respondWithFilteredResult(_0x5f2862,_0xc80d8c))['catch'](handleError(_0x5f2862,null));};exports['addAgents']=function(_0x13c59b,_0x2b696b){return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x13c59b['params']['id']}})['then'](handleEntityNotFound(_0x2b696b,null))[_0x973e('0x28')](function(_0x8e2b38){if(_0x8e2b38){return _0x8e2b38[_0x973e('0x11f')](_0x13c59b[_0x973e('0x4b')]['ids'],_[_0x973e('0x120')](_0x13c59b[_0x973e('0x4b')],[_0x973e('0x5e'),'id'])||{})[_0x973e('0xad')](function(_0x366962){for(var _0x5b0763=0x0;_0x5b0763<_0x13c59b[_0x973e('0x4b')][_0x973e('0x5e')]['length'];_0x5b0763+=0x1){socket[_0x973e('0x121')](_0x973e('0x122'),{'UserId':Number(_0x13c59b[_0x973e('0x4b')]['ids'][_0x5b0763]),'ChatWebsiteId':Number(_0x13c59b[_0x973e('0x54')]['id'])});}return _0x366962;});}})[_0x973e('0x28')](respondWithResult(_0x2b696b,null))[_0x973e('0x49')](handleError(_0x2b696b,null));};exports[_0x973e('0x123')]=function(_0x2ac3af,_0x5eae14){return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x2ac3af[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x5eae14,null))[_0x973e('0x28')](function(_0x1e8a4e){if(_0x1e8a4e){return _0x1e8a4e[_0x973e('0x123')](_0x2ac3af[_0x973e('0x36')][_0x973e('0x5e')])['then'](function(){if(_[_0x973e('0x124')](_0x2ac3af[_0x973e('0x36')]['ids'])){for(var _0x2dee3c=0x0;_0x2dee3c<_0x2ac3af[_0x973e('0x36')]['ids'][_0x973e('0x3c')];_0x2dee3c+=0x1){socket[_0x973e('0x121')](_0x973e('0x125'),{'UserId':Number(_0x2ac3af[_0x973e('0x36')]['ids'][_0x2dee3c]),'ChatWebsiteId':Number(_0x2ac3af['params']['id'])});}}else{socket['emit'](_0x973e('0x125'),{'UserId':Number(_0x2ac3af[_0x973e('0x36')][_0x973e('0x5e')]),'ChatWebsiteId':Number(_0x2ac3af[_0x973e('0x54')]['id'])});}});}})[_0x973e('0x28')](respondWithStatusCode(_0x5eae14,null))['catch'](handleError(_0x5eae14,null));};exports[_0x973e('0x126')]=function(_0x30eb8c,_0x4f5816){var _0x5c4717={};var _0x43277e={};var _0x3a276a;var _0x5d8bc8;return db[_0x973e('0x31')][_0x973e('0x62')]({'where':{'id':_0x30eb8c[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x4f5816,null))[_0x973e('0x28')](function(_0xa5e65e){if(_0xa5e65e){_0x3a276a=_0xa5e65e;_0x43277e[_0x973e('0x35')]=_[_0x973e('0x37')](db[_0x973e('0xb5')][_0x973e('0x32')]);_0x43277e['query']=_[_0x973e('0x37')](_0x30eb8c['query']);_0x43277e[_0x973e('0x38')]=_[_0x973e('0x39')](_0x43277e[_0x973e('0x35')],_0x43277e[_0x973e('0x36')]);_0x5c4717[_0x973e('0x3a')]=_[_0x973e('0x39')](_0x43277e[_0x973e('0x35')],qs[_0x973e('0x3b')](_0x30eb8c[_0x973e('0x36')][_0x973e('0x3b')]));_0x5c4717[_0x973e('0x3a')]=_0x5c4717[_0x973e('0x3a')][_0x973e('0x3c')]?_0x5c4717[_0x973e('0x3a')]:_0x43277e[_0x973e('0x35')];_0x5c4717[_0x973e('0x3f')]=qs['sort'](_0x30eb8c[_0x973e('0x36')]['sort']);_0x5c4717[_0x973e('0x42')]=qs[_0x973e('0x38')](_[_0x973e('0x5b')](_0x30eb8c[_0x973e('0x36')],_0x43277e[_0x973e('0x38')]));if(_0x30eb8c['query']['filter']){_0x5c4717[_0x973e('0x42')]=_[_0x973e('0x43')](_0x5c4717[_0x973e('0x42')],{'$or':_[_0x973e('0x30')](_0x5c4717[_0x973e('0x3a')],function(_0x17190f){var _0x35d0da={};_0x35d0da[_0x17190f]={'$like':'%'+_0x30eb8c[_0x973e('0x36')][_0x973e('0x41')]+'%'};return _0x35d0da;})});}_0x5c4717=_[_0x973e('0x43')]({},_0x5c4717,_0x30eb8c[_0x973e('0x47')]);return _0x3a276a[_0x973e('0x126')](_0x5c4717);}})[_0x973e('0x28')](function(_0x2d510a){if(_0x2d510a){_0x5d8bc8=_0x2d510a[_0x973e('0x3c')];if(!_0x30eb8c[_0x973e('0x36')][_0x973e('0x3d')](_0x973e('0x3e'))){_0x5c4717[_0x973e('0x23')]=qs[_0x973e('0x23')](_0x30eb8c[_0x973e('0x36')]['limit']);_0x5c4717[_0x973e('0x21')]=qs['offset'](_0x30eb8c[_0x973e('0x36')][_0x973e('0x21')]);}return _0x3a276a[_0x973e('0x126')](_0x5c4717);}})[_0x973e('0x28')](function(_0x2220bb){if(_0x2220bb){return _0x2220bb?{'count':_0x5d8bc8,'rows':_0x2220bb}:null;}})[_0x973e('0x28')](respondWithResult(_0x4f5816,null))['catch'](handleError(_0x4f5816,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 7dbeff7..e96c38d 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 _0xd5b2=['update','remove','hasOwnProperty','exports','../../mysqldb','ChatWebsite','save'];(function(_0x29afc6,_0x37118f){var _0x23fb71=function(_0x2f435c){while(--_0x2f435c){_0x29afc6['push'](_0x29afc6['shift']());}};_0x23fb71(++_0x37118f);}(_0xd5b2,0x10e));var _0x2d5b=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xd5b2[_0x24061a];return _0x82054e;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x2d5b('0x0'))['db'][_0x2d5b('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2d5b('0x2'),'afterUpdate':_0x2d5b('0x3'),'afterDestroy':_0x2d5b('0x4')};function emitEvent(_0x2846a3){return function(_0x5c31d3,_0x39ef3,_0x4f4491){ChatWebsiteEvents['emit'](_0x2846a3+':'+_0x5c31d3['id'],_0x5c31d3);ChatWebsiteEvents['emit'](_0x2846a3,_0x5c31d3);_0x4f4491(null);};}for(var e in events){if(events[_0x2d5b('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x2d5b('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0x8b2d=['update','emit','hasOwnProperty','hook','exports','ChatWebsite','save'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x8b2d,0xe5));var _0xd8b2=function(_0x1c2f29,_0x5a2668){_0x1c2f29=_0x1c2f29-0x0;var _0x258465=_0x8b2d[_0x1c2f29];return _0x258465;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xd8b2('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd8b2('0x1'),'afterUpdate':_0xd8b2('0x2'),'afterDestroy':'remove'};function emitEvent(_0x273310){return function(_0x3a7304,_0x55a03c,_0x2ad404){ChatWebsiteEvents[_0xd8b2('0x3')](_0x273310+':'+_0x3a7304['id'],_0x3a7304);ChatWebsiteEvents[_0xd8b2('0x3')](_0x273310,_0x3a7304);_0x2ad404(null);};}for(var e in events){if(events[_0xd8b2('0x4')](e)){var event=events[e];ChatWebsite[_0xd8b2('0x5')](e,emitEvent(event));}}module[_0xd8b2('0x6')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 28c0ff2..4c2adcf 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 _0x2912=['ChatWebsite','chat_websites','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define'];(function(_0x5cda82,_0x9b5ed5){var _0x2115c3=function(_0x4f0126){while(--_0x4f0126){_0x5cda82['push'](_0x5cda82['shift']());}};_0x2115c3(++_0x9b5ed5);}(_0x2912,0xac));var _0x2291=function(_0x32e717,_0x303a61){_0x32e717=_0x32e717-0x0;var _0xb3c72=_0x2912[_0x32e717];return _0xb3c72;};'use strict';var _=require('lodash');var util=require(_0x2291('0x0'));var logger=require(_0x2291('0x1'))(_0x2291('0x2'));var moment=require(_0x2291('0x3'));var BPromise=require('bluebird');var rp=require(_0x2291('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2291('0x5'));var config=require(_0x2291('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x1167fd,_0x545468){return _0x1167fd[_0x2291('0x7')](_0x2291('0x8'),attributes,{'tableName':_0x2291('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66b3=['lodash','util','../../config/logger','api','moment','bluebird','path','./chatWebsite.attributes','ChatWebsite','chat_websites'];(function(_0x8cf101,_0xc97822){var _0x129dfc=function(_0x9c0f29){while(--_0x9c0f29){_0x8cf101['push'](_0x8cf101['shift']());}};_0x129dfc(++_0xc97822);}(_0x66b3,0x118));var _0x366b=function(_0x5b559e,_0x159258){_0x5b559e=_0x5b559e-0x0;var _0x27ddb7=_0x66b3[_0x5b559e];return _0x27ddb7;};'use strict';var _=require(_0x366b('0x0'));var util=require(_0x366b('0x1'));var logger=require(_0x366b('0x2'))(_0x366b('0x3'));var moment=require(_0x366b('0x4'));var BPromise=require(_0x366b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x366b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x366b('0x7'));module['exports']=function(_0x3abd12,_0x463f5f){return _0x3abd12['define'](_0x366b('0x8'),attributes,{'tableName':_0x366b('0x9'),'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 ca69290..04bdca8 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 _0x0c38=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x1ae78f,_0x122ed2){var _0x5baf80=function(_0x28a303){while(--_0x28a303){_0x1ae78f['push'](_0x1ae78f['shift']());}};_0x5baf80(++_0x122ed2);}(_0x0c38,0x145));var _0x80c3=function(_0x56aba9,_0x1f0f43){_0x56aba9=_0x56aba9-0x0;var _0x5746a0=_0x0c38[_0x56aba9];return _0x5746a0;};'use strict';var _=require(_0x80c3('0x0'));var util=require(_0x80c3('0x1'));var moment=require(_0x80c3('0x2'));var BPromise=require(_0x80c3('0x3'));var rs=require(_0x80c3('0x4'));var fs=require('fs');var Redis=require(_0x80c3('0x5'));var db=require(_0x80c3('0x6'))['db'];var utils=require(_0x80c3('0x7'));var logger=require(_0x80c3('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x80c3('0x9'));var client=jayson['client'][_0x80c3('0xa')]({'port':0x232a});config[_0x80c3('0xb')]=_[_0x80c3('0xc')](config[_0x80c3('0xb')],{'host':_0x80c3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x80c3('0xe'))[_0x80c3('0xf')](socket);function respondWithRpcPromise(_0x106a93,_0x50716e,_0x550454){return new BPromise(function(_0x48bf81,_0x1ed6e0){return client[_0x80c3('0x10')](_0x106a93,_0x550454)['then'](function(_0x59b701){logger[_0x80c3('0x11')](_0x80c3('0x12'),_0x50716e,'request\x20sent');logger[_0x80c3('0x13')](_0x80c3('0x14'),_0x50716e,_0x80c3('0x15'),JSON['stringify'](_0x59b701));if(_0x59b701[_0x80c3('0x16')]){if(_0x59b701['error'][_0x80c3('0x17')]===0x1f4){logger[_0x80c3('0x16')](_0x80c3('0x12'),_0x50716e,_0x59b701['error'][_0x80c3('0x18')]);return _0x1ed6e0(_0x59b701[_0x80c3('0x16')][_0x80c3('0x18')]);}logger[_0x80c3('0x16')](_0x80c3('0x12'),_0x50716e,_0x59b701[_0x80c3('0x16')]['message']);return _0x48bf81(_0x59b701[_0x80c3('0x16')][_0x80c3('0x18')]);}else{logger[_0x80c3('0x11')](_0x80c3('0x12'),_0x50716e,_0x80c3('0x15'));_0x48bf81(_0x59b701[_0x80c3('0x19')][_0x80c3('0x18')]);}})[_0x80c3('0x1a')](function(_0x5a4771){logger[_0x80c3('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x50716e,_0x5a4771);_0x1ed6e0(_0x5a4771);});});} \ No newline at end of file +var _0x391f=['./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','defaults','localhost'];(function(_0x2e738d,_0x4c5d8a){var _0x760f9d=function(_0x414065){while(--_0x414065){_0x2e738d['push'](_0x2e738d['shift']());}};_0x760f9d(++_0x4c5d8a);}(_0x391f,0xfe));var _0xf391=function(_0x5a50cb,_0x5e507c){_0x5a50cb=_0x5a50cb-0x0;var _0x17189f=_0x391f[_0x5a50cb];return _0x17189f;};'use strict';var _=require('lodash');var util=require(_0xf391('0x0'));var moment=require('moment');var BPromise=require(_0xf391('0x1'));var rs=require(_0xf391('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf391('0x3'))['db'];var utils=require(_0xf391('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf391('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf391('0x6')][_0xf391('0x7')]({'port':0x232a});config['redis']=_[_0xf391('0x8')](config['redis'],{'host':_0xf391('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf391('0xa'))[_0xf391('0xb')](socket);function respondWithRpcPromise(_0x5988a2,_0xae796b,_0x412617){return new BPromise(function(_0x2721d3,_0x2ff15b){return client[_0xf391('0xc')](_0x5988a2,_0x412617)['then'](function(_0x3f00b4){logger[_0xf391('0xd')](_0xf391('0xe'),_0xae796b,_0xf391('0xf'));logger[_0xf391('0x10')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xae796b,_0xf391('0xf'),JSON[_0xf391('0x11')](_0x3f00b4));if(_0x3f00b4[_0xf391('0x12')]){if(_0x3f00b4['error'][_0xf391('0x13')]===0x1f4){logger['error'](_0xf391('0xe'),_0xae796b,_0x3f00b4[_0xf391('0x12')][_0xf391('0x14')]);return _0x2ff15b(_0x3f00b4[_0xf391('0x12')][_0xf391('0x14')]);}logger['error'](_0xf391('0xe'),_0xae796b,_0x3f00b4[_0xf391('0x12')]['message']);return _0x2721d3(_0x3f00b4['error'][_0xf391('0x14')]);}else{logger[_0xf391('0xd')](_0xf391('0xe'),_0xae796b,_0xf391('0xf'));_0x2721d3(_0x3f00b4[_0xf391('0x15')]['message']);}})['catch'](function(_0x325c5e){logger['error'](_0xf391('0xe'),_0xae796b,_0x325c5e);_0x2ff15b(_0x325c5e);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 4f674a9..a5ff4fc 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 _0x652f=['register','chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener'];(function(_0x83af7f,_0x49c6fd){var _0x32d85c=function(_0xf0e8bc){while(--_0xf0e8bc){_0x83af7f['push'](_0x83af7f['shift']());}};_0x32d85c(++_0x49c6fd);}(_0x652f,0x1c9));var _0xf652=function(_0x1c28e6,_0x2e3710){_0x1c28e6=_0x1c28e6-0x0;var _0x6727cb=_0x652f[_0x1c28e6];return _0x6727cb;};'use strict';var ChatWebsiteEvents=require(_0xf652('0x0'));var events=[_0xf652('0x1'),_0xf652('0x2'),'update'];function createListener(_0x35bbdb,_0x1d0be3){return function(_0x10d5b5){_0x1d0be3[_0xf652('0x3')](_0x35bbdb,_0x10d5b5);};}function removeListener(_0x578a0b,_0x582c85){return function(){ChatWebsiteEvents[_0xf652('0x4')](_0x578a0b,_0x582c85);};}exports[_0xf652('0x5')]=function(_0x2e7353){for(var _0x38f765=0x0,_0x105092=events['length'];_0x38f765<_0x105092;_0x38f765++){var _0xfc3733=events[_0x38f765];var _0x117741=createListener(_0xf652('0x6')+_0xfc3733,_0x2e7353);ChatWebsiteEvents['on'](_0xfc3733,_0x117741);}}; \ No newline at end of file +var _0xf209=['update','emit','removeListener','register','length','chatWebsite:','save','remove'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0xf209,0xf6));var _0x9f20=function(_0x90e9ab,_0x426802){_0x90e9ab=_0x90e9ab-0x0;var _0xdfa58b=_0xf209[_0x90e9ab];return _0xdfa58b;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x9f20('0x0'),_0x9f20('0x1'),_0x9f20('0x2')];function createListener(_0x1941c7,_0x35f48e){return function(_0x1fd162){_0x35f48e[_0x9f20('0x3')](_0x1941c7,_0x1fd162);};}function removeListener(_0x12e29f,_0x98d256){return function(){ChatWebsiteEvents[_0x9f20('0x4')](_0x12e29f,_0x98d256);};}exports[_0x9f20('0x5')]=function(_0x2ef7a2){for(var _0x1140a9=0x0,_0x4af607=events[_0x9f20('0x6')];_0x1140a9<_0x4af607;_0x1140a9++){var _0x337ad1=events[_0x1140a9];var _0x50dac6=createListener(_0x9f20('0x7')+_0x337ad1,_0x2ef7a2);ChatWebsiteEvents['on'](_0x337ad1,_0x50dac6);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 97748fc..148b192 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 _0x8e9f=['addApplications','addProactiveActions','put','update','delete','/:id','destroy','removeAnswers','/:id/users','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','get','isAuthenticated','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','/:id/dispositions','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','file','addLogo','server/files/images/avatars/','%s-%s','single','originalname','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e9f,0x1d3));var _0xf8e9=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x8e9f[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0xf8e9('0x0'));var util=require(_0xf8e9('0x1'));var path=require('path');var timeout=require(_0xf8e9('0x2'));var express=require(_0xf8e9('0x3'));var router=express[_0xf8e9('0x4')]();var fs_extra=require(_0xf8e9('0x5'));var auth=require(_0xf8e9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf8e9('0x7'));router[_0xf8e9('0x8')]('/',auth[_0xf8e9('0x9')](),controller['index']);router[_0xf8e9('0x8')]('/describe',auth[_0xf8e9('0x9')](),controller[_0xf8e9('0xa')]);router[_0xf8e9('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf8e9('0xb')]);router[_0xf8e9('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf8e9('0xc')]);router[_0xf8e9('0x8')](_0xf8e9('0xd'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0xe')]);router[_0xf8e9('0x8')](_0xf8e9('0xf'),controller[_0xf8e9('0x10')]);router[_0xf8e9('0x8')](_0xf8e9('0x11'),controller[_0xf8e9('0x12')]);router[_0xf8e9('0x8')](_0xf8e9('0x13'),controller[_0xf8e9('0x14')]);router[_0xf8e9('0x8')](_0xf8e9('0x15'),controller[_0xf8e9('0x16')]);router[_0xf8e9('0x8')](_0xf8e9('0x17'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x18')]);router[_0xf8e9('0x8')](_0xf8e9('0x19'),controller[_0xf8e9('0x1a')]);router[_0xf8e9('0x8')](_0xf8e9('0x1b'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x1c')]);router[_0xf8e9('0x8')](_0xf8e9('0x1d'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x1e')]);router['get'](_0xf8e9('0x1f'),controller[_0xf8e9('0x20')]);router['get'](_0xf8e9('0x21'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x22')]);router[_0xf8e9('0x8')]('/:id/users',auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x23')]);router[_0xf8e9('0x24')]('/',auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x25')]);router['post'](_0xf8e9('0x26'),auth[_0xf8e9('0x9')](),controller['addDisposition']);router[_0xf8e9('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xf8e9('0x27')]);var upload=multer({'storage':multer[_0xf8e9('0x28')]({'destination':function(_0x4af8ca,_0x2ea766,_0x4545f6){_0x4545f6(null,path[_0xf8e9('0x29')](config[_0xf8e9('0x2a')],_0xf8e9('0x2b')));},'filename':function(_0x38fc96,_0x3d0952,_0x3324b1){_0x3324b1(null,util[_0xf8e9('0x2c')]('%s-%s',Date[_0xf8e9('0x2d')](),_0x3d0952['originalname']));}})});router['post'](_0xf8e9('0xf'),upload['single'](_0xf8e9('0x2e')),controller[_0xf8e9('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1bb55f,_0x2c9a74,_0x45467a){_0x45467a(null,path[_0xf8e9('0x29')](config[_0xf8e9('0x2a')],_0xf8e9('0x30')));},'filename':function(_0x265f72,_0x763d92,_0x8f739d){_0x8f739d(null,util[_0xf8e9('0x2c')](_0xf8e9('0x31'),Date[_0xf8e9('0x2d')](),_0x763d92['originalname']));}})});router['post'](_0xf8e9('0x11'),upload[_0xf8e9('0x32')]('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5dcf8c,_0x5b5956,_0xdf7ce1){_0xdf7ce1(null,path[_0xf8e9('0x29')](config[_0xf8e9('0x2a')],_0xf8e9('0x30')));},'filename':function(_0x406a37,_0x80f1ca,_0x411fd9){_0x411fd9(null,util[_0xf8e9('0x2c')]('%s-%s',Date[_0xf8e9('0x2d')](),_0x80f1ca[_0xf8e9('0x33')]));}})});router[_0xf8e9('0x24')](_0xf8e9('0x13'),upload[_0xf8e9('0x32')](_0xf8e9('0x2e')),controller[_0xf8e9('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3694fd,_0x439552,_0x203df8){_0x203df8(null,path[_0xf8e9('0x29')](config['root'],_0xf8e9('0x30')));},'filename':function(_0x27ffa5,_0x8848fd,_0x67f7e4){_0x67f7e4(null,util['format'](_0xf8e9('0x31'),Date[_0xf8e9('0x2d')](),_0x8848fd[_0xf8e9('0x33')]));}})});router[_0xf8e9('0x24')]('/:id/system_avatar',upload[_0xf8e9('0x32')](_0xf8e9('0x2e')),controller[_0xf8e9('0x35')]);router[_0xf8e9('0x24')](_0xf8e9('0x36'),controller[_0xf8e9('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0xf8e9('0x28')]({'destination':function(_0x1b29fc,_0x58981a,_0x258fc3){const _0x5d797b=path[_0xf8e9('0x29')](config[_0xf8e9('0x2a')],_0xf8e9('0x38'),_0xf8e9('0x39'),_0xf8e9('0x3a'));fs_extra[_0xf8e9('0x3b')](_0x5d797b,function(){_0x258fc3(null,_0x5d797b);});},'filename':function(_0x2440da,_0x3a69d0,_0x14607a){const _0x57ac21=_0x3a69d0[_0xf8e9('0x33')][_0xf8e9('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4a4774=path['extname'](_0x57ac21);const _0x59aa07=Date[_0xf8e9('0x2d')]()+'-'+_0x57ac21[_0xf8e9('0x3c')](_0x4a4774,'')+_0x4a4774;_0x14607a(null,_0x59aa07);}})});router['post'](_0xf8e9('0x3d'),offlineUploadMulter[_0xf8e9('0x3e')](),controller[_0xf8e9('0x3f')]);router[_0xf8e9('0x24')](_0xf8e9('0x17'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x40')]);router['post']('/:id/applications',auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x41')]);router[_0xf8e9('0x24')](_0xf8e9('0x1d'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x42')]);router['post']('/:id/users',auth[_0xf8e9('0x9')](),controller['addAgents']);router[_0xf8e9('0x43')]('/:id',auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x44')]);router[_0xf8e9('0x45')](_0xf8e9('0x46'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x47')]);router[_0xf8e9('0x45')](_0xf8e9('0x26'),auth[_0xf8e9('0x9')](),controller['removeDispositions']);router[_0xf8e9('0x45')](_0xf8e9('0xd'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x48')]);router[_0xf8e9('0x45')](_0xf8e9('0x49'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x4a')]);module[_0xf8e9('0x4b')]=router; \ No newline at end of file +var _0x2d52=['/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','create','addDisposition','post','addAnswer','diskStorage','join','root','server/files/images/logos/','format','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','now','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','notify','server/files','offline-chat','extname','replace','/:id/offline','any','addProactiveActions','addAgents','update','delete','/:id','destroy','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2d52,0x198));var _0x22d5=function(_0xf3d3d,_0x18c710){_0xf3d3d=_0xf3d3d-0x0;var _0x1e5511=_0x2d52[_0xf3d3d];return _0x1e5511;};'use strict';var multer=require(_0x22d5('0x0'));var util=require('util');var path=require(_0x22d5('0x1'));var timeout=require(_0x22d5('0x2'));var express=require(_0x22d5('0x3'));var router=express[_0x22d5('0x4')]();var fs_extra=require(_0x22d5('0x5'));var auth=require(_0x22d5('0x6'));var interaction=require(_0x22d5('0x7'));var config=require(_0x22d5('0x8'));var controller=require(_0x22d5('0x9'));router['get']('/',auth[_0x22d5('0xa')](),controller[_0x22d5('0xb')]);router['get'](_0x22d5('0xc'),auth[_0x22d5('0xa')](),controller[_0x22d5('0xd')]);router['get']('/:id',auth[_0x22d5('0xa')](),controller[_0x22d5('0xe')]);router['get'](_0x22d5('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x22d5('0x10'),auth[_0x22d5('0xa')](),controller['getAnswers']);router[_0x22d5('0x11')](_0x22d5('0x12'),controller[_0x22d5('0x13')]);router['get'](_0x22d5('0x14'),controller[_0x22d5('0x15')]);router[_0x22d5('0x11')]('/:id/customer_avatar',controller[_0x22d5('0x16')]);router['get'](_0x22d5('0x17'),controller[_0x22d5('0x18')]);router['get']('/:id/interactions',auth[_0x22d5('0xa')](),controller[_0x22d5('0x19')]);router['get'](_0x22d5('0x1a'),controller[_0x22d5('0x1b')]);router[_0x22d5('0x11')](_0x22d5('0x1c'),auth[_0x22d5('0xa')](),controller['getApplications']);router[_0x22d5('0x11')](_0x22d5('0x1d'),auth[_0x22d5('0xa')](),controller[_0x22d5('0x1e')]);router[_0x22d5('0x11')](_0x22d5('0x1f'),controller[_0x22d5('0x20')]);router[_0x22d5('0x11')]('/:id/offline_messages',auth[_0x22d5('0xa')](),controller[_0x22d5('0x21')]);router[_0x22d5('0x11')](_0x22d5('0x22'),auth['isAuthenticated'](),controller[_0x22d5('0x23')]);router['post']('/',auth[_0x22d5('0xa')](),controller[_0x22d5('0x24')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x22d5('0x25')]);router[_0x22d5('0x26')]('/:id/canned_answers',auth[_0x22d5('0xa')](),controller[_0x22d5('0x27')]);var upload=multer({'storage':multer[_0x22d5('0x28')]({'destination':function(_0x32b6e0,_0x36a7c8,_0x3a41fd){_0x3a41fd(null,path[_0x22d5('0x29')](config[_0x22d5('0x2a')],_0x22d5('0x2b')));},'filename':function(_0x488d1b,_0x3d0d9a,_0x1c64b5){_0x1c64b5(null,util[_0x22d5('0x2c')]('%s-%s',Date['now'](),_0x3d0d9a[_0x22d5('0x2d')]));}})});router[_0x22d5('0x26')](_0x22d5('0x12'),upload[_0x22d5('0x2e')](_0x22d5('0x2f')),controller[_0x22d5('0x30')]);var upload=multer({'storage':multer[_0x22d5('0x28')]({'destination':function(_0x2ce81b,_0x3a633c,_0x4b8e1e){_0x4b8e1e(null,path[_0x22d5('0x29')](config[_0x22d5('0x2a')],_0x22d5('0x31')));},'filename':function(_0x289d34,_0x25cdea,_0x43c09e){_0x43c09e(null,util[_0x22d5('0x2c')](_0x22d5('0x32'),Date['now'](),_0x25cdea[_0x22d5('0x2d')]));}})});router[_0x22d5('0x26')](_0x22d5('0x14'),upload[_0x22d5('0x2e')](_0x22d5('0x2f')),controller['addAvatar']);var upload=multer({'storage':multer[_0x22d5('0x28')]({'destination':function(_0x24472d,_0x56b27b,_0x1ee9f5){_0x1ee9f5(null,path[_0x22d5('0x29')](config[_0x22d5('0x2a')],_0x22d5('0x31')));},'filename':function(_0x2fe42e,_0x4ef1b4,_0x4a5836){_0x4a5836(null,util[_0x22d5('0x2c')](_0x22d5('0x32'),Date[_0x22d5('0x33')](),_0x4ef1b4['originalname']));}})});router[_0x22d5('0x26')](_0x22d5('0x34'),upload['single']('file'),controller[_0x22d5('0x35')]);var upload=multer({'storage':multer[_0x22d5('0x28')]({'destination':function(_0x319678,_0x369742,_0x346c8b){_0x346c8b(null,path[_0x22d5('0x29')](config[_0x22d5('0x2a')],'server/files/images/avatars/'));},'filename':function(_0x22a16b,_0x540e2d,_0x13129b){_0x13129b(null,util[_0x22d5('0x2c')](_0x22d5('0x32'),Date[_0x22d5('0x33')](),_0x540e2d[_0x22d5('0x2d')]));}})});router[_0x22d5('0x26')](_0x22d5('0x17'),upload[_0x22d5('0x2e')](_0x22d5('0x2f')),controller[_0x22d5('0x36')]);router[_0x22d5('0x26')]('/:id/notify',controller[_0x22d5('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x4f0654,_0x2d5935,_0x2530d5){const _0x4eee99=path['join'](config['root'],_0x22d5('0x38'),'attachments',_0x22d5('0x39'));fs_extra['ensureDir'](_0x4eee99,function(){_0x2530d5(null,_0x4eee99);});},'filename':function(_0x5e3359,_0x1e0e1e,_0x224692){const _0x18e261=_0x1e0e1e[_0x22d5('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x14b31b=path[_0x22d5('0x3a')](_0x18e261);const _0x3f6606=Date[_0x22d5('0x33')]()+'-'+_0x18e261[_0x22d5('0x3b')](_0x14b31b,'')+_0x14b31b;_0x224692(null,_0x3f6606);}})});router[_0x22d5('0x26')](_0x22d5('0x3c'),offlineUploadMulter[_0x22d5('0x3d')](),controller['offline']);router['post']('/:id/interactions',auth[_0x22d5('0xa')](),controller['addInteraction']);router[_0x22d5('0x26')](_0x22d5('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x22d5('0x26')](_0x22d5('0x1d'),auth[_0x22d5('0xa')](),controller[_0x22d5('0x3e')]);router[_0x22d5('0x26')](_0x22d5('0x22'),auth['isAuthenticated'](),controller[_0x22d5('0x3f')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x22d5('0x40')]);router[_0x22d5('0x41')](_0x22d5('0x42'),auth[_0x22d5('0xa')](),controller[_0x22d5('0x43')]);router[_0x22d5('0x41')](_0x22d5('0xf'),auth[_0x22d5('0xa')](),controller['removeDispositions']);router[_0x22d5('0x41')](_0x22d5('0x10'),auth['isAuthenticated'](),controller[_0x22d5('0x44')]);router[_0x22d5('0x41')](_0x22d5('0x22'),auth[_0x22d5('0xa')](),controller[_0x22d5('0x45')]);module[_0x22d5('0x46')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 846ccdd..41f30ed 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22ef=['/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x3de9ad,_0x2a0d99){var _0x3b7676=function(_0x541c88){while(--_0x541c88){_0x3de9ad['push'](_0x3de9ad['shift']());}};_0x3b7676(++_0x2a0d99);}(_0x22ef,0x1e4));var _0xf22e=function(_0x3af98d,_0x5822e5){_0x3af98d=_0x3af98d-0x0;var _0x491d90=_0x22ef[_0x3af98d];return _0x491d90;};var beaverLogger=require(_0xf22e('0x0'));var express=require(_0xf22e('0x1'));var auth=require(_0xf22e('0x2'));var config=require(_0xf22e('0x3'));var router=express[_0xf22e('0x4')]();var isProduction=config[_0xf22e('0x5')]===_0xf22e('0x6')||![];function clientSideLogs(_0x182234,_0x339591,_0x16929c){var _0x3f72f5=_0x182234[_0xf22e('0x7')][_0xf22e('0x8')](_0xf22e('0x9'));if(!_0x3f72f5){throw new Error(_0xf22e('0xa'));}return beaverLogger['expressEndpoint']({'uri':_0xf22e('0xb'),'logger':_0x3f72f5,'enableCors':!isProduction})(_0x182234,_0x339591,_0x16929c);}router[_0xf22e('0xc')](auth[_0xf22e('0xd')](),clientSideLogs);module[_0xf22e('0xe')]=router; \ No newline at end of file +var _0xfd33=['Client-Side\x20logger\x20not\x20found!','/client-logs','exports','beaver-logger/server','express','env','app','client-side-logger'];(function(_0x18ec3f,_0x4d62cf){var _0x538f79=function(_0x6c0930){while(--_0x6c0930){_0x18ec3f['push'](_0x18ec3f['shift']());}};_0x538f79(++_0x4d62cf);}(_0xfd33,0x173));var _0x3fd3=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xfd33[_0x1b349a];return _0x5d1f7c;};var beaverLogger=require(_0x3fd3('0x0'));var express=require(_0x3fd3('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x3fd3('0x2')]==='production'||![];function clientSideLogs(_0x3598e8,_0x2db99c,_0x16d5d7){var _0x188949=_0x3598e8[_0x3fd3('0x3')]['get'](_0x3fd3('0x4'));if(!_0x188949){throw new Error(_0x3fd3('0x5'));}return beaverLogger['expressEndpoint']({'uri':_0x3fd3('0x6'),'logger':_0x188949,'enableCors':!isProduction})(_0x3598e8,_0x2db99c,_0x16d5d7);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x3fd3('0x7')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 0639ad4..aa31b71 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 _0x432a=['ENUM','AmazonAWS','Google','Outlook365','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','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x432a,0x1c5));var _0xa432=function(_0x4ec15e,_0x3040d8){_0x4ec15e=_0x4ec15e-0x0;var _0x408b47=_0x432a[_0x4ec15e];return _0x408b47;};'use strict';var Sequelize=require(_0xa432('0x0'));module['exports']={'name':{'type':Sequelize[_0xa432('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa432('0x2')](_0xa432('0x3'),_0xa432('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xa432('0x2')](_0xa432('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0xa432('0x1')],'comment':_0xa432('0x6')},'data2':{'type':Sequelize[_0xa432('0x1')],'comment':_0xa432('0x7')},'data3':{'type':Sequelize[_0xa432('0x1')],'comment':_0xa432('0x8')},'data4':{'type':Sequelize['STRING'],'comment':_0xa432('0x9')},'data5':{'type':Sequelize[_0xa432('0xa')],'comment':_0xa432('0xb')},'data6':{'type':Sequelize[_0xa432('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xa432('0xa')],'comment':_0xa432('0xc')}}; \ No newline at end of file +var _0xb920=['Google','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb920,0x17b));var _0x0b92=function(_0x2e2910,_0x3b06e0){_0x2e2910=_0x2e2910-0x0;var _0x22e05c=_0xb920[_0x2e2910];return _0x22e05c;};'use strict';var Sequelize=require(_0x0b92('0x0'));module[_0x0b92('0x1')]={'name':{'type':Sequelize[_0x0b92('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0b92('0x3')](_0x0b92('0x4'),_0x0b92('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0x0b92('0x2')],'comment':_0x0b92('0x6')},'data2':{'type':Sequelize[_0x0b92('0x2')],'comment':_0x0b92('0x7')},'data3':{'type':Sequelize['STRING'],'comment':_0x0b92('0x8')},'data4':{'type':Sequelize[_0x0b92('0x2')],'comment':_0x0b92('0x9')},'data5':{'type':Sequelize[_0x0b92('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x0b92('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x0b92('0xa')],'comment':_0x0b92('0xb')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 9aa6c97..62d84d3 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 _0x9b7b=['oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','parse','from','state','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','stringify','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','error','stack','name','send','slice','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CloudProvider','includeAll','include','findAll','rows','decryptString','data3','show','find','service','MicrosoftAzure','catch','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','body','encryptString','create','params'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x9b7b,0x76));var _0xb9b7=function(_0x21cdee,_0x4301e4){_0x21cdee=_0x21cdee-0x0;var _0x994295=_0x9b7b[_0x21cdee];return _0x994295;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0xb9b7('0x0'));var config=require(_0xb9b7('0x1'));var logger=require(_0xb9b7('0x2'))(_0xb9b7('0x3'));var db=require(_0xb9b7('0x4'))['db'];var oauth=require(_0xb9b7('0x5'));config[_0xb9b7('0x6')]=_[_0xb9b7('0x7')](config['redis'],{'host':_0xb9b7('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb9b7('0x6')]));var redis=new Redis(config[_0xb9b7('0x6')]);function respondWithStatusCode(_0x31c918,_0x174ddc){_0x174ddc=_0x174ddc||0xcc;return function(_0x2ab90f){if(_0x2ab90f){return _0x31c918[_0xb9b7('0x9')](_0x174ddc);}return _0x31c918[_0xb9b7('0xa')](_0x174ddc)[_0xb9b7('0xb')]();};}function respondWithResult(_0x457f1f,_0x5726c5){_0x5726c5=_0x5726c5||0xc8;return function(_0x245389){if(_0x245389){return _0x457f1f['status'](_0x5726c5)[_0xb9b7('0xc')](_0x245389);}};}function respondWithFilteredResult(_0xcd7b53,_0x250000){return function(_0x77a6a3){if(_0x77a6a3){var _0x22e13a=typeof _0x250000[_0xb9b7('0xd')]==='undefined'&&typeof _0x250000[_0xb9b7('0xe')]===_0xb9b7('0xf');var _0x3016e0=_0x77a6a3['count'];var _0x47eba0=_0x22e13a?0x0:_0x250000[_0xb9b7('0xd')];var _0x93d644=_0x22e13a?_0x77a6a3[_0xb9b7('0x10')]:_0x250000[_0xb9b7('0xd')]+_0x250000[_0xb9b7('0xe')];var _0x5c9dd9;if(_0x93d644>=_0x3016e0){_0x93d644=_0x3016e0;_0x5c9dd9=0xc8;}else{_0x5c9dd9=0xce;}_0xcd7b53[_0xb9b7('0xa')](_0x5c9dd9);return _0xcd7b53[_0xb9b7('0x11')](_0xb9b7('0x12'),_0x47eba0+'-'+_0x93d644+'/'+_0x3016e0)[_0xb9b7('0xc')](_0x77a6a3);}return null;};}function saveUpdates(_0x21f055){return function(_0x8bdd94){if(_0x8bdd94){return _0x8bdd94[_0xb9b7('0x13')](_0x21f055)[_0xb9b7('0x14')](function(_0x26bd10){return _0x26bd10;});}return null;};}function removeEntity(_0x185d34){return function(_0x2294ea){if(_0x2294ea){return _0x2294ea['destroy']()[_0xb9b7('0x14')](function(){_0x185d34[_0xb9b7('0xa')](0xcc)[_0xb9b7('0xb')]();});}};}function handleEntityNotFound(_0x32efa3){return function(_0x2eb177){if(!_0x2eb177){_0x32efa3['sendStatus'](0x194);}return _0x2eb177;};}function handleError(_0x6af412,_0x27a7d2){_0x27a7d2=_0x27a7d2||0x1f4;return function(_0x404fc4){logger[_0xb9b7('0x15')](_0x404fc4[_0xb9b7('0x16')]);if(_0x404fc4['name']){delete _0x404fc4[_0xb9b7('0x17')];}_0x6af412[_0xb9b7('0xa')](_0x27a7d2)[_0xb9b7('0x18')](_0x404fc4);};}function maskClientSecret(_0x282851){return _['padEnd'](_0x282851[_0xb9b7('0x19')](0x0,0x3),0x14,'*');}exports[_0xb9b7('0x1a')]=function(_0x41eb6c,_0x17368f){var _0x5f4e7c={},_0x2c678f={},_0x110e5e={'count':0x0,'rows':[]};var _0x3f923d=_[_0xb9b7('0x1b')](db['CloudProvider'][_0xb9b7('0x1c')],function(_0x22f9dd){return{'name':_0x22f9dd[_0xb9b7('0x1d')],'type':_0x22f9dd[_0xb9b7('0x1e')][_0xb9b7('0x1f')]};});_0x2c678f[_0xb9b7('0x20')]=_[_0xb9b7('0x1b')](_0x3f923d,_0xb9b7('0x17'));_0x2c678f[_0xb9b7('0x21')]=_[_0xb9b7('0x22')](_0x41eb6c['query']);_0x2c678f[_0xb9b7('0x23')]=_['intersection'](_0x2c678f[_0xb9b7('0x20')],_0x2c678f['query']);_0x5f4e7c[_0xb9b7('0x24')]=_[_0xb9b7('0x25')](_0x2c678f[_0xb9b7('0x20')],qs['fields'](_0x41eb6c[_0xb9b7('0x21')][_0xb9b7('0x26')]));_0x5f4e7c[_0xb9b7('0x24')]=_0x5f4e7c['attributes'][_0xb9b7('0x27')]?_0x5f4e7c[_0xb9b7('0x24')]:_0x2c678f[_0xb9b7('0x20')];if(!_0x41eb6c['query'][_0xb9b7('0x28')](_0xb9b7('0x29'))){_0x5f4e7c['limit']=qs['limit'](_0x41eb6c['query']['limit']);_0x5f4e7c['offset']=qs[_0xb9b7('0xd')](_0x41eb6c[_0xb9b7('0x21')][_0xb9b7('0xd')]);}_0x5f4e7c[_0xb9b7('0x2a')]=qs[_0xb9b7('0x2b')](_0x41eb6c[_0xb9b7('0x21')][_0xb9b7('0x2b')]);_0x5f4e7c[_0xb9b7('0x2c')]=qs[_0xb9b7('0x23')](_[_0xb9b7('0x2d')](_0x41eb6c['query'],_0x2c678f[_0xb9b7('0x23')]),_0x3f923d);if(_0x41eb6c[_0xb9b7('0x21')][_0xb9b7('0x2e')]){_0x5f4e7c[_0xb9b7('0x2c')]=_[_0xb9b7('0x2f')](_0x5f4e7c['where'],{'$or':_[_0xb9b7('0x1b')](_0x3f923d,function(_0x1f6d8a){if(_0x1f6d8a[_0xb9b7('0x1e')]!==_0xb9b7('0x30')){var _0x3dc48a={};_0x3dc48a[_0x1f6d8a['name']]={'$like':'%'+_0x41eb6c[_0xb9b7('0x21')][_0xb9b7('0x2e')]+'%'};return _0x3dc48a;}})});}_0x5f4e7c=_[_0xb9b7('0x2f')]({},_0x5f4e7c,_0x41eb6c[_0xb9b7('0x31')]);var _0x4af2e8={'where':_0x5f4e7c[_0xb9b7('0x2c')]};return db[_0xb9b7('0x32')][_0xb9b7('0x10')](_0x4af2e8)['then'](function(_0x1c726a){_0x110e5e['count']=_0x1c726a;if(_0x41eb6c[_0xb9b7('0x21')][_0xb9b7('0x33')]){_0x5f4e7c[_0xb9b7('0x34')]=[{'all':!![]}];}return db[_0xb9b7('0x32')][_0xb9b7('0x35')](_0x5f4e7c);})['then'](function(_0x36b33f){_0x110e5e[_0xb9b7('0x36')]=_[_0xb9b7('0x1b')](_0x36b33f,function(_0x868f85){if(_0x868f85['service']==='MicrosoftAzure'){var _0x48bf1e=encryptor[_0xb9b7('0x37')](_0x868f85[_0xb9b7('0x38')]);_0x868f85[_0xb9b7('0x38')]=maskClientSecret(_0x48bf1e);}return _0x868f85;});return _0x110e5e;})[_0xb9b7('0x14')](respondWithFilteredResult(_0x17368f,_0x5f4e7c))['catch'](handleError(_0x17368f,null));};exports[_0xb9b7('0x39')]=function(_0x970060,_0x5583ce){var _0x5e92bd={'raw':!![],'where':{'id':_0x970060['params']['id']}},_0x15ad80={};_0x15ad80[_0xb9b7('0x20')]=_[_0xb9b7('0x22')](db[_0xb9b7('0x32')]['rawAttributes']);_0x15ad80[_0xb9b7('0x21')]=_[_0xb9b7('0x22')](_0x970060[_0xb9b7('0x21')]);_0x15ad80[_0xb9b7('0x23')]=_[_0xb9b7('0x25')](_0x15ad80[_0xb9b7('0x20')],_0x15ad80[_0xb9b7('0x21')]);_0x5e92bd[_0xb9b7('0x24')]=_[_0xb9b7('0x25')](_0x15ad80[_0xb9b7('0x20')],qs['fields'](_0x970060[_0xb9b7('0x21')][_0xb9b7('0x26')]));_0x5e92bd[_0xb9b7('0x24')]=_0x5e92bd[_0xb9b7('0x24')]['length']?_0x5e92bd[_0xb9b7('0x24')]:_0x15ad80[_0xb9b7('0x20')];if(_0x970060['query'][_0xb9b7('0x33')]){_0x5e92bd['include']=[{'all':!![]}];}_0x5e92bd=_[_0xb9b7('0x2f')]({},_0x5e92bd,_0x970060[_0xb9b7('0x31')]);return db[_0xb9b7('0x32')][_0xb9b7('0x3a')](_0x5e92bd)[_0xb9b7('0x14')](handleEntityNotFound(_0x5583ce,null))[_0xb9b7('0x14')](function(_0x2689cd){if(_0x2689cd[_0xb9b7('0x3b')]===_0xb9b7('0x3c')){var _0x430ddc=encryptor[_0xb9b7('0x37')](_0x2689cd[_0xb9b7('0x38')]);_0x2689cd['data3']=maskClientSecret(_0x430ddc);}return _0x2689cd;})[_0xb9b7('0x14')](respondWithResult(_0x5583ce,null))[_0xb9b7('0x3d')](handleError(_0x5583ce,null));};exports['create']=function(_0x2b8cca,_0x14e2ca){if(!_0x2b8cca['body'][_0xb9b7('0x17')])throw new Error(_0xb9b7('0x3e'));if(!_0x2b8cca['body'][_0xb9b7('0x3b')])throw new Error(_0xb9b7('0x3f'));var _0x125498=db[_0xb9b7('0x32')][_0xb9b7('0x1c')]['service'][_0xb9b7('0x40')];if(!_0x125498[_0xb9b7('0x41')](_0x2b8cca['body']['service']))throw new Error(_0xb9b7('0x42')+_0x125498[_0xb9b7('0x43')](',\x20'));if(_0x2b8cca[_0xb9b7('0x44')]['service']===_0xb9b7('0x3c')&&_0x2b8cca[_0xb9b7('0x44')][_0xb9b7('0x38')]){_0x2b8cca[_0xb9b7('0x44')][_0xb9b7('0x38')]=encryptor[_0xb9b7('0x45')](_0x2b8cca[_0xb9b7('0x44')][_0xb9b7('0x38')]);}return db[_0xb9b7('0x32')][_0xb9b7('0x46')](_0x2b8cca[_0xb9b7('0x44')],{})[_0xb9b7('0x14')](respondWithResult(_0x14e2ca,0xc9))[_0xb9b7('0x3d')](handleError(_0x14e2ca,null));};exports['update']=function(_0x57fe34,_0x2b09d0){if(_0x57fe34['body']['id']){delete _0x57fe34[_0xb9b7('0x44')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x57fe34[_0xb9b7('0x47')]['id']}})[_0xb9b7('0x14')](handleEntityNotFound(_0x2b09d0,null))[_0xb9b7('0x14')](function(_0x34026f){if(_0x34026f['service']===_0xb9b7('0x3c')&&_0x57fe34['body'][_0xb9b7('0x38')]){_0x57fe34[_0xb9b7('0x44')][_0xb9b7('0x38')]=encryptor['encryptString'](_0x57fe34['body'][_0xb9b7('0x38')]);}return _0x34026f;})['then'](saveUpdates(_0x57fe34[_0xb9b7('0x44')],null))['then'](respondWithResult(_0x2b09d0,null))['catch'](handleError(_0x2b09d0,null));};exports['destroy']=function(_0x5974c,_0x31a414){return db[_0xb9b7('0x32')]['find']({'where':{'id':_0x5974c[_0xb9b7('0x47')]['id']}})[_0xb9b7('0x14')](handleEntityNotFound(_0x31a414,null))[_0xb9b7('0x14')](removeEntity(_0x31a414,null))[_0xb9b7('0x3d')](handleError(_0x31a414,null));};exports[_0xb9b7('0x48')]=function(_0x490d3c,_0x1bbddf){return db['CloudProvider']['findOne']({'where':{'id':_0x490d3c[_0xb9b7('0x47')]['id']},'raw':!![]})[_0xb9b7('0x14')](function(_0x23c21e){if(!_0x23c21e)return _0x1bbddf[_0xb9b7('0x9')](0x194);return{'url':oauth[_0xb9b7('0x49')](_0x23c21e,_0x490d3c['user']['id'])};})[_0xb9b7('0x14')](respondWithResult(_0x1bbddf,null))['catch'](handleError(_0x1bbddf,null));};exports[_0xb9b7('0x4a')]=function(_0x412ee8,_0x33229d){var _0x427d48=_0x412ee8[_0xb9b7('0x44')];var _0xc450be;var _0x5ec404;if(_0x427d48[_0xb9b7('0x15')])throw _0x427d48;redis[_0xb9b7('0x4b')](_0x427d48['state'])[_0xb9b7('0x14')](function(_0x1ed5bd){if(!_0x1ed5bd)throw new Error('Invalid\x20state\x20parameter');_0xc450be=JSON[_0xb9b7('0x4c')](_0x1ed5bd);var _0x1d46e7=Buffer[_0xb9b7('0x4d')](_0x427d48[_0xb9b7('0x4e')],'base64')[_0xb9b7('0x4f')]('ascii');_0x5ec404=JSON[_0xb9b7('0x4c')](_0x1d46e7);if(!oauth[_0xb9b7('0x50')](_0x427d48[_0xb9b7('0x51')],_0xc450be[_0xb9b7('0x52')]))throw new Error(_0xb9b7('0x53'));redis[_0xb9b7('0x54')](_0x427d48[_0xb9b7('0x4e')]);return oauth[_0xb9b7('0x55')](_0x427d48[_0xb9b7('0x56')],_0xc450be);})['then'](function(_0x37b342){_0xc450be[_0xb9b7('0x57')]=_0x37b342[_0xb9b7('0x58')];_0xc450be[_0xb9b7('0x59')]=_0x37b342['refresh_token'];return db[_0xb9b7('0x32')]['update']({'data5':_0xc450be[_0xb9b7('0x57')],'data6':_0xc450be['data6']},{'where':{'id':_0xc450be['id']}});})[_0xb9b7('0x14')](function(){oauth[_0xb9b7('0x5a')](_0xc450be);socket[_0xb9b7('0x5b')](_0xb9b7('0x5c'),{'id':_0x5ec404['id']});return;})[_0xb9b7('0x14')](respondWithStatusCode(_0x33229d,null))[_0xb9b7('0x3d')](function(_0x4db7a9){if(_0x5ec404){socket[_0xb9b7('0x5b')]('microsoftAuthorization:error',{'id':_0x5ec404['id']});}if(!_0xc450be){logger[_0xb9b7('0x15')](_0xb9b7('0x5d'),_0x4db7a9);return _0x33229d['status'](0x1f4)['send'](_0x4db7a9['message']);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0xc450be['id'],JSON[_0xb9b7('0x5e')](_0x4db7a9));});}; \ No newline at end of file +var _0xb275=['sort','pick','filter','where','type','merge','options','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','keys','include','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','find','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','base64','toString','ascii','parse','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','startRefreshInterval','emit','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','send','padEnd','slice','map','CloudProvider','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order'];(function(_0x179af7,_0x4bca78){var _0x4f16e1=function(_0x484cf5){while(--_0x484cf5){_0x179af7['push'](_0x179af7['shift']());}};_0x4f16e1(++_0x4bca78);}(_0xb275,0xf2));var _0x5b27=function(_0x9b40b3,_0x514ab4){_0x9b40b3=_0x9b40b3-0x0;var _0x2526c3=_0xb275[_0x9b40b3];return _0x2526c3;};'use strict';var _=require(_0x5b27('0x0'));var Redis=require(_0x5b27('0x1'));var qs=require(_0x5b27('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x5b27('0x3'));var logger=require(_0x5b27('0x4'))(_0x5b27('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x5b27('0x6'));config[_0x5b27('0x7')]=_[_0x5b27('0x8')](config[_0x5b27('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b27('0x9'))(new Redis(config[_0x5b27('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0xfeb267,_0x732ce){_0x732ce=_0x732ce||0xcc;return function(_0x29e510){if(_0x29e510){return _0xfeb267[_0x5b27('0xa')](_0x732ce);}return _0xfeb267[_0x5b27('0xb')](_0x732ce)[_0x5b27('0xc')]();};}function respondWithResult(_0x37b935,_0xbd1e8e){_0xbd1e8e=_0xbd1e8e||0xc8;return function(_0x54cbad){if(_0x54cbad){return _0x37b935[_0x5b27('0xb')](_0xbd1e8e)[_0x5b27('0xd')](_0x54cbad);}};}function respondWithFilteredResult(_0x30771f,_0x51d103){return function(_0x52c399){if(_0x52c399){var _0x1d3a75=typeof _0x51d103[_0x5b27('0xe')]===_0x5b27('0xf')&&typeof _0x51d103['limit']===_0x5b27('0xf');var _0x127d06=_0x52c399[_0x5b27('0x10')];var _0x881e5a=_0x1d3a75?0x0:_0x51d103['offset'];var _0x3fcbe6=_0x1d3a75?_0x52c399[_0x5b27('0x10')]:_0x51d103['offset']+_0x51d103['limit'];var _0x5a0df6;if(_0x3fcbe6>=_0x127d06){_0x3fcbe6=_0x127d06;_0x5a0df6=0xc8;}else{_0x5a0df6=0xce;}_0x30771f[_0x5b27('0xb')](_0x5a0df6);return _0x30771f[_0x5b27('0x11')](_0x5b27('0x12'),_0x881e5a+'-'+_0x3fcbe6+'/'+_0x127d06)[_0x5b27('0xd')](_0x52c399);}return null;};}function saveUpdates(_0x129a27){return function(_0x469e73){if(_0x469e73){return _0x469e73[_0x5b27('0x13')](_0x129a27)[_0x5b27('0x14')](function(_0x5cdf9d){return _0x5cdf9d;});}return null;};}function removeEntity(_0x1723b5){return function(_0x1b18fe){if(_0x1b18fe){return _0x1b18fe[_0x5b27('0x15')]()[_0x5b27('0x14')](function(){_0x1723b5[_0x5b27('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d5fed){return function(_0x149a25){if(!_0x149a25){_0x2d5fed[_0x5b27('0xa')](0x194);}return _0x149a25;};}function handleError(_0x4c8cb5,_0x2165e7){_0x2165e7=_0x2165e7||0x1f4;return function(_0x124fda){logger[_0x5b27('0x16')](_0x124fda[_0x5b27('0x17')]);if(_0x124fda['name']){delete _0x124fda[_0x5b27('0x18')];}_0x4c8cb5[_0x5b27('0xb')](_0x2165e7)[_0x5b27('0x19')](_0x124fda);};}function maskClientSecret(_0x18ee4c){return _[_0x5b27('0x1a')](_0x18ee4c[_0x5b27('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0x5657bf,_0x9b91c2){var _0x4c3876={},_0x6dd0f1={},_0xaf61ed={'count':0x0,'rows':[]};var _0x15cc81=_[_0x5b27('0x1c')](db[_0x5b27('0x1d')][_0x5b27('0x1e')],function(_0xd52fca){return{'name':_0xd52fca[_0x5b27('0x1f')],'type':_0xd52fca['type']['key']};});_0x6dd0f1[_0x5b27('0x20')]=_['map'](_0x15cc81,_0x5b27('0x18'));_0x6dd0f1[_0x5b27('0x21')]=_['keys'](_0x5657bf[_0x5b27('0x21')]);_0x6dd0f1[_0x5b27('0x22')]=_[_0x5b27('0x23')](_0x6dd0f1[_0x5b27('0x20')],_0x6dd0f1[_0x5b27('0x21')]);_0x4c3876[_0x5b27('0x24')]=_[_0x5b27('0x23')](_0x6dd0f1['model'],qs[_0x5b27('0x25')](_0x5657bf[_0x5b27('0x21')][_0x5b27('0x25')]));_0x4c3876[_0x5b27('0x24')]=_0x4c3876[_0x5b27('0x24')][_0x5b27('0x26')]?_0x4c3876[_0x5b27('0x24')]:_0x6dd0f1[_0x5b27('0x20')];if(!_0x5657bf[_0x5b27('0x21')][_0x5b27('0x27')](_0x5b27('0x28'))){_0x4c3876[_0x5b27('0x29')]=qs[_0x5b27('0x29')](_0x5657bf[_0x5b27('0x21')][_0x5b27('0x29')]);_0x4c3876[_0x5b27('0xe')]=qs['offset'](_0x5657bf[_0x5b27('0x21')][_0x5b27('0xe')]);}_0x4c3876[_0x5b27('0x2a')]=qs[_0x5b27('0x2b')](_0x5657bf[_0x5b27('0x21')][_0x5b27('0x2b')]);_0x4c3876['where']=qs['filters'](_[_0x5b27('0x2c')](_0x5657bf[_0x5b27('0x21')],_0x6dd0f1[_0x5b27('0x22')]),_0x15cc81);if(_0x5657bf[_0x5b27('0x21')][_0x5b27('0x2d')]){_0x4c3876['where']=_['merge'](_0x4c3876[_0x5b27('0x2e')],{'$or':_['map'](_0x15cc81,function(_0x22b168){if(_0x22b168[_0x5b27('0x2f')]!=='VIRTUAL'){var _0x72d07d={};_0x72d07d[_0x22b168[_0x5b27('0x18')]]={'$like':'%'+_0x5657bf[_0x5b27('0x21')][_0x5b27('0x2d')]+'%'};return _0x72d07d;}})});}_0x4c3876=_[_0x5b27('0x30')]({},_0x4c3876,_0x5657bf[_0x5b27('0x31')]);var _0x1e083a={'where':_0x4c3876[_0x5b27('0x2e')]};return db[_0x5b27('0x1d')][_0x5b27('0x10')](_0x1e083a)[_0x5b27('0x14')](function(_0x3a0136){_0xaf61ed[_0x5b27('0x10')]=_0x3a0136;if(_0x5657bf[_0x5b27('0x21')][_0x5b27('0x32')]){_0x4c3876['include']=[{'all':!![]}];}return db[_0x5b27('0x1d')][_0x5b27('0x33')](_0x4c3876);})[_0x5b27('0x14')](function(_0x61c654){_0xaf61ed[_0x5b27('0x34')]=_[_0x5b27('0x1c')](_0x61c654,function(_0x34ede3){if(_0x34ede3[_0x5b27('0x35')]===_0x5b27('0x36')){var _0x3973d8=encryptor[_0x5b27('0x37')](_0x34ede3[_0x5b27('0x38')]);_0x34ede3[_0x5b27('0x38')]=maskClientSecret(_0x3973d8);}return _0x34ede3;});return _0xaf61ed;})[_0x5b27('0x14')](respondWithFilteredResult(_0x9b91c2,_0x4c3876))[_0x5b27('0x39')](handleError(_0x9b91c2,null));};exports[_0x5b27('0x3a')]=function(_0x39271d,_0x2666ea){var _0x2bf017={'raw':!![],'where':{'id':_0x39271d['params']['id']}},_0x338bb6={};_0x338bb6[_0x5b27('0x20')]=_['keys'](db['CloudProvider'][_0x5b27('0x1e')]);_0x338bb6[_0x5b27('0x21')]=_[_0x5b27('0x3b')](_0x39271d[_0x5b27('0x21')]);_0x338bb6[_0x5b27('0x22')]=_[_0x5b27('0x23')](_0x338bb6[_0x5b27('0x20')],_0x338bb6[_0x5b27('0x21')]);_0x2bf017[_0x5b27('0x24')]=_['intersection'](_0x338bb6[_0x5b27('0x20')],qs['fields'](_0x39271d[_0x5b27('0x21')][_0x5b27('0x25')]));_0x2bf017['attributes']=_0x2bf017[_0x5b27('0x24')]['length']?_0x2bf017[_0x5b27('0x24')]:_0x338bb6[_0x5b27('0x20')];if(_0x39271d[_0x5b27('0x21')][_0x5b27('0x32')]){_0x2bf017[_0x5b27('0x3c')]=[{'all':!![]}];}_0x2bf017=_['merge']({},_0x2bf017,_0x39271d['options']);return db[_0x5b27('0x1d')]['find'](_0x2bf017)[_0x5b27('0x14')](handleEntityNotFound(_0x2666ea,null))['then'](function(_0x46cebb){if(_0x46cebb[_0x5b27('0x35')]===_0x5b27('0x36')){var _0x3f2c6a=encryptor[_0x5b27('0x37')](_0x46cebb[_0x5b27('0x38')]);_0x46cebb[_0x5b27('0x38')]=maskClientSecret(_0x3f2c6a);}return _0x46cebb;})[_0x5b27('0x14')](respondWithResult(_0x2666ea,null))['catch'](handleError(_0x2666ea,null));};exports['create']=function(_0x24ea2d,_0x2efa7a){if(!_0x24ea2d[_0x5b27('0x3d')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x24ea2d[_0x5b27('0x3d')]['service'])throw new Error(_0x5b27('0x3e'));var _0x508536=db[_0x5b27('0x1d')][_0x5b27('0x1e')]['service'][_0x5b27('0x3f')];if(!_0x508536[_0x5b27('0x40')](_0x24ea2d[_0x5b27('0x3d')][_0x5b27('0x35')]))throw new Error(_0x5b27('0x41')+_0x508536[_0x5b27('0x42')](',\x20'));if(_0x24ea2d[_0x5b27('0x3d')][_0x5b27('0x35')]==='MicrosoftAzure'&&_0x24ea2d[_0x5b27('0x3d')][_0x5b27('0x38')]){_0x24ea2d[_0x5b27('0x3d')][_0x5b27('0x38')]=encryptor[_0x5b27('0x43')](_0x24ea2d['body'][_0x5b27('0x38')]);}return db[_0x5b27('0x1d')][_0x5b27('0x44')](_0x24ea2d['body'],{})[_0x5b27('0x14')](respondWithResult(_0x2efa7a,0xc9))[_0x5b27('0x39')](handleError(_0x2efa7a,null));};exports[_0x5b27('0x13')]=function(_0x2a87a2,_0x551777){if(_0x2a87a2[_0x5b27('0x3d')]['id']){delete _0x2a87a2[_0x5b27('0x3d')]['id'];}return db[_0x5b27('0x1d')][_0x5b27('0x45')]({'where':{'id':_0x2a87a2[_0x5b27('0x46')]['id']}})[_0x5b27('0x14')](handleEntityNotFound(_0x551777,null))[_0x5b27('0x14')](function(_0x4b7b5e){if(_0x4b7b5e[_0x5b27('0x35')]===_0x5b27('0x36')&&_0x2a87a2[_0x5b27('0x3d')][_0x5b27('0x38')]){_0x2a87a2[_0x5b27('0x3d')][_0x5b27('0x38')]=encryptor['encryptString'](_0x2a87a2['body'][_0x5b27('0x38')]);}return _0x4b7b5e;})[_0x5b27('0x14')](saveUpdates(_0x2a87a2[_0x5b27('0x3d')],null))[_0x5b27('0x14')](respondWithResult(_0x551777,null))[_0x5b27('0x39')](handleError(_0x551777,null));};exports[_0x5b27('0x15')]=function(_0x844374,_0x194f33){return db['CloudProvider'][_0x5b27('0x45')]({'where':{'id':_0x844374[_0x5b27('0x46')]['id']}})[_0x5b27('0x14')](handleEntityNotFound(_0x194f33,null))[_0x5b27('0x14')](removeEntity(_0x194f33,null))['catch'](handleError(_0x194f33,null));};exports[_0x5b27('0x47')]=function(_0x220a25,_0x150384){return db['CloudProvider'][_0x5b27('0x48')]({'where':{'id':_0x220a25['params']['id']},'raw':!![]})['then'](function(_0x110f33){if(!_0x110f33)return _0x150384['sendStatus'](0x194);return{'url':oauth[_0x5b27('0x49')](_0x110f33,_0x220a25[_0x5b27('0x4a')]['id'])};})[_0x5b27('0x14')](respondWithResult(_0x150384,null))['catch'](handleError(_0x150384,null));};exports[_0x5b27('0x4b')]=function(_0x414367,_0x5bdd27){var _0x49b2e1=_0x414367[_0x5b27('0x3d')];var _0x4da8da;var _0x2d4d3d;if(_0x49b2e1[_0x5b27('0x16')])throw _0x49b2e1;redis['get'](_0x49b2e1[_0x5b27('0x4c')])[_0x5b27('0x14')](function(_0x4cd281){if(!_0x4cd281)throw new Error(_0x5b27('0x4d'));_0x4da8da=JSON['parse'](_0x4cd281);var _0x520e49=Buffer['from'](_0x49b2e1[_0x5b27('0x4c')],_0x5b27('0x4e'))[_0x5b27('0x4f')](_0x5b27('0x50'));_0x2d4d3d=JSON[_0x5b27('0x51')](_0x520e49);if(!oauth['isValidIdToken'](_0x49b2e1[_0x5b27('0x52')],_0x4da8da[_0x5b27('0x53')]))throw new Error(_0x5b27('0x54'));redis[_0x5b27('0x55')](_0x49b2e1['state']);return oauth[_0x5b27('0x56')](_0x49b2e1['code'],_0x4da8da);})[_0x5b27('0x14')](function(_0x73de73){_0x4da8da[_0x5b27('0x57')]=_0x73de73[_0x5b27('0x58')];_0x4da8da[_0x5b27('0x59')]=_0x73de73['refresh_token'];return db[_0x5b27('0x1d')][_0x5b27('0x13')]({'data5':_0x4da8da[_0x5b27('0x57')],'data6':_0x4da8da[_0x5b27('0x59')]},{'where':{'id':_0x4da8da['id']}});})['then'](function(){oauth[_0x5b27('0x5a')](_0x4da8da);socket[_0x5b27('0x5b')]('microsoftAuthorization:success',{'id':_0x2d4d3d['id']});return;})[_0x5b27('0x14')](respondWithStatusCode(_0x5bdd27,null))[_0x5b27('0x39')](function(_0x4d95ad){if(_0x2d4d3d){socket[_0x5b27('0x5b')]('microsoftAuthorization:error',{'id':_0x2d4d3d['id']});}if(!_0x4da8da){logger[_0x5b27('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x4d95ad);return _0x5bdd27[_0x5b27('0xb')](0x1f4)['send'](_0x4d95ad[_0x5b27('0x5c')]);}logger[_0x5b27('0x16')](_0x5b27('0x5d'),_0x4da8da['id'],JSON[_0x5b27('0x5e')](_0x4d95ad));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index c50a442..882344c 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 _0xba00=['exports','define','cloud_providers','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x16528b,_0xcf7f9d){var _0x38f906=function(_0x1c4350){while(--_0x1c4350){_0x16528b['push'](_0x16528b['shift']());}};_0x38f906(++_0xcf7f9d);}(_0xba00,0xd2));var _0x0ba0=function(_0x114c42,_0x1c03a9){_0x114c42=_0x114c42-0x0;var _0x4b7f93=_0xba00[_0x114c42];return _0x4b7f93;};'use strict';var _=require('lodash');var util=require(_0x0ba0('0x0'));var logger=require(_0x0ba0('0x1'))(_0x0ba0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ba0('0x3'));var rimraf=require(_0x0ba0('0x4'));var config=require(_0x0ba0('0x5'));var attributes=require('./cloudProvider.attributes');module[_0x0ba0('0x6')]=function(_0x3c692d,_0x44d63b){return _0x3c692d[_0x0ba0('0x7')]('CloudProvider',attributes,{'tableName':_0x0ba0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x963d=['api','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','CloudProvider','lodash','util','../../config/logger'];(function(_0x450200,_0x191325){var _0x375fbe=function(_0x559ee1){while(--_0x559ee1){_0x450200['push'](_0x450200['shift']());}};_0x375fbe(++_0x191325);}(_0x963d,0x1d3));var _0xd963=function(_0x589267,_0x3770ce){_0x589267=_0x589267-0x0;var _0x12ebb7=_0x963d[_0x589267];return _0x12ebb7;};'use strict';var _=require(_0xd963('0x0'));var util=require(_0xd963('0x1'));var logger=require(_0xd963('0x2'))(_0xd963('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd963('0x4'));var fs=require('fs');var path=require(_0xd963('0x5'));var rimraf=require(_0xd963('0x6'));var config=require(_0xd963('0x7'));var attributes=require(_0xd963('0x8'));module['exports']=function(_0x55ec15,_0x8c3985){return _0x55ec15['define'](_0xd963('0x9'),attributes,{'tableName':'cloud_providers','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 6406afd..90cb0ef 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 _0xdbd5=['[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','request-promise','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','offline_access','/token','map','type','Dynamics365','push','join','Outlook365','/.default','replace','data2','code','id_token','stringify','toString','base64','randomBytes','hex','response_type','redirect_uri','data4','response_mode','state','key','value','oauth2Claims','oauth2/','data1','set','decode','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','data5','access_token','update','catch','error','intervals','bind','findAll','all'];(function(_0x57ebb0,_0x3e878f){var _0x87cffd=function(_0x50b110){while(--_0x50b110){_0x57ebb0['push'](_0x57ebb0['shift']());}};_0x87cffd(++_0x3e878f);}(_0xdbd5,0xa0));var _0x5dbd=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0xdbd5[_0x4ed32d];return _0xf624df;};'use strict';var _=require(_0x5dbd('0x0'));var crypto=require('crypto');var jwt=require(_0x5dbd('0x1'));var moment=require(_0x5dbd('0x2'));var Redis=require('ioredis');var rp=require(_0x5dbd('0x3'));var util=require('util');var encryptor=require(_0x5dbd('0x4'));var config=require(_0x5dbd('0x5'));var logger=require(_0x5dbd('0x6'))('api');var schedule=require(_0x5dbd('0x7'));var db=require(_0x5dbd('0x8'))['db'];config[_0x5dbd('0x9')]=_[_0x5dbd('0xa')](config[_0x5dbd('0x9')],{'host':_0x5dbd('0xb'),'port':0x18eb});var redis=new Redis(config[_0x5dbd('0x9')]);var MICROSOFT_AUTH_URL=_0x5dbd('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x5dbd('0xd'),_0x5dbd('0xe'),'offline_access',_0x5dbd('0xf'),_0x5dbd('0x10'),_0x5dbd('0x11')],'Dynamics365':[_0x5dbd('0x12'),_0x5dbd('0x13')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x5dbd('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x183a82){var _0x1afcdd=_[_0x5dbd('0x15')](AZURE_AUTH_SCOPES[_0x183a82['type']]);if(_0x183a82[_0x5dbd('0x16')]===_0x5dbd('0x17'))_0x1afcdd[_0x5dbd('0x18')](_0x183a82['data7']+'/.default');return _0x1afcdd[_0x5dbd('0x19')]('\x20');}function getAccessTokenScope(_0x50279d){if(_0x50279d[_0x5dbd('0x16')]===_0x5dbd('0x1a'))return _0x5dbd('0xf');if(_0x50279d['type']===_0x5dbd('0x17'))return _0x50279d['data7']+_0x5dbd('0x1b');}function generateMicrosoftAuthorizationUrl(_0x30f28f,_0x5a9354){var _0x4e199d=MICROSOFT_AUTH_URL[_0x5dbd('0x1c')]('{TENANT_ID}',_0x30f28f[_0x5dbd('0x1d')]);var _0x328fc6=[_0x5dbd('0x1e'),_0x5dbd('0x1f')];var _0xd902d8=Buffer['from'](JSON[_0x5dbd('0x20')]({'id':_0x5a9354}))[_0x5dbd('0x21')](_0x5dbd('0x22'));var _0x1e88eb=crypto[_0x5dbd('0x23')](0x10)[_0x5dbd('0x21')](_0x5dbd('0x24'));var _0x5e677e=getAuthorizationScopes(_0x30f28f);var _0x395fe5=[{'key':'client_id','value':_0x30f28f['data1']},{'key':_0x5dbd('0x25'),'value':encodeURIComponent(_0x328fc6[_0x5dbd('0x19')]('\x20'))},{'key':_0x5dbd('0x26'),'value':_0x30f28f[_0x5dbd('0x27')]},{'key':_0x5dbd('0x28'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x5e677e)},{'key':_0x5dbd('0x29'),'value':_0xd902d8},{'key':'nonce','value':_0x1e88eb},{'key':'prompt','value':'login'}];var _0x3df714=_0x4e199d+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x395fe5,function(_0xaca15d){return _0xaca15d[_0x5dbd('0x2a')]+'='+_0xaca15d[_0x5dbd('0x2b')];})[_0x5dbd('0x19')]('&');_0x30f28f[_0x5dbd('0x2c')]={'issuer':_0x4e199d[_0x5dbd('0x1c')](_0x5dbd('0x2d'),''),'audience':_0x30f28f[_0x5dbd('0x2e')],'state':_0xd902d8,'nonce':_0x1e88eb};redis[_0x5dbd('0x2f')](_0xd902d8,JSON[_0x5dbd('0x20')](_0x30f28f));return _0x3df714;}function isValidIdToken(_0x5d7e39,_0x3a37e1){try{var _0x3a2466=jwt[_0x5dbd('0x30')](_0x5d7e39,{'complete':!![]});var _0x709e88=_0x3a2466[_0x5dbd('0x31')];if(_0x709e88[_0x5dbd('0x32')]!==_0x3a37e1[_0x5dbd('0x33')])return![];if(_0x709e88[_0x5dbd('0x34')]!==_0x3a37e1[_0x5dbd('0x35')])return![];if(_0x709e88[_0x5dbd('0x36')]!==_0x3a37e1[_0x5dbd('0x36')])return![];if(moment()[_0x5dbd('0x37')](moment[_0x5dbd('0x38')](_0x709e88[_0x5dbd('0x39')])))return![];return!![];}catch(_0x6ff3ad){throw _0x6ff3ad;}}function refreshOauth2MicrosoftAccessToken(_0x321632){return Promise[_0x5dbd('0x3a')]()[_0x5dbd('0x3b')](function(){if(_0x321632[_0x5dbd('0x3c')])return _0x321632;return db[_0x5dbd('0x3d')][_0x5dbd('0x3e')]({'where':{'id':_0x321632['id']},'raw':!![]});})[_0x5dbd('0x3b')](function(_0x42ef3d){var _0x2159d2={'grant_type':_0x5dbd('0x3f'),'refresh_token':_0x42ef3d[_0x5dbd('0x40')],'scope':getAccessTokenScope(_0x42ef3d),'redirect_uri':_0x42ef3d[_0x5dbd('0x27')],'client_id':_0x42ef3d[_0x5dbd('0x2e')],'client_secret':encryptor[_0x5dbd('0x41')](_0x42ef3d[_0x5dbd('0x3c')])};var _0x1eb87d={'method':_0x5dbd('0x42'),'uri':MICROSOFT_AUTH_URL[_0x5dbd('0x1c')](_0x5dbd('0x43'),_0x42ef3d[_0x5dbd('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2159d2,'json':!![]};return rp(_0x1eb87d);})[_0x5dbd('0x3b')](function(_0xcdfd92){_0x321632[_0x5dbd('0x44')]=_0xcdfd92[_0x5dbd('0x45')];_0x321632[_0x5dbd('0x40')]=_0xcdfd92['refresh_token'];return db[_0x5dbd('0x3d')][_0x5dbd('0x46')]({'data5':_0x321632[_0x5dbd('0x44')],'data6':_0x321632['data6']},{'where':{'id':_0x321632['id']}});})[_0x5dbd('0x3b')](function(){return _0x321632;})[_0x5dbd('0x47')](function(_0x309568){logger[_0x5dbd('0x48')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x321632['id'],_0x309568);});}function getOauth2MicrosoftAccessToken(_0x5caef8,_0x13dda7){var _0x1b41b2={'grant_type':'authorization_code','code':_0x5caef8,'scope':getAccessTokenScope(_0x13dda7),'redirect_uri':_0x13dda7[_0x5dbd('0x27')],'client_id':_0x13dda7[_0x5dbd('0x2e')],'client_secret':encryptor[_0x5dbd('0x41')](_0x13dda7['data3'])};var _0x34ffa2={'method':_0x5dbd('0x42'),'uri':MICROSOFT_AUTH_URL[_0x5dbd('0x1c')](_0x5dbd('0x43'),_0x13dda7[_0x5dbd('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1b41b2,'json':!![]};return rp(_0x34ffa2);}function startRefreshInterval(_0xf71e55){var _0x410e93=schedule[_0x5dbd('0x49')];if(_0x410e93[_0xf71e55['id']])clearInterval(_0x410e93[_0xf71e55['id']]);_0x410e93[_0xf71e55['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x5dbd('0x4a')](this,{'id':_0xf71e55['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x410e93;}function startAllRefreshIntervals(){return db[_0x5dbd('0x3d')][_0x5dbd('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x5dbd('0x3b')](function(_0x15ab83){var _0xebed1f=_0x15ab83[_0x5dbd('0x15')](function(_0x5df020){return refreshOauth2MicrosoftAccessToken(_0x5df020)[_0x5dbd('0x3b')](function(_0x14f0e9){startRefreshInterval(_0x14f0e9);});});return Promise[_0x5dbd('0x4c')](_0xebed1f);})['catch'](function(_0x14e752){var _0x3b73ff=_0x14e752?util['inspect'](_0x14e752,{'showHidden':![],'depth':null}):'';logger['error'](_0x5dbd('0x4d'),_0x3b73ff);});}module[_0x5dbd('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x76e8=['../../components/encryptor','api','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','type','Dynamics365','push','data7','join','Outlook365','/.default','replace','{TENANT_ID}','code','id_token','from','stringify','toString','randomBytes','client_id','data1','data4','form_post','scope','state','nonce','prompt','login','map','key','value','oauth2/','decode','payload','iss','issuer','aud','audience','isAfter','unix','resolve','then','data3','findOne','refresh_token','data6','decryptString','POST','CloudProvider','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data2','findAll','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util'];(function(_0x12ea92,_0x1d72cf){var _0xb8c223=function(_0x7bd6bd){while(--_0x7bd6bd){_0x12ea92['push'](_0x12ea92['shift']());}};_0xb8c223(++_0x1d72cf);}(_0x76e8,0x8e));var _0x876e=function(_0x160ea1,_0x1bba4b){_0x160ea1=_0x160ea1-0x0;var _0x36364e=_0x76e8[_0x160ea1];return _0x36364e;};'use strict';var _=require('lodash');var crypto=require(_0x876e('0x0'));var jwt=require(_0x876e('0x1'));var moment=require(_0x876e('0x2'));var Redis=require(_0x876e('0x3'));var rp=require(_0x876e('0x4'));var util=require(_0x876e('0x5'));var encryptor=require(_0x876e('0x6'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x876e('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0x876e('0x8')]=_[_0x876e('0x9')](config[_0x876e('0x8')],{'host':_0x876e('0xa'),'port':0x18eb});var redis=new Redis(config[_0x876e('0x8')]);var MICROSOFT_AUTH_URL=_0x876e('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x876e('0xc'),_0x876e('0xd'),_0x876e('0xe'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x876e('0xf'),_0x876e('0x10')],'Dynamics365':[_0x876e('0x11'),_0x876e('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x876e('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x209988){var _0x13255b=_['map'](AZURE_AUTH_SCOPES[_0x209988['type']]);if(_0x209988[_0x876e('0x13')]===_0x876e('0x14'))_0x13255b[_0x876e('0x15')](_0x209988[_0x876e('0x16')]+'/.default');return _0x13255b[_0x876e('0x17')]('\x20');}function getAccessTokenScope(_0x2708d2){if(_0x2708d2[_0x876e('0x13')]===_0x876e('0x18'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x2708d2[_0x876e('0x13')]===_0x876e('0x14'))return _0x2708d2[_0x876e('0x16')]+_0x876e('0x19');}function generateMicrosoftAuthorizationUrl(_0x1c04c4,_0x59e57f){var _0x43ea7e=MICROSOFT_AUTH_URL[_0x876e('0x1a')](_0x876e('0x1b'),_0x1c04c4['data2']);var _0x4b40c0=[_0x876e('0x1c'),_0x876e('0x1d')];var _0x13f07f=Buffer[_0x876e('0x1e')](JSON[_0x876e('0x1f')]({'id':_0x59e57f}))[_0x876e('0x20')]('base64');var _0x29cc17=crypto[_0x876e('0x21')](0x10)[_0x876e('0x20')]('hex');var _0x5b28b8=getAuthorizationScopes(_0x1c04c4);var _0x2a0bd6=[{'key':_0x876e('0x22'),'value':_0x1c04c4[_0x876e('0x23')]},{'key':'response_type','value':encodeURIComponent(_0x4b40c0['join']('\x20'))},{'key':'redirect_uri','value':_0x1c04c4[_0x876e('0x24')]},{'key':'response_mode','value':_0x876e('0x25')},{'key':_0x876e('0x26'),'value':encodeURIComponent(_0x5b28b8)},{'key':_0x876e('0x27'),'value':_0x13f07f},{'key':_0x876e('0x28'),'value':_0x29cc17},{'key':_0x876e('0x29'),'value':_0x876e('0x2a')}];var _0x15c44e=_0x43ea7e+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x876e('0x2b')](_0x2a0bd6,function(_0x2bf635){return _0x2bf635[_0x876e('0x2c')]+'='+_0x2bf635[_0x876e('0x2d')];})[_0x876e('0x17')]('&');_0x1c04c4['oauth2Claims']={'issuer':_0x43ea7e[_0x876e('0x1a')](_0x876e('0x2e'),''),'audience':_0x1c04c4['data1'],'state':_0x13f07f,'nonce':_0x29cc17};redis['set'](_0x13f07f,JSON[_0x876e('0x1f')](_0x1c04c4));return _0x15c44e;}function isValidIdToken(_0x29c498,_0x4518ff){try{var _0x3d486a=jwt[_0x876e('0x2f')](_0x29c498,{'complete':!![]});var _0xaf9c7=_0x3d486a[_0x876e('0x30')];if(_0xaf9c7[_0x876e('0x31')]!==_0x4518ff[_0x876e('0x32')])return![];if(_0xaf9c7[_0x876e('0x33')]!==_0x4518ff[_0x876e('0x34')])return![];if(_0xaf9c7['nonce']!==_0x4518ff[_0x876e('0x28')])return![];if(moment()[_0x876e('0x35')](moment[_0x876e('0x36')](_0xaf9c7['exp'])))return![];return!![];}catch(_0x319d91){throw _0x319d91;}}function refreshOauth2MicrosoftAccessToken(_0x38d254){return Promise[_0x876e('0x37')]()[_0x876e('0x38')](function(){if(_0x38d254[_0x876e('0x39')])return _0x38d254;return db['CloudProvider'][_0x876e('0x3a')]({'where':{'id':_0x38d254['id']},'raw':!![]});})['then'](function(_0x2810f0){var _0x385019={'grant_type':_0x876e('0x3b'),'refresh_token':_0x2810f0[_0x876e('0x3c')],'scope':getAccessTokenScope(_0x2810f0),'redirect_uri':_0x2810f0[_0x876e('0x24')],'client_id':_0x2810f0[_0x876e('0x23')],'client_secret':encryptor[_0x876e('0x3d')](_0x2810f0[_0x876e('0x39')])};var _0x1bab4b={'method':_0x876e('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x876e('0x1a')]('{TENANT_ID}',_0x2810f0['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x385019,'json':!![]};return rp(_0x1bab4b);})[_0x876e('0x38')](function(_0x55ec40){_0x38d254['data5']=_0x55ec40['access_token'];_0x38d254[_0x876e('0x3c')]=_0x55ec40[_0x876e('0x3b')];return db[_0x876e('0x3f')][_0x876e('0x40')]({'data5':_0x38d254[_0x876e('0x41')],'data6':_0x38d254[_0x876e('0x3c')]},{'where':{'id':_0x38d254['id']}});})[_0x876e('0x38')](function(){return _0x38d254;})[_0x876e('0x42')](function(_0x3e1cf6){logger[_0x876e('0x43')](_0x876e('0x44'),_0x38d254['id'],_0x3e1cf6);});}function getOauth2MicrosoftAccessToken(_0x379f54,_0x24bbac){var _0x2adb7d={'grant_type':_0x876e('0x45'),'code':_0x379f54,'scope':getAccessTokenScope(_0x24bbac),'redirect_uri':_0x24bbac[_0x876e('0x24')],'client_id':_0x24bbac[_0x876e('0x23')],'client_secret':encryptor[_0x876e('0x3d')](_0x24bbac[_0x876e('0x39')])};var _0x4dbbcd={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x876e('0x1a')](_0x876e('0x1b'),_0x24bbac[_0x876e('0x46')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2adb7d,'json':!![]};return rp(_0x4dbbcd);}function startRefreshInterval(_0x50eb85){var _0x4295ac=schedule['intervals'];if(_0x4295ac[_0x50eb85['id']])clearInterval(_0x4295ac[_0x50eb85['id']]);_0x4295ac[_0x50eb85['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x50eb85['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4295ac;}function startAllRefreshIntervals(){return db[_0x876e('0x3f')][_0x876e('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x876e('0x38')](function(_0x23aa69){var _0x20ee91=_0x23aa69[_0x876e('0x2b')](function(_0x39a6eb){return refreshOauth2MicrosoftAccessToken(_0x39a6eb)[_0x876e('0x38')](function(_0x8c53c3){startRefreshInterval(_0x8c53c3);});});return Promise['all'](_0x20ee91);})[_0x876e('0x42')](function(_0x47e271){var _0x2a2dd9=_0x47e271?util['inspect'](_0x47e271,{'showHidden':![],'depth':null}):'';logger['error'](_0x876e('0x48'),_0x2a2dd9);});}module[_0x876e('0x49')]={'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 46d4cce..5aa3dfe 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 _0x6ac2=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6ac2,0x184));var _0x26ac=function(_0xa348e,_0xed07dc){_0xa348e=_0xa348e-0x0;var _0x10a57e=_0x6ac2[_0xa348e];return _0x10a57e;};'use strict';var _=require(_0x26ac('0x0'));var util=require('util');var moment=require(_0x26ac('0x1'));var BPromise=require(_0x26ac('0x2'));var rs=require(_0x26ac('0x3'));var fs=require('fs');var Redis=require(_0x26ac('0x4'));var db=require(_0x26ac('0x5'))['db'];var utils=require(_0x26ac('0x6'));var logger=require('../../config/logger')(_0x26ac('0x7'));var config=require('../../config/environment');var jayson=require(_0x26ac('0x8'));var client=jayson[_0x26ac('0x9')][_0x26ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x159ba6,_0x36389c,_0x444ca1){return new BPromise(function(_0x1906d0,_0xd8b1e5){return client['request'](_0x159ba6,_0x444ca1)['then'](function(_0x27ff15){logger[_0x26ac('0xb')](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));logger['debug'](_0x26ac('0xe'),_0x36389c,_0x26ac('0xd'),JSON[_0x26ac('0xf')](_0x27ff15));if(_0x27ff15[_0x26ac('0x10')]){if(_0x27ff15['error']['code']===0x1f4){logger[_0x26ac('0x10')](_0x26ac('0xc'),_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0xd8b1e5(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}logger[_0x26ac('0x10')]('CloudProvider,\x20%s,\x20%s',_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0x1906d0(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}else{logger['info'](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));_0x1906d0(_0x27ff15['result'][_0x26ac('0x11')]);}})[_0x26ac('0x12')](function(_0x3b7c5d){logger[_0x26ac('0x10')]('CloudProvider,\x20%s,\x20%s',_0x36389c,_0x3b7c5d);_0xd8b1e5(_0x3b7c5d);});});} \ No newline at end of file +var _0x6257=['info','request\x20sent','debug','code','message','error','CloudProvider,\x20%s,\x20%s','result','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x15c1eb,_0x3c8cb8){var _0x630e54=function(_0x2b9e54){while(--_0x2b9e54){_0x15c1eb['push'](_0x15c1eb['shift']());}};_0x630e54(++_0x3c8cb8);}(_0x6257,0x1d4));var _0x7625=function(_0x429c1f,_0x4cb6e7){_0x429c1f=_0x429c1f-0x0;var _0x5cad29=_0x6257[_0x429c1f];return _0x5cad29;};'use strict';var _=require(_0x7625('0x0'));var util=require('util');var moment=require(_0x7625('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7625('0x2'));var db=require(_0x7625('0x3'))['db'];var utils=require(_0x7625('0x4'));var logger=require(_0x7625('0x5'))(_0x7625('0x6'));var config=require(_0x7625('0x7'));var jayson=require(_0x7625('0x8'));var client=jayson[_0x7625('0x9')][_0x7625('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x427050,_0x5cf7a8,_0x4b790d){return new BPromise(function(_0x287434,_0x1a02de){return client['request'](_0x427050,_0x4b790d)[_0x7625('0xb')](function(_0x2a2625){logger[_0x7625('0xc')]('CloudProvider,\x20%s,\x20%s',_0x5cf7a8,_0x7625('0xd'));logger[_0x7625('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5cf7a8,_0x7625('0xd'),JSON['stringify'](_0x2a2625));if(_0x2a2625['error']){if(_0x2a2625['error'][_0x7625('0xf')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x5cf7a8,_0x2a2625['error'][_0x7625('0x10')]);return _0x1a02de(_0x2a2625[_0x7625('0x11')][_0x7625('0x10')]);}logger[_0x7625('0x11')](_0x7625('0x12'),_0x5cf7a8,_0x2a2625[_0x7625('0x11')]['message']);return _0x287434(_0x2a2625['error'][_0x7625('0x10')]);}else{logger['info'](_0x7625('0x12'),_0x5cf7a8,_0x7625('0xd'));_0x287434(_0x2a2625[_0x7625('0x13')]['message']);}})['catch'](function(_0x43206e){logger[_0x7625('0x11')](_0x7625('0x12'),_0x5cf7a8,_0x43206e);_0x1a02de(_0x43206e);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index bfdd361..1d3044f 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 _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(_0x5c7e53,_0x174ce5){var _0x1c9af9=function(_0x38895d){while(--_0x38895d){_0x5c7e53['push'](_0x5c7e53['shift']());}};_0x1c9af9(++_0x174ce5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2b93e1,_0x10e1d3){_0x2b93e1=_0x2b93e1-0x0;var _0x40f612=_0x5f2f[_0x2b93e1];return _0x40f612;};'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 +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x7a54,0x106));var _0x47a5=function(_0xa9e9b4,_0x45edee){_0xa9e9b4=_0xa9e9b4-0x0;var _0x45dd5c=_0x7a54[_0xa9e9b4];return _0x45dd5c;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index cb62ac5..cd1ae20 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 _0x38ca=['STRING','name','sequelize'];(function(_0x128ee7,_0xbfbe00){var _0x38450a=function(_0x570931){while(--_0x570931){_0x128ee7['push'](_0x128ee7['shift']());}};_0x38450a(++_0xbfbe00);}(_0x38ca,0xb0));var _0xa38c=function(_0xa46cc9,_0x327f7d){_0xa46cc9=_0xa46cc9-0x0;var _0x5683ed=_0x38ca[_0xa46cc9];return _0x5683ed;};'use strict';var Sequelize=require(_0xa38c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa38c('0x1')],'unique':_0xa38c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa38c('0x1')]},'companyId':{'type':Sequelize[_0xa38c('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa38c('0x1')]},'fax':{'type':Sequelize[_0xa38c('0x1')]},'type':{'type':Sequelize[_0xa38c('0x1')]},'street':{'type':Sequelize[_0xa38c('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa38c('0x1')]},'country':{'type':Sequelize[_0xa38c('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xa38c('0x1')]},'sPostalCode':{'type':Sequelize[_0xa38c('0x1')]},'sCity':{'type':Sequelize[_0xa38c('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa38c('0x1')]}}; \ No newline at end of file +var _0x1a9d=['name','sequelize','exports','STRING'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x1a9d,0x161));var _0xd1a9=function(_0x2dff7e,_0x3666b2){_0x2dff7e=_0x2dff7e-0x0;var _0x3548e0=_0x1a9d[_0x2dff7e];return _0x3548e0;};'use strict';var Sequelize=require(_0xd1a9('0x0'));module[_0xd1a9('0x1')]={'name':{'type':Sequelize[_0xd1a9('0x2')],'unique':_0xd1a9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd1a9('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xd1a9('0x2')]},'phone':{'type':Sequelize[_0xd1a9('0x2')]},'fax':{'type':Sequelize[_0xd1a9('0x2')]},'type':{'type':Sequelize[_0xd1a9('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd1a9('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xd1a9('0x2')]},'email':{'type':Sequelize[_0xd1a9('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd1a9('0x2')]},'sStreet':{'type':Sequelize[_0xd1a9('0x2')]},'sPostalCode':{'type':Sequelize[_0xd1a9('0x2')]},'sCity':{'type':Sequelize[_0xd1a9('0x2')]},'sCountry':{'type':Sequelize[_0xd1a9('0x2')]},'description':{'type':Sequelize[_0xd1a9('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 48c5328..dfa0f00 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 _0xc9e7=['moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addContacts','CmContact','ids','omit','getContacts','findOne','order','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x1599a0,_0x34b3f8){var _0x4f57ed=function(_0x1822d8){while(--_0x1822d8){_0x1599a0['push'](_0x1599a0['shift']());}};_0x4f57ed(++_0x34b3f8);}(_0xc9e7,0xb5));var _0x7c9e=function(_0x1ddcbe,_0x203dfb){_0x1ddcbe=_0x1ddcbe-0x0;var _0x29741d=_0xc9e7[_0x1ddcbe];return _0x29741d;};'use strict';var emlformat=require(_0x7c9e('0x0'));var rimraf=require(_0x7c9e('0x1'));var zipdir=require(_0x7c9e('0x2'));var jsonpatch=require(_0x7c9e('0x3'));var rp=require(_0x7c9e('0x4'));var moment=require(_0x7c9e('0x5'));var BPromise=require(_0x7c9e('0x6'));var Mustache=require(_0x7c9e('0x7'));var util=require(_0x7c9e('0x8'));var path=require('path');var sox=require(_0x7c9e('0x9'));var csv=require('to-csv');var ejs=require(_0x7c9e('0xa'));var fs=require('fs');var fs_extra=require(_0x7c9e('0xb'));var _=require(_0x7c9e('0xc'));var squel=require('squel');var crypto=require(_0x7c9e('0xd'));var jsforce=require(_0x7c9e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7c9e('0xf'));var querystring=require(_0x7c9e('0x10'));var Papa=require('papaparse');var Redis=require(_0x7c9e('0x11'));var authService=require(_0x7c9e('0x12'));var qs=require(_0x7c9e('0x13'));var as=require(_0x7c9e('0x14'));var hardwareService=require(_0x7c9e('0x15'));var logger=require(_0x7c9e('0x16'))(_0x7c9e('0x17'));var utils=require(_0x7c9e('0x18'));var config=require(_0x7c9e('0x19'));var licenseUtil=require(_0x7c9e('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x337582,_0x563893){_0x563893=_0x563893||0xcc;return function(_0xaba2e8){if(_0xaba2e8){return _0x337582['sendStatus'](_0x563893);}return _0x337582['status'](_0x563893)[_0x7c9e('0x1b')]();};}function respondWithResult(_0x5a2188,_0x434eee){_0x434eee=_0x434eee||0xc8;return function(_0x12c6e3){if(_0x12c6e3){return _0x5a2188[_0x7c9e('0x1c')](_0x434eee)[_0x7c9e('0x1d')](_0x12c6e3);}};}function respondWithFilteredResult(_0x56aa79,_0x106391){return function(_0x289638){if(_0x289638){var _0x4ff7ea=typeof _0x106391['offset']===_0x7c9e('0x1e')&&typeof _0x106391[_0x7c9e('0x1f')]==='undefined';var _0x5ae28e=_0x289638[_0x7c9e('0x20')];var _0x4c32a2=_0x4ff7ea?0x0:_0x106391['offset'];var _0x41e69a=_0x4ff7ea?_0x289638['count']:_0x106391[_0x7c9e('0x21')]+_0x106391[_0x7c9e('0x1f')];var _0x49f445;if(_0x41e69a>=_0x5ae28e){_0x41e69a=_0x5ae28e;_0x49f445=0xc8;}else{_0x49f445=0xce;}_0x56aa79[_0x7c9e('0x1c')](_0x49f445);return _0x56aa79[_0x7c9e('0x22')](_0x7c9e('0x23'),_0x4c32a2+'-'+_0x41e69a+'/'+_0x5ae28e)[_0x7c9e('0x1d')](_0x289638);}return null;};}function patchUpdates(_0x62e2b8){return function(_0x50c1ca){try{jsonpatch[_0x7c9e('0x24')](_0x50c1ca,_0x62e2b8,!![]);}catch(_0x1f26ec){return BPromise[_0x7c9e('0x25')](_0x1f26ec);}return _0x50c1ca[_0x7c9e('0x26')]();};}function saveUpdates(_0xb527f,_0x3d8217){return function(_0x36365c){if(_0x36365c){return _0x36365c[_0x7c9e('0x27')](_0xb527f)[_0x7c9e('0x28')](function(_0x54075a){return _0x54075a;});}return null;};}function removeEntity(_0x31fb6b,_0x4d0c6a){return function(_0xe4e1a8){if(_0xe4e1a8){return _0xe4e1a8['destroy']()[_0x7c9e('0x28')](function(){var _0x40bd2b=_0xe4e1a8[_0x7c9e('0x29')]({'plain':!![]});var _0x316f31=_0x7c9e('0x2a');return db[_0x7c9e('0x2b')]['destroy']({'where':{'type':_0x316f31,'resourceId':_0x40bd2b['id']}})['then'](function(){return _0xe4e1a8;});})[_0x7c9e('0x28')](function(){_0x31fb6b[_0x7c9e('0x1c')](0xcc)[_0x7c9e('0x1b')]();});}};}function handleEntityNotFound(_0x3956fe,_0x44d35f){return function(_0x274eae){if(!_0x274eae){_0x3956fe['sendStatus'](0x194);}return _0x274eae;};}function handleError(_0xb97807,_0x7a5a19){_0x7a5a19=_0x7a5a19||0x1f4;return function(_0x2e3ce5){logger[_0x7c9e('0x2c')](_0x2e3ce5[_0x7c9e('0x2d')]);if(_0x2e3ce5[_0x7c9e('0x2e')]){delete _0x2e3ce5[_0x7c9e('0x2e')];}_0xb97807[_0x7c9e('0x1c')](_0x7a5a19)[_0x7c9e('0x2f')](_0x2e3ce5);};}exports[_0x7c9e('0x30')]=function(_0x1ad25a,_0x5ccd46){var _0x15d7c2={},_0x2395e7={},_0x52ba68={'count':0x0,'rows':[]};return db[_0x7c9e('0x31')]['describe']()[_0x7c9e('0x28')](function(_0x5d8e81){_0x2395e7['model']=_[_0x7c9e('0x32')](_0x5d8e81);_0x2395e7['query']=_['keys'](_0x1ad25a[_0x7c9e('0x33')]);_0x2395e7[_0x7c9e('0x34')]=_['intersection'](_0x2395e7[_0x7c9e('0x35')],_0x2395e7[_0x7c9e('0x33')]);_0x15d7c2['attributes']=_[_0x7c9e('0x36')](_0x2395e7[_0x7c9e('0x35')],qs['fields'](_0x1ad25a['query'][_0x7c9e('0x37')]));_0x15d7c2['attributes']=_0x15d7c2['attributes']['length']?_0x15d7c2[_0x7c9e('0x38')]:_0x2395e7['model'];if(!_0x1ad25a[_0x7c9e('0x33')][_0x7c9e('0x39')](_0x7c9e('0x3a'))){_0x15d7c2[_0x7c9e('0x1f')]=qs[_0x7c9e('0x1f')](_0x1ad25a[_0x7c9e('0x33')]['limit']);_0x15d7c2[_0x7c9e('0x21')]=qs[_0x7c9e('0x21')](_0x1ad25a[_0x7c9e('0x33')][_0x7c9e('0x21')]);}_0x15d7c2['order']=qs[_0x7c9e('0x3b')](_0x1ad25a[_0x7c9e('0x33')][_0x7c9e('0x3b')]);_0x15d7c2[_0x7c9e('0x3c')]=qs[_0x7c9e('0x34')](_[_0x7c9e('0x3d')](_0x1ad25a[_0x7c9e('0x33')],_0x2395e7['filters']),_0x5d8e81);if(_0x1ad25a[_0x7c9e('0x33')][_0x7c9e('0x3e')]){_0x15d7c2[_0x7c9e('0x3c')]=_[_0x7c9e('0x3f')](_0x15d7c2[_0x7c9e('0x3c')],{'$or':_['map'](_0x15d7c2[_0x7c9e('0x38')],function(_0x1b28a4){var _0x5e741f={};_0x5e741f[_0x1b28a4]={'$like':'%'+_0x1ad25a[_0x7c9e('0x33')]['filter']+'%'};return _0x5e741f;})});}_0x15d7c2=_['merge']({},_0x15d7c2,_0x1ad25a[_0x7c9e('0x40')]);var _0xa074c6={'where':_0x15d7c2['where']};return db[_0x7c9e('0x31')][_0x7c9e('0x20')](_0xa074c6)[_0x7c9e('0x28')](function(_0x3dcace){_0x52ba68[_0x7c9e('0x20')]=_0x3dcace;if(_0x1ad25a[_0x7c9e('0x33')]['includeAll']){_0x15d7c2[_0x7c9e('0x41')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x15d7c2);})[_0x7c9e('0x28')](function(_0x515381){_0x52ba68[_0x7c9e('0x42')]=_0x515381;return _0x52ba68;})[_0x7c9e('0x28')](respondWithFilteredResult(_0x5ccd46,_0x15d7c2))[_0x7c9e('0x43')](handleError(_0x5ccd46,null));})[_0x7c9e('0x43')](handleError(_0x5ccd46,null));};exports[_0x7c9e('0x44')]=function(_0x4bb89d,_0x2e9050){var _0x10e579={'raw':![],'where':{'id':_0x4bb89d[_0x7c9e('0x45')]['id']}},_0x10db06={};_0x10db06[_0x7c9e('0x35')]=_[_0x7c9e('0x32')](db[_0x7c9e('0x31')][_0x7c9e('0x46')]);_0x10db06['query']=_['keys'](_0x4bb89d['query']);_0x10db06[_0x7c9e('0x34')]=_[_0x7c9e('0x36')](_0x10db06[_0x7c9e('0x35')],_0x10db06[_0x7c9e('0x33')]);_0x10e579['attributes']=_[_0x7c9e('0x36')](_0x10db06[_0x7c9e('0x35')],qs[_0x7c9e('0x37')](_0x4bb89d['query'][_0x7c9e('0x37')]));_0x10e579[_0x7c9e('0x38')]=_0x10e579['attributes'][_0x7c9e('0x47')]?_0x10e579[_0x7c9e('0x38')]:_0x10db06['model'];if(_0x4bb89d[_0x7c9e('0x33')][_0x7c9e('0x48')]){_0x10e579[_0x7c9e('0x41')]=[{'all':!![]}];}_0x10e579=_['merge']({},_0x10e579,_0x4bb89d['options']);return db[_0x7c9e('0x31')][_0x7c9e('0x49')](_0x10e579)[_0x7c9e('0x28')](handleEntityNotFound(_0x2e9050,null))[_0x7c9e('0x28')](respondWithResult(_0x2e9050,null))[_0x7c9e('0x43')](handleError(_0x2e9050,null));};exports[_0x7c9e('0x4a')]=function(_0x46bccd,_0x2c27a2){return db[_0x7c9e('0x31')]['create'](_0x46bccd[_0x7c9e('0x4b')],{})[_0x7c9e('0x28')](function(_0x27d6b4){var _0x14dc94=_0x46bccd[_0x7c9e('0x4c')]['get']({'plain':!![]});if(!_0x14dc94)throw new Error(_0x7c9e('0x4d'));if(_0x14dc94[_0x7c9e('0x4e')]===_0x7c9e('0x4c')){var _0x4f1903=_0x27d6b4[_0x7c9e('0x29')]({'plain':!![]});var _0x47a6c2=_0x7c9e('0x2a');return db[_0x7c9e('0x4f')][_0x7c9e('0x49')]({'where':{'name':_0x47a6c2,'userProfileId':_0x14dc94[_0x7c9e('0x50')]},'raw':!![]})[_0x7c9e('0x28')](function(_0xf9223d){if(_0xf9223d&&_0xf9223d[_0x7c9e('0x51')]===0x0){return db[_0x7c9e('0x2b')][_0x7c9e('0x4a')]({'name':_0x4f1903[_0x7c9e('0x2e')],'resourceId':_0x4f1903['id'],'type':_0xf9223d['name'],'sectionId':_0xf9223d['id']},{})[_0x7c9e('0x28')](function(){return _0x27d6b4;});}else{return _0x27d6b4;}})['catch'](function(_0x2a6ae2){logger[_0x7c9e('0x2c')](_0x7c9e('0x52'),_0x2a6ae2);throw _0x2a6ae2;});}return _0x27d6b4;})[_0x7c9e('0x28')](respondWithResult(_0x2c27a2,0xc9))[_0x7c9e('0x43')](handleError(_0x2c27a2,null));};exports[_0x7c9e('0x27')]=function(_0x4d124b,_0x7f3ca6){if(_0x4d124b['body']['id']){delete _0x4d124b['body']['id'];}return db[_0x7c9e('0x31')]['find']({'where':{'id':_0x4d124b['params']['id']}})[_0x7c9e('0x28')](handleEntityNotFound(_0x7f3ca6,null))['then'](saveUpdates(_0x4d124b['body'],null))[_0x7c9e('0x28')](respondWithResult(_0x7f3ca6,null))['catch'](handleError(_0x7f3ca6,null));};exports[_0x7c9e('0x53')]=function(_0x190414,_0x1bf474){return db[_0x7c9e('0x31')][_0x7c9e('0x49')]({'where':{'id':_0x190414[_0x7c9e('0x45')]['id']}})[_0x7c9e('0x28')](handleEntityNotFound(_0x1bf474,null))['then'](removeEntity(_0x1bf474,null))[_0x7c9e('0x43')](handleError(_0x1bf474,null));};exports[_0x7c9e('0x54')]=function(_0x5cca40,_0x5977cf){return db[_0x7c9e('0x31')][_0x7c9e('0x54')]()[_0x7c9e('0x28')](respondWithResult(_0x5977cf,null))[_0x7c9e('0x43')](handleError(_0x5977cf,null));};exports[_0x7c9e('0x55')]=function(_0x5d5d1f,_0x264c93,_0x28655d){return db[_0x7c9e('0x56')][_0x7c9e('0x49')]({'where':{'id':_0x5d5d1f[_0x7c9e('0x45')]['id']}})[_0x7c9e('0x28')](handleEntityNotFound(_0x264c93,null))['then'](function(_0x430a69){if(_0x430a69){return _0x430a69[_0x7c9e('0x55')](_0x5d5d1f['body'][_0x7c9e('0x57')],_[_0x7c9e('0x58')](_0x5d5d1f[_0x7c9e('0x4b')],[_0x7c9e('0x57'),'id'])||{});}})[_0x7c9e('0x28')](respondWithResult(_0x264c93,null))['catch'](handleError(_0x264c93,null));};exports[_0x7c9e('0x59')]=function(_0x4d4a71,_0x35c892,_0x543840){var _0x87ade={};var _0x5f268b={};var _0x4b7f38;var _0x218cae;return db[_0x7c9e('0x31')][_0x7c9e('0x5a')]({'where':{'id':_0x4d4a71[_0x7c9e('0x45')]['id']}})['then'](handleEntityNotFound(_0x35c892,null))[_0x7c9e('0x28')](function(_0x96b627){if(_0x96b627){_0x4b7f38=_0x96b627;_0x5f268b['model']=_[_0x7c9e('0x32')](db[_0x7c9e('0x56')][_0x7c9e('0x46')]);_0x5f268b[_0x7c9e('0x33')]=_[_0x7c9e('0x32')](_0x4d4a71[_0x7c9e('0x33')]);_0x5f268b['filters']=_[_0x7c9e('0x36')](_0x5f268b[_0x7c9e('0x35')],_0x5f268b[_0x7c9e('0x33')]);_0x87ade[_0x7c9e('0x38')]=_[_0x7c9e('0x36')](_0x5f268b['model'],qs[_0x7c9e('0x37')](_0x4d4a71['query'][_0x7c9e('0x37')]));_0x87ade[_0x7c9e('0x38')]=_0x87ade['attributes'][_0x7c9e('0x47')]?_0x87ade[_0x7c9e('0x38')]:_0x5f268b[_0x7c9e('0x35')];_0x87ade[_0x7c9e('0x5b')]=qs[_0x7c9e('0x3b')](_0x4d4a71[_0x7c9e('0x33')][_0x7c9e('0x3b')]);_0x87ade[_0x7c9e('0x3c')]=qs[_0x7c9e('0x34')](_[_0x7c9e('0x3d')](_0x4d4a71['query'],_0x5f268b['filters']));if(_0x4d4a71['query']['filter']){_0x87ade[_0x7c9e('0x3c')]=_[_0x7c9e('0x3f')](_0x87ade[_0x7c9e('0x3c')],{'$or':_[_0x7c9e('0x5c')](_0x87ade[_0x7c9e('0x38')],function(_0x1383e9){var _0x54cf41={};_0x54cf41[_0x1383e9]={'$like':'%'+_0x4d4a71['query'][_0x7c9e('0x3e')]+'%'};return _0x54cf41;})});}_0x87ade=_['merge']({},_0x87ade,_0x4d4a71[_0x7c9e('0x40')]);return _0x4b7f38['getContacts'](_0x87ade);}})[_0x7c9e('0x28')](function(_0x38d023){if(_0x38d023){_0x218cae=_0x38d023[_0x7c9e('0x47')];if(!_0x4d4a71[_0x7c9e('0x33')][_0x7c9e('0x39')](_0x7c9e('0x3a'))){_0x87ade[_0x7c9e('0x1f')]=qs['limit'](_0x4d4a71[_0x7c9e('0x33')]['limit']);_0x87ade[_0x7c9e('0x21')]=qs[_0x7c9e('0x21')](_0x4d4a71[_0x7c9e('0x33')][_0x7c9e('0x21')]);}return _0x4b7f38[_0x7c9e('0x59')](_0x87ade);}})[_0x7c9e('0x28')](function(_0x5be71e){if(_0x5be71e){return _0x5be71e?{'count':_0x218cae,'rows':_0x5be71e}:null;}})[_0x7c9e('0x28')](respondWithResult(_0x35c892,null))['catch'](handleError(_0x35c892,null));}; \ No newline at end of file +var _0x153b=['lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','Companies','UserProfileResource','sendStatus','error','stack','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','include','findAll','rawAttributes','length','catch','create','body','user','role','get','UserProfileSection','find','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','sort','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x117512,_0x2163f5){var _0xe34741=function(_0x372088){while(--_0x372088){_0x117512['push'](_0x117512['shift']());}};_0xe34741(++_0x2163f5);}(_0x153b,0x9d));var _0xb153=function(_0x10bd48,_0xffde46){_0x10bd48=_0x10bd48-0x0;var _0x581623=_0x153b[_0x10bd48];return _0x581623;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb153('0x0'));var zipdir=require(_0xb153('0x1'));var jsonpatch=require(_0xb153('0x2'));var rp=require(_0xb153('0x3'));var moment=require(_0xb153('0x4'));var BPromise=require(_0xb153('0x5'));var Mustache=require(_0xb153('0x6'));var util=require(_0xb153('0x7'));var path=require('path');var sox=require(_0xb153('0x8'));var csv=require(_0xb153('0x9'));var ejs=require(_0xb153('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb153('0xb'));var squel=require('squel');var crypto=require(_0xb153('0xc'));var jsforce=require(_0xb153('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb153('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb153('0xe'));var authService=require(_0xb153('0xf'));var qs=require(_0xb153('0x10'));var as=require(_0xb153('0x11'));var hardwareService=require(_0xb153('0x12'));var logger=require(_0xb153('0x13'))(_0xb153('0x14'));var utils=require(_0xb153('0x15'));var config=require(_0xb153('0x16'));var licenseUtil=require(_0xb153('0x17'));var db=require(_0xb153('0x18'))['db'];function respondWithStatusCode(_0xbaa57,_0x1fcbda){_0x1fcbda=_0x1fcbda||0xcc;return function(_0x5a28e4){if(_0x5a28e4){return _0xbaa57['sendStatus'](_0x1fcbda);}return _0xbaa57[_0xb153('0x19')](_0x1fcbda)[_0xb153('0x1a')]();};}function respondWithResult(_0x427728,_0x4a2d5e){_0x4a2d5e=_0x4a2d5e||0xc8;return function(_0x1b38b7){if(_0x1b38b7){return _0x427728[_0xb153('0x19')](_0x4a2d5e)['json'](_0x1b38b7);}};}function respondWithFilteredResult(_0x3ae77b,_0x3cd2e0){return function(_0xee1bc7){if(_0xee1bc7){var _0x536a28=typeof _0x3cd2e0[_0xb153('0x1b')]===_0xb153('0x1c')&&typeof _0x3cd2e0[_0xb153('0x1d')]===_0xb153('0x1c');var _0x227c07=_0xee1bc7['count'];var _0x4edc45=_0x536a28?0x0:_0x3cd2e0[_0xb153('0x1b')];var _0xebd725=_0x536a28?_0xee1bc7[_0xb153('0x1e')]:_0x3cd2e0[_0xb153('0x1b')]+_0x3cd2e0[_0xb153('0x1d')];var _0x3922c9;if(_0xebd725>=_0x227c07){_0xebd725=_0x227c07;_0x3922c9=0xc8;}else{_0x3922c9=0xce;}_0x3ae77b[_0xb153('0x19')](_0x3922c9);return _0x3ae77b[_0xb153('0x1f')](_0xb153('0x20'),_0x4edc45+'-'+_0xebd725+'/'+_0x227c07)['json'](_0xee1bc7);}return null;};}function patchUpdates(_0x265838){return function(_0x2affc9){try{jsonpatch['apply'](_0x2affc9,_0x265838,!![]);}catch(_0x2867eb){return BPromise[_0xb153('0x21')](_0x2867eb);}return _0x2affc9[_0xb153('0x22')]();};}function saveUpdates(_0x4b7d77,_0xeaab15){return function(_0x31dd89){if(_0x31dd89){return _0x31dd89[_0xb153('0x23')](_0x4b7d77)[_0xb153('0x24')](function(_0x4ce9b9){return _0x4ce9b9;});}return null;};}function removeEntity(_0x335b9e,_0x241b96){return function(_0x2c68d5){if(_0x2c68d5){return _0x2c68d5[_0xb153('0x25')]()['then'](function(){var _0x4a3606=_0x2c68d5['get']({'plain':!![]});var _0x2aef3f=_0xb153('0x26');return db[_0xb153('0x27')]['destroy']({'where':{'type':_0x2aef3f,'resourceId':_0x4a3606['id']}})[_0xb153('0x24')](function(){return _0x2c68d5;});})[_0xb153('0x24')](function(){_0x335b9e[_0xb153('0x19')](0xcc)[_0xb153('0x1a')]();});}};}function handleEntityNotFound(_0x4afd1d,_0x1db497){return function(_0x1007ff){if(!_0x1007ff){_0x4afd1d[_0xb153('0x28')](0x194);}return _0x1007ff;};}function handleError(_0x5ac008,_0x247d13){_0x247d13=_0x247d13||0x1f4;return function(_0x2950e2){logger[_0xb153('0x29')](_0x2950e2[_0xb153('0x2a')]);if(_0x2950e2['name']){delete _0x2950e2['name'];}_0x5ac008[_0xb153('0x19')](_0x247d13)[_0xb153('0x2b')](_0x2950e2);};}exports[_0xb153('0x2c')]=function(_0x13f7cc,_0x5a0b14){var _0x3f796d={},_0x20694e={},_0x1059ef={'count':0x0,'rows':[]};return db[_0xb153('0x2d')][_0xb153('0x2e')]()[_0xb153('0x24')](function(_0x5558aa){_0x20694e[_0xb153('0x2f')]=_['keys'](_0x5558aa);_0x20694e[_0xb153('0x30')]=_[_0xb153('0x31')](_0x13f7cc['query']);_0x20694e[_0xb153('0x32')]=_[_0xb153('0x33')](_0x20694e[_0xb153('0x2f')],_0x20694e[_0xb153('0x30')]);_0x3f796d[_0xb153('0x34')]=_[_0xb153('0x33')](_0x20694e[_0xb153('0x2f')],qs[_0xb153('0x35')](_0x13f7cc['query'][_0xb153('0x35')]));_0x3f796d[_0xb153('0x34')]=_0x3f796d['attributes']['length']?_0x3f796d[_0xb153('0x34')]:_0x20694e[_0xb153('0x2f')];if(!_0x13f7cc[_0xb153('0x30')][_0xb153('0x36')](_0xb153('0x37'))){_0x3f796d[_0xb153('0x1d')]=qs[_0xb153('0x1d')](_0x13f7cc['query'][_0xb153('0x1d')]);_0x3f796d['offset']=qs['offset'](_0x13f7cc['query'][_0xb153('0x1b')]);}_0x3f796d['order']=qs['sort'](_0x13f7cc[_0xb153('0x30')]['sort']);_0x3f796d[_0xb153('0x38')]=qs[_0xb153('0x32')](_[_0xb153('0x39')](_0x13f7cc[_0xb153('0x30')],_0x20694e[_0xb153('0x32')]),_0x5558aa);if(_0x13f7cc[_0xb153('0x30')][_0xb153('0x3a')]){_0x3f796d[_0xb153('0x38')]=_[_0xb153('0x3b')](_0x3f796d[_0xb153('0x38')],{'$or':_['map'](_0x3f796d[_0xb153('0x34')],function(_0x5ee63f){var _0x511454={};_0x511454[_0x5ee63f]={'$like':'%'+_0x13f7cc['query'][_0xb153('0x3a')]+'%'};return _0x511454;})});}_0x3f796d=_['merge']({},_0x3f796d,_0x13f7cc[_0xb153('0x3c')]);var _0x3a69b5={'where':_0x3f796d[_0xb153('0x38')]};return db[_0xb153('0x2d')][_0xb153('0x1e')](_0x3a69b5)['then'](function(_0x288229){_0x1059ef[_0xb153('0x1e')]=_0x288229;if(_0x13f7cc[_0xb153('0x30')][_0xb153('0x3d')]){_0x3f796d[_0xb153('0x3e')]=[{'all':!![]}];}return db[_0xb153('0x2d')][_0xb153('0x3f')](_0x3f796d);})[_0xb153('0x24')](function(_0x2c1bec){_0x1059ef['rows']=_0x2c1bec;return _0x1059ef;})[_0xb153('0x24')](respondWithFilteredResult(_0x5a0b14,_0x3f796d))['catch'](handleError(_0x5a0b14,null));})['catch'](handleError(_0x5a0b14,null));};exports['show']=function(_0x50dfa1,_0x5223da){var _0x3086f2={'raw':![],'where':{'id':_0x50dfa1['params']['id']}},_0x328379={};_0x328379[_0xb153('0x2f')]=_[_0xb153('0x31')](db[_0xb153('0x2d')][_0xb153('0x40')]);_0x328379[_0xb153('0x30')]=_[_0xb153('0x31')](_0x50dfa1[_0xb153('0x30')]);_0x328379[_0xb153('0x32')]=_[_0xb153('0x33')](_0x328379['model'],_0x328379[_0xb153('0x30')]);_0x3086f2[_0xb153('0x34')]=_[_0xb153('0x33')](_0x328379[_0xb153('0x2f')],qs['fields'](_0x50dfa1[_0xb153('0x30')][_0xb153('0x35')]));_0x3086f2[_0xb153('0x34')]=_0x3086f2[_0xb153('0x34')][_0xb153('0x41')]?_0x3086f2['attributes']:_0x328379[_0xb153('0x2f')];if(_0x50dfa1[_0xb153('0x30')]['includeAll']){_0x3086f2[_0xb153('0x3e')]=[{'all':!![]}];}_0x3086f2=_['merge']({},_0x3086f2,_0x50dfa1['options']);return db[_0xb153('0x2d')]['find'](_0x3086f2)[_0xb153('0x24')](handleEntityNotFound(_0x5223da,null))[_0xb153('0x24')](respondWithResult(_0x5223da,null))[_0xb153('0x42')](handleError(_0x5223da,null));};exports[_0xb153('0x43')]=function(_0x3a5234,_0x75a395){return db[_0xb153('0x2d')][_0xb153('0x43')](_0x3a5234[_0xb153('0x44')],{})['then'](function(_0x326865){var _0x7dbe0=_0x3a5234[_0xb153('0x45')]['get']({'plain':!![]});if(!_0x7dbe0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7dbe0[_0xb153('0x46')]===_0xb153('0x45')){var _0x2aff6c=_0x326865[_0xb153('0x47')]({'plain':!![]});var _0x9b7e80=_0xb153('0x26');return db[_0xb153('0x48')][_0xb153('0x49')]({'where':{'name':_0x9b7e80,'userProfileId':_0x7dbe0[_0xb153('0x4a')]},'raw':!![]})['then'](function(_0x5827cb){if(_0x5827cb&&_0x5827cb['autoAssociation']===0x0){return db[_0xb153('0x27')][_0xb153('0x43')]({'name':_0x2aff6c[_0xb153('0x4b')],'resourceId':_0x2aff6c['id'],'type':_0x5827cb[_0xb153('0x4b')],'sectionId':_0x5827cb['id']},{})[_0xb153('0x24')](function(){return _0x326865;});}else{return _0x326865;}})['catch'](function(_0xb02fac){logger[_0xb153('0x29')](_0xb153('0x4c'),_0xb02fac);throw _0xb02fac;});}return _0x326865;})[_0xb153('0x24')](respondWithResult(_0x75a395,0xc9))[_0xb153('0x42')](handleError(_0x75a395,null));};exports[_0xb153('0x23')]=function(_0x4a81cd,_0x38aa92){if(_0x4a81cd[_0xb153('0x44')]['id']){delete _0x4a81cd['body']['id'];}return db[_0xb153('0x2d')][_0xb153('0x49')]({'where':{'id':_0x4a81cd[_0xb153('0x4d')]['id']}})['then'](handleEntityNotFound(_0x38aa92,null))[_0xb153('0x24')](saveUpdates(_0x4a81cd[_0xb153('0x44')],null))[_0xb153('0x24')](respondWithResult(_0x38aa92,null))['catch'](handleError(_0x38aa92,null));};exports[_0xb153('0x25')]=function(_0x2e89b0,_0x5034f8){return db['CmCompany']['find']({'where':{'id':_0x2e89b0[_0xb153('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5034f8,null))[_0xb153('0x24')](removeEntity(_0x5034f8,null))['catch'](handleError(_0x5034f8,null));};exports['describe']=function(_0x5676da,_0x25fef5){return db['CmCompany'][_0xb153('0x2e')]()['then'](respondWithResult(_0x25fef5,null))[_0xb153('0x42')](handleError(_0x25fef5,null));};exports[_0xb153('0x4e')]=function(_0x413719,_0xe2e159,_0x204942){return db[_0xb153('0x4f')][_0xb153('0x49')]({'where':{'id':_0x413719['params']['id']}})[_0xb153('0x24')](handleEntityNotFound(_0xe2e159,null))[_0xb153('0x24')](function(_0xc391d7){if(_0xc391d7){return _0xc391d7[_0xb153('0x4e')](_0x413719['body'][_0xb153('0x50')],_[_0xb153('0x51')](_0x413719[_0xb153('0x44')],[_0xb153('0x50'),'id'])||{});}})['then'](respondWithResult(_0xe2e159,null))[_0xb153('0x42')](handleError(_0xe2e159,null));};exports[_0xb153('0x52')]=function(_0x4b55df,_0xe239b0,_0x2b5b2d){var _0x4a568e={};var _0x4d1423={};var _0xbba249;var _0x37e398;return db[_0xb153('0x2d')]['findOne']({'where':{'id':_0x4b55df[_0xb153('0x4d')]['id']}})['then'](handleEntityNotFound(_0xe239b0,null))[_0xb153('0x24')](function(_0x16e469){if(_0x16e469){_0xbba249=_0x16e469;_0x4d1423[_0xb153('0x2f')]=_[_0xb153('0x31')](db[_0xb153('0x4f')][_0xb153('0x40')]);_0x4d1423[_0xb153('0x30')]=_[_0xb153('0x31')](_0x4b55df[_0xb153('0x30')]);_0x4d1423[_0xb153('0x32')]=_['intersection'](_0x4d1423['model'],_0x4d1423[_0xb153('0x30')]);_0x4a568e['attributes']=_[_0xb153('0x33')](_0x4d1423[_0xb153('0x2f')],qs['fields'](_0x4b55df['query'][_0xb153('0x35')]));_0x4a568e[_0xb153('0x34')]=_0x4a568e[_0xb153('0x34')][_0xb153('0x41')]?_0x4a568e[_0xb153('0x34')]:_0x4d1423[_0xb153('0x2f')];_0x4a568e['order']=qs[_0xb153('0x53')](_0x4b55df[_0xb153('0x30')][_0xb153('0x53')]);_0x4a568e[_0xb153('0x38')]=qs[_0xb153('0x32')](_[_0xb153('0x39')](_0x4b55df[_0xb153('0x30')],_0x4d1423[_0xb153('0x32')]));if(_0x4b55df['query'][_0xb153('0x3a')]){_0x4a568e[_0xb153('0x38')]=_[_0xb153('0x3b')](_0x4a568e[_0xb153('0x38')],{'$or':_['map'](_0x4a568e[_0xb153('0x34')],function(_0x2f8b1b){var _0x1de5d2={};_0x1de5d2[_0x2f8b1b]={'$like':'%'+_0x4b55df['query']['filter']+'%'};return _0x1de5d2;})});}_0x4a568e=_[_0xb153('0x3b')]({},_0x4a568e,_0x4b55df[_0xb153('0x3c')]);return _0xbba249[_0xb153('0x52')](_0x4a568e);}})['then'](function(_0x3ada94){if(_0x3ada94){_0x37e398=_0x3ada94[_0xb153('0x41')];if(!_0x4b55df['query']['hasOwnProperty'](_0xb153('0x37'))){_0x4a568e['limit']=qs[_0xb153('0x1d')](_0x4b55df[_0xb153('0x30')]['limit']);_0x4a568e[_0xb153('0x1b')]=qs[_0xb153('0x1b')](_0x4b55df['query']['offset']);}return _0xbba249[_0xb153('0x52')](_0x4a568e);}})[_0xb153('0x24')](function(_0xc76242){if(_0xc76242){return _0xc76242?{'count':_0x37e398,'rows':_0xc76242}:null;}})[_0xb153('0x24')](respondWithResult(_0xe239b0,null))[_0xb153('0x42')](handleError(_0xe239b0,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index f110f20..424a20e 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 _0x2fc0=['request-promise','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','../../config/logger','api','moment','bluebird'];(function(_0x3a465a,_0x3e8001){var _0x1ed244=function(_0x1349e9){while(--_0x1349e9){_0x3a465a['push'](_0x3a465a['shift']());}};_0x1ed244(++_0x3e8001);}(_0x2fc0,0x188));var _0x02fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2fc0[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x02fc('0x0'))(_0x02fc('0x1'));var moment=require(_0x02fc('0x2'));var BPromise=require(_0x02fc('0x3'));var rp=require(_0x02fc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x02fc('0x5'));var config=require(_0x02fc('0x6'));var attributes=require(_0x02fc('0x7'));module['exports']=function(_0x53c27e,_0x504a95){return _0x53c27e[_0x02fc('0x8')](_0x02fc('0x9'),attributes,{'tableName':_0x02fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09de=['request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x09de,0x89));var _0xe09d=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x09de[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0xe09d('0x0'));var util=require(_0xe09d('0x1'));var logger=require(_0xe09d('0x2'))(_0xe09d('0x3'));var moment=require(_0xe09d('0x4'));var BPromise=require(_0xe09d('0x5'));var rp=require(_0xe09d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe09d('0x7'));var config=require(_0xe09d('0x8'));var attributes=require(_0xe09d('0x9'));module[_0xe09d('0xa')]=function(_0x1b24e6,_0xbbba79){return _0x1b24e6['define'](_0xe09d('0xb'),attributes,{'tableName':_0xe09d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index bdff505..856e9c6 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 _0xfa3b=['../../config/environment','jayson/promise','client','request','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5cd253,_0x4162da){var _0x36e179=function(_0x597977){while(--_0x597977){_0x5cd253['push'](_0x5cd253['shift']());}};_0x36e179(++_0x4162da);}(_0xfa3b,0x1c5));var _0xbfa3=function(_0x474035,_0x41e639){_0x474035=_0x474035-0x0;var _0x1b58e0=_0xfa3b[_0x474035];return _0x1b58e0;};'use strict';var _=require(_0xbfa3('0x0'));var util=require(_0xbfa3('0x1'));var moment=require(_0xbfa3('0x2'));var BPromise=require(_0xbfa3('0x3'));var rs=require(_0xbfa3('0x4'));var fs=require('fs');var Redis=require(_0xbfa3('0x5'));var db=require(_0xbfa3('0x6'))['db'];var utils=require(_0xbfa3('0x7'));var logger=require(_0xbfa3('0x8'))('rpc');var config=require(_0xbfa3('0x9'));var jayson=require(_0xbfa3('0xa'));var client=jayson[_0xbfa3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x262cf0,_0xe8c5b4,_0x3a32b4){return new BPromise(function(_0x53a7d9,_0x21a4c3){return client[_0xbfa3('0xc')](_0x262cf0,_0x3a32b4)['then'](function(_0x206b9d){logger['info'](_0xbfa3('0xd'),_0xe8c5b4,_0xbfa3('0xe'));logger['debug'](_0xbfa3('0xf'),_0xe8c5b4,_0xbfa3('0xe'),JSON[_0xbfa3('0x10')](_0x206b9d));if(_0x206b9d[_0xbfa3('0x11')]){if(_0x206b9d[_0xbfa3('0x11')][_0xbfa3('0x12')]===0x1f4){logger[_0xbfa3('0x11')]('CmCompany,\x20%s,\x20%s',_0xe8c5b4,_0x206b9d[_0xbfa3('0x11')][_0xbfa3('0x13')]);return _0x21a4c3(_0x206b9d[_0xbfa3('0x11')][_0xbfa3('0x13')]);}logger[_0xbfa3('0x11')](_0xbfa3('0xd'),_0xe8c5b4,_0x206b9d[_0xbfa3('0x11')]['message']);return _0x53a7d9(_0x206b9d[_0xbfa3('0x11')][_0xbfa3('0x13')]);}else{logger[_0xbfa3('0x14')]('CmCompany,\x20%s,\x20%s',_0xe8c5b4,_0xbfa3('0xe'));_0x53a7d9(_0x206b9d[_0xbfa3('0x15')][_0xbfa3('0x13')]);}})['catch'](function(_0x2cd260){logger[_0xbfa3('0x11')](_0xbfa3('0xd'),_0xe8c5b4,_0x2cd260);_0x21a4c3(_0x2cd260);});});} \ No newline at end of file +var _0x6957=['jayson/promise','client','info','request\x20sent','debug','stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x157a8a,_0x34d072){var _0x5bf33f=function(_0x4fc182){while(--_0x4fc182){_0x157a8a['push'](_0x157a8a['shift']());}};_0x5bf33f(++_0x34d072);}(_0x6957,0xf3));var _0x7695=function(_0x23d081,_0x4b90c6){_0x23d081=_0x23d081-0x0;var _0xcc6bd3=_0x6957[_0x23d081];return _0xcc6bd3;};'use strict';var _=require(_0x7695('0x0'));var util=require(_0x7695('0x1'));var moment=require(_0x7695('0x2'));var BPromise=require(_0x7695('0x3'));var rs=require(_0x7695('0x4'));var fs=require('fs');var Redis=require(_0x7695('0x5'));var db=require(_0x7695('0x6'))['db'];var utils=require(_0x7695('0x7'));var logger=require('../../config/logger')(_0x7695('0x8'));var config=require('../../config/environment');var jayson=require(_0x7695('0x9'));var client=jayson[_0x7695('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dfa3f,_0x58ffb9,_0x365ba7){return new BPromise(function(_0x3d4a4a,_0xa71da6){return client['request'](_0x1dfa3f,_0x365ba7)['then'](function(_0x55e575){logger[_0x7695('0xb')]('CmCompany,\x20%s,\x20%s',_0x58ffb9,_0x7695('0xc'));logger[_0x7695('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x58ffb9,_0x7695('0xc'),JSON[_0x7695('0xe')](_0x55e575));if(_0x55e575[_0x7695('0xf')]){if(_0x55e575[_0x7695('0xf')][_0x7695('0x10')]===0x1f4){logger[_0x7695('0xf')]('CmCompany,\x20%s,\x20%s',_0x58ffb9,_0x55e575[_0x7695('0xf')][_0x7695('0x11')]);return _0xa71da6(_0x55e575[_0x7695('0xf')][_0x7695('0x11')]);}logger['error'](_0x7695('0x12'),_0x58ffb9,_0x55e575['error'][_0x7695('0x11')]);return _0x3d4a4a(_0x55e575[_0x7695('0xf')]['message']);}else{logger[_0x7695('0xb')]('CmCompany,\x20%s,\x20%s',_0x58ffb9,_0x7695('0xc'));_0x3d4a4a(_0x55e575[_0x7695('0x13')][_0x7695('0x11')]);}})[_0x7695('0x14')](function(_0x55c3dc){logger['error'](_0x7695('0x12'),_0x58ffb9,_0x55c3dc);_0xa71da6(_0x55c3dc);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 513f07c..5ff23ea 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 _0xf820=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','show','/:id/contacts','getContacts','create','post','addContacts','/:id','delete','destroy','multer','util','path','express'];(function(_0x37d77c,_0x4317e0){var _0x50c8f1=function(_0x20644b){while(--_0x20644b){_0x37d77c['push'](_0x37d77c['shift']());}};_0x50c8f1(++_0x4317e0);}(_0xf820,0x86));var _0x0f82=function(_0x33668d,_0x364922){_0x33668d=_0x33668d-0x0;var _0x1346e2=_0xf820[_0x33668d];return _0x1346e2;};'use strict';var multer=require(_0x0f82('0x0'));var util=require(_0x0f82('0x1'));var path=require(_0x0f82('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f82('0x3'));var router=express[_0x0f82('0x4')]();var fs_extra=require(_0x0f82('0x5'));var auth=require(_0x0f82('0x6'));var interaction=require(_0x0f82('0x7'));var config=require(_0x0f82('0x8'));var controller=require(_0x0f82('0x9'));router['get']('/',auth[_0x0f82('0xa')](),controller[_0x0f82('0xb')]);router[_0x0f82('0xc')](_0x0f82('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x0f82('0xc')]('/:id',auth[_0x0f82('0xa')](),controller[_0x0f82('0xe')]);router['get'](_0x0f82('0xf'),auth[_0x0f82('0xa')](),controller[_0x0f82('0x10')]);router['post']('/',auth[_0x0f82('0xa')](),controller[_0x0f82('0x11')]);router[_0x0f82('0x12')]('/:id/contacts',auth[_0x0f82('0xa')](),controller[_0x0f82('0x13')]);router['put'](_0x0f82('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x0f82('0x15')](_0x0f82('0x14'),auth[_0x0f82('0xa')](),controller[_0x0f82('0x16')]);module['exports']=router; \ No newline at end of file +var _0x8c7a=['/:id','show','/:id/contacts','getContacts','post','create','addContacts','update','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8c7a,0x197));var _0xa8c7=function(_0x58946f,_0x2ef6b3){_0x58946f=_0x58946f-0x0;var _0x641917=_0x8c7a[_0x58946f];return _0x641917;};'use strict';var multer=require(_0xa8c7('0x0'));var util=require(_0xa8c7('0x1'));var path=require(_0xa8c7('0x2'));var timeout=require(_0xa8c7('0x3'));var express=require(_0xa8c7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa8c7('0x5'));var config=require(_0xa8c7('0x6'));var controller=require(_0xa8c7('0x7'));router[_0xa8c7('0x8')]('/',auth['isAuthenticated'](),controller[_0xa8c7('0x9')]);router[_0xa8c7('0x8')](_0xa8c7('0xa'),auth[_0xa8c7('0xb')](),controller[_0xa8c7('0xc')]);router['get'](_0xa8c7('0xd'),auth[_0xa8c7('0xb')](),controller[_0xa8c7('0xe')]);router[_0xa8c7('0x8')](_0xa8c7('0xf'),auth[_0xa8c7('0xb')](),controller[_0xa8c7('0x10')]);router[_0xa8c7('0x11')]('/',auth[_0xa8c7('0xb')](),controller[_0xa8c7('0x12')]);router[_0xa8c7('0x11')](_0xa8c7('0xf'),auth['isAuthenticated'](),controller[_0xa8c7('0x13')]);router['put'](_0xa8c7('0xd'),auth['isAuthenticated'](),controller[_0xa8c7('0x14')]);router['delete'](_0xa8c7('0xd'),auth['isAuthenticated'](),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 dde9600..95d7c8c 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 _0x2032=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x2032,0xd9));var _0x2203=function(_0x49c099,_0x3e6dde){_0x49c099=_0x49c099-0x0;var _0x5ab6cb=_0x2032[_0x49c099];return _0x5ab6cb;};'use strict';var _=require('lodash');var Sequelize=require(_0x2203('0x0'));module[_0x2203('0x1')]={'firstName':{'type':Sequelize[_0x2203('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2203('0x2')]},'postalCode':{'type':Sequelize[_0x2203('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2203('0x2')]},'dateOfBirth':{'type':Sequelize[_0x2203('0x2')]},'description':{'type':Sequelize[_0x2203('0x3')]},'phone':{'type':Sequelize[_0x2203('0x2')]},'mobile':{'type':Sequelize[_0x2203('0x2')]},'fax':{'type':Sequelize[_0x2203('0x2')]},'email':{'type':Sequelize[_0x2203('0x2')]},'url':{'type':Sequelize[_0x2203('0x2')]},'facebook':{'type':Sequelize[_0x2203('0x2')]},'fb_data':{'type':Sequelize[_0x2203('0x2')]},'twitter':{'type':Sequelize[_0x2203('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x2203('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x2203('0x2')]},'telegram':{'type':Sequelize[_0x2203('0x2')]},'UserId':{'type':Sequelize[_0x2203('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2203('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x2203('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x2203('0x4')]}}; \ No newline at end of file +var _0xbaf0=['DATE','NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x2083a4,_0x2abcc4){var _0x46380c=function(_0x1cfd4d){while(--_0x1cfd4d){_0x2083a4['push'](_0x2083a4['shift']());}};_0x46380c(++_0x2abcc4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var Sequelize=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'firstName':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0baf('0x2')]},'street':{'type':Sequelize[_0x0baf('0x2')]},'postalCode':{'type':Sequelize[_0x0baf('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0baf('0x2')]},'dateOfBirth':{'type':Sequelize[_0x0baf('0x2')]},'description':{'type':Sequelize[_0x0baf('0x3')]},'phone':{'type':Sequelize[_0x0baf('0x2')]},'mobile':{'type':Sequelize[_0x0baf('0x2')]},'fax':{'type':Sequelize[_0x0baf('0x2')]},'email':{'type':Sequelize[_0x0baf('0x2')]},'url':{'type':Sequelize[_0x0baf('0x2')]},'facebook':{'type':Sequelize[_0x0baf('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0baf('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x0baf('0x2')]},'viber':{'type':Sequelize[_0x0baf('0x2')]},'line':{'type':Sequelize[_0x0baf('0x2')]},'wechat':{'type':Sequelize[_0x0baf('0x2')]},'telegram':{'type':Sequelize[_0x0baf('0x2')]},'UserId':{'type':Sequelize[_0x0baf('0x4')]},'priority':{'type':Sequelize[_0x0baf('0x4')](0x2)[_0x0baf('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0baf('0x6')],'defaultValue':Sequelize[_0x0baf('0x7')]},'dialTimezone':{'type':Sequelize[_0x0baf('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index b3fdf49..28139ae 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 _0x3da3=['cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','DATE','buildExpression','text','filter','isNil','Contact','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','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?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','user','role','some','User','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','agent','toString','sequelize','keyBy','merge','c.firstName','c.phone','c.mobile','c.fax','c.ListId','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','findAll','alias','custom','body','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','dialTimezone','timezones','utcOffset','duplicates','findOrCreate','spread','show','get','$and','omit','format','cf_%d','pickBy','setFields','id\x20=\x20?','phone','getTags','options','nolimit','setTags','getHoppers','pick','ContactId','includeAll','include','getHopperHistories','rawAttributes','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','import','No\x20ListId\x20specified','binding','No\x20phone\x20column\x20specified','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','Website','closed','secondDisposition','thirdDisposition','Account','key','Owner','browserName','customerIp','customerPort','osName','ratingMessage','ratingType','referer','subject','substatus','externalUrl','threadId','flatten','sortBy','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','defaults','./cmContact.socket','register','status','json','undefined','limit','offset','count','set','Content-Range','update','then','destroy','end','sendStatus','stack','name','send','index','CmContact','describe','keys','startsWith','push','CmCustomField','findOne','trimStart','cf_','all','length','fieldType','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','from','tools_tags','select'];(function(_0x5216e0,_0x4f8cb9){var _0x5b3f40=function(_0x30c832){while(--_0x30c832){_0x5216e0['push'](_0x5216e0['shift']());}};_0x5b3f40(++_0x4f8cb9);}(_0x3da3,0xe2));var _0x33da=function(_0x572bd8,_0x232739){_0x572bd8=_0x572bd8-0x0;var _0x4c2aca=_0x3da3[_0x572bd8];return _0x4c2aca;};'use strict';var moment=require(_0x33da('0x0'));var BPromise=require(_0x33da('0x1'));var util=require(_0x33da('0x2'));var path=require(_0x33da('0x3'));var fs=require('fs');var _=require(_0x33da('0x4'));var squel=require(_0x33da('0x5'));var Papa=require(_0x33da('0x6'));var Redis=require(_0x33da('0x7'));var qs=require(_0x33da('0x8'));var as=require(_0x33da('0x9'));var logger=require(_0x33da('0xa'))(_0x33da('0xb'));var config=require('../../config/environment');var shared=require(_0x33da('0xc'));var db=require(_0x33da('0xd'))['db'];config[_0x33da('0xe')]=_[_0x33da('0xf')](config[_0x33da('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33da('0xe')]));require(_0x33da('0x10'))[_0x33da('0x11')](socket);function respondWithResult(_0x2ec2c7,_0x3e0f6d){_0x3e0f6d=_0x3e0f6d||0xc8;return function(_0x15f9dd){if(_0x15f9dd){return _0x2ec2c7[_0x33da('0x12')](_0x3e0f6d)[_0x33da('0x13')](_0x15f9dd);}};}function respondWithFilteredResult(_0xeddf17,_0x4ff5dd){return function(_0x165687){if(_0x165687){var _0x4a0d9d=typeof _0x4ff5dd['offset']===_0x33da('0x14')&&typeof _0x4ff5dd[_0x33da('0x15')]===_0x33da('0x14');var _0x19741d=_0x165687['count'];var _0x24b722=_0x4a0d9d?0x0:_0x4ff5dd[_0x33da('0x16')];var _0x2e405d=_0x4a0d9d?_0x165687[_0x33da('0x17')]:_0x4ff5dd[_0x33da('0x16')]+_0x4ff5dd[_0x33da('0x15')];var _0xa4a093;if(_0x2e405d>=_0x19741d){_0x2e405d=_0x19741d;_0xa4a093=0xc8;}else{_0xa4a093=0xce;}_0xeddf17[_0x33da('0x12')](_0xa4a093);return _0xeddf17[_0x33da('0x18')](_0x33da('0x19'),_0x24b722+'-'+_0x2e405d+'/'+_0x19741d)[_0x33da('0x13')](_0x165687);}return null;};}function saveUpdates(_0x1eb739){return function(_0x168d01){if(_0x168d01){return _0x168d01[_0x33da('0x1a')](_0x1eb739)[_0x33da('0x1b')](function(_0x29131b){return _0x29131b;});}return null;};}function removeEntity(_0x20dec6){return function(_0x3e4609){if(_0x3e4609){return _0x3e4609[_0x33da('0x1c')]()[_0x33da('0x1b')](function(){_0x20dec6['status'](0xcc)[_0x33da('0x1d')]();});}};}function handleEntityNotFound(_0x2dc585){return function(_0x41350c){if(!_0x41350c){_0x2dc585[_0x33da('0x1e')](0x194);}return _0x41350c;};}function handleError(_0xf4add0,_0x525335){_0x525335=_0x525335||0x1f4;return function(_0x1aa252){logger['error'](_0x1aa252[_0x33da('0x1f')]);if(_0x1aa252[_0x33da('0x20')]){delete _0x1aa252['name'];}_0xf4add0['status'](_0x525335)[_0x33da('0x21')](_0x1aa252);};}exports[_0x33da('0x22')]=function(_0x1786c2,_0x5682a7){var _0x5a94d2={},_0x35b15a={},_0x340a46={'count':0x0,'rows':[]};return db[_0x33da('0x23')][_0x33da('0x24')]()[_0x33da('0x1b')](function(_0x1b53f8){var _0x42ac02=[];for(var _0x4a483f=0x0;_0x4a483f0x1){_0x7cfa4a['or'](_0x33da('0x63'),qs[_0x33da('0x64')](_0x36d075),null);}else{if(qs[_0x33da('0x65')](_0x36d075)){_0x7cfa4a['or'](_0x33da('0x66'),_0x36d075+'%');_0x7cfa4a['or'](_0x33da('0x67'),_0x36d075+'%');_0x7cfa4a['or'](_0x33da('0x68'),_0x36d075+'%');_0x7cfa4a['or'](_0x33da('0x69'),_0x36d075+'%');}else if(qs[_0x33da('0x6a')](_0x36d075)){_0x7cfa4a['or']('c.email\x20LIKE\x20?',_0x36d075+'%');}else{_0x7cfa4a['or'](_0x33da('0x6b'),'%'+_0x36d075+'%');_0x7cfa4a['or'](_0x33da('0x6c'),'%'+_0x36d075+'%');_0x7cfa4a['or'](_0x33da('0x6d'),'%'+_0x36d075+'%');}}}}_0x4f27c1[_0x33da('0x39')](_0x7cfa4a);_0x4f27c1[_0x33da('0x6e')](_0x33da('0x6f'));var _0x4acb02={'type':db['Sequelize'][_0x33da('0x70')][_0x33da('0x71')],'raw':!![]};var _0x31f5de=_0x4f27c1[_0x33da('0x72')]()[_0x33da('0x3a')](_0x33da('0x6f'));if(_0x5a94d2[_0x33da('0x37')]){_0x5a94d2[_0x33da('0x37')][_0x33da('0x51')](function(_0x510c49){_0x4f27c1['order']('c.'+_0x510c49[0x0],_0x510c49[0x1]===_0x33da('0x73')?![]:!![]);});}if(!_[_0x33da('0x5c')](_0x50f7c3)){_0x4f27c1['having'](_0x447eaa);_0x31f5de[_0x33da('0x39')](_0x33da('0x74'),_0x50f7c3);}BPromise[_0x33da('0x75')]()[_0x33da('0x1b')](function(){if(!_0xb46d55)return;if(_0x1786c2[_0x33da('0x76')][_0x33da('0x77')]!=='agent')return;if(!_[_0x33da('0x78')](_0xb46d55[_0x33da('0x4b')],['field',_0x33da('0x79')])){return _0x1786c2[_0x33da('0x76')][_0x33da('0x7a')]({'attributes':['id'],'raw':!![]})[_0x33da('0x1b')](function(_0xc867f){if(_[_0x33da('0x5c')](_0xc867f)){_0x31f5de[_0x33da('0x39')]('c.ListId\x20IS\x20NULL');_0x4f27c1[_0x33da('0x39')](_0x33da('0x7b'));}else{_0x31f5de[_0x33da('0x39')](_0x33da('0x7c'),_[_0x33da('0x50')](_0xc867f,'id'));_0x4f27c1[_0x33da('0x39')]('c.ListId\x20IN\x20?',_[_0x33da('0x50')](_0xc867f,'id'));}});}})['then'](function(){if(_0x1786c2['user'][_0x33da('0x77')]===_0x33da('0x7d')&&!_0xb46d55&&!_0x1786c2[_0x33da('0x31')][_0x33da('0x5d')])return[];return db['sequelize']['query'](_0x31f5de[_0x33da('0x7e')](),_0x4acb02);})[_0x33da('0x1b')](function(_0x275c6c){_0x340a46[_0x33da('0x17')]=_0x275c6c[_0x33da('0x2d')];if(_0x340a46[_0x33da('0x17')]===0x0)return[];return db[_0x33da('0x7f')][_0x33da('0x31')](_0x3dbcc5['toString'](),_0x4acb02)[_0x33da('0x1b')](function(_0x45abb8){_0x366303=_[_0x33da('0x80')](_0x45abb8,'id');_0x4acb02=_[_0x33da('0x81')](_0x4acb02,{'model':db[_0x33da('0x23')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1786c2['query'][_0x33da('0x34')]){_0x5a94d2[_0x33da('0x35')]['forEach'](function(_0x2ca2c8){_0x4f27c1['field']('c.'+_0x2ca2c8);});}else{_0x4f27c1[_0x33da('0x3a')](_0x33da('0x6f'));_0x4f27c1['field'](_0x33da('0x82'));_0x4f27c1[_0x33da('0x3a')]('c.lastName');_0x4f27c1[_0x33da('0x3a')](_0x33da('0x83'));_0x4f27c1[_0x33da('0x3a')](_0x33da('0x84'));_0x4f27c1['field'](_0x33da('0x85'));_0x4f27c1[_0x33da('0x3a')]('c.email');_0x4f27c1[_0x33da('0x3a')](_0x33da('0x86'));_0x4f27c1['field'](_0x33da('0x87'));_0x4f27c1[_0x33da('0x3a')]('c.deletedAt');_0x4f27c1['field'](_0x33da('0x88'));_0x4f27c1['field'](_0x33da('0x89'),'TagIds');}if(_0x5a94d2[_0x33da('0x15')])_0x4f27c1[_0x33da('0x15')](_0x5a94d2[_0x33da('0x15')]);if(_0x5a94d2[_0x33da('0x16')])_0x4f27c1[_0x33da('0x16')](_0x5a94d2['offset']);return db['sequelize'][_0x33da('0x31')](_0x4f27c1[_0x33da('0x7e')](),_0x4acb02);});})[_0x33da('0x1b')](function(_0x12dff0){_0x12dff0[_0x33da('0x51')](function(_0x4ad5c3){if(_0x4ad5c3[_0x33da('0x8a')]){_0x4ad5c3[_0x33da('0x8b')]=[];_0x4ad5c3['TagIds'][_0x33da('0x4f')](',')[_0x33da('0x51')](function(_0x7b23b9){_0x4ad5c3['Tags']['push'](_0x366303[_0x7b23b9]);});}delete _0x4ad5c3[_0x33da('0x8a')];});_0x340a46[_0x33da('0x8c')]=_0x12dff0;return _0x340a46;})['then'](respondWithFilteredResult(_0x5682a7,_0x5a94d2));})[_0x33da('0x8d')](handleError(_0x5682a7,null));};exports[_0x33da('0x1c')]=function(_0x3e4c29,_0x238c58){return db[_0x33da('0x23')]['find']({'where':{'id':_0x3e4c29[_0x33da('0x8e')]['id']}})[_0x33da('0x1b')](handleEntityNotFound(_0x238c58,null))['then'](removeEntity(_0x238c58,null))['catch'](handleError(_0x238c58,null));};exports[_0x33da('0x24')]=function(_0x1bb992,_0x5ab93f){return db[_0x33da('0x23')]['describe']()['then'](function(_0x3c786f){delete _0x3c786f[_0x33da('0x8f')];for(var _0x528a97=0x0;_0x528a97=_0x51fc61){_0x992ee=_0x51fc61;_0x18a4c9=0xc8;}else{_0x18a4c9=0xce;}_0xce8b8c[_0xaf26('0x11')](_0x18a4c9);return _0xce8b8c['set'](_0xaf26('0x17'),_0x21ca5f+'-'+_0x992ee+'/'+_0x51fc61)[_0xaf26('0x12')](_0x14f7a0);}return null;};}function saveUpdates(_0x1bcb98){return function(_0x4bbce4){if(_0x4bbce4){return _0x4bbce4[_0xaf26('0x18')](_0x1bcb98)[_0xaf26('0x19')](function(_0x404c58){return _0x404c58;});}return null;};}function removeEntity(_0x12c097){return function(_0x4dae95){if(_0x4dae95){return _0x4dae95[_0xaf26('0x1a')]()['then'](function(){_0x12c097[_0xaf26('0x11')](0xcc)[_0xaf26('0x1b')]();});}};}function handleEntityNotFound(_0x41cf54){return function(_0x37d8ca){if(!_0x37d8ca){_0x41cf54[_0xaf26('0x1c')](0x194);}return _0x37d8ca;};}function handleError(_0x4325c6,_0x3fb9a0){_0x3fb9a0=_0x3fb9a0||0x1f4;return function(_0x4a7c2d){logger['error'](_0x4a7c2d[_0xaf26('0x1d')]);if(_0x4a7c2d['name']){delete _0x4a7c2d['name'];}_0x4325c6[_0xaf26('0x11')](_0x3fb9a0)[_0xaf26('0x1e')](_0x4a7c2d);};}exports[_0xaf26('0x1f')]=function(_0x97a434,_0x1fbc82){var _0x3bfa01={},_0x11eb8d={},_0x40fcd3={'count':0x0,'rows':[]};return db['CmContact'][_0xaf26('0x20')]()[_0xaf26('0x19')](function(_0x57c8e0){var _0x12a260=[];for(var _0x562ff0=0x0;_0x562ff00x1){_0x2eee4a['or'](_0xaf26('0x61'),qs['getFullTextValue'](_0x3fcfe3),null);}else{if(qs[_0xaf26('0x62')](_0x3fcfe3)){_0x2eee4a['or'](_0xaf26('0x63'),_0x3fcfe3+'%');_0x2eee4a['or'](_0xaf26('0x64'),_0x3fcfe3+'%');_0x2eee4a['or']('c.mobile\x20LIKE\x20?',_0x3fcfe3+'%');_0x2eee4a['or']('c.fax\x20LIKE\x20?',_0x3fcfe3+'%');}else if(qs['isEmail'](_0x3fcfe3)){_0x2eee4a['or']('c.email\x20LIKE\x20?',_0x3fcfe3+'%');}else{_0x2eee4a['or'](_0xaf26('0x65'),'%'+_0x3fcfe3+'%');_0x2eee4a['or'](_0xaf26('0x66'),'%'+_0x3fcfe3+'%');_0x2eee4a['or'](_0xaf26('0x67'),'%'+_0x3fcfe3+'%');}}}}_0x5b3c27[_0xaf26('0x35')](_0x2eee4a);_0x5b3c27[_0xaf26('0x68')]('c.id');var _0x402aee={'type':db[_0xaf26('0x69')][_0xaf26('0x6a')][_0xaf26('0x6b')],'raw':!![]};var _0x135200=_0x5b3c27['clone']()['field'](_0xaf26('0x6c'));if(_0x3bfa01[_0xaf26('0x33')]){_0x3bfa01['order'][_0xaf26('0x4c')](function(_0x165af9){_0x5b3c27['order']('c.'+_0x165af9[0x0],_0x165af9[0x1]==='DESC'?![]:!![]);});}if(!_[_0xaf26('0x58')](_0xce4b03)){_0x5b3c27[_0xaf26('0x6d')](_0x70ee1a);_0x135200[_0xaf26('0x35')](_0xaf26('0x6e'),_0xce4b03);}BPromise['resolve']()[_0xaf26('0x19')](function(){if(!_0x1854c8)return;if(_0x97a434[_0xaf26('0x6f')][_0xaf26('0x70')]!=='agent')return;if(!_['some'](_0x1854c8[_0xaf26('0x46')],['field','User'])){return _0x97a434[_0xaf26('0x6f')][_0xaf26('0x71')]({'attributes':['id'],'raw':!![]})[_0xaf26('0x19')](function(_0xaf63b1){if(_[_0xaf26('0x58')](_0xaf63b1)){_0x135200[_0xaf26('0x35')](_0xaf26('0x72'));_0x5b3c27[_0xaf26('0x35')](_0xaf26('0x72'));}else{_0x135200[_0xaf26('0x35')](_0xaf26('0x5a'),_[_0xaf26('0x4b')](_0xaf63b1,'id'));_0x5b3c27[_0xaf26('0x35')](_0xaf26('0x5a'),_[_0xaf26('0x4b')](_0xaf63b1,'id'));}});}})[_0xaf26('0x19')](function(){if(_0x97a434[_0xaf26('0x6f')][_0xaf26('0x70')]===_0xaf26('0x73')&&!_0x1854c8&&!_0x97a434['query'][_0xaf26('0x59')])return[];return db['sequelize'][_0xaf26('0x2d')](_0x135200[_0xaf26('0x74')](),_0x402aee);})['then'](function(_0x120adb){_0x40fcd3['count']=_0x120adb[_0xaf26('0x21')];if(_0x40fcd3[_0xaf26('0x16')]===0x0)return[];return db[_0xaf26('0x75')]['query'](_0x5a9cc2['toString'](),_0x402aee)[_0xaf26('0x19')](function(_0x3a61dd){_0x485b0d=_[_0xaf26('0x76')](_0x3a61dd,'id');_0x402aee=_[_0xaf26('0x77')](_0x402aee,{'model':db[_0xaf26('0x78')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x97a434[_0xaf26('0x2d')]['fields']){_0x3bfa01[_0xaf26('0x30')][_0xaf26('0x4c')](function(_0xf4f3bf){_0x5b3c27['field']('c.'+_0xf4f3bf);});}else{_0x5b3c27['field'](_0xaf26('0x6c'));_0x5b3c27[_0xaf26('0x37')](_0xaf26('0x79'));_0x5b3c27[_0xaf26('0x37')](_0xaf26('0x7a'));_0x5b3c27[_0xaf26('0x37')]('c.phone');_0x5b3c27[_0xaf26('0x37')](_0xaf26('0x7b'));_0x5b3c27['field'](_0xaf26('0x7c'));_0x5b3c27[_0xaf26('0x37')](_0xaf26('0x7d'));_0x5b3c27[_0xaf26('0x37')](_0xaf26('0x7e'));_0x5b3c27[_0xaf26('0x37')](_0xaf26('0x7f'));_0x5b3c27[_0xaf26('0x37')](_0xaf26('0x80'));_0x5b3c27['field']('c.CompanyId');_0x5b3c27[_0xaf26('0x37')](_0xaf26('0x81'),_0xaf26('0x82'));}if(_0x3bfa01[_0xaf26('0x15')])_0x5b3c27[_0xaf26('0x15')](_0x3bfa01[_0xaf26('0x15')]);if(_0x3bfa01['offset'])_0x5b3c27['offset'](_0x3bfa01['offset']);return db[_0xaf26('0x75')][_0xaf26('0x2d')](_0x5b3c27[_0xaf26('0x74')](),_0x402aee);});})['then'](function(_0x5118c1){_0x5118c1[_0xaf26('0x4c')](function(_0x43aa9d){if(_0x43aa9d['TagIds']){_0x43aa9d[_0xaf26('0x83')]=[];_0x43aa9d[_0xaf26('0x82')]['split'](',')[_0xaf26('0x4c')](function(_0x5e7a57){_0x43aa9d[_0xaf26('0x83')][_0xaf26('0x25')](_0x485b0d[_0x5e7a57]);});}delete _0x43aa9d[_0xaf26('0x82')];});_0x40fcd3[_0xaf26('0x84')]=_0x5118c1;return _0x40fcd3;})[_0xaf26('0x19')](respondWithFilteredResult(_0x1fbc82,_0x3bfa01));})['catch'](handleError(_0x1fbc82,null));};exports[_0xaf26('0x1a')]=function(_0x49470f,_0x4f7c8e){return db['CmContact']['find']({'where':{'id':_0x49470f[_0xaf26('0x85')]['id']}})[_0xaf26('0x19')](handleEntityNotFound(_0x4f7c8e,null))[_0xaf26('0x19')](removeEntity(_0x4f7c8e,null))['catch'](handleError(_0x4f7c8e,null));};exports[_0xaf26('0x20')]=function(_0x5b301a,_0x450413){return db[_0xaf26('0x78')][_0xaf26('0x20')]()['then'](function(_0x482570){delete _0x482570[_0xaf26('0x86')];for(var _0x5b2520=0x0;_0x5b2520{}\s\\|]/g,'-');_0x58edff(null,util['format'](_0x4e96('0x24'),path['basename'](_0x424fe0[_0x4e96('0x22')],path['extname'](_0x424fe0[_0x4e96('0x22')])),Date[_0x4e96('0x25')](),path[_0x4e96('0x26')](_0x424fe0['originalname'])));}})});router['post'](_0x4e96('0x27'),upload[_0x4e96('0x28')](_0x4e96('0x29')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x4e96('0x1f')]({'destination':function(_0xc5dfc6,_0x2c6fa4,_0x3d5fad){_0x3d5fad(null,path[_0x4e96('0x20')](config['root'],_0x4e96('0x21')));},'filename':function(_0x4a4f8e,_0x387025,_0x176a83){_0x387025[_0x4e96('0x22')]=_0x387025[_0x4e96('0x22')][_0x4e96('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x176a83(null,util[_0x4e96('0x2a')](_0x4e96('0x24'),path[_0x4e96('0x2b')](_0x387025[_0x4e96('0x22')],path['extname'](_0x387025['originalname'])),Date[_0x4e96('0x25')](),path[_0x4e96('0x26')](_0x387025['originalname'])));}})});router[_0x4e96('0x18')](_0x4e96('0x2c'),upload[_0x4e96('0x28')]('file'),controller[_0x4e96('0x2d')]);router[_0x4e96('0x18')]('/upload/:id',auth[_0x4e96('0x9')](),controller[_0x4e96('0x2e')]);router[_0x4e96('0x2f')](_0x4e96('0xd'),auth[_0x4e96('0x9')](),controller[_0x4e96('0x30')]);router[_0x4e96('0x31')]('/:id',auth[_0x4e96('0x9')](),controller[_0x4e96('0x32')]);module[_0x4e96('0x33')]=router; \ No newline at end of file +var _0x9613=['/describe','describe','/:id','isAuthenticated','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','create','bulkCreate','/:id/tags','setTags','diskStorage','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','uploadCsv','join','root','/upload','upload','import','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContact.controller','index','get'];(function(_0x358571,_0x2e7106){var _0x40460f=function(_0x2ec04c){while(--_0x2ec04c){_0x358571['push'](_0x358571['shift']());}};_0x40460f(++_0x2e7106);}(_0x9613,0x1c9));var _0x3961=function(_0x4b1125,_0x204344){_0x4b1125=_0x4b1125-0x0;var _0x68a3de=_0x9613[_0x4b1125];return _0x68a3de;};'use strict';var multer=require(_0x3961('0x0'));var util=require(_0x3961('0x1'));var path=require(_0x3961('0x2'));var timeout=require(_0x3961('0x3'));var express=require('express');var router=express[_0x3961('0x4')]();var fs_extra=require(_0x3961('0x5'));var auth=require(_0x3961('0x6'));var interaction=require(_0x3961('0x7'));var config=require('../../config/environment');var controller=require(_0x3961('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3961('0x9')]);router[_0x3961('0xa')](_0x3961('0xb'),auth['isAuthenticated'](),controller[_0x3961('0xc')]);router['get'](_0x3961('0xd'),auth[_0x3961('0xe')](),controller[_0x3961('0xf')]);router[_0x3961('0xa')]('/:id/tags',auth[_0x3961('0xe')](),controller[_0x3961('0x10')]);router['get'](_0x3961('0x11'),auth[_0x3961('0xe')](),controller[_0x3961('0x12')]);router[_0x3961('0xa')](_0x3961('0x13'),auth[_0x3961('0xe')](),controller[_0x3961('0x14')]);router[_0x3961('0xa')]('/:id/hopper_finals',auth[_0x3961('0xe')](),controller['getHopperFinals']);router['get'](_0x3961('0x15'),auth['isAuthenticated'](),controller[_0x3961('0x16')]);router[_0x3961('0xa')](_0x3961('0x17'),auth[_0x3961('0xe')](),controller[_0x3961('0x18')]);router[_0x3961('0x19')](_0x3961('0x1a'),auth[_0x3961('0xe')](),controller[_0x3961('0x1b')]);router[_0x3961('0x19')]('/',auth[_0x3961('0xe')](),controller[_0x3961('0x1c')]);router[_0x3961('0x19')]('/create_many',auth[_0x3961('0xe')](),controller[_0x3961('0x1d')]);router['post'](_0x3961('0x1e'),auth[_0x3961('0xe')](),controller[_0x3961('0x1f')]);var upload=multer({'storage':multer[_0x3961('0x20')]({'destination':function(_0x292ebe,_0x26e63d,_0x10ca29){_0x10ca29(null,path['join'](config['root'],'server/files/tmp'));},'filename':function(_0x59e022,_0x2744fd,_0x1b9219){_0x2744fd[_0x3961('0x21')]=_0x2744fd[_0x3961('0x21')][_0x3961('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1b9219(null,util[_0x3961('0x23')](_0x3961('0x24'),path[_0x3961('0x25')](_0x2744fd[_0x3961('0x21')],path[_0x3961('0x26')](_0x2744fd['originalname'])),Date[_0x3961('0x27')](),path[_0x3961('0x26')](_0x2744fd[_0x3961('0x21')])));}})});router[_0x3961('0x19')]('/csv',upload[_0x3961('0x28')](_0x3961('0x29')),controller[_0x3961('0x2a')]);var upload=multer({'storage':multer[_0x3961('0x20')]({'destination':function(_0x3d63fc,_0x3aaf90,_0x49b262){_0x49b262(null,path[_0x3961('0x2b')](config[_0x3961('0x2c')],'server/files/tmp'));},'filename':function(_0xb3da14,_0x56499f,_0x2979d6){_0x56499f['originalname']=_0x56499f['originalname'][_0x3961('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2979d6(null,util[_0x3961('0x23')](_0x3961('0x24'),path['basename'](_0x56499f['originalname'],path[_0x3961('0x26')](_0x56499f[_0x3961('0x21')])),Date['now'](),path[_0x3961('0x26')](_0x56499f['originalname'])));}})});router[_0x3961('0x19')](_0x3961('0x2d'),upload[_0x3961('0x28')]('file'),controller[_0x3961('0x2e')]);router['post']('/upload/:id',auth['isAuthenticated'](),controller[_0x3961('0x2f')]);router[_0x3961('0x30')](_0x3961('0xd'),auth[_0x3961('0xe')](),controller[_0x3961('0x31')]);router[_0x3961('0x32')](_0x3961('0xd'),auth[_0x3961('0xe')](),controller['destroy']);module[_0x3961('0x33')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 56433af..c6b84ef 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 _0x0264=['lodash','exports','VIRTUAL','alias','getDataValue','STRING','TEXT','long','type','select','parse','values','setDataValue','stringify','BOOLEAN','voice','sequelize'];(function(_0x413c3c,_0x485627){var _0x489543=function(_0x2542df){while(--_0x2542df){_0x413c3c['push'](_0x413c3c['shift']());}};_0x489543(++_0x485627);}(_0x0264,0x131));var _0x4026=function(_0x52c81c,_0x1193a0){_0x52c81c=_0x52c81c-0x0;var _0x933222=_0x0264[_0x52c81c];return _0x933222;};'use strict';var Sequelize=require(_0x4026('0x0'));var _=require(_0x4026('0x1'));module[_0x4026('0x2')]={'name':{'type':Sequelize[_0x4026('0x3')],'get':function(_0xcf8a0b){return this['getDataValue'](_0x4026('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x5b6633){this['setDataValue'](_0x4026('0x4'),_0x5b6633?_0x5b6633:this[_0x4026('0x5')]('name'));}},'type':{'type':Sequelize[_0x4026('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x4026('0x7')](_0x4026('0x8')),'get':function(){if(this[_0x4026('0x5')](_0x4026('0x9'))===_0x4026('0xa')){return JSON[_0x4026('0xb')](this[_0x4026('0x5')](_0x4026('0xc')));}else{return this['getDataValue']('values');}},'set':function(_0x51e1c5){if(Array['isArray'](_0x51e1c5)){this[_0x4026('0xd')](_0x4026('0xc'),JSON[_0x4026('0xe')](_0x51e1c5));}else{this[_0x4026('0xd')](_0x4026('0xc'),_0x51e1c5);}}},'required':{'type':Sequelize[_0x4026('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x4026('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x4026('0x10'))}}; \ No newline at end of file +var _0xa898=['setDataValue','BOOLEAN','ENUM','voice','sequelize','lodash','VIRTUAL','getDataValue','alias','STRING','name','TEXT','long','type','select','parse','values','isArray'];(function(_0xd7963f,_0x4b4480){var _0x301f61=function(_0x27d943){while(--_0x27d943){_0xd7963f['push'](_0xd7963f['shift']());}};_0x301f61(++_0x4b4480);}(_0xa898,0x1d8));var _0x8a89=function(_0x14720b,_0x2d8966){_0x14720b=_0x14720b-0x0;var _0x230d8e=_0xa898[_0x14720b];return _0x230d8e;};'use strict';var Sequelize=require(_0x8a89('0x0'));var _=require(_0x8a89('0x1'));module['exports']={'name':{'type':Sequelize[_0x8a89('0x2')],'get':function(_0x1c9fc9){return this[_0x8a89('0x3')](_0x8a89('0x4'));}},'alias':{'type':Sequelize[_0x8a89('0x5')],'allowNull':![],'set':function(_0x3cf704){this['setDataValue'](_0x8a89('0x4'),_0x3cf704?_0x3cf704:this['getDataValue'](_0x8a89('0x6')));}},'type':{'type':Sequelize[_0x8a89('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x8a89('0x7')](_0x8a89('0x8')),'get':function(){if(this[_0x8a89('0x3')](_0x8a89('0x9'))===_0x8a89('0xa')){return JSON[_0x8a89('0xb')](this[_0x8a89('0x3')](_0x8a89('0xc')));}else{return this['getDataValue'](_0x8a89('0xc'));}},'set':function(_0x34ab19){if(Array[_0x8a89('0xd')](_0x34ab19)){this[_0x8a89('0xe')](_0x8a89('0xc'),JSON['stringify'](_0x34ab19));}else{this[_0x8a89('0xe')]('values',_0x34ab19);}}},'required':{'type':Sequelize[_0x8a89('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x8a89('0x10')](_0x8a89('0x11'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index a72b8dd..6889371 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 _0x1843=['../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','CmCustomField','findAll','rows','catch','show','params','includeAll','include','find','sequelize','transaction','create','body','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x5090d4,_0x1950a7){var _0x56c310=function(_0x3d3d5c){while(--_0x3d3d5c){_0x5090d4['push'](_0x5090d4['shift']());}};_0x56c310(++_0x1950a7);}(_0x1843,0x9c));var _0x3184=function(_0x324931,_0xd6ae3f){_0x324931=_0x324931-0x0;var _0x2289d1=_0x1843[_0x324931];return _0x2289d1;};'use strict';var emlformat=require(_0x3184('0x0'));var rimraf=require(_0x3184('0x1'));var zipdir=require(_0x3184('0x2'));var jsonpatch=require(_0x3184('0x3'));var rp=require(_0x3184('0x4'));var moment=require('moment');var BPromise=require(_0x3184('0x5'));var Mustache=require(_0x3184('0x6'));var util=require(_0x3184('0x7'));var path=require(_0x3184('0x8'));var sox=require(_0x3184('0x9'));var csv=require('to-csv');var ejs=require(_0x3184('0xa'));var fs=require('fs');var fs_extra=require(_0x3184('0xb'));var _=require(_0x3184('0xc'));var squel=require(_0x3184('0xd'));var crypto=require(_0x3184('0xe'));var jsforce=require(_0x3184('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3184('0x10'));var querystring=require(_0x3184('0x11'));var Papa=require(_0x3184('0x12'));var Redis=require(_0x3184('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3184('0x14'));var as=require(_0x3184('0x15'));var hardwareService=require(_0x3184('0x16'));var logger=require('../../config/logger')(_0x3184('0x17'));var utils=require('../../config/utils');var config=require(_0x3184('0x18'));var licenseUtil=require(_0x3184('0x19'));var db=require(_0x3184('0x1a'))['db'];function respondWithStatusCode(_0x55b0e2,_0x1eb2b4){_0x1eb2b4=_0x1eb2b4||0xcc;return function(_0x268292){if(_0x268292){return _0x55b0e2['sendStatus'](_0x1eb2b4);}return _0x55b0e2[_0x3184('0x1b')](_0x1eb2b4)[_0x3184('0x1c')]();};}function respondWithResult(_0x5c5059,_0xbf5bed){_0xbf5bed=_0xbf5bed||0xc8;return function(_0xa51463){if(_0xa51463){return _0x5c5059[_0x3184('0x1b')](_0xbf5bed)['json'](_0xa51463);}};}function respondWithFilteredResult(_0x21e5d3,_0x401232){return function(_0xf8e34e){if(_0xf8e34e){var _0xce8a33=typeof _0x401232[_0x3184('0x1d')]===_0x3184('0x1e')&&typeof _0x401232[_0x3184('0x1f')]==='undefined';var _0x19272d=_0xf8e34e[_0x3184('0x20')];var _0x3ad371=_0xce8a33?0x0:_0x401232[_0x3184('0x1d')];var _0x5018c7=_0xce8a33?_0xf8e34e[_0x3184('0x20')]:_0x401232[_0x3184('0x1d')]+_0x401232[_0x3184('0x1f')];var _0x3568af;if(_0x5018c7>=_0x19272d){_0x5018c7=_0x19272d;_0x3568af=0xc8;}else{_0x3568af=0xce;}_0x21e5d3[_0x3184('0x1b')](_0x3568af);return _0x21e5d3['set'](_0x3184('0x21'),_0x3ad371+'-'+_0x5018c7+'/'+_0x19272d)[_0x3184('0x22')](_0xf8e34e);}return null;};}function patchUpdates(_0x141516){return function(_0x1cfafa){try{jsonpatch['apply'](_0x1cfafa,_0x141516,!![]);}catch(_0x19b8ee){return BPromise['reject'](_0x19b8ee);}return _0x1cfafa[_0x3184('0x23')]();};}function saveUpdates(_0x731d25,_0x36a770){return function(_0x52302c){if(_0x52302c){return _0x52302c[_0x3184('0x24')](_0x731d25)[_0x3184('0x25')](function(_0x5e3070){return _0x5e3070;});}return null;};}function removeEntity(_0x2ece9e,_0x3751be){return function(_0x144f92){if(_0x144f92){return _0x144f92[_0x3184('0x26')]()[_0x3184('0x25')](function(){_0x2ece9e[_0x3184('0x1b')](0xcc)[_0x3184('0x1c')]();});}};}function handleEntityNotFound(_0xc59b15,_0x3fbb27){return function(_0x1a511e){if(!_0x1a511e){_0xc59b15['sendStatus'](0x194);}return _0x1a511e;};}function handleError(_0x306145,_0x13b4bf){_0x13b4bf=_0x13b4bf||0x1f4;return function(_0x5e0950){logger[_0x3184('0x27')](_0x5e0950[_0x3184('0x28')]);if(_0x5e0950[_0x3184('0x29')]){delete _0x5e0950[_0x3184('0x29')];}_0x306145[_0x3184('0x1b')](_0x13b4bf)[_0x3184('0x2a')](_0x5e0950);};}exports[_0x3184('0x2b')]=function(_0x26b3ca,_0x3d065a){var _0x4f0d62={},_0x2cd8c2={},_0x5dd0ac={'count':0x0,'rows':[]};var _0x24dbd3=_[_0x3184('0x2c')](db['CmCustomField'][_0x3184('0x2d')],function(_0x26d1f0){return{'name':_0x26d1f0[_0x3184('0x2e')],'type':_0x26d1f0[_0x3184('0x2f')][_0x3184('0x30')]};});_0x2cd8c2[_0x3184('0x31')]=_[_0x3184('0x32')](_[_0x3184('0x2c')](_0x24dbd3,'name'),['name']);_0x2cd8c2[_0x3184('0x33')]=_[_0x3184('0x34')](_0x26b3ca[_0x3184('0x33')]);_0x2cd8c2[_0x3184('0x35')]=_[_0x3184('0x36')](_0x2cd8c2[_0x3184('0x31')],_0x2cd8c2[_0x3184('0x33')]);_0x4f0d62[_0x3184('0x37')]=_[_0x3184('0x36')](_0x2cd8c2['model'],qs[_0x3184('0x38')](_0x26b3ca[_0x3184('0x33')][_0x3184('0x38')]));_0x4f0d62[_0x3184('0x37')]=_0x4f0d62[_0x3184('0x37')][_0x3184('0x39')]?_0x4f0d62['attributes']:_0x2cd8c2[_0x3184('0x31')];if(!_0x26b3ca[_0x3184('0x33')][_0x3184('0x3a')](_0x3184('0x3b'))){_0x4f0d62[_0x3184('0x1f')]=qs['limit'](_0x26b3ca['query'][_0x3184('0x1f')]);_0x4f0d62[_0x3184('0x1d')]=qs[_0x3184('0x1d')](_0x26b3ca[_0x3184('0x33')][_0x3184('0x1d')]);}_0x4f0d62['order']=qs[_0x3184('0x3c')](_0x26b3ca[_0x3184('0x33')]['sort']);_0x4f0d62['where']=qs['filters'](_[_0x3184('0x3d')](_0x26b3ca[_0x3184('0x33')],_0x2cd8c2['filters']),_0x24dbd3);if(_0x26b3ca['query'][_0x3184('0x3e')]){_0x4f0d62[_0x3184('0x3f')]=_['merge'](_0x4f0d62[_0x3184('0x3f')],{'$or':_[_0x3184('0x2c')](_0x24dbd3,function(_0x5d3ee6){if(_0x5d3ee6['type']!==_0x3184('0x40')){var _0xde741c={};_0xde741c[_0x5d3ee6[_0x3184('0x29')]]={'$like':'%'+_0x26b3ca['query'][_0x3184('0x3e')]+'%'};return _0xde741c;}})});}_0x4f0d62=_[_0x3184('0x41')]({},_0x4f0d62,_0x26b3ca[_0x3184('0x42')]);var _0x5e3c41={'where':_0x4f0d62[_0x3184('0x3f')]};return db['CmCustomField']['count'](_0x5e3c41)['then'](function(_0x20fb4f){_0x5dd0ac[_0x3184('0x20')]=_0x20fb4f;if(_0x26b3ca[_0x3184('0x33')]['includeAll']){_0x4f0d62['include']=[{'all':!![]}];}return db[_0x3184('0x43')][_0x3184('0x44')](_0x4f0d62);})[_0x3184('0x25')](function(_0x2be54c){_0x5dd0ac[_0x3184('0x45')]=_0x2be54c;return _0x5dd0ac;})[_0x3184('0x25')](respondWithFilteredResult(_0x3d065a,_0x4f0d62))[_0x3184('0x46')](handleError(_0x3d065a,null));};exports[_0x3184('0x47')]=function(_0x8084bd,_0xf6bca0){var _0x1feb2c={'raw':!![],'where':{'id':_0x8084bd[_0x3184('0x48')]['id']}},_0x525ba4={};_0x525ba4[_0x3184('0x31')]=_[_0x3184('0x34')](db[_0x3184('0x43')][_0x3184('0x2d')]);_0x525ba4['query']=_[_0x3184('0x34')](_0x8084bd[_0x3184('0x33')]);_0x525ba4[_0x3184('0x35')]=_['intersection'](_0x525ba4[_0x3184('0x31')],_0x525ba4[_0x3184('0x33')]);_0x1feb2c[_0x3184('0x37')]=_[_0x3184('0x36')](_0x525ba4[_0x3184('0x31')],qs['fields'](_0x8084bd[_0x3184('0x33')]['fields']));_0x1feb2c[_0x3184('0x37')]=_0x1feb2c['attributes'][_0x3184('0x39')]?_0x1feb2c[_0x3184('0x37')]:_0x525ba4['model'];if(_0x8084bd['query'][_0x3184('0x49')]){_0x1feb2c[_0x3184('0x4a')]=[{'all':!![]}];}_0x1feb2c=_['merge']({},_0x1feb2c,_0x8084bd[_0x3184('0x42')]);return db[_0x3184('0x43')][_0x3184('0x4b')](_0x1feb2c)['then'](handleEntityNotFound(_0xf6bca0,null))[_0x3184('0x25')](respondWithResult(_0xf6bca0,null))[_0x3184('0x46')](handleError(_0xf6bca0,null));};exports['update']=function(_0x5798cb,_0x44771d){if(_0x5798cb['body']['id']){delete _0x5798cb['body']['id'];}return db[_0x3184('0x43')]['find']({'where':{'id':_0x5798cb[_0x3184('0x48')]['id']}})['then'](handleEntityNotFound(_0x44771d,null))[_0x3184('0x25')](saveUpdates(_0x5798cb['body'],null))[_0x3184('0x25')](respondWithResult(_0x44771d,null))[_0x3184('0x46')](handleError(_0x44771d,null));};exports[_0x3184('0x26')]=function(_0x440f10,_0x58ba29){return db[_0x3184('0x43')][_0x3184('0x4b')]({'where':{'id':_0x440f10['params']['id']}})[_0x3184('0x25')](handleEntityNotFound(_0x58ba29,null))[_0x3184('0x25')](removeEntity(_0x58ba29,null))['catch'](handleError(_0x58ba29,null));};exports['create']=function(_0x4a7bae,_0x50a467){var _0x153615;return db[_0x3184('0x4c')][_0x3184('0x4d')](function(_0xa207fd){return db[_0x3184('0x43')][_0x3184('0x4e')](_0x4a7bae[_0x3184('0x4f')],{'transaction':_0xa207fd})[_0x3184('0x25')](function(_0x222b66){_0x153615=_0x222b66;var _0x208ced={'type':db[_0x3184('0x50')][_0x3184('0x51')],'transaction':_0xa207fd};switch(_0x4a7bae[_0x3184('0x4f')][_0x3184('0x2f')]){case _0x3184('0x52'):_0x208ced['type']=db[_0x3184('0x50')][_0x3184('0x51')];break;case _0x3184('0x53'):_0x208ced[_0x3184('0x2f')]=db['Sequelize'][_0x3184('0x54')];break;case'switch':_0x208ced[_0x3184('0x2f')]=db[_0x3184('0x50')][_0x3184('0x55')];_0x208ced[_0x3184('0x56')]=![];break;default:}return db[_0x3184('0x4c')]['queryInterface']['addColumn'](_0x3184('0x57'),util[_0x3184('0x58')](_0x3184('0x59'),_0x153615['id']),_0x208ced);})[_0x3184('0x25')](function(){return _0x153615;});})['then'](respondWithResult(_0x50a467,0xc9))[_0x3184('0x46')](handleError(_0x50a467,null));}; \ No newline at end of file +var _0xc821=['Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','save','update','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','keys','query','filters','fields','attributes','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','body','destroy','create','sequelize','transaction'];(function(_0x3cb011,_0x5cdf74){var _0x33e6f4=function(_0x2e79f1){while(--_0x2e79f1){_0x3cb011['push'](_0x3cb011['shift']());}};_0x33e6f4(++_0x5cdf74);}(_0xc821,0x117));var _0x1c82=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc821[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1c82('0x0'));var rimraf=require(_0x1c82('0x1'));var zipdir=require(_0x1c82('0x2'));var jsonpatch=require(_0x1c82('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1c82('0x4'));var Mustache=require(_0x1c82('0x5'));var util=require(_0x1c82('0x6'));var path=require(_0x1c82('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1c82('0x8'));var fs=require('fs');var fs_extra=require(_0x1c82('0x9'));var _=require(_0x1c82('0xa'));var squel=require(_0x1c82('0xb'));var crypto=require(_0x1c82('0xc'));var jsforce=require(_0x1c82('0xd'));var deskjs=require(_0x1c82('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1c82('0xf'));var Papa=require(_0x1c82('0x10'));var Redis=require(_0x1c82('0x11'));var authService=require(_0x1c82('0x12'));var qs=require(_0x1c82('0x13'));var as=require(_0x1c82('0x14'));var hardwareService=require(_0x1c82('0x15'));var logger=require(_0x1c82('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1c82('0x17'));var db=require(_0x1c82('0x18'))['db'];function respondWithStatusCode(_0x3b0d14,_0x8092e5){_0x8092e5=_0x8092e5||0xcc;return function(_0x44024d){if(_0x44024d){return _0x3b0d14[_0x1c82('0x19')](_0x8092e5);}return _0x3b0d14[_0x1c82('0x1a')](_0x8092e5)[_0x1c82('0x1b')]();};}function respondWithResult(_0x40c51a,_0x11eb70){_0x11eb70=_0x11eb70||0xc8;return function(_0x14ef58){if(_0x14ef58){return _0x40c51a[_0x1c82('0x1a')](_0x11eb70)['json'](_0x14ef58);}};}function respondWithFilteredResult(_0x4ad1ca,_0x58d3a7){return function(_0x333dbe){if(_0x333dbe){var _0x54d9ec=typeof _0x58d3a7[_0x1c82('0x1c')]===_0x1c82('0x1d')&&typeof _0x58d3a7[_0x1c82('0x1e')]===_0x1c82('0x1d');var _0x7e09ab=_0x333dbe[_0x1c82('0x1f')];var _0x1347ea=_0x54d9ec?0x0:_0x58d3a7[_0x1c82('0x1c')];var _0x33ddf6=_0x54d9ec?_0x333dbe[_0x1c82('0x1f')]:_0x58d3a7[_0x1c82('0x1c')]+_0x58d3a7[_0x1c82('0x1e')];var _0x3bca8b;if(_0x33ddf6>=_0x7e09ab){_0x33ddf6=_0x7e09ab;_0x3bca8b=0xc8;}else{_0x3bca8b=0xce;}_0x4ad1ca[_0x1c82('0x1a')](_0x3bca8b);return _0x4ad1ca['set'](_0x1c82('0x20'),_0x1347ea+'-'+_0x33ddf6+'/'+_0x7e09ab)[_0x1c82('0x21')](_0x333dbe);}return null;};}function patchUpdates(_0x4177c6){return function(_0x394e8b){try{jsonpatch['apply'](_0x394e8b,_0x4177c6,!![]);}catch(_0x27e732){return BPromise['reject'](_0x27e732);}return _0x394e8b[_0x1c82('0x22')]();};}function saveUpdates(_0x41d681,_0xe3b096){return function(_0x2ec684){if(_0x2ec684){return _0x2ec684[_0x1c82('0x23')](_0x41d681)[_0x1c82('0x24')](function(_0x27a475){return _0x27a475;});}return null;};}function removeEntity(_0x21bc3c,_0x141579){return function(_0x4ed045){if(_0x4ed045){return _0x4ed045['destroy']()[_0x1c82('0x24')](function(){_0x21bc3c[_0x1c82('0x1a')](0xcc)[_0x1c82('0x1b')]();});}};}function handleEntityNotFound(_0x23c9d3,_0x38947d){return function(_0x4bfa09){if(!_0x4bfa09){_0x23c9d3[_0x1c82('0x19')](0x194);}return _0x4bfa09;};}function handleError(_0x4eeb8a,_0x81115a){_0x81115a=_0x81115a||0x1f4;return function(_0x4042bd){logger[_0x1c82('0x25')](_0x4042bd[_0x1c82('0x26')]);if(_0x4042bd[_0x1c82('0x27')]){delete _0x4042bd[_0x1c82('0x27')];}_0x4eeb8a['status'](_0x81115a)[_0x1c82('0x28')](_0x4042bd);};}exports[_0x1c82('0x29')]=function(_0x56935a,_0x48301c){var _0x532f7b={},_0x3d2271={},_0x206e17={'count':0x0,'rows':[]};var _0x185790=_[_0x1c82('0x2a')](db[_0x1c82('0x2b')][_0x1c82('0x2c')],function(_0x57f820){return{'name':_0x57f820[_0x1c82('0x2d')],'type':_0x57f820[_0x1c82('0x2e')][_0x1c82('0x2f')]};});_0x3d2271[_0x1c82('0x30')]=_[_0x1c82('0x31')](_[_0x1c82('0x2a')](_0x185790,_0x1c82('0x27')),[_0x1c82('0x27')]);_0x3d2271['query']=_[_0x1c82('0x32')](_0x56935a[_0x1c82('0x33')]);_0x3d2271[_0x1c82('0x34')]=_['intersection'](_0x3d2271[_0x1c82('0x30')],_0x3d2271['query']);_0x532f7b['attributes']=_['intersection'](_0x3d2271[_0x1c82('0x30')],qs['fields'](_0x56935a['query'][_0x1c82('0x35')]));_0x532f7b['attributes']=_0x532f7b[_0x1c82('0x36')][_0x1c82('0x37')]?_0x532f7b['attributes']:_0x3d2271[_0x1c82('0x30')];if(!_0x56935a['query']['hasOwnProperty']('nolimit')){_0x532f7b[_0x1c82('0x1e')]=qs[_0x1c82('0x1e')](_0x56935a[_0x1c82('0x33')][_0x1c82('0x1e')]);_0x532f7b[_0x1c82('0x1c')]=qs['offset'](_0x56935a[_0x1c82('0x33')][_0x1c82('0x1c')]);}_0x532f7b[_0x1c82('0x38')]=qs[_0x1c82('0x39')](_0x56935a[_0x1c82('0x33')]['sort']);_0x532f7b[_0x1c82('0x3a')]=qs[_0x1c82('0x34')](_['pick'](_0x56935a[_0x1c82('0x33')],_0x3d2271[_0x1c82('0x34')]),_0x185790);if(_0x56935a[_0x1c82('0x33')][_0x1c82('0x3b')]){_0x532f7b[_0x1c82('0x3a')]=_[_0x1c82('0x3c')](_0x532f7b[_0x1c82('0x3a')],{'$or':_[_0x1c82('0x2a')](_0x185790,function(_0x3aca64){if(_0x3aca64[_0x1c82('0x2e')]!==_0x1c82('0x3d')){var _0x45c9cb={};_0x45c9cb[_0x3aca64[_0x1c82('0x27')]]={'$like':'%'+_0x56935a[_0x1c82('0x33')][_0x1c82('0x3b')]+'%'};return _0x45c9cb;}})});}_0x532f7b=_['merge']({},_0x532f7b,_0x56935a[_0x1c82('0x3e')]);var _0x104c87={'where':_0x532f7b['where']};return db[_0x1c82('0x2b')][_0x1c82('0x1f')](_0x104c87)['then'](function(_0x5bf8de){_0x206e17[_0x1c82('0x1f')]=_0x5bf8de;if(_0x56935a[_0x1c82('0x33')][_0x1c82('0x3f')]){_0x532f7b[_0x1c82('0x40')]=[{'all':!![]}];}return db['CmCustomField'][_0x1c82('0x41')](_0x532f7b);})[_0x1c82('0x24')](function(_0x3e1a5c){_0x206e17[_0x1c82('0x42')]=_0x3e1a5c;return _0x206e17;})[_0x1c82('0x24')](respondWithFilteredResult(_0x48301c,_0x532f7b))[_0x1c82('0x43')](handleError(_0x48301c,null));};exports[_0x1c82('0x44')]=function(_0x5e4c20,_0xc114fa){var _0x1e5228={'raw':!![],'where':{'id':_0x5e4c20[_0x1c82('0x45')]['id']}},_0x504e3a={};_0x504e3a[_0x1c82('0x30')]=_['keys'](db[_0x1c82('0x2b')][_0x1c82('0x2c')]);_0x504e3a[_0x1c82('0x33')]=_[_0x1c82('0x32')](_0x5e4c20['query']);_0x504e3a[_0x1c82('0x34')]=_[_0x1c82('0x46')](_0x504e3a[_0x1c82('0x30')],_0x504e3a[_0x1c82('0x33')]);_0x1e5228['attributes']=_[_0x1c82('0x46')](_0x504e3a['model'],qs[_0x1c82('0x35')](_0x5e4c20[_0x1c82('0x33')]['fields']));_0x1e5228['attributes']=_0x1e5228[_0x1c82('0x36')][_0x1c82('0x37')]?_0x1e5228[_0x1c82('0x36')]:_0x504e3a[_0x1c82('0x30')];if(_0x5e4c20[_0x1c82('0x33')][_0x1c82('0x3f')]){_0x1e5228[_0x1c82('0x40')]=[{'all':!![]}];}_0x1e5228=_[_0x1c82('0x3c')]({},_0x1e5228,_0x5e4c20['options']);return db[_0x1c82('0x2b')][_0x1c82('0x47')](_0x1e5228)[_0x1c82('0x24')](handleEntityNotFound(_0xc114fa,null))[_0x1c82('0x24')](respondWithResult(_0xc114fa,null))[_0x1c82('0x43')](handleError(_0xc114fa,null));};exports[_0x1c82('0x23')]=function(_0xcb3ceb,_0x378298){if(_0xcb3ceb[_0x1c82('0x48')]['id']){delete _0xcb3ceb[_0x1c82('0x48')]['id'];}return db['CmCustomField'][_0x1c82('0x47')]({'where':{'id':_0xcb3ceb['params']['id']}})[_0x1c82('0x24')](handleEntityNotFound(_0x378298,null))[_0x1c82('0x24')](saveUpdates(_0xcb3ceb[_0x1c82('0x48')],null))[_0x1c82('0x24')](respondWithResult(_0x378298,null))[_0x1c82('0x43')](handleError(_0x378298,null));};exports[_0x1c82('0x49')]=function(_0x2377f5,_0x32c975){return db[_0x1c82('0x2b')]['find']({'where':{'id':_0x2377f5[_0x1c82('0x45')]['id']}})[_0x1c82('0x24')](handleEntityNotFound(_0x32c975,null))['then'](removeEntity(_0x32c975,null))[_0x1c82('0x43')](handleError(_0x32c975,null));};exports[_0x1c82('0x4a')]=function(_0x4ab55b,_0x4b551c){var _0x470d28;return db[_0x1c82('0x4b')][_0x1c82('0x4c')](function(_0x129c15){return db[_0x1c82('0x2b')][_0x1c82('0x4a')](_0x4ab55b[_0x1c82('0x48')],{'transaction':_0x129c15})[_0x1c82('0x24')](function(_0x25c709){_0x470d28=_0x25c709;var _0x2fb625={'type':db[_0x1c82('0x4d')][_0x1c82('0x4e')],'transaction':_0x129c15};switch(_0x4ab55b[_0x1c82('0x48')][_0x1c82('0x2e')]){case'text':_0x2fb625['type']=db[_0x1c82('0x4d')][_0x1c82('0x4e')];break;case _0x1c82('0x4f'):_0x2fb625[_0x1c82('0x2e')]=db[_0x1c82('0x4d')][_0x1c82('0x50')];break;case _0x1c82('0x51'):_0x2fb625[_0x1c82('0x2e')]=db[_0x1c82('0x4d')][_0x1c82('0x52')];_0x2fb625[_0x1c82('0x53')]=![];break;default:}return db[_0x1c82('0x4b')][_0x1c82('0x54')][_0x1c82('0x55')](_0x1c82('0x56'),util[_0x1c82('0x57')](_0x1c82('0x58'),_0x470d28['id']),_0x2fb625);})[_0x1c82('0x24')](function(){return _0x470d28;});})['then'](respondWithResult(_0x4b551c,0xc9))[_0x1c82('0x43')](handleError(_0x4b551c,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 4c6425c..29454f2 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 _0xfb20=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','util'];(function(_0x1ca25a,_0x4edf94){var _0x4a390a=function(_0x5e6e1e){while(--_0x5e6e1e){_0x1ca25a['push'](_0x1ca25a['shift']());}};_0x4a390a(++_0x4edf94);}(_0xfb20,0x143));var _0x0fb2=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xfb20[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require('lodash');var util=require(_0x0fb2('0x0'));var logger=require(_0x0fb2('0x1'))('api');var moment=require(_0x0fb2('0x2'));var BPromise=require(_0x0fb2('0x3'));var rp=require(_0x0fb2('0x4'));var fs=require('fs');var path=require(_0x0fb2('0x5'));var rimraf=require('rimraf');var config=require(_0x0fb2('0x6'));var attributes=require(_0x0fb2('0x7'));module[_0x0fb2('0x8')]=function(_0x39009a,_0x3cd8bb){return _0x39009a[_0x0fb2('0x9')](_0x0fb2('0xa'),attributes,{'tableName':_0x0fb2('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e7d=['../../config/environment','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0x7e7d,0x171));var _0xd7e7=function(_0x3d50b4,_0x5625f4){_0x3d50b4=_0x3d50b4-0x0;var _0x409428=_0x7e7d[_0x3d50b4];return _0x409428;};'use strict';var _=require(_0xd7e7('0x0'));var util=require(_0xd7e7('0x1'));var logger=require(_0xd7e7('0x2'))(_0xd7e7('0x3'));var moment=require(_0xd7e7('0x4'));var BPromise=require(_0xd7e7('0x5'));var rp=require(_0xd7e7('0x6'));var fs=require('fs');var path=require(_0xd7e7('0x7'));var rimraf=require('rimraf');var config=require(_0xd7e7('0x8'));var attributes=require('./cmCustomField.attributes');module[_0xd7e7('0x9')]=function(_0x53af21,_0x141342){return _0x53af21[_0xd7e7('0xa')](_0xd7e7('0xb'),attributes,{'tableName':_0xd7e7('0xc'),'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 c66723d..f4b148d 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 _0xe3ba=['request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x1bce3b,_0x5c2e60){var _0x268859=function(_0xa0ecc8){while(--_0xa0ecc8){_0x1bce3b['push'](_0x1bce3b['shift']());}};_0x268859(++_0x5c2e60);}(_0xe3ba,0xf5));var _0xae3b=function(_0x55af86,_0x5c8ff6){_0x55af86=_0x55af86-0x0;var _0x58df3b=_0xe3ba[_0x55af86];return _0x58df3b;};'use strict';var _=require(_0xae3b('0x0'));var util=require(_0xae3b('0x1'));var moment=require('moment');var BPromise=require(_0xae3b('0x2'));var rs=require(_0xae3b('0x3'));var fs=require('fs');var Redis=require(_0xae3b('0x4'));var db=require(_0xae3b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xae3b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d013c,_0x5cc4d5,_0x3b33ba){return new BPromise(function(_0x53c585,_0x128b1d){return client[_0xae3b('0x7')](_0x5d013c,_0x3b33ba)['then'](function(_0x225b15){logger[_0xae3b('0x8')](_0xae3b('0x9'),_0x5cc4d5,_0xae3b('0xa'));logger[_0xae3b('0xb')](_0xae3b('0xc'),_0x5cc4d5,_0xae3b('0xa'),JSON[_0xae3b('0xd')](_0x225b15));if(_0x225b15['error']){if(_0x225b15[_0xae3b('0xe')]['code']===0x1f4){logger[_0xae3b('0xe')]('CmCustomField,\x20%s,\x20%s',_0x5cc4d5,_0x225b15['error']['message']);return _0x128b1d(_0x225b15[_0xae3b('0xe')][_0xae3b('0xf')]);}logger[_0xae3b('0xe')](_0xae3b('0x9'),_0x5cc4d5,_0x225b15[_0xae3b('0xe')][_0xae3b('0xf')]);return _0x53c585(_0x225b15[_0xae3b('0xe')][_0xae3b('0xf')]);}else{logger[_0xae3b('0x8')]('CmCustomField,\x20%s,\x20%s',_0x5cc4d5,_0xae3b('0xa'));_0x53c585(_0x225b15[_0xae3b('0x10')][_0xae3b('0xf')]);}})[_0xae3b('0x11')](function(_0x545210){logger[_0xae3b('0xe')](_0xae3b('0x9'),_0x5cc4d5,_0x545210);_0x128b1d(_0x545210);});});} \ No newline at end of file +var _0x495e=['request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x495e,0xd1));var _0xe495=function(_0x2e914,_0x1c7566){_0x2e914=_0x2e914-0x0;var _0x936e45=_0x495e[_0x2e914];return _0x936e45;};'use strict';var _=require(_0xe495('0x0'));var util=require(_0xe495('0x1'));var moment=require(_0xe495('0x2'));var BPromise=require(_0xe495('0x3'));var rs=require(_0xe495('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe495('0x5'))['db'];var utils=require(_0xe495('0x6'));var logger=require(_0xe495('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe495('0x8'));var client=jayson[_0xe495('0x9')][_0xe495('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x220376,_0x3ff297,_0x372f06){return new BPromise(function(_0x5a1f4c,_0x474ce7){return client[_0xe495('0xb')](_0x220376,_0x372f06)[_0xe495('0xc')](function(_0x15e306){logger[_0xe495('0xd')](_0xe495('0xe'),_0x3ff297,_0xe495('0xf'));logger['debug'](_0xe495('0x10'),_0x3ff297,_0xe495('0xf'),JSON[_0xe495('0x11')](_0x15e306));if(_0x15e306[_0xe495('0x12')]){if(_0x15e306[_0xe495('0x12')][_0xe495('0x13')]===0x1f4){logger['error'](_0xe495('0xe'),_0x3ff297,_0x15e306['error']['message']);return _0x474ce7(_0x15e306[_0xe495('0x12')][_0xe495('0x14')]);}logger[_0xe495('0x12')](_0xe495('0xe'),_0x3ff297,_0x15e306[_0xe495('0x12')][_0xe495('0x14')]);return _0x5a1f4c(_0x15e306[_0xe495('0x12')][_0xe495('0x14')]);}else{logger['info'](_0xe495('0xe'),_0x3ff297,'request\x20sent');_0x5a1f4c(_0x15e306['result']['message']);}})[_0xe495('0x15')](function(_0x561425){logger['error'](_0xe495('0xe'),_0x3ff297,_0x561425);_0x474ce7(_0x561425);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 14f2182..34beb15 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 _0x9fce=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer'];(function(_0x4bbe24,_0x49a013){var _0x4387d8=function(_0x4266e1){while(--_0x4266e1){_0x4bbe24['push'](_0x4bbe24['shift']());}};_0x4387d8(++_0x49a013);}(_0x9fce,0x99));var _0xe9fc=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0x9fce[_0x95942];return _0x6d7f81;};'use strict';var multer=require(_0xe9fc('0x0'));var util=require(_0xe9fc('0x1'));var path=require(_0xe9fc('0x2'));var timeout=require(_0xe9fc('0x3'));var express=require(_0xe9fc('0x4'));var router=express[_0xe9fc('0x5')]();var fs_extra=require(_0xe9fc('0x6'));var auth=require(_0xe9fc('0x7'));var interaction=require(_0xe9fc('0x8'));var config=require(_0xe9fc('0x9'));var controller=require(_0xe9fc('0xa'));router[_0xe9fc('0xb')]('/',auth[_0xe9fc('0xc')](),controller[_0xe9fc('0xd')]);router['get'](_0xe9fc('0xe'),auth[_0xe9fc('0xc')](),controller[_0xe9fc('0xf')]);router[_0xe9fc('0x10')]('/',auth[_0xe9fc('0xc')](),controller[_0xe9fc('0x11')]);router[_0xe9fc('0x12')](_0xe9fc('0xe'),auth[_0xe9fc('0xc')](),controller[_0xe9fc('0x13')]);router[_0xe9fc('0x14')](_0xe9fc('0xe'),auth[_0xe9fc('0xc')](),controller[_0xe9fc('0x15')]);module['exports']=router; \ No newline at end of file +var _0x590c=['update','delete','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','create','put'];(function(_0xd941b9,_0x4b251a){var _0x7eeea=function(_0x9f1cf9){while(--_0x9f1cf9){_0xd941b9['push'](_0xd941b9['shift']());}};_0x7eeea(++_0x4b251a);}(_0x590c,0x80));var _0xc590=function(_0x15750e,_0x795219){_0x15750e=_0x15750e-0x0;var _0xc23350=_0x590c[_0x15750e];return _0xc23350;};'use strict';var multer=require(_0xc590('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc590('0x1'));var express=require(_0xc590('0x2'));var router=express[_0xc590('0x3')]();var fs_extra=require(_0xc590('0x4'));var auth=require(_0xc590('0x5'));var interaction=require(_0xc590('0x6'));var config=require(_0xc590('0x7'));var controller=require(_0xc590('0x8'));router[_0xc590('0x9')]('/',auth[_0xc590('0xa')](),controller[_0xc590('0xb')]);router[_0xc590('0x9')](_0xc590('0xc'),auth[_0xc590('0xa')](),controller[_0xc590('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc590('0xe')]);router[_0xc590('0xf')]('/:id',auth[_0xc590('0xa')](),controller[_0xc590('0x10')]);router[_0xc590('0x11')](_0xc590('0xc'),auth[_0xc590('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 5112581..76d331c 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 _0xef0f=['moment','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','UNSIGNED','contactListQueue'];(function(_0x489fe3,_0x5ebb81){var _0x592190=function(_0x1612a7){while(--_0x1612a7){_0x489fe3['push'](_0x489fe3['shift']());}};_0x592190(++_0x5ebb81);}(_0xef0f,0x168));var _0xfef0=function(_0x36e220,_0x1fdd49){_0x36e220=_0x36e220-0x0;var _0x430551=_0xef0f[_0x36e220];return _0x430551;};'use strict';var moment=require(_0xfef0('0x0'));var Sequelize=require('sequelize');module[_0xfef0('0x1')]={'phone':{'type':Sequelize[_0xfef0('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xfef0('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xfef0('0x4')](_0xfef0('0x5'))},'countbusyretry':{'type':Sequelize[_0xfef0('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfef0('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xfef0('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfef0('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfef0('0x7')]},'priority':{'type':Sequelize[_0xfef0('0x6')](0x2)[_0xfef0('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xfef0('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xfef0('0x6')],'unique':_0xfef0('0x9')},'UserId':{'type':Sequelize[_0xfef0('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xfef0('0x6')],'unique':_0xfef0('0x9')},'CampaignId':{'type':Sequelize[_0xfef0('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xfef0('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xfef0('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xfef0('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xfef0('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xfef0('0x6')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xfef0('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xfef0('0x7')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x0295=['moment','STRING','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','DATE','contactListQueue'];(function(_0x5c5368,_0x481ce1){var _0x53cb86=function(_0x442ee9){while(--_0x442ee9){_0x5c5368['push'](_0x5c5368['shift']());}};_0x53cb86(++_0x481ce1);}(_0x0295,0x1f0));var _0x5029=function(_0xca19df,_0xda79a5){_0xca19df=_0xca19df-0x0;var _0x512318=_0x0295[_0xca19df];return _0x512318;};'use strict';var moment=require(_0x5029('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x5029('0x1')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x5029('0x2')](_0x5029('0x3'))},'countbusyretry':{'type':Sequelize[_0x5029('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5029('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5029('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5029('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5029('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5029('0x6')]},'priority':{'type':Sequelize[_0x5029('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x5029('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x5029('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x5029('0x4')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x5029('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x5029('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5029('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5029('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5029('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x5029('0x1')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 4dd7ab4..d00aad4 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 _0xc0d3=['$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','show','params','keys','length','find','catch','create','body','update','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','preview','sequelize','transaction','dialPreviewAutoRecallMe','value','direction','isEmpty','priority','ASC','scheduledAt','dialOrderByScheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','LOCK','Contact','CmCompany','Company','List','VoiceQueue','Queue','dialActive','getPreviewRecall','hopperId','scheduledat','UPDATE','getOpenContacts','isNumber','error','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','sendStatus','name','send','index','map','CmHopper','rawAttributes','fieldName','type','query','intersection','model','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne'];(function(_0xa26aa3,_0x2da21d){var _0x4d9874=function(_0x1ab137){while(--_0x1ab137){_0xa26aa3['push'](_0xa26aa3['shift']());}};_0x4d9874(++_0x2da21d);}(_0xc0d3,0x107));var _0x3c0d=function(_0x87ace,_0x51303e){_0x87ace=_0x87ace-0x0;var _0x1d0246=_0xc0d3[_0x87ace];return _0x1d0246;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3c0d('0x0'));var jsonpatch=require(_0x3c0d('0x1'));var rp=require(_0x3c0d('0x2'));var moment=require(_0x3c0d('0x3'));var BPromise=require(_0x3c0d('0x4'));var Mustache=require(_0x3c0d('0x5'));var util=require(_0x3c0d('0x6'));var path=require(_0x3c0d('0x7'));var sox=require(_0x3c0d('0x8'));var csv=require(_0x3c0d('0x9'));var ejs=require(_0x3c0d('0xa'));var fs=require('fs');var fs_extra=require(_0x3c0d('0xb'));var _=require(_0x3c0d('0xc'));var squel=require('squel');var crypto=require(_0x3c0d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3c0d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3c0d('0xf'));var qs=require(_0x3c0d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c0d('0x11'))(_0x3c0d('0x12'));var utils=require('../../config/utils');var config=require(_0x3c0d('0x13'));var shared=require(_0x3c0d('0x13'));var licenseUtil=require(_0x3c0d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58d476,_0x1c28cb){_0x1c28cb=_0x1c28cb||0xcc;return function(_0x4cb085){if(_0x4cb085){return _0x58d476['sendStatus'](_0x1c28cb);}return _0x58d476[_0x3c0d('0x15')](_0x1c28cb)[_0x3c0d('0x16')]();};}function respondWithResult(_0x1b8d41,_0x609eee){_0x609eee=_0x609eee||0xc8;return function(_0x278b97){if(_0x278b97){return _0x1b8d41['status'](_0x609eee)['json'](_0x278b97);}};}function respondWithFilteredResult(_0xc4ffbb,_0x4bfe86){return function(_0x2777d2){if(_0x2777d2){var _0x108fd3=typeof _0x4bfe86[_0x3c0d('0x17')]===_0x3c0d('0x18')&&typeof _0x4bfe86[_0x3c0d('0x19')]===_0x3c0d('0x18');var _0x43bfff=_0x2777d2[_0x3c0d('0x1a')];var _0x4b5d59=_0x108fd3?0x0:_0x4bfe86[_0x3c0d('0x17')];var _0x44f08b=_0x108fd3?_0x2777d2[_0x3c0d('0x1a')]:_0x4bfe86[_0x3c0d('0x17')]+_0x4bfe86[_0x3c0d('0x19')];var _0x3f5183;if(_0x44f08b>=_0x43bfff){_0x44f08b=_0x43bfff;_0x3f5183=0xc8;}else{_0x3f5183=0xce;}_0xc4ffbb['status'](_0x3f5183);return _0xc4ffbb[_0x3c0d('0x1b')](_0x3c0d('0x1c'),_0x4b5d59+'-'+_0x44f08b+'/'+_0x43bfff)[_0x3c0d('0x1d')](_0x2777d2);}return null;};}function patchUpdates(_0x3a9a49){return function(_0x5c3df0){try{jsonpatch[_0x3c0d('0x1e')](_0x5c3df0,_0x3a9a49,!![]);}catch(_0x3f3aff){return BPromise[_0x3c0d('0x1f')](_0x3f3aff);}return _0x5c3df0[_0x3c0d('0x20')]();};}function saveUpdates(_0x27654c,_0x2b55dd){return function(_0x1d3716){if(_0x1d3716){return _0x1d3716['update'](_0x27654c)[_0x3c0d('0x21')](function(_0x374643){return _0x374643;});}return null;};}function removeEntity(_0x2a8e4a,_0x1cc91f){return function(_0x134a10){if(_0x134a10){return _0x134a10['destroy']()[_0x3c0d('0x21')](function(){_0x2a8e4a[_0x3c0d('0x15')](0xcc)[_0x3c0d('0x16')]();});}};}function handleEntityNotFound(_0x5544e3,_0x4ef368){return function(_0x5ccd98){if(!_0x5ccd98){_0x5544e3[_0x3c0d('0x22')](0x194);}return _0x5ccd98;};}function handleError(_0x38bb2f,_0x4b3aa1){_0x4b3aa1=_0x4b3aa1||0x1f4;return function(_0x368857){logger['error'](_0x368857['stack']);if(_0x368857[_0x3c0d('0x23')]){delete _0x368857[_0x3c0d('0x23')];}_0x38bb2f[_0x3c0d('0x15')](_0x4b3aa1)[_0x3c0d('0x24')](_0x368857);};}exports[_0x3c0d('0x25')]=function(_0x5aecc1,_0x1f58da){var _0x48fbdc={},_0x3132f8={},_0x143562={'count':0x0,'rows':[]};var _0x1e127d=_[_0x3c0d('0x26')](db[_0x3c0d('0x27')][_0x3c0d('0x28')],function(_0x129151){return{'name':_0x129151[_0x3c0d('0x29')],'type':_0x129151[_0x3c0d('0x2a')]['key']};});_0x3132f8['model']=_['map'](_0x1e127d,_0x3c0d('0x23'));_0x3132f8[_0x3c0d('0x2b')]=_['keys'](_0x5aecc1['query']);_0x3132f8['filters']=_[_0x3c0d('0x2c')](_0x3132f8[_0x3c0d('0x2d')],_0x3132f8[_0x3c0d('0x2b')]);_0x3132f8[_0x3c0d('0x2e')]=_[_0x3c0d('0x2f')](_0x3132f8[_0x3c0d('0x2e')],[_0x3c0d('0x30'),_0x3c0d('0x31'),_0x3c0d('0x32'),_0x3c0d('0x33'),_0x3c0d('0x34'),_0x3c0d('0x35'),_0x3c0d('0x36'),'$eq',_0x3c0d('0x37'),_0x3c0d('0x38'),_0x3c0d('0x39'),_0x3c0d('0x3a'),_0x3c0d('0x3b'),'$like',_0x3c0d('0x3c'),_0x3c0d('0x3d'),_0x3c0d('0x3e'),_0x3c0d('0x3f'),_0x3c0d('0x40'),_0x3c0d('0x41'),_0x3c0d('0x42'),_0x3c0d('0x43')]);_0x48fbdc[_0x3c0d('0x44')]=_[_0x3c0d('0x2c')](_0x3132f8[_0x3c0d('0x2d')],qs['fields'](_0x5aecc1[_0x3c0d('0x2b')][_0x3c0d('0x45')]));_0x48fbdc['attributes']=_0x48fbdc[_0x3c0d('0x44')]['length']?_0x48fbdc['attributes']:_0x3132f8[_0x3c0d('0x2d')];if(!_0x5aecc1[_0x3c0d('0x2b')][_0x3c0d('0x46')](_0x3c0d('0x47'))){_0x48fbdc['limit']=qs[_0x3c0d('0x19')](_0x5aecc1[_0x3c0d('0x2b')][_0x3c0d('0x19')]);_0x48fbdc[_0x3c0d('0x17')]=qs['offset'](_0x5aecc1[_0x3c0d('0x2b')][_0x3c0d('0x17')]);}_0x48fbdc[_0x3c0d('0x48')]=qs[_0x3c0d('0x49')](_0x5aecc1['query']['sort']);_0x48fbdc['where']=qs[_0x3c0d('0x2e')](_[_0x3c0d('0x4a')](_0x5aecc1[_0x3c0d('0x2b')],_0x3132f8[_0x3c0d('0x2e')]),_0x1e127d);if(_0x5aecc1[_0x3c0d('0x2b')][_0x3c0d('0x4b')]){_0x48fbdc[_0x3c0d('0x4c')]=_['merge'](_0x48fbdc[_0x3c0d('0x4c')],{'$or':_[_0x3c0d('0x26')](_0x1e127d,function(_0x4367e6){if(_0x4367e6[_0x3c0d('0x2a')]!==_0x3c0d('0x4d')){var _0x48458c={};_0x48458c[_0x4367e6[_0x3c0d('0x23')]]={'$like':'%'+_0x5aecc1[_0x3c0d('0x2b')][_0x3c0d('0x4b')]+'%'};return _0x48458c;}})});}_0x48fbdc=_[_0x3c0d('0x4e')]({},_0x48fbdc,_0x5aecc1['options']);var _0x226d8d={'where':_0x48fbdc[_0x3c0d('0x4c')]};return db[_0x3c0d('0x27')][_0x3c0d('0x1a')](_0x226d8d)['then'](function(_0x2babb3){_0x143562[_0x3c0d('0x1a')]=_0x2babb3;if(_0x5aecc1[_0x3c0d('0x2b')][_0x3c0d('0x4f')]){_0x48fbdc[_0x3c0d('0x50')]=[{'all':!![]}];}return db[_0x3c0d('0x27')][_0x3c0d('0x51')](_0x48fbdc);})[_0x3c0d('0x21')](function(_0x5f5902){_0x143562['rows']=_0x5f5902;return _0x143562;})['then'](respondWithFilteredResult(_0x1f58da,_0x48fbdc))['catch'](handleError(_0x1f58da,null));};exports[_0x3c0d('0x52')]=function(_0x4927b9,_0x4a5b28){var _0x472a5d={'raw':!![],'where':{'id':_0x4927b9[_0x3c0d('0x53')]['id']}},_0x4613fd={};_0x4613fd[_0x3c0d('0x2d')]=_[_0x3c0d('0x54')](db[_0x3c0d('0x27')][_0x3c0d('0x28')]);_0x4613fd[_0x3c0d('0x2b')]=_[_0x3c0d('0x54')](_0x4927b9[_0x3c0d('0x2b')]);_0x4613fd[_0x3c0d('0x2e')]=_['intersection'](_0x4613fd[_0x3c0d('0x2d')],_0x4613fd[_0x3c0d('0x2b')]);_0x472a5d[_0x3c0d('0x44')]=_[_0x3c0d('0x2c')](_0x4613fd[_0x3c0d('0x2d')],qs[_0x3c0d('0x45')](_0x4927b9[_0x3c0d('0x2b')][_0x3c0d('0x45')]));_0x472a5d[_0x3c0d('0x44')]=_0x472a5d[_0x3c0d('0x44')][_0x3c0d('0x55')]?_0x472a5d[_0x3c0d('0x44')]:_0x4613fd['model'];if(_0x4927b9['query']['includeAll']){_0x472a5d[_0x3c0d('0x50')]=[{'all':!![]}];}_0x472a5d=_['merge']({},_0x472a5d,_0x4927b9['options']);return db[_0x3c0d('0x27')][_0x3c0d('0x56')](_0x472a5d)[_0x3c0d('0x21')](handleEntityNotFound(_0x4a5b28,null))[_0x3c0d('0x21')](respondWithResult(_0x4a5b28,null))[_0x3c0d('0x57')](handleError(_0x4a5b28,null));};exports[_0x3c0d('0x58')]=function(_0x221f88,_0x402935){return db[_0x3c0d('0x27')]['create'](_0x221f88[_0x3c0d('0x59')],{})[_0x3c0d('0x21')](respondWithResult(_0x402935,0xc9))[_0x3c0d('0x57')](handleError(_0x402935,null));};exports[_0x3c0d('0x5a')]=function(_0x4b32a2,_0xc61921){if(_0x4b32a2['body']['id']){delete _0x4b32a2[_0x3c0d('0x59')]['id'];}return db[_0x3c0d('0x27')][_0x3c0d('0x56')]({'where':{'id':_0x4b32a2[_0x3c0d('0x53')]['id']}})[_0x3c0d('0x21')](handleEntityNotFound(_0xc61921,null))[_0x3c0d('0x21')](saveUpdates(_0x4b32a2[_0x3c0d('0x59')],null))[_0x3c0d('0x21')](respondWithResult(_0xc61921,null))[_0x3c0d('0x57')](handleError(_0xc61921,null));};exports[_0x3c0d('0x5b')]=function(_0x19ad1d,_0x340f4b){return db[_0x3c0d('0x27')]['describe']()[_0x3c0d('0x21')](respondWithResult(_0x340f4b,null))[_0x3c0d('0x57')](handleError(_0x340f4b,null));};exports['destroy']=function(_0x2fb106,_0x452147){var _0x563db5;return db[_0x3c0d('0x27')][_0x3c0d('0x56')]({'where':{'id':_0x2fb106['params']['id']}})[_0x3c0d('0x21')](handleEntityNotFound(_0x452147,null))[_0x3c0d('0x21')](function(_0x434f6c){if(_0x434f6c){return _0x434f6c[_0x3c0d('0x5c')]()[_0x3c0d('0x21')](function(_0x43cccb){return _0x43cccb;});}})[_0x3c0d('0x21')](function(_0x86e4c8){_0x563db5=_0x86e4c8;if(_0x86e4c8){if(_0x86e4c8[_0x3c0d('0x5d')]||_0x86e4c8[_0x3c0d('0x5e')]){return db[_0x86e4c8[_0x3c0d('0x5d')]?'VoiceQueue':_0x3c0d('0x5f')][_0x3c0d('0x56')]({'where':{'id':_0x86e4c8[_0x3c0d('0x5d')]?_0x86e4c8['VoiceQueueId']:_0x86e4c8[_0x3c0d('0x5e')]},'attributes':['id','name'],'raw':!![]});}}})[_0x3c0d('0x21')](function(_0x3bfa6c){var _0x19eed8={};if(_0x3bfa6c){_[_0x3c0d('0x4e')](_0x19eed8,_[_0x3c0d('0x60')](_0x563db5[_0x3c0d('0x61')],[_0x3c0d('0x62'),_0x3c0d('0x63'),'id']));_0x19eed8[_0x3c0d('0x64')]=0x15;_0x19eed8[_0x3c0d('0x65')]=_0x3c0d('0x66');_0x19eed8[_0x3c0d('0x67')]=_0x3bfa6c[_0x3c0d('0x23')];_0x19eed8['membername']=_0x2fb106['user']['name'];_0x19eed8['UserId']=_0x2fb106[_0x3c0d('0x68')]['id'];_0x19eed8[_0x3c0d('0x66')]=!![];_0x19eed8[_0x3c0d('0x69')]=moment()[_0x3c0d('0x6a')](_0x3c0d('0x6b'));_0x19eed8[_0x3c0d('0x6c')]=_0x563db5[_0x3c0d('0x6d')];_0x19eed8[_0x3c0d('0x6e')]=_0x563db5[_0x3c0d('0x5d')]?_0x3c0d('0x6f'):'ivr';return db[_0x3c0d('0x70')][_0x3c0d('0x56')]({'where':{'id':_0x19eed8[_0x3c0d('0x71')]},'attributes':[_0x3c0d('0x72'),_0x3c0d('0x73')]})['then'](function(_0x3d5b67){if(!_[_0x3c0d('0x74')](_0x452147)&&!_['isNil'](_0x3d5b67['firstName'])){_0x19eed8[_0x3c0d('0x75')]=_0x3d5b67['firstName'];if(!_[_0x3c0d('0x74')](_0x3d5b67[_0x3c0d('0x73')])){_0x19eed8['calleridname']+='\x20'+_0x3d5b67[_0x3c0d('0x73')];}}})['finally'](function(){return db[_0x3c0d('0x76')][_0x3c0d('0x58')](_0x19eed8);});}})[_0x3c0d('0x21')](function(){return _0x452147[_0x3c0d('0x15')](0xcc)[_0x3c0d('0x16')]();})['catch'](handleError(_0x452147,null));};exports[_0x3c0d('0x77')]=function(_0x703e3c,_0x29cafb,_0x3e1646){var _0x252a2d=[];return db[_0x3c0d('0x70')][_0x3c0d('0x5b')]()[_0x3c0d('0x21')](function(_0x198821){_0x252a2d=_[_0x3c0d('0x54')](_0x198821);return _0x703e3c[_0x3c0d('0x68')][_0x3c0d('0x78')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x3c0d('0x79')},'attributes':['id','dialOrderByScheduledAt','dialPreviewAutoRecallMe'],'raw':!![]});})['then'](function(_0x22e3be){if(_0x22e3be&&_0x22e3be['length']){return db[_0x3c0d('0x7a')][_0x3c0d('0x7b')](function(_0x248d97){var _0x3a5cb2={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3c0d('0x6a')](_0x3c0d('0x6b'))},'VoiceQueueId':{'$in':_['map'](_0x22e3be,'id')},'$or':[{'UserId':null},{'UserId':_0x703e3c[_0x3c0d('0x68')]['id']}]};var _0x3d73f4={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x22e3be)[_0x3c0d('0x4b')]([_0x3c0d('0x7c'),0x0])[_0x3c0d('0x26')]('id')[_0x3c0d('0x7d')]()},'$or':[{'UserId':null},{'UserId':_0x703e3c[_0x3c0d('0x68')]['id']}]};var _0x275ffd={'$or':[_0x3a5cb2,_0x3d73f4]};var _0x423aa6=[];if(_0x703e3c[_0x3c0d('0x59')][_0x3c0d('0x7e')]&&_0x703e3c['body']['direction']==='prev'){if(!_[_0x3c0d('0x7f')](_0x703e3c[_0x3c0d('0x59')]['hopperIds'])){_0x275ffd['id']={'$in':_0x703e3c[_0x3c0d('0x59')]['hopperIds']};}_0x423aa6=[[_0x3c0d('0x80'),_0x3c0d('0x81')],[_0x3c0d('0x82'),_0x22e3be[0x0][_0x3c0d('0x83')]===_0x3c0d('0x81')?'DESC':'ASC'],db[_0x3c0d('0x7a')][_0x3c0d('0x84')](_0x3c0d('0x85')),['id',_0x3c0d('0x86')]];}else{if(!_[_0x3c0d('0x7f')](_0x703e3c[_0x3c0d('0x59')]['hopperIds'])){_0x275ffd['id']={'$notIn':_0x703e3c[_0x3c0d('0x59')]['hopperIds']};}_0x423aa6=[['priority','DESC'],[_0x3c0d('0x82'),_0x22e3be[0x0][_0x3c0d('0x83')]],db[_0x3c0d('0x7a')][_0x3c0d('0x84')](_0x3c0d('0x87')),['id',_0x3c0d('0x81')]];}return db['CmHopper'][_0x3c0d('0x88')]({'attributes':['id','scheduledat',_0x3c0d('0x89')],'where':_0x275ffd,'order':_0x423aa6,'transaction':_0x248d97,'lock':_0x248d97[_0x3c0d('0x8a')]['UPDATE'],'include':[{'model':db[_0x3c0d('0x70')],'as':_0x3c0d('0x8b'),'attributes':_0x252a2d,'include':[{'model':db[_0x3c0d('0x8c')],'as':_0x3c0d('0x8d'),'attributes':['id',_0x3c0d('0x23')]}]},{'model':db['CmList'],'as':_0x3c0d('0x8e'),'attributes':['id','name']},{'model':db[_0x3c0d('0x8f')],'as':_0x3c0d('0x90'),'attributes':['id',_0x3c0d('0x23'),_0x3c0d('0x91')]}]})[_0x3c0d('0x21')](function(_0x2aded2){if(_0x2aded2){return _0x2aded2[_0x3c0d('0x5a')]({'UserId':_0x703e3c[_0x3c0d('0x68')]['id']},{'transaction':_0x248d97});}});});}})['then'](handleEntityNotFound(_0x29cafb,null))['then'](respondWithResult(_0x29cafb,null))[_0x3c0d('0x57')](handleError(_0x29cafb,null));};exports[_0x3c0d('0x92')]=function(_0x4e1ce8,_0x4a5a56,_0x2e97ff){var _0x46faee=[];return db[_0x3c0d('0x70')][_0x3c0d('0x5b')]()[_0x3c0d('0x21')](function(_0x555484){_0x46faee=_['keys'](_0x555484);return _0x4e1ce8['user'][_0x3c0d('0x78')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt','dialPreviewAutoRecallMe'],'raw':!![]});})[_0x3c0d('0x21')](function(_0x84662b){if(_0x84662b&&_0x84662b['length']){return db[_0x3c0d('0x7a')][_0x3c0d('0x7b')](function(_0x559a5a){var _0x4290cb={'active':![],'recallme':!![],'id':_0x4e1ce8[_0x3c0d('0x59')][_0x3c0d('0x93')]};return db['CmHopper'][_0x3c0d('0x88')]({'attributes':['id',_0x3c0d('0x94'),'recallme'],'where':_0x4290cb,'transaction':_0x559a5a,'lock':_0x559a5a['LOCK'][_0x3c0d('0x95')],'include':[{'model':db[_0x3c0d('0x70')],'as':_0x3c0d('0x8b'),'attributes':_0x46faee,'include':[{'model':db[_0x3c0d('0x8c')],'as':'Company','attributes':['id',_0x3c0d('0x23')]}]},{'model':db['CmList'],'as':_0x3c0d('0x8e'),'attributes':['id',_0x3c0d('0x23')]},{'model':db[_0x3c0d('0x8f')],'as':'Queue','attributes':['id',_0x3c0d('0x23'),'dialActive']}]})['then'](function(_0xa8296a){if(_0xa8296a){return _0xa8296a['update']({'UserId':_0x4e1ce8['user']['id']},{'transaction':_0x559a5a});}});});}})['then'](handleEntityNotFound(_0x4a5a56,null))['then'](respondWithResult(_0x4a5a56,null))[_0x3c0d('0x57')](handleError(_0x4a5a56,null));};exports[_0x3c0d('0x96')]=function(_0x11581a,_0x5ced9c,_0x1c8771){return _0x11581a['user'][_0x3c0d('0x78')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x3c0d('0x79')},'attributes':['id'],'raw':!![]})['then'](function(_0x3779d8){if(_0x3779d8&&_0x3779d8[_0x3c0d('0x55')]){return db['CmHopper'][_0x3c0d('0x1a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3c0d('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x3779d8,'id')},'$or':[{'UserId':null},{'UserId':_0x11581a['user']['id']}]}});}return 0x0;})[_0x3c0d('0x21')](function(_0x5eebcf){if(!_[_0x3c0d('0x74')](_0x5eebcf)&&_[_0x3c0d('0x97')](_0x5eebcf)){return _0x5ced9c[_0x3c0d('0x15')](0xc8)[_0x3c0d('0x1d')]({'contacts':_0x5eebcf});}else{logger[_0x3c0d('0x98')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x3c0d('0x96'),0x194,_0x3c0d('0x99'));_0x5ced9c[_0x3c0d('0x22')](0x194);}})[_0x3c0d('0x57')](handleError(_0x5ced9c,null));};exports[_0x3c0d('0x9a')]=function(_0x2b7622,_0x4e7559,_0x53ad7a){var _0x472079=shared[_0x3c0d('0x9b')];var _0x25e3a8=[];_[_0x3c0d('0x26')](_0x472079,function(_0x8d9dfe){_0x25e3a8[_0x3c0d('0x9c')]({'id':_0x8d9dfe['name'],'name':_0x8d9dfe['name'],'utcOffset':_0x8d9dfe[_0x3c0d('0x9d')]});});return _0x4e7559[_0x3c0d('0x15')](0xc8)[_0x3c0d('0x1d')]({'tz':_0x25e3a8});};exports[_0x3c0d('0x9e')]=function(_0x52aa39,_0x771611,_0x19e338){var _0x4e4fbc=shared[_0x3c0d('0x9b')];var _0x34213f={};if(!_[_0x3c0d('0x74')](_0x4e4fbc[_0x52aa39[_0x3c0d('0x59')]['id']]))_0x34213f=_0x4e4fbc[_0x52aa39[_0x3c0d('0x59')]['id']];return _0x771611['status'](0xc8)[_0x3c0d('0x1d')](_0x34213f);}; \ No newline at end of file +var _0xdf96=['$gt','$gte','$ne','$not','$between','$in','$notIn','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','describe','CampaignId','VoiceQueue','Campaign','VoiceQueueId','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','direction','prev','isEmpty','hopperIds','ASC','DESC','sequelize','literal','findOne','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','dialActive','hopperId','scheduledat','Queue','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../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','count','apply','reject','update','then','destroy','error','name','send','index','map','CmHopper','fieldName','key','keys','query','model','concat','filters','$and','$or'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xdf96,0xfc));var _0x6df9=function(_0x42ab34,_0x741950){_0x42ab34=_0x42ab34-0x0;var _0x5d0b89=_0xdf96[_0x42ab34];return _0x5d0b89;};'use strict';var emlformat=require(_0x6df9('0x0'));var rimraf=require(_0x6df9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6df9('0x2'));var rp=require(_0x6df9('0x3'));var moment=require('moment');var BPromise=require(_0x6df9('0x4'));var Mustache=require(_0x6df9('0x5'));var util=require(_0x6df9('0x6'));var path=require('path');var sox=require(_0x6df9('0x7'));var csv=require(_0x6df9('0x8'));var ejs=require(_0x6df9('0x9'));var fs=require('fs');var fs_extra=require(_0x6df9('0xa'));var _=require('lodash');var squel=require(_0x6df9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6df9('0xc'));var toCsv=require(_0x6df9('0x8'));var querystring=require(_0x6df9('0xd'));var Papa=require('papaparse');var Redis=require(_0x6df9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6df9('0xf'));var as=require(_0x6df9('0x10'));var hardwareService=require(_0x6df9('0x11'));var logger=require(_0x6df9('0x12'))(_0x6df9('0x13'));var utils=require(_0x6df9('0x14'));var config=require(_0x6df9('0x15'));var shared=require(_0x6df9('0x15'));var licenseUtil=require(_0x6df9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2322c0,_0xbbb5d9){_0xbbb5d9=_0xbbb5d9||0xcc;return function(_0x1cda44){if(_0x1cda44){return _0x2322c0[_0x6df9('0x17')](_0xbbb5d9);}return _0x2322c0[_0x6df9('0x18')](_0xbbb5d9)[_0x6df9('0x19')]();};}function respondWithResult(_0x166824,_0x1f6f4d){_0x1f6f4d=_0x1f6f4d||0xc8;return function(_0x282466){if(_0x282466){return _0x166824[_0x6df9('0x18')](_0x1f6f4d)[_0x6df9('0x1a')](_0x282466);}};}function respondWithFilteredResult(_0x56751d,_0xa99ec4){return function(_0x274b01){if(_0x274b01){var _0x29edb3=typeof _0xa99ec4[_0x6df9('0x1b')]==='undefined'&&typeof _0xa99ec4[_0x6df9('0x1c')]==='undefined';var _0x5843c0=_0x274b01[_0x6df9('0x1d')];var _0x10feb6=_0x29edb3?0x0:_0xa99ec4['offset'];var _0x962a25=_0x29edb3?_0x274b01['count']:_0xa99ec4[_0x6df9('0x1b')]+_0xa99ec4[_0x6df9('0x1c')];var _0x1da2f7;if(_0x962a25>=_0x5843c0){_0x962a25=_0x5843c0;_0x1da2f7=0xc8;}else{_0x1da2f7=0xce;}_0x56751d[_0x6df9('0x18')](_0x1da2f7);return _0x56751d['set']('Content-Range',_0x10feb6+'-'+_0x962a25+'/'+_0x5843c0)[_0x6df9('0x1a')](_0x274b01);}return null;};}function patchUpdates(_0x50a8b6){return function(_0xf2978e){try{jsonpatch[_0x6df9('0x1e')](_0xf2978e,_0x50a8b6,!![]);}catch(_0x31082b){return BPromise[_0x6df9('0x1f')](_0x31082b);}return _0xf2978e['save']();};}function saveUpdates(_0x3a67a3,_0x7b19a4){return function(_0x51127c){if(_0x51127c){return _0x51127c[_0x6df9('0x20')](_0x3a67a3)[_0x6df9('0x21')](function(_0x3658d8){return _0x3658d8;});}return null;};}function removeEntity(_0x365d52,_0x999606){return function(_0x3626a8){if(_0x3626a8){return _0x3626a8[_0x6df9('0x22')]()['then'](function(){_0x365d52['status'](0xcc)[_0x6df9('0x19')]();});}};}function handleEntityNotFound(_0x5c82f8,_0x3be7ef){return function(_0x27c2b0){if(!_0x27c2b0){_0x5c82f8[_0x6df9('0x17')](0x194);}return _0x27c2b0;};}function handleError(_0x4a20c5,_0x346935){_0x346935=_0x346935||0x1f4;return function(_0x38159c){logger[_0x6df9('0x23')](_0x38159c['stack']);if(_0x38159c[_0x6df9('0x24')]){delete _0x38159c['name'];}_0x4a20c5[_0x6df9('0x18')](_0x346935)[_0x6df9('0x25')](_0x38159c);};}exports[_0x6df9('0x26')]=function(_0x400bd7,_0x3036de){var _0x267aeb={},_0x423336={},_0x3ef7ee={'count':0x0,'rows':[]};var _0x46c569=_[_0x6df9('0x27')](db[_0x6df9('0x28')]['rawAttributes'],function(_0x4bd897){return{'name':_0x4bd897[_0x6df9('0x29')],'type':_0x4bd897['type'][_0x6df9('0x2a')]};});_0x423336['model']=_[_0x6df9('0x27')](_0x46c569,_0x6df9('0x24'));_0x423336['query']=_[_0x6df9('0x2b')](_0x400bd7[_0x6df9('0x2c')]);_0x423336['filters']=_['intersection'](_0x423336[_0x6df9('0x2d')],_0x423336['query']);_0x423336['filters']=_[_0x6df9('0x2e')](_0x423336[_0x6df9('0x2f')],[_0x6df9('0x30'),_0x6df9('0x31'),_0x6df9('0x32'),_0x6df9('0x33'),'$lt','$lte',_0x6df9('0x34'),'$eq',_0x6df9('0x35'),_0x6df9('0x36'),'$notBetween',_0x6df9('0x37'),_0x6df9('0x38'),'$like',_0x6df9('0x39'),_0x6df9('0x3a'),_0x6df9('0x3b'),'$like',_0x6df9('0x3c'),_0x6df9('0x3d'),_0x6df9('0x3e'),_0x6df9('0x3f')]);_0x267aeb[_0x6df9('0x40')]=_[_0x6df9('0x41')](_0x423336['model'],qs[_0x6df9('0x42')](_0x400bd7[_0x6df9('0x2c')][_0x6df9('0x42')]));_0x267aeb['attributes']=_0x267aeb[_0x6df9('0x40')][_0x6df9('0x43')]?_0x267aeb[_0x6df9('0x40')]:_0x423336[_0x6df9('0x2d')];if(!_0x400bd7[_0x6df9('0x2c')][_0x6df9('0x44')](_0x6df9('0x45'))){_0x267aeb['limit']=qs[_0x6df9('0x1c')](_0x400bd7[_0x6df9('0x2c')][_0x6df9('0x1c')]);_0x267aeb[_0x6df9('0x1b')]=qs[_0x6df9('0x1b')](_0x400bd7[_0x6df9('0x2c')][_0x6df9('0x1b')]);}_0x267aeb[_0x6df9('0x46')]=qs['sort'](_0x400bd7[_0x6df9('0x2c')][_0x6df9('0x47')]);_0x267aeb[_0x6df9('0x48')]=qs[_0x6df9('0x2f')](_['pick'](_0x400bd7['query'],_0x423336['filters']),_0x46c569);if(_0x400bd7[_0x6df9('0x2c')][_0x6df9('0x49')]){_0x267aeb[_0x6df9('0x48')]=_[_0x6df9('0x4a')](_0x267aeb[_0x6df9('0x48')],{'$or':_[_0x6df9('0x27')](_0x46c569,function(_0x28e378){if(_0x28e378['type']!=='VIRTUAL'){var _0x2a4e08={};_0x2a4e08[_0x28e378[_0x6df9('0x24')]]={'$like':'%'+_0x400bd7[_0x6df9('0x2c')]['filter']+'%'};return _0x2a4e08;}})});}_0x267aeb=_[_0x6df9('0x4a')]({},_0x267aeb,_0x400bd7[_0x6df9('0x4b')]);var _0x437f1f={'where':_0x267aeb[_0x6df9('0x48')]};return db[_0x6df9('0x28')][_0x6df9('0x1d')](_0x437f1f)[_0x6df9('0x21')](function(_0x3ad333){_0x3ef7ee[_0x6df9('0x1d')]=_0x3ad333;if(_0x400bd7['query']['includeAll']){_0x267aeb[_0x6df9('0x4c')]=[{'all':!![]}];}return db['CmHopper'][_0x6df9('0x4d')](_0x267aeb);})[_0x6df9('0x21')](function(_0x55adbb){_0x3ef7ee[_0x6df9('0x4e')]=_0x55adbb;return _0x3ef7ee;})[_0x6df9('0x21')](respondWithFilteredResult(_0x3036de,_0x267aeb))['catch'](handleError(_0x3036de,null));};exports[_0x6df9('0x4f')]=function(_0x2a54af,_0x132c40){var _0x5d6fa9={'raw':!![],'where':{'id':_0x2a54af[_0x6df9('0x50')]['id']}},_0x1a349d={};_0x1a349d[_0x6df9('0x2d')]=_['keys'](db[_0x6df9('0x28')][_0x6df9('0x51')]);_0x1a349d['query']=_[_0x6df9('0x2b')](_0x2a54af[_0x6df9('0x2c')]);_0x1a349d[_0x6df9('0x2f')]=_['intersection'](_0x1a349d[_0x6df9('0x2d')],_0x1a349d[_0x6df9('0x2c')]);_0x5d6fa9[_0x6df9('0x40')]=_[_0x6df9('0x41')](_0x1a349d['model'],qs[_0x6df9('0x42')](_0x2a54af[_0x6df9('0x2c')][_0x6df9('0x42')]));_0x5d6fa9['attributes']=_0x5d6fa9[_0x6df9('0x40')][_0x6df9('0x43')]?_0x5d6fa9[_0x6df9('0x40')]:_0x1a349d[_0x6df9('0x2d')];if(_0x2a54af[_0x6df9('0x2c')][_0x6df9('0x52')]){_0x5d6fa9[_0x6df9('0x4c')]=[{'all':!![]}];}_0x5d6fa9=_['merge']({},_0x5d6fa9,_0x2a54af[_0x6df9('0x4b')]);return db[_0x6df9('0x28')][_0x6df9('0x53')](_0x5d6fa9)['then'](handleEntityNotFound(_0x132c40,null))[_0x6df9('0x21')](respondWithResult(_0x132c40,null))[_0x6df9('0x54')](handleError(_0x132c40,null));};exports[_0x6df9('0x55')]=function(_0x31d089,_0x43c276){return db[_0x6df9('0x28')]['create'](_0x31d089[_0x6df9('0x56')],{})[_0x6df9('0x21')](respondWithResult(_0x43c276,0xc9))['catch'](handleError(_0x43c276,null));};exports[_0x6df9('0x20')]=function(_0xe6329f,_0x12dd10){if(_0xe6329f[_0x6df9('0x56')]['id']){delete _0xe6329f[_0x6df9('0x56')]['id'];}return db[_0x6df9('0x28')][_0x6df9('0x53')]({'where':{'id':_0xe6329f[_0x6df9('0x50')]['id']}})['then'](handleEntityNotFound(_0x12dd10,null))[_0x6df9('0x21')](saveUpdates(_0xe6329f[_0x6df9('0x56')],null))['then'](respondWithResult(_0x12dd10,null))['catch'](handleError(_0x12dd10,null));};exports[_0x6df9('0x57')]=function(_0x16d09e,_0xd3ce3f){return db[_0x6df9('0x28')][_0x6df9('0x57')]()[_0x6df9('0x21')](respondWithResult(_0xd3ce3f,null))[_0x6df9('0x54')](handleError(_0xd3ce3f,null));};exports['destroy']=function(_0x8b0be,_0x487b63){var _0x29f309;return db['CmHopper'][_0x6df9('0x53')]({'where':{'id':_0x8b0be['params']['id']}})['then'](handleEntityNotFound(_0x487b63,null))['then'](function(_0x3a7271){if(_0x3a7271){return _0x3a7271[_0x6df9('0x22')]()['then'](function(_0x573d5e){return _0x573d5e;});}})[_0x6df9('0x21')](function(_0x2adcc6){_0x29f309=_0x2adcc6;if(_0x2adcc6){if(_0x2adcc6['VoiceQueueId']||_0x2adcc6[_0x6df9('0x58')]){return db[_0x2adcc6['VoiceQueueId']?_0x6df9('0x59'):_0x6df9('0x5a')]['find']({'where':{'id':_0x2adcc6[_0x6df9('0x5b')]?_0x2adcc6[_0x6df9('0x5b')]:_0x2adcc6[_0x6df9('0x58')]},'attributes':['id',_0x6df9('0x24')],'raw':!![]});}}})[_0x6df9('0x21')](function(_0x5b7cff){var _0x109a9a={};if(_0x5b7cff){_[_0x6df9('0x4a')](_0x109a9a,_[_0x6df9('0x5c')](_0x29f309[_0x6df9('0x5d')],[_0x6df9('0x5e'),_0x6df9('0x5f'),'id']));_0x109a9a[_0x6df9('0x60')]=0x15;_0x109a9a['statedesc']=_0x6df9('0x61');_0x109a9a[_0x6df9('0x62')]=_0x5b7cff[_0x6df9('0x24')];_0x109a9a[_0x6df9('0x63')]=_0x8b0be[_0x6df9('0x64')][_0x6df9('0x24')];_0x109a9a[_0x6df9('0x65')]=_0x8b0be[_0x6df9('0x64')]['id'];_0x109a9a[_0x6df9('0x61')]=!![];_0x109a9a[_0x6df9('0x66')]=moment()[_0x6df9('0x67')](_0x6df9('0x68'));_0x109a9a[_0x6df9('0x69')]=_0x29f309[_0x6df9('0x6a')];_0x109a9a[_0x6df9('0x6b')]=_0x29f309[_0x6df9('0x5b')]?_0x6df9('0x6c'):_0x6df9('0x6d');return db[_0x6df9('0x6e')][_0x6df9('0x53')]({'where':{'id':_0x109a9a['ContactId']},'attributes':[_0x6df9('0x6f'),_0x6df9('0x70')]})[_0x6df9('0x21')](function(_0x49c5de){if(!_[_0x6df9('0x71')](_0x487b63)&&!_[_0x6df9('0x71')](_0x49c5de[_0x6df9('0x6f')])){_0x109a9a[_0x6df9('0x72')]=_0x49c5de[_0x6df9('0x6f')];if(!_[_0x6df9('0x71')](_0x49c5de[_0x6df9('0x70')])){_0x109a9a['calleridname']+='\x20'+_0x49c5de['lastName'];}}})['finally'](function(){return db['CmHopperFinal'][_0x6df9('0x55')](_0x109a9a);});}})['then'](function(){return _0x487b63[_0x6df9('0x18')](0xcc)['end']();})[_0x6df9('0x54')](handleError(_0x487b63,null));};exports[_0x6df9('0x73')]=function(_0x34c7ee,_0x240141,_0x38e447){var _0x18a073=[];return db['CmContact'][_0x6df9('0x57')]()[_0x6df9('0x21')](function(_0x2001e3){_0x18a073=_[_0x6df9('0x2b')](_0x2001e3);return _0x34c7ee[_0x6df9('0x64')][_0x6df9('0x74')]({'where':{'type':_0x6df9('0x75'),'dialActive':!![],'dialMethod':_0x6df9('0x76')},'attributes':['id',_0x6df9('0x77'),_0x6df9('0x78')],'raw':!![]});})[_0x6df9('0x21')](function(_0xca471d){if(_0xca471d&&_0xca471d[_0x6df9('0x43')]){return db['sequelize'][_0x6df9('0x79')](function(_0x4e3efc){var _0xff74d3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x6df9('0x68'))},'VoiceQueueId':{'$in':_[_0x6df9('0x27')](_0xca471d,'id')},'$or':[{'UserId':null},{'UserId':_0x34c7ee[_0x6df9('0x64')]['id']}]};var _0x2abe78={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xca471d)[_0x6df9('0x49')]([_0x6df9('0x78'),0x0])[_0x6df9('0x27')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x34c7ee[_0x6df9('0x64')]['id']}]};var _0x4688f8={'$or':[_0xff74d3,_0x2abe78]};var _0x3b4c31=[];if(_0x34c7ee[_0x6df9('0x56')]['direction']&&_0x34c7ee[_0x6df9('0x56')][_0x6df9('0x7a')]===_0x6df9('0x7b')){if(!_[_0x6df9('0x7c')](_0x34c7ee[_0x6df9('0x56')][_0x6df9('0x7d')])){_0x4688f8['id']={'$in':_0x34c7ee[_0x6df9('0x56')][_0x6df9('0x7d')]};}_0x3b4c31=[['priority',_0x6df9('0x7e')],['scheduledAt',_0xca471d[0x0][_0x6df9('0x77')]===_0x6df9('0x7e')?_0x6df9('0x7f'):_0x6df9('0x7e')],db[_0x6df9('0x80')][_0x6df9('0x81')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x6df9('0x7f')]];}else{if(!_[_0x6df9('0x7c')](_0x34c7ee['body'][_0x6df9('0x7d')])){_0x4688f8['id']={'$notIn':_0x34c7ee['body'][_0x6df9('0x7d')]};}_0x3b4c31=[['priority',_0x6df9('0x7f')],['scheduledAt',_0xca471d[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0x6df9('0x81')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x6df9('0x7e')]];}return db[_0x6df9('0x28')][_0x6df9('0x82')]({'attributes':['id','scheduledat',_0x6df9('0x83')],'where':_0x4688f8,'order':_0x3b4c31,'transaction':_0x4e3efc,'lock':_0x4e3efc[_0x6df9('0x84')][_0x6df9('0x85')],'include':[{'model':db[_0x6df9('0x6e')],'as':_0x6df9('0x86'),'attributes':_0x18a073,'include':[{'model':db[_0x6df9('0x87')],'as':_0x6df9('0x88'),'attributes':['id',_0x6df9('0x24')]}]},{'model':db[_0x6df9('0x89')],'as':_0x6df9('0x8a'),'attributes':['id',_0x6df9('0x24')]},{'model':db[_0x6df9('0x59')],'as':'Queue','attributes':['id',_0x6df9('0x24'),_0x6df9('0x8b')]}]})[_0x6df9('0x21')](function(_0xe5f39){if(_0xe5f39){return _0xe5f39['update']({'UserId':_0x34c7ee[_0x6df9('0x64')]['id']},{'transaction':_0x4e3efc});}});});}})[_0x6df9('0x21')](handleEntityNotFound(_0x240141,null))[_0x6df9('0x21')](respondWithResult(_0x240141,null))[_0x6df9('0x54')](handleError(_0x240141,null));};exports['getPreviewRecall']=function(_0x39a1d5,_0x5e9971,_0x33cbb3){var _0x4174e0=[];return db[_0x6df9('0x6e')][_0x6df9('0x57')]()[_0x6df9('0x21')](function(_0x8af626){_0x4174e0=_[_0x6df9('0x2b')](_0x8af626);return _0x39a1d5[_0x6df9('0x64')][_0x6df9('0x74')]({'where':{'type':_0x6df9('0x75'),'dialActive':!![],'dialMethod':_0x6df9('0x76')},'attributes':['id',_0x6df9('0x77'),_0x6df9('0x78')],'raw':!![]});})[_0x6df9('0x21')](function(_0x19771e){if(_0x19771e&&_0x19771e[_0x6df9('0x43')]){return db['sequelize']['transaction'](function(_0xd3cad4){var _0x712f2b={'active':![],'recallme':!![],'id':_0x39a1d5[_0x6df9('0x56')][_0x6df9('0x8c')]};return db['CmHopper']['findOne']({'attributes':['id',_0x6df9('0x8d'),'recallme'],'where':_0x712f2b,'transaction':_0xd3cad4,'lock':_0xd3cad4[_0x6df9('0x84')][_0x6df9('0x85')],'include':[{'model':db[_0x6df9('0x6e')],'as':'Contact','attributes':_0x4174e0,'include':[{'model':db[_0x6df9('0x87')],'as':_0x6df9('0x88'),'attributes':['id',_0x6df9('0x24')]}]},{'model':db[_0x6df9('0x89')],'as':_0x6df9('0x8a'),'attributes':['id',_0x6df9('0x24')]},{'model':db['VoiceQueue'],'as':_0x6df9('0x8e'),'attributes':['id','name','dialActive']}]})[_0x6df9('0x21')](function(_0x2c2008){if(_0x2c2008){return _0x2c2008[_0x6df9('0x20')]({'UserId':_0x39a1d5[_0x6df9('0x64')]['id']},{'transaction':_0xd3cad4});}});});}})[_0x6df9('0x21')](handleEntityNotFound(_0x5e9971,null))[_0x6df9('0x21')](respondWithResult(_0x5e9971,null))[_0x6df9('0x54')](handleError(_0x5e9971,null));};exports['getOpenContacts']=function(_0x44ac0f,_0x2c980a,_0x3f7711){return _0x44ac0f['user'][_0x6df9('0x74')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x6df9('0x76')},'attributes':['id'],'raw':!![]})[_0x6df9('0x21')](function(_0x36cdf5){if(_0x36cdf5&&_0x36cdf5['length']){return db['CmHopper'][_0x6df9('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6df9('0x67')](_0x6df9('0x68'))},'VoiceQueueId':{'$in':_[_0x6df9('0x27')](_0x36cdf5,'id')},'$or':[{'UserId':null},{'UserId':_0x44ac0f['user']['id']}]}});}return 0x0;})['then'](function(_0x30afcc){if(!_[_0x6df9('0x71')](_0x30afcc)&&_['isNumber'](_0x30afcc)){return _0x2c980a[_0x6df9('0x18')](0xc8)['json']({'contacts':_0x30afcc});}else{logger[_0x6df9('0x23')](_0x6df9('0x8f'),_0x6df9('0x90'),0x194,_0x6df9('0x91'));_0x2c980a[_0x6df9('0x17')](0x194);}})[_0x6df9('0x54')](handleError(_0x2c980a,null));};exports[_0x6df9('0x92')]=function(_0x2c2c5b,_0x54aa08,_0x286cb3){var _0x726ec1=shared[_0x6df9('0x93')];var _0x4a1b09=[];_[_0x6df9('0x27')](_0x726ec1,function(_0x5012e6){_0x4a1b09[_0x6df9('0x94')]({'id':_0x5012e6['name'],'name':_0x5012e6['name'],'utcOffset':_0x5012e6[_0x6df9('0x95')]});});return _0x54aa08['status'](0xc8)[_0x6df9('0x1a')]({'tz':_0x4a1b09});};exports[_0x6df9('0x96')]=function(_0x23c756,_0x4a51ad,_0x385855){var _0xe627c5=shared['timezones'];var _0x418fcf={};if(!_[_0x6df9('0x71')](_0xe627c5[_0x23c756['body']['id']]))_0x418fcf=_0xe627c5[_0x23c756[_0x6df9('0x56')]['id']];return _0x4a51ad[_0x6df9('0x18')](0xc8)[_0x6df9('0x1a')](_0x418fcf);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 84cc996..e0b5b4b 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 _0x4819=['request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0x39338d,_0x19b64b){var _0x273a6a=function(_0x15a7bf){while(--_0x15a7bf){_0x39338d['push'](_0x39338d['shift']());}};_0x273a6a(++_0x19b64b);}(_0x4819,0xcd));var _0x9481=function(_0x70dc3f,_0xfc371b){_0x70dc3f=_0x70dc3f-0x0;var _0x447aa4=_0x4819[_0x70dc3f];return _0x447aa4;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[{'name':_0x9481('0xc'),'fields':[_0x9481('0xc')]},{'name':_0x9481('0xd'),'fields':['phone']},{'name':_0x9481('0xe'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper'];(function(_0x57a466,_0x433a2e){var _0x1fc3f7=function(_0x1f87eb){while(--_0x1f87eb){_0x57a466['push'](_0x57a466['shift']());}};_0x1fc3f7(++_0x433a2e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x5fc3[_0x3d42d8];return _0x27fc41;};'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')]('CmHopper',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]},{'name':_0x35fc('0xd'),'fields':[_0x35fc('0xd')]},{'name':_0x35fc('0xe'),'fields':[_0x35fc('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index bca2432..729998f 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 _0xaaf0=['UpdateCmHopper','update','DestroyCmHopper','destroy','CmContact','describe','LOCK','Contact','keys','User','name','voicePause','length','UserId','push','all','GetContactDialer','dataValues','ContactId','active','sequelize','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','literal','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','transaction','UPDATE','GetCmHopperPreview','findOne','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','Agent','CmList','List','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','ShowCmHopper','find','debug','CreateCmHopper','create','body','then'];(function(_0x2c84e5,_0x58a7c7){var _0x4990ec=function(_0x5b02b0){while(--_0x5b02b0){_0x2c84e5['push'](_0x2c84e5['shift']());}};_0x4990ec(++_0x58a7c7);}(_0xaaf0,0x1c7));var _0x0aaf=function(_0x11c510,_0x37ecc3){_0x11c510=_0x11c510-0x0;var _0x2f23a8=_0xaaf0[_0x11c510];return _0x2f23a8;};'use strict';var _=require('lodash');var util=require(_0x0aaf('0x0'));var moment=require(_0x0aaf('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0aaf('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0aaf('0x3'));var logger=require('../../config/logger')(_0x0aaf('0x4'));var config=require(_0x0aaf('0x5'));var jayson=require(_0x0aaf('0x6'));const {validateExpressRequest}=require('twilio/lib/webhooks/webhooks');var client=jayson[_0x0aaf('0x7')][_0x0aaf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x326b60,_0x39b561,_0x277bf7){return new BPromise(function(_0x242285,_0x25077e){return client['request'](_0x326b60,_0x277bf7)['then'](function(_0x2dc152){logger[_0x0aaf('0x9')](_0x0aaf('0xa'),_0x39b561,_0x0aaf('0xb'));logger['debug'](_0x0aaf('0xc'),_0x39b561,_0x0aaf('0xb'),JSON[_0x0aaf('0xd')](_0x2dc152));if(_0x2dc152[_0x0aaf('0xe')]){if(_0x2dc152[_0x0aaf('0xe')][_0x0aaf('0xf')]===0x1f4){logger[_0x0aaf('0xe')](_0x0aaf('0xa'),_0x39b561,_0x2dc152[_0x0aaf('0xe')][_0x0aaf('0x10')]);return _0x25077e(_0x2dc152[_0x0aaf('0xe')][_0x0aaf('0x10')]);}logger[_0x0aaf('0xe')](_0x0aaf('0xa'),_0x39b561,_0x2dc152[_0x0aaf('0xe')][_0x0aaf('0x10')]);return _0x242285(_0x2dc152['error'][_0x0aaf('0x10')]);}else{logger[_0x0aaf('0x9')](_0x0aaf('0xa'),_0x39b561,_0x0aaf('0xb'));_0x242285(_0x2dc152[_0x0aaf('0x11')][_0x0aaf('0x10')]);}})[_0x0aaf('0x12')](function(_0x37da6d){logger['error'](_0x0aaf('0xa'),_0x39b561,_0x37da6d);_0x25077e(_0x37da6d);});});}exports[_0x0aaf('0x13')]=function(_0x24f459){var _0x3e7700=this;return new Promise(function(_0x1fb7a2,_0xedafc8){return db[_0x0aaf('0x14')][_0x0aaf('0x15')]({'raw':_0x24f459['options']?_0x24f459[_0x0aaf('0x16')][_0x0aaf('0x17')]===undefined?!![]:![]:!![],'where':_0x24f459[_0x0aaf('0x16')]?_0x24f459[_0x0aaf('0x16')][_0x0aaf('0x18')]||null:null,'attributes':_0x24f459[_0x0aaf('0x16')]?_0x24f459['options'][_0x0aaf('0x19')]||null:null,'limit':_0x24f459[_0x0aaf('0x16')]?_0x24f459[_0x0aaf('0x16')][_0x0aaf('0x1a')]||null:null,'include':_0x24f459[_0x0aaf('0x16')]?_0x24f459[_0x0aaf('0x16')][_0x0aaf('0x1b')]?_[_0x0aaf('0x1c')](_0x24f459['options'][_0x0aaf('0x1b')],function(_0x2a4979){return{'model':db[_0x2a4979['model']],'as':_0x2a4979['as'],'attributes':_0x2a4979[_0x0aaf('0x19')],'include':_0x2a4979[_0x0aaf('0x1b')]?_['map'](_0x2a4979['include'],function(_0x37c9e1){return{'model':db[_0x37c9e1[_0x0aaf('0x1d')]],'as':_0x37c9e1['as'],'attributes':_0x37c9e1['attributes'],'include':_0x37c9e1[_0x0aaf('0x1b')]?_[_0x0aaf('0x1c')](_0x37c9e1['include'],function(_0x3cbf60){return{'model':db[_0x3cbf60[_0x0aaf('0x1d')]],'as':_0x3cbf60['as'],'attributes':_0x3cbf60['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d92e2){logger[_0x0aaf('0x9')](_0x0aaf('0x13'),_0x24f459);logger['debug'](_0x0aaf('0x13'),_0x24f459,JSON[_0x0aaf('0xd')](_0x3d92e2));_0x1fb7a2(_0x3d92e2);})['catch'](function(_0x467c85){logger[_0x0aaf('0xe')](_0x0aaf('0x13'),_0x467c85['message'],_0x24f459);_0xedafc8(_0x3e7700[_0x0aaf('0xe')](0x1f4,_0x467c85[_0x0aaf('0x10')]));});});};exports[_0x0aaf('0x1e')]=function(_0x10d2e5){var _0x1f4cd2=this;return new Promise(function(_0x32709d,_0x44dc45){return db[_0x0aaf('0x14')][_0x0aaf('0x1f')]({'raw':_0x10d2e5[_0x0aaf('0x16')]?_0x10d2e5[_0x0aaf('0x16')][_0x0aaf('0x17')]===undefined?!![]:![]:!![],'where':_0x10d2e5[_0x0aaf('0x16')]?_0x10d2e5[_0x0aaf('0x16')]['where']||null:null,'attributes':_0x10d2e5[_0x0aaf('0x16')]?_0x10d2e5[_0x0aaf('0x16')][_0x0aaf('0x19')]||null:null,'include':_0x10d2e5[_0x0aaf('0x16')]?_0x10d2e5['options'][_0x0aaf('0x1b')]?_[_0x0aaf('0x1c')](_0x10d2e5['options'][_0x0aaf('0x1b')],function(_0x1b3beb){return{'model':db[_0x1b3beb[_0x0aaf('0x1d')]],'as':_0x1b3beb['as'],'attributes':_0x1b3beb[_0x0aaf('0x19')],'include':_0x1b3beb[_0x0aaf('0x1b')]?_[_0x0aaf('0x1c')](_0x1b3beb[_0x0aaf('0x1b')],function(_0x3a49da){return{'model':db[_0x3a49da['model']],'as':_0x3a49da['as'],'attributes':_0x3a49da['attributes'],'include':_0x3a49da[_0x0aaf('0x1b')]?_[_0x0aaf('0x1c')](_0x3a49da[_0x0aaf('0x1b')],function(_0x2f3643){return{'model':db[_0x2f3643[_0x0aaf('0x1d')]],'as':_0x2f3643['as'],'attributes':_0x2f3643[_0x0aaf('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34510a){logger['info'](_0x0aaf('0x1e'),_0x10d2e5);logger[_0x0aaf('0x20')]('ShowCmHopper',_0x10d2e5,JSON['stringify'](_0x34510a));_0x32709d(_0x34510a);})[_0x0aaf('0x12')](function(_0x218c4b){logger[_0x0aaf('0xe')](_0x0aaf('0x1e'),_0x218c4b[_0x0aaf('0x10')],_0x10d2e5);_0x44dc45(_0x1f4cd2[_0x0aaf('0xe')](0x1f4,_0x218c4b[_0x0aaf('0x10')]));});});};exports[_0x0aaf('0x21')]=function(_0x1cac8d){var _0x1b9139=this;return new Promise(function(_0x22c7da,_0x1f8222){return db[_0x0aaf('0x14')][_0x0aaf('0x22')](_0x1cac8d[_0x0aaf('0x23')],{'raw':_0x1cac8d['options']?_0x1cac8d[_0x0aaf('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x0aaf('0x24')](function(_0x4fc7c0){logger[_0x0aaf('0x9')](_0x0aaf('0x21'),_0x1cac8d);logger['debug'](_0x0aaf('0x21'),_0x1cac8d,JSON[_0x0aaf('0xd')](_0x4fc7c0));_0x22c7da(_0x4fc7c0);})['catch'](function(_0x49f589){logger[_0x0aaf('0xe')](_0x0aaf('0x21'),_0x49f589[_0x0aaf('0x10')],_0x1cac8d);_0x1f8222(_0x1b9139['error'](0x1f4,_0x49f589[_0x0aaf('0x10')]));});});};exports[_0x0aaf('0x25')]=function(_0x34141b){var _0x4ed8c7=this;return new Promise(function(_0x4f265c,_0x4bbc43){return db[_0x0aaf('0x14')][_0x0aaf('0x26')](_0x34141b[_0x0aaf('0x23')],{'raw':_0x34141b[_0x0aaf('0x16')]?_0x34141b[_0x0aaf('0x16')][_0x0aaf('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34141b[_0x0aaf('0x16')]?_0x34141b[_0x0aaf('0x16')][_0x0aaf('0x18')]||null:null,'attributes':_0x34141b[_0x0aaf('0x16')]?_0x34141b[_0x0aaf('0x16')][_0x0aaf('0x19')]||null:null,'limit':_0x34141b['options']?_0x34141b[_0x0aaf('0x16')][_0x0aaf('0x1a')]||null:null})[_0x0aaf('0x24')](function(_0x1bc6cc){logger['info'](_0x0aaf('0x25'),_0x34141b);logger[_0x0aaf('0x9')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x0aaf('0xd')](_0x34141b[_0x0aaf('0x16')]['where']),_0x34141b[_0x0aaf('0x23')]['active']);logger['debug'](_0x0aaf('0x25'),_0x34141b,JSON['stringify'](_0x1bc6cc));_0x4f265c(_0x1bc6cc);})[_0x0aaf('0x12')](function(_0x2fcd82){logger[_0x0aaf('0xe')](_0x0aaf('0x25'),_0x2fcd82[_0x0aaf('0x10')],_0x34141b);_0x4bbc43(_0x4ed8c7[_0x0aaf('0xe')](0x1f4,_0x2fcd82['message']));});});};exports[_0x0aaf('0x27')]=function(_0x151c69){var _0x93daee=this;return new Promise(function(_0x52cd4c,_0xc05578){return db[_0x0aaf('0x14')][_0x0aaf('0x28')]({'where':_0x151c69[_0x0aaf('0x16')]?_0x151c69[_0x0aaf('0x16')][_0x0aaf('0x18')]||null:null})['then'](function(_0x5d39d8){logger[_0x0aaf('0x9')](_0x0aaf('0x27'),_0x151c69);logger[_0x0aaf('0x20')](_0x0aaf('0x27'),_0x151c69,JSON[_0x0aaf('0xd')](_0x5d39d8));_0x52cd4c(_0x5d39d8);})['catch'](function(_0x51df9a){logger[_0x0aaf('0xe')](_0x0aaf('0x27'),_0x51df9a[_0x0aaf('0x10')],_0x151c69);_0xc05578(_0x93daee[_0x0aaf('0xe')](0x1f4,_0x51df9a[_0x0aaf('0x10')]));});});};exports['GetContactDialer']=function(_0x170b80){var _0x590ee6=this;return new Promise(function(_0x3a068b,_0x48ba06){return db[_0x0aaf('0x29')][_0x0aaf('0x2a')]()[_0x0aaf('0x24')](function(_0x20d67d){return db['sequelize']['transaction'](function(_0x3646fb){return db[_0x0aaf('0x14')]['findAll']({'where':_0x170b80[_0x0aaf('0x16')]?_0x170b80[_0x0aaf('0x16')][_0x0aaf('0x18')]||null:null,'attributes':_0x170b80[_0x0aaf('0x16')]?_0x170b80[_0x0aaf('0x16')][_0x0aaf('0x19')]||null:null,'limit':_0x170b80[_0x0aaf('0x16')]?_0x170b80[_0x0aaf('0x16')][_0x0aaf('0x1a')]||null:null,'order':_0x170b80['options']?_0x170b80[_0x0aaf('0x16')]['order']||null:null,'transaction':_0x3646fb,'lock':_0x3646fb[_0x0aaf('0x2b')]['UPDATE'],'include':[{'model':db[_0x0aaf('0x29')],'as':_0x0aaf('0x2c'),'attributes':_[_0x0aaf('0x2d')](_0x20d67d)},{'model':db[_0x0aaf('0x2e')],'as':'Agent','attributes':['id',_0x0aaf('0x2f'),_0x0aaf('0x30')]}]})[_0x0aaf('0x24')](function(_0x1b89e8){var _0x43c74f=[];var _0x539638=[];for(var _0x96bfc9=0x0;_0x96bfc9<_0x1b89e8[_0x0aaf('0x31')];_0x96bfc9+=0x1){var _0x17f591=_0x1b89e8[_0x96bfc9][_0x0aaf('0x32')];if(_0x17f591===null){_0x43c74f[_0x0aaf('0x33')](_0x1b89e8[_0x96bfc9]['update'](_0x170b80[_0x0aaf('0x23')],{'transaction':_0x3646fb}));}else if(!_0x539638['includes'](_0x17f591)){_0x539638[_0x0aaf('0x33')](_0x17f591);_0x43c74f[_0x0aaf('0x33')](_0x1b89e8[_0x96bfc9][_0x0aaf('0x26')](_0x170b80[_0x0aaf('0x23')],{'transaction':_0x3646fb}));}}return BPromise[_0x0aaf('0x34')](_0x43c74f);});})[_0x0aaf('0x24')](function(_0x35b406){logger[_0x0aaf('0x9')](_0x0aaf('0x35'),_0x170b80);if(_0x35b406[_0x0aaf('0x31')]>0x0){logger['info']('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x35b406[0x0][_0x0aaf('0x36')]['id'],_0x35b406[0x0][_0x0aaf('0x36')][_0x0aaf('0x37')],_0x35b406[0x0][_0x0aaf('0x36')][_0x0aaf('0x38')]);}logger[_0x0aaf('0x20')]('GetContactDialer',_0x170b80,JSON[_0x0aaf('0xd')](_0x35b406));_0x3a068b(_0x35b406);})['catch'](function(_0x57d9d3){logger[_0x0aaf('0xe')](_0x0aaf('0x35'),_0x57d9d3[_0x0aaf('0x10')],_0x170b80);_0x48ba06(_0x590ee6['error'](0x1f4,_0x57d9d3[_0x0aaf('0x10')]));});});});};exports['MoveContactManagedDialer']=function(_0x56fe32){var _0x338f67=this;return new Promise(function(_0xfa2f75,_0x2b56be){return db[_0x0aaf('0x39')]['transaction'](function(_0x4ffb8b){return db[_0x0aaf('0x3a')][_0x0aaf('0x22')](_0x56fe32['body'],{'raw':_0x56fe32['options']?_0x56fe32[_0x0aaf('0x16')]['raw']===undefined?!![]:![]:!![],'transaction':_0x4ffb8b})[_0x0aaf('0x24')](function(){logger[_0x0aaf('0x9')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x0aaf('0xd')](_0x56fe32[_0x0aaf('0x16')]['where']),_0x56fe32[_0x0aaf('0x16')][_0x0aaf('0x18')]['active']);return db['CmHopper']['destroy']({'where':_0x56fe32[_0x0aaf('0x16')]?_0x56fe32[_0x0aaf('0x16')]['where']||null:null,'transaction':_0x4ffb8b});});})[_0x0aaf('0x24')](function(_0x48c6e8){logger[_0x0aaf('0x9')]('MoveContactManagedDialer',_0x56fe32);logger[_0x0aaf('0x20')](_0x0aaf('0x3b'),_0x56fe32,JSON[_0x0aaf('0xd')](_0x48c6e8));_0xfa2f75(_0x48c6e8);})['catch'](function(_0x961ab6){logger[_0x0aaf('0xe')](_0x0aaf('0x3b'),_0x961ab6['message'],_0x56fe32);_0x2b56be(_0x338f67['error'](0x1f4,_0x961ab6[_0x0aaf('0x10')]));});});};exports[_0x0aaf('0x3c')]=function(_0x23cc12){var _0x15a5ce=this;return new Promise(function(_0x27d966,_0x3179f3){return db[_0x0aaf('0x14')][_0x0aaf('0x15')]({'raw':_0x23cc12[_0x0aaf('0x16')]?_0x23cc12['options'][_0x0aaf('0x17')]===undefined?!![]:![]:!![],'where':_0x23cc12[_0x0aaf('0x16')]?_0x23cc12['options'][_0x0aaf('0x18')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x0aaf('0x39')]['fn']('IF',db[_0x0aaf('0x39')][_0x0aaf('0x3d')]('`scheduledat`\x20>=\x20'+util[_0x0aaf('0x3e')]('\x22%s\x22',moment()[_0x0aaf('0x3e')](_0x0aaf('0x3f')))+_0x0aaf('0x40')))),_0x0aaf('0x41')]]})['then'](function(_0x40f6a9){logger[_0x0aaf('0x9')](_0x0aaf('0x3c'),_0x23cc12);logger[_0x0aaf('0x20')](_0x0aaf('0x3c'),_0x23cc12,JSON['stringify'](_0x40f6a9));_0x27d966(_0x40f6a9);})[_0x0aaf('0x12')](function(_0x140848){logger[_0x0aaf('0xe')](_0x0aaf('0x3c'),_0x140848['message'],_0x23cc12);_0x3179f3(_0x15a5ce['error'](0x1f4,_0x140848[_0x0aaf('0x10')]));});});};exports[_0x0aaf('0x42')]=function(_0x58259b){var _0x3edda0=this;return new Promise(function(_0x271615,_0x2959b5){return db[_0x0aaf('0x29')][_0x0aaf('0x2a')]()[_0x0aaf('0x24')](function(_0x566d8c){return db[_0x0aaf('0x39')][_0x0aaf('0x43')](function(_0x310592){return db[_0x0aaf('0x14')][_0x0aaf('0x15')]({'where':_0x58259b['options']?_0x58259b['options'][_0x0aaf('0x18')]||null:null,'attributes':_0x58259b[_0x0aaf('0x16')]?_0x58259b['options'][_0x0aaf('0x19')]||null:null,'limit':0x1,'order':_0x58259b[_0x0aaf('0x16')]?_0x58259b[_0x0aaf('0x16')]['order']||null:null,'group':db['CmHopper'][_0x0aaf('0x32')],'transaction':_0x310592,'lock':_0x310592[_0x0aaf('0x2b')][_0x0aaf('0x44')],'include':_0x58259b[_0x0aaf('0x16')]?_0x58259b[_0x0aaf('0x16')][_0x0aaf('0x1b')]?_[_0x0aaf('0x1c')](_0x58259b[_0x0aaf('0x16')][_0x0aaf('0x1b')],function(_0x43d58f){return{'model':db[_0x43d58f[_0x0aaf('0x1d')]],'as':_0x43d58f['as'],'attributes':_0x43d58f[_0x0aaf('0x19')],'include':_0x43d58f[_0x0aaf('0x1b')]?_[_0x0aaf('0x1c')](_0x43d58f['include'],function(_0x36cccc){return{'model':db[_0x36cccc[_0x0aaf('0x1d')]],'as':_0x36cccc['as'],'attributes':_0x36cccc[_0x0aaf('0x19')],'include':_0x36cccc[_0x0aaf('0x1b')]?_[_0x0aaf('0x1c')](_0x36cccc['include'],function(_0x40a1c2){return{'model':db[_0x40a1c2[_0x0aaf('0x1d')]],'as':_0x40a1c2['as'],'attributes':_0x40a1c2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e7147){var _0x173b3b=[];for(var _0x5ceb9f=0x0;_0x5ceb9f<_0x2e7147['length'];_0x5ceb9f+=0x1){_0x173b3b['push'](_0x2e7147[_0x5ceb9f][_0x0aaf('0x26')](_0x58259b['body'],{'transaction':_0x310592}));}return BPromise['all'](_0x173b3b);});})[_0x0aaf('0x24')](function(_0xd02f9d){logger[_0x0aaf('0x9')](_0x0aaf('0x42'),_0x58259b);logger[_0x0aaf('0x20')](_0x0aaf('0x42'),_0x58259b,JSON['stringify'](_0xd02f9d));_0x271615(_0xd02f9d);})[_0x0aaf('0x12')](function(_0x2f9604){logger[_0x0aaf('0xe')](_0x0aaf('0x42'),_0x2f9604[_0x0aaf('0x10')],_0x58259b);_0x2959b5(_0x3edda0[_0x0aaf('0xe')](0x1f4,_0x2f9604[_0x0aaf('0x10')]));});});});};exports[_0x0aaf('0x45')]=function(_0x3a9ab6){var _0x45c458=this;return new Promise(function(_0x4afecd,_0x53eb2c){db[_0x0aaf('0x29')][_0x0aaf('0x2a')]()[_0x0aaf('0x24')](function(_0x189be7){return db[_0x0aaf('0x14')][_0x0aaf('0x15')]({'raw':_0x3a9ab6[_0x0aaf('0x16')]?_0x3a9ab6[_0x0aaf('0x16')][_0x0aaf('0x17')]===undefined?!![]:![]:!![],'where':_0x3a9ab6['options']?_0x3a9ab6[_0x0aaf('0x16')]['where']||null:null,'attributes':_0x3a9ab6[_0x0aaf('0x16')]?_0x3a9ab6[_0x0aaf('0x16')][_0x0aaf('0x19')]||null:null,'limit':_0x3a9ab6[_0x0aaf('0x16')]?_0x3a9ab6[_0x0aaf('0x16')]['limit']||null:null,'include':_0x3a9ab6['options']?_0x3a9ab6['options'][_0x0aaf('0x1b')]?_[_0x0aaf('0x1c')](_0x3a9ab6[_0x0aaf('0x16')][_0x0aaf('0x1b')],function(_0x353721){return{'model':db[_0x353721[_0x0aaf('0x1d')]],'as':_0x353721['as'],'attributes':_0x353721['as']===_0x0aaf('0x2c')?_['keys'](_0x189be7):_0x353721[_0x0aaf('0x19')],'include':_0x353721['include']?_[_0x0aaf('0x1c')](_0x353721[_0x0aaf('0x1b')],function(_0x4e52e7){return{'model':db[_0x4e52e7[_0x0aaf('0x1d')]],'as':_0x4e52e7['as'],'attributes':_0x4e52e7[_0x0aaf('0x19')],'include':_0x4e52e7[_0x0aaf('0x1b')]?_[_0x0aaf('0x1c')](_0x4e52e7[_0x0aaf('0x1b')],function(_0x1c84c0){return{'model':db[_0x1c84c0[_0x0aaf('0x1d')]],'as':_0x1c84c0['as'],'attributes':_0x1c84c0[_0x0aaf('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0aaf('0x24')](function(_0x4d1e62){logger[_0x0aaf('0x9')](_0x0aaf('0x13'),_0x3a9ab6);logger[_0x0aaf('0x20')](_0x0aaf('0x13'),_0x3a9ab6,JSON[_0x0aaf('0xd')](_0x4d1e62));_0x4afecd(_0x4d1e62);})[_0x0aaf('0x12')](function(_0x47430c){logger[_0x0aaf('0xe')](_0x0aaf('0x13'),_0x47430c[_0x0aaf('0x10')],_0x3a9ab6);_0x53eb2c(_0x45c458[_0x0aaf('0xe')](0x1f4,_0x47430c[_0x0aaf('0x10')]));});});});};exports['GetContactByPhone']=function(_0x5cc925){var _0x4a706a=this;return new Promise(function(_0x55d807,_0xa88552){return db[_0x0aaf('0x29')][_0x0aaf('0x46')]({'raw':!![],'where':{'phone':_0x5cc925[_0x0aaf('0x16')][_0x0aaf('0x18')]['phone']},'attributes':['id','dialTimezone'],'order':[['id',_0x0aaf('0x47')]]})[_0x0aaf('0x24')](function(_0x420450){logger[_0x0aaf('0x9')](_0x0aaf('0x48'),_0x5cc925);logger['debug'](_0x0aaf('0x48'),_0x5cc925,JSON['stringify'](_0x420450));_0x55d807(_0x420450);})[_0x0aaf('0x12')](function(_0x50b4c6){logger[_0x0aaf('0xe')](_0x0aaf('0x48'),_0x50b4c6['message'],_0x5cc925);_0xa88552(_0x4a706a[_0x0aaf('0xe')](0x1f4,_0x50b4c6[_0x0aaf('0x10')]));});});};exports['ResetActiveCalls']=function(_0x5f0c36){var _0xb94c04=this;return new Promise(function(_0x1d89f9,_0x554bdd){return db[_0x0aaf('0x39')][_0x0aaf('0x43')](function(_0x42f694){return db[_0x0aaf('0x14')][_0x0aaf('0x26')]({'active':![]},{'where':{},'transaction':_0x42f694})[_0x0aaf('0x24')](function(_0x15213f){logger[_0x0aaf('0x9')]('ResetActiveCalls',_0x5f0c36);logger[_0x0aaf('0x20')](_0x0aaf('0x49'),_0x5f0c36,JSON['stringify'](_0x15213f));_0x1d89f9(_0x15213f);})[_0x0aaf('0x12')](function(_0x1a88d4){logger['error'](_0x0aaf('0x49'),_0x1a88d4[_0x0aaf('0x10')],_0x5f0c36);_0x554bdd(_0xb94c04['error'](0x1f4,_0x1a88d4[_0x0aaf('0x10')]));});});});};exports[_0x0aaf('0x4a')]=function(_0xe850b3){var _0x4bbe7a=this;var _0x2d0a7a=_0xe850b3['body'][_0x0aaf('0x18')][_0x0aaf('0x4b')];var _0x323b0f=_0xe850b3[_0x0aaf('0x23')][_0x0aaf('0x18')][_0x0aaf('0x4c')];return new Promise(function(_0x3ce550,_0x27e610){return db[_0x0aaf('0x14')][_0x0aaf('0x15')]({'where':{'voiceQueueId':_0x2d0a7a,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize']['literal'](_0x0aaf('0x4d')+_0x323b0f+_0x0aaf('0x4e'))}},'include':[{'model':db[_0x0aaf('0x29')],'as':_0x0aaf('0x2c')},{'model':db[_0x0aaf('0x2e')],'as':_0x0aaf('0x4f'),'attributes':['id','name',_0x0aaf('0x30')]},{'model':db[_0x0aaf('0x50')],'as':_0x0aaf('0x51')}]})[_0x0aaf('0x24')](function(_0x18284f){return db[_0x0aaf('0x39')][_0x0aaf('0x43')](function(_0x596bc3){return db[_0x0aaf('0x14')][_0x0aaf('0x26')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x2d0a7a,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x0aaf('0x39')][_0x0aaf('0x3d')](_0x0aaf('0x4d')+_0x323b0f+_0x0aaf('0x4e'))}},'transaction':_0x596bc3})[_0x0aaf('0x24')](function(_0x42d47d){_0x3ce550(_0x18284f);})[_0x0aaf('0x12')](function(_0x312b83){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x312b83[_0x0aaf('0x10')],_0xe850b3);_0x27e610(validateExpressRequest);});});})[_0x0aaf('0x12')](function(_0x15912a){logger[_0x0aaf('0xe')](_0x0aaf('0x4a'),_0x15912a[_0x0aaf('0x10')],_0xe850b3);_0x27e610(_0x4bbe7a[_0x0aaf('0xe')](0x1f4,_0x15912a['message']));});});}; \ No newline at end of file +var _0x53d0=['length','push','includes','all','dataValues','active','sequelize','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','contactsRescheduled','describe','transaction','UserId','GetContactRecallMe','GetCmHopperPreview','keys','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueId','interval','NOW()\x20+\x20INTERVAL\x20','List','CmHopperHandlePreviewRecallNotifications','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','http','request','then','info','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','attributes','limit','include','map','model','debug','ShowCmHopper','where','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','CmContact','order','LOCK','UPDATE','Contact','Agent','name','voicePause'];(function(_0x1b690a,_0x29821a){var _0x8435db=function(_0x401571){while(--_0x401571){_0x1b690a['push'](_0x1b690a['shift']());}};_0x8435db(++_0x29821a);}(_0x53d0,0x1c5));var _0x053d=function(_0x59addb,_0x5861ed){_0x59addb=_0x59addb-0x0;var _0x311693=_0x53d0[_0x59addb];return _0x311693;};'use strict';var _=require('lodash');var util=require(_0x053d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x053d('0x1'));var fs=require('fs');var Redis=require(_0x053d('0x2'));var db=require(_0x053d('0x3'))['db'];var utils=require(_0x053d('0x4'));var logger=require(_0x053d('0x5'))('rpc');var config=require(_0x053d('0x6'));var jayson=require(_0x053d('0x7'));const {validateExpressRequest}=require(_0x053d('0x8'));var client=jayson['client'][_0x053d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1338ab,_0x1a8154,_0x5d7ca4){return new BPromise(function(_0x58c64e,_0x32a53e){return client[_0x053d('0xa')](_0x1338ab,_0x5d7ca4)[_0x053d('0xb')](function(_0x26efad){logger[_0x053d('0xc')]('CmHopper,\x20%s,\x20%s',_0x1a8154,'request\x20sent');logger['debug'](_0x053d('0xd'),_0x1a8154,_0x053d('0xe'),JSON[_0x053d('0xf')](_0x26efad));if(_0x26efad['error']){if(_0x26efad['error']['code']===0x1f4){logger[_0x053d('0x10')](_0x053d('0x11'),_0x1a8154,_0x26efad['error']['message']);return _0x32a53e(_0x26efad[_0x053d('0x10')][_0x053d('0x12')]);}logger[_0x053d('0x10')]('CmHopper,\x20%s,\x20%s',_0x1a8154,_0x26efad[_0x053d('0x10')][_0x053d('0x12')]);return _0x58c64e(_0x26efad['error'][_0x053d('0x12')]);}else{logger[_0x053d('0xc')](_0x053d('0x11'),_0x1a8154,'request\x20sent');_0x58c64e(_0x26efad[_0x053d('0x13')]['message']);}})[_0x053d('0x14')](function(_0x4d3478){logger[_0x053d('0x10')](_0x053d('0x11'),_0x1a8154,_0x4d3478);_0x32a53e(_0x4d3478);});});}exports[_0x053d('0x15')]=function(_0x389642){var _0xd2b107=this;return new Promise(function(_0x39e4c6,_0x42e6d4){return db[_0x053d('0x16')][_0x053d('0x17')]({'raw':_0x389642['options']?_0x389642[_0x053d('0x18')][_0x053d('0x19')]===undefined?!![]:![]:!![],'where':_0x389642[_0x053d('0x18')]?_0x389642[_0x053d('0x18')]['where']||null:null,'attributes':_0x389642[_0x053d('0x18')]?_0x389642[_0x053d('0x18')][_0x053d('0x1a')]||null:null,'limit':_0x389642['options']?_0x389642[_0x053d('0x18')][_0x053d('0x1b')]||null:null,'include':_0x389642[_0x053d('0x18')]?_0x389642['options'][_0x053d('0x1c')]?_[_0x053d('0x1d')](_0x389642[_0x053d('0x18')][_0x053d('0x1c')],function(_0x5f49a6){return{'model':db[_0x5f49a6['model']],'as':_0x5f49a6['as'],'attributes':_0x5f49a6['attributes'],'include':_0x5f49a6[_0x053d('0x1c')]?_['map'](_0x5f49a6[_0x053d('0x1c')],function(_0x46c481){return{'model':db[_0x46c481[_0x053d('0x1e')]],'as':_0x46c481['as'],'attributes':_0x46c481[_0x053d('0x1a')],'include':_0x46c481[_0x053d('0x1c')]?_[_0x053d('0x1d')](_0x46c481['include'],function(_0x6d5e4f){return{'model':db[_0x6d5e4f[_0x053d('0x1e')]],'as':_0x6d5e4f['as'],'attributes':_0x6d5e4f[_0x053d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x053d('0xb')](function(_0x23a2d8){logger[_0x053d('0xc')](_0x053d('0x15'),_0x389642);logger[_0x053d('0x1f')](_0x053d('0x15'),_0x389642,JSON[_0x053d('0xf')](_0x23a2d8));_0x39e4c6(_0x23a2d8);})[_0x053d('0x14')](function(_0x1733c7){logger['error'](_0x053d('0x15'),_0x1733c7[_0x053d('0x12')],_0x389642);_0x42e6d4(_0xd2b107[_0x053d('0x10')](0x1f4,_0x1733c7[_0x053d('0x12')]));});});};exports[_0x053d('0x20')]=function(_0x2e1f7f){var _0x4fa2ad=this;return new Promise(function(_0x9f250d,_0x356d3d){return db[_0x053d('0x16')]['find']({'raw':_0x2e1f7f['options']?_0x2e1f7f['options'][_0x053d('0x19')]===undefined?!![]:![]:!![],'where':_0x2e1f7f[_0x053d('0x18')]?_0x2e1f7f[_0x053d('0x18')][_0x053d('0x21')]||null:null,'attributes':_0x2e1f7f[_0x053d('0x18')]?_0x2e1f7f[_0x053d('0x18')][_0x053d('0x1a')]||null:null,'include':_0x2e1f7f[_0x053d('0x18')]?_0x2e1f7f[_0x053d('0x18')]['include']?_[_0x053d('0x1d')](_0x2e1f7f[_0x053d('0x18')][_0x053d('0x1c')],function(_0x40d13f){return{'model':db[_0x40d13f[_0x053d('0x1e')]],'as':_0x40d13f['as'],'attributes':_0x40d13f['attributes'],'include':_0x40d13f[_0x053d('0x1c')]?_[_0x053d('0x1d')](_0x40d13f[_0x053d('0x1c')],function(_0x3058a1){return{'model':db[_0x3058a1[_0x053d('0x1e')]],'as':_0x3058a1['as'],'attributes':_0x3058a1[_0x053d('0x1a')],'include':_0x3058a1[_0x053d('0x1c')]?_[_0x053d('0x1d')](_0x3058a1[_0x053d('0x1c')],function(_0x41314d){return{'model':db[_0x41314d[_0x053d('0x1e')]],'as':_0x41314d['as'],'attributes':_0x41314d['attributes']};}):[]};}):[]};}):[]:[]})[_0x053d('0xb')](function(_0x4f3d87){logger[_0x053d('0xc')](_0x053d('0x20'),_0x2e1f7f);logger[_0x053d('0x1f')](_0x053d('0x20'),_0x2e1f7f,JSON['stringify'](_0x4f3d87));_0x9f250d(_0x4f3d87);})[_0x053d('0x14')](function(_0x89fa3b){logger['error']('ShowCmHopper',_0x89fa3b['message'],_0x2e1f7f);_0x356d3d(_0x4fa2ad[_0x053d('0x10')](0x1f4,_0x89fa3b['message']));});});};exports[_0x053d('0x22')]=function(_0x4fc6d6){var _0x331d42=this;return new Promise(function(_0x6ca3d0,_0x155127){return db[_0x053d('0x16')][_0x053d('0x23')](_0x4fc6d6[_0x053d('0x24')],{'raw':_0x4fc6d6[_0x053d('0x18')]?_0x4fc6d6[_0x053d('0x18')][_0x053d('0x19')]===undefined?!![]:![]:!![]})[_0x053d('0xb')](function(_0x8cf98){logger[_0x053d('0xc')](_0x053d('0x22'),_0x4fc6d6);logger['debug'](_0x053d('0x22'),_0x4fc6d6,JSON[_0x053d('0xf')](_0x8cf98));_0x6ca3d0(_0x8cf98);})[_0x053d('0x14')](function(_0x4b10a3){logger[_0x053d('0x10')](_0x053d('0x22'),_0x4b10a3['message'],_0x4fc6d6);_0x155127(_0x331d42[_0x053d('0x10')](0x1f4,_0x4b10a3['message']));});});};exports[_0x053d('0x25')]=function(_0x352e6b){var _0x3724a4=this;return new Promise(function(_0x251cbc,_0x35a65f){return db[_0x053d('0x16')][_0x053d('0x26')](_0x352e6b[_0x053d('0x24')],{'raw':_0x352e6b['options']?_0x352e6b[_0x053d('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x352e6b[_0x053d('0x18')]?_0x352e6b[_0x053d('0x18')][_0x053d('0x21')]||null:null,'attributes':_0x352e6b['options']?_0x352e6b[_0x053d('0x18')]['attributes']||null:null,'limit':_0x352e6b[_0x053d('0x18')]?_0x352e6b[_0x053d('0x18')][_0x053d('0x1b')]||null:null})[_0x053d('0xb')](function(_0xb7dd10){logger[_0x053d('0xc')](_0x053d('0x25'),_0x352e6b);logger['info'](_0x053d('0x27'),JSON[_0x053d('0xf')](_0x352e6b[_0x053d('0x18')]['where']),_0x352e6b[_0x053d('0x24')]['active']);logger[_0x053d('0x1f')](_0x053d('0x25'),_0x352e6b,JSON[_0x053d('0xf')](_0xb7dd10));_0x251cbc(_0xb7dd10);})[_0x053d('0x14')](function(_0x2c328e){logger[_0x053d('0x10')]('UpdateCmHopper',_0x2c328e[_0x053d('0x12')],_0x352e6b);_0x35a65f(_0x3724a4[_0x053d('0x10')](0x1f4,_0x2c328e[_0x053d('0x12')]));});});};exports[_0x053d('0x28')]=function(_0x1256be){var _0x725461=this;return new Promise(function(_0x4f4ee7,_0x1c7145){return db[_0x053d('0x16')][_0x053d('0x29')]({'where':_0x1256be[_0x053d('0x18')]?_0x1256be['options'][_0x053d('0x21')]||null:null})['then'](function(_0x88e9d7){logger[_0x053d('0xc')](_0x053d('0x28'),_0x1256be);logger[_0x053d('0x1f')](_0x053d('0x28'),_0x1256be,JSON[_0x053d('0xf')](_0x88e9d7));_0x4f4ee7(_0x88e9d7);})['catch'](function(_0x4d2967){logger['error']('DestroyCmHopper',_0x4d2967[_0x053d('0x12')],_0x1256be);_0x1c7145(_0x725461[_0x053d('0x10')](0x1f4,_0x4d2967['message']));});});};exports[_0x053d('0x2a')]=function(_0x2fb9be){var _0x456800=this;return new Promise(function(_0x5e2f4a,_0x2825f8){return db[_0x053d('0x2b')]['describe']()[_0x053d('0xb')](function(_0xdeba0b){return db['sequelize']['transaction'](function(_0x25dc1a){return db[_0x053d('0x16')][_0x053d('0x17')]({'where':_0x2fb9be[_0x053d('0x18')]?_0x2fb9be[_0x053d('0x18')][_0x053d('0x21')]||null:null,'attributes':_0x2fb9be[_0x053d('0x18')]?_0x2fb9be[_0x053d('0x18')][_0x053d('0x1a')]||null:null,'limit':_0x2fb9be[_0x053d('0x18')]?_0x2fb9be['options'][_0x053d('0x1b')]||null:null,'order':_0x2fb9be[_0x053d('0x18')]?_0x2fb9be[_0x053d('0x18')][_0x053d('0x2c')]||null:null,'transaction':_0x25dc1a,'lock':_0x25dc1a[_0x053d('0x2d')][_0x053d('0x2e')],'include':[{'model':db[_0x053d('0x2b')],'as':_0x053d('0x2f'),'attributes':_['keys'](_0xdeba0b)},{'model':db['User'],'as':_0x053d('0x30'),'attributes':['id',_0x053d('0x31'),_0x053d('0x32')]}]})[_0x053d('0xb')](function(_0x15d167){var _0x14a322=[];var _0x331dfb=[];for(var _0x91b21=0x0;_0x91b21<_0x15d167[_0x053d('0x33')];_0x91b21+=0x1){var _0x5f4572=_0x15d167[_0x91b21]['UserId'];if(_0x5f4572===null){_0x14a322[_0x053d('0x34')](_0x15d167[_0x91b21][_0x053d('0x26')](_0x2fb9be[_0x053d('0x24')],{'transaction':_0x25dc1a}));}else if(!_0x331dfb[_0x053d('0x35')](_0x5f4572)){_0x331dfb['push'](_0x5f4572);_0x14a322[_0x053d('0x34')](_0x15d167[_0x91b21][_0x053d('0x26')](_0x2fb9be[_0x053d('0x24')],{'transaction':_0x25dc1a}));}}return BPromise[_0x053d('0x36')](_0x14a322);});})[_0x053d('0xb')](function(_0x52fb07){logger[_0x053d('0xc')](_0x053d('0x2a'),_0x2fb9be);if(_0x52fb07[_0x053d('0x33')]>0x0){logger[_0x053d('0xc')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x52fb07[0x0][_0x053d('0x37')]['id'],_0x52fb07[0x0]['dataValues']['ContactId'],_0x52fb07[0x0]['dataValues'][_0x053d('0x38')]);}logger[_0x053d('0x1f')]('GetContactDialer',_0x2fb9be,JSON[_0x053d('0xf')](_0x52fb07));_0x5e2f4a(_0x52fb07);})[_0x053d('0x14')](function(_0x1e3a57){logger[_0x053d('0x10')](_0x053d('0x2a'),_0x1e3a57[_0x053d('0x12')],_0x2fb9be);_0x2825f8(_0x456800['error'](0x1f4,_0x1e3a57[_0x053d('0x12')]));});});});};exports['MoveContactManagedDialer']=function(_0x4335f5){var _0x9e52f2=this;return new Promise(function(_0x1d983,_0x206cc6){return db[_0x053d('0x39')]['transaction'](function(_0x54d34c){return db['CmHopperFinal'][_0x053d('0x23')](_0x4335f5[_0x053d('0x24')],{'raw':_0x4335f5[_0x053d('0x18')]?_0x4335f5[_0x053d('0x18')][_0x053d('0x19')]===undefined?!![]:![]:!![],'transaction':_0x54d34c})['then'](function(){logger['info'](_0x053d('0x3a'),JSON[_0x053d('0xf')](_0x4335f5[_0x053d('0x18')][_0x053d('0x21')]),_0x4335f5['options'][_0x053d('0x21')][_0x053d('0x38')]);return db[_0x053d('0x16')][_0x053d('0x29')]({'where':_0x4335f5[_0x053d('0x18')]?_0x4335f5[_0x053d('0x18')][_0x053d('0x21')]||null:null,'transaction':_0x54d34c});});})['then'](function(_0x355fd1){logger[_0x053d('0xc')](_0x053d('0x3b'),_0x4335f5);logger[_0x053d('0x1f')](_0x053d('0x3b'),_0x4335f5,JSON[_0x053d('0xf')](_0x355fd1));_0x1d983(_0x355fd1);})['catch'](function(_0x3da7b7){logger['error']('MoveContactManagedDialer',_0x3da7b7[_0x053d('0x12')],_0x4335f5);_0x206cc6(_0x9e52f2[_0x053d('0x10')](0x1f4,_0x3da7b7['message']));});});};exports[_0x053d('0x3c')]=function(_0xcad72b){var _0x8bd155=this;return new Promise(function(_0x13cf0b,_0x5c9025){return db[_0x053d('0x16')]['findAll']({'raw':_0xcad72b['options']?_0xcad72b[_0x053d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xcad72b[_0x053d('0x18')]?_0xcad72b[_0x053d('0x18')][_0x053d('0x21')]||null:null,'attributes':[[db['sequelize']['fn'](_0x053d('0x3d'),db[_0x053d('0x39')]['fn']('IF',db['sequelize'][_0x053d('0x3e')](_0x053d('0x3f')+util[_0x053d('0x40')](_0x053d('0x41'),moment()[_0x053d('0x40')](_0x053d('0x42')))+'\x20,\x201,\x20null'))),_0x053d('0x43')]]})['then'](function(_0x37af73){logger[_0x053d('0xc')](_0x053d('0x3c'),_0xcad72b);logger[_0x053d('0x1f')](_0x053d('0x3c'),_0xcad72b,JSON[_0x053d('0xf')](_0x37af73));_0x13cf0b(_0x37af73);})[_0x053d('0x14')](function(_0x5cba84){logger[_0x053d('0x10')](_0x053d('0x3c'),_0x5cba84[_0x053d('0x12')],_0xcad72b);_0x5c9025(_0x8bd155[_0x053d('0x10')](0x1f4,_0x5cba84['message']));});});};exports['GetContactRecallMe']=function(_0x161e73){var _0x5ad34c=this;return new Promise(function(_0x48c23d,_0x16bbdf){return db[_0x053d('0x2b')][_0x053d('0x44')]()[_0x053d('0xb')](function(_0x440862){return db[_0x053d('0x39')][_0x053d('0x45')](function(_0x24e64f){return db[_0x053d('0x16')][_0x053d('0x17')]({'where':_0x161e73[_0x053d('0x18')]?_0x161e73['options'][_0x053d('0x21')]||null:null,'attributes':_0x161e73[_0x053d('0x18')]?_0x161e73[_0x053d('0x18')][_0x053d('0x1a')]||null:null,'limit':0x1,'order':_0x161e73[_0x053d('0x18')]?_0x161e73[_0x053d('0x18')][_0x053d('0x2c')]||null:null,'group':db['CmHopper'][_0x053d('0x46')],'transaction':_0x24e64f,'lock':_0x24e64f[_0x053d('0x2d')]['UPDATE'],'include':_0x161e73[_0x053d('0x18')]?_0x161e73[_0x053d('0x18')]['include']?_['map'](_0x161e73[_0x053d('0x18')][_0x053d('0x1c')],function(_0x377b8f){return{'model':db[_0x377b8f['model']],'as':_0x377b8f['as'],'attributes':_0x377b8f['attributes'],'include':_0x377b8f[_0x053d('0x1c')]?_[_0x053d('0x1d')](_0x377b8f[_0x053d('0x1c')],function(_0x4b8da1){return{'model':db[_0x4b8da1[_0x053d('0x1e')]],'as':_0x4b8da1['as'],'attributes':_0x4b8da1['attributes'],'include':_0x4b8da1[_0x053d('0x1c')]?_[_0x053d('0x1d')](_0x4b8da1[_0x053d('0x1c')],function(_0x4bf614){return{'model':db[_0x4bf614['model']],'as':_0x4bf614['as'],'attributes':_0x4bf614[_0x053d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x053d('0xb')](function(_0x117a18){var _0x1085ae=[];for(var _0x3d7ad3=0x0;_0x3d7ad3<_0x117a18[_0x053d('0x33')];_0x3d7ad3+=0x1){_0x1085ae['push'](_0x117a18[_0x3d7ad3][_0x053d('0x26')](_0x161e73['body'],{'transaction':_0x24e64f}));}return BPromise['all'](_0x1085ae);});})['then'](function(_0x4def1a){logger[_0x053d('0xc')](_0x053d('0x47'),_0x161e73);logger[_0x053d('0x1f')](_0x053d('0x47'),_0x161e73,JSON[_0x053d('0xf')](_0x4def1a));_0x48c23d(_0x4def1a);})[_0x053d('0x14')](function(_0xf2011b){logger['error'](_0x053d('0x47'),_0xf2011b[_0x053d('0x12')],_0x161e73);_0x16bbdf(_0x5ad34c[_0x053d('0x10')](0x1f4,_0xf2011b[_0x053d('0x12')]));});});});};exports[_0x053d('0x48')]=function(_0x3c9324){var _0x36266c=this;return new Promise(function(_0x1e843c,_0x19f36d){db[_0x053d('0x2b')][_0x053d('0x44')]()[_0x053d('0xb')](function(_0x56de24){return db['CmHopper'][_0x053d('0x17')]({'raw':_0x3c9324[_0x053d('0x18')]?_0x3c9324[_0x053d('0x18')][_0x053d('0x19')]===undefined?!![]:![]:!![],'where':_0x3c9324[_0x053d('0x18')]?_0x3c9324[_0x053d('0x18')][_0x053d('0x21')]||null:null,'attributes':_0x3c9324[_0x053d('0x18')]?_0x3c9324[_0x053d('0x18')][_0x053d('0x1a')]||null:null,'limit':_0x3c9324[_0x053d('0x18')]?_0x3c9324[_0x053d('0x18')][_0x053d('0x1b')]||null:null,'include':_0x3c9324[_0x053d('0x18')]?_0x3c9324[_0x053d('0x18')][_0x053d('0x1c')]?_[_0x053d('0x1d')](_0x3c9324[_0x053d('0x18')][_0x053d('0x1c')],function(_0x21a6a2){return{'model':db[_0x21a6a2['model']],'as':_0x21a6a2['as'],'attributes':_0x21a6a2['as']===_0x053d('0x2f')?_[_0x053d('0x49')](_0x56de24):_0x21a6a2[_0x053d('0x1a')],'include':_0x21a6a2['include']?_[_0x053d('0x1d')](_0x21a6a2[_0x053d('0x1c')],function(_0x349fce){return{'model':db[_0x349fce['model']],'as':_0x349fce['as'],'attributes':_0x349fce[_0x053d('0x1a')],'include':_0x349fce[_0x053d('0x1c')]?_[_0x053d('0x1d')](_0x349fce['include'],function(_0x259b4b){return{'model':db[_0x259b4b[_0x053d('0x1e')]],'as':_0x259b4b['as'],'attributes':_0x259b4b['attributes']};}):[]};}):[]};}):[]:[]})[_0x053d('0xb')](function(_0x2d3902){logger[_0x053d('0xc')](_0x053d('0x15'),_0x3c9324);logger['debug'](_0x053d('0x15'),_0x3c9324,JSON[_0x053d('0xf')](_0x2d3902));_0x1e843c(_0x2d3902);})[_0x053d('0x14')](function(_0x1f4547){logger[_0x053d('0x10')]('GetCmHopper',_0x1f4547[_0x053d('0x12')],_0x3c9324);_0x19f36d(_0x36266c[_0x053d('0x10')](0x1f4,_0x1f4547[_0x053d('0x12')]));});});});};exports['GetContactByPhone']=function(_0x227858){var _0x2f8770=this;return new Promise(function(_0x11f19d,_0x160d98){return db[_0x053d('0x2b')][_0x053d('0x4a')]({'raw':!![],'where':{'phone':_0x227858[_0x053d('0x18')][_0x053d('0x21')][_0x053d('0x4b')]},'attributes':['id','dialTimezone'],'order':[['id',_0x053d('0x4c')]]})['then'](function(_0x30c7ab){logger[_0x053d('0xc')](_0x053d('0x4d'),_0x227858);logger[_0x053d('0x1f')](_0x053d('0x4d'),_0x227858,JSON[_0x053d('0xf')](_0x30c7ab));_0x11f19d(_0x30c7ab);})[_0x053d('0x14')](function(_0x42cfee){logger[_0x053d('0x10')](_0x053d('0x4d'),_0x42cfee['message'],_0x227858);_0x160d98(_0x2f8770[_0x053d('0x10')](0x1f4,_0x42cfee[_0x053d('0x12')]));});});};exports['ResetActiveCalls']=function(_0x488de0){var _0x362cf6=this;return new Promise(function(_0x16f1aa,_0x36aa4a){return db[_0x053d('0x39')][_0x053d('0x45')](function(_0x13b904){return db[_0x053d('0x16')][_0x053d('0x26')]({'active':![]},{'where':{},'transaction':_0x13b904})[_0x053d('0xb')](function(_0x47e0e7){logger['info']('ResetActiveCalls',_0x488de0);logger['debug'](_0x053d('0x4e'),_0x488de0,JSON['stringify'](_0x47e0e7));_0x16f1aa(_0x47e0e7);})[_0x053d('0x14')](function(_0x4dde03){logger[_0x053d('0x10')]('ResetActiveCalls',_0x4dde03['message'],_0x488de0);_0x36aa4a(_0x362cf6['error'](0x1f4,_0x4dde03['message']));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x71b075){var _0x125f54=this;var _0x59918b=_0x71b075[_0x053d('0x24')][_0x053d('0x21')][_0x053d('0x4f')];var _0x3d1712=_0x71b075[_0x053d('0x24')][_0x053d('0x21')][_0x053d('0x50')];return new Promise(function(_0x971bd2,_0x1738d1){return db[_0x053d('0x16')]['findAll']({'where':{'voiceQueueId':_0x59918b,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x053d('0x39')][_0x053d('0x3e')](_0x053d('0x51')+_0x3d1712+'\x20MINUTE')}},'include':[{'model':db[_0x053d('0x2b')],'as':_0x053d('0x2f')},{'model':db['User'],'as':_0x053d('0x30'),'attributes':['id',_0x053d('0x31'),_0x053d('0x32')]},{'model':db['CmList'],'as':_0x053d('0x52')}]})[_0x053d('0xb')](function(_0x5bf94a){return db[_0x053d('0x39')]['transaction'](function(_0x324893){return db[_0x053d('0x16')][_0x053d('0x26')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x59918b,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0x053d('0x3e')](_0x053d('0x51')+_0x3d1712+'\x20MINUTE')}},'transaction':_0x324893})[_0x053d('0xb')](function(_0x553743){_0x971bd2(_0x5bf94a);})[_0x053d('0x14')](function(_0x45ddbf){logger[_0x053d('0x10')]('CmHopperHandlePreviewRecallNotifications',_0x45ddbf[_0x053d('0x12')],_0x71b075);_0x1738d1(validateExpressRequest);});});})[_0x053d('0x14')](function(_0x4865de){logger[_0x053d('0x10')](_0x053d('0x53'),_0x4865de['message'],_0x71b075);_0x1738d1(_0x125f54[_0x053d('0x10')](0x1f4,_0x4865de[_0x053d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 9118f94..232999a 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 _0x1fc5=['describe','getOpenContacts','/timezones','getTimezones','/:id','post','/preview','/timezone','getTimezone','getPreviewRecall','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x54444e,_0x4c2055){var _0x5b88d4=function(_0x42b330){while(--_0x42b330){_0x54444e['push'](_0x54444e['shift']());}};_0x5b88d4(++_0x4c2055);}(_0x1fc5,0x98));var _0x51fc=function(_0x41c7ff,_0x5be7b5){_0x41c7ff=_0x41c7ff-0x0;var _0xb41c85=_0x1fc5[_0x41c7ff];return _0xb41c85;};'use strict';var multer=require('multer');var util=require(_0x51fc('0x0'));var path=require('path');var timeout=require(_0x51fc('0x1'));var express=require(_0x51fc('0x2'));var router=express[_0x51fc('0x3')]();var fs_extra=require(_0x51fc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x51fc('0x5'));var config=require('../../config/environment');var controller=require('./cmHopper.controller');router[_0x51fc('0x6')]('/',auth[_0x51fc('0x7')](),controller[_0x51fc('0x8')]);router[_0x51fc('0x6')]('/describe',auth[_0x51fc('0x7')](),controller[_0x51fc('0x9')]);router[_0x51fc('0x6')]('/opencontacts',auth['isAuthenticated'](),controller[_0x51fc('0xa')]);router[_0x51fc('0x6')](_0x51fc('0xb'),auth['isAuthenticated'](),controller[_0x51fc('0xc')]);router[_0x51fc('0x6')](_0x51fc('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x51fc('0xe')]('/',auth[_0x51fc('0x7')](),controller['create']);router[_0x51fc('0xe')](_0x51fc('0xf'),auth['isAuthenticated'](),controller['getPreview']);router['post'](_0x51fc('0x10'),auth[_0x51fc('0x7')](),controller[_0x51fc('0x11')]);router['post']('/previewrecall',auth[_0x51fc('0x7')](),controller[_0x51fc('0x12')]);router[_0x51fc('0x13')](_0x51fc('0xd'),auth[_0x51fc('0x7')](),controller['update']);router[_0x51fc('0x14')](_0x51fc('0xd'),auth[_0x51fc('0x7')](),controller[_0x51fc('0x15')]);module[_0x51fc('0x16')]=router; \ No newline at end of file +var _0xcf66=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','/opencontacts','/timezones','getTimezones','/:id','show','post','create','/preview','/timezone','getTimezone','getPreviewRecall','put','delete','destroy','exports','multer'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0xcf66,0x185));var _0x6cf6=function(_0x20d557,_0x585455){_0x20d557=_0x20d557-0x0;var _0x41de72=_0xcf66[_0x20d557];return _0x41de72;};'use strict';var multer=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var path=require(_0x6cf6('0x2'));var timeout=require(_0x6cf6('0x3'));var express=require(_0x6cf6('0x4'));var router=express[_0x6cf6('0x5')]();var fs_extra=require(_0x6cf6('0x6'));var auth=require(_0x6cf6('0x7'));var interaction=require(_0x6cf6('0x8'));var config=require('../../config/environment');var controller=require(_0x6cf6('0x9'));router['get']('/',auth[_0x6cf6('0xa')](),controller[_0x6cf6('0xb')]);router[_0x6cf6('0xc')](_0x6cf6('0xd'),auth[_0x6cf6('0xa')](),controller[_0x6cf6('0xe')]);router[_0x6cf6('0xc')](_0x6cf6('0xf'),auth[_0x6cf6('0xa')](),controller['getOpenContacts']);router[_0x6cf6('0xc')](_0x6cf6('0x10'),auth[_0x6cf6('0xa')](),controller[_0x6cf6('0x11')]);router[_0x6cf6('0xc')](_0x6cf6('0x12'),auth[_0x6cf6('0xa')](),controller[_0x6cf6('0x13')]);router[_0x6cf6('0x14')]('/',auth[_0x6cf6('0xa')](),controller[_0x6cf6('0x15')]);router[_0x6cf6('0x14')](_0x6cf6('0x16'),auth['isAuthenticated'](),controller['getPreview']);router[_0x6cf6('0x14')](_0x6cf6('0x17'),auth['isAuthenticated'](),controller[_0x6cf6('0x18')]);router[_0x6cf6('0x14')]('/previewrecall',auth[_0x6cf6('0xa')](),controller[_0x6cf6('0x19')]);router[_0x6cf6('0x1a')](_0x6cf6('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x6cf6('0x1b')]('/:id',auth[_0x6cf6('0xa')](),controller[_0x6cf6('0x1c')]);module[_0x6cf6('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index e4e740e..2159393 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 _0x3cd8=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x2ac116,_0x50ca5a){var _0xb7b33b=function(_0x59c867){while(--_0x59c867){_0x2ac116['push'](_0x2ac116['shift']());}};_0xb7b33b(++_0x50ca5a);}(_0x3cd8,0x150));var _0x83cd=function(_0x2defb5,_0x1cda14){_0x2defb5=_0x2defb5-0x0;var _0x229c53=_0x3cd8[_0x2defb5];return _0x229c53;};'use strict';var moment=require(_0x83cd('0x0'));var Sequelize=require(_0x83cd('0x1'));module[_0x83cd('0x2')]={'phone':{'type':Sequelize[_0x83cd('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x83cd('0x4')],'unique':_0x83cd('0x5')},'ListId':{'type':Sequelize[_0x83cd('0x4')],'unique':_0x83cd('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x83cd('0x5')}}; \ No newline at end of file +var _0x433a=['INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x56fc44,_0x7be087){var _0x5e67f8=function(_0x7a60fc){while(--_0x7a60fc){_0x56fc44['push'](_0x56fc44['shift']());}};_0x5e67f8(++_0x7be087);}(_0x433a,0x14c));var _0xa433=function(_0x14c93b,_0x4ce348){_0x14c93b=_0x14c93b-0x0;var _0x45b025=_0x433a[_0x14c93b];return _0x45b025;};'use strict';var moment=require(_0xa433('0x0'));var Sequelize=require(_0xa433('0x1'));module[_0xa433('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa433('0x3')],'unique':_0xa433('0x4')},'ListId':{'type':Sequelize[_0xa433('0x3')],'unique':_0xa433('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa433('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index f9f3409..62a3049 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 _0x0360=['ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','CmHopperBlack','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','body','params','describe','rimraf','zip-dir','fast-json-patch','bluebird','util','path'];(function(_0x377543,_0xb72c5c){var _0x419eae=function(_0x10acac){while(--_0x10acac){_0x377543['push'](_0x377543['shift']());}};_0x419eae(++_0xb72c5c);}(_0x0360,0x11e));var _0x0036=function(_0x34b709,_0x5dc8af){_0x34b709=_0x34b709-0x0;var _0x20dda4=_0x0360[_0x34b709];return _0x20dda4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0036('0x0'));var zipdir=require(_0x0036('0x1'));var jsonpatch=require(_0x0036('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0036('0x3'));var Mustache=require('mustache');var util=require(_0x0036('0x4'));var path=require(_0x0036('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0036('0x6'));var fs=require('fs');var fs_extra=require(_0x0036('0x7'));var _=require(_0x0036('0x8'));var squel=require(_0x0036('0x9'));var crypto=require(_0x0036('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0036('0xb'));var toCsv=require(_0x0036('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0036('0xd'));var authService=require(_0x0036('0xe'));var qs=require(_0x0036('0xf'));var as=require(_0x0036('0x10'));var hardwareService=require(_0x0036('0x11'));var logger=require(_0x0036('0x12'))(_0x0036('0x13'));var utils=require(_0x0036('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0036('0x15'));var db=require(_0x0036('0x16'))['db'];function respondWithStatusCode(_0x5f5171,_0x156dd5){_0x156dd5=_0x156dd5||0xcc;return function(_0x21edd3){if(_0x21edd3){return _0x5f5171[_0x0036('0x17')](_0x156dd5);}return _0x5f5171[_0x0036('0x18')](_0x156dd5)['end']();};}function respondWithResult(_0x211a1c,_0x592dbd){_0x592dbd=_0x592dbd||0xc8;return function(_0xdb094a){if(_0xdb094a){return _0x211a1c[_0x0036('0x18')](_0x592dbd)['json'](_0xdb094a);}};}function respondWithFilteredResult(_0x37c9eb,_0x350eb9){return function(_0x680435){if(_0x680435){var _0x12d05c=typeof _0x350eb9[_0x0036('0x19')]===_0x0036('0x1a')&&typeof _0x350eb9['limit']===_0x0036('0x1a');var _0x31a2f8=_0x680435['count'];var _0x42980d=_0x12d05c?0x0:_0x350eb9[_0x0036('0x19')];var _0xf4638c=_0x12d05c?_0x680435[_0x0036('0x1b')]:_0x350eb9[_0x0036('0x19')]+_0x350eb9[_0x0036('0x1c')];var _0x448249;if(_0xf4638c>=_0x31a2f8){_0xf4638c=_0x31a2f8;_0x448249=0xc8;}else{_0x448249=0xce;}_0x37c9eb[_0x0036('0x18')](_0x448249);return _0x37c9eb[_0x0036('0x1d')](_0x0036('0x1e'),_0x42980d+'-'+_0xf4638c+'/'+_0x31a2f8)[_0x0036('0x1f')](_0x680435);}return null;};}function patchUpdates(_0x1ebc27){return function(_0x3daecc){try{jsonpatch[_0x0036('0x20')](_0x3daecc,_0x1ebc27,!![]);}catch(_0x4e5e0d){return BPromise['reject'](_0x4e5e0d);}return _0x3daecc[_0x0036('0x21')]();};}function saveUpdates(_0x17476b,_0x5cd374){return function(_0x275bfa){if(_0x275bfa){return _0x275bfa['update'](_0x17476b)[_0x0036('0x22')](function(_0x351ac9){return _0x351ac9;});}return null;};}function removeEntity(_0x20c301,_0x418ac0){return function(_0x1c1523){if(_0x1c1523){return _0x1c1523[_0x0036('0x23')]()['then'](function(){_0x20c301[_0x0036('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32070e,_0x1cc2d8){return function(_0x58c9de){if(!_0x58c9de){_0x32070e['sendStatus'](0x194);}return _0x58c9de;};}function handleError(_0x310e1b,_0x364dca){_0x364dca=_0x364dca||0x1f4;return function(_0x22028d){logger[_0x0036('0x24')](_0x22028d[_0x0036('0x25')]);if(_0x22028d[_0x0036('0x26')]){delete _0x22028d[_0x0036('0x26')];}_0x310e1b['status'](_0x364dca)[_0x0036('0x27')](_0x22028d);};}exports[_0x0036('0x28')]=function(_0x42d692,_0x39490b){var _0xacfec4={},_0x1fb2f3={},_0x441bef={'count':0x0,'rows':[]};var _0x2bfcac=_[_0x0036('0x29')](db[_0x0036('0x2a')]['rawAttributes'],function(_0x175fcf){return{'name':_0x175fcf[_0x0036('0x2b')],'type':_0x175fcf[_0x0036('0x2c')][_0x0036('0x2d')]};});_0x1fb2f3[_0x0036('0x2e')]=_[_0x0036('0x29')](_0x2bfcac,_0x0036('0x26'));_0x1fb2f3[_0x0036('0x2f')]=_['keys'](_0x42d692[_0x0036('0x2f')]);_0x1fb2f3['filters']=_[_0x0036('0x30')](_0x1fb2f3[_0x0036('0x2e')],_0x1fb2f3[_0x0036('0x2f')]);_0xacfec4[_0x0036('0x31')]=_[_0x0036('0x30')](_0x1fb2f3['model'],qs[_0x0036('0x32')](_0x42d692['query'][_0x0036('0x32')]));_0xacfec4[_0x0036('0x31')]=_0xacfec4[_0x0036('0x31')]['length']?_0xacfec4[_0x0036('0x31')]:_0x1fb2f3[_0x0036('0x2e')];if(!_0x42d692[_0x0036('0x2f')][_0x0036('0x33')](_0x0036('0x34'))){_0xacfec4['limit']=qs['limit'](_0x42d692[_0x0036('0x2f')][_0x0036('0x1c')]);_0xacfec4[_0x0036('0x19')]=qs[_0x0036('0x19')](_0x42d692[_0x0036('0x2f')][_0x0036('0x19')]);}_0xacfec4[_0x0036('0x35')]=qs[_0x0036('0x36')](_0x42d692[_0x0036('0x2f')][_0x0036('0x36')]);_0xacfec4[_0x0036('0x37')]=qs['filters'](_['pick'](_0x42d692[_0x0036('0x2f')],_0x1fb2f3[_0x0036('0x38')]),_0x2bfcac);if(_0x42d692[_0x0036('0x2f')]['filter']){_0xacfec4[_0x0036('0x37')]=_[_0x0036('0x39')](_0xacfec4[_0x0036('0x37')],{'$or':_[_0x0036('0x29')](_0x2bfcac,function(_0x46b0fd){if(_0x46b0fd[_0x0036('0x2c')]!==_0x0036('0x3a')){var _0x9b4b55={};_0x9b4b55[_0x46b0fd['name']]={'$like':'%'+_0x42d692[_0x0036('0x2f')][_0x0036('0x3b')]+'%'};return _0x9b4b55;}})});}_0xacfec4=_['merge']({},_0xacfec4,_0x42d692[_0x0036('0x3c')]);var _0x1c3ba0={'where':_0xacfec4[_0x0036('0x37')]};return db[_0x0036('0x2a')]['count'](_0x1c3ba0)[_0x0036('0x22')](function(_0xfb44b6){_0x441bef[_0x0036('0x1b')]=_0xfb44b6;if(_0x42d692[_0x0036('0x2f')][_0x0036('0x3d')]){_0xacfec4[_0x0036('0x3e')]=[{'all':!![]}];}return db[_0x0036('0x2a')][_0x0036('0x3f')](_0xacfec4);})[_0x0036('0x22')](function(_0xbf78e6){_0x441bef[_0x0036('0x40')]=_0xbf78e6;return _0x441bef;})[_0x0036('0x22')](respondWithFilteredResult(_0x39490b,_0xacfec4))['catch'](handleError(_0x39490b,null));};exports[_0x0036('0x41')]=function(_0x58d162,_0x202c0a){var _0x2bb512={'raw':!![],'where':{'id':_0x58d162['params']['id']}},_0x4ea214={};_0x4ea214[_0x0036('0x2e')]=_[_0x0036('0x42')](db[_0x0036('0x2a')][_0x0036('0x43')]);_0x4ea214[_0x0036('0x2f')]=_[_0x0036('0x42')](_0x58d162[_0x0036('0x2f')]);_0x4ea214['filters']=_[_0x0036('0x30')](_0x4ea214['model'],_0x4ea214[_0x0036('0x2f')]);_0x2bb512['attributes']=_[_0x0036('0x30')](_0x4ea214[_0x0036('0x2e')],qs[_0x0036('0x32')](_0x58d162[_0x0036('0x2f')]['fields']));_0x2bb512[_0x0036('0x31')]=_0x2bb512['attributes']['length']?_0x2bb512[_0x0036('0x31')]:_0x4ea214[_0x0036('0x2e')];if(_0x58d162[_0x0036('0x2f')][_0x0036('0x3d')]){_0x2bb512[_0x0036('0x3e')]=[{'all':!![]}];}_0x2bb512=_['merge']({},_0x2bb512,_0x58d162[_0x0036('0x3c')]);return db['CmHopperBlack'][_0x0036('0x44')](_0x2bb512)['then'](handleEntityNotFound(_0x202c0a,null))[_0x0036('0x22')](respondWithResult(_0x202c0a,null))[_0x0036('0x45')](handleError(_0x202c0a,null));};exports['update']=function(_0x5c9d95,_0x264d93){if(_0x5c9d95['body']['id']){delete _0x5c9d95[_0x0036('0x46')]['id'];}return db['CmHopperBlack'][_0x0036('0x44')]({'where':{'id':_0x5c9d95[_0x0036('0x47')]['id']}})[_0x0036('0x22')](handleEntityNotFound(_0x264d93,null))[_0x0036('0x22')](saveUpdates(_0x5c9d95[_0x0036('0x46')],null))[_0x0036('0x22')](respondWithResult(_0x264d93,null))[_0x0036('0x45')](handleError(_0x264d93,null));};exports['destroy']=function(_0x2ffcae,_0x1e52ca){return db[_0x0036('0x2a')][_0x0036('0x44')]({'where':{'id':_0x2ffcae[_0x0036('0x47')]['id']}})[_0x0036('0x22')](handleEntityNotFound(_0x1e52ca,null))[_0x0036('0x22')](removeEntity(_0x1e52ca,null))[_0x0036('0x45')](handleError(_0x1e52ca,null));};exports['describe']=function(_0x326b6,_0x3f4d1b){return db['CmHopperBlack'][_0x0036('0x48')]()[_0x0036('0x22')](respondWithResult(_0x3f4d1b,null))['catch'](handleError(_0x3f4d1b,null));}; \ No newline at end of file +var _0xd94b=['sort','where','filters','pick','filter','merge','includeAll','findAll','catch','params','include','options','find','body','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','save','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xd94b,0x11b));var _0xbd94=function(_0x140357,_0x6670bd){_0x140357=_0x140357-0x0;var _0x4fdf00=_0xd94b[_0x140357];return _0x4fdf00;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd94('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd94('0x1'));var rp=require(_0xbd94('0x2'));var moment=require('moment');var BPromise=require(_0xbd94('0x3'));var Mustache=require(_0xbd94('0x4'));var util=require('util');var path=require(_0xbd94('0x5'));var sox=require(_0xbd94('0x6'));var csv=require(_0xbd94('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd94('0x8'));var _=require(_0xbd94('0x9'));var squel=require(_0xbd94('0xa'));var crypto=require('crypto');var jsforce=require(_0xbd94('0xb'));var deskjs=require(_0xbd94('0xc'));var toCsv=require(_0xbd94('0x7'));var querystring=require(_0xbd94('0xd'));var Papa=require(_0xbd94('0xe'));var Redis=require('ioredis');var authService=require(_0xbd94('0xf'));var qs=require(_0xbd94('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd94('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xbd94('0x12'));var licenseUtil=require(_0xbd94('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6417d7,_0x3bb289){_0x3bb289=_0x3bb289||0xcc;return function(_0x2ac803){if(_0x2ac803){return _0x6417d7[_0xbd94('0x14')](_0x3bb289);}return _0x6417d7[_0xbd94('0x15')](_0x3bb289)[_0xbd94('0x16')]();};}function respondWithResult(_0x3d015d,_0x3a6cc3){_0x3a6cc3=_0x3a6cc3||0xc8;return function(_0x46569d){if(_0x46569d){return _0x3d015d[_0xbd94('0x15')](_0x3a6cc3)[_0xbd94('0x17')](_0x46569d);}};}function respondWithFilteredResult(_0x3e317c,_0x222cec){return function(_0x92485b){if(_0x92485b){var _0x4d0395=typeof _0x222cec[_0xbd94('0x18')]===_0xbd94('0x19')&&typeof _0x222cec[_0xbd94('0x1a')]==='undefined';var _0x5bcc19=_0x92485b[_0xbd94('0x1b')];var _0x2dfafd=_0x4d0395?0x0:_0x222cec[_0xbd94('0x18')];var _0x5310cf=_0x4d0395?_0x92485b[_0xbd94('0x1b')]:_0x222cec[_0xbd94('0x18')]+_0x222cec['limit'];var _0x2416c9;if(_0x5310cf>=_0x5bcc19){_0x5310cf=_0x5bcc19;_0x2416c9=0xc8;}else{_0x2416c9=0xce;}_0x3e317c[_0xbd94('0x15')](_0x2416c9);return _0x3e317c['set']('Content-Range',_0x2dfafd+'-'+_0x5310cf+'/'+_0x5bcc19)[_0xbd94('0x17')](_0x92485b);}return null;};}function patchUpdates(_0x353c4b){return function(_0x4fd7ca){try{jsonpatch['apply'](_0x4fd7ca,_0x353c4b,!![]);}catch(_0x4caea5){return BPromise['reject'](_0x4caea5);}return _0x4fd7ca[_0xbd94('0x1c')]();};}function saveUpdates(_0x25406f,_0x2afc7c){return function(_0x16a368){if(_0x16a368){return _0x16a368[_0xbd94('0x1d')](_0x25406f)[_0xbd94('0x1e')](function(_0x7eed99){return _0x7eed99;});}return null;};}function removeEntity(_0xa5f834,_0x28ae32){return function(_0xa6e6c9){if(_0xa6e6c9){return _0xa6e6c9[_0xbd94('0x1f')]()[_0xbd94('0x1e')](function(){_0xa5f834[_0xbd94('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2466d2,_0x26aa89){return function(_0x6a3eba){if(!_0x6a3eba){_0x2466d2[_0xbd94('0x14')](0x194);}return _0x6a3eba;};}function handleError(_0x328cb,_0x452ca1){_0x452ca1=_0x452ca1||0x1f4;return function(_0x146993){logger[_0xbd94('0x20')](_0x146993[_0xbd94('0x21')]);if(_0x146993['name']){delete _0x146993[_0xbd94('0x22')];}_0x328cb[_0xbd94('0x15')](_0x452ca1)[_0xbd94('0x23')](_0x146993);};}exports[_0xbd94('0x24')]=function(_0x3faf34,_0x1a4649){var _0x52db27={},_0x175893={},_0x32cf5d={'count':0x0,'rows':[]};var _0x23bda4=_[_0xbd94('0x25')](db[_0xbd94('0x26')][_0xbd94('0x27')],function(_0xc6ba7f){return{'name':_0xc6ba7f['fieldName'],'type':_0xc6ba7f[_0xbd94('0x28')][_0xbd94('0x29')]};});_0x175893[_0xbd94('0x2a')]=_[_0xbd94('0x25')](_0x23bda4,_0xbd94('0x22'));_0x175893[_0xbd94('0x2b')]=_[_0xbd94('0x2c')](_0x3faf34[_0xbd94('0x2b')]);_0x175893['filters']=_['intersection'](_0x175893[_0xbd94('0x2a')],_0x175893[_0xbd94('0x2b')]);_0x52db27[_0xbd94('0x2d')]=_[_0xbd94('0x2e')](_0x175893[_0xbd94('0x2a')],qs['fields'](_0x3faf34[_0xbd94('0x2b')][_0xbd94('0x2f')]));_0x52db27[_0xbd94('0x2d')]=_0x52db27[_0xbd94('0x2d')][_0xbd94('0x30')]?_0x52db27['attributes']:_0x175893[_0xbd94('0x2a')];if(!_0x3faf34['query'][_0xbd94('0x31')](_0xbd94('0x32'))){_0x52db27[_0xbd94('0x1a')]=qs[_0xbd94('0x1a')](_0x3faf34['query'][_0xbd94('0x1a')]);_0x52db27[_0xbd94('0x18')]=qs[_0xbd94('0x18')](_0x3faf34[_0xbd94('0x2b')][_0xbd94('0x18')]);}_0x52db27[_0xbd94('0x33')]=qs[_0xbd94('0x34')](_0x3faf34[_0xbd94('0x2b')][_0xbd94('0x34')]);_0x52db27[_0xbd94('0x35')]=qs[_0xbd94('0x36')](_[_0xbd94('0x37')](_0x3faf34[_0xbd94('0x2b')],_0x175893[_0xbd94('0x36')]),_0x23bda4);if(_0x3faf34[_0xbd94('0x2b')][_0xbd94('0x38')]){_0x52db27[_0xbd94('0x35')]=_['merge'](_0x52db27[_0xbd94('0x35')],{'$or':_['map'](_0x23bda4,function(_0x48c6cb){if(_0x48c6cb[_0xbd94('0x28')]!=='VIRTUAL'){var _0x1e10d4={};_0x1e10d4[_0x48c6cb[_0xbd94('0x22')]]={'$like':'%'+_0x3faf34[_0xbd94('0x2b')][_0xbd94('0x38')]+'%'};return _0x1e10d4;}})});}_0x52db27=_[_0xbd94('0x39')]({},_0x52db27,_0x3faf34['options']);var _0x447d90={'where':_0x52db27[_0xbd94('0x35')]};return db[_0xbd94('0x26')][_0xbd94('0x1b')](_0x447d90)['then'](function(_0x44e257){_0x32cf5d[_0xbd94('0x1b')]=_0x44e257;if(_0x3faf34[_0xbd94('0x2b')][_0xbd94('0x3a')]){_0x52db27['include']=[{'all':!![]}];}return db[_0xbd94('0x26')][_0xbd94('0x3b')](_0x52db27);})[_0xbd94('0x1e')](function(_0x362435){_0x32cf5d['rows']=_0x362435;return _0x32cf5d;})[_0xbd94('0x1e')](respondWithFilteredResult(_0x1a4649,_0x52db27))[_0xbd94('0x3c')](handleError(_0x1a4649,null));};exports['show']=function(_0x3946ba,_0xc092ad){var _0x1a7a0a={'raw':!![],'where':{'id':_0x3946ba[_0xbd94('0x3d')]['id']}},_0x11f4d3={};_0x11f4d3[_0xbd94('0x2a')]=_[_0xbd94('0x2c')](db[_0xbd94('0x26')][_0xbd94('0x27')]);_0x11f4d3[_0xbd94('0x2b')]=_['keys'](_0x3946ba['query']);_0x11f4d3[_0xbd94('0x36')]=_[_0xbd94('0x2e')](_0x11f4d3['model'],_0x11f4d3[_0xbd94('0x2b')]);_0x1a7a0a[_0xbd94('0x2d')]=_[_0xbd94('0x2e')](_0x11f4d3[_0xbd94('0x2a')],qs[_0xbd94('0x2f')](_0x3946ba['query'][_0xbd94('0x2f')]));_0x1a7a0a[_0xbd94('0x2d')]=_0x1a7a0a[_0xbd94('0x2d')][_0xbd94('0x30')]?_0x1a7a0a[_0xbd94('0x2d')]:_0x11f4d3[_0xbd94('0x2a')];if(_0x3946ba[_0xbd94('0x2b')]['includeAll']){_0x1a7a0a[_0xbd94('0x3e')]=[{'all':!![]}];}_0x1a7a0a=_[_0xbd94('0x39')]({},_0x1a7a0a,_0x3946ba[_0xbd94('0x3f')]);return db['CmHopperBlack'][_0xbd94('0x40')](_0x1a7a0a)[_0xbd94('0x1e')](handleEntityNotFound(_0xc092ad,null))['then'](respondWithResult(_0xc092ad,null))[_0xbd94('0x3c')](handleError(_0xc092ad,null));};exports[_0xbd94('0x1d')]=function(_0x429186,_0x5b90b9){if(_0x429186[_0xbd94('0x41')]['id']){delete _0x429186['body']['id'];}return db['CmHopperBlack'][_0xbd94('0x40')]({'where':{'id':_0x429186[_0xbd94('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5b90b9,null))['then'](saveUpdates(_0x429186['body'],null))[_0xbd94('0x1e')](respondWithResult(_0x5b90b9,null))[_0xbd94('0x3c')](handleError(_0x5b90b9,null));};exports[_0xbd94('0x1f')]=function(_0x3d82ba,_0x29aaec){return db['CmHopperBlack']['find']({'where':{'id':_0x3d82ba['params']['id']}})[_0xbd94('0x1e')](handleEntityNotFound(_0x29aaec,null))[_0xbd94('0x1e')](removeEntity(_0x29aaec,null))[_0xbd94('0x3c')](handleError(_0x29aaec,null));};exports[_0xbd94('0x42')]=function(_0x47980e,_0x5d6263){return db[_0xbd94('0x26')][_0xbd94('0x42')]()[_0xbd94('0x1e')](respondWithResult(_0x5d6263,null))[_0xbd94('0x3c')](handleError(_0x5d6263,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 3256ea0..8101ac5 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 _0x9f11=['../../config/logger','rimraf','exports','CmHopperBlack','cm_hopper_black','lodash','util'];(function(_0x41931e,_0x3249bd){var _0x3b6dff=function(_0x115723){while(--_0x115723){_0x41931e['push'](_0x41931e['shift']());}};_0x3b6dff(++_0x3249bd);}(_0x9f11,0x101));var _0x19f1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9f11[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x19f1('0x0'));var util=require(_0x19f1('0x1'));var logger=require(_0x19f1('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x19f1('0x3'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x19f1('0x4')]=function(_0x573689,_0x1e1a13){return _0x573689['define'](_0x19f1('0x5'),attributes,{'tableName':_0x19f1('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4668=['bluebird','request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','util','../../config/logger','api','moment'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0x4668,0xb2));var _0x8466=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4668[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x8466('0x0'));var logger=require(_0x8466('0x1'))(_0x8466('0x2'));var moment=require(_0x8466('0x3'));var BPromise=require(_0x8466('0x4'));var rp=require(_0x8466('0x5'));var fs=require('fs');var path=require(_0x8466('0x6'));var rimraf=require('rimraf');var config=require(_0x8466('0x7'));var attributes=require(_0x8466('0x8'));module[_0x8466('0x9')]=function(_0x3ecf83,_0x210f46){return _0x3ecf83[_0x8466('0xa')](_0x8466('0xb'),attributes,{'tableName':_0x8466('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 7681d3d..e840c19 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 _0x4c7c=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','raw','options','where','limit','include','map','model','attributes','UpdateCmHopperBlack','body','DestroyCmHopperBlack','destroy','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x51c5f1,_0xdd129e){var _0xaa23ed=function(_0x2911c0){while(--_0x2911c0){_0x51c5f1['push'](_0x51c5f1['shift']());}};_0xaa23ed(++_0xdd129e);}(_0x4c7c,0x112));var _0xc4c7=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x4c7c[_0x3cb6dc];return _0x47ec89;};'use strict';var _=require(_0xc4c7('0x0'));var util=require(_0xc4c7('0x1'));var moment=require('moment');var BPromise=require(_0xc4c7('0x2'));var rs=require(_0xc4c7('0x3'));var fs=require('fs');var Redis=require(_0xc4c7('0x4'));var db=require(_0xc4c7('0x5'))['db'];var utils=require(_0xc4c7('0x6'));var logger=require('../../config/logger')(_0xc4c7('0x7'));var config=require(_0xc4c7('0x8'));var jayson=require(_0xc4c7('0x9'));var client=jayson[_0xc4c7('0xa')][_0xc4c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40f3bf,_0x41a41b,_0xc28bae){return new BPromise(function(_0x3c40f8,_0x492633){return client[_0xc4c7('0xc')](_0x40f3bf,_0xc28bae)[_0xc4c7('0xd')](function(_0x297a14){logger['info'](_0xc4c7('0xe'),_0x41a41b,_0xc4c7('0xf'));logger[_0xc4c7('0x10')](_0xc4c7('0x11'),_0x41a41b,_0xc4c7('0xf'),JSON[_0xc4c7('0x12')](_0x297a14));if(_0x297a14[_0xc4c7('0x13')]){if(_0x297a14['error'][_0xc4c7('0x14')]===0x1f4){logger[_0xc4c7('0x13')](_0xc4c7('0xe'),_0x41a41b,_0x297a14[_0xc4c7('0x13')][_0xc4c7('0x15')]);return _0x492633(_0x297a14[_0xc4c7('0x13')]['message']);}logger[_0xc4c7('0x13')](_0xc4c7('0xe'),_0x41a41b,_0x297a14[_0xc4c7('0x13')][_0xc4c7('0x15')]);return _0x3c40f8(_0x297a14[_0xc4c7('0x13')][_0xc4c7('0x15')]);}else{logger[_0xc4c7('0x16')]('CmHopperBlack,\x20%s,\x20%s',_0x41a41b,_0xc4c7('0xf'));_0x3c40f8(_0x297a14[_0xc4c7('0x17')]['message']);}})[_0xc4c7('0x18')](function(_0x1c1470){logger[_0xc4c7('0x13')](_0xc4c7('0xe'),_0x41a41b,_0x1c1470);_0x492633(_0x1c1470);});});}exports[_0xc4c7('0x19')]=function(_0x65539c){var _0xffd463=this;return new Promise(function(_0xd19b15,_0x257f86){return db[_0xc4c7('0x1a')][_0xc4c7('0x1b')]({'raw':_0x65539c['options']?_0x65539c['options'][_0xc4c7('0x1c')]===undefined?!![]:![]:!![],'where':_0x65539c[_0xc4c7('0x1d')]?_0x65539c['options'][_0xc4c7('0x1e')]||null:null,'attributes':_0x65539c[_0xc4c7('0x1d')]?_0x65539c[_0xc4c7('0x1d')]['attributes']||null:null,'limit':_0x65539c[_0xc4c7('0x1d')]?_0x65539c['options'][_0xc4c7('0x1f')]||null:null,'include':_0x65539c['options']?_0x65539c[_0xc4c7('0x1d')][_0xc4c7('0x20')]?_[_0xc4c7('0x21')](_0x65539c['options'][_0xc4c7('0x20')],function(_0x27810a){return{'model':db[_0x27810a[_0xc4c7('0x22')]],'as':_0x27810a['as'],'attributes':_0x27810a[_0xc4c7('0x23')],'include':_0x27810a[_0xc4c7('0x20')]?_[_0xc4c7('0x21')](_0x27810a[_0xc4c7('0x20')],function(_0x439bef){return{'model':db[_0x439bef['model']],'as':_0x439bef['as'],'attributes':_0x439bef['attributes'],'include':_0x439bef[_0xc4c7('0x20')]?_[_0xc4c7('0x21')](_0x439bef['include'],function(_0x32a642){return{'model':db[_0x32a642['model']],'as':_0x32a642['as'],'attributes':_0x32a642[_0xc4c7('0x23')]};}):[]};}):[]};}):[]:[]})[_0xc4c7('0xd')](function(_0x5888d6){logger['info']('GetCmHopperBlack',_0x65539c);logger[_0xc4c7('0x10')]('GetCmHopperBlack',_0x65539c,JSON[_0xc4c7('0x12')](_0x5888d6));_0xd19b15(_0x5888d6);})[_0xc4c7('0x18')](function(_0x56c526){logger['error'](_0xc4c7('0x19'),_0x56c526[_0xc4c7('0x15')],_0x65539c);_0x257f86(_0xffd463[_0xc4c7('0x13')](0x1f4,_0x56c526[_0xc4c7('0x15')]));});});};exports[_0xc4c7('0x24')]=function(_0x585499){var _0x3f220c=this;return new Promise(function(_0x41251a,_0x934334){return db[_0xc4c7('0x1a')]['update'](_0x585499[_0xc4c7('0x25')],{'raw':_0x585499[_0xc4c7('0x1d')]?_0x585499[_0xc4c7('0x1d')][_0xc4c7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x585499[_0xc4c7('0x1d')]?_0x585499['options'][_0xc4c7('0x1e')]||null:null,'attributes':_0x585499['options']?_0x585499[_0xc4c7('0x1d')][_0xc4c7('0x23')]||null:null,'limit':_0x585499[_0xc4c7('0x1d')]?_0x585499[_0xc4c7('0x1d')][_0xc4c7('0x1f')]||null:null})['then'](function(_0x223606){logger[_0xc4c7('0x16')](_0xc4c7('0x24'),_0x585499);logger[_0xc4c7('0x10')]('UpdateCmHopperBlack',_0x585499,JSON[_0xc4c7('0x12')](_0x223606));_0x41251a(_0x223606);})['catch'](function(_0x46e446){logger[_0xc4c7('0x13')](_0xc4c7('0x24'),_0x46e446[_0xc4c7('0x15')],_0x585499);_0x934334(_0x3f220c[_0xc4c7('0x13')](0x1f4,_0x46e446['message']));});});};exports[_0xc4c7('0x26')]=function(_0x1456db){var _0x2a6835=this;return new Promise(function(_0x5ea2ee,_0x742246){return db[_0xc4c7('0x1a')][_0xc4c7('0x27')]({'where':_0x1456db[_0xc4c7('0x1d')]?_0x1456db[_0xc4c7('0x1d')][_0xc4c7('0x1e')]||null:null})['then'](function(_0x16bcec){logger[_0xc4c7('0x16')](_0xc4c7('0x26'),_0x1456db);logger[_0xc4c7('0x10')](_0xc4c7('0x26'),_0x1456db,JSON[_0xc4c7('0x12')](_0x16bcec));_0x5ea2ee(_0x16bcec);})[_0xc4c7('0x18')](function(_0xbf9f3b){logger['error']('DestroyCmHopperBlack',_0xbf9f3b[_0xc4c7('0x15')],_0x1456db);_0x742246(_0x2a6835['error'](0x1f4,_0xbf9f3b[_0xc4c7('0x15')]));});});}; \ No newline at end of file +var _0x7436=['jayson/promise','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','limit','include','map','model','body','raw','UpdateCmHopperBlack','destroy','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x7436,0x117));var _0x6743=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x7436[_0xb1cf84];return _0x4bad2e;};'use strict';var _=require(_0x6743('0x0'));var util=require('util');var moment=require(_0x6743('0x1'));var BPromise=require(_0x6743('0x2'));var rs=require(_0x6743('0x3'));var fs=require('fs');var Redis=require(_0x6743('0x4'));var db=require(_0x6743('0x5'))['db'];var utils=require(_0x6743('0x6'));var logger=require(_0x6743('0x7'))('rpc');var config=require(_0x6743('0x8'));var jayson=require(_0x6743('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59568e,_0x3c0b6a,_0x23587c){return new BPromise(function(_0x36fac4,_0x4c6c9f){return client[_0x6743('0xa')](_0x59568e,_0x23587c)[_0x6743('0xb')](function(_0x40764a){logger[_0x6743('0xc')](_0x6743('0xd'),_0x3c0b6a,'request\x20sent');logger[_0x6743('0xe')](_0x6743('0xf'),_0x3c0b6a,'request\x20sent',JSON[_0x6743('0x10')](_0x40764a));if(_0x40764a[_0x6743('0x11')]){if(_0x40764a[_0x6743('0x11')][_0x6743('0x12')]===0x1f4){logger[_0x6743('0x11')](_0x6743('0xd'),_0x3c0b6a,_0x40764a[_0x6743('0x11')]['message']);return _0x4c6c9f(_0x40764a[_0x6743('0x11')]['message']);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x3c0b6a,_0x40764a[_0x6743('0x11')][_0x6743('0x13')]);return _0x36fac4(_0x40764a[_0x6743('0x11')][_0x6743('0x13')]);}else{logger[_0x6743('0xc')](_0x6743('0xd'),_0x3c0b6a,'request\x20sent');_0x36fac4(_0x40764a['result'][_0x6743('0x13')]);}})[_0x6743('0x14')](function(_0x5a2035){logger[_0x6743('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x3c0b6a,_0x5a2035);_0x4c6c9f(_0x5a2035);});});}exports[_0x6743('0x15')]=function(_0x20e4f7){var _0xc499db=this;return new Promise(function(_0x286614,_0x422912){return db[_0x6743('0x16')][_0x6743('0x17')]({'raw':_0x20e4f7[_0x6743('0x18')]?_0x20e4f7['options']['raw']===undefined?!![]:![]:!![],'where':_0x20e4f7['options']?_0x20e4f7['options'][_0x6743('0x19')]||null:null,'attributes':_0x20e4f7[_0x6743('0x18')]?_0x20e4f7[_0x6743('0x18')][_0x6743('0x1a')]||null:null,'limit':_0x20e4f7[_0x6743('0x18')]?_0x20e4f7[_0x6743('0x18')][_0x6743('0x1b')]||null:null,'include':_0x20e4f7['options']?_0x20e4f7[_0x6743('0x18')][_0x6743('0x1c')]?_[_0x6743('0x1d')](_0x20e4f7[_0x6743('0x18')][_0x6743('0x1c')],function(_0x490867){return{'model':db[_0x490867[_0x6743('0x1e')]],'as':_0x490867['as'],'attributes':_0x490867[_0x6743('0x1a')],'include':_0x490867[_0x6743('0x1c')]?_[_0x6743('0x1d')](_0x490867[_0x6743('0x1c')],function(_0x3c3b89){return{'model':db[_0x3c3b89[_0x6743('0x1e')]],'as':_0x3c3b89['as'],'attributes':_0x3c3b89['attributes'],'include':_0x3c3b89[_0x6743('0x1c')]?_[_0x6743('0x1d')](_0x3c3b89[_0x6743('0x1c')],function(_0x273ec0){return{'model':db[_0x273ec0[_0x6743('0x1e')]],'as':_0x273ec0['as'],'attributes':_0x273ec0[_0x6743('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6743('0xb')](function(_0x320058){logger[_0x6743('0xc')]('GetCmHopperBlack',_0x20e4f7);logger['debug'](_0x6743('0x15'),_0x20e4f7,JSON[_0x6743('0x10')](_0x320058));_0x286614(_0x320058);})['catch'](function(_0x415498){logger[_0x6743('0x11')]('GetCmHopperBlack',_0x415498[_0x6743('0x13')],_0x20e4f7);_0x422912(_0xc499db[_0x6743('0x11')](0x1f4,_0x415498['message']));});});};exports['UpdateCmHopperBlack']=function(_0x14d06a){var _0x4aaa6f=this;return new Promise(function(_0xfee719,_0x30a7f9){return db['CmHopperBlack']['update'](_0x14d06a[_0x6743('0x1f')],{'raw':_0x14d06a[_0x6743('0x18')]?_0x14d06a[_0x6743('0x18')][_0x6743('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14d06a['options']?_0x14d06a[_0x6743('0x18')][_0x6743('0x19')]||null:null,'attributes':_0x14d06a[_0x6743('0x18')]?_0x14d06a[_0x6743('0x18')]['attributes']||null:null,'limit':_0x14d06a['options']?_0x14d06a[_0x6743('0x18')][_0x6743('0x1b')]||null:null})[_0x6743('0xb')](function(_0x24d51e){logger[_0x6743('0xc')](_0x6743('0x21'),_0x14d06a);logger['debug'](_0x6743('0x21'),_0x14d06a,JSON[_0x6743('0x10')](_0x24d51e));_0xfee719(_0x24d51e);})[_0x6743('0x14')](function(_0x22462b){logger[_0x6743('0x11')](_0x6743('0x21'),_0x22462b['message'],_0x14d06a);_0x30a7f9(_0x4aaa6f[_0x6743('0x11')](0x1f4,_0x22462b[_0x6743('0x13')]));});});};exports['DestroyCmHopperBlack']=function(_0x573632){var _0x515f46=this;return new Promise(function(_0x30221d,_0x2222de){return db[_0x6743('0x16')][_0x6743('0x22')]({'where':_0x573632[_0x6743('0x18')]?_0x573632[_0x6743('0x18')]['where']||null:null})['then'](function(_0xd17d0){logger[_0x6743('0xc')]('DestroyCmHopperBlack',_0x573632);logger[_0x6743('0xe')](_0x6743('0x23'),_0x573632,JSON[_0x6743('0x10')](_0xd17d0));_0x30221d(_0xd17d0);})[_0x6743('0x14')](function(_0x34f8e5){logger['error'](_0x6743('0x23'),_0x34f8e5[_0x6743('0x13')],_0x573632);_0x2222de(_0x515f46[_0x6743('0x11')](0x1f4,_0x34f8e5[_0x6743('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 33883c9..3d7e15a 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 _0x6455=['index','/describe','/:id','show','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0x6455,0x97));var _0x5645=function(_0x364ad0,_0x5183b4){_0x364ad0=_0x364ad0-0x0;var _0x1f8b07=_0x6455[_0x364ad0];return _0x1f8b07;};'use strict';var multer=require(_0x5645('0x0'));var util=require('util');var path=require(_0x5645('0x1'));var timeout=require(_0x5645('0x2'));var express=require(_0x5645('0x3'));var router=express[_0x5645('0x4')]();var fs_extra=require(_0x5645('0x5'));var auth=require(_0x5645('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5645('0x7'));var controller=require(_0x5645('0x8'));router[_0x5645('0x9')]('/',auth[_0x5645('0xa')](),controller[_0x5645('0xb')]);router[_0x5645('0x9')](_0x5645('0xc'),auth[_0x5645('0xa')](),controller['describe']);router['get'](_0x5645('0xd'),auth[_0x5645('0xa')](),controller[_0x5645('0xe')]);router[_0x5645('0xf')](_0x5645('0xd'),auth[_0x5645('0xa')](),controller['update']);router[_0x5645('0x10')](_0x5645('0xd'),auth[_0x5645('0xa')](),controller[_0x5645('0x11')]);module['exports']=router; \ No newline at end of file +var _0x326f=['../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','show','put','/:id','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x326f,0xd1));var _0xf326=function(_0x498d20,_0x4d1c12){_0x498d20=_0x498d20-0x0;var _0x1d44c6=_0x326f[_0x498d20];return _0x1d44c6;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')](_0xf326('0xf'),auth[_0xf326('0xa')](),controller[_0xf326('0x10')]);router['delete'](_0xf326('0xf'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 7030947..431d771 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 _0x8ccb=['DATE','getDataValue','endtime','setDataValue','followuptime','seconds','dispositionat','BOOLEAN','sequelize','moment','INTEGER','STRING'];(function(_0x55e6f8,_0x545b8d){var _0x350cf9=function(_0x3c1e03){while(--_0x3c1e03){_0x55e6f8['push'](_0x55e6f8['shift']());}};_0x350cf9(++_0x545b8d);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x8ccb[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require(_0xb8cc('0x0'));var moment=require(_0xb8cc('0x1'));module['exports']={'state':{'type':Sequelize[_0xb8cc('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb8cc('0x3')]},'scheduledat':{'type':Sequelize[_0xb8cc('0x4')]},'countbusyretry':{'type':Sequelize[_0xb8cc('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb8cc('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb8cc('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xb8cc('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb8cc('0x3')]},'calleridname':{'type':Sequelize[_0xb8cc('0x3')]},'starttime':{'type':Sequelize[_0xb8cc('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb8cc('0x4')]},'droptime':{'type':Sequelize[_0xb8cc('0x4')]},'endtime':{'type':Sequelize[_0xb8cc('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb8cc('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb8cc('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xb8cc('0x3')]},'campaigntype':{'type':Sequelize[_0xb8cc('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xb8cc('0x3')]},'secondDisposition':{'type':Sequelize[_0xb8cc('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xb8cc('0x4')],'set':function(_0x2c1cbc){var _0xfd89e0=this[_0xb8cc('0x5')](_0xb8cc('0x6'));if(_0xfd89e0&&_0x2c1cbc){this[_0xb8cc('0x7')](_0xb8cc('0x8'),moment(_0x2c1cbc)['diff'](moment(_0xfd89e0),_0xb8cc('0x9')));}return this['setDataValue'](_0xb8cc('0xa'),_0x2c1cbc);}},'amd':{'type':Sequelize[_0xb8cc('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb8cc('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb8cc('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb8cc('0x4')]},'callback':{'type':Sequelize[_0xb8cc('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb8cc('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb8cc('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb8cc('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xb8cc('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb8cc('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb8cc('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb8cc('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x93b2=['getDataValue','endtime','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER'];(function(_0x14638d,_0x4c2fb1){var _0x5e2b19=function(_0x127601){while(--_0x127601){_0x14638d['push'](_0x14638d['shift']());}};_0x5e2b19(++_0x4c2fb1);}(_0x93b2,0x7c));var _0x293b=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x93b2[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require(_0x293b('0x0'));var moment=require(_0x293b('0x1'));module[_0x293b('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x293b('0x3')]},'scheduledat':{'type':Sequelize[_0x293b('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x293b('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x293b('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x293b('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x293b('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x293b('0x3')]},'originatecalleridname':{'type':Sequelize[_0x293b('0x3')]},'calleridnum':{'type':Sequelize[_0x293b('0x3')]},'calleridname':{'type':Sequelize[_0x293b('0x3')]},'starttime':{'type':Sequelize[_0x293b('0x4')]},'responsetime':{'type':Sequelize[_0x293b('0x4')]},'answertime':{'type':Sequelize[_0x293b('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x293b('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x293b('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x293b('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x293b('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x293b('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x293b('0x3')]},'reason':{'type':Sequelize[_0x293b('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x293b('0x3')]},'thirdDisposition':{'type':Sequelize[_0x293b('0x3')]},'dispositionat':{'type':Sequelize[_0x293b('0x4')],'set':function(_0x23eacf){var _0xc1549c=this[_0x293b('0x6')](_0x293b('0x7'));if(_0xc1549c&&_0x23eacf){this['setDataValue'](_0x293b('0x8'),moment(_0x23eacf)[_0x293b('0x9')](moment(_0xc1549c),_0x293b('0xa')));}return this['setDataValue'](_0x293b('0xb'),_0x23eacf);}},'amd':{'type':Sequelize[_0x293b('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x293b('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x293b('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x293b('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x293b('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x293b('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x293b('0x4')]},'recallme':{'type':Sequelize[_0x293b('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x293b('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x293b('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x293b('0x5')],'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 28fabe5..ddb5b75 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 _0xe3da=['COUNT','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','noSuchContacts','congestionContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','ContactId','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','from','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','createdAt','updatedAt','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts'];(function(_0x2afb3a,_0x563228){var _0x382182=function(_0x4548b5){while(--_0x4548b5){_0x2afb3a['push'](_0x2afb3a['shift']());}};_0x382182(++_0x563228);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':!![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['describe']()['then'](respondWithResult(_0x4ed0f9,null))['catch'](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0xc8f551,_0x39f213){if(_0xc8f551[_0xae3d('0x4f')]['uniqueid']){delete _0xc8f551['body'][_0xae3d('0x50')];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'uniqueid':_0xc8f551[_0xae3d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39f213,null))[_0xae3d('0x28')](saveUpdates(_0xc8f551[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x39f213,null))[_0xae3d('0x48')](handleError(_0x39f213,null));};exports[_0xae3d('0x51')]=function(_0x38ccf1,_0x3e30ea,_0x291c7d){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x38ccf1[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),'noSuchContacts'],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),_0xae3d('0x56')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5a')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db['sequelize']['literal'](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5d')))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x61')))),'answeringMachine']]})[_0xae3d('0x28')](handleEntityNotFound(_0x3e30ea,null))[_0xae3d('0x28')](respondWithResult(_0x3e30ea,null))[_0xae3d('0x48')](handleError(_0x3e30ea,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x3a39ed,_0x31b362,_0x253ee4){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'CampaignId':_0x3a39ed[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),_0xae3d('0x62')],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),'noAnswerContacts'],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5a')))),_0xae3d('0x63')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x61')))),_0xae3d('0x64')]]})['then'](handleEntityNotFound(_0x31b362,null))[_0xae3d('0x28')](respondWithResult(_0x31b362,null))['catch'](handleError(_0x31b362,null));};exports[_0xae3d('0x65')]=function(_0x115e99,_0x26c409,_0x4709ea){return db[_0xae3d('0x66')]['find']({'where':{'id':_0x115e99[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x26c409,null))[_0xae3d('0x28')](function(_0x5f1e9c){var _0x546991;if(_0x5f1e9c){_0x546991=squel[_0xae3d('0x67')]()[_0xae3d('0x68')]('cm_hopper')['fromQuery']([_0xae3d('0x69'),'scheduledAt',_0xae3d('0x6a'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('ANY_VALUE(calleridnum)','phone')[_0xae3d('0x6c')](_0xae3d('0x6d'),_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),_0xae3d('0x6a'))[_0xae3d('0x6c')]('ANY_VALUE(ListId)',_0xae3d('0x70'))[_0xae3d('0x6c')](_0xae3d('0x71'),_0xae3d('0x72'))[_0xae3d('0x6c')](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')](_0xae3d('0x6d'),'updatedAt')['from'](_0xae3d('0x73'))[_0xae3d('0x3d')]('VoiceQueueId\x20=\x20?',_0x115e99[_0xae3d('0x4a')]['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x115e99[_0xae3d('0x4f')][_0xae3d('0x75')]['toString']())['where'](_0xae3d('0x76'))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')](_0xae3d('0x69'))['from'](_0xae3d('0x78'))[_0xae3d('0x3d')](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')]('calleridnum')[_0xae3d('0x7a')]('cm_hopper_final')['where'](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x7b')))[_0xae3d('0x7c')]('ContactId'))[_0xae3d('0x74')]();return db[_0xae3d('0x52')][_0xae3d('0x34')](_0x546991);}return[];})[_0xae3d('0x28')](respondWithResult(_0x26c409,null))[_0xae3d('0x48')](handleError(_0x26c409,null));};exports[_0xae3d('0x7d')]=function(_0x1c5f67,_0xa083d0,_0x26e422){return db[_0xae3d('0x7e')][_0xae3d('0x4d')]({'where':{'id':_0x1c5f67[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0xa083d0,null))[_0xae3d('0x28')](function(_0xf281f5){var _0x3261e5;if(_0xf281f5){_0x3261e5=squel[_0xae3d('0x67')]()['into'](_0xae3d('0x78'))[_0xae3d('0x7f')]([_0xae3d('0x69'),_0xae3d('0x6e'),_0xae3d('0x6a'),'ListId',_0xae3d('0x80'),_0xae3d('0x81'),_0xae3d('0x82')],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')](_0xae3d('0x83'),_0xae3d('0x69'))[_0xae3d('0x6c')]('NOW()',_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),'ContactId')[_0xae3d('0x6c')](_0xae3d('0x84'),_0xae3d('0x70'))['field'](_0xae3d('0x85'),_0xae3d('0x80'))['field'](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')]('NOW()',_0xae3d('0x82'))[_0xae3d('0x7a')](_0xae3d('0x73'))[_0xae3d('0x3d')](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x1c5f67['body'][_0xae3d('0x75')][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x76'))['where'](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('phone')['from'](_0xae3d('0x78'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()['field'](_0xae3d('0x87'))[_0xae3d('0x7a')](_0xae3d('0x73'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x204'))['group'](_0xae3d('0x6a')))['toString']();return db['sequelize'][_0xae3d('0x34')](_0x3261e5);}return[];})['then'](respondWithResult(_0xa083d0,null))[_0xae3d('0x48')](handleError(_0xa083d0,null));};exports['checkContactHopper']=function(_0x31f606,_0x47aa7a,_0x27c0ff){return db['CmHopper'][_0xae3d('0x88')]({'where':{'VoiceQueueId':_0x31f606['body'][_0xae3d('0x72')],'CampaignId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x80')],'ContactId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x6a')]}})[_0xae3d('0x28')](handleEntityNotFound(_0x47aa7a,null))[_0xae3d('0x28')](function(_0x95c4ce){if(_0x95c4ce){return _0x95c4ce;}return null;})[_0xae3d('0x28')](respondWithResult(_0x47aa7a,null))['catch'](handleError(_0x47aa7a,null));}; \ No newline at end of file +var _0xc1c6=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','CmHopperFinal','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','ANY_VALUE(ContactId)','field','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','CmHopper','findOne','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x674a42,_0xca5661){_0x674a42=_0x674a42-0x0;var _0x35381a=_0xc1c6[_0x674a42];return _0x35381a;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['CmHopperFinal']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':!![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['CmHopperFinal'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['describe']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')]()[_0x6c1c('0x25')](respondWithResult(_0x58d075,null))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x26cf7f,_0x52c14d){if(_0x26cf7f[_0x6c1c('0x48')][_0x6c1c('0x49')]){delete _0x26cf7f['body'][_0x6c1c('0x49')];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'uniqueid':_0x26cf7f[_0x6c1c('0x43')]['id']}})['then'](handleEntityNotFound(_0x52c14d,null))[_0x6c1c('0x25')](saveUpdates(_0x26cf7f[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0x52c14d,null))['catch'](handleError(_0x52c14d,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x56b367,_0x5714a6,_0x5008b7){return db[_0x6c1c('0x2b')][_0x6c1c('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x56b367['params']['id']},'attributes':[[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x6c1c('0x4c')))),_0x6c1c('0x4d')],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x4f')))),_0x6c1c('0x50')],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x6c1c('0x51')))),_0x6c1c('0x52')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x53')))),'congestionContacts'],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x6c1c('0x54')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x55')))),_0x6c1c('0x56')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize'][_0x6c1c('0x4e')](_0x6c1c('0x57')))),_0x6c1c('0x58')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x59')))),'answeringMachine']]})[_0x6c1c('0x25')](handleEntityNotFound(_0x5714a6,null))[_0x6c1c('0x25')](respondWithResult(_0x5714a6,null))[_0x6c1c('0x41')](handleError(_0x5714a6,null));};exports[_0x6c1c('0x5a')]=function(_0x14f3b5,_0x3229e6,_0xed095f){return db['CmHopperFinal'][_0x6c1c('0x3f')]({'raw':![],'where':{'CampaignId':_0x14f3b5['params']['id']},'attributes':[[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal'](_0x6c1c('0x4c')))),_0x6c1c('0x4d')],[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x4f')))),_0x6c1c('0x50')],[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x51')))),_0x6c1c('0x52')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal'](_0x6c1c('0x53')))),_0x6c1c('0x5b')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x5c')))),_0x6c1c('0x54')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x6c1c('0x58')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x59')))),_0x6c1c('0x5d')]]})[_0x6c1c('0x25')](handleEntityNotFound(_0x3229e6,null))[_0x6c1c('0x25')](respondWithResult(_0x3229e6,null))['catch'](handleError(_0x3229e6,null));};exports[_0x6c1c('0x5e')]=function(_0x16b741,_0x204e78,_0x5a919a){return db['VoiceQueue']['find']({'where':{'id':_0x16b741[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x204e78,null))['then'](function(_0x10e499){var _0x579ca3;if(_0x10e499){_0x579ca3=squel[_0x6c1c('0x5f')]()[_0x6c1c('0x60')](_0x6c1c('0x61'))[_0x6c1c('0x62')](['phone',_0x6c1c('0x63'),_0x6c1c('0x64'),'ListId','VoiceQueueId',_0x6c1c('0x65'),_0x6c1c('0x66')],squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x68'),_0x6c1c('0x69'))['field']('NOW()','scheduledAt')['field'](_0x6c1c('0x6a'),'ContactId')[_0x6c1c('0x6b')](_0x6c1c('0x6c'),_0x6c1c('0x6d'))['field'](_0x6c1c('0x6e'),_0x6c1c('0x6f'))[_0x6c1c('0x6b')](_0x6c1c('0x70'),_0x6c1c('0x65'))['field'](_0x6c1c('0x70'),'updatedAt')[_0x6c1c('0x71')](_0x6c1c('0x72'))[_0x6c1c('0x38')](_0x6c1c('0x73'),_0x16b741[_0x6c1c('0x43')]['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x75'),_0x16b741['body'][_0x6c1c('0x76')]['toString']())['where'](_0x6c1c('0x77'))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x69'))['from'](_0x6c1c('0x61'))['where'](_0x6c1c('0x73'),_0x16b741[_0x6c1c('0x43')]['id'][_0x6c1c('0x74')]()))['where'](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')]('calleridnum')[_0x6c1c('0x71')](_0x6c1c('0x72'))[_0x6c1c('0x38')](_0x6c1c('0x73'),_0x16b741['params']['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x79')))[_0x6c1c('0x7a')](_0x6c1c('0x64')))['toString']();return db[_0x6c1c('0x4a')][_0x6c1c('0x30')](_0x579ca3);}return[];})[_0x6c1c('0x25')](respondWithResult(_0x204e78,null))[_0x6c1c('0x41')](handleError(_0x204e78,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1ad9e2,_0x44d8c4,_0x33a141){return db['Campaign'][_0x6c1c('0x46')]({'where':{'id':_0x1ad9e2[_0x6c1c('0x43')]['id']}})['then'](handleEntityNotFound(_0x44d8c4,null))[_0x6c1c('0x25')](function(_0x50b56b){var _0x1a493a;if(_0x50b56b){_0x1a493a=squel[_0x6c1c('0x5f')]()[_0x6c1c('0x60')](_0x6c1c('0x61'))['fromQuery']([_0x6c1c('0x69'),_0x6c1c('0x63'),_0x6c1c('0x64'),'ListId',_0x6c1c('0x7b'),_0x6c1c('0x65'),_0x6c1c('0x66')],squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x68'),_0x6c1c('0x69'))[_0x6c1c('0x6b')]('NOW()',_0x6c1c('0x63'))['field'](_0x6c1c('0x6a'),_0x6c1c('0x64'))[_0x6c1c('0x6b')](_0x6c1c('0x6c'),_0x6c1c('0x6d'))[_0x6c1c('0x6b')](_0x6c1c('0x7c'),_0x6c1c('0x7b'))['field'](_0x6c1c('0x70'),'createdAt')[_0x6c1c('0x6b')](_0x6c1c('0x70'),_0x6c1c('0x66'))[_0x6c1c('0x71')]('cm_hopper_final')[_0x6c1c('0x38')](_0x6c1c('0x7d'),_0x1ad9e2[_0x6c1c('0x43')]['id']['toString']())[_0x6c1c('0x38')](_0x6c1c('0x75'),_0x1ad9e2['body']['state'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x77'))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')](_0x6c1c('0x69'))[_0x6c1c('0x71')](_0x6c1c('0x61'))[_0x6c1c('0x38')](_0x6c1c('0x7d'),_0x1ad9e2['params']['id'][_0x6c1c('0x74')]()))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')](_0x6c1c('0x7e'))[_0x6c1c('0x71')]('cm_hopper_final')[_0x6c1c('0x38')]('CampaignId\x20=\x20?',_0x1ad9e2['params']['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x79')))[_0x6c1c('0x7a')](_0x6c1c('0x64')))[_0x6c1c('0x74')]();return db[_0x6c1c('0x4a')][_0x6c1c('0x30')](_0x1a493a);}return[];})[_0x6c1c('0x25')](respondWithResult(_0x44d8c4,null))[_0x6c1c('0x41')](handleError(_0x44d8c4,null));};exports['checkContactHopper']=function(_0x3e40b6,_0x654041,_0x1a0da8){return db[_0x6c1c('0x7f')][_0x6c1c('0x80')]({'where':{'VoiceQueueId':_0x3e40b6[_0x6c1c('0x48')][_0x6c1c('0x6f')],'CampaignId':_0x3e40b6[_0x6c1c('0x48')]['CampaignId'],'ContactId':_0x3e40b6[_0x6c1c('0x48')][_0x6c1c('0x64')]}})[_0x6c1c('0x25')](handleEntityNotFound(_0x654041,null))[_0x6c1c('0x25')](function(_0x385629){if(_0x385629){return _0x385629;}return null;})[_0x6c1c('0x25')](respondWithResult(_0x654041,null))[_0x6c1c('0x41')](handleError(_0x654041,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 206d0ff..ad13cbe 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 _0xd79f=['cm_hopper_final','calleridnum','uniqueid','lodash','util','moment','path','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal'];(function(_0x2075f8,_0x43fba4){var _0x5ed2f6=function(_0x53c4f7){while(--_0x53c4f7){_0x2075f8['push'](_0x2075f8['shift']());}};_0x5ed2f6(++_0x43fba4);}(_0xd79f,0x71));var _0xfd79=function(_0x6a2f2,_0x453534){_0x6a2f2=_0x6a2f2-0x0;var _0x121340=_0xd79f[_0x6a2f2];return _0x121340;};'use strict';var _=require(_0xfd79('0x0'));var util=require(_0xfd79('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfd79('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd79('0x3'));var rimraf=require('rimraf');var config=require(_0xfd79('0x4'));var attributes=require(_0xfd79('0x5'));module[_0xfd79('0x6')]=function(_0x3d46fe,_0x5474f7){return _0x3d46fe['define'](_0xfd79('0x7'),attributes,{'tableName':_0xfd79('0x8'),'paranoid':![],'indexes':[{'name':_0xfd79('0x9'),'fields':[_0xfd79('0x9')]},{'name':_0xfd79('0xa'),'fields':[_0xfd79('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd2da=['lodash','util','api','request-promise','path','rimraf','../../config/environment','define','CmHopperFinal','calleridnum','uniqueid'];(function(_0x3b8f7e,_0x4d8884){var _0x5e0231=function(_0x3cb74d){while(--_0x3cb74d){_0x3b8f7e['push'](_0x3b8f7e['shift']());}};_0x5e0231(++_0x4d8884);}(_0xd2da,0xf2));var _0xad2d=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0xd2da[_0x5471ec];return _0x121d4c;};'use strict';var _=require(_0xad2d('0x0'));var util=require(_0xad2d('0x1'));var logger=require('../../config/logger')(_0xad2d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xad2d('0x3'));var fs=require('fs');var path=require(_0xad2d('0x4'));var rimraf=require(_0xad2d('0x5'));var config=require(_0xad2d('0x6'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x3406db,_0x4aae00){return _0x3406db[_0xad2d('0x7')](_0xad2d('0x8'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xad2d('0x9'),'fields':[_0xad2d('0x9')]},{'name':'uniqueid','fields':[_0xad2d('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 b24694a..c1a9138 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x3129c4,_0xe7d5af){var _0x329bf4=function(_0x208ffc){while(--_0x208ffc){_0x3129c4['push'](_0x3129c4['shift']());}};_0x329bf4(++_0xe7d5af);}(_0xb10b,0x12a));var _0xbb10=function(_0x47327a,_0xa744ab){_0x47327a=_0x47327a-0x0;var _0x258c4c=_0xb10b[_0x47327a];return _0x258c4c;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x58ca15,_0x4c03d7){var _0x67d3a0=function(_0x463455){while(--_0x463455){_0x58ca15['push'](_0x58ca15['shift']());}};_0x67d3a0(++_0x4c03d7);}(_0xb10b,0x12a));var _0xbb10=function(_0x11f1cf,_0x4cee87){_0x11f1cf=_0x11f1cf-0x0;var _0x22695a=_0xb10b[_0x11f1cf];return _0x22695a;};'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 ba6ba27..30308c7 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 _0x7ce8=['../../config/environment','./cmHopperFinal.controller','isAuthenticated','get','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4faa15,_0x26f2e1){var _0x2b7113=function(_0x415c8f){while(--_0x415c8f){_0x4faa15['push'](_0x4faa15['shift']());}};_0x2b7113(++_0x26f2e1);}(_0x7ce8,0x165));var _0x87ce=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x7ce8[_0x3e961c];return _0x474f9c;};'use strict';var multer=require(_0x87ce('0x0'));var util=require(_0x87ce('0x1'));var path=require(_0x87ce('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x87ce('0x3')]();var fs_extra=require(_0x87ce('0x4'));var auth=require(_0x87ce('0x5'));var interaction=require(_0x87ce('0x6'));var config=require(_0x87ce('0x7'));var controller=require(_0x87ce('0x8'));router['get']('/',auth[_0x87ce('0x9')](),controller['index']);router[_0x87ce('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x87ce('0xb')]);router[_0x87ce('0xa')](_0x87ce('0xc'),auth[_0x87ce('0x9')](),controller[_0x87ce('0xd')]);router['get'](_0x87ce('0xe'),auth['isAuthenticated'](),controller[_0x87ce('0xf')]);router[_0x87ce('0xa')](_0x87ce('0x10'),auth[_0x87ce('0x9')](),controller[_0x87ce('0x11')]);router[_0x87ce('0x12')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0x87ce('0x13')]);router[_0x87ce('0x12')](_0x87ce('0x14'),auth['isAuthenticated'](),controller[_0x87ce('0x15')]);router['post'](_0x87ce('0x16'),auth[_0x87ce('0x9')](),controller[_0x87ce('0x17')]);router[_0x87ce('0x18')](_0x87ce('0xc'),auth[_0x87ce('0x9')](),controller['update']);module[_0x87ce('0x19')]=router; \ No newline at end of file +var _0xa478=['/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','update','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal'];(function(_0x3d156e,_0x51639d){var _0x3fcc89=function(_0x78f17){while(--_0x78f17){_0x3d156e['push'](_0x3d156e['shift']());}};_0x3fcc89(++_0x51639d);}(_0xa478,0x1ea));var _0x8a47=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa478[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var path=require('path');var timeout=require(_0x8a47('0x2'));var express=require(_0x8a47('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8a47('0x4'));var interaction=require(_0x8a47('0x5'));var config=require('../../config/environment');var controller=require(_0x8a47('0x6'));router[_0x8a47('0x7')]('/',auth[_0x8a47('0x8')](),controller[_0x8a47('0x9')]);router[_0x8a47('0x7')]('/describe',auth[_0x8a47('0x8')](),controller[_0x8a47('0xa')]);router[_0x8a47('0x7')](_0x8a47('0xb'),auth[_0x8a47('0x8')](),controller['show']);router[_0x8a47('0x7')](_0x8a47('0xc'),auth['isAuthenticated'](),controller[_0x8a47('0xd')]);router['get'](_0x8a47('0xe'),auth[_0x8a47('0x8')](),controller[_0x8a47('0xf')]);router[_0x8a47('0x10')](_0x8a47('0x11'),auth[_0x8a47('0x8')](),controller[_0x8a47('0x12')]);router[_0x8a47('0x10')](_0x8a47('0x13'),auth['isAuthenticated'](),controller[_0x8a47('0x14')]);router['post'](_0x8a47('0x15'),auth[_0x8a47('0x8')](),controller['checkContactHopper']);router['put']('/:id',auth[_0x8a47('0x8')](),controller[_0x8a47('0x16')]);module[_0x8a47('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index b170a21..2bac5bb 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 _0x5a51=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x20b208,_0x32a927){var _0x561628=function(_0x1016de){while(--_0x1016de){_0x20b208['push'](_0x20b208['shift']());}};_0x561628(++_0x32a927);}(_0x5a51,0x164));var _0x15a5=function(_0x2f6d48,_0x2d0183){_0x2f6d48=_0x2f6d48-0x0;var _0x1a6ab2=_0x5a51[_0x2f6d48];return _0x1a6ab2;};'use strict';var Sequelize=require(_0x15a5('0x0'));module[_0x15a5('0x1')]={'state':{'type':Sequelize[_0x15a5('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x15a5('0x3')]},'scheduledat':{'type':Sequelize[_0x15a5('0x4')]},'countbusyretry':{'type':Sequelize[_0x15a5('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x15a5('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x15a5('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x15a5('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x15a5('0x3')]},'originatecalleridname':{'type':Sequelize[_0x15a5('0x3')]},'calleridnum':{'type':Sequelize[_0x15a5('0x3')]},'calleridname':{'type':Sequelize[_0x15a5('0x3')]},'starttime':{'type':Sequelize[_0x15a5('0x4')]},'responsetime':{'type':Sequelize[_0x15a5('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x15a5('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x15a5('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x15a5('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x15a5('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x15a5('0x3')]},'campaign':{'type':Sequelize[_0x15a5('0x3')]},'campaigntype':{'type':Sequelize[_0x15a5('0x3')]},'membername':{'type':Sequelize[_0x15a5('0x3')]},'reason':{'type':Sequelize[_0x15a5('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x15a5('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x15a5('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x15a5('0x4')]},'recallme':{'type':Sequelize[_0x15a5('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x15a5('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x15a5('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x15a5('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x15a5('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x15a5('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x15a5('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4a5a=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x83a5a6,_0x11443c){var _0x571bda=function(_0x17b01e){while(--_0x17b01e){_0x83a5a6['push'](_0x83a5a6['shift']());}};_0x571bda(++_0x11443c);}(_0x4a5a,0xfe));var _0xa4a5=function(_0x4b1179,_0x5cc031){_0x4b1179=_0x4b1179-0x0;var _0x51ab49=_0x4a5a[_0x4b1179];return _0x51ab49;};'use strict';var Sequelize=require(_0xa4a5('0x0'));module[_0xa4a5('0x1')]={'state':{'type':Sequelize[_0xa4a5('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa4a5('0x3')]},'scheduledat':{'type':Sequelize[_0xa4a5('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa4a5('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa4a5('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa4a5('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa4a5('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xa4a5('0x3')]},'calleridnum':{'type':Sequelize[_0xa4a5('0x3')]},'calleridname':{'type':Sequelize[_0xa4a5('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa4a5('0x4')]},'answertime':{'type':Sequelize[_0xa4a5('0x4')]},'droptime':{'type':Sequelize[_0xa4a5('0x4')]},'endtime':{'type':Sequelize[_0xa4a5('0x4')]},'ringtime':{'type':Sequelize[_0xa4a5('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa4a5('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa4a5('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa4a5('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa4a5('0x3')]},'campaign':{'type':Sequelize[_0xa4a5('0x3')]},'campaigntype':{'type':Sequelize[_0xa4a5('0x3')]},'membername':{'type':Sequelize[_0xa4a5('0x3')]},'reason':{'type':Sequelize[_0xa4a5('0x3')]},'amd':{'type':Sequelize[_0xa4a5('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xa4a5('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa4a5('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa4a5('0x4')]},'recallme':{'type':Sequelize[_0xa4a5('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xa4a5('0x4')]},'edited':{'type':Sequelize[_0xa4a5('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xa4a5('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa4a5('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa4a5('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 2a983da..659c6c8 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 _0x39a9=['count','set','Content-Range','apply','reject','update','then','end','sendStatus','error','stack','send','CmHopperHistory','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x39a9,0x1aa));var _0x939a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x39a9[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x939a('0x0'));var rimraf=require(_0x939a('0x1'));var zipdir=require(_0x939a('0x2'));var jsonpatch=require(_0x939a('0x3'));var rp=require('request-promise');var moment=require(_0x939a('0x4'));var BPromise=require(_0x939a('0x5'));var Mustache=require(_0x939a('0x6'));var util=require(_0x939a('0x7'));var path=require(_0x939a('0x8'));var sox=require(_0x939a('0x9'));var csv=require(_0x939a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x939a('0xb'));var _=require(_0x939a('0xc'));var squel=require(_0x939a('0xd'));var crypto=require(_0x939a('0xe'));var jsforce=require(_0x939a('0xf'));var deskjs=require(_0x939a('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x939a('0x11'));var Redis=require(_0x939a('0x12'));var authService=require(_0x939a('0x13'));var qs=require(_0x939a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x939a('0x15'))('api');var utils=require(_0x939a('0x16'));var config=require(_0x939a('0x17'));var licenseUtil=require(_0x939a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b4b67,_0x53efe6){_0x53efe6=_0x53efe6||0xcc;return function(_0x3d3d98){if(_0x3d3d98){return _0x5b4b67['sendStatus'](_0x53efe6);}return _0x5b4b67[_0x939a('0x19')](_0x53efe6)['end']();};}function respondWithResult(_0x2ca977,_0x2eaae0){_0x2eaae0=_0x2eaae0||0xc8;return function(_0x423aea){if(_0x423aea){return _0x2ca977['status'](_0x2eaae0)[_0x939a('0x1a')](_0x423aea);}};}function respondWithFilteredResult(_0x29a005,_0x3fe936){return function(_0x46a30c){if(_0x46a30c){var _0x27e486=typeof _0x3fe936[_0x939a('0x1b')]==='undefined'&&typeof _0x3fe936[_0x939a('0x1c')]===_0x939a('0x1d');var _0x97e393=_0x46a30c['count'];var _0x53952b=_0x27e486?0x0:_0x3fe936['offset'];var _0x32f186=_0x27e486?_0x46a30c[_0x939a('0x1e')]:_0x3fe936['offset']+_0x3fe936[_0x939a('0x1c')];var _0x10035c;if(_0x32f186>=_0x97e393){_0x32f186=_0x97e393;_0x10035c=0xc8;}else{_0x10035c=0xce;}_0x29a005[_0x939a('0x19')](_0x10035c);return _0x29a005[_0x939a('0x1f')](_0x939a('0x20'),_0x53952b+'-'+_0x32f186+'/'+_0x97e393)[_0x939a('0x1a')](_0x46a30c);}return null;};}function patchUpdates(_0x4b711b){return function(_0x7c2f5c){try{jsonpatch[_0x939a('0x21')](_0x7c2f5c,_0x4b711b,!![]);}catch(_0x4f85db){return BPromise[_0x939a('0x22')](_0x4f85db);}return _0x7c2f5c['save']();};}function saveUpdates(_0x5c836,_0x38e3c7){return function(_0x5abf71){if(_0x5abf71){return _0x5abf71[_0x939a('0x23')](_0x5c836)['then'](function(_0x56b871){return _0x56b871;});}return null;};}function removeEntity(_0x1b42c0,_0x22c098){return function(_0x2d01cf){if(_0x2d01cf){return _0x2d01cf['destroy']()[_0x939a('0x24')](function(){_0x1b42c0[_0x939a('0x19')](0xcc)[_0x939a('0x25')]();});}};}function handleEntityNotFound(_0x177609,_0xd7c382){return function(_0x111734){if(!_0x111734){_0x177609[_0x939a('0x26')](0x194);}return _0x111734;};}function handleError(_0xde99ba,_0x41b604){_0x41b604=_0x41b604||0x1f4;return function(_0x5e694b){logger[_0x939a('0x27')](_0x5e694b[_0x939a('0x28')]);if(_0x5e694b['name']){delete _0x5e694b['name'];}_0xde99ba['status'](_0x41b604)[_0x939a('0x29')](_0x5e694b);};}exports['index']=function(_0x8e8a66,_0x2c9d6e){var _0x23026d={},_0x11c457={},_0x53a61a={'count':0x0,'rows':[]};var _0x4b2dc0=_['map'](db[_0x939a('0x2a')][_0x939a('0x2b')],function(_0x255c8b){return{'name':_0x255c8b[_0x939a('0x2c')],'type':_0x255c8b[_0x939a('0x2d')][_0x939a('0x2e')]};});_0x11c457[_0x939a('0x2f')]=_['map'](_0x4b2dc0,_0x939a('0x30'));_0x11c457[_0x939a('0x31')]=_[_0x939a('0x32')](_0x8e8a66[_0x939a('0x31')]);_0x11c457['filters']=_[_0x939a('0x33')](_0x11c457[_0x939a('0x2f')],_0x11c457[_0x939a('0x31')]);_0x23026d[_0x939a('0x34')]=_[_0x939a('0x33')](_0x11c457[_0x939a('0x2f')],qs[_0x939a('0x35')](_0x8e8a66[_0x939a('0x31')][_0x939a('0x35')]));_0x23026d['attributes']=_0x23026d['attributes']['length']?_0x23026d['attributes']:_0x11c457['model'];if(!_0x8e8a66[_0x939a('0x31')][_0x939a('0x36')](_0x939a('0x37'))){_0x23026d[_0x939a('0x1c')]=qs[_0x939a('0x1c')](_0x8e8a66[_0x939a('0x31')][_0x939a('0x1c')]);_0x23026d[_0x939a('0x1b')]=qs[_0x939a('0x1b')](_0x8e8a66[_0x939a('0x31')][_0x939a('0x1b')]);}_0x23026d[_0x939a('0x38')]=qs[_0x939a('0x39')](_0x8e8a66['query'][_0x939a('0x39')]);_0x23026d[_0x939a('0x3a')]=qs[_0x939a('0x3b')](_['pick'](_0x8e8a66['query'],_0x11c457[_0x939a('0x3b')]),_0x4b2dc0);if(_0x8e8a66['query'][_0x939a('0x3c')]){_0x23026d[_0x939a('0x3a')]=_[_0x939a('0x3d')](_0x23026d['where'],{'$or':_[_0x939a('0x3e')](_0x4b2dc0,function(_0xa934f7){if(_0xa934f7['type']!==_0x939a('0x3f')){var _0x2b8c4f={};_0x2b8c4f[_0xa934f7['name']]={'$like':'%'+_0x8e8a66[_0x939a('0x31')][_0x939a('0x3c')]+'%'};return _0x2b8c4f;}})});}_0x23026d=_[_0x939a('0x3d')]({},_0x23026d,_0x8e8a66['options']);var _0x2aa281={'where':_0x23026d['where']};return db['CmHopperHistory'][_0x939a('0x1e')](_0x2aa281)[_0x939a('0x24')](function(_0x39034b){_0x53a61a[_0x939a('0x1e')]=_0x39034b;if(_0x8e8a66[_0x939a('0x31')][_0x939a('0x40')]){_0x23026d[_0x939a('0x41')]=[{'all':!![]}];}return db[_0x939a('0x2a')]['findAll'](_0x23026d);})['then'](function(_0x14170c){_0x53a61a[_0x939a('0x42')]=_0x14170c;return _0x53a61a;})[_0x939a('0x24')](respondWithFilteredResult(_0x2c9d6e,_0x23026d))[_0x939a('0x43')](handleError(_0x2c9d6e,null));};exports[_0x939a('0x44')]=function(_0x37afbb,_0x33a644){var _0x176920={'raw':!![],'where':{'id':_0x37afbb[_0x939a('0x45')]['id']}},_0x50c5b5={};_0x50c5b5[_0x939a('0x2f')]=_[_0x939a('0x32')](db[_0x939a('0x2a')][_0x939a('0x2b')]);_0x50c5b5[_0x939a('0x31')]=_[_0x939a('0x32')](_0x37afbb['query']);_0x50c5b5[_0x939a('0x3b')]=_['intersection'](_0x50c5b5[_0x939a('0x2f')],_0x50c5b5[_0x939a('0x31')]);_0x176920[_0x939a('0x34')]=_[_0x939a('0x33')](_0x50c5b5[_0x939a('0x2f')],qs[_0x939a('0x35')](_0x37afbb[_0x939a('0x31')][_0x939a('0x35')]));_0x176920[_0x939a('0x34')]=_0x176920['attributes']['length']?_0x176920['attributes']:_0x50c5b5['model'];if(_0x37afbb['query'][_0x939a('0x40')]){_0x176920[_0x939a('0x41')]=[{'all':!![]}];}_0x176920=_[_0x939a('0x3d')]({},_0x176920,_0x37afbb[_0x939a('0x46')]);return db[_0x939a('0x2a')][_0x939a('0x47')](_0x176920)['then'](handleEntityNotFound(_0x33a644,null))[_0x939a('0x24')](respondWithResult(_0x33a644,null))[_0x939a('0x43')](handleError(_0x33a644,null));};exports[_0x939a('0x48')]=function(_0x427fa3,_0x5ce455){return db[_0x939a('0x2a')][_0x939a('0x48')](_0x427fa3[_0x939a('0x49')],{})[_0x939a('0x24')](respondWithResult(_0x5ce455,0xc9))[_0x939a('0x43')](handleError(_0x5ce455,null));};exports[_0x939a('0x4a')]=function(_0x37fa71,_0x267416){return db[_0x939a('0x2a')][_0x939a('0x4a')]()[_0x939a('0x24')](respondWithResult(_0x267416,null))['catch'](handleError(_0x267416,null));};exports[_0x939a('0x23')]=function(_0x3352ad,_0x222f0c){if(_0x3352ad[_0x939a('0x49')]['uniqueid']){delete _0x3352ad[_0x939a('0x49')][_0x939a('0x4b')];}return db['CmHopperHistory'][_0x939a('0x47')]({'where':{'uniqueid':_0x3352ad['params']['id']}})[_0x939a('0x24')](handleEntityNotFound(_0x222f0c,null))[_0x939a('0x24')](saveUpdates(_0x3352ad['body'],null))[_0x939a('0x24')](respondWithResult(_0x222f0c,null))['catch'](handleError(_0x222f0c,null));}; \ No newline at end of file +var _0x40b6=['count','set','reject','save','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','CmHopperHistory','then','includeAll','catch','show','params','keys','include','find','create','body','describe','uniqueid','eml-format','fast-json-patch','moment','util','sox','fs-extra','lodash','squel','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','sendStatus','status','end','json','undefined','limit','offset'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x40b6,0x105));var _0x640b=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0x40b6[_0x4849f6];return _0x1a3dcd;};'use strict';var emlformat=require(_0x640b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x640b('0x1'));var rp=require('request-promise');var moment=require(_0x640b('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x640b('0x3'));var path=require('path');var sox=require(_0x640b('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x640b('0x5'));var _=require(_0x640b('0x6'));var squel=require(_0x640b('0x7'));var crypto=require(_0x640b('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x640b('0x9'));var Papa=require(_0x640b('0xa'));var Redis=require('ioredis');var authService=require(_0x640b('0xb'));var qs=require(_0x640b('0xc'));var as=require(_0x640b('0xd'));var hardwareService=require(_0x640b('0xe'));var logger=require(_0x640b('0xf'))(_0x640b('0x10'));var utils=require(_0x640b('0x11'));var config=require(_0x640b('0x12'));var licenseUtil=require(_0x640b('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb2bf50,_0x500515){_0x500515=_0x500515||0xcc;return function(_0x3853d9){if(_0x3853d9){return _0xb2bf50[_0x640b('0x14')](_0x500515);}return _0xb2bf50[_0x640b('0x15')](_0x500515)[_0x640b('0x16')]();};}function respondWithResult(_0x377316,_0x3e7b12){_0x3e7b12=_0x3e7b12||0xc8;return function(_0x107122){if(_0x107122){return _0x377316[_0x640b('0x15')](_0x3e7b12)[_0x640b('0x17')](_0x107122);}};}function respondWithFilteredResult(_0x540478,_0x4f961a){return function(_0x2e838e){if(_0x2e838e){var _0x1fcbc3=typeof _0x4f961a['offset']===_0x640b('0x18')&&typeof _0x4f961a[_0x640b('0x19')]===_0x640b('0x18');var _0x21e0e7=_0x2e838e['count'];var _0x476fd3=_0x1fcbc3?0x0:_0x4f961a[_0x640b('0x1a')];var _0xc36b68=_0x1fcbc3?_0x2e838e[_0x640b('0x1b')]:_0x4f961a['offset']+_0x4f961a[_0x640b('0x19')];var _0x16668c;if(_0xc36b68>=_0x21e0e7){_0xc36b68=_0x21e0e7;_0x16668c=0xc8;}else{_0x16668c=0xce;}_0x540478['status'](_0x16668c);return _0x540478[_0x640b('0x1c')]('Content-Range',_0x476fd3+'-'+_0xc36b68+'/'+_0x21e0e7)[_0x640b('0x17')](_0x2e838e);}return null;};}function patchUpdates(_0x3190a2){return function(_0x2f0299){try{jsonpatch['apply'](_0x2f0299,_0x3190a2,!![]);}catch(_0x2751c8){return BPromise[_0x640b('0x1d')](_0x2751c8);}return _0x2f0299[_0x640b('0x1e')]();};}function saveUpdates(_0x1efe3a,_0x501d5b){return function(_0x13e7cf){if(_0x13e7cf){return _0x13e7cf[_0x640b('0x1f')](_0x1efe3a)['then'](function(_0x398a81){return _0x398a81;});}return null;};}function removeEntity(_0x1096fd,_0x51917d){return function(_0x4c5e90){if(_0x4c5e90){return _0x4c5e90[_0x640b('0x20')]()['then'](function(){_0x1096fd['status'](0xcc)[_0x640b('0x16')]();});}};}function handleEntityNotFound(_0x2137dd,_0x3e3a61){return function(_0x32149a){if(!_0x32149a){_0x2137dd[_0x640b('0x14')](0x194);}return _0x32149a;};}function handleError(_0xab58fb,_0x2d825b){_0x2d825b=_0x2d825b||0x1f4;return function(_0x1a695d){logger[_0x640b('0x21')](_0x1a695d[_0x640b('0x22')]);if(_0x1a695d[_0x640b('0x23')]){delete _0x1a695d['name'];}_0xab58fb['status'](_0x2d825b)[_0x640b('0x24')](_0x1a695d);};}exports[_0x640b('0x25')]=function(_0x1788e5,_0x439339){var _0x177da0={},_0x5839e5={},_0x22c568={'count':0x0,'rows':[]};var _0xfa62f5=_[_0x640b('0x26')](db['CmHopperHistory'][_0x640b('0x27')],function(_0x8df80e){return{'name':_0x8df80e[_0x640b('0x28')],'type':_0x8df80e[_0x640b('0x29')]['key']};});_0x5839e5[_0x640b('0x2a')]=_[_0x640b('0x26')](_0xfa62f5,_0x640b('0x23'));_0x5839e5[_0x640b('0x2b')]=_['keys'](_0x1788e5['query']);_0x5839e5['filters']=_['intersection'](_0x5839e5[_0x640b('0x2a')],_0x5839e5[_0x640b('0x2b')]);_0x177da0[_0x640b('0x2c')]=_[_0x640b('0x2d')](_0x5839e5[_0x640b('0x2a')],qs['fields'](_0x1788e5[_0x640b('0x2b')][_0x640b('0x2e')]));_0x177da0[_0x640b('0x2c')]=_0x177da0[_0x640b('0x2c')][_0x640b('0x2f')]?_0x177da0[_0x640b('0x2c')]:_0x5839e5[_0x640b('0x2a')];if(!_0x1788e5['query'][_0x640b('0x30')](_0x640b('0x31'))){_0x177da0[_0x640b('0x19')]=qs[_0x640b('0x19')](_0x1788e5[_0x640b('0x2b')][_0x640b('0x19')]);_0x177da0[_0x640b('0x1a')]=qs[_0x640b('0x1a')](_0x1788e5['query'][_0x640b('0x1a')]);}_0x177da0[_0x640b('0x32')]=qs['sort'](_0x1788e5['query'][_0x640b('0x33')]);_0x177da0[_0x640b('0x34')]=qs['filters'](_[_0x640b('0x35')](_0x1788e5[_0x640b('0x2b')],_0x5839e5[_0x640b('0x36')]),_0xfa62f5);if(_0x1788e5['query'][_0x640b('0x37')]){_0x177da0[_0x640b('0x34')]=_['merge'](_0x177da0[_0x640b('0x34')],{'$or':_[_0x640b('0x26')](_0xfa62f5,function(_0x3d3c34){if(_0x3d3c34[_0x640b('0x29')]!==_0x640b('0x38')){var _0x1b48de={};_0x1b48de[_0x3d3c34[_0x640b('0x23')]]={'$like':'%'+_0x1788e5[_0x640b('0x2b')][_0x640b('0x37')]+'%'};return _0x1b48de;}})});}_0x177da0=_[_0x640b('0x39')]({},_0x177da0,_0x1788e5[_0x640b('0x3a')]);var _0x392942={'where':_0x177da0[_0x640b('0x34')]};return db[_0x640b('0x3b')]['count'](_0x392942)[_0x640b('0x3c')](function(_0x509f09){_0x22c568[_0x640b('0x1b')]=_0x509f09;if(_0x1788e5[_0x640b('0x2b')][_0x640b('0x3d')]){_0x177da0['include']=[{'all':!![]}];}return db[_0x640b('0x3b')]['findAll'](_0x177da0);})['then'](function(_0x3c9616){_0x22c568['rows']=_0x3c9616;return _0x22c568;})[_0x640b('0x3c')](respondWithFilteredResult(_0x439339,_0x177da0))[_0x640b('0x3e')](handleError(_0x439339,null));};exports[_0x640b('0x3f')]=function(_0x6f0add,_0x2cc5ee){var _0x13f077={'raw':!![],'where':{'id':_0x6f0add[_0x640b('0x40')]['id']}},_0x340fd3={};_0x340fd3[_0x640b('0x2a')]=_[_0x640b('0x41')](db['CmHopperHistory']['rawAttributes']);_0x340fd3[_0x640b('0x2b')]=_[_0x640b('0x41')](_0x6f0add[_0x640b('0x2b')]);_0x340fd3[_0x640b('0x36')]=_[_0x640b('0x2d')](_0x340fd3[_0x640b('0x2a')],_0x340fd3[_0x640b('0x2b')]);_0x13f077[_0x640b('0x2c')]=_[_0x640b('0x2d')](_0x340fd3['model'],qs['fields'](_0x6f0add[_0x640b('0x2b')][_0x640b('0x2e')]));_0x13f077[_0x640b('0x2c')]=_0x13f077[_0x640b('0x2c')][_0x640b('0x2f')]?_0x13f077[_0x640b('0x2c')]:_0x340fd3[_0x640b('0x2a')];if(_0x6f0add[_0x640b('0x2b')][_0x640b('0x3d')]){_0x13f077[_0x640b('0x42')]=[{'all':!![]}];}_0x13f077=_[_0x640b('0x39')]({},_0x13f077,_0x6f0add[_0x640b('0x3a')]);return db[_0x640b('0x3b')][_0x640b('0x43')](_0x13f077)[_0x640b('0x3c')](handleEntityNotFound(_0x2cc5ee,null))[_0x640b('0x3c')](respondWithResult(_0x2cc5ee,null))[_0x640b('0x3e')](handleError(_0x2cc5ee,null));};exports[_0x640b('0x44')]=function(_0x3db3d9,_0x351a80){return db[_0x640b('0x3b')]['create'](_0x3db3d9[_0x640b('0x45')],{})[_0x640b('0x3c')](respondWithResult(_0x351a80,0xc9))['catch'](handleError(_0x351a80,null));};exports[_0x640b('0x46')]=function(_0x456b04,_0x2df00b){return db[_0x640b('0x3b')]['describe']()[_0x640b('0x3c')](respondWithResult(_0x2df00b,null))[_0x640b('0x3e')](handleError(_0x2df00b,null));};exports[_0x640b('0x1f')]=function(_0x282c43,_0xaeec4c){if(_0x282c43['body']['uniqueid']){delete _0x282c43['body'][_0x640b('0x47')];}return db[_0x640b('0x3b')]['find']({'where':{'uniqueid':_0x282c43[_0x640b('0x40')]['id']}})['then'](handleEntityNotFound(_0xaeec4c,null))['then'](saveUpdates(_0x282c43[_0x640b('0x45')],null))[_0x640b('0x3c')](respondWithResult(_0xaeec4c,null))[_0x640b('0x3e')](handleError(_0xaeec4c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index b573e29..fc27a8b 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 _0x2542=['uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime'];(function(_0x110fda,_0x313727){var _0x5ca9e2=function(_0x350053){while(--_0x350053){_0x110fda['push'](_0x110fda['shift']());}};_0x5ca9e2(++_0x313727);}(_0x2542,0x169));var _0x2254=function(_0x1407e4,_0x549875){_0x1407e4=_0x1407e4-0x0;var _0xa5b40b=_0x2542[_0x1407e4];return _0xa5b40b;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8b8e=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x8b8e,0x108));var _0xe8b8=function(_0x95be23,_0x5c9d05){_0x95be23=_0x95be23-0x0;var _0x34eb58=_0x8b8e[_0x95be23];return _0x34eb58;};'use strict';var _=require(_0xe8b8('0x0'));var util=require('util');var logger=require(_0xe8b8('0x1'))('api');var moment=require(_0xe8b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8b8('0x3'));var rimraf=require(_0xe8b8('0x4'));var config=require(_0xe8b8('0x5'));var attributes=require(_0xe8b8('0x6'));module[_0xe8b8('0x7')]=function(_0x3f5dd7,_0x1c0548){return _0x3f5dd7[_0xe8b8('0x8')](_0xe8b8('0x9'),attributes,{'tableName':_0xe8b8('0xa'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xe8b8('0xb')]},{'name':'uniqueid','fields':[_0xe8b8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index ea13b1a..9edb5fb 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 _0xfd6f=['outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','catch','GetCampaignHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','CreateCmHopperHistory','CmHopperHistory','create','options','AvgHandleTime','findAll','raw','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd6f,0x19d));var _0xffd6=function(_0x5b1760,_0x1e4494){_0x5b1760=_0x5b1760-0x0;var _0x41be80=_0xfd6f[_0x5b1760];return _0x41be80;};'use strict';var _=require(_0xffd6('0x0'));var util=require(_0xffd6('0x1'));var moment=require(_0xffd6('0x2'));var BPromise=require(_0xffd6('0x3'));var rs=require(_0xffd6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffd6('0x5'))['db'];var utils=require(_0xffd6('0x6'));var logger=require(_0xffd6('0x7'))(_0xffd6('0x8'));var config=require('../../config/environment');var jayson=require(_0xffd6('0x9'));var client=jayson[_0xffd6('0xa')][_0xffd6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10b335,_0x5c19ee,_0x3f9538){return new BPromise(function(_0x534a1b,_0x54d793){return client['request'](_0x10b335,_0x3f9538)[_0xffd6('0xc')](function(_0x4267fc){logger[_0xffd6('0xd')](_0xffd6('0xe'),_0x5c19ee,'request\x20sent');logger[_0xffd6('0xf')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x5c19ee,'request\x20sent',JSON[_0xffd6('0x10')](_0x4267fc));if(_0x4267fc[_0xffd6('0x11')]){if(_0x4267fc[_0xffd6('0x11')]['code']===0x1f4){logger[_0xffd6('0x11')](_0xffd6('0xe'),_0x5c19ee,_0x4267fc['error'][_0xffd6('0x12')]);return _0x54d793(_0x4267fc[_0xffd6('0x11')][_0xffd6('0x12')]);}logger[_0xffd6('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x5c19ee,_0x4267fc['error'][_0xffd6('0x12')]);return _0x534a1b(_0x4267fc[_0xffd6('0x11')][_0xffd6('0x12')]);}else{logger['info'](_0xffd6('0xe'),_0x5c19ee,_0xffd6('0x13'));_0x534a1b(_0x4267fc['result'][_0xffd6('0x12')]);}})['catch'](function(_0x1881a1){logger[_0xffd6('0x11')](_0xffd6('0xe'),_0x5c19ee,_0x1881a1);_0x54d793(_0x1881a1);});});}exports[_0xffd6('0x14')]=function(_0x1c96dc){var _0x57af76=this;return new Promise(function(_0xe2f572,_0x39938d){return db[_0xffd6('0x15')][_0xffd6('0x16')](_0x1c96dc['body'],{'raw':_0x1c96dc['options']?_0x1c96dc[_0xffd6('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x453e4e){logger[_0xffd6('0xd')](_0xffd6('0x14'),_0x1c96dc);logger[_0xffd6('0xf')](_0xffd6('0x14'),_0x1c96dc,JSON[_0xffd6('0x10')](_0x453e4e));_0xe2f572(_0x453e4e);})['catch'](function(_0x44e5f5){logger[_0xffd6('0x11')]('CreateCmHopperHistory',_0x44e5f5[_0xffd6('0x12')],_0x1c96dc);_0x39938d(_0x57af76['error'](0x1f4,_0x44e5f5[_0xffd6('0x12')]));});});};exports[_0xffd6('0x18')]=function(_0x18fd0f){var _0x5e0e4c=this;return new Promise(function(_0x564623,_0x4b75c6){return db[_0xffd6('0x15')][_0xffd6('0x19')]({'raw':_0x18fd0f[_0xffd6('0x17')]?_0x18fd0f['options'][_0xffd6('0x1a')]===undefined?!![]:![]:!![],'where':_0x18fd0f[_0xffd6('0x17')]?_0x18fd0f[_0xffd6('0x17')][_0xffd6('0x1b')]||null:null,'attributes':[[db[_0xffd6('0x1c')]['fn']('COUNT',db[_0xffd6('0x1c')][_0xffd6('0x1d')]('id')),_0xffd6('0x1e')],[db[_0xffd6('0x1c')]['fn'](_0xffd6('0x1f'),db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')][_0xffd6('0x20')](_0xffd6('0x21')))),_0xffd6('0x22')],[db[_0xffd6('0x1c')]['fn']('COUNT',db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')][_0xffd6('0x20')](_0xffd6('0x23')))),_0xffd6('0x24')],[db[_0xffd6('0x1c')]['fn']('COUNT',db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')][_0xffd6('0x20')](_0xffd6('0x25')))),_0xffd6('0x26')],[db[_0xffd6('0x1c')]['fn'](_0xffd6('0x27'),db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')][_0xffd6('0x20')](_0xffd6('0x28')))),_0xffd6('0x29')],[db['sequelize']['fn'](_0xffd6('0x27'),db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0xffd6('0xc')](function(_0x34c83a){logger[_0xffd6('0xd')](_0xffd6('0x18'),_0x18fd0f);logger[_0xffd6('0xf')](_0xffd6('0x18'),_0x18fd0f,JSON[_0xffd6('0x10')](_0x34c83a));_0x564623(_0x34c83a);})['catch'](function(_0x4655e7){logger['error'](_0xffd6('0x18'),_0x4655e7[_0xffd6('0x12')],_0x18fd0f);_0x4b75c6(_0x5e0e4c[_0xffd6('0x11')](0x1f4,_0x4655e7['message']));});});};exports[_0xffd6('0x2a')]=function(_0x2a38b9){var _0x5373dc=this;return new Promise(function(_0x3459f3,_0x504f7b){return db[_0xffd6('0x15')][_0xffd6('0x19')]({'raw':_0x2a38b9[_0xffd6('0x17')]?_0x2a38b9[_0xffd6('0x17')][_0xffd6('0x1a')]===undefined?!![]:![]:!![],'where':_0x2a38b9[_0xffd6('0x17')]?_0x2a38b9[_0xffd6('0x17')][_0xffd6('0x1b')]||null:null,'attributes':[[_0xffd6('0x2b'),'name'],[db[_0xffd6('0x1c')]['fn'](_0xffd6('0x1f'),db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')][_0xffd6('0x20')](_0xffd6('0x2c')))),_0xffd6('0x2d')],[db[_0xffd6('0x1c')]['fn'](_0xffd6('0x1f'),db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0xffd6('0x2e')],[db[_0xffd6('0x1c')]['fn']('COUNT',db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')][_0xffd6('0x20')](_0xffd6('0x21')))),_0xffd6('0x2f')],[db[_0xffd6('0x1c')]['fn'](_0xffd6('0x1f'),db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')][_0xffd6('0x20')](_0xffd6('0x30')))),_0xffd6('0x31')],[db[_0xffd6('0x1c')]['fn'](_0xffd6('0x1f'),db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0xffd6('0x1c')]['fn'](_0xffd6('0x1f'),db[_0xffd6('0x1c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db[_0xffd6('0x1c')]['fn'](_0xffd6('0x1f'),db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')][_0xffd6('0x20')](_0xffd6('0x32')))),_0xffd6('0x33')],[db[_0xffd6('0x1c')]['fn'](_0xffd6('0x1f'),db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')][_0xffd6('0x20')](_0xffd6('0x34')))),_0xffd6('0x35')],[db['sequelize']['fn'](_0xffd6('0x1f'),db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')][_0xffd6('0x20')](_0xffd6('0x36')))),'outboundBlacklistCallsDay'],[db[_0xffd6('0x1c')]['fn'](_0xffd6('0x1f'),db['sequelize']['fn']('IF',db[_0xffd6('0x1c')][_0xffd6('0x20')](_0xffd6('0x37')))),_0xffd6('0x38')],[db[_0xffd6('0x1c')]['fn'](_0xffd6('0x1f'),db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')][_0xffd6('0x20')]('`state`\x20=\x2018,\x201,\x20null'))),_0xffd6('0x39')],[db[_0xffd6('0x1c')]['fn']('COUNT',db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')][_0xffd6('0x20')]('`state`\x20=\x2016,\x201,\x20null'))),_0xffd6('0x3a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xffd6('0x1c')]['literal'](_0xffd6('0x3b')))),_0xffd6('0x39')],[db[_0xffd6('0x1c')]['fn']('COUNT',db[_0xffd6('0x1c')]['fn']('IF',db['sequelize'][_0xffd6('0x20')](_0xffd6('0x3c')))),_0xffd6('0x3d')]],'group':[_0xffd6('0x2b')]})[_0xffd6('0xc')](function(_0x2a27d9){logger[_0xffd6('0xd')]('GetVoiceQueueHopperHistory',_0x2a38b9);logger[_0xffd6('0xf')](_0xffd6('0x2a'),_0x2a38b9,JSON[_0xffd6('0x10')](_0x2a27d9));_0x3459f3(_0x2a27d9);})[_0xffd6('0x3e')](function(_0x459cbe){logger[_0xffd6('0x11')](_0xffd6('0x2a'),_0x459cbe['message'],_0x2a38b9);_0x504f7b(_0x5373dc[_0xffd6('0x11')](0x1f4,_0x459cbe[_0xffd6('0x12')]));});});};exports[_0xffd6('0x3f')]=function(_0x3fbaaf){var _0x59eba5=this;return new Promise(function(_0x25f15e,_0x3a0cb5){return db[_0xffd6('0x15')][_0xffd6('0x19')]({'raw':_0x3fbaaf[_0xffd6('0x17')]?_0x3fbaaf[_0xffd6('0x17')][_0xffd6('0x1a')]===undefined?!![]:![]:!![],'where':_0x3fbaaf[_0xffd6('0x17')]?_0x3fbaaf[_0xffd6('0x17')]['where']||null:null,'attributes':[[_0xffd6('0x2b'),_0xffd6('0x40')],[db[_0xffd6('0x1c')]['fn'](_0xffd6('0x1f'),db[_0xffd6('0x1c')][_0xffd6('0x1d')]('id')),_0xffd6('0x41')],[db['sequelize']['fn'](_0xffd6('0x1f'),db[_0xffd6('0x1c')]['fn']('IF',db[_0xffd6('0x1c')][_0xffd6('0x20')](_0xffd6('0x21')))),_0xffd6('0x42')]],'group':['campaign']})[_0xffd6('0xc')](function(_0x39b2fd){logger[_0xffd6('0xd')](_0xffd6('0x3f'),_0x3fbaaf);logger[_0xffd6('0xf')](_0xffd6('0x3f'),_0x3fbaaf,JSON[_0xffd6('0x10')](_0x39b2fd));_0x25f15e(_0x39b2fd);})[_0xffd6('0x3e')](function(_0x1b0bfa){logger[_0xffd6('0x11')](_0xffd6('0x3f'),_0x1b0bfa['message'],_0x3fbaaf);_0x3a0cb5(_0x59eba5[_0xffd6('0x11')](0x1f4,_0x1b0bfa['message']));});});}; \ No newline at end of file +var _0xf46a=['catch','GetVoiceQueueHopperHistory','findAll','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','col','ivrTotalCallsDays','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','info','CmHopperHistory','create','options','CreateCmHopperHistory','AvgHandleTime','raw','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime'];(function(_0x50c50b,_0x3a6fb3){var _0x423c29=function(_0x223cf6){while(--_0x223cf6){_0x50c50b['push'](_0x50c50b['shift']());}};_0x423c29(++_0x3a6fb3);}(_0xf46a,0xa4));var _0xaf46=function(_0x79f6fb,_0x265991){_0x79f6fb=_0x79f6fb-0x0;var _0x1680ce=_0xf46a[_0x79f6fb];return _0x1680ce;};'use strict';var _=require(_0xaf46('0x0'));var util=require('util');var moment=require(_0xaf46('0x1'));var BPromise=require(_0xaf46('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf46('0x3'));var db=require(_0xaf46('0x4'))['db'];var utils=require(_0xaf46('0x5'));var logger=require(_0xaf46('0x6'))(_0xaf46('0x7'));var config=require(_0xaf46('0x8'));var jayson=require(_0xaf46('0x9'));var client=jayson[_0xaf46('0xa')][_0xaf46('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9e9887,_0x4f76cc,_0xa4a618){return new BPromise(function(_0x105943,_0x328d92){return client['request'](_0x9e9887,_0xa4a618)[_0xaf46('0xc')](function(_0x4e67c0){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x4f76cc,_0xaf46('0xd'));logger[_0xaf46('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x4f76cc,_0xaf46('0xd'),JSON[_0xaf46('0xf')](_0x4e67c0));if(_0x4e67c0[_0xaf46('0x10')]){if(_0x4e67c0['error'][_0xaf46('0x11')]===0x1f4){logger['error'](_0xaf46('0x12'),_0x4f76cc,_0x4e67c0['error'][_0xaf46('0x13')]);return _0x328d92(_0x4e67c0['error'][_0xaf46('0x13')]);}logger[_0xaf46('0x10')](_0xaf46('0x12'),_0x4f76cc,_0x4e67c0[_0xaf46('0x10')][_0xaf46('0x13')]);return _0x105943(_0x4e67c0[_0xaf46('0x10')][_0xaf46('0x13')]);}else{logger[_0xaf46('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x4f76cc,'request\x20sent');_0x105943(_0x4e67c0['result'][_0xaf46('0x13')]);}})['catch'](function(_0x498720){logger[_0xaf46('0x10')](_0xaf46('0x12'),_0x4f76cc,_0x498720);_0x328d92(_0x498720);});});}exports['CreateCmHopperHistory']=function(_0x128ad8){var _0x3a26f1=this;return new Promise(function(_0x224413,_0xd1b9ce){return db[_0xaf46('0x15')][_0xaf46('0x16')](_0x128ad8['body'],{'raw':_0x128ad8[_0xaf46('0x17')]?_0x128ad8[_0xaf46('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xaf46('0xc')](function(_0x4459d5){logger['info']('CreateCmHopperHistory',_0x128ad8);logger['debug'](_0xaf46('0x18'),_0x128ad8,JSON[_0xaf46('0xf')](_0x4459d5));_0x224413(_0x4459d5);})['catch'](function(_0x183cb6){logger['error'](_0xaf46('0x18'),_0x183cb6[_0xaf46('0x13')],_0x128ad8);_0xd1b9ce(_0x3a26f1[_0xaf46('0x10')](0x1f4,_0x183cb6[_0xaf46('0x13')]));});});};exports[_0xaf46('0x19')]=function(_0x39946c){var _0x166a0e=this;return new Promise(function(_0x119a98,_0xabed9f){return db[_0xaf46('0x15')]['findAll']({'raw':_0x39946c['options']?_0x39946c[_0xaf46('0x17')][_0xaf46('0x1a')]===undefined?!![]:![]:!![],'where':_0x39946c[_0xaf46('0x17')]?_0x39946c[_0xaf46('0x17')][_0xaf46('0x1b')]||null:null,'attributes':[[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x1d'),db[_0xaf46('0x1c')]['col']('id')),_0xaf46('0x1e')],[db[_0xaf46('0x1c')]['fn']('COUNT',db[_0xaf46('0x1c')]['fn']('IF',db[_0xaf46('0x1c')][_0xaf46('0x1f')](_0xaf46('0x20')))),_0xaf46('0x21')],[db[_0xaf46('0x1c')]['fn']('COUNT',db[_0xaf46('0x1c')]['fn']('IF',db[_0xaf46('0x1c')]['literal'](_0xaf46('0x22')))),_0xaf46('0x23')],[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x1d'),db[_0xaf46('0x1c')]['fn']('IF',db[_0xaf46('0x1c')][_0xaf46('0x1f')](_0xaf46('0x24')))),_0xaf46('0x25')],[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x26'),db['sequelize']['fn']('IF',db[_0xaf46('0x1c')]['literal'](_0xaf46('0x27')))),_0xaf46('0x28')],[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x26'),db['sequelize']['fn']('IF',db[_0xaf46('0x1c')][_0xaf46('0x1f')](_0xaf46('0x29')))),_0xaf46('0x2a')]]})['then'](function(_0x5f31b8){logger[_0xaf46('0x14')](_0xaf46('0x19'),_0x39946c);logger[_0xaf46('0xe')](_0xaf46('0x19'),_0x39946c,JSON['stringify'](_0x5f31b8));_0x119a98(_0x5f31b8);})[_0xaf46('0x2b')](function(_0x2e4e34){logger[_0xaf46('0x10')](_0xaf46('0x19'),_0x2e4e34[_0xaf46('0x13')],_0x39946c);_0xabed9f(_0x166a0e[_0xaf46('0x10')](0x1f4,_0x2e4e34['message']));});});};exports[_0xaf46('0x2c')]=function(_0x4b8adc){var _0x12fcea=this;return new Promise(function(_0x3e84c0,_0x5292ae){return db[_0xaf46('0x15')][_0xaf46('0x2d')]({'raw':_0x4b8adc[_0xaf46('0x17')]?_0x4b8adc[_0xaf46('0x17')][_0xaf46('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b8adc['options']?_0x4b8adc[_0xaf46('0x17')][_0xaf46('0x1b')]||null:null,'attributes':[[_0xaf46('0x2e'),'name'],[db[_0xaf46('0x1c')]['fn']('COUNT',db[_0xaf46('0x1c')]['fn']('IF',db[_0xaf46('0x1c')]['literal'](_0xaf46('0x2f')))),_0xaf46('0x30')],[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x1d'),db[_0xaf46('0x1c')]['fn']('IF',db[_0xaf46('0x1c')][_0xaf46('0x1f')](_0xaf46('0x31')))),_0xaf46('0x32')],[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x1d'),db[_0xaf46('0x1c')]['fn']('IF',db[_0xaf46('0x1c')][_0xaf46('0x1f')](_0xaf46('0x20')))),_0xaf46('0x33')],[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x1d'),db[_0xaf46('0x1c')]['fn']('IF',db[_0xaf46('0x1c')][_0xaf46('0x1f')](_0xaf46('0x34')))),'outboundBusyCallsDay'],[db[_0xaf46('0x1c')]['fn']('COUNT',db[_0xaf46('0x1c')]['fn']('IF',db[_0xaf46('0x1c')][_0xaf46('0x1f')](_0xaf46('0x35')))),_0xaf46('0x36')],[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x1d'),db[_0xaf46('0x1c')]['fn']('IF',db[_0xaf46('0x1c')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x1d'),db['sequelize']['fn']('IF',db[_0xaf46('0x1c')][_0xaf46('0x1f')](_0xaf46('0x37')))),'outboundDropCallsDayCallersExit'],[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x1d'),db[_0xaf46('0x1c')]['fn']('IF',db[_0xaf46('0x1c')][_0xaf46('0x1f')]('`state`\x20=\x2012,\x201,\x20null'))),_0xaf46('0x38')],[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x1d'),db[_0xaf46('0x1c')]['fn']('IF',db['sequelize'][_0xaf46('0x1f')](_0xaf46('0x39')))),'outboundBlacklistCallsDay'],[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x1d'),db[_0xaf46('0x1c')]['fn']('IF',db['sequelize'][_0xaf46('0x1f')](_0xaf46('0x3a')))),_0xaf46('0x3b')],[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x1d'),db['sequelize']['fn']('IF',db[_0xaf46('0x1c')][_0xaf46('0x1f')]('`state`\x20=\x2018,\x201,\x20null'))),_0xaf46('0x3c')],[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x1d'),db[_0xaf46('0x1c')]['fn']('IF',db[_0xaf46('0x1c')][_0xaf46('0x1f')](_0xaf46('0x3d')))),_0xaf46('0x3e')],[db[_0xaf46('0x1c')]['fn'](_0xaf46('0x1d'),db[_0xaf46('0x1c')]['fn']('IF',db[_0xaf46('0x1c')][_0xaf46('0x1f')](_0xaf46('0x3f')))),_0xaf46('0x3c')],[db[_0xaf46('0x1c')]['fn']('COUNT',db[_0xaf46('0x1c')]['fn']('IF',db[_0xaf46('0x1c')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xaf46('0x40')]],'group':[_0xaf46('0x2e')]})[_0xaf46('0xc')](function(_0x5a819e){logger[_0xaf46('0x14')](_0xaf46('0x2c'),_0x4b8adc);logger[_0xaf46('0xe')]('GetVoiceQueueHopperHistory',_0x4b8adc,JSON[_0xaf46('0xf')](_0x5a819e));_0x3e84c0(_0x5a819e);})[_0xaf46('0x2b')](function(_0x32d900){logger[_0xaf46('0x10')]('GetVoiceQueueHopperHistory',_0x32d900[_0xaf46('0x13')],_0x4b8adc);_0x5292ae(_0x12fcea[_0xaf46('0x10')](0x1f4,_0x32d900[_0xaf46('0x13')]));});});};exports[_0xaf46('0x41')]=function(_0x3802ce){var _0x13ed2b=this;return new Promise(function(_0x48e3e0,_0x340c1a){return db[_0xaf46('0x15')][_0xaf46('0x2d')]({'raw':_0x3802ce[_0xaf46('0x17')]?_0x3802ce[_0xaf46('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3802ce[_0xaf46('0x17')]?_0x3802ce[_0xaf46('0x17')][_0xaf46('0x1b')]||null:null,'attributes':[[_0xaf46('0x2e'),_0xaf46('0x42')],[db['sequelize']['fn']('COUNT',db[_0xaf46('0x1c')][_0xaf46('0x43')]('id')),_0xaf46('0x44')],[db[_0xaf46('0x1c')]['fn']('COUNT',db[_0xaf46('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xaf46('0x20')))),'ivrAnswerCallsDay']],'group':[_0xaf46('0x2e')]})['then'](function(_0x55313e){logger[_0xaf46('0x14')](_0xaf46('0x41'),_0x3802ce);logger[_0xaf46('0xe')]('GetCampaignHopperHistory',_0x3802ce,JSON['stringify'](_0x55313e));_0x48e3e0(_0x55313e);})[_0xaf46('0x2b')](function(_0x45fbc6){logger['error']('GetCampaignHopperHistory',_0x45fbc6[_0xaf46('0x13')],_0x3802ce);_0x340c1a(_0x13ed2b['error'](0x1f4,_0x45fbc6[_0xaf46('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index e5fcbf2..7eedf9f 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 _0x7b74=['/:id','put','update','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe'];(function(_0x21fd45,_0x32e491){var _0x537a12=function(_0x5d446c){while(--_0x5d446c){_0x21fd45['push'](_0x21fd45['shift']());}};_0x537a12(++_0x32e491);}(_0x7b74,0x123));var _0x47b7=function(_0x5431cd,_0x2b1187){_0x5431cd=_0x5431cd-0x0;var _0x7f67a5=_0x7b74[_0x5431cd];return _0x7f67a5;};'use strict';var multer=require(_0x47b7('0x0'));var util=require('util');var path=require(_0x47b7('0x1'));var timeout=require(_0x47b7('0x2'));var express=require(_0x47b7('0x3'));var router=express[_0x47b7('0x4')]();var fs_extra=require(_0x47b7('0x5'));var auth=require(_0x47b7('0x6'));var interaction=require(_0x47b7('0x7'));var config=require(_0x47b7('0x8'));var controller=require(_0x47b7('0x9'));router[_0x47b7('0xa')]('/',auth[_0x47b7('0xb')](),controller['index']);router[_0x47b7('0xa')](_0x47b7('0xc'),auth[_0x47b7('0xb')](),controller['describe']);router[_0x47b7('0xa')](_0x47b7('0xd'),auth[_0x47b7('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x47b7('0xe')](_0x47b7('0xd'),auth[_0x47b7('0xb')](),controller[_0x47b7('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2123=['/:id','show','put','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','describe'];(function(_0x13a201,_0x54bc68){var _0x1c2040=function(_0xaeca05){while(--_0xaeca05){_0x13a201['push'](_0x13a201['shift']());}};_0x1c2040(++_0x54bc68);}(_0x2123,0x1a4));var _0x3212=function(_0x409792,_0x253743){_0x409792=_0x409792-0x0;var _0x42b625=_0x2123[_0x409792];return _0x42b625;};'use strict';var multer=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require('path');var timeout=require(_0x3212('0x2'));var express=require(_0x3212('0x3'));var router=express[_0x3212('0x4')]();var fs_extra=require(_0x3212('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3212('0x6'));var config=require('../../config/environment');var controller=require(_0x3212('0x7'));router[_0x3212('0x8')]('/',auth[_0x3212('0x9')](),controller[_0x3212('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x3212('0xb')]);router[_0x3212('0x8')](_0x3212('0xc'),auth[_0x3212('0x9')](),controller[_0x3212('0xd')]);router['post']('/',auth[_0x3212('0x9')](),controller['create']);router[_0x3212('0xe')](_0x3212('0xc'),auth[_0x3212('0x9')](),controller['update']);module[_0x3212('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 6a4f342..f19d6ab 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 _0xadf0=['name','exports','STRING'];(function(_0x2b901d,_0x3fe24e){var _0x38f9bf=function(_0xe0142a){while(--_0xe0142a){_0x2b901d['push'](_0x2b901d['shift']());}};_0x38f9bf(++_0x3fe24e);}(_0xadf0,0x12d));var _0x0adf=function(_0x7e7da4,_0x2596f4){_0x7e7da4=_0x7e7da4-0x0;var _0x3f1d5b=_0xadf0[_0x7e7da4];return _0x3f1d5b;};'use strict';var Sequelize=require('sequelize');module[_0x0adf('0x0')]={'name':{'type':Sequelize[_0x0adf('0x1')],'unique':_0x0adf('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0adf('0x1')]},'dialPrefix':{'type':Sequelize[_0x0adf('0x1')]}}; \ No newline at end of file +var _0x0fc8=['STRING','sequelize','exports'];(function(_0x1a98d3,_0x149987){var _0x15f8c9=function(_0x380320){while(--_0x380320){_0x1a98d3['push'](_0x1a98d3['shift']());}};_0x15f8c9(++_0x149987);}(_0x0fc8,0x145));var _0x80fc=function(_0x301cea,_0x4d5eb8){_0x301cea=_0x301cea-0x0;var _0x9dffbe=_0x0fc8[_0x301cea];return _0x9dffbe;};'use strict';var Sequelize=require(_0x80fc('0x0'));module[_0x80fc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x80fc('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 1b79f2a..ad63bf4 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 _0x1c9c=['stack','name','send','index','map','CmList','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','include','rows','catch','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','Disposition','getDispositions','findOne','ListId','findAll','removeDispositions','addContacts','CmContact','isArray','tags','push','each','omit','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','type','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','addAgents','ids','spread','userCmList:save','removeAgents','emit','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','then','destroy','Lists'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x1c9c,0x67));var _0xc1c9=function(_0x32b4aa,_0x12eba6){_0x32b4aa=_0x32b4aa-0x0;var _0x473160=_0x1c9c[_0x32b4aa];return _0x473160;};'use strict';var emlformat=require(_0xc1c9('0x0'));var rimraf=require(_0xc1c9('0x1'));var zipdir=require(_0xc1c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc1c9('0x3'));var moment=require(_0xc1c9('0x4'));var BPromise=require(_0xc1c9('0x5'));var Mustache=require(_0xc1c9('0x6'));var util=require('util');var path=require(_0xc1c9('0x7'));var sox=require(_0xc1c9('0x8'));var csv=require(_0xc1c9('0x9'));var ejs=require(_0xc1c9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1c9('0xb'));var squel=require(_0xc1c9('0xc'));var crypto=require(_0xc1c9('0xd'));var jsforce=require(_0xc1c9('0xe'));var deskjs=require(_0xc1c9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc1c9('0x10'));var Papa=require(_0xc1c9('0x11'));var Redis=require(_0xc1c9('0x12'));var authService=require(_0xc1c9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc1c9('0x14'));var hardwareService=require(_0xc1c9('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xc1c9('0x16'));var config=require(_0xc1c9('0x17'));var licenseUtil=require(_0xc1c9('0x18'));var db=require(_0xc1c9('0x19'))['db'];config[_0xc1c9('0x1a')]=_[_0xc1c9('0x1b')](config[_0xc1c9('0x1a')],{'host':_0xc1c9('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc1c9('0x1a')]));require(_0xc1c9('0x1d'))[_0xc1c9('0x1e')](socket);function respondWithStatusCode(_0xa4c9b8,_0x4d3702){_0x4d3702=_0x4d3702||0xcc;return function(_0x5024c4){if(_0x5024c4){return _0xa4c9b8[_0xc1c9('0x1f')](_0x4d3702);}return _0xa4c9b8[_0xc1c9('0x20')](_0x4d3702)[_0xc1c9('0x21')]();};}function respondWithResult(_0x240b04,_0x315f35){_0x315f35=_0x315f35||0xc8;return function(_0x2de13a){if(_0x2de13a){return _0x240b04[_0xc1c9('0x20')](_0x315f35)[_0xc1c9('0x22')](_0x2de13a);}};}function respondWithFilteredResult(_0x9e3234,_0x43941a){return function(_0x3747e3){if(_0x3747e3){var _0x2ae228=typeof _0x43941a[_0xc1c9('0x23')]===_0xc1c9('0x24')&&typeof _0x43941a['limit']==='undefined';var _0xc79e8=_0x3747e3['count'];var _0x3e45a9=_0x2ae228?0x0:_0x43941a[_0xc1c9('0x23')];var _0x16d928=_0x2ae228?_0x3747e3['count']:_0x43941a[_0xc1c9('0x23')]+_0x43941a[_0xc1c9('0x25')];var _0x2bad5b;if(_0x16d928>=_0xc79e8){_0x16d928=_0xc79e8;_0x2bad5b=0xc8;}else{_0x2bad5b=0xce;}_0x9e3234[_0xc1c9('0x20')](_0x2bad5b);return _0x9e3234[_0xc1c9('0x26')](_0xc1c9('0x27'),_0x3e45a9+'-'+_0x16d928+'/'+_0xc79e8)[_0xc1c9('0x22')](_0x3747e3);}return null;};}function patchUpdates(_0x2fe089){return function(_0xcddf31){try{jsonpatch['apply'](_0xcddf31,_0x2fe089,!![]);}catch(_0x54673b){return BPromise[_0xc1c9('0x28')](_0x54673b);}return _0xcddf31[_0xc1c9('0x29')]();};}function saveUpdates(_0x5e1b7e,_0x12e297){return function(_0x5d07b4){if(_0x5d07b4){return _0x5d07b4['update'](_0x5e1b7e)[_0xc1c9('0x2a')](function(_0x58d760){return _0x58d760;});}return null;};}function removeEntity(_0x510b79,_0x30f816){return function(_0x4e43ab){if(_0x4e43ab){return _0x4e43ab[_0xc1c9('0x2b')]()['then'](function(){var _0x2c37e9=_0x4e43ab['get']({'plain':!![]});var _0x32f31b=_0xc1c9('0x2c');return db['UserProfileResource'][_0xc1c9('0x2b')]({'where':{'type':_0x32f31b,'resourceId':_0x2c37e9['id']}})[_0xc1c9('0x2a')](function(){return _0x4e43ab;});})['then'](function(){_0x510b79[_0xc1c9('0x20')](0xcc)[_0xc1c9('0x21')]();});}};}function handleEntityNotFound(_0x2db696,_0x306d4d){return function(_0x50e22f){if(!_0x50e22f){_0x2db696[_0xc1c9('0x1f')](0x194);}return _0x50e22f;};}function handleError(_0x503a0c,_0x521c91){_0x521c91=_0x521c91||0x1f4;return function(_0x81d856){logger['error'](_0x81d856[_0xc1c9('0x2d')]);if(_0x81d856[_0xc1c9('0x2e')]){delete _0x81d856[_0xc1c9('0x2e')];}_0x503a0c[_0xc1c9('0x20')](_0x521c91)[_0xc1c9('0x2f')](_0x81d856);};}exports[_0xc1c9('0x30')]=function(_0x320117,_0x109c0f){var _0x473a47={},_0xf8d412={},_0x3755f9={'count':0x0,'rows':[]};var _0x4504a4=_[_0xc1c9('0x31')](db[_0xc1c9('0x32')][_0xc1c9('0x33')],function(_0x524ddb){return{'name':_0x524ddb['fieldName'],'type':_0x524ddb['type']['key']};});_0xf8d412['model']=_['map'](_0x4504a4,_0xc1c9('0x2e'));_0xf8d412[_0xc1c9('0x34')]=_[_0xc1c9('0x35')](_0x320117[_0xc1c9('0x34')]);_0xf8d412[_0xc1c9('0x36')]=_[_0xc1c9('0x37')](_0xf8d412[_0xc1c9('0x38')],_0xf8d412[_0xc1c9('0x34')]);_0x473a47[_0xc1c9('0x39')]=_[_0xc1c9('0x37')](_0xf8d412[_0xc1c9('0x38')],qs[_0xc1c9('0x3a')](_0x320117[_0xc1c9('0x34')][_0xc1c9('0x3a')]));_0x473a47['attributes']=_0x473a47['attributes'][_0xc1c9('0x3b')]?_0x473a47[_0xc1c9('0x39')]:_0xf8d412[_0xc1c9('0x38')];if(!_0x320117[_0xc1c9('0x34')][_0xc1c9('0x3c')](_0xc1c9('0x3d'))){_0x473a47[_0xc1c9('0x25')]=qs[_0xc1c9('0x25')](_0x320117[_0xc1c9('0x34')]['limit']);_0x473a47[_0xc1c9('0x23')]=qs[_0xc1c9('0x23')](_0x320117[_0xc1c9('0x34')][_0xc1c9('0x23')]);}_0x473a47[_0xc1c9('0x3e')]=qs[_0xc1c9('0x3f')](_0x320117['query'][_0xc1c9('0x3f')]);_0x473a47[_0xc1c9('0x40')]=qs[_0xc1c9('0x36')](_[_0xc1c9('0x41')](_0x320117[_0xc1c9('0x34')],_0xf8d412['filters']),_0x4504a4);if(_0x320117[_0xc1c9('0x34')][_0xc1c9('0x42')]){_0x473a47['where']=_[_0xc1c9('0x43')](_0x473a47[_0xc1c9('0x40')],{'$or':_['map'](_0x4504a4,function(_0x10b51b){if(_0x10b51b['type']!=='VIRTUAL'){var _0x350f92={};_0x350f92[_0x10b51b[_0xc1c9('0x2e')]]={'$like':'%'+_0x320117[_0xc1c9('0x34')][_0xc1c9('0x42')]+'%'};return _0x350f92;}})});}_0x473a47=_[_0xc1c9('0x43')]({},_0x473a47,_0x320117[_0xc1c9('0x44')]);var _0x4a4707={'where':_0x473a47[_0xc1c9('0x40')]};return db[_0xc1c9('0x32')][_0xc1c9('0x45')](_0x4a4707)[_0xc1c9('0x2a')](function(_0x35a850){_0x3755f9[_0xc1c9('0x45')]=_0x35a850;if(_0x320117[_0xc1c9('0x34')]['includeAll']){_0x473a47[_0xc1c9('0x46')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x473a47);})[_0xc1c9('0x2a')](function(_0x45c51a){_0x3755f9[_0xc1c9('0x47')]=_0x45c51a;return _0x3755f9;})[_0xc1c9('0x2a')](respondWithFilteredResult(_0x109c0f,_0x473a47))[_0xc1c9('0x48')](handleError(_0x109c0f,null));};exports[_0xc1c9('0x49')]=function(_0x23eb93,_0x1ac293){var _0x39a6e5={'raw':![],'where':{'id':_0x23eb93[_0xc1c9('0x4a')]['id']}},_0xf1ec54={};_0xf1ec54[_0xc1c9('0x38')]=_[_0xc1c9('0x35')](db[_0xc1c9('0x32')]['rawAttributes']);_0xf1ec54[_0xc1c9('0x34')]=_[_0xc1c9('0x35')](_0x23eb93[_0xc1c9('0x34')]);_0xf1ec54[_0xc1c9('0x36')]=_[_0xc1c9('0x37')](_0xf1ec54[_0xc1c9('0x38')],_0xf1ec54[_0xc1c9('0x34')]);_0x39a6e5[_0xc1c9('0x39')]=_[_0xc1c9('0x37')](_0xf1ec54['model'],qs[_0xc1c9('0x3a')](_0x23eb93[_0xc1c9('0x34')][_0xc1c9('0x3a')]));_0x39a6e5[_0xc1c9('0x39')]=_0x39a6e5[_0xc1c9('0x39')][_0xc1c9('0x3b')]?_0x39a6e5[_0xc1c9('0x39')]:_0xf1ec54[_0xc1c9('0x38')];if(_0x23eb93[_0xc1c9('0x34')][_0xc1c9('0x4b')]){_0x39a6e5[_0xc1c9('0x46')]=[{'all':!![]}];}_0x39a6e5=_['merge']({},_0x39a6e5,_0x23eb93[_0xc1c9('0x44')]);return db[_0xc1c9('0x32')][_0xc1c9('0x4c')](_0x39a6e5)[_0xc1c9('0x2a')](handleEntityNotFound(_0x1ac293,null))[_0xc1c9('0x2a')](respondWithResult(_0x1ac293,null))[_0xc1c9('0x48')](handleError(_0x1ac293,null));};exports['create']=function(_0xbeb1bb,_0xa70803){return db['CmList'][_0xc1c9('0x4d')](_0xbeb1bb[_0xc1c9('0x4e')],{})[_0xc1c9('0x2a')](function(_0x1023cc){var _0x5334a5=_0xbeb1bb[_0xc1c9('0x4f')][_0xc1c9('0x50')]({'plain':!![]});if(!_0x5334a5)throw new Error(_0xc1c9('0x51'));if(_0x5334a5[_0xc1c9('0x52')]===_0xc1c9('0x4f')){var _0x21cdf6=_0x1023cc['get']({'plain':!![]});var _0x2414b9=_0xc1c9('0x2c');return db['UserProfileSection'][_0xc1c9('0x4c')]({'where':{'name':_0x2414b9,'userProfileId':_0x5334a5[_0xc1c9('0x53')]},'raw':!![]})[_0xc1c9('0x2a')](function(_0xb44c4d){if(_0xb44c4d&&_0xb44c4d[_0xc1c9('0x54')]===0x0){return db[_0xc1c9('0x55')][_0xc1c9('0x4d')]({'name':_0x21cdf6[_0xc1c9('0x2e')],'resourceId':_0x21cdf6['id'],'type':_0xb44c4d['name'],'sectionId':_0xb44c4d['id']},{})[_0xc1c9('0x2a')](function(){return _0x1023cc;});}else{return _0x1023cc;}})[_0xc1c9('0x48')](function(_0x2cb09c){logger[_0xc1c9('0x56')](_0xc1c9('0x57'),_0x2cb09c);throw _0x2cb09c;});}return _0x1023cc;})['then'](respondWithResult(_0xa70803,0xc9))[_0xc1c9('0x48')](handleError(_0xa70803,null));};exports[_0xc1c9('0x58')]=function(_0x58c2cc,_0x3cf5e8){if(_0x58c2cc[_0xc1c9('0x4e')]['id']){delete _0x58c2cc[_0xc1c9('0x4e')]['id'];}return db[_0xc1c9('0x32')][_0xc1c9('0x4c')]({'where':{'id':_0x58c2cc[_0xc1c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3cf5e8,null))[_0xc1c9('0x2a')](saveUpdates(_0x58c2cc[_0xc1c9('0x4e')],null))[_0xc1c9('0x2a')](respondWithResult(_0x3cf5e8,null))[_0xc1c9('0x48')](handleError(_0x3cf5e8,null));};exports[_0xc1c9('0x2b')]=function(_0x14a9ce,_0x14d7bf){return db['CmList'][_0xc1c9('0x4c')]({'where':{'id':_0x14a9ce[_0xc1c9('0x4a')]['id']}})[_0xc1c9('0x2a')](handleEntityNotFound(_0x14d7bf,null))[_0xc1c9('0x2a')](removeEntity(_0x14d7bf,null))[_0xc1c9('0x48')](handleError(_0x14d7bf,null));};exports[_0xc1c9('0x59')]=function(_0x3617cb,_0x3825f1){return db[_0xc1c9('0x32')]['describe']()[_0xc1c9('0x2a')](respondWithResult(_0x3825f1,null))[_0xc1c9('0x48')](handleError(_0x3825f1,null));};exports['addDisposition']=function(_0x4a2ccd,_0x56744a,_0x3229d1){if(_0x4a2ccd[_0xc1c9('0x4e')]['id']){delete _0x4a2ccd[_0xc1c9('0x4e')]['id'];}return db['CmList'][_0xc1c9('0x4c')]({'where':{'id':_0x4a2ccd['params']['id']}})['then'](handleEntityNotFound(_0x56744a,null))['then'](function(_0x66ca25){if(_0x66ca25){_0x4a2ccd['body']['ListId']=_0x66ca25['id'];return db[_0xc1c9('0x5a')][_0xc1c9('0x4d')](_0x4a2ccd[_0xc1c9('0x4e')]);}})[_0xc1c9('0x2a')](respondWithResult(_0x56744a,null))[_0xc1c9('0x48')](handleError(_0x56744a,null));};exports[_0xc1c9('0x5b')]=function(_0x273dad,_0x2a3394,_0x5cda12){var _0x7ee89a={'raw':![],'where':{}};var _0x2112a1={};var _0x24f511={'count':0x0,'rows':[]};return db[_0xc1c9('0x32')][_0xc1c9('0x5c')]({'where':{'id':_0x273dad[_0xc1c9('0x4a')]['id']}})[_0xc1c9('0x2a')](handleEntityNotFound(_0x2a3394,null))['then'](function(_0x2f50ee){if(_0x2f50ee){_0x2112a1[_0xc1c9('0x38')]=_[_0xc1c9('0x35')](db['Disposition']['rawAttributes']);_0x2112a1['query']=_['keys'](_0x273dad['query']);_0x2112a1[_0xc1c9('0x36')]=_[_0xc1c9('0x37')](_0x2112a1['model'],_0x2112a1[_0xc1c9('0x34')]);_0x7ee89a['attributes']=_['intersection'](_0x2112a1['model'],qs['fields'](_0x273dad['query'][_0xc1c9('0x3a')]));_0x7ee89a['attributes']=_0x7ee89a[_0xc1c9('0x39')]['length']?_0x7ee89a[_0xc1c9('0x39')]:_0x2112a1[_0xc1c9('0x38')];if(!_0x273dad[_0xc1c9('0x34')][_0xc1c9('0x3c')](_0xc1c9('0x3d'))){_0x7ee89a[_0xc1c9('0x25')]=qs[_0xc1c9('0x25')](_0x273dad[_0xc1c9('0x34')][_0xc1c9('0x25')]);_0x7ee89a[_0xc1c9('0x23')]=qs[_0xc1c9('0x23')](_0x273dad['query'][_0xc1c9('0x23')]);}_0x7ee89a[_0xc1c9('0x3e')]=qs[_0xc1c9('0x3f')](_0x273dad[_0xc1c9('0x34')]['sort']);_0x7ee89a[_0xc1c9('0x40')]=qs[_0xc1c9('0x36')](_[_0xc1c9('0x41')](_0x273dad[_0xc1c9('0x34')],_0x2112a1[_0xc1c9('0x36')]));_0x7ee89a[_0xc1c9('0x40')][_0xc1c9('0x5d')]=_0x2f50ee['id'];if(_0x273dad['query'][_0xc1c9('0x42')]){_0x7ee89a[_0xc1c9('0x40')]=_['merge'](_0x7ee89a[_0xc1c9('0x40')],{'$or':_['map'](_0x7ee89a[_0xc1c9('0x39')],function(_0x5d4194){var _0x1dcf2e={};_0x1dcf2e[_0x5d4194]={'$like':'%'+_0x273dad[_0xc1c9('0x34')][_0xc1c9('0x42')]+'%'};return _0x1dcf2e;})});}_0x7ee89a=_[_0xc1c9('0x43')]({},_0x7ee89a,_0x273dad['options']);return db['Disposition'][_0xc1c9('0x45')]({'where':_0x7ee89a['where']})['then'](function(_0x4c4929){_0x24f511[_0xc1c9('0x45')]=_0x4c4929;if(_0x273dad[_0xc1c9('0x34')][_0xc1c9('0x4b')]){_0x7ee89a[_0xc1c9('0x46')]=[{'all':!![]}];}return db[_0xc1c9('0x5a')][_0xc1c9('0x5e')](_0x7ee89a);})[_0xc1c9('0x2a')](function(_0x27277c){_0x24f511[_0xc1c9('0x47')]=_0x27277c;return _0x24f511;});}})[_0xc1c9('0x2a')](respondWithFilteredResult(_0x2a3394,_0x7ee89a))['catch'](handleError(_0x2a3394,null));};exports['removeDispositions']=function(_0x1a6c4b,_0x6d6e01,_0x4277ba){return db[_0xc1c9('0x32')][_0xc1c9('0x4c')]({'where':{'id':_0x1a6c4b[_0xc1c9('0x4a')]['id']}})[_0xc1c9('0x2a')](handleEntityNotFound(_0x6d6e01,null))[_0xc1c9('0x2a')](function(_0x1a7fd5){if(_0x1a7fd5){return _0x1a7fd5[_0xc1c9('0x5f')](_0x1a6c4b[_0xc1c9('0x34')]['ids']);}})['then'](respondWithStatusCode(_0x6d6e01,null))[_0xc1c9('0x48')](handleError(_0x6d6e01,null));};exports[_0xc1c9('0x60')]=function(_0x5c9f9f,_0xa96d80,_0xc3457a){return db[_0xc1c9('0x32')][_0xc1c9('0x4c')]({'where':{'id':_0x5c9f9f['params']['id']}})[_0xc1c9('0x2a')](handleEntityNotFound(_0xa96d80,null))[_0xc1c9('0x2a')](function(_0x285e3b){if(_0x285e3b){var _0x1d07ec=[];var _0x3a9677={'success':[],'errors':[]};return db[_0xc1c9('0x61')][_0xc1c9('0x59')]()[_0xc1c9('0x2a')](function(_0xa8fbff){if(_0x5c9f9f[_0xc1c9('0x4e')]['tags']&&_[_0xc1c9('0x62')](_0x5c9f9f[_0xc1c9('0x4e')]['tags'])){if(_0x5c9f9f[_0xc1c9('0x4e')][_0xc1c9('0x63')][_0xc1c9('0x3b')]){_0x5c9f9f['body'][_0xc1c9('0x63')]=_0x5c9f9f[_0xc1c9('0x4e')]['tags']['join'](';')+';';}else{_0x5c9f9f[_0xc1c9('0x4e')]['tags']=null;}}else{_0x5c9f9f['body']['tags']=null;}if(_0x5c9f9f[_0xc1c9('0x4e')]&&_[_0xc1c9('0x62')](_0x5c9f9f[_0xc1c9('0x4e')])){for(var _0x1d8731=0x0;_0x1d8731<_0x5c9f9f['body'][_0xc1c9('0x3b')];_0x1d8731+=0x1){_0x5c9f9f[_0xc1c9('0x4e')][_0x1d8731][_0xc1c9('0x5d')]=_0x5c9f9f[_0xc1c9('0x4a')]['id'];_0x1d07ec[_0xc1c9('0x64')](_0x5c9f9f[_0xc1c9('0x4e')][_0x1d8731]);}return BPromise[_0xc1c9('0x65')](_0x1d07ec,function(_0x3b16a4){return db[_0xc1c9('0x61')][_0xc1c9('0x4d')](_[_0xc1c9('0x66')](_0x3b16a4,['ids','id'])||{},{'fields':_[_0xc1c9('0x35')](_0xa8fbff),'raw':!![]})[_0xc1c9('0x2a')](function(_0x477824){_0x3a9677['success'][_0xc1c9('0x64')](_0x477824[_0xc1c9('0x67')]);})[_0xc1c9('0x48')](function(_0x997218){_0x3a9677[_0xc1c9('0x68')][_0xc1c9('0x64')]({'data':_0x3b16a4,'error':_0x997218[_0xc1c9('0x69')]});});})[_0xc1c9('0x2a')](function(_0xaf2025){return _0x3a9677;})[_0xc1c9('0x48')](function(_0x1b7474){return _0x1b7474;});}else{_0xa96d80[_0xc1c9('0x20')](0x190)[_0xc1c9('0x22')]({'message':_0xc1c9('0x6a')});}});}})[_0xc1c9('0x2a')](respondWithResult(_0xa96d80,null))[_0xc1c9('0x48')](handleError(_0xa96d80,null));};exports[_0xc1c9('0x6b')]=function(_0x29c5ac,_0x265d97,_0x1eba49){var _0x23d9a1;return db[_0xc1c9('0x32')][_0xc1c9('0x4c')]({'where':{'id':_0x29c5ac['params']['id']},'include':[{'model':db[_0xc1c9('0x6c')],'as':_0xc1c9('0x6d')}]})['then'](handleEntityNotFound(_0x265d97,null))[_0xc1c9('0x2a')](function(_0x140f9c){if(_0x140f9c){_0x23d9a1=_0x140f9c;return db[_0xc1c9('0x61')][_0xc1c9('0x33')];}})[_0xc1c9('0x2a')](function(_0x42e884){if(_0x42e884){var _0x383a04={};var _0x22b42c={};_0x22b42c['model']=_[_0xc1c9('0x6e')](_[_0xc1c9('0x35')](_0x42e884),_['map'](_0x23d9a1[_0xc1c9('0x6d')],function(_0x2b570f){return util[_0xc1c9('0x6f')](_0xc1c9('0x70'),_0x2b570f['id']);}));_0x22b42c[_0xc1c9('0x34')]=_['keys'](_0x29c5ac[_0xc1c9('0x34')]);_0x22b42c[_0xc1c9('0x36')]=_[_0xc1c9('0x37')](_0x22b42c[_0xc1c9('0x38')],_0x22b42c['query']);_0x383a04[_0xc1c9('0x39')]=_[_0xc1c9('0x37')](_0x22b42c[_0xc1c9('0x38')],qs[_0xc1c9('0x3a')](_0x29c5ac['query']['fields']));_0x383a04[_0xc1c9('0x39')]=_0x383a04[_0xc1c9('0x39')][_0xc1c9('0x3b')]?_0x383a04[_0xc1c9('0x39')]:_0x22b42c[_0xc1c9('0x38')];if(!_0x29c5ac[_0xc1c9('0x34')][_0xc1c9('0x3c')]('nolimit')){_0x383a04[_0xc1c9('0x25')]=qs[_0xc1c9('0x25')](_0x29c5ac[_0xc1c9('0x34')][_0xc1c9('0x25')]);_0x383a04[_0xc1c9('0x23')]=qs[_0xc1c9('0x23')](_0x29c5ac['query'][_0xc1c9('0x23')]);}_0x383a04[_0xc1c9('0x3e')]=qs[_0xc1c9('0x3f')](_0x29c5ac[_0xc1c9('0x34')]['sort']);_0x383a04[_0xc1c9('0x40')]=qs['filters'](_['pick'](_0x29c5ac['query'],_0x22b42c['filters']));_0x383a04[_0xc1c9('0x71')]=!![];if(_0x29c5ac['query'][_0xc1c9('0x42')]){_0x383a04[_0xc1c9('0x40')]=_[_0xc1c9('0x43')](_0x383a04[_0xc1c9('0x40')],{'$or':_[_0xc1c9('0x31')](_0x383a04[_0xc1c9('0x39')],function(_0x4b510d){var _0x1439ad={};_0x1439ad[_0x4b510d]={'$like':'%'+_0x29c5ac[_0xc1c9('0x34')][_0xc1c9('0x42')]+'%'};return _0x1439ad;})});}_0x383a04=_['merge']({},_0x383a04,_0x29c5ac[_0xc1c9('0x44')]);return _0x23d9a1[_0xc1c9('0x6b')](_0x383a04);}})[_0xc1c9('0x2a')](respondWithResult(_0x265d97,null))['catch'](handleError(_0x265d97,null));};exports[_0xc1c9('0x72')]=function(_0x2394bc,_0x11c66f,_0x4af6d7){var _0x54449d;return db[_0xc1c9('0x32')]['find']({'where':{'id':_0x2394bc[_0xc1c9('0x4a')]['id']},'include':[{'model':db[_0xc1c9('0x6c')],'as':_0xc1c9('0x6d')}]})[_0xc1c9('0x2a')](handleEntityNotFound(_0x11c66f,null))['then'](function(_0x5e2f61){if(_0x5e2f61){_0x54449d=_0x5e2f61;return db['CmContact']['rawAttributes'];}})[_0xc1c9('0x2a')](function(_0x382038){if(_0x382038){var _0x288d97={};var _0x21f6d6={};_0x21f6d6[_0xc1c9('0x38')]=_[_0xc1c9('0x6e')](_[_0xc1c9('0x35')](_0x382038),_['map'](_0x54449d[_0xc1c9('0x6d')],function(_0x1adb43){return util['format']('cf_%d',_0x1adb43['id']);}));_0x21f6d6[_0xc1c9('0x34')]=_[_0xc1c9('0x35')](_0x2394bc['query']);_0x21f6d6[_0xc1c9('0x36')]=_[_0xc1c9('0x37')](_0x21f6d6[_0xc1c9('0x38')],_0x21f6d6['query']);_0x288d97['attributes']=_[_0xc1c9('0x37')](_0x21f6d6['model'],qs[_0xc1c9('0x3a')](_0x2394bc[_0xc1c9('0x34')][_0xc1c9('0x3a')]));_0x288d97[_0xc1c9('0x39')]=_0x288d97[_0xc1c9('0x39')][_0xc1c9('0x3b')]?_0x288d97[_0xc1c9('0x39')]:_0x21f6d6[_0xc1c9('0x38')];if(!_0x2394bc[_0xc1c9('0x34')][_0xc1c9('0x3c')](_0xc1c9('0x3d'))){_0x288d97['limit']=qs['limit'](_0x2394bc[_0xc1c9('0x34')][_0xc1c9('0x25')]);_0x288d97['offset']=qs['offset'](_0x2394bc['query']['offset']);}_0x288d97[_0xc1c9('0x3e')]=qs[_0xc1c9('0x3f')](_0x2394bc[_0xc1c9('0x34')][_0xc1c9('0x3f')]);_0x288d97[_0xc1c9('0x40')]=qs[_0xc1c9('0x36')](_[_0xc1c9('0x41')](_0x2394bc[_0xc1c9('0x34')],_0x21f6d6[_0xc1c9('0x36')]));_0x288d97['raw']=!![];if(_0x2394bc[_0xc1c9('0x34')][_0xc1c9('0x42')]){_0x288d97[_0xc1c9('0x40')]=_[_0xc1c9('0x43')](_0x288d97['where'],{'$or':_[_0xc1c9('0x31')](_0x288d97[_0xc1c9('0x39')],function(_0x31ebb9){var _0xa5840c={};_0xa5840c[_0x31ebb9]={'$like':'%'+_0x2394bc[_0xc1c9('0x34')][_0xc1c9('0x42')]+'%'};return _0xa5840c;})});}_0x288d97=_[_0xc1c9('0x43')]({},_0x288d97,_0x2394bc['options']);return _0x54449d['getContacts'](_0x288d97);}})['then'](function(_0x724de2){if(!_['isEmpty'](_0x724de2)){var _0x29023f=toCsv(_0x724de2);var _0x57d5d1=Date[_0xc1c9('0x73')]();fs['writeFileSync'](util[_0xc1c9('0x6f')](_0xc1c9('0x74'),_0x54449d['id'],_0x57d5d1),_0x29023f);_0x11c66f[_0xc1c9('0x75')](_0xc1c9('0x76'),_0xc1c9('0x77')+util[_0xc1c9('0x6f')](_0xc1c9('0x78'),_0x54449d['id'],_0x57d5d1));_0x11c66f['setHeader'](_0xc1c9('0x79'),_0xc1c9('0x7a'));return _0x11c66f[_0xc1c9('0x7b')](util[_0xc1c9('0x6f')](_0xc1c9('0x74'),_0x54449d['id'],_0x57d5d1));}else{return _0x11c66f[_0xc1c9('0x1f')](0xcc);}})[_0xc1c9('0x48')](handleError(_0x11c66f,null));};exports[_0xc1c9('0x7c')]=function(_0x1c5591,_0x2ef6af,_0x1057c5){var _0x28fff1;delete _0x1c5591[_0xc1c9('0x4e')]['id'];return db[_0xc1c9('0x32')]['findOne']({'where':{'id':_0x1c5591[_0xc1c9('0x4a')]['id']}})[_0xc1c9('0x2a')](handleEntityNotFound(_0x2ef6af,null))[_0xc1c9('0x2a')](function(_0x2300c2){if(_0x2300c2){return db[_0xc1c9('0x7d')]['transaction'](function(_0x80d35c){return db[_0xc1c9('0x6c')][_0xc1c9('0x4d')](_0x1c5591[_0xc1c9('0x4e')],{'transaction':_0x80d35c})[_0xc1c9('0x2a')](function(_0xa5d6c9){_0x28fff1=_0xa5d6c9;return _0x2300c2[_0xc1c9('0x7e')](_0xa5d6c9,{'transaction':_0x80d35c});})[_0xc1c9('0x2a')](function(){var _0x16b129={'type':db[_0xc1c9('0x7f')][_0xc1c9('0x80')],'transaction':_0x80d35c};switch(_0x1c5591[_0xc1c9('0x4e')][_0xc1c9('0x81')]){case _0xc1c9('0x82'):_0x16b129[_0xc1c9('0x81')]=db[_0xc1c9('0x7f')][_0xc1c9('0x80')];break;case _0xc1c9('0x83'):_0x16b129[_0xc1c9('0x81')]=db[_0xc1c9('0x7f')][_0xc1c9('0x84')];break;case _0xc1c9('0x85'):_0x16b129[_0xc1c9('0x81')]=db[_0xc1c9('0x7f')][_0xc1c9('0x86')];_0x16b129[_0xc1c9('0x87')]=![];break;default:}return db[_0xc1c9('0x7d')][_0xc1c9('0x88')][_0xc1c9('0x89')]('cm_contacts',util['format'](_0xc1c9('0x8a'),_0x28fff1['id']),_0x16b129);})[_0xc1c9('0x2a')](function(){return _0x28fff1;});});}})['then'](respondWithResult(_0x2ef6af,null))['catch'](handleError(_0x2ef6af,null));};exports['getCustomFields']=function(_0x3e3265,_0x2e2699,_0x578ff5){var _0x23054f={};var _0x1a0b88={};var _0x33f05b;var _0x1a5719;return db[_0xc1c9('0x32')][_0xc1c9('0x5c')]({'where':{'id':_0x3e3265[_0xc1c9('0x4a')]['id']}})[_0xc1c9('0x2a')](handleEntityNotFound(_0x2e2699,null))[_0xc1c9('0x2a')](function(_0x113cbd){if(_0x113cbd){_0x33f05b=_0x113cbd;_0x1a0b88[_0xc1c9('0x38')]=_[_0xc1c9('0x35')](db[_0xc1c9('0x6c')][_0xc1c9('0x33')]);_0x1a0b88[_0xc1c9('0x34')]=_[_0xc1c9('0x35')](_0x3e3265[_0xc1c9('0x34')]);_0x1a0b88[_0xc1c9('0x36')]=_['intersection'](_0x1a0b88[_0xc1c9('0x38')],_0x1a0b88['query']);_0x23054f['attributes']=_[_0xc1c9('0x37')](_0x1a0b88['model'],qs[_0xc1c9('0x3a')](_0x3e3265[_0xc1c9('0x34')][_0xc1c9('0x3a')]));_0x23054f[_0xc1c9('0x39')]=_0x23054f[_0xc1c9('0x39')][_0xc1c9('0x3b')]?_0x23054f[_0xc1c9('0x39')]:_0x1a0b88[_0xc1c9('0x38')];_0x23054f[_0xc1c9('0x3e')]=qs['sort'](_0x3e3265['query']['sort']);_0x23054f[_0xc1c9('0x40')]=qs['filters'](_[_0xc1c9('0x41')](_0x3e3265['query'],_0x1a0b88['filters']));_0x23054f['where']=_[_0xc1c9('0x43')](_0x23054f['where'],{'$or':[{'ListId':_0x113cbd['id']},{'ListId':null}]});if(_0x3e3265[_0xc1c9('0x34')][_0xc1c9('0x42')]){_0x23054f[_0xc1c9('0x40')]=_[_0xc1c9('0x43')](_0x23054f['where'],{'$or':_[_0xc1c9('0x31')](_0x23054f[_0xc1c9('0x39')],function(_0x82d6e9){var _0xbe3529={};_0xbe3529[_0x82d6e9]={'$like':'%'+_0x3e3265['query']['filter']+'%'};return _0xbe3529;})});}_0x23054f=_['merge']({},_0x23054f,_0x3e3265[_0xc1c9('0x44')]);return db[_0xc1c9('0x6c')]['findAndCountAll'](_0x23054f);}})[_0xc1c9('0x2a')](respondWithResult(_0x2e2699,null))[_0xc1c9('0x48')](handleError(_0x2e2699,null));};exports[_0xc1c9('0x8b')]=function(_0x558231,_0x545673,_0x34dc1e){return db[_0xc1c9('0x32')][_0xc1c9('0x4c')]({'where':{'id':_0x558231[_0xc1c9('0x4a')]['id']}})[_0xc1c9('0x2a')](handleEntityNotFound(_0x545673,null))[_0xc1c9('0x2a')](function(_0x1df121){if(_0x1df121){return _0x1df121[_0xc1c9('0x8b')](_0x558231[_0xc1c9('0x4e')]['ids'],_[_0xc1c9('0x66')](_0x558231[_0xc1c9('0x4e')],[_0xc1c9('0x8c'),'id'])||{})[_0xc1c9('0x8d')](function(_0x336de8){for(var _0x2177f4=0x0;_0x2177f4<_0x558231[_0xc1c9('0x4e')][_0xc1c9('0x8c')][_0xc1c9('0x3b')];_0x2177f4+=0x1){socket['emit'](_0xc1c9('0x8e'),{'UserId':Number(_0x558231[_0xc1c9('0x4e')][_0xc1c9('0x8c')][_0x2177f4]),'CmListId':Number(_0x558231['params']['id'])});}return _0x336de8;});}})[_0xc1c9('0x2a')](respondWithResult(_0x545673,null))[_0xc1c9('0x48')](handleError(_0x545673,null));};exports[_0xc1c9('0x8f')]=function(_0x2951b4,_0x2453f2,_0x33a997){return db[_0xc1c9('0x32')]['find']({'where':{'id':_0x2951b4[_0xc1c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2453f2,null))['then'](function(_0x2df445){if(_0x2df445){return _0x2df445[_0xc1c9('0x8f')](_0x2951b4[_0xc1c9('0x34')]['ids'])['then'](function(){if(_[_0xc1c9('0x62')](_0x2951b4['query'][_0xc1c9('0x8c')])){for(var _0x4de038=0x0;_0x4de038<_0x2951b4[_0xc1c9('0x34')]['ids'][_0xc1c9('0x3b')];_0x4de038+=0x1){socket[_0xc1c9('0x90')]('userCmList:remove',{'UserId':Number(_0x2951b4[_0xc1c9('0x34')]['ids'][_0x4de038]),'CmListId':Number(_0x2951b4[_0xc1c9('0x4a')]['id'])});}}else{socket[_0xc1c9('0x90')](_0xc1c9('0x91'),{'UserId':Number(_0x2951b4[_0xc1c9('0x34')][_0xc1c9('0x8c')]),'CmListId':Number(_0x2951b4['params']['id'])});}});}})[_0xc1c9('0x2a')](respondWithStatusCode(_0x2453f2,null))[_0xc1c9('0x48')](handleError(_0x2453f2,null));};exports['getAgents']=function(_0x4f0ddd,_0x315060,_0x1c5d45){var _0x1c36e0={};var _0x144f61={};var _0x285cf9;var _0x61f690;return db['CmList'][_0xc1c9('0x5c')]({'where':{'id':_0x4f0ddd[_0xc1c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x315060,null))[_0xc1c9('0x2a')](function(_0x45510e){if(_0x45510e){_0x285cf9=_0x45510e;_0x144f61[_0xc1c9('0x38')]=_[_0xc1c9('0x35')](db[_0xc1c9('0x92')][_0xc1c9('0x33')]);_0x144f61[_0xc1c9('0x34')]=_['keys'](_0x4f0ddd[_0xc1c9('0x34')]);_0x144f61[_0xc1c9('0x36')]=_[_0xc1c9('0x37')](_0x144f61[_0xc1c9('0x38')],_0x144f61[_0xc1c9('0x34')]);_0x1c36e0[_0xc1c9('0x39')]=_[_0xc1c9('0x37')](_0x144f61[_0xc1c9('0x38')],qs[_0xc1c9('0x3a')](_0x4f0ddd['query'][_0xc1c9('0x3a')]));_0x1c36e0[_0xc1c9('0x39')]=_0x1c36e0[_0xc1c9('0x39')][_0xc1c9('0x3b')]?_0x1c36e0[_0xc1c9('0x39')]:_0x144f61['model'];_0x1c36e0[_0xc1c9('0x3e')]=qs[_0xc1c9('0x3f')](_0x4f0ddd[_0xc1c9('0x34')][_0xc1c9('0x3f')]);_0x1c36e0[_0xc1c9('0x40')]=qs[_0xc1c9('0x36')](_[_0xc1c9('0x41')](_0x4f0ddd[_0xc1c9('0x34')],_0x144f61[_0xc1c9('0x36')]));if(_0x4f0ddd[_0xc1c9('0x34')][_0xc1c9('0x42')]){_0x1c36e0[_0xc1c9('0x40')]=_[_0xc1c9('0x43')](_0x1c36e0[_0xc1c9('0x40')],{'$or':_[_0xc1c9('0x31')](_0x1c36e0[_0xc1c9('0x39')],function(_0x364eba){var _0x591858={};_0x591858[_0x364eba]={'$like':'%'+_0x4f0ddd[_0xc1c9('0x34')][_0xc1c9('0x42')]+'%'};return _0x591858;})});}_0x1c36e0=_[_0xc1c9('0x43')]({},_0x1c36e0,_0x4f0ddd['options']);return _0x285cf9[_0xc1c9('0x93')](_0x1c36e0);}})[_0xc1c9('0x2a')](function(_0x4d01e3){if(_0x4d01e3){_0x61f690=_0x4d01e3['length'];if(!_0x4f0ddd[_0xc1c9('0x34')][_0xc1c9('0x3c')](_0xc1c9('0x3d'))){_0x1c36e0[_0xc1c9('0x25')]=qs[_0xc1c9('0x25')](_0x4f0ddd[_0xc1c9('0x34')][_0xc1c9('0x25')]);_0x1c36e0[_0xc1c9('0x23')]=qs[_0xc1c9('0x23')](_0x4f0ddd['query'][_0xc1c9('0x23')]);}return _0x285cf9['getAgents'](_0x1c36e0);}})[_0xc1c9('0x2a')](function(_0x599477){if(_0x599477){return _0x599477?{'count':_0x61f690,'rows':_0x599477}:null;}})[_0xc1c9('0x2a')](respondWithResult(_0x315060,null))[_0xc1c9('0x48')](handleError(_0x315060,null));}; \ No newline at end of file +var _0x6a6a=['/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s','addAgents','emit','removeAgents','userCmList:remove','getAgents','User','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','Lists','UserProfileResource','status','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ListId','findOne','Disposition','nolimit','removeDispositions','ids','addContacts','tags','isArray','join','push','each','omit','success','dataValues','message','json','Malformed\x20request\x20syntax','CmCustomField','CustomFields','CmContact','format','cf_%d','getContacts','getContactsCsv','concat','raw','isEmpty','now'];(function(_0x2f39a1,_0x47ed21){var _0x3a688c=function(_0x13f0af){while(--_0x13f0af){_0x2f39a1['push'](_0x2f39a1['shift']());}};_0x3a688c(++_0x47ed21);}(_0x6a6a,0x1ca));var _0xa6a6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6a6a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6a6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6a6('0x1'));var rp=require(_0xa6a6('0x2'));var moment=require(_0xa6a6('0x3'));var BPromise=require(_0xa6a6('0x4'));var Mustache=require(_0xa6a6('0x5'));var util=require('util');var path=require(_0xa6a6('0x6'));var sox=require(_0xa6a6('0x7'));var csv=require(_0xa6a6('0x8'));var ejs=require(_0xa6a6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa6a6('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa6a6('0xb'));var deskjs=require(_0xa6a6('0xc'));var toCsv=require(_0xa6a6('0x8'));var querystring=require(_0xa6a6('0xd'));var Papa=require(_0xa6a6('0xe'));var Redis=require('ioredis');var authService=require(_0xa6a6('0xf'));var qs=require(_0xa6a6('0x10'));var as=require(_0xa6a6('0x11'));var hardwareService=require(_0xa6a6('0x12'));var logger=require(_0xa6a6('0x13'))(_0xa6a6('0x14'));var utils=require(_0xa6a6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa6a6('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa6a6('0x17')](config[_0xa6a6('0x18')],{'host':_0xa6a6('0x19'),'port':0x18eb});var socket=require(_0xa6a6('0x1a'))(new Redis(config['redis']));require('./cmList.socket')[_0xa6a6('0x1b')](socket);function respondWithStatusCode(_0x5a1d79,_0x1386c0){_0x1386c0=_0x1386c0||0xcc;return function(_0x1ab781){if(_0x1ab781){return _0x5a1d79[_0xa6a6('0x1c')](_0x1386c0);}return _0x5a1d79['status'](_0x1386c0)[_0xa6a6('0x1d')]();};}function respondWithResult(_0x47e559,_0x5388ca){_0x5388ca=_0x5388ca||0xc8;return function(_0x3738ea){if(_0x3738ea){return _0x47e559['status'](_0x5388ca)['json'](_0x3738ea);}};}function respondWithFilteredResult(_0x2274a0,_0x2c2ab8){return function(_0x4b12bd){if(_0x4b12bd){var _0x522645=typeof _0x2c2ab8[_0xa6a6('0x1e')]===_0xa6a6('0x1f')&&typeof _0x2c2ab8[_0xa6a6('0x20')]===_0xa6a6('0x1f');var _0x31ec45=_0x4b12bd[_0xa6a6('0x21')];var _0x2087a6=_0x522645?0x0:_0x2c2ab8[_0xa6a6('0x1e')];var _0x2971be=_0x522645?_0x4b12bd[_0xa6a6('0x21')]:_0x2c2ab8['offset']+_0x2c2ab8[_0xa6a6('0x20')];var _0x5dd0f5;if(_0x2971be>=_0x31ec45){_0x2971be=_0x31ec45;_0x5dd0f5=0xc8;}else{_0x5dd0f5=0xce;}_0x2274a0['status'](_0x5dd0f5);return _0x2274a0['set'](_0xa6a6('0x22'),_0x2087a6+'-'+_0x2971be+'/'+_0x31ec45)['json'](_0x4b12bd);}return null;};}function patchUpdates(_0xb2c6c3){return function(_0x245129){try{jsonpatch['apply'](_0x245129,_0xb2c6c3,!![]);}catch(_0x1299f6){return BPromise[_0xa6a6('0x23')](_0x1299f6);}return _0x245129[_0xa6a6('0x24')]();};}function saveUpdates(_0x430e4f,_0x4ce89a){return function(_0xc8f12a){if(_0xc8f12a){return _0xc8f12a[_0xa6a6('0x25')](_0x430e4f)['then'](function(_0x353985){return _0x353985;});}return null;};}function removeEntity(_0x547ca6,_0x42cd0a){return function(_0x3ee149){if(_0x3ee149){return _0x3ee149[_0xa6a6('0x26')]()[_0xa6a6('0x27')](function(){var _0x3a3b2e=_0x3ee149['get']({'plain':!![]});var _0x692076=_0xa6a6('0x28');return db[_0xa6a6('0x29')][_0xa6a6('0x26')]({'where':{'type':_0x692076,'resourceId':_0x3a3b2e['id']}})[_0xa6a6('0x27')](function(){return _0x3ee149;});})[_0xa6a6('0x27')](function(){_0x547ca6[_0xa6a6('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34fc12,_0x1b4693){return function(_0x1bb7e9){if(!_0x1bb7e9){_0x34fc12[_0xa6a6('0x1c')](0x194);}return _0x1bb7e9;};}function handleError(_0x55ff83,_0xca9726){_0xca9726=_0xca9726||0x1f4;return function(_0x1e6e71){logger[_0xa6a6('0x2b')](_0x1e6e71[_0xa6a6('0x2c')]);if(_0x1e6e71[_0xa6a6('0x2d')]){delete _0x1e6e71[_0xa6a6('0x2d')];}_0x55ff83['status'](_0xca9726)[_0xa6a6('0x2e')](_0x1e6e71);};}exports[_0xa6a6('0x2f')]=function(_0x2aef93,_0xd570de){var _0x3c9fd2={},_0x1d1d27={},_0x367fd5={'count':0x0,'rows':[]};var _0x16df05=_[_0xa6a6('0x30')](db[_0xa6a6('0x31')][_0xa6a6('0x32')],function(_0x1116e5){return{'name':_0x1116e5[_0xa6a6('0x33')],'type':_0x1116e5[_0xa6a6('0x34')][_0xa6a6('0x35')]};});_0x1d1d27[_0xa6a6('0x36')]=_[_0xa6a6('0x30')](_0x16df05,_0xa6a6('0x2d'));_0x1d1d27[_0xa6a6('0x37')]=_[_0xa6a6('0x38')](_0x2aef93['query']);_0x1d1d27[_0xa6a6('0x39')]=_[_0xa6a6('0x3a')](_0x1d1d27[_0xa6a6('0x36')],_0x1d1d27[_0xa6a6('0x37')]);_0x3c9fd2['attributes']=_[_0xa6a6('0x3a')](_0x1d1d27[_0xa6a6('0x36')],qs['fields'](_0x2aef93['query'][_0xa6a6('0x3b')]));_0x3c9fd2[_0xa6a6('0x3c')]=_0x3c9fd2[_0xa6a6('0x3c')][_0xa6a6('0x3d')]?_0x3c9fd2[_0xa6a6('0x3c')]:_0x1d1d27[_0xa6a6('0x36')];if(!_0x2aef93[_0xa6a6('0x37')][_0xa6a6('0x3e')]('nolimit')){_0x3c9fd2['limit']=qs[_0xa6a6('0x20')](_0x2aef93[_0xa6a6('0x37')]['limit']);_0x3c9fd2['offset']=qs['offset'](_0x2aef93[_0xa6a6('0x37')][_0xa6a6('0x1e')]);}_0x3c9fd2[_0xa6a6('0x3f')]=qs[_0xa6a6('0x40')](_0x2aef93[_0xa6a6('0x37')]['sort']);_0x3c9fd2[_0xa6a6('0x41')]=qs['filters'](_[_0xa6a6('0x42')](_0x2aef93[_0xa6a6('0x37')],_0x1d1d27['filters']),_0x16df05);if(_0x2aef93[_0xa6a6('0x37')][_0xa6a6('0x43')]){_0x3c9fd2[_0xa6a6('0x41')]=_['merge'](_0x3c9fd2[_0xa6a6('0x41')],{'$or':_[_0xa6a6('0x30')](_0x16df05,function(_0x273efe){if(_0x273efe[_0xa6a6('0x34')]!=='VIRTUAL'){var _0x639973={};_0x639973[_0x273efe[_0xa6a6('0x2d')]]={'$like':'%'+_0x2aef93[_0xa6a6('0x37')]['filter']+'%'};return _0x639973;}})});}_0x3c9fd2=_[_0xa6a6('0x44')]({},_0x3c9fd2,_0x2aef93[_0xa6a6('0x45')]);var _0x305ed5={'where':_0x3c9fd2[_0xa6a6('0x41')]};return db[_0xa6a6('0x31')][_0xa6a6('0x21')](_0x305ed5)[_0xa6a6('0x27')](function(_0x520535){_0x367fd5[_0xa6a6('0x21')]=_0x520535;if(_0x2aef93[_0xa6a6('0x37')][_0xa6a6('0x46')]){_0x3c9fd2[_0xa6a6('0x47')]=[{'all':!![]}];}return db[_0xa6a6('0x31')][_0xa6a6('0x48')](_0x3c9fd2);})[_0xa6a6('0x27')](function(_0x9e71b0){_0x367fd5[_0xa6a6('0x49')]=_0x9e71b0;return _0x367fd5;})[_0xa6a6('0x27')](respondWithFilteredResult(_0xd570de,_0x3c9fd2))[_0xa6a6('0x4a')](handleError(_0xd570de,null));};exports[_0xa6a6('0x4b')]=function(_0x645716,_0x271ed5){var _0x1b343d={'raw':![],'where':{'id':_0x645716[_0xa6a6('0x4c')]['id']}},_0xf0939={};_0xf0939[_0xa6a6('0x36')]=_[_0xa6a6('0x38')](db[_0xa6a6('0x31')][_0xa6a6('0x32')]);_0xf0939[_0xa6a6('0x37')]=_[_0xa6a6('0x38')](_0x645716[_0xa6a6('0x37')]);_0xf0939[_0xa6a6('0x39')]=_['intersection'](_0xf0939[_0xa6a6('0x36')],_0xf0939[_0xa6a6('0x37')]);_0x1b343d[_0xa6a6('0x3c')]=_[_0xa6a6('0x3a')](_0xf0939['model'],qs[_0xa6a6('0x3b')](_0x645716[_0xa6a6('0x37')][_0xa6a6('0x3b')]));_0x1b343d['attributes']=_0x1b343d[_0xa6a6('0x3c')]['length']?_0x1b343d[_0xa6a6('0x3c')]:_0xf0939[_0xa6a6('0x36')];if(_0x645716[_0xa6a6('0x37')][_0xa6a6('0x46')]){_0x1b343d[_0xa6a6('0x47')]=[{'all':!![]}];}_0x1b343d=_[_0xa6a6('0x44')]({},_0x1b343d,_0x645716[_0xa6a6('0x45')]);return db[_0xa6a6('0x31')]['find'](_0x1b343d)[_0xa6a6('0x27')](handleEntityNotFound(_0x271ed5,null))[_0xa6a6('0x27')](respondWithResult(_0x271ed5,null))[_0xa6a6('0x4a')](handleError(_0x271ed5,null));};exports['create']=function(_0xee1978,_0x3baed8){return db[_0xa6a6('0x31')][_0xa6a6('0x4d')](_0xee1978['body'],{})[_0xa6a6('0x27')](function(_0x130f3d){var _0x1fd7df=_0xee1978[_0xa6a6('0x4e')][_0xa6a6('0x4f')]({'plain':!![]});if(!_0x1fd7df)throw new Error(_0xa6a6('0x50'));if(_0x1fd7df[_0xa6a6('0x51')]===_0xa6a6('0x4e')){var _0x21c2e1=_0x130f3d['get']({'plain':!![]});var _0x34e055='Lists';return db[_0xa6a6('0x52')][_0xa6a6('0x53')]({'where':{'name':_0x34e055,'userProfileId':_0x1fd7df[_0xa6a6('0x54')]},'raw':!![]})['then'](function(_0x1cbaf4){if(_0x1cbaf4&&_0x1cbaf4[_0xa6a6('0x55')]===0x0){return db[_0xa6a6('0x29')][_0xa6a6('0x4d')]({'name':_0x21c2e1['name'],'resourceId':_0x21c2e1['id'],'type':_0x1cbaf4[_0xa6a6('0x2d')],'sectionId':_0x1cbaf4['id']},{})[_0xa6a6('0x27')](function(){return _0x130f3d;});}else{return _0x130f3d;}})[_0xa6a6('0x4a')](function(_0x499db6){logger['error'](_0xa6a6('0x56'),_0x499db6);throw _0x499db6;});}return _0x130f3d;})['then'](respondWithResult(_0x3baed8,0xc9))[_0xa6a6('0x4a')](handleError(_0x3baed8,null));};exports['update']=function(_0x181450,_0x469a15){if(_0x181450[_0xa6a6('0x57')]['id']){delete _0x181450[_0xa6a6('0x57')]['id'];}return db[_0xa6a6('0x31')][_0xa6a6('0x53')]({'where':{'id':_0x181450['params']['id']}})['then'](handleEntityNotFound(_0x469a15,null))['then'](saveUpdates(_0x181450[_0xa6a6('0x57')],null))[_0xa6a6('0x27')](respondWithResult(_0x469a15,null))[_0xa6a6('0x4a')](handleError(_0x469a15,null));};exports[_0xa6a6('0x26')]=function(_0x37962a,_0x2d299b){return db[_0xa6a6('0x31')][_0xa6a6('0x53')]({'where':{'id':_0x37962a['params']['id']}})[_0xa6a6('0x27')](handleEntityNotFound(_0x2d299b,null))['then'](removeEntity(_0x2d299b,null))[_0xa6a6('0x4a')](handleError(_0x2d299b,null));};exports[_0xa6a6('0x58')]=function(_0x477d11,_0x564078){return db[_0xa6a6('0x31')][_0xa6a6('0x58')]()[_0xa6a6('0x27')](respondWithResult(_0x564078,null))[_0xa6a6('0x4a')](handleError(_0x564078,null));};exports['addDisposition']=function(_0x155a90,_0x2cfcb1,_0x4a89e0){if(_0x155a90[_0xa6a6('0x57')]['id']){delete _0x155a90[_0xa6a6('0x57')]['id'];}return db[_0xa6a6('0x31')][_0xa6a6('0x53')]({'where':{'id':_0x155a90[_0xa6a6('0x4c')]['id']}})[_0xa6a6('0x27')](handleEntityNotFound(_0x2cfcb1,null))[_0xa6a6('0x27')](function(_0x19a805){if(_0x19a805){_0x155a90[_0xa6a6('0x57')][_0xa6a6('0x59')]=_0x19a805['id'];return db['Disposition']['create'](_0x155a90[_0xa6a6('0x57')]);}})[_0xa6a6('0x27')](respondWithResult(_0x2cfcb1,null))[_0xa6a6('0x4a')](handleError(_0x2cfcb1,null));};exports['getDispositions']=function(_0x48c00b,_0x1e2d0d,_0x4d961e){var _0xfbf909={'raw':![],'where':{}};var _0x19ee32={};var _0x2e4988={'count':0x0,'rows':[]};return db['CmList'][_0xa6a6('0x5a')]({'where':{'id':_0x48c00b[_0xa6a6('0x4c')]['id']}})[_0xa6a6('0x27')](handleEntityNotFound(_0x1e2d0d,null))[_0xa6a6('0x27')](function(_0x42812b){if(_0x42812b){_0x19ee32['model']=_[_0xa6a6('0x38')](db[_0xa6a6('0x5b')][_0xa6a6('0x32')]);_0x19ee32[_0xa6a6('0x37')]=_['keys'](_0x48c00b[_0xa6a6('0x37')]);_0x19ee32['filters']=_['intersection'](_0x19ee32['model'],_0x19ee32['query']);_0xfbf909[_0xa6a6('0x3c')]=_['intersection'](_0x19ee32[_0xa6a6('0x36')],qs[_0xa6a6('0x3b')](_0x48c00b[_0xa6a6('0x37')][_0xa6a6('0x3b')]));_0xfbf909[_0xa6a6('0x3c')]=_0xfbf909[_0xa6a6('0x3c')][_0xa6a6('0x3d')]?_0xfbf909[_0xa6a6('0x3c')]:_0x19ee32['model'];if(!_0x48c00b[_0xa6a6('0x37')][_0xa6a6('0x3e')](_0xa6a6('0x5c'))){_0xfbf909[_0xa6a6('0x20')]=qs[_0xa6a6('0x20')](_0x48c00b[_0xa6a6('0x37')][_0xa6a6('0x20')]);_0xfbf909[_0xa6a6('0x1e')]=qs[_0xa6a6('0x1e')](_0x48c00b[_0xa6a6('0x37')][_0xa6a6('0x1e')]);}_0xfbf909[_0xa6a6('0x3f')]=qs[_0xa6a6('0x40')](_0x48c00b[_0xa6a6('0x37')]['sort']);_0xfbf909[_0xa6a6('0x41')]=qs['filters'](_['pick'](_0x48c00b[_0xa6a6('0x37')],_0x19ee32['filters']));_0xfbf909[_0xa6a6('0x41')]['ListId']=_0x42812b['id'];if(_0x48c00b[_0xa6a6('0x37')]['filter']){_0xfbf909[_0xa6a6('0x41')]=_[_0xa6a6('0x44')](_0xfbf909['where'],{'$or':_['map'](_0xfbf909[_0xa6a6('0x3c')],function(_0x1383d6){var _0x4a6b04={};_0x4a6b04[_0x1383d6]={'$like':'%'+_0x48c00b[_0xa6a6('0x37')][_0xa6a6('0x43')]+'%'};return _0x4a6b04;})});}_0xfbf909=_[_0xa6a6('0x44')]({},_0xfbf909,_0x48c00b[_0xa6a6('0x45')]);return db[_0xa6a6('0x5b')][_0xa6a6('0x21')]({'where':_0xfbf909[_0xa6a6('0x41')]})['then'](function(_0xae09e){_0x2e4988[_0xa6a6('0x21')]=_0xae09e;if(_0x48c00b[_0xa6a6('0x37')][_0xa6a6('0x46')]){_0xfbf909[_0xa6a6('0x47')]=[{'all':!![]}];}return db[_0xa6a6('0x5b')][_0xa6a6('0x48')](_0xfbf909);})[_0xa6a6('0x27')](function(_0x7a2de){_0x2e4988[_0xa6a6('0x49')]=_0x7a2de;return _0x2e4988;});}})['then'](respondWithFilteredResult(_0x1e2d0d,_0xfbf909))[_0xa6a6('0x4a')](handleError(_0x1e2d0d,null));};exports[_0xa6a6('0x5d')]=function(_0x565280,_0x1bb62d,_0x12bd78){return db[_0xa6a6('0x31')][_0xa6a6('0x53')]({'where':{'id':_0x565280[_0xa6a6('0x4c')]['id']}})[_0xa6a6('0x27')](handleEntityNotFound(_0x1bb62d,null))[_0xa6a6('0x27')](function(_0x1624e3){if(_0x1624e3){return _0x1624e3['removeDispositions'](_0x565280['query'][_0xa6a6('0x5e')]);}})[_0xa6a6('0x27')](respondWithStatusCode(_0x1bb62d,null))[_0xa6a6('0x4a')](handleError(_0x1bb62d,null));};exports[_0xa6a6('0x5f')]=function(_0x11a6fb,_0x3e69b4,_0x346ade){return db[_0xa6a6('0x31')][_0xa6a6('0x53')]({'where':{'id':_0x11a6fb['params']['id']}})[_0xa6a6('0x27')](handleEntityNotFound(_0x3e69b4,null))[_0xa6a6('0x27')](function(_0x266900){if(_0x266900){var _0x4be9d0=[];var _0x5d0da9={'success':[],'errors':[]};return db['CmContact'][_0xa6a6('0x58')]()[_0xa6a6('0x27')](function(_0x878f67){if(_0x11a6fb['body'][_0xa6a6('0x60')]&&_[_0xa6a6('0x61')](_0x11a6fb['body'][_0xa6a6('0x60')])){if(_0x11a6fb[_0xa6a6('0x57')][_0xa6a6('0x60')][_0xa6a6('0x3d')]){_0x11a6fb[_0xa6a6('0x57')][_0xa6a6('0x60')]=_0x11a6fb[_0xa6a6('0x57')][_0xa6a6('0x60')][_0xa6a6('0x62')](';')+';';}else{_0x11a6fb[_0xa6a6('0x57')][_0xa6a6('0x60')]=null;}}else{_0x11a6fb['body'][_0xa6a6('0x60')]=null;}if(_0x11a6fb[_0xa6a6('0x57')]&&_[_0xa6a6('0x61')](_0x11a6fb[_0xa6a6('0x57')])){for(var _0x277f8b=0x0;_0x277f8b<_0x11a6fb[_0xa6a6('0x57')][_0xa6a6('0x3d')];_0x277f8b+=0x1){_0x11a6fb['body'][_0x277f8b]['ListId']=_0x11a6fb[_0xa6a6('0x4c')]['id'];_0x4be9d0[_0xa6a6('0x63')](_0x11a6fb[_0xa6a6('0x57')][_0x277f8b]);}return BPromise[_0xa6a6('0x64')](_0x4be9d0,function(_0x5ec5d9){return db['CmContact'][_0xa6a6('0x4d')](_[_0xa6a6('0x65')](_0x5ec5d9,[_0xa6a6('0x5e'),'id'])||{},{'fields':_[_0xa6a6('0x38')](_0x878f67),'raw':!![]})[_0xa6a6('0x27')](function(_0x236d69){_0x5d0da9[_0xa6a6('0x66')][_0xa6a6('0x63')](_0x236d69[_0xa6a6('0x67')]);})[_0xa6a6('0x4a')](function(_0x430200){_0x5d0da9['errors']['push']({'data':_0x5ec5d9,'error':_0x430200[_0xa6a6('0x68')]});});})[_0xa6a6('0x27')](function(_0x470cd0){return _0x5d0da9;})['catch'](function(_0x34dc79){return _0x34dc79;});}else{_0x3e69b4[_0xa6a6('0x2a')](0x190)[_0xa6a6('0x69')]({'message':_0xa6a6('0x6a')});}});}})[_0xa6a6('0x27')](respondWithResult(_0x3e69b4,null))['catch'](handleError(_0x3e69b4,null));};exports['getContacts']=function(_0x5b0954,_0x4c5597,_0x1b3d12){var _0x3d59df;return db[_0xa6a6('0x31')][_0xa6a6('0x53')]({'where':{'id':_0x5b0954[_0xa6a6('0x4c')]['id']},'include':[{'model':db[_0xa6a6('0x6b')],'as':_0xa6a6('0x6c')}]})[_0xa6a6('0x27')](handleEntityNotFound(_0x4c5597,null))[_0xa6a6('0x27')](function(_0x5b2500){if(_0x5b2500){_0x3d59df=_0x5b2500;return db[_0xa6a6('0x6d')][_0xa6a6('0x32')];}})[_0xa6a6('0x27')](function(_0x3c7f34){if(_0x3c7f34){var _0x29a2de={};var _0x55a09e={};_0x55a09e[_0xa6a6('0x36')]=_['concat'](_[_0xa6a6('0x38')](_0x3c7f34),_[_0xa6a6('0x30')](_0x3d59df[_0xa6a6('0x6c')],function(_0x220d49){return util[_0xa6a6('0x6e')](_0xa6a6('0x6f'),_0x220d49['id']);}));_0x55a09e[_0xa6a6('0x37')]=_[_0xa6a6('0x38')](_0x5b0954['query']);_0x55a09e['filters']=_[_0xa6a6('0x3a')](_0x55a09e[_0xa6a6('0x36')],_0x55a09e[_0xa6a6('0x37')]);_0x29a2de[_0xa6a6('0x3c')]=_['intersection'](_0x55a09e['model'],qs[_0xa6a6('0x3b')](_0x5b0954[_0xa6a6('0x37')]['fields']));_0x29a2de[_0xa6a6('0x3c')]=_0x29a2de[_0xa6a6('0x3c')][_0xa6a6('0x3d')]?_0x29a2de[_0xa6a6('0x3c')]:_0x55a09e[_0xa6a6('0x36')];if(!_0x5b0954['query'][_0xa6a6('0x3e')](_0xa6a6('0x5c'))){_0x29a2de['limit']=qs['limit'](_0x5b0954[_0xa6a6('0x37')][_0xa6a6('0x20')]);_0x29a2de[_0xa6a6('0x1e')]=qs[_0xa6a6('0x1e')](_0x5b0954[_0xa6a6('0x37')][_0xa6a6('0x1e')]);}_0x29a2de[_0xa6a6('0x3f')]=qs[_0xa6a6('0x40')](_0x5b0954[_0xa6a6('0x37')][_0xa6a6('0x40')]);_0x29a2de[_0xa6a6('0x41')]=qs[_0xa6a6('0x39')](_['pick'](_0x5b0954[_0xa6a6('0x37')],_0x55a09e[_0xa6a6('0x39')]));_0x29a2de['raw']=!![];if(_0x5b0954[_0xa6a6('0x37')][_0xa6a6('0x43')]){_0x29a2de[_0xa6a6('0x41')]=_[_0xa6a6('0x44')](_0x29a2de['where'],{'$or':_[_0xa6a6('0x30')](_0x29a2de['attributes'],function(_0x5bd977){var _0x10d41c={};_0x10d41c[_0x5bd977]={'$like':'%'+_0x5b0954['query']['filter']+'%'};return _0x10d41c;})});}_0x29a2de=_[_0xa6a6('0x44')]({},_0x29a2de,_0x5b0954['options']);return _0x3d59df[_0xa6a6('0x70')](_0x29a2de);}})[_0xa6a6('0x27')](respondWithResult(_0x4c5597,null))[_0xa6a6('0x4a')](handleError(_0x4c5597,null));};exports[_0xa6a6('0x71')]=function(_0x234ec0,_0xc05e87,_0xbede98){var _0x24a2a9;return db[_0xa6a6('0x31')]['find']({'where':{'id':_0x234ec0[_0xa6a6('0x4c')]['id']},'include':[{'model':db[_0xa6a6('0x6b')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0xc05e87,null))[_0xa6a6('0x27')](function(_0x238ad0){if(_0x238ad0){_0x24a2a9=_0x238ad0;return db[_0xa6a6('0x6d')]['rawAttributes'];}})[_0xa6a6('0x27')](function(_0x41f13e){if(_0x41f13e){var _0x12ec4b={};var _0x47eda5={};_0x47eda5[_0xa6a6('0x36')]=_[_0xa6a6('0x72')](_[_0xa6a6('0x38')](_0x41f13e),_['map'](_0x24a2a9[_0xa6a6('0x6c')],function(_0x30cea1){return util[_0xa6a6('0x6e')](_0xa6a6('0x6f'),_0x30cea1['id']);}));_0x47eda5[_0xa6a6('0x37')]=_[_0xa6a6('0x38')](_0x234ec0['query']);_0x47eda5[_0xa6a6('0x39')]=_[_0xa6a6('0x3a')](_0x47eda5[_0xa6a6('0x36')],_0x47eda5[_0xa6a6('0x37')]);_0x12ec4b[_0xa6a6('0x3c')]=_['intersection'](_0x47eda5['model'],qs[_0xa6a6('0x3b')](_0x234ec0['query'][_0xa6a6('0x3b')]));_0x12ec4b[_0xa6a6('0x3c')]=_0x12ec4b[_0xa6a6('0x3c')][_0xa6a6('0x3d')]?_0x12ec4b[_0xa6a6('0x3c')]:_0x47eda5[_0xa6a6('0x36')];if(!_0x234ec0['query']['hasOwnProperty'](_0xa6a6('0x5c'))){_0x12ec4b[_0xa6a6('0x20')]=qs['limit'](_0x234ec0['query'][_0xa6a6('0x20')]);_0x12ec4b[_0xa6a6('0x1e')]=qs[_0xa6a6('0x1e')](_0x234ec0[_0xa6a6('0x37')][_0xa6a6('0x1e')]);}_0x12ec4b[_0xa6a6('0x3f')]=qs[_0xa6a6('0x40')](_0x234ec0[_0xa6a6('0x37')][_0xa6a6('0x40')]);_0x12ec4b[_0xa6a6('0x41')]=qs[_0xa6a6('0x39')](_[_0xa6a6('0x42')](_0x234ec0[_0xa6a6('0x37')],_0x47eda5[_0xa6a6('0x39')]));_0x12ec4b[_0xa6a6('0x73')]=!![];if(_0x234ec0['query']['filter']){_0x12ec4b['where']=_['merge'](_0x12ec4b[_0xa6a6('0x41')],{'$or':_[_0xa6a6('0x30')](_0x12ec4b[_0xa6a6('0x3c')],function(_0x5e4fa9){var _0x3db8e0={};_0x3db8e0[_0x5e4fa9]={'$like':'%'+_0x234ec0['query'][_0xa6a6('0x43')]+'%'};return _0x3db8e0;})});}_0x12ec4b=_['merge']({},_0x12ec4b,_0x234ec0['options']);return _0x24a2a9[_0xa6a6('0x70')](_0x12ec4b);}})['then'](function(_0x26ab66){if(!_[_0xa6a6('0x74')](_0x26ab66)){var _0x5540ae=toCsv(_0x26ab66);var _0x163350=Date[_0xa6a6('0x75')]();fs['writeFileSync'](util[_0xa6a6('0x6e')](_0xa6a6('0x76'),_0x24a2a9['id'],_0x163350),_0x5540ae);_0xc05e87[_0xa6a6('0x77')]('Content-disposition',_0xa6a6('0x78')+util['format'](_0xa6a6('0x79'),_0x24a2a9['id'],_0x163350));_0xc05e87['setHeader'](_0xa6a6('0x7a'),_0xa6a6('0x7b'));return _0xc05e87[_0xa6a6('0x7c')](util['format']('/tmp/list_%d_%s.csv',_0x24a2a9['id'],_0x163350));}else{return _0xc05e87[_0xa6a6('0x1c')](0xcc);}})['catch'](handleError(_0xc05e87,null));};exports[_0xa6a6('0x7d')]=function(_0x5f33fa,_0x591f2e,_0x208575){var _0x502462;delete _0x5f33fa[_0xa6a6('0x57')]['id'];return db[_0xa6a6('0x31')]['findOne']({'where':{'id':_0x5f33fa[_0xa6a6('0x4c')]['id']}})[_0xa6a6('0x27')](handleEntityNotFound(_0x591f2e,null))[_0xa6a6('0x27')](function(_0x5a5690){if(_0x5a5690){return db[_0xa6a6('0x7e')][_0xa6a6('0x7f')](function(_0x235598){return db[_0xa6a6('0x6b')][_0xa6a6('0x4d')](_0x5f33fa[_0xa6a6('0x57')],{'transaction':_0x235598})[_0xa6a6('0x27')](function(_0x219d8b){_0x502462=_0x219d8b;return _0x5a5690[_0xa6a6('0x80')](_0x219d8b,{'transaction':_0x235598});})[_0xa6a6('0x27')](function(){var _0x5b16b3={'type':db[_0xa6a6('0x81')][_0xa6a6('0x82')],'transaction':_0x235598};switch(_0x5f33fa[_0xa6a6('0x57')][_0xa6a6('0x34')]){case'text':_0x5b16b3['type']=db[_0xa6a6('0x81')][_0xa6a6('0x82')];break;case _0xa6a6('0x83'):_0x5b16b3[_0xa6a6('0x34')]=db[_0xa6a6('0x81')]['INTEGER'];break;case _0xa6a6('0x84'):_0x5b16b3[_0xa6a6('0x34')]=db[_0xa6a6('0x81')][_0xa6a6('0x85')];_0x5b16b3['defaultValue']=![];break;default:}return db[_0xa6a6('0x7e')][_0xa6a6('0x86')][_0xa6a6('0x87')](_0xa6a6('0x88'),util[_0xa6a6('0x6e')](_0xa6a6('0x89'),_0x502462['id']),_0x5b16b3);})['then'](function(){return _0x502462;});});}})['then'](respondWithResult(_0x591f2e,null))[_0xa6a6('0x4a')](handleError(_0x591f2e,null));};exports['getCustomFields']=function(_0x30d61d,_0x4315e9,_0x3a9298){var _0x2348c5={};var _0x2db50e={};var _0x5290cc;var _0x5c3ae9;return db[_0xa6a6('0x31')]['findOne']({'where':{'id':_0x30d61d[_0xa6a6('0x4c')]['id']}})[_0xa6a6('0x27')](handleEntityNotFound(_0x4315e9,null))['then'](function(_0x543c41){if(_0x543c41){_0x5290cc=_0x543c41;_0x2db50e[_0xa6a6('0x36')]=_[_0xa6a6('0x38')](db[_0xa6a6('0x6b')][_0xa6a6('0x32')]);_0x2db50e[_0xa6a6('0x37')]=_['keys'](_0x30d61d['query']);_0x2db50e[_0xa6a6('0x39')]=_[_0xa6a6('0x3a')](_0x2db50e[_0xa6a6('0x36')],_0x2db50e[_0xa6a6('0x37')]);_0x2348c5[_0xa6a6('0x3c')]=_['intersection'](_0x2db50e[_0xa6a6('0x36')],qs[_0xa6a6('0x3b')](_0x30d61d['query']['fields']));_0x2348c5['attributes']=_0x2348c5[_0xa6a6('0x3c')]['length']?_0x2348c5['attributes']:_0x2db50e['model'];_0x2348c5[_0xa6a6('0x3f')]=qs[_0xa6a6('0x40')](_0x30d61d[_0xa6a6('0x37')][_0xa6a6('0x40')]);_0x2348c5['where']=qs[_0xa6a6('0x39')](_['pick'](_0x30d61d[_0xa6a6('0x37')],_0x2db50e['filters']));_0x2348c5['where']=_[_0xa6a6('0x44')](_0x2348c5[_0xa6a6('0x41')],{'$or':[{'ListId':_0x543c41['id']},{'ListId':null}]});if(_0x30d61d[_0xa6a6('0x37')][_0xa6a6('0x43')]){_0x2348c5[_0xa6a6('0x41')]=_[_0xa6a6('0x44')](_0x2348c5[_0xa6a6('0x41')],{'$or':_['map'](_0x2348c5[_0xa6a6('0x3c')],function(_0x11f862){var _0x3f3439={};_0x3f3439[_0x11f862]={'$like':'%'+_0x30d61d['query'][_0xa6a6('0x43')]+'%'};return _0x3f3439;})});}_0x2348c5=_[_0xa6a6('0x44')]({},_0x2348c5,_0x30d61d[_0xa6a6('0x45')]);return db['CmCustomField']['findAndCountAll'](_0x2348c5);}})[_0xa6a6('0x27')](respondWithResult(_0x4315e9,null))[_0xa6a6('0x4a')](handleError(_0x4315e9,null));};exports[_0xa6a6('0x8a')]=function(_0x49b873,_0x12e930,_0x548763){return db[_0xa6a6('0x31')][_0xa6a6('0x53')]({'where':{'id':_0x49b873[_0xa6a6('0x4c')]['id']}})[_0xa6a6('0x27')](handleEntityNotFound(_0x12e930,null))[_0xa6a6('0x27')](function(_0x5d3143){if(_0x5d3143){return _0x5d3143['addAgents'](_0x49b873[_0xa6a6('0x57')][_0xa6a6('0x5e')],_['omit'](_0x49b873['body'],[_0xa6a6('0x5e'),'id'])||{})['spread'](function(_0x1ccc53){for(var _0x155a9c=0x0;_0x155a9c<_0x49b873['body'][_0xa6a6('0x5e')]['length'];_0x155a9c+=0x1){socket[_0xa6a6('0x8b')]('userCmList:save',{'UserId':Number(_0x49b873[_0xa6a6('0x57')][_0xa6a6('0x5e')][_0x155a9c]),'CmListId':Number(_0x49b873[_0xa6a6('0x4c')]['id'])});}return _0x1ccc53;});}})[_0xa6a6('0x27')](respondWithResult(_0x12e930,null))['catch'](handleError(_0x12e930,null));};exports[_0xa6a6('0x8c')]=function(_0x326563,_0xeecb5e,_0x5ef218){return db[_0xa6a6('0x31')][_0xa6a6('0x53')]({'where':{'id':_0x326563['params']['id']}})['then'](handleEntityNotFound(_0xeecb5e,null))[_0xa6a6('0x27')](function(_0x3d14e7){if(_0x3d14e7){return _0x3d14e7[_0xa6a6('0x8c')](_0x326563['query'][_0xa6a6('0x5e')])[_0xa6a6('0x27')](function(){if(_['isArray'](_0x326563[_0xa6a6('0x37')][_0xa6a6('0x5e')])){for(var _0xbc8ff3=0x0;_0xbc8ff3<_0x326563[_0xa6a6('0x37')]['ids'][_0xa6a6('0x3d')];_0xbc8ff3+=0x1){socket[_0xa6a6('0x8b')]('userCmList:remove',{'UserId':Number(_0x326563['query']['ids'][_0xbc8ff3]),'CmListId':Number(_0x326563['params']['id'])});}}else{socket['emit'](_0xa6a6('0x8d'),{'UserId':Number(_0x326563['query']['ids']),'CmListId':Number(_0x326563[_0xa6a6('0x4c')]['id'])});}});}})[_0xa6a6('0x27')](respondWithStatusCode(_0xeecb5e,null))['catch'](handleError(_0xeecb5e,null));};exports[_0xa6a6('0x8e')]=function(_0x2d04c1,_0x454b75,_0x1fbae8){var _0xa36052={};var _0x139e10={};var _0x44ab9d;var _0x4b5b0d;return db[_0xa6a6('0x31')][_0xa6a6('0x5a')]({'where':{'id':_0x2d04c1[_0xa6a6('0x4c')]['id']}})[_0xa6a6('0x27')](handleEntityNotFound(_0x454b75,null))['then'](function(_0x39464a){if(_0x39464a){_0x44ab9d=_0x39464a;_0x139e10['model']=_['keys'](db[_0xa6a6('0x8f')][_0xa6a6('0x32')]);_0x139e10[_0xa6a6('0x37')]=_[_0xa6a6('0x38')](_0x2d04c1['query']);_0x139e10[_0xa6a6('0x39')]=_[_0xa6a6('0x3a')](_0x139e10[_0xa6a6('0x36')],_0x139e10['query']);_0xa36052[_0xa6a6('0x3c')]=_[_0xa6a6('0x3a')](_0x139e10[_0xa6a6('0x36')],qs[_0xa6a6('0x3b')](_0x2d04c1[_0xa6a6('0x37')]['fields']));_0xa36052[_0xa6a6('0x3c')]=_0xa36052[_0xa6a6('0x3c')][_0xa6a6('0x3d')]?_0xa36052[_0xa6a6('0x3c')]:_0x139e10[_0xa6a6('0x36')];_0xa36052[_0xa6a6('0x3f')]=qs['sort'](_0x2d04c1[_0xa6a6('0x37')][_0xa6a6('0x40')]);_0xa36052[_0xa6a6('0x41')]=qs['filters'](_['pick'](_0x2d04c1[_0xa6a6('0x37')],_0x139e10[_0xa6a6('0x39')]));if(_0x2d04c1[_0xa6a6('0x37')]['filter']){_0xa36052[_0xa6a6('0x41')]=_['merge'](_0xa36052['where'],{'$or':_[_0xa6a6('0x30')](_0xa36052[_0xa6a6('0x3c')],function(_0x12e007){var _0x15e624={};_0x15e624[_0x12e007]={'$like':'%'+_0x2d04c1[_0xa6a6('0x37')][_0xa6a6('0x43')]+'%'};return _0x15e624;})});}_0xa36052=_[_0xa6a6('0x44')]({},_0xa36052,_0x2d04c1[_0xa6a6('0x45')]);return _0x44ab9d[_0xa6a6('0x8e')](_0xa36052);}})[_0xa6a6('0x27')](function(_0x965235){if(_0x965235){_0x4b5b0d=_0x965235['length'];if(!_0x2d04c1[_0xa6a6('0x37')][_0xa6a6('0x3e')](_0xa6a6('0x5c'))){_0xa36052['limit']=qs[_0xa6a6('0x20')](_0x2d04c1[_0xa6a6('0x37')][_0xa6a6('0x20')]);_0xa36052[_0xa6a6('0x1e')]=qs[_0xa6a6('0x1e')](_0x2d04c1[_0xa6a6('0x37')][_0xa6a6('0x1e')]);}return _0x44ab9d['getAgents'](_0xa36052);}})[_0xa6a6('0x27')](function(_0x2a3211){if(_0x2a3211){return _0x2a3211?{'count':_0x4b5b0d,'rows':_0x2a3211}:null;}})['then'](respondWithResult(_0x454b75,null))[_0xa6a6('0x4a')](handleError(_0x454b75,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 5a1eb1c..5005ad2 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x15dbca,_0x1d7c3c){var _0x326533=function(_0x507ee2){while(--_0x507ee2){_0x15dbca['push'](_0x15dbca['shift']());}};_0x326533(++_0x1d7c3c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x204ad4,_0x502841){_0x204ad4=_0x204ad4-0x0;var _0x50675f=_0x5fc3[_0x204ad4];return _0x50675f;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0xdd1686,_0x191250){_0xdd1686=_0xdd1686-0x0;var _0x53386c=_0x326f[_0xdd1686];return _0x53386c;};'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 diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 20337fd..41d9040 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 _0x22fb=['define','CmList','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x7fe2ec,_0x3d72e2){var _0x52d656=function(_0x2033c7){while(--_0x2033c7){_0x7fe2ec['push'](_0x7fe2ec['shift']());}};_0x52d656(++_0x3d72e2);}(_0x22fb,0x192));var _0xb22f=function(_0x10741f,_0x3da3f3){_0x10741f=_0x10741f-0x0;var _0x42385f=_0x22fb[_0x10741f];return _0x42385f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22f('0x0'))('api');var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rp=require(_0xb22f('0x3'));var fs=require('fs');var path=require(_0xb22f('0x4'));var rimraf=require(_0xb22f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb22f('0x6'));module[_0xb22f('0x7')]=function(_0x2d1fb3,_0xc3ffcc){return _0x2d1fb3[_0xb22f('0x8')](_0xb22f('0x9'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5b5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash'];(function(_0x4d43f0,_0x3006f2){var _0x58ef91=function(_0x44a7f1){while(--_0x44a7f1){_0x4d43f0['push'](_0x4d43f0['shift']());}};_0x58ef91(++_0x3006f2);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x3877c1,_0x238c29){_0x3877c1=_0x3877c1-0x0;var _0x59056a=_0xe5b5[_0x3877c1];return _0x59056a;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var logger=require(_0x5e5b('0x2'))(_0x5e5b('0x3'));var moment=require(_0x5e5b('0x4'));var BPromise=require(_0x5e5b('0x5'));var rp=require(_0x5e5b('0x6'));var fs=require('fs');var path=require(_0x5e5b('0x7'));var rimraf=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var attributes=require(_0x5e5b('0xa'));module[_0x5e5b('0xb')]=function(_0xf1fbe2,_0x11e0e0){return _0xf1fbe2[_0x5e5b('0xc')](_0x5e5b('0xd'),attributes,{'tableName':_0x5e5b('0xe'),'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 e69548d..f0ecf64 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 _0x3bf9=['localhost','socket.io-emitter','./cmList.socket','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x4c1f35,_0x4f76cc){var _0x2f612a=function(_0x55f664){while(--_0x55f664){_0x4c1f35['push'](_0x4c1f35['shift']());}};_0x2f612a(++_0x4f76cc);}(_0x3bf9,0x112));var _0x93bf=function(_0x3bf1e0,_0x1580be){_0x3bf1e0=_0x3bf1e0-0x0;var _0x5a9ded=_0x3bf9[_0x3bf1e0];return _0x5a9ded;};'use strict';var _=require(_0x93bf('0x0'));var util=require(_0x93bf('0x1'));var moment=require(_0x93bf('0x2'));var BPromise=require(_0x93bf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93bf('0x4'))['db'];var utils=require(_0x93bf('0x5'));var logger=require('../../config/logger')(_0x93bf('0x6'));var config=require(_0x93bf('0x7'));var jayson=require(_0x93bf('0x8'));var client=jayson[_0x93bf('0x9')][_0x93bf('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x93bf('0xb')],{'host':_0x93bf('0xc'),'port':0x18eb});var socket=require(_0x93bf('0xd'))(new Redis(config[_0x93bf('0xb')]));require(_0x93bf('0xe'))['register'](socket);function respondWithRpcPromise(_0x232a12,_0x2c2f2e,_0x32d287){return new BPromise(function(_0x348c49,_0x144bee){return client[_0x93bf('0xf')](_0x232a12,_0x32d287)['then'](function(_0x9620d7){logger[_0x93bf('0x10')](_0x93bf('0x11'),_0x2c2f2e,_0x93bf('0x12'));logger[_0x93bf('0x13')](_0x93bf('0x14'),_0x2c2f2e,_0x93bf('0x12'),JSON[_0x93bf('0x15')](_0x9620d7));if(_0x9620d7[_0x93bf('0x16')]){if(_0x9620d7[_0x93bf('0x16')][_0x93bf('0x17')]===0x1f4){logger[_0x93bf('0x16')]('CmList,\x20%s,\x20%s',_0x2c2f2e,_0x9620d7[_0x93bf('0x16')]['message']);return _0x144bee(_0x9620d7['error'][_0x93bf('0x18')]);}logger[_0x93bf('0x16')](_0x93bf('0x11'),_0x2c2f2e,_0x9620d7[_0x93bf('0x16')][_0x93bf('0x18')]);return _0x348c49(_0x9620d7[_0x93bf('0x16')][_0x93bf('0x18')]);}else{logger[_0x93bf('0x10')](_0x93bf('0x11'),_0x2c2f2e,'request\x20sent');_0x348c49(_0x9620d7[_0x93bf('0x19')][_0x93bf('0x18')]);}})['catch'](function(_0x35850d){logger['error'](_0x93bf('0x11'),_0x2c2f2e,_0x35850d);_0x144bee(_0x35850d);});});} \ No newline at end of file +var _0x9889=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x248671,_0x3fd131){var _0x6b64f2=function(_0x2f43bf){while(--_0x2f43bf){_0x248671['push'](_0x248671['shift']());}};_0x6b64f2(++_0x3fd131);}(_0x9889,0x12e));var _0x9988=function(_0x1e6524,_0x3c0853){_0x1e6524=_0x1e6524-0x0;var _0x582f02=_0x9889[_0x1e6524];return _0x582f02;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9988('0x0'));var BPromise=require(_0x9988('0x1'));var rs=require(_0x9988('0x2'));var fs=require('fs');var Redis=require(_0x9988('0x3'));var db=require(_0x9988('0x4'))['db'];var utils=require(_0x9988('0x5'));var logger=require(_0x9988('0x6'))(_0x9988('0x7'));var config=require(_0x9988('0x8'));var jayson=require(_0x9988('0x9'));var client=jayson[_0x9988('0xa')]['http']({'port':0x232a});config[_0x9988('0xb')]=_['defaults'](config[_0x9988('0xb')],{'host':_0x9988('0xc'),'port':0x18eb});var socket=require(_0x9988('0xd'))(new Redis(config[_0x9988('0xb')]));require(_0x9988('0xe'))['register'](socket);function respondWithRpcPromise(_0x2e50b5,_0x544dab,_0x469161){return new BPromise(function(_0x2afa1e,_0x4309ea){return client[_0x9988('0xf')](_0x2e50b5,_0x469161)[_0x9988('0x10')](function(_0x3ca629){logger[_0x9988('0x11')](_0x9988('0x12'),_0x544dab,'request\x20sent');logger[_0x9988('0x13')](_0x9988('0x14'),_0x544dab,_0x9988('0x15'),JSON[_0x9988('0x16')](_0x3ca629));if(_0x3ca629[_0x9988('0x17')]){if(_0x3ca629[_0x9988('0x17')][_0x9988('0x18')]===0x1f4){logger['error'](_0x9988('0x12'),_0x544dab,_0x3ca629[_0x9988('0x17')][_0x9988('0x19')]);return _0x4309ea(_0x3ca629['error'][_0x9988('0x19')]);}logger['error'](_0x9988('0x12'),_0x544dab,_0x3ca629[_0x9988('0x17')][_0x9988('0x19')]);return _0x2afa1e(_0x3ca629[_0x9988('0x17')][_0x9988('0x19')]);}else{logger[_0x9988('0x11')](_0x9988('0x12'),_0x544dab,_0x9988('0x15'));_0x2afa1e(_0x3ca629['result']['message']);}})[_0x9988('0x1a')](function(_0x4eb2c1){logger[_0x9988('0x17')]('CmList,\x20%s,\x20%s',_0x544dab,_0x4eb2c1);_0x4309ea(_0x4eb2c1);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index b97efa4..31b1c37 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 _0xf9eb=['removeListener','length','cmList:','save','update','emit'];(function(_0x1ef44f,_0x51cc09){var _0x57c070=function(_0x41393c){while(--_0x41393c){_0x1ef44f['push'](_0x1ef44f['shift']());}};_0x57c070(++_0x51cc09);}(_0xf9eb,0x1b3));var _0xbf9e=function(_0x2ccb52,_0xc3664c){_0x2ccb52=_0x2ccb52-0x0;var _0x505033=_0xf9eb[_0x2ccb52];return _0x505033;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xbf9e('0x0'),'remove',_0xbf9e('0x1')];function createListener(_0x407631,_0x5c666){return function(_0x419d52){_0x5c666[_0xbf9e('0x2')](_0x407631,_0x419d52);};}function removeListener(_0x4c2e2c,_0x1cae9a){return function(){CmListEvents[_0xbf9e('0x3')](_0x4c2e2c,_0x1cae9a);};}exports['register']=function(_0x19fd99){for(var _0x3a18a5=0x0,_0x51dedb=events[_0xbf9e('0x4')];_0x3a18a5<_0x51dedb;_0x3a18a5++){var _0x37524a=events[_0x3a18a5];var _0x4ee6cc=createListener(_0xbf9e('0x5')+_0x37524a,_0x19fd99);CmListEvents['on'](_0x37524a,_0x4ee6cc);}}; \ No newline at end of file +var _0x4bc6=['length','cmList:','./cmList.events','save','emit','removeListener','register'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x4bc6,0x6b));var _0x64bc=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x4bc6[_0x599f41];return _0x2e4d58;};'use strict';var CmListEvents=require(_0x64bc('0x0'));var events=[_0x64bc('0x1'),'remove','update'];function createListener(_0x5ac767,_0x269fa1){return function(_0x232c5f){_0x269fa1[_0x64bc('0x2')](_0x5ac767,_0x232c5f);};}function removeListener(_0x435888,_0x46c916){return function(){CmListEvents[_0x64bc('0x3')](_0x435888,_0x46c916);};}exports[_0x64bc('0x4')]=function(_0x470756){for(var _0x18a92d=0x0,_0x34823b=events[_0x64bc('0x5')];_0x18a92d<_0x34823b;_0x18a92d++){var _0x43e8d9=events[_0x18a92d];var _0x87f3a1=createListener(_0x64bc('0x6')+_0x43e8d9,_0x470756);CmListEvents['on'](_0x43e8d9,_0x87f3a1);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 6a7351d..f61769e 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 _0xc440=['/:id/users','getAgents','post','create','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields'];(function(_0x1af98d,_0x3c608e){var _0x3553ea=function(_0x5668a4){while(--_0x5668a4){_0x1af98d['push'](_0x1af98d['shift']());}};_0x3553ea(++_0x3c608e);}(_0xc440,0x104));var _0x0c44=function(_0x1f49c2,_0xeb4570){_0x1f49c2=_0x1f49c2-0x0;var _0x11bb4d=_0xc440[_0x1f49c2];return _0x11bb4d;};'use strict';var multer=require('multer');var util=require(_0x0c44('0x0'));var path=require(_0x0c44('0x1'));var timeout=require(_0x0c44('0x2'));var express=require(_0x0c44('0x3'));var router=express[_0x0c44('0x4')]();var fs_extra=require(_0x0c44('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0c44('0x6'));var controller=require(_0x0c44('0x7'));router[_0x0c44('0x8')]('/',auth[_0x0c44('0x9')](),controller['index']);router[_0x0c44('0x8')](_0x0c44('0xa'),auth[_0x0c44('0x9')](),controller[_0x0c44('0xb')]);router[_0x0c44('0x8')](_0x0c44('0xc'),auth[_0x0c44('0x9')](),controller[_0x0c44('0xd')]);router[_0x0c44('0x8')](_0x0c44('0xe'),auth[_0x0c44('0x9')](),controller['getDispositions']);router[_0x0c44('0x8')](_0x0c44('0xf'),auth[_0x0c44('0x9')](),controller[_0x0c44('0x10')]);router['get'](_0x0c44('0x11'),auth[_0x0c44('0x9')](),controller[_0x0c44('0x12')]);router[_0x0c44('0x8')]('/:id/fields',auth[_0x0c44('0x9')](),controller[_0x0c44('0x13')]);router[_0x0c44('0x8')](_0x0c44('0x14'),auth[_0x0c44('0x9')](),controller[_0x0c44('0x15')]);router[_0x0c44('0x16')]('/',auth[_0x0c44('0x9')](),controller[_0x0c44('0x17')]);router[_0x0c44('0x16')](_0x0c44('0xe'),auth[_0x0c44('0x9')](),controller[_0x0c44('0x18')]);router[_0x0c44('0x16')](_0x0c44('0xf'),auth[_0x0c44('0x9')](),controller[_0x0c44('0x19')]);router[_0x0c44('0x16')](_0x0c44('0x1a'),auth[_0x0c44('0x9')](),controller[_0x0c44('0x1b')]);router[_0x0c44('0x16')](_0x0c44('0x14'),auth[_0x0c44('0x9')](),controller[_0x0c44('0x1c')]);router['put'](_0x0c44('0xc'),auth[_0x0c44('0x9')](),controller[_0x0c44('0x1d')]);router[_0x0c44('0x1e')](_0x0c44('0xc'),auth['isAuthenticated'](),controller[_0x0c44('0x1f')]);router['delete'](_0x0c44('0xe'),auth[_0x0c44('0x9')](),controller[_0x0c44('0x20')]);router['delete'](_0x0c44('0x14'),auth[_0x0c44('0x9')](),controller[_0x0c44('0x21')]);module[_0x0c44('0x22')]=router; \ No newline at end of file +var _0x2fed=['express','fs-extra','../../components/auth/service','./cmList.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','create','addDisposition','post','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout'];(function(_0x388651,_0x133645){var _0x3d0917=function(_0x5ecbcd){while(--_0x5ecbcd){_0x388651['push'](_0x388651['shift']());}};_0x3d0917(++_0x133645);}(_0x2fed,0x7c));var _0xd2fe=function(_0x5f1074,_0x181b3f){_0x5f1074=_0x5f1074-0x0;var _0x21a009=_0x2fed[_0x5f1074];return _0x21a009;};'use strict';var multer=require(_0xd2fe('0x0'));var util=require(_0xd2fe('0x1'));var path=require(_0xd2fe('0x2'));var timeout=require(_0xd2fe('0x3'));var express=require(_0xd2fe('0x4'));var router=express['Router']();var fs_extra=require(_0xd2fe('0x5'));var auth=require(_0xd2fe('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2fe('0x7'));router[_0xd2fe('0x8')]('/',auth[_0xd2fe('0x9')](),controller['index']);router[_0xd2fe('0x8')](_0xd2fe('0xa'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0xb')]);router['get'](_0xd2fe('0xc'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0xd')]);router[_0xd2fe('0x8')](_0xd2fe('0xe'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0xf')]);router[_0xd2fe('0x8')](_0xd2fe('0x10'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x11')]);router[_0xd2fe('0x8')](_0xd2fe('0x12'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x13')]);router[_0xd2fe('0x8')](_0xd2fe('0x14'),auth[_0xd2fe('0x9')](),controller['getCustomFields']);router[_0xd2fe('0x8')](_0xd2fe('0x15'),auth[_0xd2fe('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xd2fe('0x16')]);router['post'](_0xd2fe('0xe'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x17')]);router[_0xd2fe('0x18')](_0xd2fe('0x10'),auth[_0xd2fe('0x9')](),controller['addContacts']);router['post'](_0xd2fe('0x14'),auth[_0xd2fe('0x9')](),controller['addCustomField']);router[_0xd2fe('0x18')](_0xd2fe('0x15'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x19')]);router[_0xd2fe('0x1a')](_0xd2fe('0xc'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x1b')]);router[_0xd2fe('0x1c')](_0xd2fe('0xc'),auth['isAuthenticated'](),controller[_0xd2fe('0x1d')]);router['delete'](_0xd2fe('0xe'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x1e')]);router[_0xd2fe('0x1c')]('/:id/users',auth[_0xd2fe('0x9')](),controller['removeAgents']);module[_0xd2fe('0x1f')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index fdaf211..eae7228 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 _0x0858=['STRING','sequelize','exports','getDataValue','field'];(function(_0xa91c44,_0x2906a8){var _0x23d63c=function(_0x976d7){while(--_0x976d7){_0xa91c44['push'](_0xa91c44['shift']());}};_0x23d63c(++_0x2906a8);}(_0x0858,0x150));var _0x8085=function(_0x364add,_0xf47b65){_0x364add=_0x364add-0x0;var _0x5c9d55=_0x0858[_0x364add];return _0x5c9d55;};'use strict';var Sequelize=require(_0x8085('0x0'));module[_0x8085('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5201ee){return this[_0x8085('0x2')](_0x8085('0x3'));}},'field':{'type':Sequelize[_0x8085('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xd05f=['STRING','sequelize','exports','getDataValue','field'];(function(_0x15e447,_0xe7088f){var _0x4159dc=function(_0x3e7b2a){while(--_0x3e7b2a){_0x15e447['push'](_0x15e447['shift']());}};_0x4159dc(++_0xe7088f);}(_0xd05f,0x1eb));var _0xfd05=function(_0x552d03,_0x25b50c){_0x552d03=_0x552d03-0x0;var _0x421682=_0xd05f[_0x552d03];return _0x421682;};'use strict';var Sequelize=require(_0xfd05('0x0'));module[_0xfd05('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1b60d9){return this[_0xfd05('0x2')](_0xfd05('0x3'));}},'field':{'type':Sequelize[_0xfd05('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xfd05('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xfd05('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 084865d..af5e33c 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 _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(_0x3d820e,_0x5d557e){var _0x2a3333=function(_0x36681e){while(--_0x36681e){_0x3d820e['push'](_0x3d820e['shift']());}};_0x2a3333(++_0x5d557e);}(_0x7a54,0x106));var _0x47a5=function(_0x3dab10,_0x5c6177){_0x3dab10=_0x3dab10-0x0;var _0x83ebc8=_0x7a54[_0x3dab10];return _0x83ebc8;};'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 +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(_0x4fa5db,_0x3933b8){var _0x3ab280=function(_0x23feca){while(--_0x23feca){_0x4fa5db['push'](_0x4fa5db['shift']());}};_0x3ab280(++_0x3933b8);}(_0x7a54,0x106));var _0x47a5=function(_0x15cbf7,_0x527dcd){_0x15cbf7=_0x15cbf7-0x0;var _0x2489b7=_0x7a54[_0x15cbf7];return _0x2489b7;};'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 a8f25cf..327a6ff 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 _0xa49b=['rimraf','../../config/environment','exports','define','Condition','lodash','util','moment','request-promise','path'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xa49b,0x18b));var _0xba49=function(_0x4c1f56,_0x2b376b){_0x4c1f56=_0x4c1f56-0x0;var _0x1be32c=_0xa49b[_0x4c1f56];return _0x1be32c;};'use strict';var _=require(_0xba49('0x0'));var util=require(_0xba49('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xba49('0x2'));var BPromise=require('bluebird');var rp=require(_0xba49('0x3'));var fs=require('fs');var path=require(_0xba49('0x4'));var rimraf=require(_0xba49('0x5'));var config=require(_0xba49('0x6'));var attributes=require('./condition.attributes');module[_0xba49('0x7')]=function(_0x128497,_0x5af337){return _0x128497[_0xba49('0x8')](_0xba49('0x9'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1552=['tools_conditions','util','../../config/logger','api','moment','bluebird','request-promise','./condition.attributes','exports','define','Condition'];(function(_0x5bf000,_0x1e2eef){var _0x5281f3=function(_0x2a095c){while(--_0x2a095c){_0x5bf000['push'](_0x5bf000['shift']());}};_0x5281f3(++_0x1e2eef);}(_0x1552,0x9b));var _0x2155=function(_0x4ed37d,_0x1a84c9){_0x4ed37d=_0x4ed37d-0x0;var _0x4fb2c5=_0x1552[_0x4ed37d];return _0x4fb2c5;};'use strict';var _=require('lodash');var util=require(_0x2155('0x0'));var logger=require(_0x2155('0x1'))(_0x2155('0x2'));var moment=require(_0x2155('0x3'));var BPromise=require(_0x2155('0x4'));var rp=require(_0x2155('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2155('0x6'));module[_0x2155('0x7')]=function(_0x3e6f06,_0x4a3866){return _0x3e6f06[_0x2155('0x8')](_0x2155('0x9'),attributes,{'tableName':_0x2155('0xa'),'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 2495489..a374099 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 _0x6cf4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','randomstring'];(function(_0xbba9bd,_0x18145c){var _0x550337=function(_0x2f4c62){while(--_0x2f4c62){_0xbba9bd['push'](_0xbba9bd['shift']());}};_0x550337(++_0x18145c);}(_0x6cf4,0x1e0));var _0x46cf=function(_0x1ca9eb,_0x99a10b){_0x1ca9eb=_0x1ca9eb-0x0;var _0x2e284e=_0x6cf4[_0x1ca9eb];return _0x2e284e;};'use strict';var _=require('lodash');var util=require(_0x46cf('0x0'));var moment=require(_0x46cf('0x1'));var BPromise=require('bluebird');var rs=require(_0x46cf('0x2'));var fs=require('fs');var Redis=require(_0x46cf('0x3'));var db=require(_0x46cf('0x4'))['db'];var utils=require(_0x46cf('0x5'));var logger=require(_0x46cf('0x6'))(_0x46cf('0x7'));var config=require(_0x46cf('0x8'));var jayson=require(_0x46cf('0x9'));var client=jayson[_0x46cf('0xa')][_0x46cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdc859c,_0x3ecbdd,_0x361860){return new BPromise(function(_0x3f11a2,_0x9e057f){return client[_0x46cf('0xc')](_0xdc859c,_0x361860)[_0x46cf('0xd')](function(_0x1341dc){logger['info'](_0x46cf('0xe'),_0x3ecbdd,_0x46cf('0xf'));logger['debug'](_0x46cf('0x10'),_0x3ecbdd,'request\x20sent',JSON[_0x46cf('0x11')](_0x1341dc));if(_0x1341dc[_0x46cf('0x12')]){if(_0x1341dc[_0x46cf('0x12')][_0x46cf('0x13')]===0x1f4){logger['error'](_0x46cf('0xe'),_0x3ecbdd,_0x1341dc[_0x46cf('0x12')][_0x46cf('0x14')]);return _0x9e057f(_0x1341dc[_0x46cf('0x12')][_0x46cf('0x14')]);}logger['error']('Condition,\x20%s,\x20%s',_0x3ecbdd,_0x1341dc[_0x46cf('0x12')]['message']);return _0x3f11a2(_0x1341dc[_0x46cf('0x12')][_0x46cf('0x14')]);}else{logger[_0x46cf('0x15')]('Condition,\x20%s,\x20%s',_0x3ecbdd,_0x46cf('0xf'));_0x3f11a2(_0x1341dc['result']['message']);}})[_0x46cf('0x16')](function(_0x464ea7){logger[_0x46cf('0x12')]('Condition,\x20%s,\x20%s',_0x3ecbdd,_0x464ea7);_0x9e057f(_0x464ea7);});});} \ No newline at end of file +var _0x003e=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','then','info','request\x20sent','debug','error','Condition,\x20%s,\x20%s','message','result'];(function(_0x261e60,_0x99a834){var _0x49c9fe=function(_0x5df10d){while(--_0x5df10d){_0x261e60['push'](_0x261e60['shift']());}};_0x49c9fe(++_0x99a834);}(_0x003e,0x157));var _0xe003=function(_0x14477e,_0x44d4da){_0x14477e=_0x14477e-0x0;var _0x5d4a05=_0x003e[_0x14477e];return _0x5d4a05;};'use strict';var _=require(_0xe003('0x0'));var util=require(_0xe003('0x1'));var moment=require(_0xe003('0x2'));var BPromise=require(_0xe003('0x3'));var rs=require(_0xe003('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe003('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe003('0x6'));var config=require('../../config/environment');var jayson=require(_0xe003('0x7'));var client=jayson[_0xe003('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cc40b,_0x1084d4,_0x224dfb){return new BPromise(function(_0x487a03,_0x3e6479){return client['request'](_0x4cc40b,_0x224dfb)[_0xe003('0x9')](function(_0x40eb19){logger[_0xe003('0xa')]('Condition,\x20%s,\x20%s',_0x1084d4,_0xe003('0xb'));logger[_0xe003('0xc')]('Condition,\x20%s,\x20%s,\x20%s',_0x1084d4,_0xe003('0xb'),JSON['stringify'](_0x40eb19));if(_0x40eb19['error']){if(_0x40eb19[_0xe003('0xd')]['code']===0x1f4){logger[_0xe003('0xd')](_0xe003('0xe'),_0x1084d4,_0x40eb19[_0xe003('0xd')][_0xe003('0xf')]);return _0x3e6479(_0x40eb19['error'][_0xe003('0xf')]);}logger[_0xe003('0xd')](_0xe003('0xe'),_0x1084d4,_0x40eb19[_0xe003('0xd')]['message']);return _0x487a03(_0x40eb19['error'][_0xe003('0xf')]);}else{logger[_0xe003('0xa')]('Condition,\x20%s,\x20%s',_0x1084d4,_0xe003('0xb'));_0x487a03(_0x40eb19[_0xe003('0x10')][_0xe003('0xf')]);}})[_0xe003('0x11')](function(_0x37fa14){logger[_0xe003('0xd')](_0xe003('0xe'),_0x1084d4,_0x37fa14);_0x3e6479(_0x37fa14);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index c9d748d..f26e4c7 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 _0x1236=['delete','/:id','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','isAuthenticated','update'];(function(_0xed45fc,_0x472179){var _0x30c449=function(_0x23244a){while(--_0x23244a){_0xed45fc['push'](_0xed45fc['shift']());}};_0x30c449(++_0x472179);}(_0x1236,0xab));var _0x6123=function(_0x3555c4,_0x21d437){_0x3555c4=_0x3555c4-0x0;var _0x19f680=_0x1236[_0x3555c4];return _0x19f680;};'use strict';var multer=require(_0x6123('0x0'));var util=require(_0x6123('0x1'));var path=require(_0x6123('0x2'));var timeout=require(_0x6123('0x3'));var express=require(_0x6123('0x4'));var router=express['Router']();var fs_extra=require(_0x6123('0x5'));var auth=require(_0x6123('0x6'));var interaction=require(_0x6123('0x7'));var config=require('../../config/environment');var controller=require(_0x6123('0x8'));router['put']('/:id',auth[_0x6123('0x9')](),controller[_0x6123('0xa')]);router[_0x6123('0xb')](_0x6123('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x6123('0xd')]=router; \ No newline at end of file +var _0x4128=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./condition.controller','put','isAuthenticated','/:id','destroy'];(function(_0x12ad1b,_0x106d01){var _0x22efbb=function(_0x468f70){while(--_0x468f70){_0x12ad1b['push'](_0x12ad1b['shift']());}};_0x22efbb(++_0x106d01);}(_0x4128,0x1a5));var _0x8412=function(_0x5d361e,_0xfdb41a){_0x5d361e=_0x5d361e-0x0;var _0x2c9292=_0x4128[_0x5d361e];return _0x2c9292;};'use strict';var multer=require(_0x8412('0x0'));var util=require(_0x8412('0x1'));var path=require(_0x8412('0x2'));var timeout=require(_0x8412('0x3'));var express=require(_0x8412('0x4'));var router=express[_0x8412('0x5')]();var fs_extra=require(_0x8412('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8412('0x7'));var config=require('../../config/environment');var controller=require(_0x8412('0x8'));router[_0x8412('0x9')]('/:id',auth[_0x8412('0xa')](),controller['update']);router['delete'](_0x8412('0xb'),auth[_0x8412('0xa')](),controller[_0x8412('0xc')]);module[_0x8412('0xd')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index f9c6f21..095f356 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 _0xbaf0=['name','exports','STRING'];(function(_0x3a94e1,_0x22e4fd){var _0x6a09d5=function(_0x2d6d1c){while(--_0x2d6d1c){_0x3a94e1['push'](_0x3a94e1['shift']());}};_0x6a09d5(++_0x22e4fd);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x3fcda7,_0xc8e13e){var _0x2a0c54=function(_0x27234c){while(--_0x27234c){_0x3fcda7['push'](_0x3fcda7['shift']());}};_0x2a0c54(++_0xc8e13e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 6f0ee28..b1d89e9 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 _0xb456=['filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','clone','omit','createdAt','updatedAt','body','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','iframe','attrUrl','attrs','https://','custom','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardItem','getItems','findOne','filter','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','./dashboard.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','destroy','get','CustomDashboards','UserProfileResource','then','sendStatus','error','name','Dashboard','rawAttributes','fieldName','type','key','model','map','keys','query'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xb456,0x1b9));var _0x6b45=function(_0x1b05fa,_0x50b463){_0x1b05fa=_0x1b05fa-0x0;var _0x50740a=_0xb456[_0x1b05fa];return _0x50740a;};'use strict';var emlformat=require(_0x6b45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b45('0x1'));var jsonpatch=require(_0x6b45('0x2'));var rp=require(_0x6b45('0x3'));var moment=require(_0x6b45('0x4'));var BPromise=require(_0x6b45('0x5'));var Mustache=require(_0x6b45('0x6'));var util=require('util');var path=require(_0x6b45('0x7'));var sox=require('sox');var csv=require(_0x6b45('0x8'));var ejs=require(_0x6b45('0x9'));var fs=require('fs');var fs_extra=require(_0x6b45('0xa'));var _=require(_0x6b45('0xb'));var squel=require(_0x6b45('0xc'));var crypto=require('crypto');var jsforce=require(_0x6b45('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6b45('0x8'));var querystring=require('querystring');var Papa=require(_0x6b45('0xe'));var Redis=require(_0x6b45('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6b45('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b45('0x11'));var logger=require(_0x6b45('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x6b45('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6b45('0x14'))['db'];config[_0x6b45('0x15')]=_['defaults'](config[_0x6b45('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6b45('0x15')]));require(_0x6b45('0x16'))[_0x6b45('0x17')](socket);function respondWithStatusCode(_0x5ac42c,_0x1bb2ed){_0x1bb2ed=_0x1bb2ed||0xcc;return function(_0x4f3dd0){if(_0x4f3dd0){return _0x5ac42c['sendStatus'](_0x1bb2ed);}return _0x5ac42c[_0x6b45('0x18')](_0x1bb2ed)[_0x6b45('0x19')]();};}function respondWithResult(_0x379f0f,_0x182a8a){_0x182a8a=_0x182a8a||0xc8;return function(_0x421781){if(_0x421781){return _0x379f0f[_0x6b45('0x18')](_0x182a8a)[_0x6b45('0x1a')](_0x421781);}};}function respondWithFilteredResult(_0x35d546,_0x1d4d9e){return function(_0x17a78d){if(_0x17a78d){var _0x147d68=typeof _0x1d4d9e[_0x6b45('0x1b')]===_0x6b45('0x1c')&&typeof _0x1d4d9e[_0x6b45('0x1d')]===_0x6b45('0x1c');var _0xa78920=_0x17a78d['count'];var _0x3ef902=_0x147d68?0x0:_0x1d4d9e[_0x6b45('0x1b')];var _0x5798f5=_0x147d68?_0x17a78d[_0x6b45('0x1e')]:_0x1d4d9e[_0x6b45('0x1b')]+_0x1d4d9e[_0x6b45('0x1d')];var _0x15d10b;if(_0x5798f5>=_0xa78920){_0x5798f5=_0xa78920;_0x15d10b=0xc8;}else{_0x15d10b=0xce;}_0x35d546[_0x6b45('0x18')](_0x15d10b);return _0x35d546[_0x6b45('0x1f')]('Content-Range',_0x3ef902+'-'+_0x5798f5+'/'+_0xa78920)[_0x6b45('0x1a')](_0x17a78d);}return null;};}function patchUpdates(_0x3d203f){return function(_0x920b48){try{jsonpatch[_0x6b45('0x20')](_0x920b48,_0x3d203f,!![]);}catch(_0xaac6e2){return BPromise[_0x6b45('0x21')](_0xaac6e2);}return _0x920b48['save']();};}function saveUpdates(_0x1fdcaf,_0x13da24){return function(_0x48219a){if(_0x48219a){return _0x48219a['update'](_0x1fdcaf)['then'](function(_0x10a304){return _0x10a304;});}return null;};}function removeEntity(_0x30bb10,_0x2dcad7){return function(_0x3a0612){if(_0x3a0612){return _0x3a0612[_0x6b45('0x22')]()['then'](function(){var _0x32a2a5=_0x3a0612[_0x6b45('0x23')]({'plain':!![]});var _0x4dfebd=_0x6b45('0x24');return db[_0x6b45('0x25')]['destroy']({'where':{'type':_0x4dfebd,'resourceId':_0x32a2a5['id']}})['then'](function(){return _0x3a0612;});})[_0x6b45('0x26')](function(){_0x30bb10[_0x6b45('0x18')](0xcc)[_0x6b45('0x19')]();});}};}function handleEntityNotFound(_0x346bc8,_0x38faf8){return function(_0x42124d){if(!_0x42124d){_0x346bc8[_0x6b45('0x27')](0x194);}return _0x42124d;};}function handleError(_0x2ab56e,_0x1f2975){_0x1f2975=_0x1f2975||0x1f4;return function(_0x277d7a){logger[_0x6b45('0x28')](_0x277d7a['stack']);if(_0x277d7a['name']){delete _0x277d7a[_0x6b45('0x29')];}_0x2ab56e[_0x6b45('0x18')](_0x1f2975)['send'](_0x277d7a);};}exports['index']=function(_0x52b121,_0xcf23cf){var _0xfadd9b={},_0x10a564={},_0x3acd67={'count':0x0,'rows':[]};var _0x3dd0f0=_['map'](db[_0x6b45('0x2a')][_0x6b45('0x2b')],function(_0x176222){return{'name':_0x176222[_0x6b45('0x2c')],'type':_0x176222[_0x6b45('0x2d')][_0x6b45('0x2e')]};});_0x10a564[_0x6b45('0x2f')]=_[_0x6b45('0x30')](_0x3dd0f0,_0x6b45('0x29'));_0x10a564['query']=_[_0x6b45('0x31')](_0x52b121[_0x6b45('0x32')]);_0x10a564[_0x6b45('0x33')]=_['intersection'](_0x10a564[_0x6b45('0x2f')],_0x10a564[_0x6b45('0x32')]);_0xfadd9b['attributes']=_[_0x6b45('0x34')](_0x10a564['model'],qs['fields'](_0x52b121[_0x6b45('0x32')][_0x6b45('0x35')]));_0xfadd9b[_0x6b45('0x36')]=_0xfadd9b[_0x6b45('0x36')]['length']?_0xfadd9b[_0x6b45('0x36')]:_0x10a564['model'];if(!_0x52b121['query'][_0x6b45('0x37')]('nolimit')){_0xfadd9b[_0x6b45('0x1d')]=qs['limit'](_0x52b121['query']['limit']);_0xfadd9b[_0x6b45('0x1b')]=qs['offset'](_0x52b121[_0x6b45('0x32')][_0x6b45('0x1b')]);}_0xfadd9b[_0x6b45('0x38')]=qs[_0x6b45('0x39')](_0x52b121[_0x6b45('0x32')][_0x6b45('0x39')]);_0xfadd9b[_0x6b45('0x3a')]=qs[_0x6b45('0x33')](_[_0x6b45('0x3b')](_0x52b121[_0x6b45('0x32')],_0x10a564[_0x6b45('0x33')]),_0x3dd0f0);if(_0x52b121['query']['filter']){_0xfadd9b[_0x6b45('0x3a')]=_[_0x6b45('0x3c')](_0xfadd9b['where'],{'$or':_[_0x6b45('0x30')](_0x3dd0f0,function(_0x33b7a2){if(_0x33b7a2[_0x6b45('0x2d')]!==_0x6b45('0x3d')){var _0x20fe67={};_0x20fe67[_0x33b7a2[_0x6b45('0x29')]]={'$like':'%'+_0x52b121['query']['filter']+'%'};return _0x20fe67;}})});}_0xfadd9b=_[_0x6b45('0x3c')]({},_0xfadd9b,_0x52b121[_0x6b45('0x3e')]);var _0x2d2c8c={'where':_0xfadd9b[_0x6b45('0x3a')]};return db[_0x6b45('0x2a')][_0x6b45('0x1e')](_0x2d2c8c)[_0x6b45('0x26')](function(_0x4aba13){_0x3acd67[_0x6b45('0x1e')]=_0x4aba13;if(_0x52b121[_0x6b45('0x32')]['includeAll']){_0xfadd9b[_0x6b45('0x3f')]=[{'all':!![]}];}return db['Dashboard'][_0x6b45('0x40')](_0xfadd9b);})[_0x6b45('0x26')](function(_0x33797d){_0x3acd67[_0x6b45('0x41')]=_0x33797d;return _0x3acd67;})['then'](respondWithFilteredResult(_0xcf23cf,_0xfadd9b))['catch'](handleError(_0xcf23cf,null));};exports[_0x6b45('0x42')]=function(_0x4fd9b2,_0xa7b2e5){var _0x1c5804={'raw':![],'where':{'id':_0x4fd9b2[_0x6b45('0x43')]['id']}},_0x2b3949={};_0x2b3949[_0x6b45('0x2f')]=_[_0x6b45('0x31')](db[_0x6b45('0x2a')]['rawAttributes']);_0x2b3949[_0x6b45('0x32')]=_[_0x6b45('0x31')](_0x4fd9b2[_0x6b45('0x32')]);_0x2b3949[_0x6b45('0x33')]=_[_0x6b45('0x34')](_0x2b3949['model'],_0x2b3949[_0x6b45('0x32')]);_0x1c5804[_0x6b45('0x36')]=_['intersection'](_0x2b3949[_0x6b45('0x2f')],qs[_0x6b45('0x35')](_0x4fd9b2['query'][_0x6b45('0x35')]));_0x1c5804[_0x6b45('0x36')]=_0x1c5804[_0x6b45('0x36')][_0x6b45('0x44')]?_0x1c5804['attributes']:_0x2b3949['model'];if(_0x4fd9b2[_0x6b45('0x32')][_0x6b45('0x45')]){_0x1c5804[_0x6b45('0x3f')]=[{'all':!![]}];}_0x1c5804=_[_0x6b45('0x3c')]({},_0x1c5804,_0x4fd9b2[_0x6b45('0x3e')]);return db[_0x6b45('0x2a')][_0x6b45('0x46')](_0x1c5804)[_0x6b45('0x26')](handleEntityNotFound(_0xa7b2e5,null))[_0x6b45('0x26')](respondWithResult(_0xa7b2e5,null))[_0x6b45('0x47')](handleError(_0xa7b2e5,null));};exports[_0x6b45('0x48')]=function(_0x19700b,_0x559d88){return db[_0x6b45('0x2a')][_0x6b45('0x48')](_0x19700b['body'],{})['then'](function(_0x578fa4){var _0x1ec7a6=_0x19700b[_0x6b45('0x49')]['get']({'plain':!![]});if(!_0x1ec7a6)throw new Error(_0x6b45('0x4a'));if(_0x1ec7a6['role']===_0x6b45('0x49')){var _0x16d91b=_0x578fa4[_0x6b45('0x23')]({'plain':!![]});var _0x248687=_0x6b45('0x24');return db[_0x6b45('0x4b')][_0x6b45('0x46')]({'where':{'name':_0x248687,'userProfileId':_0x1ec7a6['userProfileId']},'raw':!![]})[_0x6b45('0x26')](function(_0x441a72){if(_0x441a72&&_0x441a72['autoAssociation']===0x0){return db[_0x6b45('0x25')][_0x6b45('0x48')]({'name':_0x16d91b['name'],'resourceId':_0x16d91b['id'],'type':_0x441a72[_0x6b45('0x29')],'sectionId':_0x441a72['id']},{})['then'](function(){return _0x578fa4;});}else{return _0x578fa4;}})['catch'](function(_0x327590){logger[_0x6b45('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x327590);throw _0x327590;});}return _0x578fa4;})['then'](respondWithResult(_0x559d88,0xc9))['catch'](handleError(_0x559d88,null));};exports[_0x6b45('0x4c')]=function(_0x40b377,_0x2dc837){var _0x31ec54={'where':{'id':_0x40b377[_0x6b45('0x43')]['id']}},_0x2b915a={};_0x2b915a[_0x6b45('0x2f')]=_[_0x6b45('0x31')](db[_0x6b45('0x2a')][_0x6b45('0x2b')]);_0x31ec54[_0x6b45('0x36')]=_[_0x6b45('0x34')](_0x2b915a[_0x6b45('0x2f')],qs['fields'](_0x40b377['query'][_0x6b45('0x35')]));_0x31ec54[_0x6b45('0x36')]=_0x31ec54[_0x6b45('0x36')][_0x6b45('0x44')]?_0x31ec54[_0x6b45('0x36')]:_0x2b915a[_0x6b45('0x2f')];if(_0x40b377['query'][_0x6b45('0x45')]){_0x31ec54[_0x6b45('0x3f')]=[{'all':!![]}];}_0x31ec54=_[_0x6b45('0x3c')]({},_0x31ec54,_0x40b377['options']);return db['Dashboard'][_0x6b45('0x46')](_0x31ec54)['then'](handleEntityNotFound(_0x2dc837,null))[_0x6b45('0x26')](function(_0x4f3d3e){if(_0x4f3d3e){var _0x5bb0ea=_0x4f3d3e['get']({'plain':!![]});_0x5bb0ea=qs[_0x6b45('0x4d')](_0x5bb0ea,['id',_0x6b45('0x4e'),_0x6b45('0x4f')]);_0x40b377[_0x6b45('0x50')]=_['omit'](_0x40b377['body'],['id',_0x6b45('0x4e'),'updatedAt']);return db[_0x6b45('0x2a')][_0x6b45('0x48')](_[_0x6b45('0x3c')](_0x5bb0ea,_0x40b377[_0x6b45('0x50')]),{'include':_0x40b377[_0x6b45('0x32')][_0x6b45('0x45')]?[{'all':!![]}]:undefined})[_0x6b45('0x26')](function(_0x50df21){var _0x47f718=_0x40b377[_0x6b45('0x49')][_0x6b45('0x23')]({'plain':!![]});if(!_0x47f718)throw new Error(_0x6b45('0x4a'));if(_0x47f718[_0x6b45('0x51')]===_0x6b45('0x49')){var _0x68d4cf=_0x50df21['get']({'plain':!![]});var _0x215ca4=_0x6b45('0x24');return db[_0x6b45('0x4b')][_0x6b45('0x46')]({'where':{'name':_0x215ca4,'userProfileId':_0x47f718[_0x6b45('0x52')]},'raw':!![]})[_0x6b45('0x26')](function(_0x23b8ca){if(_0x23b8ca&&_0x23b8ca[_0x6b45('0x53')]===0x0){return db[_0x6b45('0x25')][_0x6b45('0x48')]({'name':_0x68d4cf[_0x6b45('0x29')],'resourceId':_0x68d4cf['id'],'type':_0x23b8ca[_0x6b45('0x29')],'sectionId':_0x23b8ca['id']},{})[_0x6b45('0x26')](function(){return _0x50df21;});}else{return _0x50df21;}})[_0x6b45('0x47')](function(_0x22c4fb){logger[_0x6b45('0x28')](_0x6b45('0x54'),_0x22c4fb);throw _0x22c4fb;});}return _0x50df21;});}})['then'](respondWithResult(_0x2dc837,0xc9))[_0x6b45('0x47')](handleError(_0x2dc837,null));};exports[_0x6b45('0x55')]=function(_0x42bdcc,_0x32bea2){if(_0x42bdcc[_0x6b45('0x50')]['id']){delete _0x42bdcc[_0x6b45('0x50')]['id'];}return db[_0x6b45('0x2a')][_0x6b45('0x46')]({'where':{'id':_0x42bdcc[_0x6b45('0x43')]['id']}})[_0x6b45('0x26')](handleEntityNotFound(_0x32bea2,null))[_0x6b45('0x26')](saveUpdates(_0x42bdcc[_0x6b45('0x50')],null))[_0x6b45('0x26')](respondWithResult(_0x32bea2,null))['catch'](handleError(_0x32bea2,null));};exports[_0x6b45('0x22')]=function(_0x4a2746,_0x282156){return db['Dashboard'][_0x6b45('0x46')]({'where':{'id':_0x4a2746[_0x6b45('0x43')]['id']}})[_0x6b45('0x26')](handleEntityNotFound(_0x282156,null))[_0x6b45('0x26')](removeEntity(_0x282156,null))[_0x6b45('0x47')](handleError(_0x282156,null));};function widgetAttributes(_0x3d6c2d){try{switch(_0x3d6c2d['type']){case _0x6b45('0x56'):return[{'name':_0x6b45('0x57'),'value':_0x3d6c2d[_0x6b45('0x57')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x0]?_0x3d6c2d[_0x6b45('0x58')][0x0]['value']:undefined)||_0x6b45('0x59')}];case _0x6b45('0x5a'):return[{'name':'attrPath','value':_0x3d6c2d['attrPath']||(_0x3d6c2d['attrs']&&_0x3d6c2d[_0x6b45('0x58')][0x0]?_0x3d6c2d[_0x6b45('0x58')][0x0][_0x6b45('0x5b')]:undefined)||''}];case _0x6b45('0x5c'):return[{'name':_0x6b45('0x5d'),'value':_0x3d6c2d[_0x6b45('0x5d')]||(_0x3d6c2d['attrs']&&_0x3d6c2d[_0x6b45('0x58')][0x0]?_0x3d6c2d[_0x6b45('0x58')][0x0]['value']:undefined)||_0x6b45('0x5e')},{'name':_0x6b45('0x5f'),'value':_0x3d6c2d[_0x6b45('0x5f')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x1]?_0x3d6c2d[_0x6b45('0x58')][0x1][_0x6b45('0x5b')]:undefined)||_0x6b45('0x60')},{'name':'attrFontSize','value':_0x3d6c2d[_0x6b45('0x61')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x2]?_0x3d6c2d[_0x6b45('0x58')][0x2][_0x6b45('0x5b')]:undefined)||0xc}];case _0x6b45('0x62'):return[{'name':'attrMetric','value':_0x3d6c2d[_0x6b45('0x63')]||(_0x3d6c2d['attrs']&&_0x3d6c2d[_0x6b45('0x58')][0x0]?_0x3d6c2d[_0x6b45('0x58')][0x0][_0x6b45('0x5b')]:undefined)||_0x6b45('0x64')},{'name':_0x6b45('0x65'),'value':_0x3d6c2d[_0x6b45('0x65')]||(_0x3d6c2d['attrs']&&_0x3d6c2d[_0x6b45('0x58')][0x1]?_0x3d6c2d[_0x6b45('0x58')][0x1][_0x6b45('0x5b')]:undefined)||[]},{'name':'attrFontSize','value':_0x3d6c2d[_0x6b45('0x61')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d['attrs'][0x2]?_0x3d6c2d[_0x6b45('0x58')][0x2][_0x6b45('0x5b')]:undefined)||0x14},{'name':_0x6b45('0x66'),'value':_0x3d6c2d[_0x6b45('0x66')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x3]?_0x3d6c2d[_0x6b45('0x58')][0x3]['value']:undefined)||_0x6b45('0x67')},{'name':'attrEmailAccounts','value':_0x3d6c2d[_0x6b45('0x68')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x4]?_0x3d6c2d['attrs'][0x4]['value']:undefined)||''},{'name':_0x6b45('0x69'),'value':_0x3d6c2d[_0x6b45('0x69')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x5]?_0x3d6c2d['attrs'][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x3d6c2d[_0x6b45('0x6a')]||(_0x3d6c2d['attrs']&&_0x3d6c2d[_0x6b45('0x58')][0x6]?_0x3d6c2d[_0x6b45('0x58')][0x6][_0x6b45('0x5b')]:undefined)||''},{'name':_0x6b45('0x6b'),'value':_0x3d6c2d[_0x6b45('0x6b')]||(_0x3d6c2d['attrs']&&_0x3d6c2d[_0x6b45('0x58')][0x7]?_0x3d6c2d['attrs'][0x7][_0x6b45('0x5b')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3d6c2d[_0x6b45('0x6c')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d['attrs'][0x8]?_0x3d6c2d[_0x6b45('0x58')][0x8][_0x6b45('0x5b')]:undefined)||''},{'name':_0x6b45('0x6d'),'value':_0x3d6c2d['attrChatWebsites']||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x9]?_0x3d6c2d[_0x6b45('0x58')][0x9][_0x6b45('0x5b')]:undefined)||''}];case _0x6b45('0x6e'):case'pie-chart':return[{'name':_0x6b45('0x6f'),'value':_0x3d6c2d['attrSerie1']||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x0]?_0x3d6c2d[_0x6b45('0x58')][0x0]['value']:undefined)||'total'},{'name':'attrSerie2','value':_0x3d6c2d[_0x6b45('0x70')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x1]?_0x3d6c2d['attrs'][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x3d6c2d['attrSerie3']||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x2]?_0x3d6c2d[_0x6b45('0x58')][0x2][_0x6b45('0x5b')]:undefined)||null},{'name':_0x6b45('0x65'),'value':_0x3d6c2d[_0x6b45('0x65')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x3]?_0x3d6c2d['attrs'][0x3][_0x6b45('0x5b')]:undefined)||[]},{'name':'attrChannel','value':_0x3d6c2d[_0x6b45('0x66')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x4]?_0x3d6c2d[_0x6b45('0x58')][0x4][_0x6b45('0x5b')]:undefined)||_0x6b45('0x67')},{'name':'attrEmailAccounts','value':_0x3d6c2d[_0x6b45('0x68')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d['attrs'][0x5]?_0x3d6c2d[_0x6b45('0x58')][0x5][_0x6b45('0x5b')]:undefined)||''},{'name':_0x6b45('0x69'),'value':_0x3d6c2d[_0x6b45('0x69')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x6]?_0x3d6c2d[_0x6b45('0x58')][0x6]['value']:undefined)||''},{'name':_0x6b45('0x6a'),'value':_0x3d6c2d['attrSmsAccounts']||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x7]?_0x3d6c2d[_0x6b45('0x58')][0x7][_0x6b45('0x5b')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3d6c2d[_0x6b45('0x6b')]||(_0x3d6c2d['attrs']&&_0x3d6c2d['attrs'][0x8]?_0x3d6c2d[_0x6b45('0x58')][0x8][_0x6b45('0x5b')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3d6c2d['attrWhatsappAccounts']||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x9]?_0x3d6c2d[_0x6b45('0x58')][0x9][_0x6b45('0x5b')]:undefined)||''},{'name':_0x6b45('0x6d'),'value':_0x3d6c2d[_0x6b45('0x6d')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0xa]?_0x3d6c2d[_0x6b45('0x58')][0xa]['value']:undefined)||''}];case _0x6b45('0x71'):return[{'name':'attrReport','type':_0x3d6c2d[_0x6b45('0x72')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x0]?_0x3d6c2d['attrs'][0x0][_0x6b45('0x2d')]:undefined)||null,'value':_0x3d6c2d[_0x6b45('0x73')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x0]?_0x3d6c2d[_0x6b45('0x58')][0x0][_0x6b45('0x5b')]:undefined)||null},{'name':_0x6b45('0x74'),'value':_0x3d6c2d[_0x6b45('0x74')]||(_0x3d6c2d[_0x6b45('0x58')]&&_0x3d6c2d[_0x6b45('0x58')][0x1]?_0x3d6c2d[_0x6b45('0x58')][0x1][_0x6b45('0x5b')]:undefined)||0x0}];default:return[];}}catch(_0x1ea29d){logger[_0x6b45('0x28')](_0x6b45('0x75'),JSON['stringify'](_0x1ea29d));return[];}}exports[_0x6b45('0x76')]=function(_0x2ea6a3,_0x39dca1,_0x215496){if(_0x2ea6a3[_0x6b45('0x50')]['id']){delete _0x2ea6a3[_0x6b45('0x50')]['id'];}return db[_0x6b45('0x2a')]['find']({'where':{'id':_0x2ea6a3[_0x6b45('0x43')]['id']}})['then'](handleEntityNotFound(_0x39dca1,null))[_0x6b45('0x26')](function(_0x913cab){if(_0x913cab){_0x2ea6a3[_0x6b45('0x50')]['DashboardId']=_0x913cab['id'];_0x2ea6a3[_0x6b45('0x50')][_0x6b45('0x58')]=widgetAttributes(_0x2ea6a3[_0x6b45('0x50')]);return db[_0x6b45('0x77')][_0x6b45('0x48')](_0x2ea6a3[_0x6b45('0x50')]);}})[_0x6b45('0x26')](respondWithResult(_0x39dca1,null))[_0x6b45('0x47')](handleError(_0x39dca1,null));};exports[_0x6b45('0x78')]=function(_0x322d8c,_0x3908d0,_0x1b45a6){var _0xf121d={};var _0x1b24b7={};var _0x1f9292;var _0x116ad0;return db[_0x6b45('0x2a')][_0x6b45('0x79')]({'where':{'id':_0x322d8c[_0x6b45('0x43')]['id']}})[_0x6b45('0x26')](handleEntityNotFound(_0x3908d0,null))[_0x6b45('0x26')](function(_0x3813ec){if(_0x3813ec){_0x1f9292=_0x3813ec;_0x1b24b7[_0x6b45('0x2f')]=_[_0x6b45('0x31')](db['DashboardItem'][_0x6b45('0x2b')]);_0x1b24b7[_0x6b45('0x32')]=_[_0x6b45('0x31')](_0x322d8c[_0x6b45('0x32')]);_0x1b24b7['filters']=_['intersection'](_0x1b24b7['model'],_0x1b24b7[_0x6b45('0x32')]);_0xf121d[_0x6b45('0x36')]=_[_0x6b45('0x34')](_0x1b24b7[_0x6b45('0x2f')],qs[_0x6b45('0x35')](_0x322d8c[_0x6b45('0x32')][_0x6b45('0x35')]));_0xf121d[_0x6b45('0x36')]=_0xf121d[_0x6b45('0x36')][_0x6b45('0x44')]?_0xf121d[_0x6b45('0x36')]:_0x1b24b7[_0x6b45('0x2f')];_0xf121d[_0x6b45('0x38')]=qs[_0x6b45('0x39')](_0x322d8c[_0x6b45('0x32')][_0x6b45('0x39')]);_0xf121d[_0x6b45('0x3a')]=qs['filters'](_[_0x6b45('0x3b')](_0x322d8c['query'],_0x1b24b7[_0x6b45('0x33')]));if(_0x322d8c[_0x6b45('0x32')][_0x6b45('0x7a')]){_0xf121d['where']=_[_0x6b45('0x3c')](_0xf121d[_0x6b45('0x3a')],{'$or':_[_0x6b45('0x30')](_0xf121d['attributes'],function(_0x12863e){var _0x59767a={};_0x59767a[_0x12863e]={'$like':'%'+_0x322d8c['query'][_0x6b45('0x7a')]+'%'};return _0x59767a;})});}_0xf121d=_[_0x6b45('0x3c')]({},_0xf121d,_0x322d8c['options']);return _0x1f9292[_0x6b45('0x78')](_0xf121d);}})[_0x6b45('0x26')](function(_0x538def){if(_0x538def){_0x116ad0=_0x538def[_0x6b45('0x44')];if(!_0x322d8c[_0x6b45('0x32')]['hasOwnProperty']('nolimit')){_0xf121d[_0x6b45('0x1d')]=qs[_0x6b45('0x1d')](_0x322d8c[_0x6b45('0x32')][_0x6b45('0x1d')]);_0xf121d[_0x6b45('0x1b')]=qs[_0x6b45('0x1b')](_0x322d8c[_0x6b45('0x32')][_0x6b45('0x1b')]);}return _0x1f9292[_0x6b45('0x78')](_0xf121d);}})['then'](function(_0x40c63c){if(_0x40c63c){return _0x40c63c?{'count':_0x116ad0,'rows':_0x40c63c}:null;}})['then'](respondWithResult(_0x3908d0,null))[_0x6b45('0x47')](handleError(_0x3908d0,null));}; \ No newline at end of file +var _0x6333=['where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','catch','iframe','attrUrl','attrs','value','https://','attrPath','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','reportType','attrReport','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort'];(function(_0x4d21ad,_0x83ef1c){var _0xcb406=function(_0x517879){while(--_0x517879){_0x4d21ad['push'](_0x4d21ad['shift']());}};_0xcb406(++_0x83ef1c);}(_0x6333,0x1ce));var _0x3633=function(_0xe0f1ad,_0x1e17ac){_0xe0f1ad=_0xe0f1ad-0x0;var _0x3af42c=_0x6333[_0xe0f1ad];return _0x3af42c;};'use strict';var emlformat=require(_0x3633('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3633('0x1'));var jsonpatch=require(_0x3633('0x2'));var rp=require(_0x3633('0x3'));var moment=require(_0x3633('0x4'));var BPromise=require(_0x3633('0x5'));var Mustache=require(_0x3633('0x6'));var util=require(_0x3633('0x7'));var path=require(_0x3633('0x8'));var sox=require(_0x3633('0x9'));var csv=require(_0x3633('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3633('0xb'));var _=require(_0x3633('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3633('0xd'));var deskjs=require(_0x3633('0xe'));var toCsv=require(_0x3633('0xa'));var querystring=require(_0x3633('0xf'));var Papa=require('papaparse');var Redis=require(_0x3633('0x10'));var authService=require(_0x3633('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3633('0x12'));var hardwareService=require(_0x3633('0x13'));var logger=require(_0x3633('0x14'))(_0x3633('0x15'));var utils=require(_0x3633('0x16'));var config=require(_0x3633('0x17'));var licenseUtil=require(_0x3633('0x18'));var db=require(_0x3633('0x19'))['db'];config['redis']=_[_0x3633('0x1a')](config[_0x3633('0x1b')],{'host':_0x3633('0x1c'),'port':0x18eb});var socket=require(_0x3633('0x1d'))(new Redis(config[_0x3633('0x1b')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x287402,_0x5eeb1f){_0x5eeb1f=_0x5eeb1f||0xcc;return function(_0x38c856){if(_0x38c856){return _0x287402[_0x3633('0x1e')](_0x5eeb1f);}return _0x287402[_0x3633('0x1f')](_0x5eeb1f)[_0x3633('0x20')]();};}function respondWithResult(_0x4b41fc,_0x164f78){_0x164f78=_0x164f78||0xc8;return function(_0xa3856b){if(_0xa3856b){return _0x4b41fc['status'](_0x164f78)['json'](_0xa3856b);}};}function respondWithFilteredResult(_0x4fdd1c,_0xb7ec37){return function(_0x15089b){if(_0x15089b){var _0x6dccb3=typeof _0xb7ec37[_0x3633('0x21')]===_0x3633('0x22')&&typeof _0xb7ec37[_0x3633('0x23')]===_0x3633('0x22');var _0x136281=_0x15089b[_0x3633('0x24')];var _0x450a89=_0x6dccb3?0x0:_0xb7ec37['offset'];var _0x13b0c8=_0x6dccb3?_0x15089b[_0x3633('0x24')]:_0xb7ec37[_0x3633('0x21')]+_0xb7ec37['limit'];var _0x5792d9;if(_0x13b0c8>=_0x136281){_0x13b0c8=_0x136281;_0x5792d9=0xc8;}else{_0x5792d9=0xce;}_0x4fdd1c[_0x3633('0x1f')](_0x5792d9);return _0x4fdd1c[_0x3633('0x25')](_0x3633('0x26'),_0x450a89+'-'+_0x13b0c8+'/'+_0x136281)[_0x3633('0x27')](_0x15089b);}return null;};}function patchUpdates(_0x5ed947){return function(_0x24b81c){try{jsonpatch[_0x3633('0x28')](_0x24b81c,_0x5ed947,!![]);}catch(_0xf22776){return BPromise[_0x3633('0x29')](_0xf22776);}return _0x24b81c[_0x3633('0x2a')]();};}function saveUpdates(_0x32358b,_0x5c7f81){return function(_0x176e06){if(_0x176e06){return _0x176e06[_0x3633('0x2b')](_0x32358b)['then'](function(_0x59fcd9){return _0x59fcd9;});}return null;};}function removeEntity(_0x121bac,_0x282fd4){return function(_0x20b135){if(_0x20b135){return _0x20b135[_0x3633('0x2c')]()[_0x3633('0x2d')](function(){var _0x5e39ee=_0x20b135[_0x3633('0x2e')]({'plain':!![]});var _0x32566e=_0x3633('0x2f');return db[_0x3633('0x30')][_0x3633('0x2c')]({'where':{'type':_0x32566e,'resourceId':_0x5e39ee['id']}})[_0x3633('0x2d')](function(){return _0x20b135;});})[_0x3633('0x2d')](function(){_0x121bac[_0x3633('0x1f')](0xcc)[_0x3633('0x20')]();});}};}function handleEntityNotFound(_0x5d3d3b,_0xc997a3){return function(_0xced939){if(!_0xced939){_0x5d3d3b[_0x3633('0x1e')](0x194);}return _0xced939;};}function handleError(_0x3a5244,_0x1a588c){_0x1a588c=_0x1a588c||0x1f4;return function(_0x330ec1){logger[_0x3633('0x31')](_0x330ec1[_0x3633('0x32')]);if(_0x330ec1['name']){delete _0x330ec1[_0x3633('0x33')];}_0x3a5244[_0x3633('0x1f')](_0x1a588c)[_0x3633('0x34')](_0x330ec1);};}exports[_0x3633('0x35')]=function(_0x2a6185,_0x49f4e2){var _0x5bc1ef={},_0x13758a={},_0x3249a0={'count':0x0,'rows':[]};var _0x91f1cb=_[_0x3633('0x36')](db[_0x3633('0x37')][_0x3633('0x38')],function(_0x326f6b){return{'name':_0x326f6b[_0x3633('0x39')],'type':_0x326f6b[_0x3633('0x3a')]['key']};});_0x13758a['model']=_[_0x3633('0x36')](_0x91f1cb,_0x3633('0x33'));_0x13758a[_0x3633('0x3b')]=_[_0x3633('0x3c')](_0x2a6185[_0x3633('0x3b')]);_0x13758a['filters']=_[_0x3633('0x3d')](_0x13758a['model'],_0x13758a[_0x3633('0x3b')]);_0x5bc1ef[_0x3633('0x3e')]=_[_0x3633('0x3d')](_0x13758a['model'],qs['fields'](_0x2a6185[_0x3633('0x3b')][_0x3633('0x3f')]));_0x5bc1ef[_0x3633('0x3e')]=_0x5bc1ef['attributes'][_0x3633('0x40')]?_0x5bc1ef['attributes']:_0x13758a[_0x3633('0x41')];if(!_0x2a6185[_0x3633('0x3b')][_0x3633('0x42')](_0x3633('0x43'))){_0x5bc1ef[_0x3633('0x23')]=qs['limit'](_0x2a6185[_0x3633('0x3b')][_0x3633('0x23')]);_0x5bc1ef['offset']=qs['offset'](_0x2a6185[_0x3633('0x3b')]['offset']);}_0x5bc1ef[_0x3633('0x44')]=qs[_0x3633('0x45')](_0x2a6185['query'][_0x3633('0x45')]);_0x5bc1ef[_0x3633('0x46')]=qs[_0x3633('0x47')](_[_0x3633('0x48')](_0x2a6185[_0x3633('0x3b')],_0x13758a[_0x3633('0x47')]),_0x91f1cb);if(_0x2a6185['query'][_0x3633('0x49')]){_0x5bc1ef[_0x3633('0x46')]=_[_0x3633('0x4a')](_0x5bc1ef[_0x3633('0x46')],{'$or':_[_0x3633('0x36')](_0x91f1cb,function(_0x39b340){if(_0x39b340[_0x3633('0x3a')]!==_0x3633('0x4b')){var _0x457f48={};_0x457f48[_0x39b340['name']]={'$like':'%'+_0x2a6185['query']['filter']+'%'};return _0x457f48;}})});}_0x5bc1ef=_[_0x3633('0x4a')]({},_0x5bc1ef,_0x2a6185[_0x3633('0x4c')]);var _0x1fbf04={'where':_0x5bc1ef[_0x3633('0x46')]};return db[_0x3633('0x37')]['count'](_0x1fbf04)[_0x3633('0x2d')](function(_0x1b8449){_0x3249a0[_0x3633('0x24')]=_0x1b8449;if(_0x2a6185['query'][_0x3633('0x4d')]){_0x5bc1ef['include']=[{'all':!![]}];}return db[_0x3633('0x37')][_0x3633('0x4e')](_0x5bc1ef);})[_0x3633('0x2d')](function(_0x249c66){_0x3249a0[_0x3633('0x4f')]=_0x249c66;return _0x3249a0;})['then'](respondWithFilteredResult(_0x49f4e2,_0x5bc1ef))['catch'](handleError(_0x49f4e2,null));};exports[_0x3633('0x50')]=function(_0x5a691c,_0x563b6a){var _0x5e24f8={'raw':![],'where':{'id':_0x5a691c[_0x3633('0x51')]['id']}},_0x3a7250={};_0x3a7250[_0x3633('0x41')]=_['keys'](db[_0x3633('0x37')][_0x3633('0x38')]);_0x3a7250['query']=_[_0x3633('0x3c')](_0x5a691c[_0x3633('0x3b')]);_0x3a7250[_0x3633('0x47')]=_['intersection'](_0x3a7250[_0x3633('0x41')],_0x3a7250[_0x3633('0x3b')]);_0x5e24f8[_0x3633('0x3e')]=_[_0x3633('0x3d')](_0x3a7250['model'],qs[_0x3633('0x3f')](_0x5a691c['query'][_0x3633('0x3f')]));_0x5e24f8['attributes']=_0x5e24f8['attributes']['length']?_0x5e24f8['attributes']:_0x3a7250[_0x3633('0x41')];if(_0x5a691c['query'][_0x3633('0x4d')]){_0x5e24f8[_0x3633('0x52')]=[{'all':!![]}];}_0x5e24f8=_[_0x3633('0x4a')]({},_0x5e24f8,_0x5a691c[_0x3633('0x4c')]);return db['Dashboard'][_0x3633('0x53')](_0x5e24f8)[_0x3633('0x2d')](handleEntityNotFound(_0x563b6a,null))['then'](respondWithResult(_0x563b6a,null))['catch'](handleError(_0x563b6a,null));};exports[_0x3633('0x54')]=function(_0x1b6d08,_0xb9e641){return db[_0x3633('0x37')][_0x3633('0x54')](_0x1b6d08['body'],{})['then'](function(_0x345644){var _0x3d55e8=_0x1b6d08[_0x3633('0x55')]['get']({'plain':!![]});if(!_0x3d55e8)throw new Error(_0x3633('0x56'));if(_0x3d55e8[_0x3633('0x57')]===_0x3633('0x55')){var _0xce9ad6=_0x345644[_0x3633('0x2e')]({'plain':!![]});var _0xb10a87=_0x3633('0x2f');return db[_0x3633('0x58')][_0x3633('0x53')]({'where':{'name':_0xb10a87,'userProfileId':_0x3d55e8[_0x3633('0x59')]},'raw':!![]})[_0x3633('0x2d')](function(_0x31a177){if(_0x31a177&&_0x31a177['autoAssociation']===0x0){return db[_0x3633('0x30')][_0x3633('0x54')]({'name':_0xce9ad6['name'],'resourceId':_0xce9ad6['id'],'type':_0x31a177[_0x3633('0x33')],'sectionId':_0x31a177['id']},{})[_0x3633('0x2d')](function(){return _0x345644;});}else{return _0x345644;}})['catch'](function(_0x125ec8){logger['error'](_0x3633('0x5a'),_0x125ec8);throw _0x125ec8;});}return _0x345644;})[_0x3633('0x2d')](respondWithResult(_0xb9e641,0xc9))['catch'](handleError(_0xb9e641,null));};exports[_0x3633('0x5b')]=function(_0x4663b6,_0x19db8e){var _0x211777={'where':{'id':_0x4663b6[_0x3633('0x51')]['id']}},_0x47174e={};_0x47174e[_0x3633('0x41')]=_['keys'](db[_0x3633('0x37')][_0x3633('0x38')]);_0x211777['attributes']=_[_0x3633('0x3d')](_0x47174e['model'],qs[_0x3633('0x3f')](_0x4663b6['query'][_0x3633('0x3f')]));_0x211777[_0x3633('0x3e')]=_0x211777['attributes'][_0x3633('0x40')]?_0x211777[_0x3633('0x3e')]:_0x47174e[_0x3633('0x41')];if(_0x4663b6['query'][_0x3633('0x4d')]){_0x211777[_0x3633('0x52')]=[{'all':!![]}];}_0x211777=_[_0x3633('0x4a')]({},_0x211777,_0x4663b6['options']);return db['Dashboard'][_0x3633('0x53')](_0x211777)[_0x3633('0x2d')](handleEntityNotFound(_0x19db8e,null))['then'](function(_0x2261b2){if(_0x2261b2){var _0x4d6501=_0x2261b2[_0x3633('0x2e')]({'plain':!![]});_0x4d6501=qs[_0x3633('0x5c')](_0x4d6501,['id',_0x3633('0x5d'),_0x3633('0x5e')]);_0x4663b6[_0x3633('0x5f')]=_[_0x3633('0x5c')](_0x4663b6['body'],['id',_0x3633('0x5d'),_0x3633('0x5e')]);return db[_0x3633('0x37')][_0x3633('0x54')](_[_0x3633('0x4a')](_0x4d6501,_0x4663b6['body']),{'include':_0x4663b6[_0x3633('0x3b')][_0x3633('0x4d')]?[{'all':!![]}]:undefined})[_0x3633('0x2d')](function(_0x2b0171){var _0x138f9f=_0x4663b6[_0x3633('0x55')][_0x3633('0x2e')]({'plain':!![]});if(!_0x138f9f)throw new Error(_0x3633('0x56'));if(_0x138f9f['role']===_0x3633('0x55')){var _0x3858ef=_0x2b0171[_0x3633('0x2e')]({'plain':!![]});var _0x5cf90d='CustomDashboards';return db[_0x3633('0x58')][_0x3633('0x53')]({'where':{'name':_0x5cf90d,'userProfileId':_0x138f9f['userProfileId']},'raw':!![]})['then'](function(_0x3e12f6){if(_0x3e12f6&&_0x3e12f6['autoAssociation']===0x0){return db[_0x3633('0x30')][_0x3633('0x54')]({'name':_0x3858ef[_0x3633('0x33')],'resourceId':_0x3858ef['id'],'type':_0x3e12f6[_0x3633('0x33')],'sectionId':_0x3e12f6['id']},{})[_0x3633('0x2d')](function(){return _0x2b0171;});}else{return _0x2b0171;}})[_0x3633('0x60')](function(_0x483121){logger['error'](_0x3633('0x5a'),_0x483121);throw _0x483121;});}return _0x2b0171;});}})[_0x3633('0x2d')](respondWithResult(_0x19db8e,0xc9))[_0x3633('0x60')](handleError(_0x19db8e,null));};exports['update']=function(_0x58f9a5,_0x3a870a){if(_0x58f9a5[_0x3633('0x5f')]['id']){delete _0x58f9a5['body']['id'];}return db[_0x3633('0x37')][_0x3633('0x53')]({'where':{'id':_0x58f9a5['params']['id']}})[_0x3633('0x2d')](handleEntityNotFound(_0x3a870a,null))[_0x3633('0x2d')](saveUpdates(_0x58f9a5['body'],null))['then'](respondWithResult(_0x3a870a,null))['catch'](handleError(_0x3a870a,null));};exports[_0x3633('0x2c')]=function(_0x3f234f,_0x3c34af){return db[_0x3633('0x37')][_0x3633('0x53')]({'where':{'id':_0x3f234f[_0x3633('0x51')]['id']}})['then'](handleEntityNotFound(_0x3c34af,null))[_0x3633('0x2d')](removeEntity(_0x3c34af,null))[_0x3633('0x60')](handleError(_0x3c34af,null));};function widgetAttributes(_0x4f0b47){try{switch(_0x4f0b47[_0x3633('0x3a')]){case _0x3633('0x61'):return[{'name':_0x3633('0x62'),'value':_0x4f0b47['attrUrl']||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x0]?_0x4f0b47[_0x3633('0x63')][0x0][_0x3633('0x64')]:undefined)||_0x3633('0x65')}];case'custom':return[{'name':_0x3633('0x66'),'value':_0x4f0b47[_0x3633('0x66')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x0]?_0x4f0b47[_0x3633('0x63')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x3633('0x67'),'value':_0x4f0b47[_0x3633('0x67')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x0]?_0x4f0b47[_0x3633('0x63')][0x0][_0x3633('0x64')]:undefined)||_0x3633('0x68')},{'name':'attrTimezone','value':_0x4f0b47[_0x3633('0x69')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47['attrs'][0x1]?_0x4f0b47['attrs'][0x1][_0x3633('0x64')]:undefined)||_0x3633('0x6a')},{'name':_0x3633('0x6b'),'value':_0x4f0b47[_0x3633('0x6b')]||(_0x4f0b47['attrs']&&_0x4f0b47['attrs'][0x2]?_0x4f0b47[_0x3633('0x63')][0x2][_0x3633('0x64')]:undefined)||0xc}];case _0x3633('0x6c'):return[{'name':_0x3633('0x6d'),'value':_0x4f0b47[_0x3633('0x6d')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x0]?_0x4f0b47[_0x3633('0x63')][0x0][_0x3633('0x64')]:undefined)||_0x3633('0x6e')},{'name':_0x3633('0x6f'),'value':_0x4f0b47[_0x3633('0x6f')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x1]?_0x4f0b47['attrs'][0x1]['value']:undefined)||[]},{'name':_0x3633('0x6b'),'value':_0x4f0b47[_0x3633('0x6b')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x2]?_0x4f0b47[_0x3633('0x63')][0x2][_0x3633('0x64')]:undefined)||0x14},{'name':_0x3633('0x70'),'value':_0x4f0b47[_0x3633('0x70')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x3]?_0x4f0b47[_0x3633('0x63')][0x3][_0x3633('0x64')]:undefined)||_0x3633('0x71')},{'name':_0x3633('0x72'),'value':_0x4f0b47[_0x3633('0x72')]||(_0x4f0b47['attrs']&&_0x4f0b47[_0x3633('0x63')][0x4]?_0x4f0b47[_0x3633('0x63')][0x4][_0x3633('0x64')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x4f0b47[_0x3633('0x73')]||(_0x4f0b47['attrs']&&_0x4f0b47[_0x3633('0x63')][0x5]?_0x4f0b47[_0x3633('0x63')][0x5][_0x3633('0x64')]:undefined)||''},{'name':_0x3633('0x74'),'value':_0x4f0b47[_0x3633('0x74')]||(_0x4f0b47['attrs']&&_0x4f0b47['attrs'][0x6]?_0x4f0b47[_0x3633('0x63')][0x6]['value']:undefined)||''},{'name':_0x3633('0x75'),'value':_0x4f0b47[_0x3633('0x75')]||(_0x4f0b47['attrs']&&_0x4f0b47[_0x3633('0x63')][0x7]?_0x4f0b47[_0x3633('0x63')][0x7][_0x3633('0x64')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x4f0b47[_0x3633('0x76')]||(_0x4f0b47['attrs']&&_0x4f0b47[_0x3633('0x63')][0x8]?_0x4f0b47[_0x3633('0x63')][0x8][_0x3633('0x64')]:undefined)||''},{'name':'attrChatWebsites','value':_0x4f0b47[_0x3633('0x77')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x9]?_0x4f0b47['attrs'][0x9][_0x3633('0x64')]:undefined)||''}];case'multibar-chart':case _0x3633('0x78'):return[{'name':_0x3633('0x79'),'value':_0x4f0b47[_0x3633('0x79')]||(_0x4f0b47['attrs']&&_0x4f0b47[_0x3633('0x63')][0x0]?_0x4f0b47[_0x3633('0x63')][0x0]['value']:undefined)||_0x3633('0x6e')},{'name':_0x3633('0x7a'),'value':_0x4f0b47['attrSerie2']||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x1]?_0x4f0b47[_0x3633('0x63')][0x1][_0x3633('0x64')]:undefined)||null},{'name':_0x3633('0x7b'),'value':_0x4f0b47[_0x3633('0x7b')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x2]?_0x4f0b47[_0x3633('0x63')][0x2][_0x3633('0x64')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x4f0b47['attrVoiceQueues']||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x3]?_0x4f0b47[_0x3633('0x63')][0x3][_0x3633('0x64')]:undefined)||[]},{'name':_0x3633('0x70'),'value':_0x4f0b47['attrChannel']||(_0x4f0b47['attrs']&&_0x4f0b47[_0x3633('0x63')][0x4]?_0x4f0b47['attrs'][0x4][_0x3633('0x64')]:undefined)||_0x3633('0x71')},{'name':_0x3633('0x72'),'value':_0x4f0b47[_0x3633('0x72')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x5]?_0x4f0b47['attrs'][0x5]['value']:undefined)||''},{'name':_0x3633('0x73'),'value':_0x4f0b47[_0x3633('0x73')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x6]?_0x4f0b47[_0x3633('0x63')][0x6]['value']:undefined)||''},{'name':_0x3633('0x74'),'value':_0x4f0b47[_0x3633('0x74')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47['attrs'][0x7]?_0x4f0b47[_0x3633('0x63')][0x7][_0x3633('0x64')]:undefined)||''},{'name':_0x3633('0x75'),'value':_0x4f0b47[_0x3633('0x75')]||(_0x4f0b47['attrs']&&_0x4f0b47[_0x3633('0x63')][0x8]?_0x4f0b47['attrs'][0x8][_0x3633('0x64')]:undefined)||''},{'name':_0x3633('0x76'),'value':_0x4f0b47[_0x3633('0x76')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47['attrs'][0x9]?_0x4f0b47['attrs'][0x9][_0x3633('0x64')]:undefined)||''},{'name':_0x3633('0x77'),'value':_0x4f0b47[_0x3633('0x77')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0xa]?_0x4f0b47[_0x3633('0x63')][0xa][_0x3633('0x64')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x4f0b47[_0x3633('0x7c')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x0]?_0x4f0b47[_0x3633('0x63')][0x0][_0x3633('0x3a')]:undefined)||null,'value':_0x4f0b47[_0x3633('0x7d')]||(_0x4f0b47['attrs']&&_0x4f0b47['attrs'][0x0]?_0x4f0b47[_0x3633('0x63')][0x0][_0x3633('0x64')]:undefined)||null},{'name':_0x3633('0x7e'),'value':_0x4f0b47[_0x3633('0x7e')]||(_0x4f0b47[_0x3633('0x63')]&&_0x4f0b47[_0x3633('0x63')][0x1]?_0x4f0b47['attrs'][0x1][_0x3633('0x64')]:undefined)||0x0}];default:return[];}}catch(_0x55813b){logger['error']('widgetAttributes:\x20%s',JSON[_0x3633('0x7f')](_0x55813b));return[];}}exports[_0x3633('0x80')]=function(_0x307565,_0x193223,_0xadb4aa){if(_0x307565[_0x3633('0x5f')]['id']){delete _0x307565[_0x3633('0x5f')]['id'];}return db[_0x3633('0x37')][_0x3633('0x53')]({'where':{'id':_0x307565[_0x3633('0x51')]['id']}})[_0x3633('0x2d')](handleEntityNotFound(_0x193223,null))[_0x3633('0x2d')](function(_0x13c9c9){if(_0x13c9c9){_0x307565['body'][_0x3633('0x81')]=_0x13c9c9['id'];_0x307565[_0x3633('0x5f')][_0x3633('0x63')]=widgetAttributes(_0x307565['body']);return db[_0x3633('0x82')][_0x3633('0x54')](_0x307565['body']);}})[_0x3633('0x2d')](respondWithResult(_0x193223,null))[_0x3633('0x60')](handleError(_0x193223,null));};exports[_0x3633('0x83')]=function(_0x34b74a,_0x5a296d,_0x4cac32){var _0x51ef35={};var _0x2c728d={};var _0x126543;var _0x219a15;return db[_0x3633('0x37')][_0x3633('0x84')]({'where':{'id':_0x34b74a[_0x3633('0x51')]['id']}})[_0x3633('0x2d')](handleEntityNotFound(_0x5a296d,null))[_0x3633('0x2d')](function(_0x3bb863){if(_0x3bb863){_0x126543=_0x3bb863;_0x2c728d[_0x3633('0x41')]=_[_0x3633('0x3c')](db[_0x3633('0x82')][_0x3633('0x38')]);_0x2c728d[_0x3633('0x3b')]=_[_0x3633('0x3c')](_0x34b74a[_0x3633('0x3b')]);_0x2c728d[_0x3633('0x47')]=_['intersection'](_0x2c728d[_0x3633('0x41')],_0x2c728d['query']);_0x51ef35[_0x3633('0x3e')]=_[_0x3633('0x3d')](_0x2c728d[_0x3633('0x41')],qs[_0x3633('0x3f')](_0x34b74a[_0x3633('0x3b')]['fields']));_0x51ef35[_0x3633('0x3e')]=_0x51ef35[_0x3633('0x3e')][_0x3633('0x40')]?_0x51ef35['attributes']:_0x2c728d['model'];_0x51ef35['order']=qs[_0x3633('0x45')](_0x34b74a[_0x3633('0x3b')][_0x3633('0x45')]);_0x51ef35[_0x3633('0x46')]=qs['filters'](_[_0x3633('0x48')](_0x34b74a[_0x3633('0x3b')],_0x2c728d[_0x3633('0x47')]));if(_0x34b74a[_0x3633('0x3b')][_0x3633('0x49')]){_0x51ef35[_0x3633('0x46')]=_['merge'](_0x51ef35[_0x3633('0x46')],{'$or':_[_0x3633('0x36')](_0x51ef35['attributes'],function(_0x50730e){var _0x9fb157={};_0x9fb157[_0x50730e]={'$like':'%'+_0x34b74a[_0x3633('0x3b')][_0x3633('0x49')]+'%'};return _0x9fb157;})});}_0x51ef35=_[_0x3633('0x4a')]({},_0x51ef35,_0x34b74a[_0x3633('0x4c')]);return _0x126543[_0x3633('0x83')](_0x51ef35);}})['then'](function(_0x2d63d2){if(_0x2d63d2){_0x219a15=_0x2d63d2[_0x3633('0x40')];if(!_0x34b74a['query'][_0x3633('0x42')](_0x3633('0x43'))){_0x51ef35[_0x3633('0x23')]=qs[_0x3633('0x23')](_0x34b74a[_0x3633('0x3b')][_0x3633('0x23')]);_0x51ef35[_0x3633('0x21')]=qs[_0x3633('0x21')](_0x34b74a[_0x3633('0x3b')][_0x3633('0x21')]);}return _0x126543[_0x3633('0x83')](_0x51ef35);}})['then'](function(_0x256526){if(_0x256526){return _0x256526?{'count':_0x219a15,'rows':_0x256526}:null;}})[_0x3633('0x2d')](respondWithResult(_0x5a296d,null))[_0x3633('0x60')](handleError(_0x5a296d,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 4d62b00..89cb4dc 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 _0xb899=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','Dashboard','save','update'];(function(_0x406c64,_0x219ec0){var _0x5f59ec=function(_0x37ac46){while(--_0x37ac46){_0x406c64['push'](_0x406c64['shift']());}};_0x5f59ec(++_0x219ec0);}(_0xb899,0x8b));var _0x9b89=function(_0x5efba1,_0x3d9361){_0x5efba1=_0x5efba1-0x0;var _0x336be6=_0xb899[_0x5efba1];return _0x336be6;};'use strict';var EventEmitter=require(_0x9b89('0x0'));var Dashboard=require(_0x9b89('0x1'))['db'][_0x9b89('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9b89('0x3'),'afterUpdate':_0x9b89('0x4'),'afterDestroy':_0x9b89('0x5')};function emitEvent(_0x281f5a){return function(_0x3afa4e,_0x477601,_0x28ac48){DashboardEvents[_0x9b89('0x6')](_0x281f5a+':'+_0x3afa4e['id'],_0x3afa4e);DashboardEvents['emit'](_0x281f5a,_0x3afa4e);_0x28ac48(null);};}for(var e in events){if(events[_0x9b89('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x9b89('0x8')]=DashboardEvents; \ No newline at end of file +var _0x263d=['exports','events','Dashboard','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x57067f,_0x4eaf79){var _0x59acb9=function(_0x4f3e27){while(--_0x4f3e27){_0x57067f['push'](_0x57067f['shift']());}};_0x59acb9(++_0x4eaf79);}(_0x263d,0x1d9));var _0xd263=function(_0x15a8fa,_0x4652b2){_0x15a8fa=_0x15a8fa-0x0;var _0x1355c2=_0x263d[_0x15a8fa];return _0x1355c2;};'use strict';var EventEmitter=require(_0xd263('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xd263('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd263('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd263('0x3'),'afterDestroy':_0xd263('0x4')};function emitEvent(_0x4a4c73){return function(_0x41c284,_0x1b6f66,_0x5a477e){DashboardEvents[_0xd263('0x5')](_0x4a4c73+':'+_0x41c284['id'],_0x41c284);DashboardEvents[_0xd263('0x5')](_0x4a4c73,_0x41c284);_0x5a477e(null);};}for(var e in events){if(events[_0xd263('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xd263('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 7da9b96..25ec328 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 _0xd00a=['exports','define','Dashboard','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./dashboard.attributes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd00a,0x1e3));var _0xad00=function(_0x4c5d84,_0x244cde){_0x4c5d84=_0x4c5d84-0x0;var _0x135396=_0xd00a[_0x4c5d84];return _0x135396;};'use strict';var _=require(_0xad00('0x0'));var util=require(_0xad00('0x1'));var logger=require(_0xad00('0x2'))('api');var moment=require(_0xad00('0x3'));var BPromise=require('bluebird');var rp=require(_0xad00('0x4'));var fs=require('fs');var path=require(_0xad00('0x5'));var rimraf=require(_0xad00('0x6'));var config=require(_0xad00('0x7'));var attributes=require(_0xad00('0x8'));module[_0xad00('0x9')]=function(_0x543bae,_0x375073){return _0x543bae[_0xad00('0xa')](_0xad00('0xb'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8dc7=['../../config/environment','define','Dashboard','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x427f38,_0x34f332){var _0x2f39d7=function(_0x593940){while(--_0x593940){_0x427f38['push'](_0x427f38['shift']());}};_0x2f39d7(++_0x34f332);}(_0x8dc7,0xf6));var _0x78dc=function(_0x107254,_0x2575e4){_0x107254=_0x107254-0x0;var _0x2d4e81=_0x8dc7[_0x107254];return _0x2d4e81;};'use strict';var _=require('lodash');var util=require(_0x78dc('0x0'));var logger=require(_0x78dc('0x1'))(_0x78dc('0x2'));var moment=require('moment');var BPromise=require(_0x78dc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x78dc('0x4'));var rimraf=require(_0x78dc('0x5'));var config=require(_0x78dc('0x6'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x4315d2,_0x8f3778){return _0x4315d2[_0x78dc('0x7')](_0x78dc('0x8'),attributes,{'tableName':'dashboards','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 d4a59b5..c28f273 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 _0xd29d=['error','code','message','info','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x4254a2,_0x263c50){var _0x36f1d8=function(_0xc93da6){while(--_0xc93da6){_0x4254a2['push'](_0x4254a2['shift']());}};_0x36f1d8(++_0x263c50);}(_0xd29d,0xa1));var _0xdd29=function(_0x565da4,_0x54150b){_0x565da4=_0x565da4-0x0;var _0x558e63=_0xd29d[_0x565da4];return _0x558e63;};'use strict';var _=require(_0xdd29('0x0'));var util=require('util');var moment=require(_0xdd29('0x1'));var BPromise=require(_0xdd29('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd29('0x3'))['db'];var utils=require(_0xdd29('0x4'));var logger=require(_0xdd29('0x5'))(_0xdd29('0x6'));var config=require(_0xdd29('0x7'));var jayson=require(_0xdd29('0x8'));var client=jayson[_0xdd29('0x9')]['http']({'port':0x232a});config[_0xdd29('0xa')]=_[_0xdd29('0xb')](config[_0xdd29('0xa')],{'host':_0xdd29('0xc'),'port':0x18eb});var socket=require(_0xdd29('0xd'))(new Redis(config[_0xdd29('0xa')]));require(_0xdd29('0xe'))[_0xdd29('0xf')](socket);function respondWithRpcPromise(_0x25b57c,_0x19905b,_0x216c5c){return new BPromise(function(_0x4c595d,_0x365329){return client[_0xdd29('0x10')](_0x25b57c,_0x216c5c)[_0xdd29('0x11')](function(_0x401a17){logger['info'](_0xdd29('0x12'),_0x19905b,'request\x20sent');logger[_0xdd29('0x13')](_0xdd29('0x14'),_0x19905b,'request\x20sent',JSON['stringify'](_0x401a17));if(_0x401a17[_0xdd29('0x15')]){if(_0x401a17['error'][_0xdd29('0x16')]===0x1f4){logger[_0xdd29('0x15')](_0xdd29('0x12'),_0x19905b,_0x401a17[_0xdd29('0x15')][_0xdd29('0x17')]);return _0x365329(_0x401a17[_0xdd29('0x15')][_0xdd29('0x17')]);}logger['error'](_0xdd29('0x12'),_0x19905b,_0x401a17[_0xdd29('0x15')]['message']);return _0x4c595d(_0x401a17[_0xdd29('0x15')][_0xdd29('0x17')]);}else{logger[_0xdd29('0x18')](_0xdd29('0x12'),_0x19905b,'request\x20sent');_0x4c595d(_0x401a17['result'][_0xdd29('0x17')]);}})[_0xdd29('0x19')](function(_0x5e3c4c){logger[_0xdd29('0x15')](_0xdd29('0x12'),_0x19905b,_0x5e3c4c);_0x365329(_0x5e3c4c);});});} \ No newline at end of file +var _0x7aa0=['../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./dashboard.socket','register','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x102b48,_0x1ffa36){var _0x1819c4=function(_0xc1c6dc){while(--_0xc1c6dc){_0x102b48['push'](_0x102b48['shift']());}};_0x1819c4(++_0x1ffa36);}(_0x7aa0,0xae));var _0x07aa=function(_0xc0af09,_0x2f16c4){_0xc0af09=_0xc0af09-0x0;var _0x40be9e=_0x7aa0[_0xc0af09];return _0x40be9e;};'use strict';var _=require(_0x07aa('0x0'));var util=require(_0x07aa('0x1'));var moment=require('moment');var BPromise=require(_0x07aa('0x2'));var rs=require(_0x07aa('0x3'));var fs=require('fs');var Redis=require(_0x07aa('0x4'));var db=require(_0x07aa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x07aa('0x6'))(_0x07aa('0x7'));var config=require(_0x07aa('0x8'));var jayson=require(_0x07aa('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x07aa('0xa')]=_[_0x07aa('0xb')](config[_0x07aa('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x07aa('0xc'))(new Redis(config[_0x07aa('0xa')]));require(_0x07aa('0xd'))[_0x07aa('0xe')](socket);function respondWithRpcPromise(_0x3d9a2e,_0x3c7c43,_0x4244d8){return new BPromise(function(_0x55275f,_0x2bdde3){return client['request'](_0x3d9a2e,_0x4244d8)[_0x07aa('0xf')](function(_0x396a3f){logger[_0x07aa('0x10')]('Dashboard,\x20%s,\x20%s',_0x3c7c43,_0x07aa('0x11'));logger[_0x07aa('0x12')](_0x07aa('0x13'),_0x3c7c43,_0x07aa('0x11'),JSON[_0x07aa('0x14')](_0x396a3f));if(_0x396a3f[_0x07aa('0x15')]){if(_0x396a3f[_0x07aa('0x15')][_0x07aa('0x16')]===0x1f4){logger[_0x07aa('0x15')](_0x07aa('0x17'),_0x3c7c43,_0x396a3f[_0x07aa('0x15')][_0x07aa('0x18')]);return _0x2bdde3(_0x396a3f[_0x07aa('0x15')]['message']);}logger['error'](_0x07aa('0x17'),_0x3c7c43,_0x396a3f[_0x07aa('0x15')][_0x07aa('0x18')]);return _0x55275f(_0x396a3f['error'][_0x07aa('0x18')]);}else{logger[_0x07aa('0x10')](_0x07aa('0x17'),_0x3c7c43,_0x07aa('0x11'));_0x55275f(_0x396a3f['result'][_0x07aa('0x18')]);}})[_0x07aa('0x19')](function(_0x314b12){logger['error'](_0x07aa('0x17'),_0x3c7c43,_0x314b12);_0x2bdde3(_0x314b12);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index b3518e5..83a774e 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 _0xb634=['./dashboard.events','save','remove','update','removeListener','length','dashboard:'];(function(_0x206fd7,_0x57a336){var _0x1ae6ad=function(_0x110b71){while(--_0x110b71){_0x206fd7['push'](_0x206fd7['shift']());}};_0x1ae6ad(++_0x57a336);}(_0xb634,0x181));var _0x4b63=function(_0xdc1218,_0x4b3819){_0xdc1218=_0xdc1218-0x0;var _0x42acf8=_0xb634[_0xdc1218];return _0x42acf8;};'use strict';var DashboardEvents=require(_0x4b63('0x0'));var events=[_0x4b63('0x1'),_0x4b63('0x2'),_0x4b63('0x3')];function createListener(_0x3ca933,_0x21e1c7){return function(_0x54fc1c){_0x21e1c7['emit'](_0x3ca933,_0x54fc1c);};}function removeListener(_0x51f1cb,_0xe68d4a){return function(){DashboardEvents[_0x4b63('0x4')](_0x51f1cb,_0xe68d4a);};}exports['register']=function(_0xa38f5b){for(var _0x3213b4=0x0,_0x18f8a9=events[_0x4b63('0x5')];_0x3213b4<_0x18f8a9;_0x3213b4++){var _0x3c5649=events[_0x3213b4];var _0x213440=createListener(_0x4b63('0x6')+_0x3c5649,_0xa38f5b);DashboardEvents['on'](_0x3c5649,_0x213440);}}; \ No newline at end of file +var _0x1c8a=['register','length','save','remove','update','emit'];(function(_0x511c8e,_0x1eef1d){var _0x4576f4=function(_0x30c685){while(--_0x30c685){_0x511c8e['push'](_0x511c8e['shift']());}};_0x4576f4(++_0x1eef1d);}(_0x1c8a,0x1c4));var _0xa1c8=function(_0x288949,_0x54a8c2){_0x288949=_0x288949-0x0;var _0x4e4953=_0x1c8a[_0x288949];return _0x4e4953;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xa1c8('0x0'),_0xa1c8('0x1'),_0xa1c8('0x2')];function createListener(_0x338590,_0x3991b5){return function(_0x19d927){_0x3991b5[_0xa1c8('0x3')](_0x338590,_0x19d927);};}function removeListener(_0x2783cd,_0x3dbe3b){return function(){DashboardEvents['removeListener'](_0x2783cd,_0x3dbe3b);};}exports[_0xa1c8('0x4')]=function(_0x4dda25){for(var _0x1b773f=0x0,_0xabf3c2=events[_0xa1c8('0x5')];_0x1b773f<_0xabf3c2;_0x1b773f++){var _0x38300d=events[_0x1b773f];var _0x543c79=createListener('dashboard:'+_0x38300d,_0x4dda25);DashboardEvents['on'](_0x38300d,_0x543c79);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 034b795..8c2b4dd 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 _0x3a69=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','create','/:id/clone','post','addItem','put','update','delete','exports','multer'];(function(_0xec612b,_0x2ee4eb){var _0x59e2a7=function(_0x59abba){while(--_0x59abba){_0xec612b['push'](_0xec612b['shift']());}};_0x59e2a7(++_0x2ee4eb);}(_0x3a69,0xa0));var _0x93a6=function(_0x134b6e,_0x21b5ca){_0x134b6e=_0x134b6e-0x0;var _0x2229a9=_0x3a69[_0x134b6e];return _0x2229a9;};'use strict';var multer=require(_0x93a6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x93a6('0x1'));var express=require(_0x93a6('0x2'));var router=express[_0x93a6('0x3')]();var fs_extra=require(_0x93a6('0x4'));var auth=require(_0x93a6('0x5'));var interaction=require(_0x93a6('0x6'));var config=require(_0x93a6('0x7'));var controller=require(_0x93a6('0x8'));router[_0x93a6('0x9')]('/',auth[_0x93a6('0xa')](),controller[_0x93a6('0xb')]);router[_0x93a6('0x9')](_0x93a6('0xc'),auth[_0x93a6('0xa')](),controller[_0x93a6('0xd')]);router[_0x93a6('0x9')](_0x93a6('0xe'),auth[_0x93a6('0xa')](),controller['getItems']);router['post']('/',auth[_0x93a6('0xa')](),controller[_0x93a6('0xf')]);router['post'](_0x93a6('0x10'),auth[_0x93a6('0xa')](),controller['clone']);router[_0x93a6('0x11')](_0x93a6('0xe'),auth['isAuthenticated'](),controller[_0x93a6('0x12')]);router[_0x93a6('0x13')](_0x93a6('0xc'),auth[_0x93a6('0xa')](),controller[_0x93a6('0x14')]);router[_0x93a6('0x15')](_0x93a6('0xc'),auth[_0x93a6('0xa')](),controller['destroy']);module[_0x93a6('0x16')]=router; \ No newline at end of file +var _0x1604=['addItem','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','getItems','post','create','clone','/:id/items'];(function(_0x15497f,_0x15ecb3){var _0x3dff4e=function(_0x539f9c){while(--_0x539f9c){_0x15497f['push'](_0x15497f['shift']());}};_0x3dff4e(++_0x15ecb3);}(_0x1604,0x8f));var _0x4160=function(_0x21985a,_0x16f53f){_0x21985a=_0x21985a-0x0;var _0x5b1fbc=_0x1604[_0x21985a];return _0x5b1fbc;};'use strict';var multer=require(_0x4160('0x0'));var util=require('util');var path=require(_0x4160('0x1'));var timeout=require(_0x4160('0x2'));var express=require(_0x4160('0x3'));var router=express[_0x4160('0x4')]();var fs_extra=require(_0x4160('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4160('0x6'));var config=require(_0x4160('0x7'));var controller=require(_0x4160('0x8'));router[_0x4160('0x9')]('/',auth[_0x4160('0xa')](),controller[_0x4160('0xb')]);router[_0x4160('0x9')](_0x4160('0xc'),auth[_0x4160('0xa')](),controller['show']);router[_0x4160('0x9')]('/:id/items',auth[_0x4160('0xa')](),controller[_0x4160('0xd')]);router[_0x4160('0xe')]('/',auth['isAuthenticated'](),controller[_0x4160('0xf')]);router[_0x4160('0xe')]('/:id/clone',auth[_0x4160('0xa')](),controller[_0x4160('0x10')]);router['post'](_0x4160('0x11'),auth[_0x4160('0xa')](),controller[_0x4160('0x12')]);router[_0x4160('0x13')](_0x4160('0xc'),auth[_0x4160('0xa')](),controller[_0x4160('0x14')]);router['delete'](_0x4160('0xc'),auth['isAuthenticated'](),controller[_0x4160('0x15')]);module[_0x4160('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 5ed8df4..56cdf30 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 _0x71ab=['setDataValue','stringify','INTEGER','#2196f3','squel','exports','STRING','TEXT','long','parse','getDataValue','attrs'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x71ab,0x64));var _0xb71a=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x71ab[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');var squel=require(_0xb71a('0x0'));var _=require('lodash');module[_0xb71a('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb71a('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb71a('0x3')](_0xb71a('0x4')),'get':function(){try{return JSON[_0xb71a('0x5')](this[_0xb71a('0x6')](_0xb71a('0x7')));}catch(_0x2192e8){return[];}},'set':function(_0x38d931){try{this[_0xb71a('0x8')](_0xb71a('0x7'),JSON[_0xb71a('0x9')](_0x38d931));}catch(_0x2a4c86){this[_0xb71a('0x8')](_0xb71a('0x7'),JSON[_0xb71a('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb71a('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb71a('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb71a('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb71a('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb71a('0x2')],'allowNull':![],'defaultValue':_0xb71a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb71a('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x2bd8=['TEXT','long','parse','attrs','stringify','setDataValue','INTEGER','sequelize','lodash','exports','STRING'];(function(_0x3d9522,_0x66b774){var _0x173345=function(_0x40c1a7){while(--_0x40c1a7){_0x3d9522['push'](_0x3d9522['shift']());}};_0x173345(++_0x66b774);}(_0x2bd8,0x130));var _0x82bd=function(_0x3c1681,_0x5dec92){_0x3c1681=_0x3c1681-0x0;var _0x322997=_0x2bd8[_0x3c1681];return _0x322997;};'use strict';var Sequelize=require(_0x82bd('0x0'));var squel=require('squel');var _=require(_0x82bd('0x1'));module[_0x82bd('0x2')]={'title':{'type':Sequelize[_0x82bd('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x82bd('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x82bd('0x4')](_0x82bd('0x5')),'get':function(){try{return JSON[_0x82bd('0x6')](this['getDataValue'](_0x82bd('0x7')));}catch(_0x2e1a98){return[];}},'set':function(_0x3bf810){try{this['setDataValue'](_0x82bd('0x7'),JSON[_0x82bd('0x8')](_0x3bf810));}catch(_0x226f60){this[_0x82bd('0x9')]('attrs',JSON[_0x82bd('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x82bd('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x82bd('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x82bd('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 6ed7d42..701d148 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 _0xdbcd=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','end','undefined','count','offset','status','Content-Range','json','reject','save','destroy','then','sendStatus','stack','name','show','params','model','keys','DashboardItem','rawAttributes','filters','intersection','query','attributes','fields','includeAll','merge','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChannel','attrChatWebsites','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','find','eml-format','rimraf','request-promise','moment','bluebird','util','path','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdbcd,0x1ba));var _0xddbc=function(_0x1e9816,_0x11bef5){_0x1e9816=_0x1e9816-0x0;var _0x41e572=_0xdbcd[_0x1e9816];return _0x41e572;};'use strict';var emlformat=require(_0xddbc('0x0'));var rimraf=require(_0xddbc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xddbc('0x2'));var moment=require(_0xddbc('0x3'));var BPromise=require(_0xddbc('0x4'));var Mustache=require('mustache');var util=require(_0xddbc('0x5'));var path=require(_0xddbc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xddbc('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xddbc('0x8'));var toCsv=require(_0xddbc('0x9'));var querystring=require(_0xddbc('0xa'));var Papa=require(_0xddbc('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xddbc('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddbc('0xd'));var logger=require('../../config/logger')(_0xddbc('0xe'));var utils=require(_0xddbc('0xf'));var config=require(_0xddbc('0x10'));var licenseUtil=require(_0xddbc('0x11'));var db=require(_0xddbc('0x12'))['db'];config[_0xddbc('0x13')]=_[_0xddbc('0x14')](config[_0xddbc('0x13')],{'host':_0xddbc('0x15'),'port':0x18eb});var socket=require(_0xddbc('0x16'))(new Redis(config[_0xddbc('0x13')]));require(_0xddbc('0x17'))['register'](socket);function respondWithStatusCode(_0x57c81f,_0x45d556){_0x45d556=_0x45d556||0xcc;return function(_0x4453bf){if(_0x4453bf){return _0x57c81f['sendStatus'](_0x45d556);}return _0x57c81f['status'](_0x45d556)[_0xddbc('0x18')]();};}function respondWithResult(_0x2d4a9b,_0x2d366d){_0x2d366d=_0x2d366d||0xc8;return function(_0x19f977){if(_0x19f977){return _0x2d4a9b['status'](_0x2d366d)['json'](_0x19f977);}};}function respondWithFilteredResult(_0x356afe,_0x193c84){return function(_0x5d0a34){if(_0x5d0a34){var _0x48efdb=typeof _0x193c84['offset']===_0xddbc('0x19')&&typeof _0x193c84['limit']===_0xddbc('0x19');var _0xedd271=_0x5d0a34[_0xddbc('0x1a')];var _0x118569=_0x48efdb?0x0:_0x193c84[_0xddbc('0x1b')];var _0x114fc7=_0x48efdb?_0x5d0a34['count']:_0x193c84[_0xddbc('0x1b')]+_0x193c84['limit'];var _0x52426a;if(_0x114fc7>=_0xedd271){_0x114fc7=_0xedd271;_0x52426a=0xc8;}else{_0x52426a=0xce;}_0x356afe[_0xddbc('0x1c')](_0x52426a);return _0x356afe['set'](_0xddbc('0x1d'),_0x118569+'-'+_0x114fc7+'/'+_0xedd271)[_0xddbc('0x1e')](_0x5d0a34);}return null;};}function patchUpdates(_0x1cac88){return function(_0xa5a3a0){try{jsonpatch['apply'](_0xa5a3a0,_0x1cac88,!![]);}catch(_0x1e677a){return BPromise[_0xddbc('0x1f')](_0x1e677a);}return _0xa5a3a0[_0xddbc('0x20')]();};}function saveUpdates(_0x1d44a7,_0x328316){return function(_0x57eb60){if(_0x57eb60){return _0x57eb60['update'](_0x1d44a7)['then'](function(_0x302120){return _0x302120;});}return null;};}function removeEntity(_0x2f58cd,_0x2db65f){return function(_0x37c6f5){if(_0x37c6f5){return _0x37c6f5[_0xddbc('0x21')]()[_0xddbc('0x22')](function(){_0x2f58cd[_0xddbc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a7e0b,_0x136f64){return function(_0x12bf5b){if(!_0x12bf5b){_0x2a7e0b[_0xddbc('0x23')](0x194);}return _0x12bf5b;};}function handleError(_0x3b1f06,_0xb4f6f5){_0xb4f6f5=_0xb4f6f5||0x1f4;return function(_0x16a720){logger['error'](_0x16a720[_0xddbc('0x24')]);if(_0x16a720[_0xddbc('0x25')]){delete _0x16a720[_0xddbc('0x25')];}_0x3b1f06[_0xddbc('0x1c')](_0xb4f6f5)['send'](_0x16a720);};}exports[_0xddbc('0x26')]=function(_0x56042c,_0x49cc11){var _0x95a9c6={'raw':![],'where':{'id':_0x56042c[_0xddbc('0x27')]['id']}},_0x4d6329={};_0x4d6329[_0xddbc('0x28')]=_[_0xddbc('0x29')](db[_0xddbc('0x2a')][_0xddbc('0x2b')]);_0x4d6329['query']=_[_0xddbc('0x29')](_0x56042c['query']);_0x4d6329[_0xddbc('0x2c')]=_[_0xddbc('0x2d')](_0x4d6329[_0xddbc('0x28')],_0x4d6329[_0xddbc('0x2e')]);_0x95a9c6[_0xddbc('0x2f')]=_[_0xddbc('0x2d')](_0x4d6329[_0xddbc('0x28')],qs[_0xddbc('0x30')](_0x56042c['query'][_0xddbc('0x30')]));_0x95a9c6[_0xddbc('0x2f')]=_0x95a9c6[_0xddbc('0x2f')]['length']?_0x95a9c6[_0xddbc('0x2f')]:_0x4d6329['model'];if(_0x56042c[_0xddbc('0x2e')][_0xddbc('0x31')]){_0x95a9c6['include']=[{'all':!![]}];}_0x95a9c6=_[_0xddbc('0x32')]({},_0x95a9c6,_0x56042c['options']);return db[_0xddbc('0x2a')]['find'](_0x95a9c6)['then'](handleEntityNotFound(_0x49cc11,null))[_0xddbc('0x22')](respondWithResult(_0x49cc11,null))['catch'](handleError(_0x49cc11,null));};exports['destroy']=function(_0x457fe8,_0x8d2fbd){return db[_0xddbc('0x2a')]['find']({'where':{'id':_0x457fe8['params']['id']}})[_0xddbc('0x22')](handleEntityNotFound(_0x8d2fbd,null))['then'](removeEntity(_0x8d2fbd,null))[_0xddbc('0x33')](handleError(_0x8d2fbd,null));};function widgetAttributes(_0x217c99){try{switch(_0x217c99[_0xddbc('0x34')]){case _0xddbc('0x35'):return[{'name':_0xddbc('0x36'),'value':_0x217c99[_0xddbc('0x36')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x0]?_0x217c99[_0xddbc('0x37')][0x0][_0xddbc('0x38')]:undefined)||_0xddbc('0x39')}];case _0xddbc('0x3a'):return[{'name':_0xddbc('0x3b'),'value':_0x217c99[_0xddbc('0x3b')]||(_0x217c99['attrs']&&_0x217c99[_0xddbc('0x37')][0x0]?_0x217c99[_0xddbc('0x37')][0x0][_0xddbc('0x38')]:undefined)||''}];case _0xddbc('0x3c'):return[{'name':_0xddbc('0x3d'),'value':_0x217c99['attrHourFormat']||(_0x217c99['attrs']&&_0x217c99[_0xddbc('0x37')][0x0]?_0x217c99[_0xddbc('0x37')][0x0][_0xddbc('0x38')]:undefined)||_0xddbc('0x3e')},{'name':'attrTimezone','value':_0x217c99[_0xddbc('0x3f')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x1]?_0x217c99[_0xddbc('0x37')][0x1][_0xddbc('0x38')]:undefined)||_0xddbc('0x40')},{'name':_0xddbc('0x41'),'value':_0x217c99[_0xddbc('0x41')]||(_0x217c99['attrs']&&_0x217c99[_0xddbc('0x37')][0x2]?_0x217c99[_0xddbc('0x37')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0xddbc('0x42'),'value':_0x217c99[_0xddbc('0x42')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x0]?_0x217c99[_0xddbc('0x37')][0x0]['value']:undefined)||_0xddbc('0x43')},{'name':'attrVoiceQueues','value':_0x217c99[_0xddbc('0x44')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99['attrs'][0x1]?_0x217c99[_0xddbc('0x37')][0x1][_0xddbc('0x38')]:undefined)||[]},{'name':_0xddbc('0x41'),'value':_0x217c99['attrFontSize']||(_0x217c99['attrs']&&_0x217c99['attrs'][0x2]?_0x217c99[_0xddbc('0x37')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x217c99['attrChannel']||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x3]?_0x217c99[_0xddbc('0x37')][0x3][_0xddbc('0x38')]:undefined)||_0xddbc('0x45')},{'name':_0xddbc('0x46'),'value':_0x217c99[_0xddbc('0x46')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x4]?_0x217c99['attrs'][0x4][_0xddbc('0x38')]:undefined)||''},{'name':_0xddbc('0x47'),'value':_0x217c99[_0xddbc('0x47')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99['attrs'][0x5]?_0x217c99[_0xddbc('0x37')][0x5][_0xddbc('0x38')]:undefined)||''},{'name':_0xddbc('0x48'),'value':_0x217c99['attrSmsAccounts']||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x6]?_0x217c99[_0xddbc('0x37')][0x6][_0xddbc('0x38')]:undefined)||''},{'name':_0xddbc('0x49'),'value':_0x217c99['attrOpenchannelAccounts']||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x7]?_0x217c99[_0xddbc('0x37')][0x7]['value']:undefined)||''},{'name':_0xddbc('0x4a'),'value':_0x217c99[_0xddbc('0x4a')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x8]?_0x217c99[_0xddbc('0x37')][0x8][_0xddbc('0x38')]:undefined)||''},{'name':'attrChatWebsites','value':_0x217c99['attrChatWebsites']||(_0x217c99[_0xddbc('0x37')]&&_0x217c99['attrs'][0x9]?_0x217c99[_0xddbc('0x37')][0x9][_0xddbc('0x38')]:undefined)||''}];case _0xddbc('0x4b'):case _0xddbc('0x4c'):return[{'name':'attrSerie1','value':_0x217c99[_0xddbc('0x4d')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x0]?_0x217c99[_0xddbc('0x37')][0x0]['value']:undefined)||_0xddbc('0x43')},{'name':_0xddbc('0x4e'),'value':_0x217c99[_0xddbc('0x4e')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x1]?_0x217c99[_0xddbc('0x37')][0x1][_0xddbc('0x38')]:undefined)||null},{'name':'attrSerie3','value':_0x217c99[_0xddbc('0x4f')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x2]?_0x217c99[_0xddbc('0x37')][0x2]['value']:undefined)||null},{'name':_0xddbc('0x44'),'value':_0x217c99[_0xddbc('0x44')]||(_0x217c99['attrs']&&_0x217c99[_0xddbc('0x37')][0x3]?_0x217c99[_0xddbc('0x37')][0x3][_0xddbc('0x38')]:undefined)||[]},{'name':_0xddbc('0x50'),'value':_0x217c99[_0xddbc('0x50')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99['attrs'][0x4]?_0x217c99[_0xddbc('0x37')][0x4][_0xddbc('0x38')]:undefined)||'voice'},{'name':_0xddbc('0x46'),'value':_0x217c99[_0xddbc('0x46')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x5]?_0x217c99[_0xddbc('0x37')][0x5]['value']:undefined)||''},{'name':_0xddbc('0x47'),'value':_0x217c99[_0xddbc('0x47')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x6]?_0x217c99[_0xddbc('0x37')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x217c99[_0xddbc('0x48')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x7]?_0x217c99[_0xddbc('0x37')][0x7]['value']:undefined)||''},{'name':_0xddbc('0x49'),'value':_0x217c99['attrOpenchannelAccounts']||(_0x217c99[_0xddbc('0x37')]&&_0x217c99['attrs'][0x8]?_0x217c99['attrs'][0x8][_0xddbc('0x38')]:undefined)||''},{'name':_0xddbc('0x4a'),'value':_0x217c99[_0xddbc('0x4a')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0x9]?_0x217c99[_0xddbc('0x37')][0x9]['value']:undefined)||''},{'name':_0xddbc('0x51'),'value':_0x217c99[_0xddbc('0x51')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99[_0xddbc('0x37')][0xa]?_0x217c99['attrs'][0xa]['value']:undefined)||''}];case _0xddbc('0x52'):return[{'name':_0xddbc('0x53'),'type':_0x217c99[_0xddbc('0x54')]||(_0x217c99[_0xddbc('0x37')]&&_0x217c99['attrs'][0x0]?_0x217c99[_0xddbc('0x37')][0x0][_0xddbc('0x34')]:undefined)||null,'value':_0x217c99[_0xddbc('0x53')]||(_0x217c99['attrs']&&_0x217c99[_0xddbc('0x37')][0x0]?_0x217c99[_0xddbc('0x37')][0x0]['value']:undefined)||null},{'name':_0xddbc('0x55'),'value':_0x217c99[_0xddbc('0x55')]||(_0x217c99['attrs']&&_0x217c99['attrs'][0x1]?_0x217c99['attrs'][0x1][_0xddbc('0x38')]:undefined)||0x0}];default:return[];}}catch(_0x1959e0){logger['error'](_0xddbc('0x56'),JSON[_0xddbc('0x57')](_0x1959e0));return[];}}exports[_0xddbc('0x58')]=function(_0x5e9a01,_0x2a1060){if(_0x5e9a01['body']){_0x5e9a01[_0xddbc('0x59')]['attrs']=widgetAttributes(_0x5e9a01[_0xddbc('0x59')]);}return db[_0xddbc('0x2a')][_0xddbc('0x58')](_0x5e9a01[_0xddbc('0x59')],{})['then'](respondWithResult(_0x2a1060,0xc9))[_0xddbc('0x33')](handleError(_0x2a1060,null));};exports[_0xddbc('0x5a')]=function(_0x294fda,_0xda1c23){if(_0x294fda[_0xddbc('0x59')]['id']){delete _0x294fda[_0xddbc('0x59')]['id'];}_0x294fda['body'][_0xddbc('0x37')]=widgetAttributes(_0x294fda['body']);return db['DashboardItem'][_0xddbc('0x5b')]({'where':{'id':_0x294fda[_0xddbc('0x27')]['id']}})[_0xddbc('0x22')](handleEntityNotFound(_0xda1c23,null))[_0xddbc('0x22')](saveUpdates(_0x294fda[_0xddbc('0x59')],null))[_0xddbc('0x22')](respondWithResult(_0xda1c23,null))[_0xddbc('0x33')](handleError(_0xda1c23,null));}; \ No newline at end of file +var _0xc14a=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','./dashboardItem.socket','register','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','params','keys','rawAttributes','query','intersection','model','attributes','length','includeAll','include','options','DashboardItem','catch','find','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrOpenchannelAccounts','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x4a9230,_0x4d5b6d){var _0x3b8b95=function(_0x436419){while(--_0x436419){_0x4a9230['push'](_0x4a9230['shift']());}};_0x3b8b95(++_0x4d5b6d);}(_0xc14a,0xa9));var _0xac14=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc14a[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xac14('0x0'));var rimraf=require(_0xac14('0x1'));var zipdir=require(_0xac14('0x2'));var jsonpatch=require(_0xac14('0x3'));var rp=require(_0xac14('0x4'));var moment=require('moment');var BPromise=require(_0xac14('0x5'));var Mustache=require(_0xac14('0x6'));var util=require('util');var path=require(_0xac14('0x7'));var sox=require('sox');var csv=require(_0xac14('0x8'));var ejs=require(_0xac14('0x9'));var fs=require('fs');var fs_extra=require(_0xac14('0xa'));var _=require('lodash');var squel=require(_0xac14('0xb'));var crypto=require(_0xac14('0xc'));var jsforce=require(_0xac14('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xac14('0x8'));var querystring=require(_0xac14('0xe'));var Papa=require(_0xac14('0xf'));var Redis=require(_0xac14('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xac14('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac14('0x12'));var logger=require(_0xac14('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xac14('0x14'));var licenseUtil=require(_0xac14('0x15'));var db=require('../../mysqldb')['db'];config[_0xac14('0x16')]=_[_0xac14('0x17')](config['redis'],{'host':_0xac14('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac14('0x16')]));require(_0xac14('0x19'))[_0xac14('0x1a')](socket);function respondWithStatusCode(_0x5a80ed,_0x5365ad){_0x5365ad=_0x5365ad||0xcc;return function(_0xfcb961){if(_0xfcb961){return _0x5a80ed['sendStatus'](_0x5365ad);}return _0x5a80ed[_0xac14('0x1b')](_0x5365ad)['end']();};}function respondWithResult(_0x270284,_0x19edc6){_0x19edc6=_0x19edc6||0xc8;return function(_0x1023e2){if(_0x1023e2){return _0x270284[_0xac14('0x1b')](_0x19edc6)[_0xac14('0x1c')](_0x1023e2);}};}function respondWithFilteredResult(_0x4d7f22,_0xfc781a){return function(_0x219ee6){if(_0x219ee6){var _0x39a6e8=typeof _0xfc781a[_0xac14('0x1d')]===_0xac14('0x1e')&&typeof _0xfc781a[_0xac14('0x1f')]===_0xac14('0x1e');var _0x572d08=_0x219ee6[_0xac14('0x20')];var _0x26bf1c=_0x39a6e8?0x0:_0xfc781a[_0xac14('0x1d')];var _0xea146=_0x39a6e8?_0x219ee6[_0xac14('0x20')]:_0xfc781a['offset']+_0xfc781a['limit'];var _0x1cbb67;if(_0xea146>=_0x572d08){_0xea146=_0x572d08;_0x1cbb67=0xc8;}else{_0x1cbb67=0xce;}_0x4d7f22[_0xac14('0x1b')](_0x1cbb67);return _0x4d7f22['set'](_0xac14('0x21'),_0x26bf1c+'-'+_0xea146+'/'+_0x572d08)['json'](_0x219ee6);}return null;};}function patchUpdates(_0x528406){return function(_0x5bb4f7){try{jsonpatch[_0xac14('0x22')](_0x5bb4f7,_0x528406,!![]);}catch(_0x4c6580){return BPromise[_0xac14('0x23')](_0x4c6580);}return _0x5bb4f7[_0xac14('0x24')]();};}function saveUpdates(_0x272b46,_0x331edb){return function(_0x4ce169){if(_0x4ce169){return _0x4ce169[_0xac14('0x25')](_0x272b46)['then'](function(_0x186a10){return _0x186a10;});}return null;};}function removeEntity(_0xa2c069,_0x536eb3){return function(_0xeb26c2){if(_0xeb26c2){return _0xeb26c2[_0xac14('0x26')]()[_0xac14('0x27')](function(){_0xa2c069[_0xac14('0x1b')](0xcc)[_0xac14('0x28')]();});}};}function handleEntityNotFound(_0x2df2b8,_0x5d033d){return function(_0xc7dd39){if(!_0xc7dd39){_0x2df2b8['sendStatus'](0x194);}return _0xc7dd39;};}function handleError(_0x492011,_0x52973f){_0x52973f=_0x52973f||0x1f4;return function(_0x23a5b3){logger[_0xac14('0x29')](_0x23a5b3[_0xac14('0x2a')]);if(_0x23a5b3['name']){delete _0x23a5b3['name'];}_0x492011['status'](_0x52973f)['send'](_0x23a5b3);};}exports['show']=function(_0x47621c,_0x568024){var _0x169066={'raw':![],'where':{'id':_0x47621c[_0xac14('0x2b')]['id']}},_0x464ae9={};_0x464ae9['model']=_[_0xac14('0x2c')](db['DashboardItem'][_0xac14('0x2d')]);_0x464ae9[_0xac14('0x2e')]=_[_0xac14('0x2c')](_0x47621c[_0xac14('0x2e')]);_0x464ae9['filters']=_[_0xac14('0x2f')](_0x464ae9[_0xac14('0x30')],_0x464ae9[_0xac14('0x2e')]);_0x169066[_0xac14('0x31')]=_[_0xac14('0x2f')](_0x464ae9[_0xac14('0x30')],qs['fields'](_0x47621c['query']['fields']));_0x169066[_0xac14('0x31')]=_0x169066[_0xac14('0x31')][_0xac14('0x32')]?_0x169066[_0xac14('0x31')]:_0x464ae9['model'];if(_0x47621c[_0xac14('0x2e')][_0xac14('0x33')]){_0x169066[_0xac14('0x34')]=[{'all':!![]}];}_0x169066=_['merge']({},_0x169066,_0x47621c[_0xac14('0x35')]);return db[_0xac14('0x36')]['find'](_0x169066)['then'](handleEntityNotFound(_0x568024,null))['then'](respondWithResult(_0x568024,null))[_0xac14('0x37')](handleError(_0x568024,null));};exports[_0xac14('0x26')]=function(_0x372000,_0x239f3d){return db[_0xac14('0x36')][_0xac14('0x38')]({'where':{'id':_0x372000[_0xac14('0x2b')]['id']}})[_0xac14('0x27')](handleEntityNotFound(_0x239f3d,null))['then'](removeEntity(_0x239f3d,null))[_0xac14('0x37')](handleError(_0x239f3d,null));};function widgetAttributes(_0x215381){try{switch(_0x215381['type']){case _0xac14('0x39'):return[{'name':_0xac14('0x3a'),'value':_0x215381[_0xac14('0x3a')]||(_0x215381[_0xac14('0x3b')]&&_0x215381['attrs'][0x0]?_0x215381[_0xac14('0x3b')][0x0][_0xac14('0x3c')]:undefined)||_0xac14('0x3d')}];case _0xac14('0x3e'):return[{'name':_0xac14('0x3f'),'value':_0x215381['attrPath']||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x0]?_0x215381[_0xac14('0x3b')][0x0][_0xac14('0x3c')]:undefined)||''}];case'clock':return[{'name':_0xac14('0x40'),'value':_0x215381['attrHourFormat']||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x0]?_0x215381[_0xac14('0x3b')][0x0][_0xac14('0x3c')]:undefined)||_0xac14('0x41')},{'name':_0xac14('0x42'),'value':_0x215381[_0xac14('0x42')]||(_0x215381['attrs']&&_0x215381[_0xac14('0x3b')][0x1]?_0x215381[_0xac14('0x3b')][0x1][_0xac14('0x3c')]:undefined)||'0.00'},{'name':_0xac14('0x43'),'value':_0x215381[_0xac14('0x43')]||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x2]?_0x215381[_0xac14('0x3b')][0x2][_0xac14('0x3c')]:undefined)||0xc}];case _0xac14('0x44'):return[{'name':'attrMetric','value':_0x215381[_0xac14('0x45')]||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x0]?_0x215381[_0xac14('0x3b')][0x0]['value']:undefined)||'total'},{'name':_0xac14('0x46'),'value':_0x215381[_0xac14('0x46')]||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x1]?_0x215381[_0xac14('0x3b')][0x1]['value']:undefined)||[]},{'name':_0xac14('0x43'),'value':_0x215381[_0xac14('0x43')]||(_0x215381['attrs']&&_0x215381[_0xac14('0x3b')][0x2]?_0x215381[_0xac14('0x3b')][0x2]['value']:undefined)||0x14},{'name':_0xac14('0x47'),'value':_0x215381['attrChannel']||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x3]?_0x215381[_0xac14('0x3b')][0x3][_0xac14('0x3c')]:undefined)||_0xac14('0x48')},{'name':_0xac14('0x49'),'value':_0x215381[_0xac14('0x49')]||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x4]?_0x215381[_0xac14('0x3b')][0x4][_0xac14('0x3c')]:undefined)||''},{'name':_0xac14('0x4a'),'value':_0x215381[_0xac14('0x4a')]||(_0x215381['attrs']&&_0x215381[_0xac14('0x3b')][0x5]?_0x215381[_0xac14('0x3b')][0x5][_0xac14('0x3c')]:undefined)||''},{'name':_0xac14('0x4b'),'value':_0x215381[_0xac14('0x4b')]||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x6]?_0x215381[_0xac14('0x3b')][0x6][_0xac14('0x3c')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x215381['attrOpenchannelAccounts']||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x7]?_0x215381[_0xac14('0x3b')][0x7]['value']:undefined)||''},{'name':_0xac14('0x4c'),'value':_0x215381[_0xac14('0x4c')]||(_0x215381[_0xac14('0x3b')]&&_0x215381['attrs'][0x8]?_0x215381[_0xac14('0x3b')][0x8][_0xac14('0x3c')]:undefined)||''},{'name':'attrChatWebsites','value':_0x215381[_0xac14('0x4d')]||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x9]?_0x215381['attrs'][0x9][_0xac14('0x3c')]:undefined)||''}];case _0xac14('0x4e'):case _0xac14('0x4f'):return[{'name':_0xac14('0x50'),'value':_0x215381[_0xac14('0x50')]||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x0]?_0x215381[_0xac14('0x3b')][0x0][_0xac14('0x3c')]:undefined)||_0xac14('0x51')},{'name':_0xac14('0x52'),'value':_0x215381[_0xac14('0x52')]||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x1]?_0x215381[_0xac14('0x3b')][0x1][_0xac14('0x3c')]:undefined)||null},{'name':_0xac14('0x53'),'value':_0x215381[_0xac14('0x53')]||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x2]?_0x215381[_0xac14('0x3b')][0x2][_0xac14('0x3c')]:undefined)||null},{'name':_0xac14('0x46'),'value':_0x215381[_0xac14('0x46')]||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x3]?_0x215381[_0xac14('0x3b')][0x3][_0xac14('0x3c')]:undefined)||[]},{'name':_0xac14('0x47'),'value':_0x215381['attrChannel']||(_0x215381[_0xac14('0x3b')]&&_0x215381['attrs'][0x4]?_0x215381[_0xac14('0x3b')][0x4][_0xac14('0x3c')]:undefined)||'voice'},{'name':_0xac14('0x49'),'value':_0x215381[_0xac14('0x49')]||(_0x215381['attrs']&&_0x215381[_0xac14('0x3b')][0x5]?_0x215381[_0xac14('0x3b')][0x5][_0xac14('0x3c')]:undefined)||''},{'name':_0xac14('0x4a'),'value':_0x215381[_0xac14('0x4a')]||(_0x215381[_0xac14('0x3b')]&&_0x215381['attrs'][0x6]?_0x215381['attrs'][0x6][_0xac14('0x3c')]:undefined)||''},{'name':_0xac14('0x4b'),'value':_0x215381['attrSmsAccounts']||(_0x215381['attrs']&&_0x215381[_0xac14('0x3b')][0x7]?_0x215381[_0xac14('0x3b')][0x7]['value']:undefined)||''},{'name':_0xac14('0x54'),'value':_0x215381[_0xac14('0x54')]||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x8]?_0x215381[_0xac14('0x3b')][0x8]['value']:undefined)||''},{'name':_0xac14('0x4c'),'value':_0x215381['attrWhatsappAccounts']||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x9]?_0x215381[_0xac14('0x3b')][0x9][_0xac14('0x3c')]:undefined)||''},{'name':_0xac14('0x4d'),'value':_0x215381[_0xac14('0x4d')]||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0xa]?_0x215381['attrs'][0xa][_0xac14('0x3c')]:undefined)||''}];case'web-report':return[{'name':_0xac14('0x55'),'type':_0x215381[_0xac14('0x56')]||(_0x215381['attrs']&&_0x215381['attrs'][0x0]?_0x215381[_0xac14('0x3b')][0x0][_0xac14('0x57')]:undefined)||null,'value':_0x215381['attrReport']||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x0]?_0x215381[_0xac14('0x3b')][0x0]['value']:undefined)||null},{'name':_0xac14('0x58'),'value':_0x215381[_0xac14('0x58')]||(_0x215381[_0xac14('0x3b')]&&_0x215381[_0xac14('0x3b')][0x1]?_0x215381['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x59d097){logger[_0xac14('0x29')](_0xac14('0x59'),JSON[_0xac14('0x5a')](_0x59d097));return[];}}exports[_0xac14('0x5b')]=function(_0x1af43a,_0x2e6a8b){if(_0x1af43a[_0xac14('0x5c')]){_0x1af43a['body'][_0xac14('0x3b')]=widgetAttributes(_0x1af43a[_0xac14('0x5c')]);}return db[_0xac14('0x36')][_0xac14('0x5b')](_0x1af43a['body'],{})[_0xac14('0x27')](respondWithResult(_0x2e6a8b,0xc9))['catch'](handleError(_0x2e6a8b,null));};exports['update']=function(_0x303f4e,_0x35e01a){if(_0x303f4e['body']['id']){delete _0x303f4e[_0xac14('0x5c')]['id'];}_0x303f4e[_0xac14('0x5c')][_0xac14('0x3b')]=widgetAttributes(_0x303f4e['body']);return db['DashboardItem']['find']({'where':{'id':_0x303f4e[_0xac14('0x2b')]['id']}})[_0xac14('0x27')](handleEntityNotFound(_0x35e01a,null))[_0xac14('0x27')](saveUpdates(_0x303f4e[_0xac14('0x5c')],null))[_0xac14('0x27')](respondWithResult(_0x35e01a,null))[_0xac14('0x37')](handleError(_0x35e01a,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 998e909..7583481 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 _0xf5af=['save','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x3cc6d3,_0x23e575){var _0x70229d=function(_0x3a1ec1){while(--_0x3a1ec1){_0x3cc6d3['push'](_0x3cc6d3['shift']());}};_0x70229d(++_0x23e575);}(_0xf5af,0xb4));var _0xff5a=function(_0x2e8242,_0xdd7c17){_0x2e8242=_0x2e8242-0x0;var _0x910da8=_0xf5af[_0x2e8242];return _0x910da8;};'use strict';var EventEmitter=require(_0xff5a('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xff5a('0x1')](0x0);var events={'afterCreate':_0xff5a('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1ab44c){return function(_0x2998f3,_0x1b09af,_0x588a37){DashboardItemEvents[_0xff5a('0x3')](_0x1ab44c+':'+_0x2998f3['id'],_0x2998f3);DashboardItemEvents[_0xff5a('0x3')](_0x1ab44c,_0x2998f3);_0x588a37(null);};}for(var e in events){if(events[_0xff5a('0x4')](e)){var event=events[e];DashboardItem[_0xff5a('0x5')](e,emitEvent(event));}}module[_0xff5a('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0xbb2e=['hasOwnProperty','hook','exports','../../mysqldb','DashboardItem','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb2e,0xc3));var _0xebb2=function(_0x56a5e1,_0x420051){_0x56a5e1=_0x56a5e1-0x0;var _0x484fa7=_0xbb2e[_0x56a5e1];return _0x484fa7;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xebb2('0x0'))['db'][_0xebb2('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xebb2('0x2'),'afterUpdate':_0xebb2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4d461c){return function(_0x12dc68,_0x7cf658,_0x1cb412){DashboardItemEvents[_0xebb2('0x4')](_0x4d461c+':'+_0x12dc68['id'],_0x12dc68);DashboardItemEvents[_0xebb2('0x4')](_0x4d461c,_0x12dc68);_0x1cb412(null);};}for(var e in events){if(events[_0xebb2('0x5')](e)){var event=events[e];DashboardItem[_0xebb2('0x6')](e,emitEvent(event));}}module[_0xebb2('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 da1bf07..476b838 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 _0x2c2b=['dashboard_items','util','../../config/logger','api','request-promise','rimraf','exports','define','DashboardItem'];(function(_0x510cd9,_0x551300){var _0x2b1f61=function(_0x345249){while(--_0x345249){_0x510cd9['push'](_0x510cd9['shift']());}};_0x2b1f61(++_0x551300);}(_0x2c2b,0x1b1));var _0xb2c2=function(_0x5ca927,_0x38c385){_0x5ca927=_0x5ca927-0x0;var _0x1eb900=_0x2c2b[_0x5ca927];return _0x1eb900;};'use strict';var _=require('lodash');var util=require(_0xb2c2('0x0'));var logger=require(_0xb2c2('0x1'))(_0xb2c2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb2c2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb2c2('0x4'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0xb2c2('0x5')]=function(_0x103254,_0x5d42f4){return _0x103254[_0xb2c2('0x6')](_0xb2c2('0x7'),attributes,{'tableName':_0xb2c2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77ec=['bluebird','request-promise','path','rimraf','../../config/environment','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment'];(function(_0x23c9a6,_0x5b2afa){var _0x5cfbb3=function(_0x3274bd){while(--_0x3274bd){_0x23c9a6['push'](_0x23c9a6['shift']());}};_0x5cfbb3(++_0x5b2afa);}(_0x77ec,0x1cf));var _0xc77e=function(_0x540fb0,_0x51bbe1){_0x540fb0=_0x540fb0-0x0;var _0xc9eaf5=_0x77ec[_0x540fb0];return _0xc9eaf5;};'use strict';var _=require(_0xc77e('0x0'));var util=require(_0xc77e('0x1'));var logger=require(_0xc77e('0x2'))(_0xc77e('0x3'));var moment=require(_0xc77e('0x4'));var BPromise=require(_0xc77e('0x5'));var rp=require(_0xc77e('0x6'));var fs=require('fs');var path=require(_0xc77e('0x7'));var rimraf=require(_0xc77e('0x8'));var config=require(_0xc77e('0x9'));var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x2e5108,_0x420d94){return _0x2e5108['define'](_0xc77e('0xa'),attributes,{'tableName':_0xc77e('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 3af3e14..35897a0 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 _0x3f77=['then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request'];(function(_0x271caa,_0x485e70){var _0x18a8fa=function(_0x205826){while(--_0x205826){_0x271caa['push'](_0x271caa['shift']());}};_0x18a8fa(++_0x485e70);}(_0x3f77,0x107));var _0x73f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f77[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x73f7('0x0'));var BPromise=require(_0x73f7('0x1'));var rs=require(_0x73f7('0x2'));var fs=require('fs');var Redis=require(_0x73f7('0x3'));var db=require(_0x73f7('0x4'))['db'];var utils=require(_0x73f7('0x5'));var logger=require(_0x73f7('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x73f7('0x7'));var client=jayson[_0x73f7('0x8')][_0x73f7('0x9')]({'port':0x232a});config[_0x73f7('0xa')]=_[_0x73f7('0xb')](config['redis'],{'host':_0x73f7('0xc'),'port':0x18eb});var socket=require(_0x73f7('0xd'))(new Redis(config[_0x73f7('0xa')]));require(_0x73f7('0xe'))[_0x73f7('0xf')](socket);function respondWithRpcPromise(_0x103e8c,_0x27ede3,_0x21b104){return new BPromise(function(_0x5106d8,_0x1c4a73){return client[_0x73f7('0x10')](_0x103e8c,_0x21b104)[_0x73f7('0x11')](function(_0x2ef891){logger[_0x73f7('0x12')](_0x73f7('0x13'),_0x27ede3,_0x73f7('0x14'));logger[_0x73f7('0x15')](_0x73f7('0x16'),_0x27ede3,'request\x20sent',JSON[_0x73f7('0x17')](_0x2ef891));if(_0x2ef891['error']){if(_0x2ef891[_0x73f7('0x18')][_0x73f7('0x19')]===0x1f4){logger[_0x73f7('0x18')](_0x73f7('0x13'),_0x27ede3,_0x2ef891[_0x73f7('0x18')][_0x73f7('0x1a')]);return _0x1c4a73(_0x2ef891[_0x73f7('0x18')][_0x73f7('0x1a')]);}logger[_0x73f7('0x18')](_0x73f7('0x13'),_0x27ede3,_0x2ef891[_0x73f7('0x18')][_0x73f7('0x1a')]);return _0x5106d8(_0x2ef891[_0x73f7('0x18')]['message']);}else{logger[_0x73f7('0x12')](_0x73f7('0x13'),_0x27ede3,_0x73f7('0x14'));_0x5106d8(_0x2ef891[_0x73f7('0x1b')][_0x73f7('0x1a')]);}})['catch'](function(_0x512cec){logger['error'](_0x73f7('0x13'),_0x27ede3,_0x512cec);_0x1c4a73(_0x512cec);});});} \ No newline at end of file +var _0xe8b0=['stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x570eb2,_0x2d1612){var _0x3e3e29=function(_0x5a433d){while(--_0x5a433d){_0x570eb2['push'](_0x570eb2['shift']());}};_0x3e3e29(++_0x2d1612);}(_0xe8b0,0x162));var _0x0e8b=function(_0x39f2e8,_0x2ba3e7){_0x39f2e8=_0x39f2e8-0x0;var _0x25567c=_0xe8b0[_0x39f2e8];return _0x25567c;};'use strict';var _=require(_0x0e8b('0x0'));var util=require('util');var moment=require(_0x0e8b('0x1'));var BPromise=require(_0x0e8b('0x2'));var rs=require(_0x0e8b('0x3'));var fs=require('fs');var Redis=require(_0x0e8b('0x4'));var db=require(_0x0e8b('0x5'))['db'];var utils=require(_0x0e8b('0x6'));var logger=require(_0x0e8b('0x7'))(_0x0e8b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x0e8b('0x9')]=_[_0x0e8b('0xa')](config['redis'],{'host':_0x0e8b('0xb'),'port':0x18eb});var socket=require(_0x0e8b('0xc'))(new Redis(config[_0x0e8b('0x9')]));require('./dashboardItem.socket')[_0x0e8b('0xd')](socket);function respondWithRpcPromise(_0x28000e,_0x254017,_0x343abd){return new BPromise(function(_0x2736c6,_0x3bdfda){return client[_0x0e8b('0xe')](_0x28000e,_0x343abd)[_0x0e8b('0xf')](function(_0x3159f8){logger[_0x0e8b('0x10')](_0x0e8b('0x11'),_0x254017,_0x0e8b('0x12'));logger[_0x0e8b('0x13')](_0x0e8b('0x14'),_0x254017,_0x0e8b('0x12'),JSON[_0x0e8b('0x15')](_0x3159f8));if(_0x3159f8[_0x0e8b('0x16')]){if(_0x3159f8[_0x0e8b('0x16')]['code']===0x1f4){logger[_0x0e8b('0x16')](_0x0e8b('0x11'),_0x254017,_0x3159f8[_0x0e8b('0x16')]['message']);return _0x3bdfda(_0x3159f8[_0x0e8b('0x16')][_0x0e8b('0x17')]);}logger['error'](_0x0e8b('0x11'),_0x254017,_0x3159f8[_0x0e8b('0x16')]['message']);return _0x2736c6(_0x3159f8['error'][_0x0e8b('0x17')]);}else{logger[_0x0e8b('0x10')](_0x0e8b('0x11'),_0x254017,_0x0e8b('0x12'));_0x2736c6(_0x3159f8['result'][_0x0e8b('0x17')]);}})[_0x0e8b('0x18')](function(_0x53eeeb){logger['error'](_0x0e8b('0x11'),_0x254017,_0x53eeeb);_0x3bdfda(_0x53eeeb);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 0b2ad8c..3d5a26c 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 _0x8b62=['update','removeListener','register','length','dashboardItem:','save'];(function(_0x223781,_0x28224f){var _0x4e677b=function(_0x36e3c2){while(--_0x36e3c2){_0x223781['push'](_0x223781['shift']());}};_0x4e677b(++_0x28224f);}(_0x8b62,0x113));var _0x28b6=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0x8b62[_0x4b4d43];return _0x5706ba;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x28b6('0x0'),'remove',_0x28b6('0x1')];function createListener(_0x2cb108,_0x4ad530){return function(_0x44bd10){_0x4ad530['emit'](_0x2cb108,_0x44bd10);};}function removeListener(_0x6622a3,_0x837f63){return function(){DashboardItemEvents[_0x28b6('0x2')](_0x6622a3,_0x837f63);};}exports[_0x28b6('0x3')]=function(_0x28f1da){for(var _0x57da39=0x0,_0x4462d4=events[_0x28b6('0x4')];_0x57da39<_0x4462d4;_0x57da39++){var _0x4b3ee2=events[_0x57da39];var _0xad0355=createListener(_0x28b6('0x5')+_0x4b3ee2,_0x28f1da);DashboardItemEvents['on'](_0x4b3ee2,_0xad0355);}}; \ No newline at end of file +var _0xe84c=['update','emit','length','dashboardItem:','save','remove'];(function(_0x1c8491,_0x45929e){var _0x3a858f=function(_0x1f620b){while(--_0x1f620b){_0x1c8491['push'](_0x1c8491['shift']());}};_0x3a858f(++_0x45929e);}(_0xe84c,0x15a));var _0xce84=function(_0x1d309b,_0x4366cc){_0x1d309b=_0x1d309b-0x0;var _0x1c3ac8=_0xe84c[_0x1d309b];return _0x1c3ac8;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xce84('0x0'),_0xce84('0x1'),_0xce84('0x2')];function createListener(_0x422772,_0x1896d5){return function(_0x5b9aff){_0x1896d5[_0xce84('0x3')](_0x422772,_0x5b9aff);};}function removeListener(_0x1065df,_0x566d4c){return function(){DashboardItemEvents['removeListener'](_0x1065df,_0x566d4c);};}exports['register']=function(_0x3dada3){for(var _0x15cdbc=0x0,_0x9faa6d=events[_0xce84('0x4')];_0x15cdbc<_0x9faa6d;_0x15cdbc++){var _0x5650af=events[_0x15cdbc];var _0x12b4e1=createListener(_0xce84('0x5')+_0x5650af,_0x3dada3);DashboardItemEvents['on'](_0x5650af,_0x12b4e1);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 35d2db3..63fd7c5 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 _0x7ff9=['../../components/auth/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','show','post','put','update','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x7ff9,0x99));var _0x97ff=function(_0xb46203,_0x2e07d8){_0xb46203=_0xb46203-0x0;var _0x3b554a=_0x7ff9[_0xb46203];return _0x3b554a;};'use strict';var multer=require(_0x97ff('0x0'));var util=require(_0x97ff('0x1'));var path=require(_0x97ff('0x2'));var timeout=require(_0x97ff('0x3'));var express=require(_0x97ff('0x4'));var router=express[_0x97ff('0x5')]();var fs_extra=require(_0x97ff('0x6'));var auth=require(_0x97ff('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x97ff('0x8'));var controller=require(_0x97ff('0x9'));router['get'](_0x97ff('0xa'),auth[_0x97ff('0xb')](),controller[_0x97ff('0xc')]);router[_0x97ff('0xd')]('/',auth[_0x97ff('0xb')](),controller['create']);router[_0x97ff('0xe')](_0x97ff('0xa'),auth[_0x97ff('0xb')](),controller[_0x97ff('0xf')]);router['delete'](_0x97ff('0xa'),auth[_0x97ff('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xab20=['delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','/:id'];(function(_0x108e89,_0xb119b5){var _0x535f57=function(_0x511e22){while(--_0x511e22){_0x108e89['push'](_0x108e89['shift']());}};_0x535f57(++_0xb119b5);}(_0xab20,0x98));var _0x0ab2=function(_0x7869fa,_0x4b2b2e){_0x7869fa=_0x7869fa-0x0;var _0x50ee01=_0xab20[_0x7869fa];return _0x50ee01;};'use strict';var multer=require(_0x0ab2('0x0'));var util=require(_0x0ab2('0x1'));var path=require(_0x0ab2('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ab2('0x3'));var router=express[_0x0ab2('0x4')]();var fs_extra=require(_0x0ab2('0x5'));var auth=require(_0x0ab2('0x6'));var interaction=require(_0x0ab2('0x7'));var config=require(_0x0ab2('0x8'));var controller=require('./dashboardItem.controller');router[_0x0ab2('0x9')]('/:id',auth[_0x0ab2('0xa')](),controller['show']);router[_0x0ab2('0xb')]('/',auth[_0x0ab2('0xa')](),controller['create']);router['put'](_0x0ab2('0xc'),auth[_0x0ab2('0xa')](),controller['update']);router[_0x0ab2('0xd')](_0x0ab2('0xc'),auth['isAuthenticated'](),controller[_0x0ab2('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 585fbd9..95f9ce7 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 _0x27cb=['ENUM','first','second','third','exports','STRING'];(function(_0x52f82c,_0x201c03){var _0x329918=function(_0x29f9db){while(--_0x29f9db){_0x52f82c['push'](_0x52f82c['shift']());}};_0x329918(++_0x201c03);}(_0x27cb,0xa0));var _0xb27c=function(_0x4499cd,_0x397714){_0x4499cd=_0x4499cd-0x0;var _0x5733de=_0x27cb[_0x4499cd];return _0x5733de;};'use strict';var Sequelize=require('sequelize');module[_0xb27c('0x0')]={'name':{'type':Sequelize[_0xb27c('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xb27c('0x2')](_0xb27c('0x3'),_0xb27c('0x4'),_0xb27c('0x5')),'allowNull':![],'defaultValue':_0xb27c('0x3')},'description':{'type':Sequelize[_0xb27c('0x1')]}}; \ No newline at end of file +var _0x7e2b=['third','sequelize','exports','ENUM','first','second'];(function(_0x10ac8f,_0x3f579f){var _0x563d72=function(_0x59d1aa){while(--_0x59d1aa){_0x10ac8f['push'](_0x10ac8f['shift']());}};_0x563d72(++_0x3f579f);}(_0x7e2b,0x1db));var _0xb7e2=function(_0x1fddbf,_0x147af8){_0x1fddbf=_0x1fddbf-0x0;var _0x324eed=_0x7e2b[_0x1fddbf];return _0x324eed;};'use strict';var Sequelize=require(_0xb7e2('0x0'));module[_0xb7e2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xb7e2('0x2')](_0xb7e2('0x3'),_0xb7e2('0x4'),_0xb7e2('0x5')),'allowNull':![],'defaultValue':_0xb7e2('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index fbd1366..7dd2f36 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 _0x0ec6=['merge','options','find','create','user','get','role','UserProfileSection','update','body','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','Dispositions','UserProfileResource','destroy','then','end','error','stack','name','map','Disposition','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','includeAll','include','findAll','rows','catch','show'];(function(_0x36fbef,_0x4ffc84){var _0x45e270=function(_0x32dd95){while(--_0x32dd95){_0x36fbef['push'](_0x36fbef['shift']());}};_0x45e270(++_0x4ffc84);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x5d32f0,_0x429e9c){_0x5d32f0=_0x5d32f0-0x0;var _0x7d6bdb=_0x0ec6[_0x5d32f0];return _0x7d6bdb;};'use strict';var emlformat=require(_0x60ec('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x60ec('0x1'));var rp=require(_0x60ec('0x2'));var moment=require(_0x60ec('0x3'));var BPromise=require(_0x60ec('0x4'));var Mustache=require(_0x60ec('0x5'));var util=require(_0x60ec('0x6'));var path=require(_0x60ec('0x7'));var sox=require('sox');var csv=require(_0x60ec('0x8'));var ejs=require(_0x60ec('0x9'));var fs=require('fs');var fs_extra=require(_0x60ec('0xa'));var _=require(_0x60ec('0xb'));var squel=require('squel');var crypto=require(_0x60ec('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x60ec('0xd'));var toCsv=require(_0x60ec('0x8'));var querystring=require(_0x60ec('0xe'));var Papa=require(_0x60ec('0xf'));var Redis=require(_0x60ec('0x10'));var authService=require(_0x60ec('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x60ec('0x12'));var logger=require(_0x60ec('0x13'))(_0x60ec('0x14'));var utils=require(_0x60ec('0x15'));var config=require(_0x60ec('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28cabb,_0x41621a){_0x41621a=_0x41621a||0xcc;return function(_0x103a72){if(_0x103a72){return _0x28cabb[_0x60ec('0x17')](_0x41621a);}return _0x28cabb[_0x60ec('0x18')](_0x41621a)['end']();};}function respondWithResult(_0x21af57,_0x456fb5){_0x456fb5=_0x456fb5||0xc8;return function(_0x22fdb1){if(_0x22fdb1){return _0x21af57[_0x60ec('0x18')](_0x456fb5)[_0x60ec('0x19')](_0x22fdb1);}};}function respondWithFilteredResult(_0x23298f,_0x1f7c76){return function(_0x19dd55){if(_0x19dd55){var _0x448553=typeof _0x1f7c76['offset']===_0x60ec('0x1a')&&typeof _0x1f7c76[_0x60ec('0x1b')]===_0x60ec('0x1a');var _0x155bdc=_0x19dd55[_0x60ec('0x1c')];var _0x222c38=_0x448553?0x0:_0x1f7c76[_0x60ec('0x1d')];var _0x13052c=_0x448553?_0x19dd55[_0x60ec('0x1c')]:_0x1f7c76[_0x60ec('0x1d')]+_0x1f7c76[_0x60ec('0x1b')];var _0x1bdc45;if(_0x13052c>=_0x155bdc){_0x13052c=_0x155bdc;_0x1bdc45=0xc8;}else{_0x1bdc45=0xce;}_0x23298f['status'](_0x1bdc45);return _0x23298f[_0x60ec('0x1e')](_0x60ec('0x1f'),_0x222c38+'-'+_0x13052c+'/'+_0x155bdc)[_0x60ec('0x19')](_0x19dd55);}return null;};}function patchUpdates(_0x278ae3){return function(_0x5cace8){try{jsonpatch[_0x60ec('0x20')](_0x5cace8,_0x278ae3,!![]);}catch(_0x3e152c){return BPromise[_0x60ec('0x21')](_0x3e152c);}return _0x5cace8[_0x60ec('0x22')]();};}function saveUpdates(_0x3ab7ef,_0x354f08){return function(_0x492dfa){if(_0x492dfa){return _0x492dfa['update'](_0x3ab7ef)['then'](function(_0x1476c6){return _0x1476c6;});}return null;};}function removeEntity(_0x1080c0,_0x1f0ce7){return function(_0x1fd96e){if(_0x1fd96e){return _0x1fd96e['destroy']()['then'](function(){var _0x47ede9=_0x1fd96e['get']({'plain':!![]});var _0x317b9a=_0x60ec('0x23');return db[_0x60ec('0x24')][_0x60ec('0x25')]({'where':{'type':_0x317b9a,'resourceId':_0x47ede9['id']}})[_0x60ec('0x26')](function(){return _0x1fd96e;});})[_0x60ec('0x26')](function(){_0x1080c0[_0x60ec('0x18')](0xcc)[_0x60ec('0x27')]();});}};}function handleEntityNotFound(_0x1da3bb,_0x4999c7){return function(_0x9e904f){if(!_0x9e904f){_0x1da3bb[_0x60ec('0x17')](0x194);}return _0x9e904f;};}function handleError(_0x55449b,_0x31c3b9){_0x31c3b9=_0x31c3b9||0x1f4;return function(_0xf3817d){logger[_0x60ec('0x28')](_0xf3817d[_0x60ec('0x29')]);if(_0xf3817d[_0x60ec('0x2a')]){delete _0xf3817d[_0x60ec('0x2a')];}_0x55449b[_0x60ec('0x18')](_0x31c3b9)['send'](_0xf3817d);};}exports['index']=function(_0x2edc8c,_0x2df6ba){var _0x4d0b14={},_0x48d814={},_0x1cb821={'count':0x0,'rows':[]};var _0x54348a=_[_0x60ec('0x2b')](db[_0x60ec('0x2c')][_0x60ec('0x2d')],function(_0x1299c9){return{'name':_0x1299c9[_0x60ec('0x2e')],'type':_0x1299c9['type'][_0x60ec('0x2f')]};});_0x48d814[_0x60ec('0x30')]=_[_0x60ec('0x2b')](_0x54348a,_0x60ec('0x2a'));_0x48d814[_0x60ec('0x31')]=_[_0x60ec('0x32')](_0x2edc8c['query']);_0x48d814[_0x60ec('0x33')]=_[_0x60ec('0x34')](_0x48d814['model'],_0x48d814[_0x60ec('0x31')]);_0x4d0b14[_0x60ec('0x35')]=_[_0x60ec('0x34')](_0x48d814[_0x60ec('0x30')],qs['fields'](_0x2edc8c[_0x60ec('0x31')][_0x60ec('0x36')]));_0x4d0b14[_0x60ec('0x35')]=_0x4d0b14[_0x60ec('0x35')][_0x60ec('0x37')]?_0x4d0b14[_0x60ec('0x35')]:_0x48d814[_0x60ec('0x30')];if(!_0x2edc8c[_0x60ec('0x31')][_0x60ec('0x38')](_0x60ec('0x39'))){_0x4d0b14[_0x60ec('0x1b')]=qs[_0x60ec('0x1b')](_0x2edc8c[_0x60ec('0x31')][_0x60ec('0x1b')]);_0x4d0b14[_0x60ec('0x1d')]=qs[_0x60ec('0x1d')](_0x2edc8c[_0x60ec('0x31')]['offset']);}_0x4d0b14[_0x60ec('0x3a')]=qs[_0x60ec('0x3b')](_0x2edc8c['query'][_0x60ec('0x3b')]);_0x4d0b14['where']=qs[_0x60ec('0x33')](_[_0x60ec('0x3c')](_0x2edc8c[_0x60ec('0x31')],_0x48d814[_0x60ec('0x33')]),_0x54348a);if(_0x2edc8c[_0x60ec('0x31')][_0x60ec('0x3d')]){_0x4d0b14[_0x60ec('0x3e')]=_['merge'](_0x4d0b14['where'],{'$or':_['map'](_0x54348a,function(_0x3e7f85){if(_0x3e7f85['type']!==_0x60ec('0x3f')){var _0x306f52={};_0x306f52[_0x3e7f85['name']]={'$like':'%'+_0x2edc8c[_0x60ec('0x31')]['filter']+'%'};return _0x306f52;}})});}_0x4d0b14=_['merge']({},_0x4d0b14,_0x2edc8c['options']);var _0x298e2c={'where':_0x4d0b14[_0x60ec('0x3e')]};return db[_0x60ec('0x2c')][_0x60ec('0x1c')](_0x298e2c)['then'](function(_0x3bb831){_0x1cb821[_0x60ec('0x1c')]=_0x3bb831;if(_0x2edc8c[_0x60ec('0x31')][_0x60ec('0x40')]){_0x4d0b14[_0x60ec('0x41')]=[{'all':!![]}];}return db[_0x60ec('0x2c')][_0x60ec('0x42')](_0x4d0b14);})[_0x60ec('0x26')](function(_0xf76d37){_0x1cb821[_0x60ec('0x43')]=_0xf76d37;return _0x1cb821;})[_0x60ec('0x26')](respondWithFilteredResult(_0x2df6ba,_0x4d0b14))[_0x60ec('0x44')](handleError(_0x2df6ba,null));};exports[_0x60ec('0x45')]=function(_0x1409b2,_0x483503){var _0x3c45d2={'raw':!![],'where':{'id':_0x1409b2['params']['id']}},_0x2a4e0d={};_0x2a4e0d[_0x60ec('0x30')]=_['keys'](db[_0x60ec('0x2c')][_0x60ec('0x2d')]);_0x2a4e0d[_0x60ec('0x31')]=_[_0x60ec('0x32')](_0x1409b2[_0x60ec('0x31')]);_0x2a4e0d['filters']=_[_0x60ec('0x34')](_0x2a4e0d['model'],_0x2a4e0d[_0x60ec('0x31')]);_0x3c45d2[_0x60ec('0x35')]=_[_0x60ec('0x34')](_0x2a4e0d[_0x60ec('0x30')],qs[_0x60ec('0x36')](_0x1409b2['query'][_0x60ec('0x36')]));_0x3c45d2['attributes']=_0x3c45d2[_0x60ec('0x35')][_0x60ec('0x37')]?_0x3c45d2['attributes']:_0x2a4e0d['model'];if(_0x1409b2[_0x60ec('0x31')][_0x60ec('0x40')]){_0x3c45d2[_0x60ec('0x41')]=[{'all':!![]}];}_0x3c45d2=_[_0x60ec('0x46')]({},_0x3c45d2,_0x1409b2[_0x60ec('0x47')]);return db[_0x60ec('0x2c')][_0x60ec('0x48')](_0x3c45d2)[_0x60ec('0x26')](handleEntityNotFound(_0x483503,null))[_0x60ec('0x26')](respondWithResult(_0x483503,null))[_0x60ec('0x44')](handleError(_0x483503,null));};exports[_0x60ec('0x49')]=function(_0x3c10af,_0x43bfcf){return db[_0x60ec('0x2c')][_0x60ec('0x49')](_0x3c10af['body'],{})[_0x60ec('0x26')](function(_0x1d8188){var _0x202ced=_0x3c10af[_0x60ec('0x4a')][_0x60ec('0x4b')]({'plain':!![]});if(!_0x202ced)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x202ced[_0x60ec('0x4c')]==='user'){var _0x3ce66e=_0x1d8188[_0x60ec('0x4b')]({'plain':!![]});var _0x5c606a=_0x60ec('0x23');return db[_0x60ec('0x4d')]['find']({'where':{'name':_0x5c606a,'userProfileId':_0x202ced['userProfileId']},'raw':!![]})[_0x60ec('0x26')](function(_0x50b9ea){if(_0x50b9ea&&_0x50b9ea['autoAssociation']===0x0){return db[_0x60ec('0x24')]['create']({'name':_0x3ce66e[_0x60ec('0x2a')],'resourceId':_0x3ce66e['id'],'type':_0x50b9ea[_0x60ec('0x2a')],'sectionId':_0x50b9ea['id']},{})['then'](function(){return _0x1d8188;});}else{return _0x1d8188;}})[_0x60ec('0x44')](function(_0x12f414){logger[_0x60ec('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12f414);throw _0x12f414;});}return _0x1d8188;})[_0x60ec('0x26')](respondWithResult(_0x43bfcf,0xc9))[_0x60ec('0x44')](handleError(_0x43bfcf,null));};exports[_0x60ec('0x4e')]=function(_0x13c46c,_0x2ea124){if(_0x13c46c[_0x60ec('0x4f')]['id']){delete _0x13c46c[_0x60ec('0x4f')]['id'];}return db[_0x60ec('0x2c')]['find']({'where':{'id':_0x13c46c[_0x60ec('0x50')]['id']}})[_0x60ec('0x26')](handleEntityNotFound(_0x2ea124,null))[_0x60ec('0x26')](saveUpdates(_0x13c46c[_0x60ec('0x4f')],null))['then'](respondWithResult(_0x2ea124,null))[_0x60ec('0x44')](handleError(_0x2ea124,null));};exports[_0x60ec('0x25')]=function(_0xba960b,_0x50fcdc){return db[_0x60ec('0x2c')][_0x60ec('0x48')]({'where':{'id':_0xba960b[_0x60ec('0x50')]['id']}})[_0x60ec('0x26')](handleEntityNotFound(_0x50fcdc,null))['then'](removeEntity(_0x50fcdc,null))[_0x60ec('0x44')](handleError(_0x50fcdc,null));}; \ No newline at end of file +var _0x97ac=['request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Dispositions','end','sendStatus','error','stack','name','send','index','map','Disposition','rawAttributes','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir'];(function(_0x3a0864,_0x252f07){var _0x18f5ce=function(_0x3e2f55){while(--_0x3e2f55){_0x3a0864['push'](_0x3a0864['shift']());}};_0x18f5ce(++_0x252f07);}(_0x97ac,0xa1));var _0xc97a=function(_0x537f2e,_0x4debe3){_0x537f2e=_0x537f2e-0x0;var _0x51f3e5=_0x97ac[_0x537f2e];return _0x51f3e5;};'use strict';var emlformat=require(_0xc97a('0x0'));var rimraf=require(_0xc97a('0x1'));var zipdir=require(_0xc97a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc97a('0x3'));var moment=require(_0xc97a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc97a('0x5'));var util=require(_0xc97a('0x6'));var path=require(_0xc97a('0x7'));var sox=require('sox');var csv=require(_0xc97a('0x8'));var ejs=require(_0xc97a('0x9'));var fs=require('fs');var fs_extra=require(_0xc97a('0xa'));var _=require(_0xc97a('0xb'));var squel=require(_0xc97a('0xc'));var crypto=require(_0xc97a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc97a('0x8'));var querystring=require('querystring');var Papa=require(_0xc97a('0xe'));var Redis=require(_0xc97a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc97a('0x10'));var as=require(_0xc97a('0x11'));var hardwareService=require(_0xc97a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc97a('0x13'));var config=require(_0xc97a('0x14'));var licenseUtil=require(_0xc97a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x515fe6,_0x44d4a5){_0x44d4a5=_0x44d4a5||0xcc;return function(_0x598590){if(_0x598590){return _0x515fe6['sendStatus'](_0x44d4a5);}return _0x515fe6[_0xc97a('0x16')](_0x44d4a5)['end']();};}function respondWithResult(_0x225033,_0xe5dc26){_0xe5dc26=_0xe5dc26||0xc8;return function(_0x20f754){if(_0x20f754){return _0x225033['status'](_0xe5dc26)[_0xc97a('0x17')](_0x20f754);}};}function respondWithFilteredResult(_0x2a0209,_0x5a0f4f){return function(_0x22fda6){if(_0x22fda6){var _0xdb8af3=typeof _0x5a0f4f[_0xc97a('0x18')]===_0xc97a('0x19')&&typeof _0x5a0f4f[_0xc97a('0x1a')]===_0xc97a('0x19');var _0x545c05=_0x22fda6[_0xc97a('0x1b')];var _0x53d61a=_0xdb8af3?0x0:_0x5a0f4f[_0xc97a('0x18')];var _0x210ee1=_0xdb8af3?_0x22fda6['count']:_0x5a0f4f[_0xc97a('0x18')]+_0x5a0f4f[_0xc97a('0x1a')];var _0x4a6aba;if(_0x210ee1>=_0x545c05){_0x210ee1=_0x545c05;_0x4a6aba=0xc8;}else{_0x4a6aba=0xce;}_0x2a0209[_0xc97a('0x16')](_0x4a6aba);return _0x2a0209[_0xc97a('0x1c')](_0xc97a('0x1d'),_0x53d61a+'-'+_0x210ee1+'/'+_0x545c05)['json'](_0x22fda6);}return null;};}function patchUpdates(_0x4d11ed){return function(_0x5bb440){try{jsonpatch[_0xc97a('0x1e')](_0x5bb440,_0x4d11ed,!![]);}catch(_0x4209de){return BPromise[_0xc97a('0x1f')](_0x4209de);}return _0x5bb440[_0xc97a('0x20')]();};}function saveUpdates(_0x474199,_0x965b79){return function(_0x4acb90){if(_0x4acb90){return _0x4acb90[_0xc97a('0x21')](_0x474199)[_0xc97a('0x22')](function(_0x1391b5){return _0x1391b5;});}return null;};}function removeEntity(_0x481c06,_0x508fe4){return function(_0x3db5b4){if(_0x3db5b4){return _0x3db5b4['destroy']()[_0xc97a('0x22')](function(){var _0x50a09c=_0x3db5b4[_0xc97a('0x23')]({'plain':!![]});var _0x2916ad=_0xc97a('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x2916ad,'resourceId':_0x50a09c['id']}})[_0xc97a('0x22')](function(){return _0x3db5b4;});})[_0xc97a('0x22')](function(){_0x481c06[_0xc97a('0x16')](0xcc)[_0xc97a('0x25')]();});}};}function handleEntityNotFound(_0x245694,_0x54b865){return function(_0x27b6cd){if(!_0x27b6cd){_0x245694[_0xc97a('0x26')](0x194);}return _0x27b6cd;};}function handleError(_0x3bc15b,_0x4757d2){_0x4757d2=_0x4757d2||0x1f4;return function(_0x16cc37){logger[_0xc97a('0x27')](_0x16cc37[_0xc97a('0x28')]);if(_0x16cc37['name']){delete _0x16cc37[_0xc97a('0x29')];}_0x3bc15b[_0xc97a('0x16')](_0x4757d2)[_0xc97a('0x2a')](_0x16cc37);};}exports[_0xc97a('0x2b')]=function(_0xc9f252,_0x3ba76f){var _0x52ed6f={},_0xc35d6a={},_0x4d8351={'count':0x0,'rows':[]};var _0x14302b=_[_0xc97a('0x2c')](db[_0xc97a('0x2d')][_0xc97a('0x2e')],function(_0x3cd9bf){return{'name':_0x3cd9bf['fieldName'],'type':_0x3cd9bf[_0xc97a('0x2f')][_0xc97a('0x30')]};});_0xc35d6a[_0xc97a('0x31')]=_['map'](_0x14302b,_0xc97a('0x29'));_0xc35d6a[_0xc97a('0x32')]=_[_0xc97a('0x33')](_0xc9f252[_0xc97a('0x32')]);_0xc35d6a['filters']=_['intersection'](_0xc35d6a[_0xc97a('0x31')],_0xc35d6a['query']);_0x52ed6f[_0xc97a('0x34')]=_['intersection'](_0xc35d6a[_0xc97a('0x31')],qs[_0xc97a('0x35')](_0xc9f252[_0xc97a('0x32')][_0xc97a('0x35')]));_0x52ed6f['attributes']=_0x52ed6f[_0xc97a('0x34')][_0xc97a('0x36')]?_0x52ed6f[_0xc97a('0x34')]:_0xc35d6a['model'];if(!_0xc9f252[_0xc97a('0x32')][_0xc97a('0x37')](_0xc97a('0x38'))){_0x52ed6f[_0xc97a('0x1a')]=qs[_0xc97a('0x1a')](_0xc9f252[_0xc97a('0x32')][_0xc97a('0x1a')]);_0x52ed6f[_0xc97a('0x18')]=qs[_0xc97a('0x18')](_0xc9f252[_0xc97a('0x32')]['offset']);}_0x52ed6f[_0xc97a('0x39')]=qs[_0xc97a('0x3a')](_0xc9f252[_0xc97a('0x32')]['sort']);_0x52ed6f[_0xc97a('0x3b')]=qs[_0xc97a('0x3c')](_[_0xc97a('0x3d')](_0xc9f252[_0xc97a('0x32')],_0xc35d6a[_0xc97a('0x3c')]),_0x14302b);if(_0xc9f252['query']['filter']){_0x52ed6f[_0xc97a('0x3b')]=_[_0xc97a('0x3e')](_0x52ed6f[_0xc97a('0x3b')],{'$or':_[_0xc97a('0x2c')](_0x14302b,function(_0x29c6f8){if(_0x29c6f8['type']!==_0xc97a('0x3f')){var _0x5b551d={};_0x5b551d[_0x29c6f8['name']]={'$like':'%'+_0xc9f252[_0xc97a('0x32')][_0xc97a('0x40')]+'%'};return _0x5b551d;}})});}_0x52ed6f=_[_0xc97a('0x3e')]({},_0x52ed6f,_0xc9f252[_0xc97a('0x41')]);var _0x4e8af8={'where':_0x52ed6f['where']};return db[_0xc97a('0x2d')][_0xc97a('0x1b')](_0x4e8af8)[_0xc97a('0x22')](function(_0x589005){_0x4d8351['count']=_0x589005;if(_0xc9f252[_0xc97a('0x32')][_0xc97a('0x42')]){_0x52ed6f[_0xc97a('0x43')]=[{'all':!![]}];}return db['Disposition'][_0xc97a('0x44')](_0x52ed6f);})[_0xc97a('0x22')](function(_0x25cf75){_0x4d8351['rows']=_0x25cf75;return _0x4d8351;})[_0xc97a('0x22')](respondWithFilteredResult(_0x3ba76f,_0x52ed6f))[_0xc97a('0x45')](handleError(_0x3ba76f,null));};exports['show']=function(_0x576346,_0x37cc1b){var _0xf2311d={'raw':!![],'where':{'id':_0x576346[_0xc97a('0x46')]['id']}},_0x486408={};_0x486408[_0xc97a('0x31')]=_['keys'](db[_0xc97a('0x2d')]['rawAttributes']);_0x486408[_0xc97a('0x32')]=_[_0xc97a('0x33')](_0x576346[_0xc97a('0x32')]);_0x486408[_0xc97a('0x3c')]=_[_0xc97a('0x47')](_0x486408[_0xc97a('0x31')],_0x486408['query']);_0xf2311d[_0xc97a('0x34')]=_[_0xc97a('0x47')](_0x486408[_0xc97a('0x31')],qs['fields'](_0x576346[_0xc97a('0x32')][_0xc97a('0x35')]));_0xf2311d[_0xc97a('0x34')]=_0xf2311d[_0xc97a('0x34')][_0xc97a('0x36')]?_0xf2311d[_0xc97a('0x34')]:_0x486408['model'];if(_0x576346[_0xc97a('0x32')]['includeAll']){_0xf2311d[_0xc97a('0x43')]=[{'all':!![]}];}_0xf2311d=_['merge']({},_0xf2311d,_0x576346[_0xc97a('0x41')]);return db[_0xc97a('0x2d')]['find'](_0xf2311d)['then'](handleEntityNotFound(_0x37cc1b,null))['then'](respondWithResult(_0x37cc1b,null))[_0xc97a('0x45')](handleError(_0x37cc1b,null));};exports['create']=function(_0x5701f2,_0x5430eb){return db[_0xc97a('0x2d')][_0xc97a('0x48')](_0x5701f2[_0xc97a('0x49')],{})[_0xc97a('0x22')](function(_0x117aec){var _0x414927=_0x5701f2[_0xc97a('0x4a')][_0xc97a('0x23')]({'plain':!![]});if(!_0x414927)throw new Error(_0xc97a('0x4b'));if(_0x414927['role']===_0xc97a('0x4a')){var _0x4fac15=_0x117aec[_0xc97a('0x23')]({'plain':!![]});var _0x4c34e2=_0xc97a('0x24');return db[_0xc97a('0x4c')][_0xc97a('0x4d')]({'where':{'name':_0x4c34e2,'userProfileId':_0x414927[_0xc97a('0x4e')]},'raw':!![]})[_0xc97a('0x22')](function(_0x340686){if(_0x340686&&_0x340686['autoAssociation']===0x0){return db[_0xc97a('0x4f')][_0xc97a('0x48')]({'name':_0x4fac15[_0xc97a('0x29')],'resourceId':_0x4fac15['id'],'type':_0x340686['name'],'sectionId':_0x340686['id']},{})[_0xc97a('0x22')](function(){return _0x117aec;});}else{return _0x117aec;}})[_0xc97a('0x45')](function(_0x7b0b09){logger[_0xc97a('0x27')](_0xc97a('0x50'),_0x7b0b09);throw _0x7b0b09;});}return _0x117aec;})['then'](respondWithResult(_0x5430eb,0xc9))['catch'](handleError(_0x5430eb,null));};exports[_0xc97a('0x21')]=function(_0x3b1bfc,_0x1658ec){if(_0x3b1bfc[_0xc97a('0x49')]['id']){delete _0x3b1bfc[_0xc97a('0x49')]['id'];}return db['Disposition'][_0xc97a('0x4d')]({'where':{'id':_0x3b1bfc[_0xc97a('0x46')]['id']}})[_0xc97a('0x22')](handleEntityNotFound(_0x1658ec,null))['then'](saveUpdates(_0x3b1bfc['body'],null))[_0xc97a('0x22')](respondWithResult(_0x1658ec,null))[_0xc97a('0x45')](handleError(_0x1658ec,null));};exports[_0xc97a('0x51')]=function(_0x3a7863,_0x3c5d3f){return db[_0xc97a('0x2d')]['find']({'where':{'id':_0x3a7863[_0xc97a('0x46')]['id']}})[_0xc97a('0x22')](handleEntityNotFound(_0x3c5d3f,null))[_0xc97a('0x22')](removeEntity(_0x3c5d3f,null))['catch'](handleError(_0x3c5d3f,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index c3c4de5..71ceb37 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 _0xed31=['OpenchannelAccountId','WhatsappAccountId','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define','Disposition','name_voice','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed31,0x7a));var _0x1ed3=function(_0x5e6939,_0x3dcd8a){_0x5e6939=_0x5e6939-0x0;var _0x45d3f1=_0xed31[_0x5e6939];return _0x45d3f1;};'use strict';var _=require(_0x1ed3('0x0'));var util=require(_0x1ed3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1ed3('0x2'));var BPromise=require(_0x1ed3('0x3'));var rp=require(_0x1ed3('0x4'));var fs=require('fs');var path=require(_0x1ed3('0x5'));var rimraf=require('rimraf');var config=require(_0x1ed3('0x6'));var attributes=require(_0x1ed3('0x7'));module[_0x1ed3('0x8')]=function(_0x10ffdd,_0x38b694){return _0x10ffdd[_0x1ed3('0x9')](_0x1ed3('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x1ed3('0xb'),'fields':['name','ListId']},{'unique':!![],'name':_0x1ed3('0xc'),'fields':[_0x1ed3('0xd'),_0x1ed3('0xe')]},{'unique':!![],'name':_0x1ed3('0xf'),'fields':['name',_0x1ed3('0x10')]},{'unique':!![],'name':_0x1ed3('0x11'),'fields':['name',_0x1ed3('0x12')]},{'unique':!![],'name':_0x1ed3('0x13'),'fields':[_0x1ed3('0xd'),_0x1ed3('0x14')]},{'unique':!![],'name':_0x1ed3('0x15'),'fields':[_0x1ed3('0xd'),_0x1ed3('0x16')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x1ed3('0xd'),_0x1ed3('0x17')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe636=['Disposition','tools_dispositions','name_voice','ListId','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','WhatsappAccountId','lodash','util','api','moment','bluebird','request-promise','path','exports','define'];(function(_0x692282,_0x279660){var _0x172aa8=function(_0x5bd982){while(--_0x5bd982){_0x692282['push'](_0x692282['shift']());}};_0x172aa8(++_0x279660);}(_0xe636,0x16d));var _0x6e63=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0xe636[_0x296897];return _0x2b44ab;};'use strict';var _=require(_0x6e63('0x0'));var util=require(_0x6e63('0x1'));var logger=require('../../config/logger')(_0x6e63('0x2'));var moment=require(_0x6e63('0x3'));var BPromise=require(_0x6e63('0x4'));var rp=require(_0x6e63('0x5'));var fs=require('fs');var path=require(_0x6e63('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0x6e63('0x7')]=function(_0x1286e7,_0x2e5420){return _0x1286e7[_0x6e63('0x8')](_0x6e63('0x9'),attributes,{'tableName':_0x6e63('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x6e63('0xb'),'fields':['name',_0x6e63('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0x6e63('0xd'),_0x6e63('0xe')]},{'unique':!![],'name':_0x6e63('0xf'),'fields':[_0x6e63('0xd'),_0x6e63('0x10')]},{'unique':!![],'name':_0x6e63('0x11'),'fields':[_0x6e63('0xd'),_0x6e63('0x12')]},{'unique':!![],'name':_0x6e63('0x13'),'fields':[_0x6e63('0xd'),'FaxAccountId']},{'unique':!![],'name':_0x6e63('0x14'),'fields':[_0x6e63('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x6e63('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index b725ef6..398ced2 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(_0x3e79ab,_0x2684e6){var _0x3b813c=function(_0x59b4d2){while(--_0x59b4d2){_0x3e79ab['push'](_0x3e79ab['shift']());}};_0x3b813c(++_0x2684e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x265796,_0x316409){var _0xbfa482=function(_0x4e4657){while(--_0x4e4657){_0x265796['push'](_0x265796['shift']());}};_0xbfa482(++_0x316409);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 23dae72..65e23aa 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 _0x96c1=['path','connect-timeout','fs-extra','../../components/auth/service','./disposition.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','multer','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x96c1,0x10e));var _0x196c=function(_0x5ce662,_0x30c6ea){_0x5ce662=_0x5ce662-0x0;var _0xdd005=_0x96c1[_0x5ce662];return _0xdd005;};'use strict';var multer=require(_0x196c('0x0'));var util=require(_0x196c('0x1'));var path=require(_0x196c('0x2'));var timeout=require(_0x196c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x196c('0x4'));var auth=require(_0x196c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x196c('0x6'));router[_0x196c('0x7')]('/',auth[_0x196c('0x8')](),controller[_0x196c('0x9')]);router[_0x196c('0x7')](_0x196c('0xa'),auth[_0x196c('0x8')](),controller[_0x196c('0xb')]);router[_0x196c('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x196c('0xd')](_0x196c('0xa'),auth[_0x196c('0x8')](),controller['update']);router[_0x196c('0xe')](_0x196c('0xa'),auth['isAuthenticated'](),controller[_0x196c('0xf')]);module['exports']=router; \ No newline at end of file +var _0x50a6=['../../config/environment','./disposition.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x50a6,0x14d));var _0x650a=function(_0x2853dd,_0x36df3b){_0x2853dd=_0x2853dd-0x0;var _0x420394=_0x50a6[_0x2853dd];return _0x420394;};'use strict';var multer=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var path=require(_0x650a('0x2'));var timeout=require('connect-timeout');var express=require(_0x650a('0x3'));var router=express['Router']();var fs_extra=require(_0x650a('0x4'));var auth=require(_0x650a('0x5'));var interaction=require(_0x650a('0x6'));var config=require(_0x650a('0x7'));var controller=require(_0x650a('0x8'));router['get']('/',auth[_0x650a('0x9')](),controller[_0x650a('0xa')]);router[_0x650a('0xb')](_0x650a('0xc'),auth['isAuthenticated'](),controller[_0x650a('0xd')]);router['post']('/',auth[_0x650a('0x9')](),controller[_0x650a('0xe')]);router[_0x650a('0xf')](_0x650a('0xc'),auth[_0x650a('0x9')](),controller[_0x650a('0x10')]);router[_0x650a('0x11')](_0x650a('0xc'),auth[_0x650a('0x9')](),controller[_0x650a('0x12')]);module[_0x650a('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index a3c0d27..ef19fec 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 _0x7128=['STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','4800','9600','2400','7200','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x7128,0xfb));var _0x8712=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0x7128[_0x622035];return _0x326cf2;};'use strict';var Sequelize=require(_0x8712('0x0'));module[_0x8712('0x1')]={'name':{'type':Sequelize[_0x8712('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8712('0x2')]},'ecm':{'type':Sequelize[_0x8712('0x3')](_0x8712('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x8712('0x2')],'defaultValue':_0x8712('0x5')},'localstationid':{'type':Sequelize[_0x8712('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x8712('0x3')]('2400',_0x8712('0x6'),'7200',_0x8712('0x7'),'12000','14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x8712('0x8'),_0x8712('0x6'),_0x8712('0x9'),_0x8712('0x7'),'12000','14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x8712('0x2')],'defaultValue':_0x8712('0xa')},'gateway':{'type':Sequelize[_0x8712('0x2')],'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[_0x8712('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x8712('0xc'),_0x8712('0xd'),_0x8712('0xe'),_0x8712('0xf')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x8712('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8712('0x10')],'defaultValue':function(){return _0x8712('0x11');}},'notificationSound':{'type':Sequelize[_0x8712('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8712('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8712('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8712('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8712('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x8712('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x8712('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2a5dfd){if(!_0x2a5dfd)this[_0x8712('0x14')](_0x8712('0x15'),null);this[_0x8712('0x14')](_0x8712('0x16'),_0x2a5dfd);}}}; \ No newline at end of file +var _0xb268=['mandatoryDisposition','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','7200','9600','14400','12000','v17,v27,v29','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId'];(function(_0x5381b3,_0x432742){var _0x26ebf1=function(_0x3b9ef8){while(--_0x3b9ef8){_0x5381b3['push'](_0x5381b3['shift']());}};_0x26ebf1(++_0x432742);}(_0xb268,0x11f));var _0x8b26=function(_0x509fa8,_0x463748){_0x509fa8=_0x509fa8-0x0;var _0x1bcb5f=_0xb268[_0x509fa8];return _0x1bcb5f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8b26('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8b26('0x0')]},'ecm':{'type':Sequelize[_0x8b26('0x1')](_0x8b26('0x2'),'no'),'defaultValue':_0x8b26('0x2')},'headerinfo':{'type':Sequelize[_0x8b26('0x0')],'defaultValue':_0x8b26('0x3')},'localstationid':{'type':Sequelize[_0x8b26('0x0')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x8b26('0x1')](_0x8b26('0x4'),_0x8b26('0x5'),_0x8b26('0x6'),_0x8b26('0x7'),'12000',_0x8b26('0x8')),'defaultValue':_0x8b26('0x5')},'maxrate':{'type':Sequelize[_0x8b26('0x1')](_0x8b26('0x4'),_0x8b26('0x5'),_0x8b26('0x6'),_0x8b26('0x7'),_0x8b26('0x9'),_0x8b26('0x8')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x8b26('0x0')],'defaultValue':_0x8b26('0xa')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x8b26('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x8b26('0x1')](_0x8b26('0xb'),_0x8b26('0xc'),_0x8b26('0xd'),_0x8b26('0xe')),'defaultValue':_0x8b26('0xb')},'key':{'type':Sequelize[_0x8b26('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8b26('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x8b26('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8b26('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8b26('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8b26('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8b26('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8b26('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8b26('0x11')],'allowNull':!![],'defaultValue':null,'comment':_0x8b26('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x8b26('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x334d99){if(!_0x334d99)this[_0x8b26('0x13')](_0x8b26('0x14'),null);this[_0x8b26('0x13')](_0x8b26('0x15'),_0x334d99);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 8e9d9ef..c5e9e6b 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 _0x012d=['redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','rows','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','describe','FaxAccountId','Disposition','getDispositions','findOne','filter','options','include','findAll','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Set','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','createdAt','updatedAt','findById','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','addAgents','emit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults'];(function(_0x196d22,_0x2dedfa){var _0x33772e=function(_0x3055bd){while(--_0x3055bd){_0x196d22['push'](_0x196d22['shift']());}};_0x33772e(++_0x2dedfa);}(_0x012d,0x17c));var _0xd012=function(_0x2413da,_0x50643d){_0x2413da=_0x2413da-0x0;var _0x1eca6e=_0x012d[_0x2413da];return _0x1eca6e;};'use strict';var emlformat=require(_0xd012('0x0'));var rimraf=require(_0xd012('0x1'));var zipdir=require(_0xd012('0x2'));var jsonpatch=require(_0xd012('0x3'));var rp=require(_0xd012('0x4'));var moment=require(_0xd012('0x5'));var BPromise=require(_0xd012('0x6'));var Mustache=require(_0xd012('0x7'));var util=require(_0xd012('0x8'));var path=require(_0xd012('0x9'));var sox=require(_0xd012('0xa'));var csv=require(_0xd012('0xb'));var ejs=require(_0xd012('0xc'));var fs=require('fs');var fs_extra=require(_0xd012('0xd'));var _=require(_0xd012('0xe'));var squel=require('squel');var crypto=require(_0xd012('0xf'));var jsforce=require(_0xd012('0x10'));var deskjs=require(_0xd012('0x11'));var toCsv=require(_0xd012('0xb'));var querystring=require(_0xd012('0x12'));var Papa=require(_0xd012('0x13'));var Redis=require('ioredis');var authService=require(_0xd012('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd012('0x15'));var logger=require(_0xd012('0x16'))('api');var utils=require(_0xd012('0x17'));var config=require(_0xd012('0x18'));var licenseUtil=require(_0xd012('0x19'));var db=require(_0xd012('0x1a'))['db'];config['redis']=_[_0xd012('0x1b')](config[_0xd012('0x1c')],{'host':_0xd012('0x1d'),'port':0x18eb});var socket=require(_0xd012('0x1e'))(new Redis(config[_0xd012('0x1c')]));require('./faxAccount.socket')[_0xd012('0x1f')](socket);var jayson=require(_0xd012('0x20'));var client=jayson[_0xd012('0x21')][_0xd012('0x22')]({'port':0x232c});var client9002=jayson['client'][_0xd012('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5a2060,_0x59e340,_0x414a9f,_0x39f439){return new BPromise(function(_0x3cf923,_0x125c54){var _0x25da26=_0x39f439||client;return _0x25da26[_0xd012('0x23')](_0x5a2060,_0x414a9f)['then'](function(_0x4f483a){logger[_0xd012('0x24')](_0xd012('0x25'),_0x59e340,'request\x20sent');logger[_0xd012('0x26')](_0xd012('0x27'),_0x59e340,_0xd012('0x28'),JSON[_0xd012('0x29')](_0x4f483a));if(_0x4f483a[_0xd012('0x2a')]){if(_0x4f483a[_0xd012('0x2a')]['code']===0x1f4){logger['error'](_0xd012('0x25'),_0x59e340,_0x4f483a['error'][_0xd012('0x2b')]);return _0x125c54(_0x4f483a[_0xd012('0x2a')]['message']);}logger[_0xd012('0x2a')](_0xd012('0x25'),_0x59e340,_0x4f483a[_0xd012('0x2a')][_0xd012('0x2b')]);return _0x3cf923(_0x4f483a[_0xd012('0x2a')][_0xd012('0x2b')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x59e340,_0xd012('0x28'));_0x3cf923(_0x4f483a['result'][_0xd012('0x2b')]);}})[_0xd012('0x2c')](function(_0x4ae8bb){logger[_0xd012('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x59e340,_0x4ae8bb);_0x125c54(_0x4ae8bb);});});}function respondWithStatusCode(_0x51c0c0,_0xdb2331){_0xdb2331=_0xdb2331||0xcc;return function(_0x4f9435){if(_0x4f9435){return _0x51c0c0['sendStatus'](_0xdb2331);}return _0x51c0c0[_0xd012('0x2d')](_0xdb2331)[_0xd012('0x2e')]();};}function respondWithResult(_0x37e4c3,_0xef53a2){_0xef53a2=_0xef53a2||0xc8;return function(_0x3553a9){if(_0x3553a9){return _0x37e4c3[_0xd012('0x2d')](_0xef53a2)[_0xd012('0x2f')](_0x3553a9);}};}function respondWithFilteredResult(_0xa9f763,_0x5189f8){return function(_0x51a45c){if(_0x51a45c){var _0xb0ff8f=typeof _0x5189f8[_0xd012('0x30')]===_0xd012('0x31')&&typeof _0x5189f8[_0xd012('0x32')]==='undefined';var _0x90c0d0=_0x51a45c[_0xd012('0x33')];var _0x300204=_0xb0ff8f?0x0:_0x5189f8[_0xd012('0x30')];var _0x13d8c6=_0xb0ff8f?_0x51a45c[_0xd012('0x33')]:_0x5189f8[_0xd012('0x30')]+_0x5189f8['limit'];var _0x49db7b;if(_0x13d8c6>=_0x90c0d0){_0x13d8c6=_0x90c0d0;_0x49db7b=0xc8;}else{_0x49db7b=0xce;}_0xa9f763[_0xd012('0x2d')](_0x49db7b);return _0xa9f763[_0xd012('0x34')](_0xd012('0x35'),_0x300204+'-'+_0x13d8c6+'/'+_0x90c0d0)[_0xd012('0x2f')](_0x51a45c);}return null;};}function patchUpdates(_0x1ef885){return function(_0x5bd89b){try{jsonpatch[_0xd012('0x36')](_0x5bd89b,_0x1ef885,!![]);}catch(_0x3957bd){return BPromise[_0xd012('0x37')](_0x3957bd);}return _0x5bd89b['save']();};}function saveUpdates(_0x184ada,_0x56c3fe){return function(_0x4ce875){if(_0x4ce875){return _0x4ce875[_0xd012('0x38')](_0x184ada)[_0xd012('0x39')](function(_0x280dca){return _0x280dca;});}return null;};}function removeEntity(_0x1e7e1c,_0x4a3b8c){return function(_0x3a259c){if(_0x3a259c){return _0x3a259c[_0xd012('0x3a')]()['then'](function(){var _0x8ed30c=_0x3a259c[_0xd012('0x3b')]({'plain':!![]});var _0x294446=_0xd012('0x3c');return db[_0xd012('0x3d')]['destroy']({'where':{'type':_0x294446,'resourceId':_0x8ed30c['id']}})[_0xd012('0x39')](function(){return _0x3a259c;});})['then'](function(){_0x1e7e1c[_0xd012('0x2d')](0xcc)[_0xd012('0x2e')]();});}};}function handleEntityNotFound(_0x25952c,_0x25b94c){return function(_0x58961b){if(!_0x58961b){_0x25952c[_0xd012('0x3e')](0x194);}return _0x58961b;};}function handleError(_0x3d88e9,_0x378d73){_0x378d73=_0x378d73||0x1f4;return function(_0x2877a9){logger[_0xd012('0x2a')](_0x2877a9[_0xd012('0x3f')]);if(_0x2877a9[_0xd012('0x40')]){delete _0x2877a9[_0xd012('0x40')];}_0x3d88e9[_0xd012('0x2d')](_0x378d73)[_0xd012('0x41')](_0x2877a9);};}exports[_0xd012('0x42')]=function(_0x2962d8,_0x335b0b){var _0x1bb6f9={'include':[{'model':db[_0xd012('0x43')],'as':_0xd012('0x44')}]},_0x4ce876={},_0x595241={'count':0x0,'rows':[]};var _0x4a4167=_[_0xd012('0x45')](db[_0xd012('0x46')][_0xd012('0x47')],function(_0x1a07b3){return{'name':_0x1a07b3[_0xd012('0x48')],'type':_0x1a07b3[_0xd012('0x49')][_0xd012('0x4a')]};});_0x4ce876['model']=_[_0xd012('0x45')](_0x4a4167,_0xd012('0x40'));_0x4ce876[_0xd012('0x4b')]=_[_0xd012('0x4c')](_0x2962d8[_0xd012('0x4b')]);_0x4ce876[_0xd012('0x4d')]=_[_0xd012('0x4e')](_0x4ce876[_0xd012('0x4f')],_0x4ce876['query']);_0x1bb6f9['attributes']=_['intersection'](_0x4ce876[_0xd012('0x4f')],qs[_0xd012('0x50')](_0x2962d8[_0xd012('0x4b')][_0xd012('0x50')]));_0x1bb6f9[_0xd012('0x51')]=_0x1bb6f9['attributes'][_0xd012('0x52')]?_0x1bb6f9[_0xd012('0x51')]:_0x4ce876[_0xd012('0x4f')];if(!_0x2962d8[_0xd012('0x4b')][_0xd012('0x53')](_0xd012('0x54'))){_0x1bb6f9[_0xd012('0x32')]=qs['limit'](_0x2962d8[_0xd012('0x4b')]['limit']);_0x1bb6f9['offset']=qs[_0xd012('0x30')](_0x2962d8[_0xd012('0x4b')][_0xd012('0x30')]);}_0x1bb6f9[_0xd012('0x55')]=qs[_0xd012('0x56')](_0x2962d8[_0xd012('0x4b')][_0xd012('0x56')]);_0x1bb6f9[_0xd012('0x57')]=qs[_0xd012('0x4d')](_[_0xd012('0x58')](_0x2962d8[_0xd012('0x4b')],_0x4ce876[_0xd012('0x4d')]),_0x4a4167);if(_0x2962d8[_0xd012('0x4b')]['filter']){_0x1bb6f9['where']=_[_0xd012('0x59')](_0x1bb6f9['where'],{'$or':_[_0xd012('0x45')](_0x4a4167,function(_0x56e1bc){if(_0x56e1bc[_0xd012('0x49')]!==_0xd012('0x5a')){var _0x297e38={};_0x297e38[_0x56e1bc[_0xd012('0x40')]]={'$like':'%'+_0x2962d8['query']['filter']+'%'};return _0x297e38;}})});}_0x1bb6f9=_[_0xd012('0x59')]({},_0x1bb6f9,_0x2962d8['options']);var _0x160774={'where':_0x1bb6f9[_0xd012('0x57')]};return db['FaxAccount']['count'](_0x160774)['then'](function(_0x21296a){_0x595241[_0xd012('0x33')]=_0x21296a;if(_0x2962d8[_0xd012('0x4b')][_0xd012('0x5b')]){_0x1bb6f9['include']=[{'all':!![]}];}return db[_0xd012('0x46')]['findAll'](_0x1bb6f9);})[_0xd012('0x39')](function(_0xf092e5){_0x595241[_0xd012('0x5c')]=_0xf092e5;return _0x595241;})[_0xd012('0x39')](respondWithFilteredResult(_0x335b0b,_0x1bb6f9))[_0xd012('0x2c')](handleError(_0x335b0b,null));};exports[_0xd012('0x5d')]=function(_0x77d6a,_0x3c321b){var _0x4f6471={'raw':![],'where':{'id':_0x77d6a[_0xd012('0x5e')]['id']},'include':[{'model':db['Pause'],'as':_0xd012('0x44')}]},_0x35f549={};_0x35f549['model']=_['keys'](db[_0xd012('0x46')]['rawAttributes']);_0x35f549[_0xd012('0x4b')]=_[_0xd012('0x4c')](_0x77d6a[_0xd012('0x4b')]);_0x35f549[_0xd012('0x4d')]=_['intersection'](_0x35f549['model'],_0x35f549[_0xd012('0x4b')]);_0x4f6471[_0xd012('0x51')]=_[_0xd012('0x4e')](_0x35f549['model'],qs[_0xd012('0x50')](_0x77d6a[_0xd012('0x4b')][_0xd012('0x50')]));_0x4f6471['attributes']=_0x4f6471['attributes'][_0xd012('0x52')]?_0x4f6471[_0xd012('0x51')]:_0x35f549['model'];if(_0x77d6a[_0xd012('0x4b')][_0xd012('0x5b')]){_0x4f6471['include']=[{'all':!![]}];}_0x4f6471=_[_0xd012('0x59')]({},_0x4f6471,_0x77d6a['options']);return db['FaxAccount'][_0xd012('0x5f')](_0x4f6471)[_0xd012('0x39')](handleEntityNotFound(_0x3c321b,null))['then'](respondWithResult(_0x3c321b,null))[_0xd012('0x2c')](handleError(_0x3c321b,null));};exports[_0xd012('0x60')]=function(_0x76c27c,_0x56a46f){return db[_0xd012('0x46')][_0xd012('0x60')](_0x76c27c[_0xd012('0x61')],{})[_0xd012('0x39')](function(_0x206982){var _0x390550=_0x76c27c[_0xd012('0x62')]['get']({'plain':!![]});if(!_0x390550)throw new Error(_0xd012('0x63'));if(_0x390550[_0xd012('0x64')]===_0xd012('0x62')){var _0x19053f=_0x206982['get']({'plain':!![]});var _0x41370b=_0xd012('0x3c');return db[_0xd012('0x65')][_0xd012('0x5f')]({'where':{'name':_0x41370b,'userProfileId':_0x390550[_0xd012('0x66')]},'raw':!![]})['then'](function(_0x481836){if(_0x481836&&_0x481836[_0xd012('0x67')]===0x0){return db[_0xd012('0x3d')][_0xd012('0x60')]({'name':_0x19053f[_0xd012('0x40')],'resourceId':_0x19053f['id'],'type':_0x481836[_0xd012('0x40')],'sectionId':_0x481836['id']},{})['then'](function(){return _0x206982;});}else{return _0x206982;}})[_0xd012('0x2c')](function(_0x40f2f6){logger[_0xd012('0x2a')](_0xd012('0x68'),_0x40f2f6);throw _0x40f2f6;});}return _0x206982;})[_0xd012('0x39')](respondWithResult(_0x56a46f,0xc9))[_0xd012('0x2c')](handleError(_0x56a46f,null));};exports['update']=function(_0x36653f,_0x4a0bbb){if(_0x36653f[_0xd012('0x61')]['id']){delete _0x36653f[_0xd012('0x61')]['id'];}return db['FaxAccount'][_0xd012('0x5f')]({'where':{'id':_0x36653f['params']['id']},'include':[{'model':db[_0xd012('0x43')],'as':_0xd012('0x44')}]})[_0xd012('0x39')](handleEntityNotFound(_0x4a0bbb,null))[_0xd012('0x39')](saveUpdates(_0x36653f['body'],null))[_0xd012('0x39')](respondWithResult(_0x4a0bbb,null))[_0xd012('0x2c')](handleError(_0x4a0bbb,null));};exports[_0xd012('0x3a')]=function(_0x2df783,_0x5bee7b){return db[_0xd012('0x46')][_0xd012('0x5f')]({'where':{'id':_0x2df783[_0xd012('0x5e')]['id']}})[_0xd012('0x39')](handleEntityNotFound(_0x5bee7b,null))[_0xd012('0x39')](removeEntity(_0x5bee7b,null))[_0xd012('0x2c')](handleError(_0x5bee7b,null));};exports[_0xd012('0x69')]=function(_0x3169df,_0x60a847){return db[_0xd012('0x46')][_0xd012('0x69')]()['then'](respondWithResult(_0x60a847,null))[_0xd012('0x2c')](handleError(_0x60a847,null));};exports['addDisposition']=function(_0x49dfd7,_0x53662e,_0xce2604){if(_0x49dfd7[_0xd012('0x61')]['id']){delete _0x49dfd7[_0xd012('0x61')]['id'];}return db[_0xd012('0x46')][_0xd012('0x5f')]({'where':{'id':_0x49dfd7['params']['id']}})[_0xd012('0x39')](handleEntityNotFound(_0x53662e,null))[_0xd012('0x39')](function(_0x592844){if(_0x592844){_0x49dfd7[_0xd012('0x61')][_0xd012('0x6a')]=_0x592844['id'];return db[_0xd012('0x6b')][_0xd012('0x60')](_0x49dfd7[_0xd012('0x61')]);}})[_0xd012('0x39')](respondWithResult(_0x53662e,null))[_0xd012('0x2c')](handleError(_0x53662e,null));};exports[_0xd012('0x6c')]=function(_0x149ead,_0x299b43,_0x5a0a83){var _0x25a38b={'raw':![],'where':{}};var _0x3c9975={};var _0x19716b={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd012('0x6d')]({'where':{'id':_0x149ead[_0xd012('0x5e')]['id']}})[_0xd012('0x39')](handleEntityNotFound(_0x299b43,null))[_0xd012('0x39')](function(_0x30b075){if(_0x30b075){_0x3c9975[_0xd012('0x4f')]=_[_0xd012('0x4c')](db['Disposition']['rawAttributes']);_0x3c9975['query']=_[_0xd012('0x4c')](_0x149ead[_0xd012('0x4b')]);_0x3c9975[_0xd012('0x4d')]=_['intersection'](_0x3c9975[_0xd012('0x4f')],_0x3c9975[_0xd012('0x4b')]);_0x25a38b['attributes']=_[_0xd012('0x4e')](_0x3c9975[_0xd012('0x4f')],qs[_0xd012('0x50')](_0x149ead['query'][_0xd012('0x50')]));_0x25a38b[_0xd012('0x51')]=_0x25a38b['attributes'][_0xd012('0x52')]?_0x25a38b[_0xd012('0x51')]:_0x3c9975[_0xd012('0x4f')];if(!_0x149ead[_0xd012('0x4b')][_0xd012('0x53')](_0xd012('0x54'))){_0x25a38b['limit']=qs[_0xd012('0x32')](_0x149ead['query']['limit']);_0x25a38b['offset']=qs['offset'](_0x149ead[_0xd012('0x4b')][_0xd012('0x30')]);}_0x25a38b['order']=qs[_0xd012('0x56')](_0x149ead['query'][_0xd012('0x56')]);_0x25a38b['where']=qs[_0xd012('0x4d')](_[_0xd012('0x58')](_0x149ead[_0xd012('0x4b')],_0x3c9975[_0xd012('0x4d')]));_0x25a38b[_0xd012('0x57')][_0xd012('0x6a')]=_0x30b075['id'];if(_0x149ead[_0xd012('0x4b')][_0xd012('0x6e')]){_0x25a38b[_0xd012('0x57')]=_[_0xd012('0x59')](_0x25a38b[_0xd012('0x57')],{'$or':_[_0xd012('0x45')](_0x25a38b[_0xd012('0x51')],function(_0x262b1a){var _0x59e6e6={};_0x59e6e6[_0x262b1a]={'$like':'%'+_0x149ead[_0xd012('0x4b')][_0xd012('0x6e')]+'%'};return _0x59e6e6;})});}_0x25a38b=_[_0xd012('0x59')]({},_0x25a38b,_0x149ead[_0xd012('0x6f')]);return db['Disposition']['count']({'where':_0x25a38b['where']})[_0xd012('0x39')](function(_0x171615){_0x19716b[_0xd012('0x33')]=_0x171615;if(_0x149ead[_0xd012('0x4b')][_0xd012('0x5b')]){_0x25a38b[_0xd012('0x70')]=[{'all':!![]}];}return db[_0xd012('0x6b')][_0xd012('0x71')](_0x25a38b);})['then'](function(_0x1f21dc){_0x19716b[_0xd012('0x5c')]=_0x1f21dc;return _0x19716b;});}})[_0xd012('0x39')](respondWithFilteredResult(_0x299b43,_0x25a38b))[_0xd012('0x2c')](handleError(_0x299b43,null));};exports[_0xd012('0x72')]=function(_0x1e7c83,_0x5dfb41,_0x16b1a4){return db[_0xd012('0x46')][_0xd012('0x5f')]({'where':{'id':_0x1e7c83[_0xd012('0x5e')]['id']}})[_0xd012('0x39')](handleEntityNotFound(_0x5dfb41,null))['then'](function(_0x12f3d9){if(_0x12f3d9){return _0x12f3d9[_0xd012('0x72')](_0x1e7c83['query']['ids']);}})[_0xd012('0x39')](respondWithStatusCode(_0x5dfb41,null))[_0xd012('0x2c')](handleError(_0x5dfb41,null));};exports[_0xd012('0x73')]=function(_0x253258,_0x154a98,_0x29f7d5){if(_0x253258[_0xd012('0x61')]['id']){delete _0x253258[_0xd012('0x61')]['id'];}return db['FaxAccount'][_0xd012('0x5f')]({'where':{'id':_0x253258[_0xd012('0x5e')]['id']}})[_0xd012('0x39')](handleEntityNotFound(_0x154a98,null))[_0xd012('0x39')](function(_0x24967c){if(_0x24967c){_0x253258['body'][_0xd012('0x6a')]=_0x24967c['id'];return db[_0xd012('0x74')][_0xd012('0x60')](_0x253258[_0xd012('0x61')]);}})[_0xd012('0x39')](respondWithResult(_0x154a98,null))[_0xd012('0x2c')](handleError(_0x154a98,null));};exports['getAnswers']=function(_0xcd40e2,_0x3beb48,_0x2082c2){var _0x4d0e2d={'raw':![],'where':{}};var _0x40918c={};var _0x52fb20={'count':0x0,'rows':[]};return db[_0xd012('0x46')][_0xd012('0x6d')]({'where':{'id':_0xcd40e2['params']['id']}})[_0xd012('0x39')](handleEntityNotFound(_0x3beb48,null))[_0xd012('0x39')](function(_0x7625ca){if(_0x7625ca){_0x40918c[_0xd012('0x4f')]=_[_0xd012('0x4c')](db[_0xd012('0x74')][_0xd012('0x47')]);_0x40918c[_0xd012('0x4b')]=_[_0xd012('0x4c')](_0xcd40e2['query']);_0x40918c[_0xd012('0x4d')]=_[_0xd012('0x4e')](_0x40918c[_0xd012('0x4f')],_0x40918c[_0xd012('0x4b')]);_0x4d0e2d[_0xd012('0x51')]=_[_0xd012('0x4e')](_0x40918c[_0xd012('0x4f')],qs['fields'](_0xcd40e2[_0xd012('0x4b')][_0xd012('0x50')]));_0x4d0e2d[_0xd012('0x51')]=_0x4d0e2d[_0xd012('0x51')][_0xd012('0x52')]?_0x4d0e2d[_0xd012('0x51')]:_0x40918c[_0xd012('0x4f')];if(!_0xcd40e2['query'][_0xd012('0x53')](_0xd012('0x54'))){_0x4d0e2d[_0xd012('0x32')]=qs['limit'](_0xcd40e2[_0xd012('0x4b')][_0xd012('0x32')]);_0x4d0e2d[_0xd012('0x30')]=qs['offset'](_0xcd40e2['query'][_0xd012('0x30')]);}_0x4d0e2d[_0xd012('0x55')]=qs[_0xd012('0x56')](_0xcd40e2[_0xd012('0x4b')][_0xd012('0x56')]);_0x4d0e2d[_0xd012('0x57')]=qs[_0xd012('0x4d')](_['pick'](_0xcd40e2[_0xd012('0x4b')],_0x40918c['filters']));_0x4d0e2d['where'][_0xd012('0x6a')]=_0x7625ca['id'];if(_0xcd40e2[_0xd012('0x4b')][_0xd012('0x6e')]){_0x4d0e2d['where']=_['merge'](_0x4d0e2d['where'],{'$or':_[_0xd012('0x45')](_0x4d0e2d['attributes'],function(_0x45eadf){var _0x54eda8={};_0x54eda8[_0x45eadf]={'$like':'%'+_0xcd40e2['query']['filter']+'%'};return _0x54eda8;})});}_0x4d0e2d=_[_0xd012('0x59')]({},_0x4d0e2d,_0xcd40e2[_0xd012('0x6f')]);return db[_0xd012('0x74')][_0xd012('0x33')]({'where':_0x4d0e2d[_0xd012('0x57')]})[_0xd012('0x39')](function(_0x4b9e9b){_0x52fb20[_0xd012('0x33')]=_0x4b9e9b;if(_0xcd40e2['query'][_0xd012('0x5b')]){_0x4d0e2d[_0xd012('0x70')]=[{'all':!![]}];}return db[_0xd012('0x74')]['findAll'](_0x4d0e2d);})[_0xd012('0x39')](function(_0x46e173){_0x52fb20[_0xd012('0x5c')]=_0x46e173;return _0x52fb20;});}})['then'](respondWithFilteredResult(_0x3beb48,_0x4d0e2d))[_0xd012('0x2c')](handleError(_0x3beb48,null));};exports['removeAnswers']=function(_0x9f39d0,_0x84c82,_0x568e4e){return db[_0xd012('0x46')][_0xd012('0x5f')]({'where':{'id':_0x9f39d0[_0xd012('0x5e')]['id']}})[_0xd012('0x39')](handleEntityNotFound(_0x84c82,null))['then'](function(_0x4afc45){if(_0x4afc45){return _0x4afc45[_0xd012('0x75')](_0x9f39d0['query'][_0xd012('0x76')]);}})['then'](respondWithStatusCode(_0x84c82,null))[_0xd012('0x2c')](handleError(_0x84c82,null));};exports[_0xd012('0x77')]=function(_0x4f26be,_0x169f7b,_0x51c4f6){return db[_0xd012('0x78')][_0xd012('0x5f')]({'where':{'id':_0x4f26be[_0xd012('0x5e')]['id']}})[_0xd012('0x39')](handleEntityNotFound(_0x169f7b,null))[_0xd012('0x39')](function(_0x3c9eae){if(_0x3c9eae){return _0x3c9eae[_0xd012('0x77')](_0x4f26be[_0xd012('0x61')][_0xd012('0x76')],_[_0xd012('0x79')](_0x4f26be[_0xd012('0x61')],['ids','id'])||{});}})[_0xd012('0x39')](respondWithResult(_0x169f7b,null))['catch'](handleError(_0x169f7b,null));};exports[_0xd012('0x7a')]=function(_0x22c2bd,_0x27cbf3,_0x148883){var _0x26f38b={'raw':![],'where':{}};var _0x96d91b={};var _0x6c14f4={'count':0x0,'rows':[]};return db[_0xd012('0x46')][_0xd012('0x6d')]({'where':{'id':_0x22c2bd['params']['id']}})['then'](handleEntityNotFound(_0x27cbf3,null))[_0xd012('0x39')](function(_0xce05de){if(_0xce05de){_0x96d91b[_0xd012('0x4f')]=_['keys'](db[_0xd012('0x78')][_0xd012('0x47')]);_0x96d91b['query']=_[_0xd012('0x4c')](_0x22c2bd[_0xd012('0x4b')]);_0x96d91b['filters']=_['intersection'](_0x96d91b['model'],_0x96d91b[_0xd012('0x4b')]);_0x26f38b[_0xd012('0x51')]=_[_0xd012('0x4e')](_0x96d91b[_0xd012('0x4f')],qs[_0xd012('0x50')](_0x22c2bd[_0xd012('0x4b')][_0xd012('0x50')]));_0x26f38b[_0xd012('0x51')]=_0x26f38b[_0xd012('0x51')]['length']?_0x26f38b[_0xd012('0x51')]:_0x96d91b[_0xd012('0x4f')];if(!_0x22c2bd[_0xd012('0x4b')]['hasOwnProperty'](_0xd012('0x54'))){_0x26f38b[_0xd012('0x32')]=qs['limit'](_0x22c2bd[_0xd012('0x4b')][_0xd012('0x32')]);_0x26f38b[_0xd012('0x30')]=qs['offset'](_0x22c2bd[_0xd012('0x4b')]['offset']);}_0x26f38b[_0xd012('0x55')]=qs[_0xd012('0x56')](_0x22c2bd[_0xd012('0x4b')][_0xd012('0x56')]);_0x26f38b[_0xd012('0x57')]=qs[_0xd012('0x4d')](_[_0xd012('0x58')](_0x22c2bd[_0xd012('0x4b')],_0x96d91b[_0xd012('0x4d')]));_0x26f38b[_0xd012('0x57')]['FaxAccountId']=_0xce05de['id'];if(_0x22c2bd[_0xd012('0x4b')]['filter']){_0x26f38b[_0xd012('0x57')]=_[_0xd012('0x59')](_0x26f38b[_0xd012('0x57')],{'$or':_[_0xd012('0x45')](_0x26f38b['attributes'],function(_0x3da515){var _0x334499={};_0x334499[_0x3da515]={'$like':'%'+_0x22c2bd[_0xd012('0x4b')][_0xd012('0x6e')]+'%'};return _0x334499;})});}_0x26f38b=_[_0xd012('0x59')]({},_0x26f38b,_0x22c2bd[_0xd012('0x6f')]);return db[_0xd012('0x78')][_0xd012('0x33')]({'where':_0x26f38b['where']})['then'](function(_0x27b094){_0x6c14f4[_0xd012('0x33')]=_0x27b094;if(_0x22c2bd[_0xd012('0x4b')][_0xd012('0x5b')]){_0x26f38b['include']=[{'model':db[_0xd012('0x7b')],'as':_0xd012('0x7c'),'required':![]},{'model':db[_0xd012('0x7d')],'as':_0xd012('0x7e'),'attributes':['name',_0xd012('0x7f'),_0xd012('0x80')],'required':![]},{'model':db[_0xd012('0x81')],'as':_0xd012('0x82'),'attributes':['id','name',_0xd012('0x83')],'where':_0x22c2bd[_0xd012('0x4b')]['tag']?{'id':_0x22c2bd[_0xd012('0x4b')][_0xd012('0x84')]}:undefined,'required':_0x22c2bd[_0xd012('0x4b')][_0xd012('0x84')]?!![]:![]}];}return db['FaxInteraction'][_0xd012('0x71')](_0x26f38b);})[_0xd012('0x39')](function(_0x376a2d){_0x6c14f4[_0xd012('0x5c')]=_0x376a2d;return _0x6c14f4;});}})[_0xd012('0x39')](respondWithFilteredResult(_0x27cbf3,_0x26f38b))[_0xd012('0x2c')](handleError(_0x27cbf3,null));};exports['addApplications']=function(_0x5e9519,_0x302a77){var _0x2a7ff5=_0x5e9519[_0xd012('0x5e')]['id'];var _0x2ccfc2=_0x5e9519['body'];var _0x1a70ff=0xc8;var _0x54dc9c=null;return db[_0xd012('0x85')][_0xd012('0x86')]({'isolationLevel':db['sequelize'][_0xd012('0x87')][_0xd012('0x88')][_0xd012('0x89')]},function(_0x42d9a3){return db[_0xd012('0x46')]['findOne']({'where':{'id':_0x2a7ff5},'transaction':_0x42d9a3})[_0xd012('0x39')](function(_0x5b1f6e){if(_0x5b1f6e){return db[_0xd012('0x8a')]['destroy']({'where':{'FaxAccountId':_0x2a7ff5},'transaction':_0x42d9a3})[_0xd012('0x39')](function(){var _0x48c87a=_[_0xd012('0x45')](_0x2ccfc2,function(_0x920938){_0x920938[_0xd012('0x6a')]=_0x2a7ff5;return _0x920938;});return db[_0xd012('0x8a')]['bulkCreate'](_0x48c87a,{'transaction':_0x42d9a3});});}else{_0x1a70ff=0x194;_0x54dc9c=[];}});})[_0xd012('0x39')](function(){if(_0x1a70ff!==0x194){return db[_0xd012('0x8a')][_0xd012('0x8b')]({'where':{'FaxAccountId':_0x2a7ff5},'order':_0xd012('0x8c')})['then'](function(_0x778e0d){_0x54dc9c=_0x778e0d;});}})[_0xd012('0x2c')](function(_0x1a6a07){_0x1a70ff=0x1f4;logger[_0xd012('0x2a')](_0x1a6a07[_0xd012('0x3f')]);if(_0x1a6a07['name']){delete _0x1a6a07[_0xd012('0x40')];}_0x54dc9c=_0x1a6a07;})['finally'](function(){if(_0x54dc9c===null){_0x302a77['sendStatus'](_0x1a70ff);}else{if(_0x1a70ff===0x1f4){_0x302a77[_0xd012('0x2d')](_0x1a70ff)[_0xd012('0x41')](_0x54dc9c);}else{_0x302a77[_0xd012('0x2d')](_0x1a70ff)[_0xd012('0x2f')](_0x54dc9c);}}});};exports[_0xd012('0x8d')]=function(_0x4fd3c7,_0x138aa0,_0x4a76d6){var _0x5ea944={};var _0x111a03={};var _0x423af1;var _0x84e84b;return db[_0xd012('0x46')]['findOne']({'where':{'id':_0x4fd3c7[_0xd012('0x5e')]['id']}})[_0xd012('0x39')](handleEntityNotFound(_0x138aa0,null))[_0xd012('0x39')](function(_0x403ba9){if(_0x403ba9){_0x423af1=_0x403ba9;_0x111a03[_0xd012('0x4f')]=_[_0xd012('0x4c')](db[_0xd012('0x8a')]['rawAttributes']);_0x111a03[_0xd012('0x4b')]=_[_0xd012('0x4c')](_0x4fd3c7[_0xd012('0x4b')]);_0x111a03[_0xd012('0x4d')]=_[_0xd012('0x4e')](_0x111a03[_0xd012('0x4f')],_0x111a03['query']);_0x5ea944[_0xd012('0x51')]=_[_0xd012('0x4e')](_0x111a03[_0xd012('0x4f')],qs[_0xd012('0x50')](_0x4fd3c7[_0xd012('0x4b')][_0xd012('0x50')]));_0x5ea944[_0xd012('0x51')]=_0x5ea944['attributes'][_0xd012('0x52')]?_0x5ea944[_0xd012('0x51')]:_0x111a03[_0xd012('0x4f')];_0x5ea944[_0xd012('0x55')]=qs['sort'](_0x4fd3c7[_0xd012('0x4b')][_0xd012('0x56')]);_0x5ea944[_0xd012('0x57')]=qs[_0xd012('0x4d')](_[_0xd012('0x58')](_0x4fd3c7[_0xd012('0x4b')],_0x111a03[_0xd012('0x4d')]));if(_0x4fd3c7[_0xd012('0x4b')]['filter']){_0x5ea944[_0xd012('0x57')]=_[_0xd012('0x59')](_0x5ea944[_0xd012('0x57')],{'$or':_['map'](_0x5ea944['attributes'],function(_0x110632){var _0x24c286={};_0x24c286[_0x110632]={'$like':'%'+_0x4fd3c7[_0xd012('0x4b')][_0xd012('0x6e')]+'%'};return _0x24c286;})});}_0x5ea944=_[_0xd012('0x59')]({},_0x5ea944,_0x4fd3c7['options']);return _0x423af1[_0xd012('0x8d')](_0x5ea944);}})[_0xd012('0x39')](function(_0xf8270c){if(_0xf8270c){_0x84e84b=_0xf8270c[_0xd012('0x52')];if(!_0x4fd3c7[_0xd012('0x4b')]['hasOwnProperty'](_0xd012('0x54'))){_0x5ea944['limit']=qs[_0xd012('0x32')](_0x4fd3c7[_0xd012('0x4b')][_0xd012('0x32')]);_0x5ea944[_0xd012('0x30')]=qs[_0xd012('0x30')](_0x4fd3c7['query']['offset']);}return _0x423af1[_0xd012('0x8d')](_0x5ea944);}})[_0xd012('0x39')](function(_0x4f6407){if(_0x4f6407){return _0x4f6407?{'count':_0x84e84b,'rows':_0x4f6407}:null;}})[_0xd012('0x39')](respondWithResult(_0x138aa0,null))[_0xd012('0x2c')](handleError(_0x138aa0,null));};function Extension(_0x5a66f2,_0xa98fd6,_0x49ad91,_0x129f73){this[_0xd012('0x8e')]=_0xd012('0x8f');this[_0xd012('0x90')]=_0x5a66f2['localstationid'];this[_0xd012('0x91')]=_0x129f73;this[_0xd012('0x49')]=_0xd012('0x92');this[_0xd012('0x93')]=_0xd012('0x94');this[_0xd012('0x6a')]=_0x5a66f2['id'];this['priority']=_0xa98fd6;this[_0xd012('0x95')]=_0x49ad91;}function createExtensionsReciveFax(_0x598bb9){var _0x3b980b=0x1;var _0x46aef9=[];_0x46aef9[_0xd012('0x96')](new Extension(_0x598bb9,_0x3b980b,'',_0xd012('0x97')));_0x3b980b+=0x1;_0x46aef9[_0xd012('0x96')](new Extension(_0x598bb9,_0x3b980b,_0xd012('0x98'),'Set'));_0x3b980b+=0x1;for(var _0x2f9abd in _0x598bb9){if(_0x598bb9[_0xd012('0x53')](_0x2f9abd)&&(_0x2f9abd==='ecm'||_0x2f9abd===_0xd012('0x99')||_0x2f9abd===_0xd012('0x9a')||_0x2f9abd===_0xd012('0x9b')||_0x2f9abd===_0xd012('0x9c')||_0x2f9abd===_0xd012('0x9d')||_0x2f9abd===_0xd012('0x9e')||_0x2f9abd===_0xd012('0x9f')||_0x2f9abd===_0xd012('0xa0'))){_0x46aef9['push'](new Extension(_0x598bb9,_0x3b980b,'FAXOPT('+_0x2f9abd+')='+_0x598bb9[_0x2f9abd],_0xd012('0xa1')));_0x3b980b+=0x1;}}_0x46aef9[_0xd012('0x96')](new Extension(_0x598bb9,_0x3b980b,'6','Wait'));_0x3b980b+=0x1;_0x46aef9[_0xd012('0x96')](new Extension(_0x598bb9,_0x3b980b,_0xd012('0xa2'),_0xd012('0xa3')));_0x3b980b=0x0;return _0x46aef9;}exports[_0xd012('0xa4')]=function(_0x29fb74,_0x1da3ea,_0x41a0eb){var _0x571ba6;return db[_0xd012('0x85')][_0xd012('0x86')](function(_0xecfbd1){return db['FaxAccount'][_0xd012('0x60')](_0x29fb74[_0xd012('0x61')],{'transaction':_0xecfbd1})[_0xd012('0x39')](function(_0x2eb475){_0x571ba6=_0x2eb475['get']({'plain':!![]});return db[_0xd012('0xa5')][_0xd012('0xa6')](createExtensionsReciveFax(_0x571ba6),{'transaction':_0xecfbd1});});})[_0xd012('0x39')](function(){return _0x571ba6;})['then'](respondWithResult(_0x1da3ea,null))['catch'](handleError(_0x1da3ea,null));};exports[_0xd012('0xa7')]=function(_0x181148,_0x115765,_0x195ab1){var _0x2a0ec4;return db[_0xd012('0x85')][_0xd012('0x86')](function(_0x234f27){return db['FaxAccount'][_0xd012('0x38')](_0x181148[_0xd012('0x61')],{'where':{'id':_0x181148[_0xd012('0x61')]['id']},'transaction':_0x234f27})[_0xd012('0x39')](function(_0x45a410){return db[_0xd012('0xa5')][_0xd012('0x3a')]({'where':{'FaxAccountId':_0x181148[_0xd012('0x61')]['id']},'transaction':_0x234f27})[_0xd012('0x39')](function(_0x2fdc75){return db[_0xd012('0xa5')][_0xd012('0xa6')](createExtensionsReciveFax(_[_0xd012('0x79')](_0x181148[_0xd012('0x61')],['tech',_0xd012('0x4a'),_0xd012('0xa8'),_0xd012('0xa9'),'TrunkId','ListId'])),{'transaction':_0x234f27});});});})['then'](function(){return db['FaxAccount'][_0xd012('0xaa')](_0x181148[_0xd012('0x61')]['id']);})[_0xd012('0x39')](respondWithResult(_0x115765,null))[_0xd012('0x2c')](handleError(_0x115765,null));};exports[_0xd012('0xab')]=function(_0x260f21,_0x2f4f1d,_0x397738){var _0x41980c={'raw':!![],'where':{}};var _0x54ec3c={};var _0x6c6dd5={'count':0x0,'rows':[]};return db[_0xd012('0x46')][_0xd012('0x6d')]({'where':{'id':_0x260f21[_0xd012('0x5e')]['id']}})[_0xd012('0x39')](handleEntityNotFound(_0x2f4f1d,null))['then'](function(_0x272288){if(_0x272288){_0x54ec3c['model']=_[_0xd012('0x4c')](db['FaxMessage']['rawAttributes']);_0x54ec3c[_0xd012('0x4b')]=_[_0xd012('0x4c')](_0x260f21['query']);_0x54ec3c['filters']=_['intersection'](_0x54ec3c[_0xd012('0x4f')],_0x54ec3c[_0xd012('0x4b')]);_0x41980c['attributes']=_[_0xd012('0x4e')](_0x54ec3c['model'],qs[_0xd012('0x50')](_0x260f21[_0xd012('0x4b')][_0xd012('0x50')]));_0x41980c[_0xd012('0x51')]=_0x41980c['attributes'][_0xd012('0x52')]?_0x41980c[_0xd012('0x51')]:_0x54ec3c['model'];if(!_0x260f21['query']['hasOwnProperty'](_0xd012('0x54'))){_0x41980c[_0xd012('0x32')]=qs[_0xd012('0x32')](_0x260f21[_0xd012('0x4b')][_0xd012('0x32')]);_0x41980c['offset']=qs[_0xd012('0x30')](_0x260f21[_0xd012('0x4b')][_0xd012('0x30')]);}_0x41980c[_0xd012('0x55')]=qs[_0xd012('0x56')](_0x260f21[_0xd012('0x4b')]['sort']);_0x41980c[_0xd012('0x57')]=qs[_0xd012('0x4d')](_[_0xd012('0x58')](_0x260f21['query'],_0x54ec3c[_0xd012('0x4d')]));_0x41980c[_0xd012('0x57')][_0xd012('0x6a')]=_0x272288['id'];if(_0x260f21[_0xd012('0x4b')][_0xd012('0x6e')]){_0x41980c[_0xd012('0x57')]=_[_0xd012('0x59')](_0x41980c[_0xd012('0x57')],{'$or':_[_0xd012('0x45')](_0x41980c[_0xd012('0x51')],function(_0x3c5ec0){var _0x34afaa={};_0x34afaa[_0x3c5ec0]={'$like':'%'+_0x260f21[_0xd012('0x4b')][_0xd012('0x6e')]+'%'};return _0x34afaa;})});}if(_0x260f21[_0xd012('0x4b')][_0xd012('0xac')]){var _0x2e5c44=_0x260f21[_0xd012('0x4b')][_0xd012('0xac')][_0xd012('0xad')](',');var _0xbe86ce={};_0xbe86ce[_0x2e5c44[0x0]]={'$gte':moment(_0x2e5c44[0x1])['format'](_0xd012('0xae'))};_0x41980c['where']=_[_0xd012('0x59')](_0x41980c['where'],_0xbe86ce);}_0x41980c=_[_0xd012('0x59')]({},_0x41980c,_0x260f21[_0xd012('0x6f')]);return db[_0xd012('0xaf')][_0xd012('0x33')]({'where':_0x41980c['where']})[_0xd012('0x39')](function(_0x5e1bf0){_0x6c6dd5[_0xd012('0x33')]=_0x5e1bf0;if(_0x260f21['query'][_0xd012('0x5b')]){_0x41980c[_0xd012('0x70')]=[{'all':!![]}];}return db[_0xd012('0xaf')][_0xd012('0x71')](_0x41980c);})[_0xd012('0x39')](function(_0x3eb13f){_0x6c6dd5[_0xd012('0x5c')]=_0x3eb13f;return _0x6c6dd5;});}})[_0xd012('0x39')](respondWithFilteredResult(_0x2f4f1d,_0x41980c))[_0xd012('0x2c')](handleError(_0x2f4f1d,null));};exports[_0xd012('0x41')]=function(_0x48cd7a,_0x49df37,_0x1a8a99){var _0x27c1ac,_0x48d0fd={},_0x201a9b;if(_0x48cd7a['body']['to']){_0x201a9b=_0x48cd7a[_0xd012('0x61')]['to'][0x0];}return db[_0xd012('0x46')]['find']({'where':{'id':_0x48cd7a[_0xd012('0x5e')]['id']},'include':[{'model':db[_0xd012('0xb0')],'as':_0xd012('0xb1'),'include':[{'model':db[_0xd012('0x7b')],'as':_0xd012('0xb2'),'where':{'fax':_0x201a9b},'limit':0x1,'order':[[_0xd012('0xa9'),'DESC']]}]}]})[_0xd012('0x39')](handleEntityNotFound(_0x49df37,null))[_0xd012('0x39')](function(_0x2fa102){_0x27c1ac=_0x2fa102;if(_0x48cd7a[_0xd012('0x61')]['attachments']&&_0x48cd7a[_0xd012('0x61')]['attachments'][_0xd012('0x52')]){for(var _0x1b372b=0x0;_0x1b372b<_0x48cd7a['body'][_0xd012('0xb3')][_0xd012('0x52')];_0x1b372b+=0x1){_0x48cd7a['body'][_0xd012('0xb3')][_0x1b372b]={'filename':_0x48cd7a['body'][_0xd012('0xb3')][_0x1b372b]['name'],'id':_0x48cd7a[_0xd012('0x61')][_0xd012('0xb3')][_0x1b372b]['id'],'path':path[_0xd012('0xb4')](config[_0xd012('0xb5')],_0xd012('0xb6'),_0x48cd7a['body'][_0xd012('0xb3')][_0x1b372b][_0xd012('0xb7')])};}}return respondWithRpcPromise(_0xd012('0xb8'),_0xd012('0xb8'),{'FaxAccountId':_['isNil'](_0x48cd7a['params']['id'])?undefined:_0x48cd7a[_0xd012('0x5e')]['id'],'path':_['isNil'](_0x48cd7a[_0xd012('0x61')]['attachments'][0x0][_0xd012('0x9')])?undefined:_0x48cd7a[_0xd012('0x61')][_0xd012('0xb3')][0x0][_0xd012('0x9')],'fax':_['isNil'](_0x48cd7a['body']['to'][0x0])?undefined:_0x48cd7a['body']['to'][0x0]},client9002);})[_0xd012('0x39')](function(){if(_0x27c1ac){if(_[_0xd012('0xb9')](_0x48cd7a[_0xd012('0x61')][_0xd012('0xba')])){_0x48cd7a[_0xd012('0x61')]['from']=util['format'](_0xd012('0xbb'),_0x27c1ac[_0xd012('0x40')],_0x27c1ac[_0xd012('0xbc')]);}if(_0x27c1ac[_0xd012('0xb1')]){if(_0x27c1ac[_0xd012('0xb1')][_0xd012('0xb2')][_0xd012('0x52')]){return _0x27c1ac['List'][_0xd012('0xb2')][0x0];}else{return db['CmContact'][_0xd012('0x60')](_[_0xd012('0x1b')](_0x48cd7a[_0xd012('0x61')],{'firstName':_0x48cd7a[_0xd012('0x61')]['to'][0x0],'phone':_0x48cd7a[_0xd012('0x61')]['to'][0x0],'fax':_0x48cd7a[_0xd012('0x61')]['to'][0x0],'ListId':_0x27c1ac[_0xd012('0xbd')]}));}}else{throw new Error(_0xd012('0xbe'));}}else{throw new Error(_0xd012('0xbf'));}})[_0xd012('0x39')](function(_0x5457a9){if(_0x5457a9){return db[_0xd012('0x78')]['find']({'where':{'ContactId':_0x5457a9['id'],'closed':![],'FaxAccountId':_0x27c1ac['id']}})[_0xd012('0x39')](function(_0x210a6f){if(_0x210a6f){return[_0x210a6f,![]];}return db['FaxInteraction']['create']({'UserId':_0x48cd7a['user']['id'],'ContactId':_0x5457a9['id'],'FaxAccountId':_0x27c1ac['id'],'fax':_0x48cd7a[_0xd012('0x61')]['to'][0x0],'firstMsgDirection':_0xd012('0xc0'),'Messages':[_[_0xd012('0x59')](_0x48cd7a[_0xd012('0x61')],{'read':![],'body':_0x48cd7a['body'][_0xd012('0xb3')][0x0][_0xd012('0xc1')],'FaxAccountId':_0x27c1ac['id'],'UserId':_0x48cd7a[_0xd012('0x62')]['id'],'ContactId':_0x5457a9['id'],'AttachmentId':_0x48cd7a[_0xd012('0x61')][_0xd012('0xb3')][0x0]['id']})]},{'include':[{'model':db[_0xd012('0xaf')],'as':_0xd012('0xc2')}]})[_0xd012('0x39')](function(_0x50f116){return[_0x50f116,!![]];});});}else{throw new Error(_0xd012('0xc3'));}})[_0xd012('0xc4')](function(_0x25d841,_0x5de891){if(_0x5de891){return _0x25d841;}return db[_0xd012('0xaf')][_0xd012('0x60')]({'direction':_0xd012('0xc0'),'read':![],'body':_0x48cd7a[_0xd012('0x61')][_0xd012('0xb3')][0x0][_0xd012('0xc1')],'FaxAccountId':_0x27c1ac['id'],'FaxInteractionId':_0x25d841['id'],'UserId':_0x48cd7a['user']['id'],'ContactId':_0x25d841['ContactId'],'AttachmentId':_0x48cd7a[_0xd012('0x61')][_0xd012('0xb3')][0x0]['id']})[_0xd012('0x39')](function(_0x3861a6){_0x25d841[_0xd012('0xc5')][_0xd012('0xc2')]=[];_0x25d841[_0xd012('0xc5')][_0xd012('0xc2')][_0xd012('0x96')](_0x3861a6[_0xd012('0xc5')]);return _0x25d841;});})['then'](function(_0xa34356){respondWithRpcPromise('SendFax',_0xd012('0xc6'),{'FaxAccountId':_[_0xd012('0xb9')](_0x48cd7a[_0xd012('0x5e')]['id'])?undefined:_0x48cd7a[_0xd012('0x5e')]['id'],'path':_['isNil'](_0x48cd7a[_0xd012('0x61')][_0xd012('0xb3')][0x0][_0xd012('0x9')])?undefined:_0x48cd7a['body'][_0xd012('0xb3')][0x0][_0xd012('0x9')],'fax':_['isNil'](_0x48cd7a[_0xd012('0x61')]['to'][0x0])?undefined:_0x48cd7a[_0xd012('0x61')]['to'][0x0],'AttachmentId':_0x48cd7a[_0xd012('0x61')]['attachments'][0x0]['id']},client9002)[_0xd012('0x39')](function(_0x18957d){logger[_0xd012('0x24')]('SendFaxRpc,\x20%s',_0x18957d);})[_0xd012('0x2c')](function(_0x35a497){logger[_0xd012('0x24')]('SendFaxRpc,\x20%s',_0x35a497);});return _0xa34356;})[_0xd012('0x39')](respondWithResult(_0x49df37,null))['catch'](handleError(_0x49df37,null));};exports[_0xd012('0xc7')]=function(_0x3512ea,_0x4d26e3,_0x1fafa7){return db[_0xd012('0x46')][_0xd012('0x5f')]({'where':{'id':_0x3512ea[_0xd012('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4d26e3,null))[_0xd012('0x39')](function(_0x406dc7){if(_0x406dc7){return _0x406dc7[_0xd012('0xc7')](_0x3512ea[_0xd012('0x61')]['ids'],_[_0xd012('0x79')](_0x3512ea[_0xd012('0x61')],[_0xd012('0x76'),'id'])||{})[_0xd012('0xc4')](function(_0x900088){for(var _0x86f362=0x0;_0x86f362<_0x3512ea['body']['ids'][_0xd012('0x52')];_0x86f362+=0x1){socket[_0xd012('0xc8')]('userFaxAccount:save',{'UserId':Number(_0x3512ea[_0xd012('0x61')][_0xd012('0x76')][_0x86f362]),'FaxAccountId':Number(_0x3512ea['params']['id'])});}return _0x900088;});}})[_0xd012('0x39')](respondWithResult(_0x4d26e3,null))[_0xd012('0x2c')](handleError(_0x4d26e3,null));};exports[_0xd012('0xc9')]=function(_0x27943a,_0x3c6c33,_0x4b690f){return db[_0xd012('0x46')][_0xd012('0x5f')]({'where':{'id':_0x27943a[_0xd012('0x5e')]['id']}})[_0xd012('0x39')](handleEntityNotFound(_0x3c6c33,null))[_0xd012('0x39')](function(_0x5794cd){if(_0x5794cd){return _0x5794cd[_0xd012('0xc9')](_0x27943a[_0xd012('0x4b')][_0xd012('0x76')])[_0xd012('0x39')](function(){if(_[_0xd012('0xca')](_0x27943a[_0xd012('0x4b')][_0xd012('0x76')])){for(var _0x473ad1=0x0;_0x473ad1<_0x27943a[_0xd012('0x4b')]['ids'][_0xd012('0x52')];_0x473ad1+=0x1){socket[_0xd012('0xc8')]('userFaxAccount:remove',{'UserId':Number(_0x27943a[_0xd012('0x4b')]['ids'][_0x473ad1]),'FaxAccountId':Number(_0x27943a['params']['id'])});}}else{socket[_0xd012('0xc8')]('userFaxAccount:remove',{'UserId':Number(_0x27943a[_0xd012('0x4b')]['ids']),'FaxAccountId':Number(_0x27943a[_0xd012('0x5e')]['id'])});}});}})[_0xd012('0x39')](respondWithStatusCode(_0x3c6c33,null))[_0xd012('0x2c')](handleError(_0x3c6c33,null));};exports['getAgents']=function(_0x1b6c3e,_0x5ad09b,_0x8bd018){var _0x2a65e9={};var _0x13b465={};var _0x27280c;var _0xca1168;return db[_0xd012('0x46')][_0xd012('0x6d')]({'where':{'id':_0x1b6c3e[_0xd012('0x5e')]['id']}})[_0xd012('0x39')](handleEntityNotFound(_0x5ad09b,null))[_0xd012('0x39')](function(_0x10302d){if(_0x10302d){_0x27280c=_0x10302d;_0x13b465[_0xd012('0x4f')]=_[_0xd012('0x4c')](db[_0xd012('0x7d')][_0xd012('0x47')]);_0x13b465['query']=_[_0xd012('0x4c')](_0x1b6c3e['query']);_0x13b465[_0xd012('0x4d')]=_[_0xd012('0x4e')](_0x13b465[_0xd012('0x4f')],_0x13b465[_0xd012('0x4b')]);_0x2a65e9[_0xd012('0x51')]=_[_0xd012('0x4e')](_0x13b465[_0xd012('0x4f')],qs[_0xd012('0x50')](_0x1b6c3e['query'][_0xd012('0x50')]));_0x2a65e9[_0xd012('0x51')]=_0x2a65e9['attributes']['length']?_0x2a65e9['attributes']:_0x13b465['model'];_0x2a65e9[_0xd012('0x55')]=qs[_0xd012('0x56')](_0x1b6c3e[_0xd012('0x4b')][_0xd012('0x56')]);_0x2a65e9[_0xd012('0x57')]=qs['filters'](_[_0xd012('0x58')](_0x1b6c3e[_0xd012('0x4b')],_0x13b465['filters']));if(_0x1b6c3e[_0xd012('0x4b')][_0xd012('0x6e')]){_0x2a65e9[_0xd012('0x57')]=_[_0xd012('0x59')](_0x2a65e9['where'],{'$or':_['map'](_0x2a65e9[_0xd012('0x51')],function(_0x1bfd8d){var _0x150f70={};_0x150f70[_0x1bfd8d]={'$like':'%'+_0x1b6c3e['query'][_0xd012('0x6e')]+'%'};return _0x150f70;})});}_0x2a65e9=_['merge']({},_0x2a65e9,_0x1b6c3e[_0xd012('0x6f')]);return _0x27280c['getAgents'](_0x2a65e9);}})[_0xd012('0x39')](function(_0x22167c){if(_0x22167c){_0xca1168=_0x22167c[_0xd012('0x52')];if(!_0x1b6c3e[_0xd012('0x4b')]['hasOwnProperty'](_0xd012('0x54'))){_0x2a65e9[_0xd012('0x32')]=qs[_0xd012('0x32')](_0x1b6c3e[_0xd012('0x4b')]['limit']);_0x2a65e9[_0xd012('0x30')]=qs[_0xd012('0x30')](_0x1b6c3e[_0xd012('0x4b')][_0xd012('0x30')]);}return _0x27280c[_0xd012('0xcb')](_0x2a65e9);}})[_0xd012('0x39')](function(_0x3c6386){if(_0x3c6386){return _0x3c6386?{'count':_0xca1168,'rows':_0x3c6386}:null;}})['then'](respondWithResult(_0x5ad09b,null))['catch'](handleError(_0x5ad09b,null));}; \ No newline at end of file +var _0x19ab=['Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','Transaction','FaxApplication','bulkCreate','findAndCountAll','finally','status','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','priority','appdata','push','Answer','Set','ecm','gateway','faxdetect','maxrate','minrate','t38timeout','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','VoiceExtension','updateAccountApplications','updatedAt','ListId','findById','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','CmContact','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','Contacts','out','Contact\x20not\x20found','spread','filename','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','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','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','then','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','json','undefined','limit','count','offset','apply','reject','save','update','destroy','FaxAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','create','body','describe','getDispositions','findOne','Disposition','order','pick','FaxAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','ids','FaxInteraction','addInteraction','omit','getInteractions','Contact','User'];(function(_0x2230c4,_0x3c8ac2){var _0x5e9d2e=function(_0x2a9be1){while(--_0x2a9be1){_0x2230c4['push'](_0x2230c4['shift']());}};_0x5e9d2e(++_0x3c8ac2);}(_0x19ab,0x1d0));var _0xb19a=function(_0x5c5553,_0x1c6007){_0x5c5553=_0x5c5553-0x0;var _0x25112d=_0x19ab[_0x5c5553];return _0x25112d;};'use strict';var emlformat=require(_0xb19a('0x0'));var rimraf=require(_0xb19a('0x1'));var zipdir=require(_0xb19a('0x2'));var jsonpatch=require(_0xb19a('0x3'));var rp=require(_0xb19a('0x4'));var moment=require(_0xb19a('0x5'));var BPromise=require(_0xb19a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb19a('0x7'));var sox=require('sox');var csv=require(_0xb19a('0x8'));var ejs=require(_0xb19a('0x9'));var fs=require('fs');var fs_extra=require(_0xb19a('0xa'));var _=require(_0xb19a('0xb'));var squel=require('squel');var crypto=require(_0xb19a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb19a('0x8'));var querystring=require(_0xb19a('0xd'));var Papa=require(_0xb19a('0xe'));var Redis=require(_0xb19a('0xf'));var authService=require(_0xb19a('0x10'));var qs=require(_0xb19a('0x11'));var as=require(_0xb19a('0x12'));var hardwareService=require(_0xb19a('0x13'));var logger=require(_0xb19a('0x14'))('api');var utils=require(_0xb19a('0x15'));var config=require(_0xb19a('0x16'));var licenseUtil=require(_0xb19a('0x17'));var db=require(_0xb19a('0x18'))['db'];config['redis']=_[_0xb19a('0x19')](config[_0xb19a('0x1a')],{'host':_0xb19a('0x1b'),'port':0x18eb});var socket=require(_0xb19a('0x1c'))(new Redis(config[_0xb19a('0x1a')]));require(_0xb19a('0x1d'))[_0xb19a('0x1e')](socket);var jayson=require(_0xb19a('0x1f'));var client=jayson[_0xb19a('0x20')][_0xb19a('0x21')]({'port':0x232c});var client9002=jayson[_0xb19a('0x20')][_0xb19a('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x24b4ac,_0x146ed5,_0x3d6e4f,_0x18ce9d){return new BPromise(function(_0x10317e,_0x414c82){var _0x1244f1=_0x18ce9d||client;return _0x1244f1['request'](_0x24b4ac,_0x3d6e4f)[_0xb19a('0x22')](function(_0x2b4d12){logger[_0xb19a('0x23')](_0xb19a('0x24'),_0x146ed5,'request\x20sent');logger['debug'](_0xb19a('0x25'),_0x146ed5,_0xb19a('0x26'),JSON[_0xb19a('0x27')](_0x2b4d12));if(_0x2b4d12[_0xb19a('0x28')]){if(_0x2b4d12[_0xb19a('0x28')][_0xb19a('0x29')]===0x1f4){logger[_0xb19a('0x28')](_0xb19a('0x24'),_0x146ed5,_0x2b4d12[_0xb19a('0x28')]['message']);return _0x414c82(_0x2b4d12[_0xb19a('0x28')]['message']);}logger[_0xb19a('0x28')](_0xb19a('0x24'),_0x146ed5,_0x2b4d12[_0xb19a('0x28')][_0xb19a('0x2a')]);return _0x10317e(_0x2b4d12[_0xb19a('0x28')][_0xb19a('0x2a')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x146ed5,'request\x20sent');_0x10317e(_0x2b4d12[_0xb19a('0x2b')][_0xb19a('0x2a')]);}})[_0xb19a('0x2c')](function(_0x1fd6ad){logger[_0xb19a('0x28')](_0xb19a('0x24'),_0x146ed5,_0x1fd6ad);_0x414c82(_0x1fd6ad);});});}function respondWithStatusCode(_0xc90c58,_0x1d484a){_0x1d484a=_0x1d484a||0xcc;return function(_0x5e8dd6){if(_0x5e8dd6){return _0xc90c58[_0xb19a('0x2d')](_0x1d484a);}return _0xc90c58['status'](_0x1d484a)[_0xb19a('0x2e')]();};}function respondWithResult(_0x48b295,_0x5aa3c6){_0x5aa3c6=_0x5aa3c6||0xc8;return function(_0x14981c){if(_0x14981c){return _0x48b295['status'](_0x5aa3c6)[_0xb19a('0x2f')](_0x14981c);}};}function respondWithFilteredResult(_0x220d63,_0x185887){return function(_0x3e253b){if(_0x3e253b){var _0x28ee99=typeof _0x185887['offset']===_0xb19a('0x30')&&typeof _0x185887[_0xb19a('0x31')]===_0xb19a('0x30');var _0x553226=_0x3e253b[_0xb19a('0x32')];var _0xc0b752=_0x28ee99?0x0:_0x185887[_0xb19a('0x33')];var _0xfce42f=_0x28ee99?_0x3e253b[_0xb19a('0x32')]:_0x185887['offset']+_0x185887['limit'];var _0x24964d;if(_0xfce42f>=_0x553226){_0xfce42f=_0x553226;_0x24964d=0xc8;}else{_0x24964d=0xce;}_0x220d63['status'](_0x24964d);return _0x220d63['set']('Content-Range',_0xc0b752+'-'+_0xfce42f+'/'+_0x553226)[_0xb19a('0x2f')](_0x3e253b);}return null;};}function patchUpdates(_0x52e05f){return function(_0x48c898){try{jsonpatch[_0xb19a('0x34')](_0x48c898,_0x52e05f,!![]);}catch(_0x3e0e6d){return BPromise[_0xb19a('0x35')](_0x3e0e6d);}return _0x48c898[_0xb19a('0x36')]();};}function saveUpdates(_0x15b906,_0x1fd97a){return function(_0x3d7c6e){if(_0x3d7c6e){return _0x3d7c6e[_0xb19a('0x37')](_0x15b906)[_0xb19a('0x22')](function(_0x1bb212){return _0x1bb212;});}return null;};}function removeEntity(_0x3111f1,_0x527b5c){return function(_0x43e190){if(_0x43e190){return _0x43e190[_0xb19a('0x38')]()[_0xb19a('0x22')](function(){var _0x258017=_0x43e190['get']({'plain':!![]});var _0x1a733e=_0xb19a('0x39');return db[_0xb19a('0x3a')]['destroy']({'where':{'type':_0x1a733e,'resourceId':_0x258017['id']}})[_0xb19a('0x22')](function(){return _0x43e190;});})[_0xb19a('0x22')](function(){_0x3111f1['status'](0xcc)[_0xb19a('0x2e')]();});}};}function handleEntityNotFound(_0x59f1bc,_0x50e09f){return function(_0x5e8aad){if(!_0x5e8aad){_0x59f1bc[_0xb19a('0x2d')](0x194);}return _0x5e8aad;};}function handleError(_0x4eea39,_0xb0736f){_0xb0736f=_0xb0736f||0x1f4;return function(_0x4bc827){logger['error'](_0x4bc827['stack']);if(_0x4bc827[_0xb19a('0x3b')]){delete _0x4bc827[_0xb19a('0x3b')];}_0x4eea39['status'](_0xb0736f)[_0xb19a('0x3c')](_0x4bc827);};}exports[_0xb19a('0x3d')]=function(_0x392d23,_0x64e9ce){var _0x2babae={'include':[{'model':db[_0xb19a('0x3e')],'as':_0xb19a('0x3f')}]},_0x38ae86={},_0x37cfda={'count':0x0,'rows':[]};var _0x5659d1=_[_0xb19a('0x40')](db[_0xb19a('0x41')][_0xb19a('0x42')],function(_0x35c99f){return{'name':_0x35c99f['fieldName'],'type':_0x35c99f[_0xb19a('0x43')][_0xb19a('0x44')]};});_0x38ae86['model']=_[_0xb19a('0x40')](_0x5659d1,_0xb19a('0x3b'));_0x38ae86['query']=_[_0xb19a('0x45')](_0x392d23[_0xb19a('0x46')]);_0x38ae86[_0xb19a('0x47')]=_[_0xb19a('0x48')](_0x38ae86[_0xb19a('0x49')],_0x38ae86[_0xb19a('0x46')]);_0x2babae['attributes']=_[_0xb19a('0x48')](_0x38ae86[_0xb19a('0x49')],qs['fields'](_0x392d23[_0xb19a('0x46')][_0xb19a('0x4a')]));_0x2babae[_0xb19a('0x4b')]=_0x2babae['attributes']['length']?_0x2babae[_0xb19a('0x4b')]:_0x38ae86['model'];if(!_0x392d23[_0xb19a('0x46')][_0xb19a('0x4c')]('nolimit')){_0x2babae['limit']=qs[_0xb19a('0x31')](_0x392d23[_0xb19a('0x46')][_0xb19a('0x31')]);_0x2babae[_0xb19a('0x33')]=qs[_0xb19a('0x33')](_0x392d23[_0xb19a('0x46')][_0xb19a('0x33')]);}_0x2babae['order']=qs[_0xb19a('0x4d')](_0x392d23[_0xb19a('0x46')][_0xb19a('0x4d')]);_0x2babae[_0xb19a('0x4e')]=qs[_0xb19a('0x47')](_['pick'](_0x392d23['query'],_0x38ae86['filters']),_0x5659d1);if(_0x392d23[_0xb19a('0x46')][_0xb19a('0x4f')]){_0x2babae[_0xb19a('0x4e')]=_[_0xb19a('0x50')](_0x2babae[_0xb19a('0x4e')],{'$or':_['map'](_0x5659d1,function(_0x476b9d){if(_0x476b9d['type']!==_0xb19a('0x51')){var _0x26f8c3={};_0x26f8c3[_0x476b9d[_0xb19a('0x3b')]]={'$like':'%'+_0x392d23[_0xb19a('0x46')][_0xb19a('0x4f')]+'%'};return _0x26f8c3;}})});}_0x2babae=_[_0xb19a('0x50')]({},_0x2babae,_0x392d23[_0xb19a('0x52')]);var _0x3fc0f4={'where':_0x2babae['where']};return db[_0xb19a('0x41')][_0xb19a('0x32')](_0x3fc0f4)[_0xb19a('0x22')](function(_0x470ccd){_0x37cfda['count']=_0x470ccd;if(_0x392d23['query'][_0xb19a('0x53')]){_0x2babae[_0xb19a('0x54')]=[{'all':!![]}];}return db[_0xb19a('0x41')][_0xb19a('0x55')](_0x2babae);})['then'](function(_0x5ae734){_0x37cfda[_0xb19a('0x56')]=_0x5ae734;return _0x37cfda;})[_0xb19a('0x22')](respondWithFilteredResult(_0x64e9ce,_0x2babae))[_0xb19a('0x2c')](handleError(_0x64e9ce,null));};exports[_0xb19a('0x57')]=function(_0x710f52,_0x1fd01f){var _0x5af042={'raw':![],'where':{'id':_0x710f52[_0xb19a('0x58')]['id']},'include':[{'model':db[_0xb19a('0x3e')],'as':'mandatoryDispositionPause'}]},_0x18a0f6={};_0x18a0f6[_0xb19a('0x49')]=_[_0xb19a('0x45')](db[_0xb19a('0x41')]['rawAttributes']);_0x18a0f6['query']=_[_0xb19a('0x45')](_0x710f52[_0xb19a('0x46')]);_0x18a0f6[_0xb19a('0x47')]=_['intersection'](_0x18a0f6['model'],_0x18a0f6['query']);_0x5af042[_0xb19a('0x4b')]=_[_0xb19a('0x48')](_0x18a0f6[_0xb19a('0x49')],qs[_0xb19a('0x4a')](_0x710f52[_0xb19a('0x46')][_0xb19a('0x4a')]));_0x5af042[_0xb19a('0x4b')]=_0x5af042[_0xb19a('0x4b')][_0xb19a('0x59')]?_0x5af042[_0xb19a('0x4b')]:_0x18a0f6[_0xb19a('0x49')];if(_0x710f52[_0xb19a('0x46')][_0xb19a('0x53')]){_0x5af042[_0xb19a('0x54')]=[{'all':!![]}];}_0x5af042=_[_0xb19a('0x50')]({},_0x5af042,_0x710f52[_0xb19a('0x52')]);return db[_0xb19a('0x41')][_0xb19a('0x5a')](_0x5af042)[_0xb19a('0x22')](handleEntityNotFound(_0x1fd01f,null))['then'](respondWithResult(_0x1fd01f,null))[_0xb19a('0x2c')](handleError(_0x1fd01f,null));};exports['create']=function(_0x3509b2,_0x2af763){return db[_0xb19a('0x41')]['create'](_0x3509b2['body'],{})['then'](function(_0x417ea6){var _0x4e2785=_0x3509b2['user']['get']({'plain':!![]});if(!_0x4e2785)throw new Error(_0xb19a('0x5b'));if(_0x4e2785['role']===_0xb19a('0x5c')){var _0x5419a2=_0x417ea6[_0xb19a('0x5d')]({'plain':!![]});var _0x3e6f89='FaxAccounts';return db[_0xb19a('0x5e')][_0xb19a('0x5a')]({'where':{'name':_0x3e6f89,'userProfileId':_0x4e2785[_0xb19a('0x5f')]},'raw':!![]})[_0xb19a('0x22')](function(_0x1e1fa9){if(_0x1e1fa9&&_0x1e1fa9['autoAssociation']===0x0){return db[_0xb19a('0x3a')][_0xb19a('0x60')]({'name':_0x5419a2['name'],'resourceId':_0x5419a2['id'],'type':_0x1e1fa9[_0xb19a('0x3b')],'sectionId':_0x1e1fa9['id']},{})[_0xb19a('0x22')](function(){return _0x417ea6;});}else{return _0x417ea6;}})['catch'](function(_0xe094b){logger[_0xb19a('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe094b);throw _0xe094b;});}return _0x417ea6;})['then'](respondWithResult(_0x2af763,0xc9))[_0xb19a('0x2c')](handleError(_0x2af763,null));};exports[_0xb19a('0x37')]=function(_0x3c4783,_0x1a7d17){if(_0x3c4783['body']['id']){delete _0x3c4783['body']['id'];}return db[_0xb19a('0x41')][_0xb19a('0x5a')]({'where':{'id':_0x3c4783[_0xb19a('0x58')]['id']},'include':[{'model':db[_0xb19a('0x3e')],'as':_0xb19a('0x3f')}]})[_0xb19a('0x22')](handleEntityNotFound(_0x1a7d17,null))[_0xb19a('0x22')](saveUpdates(_0x3c4783[_0xb19a('0x61')],null))['then'](respondWithResult(_0x1a7d17,null))[_0xb19a('0x2c')](handleError(_0x1a7d17,null));};exports[_0xb19a('0x38')]=function(_0x4a6908,_0x1514a5){return db[_0xb19a('0x41')][_0xb19a('0x5a')]({'where':{'id':_0x4a6908['params']['id']}})[_0xb19a('0x22')](handleEntityNotFound(_0x1514a5,null))[_0xb19a('0x22')](removeEntity(_0x1514a5,null))[_0xb19a('0x2c')](handleError(_0x1514a5,null));};exports[_0xb19a('0x62')]=function(_0x719cb7,_0x1da678){return db[_0xb19a('0x41')][_0xb19a('0x62')]()['then'](respondWithResult(_0x1da678,null))[_0xb19a('0x2c')](handleError(_0x1da678,null));};exports['addDisposition']=function(_0xab3b78,_0x1531d3,_0x1668b4){if(_0xab3b78['body']['id']){delete _0xab3b78[_0xb19a('0x61')]['id'];}return db['FaxAccount'][_0xb19a('0x5a')]({'where':{'id':_0xab3b78[_0xb19a('0x58')]['id']}})[_0xb19a('0x22')](handleEntityNotFound(_0x1531d3,null))[_0xb19a('0x22')](function(_0x5b73c0){if(_0x5b73c0){_0xab3b78[_0xb19a('0x61')]['FaxAccountId']=_0x5b73c0['id'];return db['Disposition'][_0xb19a('0x60')](_0xab3b78['body']);}})['then'](respondWithResult(_0x1531d3,null))[_0xb19a('0x2c')](handleError(_0x1531d3,null));};exports[_0xb19a('0x63')]=function(_0x53d5c6,_0x2b16c6,_0x2e3ee4){var _0x1b0b20={'raw':![],'where':{}};var _0x23373a={};var _0x3345aa={'count':0x0,'rows':[]};return db[_0xb19a('0x41')][_0xb19a('0x64')]({'where':{'id':_0x53d5c6['params']['id']}})[_0xb19a('0x22')](handleEntityNotFound(_0x2b16c6,null))['then'](function(_0x3f0eca){if(_0x3f0eca){_0x23373a['model']=_[_0xb19a('0x45')](db[_0xb19a('0x65')][_0xb19a('0x42')]);_0x23373a[_0xb19a('0x46')]=_[_0xb19a('0x45')](_0x53d5c6[_0xb19a('0x46')]);_0x23373a[_0xb19a('0x47')]=_[_0xb19a('0x48')](_0x23373a['model'],_0x23373a[_0xb19a('0x46')]);_0x1b0b20['attributes']=_[_0xb19a('0x48')](_0x23373a[_0xb19a('0x49')],qs[_0xb19a('0x4a')](_0x53d5c6[_0xb19a('0x46')]['fields']));_0x1b0b20[_0xb19a('0x4b')]=_0x1b0b20[_0xb19a('0x4b')][_0xb19a('0x59')]?_0x1b0b20[_0xb19a('0x4b')]:_0x23373a[_0xb19a('0x49')];if(!_0x53d5c6[_0xb19a('0x46')][_0xb19a('0x4c')]('nolimit')){_0x1b0b20[_0xb19a('0x31')]=qs['limit'](_0x53d5c6['query'][_0xb19a('0x31')]);_0x1b0b20['offset']=qs[_0xb19a('0x33')](_0x53d5c6['query'][_0xb19a('0x33')]);}_0x1b0b20[_0xb19a('0x66')]=qs[_0xb19a('0x4d')](_0x53d5c6[_0xb19a('0x46')][_0xb19a('0x4d')]);_0x1b0b20[_0xb19a('0x4e')]=qs[_0xb19a('0x47')](_[_0xb19a('0x67')](_0x53d5c6[_0xb19a('0x46')],_0x23373a[_0xb19a('0x47')]));_0x1b0b20[_0xb19a('0x4e')][_0xb19a('0x68')]=_0x3f0eca['id'];if(_0x53d5c6[_0xb19a('0x46')]['filter']){_0x1b0b20[_0xb19a('0x4e')]=_[_0xb19a('0x50')](_0x1b0b20[_0xb19a('0x4e')],{'$or':_[_0xb19a('0x40')](_0x1b0b20[_0xb19a('0x4b')],function(_0x10b2ad){var _0x344197={};_0x344197[_0x10b2ad]={'$like':'%'+_0x53d5c6['query'][_0xb19a('0x4f')]+'%'};return _0x344197;})});}_0x1b0b20=_[_0xb19a('0x50')]({},_0x1b0b20,_0x53d5c6[_0xb19a('0x52')]);return db[_0xb19a('0x65')][_0xb19a('0x32')]({'where':_0x1b0b20[_0xb19a('0x4e')]})['then'](function(_0x45230b){_0x3345aa[_0xb19a('0x32')]=_0x45230b;if(_0x53d5c6[_0xb19a('0x46')][_0xb19a('0x53')]){_0x1b0b20['include']=[{'all':!![]}];}return db[_0xb19a('0x65')]['findAll'](_0x1b0b20);})[_0xb19a('0x22')](function(_0x4f760b){_0x3345aa[_0xb19a('0x56')]=_0x4f760b;return _0x3345aa;});}})['then'](respondWithFilteredResult(_0x2b16c6,_0x1b0b20))[_0xb19a('0x2c')](handleError(_0x2b16c6,null));};exports[_0xb19a('0x69')]=function(_0x2a74d4,_0x58c372,_0x2a0b02){return db[_0xb19a('0x41')]['find']({'where':{'id':_0x2a74d4[_0xb19a('0x58')]['id']}})[_0xb19a('0x22')](handleEntityNotFound(_0x58c372,null))['then'](function(_0x1d7a93){if(_0x1d7a93){return _0x1d7a93['removeDispositions'](_0x2a74d4[_0xb19a('0x46')]['ids']);}})[_0xb19a('0x22')](respondWithStatusCode(_0x58c372,null))[_0xb19a('0x2c')](handleError(_0x58c372,null));};exports[_0xb19a('0x6a')]=function(_0x50b268,_0x1ad3d7,_0x430111){if(_0x50b268[_0xb19a('0x61')]['id']){delete _0x50b268[_0xb19a('0x61')]['id'];}return db[_0xb19a('0x41')]['find']({'where':{'id':_0x50b268[_0xb19a('0x58')]['id']}})[_0xb19a('0x22')](handleEntityNotFound(_0x1ad3d7,null))[_0xb19a('0x22')](function(_0x15fcdb){if(_0x15fcdb){_0x50b268[_0xb19a('0x61')]['FaxAccountId']=_0x15fcdb['id'];return db[_0xb19a('0x6b')][_0xb19a('0x60')](_0x50b268[_0xb19a('0x61')]);}})[_0xb19a('0x22')](respondWithResult(_0x1ad3d7,null))['catch'](handleError(_0x1ad3d7,null));};exports[_0xb19a('0x6c')]=function(_0x5bf1ab,_0x2d6c8c,_0x24d017){var _0x535700={'raw':![],'where':{}};var _0xdaf00c={};var _0x1d0267={'count':0x0,'rows':[]};return db['FaxAccount'][_0xb19a('0x64')]({'where':{'id':_0x5bf1ab[_0xb19a('0x58')]['id']}})[_0xb19a('0x22')](handleEntityNotFound(_0x2d6c8c,null))['then'](function(_0x73fb73){if(_0x73fb73){_0xdaf00c[_0xb19a('0x49')]=_[_0xb19a('0x45')](db[_0xb19a('0x6b')]['rawAttributes']);_0xdaf00c[_0xb19a('0x46')]=_[_0xb19a('0x45')](_0x5bf1ab[_0xb19a('0x46')]);_0xdaf00c['filters']=_[_0xb19a('0x48')](_0xdaf00c['model'],_0xdaf00c[_0xb19a('0x46')]);_0x535700[_0xb19a('0x4b')]=_[_0xb19a('0x48')](_0xdaf00c[_0xb19a('0x49')],qs[_0xb19a('0x4a')](_0x5bf1ab['query'][_0xb19a('0x4a')]));_0x535700['attributes']=_0x535700[_0xb19a('0x4b')][_0xb19a('0x59')]?_0x535700[_0xb19a('0x4b')]:_0xdaf00c['model'];if(!_0x5bf1ab[_0xb19a('0x46')][_0xb19a('0x4c')](_0xb19a('0x6d'))){_0x535700[_0xb19a('0x31')]=qs[_0xb19a('0x31')](_0x5bf1ab['query'][_0xb19a('0x31')]);_0x535700['offset']=qs[_0xb19a('0x33')](_0x5bf1ab['query'][_0xb19a('0x33')]);}_0x535700[_0xb19a('0x66')]=qs[_0xb19a('0x4d')](_0x5bf1ab[_0xb19a('0x46')]['sort']);_0x535700['where']=qs[_0xb19a('0x47')](_[_0xb19a('0x67')](_0x5bf1ab['query'],_0xdaf00c[_0xb19a('0x47')]));_0x535700[_0xb19a('0x4e')][_0xb19a('0x68')]=_0x73fb73['id'];if(_0x5bf1ab[_0xb19a('0x46')][_0xb19a('0x4f')]){_0x535700[_0xb19a('0x4e')]=_['merge'](_0x535700[_0xb19a('0x4e')],{'$or':_['map'](_0x535700['attributes'],function(_0x42194b){var _0x25a70c={};_0x25a70c[_0x42194b]={'$like':'%'+_0x5bf1ab[_0xb19a('0x46')]['filter']+'%'};return _0x25a70c;})});}_0x535700=_['merge']({},_0x535700,_0x5bf1ab[_0xb19a('0x52')]);return db[_0xb19a('0x6b')][_0xb19a('0x32')]({'where':_0x535700[_0xb19a('0x4e')]})[_0xb19a('0x22')](function(_0x57e833){_0x1d0267[_0xb19a('0x32')]=_0x57e833;if(_0x5bf1ab[_0xb19a('0x46')][_0xb19a('0x53')]){_0x535700[_0xb19a('0x54')]=[{'all':!![]}];}return db[_0xb19a('0x6b')][_0xb19a('0x55')](_0x535700);})[_0xb19a('0x22')](function(_0x5e2967){_0x1d0267[_0xb19a('0x56')]=_0x5e2967;return _0x1d0267;});}})[_0xb19a('0x22')](respondWithFilteredResult(_0x2d6c8c,_0x535700))[_0xb19a('0x2c')](handleError(_0x2d6c8c,null));};exports[_0xb19a('0x6e')]=function(_0x3de997,_0x5db506,_0x252be7){return db['FaxAccount'][_0xb19a('0x5a')]({'where':{'id':_0x3de997[_0xb19a('0x58')]['id']}})[_0xb19a('0x22')](handleEntityNotFound(_0x5db506,null))[_0xb19a('0x22')](function(_0x2dd6cf){if(_0x2dd6cf){return _0x2dd6cf[_0xb19a('0x6e')](_0x3de997[_0xb19a('0x46')][_0xb19a('0x6f')]);}})[_0xb19a('0x22')](respondWithStatusCode(_0x5db506,null))['catch'](handleError(_0x5db506,null));};exports['addInteraction']=function(_0x5726f2,_0x1fc74c,_0x58c7dc){return db[_0xb19a('0x70')][_0xb19a('0x5a')]({'where':{'id':_0x5726f2['params']['id']}})['then'](handleEntityNotFound(_0x1fc74c,null))[_0xb19a('0x22')](function(_0x1951aa){if(_0x1951aa){return _0x1951aa[_0xb19a('0x71')](_0x5726f2['body'][_0xb19a('0x6f')],_[_0xb19a('0x72')](_0x5726f2[_0xb19a('0x61')],[_0xb19a('0x6f'),'id'])||{});}})[_0xb19a('0x22')](respondWithResult(_0x1fc74c,null))[_0xb19a('0x2c')](handleError(_0x1fc74c,null));};exports[_0xb19a('0x73')]=function(_0x1a0597,_0x1558a5,_0x119160){var _0x36ad76={'raw':![],'where':{}};var _0x520e71={};var _0x3c4012={'count':0x0,'rows':[]};return db[_0xb19a('0x41')][_0xb19a('0x64')]({'where':{'id':_0x1a0597[_0xb19a('0x58')]['id']}})[_0xb19a('0x22')](handleEntityNotFound(_0x1558a5,null))[_0xb19a('0x22')](function(_0x326b2c){if(_0x326b2c){_0x520e71[_0xb19a('0x49')]=_[_0xb19a('0x45')](db[_0xb19a('0x70')][_0xb19a('0x42')]);_0x520e71[_0xb19a('0x46')]=_[_0xb19a('0x45')](_0x1a0597['query']);_0x520e71[_0xb19a('0x47')]=_[_0xb19a('0x48')](_0x520e71[_0xb19a('0x49')],_0x520e71['query']);_0x36ad76[_0xb19a('0x4b')]=_['intersection'](_0x520e71['model'],qs['fields'](_0x1a0597[_0xb19a('0x46')]['fields']));_0x36ad76[_0xb19a('0x4b')]=_0x36ad76[_0xb19a('0x4b')][_0xb19a('0x59')]?_0x36ad76[_0xb19a('0x4b')]:_0x520e71[_0xb19a('0x49')];if(!_0x1a0597['query'][_0xb19a('0x4c')](_0xb19a('0x6d'))){_0x36ad76['limit']=qs[_0xb19a('0x31')](_0x1a0597[_0xb19a('0x46')][_0xb19a('0x31')]);_0x36ad76['offset']=qs[_0xb19a('0x33')](_0x1a0597[_0xb19a('0x46')]['offset']);}_0x36ad76[_0xb19a('0x66')]=qs['sort'](_0x1a0597[_0xb19a('0x46')][_0xb19a('0x4d')]);_0x36ad76[_0xb19a('0x4e')]=qs[_0xb19a('0x47')](_['pick'](_0x1a0597['query'],_0x520e71[_0xb19a('0x47')]));_0x36ad76[_0xb19a('0x4e')][_0xb19a('0x68')]=_0x326b2c['id'];if(_0x1a0597[_0xb19a('0x46')]['filter']){_0x36ad76[_0xb19a('0x4e')]=_[_0xb19a('0x50')](_0x36ad76[_0xb19a('0x4e')],{'$or':_['map'](_0x36ad76[_0xb19a('0x4b')],function(_0x377e18){var _0x56bf26={};_0x56bf26[_0x377e18]={'$like':'%'+_0x1a0597[_0xb19a('0x46')][_0xb19a('0x4f')]+'%'};return _0x56bf26;})});}_0x36ad76=_[_0xb19a('0x50')]({},_0x36ad76,_0x1a0597[_0xb19a('0x52')]);return db[_0xb19a('0x70')][_0xb19a('0x32')]({'where':_0x36ad76[_0xb19a('0x4e')]})[_0xb19a('0x22')](function(_0x31722b){_0x3c4012[_0xb19a('0x32')]=_0x31722b;if(_0x1a0597[_0xb19a('0x46')][_0xb19a('0x53')]){_0x36ad76[_0xb19a('0x54')]=[{'model':db['CmContact'],'as':_0xb19a('0x74'),'required':![]},{'model':db[_0xb19a('0x75')],'as':_0xb19a('0x76'),'attributes':[_0xb19a('0x3b'),_0xb19a('0x77'),_0xb19a('0x78')],'required':![]},{'model':db['Tag'],'as':_0xb19a('0x79'),'attributes':['id',_0xb19a('0x3b'),_0xb19a('0x7a')],'where':_0x1a0597[_0xb19a('0x46')][_0xb19a('0x7b')]?{'id':_0x1a0597['query'][_0xb19a('0x7b')]}:undefined,'required':_0x1a0597[_0xb19a('0x46')][_0xb19a('0x7b')]?!![]:![]}];}return db['FaxInteraction'][_0xb19a('0x55')](_0x36ad76);})[_0xb19a('0x22')](function(_0xb2877f){_0x3c4012[_0xb19a('0x56')]=_0xb2877f;return _0x3c4012;});}})[_0xb19a('0x22')](respondWithFilteredResult(_0x1558a5,_0x36ad76))[_0xb19a('0x2c')](handleError(_0x1558a5,null));};exports[_0xb19a('0x7c')]=function(_0x4541a8,_0x42022e){var _0x3d82c9=_0x4541a8[_0xb19a('0x58')]['id'];var _0x2e1179=_0x4541a8[_0xb19a('0x61')];var _0x4befbf=0xc8;var _0xcb84fd=null;return db[_0xb19a('0x7d')]['transaction']({'isolationLevel':db[_0xb19a('0x7d')][_0xb19a('0x7e')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x3fb298){return db[_0xb19a('0x41')][_0xb19a('0x64')]({'where':{'id':_0x3d82c9},'transaction':_0x3fb298})[_0xb19a('0x22')](function(_0x392b2c){if(_0x392b2c){return db[_0xb19a('0x7f')][_0xb19a('0x38')]({'where':{'FaxAccountId':_0x3d82c9},'transaction':_0x3fb298})['then'](function(){var _0x2bb96b=_[_0xb19a('0x40')](_0x2e1179,function(_0x4846cb){_0x4846cb[_0xb19a('0x68')]=_0x3d82c9;return _0x4846cb;});return db['FaxApplication'][_0xb19a('0x80')](_0x2bb96b,{'transaction':_0x3fb298});});}else{_0x4befbf=0x194;_0xcb84fd=[];}});})[_0xb19a('0x22')](function(){if(_0x4befbf!==0x194){return db[_0xb19a('0x7f')][_0xb19a('0x81')]({'where':{'FaxAccountId':_0x3d82c9},'order':'priority'})[_0xb19a('0x22')](function(_0x53a719){_0xcb84fd=_0x53a719;});}})[_0xb19a('0x2c')](function(_0xd3b7fc){_0x4befbf=0x1f4;logger[_0xb19a('0x28')](_0xd3b7fc['stack']);if(_0xd3b7fc[_0xb19a('0x3b')]){delete _0xd3b7fc['name'];}_0xcb84fd=_0xd3b7fc;})[_0xb19a('0x82')](function(){if(_0xcb84fd===null){_0x42022e['sendStatus'](_0x4befbf);}else{if(_0x4befbf===0x1f4){_0x42022e[_0xb19a('0x83')](_0x4befbf)[_0xb19a('0x3c')](_0xcb84fd);}else{_0x42022e[_0xb19a('0x83')](_0x4befbf)[_0xb19a('0x2f')](_0xcb84fd);}}});};exports[_0xb19a('0x84')]=function(_0x81c0bb,_0xcbf37c,_0x2150dc){var _0x29cebc={};var _0x357b70={};var _0x4fabab;var _0x315d3e;return db[_0xb19a('0x41')]['findOne']({'where':{'id':_0x81c0bb[_0xb19a('0x58')]['id']}})[_0xb19a('0x22')](handleEntityNotFound(_0xcbf37c,null))[_0xb19a('0x22')](function(_0x8b005c){if(_0x8b005c){_0x4fabab=_0x8b005c;_0x357b70[_0xb19a('0x49')]=_['keys'](db[_0xb19a('0x7f')][_0xb19a('0x42')]);_0x357b70['query']=_[_0xb19a('0x45')](_0x81c0bb[_0xb19a('0x46')]);_0x357b70[_0xb19a('0x47')]=_[_0xb19a('0x48')](_0x357b70[_0xb19a('0x49')],_0x357b70['query']);_0x29cebc[_0xb19a('0x4b')]=_[_0xb19a('0x48')](_0x357b70[_0xb19a('0x49')],qs[_0xb19a('0x4a')](_0x81c0bb[_0xb19a('0x46')][_0xb19a('0x4a')]));_0x29cebc[_0xb19a('0x4b')]=_0x29cebc[_0xb19a('0x4b')][_0xb19a('0x59')]?_0x29cebc['attributes']:_0x357b70['model'];_0x29cebc[_0xb19a('0x66')]=qs[_0xb19a('0x4d')](_0x81c0bb['query']['sort']);_0x29cebc[_0xb19a('0x4e')]=qs[_0xb19a('0x47')](_[_0xb19a('0x67')](_0x81c0bb['query'],_0x357b70['filters']));if(_0x81c0bb[_0xb19a('0x46')][_0xb19a('0x4f')]){_0x29cebc[_0xb19a('0x4e')]=_[_0xb19a('0x50')](_0x29cebc['where'],{'$or':_[_0xb19a('0x40')](_0x29cebc['attributes'],function(_0x135e76){var _0x43bf0b={};_0x43bf0b[_0x135e76]={'$like':'%'+_0x81c0bb[_0xb19a('0x46')][_0xb19a('0x4f')]+'%'};return _0x43bf0b;})});}_0x29cebc=_[_0xb19a('0x50')]({},_0x29cebc,_0x81c0bb[_0xb19a('0x52')]);return _0x4fabab[_0xb19a('0x84')](_0x29cebc);}})[_0xb19a('0x22')](function(_0xb96831){if(_0xb96831){_0x315d3e=_0xb96831['length'];if(!_0x81c0bb['query']['hasOwnProperty']('nolimit')){_0x29cebc[_0xb19a('0x31')]=qs[_0xb19a('0x31')](_0x81c0bb['query'][_0xb19a('0x31')]);_0x29cebc['offset']=qs[_0xb19a('0x33')](_0x81c0bb[_0xb19a('0x46')]['offset']);}return _0x4fabab[_0xb19a('0x84')](_0x29cebc);}})[_0xb19a('0x22')](function(_0x24a24a){if(_0x24a24a){return _0x24a24a?{'count':_0x315d3e,'rows':_0x24a24a}:null;}})[_0xb19a('0x22')](respondWithResult(_0xcbf37c,null))[_0xb19a('0x2c')](handleError(_0xcbf37c,null));};function Extension(_0x1635ba,_0x175df1,_0x719e72,_0x21fb5c){this[_0xb19a('0x85')]=_0xb19a('0x86');this[_0xb19a('0x87')]=_0x1635ba[_0xb19a('0x88')];this[_0xb19a('0x89')]=_0x21fb5c;this[_0xb19a('0x43')]=_0xb19a('0x8a');this[_0xb19a('0x8b')]=_0xb19a('0x8c');this['FaxAccountId']=_0x1635ba['id'];this[_0xb19a('0x8d')]=_0x175df1;this[_0xb19a('0x8e')]=_0x719e72;}function createExtensionsReciveFax(_0x17f97f){var _0x129785=0x1;var _0x13f6c2=[];_0x13f6c2[_0xb19a('0x8f')](new Extension(_0x17f97f,_0x129785,'',_0xb19a('0x90')));_0x129785+=0x1;_0x13f6c2['push'](new Extension(_0x17f97f,_0x129785,'CDR(type)=inbound-fax',_0xb19a('0x91')));_0x129785+=0x1;for(var _0x22f0db in _0x17f97f){if(_0x17f97f[_0xb19a('0x4c')](_0x22f0db)&&(_0x22f0db===_0xb19a('0x92')||_0x22f0db===_0xb19a('0x88')||_0x22f0db===_0xb19a('0x93')||_0x22f0db===_0xb19a('0x94')||_0x22f0db==='headerinfo'||_0x22f0db===_0xb19a('0x95')||_0x22f0db===_0xb19a('0x96')||_0x22f0db==='modem'||_0x22f0db===_0xb19a('0x97'))){_0x13f6c2[_0xb19a('0x8f')](new Extension(_0x17f97f,_0x129785,'FAXOPT('+_0x22f0db+')='+_0x17f97f[_0x22f0db],_0xb19a('0x91')));_0x129785+=0x1;}}_0x13f6c2['push'](new Extension(_0x17f97f,_0x129785,'6',_0xb19a('0x98')));_0x129785+=0x1;_0x13f6c2['push'](new Extension(_0x17f97f,_0x129785,_0xb19a('0x99'),_0xb19a('0x9a')));_0x129785=0x0;return _0x13f6c2;}exports[_0xb19a('0x9b')]=function(_0x5be828,_0x109bf5,_0x59e51e){var _0x529fdb;return db['sequelize'][_0xb19a('0x9c')](function(_0xec536f){return db[_0xb19a('0x41')][_0xb19a('0x60')](_0x5be828[_0xb19a('0x61')],{'transaction':_0xec536f})['then'](function(_0x4788aa){_0x529fdb=_0x4788aa[_0xb19a('0x5d')]({'plain':!![]});return db[_0xb19a('0x9d')]['bulkCreate'](createExtensionsReciveFax(_0x529fdb),{'transaction':_0xec536f});});})[_0xb19a('0x22')](function(){return _0x529fdb;})[_0xb19a('0x22')](respondWithResult(_0x109bf5,null))[_0xb19a('0x2c')](handleError(_0x109bf5,null));};exports[_0xb19a('0x9e')]=function(_0x2c3982,_0x5af81c,_0x618e16){var _0x8b498e;return db[_0xb19a('0x7d')]['transaction'](function(_0x351b64){return db[_0xb19a('0x41')][_0xb19a('0x37')](_0x2c3982[_0xb19a('0x61')],{'where':{'id':_0x2c3982[_0xb19a('0x61')]['id']},'transaction':_0x351b64})[_0xb19a('0x22')](function(_0x459a6c){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x2c3982[_0xb19a('0x61')]['id']},'transaction':_0x351b64})[_0xb19a('0x22')](function(_0xdb8c41){return db[_0xb19a('0x9d')][_0xb19a('0x80')](createExtensionsReciveFax(_[_0xb19a('0x72')](_0x2c3982[_0xb19a('0x61')],['tech','key','createdAt',_0xb19a('0x9f'),'TrunkId',_0xb19a('0xa0')])),{'transaction':_0x351b64});});});})[_0xb19a('0x22')](function(){return db[_0xb19a('0x41')][_0xb19a('0xa1')](_0x2c3982[_0xb19a('0x61')]['id']);})['then'](respondWithResult(_0x5af81c,null))[_0xb19a('0x2c')](handleError(_0x5af81c,null));};exports[_0xb19a('0xa2')]=function(_0x3c43a9,_0x144b1e,_0x4e6ed6){var _0x47bb45={'raw':!![],'where':{}};var _0xe0858e={};var _0x5cad76={'count':0x0,'rows':[]};return db[_0xb19a('0x41')]['findOne']({'where':{'id':_0x3c43a9[_0xb19a('0x58')]['id']}})[_0xb19a('0x22')](handleEntityNotFound(_0x144b1e,null))[_0xb19a('0x22')](function(_0x16e7c2){if(_0x16e7c2){_0xe0858e[_0xb19a('0x49')]=_[_0xb19a('0x45')](db['FaxMessage'][_0xb19a('0x42')]);_0xe0858e[_0xb19a('0x46')]=_[_0xb19a('0x45')](_0x3c43a9[_0xb19a('0x46')]);_0xe0858e['filters']=_[_0xb19a('0x48')](_0xe0858e[_0xb19a('0x49')],_0xe0858e[_0xb19a('0x46')]);_0x47bb45[_0xb19a('0x4b')]=_[_0xb19a('0x48')](_0xe0858e[_0xb19a('0x49')],qs['fields'](_0x3c43a9['query']['fields']));_0x47bb45[_0xb19a('0x4b')]=_0x47bb45['attributes'][_0xb19a('0x59')]?_0x47bb45[_0xb19a('0x4b')]:_0xe0858e['model'];if(!_0x3c43a9[_0xb19a('0x46')][_0xb19a('0x4c')]('nolimit')){_0x47bb45[_0xb19a('0x31')]=qs[_0xb19a('0x31')](_0x3c43a9[_0xb19a('0x46')]['limit']);_0x47bb45[_0xb19a('0x33')]=qs['offset'](_0x3c43a9[_0xb19a('0x46')]['offset']);}_0x47bb45[_0xb19a('0x66')]=qs['sort'](_0x3c43a9[_0xb19a('0x46')]['sort']);_0x47bb45['where']=qs[_0xb19a('0x47')](_[_0xb19a('0x67')](_0x3c43a9[_0xb19a('0x46')],_0xe0858e[_0xb19a('0x47')]));_0x47bb45[_0xb19a('0x4e')]['FaxAccountId']=_0x16e7c2['id'];if(_0x3c43a9[_0xb19a('0x46')][_0xb19a('0x4f')]){_0x47bb45[_0xb19a('0x4e')]=_[_0xb19a('0x50')](_0x47bb45['where'],{'$or':_[_0xb19a('0x40')](_0x47bb45[_0xb19a('0x4b')],function(_0x588904){var _0x17cfe5={};_0x17cfe5[_0x588904]={'$like':'%'+_0x3c43a9[_0xb19a('0x46')][_0xb19a('0x4f')]+'%'};return _0x17cfe5;})});}if(_0x3c43a9[_0xb19a('0x46')][_0xb19a('0xa3')]){var _0x47f586=_0x3c43a9[_0xb19a('0x46')][_0xb19a('0xa3')]['split'](',');var _0x4bac21={};_0x4bac21[_0x47f586[0x0]]={'$gte':moment(_0x47f586[0x1])['format'](_0xb19a('0xa4'))};_0x47bb45[_0xb19a('0x4e')]=_[_0xb19a('0x50')](_0x47bb45[_0xb19a('0x4e')],_0x4bac21);}_0x47bb45=_[_0xb19a('0x50')]({},_0x47bb45,_0x3c43a9['options']);return db[_0xb19a('0xa5')][_0xb19a('0x32')]({'where':_0x47bb45[_0xb19a('0x4e')]})[_0xb19a('0x22')](function(_0x5be557){_0x5cad76[_0xb19a('0x32')]=_0x5be557;if(_0x3c43a9[_0xb19a('0x46')][_0xb19a('0x53')]){_0x47bb45[_0xb19a('0x54')]=[{'all':!![]}];}return db[_0xb19a('0xa5')][_0xb19a('0x55')](_0x47bb45);})[_0xb19a('0x22')](function(_0x49bf6e){_0x5cad76[_0xb19a('0x56')]=_0x49bf6e;return _0x5cad76;});}})[_0xb19a('0x22')](respondWithFilteredResult(_0x144b1e,_0x47bb45))[_0xb19a('0x2c')](handleError(_0x144b1e,null));};exports[_0xb19a('0x3c')]=function(_0x246dd7,_0x40f2bb,_0x248ba0){var _0x4d1236,_0x46fcb0={},_0x370d82;if(_0x246dd7['body']['to']){_0x370d82=_0x246dd7[_0xb19a('0x61')]['to'][0x0];}return db[_0xb19a('0x41')]['find']({'where':{'id':_0x246dd7[_0xb19a('0x58')]['id']},'include':[{'model':db[_0xb19a('0xa6')],'as':_0xb19a('0xa7'),'include':[{'model':db[_0xb19a('0xa8')],'as':'Contacts','where':{'fax':_0x370d82},'limit':0x1,'order':[[_0xb19a('0x9f'),'DESC']]}]}]})[_0xb19a('0x22')](handleEntityNotFound(_0x40f2bb,null))['then'](function(_0x15616f){_0x4d1236=_0x15616f;if(_0x246dd7[_0xb19a('0x61')][_0xb19a('0xa9')]&&_0x246dd7[_0xb19a('0x61')][_0xb19a('0xa9')]['length']){for(var _0x9bf546=0x0;_0x9bf546<_0x246dd7[_0xb19a('0x61')][_0xb19a('0xa9')][_0xb19a('0x59')];_0x9bf546+=0x1){_0x246dd7[_0xb19a('0x61')][_0xb19a('0xa9')][_0x9bf546]={'filename':_0x246dd7[_0xb19a('0x61')]['attachments'][_0x9bf546][_0xb19a('0x3b')],'id':_0x246dd7['body'][_0xb19a('0xa9')][_0x9bf546]['id'],'path':path[_0xb19a('0xaa')](config[_0xb19a('0xab')],_0xb19a('0xac'),_0x246dd7[_0xb19a('0x61')]['attachments'][_0x9bf546]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0xb19a('0xad'),{'FaxAccountId':_[_0xb19a('0xae')](_0x246dd7[_0xb19a('0x58')]['id'])?undefined:_0x246dd7[_0xb19a('0x58')]['id'],'path':_['isNil'](_0x246dd7[_0xb19a('0x61')]['attachments'][0x0][_0xb19a('0x7')])?undefined:_0x246dd7[_0xb19a('0x61')]['attachments'][0x0][_0xb19a('0x7')],'fax':_[_0xb19a('0xae')](_0x246dd7['body']['to'][0x0])?undefined:_0x246dd7[_0xb19a('0x61')]['to'][0x0]},client9002);})[_0xb19a('0x22')](function(){if(_0x4d1236){if(_['isNil'](_0x246dd7[_0xb19a('0x61')][_0xb19a('0xaf')])){_0x246dd7[_0xb19a('0x61')]['from']=util['format'](_0xb19a('0xb0'),_0x4d1236[_0xb19a('0x3b')],_0x4d1236['fax']);}if(_0x4d1236[_0xb19a('0xa7')]){if(_0x4d1236[_0xb19a('0xa7')]['Contacts'][_0xb19a('0x59')]){return _0x4d1236['List'][_0xb19a('0xb1')][0x0];}else{return db[_0xb19a('0xa8')]['create'](_[_0xb19a('0x19')](_0x246dd7[_0xb19a('0x61')],{'firstName':_0x246dd7[_0xb19a('0x61')]['to'][0x0],'phone':_0x246dd7['body']['to'][0x0],'fax':_0x246dd7[_0xb19a('0x61')]['to'][0x0],'ListId':_0x4d1236['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xb19a('0x22')](function(_0xc7ab8f){if(_0xc7ab8f){return db[_0xb19a('0x70')][_0xb19a('0x5a')]({'where':{'ContactId':_0xc7ab8f['id'],'closed':![],'FaxAccountId':_0x4d1236['id']}})[_0xb19a('0x22')](function(_0x1a9b62){if(_0x1a9b62){return[_0x1a9b62,![]];}return db[_0xb19a('0x70')][_0xb19a('0x60')]({'UserId':_0x246dd7['user']['id'],'ContactId':_0xc7ab8f['id'],'FaxAccountId':_0x4d1236['id'],'fax':_0x246dd7[_0xb19a('0x61')]['to'][0x0],'firstMsgDirection':_0xb19a('0xb2'),'Messages':[_[_0xb19a('0x50')](_0x246dd7[_0xb19a('0x61')],{'read':![],'body':_0x246dd7['body'][_0xb19a('0xa9')][0x0]['filename'],'FaxAccountId':_0x4d1236['id'],'UserId':_0x246dd7['user']['id'],'ContactId':_0xc7ab8f['id'],'AttachmentId':_0x246dd7[_0xb19a('0x61')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xb19a('0xa5')],'as':'Messages'}]})[_0xb19a('0x22')](function(_0x494cc3){return[_0x494cc3,!![]];});});}else{throw new Error(_0xb19a('0xb3'));}})[_0xb19a('0xb4')](function(_0x4969ac,_0x4c1b91){if(_0x4c1b91){return _0x4969ac;}return db[_0xb19a('0xa5')][_0xb19a('0x60')]({'direction':_0xb19a('0xb2'),'read':![],'body':_0x246dd7[_0xb19a('0x61')]['attachments'][0x0][_0xb19a('0xb5')],'FaxAccountId':_0x4d1236['id'],'FaxInteractionId':_0x4969ac['id'],'UserId':_0x246dd7[_0xb19a('0x5c')]['id'],'ContactId':_0x4969ac[_0xb19a('0xb6')],'AttachmentId':_0x246dd7[_0xb19a('0x61')][_0xb19a('0xa9')][0x0]['id']})[_0xb19a('0x22')](function(_0x549e8c){_0x4969ac[_0xb19a('0xb7')][_0xb19a('0xb8')]=[];_0x4969ac[_0xb19a('0xb7')][_0xb19a('0xb8')][_0xb19a('0x8f')](_0x549e8c['dataValues']);return _0x4969ac;});})['then'](function(_0x25334a){respondWithRpcPromise(_0xb19a('0xb9'),_0xb19a('0xb9'),{'FaxAccountId':_[_0xb19a('0xae')](_0x246dd7['params']['id'])?undefined:_0x246dd7[_0xb19a('0x58')]['id'],'path':_[_0xb19a('0xae')](_0x246dd7[_0xb19a('0x61')][_0xb19a('0xa9')][0x0][_0xb19a('0x7')])?undefined:_0x246dd7[_0xb19a('0x61')][_0xb19a('0xa9')][0x0][_0xb19a('0x7')],'fax':_[_0xb19a('0xae')](_0x246dd7['body']['to'][0x0])?undefined:_0x246dd7['body']['to'][0x0],'AttachmentId':_0x246dd7[_0xb19a('0x61')]['attachments'][0x0]['id']},client9002)[_0xb19a('0x22')](function(_0x703a75){logger[_0xb19a('0x23')](_0xb19a('0xba'),_0x703a75);})['catch'](function(_0x1062f0){logger[_0xb19a('0x23')](_0xb19a('0xba'),_0x1062f0);});return _0x25334a;})['then'](respondWithResult(_0x40f2bb,null))[_0xb19a('0x2c')](handleError(_0x40f2bb,null));};exports[_0xb19a('0xbb')]=function(_0x276789,_0x45384a,_0x8bb5dc){return db[_0xb19a('0x41')][_0xb19a('0x5a')]({'where':{'id':_0x276789[_0xb19a('0x58')]['id']}})[_0xb19a('0x22')](handleEntityNotFound(_0x45384a,null))[_0xb19a('0x22')](function(_0x4c7125){if(_0x4c7125){return _0x4c7125[_0xb19a('0xbb')](_0x276789[_0xb19a('0x61')][_0xb19a('0x6f')],_[_0xb19a('0x72')](_0x276789[_0xb19a('0x61')],[_0xb19a('0x6f'),'id'])||{})[_0xb19a('0xb4')](function(_0x35845e){for(var _0x3f8f4c=0x0;_0x3f8f4c<_0x276789['body'][_0xb19a('0x6f')][_0xb19a('0x59')];_0x3f8f4c+=0x1){socket[_0xb19a('0xbc')](_0xb19a('0xbd'),{'UserId':Number(_0x276789['body'][_0xb19a('0x6f')][_0x3f8f4c]),'FaxAccountId':Number(_0x276789['params']['id'])});}return _0x35845e;});}})[_0xb19a('0x22')](respondWithResult(_0x45384a,null))[_0xb19a('0x2c')](handleError(_0x45384a,null));};exports[_0xb19a('0xbe')]=function(_0x5a2a4f,_0x512d0c,_0x83f674){return db[_0xb19a('0x41')][_0xb19a('0x5a')]({'where':{'id':_0x5a2a4f['params']['id']}})[_0xb19a('0x22')](handleEntityNotFound(_0x512d0c,null))[_0xb19a('0x22')](function(_0x2cd7b2){if(_0x2cd7b2){return _0x2cd7b2[_0xb19a('0xbe')](_0x5a2a4f[_0xb19a('0x46')][_0xb19a('0x6f')])['then'](function(){if(_[_0xb19a('0xbf')](_0x5a2a4f[_0xb19a('0x46')][_0xb19a('0x6f')])){for(var _0x169169=0x0;_0x169169<_0x5a2a4f['query'][_0xb19a('0x6f')][_0xb19a('0x59')];_0x169169+=0x1){socket[_0xb19a('0xbc')](_0xb19a('0xc0'),{'UserId':Number(_0x5a2a4f[_0xb19a('0x46')]['ids'][_0x169169]),'FaxAccountId':Number(_0x5a2a4f[_0xb19a('0x58')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x5a2a4f[_0xb19a('0x46')]['ids']),'FaxAccountId':Number(_0x5a2a4f[_0xb19a('0x58')]['id'])});}});}})[_0xb19a('0x22')](respondWithStatusCode(_0x512d0c,null))[_0xb19a('0x2c')](handleError(_0x512d0c,null));};exports[_0xb19a('0xc1')]=function(_0x10d722,_0x203e89,_0x5a126e){var _0x131725={};var _0x35de8f={};var _0x51fe8c;var _0x49995f;return db['FaxAccount'][_0xb19a('0x64')]({'where':{'id':_0x10d722[_0xb19a('0x58')]['id']}})[_0xb19a('0x22')](handleEntityNotFound(_0x203e89,null))[_0xb19a('0x22')](function(_0x43a285){if(_0x43a285){_0x51fe8c=_0x43a285;_0x35de8f[_0xb19a('0x49')]=_['keys'](db[_0xb19a('0x75')][_0xb19a('0x42')]);_0x35de8f[_0xb19a('0x46')]=_[_0xb19a('0x45')](_0x10d722['query']);_0x35de8f[_0xb19a('0x47')]=_[_0xb19a('0x48')](_0x35de8f['model'],_0x35de8f['query']);_0x131725['attributes']=_[_0xb19a('0x48')](_0x35de8f[_0xb19a('0x49')],qs['fields'](_0x10d722[_0xb19a('0x46')]['fields']));_0x131725[_0xb19a('0x4b')]=_0x131725['attributes']['length']?_0x131725[_0xb19a('0x4b')]:_0x35de8f['model'];_0x131725[_0xb19a('0x66')]=qs[_0xb19a('0x4d')](_0x10d722['query'][_0xb19a('0x4d')]);_0x131725[_0xb19a('0x4e')]=qs[_0xb19a('0x47')](_['pick'](_0x10d722[_0xb19a('0x46')],_0x35de8f[_0xb19a('0x47')]));if(_0x10d722['query'][_0xb19a('0x4f')]){_0x131725[_0xb19a('0x4e')]=_[_0xb19a('0x50')](_0x131725[_0xb19a('0x4e')],{'$or':_[_0xb19a('0x40')](_0x131725[_0xb19a('0x4b')],function(_0x13d25b){var _0x5ea86a={};_0x5ea86a[_0x13d25b]={'$like':'%'+_0x10d722[_0xb19a('0x46')]['filter']+'%'};return _0x5ea86a;})});}_0x131725=_[_0xb19a('0x50')]({},_0x131725,_0x10d722[_0xb19a('0x52')]);return _0x51fe8c[_0xb19a('0xc1')](_0x131725);}})['then'](function(_0xbe27ec){if(_0xbe27ec){_0x49995f=_0xbe27ec[_0xb19a('0x59')];if(!_0x10d722[_0xb19a('0x46')]['hasOwnProperty'](_0xb19a('0x6d'))){_0x131725[_0xb19a('0x31')]=qs[_0xb19a('0x31')](_0x10d722[_0xb19a('0x46')]['limit']);_0x131725[_0xb19a('0x33')]=qs[_0xb19a('0x33')](_0x10d722[_0xb19a('0x46')][_0xb19a('0x33')]);}return _0x51fe8c[_0xb19a('0xc1')](_0x131725);}})[_0xb19a('0x22')](function(_0x88f3a5){if(_0x88f3a5){return _0x88f3a5?{'count':_0x49995f,'rows':_0x88f3a5}:null;}})['then'](respondWithResult(_0x203e89,null))[_0xb19a('0x2c')](handleError(_0x203e89,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index d80a194..bd2826b 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 _0x3d70=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxAccount'];(function(_0x4cee98,_0x4a1580){var _0x3e3a10=function(_0x31b2b7){while(--_0x31b2b7){_0x4cee98['push'](_0x4cee98['shift']());}};_0x3e3a10(++_0x4a1580);}(_0x3d70,0xf6));var _0x03d7=function(_0x56a871,_0x18b7fe){_0x56a871=_0x56a871-0x0;var _0x124954=_0x3d70[_0x56a871];return _0x124954;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x03d7('0x0'))['db'][_0x03d7('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x03d7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x03d7('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2eb3c3){return function(_0x3c0942,_0x5b1209,_0xe56609){FaxAccountEvents['emit'](_0x2eb3c3+':'+_0x3c0942['id'],_0x3c0942);FaxAccountEvents[_0x03d7('0x4')](_0x2eb3c3,_0x3c0942);_0xe56609(null);};}for(var e in events){if(events[_0x03d7('0x5')](e)){var event=events[e];FaxAccount[_0x03d7('0x6')](e,emitEvent(event));}}module[_0x03d7('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x66e6=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x66e6,0xfe));var _0x666e=function(_0x3fc4e7,_0x4152f3){_0x3fc4e7=_0x3fc4e7-0x0;var _0x56ad2f=_0x66e6[_0x3fc4e7];return _0x56ad2f;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x666e('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x666e('0x1')](0x0);var events={'afterCreate':_0x666e('0x2'),'afterUpdate':_0x666e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x55ff1f){return function(_0x3bfc15,_0x4df719,_0x4011ba){FaxAccountEvents[_0x666e('0x4')](_0x55ff1f+':'+_0x3bfc15['id'],_0x3bfc15);FaxAccountEvents[_0x666e('0x4')](_0x55ff1f,_0x3bfc15);_0x4011ba(null);};}for(var e in events){if(events[_0x666e('0x5')](e)){var event=events[e];FaxAccount[_0x666e('0x6')](e,emitEvent(event));}}module[_0x666e('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 452ac4a..734a3fc 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 _0x43ec=['moment','request-promise','path','rimraf','../../config/environment','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x43ec,0x1e8));var _0xc43e=function(_0x502f1b,_0x393700){_0x502f1b=_0x502f1b-0x0;var _0x127687=_0x43ec[_0x502f1b];return _0x127687;};'use strict';var _=require(_0xc43e('0x0'));var util=require(_0xc43e('0x1'));var logger=require(_0xc43e('0x2'))(_0xc43e('0x3'));var moment=require(_0xc43e('0x4'));var BPromise=require('bluebird');var rp=require(_0xc43e('0x5'));var fs=require('fs');var path=require(_0xc43e('0x6'));var rimraf=require(_0xc43e('0x7'));var config=require(_0xc43e('0x8'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x59c2cc,_0x26b033){return _0x59c2cc[_0xc43e('0x9')](_0xc43e('0xa'),attributes,{'tableName':_0xc43e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabc1=['exports','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xabc1,0xf4));var _0x1abc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabc1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1abc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1abc('0x1'));var moment=require(_0x1abc('0x2'));var BPromise=require('bluebird');var rp=require(_0x1abc('0x3'));var fs=require('fs');var path=require(_0x1abc('0x4'));var rimraf=require(_0x1abc('0x5'));var config=require(_0x1abc('0x6'));var attributes=require(_0x1abc('0x7'));module[_0x1abc('0x8')]=function(_0x3d0dbd,_0xc5253a){return _0x3d0dbd['define']('FaxAccount',attributes,{'tableName':'fax_accounts','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 550fcb4..c605aaf 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 _0x58b8=['AttachmentId','UserId','User','name','unshift','agent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','model','map','stringify','body','fax','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','account','list','applications','orderBy','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId'];(function(_0x3c9162,_0x1c9e16){var _0x3aba04=function(_0x620e0){while(--_0x620e0){_0x3c9162['push'](_0x3c9162['shift']());}};_0x3aba04(++_0x1c9e16);}(_0x58b8,0x11f));var _0x858b=function(_0x5bfb78,_0x22e3ff){_0x5bfb78=_0x5bfb78-0x0;var _0x4efd00=_0x58b8[_0x5bfb78];return _0x4efd00;};'use strict';var _=require(_0x858b('0x0'));var util=require(_0x858b('0x1'));var moment=require(_0x858b('0x2'));var BPromise=require(_0x858b('0x3'));var rs=require(_0x858b('0x4'));var fs=require('fs');var Redis=require(_0x858b('0x5'));var db=require(_0x858b('0x6'))['db'];var utils=require(_0x858b('0x7'));var logger=require(_0x858b('0x8'))(_0x858b('0x9'));var config=require(_0x858b('0xa'));var jayson=require(_0x858b('0xb'));var client=jayson[_0x858b('0xc')][_0x858b('0xd')]({'port':0x232c});config[_0x858b('0xe')]=_[_0x858b('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x858b('0xe')]));require(_0x858b('0x10'))[_0x858b('0x11')](socket);function respondWithRpcPromise(_0x38876b,_0x3fd80a,_0x5ce695){return new BPromise(function(_0x6d8d66,_0xfcda55){return client[_0x858b('0x12')](_0x38876b,_0x5ce695)[_0x858b('0x13')](function(_0x8ffffa){logger[_0x858b('0x14')](_0x858b('0x15'),_0x3fd80a,_0x858b('0x16'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3fd80a,_0x858b('0x16'),JSON['stringify'](_0x8ffffa));if(_0x8ffffa['error']){if(_0x8ffffa[_0x858b('0x17')][_0x858b('0x18')]===0x1f4){logger[_0x858b('0x17')]('FaxAccount,\x20%s,\x20%s',_0x3fd80a,_0x8ffffa[_0x858b('0x17')]['message']);return _0xfcda55(_0x8ffffa[_0x858b('0x17')][_0x858b('0x19')]);}logger[_0x858b('0x17')](_0x858b('0x15'),_0x3fd80a,_0x8ffffa['error'][_0x858b('0x19')]);return _0x6d8d66(_0x8ffffa[_0x858b('0x17')][_0x858b('0x19')]);}else{logger['info'](_0x858b('0x15'),_0x3fd80a,_0x858b('0x16'));_0x6d8d66(_0x8ffffa[_0x858b('0x1a')]['message']);}})[_0x858b('0x1b')](function(_0x9545f7){logger[_0x858b('0x17')](_0x858b('0x15'),_0x3fd80a,_0x9545f7);_0xfcda55(_0x9545f7);});});}exports[_0x858b('0x1c')]=function(_0x35fc18){var _0x39d6d8=this;return new Promise(function(_0x4770cc,_0xd6b6e){return db[_0x858b('0x1d')][_0x858b('0x1e')]({'raw':_0x35fc18[_0x858b('0x1f')]?_0x35fc18['options'][_0x858b('0x20')]===undefined?!![]:![]:!![],'where':_0x35fc18[_0x858b('0x1f')]?_0x35fc18[_0x858b('0x1f')][_0x858b('0x21')]||null:null,'attributes':_0x35fc18[_0x858b('0x1f')]?_0x35fc18['options'][_0x858b('0x22')]||null:null,'limit':_0x35fc18[_0x858b('0x1f')]?_0x35fc18[_0x858b('0x1f')][_0x858b('0x23')]||null:null,'include':_0x35fc18['options']?_0x35fc18[_0x858b('0x1f')][_0x858b('0x24')]?_['map'](_0x35fc18[_0x858b('0x1f')][_0x858b('0x24')],function(_0x31caf3){return{'model':db[_0x31caf3[_0x858b('0x25')]],'as':_0x31caf3['as'],'attributes':_0x31caf3['attributes'],'include':_0x31caf3['include']?_['map'](_0x31caf3[_0x858b('0x24')],function(_0x427e84){return{'model':db[_0x427e84[_0x858b('0x25')]],'as':_0x427e84['as'],'attributes':_0x427e84[_0x858b('0x22')],'include':_0x427e84[_0x858b('0x24')]?_[_0x858b('0x26')](_0x427e84[_0x858b('0x24')],function(_0x1e323c){return{'model':db[_0x1e323c[_0x858b('0x25')]],'as':_0x1e323c['as'],'attributes':_0x1e323c[_0x858b('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cf540){logger[_0x858b('0x14')](_0x858b('0x1c'),_0x35fc18);logger['debug'](_0x858b('0x1c'),_0x35fc18,JSON[_0x858b('0x27')](_0x2cf540));_0x4770cc(_0x2cf540);})[_0x858b('0x1b')](function(_0x13d704){logger['error'](_0x858b('0x1c'),_0x13d704[_0x858b('0x19')],_0x35fc18);_0xd6b6e(_0x39d6d8['error'](0x1f4,_0x13d704[_0x858b('0x19')]));});});};exports['NotifyFaxAccount']=function(_0x395701,_0x287aba,_0x308fb6){var _0x4a9fbc=this;return new Promise(function(_0x275c4c,_0x8bb772){var _0x133468={'body':_0x395701[_0x858b('0x28')],'channel':_0x858b('0x29')};var _0xb6b575=[];var _0x597d64=[];var _0x8dee7f={};return db['CmContact']['describe']()[_0x858b('0x13')](function(_0x520af3){if(!_0x520af3){throw new db[(_0x858b('0x2a'))][(_0x858b('0x2b'))]('no\x20available\x20attributes');}_0xb6b575=_[_0x858b('0x2c')](_['keys'](_0x520af3),[_0x858b('0x2d'),'updatedAt']);_0x597d64=_[_0x858b('0x2c')](_['keys'](_0x520af3),[_0x858b('0x2d'),_0x858b('0x2e'),_0x858b('0x2f'),_0x858b('0x30')]);if(_0x395701[_0x858b('0x28')]['id']){delete _0x395701[_0x858b('0x28')]['id'];}if(_['isNil'](_0x395701[_0x858b('0x28')][_0x858b('0x31')])){throw new db[(_0x858b('0x2a'))][(_0x858b('0x2b'))](_0x858b('0x32'));}if(_[_0x858b('0x33')](_0x395701['body'][_0x858b('0x28')])||_0x395701[_0x858b('0x28')]['body']===''){throw new db[(_0x858b('0x2a'))][(_0x858b('0x2b'))](_0x858b('0x34'));}if(_[_0x858b('0x33')](_0x395701[_0x858b('0x28')][_0x858b('0x35')])){throw new db['Sequelize'][(_0x858b('0x2b'))](_0x858b('0x36')+_0x597d64);}if(!_['includes'](_0x597d64,_0x395701[_0x858b('0x28')][_0x858b('0x35')])){throw new db[(_0x858b('0x2a'))][(_0x858b('0x2b'))](_0x858b('0x37')+_0x597d64);}_0x8dee7f[_0x395701['body']['mapKey']]=_0x395701[_0x858b('0x28')][_0x858b('0x31')];})[_0x858b('0x13')](function(){return db[_0x858b('0x1d')][_0x858b('0x38')]({'where':{'id':_0x395701['account']['id']},'include':[{'model':db[_0x858b('0x39')],'as':_0x858b('0x3a'),'include':[{'model':db[_0x858b('0x3b')],'as':_0x858b('0x3c'),'where':_0x8dee7f,'limit':0x1,'order':[[_0x858b('0x2e'),_0x858b('0x3d')]]}]},{'model':db[_0x858b('0x3e')],'as':_0x858b('0x3f')}]});})[_0x858b('0x13')](function(_0x5e8543){if(_0x5e8543&&_0x5e8543['List']){var _0x3c88cc=_0x5e8543[_0x858b('0x40')]({'plain':!![]});_0x133468[_0x858b('0x41')]=_0x3c88cc;_0x133468['applications']=_0x3c88cc['Applications'];_0x133468[_0x858b('0x42')]=_0x3c88cc['List'];_0x133468[_0x858b('0x43')]=_[_0x858b('0x44')](_0x133468['applications'],[_0x858b('0x45')],[_0x858b('0x46')]);if(_0x133468['account']['Applications']){delete _0x133468[_0x858b('0x41')][_0x858b('0x3f')];}if(_0x133468[_0x858b('0x41')][_0x858b('0x3a')]&&_0x133468[_0x858b('0x41')][_0x858b('0x3a')][_0x858b('0x3c')][_0x858b('0x47')]){return _0x133468['account'][_0x858b('0x3a')][_0x858b('0x3c')][0x0];}var _0x307c37=_['defaults'](_0x395701[_0x858b('0x28')],{'firstName':_0x395701['body'][_0x858b('0x31')],'ListId':_0x3c88cc[_0x858b('0x30')]});_0x307c37[_0x395701[_0x858b('0x28')][_0x858b('0x35')]]=_0x395701[_0x858b('0x28')]['from'];return db[_0x858b('0x3b')][_0x858b('0x48')](_0x307c37,{'fields':_0xb6b575,'raw':!![]});}})[_0x858b('0x13')](function(_0x30f541){_0x133468[_0x858b('0x49')]=_0x30f541;if(_0x30f541){var _0x55e9a0={'ContactId':_0x30f541['id'],'FaxAccountId':_0x395701['account']['id'],'fax':_0x30f541[_0x858b('0x29')]};return db['FaxInteraction'][_0x858b('0x38')]({'where':{'ContactId':_0x30f541['id'],'closed':![],'FaxAccountId':_0x395701[_0x858b('0x41')]['id']}})[_0x858b('0x13')](function(_0x35511f){if(_0x35511f){return[_0x35511f,![]];}return db[_0x858b('0x4a')][_0x858b('0x48')](_0x55e9a0)['then'](function(_0x3a49f3){return[_0x3a49f3,!![]];});});}else{throw new Error(_0x858b('0x4b'));}})[_0x858b('0x4c')](function(_0x4d6213,_0x464d7f){var _0x31ee0b=_0x4d6213[_0x858b('0x40')]({'plain':!![]});if(_0x464d7f){if(_0x133468[_0x858b('0x41')][_0x858b('0x4d')]){_0x133468['applications'][_0x858b('0x4e')]({'id':0x0,'priority':_0x133468['applications'][_0x858b('0x47')]+0x1,'app':'close','appdata':_0x858b('0x4f'),'interval':_0x858b('0x50')});}_0x31ee0b[_0x858b('0x51')]=!![];}else{_0x31ee0b[_0x858b('0x51')]=![];}_0x133468[_0x858b('0x52')]=_0x31ee0b;return db[_0x858b('0x53')][_0x858b('0x48')]({'body':_0x395701[_0x858b('0x28')][_0x858b('0x28')],'FaxAccountId':_0x395701['account']['id'],'FaxInteractionId':_0x4d6213['id'],'direction':'in','ContactId':_0x4d6213[_0x858b('0x54')],'AttachmentId':_0x395701[_0x858b('0x28')][_0x858b('0x55')]});})['then'](function(_0x36df2b){_0x133468['message']=_0x36df2b;if(_0x133468[_0x858b('0x52')][_0x858b('0x56')]){return db[_0x858b('0x57')][_0x858b('0x38')]({'attributes':['id',_0x858b('0x58')],'where':{'id':_0x133468['interaction'][_0x858b('0x56')]}})['then'](function(_0x284a98){if(_0x284a98){_0x133468[_0x858b('0x43')][_0x858b('0x59')]({'id':0x0,'priority':0x0,'app':_0x858b('0x5a'),'appdata':_0x284a98['name']+','+(_0x133468[_0x858b('0x41')]['waitForTheAssignedAgent']||0xa),'interval':_0x858b('0x50')});}return respondWithRpcPromise(_0x858b('0x5b'),_0x858b('0x5c'),_0x133468);});}return respondWithRpcPromise(_0x858b('0x5b'),_0x858b('0x5c'),_0x133468);})[_0x858b('0x13')](function(_0x51704c){_0x275c4c(_0x51704c);})[_0x858b('0x1b')](function(_0x131360){_0x8bb772(_0x4a9fbc[_0x858b('0x17')](0x1f4,_0x131360[_0x858b('0x19')]));});});}; \ No newline at end of file +var _0x5da2=['list','List','orderBy','priority','length','ListId','create','contact','fax','FaxInteraction','autoclose','close','unmanaged','*,*,*,*','interaction','FaxMessage','AttachmentId','UserId','User','name','agent','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','register','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','FaxAccount','findAll','options','attributes','limit','include','map','model','GetFaxAccount','stringify','NotifyFaxAccount','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','DESC','FaxApplication','Applications','applications'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0x5da2,0xc1));var _0x25da=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x5da2[_0x2afbb0];return _0x411ff2;};'use strict';var _=require(_0x25da('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x25da('0x1'));var rs=require(_0x25da('0x2'));var fs=require('fs');var Redis=require(_0x25da('0x3'));var db=require(_0x25da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x25da('0x5'))(_0x25da('0x6'));var config=require('../../config/environment');var jayson=require(_0x25da('0x7'));var client=jayson[_0x25da('0x8')][_0x25da('0x9')]({'port':0x232c});config[_0x25da('0xa')]=_[_0x25da('0xb')](config[_0x25da('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x25da('0xc'))(new Redis(config[_0x25da('0xa')]));require(_0x25da('0xd'))[_0x25da('0xe')](socket);function respondWithRpcPromise(_0x21304a,_0x392971,_0x5cd88d){return new BPromise(function(_0x19869d,_0x2572cf){return client['request'](_0x21304a,_0x5cd88d)[_0x25da('0xf')](function(_0xcf93d){logger['info'](_0x25da('0x10'),_0x392971,_0x25da('0x11'));logger[_0x25da('0x12')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x392971,'request\x20sent',JSON['stringify'](_0xcf93d));if(_0xcf93d[_0x25da('0x13')]){if(_0xcf93d[_0x25da('0x13')][_0x25da('0x14')]===0x1f4){logger['error'](_0x25da('0x10'),_0x392971,_0xcf93d['error'][_0x25da('0x15')]);return _0x2572cf(_0xcf93d['error'][_0x25da('0x15')]);}logger[_0x25da('0x13')](_0x25da('0x10'),_0x392971,_0xcf93d[_0x25da('0x13')][_0x25da('0x15')]);return _0x19869d(_0xcf93d[_0x25da('0x13')]['message']);}else{logger[_0x25da('0x16')](_0x25da('0x10'),_0x392971,_0x25da('0x11'));_0x19869d(_0xcf93d[_0x25da('0x17')][_0x25da('0x15')]);}})[_0x25da('0x18')](function(_0x493d70){logger['error'](_0x25da('0x10'),_0x392971,_0x493d70);_0x2572cf(_0x493d70);});});}exports['GetFaxAccount']=function(_0x167e19){var _0x111a9a=this;return new Promise(function(_0x12aafb,_0x4540c7){return db[_0x25da('0x19')][_0x25da('0x1a')]({'raw':_0x167e19[_0x25da('0x1b')]?_0x167e19['options']['raw']===undefined?!![]:![]:!![],'where':_0x167e19[_0x25da('0x1b')]?_0x167e19[_0x25da('0x1b')]['where']||null:null,'attributes':_0x167e19[_0x25da('0x1b')]?_0x167e19['options'][_0x25da('0x1c')]||null:null,'limit':_0x167e19['options']?_0x167e19[_0x25da('0x1b')][_0x25da('0x1d')]||null:null,'include':_0x167e19[_0x25da('0x1b')]?_0x167e19[_0x25da('0x1b')][_0x25da('0x1e')]?_[_0x25da('0x1f')](_0x167e19['options'][_0x25da('0x1e')],function(_0x16bcc7){return{'model':db[_0x16bcc7[_0x25da('0x20')]],'as':_0x16bcc7['as'],'attributes':_0x16bcc7['attributes'],'include':_0x16bcc7[_0x25da('0x1e')]?_[_0x25da('0x1f')](_0x16bcc7[_0x25da('0x1e')],function(_0x4254d9){return{'model':db[_0x4254d9[_0x25da('0x20')]],'as':_0x4254d9['as'],'attributes':_0x4254d9[_0x25da('0x1c')],'include':_0x4254d9[_0x25da('0x1e')]?_[_0x25da('0x1f')](_0x4254d9[_0x25da('0x1e')],function(_0x4f75a){return{'model':db[_0x4f75a[_0x25da('0x20')]],'as':_0x4f75a['as'],'attributes':_0x4f75a[_0x25da('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x25da('0xf')](function(_0x56e72d){logger['info'](_0x25da('0x21'),_0x167e19);logger['debug'](_0x25da('0x21'),_0x167e19,JSON[_0x25da('0x22')](_0x56e72d));_0x12aafb(_0x56e72d);})[_0x25da('0x18')](function(_0x42d971){logger[_0x25da('0x13')]('GetFaxAccount',_0x42d971[_0x25da('0x15')],_0x167e19);_0x4540c7(_0x111a9a[_0x25da('0x13')](0x1f4,_0x42d971['message']));});});};exports[_0x25da('0x23')]=function(_0x294217,_0x35465e,_0x1cbda1){var _0x1239e0=this;return new Promise(function(_0x3fccea,_0x4b59b5){var _0x33c7f1={'body':_0x294217['body'],'channel':'fax'};var _0x236f39=[];var _0x5a8b70=[];var _0x22ec8c={};return db[_0x25da('0x24')]['describe']()[_0x25da('0xf')](function(_0x534009){if(!_0x534009){throw new db[(_0x25da('0x25'))][(_0x25da('0x26'))](_0x25da('0x27'));}_0x236f39=_[_0x25da('0x28')](_[_0x25da('0x29')](_0x534009),[_0x25da('0x2a'),_0x25da('0x2b')]);_0x5a8b70=_[_0x25da('0x28')](_[_0x25da('0x29')](_0x534009),[_0x25da('0x2a'),'updatedAt',_0x25da('0x2c'),'ListId']);if(_0x294217[_0x25da('0x2d')]['id']){delete _0x294217[_0x25da('0x2d')]['id'];}if(_[_0x25da('0x2e')](_0x294217[_0x25da('0x2d')][_0x25da('0x2f')])){throw new db[(_0x25da('0x25'))][(_0x25da('0x26'))](_0x25da('0x30'));}if(_[_0x25da('0x2e')](_0x294217[_0x25da('0x2d')][_0x25da('0x2d')])||_0x294217['body'][_0x25da('0x2d')]===''){throw new db[(_0x25da('0x25'))]['ValidationError'](_0x25da('0x31'));}if(_[_0x25da('0x2e')](_0x294217[_0x25da('0x2d')]['mapKey'])){throw new db[(_0x25da('0x25'))][(_0x25da('0x26'))](_0x25da('0x32')+_0x5a8b70);}if(!_[_0x25da('0x33')](_0x5a8b70,_0x294217[_0x25da('0x2d')][_0x25da('0x34')])){throw new db[(_0x25da('0x25'))][(_0x25da('0x26'))](_0x25da('0x35')+_0x5a8b70);}_0x22ec8c[_0x294217[_0x25da('0x2d')]['mapKey']]=_0x294217[_0x25da('0x2d')][_0x25da('0x2f')];})['then'](function(){return db['FaxAccount'][_0x25da('0x36')]({'where':{'id':_0x294217[_0x25da('0x37')]['id']},'include':[{'model':db[_0x25da('0x38')],'as':'List','include':[{'model':db[_0x25da('0x24')],'as':_0x25da('0x39'),'where':_0x22ec8c,'limit':0x1,'order':[[_0x25da('0x2b'),_0x25da('0x3a')]]}]},{'model':db[_0x25da('0x3b')],'as':_0x25da('0x3c')}]});})[_0x25da('0xf')](function(_0x2aa672){if(_0x2aa672&&_0x2aa672['List']){var _0x530c94=_0x2aa672['get']({'plain':!![]});_0x33c7f1[_0x25da('0x37')]=_0x530c94;_0x33c7f1[_0x25da('0x3d')]=_0x530c94['Applications'];_0x33c7f1[_0x25da('0x3e')]=_0x530c94[_0x25da('0x3f')];_0x33c7f1[_0x25da('0x3d')]=_[_0x25da('0x40')](_0x33c7f1[_0x25da('0x3d')],[_0x25da('0x41')],['asc']);if(_0x33c7f1[_0x25da('0x37')]['Applications']){delete _0x33c7f1[_0x25da('0x37')][_0x25da('0x3c')];}if(_0x33c7f1[_0x25da('0x37')]['List']&&_0x33c7f1[_0x25da('0x37')][_0x25da('0x3f')][_0x25da('0x39')][_0x25da('0x42')]){return _0x33c7f1['account'][_0x25da('0x3f')][_0x25da('0x39')][0x0];}var _0x1f899b=_[_0x25da('0xb')](_0x294217['body'],{'firstName':_0x294217[_0x25da('0x2d')][_0x25da('0x2f')],'ListId':_0x530c94[_0x25da('0x43')]});_0x1f899b[_0x294217[_0x25da('0x2d')]['mapKey']]=_0x294217[_0x25da('0x2d')][_0x25da('0x2f')];return db['CmContact'][_0x25da('0x44')](_0x1f899b,{'fields':_0x236f39,'raw':!![]});}})['then'](function(_0x3b49b3){_0x33c7f1[_0x25da('0x45')]=_0x3b49b3;if(_0x3b49b3){var _0x16c95f={'ContactId':_0x3b49b3['id'],'FaxAccountId':_0x294217[_0x25da('0x37')]['id'],'fax':_0x3b49b3[_0x25da('0x46')]};return db[_0x25da('0x47')][_0x25da('0x36')]({'where':{'ContactId':_0x3b49b3['id'],'closed':![],'FaxAccountId':_0x294217[_0x25da('0x37')]['id']}})[_0x25da('0xf')](function(_0x5cf027){if(_0x5cf027){return[_0x5cf027,![]];}return db[_0x25da('0x47')]['create'](_0x16c95f)['then'](function(_0x51aaca){return[_0x51aaca,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x126657,_0x49358c){var _0x31a58=_0x126657['get']({'plain':!![]});if(_0x49358c){if(_0x33c7f1['account'][_0x25da('0x48')]){_0x33c7f1[_0x25da('0x3d')]['push']({'id':0x0,'priority':_0x33c7f1[_0x25da('0x3d')][_0x25da('0x42')]+0x1,'app':_0x25da('0x49'),'appdata':_0x25da('0x4a'),'interval':_0x25da('0x4b')});}_0x31a58['created']=!![];}else{_0x31a58['created']=![];}_0x33c7f1[_0x25da('0x4c')]=_0x31a58;return db[_0x25da('0x4d')][_0x25da('0x44')]({'body':_0x294217['body'][_0x25da('0x2d')],'FaxAccountId':_0x294217[_0x25da('0x37')]['id'],'FaxInteractionId':_0x126657['id'],'direction':'in','ContactId':_0x126657['ContactId'],'AttachmentId':_0x294217[_0x25da('0x2d')][_0x25da('0x4e')]});})[_0x25da('0xf')](function(_0x5514a3){_0x33c7f1['message']=_0x5514a3;if(_0x33c7f1[_0x25da('0x4c')][_0x25da('0x4f')]){return db[_0x25da('0x50')][_0x25da('0x36')]({'attributes':['id',_0x25da('0x51')],'where':{'id':_0x33c7f1[_0x25da('0x4c')][_0x25da('0x4f')]}})[_0x25da('0xf')](function(_0x409176){if(_0x409176){_0x33c7f1[_0x25da('0x3d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x25da('0x52'),'appdata':_0x409176[_0x25da('0x51')]+','+(_0x33c7f1[_0x25da('0x37')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x33c7f1);});}return respondWithRpcPromise(_0x25da('0x53'),_0x25da('0x54'),_0x33c7f1);})[_0x25da('0xf')](function(_0x3f81c1){_0x3fccea(_0x3f81c1);})[_0x25da('0x18')](function(_0x3af122){_0x4b59b5(_0x1239e0[_0x25da('0x13')](0x1f4,_0x3af122[_0x25da('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 4bbc322..326f934 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 _0xb50d=['remove','update','emit','removeListener','register','length','faxAccount:','./faxAccount.events','save'];(function(_0x3deb08,_0x4d3d85){var _0x5412a1=function(_0x118d8f){while(--_0x118d8f){_0x3deb08['push'](_0x3deb08['shift']());}};_0x5412a1(++_0x4d3d85);}(_0xb50d,0x1a5));var _0xdb50=function(_0x3ff11a,_0x312cfa){_0x3ff11a=_0x3ff11a-0x0;var _0x3bda2e=_0xb50d[_0x3ff11a];return _0x3bda2e;};'use strict';var FaxAccountEvents=require(_0xdb50('0x0'));var events=[_0xdb50('0x1'),_0xdb50('0x2'),_0xdb50('0x3')];function createListener(_0x263845,_0x522ac4){return function(_0x3be00d){_0x522ac4[_0xdb50('0x4')](_0x263845,_0x3be00d);};}function removeListener(_0x16d71c,_0x440a00){return function(){FaxAccountEvents[_0xdb50('0x5')](_0x16d71c,_0x440a00);};}exports[_0xdb50('0x6')]=function(_0x147570){for(var _0x3d2ba5=0x0,_0x4d4666=events[_0xdb50('0x7')];_0x3d2ba5<_0x4d4666;_0x3d2ba5++){var _0x3d74d6=events[_0x3d2ba5];var _0x11dc51=createListener(_0xdb50('0x8')+_0x3d74d6,_0x147570);FaxAccountEvents['on'](_0x3d74d6,_0x11dc51);}}; \ No newline at end of file +var _0xc142=['./faxAccount.events','save','remove','update','emit','removeListener','length','faxAccount:'];(function(_0x1acb96,_0x108216){var _0x5da6cf=function(_0x495410){while(--_0x495410){_0x1acb96['push'](_0x1acb96['shift']());}};_0x5da6cf(++_0x108216);}(_0xc142,0x88));var _0x2c14=function(_0x25fa5c,_0x421141){_0x25fa5c=_0x25fa5c-0x0;var _0x1bade2=_0xc142[_0x25fa5c];return _0x1bade2;};'use strict';var FaxAccountEvents=require(_0x2c14('0x0'));var events=[_0x2c14('0x1'),_0x2c14('0x2'),_0x2c14('0x3')];function createListener(_0x774ea7,_0x3a3ca9){return function(_0x24a26a){_0x3a3ca9[_0x2c14('0x4')](_0x774ea7,_0x24a26a);};}function removeListener(_0x3e9204,_0x5f04b1){return function(){FaxAccountEvents[_0x2c14('0x5')](_0x3e9204,_0x5f04b1);};}exports['register']=function(_0x1c473c){for(var _0x2484b1=0x0,_0x3cfd94=events[_0x2c14('0x6')];_0x2484b1<_0x3cfd94;_0x2484b1++){var _0x240fe3=events[_0x2484b1];var _0x19db02=createListener(_0x2c14('0x7')+_0x240fe3,_0x1c473c);FaxAccountEvents['on'](_0x240fe3,_0x19db02);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index d4ef70e..1b86520 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(_0x5505a6,_0x3ecff8){var _0x95632=function(_0x5a8b33){while(--_0x5a8b33){_0x5505a6['push'](_0x5505a6['shift']());}};_0x95632(++_0x3ecff8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x251bc2,_0x35bd21){var _0xef3802=function(_0x230a1a){while(--_0x230a1a){_0x251bc2['push'](_0x251bc2['shift']());}};_0xef3802(++_0x35bd21);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 d3fdf07..c97501b 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 _0x2fd1=['STRING','sequelize','exports','INTEGER','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2fd1,0x6a));var _0x12fd=function(_0x4ab32c,_0x44ab5e){_0x4ab32c=_0x4ab32c-0x0;var _0x2b9644=_0x2fd1[_0x4ab32c];return _0x2b9644;};'use strict';var Sequelize=require(_0x12fd('0x0'));module[_0x12fd('0x1')]={'priority':{'type':Sequelize[_0x12fd('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x12fd('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x12fd('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x0141=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x4b1f2b,_0x3c42e4){var _0x2f6072=function(_0x21e9b2){while(--_0x21e9b2){_0x4b1f2b['push'](_0x4b1f2b['shift']());}};_0x2f6072(++_0x3c42e4);}(_0x0141,0x129));var _0x1014=function(_0x1ec08e,_0x5ca6f0){_0x1ec08e=_0x1ec08e-0x0;var _0x424112=_0x0141[_0x1ec08e];return _0x424112;};'use strict';var Sequelize=require(_0x1014('0x0'));module[_0x1014('0x1')]={'priority':{'type':Sequelize[_0x1014('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x1014('0x3')]()},'description':{'type':Sequelize[_0x1014('0x4')]},'interval':{'type':Sequelize[_0x1014('0x4')],'defaultValue':_0x1014('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index f982a9e..1b18bc4 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 _0xaaff=['key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','count','includeAll','rows','catch','show','params','intersection','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type'];(function(_0x2c1563,_0x206767){var _0x3352a9=function(_0x46c687){while(--_0x46c687){_0x2c1563['push'](_0x2c1563['shift']());}};_0x3352a9(++_0x206767);}(_0xaaff,0x18e));var _0xfaaf=function(_0x4f2b8c,_0x4012c8){_0x4f2b8c=_0x4f2b8c-0x0;var _0x1226ae=_0xaaff[_0x4f2b8c];return _0x1226ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfaaf('0x0'));var zipdir=require(_0xfaaf('0x1'));var jsonpatch=require(_0xfaaf('0x2'));var rp=require(_0xfaaf('0x3'));var moment=require('moment');var BPromise=require(_0xfaaf('0x4'));var Mustache=require(_0xfaaf('0x5'));var util=require(_0xfaaf('0x6'));var path=require(_0xfaaf('0x7'));var sox=require(_0xfaaf('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfaaf('0x9'));var _=require(_0xfaaf('0xa'));var squel=require('squel');var crypto=require(_0xfaaf('0xb'));var jsforce=require(_0xfaaf('0xc'));var deskjs=require(_0xfaaf('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfaaf('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfaaf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfaaf('0x10'));var logger=require(_0xfaaf('0x11'))(_0xfaaf('0x12'));var utils=require(_0xfaaf('0x13'));var config=require(_0xfaaf('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xfaaf('0x15'))['db'];function respondWithStatusCode(_0x2a9a1d,_0x200c61){_0x200c61=_0x200c61||0xcc;return function(_0x5d6768){if(_0x5d6768){return _0x2a9a1d[_0xfaaf('0x16')](_0x200c61);}return _0x2a9a1d['status'](_0x200c61)[_0xfaaf('0x17')]();};}function respondWithResult(_0x11d064,_0x29db5c){_0x29db5c=_0x29db5c||0xc8;return function(_0x1b7f2f){if(_0x1b7f2f){return _0x11d064[_0xfaaf('0x18')](_0x29db5c)[_0xfaaf('0x19')](_0x1b7f2f);}};}function respondWithFilteredResult(_0x4fa01d,_0x47d2f4){return function(_0x23b61c){if(_0x23b61c){var _0x5a9cd1=typeof _0x47d2f4[_0xfaaf('0x1a')]===_0xfaaf('0x1b')&&typeof _0x47d2f4[_0xfaaf('0x1c')]==='undefined';var _0x11e05e=_0x23b61c['count'];var _0x3942a4=_0x5a9cd1?0x0:_0x47d2f4[_0xfaaf('0x1a')];var _0x96cfb6=_0x5a9cd1?_0x23b61c['count']:_0x47d2f4['offset']+_0x47d2f4['limit'];var _0x260831;if(_0x96cfb6>=_0x11e05e){_0x96cfb6=_0x11e05e;_0x260831=0xc8;}else{_0x260831=0xce;}_0x4fa01d[_0xfaaf('0x18')](_0x260831);return _0x4fa01d[_0xfaaf('0x1d')](_0xfaaf('0x1e'),_0x3942a4+'-'+_0x96cfb6+'/'+_0x11e05e)[_0xfaaf('0x19')](_0x23b61c);}return null;};}function patchUpdates(_0x5b1de7){return function(_0x6f23d){try{jsonpatch[_0xfaaf('0x1f')](_0x6f23d,_0x5b1de7,!![]);}catch(_0x338cbc){return BPromise[_0xfaaf('0x20')](_0x338cbc);}return _0x6f23d[_0xfaaf('0x21')]();};}function saveUpdates(_0x4c976a,_0x3f5454){return function(_0x3d76b0){if(_0x3d76b0){return _0x3d76b0[_0xfaaf('0x22')](_0x4c976a)[_0xfaaf('0x23')](function(_0x3160b1){return _0x3160b1;});}return null;};}function removeEntity(_0x3b01a4,_0x1dadab){return function(_0x1111ee){if(_0x1111ee){return _0x1111ee[_0xfaaf('0x24')]()[_0xfaaf('0x23')](function(){_0x3b01a4[_0xfaaf('0x18')](0xcc)[_0xfaaf('0x17')]();});}};}function handleEntityNotFound(_0x1dc16c,_0x111429){return function(_0x29fb08){if(!_0x29fb08){_0x1dc16c['sendStatus'](0x194);}return _0x29fb08;};}function handleError(_0x94445e,_0x132864){_0x132864=_0x132864||0x1f4;return function(_0x1ae914){logger['error'](_0x1ae914[_0xfaaf('0x25')]);if(_0x1ae914[_0xfaaf('0x26')]){delete _0x1ae914[_0xfaaf('0x26')];}_0x94445e[_0xfaaf('0x18')](_0x132864)[_0xfaaf('0x27')](_0x1ae914);};}exports[_0xfaaf('0x28')]=function(_0x1853ee,_0x543c43){var _0x3a2b40={},_0x4d91de={},_0x2960c5={'count':0x0,'rows':[]};var _0x31ae45=_[_0xfaaf('0x29')](db[_0xfaaf('0x2a')][_0xfaaf('0x2b')],function(_0x24712c){return{'name':_0x24712c[_0xfaaf('0x2c')],'type':_0x24712c[_0xfaaf('0x2d')][_0xfaaf('0x2e')]};});_0x4d91de[_0xfaaf('0x2f')]=_[_0xfaaf('0x29')](_0x31ae45,_0xfaaf('0x26'));_0x4d91de[_0xfaaf('0x30')]=_[_0xfaaf('0x31')](_0x1853ee[_0xfaaf('0x30')]);_0x4d91de[_0xfaaf('0x32')]=_['intersection'](_0x4d91de['model'],_0x4d91de['query']);_0x3a2b40[_0xfaaf('0x33')]=_['intersection'](_0x4d91de[_0xfaaf('0x2f')],qs[_0xfaaf('0x34')](_0x1853ee[_0xfaaf('0x30')][_0xfaaf('0x34')]));_0x3a2b40['attributes']=_0x3a2b40[_0xfaaf('0x33')][_0xfaaf('0x35')]?_0x3a2b40[_0xfaaf('0x33')]:_0x4d91de[_0xfaaf('0x2f')];if(!_0x1853ee[_0xfaaf('0x30')][_0xfaaf('0x36')]('nolimit')){_0x3a2b40[_0xfaaf('0x1c')]=qs[_0xfaaf('0x1c')](_0x1853ee[_0xfaaf('0x30')][_0xfaaf('0x1c')]);_0x3a2b40['offset']=qs[_0xfaaf('0x1a')](_0x1853ee[_0xfaaf('0x30')]['offset']);}_0x3a2b40[_0xfaaf('0x37')]=qs[_0xfaaf('0x38')](_0x1853ee['query'][_0xfaaf('0x38')]);_0x3a2b40[_0xfaaf('0x39')]=qs[_0xfaaf('0x32')](_[_0xfaaf('0x3a')](_0x1853ee[_0xfaaf('0x30')],_0x4d91de['filters']),_0x31ae45);if(_0x1853ee[_0xfaaf('0x30')]['filter']){_0x3a2b40[_0xfaaf('0x39')]=_['merge'](_0x3a2b40['where'],{'$or':_[_0xfaaf('0x29')](_0x31ae45,function(_0x24508f){if(_0x24508f['type']!==_0xfaaf('0x3b')){var _0x35b478={};_0x35b478[_0x24508f['name']]={'$like':'%'+_0x1853ee[_0xfaaf('0x30')][_0xfaaf('0x3c')]+'%'};return _0x35b478;}})});}_0x3a2b40=_[_0xfaaf('0x3d')]({},_0x3a2b40,_0x1853ee[_0xfaaf('0x3e')]);var _0x466dd6={'where':_0x3a2b40[_0xfaaf('0x39')]};return db[_0xfaaf('0x2a')][_0xfaaf('0x3f')](_0x466dd6)[_0xfaaf('0x23')](function(_0x533d86){_0x2960c5[_0xfaaf('0x3f')]=_0x533d86;if(_0x1853ee[_0xfaaf('0x30')][_0xfaaf('0x40')]){_0x3a2b40['include']=[{'all':!![]}];}return db[_0xfaaf('0x2a')]['findAll'](_0x3a2b40);})[_0xfaaf('0x23')](function(_0x316f42){_0x2960c5[_0xfaaf('0x41')]=_0x316f42;return _0x2960c5;})['then'](respondWithFilteredResult(_0x543c43,_0x3a2b40))[_0xfaaf('0x42')](handleError(_0x543c43,null));};exports[_0xfaaf('0x43')]=function(_0x240f01,_0x21b742){var _0x2e165d={'raw':!![],'where':{'id':_0x240f01[_0xfaaf('0x44')]['id']}},_0x2e8dd8={};_0x2e8dd8[_0xfaaf('0x2f')]=_[_0xfaaf('0x31')](db[_0xfaaf('0x2a')][_0xfaaf('0x2b')]);_0x2e8dd8[_0xfaaf('0x30')]=_['keys'](_0x240f01[_0xfaaf('0x30')]);_0x2e8dd8[_0xfaaf('0x32')]=_[_0xfaaf('0x45')](_0x2e8dd8[_0xfaaf('0x2f')],_0x2e8dd8['query']);_0x2e165d['attributes']=_[_0xfaaf('0x45')](_0x2e8dd8[_0xfaaf('0x2f')],qs['fields'](_0x240f01[_0xfaaf('0x30')][_0xfaaf('0x34')]));_0x2e165d[_0xfaaf('0x33')]=_0x2e165d[_0xfaaf('0x33')][_0xfaaf('0x35')]?_0x2e165d['attributes']:_0x2e8dd8[_0xfaaf('0x2f')];if(_0x240f01[_0xfaaf('0x30')][_0xfaaf('0x40')]){_0x2e165d[_0xfaaf('0x46')]=[{'all':!![]}];}_0x2e165d=_[_0xfaaf('0x3d')]({},_0x2e165d,_0x240f01[_0xfaaf('0x3e')]);return db[_0xfaaf('0x2a')][_0xfaaf('0x47')](_0x2e165d)[_0xfaaf('0x23')](handleEntityNotFound(_0x21b742,null))['then'](respondWithResult(_0x21b742,null))[_0xfaaf('0x42')](handleError(_0x21b742,null));};exports['create']=function(_0x19df23,_0x4d80f7){return db[_0xfaaf('0x2a')][_0xfaaf('0x48')](_0x19df23[_0xfaaf('0x49')],{})[_0xfaaf('0x23')](respondWithResult(_0x4d80f7,0xc9))[_0xfaaf('0x42')](handleError(_0x4d80f7,null));};exports[_0xfaaf('0x22')]=function(_0x4d569a,_0x895368){if(_0x4d569a[_0xfaaf('0x49')]['id']){delete _0x4d569a[_0xfaaf('0x49')]['id'];}return db[_0xfaaf('0x2a')]['find']({'where':{'id':_0x4d569a['params']['id']}})[_0xfaaf('0x23')](handleEntityNotFound(_0x895368,null))[_0xfaaf('0x23')](saveUpdates(_0x4d569a[_0xfaaf('0x49')],null))['then'](respondWithResult(_0x895368,null))['catch'](handleError(_0x895368,null));};exports[_0xfaaf('0x24')]=function(_0x516ad4,_0xa50bfb){return db[_0xfaaf('0x2a')][_0xfaaf('0x47')]({'where':{'id':_0x516ad4[_0xfaaf('0x44')]['id']}})[_0xfaaf('0x23')](handleEntityNotFound(_0xa50bfb,null))[_0xfaaf('0x23')](removeEntity(_0xa50bfb,null))[_0xfaaf('0x42')](handleError(_0xa50bfb,null));}; \ No newline at end of file +var _0xd6c1=['create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','end','error','send','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','name','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','keys','find'];(function(_0x48820e,_0x1e8c94){var _0x5c5913=function(_0x88d3af){while(--_0x88d3af){_0x48820e['push'](_0x48820e['shift']());}};_0x5c5913(++_0x1e8c94);}(_0xd6c1,0x1bf));var _0x1d6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd6c1[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x1d6c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d6c('0x1'));var jsonpatch=require(_0x1d6c('0x2'));var rp=require(_0x1d6c('0x3'));var moment=require(_0x1d6c('0x4'));var BPromise=require(_0x1d6c('0x5'));var Mustache=require('mustache');var util=require(_0x1d6c('0x6'));var path=require(_0x1d6c('0x7'));var sox=require('sox');var csv=require(_0x1d6c('0x8'));var ejs=require(_0x1d6c('0x9'));var fs=require('fs');var fs_extra=require(_0x1d6c('0xa'));var _=require(_0x1d6c('0xb'));var squel=require(_0x1d6c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1d6c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1d6c('0xe'));var Papa=require(_0x1d6c('0xf'));var Redis=require(_0x1d6c('0x10'));var authService=require(_0x1d6c('0x11'));var qs=require(_0x1d6c('0x12'));var as=require(_0x1d6c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d6c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1d6c('0x15'));var licenseUtil=require(_0x1d6c('0x16'));var db=require(_0x1d6c('0x17'))['db'];function respondWithStatusCode(_0x17d5fc,_0x13bd0f){_0x13bd0f=_0x13bd0f||0xcc;return function(_0x5e8c5e){if(_0x5e8c5e){return _0x17d5fc[_0x1d6c('0x18')](_0x13bd0f);}return _0x17d5fc['status'](_0x13bd0f)['end']();};}function respondWithResult(_0xfb6ff2,_0x41527a){_0x41527a=_0x41527a||0xc8;return function(_0x3db8c4){if(_0x3db8c4){return _0xfb6ff2[_0x1d6c('0x19')](_0x41527a)[_0x1d6c('0x1a')](_0x3db8c4);}};}function respondWithFilteredResult(_0x1f0056,_0x4c8a96){return function(_0x340071){if(_0x340071){var _0x558a88=typeof _0x4c8a96[_0x1d6c('0x1b')]===_0x1d6c('0x1c')&&typeof _0x4c8a96['limit']===_0x1d6c('0x1c');var _0x1d4dba=_0x340071[_0x1d6c('0x1d')];var _0x494ac1=_0x558a88?0x0:_0x4c8a96['offset'];var _0x508c22=_0x558a88?_0x340071[_0x1d6c('0x1d')]:_0x4c8a96[_0x1d6c('0x1b')]+_0x4c8a96[_0x1d6c('0x1e')];var _0x594311;if(_0x508c22>=_0x1d4dba){_0x508c22=_0x1d4dba;_0x594311=0xc8;}else{_0x594311=0xce;}_0x1f0056[_0x1d6c('0x19')](_0x594311);return _0x1f0056['set'](_0x1d6c('0x1f'),_0x494ac1+'-'+_0x508c22+'/'+_0x1d4dba)[_0x1d6c('0x1a')](_0x340071);}return null;};}function patchUpdates(_0x3b53a0){return function(_0xa2e7b1){try{jsonpatch[_0x1d6c('0x20')](_0xa2e7b1,_0x3b53a0,!![]);}catch(_0x3ce5d6){return BPromise[_0x1d6c('0x21')](_0x3ce5d6);}return _0xa2e7b1[_0x1d6c('0x22')]();};}function saveUpdates(_0x3a6703,_0x38db73){return function(_0x29d1e4){if(_0x29d1e4){return _0x29d1e4[_0x1d6c('0x23')](_0x3a6703)['then'](function(_0x5df5b9){return _0x5df5b9;});}return null;};}function removeEntity(_0x460611,_0x2c6174){return function(_0x413474){if(_0x413474){return _0x413474[_0x1d6c('0x24')]()[_0x1d6c('0x25')](function(){_0x460611['status'](0xcc)[_0x1d6c('0x26')]();});}};}function handleEntityNotFound(_0x3a91c0,_0x175499){return function(_0x9d57e8){if(!_0x9d57e8){_0x3a91c0[_0x1d6c('0x18')](0x194);}return _0x9d57e8;};}function handleError(_0x42e5e5,_0x476407){_0x476407=_0x476407||0x1f4;return function(_0x36a7f1){logger[_0x1d6c('0x27')](_0x36a7f1['stack']);if(_0x36a7f1['name']){delete _0x36a7f1['name'];}_0x42e5e5[_0x1d6c('0x19')](_0x476407)[_0x1d6c('0x28')](_0x36a7f1);};}exports[_0x1d6c('0x29')]=function(_0x3aa986,_0x38c99e){var _0x2a706f={},_0x20a0c9={},_0x4200a8={'count':0x0,'rows':[]};var _0x4a89eb=_['map'](db[_0x1d6c('0x2a')][_0x1d6c('0x2b')],function(_0xd3d7c){return{'name':_0xd3d7c[_0x1d6c('0x2c')],'type':_0xd3d7c[_0x1d6c('0x2d')][_0x1d6c('0x2e')]};});_0x20a0c9[_0x1d6c('0x2f')]=_[_0x1d6c('0x30')](_0x4a89eb,_0x1d6c('0x31'));_0x20a0c9['query']=_['keys'](_0x3aa986[_0x1d6c('0x32')]);_0x20a0c9[_0x1d6c('0x33')]=_[_0x1d6c('0x34')](_0x20a0c9[_0x1d6c('0x2f')],_0x20a0c9[_0x1d6c('0x32')]);_0x2a706f[_0x1d6c('0x35')]=_[_0x1d6c('0x34')](_0x20a0c9[_0x1d6c('0x2f')],qs[_0x1d6c('0x36')](_0x3aa986[_0x1d6c('0x32')][_0x1d6c('0x36')]));_0x2a706f[_0x1d6c('0x35')]=_0x2a706f[_0x1d6c('0x35')][_0x1d6c('0x37')]?_0x2a706f[_0x1d6c('0x35')]:_0x20a0c9[_0x1d6c('0x2f')];if(!_0x3aa986[_0x1d6c('0x32')]['hasOwnProperty'](_0x1d6c('0x38'))){_0x2a706f[_0x1d6c('0x1e')]=qs[_0x1d6c('0x1e')](_0x3aa986['query'][_0x1d6c('0x1e')]);_0x2a706f[_0x1d6c('0x1b')]=qs[_0x1d6c('0x1b')](_0x3aa986['query'][_0x1d6c('0x1b')]);}_0x2a706f[_0x1d6c('0x39')]=qs[_0x1d6c('0x3a')](_0x3aa986[_0x1d6c('0x32')]['sort']);_0x2a706f[_0x1d6c('0x3b')]=qs[_0x1d6c('0x33')](_[_0x1d6c('0x3c')](_0x3aa986[_0x1d6c('0x32')],_0x20a0c9[_0x1d6c('0x33')]),_0x4a89eb);if(_0x3aa986[_0x1d6c('0x32')][_0x1d6c('0x3d')]){_0x2a706f['where']=_['merge'](_0x2a706f[_0x1d6c('0x3b')],{'$or':_[_0x1d6c('0x30')](_0x4a89eb,function(_0x5f19c8){if(_0x5f19c8[_0x1d6c('0x2d')]!==_0x1d6c('0x3e')){var _0x42cd29={};_0x42cd29[_0x5f19c8['name']]={'$like':'%'+_0x3aa986[_0x1d6c('0x32')][_0x1d6c('0x3d')]+'%'};return _0x42cd29;}})});}_0x2a706f=_[_0x1d6c('0x3f')]({},_0x2a706f,_0x3aa986[_0x1d6c('0x40')]);var _0xd4a8fe={'where':_0x2a706f[_0x1d6c('0x3b')]};return db[_0x1d6c('0x2a')][_0x1d6c('0x1d')](_0xd4a8fe)[_0x1d6c('0x25')](function(_0x10c1a4){_0x4200a8['count']=_0x10c1a4;if(_0x3aa986['query'][_0x1d6c('0x41')]){_0x2a706f[_0x1d6c('0x42')]=[{'all':!![]}];}return db[_0x1d6c('0x2a')]['findAll'](_0x2a706f);})[_0x1d6c('0x25')](function(_0x3951ae){_0x4200a8['rows']=_0x3951ae;return _0x4200a8;})[_0x1d6c('0x25')](respondWithFilteredResult(_0x38c99e,_0x2a706f))[_0x1d6c('0x43')](handleError(_0x38c99e,null));};exports[_0x1d6c('0x44')]=function(_0x57ab35,_0x12f50b){var _0x17b52d={'raw':!![],'where':{'id':_0x57ab35['params']['id']}},_0x2cb4a1={};_0x2cb4a1[_0x1d6c('0x2f')]=_[_0x1d6c('0x45')](db[_0x1d6c('0x2a')][_0x1d6c('0x2b')]);_0x2cb4a1['query']=_['keys'](_0x57ab35[_0x1d6c('0x32')]);_0x2cb4a1[_0x1d6c('0x33')]=_[_0x1d6c('0x34')](_0x2cb4a1['model'],_0x2cb4a1['query']);_0x17b52d[_0x1d6c('0x35')]=_['intersection'](_0x2cb4a1[_0x1d6c('0x2f')],qs['fields'](_0x57ab35[_0x1d6c('0x32')][_0x1d6c('0x36')]));_0x17b52d[_0x1d6c('0x35')]=_0x17b52d[_0x1d6c('0x35')][_0x1d6c('0x37')]?_0x17b52d[_0x1d6c('0x35')]:_0x2cb4a1[_0x1d6c('0x2f')];if(_0x57ab35['query'][_0x1d6c('0x41')]){_0x17b52d[_0x1d6c('0x42')]=[{'all':!![]}];}_0x17b52d=_[_0x1d6c('0x3f')]({},_0x17b52d,_0x57ab35[_0x1d6c('0x40')]);return db['FaxApplication'][_0x1d6c('0x46')](_0x17b52d)[_0x1d6c('0x25')](handleEntityNotFound(_0x12f50b,null))[_0x1d6c('0x25')](respondWithResult(_0x12f50b,null))['catch'](handleError(_0x12f50b,null));};exports[_0x1d6c('0x47')]=function(_0x2a46a4,_0x583a36){return db[_0x1d6c('0x2a')]['create'](_0x2a46a4[_0x1d6c('0x48')],{})[_0x1d6c('0x25')](respondWithResult(_0x583a36,0xc9))['catch'](handleError(_0x583a36,null));};exports['update']=function(_0x2df0cd,_0x2a4543){if(_0x2df0cd[_0x1d6c('0x48')]['id']){delete _0x2df0cd[_0x1d6c('0x48')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x2df0cd['params']['id']}})[_0x1d6c('0x25')](handleEntityNotFound(_0x2a4543,null))['then'](saveUpdates(_0x2df0cd[_0x1d6c('0x48')],null))[_0x1d6c('0x25')](respondWithResult(_0x2a4543,null))['catch'](handleError(_0x2a4543,null));};exports[_0x1d6c('0x24')]=function(_0x248e4a,_0x475a6f){return db[_0x1d6c('0x2a')][_0x1d6c('0x46')]({'where':{'id':_0x248e4a[_0x1d6c('0x49')]['id']}})[_0x1d6c('0x25')](handleEntityNotFound(_0x475a6f,null))[_0x1d6c('0x25')](removeEntity(_0x475a6f,null))[_0x1d6c('0x43')](handleError(_0x475a6f,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index d68dfcf..ff33b2e 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 _0xdb3b=['define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','path','../../config/environment','exports'];(function(_0x4e7da6,_0x5d8440){var _0x25d332=function(_0x3df512){while(--_0x3df512){_0x4e7da6['push'](_0x4e7da6['shift']());}};_0x25d332(++_0x5d8440);}(_0xdb3b,0x16c));var _0xbdb3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdb3b[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbdb3('0x0'))(_0xbdb3('0x1'));var moment=require(_0xbdb3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbdb3('0x3'));var rimraf=require('rimraf');var config=require(_0xbdb3('0x4'));var attributes=require('./faxApplication.attributes');module[_0xbdb3('0x5')]=function(_0x5af45a,_0x265c96){return _0x5af45a[_0xbdb3('0x6')](_0xbdb3('0x7'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbdb3('0x8'),'collate':_0xbdb3('0x9')});}; \ No newline at end of file +var _0x2f95=['exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','./faxApplication.attributes'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x2f95,0x76));var _0x52f9=function(_0x2cacd4,_0x53f5b1){_0x2cacd4=_0x2cacd4-0x0;var _0xe85568=_0x2f95[_0x2cacd4];return _0xe85568;};'use strict';var _=require(_0x52f9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x52f9('0x1'));var moment=require(_0x52f9('0x2'));var BPromise=require(_0x52f9('0x3'));var rp=require(_0x52f9('0x4'));var fs=require('fs');var path=require(_0x52f9('0x5'));var rimraf=require(_0x52f9('0x6'));var config=require('../../config/environment');var attributes=require(_0x52f9('0x7'));module[_0x52f9('0x8')]=function(_0x27d152,_0x4fe484){return _0x27d152[_0x52f9('0x9')](_0x52f9('0xa'),attributes,{'tableName':_0x52f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x52f9('0xc'),'collate':_0x52f9('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index eff638f..3afb6b0 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 _0x06da=['randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','attributes','then','moment'];(function(_0xb56a21,_0x3093c7){var _0x121573=function(_0x4bb965){while(--_0x4bb965){_0xb56a21['push'](_0xb56a21['shift']());}};_0x121573(++_0x3093c7);}(_0x06da,0x8f));var _0xa06d=function(_0x174d7b,_0x3a4d99){_0x174d7b=_0x174d7b-0x0;var _0x1748cd=_0x06da[_0x174d7b];return _0x1748cd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa06d('0x0'));var BPromise=require('bluebird');var rs=require(_0xa06d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa06d('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xa06d('0x3'))('rpc');var config=require(_0xa06d('0x4'));var jayson=require(_0xa06d('0x5'));var client=jayson[_0xa06d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3abe3f,_0x33f7b8,_0x21f2d4){return new BPromise(function(_0x25d5cb,_0x1b2f60){return client[_0xa06d('0x7')](_0x3abe3f,_0x21f2d4)['then'](function(_0x23149b){logger[_0xa06d('0x8')]('FaxApplication,\x20%s,\x20%s',_0x33f7b8,_0xa06d('0x9'));logger[_0xa06d('0xa')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x33f7b8,_0xa06d('0x9'),JSON[_0xa06d('0xb')](_0x23149b));if(_0x23149b[_0xa06d('0xc')]){if(_0x23149b[_0xa06d('0xc')]['code']===0x1f4){logger[_0xa06d('0xc')](_0xa06d('0xd'),_0x33f7b8,_0x23149b[_0xa06d('0xc')][_0xa06d('0xe')]);return _0x1b2f60(_0x23149b[_0xa06d('0xc')]['message']);}logger[_0xa06d('0xc')]('FaxApplication,\x20%s,\x20%s',_0x33f7b8,_0x23149b[_0xa06d('0xc')][_0xa06d('0xe')]);return _0x25d5cb(_0x23149b[_0xa06d('0xc')][_0xa06d('0xe')]);}else{logger[_0xa06d('0x8')](_0xa06d('0xd'),_0x33f7b8,_0xa06d('0x9'));_0x25d5cb(_0x23149b[_0xa06d('0xf')][_0xa06d('0xe')]);}})[_0xa06d('0x10')](function(_0xee559e){logger['error'](_0xa06d('0xd'),_0x33f7b8,_0xee559e);_0x1b2f60(_0xee559e);});});}exports[_0xa06d('0x11')]=function(_0x1cdc8d){var _0x2424de=this;return new Promise(function(_0x5c9738,_0xc78abc){return db[_0xa06d('0x12')][_0xa06d('0x13')](_0x1cdc8d[_0xa06d('0x14')],{'raw':_0x1cdc8d[_0xa06d('0x15')]?_0x1cdc8d[_0xa06d('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cdc8d[_0xa06d('0x15')]?_0x1cdc8d['options']['where']||null:null,'attributes':_0x1cdc8d[_0xa06d('0x15')]?_0x1cdc8d['options'][_0xa06d('0x16')]||null:null,'limit':_0x1cdc8d[_0xa06d('0x15')]?_0x1cdc8d[_0xa06d('0x15')]['limit']||null:null})[_0xa06d('0x17')](function(_0x22e57d){logger[_0xa06d('0x8')](_0xa06d('0x11'),_0x1cdc8d);logger['debug']('UpdateFaxApplication',_0x1cdc8d,JSON[_0xa06d('0xb')](_0x22e57d));_0x5c9738(_0x22e57d);})[_0xa06d('0x10')](function(_0x15c669){logger[_0xa06d('0xc')](_0xa06d('0x11'),_0x15c669['message'],_0x1cdc8d);_0xc78abc(_0x2424de[_0xa06d('0xc')](0x1f4,_0x15c669[_0xa06d('0xe')]));});});}; \ No newline at end of file +var _0x1905=['FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','UpdateFaxApplication','update','body','options','raw','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3f4cdf,_0x10f1fa){var _0x14e489=function(_0x85634a){while(--_0x85634a){_0x3f4cdf['push'](_0x3f4cdf['shift']());}};_0x14e489(++_0x10f1fa);}(_0x1905,0x1a1));var _0x5190=function(_0x5a1024,_0x48dff9){_0x5a1024=_0x5a1024-0x0;var _0x594855=_0x1905[_0x5a1024];return _0x594855;};'use strict';var _=require(_0x5190('0x0'));var util=require('util');var moment=require(_0x5190('0x1'));var BPromise=require(_0x5190('0x2'));var rs=require(_0x5190('0x3'));var fs=require('fs');var Redis=require(_0x5190('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5190('0x5'))(_0x5190('0x6'));var config=require(_0x5190('0x7'));var jayson=require(_0x5190('0x8'));var client=jayson[_0x5190('0x9')][_0x5190('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x401b3e,_0x11c197,_0x49b076){return new BPromise(function(_0x69cf34,_0x367fbb){return client['request'](_0x401b3e,_0x49b076)[_0x5190('0xb')](function(_0x1ed50e){logger['info'](_0x5190('0xc'),_0x11c197,_0x5190('0xd'));logger[_0x5190('0xe')](_0x5190('0xf'),_0x11c197,_0x5190('0xd'),JSON[_0x5190('0x10')](_0x1ed50e));if(_0x1ed50e[_0x5190('0x11')]){if(_0x1ed50e[_0x5190('0x11')]['code']===0x1f4){logger[_0x5190('0x11')]('FaxApplication,\x20%s,\x20%s',_0x11c197,_0x1ed50e[_0x5190('0x11')][_0x5190('0x12')]);return _0x367fbb(_0x1ed50e[_0x5190('0x11')][_0x5190('0x12')]);}logger[_0x5190('0x11')](_0x5190('0xc'),_0x11c197,_0x1ed50e[_0x5190('0x11')][_0x5190('0x12')]);return _0x69cf34(_0x1ed50e[_0x5190('0x11')]['message']);}else{logger[_0x5190('0x13')](_0x5190('0xc'),_0x11c197,_0x5190('0xd'));_0x69cf34(_0x1ed50e['result'][_0x5190('0x12')]);}})['catch'](function(_0x385483){logger[_0x5190('0x11')](_0x5190('0xc'),_0x11c197,_0x385483);_0x367fbb(_0x385483);});});}exports[_0x5190('0x14')]=function(_0x59ce86){var _0x33c180=this;return new Promise(function(_0x1dd017,_0x4d5913){return db['FaxApplication'][_0x5190('0x15')](_0x59ce86[_0x5190('0x16')],{'raw':_0x59ce86[_0x5190('0x17')]?_0x59ce86[_0x5190('0x17')][_0x5190('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59ce86[_0x5190('0x17')]?_0x59ce86[_0x5190('0x17')][_0x5190('0x19')]||null:null,'attributes':_0x59ce86[_0x5190('0x17')]?_0x59ce86[_0x5190('0x17')]['attributes']||null:null,'limit':_0x59ce86['options']?_0x59ce86['options'][_0x5190('0x1a')]||null:null})[_0x5190('0xb')](function(_0x19c491){logger[_0x5190('0x13')](_0x5190('0x14'),_0x59ce86);logger['debug']('UpdateFaxApplication',_0x59ce86,JSON[_0x5190('0x10')](_0x19c491));_0x1dd017(_0x19c491);})['catch'](function(_0x24cfe1){logger[_0x5190('0x11')](_0x5190('0x14'),_0x24cfe1[_0x5190('0x12')],_0x59ce86);_0x4d5913(_0x33c180[_0x5190('0x11')](0x1f4,_0x24cfe1[_0x5190('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 98c951c..3230921 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 _0x6324=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x1f1743,_0x4a1d6e){var _0x372903=function(_0x2cde28){while(--_0x2cde28){_0x1f1743['push'](_0x1f1743['shift']());}};_0x372903(++_0x4a1d6e);}(_0x6324,0x142));var _0x4632=function(_0x289a1f,_0x1b4dc6){_0x289a1f=_0x289a1f-0x0;var _0x5a44ec=_0x6324[_0x289a1f];return _0x5a44ec;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./faxApplication.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0xb')]('/',auth['isAuthenticated'](),controller[_0x4632('0xc')]);router[_0x4632('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x4632('0xe')]);router[_0x4632('0xf')](_0x4632('0x10'),auth[_0x4632('0x8')](),controller[_0x4632('0x11')]);module[_0x4632('0x12')]=router; \ No newline at end of file +var _0xdd4f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','express'];(function(_0x47cfb2,_0x550212){var _0x1d5212=function(_0x165365){while(--_0x165365){_0x47cfb2['push'](_0x47cfb2['shift']());}};_0x1d5212(++_0x550212);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x753c76,_0x5dd234){_0x753c76=_0x753c76-0x0;var _0x4eb68a=_0xdd4f[_0x753c76];return _0x4eb68a;};'use strict';var multer=require(_0xfdd4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdd4('0x1'));var router=express[_0xfdd4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfdd4('0x3'));var interaction=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var controller=require('./faxApplication.controller');router[_0xfdd4('0x6')]('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0x8')]);router[_0xfdd4('0x6')](_0xfdd4('0x9'),auth['isAuthenticated'](),controller[_0xfdd4('0xa')]);router['post']('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xb')]);router[_0xfdd4('0xc')]('/:id',auth[_0xfdd4('0x7')](),controller['update']);router[_0xfdd4('0xd')](_0xfdd4('0x9'),auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xe')]);module[_0xfdd4('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index e7051ae..01f414e 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 _0xd4b7=['ENUM','sequelize','exports','BOOLEAN','DATE','STRING','out'];(function(_0x45967a,_0x474c44){var _0xf97e90=function(_0x207c36){while(--_0x207c36){_0x45967a['push'](_0x45967a['shift']());}};_0xf97e90(++_0x474c44);}(_0xd4b7,0x10b));var _0x7d4b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4b7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7d4b('0x0'));module[_0x7d4b('0x1')]={'closed':{'type':Sequelize[_0x7d4b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7d4b('0x3')]},'disposition':{'type':Sequelize[_0x7d4b('0x4')]},'secondDisposition':{'type':Sequelize[_0x7d4b('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7d4b('0x4')]},'read1stAt':{'type':Sequelize[_0x7d4b('0x3')]},'fax':{'type':Sequelize[_0x7d4b('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7d4b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7d4b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x7d4b('0x6')]('in',_0x7d4b('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xd592=['ENUM','out','exports','BOOLEAN','DATE','STRING'];(function(_0x333666,_0x513de3){var _0x3b9de9=function(_0x1cb806){while(--_0x1cb806){_0x333666['push'](_0x333666['shift']());}};_0x3b9de9(++_0x513de3);}(_0xd592,0xa4));var _0x2d59=function(_0x255acd,_0x1f6943){_0x255acd=_0x255acd-0x0;var _0x3e6e31=_0xd592[_0x255acd];return _0x3e6e31;};'use strict';var Sequelize=require('sequelize');module[_0x2d59('0x0')]={'closed':{'type':Sequelize[_0x2d59('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2d59('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2d59('0x3')]},'note':{'type':Sequelize[_0x2d59('0x3')]},'read1stAt':{'type':Sequelize[_0x2d59('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x2d59('0x4')]('in',_0x2d59('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2d59('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x2d59('0x4')]('in',_0x2d59('0x5')),'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 05aa7e1..6cc8b6a 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 _0x5e7d=['tools_tags','t.id\x20=\x20it.TagId','expr','search','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','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','contactName','isEmpty','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','model','rawAttributes','fields','includeAll','include','create','describe','addMessage','ids','omit','findOne','FaxMessage','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','faxInteractionTags:save','removeTags','download','unix','join','root','files','server','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','Users','map','TagIds','Tags','forEach','catch','talking','answered','unmanaged','total','closed','UserId','waiting','index','FaxInteraction','type','key','keys','query','filters','intersection','attributes','length','nolimit','order','sort','pick','select','field','color','from','ui.FaxInteractionId','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id'];(function(_0x3efc2b,_0x30e89e){var _0x143578=function(_0x506c2d){while(--_0x506c2d){_0x3efc2b['push'](_0x3efc2b['shift']());}};_0x143578(++_0x30e89e);}(_0x5e7d,0x15f));var _0xd5e7=function(_0x367336,_0x18c229){_0x367336=_0x367336-0x0;var _0x3423a7=_0x5e7d[_0x367336];return _0x3423a7;};'use strict';var emlformat=require(_0xd5e7('0x0'));var rimraf=require(_0xd5e7('0x1'));var zipdir=require(_0xd5e7('0x2'));var jsonpatch=require(_0xd5e7('0x3'));var rp=require(_0xd5e7('0x4'));var moment=require(_0xd5e7('0x5'));var BPromise=require(_0xd5e7('0x6'));var Mustache=require(_0xd5e7('0x7'));var util=require(_0xd5e7('0x8'));var path=require(_0xd5e7('0x9'));var sox=require(_0xd5e7('0xa'));var csv=require(_0xd5e7('0xb'));var ejs=require(_0xd5e7('0xc'));var fs=require('fs');var fs_extra=require(_0xd5e7('0xd'));var _=require(_0xd5e7('0xe'));var squel=require(_0xd5e7('0xf'));var crypto=require('crypto');var jsforce=require(_0xd5e7('0x10'));var deskjs=require(_0xd5e7('0x11'));var toCsv=require(_0xd5e7('0xb'));var querystring=require(_0xd5e7('0x12'));var Papa=require(_0xd5e7('0x13'));var Redis=require(_0xd5e7('0x14'));var authService=require(_0xd5e7('0x15'));var qs=require(_0xd5e7('0x16'));var as=require(_0xd5e7('0x17'));var hardwareService=require(_0xd5e7('0x18'));var logger=require(_0xd5e7('0x19'))(_0xd5e7('0x1a'));var utils=require(_0xd5e7('0x1b'));var config=require(_0xd5e7('0x1c'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd5e7('0x1d')]=_['defaults'](config['redis'],{'host':_0xd5e7('0x1e'),'port':0x18eb});var socket=require(_0xd5e7('0x1f'))(new Redis(config['redis']));require(_0xd5e7('0x20'))[_0xd5e7('0x21')](socket);function respondWithStatusCode(_0x41d3fb,_0x4933a3){_0x4933a3=_0x4933a3||0xcc;return function(_0x250aaa){if(_0x250aaa){return _0x41d3fb[_0xd5e7('0x22')](_0x4933a3);}return _0x41d3fb[_0xd5e7('0x23')](_0x4933a3)[_0xd5e7('0x24')]();};}function respondWithResult(_0x4bebde,_0x5fce4c){_0x5fce4c=_0x5fce4c||0xc8;return function(_0x5175a5){if(_0x5175a5){return _0x4bebde['status'](_0x5fce4c)['json'](_0x5175a5);}};}function respondWithFilteredResult(_0xa205dd,_0x5290bc){return function(_0x481966){if(_0x481966){var _0x570735=typeof _0x5290bc[_0xd5e7('0x25')]===_0xd5e7('0x26')&&typeof _0x5290bc[_0xd5e7('0x27')]===_0xd5e7('0x26');var _0x571d72=_0x481966[_0xd5e7('0x28')];var _0x2f0158=_0x570735?0x0:_0x5290bc[_0xd5e7('0x25')];var _0x256950=_0x570735?_0x481966[_0xd5e7('0x28')]:_0x5290bc[_0xd5e7('0x25')]+_0x5290bc['limit'];var _0x1e25f6;if(_0x256950>=_0x571d72){_0x256950=_0x571d72;_0x1e25f6=0xc8;}else{_0x1e25f6=0xce;}_0xa205dd[_0xd5e7('0x23')](_0x1e25f6);return _0xa205dd[_0xd5e7('0x29')](_0xd5e7('0x2a'),_0x2f0158+'-'+_0x256950+'/'+_0x571d72)[_0xd5e7('0x2b')](_0x481966);}return null;};}function patchUpdates(_0x5e52aa){return function(_0x4daf8b){try{jsonpatch['apply'](_0x4daf8b,_0x5e52aa,!![]);}catch(_0x523935){return BPromise[_0xd5e7('0x2c')](_0x523935);}return _0x4daf8b[_0xd5e7('0x2d')]();};}function saveUpdates(_0x4a3c6e,_0x1cb89a){return function(_0x451afa){if(_0x451afa){return _0x451afa[_0xd5e7('0x2e')](_0x4a3c6e)[_0xd5e7('0x2f')](function(_0x450cb0){return _0x450cb0;});}return null;};}function removeEntity(_0xaab16d,_0x552021){return function(_0x32a9b0){if(_0x32a9b0){return _0x32a9b0[_0xd5e7('0x30')]()[_0xd5e7('0x2f')](function(){_0xaab16d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x11140e,_0x34058b){return function(_0x46db32){if(!_0x46db32){_0x11140e[_0xd5e7('0x22')](0x194);}return _0x46db32;};}function handleError(_0xe5df6d,_0xd3deea){_0xd3deea=_0xd3deea||0x1f4;return function(_0x51d1e6){logger['error'](_0x51d1e6[_0xd5e7('0x31')]);if(_0x51d1e6[_0xd5e7('0x32')]){delete _0x51d1e6[_0xd5e7('0x32')];}_0xe5df6d['status'](_0xd3deea)[_0xd5e7('0x33')](_0x51d1e6);};}function getInteractionUsers(_0x25faa9,_0x3d85e5){return new BPromise(function(_0x3730f6,_0x4747d4){try{if(_0x3d85e5[_0x25faa9['id']]){_0x25faa9[_0xd5e7('0x34')]=_[_0xd5e7('0x35')](_0x3d85e5[_0x25faa9['id']],function(_0x4a8b77){return{'id':_0x4a8b77['id'],'fullname':_0x4a8b77['fullname']};});}}catch(_0x2091df){_0x4747d4(_0x2091df);}_0x3730f6(_0x25faa9);});}function getInteractionTags(_0x108d1d,_0x4efbdb){return new BPromise(function(_0xa5ff39,_0x48c0f6){try{if(_0x108d1d[_0xd5e7('0x36')]){_0x108d1d[_0xd5e7('0x37')]=[];_0x108d1d[_0xd5e7('0x36')]['split'](',')[_0xd5e7('0x38')](function(_0x2ed06d){_0x108d1d[_0xd5e7('0x37')]['push'](_0x4efbdb[_0x2ed06d]);});}delete _0x108d1d[_0xd5e7('0x36')];}catch(_0x5c1959){_0x48c0f6(_0x5c1959);}_0xa5ff39(_0x108d1d);});}function updateFaxInteraction(_0x449019,_0x2b5e03,_0x1d9b93){return new BPromise(function(_0x2c8b72,_0x3d8426){return getInteractionUsers(_0x449019,_0x1d9b93)['then'](function(_0x400d66){return getInteractionTags(_0x400d66,_0x2b5e03);})[_0xd5e7('0x2f')](function(_0x1b0098){return getStateInteraction(_0x1b0098);})['then'](function(_0x33f94c){_0x2c8b72(_0x33f94c);})[_0xd5e7('0x39')](function(_0x4a1a83){_0x3d8426(_0x4a1a83);});});}function getStateInteraction(_0x91f2ac){return new BPromise(function(_0x144af4){_0x91f2ac['waiting']=0x0;_0x91f2ac[_0xd5e7('0x3a')]=0x0;_0x91f2ac[_0xd5e7('0x3b')]=0x0;_0x91f2ac[_0xd5e7('0x3c')]=0x0;_0x91f2ac[_0xd5e7('0x3d')]=0x0;if(!_0x91f2ac[_0xd5e7('0x3e')]&&!_0x91f2ac[_0xd5e7('0x3f')]){_0x91f2ac[_0xd5e7('0x40')]+=0x1;}if(!_0x91f2ac[_0xd5e7('0x3e')]&&_0x91f2ac[_0xd5e7('0x3f')]){_0x91f2ac[_0xd5e7('0x3a')]+=0x1;if(_0x91f2ac[_0xd5e7('0x40')]){_0x91f2ac[_0xd5e7('0x40')]-=0x1;}}if(_0x91f2ac['closed']&&_0x91f2ac['UserId']){_0x91f2ac[_0xd5e7('0x3b')]+=0x1;if(_0x91f2ac['talking']){_0x91f2ac[_0xd5e7('0x3a')]-=0x1;}}if(_0x91f2ac[_0xd5e7('0x3e')]&&!_0x91f2ac[_0xd5e7('0x3f')]){_0x91f2ac[_0xd5e7('0x3c')]+=0x1;if(_0x91f2ac[_0xd5e7('0x40')]){_0x91f2ac[_0xd5e7('0x40')]-=0x1;}}_0x91f2ac[_0xd5e7('0x3d')]+=0x1;_0x144af4(_0x91f2ac);});}exports[_0xd5e7('0x41')]=function(_0x420e67,_0x327062){var _0x2618ec={},_0x7b69b6={},_0x49afd2={'count':0x0,'rows':[]};var _0x27b7a3=_[_0xd5e7('0x35')](db[_0xd5e7('0x42')]['rawAttributes'],function(_0x210e66){return{'name':_0x210e66['fieldName'],'type':_0x210e66[_0xd5e7('0x43')][_0xd5e7('0x44')]};});_0x7b69b6['model']=_[_0xd5e7('0x35')](_0x27b7a3,_0xd5e7('0x32'));_0x7b69b6['query']=_[_0xd5e7('0x45')](_0x420e67[_0xd5e7('0x46')]);_0x7b69b6[_0xd5e7('0x47')]=_[_0xd5e7('0x48')](_0x7b69b6['model'],_0x7b69b6[_0xd5e7('0x46')]);_0x2618ec[_0xd5e7('0x49')]=_[_0xd5e7('0x48')](_0x7b69b6['model'],qs['fields'](_0x420e67[_0xd5e7('0x46')]['fields']));_0x2618ec[_0xd5e7('0x49')]=_0x2618ec[_0xd5e7('0x49')][_0xd5e7('0x4a')]?_0x2618ec[_0xd5e7('0x49')]:_0x7b69b6['model'];if(!_0x420e67[_0xd5e7('0x46')]['hasOwnProperty'](_0xd5e7('0x4b'))){_0x2618ec['limit']=qs[_0xd5e7('0x27')](_0x420e67['query'][_0xd5e7('0x27')]);_0x2618ec['offset']=qs['offset'](_0x420e67[_0xd5e7('0x46')]['offset']);}_0x2618ec[_0xd5e7('0x4c')]=qs[_0xd5e7('0x4d')](_0x420e67[_0xd5e7('0x46')][_0xd5e7('0x4d')]);_0x2618ec['where']=qs[_0xd5e7('0x47')](_[_0xd5e7('0x4e')](_0x420e67[_0xd5e7('0x46')],_0x7b69b6[_0xd5e7('0x47')]),_0x27b7a3);var _0xec5de0=[];var _0x4cf159=squel[_0xd5e7('0x4f')]()[_0xd5e7('0x50')]('id')[_0xd5e7('0x50')](_0xd5e7('0x32'))[_0xd5e7('0x50')](_0xd5e7('0x51'))[_0xd5e7('0x52')]('tools_tags');var _0x1f9c9a=squel[_0xd5e7('0x4f')]()['field']('u.id')['field']('u.fullname')[_0xd5e7('0x50')](_0xd5e7('0x53'))['from']('user_has_fax_interactions','ui')[_0xd5e7('0x54')]('users','u',_0xd5e7('0x55'));var _0x4fdca0=squel[_0xd5e7('0x4f')]()['from'](_0xd5e7('0x56'),'i')[_0xd5e7('0x54')](_0xd5e7('0x57'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xd5e7('0x54')]('users','o',_0xd5e7('0x58'))[_0xd5e7('0x54')](_0xd5e7('0x59'),'a',_0xd5e7('0x5a'))['left_join'](_0xd5e7('0x5b'),'me',_0xd5e7('0x5c'))[_0xd5e7('0x54')](_0xd5e7('0x5d'),'it',_0xd5e7('0x5e'))[_0xd5e7('0x54')](_0xd5e7('0x5f'),'t',_0xd5e7('0x60'));var _0x4e896d=squel[_0xd5e7('0x61')]();var _0x5e28fe=[];var _0x1609b7=squel[_0xd5e7('0x61')]();var _0x536a28;if(_0x420e67[_0xd5e7('0x46')][_0xd5e7('0x62')]){_0x536a28=as['parseSearch'](_0x420e67[_0xd5e7('0x46')][_0xd5e7('0x62')]);var _0x197ed5=_0x536a28['sqlOperator'];for(var _0x2df426=0x0;_0x2df426<_0x536a28['conditions'][_0xd5e7('0x4a')];_0x2df426++){var _0x1449db=_0x536a28['conditions'][_0x2df426];var _0x42d21c='i';var _0x47b5b5=_[_0xd5e7('0x63')](_0x27b7a3,[_0xd5e7('0x32'),_0x1449db[_0xd5e7('0x50')]]);if(!_0x47b5b5){switch(_0x1449db['field']){case _0xd5e7('0x64'):if(_0x1449db[_0xd5e7('0x65')]==0x1){_0x4fdca0[_0xd5e7('0x66')]('`'+_0x1449db['field']+'`\x20=\x200');}else{_0x4fdca0[_0xd5e7('0x66')]('`'+_0x1449db[_0xd5e7('0x50')]+_0xd5e7('0x67'));}break;case _0xd5e7('0x68'):if(_0x1449db[_0xd5e7('0x69')]===_0xd5e7('0x6a')){if(_0x1449db[_0xd5e7('0x65')][_0xd5e7('0x6b')]('\x20')[_0xd5e7('0x4a')]>0x1){_0x4e896d[_0x197ed5](_0xd5e7('0x6c'),qs[_0xd5e7('0x6d')](_0x1449db[_0xd5e7('0x65')]),null);}else{var _0x5b356a='%'+_0x1449db[_0xd5e7('0x65')]+'%';_0x4e896d[_0x197ed5](_0xd5e7('0x6e'),_0x5b356a,_0x5b356a,_0x5b356a);}}else{_0x47b5b5=_[_0xd5e7('0x63')](_0x27b7a3,[_0xd5e7('0x32'),_0xd5e7('0x6f')]);_0x1449db['field']=_0xd5e7('0x6f');_0x3000b7=as[_0xd5e7('0x70')](_0x42d21c,_0x47b5b5[_0xd5e7('0x43')],_0x1449db);_0x4e896d[_0x197ed5](_0x3000b7['text'],_0x3000b7[_0xd5e7('0x65')][_0xd5e7('0x71')],_0x3000b7[_0xd5e7('0x65')][_0xd5e7('0x24')]);}break;case _0xd5e7('0x72'):var _0x281dd4=_0x1449db[_0xd5e7('0x65')]['split'](',')[_0xd5e7('0x35')](function(_0x1476e4){return Number(_0x1476e4);});_0x281dd4[_0xd5e7('0x38')](function(_0x1bab12){_0x1609b7['or'](_0xd5e7('0x73'),'%,'+_0x1bab12+',%');});_0x5e28fe=_['union'](_0x5e28fe,_0x281dd4);break;case'User':if(_0x1449db[_0xd5e7('0x69')]===_0xd5e7('0x6a')){_0x4e896d[_0x197ed5](_0xd5e7('0x74'),'%'+_0x1449db['value']+'%',null);}else{_0x47b5b5=_[_0xd5e7('0x63')](_0x27b7a3,['name',_0xd5e7('0x3f')]);_0x1449db['field']=_0xd5e7('0x3f');_0x3000b7=as['buildExpression'](_0x42d21c,_0x47b5b5[_0xd5e7('0x43')],_0x1449db);_0x4e896d[_0x197ed5](_0x3000b7[_0xd5e7('0x75')],_0x3000b7[_0xd5e7('0x65')][_0xd5e7('0x71')],_0x3000b7[_0xd5e7('0x65')][_0xd5e7('0x24')]);}break;case _0xd5e7('0x76'):_0x3000b7=as[_0xd5e7('0x70')]('me',null,_0x1449db);_0x4e896d[_0x197ed5](_0x3000b7[_0xd5e7('0x75')],_0x3000b7[_0xd5e7('0x65')][_0xd5e7('0x71')],_0x3000b7['value'][_0xd5e7('0x24')]);break;}}else{var _0x3000b7=as[_0xd5e7('0x70')](_0x42d21c,_0x47b5b5[_0xd5e7('0x43')],_0x1449db);_0x4e896d[_0x197ed5](_0x3000b7[_0xd5e7('0x75')],_0x3000b7[_0xd5e7('0x65')][_0xd5e7('0x71')],_0x3000b7[_0xd5e7('0x65')][_0xd5e7('0x24')]);}}}else{var _0x4c05f9=_(_0x420e67[_0xd5e7('0x46')])[_0xd5e7('0x45')]()[_0xd5e7('0x35')](function(_0x4cede7){return _[_0xd5e7('0x77')](_0x27b7a3,[_0xd5e7('0x32'),_0x4cede7])?_0x4cede7:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x4c05f9)){_0x4c05f9[_0xd5e7('0x38')](function(_0x3dd826){if(_0x3dd826===_0xd5e7('0x78')){_0x4fdca0[_0xd5e7('0x79')](_0xd5e7('0x7a'),[]['concat'](_0x420e67[_0xd5e7('0x46')][_0x3dd826]));}else if(_0x3dd826===_0xd5e7('0x7b')){var _0xe7ad4c=JSON[_0xd5e7('0x7c')](_0x420e67[_0xd5e7('0x46')][_0x3dd826])[_0xd5e7('0x7d')];var _0x7854d9=JSON[_0xd5e7('0x7c')](_0x420e67[_0xd5e7('0x46')][_0x3dd826])['$lte'];_0x4fdca0[_0xd5e7('0x79')](_0xd5e7('0x7e'),_0xe7ad4c,_0x7854d9);}else{if(_0x420e67[_0xd5e7('0x46')][_0x3dd826]==='null'){_0x4fdca0[_0xd5e7('0x79')]('i.'+_0x3dd826+_0xd5e7('0x7f'));}else{_0x4fdca0[_0xd5e7('0x79')]('i.'+_0x3dd826+_0xd5e7('0x80'),_0x420e67[_0xd5e7('0x46')][_0x3dd826]);}}});}if(_0x420e67[_0xd5e7('0x46')][_0xd5e7('0x81')]){if(_0x420e67['query']['read']==0x1){_0x4fdca0[_0xd5e7('0x66')](_0xd5e7('0x82'));}else{_0x4fdca0[_0xd5e7('0x66')](_0xd5e7('0x83'));}}if(_0x420e67['query'][_0xd5e7('0x84')]){_0x5e28fe=_[_0xd5e7('0x85')](_0x420e67['query'][_0xd5e7('0x84')])?_0x420e67[_0xd5e7('0x46')][_0xd5e7('0x84')]:new Array(_0x420e67[_0xd5e7('0x46')][_0xd5e7('0x84')]);_0x5e28fe['forEach'](function(_0x3bb5ce){_0x1609b7['or'](_0xd5e7('0x73'),'%,'+_0x3bb5ce+',%');});}if(_0x420e67[_0xd5e7('0x46')][_0xd5e7('0x86')]){var _0x393887=_0x420e67['query']['filter'][_0xd5e7('0x87')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xd5e7('0x88')](_0x393887)){_0x4e896d['or'](_0xd5e7('0x89'),_0x393887+'%')['or']('i.fax\x20LIKE\x20?',_0x393887+'%');}_0x4e896d['or'](_0xd5e7('0x8a'),_0x393887+'%');}}_0x4fdca0[_0xd5e7('0x79')](_0x4e896d);_0x4fdca0[_0xd5e7('0x8b')](_0xd5e7('0x8c'));var _0x9343c6={'type':db['Sequelize'][_0xd5e7('0x8d')][_0xd5e7('0x8e')],'raw':!![]};var _0x29276c=_0x4fdca0[_0xd5e7('0x8f')]();_0x29276c[_0xd5e7('0x50')](_0xd5e7('0x8c'));_0x29276c[_0xd5e7('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd5e7('0x64'));if(_0x2618ec[_0xd5e7('0x4c')]){_0x2618ec[_0xd5e7('0x4c')][_0xd5e7('0x38')](function(_0x4e363e){var _0x35e94a=_0x4e363e[0x0]===_0xd5e7('0x90')?_0x4e363e[0x0]:'i.'+_0x4e363e[0x0];_0x4fdca0[_0xd5e7('0x4c')](_0x35e94a,_0x4e363e[0x1]==='DESC'?![]:!![]);});}if(!_[_0xd5e7('0x91')](_0x5e28fe)){_0x4fdca0[_0xd5e7('0x66')](_0x1609b7);_0x29276c['where']('t.id\x20IN\x20?',_0x5e28fe);}BPromise[_0xd5e7('0x92')]()['then'](function(){if(!_0x536a28){if(_0x420e67[_0xd5e7('0x46')][_0xd5e7('0x78')])return;_0x29276c[_0xd5e7('0x79')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x4fdca0['where'](_0xd5e7('0x93'));return;}if(_0x420e67[_0xd5e7('0x94')][_0xd5e7('0x95')]!==_0xd5e7('0x96'))return;return _0x420e67[_0xd5e7('0x94')][_0xd5e7('0x97')]({'attributes':['id'],'raw':!![]})[_0xd5e7('0x2f')](function(_0x257db8){if(_['isEmpty'](_0x257db8)){_0x29276c['where']('i.FaxAccountId\x20IS\x20NULL');_0x4fdca0['where'](_0xd5e7('0x98'));}else{_0x29276c['where'](_0xd5e7('0x7a'),_[_0xd5e7('0x35')](_0x257db8,'id'));_0x4fdca0[_0xd5e7('0x79')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x257db8,'id'));}});})['then'](function(){if(_0x420e67[_0xd5e7('0x94')][_0xd5e7('0x95')]===_0xd5e7('0x96')&&!_0x536a28&&!_0x420e67[_0xd5e7('0x46')][_0xd5e7('0x78')])return[];return db[_0xd5e7('0x99')]['query'](_0x29276c[_0xd5e7('0x9a')](),_0x9343c6);})['then'](function(_0x458b41){_0x49afd2[_0xd5e7('0x28')]=_0x458b41[_0xd5e7('0x4a')];if(_0x49afd2['count']===0x0)return[];return db[_0xd5e7('0x99')][_0xd5e7('0x46')](_0x4cf159[_0xd5e7('0x9a')](),_0x9343c6)['then'](function(_0x16fc67){_0xec5de0=_[_0xd5e7('0x9b')](_0x16fc67,'id');_0x9343c6=_[_0xd5e7('0x9c')](_0x9343c6,{'model':db[_0xd5e7('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x420e67[_0xd5e7('0x46')]['fields']){_0x2618ec[_0xd5e7('0x49')][_0xd5e7('0x38')](function(_0x54ac30){_0x4fdca0[_0xd5e7('0x50')]('i.'+_0x54ac30);});}else{_0x4fdca0[_0xd5e7('0x50')](_0xd5e7('0x9d'),_0xd5e7('0x64'));_0x4fdca0['field'](_0xd5e7('0x9e'),'Account.key');_0x4fdca0['field'](_0xd5e7('0x9f'),_0xd5e7('0xa0'));_0x4fdca0[_0xd5e7('0x50')](_0xd5e7('0xa1'),_0xd5e7('0x90'));_0x4fdca0['field'](_0xd5e7('0xa2'));_0x4fdca0[_0xd5e7('0x50')](_0xd5e7('0xa3'),'Contact.firstName');_0x4fdca0[_0xd5e7('0x50')](_0xd5e7('0xa4'),'Contact.lastName');_0x4fdca0[_0xd5e7('0x50')](_0xd5e7('0xa5'),_0xd5e7('0xa6'));_0x4fdca0[_0xd5e7('0x50')](_0xd5e7('0xa7'),_0xd5e7('0xa8'));_0x4fdca0[_0xd5e7('0x50')](_0xd5e7('0xa9'),_0xd5e7('0xaa'));_0x4fdca0['field'](_0xd5e7('0xab'),_0xd5e7('0xac'));_0x4fdca0[_0xd5e7('0x50')](_0xd5e7('0xad'),_0xd5e7('0xae'));_0x4fdca0[_0xd5e7('0x50')](_0xd5e7('0xaf'),_0xd5e7('0xb0'));_0x4fdca0[_0xd5e7('0x50')](_0xd5e7('0xb1'),'TagIds');}if(_0x2618ec[_0xd5e7('0x27')])_0x4fdca0[_0xd5e7('0x27')](_0x2618ec[_0xd5e7('0x27')]);if(_0x2618ec[_0xd5e7('0x25')])_0x4fdca0[_0xd5e7('0x25')](_0x2618ec[_0xd5e7('0x25')]);return db[_0xd5e7('0x99')]['query'](_0x4fdca0['toString'](),_0x9343c6);})[_0xd5e7('0x2f')](function(_0x506d48){if(_0x506d48['length']>0x0)_0x1f9c9a['where'](_0xd5e7('0xb2'),_[_0xd5e7('0x35')](_0x506d48,'id'));return db[_0xd5e7('0x99')][_0xd5e7('0x46')](_0x1f9c9a[_0xd5e7('0x9a')](),_0x9343c6)['then'](function(_0x5dd928){var _0x57526a=_[_0xd5e7('0xb3')](_0x5dd928,_0xd5e7('0xb4'));var _0x49d7b1=[];_0x506d48[_0xd5e7('0x38')](function(_0x51525e){_0x49d7b1['push'](updateFaxInteraction(_0x51525e,_0xec5de0,_0x57526a));});return BPromise[_0xd5e7('0xb5')](_0x49d7b1);});});})['then'](function(_0x1fd4c0){_0x49afd2[_0xd5e7('0xb6')]=_0x1fd4c0;return _0x49afd2;})[_0xd5e7('0x2f')](respondWithFilteredResult(_0x327062,_0x2618ec))[_0xd5e7('0x39')](handleError(_0x327062,null));};exports[_0xd5e7('0xb7')]=function(_0x5d8e30,_0x6983ec){var _0x3f0df5={'raw':![],'where':{'id':_0x5d8e30[_0xd5e7('0xb8')]['id']}},_0x5572c6={};_0x5572c6[_0xd5e7('0xb9')]=_['keys'](db['FaxInteraction'][_0xd5e7('0xba')]);_0x5572c6['query']=_[_0xd5e7('0x45')](_0x5d8e30[_0xd5e7('0x46')]);_0x5572c6[_0xd5e7('0x47')]=_[_0xd5e7('0x48')](_0x5572c6[_0xd5e7('0xb9')],_0x5572c6[_0xd5e7('0x46')]);_0x3f0df5[_0xd5e7('0x49')]=_[_0xd5e7('0x48')](_0x5572c6[_0xd5e7('0xb9')],qs[_0xd5e7('0xbb')](_0x5d8e30[_0xd5e7('0x46')][_0xd5e7('0xbb')]));_0x3f0df5[_0xd5e7('0x49')]=_0x3f0df5[_0xd5e7('0x49')][_0xd5e7('0x4a')]?_0x3f0df5[_0xd5e7('0x49')]:_0x5572c6[_0xd5e7('0xb9')];if(_0x5d8e30[_0xd5e7('0x46')][_0xd5e7('0xbc')]){_0x3f0df5[_0xd5e7('0xbd')]=[{'all':!![]}];}_0x3f0df5=_[_0xd5e7('0x9c')]({},_0x3f0df5,_0x5d8e30['options']);return db[_0xd5e7('0x42')]['find'](_0x3f0df5)[_0xd5e7('0x2f')](handleEntityNotFound(_0x6983ec,null))[_0xd5e7('0x2f')](respondWithResult(_0x6983ec,null))['catch'](handleError(_0x6983ec,null));};exports[_0xd5e7('0xbe')]=function(_0x20f4dc,_0x500c10){return db[_0xd5e7('0x42')][_0xd5e7('0xbe')](_0x20f4dc[_0xd5e7('0x76')],{})['then'](respondWithResult(_0x500c10,0xc9))[_0xd5e7('0x39')](handleError(_0x500c10,null));};exports[_0xd5e7('0x2e')]=function(_0x3159bc,_0x513839){if(_0x3159bc[_0xd5e7('0x76')]['id']){delete _0x3159bc[_0xd5e7('0x76')]['id'];}return db['FaxInteraction'][_0xd5e7('0x63')]({'where':{'id':_0x3159bc['params']['id']}})['then'](handleEntityNotFound(_0x513839,null))[_0xd5e7('0x2f')](saveUpdates(_0x3159bc[_0xd5e7('0x76')],null))['then'](respondWithResult(_0x513839,null))[_0xd5e7('0x39')](handleError(_0x513839,null));};exports[_0xd5e7('0x30')]=function(_0x2b4193,_0x5a1eef){return db[_0xd5e7('0x42')][_0xd5e7('0x63')]({'where':{'id':_0x2b4193[_0xd5e7('0xb8')]['id']}})[_0xd5e7('0x2f')](handleEntityNotFound(_0x5a1eef,null))[_0xd5e7('0x2f')](removeEntity(_0x5a1eef,null))[_0xd5e7('0x39')](handleError(_0x5a1eef,null));};exports[_0xd5e7('0xbf')]=function(_0x458d02,_0x43e6ab){return db[_0xd5e7('0x42')][_0xd5e7('0xbf')]()[_0xd5e7('0x2f')](respondWithResult(_0x43e6ab,null))[_0xd5e7('0x39')](handleError(_0x43e6ab,null));};exports[_0xd5e7('0xc0')]=function(_0x2f159d,_0x400669,_0x423280){return db['FaxMessage'][_0xd5e7('0x63')]({'where':{'id':_0x2f159d[_0xd5e7('0xb8')]['id']}})['then'](handleEntityNotFound(_0x400669,null))['then'](function(_0x39b914){if(_0x39b914){return _0x39b914[_0xd5e7('0xc0')](_0x2f159d[_0xd5e7('0x76')][_0xd5e7('0xc1')],_[_0xd5e7('0xc2')](_0x2f159d['body'],[_0xd5e7('0xc1'),'id'])||{});}})[_0xd5e7('0x2f')](respondWithResult(_0x400669,null))[_0xd5e7('0x39')](handleError(_0x400669,null));};exports['getMessages']=function(_0xf03072,_0x22ba08,_0x4f01d2){var _0x5cdc2b={'raw':![],'where':{}};var _0x4e64ea={};var _0x287501={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xd5e7('0xc3')]({'where':{'id':_0xf03072['params']['id']}})[_0xd5e7('0x2f')](handleEntityNotFound(_0x22ba08,null))['then'](function(_0x3397a9){if(_0x3397a9){_0x4e64ea[_0xd5e7('0xb9')]=_[_0xd5e7('0x45')](db[_0xd5e7('0xc4')][_0xd5e7('0xba')]);_0x4e64ea[_0xd5e7('0x46')]=_['keys'](_0xf03072[_0xd5e7('0x46')]);_0x4e64ea[_0xd5e7('0x47')]=_[_0xd5e7('0x48')](_0x4e64ea['model'],_0x4e64ea['query']);_0x5cdc2b[_0xd5e7('0x49')]=_[_0xd5e7('0x48')](_0x4e64ea[_0xd5e7('0xb9')],qs[_0xd5e7('0xbb')](_0xf03072[_0xd5e7('0x46')]['fields']));_0x5cdc2b[_0xd5e7('0x49')]=_0x5cdc2b[_0xd5e7('0x49')]['length']?_0x5cdc2b[_0xd5e7('0x49')]:_0x4e64ea[_0xd5e7('0xb9')];if(!_0xf03072['query'][_0xd5e7('0xc5')]('nolimit')){_0x5cdc2b['limit']=qs[_0xd5e7('0x27')](_0xf03072[_0xd5e7('0x46')][_0xd5e7('0x27')]);_0x5cdc2b[_0xd5e7('0x25')]=qs['offset'](_0xf03072[_0xd5e7('0x46')][_0xd5e7('0x25')]);}_0x5cdc2b[_0xd5e7('0x4c')]=qs[_0xd5e7('0x4d')](_0xf03072[_0xd5e7('0x46')][_0xd5e7('0x4d')]);_0x5cdc2b[_0xd5e7('0x79')]=qs[_0xd5e7('0x47')](_[_0xd5e7('0x4e')](_0xf03072['query'],_0x4e64ea[_0xd5e7('0x47')]));_0x5cdc2b[_0xd5e7('0x79')][_0xd5e7('0xb4')]=_0x3397a9['id'];if(_0xf03072[_0xd5e7('0x46')][_0xd5e7('0x86')]){_0x5cdc2b['where']=_[_0xd5e7('0x9c')](_0x5cdc2b['where'],{'$or':_['map'](_0x5cdc2b[_0xd5e7('0x49')],function(_0x5f5c4a){var _0x36ce43={};_0x36ce43[_0x5f5c4a]={'$like':'%'+_0xf03072['query'][_0xd5e7('0x86')]+'%'};return _0x36ce43;})});}if(_0xf03072[_0xd5e7('0x46')][_0xd5e7('0x7d')]){var _0x13f1cb=_0xf03072['query'][_0xd5e7('0x7d')][_0xd5e7('0x6b')](',');var _0x342d6b={};_0x342d6b[_0x13f1cb[0x0]]={'$gte':moment(_0x13f1cb[0x1])[_0xd5e7('0xc6')](_0xd5e7('0xc7'))};_0x5cdc2b['where']=_[_0xd5e7('0x9c')](_0x5cdc2b[_0xd5e7('0x79')],_0x342d6b);}_0x5cdc2b=_['merge']({},_0x5cdc2b,_0xf03072[_0xd5e7('0xc8')]);return db[_0xd5e7('0xc4')]['count']({'where':_0x5cdc2b['where']})[_0xd5e7('0x2f')](function(_0x22a895){_0x287501[_0xd5e7('0x28')]=_0x22a895;if(_0xf03072[_0xd5e7('0x46')][_0xd5e7('0xbc')]){_0x5cdc2b[_0xd5e7('0xbd')]=[{'all':!![]}];}return db[_0xd5e7('0xc4')][_0xd5e7('0xc9')](_0x5cdc2b);})[_0xd5e7('0x2f')](function(_0x385091){_0x287501['rows']=_0x385091;return _0x287501;});}})['then'](respondWithFilteredResult(_0x22ba08,_0x5cdc2b))['catch'](handleError(_0x22ba08,null));};exports[_0xd5e7('0xca')]=function(_0x4eae83,_0x37fcf3,_0x153489){return db[_0xd5e7('0x42')][_0xd5e7('0x63')]({'where':{'id':_0x4eae83['params']['id']}})['then'](handleEntityNotFound(_0x37fcf3,null))[_0xd5e7('0x2f')](function(_0x3b1e11){if(_0x3b1e11){return _0x3b1e11[_0xd5e7('0xcb')](_0x4eae83[_0xd5e7('0x76')]['ids'],_[_0xd5e7('0xc2')](_0x4eae83[_0xd5e7('0x76')],[_0xd5e7('0xc1'),'id'])||{})['spread'](function(){return db[_0xd5e7('0x72')]['findAll']({'attributes':['id',_0xd5e7('0x32'),_0xd5e7('0x51')],'where':{'id':_0x4eae83['body']['ids']}});})['then'](function(_0x3d7bf5){socket['emit'](_0xd5e7('0xcc'),{'id':Number(_0x4eae83[_0xd5e7('0xb8')]['id']),'tags':_0x3d7bf5||[]});return{'id':Number(_0x4eae83[_0xd5e7('0xb8')]['id']),'tags':_0x3d7bf5||[]};});}})['then'](respondWithResult(_0x37fcf3,null))['catch'](handleError(_0x37fcf3,null));};exports[_0xd5e7('0xcd')]=function(_0x3f43f4,_0x18ac4d,_0x45ad49){return db['FaxInteraction'][_0xd5e7('0x63')]({'where':{'id':_0x3f43f4[_0xd5e7('0xb8')]['id']}})[_0xd5e7('0x2f')](handleEntityNotFound(_0x18ac4d,null))[_0xd5e7('0x2f')](function(_0x50528b){if(_0x50528b){return _0x50528b['removeTags'](_0x3f43f4[_0xd5e7('0x46')][_0xd5e7('0xc1')]);}})['then'](respondWithStatusCode(_0x18ac4d,null))[_0xd5e7('0x39')](handleError(_0x18ac4d,null));};exports[_0xd5e7('0xce')]=function(_0x187292,_0x2b8872){var _0x7a6b6e=moment()[_0xd5e7('0xcf')]()[_0xd5e7('0x9a')]();var _0x2c062e=path[_0xd5e7('0xd0')](config[_0xd5e7('0xd1')],'server',_0xd5e7('0xd2'),'tmp');var _0x3109c3=path[_0xd5e7('0xd0')](config[_0xd5e7('0xd1')],_0xd5e7('0xd3'),_0xd5e7('0xd2'),_0xd5e7('0xd4'));var _0x4ec91f=path[_0xd5e7('0xd0')](_0x2c062e,_0x7a6b6e);var _0x4c0ca4=util['format'](_0xd5e7('0xd5'),_0x187292['params']['id'],_0x7a6b6e);var _0x1a64a7=path[_0xd5e7('0xd0')](_0x2c062e,_0x4c0ca4);var _0x2ef542=[];_0x2ef542[_0xd5e7('0xd6')]({'model':db[_0xd5e7('0xd7')],'as':_0xd5e7('0xd7'),'raw':!![]});var _0x124589=[{'model':db[_0xd5e7('0xc4')],'as':_0xd5e7('0xd8'),'attributes':['id',_0xd5e7('0x76'),_0xd5e7('0x7b')],'include':_0x2ef542}];return db[_0xd5e7('0x42')]['find']({'where':{'id':_0x187292[_0xd5e7('0xb8')]['id']},'include':_0x124589})[_0xd5e7('0x2f')](handleEntityNotFound(_0x2b8872,null))[_0xd5e7('0x2f')](function(_0x10eebf){if(_0x10eebf&&_0x10eebf[_0xd5e7('0xd8')]){var _0x397ede=_0x10eebf[_0xd5e7('0xd9')]({'plain':!![]});fs[_0xd5e7('0xda')](_0x4ec91f);for(var _0x52ade4=0x0;_0x52ade4<_0x397ede['Messages'][_0xd5e7('0x4a')];_0x52ade4++){var _0x9d5f5d=_0x397ede['Messages'][_0x52ade4][_0xd5e7('0xd7')];if(_0x9d5f5d){var _0x567125=path['join'](_0x3109c3,_0x9d5f5d[_0xd5e7('0xdb')]);if(fs[_0xd5e7('0xdc')](_0x567125)){fs['createReadStream'](_0x567125)[_0xd5e7('0xdd')](fs['createWriteStream'](path[_0xd5e7('0xd0')](_0x4ec91f,_0x9d5f5d[_0xd5e7('0xdb')])));}}}return BPromise[_0xd5e7('0x92')]()[_0xd5e7('0x2f')](function(){return new BPromise(function(_0x528170,_0x132076){zipdir(_0x4ec91f,{'saveTo':_0x1a64a7},function(_0xfc422f,_0x656619){if(_0xfc422f)return _0x132076(_0xfc422f);return _0x528170(_0x656619);});})[_0xd5e7('0x2f')](function(){return new BPromise(function(_0x58a9db,_0x36be2c){rimraf(_0x4ec91f,function(_0x486bba){if(_0x486bba)_0x36be2c(_0x486bba);return _0x58a9db();});});})[_0xd5e7('0x2f')](function(){return _0x2b8872[_0xd5e7('0xce')](_0x1a64a7,_0x4c0ca4,function(_0x3c72fd){if(_0x3c72fd){console['log']('err',_0x3c72fd);}else{fs[_0xd5e7('0xde')](_0x1a64a7);}});});});}else{return _0x2b8872[_0xd5e7('0x22')](0xc8);}})['catch'](handleError(_0x2b8872,null));}; \ No newline at end of file +var _0xc542=['UserId','FaxInteraction','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','select','field','from','ui.FaxInteractionId','user_has_fax_interactions','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','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','compact','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','all','rows','show','rawAttributes','include','create','params','describe','addMessage','FaxMessage','ids','omit','findOne','filters','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','spread','color','emit','removeTags','download','unix','join','server','tmp','root','attachments','Attachment','Messages','get','mkdirSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','Users','map','fullname','TagIds','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0xc542,0x9e));var _0x2c54=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xc542[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require(_0x2c54('0x0'));var rimraf=require(_0x2c54('0x1'));var zipdir=require(_0x2c54('0x2'));var jsonpatch=require(_0x2c54('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2c54('0x4'));var Mustache=require(_0x2c54('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2c54('0x6'));var csv=require(_0x2c54('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c54('0x8'));var _=require(_0x2c54('0x9'));var squel=require('squel');var crypto=require(_0x2c54('0xa'));var jsforce=require(_0x2c54('0xb'));var deskjs=require(_0x2c54('0xc'));var toCsv=require(_0x2c54('0x7'));var querystring=require(_0x2c54('0xd'));var Papa=require(_0x2c54('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2c54('0xf'));var hardwareService=require(_0x2c54('0x10'));var logger=require(_0x2c54('0x11'))(_0x2c54('0x12'));var utils=require('../../config/utils');var config=require(_0x2c54('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c54('0x14'))['db'];config['redis']=_[_0x2c54('0x15')](config[_0x2c54('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxInteraction.socket')[_0x2c54('0x17')](socket);function respondWithStatusCode(_0x498a8f,_0x1d9664){_0x1d9664=_0x1d9664||0xcc;return function(_0x1d8ab8){if(_0x1d8ab8){return _0x498a8f[_0x2c54('0x18')](_0x1d9664);}return _0x498a8f[_0x2c54('0x19')](_0x1d9664)[_0x2c54('0x1a')]();};}function respondWithResult(_0x472de4,_0x1ef8e0){_0x1ef8e0=_0x1ef8e0||0xc8;return function(_0x3bad36){if(_0x3bad36){return _0x472de4['status'](_0x1ef8e0)[_0x2c54('0x1b')](_0x3bad36);}};}function respondWithFilteredResult(_0x1f6f4d,_0x1b8bae){return function(_0x390efc){if(_0x390efc){var _0x41977a=typeof _0x1b8bae[_0x2c54('0x1c')]===_0x2c54('0x1d')&&typeof _0x1b8bae[_0x2c54('0x1e')]===_0x2c54('0x1d');var _0x2a004e=_0x390efc[_0x2c54('0x1f')];var _0x17a6f3=_0x41977a?0x0:_0x1b8bae[_0x2c54('0x1c')];var _0x498023=_0x41977a?_0x390efc['count']:_0x1b8bae[_0x2c54('0x1c')]+_0x1b8bae[_0x2c54('0x1e')];var _0x131e4d;if(_0x498023>=_0x2a004e){_0x498023=_0x2a004e;_0x131e4d=0xc8;}else{_0x131e4d=0xce;}_0x1f6f4d[_0x2c54('0x19')](_0x131e4d);return _0x1f6f4d['set'](_0x2c54('0x20'),_0x17a6f3+'-'+_0x498023+'/'+_0x2a004e)[_0x2c54('0x1b')](_0x390efc);}return null;};}function patchUpdates(_0x3dcd33){return function(_0x21860b){try{jsonpatch[_0x2c54('0x21')](_0x21860b,_0x3dcd33,!![]);}catch(_0x3b6175){return BPromise[_0x2c54('0x22')](_0x3b6175);}return _0x21860b[_0x2c54('0x23')]();};}function saveUpdates(_0x1c4186,_0x436bd2){return function(_0x329f55){if(_0x329f55){return _0x329f55[_0x2c54('0x24')](_0x1c4186)[_0x2c54('0x25')](function(_0x2793b5){return _0x2793b5;});}return null;};}function removeEntity(_0x4ea5e9,_0x50159a){return function(_0x2e7c17){if(_0x2e7c17){return _0x2e7c17[_0x2c54('0x26')]()[_0x2c54('0x25')](function(){_0x4ea5e9['status'](0xcc)[_0x2c54('0x1a')]();});}};}function handleEntityNotFound(_0x5b4cbc,_0x34d80b){return function(_0x156084){if(!_0x156084){_0x5b4cbc[_0x2c54('0x18')](0x194);}return _0x156084;};}function handleError(_0x5a9fa1,_0x3c14c7){_0x3c14c7=_0x3c14c7||0x1f4;return function(_0x10af1b){logger[_0x2c54('0x27')](_0x10af1b[_0x2c54('0x28')]);if(_0x10af1b[_0x2c54('0x29')]){delete _0x10af1b[_0x2c54('0x29')];}_0x5a9fa1[_0x2c54('0x19')](_0x3c14c7)['send'](_0x10af1b);};}function getInteractionUsers(_0x5f2d81,_0x5070ba){return new BPromise(function(_0x44f5e0,_0x514933){try{if(_0x5070ba[_0x5f2d81['id']]){_0x5f2d81[_0x2c54('0x2a')]=_[_0x2c54('0x2b')](_0x5070ba[_0x5f2d81['id']],function(_0x3acaa2){return{'id':_0x3acaa2['id'],'fullname':_0x3acaa2[_0x2c54('0x2c')]};});}}catch(_0x18a828){_0x514933(_0x18a828);}_0x44f5e0(_0x5f2d81);});}function getInteractionTags(_0x11f0cc,_0xdad88){return new BPromise(function(_0x4cb4de,_0x4f2c74){try{if(_0x11f0cc[_0x2c54('0x2d')]){_0x11f0cc['Tags']=[];_0x11f0cc[_0x2c54('0x2d')][_0x2c54('0x2e')](',')[_0x2c54('0x2f')](function(_0x5693b7){_0x11f0cc['Tags'][_0x2c54('0x30')](_0xdad88[_0x5693b7]);});}delete _0x11f0cc['TagIds'];}catch(_0xa26c49){_0x4f2c74(_0xa26c49);}_0x4cb4de(_0x11f0cc);});}function updateFaxInteraction(_0x1eaa85,_0x4e580a,_0x4b3ed1){return new BPromise(function(_0x3cc9b6,_0x4fed0c){return getInteractionUsers(_0x1eaa85,_0x4b3ed1)[_0x2c54('0x25')](function(_0x127e7e){return getInteractionTags(_0x127e7e,_0x4e580a);})[_0x2c54('0x25')](function(_0x55f7b3){return getStateInteraction(_0x55f7b3);})['then'](function(_0x5dd653){_0x3cc9b6(_0x5dd653);})[_0x2c54('0x31')](function(_0x210b0e){_0x4fed0c(_0x210b0e);});});}function getStateInteraction(_0x353735){return new BPromise(function(_0xc0a975){_0x353735[_0x2c54('0x32')]=0x0;_0x353735[_0x2c54('0x33')]=0x0;_0x353735[_0x2c54('0x34')]=0x0;_0x353735[_0x2c54('0x35')]=0x0;_0x353735[_0x2c54('0x36')]=0x0;if(!_0x353735[_0x2c54('0x37')]&&!_0x353735[_0x2c54('0x38')]){_0x353735[_0x2c54('0x32')]+=0x1;}if(!_0x353735[_0x2c54('0x37')]&&_0x353735[_0x2c54('0x38')]){_0x353735[_0x2c54('0x33')]+=0x1;if(_0x353735[_0x2c54('0x32')]){_0x353735['waiting']-=0x1;}}if(_0x353735['closed']&&_0x353735[_0x2c54('0x38')]){_0x353735[_0x2c54('0x34')]+=0x1;if(_0x353735['talking']){_0x353735[_0x2c54('0x33')]-=0x1;}}if(_0x353735[_0x2c54('0x37')]&&!_0x353735[_0x2c54('0x38')]){_0x353735[_0x2c54('0x35')]+=0x1;if(_0x353735[_0x2c54('0x32')]){_0x353735[_0x2c54('0x32')]-=0x1;}}_0x353735[_0x2c54('0x36')]+=0x1;_0xc0a975(_0x353735);});}exports['index']=function(_0x5c3b14,_0x4865c7){var _0x4509b6={},_0xacbba7={},_0x519034={'count':0x0,'rows':[]};var _0x3eef61=_[_0x2c54('0x2b')](db[_0x2c54('0x39')]['rawAttributes'],function(_0x265338){return{'name':_0x265338[_0x2c54('0x3a')],'type':_0x265338[_0x2c54('0x3b')][_0x2c54('0x3c')]};});_0xacbba7['model']=_[_0x2c54('0x2b')](_0x3eef61,_0x2c54('0x29'));_0xacbba7[_0x2c54('0x3d')]=_[_0x2c54('0x3e')](_0x5c3b14[_0x2c54('0x3d')]);_0xacbba7['filters']=_[_0x2c54('0x3f')](_0xacbba7[_0x2c54('0x40')],_0xacbba7['query']);_0x4509b6[_0x2c54('0x41')]=_[_0x2c54('0x3f')](_0xacbba7[_0x2c54('0x40')],qs[_0x2c54('0x42')](_0x5c3b14[_0x2c54('0x3d')][_0x2c54('0x42')]));_0x4509b6[_0x2c54('0x41')]=_0x4509b6['attributes'][_0x2c54('0x43')]?_0x4509b6['attributes']:_0xacbba7[_0x2c54('0x40')];if(!_0x5c3b14[_0x2c54('0x3d')][_0x2c54('0x44')](_0x2c54('0x45'))){_0x4509b6[_0x2c54('0x1e')]=qs['limit'](_0x5c3b14[_0x2c54('0x3d')][_0x2c54('0x1e')]);_0x4509b6[_0x2c54('0x1c')]=qs['offset'](_0x5c3b14[_0x2c54('0x3d')][_0x2c54('0x1c')]);}_0x4509b6[_0x2c54('0x46')]=qs[_0x2c54('0x47')](_0x5c3b14[_0x2c54('0x3d')]['sort']);_0x4509b6['where']=qs['filters'](_[_0x2c54('0x48')](_0x5c3b14['query'],_0xacbba7['filters']),_0x3eef61);var _0x3355e4=[];var _0x4d1823=squel[_0x2c54('0x49')]()[_0x2c54('0x4a')]('id')['field'](_0x2c54('0x29'))[_0x2c54('0x4a')]('color')[_0x2c54('0x4b')]('tools_tags');var _0x366d42=squel[_0x2c54('0x49')]()[_0x2c54('0x4a')]('u.id')['field']('u.fullname')['field'](_0x2c54('0x4c'))[_0x2c54('0x4b')](_0x2c54('0x4d'),'ui')['left_join'](_0x2c54('0x4e'),'u',_0x2c54('0x4f'));var _0x3179e5=squel[_0x2c54('0x49')]()[_0x2c54('0x4b')]('fax_interactions','i')['left_join'](_0x2c54('0x50'),'c',_0x2c54('0x51'))[_0x2c54('0x52')](_0x2c54('0x4e'),'o',_0x2c54('0x53'))[_0x2c54('0x52')](_0x2c54('0x54'),'a',_0x2c54('0x55'))[_0x2c54('0x52')](_0x2c54('0x56'),'me',_0x2c54('0x57'))['left_join'](_0x2c54('0x58'),'it',_0x2c54('0x59'))[_0x2c54('0x52')](_0x2c54('0x5a'),'t',_0x2c54('0x5b'));var _0x4586c3=squel[_0x2c54('0x5c')]();var _0x3135b2=[];var _0x4bc5ce=squel[_0x2c54('0x5c')]();var _0x1b5cdf;if(_0x5c3b14['query']['search']){_0x1b5cdf=as['parseSearch'](_0x5c3b14['query'][_0x2c54('0x5d')]);var _0x765c3d=_0x1b5cdf['sqlOperator'];for(var _0x542f4b=0x0;_0x542f4b<_0x1b5cdf['conditions'][_0x2c54('0x43')];_0x542f4b++){var _0x8bb2a1=_0x1b5cdf[_0x2c54('0x5e')][_0x542f4b];var _0x53c068='i';var _0xa2e5c2=_['find'](_0x3eef61,[_0x2c54('0x29'),_0x8bb2a1[_0x2c54('0x4a')]]);if(!_0xa2e5c2){switch(_0x8bb2a1[_0x2c54('0x4a')]){case'unreadMessages':if(_0x8bb2a1[_0x2c54('0x5f')]==0x1){_0x3179e5[_0x2c54('0x60')]('`'+_0x8bb2a1[_0x2c54('0x4a')]+_0x2c54('0x61'));}else{_0x3179e5['having']('`'+_0x8bb2a1[_0x2c54('0x4a')]+_0x2c54('0x62'));}break;case _0x2c54('0x63'):if(_0x8bb2a1[_0x2c54('0x64')]===_0x2c54('0x65')){if(_0x8bb2a1[_0x2c54('0x5f')]['split']('\x20')[_0x2c54('0x43')]>0x1){_0x4586c3[_0x765c3d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2c54('0x66')](_0x8bb2a1['value']),null);}else{var _0x1d2e8c='%'+_0x8bb2a1[_0x2c54('0x5f')]+'%';_0x4586c3[_0x765c3d](_0x2c54('0x67'),_0x1d2e8c,_0x1d2e8c,_0x1d2e8c);}}else{_0xa2e5c2=_[_0x2c54('0x68')](_0x3eef61,[_0x2c54('0x29'),'ContactId']);_0x8bb2a1[_0x2c54('0x4a')]=_0x2c54('0x69');_0x44a629=as[_0x2c54('0x6a')](_0x53c068,_0xa2e5c2['type'],_0x8bb2a1);_0x4586c3[_0x765c3d](_0x44a629['text'],_0x44a629[_0x2c54('0x5f')][_0x2c54('0x6b')],_0x44a629['value']['end']);}break;case'Tag':var _0x434dc9=_0x8bb2a1[_0x2c54('0x5f')][_0x2c54('0x2e')](',')['map'](function(_0x357ef5){return Number(_0x357ef5);});_0x434dc9[_0x2c54('0x2f')](function(_0x6eea0e){_0x4bc5ce['or'](_0x2c54('0x6c'),'%,'+_0x6eea0e+',%');});_0x3135b2=_[_0x2c54('0x6d')](_0x3135b2,_0x434dc9);break;case _0x2c54('0x6e'):if(_0x8bb2a1[_0x2c54('0x64')]==='$substring'){_0x4586c3[_0x765c3d](_0x2c54('0x6f'),'%'+_0x8bb2a1[_0x2c54('0x5f')]+'%',null);}else{_0xa2e5c2=_['find'](_0x3eef61,['name',_0x2c54('0x38')]);_0x8bb2a1[_0x2c54('0x4a')]=_0x2c54('0x38');_0x44a629=as[_0x2c54('0x6a')](_0x53c068,_0xa2e5c2[_0x2c54('0x3b')],_0x8bb2a1);_0x4586c3[_0x765c3d](_0x44a629[_0x2c54('0x70')],_0x44a629[_0x2c54('0x5f')][_0x2c54('0x6b')],_0x44a629['value'][_0x2c54('0x1a')]);}break;case _0x2c54('0x71'):_0x44a629=as[_0x2c54('0x6a')]('me',null,_0x8bb2a1);_0x4586c3[_0x765c3d](_0x44a629['text'],_0x44a629[_0x2c54('0x5f')][_0x2c54('0x6b')],_0x44a629[_0x2c54('0x5f')][_0x2c54('0x1a')]);break;}}else{var _0x44a629=as[_0x2c54('0x6a')](_0x53c068,_0xa2e5c2[_0x2c54('0x3b')],_0x8bb2a1);_0x4586c3[_0x765c3d](_0x44a629[_0x2c54('0x70')],_0x44a629[_0x2c54('0x5f')][_0x2c54('0x6b')],_0x44a629[_0x2c54('0x5f')][_0x2c54('0x1a')]);}}}else{var _0x1dab00=_(_0x5c3b14[_0x2c54('0x3d')])[_0x2c54('0x3e')]()['map'](function(_0x36a358){return _[_0x2c54('0x72')](_0x3eef61,[_0x2c54('0x29'),_0x36a358])?_0x36a358:undefined;})[_0x2c54('0x73')]()[_0x2c54('0x5f')]();if(!_['isEmpty'](_0x1dab00)){_0x1dab00[_0x2c54('0x2f')](function(_0x5d27e1){if(_0x5d27e1===_0x2c54('0x74')){_0x3179e5['where'](_0x2c54('0x75'),[][_0x2c54('0x76')](_0x5c3b14[_0x2c54('0x3d')][_0x5d27e1]));}else if(_0x5d27e1===_0x2c54('0x77')){var _0x470e25=JSON[_0x2c54('0x78')](_0x5c3b14[_0x2c54('0x3d')][_0x5d27e1])[_0x2c54('0x79')];var _0x47cf5c=JSON[_0x2c54('0x78')](_0x5c3b14['query'][_0x5d27e1])[_0x2c54('0x7a')];_0x3179e5[_0x2c54('0x7b')](_0x2c54('0x7c'),_0x470e25,_0x47cf5c);}else{if(_0x5c3b14[_0x2c54('0x3d')][_0x5d27e1]===_0x2c54('0x7d')){_0x3179e5[_0x2c54('0x7b')]('i.'+_0x5d27e1+_0x2c54('0x7e'));}else{_0x3179e5[_0x2c54('0x7b')]('i.'+_0x5d27e1+_0x2c54('0x7f'),_0x5c3b14[_0x2c54('0x3d')][_0x5d27e1]);}}});}if(_0x5c3b14['query'][_0x2c54('0x80')]){if(_0x5c3b14['query']['read']==0x1){_0x3179e5[_0x2c54('0x60')]('`unreadMessages`\x20=\x200');}else{_0x3179e5['having'](_0x2c54('0x81'));}}if(_0x5c3b14[_0x2c54('0x3d')][_0x2c54('0x82')]){_0x3135b2=_[_0x2c54('0x83')](_0x5c3b14[_0x2c54('0x3d')][_0x2c54('0x82')])?_0x5c3b14[_0x2c54('0x3d')]['tag']:new Array(_0x5c3b14[_0x2c54('0x3d')]['tag']);_0x3135b2[_0x2c54('0x2f')](function(_0x51a2a7){_0x4bc5ce['or'](_0x2c54('0x6c'),'%,'+_0x51a2a7+',%');});}if(_0x5c3b14[_0x2c54('0x3d')][_0x2c54('0x84')]){var _0x41b832=_0x5c3b14[_0x2c54('0x3d')]['filter']['replace']('\x5c','\x5c\x5c')[_0x2c54('0x85')](/'/g,'\x27\x27');if(qs[_0x2c54('0x86')](_0x41b832)){_0x4586c3['or'](_0x2c54('0x87'),_0x41b832+'%')['or'](_0x2c54('0x88'),_0x41b832+'%');}_0x4586c3['or'](_0x2c54('0x89'),_0x41b832+'%');}}_0x3179e5['where'](_0x4586c3);_0x3179e5[_0x2c54('0x8a')](_0x2c54('0x8b'));var _0x4c9383={'type':db[_0x2c54('0x8c')][_0x2c54('0x8d')][_0x2c54('0x8e')],'raw':!![]};var _0x78751b=_0x3179e5['clone']();_0x78751b[_0x2c54('0x4a')](_0x2c54('0x8b'));_0x78751b[_0x2c54('0x4a')](_0x2c54('0x8f'),_0x2c54('0x90'));if(_0x4509b6['order']){_0x4509b6[_0x2c54('0x46')][_0x2c54('0x2f')](function(_0x1c09d6){var _0x3158b5=_0x1c09d6[0x0]===_0x2c54('0x91')?_0x1c09d6[0x0]:'i.'+_0x1c09d6[0x0];_0x3179e5[_0x2c54('0x46')](_0x3158b5,_0x1c09d6[0x1]===_0x2c54('0x92')?![]:!![]);});}if(!_[_0x2c54('0x93')](_0x3135b2)){_0x3179e5[_0x2c54('0x60')](_0x4bc5ce);_0x78751b[_0x2c54('0x7b')](_0x2c54('0x94'),_0x3135b2);}BPromise['resolve']()[_0x2c54('0x25')](function(){if(!_0x1b5cdf){if(_0x5c3b14[_0x2c54('0x3d')]['FaxAccountId'])return;_0x78751b[_0x2c54('0x7b')](_0x2c54('0x95'));_0x3179e5['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x5c3b14[_0x2c54('0x96')][_0x2c54('0x97')]!==_0x2c54('0x98'))return;return _0x5c3b14[_0x2c54('0x96')][_0x2c54('0x99')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3d2aea){if(_['isEmpty'](_0x3d2aea)){_0x78751b[_0x2c54('0x7b')](_0x2c54('0x9a'));_0x3179e5[_0x2c54('0x7b')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x78751b[_0x2c54('0x7b')]('i.FaxAccountId\x20IN\x20?',_[_0x2c54('0x2b')](_0x3d2aea,'id'));_0x3179e5[_0x2c54('0x7b')](_0x2c54('0x75'),_[_0x2c54('0x2b')](_0x3d2aea,'id'));}});})[_0x2c54('0x25')](function(){if(_0x5c3b14[_0x2c54('0x96')][_0x2c54('0x97')]==='agent'&&!_0x1b5cdf&&!_0x5c3b14[_0x2c54('0x3d')][_0x2c54('0x74')])return[];return db[_0x2c54('0x9b')]['query'](_0x78751b[_0x2c54('0x9c')](),_0x4c9383);})[_0x2c54('0x25')](function(_0x2889ce){_0x519034[_0x2c54('0x1f')]=_0x2889ce[_0x2c54('0x43')];if(_0x519034[_0x2c54('0x1f')]===0x0)return[];return db['sequelize'][_0x2c54('0x3d')](_0x4d1823['toString'](),_0x4c9383)[_0x2c54('0x25')](function(_0x29cd6c){_0x3355e4=_[_0x2c54('0x9d')](_0x29cd6c,'id');_0x4c9383=_[_0x2c54('0x9e')](_0x4c9383,{'model':db[_0x2c54('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5c3b14[_0x2c54('0x3d')][_0x2c54('0x42')]){_0x4509b6['attributes'][_0x2c54('0x2f')](function(_0xfe257e){_0x3179e5['field']('i.'+_0xfe257e);});}else{_0x3179e5[_0x2c54('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2c54('0x90'));_0x3179e5[_0x2c54('0x4a')]('a.key',_0x2c54('0x9f'));_0x3179e5[_0x2c54('0x4a')](_0x2c54('0xa0'),_0x2c54('0xa1'));_0x3179e5['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');_0x3179e5[_0x2c54('0x4a')]('i.*');_0x3179e5[_0x2c54('0x4a')](_0x2c54('0xa2'),_0x2c54('0xa3'));_0x3179e5[_0x2c54('0x4a')](_0x2c54('0xa4'),'Contact.lastName');_0x3179e5[_0x2c54('0x4a')]('c.email',_0x2c54('0xa5'));_0x3179e5[_0x2c54('0x4a')](_0x2c54('0xa6'),'Contact.phone');_0x3179e5[_0x2c54('0x4a')]('c.mobile',_0x2c54('0xa7'));_0x3179e5[_0x2c54('0x4a')](_0x2c54('0xa8'),_0x2c54('0xa9'));_0x3179e5['field'](_0x2c54('0xaa'),'Owner.fullname');_0x3179e5[_0x2c54('0x4a')]('o.internal','Owner.internal');_0x3179e5[_0x2c54('0x4a')](_0x2c54('0xab'),_0x2c54('0x2d'));}if(_0x4509b6[_0x2c54('0x1e')])_0x3179e5[_0x2c54('0x1e')](_0x4509b6['limit']);if(_0x4509b6[_0x2c54('0x1c')])_0x3179e5[_0x2c54('0x1c')](_0x4509b6[_0x2c54('0x1c')]);return db[_0x2c54('0x9b')][_0x2c54('0x3d')](_0x3179e5[_0x2c54('0x9c')](),_0x4c9383);})[_0x2c54('0x25')](function(_0x3f3116){if(_0x3f3116['length']>0x0)_0x366d42['where']('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x3f3116,'id'));return db[_0x2c54('0x9b')][_0x2c54('0x3d')](_0x366d42['toString'](),_0x4c9383)[_0x2c54('0x25')](function(_0x4e02f7){var _0x1760f7=_[_0x2c54('0xac')](_0x4e02f7,_0x2c54('0xad'));var _0x1141e3=[];_0x3f3116[_0x2c54('0x2f')](function(_0x19c973){_0x1141e3['push'](updateFaxInteraction(_0x19c973,_0x3355e4,_0x1760f7));});return BPromise[_0x2c54('0xae')](_0x1141e3);});});})[_0x2c54('0x25')](function(_0x3f3a62){_0x519034[_0x2c54('0xaf')]=_0x3f3a62;return _0x519034;})[_0x2c54('0x25')](respondWithFilteredResult(_0x4865c7,_0x4509b6))[_0x2c54('0x31')](handleError(_0x4865c7,null));};exports[_0x2c54('0xb0')]=function(_0x1c9636,_0x3ea300){var _0x19c93a={'raw':![],'where':{'id':_0x1c9636['params']['id']}},_0x1d94b3={};_0x1d94b3[_0x2c54('0x40')]=_[_0x2c54('0x3e')](db[_0x2c54('0x39')][_0x2c54('0xb1')]);_0x1d94b3[_0x2c54('0x3d')]=_['keys'](_0x1c9636[_0x2c54('0x3d')]);_0x1d94b3['filters']=_[_0x2c54('0x3f')](_0x1d94b3[_0x2c54('0x40')],_0x1d94b3[_0x2c54('0x3d')]);_0x19c93a[_0x2c54('0x41')]=_['intersection'](_0x1d94b3[_0x2c54('0x40')],qs[_0x2c54('0x42')](_0x1c9636['query']['fields']));_0x19c93a['attributes']=_0x19c93a[_0x2c54('0x41')][_0x2c54('0x43')]?_0x19c93a['attributes']:_0x1d94b3[_0x2c54('0x40')];if(_0x1c9636[_0x2c54('0x3d')]['includeAll']){_0x19c93a[_0x2c54('0xb2')]=[{'all':!![]}];}_0x19c93a=_[_0x2c54('0x9e')]({},_0x19c93a,_0x1c9636['options']);return db['FaxInteraction']['find'](_0x19c93a)[_0x2c54('0x25')](handleEntityNotFound(_0x3ea300,null))[_0x2c54('0x25')](respondWithResult(_0x3ea300,null))[_0x2c54('0x31')](handleError(_0x3ea300,null));};exports['create']=function(_0x503cc4,_0xc2b978){return db['FaxInteraction'][_0x2c54('0xb3')](_0x503cc4[_0x2c54('0x71')],{})[_0x2c54('0x25')](respondWithResult(_0xc2b978,0xc9))[_0x2c54('0x31')](handleError(_0xc2b978,null));};exports['update']=function(_0x18721a,_0x31786d){if(_0x18721a[_0x2c54('0x71')]['id']){delete _0x18721a[_0x2c54('0x71')]['id'];}return db[_0x2c54('0x39')][_0x2c54('0x68')]({'where':{'id':_0x18721a[_0x2c54('0xb4')]['id']}})[_0x2c54('0x25')](handleEntityNotFound(_0x31786d,null))[_0x2c54('0x25')](saveUpdates(_0x18721a[_0x2c54('0x71')],null))['then'](respondWithResult(_0x31786d,null))['catch'](handleError(_0x31786d,null));};exports['destroy']=function(_0x51c520,_0x548495){return db[_0x2c54('0x39')][_0x2c54('0x68')]({'where':{'id':_0x51c520[_0x2c54('0xb4')]['id']}})[_0x2c54('0x25')](handleEntityNotFound(_0x548495,null))['then'](removeEntity(_0x548495,null))['catch'](handleError(_0x548495,null));};exports[_0x2c54('0xb5')]=function(_0x3e950c,_0x417958){return db[_0x2c54('0x39')][_0x2c54('0xb5')]()[_0x2c54('0x25')](respondWithResult(_0x417958,null))[_0x2c54('0x31')](handleError(_0x417958,null));};exports[_0x2c54('0xb6')]=function(_0x142fef,_0xbf5e87,_0x5b86cf){return db[_0x2c54('0xb7')][_0x2c54('0x68')]({'where':{'id':_0x142fef[_0x2c54('0xb4')]['id']}})[_0x2c54('0x25')](handleEntityNotFound(_0xbf5e87,null))['then'](function(_0xf0761){if(_0xf0761){return _0xf0761['addMessage'](_0x142fef[_0x2c54('0x71')][_0x2c54('0xb8')],_[_0x2c54('0xb9')](_0x142fef[_0x2c54('0x71')],[_0x2c54('0xb8'),'id'])||{});}})[_0x2c54('0x25')](respondWithResult(_0xbf5e87,null))[_0x2c54('0x31')](handleError(_0xbf5e87,null));};exports['getMessages']=function(_0x527a1b,_0x388ed9,_0x2dcd3e){var _0x73bb4e={'raw':![],'where':{}};var _0x48a35e={};var _0x20ad0d={'count':0x0,'rows':[]};return db[_0x2c54('0x39')][_0x2c54('0xba')]({'where':{'id':_0x527a1b[_0x2c54('0xb4')]['id']}})[_0x2c54('0x25')](handleEntityNotFound(_0x388ed9,null))[_0x2c54('0x25')](function(_0x1b287d){if(_0x1b287d){_0x48a35e[_0x2c54('0x40')]=_[_0x2c54('0x3e')](db['FaxMessage'][_0x2c54('0xb1')]);_0x48a35e[_0x2c54('0x3d')]=_[_0x2c54('0x3e')](_0x527a1b[_0x2c54('0x3d')]);_0x48a35e['filters']=_[_0x2c54('0x3f')](_0x48a35e[_0x2c54('0x40')],_0x48a35e[_0x2c54('0x3d')]);_0x73bb4e['attributes']=_['intersection'](_0x48a35e[_0x2c54('0x40')],qs[_0x2c54('0x42')](_0x527a1b['query'][_0x2c54('0x42')]));_0x73bb4e['attributes']=_0x73bb4e[_0x2c54('0x41')][_0x2c54('0x43')]?_0x73bb4e[_0x2c54('0x41')]:_0x48a35e[_0x2c54('0x40')];if(!_0x527a1b[_0x2c54('0x3d')][_0x2c54('0x44')]('nolimit')){_0x73bb4e[_0x2c54('0x1e')]=qs[_0x2c54('0x1e')](_0x527a1b[_0x2c54('0x3d')]['limit']);_0x73bb4e[_0x2c54('0x1c')]=qs[_0x2c54('0x1c')](_0x527a1b[_0x2c54('0x3d')][_0x2c54('0x1c')]);}_0x73bb4e[_0x2c54('0x46')]=qs['sort'](_0x527a1b[_0x2c54('0x3d')]['sort']);_0x73bb4e['where']=qs[_0x2c54('0xbb')](_[_0x2c54('0x48')](_0x527a1b[_0x2c54('0x3d')],_0x48a35e[_0x2c54('0xbb')]));_0x73bb4e[_0x2c54('0x7b')]['FaxInteractionId']=_0x1b287d['id'];if(_0x527a1b[_0x2c54('0x3d')]['filter']){_0x73bb4e[_0x2c54('0x7b')]=_['merge'](_0x73bb4e[_0x2c54('0x7b')],{'$or':_[_0x2c54('0x2b')](_0x73bb4e[_0x2c54('0x41')],function(_0x5d58ba){var _0x5a5248={};_0x5a5248[_0x5d58ba]={'$like':'%'+_0x527a1b[_0x2c54('0x3d')][_0x2c54('0x84')]+'%'};return _0x5a5248;})});}if(_0x527a1b[_0x2c54('0x3d')][_0x2c54('0x79')]){var _0x35dd5d=_0x527a1b[_0x2c54('0x3d')][_0x2c54('0x79')][_0x2c54('0x2e')](',');var _0x3dab86={};_0x3dab86[_0x35dd5d[0x0]]={'$gte':moment(_0x35dd5d[0x1])[_0x2c54('0xbc')](_0x2c54('0xbd'))};_0x73bb4e[_0x2c54('0x7b')]=_[_0x2c54('0x9e')](_0x73bb4e[_0x2c54('0x7b')],_0x3dab86);}_0x73bb4e=_['merge']({},_0x73bb4e,_0x527a1b[_0x2c54('0xbe')]);return db['FaxMessage']['count']({'where':_0x73bb4e[_0x2c54('0x7b')]})[_0x2c54('0x25')](function(_0x5d884b){_0x20ad0d[_0x2c54('0x1f')]=_0x5d884b;if(_0x527a1b['query'][_0x2c54('0xbf')]){_0x73bb4e[_0x2c54('0xb2')]=[{'all':!![]}];}return db['FaxMessage'][_0x2c54('0xc0')](_0x73bb4e);})['then'](function(_0xaf9327){_0x20ad0d[_0x2c54('0xaf')]=_0xaf9327;return _0x20ad0d;});}})['then'](respondWithFilteredResult(_0x388ed9,_0x73bb4e))['catch'](handleError(_0x388ed9,null));};exports['addTags']=function(_0x5ef2d9,_0x3c2c9c,_0x1296f7){return db[_0x2c54('0x39')]['find']({'where':{'id':_0x5ef2d9[_0x2c54('0xb4')]['id']}})[_0x2c54('0x25')](handleEntityNotFound(_0x3c2c9c,null))[_0x2c54('0x25')](function(_0x8fd98d){if(_0x8fd98d){return _0x8fd98d['setTags'](_0x5ef2d9[_0x2c54('0x71')][_0x2c54('0xb8')],_[_0x2c54('0xb9')](_0x5ef2d9[_0x2c54('0x71')],[_0x2c54('0xb8'),'id'])||{})[_0x2c54('0xc1')](function(){return db['Tag'][_0x2c54('0xc0')]({'attributes':['id',_0x2c54('0x29'),_0x2c54('0xc2')],'where':{'id':_0x5ef2d9[_0x2c54('0x71')][_0x2c54('0xb8')]}});})[_0x2c54('0x25')](function(_0x5793e4){socket[_0x2c54('0xc3')]('faxInteractionTags:save',{'id':Number(_0x5ef2d9[_0x2c54('0xb4')]['id']),'tags':_0x5793e4||[]});return{'id':Number(_0x5ef2d9[_0x2c54('0xb4')]['id']),'tags':_0x5793e4||[]};});}})['then'](respondWithResult(_0x3c2c9c,null))[_0x2c54('0x31')](handleError(_0x3c2c9c,null));};exports[_0x2c54('0xc4')]=function(_0xfbb68e,_0x1da517,_0x5b8734){return db['FaxInteraction'][_0x2c54('0x68')]({'where':{'id':_0xfbb68e['params']['id']}})[_0x2c54('0x25')](handleEntityNotFound(_0x1da517,null))[_0x2c54('0x25')](function(_0x405d1c){if(_0x405d1c){return _0x405d1c[_0x2c54('0xc4')](_0xfbb68e['query'][_0x2c54('0xb8')]);}})[_0x2c54('0x25')](respondWithStatusCode(_0x1da517,null))[_0x2c54('0x31')](handleError(_0x1da517,null));};exports[_0x2c54('0xc5')]=function(_0x916b9f,_0x501300){var _0x498612=moment()[_0x2c54('0xc6')]()[_0x2c54('0x9c')]();var _0x39d72b=path[_0x2c54('0xc7')](config['root'],_0x2c54('0xc8'),'files',_0x2c54('0xc9'));var _0x448b81=path['join'](config[_0x2c54('0xca')],_0x2c54('0xc8'),'files',_0x2c54('0xcb'));var _0x44c69f=path[_0x2c54('0xc7')](_0x39d72b,_0x498612);var _0x4771dc=util[_0x2c54('0xbc')]('transcript-%d-%s.zip',_0x916b9f[_0x2c54('0xb4')]['id'],_0x498612);var _0x4d7ddb=path[_0x2c54('0xc7')](_0x39d72b,_0x4771dc);var _0x5ce3dd=[];_0x5ce3dd['push']({'model':db['Attachment'],'as':_0x2c54('0xcc'),'raw':!![]});var _0x1fadfd=[{'model':db['FaxMessage'],'as':_0x2c54('0xcd'),'attributes':['id',_0x2c54('0x71'),_0x2c54('0x77')],'include':_0x5ce3dd}];return db[_0x2c54('0x39')]['find']({'where':{'id':_0x916b9f[_0x2c54('0xb4')]['id']},'include':_0x1fadfd})[_0x2c54('0x25')](handleEntityNotFound(_0x501300,null))['then'](function(_0x4d5128){if(_0x4d5128&&_0x4d5128[_0x2c54('0xcd')]){var _0x211595=_0x4d5128[_0x2c54('0xce')]({'plain':!![]});fs[_0x2c54('0xcf')](_0x44c69f);for(var _0x443be8=0x0;_0x443be8<_0x211595[_0x2c54('0xcd')][_0x2c54('0x43')];_0x443be8++){var _0x43efdf=_0x211595[_0x2c54('0xcd')][_0x443be8]['Attachment'];if(_0x43efdf){var _0x28eb20=path['join'](_0x448b81,_0x43efdf['basename']);if(fs['existsSync'](_0x28eb20)){fs[_0x2c54('0xd0')](_0x28eb20)[_0x2c54('0xd1')](fs[_0x2c54('0xd2')](path[_0x2c54('0xc7')](_0x44c69f,_0x43efdf['basename'])));}}}return BPromise['resolve']()[_0x2c54('0x25')](function(){return new BPromise(function(_0x70b8c3,_0x58c2a3){zipdir(_0x44c69f,{'saveTo':_0x4d7ddb},function(_0x4d41f1,_0x3e4217){if(_0x4d41f1)return _0x58c2a3(_0x4d41f1);return _0x70b8c3(_0x3e4217);});})['then'](function(){return new BPromise(function(_0x1bb768,_0x4a504c){rimraf(_0x44c69f,function(_0x52f74f){if(_0x52f74f)_0x4a504c(_0x52f74f);return _0x1bb768();});});})['then'](function(){return _0x501300[_0x2c54('0xc5')](_0x4d7ddb,_0x4771dc,function(_0xf18f25){if(_0xf18f25){console[_0x2c54('0xd3')](_0x2c54('0xd4'),_0xf18f25);}else{fs[_0x2c54('0xd5')](_0x4d7ddb);}});});});}else{return _0x501300[_0x2c54('0x18')](0xc8);}})[_0x2c54('0x31')](handleError(_0x501300,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 31e5708..90604ef 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 _0x3f75=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','events','../../mysqldb','FaxMessage','save','update'];(function(_0x4b8e47,_0x2f9c13){var _0x3355f2=function(_0x4c9ba8){while(--_0x4c9ba8){_0x4b8e47['push'](_0x4b8e47['shift']());}};_0x3355f2(++_0x2f9c13);}(_0x3f75,0xeb));var _0x53f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f75[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x53f7('0x0'));var FaxInteraction=require(_0x53f7('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x53f7('0x1'))['db'][_0x53f7('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x53f7('0x3'),'afterUpdate':_0x53f7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x376902){return function(_0x3e4645,_0x1c00ca,_0x2ce43b){_0x3e4645[_0x53f7('0x5')]({'attributes':['id'],'raw':!![]})[_0x53f7('0x6')](function(_0x2c24a4){_0x3e4645[_0x53f7('0x7')](_0x53f7('0x8'),_0x2c24a4[_0x53f7('0x9')](function(_0x12e1c3){return{'id':_0x12e1c3['id']};}));return FaxMessage[_0x53f7('0xa')]({'where':{'FaxInteractionId':_0x3e4645['id'],'direction':'in','read':![]},'raw':!![]});})[_0x53f7('0x6')](function(_0x22d64a){_0x3e4645[_0x53f7('0x7')](_0x53f7('0xb'),_0x22d64a[_0x53f7('0xc')]);FaxInteractionEvents[_0x53f7('0xd')](_0x376902+':'+_0x3e4645['id'],_0x3e4645);FaxInteractionEvents[_0x53f7('0xd')](_0x376902,_0x3e4645);_0x2ce43b(null);})[_0x53f7('0xe')](_0x2ce43b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0xafe9=['Users','map','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','then','setDataValue'];(function(_0x420352,_0x4c7a52){var _0x45da93=function(_0x576793){while(--_0x576793){_0x420352['push'](_0x420352['shift']());}};_0x45da93(++_0x4c7a52);}(_0xafe9,0x1d1));var _0x9afe=function(_0x52ad3a,_0x1fa1ec){_0x52ad3a=_0x52ad3a-0x0;var _0x179d0a=_0xafe9[_0x52ad3a];return _0x179d0a;};'use strict';var EventEmitter=require(_0x9afe('0x0'));var FaxInteraction=require(_0x9afe('0x1'))['db'][_0x9afe('0x2')];var FaxMessage=require(_0x9afe('0x1'))['db'][_0x9afe('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9afe('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9afe('0x5'),'afterDestroy':_0x9afe('0x6')};function emitEvent(_0x44e709){return function(_0x20644a,_0x44e789,_0x239ac9){_0x20644a[_0x9afe('0x7')]({'attributes':['id'],'raw':!![]})[_0x9afe('0x8')](function(_0x48038b){_0x20644a[_0x9afe('0x9')](_0x9afe('0xa'),_0x48038b[_0x9afe('0xb')](function(_0x2e7e5a){return{'id':_0x2e7e5a['id']};}));return FaxMessage[_0x9afe('0xc')]({'where':{'FaxInteractionId':_0x20644a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9afe('0x8')](function(_0x36c7b5){_0x20644a['setDataValue'](_0x9afe('0xd'),_0x36c7b5[_0x9afe('0xe')]);FaxInteractionEvents[_0x9afe('0xf')](_0x44e709+':'+_0x20644a['id'],_0x20644a);FaxInteractionEvents['emit'](_0x44e709,_0x20644a);_0x239ac9(null);})[_0x9afe('0x10')](_0x239ac9(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x9afe('0x11')](e,emitEvent(event));}}module[_0x9afe('0x12')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 41819d1..84d9938 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 _0xa5c5=['fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5c5,0xba));var _0x5a5c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa5c5[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x5a5c('0x0'));var util=require(_0x5a5c('0x1'));var logger=require(_0x5a5c('0x2'))('api');var moment=require(_0x5a5c('0x3'));var BPromise=require(_0x5a5c('0x4'));var rp=require(_0x5a5c('0x5'));var fs=require('fs');var path=require(_0x5a5c('0x6'));var rimraf=require(_0x5a5c('0x7'));var config=require(_0x5a5c('0x8'));var attributes=require(_0x5a5c('0x9'));module[_0x5a5c('0xa')]=function(_0x1ecb19,_0xb3aca1){return _0x1ecb19['define'](_0x5a5c('0xb'),attributes,{'tableName':_0x5a5c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd50c42,_0x169491,_0x5b061b){if(_0xd50c42[_0x5a5c('0xd')](_0x5a5c('0xe'))){_0xd50c42[_0x5a5c('0xf')]=moment()[_0x5a5c('0x10')](_0x5a5c('0x11'));}_0x5b061b(null,_0xd50c42);}}});}; \ No newline at end of file +var _0x6ffc=['./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x25bb9d,_0x4f12cc){var _0x5e7a45=function(_0x3cef35){while(--_0x3cef35){_0x25bb9d['push'](_0x25bb9d['shift']());}};_0x5e7a45(++_0x4f12cc);}(_0x6ffc,0x12a));var _0xc6ff=function(_0x2665aa,_0x25bc75){_0x2665aa=_0x2665aa-0x0;var _0x58ea9c=_0x6ffc[_0x2665aa];return _0x58ea9c;};'use strict';var _=require('lodash');var util=require(_0xc6ff('0x0'));var logger=require('../../config/logger')(_0xc6ff('0x1'));var moment=require(_0xc6ff('0x2'));var BPromise=require(_0xc6ff('0x3'));var rp=require(_0xc6ff('0x4'));var fs=require('fs');var path=require(_0xc6ff('0x5'));var rimraf=require(_0xc6ff('0x6'));var config=require(_0xc6ff('0x7'));var attributes=require(_0xc6ff('0x8'));module['exports']=function(_0x1f7019,_0x9de75){return _0x1f7019[_0xc6ff('0x9')](_0xc6ff('0xa'),attributes,{'tableName':_0xc6ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ba502,_0x553603,_0x1f15ba){if(_0x1ba502[_0xc6ff('0xc')](_0xc6ff('0xd'))){_0x1ba502[_0xc6ff('0xe')]=moment()[_0xc6ff('0xf')](_0xc6ff('0x10'));}_0x1f15ba(null,_0x1ba502);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 608d799..3537bfb 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 _0xe67b=['raw','where','attributes','limit','catch','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','UpdateFaxInteraction','update','body','options'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xe67b,0x91));var _0xbe67=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xe67b[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0xbe67('0x0'));var util=require(_0xbe67('0x1'));var moment=require(_0xbe67('0x2'));var BPromise=require(_0xbe67('0x3'));var rs=require(_0xbe67('0x4'));var fs=require('fs');var Redis=require(_0xbe67('0x5'));var db=require(_0xbe67('0x6'))['db'];var utils=require(_0xbe67('0x7'));var logger=require(_0xbe67('0x8'))('rpc');var config=require(_0xbe67('0x9'));var jayson=require(_0xbe67('0xa'));var client=jayson['client'][_0xbe67('0xb')]({'port':0x232a});config[_0xbe67('0xc')]=_[_0xbe67('0xd')](config[_0xbe67('0xc')],{'host':_0xbe67('0xe'),'port':0x18eb});var socket=require(_0xbe67('0xf'))(new Redis(config['redis']));require(_0xbe67('0x10'))[_0xbe67('0x11')](socket);function respondWithRpcPromise(_0x193505,_0x481396,_0x5336cb){return new BPromise(function(_0x435ea4,_0x5672f6){return client['request'](_0x193505,_0x5336cb)[_0xbe67('0x12')](function(_0x35e756){logger['info'](_0xbe67('0x13'),_0x481396,_0xbe67('0x14'));logger[_0xbe67('0x15')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x481396,_0xbe67('0x14'),JSON[_0xbe67('0x16')](_0x35e756));if(_0x35e756['error']){if(_0x35e756['error'][_0xbe67('0x17')]===0x1f4){logger['error'](_0xbe67('0x13'),_0x481396,_0x35e756[_0xbe67('0x18')][_0xbe67('0x19')]);return _0x5672f6(_0x35e756[_0xbe67('0x18')][_0xbe67('0x19')]);}logger[_0xbe67('0x18')](_0xbe67('0x13'),_0x481396,_0x35e756['error'][_0xbe67('0x19')]);return _0x435ea4(_0x35e756['error'][_0xbe67('0x19')]);}else{logger[_0xbe67('0x1a')](_0xbe67('0x13'),_0x481396,_0xbe67('0x14'));_0x435ea4(_0x35e756['result']['message']);}})['catch'](function(_0x47aeee){logger[_0xbe67('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x481396,_0x47aeee);_0x5672f6(_0x47aeee);});});}exports[_0xbe67('0x1b')]=function(_0x213c6e){var _0x2b06f6=this;return new Promise(function(_0x2d8890,_0x24eff8){return db['FaxInteraction'][_0xbe67('0x1c')](_0x213c6e[_0xbe67('0x1d')],{'raw':_0x213c6e[_0xbe67('0x1e')]?_0x213c6e[_0xbe67('0x1e')][_0xbe67('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x213c6e[_0xbe67('0x1e')]?_0x213c6e['options'][_0xbe67('0x20')]||null:null,'attributes':_0x213c6e[_0xbe67('0x1e')]?_0x213c6e['options'][_0xbe67('0x21')]||null:null,'limit':_0x213c6e[_0xbe67('0x1e')]?_0x213c6e['options'][_0xbe67('0x22')]||null:null})[_0xbe67('0x12')](function(_0x48bd62){logger[_0xbe67('0x1a')](_0xbe67('0x1b'),_0x213c6e);logger[_0xbe67('0x15')](_0xbe67('0x1b'),_0x213c6e,JSON[_0xbe67('0x16')](_0x48bd62));_0x2d8890(_0x48bd62);})[_0xbe67('0x23')](function(_0x5b33e8){logger[_0xbe67('0x18')](_0xbe67('0x1b'),_0x5b33e8[_0xbe67('0x19')],_0x213c6e);_0x24eff8(_0x2b06f6[_0xbe67('0x18')](0x1f4,_0x5b33e8[_0xbe67('0x19')]));});});};exports[_0xbe67('0x24')]=function(_0x237312){return new Promise(function(_0xed129,_0x42bb74){return db[_0xbe67('0x25')][_0xbe67('0x26')]({'where':_0x237312['options']?_0x237312[_0xbe67('0x1e')][_0xbe67('0x20')]||null:null})[_0xbe67('0x12')](function(_0x11351e){if(_0x11351e){return _0x11351e[_0xbe67('0x27')](_0x237312[_0xbe67('0x1d')][_0xbe67('0x28')],_[_0xbe67('0x29')](_0x237312[_0xbe67('0x1d')],[_0xbe67('0x28'),'id'])||{});}})[_0xbe67('0x2a')](function(_0x50e6c7){logger[_0xbe67('0x1a')]('AddTags',_0x237312);logger[_0xbe67('0x15')](_0xbe67('0x2b'),_0x237312,JSON[_0xbe67('0x16')](_0x50e6c7));_0xed129(_0x50e6c7);})[_0xbe67('0x23')](function(_0x146832){logger[_0xbe67('0x18')](_0xbe67('0x2b'),_0x146832['message'],_0x237312);_0x42bb74(_this[_0xbe67('0x18')](0x1f4,_0x146832[_0xbe67('0x19')]));});});}; \ No newline at end of file +var _0x228c=['request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','update','body','options','raw','where','attributes','limit','then','UpdateFaxInteraction','catch','AddTagsToFaxInteraction','FaxInteraction','find','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register'];(function(_0x5499ab,_0x4c1128){var _0x344478=function(_0x5d767e){while(--_0x5d767e){_0x5499ab['push'](_0x5499ab['shift']());}};_0x344478(++_0x4c1128);}(_0x228c,0x1df));var _0xc228=function(_0x31eab3,_0x161fde){_0x31eab3=_0x31eab3-0x0;var _0x1e4c92=_0x228c[_0x31eab3];return _0x1e4c92;};'use strict';var _=require('lodash');var util=require(_0xc228('0x0'));var moment=require('moment');var BPromise=require(_0xc228('0x1'));var rs=require(_0xc228('0x2'));var fs=require('fs');var Redis=require(_0xc228('0x3'));var db=require(_0xc228('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc228('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc228('0x6')]['http']({'port':0x232a});config[_0xc228('0x7')]=_[_0xc228('0x8')](config['redis'],{'host':_0xc228('0x9'),'port':0x18eb});var socket=require(_0xc228('0xa'))(new Redis(config[_0xc228('0x7')]));require(_0xc228('0xb'))[_0xc228('0xc')](socket);function respondWithRpcPromise(_0x3fbcd9,_0x480a20,_0x155379){return new BPromise(function(_0x3045a6,_0x111c04){return client[_0xc228('0xd')](_0x3fbcd9,_0x155379)['then'](function(_0x235b49){logger[_0xc228('0xe')](_0xc228('0xf'),_0x480a20,_0xc228('0x10'));logger[_0xc228('0x11')](_0xc228('0x12'),_0x480a20,_0xc228('0x10'),JSON[_0xc228('0x13')](_0x235b49));if(_0x235b49[_0xc228('0x14')]){if(_0x235b49[_0xc228('0x14')][_0xc228('0x15')]===0x1f4){logger[_0xc228('0x14')](_0xc228('0xf'),_0x480a20,_0x235b49[_0xc228('0x14')]['message']);return _0x111c04(_0x235b49[_0xc228('0x14')]['message']);}logger[_0xc228('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x480a20,_0x235b49[_0xc228('0x14')][_0xc228('0x16')]);return _0x3045a6(_0x235b49[_0xc228('0x14')][_0xc228('0x16')]);}else{logger[_0xc228('0xe')](_0xc228('0xf'),_0x480a20,'request\x20sent');_0x3045a6(_0x235b49[_0xc228('0x17')][_0xc228('0x16')]);}})['catch'](function(_0x32a655){logger[_0xc228('0x14')](_0xc228('0xf'),_0x480a20,_0x32a655);_0x111c04(_0x32a655);});});}exports['UpdateFaxInteraction']=function(_0x193756){var _0x4ace08=this;return new Promise(function(_0x56e176,_0x4300bc){return db['FaxInteraction'][_0xc228('0x18')](_0x193756[_0xc228('0x19')],{'raw':_0x193756[_0xc228('0x1a')]?_0x193756[_0xc228('0x1a')][_0xc228('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x193756['options']?_0x193756[_0xc228('0x1a')][_0xc228('0x1c')]||null:null,'attributes':_0x193756[_0xc228('0x1a')]?_0x193756[_0xc228('0x1a')][_0xc228('0x1d')]||null:null,'limit':_0x193756['options']?_0x193756[_0xc228('0x1a')][_0xc228('0x1e')]||null:null})[_0xc228('0x1f')](function(_0x18c283){logger['info'](_0xc228('0x20'),_0x193756);logger[_0xc228('0x11')](_0xc228('0x20'),_0x193756,JSON['stringify'](_0x18c283));_0x56e176(_0x18c283);})[_0xc228('0x21')](function(_0x152471){logger[_0xc228('0x14')](_0xc228('0x20'),_0x152471[_0xc228('0x16')],_0x193756);_0x4300bc(_0x4ace08['error'](0x1f4,_0x152471[_0xc228('0x16')]));});});};exports[_0xc228('0x22')]=function(_0x1a4185){return new Promise(function(_0x5e1ce9,_0x899722){return db[_0xc228('0x23')][_0xc228('0x24')]({'where':_0x1a4185[_0xc228('0x1a')]?_0x1a4185[_0xc228('0x1a')][_0xc228('0x1c')]||null:null})[_0xc228('0x1f')](function(_0x19b3e5){if(_0x19b3e5){return _0x19b3e5['addTags'](_0x1a4185['body'][_0xc228('0x25')],_[_0xc228('0x26')](_0x1a4185['body'],['ids','id'])||{});}})[_0xc228('0x27')](function(_0x30caaf){logger[_0xc228('0xe')](_0xc228('0x28'),_0x1a4185);logger[_0xc228('0x11')](_0xc228('0x28'),_0x1a4185,JSON[_0xc228('0x13')](_0x30caaf));_0x5e1ce9(_0x30caaf);})[_0xc228('0x21')](function(_0xfb0f8){logger[_0xc228('0x14')](_0xc228('0x28'),_0xfb0f8['message'],_0x1a4185);_0x899722(_this[_0xc228('0x14')](0x1f4,_0xfb0f8['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 17fc829..491a0da 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 _0x1730=['emit','removeListener','register','faxInteraction:'];(function(_0x3a6a89,_0x11e8dd){var _0x1fe7a4=function(_0x1f4405){while(--_0x1f4405){_0x3a6a89['push'](_0x3a6a89['shift']());}};_0x1fe7a4(++_0x11e8dd);}(_0x1730,0xd4));var _0x0173=function(_0x597f3e,_0x37b7f0){_0x597f3e=_0x597f3e-0x0;var _0x137a46=_0x1730[_0x597f3e];return _0x137a46;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save','remove','update'];function createListener(_0x21cfb7,_0x1e689a){return function(_0x29aaf6){_0x1e689a[_0x0173('0x0')](_0x21cfb7,_0x29aaf6);};}function removeListener(_0x570608,_0x17b776){return function(){FaxInteractionEvents[_0x0173('0x1')](_0x570608,_0x17b776);};}exports[_0x0173('0x2')]=function(_0x208a3f){for(var _0x44a2d5=0x0,_0x4937ae=events['length'];_0x44a2d5<_0x4937ae;_0x44a2d5++){var _0x291dbb=events[_0x44a2d5];var _0x395b8d=createListener(_0x0173('0x3')+_0x291dbb,_0x208a3f);FaxInteractionEvents['on'](_0x291dbb,_0x395b8d);}}; \ No newline at end of file +var _0xa25b=['removeListener','register','length','faxInteraction:','save','remove','update','emit'];(function(_0x29e72d,_0x1c695c){var _0x4b2112=function(_0x10d80e){while(--_0x10d80e){_0x29e72d['push'](_0x29e72d['shift']());}};_0x4b2112(++_0x1c695c);}(_0xa25b,0x134));var _0xba25=function(_0xd5e20e,_0x527c95){_0xd5e20e=_0xd5e20e-0x0;var _0x193b68=_0xa25b[_0xd5e20e];return _0x193b68;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xba25('0x0'),_0xba25('0x1'),_0xba25('0x2')];function createListener(_0x317602,_0x261188){return function(_0x22f721){_0x261188[_0xba25('0x3')](_0x317602,_0x22f721);};}function removeListener(_0x31cee8,_0x2074c8){return function(){FaxInteractionEvents[_0xba25('0x4')](_0x31cee8,_0x2074c8);};}exports[_0xba25('0x5')]=function(_0x5ef140){for(var _0x2047d2=0x0,_0x2c4792=events[_0xba25('0x6')];_0x2047d2<_0x2c4792;_0x2047d2++){var _0x4dd18f=events[_0x2047d2];var _0x479a84=createListener(_0xba25('0x7')+_0x4dd18f,_0x5ef140);FaxInteractionEvents['on'](_0x4dd18f,_0x479a84);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 9b47245..0b47f14 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 _0x3544=['/:id','show','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','faxinteraction:addtags','put','faxinteraction:update','update','delete','fax','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe'];(function(_0x44353d,_0x267761){var _0x93dd90=function(_0x218cc1){while(--_0x218cc1){_0x44353d['push'](_0x44353d['shift']());}};_0x93dd90(++_0x267761);}(_0x3544,0x70));var _0x4354=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x3544[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x4354('0x0'));var util=require(_0x4354('0x1'));var path=require(_0x4354('0x2'));var timeout=require('connect-timeout');var express=require(_0x4354('0x3'));var router=express[_0x4354('0x4')]();var fs_extra=require(_0x4354('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4354('0x6'));var config=require(_0x4354('0x7'));var controller=require(_0x4354('0x8'));router[_0x4354('0x9')]('/',auth[_0x4354('0xa')](),controller['index']);router[_0x4354('0x9')](_0x4354('0xb'),auth[_0x4354('0xa')](),controller['describe']);router[_0x4354('0x9')](_0x4354('0xc'),auth['isAuthenticated'](),controller[_0x4354('0xd')]);router[_0x4354('0x9')](_0x4354('0xe'),auth[_0x4354('0xa')](),controller[_0x4354('0xf')]);router[_0x4354('0x9')]('/:id/download',auth[_0x4354('0xa')](),controller[_0x4354('0x10')]);router[_0x4354('0x11')]('/',auth[_0x4354('0xa')](),controller[_0x4354('0x12')]);router['post'](_0x4354('0xe'),auth[_0x4354('0xa')](),controller['addMessage']);router[_0x4354('0x11')](_0x4354('0x13'),auth['isAuthenticated'](),interaction[_0x4354('0x14')]('fax',_0x4354('0x15')),controller['addTags']);router[_0x4354('0x16')](_0x4354('0xc'),auth[_0x4354('0xa')](),interaction['tracked']('fax',_0x4354('0x17')),controller[_0x4354('0x18')]);router[_0x4354('0x19')](_0x4354('0xc'),auth[_0x4354('0xa')](),interaction[_0x4354('0x14')](_0x4354('0x1a'),_0x4354('0x1b')),controller[_0x4354('0x1c')]);router[_0x4354('0x19')](_0x4354('0x13'),auth[_0x4354('0xa')](),controller[_0x4354('0x1d')]);module[_0x4354('0x1e')]=router; \ No newline at end of file +var _0xd4d6=['create','addMessage','/:id/tags','tracked','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download'];(function(_0xe9b030,_0x3af175){var _0x3f5a67=function(_0x3ef2af){while(--_0x3ef2af){_0xe9b030['push'](_0xe9b030['shift']());}};_0x3f5a67(++_0x3af175);}(_0xd4d6,0x1cc));var _0x6d4d=function(_0x59df12,_0x346a1e){_0x59df12=_0x59df12-0x0;var _0x1b8e4e=_0xd4d6[_0x59df12];return _0x1b8e4e;};'use strict';var multer=require(_0x6d4d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6d4d('0x1'));var express=require(_0x6d4d('0x2'));var router=express[_0x6d4d('0x3')]();var fs_extra=require(_0x6d4d('0x4'));var auth=require(_0x6d4d('0x5'));var interaction=require(_0x6d4d('0x6'));var config=require(_0x6d4d('0x7'));var controller=require(_0x6d4d('0x8'));router[_0x6d4d('0x9')]('/',auth[_0x6d4d('0xa')](),controller[_0x6d4d('0xb')]);router[_0x6d4d('0x9')](_0x6d4d('0xc'),auth[_0x6d4d('0xa')](),controller[_0x6d4d('0xd')]);router['get'](_0x6d4d('0xe'),auth['isAuthenticated'](),controller[_0x6d4d('0xf')]);router['get'](_0x6d4d('0x10'),auth[_0x6d4d('0xa')](),controller[_0x6d4d('0x11')]);router[_0x6d4d('0x9')](_0x6d4d('0x12'),auth[_0x6d4d('0xa')](),controller[_0x6d4d('0x13')]);router['post']('/',auth[_0x6d4d('0xa')](),controller[_0x6d4d('0x14')]);router['post'](_0x6d4d('0x10'),auth['isAuthenticated'](),controller[_0x6d4d('0x15')]);router['post'](_0x6d4d('0x16'),auth[_0x6d4d('0xa')](),interaction[_0x6d4d('0x17')](_0x6d4d('0x18'),'faxinteraction:addtags'),controller['addTags']);router['put'](_0x6d4d('0xe'),auth['isAuthenticated'](),interaction[_0x6d4d('0x17')](_0x6d4d('0x18'),_0x6d4d('0x19')),controller[_0x6d4d('0x1a')]);router[_0x6d4d('0x1b')](_0x6d4d('0xe'),auth[_0x6d4d('0xa')](),interaction[_0x6d4d('0x17')](_0x6d4d('0x18'),_0x6d4d('0x1c')),controller[_0x6d4d('0x1d')]);router[_0x6d4d('0x1b')](_0x6d4d('0x16'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 259ac8a..841d3d5 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 _0xe57e=['out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe57e,0xf2));var _0xee57=function(_0xd7b35,_0x7aec91){_0xd7b35=_0xd7b35-0x0;var _0x400a21=_0xe57e[_0xd7b35];return _0x400a21;};'use strict';var Sequelize=require(_0xee57('0x0'));module['exports']={'body':{'type':Sequelize[_0xee57('0x1')](_0xee57('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xee57('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xee57('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xee57('0x5')]}}; \ No newline at end of file +var _0x9224=['out','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x6a3e25,_0x266427){var _0x22d542=function(_0x5ea17e){while(--_0x5ea17e){_0x6a3e25['push'](_0x6a3e25['shift']());}};_0x22d542(++_0x266427);}(_0x9224,0xa3));var _0x4922=function(_0x30e46b,_0x3b23e8){_0x30e46b=_0x30e46b-0x0;var _0x35a995=_0x9224[_0x30e46b];return _0x35a995;};'use strict';var Sequelize=require('sequelize');module[_0x4922('0x0')]={'body':{'type':Sequelize[_0x4922('0x1')](_0x4922('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4922('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4922('0x4')]('in',_0x4922('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 9160ac4..9275fad 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 _0xbbad=['contact','UserId','User','fullname','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','get','FaxInteractionId','interaction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','email','motionChannel','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','basename','download','join','server','files','attachments','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','reject','save','stack','send','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','pick','filter','where','merge','VIRTUAL','FaxMessage','include','findAll','params','includeAll','options','update','body','find','describe','fax-interactions','accept','fax','read','readAt','format','user','agent','FaxInteraction','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT'];(function(_0xa1f227,_0x5ab71e){var _0x1e2ad1=function(_0x5c9f1e){while(--_0x5c9f1e){_0xa1f227['push'](_0xa1f227['shift']());}};_0x1e2ad1(++_0x5ab71e);}(_0xbbad,0x1d0));var _0xdbba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbad[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xdbba('0x0'));var rimraf=require(_0xdbba('0x1'));var zipdir=require(_0xdbba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdbba('0x3'));var moment=require('moment');var BPromise=require(_0xdbba('0x4'));var Mustache=require(_0xdbba('0x5'));var util=require(_0xdbba('0x6'));var path=require(_0xdbba('0x7'));var sox=require(_0xdbba('0x8'));var csv=require(_0xdbba('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdbba('0xa'));var _=require(_0xdbba('0xb'));var squel=require(_0xdbba('0xc'));var crypto=require('crypto');var jsforce=require(_0xdbba('0xd'));var deskjs=require(_0xdbba('0xe'));var toCsv=require(_0xdbba('0x9'));var querystring=require(_0xdbba('0xf'));var Papa=require(_0xdbba('0x10'));var Redis=require('ioredis');var authService=require(_0xdbba('0x11'));var qs=require(_0xdbba('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdbba('0x13'));var logger=require(_0xdbba('0x14'))('api');var utils=require(_0xdbba('0x15'));var config=require(_0xdbba('0x16'));var licenseUtil=require(_0xdbba('0x17'));var db=require(_0xdbba('0x18'))['db'];config[_0xdbba('0x19')]=_[_0xdbba('0x1a')](config[_0xdbba('0x19')],{'host':_0xdbba('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdbba('0x1c'))[_0xdbba('0x1d')](socket);var jayson=require(_0xdbba('0x1e'));var client=jayson[_0xdbba('0x1f')]['http']({'port':0x232c});var client9002=jayson['client'][_0xdbba('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5e4c7f,_0x5d5720,_0x648bd1,_0x40c9de){return new BPromise(function(_0x117b17,_0x2a27da){var _0x531ff1=_0x40c9de||client;return _0x531ff1['request'](_0x5e4c7f,_0x648bd1)[_0xdbba('0x21')](function(_0x324652){logger[_0xdbba('0x22')](_0xdbba('0x23'),_0x5d5720,'request\x20sent');logger[_0xdbba('0x24')](_0xdbba('0x25'),_0x5d5720,_0xdbba('0x26'),JSON[_0xdbba('0x27')](_0x324652));if(_0x324652[_0xdbba('0x28')]){if(_0x324652[_0xdbba('0x28')][_0xdbba('0x29')]===0x1f4){logger['error'](_0xdbba('0x23'),_0x5d5720,_0x324652[_0xdbba('0x28')][_0xdbba('0x2a')]);return _0x2a27da(_0x324652[_0xdbba('0x28')]['message']);}logger[_0xdbba('0x28')]('FaxMessage,\x20%s,\x20%s',_0x5d5720,_0x324652[_0xdbba('0x28')]['message']);return _0x117b17(_0x324652[_0xdbba('0x28')][_0xdbba('0x2a')]);}else{logger['info'](_0xdbba('0x23'),_0x5d5720,'request\x20sent');_0x117b17(_0x324652[_0xdbba('0x2b')][_0xdbba('0x2a')]);}})[_0xdbba('0x2c')](function(_0x3c9bf6){logger[_0xdbba('0x28')](_0xdbba('0x23'),_0x5d5720,_0x3c9bf6);_0x2a27da(_0x3c9bf6);});});}function respondWithStatusCode(_0x1f4c4a,_0x174fbb){_0x174fbb=_0x174fbb||0xcc;return function(_0x46be28){if(_0x46be28){return _0x1f4c4a[_0xdbba('0x2d')](_0x174fbb);}return _0x1f4c4a[_0xdbba('0x2e')](_0x174fbb)[_0xdbba('0x2f')]();};}function respondWithResult(_0x495c7e,_0x1360e1){_0x1360e1=_0x1360e1||0xc8;return function(_0x40104f){if(_0x40104f){return _0x495c7e['status'](_0x1360e1)['json'](_0x40104f);}};}function respondWithFilteredResult(_0x292996,_0x17a4fe){return function(_0x35ddca){if(_0x35ddca){var _0x451929=typeof _0x17a4fe[_0xdbba('0x30')]==='undefined'&&typeof _0x17a4fe[_0xdbba('0x31')]===_0xdbba('0x32');var _0x4b329a=_0x35ddca[_0xdbba('0x33')];var _0x46b671=_0x451929?0x0:_0x17a4fe[_0xdbba('0x30')];var _0x44651a=_0x451929?_0x35ddca[_0xdbba('0x33')]:_0x17a4fe[_0xdbba('0x30')]+_0x17a4fe[_0xdbba('0x31')];var _0x12c36d;if(_0x44651a>=_0x4b329a){_0x44651a=_0x4b329a;_0x12c36d=0xc8;}else{_0x12c36d=0xce;}_0x292996[_0xdbba('0x2e')](_0x12c36d);return _0x292996[_0xdbba('0x34')](_0xdbba('0x35'),_0x46b671+'-'+_0x44651a+'/'+_0x4b329a)['json'](_0x35ddca);}return null;};}function patchUpdates(_0x3dd597){return function(_0x5a0f8e){try{jsonpatch['apply'](_0x5a0f8e,_0x3dd597,!![]);}catch(_0x3ec2ae){return BPromise[_0xdbba('0x36')](_0x3ec2ae);}return _0x5a0f8e[_0xdbba('0x37')]();};}function saveUpdates(_0x47df4a,_0x2aa817){return function(_0x595c20){if(_0x595c20){return _0x595c20['update'](_0x47df4a)[_0xdbba('0x21')](function(_0x33abd7){return _0x33abd7;});}return null;};}function removeEntity(_0x104a83,_0xb66932){return function(_0x6dfb32){if(_0x6dfb32){return _0x6dfb32['destroy']()[_0xdbba('0x21')](function(){_0x104a83[_0xdbba('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x115afe,_0x1daad9){return function(_0x3d2687){if(!_0x3d2687){_0x115afe[_0xdbba('0x2d')](0x194);}return _0x3d2687;};}function handleError(_0x36e7a5,_0x288f89){_0x288f89=_0x288f89||0x1f4;return function(_0x34ddd5){logger[_0xdbba('0x28')](_0x34ddd5[_0xdbba('0x38')]);if(_0x34ddd5['name']){delete _0x34ddd5['name'];}_0x36e7a5[_0xdbba('0x2e')](_0x288f89)[_0xdbba('0x39')](_0x34ddd5);};}exports[_0xdbba('0x3a')]=function(_0x5c9dfd,_0x48dbab){var _0x135b88={},_0x42cf4a={},_0x4058ee={'count':0x0,'rows':[]};var _0x5cfee9=_[_0xdbba('0x3b')](db['FaxMessage'][_0xdbba('0x3c')],function(_0x5440ca){return{'name':_0x5440ca[_0xdbba('0x3d')],'type':_0x5440ca[_0xdbba('0x3e')]['key']};});_0x42cf4a[_0xdbba('0x3f')]=_['map'](_0x5cfee9,_0xdbba('0x40'));_0x42cf4a[_0xdbba('0x41')]=_[_0xdbba('0x42')](_0x5c9dfd[_0xdbba('0x41')]);_0x42cf4a[_0xdbba('0x43')]=_[_0xdbba('0x44')](_0x42cf4a[_0xdbba('0x3f')],_0x42cf4a[_0xdbba('0x41')]);_0x135b88[_0xdbba('0x45')]=_['intersection'](_0x42cf4a[_0xdbba('0x3f')],qs[_0xdbba('0x46')](_0x5c9dfd[_0xdbba('0x41')][_0xdbba('0x46')]));_0x135b88[_0xdbba('0x45')]=_0x135b88[_0xdbba('0x45')][_0xdbba('0x47')]?_0x135b88[_0xdbba('0x45')]:_0x42cf4a[_0xdbba('0x3f')];if(!_0x5c9dfd[_0xdbba('0x41')]['hasOwnProperty'](_0xdbba('0x48'))){_0x135b88[_0xdbba('0x31')]=qs[_0xdbba('0x31')](_0x5c9dfd['query'][_0xdbba('0x31')]);_0x135b88[_0xdbba('0x30')]=qs[_0xdbba('0x30')](_0x5c9dfd['query'][_0xdbba('0x30')]);}_0x135b88[_0xdbba('0x49')]=qs['sort'](_0x5c9dfd['query']['sort']);_0x135b88['where']=qs[_0xdbba('0x43')](_[_0xdbba('0x4a')](_0x5c9dfd[_0xdbba('0x41')],_0x42cf4a[_0xdbba('0x43')]),_0x5cfee9);if(_0x5c9dfd[_0xdbba('0x41')][_0xdbba('0x4b')]){_0x135b88[_0xdbba('0x4c')]=_[_0xdbba('0x4d')](_0x135b88[_0xdbba('0x4c')],{'$or':_[_0xdbba('0x3b')](_0x5cfee9,function(_0x10b640){if(_0x10b640['type']!==_0xdbba('0x4e')){var _0x6a1486={};_0x6a1486[_0x10b640[_0xdbba('0x40')]]={'$like':'%'+_0x5c9dfd[_0xdbba('0x41')][_0xdbba('0x4b')]+'%'};return _0x6a1486;}})});}_0x135b88=_[_0xdbba('0x4d')]({},_0x135b88,_0x5c9dfd['options']);var _0x5e9bac={'where':_0x135b88['where']};return db[_0xdbba('0x4f')][_0xdbba('0x33')](_0x5e9bac)[_0xdbba('0x21')](function(_0x22bea6){_0x4058ee[_0xdbba('0x33')]=_0x22bea6;if(_0x5c9dfd[_0xdbba('0x41')]['includeAll']){_0x135b88[_0xdbba('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0xdbba('0x51')](_0x135b88);})[_0xdbba('0x21')](function(_0x81fefe){_0x4058ee['rows']=_0x81fefe;return _0x4058ee;})[_0xdbba('0x21')](respondWithFilteredResult(_0x48dbab,_0x135b88))['catch'](handleError(_0x48dbab,null));};exports['show']=function(_0x5ee1eb,_0x56dbcf){var _0x42ecf6={'raw':!![],'where':{'id':_0x5ee1eb[_0xdbba('0x52')]['id']}},_0x271d40={};_0x271d40[_0xdbba('0x3f')]=_[_0xdbba('0x42')](db[_0xdbba('0x4f')][_0xdbba('0x3c')]);_0x271d40[_0xdbba('0x41')]=_['keys'](_0x5ee1eb['query']);_0x271d40[_0xdbba('0x43')]=_['intersection'](_0x271d40[_0xdbba('0x3f')],_0x271d40[_0xdbba('0x41')]);_0x42ecf6['attributes']=_[_0xdbba('0x44')](_0x271d40[_0xdbba('0x3f')],qs[_0xdbba('0x46')](_0x5ee1eb['query'][_0xdbba('0x46')]));_0x42ecf6[_0xdbba('0x45')]=_0x42ecf6[_0xdbba('0x45')][_0xdbba('0x47')]?_0x42ecf6[_0xdbba('0x45')]:_0x271d40['model'];if(_0x5ee1eb[_0xdbba('0x41')][_0xdbba('0x53')]){_0x42ecf6[_0xdbba('0x50')]=[{'all':!![]}];}_0x42ecf6=_[_0xdbba('0x4d')]({},_0x42ecf6,_0x5ee1eb[_0xdbba('0x54')]);return db[_0xdbba('0x4f')]['find'](_0x42ecf6)[_0xdbba('0x21')](handleEntityNotFound(_0x56dbcf,null))[_0xdbba('0x21')](respondWithResult(_0x56dbcf,null))[_0xdbba('0x2c')](handleError(_0x56dbcf,null));};exports[_0xdbba('0x55')]=function(_0x4f7397,_0x521dcf){if(_0x4f7397[_0xdbba('0x56')]['id']){delete _0x4f7397[_0xdbba('0x56')]['id'];}return db['FaxMessage'][_0xdbba('0x57')]({'where':{'id':_0x4f7397['params']['id']}})[_0xdbba('0x21')](handleEntityNotFound(_0x521dcf,null))[_0xdbba('0x21')](saveUpdates(_0x4f7397[_0xdbba('0x56')],null))[_0xdbba('0x21')](respondWithResult(_0x521dcf,null))[_0xdbba('0x2c')](handleError(_0x521dcf,null));};exports['destroy']=function(_0x449d37,_0x210c54){return db[_0xdbba('0x4f')][_0xdbba('0x57')]({'where':{'id':_0x449d37['params']['id']}})[_0xdbba('0x21')](handleEntityNotFound(_0x210c54,null))[_0xdbba('0x21')](removeEntity(_0x210c54,null))[_0xdbba('0x2c')](handleError(_0x210c54,null));};exports[_0xdbba('0x58')]=function(_0x26e1ab,_0xb715c9){return db[_0xdbba('0x4f')][_0xdbba('0x58')]()['then'](respondWithResult(_0xb715c9,null))[_0xdbba('0x2c')](handleError(_0xb715c9,null));};var interaction_log=require(_0xdbba('0x14'))(_0xdbba('0x59'));exports[_0xdbba('0x5a')]=function(_0x5989b5,_0xf46931,_0x200b4e){var _0x2c7443={'agent':{},'channel':_0xdbba('0x5b')};if(_0x5989b5[_0xdbba('0x56')]['id']){delete _0x5989b5[_0xdbba('0x56')]['id'];}_0x5989b5[_0xdbba('0x56')][_0xdbba('0x5c')]=!![];_0x5989b5[_0xdbba('0x56')][_0xdbba('0x5d')]=moment()[_0xdbba('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x5989b5[_0xdbba('0x56')]['UserId']=_0x5989b5[_0xdbba('0x56')]['UserId']||_0x5989b5[_0xdbba('0x5f')]['id'];_0x2c7443[_0xdbba('0x60')]['id']=_0x5989b5[_0xdbba('0x56')]['UserId'];return db['FaxMessage'][_0xdbba('0x57')]({'where':{'id':_0x5989b5[_0xdbba('0x52')]['id'],'UserId':null}})[_0xdbba('0x21')](handleEntityNotFound(_0xf46931,null))[_0xdbba('0x21')](saveUpdates(_0x5989b5['body'],null))[_0xdbba('0x21')](function(_0x5241b6){if(_0x5241b6){_0x2c7443[_0xdbba('0x2a')]=_0x5241b6['get']({'plain':!![]});return db[_0xdbba('0x61')]['find']({'where':{'id':_0x5241b6['FaxInteractionId']}});}return null;})[_0xdbba('0x21')](handleEntityNotFound(_0xf46931,null))[_0xdbba('0x21')](function(_0x588b69){if(_0x588b69){return _0x588b69[_0xdbba('0x55')]({'UserId':_0x5989b5['body']['UserId'],'read1stAt':_[_0xdbba('0x62')](_0x588b69[_0xdbba('0x63')])?moment()[_0xdbba('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdbba('0x21')](function(_0x1717d8){if(_0x1717d8){_0x2c7443['interaction']=_0x1717d8['get']({'plain':!![]});interaction_log[_0xdbba('0x22')](_0xdbba('0x64'),_0x5989b5[_0xdbba('0x5f')]['id'],_0x5989b5[_0xdbba('0x5f')]['name'],_0x5989b5[_0xdbba('0x5f')][_0xdbba('0x65')],_0x2c7443['interaction']['id'],_0x5989b5['body']?JSON[_0xdbba('0x27')](_0x5989b5[_0xdbba('0x56')]):'null');return respondWithRpcPromise('AcceptMessage',_0xdbba('0x66'),_0x2c7443);}return null;})[_0xdbba('0x21')](function(_0x5ea7bc){var _0x2b23b9=_0xdbba('0x67')+_0x5ea7bc[_0xdbba('0x2a')][_0xdbba('0x68')];return db['sequelize'][_0xdbba('0x41')](_0x2b23b9,{'type':db[_0xdbba('0x69')][_0xdbba('0x6a')][_0xdbba('0x6b')],'raw':!![]})[_0xdbba('0x21')](function(_0x2bb398){return _0x2bb398;});})[_0xdbba('0x21')](function(_0x417a23){if(_0x417a23){_0x2c7443[_0xdbba('0x2a')][_0xdbba('0x6c')]=_0x417a23[0x0];if(!_0x5989b5[_0xdbba('0x56')][_0xdbba('0x6d')])return;return db[_0xdbba('0x6e')][_0xdbba('0x57')]({'where':{'id':_0x5989b5[_0xdbba('0x56')][_0xdbba('0x6d')],'role':_0xdbba('0x60')},'attributes':['id',_0xdbba('0x40'),_0xdbba('0x6f'),'email',_0xdbba('0x70')],'raw':!![]});}return null;})[_0xdbba('0x21')](function(_0x56b3cb){if(!_0x56b3cb)return null;_0x2c7443['message'][_0xdbba('0x60')]=_0x56b3cb;return _0x2c7443;})['then'](function(_0x50bb35){if(_0x50bb35){if(_0x5989b5[_0xdbba('0x56')]['manual']){_0x2c7443[_0xdbba('0x2a')][_0xdbba('0x71')]=util['format'](_0xdbba('0x72'),_0x5989b5[_0xdbba('0x5f')]['name']);_0x2c7443[_0xdbba('0x2a')]['channel']=_0x2c7443[_0xdbba('0x73')];_0x2c7443[_0xdbba('0x2a')]['motionChannel']=_0x2c7443[_0xdbba('0x73')];_0x2c7443[_0xdbba('0x2a')][_0xdbba('0x74')]=_0xdbba('0x5a');return respondWithRpcPromise('EventManager',_0xdbba('0x75'),{'event':_0xdbba('0x76'),'message':_0x2c7443[_0xdbba('0x2a')]},client9002)['then'](function(){return _0x2c7443;});}return _0x2c7443;}return null;})['then'](respondWithResult(_0xf46931,null))[_0xdbba('0x2c')](handleError(_0xf46931,null));};var interaction_log=require(_0xdbba('0x14'))(_0xdbba('0x59'));exports[_0xdbba('0x36')]=function(_0x445bbd,_0x536bf6,_0x1cbaa3){var _0x4ae4b3={'agent':{},'channel':_0xdbba('0x5b')};if(_0x445bbd[_0xdbba('0x56')]['id']){delete _0x445bbd[_0xdbba('0x56')]['id'];}_0x445bbd[_0xdbba('0x56')][_0xdbba('0x6d')]=_0x445bbd[_0xdbba('0x56')][_0xdbba('0x6d')]||_0x445bbd[_0xdbba('0x5f')]['id'];_0x4ae4b3[_0xdbba('0x60')]['id']=_0x445bbd['body'][_0xdbba('0x6d')];return db['FaxMessage'][_0xdbba('0x57')]({'where':{'id':_0x445bbd[_0xdbba('0x52')]['id'],'UserId':null}})[_0xdbba('0x21')](handleEntityNotFound(_0x536bf6,null))[_0xdbba('0x21')](function(_0x1cb774){if(_0x1cb774){_0x4ae4b3[_0xdbba('0x2a')]=_0x1cb774[_0xdbba('0x77')]({'plain':!![]});return db['FaxInteraction'][_0xdbba('0x57')]({'where':{'id':_0x1cb774[_0xdbba('0x78')]}});}return null;})[_0xdbba('0x21')](handleEntityNotFound(_0x536bf6,null))[_0xdbba('0x21')](function(_0xf6e2a3){if(_0xf6e2a3){_0x4ae4b3[_0xdbba('0x79')]=_0xf6e2a3[_0xdbba('0x77')]({'plain':!![]});interaction_log['info'](_0xdbba('0x7a'),_0x445bbd['user']['id'],_0x445bbd[_0xdbba('0x5f')]['name'],_0x445bbd[_0xdbba('0x5f')][_0xdbba('0x65')],_0x4ae4b3[_0xdbba('0x79')]['id'],_0x445bbd[_0xdbba('0x56')]?JSON[_0xdbba('0x27')](_0x445bbd[_0xdbba('0x56')]):_0xdbba('0x7b'));return respondWithRpcPromise(_0xdbba('0x7c'),_0xdbba('0x7d'),_0x4ae4b3);}return null;})[_0xdbba('0x21')](function(_0xdbe9c7){var _0x59c7ca='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xdbe9c7['message'][_0xdbba('0x68')];return db[_0xdbba('0x7e')]['query'](_0x59c7ca,{'type':db[_0xdbba('0x69')]['QueryTypes'][_0xdbba('0x6b')],'raw':!![]})[_0xdbba('0x21')](function(_0x4d331e){return _0x4d331e;});})[_0xdbba('0x21')](function(_0x657be9){if(_0x657be9){_0x4ae4b3[_0xdbba('0x2a')][_0xdbba('0x6c')]=_0x657be9[0x0];if(!_0x445bbd[_0xdbba('0x56')]['UserId'])return;return db[_0xdbba('0x6e')]['find']({'where':{'id':_0x445bbd[_0xdbba('0x56')][_0xdbba('0x6d')],'role':'agent'},'attributes':['id','name',_0xdbba('0x6f'),_0xdbba('0x7f'),_0xdbba('0x70')],'raw':!![]});}return null;})[_0xdbba('0x21')](function(_0xfacb4){if(!_0xfacb4)return null;_0x4ae4b3[_0xdbba('0x2a')][_0xdbba('0x60')]=_0xfacb4;return _0x4ae4b3;})[_0xdbba('0x21')](function(_0x7cd17b){if(_0x7cd17b){_0x7cd17b[_0xdbba('0x2a')][_0xdbba('0x71')]=util[_0xdbba('0x5e')](_0xdbba('0x72'),_0x445bbd['user'][_0xdbba('0x40')]);_0x7cd17b[_0xdbba('0x2a')]['channel']=_0x4ae4b3['channel'];_0x7cd17b[_0xdbba('0x2a')][_0xdbba('0x80')]=_0x4ae4b3['channel'];_0x7cd17b[_0xdbba('0x2a')]['event']=_0xdbba('0x36');respondWithRpcPromise('EventManager',_0xdbba('0x75'),{'event':_0xdbba('0x81'),'message':_0x7cd17b[_0xdbba('0x2a')]},client9002);return _0x4ae4b3;}return null;})[_0xdbba('0x21')](respondWithResult(_0x536bf6,null))[_0xdbba('0x2c')](handleError(_0x536bf6,null));};exports[_0xdbba('0x82')]=function(_0x21b9b9,_0x50bdad){var _0x4087ee;return db[_0xdbba('0x4f')][_0xdbba('0x82')](_0x21b9b9['body'],{})['then'](function(_0x350680){_0x4087ee=_0x350680;return db[_0xdbba('0x83')][_0xdbba('0x84')]({'where':{'id':_0x4087ee[_0xdbba('0x68')]}});})[_0xdbba('0x21')](function(_0x22fd9f){if(_['isNil'](_0x22fd9f)){return;}else{_0x4087ee[_0xdbba('0x5b')]=_0x22fd9f[_0xdbba('0x5b')];return db[_0xdbba('0x85')]['findOne']({'where':{'id':_0x4087ee[_0xdbba('0x86')]}});}})[_0xdbba('0x21')](function(_0x2e56a8){return respondWithRpcPromise(_0xdbba('0x87'),_0xdbba('0x87'),{'FaxAccountId':_[_0xdbba('0x62')](_0x21b9b9[_0xdbba('0x56')])?undefined:_0x21b9b9[_0xdbba('0x56')][_0xdbba('0x88')],'path':_[_0xdbba('0x62')](_0x2e56a8)?undefined:util[_0xdbba('0x5e')]('/var/opt/motion2/server/files/attachments/%s',_0x2e56a8[_0xdbba('0x89')]),'fax':_[_0xdbba('0x62')](_0x4087ee['fax'])?undefined:_0x4087ee[_0xdbba('0x5b')],'AttachmentId':_0x4087ee[_0xdbba('0x86')]},client9002);})[_0xdbba('0x21')](respondWithResult(_0x50bdad,0xc9))[_0xdbba('0x2c')](handleError(_0x50bdad,null));};exports[_0xdbba('0x8a')]=function(_0x474c9b,_0x5a4a68){var _0x2769d1=path[_0xdbba('0x8b')](config['root'],_0xdbba('0x8c'),_0xdbba('0x8d'),_0xdbba('0x8e'));return db[_0xdbba('0x4f')]['find']({'where':{'id':_0x474c9b[_0xdbba('0x52')]['id']},'include':[{'model':db[_0xdbba('0x85')],'as':'Attachment'}]})[_0xdbba('0x21')](handleEntityNotFound(_0x5a4a68,null))['then'](function(_0x34981a){if(_0x34981a){return _0x5a4a68[_0xdbba('0x8a')](path[_0xdbba('0x8b')](_0x2769d1,_0x34981a[_0xdbba('0x85')][_0xdbba('0x89')]));}})[_0xdbba('0x2c')](handleError(_0x5a4a68,null));}; \ No newline at end of file +var _0xc152=['bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','FaxMessage','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','sequelize','Sequelize','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','create','findOne','Attachment','SendFax','FaxAccountId','basename','download','join','root','server','attachments','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x206751,_0x4d343c){var _0x5d6cfe=function(_0x513b68){while(--_0x513b68){_0x206751['push'](_0x206751['shift']());}};_0x5d6cfe(++_0x4d343c);}(_0xc152,0x1a2));var _0x2c15=function(_0x2d9a8d,_0x21b8ea){_0x2d9a8d=_0x2d9a8d-0x0;var _0x11039e=_0xc152[_0x2d9a8d];return _0x11039e;};'use strict';var emlformat=require(_0x2c15('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c15('0x1'));var jsonpatch=require(_0x2c15('0x2'));var rp=require(_0x2c15('0x3'));var moment=require(_0x2c15('0x4'));var BPromise=require(_0x2c15('0x5'));var Mustache=require('mustache');var util=require(_0x2c15('0x6'));var path=require(_0x2c15('0x7'));var sox=require(_0x2c15('0x8'));var csv=require(_0x2c15('0x9'));var ejs=require(_0x2c15('0xa'));var fs=require('fs');var fs_extra=require(_0x2c15('0xb'));var _=require(_0x2c15('0xc'));var squel=require(_0x2c15('0xd'));var crypto=require(_0x2c15('0xe'));var jsforce=require(_0x2c15('0xf'));var deskjs=require(_0x2c15('0x10'));var toCsv=require(_0x2c15('0x9'));var querystring=require(_0x2c15('0x11'));var Papa=require('papaparse');var Redis=require(_0x2c15('0x12'));var authService=require(_0x2c15('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2c15('0x14'));var hardwareService=require(_0x2c15('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x2c15('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2c15('0x17'));var db=require('../../mysqldb')['db'];config[_0x2c15('0x18')]=_[_0x2c15('0x19')](config[_0x2c15('0x18')],{'host':_0x2c15('0x1a'),'port':0x18eb});var socket=require(_0x2c15('0x1b'))(new Redis(config[_0x2c15('0x18')]));require(_0x2c15('0x1c'))[_0x2c15('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2c15('0x1e')][_0x2c15('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x453ca9,_0x334eee,_0xde99f5,_0x331df1){return new BPromise(function(_0x2376f8,_0x48b2ea){var _0xaa6eee=_0x331df1||client;return _0xaa6eee[_0x2c15('0x20')](_0x453ca9,_0xde99f5)[_0x2c15('0x21')](function(_0x19bb70){logger['info'](_0x2c15('0x22'),_0x334eee,'request\x20sent');logger[_0x2c15('0x23')](_0x2c15('0x24'),_0x334eee,_0x2c15('0x25'),JSON[_0x2c15('0x26')](_0x19bb70));if(_0x19bb70[_0x2c15('0x27')]){if(_0x19bb70['error'][_0x2c15('0x28')]===0x1f4){logger['error'](_0x2c15('0x22'),_0x334eee,_0x19bb70[_0x2c15('0x27')][_0x2c15('0x29')]);return _0x48b2ea(_0x19bb70[_0x2c15('0x27')][_0x2c15('0x29')]);}logger[_0x2c15('0x27')]('FaxMessage,\x20%s,\x20%s',_0x334eee,_0x19bb70[_0x2c15('0x27')][_0x2c15('0x29')]);return _0x2376f8(_0x19bb70[_0x2c15('0x27')][_0x2c15('0x29')]);}else{logger[_0x2c15('0x2a')](_0x2c15('0x22'),_0x334eee,_0x2c15('0x25'));_0x2376f8(_0x19bb70[_0x2c15('0x2b')][_0x2c15('0x29')]);}})[_0x2c15('0x2c')](function(_0x4c896e){logger['error'](_0x2c15('0x22'),_0x334eee,_0x4c896e);_0x48b2ea(_0x4c896e);});});}function respondWithStatusCode(_0x31a8df,_0x4b9db9){_0x4b9db9=_0x4b9db9||0xcc;return function(_0xeaf1e){if(_0xeaf1e){return _0x31a8df[_0x2c15('0x2d')](_0x4b9db9);}return _0x31a8df[_0x2c15('0x2e')](_0x4b9db9)[_0x2c15('0x2f')]();};}function respondWithResult(_0x2e5f19,_0x2b08ea){_0x2b08ea=_0x2b08ea||0xc8;return function(_0x177331){if(_0x177331){return _0x2e5f19[_0x2c15('0x2e')](_0x2b08ea)['json'](_0x177331);}};}function respondWithFilteredResult(_0x15ced9,_0x13f93f){return function(_0x235338){if(_0x235338){var _0xfc0fb9=typeof _0x13f93f['offset']==='undefined'&&typeof _0x13f93f['limit']===_0x2c15('0x30');var _0x97a289=_0x235338[_0x2c15('0x31')];var _0x4c8b6e=_0xfc0fb9?0x0:_0x13f93f[_0x2c15('0x32')];var _0x13db31=_0xfc0fb9?_0x235338[_0x2c15('0x31')]:_0x13f93f[_0x2c15('0x32')]+_0x13f93f[_0x2c15('0x33')];var _0x37cd1a;if(_0x13db31>=_0x97a289){_0x13db31=_0x97a289;_0x37cd1a=0xc8;}else{_0x37cd1a=0xce;}_0x15ced9[_0x2c15('0x2e')](_0x37cd1a);return _0x15ced9[_0x2c15('0x34')](_0x2c15('0x35'),_0x4c8b6e+'-'+_0x13db31+'/'+_0x97a289)[_0x2c15('0x36')](_0x235338);}return null;};}function patchUpdates(_0x26489a){return function(_0x55d9cd){try{jsonpatch[_0x2c15('0x37')](_0x55d9cd,_0x26489a,!![]);}catch(_0x53ffb4){return BPromise[_0x2c15('0x38')](_0x53ffb4);}return _0x55d9cd[_0x2c15('0x39')]();};}function saveUpdates(_0x3465a0,_0x449f75){return function(_0x551c4f){if(_0x551c4f){return _0x551c4f[_0x2c15('0x3a')](_0x3465a0)[_0x2c15('0x21')](function(_0x199292){return _0x199292;});}return null;};}function removeEntity(_0x2b4b9e,_0x39e0bf){return function(_0x3b7afd){if(_0x3b7afd){return _0x3b7afd[_0x2c15('0x3b')]()[_0x2c15('0x21')](function(){_0x2b4b9e[_0x2c15('0x2e')](0xcc)[_0x2c15('0x2f')]();});}};}function handleEntityNotFound(_0x5336b9,_0x2a8234){return function(_0x286c0d){if(!_0x286c0d){_0x5336b9['sendStatus'](0x194);}return _0x286c0d;};}function handleError(_0x1d7662,_0x2e0aa7){_0x2e0aa7=_0x2e0aa7||0x1f4;return function(_0x2b0e08){logger['error'](_0x2b0e08['stack']);if(_0x2b0e08['name']){delete _0x2b0e08[_0x2c15('0x3c')];}_0x1d7662[_0x2c15('0x2e')](_0x2e0aa7)['send'](_0x2b0e08);};}exports['index']=function(_0x5c97b0,_0x45a4bf){var _0x22305b={},_0x52e140={},_0x539852={'count':0x0,'rows':[]};var _0x5e4c91=_['map'](db[_0x2c15('0x3d')][_0x2c15('0x3e')],function(_0x2a0d48){return{'name':_0x2a0d48[_0x2c15('0x3f')],'type':_0x2a0d48[_0x2c15('0x40')][_0x2c15('0x41')]};});_0x52e140[_0x2c15('0x42')]=_[_0x2c15('0x43')](_0x5e4c91,_0x2c15('0x3c'));_0x52e140[_0x2c15('0x44')]=_['keys'](_0x5c97b0[_0x2c15('0x44')]);_0x52e140[_0x2c15('0x45')]=_['intersection'](_0x52e140[_0x2c15('0x42')],_0x52e140[_0x2c15('0x44')]);_0x22305b[_0x2c15('0x46')]=_[_0x2c15('0x47')](_0x52e140[_0x2c15('0x42')],qs[_0x2c15('0x48')](_0x5c97b0[_0x2c15('0x44')][_0x2c15('0x48')]));_0x22305b[_0x2c15('0x46')]=_0x22305b['attributes'][_0x2c15('0x49')]?_0x22305b['attributes']:_0x52e140[_0x2c15('0x42')];if(!_0x5c97b0['query'][_0x2c15('0x4a')](_0x2c15('0x4b'))){_0x22305b[_0x2c15('0x33')]=qs[_0x2c15('0x33')](_0x5c97b0[_0x2c15('0x44')][_0x2c15('0x33')]);_0x22305b['offset']=qs['offset'](_0x5c97b0[_0x2c15('0x44')][_0x2c15('0x32')]);}_0x22305b['order']=qs['sort'](_0x5c97b0[_0x2c15('0x44')]['sort']);_0x22305b['where']=qs[_0x2c15('0x45')](_[_0x2c15('0x4c')](_0x5c97b0[_0x2c15('0x44')],_0x52e140[_0x2c15('0x45')]),_0x5e4c91);if(_0x5c97b0[_0x2c15('0x44')]['filter']){_0x22305b[_0x2c15('0x4d')]=_[_0x2c15('0x4e')](_0x22305b['where'],{'$or':_['map'](_0x5e4c91,function(_0x34bc7b){if(_0x34bc7b[_0x2c15('0x40')]!==_0x2c15('0x4f')){var _0x294873={};_0x294873[_0x34bc7b[_0x2c15('0x3c')]]={'$like':'%'+_0x5c97b0['query']['filter']+'%'};return _0x294873;}})});}_0x22305b=_['merge']({},_0x22305b,_0x5c97b0[_0x2c15('0x50')]);var _0x10728a={'where':_0x22305b[_0x2c15('0x4d')]};return db[_0x2c15('0x3d')][_0x2c15('0x31')](_0x10728a)[_0x2c15('0x21')](function(_0x16552c){_0x539852[_0x2c15('0x31')]=_0x16552c;if(_0x5c97b0[_0x2c15('0x44')][_0x2c15('0x51')]){_0x22305b[_0x2c15('0x52')]=[{'all':!![]}];}return db[_0x2c15('0x3d')][_0x2c15('0x53')](_0x22305b);})[_0x2c15('0x21')](function(_0x4e916b){_0x539852[_0x2c15('0x54')]=_0x4e916b;return _0x539852;})['then'](respondWithFilteredResult(_0x45a4bf,_0x22305b))[_0x2c15('0x2c')](handleError(_0x45a4bf,null));};exports[_0x2c15('0x55')]=function(_0x2c77b5,_0xb8d2f0){var _0x57a4df={'raw':!![],'where':{'id':_0x2c77b5['params']['id']}},_0x5b8a85={};_0x5b8a85[_0x2c15('0x42')]=_['keys'](db[_0x2c15('0x3d')][_0x2c15('0x3e')]);_0x5b8a85['query']=_[_0x2c15('0x56')](_0x2c77b5[_0x2c15('0x44')]);_0x5b8a85[_0x2c15('0x45')]=_[_0x2c15('0x47')](_0x5b8a85[_0x2c15('0x42')],_0x5b8a85[_0x2c15('0x44')]);_0x57a4df[_0x2c15('0x46')]=_[_0x2c15('0x47')](_0x5b8a85[_0x2c15('0x42')],qs['fields'](_0x2c77b5[_0x2c15('0x44')][_0x2c15('0x48')]));_0x57a4df[_0x2c15('0x46')]=_0x57a4df[_0x2c15('0x46')][_0x2c15('0x49')]?_0x57a4df['attributes']:_0x5b8a85[_0x2c15('0x42')];if(_0x2c77b5[_0x2c15('0x44')]['includeAll']){_0x57a4df['include']=[{'all':!![]}];}_0x57a4df=_['merge']({},_0x57a4df,_0x2c77b5['options']);return db['FaxMessage'][_0x2c15('0x57')](_0x57a4df)[_0x2c15('0x21')](handleEntityNotFound(_0xb8d2f0,null))['then'](respondWithResult(_0xb8d2f0,null))['catch'](handleError(_0xb8d2f0,null));};exports[_0x2c15('0x3a')]=function(_0x1ce8c1,_0x14eedd){if(_0x1ce8c1[_0x2c15('0x58')]['id']){delete _0x1ce8c1[_0x2c15('0x58')]['id'];}return db[_0x2c15('0x3d')][_0x2c15('0x57')]({'where':{'id':_0x1ce8c1[_0x2c15('0x59')]['id']}})[_0x2c15('0x21')](handleEntityNotFound(_0x14eedd,null))[_0x2c15('0x21')](saveUpdates(_0x1ce8c1[_0x2c15('0x58')],null))['then'](respondWithResult(_0x14eedd,null))[_0x2c15('0x2c')](handleError(_0x14eedd,null));};exports[_0x2c15('0x3b')]=function(_0x26abca,_0x4c603f){return db[_0x2c15('0x3d')][_0x2c15('0x57')]({'where':{'id':_0x26abca['params']['id']}})['then'](handleEntityNotFound(_0x4c603f,null))[_0x2c15('0x21')](removeEntity(_0x4c603f,null))[_0x2c15('0x2c')](handleError(_0x4c603f,null));};exports[_0x2c15('0x5a')]=function(_0x3384e8,_0x2a8679){return db['FaxMessage']['describe']()[_0x2c15('0x21')](respondWithResult(_0x2a8679,null))[_0x2c15('0x2c')](handleError(_0x2a8679,null));};var interaction_log=require(_0x2c15('0x5b'))(_0x2c15('0x5c'));exports[_0x2c15('0x5d')]=function(_0xcf79a6,_0x126408,_0xd5ab26){var _0x1d9069={'agent':{},'channel':_0x2c15('0x5e')};if(_0xcf79a6['body']['id']){delete _0xcf79a6[_0x2c15('0x58')]['id'];}_0xcf79a6['body'][_0x2c15('0x5f')]=!![];_0xcf79a6[_0x2c15('0x58')][_0x2c15('0x60')]=moment()[_0x2c15('0x61')](_0x2c15('0x62'));_0xcf79a6[_0x2c15('0x58')][_0x2c15('0x63')]=_0xcf79a6[_0x2c15('0x58')][_0x2c15('0x63')]||_0xcf79a6[_0x2c15('0x64')]['id'];_0x1d9069['agent']['id']=_0xcf79a6[_0x2c15('0x58')][_0x2c15('0x63')];return db[_0x2c15('0x3d')][_0x2c15('0x57')]({'where':{'id':_0xcf79a6[_0x2c15('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x126408,null))[_0x2c15('0x21')](saveUpdates(_0xcf79a6[_0x2c15('0x58')],null))['then'](function(_0x52ffa3){if(_0x52ffa3){_0x1d9069[_0x2c15('0x29')]=_0x52ffa3[_0x2c15('0x65')]({'plain':!![]});return db[_0x2c15('0x66')][_0x2c15('0x57')]({'where':{'id':_0x52ffa3['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x126408,null))[_0x2c15('0x21')](function(_0x3ef960){if(_0x3ef960){return _0x3ef960['update']({'UserId':_0xcf79a6[_0x2c15('0x58')]['UserId'],'read1stAt':_[_0x2c15('0x67')](_0x3ef960[_0x2c15('0x68')])?moment()[_0x2c15('0x61')](_0x2c15('0x62')):undefined});}return null;})[_0x2c15('0x21')](function(_0x11e726){if(_0x11e726){_0x1d9069[_0x2c15('0x69')]=_0x11e726[_0x2c15('0x65')]({'plain':!![]});interaction_log[_0x2c15('0x2a')](_0x2c15('0x6a'),_0xcf79a6['user']['id'],_0xcf79a6[_0x2c15('0x64')][_0x2c15('0x3c')],_0xcf79a6[_0x2c15('0x64')][_0x2c15('0x6b')],_0x1d9069[_0x2c15('0x69')]['id'],_0xcf79a6['body']?JSON[_0x2c15('0x26')](_0xcf79a6[_0x2c15('0x58')]):_0x2c15('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x2c15('0x6d'),_0x1d9069);}return null;})[_0x2c15('0x21')](function(_0xdc0890){var _0x179511='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xdc0890['message']['ContactId'];return db[_0x2c15('0x6e')]['query'](_0x179511,{'type':db[_0x2c15('0x6f')]['QueryTypes'][_0x2c15('0x70')],'raw':!![]})[_0x2c15('0x21')](function(_0x521210){return _0x521210;});})[_0x2c15('0x21')](function(_0x18731a){if(_0x18731a){_0x1d9069[_0x2c15('0x29')][_0x2c15('0x71')]=_0x18731a[0x0];if(!_0xcf79a6[_0x2c15('0x58')][_0x2c15('0x63')])return;return db[_0x2c15('0x72')][_0x2c15('0x57')]({'where':{'id':_0xcf79a6[_0x2c15('0x58')][_0x2c15('0x63')],'role':_0x2c15('0x73')},'attributes':['id',_0x2c15('0x3c'),_0x2c15('0x74'),_0x2c15('0x75'),_0x2c15('0x76')],'raw':!![]});}return null;})[_0x2c15('0x21')](function(_0x5d2ddd){if(!_0x5d2ddd)return null;_0x1d9069[_0x2c15('0x29')]['agent']=_0x5d2ddd;return _0x1d9069;})[_0x2c15('0x21')](function(_0x111c84){if(_0x111c84){if(_0xcf79a6[_0x2c15('0x58')][_0x2c15('0x77')]){_0x1d9069['message'][_0x2c15('0x78')]=util['format'](_0x2c15('0x79'),_0xcf79a6[_0x2c15('0x64')][_0x2c15('0x3c')]);_0x1d9069[_0x2c15('0x29')][_0x2c15('0x7a')]=_0x1d9069[_0x2c15('0x7a')];_0x1d9069[_0x2c15('0x29')][_0x2c15('0x7b')]=_0x1d9069[_0x2c15('0x7a')];_0x1d9069[_0x2c15('0x29')]['event']=_0x2c15('0x5d');return respondWithRpcPromise(_0x2c15('0x7c'),'EventManager',{'event':_0x2c15('0x7d'),'message':_0x1d9069[_0x2c15('0x29')]},client9002)[_0x2c15('0x21')](function(){return _0x1d9069;});}return _0x1d9069;}return null;})[_0x2c15('0x21')](respondWithResult(_0x126408,null))[_0x2c15('0x2c')](handleError(_0x126408,null));};var interaction_log=require(_0x2c15('0x5b'))(_0x2c15('0x5c'));exports[_0x2c15('0x38')]=function(_0x5b75b7,_0x31dd57,_0x28fb94){var _0x41ecb5={'agent':{},'channel':_0x2c15('0x5e')};if(_0x5b75b7[_0x2c15('0x58')]['id']){delete _0x5b75b7[_0x2c15('0x58')]['id'];}_0x5b75b7[_0x2c15('0x58')]['UserId']=_0x5b75b7[_0x2c15('0x58')]['UserId']||_0x5b75b7[_0x2c15('0x64')]['id'];_0x41ecb5[_0x2c15('0x73')]['id']=_0x5b75b7[_0x2c15('0x58')]['UserId'];return db[_0x2c15('0x3d')][_0x2c15('0x57')]({'where':{'id':_0x5b75b7[_0x2c15('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x31dd57,null))[_0x2c15('0x21')](function(_0x3093b9){if(_0x3093b9){_0x41ecb5[_0x2c15('0x29')]=_0x3093b9['get']({'plain':!![]});return db['FaxInteraction'][_0x2c15('0x57')]({'where':{'id':_0x3093b9['FaxInteractionId']}});}return null;})[_0x2c15('0x21')](handleEntityNotFound(_0x31dd57,null))[_0x2c15('0x21')](function(_0x2cb1d3){if(_0x2cb1d3){_0x41ecb5[_0x2c15('0x69')]=_0x2cb1d3[_0x2c15('0x65')]({'plain':!![]});interaction_log[_0x2c15('0x2a')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5b75b7[_0x2c15('0x64')]['id'],_0x5b75b7[_0x2c15('0x64')][_0x2c15('0x3c')],_0x5b75b7[_0x2c15('0x64')][_0x2c15('0x6b')],_0x41ecb5[_0x2c15('0x69')]['id'],_0x5b75b7['body']?JSON[_0x2c15('0x26')](_0x5b75b7[_0x2c15('0x58')]):_0x2c15('0x6c'));return respondWithRpcPromise(_0x2c15('0x7e'),'rejectMessage',_0x41ecb5);}return null;})['then'](function(_0x589624){var _0xf2dd75=_0x2c15('0x7f')+_0x589624[_0x2c15('0x29')][_0x2c15('0x80')];return db[_0x2c15('0x6e')][_0x2c15('0x44')](_0xf2dd75,{'type':db[_0x2c15('0x6f')][_0x2c15('0x81')]['SELECT'],'raw':!![]})[_0x2c15('0x21')](function(_0x18f34e){return _0x18f34e;});})[_0x2c15('0x21')](function(_0x561ae7){if(_0x561ae7){_0x41ecb5[_0x2c15('0x29')][_0x2c15('0x71')]=_0x561ae7[0x0];if(!_0x5b75b7['body'][_0x2c15('0x63')])return;return db['User']['find']({'where':{'id':_0x5b75b7[_0x2c15('0x58')][_0x2c15('0x63')],'role':_0x2c15('0x73')},'attributes':['id',_0x2c15('0x3c'),_0x2c15('0x74'),_0x2c15('0x75'),_0x2c15('0x76')],'raw':!![]});}return null;})[_0x2c15('0x21')](function(_0x1f01df){if(!_0x1f01df)return null;_0x41ecb5[_0x2c15('0x29')][_0x2c15('0x73')]=_0x1f01df;return _0x41ecb5;})[_0x2c15('0x21')](function(_0x4aea30){if(_0x4aea30){_0x4aea30[_0x2c15('0x29')]['interface']=util[_0x2c15('0x61')](_0x2c15('0x79'),_0x5b75b7['user']['name']);_0x4aea30[_0x2c15('0x29')][_0x2c15('0x7a')]=_0x41ecb5['channel'];_0x4aea30[_0x2c15('0x29')]['motionChannel']=_0x41ecb5['channel'];_0x4aea30[_0x2c15('0x29')]['event']=_0x2c15('0x38');respondWithRpcPromise('EventManager',_0x2c15('0x7c'),{'event':'rejectmessage','message':_0x4aea30[_0x2c15('0x29')]},client9002);return _0x41ecb5;}return null;})['then'](respondWithResult(_0x31dd57,null))[_0x2c15('0x2c')](handleError(_0x31dd57,null));};exports[_0x2c15('0x82')]=function(_0x1a7794,_0x4508a1){var _0x517be1;return db[_0x2c15('0x3d')][_0x2c15('0x82')](_0x1a7794[_0x2c15('0x58')],{})[_0x2c15('0x21')](function(_0x26ddeb){_0x517be1=_0x26ddeb;return db['CmContact'][_0x2c15('0x83')]({'where':{'id':_0x517be1[_0x2c15('0x80')]}});})[_0x2c15('0x21')](function(_0x5c9957){if(_[_0x2c15('0x67')](_0x5c9957)){return;}else{_0x517be1['fax']=_0x5c9957['fax'];return db[_0x2c15('0x84')][_0x2c15('0x83')]({'where':{'id':_0x517be1['AttachmentId']}});}})[_0x2c15('0x21')](function(_0x3bfda9){return respondWithRpcPromise(_0x2c15('0x85'),_0x2c15('0x85'),{'FaxAccountId':_[_0x2c15('0x67')](_0x1a7794['body'])?undefined:_0x1a7794['body'][_0x2c15('0x86')],'path':_['isNil'](_0x3bfda9)?undefined:util[_0x2c15('0x61')]('/var/opt/motion2/server/files/attachments/%s',_0x3bfda9[_0x2c15('0x87')]),'fax':_[_0x2c15('0x67')](_0x517be1[_0x2c15('0x5e')])?undefined:_0x517be1[_0x2c15('0x5e')],'AttachmentId':_0x517be1['AttachmentId']},client9002);})['then'](respondWithResult(_0x4508a1,0xc9))[_0x2c15('0x2c')](handleError(_0x4508a1,null));};exports[_0x2c15('0x88')]=function(_0x13b365,_0x3db157){var _0x3c53a1=path[_0x2c15('0x89')](config[_0x2c15('0x8a')],_0x2c15('0x8b'),'files',_0x2c15('0x8c'));return db['FaxMessage'][_0x2c15('0x57')]({'where':{'id':_0x13b365[_0x2c15('0x59')]['id']},'include':[{'model':db[_0x2c15('0x84')],'as':_0x2c15('0x84')}]})['then'](handleEntityNotFound(_0x3db157,null))[_0x2c15('0x21')](function(_0x4b4034){if(_0x4b4034){return _0x3db157['download'](path[_0x2c15('0x89')](_0x3c53a1,_0x4b4034[_0x2c15('0x84')][_0x2c15('0x87')]));}})['catch'](handleError(_0x3db157,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index f6ed07b..050c86d 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 _0x6faf=['FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x48712a,_0x178341){var _0x3c36f1=function(_0x322d66){while(--_0x322d66){_0x48712a['push'](_0x48712a['shift']());}};_0x3c36f1(++_0x178341);}(_0x6faf,0xf9));var _0xf6fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6faf[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xf6fa('0x0'))['db'][_0xf6fa('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xf6fa('0x2')](0x0);var events={'afterCreate':_0xf6fa('0x3'),'afterUpdate':_0xf6fa('0x4'),'afterDestroy':_0xf6fa('0x5')};function emitEvent(_0x4f1f7a){return function(_0x243626,_0x4c2fda,_0xed8c6b){FaxMessageEvents['emit'](_0x4f1f7a+':'+_0x243626['id'],_0x243626);FaxMessageEvents[_0xf6fa('0x6')](_0x4f1f7a,_0x243626);_0xed8c6b(null);};}for(var e in events){if(events[_0xf6fa('0x7')](e)){var event=events[e];FaxMessage[_0xf6fa('0x8')](e,emitEvent(event));}}module[_0xf6fa('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x7ed1=['emit','exports','events','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x582d8d,_0x13fce1){var _0x35c6fd=function(_0x36b1ec){while(--_0x36b1ec){_0x582d8d['push'](_0x582d8d['shift']());}};_0x35c6fd(++_0x13fce1);}(_0x7ed1,0xca));var _0x17ed=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x7ed1[_0x5cb1af];return _0x8d7940;};'use strict';var EventEmitter=require(_0x17ed('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x17ed('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x17ed('0x2')](0x0);var events={'afterCreate':_0x17ed('0x3'),'afterUpdate':_0x17ed('0x4'),'afterDestroy':_0x17ed('0x5')};function emitEvent(_0x3dc540){return function(_0x54bf1f,_0x2fdcd3,_0x7b29db){FaxMessageEvents[_0x17ed('0x6')](_0x3dc540+':'+_0x54bf1f['id'],_0x54bf1f);FaxMessageEvents[_0x17ed('0x6')](_0x3dc540,_0x54bf1f);_0x7b29db(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x17ed('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 0b04cb0..b1e9f48 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 _0xfbe4=['update','createdAt','direction','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fti_fax_messages','toLowerCase','secret','UserId','FaxInteraction'];(function(_0x2ed091,_0x2d504b){var _0xa7e658=function(_0xc46dc5){while(--_0xc46dc5){_0x2ed091['push'](_0x2ed091['shift']());}};_0xa7e658(++_0x2d504b);}(_0xfbe4,0x66));var _0x4fbe=function(_0x23ed9b,_0x312447){_0x23ed9b=_0x23ed9b-0x0;var _0x47adda=_0xfbe4[_0x23ed9b];return _0x47adda;};'use strict';var _=require(_0x4fbe('0x0'));var util=require(_0x4fbe('0x1'));var logger=require(_0x4fbe('0x2'))(_0x4fbe('0x3'));var moment=require(_0x4fbe('0x4'));var BPromise=require(_0x4fbe('0x5'));var rp=require(_0x4fbe('0x6'));var fs=require('fs');var path=require(_0x4fbe('0x7'));var rimraf=require(_0x4fbe('0x8'));var config=require(_0x4fbe('0x9'));var attributes=require(_0x4fbe('0xa'));module['exports']=function(_0x53a99d,_0x2bcdd7){return _0x53a99d[_0x4fbe('0xb')](_0x4fbe('0xc'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x4fbe('0xd'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2dfabc,_0x4c0aa3,_0x13c4b8){var _0x52e58f=_0x53a99d['models'];var _0x5dc602=_0x2dfabc['get']({'plain':!![]});if(_0x5dc602['direction'][_0x4fbe('0xe')]()==='in'||_0x5dc602['direction'][_0x4fbe('0xe')]()==='out'&&!_0x5dc602[_0x4fbe('0xf')]&&!_['isNil'](_0x5dc602[_0x4fbe('0x10')])){_0x52e58f[_0x4fbe('0x11')]['findOne']({'where':{'id':_0x5dc602['FaxInteractionId']}})['then'](function(_0x254127){if(_0x254127){_0x254127[_0x4fbe('0x12')]({'lastMsgAt':_0x5dc602[_0x4fbe('0x13')],'lastMsgDirection':_0x5dc602[_0x4fbe('0x14')][_0x4fbe('0xe')]()});}})[_0x4fbe('0x15')](function(_0x5a9df3){console[_0x4fbe('0x16')](_0x5a9df3);});}_0x13c4b8();}},'charset':'utf8mb4','collate':_0x4fbe('0x17')});}; \ No newline at end of file +var _0xfda5=['findOne','FaxInteractionId','update','catch','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','FaxMessage','fti_fax_messages','models','get','toLowerCase','direction','secret','isNil','UserId','FaxInteraction'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xfda5,0x164));var _0x5fda=function(_0x1d8b5f,_0x1d0e91){_0x1d8b5f=_0x1d8b5f-0x0;var _0x12c5b1=_0xfda5[_0x1d8b5f];return _0x12c5b1;};'use strict';var _=require('lodash');var util=require(_0x5fda('0x0'));var logger=require(_0x5fda('0x1'))(_0x5fda('0x2'));var moment=require(_0x5fda('0x3'));var BPromise=require(_0x5fda('0x4'));var rp=require(_0x5fda('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5fda('0x6'));var config=require(_0x5fda('0x7'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0xac2690,_0x148793){return _0xac2690[_0x5fda('0x8')](_0x5fda('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x5fda('0xa'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x569026,_0x4444a3,_0x1759d3){var _0x4cbd53=_0xac2690[_0x5fda('0xb')];var _0x5d811e=_0x569026[_0x5fda('0xc')]({'plain':!![]});if(_0x5d811e['direction'][_0x5fda('0xd')]()==='in'||_0x5d811e[_0x5fda('0xe')][_0x5fda('0xd')]()==='out'&&!_0x5d811e[_0x5fda('0xf')]&&!_[_0x5fda('0x10')](_0x5d811e[_0x5fda('0x11')])){_0x4cbd53[_0x5fda('0x12')][_0x5fda('0x13')]({'where':{'id':_0x5d811e[_0x5fda('0x14')]}})['then'](function(_0x4c637c){if(_0x4c637c){_0x4c637c[_0x5fda('0x15')]({'lastMsgAt':_0x5d811e['createdAt'],'lastMsgDirection':_0x5d811e[_0x5fda('0xe')][_0x5fda('0xd')]()});}})[_0x5fda('0x16')](function(_0x57da5c){console[_0x5fda('0x17')](_0x57da5c);});}_0x1759d3();}},'charset':_0x5fda('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 3a11242..ecf0db4 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 _0x9c44=['code','message','info','catch','FaxMessage','create','body','options','CreateFaxMessage','stringify','UpdateFaxMessage','update','raw','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});config[_0x49c4('0x9')]=_[_0x49c4('0xa')](config[_0x49c4('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x49c4('0xb'))(new Redis(config[_0x49c4('0x9')]));require(_0x49c4('0xc'))[_0x49c4('0xd')](socket);function respondWithRpcPromise(_0x4c7d3a,_0x5ab4a3,_0x451ea6){return new BPromise(function(_0x313e73,_0x58cad7){return client[_0x49c4('0xe')](_0x4c7d3a,_0x451ea6)[_0x49c4('0xf')](function(_0x4adb3c){logger['info'](_0x49c4('0x10'),_0x5ab4a3,_0x49c4('0x11'));logger['debug'](_0x49c4('0x12'),_0x5ab4a3,_0x49c4('0x11'),JSON['stringify'](_0x4adb3c));if(_0x4adb3c[_0x49c4('0x13')]){if(_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x14')]===0x1f4){logger[_0x49c4('0x13')](_0x49c4('0x10'),_0x5ab4a3,_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x15')]);return _0x58cad7(_0x4adb3c[_0x49c4('0x13')]['message']);}logger[_0x49c4('0x13')](_0x49c4('0x10'),_0x5ab4a3,_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x15')]);return _0x313e73(_0x4adb3c[_0x49c4('0x13')]['message']);}else{logger[_0x49c4('0x16')](_0x49c4('0x10'),_0x5ab4a3,'request\x20sent');_0x313e73(_0x4adb3c['result'][_0x49c4('0x15')]);}})[_0x49c4('0x17')](function(_0x3addb2){logger['error'](_0x49c4('0x10'),_0x5ab4a3,_0x3addb2);_0x58cad7(_0x3addb2);});});}exports['CreateFaxMessage']=function(_0x2cbd50){var _0x1806c2=this;return new Promise(function(_0xe31fcc,_0x291526){return db[_0x49c4('0x18')][_0x49c4('0x19')](_0x2cbd50[_0x49c4('0x1a')],{'raw':_0x2cbd50[_0x49c4('0x1b')]?_0x2cbd50[_0x49c4('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x57f502){logger[_0x49c4('0x16')]('CreateFaxMessage',_0x2cbd50);logger['debug'](_0x49c4('0x1c'),_0x2cbd50,JSON[_0x49c4('0x1d')](_0x57f502));_0xe31fcc(_0x57f502);})[_0x49c4('0x17')](function(_0xd335e4){logger['error']('CreateFaxMessage',_0xd335e4[_0x49c4('0x15')],_0x2cbd50);_0x291526(_0x1806c2[_0x49c4('0x13')](0x1f4,_0xd335e4['message']));});});};exports[_0x49c4('0x1e')]=function(_0x43e014){var _0x210159=this;return new Promise(function(_0xa7a826,_0x531d92){return db['FaxMessage'][_0x49c4('0x1f')](_0x43e014['body'],{'raw':_0x43e014[_0x49c4('0x1b')]?_0x43e014[_0x49c4('0x1b')][_0x49c4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43e014[_0x49c4('0x1b')]?_0x43e014['options'][_0x49c4('0x21')]||null:null,'attributes':_0x43e014[_0x49c4('0x1b')]?_0x43e014[_0x49c4('0x1b')][_0x49c4('0x22')]||null:null,'limit':_0x43e014[_0x49c4('0x1b')]?_0x43e014[_0x49c4('0x1b')][_0x49c4('0x23')]||null:null})[_0x49c4('0xf')](function(_0x17b50f){logger[_0x49c4('0x16')](_0x49c4('0x1e'),_0x43e014);logger['debug']('UpdateFaxMessage',_0x43e014,JSON['stringify'](_0x17b50f));_0xa7a826(_0x17b50f);})[_0x49c4('0x17')](function(_0x7ee704){logger[_0x49c4('0x13')](_0x49c4('0x1e'),_0x7ee704[_0x49c4('0x15')],_0x43e014);_0x531d92(_0x210159['error'](0x1f4,_0x7ee704[_0x49c4('0x15')]));});});}; \ No newline at end of file +var _0x032e=['FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','where','attributes','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0x188e76,_0x516271){var _0x515514=function(_0x4580d9){while(--_0x4580d9){_0x188e76['push'](_0x188e76['shift']());}};_0x515514(++_0x516271);}(_0x032e,0x124));var _0xe032=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x032e[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});config[_0xe032('0xb')]=_[_0xe032('0xc')](config[_0xe032('0xb')],{'host':_0xe032('0xd'),'port':0x18eb});var socket=require(_0xe032('0xe'))(new Redis(config[_0xe032('0xb')]));require(_0xe032('0xf'))[_0xe032('0x10')](socket);function respondWithRpcPromise(_0x2dc9e5,_0x167bd9,_0x4aec53){return new BPromise(function(_0x1382e1,_0x1ce2ae){return client[_0xe032('0x11')](_0x2dc9e5,_0x4aec53)[_0xe032('0x12')](function(_0x244f93){logger[_0xe032('0x13')](_0xe032('0x14'),_0x167bd9,'request\x20sent');logger[_0xe032('0x15')](_0xe032('0x16'),_0x167bd9,_0xe032('0x17'),JSON[_0xe032('0x18')](_0x244f93));if(_0x244f93['error']){if(_0x244f93[_0xe032('0x19')][_0xe032('0x1a')]===0x1f4){logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1ce2ae(_0x244f93[_0xe032('0x19')]['message']);}logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1382e1(_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);}else{logger['info'](_0xe032('0x14'),_0x167bd9,_0xe032('0x17'));_0x1382e1(_0x244f93[_0xe032('0x1c')][_0xe032('0x1b')]);}})[_0xe032('0x1d')](function(_0x5721ce){logger['error']('FaxMessage,\x20%s,\x20%s',_0x167bd9,_0x5721ce);_0x1ce2ae(_0x5721ce);});});}exports[_0xe032('0x1e')]=function(_0x505d8c){var _0x46dc27=this;return new Promise(function(_0x4608e4,_0x3f0257){return db[_0xe032('0x1f')][_0xe032('0x20')](_0x505d8c[_0xe032('0x21')],{'raw':_0x505d8c[_0xe032('0x22')]?_0x505d8c['options'][_0xe032('0x23')]===undefined?!![]:![]:!![]})[_0xe032('0x12')](function(_0x232e8f){logger[_0xe032('0x13')](_0xe032('0x1e'),_0x505d8c);logger[_0xe032('0x15')](_0xe032('0x1e'),_0x505d8c,JSON[_0xe032('0x18')](_0x232e8f));_0x4608e4(_0x232e8f);})['catch'](function(_0x4f1aa3){logger['error'](_0xe032('0x1e'),_0x4f1aa3[_0xe032('0x1b')],_0x505d8c);_0x3f0257(_0x46dc27[_0xe032('0x19')](0x1f4,_0x4f1aa3[_0xe032('0x1b')]));});});};exports[_0xe032('0x24')]=function(_0x200671){var _0x36ece7=this;return new Promise(function(_0x2b6ffa,_0x4dcbf1){return db[_0xe032('0x1f')]['update'](_0x200671[_0xe032('0x21')],{'raw':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200671['options']?_0x200671['options'][_0xe032('0x25')]||null:null,'attributes':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x26')]||null:null,'limit':_0x200671['options']?_0x200671['options']['limit']||null:null})[_0xe032('0x12')](function(_0x1dd34f){logger[_0xe032('0x13')](_0xe032('0x24'),_0x200671);logger['debug'](_0xe032('0x24'),_0x200671,JSON[_0xe032('0x18')](_0x1dd34f));_0x2b6ffa(_0x1dd34f);})[_0xe032('0x1d')](function(_0x4348f8){logger[_0xe032('0x19')]('UpdateFaxMessage',_0x4348f8[_0xe032('0x1b')],_0x200671);_0x4dcbf1(_0x36ece7[_0xe032('0x19')](0x1f4,_0x4348f8[_0xe032('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index d7c8ed7..7c72663 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 _0xde53=['remove','update','emit','register','faxMessage:','save'];(function(_0x42e3c0,_0x569faa){var _0x341485=function(_0x2ee142){while(--_0x2ee142){_0x42e3c0['push'](_0x42e3c0['shift']());}};_0x341485(++_0x569faa);}(_0xde53,0x8f));var _0x3de5=function(_0x29aa84,_0x25a260){_0x29aa84=_0x29aa84-0x0;var _0x46cc12=_0xde53[_0x29aa84];return _0x46cc12;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x3de5('0x0'),_0x3de5('0x1'),_0x3de5('0x2')];function createListener(_0x2c8a0a,_0x1609d4){return function(_0x2e48f2){_0x1609d4[_0x3de5('0x3')](_0x2c8a0a,_0x2e48f2);};}function removeListener(_0x448ba3,_0x2f6729){return function(){FaxMessageEvents['removeListener'](_0x448ba3,_0x2f6729);};}exports[_0x3de5('0x4')]=function(_0x52226d){for(var _0x525fd7=0x0,_0x5f4cf4=events['length'];_0x525fd7<_0x5f4cf4;_0x525fd7++){var _0x1e59c4=events[_0x525fd7];var _0x4a6cfd=createListener(_0x3de5('0x5')+_0x1e59c4,_0x52226d);FaxMessageEvents['on'](_0x1e59c4,_0x4a6cfd);}}; \ No newline at end of file +var _0x457c=['save','remove','removeListener','register','length','faxMessage:','./faxMessage.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x457c,0x16b));var _0xc457=function(_0x3df469,_0x56983a){_0x3df469=_0x3df469-0x0;var _0xccf99=_0x457c[_0x3df469];return _0xccf99;};'use strict';var FaxMessageEvents=require(_0xc457('0x0'));var events=[_0xc457('0x1'),_0xc457('0x2'),'update'];function createListener(_0x2133d3,_0x2d4ddb){return function(_0x68a947){_0x2d4ddb['emit'](_0x2133d3,_0x68a947);};}function removeListener(_0x2c9943,_0x2c37de){return function(){FaxMessageEvents[_0xc457('0x3')](_0x2c9943,_0x2c37de);};}exports[_0xc457('0x4')]=function(_0x4e3238){for(var _0x37e48b=0x0,_0x98e427=events[_0xc457('0x5')];_0x37e48b<_0x98e427;_0x37e48b++){var _0x2b3655=events[_0x37e48b];var _0x1e230e=createListener(_0xc457('0x6')+_0x2b3655,_0x4e3238);FaxMessageEvents['on'](_0x2b3655,_0x1e230e);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 5ebf3b9..dab9e60 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 _0x91a7=['isAuthenticated','/:id','show','download','tracked','fax','faxmessage:create','create','put','update','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','./faxMessage.controller','get','index','/describe'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x91a7,0xe7));var _0x791a=function(_0x5f296f,_0x41e34d){_0x5f296f=_0x5f296f-0x0;var _0x4a517e=_0x91a7[_0x5f296f];return _0x4a517e;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0x6')]('/:id/download',auth[_0x791a('0x9')](),controller[_0x791a('0xc')]);router['post']('/',auth[_0x791a('0x9')](),interaction[_0x791a('0xd')](_0x791a('0xe'),_0x791a('0xf')),controller[_0x791a('0x10')]);router[_0x791a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x791a('0x12')]);router[_0x791a('0x11')]('/:id/accept',auth[_0x791a('0x9')](),controller[_0x791a('0x13')]);router['put'](_0x791a('0x14'),auth[_0x791a('0x9')](),controller[_0x791a('0x15')]);router[_0x791a('0x16')]('/:id',auth[_0x791a('0x9')](),controller['destroy']);module[_0x791a('0x17')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xe43eea,_0x577840){var _0x28a66d=function(_0x48d6b2){while(--_0x48d6b2){_0xe43eea['push'](_0xe43eea['shift']());}};_0x28a66d(++_0x577840);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')]('/',auth['isAuthenticated'](),interaction[_0x3071('0x11')](_0x3071('0x12'),_0x3071('0x13')),controller[_0x3071('0x14')]);router[_0x3071('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x3071('0x16')]);router['put'](_0x3071('0x17'),auth[_0x3071('0x9')](),controller['accept']);router[_0x3071('0x15')]('/:id/reject',auth[_0x3071('0x9')](),controller[_0x3071('0x18')]);router[_0x3071('0x19')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x1a')]);module[_0x3071('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index e153ad4..3dd6586 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 _0x2dcc=['name','INTEGER','beepall','roundrobin','sequelize','STRING'];(function(_0x250e42,_0x383888){var _0xa56f07=function(_0x37387){while(--_0x37387){_0x250e42['push'](_0x250e42['shift']());}};_0xa56f07(++_0x383888);}(_0x2dcc,0x88));var _0xc2dc=function(_0x43b082,_0x289297){_0x43b082=_0x43b082-0x0;var _0x40bde9=_0x2dcc[_0x43b082];return _0x40bde9;};'use strict';var Sequelize=require(_0xc2dc('0x0'));module['exports']={'name':{'type':Sequelize[_0xc2dc('0x1')],'unique':_0xc2dc('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc2dc('0x1')]},'timeout':{'type':Sequelize[_0xc2dc('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xc2dc('0x4'),_0xc2dc('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xcedf=['name','INTEGER','ENUM','roundrobin','sequelize','exports','STRING'];(function(_0x5bde14,_0x561394){var _0x2b4e8f=function(_0x135de7){while(--_0x135de7){_0x5bde14['push'](_0x5bde14['shift']());}};_0x2b4e8f(++_0x561394);}(_0xcedf,0x1b6));var _0xfced=function(_0x141c20,_0x21c9ad){_0x141c20=_0x141c20-0x0;var _0x4b914d=_0xcedf[_0x141c20];return _0x4b914d;};'use strict';var Sequelize=require(_0xfced('0x0'));module[_0xfced('0x1')]={'name':{'type':Sequelize[_0xfced('0x2')],'unique':_0xfced('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfced('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfced('0x5')]('rrmemory','beepall',_0xfced('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'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 a7c4150..2597940 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 _0x6863=['send','index','FaxQueue','rawAttributes','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','type','includeAll','include','catch','show','length','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','describe','getMembers','UserFaxQueue','nolimit','order','FaxQueueId','options','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','faxPause','findOne','Team','getTeams','ids','Agents','flatMap','transaction','addTeams','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','every','TeamId','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','spread','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','get','FaxQueues','end','error','stack','name'];(function(_0xacb4ac,_0x3a47a8){var _0xb84099=function(_0x375952){while(--_0x375952){_0xacb4ac['push'](_0xacb4ac['shift']());}};_0xb84099(++_0x3a47a8);}(_0x6863,0x168));var _0x3686=function(_0x2e0687,_0x400ea5){_0x2e0687=_0x2e0687-0x0;var _0x7232a=_0x6863[_0x2e0687];return _0x7232a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3686('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3686('0x1'));var rp=require(_0x3686('0x2'));var moment=require(_0x3686('0x3'));var BPromise=require(_0x3686('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3686('0x5'));var csv=require(_0x3686('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3686('0x7'));var _=require(_0x3686('0x8'));var squel=require(_0x3686('0x9'));var crypto=require(_0x3686('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3686('0xb'));var toCsv=require(_0x3686('0x6'));var querystring=require(_0x3686('0xc'));var Papa=require(_0x3686('0xd'));var Redis=require('ioredis');var authService=require(_0x3686('0xe'));var qs=require(_0x3686('0xf'));var as=require(_0x3686('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3686('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x3686('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3686('0x13')]=_[_0x3686('0x14')](config[_0x3686('0x13')],{'host':_0x3686('0x15'),'port':0x18eb});var socket=require(_0x3686('0x16'))(new Redis(config[_0x3686('0x13')]));require(_0x3686('0x17'))[_0x3686('0x18')](socket);function respondWithStatusCode(_0x57ea34,_0x16b8f6){_0x16b8f6=_0x16b8f6||0xcc;return function(_0x2a0b8e){if(_0x2a0b8e){return _0x57ea34[_0x3686('0x19')](_0x16b8f6);}return _0x57ea34[_0x3686('0x1a')](_0x16b8f6)['end']();};}function respondWithResult(_0x5408ff,_0x57ac69){_0x57ac69=_0x57ac69||0xc8;return function(_0x3764b3){if(_0x3764b3){return _0x5408ff[_0x3686('0x1a')](_0x57ac69)['json'](_0x3764b3);}};}function respondWithFilteredResult(_0x26d261,_0x1df7bd){return function(_0x38c6fd){if(_0x38c6fd){var _0x1815c7=typeof _0x1df7bd[_0x3686('0x1b')]==='undefined'&&typeof _0x1df7bd['limit']===_0x3686('0x1c');var _0x375ada=_0x38c6fd[_0x3686('0x1d')];var _0x2ae6d4=_0x1815c7?0x0:_0x1df7bd[_0x3686('0x1b')];var _0x517adb=_0x1815c7?_0x38c6fd[_0x3686('0x1d')]:_0x1df7bd[_0x3686('0x1b')]+_0x1df7bd[_0x3686('0x1e')];var _0x2540cc;if(_0x517adb>=_0x375ada){_0x517adb=_0x375ada;_0x2540cc=0xc8;}else{_0x2540cc=0xce;}_0x26d261['status'](_0x2540cc);return _0x26d261[_0x3686('0x1f')](_0x3686('0x20'),_0x2ae6d4+'-'+_0x517adb+'/'+_0x375ada)[_0x3686('0x21')](_0x38c6fd);}return null;};}function patchUpdates(_0xc269d0){return function(_0x385ade){try{jsonpatch[_0x3686('0x22')](_0x385ade,_0xc269d0,!![]);}catch(_0x584658){return BPromise[_0x3686('0x23')](_0x584658);}return _0x385ade[_0x3686('0x24')]();};}function saveUpdates(_0x5273d0,_0x403bde){return function(_0x2655c4){if(_0x2655c4){return _0x2655c4[_0x3686('0x25')](_0x5273d0)[_0x3686('0x26')](function(_0x34f8c9){return _0x34f8c9;});}return null;};}function removeEntity(_0x598bdf,_0x6c7b28){return function(_0x4932a8){if(_0x4932a8){return _0x4932a8['destroy']()[_0x3686('0x26')](function(){var _0x399af2=_0x4932a8[_0x3686('0x27')]({'plain':!![]});var _0x45501c=_0x3686('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x45501c,'resourceId':_0x399af2['id']}})[_0x3686('0x26')](function(){return _0x4932a8;});})['then'](function(){_0x598bdf[_0x3686('0x1a')](0xcc)[_0x3686('0x29')]();});}};}function handleEntityNotFound(_0x8b4ef,_0x19f988){return function(_0x388fe7){if(!_0x388fe7){_0x8b4ef[_0x3686('0x19')](0x194);}return _0x388fe7;};}function handleError(_0xe80eca,_0x363ac5){_0x363ac5=_0x363ac5||0x1f4;return function(_0x4fe52e){logger[_0x3686('0x2a')](_0x4fe52e[_0x3686('0x2b')]);if(_0x4fe52e[_0x3686('0x2c')]){delete _0x4fe52e[_0x3686('0x2c')];}_0xe80eca['status'](_0x363ac5)[_0x3686('0x2d')](_0x4fe52e);};}exports[_0x3686('0x2e')]=function(_0x1a5778,_0x3ced52){var _0x2ead8f={},_0x37586e={},_0x537e2c={'count':0x0,'rows':[]};var _0x5bf845=_['map'](db[_0x3686('0x2f')][_0x3686('0x30')],function(_0x155a9e){return{'name':_0x155a9e['fieldName'],'type':_0x155a9e['type']['key']};});_0x37586e[_0x3686('0x31')]=_[_0x3686('0x32')](_0x5bf845,_0x3686('0x2c'));_0x37586e[_0x3686('0x33')]=_[_0x3686('0x34')](_0x1a5778['query']);_0x37586e[_0x3686('0x35')]=_[_0x3686('0x36')](_0x37586e[_0x3686('0x31')],_0x37586e['query']);_0x2ead8f['attributes']=_[_0x3686('0x36')](_0x37586e[_0x3686('0x31')],qs['fields'](_0x1a5778['query'][_0x3686('0x37')]));_0x2ead8f[_0x3686('0x38')]=_0x2ead8f[_0x3686('0x38')]['length']?_0x2ead8f[_0x3686('0x38')]:_0x37586e['model'];if(!_0x1a5778[_0x3686('0x33')][_0x3686('0x39')]('nolimit')){_0x2ead8f[_0x3686('0x1e')]=qs[_0x3686('0x1e')](_0x1a5778[_0x3686('0x33')]['limit']);_0x2ead8f[_0x3686('0x1b')]=qs[_0x3686('0x1b')](_0x1a5778[_0x3686('0x33')][_0x3686('0x1b')]);}_0x2ead8f['order']=qs[_0x3686('0x3a')](_0x1a5778[_0x3686('0x33')][_0x3686('0x3a')]);_0x2ead8f[_0x3686('0x3b')]=qs[_0x3686('0x35')](_[_0x3686('0x3c')](_0x1a5778[_0x3686('0x33')],_0x37586e[_0x3686('0x35')]),_0x5bf845);if(_0x1a5778[_0x3686('0x33')][_0x3686('0x3d')]){_0x2ead8f[_0x3686('0x3b')]=_[_0x3686('0x3e')](_0x2ead8f[_0x3686('0x3b')],{'$or':_[_0x3686('0x32')](_0x5bf845,function(_0x20f3f7){if(_0x20f3f7[_0x3686('0x3f')]!=='VIRTUAL'){var _0x147c79={};_0x147c79[_0x20f3f7[_0x3686('0x2c')]]={'$like':'%'+_0x1a5778['query'][_0x3686('0x3d')]+'%'};return _0x147c79;}})});}_0x2ead8f=_[_0x3686('0x3e')]({},_0x2ead8f,_0x1a5778['options']);var _0xa19f98={'where':_0x2ead8f['where']};return db['FaxQueue'][_0x3686('0x1d')](_0xa19f98)[_0x3686('0x26')](function(_0x5af137){_0x537e2c[_0x3686('0x1d')]=_0x5af137;if(_0x1a5778[_0x3686('0x33')][_0x3686('0x40')]){_0x2ead8f[_0x3686('0x41')]=[{'all':!![]}];}return db[_0x3686('0x2f')]['findAll'](_0x2ead8f);})['then'](function(_0x1c3380){_0x537e2c['rows']=_0x1c3380;return _0x537e2c;})[_0x3686('0x26')](respondWithFilteredResult(_0x3ced52,_0x2ead8f))[_0x3686('0x42')](handleError(_0x3ced52,null));};exports[_0x3686('0x43')]=function(_0x4ba255,_0x2f1685){var _0x25c41f={'raw':!![],'where':{'id':_0x4ba255['params']['id']}},_0x11c9cd={};_0x11c9cd[_0x3686('0x31')]=_[_0x3686('0x34')](db[_0x3686('0x2f')][_0x3686('0x30')]);_0x11c9cd[_0x3686('0x33')]=_[_0x3686('0x34')](_0x4ba255['query']);_0x11c9cd['filters']=_['intersection'](_0x11c9cd[_0x3686('0x31')],_0x11c9cd[_0x3686('0x33')]);_0x25c41f['attributes']=_[_0x3686('0x36')](_0x11c9cd[_0x3686('0x31')],qs[_0x3686('0x37')](_0x4ba255['query'][_0x3686('0x37')]));_0x25c41f[_0x3686('0x38')]=_0x25c41f[_0x3686('0x38')][_0x3686('0x44')]?_0x25c41f[_0x3686('0x38')]:_0x11c9cd['model'];if(_0x4ba255[_0x3686('0x33')][_0x3686('0x40')]){_0x25c41f[_0x3686('0x41')]=[{'all':!![]}];}_0x25c41f=_['merge']({},_0x25c41f,_0x4ba255['options']);return db[_0x3686('0x2f')][_0x3686('0x45')](_0x25c41f)[_0x3686('0x26')](handleEntityNotFound(_0x2f1685,null))['then'](respondWithResult(_0x2f1685,null))[_0x3686('0x42')](handleError(_0x2f1685,null));};exports['create']=function(_0x1755e2,_0x245735){return db[_0x3686('0x2f')]['create'](_0x1755e2['body'],{})[_0x3686('0x26')](function(_0x2bdaf6){var _0x47ad53=_0x1755e2[_0x3686('0x46')][_0x3686('0x27')]({'plain':!![]});if(!_0x47ad53)throw new Error(_0x3686('0x47'));if(_0x47ad53[_0x3686('0x48')]===_0x3686('0x46')){var _0x516d3c=_0x2bdaf6[_0x3686('0x27')]({'plain':!![]});var _0x4bb58b=_0x3686('0x28');return db[_0x3686('0x49')][_0x3686('0x45')]({'where':{'name':_0x4bb58b,'userProfileId':_0x47ad53['userProfileId']},'raw':!![]})['then'](function(_0x492ac7){if(_0x492ac7&&_0x492ac7[_0x3686('0x4a')]===0x0){return db[_0x3686('0x4b')][_0x3686('0x4c')]({'name':_0x516d3c[_0x3686('0x2c')],'resourceId':_0x516d3c['id'],'type':_0x492ac7[_0x3686('0x2c')],'sectionId':_0x492ac7['id']},{})[_0x3686('0x26')](function(){return _0x2bdaf6;});}else{return _0x2bdaf6;}})[_0x3686('0x42')](function(_0x192e6f){logger[_0x3686('0x2a')](_0x3686('0x4d'),_0x192e6f);throw _0x192e6f;});}return _0x2bdaf6;})[_0x3686('0x26')](respondWithResult(_0x245735,0xc9))['catch'](handleError(_0x245735,null));};exports['update']=function(_0x54987c,_0x5b9e07){if(_0x54987c['body']['id']){delete _0x54987c[_0x3686('0x4e')]['id'];}return db[_0x3686('0x2f')][_0x3686('0x45')]({'where':{'id':_0x54987c[_0x3686('0x4f')]['id']}})[_0x3686('0x26')](handleEntityNotFound(_0x5b9e07,null))[_0x3686('0x26')](saveUpdates(_0x54987c['body'],null))[_0x3686('0x26')](respondWithResult(_0x5b9e07,null))[_0x3686('0x42')](handleError(_0x5b9e07,null));};exports[_0x3686('0x50')]=function(_0x59a348,_0x21bed5){return db[_0x3686('0x2f')][_0x3686('0x45')]({'where':{'id':_0x59a348[_0x3686('0x4f')]['id']}})[_0x3686('0x26')](handleEntityNotFound(_0x21bed5,null))[_0x3686('0x26')](removeEntity(_0x21bed5,null))[_0x3686('0x42')](handleError(_0x21bed5,null));};exports[_0x3686('0x51')]=function(_0x2ba54d,_0x430f27){return db['FaxQueue']['describe']()['then'](respondWithResult(_0x430f27,null))[_0x3686('0x42')](handleError(_0x430f27,null));};exports[_0x3686('0x52')]=function(_0x45dc64,_0x576965,_0x5b74ab){var _0x2dd3ca={'raw':!![],'where':{}},_0x40a76b={},_0x33d840;return db['FaxQueue']['findOne']({'where':{'id':_0x45dc64[_0x3686('0x4f')]['id']}})[_0x3686('0x26')](handleEntityNotFound(_0x576965,null))[_0x3686('0x26')](function(_0x197bd0){if(_0x197bd0){_0x33d840=_0x197bd0[_0x3686('0x27')]({'plain':!![]});_0x40a76b['model']=_[_0x3686('0x34')](db[_0x3686('0x53')][_0x3686('0x30')]);_0x40a76b[_0x3686('0x33')]=_['keys'](_0x45dc64[_0x3686('0x33')]);_0x40a76b[_0x3686('0x35')]=_['intersection'](_0x40a76b[_0x3686('0x31')],_0x40a76b[_0x3686('0x33')]);_0x2dd3ca[_0x3686('0x38')]=_['intersection'](_0x40a76b[_0x3686('0x31')],qs['fields'](_0x45dc64[_0x3686('0x33')][_0x3686('0x37')]));_0x2dd3ca[_0x3686('0x38')]=_0x2dd3ca[_0x3686('0x38')][_0x3686('0x44')]?_0x2dd3ca[_0x3686('0x38')]:_0x40a76b['model'];if(!_0x45dc64['query'][_0x3686('0x39')](_0x3686('0x54'))){_0x2dd3ca[_0x3686('0x1e')]=qs[_0x3686('0x1e')](_0x45dc64[_0x3686('0x33')][_0x3686('0x1e')]);_0x2dd3ca[_0x3686('0x1b')]=qs[_0x3686('0x1b')](_0x45dc64[_0x3686('0x33')]['offset']);}_0x2dd3ca[_0x3686('0x55')]=qs[_0x3686('0x3a')](_0x45dc64['query']['sort']);_0x2dd3ca[_0x3686('0x3b')]=qs['filters'](_[_0x3686('0x3c')](_0x45dc64[_0x3686('0x33')],_0x40a76b['filters']));_0x2dd3ca['where'][_0x3686('0x56')]=_0x197bd0['id'];if(_0x45dc64[_0x3686('0x33')][_0x3686('0x3d')]){_0x2dd3ca[_0x3686('0x3b')]=_[_0x3686('0x3e')](_0x2dd3ca[_0x3686('0x3b')],{'$or':_[_0x3686('0x32')](_0x2dd3ca[_0x3686('0x38')],function(_0x32ed6e){var _0x120260={};_0x120260[_0x32ed6e]={'$like':'%'+_0x45dc64[_0x3686('0x33')][_0x3686('0x3d')]+'%'};return _0x120260;})});}_0x2dd3ca=_[_0x3686('0x3e')]({},_0x2dd3ca,_0x45dc64[_0x3686('0x57')]);return db[_0x3686('0x53')][_0x3686('0x58')](_0x2dd3ca);}})[_0x3686('0x26')](function(_0x4323d0){if(_0x4323d0){return db[_0x3686('0x59')][_0x3686('0x5a')]({'where':{'id':_['map'](_0x4323d0,_0x3686('0x5b')),'role':_0x3686('0x5c')},'attributes':['id',_0x3686('0x2c'),'faxPause',_0x3686('0x5d'),_0x3686('0x5e')]});}})['then'](function(_0x5887f8){if(_0x5887f8){return{'count':_0x5887f8['count'],'rows':_[_0x3686('0x32')](_0x5887f8[_0x3686('0x5f')],function(_0x4481ef){return{'membername':_0x4481ef[_0x3686('0x2c')],'UserId':_0x4481ef['id'],'queue_name':_0x33d840['name'],'FaxQueueId':_0x33d840['id'],'interface':util[_0x3686('0x60')]('%s/%s','SIP',_0x4481ef[_0x3686('0x2c')]),'penalty':0x0,'paused':_0x4481ef[_0x3686('0x61')],'createdAt':_0x4481ef['createdAt'],'updatedAt':_0x4481ef[_0x3686('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x576965,_0x2dd3ca))[_0x3686('0x42')](handleError(_0x576965,null));};exports['getTeams']=function(_0x45c473,_0x1d224f,_0x2e314d){var _0x5aa224={};var _0x280ccf={};var _0x269082;var _0x489dd6;return db[_0x3686('0x2f')][_0x3686('0x62')]({'where':{'id':_0x45c473[_0x3686('0x4f')]['id']}})[_0x3686('0x26')](handleEntityNotFound(_0x1d224f,null))[_0x3686('0x26')](function(_0x459b74){if(_0x459b74){_0x269082=_0x459b74;_0x280ccf['model']=_[_0x3686('0x34')](db[_0x3686('0x63')]['rawAttributes']);_0x280ccf[_0x3686('0x33')]=_[_0x3686('0x34')](_0x45c473['query']);_0x280ccf[_0x3686('0x35')]=_['intersection'](_0x280ccf[_0x3686('0x31')],_0x280ccf[_0x3686('0x33')]);_0x5aa224[_0x3686('0x38')]=_[_0x3686('0x36')](_0x280ccf['model'],qs[_0x3686('0x37')](_0x45c473[_0x3686('0x33')][_0x3686('0x37')]));_0x5aa224[_0x3686('0x38')]=_0x5aa224[_0x3686('0x38')][_0x3686('0x44')]?_0x5aa224[_0x3686('0x38')]:_0x280ccf[_0x3686('0x31')];_0x5aa224[_0x3686('0x55')]=qs[_0x3686('0x3a')](_0x45c473['query'][_0x3686('0x3a')]);_0x5aa224[_0x3686('0x3b')]=qs['filters'](_[_0x3686('0x3c')](_0x45c473['query'],_0x280ccf[_0x3686('0x35')]));if(_0x45c473[_0x3686('0x33')][_0x3686('0x3d')]){_0x5aa224[_0x3686('0x3b')]=_[_0x3686('0x3e')](_0x5aa224['where'],{'$or':_['map'](_0x5aa224[_0x3686('0x38')],function(_0x946c5f){var _0x4f0daf={};_0x4f0daf[_0x946c5f]={'$like':'%'+_0x45c473[_0x3686('0x33')]['filter']+'%'};return _0x4f0daf;})});}_0x5aa224=_[_0x3686('0x3e')]({},_0x5aa224,_0x45c473[_0x3686('0x57')]);return _0x269082[_0x3686('0x64')](_0x5aa224);}})[_0x3686('0x26')](function(_0x90c6fe){if(_0x90c6fe){_0x489dd6=_0x90c6fe[_0x3686('0x44')];if(!_0x45c473['query'][_0x3686('0x39')](_0x3686('0x54'))){_0x5aa224[_0x3686('0x1e')]=qs[_0x3686('0x1e')](_0x45c473['query'][_0x3686('0x1e')]);_0x5aa224[_0x3686('0x1b')]=qs[_0x3686('0x1b')](_0x45c473[_0x3686('0x33')][_0x3686('0x1b')]);}return _0x269082['getTeams'](_0x5aa224);}})[_0x3686('0x26')](function(_0x2de4f7){if(_0x2de4f7){return _0x2de4f7?{'count':_0x489dd6,'rows':_0x2de4f7}:null;}})[_0x3686('0x26')](respondWithResult(_0x1d224f,null))[_0x3686('0x42')](handleError(_0x1d224f,null));};exports['addTeams']=function(_0x201720,_0x21ca05,_0x20203b){var _0x2c3125=_0x201720[_0x3686('0x4e')][_0x3686('0x65')];return db['Team']['findAll']({'where':{'id':_0x2c3125},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3686('0x66'),'attributes':['id',_0x3686('0x2c'),'online','voicePause','interface'],'raw':!![]}]})[_0x3686('0x26')](function(_0x5de011){if(_0x5de011){var _0x3b6982=_[_0x3686('0x67')](_0x5de011,function(_0x458950){var _0x292f39=_0x458950['get']({'plain':!![]});return _0x292f39['Agents'];});return db['FaxQueue']['find']({'where':{'id':_0x201720[_0x3686('0x4f')]['id']}})[_0x3686('0x26')](function(_0x3159ff){return db['sequelize'][_0x3686('0x68')](function(_0x525a8d){return _0x3159ff[_0x3686('0x69')](_0x2c3125,{'transaction':_0x525a8d})[_0x3686('0x26')](function(){return BPromise['each'](_0x3b6982,function(_0x5eabc4){return db['UserFaxQueue'][_0x3686('0x6a')]({'where':{'UserId':_0x5eabc4['id'],'FaxQueueId':_0x201720[_0x3686('0x4f')]['id']},'transaction':_0x525a8d});});})[_0x3686('0x26')](function(){_0x3b6982[_0x3686('0x6b')](function(_0x25ad5b){socket[_0x3686('0x6c')](_0x3686('0x6d'),{'UserId':_0x25ad5b['id'],'FaxQueueId':_0x3159ff['id']});});});});});}})[_0x3686('0x26')](respondWithStatusCode(_0x21ca05,null))[_0x3686('0x42')](handleError(_0x21ca05,null));};exports[_0x3686('0x6e')]=function(_0x174581,_0x4760a2,_0x511b08){return db[_0x3686('0x63')][_0x3686('0x58')]({'where':{'id':_0x174581[_0x3686('0x33')][_0x3686('0x65')]},'attributes':['id'],'include':[{'model':db[_0x3686('0x59')],'as':_0x3686('0x66'),'attributes':['id'],'raw':!![]}]})[_0x3686('0x26')](handleEntityNotFound(_0x4760a2,null))[_0x3686('0x26')](function(_0xace2b0){var _0x5a397c=_[_0x3686('0x32')](_0xace2b0,'id');var _0x3392d9=[];var _0x52e34e=[];var _0x1dc540=squel[_0x3686('0x6f')]();_0x1dc540[_0x3686('0x70')](_0x3686('0x71'))[_0x3686('0x72')](_0x3686('0x73'),'tq')[_0x3686('0x74')]('user_has_teams','ut',_0x3686('0x75'))[_0x3686('0x3b')](_0x3686('0x76'),_0x174581[_0x3686('0x4f')]['id']);for(var _0x30fda4=0x0;_0x30fda4<_0xace2b0[_0x3686('0x44')];_0x30fda4+=0x1){let _0x2dce84=_0xace2b0[_0x30fda4];for(var _0x3da0e2=0x0;_0x3da0e2<_0x2dce84[_0x3686('0x66')][_0x3686('0x44')];_0x3da0e2+=0x1){let _0x5d6cd6=_0x2dce84['Agents'][_0x3da0e2];var _0x9800d8=_0x1dc540[_0x3686('0x77')]();_0x9800d8[_0x3686('0x3b')](_0x3686('0x78'),_0x5d6cd6['id']);_0x52e34e[_0x3686('0x79')](db[_0x3686('0x7a')]['query'](_0x9800d8[_0x3686('0x7b')](),{'type':db[_0x3686('0x7a')]['QueryTypes']['SELECT']})[_0x3686('0x26')](function(_0x2af783){if(_0x2af783['length']===0x1){return _0x5d6cd6['id'];}else{var _0x1c0095=_[_0x3686('0x7c')](_['map'](_0x2af783,_0x3686('0x7d')),function(_0x516f3d){return _['includes'](_0x5a397c,_0x516f3d);});if(_0x1c0095){return _0x5d6cd6['id'];}}}));}}return BPromise['all'](_0x52e34e)[_0x3686('0x26')](function(_0x520341){_0x3392d9=_(_0x3392d9)[_0x3686('0x7e')](_0x520341)[_0x3686('0x7f')]()[_0x3686('0x80')]();return db[_0x3686('0x2f')][_0x3686('0x45')]({'where':{'id':_0x174581['params']['id']}})[_0x3686('0x26')](function(_0x244882){return db[_0x3686('0x7a')][_0x3686('0x68')](function(_0x40ee93){return _0x244882[_0x3686('0x6e')](_0x174581['query'][_0x3686('0x65')],{'transaction':_0x40ee93})['then'](function(){if(!_[_0x3686('0x81')](_0x3392d9)){return _0x244882[_0x3686('0x82')](_0x3392d9,{'transaction':_0x40ee93});}})[_0x3686('0x26')](function(){_0x3392d9[_0x3686('0x6b')](function(_0x2fdc84){socket[_0x3686('0x6c')](_0x3686('0x83'),{'UserId':_0x2fdc84,'FaxQueueId':_0x244882['id']});});});});});});})[_0x3686('0x26')](respondWithStatusCode(_0x4760a2,null))['catch'](handleError(_0x4760a2,null));};exports[_0x3686('0x84')]=function(_0x41cd9b,_0x2101d0,_0x305df3){return db[_0x3686('0x2f')][_0x3686('0x45')]({'where':{'id':_0x41cd9b[_0x3686('0x4f')]['id']}})[_0x3686('0x26')](handleEntityNotFound(_0x2101d0,null))['then'](function(_0x1e9bcc){if(_0x1e9bcc){return _0x1e9bcc[_0x3686('0x84')](_0x41cd9b['body'][_0x3686('0x65')],_['omit'](_0x41cd9b[_0x3686('0x4e')],[_0x3686('0x65'),'id'])||{})[_0x3686('0x85')](function(_0x49a471){for(var _0x102751=0x0;_0x102751<_0x41cd9b[_0x3686('0x4e')][_0x3686('0x65')][_0x3686('0x44')];_0x102751+=0x1){socket[_0x3686('0x6c')](_0x3686('0x6d'),{'UserId':Number(_0x41cd9b[_0x3686('0x4e')][_0x3686('0x65')][_0x102751]),'FaxQueueId':Number(_0x41cd9b[_0x3686('0x4f')]['id'])});}return _0x49a471;});}})[_0x3686('0x26')](respondWithResult(_0x2101d0,null))[_0x3686('0x42')](handleError(_0x2101d0,null));};exports['removeAgents']=function(_0x26f9f5,_0x212473,_0x2c4b6c){return db['FaxQueue'][_0x3686('0x45')]({'where':{'id':_0x26f9f5[_0x3686('0x4f')]['id']}})['then'](handleEntityNotFound(_0x212473,null))[_0x3686('0x26')](function(_0x2a5e3d){if(_0x2a5e3d){return _0x2a5e3d[_0x3686('0x82')](_0x26f9f5[_0x3686('0x33')][_0x3686('0x65')])[_0x3686('0x26')](function(){if(_['isArray'](_0x26f9f5['query'][_0x3686('0x65')])){for(var _0x11e3ad=0x0;_0x11e3ad<_0x26f9f5[_0x3686('0x33')][_0x3686('0x65')][_0x3686('0x44')];_0x11e3ad+=0x1){socket[_0x3686('0x6c')](_0x3686('0x83'),{'UserId':Number(_0x26f9f5[_0x3686('0x33')][_0x3686('0x65')][_0x11e3ad]),'FaxQueueId':Number(_0x26f9f5[_0x3686('0x4f')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x26f9f5[_0x3686('0x33')][_0x3686('0x65')]),'FaxQueueId':Number(_0x26f9f5[_0x3686('0x4f')]['id'])});}});}})[_0x3686('0x26')](respondWithStatusCode(_0x212473,null))[_0x3686('0x42')](handleError(_0x212473,null));};exports[_0x3686('0x86')]=function(_0x3fcedd,_0x1ca9fd,_0x219075){var _0x3d9510={};var _0x59e724={};var _0x21243d;var _0x3fe495;return db['FaxQueue'][_0x3686('0x62')]({'where':{'id':_0x3fcedd[_0x3686('0x4f')]['id']}})[_0x3686('0x26')](handleEntityNotFound(_0x1ca9fd,null))[_0x3686('0x26')](function(_0xb24b4d){if(_0xb24b4d){_0x21243d=_0xb24b4d;_0x59e724[_0x3686('0x31')]=_[_0x3686('0x34')](db[_0x3686('0x59')]['rawAttributes']);_0x59e724['query']=_['keys'](_0x3fcedd['query']);_0x59e724['filters']=_['intersection'](_0x59e724[_0x3686('0x31')],_0x59e724[_0x3686('0x33')]);_0x3d9510[_0x3686('0x38')]=_['intersection'](_0x59e724[_0x3686('0x31')],qs[_0x3686('0x37')](_0x3fcedd['query'][_0x3686('0x37')]));_0x3d9510['attributes']=_0x3d9510['attributes'][_0x3686('0x44')]?_0x3d9510[_0x3686('0x38')]:_0x59e724[_0x3686('0x31')];_0x3d9510[_0x3686('0x55')]=qs[_0x3686('0x3a')](_0x3fcedd[_0x3686('0x33')][_0x3686('0x3a')]);_0x3d9510[_0x3686('0x3b')]=qs['filters'](_['pick'](_0x3fcedd[_0x3686('0x33')],_0x59e724[_0x3686('0x35')]));if(_0x3fcedd[_0x3686('0x33')][_0x3686('0x3d')]){_0x3d9510[_0x3686('0x3b')]=_['merge'](_0x3d9510[_0x3686('0x3b')],{'$or':_[_0x3686('0x32')](_0x3d9510[_0x3686('0x38')],function(_0x3a6959){var _0x4952bd={};_0x4952bd[_0x3a6959]={'$like':'%'+_0x3fcedd[_0x3686('0x33')][_0x3686('0x3d')]+'%'};return _0x4952bd;})});}_0x3d9510=_[_0x3686('0x3e')]({},_0x3d9510,_0x3fcedd[_0x3686('0x57')]);return _0x21243d['getAgents'](_0x3d9510);}})[_0x3686('0x26')](function(_0x51e0f1){if(_0x51e0f1){_0x3fe495=_0x51e0f1[_0x3686('0x44')];if(!_0x3fcedd[_0x3686('0x33')][_0x3686('0x39')](_0x3686('0x54'))){_0x3d9510[_0x3686('0x1e')]=qs['limit'](_0x3fcedd[_0x3686('0x33')][_0x3686('0x1e')]);_0x3d9510[_0x3686('0x1b')]=qs['offset'](_0x3fcedd[_0x3686('0x33')][_0x3686('0x1b')]);}return _0x21243d[_0x3686('0x86')](_0x3d9510);}})[_0x3686('0x26')](function(_0x266435){if(_0x266435){return _0x266435?{'count':_0x3fe495,'rows':_0x266435}:null;}})[_0x3686('0x26')](respondWithResult(_0x1ca9fd,null))[_0x3686('0x42')](handleError(_0x1ca9fd,null));}; \ No newline at end of file +var _0xba38=['removeAgents','addAgents','omit','spread','isArray','emit','userFaxQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack','send','index','FaxQueue','fieldName','type','map','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where','merge','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','keys','find','catch','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserFaxQueue','sort','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','findOrCreate','forEach','userFaxQueue:save','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeTeams'];(function(_0x26d5e0,_0x4696bd){var _0x5125f2=function(_0x6237b5){while(--_0x6237b5){_0x26d5e0['push'](_0x26d5e0['shift']());}};_0x5125f2(++_0x4696bd);}(_0xba38,0x1ac));var _0x8ba3=function(_0x54c793,_0x3cc8f7){_0x54c793=_0x54c793-0x0;var _0xc10a48=_0xba38[_0x54c793];return _0xc10a48;};'use strict';var emlformat=require(_0x8ba3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ba3('0x1'));var jsonpatch=require(_0x8ba3('0x2'));var rp=require('request-promise');var moment=require(_0x8ba3('0x3'));var BPromise=require(_0x8ba3('0x4'));var Mustache=require('mustache');var util=require(_0x8ba3('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8ba3('0x6'));var ejs=require(_0x8ba3('0x7'));var fs=require('fs');var fs_extra=require(_0x8ba3('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8ba3('0x9'));var jsforce=require(_0x8ba3('0xa'));var deskjs=require(_0x8ba3('0xb'));var toCsv=require(_0x8ba3('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8ba3('0xc'));var authService=require(_0x8ba3('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x8ba3('0xe'));var hardwareService=require(_0x8ba3('0xf'));var logger=require(_0x8ba3('0x10'))(_0x8ba3('0x11'));var utils=require(_0x8ba3('0x12'));var config=require(_0x8ba3('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ba3('0x14'))['db'];config[_0x8ba3('0x15')]=_[_0x8ba3('0x16')](config[_0x8ba3('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ba3('0x17'))(new Redis(config['redis']));require(_0x8ba3('0x18'))[_0x8ba3('0x19')](socket);function respondWithStatusCode(_0x2f26d1,_0x231ae8){_0x231ae8=_0x231ae8||0xcc;return function(_0x1b6f9c){if(_0x1b6f9c){return _0x2f26d1[_0x8ba3('0x1a')](_0x231ae8);}return _0x2f26d1['status'](_0x231ae8)[_0x8ba3('0x1b')]();};}function respondWithResult(_0x313603,_0x439aec){_0x439aec=_0x439aec||0xc8;return function(_0x3ca9c7){if(_0x3ca9c7){return _0x313603['status'](_0x439aec)[_0x8ba3('0x1c')](_0x3ca9c7);}};}function respondWithFilteredResult(_0x4ab619,_0x29f13f){return function(_0x9e663f){if(_0x9e663f){var _0x5182a2=typeof _0x29f13f['offset']===_0x8ba3('0x1d')&&typeof _0x29f13f['limit']===_0x8ba3('0x1d');var _0x429507=_0x9e663f[_0x8ba3('0x1e')];var _0xc86d4e=_0x5182a2?0x0:_0x29f13f[_0x8ba3('0x1f')];var _0x19dc95=_0x5182a2?_0x9e663f['count']:_0x29f13f[_0x8ba3('0x1f')]+_0x29f13f[_0x8ba3('0x20')];var _0x57f582;if(_0x19dc95>=_0x429507){_0x19dc95=_0x429507;_0x57f582=0xc8;}else{_0x57f582=0xce;}_0x4ab619[_0x8ba3('0x21')](_0x57f582);return _0x4ab619[_0x8ba3('0x22')](_0x8ba3('0x23'),_0xc86d4e+'-'+_0x19dc95+'/'+_0x429507)[_0x8ba3('0x1c')](_0x9e663f);}return null;};}function patchUpdates(_0x500db0){return function(_0x3df4e6){try{jsonpatch[_0x8ba3('0x24')](_0x3df4e6,_0x500db0,!![]);}catch(_0x392ff6){return BPromise[_0x8ba3('0x25')](_0x392ff6);}return _0x3df4e6[_0x8ba3('0x26')]();};}function saveUpdates(_0x18ccd9,_0x50bc32){return function(_0x3c84ff){if(_0x3c84ff){return _0x3c84ff[_0x8ba3('0x27')](_0x18ccd9)[_0x8ba3('0x28')](function(_0x468c28){return _0x468c28;});}return null;};}function removeEntity(_0x5a670c,_0x3f24fc){return function(_0x2e7b61){if(_0x2e7b61){return _0x2e7b61[_0x8ba3('0x29')]()[_0x8ba3('0x28')](function(){var _0x2084c1=_0x2e7b61[_0x8ba3('0x2a')]({'plain':!![]});var _0x5094b2=_0x8ba3('0x2b');return db[_0x8ba3('0x2c')][_0x8ba3('0x29')]({'where':{'type':_0x5094b2,'resourceId':_0x2084c1['id']}})[_0x8ba3('0x28')](function(){return _0x2e7b61;});})['then'](function(){_0x5a670c[_0x8ba3('0x21')](0xcc)[_0x8ba3('0x1b')]();});}};}function handleEntityNotFound(_0x3c1b8b,_0x4035ef){return function(_0x2a6e6e){if(!_0x2a6e6e){_0x3c1b8b[_0x8ba3('0x1a')](0x194);}return _0x2a6e6e;};}function handleError(_0x359dd4,_0xe05463){_0xe05463=_0xe05463||0x1f4;return function(_0x3f82b2){logger[_0x8ba3('0x2d')](_0x3f82b2[_0x8ba3('0x2e')]);if(_0x3f82b2['name']){delete _0x3f82b2['name'];}_0x359dd4[_0x8ba3('0x21')](_0xe05463)[_0x8ba3('0x2f')](_0x3f82b2);};}exports[_0x8ba3('0x30')]=function(_0x1e34a1,_0x1367be){var _0x25cbd4={},_0x138238={},_0x133fef={'count':0x0,'rows':[]};var _0x532cb3=_['map'](db[_0x8ba3('0x31')]['rawAttributes'],function(_0x360d25){return{'name':_0x360d25[_0x8ba3('0x32')],'type':_0x360d25[_0x8ba3('0x33')]['key']};});_0x138238['model']=_[_0x8ba3('0x34')](_0x532cb3,_0x8ba3('0x35'));_0x138238[_0x8ba3('0x36')]=_['keys'](_0x1e34a1[_0x8ba3('0x36')]);_0x138238[_0x8ba3('0x37')]=_[_0x8ba3('0x38')](_0x138238[_0x8ba3('0x39')],_0x138238[_0x8ba3('0x36')]);_0x25cbd4[_0x8ba3('0x3a')]=_[_0x8ba3('0x38')](_0x138238[_0x8ba3('0x39')],qs[_0x8ba3('0x3b')](_0x1e34a1[_0x8ba3('0x36')]['fields']));_0x25cbd4['attributes']=_0x25cbd4[_0x8ba3('0x3a')][_0x8ba3('0x3c')]?_0x25cbd4[_0x8ba3('0x3a')]:_0x138238['model'];if(!_0x1e34a1[_0x8ba3('0x36')][_0x8ba3('0x3d')](_0x8ba3('0x3e'))){_0x25cbd4['limit']=qs['limit'](_0x1e34a1[_0x8ba3('0x36')]['limit']);_0x25cbd4[_0x8ba3('0x1f')]=qs['offset'](_0x1e34a1[_0x8ba3('0x36')]['offset']);}_0x25cbd4[_0x8ba3('0x3f')]=qs['sort'](_0x1e34a1[_0x8ba3('0x36')]['sort']);_0x25cbd4['where']=qs[_0x8ba3('0x37')](_[_0x8ba3('0x40')](_0x1e34a1[_0x8ba3('0x36')],_0x138238[_0x8ba3('0x37')]),_0x532cb3);if(_0x1e34a1[_0x8ba3('0x36')]['filter']){_0x25cbd4[_0x8ba3('0x41')]=_[_0x8ba3('0x42')](_0x25cbd4[_0x8ba3('0x41')],{'$or':_[_0x8ba3('0x34')](_0x532cb3,function(_0x30c0ef){if(_0x30c0ef[_0x8ba3('0x33')]!=='VIRTUAL'){var _0x4ccd7b={};_0x4ccd7b[_0x30c0ef[_0x8ba3('0x35')]]={'$like':'%'+_0x1e34a1['query'][_0x8ba3('0x43')]+'%'};return _0x4ccd7b;}})});}_0x25cbd4=_[_0x8ba3('0x42')]({},_0x25cbd4,_0x1e34a1[_0x8ba3('0x44')]);var _0xf80199={'where':_0x25cbd4['where']};return db['FaxQueue'][_0x8ba3('0x1e')](_0xf80199)[_0x8ba3('0x28')](function(_0x4053c5){_0x133fef[_0x8ba3('0x1e')]=_0x4053c5;if(_0x1e34a1['query'][_0x8ba3('0x45')]){_0x25cbd4[_0x8ba3('0x46')]=[{'all':!![]}];}return db[_0x8ba3('0x31')][_0x8ba3('0x47')](_0x25cbd4);})[_0x8ba3('0x28')](function(_0x171006){_0x133fef[_0x8ba3('0x48')]=_0x171006;return _0x133fef;})['then'](respondWithFilteredResult(_0x1367be,_0x25cbd4))['catch'](handleError(_0x1367be,null));};exports[_0x8ba3('0x49')]=function(_0x3ceece,_0x17c0f7){var _0x1e89ab={'raw':!![],'where':{'id':_0x3ceece[_0x8ba3('0x4a')]['id']}},_0x10d3a6={};_0x10d3a6['model']=_['keys'](db[_0x8ba3('0x31')][_0x8ba3('0x4b')]);_0x10d3a6['query']=_[_0x8ba3('0x4c')](_0x3ceece[_0x8ba3('0x36')]);_0x10d3a6['filters']=_['intersection'](_0x10d3a6[_0x8ba3('0x39')],_0x10d3a6['query']);_0x1e89ab['attributes']=_[_0x8ba3('0x38')](_0x10d3a6[_0x8ba3('0x39')],qs['fields'](_0x3ceece['query'][_0x8ba3('0x3b')]));_0x1e89ab[_0x8ba3('0x3a')]=_0x1e89ab[_0x8ba3('0x3a')]['length']?_0x1e89ab[_0x8ba3('0x3a')]:_0x10d3a6[_0x8ba3('0x39')];if(_0x3ceece[_0x8ba3('0x36')]['includeAll']){_0x1e89ab[_0x8ba3('0x46')]=[{'all':!![]}];}_0x1e89ab=_[_0x8ba3('0x42')]({},_0x1e89ab,_0x3ceece[_0x8ba3('0x44')]);return db['FaxQueue'][_0x8ba3('0x4d')](_0x1e89ab)[_0x8ba3('0x28')](handleEntityNotFound(_0x17c0f7,null))[_0x8ba3('0x28')](respondWithResult(_0x17c0f7,null))[_0x8ba3('0x4e')](handleError(_0x17c0f7,null));};exports[_0x8ba3('0x4f')]=function(_0x213015,_0x3200d0){return db[_0x8ba3('0x31')]['create'](_0x213015[_0x8ba3('0x50')],{})['then'](function(_0xad2bbe){var _0x4566fc=_0x213015[_0x8ba3('0x51')][_0x8ba3('0x2a')]({'plain':!![]});if(!_0x4566fc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4566fc[_0x8ba3('0x52')]==='user'){var _0x12d12c=_0xad2bbe[_0x8ba3('0x2a')]({'plain':!![]});var _0x1046c0=_0x8ba3('0x2b');return db['UserProfileSection'][_0x8ba3('0x4d')]({'where':{'name':_0x1046c0,'userProfileId':_0x4566fc['userProfileId']},'raw':!![]})[_0x8ba3('0x28')](function(_0x5027c1){if(_0x5027c1&&_0x5027c1[_0x8ba3('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x12d12c['name'],'resourceId':_0x12d12c['id'],'type':_0x5027c1[_0x8ba3('0x35')],'sectionId':_0x5027c1['id']},{})[_0x8ba3('0x28')](function(){return _0xad2bbe;});}else{return _0xad2bbe;}})[_0x8ba3('0x4e')](function(_0x4e0e5b){logger[_0x8ba3('0x2d')](_0x8ba3('0x54'),_0x4e0e5b);throw _0x4e0e5b;});}return _0xad2bbe;})['then'](respondWithResult(_0x3200d0,0xc9))[_0x8ba3('0x4e')](handleError(_0x3200d0,null));};exports[_0x8ba3('0x27')]=function(_0x10bde4,_0x16abf0){if(_0x10bde4[_0x8ba3('0x50')]['id']){delete _0x10bde4[_0x8ba3('0x50')]['id'];}return db[_0x8ba3('0x31')][_0x8ba3('0x4d')]({'where':{'id':_0x10bde4[_0x8ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x16abf0,null))['then'](saveUpdates(_0x10bde4[_0x8ba3('0x50')],null))[_0x8ba3('0x28')](respondWithResult(_0x16abf0,null))[_0x8ba3('0x4e')](handleError(_0x16abf0,null));};exports[_0x8ba3('0x29')]=function(_0x2fa6b3,_0x410861){return db[_0x8ba3('0x31')][_0x8ba3('0x4d')]({'where':{'id':_0x2fa6b3[_0x8ba3('0x4a')]['id']}})[_0x8ba3('0x28')](handleEntityNotFound(_0x410861,null))['then'](removeEntity(_0x410861,null))['catch'](handleError(_0x410861,null));};exports[_0x8ba3('0x55')]=function(_0x12ea44,_0x30a14d){return db[_0x8ba3('0x31')][_0x8ba3('0x55')]()[_0x8ba3('0x28')](respondWithResult(_0x30a14d,null))[_0x8ba3('0x4e')](handleError(_0x30a14d,null));};exports['getMembers']=function(_0x5b2a89,_0xe250b5,_0x173c8f){var _0x13eb3e={'raw':!![],'where':{}},_0x3418cf={},_0x354557;return db[_0x8ba3('0x31')][_0x8ba3('0x56')]({'where':{'id':_0x5b2a89[_0x8ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0xe250b5,null))[_0x8ba3('0x28')](function(_0x170ac5){if(_0x170ac5){_0x354557=_0x170ac5[_0x8ba3('0x2a')]({'plain':!![]});_0x3418cf['model']=_[_0x8ba3('0x4c')](db[_0x8ba3('0x57')][_0x8ba3('0x4b')]);_0x3418cf[_0x8ba3('0x36')]=_['keys'](_0x5b2a89['query']);_0x3418cf[_0x8ba3('0x37')]=_[_0x8ba3('0x38')](_0x3418cf[_0x8ba3('0x39')],_0x3418cf[_0x8ba3('0x36')]);_0x13eb3e[_0x8ba3('0x3a')]=_['intersection'](_0x3418cf[_0x8ba3('0x39')],qs[_0x8ba3('0x3b')](_0x5b2a89[_0x8ba3('0x36')]['fields']));_0x13eb3e[_0x8ba3('0x3a')]=_0x13eb3e['attributes'][_0x8ba3('0x3c')]?_0x13eb3e['attributes']:_0x3418cf[_0x8ba3('0x39')];if(!_0x5b2a89['query']['hasOwnProperty'](_0x8ba3('0x3e'))){_0x13eb3e[_0x8ba3('0x20')]=qs[_0x8ba3('0x20')](_0x5b2a89['query'][_0x8ba3('0x20')]);_0x13eb3e['offset']=qs['offset'](_0x5b2a89[_0x8ba3('0x36')][_0x8ba3('0x1f')]);}_0x13eb3e[_0x8ba3('0x3f')]=qs[_0x8ba3('0x58')](_0x5b2a89[_0x8ba3('0x36')][_0x8ba3('0x58')]);_0x13eb3e[_0x8ba3('0x41')]=qs[_0x8ba3('0x37')](_[_0x8ba3('0x40')](_0x5b2a89[_0x8ba3('0x36')],_0x3418cf[_0x8ba3('0x37')]));_0x13eb3e['where'][_0x8ba3('0x59')]=_0x170ac5['id'];if(_0x5b2a89[_0x8ba3('0x36')]['filter']){_0x13eb3e[_0x8ba3('0x41')]=_['merge'](_0x13eb3e[_0x8ba3('0x41')],{'$or':_[_0x8ba3('0x34')](_0x13eb3e['attributes'],function(_0x3869b0){var _0x4296a9={};_0x4296a9[_0x3869b0]={'$like':'%'+_0x5b2a89[_0x8ba3('0x36')][_0x8ba3('0x43')]+'%'};return _0x4296a9;})});}_0x13eb3e=_['merge']({},_0x13eb3e,_0x5b2a89[_0x8ba3('0x44')]);return db['UserFaxQueue'][_0x8ba3('0x47')](_0x13eb3e);}})[_0x8ba3('0x28')](function(_0x109693){if(_0x109693){return db[_0x8ba3('0x5a')][_0x8ba3('0x5b')]({'where':{'id':_[_0x8ba3('0x34')](_0x109693,_0x8ba3('0x5c')),'role':_0x8ba3('0x5d')},'attributes':['id',_0x8ba3('0x35'),_0x8ba3('0x5e'),_0x8ba3('0x5f'),_0x8ba3('0x60')]});}})[_0x8ba3('0x28')](function(_0x7d783e){if(_0x7d783e){return{'count':_0x7d783e[_0x8ba3('0x1e')],'rows':_['map'](_0x7d783e[_0x8ba3('0x48')],function(_0x978ed7){return{'membername':_0x978ed7[_0x8ba3('0x35')],'UserId':_0x978ed7['id'],'queue_name':_0x354557[_0x8ba3('0x35')],'FaxQueueId':_0x354557['id'],'interface':util[_0x8ba3('0x61')](_0x8ba3('0x62'),_0x8ba3('0x63'),_0x978ed7[_0x8ba3('0x35')]),'penalty':0x0,'paused':_0x978ed7[_0x8ba3('0x5e')],'createdAt':_0x978ed7[_0x8ba3('0x60')],'updatedAt':_0x978ed7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xe250b5,_0x13eb3e))[_0x8ba3('0x4e')](handleError(_0xe250b5,null));};exports[_0x8ba3('0x64')]=function(_0x1a6b0e,_0x22a746,_0x22cfe0){var _0x16c8b9={};var _0x186439={};var _0x2c7ee1;var _0x2f24d3;return db[_0x8ba3('0x31')][_0x8ba3('0x56')]({'where':{'id':_0x1a6b0e[_0x8ba3('0x4a')]['id']}})[_0x8ba3('0x28')](handleEntityNotFound(_0x22a746,null))[_0x8ba3('0x28')](function(_0x5564b4){if(_0x5564b4){_0x2c7ee1=_0x5564b4;_0x186439[_0x8ba3('0x39')]=_['keys'](db['Team'][_0x8ba3('0x4b')]);_0x186439[_0x8ba3('0x36')]=_[_0x8ba3('0x4c')](_0x1a6b0e[_0x8ba3('0x36')]);_0x186439[_0x8ba3('0x37')]=_[_0x8ba3('0x38')](_0x186439[_0x8ba3('0x39')],_0x186439[_0x8ba3('0x36')]);_0x16c8b9['attributes']=_[_0x8ba3('0x38')](_0x186439[_0x8ba3('0x39')],qs[_0x8ba3('0x3b')](_0x1a6b0e[_0x8ba3('0x36')][_0x8ba3('0x3b')]));_0x16c8b9[_0x8ba3('0x3a')]=_0x16c8b9['attributes'][_0x8ba3('0x3c')]?_0x16c8b9[_0x8ba3('0x3a')]:_0x186439[_0x8ba3('0x39')];_0x16c8b9[_0x8ba3('0x3f')]=qs[_0x8ba3('0x58')](_0x1a6b0e['query'][_0x8ba3('0x58')]);_0x16c8b9[_0x8ba3('0x41')]=qs[_0x8ba3('0x37')](_['pick'](_0x1a6b0e[_0x8ba3('0x36')],_0x186439[_0x8ba3('0x37')]));if(_0x1a6b0e[_0x8ba3('0x36')][_0x8ba3('0x43')]){_0x16c8b9[_0x8ba3('0x41')]=_['merge'](_0x16c8b9[_0x8ba3('0x41')],{'$or':_[_0x8ba3('0x34')](_0x16c8b9[_0x8ba3('0x3a')],function(_0x355ad9){var _0x20f947={};_0x20f947[_0x355ad9]={'$like':'%'+_0x1a6b0e['query'][_0x8ba3('0x43')]+'%'};return _0x20f947;})});}_0x16c8b9=_[_0x8ba3('0x42')]({},_0x16c8b9,_0x1a6b0e[_0x8ba3('0x44')]);return _0x2c7ee1[_0x8ba3('0x64')](_0x16c8b9);}})[_0x8ba3('0x28')](function(_0x2852f7){if(_0x2852f7){_0x2f24d3=_0x2852f7[_0x8ba3('0x3c')];if(!_0x1a6b0e[_0x8ba3('0x36')]['hasOwnProperty'](_0x8ba3('0x3e'))){_0x16c8b9[_0x8ba3('0x20')]=qs[_0x8ba3('0x20')](_0x1a6b0e[_0x8ba3('0x36')][_0x8ba3('0x20')]);_0x16c8b9[_0x8ba3('0x1f')]=qs[_0x8ba3('0x1f')](_0x1a6b0e[_0x8ba3('0x36')][_0x8ba3('0x1f')]);}return _0x2c7ee1[_0x8ba3('0x64')](_0x16c8b9);}})[_0x8ba3('0x28')](function(_0x56ed68){if(_0x56ed68){return _0x56ed68?{'count':_0x2f24d3,'rows':_0x56ed68}:null;}})[_0x8ba3('0x28')](respondWithResult(_0x22a746,null))[_0x8ba3('0x4e')](handleError(_0x22a746,null));};exports[_0x8ba3('0x65')]=function(_0x28e4b6,_0x5506f9,_0x3878f9){var _0x1dd644=_0x28e4b6[_0x8ba3('0x50')][_0x8ba3('0x66')];return db['Team'][_0x8ba3('0x47')]({'where':{'id':_0x1dd644},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8ba3('0x67'),'attributes':['id',_0x8ba3('0x35'),_0x8ba3('0x68'),_0x8ba3('0x69'),_0x8ba3('0x6a')],'raw':!![]}]})[_0x8ba3('0x28')](function(_0x53f930){if(_0x53f930){var _0x2b192c=_[_0x8ba3('0x6b')](_0x53f930,function(_0x5a4f8f){var _0x2eba65=_0x5a4f8f[_0x8ba3('0x2a')]({'plain':!![]});return _0x2eba65[_0x8ba3('0x67')];});return db[_0x8ba3('0x31')][_0x8ba3('0x4d')]({'where':{'id':_0x28e4b6['params']['id']}})[_0x8ba3('0x28')](function(_0x591cc6){return db['sequelize'][_0x8ba3('0x6c')](function(_0x1f6e4d){return _0x591cc6[_0x8ba3('0x65')](_0x1dd644,{'transaction':_0x1f6e4d})[_0x8ba3('0x28')](function(){return BPromise['each'](_0x2b192c,function(_0x5c16df){return db[_0x8ba3('0x57')][_0x8ba3('0x6d')]({'where':{'UserId':_0x5c16df['id'],'FaxQueueId':_0x28e4b6[_0x8ba3('0x4a')]['id']},'transaction':_0x1f6e4d});});})['then'](function(){_0x2b192c[_0x8ba3('0x6e')](function(_0x179add){socket['emit'](_0x8ba3('0x6f'),{'UserId':_0x179add['id'],'FaxQueueId':_0x591cc6['id']});});});});});}})[_0x8ba3('0x28')](respondWithStatusCode(_0x5506f9,null))[_0x8ba3('0x4e')](handleError(_0x5506f9,null));};exports['removeTeams']=function(_0x2c98d3,_0x46a977,_0x2e9b64){return db['Team'][_0x8ba3('0x47')]({'where':{'id':_0x2c98d3[_0x8ba3('0x36')][_0x8ba3('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8ba3('0x67'),'attributes':['id'],'raw':!![]}]})[_0x8ba3('0x28')](handleEntityNotFound(_0x46a977,null))[_0x8ba3('0x28')](function(_0xe4423f){var _0x1b887b=_[_0x8ba3('0x34')](_0xe4423f,'id');var _0x359f3a=[];var _0x3c9a97=[];var _0x1435b7=squel[_0x8ba3('0x70')]();_0x1435b7['field'](_0x8ba3('0x71'))[_0x8ba3('0x72')]('team_has_fax_queues','tq')['join'](_0x8ba3('0x73'),'ut',_0x8ba3('0x74'))[_0x8ba3('0x41')](_0x8ba3('0x75'),_0x2c98d3[_0x8ba3('0x4a')]['id']);for(var _0x300e97=0x0;_0x300e97<_0xe4423f[_0x8ba3('0x3c')];_0x300e97+=0x1){let _0x48a955=_0xe4423f[_0x300e97];for(var _0x45d9c2=0x0;_0x45d9c2<_0x48a955[_0x8ba3('0x67')][_0x8ba3('0x3c')];_0x45d9c2+=0x1){let _0x11a70c=_0x48a955[_0x8ba3('0x67')][_0x45d9c2];var _0x17e290=_0x1435b7[_0x8ba3('0x76')]();_0x17e290[_0x8ba3('0x41')](_0x8ba3('0x77'),_0x11a70c['id']);_0x3c9a97[_0x8ba3('0x78')](db[_0x8ba3('0x79')][_0x8ba3('0x36')](_0x17e290[_0x8ba3('0x7a')](),{'type':db[_0x8ba3('0x79')][_0x8ba3('0x7b')][_0x8ba3('0x7c')]})['then'](function(_0x4d8e11){if(_0x4d8e11[_0x8ba3('0x3c')]===0x1){return _0x11a70c['id'];}else{var _0x181dc2=_[_0x8ba3('0x7d')](_[_0x8ba3('0x34')](_0x4d8e11,_0x8ba3('0x7e')),function(_0x3e4ea8){return _[_0x8ba3('0x7f')](_0x1b887b,_0x3e4ea8);});if(_0x181dc2){return _0x11a70c['id'];}}}));}}return BPromise[_0x8ba3('0x80')](_0x3c9a97)[_0x8ba3('0x28')](function(_0x4bc4ca){_0x359f3a=_(_0x359f3a)[_0x8ba3('0x81')](_0x4bc4ca)[_0x8ba3('0x82')]()['value']();return db[_0x8ba3('0x31')]['find']({'where':{'id':_0x2c98d3['params']['id']}})[_0x8ba3('0x28')](function(_0x30b3e2){return db[_0x8ba3('0x79')]['transaction'](function(_0x247137){return _0x30b3e2[_0x8ba3('0x83')](_0x2c98d3[_0x8ba3('0x36')][_0x8ba3('0x66')],{'transaction':_0x247137})[_0x8ba3('0x28')](function(){if(!_['isEmpty'](_0x359f3a)){return _0x30b3e2[_0x8ba3('0x84')](_0x359f3a,{'transaction':_0x247137});}})['then'](function(){_0x359f3a[_0x8ba3('0x6e')](function(_0x2607b6){socket['emit']('userFaxQueue:remove',{'UserId':_0x2607b6,'FaxQueueId':_0x30b3e2['id']});});});});});});})['then'](respondWithStatusCode(_0x46a977,null))[_0x8ba3('0x4e')](handleError(_0x46a977,null));};exports[_0x8ba3('0x85')]=function(_0x577265,_0x3ddefe,_0x556b1d){return db['FaxQueue'][_0x8ba3('0x4d')]({'where':{'id':_0x577265[_0x8ba3('0x4a')]['id']}})[_0x8ba3('0x28')](handleEntityNotFound(_0x3ddefe,null))[_0x8ba3('0x28')](function(_0x2101ff){if(_0x2101ff){return _0x2101ff['addAgents'](_0x577265['body'][_0x8ba3('0x66')],_[_0x8ba3('0x86')](_0x577265[_0x8ba3('0x50')],['ids','id'])||{})[_0x8ba3('0x87')](function(_0x3b668a){for(var _0x2c3f89=0x0;_0x2c3f89<_0x577265[_0x8ba3('0x50')]['ids'][_0x8ba3('0x3c')];_0x2c3f89+=0x1){socket['emit'](_0x8ba3('0x6f'),{'UserId':Number(_0x577265[_0x8ba3('0x50')][_0x8ba3('0x66')][_0x2c3f89]),'FaxQueueId':Number(_0x577265[_0x8ba3('0x4a')]['id'])});}return _0x3b668a;});}})[_0x8ba3('0x28')](respondWithResult(_0x3ddefe,null))[_0x8ba3('0x4e')](handleError(_0x3ddefe,null));};exports[_0x8ba3('0x84')]=function(_0x482e9d,_0x3d7111,_0x460812){return db[_0x8ba3('0x31')][_0x8ba3('0x4d')]({'where':{'id':_0x482e9d['params']['id']}})['then'](handleEntityNotFound(_0x3d7111,null))[_0x8ba3('0x28')](function(_0x231f8a){if(_0x231f8a){return _0x231f8a[_0x8ba3('0x84')](_0x482e9d['query'][_0x8ba3('0x66')])[_0x8ba3('0x28')](function(){if(_[_0x8ba3('0x88')](_0x482e9d['query'][_0x8ba3('0x66')])){for(var _0x33e689=0x0;_0x33e689<_0x482e9d['query']['ids']['length'];_0x33e689+=0x1){socket[_0x8ba3('0x89')]('userFaxQueue:remove',{'UserId':Number(_0x482e9d[_0x8ba3('0x36')][_0x8ba3('0x66')][_0x33e689]),'FaxQueueId':Number(_0x482e9d[_0x8ba3('0x4a')]['id'])});}}else{socket[_0x8ba3('0x89')](_0x8ba3('0x8a'),{'UserId':Number(_0x482e9d[_0x8ba3('0x36')][_0x8ba3('0x66')]),'FaxQueueId':Number(_0x482e9d[_0x8ba3('0x4a')]['id'])});}});}})[_0x8ba3('0x28')](respondWithStatusCode(_0x3d7111,null))[_0x8ba3('0x4e')](handleError(_0x3d7111,null));};exports['getAgents']=function(_0x49a2a3,_0x103a57,_0x395207){var _0x5911af={};var _0x1bda74={};var _0x538d2a;var _0x5d68be;return db[_0x8ba3('0x31')][_0x8ba3('0x56')]({'where':{'id':_0x49a2a3['params']['id']}})[_0x8ba3('0x28')](handleEntityNotFound(_0x103a57,null))[_0x8ba3('0x28')](function(_0x14b8b3){if(_0x14b8b3){_0x538d2a=_0x14b8b3;_0x1bda74['model']=_['keys'](db[_0x8ba3('0x5a')][_0x8ba3('0x4b')]);_0x1bda74[_0x8ba3('0x36')]=_[_0x8ba3('0x4c')](_0x49a2a3[_0x8ba3('0x36')]);_0x1bda74[_0x8ba3('0x37')]=_['intersection'](_0x1bda74['model'],_0x1bda74['query']);_0x5911af['attributes']=_['intersection'](_0x1bda74[_0x8ba3('0x39')],qs['fields'](_0x49a2a3['query'][_0x8ba3('0x3b')]));_0x5911af[_0x8ba3('0x3a')]=_0x5911af[_0x8ba3('0x3a')][_0x8ba3('0x3c')]?_0x5911af[_0x8ba3('0x3a')]:_0x1bda74[_0x8ba3('0x39')];_0x5911af[_0x8ba3('0x3f')]=qs['sort'](_0x49a2a3['query'][_0x8ba3('0x58')]);_0x5911af[_0x8ba3('0x41')]=qs[_0x8ba3('0x37')](_[_0x8ba3('0x40')](_0x49a2a3['query'],_0x1bda74[_0x8ba3('0x37')]));if(_0x49a2a3[_0x8ba3('0x36')]['filter']){_0x5911af['where']=_[_0x8ba3('0x42')](_0x5911af['where'],{'$or':_[_0x8ba3('0x34')](_0x5911af[_0x8ba3('0x3a')],function(_0x207451){var _0x3493a9={};_0x3493a9[_0x207451]={'$like':'%'+_0x49a2a3[_0x8ba3('0x36')][_0x8ba3('0x43')]+'%'};return _0x3493a9;})});}_0x5911af=_['merge']({},_0x5911af,_0x49a2a3['options']);return _0x538d2a['getAgents'](_0x5911af);}})[_0x8ba3('0x28')](function(_0x29d946){if(_0x29d946){_0x5d68be=_0x29d946[_0x8ba3('0x3c')];if(!_0x49a2a3[_0x8ba3('0x36')][_0x8ba3('0x3d')](_0x8ba3('0x3e'))){_0x5911af[_0x8ba3('0x20')]=qs[_0x8ba3('0x20')](_0x49a2a3[_0x8ba3('0x36')]['limit']);_0x5911af['offset']=qs[_0x8ba3('0x1f')](_0x49a2a3[_0x8ba3('0x36')]['offset']);}return _0x538d2a[_0x8ba3('0x8b')](_0x5911af);}})[_0x8ba3('0x28')](function(_0xcbd707){if(_0xcbd707){return _0xcbd707?{'count':_0x5d68be,'rows':_0xcbd707}:null;}})[_0x8ba3('0x28')](respondWithResult(_0x103a57,null))[_0x8ba3('0x4e')](handleError(_0x103a57,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index af85416..2c07a74 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 _0xc6b1=['exports','events','update','emit','hook'];(function(_0x12f4af,_0x4a2bb9){var _0x4c4d50=function(_0x25a7f7){while(--_0x25a7f7){_0x12f4af['push'](_0x12f4af['shift']());}};_0x4c4d50(++_0x4a2bb9);}(_0xc6b1,0x1c3));var _0x1c6b=function(_0x416a0c,_0xd2924f){_0x416a0c=_0x416a0c-0x0;var _0x1fc8c4=_0xc6b1[_0x416a0c];return _0x1fc8c4;};'use strict';var EventEmitter=require(_0x1c6b('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1c6b('0x1'),'afterDestroy':'remove'};function emitEvent(_0x154f6f){return function(_0x1f3667,_0x253c14,_0x4d14db){FaxQueueEvents[_0x1c6b('0x2')](_0x154f6f+':'+_0x1f3667['id'],_0x1f3667);FaxQueueEvents[_0x1c6b('0x2')](_0x154f6f,_0x1f3667);_0x4d14db(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x1c6b('0x3')](e,emitEvent(event));}}module[_0x1c6b('0x4')]=FaxQueueEvents; \ No newline at end of file +var _0x2f31=['update','emit','hook','exports','../../mysqldb','FaxQueue','setMaxListeners','save'];(function(_0x52322c,_0x1bd288){var _0x171fc8=function(_0x51c406){while(--_0x51c406){_0x52322c['push'](_0x52322c['shift']());}};_0x171fc8(++_0x1bd288);}(_0x2f31,0xbc));var _0x12f3=function(_0x257a48,_0x1f54db){_0x257a48=_0x257a48-0x0;var _0x3eac44=_0x2f31[_0x257a48];return _0x3eac44;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x12f3('0x0'))['db'][_0x12f3('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x12f3('0x2')](0x0);var events={'afterCreate':_0x12f3('0x3'),'afterUpdate':_0x12f3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5aec89){return function(_0xc56e67,_0x412590,_0x23d143){FaxQueueEvents[_0x12f3('0x5')](_0x5aec89+':'+_0xc56e67['id'],_0xc56e67);FaxQueueEvents['emit'](_0x5aec89,_0xc56e67);_0x23d143(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x12f3('0x6')](e,emitEvent(event));}}module[_0x12f3('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 1291f2f..e9e838e 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 _0xe4a8=['rimraf','../../config/environment','FaxQueue','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x42cc21,_0x189b0b){var _0x5756b4=function(_0x129279){while(--_0x129279){_0x42cc21['push'](_0x42cc21['shift']());}};_0x5756b4(++_0x189b0b);}(_0xe4a8,0x161));var _0x8e4a=function(_0x2f92d8,_0x2ef7f4){_0x2f92d8=_0x2f92d8-0x0;var _0x200ef1=_0xe4a8[_0x2f92d8];return _0x200ef1;};'use strict';var _=require('lodash');var util=require(_0x8e4a('0x0'));var logger=require(_0x8e4a('0x1'))(_0x8e4a('0x2'));var moment=require(_0x8e4a('0x3'));var BPromise=require(_0x8e4a('0x4'));var rp=require(_0x8e4a('0x5'));var fs=require('fs');var path=require(_0x8e4a('0x6'));var rimraf=require(_0x8e4a('0x7'));var config=require(_0x8e4a('0x8'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x248e05,_0x33d3a3){return _0x248e05['define'](_0x8e4a('0x9'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7721=['rimraf','../../config/environment','exports','define','lodash','api','moment','path'];(function(_0x278b83,_0x4cb2fd){var _0x10fc33=function(_0x1dd667){while(--_0x1dd667){_0x278b83['push'](_0x278b83['shift']());}};_0x10fc33(++_0x4cb2fd);}(_0x7721,0x154));var _0x1772=function(_0x34ffa1,_0x21984a){_0x34ffa1=_0x34ffa1-0x0;var _0x4d84ca=_0x7721[_0x34ffa1];return _0x4d84ca;};'use strict';var _=require(_0x1772('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1772('0x1'));var moment=require(_0x1772('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1772('0x3'));var rimraf=require(_0x1772('0x4'));var config=require(_0x1772('0x5'));var attributes=require('./faxQueue.attributes');module[_0x1772('0x6')]=function(_0x54401e,_0x110e17){return _0x54401e[_0x1772('0x7')]('FaxQueue',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 711cee1..b603747 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 _0xf13a=['result','catch','GetFaxQueue','FaxQueue','options','where','attributes','limit','include','map','model','ShowFaxQueue','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','FaxQueue,\x20%s,\x20%s','message'];(function(_0x4df17e,_0x5edbda){var _0x5685a2=function(_0x275c1a){while(--_0x275c1a){_0x4df17e['push'](_0x4df17e['shift']());}};_0x5685a2(++_0x5edbda);}(_0xf13a,0x1af));var _0xaf13=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0xf13a[_0x1ac120];return _0x19b703;};'use strict';var _=require(_0xaf13('0x0'));var util=require(_0xaf13('0x1'));var moment=require(_0xaf13('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf13('0x3'));var fs=require('fs');var Redis=require(_0xaf13('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf13('0x5'));var logger=require(_0xaf13('0x6'))(_0xaf13('0x7'));var config=require(_0xaf13('0x8'));var jayson=require(_0xaf13('0x9'));var client=jayson[_0xaf13('0xa')][_0xaf13('0xb')]({'port':0x232a});config[_0xaf13('0xc')]=_['defaults'](config['redis'],{'host':_0xaf13('0xd'),'port':0x18eb});var socket=require(_0xaf13('0xe'))(new Redis(config[_0xaf13('0xc')]));require(_0xaf13('0xf'))['register'](socket);function respondWithRpcPromise(_0x8d2926,_0x3cc7d2,_0x374412){return new BPromise(function(_0x449c16,_0x340613){return client['request'](_0x8d2926,_0x374412)[_0xaf13('0x10')](function(_0x2ba443){logger[_0xaf13('0x11')]('FaxQueue,\x20%s,\x20%s',_0x3cc7d2,_0xaf13('0x12'));logger[_0xaf13('0x13')](_0xaf13('0x14'),_0x3cc7d2,_0xaf13('0x12'),JSON['stringify'](_0x2ba443));if(_0x2ba443[_0xaf13('0x15')]){if(_0x2ba443[_0xaf13('0x15')][_0xaf13('0x16')]===0x1f4){logger['error'](_0xaf13('0x17'),_0x3cc7d2,_0x2ba443[_0xaf13('0x15')][_0xaf13('0x18')]);return _0x340613(_0x2ba443[_0xaf13('0x15')][_0xaf13('0x18')]);}logger[_0xaf13('0x15')]('FaxQueue,\x20%s,\x20%s',_0x3cc7d2,_0x2ba443[_0xaf13('0x15')][_0xaf13('0x18')]);return _0x449c16(_0x2ba443[_0xaf13('0x15')][_0xaf13('0x18')]);}else{logger[_0xaf13('0x11')](_0xaf13('0x17'),_0x3cc7d2,'request\x20sent');_0x449c16(_0x2ba443[_0xaf13('0x19')]['message']);}})[_0xaf13('0x1a')](function(_0x25e530){logger[_0xaf13('0x15')]('FaxQueue,\x20%s,\x20%s',_0x3cc7d2,_0x25e530);_0x340613(_0x25e530);});});}exports[_0xaf13('0x1b')]=function(_0x4932c3){var _0x33d38f=this;return new Promise(function(_0x409005,_0x551cf1){return db[_0xaf13('0x1c')]['findAll']({'raw':_0x4932c3[_0xaf13('0x1d')]?_0x4932c3[_0xaf13('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4932c3[_0xaf13('0x1d')]?_0x4932c3[_0xaf13('0x1d')][_0xaf13('0x1e')]||null:null,'attributes':_0x4932c3[_0xaf13('0x1d')]?_0x4932c3['options'][_0xaf13('0x1f')]||null:null,'limit':_0x4932c3[_0xaf13('0x1d')]?_0x4932c3[_0xaf13('0x1d')][_0xaf13('0x20')]||null:null,'include':_0x4932c3['options']?_0x4932c3[_0xaf13('0x1d')][_0xaf13('0x21')]?_[_0xaf13('0x22')](_0x4932c3[_0xaf13('0x1d')][_0xaf13('0x21')],function(_0x47130e){return{'model':db[_0x47130e[_0xaf13('0x23')]],'as':_0x47130e['as'],'attributes':_0x47130e[_0xaf13('0x1f')],'include':_0x47130e[_0xaf13('0x21')]?_['map'](_0x47130e[_0xaf13('0x21')],function(_0x4419ea){return{'model':db[_0x4419ea['model']],'as':_0x4419ea['as'],'attributes':_0x4419ea['attributes'],'include':_0x4419ea[_0xaf13('0x21')]?_[_0xaf13('0x22')](_0x4419ea['include'],function(_0x253a8c){return{'model':db[_0x253a8c[_0xaf13('0x23')]],'as':_0x253a8c['as'],'attributes':_0x253a8c[_0xaf13('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaf13('0x10')](function(_0x511294){logger[_0xaf13('0x11')](_0xaf13('0x1b'),_0x4932c3);logger['debug'](_0xaf13('0x1b'),_0x4932c3,JSON['stringify'](_0x511294));_0x409005(_0x511294);})['catch'](function(_0x513d38){logger[_0xaf13('0x15')]('GetFaxQueue',_0x513d38[_0xaf13('0x18')],_0x4932c3);_0x551cf1(_0x33d38f['error'](0x1f4,_0x513d38[_0xaf13('0x18')]));});});};exports[_0xaf13('0x24')]=function(_0x2725c8){var _0x4a2fb5=this;return new Promise(function(_0xf1f22a,_0x1787fa){return db[_0xaf13('0x1c')][_0xaf13('0x25')]({'raw':_0x2725c8[_0xaf13('0x1d')]?_0x2725c8[_0xaf13('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2725c8[_0xaf13('0x1d')]?_0x2725c8['options']['where']||null:null,'attributes':_0x2725c8[_0xaf13('0x1d')]?_0x2725c8[_0xaf13('0x1d')][_0xaf13('0x1f')]||null:null,'include':_0x2725c8[_0xaf13('0x1d')]?_0x2725c8[_0xaf13('0x1d')][_0xaf13('0x21')]?_[_0xaf13('0x22')](_0x2725c8[_0xaf13('0x1d')][_0xaf13('0x21')],function(_0xb4a9ea){return{'model':db[_0xb4a9ea[_0xaf13('0x23')]],'as':_0xb4a9ea['as'],'attributes':_0xb4a9ea[_0xaf13('0x1f')],'include':_0xb4a9ea[_0xaf13('0x21')]?_['map'](_0xb4a9ea[_0xaf13('0x21')],function(_0xfc28ff){return{'model':db[_0xfc28ff[_0xaf13('0x23')]],'as':_0xfc28ff['as'],'attributes':_0xfc28ff[_0xaf13('0x1f')],'include':_0xfc28ff[_0xaf13('0x21')]?_[_0xaf13('0x22')](_0xfc28ff[_0xaf13('0x21')],function(_0x5bd94a){return{'model':db[_0x5bd94a[_0xaf13('0x23')]],'as':_0x5bd94a['as'],'attributes':_0x5bd94a[_0xaf13('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaf13('0x10')](function(_0x5d8de0){logger[_0xaf13('0x11')]('ShowFaxQueue',_0x2725c8);logger['debug'](_0xaf13('0x24'),_0x2725c8,JSON['stringify'](_0x5d8de0));_0xf1f22a(_0x5d8de0);})[_0xaf13('0x1a')](function(_0x2a681b){logger[_0xaf13('0x15')]('ShowFaxQueue',_0x2a681b[_0xaf13('0x18')],_0x2725c8);_0x1787fa(_0x4a2fb5[_0xaf13('0x15')](0x1f4,_0x2a681b[_0xaf13('0x18')]));});});}; \ No newline at end of file +var _0xdf41=['info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','debug','catch','FaxQueue','find','ShowFaxQueue','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then'];(function(_0xe1a3a5,_0xd3e341){var _0x362646=function(_0xdcef03){while(--_0xdcef03){_0xe1a3a5['push'](_0xe1a3a5['shift']());}};_0x362646(++_0xd3e341);}(_0xdf41,0xb4));var _0x1df4=function(_0x5d414b,_0x4acecd){_0x5d414b=_0x5d414b-0x0;var _0x98874f=_0xdf41[_0x5d414b];return _0x98874f;};'use strict';var _=require('lodash');var util=require(_0x1df4('0x0'));var moment=require(_0x1df4('0x1'));var BPromise=require('bluebird');var rs=require(_0x1df4('0x2'));var fs=require('fs');var Redis=require(_0x1df4('0x3'));var db=require(_0x1df4('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1df4('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1df4('0x6')][_0x1df4('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1df4('0x8')],{'host':_0x1df4('0x9'),'port':0x18eb});var socket=require(_0x1df4('0xa'))(new Redis(config[_0x1df4('0x8')]));require(_0x1df4('0xb'))[_0x1df4('0xc')](socket);function respondWithRpcPromise(_0x29591b,_0x1b0e50,_0x5d9c97){return new BPromise(function(_0x9f3fd3,_0x119359){return client[_0x1df4('0xd')](_0x29591b,_0x5d9c97)[_0x1df4('0xe')](function(_0x149d42){logger[_0x1df4('0xf')](_0x1df4('0x10'),_0x1b0e50,_0x1df4('0x11'));logger['debug'](_0x1df4('0x12'),_0x1b0e50,_0x1df4('0x11'),JSON[_0x1df4('0x13')](_0x149d42));if(_0x149d42['error']){if(_0x149d42[_0x1df4('0x14')][_0x1df4('0x15')]===0x1f4){logger[_0x1df4('0x14')](_0x1df4('0x10'),_0x1b0e50,_0x149d42[_0x1df4('0x14')][_0x1df4('0x16')]);return _0x119359(_0x149d42[_0x1df4('0x14')][_0x1df4('0x16')]);}logger[_0x1df4('0x14')]('FaxQueue,\x20%s,\x20%s',_0x1b0e50,_0x149d42[_0x1df4('0x14')][_0x1df4('0x16')]);return _0x9f3fd3(_0x149d42[_0x1df4('0x14')]['message']);}else{logger[_0x1df4('0xf')](_0x1df4('0x10'),_0x1b0e50,_0x1df4('0x11'));_0x9f3fd3(_0x149d42[_0x1df4('0x17')][_0x1df4('0x16')]);}})['catch'](function(_0x2022a3){logger[_0x1df4('0x14')]('FaxQueue,\x20%s,\x20%s',_0x1b0e50,_0x2022a3);_0x119359(_0x2022a3);});});}exports[_0x1df4('0x18')]=function(_0x42a6df){var _0x2d59a7=this;return new Promise(function(_0x4d7ca4,_0x36f61e){return db['FaxQueue'][_0x1df4('0x19')]({'raw':_0x42a6df[_0x1df4('0x1a')]?_0x42a6df[_0x1df4('0x1a')][_0x1df4('0x1b')]===undefined?!![]:![]:!![],'where':_0x42a6df[_0x1df4('0x1a')]?_0x42a6df[_0x1df4('0x1a')][_0x1df4('0x1c')]||null:null,'attributes':_0x42a6df[_0x1df4('0x1a')]?_0x42a6df[_0x1df4('0x1a')][_0x1df4('0x1d')]||null:null,'limit':_0x42a6df['options']?_0x42a6df['options'][_0x1df4('0x1e')]||null:null,'include':_0x42a6df['options']?_0x42a6df[_0x1df4('0x1a')]['include']?_['map'](_0x42a6df[_0x1df4('0x1a')][_0x1df4('0x1f')],function(_0x5f145d){return{'model':db[_0x5f145d['model']],'as':_0x5f145d['as'],'attributes':_0x5f145d['attributes'],'include':_0x5f145d[_0x1df4('0x1f')]?_['map'](_0x5f145d[_0x1df4('0x1f')],function(_0x1b9bf3){return{'model':db[_0x1b9bf3[_0x1df4('0x20')]],'as':_0x1b9bf3['as'],'attributes':_0x1b9bf3[_0x1df4('0x1d')],'include':_0x1b9bf3[_0x1df4('0x1f')]?_[_0x1df4('0x21')](_0x1b9bf3['include'],function(_0x2a9ade){return{'model':db[_0x2a9ade[_0x1df4('0x20')]],'as':_0x2a9ade['as'],'attributes':_0x2a9ade[_0x1df4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1df4('0xe')](function(_0x15be7f){logger[_0x1df4('0xf')](_0x1df4('0x18'),_0x42a6df);logger[_0x1df4('0x22')](_0x1df4('0x18'),_0x42a6df,JSON['stringify'](_0x15be7f));_0x4d7ca4(_0x15be7f);})[_0x1df4('0x23')](function(_0x56449b){logger[_0x1df4('0x14')]('GetFaxQueue',_0x56449b[_0x1df4('0x16')],_0x42a6df);_0x36f61e(_0x2d59a7[_0x1df4('0x14')](0x1f4,_0x56449b['message']));});});};exports['ShowFaxQueue']=function(_0x41f88e){var _0x316130=this;return new Promise(function(_0x1e02d2,_0x470018){return db[_0x1df4('0x24')][_0x1df4('0x25')]({'raw':_0x41f88e[_0x1df4('0x1a')]?_0x41f88e[_0x1df4('0x1a')][_0x1df4('0x1b')]===undefined?!![]:![]:!![],'where':_0x41f88e[_0x1df4('0x1a')]?_0x41f88e[_0x1df4('0x1a')]['where']||null:null,'attributes':_0x41f88e[_0x1df4('0x1a')]?_0x41f88e[_0x1df4('0x1a')][_0x1df4('0x1d')]||null:null,'include':_0x41f88e[_0x1df4('0x1a')]?_0x41f88e[_0x1df4('0x1a')]['include']?_['map'](_0x41f88e['options'][_0x1df4('0x1f')],function(_0x1ecf49){return{'model':db[_0x1ecf49[_0x1df4('0x20')]],'as':_0x1ecf49['as'],'attributes':_0x1ecf49[_0x1df4('0x1d')],'include':_0x1ecf49[_0x1df4('0x1f')]?_['map'](_0x1ecf49[_0x1df4('0x1f')],function(_0x2337fa){return{'model':db[_0x2337fa[_0x1df4('0x20')]],'as':_0x2337fa['as'],'attributes':_0x2337fa[_0x1df4('0x1d')],'include':_0x2337fa[_0x1df4('0x1f')]?_[_0x1df4('0x21')](_0x2337fa[_0x1df4('0x1f')],function(_0x300ee4){return{'model':db[_0x300ee4[_0x1df4('0x20')]],'as':_0x300ee4['as'],'attributes':_0x300ee4[_0x1df4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1df4('0xe')](function(_0x11ada2){logger['info'](_0x1df4('0x26'),_0x41f88e);logger['debug'](_0x1df4('0x26'),_0x41f88e,JSON['stringify'](_0x11ada2));_0x1e02d2(_0x11ada2);})[_0x1df4('0x23')](function(_0x280619){logger[_0x1df4('0x14')]('ShowFaxQueue',_0x280619[_0x1df4('0x16')],_0x41f88e);_0x470018(_0x316130[_0x1df4('0x14')](0x1f4,_0x280619[_0x1df4('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index a6b755b..46ff061 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 _0xaddb=['save','remove','removeListener','length','faxQueue:','./faxQueue.events'];(function(_0x4f6efd,_0x587db0){var _0x5ddd3d=function(_0x3c2363){while(--_0x3c2363){_0x4f6efd['push'](_0x4f6efd['shift']());}};_0x5ddd3d(++_0x587db0);}(_0xaddb,0x83));var _0xbadd=function(_0x4c9427,_0x372857){_0x4c9427=_0x4c9427-0x0;var _0x5bfa52=_0xaddb[_0x4c9427];return _0x5bfa52;};'use strict';var FaxQueueEvents=require(_0xbadd('0x0'));var events=[_0xbadd('0x1'),_0xbadd('0x2'),'update'];function createListener(_0x28a291,_0x16a1b2){return function(_0x170d2f){_0x16a1b2['emit'](_0x28a291,_0x170d2f);};}function removeListener(_0xfb1bd3,_0x2ee5ec){return function(){FaxQueueEvents[_0xbadd('0x3')](_0xfb1bd3,_0x2ee5ec);};}exports['register']=function(_0x26a370){for(var _0x171db2=0x0,_0x7545a5=events[_0xbadd('0x4')];_0x171db2<_0x7545a5;_0x171db2++){var _0x14e3fc=events[_0x171db2];var _0x1f2721=createListener(_0xbadd('0x5')+_0x14e3fc,_0x26a370);FaxQueueEvents['on'](_0x14e3fc,_0x1f2721);}}; \ No newline at end of file +var _0xe4cd=['remove','update','emit','register','length','faxQueue:','./faxQueue.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4cd,0x84));var _0xde4c=function(_0x47867a,_0x42f17d){_0x47867a=_0x47867a-0x0;var _0x4a2dd0=_0xe4cd[_0x47867a];return _0x4a2dd0;};'use strict';var FaxQueueEvents=require(_0xde4c('0x0'));var events=['save',_0xde4c('0x1'),_0xde4c('0x2')];function createListener(_0x5ad78d,_0x4a3892){return function(_0x39ade2){_0x4a3892[_0xde4c('0x3')](_0x5ad78d,_0x39ade2);};}function removeListener(_0x166526,_0x5d6596){return function(){FaxQueueEvents['removeListener'](_0x166526,_0x5d6596);};}exports[_0xde4c('0x4')]=function(_0x2dc907){for(var _0x32f87d=0x0,_0x13237c=events[_0xde4c('0x5')];_0x32f87d<_0x13237c;_0x32f87d++){var _0x4d2a08=events[_0x32f87d];var _0x4682cb=createListener(_0xde4c('0x6')+_0x4d2a08,_0x2dc907);FaxQueueEvents['on'](_0x4d2a08,_0x4682cb);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index fef0837..ec1beab 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 _0x6b1b=['../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','delete','/:id','destroy','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x6b1b[_0x4baae2];return _0x1a2285;};'use strict';var multer=require('multer');var util=require(_0xb6b1('0x0'));var path=require(_0xb6b1('0x1'));var timeout=require(_0xb6b1('0x2'));var express=require('express');var router=express[_0xb6b1('0x3')]();var fs_extra=require(_0xb6b1('0x4'));var auth=require(_0xb6b1('0x5'));var interaction=require(_0xb6b1('0x6'));var config=require(_0xb6b1('0x7'));var controller=require(_0xb6b1('0x8'));router[_0xb6b1('0x9')]('/',auth[_0xb6b1('0xa')](),controller[_0xb6b1('0xb')]);router[_0xb6b1('0x9')](_0xb6b1('0xc'),auth['isAuthenticated'](),controller[_0xb6b1('0xd')]);router['get']('/:id',auth[_0xb6b1('0xa')](),controller['show']);router[_0xb6b1('0x9')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router['get'](_0xb6b1('0xe'),auth[_0xb6b1('0xa')](),controller['getTeams']);router[_0xb6b1('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xb6b1('0xf')]);router[_0xb6b1('0x10')]('/',auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x11')]);router[_0xb6b1('0x10')](_0xb6b1('0xe'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x12')]);router[_0xb6b1('0x10')](_0xb6b1('0x13'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb6b1('0x15')](_0xb6b1('0x16'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x17')]);router[_0xb6b1('0x15')](_0xb6b1('0xe'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xb6b1('0x15')](_0xb6b1('0x13'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x18')]);module[_0xb6b1('0x19')]=router; \ No newline at end of file +var _0x6b1b=['../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','delete','/:id','destroy','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x6b1b[_0x49ca18];return _0x145d54;};'use strict';var multer=require('multer');var util=require(_0xb6b1('0x0'));var path=require(_0xb6b1('0x1'));var timeout=require(_0xb6b1('0x2'));var express=require('express');var router=express[_0xb6b1('0x3')]();var fs_extra=require(_0xb6b1('0x4'));var auth=require(_0xb6b1('0x5'));var interaction=require(_0xb6b1('0x6'));var config=require(_0xb6b1('0x7'));var controller=require(_0xb6b1('0x8'));router[_0xb6b1('0x9')]('/',auth[_0xb6b1('0xa')](),controller[_0xb6b1('0xb')]);router[_0xb6b1('0x9')](_0xb6b1('0xc'),auth['isAuthenticated'](),controller[_0xb6b1('0xd')]);router['get']('/:id',auth[_0xb6b1('0xa')](),controller['show']);router[_0xb6b1('0x9')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router['get'](_0xb6b1('0xe'),auth[_0xb6b1('0xa')](),controller['getTeams']);router[_0xb6b1('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xb6b1('0xf')]);router[_0xb6b1('0x10')]('/',auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x11')]);router[_0xb6b1('0x10')](_0xb6b1('0xe'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x12')]);router[_0xb6b1('0x10')](_0xb6b1('0x13'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb6b1('0x15')](_0xb6b1('0x16'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x17')]);router[_0xb6b1('0x15')](_0xb6b1('0xe'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xb6b1('0x15')](_0xb6b1('0x13'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x18')]);module[_0xb6b1('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index c265bd3..0201316 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 _0x2299=['moment','sequelize','STRING','DATE'];(function(_0x25d8f1,_0x30a9f3){var _0x31839d=function(_0x44fc86){while(--_0x44fc86){_0x25d8f1['push'](_0x25d8f1['shift']());}};_0x31839d(++_0x30a9f3);}(_0x2299,0xb8));var _0x9229=function(_0x13d911,_0x472938){_0x13d911=_0x13d911-0x0;var _0x1bb4ea=_0x2299[_0x13d911];return _0x1bb4ea;};'use strict';var moment=require(_0x9229('0x0'));var Sequelize=require(_0x9229('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9229('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9229('0x2')]},'joinAt':{'type':Sequelize[_0x9229('0x3')]},'leaveAt':{'type':Sequelize[_0x9229('0x3')]},'acceptAt':{'type':Sequelize[_0x9229('0x3')]},'exitAt':{'type':Sequelize[_0x9229('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9f82=['DATE','sequelize','exports','STRING'];(function(_0x517db2,_0x5d157a){var _0x2c21df=function(_0x314675){while(--_0x314675){_0x517db2['push'](_0x517db2['shift']());}};_0x2c21df(++_0x5d157a);}(_0x9f82,0x111));var _0x29f8=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9f82[_0x1ac595];return _0x455fff;};'use strict';var moment=require('moment');var Sequelize=require(_0x29f8('0x0'));module[_0x29f8('0x1')]={'uniqueid':{'type':Sequelize[_0x29f8('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x29f8('0x2')]},'joinAt':{'type':Sequelize[_0x29f8('0x3')]},'leaveAt':{'type':Sequelize[_0x29f8('0x3')]},'acceptAt':{'type':Sequelize[_0x29f8('0x3')]},'exitAt':{'type':Sequelize[_0x29f8('0x3')]},'reason':{'type':Sequelize[_0x29f8('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 4658c4c..b3729fb 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 _0x4fdc=['crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','include','rows','catch','params','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x4c73f2,_0x168ac5){var _0x257b36=function(_0xaeb311){while(--_0xaeb311){_0x4c73f2['push'](_0x4c73f2['shift']());}};_0x257b36(++_0x168ac5);}(_0x4fdc,0x84));var _0xc4fd=function(_0x1ad17b,_0xd6e43e){_0x1ad17b=_0x1ad17b-0x0;var _0x4aae59=_0x4fdc[_0x1ad17b];return _0x4aae59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc4fd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc4fd('0x1'));var rp=require(_0xc4fd('0x2'));var moment=require(_0xc4fd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc4fd('0x4'));var util=require(_0xc4fd('0x5'));var path=require(_0xc4fd('0x6'));var sox=require(_0xc4fd('0x7'));var csv=require(_0xc4fd('0x8'));var ejs=require(_0xc4fd('0x9'));var fs=require('fs');var fs_extra=require(_0xc4fd('0xa'));var _=require('lodash');var squel=require(_0xc4fd('0xb'));var crypto=require(_0xc4fd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc4fd('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc4fd('0xe'));var Redis=require(_0xc4fd('0xf'));var authService=require(_0xc4fd('0x10'));var qs=require(_0xc4fd('0x11'));var as=require(_0xc4fd('0x12'));var hardwareService=require(_0xc4fd('0x13'));var logger=require(_0xc4fd('0x14'))(_0xc4fd('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc4fd('0x16'));var db=require(_0xc4fd('0x17'))['db'];function respondWithStatusCode(_0x25fc9a,_0x4cecec){_0x4cecec=_0x4cecec||0xcc;return function(_0x31d6c0){if(_0x31d6c0){return _0x25fc9a[_0xc4fd('0x18')](_0x4cecec);}return _0x25fc9a[_0xc4fd('0x19')](_0x4cecec)[_0xc4fd('0x1a')]();};}function respondWithResult(_0x4577a8,_0x29d08c){_0x29d08c=_0x29d08c||0xc8;return function(_0x1d67f0){if(_0x1d67f0){return _0x4577a8[_0xc4fd('0x19')](_0x29d08c)[_0xc4fd('0x1b')](_0x1d67f0);}};}function respondWithFilteredResult(_0x553121,_0x75a44f){return function(_0x4c96e5){if(_0x4c96e5){var _0x5a248c=typeof _0x75a44f[_0xc4fd('0x1c')]===_0xc4fd('0x1d')&&typeof _0x75a44f['limit']==='undefined';var _0x6c739e=_0x4c96e5[_0xc4fd('0x1e')];var _0x2bc246=_0x5a248c?0x0:_0x75a44f[_0xc4fd('0x1c')];var _0xaf6c46=_0x5a248c?_0x4c96e5[_0xc4fd('0x1e')]:_0x75a44f[_0xc4fd('0x1c')]+_0x75a44f['limit'];var _0x1e440f;if(_0xaf6c46>=_0x6c739e){_0xaf6c46=_0x6c739e;_0x1e440f=0xc8;}else{_0x1e440f=0xce;}_0x553121[_0xc4fd('0x19')](_0x1e440f);return _0x553121[_0xc4fd('0x1f')]('Content-Range',_0x2bc246+'-'+_0xaf6c46+'/'+_0x6c739e)['json'](_0x4c96e5);}return null;};}function patchUpdates(_0x1a21ef){return function(_0x254278){try{jsonpatch[_0xc4fd('0x20')](_0x254278,_0x1a21ef,!![]);}catch(_0x3f6fe3){return BPromise[_0xc4fd('0x21')](_0x3f6fe3);}return _0x254278[_0xc4fd('0x22')]();};}function saveUpdates(_0x5bcb6c,_0x5271f8){return function(_0x30900b){if(_0x30900b){return _0x30900b[_0xc4fd('0x23')](_0x5bcb6c)[_0xc4fd('0x24')](function(_0x2eba79){return _0x2eba79;});}return null;};}function removeEntity(_0x1b206b,_0x433eb4){return function(_0x3006ad){if(_0x3006ad){return _0x3006ad[_0xc4fd('0x25')]()[_0xc4fd('0x24')](function(){_0x1b206b['status'](0xcc)[_0xc4fd('0x1a')]();});}};}function handleEntityNotFound(_0x18b1a8,_0x2ce202){return function(_0x2c8831){if(!_0x2c8831){_0x18b1a8[_0xc4fd('0x18')](0x194);}return _0x2c8831;};}function handleError(_0xb6052a,_0x331f1){_0x331f1=_0x331f1||0x1f4;return function(_0x15022d){logger[_0xc4fd('0x26')](_0x15022d['stack']);if(_0x15022d['name']){delete _0x15022d[_0xc4fd('0x27')];}_0xb6052a[_0xc4fd('0x19')](_0x331f1)[_0xc4fd('0x28')](_0x15022d);};}exports[_0xc4fd('0x29')]=function(_0x38ac21,_0x23435e){var _0x546a39={},_0x15d61b={},_0x1b65bd={'count':0x0,'rows':[]};var _0x6b5f5e=_[_0xc4fd('0x2a')](db[_0xc4fd('0x2b')][_0xc4fd('0x2c')],function(_0x193a4a){return{'name':_0x193a4a[_0xc4fd('0x2d')],'type':_0x193a4a['type']['key']};});_0x15d61b[_0xc4fd('0x2e')]=_[_0xc4fd('0x2a')](_0x6b5f5e,_0xc4fd('0x27'));_0x15d61b[_0xc4fd('0x2f')]=_['keys'](_0x38ac21[_0xc4fd('0x2f')]);_0x15d61b['filters']=_[_0xc4fd('0x30')](_0x15d61b[_0xc4fd('0x2e')],_0x15d61b['query']);_0x546a39[_0xc4fd('0x31')]=_[_0xc4fd('0x30')](_0x15d61b[_0xc4fd('0x2e')],qs[_0xc4fd('0x32')](_0x38ac21[_0xc4fd('0x2f')][_0xc4fd('0x32')]));_0x546a39['attributes']=_0x546a39[_0xc4fd('0x31')][_0xc4fd('0x33')]?_0x546a39[_0xc4fd('0x31')]:_0x15d61b[_0xc4fd('0x2e')];if(!_0x38ac21[_0xc4fd('0x2f')][_0xc4fd('0x34')](_0xc4fd('0x35'))){_0x546a39['limit']=qs[_0xc4fd('0x36')](_0x38ac21['query']['limit']);_0x546a39[_0xc4fd('0x1c')]=qs['offset'](_0x38ac21[_0xc4fd('0x2f')][_0xc4fd('0x1c')]);}_0x546a39[_0xc4fd('0x37')]=qs['sort'](_0x38ac21[_0xc4fd('0x2f')][_0xc4fd('0x38')]);_0x546a39[_0xc4fd('0x39')]=qs[_0xc4fd('0x3a')](_['pick'](_0x38ac21[_0xc4fd('0x2f')],_0x15d61b[_0xc4fd('0x3a')]),_0x6b5f5e);if(_0x38ac21[_0xc4fd('0x2f')][_0xc4fd('0x3b')]){_0x546a39['where']=_[_0xc4fd('0x3c')](_0x546a39[_0xc4fd('0x39')],{'$or':_['map'](_0x6b5f5e,function(_0xe202af){if(_0xe202af[_0xc4fd('0x3d')]!==_0xc4fd('0x3e')){var _0x337dc7={};_0x337dc7[_0xe202af['name']]={'$like':'%'+_0x38ac21[_0xc4fd('0x2f')][_0xc4fd('0x3b')]+'%'};return _0x337dc7;}})});}_0x546a39=_['merge']({},_0x546a39,_0x38ac21[_0xc4fd('0x3f')]);var _0x9f2741={'where':_0x546a39[_0xc4fd('0x39')]};return db['FaxQueueReport'][_0xc4fd('0x1e')](_0x9f2741)[_0xc4fd('0x24')](function(_0x18981a){_0x1b65bd[_0xc4fd('0x1e')]=_0x18981a;if(_0x38ac21['query']['includeAll']){_0x546a39[_0xc4fd('0x40')]=[{'all':!![]}];}return db[_0xc4fd('0x2b')]['findAll'](_0x546a39);})[_0xc4fd('0x24')](function(_0xf06c76){_0x1b65bd[_0xc4fd('0x41')]=_0xf06c76;return _0x1b65bd;})[_0xc4fd('0x24')](respondWithFilteredResult(_0x23435e,_0x546a39))[_0xc4fd('0x42')](handleError(_0x23435e,null));};exports['show']=function(_0x3d1584,_0x517fe4){var _0x5c3fe9={'raw':!![],'where':{'id':_0x3d1584[_0xc4fd('0x43')]['id']}},_0xee8027={};_0xee8027['model']=_['keys'](db[_0xc4fd('0x2b')][_0xc4fd('0x2c')]);_0xee8027[_0xc4fd('0x2f')]=_['keys'](_0x3d1584['query']);_0xee8027[_0xc4fd('0x3a')]=_[_0xc4fd('0x30')](_0xee8027[_0xc4fd('0x2e')],_0xee8027[_0xc4fd('0x2f')]);_0x5c3fe9[_0xc4fd('0x31')]=_[_0xc4fd('0x30')](_0xee8027[_0xc4fd('0x2e')],qs[_0xc4fd('0x32')](_0x3d1584[_0xc4fd('0x2f')][_0xc4fd('0x32')]));_0x5c3fe9[_0xc4fd('0x31')]=_0x5c3fe9['attributes'][_0xc4fd('0x33')]?_0x5c3fe9[_0xc4fd('0x31')]:_0xee8027[_0xc4fd('0x2e')];if(_0x3d1584[_0xc4fd('0x2f')]['includeAll']){_0x5c3fe9[_0xc4fd('0x40')]=[{'all':!![]}];}_0x5c3fe9=_[_0xc4fd('0x3c')]({},_0x5c3fe9,_0x3d1584[_0xc4fd('0x3f')]);return db[_0xc4fd('0x2b')][_0xc4fd('0x44')](_0x5c3fe9)[_0xc4fd('0x24')](handleEntityNotFound(_0x517fe4,null))[_0xc4fd('0x24')](respondWithResult(_0x517fe4,null))[_0xc4fd('0x42')](handleError(_0x517fe4,null));};exports[_0xc4fd('0x45')]=function(_0x27b2a6,_0x26a4d2){return db['FaxQueueReport'][_0xc4fd('0x45')](_0x27b2a6[_0xc4fd('0x46')],{})['then'](respondWithResult(_0x26a4d2,0xc9))['catch'](handleError(_0x26a4d2,null));};exports[_0xc4fd('0x23')]=function(_0xebdd81,_0x1a3e0d){if(_0xebdd81[_0xc4fd('0x46')]['id']){delete _0xebdd81[_0xc4fd('0x46')]['id'];}return db['FaxQueueReport'][_0xc4fd('0x44')]({'where':{'id':_0xebdd81[_0xc4fd('0x43')]['id']}})[_0xc4fd('0x24')](handleEntityNotFound(_0x1a3e0d,null))[_0xc4fd('0x24')](saveUpdates(_0xebdd81[_0xc4fd('0x46')],null))[_0xc4fd('0x24')](respondWithResult(_0x1a3e0d,null))[_0xc4fd('0x42')](handleError(_0x1a3e0d,null));};exports['destroy']=function(_0x29d29c,_0x2dad03){return db['FaxQueueReport']['find']({'where':{'id':_0x29d29c[_0xc4fd('0x43')]['id']}})[_0xc4fd('0x24')](handleEntityNotFound(_0x2dad03,null))[_0xc4fd('0x24')](removeEntity(_0x2dad03,null))[_0xc4fd('0x42')](handleError(_0x2dad03,null));};exports[_0xc4fd('0x47')]=function(_0x3999d2,_0x4c5c90){return db[_0xc4fd('0x2b')][_0xc4fd('0x47')]()[_0xc4fd('0x24')](respondWithResult(_0x4c5c90,null))[_0xc4fd('0x42')](handleError(_0x4c5c90,null));}; \ No newline at end of file +var _0x1fdc=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','stack','name','send','index','map','FaxQueueReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','order','sort','pick','where','filter','options','includeAll','include','findAll','rows','show','rawAttributes','merge','find','catch','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x3babb4,_0x3a3039){var _0x40e17c=function(_0x2e5a56){while(--_0x2e5a56){_0x3babb4['push'](_0x3babb4['shift']());}};_0x40e17c(++_0x3a3039);}(_0x1fdc,0x8b));var _0xc1fd=function(_0x456b57,_0x58691a){_0x456b57=_0x456b57-0x0;var _0x18f49f=_0x1fdc[_0x456b57];return _0x18f49f;};'use strict';var emlformat=require(_0xc1fd('0x0'));var rimraf=require(_0xc1fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1fd('0x2'));var rp=require(_0xc1fd('0x3'));var moment=require(_0xc1fd('0x4'));var BPromise=require(_0xc1fd('0x5'));var Mustache=require(_0xc1fd('0x6'));var util=require(_0xc1fd('0x7'));var path=require(_0xc1fd('0x8'));var sox=require('sox');var csv=require(_0xc1fd('0x9'));var ejs=require(_0xc1fd('0xa'));var fs=require('fs');var fs_extra=require(_0xc1fd('0xb'));var _=require(_0xc1fd('0xc'));var squel=require(_0xc1fd('0xd'));var crypto=require(_0xc1fd('0xe'));var jsforce=require(_0xc1fd('0xf'));var deskjs=require(_0xc1fd('0x10'));var toCsv=require(_0xc1fd('0x9'));var querystring=require(_0xc1fd('0x11'));var Papa=require(_0xc1fd('0x12'));var Redis=require(_0xc1fd('0x13'));var authService=require(_0xc1fd('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc1fd('0x15'));var hardwareService=require(_0xc1fd('0x16'));var logger=require('../../config/logger')(_0xc1fd('0x17'));var utils=require('../../config/utils');var config=require(_0xc1fd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1fd('0x19'))['db'];function respondWithStatusCode(_0x18b9b7,_0xcea0b0){_0xcea0b0=_0xcea0b0||0xcc;return function(_0x4e540c){if(_0x4e540c){return _0x18b9b7[_0xc1fd('0x1a')](_0xcea0b0);}return _0x18b9b7[_0xc1fd('0x1b')](_0xcea0b0)[_0xc1fd('0x1c')]();};}function respondWithResult(_0x5439d8,_0x4ae51e){_0x4ae51e=_0x4ae51e||0xc8;return function(_0x4fa283){if(_0x4fa283){return _0x5439d8[_0xc1fd('0x1b')](_0x4ae51e)[_0xc1fd('0x1d')](_0x4fa283);}};}function respondWithFilteredResult(_0x5d3d4a,_0x57fed5){return function(_0x4bd8d8){if(_0x4bd8d8){var _0x6e9ea=typeof _0x57fed5[_0xc1fd('0x1e')]===_0xc1fd('0x1f')&&typeof _0x57fed5[_0xc1fd('0x20')]==='undefined';var _0x279b60=_0x4bd8d8['count'];var _0x3634e3=_0x6e9ea?0x0:_0x57fed5[_0xc1fd('0x1e')];var _0x12398e=_0x6e9ea?_0x4bd8d8[_0xc1fd('0x21')]:_0x57fed5[_0xc1fd('0x1e')]+_0x57fed5[_0xc1fd('0x20')];var _0x13a2c4;if(_0x12398e>=_0x279b60){_0x12398e=_0x279b60;_0x13a2c4=0xc8;}else{_0x13a2c4=0xce;}_0x5d3d4a[_0xc1fd('0x1b')](_0x13a2c4);return _0x5d3d4a[_0xc1fd('0x22')](_0xc1fd('0x23'),_0x3634e3+'-'+_0x12398e+'/'+_0x279b60)[_0xc1fd('0x1d')](_0x4bd8d8);}return null;};}function patchUpdates(_0x4e5f56){return function(_0x44668c){try{jsonpatch['apply'](_0x44668c,_0x4e5f56,!![]);}catch(_0x6d8688){return BPromise['reject'](_0x6d8688);}return _0x44668c[_0xc1fd('0x24')]();};}function saveUpdates(_0x145090,_0x3d4ae4){return function(_0x4d2410){if(_0x4d2410){return _0x4d2410[_0xc1fd('0x25')](_0x145090)['then'](function(_0x152d76){return _0x152d76;});}return null;};}function removeEntity(_0x27e63f,_0x3cf4a2){return function(_0x1593da){if(_0x1593da){return _0x1593da[_0xc1fd('0x26')]()[_0xc1fd('0x27')](function(){_0x27e63f[_0xc1fd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16509d,_0x510801){return function(_0x4bf6b4){if(!_0x4bf6b4){_0x16509d['sendStatus'](0x194);}return _0x4bf6b4;};}function handleError(_0x41e9e4,_0x42b7bd){_0x42b7bd=_0x42b7bd||0x1f4;return function(_0x236efa){logger[_0xc1fd('0x28')](_0x236efa[_0xc1fd('0x29')]);if(_0x236efa[_0xc1fd('0x2a')]){delete _0x236efa[_0xc1fd('0x2a')];}_0x41e9e4['status'](_0x42b7bd)[_0xc1fd('0x2b')](_0x236efa);};}exports[_0xc1fd('0x2c')]=function(_0x854418,_0x12f8f6){var _0x38677e={},_0x19bdef={},_0x121320={'count':0x0,'rows':[]};var _0x1d94b0=_[_0xc1fd('0x2d')](db[_0xc1fd('0x2e')]['rawAttributes'],function(_0x1ba573){return{'name':_0x1ba573[_0xc1fd('0x2f')],'type':_0x1ba573[_0xc1fd('0x30')][_0xc1fd('0x31')]};});_0x19bdef[_0xc1fd('0x32')]=_[_0xc1fd('0x2d')](_0x1d94b0,'name');_0x19bdef['query']=_[_0xc1fd('0x33')](_0x854418[_0xc1fd('0x34')]);_0x19bdef[_0xc1fd('0x35')]=_[_0xc1fd('0x36')](_0x19bdef[_0xc1fd('0x32')],_0x19bdef[_0xc1fd('0x34')]);_0x38677e['attributes']=_[_0xc1fd('0x36')](_0x19bdef['model'],qs['fields'](_0x854418[_0xc1fd('0x34')][_0xc1fd('0x37')]));_0x38677e[_0xc1fd('0x38')]=_0x38677e[_0xc1fd('0x38')][_0xc1fd('0x39')]?_0x38677e[_0xc1fd('0x38')]:_0x19bdef[_0xc1fd('0x32')];if(!_0x854418[_0xc1fd('0x34')]['hasOwnProperty']('nolimit')){_0x38677e[_0xc1fd('0x20')]=qs[_0xc1fd('0x20')](_0x854418['query'][_0xc1fd('0x20')]);_0x38677e['offset']=qs[_0xc1fd('0x1e')](_0x854418[_0xc1fd('0x34')][_0xc1fd('0x1e')]);}_0x38677e[_0xc1fd('0x3a')]=qs[_0xc1fd('0x3b')](_0x854418[_0xc1fd('0x34')][_0xc1fd('0x3b')]);_0x38677e['where']=qs[_0xc1fd('0x35')](_[_0xc1fd('0x3c')](_0x854418[_0xc1fd('0x34')],_0x19bdef['filters']),_0x1d94b0);if(_0x854418[_0xc1fd('0x34')]['filter']){_0x38677e[_0xc1fd('0x3d')]=_['merge'](_0x38677e['where'],{'$or':_[_0xc1fd('0x2d')](_0x1d94b0,function(_0x5b5ee4){if(_0x5b5ee4[_0xc1fd('0x30')]!=='VIRTUAL'){var _0x35fcd4={};_0x35fcd4[_0x5b5ee4[_0xc1fd('0x2a')]]={'$like':'%'+_0x854418[_0xc1fd('0x34')][_0xc1fd('0x3e')]+'%'};return _0x35fcd4;}})});}_0x38677e=_['merge']({},_0x38677e,_0x854418[_0xc1fd('0x3f')]);var _0x2ef383={'where':_0x38677e[_0xc1fd('0x3d')]};return db['FaxQueueReport'][_0xc1fd('0x21')](_0x2ef383)[_0xc1fd('0x27')](function(_0x3ade5f){_0x121320[_0xc1fd('0x21')]=_0x3ade5f;if(_0x854418[_0xc1fd('0x34')][_0xc1fd('0x40')]){_0x38677e[_0xc1fd('0x41')]=[{'all':!![]}];}return db[_0xc1fd('0x2e')][_0xc1fd('0x42')](_0x38677e);})[_0xc1fd('0x27')](function(_0x44998f){_0x121320[_0xc1fd('0x43')]=_0x44998f;return _0x121320;})[_0xc1fd('0x27')](respondWithFilteredResult(_0x12f8f6,_0x38677e))['catch'](handleError(_0x12f8f6,null));};exports[_0xc1fd('0x44')]=function(_0x476bdb,_0x2447c6){var _0x34af64={'raw':!![],'where':{'id':_0x476bdb['params']['id']}},_0x8db94a={};_0x8db94a[_0xc1fd('0x32')]=_[_0xc1fd('0x33')](db[_0xc1fd('0x2e')][_0xc1fd('0x45')]);_0x8db94a[_0xc1fd('0x34')]=_['keys'](_0x476bdb[_0xc1fd('0x34')]);_0x8db94a[_0xc1fd('0x35')]=_[_0xc1fd('0x36')](_0x8db94a[_0xc1fd('0x32')],_0x8db94a[_0xc1fd('0x34')]);_0x34af64[_0xc1fd('0x38')]=_[_0xc1fd('0x36')](_0x8db94a[_0xc1fd('0x32')],qs[_0xc1fd('0x37')](_0x476bdb['query'][_0xc1fd('0x37')]));_0x34af64[_0xc1fd('0x38')]=_0x34af64[_0xc1fd('0x38')][_0xc1fd('0x39')]?_0x34af64[_0xc1fd('0x38')]:_0x8db94a['model'];if(_0x476bdb['query'][_0xc1fd('0x40')]){_0x34af64['include']=[{'all':!![]}];}_0x34af64=_[_0xc1fd('0x46')]({},_0x34af64,_0x476bdb[_0xc1fd('0x3f')]);return db[_0xc1fd('0x2e')][_0xc1fd('0x47')](_0x34af64)[_0xc1fd('0x27')](handleEntityNotFound(_0x2447c6,null))[_0xc1fd('0x27')](respondWithResult(_0x2447c6,null))[_0xc1fd('0x48')](handleError(_0x2447c6,null));};exports[_0xc1fd('0x49')]=function(_0x17e20b,_0x3d730e){return db[_0xc1fd('0x2e')]['create'](_0x17e20b[_0xc1fd('0x4a')],{})[_0xc1fd('0x27')](respondWithResult(_0x3d730e,0xc9))[_0xc1fd('0x48')](handleError(_0x3d730e,null));};exports[_0xc1fd('0x25')]=function(_0x4ab8c0,_0x335fde){if(_0x4ab8c0[_0xc1fd('0x4a')]['id']){delete _0x4ab8c0['body']['id'];}return db['FaxQueueReport'][_0xc1fd('0x47')]({'where':{'id':_0x4ab8c0[_0xc1fd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x335fde,null))[_0xc1fd('0x27')](saveUpdates(_0x4ab8c0[_0xc1fd('0x4a')],null))['then'](respondWithResult(_0x335fde,null))[_0xc1fd('0x48')](handleError(_0x335fde,null));};exports[_0xc1fd('0x26')]=function(_0x51540f,_0x56c58e){return db[_0xc1fd('0x2e')][_0xc1fd('0x47')]({'where':{'id':_0x51540f[_0xc1fd('0x4b')]['id']}})[_0xc1fd('0x27')](handleEntityNotFound(_0x56c58e,null))[_0xc1fd('0x27')](removeEntity(_0x56c58e,null))[_0xc1fd('0x48')](handleError(_0x56c58e,null));};exports[_0xc1fd('0x4c')]=function(_0x43d6cb,_0x8feb70){return db['FaxQueueReport'][_0xc1fd('0x4c')]()[_0xc1fd('0x27')](respondWithResult(_0x8feb70,null))[_0xc1fd('0x48')](handleError(_0x8feb70,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 6413ea1..f07b684 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 _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x40cd94,_0x98e3a0){var _0x4a4e40=function(_0x281e97){while(--_0x281e97){_0x40cd94['push'](_0x40cd94['shift']());}};_0x4a4e40(++_0x98e3a0);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x52c3c3,_0x5af662){_0x52c3c3=_0x52c3c3-0x0;var _0x34389a=_0x7fbe[_0x52c3c3];return _0x34389a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x3c1309,_0x66e161){var _0x4b71bf=function(_0x46426e){while(--_0x46426e){_0x3c1309['push'](_0x3c1309['shift']());}};_0x4b71bf(++_0x66e161);}(_0xe14b,0x93));var _0xbe14=function(_0x5d15f5,_0x4d26ea){_0x5d15f5=_0x5d15f5-0x0;var _0x343cf7=_0xe14b[_0x5d15f5];return _0x343cf7;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','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 d78b31e..c980fe0 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 _0x1174=['request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','body','options','UpdateFaxQueueReport','FaxQueueReport','update','raw','where','attributes','limit','lodash','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s'];(function(_0x48bf20,_0x22e1a2){var _0x2e2ae6=function(_0x1cd8f9){while(--_0x1cd8f9){_0x48bf20['push'](_0x48bf20['shift']());}};_0x2e2ae6(++_0x22e1a2);}(_0x1174,0x1b3));var _0x4117=function(_0x33dc47,_0x1efdb9){_0x33dc47=_0x33dc47-0x0;var _0x371b62=_0x1174[_0x33dc47];return _0x371b62;};'use strict';var _=require(_0x4117('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4117('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x4117('0x2'));var logger=require(_0x4117('0x3'))(_0x4117('0x4'));var config=require(_0x4117('0x5'));var jayson=require(_0x4117('0x6'));var client=jayson[_0x4117('0x7')][_0x4117('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x418315,_0x1d2913,_0x37654b){return new BPromise(function(_0x13d373,_0x3db36e){return client[_0x4117('0x9')](_0x418315,_0x37654b)[_0x4117('0xa')](function(_0x43e2b){logger[_0x4117('0xb')](_0x4117('0xc'),_0x1d2913,_0x4117('0xd'));logger[_0x4117('0xe')](_0x4117('0xf'),_0x1d2913,_0x4117('0xd'),JSON[_0x4117('0x10')](_0x43e2b));if(_0x43e2b[_0x4117('0x11')]){if(_0x43e2b[_0x4117('0x11')][_0x4117('0x12')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x1d2913,_0x43e2b[_0x4117('0x11')][_0x4117('0x13')]);return _0x3db36e(_0x43e2b[_0x4117('0x11')][_0x4117('0x13')]);}logger['error'](_0x4117('0xc'),_0x1d2913,_0x43e2b[_0x4117('0x11')][_0x4117('0x13')]);return _0x13d373(_0x43e2b[_0x4117('0x11')][_0x4117('0x13')]);}else{logger['info'](_0x4117('0xc'),_0x1d2913,_0x4117('0xd'));_0x13d373(_0x43e2b[_0x4117('0x14')][_0x4117('0x13')]);}})[_0x4117('0x15')](function(_0x1099e5){logger[_0x4117('0x11')](_0x4117('0xc'),_0x1d2913,_0x1099e5);_0x3db36e(_0x1099e5);});});}exports[_0x4117('0x16')]=function(_0x5a1d29){var _0x5b2f70=this;return new Promise(function(_0x47c017,_0x54554e){return db['FaxQueueReport']['create'](_0x5a1d29[_0x4117('0x17')],{'raw':_0x5a1d29[_0x4117('0x18')]?_0x5a1d29[_0x4117('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x4117('0xa')](function(_0x391920){logger['info'](_0x4117('0x16'),_0x5a1d29);logger[_0x4117('0xe')](_0x4117('0x16'),_0x5a1d29,JSON['stringify'](_0x391920));_0x47c017(_0x391920);})['catch'](function(_0x13e504){logger[_0x4117('0x11')]('CreateFaxQueueReport',_0x13e504[_0x4117('0x13')],_0x5a1d29);_0x54554e(_0x5b2f70[_0x4117('0x11')](0x1f4,_0x13e504['message']));});});};exports[_0x4117('0x19')]=function(_0x4964ee){var _0x54b0d7=this;return new Promise(function(_0x58c97c,_0x444d77){return db[_0x4117('0x1a')][_0x4117('0x1b')](_0x4964ee[_0x4117('0x17')],{'raw':_0x4964ee[_0x4117('0x18')]?_0x4964ee['options'][_0x4117('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4964ee[_0x4117('0x18')]?_0x4964ee[_0x4117('0x18')][_0x4117('0x1d')]||null:null,'attributes':_0x4964ee[_0x4117('0x18')]?_0x4964ee[_0x4117('0x18')][_0x4117('0x1e')]||null:null,'limit':_0x4964ee[_0x4117('0x18')]?_0x4964ee[_0x4117('0x18')][_0x4117('0x1f')]||null:null})[_0x4117('0xa')](function(_0x34b580){logger[_0x4117('0xb')](_0x4117('0x19'),_0x4964ee);logger[_0x4117('0xe')](_0x4117('0x19'),_0x4964ee,JSON[_0x4117('0x10')](_0x34b580));_0x58c97c(_0x34b580);})['catch'](function(_0x2e211d){logger[_0x4117('0x11')](_0x4117('0x19'),_0x2e211d['message'],_0x4964ee);_0x444d77(_0x54b0d7[_0x4117('0x11')](0x1f4,_0x2e211d[_0x4117('0x13')]));});});}; \ No newline at end of file +var _0x1840=['client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','options','UpdateFaxQueueReport','update','body','where','attributes','stringify','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise'];(function(_0x23e8ec,_0xfddd6f){var _0xfc511d=function(_0x5bc61c){while(--_0x5bc61c){_0x23e8ec['push'](_0x23e8ec['shift']());}};_0xfc511d(++_0xfddd6f);}(_0x1840,0xe8));var _0x0184=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x1840[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x0184('0x0'));var util=require(_0x0184('0x1'));var moment=require(_0x0184('0x2'));var BPromise=require(_0x0184('0x3'));var rs=require(_0x0184('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0184('0x5'))('rpc');var config=require(_0x0184('0x6'));var jayson=require(_0x0184('0x7'));var client=jayson[_0x0184('0x8')][_0x0184('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ecf87,_0x20540d,_0x403305){return new BPromise(function(_0x1eb25a,_0x31811a){return client[_0x0184('0xa')](_0x3ecf87,_0x403305)[_0x0184('0xb')](function(_0x278280){logger[_0x0184('0xc')](_0x0184('0xd'),_0x20540d,'request\x20sent');logger[_0x0184('0xe')](_0x0184('0xf'),_0x20540d,_0x0184('0x10'),JSON['stringify'](_0x278280));if(_0x278280[_0x0184('0x11')]){if(_0x278280[_0x0184('0x11')]['code']===0x1f4){logger[_0x0184('0x11')](_0x0184('0xd'),_0x20540d,_0x278280[_0x0184('0x11')][_0x0184('0x12')]);return _0x31811a(_0x278280['error'][_0x0184('0x12')]);}logger[_0x0184('0x11')](_0x0184('0xd'),_0x20540d,_0x278280['error'][_0x0184('0x12')]);return _0x1eb25a(_0x278280[_0x0184('0x11')][_0x0184('0x12')]);}else{logger['info'](_0x0184('0xd'),_0x20540d,'request\x20sent');_0x1eb25a(_0x278280[_0x0184('0x13')][_0x0184('0x12')]);}})[_0x0184('0x14')](function(_0x2c79fa){logger['error'](_0x0184('0xd'),_0x20540d,_0x2c79fa);_0x31811a(_0x2c79fa);});});}exports[_0x0184('0x15')]=function(_0x5a407c){var _0x49e6ef=this;return new Promise(function(_0x1d77d4,_0x5839a5){return db[_0x0184('0x16')]['create'](_0x5a407c['body'],{'raw':_0x5a407c['options']?_0x5a407c[_0x0184('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x534185){logger[_0x0184('0xc')](_0x0184('0x15'),_0x5a407c);logger[_0x0184('0xe')]('CreateFaxQueueReport',_0x5a407c,JSON['stringify'](_0x534185));_0x1d77d4(_0x534185);})[_0x0184('0x14')](function(_0x2b7fda){logger[_0x0184('0x11')]('CreateFaxQueueReport',_0x2b7fda[_0x0184('0x12')],_0x5a407c);_0x5839a5(_0x49e6ef[_0x0184('0x11')](0x1f4,_0x2b7fda[_0x0184('0x12')]));});});};exports[_0x0184('0x18')]=function(_0x5dd143){var _0x5498e6=this;return new Promise(function(_0x25088e,_0x296432){return db[_0x0184('0x16')][_0x0184('0x19')](_0x5dd143[_0x0184('0x1a')],{'raw':_0x5dd143[_0x0184('0x17')]?_0x5dd143[_0x0184('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dd143[_0x0184('0x17')]?_0x5dd143[_0x0184('0x17')][_0x0184('0x1b')]||null:null,'attributes':_0x5dd143[_0x0184('0x17')]?_0x5dd143[_0x0184('0x17')][_0x0184('0x1c')]||null:null,'limit':_0x5dd143[_0x0184('0x17')]?_0x5dd143[_0x0184('0x17')]['limit']||null:null})[_0x0184('0xb')](function(_0x314549){logger['info']('UpdateFaxQueueReport',_0x5dd143);logger['debug']('UpdateFaxQueueReport',_0x5dd143,JSON[_0x0184('0x1d')](_0x314549));_0x25088e(_0x314549);})[_0x0184('0x14')](function(_0x5baeb2){logger[_0x0184('0x11')](_0x0184('0x18'),_0x5baeb2[_0x0184('0x12')],_0x5dd143);_0x296432(_0x5498e6[_0x0184('0x11')](0x1f4,_0x5baeb2[_0x0184('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index c609948..2ec2937 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 _0xdf5e=['multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','put','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf5e,0xe0));var _0xedf5=function(_0x12e073,_0x4d43db){_0x12e073=_0x12e073-0x0;var _0x267748=_0xdf5e[_0x12e073];return _0x267748;};'use strict';var multer=require(_0xedf5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xedf5('0x1'));var router=express[_0xedf5('0x2')]();var fs_extra=require(_0xedf5('0x3'));var auth=require(_0xedf5('0x4'));var interaction=require(_0xedf5('0x5'));var config=require('../../config/environment');var controller=require(_0xedf5('0x6'));router[_0xedf5('0x7')]('/',auth[_0xedf5('0x8')](),controller[_0xedf5('0x9')]);router[_0xedf5('0x7')]('/describe',auth[_0xedf5('0x8')](),controller[_0xedf5('0xa')]);router[_0xedf5('0x7')](_0xedf5('0xb'),auth[_0xedf5('0x8')](),controller[_0xedf5('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xedf5('0xd')](_0xedf5('0xb'),auth[_0xedf5('0x8')](),controller['update']);router[_0xedf5('0xe')](_0xedf5('0xb'),auth[_0xedf5('0x8')](),controller[_0xedf5('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2f42=['../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x37a902,_0x50579a){var _0x566d4f=function(_0x44a02e){while(--_0x44a02e){_0x37a902['push'](_0x37a902['shift']());}};_0x566d4f(++_0x50579a);}(_0x2f42,0x1e8));var _0x22f4=function(_0x393373,_0x2f7c7c){_0x393373=_0x393373-0x0;var _0x495327=_0x2f42[_0x393373];return _0x495327;};'use strict';var multer=require('multer');var util=require(_0x22f4('0x0'));var path=require(_0x22f4('0x1'));var timeout=require(_0x22f4('0x2'));var express=require(_0x22f4('0x3'));var router=express['Router']();var fs_extra=require(_0x22f4('0x4'));var auth=require(_0x22f4('0x5'));var interaction=require(_0x22f4('0x6'));var config=require(_0x22f4('0x7'));var controller=require('./faxQueueReport.controller');router[_0x22f4('0x8')]('/',auth['isAuthenticated'](),controller[_0x22f4('0x9')]);router[_0x22f4('0x8')]('/describe',auth[_0x22f4('0xa')](),controller['describe']);router[_0x22f4('0x8')](_0x22f4('0xb'),auth['isAuthenticated'](),controller[_0x22f4('0xc')]);router[_0x22f4('0xd')]('/',auth['isAuthenticated'](),controller[_0x22f4('0xe')]);router[_0x22f4('0xf')](_0x22f4('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x22f4('0x10')](_0x22f4('0xb'),auth['isAuthenticated'](),controller[_0x22f4('0x11')]);module[_0x22f4('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 2bfaf54..b77a6b1 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x152449,_0x49f41d){var _0x5b58b2=function(_0x226c30){while(--_0x226c30){_0x152449['push'](_0x152449['shift']());}};_0x5b58b2(++_0x49f41d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x346a71,_0x1310c4){_0x346a71=_0x346a71-0x0;var _0x5a4f72=_0x9bde[_0x346a71];return _0x5a4f72;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0xb43b,0x1b2));var _0xbb43=function(_0x348f17,_0x4dfb4c){_0x348f17=_0x348f17-0x0;var _0x2512b4=_0xb43b[_0x348f17];return _0x2512b4;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 5eec0c3..f874dcf 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 _0xdb8b=['squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','count','set','reject','destroy','end','error','stack','send','index','FaxTransferReport','type','key','map','name','keys','query','filters','intersection','attributes','model','fields','length','nolimit','offset','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash'];(function(_0x3d0177,_0x5c98b1){var _0x47e974=function(_0x37b219){while(--_0x37b219){_0x3d0177['push'](_0x3d0177['shift']());}};_0x47e974(++_0x5c98b1);}(_0xdb8b,0x158));var _0xbdb8=function(_0x1b9a8b,_0x18eda6){_0x1b9a8b=_0x1b9a8b-0x0;var _0x2c7c7b=_0xdb8b[_0x1b9a8b];return _0x2c7c7b;};'use strict';var emlformat=require(_0xbdb8('0x0'));var rimraf=require(_0xbdb8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbdb8('0x2'));var rp=require(_0xbdb8('0x3'));var moment=require(_0xbdb8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbdb8('0x5'));var util=require('util');var path=require(_0xbdb8('0x6'));var sox=require(_0xbdb8('0x7'));var csv=require(_0xbdb8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbdb8('0x9'));var _=require(_0xbdb8('0xa'));var squel=require(_0xbdb8('0xb'));var crypto=require(_0xbdb8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbdb8('0xd'));var toCsv=require(_0xbdb8('0x8'));var querystring=require('querystring');var Papa=require(_0xbdb8('0xe'));var Redis=require(_0xbdb8('0xf'));var authService=require(_0xbdb8('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbdb8('0x11'));var logger=require(_0xbdb8('0x12'))(_0xbdb8('0x13'));var utils=require(_0xbdb8('0x14'));var config=require(_0xbdb8('0x15'));var licenseUtil=require(_0xbdb8('0x16'));var db=require(_0xbdb8('0x17'))['db'];function respondWithStatusCode(_0x827adf,_0x4ff21d){_0x4ff21d=_0x4ff21d||0xcc;return function(_0xcfd5f8){if(_0xcfd5f8){return _0x827adf[_0xbdb8('0x18')](_0x4ff21d);}return _0x827adf['status'](_0x4ff21d)['end']();};}function respondWithResult(_0x1bd85b,_0x213f38){_0x213f38=_0x213f38||0xc8;return function(_0x501d4e){if(_0x501d4e){return _0x1bd85b[_0xbdb8('0x19')](_0x213f38)['json'](_0x501d4e);}};}function respondWithFilteredResult(_0x584efc,_0x38d1ad){return function(_0x5d149d){if(_0x5d149d){var _0x4deec0=typeof _0x38d1ad['offset']==='undefined'&&typeof _0x38d1ad[_0xbdb8('0x1a')]===_0xbdb8('0x1b');var _0x32fd56=_0x5d149d[_0xbdb8('0x1c')];var _0x41ce30=_0x4deec0?0x0:_0x38d1ad['offset'];var _0x2f816d=_0x4deec0?_0x5d149d[_0xbdb8('0x1c')]:_0x38d1ad['offset']+_0x38d1ad[_0xbdb8('0x1a')];var _0x26a7d5;if(_0x2f816d>=_0x32fd56){_0x2f816d=_0x32fd56;_0x26a7d5=0xc8;}else{_0x26a7d5=0xce;}_0x584efc['status'](_0x26a7d5);return _0x584efc[_0xbdb8('0x1d')]('Content-Range',_0x41ce30+'-'+_0x2f816d+'/'+_0x32fd56)['json'](_0x5d149d);}return null;};}function patchUpdates(_0x4e6284){return function(_0x1a5748){try{jsonpatch['apply'](_0x1a5748,_0x4e6284,!![]);}catch(_0x348115){return BPromise[_0xbdb8('0x1e')](_0x348115);}return _0x1a5748['save']();};}function saveUpdates(_0x56ef82,_0x562994){return function(_0x4d4f76){if(_0x4d4f76){return _0x4d4f76['update'](_0x56ef82)['then'](function(_0x313b92){return _0x313b92;});}return null;};}function removeEntity(_0x56a28f,_0x84772e){return function(_0x39f3a3){if(_0x39f3a3){return _0x39f3a3[_0xbdb8('0x1f')]()['then'](function(){_0x56a28f[_0xbdb8('0x19')](0xcc)[_0xbdb8('0x20')]();});}};}function handleEntityNotFound(_0x5ac580,_0x1ddbba){return function(_0x229b98){if(!_0x229b98){_0x5ac580[_0xbdb8('0x18')](0x194);}return _0x229b98;};}function handleError(_0x3bf920,_0x5859e6){_0x5859e6=_0x5859e6||0x1f4;return function(_0x2f5707){logger[_0xbdb8('0x21')](_0x2f5707[_0xbdb8('0x22')]);if(_0x2f5707['name']){delete _0x2f5707['name'];}_0x3bf920[_0xbdb8('0x19')](_0x5859e6)[_0xbdb8('0x23')](_0x2f5707);};}exports[_0xbdb8('0x24')]=function(_0x48fb37,_0x373b42){var _0xdc8adb={},_0x276fee={},_0x62d988={'count':0x0,'rows':[]};var _0x4610ba=_['map'](db[_0xbdb8('0x25')]['rawAttributes'],function(_0xfd44b){return{'name':_0xfd44b['fieldName'],'type':_0xfd44b[_0xbdb8('0x26')][_0xbdb8('0x27')]};});_0x276fee['model']=_[_0xbdb8('0x28')](_0x4610ba,_0xbdb8('0x29'));_0x276fee['query']=_[_0xbdb8('0x2a')](_0x48fb37[_0xbdb8('0x2b')]);_0x276fee[_0xbdb8('0x2c')]=_[_0xbdb8('0x2d')](_0x276fee['model'],_0x276fee[_0xbdb8('0x2b')]);_0xdc8adb[_0xbdb8('0x2e')]=_['intersection'](_0x276fee[_0xbdb8('0x2f')],qs[_0xbdb8('0x30')](_0x48fb37[_0xbdb8('0x2b')][_0xbdb8('0x30')]));_0xdc8adb[_0xbdb8('0x2e')]=_0xdc8adb[_0xbdb8('0x2e')][_0xbdb8('0x31')]?_0xdc8adb[_0xbdb8('0x2e')]:_0x276fee['model'];if(!_0x48fb37[_0xbdb8('0x2b')]['hasOwnProperty'](_0xbdb8('0x32'))){_0xdc8adb[_0xbdb8('0x1a')]=qs[_0xbdb8('0x1a')](_0x48fb37['query'][_0xbdb8('0x1a')]);_0xdc8adb['offset']=qs['offset'](_0x48fb37[_0xbdb8('0x2b')][_0xbdb8('0x33')]);}_0xdc8adb['order']=qs[_0xbdb8('0x34')](_0x48fb37[_0xbdb8('0x2b')][_0xbdb8('0x34')]);_0xdc8adb[_0xbdb8('0x35')]=qs[_0xbdb8('0x2c')](_['pick'](_0x48fb37['query'],_0x276fee['filters']),_0x4610ba);if(_0x48fb37['query'][_0xbdb8('0x36')]){_0xdc8adb[_0xbdb8('0x35')]=_[_0xbdb8('0x37')](_0xdc8adb[_0xbdb8('0x35')],{'$or':_[_0xbdb8('0x28')](_0x4610ba,function(_0xbf924c){if(_0xbf924c['type']!==_0xbdb8('0x38')){var _0x52ae2a={};_0x52ae2a[_0xbf924c[_0xbdb8('0x29')]]={'$like':'%'+_0x48fb37['query']['filter']+'%'};return _0x52ae2a;}})});}_0xdc8adb=_['merge']({},_0xdc8adb,_0x48fb37[_0xbdb8('0x39')]);var _0x1037ec={'where':_0xdc8adb[_0xbdb8('0x35')]};return db['FaxTransferReport'][_0xbdb8('0x1c')](_0x1037ec)[_0xbdb8('0x3a')](function(_0x480e99){_0x62d988['count']=_0x480e99;if(_0x48fb37[_0xbdb8('0x2b')][_0xbdb8('0x3b')]){_0xdc8adb[_0xbdb8('0x3c')]=[{'all':!![]}];}return db[_0xbdb8('0x25')][_0xbdb8('0x3d')](_0xdc8adb);})[_0xbdb8('0x3a')](function(_0x6a2be9){_0x62d988[_0xbdb8('0x3e')]=_0x6a2be9;return _0x62d988;})['then'](respondWithFilteredResult(_0x373b42,_0xdc8adb))[_0xbdb8('0x3f')](handleError(_0x373b42,null));};exports[_0xbdb8('0x40')]=function(_0x2f742f,_0x242ae3){var _0x510b53={'raw':!![],'where':{'id':_0x2f742f[_0xbdb8('0x41')]['id']}},_0x450831={};_0x450831['model']=_['keys'](db['FaxTransferReport']['rawAttributes']);_0x450831[_0xbdb8('0x2b')]=_[_0xbdb8('0x2a')](_0x2f742f[_0xbdb8('0x2b')]);_0x450831[_0xbdb8('0x2c')]=_[_0xbdb8('0x2d')](_0x450831[_0xbdb8('0x2f')],_0x450831[_0xbdb8('0x2b')]);_0x510b53['attributes']=_[_0xbdb8('0x2d')](_0x450831[_0xbdb8('0x2f')],qs[_0xbdb8('0x30')](_0x2f742f['query'][_0xbdb8('0x30')]));_0x510b53[_0xbdb8('0x2e')]=_0x510b53[_0xbdb8('0x2e')][_0xbdb8('0x31')]?_0x510b53['attributes']:_0x450831['model'];if(_0x2f742f['query'][_0xbdb8('0x3b')]){_0x510b53[_0xbdb8('0x3c')]=[{'all':!![]}];}_0x510b53=_[_0xbdb8('0x37')]({},_0x510b53,_0x2f742f[_0xbdb8('0x39')]);return db['FaxTransferReport'][_0xbdb8('0x42')](_0x510b53)[_0xbdb8('0x3a')](handleEntityNotFound(_0x242ae3,null))[_0xbdb8('0x3a')](respondWithResult(_0x242ae3,null))[_0xbdb8('0x3f')](handleError(_0x242ae3,null));};exports[_0xbdb8('0x43')]=function(_0x3cfc7d,_0x3d2562){return db[_0xbdb8('0x25')]['create'](_0x3cfc7d[_0xbdb8('0x44')],{})[_0xbdb8('0x3a')](respondWithResult(_0x3d2562,0xc9))[_0xbdb8('0x3f')](handleError(_0x3d2562,null));};exports[_0xbdb8('0x45')]=function(_0x5c2c0a,_0x281795){if(_0x5c2c0a[_0xbdb8('0x44')]['id']){delete _0x5c2c0a[_0xbdb8('0x44')]['id'];}return db[_0xbdb8('0x25')][_0xbdb8('0x42')]({'where':{'id':_0x5c2c0a[_0xbdb8('0x41')]['id']}})[_0xbdb8('0x3a')](handleEntityNotFound(_0x281795,null))[_0xbdb8('0x3a')](saveUpdates(_0x5c2c0a[_0xbdb8('0x44')],null))['then'](respondWithResult(_0x281795,null))[_0xbdb8('0x3f')](handleError(_0x281795,null));};exports[_0xbdb8('0x1f')]=function(_0x31dcbb,_0x2d485b){return db['FaxTransferReport'][_0xbdb8('0x42')]({'where':{'id':_0x31dcbb['params']['id']}})[_0xbdb8('0x3a')](handleEntityNotFound(_0x2d485b,null))['then'](removeEntity(_0x2d485b,null))[_0xbdb8('0x3f')](handleError(_0x2d485b,null));};exports[_0xbdb8('0x46')]=function(_0x5768cc,_0x1de2ec){return db[_0xbdb8('0x25')][_0xbdb8('0x46')]()[_0xbdb8('0x3a')](respondWithResult(_0x1de2ec,null))[_0xbdb8('0x3f')](handleError(_0x1de2ec,null));}; \ No newline at end of file +var _0x6aae=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','set','apply','reject','save','then','end','error','stack','name','FaxTransferReport','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','destroy','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x4eb7e6,_0x451464){var _0x3cf508=function(_0x462471){while(--_0x462471){_0x4eb7e6['push'](_0x4eb7e6['shift']());}};_0x3cf508(++_0x451464);}(_0x6aae,0x8d));var _0xe6aa=function(_0x104a95,_0x424bfc){_0x104a95=_0x104a95-0x0;var _0x2107c8=_0x6aae[_0x104a95];return _0x2107c8;};'use strict';var emlformat=require(_0xe6aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe6aa('0x1'));var jsonpatch=require(_0xe6aa('0x2'));var rp=require(_0xe6aa('0x3'));var moment=require(_0xe6aa('0x4'));var BPromise=require(_0xe6aa('0x5'));var Mustache=require('mustache');var util=require(_0xe6aa('0x6'));var path=require(_0xe6aa('0x7'));var sox=require(_0xe6aa('0x8'));var csv=require(_0xe6aa('0x9'));var ejs=require(_0xe6aa('0xa'));var fs=require('fs');var fs_extra=require(_0xe6aa('0xb'));var _=require(_0xe6aa('0xc'));var squel=require(_0xe6aa('0xd'));var crypto=require(_0xe6aa('0xe'));var jsforce=require(_0xe6aa('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe6aa('0x10'));var Papa=require(_0xe6aa('0x11'));var Redis=require(_0xe6aa('0x12'));var authService=require(_0xe6aa('0x13'));var qs=require(_0xe6aa('0x14'));var as=require(_0xe6aa('0x15'));var hardwareService=require(_0xe6aa('0x16'));var logger=require(_0xe6aa('0x17'))(_0xe6aa('0x18'));var utils=require(_0xe6aa('0x19'));var config=require(_0xe6aa('0x1a'));var licenseUtil=require(_0xe6aa('0x1b'));var db=require(_0xe6aa('0x1c'))['db'];function respondWithStatusCode(_0x401e4b,_0x52ff4f){_0x52ff4f=_0x52ff4f||0xcc;return function(_0x29f7df){if(_0x29f7df){return _0x401e4b['sendStatus'](_0x52ff4f);}return _0x401e4b[_0xe6aa('0x1d')](_0x52ff4f)['end']();};}function respondWithResult(_0x354d22,_0x56e1f2){_0x56e1f2=_0x56e1f2||0xc8;return function(_0x475ffb){if(_0x475ffb){return _0x354d22[_0xe6aa('0x1d')](_0x56e1f2)[_0xe6aa('0x1e')](_0x475ffb);}};}function respondWithFilteredResult(_0x3b9f5e,_0x8e905){return function(_0x4526a5){if(_0x4526a5){var _0x5f18ad=typeof _0x8e905['offset']===_0xe6aa('0x1f')&&typeof _0x8e905['limit']===_0xe6aa('0x1f');var _0x189401=_0x4526a5[_0xe6aa('0x20')];var _0x2242df=_0x5f18ad?0x0:_0x8e905[_0xe6aa('0x21')];var _0x5f580b=_0x5f18ad?_0x4526a5[_0xe6aa('0x20')]:_0x8e905[_0xe6aa('0x21')]+_0x8e905[_0xe6aa('0x22')];var _0xbeb559;if(_0x5f580b>=_0x189401){_0x5f580b=_0x189401;_0xbeb559=0xc8;}else{_0xbeb559=0xce;}_0x3b9f5e[_0xe6aa('0x1d')](_0xbeb559);return _0x3b9f5e[_0xe6aa('0x23')]('Content-Range',_0x2242df+'-'+_0x5f580b+'/'+_0x189401)[_0xe6aa('0x1e')](_0x4526a5);}return null;};}function patchUpdates(_0x2cc9ab){return function(_0x475f2b){try{jsonpatch[_0xe6aa('0x24')](_0x475f2b,_0x2cc9ab,!![]);}catch(_0x61da3a){return BPromise[_0xe6aa('0x25')](_0x61da3a);}return _0x475f2b[_0xe6aa('0x26')]();};}function saveUpdates(_0x23f205,_0x32e970){return function(_0xbf8ab5){if(_0xbf8ab5){return _0xbf8ab5['update'](_0x23f205)[_0xe6aa('0x27')](function(_0x3bfc72){return _0x3bfc72;});}return null;};}function removeEntity(_0x25d7ee,_0x30e4ff){return function(_0x537c3d){if(_0x537c3d){return _0x537c3d['destroy']()['then'](function(){_0x25d7ee[_0xe6aa('0x1d')](0xcc)[_0xe6aa('0x28')]();});}};}function handleEntityNotFound(_0x1fedd8,_0x215947){return function(_0x24c566){if(!_0x24c566){_0x1fedd8['sendStatus'](0x194);}return _0x24c566;};}function handleError(_0x2ef5b3,_0x22e007){_0x22e007=_0x22e007||0x1f4;return function(_0x1de033){logger[_0xe6aa('0x29')](_0x1de033[_0xe6aa('0x2a')]);if(_0x1de033[_0xe6aa('0x2b')]){delete _0x1de033[_0xe6aa('0x2b')];}_0x2ef5b3['status'](_0x22e007)['send'](_0x1de033);};}exports['index']=function(_0x3cb443,_0x5d71a8){var _0x2fb795={},_0x2134ac={},_0x41d15f={'count':0x0,'rows':[]};var _0x237704=_['map'](db[_0xe6aa('0x2c')]['rawAttributes'],function(_0x26c9b6){return{'name':_0x26c9b6[_0xe6aa('0x2d')],'type':_0x26c9b6[_0xe6aa('0x2e')][_0xe6aa('0x2f')]};});_0x2134ac[_0xe6aa('0x30')]=_[_0xe6aa('0x31')](_0x237704,_0xe6aa('0x2b'));_0x2134ac[_0xe6aa('0x32')]=_['keys'](_0x3cb443[_0xe6aa('0x32')]);_0x2134ac[_0xe6aa('0x33')]=_['intersection'](_0x2134ac['model'],_0x2134ac['query']);_0x2fb795[_0xe6aa('0x34')]=_[_0xe6aa('0x35')](_0x2134ac[_0xe6aa('0x30')],qs[_0xe6aa('0x36')](_0x3cb443[_0xe6aa('0x32')]['fields']));_0x2fb795[_0xe6aa('0x34')]=_0x2fb795[_0xe6aa('0x34')][_0xe6aa('0x37')]?_0x2fb795[_0xe6aa('0x34')]:_0x2134ac['model'];if(!_0x3cb443[_0xe6aa('0x32')][_0xe6aa('0x38')](_0xe6aa('0x39'))){_0x2fb795[_0xe6aa('0x22')]=qs[_0xe6aa('0x22')](_0x3cb443[_0xe6aa('0x32')][_0xe6aa('0x22')]);_0x2fb795['offset']=qs['offset'](_0x3cb443['query'][_0xe6aa('0x21')]);}_0x2fb795[_0xe6aa('0x3a')]=qs['sort'](_0x3cb443[_0xe6aa('0x32')][_0xe6aa('0x3b')]);_0x2fb795[_0xe6aa('0x3c')]=qs['filters'](_[_0xe6aa('0x3d')](_0x3cb443[_0xe6aa('0x32')],_0x2134ac[_0xe6aa('0x33')]),_0x237704);if(_0x3cb443['query'][_0xe6aa('0x3e')]){_0x2fb795[_0xe6aa('0x3c')]=_['merge'](_0x2fb795['where'],{'$or':_[_0xe6aa('0x31')](_0x237704,function(_0x2ec3bb){if(_0x2ec3bb['type']!==_0xe6aa('0x3f')){var _0x54d853={};_0x54d853[_0x2ec3bb[_0xe6aa('0x2b')]]={'$like':'%'+_0x3cb443['query'][_0xe6aa('0x3e')]+'%'};return _0x54d853;}})});}_0x2fb795=_[_0xe6aa('0x40')]({},_0x2fb795,_0x3cb443[_0xe6aa('0x41')]);var _0x460dcf={'where':_0x2fb795[_0xe6aa('0x3c')]};return db['FaxTransferReport'][_0xe6aa('0x20')](_0x460dcf)[_0xe6aa('0x27')](function(_0x1fd9a6){_0x41d15f['count']=_0x1fd9a6;if(_0x3cb443[_0xe6aa('0x32')]['includeAll']){_0x2fb795[_0xe6aa('0x42')]=[{'all':!![]}];}return db[_0xe6aa('0x2c')][_0xe6aa('0x43')](_0x2fb795);})[_0xe6aa('0x27')](function(_0x44ec85){_0x41d15f[_0xe6aa('0x44')]=_0x44ec85;return _0x41d15f;})[_0xe6aa('0x27')](respondWithFilteredResult(_0x5d71a8,_0x2fb795))['catch'](handleError(_0x5d71a8,null));};exports[_0xe6aa('0x45')]=function(_0x1f3ce8,_0x3992a7){var _0xb55b00={'raw':!![],'where':{'id':_0x1f3ce8['params']['id']}},_0x2ccbfb={};_0x2ccbfb[_0xe6aa('0x30')]=_[_0xe6aa('0x46')](db[_0xe6aa('0x2c')][_0xe6aa('0x47')]);_0x2ccbfb[_0xe6aa('0x32')]=_[_0xe6aa('0x46')](_0x1f3ce8[_0xe6aa('0x32')]);_0x2ccbfb[_0xe6aa('0x33')]=_['intersection'](_0x2ccbfb['model'],_0x2ccbfb[_0xe6aa('0x32')]);_0xb55b00[_0xe6aa('0x34')]=_[_0xe6aa('0x35')](_0x2ccbfb[_0xe6aa('0x30')],qs[_0xe6aa('0x36')](_0x1f3ce8['query'][_0xe6aa('0x36')]));_0xb55b00[_0xe6aa('0x34')]=_0xb55b00[_0xe6aa('0x34')]['length']?_0xb55b00[_0xe6aa('0x34')]:_0x2ccbfb[_0xe6aa('0x30')];if(_0x1f3ce8[_0xe6aa('0x32')]['includeAll']){_0xb55b00[_0xe6aa('0x42')]=[{'all':!![]}];}_0xb55b00=_[_0xe6aa('0x40')]({},_0xb55b00,_0x1f3ce8['options']);return db[_0xe6aa('0x2c')][_0xe6aa('0x48')](_0xb55b00)[_0xe6aa('0x27')](handleEntityNotFound(_0x3992a7,null))[_0xe6aa('0x27')](respondWithResult(_0x3992a7,null))[_0xe6aa('0x49')](handleError(_0x3992a7,null));};exports[_0xe6aa('0x4a')]=function(_0x595b70,_0x4e501b){return db[_0xe6aa('0x2c')]['create'](_0x595b70[_0xe6aa('0x4b')],{})[_0xe6aa('0x27')](respondWithResult(_0x4e501b,0xc9))[_0xe6aa('0x49')](handleError(_0x4e501b,null));};exports['update']=function(_0x2b25c5,_0x3df91b){if(_0x2b25c5['body']['id']){delete _0x2b25c5[_0xe6aa('0x4b')]['id'];}return db[_0xe6aa('0x2c')][_0xe6aa('0x48')]({'where':{'id':_0x2b25c5['params']['id']}})['then'](handleEntityNotFound(_0x3df91b,null))['then'](saveUpdates(_0x2b25c5['body'],null))[_0xe6aa('0x27')](respondWithResult(_0x3df91b,null))[_0xe6aa('0x49')](handleError(_0x3df91b,null));};exports[_0xe6aa('0x4c')]=function(_0x59d96d,_0x30bb3f){return db['FaxTransferReport'][_0xe6aa('0x48')]({'where':{'id':_0x59d96d[_0xe6aa('0x4d')]['id']}})[_0xe6aa('0x27')](handleEntityNotFound(_0x30bb3f,null))[_0xe6aa('0x27')](removeEntity(_0x30bb3f,null))[_0xe6aa('0x49')](handleError(_0x30bb3f,null));};exports[_0xe6aa('0x4e')]=function(_0x3df442,_0x39abb7){return db[_0xe6aa('0x2c')][_0xe6aa('0x4e')]()[_0xe6aa('0x27')](respondWithResult(_0x39abb7,null))[_0xe6aa('0x49')](handleError(_0x39abb7,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index dc92813..bd10821 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 _0xc281=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid'];(function(_0x53a829,_0x508637){var _0x46d9d9=function(_0x46f72d){while(--_0x46f72d){_0x53a829['push'](_0x53a829['shift']());}};_0x46d9d9(++_0x508637);}(_0xc281,0x1c7));var _0x1c28=function(_0x180293,_0x28e631){_0x180293=_0x180293-0x0;var _0x12dd33=_0xc281[_0x180293];return _0x12dd33;};'use strict';var _=require('lodash');var util=require(_0x1c28('0x0'));var logger=require(_0x1c28('0x1'))(_0x1c28('0x2'));var moment=require(_0x1c28('0x3'));var BPromise=require(_0x1c28('0x4'));var rp=require(_0x1c28('0x5'));var fs=require('fs');var path=require(_0x1c28('0x6'));var rimraf=require('rimraf');var config=require(_0x1c28('0x7'));var attributes=require(_0x1c28('0x8'));module[_0x1c28('0x9')]=function(_0x4bc56d,_0x71e150){return _0x4bc56d[_0x1c28('0xa')]('FaxTransferReport',attributes,{'tableName':_0x1c28('0xb'),'paranoid':![],'indexes':[{'name':_0x1c28('0xc'),'fields':[_0x1c28('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x076c=['./faxTransferReport.attributes','exports','FaxTransferReport','uniqueid','lodash','util','api','bluebird','rimraf'];(function(_0x45ba4f,_0x12d3a8){var _0x2ff605=function(_0x16de5c){while(--_0x16de5c){_0x45ba4f['push'](_0x45ba4f['shift']());}};_0x2ff605(++_0x12d3a8);}(_0x076c,0x112));var _0xc076=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0x076c[_0x20e7e3];return _0x14b9de;};'use strict';var _=require(_0xc076('0x0'));var util=require(_0xc076('0x1'));var logger=require('../../config/logger')(_0xc076('0x2'));var moment=require('moment');var BPromise=require(_0xc076('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc076('0x4'));var config=require('../../config/environment');var attributes=require(_0xc076('0x5'));module[_0xc076('0x6')]=function(_0x121c68,_0x1bcdb3){return _0x121c68['define'](_0xc076('0x7'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xc076('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 50deb85..e61036d 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 _0xd6db=['../../config/environment','client','request','info','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd6db,0x186));var _0xbd6d=function(_0x2ea0fb,_0xd9bdcf){_0x2ea0fb=_0x2ea0fb-0x0;var _0x3ee61f=_0xd6db[_0x2ea0fb];return _0x3ee61f;};'use strict';var _=require(_0xbd6d('0x0'));var util=require(_0xbd6d('0x1'));var moment=require(_0xbd6d('0x2'));var BPromise=require(_0xbd6d('0x3'));var rs=require(_0xbd6d('0x4'));var fs=require('fs');var Redis=require(_0xbd6d('0x5'));var db=require(_0xbd6d('0x6'))['db'];var utils=require(_0xbd6d('0x7'));var logger=require(_0xbd6d('0x8'))(_0xbd6d('0x9'));var config=require(_0xbd6d('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xbd6d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26fd1f,_0x48e2e6,_0x5f3b64){return new BPromise(function(_0x5d663c,_0x16a856){return client[_0xbd6d('0xc')](_0x26fd1f,_0x5f3b64)['then'](function(_0x32a983){logger[_0xbd6d('0xd')](_0xbd6d('0xe'),_0x48e2e6,'request\x20sent');logger['debug'](_0xbd6d('0xf'),_0x48e2e6,_0xbd6d('0x10'),JSON['stringify'](_0x32a983));if(_0x32a983[_0xbd6d('0x11')]){if(_0x32a983[_0xbd6d('0x11')]['code']===0x1f4){logger[_0xbd6d('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x48e2e6,_0x32a983['error'][_0xbd6d('0x12')]);return _0x16a856(_0x32a983[_0xbd6d('0x11')][_0xbd6d('0x12')]);}logger[_0xbd6d('0x11')](_0xbd6d('0xe'),_0x48e2e6,_0x32a983[_0xbd6d('0x11')][_0xbd6d('0x12')]);return _0x5d663c(_0x32a983[_0xbd6d('0x11')][_0xbd6d('0x12')]);}else{logger[_0xbd6d('0xd')](_0xbd6d('0xe'),_0x48e2e6,_0xbd6d('0x10'));_0x5d663c(_0x32a983[_0xbd6d('0x13')][_0xbd6d('0x12')]);}})['catch'](function(_0x25509c){logger['error'](_0xbd6d('0xe'),_0x48e2e6,_0x25509c);_0x16a856(_0x25509c);});});} \ No newline at end of file +var _0x9b6a=['rpc','jayson/promise','http','request','then','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x11d034,_0x5353e8){var _0x1835cd=function(_0xae857c){while(--_0xae857c){_0x11d034['push'](_0x11d034['shift']());}};_0x1835cd(++_0x5353e8);}(_0x9b6a,0xc1));var _0xa9b6=function(_0x303f17,_0x4f8d86){_0x303f17=_0x303f17-0x0;var _0x3107f7=_0x9b6a[_0x303f17];return _0x3107f7;};'use strict';var _=require(_0xa9b6('0x0'));var util=require(_0xa9b6('0x1'));var moment=require('moment');var BPromise=require(_0xa9b6('0x2'));var rs=require(_0xa9b6('0x3'));var fs=require('fs');var Redis=require(_0xa9b6('0x4'));var db=require(_0xa9b6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa9b6('0x6'))(_0xa9b6('0x7'));var config=require('../../config/environment');var jayson=require(_0xa9b6('0x8'));var client=jayson['client'][_0xa9b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28b3f3,_0x22bf40,_0xc9b518){return new BPromise(function(_0x1043b7,_0x5348a0){return client[_0xa9b6('0xa')](_0x28b3f3,_0xc9b518)[_0xa9b6('0xb')](function(_0x466e31){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x22bf40,_0xa9b6('0xc'));logger[_0xa9b6('0xd')](_0xa9b6('0xe'),_0x22bf40,_0xa9b6('0xc'),JSON[_0xa9b6('0xf')](_0x466e31));if(_0x466e31['error']){if(_0x466e31[_0xa9b6('0x10')][_0xa9b6('0x11')]===0x1f4){logger['error'](_0xa9b6('0x12'),_0x22bf40,_0x466e31[_0xa9b6('0x10')][_0xa9b6('0x13')]);return _0x5348a0(_0x466e31[_0xa9b6('0x10')][_0xa9b6('0x13')]);}logger[_0xa9b6('0x10')](_0xa9b6('0x12'),_0x22bf40,_0x466e31[_0xa9b6('0x10')][_0xa9b6('0x13')]);return _0x1043b7(_0x466e31['error'][_0xa9b6('0x13')]);}else{logger['info'](_0xa9b6('0x12'),_0x22bf40,_0xa9b6('0xc'));_0x1043b7(_0x466e31['result']['message']);}})['catch'](function(_0x3fb404){logger[_0xa9b6('0x10')](_0xa9b6('0x12'),_0x22bf40,_0x3fb404);_0x5348a0(_0x3fb404);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 1492ec0..f853995 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 _0x1675=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','post','delete','/:id','destroy','connect-timeout'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x1675,0xd1));var _0x5167=function(_0x507ecd,_0x217f93){_0x507ecd=_0x507ecd-0x0;var _0x163ed5=_0x1675[_0x507ecd];return _0x163ed5;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5167('0x0'));var express=require(_0x5167('0x1'));var router=express[_0x5167('0x2')]();var fs_extra=require(_0x5167('0x3'));var auth=require(_0x5167('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5167('0x5'));var controller=require(_0x5167('0x6'));router[_0x5167('0x7')]('/',auth[_0x5167('0x8')](),controller[_0x5167('0x9')]);router['get'](_0x5167('0xa'),auth[_0x5167('0x8')](),controller['describe']);router[_0x5167('0x7')]('/:id',auth[_0x5167('0x8')](),controller['show']);router[_0x5167('0xb')]('/',auth[_0x5167('0x8')](),controller['create']);router['put']('/:id',auth[_0x5167('0x8')](),controller['update']);router[_0x5167('0xc')](_0x5167('0xd'),auth[_0x5167('0x8')](),controller[_0x5167('0xe')]);module['exports']=router; \ No newline at end of file +var _0x0d3d=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','describe','/:id','show','post'];(function(_0x633f32,_0x5b8d6f){var _0x2e5960=function(_0x45ef9b){while(--_0x45ef9b){_0x633f32['push'](_0x633f32['shift']());}};_0x2e5960(++_0x5b8d6f);}(_0x0d3d,0x166));var _0xd0d3=function(_0x1dd6d6,_0x30a475){_0x1dd6d6=_0x1dd6d6-0x0;var _0xe2e7d6=_0x0d3d[_0x1dd6d6];return _0xe2e7d6;};'use strict';var multer=require(_0xd0d3('0x0'));var util=require(_0xd0d3('0x1'));var path=require(_0xd0d3('0x2'));var timeout=require(_0xd0d3('0x3'));var express=require('express');var router=express[_0xd0d3('0x4')]();var fs_extra=require(_0xd0d3('0x5'));var auth=require(_0xd0d3('0x6'));var interaction=require(_0xd0d3('0x7'));var config=require(_0xd0d3('0x8'));var controller=require(_0xd0d3('0x9'));router[_0xd0d3('0xa')]('/',auth[_0xd0d3('0xb')](),controller['index']);router['get']('/describe',auth[_0xd0d3('0xb')](),controller[_0xd0d3('0xc')]);router['get'](_0xd0d3('0xd'),auth[_0xd0d3('0xb')](),controller[_0xd0d3('0xe')]);router[_0xd0d3('0xf')]('/',auth[_0xd0d3('0xb')](),controller[_0xd0d3('0x10')]);router[_0xd0d3('0x11')](_0xd0d3('0xd'),auth['isAuthenticated'](),controller[_0xd0d3('0x12')]);router[_0xd0d3('0x13')](_0xd0d3('0xd'),auth[_0xd0d3('0xb')](),controller[_0xd0d3('0x14')]);module[_0xd0d3('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index a0136c4..b94d10a 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 _0x8db1=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x8db1,0x185));var _0x18db=function(_0x383552,_0x5db2de){_0x383552=_0x383552-0x0;var _0x338ff7=_0x8db1[_0x383552];return _0x338ff7;};'use strict';var multer=require(_0x18db('0x0'));var util=require(_0x18db('0x1'));var path=require(_0x18db('0x2'));var timeout=require(_0x18db('0x3'));var express=require(_0x18db('0x4'));var router=express[_0x18db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x18db('0x6'));var interaction=require(_0x18db('0x7'));var config=require(_0x18db('0x8'));var controller=require(_0x18db('0x9'));router['get']('/',auth[_0x18db('0xa')](),controller[_0x18db('0xb')]);router[_0x18db('0xc')](_0x18db('0xd'),auth[_0x18db('0xa')](),controller['show']);router[_0x18db('0xc')](_0x18db('0xe'),auth[_0x18db('0xa')](),controller[_0x18db('0xf')]);router['get'](_0x18db('0x10'),auth[_0x18db('0xa')](),controller[_0x18db('0x11')]);router[_0x18db('0x12')]('/',auth[_0x18db('0xa')](),controller[_0x18db('0x13')]);router[_0x18db('0x12')](_0x18db('0xe'),auth[_0x18db('0xa')](),controller[_0x18db('0x14')]);router[_0x18db('0x15')](_0x18db('0xd'),auth[_0x18db('0xa')](),controller[_0x18db('0x16')]);router[_0x18db('0x17')]('/:id',auth[_0x18db('0xa')](),controller[_0x18db('0x18')]);module[_0x18db('0x19')]=router; \ No newline at end of file +var _0x6ad3=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','addConfiguration','delete','destroy'];(function(_0x5d2194,_0x263167){var _0x1d4425=function(_0x444218){while(--_0x444218){_0x5d2194['push'](_0x5d2194['shift']());}};_0x1d4425(++_0x263167);}(_0x6ad3,0xe2));var _0x36ad=function(_0x1b892b,_0x4efe48){_0x1b892b=_0x1b892b-0x0;var _0xa99e57=_0x6ad3[_0x1b892b];return _0xa99e57;};'use strict';var multer=require(_0x36ad('0x0'));var util=require(_0x36ad('0x1'));var path=require(_0x36ad('0x2'));var timeout=require(_0x36ad('0x3'));var express=require(_0x36ad('0x4'));var router=express[_0x36ad('0x5')]();var fs_extra=require(_0x36ad('0x6'));var auth=require(_0x36ad('0x7'));var interaction=require(_0x36ad('0x8'));var config=require(_0x36ad('0x9'));var controller=require(_0x36ad('0xa'));router[_0x36ad('0xb')]('/',auth[_0x36ad('0xc')](),controller[_0x36ad('0xd')]);router[_0x36ad('0xb')](_0x36ad('0xe'),auth[_0x36ad('0xc')](),controller[_0x36ad('0xf')]);router[_0x36ad('0xb')](_0x36ad('0x10'),auth[_0x36ad('0xc')](),controller[_0x36ad('0x11')]);router[_0x36ad('0xb')](_0x36ad('0x12'),auth['isAuthenticated'](),controller[_0x36ad('0x13')]);router['post']('/',auth[_0x36ad('0xc')](),controller[_0x36ad('0x14')]);router['post'](_0x36ad('0x10'),auth[_0x36ad('0xc')](),controller[_0x36ad('0x15')]);router['put'](_0x36ad('0xe'),auth[_0x36ad('0xc')](),controller['update']);router[_0x36ad('0x16')]('/:id',auth[_0x36ad('0xc')](),controller[_0x36ad('0x17')]);module[_0x36ad('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index b7b2a5b..479a20d 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 _0xca39=['basic','ENUM','integrationTab','sequelize','STRING'];(function(_0x1ee294,_0xbba3f5){var _0x41d205=function(_0x529f07){while(--_0x529f07){_0x1ee294['push'](_0x1ee294['shift']());}};_0x41d205(++_0xbba3f5);}(_0xca39,0xda));var _0x9ca3=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xca39[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x9ca3('0x0'));module['exports']={'name':{'type':Sequelize[_0x9ca3('0x1')]},'description':{'type':Sequelize[_0x9ca3('0x1')]},'username':{'type':Sequelize[_0x9ca3('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x9ca3('0x2')),'defaultValue':_0x9ca3('0x2')},'password':{'type':Sequelize[_0x9ca3('0x1')]},'consumerKey':{'type':Sequelize[_0x9ca3('0x1')]},'consumerSecret':{'type':Sequelize[_0x9ca3('0x1')]},'token':{'type':Sequelize[_0x9ca3('0x1')]},'tokenSecret':{'type':Sequelize[_0x9ca3('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9ca3('0x3')](_0x9ca3('0x4'),'newTab'),'defaultValue':_0x9ca3('0x4')}}; \ No newline at end of file +var _0x07f3=['ENUM','integrationTab','newTab','sequelize','STRING','basic'];(function(_0x34cbfd,_0x4499b7){var _0x2eb449=function(_0x6f9bc0){while(--_0x6f9bc0){_0x34cbfd['push'](_0x34cbfd['shift']());}};_0x2eb449(++_0x4499b7);}(_0x07f3,0x8d));var _0x307f=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0x07f3[_0x5805d7];return _0x170fe4;};'use strict';var Sequelize=require(_0x307f('0x0'));module['exports']={'name':{'type':Sequelize[_0x307f('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0x307f('0x2')},'password':{'type':Sequelize[_0x307f('0x1')]},'consumerKey':{'type':Sequelize[_0x307f('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x307f('0x1')]},'tokenSecret':{'type':Sequelize[_0x307f('0x1')]},'serverUrl':{'type':Sequelize[_0x307f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x307f('0x3')](_0x307f('0x4'),_0x307f('0x5')),'defaultValue':_0x307f('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index f8e4edd..02e102f 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 _0x049d=['sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','save','update','destroy','then','error','name','send','map','DeskAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','%s/custom_fields','application/json','basic','headers','Authorization','format','Basic\x20%s','%s:%s','base64','concat','_embedded','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','request-promise','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5c0613,_0x307c0c){var _0x3af273=function(_0x1c03f7){while(--_0x1c03f7){_0x5c0613['push'](_0x5c0613['shift']());}};_0x3af273(++_0x307c0c);}(_0x049d,0x138));var _0xd049=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x049d[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xd049('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd049('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd049('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd049('0x3'));var sox=require(_0xd049('0x4'));var csv=require(_0xd049('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd049('0x6'));var _=require(_0xd049('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd049('0x8'));var deskjs=require(_0xd049('0x9'));var toCsv=require(_0xd049('0x5'));var querystring=require(_0xd049('0xa'));var Papa=require(_0xd049('0xb'));var Redis=require('ioredis');var authService=require(_0xd049('0xc'));var qs=require(_0xd049('0xd'));var as=require(_0xd049('0xe'));var hardwareService=require(_0xd049('0xf'));var logger=require(_0xd049('0x10'))(_0xd049('0x11'));var utils=require(_0xd049('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xd049('0x13'));var db=require(_0xd049('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x316315,_0x14d86c){_0x14d86c=_0x14d86c||0xcc;return function(_0xf18c71){if(_0xf18c71){return _0x316315[_0xd049('0x15')](_0x14d86c);}return _0x316315[_0xd049('0x16')](_0x14d86c)[_0xd049('0x17')]();};}function respondWithResult(_0x225e17,_0x1c4c95){_0x1c4c95=_0x1c4c95||0xc8;return function(_0x31cbfd){if(_0x31cbfd){return _0x225e17['status'](_0x1c4c95)[_0xd049('0x18')](_0x31cbfd);}};}function respondWithFilteredResult(_0x42cd30,_0x3cf8a6){return function(_0x38043e){if(_0x38043e){var _0x3a1e3b=typeof _0x3cf8a6['offset']==='undefined'&&typeof _0x3cf8a6['limit']===_0xd049('0x19');var _0x4070a5=_0x38043e['count'];var _0x1f8883=_0x3a1e3b?0x0:_0x3cf8a6['offset'];var _0x5b9291=_0x3a1e3b?_0x38043e[_0xd049('0x1a')]:_0x3cf8a6[_0xd049('0x1b')]+_0x3cf8a6[_0xd049('0x1c')];var _0x6c616;if(_0x5b9291>=_0x4070a5){_0x5b9291=_0x4070a5;_0x6c616=0xc8;}else{_0x6c616=0xce;}_0x42cd30[_0xd049('0x16')](_0x6c616);return _0x42cd30[_0xd049('0x1d')](_0xd049('0x1e'),_0x1f8883+'-'+_0x5b9291+'/'+_0x4070a5)[_0xd049('0x18')](_0x38043e);}return null;};}function patchUpdates(_0x21d23e){return function(_0x437215){try{jsonpatch['apply'](_0x437215,_0x21d23e,!![]);}catch(_0x8e2f97){return BPromise['reject'](_0x8e2f97);}return _0x437215[_0xd049('0x1f')]();};}function saveUpdates(_0x509445,_0xaaf3c){return function(_0x3b6790){if(_0x3b6790){return _0x3b6790[_0xd049('0x20')](_0x509445)['then'](function(_0x16261a){return _0x16261a;});}return null;};}function removeEntity(_0xbc4a35,_0x13c5fb){return function(_0x36c674){if(_0x36c674){return _0x36c674[_0xd049('0x21')]()[_0xd049('0x22')](function(){_0xbc4a35[_0xd049('0x16')](0xcc)[_0xd049('0x17')]();});}};}function handleEntityNotFound(_0x21145b,_0x4d1dc4){return function(_0x56a14a){if(!_0x56a14a){_0x21145b['sendStatus'](0x194);}return _0x56a14a;};}function handleError(_0x101207,_0x45ccc2){_0x45ccc2=_0x45ccc2||0x1f4;return function(_0x354fe8){logger[_0xd049('0x23')](_0x354fe8['stack']);if(_0x354fe8[_0xd049('0x24')]){delete _0x354fe8[_0xd049('0x24')];}_0x101207[_0xd049('0x16')](_0x45ccc2)[_0xd049('0x25')](_0x354fe8);};}exports['index']=function(_0xbc1b79,_0x45dc3a){var _0xe1859={},_0x5e3d53={},_0xa4b00a={'count':0x0,'rows':[]};var _0x5741dd=_[_0xd049('0x26')](db[_0xd049('0x27')][_0xd049('0x28')],function(_0x24891d){return{'name':_0x24891d[_0xd049('0x29')],'type':_0x24891d[_0xd049('0x2a')][_0xd049('0x2b')]};});_0x5e3d53['model']=_['map'](_0x5741dd,_0xd049('0x24'));_0x5e3d53[_0xd049('0x2c')]=_['keys'](_0xbc1b79[_0xd049('0x2c')]);_0x5e3d53[_0xd049('0x2d')]=_[_0xd049('0x2e')](_0x5e3d53['model'],_0x5e3d53[_0xd049('0x2c')]);_0xe1859['attributes']=_[_0xd049('0x2e')](_0x5e3d53[_0xd049('0x2f')],qs[_0xd049('0x30')](_0xbc1b79['query']['fields']));_0xe1859[_0xd049('0x31')]=_0xe1859[_0xd049('0x31')][_0xd049('0x32')]?_0xe1859['attributes']:_0x5e3d53[_0xd049('0x2f')];if(!_0xbc1b79['query'][_0xd049('0x33')](_0xd049('0x34'))){_0xe1859[_0xd049('0x1c')]=qs[_0xd049('0x1c')](_0xbc1b79[_0xd049('0x2c')][_0xd049('0x1c')]);_0xe1859['offset']=qs[_0xd049('0x1b')](_0xbc1b79[_0xd049('0x2c')]['offset']);}_0xe1859[_0xd049('0x35')]=qs[_0xd049('0x36')](_0xbc1b79[_0xd049('0x2c')][_0xd049('0x36')]);_0xe1859[_0xd049('0x37')]=qs[_0xd049('0x2d')](_[_0xd049('0x38')](_0xbc1b79[_0xd049('0x2c')],_0x5e3d53[_0xd049('0x2d')]),_0x5741dd);if(_0xbc1b79[_0xd049('0x2c')][_0xd049('0x39')]){_0xe1859['where']=_['merge'](_0xe1859[_0xd049('0x37')],{'$or':_[_0xd049('0x26')](_0x5741dd,function(_0x53ad5a){if(_0x53ad5a['type']!==_0xd049('0x3a')){var _0x30fca5={};_0x30fca5[_0x53ad5a[_0xd049('0x24')]]={'$like':'%'+_0xbc1b79[_0xd049('0x2c')][_0xd049('0x39')]+'%'};return _0x30fca5;}})});}_0xe1859=_[_0xd049('0x3b')]({},_0xe1859,_0xbc1b79[_0xd049('0x3c')]);var _0x5b437b={'where':_0xe1859[_0xd049('0x37')]};return db['DeskAccount'][_0xd049('0x1a')](_0x5b437b)['then'](function(_0x134277){_0xa4b00a[_0xd049('0x1a')]=_0x134277;if(_0xbc1b79[_0xd049('0x2c')][_0xd049('0x3d')]){_0xe1859[_0xd049('0x3e')]=[{'all':!![]}];}return db[_0xd049('0x27')][_0xd049('0x3f')](_0xe1859);})[_0xd049('0x22')](function(_0x5b1518){_0xa4b00a[_0xd049('0x40')]=_0x5b1518;return _0xa4b00a;})[_0xd049('0x22')](respondWithFilteredResult(_0x45dc3a,_0xe1859))[_0xd049('0x41')](handleError(_0x45dc3a,null));};exports[_0xd049('0x42')]=function(_0x1c91f7,_0x3c86c1){var _0x5aa564={'raw':![],'where':{'id':_0x1c91f7[_0xd049('0x43')]['id']}},_0x490c9c={};_0x490c9c[_0xd049('0x2f')]=_[_0xd049('0x44')](db[_0xd049('0x27')][_0xd049('0x28')]);_0x490c9c[_0xd049('0x2c')]=_[_0xd049('0x44')](_0x1c91f7[_0xd049('0x2c')]);_0x490c9c['filters']=_[_0xd049('0x2e')](_0x490c9c[_0xd049('0x2f')],_0x490c9c[_0xd049('0x2c')]);_0x5aa564['attributes']=_[_0xd049('0x2e')](_0x490c9c[_0xd049('0x2f')],qs['fields'](_0x1c91f7['query'][_0xd049('0x30')]));_0x5aa564[_0xd049('0x31')]=_0x5aa564[_0xd049('0x31')]['length']?_0x5aa564[_0xd049('0x31')]:_0x490c9c['model'];if(_0x1c91f7['query'][_0xd049('0x3d')]){_0x5aa564[_0xd049('0x3e')]=[{'all':!![]}];}_0x5aa564=_['merge']({},_0x5aa564,_0x1c91f7[_0xd049('0x3c')]);return db['DeskAccount'][_0xd049('0x45')](_0x5aa564)[_0xd049('0x22')](handleEntityNotFound(_0x3c86c1,null))['then'](respondWithResult(_0x3c86c1,null))[_0xd049('0x41')](handleError(_0x3c86c1,null));};exports['create']=function(_0x3b3317,_0xc209ee){return db[_0xd049('0x27')][_0xd049('0x46')](_0x3b3317['body'],{})['then'](respondWithResult(_0xc209ee,0xc9))[_0xd049('0x41')](handleError(_0xc209ee,null));};exports[_0xd049('0x20')]=function(_0x303dba,_0x18fdad){if(_0x303dba['body']['id']){delete _0x303dba[_0xd049('0x47')]['id'];}return db['DeskAccount'][_0xd049('0x45')]({'where':{'id':_0x303dba[_0xd049('0x43')]['id']}})['then'](handleEntityNotFound(_0x18fdad,null))[_0xd049('0x22')](saveUpdates(_0x303dba[_0xd049('0x47')],null))[_0xd049('0x22')](respondWithResult(_0x18fdad,null))[_0xd049('0x41')](handleError(_0x18fdad,null));};exports['destroy']=function(_0x2d6282,_0x22014e){return db[_0xd049('0x27')][_0xd049('0x45')]({'where':{'id':_0x2d6282[_0xd049('0x43')]['id']}})['then'](handleEntityNotFound(_0x22014e,null))['then'](removeEntity(_0x22014e,null))[_0xd049('0x41')](handleError(_0x22014e,null));};exports[_0xd049('0x48')]=function(_0x96c4c0,_0x107b09,_0x219071){var _0x4cff1d={};var _0x5620db={};var _0x2a616f;var _0x5cd138;return db[_0xd049('0x27')][_0xd049('0x49')]({'where':{'id':_0x96c4c0[_0xd049('0x43')]['id']}})[_0xd049('0x22')](handleEntityNotFound(_0x107b09,null))['then'](function(_0x35dc40){if(_0x35dc40){_0x2a616f=_0x35dc40;_0x5620db[_0xd049('0x2f')]=_[_0xd049('0x44')](db[_0xd049('0x4a')]['rawAttributes']);_0x5620db[_0xd049('0x2c')]=_[_0xd049('0x44')](_0x96c4c0[_0xd049('0x2c')]);_0x5620db[_0xd049('0x2d')]=_[_0xd049('0x2e')](_0x5620db[_0xd049('0x2f')],_0x5620db[_0xd049('0x2c')]);_0x4cff1d[_0xd049('0x31')]=_[_0xd049('0x2e')](_0x5620db[_0xd049('0x2f')],qs[_0xd049('0x30')](_0x96c4c0[_0xd049('0x2c')]['fields']));_0x4cff1d[_0xd049('0x31')]=_0x4cff1d[_0xd049('0x31')][_0xd049('0x32')]?_0x4cff1d['attributes']:_0x5620db[_0xd049('0x2f')];_0x4cff1d[_0xd049('0x35')]=qs[_0xd049('0x36')](_0x96c4c0[_0xd049('0x2c')][_0xd049('0x36')]);_0x4cff1d[_0xd049('0x37')]=qs[_0xd049('0x2d')](_['pick'](_0x96c4c0[_0xd049('0x2c')],_0x5620db['filters']));if(_0x96c4c0[_0xd049('0x2c')][_0xd049('0x39')]){_0x4cff1d[_0xd049('0x37')]=_['merge'](_0x4cff1d['where'],{'$or':_[_0xd049('0x26')](_0x4cff1d[_0xd049('0x31')],function(_0x5c0ee4){var _0x143230={};_0x143230[_0x5c0ee4]={'$like':'%'+_0x96c4c0[_0xd049('0x2c')][_0xd049('0x39')]+'%'};return _0x143230;})});}_0x4cff1d=_['merge']({},_0x4cff1d,_0x96c4c0[_0xd049('0x3c')]);return _0x2a616f[_0xd049('0x48')](_0x4cff1d);}})[_0xd049('0x22')](function(_0x388b45){if(_0x388b45){_0x5cd138=_0x388b45[_0xd049('0x32')];if(!_0x96c4c0[_0xd049('0x2c')][_0xd049('0x33')](_0xd049('0x34'))){_0x4cff1d[_0xd049('0x1c')]=qs[_0xd049('0x1c')](_0x96c4c0[_0xd049('0x2c')][_0xd049('0x1c')]);_0x4cff1d[_0xd049('0x1b')]=qs[_0xd049('0x1b')](_0x96c4c0[_0xd049('0x2c')][_0xd049('0x1b')]);}return _0x2a616f[_0xd049('0x48')](_0x4cff1d);}})[_0xd049('0x22')](function(_0x258af5){if(_0x258af5){return _0x258af5?{'count':_0x5cd138,'rows':_0x258af5}:null;}})['then'](respondWithResult(_0x107b09,null))[_0xd049('0x41')](handleError(_0x107b09,null));};exports[_0xd049('0x4b')]=function(_0x5a4488,_0x25b655,_0x3c997d){if(_0x5a4488[_0xd049('0x47')]['id']){delete _0x5a4488['body']['id'];}return db[_0xd049('0x27')][_0xd049('0x49')]({'where':{'id':_0x5a4488[_0xd049('0x43')]['id']}})[_0xd049('0x22')](handleEntityNotFound(_0x25b655,null))[_0xd049('0x22')](function(_0x35797b){if(_0x35797b){_0x5a4488[_0xd049('0x47')][_0xd049('0x4c')]=_0x35797b['id'];_0x5a4488[_0xd049('0x47')][_0xd049('0x4d')]=integrations[_0xd049('0x4e')](_0x5a4488[_0xd049('0x47')][_0xd049('0x4f')],_0x5a4488['body'][_0xd049('0x2a')]);_0x5a4488[_0xd049('0x47')][_0xd049('0x50')]=integrations[_0xd049('0x51')](_0x5a4488[_0xd049('0x47')][_0xd049('0x4f')],_0x5a4488[_0xd049('0x47')][_0xd049('0x2a')]);return db['DeskConfiguration'][_0xd049('0x46')](_0x5a4488['body'],{'include':[{'model':db['DeskField'],'as':_0xd049('0x4d')},{'model':db[_0xd049('0x52')],'as':_0xd049('0x50')}]});}return null;})[_0xd049('0x22')](respondWithResult(_0x25b655,null))[_0xd049('0x41')](handleError(_0x25b655,null));};exports[_0xd049('0x53')]=function(_0xb5f9b6,_0x284199,_0x51fa5e){var _0xc05707=[{'name':_0xd049('0x54'),'label':_0xd049('0x54'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x23c605='';return db[_0xd049('0x27')][_0xd049('0x49')]({'where':{'id':_0xb5f9b6['params']['id']},'attributes':['id',_0xd049('0x55'),'authType',_0xd049('0x56'),_0xd049('0x57'),_0xd049('0x58'),_0xd049('0x59'),_0xd049('0x5a'),_0xd049('0x5b')]})[_0xd049('0x22')](handleEntityNotFound(_0x284199,null))[_0xd049('0x22')](function(_0x5020b8){if(_0x5020b8){_0x23c605=_0x5020b8[_0xd049('0x55')];var _0x54fecd=_0x23c605[_0xd049('0x5c')](-0x1);if(_0x54fecd==='/'){_0x23c605=_0x23c605[_0xd049('0x5d')](0x0,_0x23c605[_0xd049('0x5e')](_0x54fecd));}var _0x3f1285={'method':_0xd049('0x5f'),'uri':util['format'](_0xd049('0x60'),_0x23c605),'headers':{'Content-Type':_0xd049('0x61'),'Accept':_0xd049('0x61')},'json':!![]};if(_0x5020b8['authType']===_0xd049('0x62')){_0x3f1285[_0xd049('0x63')][_0xd049('0x64')]=util[_0xd049('0x65')](_0xd049('0x66'),new Buffer(util[_0xd049('0x65')](_0xd049('0x67'),_0x5020b8[_0xd049('0x56')],_0x5020b8[_0xd049('0x57')]))['toString'](_0xd049('0x68')));}return rp(_0x3f1285)[_0xd049('0x22')](function(_0x4f7b79){return _0xc05707[_0xd049('0x69')](_[_0xd049('0x26')](_0x4f7b79[_0xd049('0x6a')]['entries'],function(_0x529561){return{'id':_0x529561[_0xd049('0x24')],'name':_0x529561[_0xd049('0x24')],'type':_0x529561['type'],'active':_0x529561['active'],'label':_0x529561['label'],'custom':!![]};}));});}})[_0xd049('0x22')](function(_0x8036e7){return{'count':_0x8036e7[_0xd049('0x32')],'rows':_0x8036e7};})[_0xd049('0x22')](respondWithResult(_0x284199,null))['catch'](function(_0x5eb974){var _0x585060=_0xb5f9b6[_0xd049('0x2c')][_0xd049('0x6b')]?0x1f4:_0x5eb974[_0xd049('0x6c')]||0x1f4;logger[_0xd049('0x23')](_0xd049('0x6d'),_0xd049('0x53'),_0x585060,JSON[_0xd049('0x6e')](_0x5eb974));delete _0x5eb974['name'];if(_0x585060===0x191){_0x585060=0x190;}_0x284199[_0xd049('0x16')](_0x585060)[_0xd049('0x25')](_0xb5f9b6[_0xd049('0x2c')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5eb974[_0xd049('0x6c')]}:_0x5eb974);});}; \ No newline at end of file +var _0x6817=['../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','undefined','count','offset','limit','Content-Range','reject','save','then','destroy','sendStatus','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','DeskAccount','includeAll','include','findAll','catch','params','keys','length','find','create','body','update','getConfigurations','findOne','DeskConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','authType','username','consumerSecret','token','tokenSecret','remoteUri','slice','substring','format','%s/custom_fields','application/json','headers','%s:%s','base64','concat','_embedded','active','label','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api'];(function(_0x4cffdc,_0x2d5427){var _0x316a78=function(_0x3b1e64){while(--_0x3b1e64){_0x4cffdc['push'](_0x4cffdc['shift']());}};_0x316a78(++_0x2d5427);}(_0x6817,0x12c));var _0x7681=function(_0x36db6b,_0x5918c4){_0x36db6b=_0x36db6b-0x0;var _0x211f34=_0x6817[_0x36db6b];return _0x211f34;};'use strict';var emlformat=require(_0x7681('0x0'));var rimraf=require(_0x7681('0x1'));var zipdir=require(_0x7681('0x2'));var jsonpatch=require(_0x7681('0x3'));var rp=require('request-promise');var moment=require(_0x7681('0x4'));var BPromise=require(_0x7681('0x5'));var Mustache=require(_0x7681('0x6'));var util=require(_0x7681('0x7'));var path=require(_0x7681('0x8'));var sox=require(_0x7681('0x9'));var csv=require('to-csv');var ejs=require(_0x7681('0xa'));var fs=require('fs');var fs_extra=require(_0x7681('0xb'));var _=require('lodash');var squel=require(_0x7681('0xc'));var crypto=require('crypto');var jsforce=require(_0x7681('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7681('0xe'));var querystring=require(_0x7681('0xf'));var Papa=require(_0x7681('0x10'));var Redis=require(_0x7681('0x11'));var authService=require(_0x7681('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7681('0x13'))(_0x7681('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7681('0x15'));var db=require(_0x7681('0x16'))['db'];var integrations=require(_0x7681('0x17'));function respondWithStatusCode(_0x123d81,_0x4642af){_0x4642af=_0x4642af||0xcc;return function(_0x57f230){if(_0x57f230){return _0x123d81['sendStatus'](_0x4642af);}return _0x123d81['status'](_0x4642af)[_0x7681('0x18')]();};}function respondWithResult(_0x47b7d3,_0x361ba4){_0x361ba4=_0x361ba4||0xc8;return function(_0x16c742){if(_0x16c742){return _0x47b7d3[_0x7681('0x19')](_0x361ba4)[_0x7681('0x1a')](_0x16c742);}};}function respondWithFilteredResult(_0x18e400,_0x3fcb52){return function(_0x1f7d05){if(_0x1f7d05){var _0x23bd58=typeof _0x3fcb52['offset']===_0x7681('0x1b')&&typeof _0x3fcb52['limit']===_0x7681('0x1b');var _0x5b73b5=_0x1f7d05[_0x7681('0x1c')];var _0x51f289=_0x23bd58?0x0:_0x3fcb52[_0x7681('0x1d')];var _0x687abf=_0x23bd58?_0x1f7d05[_0x7681('0x1c')]:_0x3fcb52[_0x7681('0x1d')]+_0x3fcb52[_0x7681('0x1e')];var _0x223fb1;if(_0x687abf>=_0x5b73b5){_0x687abf=_0x5b73b5;_0x223fb1=0xc8;}else{_0x223fb1=0xce;}_0x18e400[_0x7681('0x19')](_0x223fb1);return _0x18e400['set'](_0x7681('0x1f'),_0x51f289+'-'+_0x687abf+'/'+_0x5b73b5)[_0x7681('0x1a')](_0x1f7d05);}return null;};}function patchUpdates(_0x1b124e){return function(_0x30dbcd){try{jsonpatch['apply'](_0x30dbcd,_0x1b124e,!![]);}catch(_0x17bbed){return BPromise[_0x7681('0x20')](_0x17bbed);}return _0x30dbcd[_0x7681('0x21')]();};}function saveUpdates(_0x5b0297,_0x12e03a){return function(_0x279940){if(_0x279940){return _0x279940['update'](_0x5b0297)[_0x7681('0x22')](function(_0x988f1e){return _0x988f1e;});}return null;};}function removeEntity(_0x5598e3,_0x345041){return function(_0x3bdc10){if(_0x3bdc10){return _0x3bdc10[_0x7681('0x23')]()['then'](function(){_0x5598e3[_0x7681('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c3ef8,_0x5512cc){return function(_0x35836e){if(!_0x35836e){_0x5c3ef8[_0x7681('0x24')](0x194);}return _0x35836e;};}function handleError(_0x35a68c,_0x5a8efb){_0x5a8efb=_0x5a8efb||0x1f4;return function(_0x339fd3){logger['error'](_0x339fd3['stack']);if(_0x339fd3['name']){delete _0x339fd3[_0x7681('0x25')];}_0x35a68c[_0x7681('0x19')](_0x5a8efb)[_0x7681('0x26')](_0x339fd3);};}exports[_0x7681('0x27')]=function(_0x10fdd4,_0x2c5ec4){var _0x111946={},_0x3bc627={},_0xe6af7e={'count':0x0,'rows':[]};var _0x3c73fc=_[_0x7681('0x28')](db['DeskAccount'][_0x7681('0x29')],function(_0x494116){return{'name':_0x494116['fieldName'],'type':_0x494116[_0x7681('0x2a')][_0x7681('0x2b')]};});_0x3bc627[_0x7681('0x2c')]=_['map'](_0x3c73fc,_0x7681('0x25'));_0x3bc627[_0x7681('0x2d')]=_['keys'](_0x10fdd4['query']);_0x3bc627[_0x7681('0x2e')]=_[_0x7681('0x2f')](_0x3bc627['model'],_0x3bc627[_0x7681('0x2d')]);_0x111946[_0x7681('0x30')]=_[_0x7681('0x2f')](_0x3bc627['model'],qs['fields'](_0x10fdd4[_0x7681('0x2d')][_0x7681('0x31')]));_0x111946['attributes']=_0x111946['attributes']['length']?_0x111946[_0x7681('0x30')]:_0x3bc627[_0x7681('0x2c')];if(!_0x10fdd4['query'][_0x7681('0x32')](_0x7681('0x33'))){_0x111946[_0x7681('0x1e')]=qs[_0x7681('0x1e')](_0x10fdd4[_0x7681('0x2d')]['limit']);_0x111946['offset']=qs[_0x7681('0x1d')](_0x10fdd4[_0x7681('0x2d')][_0x7681('0x1d')]);}_0x111946[_0x7681('0x34')]=qs[_0x7681('0x35')](_0x10fdd4[_0x7681('0x2d')][_0x7681('0x35')]);_0x111946[_0x7681('0x36')]=qs[_0x7681('0x2e')](_[_0x7681('0x37')](_0x10fdd4['query'],_0x3bc627[_0x7681('0x2e')]),_0x3c73fc);if(_0x10fdd4['query'][_0x7681('0x38')]){_0x111946[_0x7681('0x36')]=_[_0x7681('0x39')](_0x111946[_0x7681('0x36')],{'$or':_[_0x7681('0x28')](_0x3c73fc,function(_0x25cb49){if(_0x25cb49[_0x7681('0x2a')]!==_0x7681('0x3a')){var _0x4a1deb={};_0x4a1deb[_0x25cb49[_0x7681('0x25')]]={'$like':'%'+_0x10fdd4[_0x7681('0x2d')][_0x7681('0x38')]+'%'};return _0x4a1deb;}})});}_0x111946=_[_0x7681('0x39')]({},_0x111946,_0x10fdd4[_0x7681('0x3b')]);var _0x5021f2={'where':_0x111946[_0x7681('0x36')]};return db[_0x7681('0x3c')][_0x7681('0x1c')](_0x5021f2)[_0x7681('0x22')](function(_0x5cfe88){_0xe6af7e['count']=_0x5cfe88;if(_0x10fdd4[_0x7681('0x2d')][_0x7681('0x3d')]){_0x111946[_0x7681('0x3e')]=[{'all':!![]}];}return db[_0x7681('0x3c')][_0x7681('0x3f')](_0x111946);})[_0x7681('0x22')](function(_0x38cfae){_0xe6af7e['rows']=_0x38cfae;return _0xe6af7e;})[_0x7681('0x22')](respondWithFilteredResult(_0x2c5ec4,_0x111946))[_0x7681('0x40')](handleError(_0x2c5ec4,null));};exports['show']=function(_0x540134,_0x3f2702){var _0x54a003={'raw':![],'where':{'id':_0x540134[_0x7681('0x41')]['id']}},_0x18bbb0={};_0x18bbb0['model']=_[_0x7681('0x42')](db[_0x7681('0x3c')][_0x7681('0x29')]);_0x18bbb0[_0x7681('0x2d')]=_[_0x7681('0x42')](_0x540134[_0x7681('0x2d')]);_0x18bbb0['filters']=_[_0x7681('0x2f')](_0x18bbb0['model'],_0x18bbb0[_0x7681('0x2d')]);_0x54a003[_0x7681('0x30')]=_[_0x7681('0x2f')](_0x18bbb0[_0x7681('0x2c')],qs[_0x7681('0x31')](_0x540134['query'][_0x7681('0x31')]));_0x54a003[_0x7681('0x30')]=_0x54a003[_0x7681('0x30')][_0x7681('0x43')]?_0x54a003['attributes']:_0x18bbb0[_0x7681('0x2c')];if(_0x540134[_0x7681('0x2d')][_0x7681('0x3d')]){_0x54a003[_0x7681('0x3e')]=[{'all':!![]}];}_0x54a003=_[_0x7681('0x39')]({},_0x54a003,_0x540134[_0x7681('0x3b')]);return db['DeskAccount'][_0x7681('0x44')](_0x54a003)[_0x7681('0x22')](handleEntityNotFound(_0x3f2702,null))['then'](respondWithResult(_0x3f2702,null))['catch'](handleError(_0x3f2702,null));};exports[_0x7681('0x45')]=function(_0x2baf75,_0x3573b){return db[_0x7681('0x3c')][_0x7681('0x45')](_0x2baf75[_0x7681('0x46')],{})[_0x7681('0x22')](respondWithResult(_0x3573b,0xc9))['catch'](handleError(_0x3573b,null));};exports[_0x7681('0x47')]=function(_0x214431,_0x101d63){if(_0x214431[_0x7681('0x46')]['id']){delete _0x214431[_0x7681('0x46')]['id'];}return db[_0x7681('0x3c')]['find']({'where':{'id':_0x214431[_0x7681('0x41')]['id']}})[_0x7681('0x22')](handleEntityNotFound(_0x101d63,null))[_0x7681('0x22')](saveUpdates(_0x214431['body'],null))['then'](respondWithResult(_0x101d63,null))[_0x7681('0x40')](handleError(_0x101d63,null));};exports[_0x7681('0x23')]=function(_0x40ed66,_0x42ea9c){return db[_0x7681('0x3c')][_0x7681('0x44')]({'where':{'id':_0x40ed66[_0x7681('0x41')]['id']}})['then'](handleEntityNotFound(_0x42ea9c,null))[_0x7681('0x22')](removeEntity(_0x42ea9c,null))[_0x7681('0x40')](handleError(_0x42ea9c,null));};exports[_0x7681('0x48')]=function(_0x43a570,_0x270ea1,_0x4fead7){var _0x285729={};var _0x40b14d={};var _0x26d442;var _0x3142ba;return db[_0x7681('0x3c')][_0x7681('0x49')]({'where':{'id':_0x43a570[_0x7681('0x41')]['id']}})[_0x7681('0x22')](handleEntityNotFound(_0x270ea1,null))[_0x7681('0x22')](function(_0x456276){if(_0x456276){_0x26d442=_0x456276;_0x40b14d['model']=_['keys'](db[_0x7681('0x4a')][_0x7681('0x29')]);_0x40b14d[_0x7681('0x2d')]=_[_0x7681('0x42')](_0x43a570[_0x7681('0x2d')]);_0x40b14d[_0x7681('0x2e')]=_['intersection'](_0x40b14d[_0x7681('0x2c')],_0x40b14d['query']);_0x285729[_0x7681('0x30')]=_[_0x7681('0x2f')](_0x40b14d[_0x7681('0x2c')],qs['fields'](_0x43a570[_0x7681('0x2d')]['fields']));_0x285729[_0x7681('0x30')]=_0x285729[_0x7681('0x30')]['length']?_0x285729[_0x7681('0x30')]:_0x40b14d[_0x7681('0x2c')];_0x285729[_0x7681('0x34')]=qs[_0x7681('0x35')](_0x43a570[_0x7681('0x2d')]['sort']);_0x285729[_0x7681('0x36')]=qs['filters'](_[_0x7681('0x37')](_0x43a570['query'],_0x40b14d[_0x7681('0x2e')]));if(_0x43a570[_0x7681('0x2d')][_0x7681('0x38')]){_0x285729[_0x7681('0x36')]=_[_0x7681('0x39')](_0x285729[_0x7681('0x36')],{'$or':_[_0x7681('0x28')](_0x285729['attributes'],function(_0x4832c6){var _0x2e5b9b={};_0x2e5b9b[_0x4832c6]={'$like':'%'+_0x43a570[_0x7681('0x2d')][_0x7681('0x38')]+'%'};return _0x2e5b9b;})});}_0x285729=_[_0x7681('0x39')]({},_0x285729,_0x43a570[_0x7681('0x3b')]);return _0x26d442['getConfigurations'](_0x285729);}})[_0x7681('0x22')](function(_0x3f2e50){if(_0x3f2e50){_0x3142ba=_0x3f2e50[_0x7681('0x43')];if(!_0x43a570[_0x7681('0x2d')][_0x7681('0x32')]('nolimit')){_0x285729[_0x7681('0x1e')]=qs[_0x7681('0x1e')](_0x43a570['query'][_0x7681('0x1e')]);_0x285729[_0x7681('0x1d')]=qs[_0x7681('0x1d')](_0x43a570[_0x7681('0x2d')][_0x7681('0x1d')]);}return _0x26d442[_0x7681('0x48')](_0x285729);}})[_0x7681('0x22')](function(_0x25df19){if(_0x25df19){return _0x25df19?{'count':_0x3142ba,'rows':_0x25df19}:null;}})['then'](respondWithResult(_0x270ea1,null))[_0x7681('0x40')](handleError(_0x270ea1,null));};exports[_0x7681('0x4b')]=function(_0x4c29ed,_0x58bd22,_0x22ece9){if(_0x4c29ed[_0x7681('0x46')]['id']){delete _0x4c29ed[_0x7681('0x46')]['id'];}return db['DeskAccount'][_0x7681('0x49')]({'where':{'id':_0x4c29ed[_0x7681('0x41')]['id']}})[_0x7681('0x22')](handleEntityNotFound(_0x58bd22,null))[_0x7681('0x22')](function(_0x2375d1){if(_0x2375d1){_0x4c29ed[_0x7681('0x46')]['AccountId']=_0x2375d1['id'];_0x4c29ed[_0x7681('0x46')][_0x7681('0x4c')]=integrations[_0x7681('0x4d')](_0x4c29ed[_0x7681('0x46')][_0x7681('0x4e')],_0x4c29ed[_0x7681('0x46')][_0x7681('0x2a')]);_0x4c29ed[_0x7681('0x46')][_0x7681('0x4f')]=integrations[_0x7681('0x50')](_0x4c29ed[_0x7681('0x46')]['channel'],_0x4c29ed['body'][_0x7681('0x2a')]);return db[_0x7681('0x4a')][_0x7681('0x45')](_0x4c29ed['body'],{'include':[{'model':db['DeskField'],'as':_0x7681('0x4c')},{'model':db[_0x7681('0x51')],'as':'Descriptions'}]});}return null;})[_0x7681('0x22')](respondWithResult(_0x58bd22,null))[_0x7681('0x40')](handleError(_0x58bd22,null));};exports[_0x7681('0x52')]=function(_0x3a2706,_0x230131,_0x47fdfb){var _0x51c088=[{'name':_0x7681('0x53'),'label':_0x7681('0x53'),'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 _0x25ecdd='';return db[_0x7681('0x3c')][_0x7681('0x49')]({'where':{'id':_0x3a2706['params']['id']},'attributes':['id','remoteUri',_0x7681('0x54'),_0x7681('0x55'),'password','consumerKey',_0x7681('0x56'),_0x7681('0x57'),_0x7681('0x58')]})['then'](handleEntityNotFound(_0x230131,null))[_0x7681('0x22')](function(_0x1e6127){if(_0x1e6127){_0x25ecdd=_0x1e6127[_0x7681('0x59')];var _0x4ce225=_0x25ecdd[_0x7681('0x5a')](-0x1);if(_0x4ce225==='/'){_0x25ecdd=_0x25ecdd[_0x7681('0x5b')](0x0,_0x25ecdd['lastIndexOf'](_0x4ce225));}var _0x51f99b={'method':'GET','uri':util[_0x7681('0x5c')](_0x7681('0x5d'),_0x25ecdd),'headers':{'Content-Type':_0x7681('0x5e'),'Accept':'application/json'},'json':!![]};if(_0x1e6127[_0x7681('0x54')]==='basic'){_0x51f99b[_0x7681('0x5f')]['Authorization']=util[_0x7681('0x5c')]('Basic\x20%s',new Buffer(util['format'](_0x7681('0x60'),_0x1e6127[_0x7681('0x55')],_0x1e6127['password']))['toString'](_0x7681('0x61')));}return rp(_0x51f99b)[_0x7681('0x22')](function(_0x489ad4){return _0x51c088[_0x7681('0x62')](_[_0x7681('0x28')](_0x489ad4[_0x7681('0x63')]['entries'],function(_0x4ebc0b){return{'id':_0x4ebc0b[_0x7681('0x25')],'name':_0x4ebc0b[_0x7681('0x25')],'type':_0x4ebc0b['type'],'active':_0x4ebc0b[_0x7681('0x64')],'label':_0x4ebc0b[_0x7681('0x65')],'custom':!![]};}));});}})[_0x7681('0x22')](function(_0x383cbb){return{'count':_0x383cbb['length'],'rows':_0x383cbb};})[_0x7681('0x22')](respondWithResult(_0x230131,null))['catch'](function(_0xb77dd8){var _0x201366=_0x3a2706[_0x7681('0x2d')]['test']?0x1f4:_0xb77dd8[_0x7681('0x66')]||0x1f4;logger[_0x7681('0x67')](_0x7681('0x68'),_0x7681('0x52'),_0x201366,JSON['stringify'](_0xb77dd8));delete _0xb77dd8[_0x7681('0x25')];if(_0x201366===0x191){_0x201366=0x190;}_0x230131[_0x7681('0x19')](_0x201366)[_0x7681('0x26')](_0x3a2706[_0x7681('0x2d')][_0x7681('0x69')]?{'message':_0x7681('0x6a'),'statusCode':_0xb77dd8[_0x7681('0x66')]}:_0xb77dd8);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index d5dcde2..45f0e35 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 _0x4c1c=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts'];(function(_0x46d9e6,_0x3ae468){var _0x9221bd=function(_0x4e3e0f){while(--_0x4e3e0f){_0x46d9e6['push'](_0x46d9e6['shift']());}};_0x9221bd(++_0x3ae468);}(_0x4c1c,0x188));var _0xc4c1=function(_0x862884,_0x179ce7){_0x862884=_0x862884-0x0;var _0x506c8e=_0x4c1c[_0x862884];return _0x506c8e;};'use strict';var _=require(_0xc4c1('0x0'));var util=require('util');var logger=require(_0xc4c1('0x1'))(_0xc4c1('0x2'));var moment=require(_0xc4c1('0x3'));var BPromise=require(_0xc4c1('0x4'));var rp=require(_0xc4c1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc4c1('0x6'));var config=require(_0xc4c1('0x7'));var attributes=require(_0xc4c1('0x8'));var integrations=require(_0xc4c1('0x9'));module[_0xc4c1('0xa')]=function(_0xceb7ec,_0x48b82e){return _0xceb7ec[_0xc4c1('0xb')](_0xc4c1('0xc'),attributes,{'tableName':_0xc4c1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0506=['moment','request-promise','path','rimraf','../../config/environment','exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x4c367b,_0x2f749e){var _0x122fcb=function(_0x43d063){while(--_0x43d063){_0x4c367b['push'](_0x4c367b['shift']());}};_0x122fcb(++_0x2f749e);}(_0x0506,0xd9));var _0x6050=function(_0x2beccf,_0x571e1e){_0x2beccf=_0x2beccf-0x0;var _0x4f7f2c=_0x0506[_0x2beccf];return _0x4f7f2c;};'use strict';var _=require(_0x6050('0x0'));var util=require(_0x6050('0x1'));var logger=require(_0x6050('0x2'))('api');var moment=require(_0x6050('0x3'));var BPromise=require('bluebird');var rp=require(_0x6050('0x4'));var fs=require('fs');var path=require(_0x6050('0x5'));var rimraf=require(_0x6050('0x6'));var config=require(_0x6050('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x6050('0x8')]=function(_0x57412e,_0x53a912){return _0x57412e['define'](_0x6050('0x9'),attributes,{'tableName':_0x6050('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 540105e..d2e4f85 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 _0x9fbe=['request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskAccount','options','raw','where','attributes','limit','include','model','map','GetDeskAccount','catch','ShowDeskAccount','then','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskAccount,\x20%s,\x20%s'];(function(_0x54794e,_0x2b0d2b){var _0x45e341=function(_0x177698){while(--_0x177698){_0x54794e['push'](_0x54794e['shift']());}};_0x45e341(++_0x2b0d2b);}(_0x9fbe,0x98));var _0xe9fb=function(_0x4cbdc4,_0x8be7a8){_0x4cbdc4=_0x4cbdc4-0x0;var _0x413c70=_0x9fbe[_0x4cbdc4];return _0x413c70;};'use strict';var _=require(_0xe9fb('0x0'));var util=require(_0xe9fb('0x1'));var moment=require(_0xe9fb('0x2'));var BPromise=require('bluebird');var rs=require(_0xe9fb('0x3'));var fs=require('fs');var Redis=require(_0xe9fb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe9fb('0x5'));var config=require(_0xe9fb('0x6'));var jayson=require(_0xe9fb('0x7'));var client=jayson[_0xe9fb('0x8')][_0xe9fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x445419,_0x31458c,_0x106605){return new BPromise(function(_0x4c06bd,_0xb458c3){return client[_0xe9fb('0xa')](_0x445419,_0x106605)['then'](function(_0x3596c7){logger[_0xe9fb('0xb')](_0xe9fb('0xc'),_0x31458c,_0xe9fb('0xd'));logger[_0xe9fb('0xe')](_0xe9fb('0xf'),_0x31458c,'request\x20sent',JSON[_0xe9fb('0x10')](_0x3596c7));if(_0x3596c7['error']){if(_0x3596c7[_0xe9fb('0x11')][_0xe9fb('0x12')]===0x1f4){logger['error'](_0xe9fb('0xc'),_0x31458c,_0x3596c7['error']['message']);return _0xb458c3(_0x3596c7[_0xe9fb('0x11')]['message']);}logger['error'](_0xe9fb('0xc'),_0x31458c,_0x3596c7[_0xe9fb('0x11')][_0xe9fb('0x13')]);return _0x4c06bd(_0x3596c7[_0xe9fb('0x11')][_0xe9fb('0x13')]);}else{logger[_0xe9fb('0xb')](_0xe9fb('0xc'),_0x31458c,_0xe9fb('0xd'));_0x4c06bd(_0x3596c7['result'][_0xe9fb('0x13')]);}})['catch'](function(_0x5f46da){logger[_0xe9fb('0x11')](_0xe9fb('0xc'),_0x31458c,_0x5f46da);_0xb458c3(_0x5f46da);});});}exports['GetDeskAccount']=function(_0x16d68e){var _0x3782c3=this;return new Promise(function(_0x58a6ce,_0x4f901e){return db[_0xe9fb('0x14')]['findAll']({'raw':_0x16d68e[_0xe9fb('0x15')]?_0x16d68e[_0xe9fb('0x15')][_0xe9fb('0x16')]===undefined?!![]:![]:!![],'where':_0x16d68e['options']?_0x16d68e[_0xe9fb('0x15')][_0xe9fb('0x17')]||null:null,'attributes':_0x16d68e[_0xe9fb('0x15')]?_0x16d68e[_0xe9fb('0x15')][_0xe9fb('0x18')]||null:null,'limit':_0x16d68e[_0xe9fb('0x15')]?_0x16d68e[_0xe9fb('0x15')][_0xe9fb('0x19')]||null:null,'include':_0x16d68e[_0xe9fb('0x15')]?_0x16d68e[_0xe9fb('0x15')][_0xe9fb('0x1a')]?_['map'](_0x16d68e['options']['include'],function(_0xa958e2){return{'model':db[_0xa958e2['model']],'as':_0xa958e2['as'],'attributes':_0xa958e2[_0xe9fb('0x18')],'include':_0xa958e2[_0xe9fb('0x1a')]?_['map'](_0xa958e2[_0xe9fb('0x1a')],function(_0x44a588){return{'model':db[_0x44a588[_0xe9fb('0x1b')]],'as':_0x44a588['as'],'attributes':_0x44a588[_0xe9fb('0x18')],'include':_0x44a588[_0xe9fb('0x1a')]?_[_0xe9fb('0x1c')](_0x44a588[_0xe9fb('0x1a')],function(_0x20fc9f){return{'model':db[_0x20fc9f['model']],'as':_0x20fc9f['as'],'attributes':_0x20fc9f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x837dc3){logger[_0xe9fb('0xb')]('GetDeskAccount',_0x16d68e);logger[_0xe9fb('0xe')](_0xe9fb('0x1d'),_0x16d68e,JSON['stringify'](_0x837dc3));_0x58a6ce(_0x837dc3);})[_0xe9fb('0x1e')](function(_0x3a4d16){logger[_0xe9fb('0x11')]('GetDeskAccount',_0x3a4d16['message'],_0x16d68e);_0x4f901e(_0x3782c3[_0xe9fb('0x11')](0x1f4,_0x3a4d16['message']));});});};exports[_0xe9fb('0x1f')]=function(_0x52962d){var _0x48306c=this;return new Promise(function(_0x196c36,_0x2ba4de){return db[_0xe9fb('0x14')]['find']({'raw':_0x52962d[_0xe9fb('0x15')]?_0x52962d[_0xe9fb('0x15')][_0xe9fb('0x16')]===undefined?!![]:![]:!![],'where':_0x52962d[_0xe9fb('0x15')]?_0x52962d[_0xe9fb('0x15')][_0xe9fb('0x17')]||null:null,'attributes':_0x52962d[_0xe9fb('0x15')]?_0x52962d['options'][_0xe9fb('0x18')]||null:null,'include':_0x52962d[_0xe9fb('0x15')]?_0x52962d['options'][_0xe9fb('0x1a')]?_[_0xe9fb('0x1c')](_0x52962d['options'][_0xe9fb('0x1a')],function(_0x3e1258){return{'model':db[_0x3e1258[_0xe9fb('0x1b')]],'as':_0x3e1258['as'],'attributes':_0x3e1258[_0xe9fb('0x18')],'include':_0x3e1258[_0xe9fb('0x1a')]?_['map'](_0x3e1258[_0xe9fb('0x1a')],function(_0x5a87c2){return{'model':db[_0x5a87c2[_0xe9fb('0x1b')]],'as':_0x5a87c2['as'],'attributes':_0x5a87c2[_0xe9fb('0x18')],'include':_0x5a87c2[_0xe9fb('0x1a')]?_[_0xe9fb('0x1c')](_0x5a87c2[_0xe9fb('0x1a')],function(_0x5ead4c){return{'model':db[_0x5ead4c[_0xe9fb('0x1b')]],'as':_0x5ead4c['as'],'attributes':_0x5ead4c[_0xe9fb('0x18')]};}):[]};}):[]};}):[]:[]})[_0xe9fb('0x20')](function(_0x56e692){logger[_0xe9fb('0xb')](_0xe9fb('0x1f'),_0x52962d);logger[_0xe9fb('0xe')](_0xe9fb('0x1f'),_0x52962d,JSON[_0xe9fb('0x10')](_0x56e692));_0x196c36(_0x56e692);})[_0xe9fb('0x1e')](function(_0x352e71){logger[_0xe9fb('0x11')](_0xe9fb('0x1f'),_0x352e71[_0xe9fb('0x13')],_0x52962d);_0x2ba4de(_0x48306c['error'](0x1f4,_0x352e71[_0xe9fb('0x13')]));});});}; \ No newline at end of file +var _0x0c4e=['catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','include','model','attributes','map','info','debug','find','ShowDeskAccount','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','DeskAccount,\x20%s,\x20%s','result'];(function(_0x81dcac,_0x8ff7db){var _0xc7803b=function(_0x499b29){while(--_0x499b29){_0x81dcac['push'](_0x81dcac['shift']());}};_0xc7803b(++_0x8ff7db);}(_0x0c4e,0x164));var _0xe0c4=function(_0x58532e,_0xb2bfc8){_0x58532e=_0x58532e-0x0;var _0x38b946=_0x0c4e[_0x58532e];return _0x38b946;};'use strict';var _=require('lodash');var util=require(_0xe0c4('0x0'));var moment=require(_0xe0c4('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0c4('0x2'));var fs=require('fs');var Redis=require(_0xe0c4('0x3'));var db=require(_0xe0c4('0x4'))['db'];var utils=require(_0xe0c4('0x5'));var logger=require('../../config/logger')(_0xe0c4('0x6'));var config=require(_0xe0c4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe0c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cc59c,_0x3385e9,_0x41308d){return new BPromise(function(_0x4f71b9,_0x47e84e){return client[_0xe0c4('0x9')](_0x5cc59c,_0x41308d)[_0xe0c4('0xa')](function(_0x5ebd4d){logger['info']('DeskAccount,\x20%s,\x20%s',_0x3385e9,_0xe0c4('0xb'));logger['debug'](_0xe0c4('0xc'),_0x3385e9,_0xe0c4('0xb'),JSON[_0xe0c4('0xd')](_0x5ebd4d));if(_0x5ebd4d['error']){if(_0x5ebd4d[_0xe0c4('0xe')]['code']===0x1f4){logger[_0xe0c4('0xe')]('DeskAccount,\x20%s,\x20%s',_0x3385e9,_0x5ebd4d[_0xe0c4('0xe')][_0xe0c4('0xf')]);return _0x47e84e(_0x5ebd4d[_0xe0c4('0xe')][_0xe0c4('0xf')]);}logger[_0xe0c4('0xe')](_0xe0c4('0x10'),_0x3385e9,_0x5ebd4d['error'][_0xe0c4('0xf')]);return _0x4f71b9(_0x5ebd4d[_0xe0c4('0xe')][_0xe0c4('0xf')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x3385e9,_0xe0c4('0xb'));_0x4f71b9(_0x5ebd4d[_0xe0c4('0x11')][_0xe0c4('0xf')]);}})[_0xe0c4('0x12')](function(_0x389d74){logger[_0xe0c4('0xe')](_0xe0c4('0x10'),_0x3385e9,_0x389d74);_0x47e84e(_0x389d74);});});}exports[_0xe0c4('0x13')]=function(_0x51b658){var _0x12089c=this;return new Promise(function(_0xccfb2a,_0x547ec7){return db[_0xe0c4('0x14')][_0xe0c4('0x15')]({'raw':_0x51b658[_0xe0c4('0x16')]?_0x51b658[_0xe0c4('0x16')][_0xe0c4('0x17')]===undefined?!![]:![]:!![],'where':_0x51b658[_0xe0c4('0x16')]?_0x51b658[_0xe0c4('0x16')][_0xe0c4('0x18')]||null:null,'attributes':_0x51b658[_0xe0c4('0x16')]?_0x51b658[_0xe0c4('0x16')]['attributes']||null:null,'limit':_0x51b658[_0xe0c4('0x16')]?_0x51b658[_0xe0c4('0x16')][_0xe0c4('0x19')]||null:null,'include':_0x51b658['options']?_0x51b658[_0xe0c4('0x16')][_0xe0c4('0x1a')]?_['map'](_0x51b658[_0xe0c4('0x16')][_0xe0c4('0x1a')],function(_0x1c1083){return{'model':db[_0x1c1083[_0xe0c4('0x1b')]],'as':_0x1c1083['as'],'attributes':_0x1c1083[_0xe0c4('0x1c')],'include':_0x1c1083[_0xe0c4('0x1a')]?_[_0xe0c4('0x1d')](_0x1c1083[_0xe0c4('0x1a')],function(_0xd4b296){return{'model':db[_0xd4b296['model']],'as':_0xd4b296['as'],'attributes':_0xd4b296[_0xe0c4('0x1c')],'include':_0xd4b296[_0xe0c4('0x1a')]?_[_0xe0c4('0x1d')](_0xd4b296[_0xe0c4('0x1a')],function(_0x557864){return{'model':db[_0x557864[_0xe0c4('0x1b')]],'as':_0x557864['as'],'attributes':_0x557864['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x7722ff){logger[_0xe0c4('0x1e')](_0xe0c4('0x13'),_0x51b658);logger[_0xe0c4('0x1f')](_0xe0c4('0x13'),_0x51b658,JSON[_0xe0c4('0xd')](_0x7722ff));_0xccfb2a(_0x7722ff);})[_0xe0c4('0x12')](function(_0x570867){logger[_0xe0c4('0xe')](_0xe0c4('0x13'),_0x570867[_0xe0c4('0xf')],_0x51b658);_0x547ec7(_0x12089c['error'](0x1f4,_0x570867[_0xe0c4('0xf')]));});});};exports['ShowDeskAccount']=function(_0x317be0){var _0x5d3597=this;return new Promise(function(_0x165c0a,_0x376b02){return db['DeskAccount'][_0xe0c4('0x20')]({'raw':_0x317be0[_0xe0c4('0x16')]?_0x317be0['options']['raw']===undefined?!![]:![]:!![],'where':_0x317be0['options']?_0x317be0['options'][_0xe0c4('0x18')]||null:null,'attributes':_0x317be0[_0xe0c4('0x16')]?_0x317be0['options'][_0xe0c4('0x1c')]||null:null,'include':_0x317be0['options']?_0x317be0[_0xe0c4('0x16')][_0xe0c4('0x1a')]?_['map'](_0x317be0[_0xe0c4('0x16')][_0xe0c4('0x1a')],function(_0x1ffd60){return{'model':db[_0x1ffd60[_0xe0c4('0x1b')]],'as':_0x1ffd60['as'],'attributes':_0x1ffd60[_0xe0c4('0x1c')],'include':_0x1ffd60[_0xe0c4('0x1a')]?_['map'](_0x1ffd60['include'],function(_0x39a004){return{'model':db[_0x39a004[_0xe0c4('0x1b')]],'as':_0x39a004['as'],'attributes':_0x39a004[_0xe0c4('0x1c')],'include':_0x39a004[_0xe0c4('0x1a')]?_['map'](_0x39a004[_0xe0c4('0x1a')],function(_0x2d7606){return{'model':db[_0x2d7606[_0xe0c4('0x1b')]],'as':_0x2d7606['as'],'attributes':_0x2d7606['attributes']};}):[]};}):[]};}):[]:[]})[_0xe0c4('0xa')](function(_0x1f0dd1){logger['info'](_0xe0c4('0x21'),_0x317be0);logger[_0xe0c4('0x1f')]('ShowDeskAccount',_0x317be0,JSON[_0xe0c4('0xd')](_0x1f0dd1));_0x165c0a(_0x1f0dd1);})[_0xe0c4('0x12')](function(_0x1d89bc){logger['error']('ShowDeskAccount',_0x1d89bc[_0xe0c4('0xf')],_0x317be0);_0x376b02(_0x5d3597[_0xe0c4('0xe')](0x1f4,_0x1d89bc['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index d10cb9b..c09987b 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x39cec7,_0x5ccadf){var _0x2816fb=function(_0x8ea9f4){while(--_0x8ea9f4){_0x39cec7['push'](_0x39cec7['shift']());}};_0x2816fb(++_0x5ccadf);}(_0x008c,0x188));var _0xc008=function(_0x1cc3a5,_0x59850b){_0x1cc3a5=_0x1cc3a5-0x0;var _0x4bf8b7=_0x008c[_0x1cc3a5];return _0x4bf8b7;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _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(_0x2d025d,_0x1cd15f){var _0x1c3d25=function(_0x107035){while(--_0x107035){_0x2d025d['push'](_0x2d025d['shift']());}};_0x1c3d25(++_0x1cd15f);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index e3351b7..b3c1aa1 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 _0x32b7=['exports','STRING','sequelize'];(function(_0x33c3f0,_0x35a6a6){var _0x2ce021=function(_0x4f6778){while(--_0x4f6778){_0x33c3f0['push'](_0x33c3f0['shift']());}};_0x2ce021(++_0x35a6a6);}(_0x32b7,0x19d));var _0x732b=function(_0x4d56b5,_0x1a15f2){_0x4d56b5=_0x4d56b5-0x0;var _0x355514=_0x32b7[_0x4d56b5];return _0x355514;};'use strict';var Sequelize=require(_0x732b('0x0'));module[_0x732b('0x1')]={'name':{'type':Sequelize[_0x732b('0x2')]},'description':{'type':Sequelize[_0x732b('0x2')]}}; \ No newline at end of file +var _0xba46=['sequelize','exports','STRING'];(function(_0x2e60e8,_0x4fb1c2){var _0xc74383=function(_0x5831b6){while(--_0x5831b6){_0x2e60e8['push'](_0x2e60e8['shift']());}};_0xc74383(++_0x4fb1c2);}(_0xba46,0xdb));var _0x6ba4=function(_0x5aac87,_0xbc6e8e){_0x5aac87=_0x5aac87-0x0;var _0x6328b5=_0xba46[_0x5aac87];return _0x6328b5;};'use strict';var Sequelize=require(_0x6ba4('0x0'));module[_0x6ba4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6ba4('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 5ac336b..851e12a 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 _0x8475=['model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','include','find','create','body','params','destroy','getFields','findOne','DeskField','length','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','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','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key'];(function(_0x23f558,_0x34d026){var _0x55e9ec=function(_0x7f94e){while(--_0x7f94e){_0x23f558['push'](_0x23f558['shift']());}};_0x55e9ec(++_0x34d026);}(_0x8475,0x1dd));var _0x5847=function(_0x184756,_0xa3e4bb){_0x184756=_0x184756-0x0;var _0x2c9784=_0x8475[_0x184756];return _0x2c9784;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5847('0x0'));var jsonpatch=require(_0x5847('0x1'));var rp=require(_0x5847('0x2'));var moment=require(_0x5847('0x3'));var BPromise=require(_0x5847('0x4'));var Mustache=require(_0x5847('0x5'));var util=require(_0x5847('0x6'));var path=require('path');var sox=require(_0x5847('0x7'));var csv=require('to-csv');var ejs=require(_0x5847('0x8'));var fs=require('fs');var fs_extra=require(_0x5847('0x9'));var _=require(_0x5847('0xa'));var squel=require(_0x5847('0xb'));var crypto=require(_0x5847('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5847('0xd'));var toCsv=require(_0x5847('0xe'));var querystring=require('querystring');var Papa=require(_0x5847('0xf'));var Redis=require(_0x5847('0x10'));var authService=require(_0x5847('0x11'));var qs=require(_0x5847('0x12'));var as=require(_0x5847('0x13'));var hardwareService=require(_0x5847('0x14'));var logger=require('../../config/logger')(_0x5847('0x15'));var utils=require(_0x5847('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5847('0x17'));var db=require(_0x5847('0x18'))['db'];function respondWithStatusCode(_0x56f283,_0x14e2d3){_0x14e2d3=_0x14e2d3||0xcc;return function(_0x52633d){if(_0x52633d){return _0x56f283[_0x5847('0x19')](_0x14e2d3);}return _0x56f283[_0x5847('0x1a')](_0x14e2d3)[_0x5847('0x1b')]();};}function respondWithResult(_0x26f66b,_0x37cb45){_0x37cb45=_0x37cb45||0xc8;return function(_0x34e821){if(_0x34e821){return _0x26f66b['status'](_0x37cb45)[_0x5847('0x1c')](_0x34e821);}};}function respondWithFilteredResult(_0x4b4b19,_0x434af2){return function(_0x393e1e){if(_0x393e1e){var _0x38d139=typeof _0x434af2[_0x5847('0x1d')]==='undefined'&&typeof _0x434af2[_0x5847('0x1e')]===_0x5847('0x1f');var _0x3c25f7=_0x393e1e[_0x5847('0x20')];var _0x32ea7c=_0x38d139?0x0:_0x434af2[_0x5847('0x1d')];var _0x4a71a1=_0x38d139?_0x393e1e['count']:_0x434af2['offset']+_0x434af2[_0x5847('0x1e')];var _0x25810c;if(_0x4a71a1>=_0x3c25f7){_0x4a71a1=_0x3c25f7;_0x25810c=0xc8;}else{_0x25810c=0xce;}_0x4b4b19[_0x5847('0x1a')](_0x25810c);return _0x4b4b19[_0x5847('0x21')](_0x5847('0x22'),_0x32ea7c+'-'+_0x4a71a1+'/'+_0x3c25f7)['json'](_0x393e1e);}return null;};}function patchUpdates(_0x1a5ac0){return function(_0xc77eb3){try{jsonpatch[_0x5847('0x23')](_0xc77eb3,_0x1a5ac0,!![]);}catch(_0x554423){return BPromise[_0x5847('0x24')](_0x554423);}return _0xc77eb3[_0x5847('0x25')]();};}function saveUpdates(_0x456fbd,_0x1dbb5b){return function(_0x5a5f05){if(_0x5a5f05){return _0x5a5f05[_0x5847('0x26')](_0x456fbd)['then'](function(_0x10f64e){return _0x10f64e;});}return null;};}function removeEntity(_0x1df10d,_0x303188){return function(_0xe3c0bb){if(_0xe3c0bb){return _0xe3c0bb['destroy']()[_0x5847('0x27')](function(){_0x1df10d['status'](0xcc)[_0x5847('0x1b')]();});}};}function handleEntityNotFound(_0x9ea49e,_0x1b927f){return function(_0x2c0d5c){if(!_0x2c0d5c){_0x9ea49e[_0x5847('0x19')](0x194);}return _0x2c0d5c;};}function handleError(_0x2514b4,_0x13ff47){_0x13ff47=_0x13ff47||0x1f4;return function(_0x4b054d){logger[_0x5847('0x28')](_0x4b054d[_0x5847('0x29')]);if(_0x4b054d['name']){delete _0x4b054d[_0x5847('0x2a')];}_0x2514b4['status'](_0x13ff47)[_0x5847('0x2b')](_0x4b054d);};}exports[_0x5847('0x2c')]=function(_0x51a635,_0x52847f){var _0x46b110={},_0x29ad3d={},_0x29c2a4={'count':0x0,'rows':[]};var _0x598c10=_[_0x5847('0x2d')](db[_0x5847('0x2e')][_0x5847('0x2f')],function(_0x291cc6){return{'name':_0x291cc6[_0x5847('0x30')],'type':_0x291cc6[_0x5847('0x31')][_0x5847('0x32')]};});_0x29ad3d[_0x5847('0x33')]=_[_0x5847('0x2d')](_0x598c10,_0x5847('0x2a'));_0x29ad3d[_0x5847('0x34')]=_[_0x5847('0x35')](_0x51a635[_0x5847('0x34')]);_0x29ad3d[_0x5847('0x36')]=_[_0x5847('0x37')](_0x29ad3d[_0x5847('0x33')],_0x29ad3d[_0x5847('0x34')]);_0x46b110[_0x5847('0x38')]=_[_0x5847('0x37')](_0x29ad3d[_0x5847('0x33')],qs['fields'](_0x51a635[_0x5847('0x34')][_0x5847('0x39')]));_0x46b110[_0x5847('0x38')]=_0x46b110[_0x5847('0x38')]['length']?_0x46b110['attributes']:_0x29ad3d['model'];if(!_0x51a635[_0x5847('0x34')]['hasOwnProperty'](_0x5847('0x3a'))){_0x46b110[_0x5847('0x1e')]=qs['limit'](_0x51a635['query'][_0x5847('0x1e')]);_0x46b110[_0x5847('0x1d')]=qs[_0x5847('0x1d')](_0x51a635[_0x5847('0x34')][_0x5847('0x1d')]);}_0x46b110[_0x5847('0x3b')]=qs[_0x5847('0x3c')](_0x51a635[_0x5847('0x34')][_0x5847('0x3c')]);_0x46b110[_0x5847('0x3d')]=qs[_0x5847('0x36')](_[_0x5847('0x3e')](_0x51a635[_0x5847('0x34')],_0x29ad3d[_0x5847('0x36')]),_0x598c10);if(_0x51a635[_0x5847('0x34')][_0x5847('0x3f')]){_0x46b110[_0x5847('0x3d')]=_['merge'](_0x46b110[_0x5847('0x3d')],{'$or':_[_0x5847('0x2d')](_0x598c10,function(_0x6fc231){if(_0x6fc231['type']!==_0x5847('0x40')){var _0x54693c={};_0x54693c[_0x6fc231[_0x5847('0x2a')]]={'$like':'%'+_0x51a635[_0x5847('0x34')]['filter']+'%'};return _0x54693c;}})});}_0x46b110=_[_0x5847('0x41')]({},_0x46b110,_0x51a635[_0x5847('0x42')]);var _0x53c898={'where':_0x46b110[_0x5847('0x3d')]};return db[_0x5847('0x2e')][_0x5847('0x20')](_0x53c898)[_0x5847('0x27')](function(_0x3195e3){_0x29c2a4[_0x5847('0x20')]=_0x3195e3;if(_0x51a635[_0x5847('0x34')][_0x5847('0x43')]){_0x46b110['include']=[{'all':!![]}];}return db[_0x5847('0x2e')][_0x5847('0x44')](_0x46b110);})[_0x5847('0x27')](function(_0x36b18b){_0x29c2a4[_0x5847('0x45')]=_0x36b18b;return _0x29c2a4;})['then'](respondWithFilteredResult(_0x52847f,_0x46b110))[_0x5847('0x46')](handleError(_0x52847f,null));};exports['show']=function(_0x1de458,_0x6ae62e){var _0x1ccdcf={'raw':![],'where':{'id':_0x1de458['params']['id']}},_0x9a896c={};_0x9a896c[_0x5847('0x33')]=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x9a896c['query']=_[_0x5847('0x35')](_0x1de458[_0x5847('0x34')]);_0x9a896c[_0x5847('0x36')]=_[_0x5847('0x37')](_0x9a896c[_0x5847('0x33')],_0x9a896c[_0x5847('0x34')]);_0x1ccdcf[_0x5847('0x38')]=_[_0x5847('0x37')](_0x9a896c[_0x5847('0x33')],qs[_0x5847('0x39')](_0x1de458['query']['fields']));_0x1ccdcf[_0x5847('0x38')]=_0x1ccdcf[_0x5847('0x38')]['length']?_0x1ccdcf[_0x5847('0x38')]:_0x9a896c[_0x5847('0x33')];if(_0x1de458[_0x5847('0x34')][_0x5847('0x43')]){_0x1ccdcf[_0x5847('0x47')]=[{'all':!![]}];}_0x1ccdcf=_[_0x5847('0x41')]({},_0x1ccdcf,_0x1de458[_0x5847('0x42')]);return db[_0x5847('0x2e')][_0x5847('0x48')](_0x1ccdcf)['then'](handleEntityNotFound(_0x6ae62e,null))[_0x5847('0x27')](respondWithResult(_0x6ae62e,null))['catch'](handleError(_0x6ae62e,null));};exports[_0x5847('0x49')]=function(_0x4267b5,_0x5bff5c){return db['DeskConfiguration'][_0x5847('0x49')](_0x4267b5[_0x5847('0x4a')],{})[_0x5847('0x27')](respondWithResult(_0x5bff5c,0xc9))[_0x5847('0x46')](handleError(_0x5bff5c,null));};exports[_0x5847('0x26')]=function(_0x14d32a,_0x37b302){if(_0x14d32a[_0x5847('0x4a')]['id']){delete _0x14d32a[_0x5847('0x4a')]['id'];}return db[_0x5847('0x2e')]['find']({'where':{'id':_0x14d32a[_0x5847('0x4b')]['id']}})['then'](handleEntityNotFound(_0x37b302,null))[_0x5847('0x27')](saveUpdates(_0x14d32a[_0x5847('0x4a')],null))[_0x5847('0x27')](respondWithResult(_0x37b302,null))[_0x5847('0x46')](handleError(_0x37b302,null));};exports[_0x5847('0x4c')]=function(_0x1be624,_0x520071){return db[_0x5847('0x2e')]['find']({'where':{'id':_0x1be624['params']['id']}})['then'](handleEntityNotFound(_0x520071,null))[_0x5847('0x27')](removeEntity(_0x520071,null))[_0x5847('0x46')](handleError(_0x520071,null));};exports[_0x5847('0x4d')]=function(_0x25e254,_0x14652e,_0x389ece){var _0x30dfd6={};var _0x4dc0e4={};var _0x2e1949;var _0x120b91;return db[_0x5847('0x2e')][_0x5847('0x4e')]({'where':{'id':_0x25e254[_0x5847('0x4b')]['id']}})[_0x5847('0x27')](handleEntityNotFound(_0x14652e,null))[_0x5847('0x27')](function(_0x19ae09){if(_0x19ae09){_0x2e1949=_0x19ae09;_0x4dc0e4['model']=_['keys'](db[_0x5847('0x4f')][_0x5847('0x2f')]);_0x4dc0e4[_0x5847('0x34')]=_[_0x5847('0x35')](_0x25e254[_0x5847('0x34')]);_0x4dc0e4[_0x5847('0x36')]=_[_0x5847('0x37')](_0x4dc0e4['model'],_0x4dc0e4[_0x5847('0x34')]);_0x30dfd6['attributes']=_[_0x5847('0x37')](_0x4dc0e4[_0x5847('0x33')],qs[_0x5847('0x39')](_0x25e254[_0x5847('0x34')][_0x5847('0x39')]));_0x30dfd6[_0x5847('0x38')]=_0x30dfd6[_0x5847('0x38')][_0x5847('0x50')]?_0x30dfd6[_0x5847('0x38')]:_0x4dc0e4[_0x5847('0x33')];_0x30dfd6[_0x5847('0x3b')]=qs[_0x5847('0x3c')](_0x25e254[_0x5847('0x34')][_0x5847('0x3c')]);_0x30dfd6['where']=qs[_0x5847('0x36')](_['pick'](_0x25e254[_0x5847('0x34')],_0x4dc0e4['filters']));if(_0x25e254[_0x5847('0x34')][_0x5847('0x3f')]){_0x30dfd6[_0x5847('0x3d')]=_[_0x5847('0x41')](_0x30dfd6['where'],{'$or':_[_0x5847('0x2d')](_0x30dfd6['attributes'],function(_0x12d695){var _0x1b28e2={};_0x1b28e2[_0x12d695]={'$like':'%'+_0x25e254[_0x5847('0x34')][_0x5847('0x3f')]+'%'};return _0x1b28e2;})});}_0x30dfd6=_[_0x5847('0x41')]({},_0x30dfd6,_0x25e254[_0x5847('0x42')]);return _0x2e1949[_0x5847('0x4d')](_0x30dfd6);}})[_0x5847('0x27')](function(_0x54ec04){if(_0x54ec04){_0x120b91=_0x54ec04[_0x5847('0x50')];if(!_0x25e254[_0x5847('0x34')][_0x5847('0x51')](_0x5847('0x3a'))){_0x30dfd6[_0x5847('0x1e')]=qs[_0x5847('0x1e')](_0x25e254[_0x5847('0x34')][_0x5847('0x1e')]);_0x30dfd6['offset']=qs['offset'](_0x25e254['query'][_0x5847('0x1d')]);}return _0x2e1949[_0x5847('0x4d')](_0x30dfd6);}})[_0x5847('0x27')](function(_0x2f4bf0){if(_0x2f4bf0){return _0x2f4bf0?{'count':_0x120b91,'rows':_0x2f4bf0}:null;}})['then'](respondWithResult(_0x14652e,null))[_0x5847('0x46')](handleError(_0x14652e,null));};exports['getSubjects']=function(_0x84a2dc,_0x1eee4e,_0x318f16){var _0x2ef9d1={};var _0x294989={};var _0x31b98e;var _0xc58c32;return db[_0x5847('0x2e')][_0x5847('0x4e')]({'where':{'id':_0x84a2dc[_0x5847('0x4b')]['id']}})[_0x5847('0x27')](handleEntityNotFound(_0x1eee4e,null))[_0x5847('0x27')](function(_0x273fb8){if(_0x273fb8){_0x31b98e=_0x273fb8;_0x294989[_0x5847('0x33')]=_[_0x5847('0x35')](db['DeskField'][_0x5847('0x2f')]);_0x294989[_0x5847('0x34')]=_[_0x5847('0x35')](_0x84a2dc[_0x5847('0x34')]);_0x294989[_0x5847('0x36')]=_[_0x5847('0x37')](_0x294989[_0x5847('0x33')],_0x294989[_0x5847('0x34')]);_0x2ef9d1[_0x5847('0x38')]=_['intersection'](_0x294989[_0x5847('0x33')],qs[_0x5847('0x39')](_0x84a2dc['query'][_0x5847('0x39')]));_0x2ef9d1[_0x5847('0x38')]=_0x2ef9d1[_0x5847('0x38')][_0x5847('0x50')]?_0x2ef9d1['attributes']:_0x294989[_0x5847('0x33')];_0x2ef9d1['order']=qs[_0x5847('0x3c')](_0x84a2dc[_0x5847('0x34')][_0x5847('0x3c')]);_0x2ef9d1[_0x5847('0x3d')]=qs[_0x5847('0x36')](_[_0x5847('0x3e')](_0x84a2dc['query'],_0x294989[_0x5847('0x36')]));if(_0x84a2dc['query'][_0x5847('0x3f')]){_0x2ef9d1[_0x5847('0x3d')]=_[_0x5847('0x41')](_0x2ef9d1['where'],{'$or':_[_0x5847('0x2d')](_0x2ef9d1['attributes'],function(_0x385d45){var _0x86a6b2={};_0x86a6b2[_0x385d45]={'$like':'%'+_0x84a2dc[_0x5847('0x34')][_0x5847('0x3f')]+'%'};return _0x86a6b2;})});}_0x2ef9d1=_[_0x5847('0x41')]({},_0x2ef9d1,_0x84a2dc['options']);return _0x31b98e['getSubjects'](_0x2ef9d1);}})[_0x5847('0x27')](function(_0x417bd0){if(_0x417bd0){_0xc58c32=_0x417bd0[_0x5847('0x50')];if(!_0x84a2dc[_0x5847('0x34')][_0x5847('0x51')]('nolimit')){_0x2ef9d1['limit']=qs[_0x5847('0x1e')](_0x84a2dc[_0x5847('0x34')][_0x5847('0x1e')]);_0x2ef9d1[_0x5847('0x1d')]=qs[_0x5847('0x1d')](_0x84a2dc['query']['offset']);}return _0x31b98e[_0x5847('0x52')](_0x2ef9d1);}})[_0x5847('0x27')](function(_0x4b2451){if(_0x4b2451){return _0x4b2451?{'count':_0xc58c32,'rows':_0x4b2451}:null;}})['then'](respondWithResult(_0x1eee4e,null))[_0x5847('0x46')](handleError(_0x1eee4e,null));};exports[_0x5847('0x53')]=function(_0x182b30,_0x503ba6,_0x213270){var _0x1a7b19={};var _0xbda48b={};var _0x42be35;var _0x594e94;return db['DeskConfiguration'][_0x5847('0x4e')]({'where':{'id':_0x182b30[_0x5847('0x4b')]['id']}})[_0x5847('0x27')](handleEntityNotFound(_0x503ba6,null))[_0x5847('0x27')](function(_0x2cd833){if(_0x2cd833){_0x42be35=_0x2cd833;_0xbda48b[_0x5847('0x33')]=_['keys'](db[_0x5847('0x4f')]['rawAttributes']);_0xbda48b[_0x5847('0x34')]=_['keys'](_0x182b30[_0x5847('0x34')]);_0xbda48b['filters']=_['intersection'](_0xbda48b[_0x5847('0x33')],_0xbda48b[_0x5847('0x34')]);_0x1a7b19[_0x5847('0x38')]=_[_0x5847('0x37')](_0xbda48b[_0x5847('0x33')],qs[_0x5847('0x39')](_0x182b30[_0x5847('0x34')][_0x5847('0x39')]));_0x1a7b19[_0x5847('0x38')]=_0x1a7b19[_0x5847('0x38')]['length']?_0x1a7b19['attributes']:_0xbda48b['model'];_0x1a7b19[_0x5847('0x3b')]=qs[_0x5847('0x3c')](_0x182b30[_0x5847('0x34')][_0x5847('0x3c')]);_0x1a7b19[_0x5847('0x3d')]=qs[_0x5847('0x36')](_['pick'](_0x182b30['query'],_0xbda48b[_0x5847('0x36')]));if(_0x182b30[_0x5847('0x34')][_0x5847('0x3f')]){_0x1a7b19[_0x5847('0x3d')]=_[_0x5847('0x41')](_0x1a7b19['where'],{'$or':_[_0x5847('0x2d')](_0x1a7b19['attributes'],function(_0x5eae0c){var _0x296e1c={};_0x296e1c[_0x5eae0c]={'$like':'%'+_0x182b30[_0x5847('0x34')]['filter']+'%'};return _0x296e1c;})});}_0x1a7b19=_[_0x5847('0x41')]({},_0x1a7b19,_0x182b30[_0x5847('0x42')]);return _0x42be35[_0x5847('0x53')](_0x1a7b19);}})[_0x5847('0x27')](function(_0xa98bf4){if(_0xa98bf4){_0x594e94=_0xa98bf4['length'];if(!_0x182b30[_0x5847('0x34')]['hasOwnProperty'](_0x5847('0x3a'))){_0x1a7b19[_0x5847('0x1e')]=qs[_0x5847('0x1e')](_0x182b30['query']['limit']);_0x1a7b19['offset']=qs['offset'](_0x182b30[_0x5847('0x34')]['offset']);}return _0x42be35[_0x5847('0x53')](_0x1a7b19);}})['then'](function(_0x244c3b){if(_0x244c3b){return _0x244c3b?{'count':_0x594e94,'rows':_0x244c3b}:null;}})[_0x5847('0x27')](respondWithResult(_0x503ba6,null))['catch'](handleError(_0x503ba6,null));};exports[_0x5847('0x54')]=function(_0x51721e,_0x5ea75a,_0x3eed8f){var _0x16f4c3={};var _0x21b3a5={};var _0x3144b1;var _0x18eea7;return db[_0x5847('0x2e')][_0x5847('0x4e')]({'where':{'id':_0x51721e[_0x5847('0x4b')]['id']}})[_0x5847('0x27')](handleEntityNotFound(_0x5ea75a,null))['then'](function(_0x3e0217){if(_0x3e0217){_0x3144b1=_0x3e0217;_0x21b3a5[_0x5847('0x33')]=_[_0x5847('0x35')](db[_0x5847('0x55')]['rawAttributes']);_0x21b3a5['query']=_[_0x5847('0x35')](_0x51721e[_0x5847('0x34')]);_0x21b3a5[_0x5847('0x36')]=_[_0x5847('0x37')](_0x21b3a5['model'],_0x21b3a5[_0x5847('0x34')]);_0x16f4c3[_0x5847('0x38')]=_[_0x5847('0x37')](_0x21b3a5[_0x5847('0x33')],qs[_0x5847('0x39')](_0x51721e[_0x5847('0x34')][_0x5847('0x39')]));_0x16f4c3[_0x5847('0x38')]=_0x16f4c3[_0x5847('0x38')][_0x5847('0x50')]?_0x16f4c3[_0x5847('0x38')]:_0x21b3a5[_0x5847('0x33')];_0x16f4c3[_0x5847('0x3b')]=qs[_0x5847('0x3c')](_0x51721e[_0x5847('0x34')][_0x5847('0x3c')]);_0x16f4c3[_0x5847('0x3d')]=qs[_0x5847('0x36')](_[_0x5847('0x3e')](_0x51721e[_0x5847('0x34')],_0x21b3a5[_0x5847('0x36')]));if(_0x51721e['query'][_0x5847('0x3f')]){_0x16f4c3[_0x5847('0x3d')]=_[_0x5847('0x41')](_0x16f4c3['where'],{'$or':_['map'](_0x16f4c3[_0x5847('0x38')],function(_0x2a3092){var _0x135f7e={};_0x135f7e[_0x2a3092]={'$like':'%'+_0x51721e[_0x5847('0x34')]['filter']+'%'};return _0x135f7e;})});}_0x16f4c3=_[_0x5847('0x41')]({},_0x16f4c3,_0x51721e[_0x5847('0x42')]);return _0x3144b1[_0x5847('0x54')](_0x16f4c3);}})['then'](function(_0x6e271e){if(_0x6e271e){_0x18eea7=_0x6e271e[_0x5847('0x50')];if(!_0x51721e['query'][_0x5847('0x51')](_0x5847('0x3a'))){_0x16f4c3[_0x5847('0x1e')]=qs[_0x5847('0x1e')](_0x51721e[_0x5847('0x34')][_0x5847('0x1e')]);_0x16f4c3[_0x5847('0x1d')]=qs[_0x5847('0x1d')](_0x51721e[_0x5847('0x34')][_0x5847('0x1d')]);}return _0x3144b1[_0x5847('0x54')](_0x16f4c3);}})[_0x5847('0x27')](function(_0x4624a9){if(_0x4624a9){return _0x4624a9?{'count':_0x18eea7,'rows':_0x4624a9}:null;}})[_0x5847('0x27')](respondWithResult(_0x5ea75a,null))[_0x5847('0x46')](handleError(_0x5ea75a,null));};exports[_0x5847('0x56')]=function(_0x34c6f5,_0x3fafdc,_0x335e44){if(_0x34c6f5[_0x5847('0x4a')]['id']){delete _0x34c6f5['body']['id'];}return db['DeskConfiguration'][_0x5847('0x4e')]({'where':{'id':_0x34c6f5['params']['id']}})[_0x5847('0x27')](handleEntityNotFound(_0x3fafdc,null))[_0x5847('0x27')](function(_0x49c98d){if(_0x49c98d){return _0x49c98d[_0x5847('0x56')](_0x34c6f5['body'][_0x5847('0x57')]||[]);}return null;})['then'](respondWithResult(_0x3fafdc,null))[_0x5847('0x46')](handleError(_0x3fafdc,null));}; \ No newline at end of file +var _0x7a3d=['update','params','getFields','findOne','DeskField','getSubjects','getDescriptions','hasOwnProperty','Tag','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','Content-Range','apply','reject','destroy','then','end','sendStatus','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body'];(function(_0x45f00b,_0x19ba21){var _0x4c4c0b=function(_0x3b59fd){while(--_0x3b59fd){_0x45f00b['push'](_0x45f00b['shift']());}};_0x4c4c0b(++_0x19ba21);}(_0x7a3d,0x16b));var _0xd7a3=function(_0x205a52,_0x319f69){_0x205a52=_0x205a52-0x0;var _0x4cec1b=_0x7a3d[_0x205a52];return _0x4cec1b;};'use strict';var emlformat=require(_0xd7a3('0x0'));var rimraf=require(_0xd7a3('0x1'));var zipdir=require(_0xd7a3('0x2'));var jsonpatch=require(_0xd7a3('0x3'));var rp=require(_0xd7a3('0x4'));var moment=require(_0xd7a3('0x5'));var BPromise=require(_0xd7a3('0x6'));var Mustache=require(_0xd7a3('0x7'));var util=require(_0xd7a3('0x8'));var path=require(_0xd7a3('0x9'));var sox=require(_0xd7a3('0xa'));var csv=require(_0xd7a3('0xb'));var ejs=require(_0xd7a3('0xc'));var fs=require('fs');var fs_extra=require(_0xd7a3('0xd'));var _=require('lodash');var squel=require(_0xd7a3('0xe'));var crypto=require(_0xd7a3('0xf'));var jsforce=require(_0xd7a3('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd7a3('0x11'));var Redis=require(_0xd7a3('0x12'));var authService=require(_0xd7a3('0x13'));var qs=require(_0xd7a3('0x14'));var as=require(_0xd7a3('0x15'));var hardwareService=require(_0xd7a3('0x16'));var logger=require('../../config/logger')(_0xd7a3('0x17'));var utils=require(_0xd7a3('0x18'));var config=require(_0xd7a3('0x19'));var licenseUtil=require(_0xd7a3('0x1a'));var db=require(_0xd7a3('0x1b'))['db'];function respondWithStatusCode(_0x167603,_0x1a45fa){_0x1a45fa=_0x1a45fa||0xcc;return function(_0x8eea6a){if(_0x8eea6a){return _0x167603['sendStatus'](_0x1a45fa);}return _0x167603[_0xd7a3('0x1c')](_0x1a45fa)['end']();};}function respondWithResult(_0x4896d1,_0x4c483c){_0x4c483c=_0x4c483c||0xc8;return function(_0x1bf4d7){if(_0x1bf4d7){return _0x4896d1[_0xd7a3('0x1c')](_0x4c483c)[_0xd7a3('0x1d')](_0x1bf4d7);}};}function respondWithFilteredResult(_0x37b9b6,_0x53184c){return function(_0x1fdfb5){if(_0x1fdfb5){var _0x37d32a=typeof _0x53184c[_0xd7a3('0x1e')]==='undefined'&&typeof _0x53184c[_0xd7a3('0x1f')]===_0xd7a3('0x20');var _0x5ea47c=_0x1fdfb5[_0xd7a3('0x21')];var _0x237176=_0x37d32a?0x0:_0x53184c[_0xd7a3('0x1e')];var _0x2091f3=_0x37d32a?_0x1fdfb5[_0xd7a3('0x21')]:_0x53184c[_0xd7a3('0x1e')]+_0x53184c[_0xd7a3('0x1f')];var _0x2ccffc;if(_0x2091f3>=_0x5ea47c){_0x2091f3=_0x5ea47c;_0x2ccffc=0xc8;}else{_0x2ccffc=0xce;}_0x37b9b6['status'](_0x2ccffc);return _0x37b9b6['set'](_0xd7a3('0x22'),_0x237176+'-'+_0x2091f3+'/'+_0x5ea47c)[_0xd7a3('0x1d')](_0x1fdfb5);}return null;};}function patchUpdates(_0x3f2e7a){return function(_0x16a45d){try{jsonpatch[_0xd7a3('0x23')](_0x16a45d,_0x3f2e7a,!![]);}catch(_0xdc92ee){return BPromise[_0xd7a3('0x24')](_0xdc92ee);}return _0x16a45d['save']();};}function saveUpdates(_0x6ec788,_0x3de763){return function(_0x5bd961){if(_0x5bd961){return _0x5bd961['update'](_0x6ec788)['then'](function(_0xa9a9){return _0xa9a9;});}return null;};}function removeEntity(_0x2acce1,_0x5607be){return function(_0x161e51){if(_0x161e51){return _0x161e51[_0xd7a3('0x25')]()[_0xd7a3('0x26')](function(){_0x2acce1['status'](0xcc)[_0xd7a3('0x27')]();});}};}function handleEntityNotFound(_0x274008,_0x502f2b){return function(_0x27d728){if(!_0x27d728){_0x274008[_0xd7a3('0x28')](0x194);}return _0x27d728;};}function handleError(_0x3b8bbb,_0x3ad098){_0x3ad098=_0x3ad098||0x1f4;return function(_0x2337d1){logger[_0xd7a3('0x29')](_0x2337d1[_0xd7a3('0x2a')]);if(_0x2337d1[_0xd7a3('0x2b')]){delete _0x2337d1[_0xd7a3('0x2b')];}_0x3b8bbb[_0xd7a3('0x1c')](_0x3ad098)[_0xd7a3('0x2c')](_0x2337d1);};}exports[_0xd7a3('0x2d')]=function(_0x47ec6a,_0x115693){var _0x4eaacd={},_0x392cd1={},_0x50da89={'count':0x0,'rows':[]};var _0x84ce9f=_[_0xd7a3('0x2e')](db[_0xd7a3('0x2f')][_0xd7a3('0x30')],function(_0xacc636){return{'name':_0xacc636[_0xd7a3('0x31')],'type':_0xacc636[_0xd7a3('0x32')]['key']};});_0x392cd1[_0xd7a3('0x33')]=_[_0xd7a3('0x2e')](_0x84ce9f,_0xd7a3('0x2b'));_0x392cd1['query']=_['keys'](_0x47ec6a[_0xd7a3('0x34')]);_0x392cd1[_0xd7a3('0x35')]=_[_0xd7a3('0x36')](_0x392cd1[_0xd7a3('0x33')],_0x392cd1[_0xd7a3('0x34')]);_0x4eaacd[_0xd7a3('0x37')]=_[_0xd7a3('0x36')](_0x392cd1['model'],qs[_0xd7a3('0x38')](_0x47ec6a[_0xd7a3('0x34')][_0xd7a3('0x38')]));_0x4eaacd[_0xd7a3('0x37')]=_0x4eaacd[_0xd7a3('0x37')][_0xd7a3('0x39')]?_0x4eaacd[_0xd7a3('0x37')]:_0x392cd1[_0xd7a3('0x33')];if(!_0x47ec6a[_0xd7a3('0x34')]['hasOwnProperty'](_0xd7a3('0x3a'))){_0x4eaacd[_0xd7a3('0x1f')]=qs['limit'](_0x47ec6a[_0xd7a3('0x34')][_0xd7a3('0x1f')]);_0x4eaacd[_0xd7a3('0x1e')]=qs['offset'](_0x47ec6a[_0xd7a3('0x34')]['offset']);}_0x4eaacd[_0xd7a3('0x3b')]=qs['sort'](_0x47ec6a['query'][_0xd7a3('0x3c')]);_0x4eaacd[_0xd7a3('0x3d')]=qs['filters'](_[_0xd7a3('0x3e')](_0x47ec6a[_0xd7a3('0x34')],_0x392cd1['filters']),_0x84ce9f);if(_0x47ec6a[_0xd7a3('0x34')][_0xd7a3('0x3f')]){_0x4eaacd[_0xd7a3('0x3d')]=_[_0xd7a3('0x40')](_0x4eaacd[_0xd7a3('0x3d')],{'$or':_[_0xd7a3('0x2e')](_0x84ce9f,function(_0x595af7){if(_0x595af7[_0xd7a3('0x32')]!==_0xd7a3('0x41')){var _0x1d0d89={};_0x1d0d89[_0x595af7['name']]={'$like':'%'+_0x47ec6a[_0xd7a3('0x34')]['filter']+'%'};return _0x1d0d89;}})});}_0x4eaacd=_['merge']({},_0x4eaacd,_0x47ec6a[_0xd7a3('0x42')]);var _0x3a9fd2={'where':_0x4eaacd[_0xd7a3('0x3d')]};return db[_0xd7a3('0x2f')][_0xd7a3('0x21')](_0x3a9fd2)[_0xd7a3('0x26')](function(_0x426b15){_0x50da89[_0xd7a3('0x21')]=_0x426b15;if(_0x47ec6a[_0xd7a3('0x34')][_0xd7a3('0x43')]){_0x4eaacd[_0xd7a3('0x44')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xd7a3('0x45')](_0x4eaacd);})[_0xd7a3('0x26')](function(_0xaa9d91){_0x50da89[_0xd7a3('0x46')]=_0xaa9d91;return _0x50da89;})[_0xd7a3('0x26')](respondWithFilteredResult(_0x115693,_0x4eaacd))[_0xd7a3('0x47')](handleError(_0x115693,null));};exports[_0xd7a3('0x48')]=function(_0x7a670c,_0x479124){var _0x5a409c={'raw':![],'where':{'id':_0x7a670c['params']['id']}},_0x2d69bb={};_0x2d69bb[_0xd7a3('0x33')]=_[_0xd7a3('0x49')](db[_0xd7a3('0x2f')][_0xd7a3('0x30')]);_0x2d69bb[_0xd7a3('0x34')]=_[_0xd7a3('0x49')](_0x7a670c[_0xd7a3('0x34')]);_0x2d69bb['filters']=_[_0xd7a3('0x36')](_0x2d69bb[_0xd7a3('0x33')],_0x2d69bb[_0xd7a3('0x34')]);_0x5a409c[_0xd7a3('0x37')]=_['intersection'](_0x2d69bb[_0xd7a3('0x33')],qs[_0xd7a3('0x38')](_0x7a670c[_0xd7a3('0x34')]['fields']));_0x5a409c[_0xd7a3('0x37')]=_0x5a409c['attributes'][_0xd7a3('0x39')]?_0x5a409c[_0xd7a3('0x37')]:_0x2d69bb[_0xd7a3('0x33')];if(_0x7a670c[_0xd7a3('0x34')][_0xd7a3('0x43')]){_0x5a409c['include']=[{'all':!![]}];}_0x5a409c=_['merge']({},_0x5a409c,_0x7a670c[_0xd7a3('0x42')]);return db['DeskConfiguration'][_0xd7a3('0x4a')](_0x5a409c)['then'](handleEntityNotFound(_0x479124,null))['then'](respondWithResult(_0x479124,null))[_0xd7a3('0x47')](handleError(_0x479124,null));};exports['create']=function(_0x12db39,_0x18c662){return db[_0xd7a3('0x2f')][_0xd7a3('0x4b')](_0x12db39[_0xd7a3('0x4c')],{})[_0xd7a3('0x26')](respondWithResult(_0x18c662,0xc9))[_0xd7a3('0x47')](handleError(_0x18c662,null));};exports[_0xd7a3('0x4d')]=function(_0x249de5,_0x159360){if(_0x249de5['body']['id']){delete _0x249de5[_0xd7a3('0x4c')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x249de5['params']['id']}})['then'](handleEntityNotFound(_0x159360,null))[_0xd7a3('0x26')](saveUpdates(_0x249de5['body'],null))[_0xd7a3('0x26')](respondWithResult(_0x159360,null))[_0xd7a3('0x47')](handleError(_0x159360,null));};exports[_0xd7a3('0x25')]=function(_0xb99e15,_0x3d4df0){return db[_0xd7a3('0x2f')][_0xd7a3('0x4a')]({'where':{'id':_0xb99e15[_0xd7a3('0x4e')]['id']}})[_0xd7a3('0x26')](handleEntityNotFound(_0x3d4df0,null))[_0xd7a3('0x26')](removeEntity(_0x3d4df0,null))['catch'](handleError(_0x3d4df0,null));};exports[_0xd7a3('0x4f')]=function(_0x5c4b39,_0xbb09b0,_0x386eb9){var _0x6662ac={};var _0x53b22f={};var _0x33c853;var _0x314029;return db[_0xd7a3('0x2f')][_0xd7a3('0x50')]({'where':{'id':_0x5c4b39[_0xd7a3('0x4e')]['id']}})[_0xd7a3('0x26')](handleEntityNotFound(_0xbb09b0,null))[_0xd7a3('0x26')](function(_0x5d1a46){if(_0x5d1a46){_0x33c853=_0x5d1a46;_0x53b22f[_0xd7a3('0x33')]=_[_0xd7a3('0x49')](db[_0xd7a3('0x51')]['rawAttributes']);_0x53b22f['query']=_[_0xd7a3('0x49')](_0x5c4b39[_0xd7a3('0x34')]);_0x53b22f[_0xd7a3('0x35')]=_[_0xd7a3('0x36')](_0x53b22f[_0xd7a3('0x33')],_0x53b22f['query']);_0x6662ac[_0xd7a3('0x37')]=_[_0xd7a3('0x36')](_0x53b22f[_0xd7a3('0x33')],qs[_0xd7a3('0x38')](_0x5c4b39[_0xd7a3('0x34')][_0xd7a3('0x38')]));_0x6662ac['attributes']=_0x6662ac[_0xd7a3('0x37')][_0xd7a3('0x39')]?_0x6662ac['attributes']:_0x53b22f['model'];_0x6662ac[_0xd7a3('0x3b')]=qs[_0xd7a3('0x3c')](_0x5c4b39[_0xd7a3('0x34')][_0xd7a3('0x3c')]);_0x6662ac[_0xd7a3('0x3d')]=qs[_0xd7a3('0x35')](_['pick'](_0x5c4b39[_0xd7a3('0x34')],_0x53b22f[_0xd7a3('0x35')]));if(_0x5c4b39['query'][_0xd7a3('0x3f')]){_0x6662ac['where']=_[_0xd7a3('0x40')](_0x6662ac['where'],{'$or':_[_0xd7a3('0x2e')](_0x6662ac['attributes'],function(_0x4c448a){var _0x502794={};_0x502794[_0x4c448a]={'$like':'%'+_0x5c4b39[_0xd7a3('0x34')]['filter']+'%'};return _0x502794;})});}_0x6662ac=_[_0xd7a3('0x40')]({},_0x6662ac,_0x5c4b39['options']);return _0x33c853[_0xd7a3('0x4f')](_0x6662ac);}})['then'](function(_0x39a0df){if(_0x39a0df){_0x314029=_0x39a0df[_0xd7a3('0x39')];if(!_0x5c4b39[_0xd7a3('0x34')]['hasOwnProperty'](_0xd7a3('0x3a'))){_0x6662ac['limit']=qs[_0xd7a3('0x1f')](_0x5c4b39[_0xd7a3('0x34')][_0xd7a3('0x1f')]);_0x6662ac[_0xd7a3('0x1e')]=qs['offset'](_0x5c4b39[_0xd7a3('0x34')][_0xd7a3('0x1e')]);}return _0x33c853['getFields'](_0x6662ac);}})[_0xd7a3('0x26')](function(_0x37d127){if(_0x37d127){return _0x37d127?{'count':_0x314029,'rows':_0x37d127}:null;}})['then'](respondWithResult(_0xbb09b0,null))[_0xd7a3('0x47')](handleError(_0xbb09b0,null));};exports['getSubjects']=function(_0x4b8419,_0x1f9fef,_0x26150e){var _0x4bd9b2={};var _0xb79ddc={};var _0x382ba9;var _0x1aea6c;return db['DeskConfiguration'][_0xd7a3('0x50')]({'where':{'id':_0x4b8419['params']['id']}})['then'](handleEntityNotFound(_0x1f9fef,null))[_0xd7a3('0x26')](function(_0x27b78b){if(_0x27b78b){_0x382ba9=_0x27b78b;_0xb79ddc['model']=_[_0xd7a3('0x49')](db[_0xd7a3('0x51')][_0xd7a3('0x30')]);_0xb79ddc['query']=_[_0xd7a3('0x49')](_0x4b8419['query']);_0xb79ddc[_0xd7a3('0x35')]=_[_0xd7a3('0x36')](_0xb79ddc[_0xd7a3('0x33')],_0xb79ddc['query']);_0x4bd9b2[_0xd7a3('0x37')]=_[_0xd7a3('0x36')](_0xb79ddc[_0xd7a3('0x33')],qs['fields'](_0x4b8419[_0xd7a3('0x34')][_0xd7a3('0x38')]));_0x4bd9b2[_0xd7a3('0x37')]=_0x4bd9b2['attributes'][_0xd7a3('0x39')]?_0x4bd9b2['attributes']:_0xb79ddc[_0xd7a3('0x33')];_0x4bd9b2[_0xd7a3('0x3b')]=qs['sort'](_0x4b8419[_0xd7a3('0x34')][_0xd7a3('0x3c')]);_0x4bd9b2['where']=qs['filters'](_['pick'](_0x4b8419[_0xd7a3('0x34')],_0xb79ddc[_0xd7a3('0x35')]));if(_0x4b8419[_0xd7a3('0x34')][_0xd7a3('0x3f')]){_0x4bd9b2[_0xd7a3('0x3d')]=_[_0xd7a3('0x40')](_0x4bd9b2[_0xd7a3('0x3d')],{'$or':_[_0xd7a3('0x2e')](_0x4bd9b2[_0xd7a3('0x37')],function(_0x5ccaf4){var _0x27dde2={};_0x27dde2[_0x5ccaf4]={'$like':'%'+_0x4b8419[_0xd7a3('0x34')][_0xd7a3('0x3f')]+'%'};return _0x27dde2;})});}_0x4bd9b2=_[_0xd7a3('0x40')]({},_0x4bd9b2,_0x4b8419['options']);return _0x382ba9[_0xd7a3('0x52')](_0x4bd9b2);}})[_0xd7a3('0x26')](function(_0x16ddb2){if(_0x16ddb2){_0x1aea6c=_0x16ddb2[_0xd7a3('0x39')];if(!_0x4b8419['query']['hasOwnProperty'](_0xd7a3('0x3a'))){_0x4bd9b2['limit']=qs['limit'](_0x4b8419[_0xd7a3('0x34')][_0xd7a3('0x1f')]);_0x4bd9b2[_0xd7a3('0x1e')]=qs['offset'](_0x4b8419[_0xd7a3('0x34')][_0xd7a3('0x1e')]);}return _0x382ba9[_0xd7a3('0x52')](_0x4bd9b2);}})[_0xd7a3('0x26')](function(_0x2d2eef){if(_0x2d2eef){return _0x2d2eef?{'count':_0x1aea6c,'rows':_0x2d2eef}:null;}})['then'](respondWithResult(_0x1f9fef,null))['catch'](handleError(_0x1f9fef,null));};exports[_0xd7a3('0x53')]=function(_0x3cc69f,_0x2dc553,_0x2f74a7){var _0x1a32fa={};var _0x555d02={};var _0x102036;var _0x66dfa4;return db['DeskConfiguration'][_0xd7a3('0x50')]({'where':{'id':_0x3cc69f[_0xd7a3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2dc553,null))['then'](function(_0x5d1c8f){if(_0x5d1c8f){_0x102036=_0x5d1c8f;_0x555d02['model']=_[_0xd7a3('0x49')](db[_0xd7a3('0x51')][_0xd7a3('0x30')]);_0x555d02[_0xd7a3('0x34')]=_['keys'](_0x3cc69f[_0xd7a3('0x34')]);_0x555d02[_0xd7a3('0x35')]=_[_0xd7a3('0x36')](_0x555d02['model'],_0x555d02['query']);_0x1a32fa['attributes']=_['intersection'](_0x555d02[_0xd7a3('0x33')],qs[_0xd7a3('0x38')](_0x3cc69f[_0xd7a3('0x34')][_0xd7a3('0x38')]));_0x1a32fa[_0xd7a3('0x37')]=_0x1a32fa[_0xd7a3('0x37')]['length']?_0x1a32fa['attributes']:_0x555d02[_0xd7a3('0x33')];_0x1a32fa[_0xd7a3('0x3b')]=qs[_0xd7a3('0x3c')](_0x3cc69f[_0xd7a3('0x34')]['sort']);_0x1a32fa[_0xd7a3('0x3d')]=qs[_0xd7a3('0x35')](_[_0xd7a3('0x3e')](_0x3cc69f[_0xd7a3('0x34')],_0x555d02['filters']));if(_0x3cc69f[_0xd7a3('0x34')][_0xd7a3('0x3f')]){_0x1a32fa[_0xd7a3('0x3d')]=_[_0xd7a3('0x40')](_0x1a32fa[_0xd7a3('0x3d')],{'$or':_[_0xd7a3('0x2e')](_0x1a32fa[_0xd7a3('0x37')],function(_0x29d803){var _0x384bb3={};_0x384bb3[_0x29d803]={'$like':'%'+_0x3cc69f[_0xd7a3('0x34')][_0xd7a3('0x3f')]+'%'};return _0x384bb3;})});}_0x1a32fa=_[_0xd7a3('0x40')]({},_0x1a32fa,_0x3cc69f['options']);return _0x102036[_0xd7a3('0x53')](_0x1a32fa);}})['then'](function(_0x165716){if(_0x165716){_0x66dfa4=_0x165716[_0xd7a3('0x39')];if(!_0x3cc69f['query'][_0xd7a3('0x54')](_0xd7a3('0x3a'))){_0x1a32fa['limit']=qs['limit'](_0x3cc69f[_0xd7a3('0x34')][_0xd7a3('0x1f')]);_0x1a32fa[_0xd7a3('0x1e')]=qs[_0xd7a3('0x1e')](_0x3cc69f[_0xd7a3('0x34')][_0xd7a3('0x1e')]);}return _0x102036[_0xd7a3('0x53')](_0x1a32fa);}})['then'](function(_0x3fef80){if(_0x3fef80){return _0x3fef80?{'count':_0x66dfa4,'rows':_0x3fef80}:null;}})['then'](respondWithResult(_0x2dc553,null))[_0xd7a3('0x47')](handleError(_0x2dc553,null));};exports['getTags']=function(_0x535720,_0x2540ac,_0x102e46){var _0x101160={};var _0x55590c={};var _0x5e116d;var _0x15bf8d;return db[_0xd7a3('0x2f')][_0xd7a3('0x50')]({'where':{'id':_0x535720[_0xd7a3('0x4e')]['id']}})[_0xd7a3('0x26')](handleEntityNotFound(_0x2540ac,null))[_0xd7a3('0x26')](function(_0x30f3b0){if(_0x30f3b0){_0x5e116d=_0x30f3b0;_0x55590c[_0xd7a3('0x33')]=_[_0xd7a3('0x49')](db[_0xd7a3('0x55')][_0xd7a3('0x30')]);_0x55590c[_0xd7a3('0x34')]=_[_0xd7a3('0x49')](_0x535720[_0xd7a3('0x34')]);_0x55590c['filters']=_[_0xd7a3('0x36')](_0x55590c['model'],_0x55590c['query']);_0x101160[_0xd7a3('0x37')]=_[_0xd7a3('0x36')](_0x55590c[_0xd7a3('0x33')],qs['fields'](_0x535720['query']['fields']));_0x101160[_0xd7a3('0x37')]=_0x101160['attributes'][_0xd7a3('0x39')]?_0x101160['attributes']:_0x55590c['model'];_0x101160[_0xd7a3('0x3b')]=qs[_0xd7a3('0x3c')](_0x535720[_0xd7a3('0x34')]['sort']);_0x101160['where']=qs[_0xd7a3('0x35')](_['pick'](_0x535720['query'],_0x55590c['filters']));if(_0x535720[_0xd7a3('0x34')][_0xd7a3('0x3f')]){_0x101160[_0xd7a3('0x3d')]=_[_0xd7a3('0x40')](_0x101160[_0xd7a3('0x3d')],{'$or':_[_0xd7a3('0x2e')](_0x101160[_0xd7a3('0x37')],function(_0x2ddd02){var _0x5dd8bd={};_0x5dd8bd[_0x2ddd02]={'$like':'%'+_0x535720[_0xd7a3('0x34')][_0xd7a3('0x3f')]+'%'};return _0x5dd8bd;})});}_0x101160=_['merge']({},_0x101160,_0x535720['options']);return _0x5e116d[_0xd7a3('0x56')](_0x101160);}})['then'](function(_0xff3096){if(_0xff3096){_0x15bf8d=_0xff3096[_0xd7a3('0x39')];if(!_0x535720[_0xd7a3('0x34')][_0xd7a3('0x54')](_0xd7a3('0x3a'))){_0x101160['limit']=qs['limit'](_0x535720[_0xd7a3('0x34')][_0xd7a3('0x1f')]);_0x101160['offset']=qs[_0xd7a3('0x1e')](_0x535720['query'][_0xd7a3('0x1e')]);}return _0x5e116d[_0xd7a3('0x56')](_0x101160);}})[_0xd7a3('0x26')](function(_0x5e9b28){if(_0x5e9b28){return _0x5e9b28?{'count':_0x15bf8d,'rows':_0x5e9b28}:null;}})[_0xd7a3('0x26')](respondWithResult(_0x2540ac,null))[_0xd7a3('0x47')](handleError(_0x2540ac,null));};exports['setTags']=function(_0x26dd0d,_0x51db8b,_0xbe71e3){if(_0x26dd0d[_0xd7a3('0x4c')]['id']){delete _0x26dd0d[_0xd7a3('0x4c')]['id'];}return db[_0xd7a3('0x2f')][_0xd7a3('0x50')]({'where':{'id':_0x26dd0d[_0xd7a3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x51db8b,null))['then'](function(_0x686d7d){if(_0x686d7d){return _0x686d7d[_0xd7a3('0x57')](_0x26dd0d[_0xd7a3('0x4c')]['ids']||[]);}return null;})[_0xd7a3('0x26')](respondWithResult(_0x51db8b,null))[_0xd7a3('0x47')](handleError(_0x51db8b,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 75ee78c..9dbe38d 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 _0xe889=['lodash','util','bluebird','request-promise','rimraf','../../config/environment','DeskConfiguration','int_desk_configurations'];(function(_0x37731b,_0x5095e9){var _0x5a5cce=function(_0x1bdff4){while(--_0x1bdff4){_0x37731b['push'](_0x37731b['shift']());}};_0x5a5cce(++_0x5095e9);}(_0xe889,0x88));var _0x9e88=function(_0x111d21,_0x523f39){_0x111d21=_0x111d21-0x0;var _0xe89373=_0xe889[_0x111d21];return _0xe89373;};'use strict';var _=require(_0x9e88('0x0'));var util=require(_0x9e88('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9e88('0x2'));var rp=require(_0x9e88('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e88('0x4'));var config=require(_0x9e88('0x5'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x527a2a,_0x28bdcf){return _0x527a2a['define'](_0x9e88('0x6'),attributes,{'tableName':_0x9e88('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb688=['exports','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x396360,_0x2a68af){var _0xde4d68=function(_0x35e01a){while(--_0x35e01a){_0x396360['push'](_0x396360['shift']());}};_0xde4d68(++_0x2a68af);}(_0xb688,0xcf));var _0x8b68=function(_0x2f8bb1,_0x12f0cd){_0x2f8bb1=_0x2f8bb1-0x0;var _0x2f0aa7=_0xb688[_0x2f8bb1];return _0x2f0aa7;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 96ef908..1d54e24 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 _0xeb85=['message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','info'];(function(_0x432db1,_0x2cfb08){var _0x1c31fc=function(_0x20108e){while(--_0x20108e){_0x432db1['push'](_0x432db1['shift']());}};_0x1c31fc(++_0x2cfb08);}(_0xeb85,0x167));var _0x5eb8=function(_0x8a5bfa,_0x510b76){_0x8a5bfa=_0x8a5bfa-0x0;var _0x24cece=_0xeb85[_0x8a5bfa];return _0x24cece;};'use strict';var _=require('lodash');var util=require(_0x5eb8('0x0'));var moment=require(_0x5eb8('0x1'));var BPromise=require(_0x5eb8('0x2'));var rs=require(_0x5eb8('0x3'));var fs=require('fs');var Redis=require(_0x5eb8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5eb8('0x5'));var logger=require(_0x5eb8('0x6'))('rpc');var config=require(_0x5eb8('0x7'));var jayson=require(_0x5eb8('0x8'));var client=jayson['client'][_0x5eb8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b402e,_0x2e9793,_0x4e8b5e){return new BPromise(function(_0x3f7fb5,_0x44b372){return client[_0x5eb8('0xa')](_0x1b402e,_0x4e8b5e)[_0x5eb8('0xb')](function(_0x6a139a){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x2e9793,'request\x20sent');logger['debug'](_0x5eb8('0xc'),_0x2e9793,_0x5eb8('0xd'),JSON[_0x5eb8('0xe')](_0x6a139a));if(_0x6a139a[_0x5eb8('0xf')]){if(_0x6a139a['error'][_0x5eb8('0x10')]===0x1f4){logger[_0x5eb8('0xf')](_0x5eb8('0x11'),_0x2e9793,_0x6a139a[_0x5eb8('0xf')]['message']);return _0x44b372(_0x6a139a[_0x5eb8('0xf')]['message']);}logger[_0x5eb8('0xf')](_0x5eb8('0x11'),_0x2e9793,_0x6a139a[_0x5eb8('0xf')]['message']);return _0x3f7fb5(_0x6a139a['error']['message']);}else{logger[_0x5eb8('0x12')](_0x5eb8('0x11'),_0x2e9793,_0x5eb8('0xd'));_0x3f7fb5(_0x6a139a['result'][_0x5eb8('0x13')]);}})[_0x5eb8('0x14')](function(_0x94b3ae){logger[_0x5eb8('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x2e9793,_0x94b3ae);_0x44b372(_0x94b3ae);});});} \ No newline at end of file +var _0xd01d=['error','code','message','DeskConfiguration,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x35604a,_0x497997){var _0x382121=function(_0x6054ba){while(--_0x6054ba){_0x35604a['push'](_0x35604a['shift']());}};_0x382121(++_0x497997);}(_0xd01d,0xbe));var _0xdd01=function(_0x430cba,_0x4cdda9){_0x430cba=_0x430cba-0x0;var _0x3cfdcc=_0xd01d[_0x430cba];return _0x3cfdcc;};'use strict';var _=require('lodash');var util=require(_0xdd01('0x0'));var moment=require('moment');var BPromise=require(_0xdd01('0x1'));var rs=require(_0xdd01('0x2'));var fs=require('fs');var Redis=require(_0xdd01('0x3'));var db=require(_0xdd01('0x4'))['db'];var utils=require(_0xdd01('0x5'));var logger=require(_0xdd01('0x6'))(_0xdd01('0x7'));var config=require(_0xdd01('0x8'));var jayson=require(_0xdd01('0x9'));var client=jayson[_0xdd01('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ce4b4,_0x44599f,_0xb1caa3){return new BPromise(function(_0x400f5a,_0x15afb1){return client[_0xdd01('0xb')](_0x5ce4b4,_0xb1caa3)['then'](function(_0x2c9fd4){logger[_0xdd01('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x44599f,'request\x20sent');logger[_0xdd01('0xd')](_0xdd01('0xe'),_0x44599f,_0xdd01('0xf'),JSON[_0xdd01('0x10')](_0x2c9fd4));if(_0x2c9fd4[_0xdd01('0x11')]){if(_0x2c9fd4['error'][_0xdd01('0x12')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x44599f,_0x2c9fd4[_0xdd01('0x11')][_0xdd01('0x13')]);return _0x15afb1(_0x2c9fd4[_0xdd01('0x11')][_0xdd01('0x13')]);}logger[_0xdd01('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x44599f,_0x2c9fd4[_0xdd01('0x11')]['message']);return _0x400f5a(_0x2c9fd4[_0xdd01('0x11')][_0xdd01('0x13')]);}else{logger['info'](_0xdd01('0x14'),_0x44599f,'request\x20sent');_0x400f5a(_0x2c9fd4[_0xdd01('0x15')][_0xdd01('0x13')]);}})[_0xdd01('0x16')](function(_0x4ce145){logger[_0xdd01('0x11')](_0xdd01('0x14'),_0x44599f,_0x4ce145);_0x15afb1(_0x4ce145);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 937ebb5..3bb2b86 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 _0xe884=['isAuthenticated','index','/:id','post','create','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xe884,0x1d3));var _0x4e88=function(_0x2b1725,_0x5d7dc6){_0x2b1725=_0x2b1725-0x0;var _0xaa90cf=_0xe884[_0x2b1725];return _0xaa90cf;};'use strict';var multer=require(_0x4e88('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4e88('0x1'));var express=require(_0x4e88('0x2'));var router=express[_0x4e88('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4e88('0x4'));var interaction=require(_0x4e88('0x5'));var config=require(_0x4e88('0x6'));var controller=require(_0x4e88('0x7'));router[_0x4e88('0x8')]('/',auth[_0x4e88('0x9')](),controller[_0x4e88('0xa')]);router['get'](_0x4e88('0xb'),auth[_0x4e88('0x9')](),controller['show']);router[_0x4e88('0xc')]('/',auth[_0x4e88('0x9')](),controller[_0x4e88('0xd')]);router['put'](_0x4e88('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x4e88('0xb'),auth[_0x4e88('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9dbf=['index','/:id','show','post','create','delete','exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0x9dbf,0x1ab));var _0xf9db=function(_0x10ccf3,_0x346b0f){_0x10ccf3=_0x10ccf3-0x0;var _0x392ef2=_0x9dbf[_0x10ccf3];return _0x392ef2;};'use strict';var multer=require('multer');var util=require(_0xf9db('0x0'));var path=require(_0xf9db('0x1'));var timeout=require(_0xf9db('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf9db('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf9db('0x4'));var config=require(_0xf9db('0x5'));var controller=require('./intDeskField.controller');router[_0xf9db('0x6')]('/',auth[_0xf9db('0x7')](),controller[_0xf9db('0x8')]);router[_0xf9db('0x6')](_0xf9db('0x9'),auth[_0xf9db('0x7')](),controller[_0xf9db('0xa')]);router[_0xf9db('0xb')]('/',auth[_0xf9db('0x7')](),controller[_0xf9db('0xc')]);router['put'](_0xf9db('0x9'),auth[_0xf9db('0x7')](),controller['update']);router[_0xf9db('0xd')]('/:id',auth[_0xf9db('0x7')](),controller['destroy']);module[_0xf9db('0xe')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 0002d01..5e3f010 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 _0xba4a=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x5d7686,_0x5d11b1){var _0x408ab4=function(_0x424411){while(--_0x424411){_0x5d7686['push'](_0x5d7686['shift']());}};_0x408ab4(++_0x5d11b1);}(_0xba4a,0x1ac));var _0xaba4=function(_0x3bc803,_0x3a5146){_0x3bc803=_0x3bc803-0x0;var _0x2eb606=_0xba4a[_0x3bc803];return _0x2eb606;};'use strict';var Sequelize=require(_0xaba4('0x0'));module[_0xaba4('0x1')]={'type':{'type':Sequelize[_0xaba4('0x2')](_0xaba4('0x3'),_0xaba4('0x4'),_0xaba4('0x5'),_0xaba4('0x6'),_0xaba4('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xaba4('0x8')]},'key':{'type':Sequelize[_0xaba4('0x8')]},'keyType':{'type':Sequelize[_0xaba4('0x2')](_0xaba4('0x3'),_0xaba4('0x4'),_0xaba4('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xaba4('0x8')]},'nameField':{'type':Sequelize[_0xaba4('0x8')]},'customField':{'type':Sequelize[_0xaba4('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaba4('0x8')]}}; \ No newline at end of file +var _0x367d=['ENUM','variable','customVariable','keyValue','picklist','STRING','string','sequelize','exports'];(function(_0x12f3ea,_0x2c843e){var _0x21f759=function(_0x5b2856){while(--_0x5b2856){_0x12f3ea['push'](_0x12f3ea['shift']());}};_0x21f759(++_0x2c843e);}(_0x367d,0x7c));var _0xd367=function(_0xf45137,_0x10e5c9){_0xf45137=_0xf45137-0x0;var _0x235149=_0x367d[_0xf45137];return _0x235149;};'use strict';var Sequelize=require(_0xd367('0x0'));module[_0xd367('0x1')]={'type':{'type':Sequelize[_0xd367('0x2')]('string',_0xd367('0x3'),_0xd367('0x4'),_0xd367('0x5'),_0xd367('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd367('0x7')]},'keyType':{'type':Sequelize[_0xd367('0x2')](_0xd367('0x8'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd367('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 2fef573..aa2c316 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 _0xfed6=['send','index','rawAttributes','fieldName','type','key','query','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','DeskField','includeAll','include','findAll','rows','show','keys','intersection','length','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../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','save','update','then','destroy','error','stack','name'];(function(_0x467178,_0x5bc789){var _0xf85931=function(_0x24765d){while(--_0x24765d){_0x467178['push'](_0x467178['shift']());}};_0xf85931(++_0x5bc789);}(_0xfed6,0x14a));var _0x6fed=function(_0x3362e5,_0x5091d1){_0x3362e5=_0x3362e5-0x0;var _0x228031=_0xfed6[_0x3362e5];return _0x228031;};'use strict';var emlformat=require(_0x6fed('0x0'));var rimraf=require(_0x6fed('0x1'));var zipdir=require(_0x6fed('0x2'));var jsonpatch=require(_0x6fed('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6fed('0x4'));var Mustache=require('mustache');var util=require(_0x6fed('0x5'));var path=require(_0x6fed('0x6'));var sox=require(_0x6fed('0x7'));var csv=require(_0x6fed('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6fed('0x9'));var _=require(_0x6fed('0xa'));var squel=require(_0x6fed('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6fed('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6fed('0xd'));var Redis=require(_0x6fed('0xe'));var authService=require(_0x6fed('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6fed('0x10'));var hardwareService=require(_0x6fed('0x11'));var logger=require(_0x6fed('0x12'))(_0x6fed('0x13'));var utils=require('../../config/utils');var config=require(_0x6fed('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6fed('0x15'))['db'];function respondWithStatusCode(_0x1a7863,_0x707f8d){_0x707f8d=_0x707f8d||0xcc;return function(_0x414e4f){if(_0x414e4f){return _0x1a7863[_0x6fed('0x16')](_0x707f8d);}return _0x1a7863[_0x6fed('0x17')](_0x707f8d)[_0x6fed('0x18')]();};}function respondWithResult(_0x3579e5,_0x5558ef){_0x5558ef=_0x5558ef||0xc8;return function(_0x304d01){if(_0x304d01){return _0x3579e5[_0x6fed('0x17')](_0x5558ef)[_0x6fed('0x19')](_0x304d01);}};}function respondWithFilteredResult(_0x4cc86c,_0x1332c6){return function(_0x294280){if(_0x294280){var _0x67415d=typeof _0x1332c6[_0x6fed('0x1a')]===_0x6fed('0x1b')&&typeof _0x1332c6[_0x6fed('0x1c')]===_0x6fed('0x1b');var _0x4eb346=_0x294280['count'];var _0x2f419a=_0x67415d?0x0:_0x1332c6['offset'];var _0x56988a=_0x67415d?_0x294280[_0x6fed('0x1d')]:_0x1332c6['offset']+_0x1332c6[_0x6fed('0x1c')];var _0x261663;if(_0x56988a>=_0x4eb346){_0x56988a=_0x4eb346;_0x261663=0xc8;}else{_0x261663=0xce;}_0x4cc86c[_0x6fed('0x17')](_0x261663);return _0x4cc86c[_0x6fed('0x1e')](_0x6fed('0x1f'),_0x2f419a+'-'+_0x56988a+'/'+_0x4eb346)[_0x6fed('0x19')](_0x294280);}return null;};}function patchUpdates(_0x357adf){return function(_0x2c838b){try{jsonpatch[_0x6fed('0x20')](_0x2c838b,_0x357adf,!![]);}catch(_0x2f4dc3){return BPromise['reject'](_0x2f4dc3);}return _0x2c838b[_0x6fed('0x21')]();};}function saveUpdates(_0x4e4373,_0x4e394b){return function(_0x1a2bec){if(_0x1a2bec){return _0x1a2bec[_0x6fed('0x22')](_0x4e4373)[_0x6fed('0x23')](function(_0x473d86){return _0x473d86;});}return null;};}function removeEntity(_0x21954c,_0x3c59a1){return function(_0xefb994){if(_0xefb994){return _0xefb994[_0x6fed('0x24')]()[_0x6fed('0x23')](function(){_0x21954c[_0x6fed('0x17')](0xcc)[_0x6fed('0x18')]();});}};}function handleEntityNotFound(_0x497747,_0x4b0e15){return function(_0x39b3ab){if(!_0x39b3ab){_0x497747[_0x6fed('0x16')](0x194);}return _0x39b3ab;};}function handleError(_0x5d02f5,_0x491d65){_0x491d65=_0x491d65||0x1f4;return function(_0x52cad1){logger[_0x6fed('0x25')](_0x52cad1[_0x6fed('0x26')]);if(_0x52cad1[_0x6fed('0x27')]){delete _0x52cad1['name'];}_0x5d02f5[_0x6fed('0x17')](_0x491d65)[_0x6fed('0x28')](_0x52cad1);};}exports[_0x6fed('0x29')]=function(_0x440d8a,_0x2e7a65){var _0x18bea5={},_0x35d2c2={},_0x1870ff={'count':0x0,'rows':[]};var _0x15bf3f=_['map'](db['DeskField'][_0x6fed('0x2a')],function(_0x48009a){return{'name':_0x48009a[_0x6fed('0x2b')],'type':_0x48009a[_0x6fed('0x2c')][_0x6fed('0x2d')]};});_0x35d2c2['model']=_['map'](_0x15bf3f,_0x6fed('0x27'));_0x35d2c2[_0x6fed('0x2e')]=_['keys'](_0x440d8a[_0x6fed('0x2e')]);_0x35d2c2['filters']=_['intersection'](_0x35d2c2[_0x6fed('0x2f')],_0x35d2c2['query']);_0x18bea5[_0x6fed('0x30')]=_['intersection'](_0x35d2c2['model'],qs[_0x6fed('0x31')](_0x440d8a['query']['fields']));_0x18bea5[_0x6fed('0x30')]=_0x18bea5[_0x6fed('0x30')]['length']?_0x18bea5[_0x6fed('0x30')]:_0x35d2c2[_0x6fed('0x2f')];if(!_0x440d8a['query'][_0x6fed('0x32')](_0x6fed('0x33'))){_0x18bea5['limit']=qs[_0x6fed('0x1c')](_0x440d8a[_0x6fed('0x2e')][_0x6fed('0x1c')]);_0x18bea5[_0x6fed('0x1a')]=qs['offset'](_0x440d8a[_0x6fed('0x2e')]['offset']);}_0x18bea5[_0x6fed('0x34')]=qs[_0x6fed('0x35')](_0x440d8a['query'][_0x6fed('0x35')]);_0x18bea5['where']=qs[_0x6fed('0x36')](_[_0x6fed('0x37')](_0x440d8a[_0x6fed('0x2e')],_0x35d2c2[_0x6fed('0x36')]),_0x15bf3f);if(_0x440d8a['query'][_0x6fed('0x38')]){_0x18bea5[_0x6fed('0x39')]=_[_0x6fed('0x3a')](_0x18bea5[_0x6fed('0x39')],{'$or':_['map'](_0x15bf3f,function(_0x102068){if(_0x102068[_0x6fed('0x2c')]!=='VIRTUAL'){var _0xf61812={};_0xf61812[_0x102068[_0x6fed('0x27')]]={'$like':'%'+_0x440d8a[_0x6fed('0x2e')][_0x6fed('0x38')]+'%'};return _0xf61812;}})});}_0x18bea5=_[_0x6fed('0x3a')]({},_0x18bea5,_0x440d8a[_0x6fed('0x3b')]);var _0x111be3={'where':_0x18bea5[_0x6fed('0x39')]};return db[_0x6fed('0x3c')]['count'](_0x111be3)[_0x6fed('0x23')](function(_0x36dfb9){_0x1870ff['count']=_0x36dfb9;if(_0x440d8a['query'][_0x6fed('0x3d')]){_0x18bea5[_0x6fed('0x3e')]=[{'all':!![]}];}return db['DeskField'][_0x6fed('0x3f')](_0x18bea5);})[_0x6fed('0x23')](function(_0x5ca319){_0x1870ff[_0x6fed('0x40')]=_0x5ca319;return _0x1870ff;})[_0x6fed('0x23')](respondWithFilteredResult(_0x2e7a65,_0x18bea5))['catch'](handleError(_0x2e7a65,null));};exports[_0x6fed('0x41')]=function(_0x398daa,_0x792d5){var _0x3424bf={'raw':!![],'where':{'id':_0x398daa['params']['id']}},_0x5bd845={};_0x5bd845[_0x6fed('0x2f')]=_[_0x6fed('0x42')](db[_0x6fed('0x3c')][_0x6fed('0x2a')]);_0x5bd845[_0x6fed('0x2e')]=_['keys'](_0x398daa['query']);_0x5bd845['filters']=_[_0x6fed('0x43')](_0x5bd845[_0x6fed('0x2f')],_0x5bd845[_0x6fed('0x2e')]);_0x3424bf[_0x6fed('0x30')]=_[_0x6fed('0x43')](_0x5bd845[_0x6fed('0x2f')],qs[_0x6fed('0x31')](_0x398daa[_0x6fed('0x2e')][_0x6fed('0x31')]));_0x3424bf['attributes']=_0x3424bf['attributes'][_0x6fed('0x44')]?_0x3424bf[_0x6fed('0x30')]:_0x5bd845[_0x6fed('0x2f')];if(_0x398daa[_0x6fed('0x2e')][_0x6fed('0x3d')]){_0x3424bf['include']=[{'all':!![]}];}_0x3424bf=_[_0x6fed('0x3a')]({},_0x3424bf,_0x398daa[_0x6fed('0x3b')]);return db[_0x6fed('0x3c')]['find'](_0x3424bf)['then'](handleEntityNotFound(_0x792d5,null))[_0x6fed('0x23')](respondWithResult(_0x792d5,null))[_0x6fed('0x45')](handleError(_0x792d5,null));};exports[_0x6fed('0x46')]=function(_0x2f253c,_0x5a2ea5){return db[_0x6fed('0x3c')][_0x6fed('0x46')](_0x2f253c[_0x6fed('0x47')],{})[_0x6fed('0x23')](respondWithResult(_0x5a2ea5,0xc9))[_0x6fed('0x45')](handleError(_0x5a2ea5,null));};exports[_0x6fed('0x22')]=function(_0x1891aa,_0x59b9c2){if(_0x1891aa[_0x6fed('0x47')]['id']){delete _0x1891aa['body']['id'];}return db[_0x6fed('0x3c')][_0x6fed('0x48')]({'where':{'id':_0x1891aa[_0x6fed('0x49')]['id']}})[_0x6fed('0x23')](handleEntityNotFound(_0x59b9c2,null))[_0x6fed('0x23')](saveUpdates(_0x1891aa[_0x6fed('0x47')],null))['then'](respondWithResult(_0x59b9c2,null))[_0x6fed('0x45')](handleError(_0x59b9c2,null));};exports[_0x6fed('0x24')]=function(_0xc07afa,_0x465272){return db[_0x6fed('0x3c')][_0x6fed('0x48')]({'where':{'id':_0xc07afa[_0x6fed('0x49')]['id']}})['then'](handleEntityNotFound(_0x465272,null))[_0x6fed('0x23')](removeEntity(_0x465272,null))[_0x6fed('0x45')](handleError(_0x465272,null));}; \ No newline at end of file +var _0xcfcb=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','map','DeskField','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','create','body','find','params','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch'];(function(_0x551984,_0x4ca195){var _0x4ab655=function(_0x77926b){while(--_0x77926b){_0x551984['push'](_0x551984['shift']());}};_0x4ab655(++_0x4ca195);}(_0xcfcb,0x7a));var _0xbcfc=function(_0x4737a0,_0x36520e){_0x4737a0=_0x4737a0-0x0;var _0x4d558b=_0xcfcb[_0x4737a0];return _0x4d558b;};'use strict';var emlformat=require(_0xbcfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbcfc('0x1'));var moment=require(_0xbcfc('0x2'));var BPromise=require(_0xbcfc('0x3'));var Mustache=require(_0xbcfc('0x4'));var util=require(_0xbcfc('0x5'));var path=require(_0xbcfc('0x6'));var sox=require(_0xbcfc('0x7'));var csv=require(_0xbcfc('0x8'));var ejs=require(_0xbcfc('0x9'));var fs=require('fs');var fs_extra=require(_0xbcfc('0xa'));var _=require(_0xbcfc('0xb'));var squel=require(_0xbcfc('0xc'));var crypto=require(_0xbcfc('0xd'));var jsforce=require(_0xbcfc('0xe'));var deskjs=require(_0xbcfc('0xf'));var toCsv=require(_0xbcfc('0x8'));var querystring=require(_0xbcfc('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbcfc('0x11'));var hardwareService=require(_0xbcfc('0x12'));var logger=require(_0xbcfc('0x13'))(_0xbcfc('0x14'));var utils=require(_0xbcfc('0x15'));var config=require(_0xbcfc('0x16'));var licenseUtil=require(_0xbcfc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bf203,_0x163f2e){_0x163f2e=_0x163f2e||0xcc;return function(_0x1ac624){if(_0x1ac624){return _0x4bf203['sendStatus'](_0x163f2e);}return _0x4bf203[_0xbcfc('0x18')](_0x163f2e)['end']();};}function respondWithResult(_0x419733,_0x1d6f03){_0x1d6f03=_0x1d6f03||0xc8;return function(_0x53dff7){if(_0x53dff7){return _0x419733[_0xbcfc('0x18')](_0x1d6f03)[_0xbcfc('0x19')](_0x53dff7);}};}function respondWithFilteredResult(_0x2e5f71,_0x335792){return function(_0x2053a3){if(_0x2053a3){var _0x175407=typeof _0x335792['offset']===_0xbcfc('0x1a')&&typeof _0x335792[_0xbcfc('0x1b')]==='undefined';var _0x1b38ec=_0x2053a3[_0xbcfc('0x1c')];var _0x521978=_0x175407?0x0:_0x335792['offset'];var _0x15abcf=_0x175407?_0x2053a3[_0xbcfc('0x1c')]:_0x335792[_0xbcfc('0x1d')]+_0x335792['limit'];var _0x35ce65;if(_0x15abcf>=_0x1b38ec){_0x15abcf=_0x1b38ec;_0x35ce65=0xc8;}else{_0x35ce65=0xce;}_0x2e5f71[_0xbcfc('0x18')](_0x35ce65);return _0x2e5f71[_0xbcfc('0x1e')](_0xbcfc('0x1f'),_0x521978+'-'+_0x15abcf+'/'+_0x1b38ec)[_0xbcfc('0x19')](_0x2053a3);}return null;};}function patchUpdates(_0x5c8e96){return function(_0x12f0d2){try{jsonpatch[_0xbcfc('0x20')](_0x12f0d2,_0x5c8e96,!![]);}catch(_0x250a25){return BPromise['reject'](_0x250a25);}return _0x12f0d2['save']();};}function saveUpdates(_0x2fb36c,_0x172ba1){return function(_0x43f168){if(_0x43f168){return _0x43f168[_0xbcfc('0x21')](_0x2fb36c)[_0xbcfc('0x22')](function(_0x265ec6){return _0x265ec6;});}return null;};}function removeEntity(_0x29ade5,_0x52f9c4){return function(_0x3a90a7){if(_0x3a90a7){return _0x3a90a7[_0xbcfc('0x23')]()['then'](function(){_0x29ade5[_0xbcfc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9a013f,_0x34fbf2){return function(_0x58295c){if(!_0x58295c){_0x9a013f[_0xbcfc('0x24')](0x194);}return _0x58295c;};}function handleError(_0x7f4bf4,_0x11a1ef){_0x11a1ef=_0x11a1ef||0x1f4;return function(_0x3db2ec){logger[_0xbcfc('0x25')](_0x3db2ec[_0xbcfc('0x26')]);if(_0x3db2ec['name']){delete _0x3db2ec[_0xbcfc('0x27')];}_0x7f4bf4['status'](_0x11a1ef)[_0xbcfc('0x28')](_0x3db2ec);};}exports['index']=function(_0x276165,_0x37d305){var _0x2a03b2={},_0x2d5219={},_0x226247={'count':0x0,'rows':[]};var _0x258362=_[_0xbcfc('0x29')](db[_0xbcfc('0x2a')][_0xbcfc('0x2b')],function(_0x41f7b0){return{'name':_0x41f7b0[_0xbcfc('0x2c')],'type':_0x41f7b0['type'][_0xbcfc('0x2d')]};});_0x2d5219['model']=_[_0xbcfc('0x29')](_0x258362,_0xbcfc('0x27'));_0x2d5219[_0xbcfc('0x2e')]=_[_0xbcfc('0x2f')](_0x276165[_0xbcfc('0x2e')]);_0x2d5219['filters']=_[_0xbcfc('0x30')](_0x2d5219[_0xbcfc('0x31')],_0x2d5219[_0xbcfc('0x2e')]);_0x2a03b2[_0xbcfc('0x32')]=_[_0xbcfc('0x30')](_0x2d5219['model'],qs[_0xbcfc('0x33')](_0x276165[_0xbcfc('0x2e')]['fields']));_0x2a03b2[_0xbcfc('0x32')]=_0x2a03b2[_0xbcfc('0x32')]['length']?_0x2a03b2['attributes']:_0x2d5219[_0xbcfc('0x31')];if(!_0x276165[_0xbcfc('0x2e')][_0xbcfc('0x34')](_0xbcfc('0x35'))){_0x2a03b2[_0xbcfc('0x1b')]=qs[_0xbcfc('0x1b')](_0x276165[_0xbcfc('0x2e')][_0xbcfc('0x1b')]);_0x2a03b2[_0xbcfc('0x1d')]=qs[_0xbcfc('0x1d')](_0x276165['query'][_0xbcfc('0x1d')]);}_0x2a03b2[_0xbcfc('0x36')]=qs['sort'](_0x276165[_0xbcfc('0x2e')]['sort']);_0x2a03b2[_0xbcfc('0x37')]=qs[_0xbcfc('0x38')](_[_0xbcfc('0x39')](_0x276165['query'],_0x2d5219['filters']),_0x258362);if(_0x276165[_0xbcfc('0x2e')][_0xbcfc('0x3a')]){_0x2a03b2[_0xbcfc('0x37')]=_['merge'](_0x2a03b2[_0xbcfc('0x37')],{'$or':_[_0xbcfc('0x29')](_0x258362,function(_0x55d02c){if(_0x55d02c['type']!=='VIRTUAL'){var _0x54d90d={};_0x54d90d[_0x55d02c['name']]={'$like':'%'+_0x276165['query']['filter']+'%'};return _0x54d90d;}})});}_0x2a03b2=_[_0xbcfc('0x3b')]({},_0x2a03b2,_0x276165[_0xbcfc('0x3c')]);var _0x56e024={'where':_0x2a03b2['where']};return db['DeskField'][_0xbcfc('0x1c')](_0x56e024)[_0xbcfc('0x22')](function(_0x21c512){_0x226247['count']=_0x21c512;if(_0x276165['query'][_0xbcfc('0x3d')]){_0x2a03b2[_0xbcfc('0x3e')]=[{'all':!![]}];}return db[_0xbcfc('0x2a')][_0xbcfc('0x3f')](_0x2a03b2);})['then'](function(_0x50714a){_0x226247[_0xbcfc('0x40')]=_0x50714a;return _0x226247;})['then'](respondWithFilteredResult(_0x37d305,_0x2a03b2))['catch'](handleError(_0x37d305,null));};exports['show']=function(_0x34f237,_0x471f4f){var _0x468d9b={'raw':!![],'where':{'id':_0x34f237['params']['id']}},_0x22c27b={};_0x22c27b[_0xbcfc('0x31')]=_[_0xbcfc('0x2f')](db[_0xbcfc('0x2a')]['rawAttributes']);_0x22c27b[_0xbcfc('0x2e')]=_[_0xbcfc('0x2f')](_0x34f237[_0xbcfc('0x2e')]);_0x22c27b[_0xbcfc('0x38')]=_[_0xbcfc('0x30')](_0x22c27b[_0xbcfc('0x31')],_0x22c27b['query']);_0x468d9b[_0xbcfc('0x32')]=_[_0xbcfc('0x30')](_0x22c27b[_0xbcfc('0x31')],qs[_0xbcfc('0x33')](_0x34f237[_0xbcfc('0x2e')]['fields']));_0x468d9b[_0xbcfc('0x32')]=_0x468d9b[_0xbcfc('0x32')]['length']?_0x468d9b[_0xbcfc('0x32')]:_0x22c27b[_0xbcfc('0x31')];if(_0x34f237['query'][_0xbcfc('0x3d')]){_0x468d9b[_0xbcfc('0x3e')]=[{'all':!![]}];}_0x468d9b=_[_0xbcfc('0x3b')]({},_0x468d9b,_0x34f237[_0xbcfc('0x3c')]);return db[_0xbcfc('0x2a')]['find'](_0x468d9b)[_0xbcfc('0x22')](handleEntityNotFound(_0x471f4f,null))[_0xbcfc('0x22')](respondWithResult(_0x471f4f,null))[_0xbcfc('0x41')](handleError(_0x471f4f,null));};exports[_0xbcfc('0x42')]=function(_0x4da298,_0x423930){return db[_0xbcfc('0x2a')]['create'](_0x4da298['body'],{})[_0xbcfc('0x22')](respondWithResult(_0x423930,0xc9))[_0xbcfc('0x41')](handleError(_0x423930,null));};exports[_0xbcfc('0x21')]=function(_0x212bab,_0x1a7702){if(_0x212bab[_0xbcfc('0x43')]['id']){delete _0x212bab['body']['id'];}return db[_0xbcfc('0x2a')][_0xbcfc('0x44')]({'where':{'id':_0x212bab[_0xbcfc('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a7702,null))[_0xbcfc('0x22')](saveUpdates(_0x212bab[_0xbcfc('0x43')],null))[_0xbcfc('0x22')](respondWithResult(_0x1a7702,null))[_0xbcfc('0x41')](handleError(_0x1a7702,null));};exports[_0xbcfc('0x23')]=function(_0x3cd6ec,_0x69561f){return db['DeskField'][_0xbcfc('0x44')]({'where':{'id':_0x3cd6ec[_0xbcfc('0x45')]['id']}})[_0xbcfc('0x22')](handleEntityNotFound(_0x69561f,null))[_0xbcfc('0x22')](removeEntity(_0x69561f,null))[_0xbcfc('0x41')](handleError(_0x69561f,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 6166b59..ce68348 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 _0x5df1=['rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId','util','moment','request-promise'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x5df1,0x1a1));var _0x15df=function(_0x327833,_0x1a5833){_0x327833=_0x327833-0x0;var _0x29ade9=_0x5df1[_0x327833];return _0x29ade9;};'use strict';var _=require('lodash');var util=require(_0x15df('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x15df('0x1'));var BPromise=require('bluebird');var rp=require(_0x15df('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15df('0x3'));var config=require(_0x15df('0x4'));var attributes=require(_0x15df('0x5'));module[_0x15df('0x6')]=function(_0x5c76f5,_0x17e05b){return _0x5c76f5[_0x15df('0x7')](_0x15df('0x8'),attributes,{'tableName':_0x15df('0x9'),'paranoid':![],'indexes':[{'name':_0x15df('0xa'),'fields':['idField',_0x15df('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7d6b=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util'];(function(_0x1896d2,_0x38e977){var _0xd06e7=function(_0x2ef043){while(--_0x2ef043){_0x1896d2['push'](_0x1896d2['shift']());}};_0xd06e7(++_0x38e977);}(_0x7d6b,0xdb));var _0xb7d6=function(_0x13ad07,_0x342e35){_0x13ad07=_0x13ad07-0x0;var _0x15707c=_0x7d6b[_0x13ad07];return _0x15707c;};'use strict';var _=require(_0xb7d6('0x0'));var util=require(_0xb7d6('0x1'));var logger=require(_0xb7d6('0x2'))(_0xb7d6('0x3'));var moment=require(_0xb7d6('0x4'));var BPromise=require(_0xb7d6('0x5'));var rp=require(_0xb7d6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb7d6('0x7'));var config=require(_0xb7d6('0x8'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0xeefb02,_0x30ed78){return _0xeefb02['define'](_0xb7d6('0x9'),attributes,{'tableName':_0xb7d6('0xa'),'paranoid':![],'indexes':[{'name':_0xb7d6('0xb'),'fields':['idField',_0xb7d6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index e31992e..40de3f5 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 _0x0616=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','info','DeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x2a0af4,_0x44e712){var _0x2be515=function(_0x39015a){while(--_0x39015a){_0x2a0af4['push'](_0x2a0af4['shift']());}};_0x2be515(++_0x44e712);}(_0x0616,0x1d0));var _0x6061=function(_0x73d817,_0x54eed1){_0x73d817=_0x73d817-0x0;var _0x178cf8=_0x0616[_0x73d817];return _0x178cf8;};'use strict';var _=require('lodash');var util=require(_0x6061('0x0'));var moment=require(_0x6061('0x1'));var BPromise=require(_0x6061('0x2'));var rs=require(_0x6061('0x3'));var fs=require('fs');var Redis=require(_0x6061('0x4'));var db=require(_0x6061('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6061('0x6'))(_0x6061('0x7'));var config=require(_0x6061('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6061('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d9516,_0x27f051,_0x501a39){return new BPromise(function(_0x53aaa4,_0x434d95){return client['request'](_0x3d9516,_0x501a39)['then'](function(_0xe2345b){logger[_0x6061('0xa')](_0x6061('0xb'),_0x27f051,'request\x20sent');logger[_0x6061('0xc')]('DeskField,\x20%s,\x20%s,\x20%s',_0x27f051,_0x6061('0xd'),JSON[_0x6061('0xe')](_0xe2345b));if(_0xe2345b[_0x6061('0xf')]){if(_0xe2345b['error'][_0x6061('0x10')]===0x1f4){logger['error'](_0x6061('0xb'),_0x27f051,_0xe2345b[_0x6061('0xf')][_0x6061('0x11')]);return _0x434d95(_0xe2345b['error'][_0x6061('0x11')]);}logger[_0x6061('0xf')](_0x6061('0xb'),_0x27f051,_0xe2345b[_0x6061('0xf')][_0x6061('0x11')]);return _0x53aaa4(_0xe2345b[_0x6061('0xf')][_0x6061('0x11')]);}else{logger[_0x6061('0xa')](_0x6061('0xb'),_0x27f051,_0x6061('0xd'));_0x53aaa4(_0xe2345b[_0x6061('0x12')]['message']);}})[_0x6061('0x13')](function(_0x4799a9){logger[_0x6061('0xf')](_0x6061('0xb'),_0x27f051,_0x4799a9);_0x434d95(_0x4799a9);});});} \ No newline at end of file +var _0x10b9=['../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x10b9,0x13a));var _0x910b=function(_0x10caef,_0x53c874){_0x10caef=_0x10caef-0x0;var _0x2bf684=_0x10b9[_0x10caef];return _0x2bf684;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x910b('0x0'));var BPromise=require(_0x910b('0x1'));var rs=require(_0x910b('0x2'));var fs=require('fs');var Redis=require(_0x910b('0x3'));var db=require(_0x910b('0x4'))['db'];var utils=require(_0x910b('0x5'));var logger=require(_0x910b('0x6'))(_0x910b('0x7'));var config=require(_0x910b('0x8'));var jayson=require(_0x910b('0x9'));var client=jayson[_0x910b('0xa')][_0x910b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x345d55,_0x485c6a,_0x2489f5){return new BPromise(function(_0x2fa8c8,_0x50e1c7){return client[_0x910b('0xc')](_0x345d55,_0x2489f5)[_0x910b('0xd')](function(_0x42dd04){logger[_0x910b('0xe')](_0x910b('0xf'),_0x485c6a,_0x910b('0x10'));logger[_0x910b('0x11')](_0x910b('0x12'),_0x485c6a,_0x910b('0x10'),JSON[_0x910b('0x13')](_0x42dd04));if(_0x42dd04[_0x910b('0x14')]){if(_0x42dd04[_0x910b('0x14')]['code']===0x1f4){logger[_0x910b('0x14')]('DeskField,\x20%s,\x20%s',_0x485c6a,_0x42dd04[_0x910b('0x14')][_0x910b('0x15')]);return _0x50e1c7(_0x42dd04['error'][_0x910b('0x15')]);}logger['error'](_0x910b('0xf'),_0x485c6a,_0x42dd04[_0x910b('0x14')][_0x910b('0x15')]);return _0x2fa8c8(_0x42dd04[_0x910b('0x14')][_0x910b('0x15')]);}else{logger[_0x910b('0xe')](_0x910b('0xf'),_0x485c6a,'request\x20sent');_0x2fa8c8(_0x42dd04[_0x910b('0x16')]['message']);}})['catch'](function(_0x339f35){logger[_0x910b('0x14')](_0x910b('0xf'),_0x485c6a,_0x339f35);_0x50e1c7(_0x339f35);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 4c4fce8..f685c8a 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 _0xa47a=['post','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create'];(function(_0x3f6426,_0x12cbf9){var _0x25d790=function(_0x3c6756){while(--_0x3c6756){_0x3f6426['push'](_0x3f6426['shift']());}};_0x25d790(++_0x12cbf9);}(_0xa47a,0x1d2));var _0xaa47=function(_0x47de36,_0x3fad7a){_0x47de36=_0x47de36-0x0;var _0x1ceb27=_0xa47a[_0x47de36];return _0x1ceb27;};'use strict';var multer=require(_0xaa47('0x0'));var util=require(_0xaa47('0x1'));var path=require(_0xaa47('0x2'));var timeout=require(_0xaa47('0x3'));var express=require('express');var router=express[_0xaa47('0x4')]();var fs_extra=require(_0xaa47('0x5'));var auth=require(_0xaa47('0x6'));var interaction=require(_0xaa47('0x7'));var config=require('../../config/environment');var controller=require(_0xaa47('0x8'));router[_0xaa47('0x9')]('/',auth[_0xaa47('0xa')](),controller['index']);router[_0xaa47('0x9')]('/:id',auth[_0xaa47('0xa')](),controller[_0xaa47('0xb')]);router['get'](_0xaa47('0xc'),auth['isAuthenticated'](),controller[_0xaa47('0xd')]);router[_0xaa47('0x9')](_0xaa47('0xe'),auth['isAuthenticated'](),controller[_0xaa47('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaa47('0x10')]);router[_0xaa47('0x11')](_0xaa47('0xc'),auth[_0xaa47('0xa')](),controller['addConfiguration']);router[_0xaa47('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xaa47('0x13')](_0xaa47('0x14'),auth[_0xaa47('0xa')](),controller[_0xaa47('0x15')]);module[_0xaa47('0x16')]=router; \ No newline at end of file +var _0xad27=['addConfiguration','put','/:id','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','show','getConfigurations','/:id/fields','post','create'];(function(_0x34c043,_0x13c207){var _0xaf40ef=function(_0x4c599b){while(--_0x4c599b){_0x34c043['push'](_0x34c043['shift']());}};_0xaf40ef(++_0x13c207);}(_0xad27,0x1bf));var _0x7ad2=function(_0x58f7b6,_0x20abe9){_0x58f7b6=_0x58f7b6-0x0;var _0x46caf8=_0xad27[_0x58f7b6];return _0x46caf8;};'use strict';var multer=require(_0x7ad2('0x0'));var util=require(_0x7ad2('0x1'));var path=require(_0x7ad2('0x2'));var timeout=require(_0x7ad2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7ad2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7ad2('0x5'));var config=require(_0x7ad2('0x6'));var controller=require(_0x7ad2('0x7'));router[_0x7ad2('0x8')]('/',auth[_0x7ad2('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7ad2('0xa')]);router['get']('/:id/configurations',auth[_0x7ad2('0x9')](),controller[_0x7ad2('0xb')]);router[_0x7ad2('0x8')](_0x7ad2('0xc'),auth[_0x7ad2('0x9')](),controller['getFields']);router[_0x7ad2('0xd')]('/',auth['isAuthenticated'](),controller[_0x7ad2('0xe')]);router[_0x7ad2('0xd')]('/:id/configurations',auth[_0x7ad2('0x9')](),controller[_0x7ad2('0xf')]);router[_0x7ad2('0x10')](_0x7ad2('0x11'),auth['isAuthenticated'](),controller[_0x7ad2('0x12')]);router[_0x7ad2('0x13')](_0x7ad2('0x11'),auth[_0x7ad2('0x9')](),controller['destroy']);module[_0x7ad2('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index f289965..e0c3a63 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 _0x4250=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2f7f29,_0x5c6040){var _0x37d68a=function(_0x59accb){while(--_0x59accb){_0x2f7f29['push'](_0x2f7f29['shift']());}};_0x37d68a(++_0x5c6040);}(_0x4250,0x146));var _0x0425=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x4250[_0x5e36d1];return _0x950b9e;};'use strict';var Sequelize=require(_0x0425('0x0'));module[_0x0425('0x1')]={'name':{'type':Sequelize[_0x0425('0x2')]},'username':{'type':Sequelize[_0x0425('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0425('0x2')]},'tenantId':{'type':Sequelize[_0x0425('0x2')]},'clientId':{'type':Sequelize[_0x0425('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x0425('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0425('0x2')]},'modernAuthentication':{'type':Sequelize[_0x0425('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x33c5=['STRING','BOOLEAN','exports'];(function(_0x3e9c72,_0x1391a0){var _0x10cb97=function(_0x5e7e0d){while(--_0x5e7e0d){_0x3e9c72['push'](_0x3e9c72['shift']());}};_0x10cb97(++_0x1391a0);}(_0x33c5,0xe6));var _0x533c=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x33c5[_0x111e94];return _0x3de107;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x533c('0x1')]},'remoteUri':{'type':Sequelize[_0x533c('0x1')]},'tenantId':{'type':Sequelize[_0x533c('0x1')]},'clientId':{'type':Sequelize[_0x533c('0x1')]},'clientSecret':{'type':Sequelize[_0x533c('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x533c('0x1')]},'modernAuthentication':{'type':Sequelize[_0x533c('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 52df9ed..6ac427d 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 _0x8b0c=['https://login.microsoftonline.com/','/oauth2/token','clientId','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','concat','test','error','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','UserLocalizedLabel','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','update','destroy','then','end','sendStatus','stack','name','send','index','Dynamics365Account','rawAttributes','fieldName','type','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','create','body','getConfigurations','findOne','Dynamics365Configuration','pick','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','slice','substring','lastIndexOf','format','getFields','ticketType','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST'];(function(_0x45030e,_0x32b6b8){var _0x4df3be=function(_0x1fe781){while(--_0x1fe781){_0x45030e['push'](_0x45030e['shift']());}};_0x4df3be(++_0x32b6b8);}(_0x8b0c,0xec));var _0xc8b0=function(_0x12dca4,_0x38e541){_0x12dca4=_0x12dca4-0x0;var _0x5db702=_0x8b0c[_0x12dca4];return _0x5db702;};'use strict';var rp=require(_0xc8b0('0x0'));var util=require(_0xc8b0('0x1'));var _=require(_0xc8b0('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xc8b0('0x3'))(_0xc8b0('0x4'));var db=require(_0xc8b0('0x5'))['db'];var integrations=require(_0xc8b0('0x6'));function respondWithResult(_0x17e519,_0x26c540){_0x26c540=_0x26c540||0xc8;return function(_0x2f0cea){if(_0x2f0cea){return _0x17e519['status'](_0x26c540)[_0xc8b0('0x7')](_0x2f0cea);}};}function respondWithFilteredResult(_0x358de8,_0x480e5e){return function(_0x2b4494){if(_0x2b4494){var _0x44a4b3=typeof _0x480e5e[_0xc8b0('0x8')]===_0xc8b0('0x9')&&typeof _0x480e5e[_0xc8b0('0xa')]==='undefined';var _0x10d012=_0x2b4494[_0xc8b0('0xb')];var _0x196a24=_0x44a4b3?0x0:_0x480e5e['offset'];var _0x550e4b=_0x44a4b3?_0x2b4494[_0xc8b0('0xb')]:_0x480e5e['offset']+_0x480e5e['limit'];var _0x42feb4;if(_0x550e4b>=_0x10d012){_0x550e4b=_0x10d012;_0x42feb4=0xc8;}else{_0x42feb4=0xce;}_0x358de8[_0xc8b0('0xc')](_0x42feb4);return _0x358de8['set']('Content-Range',_0x196a24+'-'+_0x550e4b+'/'+_0x10d012)[_0xc8b0('0x7')](_0x2b4494);}return null;};}function saveUpdates(_0x44a16e){return function(_0x2917cf){if(_0x2917cf){return _0x2917cf[_0xc8b0('0xd')](_0x44a16e)['then'](function(_0x466b17){return _0x466b17;});}return null;};}function removeEntity(_0x54a180){return function(_0x5916bb){if(_0x5916bb){return _0x5916bb[_0xc8b0('0xe')]()[_0xc8b0('0xf')](function(){_0x54a180['status'](0xcc)[_0xc8b0('0x10')]();});}};}function handleEntityNotFound(_0x24633b){return function(_0x213538){if(!_0x213538){_0x24633b[_0xc8b0('0x11')](0x194);}return _0x213538;};}function handleError(_0x2ec0df,_0x2d773d){_0x2d773d=_0x2d773d||0x1f4;return function(_0x1639c5){logger['error'](_0x1639c5[_0xc8b0('0x12')]);if(_0x1639c5['name']){delete _0x1639c5[_0xc8b0('0x13')];}_0x2ec0df['status'](_0x2d773d)[_0xc8b0('0x14')](_0x1639c5);};}exports[_0xc8b0('0x15')]=function(_0x1abb7a,_0x7f0cfc){var _0x22e5c0={},_0xa4eb3={},_0x462fa1={'count':0x0,'rows':[]};var _0x2cb380=_['map'](db[_0xc8b0('0x16')][_0xc8b0('0x17')],function(_0x312073){return{'name':_0x312073[_0xc8b0('0x18')],'type':_0x312073[_0xc8b0('0x19')]['key']};});_0xa4eb3['model']=_[_0xc8b0('0x1a')](_0x2cb380,_0xc8b0('0x13'));_0xa4eb3[_0xc8b0('0x1b')]=_[_0xc8b0('0x1c')](_0x1abb7a[_0xc8b0('0x1b')]);_0xa4eb3[_0xc8b0('0x1d')]=_[_0xc8b0('0x1e')](_0xa4eb3['model'],_0xa4eb3[_0xc8b0('0x1b')]);_0x22e5c0[_0xc8b0('0x1f')]=_['intersection'](_0xa4eb3[_0xc8b0('0x20')],qs['fields'](_0x1abb7a[_0xc8b0('0x1b')][_0xc8b0('0x21')]));_0x22e5c0[_0xc8b0('0x1f')]=_0x22e5c0['attributes']['length']?_0x22e5c0[_0xc8b0('0x1f')]:_0xa4eb3['model'];if(!_0x1abb7a['query'][_0xc8b0('0x22')]('nolimit')){_0x22e5c0[_0xc8b0('0xa')]=qs[_0xc8b0('0xa')](_0x1abb7a[_0xc8b0('0x1b')]['limit']);_0x22e5c0[_0xc8b0('0x8')]=qs[_0xc8b0('0x8')](_0x1abb7a['query'][_0xc8b0('0x8')]);}_0x22e5c0[_0xc8b0('0x23')]=qs[_0xc8b0('0x24')](_0x1abb7a[_0xc8b0('0x1b')][_0xc8b0('0x24')]);_0x22e5c0[_0xc8b0('0x25')]=qs[_0xc8b0('0x1d')](_['pick'](_0x1abb7a[_0xc8b0('0x1b')],_0xa4eb3['filters']),_0x2cb380);if(_0x1abb7a['query'][_0xc8b0('0x26')]){_0x22e5c0['where']=_[_0xc8b0('0x27')](_0x22e5c0[_0xc8b0('0x25')],{'$or':_[_0xc8b0('0x1a')](_0x2cb380,function(_0x4c8242){if(_0x4c8242[_0xc8b0('0x19')]!==_0xc8b0('0x28')){var _0x24b87a={};_0x24b87a[_0x4c8242[_0xc8b0('0x13')]]={'$like':'%'+_0x1abb7a['query'][_0xc8b0('0x26')]+'%'};return _0x24b87a;}})});}_0x22e5c0=_[_0xc8b0('0x27')]({},_0x22e5c0,_0x1abb7a[_0xc8b0('0x29')]);var _0x3b28f4={'where':_0x22e5c0['where']};return db['Dynamics365Account'][_0xc8b0('0xb')](_0x3b28f4)['then'](function(_0xb9c59b){_0x462fa1[_0xc8b0('0xb')]=_0xb9c59b;if(_0x1abb7a[_0xc8b0('0x1b')]['includeAll']){_0x22e5c0[_0xc8b0('0x2a')]=[{'all':!![]}];}return db[_0xc8b0('0x16')][_0xc8b0('0x2b')](_0x22e5c0);})[_0xc8b0('0xf')](function(_0x393d8b){_0x462fa1['rows']=_0x393d8b;return _0x462fa1;})[_0xc8b0('0xf')](respondWithFilteredResult(_0x7f0cfc,_0x22e5c0))[_0xc8b0('0x2c')](handleError(_0x7f0cfc,null));};exports[_0xc8b0('0x2d')]=function(_0x558161,_0x274020){var _0x839381={'raw':![],'where':{'id':_0x558161[_0xc8b0('0x2e')]['id']}},_0x2fa5a8={};_0x2fa5a8['model']=_[_0xc8b0('0x1c')](db[_0xc8b0('0x16')][_0xc8b0('0x17')]);_0x2fa5a8['query']=_[_0xc8b0('0x1c')](_0x558161['query']);_0x2fa5a8[_0xc8b0('0x1d')]=_[_0xc8b0('0x1e')](_0x2fa5a8[_0xc8b0('0x20')],_0x2fa5a8[_0xc8b0('0x1b')]);_0x839381[_0xc8b0('0x1f')]=_['intersection'](_0x2fa5a8[_0xc8b0('0x20')],qs[_0xc8b0('0x21')](_0x558161['query']['fields']));_0x839381['attributes']=_0x839381[_0xc8b0('0x1f')][_0xc8b0('0x2f')]?_0x839381[_0xc8b0('0x1f')]:_0x2fa5a8['model'];if(_0x558161['query'][_0xc8b0('0x30')]){_0x839381[_0xc8b0('0x2a')]=[{'all':!![]}];}_0x839381=_['merge']({},_0x839381,_0x558161['options']);return db['Dynamics365Account'][_0xc8b0('0x31')](_0x839381)[_0xc8b0('0xf')](handleEntityNotFound(_0x274020,null))[_0xc8b0('0xf')](respondWithResult(_0x274020,null))[_0xc8b0('0x2c')](handleError(_0x274020,null));};exports[_0xc8b0('0x32')]=function(_0x3d6d9f,_0x4f3540){return db[_0xc8b0('0x16')][_0xc8b0('0x32')](_0x3d6d9f[_0xc8b0('0x33')],{})[_0xc8b0('0xf')](respondWithResult(_0x4f3540,0xc9))['catch'](handleError(_0x4f3540,null));};exports[_0xc8b0('0xd')]=function(_0x23c593,_0x509456){if(_0x23c593['body']['id']){delete _0x23c593[_0xc8b0('0x33')]['id'];}return db[_0xc8b0('0x16')][_0xc8b0('0x31')]({'where':{'id':_0x23c593['params']['id']}})[_0xc8b0('0xf')](handleEntityNotFound(_0x509456,null))[_0xc8b0('0xf')](saveUpdates(_0x23c593['body'],null))[_0xc8b0('0xf')](respondWithResult(_0x509456,null))[_0xc8b0('0x2c')](handleError(_0x509456,null));};exports['destroy']=function(_0x31f61c,_0x9a0834){return db['Dynamics365Account'][_0xc8b0('0x31')]({'where':{'id':_0x31f61c[_0xc8b0('0x2e')]['id']}})[_0xc8b0('0xf')](handleEntityNotFound(_0x9a0834,null))['then'](removeEntity(_0x9a0834,null))[_0xc8b0('0x2c')](handleError(_0x9a0834,null));};exports[_0xc8b0('0x34')]=function(_0x4631a3,_0x96ceed){var _0x324136={};var _0x3de558={};var _0x387937;var _0x1641af;return db[_0xc8b0('0x16')][_0xc8b0('0x35')]({'where':{'id':_0x4631a3[_0xc8b0('0x2e')]['id']}})[_0xc8b0('0xf')](handleEntityNotFound(_0x96ceed,null))[_0xc8b0('0xf')](function(_0x46c960){if(_0x46c960){_0x387937=_0x46c960;_0x3de558[_0xc8b0('0x20')]=_[_0xc8b0('0x1c')](db[_0xc8b0('0x36')][_0xc8b0('0x17')]);_0x3de558['query']=_[_0xc8b0('0x1c')](_0x4631a3[_0xc8b0('0x1b')]);_0x3de558['filters']=_['intersection'](_0x3de558['model'],_0x3de558[_0xc8b0('0x1b')]);_0x324136[_0xc8b0('0x1f')]=_['intersection'](_0x3de558[_0xc8b0('0x20')],qs['fields'](_0x4631a3[_0xc8b0('0x1b')][_0xc8b0('0x21')]));_0x324136[_0xc8b0('0x1f')]=_0x324136[_0xc8b0('0x1f')][_0xc8b0('0x2f')]?_0x324136[_0xc8b0('0x1f')]:_0x3de558[_0xc8b0('0x20')];_0x324136[_0xc8b0('0x23')]=qs[_0xc8b0('0x24')](_0x4631a3['query'][_0xc8b0('0x24')]);_0x324136['where']=qs[_0xc8b0('0x1d')](_[_0xc8b0('0x37')](_0x4631a3[_0xc8b0('0x1b')],_0x3de558[_0xc8b0('0x1d')]));if(_0x4631a3[_0xc8b0('0x1b')][_0xc8b0('0x26')]){_0x324136[_0xc8b0('0x25')]=_[_0xc8b0('0x27')](_0x324136[_0xc8b0('0x25')],{'$or':_['map'](_0x324136[_0xc8b0('0x1f')],function(_0x5f50b7){var _0x9b3d01={};_0x9b3d01[_0x5f50b7]={'$like':'%'+_0x4631a3[_0xc8b0('0x1b')][_0xc8b0('0x26')]+'%'};return _0x9b3d01;})});}_0x324136=_[_0xc8b0('0x27')]({},_0x324136,_0x4631a3[_0xc8b0('0x29')]);return _0x387937[_0xc8b0('0x34')](_0x324136);}})[_0xc8b0('0xf')](function(_0x113c51){if(_0x113c51){_0x1641af=_0x113c51['length'];if(!_0x4631a3['query'][_0xc8b0('0x22')]('nolimit')){_0x324136[_0xc8b0('0xa')]=qs[_0xc8b0('0xa')](_0x4631a3['query'][_0xc8b0('0xa')]);_0x324136[_0xc8b0('0x8')]=qs[_0xc8b0('0x8')](_0x4631a3[_0xc8b0('0x1b')][_0xc8b0('0x8')]);}return _0x387937[_0xc8b0('0x34')](_0x324136);}})[_0xc8b0('0xf')](function(_0x5c5e2d){if(_0x5c5e2d){return _0x5c5e2d?{'count':_0x1641af,'rows':_0x5c5e2d}:null;}})[_0xc8b0('0xf')](respondWithResult(_0x96ceed,null))[_0xc8b0('0x2c')](handleError(_0x96ceed,null));};exports['addConfiguration']=function(_0x378b21,_0x5b06fd){if(_0x378b21[_0xc8b0('0x33')]['id']){delete _0x378b21[_0xc8b0('0x33')]['id'];}return db[_0xc8b0('0x16')][_0xc8b0('0x35')]({'where':{'id':_0x378b21[_0xc8b0('0x2e')]['id']}})[_0xc8b0('0xf')](handleEntityNotFound(_0x5b06fd,null))[_0xc8b0('0xf')](function(_0x3dac69){if(_0x3dac69){_0x378b21[_0xc8b0('0x33')][_0xc8b0('0x38')]=_0x3dac69['id'];_0x378b21[_0xc8b0('0x33')][_0xc8b0('0x39')]=integrations[_0xc8b0('0x3a')](_0x378b21['body'][_0xc8b0('0x3b')],_0x378b21[_0xc8b0('0x33')][_0xc8b0('0x19')]);_0x378b21[_0xc8b0('0x33')][_0xc8b0('0x3c')]=integrations[_0xc8b0('0x3d')](_0x378b21[_0xc8b0('0x33')][_0xc8b0('0x3b')],_0x378b21[_0xc8b0('0x33')][_0xc8b0('0x19')]);return db['Dynamics365Configuration'][_0xc8b0('0x32')](_0x378b21[_0xc8b0('0x33')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0xc8b0('0x3c')}]});}return null;})[_0xc8b0('0xf')](respondWithResult(_0x5b06fd,null))['catch'](handleError(_0x5b06fd,null));};function sanitizeRemoteUri(_0x2bc896){var _0x2e6d00=_0x2bc896[_0xc8b0('0x3e')](-0x1);if(_0x2e6d00==='/')return _0x2bc896[_0xc8b0('0x3f')](0x0,_0x2bc896[_0xc8b0('0x40')](_0x2e6d00));return _0x2bc896;}function getWebApiUrl(_0x362cf7){return util[_0xc8b0('0x41')]('%s/api/data/v9.0/',_0x362cf7);}exports[_0xc8b0('0x42')]=function(_0x4b62e0,_0x56f383){var _0x537d40=_0x4b62e0['query'][_0xc8b0('0x43')];var _0x3bd527=_0x537d40==='incident'?'Incident':'PhoneCall';var _0x4981a9='';var _0xfba92d='';var _0x14347a='';var _0x3d5ba1='';var _0x3340cd='';var _0x40f740='';var _0x70c2ac='';var _0x512f49='';var _0x21438f=['title',_0xc8b0('0x44'),_0xc8b0('0x45'),_0xc8b0('0x46'),_0xc8b0('0x47'),_0xc8b0('0x48'),_0xc8b0('0x49'),_0xc8b0('0x4a'),_0xc8b0('0x4b'),'phonecall_activity_parties'];var _0x9d9fd7=[_0xc8b0('0x4c'),_0xc8b0('0x4d'),_0xc8b0('0x4e'),_0xc8b0('0x4f'),_0xc8b0('0x50'),_0xc8b0('0x51'),'contractdetailidname','contractidname','createdbyexternalpartyname',_0xc8b0('0x52'),'createdbyname',_0xc8b0('0x53'),_0xc8b0('0x54'),_0xc8b0('0x55'),_0xc8b0('0x56'),_0xc8b0('0x57'),'customeridtype',_0xc8b0('0x58'),_0xc8b0('0x59'),'entitlementidname','entityimage_timestamp',_0xc8b0('0x5a'),_0xc8b0('0x5b'),'exchangerate',_0xc8b0('0x5c'),_0xc8b0('0x5d'),_0xc8b0('0x5e'),'influencescore','kbarticleidname','lastonholdtime',_0xc8b0('0x5f'),_0xc8b0('0x60'),_0xc8b0('0x61'),_0xc8b0('0x62'),_0xc8b0('0x63'),_0xc8b0('0x64'),_0xc8b0('0x65'),_0xc8b0('0x66'),_0xc8b0('0x67'),'msdyn_iotalertname',_0xc8b0('0x68'),_0xc8b0('0x69'),'overriddencreatedon',_0xc8b0('0x6a'),_0xc8b0('0x6b'),_0xc8b0('0x6c'),_0xc8b0('0x6d'),_0xc8b0('0x6e'),_0xc8b0('0x6f'),_0xc8b0('0x70'),_0xc8b0('0x71'),'productserialnumber',_0xc8b0('0x72'),_0xc8b0('0x73'),_0xc8b0('0x74'),_0xc8b0('0x75'),_0xc8b0('0x76'),_0xc8b0('0x77'),_0xc8b0('0x78'),_0xc8b0('0x79'),_0xc8b0('0x7a'),'statecode','statuscode','subjectidname',_0xc8b0('0x7b'),'timezoneruleversionnumber',_0xc8b0('0x7c'),_0xc8b0('0x7d'),_0xc8b0('0x7e'),_0xc8b0('0x7f')];var _0x3ac16a=_0x21438f['concat'](_0x9d9fd7);return db[_0xc8b0('0x16')][_0xc8b0('0x35')]({'where':{'id':_0x4b62e0[_0xc8b0('0x2e')]['id']},'attributes':['id',_0xc8b0('0x80'),_0xc8b0('0x81'),_0xc8b0('0x82'),_0xc8b0('0x83'),'clientId',_0xc8b0('0x84'),_0xc8b0('0x85')],'include':[{'model':db['CloudProvider'],'as':_0xc8b0('0x86'),'attributes':['id',_0xc8b0('0x87'),_0xc8b0('0x88')]}]})[_0xc8b0('0xf')](handleEntityNotFound(_0x56f383,null))['then'](function(_0x1be349){if(_0x1be349){if(_0x1be349['modernAuthentication']){_0x1be349['access_token']=_0x1be349[_0xc8b0('0x86')][_0xc8b0('0x87')];_0x512f49=sanitizeRemoteUri(_0x1be349[_0xc8b0('0x86')]['data7']);_0x70c2ac=getWebApiUrl(_0x512f49);return _0x1be349;}_0x512f49=sanitizeRemoteUri(_0x1be349['remoteUri']);_0x70c2ac=getWebApiUrl(_0x512f49);var _0xdfecfe={'method':_0xc8b0('0x89'),'uri':_0xc8b0('0x8a')+_0x1be349[_0xc8b0('0x83')]+_0xc8b0('0x8b'),'form':{'client_id':_0x1be349[_0xc8b0('0x8c')],'resource':_0x512f49,'username':_0x1be349[_0xc8b0('0x80')],'password':_0x1be349[_0xc8b0('0x81')],'grant_type':_0xc8b0('0x81'),'client_secret':_0x1be349[_0xc8b0('0x84')]},'json':!![]};return rp(_0xdfecfe);}})[_0xc8b0('0xf')](function(_0xf10452){_0x40f740=_0xf10452[_0xc8b0('0x8d')];var _0x5488ec={'method':_0xc8b0('0x8e'),'uri':encodeURI(_0x70c2ac+_0xc8b0('0x8f')+_0x3bd527+'\x27'),'headers':{'Authorization':_0xc8b0('0x90')+_0x40f740,'If-None-Match':null,'OData-Version':_0xc8b0('0x91')},'json':!![]};return rp(_0x5488ec);})[_0xc8b0('0xf')](function(_0x570fbb){var _0x4e0ea1=_0x570fbb[_0xc8b0('0x92')][0x0];var _0x196b08=_0x4e0ea1[_0xc8b0('0x93')];var _0x1127f3={'method':_0xc8b0('0x8e'),'uri':_0x70c2ac+_0xc8b0('0x94')+_0x196b08+_0xc8b0('0x95'),'headers':{'Authorization':_0xc8b0('0x90')+_0x40f740,'If-None-Match':null,'OData-Version':_0xc8b0('0x91')},'json':!![]};return rp(_0x1127f3);})[_0xc8b0('0xf')](function(_0x1d6308){_0x4981a9=_0x1d6308;_0xfba92d=_0x4981a9[_0xc8b0('0x96')];_0xfba92d=_['remove'](_0xfba92d,function(_0x226733){return!_0x3ac16a[_0xc8b0('0x97')](_0x226733[_0xc8b0('0x98')]);});var _0x49e2a4=[];var _0xb0966e=[];_0xfba92d[_0xc8b0('0x99')](function(_0x308932){if(_0x308932[_0xc8b0('0x9a')]){var _0x5039e4=_0x308932[_0xc8b0('0x9a')][_0xc8b0('0x3f')](_0x308932[_0xc8b0('0x9a')][_0xc8b0('0x40')]('.')+0x1);if(_0x5039e4===_0xc8b0('0x9b')){_0x49e2a4[_0xc8b0('0x9c')](getSelectList(_0x70c2ac,_0x537d40,_0xb0966e,_0x4981a9[_0xc8b0('0x93')],_0x308932['MetadataId'],_0x40f740));}}});return Promise[_0xc8b0('0x9d')](_0x49e2a4);})[_0xc8b0('0xf')](function(_0x5a7b19){_0x14347a=_0x5a7b19[0x0];var _0x106235=[];var _0x4cab2f=[];_0xfba92d['forEach'](function(_0x503585){if(!_[_0xc8b0('0x9e')](_0x503585[_0xc8b0('0x9a')])){var _0x379d48=_0x503585['@odata.type'][_0xc8b0('0x3f')](_0x503585[_0xc8b0('0x9a')]['lastIndexOf']('.')+0x1);if(_0x379d48===_0xc8b0('0x9f')){_0x106235[_0xc8b0('0x9c')](getBooleanList(_0x70c2ac,_0x537d40,_0x4cab2f,_0x4981a9[_0xc8b0('0x93')],_0x503585[_0xc8b0('0x93')],_0x40f740));}}});return Promise['all'](_0x106235);})[_0xc8b0('0xf')](function(_0xe6dd6e){_0x3d5ba1=_0xe6dd6e[0x0];var _0x260d0e=[];var _0x4691e4=[];_0xfba92d['forEach'](function(_0x1dee97){if(_0x1dee97[_0xc8b0('0x9a')]){var _0x344e3d=_0x1dee97['@odata.type'][_0xc8b0('0x3f')](_0x1dee97[_0xc8b0('0x9a')][_0xc8b0('0x40')]('.')+0x1);if(_0x344e3d===_0xc8b0('0xa0')||_0x344e3d===_0xc8b0('0xa1')||_0x344e3d===_0xc8b0('0xa2')||_0x344e3d===_0xc8b0('0xa3')||_0x344e3d===_0xc8b0('0xa4')||_0x344e3d===_0xc8b0('0xa5')||_0x344e3d===_0xc8b0('0xa6')||_0x344e3d===_0xc8b0('0xa7')||_0x344e3d===_0xc8b0('0xa8')||_0x344e3d==='DecimalAttributeMetadata'){_0x260d0e[_0xc8b0('0x9c')](getInputList(_0x70c2ac,_0x537d40,_0x344e3d,_0x4691e4,_0x4981a9['MetadataId'],_0x1dee97[_0xc8b0('0x93')],_0x40f740));}}});return Promise[_0xc8b0('0x9d')](_0x260d0e);})['then'](function(_0x31dd90){_0x3340cd=_0x31dd90[0x0];var _0x18d0b5=_0x14347a[_0xc8b0('0xa9')](_0x3d5ba1)['concat'](_0x3340cd);var _0x3a7f07={'count':_0x18d0b5['length'],'rows':_0x18d0b5};return _0x3a7f07;})[_0xc8b0('0xf')](respondWithResult(_0x56f383,null))[_0xc8b0('0x2c')](function(_0x13333e){var _0x4afe04=_0x4b62e0['query'][_0xc8b0('0xaa')]?0x1f4:_0x13333e['statusCode']||0x1f4;logger[_0xc8b0('0xab')](_0x13333e[_0xc8b0('0x12')]);delete _0x13333e[_0xc8b0('0x13')];if(_0x4afe04===0x191){_0x4afe04=0x190;}_0x56f383[_0xc8b0('0xc')](_0x4afe04)['send'](_0x4b62e0[_0xc8b0('0x1b')][_0xc8b0('0xaa')]?{'message':'Wrong\x20credentials','statusCode':_0x13333e[_0xc8b0('0xac')]}:_0x13333e);});};function getSelectList(_0x2a98d6,_0x1b7c3e,_0x4cd130,_0x171248,_0x358d99,_0x3cdf36){var _0x4fed0d={'method':_0xc8b0('0x8e'),'uri':_0x2a98d6+_0xc8b0('0x94')+_0x171248+_0xc8b0('0xad')+_0x358d99+_0xc8b0('0xae')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x3cdf36,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4fed0d)[_0xc8b0('0xf')](function(_0x29782f){var _0x4fd7b6=[];var _0x56919d=_0x29782f['OptionSet'][_0xc8b0('0xaf')];_0x56919d['forEach'](function(_0x2f9af4){_0x4fd7b6['push']({'name':_0x2f9af4[_0xc8b0('0xb0')]['UserLocalizedLabel']['Label'],'value':String(_0x2f9af4[_0xc8b0('0xb1')])});});var _0x2c0f5e={'id':_0x1b7c3e+'_'+_0x29782f['LogicalName'],'name':_0x29782f[_0xc8b0('0xb2')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x4fd7b6};_0x4cd130[_0xc8b0('0x9c')](_0x2c0f5e);return _0x4cd130;});}function getBooleanList(_0x497d2e,_0x42b96c,_0x4fceb6,_0x30e2b5,_0x5e4de4,_0x45438f){var _0x1091dc={'method':_0xc8b0('0x8e'),'uri':_0x497d2e+_0xc8b0('0x94')+_0x30e2b5+_0xc8b0('0xad')+_0x5e4de4+_0xc8b0('0xb3'),'headers':{'Authorization':_0xc8b0('0x90')+_0x45438f,'If-None-Match':null,'OData-Version':_0xc8b0('0x91')},'json':!![]};return rp(_0x1091dc)[_0xc8b0('0xf')](function(_0x2ec0e7){var _0x44d7d4=[];_0x44d7d4[_0xc8b0('0x9c')]({'name':_0x2ec0e7[_0xc8b0('0xb4')][_0xc8b0('0xb5')][_0xc8b0('0xb0')][_0xc8b0('0xb6')][_0xc8b0('0xb0')],'value':_0xc8b0('0xb7')},{'name':_0x2ec0e7[_0xc8b0('0xb4')][_0xc8b0('0xb8')][_0xc8b0('0xb0')][_0xc8b0('0xb6')][_0xc8b0('0xb0')],'value':_0xc8b0('0xb9')});var _0x36cbcc={'id':_0x42b96c+'_'+_0x2ec0e7[_0xc8b0('0x98')],'name':_0x2ec0e7['DisplayName'][_0xc8b0('0xb6')][_0xc8b0('0xb0')],'custom':![],'options':_0x44d7d4};_0x4fceb6[_0xc8b0('0x9c')](_0x36cbcc);return _0x4fceb6;});}function getInputList(_0x3adcba,_0x1b7032,_0x3b1808,_0x146a1d,_0x29fca4,_0x4bc74f,_0x4537de){var _0x312dcf={'method':_0xc8b0('0x8e'),'uri':_0x3adcba+_0xc8b0('0x94')+_0x29fca4+_0xc8b0('0xad')+_0x4bc74f+_0xc8b0('0xba')+_0x3b1808+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x4537de,'If-None-Match':null,'OData-Version':_0xc8b0('0x91')},'json':!![]};return rp(_0x312dcf)[_0xc8b0('0xf')](function(_0x5b5ba8){var _0x3bb838={'id':_0x1b7032+'_'+_0x5b5ba8[_0xc8b0('0x98')],'name':_0x5b5ba8['DisplayName'][_0xc8b0('0xb6')]?_0x5b5ba8[_0xc8b0('0xb2')][_0xc8b0('0xb6')]['Label']:_0x5b5ba8[_0xc8b0('0x98')],'custom':![],'options':[]};_0x146a1d['push'](_0x3bb838);return _0x146a1d;});} \ No newline at end of file +var _0x071d=['getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','title','description','ownerid','caseorigincode','subject','regardingobjectid','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','escalatedon','exchangerate','followupby','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','remoteUri','POST','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','statusCode','stack','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','Dynamics365Account','findAll','rows','catch','params','find','create','body','destroy'];(function(_0x324faa,_0x73aaea){var _0x2a60b0=function(_0x49e2d4){while(--_0x49e2d4){_0x324faa['push'](_0x324faa['shift']());}};_0x2a60b0(++_0x73aaea);}(_0x071d,0x82));var _0xd071=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x071d[_0x4a9fb1];return _0x348672;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0xd071('0x0'));var qs=require(_0xd071('0x1'));var logger=require(_0xd071('0x2'))(_0xd071('0x3'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd071('0x4'));function respondWithResult(_0x1a29a3,_0x54d8f0){_0x54d8f0=_0x54d8f0||0xc8;return function(_0x24df87){if(_0x24df87){return _0x1a29a3[_0xd071('0x5')](_0x54d8f0)[_0xd071('0x6')](_0x24df87);}};}function respondWithFilteredResult(_0x12025a,_0x30216a){return function(_0x649f22){if(_0x649f22){var _0x80236a=typeof _0x30216a[_0xd071('0x7')]===_0xd071('0x8')&&typeof _0x30216a[_0xd071('0x9')]===_0xd071('0x8');var _0x565530=_0x649f22[_0xd071('0xa')];var _0x41aca7=_0x80236a?0x0:_0x30216a[_0xd071('0x7')];var _0x240f31=_0x80236a?_0x649f22[_0xd071('0xa')]:_0x30216a['offset']+_0x30216a[_0xd071('0x9')];var _0x393f43;if(_0x240f31>=_0x565530){_0x240f31=_0x565530;_0x393f43=0xc8;}else{_0x393f43=0xce;}_0x12025a[_0xd071('0x5')](_0x393f43);return _0x12025a[_0xd071('0xb')](_0xd071('0xc'),_0x41aca7+'-'+_0x240f31+'/'+_0x565530)[_0xd071('0x6')](_0x649f22);}return null;};}function saveUpdates(_0x5a1464){return function(_0x124fe8){if(_0x124fe8){return _0x124fe8[_0xd071('0xd')](_0x5a1464)['then'](function(_0x135b7b){return _0x135b7b;});}return null;};}function removeEntity(_0x2b4cbe){return function(_0x39c0f6){if(_0x39c0f6){return _0x39c0f6['destroy']()[_0xd071('0xe')](function(){_0x2b4cbe[_0xd071('0x5')](0xcc)['end']();});}};}function handleEntityNotFound(_0x85bfee){return function(_0x1191fb){if(!_0x1191fb){_0x85bfee[_0xd071('0xf')](0x194);}return _0x1191fb;};}function handleError(_0x12854e,_0x19c3bd){_0x19c3bd=_0x19c3bd||0x1f4;return function(_0x4c0fcc){logger[_0xd071('0x10')](_0x4c0fcc['stack']);if(_0x4c0fcc['name']){delete _0x4c0fcc['name'];}_0x12854e[_0xd071('0x5')](_0x19c3bd)[_0xd071('0x11')](_0x4c0fcc);};}exports[_0xd071('0x12')]=function(_0x71ebbd,_0x5187a3){var _0xcee677={},_0x3cbc5c={},_0x55b2d3={'count':0x0,'rows':[]};var _0x22d3d2=_[_0xd071('0x13')](db['Dynamics365Account'][_0xd071('0x14')],function(_0x5001b8){return{'name':_0x5001b8[_0xd071('0x15')],'type':_0x5001b8[_0xd071('0x16')][_0xd071('0x17')]};});_0x3cbc5c[_0xd071('0x18')]=_[_0xd071('0x13')](_0x22d3d2,_0xd071('0x19'));_0x3cbc5c[_0xd071('0x1a')]=_[_0xd071('0x1b')](_0x71ebbd[_0xd071('0x1a')]);_0x3cbc5c['filters']=_['intersection'](_0x3cbc5c[_0xd071('0x18')],_0x3cbc5c[_0xd071('0x1a')]);_0xcee677[_0xd071('0x1c')]=_[_0xd071('0x1d')](_0x3cbc5c[_0xd071('0x18')],qs[_0xd071('0x1e')](_0x71ebbd[_0xd071('0x1a')][_0xd071('0x1e')]));_0xcee677['attributes']=_0xcee677[_0xd071('0x1c')][_0xd071('0x1f')]?_0xcee677[_0xd071('0x1c')]:_0x3cbc5c[_0xd071('0x18')];if(!_0x71ebbd['query'][_0xd071('0x20')](_0xd071('0x21'))){_0xcee677[_0xd071('0x9')]=qs[_0xd071('0x9')](_0x71ebbd[_0xd071('0x1a')]['limit']);_0xcee677[_0xd071('0x7')]=qs[_0xd071('0x7')](_0x71ebbd[_0xd071('0x1a')][_0xd071('0x7')]);}_0xcee677[_0xd071('0x22')]=qs[_0xd071('0x23')](_0x71ebbd['query'][_0xd071('0x23')]);_0xcee677[_0xd071('0x24')]=qs[_0xd071('0x25')](_[_0xd071('0x26')](_0x71ebbd[_0xd071('0x1a')],_0x3cbc5c[_0xd071('0x25')]),_0x22d3d2);if(_0x71ebbd['query'][_0xd071('0x27')]){_0xcee677['where']=_['merge'](_0xcee677['where'],{'$or':_[_0xd071('0x13')](_0x22d3d2,function(_0x58fde9){if(_0x58fde9[_0xd071('0x16')]!==_0xd071('0x28')){var _0x4de054={};_0x4de054[_0x58fde9[_0xd071('0x19')]]={'$like':'%'+_0x71ebbd['query'][_0xd071('0x27')]+'%'};return _0x4de054;}})});}_0xcee677=_[_0xd071('0x29')]({},_0xcee677,_0x71ebbd[_0xd071('0x2a')]);var _0x28cc16={'where':_0xcee677['where']};return db['Dynamics365Account'][_0xd071('0xa')](_0x28cc16)[_0xd071('0xe')](function(_0x441d42){_0x55b2d3['count']=_0x441d42;if(_0x71ebbd[_0xd071('0x1a')][_0xd071('0x2b')]){_0xcee677[_0xd071('0x2c')]=[{'all':!![]}];}return db[_0xd071('0x2d')][_0xd071('0x2e')](_0xcee677);})['then'](function(_0x2142d4){_0x55b2d3[_0xd071('0x2f')]=_0x2142d4;return _0x55b2d3;})[_0xd071('0xe')](respondWithFilteredResult(_0x5187a3,_0xcee677))[_0xd071('0x30')](handleError(_0x5187a3,null));};exports['show']=function(_0x55e968,_0xdee0af){var _0x4d543b={'raw':![],'where':{'id':_0x55e968[_0xd071('0x31')]['id']}},_0x4c678e={};_0x4c678e[_0xd071('0x18')]=_['keys'](db[_0xd071('0x2d')][_0xd071('0x14')]);_0x4c678e[_0xd071('0x1a')]=_['keys'](_0x55e968[_0xd071('0x1a')]);_0x4c678e[_0xd071('0x25')]=_['intersection'](_0x4c678e[_0xd071('0x18')],_0x4c678e[_0xd071('0x1a')]);_0x4d543b[_0xd071('0x1c')]=_[_0xd071('0x1d')](_0x4c678e[_0xd071('0x18')],qs[_0xd071('0x1e')](_0x55e968[_0xd071('0x1a')][_0xd071('0x1e')]));_0x4d543b['attributes']=_0x4d543b[_0xd071('0x1c')][_0xd071('0x1f')]?_0x4d543b[_0xd071('0x1c')]:_0x4c678e[_0xd071('0x18')];if(_0x55e968[_0xd071('0x1a')]['includeAll']){_0x4d543b[_0xd071('0x2c')]=[{'all':!![]}];}_0x4d543b=_['merge']({},_0x4d543b,_0x55e968['options']);return db['Dynamics365Account'][_0xd071('0x32')](_0x4d543b)[_0xd071('0xe')](handleEntityNotFound(_0xdee0af,null))['then'](respondWithResult(_0xdee0af,null))[_0xd071('0x30')](handleError(_0xdee0af,null));};exports[_0xd071('0x33')]=function(_0x3398b9,_0x5eb842){return db[_0xd071('0x2d')]['create'](_0x3398b9[_0xd071('0x34')],{})[_0xd071('0xe')](respondWithResult(_0x5eb842,0xc9))[_0xd071('0x30')](handleError(_0x5eb842,null));};exports[_0xd071('0xd')]=function(_0x57afd2,_0x1bff67){if(_0x57afd2['body']['id']){delete _0x57afd2[_0xd071('0x34')]['id'];}return db[_0xd071('0x2d')][_0xd071('0x32')]({'where':{'id':_0x57afd2[_0xd071('0x31')]['id']}})[_0xd071('0xe')](handleEntityNotFound(_0x1bff67,null))[_0xd071('0xe')](saveUpdates(_0x57afd2[_0xd071('0x34')],null))[_0xd071('0xe')](respondWithResult(_0x1bff67,null))['catch'](handleError(_0x1bff67,null));};exports[_0xd071('0x35')]=function(_0x2249a8,_0x2d3ea2){return db[_0xd071('0x2d')][_0xd071('0x32')]({'where':{'id':_0x2249a8['params']['id']}})[_0xd071('0xe')](handleEntityNotFound(_0x2d3ea2,null))[_0xd071('0xe')](removeEntity(_0x2d3ea2,null))[_0xd071('0x30')](handleError(_0x2d3ea2,null));};exports[_0xd071('0x36')]=function(_0x4e5457,_0x19c445){var _0x1c6758={};var _0x5df66d={};var _0x455b02;var _0x5df4d1;return db[_0xd071('0x2d')][_0xd071('0x37')]({'where':{'id':_0x4e5457[_0xd071('0x31')]['id']}})[_0xd071('0xe')](handleEntityNotFound(_0x19c445,null))['then'](function(_0x54d78e){if(_0x54d78e){_0x455b02=_0x54d78e;_0x5df66d['model']=_[_0xd071('0x1b')](db[_0xd071('0x38')][_0xd071('0x14')]);_0x5df66d[_0xd071('0x1a')]=_[_0xd071('0x1b')](_0x4e5457[_0xd071('0x1a')]);_0x5df66d[_0xd071('0x25')]=_[_0xd071('0x1d')](_0x5df66d['model'],_0x5df66d[_0xd071('0x1a')]);_0x1c6758[_0xd071('0x1c')]=_[_0xd071('0x1d')](_0x5df66d[_0xd071('0x18')],qs[_0xd071('0x1e')](_0x4e5457[_0xd071('0x1a')]['fields']));_0x1c6758['attributes']=_0x1c6758[_0xd071('0x1c')][_0xd071('0x1f')]?_0x1c6758[_0xd071('0x1c')]:_0x5df66d['model'];_0x1c6758[_0xd071('0x22')]=qs[_0xd071('0x23')](_0x4e5457['query']['sort']);_0x1c6758[_0xd071('0x24')]=qs[_0xd071('0x25')](_[_0xd071('0x26')](_0x4e5457['query'],_0x5df66d[_0xd071('0x25')]));if(_0x4e5457['query']['filter']){_0x1c6758[_0xd071('0x24')]=_[_0xd071('0x29')](_0x1c6758[_0xd071('0x24')],{'$or':_['map'](_0x1c6758[_0xd071('0x1c')],function(_0x426cf1){var _0x10b47f={};_0x10b47f[_0x426cf1]={'$like':'%'+_0x4e5457[_0xd071('0x1a')][_0xd071('0x27')]+'%'};return _0x10b47f;})});}_0x1c6758=_[_0xd071('0x29')]({},_0x1c6758,_0x4e5457[_0xd071('0x2a')]);return _0x455b02[_0xd071('0x36')](_0x1c6758);}})['then'](function(_0x17fc2e){if(_0x17fc2e){_0x5df4d1=_0x17fc2e[_0xd071('0x1f')];if(!_0x4e5457[_0xd071('0x1a')][_0xd071('0x20')](_0xd071('0x21'))){_0x1c6758[_0xd071('0x9')]=qs[_0xd071('0x9')](_0x4e5457[_0xd071('0x1a')][_0xd071('0x9')]);_0x1c6758[_0xd071('0x7')]=qs[_0xd071('0x7')](_0x4e5457[_0xd071('0x1a')][_0xd071('0x7')]);}return _0x455b02['getConfigurations'](_0x1c6758);}})[_0xd071('0xe')](function(_0x2fdecb){if(_0x2fdecb){return _0x2fdecb?{'count':_0x5df4d1,'rows':_0x2fdecb}:null;}})[_0xd071('0xe')](respondWithResult(_0x19c445,null))[_0xd071('0x30')](handleError(_0x19c445,null));};exports[_0xd071('0x39')]=function(_0x27f934,_0x1522ea){if(_0x27f934[_0xd071('0x34')]['id']){delete _0x27f934[_0xd071('0x34')]['id'];}return db[_0xd071('0x2d')][_0xd071('0x37')]({'where':{'id':_0x27f934['params']['id']}})[_0xd071('0xe')](handleEntityNotFound(_0x1522ea,null))['then'](function(_0x386fdd){if(_0x386fdd){_0x27f934[_0xd071('0x34')][_0xd071('0x3a')]=_0x386fdd['id'];_0x27f934['body'][_0xd071('0x3b')]=integrations[_0xd071('0x3c')](_0x27f934['body'][_0xd071('0x3d')],_0x27f934['body']['type']);_0x27f934[_0xd071('0x34')][_0xd071('0x3e')]=integrations[_0xd071('0x3f')](_0x27f934['body'][_0xd071('0x3d')],_0x27f934[_0xd071('0x34')][_0xd071('0x16')]);return db['Dynamics365Configuration'][_0xd071('0x33')](_0x27f934[_0xd071('0x34')],{'include':[{'model':db[_0xd071('0x40')],'as':_0xd071('0x3b')},{'model':db[_0xd071('0x40')],'as':_0xd071('0x3e')}]});}return null;})[_0xd071('0xe')](respondWithResult(_0x1522ea,null))[_0xd071('0x30')](handleError(_0x1522ea,null));};function sanitizeRemoteUri(_0x2ed2ac){var _0x33eec4=_0x2ed2ac['slice'](-0x1);if(_0x33eec4==='/')return _0x2ed2ac[_0xd071('0x41')](0x0,_0x2ed2ac[_0xd071('0x42')](_0x33eec4));return _0x2ed2ac;}function getWebApiUrl(_0x21ca32){return util[_0xd071('0x43')](_0xd071('0x44'),_0x21ca32);}exports[_0xd071('0x45')]=function(_0x3dd6ee,_0x4c5665){var _0x5982a7=_0x3dd6ee[_0xd071('0x1a')][_0xd071('0x46')];var _0x2ee242=_0x5982a7===_0xd071('0x47')?_0xd071('0x48'):'PhoneCall';var _0x47ef53='';var _0x5999bb='';var _0x59d3af='';var _0x322f5e='';var _0xccaee9='';var _0x10ed10='';var _0x129a8a='';var _0x1b78c1='';var _0x57a1e6=[_0xd071('0x49'),_0xd071('0x4a'),'customerid',_0xd071('0x4b'),_0xd071('0x4c'),_0xd071('0x4d'),'phonenumber',_0xd071('0x4e'),'directioncode','phonecall_activity_parties'];var _0x1484ab=[_0xd071('0x4f'),_0xd071('0x50'),_0xd071('0x51'),'billedserviceunits',_0xd071('0x52'),_0xd071('0x53'),'contractdetailidname',_0xd071('0x54'),'createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname',_0xd071('0x55'),'createdon',_0xd071('0x56'),_0xd071('0x57'),_0xd071('0x58'),_0xd071('0x59'),_0xd071('0x5a'),'emailaddress',_0xd071('0x5b'),'entityimage_timestamp','entityimage_url',_0xd071('0x5c'),_0xd071('0x5d'),'firstresponsebykpiidname',_0xd071('0x5e'),'importsequencenumber',_0xd071('0x5f'),_0xd071('0x60'),_0xd071('0x61'),'masteridname',_0xd071('0x62'),_0xd071('0x63'),_0xd071('0x64'),_0xd071('0x65'),_0xd071('0x66'),_0xd071('0x67'),_0xd071('0x68'),_0xd071('0x69'),_0xd071('0x6a'),'numberofchildincidents',_0xd071('0x6b'),_0xd071('0x6c'),_0xd071('0x6d'),_0xd071('0x6e'),'owneridyominame',_0xd071('0x6f'),'primarycontactidname',_0xd071('0x70'),_0xd071('0x71'),_0xd071('0x72'),_0xd071('0x73'),'resolveby',_0xd071('0x74'),_0xd071('0x75'),'responsiblecontactidname','responsiblecontactidyominame',_0xd071('0x76'),_0xd071('0x77'),_0xd071('0x78'),_0xd071('0x79'),'statecode',_0xd071('0x7a'),_0xd071('0x7b'),_0xd071('0x7c'),'timezoneruleversionnumber',_0xd071('0x7d'),_0xd071('0x7e'),_0xd071('0x7f'),_0xd071('0x80')];var _0x577a9d=_0x57a1e6[_0xd071('0x81')](_0x1484ab);return db[_0xd071('0x2d')][_0xd071('0x37')]({'where':{'id':_0x3dd6ee[_0xd071('0x31')]['id']},'attributes':['id',_0xd071('0x82'),_0xd071('0x83'),'remoteUri',_0xd071('0x84'),_0xd071('0x85'),_0xd071('0x86'),_0xd071('0x87')],'include':[{'model':db[_0xd071('0x88')],'as':_0xd071('0x88'),'attributes':['id',_0xd071('0x89'),_0xd071('0x8a')]}]})[_0xd071('0xe')](handleEntityNotFound(_0x4c5665,null))['then'](function(_0x3a1508){if(_0x3a1508){if(_0x3a1508[_0xd071('0x87')]){_0x3a1508[_0xd071('0x8b')]=_0x3a1508['CloudProvider'][_0xd071('0x89')];_0x1b78c1=sanitizeRemoteUri(_0x3a1508[_0xd071('0x88')][_0xd071('0x8a')]);_0x129a8a=getWebApiUrl(_0x1b78c1);return _0x3a1508;}_0x1b78c1=sanitizeRemoteUri(_0x3a1508[_0xd071('0x8c')]);_0x129a8a=getWebApiUrl(_0x1b78c1);var _0x588260={'method':_0xd071('0x8d'),'uri':'https://login.microsoftonline.com/'+_0x3a1508[_0xd071('0x84')]+_0xd071('0x8e'),'form':{'client_id':_0x3a1508[_0xd071('0x85')],'resource':_0x1b78c1,'username':_0x3a1508[_0xd071('0x82')],'password':_0x3a1508['password'],'grant_type':'password','client_secret':_0x3a1508[_0xd071('0x86')]},'json':!![]};return rp(_0x588260);}})[_0xd071('0xe')](function(_0x3082e9){_0x10ed10=_0x3082e9[_0xd071('0x8b')];var _0x2be23a={'method':_0xd071('0x8f'),'uri':encodeURI(_0x129a8a+_0xd071('0x90')+_0x2ee242+'\x27'),'headers':{'Authorization':_0xd071('0x91')+_0x10ed10,'If-None-Match':null,'OData-Version':_0xd071('0x92')},'json':!![]};return rp(_0x2be23a);})['then'](function(_0xa09520){var _0x1e7a78=_0xa09520['value'][0x0];var _0x3c28f8=_0x1e7a78[_0xd071('0x93')];var _0x2e3ea4={'method':'GET','uri':_0x129a8a+_0xd071('0x94')+_0x3c28f8+_0xd071('0x95'),'headers':{'Authorization':'Bearer\x20'+_0x10ed10,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2e3ea4);})[_0xd071('0xe')](function(_0x59ed96){_0x47ef53=_0x59ed96;_0x5999bb=_0x47ef53[_0xd071('0x96')];_0x5999bb=_[_0xd071('0x97')](_0x5999bb,function(_0x1273e2){return!_0x577a9d['includes'](_0x1273e2[_0xd071('0x98')]);});var _0x5019b4=[];var _0xfec7de=[];_0x5999bb[_0xd071('0x99')](function(_0x1e320b){if(_0x1e320b[_0xd071('0x9a')]){var _0x17ec58=_0x1e320b[_0xd071('0x9a')][_0xd071('0x41')](_0x1e320b[_0xd071('0x9a')][_0xd071('0x42')]('.')+0x1);if(_0x17ec58===_0xd071('0x9b')){_0x5019b4[_0xd071('0x9c')](getSelectList(_0x129a8a,_0x5982a7,_0xfec7de,_0x47ef53['MetadataId'],_0x1e320b[_0xd071('0x93')],_0x10ed10));}}});return Promise[_0xd071('0x9d')](_0x5019b4);})[_0xd071('0xe')](function(_0x2a494e){_0x59d3af=_0x2a494e[0x0];var _0x501209=[];var _0x3c8cf2=[];_0x5999bb[_0xd071('0x99')](function(_0x2a9aff){if(!_[_0xd071('0x9e')](_0x2a9aff[_0xd071('0x9a')])){var _0x59790c=_0x2a9aff['@odata.type']['substring'](_0x2a9aff[_0xd071('0x9a')]['lastIndexOf']('.')+0x1);if(_0x59790c===_0xd071('0x9f')){_0x501209[_0xd071('0x9c')](getBooleanList(_0x129a8a,_0x5982a7,_0x3c8cf2,_0x47ef53[_0xd071('0x93')],_0x2a9aff[_0xd071('0x93')],_0x10ed10));}}});return Promise[_0xd071('0x9d')](_0x501209);})[_0xd071('0xe')](function(_0x278497){_0x322f5e=_0x278497[0x0];var _0x30e4fb=[];var _0x3655f2=[];_0x5999bb[_0xd071('0x99')](function(_0x57397d){if(_0x57397d[_0xd071('0x9a')]){var _0x3d5fa5=_0x57397d[_0xd071('0x9a')][_0xd071('0x41')](_0x57397d[_0xd071('0x9a')][_0xd071('0x42')]('.')+0x1);if(_0x3d5fa5==='StringAttributeMetadata'||_0x3d5fa5===_0xd071('0xa0')||_0x3d5fa5===_0xd071('0xa1')||_0x3d5fa5===_0xd071('0xa2')||_0x3d5fa5===_0xd071('0xa3')||_0x3d5fa5===_0xd071('0xa4')||_0x3d5fa5==='StatusAttributeMetadata'||_0x3d5fa5===_0xd071('0xa5')||_0x3d5fa5===_0xd071('0xa6')||_0x3d5fa5==='DecimalAttributeMetadata'){_0x30e4fb[_0xd071('0x9c')](getInputList(_0x129a8a,_0x5982a7,_0x3d5fa5,_0x3655f2,_0x47ef53[_0xd071('0x93')],_0x57397d[_0xd071('0x93')],_0x10ed10));}}});return Promise['all'](_0x30e4fb);})[_0xd071('0xe')](function(_0x50f6af){_0xccaee9=_0x50f6af[0x0];var _0x24ff50=_0x59d3af[_0xd071('0x81')](_0x322f5e)['concat'](_0xccaee9);var _0x1f7dce={'count':_0x24ff50[_0xd071('0x1f')],'rows':_0x24ff50};return _0x1f7dce;})[_0xd071('0xe')](respondWithResult(_0x4c5665,null))['catch'](function(_0x9e5739){var _0x20bad6=_0x3dd6ee['query']['test']?0x1f4:_0x9e5739[_0xd071('0xa7')]||0x1f4;logger['error'](_0x9e5739[_0xd071('0xa8')]);delete _0x9e5739[_0xd071('0x19')];if(_0x20bad6===0x191){_0x20bad6=0x190;}_0x4c5665['status'](_0x20bad6)[_0xd071('0x11')](_0x3dd6ee['query'][_0xd071('0xa9')]?{'message':_0xd071('0xaa'),'statusCode':_0x9e5739['statusCode']}:_0x9e5739);});};function getSelectList(_0x1e2c03,_0x2881e9,_0x342931,_0x821806,_0x159b5b,_0x1d1a32){var _0x4f00e1={'method':_0xd071('0x8f'),'uri':_0x1e2c03+_0xd071('0x94')+_0x821806+_0xd071('0xab')+_0x159b5b+_0xd071('0xac')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xd071('0x91')+_0x1d1a32,'If-None-Match':null,'OData-Version':_0xd071('0x92')},'json':!![]};return rp(_0x4f00e1)[_0xd071('0xe')](function(_0x6dade7){var _0x60dfe=[];var _0x2cef00=_0x6dade7[_0xd071('0xad')][_0xd071('0xae')];_0x2cef00[_0xd071('0x99')](function(_0x190aa9){_0x60dfe[_0xd071('0x9c')]({'name':_0x190aa9[_0xd071('0xaf')][_0xd071('0xb0')][_0xd071('0xaf')],'value':String(_0x190aa9['Value'])});});var _0x2935d1={'id':_0x2881e9+'_'+_0x6dade7[_0xd071('0x98')],'name':_0x6dade7[_0xd071('0xb1')][_0xd071('0xb0')][_0xd071('0xaf')],'custom':![],'options':_0x60dfe};_0x342931['push'](_0x2935d1);return _0x342931;});}function getBooleanList(_0x5a626a,_0x4ab47a,_0x779775,_0x2d9684,_0x1f4b19,_0x5dabfd){var _0x1bb174={'method':_0xd071('0x8f'),'uri':_0x5a626a+_0xd071('0x94')+_0x2d9684+_0xd071('0xab')+_0x1f4b19+_0xd071('0xb2'),'headers':{'Authorization':'Bearer\x20'+_0x5dabfd,'If-None-Match':null,'OData-Version':_0xd071('0x92')},'json':!![]};return rp(_0x1bb174)[_0xd071('0xe')](function(_0x1f7d15){var _0x2187d1=[];_0x2187d1[_0xd071('0x9c')]({'name':_0x1f7d15[_0xd071('0xad')][_0xd071('0xb3')][_0xd071('0xaf')][_0xd071('0xb0')][_0xd071('0xaf')],'value':_0xd071('0xb4')},{'name':_0x1f7d15[_0xd071('0xad')][_0xd071('0xb5')][_0xd071('0xaf')]['UserLocalizedLabel'][_0xd071('0xaf')],'value':_0xd071('0xb6')});var _0x55cdd9={'id':_0x4ab47a+'_'+_0x1f7d15['LogicalName'],'name':_0x1f7d15[_0xd071('0xb1')]['UserLocalizedLabel'][_0xd071('0xaf')],'custom':![],'options':_0x2187d1};_0x779775[_0xd071('0x9c')](_0x55cdd9);return _0x779775;});}function getInputList(_0x2241b9,_0x4545b7,_0x48ce22,_0x4ed07c,_0x461252,_0xcb2368,_0x33752b){var _0x5c87b9={'method':'GET','uri':_0x2241b9+_0xd071('0x94')+_0x461252+_0xd071('0xab')+_0xcb2368+')/Microsoft.Dynamics.CRM.'+_0x48ce22+_0xd071('0xb7'),'headers':{'Authorization':_0xd071('0x91')+_0x33752b,'If-None-Match':null,'OData-Version':_0xd071('0x92')},'json':!![]};return rp(_0x5c87b9)[_0xd071('0xe')](function(_0x17c92e){var _0x115340={'id':_0x4545b7+'_'+_0x17c92e['LogicalName'],'name':_0x17c92e['DisplayName'][_0xd071('0xb0')]?_0x17c92e[_0xd071('0xb1')][_0xd071('0xb0')]['Label']:_0x17c92e[_0xd071('0x98')],'custom':![],'options':[]};_0x4ed07c['push'](_0x115340);return _0x4ed07c;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index acdf06d..144ba31 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x4ff828,_0x4b4d35){var _0x3f9dfb=function(_0x226c21){while(--_0x226c21){_0x4ff828['push'](_0x4ff828['shift']());}};_0x3f9dfb(++_0x4b4d35);}(_0x757a,0xde));var _0xa757=function(_0x5749e2,_0x33649b){_0x5749e2=_0x5749e2-0x0;var _0x57bd00=_0x757a[_0x5749e2];return _0x57bd00;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x2aba95,_0xfe7e7){var _0x1bccfe=function(_0x2ca796){while(--_0x2ca796){_0x2aba95['push'](_0x2aba95['shift']());}};_0x1bccfe(++_0xfe7e7);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 76ab0a7..6282a89 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 _0x5f57=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','include','map','model','attributes','ShowDynamics365Account','find','where','lodash','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0xd0c408,_0x5a19a9){var _0x542ce2=function(_0x405a77){while(--_0x405a77){_0xd0c408['push'](_0xd0c408['shift']());}};_0x542ce2(++_0x5a19a9);}(_0x5f57,0xe9));var _0x75f5=function(_0x4eb44b,_0x49f016){_0x4eb44b=_0x4eb44b-0x0;var _0x1f137f=_0x5f57[_0x4eb44b];return _0x1f137f;};'use strict';var _=require(_0x75f5('0x0'));var util=require('util');var moment=require(_0x75f5('0x1'));var BPromise=require('bluebird');var rs=require(_0x75f5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75f5('0x3'))['db'];var utils=require(_0x75f5('0x4'));var logger=require(_0x75f5('0x5'))(_0x75f5('0x6'));var config=require(_0x75f5('0x7'));var jayson=require(_0x75f5('0x8'));var client=jayson['client'][_0x75f5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a1062,_0x34ccc7,_0x30f8b4){return new BPromise(function(_0x420770,_0x3ce721){return client[_0x75f5('0xa')](_0x3a1062,_0x30f8b4)[_0x75f5('0xb')](function(_0x244923){logger[_0x75f5('0xc')](_0x75f5('0xd'),_0x34ccc7,_0x75f5('0xe'));logger[_0x75f5('0xf')](_0x75f5('0x10'),_0x34ccc7,_0x75f5('0xe'),JSON[_0x75f5('0x11')](_0x244923));if(_0x244923[_0x75f5('0x12')]){if(_0x244923[_0x75f5('0x12')][_0x75f5('0x13')]===0x1f4){logger[_0x75f5('0x12')](_0x75f5('0xd'),_0x34ccc7,_0x244923[_0x75f5('0x12')][_0x75f5('0x14')]);return _0x3ce721(_0x244923[_0x75f5('0x12')][_0x75f5('0x14')]);}logger[_0x75f5('0x12')](_0x75f5('0xd'),_0x34ccc7,_0x244923[_0x75f5('0x12')]['message']);return _0x420770(_0x244923[_0x75f5('0x12')]['message']);}else{logger[_0x75f5('0xc')](_0x75f5('0xd'),_0x34ccc7,_0x75f5('0xe'));_0x420770(_0x244923['result'][_0x75f5('0x14')]);}})[_0x75f5('0x15')](function(_0x2cab66){logger[_0x75f5('0x12')](_0x75f5('0xd'),_0x34ccc7,_0x2cab66);_0x3ce721(_0x2cab66);});});}exports[_0x75f5('0x16')]=function(_0x4e6e1a){var _0x19eeb5=this;return new Promise(function(_0x3b177a,_0x10e9eb){return db[_0x75f5('0x17')][_0x75f5('0x18')]({'raw':_0x4e6e1a[_0x75f5('0x19')]?_0x4e6e1a[_0x75f5('0x19')][_0x75f5('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e6e1a[_0x75f5('0x19')]?_0x4e6e1a[_0x75f5('0x19')]['where']||null:null,'attributes':_0x4e6e1a[_0x75f5('0x19')]?_0x4e6e1a[_0x75f5('0x19')]['attributes']||null:null,'limit':_0x4e6e1a['options']?_0x4e6e1a[_0x75f5('0x19')]['limit']||null:null,'include':_0x4e6e1a['options']?_0x4e6e1a[_0x75f5('0x19')][_0x75f5('0x1b')]?_[_0x75f5('0x1c')](_0x4e6e1a['options'][_0x75f5('0x1b')],function(_0x33f027){return{'model':db[_0x33f027[_0x75f5('0x1d')]],'as':_0x33f027['as'],'attributes':_0x33f027[_0x75f5('0x1e')],'include':_0x33f027[_0x75f5('0x1b')]?_[_0x75f5('0x1c')](_0x33f027[_0x75f5('0x1b')],function(_0x31271d){return{'model':db[_0x31271d['model']],'as':_0x31271d['as'],'attributes':_0x31271d['attributes'],'include':_0x31271d[_0x75f5('0x1b')]?_[_0x75f5('0x1c')](_0x31271d[_0x75f5('0x1b')],function(_0x19a9d9){return{'model':db[_0x19a9d9[_0x75f5('0x1d')]],'as':_0x19a9d9['as'],'attributes':_0x19a9d9[_0x75f5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x75f5('0xb')](function(_0x1e1b5e){logger[_0x75f5('0xc')](_0x75f5('0x16'),_0x4e6e1a);logger[_0x75f5('0xf')](_0x75f5('0x16'),_0x4e6e1a,JSON[_0x75f5('0x11')](_0x1e1b5e));_0x3b177a(_0x1e1b5e);})[_0x75f5('0x15')](function(_0x5d76c9){logger[_0x75f5('0x12')](_0x75f5('0x16'),_0x5d76c9['message'],_0x4e6e1a);_0x10e9eb(_0x19eeb5[_0x75f5('0x12')](0x1f4,_0x5d76c9[_0x75f5('0x14')]));});});};exports[_0x75f5('0x1f')]=function(_0x4aba33){var _0x22ec1c=this;return new Promise(function(_0x2f63d9,_0x2b76ee){return db[_0x75f5('0x17')][_0x75f5('0x20')]({'raw':_0x4aba33[_0x75f5('0x19')]?_0x4aba33[_0x75f5('0x19')][_0x75f5('0x1a')]===undefined?!![]:![]:!![],'where':_0x4aba33['options']?_0x4aba33[_0x75f5('0x19')][_0x75f5('0x21')]||null:null,'attributes':_0x4aba33['options']?_0x4aba33[_0x75f5('0x19')][_0x75f5('0x1e')]||null:null,'include':_0x4aba33[_0x75f5('0x19')]?_0x4aba33[_0x75f5('0x19')][_0x75f5('0x1b')]?_['map'](_0x4aba33[_0x75f5('0x19')][_0x75f5('0x1b')],function(_0x9dcb4e){return{'model':db[_0x9dcb4e[_0x75f5('0x1d')]],'as':_0x9dcb4e['as'],'attributes':_0x9dcb4e['attributes'],'include':_0x9dcb4e[_0x75f5('0x1b')]?_['map'](_0x9dcb4e[_0x75f5('0x1b')],function(_0x9bc6fa){return{'model':db[_0x9bc6fa[_0x75f5('0x1d')]],'as':_0x9bc6fa['as'],'attributes':_0x9bc6fa[_0x75f5('0x1e')],'include':_0x9bc6fa[_0x75f5('0x1b')]?_[_0x75f5('0x1c')](_0x9bc6fa['include'],function(_0x1ca98a){return{'model':db[_0x1ca98a['model']],'as':_0x1ca98a['as'],'attributes':_0x1ca98a['attributes']};}):[]};}):[]};}):[]:[]})[_0x75f5('0xb')](function(_0x42c2b3){logger[_0x75f5('0xc')](_0x75f5('0x1f'),_0x4aba33);logger[_0x75f5('0xf')](_0x75f5('0x1f'),_0x4aba33,JSON[_0x75f5('0x11')](_0x42c2b3));_0x2f63d9(_0x42c2b3);})[_0x75f5('0x15')](function(_0x1dafb9){logger[_0x75f5('0x12')](_0x75f5('0x1f'),_0x1dafb9['message'],_0x4aba33);_0x2b76ee(_0x22ec1c['error'](0x1f4,_0x1dafb9[_0x75f5('0x14')]));});});}; \ No newline at end of file +var _0x9310=['result','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','include','map','model','find','ShowDynamics365Account','catch','lodash','util','moment','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4902eb,_0x4ca06c){var _0x1f30b1=function(_0x1f62d2){while(--_0x1f62d2){_0x4902eb['push'](_0x4902eb['shift']());}};_0x1f30b1(++_0x4ca06c);}(_0x9310,0xd3));var _0x0931=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0x9310[_0x19d24c];return _0x2fae8d;};'use strict';var _=require(_0x0931('0x0'));var util=require(_0x0931('0x1'));var moment=require(_0x0931('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0931('0x3'));var db=require(_0x0931('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0931('0x5'));var config=require('../../config/environment');var jayson=require(_0x0931('0x6'));var client=jayson[_0x0931('0x7')][_0x0931('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24746d,_0x366ac6,_0xee312){return new BPromise(function(_0x965301,_0x49be94){return client[_0x0931('0x9')](_0x24746d,_0xee312)[_0x0931('0xa')](function(_0x34c406){logger[_0x0931('0xb')](_0x0931('0xc'),_0x366ac6,_0x0931('0xd'));logger[_0x0931('0xe')](_0x0931('0xf'),_0x366ac6,_0x0931('0xd'),JSON[_0x0931('0x10')](_0x34c406));if(_0x34c406[_0x0931('0x11')]){if(_0x34c406[_0x0931('0x11')][_0x0931('0x12')]===0x1f4){logger[_0x0931('0x11')](_0x0931('0xc'),_0x366ac6,_0x34c406['error'][_0x0931('0x13')]);return _0x49be94(_0x34c406[_0x0931('0x11')]['message']);}logger[_0x0931('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x366ac6,_0x34c406[_0x0931('0x11')][_0x0931('0x13')]);return _0x965301(_0x34c406['error']['message']);}else{logger[_0x0931('0xb')](_0x0931('0xc'),_0x366ac6,_0x0931('0xd'));_0x965301(_0x34c406[_0x0931('0x14')][_0x0931('0x13')]);}})['catch'](function(_0x3d6eda){logger[_0x0931('0x11')](_0x0931('0xc'),_0x366ac6,_0x3d6eda);_0x49be94(_0x3d6eda);});});}exports[_0x0931('0x15')]=function(_0x13fa39){var _0x15683b=this;return new Promise(function(_0x4131a0,_0x548451){return db[_0x0931('0x16')]['findAll']({'raw':_0x13fa39['options']?_0x13fa39[_0x0931('0x17')][_0x0931('0x18')]===undefined?!![]:![]:!![],'where':_0x13fa39[_0x0931('0x17')]?_0x13fa39['options'][_0x0931('0x19')]||null:null,'attributes':_0x13fa39['options']?_0x13fa39[_0x0931('0x17')][_0x0931('0x1a')]||null:null,'limit':_0x13fa39[_0x0931('0x17')]?_0x13fa39[_0x0931('0x17')]['limit']||null:null,'include':_0x13fa39[_0x0931('0x17')]?_0x13fa39['options'][_0x0931('0x1b')]?_['map'](_0x13fa39[_0x0931('0x17')][_0x0931('0x1b')],function(_0x3a401a){return{'model':db[_0x3a401a['model']],'as':_0x3a401a['as'],'attributes':_0x3a401a['attributes'],'include':_0x3a401a[_0x0931('0x1b')]?_['map'](_0x3a401a[_0x0931('0x1b')],function(_0x4e3734){return{'model':db[_0x4e3734['model']],'as':_0x4e3734['as'],'attributes':_0x4e3734[_0x0931('0x1a')],'include':_0x4e3734[_0x0931('0x1b')]?_[_0x0931('0x1c')](_0x4e3734[_0x0931('0x1b')],function(_0x53901a){return{'model':db[_0x53901a[_0x0931('0x1d')]],'as':_0x53901a['as'],'attributes':_0x53901a[_0x0931('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0931('0xa')](function(_0x1033ba){logger[_0x0931('0xb')](_0x0931('0x15'),_0x13fa39);logger[_0x0931('0xe')](_0x0931('0x15'),_0x13fa39,JSON['stringify'](_0x1033ba));_0x4131a0(_0x1033ba);})['catch'](function(_0x4e57f3){logger[_0x0931('0x11')](_0x0931('0x15'),_0x4e57f3[_0x0931('0x13')],_0x13fa39);_0x548451(_0x15683b[_0x0931('0x11')](0x1f4,_0x4e57f3[_0x0931('0x13')]));});});};exports['ShowDynamics365Account']=function(_0x46e2dc){var _0x294a82=this;return new Promise(function(_0x420c2f,_0x2f016f){return db['Dynamics365Account'][_0x0931('0x1e')]({'raw':_0x46e2dc['options']?_0x46e2dc['options'][_0x0931('0x18')]===undefined?!![]:![]:!![],'where':_0x46e2dc[_0x0931('0x17')]?_0x46e2dc[_0x0931('0x17')][_0x0931('0x19')]||null:null,'attributes':_0x46e2dc['options']?_0x46e2dc['options']['attributes']||null:null,'include':_0x46e2dc[_0x0931('0x17')]?_0x46e2dc[_0x0931('0x17')][_0x0931('0x1b')]?_[_0x0931('0x1c')](_0x46e2dc[_0x0931('0x17')][_0x0931('0x1b')],function(_0x34fb0a){return{'model':db[_0x34fb0a['model']],'as':_0x34fb0a['as'],'attributes':_0x34fb0a[_0x0931('0x1a')],'include':_0x34fb0a[_0x0931('0x1b')]?_[_0x0931('0x1c')](_0x34fb0a[_0x0931('0x1b')],function(_0x3452e7){return{'model':db[_0x3452e7[_0x0931('0x1d')]],'as':_0x3452e7['as'],'attributes':_0x3452e7[_0x0931('0x1a')],'include':_0x3452e7['include']?_[_0x0931('0x1c')](_0x3452e7[_0x0931('0x1b')],function(_0x534491){return{'model':db[_0x534491[_0x0931('0x1d')]],'as':_0x534491['as'],'attributes':_0x534491[_0x0931('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0931('0xa')](function(_0x11fbeb){logger[_0x0931('0xb')](_0x0931('0x1f'),_0x46e2dc);logger['debug'](_0x0931('0x1f'),_0x46e2dc,JSON['stringify'](_0x11fbeb));_0x420c2f(_0x11fbeb);})[_0x0931('0x20')](function(_0x4808c1){logger[_0x0931('0x11')](_0x0931('0x1f'),_0x4808c1[_0x0931('0x13')],_0x46e2dc);_0x2f016f(_0x294a82[_0x0931('0x11')](0x1f4,_0x4808c1[_0x0931('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 95bb037..c69e133 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 _0xa9f0=['/:id','isAuthenticated','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x7d79b3,_0x33ebf2){var _0x56ace2=function(_0x3a4ee1){while(--_0x3a4ee1){_0x7d79b3['push'](_0x7d79b3['shift']());}};_0x56ace2(++_0x33ebf2);}(_0xa9f0,0x153));var _0x0a9f=function(_0x52a77c,_0x466ae9){_0x52a77c=_0x52a77c-0x0;var _0x212119=_0xa9f0[_0x52a77c];return _0x212119;};'use strict';var multer=require(_0x0a9f('0x0'));var util=require('util');var path=require(_0x0a9f('0x1'));var timeout=require(_0x0a9f('0x2'));var express=require(_0x0a9f('0x3'));var router=express[_0x0a9f('0x4')]();var fs_extra=require(_0x0a9f('0x5'));var auth=require(_0x0a9f('0x6'));var interaction=require(_0x0a9f('0x7'));var config=require(_0x0a9f('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0x0a9f('0x9')]('/',auth['isAuthenticated'](),controller[_0x0a9f('0xa')]);router['get'](_0x0a9f('0xb'),auth[_0x0a9f('0xc')](),controller[_0x0a9f('0xd')]);router[_0x0a9f('0x9')]('/:id/fields',auth[_0x0a9f('0xc')](),controller[_0x0a9f('0xe')]);router[_0x0a9f('0x9')](_0x0a9f('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x0a9f('0x9')](_0x0a9f('0x10'),auth[_0x0a9f('0xc')](),controller[_0x0a9f('0x11')]);router[_0x0a9f('0x12')]('/',auth[_0x0a9f('0xc')](),controller[_0x0a9f('0x13')]);router[_0x0a9f('0x14')](_0x0a9f('0xb'),auth[_0x0a9f('0xc')](),controller[_0x0a9f('0x15')]);router[_0x0a9f('0x16')](_0x0a9f('0xb'),auth['isAuthenticated'](),controller[_0x0a9f('0x17')]);module[_0x0a9f('0x18')]=router; \ No newline at end of file +var _0xfd2d=['getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','show','/:id/fields'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xfd2d,0x15c));var _0xdfd2=function(_0x4a53c4,_0x288e70){_0x4a53c4=_0x4a53c4-0x0;var _0x5d5f08=_0xfd2d[_0x4a53c4];return _0x5d5f08;};'use strict';var multer=require(_0xdfd2('0x0'));var util=require(_0xdfd2('0x1'));var path=require(_0xdfd2('0x2'));var timeout=require(_0xdfd2('0x3'));var express=require(_0xdfd2('0x4'));var router=express[_0xdfd2('0x5')]();var fs_extra=require(_0xdfd2('0x6'));var auth=require(_0xdfd2('0x7'));var interaction=require(_0xdfd2('0x8'));var config=require(_0xdfd2('0x9'));var controller=require(_0xdfd2('0xa'));router['get']('/',auth[_0xdfd2('0xb')](),controller[_0xdfd2('0xc')]);router[_0xdfd2('0xd')]('/:id',auth[_0xdfd2('0xb')](),controller[_0xdfd2('0xe')]);router[_0xdfd2('0xd')](_0xdfd2('0xf'),auth[_0xdfd2('0xb')](),controller[_0xdfd2('0x10')]);router[_0xdfd2('0xd')](_0xdfd2('0x11'),auth[_0xdfd2('0xb')](),controller[_0xdfd2('0x12')]);router[_0xdfd2('0xd')](_0xdfd2('0x13'),auth[_0xdfd2('0xb')](),controller['getDescriptions']);router[_0xdfd2('0x14')]('/',auth[_0xdfd2('0xb')](),controller[_0xdfd2('0x15')]);router[_0xdfd2('0x16')](_0xdfd2('0x17'),auth[_0xdfd2('0xb')](),controller[_0xdfd2('0x18')]);router[_0xdfd2('0x19')]('/:id',auth[_0xdfd2('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index e558327..6e7b8ed 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 _0x404a=['incident','phonecall','nothing','sequelize','exports','STRING','ENUM'];(function(_0x3fc752,_0x545260){var _0xecdf3e=function(_0x5b55fe){while(--_0x5b55fe){_0x3fc752['push'](_0x3fc752['shift']());}};_0xecdf3e(++_0x545260);}(_0x404a,0xab));var _0xa404=function(_0x59cd8c,_0x5d69a9){_0x59cd8c=_0x59cd8c-0x0;var _0x4422eb=_0x404a[_0x59cd8c];return _0x4422eb;};'use strict';var Sequelize=require(_0xa404('0x0'));module[_0xa404('0x1')]={'name':{'type':Sequelize[_0xa404('0x2')]},'description':{'type':Sequelize[_0xa404('0x2')]},'ticketType':{'type':Sequelize[_0xa404('0x3')](_0xa404('0x4'),_0xa404('0x5')),'defaultValue':_0xa404('0x4')},'moduleCreate':{'type':Sequelize['ENUM']('contact',_0xa404('0x6')),'defaultValue':'contact','allowNull':![]}}; \ No newline at end of file +var _0xc97f=['sequelize','exports','STRING','phonecall','incident','ENUM','contact','nothing'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0xc97f,0x1b0));var _0xfc97=function(_0x14bbdb,_0x2beab5){_0x14bbdb=_0x14bbdb-0x0;var _0x19dec5=_0xc97f[_0x14bbdb];return _0x19dec5;};'use strict';var Sequelize=require(_0xfc97('0x0'));module[_0xfc97('0x1')]={'name':{'type':Sequelize[_0xfc97('0x2')]},'description':{'type':Sequelize[_0xfc97('0x2')]},'ticketType':{'type':Sequelize['ENUM']('incident',_0xfc97('0x3')),'defaultValue':_0xfc97('0x4')},'moduleCreate':{'type':Sequelize[_0xfc97('0x5')](_0xfc97('0x6'),_0xfc97('0x7')),'defaultValue':_0xfc97('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 8f12487..050d9a7 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 _0xe702=['Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','include','rows','params','options','catch','create','body','find','destroy','Dynamics365Field','getFields','nolimit','getSubjects','getDescriptions','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','error','stack','name','send','index','map'];(function(_0x1925df,_0xbd3e63){var _0x2f4e05=function(_0x4ffc0b){while(--_0x4ffc0b){_0x1925df['push'](_0x1925df['shift']());}};_0x2f4e05(++_0xbd3e63);}(_0xe702,0x168));var _0x2e70=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xe702[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e70('0x0'));var zipdir=require(_0x2e70('0x1'));var jsonpatch=require(_0x2e70('0x2'));var rp=require(_0x2e70('0x3'));var moment=require(_0x2e70('0x4'));var BPromise=require(_0x2e70('0x5'));var Mustache=require(_0x2e70('0x6'));var util=require(_0x2e70('0x7'));var path=require(_0x2e70('0x8'));var sox=require(_0x2e70('0x9'));var csv=require(_0x2e70('0xa'));var ejs=require(_0x2e70('0xb'));var fs=require('fs');var fs_extra=require(_0x2e70('0xc'));var _=require(_0x2e70('0xd'));var squel=require(_0x2e70('0xe'));var crypto=require(_0x2e70('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2e70('0x10'));var toCsv=require(_0x2e70('0xa'));var querystring=require(_0x2e70('0x11'));var Papa=require(_0x2e70('0x12'));var Redis=require('ioredis');var authService=require(_0x2e70('0x13'));var qs=require(_0x2e70('0x14'));var as=require(_0x2e70('0x15'));var hardwareService=require(_0x2e70('0x16'));var logger=require(_0x2e70('0x17'))(_0x2e70('0x18'));var utils=require('../../config/utils');var config=require(_0x2e70('0x19'));var licenseUtil=require(_0x2e70('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bd271,_0x51734e){_0x51734e=_0x51734e||0xcc;return function(_0x3ac11f){if(_0x3ac11f){return _0x5bd271['sendStatus'](_0x51734e);}return _0x5bd271[_0x2e70('0x1b')](_0x51734e)[_0x2e70('0x1c')]();};}function respondWithResult(_0x265b0a,_0x449ca6){_0x449ca6=_0x449ca6||0xc8;return function(_0x3a2d63){if(_0x3a2d63){return _0x265b0a['status'](_0x449ca6)[_0x2e70('0x1d')](_0x3a2d63);}};}function respondWithFilteredResult(_0x5df1dd,_0x9c9c99){return function(_0x1ae21b){if(_0x1ae21b){var _0x480897=typeof _0x9c9c99[_0x2e70('0x1e')]===_0x2e70('0x1f')&&typeof _0x9c9c99['limit']===_0x2e70('0x1f');var _0x5e7c3f=_0x1ae21b[_0x2e70('0x20')];var _0x3fe4c7=_0x480897?0x0:_0x9c9c99[_0x2e70('0x1e')];var _0x4d37f8=_0x480897?_0x1ae21b['count']:_0x9c9c99[_0x2e70('0x1e')]+_0x9c9c99[_0x2e70('0x21')];var _0xb4f2c3;if(_0x4d37f8>=_0x5e7c3f){_0x4d37f8=_0x5e7c3f;_0xb4f2c3=0xc8;}else{_0xb4f2c3=0xce;}_0x5df1dd[_0x2e70('0x1b')](_0xb4f2c3);return _0x5df1dd['set'](_0x2e70('0x22'),_0x3fe4c7+'-'+_0x4d37f8+'/'+_0x5e7c3f)['json'](_0x1ae21b);}return null;};}function patchUpdates(_0x5c677c){return function(_0x505189){try{jsonpatch['apply'](_0x505189,_0x5c677c,!![]);}catch(_0x2a9ead){return BPromise[_0x2e70('0x23')](_0x2a9ead);}return _0x505189[_0x2e70('0x24')]();};}function saveUpdates(_0x433b26,_0x3758a9){return function(_0x54f341){if(_0x54f341){return _0x54f341[_0x2e70('0x25')](_0x433b26)[_0x2e70('0x26')](function(_0x4632f5){return _0x4632f5;});}return null;};}function removeEntity(_0x57a148,_0x1eb722){return function(_0x3dbb1d){if(_0x3dbb1d){return _0x3dbb1d['destroy']()[_0x2e70('0x26')](function(){_0x57a148[_0x2e70('0x1b')](0xcc)[_0x2e70('0x1c')]();});}};}function handleEntityNotFound(_0x1fcaf3,_0x59121c){return function(_0xcf8699){if(!_0xcf8699){_0x1fcaf3['sendStatus'](0x194);}return _0xcf8699;};}function handleError(_0x4b6219,_0xb16063){_0xb16063=_0xb16063||0x1f4;return function(_0x34f8db){logger[_0x2e70('0x27')](_0x34f8db[_0x2e70('0x28')]);if(_0x34f8db['name']){delete _0x34f8db[_0x2e70('0x29')];}_0x4b6219[_0x2e70('0x1b')](_0xb16063)[_0x2e70('0x2a')](_0x34f8db);};}exports[_0x2e70('0x2b')]=function(_0x3ac1fb,_0x42dd7b){var _0x518f69={},_0x27f61f={},_0x483db0={'count':0x0,'rows':[]};var _0x2957e8=_[_0x2e70('0x2c')](db[_0x2e70('0x2d')][_0x2e70('0x2e')],function(_0x17253b){return{'name':_0x17253b[_0x2e70('0x2f')],'type':_0x17253b[_0x2e70('0x30')][_0x2e70('0x31')]};});_0x27f61f[_0x2e70('0x32')]=_[_0x2e70('0x2c')](_0x2957e8,_0x2e70('0x29'));_0x27f61f[_0x2e70('0x33')]=_[_0x2e70('0x34')](_0x3ac1fb[_0x2e70('0x33')]);_0x27f61f['filters']=_['intersection'](_0x27f61f[_0x2e70('0x32')],_0x27f61f[_0x2e70('0x33')]);_0x518f69['attributes']=_[_0x2e70('0x35')](_0x27f61f[_0x2e70('0x32')],qs[_0x2e70('0x36')](_0x3ac1fb[_0x2e70('0x33')][_0x2e70('0x36')]));_0x518f69['attributes']=_0x518f69[_0x2e70('0x37')][_0x2e70('0x38')]?_0x518f69['attributes']:_0x27f61f[_0x2e70('0x32')];if(!_0x3ac1fb['query'][_0x2e70('0x39')]('nolimit')){_0x518f69['limit']=qs[_0x2e70('0x21')](_0x3ac1fb['query']['limit']);_0x518f69[_0x2e70('0x1e')]=qs[_0x2e70('0x1e')](_0x3ac1fb[_0x2e70('0x33')][_0x2e70('0x1e')]);}_0x518f69[_0x2e70('0x3a')]=qs[_0x2e70('0x3b')](_0x3ac1fb[_0x2e70('0x33')]['sort']);_0x518f69[_0x2e70('0x3c')]=qs[_0x2e70('0x3d')](_[_0x2e70('0x3e')](_0x3ac1fb['query'],_0x27f61f[_0x2e70('0x3d')]),_0x2957e8);if(_0x3ac1fb[_0x2e70('0x33')][_0x2e70('0x3f')]){_0x518f69[_0x2e70('0x3c')]=_[_0x2e70('0x40')](_0x518f69[_0x2e70('0x3c')],{'$or':_[_0x2e70('0x2c')](_0x2957e8,function(_0x4cdf6c){if(_0x4cdf6c[_0x2e70('0x30')]!=='VIRTUAL'){var _0x3b3e89={};_0x3b3e89[_0x4cdf6c[_0x2e70('0x29')]]={'$like':'%'+_0x3ac1fb['query']['filter']+'%'};return _0x3b3e89;}})});}_0x518f69=_[_0x2e70('0x40')]({},_0x518f69,_0x3ac1fb['options']);var _0x438a2b={'where':_0x518f69['where']};return db[_0x2e70('0x2d')][_0x2e70('0x20')](_0x438a2b)[_0x2e70('0x26')](function(_0x74faae){_0x483db0[_0x2e70('0x20')]=_0x74faae;if(_0x3ac1fb[_0x2e70('0x33')][_0x2e70('0x41')]){_0x518f69[_0x2e70('0x42')]=[{'all':!![]}];}return db[_0x2e70('0x2d')]['findAll'](_0x518f69);})[_0x2e70('0x26')](function(_0x18c1ee){_0x483db0[_0x2e70('0x43')]=_0x18c1ee;return _0x483db0;})[_0x2e70('0x26')](respondWithFilteredResult(_0x42dd7b,_0x518f69))['catch'](handleError(_0x42dd7b,null));};exports['show']=function(_0x5e8512,_0x2cdbbf){var _0x2e6fbc={'raw':![],'where':{'id':_0x5e8512[_0x2e70('0x44')]['id']}},_0x27b0ba={};_0x27b0ba[_0x2e70('0x32')]=_['keys'](db[_0x2e70('0x2d')][_0x2e70('0x2e')]);_0x27b0ba[_0x2e70('0x33')]=_[_0x2e70('0x34')](_0x5e8512['query']);_0x27b0ba[_0x2e70('0x3d')]=_[_0x2e70('0x35')](_0x27b0ba['model'],_0x27b0ba[_0x2e70('0x33')]);_0x2e6fbc[_0x2e70('0x37')]=_['intersection'](_0x27b0ba[_0x2e70('0x32')],qs[_0x2e70('0x36')](_0x5e8512[_0x2e70('0x33')][_0x2e70('0x36')]));_0x2e6fbc[_0x2e70('0x37')]=_0x2e6fbc[_0x2e70('0x37')][_0x2e70('0x38')]?_0x2e6fbc[_0x2e70('0x37')]:_0x27b0ba['model'];if(_0x5e8512[_0x2e70('0x33')][_0x2e70('0x41')]){_0x2e6fbc[_0x2e70('0x42')]=[{'all':!![]}];}_0x2e6fbc=_[_0x2e70('0x40')]({},_0x2e6fbc,_0x5e8512[_0x2e70('0x45')]);return db[_0x2e70('0x2d')]['find'](_0x2e6fbc)[_0x2e70('0x26')](handleEntityNotFound(_0x2cdbbf,null))[_0x2e70('0x26')](respondWithResult(_0x2cdbbf,null))[_0x2e70('0x46')](handleError(_0x2cdbbf,null));};exports[_0x2e70('0x47')]=function(_0x394bde,_0x56cb1e){return db[_0x2e70('0x2d')][_0x2e70('0x47')](_0x394bde[_0x2e70('0x48')],{})[_0x2e70('0x26')](respondWithResult(_0x56cb1e,0xc9))[_0x2e70('0x46')](handleError(_0x56cb1e,null));};exports[_0x2e70('0x25')]=function(_0xa320dc,_0x4d466a){if(_0xa320dc['body']['id']){delete _0xa320dc[_0x2e70('0x48')]['id'];}return db['Dynamics365Configuration'][_0x2e70('0x49')]({'where':{'id':_0xa320dc['params']['id']}})['then'](handleEntityNotFound(_0x4d466a,null))[_0x2e70('0x26')](saveUpdates(_0xa320dc[_0x2e70('0x48')],null))['then'](respondWithResult(_0x4d466a,null))['catch'](handleError(_0x4d466a,null));};exports[_0x2e70('0x4a')]=function(_0x599d1f,_0xed3f51){return db['Dynamics365Configuration'][_0x2e70('0x49')]({'where':{'id':_0x599d1f['params']['id']}})['then'](handleEntityNotFound(_0xed3f51,null))[_0x2e70('0x26')](removeEntity(_0xed3f51,null))[_0x2e70('0x46')](handleError(_0xed3f51,null));};exports['getFields']=function(_0x5bf37a,_0x170ad7,_0x42b587){var _0x3fdb69={};var _0x3414c3={};var _0x334015;var _0x42ada0;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x5bf37a[_0x2e70('0x44')]['id']}})['then'](handleEntityNotFound(_0x170ad7,null))[_0x2e70('0x26')](function(_0x135885){if(_0x135885){_0x334015=_0x135885;_0x3414c3[_0x2e70('0x32')]=_[_0x2e70('0x34')](db[_0x2e70('0x4b')][_0x2e70('0x2e')]);_0x3414c3['query']=_[_0x2e70('0x34')](_0x5bf37a['query']);_0x3414c3['filters']=_[_0x2e70('0x35')](_0x3414c3[_0x2e70('0x32')],_0x3414c3[_0x2e70('0x33')]);_0x3fdb69[_0x2e70('0x37')]=_[_0x2e70('0x35')](_0x3414c3[_0x2e70('0x32')],qs['fields'](_0x5bf37a[_0x2e70('0x33')]['fields']));_0x3fdb69[_0x2e70('0x37')]=_0x3fdb69[_0x2e70('0x37')][_0x2e70('0x38')]?_0x3fdb69[_0x2e70('0x37')]:_0x3414c3[_0x2e70('0x32')];_0x3fdb69[_0x2e70('0x3a')]=qs['sort'](_0x5bf37a['query'][_0x2e70('0x3b')]);_0x3fdb69['where']=qs[_0x2e70('0x3d')](_[_0x2e70('0x3e')](_0x5bf37a[_0x2e70('0x33')],_0x3414c3['filters']));if(_0x5bf37a[_0x2e70('0x33')]['filter']){_0x3fdb69[_0x2e70('0x3c')]=_['merge'](_0x3fdb69['where'],{'$or':_[_0x2e70('0x2c')](_0x3fdb69[_0x2e70('0x37')],function(_0x313e43){var _0x278309={};_0x278309[_0x313e43]={'$like':'%'+_0x5bf37a[_0x2e70('0x33')][_0x2e70('0x3f')]+'%'};return _0x278309;})});}_0x3fdb69=_[_0x2e70('0x40')]({},_0x3fdb69,_0x5bf37a[_0x2e70('0x45')]);return _0x334015[_0x2e70('0x4c')](_0x3fdb69);}})['then'](function(_0x3b06fc){if(_0x3b06fc){_0x42ada0=_0x3b06fc[_0x2e70('0x38')];if(!_0x5bf37a[_0x2e70('0x33')]['hasOwnProperty'](_0x2e70('0x4d'))){_0x3fdb69[_0x2e70('0x21')]=qs['limit'](_0x5bf37a[_0x2e70('0x33')]['limit']);_0x3fdb69['offset']=qs['offset'](_0x5bf37a[_0x2e70('0x33')]['offset']);}return _0x334015['getFields'](_0x3fdb69);}})[_0x2e70('0x26')](function(_0x2541e3){if(_0x2541e3){return _0x2541e3?{'count':_0x42ada0,'rows':_0x2541e3}:null;}})[_0x2e70('0x26')](respondWithResult(_0x170ad7,null))[_0x2e70('0x46')](handleError(_0x170ad7,null));};exports[_0x2e70('0x4e')]=function(_0xe67b04,_0x2bc971,_0x24f52b){var _0x5a1b6b={};var _0x123398={};var _0x1e768a;var _0x50f411;return db[_0x2e70('0x2d')]['findOne']({'where':{'id':_0xe67b04[_0x2e70('0x44')]['id']}})['then'](handleEntityNotFound(_0x2bc971,null))[_0x2e70('0x26')](function(_0x3635d5){if(_0x3635d5){_0x1e768a=_0x3635d5;_0x123398[_0x2e70('0x32')]=_[_0x2e70('0x34')](db[_0x2e70('0x4b')][_0x2e70('0x2e')]);_0x123398[_0x2e70('0x33')]=_[_0x2e70('0x34')](_0xe67b04[_0x2e70('0x33')]);_0x123398[_0x2e70('0x3d')]=_['intersection'](_0x123398[_0x2e70('0x32')],_0x123398[_0x2e70('0x33')]);_0x5a1b6b['attributes']=_[_0x2e70('0x35')](_0x123398[_0x2e70('0x32')],qs[_0x2e70('0x36')](_0xe67b04[_0x2e70('0x33')][_0x2e70('0x36')]));_0x5a1b6b[_0x2e70('0x37')]=_0x5a1b6b[_0x2e70('0x37')][_0x2e70('0x38')]?_0x5a1b6b[_0x2e70('0x37')]:_0x123398[_0x2e70('0x32')];_0x5a1b6b[_0x2e70('0x3a')]=qs[_0x2e70('0x3b')](_0xe67b04[_0x2e70('0x33')][_0x2e70('0x3b')]);_0x5a1b6b[_0x2e70('0x3c')]=qs['filters'](_[_0x2e70('0x3e')](_0xe67b04[_0x2e70('0x33')],_0x123398['filters']));if(_0xe67b04[_0x2e70('0x33')][_0x2e70('0x3f')]){_0x5a1b6b[_0x2e70('0x3c')]=_[_0x2e70('0x40')](_0x5a1b6b[_0x2e70('0x3c')],{'$or':_['map'](_0x5a1b6b[_0x2e70('0x37')],function(_0xcc504e){var _0x2ce24c={};_0x2ce24c[_0xcc504e]={'$like':'%'+_0xe67b04[_0x2e70('0x33')][_0x2e70('0x3f')]+'%'};return _0x2ce24c;})});}_0x5a1b6b=_[_0x2e70('0x40')]({},_0x5a1b6b,_0xe67b04[_0x2e70('0x45')]);return _0x1e768a[_0x2e70('0x4e')](_0x5a1b6b);}})[_0x2e70('0x26')](function(_0x34ecf2){if(_0x34ecf2){_0x50f411=_0x34ecf2[_0x2e70('0x38')];if(!_0xe67b04[_0x2e70('0x33')][_0x2e70('0x39')](_0x2e70('0x4d'))){_0x5a1b6b[_0x2e70('0x21')]=qs['limit'](_0xe67b04[_0x2e70('0x33')][_0x2e70('0x21')]);_0x5a1b6b[_0x2e70('0x1e')]=qs[_0x2e70('0x1e')](_0xe67b04[_0x2e70('0x33')][_0x2e70('0x1e')]);}return _0x1e768a['getSubjects'](_0x5a1b6b);}})[_0x2e70('0x26')](function(_0x37f203){if(_0x37f203){return _0x37f203?{'count':_0x50f411,'rows':_0x37f203}:null;}})[_0x2e70('0x26')](respondWithResult(_0x2bc971,null))['catch'](handleError(_0x2bc971,null));};exports[_0x2e70('0x4f')]=function(_0xd42139,_0x1334b1,_0x36cb67){var _0x34d34f={};var _0x24d46f={};var _0x5bc277;var _0x3bcaa5;return db[_0x2e70('0x2d')][_0x2e70('0x50')]({'where':{'id':_0xd42139[_0x2e70('0x44')]['id']}})[_0x2e70('0x26')](handleEntityNotFound(_0x1334b1,null))[_0x2e70('0x26')](function(_0x4ab378){if(_0x4ab378){_0x5bc277=_0x4ab378;_0x24d46f['model']=_[_0x2e70('0x34')](db[_0x2e70('0x4b')]['rawAttributes']);_0x24d46f[_0x2e70('0x33')]=_[_0x2e70('0x34')](_0xd42139[_0x2e70('0x33')]);_0x24d46f[_0x2e70('0x3d')]=_[_0x2e70('0x35')](_0x24d46f['model'],_0x24d46f['query']);_0x34d34f[_0x2e70('0x37')]=_[_0x2e70('0x35')](_0x24d46f[_0x2e70('0x32')],qs[_0x2e70('0x36')](_0xd42139[_0x2e70('0x33')][_0x2e70('0x36')]));_0x34d34f[_0x2e70('0x37')]=_0x34d34f[_0x2e70('0x37')][_0x2e70('0x38')]?_0x34d34f[_0x2e70('0x37')]:_0x24d46f['model'];_0x34d34f[_0x2e70('0x3a')]=qs[_0x2e70('0x3b')](_0xd42139[_0x2e70('0x33')][_0x2e70('0x3b')]);_0x34d34f[_0x2e70('0x3c')]=qs[_0x2e70('0x3d')](_[_0x2e70('0x3e')](_0xd42139[_0x2e70('0x33')],_0x24d46f[_0x2e70('0x3d')]));if(_0xd42139[_0x2e70('0x33')][_0x2e70('0x3f')]){_0x34d34f[_0x2e70('0x3c')]=_[_0x2e70('0x40')](_0x34d34f[_0x2e70('0x3c')],{'$or':_[_0x2e70('0x2c')](_0x34d34f['attributes'],function(_0x4ec59b){var _0xa660d1={};_0xa660d1[_0x4ec59b]={'$like':'%'+_0xd42139[_0x2e70('0x33')][_0x2e70('0x3f')]+'%'};return _0xa660d1;})});}_0x34d34f=_[_0x2e70('0x40')]({},_0x34d34f,_0xd42139[_0x2e70('0x45')]);return _0x5bc277[_0x2e70('0x4f')](_0x34d34f);}})[_0x2e70('0x26')](function(_0x3121c8){if(_0x3121c8){_0x3bcaa5=_0x3121c8[_0x2e70('0x38')];if(!_0xd42139[_0x2e70('0x33')][_0x2e70('0x39')](_0x2e70('0x4d'))){_0x34d34f[_0x2e70('0x21')]=qs[_0x2e70('0x21')](_0xd42139[_0x2e70('0x33')][_0x2e70('0x21')]);_0x34d34f[_0x2e70('0x1e')]=qs[_0x2e70('0x1e')](_0xd42139[_0x2e70('0x33')][_0x2e70('0x1e')]);}return _0x5bc277[_0x2e70('0x4f')](_0x34d34f);}})['then'](function(_0x1d93b6){if(_0x1d93b6){return _0x1d93b6?{'count':_0x3bcaa5,'rows':_0x1d93b6}:null;}})[_0x2e70('0x26')](respondWithResult(_0x1334b1,null))[_0x2e70('0x46')](handleError(_0x1334b1,null));}; \ No newline at end of file +var _0xd13a=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','update','params','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','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','papaparse','ioredis','../../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','Content-Range','apply','reject','save','then','destroy','end','sendStatus','stack','name','send','index','map','Dynamics365Configuration','type','model','keys'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd13a,0x73));var _0xad13=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd13a[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0xad13('0x0'));var rimraf=require(_0xad13('0x1'));var zipdir=require(_0xad13('0x2'));var jsonpatch=require(_0xad13('0x3'));var rp=require(_0xad13('0x4'));var moment=require(_0xad13('0x5'));var BPromise=require(_0xad13('0x6'));var Mustache=require(_0xad13('0x7'));var util=require(_0xad13('0x8'));var path=require('path');var sox=require(_0xad13('0x9'));var csv=require(_0xad13('0xa'));var ejs=require(_0xad13('0xb'));var fs=require('fs');var fs_extra=require(_0xad13('0xc'));var _=require(_0xad13('0xd'));var squel=require(_0xad13('0xe'));var crypto=require(_0xad13('0xf'));var jsforce=require(_0xad13('0x10'));var deskjs=require(_0xad13('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xad13('0x12'));var Redis=require(_0xad13('0x13'));var authService=require(_0xad13('0x14'));var qs=require(_0xad13('0x15'));var as=require(_0xad13('0x16'));var hardwareService=require(_0xad13('0x17'));var logger=require(_0xad13('0x18'))(_0xad13('0x19'));var utils=require(_0xad13('0x1a'));var config=require(_0xad13('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b6461,_0x1c205a){_0x1c205a=_0x1c205a||0xcc;return function(_0x3532e2){if(_0x3532e2){return _0x1b6461['sendStatus'](_0x1c205a);}return _0x1b6461[_0xad13('0x1c')](_0x1c205a)['end']();};}function respondWithResult(_0xf99e72,_0x39201){_0x39201=_0x39201||0xc8;return function(_0x5a0b25){if(_0x5a0b25){return _0xf99e72[_0xad13('0x1c')](_0x39201)[_0xad13('0x1d')](_0x5a0b25);}};}function respondWithFilteredResult(_0x8d4fd,_0x4c05a7){return function(_0x52d292){if(_0x52d292){var _0x2a9f09=typeof _0x4c05a7[_0xad13('0x1e')]===_0xad13('0x1f')&&typeof _0x4c05a7[_0xad13('0x20')]===_0xad13('0x1f');var _0x340241=_0x52d292[_0xad13('0x21')];var _0x4c31bd=_0x2a9f09?0x0:_0x4c05a7[_0xad13('0x1e')];var _0x4cbbd1=_0x2a9f09?_0x52d292[_0xad13('0x21')]:_0x4c05a7[_0xad13('0x1e')]+_0x4c05a7['limit'];var _0x567a84;if(_0x4cbbd1>=_0x340241){_0x4cbbd1=_0x340241;_0x567a84=0xc8;}else{_0x567a84=0xce;}_0x8d4fd[_0xad13('0x1c')](_0x567a84);return _0x8d4fd['set'](_0xad13('0x22'),_0x4c31bd+'-'+_0x4cbbd1+'/'+_0x340241)['json'](_0x52d292);}return null;};}function patchUpdates(_0x1fe69c){return function(_0x45513c){try{jsonpatch[_0xad13('0x23')](_0x45513c,_0x1fe69c,!![]);}catch(_0x55aa80){return BPromise[_0xad13('0x24')](_0x55aa80);}return _0x45513c[_0xad13('0x25')]();};}function saveUpdates(_0x5cdfc0,_0xa4ed93){return function(_0x454f6a){if(_0x454f6a){return _0x454f6a['update'](_0x5cdfc0)[_0xad13('0x26')](function(_0x4a0de1){return _0x4a0de1;});}return null;};}function removeEntity(_0x1d7f72,_0x3163a4){return function(_0x2ecc9d){if(_0x2ecc9d){return _0x2ecc9d[_0xad13('0x27')]()['then'](function(){_0x1d7f72[_0xad13('0x1c')](0xcc)[_0xad13('0x28')]();});}};}function handleEntityNotFound(_0x24d853,_0x4ebadc){return function(_0x46af30){if(!_0x46af30){_0x24d853[_0xad13('0x29')](0x194);}return _0x46af30;};}function handleError(_0x38bc03,_0x13326c){_0x13326c=_0x13326c||0x1f4;return function(_0x387904){logger['error'](_0x387904[_0xad13('0x2a')]);if(_0x387904['name']){delete _0x387904[_0xad13('0x2b')];}_0x38bc03['status'](_0x13326c)[_0xad13('0x2c')](_0x387904);};}exports[_0xad13('0x2d')]=function(_0x1e78ee,_0x519ab2){var _0x1b2723={},_0x596f60={},_0x37de6f={'count':0x0,'rows':[]};var _0xd12db1=_[_0xad13('0x2e')](db[_0xad13('0x2f')]['rawAttributes'],function(_0x1d2d18){return{'name':_0x1d2d18['fieldName'],'type':_0x1d2d18[_0xad13('0x30')]['key']};});_0x596f60[_0xad13('0x31')]=_['map'](_0xd12db1,_0xad13('0x2b'));_0x596f60['query']=_[_0xad13('0x32')](_0x1e78ee[_0xad13('0x33')]);_0x596f60[_0xad13('0x34')]=_[_0xad13('0x35')](_0x596f60['model'],_0x596f60['query']);_0x1b2723[_0xad13('0x36')]=_[_0xad13('0x35')](_0x596f60[_0xad13('0x31')],qs[_0xad13('0x37')](_0x1e78ee['query'][_0xad13('0x37')]));_0x1b2723[_0xad13('0x36')]=_0x1b2723[_0xad13('0x36')][_0xad13('0x38')]?_0x1b2723['attributes']:_0x596f60[_0xad13('0x31')];if(!_0x1e78ee['query'][_0xad13('0x39')](_0xad13('0x3a'))){_0x1b2723[_0xad13('0x20')]=qs[_0xad13('0x20')](_0x1e78ee[_0xad13('0x33')][_0xad13('0x20')]);_0x1b2723['offset']=qs['offset'](_0x1e78ee[_0xad13('0x33')]['offset']);}_0x1b2723[_0xad13('0x3b')]=qs[_0xad13('0x3c')](_0x1e78ee['query']['sort']);_0x1b2723[_0xad13('0x3d')]=qs[_0xad13('0x34')](_[_0xad13('0x3e')](_0x1e78ee[_0xad13('0x33')],_0x596f60[_0xad13('0x34')]),_0xd12db1);if(_0x1e78ee[_0xad13('0x33')][_0xad13('0x3f')]){_0x1b2723['where']=_[_0xad13('0x40')](_0x1b2723['where'],{'$or':_[_0xad13('0x2e')](_0xd12db1,function(_0x5943a8){if(_0x5943a8['type']!==_0xad13('0x41')){var _0x10ff91={};_0x10ff91[_0x5943a8[_0xad13('0x2b')]]={'$like':'%'+_0x1e78ee[_0xad13('0x33')][_0xad13('0x3f')]+'%'};return _0x10ff91;}})});}_0x1b2723=_[_0xad13('0x40')]({},_0x1b2723,_0x1e78ee[_0xad13('0x42')]);var _0x248eae={'where':_0x1b2723['where']};return db[_0xad13('0x2f')]['count'](_0x248eae)['then'](function(_0x5a4675){_0x37de6f[_0xad13('0x21')]=_0x5a4675;if(_0x1e78ee['query'][_0xad13('0x43')]){_0x1b2723[_0xad13('0x44')]=[{'all':!![]}];}return db[_0xad13('0x2f')]['findAll'](_0x1b2723);})['then'](function(_0x54acb6){_0x37de6f[_0xad13('0x45')]=_0x54acb6;return _0x37de6f;})[_0xad13('0x26')](respondWithFilteredResult(_0x519ab2,_0x1b2723))[_0xad13('0x46')](handleError(_0x519ab2,null));};exports[_0xad13('0x47')]=function(_0x2cc488,_0x271f00){var _0x191352={'raw':![],'where':{'id':_0x2cc488['params']['id']}},_0x1eda00={};_0x1eda00['model']=_[_0xad13('0x32')](db[_0xad13('0x2f')][_0xad13('0x48')]);_0x1eda00[_0xad13('0x33')]=_['keys'](_0x2cc488[_0xad13('0x33')]);_0x1eda00[_0xad13('0x34')]=_[_0xad13('0x35')](_0x1eda00[_0xad13('0x31')],_0x1eda00[_0xad13('0x33')]);_0x191352[_0xad13('0x36')]=_['intersection'](_0x1eda00[_0xad13('0x31')],qs[_0xad13('0x37')](_0x2cc488[_0xad13('0x33')]['fields']));_0x191352[_0xad13('0x36')]=_0x191352[_0xad13('0x36')][_0xad13('0x38')]?_0x191352['attributes']:_0x1eda00[_0xad13('0x31')];if(_0x2cc488[_0xad13('0x33')]['includeAll']){_0x191352[_0xad13('0x44')]=[{'all':!![]}];}_0x191352=_['merge']({},_0x191352,_0x2cc488[_0xad13('0x42')]);return db[_0xad13('0x2f')][_0xad13('0x49')](_0x191352)[_0xad13('0x26')](handleEntityNotFound(_0x271f00,null))[_0xad13('0x26')](respondWithResult(_0x271f00,null))[_0xad13('0x46')](handleError(_0x271f00,null));};exports['create']=function(_0x16aa99,_0x10ac67){return db[_0xad13('0x2f')][_0xad13('0x4a')](_0x16aa99[_0xad13('0x4b')],{})[_0xad13('0x26')](respondWithResult(_0x10ac67,0xc9))[_0xad13('0x46')](handleError(_0x10ac67,null));};exports[_0xad13('0x4c')]=function(_0x2f714e,_0x25321f){if(_0x2f714e[_0xad13('0x4b')]['id']){delete _0x2f714e[_0xad13('0x4b')]['id'];}return db[_0xad13('0x2f')][_0xad13('0x49')]({'where':{'id':_0x2f714e[_0xad13('0x4d')]['id']}})['then'](handleEntityNotFound(_0x25321f,null))['then'](saveUpdates(_0x2f714e[_0xad13('0x4b')],null))[_0xad13('0x26')](respondWithResult(_0x25321f,null))['catch'](handleError(_0x25321f,null));};exports[_0xad13('0x27')]=function(_0x134a5f,_0x1578e7){return db['Dynamics365Configuration'][_0xad13('0x49')]({'where':{'id':_0x134a5f[_0xad13('0x4d')]['id']}})[_0xad13('0x26')](handleEntityNotFound(_0x1578e7,null))[_0xad13('0x26')](removeEntity(_0x1578e7,null))['catch'](handleError(_0x1578e7,null));};exports[_0xad13('0x4e')]=function(_0x4b2d76,_0x3f10d5,_0x435848){var _0x856456={};var _0x2bddef={};var _0x3e6a31;var _0x39acf2;return db[_0xad13('0x2f')][_0xad13('0x4f')]({'where':{'id':_0x4b2d76[_0xad13('0x4d')]['id']}})[_0xad13('0x26')](handleEntityNotFound(_0x3f10d5,null))[_0xad13('0x26')](function(_0x3184d3){if(_0x3184d3){_0x3e6a31=_0x3184d3;_0x2bddef[_0xad13('0x31')]=_[_0xad13('0x32')](db[_0xad13('0x50')][_0xad13('0x48')]);_0x2bddef[_0xad13('0x33')]=_[_0xad13('0x32')](_0x4b2d76[_0xad13('0x33')]);_0x2bddef['filters']=_[_0xad13('0x35')](_0x2bddef[_0xad13('0x31')],_0x2bddef[_0xad13('0x33')]);_0x856456[_0xad13('0x36')]=_[_0xad13('0x35')](_0x2bddef['model'],qs[_0xad13('0x37')](_0x4b2d76['query']['fields']));_0x856456['attributes']=_0x856456[_0xad13('0x36')]['length']?_0x856456[_0xad13('0x36')]:_0x2bddef['model'];_0x856456[_0xad13('0x3b')]=qs['sort'](_0x4b2d76[_0xad13('0x33')][_0xad13('0x3c')]);_0x856456['where']=qs[_0xad13('0x34')](_[_0xad13('0x3e')](_0x4b2d76[_0xad13('0x33')],_0x2bddef['filters']));if(_0x4b2d76[_0xad13('0x33')][_0xad13('0x3f')]){_0x856456[_0xad13('0x3d')]=_[_0xad13('0x40')](_0x856456[_0xad13('0x3d')],{'$or':_[_0xad13('0x2e')](_0x856456[_0xad13('0x36')],function(_0x79225f){var _0x3cbae1={};_0x3cbae1[_0x79225f]={'$like':'%'+_0x4b2d76['query'][_0xad13('0x3f')]+'%'};return _0x3cbae1;})});}_0x856456=_[_0xad13('0x40')]({},_0x856456,_0x4b2d76[_0xad13('0x42')]);return _0x3e6a31[_0xad13('0x4e')](_0x856456);}})[_0xad13('0x26')](function(_0xde868d){if(_0xde868d){_0x39acf2=_0xde868d[_0xad13('0x38')];if(!_0x4b2d76[_0xad13('0x33')]['hasOwnProperty'](_0xad13('0x3a'))){_0x856456[_0xad13('0x20')]=qs[_0xad13('0x20')](_0x4b2d76[_0xad13('0x33')][_0xad13('0x20')]);_0x856456[_0xad13('0x1e')]=qs[_0xad13('0x1e')](_0x4b2d76[_0xad13('0x33')][_0xad13('0x1e')]);}return _0x3e6a31['getFields'](_0x856456);}})[_0xad13('0x26')](function(_0xf078f5){if(_0xf078f5){return _0xf078f5?{'count':_0x39acf2,'rows':_0xf078f5}:null;}})[_0xad13('0x26')](respondWithResult(_0x3f10d5,null))[_0xad13('0x46')](handleError(_0x3f10d5,null));};exports['getSubjects']=function(_0x5b57e5,_0x1e73e6,_0x318e1d){var _0x1db78c={};var _0xd76277={};var _0xd557ca;var _0x457b6e;return db['Dynamics365Configuration'][_0xad13('0x4f')]({'where':{'id':_0x5b57e5[_0xad13('0x4d')]['id']}})[_0xad13('0x26')](handleEntityNotFound(_0x1e73e6,null))[_0xad13('0x26')](function(_0x49d773){if(_0x49d773){_0xd557ca=_0x49d773;_0xd76277[_0xad13('0x31')]=_[_0xad13('0x32')](db[_0xad13('0x50')][_0xad13('0x48')]);_0xd76277['query']=_['keys'](_0x5b57e5[_0xad13('0x33')]);_0xd76277['filters']=_[_0xad13('0x35')](_0xd76277['model'],_0xd76277[_0xad13('0x33')]);_0x1db78c[_0xad13('0x36')]=_[_0xad13('0x35')](_0xd76277['model'],qs[_0xad13('0x37')](_0x5b57e5['query']['fields']));_0x1db78c[_0xad13('0x36')]=_0x1db78c[_0xad13('0x36')][_0xad13('0x38')]?_0x1db78c['attributes']:_0xd76277[_0xad13('0x31')];_0x1db78c[_0xad13('0x3b')]=qs[_0xad13('0x3c')](_0x5b57e5['query'][_0xad13('0x3c')]);_0x1db78c['where']=qs[_0xad13('0x34')](_[_0xad13('0x3e')](_0x5b57e5[_0xad13('0x33')],_0xd76277[_0xad13('0x34')]));if(_0x5b57e5[_0xad13('0x33')][_0xad13('0x3f')]){_0x1db78c[_0xad13('0x3d')]=_[_0xad13('0x40')](_0x1db78c[_0xad13('0x3d')],{'$or':_[_0xad13('0x2e')](_0x1db78c[_0xad13('0x36')],function(_0x1b2771){var _0x38437d={};_0x38437d[_0x1b2771]={'$like':'%'+_0x5b57e5['query'][_0xad13('0x3f')]+'%'};return _0x38437d;})});}_0x1db78c=_[_0xad13('0x40')]({},_0x1db78c,_0x5b57e5[_0xad13('0x42')]);return _0xd557ca[_0xad13('0x51')](_0x1db78c);}})[_0xad13('0x26')](function(_0x1667ed){if(_0x1667ed){_0x457b6e=_0x1667ed[_0xad13('0x38')];if(!_0x5b57e5[_0xad13('0x33')][_0xad13('0x39')](_0xad13('0x3a'))){_0x1db78c[_0xad13('0x20')]=qs['limit'](_0x5b57e5[_0xad13('0x33')]['limit']);_0x1db78c['offset']=qs['offset'](_0x5b57e5[_0xad13('0x33')][_0xad13('0x1e')]);}return _0xd557ca['getSubjects'](_0x1db78c);}})[_0xad13('0x26')](function(_0xdc6ccf){if(_0xdc6ccf){return _0xdc6ccf?{'count':_0x457b6e,'rows':_0xdc6ccf}:null;}})['then'](respondWithResult(_0x1e73e6,null))[_0xad13('0x46')](handleError(_0x1e73e6,null));};exports['getDescriptions']=function(_0x4e5262,_0x259f85,_0x12d55f){var _0x223288={};var _0x2d187a={};var _0x26020d;var _0xc30a4e;return db['Dynamics365Configuration'][_0xad13('0x4f')]({'where':{'id':_0x4e5262[_0xad13('0x4d')]['id']}})[_0xad13('0x26')](handleEntityNotFound(_0x259f85,null))[_0xad13('0x26')](function(_0x45a03e){if(_0x45a03e){_0x26020d=_0x45a03e;_0x2d187a[_0xad13('0x31')]=_[_0xad13('0x32')](db[_0xad13('0x50')][_0xad13('0x48')]);_0x2d187a[_0xad13('0x33')]=_['keys'](_0x4e5262[_0xad13('0x33')]);_0x2d187a[_0xad13('0x34')]=_[_0xad13('0x35')](_0x2d187a[_0xad13('0x31')],_0x2d187a['query']);_0x223288[_0xad13('0x36')]=_[_0xad13('0x35')](_0x2d187a['model'],qs[_0xad13('0x37')](_0x4e5262[_0xad13('0x33')]['fields']));_0x223288[_0xad13('0x36')]=_0x223288[_0xad13('0x36')][_0xad13('0x38')]?_0x223288[_0xad13('0x36')]:_0x2d187a[_0xad13('0x31')];_0x223288[_0xad13('0x3b')]=qs[_0xad13('0x3c')](_0x4e5262[_0xad13('0x33')][_0xad13('0x3c')]);_0x223288[_0xad13('0x3d')]=qs[_0xad13('0x34')](_[_0xad13('0x3e')](_0x4e5262[_0xad13('0x33')],_0x2d187a[_0xad13('0x34')]));if(_0x4e5262[_0xad13('0x33')]['filter']){_0x223288[_0xad13('0x3d')]=_['merge'](_0x223288[_0xad13('0x3d')],{'$or':_['map'](_0x223288[_0xad13('0x36')],function(_0x55a5f5){var _0x58dd63={};_0x58dd63[_0x55a5f5]={'$like':'%'+_0x4e5262[_0xad13('0x33')][_0xad13('0x3f')]+'%'};return _0x58dd63;})});}_0x223288=_[_0xad13('0x40')]({},_0x223288,_0x4e5262[_0xad13('0x42')]);return _0x26020d[_0xad13('0x52')](_0x223288);}})[_0xad13('0x26')](function(_0x35e354){if(_0x35e354){_0xc30a4e=_0x35e354[_0xad13('0x38')];if(!_0x4e5262[_0xad13('0x33')][_0xad13('0x39')](_0xad13('0x3a'))){_0x223288[_0xad13('0x20')]=qs[_0xad13('0x20')](_0x4e5262[_0xad13('0x33')][_0xad13('0x20')]);_0x223288['offset']=qs[_0xad13('0x1e')](_0x4e5262[_0xad13('0x33')]['offset']);}return _0x26020d[_0xad13('0x52')](_0x223288);}})['then'](function(_0x3fee75){if(_0x3fee75){return _0x3fee75?{'count':_0xc30a4e,'rows':_0x3fee75}:null;}})[_0xad13('0x26')](respondWithResult(_0x259f85,null))[_0xad13('0x46')](handleError(_0x259f85,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index bb35beb..5808b62 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 _0xf109=['Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x80aaee,_0x53dd19){var _0x380b69=function(_0x1a709e){while(--_0x1a709e){_0x80aaee['push'](_0x80aaee['shift']());}};_0x380b69(++_0x53dd19);}(_0xf109,0xce));var _0x9f10=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xf109[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6d6=['path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2efa09,_0xe0b75f){var _0x544fb6=function(_0x261aa6){while(--_0x261aa6){_0x2efa09['push'](_0x2efa09['shift']());}};_0x544fb6(++_0xe0b75f);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x113114,_0x3b8b6e){_0x113114=_0x113114-0x0;var _0x53fd29=_0xd6d6[_0x113114];return _0x53fd29;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var logger=require(_0x6d6d('0x2'))(_0x6d6d('0x3'));var moment=require('moment');var BPromise=require(_0x6d6d('0x4'));var rp=require(_0x6d6d('0x5'));var fs=require('fs');var path=require(_0x6d6d('0x6'));var rimraf=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var attributes=require(_0x6d6d('0x9'));module[_0x6d6d('0xa')]=function(_0x5702dc,_0x210ff7){return _0x5702dc[_0x6d6d('0xb')](_0x6d6d('0xc'),attributes,{'tableName':_0x6d6d('0xd'),'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 d4583f7..731baac 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 _0x8166=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8166,0x1a2));var _0x6816=function(_0x28c939,_0x110e29){_0x28c939=_0x28c939-0x0;var _0x527fe9=_0x8166[_0x28c939];return _0x527fe9;};'use strict';var _=require(_0x6816('0x0'));var util=require(_0x6816('0x1'));var moment=require(_0x6816('0x2'));var BPromise=require(_0x6816('0x3'));var rs=require(_0x6816('0x4'));var fs=require('fs');var Redis=require(_0x6816('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6816('0x6'));var logger=require(_0x6816('0x7'))('rpc');var config=require(_0x6816('0x8'));var jayson=require(_0x6816('0x9'));var client=jayson[_0x6816('0xa')][_0x6816('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5648f0,_0x34049b,_0x49d573){return new BPromise(function(_0x5e16c1,_0x292891){return client['request'](_0x5648f0,_0x49d573)['then'](function(_0x413525){logger[_0x6816('0xc')](_0x6816('0xd'),_0x34049b,_0x6816('0xe'));logger[_0x6816('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x34049b,_0x6816('0xe'),JSON[_0x6816('0x10')](_0x413525));if(_0x413525['error']){if(_0x413525[_0x6816('0x11')]['code']===0x1f4){logger[_0x6816('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x34049b,_0x413525['error'][_0x6816('0x12')]);return _0x292891(_0x413525[_0x6816('0x11')][_0x6816('0x12')]);}logger[_0x6816('0x11')](_0x6816('0xd'),_0x34049b,_0x413525['error'][_0x6816('0x12')]);return _0x5e16c1(_0x413525['error'][_0x6816('0x12')]);}else{logger[_0x6816('0xc')](_0x6816('0xd'),_0x34049b,_0x6816('0xe'));_0x5e16c1(_0x413525[_0x6816('0x13')][_0x6816('0x12')]);}})['catch'](function(_0x2a933d){logger[_0x6816('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x34049b,_0x2a933d);_0x292891(_0x2a933d);});});} \ No newline at end of file +var _0x1e68=['request\x20sent','debug','stringify','error','message','Dynamics365Configuration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info'];(function(_0x4a83b8,_0x32f91d){var _0x10573f=function(_0x1217b4){while(--_0x1217b4){_0x4a83b8['push'](_0x4a83b8['shift']());}};_0x10573f(++_0x32f91d);}(_0x1e68,0x110));var _0x81e6=function(_0x40be8b,_0x3ad52c){_0x40be8b=_0x40be8b-0x0;var _0x2b1dfa=_0x1e68[_0x40be8b];return _0x2b1dfa;};'use strict';var _=require(_0x81e6('0x0'));var util=require(_0x81e6('0x1'));var moment=require(_0x81e6('0x2'));var BPromise=require(_0x81e6('0x3'));var rs=require(_0x81e6('0x4'));var fs=require('fs');var Redis=require(_0x81e6('0x5'));var db=require(_0x81e6('0x6'))['db'];var utils=require(_0x81e6('0x7'));var logger=require('../../config/logger')(_0x81e6('0x8'));var config=require(_0x81e6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x81e6('0xa')][_0x81e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41116e,_0x43fb25,_0x29cd28){return new BPromise(function(_0x457d8f,_0xff8cb6){return client['request'](_0x41116e,_0x29cd28)[_0x81e6('0xc')](function(_0x33ef7b){logger[_0x81e6('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x43fb25,_0x81e6('0xe'));logger[_0x81e6('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x43fb25,_0x81e6('0xe'),JSON[_0x81e6('0x10')](_0x33ef7b));if(_0x33ef7b[_0x81e6('0x11')]){if(_0x33ef7b[_0x81e6('0x11')]['code']===0x1f4){logger[_0x81e6('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x43fb25,_0x33ef7b[_0x81e6('0x11')][_0x81e6('0x12')]);return _0xff8cb6(_0x33ef7b[_0x81e6('0x11')][_0x81e6('0x12')]);}logger[_0x81e6('0x11')](_0x81e6('0x13'),_0x43fb25,_0x33ef7b[_0x81e6('0x11')][_0x81e6('0x12')]);return _0x457d8f(_0x33ef7b[_0x81e6('0x11')][_0x81e6('0x12')]);}else{logger['info'](_0x81e6('0x13'),_0x43fb25,_0x81e6('0xe'));_0x457d8f(_0x33ef7b[_0x81e6('0x14')][_0x81e6('0x12')]);}})[_0x81e6('0x15')](function(_0x920f12){logger['error'](_0x81e6('0x13'),_0x43fb25,_0x920f12);_0xff8cb6(_0x920f12);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 6f5680a..3dd2e83 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 _0xfc52=['../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','create','put','delete','destroy','exports','path','connect-timeout','Router','fs-extra'];(function(_0x343583,_0x276f29){var _0x547962=function(_0x2b2f24){while(--_0x2b2f24){_0x343583['push'](_0x343583['shift']());}};_0x547962(++_0x276f29);}(_0xfc52,0x1d8));var _0x2fc5=function(_0x2ced4f,_0x3e2bec){_0x2ced4f=_0x2ced4f-0x0;var _0x4cf01a=_0xfc52[_0x2ced4f];return _0x4cf01a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2fc5('0x0'));var timeout=require(_0x2fc5('0x1'));var express=require('express');var router=express[_0x2fc5('0x2')]();var fs_extra=require(_0x2fc5('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2fc5('0x4'));var controller=require(_0x2fc5('0x5'));router[_0x2fc5('0x6')]('/',auth[_0x2fc5('0x7')](),controller['index']);router[_0x2fc5('0x6')](_0x2fc5('0x8'),auth[_0x2fc5('0x7')](),controller['show']);router['post']('/',auth[_0x2fc5('0x7')](),controller[_0x2fc5('0x9')]);router[_0x2fc5('0xa')](_0x2fc5('0x8'),auth[_0x2fc5('0x7')](),controller['update']);router[_0x2fc5('0xb')](_0x2fc5('0x8'),auth['isAuthenticated'](),controller[_0x2fc5('0xc')]);module[_0x2fc5('0xd')]=router; \ No newline at end of file +var _0x2157=['show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','get','/:id'];(function(_0x53cf0b,_0x3a4c4c){var _0x2c8484=function(_0x42d4a5){while(--_0x42d4a5){_0x53cf0b['push'](_0x53cf0b['shift']());}};_0x2c8484(++_0x3a4c4c);}(_0x2157,0xe3));var _0x7215=function(_0x2dff3f,_0x258622){_0x2dff3f=_0x2dff3f-0x0;var _0x3570c8=_0x2157[_0x2dff3f];return _0x3570c8;};'use strict';var multer=require(_0x7215('0x0'));var util=require(_0x7215('0x1'));var path=require(_0x7215('0x2'));var timeout=require(_0x7215('0x3'));var express=require(_0x7215('0x4'));var router=express[_0x7215('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7215('0x6'));var interaction=require(_0x7215('0x7'));var config=require(_0x7215('0x8'));var controller=require(_0x7215('0x9'));router['get']('/',auth[_0x7215('0xa')](),controller['index']);router[_0x7215('0xb')](_0x7215('0xc'),auth['isAuthenticated'](),controller[_0x7215('0xd')]);router[_0x7215('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7215('0xf')]('/:id',auth[_0x7215('0xa')](),controller[_0x7215('0x10')]);router[_0x7215('0x11')](_0x7215('0xc'),auth[_0x7215('0xa')](),controller[_0x7215('0x12')]);module[_0x7215('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index f61c46f..d3208ce 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 _0x1c8d=['customVariable','picklist','STRING','ENUM','string','variable'];(function(_0x400ad4,_0x25ab92){var _0x48f28c=function(_0x482d00){while(--_0x482d00){_0x400ad4['push'](_0x400ad4['shift']());}};_0x48f28c(++_0x25ab92);}(_0x1c8d,0x183));var _0xd1c8=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1c8d[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xd1c8('0x0')](_0xd1c8('0x1'),_0xd1c8('0x2'),_0xd1c8('0x3'),'keyValue',_0xd1c8('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd1c8('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd1c8('0x0')]('string',_0xd1c8('0x2'),_0xd1c8('0x3'))},'keyContent':{'type':Sequelize[_0xd1c8('0x5')]},'idField':{'type':Sequelize[_0xd1c8('0x5')]},'nameField':{'type':Sequelize[_0xd1c8('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd1c8('0x5')]}}; \ No newline at end of file +var _0x36fa=['customVariable','keyValue','picklist','STRING','BOOLEAN','ENUM','string'];(function(_0x3d9779,_0x1aba29){var _0x262ece=function(_0x56aa6a){while(--_0x56aa6a){_0x3d9779['push'](_0x3d9779['shift']());}};_0x262ece(++_0x1aba29);}(_0x36fa,0x124));var _0xa36f=function(_0x51e7d0,_0x178df4){_0x51e7d0=_0x51e7d0-0x0;var _0x1d64b1=_0x36fa[_0x51e7d0];return _0x1d64b1;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xa36f('0x0')](_0xa36f('0x1'),'variable',_0xa36f('0x2'),_0xa36f('0x3'),_0xa36f('0x4')),'defaultValue':_0xa36f('0x1')},'content':{'type':Sequelize[_0xa36f('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xa36f('0x1'),'variable',_0xa36f('0x2'))},'keyContent':{'type':Sequelize[_0xa36f('0x5')]},'idField':{'type':Sequelize[_0xa36f('0x5')]},'nameField':{'type':Sequelize[_0xa36f('0x5')]},'customField':{'type':Sequelize[_0xa36f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa36f('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index c4f5fc2..000f112 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 _0x5e92=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','filter','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','update','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type'];(function(_0x606ade,_0x424b44){var _0x1774b7=function(_0x203650){while(--_0x203650){_0x606ade['push'](_0x606ade['shift']());}};_0x1774b7(++_0x424b44);}(_0x5e92,0xab));var _0x25e9=function(_0x399ae7,_0x3fe762){_0x399ae7=_0x399ae7-0x0;var _0xa57ba7=_0x5e92[_0x399ae7];return _0xa57ba7;};'use strict';var emlformat=require(_0x25e9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x25e9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25e9('0x2'));var moment=require(_0x25e9('0x3'));var BPromise=require(_0x25e9('0x4'));var Mustache=require(_0x25e9('0x5'));var util=require(_0x25e9('0x6'));var path=require(_0x25e9('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25e9('0x8'));var fs=require('fs');var fs_extra=require(_0x25e9('0x9'));var _=require('lodash');var squel=require(_0x25e9('0xa'));var crypto=require('crypto');var jsforce=require(_0x25e9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x25e9('0xc'));var querystring=require(_0x25e9('0xd'));var Papa=require(_0x25e9('0xe'));var Redis=require(_0x25e9('0xf'));var authService=require(_0x25e9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x25e9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x25e9('0x12'))(_0x25e9('0x13'));var utils=require(_0x25e9('0x14'));var config=require(_0x25e9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x25e9('0x16'))['db'];function respondWithStatusCode(_0x4552d9,_0x307e16){_0x307e16=_0x307e16||0xcc;return function(_0x58f073){if(_0x58f073){return _0x4552d9[_0x25e9('0x17')](_0x307e16);}return _0x4552d9[_0x25e9('0x18')](_0x307e16)[_0x25e9('0x19')]();};}function respondWithResult(_0x123934,_0x3ea452){_0x3ea452=_0x3ea452||0xc8;return function(_0x4078c4){if(_0x4078c4){return _0x123934['status'](_0x3ea452)[_0x25e9('0x1a')](_0x4078c4);}};}function respondWithFilteredResult(_0x4ceeab,_0x36e633){return function(_0x1e455f){if(_0x1e455f){var _0x2e98d7=typeof _0x36e633['offset']===_0x25e9('0x1b')&&typeof _0x36e633['limit']===_0x25e9('0x1b');var _0x5183bf=_0x1e455f[_0x25e9('0x1c')];var _0x18eb9d=_0x2e98d7?0x0:_0x36e633['offset'];var _0x43b477=_0x2e98d7?_0x1e455f['count']:_0x36e633['offset']+_0x36e633[_0x25e9('0x1d')];var _0x399967;if(_0x43b477>=_0x5183bf){_0x43b477=_0x5183bf;_0x399967=0xc8;}else{_0x399967=0xce;}_0x4ceeab['status'](_0x399967);return _0x4ceeab['set'](_0x25e9('0x1e'),_0x18eb9d+'-'+_0x43b477+'/'+_0x5183bf)['json'](_0x1e455f);}return null;};}function patchUpdates(_0x13b69c){return function(_0x4458cc){try{jsonpatch[_0x25e9('0x1f')](_0x4458cc,_0x13b69c,!![]);}catch(_0x142b1d){return BPromise['reject'](_0x142b1d);}return _0x4458cc[_0x25e9('0x20')]();};}function saveUpdates(_0x273a4c,_0x9688c1){return function(_0x2f6ddb){if(_0x2f6ddb){return _0x2f6ddb['update'](_0x273a4c)[_0x25e9('0x21')](function(_0x2a5138){return _0x2a5138;});}return null;};}function removeEntity(_0x5283c4,_0x3a0dae){return function(_0x387fbe){if(_0x387fbe){return _0x387fbe[_0x25e9('0x22')]()[_0x25e9('0x21')](function(){_0x5283c4[_0x25e9('0x18')](0xcc)[_0x25e9('0x19')]();});}};}function handleEntityNotFound(_0x1953de,_0x4a30dc){return function(_0x124245){if(!_0x124245){_0x1953de[_0x25e9('0x17')](0x194);}return _0x124245;};}function handleError(_0x527e71,_0x5d6bdb){_0x5d6bdb=_0x5d6bdb||0x1f4;return function(_0x2019ec){logger[_0x25e9('0x23')](_0x2019ec[_0x25e9('0x24')]);if(_0x2019ec['name']){delete _0x2019ec[_0x25e9('0x25')];}_0x527e71[_0x25e9('0x18')](_0x5d6bdb)[_0x25e9('0x26')](_0x2019ec);};}exports[_0x25e9('0x27')]=function(_0x432a8f,_0x31321d){var _0x46a76c={},_0x2c649e={},_0xfbc42c={'count':0x0,'rows':[]};var _0x473f06=_[_0x25e9('0x28')](db[_0x25e9('0x29')][_0x25e9('0x2a')],function(_0x1988f1){return{'name':_0x1988f1[_0x25e9('0x2b')],'type':_0x1988f1[_0x25e9('0x2c')][_0x25e9('0x2d')]};});_0x2c649e[_0x25e9('0x2e')]=_['map'](_0x473f06,'name');_0x2c649e[_0x25e9('0x2f')]=_[_0x25e9('0x30')](_0x432a8f[_0x25e9('0x2f')]);_0x2c649e[_0x25e9('0x31')]=_[_0x25e9('0x32')](_0x2c649e[_0x25e9('0x2e')],_0x2c649e[_0x25e9('0x2f')]);_0x46a76c[_0x25e9('0x33')]=_[_0x25e9('0x32')](_0x2c649e[_0x25e9('0x2e')],qs[_0x25e9('0x34')](_0x432a8f[_0x25e9('0x2f')][_0x25e9('0x34')]));_0x46a76c[_0x25e9('0x33')]=_0x46a76c[_0x25e9('0x33')][_0x25e9('0x35')]?_0x46a76c[_0x25e9('0x33')]:_0x2c649e[_0x25e9('0x2e')];if(!_0x432a8f[_0x25e9('0x2f')][_0x25e9('0x36')](_0x25e9('0x37'))){_0x46a76c[_0x25e9('0x1d')]=qs[_0x25e9('0x1d')](_0x432a8f[_0x25e9('0x2f')][_0x25e9('0x1d')]);_0x46a76c['offset']=qs[_0x25e9('0x38')](_0x432a8f[_0x25e9('0x2f')][_0x25e9('0x38')]);}_0x46a76c['order']=qs[_0x25e9('0x39')](_0x432a8f['query'][_0x25e9('0x39')]);_0x46a76c[_0x25e9('0x3a')]=qs[_0x25e9('0x31')](_['pick'](_0x432a8f['query'],_0x2c649e[_0x25e9('0x31')]),_0x473f06);if(_0x432a8f[_0x25e9('0x2f')][_0x25e9('0x3b')]){_0x46a76c[_0x25e9('0x3a')]=_['merge'](_0x46a76c[_0x25e9('0x3a')],{'$or':_[_0x25e9('0x28')](_0x473f06,function(_0x36482e){if(_0x36482e[_0x25e9('0x2c')]!=='VIRTUAL'){var _0x785d5b={};_0x785d5b[_0x36482e[_0x25e9('0x25')]]={'$like':'%'+_0x432a8f[_0x25e9('0x2f')][_0x25e9('0x3b')]+'%'};return _0x785d5b;}})});}_0x46a76c=_[_0x25e9('0x3c')]({},_0x46a76c,_0x432a8f[_0x25e9('0x3d')]);var _0x5aed6f={'where':_0x46a76c[_0x25e9('0x3a')]};return db['Dynamics365Field']['count'](_0x5aed6f)[_0x25e9('0x21')](function(_0x384bb0){_0xfbc42c[_0x25e9('0x1c')]=_0x384bb0;if(_0x432a8f['query']['includeAll']){_0x46a76c[_0x25e9('0x3e')]=[{'all':!![]}];}return db[_0x25e9('0x29')][_0x25e9('0x3f')](_0x46a76c);})['then'](function(_0x1c217e){_0xfbc42c['rows']=_0x1c217e;return _0xfbc42c;})[_0x25e9('0x21')](respondWithFilteredResult(_0x31321d,_0x46a76c))[_0x25e9('0x40')](handleError(_0x31321d,null));};exports[_0x25e9('0x41')]=function(_0x413939,_0x8c236){var _0x156ced={'raw':!![],'where':{'id':_0x413939[_0x25e9('0x42')]['id']}},_0x186448={};_0x186448['model']=_[_0x25e9('0x30')](db['Dynamics365Field'][_0x25e9('0x2a')]);_0x186448['query']=_[_0x25e9('0x30')](_0x413939[_0x25e9('0x2f')]);_0x186448['filters']=_[_0x25e9('0x32')](_0x186448[_0x25e9('0x2e')],_0x186448[_0x25e9('0x2f')]);_0x156ced['attributes']=_[_0x25e9('0x32')](_0x186448[_0x25e9('0x2e')],qs[_0x25e9('0x34')](_0x413939[_0x25e9('0x2f')][_0x25e9('0x34')]));_0x156ced['attributes']=_0x156ced['attributes'][_0x25e9('0x35')]?_0x156ced[_0x25e9('0x33')]:_0x186448[_0x25e9('0x2e')];if(_0x413939['query'][_0x25e9('0x43')]){_0x156ced[_0x25e9('0x3e')]=[{'all':!![]}];}_0x156ced=_[_0x25e9('0x3c')]({},_0x156ced,_0x413939[_0x25e9('0x3d')]);return db[_0x25e9('0x29')][_0x25e9('0x44')](_0x156ced)[_0x25e9('0x21')](handleEntityNotFound(_0x8c236,null))[_0x25e9('0x21')](respondWithResult(_0x8c236,null))[_0x25e9('0x40')](handleError(_0x8c236,null));};exports[_0x25e9('0x45')]=function(_0x54ee9b,_0x3ca4e9){return db[_0x25e9('0x29')][_0x25e9('0x45')](_0x54ee9b[_0x25e9('0x46')],{})['then'](respondWithResult(_0x3ca4e9,0xc9))['catch'](handleError(_0x3ca4e9,null));};exports[_0x25e9('0x47')]=function(_0x187777,_0x2999ce){if(_0x187777[_0x25e9('0x46')]['id']){delete _0x187777[_0x25e9('0x46')]['id'];}return db[_0x25e9('0x29')][_0x25e9('0x44')]({'where':{'id':_0x187777[_0x25e9('0x42')]['id']}})[_0x25e9('0x21')](handleEntityNotFound(_0x2999ce,null))[_0x25e9('0x21')](saveUpdates(_0x187777[_0x25e9('0x46')],null))[_0x25e9('0x21')](respondWithResult(_0x2999ce,null))[_0x25e9('0x40')](handleError(_0x2999ce,null));};exports[_0x25e9('0x22')]=function(_0x3e7acb,_0x41dc97){return db[_0x25e9('0x29')][_0x25e9('0x44')]({'where':{'id':_0x3e7acb[_0x25e9('0x42')]['id']}})[_0x25e9('0x21')](handleEntityNotFound(_0x41dc97,null))[_0x25e9('0x21')](removeEntity(_0x41dc97,null))['catch'](handleError(_0x41dc97,null));}; \ No newline at end of file +var _0xca20=['json','apply','reject','save','update','then','destroy','end','stack','name','send','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Field','include','findAll','rows','catch','show','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','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','offset','undefined','limit','count','set','Content-Range'];(function(_0x188a21,_0x5fced1){var _0x42e918=function(_0x24bafe){while(--_0x24bafe){_0x188a21['push'](_0x188a21['shift']());}};_0x42e918(++_0x5fced1);}(_0xca20,0x113));var _0x0ca2=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xca20[_0xd0b415];return _0x2bdf2c;};'use strict';var emlformat=require(_0x0ca2('0x0'));var rimraf=require(_0x0ca2('0x1'));var zipdir=require(_0x0ca2('0x2'));var jsonpatch=require(_0x0ca2('0x3'));var rp=require(_0x0ca2('0x4'));var moment=require(_0x0ca2('0x5'));var BPromise=require(_0x0ca2('0x6'));var Mustache=require(_0x0ca2('0x7'));var util=require(_0x0ca2('0x8'));var path=require('path');var sox=require(_0x0ca2('0x9'));var csv=require(_0x0ca2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ca2('0xb'));var _=require('lodash');var squel=require(_0x0ca2('0xc'));var crypto=require('crypto');var jsforce=require(_0x0ca2('0xd'));var deskjs=require(_0x0ca2('0xe'));var toCsv=require(_0x0ca2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0ca2('0xf'));var authService=require(_0x0ca2('0x10'));var qs=require(_0x0ca2('0x11'));var as=require(_0x0ca2('0x12'));var hardwareService=require(_0x0ca2('0x13'));var logger=require('../../config/logger')(_0x0ca2('0x14'));var utils=require(_0x0ca2('0x15'));var config=require(_0x0ca2('0x16'));var licenseUtil=require(_0x0ca2('0x17'));var db=require(_0x0ca2('0x18'))['db'];function respondWithStatusCode(_0x4517b4,_0x472f5a){_0x472f5a=_0x472f5a||0xcc;return function(_0x54d840){if(_0x54d840){return _0x4517b4[_0x0ca2('0x19')](_0x472f5a);}return _0x4517b4[_0x0ca2('0x1a')](_0x472f5a)['end']();};}function respondWithResult(_0x36312e,_0x4f7b3b){_0x4f7b3b=_0x4f7b3b||0xc8;return function(_0x32f574){if(_0x32f574){return _0x36312e[_0x0ca2('0x1a')](_0x4f7b3b)['json'](_0x32f574);}};}function respondWithFilteredResult(_0x594c45,_0x56f3cf){return function(_0x8e9889){if(_0x8e9889){var _0x117eb0=typeof _0x56f3cf[_0x0ca2('0x1b')]===_0x0ca2('0x1c')&&typeof _0x56f3cf[_0x0ca2('0x1d')]===_0x0ca2('0x1c');var _0x10c154=_0x8e9889[_0x0ca2('0x1e')];var _0x1f023d=_0x117eb0?0x0:_0x56f3cf['offset'];var _0x35850a=_0x117eb0?_0x8e9889[_0x0ca2('0x1e')]:_0x56f3cf[_0x0ca2('0x1b')]+_0x56f3cf[_0x0ca2('0x1d')];var _0x2c0339;if(_0x35850a>=_0x10c154){_0x35850a=_0x10c154;_0x2c0339=0xc8;}else{_0x2c0339=0xce;}_0x594c45['status'](_0x2c0339);return _0x594c45[_0x0ca2('0x1f')](_0x0ca2('0x20'),_0x1f023d+'-'+_0x35850a+'/'+_0x10c154)[_0x0ca2('0x21')](_0x8e9889);}return null;};}function patchUpdates(_0x57d7d7){return function(_0x5d34d0){try{jsonpatch[_0x0ca2('0x22')](_0x5d34d0,_0x57d7d7,!![]);}catch(_0x2c0dac){return BPromise[_0x0ca2('0x23')](_0x2c0dac);}return _0x5d34d0[_0x0ca2('0x24')]();};}function saveUpdates(_0xc4734f,_0x584784){return function(_0x4f5115){if(_0x4f5115){return _0x4f5115[_0x0ca2('0x25')](_0xc4734f)[_0x0ca2('0x26')](function(_0x5c3e08){return _0x5c3e08;});}return null;};}function removeEntity(_0x361419,_0x2b9ba1){return function(_0x5dc551){if(_0x5dc551){return _0x5dc551[_0x0ca2('0x27')]()[_0x0ca2('0x26')](function(){_0x361419[_0x0ca2('0x1a')](0xcc)[_0x0ca2('0x28')]();});}};}function handleEntityNotFound(_0x95ba01,_0xf3decc){return function(_0x284017){if(!_0x284017){_0x95ba01[_0x0ca2('0x19')](0x194);}return _0x284017;};}function handleError(_0x5cab5b,_0x195631){_0x195631=_0x195631||0x1f4;return function(_0x544e6f){logger['error'](_0x544e6f[_0x0ca2('0x29')]);if(_0x544e6f[_0x0ca2('0x2a')]){delete _0x544e6f[_0x0ca2('0x2a')];}_0x5cab5b[_0x0ca2('0x1a')](_0x195631)[_0x0ca2('0x2b')](_0x544e6f);};}exports['index']=function(_0x5f2336,_0x3ea16b){var _0x1c5f4f={},_0x3bb658={},_0x332ee9={'count':0x0,'rows':[]};var _0x572f87=_[_0x0ca2('0x2c')](db['Dynamics365Field'][_0x0ca2('0x2d')],function(_0x44517a){return{'name':_0x44517a[_0x0ca2('0x2e')],'type':_0x44517a[_0x0ca2('0x2f')][_0x0ca2('0x30')]};});_0x3bb658['model']=_['map'](_0x572f87,'name');_0x3bb658['query']=_[_0x0ca2('0x31')](_0x5f2336['query']);_0x3bb658[_0x0ca2('0x32')]=_[_0x0ca2('0x33')](_0x3bb658[_0x0ca2('0x34')],_0x3bb658[_0x0ca2('0x35')]);_0x1c5f4f[_0x0ca2('0x36')]=_[_0x0ca2('0x33')](_0x3bb658['model'],qs[_0x0ca2('0x37')](_0x5f2336[_0x0ca2('0x35')][_0x0ca2('0x37')]));_0x1c5f4f[_0x0ca2('0x36')]=_0x1c5f4f[_0x0ca2('0x36')][_0x0ca2('0x38')]?_0x1c5f4f[_0x0ca2('0x36')]:_0x3bb658[_0x0ca2('0x34')];if(!_0x5f2336[_0x0ca2('0x35')][_0x0ca2('0x39')](_0x0ca2('0x3a'))){_0x1c5f4f['limit']=qs[_0x0ca2('0x1d')](_0x5f2336[_0x0ca2('0x35')][_0x0ca2('0x1d')]);_0x1c5f4f[_0x0ca2('0x1b')]=qs['offset'](_0x5f2336[_0x0ca2('0x35')]['offset']);}_0x1c5f4f[_0x0ca2('0x3b')]=qs[_0x0ca2('0x3c')](_0x5f2336[_0x0ca2('0x35')]['sort']);_0x1c5f4f[_0x0ca2('0x3d')]=qs['filters'](_[_0x0ca2('0x3e')](_0x5f2336['query'],_0x3bb658[_0x0ca2('0x32')]),_0x572f87);if(_0x5f2336['query'][_0x0ca2('0x3f')]){_0x1c5f4f[_0x0ca2('0x3d')]=_[_0x0ca2('0x40')](_0x1c5f4f['where'],{'$or':_[_0x0ca2('0x2c')](_0x572f87,function(_0x51ba2e){if(_0x51ba2e[_0x0ca2('0x2f')]!==_0x0ca2('0x41')){var _0xab4247={};_0xab4247[_0x51ba2e[_0x0ca2('0x2a')]]={'$like':'%'+_0x5f2336[_0x0ca2('0x35')][_0x0ca2('0x3f')]+'%'};return _0xab4247;}})});}_0x1c5f4f=_[_0x0ca2('0x40')]({},_0x1c5f4f,_0x5f2336[_0x0ca2('0x42')]);var _0x5bdb3f={'where':_0x1c5f4f['where']};return db[_0x0ca2('0x43')][_0x0ca2('0x1e')](_0x5bdb3f)['then'](function(_0x16e41a){_0x332ee9[_0x0ca2('0x1e')]=_0x16e41a;if(_0x5f2336[_0x0ca2('0x35')]['includeAll']){_0x1c5f4f[_0x0ca2('0x44')]=[{'all':!![]}];}return db[_0x0ca2('0x43')][_0x0ca2('0x45')](_0x1c5f4f);})['then'](function(_0x2bde3e){_0x332ee9[_0x0ca2('0x46')]=_0x2bde3e;return _0x332ee9;})[_0x0ca2('0x26')](respondWithFilteredResult(_0x3ea16b,_0x1c5f4f))[_0x0ca2('0x47')](handleError(_0x3ea16b,null));};exports[_0x0ca2('0x48')]=function(_0x10e446,_0x51f313){var _0x6bc8a7={'raw':!![],'where':{'id':_0x10e446['params']['id']}},_0x332a8c={};_0x332a8c['model']=_[_0x0ca2('0x31')](db[_0x0ca2('0x43')][_0x0ca2('0x2d')]);_0x332a8c[_0x0ca2('0x35')]=_[_0x0ca2('0x31')](_0x10e446['query']);_0x332a8c[_0x0ca2('0x32')]=_[_0x0ca2('0x33')](_0x332a8c[_0x0ca2('0x34')],_0x332a8c[_0x0ca2('0x35')]);_0x6bc8a7[_0x0ca2('0x36')]=_[_0x0ca2('0x33')](_0x332a8c[_0x0ca2('0x34')],qs['fields'](_0x10e446[_0x0ca2('0x35')][_0x0ca2('0x37')]));_0x6bc8a7[_0x0ca2('0x36')]=_0x6bc8a7[_0x0ca2('0x36')][_0x0ca2('0x38')]?_0x6bc8a7[_0x0ca2('0x36')]:_0x332a8c[_0x0ca2('0x34')];if(_0x10e446[_0x0ca2('0x35')][_0x0ca2('0x49')]){_0x6bc8a7[_0x0ca2('0x44')]=[{'all':!![]}];}_0x6bc8a7=_[_0x0ca2('0x40')]({},_0x6bc8a7,_0x10e446[_0x0ca2('0x42')]);return db[_0x0ca2('0x43')]['find'](_0x6bc8a7)[_0x0ca2('0x26')](handleEntityNotFound(_0x51f313,null))['then'](respondWithResult(_0x51f313,null))[_0x0ca2('0x47')](handleError(_0x51f313,null));};exports[_0x0ca2('0x4a')]=function(_0x1fc801,_0x3bd0a5){return db[_0x0ca2('0x43')][_0x0ca2('0x4a')](_0x1fc801['body'],{})[_0x0ca2('0x26')](respondWithResult(_0x3bd0a5,0xc9))[_0x0ca2('0x47')](handleError(_0x3bd0a5,null));};exports[_0x0ca2('0x25')]=function(_0x3c255c,_0x4354a3){if(_0x3c255c[_0x0ca2('0x4b')]['id']){delete _0x3c255c[_0x0ca2('0x4b')]['id'];}return db[_0x0ca2('0x43')][_0x0ca2('0x4c')]({'where':{'id':_0x3c255c['params']['id']}})['then'](handleEntityNotFound(_0x4354a3,null))[_0x0ca2('0x26')](saveUpdates(_0x3c255c[_0x0ca2('0x4b')],null))[_0x0ca2('0x26')](respondWithResult(_0x4354a3,null))[_0x0ca2('0x47')](handleError(_0x4354a3,null));};exports[_0x0ca2('0x27')]=function(_0x724068,_0x5c43ab){return db[_0x0ca2('0x43')][_0x0ca2('0x4c')]({'where':{'id':_0x724068['params']['id']}})[_0x0ca2('0x26')](handleEntityNotFound(_0x5c43ab,null))[_0x0ca2('0x26')](removeEntity(_0x5c43ab,null))[_0x0ca2('0x47')](handleError(_0x5c43ab,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 5f9dd4d..cc32e40 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 _0xdca3=['idField','FieldId','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x52a293,_0x20560f){var _0x50b815=function(_0x1f83b5){while(--_0x1f83b5){_0x52a293['push'](_0x52a293['shift']());}};_0x50b815(++_0x20560f);}(_0xdca3,0x17b));var _0x3dca=function(_0x42ee97,_0x27ecad){_0x42ee97=_0x42ee97-0x0;var _0x4c62af=_0xdca3[_0x42ee97];return _0x4c62af;};'use strict';var _=require('lodash');var util=require(_0x3dca('0x0'));var logger=require(_0x3dca('0x1'))('api');var moment=require(_0x3dca('0x2'));var BPromise=require(_0x3dca('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3dca('0x4'));var config=require(_0x3dca('0x5'));var attributes=require(_0x3dca('0x6'));module[_0x3dca('0x7')]=function(_0x9cc90,_0x3cd0b4){return _0x9cc90['define'](_0x3dca('0x8'),attributes,{'tableName':_0x3dca('0x9'),'paranoid':![],'indexes':[{'name':_0x3dca('0xa'),'fields':[_0x3dca('0xb'),_0x3dca('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc5c=['request-promise','path','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xbc5c,0x1c3));var _0xcbc5=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xbc5c[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0xcbc5('0x0'));var logger=require(_0xcbc5('0x1'))('api');var moment=require(_0xcbc5('0x2'));var BPromise=require(_0xcbc5('0x3'));var rp=require(_0xcbc5('0x4'));var fs=require('fs');var path=require(_0xcbc5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcbc5('0x6'));module[_0xcbc5('0x7')]=function(_0x58b258,_0x1da78a){return _0x58b258['define'](_0xcbc5('0x8'),attributes,{'tableName':_0xcbc5('0x9'),'paranoid':![],'indexes':[{'name':_0xcbc5('0xa'),'fields':[_0xcbc5('0xb'),_0xcbc5('0xc')],'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 0e55ee8..2e2a191 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 _0xdd51=['jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x11ebd2,_0x57582b){var _0x57ba34=function(_0xeb5185){while(--_0xeb5185){_0x11ebd2['push'](_0x11ebd2['shift']());}};_0x57ba34(++_0x57582b);}(_0xdd51,0x1da));var _0x1dd5=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xdd51[_0x411add];return _0x238242;};'use strict';var _=require('lodash');var util=require(_0x1dd5('0x0'));var moment=require(_0x1dd5('0x1'));var BPromise=require(_0x1dd5('0x2'));var rs=require(_0x1dd5('0x3'));var fs=require('fs');var Redis=require(_0x1dd5('0x4'));var db=require(_0x1dd5('0x5'))['db'];var utils=require(_0x1dd5('0x6'));var logger=require('../../config/logger')(_0x1dd5('0x7'));var config=require(_0x1dd5('0x8'));var jayson=require(_0x1dd5('0x9'));var client=jayson[_0x1dd5('0xa')][_0x1dd5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x371cf0,_0xbd1510,_0x2c5d48){return new BPromise(function(_0x4996ef,_0x140300){return client[_0x1dd5('0xc')](_0x371cf0,_0x2c5d48)[_0x1dd5('0xd')](function(_0x18cf29){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0xbd1510,_0x1dd5('0xe'));logger[_0x1dd5('0xf')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0xbd1510,_0x1dd5('0xe'),JSON[_0x1dd5('0x10')](_0x18cf29));if(_0x18cf29[_0x1dd5('0x11')]){if(_0x18cf29[_0x1dd5('0x11')][_0x1dd5('0x12')]===0x1f4){logger[_0x1dd5('0x11')](_0x1dd5('0x13'),_0xbd1510,_0x18cf29['error']['message']);return _0x140300(_0x18cf29[_0x1dd5('0x11')][_0x1dd5('0x14')]);}logger[_0x1dd5('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0xbd1510,_0x18cf29[_0x1dd5('0x11')]['message']);return _0x4996ef(_0x18cf29[_0x1dd5('0x11')][_0x1dd5('0x14')]);}else{logger['info'](_0x1dd5('0x13'),_0xbd1510,_0x1dd5('0xe'));_0x4996ef(_0x18cf29[_0x1dd5('0x15')]['message']);}})[_0x1dd5('0x16')](function(_0x48ec81){logger[_0x1dd5('0x11')](_0x1dd5('0x13'),_0xbd1510,_0x48ec81);_0x140300(_0x48ec81);});});} \ No newline at end of file +var _0x3a30=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4b04f9,_0x109d55){var _0x421410=function(_0x23206f){while(--_0x23206f){_0x4b04f9['push'](_0x4b04f9['shift']());}};_0x421410(++_0x109d55);}(_0x3a30,0x1ba));var _0x03a3=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3a30[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x03a3('0x0'));var util=require(_0x03a3('0x1'));var moment=require(_0x03a3('0x2'));var BPromise=require(_0x03a3('0x3'));var rs=require(_0x03a3('0x4'));var fs=require('fs');var Redis=require(_0x03a3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x03a3('0x6'))(_0x03a3('0x7'));var config=require(_0x03a3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x03a3('0x9')][_0x03a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x387416,_0x1cd41d,_0x58d8a8){return new BPromise(function(_0x26d117,_0x19ae59){return client[_0x03a3('0xb')](_0x387416,_0x58d8a8)[_0x03a3('0xc')](function(_0x40293e){logger['info'](_0x03a3('0xd'),_0x1cd41d,_0x03a3('0xe'));logger[_0x03a3('0xf')](_0x03a3('0x10'),_0x1cd41d,_0x03a3('0xe'),JSON[_0x03a3('0x11')](_0x40293e));if(_0x40293e[_0x03a3('0x12')]){if(_0x40293e[_0x03a3('0x12')][_0x03a3('0x13')]===0x1f4){logger[_0x03a3('0x12')](_0x03a3('0xd'),_0x1cd41d,_0x40293e[_0x03a3('0x12')][_0x03a3('0x14')]);return _0x19ae59(_0x40293e[_0x03a3('0x12')][_0x03a3('0x14')]);}logger[_0x03a3('0x12')](_0x03a3('0xd'),_0x1cd41d,_0x40293e[_0x03a3('0x12')]['message']);return _0x26d117(_0x40293e['error'][_0x03a3('0x14')]);}else{logger[_0x03a3('0x15')](_0x03a3('0xd'),_0x1cd41d,_0x03a3('0xe'));_0x26d117(_0x40293e[_0x03a3('0x16')][_0x03a3('0x14')]);}})['catch'](function(_0x2d694e){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x1cd41d,_0x2d694e);_0x19ae59(_0x2d694e);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 2e0211b..cd944d8 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 _0x22b7=['get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','/:id'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x22b7,0xd0));var _0x722b=function(_0x2db055,_0x5bde11){_0x2db055=_0x2db055-0x0;var _0xb2f3a4=_0x22b7[_0x2db055];return _0xb2f3a4;};'use strict';var multer=require(_0x722b('0x0'));var util=require(_0x722b('0x1'));var path=require('path');var timeout=require(_0x722b('0x2'));var express=require(_0x722b('0x3'));var router=express[_0x722b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x722b('0x5'));var interaction=require(_0x722b('0x6'));var config=require(_0x722b('0x7'));var controller=require(_0x722b('0x8'));router['get']('/',auth[_0x722b('0x9')](),controller[_0x722b('0xa')]);router['get'](_0x722b('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x722b('0xc')](_0x722b('0xd'),auth[_0x722b('0x9')](),controller[_0x722b('0xe')]);router[_0x722b('0xc')](_0x722b('0xf'),auth[_0x722b('0x9')](),controller[_0x722b('0x10')]);router[_0x722b('0x11')]('/',auth[_0x722b('0x9')](),controller[_0x722b('0x12')]);router[_0x722b('0x11')](_0x722b('0xd'),auth['isAuthenticated'](),controller[_0x722b('0x13')]);router['put'](_0x722b('0xb'),auth[_0x722b('0x9')](),controller['update']);router['delete'](_0x722b('0xb'),auth[_0x722b('0x9')](),controller[_0x722b('0x14')]);module[_0x722b('0x15')]=router; \ No newline at end of file +var _0x5f16=['index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated'];(function(_0x3f12aa,_0x3cf300){var _0x5ca585=function(_0x452fc9){while(--_0x452fc9){_0x3f12aa['push'](_0x3f12aa['shift']());}};_0x5ca585(++_0x3cf300);}(_0x5f16,0x1ea));var _0x65f1=function(_0x4cc10d,_0x2c3519){_0x4cc10d=_0x4cc10d-0x0;var _0x3cf523=_0x5f16[_0x4cc10d];return _0x3cf523;};'use strict';var multer=require('multer');var util=require(_0x65f1('0x0'));var path=require(_0x65f1('0x1'));var timeout=require(_0x65f1('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x65f1('0x3'));var auth=require(_0x65f1('0x4'));var interaction=require(_0x65f1('0x5'));var config=require(_0x65f1('0x6'));var controller=require(_0x65f1('0x7'));router[_0x65f1('0x8')]('/',auth[_0x65f1('0x9')](),controller[_0x65f1('0xa')]);router[_0x65f1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x65f1('0xb')]);router[_0x65f1('0x8')](_0x65f1('0xc'),auth[_0x65f1('0x9')](),controller[_0x65f1('0xd')]);router[_0x65f1('0x8')](_0x65f1('0xe'),auth[_0x65f1('0x9')](),controller[_0x65f1('0xf')]);router[_0x65f1('0x10')]('/',auth['isAuthenticated'](),controller[_0x65f1('0x11')]);router['post'](_0x65f1('0xc'),auth['isAuthenticated'](),controller[_0x65f1('0x12')]);router[_0x65f1('0x13')](_0x65f1('0x14'),auth['isAuthenticated'](),controller[_0x65f1('0x15')]);router[_0x65f1('0x16')](_0x65f1('0x14'),auth[_0x65f1('0x9')](),controller[_0x65f1('0x17')]);module[_0x65f1('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 8d19a6e..07bbb39 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 _0xda2d=['exports','STRING','username'];(function(_0x5a16d4,_0x59f79a){var _0xf55351=function(_0x47c99d){while(--_0x47c99d){_0x5a16d4['push'](_0x5a16d4['shift']());}};_0xf55351(++_0x59f79a);}(_0xda2d,0x102));var _0xdda2=function(_0x2feb4f,_0x413102){_0x2feb4f=_0x2feb4f-0x0;var _0x2f1ec8=_0xda2d[_0x2feb4f];return _0x2f1ec8;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'name':{'type':Sequelize[_0xdda2('0x1')]},'description':{'type':Sequelize[_0xdda2('0x1')]},'username':{'type':Sequelize[_0xdda2('0x1')],'unique':_0xdda2('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xdda2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x9536=['username','remoteUri','sequelize','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9536,0x179));var _0x6953=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0x9536[_0x38af48];return _0x445384;};'use strict';var Sequelize=require(_0x6953('0x0'));module[_0x6953('0x1')]={'name':{'type':Sequelize[_0x6953('0x2')]},'description':{'type':Sequelize[_0x6953('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6953('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6953('0x2')],'unique':_0x6953('0x4')},'serverUrl':{'type':Sequelize[_0x6953('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 9d5e3c1..90e66ff 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 _0x0901=['limit','count','set','apply','reject','save','then','error','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','destroy','getConfigurations','length','order','addConfiguration','findOne','AccountId','Subjects','channel','getDescriptions','FreshdeskConfiguration','FreshdeskField','Descriptions','getFields','apiKey','remoteUri','slice','substring','lastIndexOf','%s/%s','api/v2/ticket_fields','format','%s:X','base64','requester','agent','description','group','source','ticket_type','company','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x0901,0x134));var _0x1090=function(_0x5d2042,_0x6bd091){_0x5d2042=_0x5d2042-0x0;var _0x41be99=_0x0901[_0x5d2042];return _0x41be99;};'use strict';var emlformat=require(_0x1090('0x0'));var rimraf=require(_0x1090('0x1'));var zipdir=require(_0x1090('0x2'));var jsonpatch=require(_0x1090('0x3'));var rp=require(_0x1090('0x4'));var moment=require(_0x1090('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1090('0x6'));var path=require(_0x1090('0x7'));var sox=require(_0x1090('0x8'));var csv=require(_0x1090('0x9'));var ejs=require(_0x1090('0xa'));var fs=require('fs');var fs_extra=require(_0x1090('0xb'));var _=require('lodash');var squel=require(_0x1090('0xc'));var crypto=require(_0x1090('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1090('0xe'));var toCsv=require(_0x1090('0x9'));var querystring=require(_0x1090('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1090('0x10'));var as=require(_0x1090('0x11'));var hardwareService=require(_0x1090('0x12'));var logger=require('../../config/logger')(_0x1090('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1090('0x14'));var db=require(_0x1090('0x15'))['db'];var integrations=require(_0x1090('0x16'));function respondWithStatusCode(_0x2c0afa,_0x4250c6){_0x4250c6=_0x4250c6||0xcc;return function(_0x793497){if(_0x793497){return _0x2c0afa[_0x1090('0x17')](_0x4250c6);}return _0x2c0afa[_0x1090('0x18')](_0x4250c6)[_0x1090('0x19')]();};}function respondWithResult(_0x897055,_0x477a41){_0x477a41=_0x477a41||0xc8;return function(_0x43317a){if(_0x43317a){return _0x897055[_0x1090('0x18')](_0x477a41)['json'](_0x43317a);}};}function respondWithFilteredResult(_0x465cbd,_0x28a09a){return function(_0x14e6dc){if(_0x14e6dc){var _0x56d312=typeof _0x28a09a[_0x1090('0x1a')]===_0x1090('0x1b')&&typeof _0x28a09a[_0x1090('0x1c')]===_0x1090('0x1b');var _0x365975=_0x14e6dc['count'];var _0x3db4bb=_0x56d312?0x0:_0x28a09a[_0x1090('0x1a')];var _0xf77749=_0x56d312?_0x14e6dc[_0x1090('0x1d')]:_0x28a09a[_0x1090('0x1a')]+_0x28a09a[_0x1090('0x1c')];var _0x3ed180;if(_0xf77749>=_0x365975){_0xf77749=_0x365975;_0x3ed180=0xc8;}else{_0x3ed180=0xce;}_0x465cbd[_0x1090('0x18')](_0x3ed180);return _0x465cbd[_0x1090('0x1e')]('Content-Range',_0x3db4bb+'-'+_0xf77749+'/'+_0x365975)['json'](_0x14e6dc);}return null;};}function patchUpdates(_0x8df216){return function(_0x51514c){try{jsonpatch[_0x1090('0x1f')](_0x51514c,_0x8df216,!![]);}catch(_0x28502a){return BPromise[_0x1090('0x20')](_0x28502a);}return _0x51514c[_0x1090('0x21')]();};}function saveUpdates(_0x211b39,_0x29633c){return function(_0x2f04da){if(_0x2f04da){return _0x2f04da['update'](_0x211b39)['then'](function(_0x4c7434){return _0x4c7434;});}return null;};}function removeEntity(_0x48b5c0,_0x4d187a){return function(_0x53d6c1){if(_0x53d6c1){return _0x53d6c1['destroy']()[_0x1090('0x22')](function(){_0x48b5c0[_0x1090('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3face7,_0x50267d){return function(_0x12ee12){if(!_0x12ee12){_0x3face7[_0x1090('0x17')](0x194);}return _0x12ee12;};}function handleError(_0x3a2123,_0x5e2859){_0x5e2859=_0x5e2859||0x1f4;return function(_0x5d0e70){logger[_0x1090('0x23')](_0x5d0e70['stack']);if(_0x5d0e70[_0x1090('0x24')]){delete _0x5d0e70['name'];}_0x3a2123[_0x1090('0x18')](_0x5e2859)[_0x1090('0x25')](_0x5d0e70);};}exports[_0x1090('0x26')]=function(_0x3b7f54,_0x257645){var _0x5bd6ab={},_0x23f8a2={},_0x19fcdb={'count':0x0,'rows':[]};var _0x1d6d1e=_[_0x1090('0x27')](db[_0x1090('0x28')][_0x1090('0x29')],function(_0x312e27){return{'name':_0x312e27[_0x1090('0x2a')],'type':_0x312e27[_0x1090('0x2b')][_0x1090('0x2c')]};});_0x23f8a2['model']=_['map'](_0x1d6d1e,_0x1090('0x24'));_0x23f8a2[_0x1090('0x2d')]=_[_0x1090('0x2e')](_0x3b7f54['query']);_0x23f8a2[_0x1090('0x2f')]=_[_0x1090('0x30')](_0x23f8a2[_0x1090('0x31')],_0x23f8a2[_0x1090('0x2d')]);_0x5bd6ab[_0x1090('0x32')]=_['intersection'](_0x23f8a2[_0x1090('0x31')],qs[_0x1090('0x33')](_0x3b7f54[_0x1090('0x2d')][_0x1090('0x33')]));_0x5bd6ab[_0x1090('0x32')]=_0x5bd6ab[_0x1090('0x32')]['length']?_0x5bd6ab[_0x1090('0x32')]:_0x23f8a2['model'];if(!_0x3b7f54[_0x1090('0x2d')][_0x1090('0x34')](_0x1090('0x35'))){_0x5bd6ab[_0x1090('0x1c')]=qs['limit'](_0x3b7f54[_0x1090('0x2d')][_0x1090('0x1c')]);_0x5bd6ab[_0x1090('0x1a')]=qs['offset'](_0x3b7f54['query'][_0x1090('0x1a')]);}_0x5bd6ab['order']=qs[_0x1090('0x36')](_0x3b7f54['query'][_0x1090('0x36')]);_0x5bd6ab['where']=qs[_0x1090('0x2f')](_[_0x1090('0x37')](_0x3b7f54['query'],_0x23f8a2[_0x1090('0x2f')]),_0x1d6d1e);if(_0x3b7f54[_0x1090('0x2d')][_0x1090('0x38')]){_0x5bd6ab[_0x1090('0x39')]=_[_0x1090('0x3a')](_0x5bd6ab[_0x1090('0x39')],{'$or':_[_0x1090('0x27')](_0x1d6d1e,function(_0x3e96c1){if(_0x3e96c1[_0x1090('0x2b')]!==_0x1090('0x3b')){var _0x19d96b={};_0x19d96b[_0x3e96c1['name']]={'$like':'%'+_0x3b7f54[_0x1090('0x2d')][_0x1090('0x38')]+'%'};return _0x19d96b;}})});}_0x5bd6ab=_[_0x1090('0x3a')]({},_0x5bd6ab,_0x3b7f54[_0x1090('0x3c')]);var _0x21b0c8={'where':_0x5bd6ab[_0x1090('0x39')]};return db['FreshdeskAccount']['count'](_0x21b0c8)[_0x1090('0x22')](function(_0xb4323e){_0x19fcdb[_0x1090('0x1d')]=_0xb4323e;if(_0x3b7f54[_0x1090('0x2d')][_0x1090('0x3d')]){_0x5bd6ab[_0x1090('0x3e')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x1090('0x3f')](_0x5bd6ab);})[_0x1090('0x22')](function(_0x25de72){_0x19fcdb[_0x1090('0x40')]=_0x25de72;return _0x19fcdb;})[_0x1090('0x22')](respondWithFilteredResult(_0x257645,_0x5bd6ab))[_0x1090('0x41')](handleError(_0x257645,null));};exports[_0x1090('0x42')]=function(_0x1a7ef4,_0xe5273a){var _0x56876c={'raw':![],'where':{'id':_0x1a7ef4[_0x1090('0x43')]['id']}},_0x221720={};_0x221720['model']=_[_0x1090('0x2e')](db[_0x1090('0x28')][_0x1090('0x29')]);_0x221720[_0x1090('0x2d')]=_[_0x1090('0x2e')](_0x1a7ef4['query']);_0x221720[_0x1090('0x2f')]=_[_0x1090('0x30')](_0x221720[_0x1090('0x31')],_0x221720[_0x1090('0x2d')]);_0x56876c[_0x1090('0x32')]=_['intersection'](_0x221720[_0x1090('0x31')],qs[_0x1090('0x33')](_0x1a7ef4[_0x1090('0x2d')]['fields']));_0x56876c['attributes']=_0x56876c[_0x1090('0x32')]['length']?_0x56876c[_0x1090('0x32')]:_0x221720[_0x1090('0x31')];if(_0x1a7ef4[_0x1090('0x2d')]['includeAll']){_0x56876c['include']=[{'all':!![]}];}_0x56876c=_[_0x1090('0x3a')]({},_0x56876c,_0x1a7ef4[_0x1090('0x3c')]);return db['FreshdeskAccount'][_0x1090('0x44')](_0x56876c)[_0x1090('0x22')](handleEntityNotFound(_0xe5273a,null))['then'](respondWithResult(_0xe5273a,null))[_0x1090('0x41')](handleError(_0xe5273a,null));};exports[_0x1090('0x45')]=function(_0x38622e,_0x11d861){return db[_0x1090('0x28')]['create'](_0x38622e['body'],{})[_0x1090('0x22')](respondWithResult(_0x11d861,0xc9))['catch'](handleError(_0x11d861,null));};exports[_0x1090('0x46')]=function(_0x1e45a9,_0x8171eb){if(_0x1e45a9['body']['id']){delete _0x1e45a9[_0x1090('0x47')]['id'];}return db[_0x1090('0x28')][_0x1090('0x44')]({'where':{'id':_0x1e45a9[_0x1090('0x43')]['id']}})[_0x1090('0x22')](handleEntityNotFound(_0x8171eb,null))[_0x1090('0x22')](saveUpdates(_0x1e45a9[_0x1090('0x47')],null))[_0x1090('0x22')](respondWithResult(_0x8171eb,null))[_0x1090('0x41')](handleError(_0x8171eb,null));};exports[_0x1090('0x48')]=function(_0x36c2dd,_0x419b22){return db[_0x1090('0x28')][_0x1090('0x44')]({'where':{'id':_0x36c2dd['params']['id']}})[_0x1090('0x22')](handleEntityNotFound(_0x419b22,null))[_0x1090('0x22')](removeEntity(_0x419b22,null))['catch'](handleError(_0x419b22,null));};exports[_0x1090('0x49')]=function(_0x4d0b43,_0x1ab946,_0x1a94bd){var _0x4bb3e9={};var _0x30a7c7={};var _0xf82aa5;var _0x540e20;return db[_0x1090('0x28')]['findOne']({'where':{'id':_0x4d0b43['params']['id']}})[_0x1090('0x22')](handleEntityNotFound(_0x1ab946,null))[_0x1090('0x22')](function(_0x3187b9){if(_0x3187b9){_0xf82aa5=_0x3187b9;_0x30a7c7[_0x1090('0x31')]=_[_0x1090('0x2e')](db['FreshdeskConfiguration']['rawAttributes']);_0x30a7c7[_0x1090('0x2d')]=_[_0x1090('0x2e')](_0x4d0b43[_0x1090('0x2d')]);_0x30a7c7[_0x1090('0x2f')]=_['intersection'](_0x30a7c7['model'],_0x30a7c7[_0x1090('0x2d')]);_0x4bb3e9['attributes']=_['intersection'](_0x30a7c7[_0x1090('0x31')],qs[_0x1090('0x33')](_0x4d0b43[_0x1090('0x2d')][_0x1090('0x33')]));_0x4bb3e9[_0x1090('0x32')]=_0x4bb3e9[_0x1090('0x32')][_0x1090('0x4a')]?_0x4bb3e9[_0x1090('0x32')]:_0x30a7c7[_0x1090('0x31')];_0x4bb3e9[_0x1090('0x4b')]=qs[_0x1090('0x36')](_0x4d0b43[_0x1090('0x2d')]['sort']);_0x4bb3e9[_0x1090('0x39')]=qs[_0x1090('0x2f')](_[_0x1090('0x37')](_0x4d0b43[_0x1090('0x2d')],_0x30a7c7[_0x1090('0x2f')]));if(_0x4d0b43[_0x1090('0x2d')][_0x1090('0x38')]){_0x4bb3e9['where']=_[_0x1090('0x3a')](_0x4bb3e9[_0x1090('0x39')],{'$or':_[_0x1090('0x27')](_0x4bb3e9['attributes'],function(_0x16fa9f){var _0x30b912={};_0x30b912[_0x16fa9f]={'$like':'%'+_0x4d0b43[_0x1090('0x2d')][_0x1090('0x38')]+'%'};return _0x30b912;})});}_0x4bb3e9=_['merge']({},_0x4bb3e9,_0x4d0b43[_0x1090('0x3c')]);return _0xf82aa5[_0x1090('0x49')](_0x4bb3e9);}})['then'](function(_0xfd7c03){if(_0xfd7c03){_0x540e20=_0xfd7c03[_0x1090('0x4a')];if(!_0x4d0b43[_0x1090('0x2d')][_0x1090('0x34')](_0x1090('0x35'))){_0x4bb3e9[_0x1090('0x1c')]=qs[_0x1090('0x1c')](_0x4d0b43[_0x1090('0x2d')][_0x1090('0x1c')]);_0x4bb3e9[_0x1090('0x1a')]=qs[_0x1090('0x1a')](_0x4d0b43['query'][_0x1090('0x1a')]);}return _0xf82aa5[_0x1090('0x49')](_0x4bb3e9);}})[_0x1090('0x22')](function(_0x496cc0){if(_0x496cc0){return _0x496cc0?{'count':_0x540e20,'rows':_0x496cc0}:null;}})['then'](respondWithResult(_0x1ab946,null))[_0x1090('0x41')](handleError(_0x1ab946,null));};exports[_0x1090('0x4c')]=function(_0x31e628,_0x188d09,_0x3b9d9f){if(_0x31e628['body']['id']){delete _0x31e628[_0x1090('0x47')]['id'];}return db[_0x1090('0x28')][_0x1090('0x4d')]({'where':{'id':_0x31e628[_0x1090('0x43')]['id']}})[_0x1090('0x22')](handleEntityNotFound(_0x188d09,null))['then'](function(_0xc50fb7){if(_0xc50fb7){_0x31e628['body'][_0x1090('0x4e')]=_0xc50fb7['id'];_0x31e628[_0x1090('0x47')][_0x1090('0x4f')]=integrations['getSubjects'](_0x31e628['body'][_0x1090('0x50')],_0x31e628[_0x1090('0x47')]['type']);_0x31e628[_0x1090('0x47')]['Descriptions']=integrations[_0x1090('0x51')](_0x31e628[_0x1090('0x47')][_0x1090('0x50')],_0x31e628['body'][_0x1090('0x2b')]);return db[_0x1090('0x52')][_0x1090('0x45')](_0x31e628['body'],{'include':[{'model':db[_0x1090('0x53')],'as':_0x1090('0x4f')},{'model':db['FreshdeskField'],'as':_0x1090('0x54')}]});}return null;})[_0x1090('0x22')](respondWithResult(_0x188d09,null))['catch'](handleError(_0x188d09,null));};exports[_0x1090('0x55')]=function(_0x8f2332,_0x3b8060,_0x3ca0d4){var _0x54e6cb='';return db['FreshdeskAccount'][_0x1090('0x4d')]({'where':{'id':_0x8f2332[_0x1090('0x43')]['id']},'attributes':['id','remoteUri',_0x1090('0x56')]})[_0x1090('0x22')](handleEntityNotFound(_0x3b8060,null))['then'](function(_0x2abbd1){if(_0x2abbd1){_0x54e6cb=_0x2abbd1[_0x1090('0x57')];var _0x583e9c=_0x54e6cb[_0x1090('0x58')](-0x1);if(_0x583e9c==='/'){_0x54e6cb=_0x54e6cb[_0x1090('0x59')](0x0,_0x54e6cb[_0x1090('0x5a')](_0x583e9c));}return rp({'method':'GET','uri':util['format'](_0x1090('0x5b'),_0x54e6cb,_0x1090('0x5c')),'headers':{'Authorization':util[_0x1090('0x5d')]('Basic\x20%s',new Buffer(util[_0x1090('0x5d')](_0x1090('0x5e'),_0x2abbd1[_0x1090('0x56')]))['toString'](_0x1090('0x5f')))},'json':!![]});}})['then'](function(_0x565501){if(_0x565501){var _0x399adc=[_0x1090('0x60'),'subject',_0x1090('0x61'),_0x1090('0x62'),'status','priority',_0x1090('0x63'),_0x1090('0x64'),_0x1090('0x65'),_0x1090('0x63'),_0x1090('0x66')];_['remove'](_0x565501,function(_0x2073a4){return _0x399adc['includes'](_0x2073a4[_0x1090('0x24')])||!_0x2073a4[_0x1090('0x67')]&&_0x2073a4['type']!==_0x1090('0x68')&&_0x2073a4[_0x1090('0x2b')]!==_0x1090('0x69');});return{'count':_0x565501[_0x1090('0x4a')],'rows':_['map'](_0x565501,function(_0x20d013){return{'id':_0x20d013[_0x1090('0x24')],'name':_0x20d013[_0x1090('0x6a')],'custom':!_0x20d013[_0x1090('0x67')],'options':_0x20d013[_0x1090('0x6b')]?_[_0x1090('0x27')](_0x20d013[_0x1090('0x6b')],function(_0x119ebb){return{'name':_[_0x1090('0x6c')](_0x119ebb),'value':_0x119ebb};}):[]};})};}})[_0x1090('0x22')](respondWithResult(_0x3b8060,null))[_0x1090('0x41')](function(_0x24e4ea){var _0x39f0e0=_0x8f2332['query']['test']?0x1f4:_0x24e4ea[_0x1090('0x6d')]||0x1f4;logger['error'](_0x1090('0x6e'),_0x1090('0x55'),_0x39f0e0,JSON['stringify'](_0x24e4ea));delete _0x24e4ea[_0x1090('0x24')];if(_0x39f0e0===0x191){_0x39f0e0=0x190;}_0x3b8060[_0x1090('0x18')](_0x39f0e0)['send'](_0x8f2332[_0x1090('0x2d')][_0x1090('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0x24e4ea[_0x1090('0x6d')]}:_0x24e4ea);});}; \ No newline at end of file +var _0x6953=['getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','toString','base64','requester','subject','agent','group','source','company','remove','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','update','params','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','FreshdeskField','Descriptions'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6953,0x91));var _0x3695=function(_0x309c02,_0x4bf2d1){_0x309c02=_0x309c02-0x0;var _0x57c06c=_0x6953[_0x309c02];return _0x57c06c;};'use strict';var emlformat=require(_0x3695('0x0'));var rimraf=require(_0x3695('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3695('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3695('0x3'));var util=require(_0x3695('0x4'));var path=require(_0x3695('0x5'));var sox=require('sox');var csv=require(_0x3695('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3695('0x7'));var _=require(_0x3695('0x8'));var squel=require(_0x3695('0x9'));var crypto=require(_0x3695('0xa'));var jsforce=require(_0x3695('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3695('0x6'));var querystring=require('querystring');var Papa=require(_0x3695('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3695('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3695('0xe'));var logger=require(_0x3695('0xf'))(_0x3695('0x10'));var utils=require(_0x3695('0x11'));var config=require(_0x3695('0x12'));var licenseUtil=require(_0x3695('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3695('0x14'));function respondWithStatusCode(_0x345587,_0x212011){_0x212011=_0x212011||0xcc;return function(_0x44e42c){if(_0x44e42c){return _0x345587[_0x3695('0x15')](_0x212011);}return _0x345587[_0x3695('0x16')](_0x212011)[_0x3695('0x17')]();};}function respondWithResult(_0x4df429,_0x26dfc9){_0x26dfc9=_0x26dfc9||0xc8;return function(_0xc5dc5){if(_0xc5dc5){return _0x4df429[_0x3695('0x16')](_0x26dfc9)['json'](_0xc5dc5);}};}function respondWithFilteredResult(_0x3aa59d,_0x231c7d){return function(_0x2cdd3){if(_0x2cdd3){var _0x3cb320=typeof _0x231c7d[_0x3695('0x18')]===_0x3695('0x19')&&typeof _0x231c7d[_0x3695('0x1a')]==='undefined';var _0x717ee4=_0x2cdd3['count'];var _0x1082db=_0x3cb320?0x0:_0x231c7d[_0x3695('0x18')];var _0x1553ea=_0x3cb320?_0x2cdd3[_0x3695('0x1b')]:_0x231c7d[_0x3695('0x18')]+_0x231c7d['limit'];var _0x1bb921;if(_0x1553ea>=_0x717ee4){_0x1553ea=_0x717ee4;_0x1bb921=0xc8;}else{_0x1bb921=0xce;}_0x3aa59d[_0x3695('0x16')](_0x1bb921);return _0x3aa59d[_0x3695('0x1c')](_0x3695('0x1d'),_0x1082db+'-'+_0x1553ea+'/'+_0x717ee4)[_0x3695('0x1e')](_0x2cdd3);}return null;};}function patchUpdates(_0x1ebba8){return function(_0x34b0fc){try{jsonpatch[_0x3695('0x1f')](_0x34b0fc,_0x1ebba8,!![]);}catch(_0x1f267a){return BPromise[_0x3695('0x20')](_0x1f267a);}return _0x34b0fc[_0x3695('0x21')]();};}function saveUpdates(_0xf2c747,_0x459f33){return function(_0x30d713){if(_0x30d713){return _0x30d713['update'](_0xf2c747)[_0x3695('0x22')](function(_0xdb0934){return _0xdb0934;});}return null;};}function removeEntity(_0x4899c0,_0x4940e9){return function(_0x3ac6aa){if(_0x3ac6aa){return _0x3ac6aa[_0x3695('0x23')]()[_0x3695('0x22')](function(){_0x4899c0[_0x3695('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x180f77,_0x48c2fd){return function(_0xeddb06){if(!_0xeddb06){_0x180f77['sendStatus'](0x194);}return _0xeddb06;};}function handleError(_0xe085de,_0x5adea3){_0x5adea3=_0x5adea3||0x1f4;return function(_0x366d71){logger[_0x3695('0x24')](_0x366d71[_0x3695('0x25')]);if(_0x366d71[_0x3695('0x26')]){delete _0x366d71[_0x3695('0x26')];}_0xe085de[_0x3695('0x16')](_0x5adea3)['send'](_0x366d71);};}exports[_0x3695('0x27')]=function(_0x354ae0,_0x5f193c){var _0x392107={},_0x4d0742={},_0x39c39f={'count':0x0,'rows':[]};var _0x399bc6=_[_0x3695('0x28')](db[_0x3695('0x29')][_0x3695('0x2a')],function(_0x21f379){return{'name':_0x21f379[_0x3695('0x2b')],'type':_0x21f379[_0x3695('0x2c')]['key']};});_0x4d0742[_0x3695('0x2d')]=_[_0x3695('0x28')](_0x399bc6,_0x3695('0x26'));_0x4d0742['query']=_['keys'](_0x354ae0[_0x3695('0x2e')]);_0x4d0742['filters']=_[_0x3695('0x2f')](_0x4d0742[_0x3695('0x2d')],_0x4d0742['query']);_0x392107[_0x3695('0x30')]=_['intersection'](_0x4d0742[_0x3695('0x2d')],qs[_0x3695('0x31')](_0x354ae0[_0x3695('0x2e')][_0x3695('0x31')]));_0x392107[_0x3695('0x30')]=_0x392107[_0x3695('0x30')]['length']?_0x392107[_0x3695('0x30')]:_0x4d0742[_0x3695('0x2d')];if(!_0x354ae0['query'][_0x3695('0x32')](_0x3695('0x33'))){_0x392107['limit']=qs['limit'](_0x354ae0['query']['limit']);_0x392107[_0x3695('0x18')]=qs[_0x3695('0x18')](_0x354ae0['query'][_0x3695('0x18')]);}_0x392107[_0x3695('0x34')]=qs[_0x3695('0x35')](_0x354ae0[_0x3695('0x2e')]['sort']);_0x392107['where']=qs[_0x3695('0x36')](_[_0x3695('0x37')](_0x354ae0['query'],_0x4d0742[_0x3695('0x36')]),_0x399bc6);if(_0x354ae0[_0x3695('0x2e')][_0x3695('0x38')]){_0x392107[_0x3695('0x39')]=_[_0x3695('0x3a')](_0x392107[_0x3695('0x39')],{'$or':_[_0x3695('0x28')](_0x399bc6,function(_0x21a0b8){if(_0x21a0b8[_0x3695('0x2c')]!==_0x3695('0x3b')){var _0x460b49={};_0x460b49[_0x21a0b8[_0x3695('0x26')]]={'$like':'%'+_0x354ae0[_0x3695('0x2e')][_0x3695('0x38')]+'%'};return _0x460b49;}})});}_0x392107=_[_0x3695('0x3a')]({},_0x392107,_0x354ae0[_0x3695('0x3c')]);var _0x599a0c={'where':_0x392107[_0x3695('0x39')]};return db[_0x3695('0x29')][_0x3695('0x1b')](_0x599a0c)[_0x3695('0x22')](function(_0x3eba18){_0x39c39f[_0x3695('0x1b')]=_0x3eba18;if(_0x354ae0[_0x3695('0x2e')]['includeAll']){_0x392107[_0x3695('0x3d')]=[{'all':!![]}];}return db[_0x3695('0x29')][_0x3695('0x3e')](_0x392107);})['then'](function(_0x226db8){_0x39c39f[_0x3695('0x3f')]=_0x226db8;return _0x39c39f;})[_0x3695('0x22')](respondWithFilteredResult(_0x5f193c,_0x392107))[_0x3695('0x40')](handleError(_0x5f193c,null));};exports[_0x3695('0x41')]=function(_0x322923,_0x4261d1){var _0x5b825a={'raw':![],'where':{'id':_0x322923['params']['id']}},_0x1b56cc={};_0x1b56cc['model']=_[_0x3695('0x42')](db['FreshdeskAccount'][_0x3695('0x2a')]);_0x1b56cc[_0x3695('0x2e')]=_[_0x3695('0x42')](_0x322923[_0x3695('0x2e')]);_0x1b56cc['filters']=_[_0x3695('0x2f')](_0x1b56cc[_0x3695('0x2d')],_0x1b56cc[_0x3695('0x2e')]);_0x5b825a['attributes']=_[_0x3695('0x2f')](_0x1b56cc[_0x3695('0x2d')],qs[_0x3695('0x31')](_0x322923[_0x3695('0x2e')][_0x3695('0x31')]));_0x5b825a[_0x3695('0x30')]=_0x5b825a[_0x3695('0x30')][_0x3695('0x43')]?_0x5b825a[_0x3695('0x30')]:_0x1b56cc['model'];if(_0x322923['query'][_0x3695('0x44')]){_0x5b825a[_0x3695('0x3d')]=[{'all':!![]}];}_0x5b825a=_[_0x3695('0x3a')]({},_0x5b825a,_0x322923['options']);return db[_0x3695('0x29')][_0x3695('0x45')](_0x5b825a)[_0x3695('0x22')](handleEntityNotFound(_0x4261d1,null))['then'](respondWithResult(_0x4261d1,null))[_0x3695('0x40')](handleError(_0x4261d1,null));};exports[_0x3695('0x46')]=function(_0x3d6a61,_0x1abe89){return db[_0x3695('0x29')]['create'](_0x3d6a61[_0x3695('0x47')],{})[_0x3695('0x22')](respondWithResult(_0x1abe89,0xc9))[_0x3695('0x40')](handleError(_0x1abe89,null));};exports[_0x3695('0x48')]=function(_0x557619,_0xccc7b2){if(_0x557619['body']['id']){delete _0x557619['body']['id'];}return db[_0x3695('0x29')][_0x3695('0x45')]({'where':{'id':_0x557619[_0x3695('0x49')]['id']}})[_0x3695('0x22')](handleEntityNotFound(_0xccc7b2,null))[_0x3695('0x22')](saveUpdates(_0x557619['body'],null))['then'](respondWithResult(_0xccc7b2,null))['catch'](handleError(_0xccc7b2,null));};exports[_0x3695('0x23')]=function(_0x5eeaca,_0x4f5f1b){return db['FreshdeskAccount']['find']({'where':{'id':_0x5eeaca[_0x3695('0x49')]['id']}})[_0x3695('0x22')](handleEntityNotFound(_0x4f5f1b,null))['then'](removeEntity(_0x4f5f1b,null))[_0x3695('0x40')](handleError(_0x4f5f1b,null));};exports[_0x3695('0x4a')]=function(_0x567447,_0x4a0a78,_0x419ed6){var _0x2cf76d={};var _0x1a61d6={};var _0x56f7df;var _0x114423;return db[_0x3695('0x29')][_0x3695('0x4b')]({'where':{'id':_0x567447[_0x3695('0x49')]['id']}})[_0x3695('0x22')](handleEntityNotFound(_0x4a0a78,null))[_0x3695('0x22')](function(_0x3b5552){if(_0x3b5552){_0x56f7df=_0x3b5552;_0x1a61d6[_0x3695('0x2d')]=_[_0x3695('0x42')](db[_0x3695('0x4c')][_0x3695('0x2a')]);_0x1a61d6[_0x3695('0x2e')]=_[_0x3695('0x42')](_0x567447[_0x3695('0x2e')]);_0x1a61d6[_0x3695('0x36')]=_[_0x3695('0x2f')](_0x1a61d6[_0x3695('0x2d')],_0x1a61d6[_0x3695('0x2e')]);_0x2cf76d[_0x3695('0x30')]=_[_0x3695('0x2f')](_0x1a61d6[_0x3695('0x2d')],qs[_0x3695('0x31')](_0x567447[_0x3695('0x2e')]['fields']));_0x2cf76d['attributes']=_0x2cf76d[_0x3695('0x30')][_0x3695('0x43')]?_0x2cf76d['attributes']:_0x1a61d6[_0x3695('0x2d')];_0x2cf76d[_0x3695('0x34')]=qs[_0x3695('0x35')](_0x567447[_0x3695('0x2e')][_0x3695('0x35')]);_0x2cf76d[_0x3695('0x39')]=qs[_0x3695('0x36')](_[_0x3695('0x37')](_0x567447[_0x3695('0x2e')],_0x1a61d6[_0x3695('0x36')]));if(_0x567447['query'][_0x3695('0x38')]){_0x2cf76d[_0x3695('0x39')]=_[_0x3695('0x3a')](_0x2cf76d[_0x3695('0x39')],{'$or':_[_0x3695('0x28')](_0x2cf76d['attributes'],function(_0xb0b073){var _0x1384c2={};_0x1384c2[_0xb0b073]={'$like':'%'+_0x567447[_0x3695('0x2e')]['filter']+'%'};return _0x1384c2;})});}_0x2cf76d=_[_0x3695('0x3a')]({},_0x2cf76d,_0x567447[_0x3695('0x3c')]);return _0x56f7df['getConfigurations'](_0x2cf76d);}})['then'](function(_0x241027){if(_0x241027){_0x114423=_0x241027['length'];if(!_0x567447['query'][_0x3695('0x32')](_0x3695('0x33'))){_0x2cf76d[_0x3695('0x1a')]=qs[_0x3695('0x1a')](_0x567447[_0x3695('0x2e')]['limit']);_0x2cf76d[_0x3695('0x18')]=qs[_0x3695('0x18')](_0x567447[_0x3695('0x2e')]['offset']);}return _0x56f7df[_0x3695('0x4a')](_0x2cf76d);}})[_0x3695('0x22')](function(_0x18c77f){if(_0x18c77f){return _0x18c77f?{'count':_0x114423,'rows':_0x18c77f}:null;}})[_0x3695('0x22')](respondWithResult(_0x4a0a78,null))[_0x3695('0x40')](handleError(_0x4a0a78,null));};exports[_0x3695('0x4d')]=function(_0x558e82,_0x1c6516,_0x3a67bc){if(_0x558e82[_0x3695('0x47')]['id']){delete _0x558e82[_0x3695('0x47')]['id'];}return db[_0x3695('0x29')]['findOne']({'where':{'id':_0x558e82[_0x3695('0x49')]['id']}})[_0x3695('0x22')](handleEntityNotFound(_0x1c6516,null))[_0x3695('0x22')](function(_0x188bdc){if(_0x188bdc){_0x558e82[_0x3695('0x47')][_0x3695('0x4e')]=_0x188bdc['id'];_0x558e82['body'][_0x3695('0x4f')]=integrations[_0x3695('0x50')](_0x558e82['body']['channel'],_0x558e82[_0x3695('0x47')][_0x3695('0x2c')]);_0x558e82[_0x3695('0x47')]['Descriptions']=integrations[_0x3695('0x51')](_0x558e82[_0x3695('0x47')][_0x3695('0x52')],_0x558e82[_0x3695('0x47')][_0x3695('0x2c')]);return db['FreshdeskConfiguration'][_0x3695('0x46')](_0x558e82['body'],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db[_0x3695('0x53')],'as':_0x3695('0x54')}]});}return null;})[_0x3695('0x22')](respondWithResult(_0x1c6516,null))[_0x3695('0x40')](handleError(_0x1c6516,null));};exports[_0x3695('0x55')]=function(_0x36777e,_0x3d7215,_0x3b0794){var _0x156031='';return db[_0x3695('0x29')][_0x3695('0x4b')]({'where':{'id':_0x36777e[_0x3695('0x49')]['id']},'attributes':['id',_0x3695('0x56'),_0x3695('0x57')]})[_0x3695('0x22')](handleEntityNotFound(_0x3d7215,null))[_0x3695('0x22')](function(_0x500234){if(_0x500234){_0x156031=_0x500234[_0x3695('0x56')];var _0x3610b2=_0x156031[_0x3695('0x58')](-0x1);if(_0x3610b2==='/'){_0x156031=_0x156031[_0x3695('0x59')](0x0,_0x156031[_0x3695('0x5a')](_0x3610b2));}return rp({'method':_0x3695('0x5b'),'uri':util['format'](_0x3695('0x5c'),_0x156031,_0x3695('0x5d')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x3695('0x5e')]('%s:X',_0x500234[_0x3695('0x57')]))[_0x3695('0x5f')](_0x3695('0x60')))},'json':!![]});}})[_0x3695('0x22')](function(_0x75339d){if(_0x75339d){var _0x57c6f3=[_0x3695('0x61'),_0x3695('0x62'),_0x3695('0x63'),'description','status','priority',_0x3695('0x64'),_0x3695('0x65'),'ticket_type',_0x3695('0x64'),_0x3695('0x66')];_[_0x3695('0x67')](_0x75339d,function(_0x27852b){return _0x57c6f3[_0x3695('0x68')](_0x27852b[_0x3695('0x26')])||!_0x27852b[_0x3695('0x69')]&&_0x27852b[_0x3695('0x2c')]!=='custom_text'&&_0x27852b[_0x3695('0x2c')]!==_0x3695('0x6a');});return{'count':_0x75339d[_0x3695('0x43')],'rows':_[_0x3695('0x28')](_0x75339d,function(_0xf4c7cf){return{'id':_0xf4c7cf[_0x3695('0x26')],'name':_0xf4c7cf[_0x3695('0x6b')],'custom':!_0xf4c7cf[_0x3695('0x69')],'options':_0xf4c7cf['choices']?_[_0x3695('0x28')](_0xf4c7cf[_0x3695('0x6c')],function(_0x1d5430){return{'name':_[_0x3695('0x6d')](_0x1d5430),'value':_0x1d5430};}):[]};})};}})[_0x3695('0x22')](respondWithResult(_0x3d7215,null))[_0x3695('0x40')](function(_0x3fa4b0){var _0x2ab830=_0x36777e[_0x3695('0x2e')][_0x3695('0x6e')]?0x1f4:_0x3fa4b0[_0x3695('0x6f')]||0x1f4;logger[_0x3695('0x24')](_0x3695('0x70'),'getFields',_0x2ab830,JSON['stringify'](_0x3fa4b0));delete _0x3fa4b0[_0x3695('0x26')];if(_0x2ab830===0x191){_0x2ab830=0x190;}_0x3d7215[_0x3695('0x16')](_0x2ab830)[_0x3695('0x71')](_0x36777e['query'][_0x3695('0x6e')]?{'message':_0x3695('0x72'),'statusCode':_0x3fa4b0[_0x3695('0x6f')]}:_0x3fa4b0);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 137179b..2a32d87 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 _0x668a=['moment','path','rimraf','../../components/integrations/configuration','exports','int_freshdesk_accounts','lodash','util','../../config/logger','api'];(function(_0x2b16b3,_0x1611a1){var _0x415632=function(_0x64039a){while(--_0x64039a){_0x2b16b3['push'](_0x2b16b3['shift']());}};_0x415632(++_0x1611a1);}(_0x668a,0x1be));var _0xa668=function(_0x2e0bf5,_0x24278f){_0x2e0bf5=_0x2e0bf5-0x0;var _0x5f24da=_0x668a[_0x2e0bf5];return _0x5f24da;};'use strict';var _=require(_0xa668('0x0'));var util=require(_0xa668('0x1'));var logger=require(_0xa668('0x2'))(_0xa668('0x3'));var moment=require(_0xa668('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa668('0x5'));var rimraf=require(_0xa668('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xa668('0x7'));module[_0xa668('0x8')]=function(_0x59643b,_0x493364){return _0x59643b['define']('FreshdeskAccount',attributes,{'tableName':_0xa668('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ea1=['request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','moment','bluebird'];(function(_0x1e440c,_0x3b2ca5){var _0x3cfab5=function(_0x905734){while(--_0x905734){_0x1e440c['push'](_0x1e440c['shift']());}};_0x3cfab5(++_0x3b2ca5);}(_0x4ea1,0xb2));var _0x14ea=function(_0x1ffaec,_0x5a40d4){_0x1ffaec=_0x1ffaec-0x0;var _0x4375c6=_0x4ea1[_0x1ffaec];return _0x4375c6;};'use strict';var _=require('lodash');var util=require(_0x14ea('0x0'));var logger=require(_0x14ea('0x1'))('api');var moment=require(_0x14ea('0x2'));var BPromise=require(_0x14ea('0x3'));var rp=require(_0x14ea('0x4'));var fs=require('fs');var path=require(_0x14ea('0x5'));var rimraf=require(_0x14ea('0x6'));var config=require(_0x14ea('0x7'));var attributes=require(_0x14ea('0x8'));var integrations=require(_0x14ea('0x9'));module[_0x14ea('0xa')]=function(_0x24bdea,_0x90c010){return _0x24bdea[_0x14ea('0xb')](_0x14ea('0xc'),attributes,{'tableName':_0x14ea('0xd'),'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 720eb9b..c767352 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 _0x0be7=['client','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','attributes','limit','include','map','model','ShowFreshdeskAccount','find','raw','where','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x0be7,0xc4));var _0x70be=function(_0xcbfe09,_0x1777bf){_0xcbfe09=_0xcbfe09-0x0;var _0x3d59e3=_0x0be7[_0xcbfe09];return _0x3d59e3;};'use strict';var _=require('lodash');var util=require(_0x70be('0x0'));var moment=require('moment');var BPromise=require(_0x70be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70be('0x2'));var db=require(_0x70be('0x3'))['db'];var utils=require(_0x70be('0x4'));var logger=require(_0x70be('0x5'))(_0x70be('0x6'));var config=require(_0x70be('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x70be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe8b00,_0x5a8b51,_0x352f03){return new BPromise(function(_0x23373d,_0x11aa1a){return client[_0x70be('0x9')](_0xe8b00,_0x352f03)[_0x70be('0xa')](function(_0x5940c2){logger['info'](_0x70be('0xb'),_0x5a8b51,_0x70be('0xc'));logger[_0x70be('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x5a8b51,_0x70be('0xc'),JSON[_0x70be('0xe')](_0x5940c2));if(_0x5940c2[_0x70be('0xf')]){if(_0x5940c2['error'][_0x70be('0x10')]===0x1f4){logger[_0x70be('0xf')](_0x70be('0xb'),_0x5a8b51,_0x5940c2[_0x70be('0xf')][_0x70be('0x11')]);return _0x11aa1a(_0x5940c2[_0x70be('0xf')][_0x70be('0x11')]);}logger[_0x70be('0xf')](_0x70be('0xb'),_0x5a8b51,_0x5940c2[_0x70be('0xf')][_0x70be('0x11')]);return _0x23373d(_0x5940c2[_0x70be('0xf')][_0x70be('0x11')]);}else{logger[_0x70be('0x12')](_0x70be('0xb'),_0x5a8b51,'request\x20sent');_0x23373d(_0x5940c2[_0x70be('0x13')][_0x70be('0x11')]);}})[_0x70be('0x14')](function(_0x56e261){logger['error'](_0x70be('0xb'),_0x5a8b51,_0x56e261);_0x11aa1a(_0x56e261);});});}exports[_0x70be('0x15')]=function(_0x4bf04d){var _0x281650=this;return new Promise(function(_0xfdafd3,_0x2cc69f){return db[_0x70be('0x16')][_0x70be('0x17')]({'raw':_0x4bf04d[_0x70be('0x18')]?_0x4bf04d['options']['raw']===undefined?!![]:![]:!![],'where':_0x4bf04d[_0x70be('0x18')]?_0x4bf04d[_0x70be('0x18')]['where']||null:null,'attributes':_0x4bf04d[_0x70be('0x18')]?_0x4bf04d['options'][_0x70be('0x19')]||null:null,'limit':_0x4bf04d[_0x70be('0x18')]?_0x4bf04d[_0x70be('0x18')][_0x70be('0x1a')]||null:null,'include':_0x4bf04d[_0x70be('0x18')]?_0x4bf04d[_0x70be('0x18')][_0x70be('0x1b')]?_[_0x70be('0x1c')](_0x4bf04d[_0x70be('0x18')][_0x70be('0x1b')],function(_0x489036){return{'model':db[_0x489036[_0x70be('0x1d')]],'as':_0x489036['as'],'attributes':_0x489036[_0x70be('0x19')],'include':_0x489036['include']?_[_0x70be('0x1c')](_0x489036[_0x70be('0x1b')],function(_0x381ffe){return{'model':db[_0x381ffe['model']],'as':_0x381ffe['as'],'attributes':_0x381ffe[_0x70be('0x19')],'include':_0x381ffe['include']?_[_0x70be('0x1c')](_0x381ffe[_0x70be('0x1b')],function(_0x35fe7f){return{'model':db[_0x35fe7f[_0x70be('0x1d')]],'as':_0x35fe7f['as'],'attributes':_0x35fe7f[_0x70be('0x19')]};}):[]};}):[]};}):[]:[]})[_0x70be('0xa')](function(_0x3ee42a){logger['info'](_0x70be('0x15'),_0x4bf04d);logger[_0x70be('0xd')](_0x70be('0x15'),_0x4bf04d,JSON[_0x70be('0xe')](_0x3ee42a));_0xfdafd3(_0x3ee42a);})[_0x70be('0x14')](function(_0xbd9eba){logger['error'](_0x70be('0x15'),_0xbd9eba[_0x70be('0x11')],_0x4bf04d);_0x2cc69f(_0x281650[_0x70be('0xf')](0x1f4,_0xbd9eba['message']));});});};exports[_0x70be('0x1e')]=function(_0xada81d){var _0xf8ce91=this;return new Promise(function(_0x246c40,_0x3177b8){return db[_0x70be('0x16')][_0x70be('0x1f')]({'raw':_0xada81d[_0x70be('0x18')]?_0xada81d[_0x70be('0x18')][_0x70be('0x20')]===undefined?!![]:![]:!![],'where':_0xada81d[_0x70be('0x18')]?_0xada81d[_0x70be('0x18')][_0x70be('0x21')]||null:null,'attributes':_0xada81d[_0x70be('0x18')]?_0xada81d['options'][_0x70be('0x19')]||null:null,'include':_0xada81d[_0x70be('0x18')]?_0xada81d[_0x70be('0x18')]['include']?_[_0x70be('0x1c')](_0xada81d[_0x70be('0x18')][_0x70be('0x1b')],function(_0x1c4edb){return{'model':db[_0x1c4edb[_0x70be('0x1d')]],'as':_0x1c4edb['as'],'attributes':_0x1c4edb[_0x70be('0x19')],'include':_0x1c4edb[_0x70be('0x1b')]?_['map'](_0x1c4edb[_0x70be('0x1b')],function(_0x460fdf){return{'model':db[_0x460fdf[_0x70be('0x1d')]],'as':_0x460fdf['as'],'attributes':_0x460fdf[_0x70be('0x19')],'include':_0x460fdf['include']?_[_0x70be('0x1c')](_0x460fdf[_0x70be('0x1b')],function(_0x94e3e1){return{'model':db[_0x94e3e1[_0x70be('0x1d')]],'as':_0x94e3e1['as'],'attributes':_0x94e3e1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x14092f){logger[_0x70be('0x12')](_0x70be('0x1e'),_0xada81d);logger[_0x70be('0xd')]('ShowFreshdeskAccount',_0xada81d,JSON['stringify'](_0x14092f));_0x246c40(_0x14092f);})[_0x70be('0x14')](function(_0x39ebba){logger[_0x70be('0xf')](_0x70be('0x1e'),_0x39ebba['message'],_0xada81d);_0x3177b8(_0xf8ce91[_0x70be('0xf')](0x1f4,_0x39ebba['message']));});});}; \ No newline at end of file +var _0xbf5a=['FreshdeskAccount','options','raw','where','attributes','limit','include','map','GetFreshdeskAccount','ShowFreshdeskAccount','model','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x34d993,_0x3c7017){var _0x4728c7=function(_0x12f5ca){while(--_0x12f5ca){_0x34d993['push'](_0x34d993['shift']());}};_0x4728c7(++_0x3c7017);}(_0xbf5a,0x6e));var _0xabf5=function(_0x16eb48,_0x1188fd){_0x16eb48=_0x16eb48-0x0;var _0x11f739=_0xbf5a[_0x16eb48];return _0x11f739;};'use strict';var _=require(_0xabf5('0x0'));var util=require('util');var moment=require(_0xabf5('0x1'));var BPromise=require(_0xabf5('0x2'));var rs=require(_0xabf5('0x3'));var fs=require('fs');var Redis=require(_0xabf5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xabf5('0x5'));var logger=require(_0xabf5('0x6'))(_0xabf5('0x7'));var config=require(_0xabf5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xabf5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x400415,_0x20c7a0,_0x212ea3){return new BPromise(function(_0x27794d,_0x31f20f){return client['request'](_0x400415,_0x212ea3)[_0xabf5('0xa')](function(_0x423f71){logger['info'](_0xabf5('0xb'),_0x20c7a0,_0xabf5('0xc'));logger[_0xabf5('0xd')](_0xabf5('0xe'),_0x20c7a0,'request\x20sent',JSON[_0xabf5('0xf')](_0x423f71));if(_0x423f71[_0xabf5('0x10')]){if(_0x423f71[_0xabf5('0x10')][_0xabf5('0x11')]===0x1f4){logger[_0xabf5('0x10')](_0xabf5('0xb'),_0x20c7a0,_0x423f71[_0xabf5('0x10')][_0xabf5('0x12')]);return _0x31f20f(_0x423f71[_0xabf5('0x10')][_0xabf5('0x12')]);}logger[_0xabf5('0x10')](_0xabf5('0xb'),_0x20c7a0,_0x423f71[_0xabf5('0x10')][_0xabf5('0x12')]);return _0x27794d(_0x423f71[_0xabf5('0x10')]['message']);}else{logger[_0xabf5('0x13')](_0xabf5('0xb'),_0x20c7a0,_0xabf5('0xc'));_0x27794d(_0x423f71[_0xabf5('0x14')][_0xabf5('0x12')]);}})[_0xabf5('0x15')](function(_0x55da16){logger[_0xabf5('0x10')](_0xabf5('0xb'),_0x20c7a0,_0x55da16);_0x31f20f(_0x55da16);});});}exports['GetFreshdeskAccount']=function(_0x2fa504){var _0x2a8027=this;return new Promise(function(_0x285b69,_0xc1bc1a){return db[_0xabf5('0x16')]['findAll']({'raw':_0x2fa504[_0xabf5('0x17')]?_0x2fa504[_0xabf5('0x17')][_0xabf5('0x18')]===undefined?!![]:![]:!![],'where':_0x2fa504[_0xabf5('0x17')]?_0x2fa504[_0xabf5('0x17')][_0xabf5('0x19')]||null:null,'attributes':_0x2fa504[_0xabf5('0x17')]?_0x2fa504['options'][_0xabf5('0x1a')]||null:null,'limit':_0x2fa504[_0xabf5('0x17')]?_0x2fa504[_0xabf5('0x17')][_0xabf5('0x1b')]||null:null,'include':_0x2fa504[_0xabf5('0x17')]?_0x2fa504['options'][_0xabf5('0x1c')]?_[_0xabf5('0x1d')](_0x2fa504[_0xabf5('0x17')]['include'],function(_0x54dfb4){return{'model':db[_0x54dfb4['model']],'as':_0x54dfb4['as'],'attributes':_0x54dfb4[_0xabf5('0x1a')],'include':_0x54dfb4['include']?_['map'](_0x54dfb4[_0xabf5('0x1c')],function(_0xbb3d22){return{'model':db[_0xbb3d22['model']],'as':_0xbb3d22['as'],'attributes':_0xbb3d22['attributes'],'include':_0xbb3d22[_0xabf5('0x1c')]?_[_0xabf5('0x1d')](_0xbb3d22[_0xabf5('0x1c')],function(_0x39fa5a){return{'model':db[_0x39fa5a['model']],'as':_0x39fa5a['as'],'attributes':_0x39fa5a[_0xabf5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b587e){logger['info'](_0xabf5('0x1e'),_0x2fa504);logger[_0xabf5('0xd')](_0xabf5('0x1e'),_0x2fa504,JSON[_0xabf5('0xf')](_0x2b587e));_0x285b69(_0x2b587e);})[_0xabf5('0x15')](function(_0x390a2c){logger[_0xabf5('0x10')](_0xabf5('0x1e'),_0x390a2c['message'],_0x2fa504);_0xc1bc1a(_0x2a8027[_0xabf5('0x10')](0x1f4,_0x390a2c[_0xabf5('0x12')]));});});};exports[_0xabf5('0x1f')]=function(_0x2e78e8){var _0x4a113e=this;return new Promise(function(_0x937ef8,_0x1bf019){return db[_0xabf5('0x16')]['find']({'raw':_0x2e78e8[_0xabf5('0x17')]?_0x2e78e8[_0xabf5('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2e78e8[_0xabf5('0x17')]?_0x2e78e8['options'][_0xabf5('0x19')]||null:null,'attributes':_0x2e78e8['options']?_0x2e78e8['options'][_0xabf5('0x1a')]||null:null,'include':_0x2e78e8[_0xabf5('0x17')]?_0x2e78e8[_0xabf5('0x17')][_0xabf5('0x1c')]?_[_0xabf5('0x1d')](_0x2e78e8[_0xabf5('0x17')]['include'],function(_0x3c4425){return{'model':db[_0x3c4425[_0xabf5('0x20')]],'as':_0x3c4425['as'],'attributes':_0x3c4425[_0xabf5('0x1a')],'include':_0x3c4425[_0xabf5('0x1c')]?_[_0xabf5('0x1d')](_0x3c4425[_0xabf5('0x1c')],function(_0x338cb6){return{'model':db[_0x338cb6[_0xabf5('0x20')]],'as':_0x338cb6['as'],'attributes':_0x338cb6[_0xabf5('0x1a')],'include':_0x338cb6[_0xabf5('0x1c')]?_['map'](_0x338cb6[_0xabf5('0x1c')],function(_0x4c7fbe){return{'model':db[_0x4c7fbe['model']],'as':_0x4c7fbe['as'],'attributes':_0x4c7fbe[_0xabf5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xabf5('0xa')](function(_0x108a77){logger[_0xabf5('0x13')](_0xabf5('0x1f'),_0x2e78e8);logger[_0xabf5('0xd')](_0xabf5('0x1f'),_0x2e78e8,JSON[_0xabf5('0xf')](_0x108a77));_0x937ef8(_0x108a77);})[_0xabf5('0x15')](function(_0xd47b68){logger[_0xabf5('0x10')](_0xabf5('0x1f'),_0xd47b68[_0xabf5('0x12')],_0x2e78e8);_0x1bf019(_0x4a113e[_0xabf5('0x10')](0x1f4,_0xd47b68[_0xabf5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index dc05241..f162e7c 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 _0x0854=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','getTags','create','post','/:id/tags','setTags','put','update','delete','exports','multer','util','path'];(function(_0x36b9a,_0x434e2e){var _0x345e2d=function(_0x32e7bf){while(--_0x32e7bf){_0x36b9a['push'](_0x36b9a['shift']());}};_0x345e2d(++_0x434e2e);}(_0x0854,0x15c));var _0x4085=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0854[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4085('0x0'));var util=require(_0x4085('0x1'));var path=require(_0x4085('0x2'));var timeout=require(_0x4085('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4085('0x4'));var auth=require(_0x4085('0x5'));var interaction=require(_0x4085('0x6'));var config=require(_0x4085('0x7'));var controller=require(_0x4085('0x8'));router[_0x4085('0x9')]('/',auth[_0x4085('0xa')](),controller['index']);router[_0x4085('0x9')](_0x4085('0xb'),auth['isAuthenticated'](),controller[_0x4085('0xc')]);router[_0x4085('0x9')](_0x4085('0xd'),auth[_0x4085('0xa')](),controller[_0x4085('0xe')]);router[_0x4085('0x9')](_0x4085('0xf'),auth['isAuthenticated'](),controller[_0x4085('0x10')]);router[_0x4085('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x4085('0x11')]);router[_0x4085('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x4085('0x12')]);router['post']('/',auth[_0x4085('0xa')](),controller[_0x4085('0x13')]);router[_0x4085('0x14')](_0x4085('0x15'),auth['isAuthenticated'](),controller[_0x4085('0x16')]);router[_0x4085('0x17')](_0x4085('0xb'),auth[_0x4085('0xa')](),controller[_0x4085('0x18')]);router[_0x4085('0x19')](_0x4085('0xb'),auth[_0x4085('0xa')](),controller['destroy']);module[_0x4085('0x1a')]=router; \ No newline at end of file +var _0xc5e4=['./intFreshdeskConfiguration.controller','isAuthenticated','index','show','get','/:id/fields','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x50dbe3,_0x59e7cd){var _0x52f5a6=function(_0x56bb64){while(--_0x56bb64){_0x50dbe3['push'](_0x50dbe3['shift']());}};_0x52f5a6(++_0x59e7cd);}(_0xc5e4,0x1c2));var _0x4c5e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc5e4[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4c5e('0x0'));var util=require(_0x4c5e('0x1'));var path=require(_0x4c5e('0x2'));var timeout=require(_0x4c5e('0x3'));var express=require(_0x4c5e('0x4'));var router=express[_0x4c5e('0x5')]();var fs_extra=require(_0x4c5e('0x6'));var auth=require(_0x4c5e('0x7'));var interaction=require(_0x4c5e('0x8'));var config=require('../../config/environment');var controller=require(_0x4c5e('0x9'));router['get']('/',auth[_0x4c5e('0xa')](),controller[_0x4c5e('0xb')]);router['get']('/:id',auth[_0x4c5e('0xa')](),controller[_0x4c5e('0xc')]);router[_0x4c5e('0xd')](_0x4c5e('0xe'),auth[_0x4c5e('0xa')](),controller['getFields']);router[_0x4c5e('0xd')]('/:id/subjects',auth[_0x4c5e('0xa')](),controller[_0x4c5e('0xf')]);router[_0x4c5e('0xd')](_0x4c5e('0x10'),auth[_0x4c5e('0xa')](),controller['getDescriptions']);router['get'](_0x4c5e('0x11'),auth[_0x4c5e('0xa')](),controller[_0x4c5e('0x12')]);router[_0x4c5e('0x13')]('/',auth['isAuthenticated'](),controller[_0x4c5e('0x14')]);router['post']('/:id/tags',auth['isAuthenticated'](),controller[_0x4c5e('0x15')]);router['put']('/:id',auth[_0x4c5e('0xa')](),controller[_0x4c5e('0x16')]);router[_0x4c5e('0x17')](_0x4c5e('0x18'),auth[_0x4c5e('0xa')](),controller[_0x4c5e('0x19')]);module[_0x4c5e('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 04c8046..8d79300 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 _0xb498=['STRING','sequelize','exports'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xb498,0x142));var _0x8b49=function(_0x478545,_0x156b00){_0x478545=_0x478545-0x0;var _0x4de529=_0xb498[_0x478545];return _0x4de529;};'use strict';var Sequelize=require(_0x8b49('0x0'));module[_0x8b49('0x1')]={'name':{'type':Sequelize[_0x8b49('0x2')]},'description':{'type':Sequelize[_0x8b49('0x2')]}}; \ No newline at end of file +var _0x01d3=['STRING'];(function(_0x358fc6,_0x17c780){var _0x113c75=function(_0x381ea8){while(--_0x381ea8){_0x358fc6['push'](_0x358fc6['shift']());}};_0x113c75(++_0x17c780);}(_0x01d3,0x1f0));var _0x301d=function(_0x1aa88f,_0x3b186f){_0x1aa88f=_0x1aa88f-0x0;var _0x3e0b82=_0x01d3[_0x1aa88f];return _0x3e0b82;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x301d('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 3c04227..c7391b1 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 _0x111b=['status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','getFields','findOne','getSubjects','FreshdeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x111b,0xec));var _0xb111=function(_0x38ed1e,_0x17c77a){_0x38ed1e=_0x38ed1e-0x0;var _0x1e660e=_0x111b[_0x38ed1e];return _0x1e660e;};'use strict';var emlformat=require(_0xb111('0x0'));var rimraf=require(_0xb111('0x1'));var zipdir=require(_0xb111('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb111('0x3'));var moment=require('moment');var BPromise=require(_0xb111('0x4'));var Mustache=require(_0xb111('0x5'));var util=require(_0xb111('0x6'));var path=require(_0xb111('0x7'));var sox=require(_0xb111('0x8'));var csv=require('to-csv');var ejs=require(_0xb111('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb111('0xa'));var toCsv=require(_0xb111('0xb'));var querystring=require(_0xb111('0xc'));var Papa=require(_0xb111('0xd'));var Redis=require(_0xb111('0xe'));var authService=require(_0xb111('0xf'));var qs=require(_0xb111('0x10'));var as=require(_0xb111('0x11'));var hardwareService=require(_0xb111('0x12'));var logger=require(_0xb111('0x13'))('api');var utils=require(_0xb111('0x14'));var config=require(_0xb111('0x15'));var licenseUtil=require(_0xb111('0x16'));var db=require(_0xb111('0x17'))['db'];function respondWithStatusCode(_0x2f43d0,_0x41a050){_0x41a050=_0x41a050||0xcc;return function(_0x278a36){if(_0x278a36){return _0x2f43d0[_0xb111('0x18')](_0x41a050);}return _0x2f43d0[_0xb111('0x19')](_0x41a050)[_0xb111('0x1a')]();};}function respondWithResult(_0x4f9eb4,_0x2dd8d2){_0x2dd8d2=_0x2dd8d2||0xc8;return function(_0x1f8b66){if(_0x1f8b66){return _0x4f9eb4[_0xb111('0x19')](_0x2dd8d2)[_0xb111('0x1b')](_0x1f8b66);}};}function respondWithFilteredResult(_0x311b40,_0x5b32af){return function(_0x5e4bd4){if(_0x5e4bd4){var _0x42b3cd=typeof _0x5b32af[_0xb111('0x1c')]==='undefined'&&typeof _0x5b32af[_0xb111('0x1d')]===_0xb111('0x1e');var _0x4d8504=_0x5e4bd4[_0xb111('0x1f')];var _0x41a907=_0x42b3cd?0x0:_0x5b32af['offset'];var _0x34f6cb=_0x42b3cd?_0x5e4bd4[_0xb111('0x1f')]:_0x5b32af[_0xb111('0x1c')]+_0x5b32af[_0xb111('0x1d')];var _0x43c653;if(_0x34f6cb>=_0x4d8504){_0x34f6cb=_0x4d8504;_0x43c653=0xc8;}else{_0x43c653=0xce;}_0x311b40['status'](_0x43c653);return _0x311b40[_0xb111('0x20')](_0xb111('0x21'),_0x41a907+'-'+_0x34f6cb+'/'+_0x4d8504)['json'](_0x5e4bd4);}return null;};}function patchUpdates(_0x548e20){return function(_0x3d0d20){try{jsonpatch[_0xb111('0x22')](_0x3d0d20,_0x548e20,!![]);}catch(_0x406c53){return BPromise[_0xb111('0x23')](_0x406c53);}return _0x3d0d20[_0xb111('0x24')]();};}function saveUpdates(_0xbe5b24,_0x374657){return function(_0x19a392){if(_0x19a392){return _0x19a392[_0xb111('0x25')](_0xbe5b24)[_0xb111('0x26')](function(_0x35ba0c){return _0x35ba0c;});}return null;};}function removeEntity(_0x49678e,_0xac4bc6){return function(_0x3dd6ce){if(_0x3dd6ce){return _0x3dd6ce[_0xb111('0x27')]()['then'](function(){_0x49678e[_0xb111('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b0d19,_0x5e0036){return function(_0x577e82){if(!_0x577e82){_0x1b0d19[_0xb111('0x18')](0x194);}return _0x577e82;};}function handleError(_0xb3ed07,_0x162464){_0x162464=_0x162464||0x1f4;return function(_0x14991e){logger[_0xb111('0x28')](_0x14991e[_0xb111('0x29')]);if(_0x14991e[_0xb111('0x2a')]){delete _0x14991e[_0xb111('0x2a')];}_0xb3ed07[_0xb111('0x19')](_0x162464)[_0xb111('0x2b')](_0x14991e);};}exports[_0xb111('0x2c')]=function(_0x2aafa8,_0x44c3e3){var _0x345ada={},_0x5621d3={},_0x3eda52={'count':0x0,'rows':[]};var _0xbd790f=_['map'](db[_0xb111('0x2d')][_0xb111('0x2e')],function(_0x39efcc){return{'name':_0x39efcc[_0xb111('0x2f')],'type':_0x39efcc[_0xb111('0x30')][_0xb111('0x31')]};});_0x5621d3[_0xb111('0x32')]=_[_0xb111('0x33')](_0xbd790f,'name');_0x5621d3['query']=_[_0xb111('0x34')](_0x2aafa8['query']);_0x5621d3[_0xb111('0x35')]=_[_0xb111('0x36')](_0x5621d3[_0xb111('0x32')],_0x5621d3[_0xb111('0x37')]);_0x345ada[_0xb111('0x38')]=_[_0xb111('0x36')](_0x5621d3[_0xb111('0x32')],qs['fields'](_0x2aafa8[_0xb111('0x37')][_0xb111('0x39')]));_0x345ada[_0xb111('0x38')]=_0x345ada['attributes'][_0xb111('0x3a')]?_0x345ada[_0xb111('0x38')]:_0x5621d3[_0xb111('0x32')];if(!_0x2aafa8['query'][_0xb111('0x3b')](_0xb111('0x3c'))){_0x345ada['limit']=qs['limit'](_0x2aafa8['query'][_0xb111('0x1d')]);_0x345ada['offset']=qs[_0xb111('0x1c')](_0x2aafa8[_0xb111('0x37')][_0xb111('0x1c')]);}_0x345ada[_0xb111('0x3d')]=qs[_0xb111('0x3e')](_0x2aafa8[_0xb111('0x37')][_0xb111('0x3e')]);_0x345ada[_0xb111('0x3f')]=qs['filters'](_[_0xb111('0x40')](_0x2aafa8[_0xb111('0x37')],_0x5621d3['filters']),_0xbd790f);if(_0x2aafa8[_0xb111('0x37')][_0xb111('0x41')]){_0x345ada[_0xb111('0x3f')]=_[_0xb111('0x42')](_0x345ada[_0xb111('0x3f')],{'$or':_[_0xb111('0x33')](_0xbd790f,function(_0x2deb00){if(_0x2deb00[_0xb111('0x30')]!=='VIRTUAL'){var _0x2b871b={};_0x2b871b[_0x2deb00[_0xb111('0x2a')]]={'$like':'%'+_0x2aafa8[_0xb111('0x37')]['filter']+'%'};return _0x2b871b;}})});}_0x345ada=_[_0xb111('0x42')]({},_0x345ada,_0x2aafa8[_0xb111('0x43')]);var _0x7eac72={'where':_0x345ada[_0xb111('0x3f')]};return db[_0xb111('0x2d')][_0xb111('0x1f')](_0x7eac72)[_0xb111('0x26')](function(_0x185086){_0x3eda52[_0xb111('0x1f')]=_0x185086;if(_0x2aafa8['query'][_0xb111('0x44')]){_0x345ada[_0xb111('0x45')]=[{'all':!![]}];}return db[_0xb111('0x2d')][_0xb111('0x46')](_0x345ada);})[_0xb111('0x26')](function(_0x39f667){_0x3eda52[_0xb111('0x47')]=_0x39f667;return _0x3eda52;})[_0xb111('0x26')](respondWithFilteredResult(_0x44c3e3,_0x345ada))[_0xb111('0x48')](handleError(_0x44c3e3,null));};exports[_0xb111('0x49')]=function(_0x5ee88f,_0x3ad900){var _0x98f54e={'raw':![],'where':{'id':_0x5ee88f['params']['id']}},_0x3e5b8f={};_0x3e5b8f['model']=_[_0xb111('0x34')](db[_0xb111('0x2d')]['rawAttributes']);_0x3e5b8f[_0xb111('0x37')]=_[_0xb111('0x34')](_0x5ee88f[_0xb111('0x37')]);_0x3e5b8f[_0xb111('0x35')]=_[_0xb111('0x36')](_0x3e5b8f['model'],_0x3e5b8f['query']);_0x98f54e[_0xb111('0x38')]=_[_0xb111('0x36')](_0x3e5b8f[_0xb111('0x32')],qs['fields'](_0x5ee88f[_0xb111('0x37')][_0xb111('0x39')]));_0x98f54e[_0xb111('0x38')]=_0x98f54e[_0xb111('0x38')][_0xb111('0x3a')]?_0x98f54e['attributes']:_0x3e5b8f[_0xb111('0x32')];if(_0x5ee88f[_0xb111('0x37')][_0xb111('0x44')]){_0x98f54e[_0xb111('0x45')]=[{'all':!![]}];}_0x98f54e=_[_0xb111('0x42')]({},_0x98f54e,_0x5ee88f[_0xb111('0x43')]);return db[_0xb111('0x2d')][_0xb111('0x4a')](_0x98f54e)['then'](handleEntityNotFound(_0x3ad900,null))['then'](respondWithResult(_0x3ad900,null))[_0xb111('0x48')](handleError(_0x3ad900,null));};exports[_0xb111('0x4b')]=function(_0x19bc6f,_0x4d388a){return db[_0xb111('0x2d')][_0xb111('0x4b')](_0x19bc6f[_0xb111('0x4c')],{})[_0xb111('0x26')](respondWithResult(_0x4d388a,0xc9))[_0xb111('0x48')](handleError(_0x4d388a,null));};exports[_0xb111('0x25')]=function(_0x1f336a,_0x263f77){if(_0x1f336a[_0xb111('0x4c')]['id']){delete _0x1f336a[_0xb111('0x4c')]['id'];}return db[_0xb111('0x2d')][_0xb111('0x4a')]({'where':{'id':_0x1f336a['params']['id']}})[_0xb111('0x26')](handleEntityNotFound(_0x263f77,null))[_0xb111('0x26')](saveUpdates(_0x1f336a[_0xb111('0x4c')],null))[_0xb111('0x26')](respondWithResult(_0x263f77,null))['catch'](handleError(_0x263f77,null));};exports[_0xb111('0x27')]=function(_0x5c20d3,_0x4651a7){return db['FreshdeskConfiguration'][_0xb111('0x4a')]({'where':{'id':_0x5c20d3[_0xb111('0x4d')]['id']}})[_0xb111('0x26')](handleEntityNotFound(_0x4651a7,null))['then'](removeEntity(_0x4651a7,null))['catch'](handleError(_0x4651a7,null));};exports[_0xb111('0x4e')]=function(_0x1940b7,_0x13edf5,_0x599019){var _0xd8dc3e={};var _0x164eac={};var _0x263e1b;var _0x531f3d;return db[_0xb111('0x2d')][_0xb111('0x4f')]({'where':{'id':_0x1940b7[_0xb111('0x4d')]['id']}})['then'](handleEntityNotFound(_0x13edf5,null))[_0xb111('0x26')](function(_0x45b1e5){if(_0x45b1e5){_0x263e1b=_0x45b1e5;_0x164eac[_0xb111('0x32')]=_[_0xb111('0x34')](db['FreshdeskField'][_0xb111('0x2e')]);_0x164eac[_0xb111('0x37')]=_['keys'](_0x1940b7[_0xb111('0x37')]);_0x164eac[_0xb111('0x35')]=_['intersection'](_0x164eac[_0xb111('0x32')],_0x164eac[_0xb111('0x37')]);_0xd8dc3e[_0xb111('0x38')]=_['intersection'](_0x164eac[_0xb111('0x32')],qs['fields'](_0x1940b7[_0xb111('0x37')]['fields']));_0xd8dc3e['attributes']=_0xd8dc3e['attributes']['length']?_0xd8dc3e[_0xb111('0x38')]:_0x164eac[_0xb111('0x32')];_0xd8dc3e['order']=qs[_0xb111('0x3e')](_0x1940b7[_0xb111('0x37')][_0xb111('0x3e')]);_0xd8dc3e[_0xb111('0x3f')]=qs[_0xb111('0x35')](_[_0xb111('0x40')](_0x1940b7[_0xb111('0x37')],_0x164eac['filters']));if(_0x1940b7[_0xb111('0x37')][_0xb111('0x41')]){_0xd8dc3e[_0xb111('0x3f')]=_[_0xb111('0x42')](_0xd8dc3e[_0xb111('0x3f')],{'$or':_[_0xb111('0x33')](_0xd8dc3e[_0xb111('0x38')],function(_0x3b07ea){var _0x557560={};_0x557560[_0x3b07ea]={'$like':'%'+_0x1940b7['query'][_0xb111('0x41')]+'%'};return _0x557560;})});}_0xd8dc3e=_['merge']({},_0xd8dc3e,_0x1940b7[_0xb111('0x43')]);return _0x263e1b[_0xb111('0x4e')](_0xd8dc3e);}})[_0xb111('0x26')](function(_0x3bba2e){if(_0x3bba2e){_0x531f3d=_0x3bba2e[_0xb111('0x3a')];if(!_0x1940b7[_0xb111('0x37')]['hasOwnProperty'](_0xb111('0x3c'))){_0xd8dc3e[_0xb111('0x1d')]=qs[_0xb111('0x1d')](_0x1940b7['query'][_0xb111('0x1d')]);_0xd8dc3e[_0xb111('0x1c')]=qs[_0xb111('0x1c')](_0x1940b7[_0xb111('0x37')][_0xb111('0x1c')]);}return _0x263e1b[_0xb111('0x4e')](_0xd8dc3e);}})['then'](function(_0x4f7164){if(_0x4f7164){return _0x4f7164?{'count':_0x531f3d,'rows':_0x4f7164}:null;}})[_0xb111('0x26')](respondWithResult(_0x13edf5,null))[_0xb111('0x48')](handleError(_0x13edf5,null));};exports[_0xb111('0x50')]=function(_0x2dae57,_0x42afde,_0x10ddc2){var _0x281546={};var _0x92036f={};var _0x1e5620;var _0x176ae2;return db['FreshdeskConfiguration'][_0xb111('0x4f')]({'where':{'id':_0x2dae57[_0xb111('0x4d')]['id']}})[_0xb111('0x26')](handleEntityNotFound(_0x42afde,null))[_0xb111('0x26')](function(_0x21d182){if(_0x21d182){_0x1e5620=_0x21d182;_0x92036f[_0xb111('0x32')]=_[_0xb111('0x34')](db[_0xb111('0x51')][_0xb111('0x2e')]);_0x92036f[_0xb111('0x37')]=_[_0xb111('0x34')](_0x2dae57[_0xb111('0x37')]);_0x92036f[_0xb111('0x35')]=_[_0xb111('0x36')](_0x92036f['model'],_0x92036f[_0xb111('0x37')]);_0x281546[_0xb111('0x38')]=_[_0xb111('0x36')](_0x92036f[_0xb111('0x32')],qs[_0xb111('0x39')](_0x2dae57[_0xb111('0x37')][_0xb111('0x39')]));_0x281546['attributes']=_0x281546[_0xb111('0x38')][_0xb111('0x3a')]?_0x281546[_0xb111('0x38')]:_0x92036f[_0xb111('0x32')];_0x281546[_0xb111('0x3d')]=qs[_0xb111('0x3e')](_0x2dae57['query'][_0xb111('0x3e')]);_0x281546[_0xb111('0x3f')]=qs[_0xb111('0x35')](_[_0xb111('0x40')](_0x2dae57['query'],_0x92036f['filters']));if(_0x2dae57[_0xb111('0x37')]['filter']){_0x281546[_0xb111('0x3f')]=_[_0xb111('0x42')](_0x281546[_0xb111('0x3f')],{'$or':_[_0xb111('0x33')](_0x281546[_0xb111('0x38')],function(_0x41ef4a){var _0x278819={};_0x278819[_0x41ef4a]={'$like':'%'+_0x2dae57[_0xb111('0x37')][_0xb111('0x41')]+'%'};return _0x278819;})});}_0x281546=_[_0xb111('0x42')]({},_0x281546,_0x2dae57[_0xb111('0x43')]);return _0x1e5620['getSubjects'](_0x281546);}})[_0xb111('0x26')](function(_0x3acc4b){if(_0x3acc4b){_0x176ae2=_0x3acc4b[_0xb111('0x3a')];if(!_0x2dae57[_0xb111('0x37')][_0xb111('0x3b')]('nolimit')){_0x281546[_0xb111('0x1d')]=qs[_0xb111('0x1d')](_0x2dae57[_0xb111('0x37')][_0xb111('0x1d')]);_0x281546['offset']=qs[_0xb111('0x1c')](_0x2dae57[_0xb111('0x37')]['offset']);}return _0x1e5620[_0xb111('0x50')](_0x281546);}})[_0xb111('0x26')](function(_0xe4094c){if(_0xe4094c){return _0xe4094c?{'count':_0x176ae2,'rows':_0xe4094c}:null;}})[_0xb111('0x26')](respondWithResult(_0x42afde,null))[_0xb111('0x48')](handleError(_0x42afde,null));};exports['getDescriptions']=function(_0x678722,_0xadb3e5,_0x181859){var _0x57b0e6={};var _0x2d039e={};var _0x2b4eee;var _0x301454;return db['FreshdeskConfiguration'][_0xb111('0x4f')]({'where':{'id':_0x678722[_0xb111('0x4d')]['id']}})[_0xb111('0x26')](handleEntityNotFound(_0xadb3e5,null))['then'](function(_0x5609de){if(_0x5609de){_0x2b4eee=_0x5609de;_0x2d039e['model']=_[_0xb111('0x34')](db['FreshdeskField'][_0xb111('0x2e')]);_0x2d039e['query']=_[_0xb111('0x34')](_0x678722[_0xb111('0x37')]);_0x2d039e['filters']=_[_0xb111('0x36')](_0x2d039e[_0xb111('0x32')],_0x2d039e['query']);_0x57b0e6[_0xb111('0x38')]=_['intersection'](_0x2d039e[_0xb111('0x32')],qs[_0xb111('0x39')](_0x678722[_0xb111('0x37')]['fields']));_0x57b0e6[_0xb111('0x38')]=_0x57b0e6['attributes'][_0xb111('0x3a')]?_0x57b0e6[_0xb111('0x38')]:_0x2d039e[_0xb111('0x32')];_0x57b0e6['order']=qs['sort'](_0x678722['query'][_0xb111('0x3e')]);_0x57b0e6[_0xb111('0x3f')]=qs['filters'](_['pick'](_0x678722[_0xb111('0x37')],_0x2d039e[_0xb111('0x35')]));if(_0x678722[_0xb111('0x37')][_0xb111('0x41')]){_0x57b0e6['where']=_[_0xb111('0x42')](_0x57b0e6['where'],{'$or':_[_0xb111('0x33')](_0x57b0e6['attributes'],function(_0x595d71){var _0x3a3f13={};_0x3a3f13[_0x595d71]={'$like':'%'+_0x678722['query']['filter']+'%'};return _0x3a3f13;})});}_0x57b0e6=_[_0xb111('0x42')]({},_0x57b0e6,_0x678722[_0xb111('0x43')]);return _0x2b4eee['getDescriptions'](_0x57b0e6);}})[_0xb111('0x26')](function(_0x54bad6){if(_0x54bad6){_0x301454=_0x54bad6['length'];if(!_0x678722[_0xb111('0x37')][_0xb111('0x3b')](_0xb111('0x3c'))){_0x57b0e6[_0xb111('0x1d')]=qs[_0xb111('0x1d')](_0x678722['query'][_0xb111('0x1d')]);_0x57b0e6[_0xb111('0x1c')]=qs[_0xb111('0x1c')](_0x678722[_0xb111('0x37')]['offset']);}return _0x2b4eee[_0xb111('0x52')](_0x57b0e6);}})[_0xb111('0x26')](function(_0x4ec620){if(_0x4ec620){return _0x4ec620?{'count':_0x301454,'rows':_0x4ec620}:null;}})[_0xb111('0x26')](respondWithResult(_0xadb3e5,null))[_0xb111('0x48')](handleError(_0xadb3e5,null));};exports[_0xb111('0x53')]=function(_0x14119a,_0x1c928b,_0xf466ab){var _0x4e3df9={};var _0x293111={};var _0x32518a;var _0x255238;return db[_0xb111('0x2d')][_0xb111('0x4f')]({'where':{'id':_0x14119a[_0xb111('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1c928b,null))[_0xb111('0x26')](function(_0x1756f0){if(_0x1756f0){_0x32518a=_0x1756f0;_0x293111[_0xb111('0x32')]=_['keys'](db[_0xb111('0x54')][_0xb111('0x2e')]);_0x293111['query']=_[_0xb111('0x34')](_0x14119a[_0xb111('0x37')]);_0x293111[_0xb111('0x35')]=_[_0xb111('0x36')](_0x293111[_0xb111('0x32')],_0x293111['query']);_0x4e3df9[_0xb111('0x38')]=_['intersection'](_0x293111[_0xb111('0x32')],qs[_0xb111('0x39')](_0x14119a[_0xb111('0x37')]['fields']));_0x4e3df9[_0xb111('0x38')]=_0x4e3df9[_0xb111('0x38')][_0xb111('0x3a')]?_0x4e3df9['attributes']:_0x293111[_0xb111('0x32')];_0x4e3df9[_0xb111('0x3d')]=qs['sort'](_0x14119a[_0xb111('0x37')][_0xb111('0x3e')]);_0x4e3df9[_0xb111('0x3f')]=qs[_0xb111('0x35')](_[_0xb111('0x40')](_0x14119a[_0xb111('0x37')],_0x293111[_0xb111('0x35')]));if(_0x14119a[_0xb111('0x37')][_0xb111('0x41')]){_0x4e3df9['where']=_[_0xb111('0x42')](_0x4e3df9[_0xb111('0x3f')],{'$or':_[_0xb111('0x33')](_0x4e3df9[_0xb111('0x38')],function(_0x17af1b){var _0xac1fb9={};_0xac1fb9[_0x17af1b]={'$like':'%'+_0x14119a['query']['filter']+'%'};return _0xac1fb9;})});}_0x4e3df9=_['merge']({},_0x4e3df9,_0x14119a[_0xb111('0x43')]);return _0x32518a[_0xb111('0x53')](_0x4e3df9);}})[_0xb111('0x26')](function(_0x3eea54){if(_0x3eea54){_0x255238=_0x3eea54[_0xb111('0x3a')];if(!_0x14119a[_0xb111('0x37')][_0xb111('0x3b')](_0xb111('0x3c'))){_0x4e3df9[_0xb111('0x1d')]=qs['limit'](_0x14119a[_0xb111('0x37')][_0xb111('0x1d')]);_0x4e3df9[_0xb111('0x1c')]=qs[_0xb111('0x1c')](_0x14119a[_0xb111('0x37')][_0xb111('0x1c')]);}return _0x32518a[_0xb111('0x53')](_0x4e3df9);}})[_0xb111('0x26')](function(_0x46f494){if(_0x46f494){return _0x46f494?{'count':_0x255238,'rows':_0x46f494}:null;}})[_0xb111('0x26')](respondWithResult(_0x1c928b,null))[_0xb111('0x48')](handleError(_0x1c928b,null));};exports[_0xb111('0x55')]=function(_0x11c06c,_0x52950d,_0x3137e1){if(_0x11c06c[_0xb111('0x4c')]['id']){delete _0x11c06c['body']['id'];}return db[_0xb111('0x2d')]['findOne']({'where':{'id':_0x11c06c['params']['id']}})[_0xb111('0x26')](handleEntityNotFound(_0x52950d,null))[_0xb111('0x26')](function(_0x537ee2){if(_0x537ee2){return _0x537ee2['setTags'](_0x11c06c[_0xb111('0x4c')][_0xb111('0x56')]||[]);}return null;})['then'](respondWithResult(_0x52950d,null))[_0xb111('0x48')](handleError(_0x52950d,null));}; \ No newline at end of file +var _0x0f80=['rawAttributes','options','create','body','destroy','find','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','order','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','includeAll','include','catch','show','params','keys'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x0f80,0x108));var _0x00f8=function(_0x548423,_0x364231){_0x548423=_0x548423-0x0;var _0x1a9f66=_0x0f80[_0x548423];return _0x1a9f66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00f8('0x0'));var zipdir=require(_0x00f8('0x1'));var jsonpatch=require(_0x00f8('0x2'));var rp=require(_0x00f8('0x3'));var moment=require(_0x00f8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x00f8('0x5'));var util=require(_0x00f8('0x6'));var path=require(_0x00f8('0x7'));var sox=require('sox');var csv=require(_0x00f8('0x8'));var ejs=require(_0x00f8('0x9'));var fs=require('fs');var fs_extra=require(_0x00f8('0xa'));var _=require(_0x00f8('0xb'));var squel=require(_0x00f8('0xc'));var crypto=require(_0x00f8('0xd'));var jsforce=require(_0x00f8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x00f8('0x8'));var querystring=require(_0x00f8('0xf'));var Papa=require(_0x00f8('0x10'));var Redis=require('ioredis');var authService=require(_0x00f8('0x11'));var qs=require(_0x00f8('0x12'));var as=require(_0x00f8('0x13'));var hardwareService=require(_0x00f8('0x14'));var logger=require(_0x00f8('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x00f8('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fd828,_0x4ba3d6){_0x4ba3d6=_0x4ba3d6||0xcc;return function(_0x41dbe4){if(_0x41dbe4){return _0x2fd828[_0x00f8('0x17')](_0x4ba3d6);}return _0x2fd828['status'](_0x4ba3d6)[_0x00f8('0x18')]();};}function respondWithResult(_0x47c3da,_0x5e8ace){_0x5e8ace=_0x5e8ace||0xc8;return function(_0x371b6a){if(_0x371b6a){return _0x47c3da[_0x00f8('0x19')](_0x5e8ace)[_0x00f8('0x1a')](_0x371b6a);}};}function respondWithFilteredResult(_0x3e2bea,_0x49eeef){return function(_0x23ba53){if(_0x23ba53){var _0x44ebf0=typeof _0x49eeef[_0x00f8('0x1b')]===_0x00f8('0x1c')&&typeof _0x49eeef['limit']===_0x00f8('0x1c');var _0x22003e=_0x23ba53[_0x00f8('0x1d')];var _0xfd83a=_0x44ebf0?0x0:_0x49eeef[_0x00f8('0x1b')];var _0x1a6c5a=_0x44ebf0?_0x23ba53[_0x00f8('0x1d')]:_0x49eeef['offset']+_0x49eeef['limit'];var _0x7bcc6d;if(_0x1a6c5a>=_0x22003e){_0x1a6c5a=_0x22003e;_0x7bcc6d=0xc8;}else{_0x7bcc6d=0xce;}_0x3e2bea['status'](_0x7bcc6d);return _0x3e2bea[_0x00f8('0x1e')](_0x00f8('0x1f'),_0xfd83a+'-'+_0x1a6c5a+'/'+_0x22003e)['json'](_0x23ba53);}return null;};}function patchUpdates(_0x485d6b){return function(_0x1f9599){try{jsonpatch[_0x00f8('0x20')](_0x1f9599,_0x485d6b,!![]);}catch(_0x1e53da){return BPromise[_0x00f8('0x21')](_0x1e53da);}return _0x1f9599[_0x00f8('0x22')]();};}function saveUpdates(_0x3e92b6,_0x149c00){return function(_0x40a44d){if(_0x40a44d){return _0x40a44d[_0x00f8('0x23')](_0x3e92b6)[_0x00f8('0x24')](function(_0x77fefb){return _0x77fefb;});}return null;};}function removeEntity(_0x234f12,_0x5a2d1a){return function(_0x4e4768){if(_0x4e4768){return _0x4e4768['destroy']()[_0x00f8('0x24')](function(){_0x234f12['status'](0xcc)[_0x00f8('0x18')]();});}};}function handleEntityNotFound(_0x3d2c32,_0x517556){return function(_0xb3a82a){if(!_0xb3a82a){_0x3d2c32[_0x00f8('0x17')](0x194);}return _0xb3a82a;};}function handleError(_0x3844fa,_0x2eea66){_0x2eea66=_0x2eea66||0x1f4;return function(_0x27753c){logger[_0x00f8('0x25')](_0x27753c[_0x00f8('0x26')]);if(_0x27753c[_0x00f8('0x27')]){delete _0x27753c[_0x00f8('0x27')];}_0x3844fa[_0x00f8('0x19')](_0x2eea66)[_0x00f8('0x28')](_0x27753c);};}exports[_0x00f8('0x29')]=function(_0x5e7463,_0x346e00){var _0x3b0b6e={},_0x3413bc={},_0x242fe7={'count':0x0,'rows':[]};var _0x4cfd4f=_[_0x00f8('0x2a')](db[_0x00f8('0x2b')]['rawAttributes'],function(_0x1a8e35){return{'name':_0x1a8e35[_0x00f8('0x2c')],'type':_0x1a8e35[_0x00f8('0x2d')][_0x00f8('0x2e')]};});_0x3413bc[_0x00f8('0x2f')]=_['map'](_0x4cfd4f,_0x00f8('0x27'));_0x3413bc[_0x00f8('0x30')]=_['keys'](_0x5e7463['query']);_0x3413bc['filters']=_['intersection'](_0x3413bc['model'],_0x3413bc[_0x00f8('0x30')]);_0x3b0b6e[_0x00f8('0x31')]=_[_0x00f8('0x32')](_0x3413bc[_0x00f8('0x2f')],qs[_0x00f8('0x33')](_0x5e7463['query'][_0x00f8('0x33')]));_0x3b0b6e['attributes']=_0x3b0b6e['attributes'][_0x00f8('0x34')]?_0x3b0b6e[_0x00f8('0x31')]:_0x3413bc['model'];if(!_0x5e7463[_0x00f8('0x30')][_0x00f8('0x35')](_0x00f8('0x36'))){_0x3b0b6e['limit']=qs[_0x00f8('0x37')](_0x5e7463[_0x00f8('0x30')][_0x00f8('0x37')]);_0x3b0b6e[_0x00f8('0x1b')]=qs['offset'](_0x5e7463[_0x00f8('0x30')][_0x00f8('0x1b')]);}_0x3b0b6e['order']=qs['sort'](_0x5e7463[_0x00f8('0x30')][_0x00f8('0x38')]);_0x3b0b6e[_0x00f8('0x39')]=qs[_0x00f8('0x3a')](_[_0x00f8('0x3b')](_0x5e7463[_0x00f8('0x30')],_0x3413bc[_0x00f8('0x3a')]),_0x4cfd4f);if(_0x5e7463[_0x00f8('0x30')][_0x00f8('0x3c')]){_0x3b0b6e[_0x00f8('0x39')]=_[_0x00f8('0x3d')](_0x3b0b6e[_0x00f8('0x39')],{'$or':_['map'](_0x4cfd4f,function(_0x3932b9){if(_0x3932b9[_0x00f8('0x2d')]!=='VIRTUAL'){var _0x640255={};_0x640255[_0x3932b9[_0x00f8('0x27')]]={'$like':'%'+_0x5e7463[_0x00f8('0x30')]['filter']+'%'};return _0x640255;}})});}_0x3b0b6e=_['merge']({},_0x3b0b6e,_0x5e7463['options']);var _0x2b1628={'where':_0x3b0b6e[_0x00f8('0x39')]};return db[_0x00f8('0x2b')][_0x00f8('0x1d')](_0x2b1628)['then'](function(_0xcc340e){_0x242fe7['count']=_0xcc340e;if(_0x5e7463['query'][_0x00f8('0x3e')]){_0x3b0b6e[_0x00f8('0x3f')]=[{'all':!![]}];}return db[_0x00f8('0x2b')]['findAll'](_0x3b0b6e);})[_0x00f8('0x24')](function(_0x16480e){_0x242fe7['rows']=_0x16480e;return _0x242fe7;})[_0x00f8('0x24')](respondWithFilteredResult(_0x346e00,_0x3b0b6e))[_0x00f8('0x40')](handleError(_0x346e00,null));};exports[_0x00f8('0x41')]=function(_0x524424,_0x164a9c){var _0x2736a2={'raw':![],'where':{'id':_0x524424[_0x00f8('0x42')]['id']}},_0x570696={};_0x570696[_0x00f8('0x2f')]=_[_0x00f8('0x43')](db[_0x00f8('0x2b')][_0x00f8('0x44')]);_0x570696['query']=_[_0x00f8('0x43')](_0x524424[_0x00f8('0x30')]);_0x570696[_0x00f8('0x3a')]=_[_0x00f8('0x32')](_0x570696[_0x00f8('0x2f')],_0x570696[_0x00f8('0x30')]);_0x2736a2[_0x00f8('0x31')]=_[_0x00f8('0x32')](_0x570696[_0x00f8('0x2f')],qs['fields'](_0x524424['query'][_0x00f8('0x33')]));_0x2736a2[_0x00f8('0x31')]=_0x2736a2[_0x00f8('0x31')][_0x00f8('0x34')]?_0x2736a2[_0x00f8('0x31')]:_0x570696['model'];if(_0x524424[_0x00f8('0x30')]['includeAll']){_0x2736a2[_0x00f8('0x3f')]=[{'all':!![]}];}_0x2736a2=_[_0x00f8('0x3d')]({},_0x2736a2,_0x524424[_0x00f8('0x45')]);return db['FreshdeskConfiguration']['find'](_0x2736a2)[_0x00f8('0x24')](handleEntityNotFound(_0x164a9c,null))[_0x00f8('0x24')](respondWithResult(_0x164a9c,null))[_0x00f8('0x40')](handleError(_0x164a9c,null));};exports[_0x00f8('0x46')]=function(_0x169301,_0x38ecba){return db[_0x00f8('0x2b')][_0x00f8('0x46')](_0x169301[_0x00f8('0x47')],{})[_0x00f8('0x24')](respondWithResult(_0x38ecba,0xc9))[_0x00f8('0x40')](handleError(_0x38ecba,null));};exports[_0x00f8('0x23')]=function(_0x7eea65,_0x23c213){if(_0x7eea65['body']['id']){delete _0x7eea65[_0x00f8('0x47')]['id'];}return db[_0x00f8('0x2b')]['find']({'where':{'id':_0x7eea65[_0x00f8('0x42')]['id']}})[_0x00f8('0x24')](handleEntityNotFound(_0x23c213,null))['then'](saveUpdates(_0x7eea65[_0x00f8('0x47')],null))[_0x00f8('0x24')](respondWithResult(_0x23c213,null))[_0x00f8('0x40')](handleError(_0x23c213,null));};exports[_0x00f8('0x48')]=function(_0x20ce69,_0x389d0b){return db[_0x00f8('0x2b')][_0x00f8('0x49')]({'where':{'id':_0x20ce69[_0x00f8('0x42')]['id']}})['then'](handleEntityNotFound(_0x389d0b,null))[_0x00f8('0x24')](removeEntity(_0x389d0b,null))[_0x00f8('0x40')](handleError(_0x389d0b,null));};exports[_0x00f8('0x4a')]=function(_0x57926d,_0x6a9faf,_0x57d1df){var _0x319e99={};var _0x308371={};var _0x1950b4;var _0x184683;return db['FreshdeskConfiguration'][_0x00f8('0x4b')]({'where':{'id':_0x57926d['params']['id']}})[_0x00f8('0x24')](handleEntityNotFound(_0x6a9faf,null))[_0x00f8('0x24')](function(_0x3268e7){if(_0x3268e7){_0x1950b4=_0x3268e7;_0x308371[_0x00f8('0x2f')]=_[_0x00f8('0x43')](db[_0x00f8('0x4c')][_0x00f8('0x44')]);_0x308371['query']=_[_0x00f8('0x43')](_0x57926d['query']);_0x308371['filters']=_[_0x00f8('0x32')](_0x308371[_0x00f8('0x2f')],_0x308371[_0x00f8('0x30')]);_0x319e99['attributes']=_[_0x00f8('0x32')](_0x308371['model'],qs[_0x00f8('0x33')](_0x57926d[_0x00f8('0x30')]['fields']));_0x319e99[_0x00f8('0x31')]=_0x319e99[_0x00f8('0x31')]['length']?_0x319e99[_0x00f8('0x31')]:_0x308371[_0x00f8('0x2f')];_0x319e99['order']=qs['sort'](_0x57926d['query'][_0x00f8('0x38')]);_0x319e99['where']=qs[_0x00f8('0x3a')](_[_0x00f8('0x3b')](_0x57926d[_0x00f8('0x30')],_0x308371[_0x00f8('0x3a')]));if(_0x57926d['query'][_0x00f8('0x3c')]){_0x319e99[_0x00f8('0x39')]=_['merge'](_0x319e99['where'],{'$or':_['map'](_0x319e99['attributes'],function(_0x8272ad){var _0x18847d={};_0x18847d[_0x8272ad]={'$like':'%'+_0x57926d[_0x00f8('0x30')][_0x00f8('0x3c')]+'%'};return _0x18847d;})});}_0x319e99=_[_0x00f8('0x3d')]({},_0x319e99,_0x57926d[_0x00f8('0x45')]);return _0x1950b4['getFields'](_0x319e99);}})[_0x00f8('0x24')](function(_0x233afb){if(_0x233afb){_0x184683=_0x233afb[_0x00f8('0x34')];if(!_0x57926d[_0x00f8('0x30')]['hasOwnProperty']('nolimit')){_0x319e99[_0x00f8('0x37')]=qs[_0x00f8('0x37')](_0x57926d[_0x00f8('0x30')][_0x00f8('0x37')]);_0x319e99[_0x00f8('0x1b')]=qs[_0x00f8('0x1b')](_0x57926d[_0x00f8('0x30')][_0x00f8('0x1b')]);}return _0x1950b4[_0x00f8('0x4a')](_0x319e99);}})[_0x00f8('0x24')](function(_0x357c85){if(_0x357c85){return _0x357c85?{'count':_0x184683,'rows':_0x357c85}:null;}})[_0x00f8('0x24')](respondWithResult(_0x6a9faf,null))[_0x00f8('0x40')](handleError(_0x6a9faf,null));};exports[_0x00f8('0x4d')]=function(_0x3fbd1e,_0x355f73,_0x4e36c3){var _0x31ccef={};var _0x3b7c55={};var _0x5b19d3;var _0x302208;return db[_0x00f8('0x2b')][_0x00f8('0x4b')]({'where':{'id':_0x3fbd1e['params']['id']}})[_0x00f8('0x24')](handleEntityNotFound(_0x355f73,null))[_0x00f8('0x24')](function(_0x1376be){if(_0x1376be){_0x5b19d3=_0x1376be;_0x3b7c55['model']=_[_0x00f8('0x43')](db['FreshdeskField'][_0x00f8('0x44')]);_0x3b7c55[_0x00f8('0x30')]=_['keys'](_0x3fbd1e['query']);_0x3b7c55[_0x00f8('0x3a')]=_[_0x00f8('0x32')](_0x3b7c55[_0x00f8('0x2f')],_0x3b7c55[_0x00f8('0x30')]);_0x31ccef[_0x00f8('0x31')]=_['intersection'](_0x3b7c55['model'],qs['fields'](_0x3fbd1e[_0x00f8('0x30')][_0x00f8('0x33')]));_0x31ccef[_0x00f8('0x31')]=_0x31ccef[_0x00f8('0x31')]['length']?_0x31ccef[_0x00f8('0x31')]:_0x3b7c55[_0x00f8('0x2f')];_0x31ccef['order']=qs[_0x00f8('0x38')](_0x3fbd1e[_0x00f8('0x30')]['sort']);_0x31ccef[_0x00f8('0x39')]=qs['filters'](_[_0x00f8('0x3b')](_0x3fbd1e[_0x00f8('0x30')],_0x3b7c55[_0x00f8('0x3a')]));if(_0x3fbd1e[_0x00f8('0x30')]['filter']){_0x31ccef['where']=_['merge'](_0x31ccef[_0x00f8('0x39')],{'$or':_[_0x00f8('0x2a')](_0x31ccef[_0x00f8('0x31')],function(_0x3ea146){var _0x3569f7={};_0x3569f7[_0x3ea146]={'$like':'%'+_0x3fbd1e[_0x00f8('0x30')]['filter']+'%'};return _0x3569f7;})});}_0x31ccef=_[_0x00f8('0x3d')]({},_0x31ccef,_0x3fbd1e[_0x00f8('0x45')]);return _0x5b19d3[_0x00f8('0x4d')](_0x31ccef);}})['then'](function(_0x162803){if(_0x162803){_0x302208=_0x162803[_0x00f8('0x34')];if(!_0x3fbd1e[_0x00f8('0x30')][_0x00f8('0x35')]('nolimit')){_0x31ccef[_0x00f8('0x37')]=qs['limit'](_0x3fbd1e[_0x00f8('0x30')][_0x00f8('0x37')]);_0x31ccef[_0x00f8('0x1b')]=qs['offset'](_0x3fbd1e[_0x00f8('0x30')]['offset']);}return _0x5b19d3[_0x00f8('0x4d')](_0x31ccef);}})[_0x00f8('0x24')](function(_0xd451cb){if(_0xd451cb){return _0xd451cb?{'count':_0x302208,'rows':_0xd451cb}:null;}})['then'](respondWithResult(_0x355f73,null))[_0x00f8('0x40')](handleError(_0x355f73,null));};exports[_0x00f8('0x4e')]=function(_0x294e58,_0x1441e1,_0x7378c){var _0x220089={};var _0x110310={};var _0x542cfd;var _0xaae655;return db['FreshdeskConfiguration'][_0x00f8('0x4b')]({'where':{'id':_0x294e58[_0x00f8('0x42')]['id']}})[_0x00f8('0x24')](handleEntityNotFound(_0x1441e1,null))[_0x00f8('0x24')](function(_0x30e78a){if(_0x30e78a){_0x542cfd=_0x30e78a;_0x110310[_0x00f8('0x2f')]=_[_0x00f8('0x43')](db[_0x00f8('0x4c')][_0x00f8('0x44')]);_0x110310[_0x00f8('0x30')]=_[_0x00f8('0x43')](_0x294e58['query']);_0x110310[_0x00f8('0x3a')]=_[_0x00f8('0x32')](_0x110310[_0x00f8('0x2f')],_0x110310[_0x00f8('0x30')]);_0x220089[_0x00f8('0x31')]=_[_0x00f8('0x32')](_0x110310['model'],qs[_0x00f8('0x33')](_0x294e58[_0x00f8('0x30')][_0x00f8('0x33')]));_0x220089['attributes']=_0x220089['attributes'][_0x00f8('0x34')]?_0x220089[_0x00f8('0x31')]:_0x110310[_0x00f8('0x2f')];_0x220089[_0x00f8('0x4f')]=qs[_0x00f8('0x38')](_0x294e58[_0x00f8('0x30')][_0x00f8('0x38')]);_0x220089['where']=qs[_0x00f8('0x3a')](_[_0x00f8('0x3b')](_0x294e58[_0x00f8('0x30')],_0x110310[_0x00f8('0x3a')]));if(_0x294e58[_0x00f8('0x30')][_0x00f8('0x3c')]){_0x220089[_0x00f8('0x39')]=_[_0x00f8('0x3d')](_0x220089[_0x00f8('0x39')],{'$or':_[_0x00f8('0x2a')](_0x220089[_0x00f8('0x31')],function(_0x2b19ab){var _0x3dbe79={};_0x3dbe79[_0x2b19ab]={'$like':'%'+_0x294e58['query']['filter']+'%'};return _0x3dbe79;})});}_0x220089=_[_0x00f8('0x3d')]({},_0x220089,_0x294e58[_0x00f8('0x45')]);return _0x542cfd[_0x00f8('0x4e')](_0x220089);}})[_0x00f8('0x24')](function(_0x454cad){if(_0x454cad){_0xaae655=_0x454cad[_0x00f8('0x34')];if(!_0x294e58[_0x00f8('0x30')][_0x00f8('0x35')](_0x00f8('0x36'))){_0x220089[_0x00f8('0x37')]=qs[_0x00f8('0x37')](_0x294e58['query']['limit']);_0x220089[_0x00f8('0x1b')]=qs[_0x00f8('0x1b')](_0x294e58[_0x00f8('0x30')]['offset']);}return _0x542cfd[_0x00f8('0x4e')](_0x220089);}})[_0x00f8('0x24')](function(_0x4898c1){if(_0x4898c1){return _0x4898c1?{'count':_0xaae655,'rows':_0x4898c1}:null;}})[_0x00f8('0x24')](respondWithResult(_0x1441e1,null))['catch'](handleError(_0x1441e1,null));};exports[_0x00f8('0x50')]=function(_0x7f2529,_0x51c433,_0x5b2d31){var _0x2fb9e7={};var _0x323491={};var _0x4f2855;var _0x17a406;return db['FreshdeskConfiguration'][_0x00f8('0x4b')]({'where':{'id':_0x7f2529[_0x00f8('0x42')]['id']}})[_0x00f8('0x24')](handleEntityNotFound(_0x51c433,null))[_0x00f8('0x24')](function(_0x3d6fc0){if(_0x3d6fc0){_0x4f2855=_0x3d6fc0;_0x323491['model']=_['keys'](db[_0x00f8('0x51')][_0x00f8('0x44')]);_0x323491[_0x00f8('0x30')]=_[_0x00f8('0x43')](_0x7f2529['query']);_0x323491['filters']=_['intersection'](_0x323491[_0x00f8('0x2f')],_0x323491[_0x00f8('0x30')]);_0x2fb9e7[_0x00f8('0x31')]=_[_0x00f8('0x32')](_0x323491[_0x00f8('0x2f')],qs[_0x00f8('0x33')](_0x7f2529[_0x00f8('0x30')]['fields']));_0x2fb9e7[_0x00f8('0x31')]=_0x2fb9e7[_0x00f8('0x31')][_0x00f8('0x34')]?_0x2fb9e7[_0x00f8('0x31')]:_0x323491['model'];_0x2fb9e7[_0x00f8('0x4f')]=qs[_0x00f8('0x38')](_0x7f2529[_0x00f8('0x30')][_0x00f8('0x38')]);_0x2fb9e7[_0x00f8('0x39')]=qs[_0x00f8('0x3a')](_[_0x00f8('0x3b')](_0x7f2529[_0x00f8('0x30')],_0x323491[_0x00f8('0x3a')]));if(_0x7f2529['query'][_0x00f8('0x3c')]){_0x2fb9e7[_0x00f8('0x39')]=_[_0x00f8('0x3d')](_0x2fb9e7[_0x00f8('0x39')],{'$or':_[_0x00f8('0x2a')](_0x2fb9e7[_0x00f8('0x31')],function(_0x27b3b9){var _0x2965f5={};_0x2965f5[_0x27b3b9]={'$like':'%'+_0x7f2529['query'][_0x00f8('0x3c')]+'%'};return _0x2965f5;})});}_0x2fb9e7=_[_0x00f8('0x3d')]({},_0x2fb9e7,_0x7f2529[_0x00f8('0x45')]);return _0x4f2855[_0x00f8('0x50')](_0x2fb9e7);}})[_0x00f8('0x24')](function(_0x126192){if(_0x126192){_0x17a406=_0x126192[_0x00f8('0x34')];if(!_0x7f2529[_0x00f8('0x30')]['hasOwnProperty'](_0x00f8('0x36'))){_0x2fb9e7['limit']=qs['limit'](_0x7f2529[_0x00f8('0x30')][_0x00f8('0x37')]);_0x2fb9e7[_0x00f8('0x1b')]=qs[_0x00f8('0x1b')](_0x7f2529[_0x00f8('0x30')][_0x00f8('0x1b')]);}return _0x4f2855[_0x00f8('0x50')](_0x2fb9e7);}})['then'](function(_0x1164bf){if(_0x1164bf){return _0x1164bf?{'count':_0x17a406,'rows':_0x1164bf}:null;}})['then'](respondWithResult(_0x51c433,null))[_0x00f8('0x40')](handleError(_0x51c433,null));};exports['setTags']=function(_0x410975,_0x4a78be,_0x6430c){if(_0x410975[_0x00f8('0x47')]['id']){delete _0x410975[_0x00f8('0x47')]['id'];}return db['FreshdeskConfiguration'][_0x00f8('0x4b')]({'where':{'id':_0x410975[_0x00f8('0x42')]['id']}})[_0x00f8('0x24')](handleEntityNotFound(_0x4a78be,null))['then'](function(_0x51681b){if(_0x51681b){return _0x51681b[_0x00f8('0x52')](_0x410975[_0x00f8('0x47')]['ids']||[]);}return null;})['then'](respondWithResult(_0x4a78be,null))[_0x00f8('0x40')](handleError(_0x4a78be,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 5c1c420..5909000 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 _0xfbe8=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','util','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfbe8,0x162));var _0x8fbe=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xfbe8[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x8fbe('0x0'));var logger=require('../../config/logger')(_0x8fbe('0x1'));var moment=require(_0x8fbe('0x2'));var BPromise=require(_0x8fbe('0x3'));var rp=require(_0x8fbe('0x4'));var fs=require('fs');var path=require(_0x8fbe('0x5'));var rimraf=require(_0x8fbe('0x6'));var config=require(_0x8fbe('0x7'));var attributes=require(_0x8fbe('0x8'));module['exports']=function(_0x53bb14,_0x1d8020){return _0x53bb14[_0x8fbe('0x9')](_0x8fbe('0xa'),attributes,{'tableName':_0x8fbe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bb7=['exports','define','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x4e1211,_0x3babe2){var _0x2ffc28=function(_0x4febf4){while(--_0x4febf4){_0x4e1211['push'](_0x4e1211['shift']());}};_0x2ffc28(++_0x3babe2);}(_0x9bb7,0x1e4));var _0x79bb=function(_0x4109e7,_0x2c8158){_0x4109e7=_0x4109e7-0x0;var _0x28d807=_0x9bb7[_0x4109e7];return _0x28d807;};'use strict';var _=require(_0x79bb('0x0'));var util=require(_0x79bb('0x1'));var logger=require(_0x79bb('0x2'))(_0x79bb('0x3'));var moment=require(_0x79bb('0x4'));var BPromise=require(_0x79bb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x79bb('0x6'));var rimraf=require(_0x79bb('0x7'));var config=require(_0x79bb('0x8'));var attributes=require(_0x79bb('0x9'));module[_0x79bb('0xa')]=function(_0x25eed1,_0x4999e0){return _0x25eed1[_0x79bb('0xb')]('FreshdeskConfiguration',attributes,{'tableName':_0x79bb('0xc'),'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 02d6839..d5f9360 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 _0xc757=['FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info'];(function(_0x241ef5,_0x17f16a){var _0x2e72e7=function(_0x3cf233){while(--_0x3cf233){_0x241ef5['push'](_0x241ef5['shift']());}};_0x2e72e7(++_0x17f16a);}(_0xc757,0x1d4));var _0x7c75=function(_0x2844de,_0x560469){_0x2844de=_0x2844de-0x0;var _0x37be61=_0xc757[_0x2844de];return _0x37be61;};'use strict';var _=require(_0x7c75('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7c75('0x1'));var rs=require(_0x7c75('0x2'));var fs=require('fs');var Redis=require(_0x7c75('0x3'));var db=require(_0x7c75('0x4'))['db'];var utils=require(_0x7c75('0x5'));var logger=require(_0x7c75('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7c75('0x7')][_0x7c75('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59e62c,_0x432ba1,_0x1cea0b){return new BPromise(function(_0x314786,_0x1fdb21){return client[_0x7c75('0x9')](_0x59e62c,_0x1cea0b)[_0x7c75('0xa')](function(_0x2bdcf4){logger[_0x7c75('0xb')](_0x7c75('0xc'),_0x432ba1,_0x7c75('0xd'));logger[_0x7c75('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x432ba1,_0x7c75('0xd'),JSON['stringify'](_0x2bdcf4));if(_0x2bdcf4[_0x7c75('0xf')]){if(_0x2bdcf4['error'][_0x7c75('0x10')]===0x1f4){logger[_0x7c75('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x432ba1,_0x2bdcf4[_0x7c75('0xf')][_0x7c75('0x11')]);return _0x1fdb21(_0x2bdcf4['error'][_0x7c75('0x11')]);}logger[_0x7c75('0xf')](_0x7c75('0xc'),_0x432ba1,_0x2bdcf4[_0x7c75('0xf')][_0x7c75('0x11')]);return _0x314786(_0x2bdcf4[_0x7c75('0xf')][_0x7c75('0x11')]);}else{logger[_0x7c75('0xb')](_0x7c75('0xc'),_0x432ba1,_0x7c75('0xd'));_0x314786(_0x2bdcf4[_0x7c75('0x12')][_0x7c75('0x11')]);}})[_0x7c75('0x13')](function(_0x4b53fc){logger[_0x7c75('0xf')](_0x7c75('0xc'),_0x432ba1,_0x4b53fc);_0x1fdb21(_0x4b53fc);});});} \ No newline at end of file +var _0xeaa7=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','util','moment','bluebird','randomstring'];(function(_0x28adcd,_0x2e18bd){var _0x350638=function(_0x55d523){while(--_0x55d523){_0x28adcd['push'](_0x28adcd['shift']());}};_0x350638(++_0x2e18bd);}(_0xeaa7,0x1c8));var _0x7eaa=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0xeaa7[_0x43d16c];return _0x208cce;};'use strict';var _=require('lodash');var util=require(_0x7eaa('0x0'));var moment=require(_0x7eaa('0x1'));var BPromise=require(_0x7eaa('0x2'));var rs=require(_0x7eaa('0x3'));var fs=require('fs');var Redis=require(_0x7eaa('0x4'));var db=require(_0x7eaa('0x5'))['db'];var utils=require(_0x7eaa('0x6'));var logger=require('../../config/logger')(_0x7eaa('0x7'));var config=require(_0x7eaa('0x8'));var jayson=require(_0x7eaa('0x9'));var client=jayson[_0x7eaa('0xa')][_0x7eaa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22c91d,_0x186d66,_0x24162c){return new BPromise(function(_0x46e0c4,_0x118146){return client[_0x7eaa('0xc')](_0x22c91d,_0x24162c)[_0x7eaa('0xd')](function(_0x9a090d){logger[_0x7eaa('0xe')](_0x7eaa('0xf'),_0x186d66,'request\x20sent');logger[_0x7eaa('0x10')](_0x7eaa('0x11'),_0x186d66,_0x7eaa('0x12'),JSON['stringify'](_0x9a090d));if(_0x9a090d[_0x7eaa('0x13')]){if(_0x9a090d['error'][_0x7eaa('0x14')]===0x1f4){logger[_0x7eaa('0x13')](_0x7eaa('0xf'),_0x186d66,_0x9a090d[_0x7eaa('0x13')][_0x7eaa('0x15')]);return _0x118146(_0x9a090d[_0x7eaa('0x13')][_0x7eaa('0x15')]);}logger[_0x7eaa('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x186d66,_0x9a090d[_0x7eaa('0x13')][_0x7eaa('0x15')]);return _0x46e0c4(_0x9a090d[_0x7eaa('0x13')][_0x7eaa('0x15')]);}else{logger[_0x7eaa('0xe')](_0x7eaa('0xf'),_0x186d66,_0x7eaa('0x12'));_0x46e0c4(_0x9a090d['result'][_0x7eaa('0x15')]);}})[_0x7eaa('0x16')](function(_0x53f1eb){logger[_0x7eaa('0x13')](_0x7eaa('0xf'),_0x186d66,_0x53f1eb);_0x118146(_0x53f1eb);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index c8e4fbc..ef92fd3 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 _0x5176=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x3d7056,_0xbb4258){var _0x464a0f=function(_0x4a7fdf){while(--_0x4a7fdf){_0x3d7056['push'](_0x3d7056['shift']());}};_0x464a0f(++_0xbb4258);}(_0x5176,0x179));var _0x6517=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5176[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x6517('0x0'));var path=require(_0x6517('0x1'));var timeout=require(_0x6517('0x2'));var express=require(_0x6517('0x3'));var router=express[_0x6517('0x4')]();var fs_extra=require(_0x6517('0x5'));var auth=require(_0x6517('0x6'));var interaction=require(_0x6517('0x7'));var config=require(_0x6517('0x8'));var controller=require('./intFreshdeskField.controller');router[_0x6517('0x9')]('/',auth[_0x6517('0xa')](),controller[_0x6517('0xb')]);router[_0x6517('0x9')]('/:id',auth[_0x6517('0xa')](),controller[_0x6517('0xc')]);router[_0x6517('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6517('0xe')](_0x6517('0xf'),auth['isAuthenticated'](),controller[_0x6517('0x10')]);router[_0x6517('0x11')](_0x6517('0xf'),auth[_0x6517('0xa')](),controller[_0x6517('0x12')]);module[_0x6517('0x13')]=router; \ No newline at end of file +var _0xc732=['../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','/:id','isAuthenticated','show','create','put','destroy','multer','util','connect-timeout','express','fs-extra'];(function(_0x45cd59,_0x5be7c0){var _0x39541a=function(_0xab724a){while(--_0xab724a){_0x45cd59['push'](_0x45cd59['shift']());}};_0x39541a(++_0x5be7c0);}(_0xc732,0xbe));var _0x2c73=function(_0x571a0c,_0x2130ed){_0x571a0c=_0x571a0c-0x0;var _0x1c2eca=_0xc732[_0x571a0c];return _0x1c2eca;};'use strict';var multer=require(_0x2c73('0x0'));var util=require(_0x2c73('0x1'));var path=require('path');var timeout=require(_0x2c73('0x2'));var express=require(_0x2c73('0x3'));var router=express['Router']();var fs_extra=require(_0x2c73('0x4'));var auth=require(_0x2c73('0x5'));var interaction=require(_0x2c73('0x6'));var config=require('../../config/environment');var controller=require(_0x2c73('0x7'));router[_0x2c73('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2c73('0x8')](_0x2c73('0x9'),auth[_0x2c73('0xa')](),controller[_0x2c73('0xb')]);router['post']('/',auth[_0x2c73('0xa')](),controller[_0x2c73('0xc')]);router[_0x2c73('0xd')](_0x2c73('0x9'),auth[_0x2c73('0xa')](),controller['update']);router['delete'](_0x2c73('0x9'),auth[_0x2c73('0xa')](),controller[_0x2c73('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 33bf0c1..24670f7 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 _0xaf3d=['sequelize','exports','string','variable','keyValue','STRING','ENUM','BOOLEAN'];(function(_0x692ffb,_0xf40122){var _0x473fad=function(_0x4be1d5){while(--_0x4be1d5){_0x692ffb['push'](_0x692ffb['shift']());}};_0x473fad(++_0xf40122);}(_0xaf3d,0x1e8));var _0xdaf3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaf3d[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xdaf3('0x0'));module[_0xdaf3('0x1')]={'type':{'type':Sequelize['ENUM'](_0xdaf3('0x2'),_0xdaf3('0x3'),'customVariable',_0xdaf3('0x4'),'picklist'),'defaultValue':_0xdaf3('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdaf3('0x5')]},'keyType':{'type':Sequelize[_0xdaf3('0x6')]('string',_0xdaf3('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xdaf3('0x5')]},'idField':{'type':Sequelize[_0xdaf3('0x5')]},'nameField':{'type':Sequelize[_0xdaf3('0x5')]},'customField':{'type':Sequelize[_0xdaf3('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdaf3('0x5')]}}; \ No newline at end of file +var _0x58e5=['variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','string'];(function(_0x2ebfb2,_0x44f875){var _0x4db0ef=function(_0x4d0d12){while(--_0x4d0d12){_0x2ebfb2['push'](_0x2ebfb2['shift']());}};_0x4db0ef(++_0x44f875);}(_0x58e5,0x115));var _0x558e=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x58e5[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require(_0x558e('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x558e('0x1'),_0x558e('0x2'),_0x558e('0x3'),_0x558e('0x4'),_0x558e('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x558e('0x6')]},'keyType':{'type':Sequelize[_0x558e('0x7')](_0x558e('0x1'),_0x558e('0x2'),_0x558e('0x3'))},'keyContent':{'type':Sequelize[_0x558e('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x558e('0x6')]},'customField':{'type':Sequelize[_0x558e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x558e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 607fabc..299d22f 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 _0x574d=['reject','save','update','then','destroy','error','name','send','map','FreshdeskField','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','findAll','catch','show','params','includeAll','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x55f455,_0x1e46c7){var _0x2a50a9=function(_0x2a79a5){while(--_0x2a79a5){_0x55f455['push'](_0x55f455['shift']());}};_0x2a50a9(++_0x1e46c7);}(_0x574d,0xc0));var _0xd574=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x574d[_0x1e4360];return _0x31e6b4;};'use strict';var emlformat=require(_0xd574('0x0'));var rimraf=require(_0xd574('0x1'));var zipdir=require(_0xd574('0x2'));var jsonpatch=require(_0xd574('0x3'));var rp=require(_0xd574('0x4'));var moment=require(_0xd574('0x5'));var BPromise=require(_0xd574('0x6'));var Mustache=require('mustache');var util=require(_0xd574('0x7'));var path=require(_0xd574('0x8'));var sox=require(_0xd574('0x9'));var csv=require(_0xd574('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd574('0xb'));var _=require(_0xd574('0xc'));var squel=require(_0xd574('0xd'));var crypto=require(_0xd574('0xe'));var jsforce=require(_0xd574('0xf'));var deskjs=require(_0xd574('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd574('0x11'));var Redis=require(_0xd574('0x12'));var authService=require(_0xd574('0x13'));var qs=require(_0xd574('0x14'));var as=require(_0xd574('0x15'));var hardwareService=require(_0xd574('0x16'));var logger=require(_0xd574('0x17'))('api');var utils=require(_0xd574('0x18'));var config=require(_0xd574('0x19'));var licenseUtil=require(_0xd574('0x1a'));var db=require(_0xd574('0x1b'))['db'];function respondWithStatusCode(_0x1ddedb,_0x6c93de){_0x6c93de=_0x6c93de||0xcc;return function(_0x8dd760){if(_0x8dd760){return _0x1ddedb[_0xd574('0x1c')](_0x6c93de);}return _0x1ddedb[_0xd574('0x1d')](_0x6c93de)[_0xd574('0x1e')]();};}function respondWithResult(_0x43e251,_0x2cc660){_0x2cc660=_0x2cc660||0xc8;return function(_0x564b36){if(_0x564b36){return _0x43e251[_0xd574('0x1d')](_0x2cc660)[_0xd574('0x1f')](_0x564b36);}};}function respondWithFilteredResult(_0x2d66be,_0x1537f4){return function(_0x46fb4c){if(_0x46fb4c){var _0x341463=typeof _0x1537f4[_0xd574('0x20')]===_0xd574('0x21')&&typeof _0x1537f4['limit']==='undefined';var _0x1486c7=_0x46fb4c[_0xd574('0x22')];var _0x2ac01d=_0x341463?0x0:_0x1537f4['offset'];var _0x58a74b=_0x341463?_0x46fb4c[_0xd574('0x22')]:_0x1537f4[_0xd574('0x20')]+_0x1537f4[_0xd574('0x23')];var _0x46e331;if(_0x58a74b>=_0x1486c7){_0x58a74b=_0x1486c7;_0x46e331=0xc8;}else{_0x46e331=0xce;}_0x2d66be[_0xd574('0x1d')](_0x46e331);return _0x2d66be[_0xd574('0x24')](_0xd574('0x25'),_0x2ac01d+'-'+_0x58a74b+'/'+_0x1486c7)[_0xd574('0x1f')](_0x46fb4c);}return null;};}function patchUpdates(_0xefe45f){return function(_0x9f980d){try{jsonpatch[_0xd574('0x26')](_0x9f980d,_0xefe45f,!![]);}catch(_0x587f62){return BPromise[_0xd574('0x27')](_0x587f62);}return _0x9f980d[_0xd574('0x28')]();};}function saveUpdates(_0x481564,_0x39c39d){return function(_0x5e5b9f){if(_0x5e5b9f){return _0x5e5b9f[_0xd574('0x29')](_0x481564)[_0xd574('0x2a')](function(_0x199756){return _0x199756;});}return null;};}function removeEntity(_0x3f85cf,_0x1aec00){return function(_0x72d2b8){if(_0x72d2b8){return _0x72d2b8[_0xd574('0x2b')]()[_0xd574('0x2a')](function(){_0x3f85cf[_0xd574('0x1d')](0xcc)[_0xd574('0x1e')]();});}};}function handleEntityNotFound(_0x1fbd81,_0x44ddae){return function(_0x3e0501){if(!_0x3e0501){_0x1fbd81[_0xd574('0x1c')](0x194);}return _0x3e0501;};}function handleError(_0x5f1456,_0x441f13){_0x441f13=_0x441f13||0x1f4;return function(_0x53142f){logger[_0xd574('0x2c')](_0x53142f['stack']);if(_0x53142f['name']){delete _0x53142f[_0xd574('0x2d')];}_0x5f1456[_0xd574('0x1d')](_0x441f13)[_0xd574('0x2e')](_0x53142f);};}exports['index']=function(_0x2a8e86,_0x30e49e){var _0x8eefda={},_0x9761f5={},_0x508eaa={'count':0x0,'rows':[]};var _0x5298d7=_[_0xd574('0x2f')](db[_0xd574('0x30')][_0xd574('0x31')],function(_0x23a495){return{'name':_0x23a495[_0xd574('0x32')],'type':_0x23a495[_0xd574('0x33')]['key']};});_0x9761f5['model']=_[_0xd574('0x2f')](_0x5298d7,_0xd574('0x2d'));_0x9761f5[_0xd574('0x34')]=_[_0xd574('0x35')](_0x2a8e86[_0xd574('0x34')]);_0x9761f5[_0xd574('0x36')]=_[_0xd574('0x37')](_0x9761f5[_0xd574('0x38')],_0x9761f5['query']);_0x8eefda['attributes']=_[_0xd574('0x37')](_0x9761f5[_0xd574('0x38')],qs[_0xd574('0x39')](_0x2a8e86[_0xd574('0x34')][_0xd574('0x39')]));_0x8eefda['attributes']=_0x8eefda[_0xd574('0x3a')][_0xd574('0x3b')]?_0x8eefda[_0xd574('0x3a')]:_0x9761f5[_0xd574('0x38')];if(!_0x2a8e86[_0xd574('0x34')][_0xd574('0x3c')](_0xd574('0x3d'))){_0x8eefda['limit']=qs[_0xd574('0x23')](_0x2a8e86['query'][_0xd574('0x23')]);_0x8eefda[_0xd574('0x20')]=qs[_0xd574('0x20')](_0x2a8e86[_0xd574('0x34')][_0xd574('0x20')]);}_0x8eefda[_0xd574('0x3e')]=qs[_0xd574('0x3f')](_0x2a8e86[_0xd574('0x34')][_0xd574('0x3f')]);_0x8eefda[_0xd574('0x40')]=qs[_0xd574('0x36')](_['pick'](_0x2a8e86[_0xd574('0x34')],_0x9761f5[_0xd574('0x36')]),_0x5298d7);if(_0x2a8e86[_0xd574('0x34')]['filter']){_0x8eefda[_0xd574('0x40')]=_[_0xd574('0x41')](_0x8eefda[_0xd574('0x40')],{'$or':_[_0xd574('0x2f')](_0x5298d7,function(_0x15d429){if(_0x15d429[_0xd574('0x33')]!=='VIRTUAL'){var _0x1dbeb9={};_0x1dbeb9[_0x15d429[_0xd574('0x2d')]]={'$like':'%'+_0x2a8e86[_0xd574('0x34')][_0xd574('0x42')]+'%'};return _0x1dbeb9;}})});}_0x8eefda=_[_0xd574('0x41')]({},_0x8eefda,_0x2a8e86['options']);var _0x3f79c4={'where':_0x8eefda[_0xd574('0x40')]};return db[_0xd574('0x30')]['count'](_0x3f79c4)['then'](function(_0x4a0e67){_0x508eaa[_0xd574('0x22')]=_0x4a0e67;if(_0x2a8e86['query']['includeAll']){_0x8eefda['include']=[{'all':!![]}];}return db[_0xd574('0x30')][_0xd574('0x43')](_0x8eefda);})[_0xd574('0x2a')](function(_0x20b570){_0x508eaa['rows']=_0x20b570;return _0x508eaa;})[_0xd574('0x2a')](respondWithFilteredResult(_0x30e49e,_0x8eefda))[_0xd574('0x44')](handleError(_0x30e49e,null));};exports[_0xd574('0x45')]=function(_0x411ecb,_0x4a580c){var _0x1bf7c5={'raw':!![],'where':{'id':_0x411ecb[_0xd574('0x46')]['id']}},_0x4caf06={};_0x4caf06[_0xd574('0x38')]=_[_0xd574('0x35')](db[_0xd574('0x30')][_0xd574('0x31')]);_0x4caf06[_0xd574('0x34')]=_[_0xd574('0x35')](_0x411ecb[_0xd574('0x34')]);_0x4caf06[_0xd574('0x36')]=_[_0xd574('0x37')](_0x4caf06[_0xd574('0x38')],_0x4caf06[_0xd574('0x34')]);_0x1bf7c5[_0xd574('0x3a')]=_['intersection'](_0x4caf06[_0xd574('0x38')],qs['fields'](_0x411ecb['query'][_0xd574('0x39')]));_0x1bf7c5[_0xd574('0x3a')]=_0x1bf7c5['attributes'][_0xd574('0x3b')]?_0x1bf7c5[_0xd574('0x3a')]:_0x4caf06[_0xd574('0x38')];if(_0x411ecb['query'][_0xd574('0x47')]){_0x1bf7c5[_0xd574('0x48')]=[{'all':!![]}];}_0x1bf7c5=_[_0xd574('0x41')]({},_0x1bf7c5,_0x411ecb[_0xd574('0x49')]);return db[_0xd574('0x30')][_0xd574('0x4a')](_0x1bf7c5)['then'](handleEntityNotFound(_0x4a580c,null))[_0xd574('0x2a')](respondWithResult(_0x4a580c,null))[_0xd574('0x44')](handleError(_0x4a580c,null));};exports[_0xd574('0x4b')]=function(_0x8c305c,_0x14d08b){return db[_0xd574('0x30')][_0xd574('0x4b')](_0x8c305c[_0xd574('0x4c')],{})[_0xd574('0x2a')](respondWithResult(_0x14d08b,0xc9))[_0xd574('0x44')](handleError(_0x14d08b,null));};exports[_0xd574('0x29')]=function(_0x3aa4e6,_0x1cad77){if(_0x3aa4e6[_0xd574('0x4c')]['id']){delete _0x3aa4e6[_0xd574('0x4c')]['id'];}return db[_0xd574('0x30')]['find']({'where':{'id':_0x3aa4e6[_0xd574('0x46')]['id']}})[_0xd574('0x2a')](handleEntityNotFound(_0x1cad77,null))['then'](saveUpdates(_0x3aa4e6[_0xd574('0x4c')],null))[_0xd574('0x2a')](respondWithResult(_0x1cad77,null))[_0xd574('0x44')](handleError(_0x1cad77,null));};exports[_0xd574('0x2b')]=function(_0x2fcf85,_0x1426fb){return db[_0xd574('0x30')][_0xd574('0x4a')]({'where':{'id':_0x2fcf85[_0xd574('0x46')]['id']}})[_0xd574('0x2a')](handleEntityNotFound(_0x1426fb,null))['then'](removeEntity(_0x1426fb,null))[_0xd574('0x44')](handleError(_0x1426fb,null));}; \ No newline at end of file +var _0x76dc=['body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../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','json','apply','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','FreshdeskField','includeAll','include','rows','params','options','find','catch','create'];(function(_0x26c3cb,_0x3e5baa){var _0x1811da=function(_0x5af8bb){while(--_0x5af8bb){_0x26c3cb['push'](_0x26c3cb['shift']());}};_0x1811da(++_0x3e5baa);}(_0x76dc,0x1f2));var _0xc76d=function(_0x5f1995,_0x25aa95){_0x5f1995=_0x5f1995-0x0;var _0x1a14da=_0x76dc[_0x5f1995];return _0x1a14da;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require(_0xc76d('0x3'));var rp=require('request-promise');var moment=require(_0xc76d('0x4'));var BPromise=require(_0xc76d('0x5'));var Mustache=require('mustache');var util=require(_0xc76d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc76d('0x7'));var ejs=require(_0xc76d('0x8'));var fs=require('fs');var fs_extra=require(_0xc76d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc76d('0xa'));var jsforce=require(_0xc76d('0xb'));var deskjs=require(_0xc76d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc76d('0xd'));var Redis=require(_0xc76d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc76d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc76d('0x10'));var logger=require(_0xc76d('0x11'))(_0xc76d('0x12'));var utils=require(_0xc76d('0x13'));var config=require(_0xc76d('0x14'));var licenseUtil=require(_0xc76d('0x15'));var db=require(_0xc76d('0x16'))['db'];function respondWithStatusCode(_0x2e02e9,_0x1722b3){_0x1722b3=_0x1722b3||0xcc;return function(_0x311814){if(_0x311814){return _0x2e02e9[_0xc76d('0x17')](_0x1722b3);}return _0x2e02e9[_0xc76d('0x18')](_0x1722b3)[_0xc76d('0x19')]();};}function respondWithResult(_0x3ed1bd,_0x5cda20){_0x5cda20=_0x5cda20||0xc8;return function(_0x8696db){if(_0x8696db){return _0x3ed1bd[_0xc76d('0x18')](_0x5cda20)['json'](_0x8696db);}};}function respondWithFilteredResult(_0x4741a4,_0x2d23d2){return function(_0x47a4ee){if(_0x47a4ee){var _0x6f94e=typeof _0x2d23d2['offset']===_0xc76d('0x1a')&&typeof _0x2d23d2['limit']==='undefined';var _0x45a83e=_0x47a4ee[_0xc76d('0x1b')];var _0x339623=_0x6f94e?0x0:_0x2d23d2[_0xc76d('0x1c')];var _0xd1d16f=_0x6f94e?_0x47a4ee['count']:_0x2d23d2[_0xc76d('0x1c')]+_0x2d23d2[_0xc76d('0x1d')];var _0xa0c5b6;if(_0xd1d16f>=_0x45a83e){_0xd1d16f=_0x45a83e;_0xa0c5b6=0xc8;}else{_0xa0c5b6=0xce;}_0x4741a4[_0xc76d('0x18')](_0xa0c5b6);return _0x4741a4[_0xc76d('0x1e')]('Content-Range',_0x339623+'-'+_0xd1d16f+'/'+_0x45a83e)[_0xc76d('0x1f')](_0x47a4ee);}return null;};}function patchUpdates(_0x324db7){return function(_0x5dffde){try{jsonpatch[_0xc76d('0x20')](_0x5dffde,_0x324db7,!![]);}catch(_0x777f22){return BPromise[_0xc76d('0x21')](_0x777f22);}return _0x5dffde[_0xc76d('0x22')]();};}function saveUpdates(_0x18f546,_0x3d357b){return function(_0x42b89c){if(_0x42b89c){return _0x42b89c[_0xc76d('0x23')](_0x18f546)[_0xc76d('0x24')](function(_0x20e09c){return _0x20e09c;});}return null;};}function removeEntity(_0x15328d,_0x5de11f){return function(_0x11b42f){if(_0x11b42f){return _0x11b42f[_0xc76d('0x25')]()['then'](function(){_0x15328d[_0xc76d('0x18')](0xcc)[_0xc76d('0x19')]();});}};}function handleEntityNotFound(_0x55ca79,_0x374b9e){return function(_0x476aee){if(!_0x476aee){_0x55ca79[_0xc76d('0x17')](0x194);}return _0x476aee;};}function handleError(_0xd1dda0,_0xfc4aea){_0xfc4aea=_0xfc4aea||0x1f4;return function(_0x1949c4){logger[_0xc76d('0x26')](_0x1949c4['stack']);if(_0x1949c4['name']){delete _0x1949c4[_0xc76d('0x27')];}_0xd1dda0[_0xc76d('0x18')](_0xfc4aea)['send'](_0x1949c4);};}exports[_0xc76d('0x28')]=function(_0x52a79a,_0x64899f){var _0x49fa89={},_0x2039f4={},_0x5cf2e4={'count':0x0,'rows':[]};var _0x13b468=_[_0xc76d('0x29')](db['FreshdeskField'][_0xc76d('0x2a')],function(_0x1c68f3){return{'name':_0x1c68f3[_0xc76d('0x2b')],'type':_0x1c68f3[_0xc76d('0x2c')]['key']};});_0x2039f4[_0xc76d('0x2d')]=_['map'](_0x13b468,_0xc76d('0x27'));_0x2039f4['query']=_[_0xc76d('0x2e')](_0x52a79a[_0xc76d('0x2f')]);_0x2039f4['filters']=_['intersection'](_0x2039f4['model'],_0x2039f4['query']);_0x49fa89[_0xc76d('0x30')]=_[_0xc76d('0x31')](_0x2039f4[_0xc76d('0x2d')],qs[_0xc76d('0x32')](_0x52a79a[_0xc76d('0x2f')]['fields']));_0x49fa89[_0xc76d('0x30')]=_0x49fa89['attributes'][_0xc76d('0x33')]?_0x49fa89['attributes']:_0x2039f4[_0xc76d('0x2d')];if(!_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x34')](_0xc76d('0x35'))){_0x49fa89[_0xc76d('0x1d')]=qs['limit'](_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x1d')]);_0x49fa89[_0xc76d('0x1c')]=qs['offset'](_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x1c')]);}_0x49fa89[_0xc76d('0x36')]=qs['sort'](_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x37')]);_0x49fa89[_0xc76d('0x38')]=qs[_0xc76d('0x39')](_[_0xc76d('0x3a')](_0x52a79a[_0xc76d('0x2f')],_0x2039f4['filters']),_0x13b468);if(_0x52a79a['query'][_0xc76d('0x3b')]){_0x49fa89['where']=_[_0xc76d('0x3c')](_0x49fa89[_0xc76d('0x38')],{'$or':_[_0xc76d('0x29')](_0x13b468,function(_0x1925a1){if(_0x1925a1['type']!=='VIRTUAL'){var _0xc907eb={};_0xc907eb[_0x1925a1[_0xc76d('0x27')]]={'$like':'%'+_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x3b')]+'%'};return _0xc907eb;}})});}_0x49fa89=_[_0xc76d('0x3c')]({},_0x49fa89,_0x52a79a['options']);var _0x42404c={'where':_0x49fa89[_0xc76d('0x38')]};return db[_0xc76d('0x3d')][_0xc76d('0x1b')](_0x42404c)[_0xc76d('0x24')](function(_0x78e14a){_0x5cf2e4[_0xc76d('0x1b')]=_0x78e14a;if(_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x3e')]){_0x49fa89[_0xc76d('0x3f')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x49fa89);})[_0xc76d('0x24')](function(_0x2a0759){_0x5cf2e4[_0xc76d('0x40')]=_0x2a0759;return _0x5cf2e4;})[_0xc76d('0x24')](respondWithFilteredResult(_0x64899f,_0x49fa89))['catch'](handleError(_0x64899f,null));};exports['show']=function(_0x45be72,_0x13a895){var _0x3e471e={'raw':!![],'where':{'id':_0x45be72[_0xc76d('0x41')]['id']}},_0x15eb42={};_0x15eb42[_0xc76d('0x2d')]=_[_0xc76d('0x2e')](db[_0xc76d('0x3d')]['rawAttributes']);_0x15eb42[_0xc76d('0x2f')]=_[_0xc76d('0x2e')](_0x45be72[_0xc76d('0x2f')]);_0x15eb42[_0xc76d('0x39')]=_['intersection'](_0x15eb42['model'],_0x15eb42['query']);_0x3e471e['attributes']=_['intersection'](_0x15eb42['model'],qs['fields'](_0x45be72[_0xc76d('0x2f')][_0xc76d('0x32')]));_0x3e471e[_0xc76d('0x30')]=_0x3e471e[_0xc76d('0x30')][_0xc76d('0x33')]?_0x3e471e[_0xc76d('0x30')]:_0x15eb42[_0xc76d('0x2d')];if(_0x45be72[_0xc76d('0x2f')]['includeAll']){_0x3e471e[_0xc76d('0x3f')]=[{'all':!![]}];}_0x3e471e=_[_0xc76d('0x3c')]({},_0x3e471e,_0x45be72[_0xc76d('0x42')]);return db[_0xc76d('0x3d')][_0xc76d('0x43')](_0x3e471e)[_0xc76d('0x24')](handleEntityNotFound(_0x13a895,null))[_0xc76d('0x24')](respondWithResult(_0x13a895,null))[_0xc76d('0x44')](handleError(_0x13a895,null));};exports[_0xc76d('0x45')]=function(_0x4fb26e,_0x5b41d3){return db[_0xc76d('0x3d')][_0xc76d('0x45')](_0x4fb26e[_0xc76d('0x46')],{})[_0xc76d('0x24')](respondWithResult(_0x5b41d3,0xc9))[_0xc76d('0x44')](handleError(_0x5b41d3,null));};exports['update']=function(_0x25fc9d,_0x1ede13){if(_0x25fc9d['body']['id']){delete _0x25fc9d['body']['id'];}return db[_0xc76d('0x3d')][_0xc76d('0x43')]({'where':{'id':_0x25fc9d['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x1ede13,null))[_0xc76d('0x24')](saveUpdates(_0x25fc9d[_0xc76d('0x46')],null))[_0xc76d('0x24')](respondWithResult(_0x1ede13,null))[_0xc76d('0x44')](handleError(_0x1ede13,null));};exports[_0xc76d('0x25')]=function(_0x25a549,_0x10b1b0){return db[_0xc76d('0x3d')][_0xc76d('0x43')]({'where':{'id':_0x25a549['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x10b1b0,null))[_0xc76d('0x24')](removeEntity(_0x10b1b0,null))[_0xc76d('0x44')](handleError(_0x10b1b0,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 60ba6dd..4ce7753 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 _0x95ce=['exports','define','FreshdeskField','int_freshdesk_fields','FieldId','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x95ce,0x1e6));var _0xe95c=function(_0x5131e4,_0x145fa4){_0x5131e4=_0x5131e4-0x0;var _0x254c6c=_0x95ce[_0x5131e4];return _0x254c6c;};'use strict';var _=require('lodash');var util=require(_0xe95c('0x0'));var logger=require(_0xe95c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe95c('0x2'));var rp=require(_0xe95c('0x3'));var fs=require('fs');var path=require(_0xe95c('0x4'));var rimraf=require(_0xe95c('0x5'));var config=require(_0xe95c('0x6'));var attributes=require(_0xe95c('0x7'));module[_0xe95c('0x8')]=function(_0x423077,_0x5277d2){return _0x423077[_0xe95c('0x9')](_0xe95c('0xa'),attributes,{'tableName':_0xe95c('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0xe95c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf9a2=['exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x18f311,_0x6775ed){var _0x15d8e1=function(_0x28725d){while(--_0x28725d){_0x18f311['push'](_0x18f311['shift']());}};_0x15d8e1(++_0x6775ed);}(_0xf9a2,0xf4));var _0x2f9a=function(_0x23d42e,_0x2927ed){_0x23d42e=_0x23d42e-0x0;var _0x50e66f=_0xf9a2[_0x23d42e];return _0x50e66f;};'use strict';var _=require(_0x2f9a('0x0'));var util=require(_0x2f9a('0x1'));var logger=require(_0x2f9a('0x2'))(_0x2f9a('0x3'));var moment=require(_0x2f9a('0x4'));var BPromise=require(_0x2f9a('0x5'));var rp=require(_0x2f9a('0x6'));var fs=require('fs');var path=require(_0x2f9a('0x7'));var rimraf=require(_0x2f9a('0x8'));var config=require(_0x2f9a('0x9'));var attributes=require(_0x2f9a('0xa'));module[_0x2f9a('0xb')]=function(_0x90179e,_0x5c05eb){return _0x90179e['define'](_0x2f9a('0xc'),attributes,{'tableName':_0x2f9a('0xd'),'paranoid':![],'indexes':[{'name':_0x2f9a('0xe'),'fields':[_0x2f9a('0xf'),_0x2f9a('0x10')],'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 189ec3e..c703568 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 _0xc0c1=['request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0xf88f4d,_0x3bd588){var _0x3dcfba=function(_0x139746){while(--_0x139746){_0xf88f4d['push'](_0xf88f4d['shift']());}};_0x3dcfba(++_0x3bd588);}(_0xc0c1,0x81));var _0x1c0c=function(_0x9641cb,_0x3bc3df){_0x9641cb=_0x9641cb-0x0;var _0x1a3294=_0xc0c1[_0x9641cb];return _0x1a3294;};'use strict';var _=require(_0x1c0c('0x0'));var util=require(_0x1c0c('0x1'));var moment=require('moment');var BPromise=require(_0x1c0c('0x2'));var rs=require(_0x1c0c('0x3'));var fs=require('fs');var Redis=require(_0x1c0c('0x4'));var db=require(_0x1c0c('0x5'))['db'];var utils=require(_0x1c0c('0x6'));var logger=require('../../config/logger')(_0x1c0c('0x7'));var config=require(_0x1c0c('0x8'));var jayson=require(_0x1c0c('0x9'));var client=jayson[_0x1c0c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12c78b,_0x3f9631,_0x1f4bd4){return new BPromise(function(_0x38fdd1,_0x5a8957){return client[_0x1c0c('0xb')](_0x12c78b,_0x1f4bd4)['then'](function(_0x13c0a9){logger[_0x1c0c('0xc')](_0x1c0c('0xd'),_0x3f9631,_0x1c0c('0xe'));logger['debug'](_0x1c0c('0xf'),_0x3f9631,_0x1c0c('0xe'),JSON[_0x1c0c('0x10')](_0x13c0a9));if(_0x13c0a9[_0x1c0c('0x11')]){if(_0x13c0a9[_0x1c0c('0x11')][_0x1c0c('0x12')]===0x1f4){logger[_0x1c0c('0x11')](_0x1c0c('0xd'),_0x3f9631,_0x13c0a9[_0x1c0c('0x11')]['message']);return _0x5a8957(_0x13c0a9[_0x1c0c('0x11')]['message']);}logger['error'](_0x1c0c('0xd'),_0x3f9631,_0x13c0a9[_0x1c0c('0x11')]['message']);return _0x38fdd1(_0x13c0a9['error'][_0x1c0c('0x13')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x3f9631,_0x1c0c('0xe'));_0x38fdd1(_0x13c0a9['result']['message']);}})['catch'](function(_0x51364d){logger[_0x1c0c('0x11')](_0x1c0c('0xd'),_0x3f9631,_0x51364d);_0x5a8957(_0x51364d);});});} \ No newline at end of file +var _0x27a5=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis'];(function(_0x547ff4,_0x416fa1){var _0xe41057=function(_0x1afe63){while(--_0x1afe63){_0x547ff4['push'](_0x547ff4['shift']());}};_0xe41057(++_0x416fa1);}(_0x27a5,0x96));var _0x527a=function(_0x440365,_0x25e9c5){_0x440365=_0x440365-0x0;var _0x376a89=_0x27a5[_0x440365];return _0x376a89;};'use strict';var _=require(_0x527a('0x0'));var util=require(_0x527a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x527a('0x2'));var fs=require('fs');var Redis=require(_0x527a('0x3'));var db=require(_0x527a('0x4'))['db'];var utils=require(_0x527a('0x5'));var logger=require('../../config/logger')(_0x527a('0x6'));var config=require(_0x527a('0x7'));var jayson=require(_0x527a('0x8'));var client=jayson[_0x527a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe9d745,_0x53a4e9,_0x3cb71e){return new BPromise(function(_0x1574e9,_0x49d29a){return client['request'](_0xe9d745,_0x3cb71e)[_0x527a('0xa')](function(_0x30eb29){logger['info'](_0x527a('0xb'),_0x53a4e9,_0x527a('0xc'));logger[_0x527a('0xd')](_0x527a('0xe'),_0x53a4e9,'request\x20sent',JSON[_0x527a('0xf')](_0x30eb29));if(_0x30eb29[_0x527a('0x10')]){if(_0x30eb29[_0x527a('0x10')][_0x527a('0x11')]===0x1f4){logger[_0x527a('0x10')](_0x527a('0xb'),_0x53a4e9,_0x30eb29[_0x527a('0x10')][_0x527a('0x12')]);return _0x49d29a(_0x30eb29['error'][_0x527a('0x12')]);}logger[_0x527a('0x10')](_0x527a('0xb'),_0x53a4e9,_0x30eb29[_0x527a('0x10')][_0x527a('0x12')]);return _0x1574e9(_0x30eb29[_0x527a('0x10')][_0x527a('0x12')]);}else{logger[_0x527a('0x13')](_0x527a('0xb'),_0x53a4e9,_0x527a('0xc'));_0x1574e9(_0x30eb29[_0x527a('0x14')][_0x527a('0x12')]);}})[_0x527a('0x15')](function(_0x260600){logger[_0x527a('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x53a4e9,_0x260600);_0x49d29a(_0x260600);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 4f6125a..d903c82 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(_0x300860,_0x509371){var _0x2094ad=function(_0x2090a2){while(--_0x2090a2){_0x300860['push'](_0x300860['shift']());}};_0x2094ad(++_0x509371);}(_0x9348,0x10d));var _0x8934=function(_0x45f4af,_0x1f902d){_0x45f4af=_0x45f4af-0x0;var _0x29f808=_0x9348[_0x45f4af];return _0x29f808;};'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 _0x2e54=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x2510f1,_0x271dd9){var _0x4f4ffd=function(_0x5a9ea7){while(--_0x5a9ea7){_0x2510f1['push'](_0x2510f1['shift']());}};_0x4f4ffd(++_0x271dd9);}(_0x2e54,0x1dd));var _0x42e5=function(_0x4f06ed,_0xb27315){_0x4f06ed=_0x4f06ed-0x0;var _0x349a59=_0x2e54[_0x4f06ed];return _0x349a59;};'use strict';var multer=require(_0x42e5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x42e5('0x1'));var express=require(_0x42e5('0x2'));var router=express[_0x42e5('0x3')]();var fs_extra=require(_0x42e5('0x4'));var auth=require(_0x42e5('0x5'));var interaction=require(_0x42e5('0x6'));var config=require(_0x42e5('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x42e5('0x8')]('/',auth[_0x42e5('0x9')](),controller[_0x42e5('0xa')]);router['get'](_0x42e5('0xb'),auth['isAuthenticated'](),controller[_0x42e5('0xc')]);router['get'](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0xe')]);router[_0x42e5('0x8')](_0x42e5('0xf'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x10')]);router[_0x42e5('0x11')]('/',auth[_0x42e5('0x9')](),controller['create']);router[_0x42e5('0x11')](_0x42e5('0xd'),auth['isAuthenticated'](),controller[_0x42e5('0x12')]);router[_0x42e5('0x13')](_0x42e5('0xb'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x14')]);router[_0x42e5('0x15')](_0x42e5('0xb'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x16')]);module[_0x42e5('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 3f305a3..b50255f 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 _0x4137=['STRING','username','remoteUri','sequelize','exports'];(function(_0x23bc41,_0x4d2165){var _0x228730=function(_0x1c911c){while(--_0x1c911c){_0x23bc41['push'](_0x23bc41['shift']());}};_0x228730(++_0x4d2165);}(_0x4137,0xf8));var _0x7413=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4137[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x7413('0x0'));module[_0x7413('0x1')]={'name':{'type':Sequelize[_0x7413('0x2')]},'description':{'type':Sequelize[_0x7413('0x2')]},'username':{'type':Sequelize[_0x7413('0x2')],'unique':_0x7413('0x3')},'apiKey':{'type':Sequelize[_0x7413('0x2')]},'remoteUri':{'type':Sequelize[_0x7413('0x2')],'unique':_0x7413('0x4')},'serverUrl':{'type':Sequelize[_0x7413('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x430c=['sequelize','STRING','username'];(function(_0x58a37a,_0x26c26f){var _0x5151bd=function(_0x37ac24){while(--_0x37ac24){_0x58a37a['push'](_0x58a37a['shift']());}};_0x5151bd(++_0x26c26f);}(_0x430c,0x1a1));var _0xc430=function(_0x4fe19c,_0x45d0fe){_0x4fe19c=_0x4fe19c-0x0;var _0x952ac7=_0x430c[_0x4fe19c];return _0x952ac7;};'use strict';var Sequelize=require(_0xc430('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc430('0x1')]},'username':{'type':Sequelize[_0xc430('0x1')],'unique':_0xc430('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 0587f6d..88565d7 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 _0x70dd=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','end','stack','name','send','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','FreshsalesAccount','includeAll','include','catch','params','options','create','body','find','destroy','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','getSubjects','Descriptions','channel','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x3596f9,_0x23ac87){var _0x13e16b=function(_0x1b9791){while(--_0x1b9791){_0x3596f9['push'](_0x3596f9['shift']());}};_0x13e16b(++_0x23ac87);}(_0x70dd,0x121));var _0xd70d=function(_0x2faa51,_0x17be07){_0x2faa51=_0x2faa51-0x0;var _0x41406a=_0x70dd[_0x2faa51];return _0x41406a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd70d('0x0'));var jsonpatch=require(_0xd70d('0x1'));var rp=require('request-promise');var moment=require(_0xd70d('0x2'));var BPromise=require(_0xd70d('0x3'));var Mustache=require(_0xd70d('0x4'));var util=require(_0xd70d('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd70d('0x6'));var fs=require('fs');var fs_extra=require(_0xd70d('0x7'));var _=require(_0xd70d('0x8'));var squel=require(_0xd70d('0x9'));var crypto=require(_0xd70d('0xa'));var jsforce=require(_0xd70d('0xb'));var deskjs=require(_0xd70d('0xc'));var toCsv=require(_0xd70d('0xd'));var querystring=require(_0xd70d('0xe'));var Papa=require(_0xd70d('0xf'));var Redis=require(_0xd70d('0x10'));var authService=require(_0xd70d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd70d('0x12'));var hardwareService=require(_0xd70d('0x13'));var logger=require('../../config/logger')(_0xd70d('0x14'));var utils=require(_0xd70d('0x15'));var config=require(_0xd70d('0x16'));var licenseUtil=require(_0xd70d('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x509511,_0x5a0d46){_0x5a0d46=_0x5a0d46||0xcc;return function(_0x4a3530){if(_0x4a3530){return _0x509511[_0xd70d('0x18')](_0x5a0d46);}return _0x509511[_0xd70d('0x19')](_0x5a0d46)['end']();};}function respondWithResult(_0x56abf6,_0x4522db){_0x4522db=_0x4522db||0xc8;return function(_0x624805){if(_0x624805){return _0x56abf6[_0xd70d('0x19')](_0x4522db)[_0xd70d('0x1a')](_0x624805);}};}function respondWithFilteredResult(_0x42b93c,_0x3508a1){return function(_0x3dbf08){if(_0x3dbf08){var _0x40fe43=typeof _0x3508a1['offset']===_0xd70d('0x1b')&&typeof _0x3508a1[_0xd70d('0x1c')]===_0xd70d('0x1b');var _0x2b3894=_0x3dbf08[_0xd70d('0x1d')];var _0x484c7f=_0x40fe43?0x0:_0x3508a1[_0xd70d('0x1e')];var _0x4348f6=_0x40fe43?_0x3dbf08[_0xd70d('0x1d')]:_0x3508a1[_0xd70d('0x1e')]+_0x3508a1['limit'];var _0x364f0a;if(_0x4348f6>=_0x2b3894){_0x4348f6=_0x2b3894;_0x364f0a=0xc8;}else{_0x364f0a=0xce;}_0x42b93c['status'](_0x364f0a);return _0x42b93c[_0xd70d('0x1f')](_0xd70d('0x20'),_0x484c7f+'-'+_0x4348f6+'/'+_0x2b3894)[_0xd70d('0x1a')](_0x3dbf08);}return null;};}function patchUpdates(_0x3a3e3a){return function(_0x1e7e12){try{jsonpatch['apply'](_0x1e7e12,_0x3a3e3a,!![]);}catch(_0x2c1f09){return BPromise[_0xd70d('0x21')](_0x2c1f09);}return _0x1e7e12[_0xd70d('0x22')]();};}function saveUpdates(_0x2ed962,_0x4ceebb){return function(_0x17eeaa){if(_0x17eeaa){return _0x17eeaa[_0xd70d('0x23')](_0x2ed962)[_0xd70d('0x24')](function(_0x1189f6){return _0x1189f6;});}return null;};}function removeEntity(_0x524172,_0x2670ac){return function(_0x5ba3c2){if(_0x5ba3c2){return _0x5ba3c2['destroy']()[_0xd70d('0x24')](function(){_0x524172[_0xd70d('0x19')](0xcc)[_0xd70d('0x25')]();});}};}function handleEntityNotFound(_0x598520,_0x32ea5a){return function(_0x509a4d){if(!_0x509a4d){_0x598520[_0xd70d('0x18')](0x194);}return _0x509a4d;};}function handleError(_0x526b88,_0x166b34){_0x166b34=_0x166b34||0x1f4;return function(_0x1d4a1b){logger['error'](_0x1d4a1b[_0xd70d('0x26')]);if(_0x1d4a1b[_0xd70d('0x27')]){delete _0x1d4a1b[_0xd70d('0x27')];}_0x526b88[_0xd70d('0x19')](_0x166b34)[_0xd70d('0x28')](_0x1d4a1b);};}exports['index']=function(_0x3ed73e,_0x50a370){var _0x3925af={},_0x23de17={},_0x45b378={'count':0x0,'rows':[]};var _0x2b4eba=_[_0xd70d('0x29')](db['FreshsalesAccount'][_0xd70d('0x2a')],function(_0x27afb9){return{'name':_0x27afb9['fieldName'],'type':_0x27afb9[_0xd70d('0x2b')][_0xd70d('0x2c')]};});_0x23de17[_0xd70d('0x2d')]=_[_0xd70d('0x29')](_0x2b4eba,'name');_0x23de17['query']=_[_0xd70d('0x2e')](_0x3ed73e['query']);_0x23de17[_0xd70d('0x2f')]=_[_0xd70d('0x30')](_0x23de17['model'],_0x23de17[_0xd70d('0x31')]);_0x3925af[_0xd70d('0x32')]=_[_0xd70d('0x30')](_0x23de17['model'],qs[_0xd70d('0x33')](_0x3ed73e[_0xd70d('0x31')]['fields']));_0x3925af[_0xd70d('0x32')]=_0x3925af['attributes'][_0xd70d('0x34')]?_0x3925af['attributes']:_0x23de17['model'];if(!_0x3ed73e[_0xd70d('0x31')][_0xd70d('0x35')](_0xd70d('0x36'))){_0x3925af['limit']=qs['limit'](_0x3ed73e[_0xd70d('0x31')]['limit']);_0x3925af[_0xd70d('0x1e')]=qs[_0xd70d('0x1e')](_0x3ed73e[_0xd70d('0x31')][_0xd70d('0x1e')]);}_0x3925af[_0xd70d('0x37')]=qs[_0xd70d('0x38')](_0x3ed73e[_0xd70d('0x31')][_0xd70d('0x38')]);_0x3925af[_0xd70d('0x39')]=qs[_0xd70d('0x2f')](_[_0xd70d('0x3a')](_0x3ed73e[_0xd70d('0x31')],_0x23de17[_0xd70d('0x2f')]),_0x2b4eba);if(_0x3ed73e[_0xd70d('0x31')][_0xd70d('0x3b')]){_0x3925af['where']=_[_0xd70d('0x3c')](_0x3925af[_0xd70d('0x39')],{'$or':_['map'](_0x2b4eba,function(_0x52bd10){if(_0x52bd10[_0xd70d('0x2b')]!==_0xd70d('0x3d')){var _0x2e1e73={};_0x2e1e73[_0x52bd10[_0xd70d('0x27')]]={'$like':'%'+_0x3ed73e[_0xd70d('0x31')]['filter']+'%'};return _0x2e1e73;}})});}_0x3925af=_[_0xd70d('0x3c')]({},_0x3925af,_0x3ed73e['options']);var _0x5aec4e={'where':_0x3925af[_0xd70d('0x39')]};return db[_0xd70d('0x3e')][_0xd70d('0x1d')](_0x5aec4e)['then'](function(_0x36ffb1){_0x45b378[_0xd70d('0x1d')]=_0x36ffb1;if(_0x3ed73e['query'][_0xd70d('0x3f')]){_0x3925af[_0xd70d('0x40')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x3925af);})[_0xd70d('0x24')](function(_0x2ba281){_0x45b378['rows']=_0x2ba281;return _0x45b378;})[_0xd70d('0x24')](respondWithFilteredResult(_0x50a370,_0x3925af))[_0xd70d('0x41')](handleError(_0x50a370,null));};exports['show']=function(_0x9d7a57,_0x507a75){var _0x230de0={'raw':![],'where':{'id':_0x9d7a57[_0xd70d('0x42')]['id']}},_0x96696f={};_0x96696f[_0xd70d('0x2d')]=_[_0xd70d('0x2e')](db[_0xd70d('0x3e')][_0xd70d('0x2a')]);_0x96696f[_0xd70d('0x31')]=_[_0xd70d('0x2e')](_0x9d7a57[_0xd70d('0x31')]);_0x96696f[_0xd70d('0x2f')]=_[_0xd70d('0x30')](_0x96696f[_0xd70d('0x2d')],_0x96696f['query']);_0x230de0[_0xd70d('0x32')]=_[_0xd70d('0x30')](_0x96696f[_0xd70d('0x2d')],qs[_0xd70d('0x33')](_0x9d7a57['query'][_0xd70d('0x33')]));_0x230de0[_0xd70d('0x32')]=_0x230de0[_0xd70d('0x32')][_0xd70d('0x34')]?_0x230de0[_0xd70d('0x32')]:_0x96696f['model'];if(_0x9d7a57['query'][_0xd70d('0x3f')]){_0x230de0['include']=[{'all':!![]}];}_0x230de0=_[_0xd70d('0x3c')]({},_0x230de0,_0x9d7a57[_0xd70d('0x43')]);return db[_0xd70d('0x3e')]['find'](_0x230de0)[_0xd70d('0x24')](handleEntityNotFound(_0x507a75,null))['then'](respondWithResult(_0x507a75,null))[_0xd70d('0x41')](handleError(_0x507a75,null));};exports[_0xd70d('0x44')]=function(_0x3db014,_0x214258){return db[_0xd70d('0x3e')][_0xd70d('0x44')](_0x3db014[_0xd70d('0x45')],{})['then'](respondWithResult(_0x214258,0xc9))[_0xd70d('0x41')](handleError(_0x214258,null));};exports['update']=function(_0x1e7e46,_0x4a490d){if(_0x1e7e46[_0xd70d('0x45')]['id']){delete _0x1e7e46[_0xd70d('0x45')]['id'];}return db['FreshsalesAccount'][_0xd70d('0x46')]({'where':{'id':_0x1e7e46['params']['id']}})[_0xd70d('0x24')](handleEntityNotFound(_0x4a490d,null))[_0xd70d('0x24')](saveUpdates(_0x1e7e46[_0xd70d('0x45')],null))[_0xd70d('0x24')](respondWithResult(_0x4a490d,null))[_0xd70d('0x41')](handleError(_0x4a490d,null));};exports[_0xd70d('0x47')]=function(_0x4e4ac9,_0x183529){return db[_0xd70d('0x3e')][_0xd70d('0x46')]({'where':{'id':_0x4e4ac9[_0xd70d('0x42')]['id']}})[_0xd70d('0x24')](handleEntityNotFound(_0x183529,null))[_0xd70d('0x24')](removeEntity(_0x183529,null))[_0xd70d('0x41')](handleError(_0x183529,null));};exports[_0xd70d('0x48')]=function(_0x501958,_0x13eac9,_0x19a08b){var _0x45d116={};var _0x478687={};var _0x3db83a;var _0x4b981a;return db[_0xd70d('0x3e')][_0xd70d('0x49')]({'where':{'id':_0x501958[_0xd70d('0x42')]['id']}})['then'](handleEntityNotFound(_0x13eac9,null))[_0xd70d('0x24')](function(_0x14160a){if(_0x14160a){_0x3db83a=_0x14160a;_0x478687[_0xd70d('0x2d')]=_[_0xd70d('0x2e')](db[_0xd70d('0x4a')][_0xd70d('0x2a')]);_0x478687[_0xd70d('0x31')]=_[_0xd70d('0x2e')](_0x501958[_0xd70d('0x31')]);_0x478687['filters']=_[_0xd70d('0x30')](_0x478687[_0xd70d('0x2d')],_0x478687[_0xd70d('0x31')]);_0x45d116['attributes']=_[_0xd70d('0x30')](_0x478687[_0xd70d('0x2d')],qs[_0xd70d('0x33')](_0x501958[_0xd70d('0x31')][_0xd70d('0x33')]));_0x45d116[_0xd70d('0x32')]=_0x45d116[_0xd70d('0x32')][_0xd70d('0x34')]?_0x45d116[_0xd70d('0x32')]:_0x478687['model'];_0x45d116['order']=qs[_0xd70d('0x38')](_0x501958['query']['sort']);_0x45d116[_0xd70d('0x39')]=qs['filters'](_[_0xd70d('0x3a')](_0x501958[_0xd70d('0x31')],_0x478687['filters']));if(_0x501958[_0xd70d('0x31')][_0xd70d('0x3b')]){_0x45d116['where']=_[_0xd70d('0x3c')](_0x45d116[_0xd70d('0x39')],{'$or':_[_0xd70d('0x29')](_0x45d116[_0xd70d('0x32')],function(_0x3dd1a9){var _0x239ead={};_0x239ead[_0x3dd1a9]={'$like':'%'+_0x501958['query']['filter']+'%'};return _0x239ead;})});}_0x45d116=_[_0xd70d('0x3c')]({},_0x45d116,_0x501958[_0xd70d('0x43')]);return _0x3db83a['getConfigurations'](_0x45d116);}})['then'](function(_0x1aa71f){if(_0x1aa71f){_0x4b981a=_0x1aa71f[_0xd70d('0x34')];if(!_0x501958[_0xd70d('0x31')][_0xd70d('0x35')](_0xd70d('0x36'))){_0x45d116['limit']=qs[_0xd70d('0x1c')](_0x501958[_0xd70d('0x31')][_0xd70d('0x1c')]);_0x45d116[_0xd70d('0x1e')]=qs[_0xd70d('0x1e')](_0x501958['query'][_0xd70d('0x1e')]);}return _0x3db83a['getConfigurations'](_0x45d116);}})['then'](function(_0xdb73b2){if(_0xdb73b2){return _0xdb73b2?{'count':_0x4b981a,'rows':_0xdb73b2}:null;}})['then'](respondWithResult(_0x13eac9,null))[_0xd70d('0x41')](handleError(_0x13eac9,null));};exports[_0xd70d('0x4b')]=function(_0x34fe89,_0x44a76a,_0x3a9ba6){if(_0x34fe89[_0xd70d('0x45')]['id']){delete _0x34fe89[_0xd70d('0x45')]['id'];}return db[_0xd70d('0x3e')][_0xd70d('0x49')]({'where':{'id':_0x34fe89[_0xd70d('0x42')]['id']}})['then'](handleEntityNotFound(_0x44a76a,null))[_0xd70d('0x24')](function(_0x3036ac){if(_0x3036ac){_0x34fe89[_0xd70d('0x45')]['AccountId']=_0x3036ac['id'];_0x34fe89['body']['Subjects']=integrations[_0xd70d('0x4c')](_0x34fe89['body']['channel'],_0x34fe89[_0xd70d('0x45')]['type']);_0x34fe89[_0xd70d('0x45')][_0xd70d('0x4d')]=integrations['getDescriptions'](_0x34fe89['body'][_0xd70d('0x4e')],_0x34fe89[_0xd70d('0x45')][_0xd70d('0x2b')]);return db[_0xd70d('0x4a')][_0xd70d('0x44')](_0x34fe89[_0xd70d('0x45')],{'include':[{'model':db[_0xd70d('0x4f')],'as':_0xd70d('0x50')},{'model':db['FreshsalesField'],'as':_0xd70d('0x4d')}]});}return null;})[_0xd70d('0x24')](respondWithResult(_0x44a76a,null))[_0xd70d('0x41')](handleError(_0x44a76a,null));};exports[_0xd70d('0x51')]=function(_0x291b16,_0x4c5ee3,_0x2cc78b){var _0x382695='';var _0x3befe7='';return db[_0xd70d('0x3e')][_0xd70d('0x49')]({'where':{'id':_0x291b16[_0xd70d('0x42')]['id']},'attributes':['id',_0xd70d('0x52'),_0xd70d('0x53'),_0xd70d('0x54')]})[_0xd70d('0x24')](handleEntityNotFound(_0x4c5ee3,null))[_0xd70d('0x24')](function(_0x88f9f9){if(_0x88f9f9){_0x3befe7=_0x88f9f9['username'];_0x382695=_0x88f9f9[_0xd70d('0x53')];var _0x396ba2=_0x88f9f9[_0xd70d('0x53')][_0xd70d('0x55')](-0x1);if(_0x396ba2==='/'){_0x382695=_0x382695[_0xd70d('0x56')](0x0,_0x382695[_0xd70d('0x57')](_0x396ba2));}return rp({'method':_0xd70d('0x58'),'uri':util[_0xd70d('0x59')](_0xd70d('0x5a'),_0x382695,_0xd70d('0x5b')),'headers':{'Authorization':_0xd70d('0x5c')+_0x88f9f9['apiKey']},'json':!![]});}})[_0xd70d('0x24')](function(_0x3113fd){if(_0x3113fd){var _0x1f3a6b=_0x3113fd[_0xd70d('0x5d')];var _0x568c01=![];var _0x1c4264=null;for(_0x1c4264=0x0;_0x1c4264<_0x1f3a6b[_0xd70d('0x34')];_0x1c4264++){if(_0x1f3a6b[_0x1c4264][_0xd70d('0x5e')]===_0x3befe7){_0x568c01=!![];}}if(_0x568c01){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xd70d('0x5f')});}}})['then'](respondWithResult(_0x4c5ee3,null))[_0xd70d('0x41')](function(_0x2a9734){var _0x474401=_0x291b16['query']['test']?0x1f4:_0x2a9734[_0xd70d('0x60')]||0x1f4;logger[_0xd70d('0x61')](_0xd70d('0x62'),_0xd70d('0x51'),_0x474401,JSON[_0xd70d('0x63')](_0x2a9734));delete _0x2a9734['name'];if(_0x474401===0x191){_0x474401=0x190;}_0x4c5ee3[_0xd70d('0x19')](_0x474401)[_0xd70d('0x28')](_0x291b16[_0xd70d('0x31')][_0xd70d('0x64')]?{'message':_0xd70d('0x65'),'statusCode':_0x2a9734[_0xd70d('0x60')]}:_0x2a9734);});}; \ No newline at end of file +var _0x4e37=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','include','find','catch','create','body','getConfigurations','findOne','params','FreshsalesConfiguration','order','addConfiguration','Subjects','getSubjects','getDescriptions','channel','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','email','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','FreshsalesAccount','rawAttributes','type','model','map','query'];(function(_0x2f4748,_0x24af55){var _0x18eece=function(_0x489dd6){while(--_0x489dd6){_0x2f4748['push'](_0x2f4748['shift']());}};_0x18eece(++_0x24af55);}(_0x4e37,0x15c));var _0x74e3=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x4e37[_0x599e60];return _0x468e19;};'use strict';var emlformat=require(_0x74e3('0x0'));var rimraf=require(_0x74e3('0x1'));var zipdir=require(_0x74e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74e3('0x3'));var moment=require(_0x74e3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x74e3('0x5'));var util=require('util');var path=require('path');var sox=require(_0x74e3('0x6'));var csv=require('to-csv');var ejs=require(_0x74e3('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x74e3('0x8'));var crypto=require(_0x74e3('0x9'));var jsforce=require(_0x74e3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x74e3('0xb'));var querystring=require(_0x74e3('0xc'));var Papa=require(_0x74e3('0xd'));var Redis=require(_0x74e3('0xe'));var authService=require(_0x74e3('0xf'));var qs=require(_0x74e3('0x10'));var as=require(_0x74e3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x74e3('0x12'));var utils=require(_0x74e3('0x13'));var config=require(_0x74e3('0x14'));var licenseUtil=require(_0x74e3('0x15'));var db=require(_0x74e3('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x280f58,_0x4575ec){_0x4575ec=_0x4575ec||0xcc;return function(_0x28d582){if(_0x28d582){return _0x280f58['sendStatus'](_0x4575ec);}return _0x280f58['status'](_0x4575ec)[_0x74e3('0x17')]();};}function respondWithResult(_0x2a99c5,_0x266f4d){_0x266f4d=_0x266f4d||0xc8;return function(_0x2ed0ad){if(_0x2ed0ad){return _0x2a99c5[_0x74e3('0x18')](_0x266f4d)[_0x74e3('0x19')](_0x2ed0ad);}};}function respondWithFilteredResult(_0x17d1e5,_0x3ec863){return function(_0x5cc73c){if(_0x5cc73c){var _0x79cff4=typeof _0x3ec863[_0x74e3('0x1a')]==='undefined'&&typeof _0x3ec863[_0x74e3('0x1b')]===_0x74e3('0x1c');var _0x3d5a40=_0x5cc73c['count'];var _0x2350a3=_0x79cff4?0x0:_0x3ec863[_0x74e3('0x1a')];var _0x284727=_0x79cff4?_0x5cc73c[_0x74e3('0x1d')]:_0x3ec863[_0x74e3('0x1a')]+_0x3ec863[_0x74e3('0x1b')];var _0x4f3d73;if(_0x284727>=_0x3d5a40){_0x284727=_0x3d5a40;_0x4f3d73=0xc8;}else{_0x4f3d73=0xce;}_0x17d1e5['status'](_0x4f3d73);return _0x17d1e5[_0x74e3('0x1e')]('Content-Range',_0x2350a3+'-'+_0x284727+'/'+_0x3d5a40)['json'](_0x5cc73c);}return null;};}function patchUpdates(_0x5349ca){return function(_0x4af37d){try{jsonpatch[_0x74e3('0x1f')](_0x4af37d,_0x5349ca,!![]);}catch(_0x2d661a){return BPromise[_0x74e3('0x20')](_0x2d661a);}return _0x4af37d['save']();};}function saveUpdates(_0x4e2b1c,_0x4f87a3){return function(_0x5e21a1){if(_0x5e21a1){return _0x5e21a1[_0x74e3('0x21')](_0x4e2b1c)['then'](function(_0x3438c1){return _0x3438c1;});}return null;};}function removeEntity(_0x150a31,_0x339dad){return function(_0x485b29){if(_0x485b29){return _0x485b29[_0x74e3('0x22')]()[_0x74e3('0x23')](function(){_0x150a31[_0x74e3('0x18')](0xcc)[_0x74e3('0x17')]();});}};}function handleEntityNotFound(_0x337b67,_0x332f77){return function(_0x5ed7ac){if(!_0x5ed7ac){_0x337b67[_0x74e3('0x24')](0x194);}return _0x5ed7ac;};}function handleError(_0x5d4012,_0xae75d5){_0xae75d5=_0xae75d5||0x1f4;return function(_0x55f9b4){logger[_0x74e3('0x25')](_0x55f9b4[_0x74e3('0x26')]);if(_0x55f9b4[_0x74e3('0x27')]){delete _0x55f9b4['name'];}_0x5d4012[_0x74e3('0x18')](_0xae75d5)[_0x74e3('0x28')](_0x55f9b4);};}exports[_0x74e3('0x29')]=function(_0x593820,_0x331d3d){var _0x4cd707={},_0x1a5b0c={},_0x49999d={'count':0x0,'rows':[]};var _0x375c72=_['map'](db[_0x74e3('0x2a')][_0x74e3('0x2b')],function(_0x18c309){return{'name':_0x18c309['fieldName'],'type':_0x18c309[_0x74e3('0x2c')]['key']};});_0x1a5b0c[_0x74e3('0x2d')]=_[_0x74e3('0x2e')](_0x375c72,_0x74e3('0x27'));_0x1a5b0c[_0x74e3('0x2f')]=_[_0x74e3('0x30')](_0x593820[_0x74e3('0x2f')]);_0x1a5b0c[_0x74e3('0x31')]=_[_0x74e3('0x32')](_0x1a5b0c[_0x74e3('0x2d')],_0x1a5b0c[_0x74e3('0x2f')]);_0x4cd707[_0x74e3('0x33')]=_[_0x74e3('0x32')](_0x1a5b0c[_0x74e3('0x2d')],qs[_0x74e3('0x34')](_0x593820[_0x74e3('0x2f')][_0x74e3('0x34')]));_0x4cd707[_0x74e3('0x33')]=_0x4cd707[_0x74e3('0x33')][_0x74e3('0x35')]?_0x4cd707[_0x74e3('0x33')]:_0x1a5b0c[_0x74e3('0x2d')];if(!_0x593820[_0x74e3('0x2f')][_0x74e3('0x36')](_0x74e3('0x37'))){_0x4cd707[_0x74e3('0x1b')]=qs[_0x74e3('0x1b')](_0x593820[_0x74e3('0x2f')]['limit']);_0x4cd707[_0x74e3('0x1a')]=qs[_0x74e3('0x1a')](_0x593820[_0x74e3('0x2f')]['offset']);}_0x4cd707['order']=qs['sort'](_0x593820[_0x74e3('0x2f')][_0x74e3('0x38')]);_0x4cd707[_0x74e3('0x39')]=qs[_0x74e3('0x31')](_[_0x74e3('0x3a')](_0x593820['query'],_0x1a5b0c['filters']),_0x375c72);if(_0x593820[_0x74e3('0x2f')][_0x74e3('0x3b')]){_0x4cd707[_0x74e3('0x39')]=_[_0x74e3('0x3c')](_0x4cd707[_0x74e3('0x39')],{'$or':_['map'](_0x375c72,function(_0x594fa3){if(_0x594fa3['type']!=='VIRTUAL'){var _0x154ccf={};_0x154ccf[_0x594fa3[_0x74e3('0x27')]]={'$like':'%'+_0x593820[_0x74e3('0x2f')][_0x74e3('0x3b')]+'%'};return _0x154ccf;}})});}_0x4cd707=_[_0x74e3('0x3c')]({},_0x4cd707,_0x593820[_0x74e3('0x3d')]);var _0x4b4501={'where':_0x4cd707[_0x74e3('0x39')]};return db[_0x74e3('0x2a')]['count'](_0x4b4501)[_0x74e3('0x23')](function(_0x24ca4e){_0x49999d[_0x74e3('0x1d')]=_0x24ca4e;if(_0x593820[_0x74e3('0x2f')][_0x74e3('0x3e')]){_0x4cd707['include']=[{'all':!![]}];}return db[_0x74e3('0x2a')][_0x74e3('0x3f')](_0x4cd707);})['then'](function(_0x3d75fc){_0x49999d[_0x74e3('0x40')]=_0x3d75fc;return _0x49999d;})['then'](respondWithFilteredResult(_0x331d3d,_0x4cd707))['catch'](handleError(_0x331d3d,null));};exports[_0x74e3('0x41')]=function(_0x265882,_0x1a88ce){var _0x559665={'raw':![],'where':{'id':_0x265882['params']['id']}},_0x1f5aa6={};_0x1f5aa6['model']=_[_0x74e3('0x30')](db['FreshsalesAccount']['rawAttributes']);_0x1f5aa6['query']=_[_0x74e3('0x30')](_0x265882[_0x74e3('0x2f')]);_0x1f5aa6[_0x74e3('0x31')]=_[_0x74e3('0x32')](_0x1f5aa6[_0x74e3('0x2d')],_0x1f5aa6[_0x74e3('0x2f')]);_0x559665[_0x74e3('0x33')]=_['intersection'](_0x1f5aa6[_0x74e3('0x2d')],qs[_0x74e3('0x34')](_0x265882['query']['fields']));_0x559665[_0x74e3('0x33')]=_0x559665[_0x74e3('0x33')][_0x74e3('0x35')]?_0x559665[_0x74e3('0x33')]:_0x1f5aa6['model'];if(_0x265882[_0x74e3('0x2f')][_0x74e3('0x3e')]){_0x559665[_0x74e3('0x42')]=[{'all':!![]}];}_0x559665=_[_0x74e3('0x3c')]({},_0x559665,_0x265882['options']);return db[_0x74e3('0x2a')][_0x74e3('0x43')](_0x559665)[_0x74e3('0x23')](handleEntityNotFound(_0x1a88ce,null))['then'](respondWithResult(_0x1a88ce,null))[_0x74e3('0x44')](handleError(_0x1a88ce,null));};exports['create']=function(_0x2f4bd9,_0x24295f){return db[_0x74e3('0x2a')][_0x74e3('0x45')](_0x2f4bd9['body'],{})[_0x74e3('0x23')](respondWithResult(_0x24295f,0xc9))['catch'](handleError(_0x24295f,null));};exports[_0x74e3('0x21')]=function(_0x50d805,_0x3c82bf){if(_0x50d805[_0x74e3('0x46')]['id']){delete _0x50d805['body']['id'];}return db['FreshsalesAccount'][_0x74e3('0x43')]({'where':{'id':_0x50d805['params']['id']}})[_0x74e3('0x23')](handleEntityNotFound(_0x3c82bf,null))[_0x74e3('0x23')](saveUpdates(_0x50d805[_0x74e3('0x46')],null))[_0x74e3('0x23')](respondWithResult(_0x3c82bf,null))[_0x74e3('0x44')](handleError(_0x3c82bf,null));};exports[_0x74e3('0x22')]=function(_0x4dd57a,_0xf927a5){return db[_0x74e3('0x2a')][_0x74e3('0x43')]({'where':{'id':_0x4dd57a['params']['id']}})['then'](handleEntityNotFound(_0xf927a5,null))[_0x74e3('0x23')](removeEntity(_0xf927a5,null))['catch'](handleError(_0xf927a5,null));};exports[_0x74e3('0x47')]=function(_0x18d815,_0x5d4123,_0x207939){var _0x258a94={};var _0x2e0a73={};var _0x30dabd;var _0xc09177;return db[_0x74e3('0x2a')][_0x74e3('0x48')]({'where':{'id':_0x18d815[_0x74e3('0x49')]['id']}})[_0x74e3('0x23')](handleEntityNotFound(_0x5d4123,null))[_0x74e3('0x23')](function(_0x5d9853){if(_0x5d9853){_0x30dabd=_0x5d9853;_0x2e0a73[_0x74e3('0x2d')]=_[_0x74e3('0x30')](db[_0x74e3('0x4a')]['rawAttributes']);_0x2e0a73[_0x74e3('0x2f')]=_[_0x74e3('0x30')](_0x18d815[_0x74e3('0x2f')]);_0x2e0a73['filters']=_['intersection'](_0x2e0a73['model'],_0x2e0a73[_0x74e3('0x2f')]);_0x258a94['attributes']=_[_0x74e3('0x32')](_0x2e0a73[_0x74e3('0x2d')],qs[_0x74e3('0x34')](_0x18d815[_0x74e3('0x2f')]['fields']));_0x258a94[_0x74e3('0x33')]=_0x258a94[_0x74e3('0x33')][_0x74e3('0x35')]?_0x258a94[_0x74e3('0x33')]:_0x2e0a73[_0x74e3('0x2d')];_0x258a94[_0x74e3('0x4b')]=qs['sort'](_0x18d815[_0x74e3('0x2f')][_0x74e3('0x38')]);_0x258a94[_0x74e3('0x39')]=qs[_0x74e3('0x31')](_[_0x74e3('0x3a')](_0x18d815[_0x74e3('0x2f')],_0x2e0a73[_0x74e3('0x31')]));if(_0x18d815[_0x74e3('0x2f')][_0x74e3('0x3b')]){_0x258a94['where']=_[_0x74e3('0x3c')](_0x258a94[_0x74e3('0x39')],{'$or':_[_0x74e3('0x2e')](_0x258a94[_0x74e3('0x33')],function(_0x58cf1a){var _0x41c110={};_0x41c110[_0x58cf1a]={'$like':'%'+_0x18d815[_0x74e3('0x2f')][_0x74e3('0x3b')]+'%'};return _0x41c110;})});}_0x258a94=_[_0x74e3('0x3c')]({},_0x258a94,_0x18d815[_0x74e3('0x3d')]);return _0x30dabd[_0x74e3('0x47')](_0x258a94);}})[_0x74e3('0x23')](function(_0x2a146d){if(_0x2a146d){_0xc09177=_0x2a146d['length'];if(!_0x18d815[_0x74e3('0x2f')][_0x74e3('0x36')](_0x74e3('0x37'))){_0x258a94[_0x74e3('0x1b')]=qs['limit'](_0x18d815[_0x74e3('0x2f')][_0x74e3('0x1b')]);_0x258a94[_0x74e3('0x1a')]=qs[_0x74e3('0x1a')](_0x18d815[_0x74e3('0x2f')][_0x74e3('0x1a')]);}return _0x30dabd[_0x74e3('0x47')](_0x258a94);}})[_0x74e3('0x23')](function(_0x1b7d48){if(_0x1b7d48){return _0x1b7d48?{'count':_0xc09177,'rows':_0x1b7d48}:null;}})[_0x74e3('0x23')](respondWithResult(_0x5d4123,null))[_0x74e3('0x44')](handleError(_0x5d4123,null));};exports[_0x74e3('0x4c')]=function(_0x2b145b,_0x37efc1,_0x3d8f94){if(_0x2b145b['body']['id']){delete _0x2b145b[_0x74e3('0x46')]['id'];}return db[_0x74e3('0x2a')][_0x74e3('0x48')]({'where':{'id':_0x2b145b['params']['id']}})['then'](handleEntityNotFound(_0x37efc1,null))[_0x74e3('0x23')](function(_0x41b7a2){if(_0x41b7a2){_0x2b145b[_0x74e3('0x46')]['AccountId']=_0x41b7a2['id'];_0x2b145b[_0x74e3('0x46')][_0x74e3('0x4d')]=integrations[_0x74e3('0x4e')](_0x2b145b[_0x74e3('0x46')]['channel'],_0x2b145b[_0x74e3('0x46')][_0x74e3('0x2c')]);_0x2b145b['body']['Descriptions']=integrations[_0x74e3('0x4f')](_0x2b145b[_0x74e3('0x46')][_0x74e3('0x50')],_0x2b145b[_0x74e3('0x46')][_0x74e3('0x2c')]);return db[_0x74e3('0x4a')]['create'](_0x2b145b[_0x74e3('0x46')],{'include':[{'model':db[_0x74e3('0x51')],'as':_0x74e3('0x4d')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0x74e3('0x23')](respondWithResult(_0x37efc1,null))['catch'](handleError(_0x37efc1,null));};exports[_0x74e3('0x52')]=function(_0x1fe7ca,_0x8e9803,_0x461aa6){var _0x187e94='';var _0x54039e='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x1fe7ca['params']['id']},'attributes':['id',_0x74e3('0x53'),_0x74e3('0x54'),_0x74e3('0x55')]})[_0x74e3('0x23')](handleEntityNotFound(_0x8e9803,null))[_0x74e3('0x23')](function(_0x3e6d7f){if(_0x3e6d7f){_0x54039e=_0x3e6d7f[_0x74e3('0x53')];_0x187e94=_0x3e6d7f[_0x74e3('0x54')];var _0x52b0af=_0x3e6d7f[_0x74e3('0x54')][_0x74e3('0x56')](-0x1);if(_0x52b0af==='/'){_0x187e94=_0x187e94[_0x74e3('0x57')](0x0,_0x187e94[_0x74e3('0x58')](_0x52b0af));}return rp({'method':'GET','uri':util[_0x74e3('0x59')](_0x74e3('0x5a'),_0x187e94,_0x74e3('0x5b')),'headers':{'Authorization':_0x74e3('0x5c')+_0x3e6d7f['apiKey']},'json':!![]});}})[_0x74e3('0x23')](function(_0x25b1ef){if(_0x25b1ef){var _0x133e18=_0x25b1ef[_0x74e3('0x5d')];var _0x4d3e56=![];var _0x4cc3d7=null;for(_0x4cc3d7=0x0;_0x4cc3d7<_0x133e18[_0x74e3('0x35')];_0x4cc3d7++){if(_0x133e18[_0x4cc3d7][_0x74e3('0x5e')]===_0x54039e){_0x4d3e56=!![];}}if(_0x4d3e56){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x74e3('0x23')](respondWithResult(_0x8e9803,null))[_0x74e3('0x44')](function(_0xace2b4){var _0xd51280=_0x1fe7ca[_0x74e3('0x2f')]['test']?0x1f4:_0xace2b4['statusCode']||0x1f4;logger['error'](_0x74e3('0x5f'),_0x74e3('0x52'),_0xd51280,JSON[_0x74e3('0x60')](_0xace2b4));delete _0xace2b4[_0x74e3('0x27')];if(_0xd51280===0x191){_0xd51280=0x190;}_0x8e9803['status'](_0xd51280)[_0x74e3('0x28')](_0x1fe7ca[_0x74e3('0x2f')]['test']?{'message':_0x74e3('0x61'),'statusCode':_0xace2b4[_0x74e3('0x62')]}:_0xace2b4);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index eb8c2a3..7f28671 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 _0xd101=['moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','../../config/logger','api'];(function(_0x3b8aca,_0x1f2ce4){var _0x188bae=function(_0xa91287){while(--_0xa91287){_0x3b8aca['push'](_0x3b8aca['shift']());}};_0x188bae(++_0x1f2ce4);}(_0xd101,0xc1));var _0x1d10=function(_0x1b8171,_0x4cb679){_0x1b8171=_0x1b8171-0x0;var _0xa8c506=_0xd101[_0x1b8171];return _0xa8c506;};'use strict';var _=require(_0x1d10('0x0'));var util=require('util');var logger=require(_0x1d10('0x1'))(_0x1d10('0x2'));var moment=require(_0x1d10('0x3'));var BPromise=require(_0x1d10('0x4'));var rp=require(_0x1d10('0x5'));var fs=require('fs');var path=require(_0x1d10('0x6'));var rimraf=require(_0x1d10('0x7'));var config=require(_0x1d10('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x1d10('0x9'));module[_0x1d10('0xa')]=function(_0x2a4e2d,_0x27d569){return _0x2a4e2d[_0x1d10('0xb')](_0x1d10('0xc'),attributes,{'tableName':_0x1d10('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6050=['moment','bluebird','path','rimraf','../../config/environment','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x4dd06b,_0x19bc12){var _0x4d3cf2=function(_0x353d7a){while(--_0x353d7a){_0x4dd06b['push'](_0x4dd06b['shift']());}};_0x4d3cf2(++_0x19bc12);}(_0x6050,0x196));var _0x0605=function(_0x359846,_0x454cd0){_0x359846=_0x359846-0x0;var _0x163e2e=_0x6050[_0x359846];return _0x163e2e;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xd78d96,_0x578623){return _0xd78d96['define']('FreshsalesAccount',attributes,{'tableName':_0x0605('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 026b5b7..327ca12 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 _0x25e7=['find','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','map','include','model','stringify'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x25e7,0x1d6));var _0x725e=function(_0x15c5b8,_0x3b670f){_0x15c5b8=_0x15c5b8-0x0;var _0xd45fe6=_0x25e7[_0x15c5b8];return _0xd45fe6;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rs=require(_0x725e('0x4'));var fs=require('fs');var Redis=require(_0x725e('0x5'));var db=require(_0x725e('0x6'))['db'];var utils=require(_0x725e('0x7'));var logger=require(_0x725e('0x8'))(_0x725e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x725e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481316,_0x111a50,_0x192c27){return new BPromise(function(_0x216b33,_0x67de0c){return client[_0x725e('0xb')](_0x481316,_0x192c27)[_0x725e('0xc')](function(_0x39858a){logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,_0x725e('0xf'));logger[_0x725e('0x10')](_0x725e('0x11'),_0x111a50,'request\x20sent',JSON['stringify'](_0x39858a));if(_0x39858a[_0x725e('0x12')]){if(_0x39858a[_0x725e('0x12')]['code']===0x1f4){logger['error'](_0x725e('0xe'),_0x111a50,_0x39858a[_0x725e('0x12')]['message']);return _0x67de0c(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}logger[_0x725e('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x111a50,_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);return _0x216b33(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}else{logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,'request\x20sent');_0x216b33(_0x39858a[_0x725e('0x14')][_0x725e('0x13')]);}})[_0x725e('0x15')](function(_0x54ac0f){logger[_0x725e('0x12')](_0x725e('0xe'),_0x111a50,_0x54ac0f);_0x67de0c(_0x54ac0f);});});}exports[_0x725e('0x16')]=function(_0x397e33){var _0x268438=this;return new Promise(function(_0x2811e7,_0x528e7d){return db[_0x725e('0x17')][_0x725e('0x18')]({'raw':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')][_0x725e('0x1a')]===undefined?!![]:![]:!![],'where':_0x397e33[_0x725e('0x19')]?_0x397e33['options'][_0x725e('0x1b')]||null:null,'attributes':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')][_0x725e('0x1c')]||null:null,'limit':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')][_0x725e('0x1d')]||null:null,'include':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')]['include']?_[_0x725e('0x1e')](_0x397e33[_0x725e('0x19')][_0x725e('0x1f')],function(_0x3facae){return{'model':db[_0x3facae['model']],'as':_0x3facae['as'],'attributes':_0x3facae[_0x725e('0x1c')],'include':_0x3facae['include']?_['map'](_0x3facae['include'],function(_0x2aad7b){return{'model':db[_0x2aad7b[_0x725e('0x20')]],'as':_0x2aad7b['as'],'attributes':_0x2aad7b[_0x725e('0x1c')],'include':_0x2aad7b['include']?_[_0x725e('0x1e')](_0x2aad7b[_0x725e('0x1f')],function(_0x5a5bef){return{'model':db[_0x5a5bef[_0x725e('0x20')]],'as':_0x5a5bef['as'],'attributes':_0x5a5bef[_0x725e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x378ace){logger['info']('GetFreshsalesAccount',_0x397e33);logger[_0x725e('0x10')]('GetFreshsalesAccount',_0x397e33,JSON[_0x725e('0x21')](_0x378ace));_0x2811e7(_0x378ace);})['catch'](function(_0x4de2e0){logger[_0x725e('0x12')](_0x725e('0x16'),_0x4de2e0[_0x725e('0x13')],_0x397e33);_0x528e7d(_0x268438['error'](0x1f4,_0x4de2e0[_0x725e('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0x85d29c){var _0x1ce9c8=this;return new Promise(function(_0x39932f,_0x28951f){return db[_0x725e('0x17')][_0x725e('0x22')]({'raw':_0x85d29c[_0x725e('0x19')]?_0x85d29c[_0x725e('0x19')][_0x725e('0x1a')]===undefined?!![]:![]:!![],'where':_0x85d29c[_0x725e('0x19')]?_0x85d29c[_0x725e('0x19')]['where']||null:null,'attributes':_0x85d29c[_0x725e('0x19')]?_0x85d29c[_0x725e('0x19')]['attributes']||null:null,'include':_0x85d29c[_0x725e('0x19')]?_0x85d29c['options'][_0x725e('0x1f')]?_['map'](_0x85d29c[_0x725e('0x19')][_0x725e('0x1f')],function(_0x1f2898){return{'model':db[_0x1f2898[_0x725e('0x20')]],'as':_0x1f2898['as'],'attributes':_0x1f2898[_0x725e('0x1c')],'include':_0x1f2898[_0x725e('0x1f')]?_['map'](_0x1f2898['include'],function(_0x35e5e7){return{'model':db[_0x35e5e7[_0x725e('0x20')]],'as':_0x35e5e7['as'],'attributes':_0x35e5e7[_0x725e('0x1c')],'include':_0x35e5e7['include']?_[_0x725e('0x1e')](_0x35e5e7['include'],function(_0x3ce327){return{'model':db[_0x3ce327[_0x725e('0x20')]],'as':_0x3ce327['as'],'attributes':_0x3ce327[_0x725e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x725e('0xc')](function(_0x4f15f3){logger['info'](_0x725e('0x23'),_0x85d29c);logger[_0x725e('0x10')](_0x725e('0x23'),_0x85d29c,JSON['stringify'](_0x4f15f3));_0x39932f(_0x4f15f3);})[_0x725e('0x15')](function(_0xec3b9d){logger[_0x725e('0x12')]('ShowFreshsalesAccount',_0xec3b9d[_0x725e('0x13')],_0x85d29c);_0x28951f(_0x1ce9c8['error'](0x1f4,_0xec3b9d[_0x725e('0x13')]));});});}; \ No newline at end of file +var _0xfb11=['catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','include','map','model','attributes','debug','ShowFreshsalesAccount','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x118229,_0x4b893b){var _0xa57117=function(_0x24ddce){while(--_0x24ddce){_0x118229['push'](_0x118229['shift']());}};_0xa57117(++_0x4b893b);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xfb11[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var moment=require(_0x1fb1('0x1'));var BPromise=require(_0x1fb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fb1('0x4'));var logger=require('../../config/logger')(_0x1fb1('0x5'));var config=require(_0x1fb1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1fb1('0x7')][_0x1fb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c098d,_0x1859da,_0x2596c2){return new BPromise(function(_0x34e61a,_0x236b20){return client[_0x1fb1('0x9')](_0x4c098d,_0x2596c2)[_0x1fb1('0xa')](function(_0x438d15){logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,_0x1fb1('0xd'));logger['debug'](_0x1fb1('0xe'),_0x1859da,'request\x20sent',JSON[_0x1fb1('0xf')](_0x438d15));if(_0x438d15['error']){if(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x11')]===0x1f4){logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x236b20(_0x438d15['error'][_0x1fb1('0x12')]);}logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x34e61a(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);}else{logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,'request\x20sent');_0x34e61a(_0x438d15['result'][_0x1fb1('0x12')]);}})[_0x1fb1('0x13')](function(_0x3924ab){logger['error'](_0x1fb1('0xc'),_0x1859da,_0x3924ab);_0x236b20(_0x3924ab);});});}exports[_0x1fb1('0x14')]=function(_0x24d4df){var _0x34076b=this;return new Promise(function(_0x33c6b6,_0x27d71f){return db[_0x1fb1('0x15')][_0x1fb1('0x16')]({'raw':_0x24d4df[_0x1fb1('0x17')]?_0x24d4df['options'][_0x1fb1('0x18')]===undefined?!![]:![]:!![],'where':_0x24d4df['options']?_0x24d4df['options'][_0x1fb1('0x19')]||null:null,'attributes':_0x24d4df[_0x1fb1('0x17')]?_0x24d4df[_0x1fb1('0x17')]['attributes']||null:null,'limit':_0x24d4df[_0x1fb1('0x17')]?_0x24d4df['options']['limit']||null:null,'include':_0x24d4df['options']?_0x24d4df[_0x1fb1('0x17')][_0x1fb1('0x1a')]?_[_0x1fb1('0x1b')](_0x24d4df[_0x1fb1('0x17')][_0x1fb1('0x1a')],function(_0x53b8af){return{'model':db[_0x53b8af[_0x1fb1('0x1c')]],'as':_0x53b8af['as'],'attributes':_0x53b8af[_0x1fb1('0x1d')],'include':_0x53b8af[_0x1fb1('0x1a')]?_[_0x1fb1('0x1b')](_0x53b8af[_0x1fb1('0x1a')],function(_0x1353a4){return{'model':db[_0x1353a4[_0x1fb1('0x1c')]],'as':_0x1353a4['as'],'attributes':_0x1353a4[_0x1fb1('0x1d')],'include':_0x1353a4['include']?_[_0x1fb1('0x1b')](_0x1353a4[_0x1fb1('0x1a')],function(_0x46ff60){return{'model':db[_0x46ff60[_0x1fb1('0x1c')]],'as':_0x46ff60['as'],'attributes':_0x46ff60[_0x1fb1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1fb1('0xa')](function(_0x1a74c4){logger[_0x1fb1('0xb')](_0x1fb1('0x14'),_0x24d4df);logger[_0x1fb1('0x1e')](_0x1fb1('0x14'),_0x24d4df,JSON[_0x1fb1('0xf')](_0x1a74c4));_0x33c6b6(_0x1a74c4);})[_0x1fb1('0x13')](function(_0xe8ec0a){logger[_0x1fb1('0x10')]('GetFreshsalesAccount',_0xe8ec0a[_0x1fb1('0x12')],_0x24d4df);_0x27d71f(_0x34076b[_0x1fb1('0x10')](0x1f4,_0xe8ec0a[_0x1fb1('0x12')]));});});};exports[_0x1fb1('0x1f')]=function(_0x5402e9){var _0x245f84=this;return new Promise(function(_0x30c8eb,_0x5d45a5){return db[_0x1fb1('0x15')]['find']({'raw':_0x5402e9['options']?_0x5402e9[_0x1fb1('0x17')][_0x1fb1('0x18')]===undefined?!![]:![]:!![],'where':_0x5402e9['options']?_0x5402e9[_0x1fb1('0x17')][_0x1fb1('0x19')]||null:null,'attributes':_0x5402e9[_0x1fb1('0x17')]?_0x5402e9[_0x1fb1('0x17')][_0x1fb1('0x1d')]||null:null,'include':_0x5402e9['options']?_0x5402e9[_0x1fb1('0x17')][_0x1fb1('0x1a')]?_[_0x1fb1('0x1b')](_0x5402e9[_0x1fb1('0x17')][_0x1fb1('0x1a')],function(_0x307700){return{'model':db[_0x307700[_0x1fb1('0x1c')]],'as':_0x307700['as'],'attributes':_0x307700[_0x1fb1('0x1d')],'include':_0x307700[_0x1fb1('0x1a')]?_['map'](_0x307700[_0x1fb1('0x1a')],function(_0x4b4271){return{'model':db[_0x4b4271[_0x1fb1('0x1c')]],'as':_0x4b4271['as'],'attributes':_0x4b4271['attributes'],'include':_0x4b4271[_0x1fb1('0x1a')]?_['map'](_0x4b4271['include'],function(_0x25ac36){return{'model':db[_0x25ac36[_0x1fb1('0x1c')]],'as':_0x25ac36['as'],'attributes':_0x25ac36[_0x1fb1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1fb1('0xa')](function(_0x564ed9){logger[_0x1fb1('0xb')](_0x1fb1('0x1f'),_0x5402e9);logger[_0x1fb1('0x1e')]('ShowFreshsalesAccount',_0x5402e9,JSON[_0x1fb1('0xf')](_0x564ed9));_0x30c8eb(_0x564ed9);})[_0x1fb1('0x13')](function(_0x228235){logger[_0x1fb1('0x10')](_0x1fb1('0x1f'),_0x228235[_0x1fb1('0x12')],_0x5402e9);_0x5d45a5(_0x245f84[_0x1fb1('0x10')](0x1f4,_0x228235['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index ce5d361..e0b7afc 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 _0x92b4=['isAuthenticated','/:id/descriptions','getDescriptions','getFields','post','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','get','index','/:id'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x92b4,0x64));var _0x492b=function(_0x122b70,_0x1982c5){_0x122b70=_0x122b70-0x0;var _0x57865c=_0x92b4[_0x122b70];return _0x57865c;};'use strict';var multer=require('multer');var util=require(_0x492b('0x0'));var path=require('path');var timeout=require(_0x492b('0x1'));var express=require(_0x492b('0x2'));var router=express['Router']();var fs_extra=require(_0x492b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x492b('0x4'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0x492b('0x5')]('/',auth['isAuthenticated'](),controller[_0x492b('0x6')]);router[_0x492b('0x5')](_0x492b('0x7'),auth[_0x492b('0x8')](),controller['show']);router[_0x492b('0x5')]('/:id/subjects',auth[_0x492b('0x8')](),controller['getSubjects']);router[_0x492b('0x5')](_0x492b('0x9'),auth[_0x492b('0x8')](),controller[_0x492b('0xa')]);router['get']('/:id/fields',auth[_0x492b('0x8')](),controller[_0x492b('0xb')]);router[_0x492b('0xc')]('/',auth[_0x492b('0x8')](),controller['create']);router[_0x492b('0xd')](_0x492b('0x7'),auth[_0x492b('0x8')](),controller[_0x492b('0xe')]);router[_0x492b('0xf')]('/:id',auth[_0x492b('0x8')](),controller[_0x492b('0x10')]);module[_0x492b('0x11')]=router; \ No newline at end of file +var _0x18b7=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','update','delete'];(function(_0x43941d,_0x45fd0d){var _0x27b82a=function(_0x21851e){while(--_0x21851e){_0x43941d['push'](_0x43941d['shift']());}};_0x27b82a(++_0x45fd0d);}(_0x18b7,0x16a));var _0x718b=function(_0x30ff57,_0x474daf){_0x30ff57=_0x30ff57-0x0;var _0x58172d=_0x18b7[_0x30ff57];return _0x58172d;};'use strict';var multer=require(_0x718b('0x0'));var util=require(_0x718b('0x1'));var path=require(_0x718b('0x2'));var timeout=require(_0x718b('0x3'));var express=require(_0x718b('0x4'));var router=express[_0x718b('0x5')]();var fs_extra=require(_0x718b('0x6'));var auth=require(_0x718b('0x7'));var interaction=require(_0x718b('0x8'));var config=require(_0x718b('0x9'));var controller=require(_0x718b('0xa'));router[_0x718b('0xb')]('/',auth[_0x718b('0xc')](),controller[_0x718b('0xd')]);router[_0x718b('0xb')](_0x718b('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x718b('0xf'),auth[_0x718b('0xc')](),controller[_0x718b('0x10')]);router[_0x718b('0xb')](_0x718b('0x11'),auth[_0x718b('0xc')](),controller[_0x718b('0x12')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x718b('0x13')]);router['put'](_0x718b('0xe'),auth[_0x718b('0xc')](),controller[_0x718b('0x14')]);router[_0x718b('0x15')](_0x718b('0xe'),auth[_0x718b('0xc')](),controller[_0x718b('0x16')]);module[_0x718b('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 3e4c47e..536c76d 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 _0xab5d=['exports','STRING'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xab5d,0x6e));var _0xdab5=function(_0x3e4f1a,_0xf71492){_0x3e4f1a=_0x3e4f1a-0x0;var _0x32049a=_0xab5d[_0x3e4f1a];return _0x32049a;};'use strict';var Sequelize=require('sequelize');module[_0xdab5('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdab5('0x1')]}}; \ No newline at end of file +var _0xe68c=['exports','STRING'];(function(_0x3a4c85,_0x348e23){var _0x348324=function(_0x4e377b){while(--_0x4e377b){_0x3a4c85['push'](_0x3a4c85['shift']());}};_0x348324(++_0x348e23);}(_0xe68c,0x1a0));var _0xce68=function(_0x50d6a1,_0x190b8a){_0x50d6a1=_0x50d6a1-0x0;var _0x3fec22=_0xe68c[_0x50d6a1];return _0x3fec22;};'use strict';var Sequelize=require('sequelize');module[_0xce68('0x0')]={'name':{'type':Sequelize[_0xce68('0x1')]},'description':{'type':Sequelize[_0xce68('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index e2eb645..2737780 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 _0xcaca=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','pick','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5074e9,_0x48a968){var _0x19d105=function(_0x2ce1a4){while(--_0x2ce1a4){_0x5074e9['push'](_0x5074e9['shift']());}};_0x19d105(++_0x48a968);}(_0xcaca,0x18e));var _0xacac=function(_0x21dd85,_0x384ae1){_0x21dd85=_0x21dd85-0x0;var _0x7928b0=_0xcaca[_0x21dd85];return _0x7928b0;};'use strict';var emlformat=require(_0xacac('0x0'));var rimraf=require(_0xacac('0x1'));var zipdir=require(_0xacac('0x2'));var jsonpatch=require(_0xacac('0x3'));var rp=require(_0xacac('0x4'));var moment=require('moment');var BPromise=require(_0xacac('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xacac('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xacac('0x7'));var fs=require('fs');var fs_extra=require(_0xacac('0x8'));var _=require(_0xacac('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xacac('0xa'));var deskjs=require(_0xacac('0xb'));var toCsv=require(_0xacac('0xc'));var querystring=require(_0xacac('0xd'));var Papa=require(_0xacac('0xe'));var Redis=require(_0xacac('0xf'));var authService=require(_0xacac('0x10'));var qs=require(_0xacac('0x11'));var as=require(_0xacac('0x12'));var hardwareService=require(_0xacac('0x13'));var logger=require(_0xacac('0x14'))('api');var utils=require(_0xacac('0x15'));var config=require(_0xacac('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xacac('0x17'))['db'];function respondWithStatusCode(_0x2ed586,_0x5a2423){_0x5a2423=_0x5a2423||0xcc;return function(_0x1b2b89){if(_0x1b2b89){return _0x2ed586[_0xacac('0x18')](_0x5a2423);}return _0x2ed586[_0xacac('0x19')](_0x5a2423)[_0xacac('0x1a')]();};}function respondWithResult(_0x9e5b53,_0x506536){_0x506536=_0x506536||0xc8;return function(_0x15ae93){if(_0x15ae93){return _0x9e5b53[_0xacac('0x19')](_0x506536)[_0xacac('0x1b')](_0x15ae93);}};}function respondWithFilteredResult(_0x1df027,_0xa644a0){return function(_0x162050){if(_0x162050){var _0x31218c=typeof _0xa644a0['offset']===_0xacac('0x1c')&&typeof _0xa644a0[_0xacac('0x1d')]===_0xacac('0x1c');var _0x38490f=_0x162050[_0xacac('0x1e')];var _0x5db3f1=_0x31218c?0x0:_0xa644a0[_0xacac('0x1f')];var _0x71b278=_0x31218c?_0x162050[_0xacac('0x1e')]:_0xa644a0[_0xacac('0x1f')]+_0xa644a0[_0xacac('0x1d')];var _0x44a7d7;if(_0x71b278>=_0x38490f){_0x71b278=_0x38490f;_0x44a7d7=0xc8;}else{_0x44a7d7=0xce;}_0x1df027['status'](_0x44a7d7);return _0x1df027[_0xacac('0x20')](_0xacac('0x21'),_0x5db3f1+'-'+_0x71b278+'/'+_0x38490f)[_0xacac('0x1b')](_0x162050);}return null;};}function patchUpdates(_0x49e509){return function(_0xee75ad){try{jsonpatch[_0xacac('0x22')](_0xee75ad,_0x49e509,!![]);}catch(_0x2e21ec){return BPromise[_0xacac('0x23')](_0x2e21ec);}return _0xee75ad[_0xacac('0x24')]();};}function saveUpdates(_0x10f585,_0x205901){return function(_0x3b7574){if(_0x3b7574){return _0x3b7574[_0xacac('0x25')](_0x10f585)[_0xacac('0x26')](function(_0x367b96){return _0x367b96;});}return null;};}function removeEntity(_0x58c6e0,_0x442e25){return function(_0x3bd398){if(_0x3bd398){return _0x3bd398[_0xacac('0x27')]()[_0xacac('0x26')](function(){_0x58c6e0[_0xacac('0x19')](0xcc)[_0xacac('0x1a')]();});}};}function handleEntityNotFound(_0x39b9d1,_0x84b79c){return function(_0x436f62){if(!_0x436f62){_0x39b9d1[_0xacac('0x18')](0x194);}return _0x436f62;};}function handleError(_0x17ab9a,_0x3e0bbc){_0x3e0bbc=_0x3e0bbc||0x1f4;return function(_0x46ccf5){logger[_0xacac('0x28')](_0x46ccf5[_0xacac('0x29')]);if(_0x46ccf5[_0xacac('0x2a')]){delete _0x46ccf5['name'];}_0x17ab9a['status'](_0x3e0bbc)[_0xacac('0x2b')](_0x46ccf5);};}exports['index']=function(_0x49fae4,_0x540bf3){var _0x23d19f={},_0x204335={},_0x2b5bf8={'count':0x0,'rows':[]};var _0x275f45=_[_0xacac('0x2c')](db[_0xacac('0x2d')][_0xacac('0x2e')],function(_0x1a965e){return{'name':_0x1a965e[_0xacac('0x2f')],'type':_0x1a965e['type'][_0xacac('0x30')]};});_0x204335['model']=_['map'](_0x275f45,'name');_0x204335[_0xacac('0x31')]=_['keys'](_0x49fae4[_0xacac('0x31')]);_0x204335[_0xacac('0x32')]=_[_0xacac('0x33')](_0x204335[_0xacac('0x34')],_0x204335[_0xacac('0x31')]);_0x23d19f['attributes']=_[_0xacac('0x33')](_0x204335[_0xacac('0x34')],qs[_0xacac('0x35')](_0x49fae4['query']['fields']));_0x23d19f[_0xacac('0x36')]=_0x23d19f['attributes'][_0xacac('0x37')]?_0x23d19f[_0xacac('0x36')]:_0x204335['model'];if(!_0x49fae4[_0xacac('0x31')][_0xacac('0x38')](_0xacac('0x39'))){_0x23d19f['limit']=qs['limit'](_0x49fae4[_0xacac('0x31')][_0xacac('0x1d')]);_0x23d19f[_0xacac('0x1f')]=qs[_0xacac('0x1f')](_0x49fae4['query'][_0xacac('0x1f')]);}_0x23d19f[_0xacac('0x3a')]=qs[_0xacac('0x3b')](_0x49fae4[_0xacac('0x31')][_0xacac('0x3b')]);_0x23d19f[_0xacac('0x3c')]=qs[_0xacac('0x32')](_['pick'](_0x49fae4['query'],_0x204335[_0xacac('0x32')]),_0x275f45);if(_0x49fae4[_0xacac('0x31')][_0xacac('0x3d')]){_0x23d19f[_0xacac('0x3c')]=_[_0xacac('0x3e')](_0x23d19f[_0xacac('0x3c')],{'$or':_['map'](_0x275f45,function(_0x2cf6b3){if(_0x2cf6b3[_0xacac('0x3f')]!==_0xacac('0x40')){var _0x488438={};_0x488438[_0x2cf6b3[_0xacac('0x2a')]]={'$like':'%'+_0x49fae4[_0xacac('0x31')]['filter']+'%'};return _0x488438;}})});}_0x23d19f=_[_0xacac('0x3e')]({},_0x23d19f,_0x49fae4[_0xacac('0x41')]);var _0x2456a7={'where':_0x23d19f['where']};return db[_0xacac('0x2d')]['count'](_0x2456a7)[_0xacac('0x26')](function(_0x1775a3){_0x2b5bf8[_0xacac('0x1e')]=_0x1775a3;if(_0x49fae4[_0xacac('0x31')][_0xacac('0x42')]){_0x23d19f[_0xacac('0x43')]=[{'all':!![]}];}return db[_0xacac('0x2d')][_0xacac('0x44')](_0x23d19f);})['then'](function(_0x42ba2e){_0x2b5bf8[_0xacac('0x45')]=_0x42ba2e;return _0x2b5bf8;})[_0xacac('0x26')](respondWithFilteredResult(_0x540bf3,_0x23d19f))[_0xacac('0x46')](handleError(_0x540bf3,null));};exports[_0xacac('0x47')]=function(_0x5650d4,_0x576385){var _0xd293bf={'raw':![],'where':{'id':_0x5650d4[_0xacac('0x48')]['id']}},_0x36829a={};_0x36829a[_0xacac('0x34')]=_[_0xacac('0x49')](db[_0xacac('0x2d')][_0xacac('0x2e')]);_0x36829a[_0xacac('0x31')]=_[_0xacac('0x49')](_0x5650d4[_0xacac('0x31')]);_0x36829a[_0xacac('0x32')]=_['intersection'](_0x36829a[_0xacac('0x34')],_0x36829a[_0xacac('0x31')]);_0xd293bf[_0xacac('0x36')]=_[_0xacac('0x33')](_0x36829a[_0xacac('0x34')],qs['fields'](_0x5650d4[_0xacac('0x31')][_0xacac('0x35')]));_0xd293bf[_0xacac('0x36')]=_0xd293bf[_0xacac('0x36')][_0xacac('0x37')]?_0xd293bf[_0xacac('0x36')]:_0x36829a[_0xacac('0x34')];if(_0x5650d4['query']['includeAll']){_0xd293bf[_0xacac('0x43')]=[{'all':!![]}];}_0xd293bf=_[_0xacac('0x3e')]({},_0xd293bf,_0x5650d4[_0xacac('0x41')]);return db[_0xacac('0x2d')][_0xacac('0x4a')](_0xd293bf)['then'](handleEntityNotFound(_0x576385,null))[_0xacac('0x26')](respondWithResult(_0x576385,null))[_0xacac('0x46')](handleError(_0x576385,null));};exports[_0xacac('0x4b')]=function(_0x5b6964,_0xf034f8){return db[_0xacac('0x2d')][_0xacac('0x4b')](_0x5b6964['body'],{})[_0xacac('0x26')](respondWithResult(_0xf034f8,0xc9))['catch'](handleError(_0xf034f8,null));};exports['update']=function(_0x2dcf5a,_0x4b1d63){if(_0x2dcf5a[_0xacac('0x4c')]['id']){delete _0x2dcf5a[_0xacac('0x4c')]['id'];}return db[_0xacac('0x2d')][_0xacac('0x4a')]({'where':{'id':_0x2dcf5a[_0xacac('0x48')]['id']}})[_0xacac('0x26')](handleEntityNotFound(_0x4b1d63,null))[_0xacac('0x26')](saveUpdates(_0x2dcf5a[_0xacac('0x4c')],null))['then'](respondWithResult(_0x4b1d63,null))[_0xacac('0x46')](handleError(_0x4b1d63,null));};exports[_0xacac('0x27')]=function(_0x66835d,_0x344349){return db['FreshsalesConfiguration'][_0xacac('0x4a')]({'where':{'id':_0x66835d[_0xacac('0x48')]['id']}})[_0xacac('0x26')](handleEntityNotFound(_0x344349,null))[_0xacac('0x26')](removeEntity(_0x344349,null))[_0xacac('0x46')](handleError(_0x344349,null));};exports[_0xacac('0x4d')]=function(_0x4ac316,_0x15dbd6,_0x4bafe2){var _0x25886d={};var _0x51986d={};var _0x367999;var _0x5627f8;return db[_0xacac('0x2d')][_0xacac('0x4e')]({'where':{'id':_0x4ac316[_0xacac('0x48')]['id']}})['then'](handleEntityNotFound(_0x15dbd6,null))['then'](function(_0xe3d70e){if(_0xe3d70e){_0x367999=_0xe3d70e;_0x51986d['model']=_[_0xacac('0x49')](db[_0xacac('0x4f')][_0xacac('0x2e')]);_0x51986d[_0xacac('0x31')]=_['keys'](_0x4ac316[_0xacac('0x31')]);_0x51986d[_0xacac('0x32')]=_['intersection'](_0x51986d[_0xacac('0x34')],_0x51986d[_0xacac('0x31')]);_0x25886d[_0xacac('0x36')]=_[_0xacac('0x33')](_0x51986d['model'],qs['fields'](_0x4ac316[_0xacac('0x31')][_0xacac('0x35')]));_0x25886d[_0xacac('0x36')]=_0x25886d[_0xacac('0x36')][_0xacac('0x37')]?_0x25886d['attributes']:_0x51986d[_0xacac('0x34')];_0x25886d[_0xacac('0x3a')]=qs[_0xacac('0x3b')](_0x4ac316['query'][_0xacac('0x3b')]);_0x25886d[_0xacac('0x3c')]=qs[_0xacac('0x32')](_['pick'](_0x4ac316[_0xacac('0x31')],_0x51986d[_0xacac('0x32')]));if(_0x4ac316['query'][_0xacac('0x3d')]){_0x25886d[_0xacac('0x3c')]=_['merge'](_0x25886d[_0xacac('0x3c')],{'$or':_[_0xacac('0x2c')](_0x25886d[_0xacac('0x36')],function(_0x5579ac){var _0x33e5e7={};_0x33e5e7[_0x5579ac]={'$like':'%'+_0x4ac316['query']['filter']+'%'};return _0x33e5e7;})});}_0x25886d=_[_0xacac('0x3e')]({},_0x25886d,_0x4ac316[_0xacac('0x41')]);return _0x367999[_0xacac('0x4d')](_0x25886d);}})['then'](function(_0xf72b22){if(_0xf72b22){_0x5627f8=_0xf72b22[_0xacac('0x37')];if(!_0x4ac316['query'][_0xacac('0x38')](_0xacac('0x39'))){_0x25886d[_0xacac('0x1d')]=qs[_0xacac('0x1d')](_0x4ac316[_0xacac('0x31')]['limit']);_0x25886d[_0xacac('0x1f')]=qs[_0xacac('0x1f')](_0x4ac316['query'][_0xacac('0x1f')]);}return _0x367999[_0xacac('0x4d')](_0x25886d);}})[_0xacac('0x26')](function(_0x3d4705){if(_0x3d4705){return _0x3d4705?{'count':_0x5627f8,'rows':_0x3d4705}:null;}})[_0xacac('0x26')](respondWithResult(_0x15dbd6,null))[_0xacac('0x46')](handleError(_0x15dbd6,null));};exports[_0xacac('0x50')]=function(_0x46c60b,_0x7bf1ed,_0x48e78f){var _0x546201={};var _0x502c32={};var _0x2a9683;var _0x1ea86f;return db[_0xacac('0x2d')][_0xacac('0x4e')]({'where':{'id':_0x46c60b[_0xacac('0x48')]['id']}})['then'](handleEntityNotFound(_0x7bf1ed,null))['then'](function(_0x3d5414){if(_0x3d5414){_0x2a9683=_0x3d5414;_0x502c32[_0xacac('0x34')]=_['keys'](db[_0xacac('0x4f')][_0xacac('0x2e')]);_0x502c32[_0xacac('0x31')]=_['keys'](_0x46c60b[_0xacac('0x31')]);_0x502c32[_0xacac('0x32')]=_[_0xacac('0x33')](_0x502c32[_0xacac('0x34')],_0x502c32[_0xacac('0x31')]);_0x546201['attributes']=_['intersection'](_0x502c32[_0xacac('0x34')],qs['fields'](_0x46c60b[_0xacac('0x31')]['fields']));_0x546201['attributes']=_0x546201[_0xacac('0x36')][_0xacac('0x37')]?_0x546201[_0xacac('0x36')]:_0x502c32[_0xacac('0x34')];_0x546201[_0xacac('0x3a')]=qs[_0xacac('0x3b')](_0x46c60b['query'][_0xacac('0x3b')]);_0x546201['where']=qs[_0xacac('0x32')](_[_0xacac('0x51')](_0x46c60b[_0xacac('0x31')],_0x502c32[_0xacac('0x32')]));if(_0x46c60b[_0xacac('0x31')]['filter']){_0x546201[_0xacac('0x3c')]=_[_0xacac('0x3e')](_0x546201['where'],{'$or':_[_0xacac('0x2c')](_0x546201[_0xacac('0x36')],function(_0x2e75b9){var _0x511a2f={};_0x511a2f[_0x2e75b9]={'$like':'%'+_0x46c60b[_0xacac('0x31')][_0xacac('0x3d')]+'%'};return _0x511a2f;})});}_0x546201=_[_0xacac('0x3e')]({},_0x546201,_0x46c60b[_0xacac('0x41')]);return _0x2a9683[_0xacac('0x50')](_0x546201);}})[_0xacac('0x26')](function(_0x15db2a){if(_0x15db2a){_0x1ea86f=_0x15db2a[_0xacac('0x37')];if(!_0x46c60b[_0xacac('0x31')][_0xacac('0x38')](_0xacac('0x39'))){_0x546201[_0xacac('0x1d')]=qs['limit'](_0x46c60b[_0xacac('0x31')]['limit']);_0x546201['offset']=qs[_0xacac('0x1f')](_0x46c60b['query']['offset']);}return _0x2a9683[_0xacac('0x50')](_0x546201);}})[_0xacac('0x26')](function(_0x24fde8){if(_0x24fde8){return _0x24fde8?{'count':_0x1ea86f,'rows':_0x24fde8}:null;}})['then'](respondWithResult(_0x7bf1ed,null))['catch'](handleError(_0x7bf1ed,null));};exports[_0xacac('0x52')]=function(_0x7eda51,_0x4bfdab,_0x19f71b){var _0x5086b1={};var _0x274876={};var _0x364e32;var _0x432920;return db[_0xacac('0x2d')][_0xacac('0x4e')]({'where':{'id':_0x7eda51[_0xacac('0x48')]['id']}})[_0xacac('0x26')](handleEntityNotFound(_0x4bfdab,null))[_0xacac('0x26')](function(_0x1b0000){if(_0x1b0000){_0x364e32=_0x1b0000;_0x274876[_0xacac('0x34')]=_[_0xacac('0x49')](db[_0xacac('0x4f')]['rawAttributes']);_0x274876[_0xacac('0x31')]=_[_0xacac('0x49')](_0x7eda51[_0xacac('0x31')]);_0x274876[_0xacac('0x32')]=_[_0xacac('0x33')](_0x274876['model'],_0x274876['query']);_0x5086b1[_0xacac('0x36')]=_[_0xacac('0x33')](_0x274876[_0xacac('0x34')],qs[_0xacac('0x35')](_0x7eda51[_0xacac('0x31')]['fields']));_0x5086b1[_0xacac('0x36')]=_0x5086b1['attributes'][_0xacac('0x37')]?_0x5086b1[_0xacac('0x36')]:_0x274876[_0xacac('0x34')];_0x5086b1[_0xacac('0x3a')]=qs[_0xacac('0x3b')](_0x7eda51[_0xacac('0x31')][_0xacac('0x3b')]);_0x5086b1[_0xacac('0x3c')]=qs[_0xacac('0x32')](_[_0xacac('0x51')](_0x7eda51[_0xacac('0x31')],_0x274876['filters']));if(_0x7eda51[_0xacac('0x31')][_0xacac('0x3d')]){_0x5086b1[_0xacac('0x3c')]=_['merge'](_0x5086b1[_0xacac('0x3c')],{'$or':_[_0xacac('0x2c')](_0x5086b1[_0xacac('0x36')],function(_0x3fa64c){var _0xdd3073={};_0xdd3073[_0x3fa64c]={'$like':'%'+_0x7eda51[_0xacac('0x31')][_0xacac('0x3d')]+'%'};return _0xdd3073;})});}_0x5086b1=_['merge']({},_0x5086b1,_0x7eda51[_0xacac('0x41')]);return _0x364e32[_0xacac('0x52')](_0x5086b1);}})[_0xacac('0x26')](function(_0x5f0fed){if(_0x5f0fed){_0x432920=_0x5f0fed[_0xacac('0x37')];if(!_0x7eda51[_0xacac('0x31')][_0xacac('0x38')](_0xacac('0x39'))){_0x5086b1[_0xacac('0x1d')]=qs[_0xacac('0x1d')](_0x7eda51[_0xacac('0x31')][_0xacac('0x1d')]);_0x5086b1[_0xacac('0x1f')]=qs['offset'](_0x7eda51[_0xacac('0x31')][_0xacac('0x1f')]);}return _0x364e32[_0xacac('0x52')](_0x5086b1);}})[_0xacac('0x26')](function(_0x54b568){if(_0x54b568){return _0x54b568?{'count':_0x432920,'rows':_0x54b568}:null;}})['then'](respondWithResult(_0x4bfdab,null))['catch'](handleError(_0x4bfdab,null));}; \ No newline at end of file +var _0xeff6=['sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','type','VIRTUAL','options','rows','catch','params','include','find','create','body','update','getSubjects','findOne','FreshsalesField','order','sort','nolimit','getDescriptions','getFields','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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'];(function(_0x34da52,_0x339ed9){var _0x19ed0e=function(_0x2c0d9f){while(--_0x2c0d9f){_0x34da52['push'](_0x34da52['shift']());}};_0x19ed0e(++_0x339ed9);}(_0xeff6,0x1c7));var _0x6eff=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeff6[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6eff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6eff('0x1'));var rp=require(_0x6eff('0x2'));var moment=require(_0x6eff('0x3'));var BPromise=require(_0x6eff('0x4'));var Mustache=require(_0x6eff('0x5'));var util=require(_0x6eff('0x6'));var path=require(_0x6eff('0x7'));var sox=require(_0x6eff('0x8'));var csv=require(_0x6eff('0x9'));var ejs=require(_0x6eff('0xa'));var fs=require('fs');var fs_extra=require(_0x6eff('0xb'));var _=require(_0x6eff('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6eff('0xd'));var deskjs=require(_0x6eff('0xe'));var toCsv=require(_0x6eff('0x9'));var querystring=require(_0x6eff('0xf'));var Papa=require(_0x6eff('0x10'));var Redis=require('ioredis');var authService=require(_0x6eff('0x11'));var qs=require(_0x6eff('0x12'));var as=require(_0x6eff('0x13'));var hardwareService=require(_0x6eff('0x14'));var logger=require(_0x6eff('0x15'))('api');var utils=require(_0x6eff('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6eff('0x17'));var db=require(_0x6eff('0x18'))['db'];function respondWithStatusCode(_0x1dd2a5,_0x1894d6){_0x1894d6=_0x1894d6||0xcc;return function(_0x256061){if(_0x256061){return _0x1dd2a5[_0x6eff('0x19')](_0x1894d6);}return _0x1dd2a5['status'](_0x1894d6)[_0x6eff('0x1a')]();};}function respondWithResult(_0x176a77,_0x5b5108){_0x5b5108=_0x5b5108||0xc8;return function(_0x2f967d){if(_0x2f967d){return _0x176a77[_0x6eff('0x1b')](_0x5b5108)[_0x6eff('0x1c')](_0x2f967d);}};}function respondWithFilteredResult(_0x1527e0,_0x34bd17){return function(_0x32c8ca){if(_0x32c8ca){var _0x28046c=typeof _0x34bd17[_0x6eff('0x1d')]===_0x6eff('0x1e')&&typeof _0x34bd17[_0x6eff('0x1f')]===_0x6eff('0x1e');var _0x371209=_0x32c8ca[_0x6eff('0x20')];var _0xa309be=_0x28046c?0x0:_0x34bd17['offset'];var _0x1d94ca=_0x28046c?_0x32c8ca[_0x6eff('0x20')]:_0x34bd17[_0x6eff('0x1d')]+_0x34bd17[_0x6eff('0x1f')];var _0x1d1325;if(_0x1d94ca>=_0x371209){_0x1d94ca=_0x371209;_0x1d1325=0xc8;}else{_0x1d1325=0xce;}_0x1527e0[_0x6eff('0x1b')](_0x1d1325);return _0x1527e0[_0x6eff('0x21')]('Content-Range',_0xa309be+'-'+_0x1d94ca+'/'+_0x371209)[_0x6eff('0x1c')](_0x32c8ca);}return null;};}function patchUpdates(_0x37c5f8){return function(_0x2b4668){try{jsonpatch[_0x6eff('0x22')](_0x2b4668,_0x37c5f8,!![]);}catch(_0x42c47c){return BPromise[_0x6eff('0x23')](_0x42c47c);}return _0x2b4668[_0x6eff('0x24')]();};}function saveUpdates(_0x40547b,_0x5df8be){return function(_0xb3988c){if(_0xb3988c){return _0xb3988c['update'](_0x40547b)[_0x6eff('0x25')](function(_0x47ba7e){return _0x47ba7e;});}return null;};}function removeEntity(_0x42b266,_0x667750){return function(_0x2c9dcf){if(_0x2c9dcf){return _0x2c9dcf[_0x6eff('0x26')]()['then'](function(){_0x42b266[_0x6eff('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d1909,_0x66d097){return function(_0x505a09){if(!_0x505a09){_0x2d1909[_0x6eff('0x19')](0x194);}return _0x505a09;};}function handleError(_0x12ea86,_0x3092f9){_0x3092f9=_0x3092f9||0x1f4;return function(_0x35da59){logger[_0x6eff('0x27')](_0x35da59['stack']);if(_0x35da59[_0x6eff('0x28')]){delete _0x35da59[_0x6eff('0x28')];}_0x12ea86[_0x6eff('0x1b')](_0x3092f9)[_0x6eff('0x29')](_0x35da59);};}exports[_0x6eff('0x2a')]=function(_0x5b62f5,_0x237cc6){var _0x2117e5={},_0x4aeab9={},_0x132165={'count':0x0,'rows':[]};var _0x1b161f=_[_0x6eff('0x2b')](db[_0x6eff('0x2c')][_0x6eff('0x2d')],function(_0x2cd0a8){return{'name':_0x2cd0a8[_0x6eff('0x2e')],'type':_0x2cd0a8['type'][_0x6eff('0x2f')]};});_0x4aeab9['model']=_['map'](_0x1b161f,_0x6eff('0x28'));_0x4aeab9[_0x6eff('0x30')]=_[_0x6eff('0x31')](_0x5b62f5[_0x6eff('0x30')]);_0x4aeab9[_0x6eff('0x32')]=_[_0x6eff('0x33')](_0x4aeab9[_0x6eff('0x34')],_0x4aeab9['query']);_0x2117e5[_0x6eff('0x35')]=_['intersection'](_0x4aeab9[_0x6eff('0x34')],qs[_0x6eff('0x36')](_0x5b62f5[_0x6eff('0x30')][_0x6eff('0x36')]));_0x2117e5[_0x6eff('0x35')]=_0x2117e5['attributes'][_0x6eff('0x37')]?_0x2117e5['attributes']:_0x4aeab9['model'];if(!_0x5b62f5[_0x6eff('0x30')][_0x6eff('0x38')]('nolimit')){_0x2117e5[_0x6eff('0x1f')]=qs[_0x6eff('0x1f')](_0x5b62f5[_0x6eff('0x30')][_0x6eff('0x1f')]);_0x2117e5[_0x6eff('0x1d')]=qs[_0x6eff('0x1d')](_0x5b62f5[_0x6eff('0x30')]['offset']);}_0x2117e5['order']=qs['sort'](_0x5b62f5['query']['sort']);_0x2117e5[_0x6eff('0x39')]=qs[_0x6eff('0x32')](_[_0x6eff('0x3a')](_0x5b62f5[_0x6eff('0x30')],_0x4aeab9['filters']),_0x1b161f);if(_0x5b62f5['query'][_0x6eff('0x3b')]){_0x2117e5[_0x6eff('0x39')]=_[_0x6eff('0x3c')](_0x2117e5[_0x6eff('0x39')],{'$or':_['map'](_0x1b161f,function(_0x22884e){if(_0x22884e[_0x6eff('0x3d')]!==_0x6eff('0x3e')){var _0x270e2c={};_0x270e2c[_0x22884e[_0x6eff('0x28')]]={'$like':'%'+_0x5b62f5[_0x6eff('0x30')][_0x6eff('0x3b')]+'%'};return _0x270e2c;}})});}_0x2117e5=_[_0x6eff('0x3c')]({},_0x2117e5,_0x5b62f5[_0x6eff('0x3f')]);var _0x43e067={'where':_0x2117e5['where']};return db[_0x6eff('0x2c')]['count'](_0x43e067)[_0x6eff('0x25')](function(_0x52b9d2){_0x132165[_0x6eff('0x20')]=_0x52b9d2;if(_0x5b62f5[_0x6eff('0x30')]['includeAll']){_0x2117e5['include']=[{'all':!![]}];}return db[_0x6eff('0x2c')]['findAll'](_0x2117e5);})[_0x6eff('0x25')](function(_0x5b59af){_0x132165[_0x6eff('0x40')]=_0x5b59af;return _0x132165;})[_0x6eff('0x25')](respondWithFilteredResult(_0x237cc6,_0x2117e5))[_0x6eff('0x41')](handleError(_0x237cc6,null));};exports['show']=function(_0x197bb7,_0x424a5b){var _0x4be409={'raw':![],'where':{'id':_0x197bb7[_0x6eff('0x42')]['id']}},_0x539adb={};_0x539adb['model']=_[_0x6eff('0x31')](db[_0x6eff('0x2c')][_0x6eff('0x2d')]);_0x539adb[_0x6eff('0x30')]=_[_0x6eff('0x31')](_0x197bb7[_0x6eff('0x30')]);_0x539adb[_0x6eff('0x32')]=_[_0x6eff('0x33')](_0x539adb[_0x6eff('0x34')],_0x539adb[_0x6eff('0x30')]);_0x4be409[_0x6eff('0x35')]=_['intersection'](_0x539adb['model'],qs[_0x6eff('0x36')](_0x197bb7[_0x6eff('0x30')][_0x6eff('0x36')]));_0x4be409['attributes']=_0x4be409['attributes'][_0x6eff('0x37')]?_0x4be409[_0x6eff('0x35')]:_0x539adb['model'];if(_0x197bb7[_0x6eff('0x30')]['includeAll']){_0x4be409[_0x6eff('0x43')]=[{'all':!![]}];}_0x4be409=_[_0x6eff('0x3c')]({},_0x4be409,_0x197bb7['options']);return db['FreshsalesConfiguration'][_0x6eff('0x44')](_0x4be409)['then'](handleEntityNotFound(_0x424a5b,null))['then'](respondWithResult(_0x424a5b,null))[_0x6eff('0x41')](handleError(_0x424a5b,null));};exports[_0x6eff('0x45')]=function(_0x59102a,_0x35a64c){return db[_0x6eff('0x2c')][_0x6eff('0x45')](_0x59102a[_0x6eff('0x46')],{})[_0x6eff('0x25')](respondWithResult(_0x35a64c,0xc9))['catch'](handleError(_0x35a64c,null));};exports[_0x6eff('0x47')]=function(_0x13ad93,_0x2173eb){if(_0x13ad93[_0x6eff('0x46')]['id']){delete _0x13ad93['body']['id'];}return db[_0x6eff('0x2c')][_0x6eff('0x44')]({'where':{'id':_0x13ad93[_0x6eff('0x42')]['id']}})['then'](handleEntityNotFound(_0x2173eb,null))[_0x6eff('0x25')](saveUpdates(_0x13ad93[_0x6eff('0x46')],null))['then'](respondWithResult(_0x2173eb,null))[_0x6eff('0x41')](handleError(_0x2173eb,null));};exports[_0x6eff('0x26')]=function(_0x69f2f,_0x2255f7){return db['FreshsalesConfiguration'][_0x6eff('0x44')]({'where':{'id':_0x69f2f[_0x6eff('0x42')]['id']}})[_0x6eff('0x25')](handleEntityNotFound(_0x2255f7,null))[_0x6eff('0x25')](removeEntity(_0x2255f7,null))[_0x6eff('0x41')](handleError(_0x2255f7,null));};exports[_0x6eff('0x48')]=function(_0x14a0cb,_0x1bc7dc,_0x1778a3){var _0x4f3c05={};var _0x57f3ad={};var _0x5accc9;var _0x3b6fb6;return db[_0x6eff('0x2c')][_0x6eff('0x49')]({'where':{'id':_0x14a0cb[_0x6eff('0x42')]['id']}})[_0x6eff('0x25')](handleEntityNotFound(_0x1bc7dc,null))[_0x6eff('0x25')](function(_0x5d96f0){if(_0x5d96f0){_0x5accc9=_0x5d96f0;_0x57f3ad[_0x6eff('0x34')]=_['keys'](db[_0x6eff('0x4a')]['rawAttributes']);_0x57f3ad[_0x6eff('0x30')]=_['keys'](_0x14a0cb[_0x6eff('0x30')]);_0x57f3ad[_0x6eff('0x32')]=_['intersection'](_0x57f3ad[_0x6eff('0x34')],_0x57f3ad[_0x6eff('0x30')]);_0x4f3c05[_0x6eff('0x35')]=_[_0x6eff('0x33')](_0x57f3ad[_0x6eff('0x34')],qs['fields'](_0x14a0cb['query'][_0x6eff('0x36')]));_0x4f3c05[_0x6eff('0x35')]=_0x4f3c05['attributes'][_0x6eff('0x37')]?_0x4f3c05[_0x6eff('0x35')]:_0x57f3ad[_0x6eff('0x34')];_0x4f3c05[_0x6eff('0x4b')]=qs[_0x6eff('0x4c')](_0x14a0cb[_0x6eff('0x30')][_0x6eff('0x4c')]);_0x4f3c05[_0x6eff('0x39')]=qs[_0x6eff('0x32')](_[_0x6eff('0x3a')](_0x14a0cb[_0x6eff('0x30')],_0x57f3ad[_0x6eff('0x32')]));if(_0x14a0cb[_0x6eff('0x30')][_0x6eff('0x3b')]){_0x4f3c05['where']=_['merge'](_0x4f3c05[_0x6eff('0x39')],{'$or':_[_0x6eff('0x2b')](_0x4f3c05[_0x6eff('0x35')],function(_0x340423){var _0x21dce9={};_0x21dce9[_0x340423]={'$like':'%'+_0x14a0cb[_0x6eff('0x30')]['filter']+'%'};return _0x21dce9;})});}_0x4f3c05=_[_0x6eff('0x3c')]({},_0x4f3c05,_0x14a0cb['options']);return _0x5accc9['getSubjects'](_0x4f3c05);}})[_0x6eff('0x25')](function(_0x2eb84a){if(_0x2eb84a){_0x3b6fb6=_0x2eb84a[_0x6eff('0x37')];if(!_0x14a0cb[_0x6eff('0x30')][_0x6eff('0x38')](_0x6eff('0x4d'))){_0x4f3c05[_0x6eff('0x1f')]=qs['limit'](_0x14a0cb[_0x6eff('0x30')]['limit']);_0x4f3c05[_0x6eff('0x1d')]=qs[_0x6eff('0x1d')](_0x14a0cb['query'][_0x6eff('0x1d')]);}return _0x5accc9[_0x6eff('0x48')](_0x4f3c05);}})[_0x6eff('0x25')](function(_0x50e25a){if(_0x50e25a){return _0x50e25a?{'count':_0x3b6fb6,'rows':_0x50e25a}:null;}})[_0x6eff('0x25')](respondWithResult(_0x1bc7dc,null))[_0x6eff('0x41')](handleError(_0x1bc7dc,null));};exports[_0x6eff('0x4e')]=function(_0x213161,_0x266349,_0x195114){var _0xb594c5={};var _0x2c6d8c={};var _0x5456fc;var _0x5138b4;return db[_0x6eff('0x2c')]['findOne']({'where':{'id':_0x213161['params']['id']}})[_0x6eff('0x25')](handleEntityNotFound(_0x266349,null))['then'](function(_0x46774e){if(_0x46774e){_0x5456fc=_0x46774e;_0x2c6d8c[_0x6eff('0x34')]=_[_0x6eff('0x31')](db[_0x6eff('0x4a')][_0x6eff('0x2d')]);_0x2c6d8c[_0x6eff('0x30')]=_[_0x6eff('0x31')](_0x213161[_0x6eff('0x30')]);_0x2c6d8c[_0x6eff('0x32')]=_[_0x6eff('0x33')](_0x2c6d8c[_0x6eff('0x34')],_0x2c6d8c[_0x6eff('0x30')]);_0xb594c5[_0x6eff('0x35')]=_[_0x6eff('0x33')](_0x2c6d8c[_0x6eff('0x34')],qs[_0x6eff('0x36')](_0x213161[_0x6eff('0x30')][_0x6eff('0x36')]));_0xb594c5['attributes']=_0xb594c5[_0x6eff('0x35')][_0x6eff('0x37')]?_0xb594c5[_0x6eff('0x35')]:_0x2c6d8c[_0x6eff('0x34')];_0xb594c5[_0x6eff('0x4b')]=qs[_0x6eff('0x4c')](_0x213161[_0x6eff('0x30')][_0x6eff('0x4c')]);_0xb594c5[_0x6eff('0x39')]=qs[_0x6eff('0x32')](_[_0x6eff('0x3a')](_0x213161[_0x6eff('0x30')],_0x2c6d8c[_0x6eff('0x32')]));if(_0x213161['query']['filter']){_0xb594c5['where']=_[_0x6eff('0x3c')](_0xb594c5['where'],{'$or':_['map'](_0xb594c5['attributes'],function(_0x43c448){var _0x4db97d={};_0x4db97d[_0x43c448]={'$like':'%'+_0x213161[_0x6eff('0x30')][_0x6eff('0x3b')]+'%'};return _0x4db97d;})});}_0xb594c5=_[_0x6eff('0x3c')]({},_0xb594c5,_0x213161[_0x6eff('0x3f')]);return _0x5456fc['getDescriptions'](_0xb594c5);}})[_0x6eff('0x25')](function(_0x3ea93c){if(_0x3ea93c){_0x5138b4=_0x3ea93c[_0x6eff('0x37')];if(!_0x213161[_0x6eff('0x30')]['hasOwnProperty'](_0x6eff('0x4d'))){_0xb594c5['limit']=qs[_0x6eff('0x1f')](_0x213161[_0x6eff('0x30')][_0x6eff('0x1f')]);_0xb594c5[_0x6eff('0x1d')]=qs[_0x6eff('0x1d')](_0x213161[_0x6eff('0x30')]['offset']);}return _0x5456fc[_0x6eff('0x4e')](_0xb594c5);}})['then'](function(_0x23b974){if(_0x23b974){return _0x23b974?{'count':_0x5138b4,'rows':_0x23b974}:null;}})[_0x6eff('0x25')](respondWithResult(_0x266349,null))['catch'](handleError(_0x266349,null));};exports[_0x6eff('0x4f')]=function(_0x4c4abb,_0x569d93,_0x4ad8b0){var _0x1489b3={};var _0xb5384e={};var _0x23b0f3;var _0x4a1ad8;return db[_0x6eff('0x2c')]['findOne']({'where':{'id':_0x4c4abb[_0x6eff('0x42')]['id']}})[_0x6eff('0x25')](handleEntityNotFound(_0x569d93,null))[_0x6eff('0x25')](function(_0x597f5c){if(_0x597f5c){_0x23b0f3=_0x597f5c;_0xb5384e[_0x6eff('0x34')]=_[_0x6eff('0x31')](db[_0x6eff('0x4a')][_0x6eff('0x2d')]);_0xb5384e[_0x6eff('0x30')]=_['keys'](_0x4c4abb[_0x6eff('0x30')]);_0xb5384e[_0x6eff('0x32')]=_[_0x6eff('0x33')](_0xb5384e['model'],_0xb5384e['query']);_0x1489b3[_0x6eff('0x35')]=_['intersection'](_0xb5384e['model'],qs[_0x6eff('0x36')](_0x4c4abb[_0x6eff('0x30')][_0x6eff('0x36')]));_0x1489b3[_0x6eff('0x35')]=_0x1489b3[_0x6eff('0x35')]['length']?_0x1489b3[_0x6eff('0x35')]:_0xb5384e['model'];_0x1489b3[_0x6eff('0x4b')]=qs[_0x6eff('0x4c')](_0x4c4abb[_0x6eff('0x30')][_0x6eff('0x4c')]);_0x1489b3[_0x6eff('0x39')]=qs['filters'](_[_0x6eff('0x3a')](_0x4c4abb['query'],_0xb5384e[_0x6eff('0x32')]));if(_0x4c4abb['query'][_0x6eff('0x3b')]){_0x1489b3[_0x6eff('0x39')]=_[_0x6eff('0x3c')](_0x1489b3[_0x6eff('0x39')],{'$or':_[_0x6eff('0x2b')](_0x1489b3[_0x6eff('0x35')],function(_0x259fda){var _0x19dacf={};_0x19dacf[_0x259fda]={'$like':'%'+_0x4c4abb[_0x6eff('0x30')][_0x6eff('0x3b')]+'%'};return _0x19dacf;})});}_0x1489b3=_['merge']({},_0x1489b3,_0x4c4abb[_0x6eff('0x3f')]);return _0x23b0f3[_0x6eff('0x4f')](_0x1489b3);}})['then'](function(_0x1d44ab){if(_0x1d44ab){_0x4a1ad8=_0x1d44ab[_0x6eff('0x37')];if(!_0x4c4abb[_0x6eff('0x30')]['hasOwnProperty'](_0x6eff('0x4d'))){_0x1489b3[_0x6eff('0x1f')]=qs[_0x6eff('0x1f')](_0x4c4abb['query']['limit']);_0x1489b3['offset']=qs[_0x6eff('0x1d')](_0x4c4abb['query'][_0x6eff('0x1d')]);}return _0x23b0f3['getFields'](_0x1489b3);}})[_0x6eff('0x25')](function(_0x58bbf0){if(_0x58bbf0){return _0x58bbf0?{'count':_0x4a1ad8,'rows':_0x58bbf0}:null;}})[_0x6eff('0x25')](respondWithResult(_0x569d93,null))['catch'](handleError(_0x569d93,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 4e311ee..bd9984a 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 _0x70b1=['define','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0x2d0484,_0x36cb59){var _0x4013d1=function(_0x33f804){while(--_0x33f804){_0x2d0484['push'](_0x2d0484['shift']());}};_0x4013d1(++_0x36cb59);}(_0x70b1,0x14c));var _0x170b=function(_0x3077c7,_0x486647){_0x3077c7=_0x3077c7-0x0;var _0xceb15a=_0x70b1[_0x3077c7];return _0xceb15a;};'use strict';var _=require(_0x170b('0x0'));var util=require(_0x170b('0x1'));var logger=require(_0x170b('0x2'))(_0x170b('0x3'));var moment=require(_0x170b('0x4'));var BPromise=require('bluebird');var rp=require(_0x170b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x170b('0x6'));var attributes=require(_0x170b('0x7'));module[_0x170b('0x8')]=function(_0x9ed757,_0x9a0d15){return _0x9ed757[_0x170b('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0x170b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c45=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x55368f,_0x46599d){var _0xa91b63=function(_0x5deab1){while(--_0x5deab1){_0x55368f['push'](_0x55368f['shift']());}};_0xa91b63(++_0x46599d);}(_0x6c45,0x1b8));var _0x56c4=function(_0x1f631a,_0x2ea293){_0x1f631a=_0x1f631a-0x0;var _0x2f77dd=_0x6c45[_0x1f631a];return _0x2f77dd;};'use strict';var _=require(_0x56c4('0x0'));var util=require(_0x56c4('0x1'));var logger=require(_0x56c4('0x2'))(_0x56c4('0x3'));var moment=require('moment');var BPromise=require(_0x56c4('0x4'));var rp=require(_0x56c4('0x5'));var fs=require('fs');var path=require(_0x56c4('0x6'));var rimraf=require(_0x56c4('0x7'));var config=require(_0x56c4('0x8'));var attributes=require(_0x56c4('0x9'));module[_0x56c4('0xa')]=function(_0x1611ec,_0x4fbf39){return _0x1611ec[_0x56c4('0xb')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 23827be..e1d2550 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 _0x7400=['http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7400,0x1d8));var _0x0740=function(_0x42bfc9,_0x92ccf5){_0x42bfc9=_0x42bfc9-0x0;var _0x645e2b=_0x7400[_0x42bfc9];return _0x645e2b;};'use strict';var _=require(_0x0740('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0740('0x1'));var rs=require(_0x0740('0x2'));var fs=require('fs');var Redis=require(_0x0740('0x3'));var db=require(_0x0740('0x4'))['db'];var utils=require(_0x0740('0x5'));var logger=require(_0x0740('0x6'))(_0x0740('0x7'));var config=require(_0x0740('0x8'));var jayson=require(_0x0740('0x9'));var client=jayson[_0x0740('0xa')][_0x0740('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38de9e,_0x39c2d3,_0x464967){return new BPromise(function(_0x4be1fa,_0x4a525b){return client[_0x0740('0xc')](_0x38de9e,_0x464967)['then'](function(_0x29626c){logger[_0x0740('0xd')](_0x0740('0xe'),_0x39c2d3,_0x0740('0xf'));logger['debug'](_0x0740('0x10'),_0x39c2d3,_0x0740('0xf'),JSON[_0x0740('0x11')](_0x29626c));if(_0x29626c[_0x0740('0x12')]){if(_0x29626c[_0x0740('0x12')][_0x0740('0x13')]===0x1f4){logger['error'](_0x0740('0xe'),_0x39c2d3,_0x29626c[_0x0740('0x12')]['message']);return _0x4a525b(_0x29626c[_0x0740('0x12')]['message']);}logger[_0x0740('0x12')](_0x0740('0xe'),_0x39c2d3,_0x29626c[_0x0740('0x12')][_0x0740('0x14')]);return _0x4be1fa(_0x29626c['error']['message']);}else{logger[_0x0740('0xd')](_0x0740('0xe'),_0x39c2d3,_0x0740('0xf'));_0x4be1fa(_0x29626c['result'][_0x0740('0x14')]);}})['catch'](function(_0x4f9fed){logger[_0x0740('0x12')](_0x0740('0xe'),_0x39c2d3,_0x4f9fed);_0x4a525b(_0x4f9fed);});});} \ No newline at end of file +var _0xf5d7=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x265862,_0x8d82b0){var _0x57293a=function(_0x2492db){while(--_0x2492db){_0x265862['push'](_0x265862['shift']());}};_0x57293a(++_0x8d82b0);}(_0xf5d7,0x1e0));var _0x7f5d=function(_0x50dba1,_0x18bd26){_0x50dba1=_0x50dba1-0x0;var _0xd2cb06=_0xf5d7[_0x50dba1];return _0xd2cb06;};'use strict';var _=require(_0x7f5d('0x0'));var util=require(_0x7f5d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7f5d('0x2'));var fs=require('fs');var Redis=require(_0x7f5d('0x3'));var db=require(_0x7f5d('0x4'))['db'];var utils=require(_0x7f5d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7f5d('0x6'));var jayson=require(_0x7f5d('0x7'));var client=jayson[_0x7f5d('0x8')][_0x7f5d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25d66f,_0x131cfe,_0x23dbf7){return new BPromise(function(_0x182c6a,_0x3f210f){return client[_0x7f5d('0xa')](_0x25d66f,_0x23dbf7)['then'](function(_0xb9a531){logger['info'](_0x7f5d('0xb'),_0x131cfe,_0x7f5d('0xc'));logger[_0x7f5d('0xd')](_0x7f5d('0xe'),_0x131cfe,_0x7f5d('0xc'),JSON[_0x7f5d('0xf')](_0xb9a531));if(_0xb9a531[_0x7f5d('0x10')]){if(_0xb9a531[_0x7f5d('0x10')][_0x7f5d('0x11')]===0x1f4){logger[_0x7f5d('0x10')](_0x7f5d('0xb'),_0x131cfe,_0xb9a531[_0x7f5d('0x10')][_0x7f5d('0x12')]);return _0x3f210f(_0xb9a531['error'][_0x7f5d('0x12')]);}logger['error'](_0x7f5d('0xb'),_0x131cfe,_0xb9a531['error'][_0x7f5d('0x12')]);return _0x182c6a(_0xb9a531['error'][_0x7f5d('0x12')]);}else{logger['info'](_0x7f5d('0xb'),_0x131cfe,_0x7f5d('0xc'));_0x182c6a(_0xb9a531['result']['message']);}})[_0x7f5d('0x13')](function(_0x3b1645){logger[_0x7f5d('0x10')](_0x7f5d('0xb'),_0x131cfe,_0x3b1645);_0x3f210f(_0x3b1645);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index ec6f2d3..455db31 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 _0xecd5=['delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x9b50c4,_0x274a56){var _0x3276e5=function(_0x1b23ff){while(--_0x1b23ff){_0x9b50c4['push'](_0x9b50c4['shift']());}};_0x3276e5(++_0x274a56);}(_0xecd5,0x110));var _0x5ecd=function(_0x1ca072,_0x1ef001){_0x1ca072=_0x1ca072-0x0;var _0x9f5e46=_0xecd5[_0x1ca072];return _0x9f5e46;};'use strict';var multer=require('multer');var util=require(_0x5ecd('0x0'));var path=require(_0x5ecd('0x1'));var timeout=require(_0x5ecd('0x2'));var express=require('express');var router=express[_0x5ecd('0x3')]();var fs_extra=require(_0x5ecd('0x4'));var auth=require(_0x5ecd('0x5'));var interaction=require(_0x5ecd('0x6'));var config=require('../../config/environment');var controller=require(_0x5ecd('0x7'));router['get']('/',auth[_0x5ecd('0x8')](),controller[_0x5ecd('0x9')]);router['get'](_0x5ecd('0xa'),auth[_0x5ecd('0x8')](),controller[_0x5ecd('0xb')]);router[_0x5ecd('0xc')]('/',auth[_0x5ecd('0x8')](),controller[_0x5ecd('0xd')]);router[_0x5ecd('0xe')](_0x5ecd('0xa'),auth[_0x5ecd('0x8')](),controller[_0x5ecd('0xf')]);router[_0x5ecd('0x10')](_0x5ecd('0xa'),auth['isAuthenticated'](),controller[_0x5ecd('0x11')]);module['exports']=router; \ No newline at end of file +var _0x43fd=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x7fae28,_0x42fa94){var _0x3952ca=function(_0x59c901){while(--_0x59c901){_0x7fae28['push'](_0x7fae28['shift']());}};_0x3952ca(++_0x42fa94);}(_0x43fd,0x150));var _0xd43f=function(_0x23fd45,_0x259eaf){_0x23fd45=_0x23fd45-0x0;var _0x52f837=_0x43fd[_0x23fd45];return _0x52f837;};'use strict';var multer=require(_0xd43f('0x0'));var util=require(_0xd43f('0x1'));var path=require('path');var timeout=require(_0xd43f('0x2'));var express=require('express');var router=express[_0xd43f('0x3')]();var fs_extra=require(_0xd43f('0x4'));var auth=require(_0xd43f('0x5'));var interaction=require(_0xd43f('0x6'));var config=require(_0xd43f('0x7'));var controller=require(_0xd43f('0x8'));router[_0xd43f('0x9')]('/',auth[_0xd43f('0xa')](),controller[_0xd43f('0xb')]);router[_0xd43f('0x9')](_0xd43f('0xc'),auth[_0xd43f('0xa')](),controller[_0xd43f('0xd')]);router[_0xd43f('0xe')]('/',auth['isAuthenticated'](),controller[_0xd43f('0xf')]);router[_0xd43f('0x10')](_0xd43f('0xc'),auth['isAuthenticated'](),controller[_0xd43f('0x11')]);router[_0xd43f('0x12')]('/:id',auth[_0xd43f('0xa')](),controller[_0xd43f('0x13')]);module[_0xd43f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 13bc5ec..4d7e877 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 _0xe5b7=['STRING','variable','sequelize','ENUM','string','customVariable','keyValue'];(function(_0x55b633,_0x321e5a){var _0x24c8a2=function(_0xab5c90){while(--_0xab5c90){_0x55b633['push'](_0x55b633['shift']());}};_0x24c8a2(++_0x321e5a);}(_0xe5b7,0xaa));var _0x7e5b=function(_0x21a56b,_0x2e3192){_0x21a56b=_0x21a56b-0x0;var _0x47dce7=_0xe5b7[_0x21a56b];return _0x47dce7;};'use strict';var Sequelize=require(_0x7e5b('0x0'));module['exports']={'type':{'type':Sequelize[_0x7e5b('0x1')](_0x7e5b('0x2'),'variable',_0x7e5b('0x3'),_0x7e5b('0x4'),'picklist'),'defaultValue':_0x7e5b('0x2')},'content':{'type':Sequelize[_0x7e5b('0x5')]},'key':{'type':Sequelize[_0x7e5b('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x7e5b('0x2'),_0x7e5b('0x6'),_0x7e5b('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7e5b('0x5')]},'nameField':{'type':Sequelize[_0x7e5b('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7e5b('0x5')]}}; \ No newline at end of file +var _0xd863=['BOOLEAN','sequelize','exports','string','STRING','ENUM','customVariable'];(function(_0x4c276e,_0x3e0629){var _0x5f4cb5=function(_0x304d98){while(--_0x304d98){_0x4c276e['push'](_0x4c276e['shift']());}};_0x5f4cb5(++_0x3e0629);}(_0xd863,0xda));var _0x3d86=function(_0x49c65f,_0x436ce9){_0x49c65f=_0x49c65f-0x0;var _0x3a804c=_0xd863[_0x49c65f];return _0x3a804c;};'use strict';var Sequelize=require(_0x3d86('0x0'));module[_0x3d86('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3d86('0x2'),'variable','customVariable','keyValue','picklist'),'defaultValue':_0x3d86('0x2')},'content':{'type':Sequelize[_0x3d86('0x3')]},'key':{'type':Sequelize[_0x3d86('0x3')]},'keyType':{'type':Sequelize[_0x3d86('0x4')](_0x3d86('0x2'),'variable',_0x3d86('0x5'))},'keyContent':{'type':Sequelize[_0x3d86('0x3')]},'idField':{'type':Sequelize[_0x3d86('0x3')]},'nameField':{'type':Sequelize[_0x3d86('0x3')]},'customField':{'type':Sequelize[_0x3d86('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3d86('0x3')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index de4f61b..1d5baa4 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 _0xf247=['query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FreshsalesField','findAll','rows','show','params','rawAttributes','keys','find','catch','create','body','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','fieldName','type','model','map','name'];(function(_0x58dc50,_0x2af0b7){var _0x1fda34=function(_0x5cf61b){while(--_0x5cf61b){_0x58dc50['push'](_0x58dc50['shift']());}};_0x1fda34(++_0x2af0b7);}(_0xf247,0x198));var _0x7f24=function(_0x328bd3,_0x9cf5a5){_0x328bd3=_0x328bd3-0x0;var _0x458149=_0xf247[_0x328bd3];return _0x458149;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f24('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7f24('0x1'));var moment=require(_0x7f24('0x2'));var BPromise=require(_0x7f24('0x3'));var Mustache=require(_0x7f24('0x4'));var util=require('util');var path=require(_0x7f24('0x5'));var sox=require(_0x7f24('0x6'));var csv=require(_0x7f24('0x7'));var ejs=require(_0x7f24('0x8'));var fs=require('fs');var fs_extra=require(_0x7f24('0x9'));var _=require(_0x7f24('0xa'));var squel=require('squel');var crypto=require(_0x7f24('0xb'));var jsforce=require(_0x7f24('0xc'));var deskjs=require(_0x7f24('0xd'));var toCsv=require(_0x7f24('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7f24('0xe'));var authService=require(_0x7f24('0xf'));var qs=require(_0x7f24('0x10'));var as=require(_0x7f24('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f24('0x12'))(_0x7f24('0x13'));var utils=require(_0x7f24('0x14'));var config=require(_0x7f24('0x15'));var licenseUtil=require(_0x7f24('0x16'));var db=require(_0x7f24('0x17'))['db'];function respondWithStatusCode(_0x58d91f,_0x33c7f9){_0x33c7f9=_0x33c7f9||0xcc;return function(_0x492e45){if(_0x492e45){return _0x58d91f[_0x7f24('0x18')](_0x33c7f9);}return _0x58d91f[_0x7f24('0x19')](_0x33c7f9)['end']();};}function respondWithResult(_0x137127,_0x4511a0){_0x4511a0=_0x4511a0||0xc8;return function(_0x4f1009){if(_0x4f1009){return _0x137127['status'](_0x4511a0)[_0x7f24('0x1a')](_0x4f1009);}};}function respondWithFilteredResult(_0x28cf22,_0xf91b17){return function(_0x23be6c){if(_0x23be6c){var _0x471d30=typeof _0xf91b17[_0x7f24('0x1b')]==='undefined'&&typeof _0xf91b17['limit']===_0x7f24('0x1c');var _0x3f41a7=_0x23be6c[_0x7f24('0x1d')];var _0x2e426a=_0x471d30?0x0:_0xf91b17[_0x7f24('0x1b')];var _0x235d71=_0x471d30?_0x23be6c[_0x7f24('0x1d')]:_0xf91b17['offset']+_0xf91b17[_0x7f24('0x1e')];var _0x41a3ae;if(_0x235d71>=_0x3f41a7){_0x235d71=_0x3f41a7;_0x41a3ae=0xc8;}else{_0x41a3ae=0xce;}_0x28cf22['status'](_0x41a3ae);return _0x28cf22[_0x7f24('0x1f')](_0x7f24('0x20'),_0x2e426a+'-'+_0x235d71+'/'+_0x3f41a7)[_0x7f24('0x1a')](_0x23be6c);}return null;};}function patchUpdates(_0x3aa275){return function(_0x3fbeef){try{jsonpatch[_0x7f24('0x21')](_0x3fbeef,_0x3aa275,!![]);}catch(_0xc3d85a){return BPromise[_0x7f24('0x22')](_0xc3d85a);}return _0x3fbeef[_0x7f24('0x23')]();};}function saveUpdates(_0x28e4be,_0x1ba1a4){return function(_0x146372){if(_0x146372){return _0x146372[_0x7f24('0x24')](_0x28e4be)[_0x7f24('0x25')](function(_0x45b435){return _0x45b435;});}return null;};}function removeEntity(_0x20c089,_0x1da0a0){return function(_0x2c275e){if(_0x2c275e){return _0x2c275e[_0x7f24('0x26')]()['then'](function(){_0x20c089[_0x7f24('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dac00,_0x40ca96){return function(_0x50230a){if(!_0x50230a){_0x1dac00[_0x7f24('0x18')](0x194);}return _0x50230a;};}function handleError(_0xa28ef0,_0x1441f9){_0x1441f9=_0x1441f9||0x1f4;return function(_0x11a670){logger[_0x7f24('0x27')](_0x11a670[_0x7f24('0x28')]);if(_0x11a670['name']){delete _0x11a670['name'];}_0xa28ef0[_0x7f24('0x19')](_0x1441f9)[_0x7f24('0x29')](_0x11a670);};}exports[_0x7f24('0x2a')]=function(_0x29f26c,_0x9518e4){var _0x236195={},_0x58fed1={},_0x1f9590={'count':0x0,'rows':[]};var _0x5cfb3e=_['map'](db['FreshsalesField']['rawAttributes'],function(_0x4210ce){return{'name':_0x4210ce[_0x7f24('0x2b')],'type':_0x4210ce[_0x7f24('0x2c')]['key']};});_0x58fed1[_0x7f24('0x2d')]=_[_0x7f24('0x2e')](_0x5cfb3e,_0x7f24('0x2f'));_0x58fed1[_0x7f24('0x30')]=_['keys'](_0x29f26c['query']);_0x58fed1[_0x7f24('0x31')]=_['intersection'](_0x58fed1[_0x7f24('0x2d')],_0x58fed1[_0x7f24('0x30')]);_0x236195[_0x7f24('0x32')]=_[_0x7f24('0x33')](_0x58fed1[_0x7f24('0x2d')],qs[_0x7f24('0x34')](_0x29f26c[_0x7f24('0x30')][_0x7f24('0x34')]));_0x236195[_0x7f24('0x32')]=_0x236195[_0x7f24('0x32')][_0x7f24('0x35')]?_0x236195['attributes']:_0x58fed1['model'];if(!_0x29f26c[_0x7f24('0x30')][_0x7f24('0x36')](_0x7f24('0x37'))){_0x236195[_0x7f24('0x1e')]=qs[_0x7f24('0x1e')](_0x29f26c['query'][_0x7f24('0x1e')]);_0x236195[_0x7f24('0x1b')]=qs['offset'](_0x29f26c['query']['offset']);}_0x236195[_0x7f24('0x38')]=qs['sort'](_0x29f26c[_0x7f24('0x30')]['sort']);_0x236195[_0x7f24('0x39')]=qs[_0x7f24('0x31')](_[_0x7f24('0x3a')](_0x29f26c[_0x7f24('0x30')],_0x58fed1[_0x7f24('0x31')]),_0x5cfb3e);if(_0x29f26c[_0x7f24('0x30')][_0x7f24('0x3b')]){_0x236195[_0x7f24('0x39')]=_[_0x7f24('0x3c')](_0x236195[_0x7f24('0x39')],{'$or':_['map'](_0x5cfb3e,function(_0x51b0f2){if(_0x51b0f2[_0x7f24('0x2c')]!==_0x7f24('0x3d')){var _0x42e1e8={};_0x42e1e8[_0x51b0f2[_0x7f24('0x2f')]]={'$like':'%'+_0x29f26c['query'][_0x7f24('0x3b')]+'%'};return _0x42e1e8;}})});}_0x236195=_[_0x7f24('0x3c')]({},_0x236195,_0x29f26c[_0x7f24('0x3e')]);var _0x48e4cc={'where':_0x236195['where']};return db['FreshsalesField'][_0x7f24('0x1d')](_0x48e4cc)[_0x7f24('0x25')](function(_0x4636a5){_0x1f9590[_0x7f24('0x1d')]=_0x4636a5;if(_0x29f26c[_0x7f24('0x30')][_0x7f24('0x3f')]){_0x236195[_0x7f24('0x40')]=[{'all':!![]}];}return db[_0x7f24('0x41')][_0x7f24('0x42')](_0x236195);})[_0x7f24('0x25')](function(_0xf5d8ca){_0x1f9590[_0x7f24('0x43')]=_0xf5d8ca;return _0x1f9590;})['then'](respondWithFilteredResult(_0x9518e4,_0x236195))['catch'](handleError(_0x9518e4,null));};exports[_0x7f24('0x44')]=function(_0x1e4333,_0x58105d){var _0x5245f2={'raw':!![],'where':{'id':_0x1e4333[_0x7f24('0x45')]['id']}},_0x173509={};_0x173509[_0x7f24('0x2d')]=_['keys'](db[_0x7f24('0x41')][_0x7f24('0x46')]);_0x173509[_0x7f24('0x30')]=_[_0x7f24('0x47')](_0x1e4333[_0x7f24('0x30')]);_0x173509[_0x7f24('0x31')]=_['intersection'](_0x173509[_0x7f24('0x2d')],_0x173509[_0x7f24('0x30')]);_0x5245f2[_0x7f24('0x32')]=_['intersection'](_0x173509[_0x7f24('0x2d')],qs['fields'](_0x1e4333[_0x7f24('0x30')][_0x7f24('0x34')]));_0x5245f2['attributes']=_0x5245f2['attributes'][_0x7f24('0x35')]?_0x5245f2[_0x7f24('0x32')]:_0x173509[_0x7f24('0x2d')];if(_0x1e4333[_0x7f24('0x30')][_0x7f24('0x3f')]){_0x5245f2[_0x7f24('0x40')]=[{'all':!![]}];}_0x5245f2=_[_0x7f24('0x3c')]({},_0x5245f2,_0x1e4333[_0x7f24('0x3e')]);return db[_0x7f24('0x41')][_0x7f24('0x48')](_0x5245f2)[_0x7f24('0x25')](handleEntityNotFound(_0x58105d,null))['then'](respondWithResult(_0x58105d,null))[_0x7f24('0x49')](handleError(_0x58105d,null));};exports[_0x7f24('0x4a')]=function(_0x4b16aa,_0x15bce9){return db[_0x7f24('0x41')][_0x7f24('0x4a')](_0x4b16aa[_0x7f24('0x4b')],{})[_0x7f24('0x25')](respondWithResult(_0x15bce9,0xc9))[_0x7f24('0x49')](handleError(_0x15bce9,null));};exports[_0x7f24('0x24')]=function(_0x4abcf8,_0x1a9dce){if(_0x4abcf8[_0x7f24('0x4b')]['id']){delete _0x4abcf8[_0x7f24('0x4b')]['id'];}return db[_0x7f24('0x41')][_0x7f24('0x48')]({'where':{'id':_0x4abcf8[_0x7f24('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a9dce,null))[_0x7f24('0x25')](saveUpdates(_0x4abcf8[_0x7f24('0x4b')],null))[_0x7f24('0x25')](respondWithResult(_0x1a9dce,null))[_0x7f24('0x49')](handleError(_0x1a9dce,null));};exports[_0x7f24('0x26')]=function(_0x4c85b7,_0x456020){return db[_0x7f24('0x41')]['find']({'where':{'id':_0x4c85b7[_0x7f24('0x45')]['id']}})[_0x7f24('0x25')](handleEntityNotFound(_0x456020,null))[_0x7f24('0x25')](removeEntity(_0x456020,null))[_0x7f24('0x49')](handleError(_0x456020,null));}; \ No newline at end of file +var _0x719a=['attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','params','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesField','rawAttributes','type','query','keys','filters','intersection','model','fields'];(function(_0x27fbe6,_0x118760){var _0x4817c3=function(_0x2bef96){while(--_0x2bef96){_0x27fbe6['push'](_0x27fbe6['shift']());}};_0x4817c3(++_0x118760);}(_0x719a,0x12a));var _0xa719=function(_0x2f2c16,_0x1e1168){_0x2f2c16=_0x2f2c16-0x0;var _0xfbf11b=_0x719a[_0x2f2c16];return _0xfbf11b;};'use strict';var emlformat=require(_0xa719('0x0'));var rimraf=require(_0xa719('0x1'));var zipdir=require(_0xa719('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa719('0x3'));var moment=require(_0xa719('0x4'));var BPromise=require(_0xa719('0x5'));var Mustache=require(_0xa719('0x6'));var util=require(_0xa719('0x7'));var path=require(_0xa719('0x8'));var sox=require('sox');var csv=require(_0xa719('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa719('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa719('0xb'));var jsforce=require(_0xa719('0xc'));var deskjs=require(_0xa719('0xd'));var toCsv=require(_0xa719('0x9'));var querystring=require(_0xa719('0xe'));var Papa=require('papaparse');var Redis=require(_0xa719('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa719('0x10'));var as=require(_0xa719('0x11'));var hardwareService=require(_0xa719('0x12'));var logger=require(_0xa719('0x13'))('api');var utils=require(_0xa719('0x14'));var config=require(_0xa719('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa719('0x16'))['db'];function respondWithStatusCode(_0x5d3776,_0x325e27){_0x325e27=_0x325e27||0xcc;return function(_0x5d547e){if(_0x5d547e){return _0x5d3776['sendStatus'](_0x325e27);}return _0x5d3776[_0xa719('0x17')](_0x325e27)[_0xa719('0x18')]();};}function respondWithResult(_0x129277,_0x11a06f){_0x11a06f=_0x11a06f||0xc8;return function(_0x2508ff){if(_0x2508ff){return _0x129277[_0xa719('0x17')](_0x11a06f)[_0xa719('0x19')](_0x2508ff);}};}function respondWithFilteredResult(_0x115a4b,_0x527066){return function(_0x3d75e4){if(_0x3d75e4){var _0x286c51=typeof _0x527066[_0xa719('0x1a')]===_0xa719('0x1b')&&typeof _0x527066[_0xa719('0x1c')]===_0xa719('0x1b');var _0x3fbdb0=_0x3d75e4[_0xa719('0x1d')];var _0x5117ea=_0x286c51?0x0:_0x527066[_0xa719('0x1a')];var _0x3a40a2=_0x286c51?_0x3d75e4[_0xa719('0x1d')]:_0x527066[_0xa719('0x1a')]+_0x527066['limit'];var _0x35c3d9;if(_0x3a40a2>=_0x3fbdb0){_0x3a40a2=_0x3fbdb0;_0x35c3d9=0xc8;}else{_0x35c3d9=0xce;}_0x115a4b['status'](_0x35c3d9);return _0x115a4b['set'](_0xa719('0x1e'),_0x5117ea+'-'+_0x3a40a2+'/'+_0x3fbdb0)[_0xa719('0x19')](_0x3d75e4);}return null;};}function patchUpdates(_0x2bd0c7){return function(_0x345b67){try{jsonpatch['apply'](_0x345b67,_0x2bd0c7,!![]);}catch(_0x3bcaa0){return BPromise[_0xa719('0x1f')](_0x3bcaa0);}return _0x345b67[_0xa719('0x20')]();};}function saveUpdates(_0x2ab55f,_0x36777c){return function(_0x211b22){if(_0x211b22){return _0x211b22[_0xa719('0x21')](_0x2ab55f)[_0xa719('0x22')](function(_0x14d2b7){return _0x14d2b7;});}return null;};}function removeEntity(_0x475aa7,_0x5d77b3){return function(_0x5d0804){if(_0x5d0804){return _0x5d0804[_0xa719('0x23')]()[_0xa719('0x22')](function(){_0x475aa7[_0xa719('0x17')](0xcc)[_0xa719('0x18')]();});}};}function handleEntityNotFound(_0x3c056b,_0x5e4429){return function(_0xdef301){if(!_0xdef301){_0x3c056b[_0xa719('0x24')](0x194);}return _0xdef301;};}function handleError(_0x1ba97f,_0x3eaf89){_0x3eaf89=_0x3eaf89||0x1f4;return function(_0x38878f){logger[_0xa719('0x25')](_0x38878f[_0xa719('0x26')]);if(_0x38878f[_0xa719('0x27')]){delete _0x38878f['name'];}_0x1ba97f[_0xa719('0x17')](_0x3eaf89)[_0xa719('0x28')](_0x38878f);};}exports[_0xa719('0x29')]=function(_0x472e6b,_0x499e70){var _0x298ef3={},_0x5a2b99={},_0x43f3b9={'count':0x0,'rows':[]};var _0x4c26a8=_[_0xa719('0x2a')](db[_0xa719('0x2b')][_0xa719('0x2c')],function(_0x3c46ba){return{'name':_0x3c46ba['fieldName'],'type':_0x3c46ba[_0xa719('0x2d')]['key']};});_0x5a2b99['model']=_[_0xa719('0x2a')](_0x4c26a8,'name');_0x5a2b99[_0xa719('0x2e')]=_[_0xa719('0x2f')](_0x472e6b[_0xa719('0x2e')]);_0x5a2b99[_0xa719('0x30')]=_[_0xa719('0x31')](_0x5a2b99[_0xa719('0x32')],_0x5a2b99['query']);_0x298ef3['attributes']=_[_0xa719('0x31')](_0x5a2b99['model'],qs[_0xa719('0x33')](_0x472e6b[_0xa719('0x2e')]['fields']));_0x298ef3[_0xa719('0x34')]=_0x298ef3[_0xa719('0x34')][_0xa719('0x35')]?_0x298ef3[_0xa719('0x34')]:_0x5a2b99[_0xa719('0x32')];if(!_0x472e6b[_0xa719('0x2e')][_0xa719('0x36')](_0xa719('0x37'))){_0x298ef3['limit']=qs[_0xa719('0x1c')](_0x472e6b[_0xa719('0x2e')][_0xa719('0x1c')]);_0x298ef3['offset']=qs['offset'](_0x472e6b[_0xa719('0x2e')][_0xa719('0x1a')]);}_0x298ef3[_0xa719('0x38')]=qs[_0xa719('0x39')](_0x472e6b['query'][_0xa719('0x39')]);_0x298ef3[_0xa719('0x3a')]=qs[_0xa719('0x30')](_['pick'](_0x472e6b[_0xa719('0x2e')],_0x5a2b99[_0xa719('0x30')]),_0x4c26a8);if(_0x472e6b[_0xa719('0x2e')][_0xa719('0x3b')]){_0x298ef3[_0xa719('0x3a')]=_[_0xa719('0x3c')](_0x298ef3[_0xa719('0x3a')],{'$or':_[_0xa719('0x2a')](_0x4c26a8,function(_0x2bf65f){if(_0x2bf65f[_0xa719('0x2d')]!==_0xa719('0x3d')){var _0x4e69ac={};_0x4e69ac[_0x2bf65f[_0xa719('0x27')]]={'$like':'%'+_0x472e6b['query'][_0xa719('0x3b')]+'%'};return _0x4e69ac;}})});}_0x298ef3=_['merge']({},_0x298ef3,_0x472e6b[_0xa719('0x3e')]);var _0x13d80b={'where':_0x298ef3['where']};return db[_0xa719('0x2b')][_0xa719('0x1d')](_0x13d80b)[_0xa719('0x22')](function(_0x1bf3f2){_0x43f3b9[_0xa719('0x1d')]=_0x1bf3f2;if(_0x472e6b[_0xa719('0x2e')][_0xa719('0x3f')]){_0x298ef3[_0xa719('0x40')]=[{'all':!![]}];}return db[_0xa719('0x2b')]['findAll'](_0x298ef3);})[_0xa719('0x22')](function(_0xb0dcc0){_0x43f3b9['rows']=_0xb0dcc0;return _0x43f3b9;})[_0xa719('0x22')](respondWithFilteredResult(_0x499e70,_0x298ef3))[_0xa719('0x41')](handleError(_0x499e70,null));};exports['show']=function(_0x98db65,_0x2c2515){var _0x32515b={'raw':!![],'where':{'id':_0x98db65[_0xa719('0x42')]['id']}},_0x5b31e4={};_0x5b31e4[_0xa719('0x32')]=_[_0xa719('0x2f')](db[_0xa719('0x2b')][_0xa719('0x2c')]);_0x5b31e4[_0xa719('0x2e')]=_[_0xa719('0x2f')](_0x98db65[_0xa719('0x2e')]);_0x5b31e4['filters']=_['intersection'](_0x5b31e4['model'],_0x5b31e4[_0xa719('0x2e')]);_0x32515b[_0xa719('0x34')]=_['intersection'](_0x5b31e4[_0xa719('0x32')],qs[_0xa719('0x33')](_0x98db65[_0xa719('0x2e')][_0xa719('0x33')]));_0x32515b[_0xa719('0x34')]=_0x32515b[_0xa719('0x34')][_0xa719('0x35')]?_0x32515b['attributes']:_0x5b31e4[_0xa719('0x32')];if(_0x98db65[_0xa719('0x2e')][_0xa719('0x3f')]){_0x32515b['include']=[{'all':!![]}];}_0x32515b=_['merge']({},_0x32515b,_0x98db65[_0xa719('0x3e')]);return db[_0xa719('0x2b')]['find'](_0x32515b)[_0xa719('0x22')](handleEntityNotFound(_0x2c2515,null))[_0xa719('0x22')](respondWithResult(_0x2c2515,null))['catch'](handleError(_0x2c2515,null));};exports[_0xa719('0x43')]=function(_0x488d69,_0x442936){return db[_0xa719('0x2b')][_0xa719('0x43')](_0x488d69[_0xa719('0x44')],{})[_0xa719('0x22')](respondWithResult(_0x442936,0xc9))['catch'](handleError(_0x442936,null));};exports[_0xa719('0x21')]=function(_0xb22283,_0x571467){if(_0xb22283[_0xa719('0x44')]['id']){delete _0xb22283['body']['id'];}return db['FreshsalesField'][_0xa719('0x45')]({'where':{'id':_0xb22283[_0xa719('0x42')]['id']}})[_0xa719('0x22')](handleEntityNotFound(_0x571467,null))['then'](saveUpdates(_0xb22283[_0xa719('0x44')],null))[_0xa719('0x22')](respondWithResult(_0x571467,null))[_0xa719('0x41')](handleError(_0x571467,null));};exports['destroy']=function(_0x2b3e1c,_0x2a86ef){return db[_0xa719('0x2b')][_0xa719('0x45')]({'where':{'id':_0x2b3e1c[_0xa719('0x42')]['id']}})[_0xa719('0x22')](handleEntityNotFound(_0x2a86ef,null))['then'](removeEntity(_0x2a86ef,null))[_0xa719('0x41')](handleError(_0x2a86ef,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index aa1f2dd..d7e5db6 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 _0xa8b1=['request-promise','../../config/environment','./intFreshsalesField.attributes','define','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2bda7e,_0x2b6d2f){var _0x10a523=function(_0x39feed){while(--_0x39feed){_0x2bda7e['push'](_0x2bda7e['shift']());}};_0x10a523(++_0x2b6d2f);}(_0xa8b1,0x182));var _0x1a8b=function(_0x319ac5,_0xe140cf){_0x319ac5=_0x319ac5-0x0;var _0x4b8b1b=_0xa8b1[_0x319ac5];return _0x4b8b1b;};'use strict';var _=require(_0x1a8b('0x0'));var util=require(_0x1a8b('0x1'));var logger=require(_0x1a8b('0x2'))(_0x1a8b('0x3'));var moment=require(_0x1a8b('0x4'));var BPromise=require(_0x1a8b('0x5'));var rp=require(_0x1a8b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a8b('0x7'));var attributes=require(_0x1a8b('0x8'));module['exports']=function(_0x2d90b8,_0x23d6ec){return _0x2d90b8[_0x1a8b('0x9')]('FreshsalesField',attributes,{'tableName':_0x1a8b('0xa'),'paranoid':![],'indexes':[{'name':_0x1a8b('0xb'),'fields':[_0x1a8b('0xc'),_0x1a8b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x065e=['int_freshsales_fields','idField','FieldId','lodash','moment','bluebird','request-promise','../../config/environment','./intFreshsalesField.attributes','define'];(function(_0x1064b8,_0x32e8ac){var _0x4a53bd=function(_0xe43f81){while(--_0xe43f81){_0x1064b8['push'](_0x1064b8['shift']());}};_0x4a53bd(++_0x32e8ac);}(_0x065e,0x1a7));var _0xe065=function(_0x1e1028,_0x3567b0){_0x1e1028=_0x1e1028-0x0;var _0x485eb1=_0x065e[_0x1e1028];return _0x485eb1;};'use strict';var _=require(_0xe065('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe065('0x1'));var BPromise=require(_0xe065('0x2'));var rp=require(_0xe065('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe065('0x4'));var attributes=require(_0xe065('0x5'));module['exports']=function(_0x10b45f,_0x1e7e69){return _0x10b45f[_0xe065('0x6')]('FreshsalesField',attributes,{'tableName':_0xe065('0x7'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xe065('0x8'),_0xe065('0x9')],'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 b59662e..2713ca2 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 _0xafc4=['error','code','message','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2ee42a,_0x14f94c){var _0x524489=function(_0x416f8d){while(--_0x416f8d){_0x2ee42a['push'](_0x2ee42a['shift']());}};_0x524489(++_0x14f94c);}(_0xafc4,0x69));var _0x4afc=function(_0x476cba,_0x34f187){_0x476cba=_0x476cba-0x0;var _0x176a68=_0xafc4[_0x476cba];return _0x176a68;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('FreshsalesField,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});} \ No newline at end of file +var _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x253de8,_0x38faa8){var _0x40f580=function(_0x5f2d21){while(--_0x5f2d21){_0x253de8['push'](_0x253de8['shift']());}};_0x40f580(++_0x38faa8);}(_0x1623,0xab));var _0x3162=function(_0x447fc0,_0x5966c9){_0x447fc0=_0x447fc0-0x0;var _0x106891=_0x1623[_0x447fc0];return _0x106891;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index df20d05..335463f 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x403e51,_0x2ddaa8){var _0x460c60=function(_0x189d8e){while(--_0x189d8e){_0x403e51['push'](_0x403e51['shift']());}};_0x460c60(++_0x2ddaa8);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4c7bdf,_0x590274){var _0x53f850=function(_0x46d1cd){while(--_0x46d1cd){_0x4c7bdf['push'](_0x4c7bdf['shift']());}};_0x53f850(++_0x590274);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 9af77ca..a67fd14 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 _0xaf30=['username','ENUM','integrationTab','newTab','exports','STRING'];(function(_0x4ecc0a,_0x1dc3b9){var _0x5e2deb=function(_0x17ecb4){while(--_0x17ecb4){_0x4ecc0a['push'](_0x4ecc0a['shift']());}};_0x5e2deb(++_0x1dc3b9);}(_0xaf30,0xd0));var _0x0af3=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0xaf30[_0x2abc3d];return _0x252745;};'use strict';var Sequelize=require('sequelize');module[_0x0af3('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0af3('0x1')]},'username':{'type':Sequelize[_0x0af3('0x1')],'unique':_0x0af3('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x0af3('0x1')]},'clientId':{'type':Sequelize[_0x0af3('0x1')]},'clientSecret':{'type':Sequelize[_0x0af3('0x1')]},'securityToken':{'type':Sequelize[_0x0af3('0x1')]},'serverUrl':{'type':Sequelize[_0x0af3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0af3('0x3')](_0x0af3('0x4'),_0x0af3('0x5')),'defaultValue':_0x0af3('0x4')}}; \ No newline at end of file +var _0x5f7b=['sequelize','exports','STRING','username','integrationTab','newTab'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0x5f7b,0x14a));var _0xb5f7=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x5f7b[_0x263a74];return _0x2aa86c;};'use strict';var Sequelize=require(_0xb5f7('0x0'));module[_0xb5f7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb5f7('0x2')]},'username':{'type':Sequelize[_0xb5f7('0x2')],'unique':_0xb5f7('0x3')},'remoteUri':{'type':Sequelize[_0xb5f7('0x2')]},'password':{'type':Sequelize[_0xb5f7('0x2')]},'clientId':{'type':Sequelize[_0xb5f7('0x2')]},'clientSecret':{'type':Sequelize[_0xb5f7('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb5f7('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb5f7('0x4'),_0xb5f7('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 09c074c..b9206d5 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 _0x9ecc=['create','body','getConfigurations','findOne','SalesforceConfiguration','map','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','securityToken','slice','substring','lastIndexOf','login','ticketType','sobject','describe','OwnerId','IsRecurrence','Subject','Description','string','int','boolean','email','textarea','phone','includes','label','custom','picklistValues','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SalesforceAccount','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x9ecc,0x19e));var _0xc9ec=function(_0x46075c,_0x1befde){_0x46075c=_0x46075c-0x0;var _0x46147d=_0x9ecc[_0x46075c];return _0x46147d;};'use strict';var emlformat=require(_0xc9ec('0x0'));var rimraf=require(_0xc9ec('0x1'));var zipdir=require(_0xc9ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9ec('0x3'));var moment=require('moment');var BPromise=require(_0xc9ec('0x4'));var Mustache=require('mustache');var util=require(_0xc9ec('0x5'));var path=require(_0xc9ec('0x6'));var sox=require(_0xc9ec('0x7'));var csv=require(_0xc9ec('0x8'));var ejs=require(_0xc9ec('0x9'));var fs=require('fs');var fs_extra=require(_0xc9ec('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc9ec('0xb'));var deskjs=require(_0xc9ec('0xc'));var toCsv=require(_0xc9ec('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc9ec('0xd'));var authService=require(_0xc9ec('0xe'));var qs=require(_0xc9ec('0xf'));var as=require(_0xc9ec('0x10'));var hardwareService=require(_0xc9ec('0x11'));var logger=require(_0xc9ec('0x12'))(_0xc9ec('0x13'));var utils=require(_0xc9ec('0x14'));var config=require(_0xc9ec('0x15'));var licenseUtil=require(_0xc9ec('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc9ec('0x17'));function respondWithStatusCode(_0x39cdaf,_0x21afe3){_0x21afe3=_0x21afe3||0xcc;return function(_0x4f4834){if(_0x4f4834){return _0x39cdaf[_0xc9ec('0x18')](_0x21afe3);}return _0x39cdaf[_0xc9ec('0x19')](_0x21afe3)[_0xc9ec('0x1a')]();};}function respondWithResult(_0x30480d,_0x1cba65){_0x1cba65=_0x1cba65||0xc8;return function(_0x45c6d5){if(_0x45c6d5){return _0x30480d[_0xc9ec('0x19')](_0x1cba65)[_0xc9ec('0x1b')](_0x45c6d5);}};}function respondWithFilteredResult(_0x27da89,_0x344ea8){return function(_0x563c7d){if(_0x563c7d){var _0x21a1eb=typeof _0x344ea8['offset']==='undefined'&&typeof _0x344ea8[_0xc9ec('0x1c')]===_0xc9ec('0x1d');var _0x58783f=_0x563c7d['count'];var _0x4ea3b8=_0x21a1eb?0x0:_0x344ea8[_0xc9ec('0x1e')];var _0x52de85=_0x21a1eb?_0x563c7d['count']:_0x344ea8[_0xc9ec('0x1e')]+_0x344ea8[_0xc9ec('0x1c')];var _0x522c1d;if(_0x52de85>=_0x58783f){_0x52de85=_0x58783f;_0x522c1d=0xc8;}else{_0x522c1d=0xce;}_0x27da89[_0xc9ec('0x19')](_0x522c1d);return _0x27da89[_0xc9ec('0x1f')](_0xc9ec('0x20'),_0x4ea3b8+'-'+_0x52de85+'/'+_0x58783f)[_0xc9ec('0x1b')](_0x563c7d);}return null;};}function patchUpdates(_0x4c90f1){return function(_0x15b525){try{jsonpatch[_0xc9ec('0x21')](_0x15b525,_0x4c90f1,!![]);}catch(_0x56a055){return BPromise[_0xc9ec('0x22')](_0x56a055);}return _0x15b525[_0xc9ec('0x23')]();};}function saveUpdates(_0x8eb8d3,_0x54b277){return function(_0x3ba11c){if(_0x3ba11c){return _0x3ba11c[_0xc9ec('0x24')](_0x8eb8d3)['then'](function(_0x29bc71){return _0x29bc71;});}return null;};}function removeEntity(_0x1fcaa7,_0x507052){return function(_0x527320){if(_0x527320){return _0x527320[_0xc9ec('0x25')]()[_0xc9ec('0x26')](function(){_0x1fcaa7[_0xc9ec('0x19')](0xcc)[_0xc9ec('0x1a')]();});}};}function handleEntityNotFound(_0x3daf7b,_0x29ea40){return function(_0xf6bb6f){if(!_0xf6bb6f){_0x3daf7b[_0xc9ec('0x18')](0x194);}return _0xf6bb6f;};}function handleError(_0x4de57d,_0x5bc1a3){_0x5bc1a3=_0x5bc1a3||0x1f4;return function(_0x1ba8c4){logger[_0xc9ec('0x27')](_0x1ba8c4[_0xc9ec('0x28')]);if(_0x1ba8c4[_0xc9ec('0x29')]){delete _0x1ba8c4[_0xc9ec('0x29')];}_0x4de57d[_0xc9ec('0x19')](_0x5bc1a3)[_0xc9ec('0x2a')](_0x1ba8c4);};}exports[_0xc9ec('0x2b')]=function(_0x407aee,_0x3c247a){var _0x21246d={},_0x40924c={},_0x1a376d={'count':0x0,'rows':[]};var _0x502da9=_['map'](db['SalesforceAccount'][_0xc9ec('0x2c')],function(_0x1f51c9){return{'name':_0x1f51c9['fieldName'],'type':_0x1f51c9[_0xc9ec('0x2d')][_0xc9ec('0x2e')]};});_0x40924c[_0xc9ec('0x2f')]=_['map'](_0x502da9,_0xc9ec('0x29'));_0x40924c[_0xc9ec('0x30')]=_['keys'](_0x407aee[_0xc9ec('0x30')]);_0x40924c[_0xc9ec('0x31')]=_['intersection'](_0x40924c[_0xc9ec('0x2f')],_0x40924c[_0xc9ec('0x30')]);_0x21246d['attributes']=_['intersection'](_0x40924c['model'],qs['fields'](_0x407aee[_0xc9ec('0x30')][_0xc9ec('0x32')]));_0x21246d[_0xc9ec('0x33')]=_0x21246d['attributes'][_0xc9ec('0x34')]?_0x21246d['attributes']:_0x40924c[_0xc9ec('0x2f')];if(!_0x407aee[_0xc9ec('0x30')][_0xc9ec('0x35')](_0xc9ec('0x36'))){_0x21246d['limit']=qs[_0xc9ec('0x1c')](_0x407aee[_0xc9ec('0x30')][_0xc9ec('0x1c')]);_0x21246d['offset']=qs[_0xc9ec('0x1e')](_0x407aee['query'][_0xc9ec('0x1e')]);}_0x21246d[_0xc9ec('0x37')]=qs[_0xc9ec('0x38')](_0x407aee[_0xc9ec('0x30')][_0xc9ec('0x38')]);_0x21246d[_0xc9ec('0x39')]=qs['filters'](_[_0xc9ec('0x3a')](_0x407aee[_0xc9ec('0x30')],_0x40924c[_0xc9ec('0x31')]),_0x502da9);if(_0x407aee['query'][_0xc9ec('0x3b')]){_0x21246d[_0xc9ec('0x39')]=_[_0xc9ec('0x3c')](_0x21246d[_0xc9ec('0x39')],{'$or':_['map'](_0x502da9,function(_0x76e72b){if(_0x76e72b[_0xc9ec('0x2d')]!==_0xc9ec('0x3d')){var _0xd4859a={};_0xd4859a[_0x76e72b[_0xc9ec('0x29')]]={'$like':'%'+_0x407aee[_0xc9ec('0x30')][_0xc9ec('0x3b')]+'%'};return _0xd4859a;}})});}_0x21246d=_['merge']({},_0x21246d,_0x407aee[_0xc9ec('0x3e')]);var _0x4c3205={'where':_0x21246d[_0xc9ec('0x39')]};return db[_0xc9ec('0x3f')]['count'](_0x4c3205)[_0xc9ec('0x26')](function(_0x56be0f){_0x1a376d['count']=_0x56be0f;if(_0x407aee[_0xc9ec('0x30')][_0xc9ec('0x40')]){_0x21246d[_0xc9ec('0x41')]=[{'all':!![]}];}return db[_0xc9ec('0x3f')][_0xc9ec('0x42')](_0x21246d);})[_0xc9ec('0x26')](function(_0x3f5264){_0x1a376d[_0xc9ec('0x43')]=_0x3f5264;return _0x1a376d;})['then'](respondWithFilteredResult(_0x3c247a,_0x21246d))[_0xc9ec('0x44')](handleError(_0x3c247a,null));};exports[_0xc9ec('0x45')]=function(_0x485716,_0x1942d2){var _0x5e6d64={'raw':![],'where':{'id':_0x485716[_0xc9ec('0x46')]['id']}},_0x3350b5={};_0x3350b5[_0xc9ec('0x2f')]=_[_0xc9ec('0x47')](db[_0xc9ec('0x3f')][_0xc9ec('0x2c')]);_0x3350b5[_0xc9ec('0x30')]=_['keys'](_0x485716[_0xc9ec('0x30')]);_0x3350b5[_0xc9ec('0x31')]=_[_0xc9ec('0x48')](_0x3350b5[_0xc9ec('0x2f')],_0x3350b5[_0xc9ec('0x30')]);_0x5e6d64[_0xc9ec('0x33')]=_[_0xc9ec('0x48')](_0x3350b5['model'],qs[_0xc9ec('0x32')](_0x485716[_0xc9ec('0x30')]['fields']));_0x5e6d64[_0xc9ec('0x33')]=_0x5e6d64['attributes']['length']?_0x5e6d64[_0xc9ec('0x33')]:_0x3350b5['model'];if(_0x485716[_0xc9ec('0x30')][_0xc9ec('0x40')]){_0x5e6d64[_0xc9ec('0x41')]=[{'all':!![]}];}_0x5e6d64=_[_0xc9ec('0x3c')]({},_0x5e6d64,_0x485716[_0xc9ec('0x3e')]);return db['SalesforceAccount'][_0xc9ec('0x49')](_0x5e6d64)[_0xc9ec('0x26')](handleEntityNotFound(_0x1942d2,null))['then'](respondWithResult(_0x1942d2,null))[_0xc9ec('0x44')](handleError(_0x1942d2,null));};exports[_0xc9ec('0x4a')]=function(_0x55ec63,_0x363a8f){return db[_0xc9ec('0x3f')][_0xc9ec('0x4a')](_0x55ec63[_0xc9ec('0x4b')],{})[_0xc9ec('0x26')](respondWithResult(_0x363a8f,0xc9))[_0xc9ec('0x44')](handleError(_0x363a8f,null));};exports['update']=function(_0x2aa8cb,_0x22090b){if(_0x2aa8cb['body']['id']){delete _0x2aa8cb[_0xc9ec('0x4b')]['id'];}return db[_0xc9ec('0x3f')]['find']({'where':{'id':_0x2aa8cb[_0xc9ec('0x46')]['id']}})[_0xc9ec('0x26')](handleEntityNotFound(_0x22090b,null))[_0xc9ec('0x26')](saveUpdates(_0x2aa8cb[_0xc9ec('0x4b')],null))[_0xc9ec('0x26')](respondWithResult(_0x22090b,null))['catch'](handleError(_0x22090b,null));};exports[_0xc9ec('0x25')]=function(_0x3e4dac,_0x43229b){return db[_0xc9ec('0x3f')][_0xc9ec('0x49')]({'where':{'id':_0x3e4dac[_0xc9ec('0x46')]['id']}})[_0xc9ec('0x26')](handleEntityNotFound(_0x43229b,null))['then'](removeEntity(_0x43229b,null))[_0xc9ec('0x44')](handleError(_0x43229b,null));};exports[_0xc9ec('0x4c')]=function(_0x237cfc,_0x255731,_0x2e3d8d){var _0x429bb4={};var _0x522d72={};var _0x1414c1;var _0x57ffcb;return db[_0xc9ec('0x3f')][_0xc9ec('0x4d')]({'where':{'id':_0x237cfc['params']['id']}})[_0xc9ec('0x26')](handleEntityNotFound(_0x255731,null))['then'](function(_0x3e784f){if(_0x3e784f){_0x1414c1=_0x3e784f;_0x522d72['model']=_[_0xc9ec('0x47')](db[_0xc9ec('0x4e')][_0xc9ec('0x2c')]);_0x522d72[_0xc9ec('0x30')]=_[_0xc9ec('0x47')](_0x237cfc[_0xc9ec('0x30')]);_0x522d72[_0xc9ec('0x31')]=_[_0xc9ec('0x48')](_0x522d72['model'],_0x522d72[_0xc9ec('0x30')]);_0x429bb4[_0xc9ec('0x33')]=_['intersection'](_0x522d72[_0xc9ec('0x2f')],qs[_0xc9ec('0x32')](_0x237cfc[_0xc9ec('0x30')][_0xc9ec('0x32')]));_0x429bb4[_0xc9ec('0x33')]=_0x429bb4[_0xc9ec('0x33')][_0xc9ec('0x34')]?_0x429bb4['attributes']:_0x522d72[_0xc9ec('0x2f')];_0x429bb4[_0xc9ec('0x37')]=qs[_0xc9ec('0x38')](_0x237cfc[_0xc9ec('0x30')][_0xc9ec('0x38')]);_0x429bb4['where']=qs[_0xc9ec('0x31')](_['pick'](_0x237cfc['query'],_0x522d72[_0xc9ec('0x31')]));if(_0x237cfc[_0xc9ec('0x30')][_0xc9ec('0x3b')]){_0x429bb4[_0xc9ec('0x39')]=_[_0xc9ec('0x3c')](_0x429bb4[_0xc9ec('0x39')],{'$or':_[_0xc9ec('0x4f')](_0x429bb4[_0xc9ec('0x33')],function(_0x56d5fe){var _0x57c212={};_0x57c212[_0x56d5fe]={'$like':'%'+_0x237cfc[_0xc9ec('0x30')][_0xc9ec('0x3b')]+'%'};return _0x57c212;})});}_0x429bb4=_[_0xc9ec('0x3c')]({},_0x429bb4,_0x237cfc[_0xc9ec('0x3e')]);return _0x1414c1[_0xc9ec('0x4c')](_0x429bb4);}})[_0xc9ec('0x26')](function(_0x4b3ad2){if(_0x4b3ad2){_0x57ffcb=_0x4b3ad2[_0xc9ec('0x34')];if(!_0x237cfc['query']['hasOwnProperty']('nolimit')){_0x429bb4[_0xc9ec('0x1c')]=qs[_0xc9ec('0x1c')](_0x237cfc['query'][_0xc9ec('0x1c')]);_0x429bb4['offset']=qs['offset'](_0x237cfc['query'][_0xc9ec('0x1e')]);}return _0x1414c1[_0xc9ec('0x4c')](_0x429bb4);}})[_0xc9ec('0x26')](function(_0xb9f1d2){if(_0xb9f1d2){return _0xb9f1d2?{'count':_0x57ffcb,'rows':_0xb9f1d2}:null;}})[_0xc9ec('0x26')](respondWithResult(_0x255731,null))[_0xc9ec('0x44')](handleError(_0x255731,null));};exports[_0xc9ec('0x50')]=function(_0x1afc34,_0x4c3c93,_0xbbfd60){if(_0x1afc34[_0xc9ec('0x4b')]['id']){delete _0x1afc34[_0xc9ec('0x4b')]['id'];}return db[_0xc9ec('0x3f')]['findOne']({'where':{'id':_0x1afc34[_0xc9ec('0x46')]['id']}})['then'](handleEntityNotFound(_0x4c3c93,null))[_0xc9ec('0x26')](function(_0x5519cb){if(_0x5519cb){_0x1afc34[_0xc9ec('0x4b')][_0xc9ec('0x51')]=_0x5519cb['id'];_0x1afc34[_0xc9ec('0x4b')][_0xc9ec('0x52')]=integrations[_0xc9ec('0x53')](_0x1afc34[_0xc9ec('0x4b')][_0xc9ec('0x54')],_0x1afc34[_0xc9ec('0x4b')][_0xc9ec('0x2d')]);_0x1afc34['body'][_0xc9ec('0x55')]=integrations['getDescriptions'](_0x1afc34[_0xc9ec('0x4b')][_0xc9ec('0x54')],_0x1afc34[_0xc9ec('0x4b')]['type']);return db[_0xc9ec('0x4e')]['create'](_0x1afc34[_0xc9ec('0x4b')],{'include':[{'model':db[_0xc9ec('0x56')],'as':_0xc9ec('0x52')},{'model':db['SalesforceField'],'as':_0xc9ec('0x55')}]});}return null;})['then'](respondWithResult(_0x4c3c93,null))[_0xc9ec('0x44')](handleError(_0x4c3c93,null));};exports[_0xc9ec('0x57')]=function(_0x1bb295,_0x47439e,_0x32705c){var _0x164cd8;var _0x5de914='';var _0x426c4c=_0xc9ec('0x58');return db[_0xc9ec('0x3f')][_0xc9ec('0x4d')]({'where':{'id':_0x1bb295[_0xc9ec('0x46')]['id']},'attributes':['id',_0xc9ec('0x59'),_0xc9ec('0x5a'),_0xc9ec('0x5b'),_0xc9ec('0x5c'),'password',_0xc9ec('0x5d')]})[_0xc9ec('0x26')](handleEntityNotFound(_0x47439e,null))['then'](function(_0x692c04){if(_0x692c04){_0x5de914=_0x692c04[_0xc9ec('0x59')];var _0x58665c=_0x5de914[_0xc9ec('0x5e')](-0x1);if(_0x58665c==='/'){_0x5de914=_0x5de914[_0xc9ec('0x5f')](0x0,_0x5de914[_0xc9ec('0x60')](_0x58665c));}_0x164cd8=new jsforce['Connection']({'oauth2':{'loginUrl':_0x5de914,'clientId':_0x692c04[_0xc9ec('0x5a')],'clientSecret':_0x692c04[_0xc9ec('0x5b')]}});return _0x164cd8[_0xc9ec('0x61')](_0x692c04[_0xc9ec('0x5c')],_0x692c04['password']['concat'](_0x692c04[_0xc9ec('0x5d')]));}})[_0xc9ec('0x26')](function(_0x5ad056){if(_0x5ad056){if(!_['isNil'](_0x1bb295[_0xc9ec('0x30')][_0xc9ec('0x62')])){_0x426c4c=_0x1bb295[_0xc9ec('0x30')][_0xc9ec('0x62')];}return _0x164cd8[_0xc9ec('0x63')](_0x426c4c)[_0xc9ec('0x64')]();}})['then'](function(_0x4972ae){var _0x4319a1=[_0xc9ec('0x65'),'ActivityDate','IsReminderSet',_0xc9ec('0x66'),_0xc9ec('0x67'),_0xc9ec('0x68')];var _0x3a135d=[_0xc9ec('0x69'),_0xc9ec('0x6a'),'picklist',_0xc9ec('0x6b'),_0xc9ec('0x6c'),_0xc9ec('0x6d'),_0xc9ec('0x6e')];if(_0x4972ae){_['remove'](_0x4972ae['fields'],function(_0x3c3fb3){return _0x4319a1['includes'](_0x3c3fb3[_0xc9ec('0x29')])||!_0x3a135d[_0xc9ec('0x6f')](_0x3c3fb3[_0xc9ec('0x2d')]);});return{'count':_0x4972ae[_0xc9ec('0x32')]['length'],'rows':_[_0xc9ec('0x4f')](_0x4972ae[_0xc9ec('0x32')],function(_0x12a103){return{'id':_0x12a103[_0xc9ec('0x29')],'name':_0x12a103[_0xc9ec('0x70')],'custom':_0x12a103[_0xc9ec('0x71')],'options':_0x12a103[_0xc9ec('0x72')][_0xc9ec('0x34')]>0x0?_['map'](_0x12a103['picklistValues'],function(_0x5a558a){return{'name':_0x5a558a[_0xc9ec('0x70')],'value':_0x5a558a['value']};}):_0x12a103[_0xc9ec('0x2d')]=='boolean'?[{'name':_0xc9ec('0x73'),'value':_0xc9ec('0x74')},{'name':'False','value':_0xc9ec('0x75')}]:[]};})};}})[_0xc9ec('0x26')](respondWithResult(_0x47439e,null))[_0xc9ec('0x44')](function(_0x22c6ac){var _0x3f7b6c=_0x1bb295[_0xc9ec('0x30')][_0xc9ec('0x76')]?0x1f4:_0x22c6ac[_0xc9ec('0x77')]||0x1f4;logger[_0xc9ec('0x27')](_0xc9ec('0x78'),'getFields',_0x3f7b6c,JSON['stringify'](_0x22c6ac));delete _0x22c6ac[_0xc9ec('0x29')];if(_0x3f7b6c===0x191){_0x3f7b6c=0x190;}_0x47439e[_0xc9ec('0x19')](_0x3f7b6c)[_0xc9ec('0x2a')](_0x1bb295[_0xc9ec('0x30')][_0xc9ec('0x76')]?{'message':_0xc9ec('0x79'),'statusCode':_0x22c6ac[_0xc9ec('0x77')]}:_0x22c6ac);});}; \ No newline at end of file +var _0xd798=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','SalesforceAccount','includeAll','findAll','rows','catch','show','fields','length','include','options','find','create','body','params','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','Subjects','Descriptions','getDescriptions','getFields','Task','remoteUri','clientSecret','username','password','securityToken','slice','substring','Connection','clientId','login','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','boolean','email','textarea','phone','remove','includes','picklistValues','label','value','True','true','False','false','test','statusCode','error','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x2bda2b,_0xc5bb5d){var _0x50dbb2=function(_0x771760){while(--_0x771760){_0x2bda2b['push'](_0x2bda2b['shift']());}};_0x50dbb2(++_0xc5bb5d);}(_0xd798,0x78));var _0x8d79=function(_0x257248,_0x5b7246){_0x257248=_0x257248-0x0;var _0xccfe94=_0xd798[_0x257248];return _0xccfe94;};'use strict';var emlformat=require(_0x8d79('0x0'));var rimraf=require(_0x8d79('0x1'));var zipdir=require(_0x8d79('0x2'));var jsonpatch=require(_0x8d79('0x3'));var rp=require(_0x8d79('0x4'));var moment=require(_0x8d79('0x5'));var BPromise=require(_0x8d79('0x6'));var Mustache=require(_0x8d79('0x7'));var util=require(_0x8d79('0x8'));var path=require('path');var sox=require(_0x8d79('0x9'));var csv=require('to-csv');var ejs=require(_0x8d79('0xa'));var fs=require('fs');var fs_extra=require(_0x8d79('0xb'));var _=require(_0x8d79('0xc'));var squel=require(_0x8d79('0xd'));var crypto=require(_0x8d79('0xe'));var jsforce=require(_0x8d79('0xf'));var deskjs=require(_0x8d79('0x10'));var toCsv=require(_0x8d79('0x11'));var querystring=require(_0x8d79('0x12'));var Papa=require(_0x8d79('0x13'));var Redis=require('ioredis');var authService=require(_0x8d79('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8d79('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d79('0x16'))(_0x8d79('0x17'));var utils=require(_0x8d79('0x18'));var config=require(_0x8d79('0x19'));var licenseUtil=require(_0x8d79('0x1a'));var db=require(_0x8d79('0x1b'))['db'];var integrations=require(_0x8d79('0x1c'));function respondWithStatusCode(_0x504094,_0x247cd9){_0x247cd9=_0x247cd9||0xcc;return function(_0x115763){if(_0x115763){return _0x504094[_0x8d79('0x1d')](_0x247cd9);}return _0x504094['status'](_0x247cd9)['end']();};}function respondWithResult(_0x35a8ae,_0x29df3b){_0x29df3b=_0x29df3b||0xc8;return function(_0x5c9ded){if(_0x5c9ded){return _0x35a8ae[_0x8d79('0x1e')](_0x29df3b)[_0x8d79('0x1f')](_0x5c9ded);}};}function respondWithFilteredResult(_0x31d2e5,_0xa71bc5){return function(_0x501439){if(_0x501439){var _0x4805bf=typeof _0xa71bc5[_0x8d79('0x20')]==='undefined'&&typeof _0xa71bc5[_0x8d79('0x21')]===_0x8d79('0x22');var _0xb58fd3=_0x501439[_0x8d79('0x23')];var _0x23175e=_0x4805bf?0x0:_0xa71bc5[_0x8d79('0x20')];var _0x5afb54=_0x4805bf?_0x501439[_0x8d79('0x23')]:_0xa71bc5[_0x8d79('0x20')]+_0xa71bc5[_0x8d79('0x21')];var _0x1526fe;if(_0x5afb54>=_0xb58fd3){_0x5afb54=_0xb58fd3;_0x1526fe=0xc8;}else{_0x1526fe=0xce;}_0x31d2e5['status'](_0x1526fe);return _0x31d2e5[_0x8d79('0x24')](_0x8d79('0x25'),_0x23175e+'-'+_0x5afb54+'/'+_0xb58fd3)[_0x8d79('0x1f')](_0x501439);}return null;};}function patchUpdates(_0x497e7a){return function(_0x2ae320){try{jsonpatch[_0x8d79('0x26')](_0x2ae320,_0x497e7a,!![]);}catch(_0x57ae98){return BPromise[_0x8d79('0x27')](_0x57ae98);}return _0x2ae320[_0x8d79('0x28')]();};}function saveUpdates(_0x190ab2,_0x1db4e4){return function(_0x1e8126){if(_0x1e8126){return _0x1e8126[_0x8d79('0x29')](_0x190ab2)[_0x8d79('0x2a')](function(_0x2d4aa3){return _0x2d4aa3;});}return null;};}function removeEntity(_0x1eb5dd,_0x381e29){return function(_0x566366){if(_0x566366){return _0x566366[_0x8d79('0x2b')]()['then'](function(){_0x1eb5dd[_0x8d79('0x1e')](0xcc)[_0x8d79('0x2c')]();});}};}function handleEntityNotFound(_0x2a10cd,_0x256618){return function(_0x14e8ae){if(!_0x14e8ae){_0x2a10cd[_0x8d79('0x1d')](0x194);}return _0x14e8ae;};}function handleError(_0xe60142,_0x5868b0){_0x5868b0=_0x5868b0||0x1f4;return function(_0x291ecd){logger['error'](_0x291ecd[_0x8d79('0x2d')]);if(_0x291ecd[_0x8d79('0x2e')]){delete _0x291ecd[_0x8d79('0x2e')];}_0xe60142[_0x8d79('0x1e')](_0x5868b0)['send'](_0x291ecd);};}exports[_0x8d79('0x2f')]=function(_0x3614c8,_0x2fe5ef){var _0x52dc5e={},_0x4b630e={},_0x4e2eed={'count':0x0,'rows':[]};var _0x3add0c=_['map'](db['SalesforceAccount'][_0x8d79('0x30')],function(_0x15c94f){return{'name':_0x15c94f[_0x8d79('0x31')],'type':_0x15c94f['type'][_0x8d79('0x32')]};});_0x4b630e[_0x8d79('0x33')]=_['map'](_0x3add0c,_0x8d79('0x2e'));_0x4b630e['query']=_[_0x8d79('0x34')](_0x3614c8[_0x8d79('0x35')]);_0x4b630e[_0x8d79('0x36')]=_[_0x8d79('0x37')](_0x4b630e[_0x8d79('0x33')],_0x4b630e['query']);_0x52dc5e['attributes']=_['intersection'](_0x4b630e[_0x8d79('0x33')],qs['fields'](_0x3614c8[_0x8d79('0x35')]['fields']));_0x52dc5e['attributes']=_0x52dc5e[_0x8d79('0x38')]['length']?_0x52dc5e[_0x8d79('0x38')]:_0x4b630e['model'];if(!_0x3614c8[_0x8d79('0x35')][_0x8d79('0x39')](_0x8d79('0x3a'))){_0x52dc5e[_0x8d79('0x21')]=qs['limit'](_0x3614c8[_0x8d79('0x35')][_0x8d79('0x21')]);_0x52dc5e[_0x8d79('0x20')]=qs[_0x8d79('0x20')](_0x3614c8[_0x8d79('0x35')][_0x8d79('0x20')]);}_0x52dc5e[_0x8d79('0x3b')]=qs['sort'](_0x3614c8['query'][_0x8d79('0x3c')]);_0x52dc5e['where']=qs[_0x8d79('0x36')](_[_0x8d79('0x3d')](_0x3614c8[_0x8d79('0x35')],_0x4b630e[_0x8d79('0x36')]),_0x3add0c);if(_0x3614c8['query'][_0x8d79('0x3e')]){_0x52dc5e[_0x8d79('0x3f')]=_[_0x8d79('0x40')](_0x52dc5e[_0x8d79('0x3f')],{'$or':_[_0x8d79('0x41')](_0x3add0c,function(_0x3096ae){if(_0x3096ae[_0x8d79('0x42')]!==_0x8d79('0x43')){var _0x46a6db={};_0x46a6db[_0x3096ae['name']]={'$like':'%'+_0x3614c8[_0x8d79('0x35')][_0x8d79('0x3e')]+'%'};return _0x46a6db;}})});}_0x52dc5e=_[_0x8d79('0x40')]({},_0x52dc5e,_0x3614c8['options']);var _0x25833e={'where':_0x52dc5e[_0x8d79('0x3f')]};return db[_0x8d79('0x44')][_0x8d79('0x23')](_0x25833e)[_0x8d79('0x2a')](function(_0xc77022){_0x4e2eed[_0x8d79('0x23')]=_0xc77022;if(_0x3614c8[_0x8d79('0x35')][_0x8d79('0x45')]){_0x52dc5e['include']=[{'all':!![]}];}return db[_0x8d79('0x44')][_0x8d79('0x46')](_0x52dc5e);})['then'](function(_0x4c12ff){_0x4e2eed[_0x8d79('0x47')]=_0x4c12ff;return _0x4e2eed;})[_0x8d79('0x2a')](respondWithFilteredResult(_0x2fe5ef,_0x52dc5e))[_0x8d79('0x48')](handleError(_0x2fe5ef,null));};exports[_0x8d79('0x49')]=function(_0x16d511,_0x2741ba){var _0x4daeb5={'raw':![],'where':{'id':_0x16d511['params']['id']}},_0x45e477={};_0x45e477[_0x8d79('0x33')]=_[_0x8d79('0x34')](db['SalesforceAccount'][_0x8d79('0x30')]);_0x45e477['query']=_[_0x8d79('0x34')](_0x16d511[_0x8d79('0x35')]);_0x45e477[_0x8d79('0x36')]=_[_0x8d79('0x37')](_0x45e477[_0x8d79('0x33')],_0x45e477[_0x8d79('0x35')]);_0x4daeb5[_0x8d79('0x38')]=_[_0x8d79('0x37')](_0x45e477['model'],qs['fields'](_0x16d511[_0x8d79('0x35')][_0x8d79('0x4a')]));_0x4daeb5['attributes']=_0x4daeb5['attributes'][_0x8d79('0x4b')]?_0x4daeb5[_0x8d79('0x38')]:_0x45e477[_0x8d79('0x33')];if(_0x16d511[_0x8d79('0x35')][_0x8d79('0x45')]){_0x4daeb5[_0x8d79('0x4c')]=[{'all':!![]}];}_0x4daeb5=_['merge']({},_0x4daeb5,_0x16d511[_0x8d79('0x4d')]);return db['SalesforceAccount'][_0x8d79('0x4e')](_0x4daeb5)[_0x8d79('0x2a')](handleEntityNotFound(_0x2741ba,null))[_0x8d79('0x2a')](respondWithResult(_0x2741ba,null))[_0x8d79('0x48')](handleError(_0x2741ba,null));};exports[_0x8d79('0x4f')]=function(_0x362e29,_0x229f58){return db['SalesforceAccount'][_0x8d79('0x4f')](_0x362e29[_0x8d79('0x50')],{})[_0x8d79('0x2a')](respondWithResult(_0x229f58,0xc9))[_0x8d79('0x48')](handleError(_0x229f58,null));};exports[_0x8d79('0x29')]=function(_0x306c3f,_0x4da2df){if(_0x306c3f[_0x8d79('0x50')]['id']){delete _0x306c3f[_0x8d79('0x50')]['id'];}return db['SalesforceAccount'][_0x8d79('0x4e')]({'where':{'id':_0x306c3f[_0x8d79('0x51')]['id']}})['then'](handleEntityNotFound(_0x4da2df,null))[_0x8d79('0x2a')](saveUpdates(_0x306c3f[_0x8d79('0x50')],null))[_0x8d79('0x2a')](respondWithResult(_0x4da2df,null))[_0x8d79('0x48')](handleError(_0x4da2df,null));};exports[_0x8d79('0x2b')]=function(_0x3c32d8,_0x261b66){return db['SalesforceAccount'][_0x8d79('0x4e')]({'where':{'id':_0x3c32d8[_0x8d79('0x51')]['id']}})[_0x8d79('0x2a')](handleEntityNotFound(_0x261b66,null))[_0x8d79('0x2a')](removeEntity(_0x261b66,null))[_0x8d79('0x48')](handleError(_0x261b66,null));};exports['getConfigurations']=function(_0x1c9718,_0x2575d8,_0x30771c){var _0x31cb1e={};var _0x23af6e={};var _0x3c8b37;var _0x56d8d3;return db['SalesforceAccount'][_0x8d79('0x52')]({'where':{'id':_0x1c9718[_0x8d79('0x51')]['id']}})[_0x8d79('0x2a')](handleEntityNotFound(_0x2575d8,null))[_0x8d79('0x2a')](function(_0xa84cf8){if(_0xa84cf8){_0x3c8b37=_0xa84cf8;_0x23af6e[_0x8d79('0x33')]=_[_0x8d79('0x34')](db[_0x8d79('0x53')][_0x8d79('0x30')]);_0x23af6e[_0x8d79('0x35')]=_[_0x8d79('0x34')](_0x1c9718[_0x8d79('0x35')]);_0x23af6e[_0x8d79('0x36')]=_['intersection'](_0x23af6e[_0x8d79('0x33')],_0x23af6e[_0x8d79('0x35')]);_0x31cb1e['attributes']=_['intersection'](_0x23af6e[_0x8d79('0x33')],qs[_0x8d79('0x4a')](_0x1c9718[_0x8d79('0x35')][_0x8d79('0x4a')]));_0x31cb1e[_0x8d79('0x38')]=_0x31cb1e['attributes']['length']?_0x31cb1e['attributes']:_0x23af6e[_0x8d79('0x33')];_0x31cb1e[_0x8d79('0x3b')]=qs[_0x8d79('0x3c')](_0x1c9718[_0x8d79('0x35')][_0x8d79('0x3c')]);_0x31cb1e[_0x8d79('0x3f')]=qs[_0x8d79('0x36')](_['pick'](_0x1c9718[_0x8d79('0x35')],_0x23af6e[_0x8d79('0x36')]));if(_0x1c9718['query'][_0x8d79('0x3e')]){_0x31cb1e[_0x8d79('0x3f')]=_['merge'](_0x31cb1e['where'],{'$or':_['map'](_0x31cb1e[_0x8d79('0x38')],function(_0x2df5a2){var _0x2a2142={};_0x2a2142[_0x2df5a2]={'$like':'%'+_0x1c9718[_0x8d79('0x35')][_0x8d79('0x3e')]+'%'};return _0x2a2142;})});}_0x31cb1e=_[_0x8d79('0x40')]({},_0x31cb1e,_0x1c9718[_0x8d79('0x4d')]);return _0x3c8b37[_0x8d79('0x54')](_0x31cb1e);}})['then'](function(_0x56eefe){if(_0x56eefe){_0x56d8d3=_0x56eefe[_0x8d79('0x4b')];if(!_0x1c9718['query']['hasOwnProperty'](_0x8d79('0x3a'))){_0x31cb1e[_0x8d79('0x21')]=qs[_0x8d79('0x21')](_0x1c9718[_0x8d79('0x35')][_0x8d79('0x21')]);_0x31cb1e['offset']=qs[_0x8d79('0x20')](_0x1c9718[_0x8d79('0x35')][_0x8d79('0x20')]);}return _0x3c8b37['getConfigurations'](_0x31cb1e);}})[_0x8d79('0x2a')](function(_0x2ad5e2){if(_0x2ad5e2){return _0x2ad5e2?{'count':_0x56d8d3,'rows':_0x2ad5e2}:null;}})[_0x8d79('0x2a')](respondWithResult(_0x2575d8,null))[_0x8d79('0x48')](handleError(_0x2575d8,null));};exports[_0x8d79('0x55')]=function(_0x3838de,_0x320758,_0x3a8f16){if(_0x3838de[_0x8d79('0x50')]['id']){delete _0x3838de[_0x8d79('0x50')]['id'];}return db['SalesforceAccount'][_0x8d79('0x52')]({'where':{'id':_0x3838de['params']['id']}})[_0x8d79('0x2a')](handleEntityNotFound(_0x320758,null))[_0x8d79('0x2a')](function(_0x10f896){if(_0x10f896){_0x3838de[_0x8d79('0x50')]['AccountId']=_0x10f896['id'];_0x3838de['body'][_0x8d79('0x56')]=integrations['getSubjects'](_0x3838de[_0x8d79('0x50')]['channel'],_0x3838de[_0x8d79('0x50')]['type']);_0x3838de[_0x8d79('0x50')][_0x8d79('0x57')]=integrations[_0x8d79('0x58')](_0x3838de['body']['channel'],_0x3838de[_0x8d79('0x50')][_0x8d79('0x42')]);return db[_0x8d79('0x53')][_0x8d79('0x4f')](_0x3838de[_0x8d79('0x50')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0x8d79('0x2a')](respondWithResult(_0x320758,null))[_0x8d79('0x48')](handleError(_0x320758,null));};exports[_0x8d79('0x59')]=function(_0x23f2ff,_0x2d8e2e,_0x49745b){var _0x4606ff;var _0x258616='';var _0x4f9b4e=_0x8d79('0x5a');return db['SalesforceAccount'][_0x8d79('0x52')]({'where':{'id':_0x23f2ff[_0x8d79('0x51')]['id']},'attributes':['id',_0x8d79('0x5b'),'clientId',_0x8d79('0x5c'),_0x8d79('0x5d'),_0x8d79('0x5e'),_0x8d79('0x5f')]})[_0x8d79('0x2a')](handleEntityNotFound(_0x2d8e2e,null))[_0x8d79('0x2a')](function(_0x5b3885){if(_0x5b3885){_0x258616=_0x5b3885['remoteUri'];var _0x11b128=_0x258616[_0x8d79('0x60')](-0x1);if(_0x11b128==='/'){_0x258616=_0x258616[_0x8d79('0x61')](0x0,_0x258616['lastIndexOf'](_0x11b128));}_0x4606ff=new jsforce[(_0x8d79('0x62'))]({'oauth2':{'loginUrl':_0x258616,'clientId':_0x5b3885[_0x8d79('0x63')],'clientSecret':_0x5b3885[_0x8d79('0x5c')]}});return _0x4606ff[_0x8d79('0x64')](_0x5b3885[_0x8d79('0x5d')],_0x5b3885[_0x8d79('0x5e')][_0x8d79('0x65')](_0x5b3885[_0x8d79('0x5f')]));}})[_0x8d79('0x2a')](function(_0x43205b){if(_0x43205b){if(!_[_0x8d79('0x66')](_0x23f2ff[_0x8d79('0x35')][_0x8d79('0x67')])){_0x4f9b4e=_0x23f2ff[_0x8d79('0x35')][_0x8d79('0x67')];}return _0x4606ff['sobject'](_0x4f9b4e)[_0x8d79('0x68')]();}})[_0x8d79('0x2a')](function(_0x37f704){var _0x34a51e=[_0x8d79('0x69'),_0x8d79('0x6a'),_0x8d79('0x6b'),_0x8d79('0x6c'),_0x8d79('0x6d'),_0x8d79('0x6e')];var _0xe8970f=[_0x8d79('0x6f'),'int','picklist',_0x8d79('0x70'),_0x8d79('0x71'),_0x8d79('0x72'),_0x8d79('0x73')];if(_0x37f704){_[_0x8d79('0x74')](_0x37f704[_0x8d79('0x4a')],function(_0x58b0bc){return _0x34a51e[_0x8d79('0x75')](_0x58b0bc[_0x8d79('0x2e')])||!_0xe8970f['includes'](_0x58b0bc['type']);});return{'count':_0x37f704[_0x8d79('0x4a')]['length'],'rows':_[_0x8d79('0x41')](_0x37f704[_0x8d79('0x4a')],function(_0x5f450a){return{'id':_0x5f450a[_0x8d79('0x2e')],'name':_0x5f450a['label'],'custom':_0x5f450a['custom'],'options':_0x5f450a[_0x8d79('0x76')]['length']>0x0?_[_0x8d79('0x41')](_0x5f450a[_0x8d79('0x76')],function(_0x6191d3){return{'name':_0x6191d3[_0x8d79('0x77')],'value':_0x6191d3[_0x8d79('0x78')]};}):_0x5f450a[_0x8d79('0x42')]==_0x8d79('0x70')?[{'name':_0x8d79('0x79'),'value':_0x8d79('0x7a')},{'name':_0x8d79('0x7b'),'value':_0x8d79('0x7c')}]:[]};})};}})[_0x8d79('0x2a')](respondWithResult(_0x2d8e2e,null))[_0x8d79('0x48')](function(_0x5651f0){var _0x2a919e=_0x23f2ff[_0x8d79('0x35')][_0x8d79('0x7d')]?0x1f4:_0x5651f0[_0x8d79('0x7e')]||0x1f4;logger[_0x8d79('0x7f')]('getFields,\x20%s,\x20%s,\x20%s',_0x8d79('0x59'),_0x2a919e,JSON['stringify'](_0x5651f0));delete _0x5651f0[_0x8d79('0x2e')];if(_0x2a919e===0x191){_0x2a919e=0x190;}_0x2d8e2e['status'](_0x2a919e)[_0x8d79('0x80')](_0x23f2ff[_0x8d79('0x35')][_0x8d79('0x7d')]?{'message':'Wrong\x20credentials','statusCode':_0x5651f0[_0x8d79('0x7e')]}:_0x5651f0);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 3502f60..ab7e1da 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 _0xcbfa=['SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x538c70,_0x35531f){var _0x42ae01=function(_0x5c7368){while(--_0x5c7368){_0x538c70['push'](_0x538c70['shift']());}};_0x42ae01(++_0x35531f);}(_0xcbfa,0x1f0));var _0xacbf=function(_0x35a140,_0x3aeac6){_0x35a140=_0x35a140-0x0;var _0x30ab82=_0xcbfa[_0x35a140];return _0x30ab82;};'use strict';var _=require(_0xacbf('0x0'));var util=require(_0xacbf('0x1'));var logger=require(_0xacbf('0x2'))('api');var moment=require(_0xacbf('0x3'));var BPromise=require(_0xacbf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xacbf('0x5'));var rimraf=require(_0xacbf('0x6'));var config=require('../../config/environment');var attributes=require(_0xacbf('0x7'));var integrations=require(_0xacbf('0x8'));module[_0xacbf('0x9')]=function(_0x1a4733,_0x64a24b){return _0x1a4733[_0xacbf('0xa')](_0xacbf('0xb'),attributes,{'tableName':_0xacbf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e44=['path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3badc3,_0x561af1){var _0x571d68=function(_0x54f5f1){while(--_0x54f5f1){_0x3badc3['push'](_0x3badc3['shift']());}};_0x571d68(++_0x561af1);}(_0x1e44,0x1a9));var _0x41e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e44[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41e4('0x0'));var util=require(_0x41e4('0x1'));var logger=require(_0x41e4('0x2'))(_0x41e4('0x3'));var moment=require(_0x41e4('0x4'));var BPromise=require(_0x41e4('0x5'));var rp=require(_0x41e4('0x6'));var fs=require('fs');var path=require(_0x41e4('0x7'));var rimraf=require('rimraf');var config=require(_0x41e4('0x8'));var attributes=require(_0x41e4('0x9'));var integrations=require(_0x41e4('0xa'));module['exports']=function(_0xf44512,_0x5e5199){return _0xf44512[_0x41e4('0xb')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','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 02db1ef..aa64cc1 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 _0x0004=['model','map','attributes','then','ShowSalesforceAccount','SalesforceAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSalesforceAccount','findAll','options','raw','where','limit','include'];(function(_0x28181c,_0x9e8e0f){var _0x1432fe=function(_0x31d7c7){while(--_0x31d7c7){_0x28181c['push'](_0x28181c['shift']());}};_0x1432fe(++_0x9e8e0f);}(_0x0004,0x19e));var _0x4000=function(_0x32bf8b,_0x2ac32b){_0x32bf8b=_0x32bf8b-0x0;var _0x1e5ef5=_0x0004[_0x32bf8b];return _0x1e5ef5;};'use strict';var _=require(_0x4000('0x0'));var util=require('util');var moment=require(_0x4000('0x1'));var BPromise=require(_0x4000('0x2'));var rs=require(_0x4000('0x3'));var fs=require('fs');var Redis=require(_0x4000('0x4'));var db=require(_0x4000('0x5'))['db'];var utils=require(_0x4000('0x6'));var logger=require(_0x4000('0x7'))(_0x4000('0x8'));var config=require(_0x4000('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4000('0xa')][_0x4000('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f86e8,_0x4b1d79,_0x18c4bb){return new BPromise(function(_0x258832,_0x5ccbeb){return client['request'](_0x3f86e8,_0x18c4bb)['then'](function(_0x42ab47){logger['info'](_0x4000('0xc'),_0x4b1d79,_0x4000('0xd'));logger[_0x4000('0xe')](_0x4000('0xf'),_0x4b1d79,_0x4000('0xd'),JSON[_0x4000('0x10')](_0x42ab47));if(_0x42ab47[_0x4000('0x11')]){if(_0x42ab47[_0x4000('0x11')][_0x4000('0x12')]===0x1f4){logger[_0x4000('0x11')](_0x4000('0xc'),_0x4b1d79,_0x42ab47[_0x4000('0x11')][_0x4000('0x13')]);return _0x5ccbeb(_0x42ab47[_0x4000('0x11')]['message']);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x4b1d79,_0x42ab47[_0x4000('0x11')][_0x4000('0x13')]);return _0x258832(_0x42ab47[_0x4000('0x11')][_0x4000('0x13')]);}else{logger[_0x4000('0x14')]('SalesforceAccount,\x20%s,\x20%s',_0x4b1d79,_0x4000('0xd'));_0x258832(_0x42ab47[_0x4000('0x15')]['message']);}})[_0x4000('0x16')](function(_0x35d93a){logger[_0x4000('0x11')](_0x4000('0xc'),_0x4b1d79,_0x35d93a);_0x5ccbeb(_0x35d93a);});});}exports[_0x4000('0x17')]=function(_0x362be7){var _0x280df2=this;return new Promise(function(_0x1d7594,_0x277193){return db['SalesforceAccount'][_0x4000('0x18')]({'raw':_0x362be7[_0x4000('0x19')]?_0x362be7['options'][_0x4000('0x1a')]===undefined?!![]:![]:!![],'where':_0x362be7[_0x4000('0x19')]?_0x362be7[_0x4000('0x19')][_0x4000('0x1b')]||null:null,'attributes':_0x362be7[_0x4000('0x19')]?_0x362be7['options']['attributes']||null:null,'limit':_0x362be7[_0x4000('0x19')]?_0x362be7['options'][_0x4000('0x1c')]||null:null,'include':_0x362be7[_0x4000('0x19')]?_0x362be7['options'][_0x4000('0x1d')]?_['map'](_0x362be7[_0x4000('0x19')][_0x4000('0x1d')],function(_0x3f5d57){return{'model':db[_0x3f5d57[_0x4000('0x1e')]],'as':_0x3f5d57['as'],'attributes':_0x3f5d57['attributes'],'include':_0x3f5d57[_0x4000('0x1d')]?_[_0x4000('0x1f')](_0x3f5d57[_0x4000('0x1d')],function(_0x24e34f){return{'model':db[_0x24e34f[_0x4000('0x1e')]],'as':_0x24e34f['as'],'attributes':_0x24e34f[_0x4000('0x20')],'include':_0x24e34f[_0x4000('0x1d')]?_['map'](_0x24e34f[_0x4000('0x1d')],function(_0x343eee){return{'model':db[_0x343eee[_0x4000('0x1e')]],'as':_0x343eee['as'],'attributes':_0x343eee['attributes']};}):[]};}):[]};}):[]:[]})[_0x4000('0x21')](function(_0x54be16){logger['info'](_0x4000('0x17'),_0x362be7);logger[_0x4000('0xe')](_0x4000('0x17'),_0x362be7,JSON['stringify'](_0x54be16));_0x1d7594(_0x54be16);})['catch'](function(_0x5be96c){logger['error'](_0x4000('0x17'),_0x5be96c['message'],_0x362be7);_0x277193(_0x280df2[_0x4000('0x11')](0x1f4,_0x5be96c['message']));});});};exports[_0x4000('0x22')]=function(_0x28e700){var _0x2de320=this;return new Promise(function(_0x20ba90,_0x290416){return db[_0x4000('0x23')][_0x4000('0x24')]({'raw':_0x28e700[_0x4000('0x19')]?_0x28e700[_0x4000('0x19')][_0x4000('0x1a')]===undefined?!![]:![]:!![],'where':_0x28e700[_0x4000('0x19')]?_0x28e700[_0x4000('0x19')]['where']||null:null,'attributes':_0x28e700[_0x4000('0x19')]?_0x28e700[_0x4000('0x19')][_0x4000('0x20')]||null:null,'include':_0x28e700['options']?_0x28e700[_0x4000('0x19')]['include']?_['map'](_0x28e700[_0x4000('0x19')][_0x4000('0x1d')],function(_0x50a27c){return{'model':db[_0x50a27c[_0x4000('0x1e')]],'as':_0x50a27c['as'],'attributes':_0x50a27c[_0x4000('0x20')],'include':_0x50a27c[_0x4000('0x1d')]?_[_0x4000('0x1f')](_0x50a27c[_0x4000('0x1d')],function(_0x328361){return{'model':db[_0x328361['model']],'as':_0x328361['as'],'attributes':_0x328361[_0x4000('0x20')],'include':_0x328361['include']?_[_0x4000('0x1f')](_0x328361['include'],function(_0x34b358){return{'model':db[_0x34b358[_0x4000('0x1e')]],'as':_0x34b358['as'],'attributes':_0x34b358[_0x4000('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4000('0x21')](function(_0x3d8c76){logger[_0x4000('0x14')](_0x4000('0x22'),_0x28e700);logger['debug'](_0x4000('0x22'),_0x28e700,JSON[_0x4000('0x10')](_0x3d8c76));_0x20ba90(_0x3d8c76);})['catch'](function(_0x32a3a2){logger['error']('ShowSalesforceAccount',_0x32a3a2[_0x4000('0x13')],_0x28e700);_0x290416(_0x2de320[_0x4000('0x11')](0x1f4,_0x32a3a2[_0x4000('0x13')]));});});}; \ No newline at end of file +var _0x2978=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','include','model','map','catch','ShowSalesforceAccount','find','debug','lodash','moment','randomstring'];(function(_0x3e6a37,_0x36fac2){var _0x898f66=function(_0x66308b){while(--_0x66308b){_0x3e6a37['push'](_0x3e6a37['shift']());}};_0x898f66(++_0x36fac2);}(_0x2978,0xf2));var _0x8297=function(_0x32d2da,_0xf63150){_0x32d2da=_0x32d2da-0x0;var _0x3b533c=_0x2978[_0x32d2da];return _0x3b533c;};'use strict';var _=require(_0x8297('0x0'));var util=require('util');var moment=require(_0x8297('0x1'));var BPromise=require('bluebird');var rs=require(_0x8297('0x2'));var fs=require('fs');var Redis=require(_0x8297('0x3'));var db=require(_0x8297('0x4'))['db'];var utils=require(_0x8297('0x5'));var logger=require(_0x8297('0x6'))(_0x8297('0x7'));var config=require('../../config/environment');var jayson=require(_0x8297('0x8'));var client=jayson[_0x8297('0x9')][_0x8297('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ca0ad,_0x4f29b8,_0x5cc911){return new BPromise(function(_0x371c97,_0x3166d7){return client[_0x8297('0xb')](_0x2ca0ad,_0x5cc911)[_0x8297('0xc')](function(_0x57bca4){logger[_0x8297('0xd')](_0x8297('0xe'),_0x4f29b8,'request\x20sent');logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4f29b8,_0x8297('0xf'),JSON[_0x8297('0x10')](_0x57bca4));if(_0x57bca4[_0x8297('0x11')]){if(_0x57bca4['error'][_0x8297('0x12')]===0x1f4){logger[_0x8297('0x11')](_0x8297('0xe'),_0x4f29b8,_0x57bca4['error'][_0x8297('0x13')]);return _0x3166d7(_0x57bca4[_0x8297('0x11')][_0x8297('0x13')]);}logger[_0x8297('0x11')](_0x8297('0xe'),_0x4f29b8,_0x57bca4[_0x8297('0x11')][_0x8297('0x13')]);return _0x371c97(_0x57bca4[_0x8297('0x11')]['message']);}else{logger[_0x8297('0xd')](_0x8297('0xe'),_0x4f29b8,_0x8297('0xf'));_0x371c97(_0x57bca4[_0x8297('0x14')]['message']);}})['catch'](function(_0x4f814c){logger[_0x8297('0x11')](_0x8297('0xe'),_0x4f29b8,_0x4f814c);_0x3166d7(_0x4f814c);});});}exports[_0x8297('0x15')]=function(_0xa4aac9){var _0x433261=this;return new Promise(function(_0x32e016,_0x178d96){return db[_0x8297('0x16')][_0x8297('0x17')]({'raw':_0xa4aac9['options']?_0xa4aac9[_0x8297('0x18')][_0x8297('0x19')]===undefined?!![]:![]:!![],'where':_0xa4aac9[_0x8297('0x18')]?_0xa4aac9['options'][_0x8297('0x1a')]||null:null,'attributes':_0xa4aac9[_0x8297('0x18')]?_0xa4aac9[_0x8297('0x18')][_0x8297('0x1b')]||null:null,'limit':_0xa4aac9[_0x8297('0x18')]?_0xa4aac9[_0x8297('0x18')]['limit']||null:null,'include':_0xa4aac9[_0x8297('0x18')]?_0xa4aac9[_0x8297('0x18')]['include']?_['map'](_0xa4aac9[_0x8297('0x18')][_0x8297('0x1c')],function(_0xd5dd34){return{'model':db[_0xd5dd34[_0x8297('0x1d')]],'as':_0xd5dd34['as'],'attributes':_0xd5dd34[_0x8297('0x1b')],'include':_0xd5dd34[_0x8297('0x1c')]?_[_0x8297('0x1e')](_0xd5dd34['include'],function(_0x560f8e){return{'model':db[_0x560f8e[_0x8297('0x1d')]],'as':_0x560f8e['as'],'attributes':_0x560f8e[_0x8297('0x1b')],'include':_0x560f8e['include']?_[_0x8297('0x1e')](_0x560f8e[_0x8297('0x1c')],function(_0x2b5372){return{'model':db[_0x2b5372[_0x8297('0x1d')]],'as':_0x2b5372['as'],'attributes':_0x2b5372[_0x8297('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8297('0xc')](function(_0x312b1a){logger['info'](_0x8297('0x15'),_0xa4aac9);logger['debug'](_0x8297('0x15'),_0xa4aac9,JSON['stringify'](_0x312b1a));_0x32e016(_0x312b1a);})[_0x8297('0x1f')](function(_0x524a4d){logger[_0x8297('0x11')](_0x8297('0x15'),_0x524a4d['message'],_0xa4aac9);_0x178d96(_0x433261[_0x8297('0x11')](0x1f4,_0x524a4d['message']));});});};exports[_0x8297('0x20')]=function(_0x2fd05f){var _0x5ba22f=this;return new Promise(function(_0x50f671,_0x4074f3){return db['SalesforceAccount'][_0x8297('0x21')]({'raw':_0x2fd05f[_0x8297('0x18')]?_0x2fd05f[_0x8297('0x18')][_0x8297('0x19')]===undefined?!![]:![]:!![],'where':_0x2fd05f['options']?_0x2fd05f[_0x8297('0x18')][_0x8297('0x1a')]||null:null,'attributes':_0x2fd05f[_0x8297('0x18')]?_0x2fd05f['options']['attributes']||null:null,'include':_0x2fd05f[_0x8297('0x18')]?_0x2fd05f[_0x8297('0x18')]['include']?_[_0x8297('0x1e')](_0x2fd05f[_0x8297('0x18')][_0x8297('0x1c')],function(_0x2b6c74){return{'model':db[_0x2b6c74[_0x8297('0x1d')]],'as':_0x2b6c74['as'],'attributes':_0x2b6c74[_0x8297('0x1b')],'include':_0x2b6c74[_0x8297('0x1c')]?_[_0x8297('0x1e')](_0x2b6c74[_0x8297('0x1c')],function(_0x24dcea){return{'model':db[_0x24dcea[_0x8297('0x1d')]],'as':_0x24dcea['as'],'attributes':_0x24dcea[_0x8297('0x1b')],'include':_0x24dcea[_0x8297('0x1c')]?_['map'](_0x24dcea[_0x8297('0x1c')],function(_0x394a0a){return{'model':db[_0x394a0a['model']],'as':_0x394a0a['as'],'attributes':_0x394a0a[_0x8297('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ce0b5){logger[_0x8297('0xd')](_0x8297('0x20'),_0x2fd05f);logger[_0x8297('0x22')](_0x8297('0x20'),_0x2fd05f,JSON[_0x8297('0x10')](_0x3ce0b5));_0x50f671(_0x3ce0b5);})[_0x8297('0x1f')](function(_0x5621ca){logger[_0x8297('0x11')]('ShowSalesforceAccount',_0x5621ca[_0x8297('0x13')],_0x2fd05f);_0x4074f3(_0x5ba22f[_0x8297('0x11')](0x1f4,_0x5621ca[_0x8297('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 7701272..4149486 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2ed7a2,_0x56a52f){var _0x33f974=function(_0x681308){while(--_0x681308){_0x2ed7a2['push'](_0x2ed7a2['shift']());}};_0x33f974(++_0x56a52f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5b7f48,_0x4d8a1d){_0x5b7f48=_0x5b7f48-0x0;var _0x2424b0=_0x5f2f[_0x5b7f48];return _0x2424b0;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file +var _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2032,0xd9));var _0x2203=function(_0x523e2a,_0x49e38f){_0x523e2a=_0x523e2a-0x0;var _0x4fd1ad=_0x2032[_0x523e2a];return _0x4fd1ad;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index f235aa0..88cc6b3 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 _0x6e2d=['lead','account','nothing','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6e2d,0x158));var _0xd6e2=function(_0x3f68c8,_0x44724f){_0x3f68c8=_0x3f68c8-0x0;var _0x2ab867=_0x6e2d[_0x3f68c8];return _0x2ab867;};'use strict';var Sequelize=require(_0xd6e2('0x0'));module[_0xd6e2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd6e2('0x2')]},'ticketType':{'type':Sequelize[_0xd6e2('0x3')](_0xd6e2('0x4'),_0xd6e2('0x5')),'defaultValue':_0xd6e2('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0xd6e2('0x6'),_0xd6e2('0x7'),_0xd6e2('0x8'),'account_contact_lead',_0xd6e2('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xd6e2('0x3')](_0xd6e2('0xa'),_0xd6e2('0x7'),_0xd6e2('0x8'),_0xd6e2('0x9')),'defaultValue':_0xd6e2('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xd6e2('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xd6e2('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xd6e2('0x2')]}}; \ No newline at end of file +var _0xd0e0=['contact_lead','contact','lead','account_contact_lead','account','sequelize','exports','STRING','ENUM'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0xd0e0,0x19a));var _0x0d0e=function(_0x4de80f,_0x4a1771){_0x4de80f=_0x4de80f-0x0;var _0x572471=_0xd0e0[_0x4de80f];return _0x572471;};'use strict';var Sequelize=require(_0x0d0e('0x0'));module[_0x0d0e('0x1')]={'name':{'type':Sequelize[_0x0d0e('0x2')]},'description':{'type':Sequelize[_0x0d0e('0x2')]},'ticketType':{'type':Sequelize['ENUM']('Task','Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x0d0e('0x3')](_0x0d0e('0x4'),_0x0d0e('0x5'),_0x0d0e('0x6'),_0x0d0e('0x7'),_0x0d0e('0x8')),'defaultValue':_0x0d0e('0x4')},'moduleCreate':{'type':Sequelize[_0x0d0e('0x3')]('nothing','contact',_0x0d0e('0x6'),_0x0d0e('0x8')),'defaultValue':_0x0d0e('0x6')},'leadId':{'type':Sequelize[_0x0d0e('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x0d0e('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x0d0e('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x0d0e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 840e459..64c3469 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 _0x135c=['../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','SalesforceConfiguration','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','getFields','findOne','getSubjects','SalesforceField','hasOwnProperty','getDescriptions','pick','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x53b133,_0x176261){var _0x5647e0=function(_0x4c62b0){while(--_0x4c62b0){_0x53b133['push'](_0x53b133['shift']());}};_0x5647e0(++_0x176261);}(_0x135c,0xda));var _0xc135=function(_0x2d361d,_0x2e1713){_0x2d361d=_0x2d361d-0x0;var _0x5ac9b3=_0x135c[_0x2d361d];return _0x5ac9b3;};'use strict';var emlformat=require(_0xc135('0x0'));var rimraf=require(_0xc135('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc135('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc135('0x3'));var Mustache=require(_0xc135('0x4'));var util=require(_0xc135('0x5'));var path=require('path');var sox=require(_0xc135('0x6'));var csv=require(_0xc135('0x7'));var ejs=require(_0xc135('0x8'));var fs=require('fs');var fs_extra=require(_0xc135('0x9'));var _=require(_0xc135('0xa'));var squel=require(_0xc135('0xb'));var crypto=require(_0xc135('0xc'));var jsforce=require(_0xc135('0xd'));var deskjs=require(_0xc135('0xe'));var toCsv=require(_0xc135('0x7'));var querystring=require('querystring');var Papa=require(_0xc135('0xf'));var Redis=require(_0xc135('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc135('0x11'));var as=require(_0xc135('0x12'));var hardwareService=require(_0xc135('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc135('0x14'));var licenseUtil=require(_0xc135('0x15'));var db=require(_0xc135('0x16'))['db'];function respondWithStatusCode(_0x5515ee,_0xc62959){_0xc62959=_0xc62959||0xcc;return function(_0x4e9404){if(_0x4e9404){return _0x5515ee[_0xc135('0x17')](_0xc62959);}return _0x5515ee[_0xc135('0x18')](_0xc62959)[_0xc135('0x19')]();};}function respondWithResult(_0x41f8f8,_0x233753){_0x233753=_0x233753||0xc8;return function(_0xb5bfde){if(_0xb5bfde){return _0x41f8f8[_0xc135('0x18')](_0x233753)[_0xc135('0x1a')](_0xb5bfde);}};}function respondWithFilteredResult(_0xb74f9a,_0x386d02){return function(_0x1e4b6b){if(_0x1e4b6b){var _0x44507c=typeof _0x386d02[_0xc135('0x1b')]==='undefined'&&typeof _0x386d02['limit']==='undefined';var _0x1bf4fd=_0x1e4b6b[_0xc135('0x1c')];var _0x22d29f=_0x44507c?0x0:_0x386d02[_0xc135('0x1b')];var _0x5e7c7e=_0x44507c?_0x1e4b6b['count']:_0x386d02[_0xc135('0x1b')]+_0x386d02[_0xc135('0x1d')];var _0x39830c;if(_0x5e7c7e>=_0x1bf4fd){_0x5e7c7e=_0x1bf4fd;_0x39830c=0xc8;}else{_0x39830c=0xce;}_0xb74f9a['status'](_0x39830c);return _0xb74f9a[_0xc135('0x1e')]('Content-Range',_0x22d29f+'-'+_0x5e7c7e+'/'+_0x1bf4fd)[_0xc135('0x1a')](_0x1e4b6b);}return null;};}function patchUpdates(_0x6f30fd){return function(_0x53f7fb){try{jsonpatch[_0xc135('0x1f')](_0x53f7fb,_0x6f30fd,!![]);}catch(_0x68682){return BPromise[_0xc135('0x20')](_0x68682);}return _0x53f7fb[_0xc135('0x21')]();};}function saveUpdates(_0x23fd4b,_0x52f2be){return function(_0x4396c9){if(_0x4396c9){return _0x4396c9[_0xc135('0x22')](_0x23fd4b)[_0xc135('0x23')](function(_0x51d959){return _0x51d959;});}return null;};}function removeEntity(_0x22173e,_0x1b8d52){return function(_0x3bb639){if(_0x3bb639){return _0x3bb639[_0xc135('0x24')]()[_0xc135('0x23')](function(){_0x22173e[_0xc135('0x18')](0xcc)[_0xc135('0x19')]();});}};}function handleEntityNotFound(_0x41727c,_0x56d7af){return function(_0x1f1ed0){if(!_0x1f1ed0){_0x41727c[_0xc135('0x17')](0x194);}return _0x1f1ed0;};}function handleError(_0x421b9b,_0x2cef85){_0x2cef85=_0x2cef85||0x1f4;return function(_0x20ac74){logger[_0xc135('0x25')](_0x20ac74[_0xc135('0x26')]);if(_0x20ac74[_0xc135('0x27')]){delete _0x20ac74[_0xc135('0x27')];}_0x421b9b['status'](_0x2cef85)['send'](_0x20ac74);};}exports[_0xc135('0x28')]=function(_0x51a320,_0x1a2a1b){var _0x1cf24f={},_0x122daa={},_0x350168={'count':0x0,'rows':[]};var _0x30d1f0=_[_0xc135('0x29')](db[_0xc135('0x2a')]['rawAttributes'],function(_0x578a38){return{'name':_0x578a38['fieldName'],'type':_0x578a38[_0xc135('0x2b')][_0xc135('0x2c')]};});_0x122daa[_0xc135('0x2d')]=_[_0xc135('0x29')](_0x30d1f0,_0xc135('0x27'));_0x122daa[_0xc135('0x2e')]=_[_0xc135('0x2f')](_0x51a320[_0xc135('0x2e')]);_0x122daa[_0xc135('0x30')]=_['intersection'](_0x122daa[_0xc135('0x2d')],_0x122daa[_0xc135('0x2e')]);_0x1cf24f[_0xc135('0x31')]=_[_0xc135('0x32')](_0x122daa[_0xc135('0x2d')],qs[_0xc135('0x33')](_0x51a320[_0xc135('0x2e')][_0xc135('0x33')]));_0x1cf24f[_0xc135('0x31')]=_0x1cf24f[_0xc135('0x31')]['length']?_0x1cf24f['attributes']:_0x122daa[_0xc135('0x2d')];if(!_0x51a320[_0xc135('0x2e')]['hasOwnProperty'](_0xc135('0x34'))){_0x1cf24f[_0xc135('0x1d')]=qs[_0xc135('0x1d')](_0x51a320[_0xc135('0x2e')][_0xc135('0x1d')]);_0x1cf24f[_0xc135('0x1b')]=qs[_0xc135('0x1b')](_0x51a320['query'][_0xc135('0x1b')]);}_0x1cf24f[_0xc135('0x35')]=qs[_0xc135('0x36')](_0x51a320['query'][_0xc135('0x36')]);_0x1cf24f[_0xc135('0x37')]=qs[_0xc135('0x30')](_['pick'](_0x51a320['query'],_0x122daa[_0xc135('0x30')]),_0x30d1f0);if(_0x51a320[_0xc135('0x2e')][_0xc135('0x38')]){_0x1cf24f[_0xc135('0x37')]=_[_0xc135('0x39')](_0x1cf24f[_0xc135('0x37')],{'$or':_[_0xc135('0x29')](_0x30d1f0,function(_0x4db815){if(_0x4db815['type']!==_0xc135('0x3a')){var _0x550281={};_0x550281[_0x4db815[_0xc135('0x27')]]={'$like':'%'+_0x51a320[_0xc135('0x2e')][_0xc135('0x38')]+'%'};return _0x550281;}})});}_0x1cf24f=_[_0xc135('0x39')]({},_0x1cf24f,_0x51a320[_0xc135('0x3b')]);var _0x37444c={'where':_0x1cf24f[_0xc135('0x37')]};return db[_0xc135('0x2a')][_0xc135('0x1c')](_0x37444c)['then'](function(_0x5cfb4d){_0x350168[_0xc135('0x1c')]=_0x5cfb4d;if(_0x51a320[_0xc135('0x2e')][_0xc135('0x3c')]){_0x1cf24f[_0xc135('0x3d')]=[{'all':!![]}];}return db[_0xc135('0x2a')][_0xc135('0x3e')](_0x1cf24f);})[_0xc135('0x23')](function(_0x5b1c0f){_0x350168[_0xc135('0x3f')]=_0x5b1c0f;return _0x350168;})[_0xc135('0x23')](respondWithFilteredResult(_0x1a2a1b,_0x1cf24f))[_0xc135('0x40')](handleError(_0x1a2a1b,null));};exports[_0xc135('0x41')]=function(_0x1cb46e,_0x3bbd91){var _0x19666a={'raw':![],'where':{'id':_0x1cb46e['params']['id']}},_0x422607={};_0x422607[_0xc135('0x2d')]=_[_0xc135('0x2f')](db[_0xc135('0x2a')][_0xc135('0x42')]);_0x422607[_0xc135('0x2e')]=_[_0xc135('0x2f')](_0x1cb46e[_0xc135('0x2e')]);_0x422607['filters']=_[_0xc135('0x32')](_0x422607[_0xc135('0x2d')],_0x422607[_0xc135('0x2e')]);_0x19666a[_0xc135('0x31')]=_[_0xc135('0x32')](_0x422607[_0xc135('0x2d')],qs[_0xc135('0x33')](_0x1cb46e[_0xc135('0x2e')][_0xc135('0x33')]));_0x19666a[_0xc135('0x31')]=_0x19666a[_0xc135('0x31')][_0xc135('0x43')]?_0x19666a['attributes']:_0x422607['model'];if(_0x1cb46e['query'][_0xc135('0x3c')]){_0x19666a[_0xc135('0x3d')]=[{'all':!![]}];}_0x19666a=_[_0xc135('0x39')]({},_0x19666a,_0x1cb46e[_0xc135('0x3b')]);return db[_0xc135('0x2a')][_0xc135('0x44')](_0x19666a)[_0xc135('0x23')](handleEntityNotFound(_0x3bbd91,null))[_0xc135('0x23')](respondWithResult(_0x3bbd91,null))[_0xc135('0x40')](handleError(_0x3bbd91,null));};exports[_0xc135('0x45')]=function(_0x270f4b,_0x46118d){return db[_0xc135('0x2a')]['create'](_0x270f4b[_0xc135('0x46')],{})[_0xc135('0x23')](respondWithResult(_0x46118d,0xc9))[_0xc135('0x40')](handleError(_0x46118d,null));};exports[_0xc135('0x22')]=function(_0xc31d1a,_0x45dc55){if(_0xc31d1a[_0xc135('0x46')]['id']){delete _0xc31d1a['body']['id'];}return db[_0xc135('0x2a')][_0xc135('0x44')]({'where':{'id':_0xc31d1a[_0xc135('0x47')]['id']}})['then'](handleEntityNotFound(_0x45dc55,null))['then'](saveUpdates(_0xc31d1a[_0xc135('0x46')],null))[_0xc135('0x23')](respondWithResult(_0x45dc55,null))['catch'](handleError(_0x45dc55,null));};exports['destroy']=function(_0x1fa6be,_0x4618e6){return db['SalesforceConfiguration'][_0xc135('0x44')]({'where':{'id':_0x1fa6be[_0xc135('0x47')]['id']}})[_0xc135('0x23')](handleEntityNotFound(_0x4618e6,null))[_0xc135('0x23')](removeEntity(_0x4618e6,null))[_0xc135('0x40')](handleError(_0x4618e6,null));};exports[_0xc135('0x48')]=function(_0x237970,_0x3ba543,_0x35e076){var _0x82f719={};var _0x32e5ed={};var _0x4238fd;var _0x2350f2;return db[_0xc135('0x2a')][_0xc135('0x49')]({'where':{'id':_0x237970['params']['id']}})[_0xc135('0x23')](handleEntityNotFound(_0x3ba543,null))['then'](function(_0x2c2b85){if(_0x2c2b85){_0x4238fd=_0x2c2b85;_0x32e5ed[_0xc135('0x2d')]=_[_0xc135('0x2f')](db['SalesforceField']['rawAttributes']);_0x32e5ed[_0xc135('0x2e')]=_[_0xc135('0x2f')](_0x237970[_0xc135('0x2e')]);_0x32e5ed['filters']=_[_0xc135('0x32')](_0x32e5ed[_0xc135('0x2d')],_0x32e5ed['query']);_0x82f719[_0xc135('0x31')]=_['intersection'](_0x32e5ed[_0xc135('0x2d')],qs[_0xc135('0x33')](_0x237970[_0xc135('0x2e')]['fields']));_0x82f719[_0xc135('0x31')]=_0x82f719[_0xc135('0x31')]['length']?_0x82f719[_0xc135('0x31')]:_0x32e5ed['model'];_0x82f719['order']=qs[_0xc135('0x36')](_0x237970[_0xc135('0x2e')][_0xc135('0x36')]);_0x82f719['where']=qs[_0xc135('0x30')](_['pick'](_0x237970[_0xc135('0x2e')],_0x32e5ed['filters']));if(_0x237970[_0xc135('0x2e')]['filter']){_0x82f719[_0xc135('0x37')]=_['merge'](_0x82f719[_0xc135('0x37')],{'$or':_[_0xc135('0x29')](_0x82f719[_0xc135('0x31')],function(_0x3f4601){var _0x8a7139={};_0x8a7139[_0x3f4601]={'$like':'%'+_0x237970['query'][_0xc135('0x38')]+'%'};return _0x8a7139;})});}_0x82f719=_[_0xc135('0x39')]({},_0x82f719,_0x237970[_0xc135('0x3b')]);return _0x4238fd[_0xc135('0x48')](_0x82f719);}})['then'](function(_0x160c74){if(_0x160c74){_0x2350f2=_0x160c74[_0xc135('0x43')];if(!_0x237970[_0xc135('0x2e')]['hasOwnProperty'](_0xc135('0x34'))){_0x82f719['limit']=qs['limit'](_0x237970['query'][_0xc135('0x1d')]);_0x82f719[_0xc135('0x1b')]=qs[_0xc135('0x1b')](_0x237970['query'][_0xc135('0x1b')]);}return _0x4238fd['getFields'](_0x82f719);}})['then'](function(_0x3638e0){if(_0x3638e0){return _0x3638e0?{'count':_0x2350f2,'rows':_0x3638e0}:null;}})[_0xc135('0x23')](respondWithResult(_0x3ba543,null))[_0xc135('0x40')](handleError(_0x3ba543,null));};exports[_0xc135('0x4a')]=function(_0x7c2571,_0x98906d,_0x512eca){var _0x44cd5a={};var _0x2572bf={};var _0x26f97f;var _0x149d2e;return db[_0xc135('0x2a')][_0xc135('0x49')]({'where':{'id':_0x7c2571[_0xc135('0x47')]['id']}})[_0xc135('0x23')](handleEntityNotFound(_0x98906d,null))[_0xc135('0x23')](function(_0x1d24d4){if(_0x1d24d4){_0x26f97f=_0x1d24d4;_0x2572bf[_0xc135('0x2d')]=_['keys'](db[_0xc135('0x4b')][_0xc135('0x42')]);_0x2572bf[_0xc135('0x2e')]=_[_0xc135('0x2f')](_0x7c2571[_0xc135('0x2e')]);_0x2572bf[_0xc135('0x30')]=_[_0xc135('0x32')](_0x2572bf[_0xc135('0x2d')],_0x2572bf['query']);_0x44cd5a[_0xc135('0x31')]=_[_0xc135('0x32')](_0x2572bf[_0xc135('0x2d')],qs[_0xc135('0x33')](_0x7c2571[_0xc135('0x2e')][_0xc135('0x33')]));_0x44cd5a[_0xc135('0x31')]=_0x44cd5a[_0xc135('0x31')][_0xc135('0x43')]?_0x44cd5a[_0xc135('0x31')]:_0x2572bf[_0xc135('0x2d')];_0x44cd5a[_0xc135('0x35')]=qs[_0xc135('0x36')](_0x7c2571[_0xc135('0x2e')][_0xc135('0x36')]);_0x44cd5a[_0xc135('0x37')]=qs[_0xc135('0x30')](_['pick'](_0x7c2571[_0xc135('0x2e')],_0x2572bf['filters']));if(_0x7c2571[_0xc135('0x2e')][_0xc135('0x38')]){_0x44cd5a['where']=_[_0xc135('0x39')](_0x44cd5a['where'],{'$or':_[_0xc135('0x29')](_0x44cd5a[_0xc135('0x31')],function(_0x10702c){var _0x30997c={};_0x30997c[_0x10702c]={'$like':'%'+_0x7c2571[_0xc135('0x2e')][_0xc135('0x38')]+'%'};return _0x30997c;})});}_0x44cd5a=_[_0xc135('0x39')]({},_0x44cd5a,_0x7c2571[_0xc135('0x3b')]);return _0x26f97f['getSubjects'](_0x44cd5a);}})['then'](function(_0x440d62){if(_0x440d62){_0x149d2e=_0x440d62[_0xc135('0x43')];if(!_0x7c2571[_0xc135('0x2e')][_0xc135('0x4c')](_0xc135('0x34'))){_0x44cd5a[_0xc135('0x1d')]=qs['limit'](_0x7c2571[_0xc135('0x2e')][_0xc135('0x1d')]);_0x44cd5a[_0xc135('0x1b')]=qs['offset'](_0x7c2571[_0xc135('0x2e')][_0xc135('0x1b')]);}return _0x26f97f[_0xc135('0x4a')](_0x44cd5a);}})['then'](function(_0x393406){if(_0x393406){return _0x393406?{'count':_0x149d2e,'rows':_0x393406}:null;}})[_0xc135('0x23')](respondWithResult(_0x98906d,null))['catch'](handleError(_0x98906d,null));};exports[_0xc135('0x4d')]=function(_0x15116b,_0x37f9df,_0x20ae5c){var _0x5cdb51={};var _0x4b5110={};var _0x1783a9;var _0x53db47;return db[_0xc135('0x2a')][_0xc135('0x49')]({'where':{'id':_0x15116b[_0xc135('0x47')]['id']}})[_0xc135('0x23')](handleEntityNotFound(_0x37f9df,null))[_0xc135('0x23')](function(_0x5b0afc){if(_0x5b0afc){_0x1783a9=_0x5b0afc;_0x4b5110[_0xc135('0x2d')]=_['keys'](db[_0xc135('0x4b')][_0xc135('0x42')]);_0x4b5110[_0xc135('0x2e')]=_['keys'](_0x15116b['query']);_0x4b5110[_0xc135('0x30')]=_[_0xc135('0x32')](_0x4b5110[_0xc135('0x2d')],_0x4b5110[_0xc135('0x2e')]);_0x5cdb51['attributes']=_[_0xc135('0x32')](_0x4b5110[_0xc135('0x2d')],qs[_0xc135('0x33')](_0x15116b[_0xc135('0x2e')][_0xc135('0x33')]));_0x5cdb51['attributes']=_0x5cdb51[_0xc135('0x31')][_0xc135('0x43')]?_0x5cdb51['attributes']:_0x4b5110['model'];_0x5cdb51[_0xc135('0x35')]=qs[_0xc135('0x36')](_0x15116b[_0xc135('0x2e')][_0xc135('0x36')]);_0x5cdb51[_0xc135('0x37')]=qs[_0xc135('0x30')](_[_0xc135('0x4e')](_0x15116b[_0xc135('0x2e')],_0x4b5110['filters']));if(_0x15116b[_0xc135('0x2e')][_0xc135('0x38')]){_0x5cdb51[_0xc135('0x37')]=_[_0xc135('0x39')](_0x5cdb51[_0xc135('0x37')],{'$or':_['map'](_0x5cdb51[_0xc135('0x31')],function(_0x4fd2eb){var _0x3d27ac={};_0x3d27ac[_0x4fd2eb]={'$like':'%'+_0x15116b['query']['filter']+'%'};return _0x3d27ac;})});}_0x5cdb51=_[_0xc135('0x39')]({},_0x5cdb51,_0x15116b['options']);return _0x1783a9[_0xc135('0x4d')](_0x5cdb51);}})[_0xc135('0x23')](function(_0x173c37){if(_0x173c37){_0x53db47=_0x173c37[_0xc135('0x43')];if(!_0x15116b['query']['hasOwnProperty'](_0xc135('0x34'))){_0x5cdb51[_0xc135('0x1d')]=qs[_0xc135('0x1d')](_0x15116b[_0xc135('0x2e')][_0xc135('0x1d')]);_0x5cdb51[_0xc135('0x1b')]=qs[_0xc135('0x1b')](_0x15116b[_0xc135('0x2e')][_0xc135('0x1b')]);}return _0x1783a9[_0xc135('0x4d')](_0x5cdb51);}})[_0xc135('0x23')](function(_0x57a580){if(_0x57a580){return _0x57a580?{'count':_0x53db47,'rows':_0x57a580}:null;}})[_0xc135('0x23')](respondWithResult(_0x37f9df,null))[_0xc135('0x40')](handleError(_0x37f9df,null));}; \ No newline at end of file +var _0x5b4a=['map','fieldName','type','key','query','filters','model','attributes','fields','nolimit','limit','order','where','pick','filter','VIRTUAL','merge','options','SalesforceConfiguration','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','length','includeAll','create','body','find','getFields','findOne','SalesforceField','sort','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0x5b4a,0x1d1));var _0xa5b4=function(_0x46bc62,_0x44ea1d){_0x46bc62=_0x46bc62-0x0;var _0x31105b=_0x5b4a[_0x46bc62];return _0x31105b;};'use strict';var emlformat=require(_0xa5b4('0x0'));var rimraf=require(_0xa5b4('0x1'));var zipdir=require(_0xa5b4('0x2'));var jsonpatch=require(_0xa5b4('0x3'));var rp=require(_0xa5b4('0x4'));var moment=require(_0xa5b4('0x5'));var BPromise=require(_0xa5b4('0x6'));var Mustache=require(_0xa5b4('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa5b4('0x8'));var csv=require(_0xa5b4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5b4('0xa'));var _=require(_0xa5b4('0xb'));var squel=require(_0xa5b4('0xc'));var crypto=require(_0xa5b4('0xd'));var jsforce=require(_0xa5b4('0xe'));var deskjs=require(_0xa5b4('0xf'));var toCsv=require(_0xa5b4('0x9'));var querystring=require(_0xa5b4('0x10'));var Papa=require(_0xa5b4('0x11'));var Redis=require(_0xa5b4('0x12'));var authService=require(_0xa5b4('0x13'));var qs=require(_0xa5b4('0x14'));var as=require(_0xa5b4('0x15'));var hardwareService=require(_0xa5b4('0x16'));var logger=require(_0xa5b4('0x17'))('api');var utils=require(_0xa5b4('0x18'));var config=require(_0xa5b4('0x19'));var licenseUtil=require(_0xa5b4('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36c096,_0x2f6969){_0x2f6969=_0x2f6969||0xcc;return function(_0x4deaca){if(_0x4deaca){return _0x36c096[_0xa5b4('0x1b')](_0x2f6969);}return _0x36c096[_0xa5b4('0x1c')](_0x2f6969)[_0xa5b4('0x1d')]();};}function respondWithResult(_0x4638ae,_0x1a0dfc){_0x1a0dfc=_0x1a0dfc||0xc8;return function(_0x4b5604){if(_0x4b5604){return _0x4638ae['status'](_0x1a0dfc)[_0xa5b4('0x1e')](_0x4b5604);}};}function respondWithFilteredResult(_0x308dfe,_0x2a2301){return function(_0x3df116){if(_0x3df116){var _0x521e17=typeof _0x2a2301[_0xa5b4('0x1f')]==='undefined'&&typeof _0x2a2301['limit']===_0xa5b4('0x20');var _0xb2a708=_0x3df116[_0xa5b4('0x21')];var _0x48e25c=_0x521e17?0x0:_0x2a2301[_0xa5b4('0x1f')];var _0x3718d3=_0x521e17?_0x3df116[_0xa5b4('0x21')]:_0x2a2301[_0xa5b4('0x1f')]+_0x2a2301['limit'];var _0x253b7e;if(_0x3718d3>=_0xb2a708){_0x3718d3=_0xb2a708;_0x253b7e=0xc8;}else{_0x253b7e=0xce;}_0x308dfe[_0xa5b4('0x1c')](_0x253b7e);return _0x308dfe[_0xa5b4('0x22')](_0xa5b4('0x23'),_0x48e25c+'-'+_0x3718d3+'/'+_0xb2a708)[_0xa5b4('0x1e')](_0x3df116);}return null;};}function patchUpdates(_0x14992e){return function(_0x42c1d7){try{jsonpatch['apply'](_0x42c1d7,_0x14992e,!![]);}catch(_0x454dd5){return BPromise[_0xa5b4('0x24')](_0x454dd5);}return _0x42c1d7[_0xa5b4('0x25')]();};}function saveUpdates(_0x17d092,_0x173810){return function(_0x25d96f){if(_0x25d96f){return _0x25d96f[_0xa5b4('0x26')](_0x17d092)[_0xa5b4('0x27')](function(_0x4b445a){return _0x4b445a;});}return null;};}function removeEntity(_0x1bcf22,_0x4e72a5){return function(_0x48e94a){if(_0x48e94a){return _0x48e94a[_0xa5b4('0x28')]()['then'](function(){_0x1bcf22[_0xa5b4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b9ba9,_0x1185fb){return function(_0x5c8a7d){if(!_0x5c8a7d){_0x2b9ba9[_0xa5b4('0x1b')](0x194);}return _0x5c8a7d;};}function handleError(_0x350bb4,_0x1d7a9a){_0x1d7a9a=_0x1d7a9a||0x1f4;return function(_0x352a2f){logger[_0xa5b4('0x29')](_0x352a2f['stack']);if(_0x352a2f[_0xa5b4('0x2a')]){delete _0x352a2f[_0xa5b4('0x2a')];}_0x350bb4[_0xa5b4('0x1c')](_0x1d7a9a)[_0xa5b4('0x2b')](_0x352a2f);};}exports[_0xa5b4('0x2c')]=function(_0x263a58,_0x3c98f1){var _0xc5fb88={},_0x190e76={},_0x46dc0c={'count':0x0,'rows':[]};var _0x17a1ef=_[_0xa5b4('0x2d')](db['SalesforceConfiguration']['rawAttributes'],function(_0x5ac7f5){return{'name':_0x5ac7f5[_0xa5b4('0x2e')],'type':_0x5ac7f5[_0xa5b4('0x2f')][_0xa5b4('0x30')]};});_0x190e76['model']=_[_0xa5b4('0x2d')](_0x17a1ef,'name');_0x190e76[_0xa5b4('0x31')]=_['keys'](_0x263a58[_0xa5b4('0x31')]);_0x190e76[_0xa5b4('0x32')]=_['intersection'](_0x190e76[_0xa5b4('0x33')],_0x190e76['query']);_0xc5fb88[_0xa5b4('0x34')]=_['intersection'](_0x190e76[_0xa5b4('0x33')],qs[_0xa5b4('0x35')](_0x263a58[_0xa5b4('0x31')]['fields']));_0xc5fb88[_0xa5b4('0x34')]=_0xc5fb88[_0xa5b4('0x34')]['length']?_0xc5fb88[_0xa5b4('0x34')]:_0x190e76['model'];if(!_0x263a58[_0xa5b4('0x31')]['hasOwnProperty'](_0xa5b4('0x36'))){_0xc5fb88[_0xa5b4('0x37')]=qs[_0xa5b4('0x37')](_0x263a58[_0xa5b4('0x31')][_0xa5b4('0x37')]);_0xc5fb88[_0xa5b4('0x1f')]=qs[_0xa5b4('0x1f')](_0x263a58['query'][_0xa5b4('0x1f')]);}_0xc5fb88[_0xa5b4('0x38')]=qs['sort'](_0x263a58[_0xa5b4('0x31')]['sort']);_0xc5fb88[_0xa5b4('0x39')]=qs[_0xa5b4('0x32')](_[_0xa5b4('0x3a')](_0x263a58['query'],_0x190e76['filters']),_0x17a1ef);if(_0x263a58[_0xa5b4('0x31')][_0xa5b4('0x3b')]){_0xc5fb88[_0xa5b4('0x39')]=_['merge'](_0xc5fb88['where'],{'$or':_[_0xa5b4('0x2d')](_0x17a1ef,function(_0x1dc069){if(_0x1dc069[_0xa5b4('0x2f')]!==_0xa5b4('0x3c')){var _0x43775c={};_0x43775c[_0x1dc069[_0xa5b4('0x2a')]]={'$like':'%'+_0x263a58['query'][_0xa5b4('0x3b')]+'%'};return _0x43775c;}})});}_0xc5fb88=_[_0xa5b4('0x3d')]({},_0xc5fb88,_0x263a58[_0xa5b4('0x3e')]);var _0x375a8e={'where':_0xc5fb88[_0xa5b4('0x39')]};return db[_0xa5b4('0x3f')][_0xa5b4('0x21')](_0x375a8e)[_0xa5b4('0x27')](function(_0x4dadf2){_0x46dc0c[_0xa5b4('0x21')]=_0x4dadf2;if(_0x263a58[_0xa5b4('0x31')]['includeAll']){_0xc5fb88[_0xa5b4('0x40')]=[{'all':!![]}];}return db[_0xa5b4('0x3f')][_0xa5b4('0x41')](_0xc5fb88);})[_0xa5b4('0x27')](function(_0x534334){_0x46dc0c[_0xa5b4('0x42')]=_0x534334;return _0x46dc0c;})[_0xa5b4('0x27')](respondWithFilteredResult(_0x3c98f1,_0xc5fb88))[_0xa5b4('0x43')](handleError(_0x3c98f1,null));};exports[_0xa5b4('0x44')]=function(_0x43c247,_0x32bcbe){var _0x43fe10={'raw':![],'where':{'id':_0x43c247[_0xa5b4('0x45')]['id']}},_0x471d2d={};_0x471d2d['model']=_[_0xa5b4('0x46')](db[_0xa5b4('0x3f')][_0xa5b4('0x47')]);_0x471d2d[_0xa5b4('0x31')]=_['keys'](_0x43c247[_0xa5b4('0x31')]);_0x471d2d['filters']=_[_0xa5b4('0x48')](_0x471d2d[_0xa5b4('0x33')],_0x471d2d['query']);_0x43fe10[_0xa5b4('0x34')]=_[_0xa5b4('0x48')](_0x471d2d[_0xa5b4('0x33')],qs['fields'](_0x43c247[_0xa5b4('0x31')][_0xa5b4('0x35')]));_0x43fe10[_0xa5b4('0x34')]=_0x43fe10[_0xa5b4('0x34')][_0xa5b4('0x49')]?_0x43fe10[_0xa5b4('0x34')]:_0x471d2d[_0xa5b4('0x33')];if(_0x43c247[_0xa5b4('0x31')][_0xa5b4('0x4a')]){_0x43fe10[_0xa5b4('0x40')]=[{'all':!![]}];}_0x43fe10=_[_0xa5b4('0x3d')]({},_0x43fe10,_0x43c247[_0xa5b4('0x3e')]);return db['SalesforceConfiguration']['find'](_0x43fe10)[_0xa5b4('0x27')](handleEntityNotFound(_0x32bcbe,null))[_0xa5b4('0x27')](respondWithResult(_0x32bcbe,null))['catch'](handleError(_0x32bcbe,null));};exports[_0xa5b4('0x4b')]=function(_0x4a829,_0x3f3089){return db['SalesforceConfiguration'][_0xa5b4('0x4b')](_0x4a829['body'],{})[_0xa5b4('0x27')](respondWithResult(_0x3f3089,0xc9))['catch'](handleError(_0x3f3089,null));};exports[_0xa5b4('0x26')]=function(_0x246113,_0x2b702c){if(_0x246113['body']['id']){delete _0x246113[_0xa5b4('0x4c')]['id'];}return db[_0xa5b4('0x3f')][_0xa5b4('0x4d')]({'where':{'id':_0x246113[_0xa5b4('0x45')]['id']}})[_0xa5b4('0x27')](handleEntityNotFound(_0x2b702c,null))[_0xa5b4('0x27')](saveUpdates(_0x246113[_0xa5b4('0x4c')],null))[_0xa5b4('0x27')](respondWithResult(_0x2b702c,null))[_0xa5b4('0x43')](handleError(_0x2b702c,null));};exports[_0xa5b4('0x28')]=function(_0x48679b,_0x383038){return db['SalesforceConfiguration'][_0xa5b4('0x4d')]({'where':{'id':_0x48679b[_0xa5b4('0x45')]['id']}})[_0xa5b4('0x27')](handleEntityNotFound(_0x383038,null))[_0xa5b4('0x27')](removeEntity(_0x383038,null))['catch'](handleError(_0x383038,null));};exports[_0xa5b4('0x4e')]=function(_0x2ad649,_0x463059,_0x5966bf){var _0x135117={};var _0x1b7009={};var _0x15a5bb;var _0x48f217;return db[_0xa5b4('0x3f')][_0xa5b4('0x4f')]({'where':{'id':_0x2ad649['params']['id']}})['then'](handleEntityNotFound(_0x463059,null))[_0xa5b4('0x27')](function(_0x11543f){if(_0x11543f){_0x15a5bb=_0x11543f;_0x1b7009[_0xa5b4('0x33')]=_[_0xa5b4('0x46')](db[_0xa5b4('0x50')][_0xa5b4('0x47')]);_0x1b7009['query']=_[_0xa5b4('0x46')](_0x2ad649[_0xa5b4('0x31')]);_0x1b7009[_0xa5b4('0x32')]=_[_0xa5b4('0x48')](_0x1b7009[_0xa5b4('0x33')],_0x1b7009[_0xa5b4('0x31')]);_0x135117[_0xa5b4('0x34')]=_[_0xa5b4('0x48')](_0x1b7009[_0xa5b4('0x33')],qs[_0xa5b4('0x35')](_0x2ad649[_0xa5b4('0x31')][_0xa5b4('0x35')]));_0x135117[_0xa5b4('0x34')]=_0x135117['attributes'][_0xa5b4('0x49')]?_0x135117[_0xa5b4('0x34')]:_0x1b7009[_0xa5b4('0x33')];_0x135117[_0xa5b4('0x38')]=qs[_0xa5b4('0x51')](_0x2ad649['query']['sort']);_0x135117['where']=qs[_0xa5b4('0x32')](_[_0xa5b4('0x3a')](_0x2ad649['query'],_0x1b7009[_0xa5b4('0x32')]));if(_0x2ad649[_0xa5b4('0x31')][_0xa5b4('0x3b')]){_0x135117[_0xa5b4('0x39')]=_[_0xa5b4('0x3d')](_0x135117['where'],{'$or':_[_0xa5b4('0x2d')](_0x135117[_0xa5b4('0x34')],function(_0x1af335){var _0x32d210={};_0x32d210[_0x1af335]={'$like':'%'+_0x2ad649[_0xa5b4('0x31')]['filter']+'%'};return _0x32d210;})});}_0x135117=_['merge']({},_0x135117,_0x2ad649['options']);return _0x15a5bb[_0xa5b4('0x4e')](_0x135117);}})[_0xa5b4('0x27')](function(_0x4ffaa2){if(_0x4ffaa2){_0x48f217=_0x4ffaa2['length'];if(!_0x2ad649['query']['hasOwnProperty']('nolimit')){_0x135117[_0xa5b4('0x37')]=qs[_0xa5b4('0x37')](_0x2ad649[_0xa5b4('0x31')]['limit']);_0x135117['offset']=qs['offset'](_0x2ad649[_0xa5b4('0x31')][_0xa5b4('0x1f')]);}return _0x15a5bb[_0xa5b4('0x4e')](_0x135117);}})[_0xa5b4('0x27')](function(_0x395e92){if(_0x395e92){return _0x395e92?{'count':_0x48f217,'rows':_0x395e92}:null;}})['then'](respondWithResult(_0x463059,null))['catch'](handleError(_0x463059,null));};exports[_0xa5b4('0x52')]=function(_0xe3166a,_0x21f0fd,_0x579335){var _0x43c18f={};var _0x3917b8={};var _0x4031b9;var _0x46b9eb;return db[_0xa5b4('0x3f')][_0xa5b4('0x4f')]({'where':{'id':_0xe3166a['params']['id']}})[_0xa5b4('0x27')](handleEntityNotFound(_0x21f0fd,null))[_0xa5b4('0x27')](function(_0x1d4e1b){if(_0x1d4e1b){_0x4031b9=_0x1d4e1b;_0x3917b8[_0xa5b4('0x33')]=_[_0xa5b4('0x46')](db['SalesforceField']['rawAttributes']);_0x3917b8[_0xa5b4('0x31')]=_[_0xa5b4('0x46')](_0xe3166a[_0xa5b4('0x31')]);_0x3917b8[_0xa5b4('0x32')]=_['intersection'](_0x3917b8[_0xa5b4('0x33')],_0x3917b8['query']);_0x43c18f[_0xa5b4('0x34')]=_[_0xa5b4('0x48')](_0x3917b8[_0xa5b4('0x33')],qs['fields'](_0xe3166a[_0xa5b4('0x31')][_0xa5b4('0x35')]));_0x43c18f[_0xa5b4('0x34')]=_0x43c18f[_0xa5b4('0x34')][_0xa5b4('0x49')]?_0x43c18f[_0xa5b4('0x34')]:_0x3917b8[_0xa5b4('0x33')];_0x43c18f[_0xa5b4('0x38')]=qs[_0xa5b4('0x51')](_0xe3166a['query'][_0xa5b4('0x51')]);_0x43c18f[_0xa5b4('0x39')]=qs['filters'](_['pick'](_0xe3166a[_0xa5b4('0x31')],_0x3917b8[_0xa5b4('0x32')]));if(_0xe3166a[_0xa5b4('0x31')][_0xa5b4('0x3b')]){_0x43c18f[_0xa5b4('0x39')]=_['merge'](_0x43c18f[_0xa5b4('0x39')],{'$or':_['map'](_0x43c18f[_0xa5b4('0x34')],function(_0x460525){var _0x5b9c79={};_0x5b9c79[_0x460525]={'$like':'%'+_0xe3166a['query'][_0xa5b4('0x3b')]+'%'};return _0x5b9c79;})});}_0x43c18f=_['merge']({},_0x43c18f,_0xe3166a[_0xa5b4('0x3e')]);return _0x4031b9[_0xa5b4('0x52')](_0x43c18f);}})[_0xa5b4('0x27')](function(_0x46b50c){if(_0x46b50c){_0x46b9eb=_0x46b50c[_0xa5b4('0x49')];if(!_0xe3166a[_0xa5b4('0x31')][_0xa5b4('0x53')](_0xa5b4('0x36'))){_0x43c18f[_0xa5b4('0x37')]=qs['limit'](_0xe3166a[_0xa5b4('0x31')][_0xa5b4('0x37')]);_0x43c18f[_0xa5b4('0x1f')]=qs[_0xa5b4('0x1f')](_0xe3166a[_0xa5b4('0x31')][_0xa5b4('0x1f')]);}return _0x4031b9[_0xa5b4('0x52')](_0x43c18f);}})[_0xa5b4('0x27')](function(_0x35e6b5){if(_0x35e6b5){return _0x35e6b5?{'count':_0x46b9eb,'rows':_0x35e6b5}:null;}})[_0xa5b4('0x27')](respondWithResult(_0x21f0fd,null))[_0xa5b4('0x43')](handleError(_0x21f0fd,null));};exports[_0xa5b4('0x54')]=function(_0xc55651,_0x20e15c,_0x1a5604){var _0x34ce67={};var _0x284463={};var _0x477a0f;var _0x727006;return db[_0xa5b4('0x3f')]['findOne']({'where':{'id':_0xc55651[_0xa5b4('0x45')]['id']}})['then'](handleEntityNotFound(_0x20e15c,null))[_0xa5b4('0x27')](function(_0x2e83c4){if(_0x2e83c4){_0x477a0f=_0x2e83c4;_0x284463[_0xa5b4('0x33')]=_[_0xa5b4('0x46')](db[_0xa5b4('0x50')][_0xa5b4('0x47')]);_0x284463['query']=_[_0xa5b4('0x46')](_0xc55651[_0xa5b4('0x31')]);_0x284463[_0xa5b4('0x32')]=_[_0xa5b4('0x48')](_0x284463[_0xa5b4('0x33')],_0x284463[_0xa5b4('0x31')]);_0x34ce67['attributes']=_[_0xa5b4('0x48')](_0x284463[_0xa5b4('0x33')],qs[_0xa5b4('0x35')](_0xc55651[_0xa5b4('0x31')][_0xa5b4('0x35')]));_0x34ce67[_0xa5b4('0x34')]=_0x34ce67['attributes'][_0xa5b4('0x49')]?_0x34ce67[_0xa5b4('0x34')]:_0x284463['model'];_0x34ce67[_0xa5b4('0x38')]=qs[_0xa5b4('0x51')](_0xc55651[_0xa5b4('0x31')][_0xa5b4('0x51')]);_0x34ce67['where']=qs['filters'](_[_0xa5b4('0x3a')](_0xc55651[_0xa5b4('0x31')],_0x284463[_0xa5b4('0x32')]));if(_0xc55651[_0xa5b4('0x31')][_0xa5b4('0x3b')]){_0x34ce67[_0xa5b4('0x39')]=_[_0xa5b4('0x3d')](_0x34ce67[_0xa5b4('0x39')],{'$or':_[_0xa5b4('0x2d')](_0x34ce67[_0xa5b4('0x34')],function(_0x35bae){var _0x41b9ad={};_0x41b9ad[_0x35bae]={'$like':'%'+_0xc55651[_0xa5b4('0x31')][_0xa5b4('0x3b')]+'%'};return _0x41b9ad;})});}_0x34ce67=_[_0xa5b4('0x3d')]({},_0x34ce67,_0xc55651['options']);return _0x477a0f[_0xa5b4('0x54')](_0x34ce67);}})[_0xa5b4('0x27')](function(_0x47af4b){if(_0x47af4b){_0x727006=_0x47af4b[_0xa5b4('0x49')];if(!_0xc55651['query']['hasOwnProperty'](_0xa5b4('0x36'))){_0x34ce67['limit']=qs[_0xa5b4('0x37')](_0xc55651[_0xa5b4('0x31')]['limit']);_0x34ce67['offset']=qs['offset'](_0xc55651[_0xa5b4('0x31')][_0xa5b4('0x1f')]);}return _0x477a0f[_0xa5b4('0x54')](_0x34ce67);}})['then'](function(_0x4a9e5b){if(_0x4a9e5b){return _0x4a9e5b?{'count':_0x727006,'rows':_0x4a9e5b}:null;}})['then'](respondWithResult(_0x20e15c,null))[_0xa5b4('0x43')](handleError(_0x20e15c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 892c94b..177c139 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 _0x0594=['define','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0594,0xeb));var _0x4059=function(_0x2325c0,_0x5929c5){_0x2325c0=_0x2325c0-0x0;var _0x1c7b40=_0x0594[_0x2325c0];return _0x1c7b40;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4059('0x0'))(_0x4059('0x1'));var moment=require(_0x4059('0x2'));var BPromise=require(_0x4059('0x3'));var rp=require(_0x4059('0x4'));var fs=require('fs');var path=require(_0x4059('0x5'));var rimraf=require(_0x4059('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x4059('0x7')]=function(_0x2b00bd,_0x2f5318){return _0x2b00bd[_0x4059('0x8')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcaea=['moment','request-promise','rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util'];(function(_0x50bc55,_0xae2119){var _0x27c53e=function(_0x31a2f2){while(--_0x31a2f2){_0x50bc55['push'](_0x50bc55['shift']());}};_0x27c53e(++_0xae2119);}(_0xcaea,0xf8));var _0xacae=function(_0x26a715,_0x22659f){_0x26a715=_0x26a715-0x0;var _0x45420d=_0xcaea[_0x26a715];return _0x45420d;};'use strict';var _=require(_0xacae('0x0'));var util=require(_0xacae('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xacae('0x2'));var BPromise=require('bluebird');var rp=require(_0xacae('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xacae('0x4'));var config=require('../../config/environment');var attributes=require(_0xacae('0x5'));module[_0xacae('0x6')]=function(_0x8667d5,_0x4b501a){return _0x8667d5[_0xacae('0x7')](_0xacae('0x8'),attributes,{'tableName':_0xacae('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 3724a9e..94909f2 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 _0xd551=['jayson/promise','client','http','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x580a10,_0x48e5d4){var _0x476b81=function(_0x126766){while(--_0x126766){_0x580a10['push'](_0x580a10['shift']());}};_0x476b81(++_0x48e5d4);}(_0xd551,0x65));var _0x1d55=function(_0x34ad09,_0xba8f16){_0x34ad09=_0x34ad09-0x0;var _0x4c8431=_0xd551[_0x34ad09];return _0x4c8431;};'use strict';var _=require('lodash');var util=require(_0x1d55('0x0'));var moment=require(_0x1d55('0x1'));var BPromise=require(_0x1d55('0x2'));var rs=require(_0x1d55('0x3'));var fs=require('fs');var Redis=require(_0x1d55('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d55('0x5'));var logger=require(_0x1d55('0x6'))(_0x1d55('0x7'));var config=require(_0x1d55('0x8'));var jayson=require(_0x1d55('0x9'));var client=jayson[_0x1d55('0xa')][_0x1d55('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c84ad,_0x26f547,_0x562762){return new BPromise(function(_0x524051,_0x20aac1){return client['request'](_0x5c84ad,_0x562762)['then'](function(_0x31ecab){logger[_0x1d55('0xc')](_0x1d55('0xd'),_0x26f547,_0x1d55('0xe'));logger[_0x1d55('0xf')](_0x1d55('0x10'),_0x26f547,_0x1d55('0xe'),JSON[_0x1d55('0x11')](_0x31ecab));if(_0x31ecab[_0x1d55('0x12')]){if(_0x31ecab['error'][_0x1d55('0x13')]===0x1f4){logger[_0x1d55('0x12')](_0x1d55('0xd'),_0x26f547,_0x31ecab[_0x1d55('0x12')]['message']);return _0x20aac1(_0x31ecab[_0x1d55('0x12')][_0x1d55('0x14')]);}logger[_0x1d55('0x12')](_0x1d55('0xd'),_0x26f547,_0x31ecab[_0x1d55('0x12')][_0x1d55('0x14')]);return _0x524051(_0x31ecab[_0x1d55('0x12')][_0x1d55('0x14')]);}else{logger[_0x1d55('0xc')](_0x1d55('0xd'),_0x26f547,_0x1d55('0xe'));_0x524051(_0x31ecab[_0x1d55('0x15')][_0x1d55('0x14')]);}})['catch'](function(_0x4352fb){logger[_0x1d55('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x26f547,_0x4352fb);_0x20aac1(_0x4352fb);});});} \ No newline at end of file +var _0x489b=['request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x312a22,_0x3fc9b5){var _0x417e7a=function(_0x33eb8f){while(--_0x33eb8f){_0x312a22['push'](_0x312a22['shift']());}};_0x417e7a(++_0x3fc9b5);}(_0x489b,0x1cb));var _0xb489=function(_0x3e6750,_0x9e51a5){_0x3e6750=_0x3e6750-0x0;var _0xb0fb48=_0x489b[_0x3e6750];return _0xb0fb48;};'use strict';var _=require(_0xb489('0x0'));var util=require(_0xb489('0x1'));var moment=require(_0xb489('0x2'));var BPromise=require(_0xb489('0x3'));var rs=require(_0xb489('0x4'));var fs=require('fs');var Redis=require(_0xb489('0x5'));var db=require(_0xb489('0x6'))['db'];var utils=require(_0xb489('0x7'));var logger=require(_0xb489('0x8'))(_0xb489('0x9'));var config=require(_0xb489('0xa'));var jayson=require(_0xb489('0xb'));var client=jayson['client'][_0xb489('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7f80f8,_0xaeff44,_0x423e13){return new BPromise(function(_0x4400c3,_0x3a8113){return client[_0xb489('0xd')](_0x7f80f8,_0x423e13)['then'](function(_0x29da60){logger[_0xb489('0xe')](_0xb489('0xf'),_0xaeff44,_0xb489('0x10'));logger[_0xb489('0x11')](_0xb489('0x12'),_0xaeff44,'request\x20sent',JSON[_0xb489('0x13')](_0x29da60));if(_0x29da60['error']){if(_0x29da60[_0xb489('0x14')][_0xb489('0x15')]===0x1f4){logger['error'](_0xb489('0xf'),_0xaeff44,_0x29da60[_0xb489('0x14')]['message']);return _0x3a8113(_0x29da60['error']['message']);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0xaeff44,_0x29da60[_0xb489('0x14')][_0xb489('0x16')]);return _0x4400c3(_0x29da60[_0xb489('0x14')][_0xb489('0x16')]);}else{logger[_0xb489('0xe')](_0xb489('0xf'),_0xaeff44,_0xb489('0x10'));_0x4400c3(_0x29da60[_0xb489('0x17')][_0xb489('0x16')]);}})[_0xb489('0x18')](function(_0x41008c){logger[_0xb489('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0xaeff44,_0x41008c);_0x3a8113(_0x41008c);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 7829346..26c81b8 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 _0xb4dd=['../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','show','post','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x5b87ce,_0x20b7f6){var _0x597aa7=function(_0x295004){while(--_0x295004){_0x5b87ce['push'](_0x5b87ce['shift']());}};_0x597aa7(++_0x20b7f6);}(_0xb4dd,0x13d));var _0xdb4d=function(_0x1360de,_0x1ca32f){_0x1360de=_0x1360de-0x0;var _0x2517ec=_0xb4dd[_0x1360de];return _0x2517ec;};'use strict';var multer=require(_0xdb4d('0x0'));var util=require(_0xdb4d('0x1'));var path=require('path');var timeout=require(_0xdb4d('0x2'));var express=require(_0xdb4d('0x3'));var router=express[_0xdb4d('0x4')]();var fs_extra=require(_0xdb4d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdb4d('0x6'));var config=require(_0xdb4d('0x7'));var controller=require(_0xdb4d('0x8'));router['get']('/',auth[_0xdb4d('0x9')](),controller[_0xdb4d('0xa')]);router[_0xdb4d('0xb')]('/:id',auth[_0xdb4d('0x9')](),controller[_0xdb4d('0xc')]);router[_0xdb4d('0xd')]('/',auth[_0xdb4d('0x9')](),controller['create']);router[_0xdb4d('0xe')](_0xdb4d('0xf'),auth[_0xdb4d('0x9')](),controller['update']);router[_0xdb4d('0x10')](_0xdb4d('0xf'),auth['isAuthenticated'](),controller[_0xdb4d('0x11')]);module[_0xdb4d('0x12')]=router; \ No newline at end of file +var _0x8798=['path','Router','fs-extra','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','index','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util'];(function(_0x27a0e5,_0x1f6d3b){var _0x11e44e=function(_0x1720c6){while(--_0x1720c6){_0x27a0e5['push'](_0x27a0e5['shift']());}};_0x11e44e(++_0x1f6d3b);}(_0x8798,0xe8));var _0x8879=function(_0x5d530c,_0x38a743){_0x5d530c=_0x5d530c-0x0;var _0x1f1021=_0x8798[_0x5d530c];return _0x1f1021;};'use strict';var multer=require(_0x8879('0x0'));var util=require(_0x8879('0x1'));var path=require(_0x8879('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8879('0x3')]();var fs_extra=require(_0x8879('0x4'));var auth=require(_0x8879('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8879('0x6'));var controller=require(_0x8879('0x7'));router[_0x8879('0x8')]('/',auth['isAuthenticated'](),controller[_0x8879('0x9')]);router[_0x8879('0x8')](_0x8879('0xa'),auth[_0x8879('0xb')](),controller[_0x8879('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8879('0xd')](_0x8879('0xa'),auth[_0x8879('0xb')](),controller[_0x8879('0xe')]);router[_0x8879('0xf')](_0x8879('0xa'),auth['isAuthenticated'](),controller[_0x8879('0x10')]);module[_0x8879('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 1039742..4dcb84d 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 _0x72b5=['keyValue','picklist','string','STRING','customVariable','sequelize','ENUM','variable'];(function(_0x295fe9,_0x345828){var _0x3b80df=function(_0x85b4dc){while(--_0x85b4dc){_0x295fe9['push'](_0x295fe9['shift']());}};_0x3b80df(++_0x345828);}(_0x72b5,0x9d));var _0x572b=function(_0x1323fa,_0x193b8a){_0x1323fa=_0x1323fa-0x0;var _0x39b0e7=_0x72b5[_0x1323fa];return _0x39b0e7;};'use strict';var Sequelize=require(_0x572b('0x0'));module['exports']={'type':{'type':Sequelize[_0x572b('0x1')]('string',_0x572b('0x2'),'customVariable',_0x572b('0x3'),_0x572b('0x4')),'defaultValue':_0x572b('0x5')},'content':{'type':Sequelize[_0x572b('0x6')]},'key':{'type':Sequelize[_0x572b('0x6')]},'keyType':{'type':Sequelize[_0x572b('0x1')](_0x572b('0x5'),_0x572b('0x2'),_0x572b('0x7'))},'keyContent':{'type':Sequelize[_0x572b('0x6')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x572b('0x6')]}}; \ No newline at end of file +var _0x019f=['ENUM','string','variable','keyValue','STRING','customVariable','sequelize','exports'];(function(_0x26f2a3,_0x324e2d){var _0x2a9969=function(_0x3cc464){while(--_0x3cc464){_0x26f2a3['push'](_0x26f2a3['shift']());}};_0x2a9969(++_0x324e2d);}(_0x019f,0x126));var _0xf019=function(_0x3c5924,_0x4d295f){_0x3c5924=_0x3c5924-0x0;var _0x576958=_0x019f[_0x3c5924];return _0x576958;};'use strict';var Sequelize=require(_0xf019('0x0'));module[_0xf019('0x1')]={'type':{'type':Sequelize[_0xf019('0x2')](_0xf019('0x3'),_0xf019('0x4'),'customVariable',_0xf019('0x5'),'picklist'),'defaultValue':_0xf019('0x3')},'content':{'type':Sequelize[_0xf019('0x6')]},'key':{'type':Sequelize[_0xf019('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xf019('0x3'),_0xf019('0x4'),_0xf019('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf019('0x6')]},'variableName':{'type':Sequelize[_0xf019('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 0e51a76..439bf29 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 _0xd3db=['status','end','json','offset','undefined','limit','count','set','apply','then','destroy','sendStatus','stack','name','index','SalesforceField','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','update','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x770ffe,_0x441c78){var _0x27f062=function(_0x52da97){while(--_0x52da97){_0x770ffe['push'](_0x770ffe['shift']());}};_0x27f062(++_0x441c78);}(_0xd3db,0x1d4));var _0xbd3d=function(_0x126dca,_0x341c12){_0x126dca=_0x126dca-0x0;var _0x33db12=_0xd3db[_0x126dca];return _0x33db12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd3d('0x0'));var zipdir=require(_0xbd3d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbd3d('0x2'));var BPromise=require(_0xbd3d('0x3'));var Mustache=require(_0xbd3d('0x4'));var util=require(_0xbd3d('0x5'));var path=require(_0xbd3d('0x6'));var sox=require(_0xbd3d('0x7'));var csv=require(_0xbd3d('0x8'));var ejs=require(_0xbd3d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd3d('0xa'));var squel=require(_0xbd3d('0xb'));var crypto=require(_0xbd3d('0xc'));var jsforce=require(_0xbd3d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbd3d('0x8'));var querystring=require('querystring');var Papa=require(_0xbd3d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd3d('0xf'));var as=require(_0xbd3d('0x10'));var hardwareService=require(_0xbd3d('0x11'));var logger=require(_0xbd3d('0x12'))('api');var utils=require(_0xbd3d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbd3d('0x14'));var db=require(_0xbd3d('0x15'))['db'];function respondWithStatusCode(_0xf51fa9,_0x5ae367){_0x5ae367=_0x5ae367||0xcc;return function(_0x220c61){if(_0x220c61){return _0xf51fa9['sendStatus'](_0x5ae367);}return _0xf51fa9[_0xbd3d('0x16')](_0x5ae367)[_0xbd3d('0x17')]();};}function respondWithResult(_0x798a4e,_0x5f31b9){_0x5f31b9=_0x5f31b9||0xc8;return function(_0x1b381b){if(_0x1b381b){return _0x798a4e[_0xbd3d('0x16')](_0x5f31b9)[_0xbd3d('0x18')](_0x1b381b);}};}function respondWithFilteredResult(_0x34d627,_0x16e06c){return function(_0x117b79){if(_0x117b79){var _0x54bfac=typeof _0x16e06c[_0xbd3d('0x19')]===_0xbd3d('0x1a')&&typeof _0x16e06c[_0xbd3d('0x1b')]===_0xbd3d('0x1a');var _0x56df26=_0x117b79['count'];var _0x6b882a=_0x54bfac?0x0:_0x16e06c[_0xbd3d('0x19')];var _0x176fe5=_0x54bfac?_0x117b79[_0xbd3d('0x1c')]:_0x16e06c[_0xbd3d('0x19')]+_0x16e06c['limit'];var _0xafe96;if(_0x176fe5>=_0x56df26){_0x176fe5=_0x56df26;_0xafe96=0xc8;}else{_0xafe96=0xce;}_0x34d627['status'](_0xafe96);return _0x34d627[_0xbd3d('0x1d')]('Content-Range',_0x6b882a+'-'+_0x176fe5+'/'+_0x56df26)['json'](_0x117b79);}return null;};}function patchUpdates(_0x1ae51d){return function(_0x59bade){try{jsonpatch[_0xbd3d('0x1e')](_0x59bade,_0x1ae51d,!![]);}catch(_0x488f25){return BPromise['reject'](_0x488f25);}return _0x59bade['save']();};}function saveUpdates(_0x3f3df3,_0x1a735b){return function(_0x3e0db4){if(_0x3e0db4){return _0x3e0db4['update'](_0x3f3df3)[_0xbd3d('0x1f')](function(_0x4b3de3){return _0x4b3de3;});}return null;};}function removeEntity(_0x2ca9e8,_0x15f0c2){return function(_0x37be52){if(_0x37be52){return _0x37be52[_0xbd3d('0x20')]()[_0xbd3d('0x1f')](function(){_0x2ca9e8[_0xbd3d('0x16')](0xcc)[_0xbd3d('0x17')]();});}};}function handleEntityNotFound(_0x116901,_0x5752f8){return function(_0x189125){if(!_0x189125){_0x116901[_0xbd3d('0x21')](0x194);}return _0x189125;};}function handleError(_0x319c97,_0x164634){_0x164634=_0x164634||0x1f4;return function(_0xb5377e){logger['error'](_0xb5377e[_0xbd3d('0x22')]);if(_0xb5377e[_0xbd3d('0x23')]){delete _0xb5377e[_0xbd3d('0x23')];}_0x319c97[_0xbd3d('0x16')](_0x164634)['send'](_0xb5377e);};}exports[_0xbd3d('0x24')]=function(_0x4bc783,_0x30e853){var _0x151ed2={},_0x130f5d={},_0x453701={'count':0x0,'rows':[]};var _0x3ef9e8=_['map'](db[_0xbd3d('0x25')][_0xbd3d('0x26')],function(_0x5ca759){return{'name':_0x5ca759['fieldName'],'type':_0x5ca759[_0xbd3d('0x27')][_0xbd3d('0x28')]};});_0x130f5d[_0xbd3d('0x29')]=_[_0xbd3d('0x2a')](_0x3ef9e8,_0xbd3d('0x23'));_0x130f5d[_0xbd3d('0x2b')]=_[_0xbd3d('0x2c')](_0x4bc783[_0xbd3d('0x2b')]);_0x130f5d[_0xbd3d('0x2d')]=_['intersection'](_0x130f5d[_0xbd3d('0x29')],_0x130f5d['query']);_0x151ed2[_0xbd3d('0x2e')]=_[_0xbd3d('0x2f')](_0x130f5d[_0xbd3d('0x29')],qs[_0xbd3d('0x30')](_0x4bc783[_0xbd3d('0x2b')][_0xbd3d('0x30')]));_0x151ed2[_0xbd3d('0x2e')]=_0x151ed2['attributes'][_0xbd3d('0x31')]?_0x151ed2['attributes']:_0x130f5d[_0xbd3d('0x29')];if(!_0x4bc783[_0xbd3d('0x2b')][_0xbd3d('0x32')](_0xbd3d('0x33'))){_0x151ed2[_0xbd3d('0x1b')]=qs[_0xbd3d('0x1b')](_0x4bc783[_0xbd3d('0x2b')]['limit']);_0x151ed2['offset']=qs[_0xbd3d('0x19')](_0x4bc783[_0xbd3d('0x2b')][_0xbd3d('0x19')]);}_0x151ed2[_0xbd3d('0x34')]=qs[_0xbd3d('0x35')](_0x4bc783['query'][_0xbd3d('0x35')]);_0x151ed2[_0xbd3d('0x36')]=qs[_0xbd3d('0x2d')](_[_0xbd3d('0x37')](_0x4bc783[_0xbd3d('0x2b')],_0x130f5d[_0xbd3d('0x2d')]),_0x3ef9e8);if(_0x4bc783[_0xbd3d('0x2b')][_0xbd3d('0x38')]){_0x151ed2[_0xbd3d('0x36')]=_[_0xbd3d('0x39')](_0x151ed2[_0xbd3d('0x36')],{'$or':_[_0xbd3d('0x2a')](_0x3ef9e8,function(_0x16ee4d){if(_0x16ee4d[_0xbd3d('0x27')]!==_0xbd3d('0x3a')){var _0x614050={};_0x614050[_0x16ee4d['name']]={'$like':'%'+_0x4bc783[_0xbd3d('0x2b')]['filter']+'%'};return _0x614050;}})});}_0x151ed2=_['merge']({},_0x151ed2,_0x4bc783[_0xbd3d('0x3b')]);var _0xd0add6={'where':_0x151ed2['where']};return db[_0xbd3d('0x25')]['count'](_0xd0add6)[_0xbd3d('0x1f')](function(_0x38a625){_0x453701[_0xbd3d('0x1c')]=_0x38a625;if(_0x4bc783['query'][_0xbd3d('0x3c')]){_0x151ed2['include']=[{'all':!![]}];}return db['SalesforceField'][_0xbd3d('0x3d')](_0x151ed2);})['then'](function(_0x3d9989){_0x453701['rows']=_0x3d9989;return _0x453701;})[_0xbd3d('0x1f')](respondWithFilteredResult(_0x30e853,_0x151ed2))[_0xbd3d('0x3e')](handleError(_0x30e853,null));};exports[_0xbd3d('0x3f')]=function(_0x4d4c3b,_0x17482d){var _0x24d4b8={'raw':!![],'where':{'id':_0x4d4c3b[_0xbd3d('0x40')]['id']}},_0x322a74={};_0x322a74[_0xbd3d('0x29')]=_[_0xbd3d('0x2c')](db[_0xbd3d('0x25')][_0xbd3d('0x26')]);_0x322a74[_0xbd3d('0x2b')]=_[_0xbd3d('0x2c')](_0x4d4c3b[_0xbd3d('0x2b')]);_0x322a74[_0xbd3d('0x2d')]=_[_0xbd3d('0x2f')](_0x322a74['model'],_0x322a74[_0xbd3d('0x2b')]);_0x24d4b8[_0xbd3d('0x2e')]=_[_0xbd3d('0x2f')](_0x322a74[_0xbd3d('0x29')],qs[_0xbd3d('0x30')](_0x4d4c3b[_0xbd3d('0x2b')]['fields']));_0x24d4b8[_0xbd3d('0x2e')]=_0x24d4b8[_0xbd3d('0x2e')]['length']?_0x24d4b8[_0xbd3d('0x2e')]:_0x322a74['model'];if(_0x4d4c3b[_0xbd3d('0x2b')]['includeAll']){_0x24d4b8[_0xbd3d('0x41')]=[{'all':!![]}];}_0x24d4b8=_['merge']({},_0x24d4b8,_0x4d4c3b[_0xbd3d('0x3b')]);return db['SalesforceField'][_0xbd3d('0x42')](_0x24d4b8)[_0xbd3d('0x1f')](handleEntityNotFound(_0x17482d,null))['then'](respondWithResult(_0x17482d,null))[_0xbd3d('0x3e')](handleError(_0x17482d,null));};exports[_0xbd3d('0x43')]=function(_0x29b075,_0x1176a1){return db[_0xbd3d('0x25')][_0xbd3d('0x43')](_0x29b075[_0xbd3d('0x44')],{})[_0xbd3d('0x1f')](respondWithResult(_0x1176a1,0xc9))['catch'](handleError(_0x1176a1,null));};exports[_0xbd3d('0x45')]=function(_0x3e0a41,_0x566816){if(_0x3e0a41['body']['id']){delete _0x3e0a41[_0xbd3d('0x44')]['id'];}return db[_0xbd3d('0x25')]['find']({'where':{'id':_0x3e0a41['params']['id']}})[_0xbd3d('0x1f')](handleEntityNotFound(_0x566816,null))[_0xbd3d('0x1f')](saveUpdates(_0x3e0a41[_0xbd3d('0x44')],null))['then'](respondWithResult(_0x566816,null))['catch'](handleError(_0x566816,null));};exports[_0xbd3d('0x20')]=function(_0x1f875b,_0x44dfa4){return db[_0xbd3d('0x25')]['find']({'where':{'id':_0x1f875b[_0xbd3d('0x40')]['id']}})[_0xbd3d('0x1f')](handleEntityNotFound(_0x44dfa4,null))[_0xbd3d('0x1f')](removeEntity(_0x44dfa4,null))['catch'](handleError(_0x44dfa4,null));}; \ No newline at end of file +var _0x5214=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x40ede5,_0xea4683){var _0x48d25a=function(_0x261b7b){while(--_0x261b7b){_0x40ede5['push'](_0x40ede5['shift']());}};_0x48d25a(++_0xea4683);}(_0x5214,0x12f));var _0x4521=function(_0x11bc7d,_0x2b0725){_0x11bc7d=_0x11bc7d-0x0;var _0x5ca446=_0x5214[_0x11bc7d];return _0x5ca446;};'use strict';var emlformat=require(_0x4521('0x0'));var rimraf=require(_0x4521('0x1'));var zipdir=require(_0x4521('0x2'));var jsonpatch=require(_0x4521('0x3'));var rp=require(_0x4521('0x4'));var moment=require(_0x4521('0x5'));var BPromise=require(_0x4521('0x6'));var Mustache=require(_0x4521('0x7'));var util=require(_0x4521('0x8'));var path=require(_0x4521('0x9'));var sox=require('sox');var csv=require(_0x4521('0xa'));var ejs=require(_0x4521('0xb'));var fs=require('fs');var fs_extra=require(_0x4521('0xc'));var _=require(_0x4521('0xd'));var squel=require(_0x4521('0xe'));var crypto=require('crypto');var jsforce=require(_0x4521('0xf'));var deskjs=require(_0x4521('0x10'));var toCsv=require(_0x4521('0xa'));var querystring=require(_0x4521('0x11'));var Papa=require(_0x4521('0x12'));var Redis=require(_0x4521('0x13'));var authService=require(_0x4521('0x14'));var qs=require(_0x4521('0x15'));var as=require(_0x4521('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4521('0x17'));var utils=require(_0x4521('0x18'));var config=require(_0x4521('0x19'));var licenseUtil=require(_0x4521('0x1a'));var db=require(_0x4521('0x1b'))['db'];function respondWithStatusCode(_0xd564d2,_0x50377b){_0x50377b=_0x50377b||0xcc;return function(_0x46ab19){if(_0x46ab19){return _0xd564d2[_0x4521('0x1c')](_0x50377b);}return _0xd564d2[_0x4521('0x1d')](_0x50377b)[_0x4521('0x1e')]();};}function respondWithResult(_0x4b913f,_0x195171){_0x195171=_0x195171||0xc8;return function(_0x5ba5ac){if(_0x5ba5ac){return _0x4b913f['status'](_0x195171)[_0x4521('0x1f')](_0x5ba5ac);}};}function respondWithFilteredResult(_0x293030,_0x1af438){return function(_0x52d295){if(_0x52d295){var _0x531dc1=typeof _0x1af438[_0x4521('0x20')]===_0x4521('0x21')&&typeof _0x1af438[_0x4521('0x22')]===_0x4521('0x21');var _0x3d2194=_0x52d295[_0x4521('0x23')];var _0x50137d=_0x531dc1?0x0:_0x1af438[_0x4521('0x20')];var _0x527cb9=_0x531dc1?_0x52d295[_0x4521('0x23')]:_0x1af438[_0x4521('0x20')]+_0x1af438[_0x4521('0x22')];var _0x4404c9;if(_0x527cb9>=_0x3d2194){_0x527cb9=_0x3d2194;_0x4404c9=0xc8;}else{_0x4404c9=0xce;}_0x293030[_0x4521('0x1d')](_0x4404c9);return _0x293030[_0x4521('0x24')](_0x4521('0x25'),_0x50137d+'-'+_0x527cb9+'/'+_0x3d2194)[_0x4521('0x1f')](_0x52d295);}return null;};}function patchUpdates(_0x3411e){return function(_0x465b11){try{jsonpatch['apply'](_0x465b11,_0x3411e,!![]);}catch(_0x1e4b36){return BPromise[_0x4521('0x26')](_0x1e4b36);}return _0x465b11[_0x4521('0x27')]();};}function saveUpdates(_0x370fa6,_0x270f83){return function(_0x980784){if(_0x980784){return _0x980784[_0x4521('0x28')](_0x370fa6)[_0x4521('0x29')](function(_0x309a45){return _0x309a45;});}return null;};}function removeEntity(_0x50e7cc,_0x2e9340){return function(_0x187e2d){if(_0x187e2d){return _0x187e2d[_0x4521('0x2a')]()[_0x4521('0x29')](function(){_0x50e7cc[_0x4521('0x1d')](0xcc)[_0x4521('0x1e')]();});}};}function handleEntityNotFound(_0x2b216b,_0x4f6016){return function(_0x1f7e03){if(!_0x1f7e03){_0x2b216b[_0x4521('0x1c')](0x194);}return _0x1f7e03;};}function handleError(_0x319fe6,_0x3a98fd){_0x3a98fd=_0x3a98fd||0x1f4;return function(_0x1a37f1){logger[_0x4521('0x2b')](_0x1a37f1[_0x4521('0x2c')]);if(_0x1a37f1['name']){delete _0x1a37f1[_0x4521('0x2d')];}_0x319fe6[_0x4521('0x1d')](_0x3a98fd)[_0x4521('0x2e')](_0x1a37f1);};}exports[_0x4521('0x2f')]=function(_0x25f5d0,_0x35e1b9){var _0x45f72c={},_0x204f9f={},_0x14bd57={'count':0x0,'rows':[]};var _0x30615f=_[_0x4521('0x30')](db[_0x4521('0x31')][_0x4521('0x32')],function(_0x2c640a){return{'name':_0x2c640a[_0x4521('0x33')],'type':_0x2c640a[_0x4521('0x34')][_0x4521('0x35')]};});_0x204f9f['model']=_[_0x4521('0x30')](_0x30615f,_0x4521('0x2d'));_0x204f9f['query']=_['keys'](_0x25f5d0['query']);_0x204f9f[_0x4521('0x36')]=_[_0x4521('0x37')](_0x204f9f[_0x4521('0x38')],_0x204f9f[_0x4521('0x39')]);_0x45f72c[_0x4521('0x3a')]=_[_0x4521('0x37')](_0x204f9f['model'],qs['fields'](_0x25f5d0[_0x4521('0x39')][_0x4521('0x3b')]));_0x45f72c[_0x4521('0x3a')]=_0x45f72c['attributes'][_0x4521('0x3c')]?_0x45f72c['attributes']:_0x204f9f[_0x4521('0x38')];if(!_0x25f5d0[_0x4521('0x39')][_0x4521('0x3d')]('nolimit')){_0x45f72c[_0x4521('0x22')]=qs[_0x4521('0x22')](_0x25f5d0[_0x4521('0x39')]['limit']);_0x45f72c['offset']=qs[_0x4521('0x20')](_0x25f5d0[_0x4521('0x39')]['offset']);}_0x45f72c[_0x4521('0x3e')]=qs[_0x4521('0x3f')](_0x25f5d0[_0x4521('0x39')][_0x4521('0x3f')]);_0x45f72c[_0x4521('0x40')]=qs['filters'](_[_0x4521('0x41')](_0x25f5d0[_0x4521('0x39')],_0x204f9f[_0x4521('0x36')]),_0x30615f);if(_0x25f5d0[_0x4521('0x39')][_0x4521('0x42')]){_0x45f72c[_0x4521('0x40')]=_['merge'](_0x45f72c[_0x4521('0x40')],{'$or':_[_0x4521('0x30')](_0x30615f,function(_0x59cf1d){if(_0x59cf1d[_0x4521('0x34')]!=='VIRTUAL'){var _0x59ac9f={};_0x59ac9f[_0x59cf1d[_0x4521('0x2d')]]={'$like':'%'+_0x25f5d0[_0x4521('0x39')][_0x4521('0x42')]+'%'};return _0x59ac9f;}})});}_0x45f72c=_[_0x4521('0x43')]({},_0x45f72c,_0x25f5d0[_0x4521('0x44')]);var _0x11045e={'where':_0x45f72c[_0x4521('0x40')]};return db['SalesforceField'][_0x4521('0x23')](_0x11045e)[_0x4521('0x29')](function(_0x4f5811){_0x14bd57[_0x4521('0x23')]=_0x4f5811;if(_0x25f5d0[_0x4521('0x39')][_0x4521('0x45')]){_0x45f72c[_0x4521('0x46')]=[{'all':!![]}];}return db[_0x4521('0x31')][_0x4521('0x47')](_0x45f72c);})[_0x4521('0x29')](function(_0x41b1e0){_0x14bd57[_0x4521('0x48')]=_0x41b1e0;return _0x14bd57;})['then'](respondWithFilteredResult(_0x35e1b9,_0x45f72c))[_0x4521('0x49')](handleError(_0x35e1b9,null));};exports[_0x4521('0x4a')]=function(_0x2e3f94,_0x1ea11f){var _0x5ebc5d={'raw':!![],'where':{'id':_0x2e3f94[_0x4521('0x4b')]['id']}},_0x30d696={};_0x30d696[_0x4521('0x38')]=_[_0x4521('0x4c')](db['SalesforceField']['rawAttributes']);_0x30d696[_0x4521('0x39')]=_[_0x4521('0x4c')](_0x2e3f94[_0x4521('0x39')]);_0x30d696[_0x4521('0x36')]=_[_0x4521('0x37')](_0x30d696[_0x4521('0x38')],_0x30d696['query']);_0x5ebc5d[_0x4521('0x3a')]=_['intersection'](_0x30d696[_0x4521('0x38')],qs[_0x4521('0x3b')](_0x2e3f94[_0x4521('0x39')]['fields']));_0x5ebc5d[_0x4521('0x3a')]=_0x5ebc5d[_0x4521('0x3a')][_0x4521('0x3c')]?_0x5ebc5d[_0x4521('0x3a')]:_0x30d696[_0x4521('0x38')];if(_0x2e3f94[_0x4521('0x39')][_0x4521('0x45')]){_0x5ebc5d[_0x4521('0x46')]=[{'all':!![]}];}_0x5ebc5d=_[_0x4521('0x43')]({},_0x5ebc5d,_0x2e3f94[_0x4521('0x44')]);return db['SalesforceField'][_0x4521('0x4d')](_0x5ebc5d)[_0x4521('0x29')](handleEntityNotFound(_0x1ea11f,null))[_0x4521('0x29')](respondWithResult(_0x1ea11f,null))[_0x4521('0x49')](handleError(_0x1ea11f,null));};exports[_0x4521('0x4e')]=function(_0xd6334d,_0x32da33){return db[_0x4521('0x31')][_0x4521('0x4e')](_0xd6334d[_0x4521('0x4f')],{})[_0x4521('0x29')](respondWithResult(_0x32da33,0xc9))[_0x4521('0x49')](handleError(_0x32da33,null));};exports[_0x4521('0x28')]=function(_0x1233e5,_0x3e41ff){if(_0x1233e5['body']['id']){delete _0x1233e5['body']['id'];}return db[_0x4521('0x31')]['find']({'where':{'id':_0x1233e5[_0x4521('0x4b')]['id']}})[_0x4521('0x29')](handleEntityNotFound(_0x3e41ff,null))[_0x4521('0x29')](saveUpdates(_0x1233e5[_0x4521('0x4f')],null))['then'](respondWithResult(_0x3e41ff,null))['catch'](handleError(_0x3e41ff,null));};exports['destroy']=function(_0x4e90f3,_0x4f933e){return db[_0x4521('0x31')][_0x4521('0x4d')]({'where':{'id':_0x4e90f3[_0x4521('0x4b')]['id']}})[_0x4521('0x29')](handleEntityNotFound(_0x4f933e,null))[_0x4521('0x29')](removeEntity(_0x4f933e,null))[_0x4521('0x49')](handleError(_0x4f933e,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index db00788..e1d0901 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 _0x8233=['../../config/environment','./intSalesforceField.attributes','define','SalesforceField','idField','FieldId','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x78f0bf,_0x4bec23){var _0x3ccc69=function(_0x2623c4){while(--_0x2623c4){_0x78f0bf['push'](_0x78f0bf['shift']());}};_0x3ccc69(++_0x4bec23);}(_0x8233,0x132));var _0x3823=function(_0x40e7aa,_0xb952d9){_0x40e7aa=_0x40e7aa-0x0;var _0x2dc873=_0x8233[_0x40e7aa];return _0x2dc873;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3823('0x0'))('api');var moment=require('moment');var BPromise=require(_0x3823('0x1'));var rp=require(_0x3823('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3823('0x3'));var config=require(_0x3823('0x4'));var attributes=require(_0x3823('0x5'));module['exports']=function(_0x117533,_0x5ef69c){return _0x117533[_0x3823('0x6')](_0x3823('0x7'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x3823('0x8'),_0x3823('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x421f=['int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','SalesforceField'];(function(_0x3197cf,_0x53d94a){var _0x3dde9b=function(_0x224340){while(--_0x224340){_0x3197cf['push'](_0x3197cf['shift']());}};_0x3dde9b(++_0x53d94a);}(_0x421f,0x103));var _0xf421=function(_0xc41365,_0x35d774){_0xc41365=_0xc41365-0x0;var _0x388102=_0x421f[_0xc41365];return _0x388102;};'use strict';var _=require('lodash');var util=require(_0xf421('0x0'));var logger=require(_0xf421('0x1'))(_0xf421('0x2'));var moment=require(_0xf421('0x3'));var BPromise=require(_0xf421('0x4'));var rp=require(_0xf421('0x5'));var fs=require('fs');var path=require(_0xf421('0x6'));var rimraf=require(_0xf421('0x7'));var config=require(_0xf421('0x8'));var attributes=require(_0xf421('0x9'));module['exports']=function(_0x97be9a,_0x3d0d9e){return _0x97be9a['define'](_0xf421('0xa'),attributes,{'tableName':_0xf421('0xb'),'paranoid':![],'indexes':[{'name':_0xf421('0xc'),'fields':[_0xf421('0xd'),_0xf421('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index b472285..4b5c9a0 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 _0x6c25=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5d68ec,_0x4984cb){var _0x1d4a40=function(_0x2f2db6){while(--_0x2f2db6){_0x5d68ec['push'](_0x5d68ec['shift']());}};_0x1d4a40(++_0x4984cb);}(_0x6c25,0xd2));var _0x56c2=function(_0x3d0c89,_0x39a2fa){_0x3d0c89=_0x3d0c89-0x0;var _0xd17883=_0x6c25[_0x3d0c89];return _0xd17883;};'use strict';var _=require(_0x56c2('0x0'));var util=require(_0x56c2('0x1'));var moment=require('moment');var BPromise=require(_0x56c2('0x2'));var rs=require(_0x56c2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x56c2('0x4'))['db'];var utils=require(_0x56c2('0x5'));var logger=require(_0x56c2('0x6'))(_0x56c2('0x7'));var config=require(_0x56c2('0x8'));var jayson=require(_0x56c2('0x9'));var client=jayson[_0x56c2('0xa')][_0x56c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4505ac,_0x8bbff,_0x3d94b2){return new BPromise(function(_0x6fdf6f,_0x5b5367){return client[_0x56c2('0xc')](_0x4505ac,_0x3d94b2)[_0x56c2('0xd')](function(_0x4a49df){logger[_0x56c2('0xe')](_0x56c2('0xf'),_0x8bbff,_0x56c2('0x10'));logger[_0x56c2('0x11')](_0x56c2('0x12'),_0x8bbff,_0x56c2('0x10'),JSON[_0x56c2('0x13')](_0x4a49df));if(_0x4a49df[_0x56c2('0x14')]){if(_0x4a49df[_0x56c2('0x14')][_0x56c2('0x15')]===0x1f4){logger[_0x56c2('0x14')](_0x56c2('0xf'),_0x8bbff,_0x4a49df[_0x56c2('0x14')]['message']);return _0x5b5367(_0x4a49df[_0x56c2('0x14')]['message']);}logger[_0x56c2('0x14')]('SalesforceField,\x20%s,\x20%s',_0x8bbff,_0x4a49df[_0x56c2('0x14')][_0x56c2('0x16')]);return _0x6fdf6f(_0x4a49df[_0x56c2('0x14')][_0x56c2('0x16')]);}else{logger[_0x56c2('0xe')](_0x56c2('0xf'),_0x8bbff,_0x56c2('0x10'));_0x6fdf6f(_0x4a49df[_0x56c2('0x17')][_0x56c2('0x16')]);}})['catch'](function(_0x3728a7){logger[_0x56c2('0x14')](_0x56c2('0xf'),_0x8bbff,_0x3728a7);_0x5b5367(_0x3728a7);});});} \ No newline at end of file +var _0xfdc1=['SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent'];(function(_0x131a20,_0x500ba0){var _0x3c0451=function(_0x516b19){while(--_0x516b19){_0x131a20['push'](_0x131a20['shift']());}};_0x3c0451(++_0x500ba0);}(_0xfdc1,0xcf));var _0x1fdc=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xfdc1[_0x4914e2];return _0x2dcd07;};'use strict';var _=require(_0x1fdc('0x0'));var util=require(_0x1fdc('0x1'));var moment=require(_0x1fdc('0x2'));var BPromise=require('bluebird');var rs=require(_0x1fdc('0x3'));var fs=require('fs');var Redis=require(_0x1fdc('0x4'));var db=require(_0x1fdc('0x5'))['db'];var utils=require(_0x1fdc('0x6'));var logger=require(_0x1fdc('0x7'))(_0x1fdc('0x8'));var config=require(_0x1fdc('0x9'));var jayson=require(_0x1fdc('0xa'));var client=jayson[_0x1fdc('0xb')][_0x1fdc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21908d,_0x456190,_0x301085){return new BPromise(function(_0x5662c0,_0x48b6d6){return client[_0x1fdc('0xd')](_0x21908d,_0x301085)[_0x1fdc('0xe')](function(_0x41f7ed){logger[_0x1fdc('0xf')](_0x1fdc('0x10'),_0x456190,_0x1fdc('0x11'));logger['debug'](_0x1fdc('0x12'),_0x456190,_0x1fdc('0x11'),JSON[_0x1fdc('0x13')](_0x41f7ed));if(_0x41f7ed[_0x1fdc('0x14')]){if(_0x41f7ed['error'][_0x1fdc('0x15')]===0x1f4){logger[_0x1fdc('0x14')](_0x1fdc('0x10'),_0x456190,_0x41f7ed[_0x1fdc('0x14')][_0x1fdc('0x16')]);return _0x48b6d6(_0x41f7ed[_0x1fdc('0x14')][_0x1fdc('0x16')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x456190,_0x41f7ed[_0x1fdc('0x14')][_0x1fdc('0x16')]);return _0x5662c0(_0x41f7ed[_0x1fdc('0x14')][_0x1fdc('0x16')]);}else{logger[_0x1fdc('0xf')](_0x1fdc('0x10'),_0x456190,_0x1fdc('0x11'));_0x5662c0(_0x41f7ed[_0x1fdc('0x17')][_0x1fdc('0x16')]);}})[_0x1fdc('0x18')](function(_0x52f166){logger[_0x1fdc('0x14')](_0x1fdc('0x10'),_0x456190,_0x52f166);_0x48b6d6(_0x52f166);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 60ebf6d..6a0512b 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 _0xbdd7=['express','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','post','create','addConfiguration','put','update','destroy','multer','util','path'];(function(_0x1fb02e,_0x2db37a){var _0x9f7b68=function(_0x1548ae){while(--_0x1548ae){_0x1fb02e['push'](_0x1fb02e['shift']());}};_0x9f7b68(++_0x2db37a);}(_0xbdd7,0xed));var _0x7bdd=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbdd7[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7bdd('0x0'));var util=require(_0x7bdd('0x1'));var path=require(_0x7bdd('0x2'));var timeout=require('connect-timeout');var express=require(_0x7bdd('0x3'));var router=express['Router']();var fs_extra=require(_0x7bdd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7bdd('0x5'));var config=require(_0x7bdd('0x6'));var controller=require(_0x7bdd('0x7'));router[_0x7bdd('0x8')]('/',auth['isAuthenticated'](),controller[_0x7bdd('0x9')]);router[_0x7bdd('0x8')](_0x7bdd('0xa'),auth[_0x7bdd('0xb')](),controller[_0x7bdd('0xc')]);router[_0x7bdd('0x8')](_0x7bdd('0xd'),auth[_0x7bdd('0xb')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x7bdd('0xb')](),controller['getFields']);router[_0x7bdd('0xe')]('/',auth[_0x7bdd('0xb')](),controller[_0x7bdd('0xf')]);router[_0x7bdd('0xe')](_0x7bdd('0xd'),auth[_0x7bdd('0xb')](),controller[_0x7bdd('0x10')]);router[_0x7bdd('0x11')](_0x7bdd('0xa'),auth[_0x7bdd('0xb')](),controller[_0x7bdd('0x12')]);router['delete'](_0x7bdd('0xa'),auth[_0x7bdd('0xb')](),controller[_0x7bdd('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5d70=['getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields'];(function(_0x44b91c,_0x483ee5){var _0x2a3356=function(_0x4f0e8a){while(--_0x4f0e8a){_0x44b91c['push'](_0x44b91c['shift']());}};_0x2a3356(++_0x483ee5);}(_0x5d70,0x8d));var _0x05d7=function(_0x3ce041,_0x4566c9){_0x3ce041=_0x3ce041-0x0;var _0x54afb8=_0x5d70[_0x3ce041];return _0x54afb8;};'use strict';var multer=require(_0x05d7('0x0'));var util=require(_0x05d7('0x1'));var path=require('path');var timeout=require(_0x05d7('0x2'));var express=require(_0x05d7('0x3'));var router=express[_0x05d7('0x4')]();var fs_extra=require(_0x05d7('0x5'));var auth=require(_0x05d7('0x6'));var interaction=require(_0x05d7('0x7'));var config=require('../../config/environment');var controller=require(_0x05d7('0x8'));router[_0x05d7('0x9')]('/',auth[_0x05d7('0xa')](),controller[_0x05d7('0xb')]);router['get']('/:id',auth[_0x05d7('0xa')](),controller[_0x05d7('0xc')]);router[_0x05d7('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x05d7('0xd')]);router[_0x05d7('0x9')](_0x05d7('0xe'),auth[_0x05d7('0xa')](),controller[_0x05d7('0xf')]);router[_0x05d7('0x10')]('/',auth[_0x05d7('0xa')](),controller[_0x05d7('0x11')]);router[_0x05d7('0x10')](_0x05d7('0x12'),auth[_0x05d7('0xa')](),controller[_0x05d7('0x13')]);router[_0x05d7('0x14')](_0x05d7('0x15'),auth[_0x05d7('0xa')](),controller[_0x05d7('0x16')]);router[_0x05d7('0x17')](_0x05d7('0x15'),auth[_0x05d7('0xa')](),controller[_0x05d7('0x18')]);module[_0x05d7('0x19')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 0185148..e8278b0 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 _0x18cb=['username','remoteUri','sequelize','STRING'];(function(_0xe0648e,_0x5845f9){var _0x232e53=function(_0x1da32f){while(--_0x1da32f){_0xe0648e['push'](_0xe0648e['shift']());}};_0x232e53(++_0x5845f9);}(_0x18cb,0x176));var _0xb18c=function(_0x16d270,_0x324fdf){_0x16d270=_0x16d270-0x0;var _0x5867f7=_0x18cb[_0x16d270];return _0x5867f7;};'use strict';var Sequelize=require(_0xb18c('0x0'));module['exports']={'name':{'type':Sequelize[_0xb18c('0x1')]},'description':{'type':Sequelize[_0xb18c('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xb18c('0x2')},'password':{'type':Sequelize[_0xb18c('0x1')]},'email':{'type':Sequelize[_0xb18c('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xb18c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x7ee1=['exports','STRING','remoteUri'];(function(_0x4eaf2e,_0x447127){var _0x500d01=function(_0x5aa873){while(--_0x5aa873){_0x4eaf2e['push'](_0x4eaf2e['shift']());}};_0x500d01(++_0x447127);}(_0x7ee1,0xc6));var _0x17ee=function(_0x26bea7,_0x43db9d){_0x26bea7=_0x26bea7-0x0;var _0x17ebae=_0x7ee1[_0x26bea7];return _0x17ebae;};'use strict';var Sequelize=require('sequelize');module[_0x17ee('0x0')]={'name':{'type':Sequelize[_0x17ee('0x1')]},'description':{'type':Sequelize[_0x17ee('0x1')]},'username':{'type':Sequelize[_0x17ee('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x17ee('0x1')]},'email':{'type':Sequelize[_0x17ee('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x17ee('0x2')},'serverUrl':{'type':Sequelize[_0x17ee('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index a8d4e5c..da684b4 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 _0x6394=['name','send','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ServicenowAccount','findAll','catch','show','params','keys','rawAttributes','find','create','body','update','getConfigurations','findOne','ServicenowConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','rfc','time_worked','expected_start','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','reassignment_count','assigned_to','sla_due','approval','comments_and_work_notes','sys_mod_count','sys_tags','upon_approval','correlation_id','username','password','email','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','label','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','push','all','concat','test','Wrong\x20credentials','statusCode','boolean','True','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','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','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','reject','destroy','then','error'];(function(_0x552545,_0x4be12d){var _0x348df0=function(_0x2ed185){while(--_0x2ed185){_0x552545['push'](_0x552545['shift']());}};_0x348df0(++_0x4be12d);}(_0x6394,0x92));var _0x4639=function(_0x43078f,_0x52b0e7){_0x43078f=_0x43078f-0x0;var _0x2d7413=_0x6394[_0x43078f];return _0x2d7413;};'use strict';var emlformat=require(_0x4639('0x0'));var rimraf=require(_0x4639('0x1'));var zipdir=require(_0x4639('0x2'));var jsonpatch=require(_0x4639('0x3'));var rp=require(_0x4639('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4639('0x5'));var util=require(_0x4639('0x6'));var path=require(_0x4639('0x7'));var sox=require(_0x4639('0x8'));var csv=require(_0x4639('0x9'));var ejs=require(_0x4639('0xa'));var fs=require('fs');var fs_extra=require(_0x4639('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4639('0xc'));var jsforce=require(_0x4639('0xd'));var deskjs=require(_0x4639('0xe'));var toCsv=require(_0x4639('0x9'));var querystring=require(_0x4639('0xf'));var Papa=require(_0x4639('0x10'));var Redis=require(_0x4639('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4639('0x12'));var as=require(_0x4639('0x13'));var hardwareService=require(_0x4639('0x14'));var logger=require(_0x4639('0x15'))(_0x4639('0x16'));var utils=require(_0x4639('0x17'));var config=require(_0x4639('0x18'));var licenseUtil=require(_0x4639('0x19'));var db=require(_0x4639('0x1a'))['db'];var integrations=require(_0x4639('0x1b'));function respondWithStatusCode(_0x3207d0,_0x16bb70){_0x16bb70=_0x16bb70||0xcc;return function(_0x53dc8d){if(_0x53dc8d){return _0x3207d0[_0x4639('0x1c')](_0x16bb70);}return _0x3207d0['status'](_0x16bb70)[_0x4639('0x1d')]();};}function respondWithResult(_0x1341d3,_0x493d68){_0x493d68=_0x493d68||0xc8;return function(_0x28e716){if(_0x28e716){return _0x1341d3[_0x4639('0x1e')](_0x493d68)['json'](_0x28e716);}};}function respondWithFilteredResult(_0x1abeae,_0x521a06){return function(_0x1a2f0c){if(_0x1a2f0c){var _0x502aa4=typeof _0x521a06[_0x4639('0x1f')]===_0x4639('0x20')&&typeof _0x521a06['limit']==='undefined';var _0x4a2bcc=_0x1a2f0c['count'];var _0x5d70ab=_0x502aa4?0x0:_0x521a06[_0x4639('0x1f')];var _0x579b2e=_0x502aa4?_0x1a2f0c[_0x4639('0x21')]:_0x521a06[_0x4639('0x1f')]+_0x521a06['limit'];var _0x3e552c;if(_0x579b2e>=_0x4a2bcc){_0x579b2e=_0x4a2bcc;_0x3e552c=0xc8;}else{_0x3e552c=0xce;}_0x1abeae['status'](_0x3e552c);return _0x1abeae[_0x4639('0x22')](_0x4639('0x23'),_0x5d70ab+'-'+_0x579b2e+'/'+_0x4a2bcc)[_0x4639('0x24')](_0x1a2f0c);}return null;};}function patchUpdates(_0x3c911e){return function(_0x817769){try{jsonpatch['apply'](_0x817769,_0x3c911e,!![]);}catch(_0x1d672f){return BPromise[_0x4639('0x25')](_0x1d672f);}return _0x817769['save']();};}function saveUpdates(_0x295003,_0xd314b6){return function(_0x2f8ec7){if(_0x2f8ec7){return _0x2f8ec7['update'](_0x295003)['then'](function(_0x310d25){return _0x310d25;});}return null;};}function removeEntity(_0x169be8,_0x5a8b81){return function(_0x33b558){if(_0x33b558){return _0x33b558[_0x4639('0x26')]()[_0x4639('0x27')](function(){_0x169be8[_0x4639('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xeeed41,_0x45b480){return function(_0x23b77e){if(!_0x23b77e){_0xeeed41[_0x4639('0x1c')](0x194);}return _0x23b77e;};}function handleError(_0x35fbc7,_0x48104f){_0x48104f=_0x48104f||0x1f4;return function(_0x4b556d){logger[_0x4639('0x28')](_0x4b556d['stack']);if(_0x4b556d[_0x4639('0x29')]){delete _0x4b556d[_0x4639('0x29')];}_0x35fbc7[_0x4639('0x1e')](_0x48104f)[_0x4639('0x2a')](_0x4b556d);};}exports['index']=function(_0x363790,_0x1879c2){var _0x8516f5={},_0x31dd57={},_0x515b0d={'count':0x0,'rows':[]};var _0x5418eb=_[_0x4639('0x2b')](db['ServicenowAccount']['rawAttributes'],function(_0x1b4f28){return{'name':_0x1b4f28[_0x4639('0x2c')],'type':_0x1b4f28[_0x4639('0x2d')][_0x4639('0x2e')]};});_0x31dd57[_0x4639('0x2f')]=_['map'](_0x5418eb,_0x4639('0x29'));_0x31dd57[_0x4639('0x30')]=_['keys'](_0x363790[_0x4639('0x30')]);_0x31dd57[_0x4639('0x31')]=_[_0x4639('0x32')](_0x31dd57['model'],_0x31dd57[_0x4639('0x30')]);_0x8516f5['attributes']=_[_0x4639('0x32')](_0x31dd57[_0x4639('0x2f')],qs['fields'](_0x363790[_0x4639('0x30')][_0x4639('0x33')]));_0x8516f5[_0x4639('0x34')]=_0x8516f5[_0x4639('0x34')][_0x4639('0x35')]?_0x8516f5[_0x4639('0x34')]:_0x31dd57[_0x4639('0x2f')];if(!_0x363790[_0x4639('0x30')][_0x4639('0x36')](_0x4639('0x37'))){_0x8516f5[_0x4639('0x38')]=qs[_0x4639('0x38')](_0x363790[_0x4639('0x30')][_0x4639('0x38')]);_0x8516f5[_0x4639('0x1f')]=qs[_0x4639('0x1f')](_0x363790['query'][_0x4639('0x1f')]);}_0x8516f5[_0x4639('0x39')]=qs['sort'](_0x363790['query'][_0x4639('0x3a')]);_0x8516f5[_0x4639('0x3b')]=qs['filters'](_[_0x4639('0x3c')](_0x363790[_0x4639('0x30')],_0x31dd57[_0x4639('0x31')]),_0x5418eb);if(_0x363790['query'][_0x4639('0x3d')]){_0x8516f5['where']=_[_0x4639('0x3e')](_0x8516f5[_0x4639('0x3b')],{'$or':_['map'](_0x5418eb,function(_0x3df52e){if(_0x3df52e[_0x4639('0x2d')]!==_0x4639('0x3f')){var _0x2d9d60={};_0x2d9d60[_0x3df52e[_0x4639('0x29')]]={'$like':'%'+_0x363790[_0x4639('0x30')][_0x4639('0x3d')]+'%'};return _0x2d9d60;}})});}_0x8516f5=_[_0x4639('0x3e')]({},_0x8516f5,_0x363790[_0x4639('0x40')]);var _0x407a91={'where':_0x8516f5['where']};return db['ServicenowAccount'][_0x4639('0x21')](_0x407a91)['then'](function(_0x476723){_0x515b0d[_0x4639('0x21')]=_0x476723;if(_0x363790['query'][_0x4639('0x41')]){_0x8516f5[_0x4639('0x42')]=[{'all':!![]}];}return db[_0x4639('0x43')][_0x4639('0x44')](_0x8516f5);})[_0x4639('0x27')](function(_0x47e22a){_0x515b0d['rows']=_0x47e22a;return _0x515b0d;})[_0x4639('0x27')](respondWithFilteredResult(_0x1879c2,_0x8516f5))[_0x4639('0x45')](handleError(_0x1879c2,null));};exports[_0x4639('0x46')]=function(_0x390e7c,_0x5f2da7){var _0x2b39dc={'raw':![],'where':{'id':_0x390e7c[_0x4639('0x47')]['id']}},_0x2fce09={};_0x2fce09['model']=_[_0x4639('0x48')](db[_0x4639('0x43')][_0x4639('0x49')]);_0x2fce09[_0x4639('0x30')]=_[_0x4639('0x48')](_0x390e7c[_0x4639('0x30')]);_0x2fce09[_0x4639('0x31')]=_[_0x4639('0x32')](_0x2fce09[_0x4639('0x2f')],_0x2fce09['query']);_0x2b39dc[_0x4639('0x34')]=_[_0x4639('0x32')](_0x2fce09[_0x4639('0x2f')],qs[_0x4639('0x33')](_0x390e7c[_0x4639('0x30')]['fields']));_0x2b39dc[_0x4639('0x34')]=_0x2b39dc['attributes'][_0x4639('0x35')]?_0x2b39dc[_0x4639('0x34')]:_0x2fce09[_0x4639('0x2f')];if(_0x390e7c[_0x4639('0x30')]['includeAll']){_0x2b39dc[_0x4639('0x42')]=[{'all':!![]}];}_0x2b39dc=_[_0x4639('0x3e')]({},_0x2b39dc,_0x390e7c['options']);return db[_0x4639('0x43')][_0x4639('0x4a')](_0x2b39dc)[_0x4639('0x27')](handleEntityNotFound(_0x5f2da7,null))['then'](respondWithResult(_0x5f2da7,null))[_0x4639('0x45')](handleError(_0x5f2da7,null));};exports[_0x4639('0x4b')]=function(_0x120b3a,_0x506eaa){return db['ServicenowAccount'][_0x4639('0x4b')](_0x120b3a[_0x4639('0x4c')],{})[_0x4639('0x27')](respondWithResult(_0x506eaa,0xc9))[_0x4639('0x45')](handleError(_0x506eaa,null));};exports[_0x4639('0x4d')]=function(_0x2dba6a,_0x1b0b1a){if(_0x2dba6a[_0x4639('0x4c')]['id']){delete _0x2dba6a[_0x4639('0x4c')]['id'];}return db[_0x4639('0x43')]['find']({'where':{'id':_0x2dba6a[_0x4639('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b0b1a,null))[_0x4639('0x27')](saveUpdates(_0x2dba6a[_0x4639('0x4c')],null))[_0x4639('0x27')](respondWithResult(_0x1b0b1a,null))[_0x4639('0x45')](handleError(_0x1b0b1a,null));};exports[_0x4639('0x26')]=function(_0x183c3b,_0x35cec7){return db[_0x4639('0x43')][_0x4639('0x4a')]({'where':{'id':_0x183c3b[_0x4639('0x47')]['id']}})[_0x4639('0x27')](handleEntityNotFound(_0x35cec7,null))['then'](removeEntity(_0x35cec7,null))[_0x4639('0x45')](handleError(_0x35cec7,null));};exports[_0x4639('0x4e')]=function(_0x51cd37,_0x168f31,_0x19ae24){var _0x2762be={};var _0x3bea99={};var _0x4592c0;var _0x5eaf5f;return db[_0x4639('0x43')][_0x4639('0x4f')]({'where':{'id':_0x51cd37[_0x4639('0x47')]['id']}})[_0x4639('0x27')](handleEntityNotFound(_0x168f31,null))[_0x4639('0x27')](function(_0x3c754f){if(_0x3c754f){_0x4592c0=_0x3c754f;_0x3bea99['model']=_[_0x4639('0x48')](db[_0x4639('0x50')][_0x4639('0x49')]);_0x3bea99[_0x4639('0x30')]=_['keys'](_0x51cd37[_0x4639('0x30')]);_0x3bea99[_0x4639('0x31')]=_[_0x4639('0x32')](_0x3bea99[_0x4639('0x2f')],_0x3bea99[_0x4639('0x30')]);_0x2762be[_0x4639('0x34')]=_[_0x4639('0x32')](_0x3bea99['model'],qs[_0x4639('0x33')](_0x51cd37[_0x4639('0x30')][_0x4639('0x33')]));_0x2762be[_0x4639('0x34')]=_0x2762be['attributes'][_0x4639('0x35')]?_0x2762be['attributes']:_0x3bea99[_0x4639('0x2f')];_0x2762be['order']=qs[_0x4639('0x3a')](_0x51cd37[_0x4639('0x30')][_0x4639('0x3a')]);_0x2762be['where']=qs[_0x4639('0x31')](_[_0x4639('0x3c')](_0x51cd37[_0x4639('0x30')],_0x3bea99[_0x4639('0x31')]));if(_0x51cd37[_0x4639('0x30')][_0x4639('0x3d')]){_0x2762be['where']=_[_0x4639('0x3e')](_0x2762be[_0x4639('0x3b')],{'$or':_[_0x4639('0x2b')](_0x2762be[_0x4639('0x34')],function(_0x2a5e56){var _0x1df443={};_0x1df443[_0x2a5e56]={'$like':'%'+_0x51cd37[_0x4639('0x30')][_0x4639('0x3d')]+'%'};return _0x1df443;})});}_0x2762be=_[_0x4639('0x3e')]({},_0x2762be,_0x51cd37['options']);return _0x4592c0[_0x4639('0x4e')](_0x2762be);}})['then'](function(_0x4b9ea9){if(_0x4b9ea9){_0x5eaf5f=_0x4b9ea9[_0x4639('0x35')];if(!_0x51cd37[_0x4639('0x30')][_0x4639('0x36')](_0x4639('0x37'))){_0x2762be[_0x4639('0x38')]=qs[_0x4639('0x38')](_0x51cd37[_0x4639('0x30')][_0x4639('0x38')]);_0x2762be[_0x4639('0x1f')]=qs[_0x4639('0x1f')](_0x51cd37[_0x4639('0x30')][_0x4639('0x1f')]);}return _0x4592c0[_0x4639('0x4e')](_0x2762be);}})[_0x4639('0x27')](function(_0xad03b3){if(_0xad03b3){return _0xad03b3?{'count':_0x5eaf5f,'rows':_0xad03b3}:null;}})[_0x4639('0x27')](respondWithResult(_0x168f31,null))[_0x4639('0x45')](handleError(_0x168f31,null));};exports['addConfiguration']=function(_0x3995be,_0x5e1a19,_0x35401d){if(_0x3995be[_0x4639('0x4c')]['id']){delete _0x3995be['body']['id'];}return db[_0x4639('0x43')][_0x4639('0x4f')]({'where':{'id':_0x3995be[_0x4639('0x47')]['id']}})[_0x4639('0x27')](handleEntityNotFound(_0x5e1a19,null))[_0x4639('0x27')](function(_0x22fcd0){if(_0x22fcd0){_0x3995be['body'][_0x4639('0x51')]=_0x22fcd0['id'];_0x3995be[_0x4639('0x4c')][_0x4639('0x52')]=integrations[_0x4639('0x53')](_0x3995be[_0x4639('0x4c')][_0x4639('0x54')],_0x3995be[_0x4639('0x4c')][_0x4639('0x2d')]);_0x3995be[_0x4639('0x4c')][_0x4639('0x55')]=integrations[_0x4639('0x56')](_0x3995be[_0x4639('0x4c')][_0x4639('0x54')],_0x3995be[_0x4639('0x4c')][_0x4639('0x2d')]);return db[_0x4639('0x50')]['create'](_0x3995be[_0x4639('0x4c')],{'include':[{'model':db[_0x4639('0x57')],'as':_0x4639('0x52')},{'model':db[_0x4639('0x57')],'as':'Descriptions'}]});}return null;})[_0x4639('0x27')](respondWithResult(_0x5e1a19,null))['catch'](handleError(_0x5e1a19,null));};exports['getFields']=function(_0x855072,_0xafab9e,_0x23d1d8){var _0x275d1f=[_0x4639('0x58'),_0x4639('0x59'),_0x4639('0x5a'),_0x4639('0x5b'),'close_code',_0x4639('0x5c'),_0x4639('0x5d'),_0x4639('0x5e'),_0x4639('0x5f')];var _0x16cc7c=['parent',_0x4639('0x58'),_0x4639('0x60'),_0x4639('0x61'),_0x4639('0x62'),_0x4639('0x63'),_0x4639('0x64'),_0x4639('0x59'),_0x4639('0x65'),'number',_0x4639('0x66'),_0x4639('0x67'),'opened_by',_0x4639('0x68'),_0x4639('0x69'),_0x4639('0x6a'),'state',_0x4639('0x6b'),'knowledge',_0x4639('0x39'),_0x4639('0x6c'),_0x4639('0x6d'),_0x4639('0x6e'),_0x4639('0x6f'),_0x4639('0x70'),_0x4639('0x71'),_0x4639('0x72'),_0x4639('0x73'),_0x4639('0x74'),'sys_domain_path',_0x4639('0x75'),_0x4639('0x76'),_0x4639('0x77'),'opened_at',_0x4639('0x78'),_0x4639('0x79'),'work_end',_0x4639('0x7a'),_0x4639('0x7b'),_0x4639('0x7c'),_0x4639('0x7d'),_0x4639('0x5b'),_0x4639('0x7e'),_0x4639('0x7f'),_0x4639('0x80'),_0x4639('0x81'),_0x4639('0x82'),_0x4639('0x83'),_0x4639('0x84'),_0x4639('0x85'),_0x4639('0x86'),_0x4639('0x87'),'calendar_duration','notify',_0x4639('0x88'),_0x4639('0x89'),_0x4639('0x8a'),_0x4639('0x8b'),_0x4639('0x8c'),_0x4639('0x8d'),_0x4639('0x8e'),'reopened_by',_0x4639('0x5d'),_0x4639('0x8f'),_0x4639('0x90'),'company',_0x4639('0x91'),'activity_due',_0x4639('0x92'),_0x4639('0x5e'),'comments',_0x4639('0x93'),_0x4639('0x94'),_0x4639('0x95'),'due_date',_0x4639('0x96'),'reopen_count',_0x4639('0x97'),'escalation',_0x4639('0x98'),_0x4639('0x99'),'location',_0x4639('0x5f')];var _0x5952f5='';var _0x59d503='';var _0x1d806e=[];var _0x4aae70='';var _0x36a72b='';var _0xb5e277=[];var _0x934aea='';var _0x1f5a68='';var _0x273fa2={};var _0x16ba2f='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x855072[_0x4639('0x47')]['id']},'attributes':['id',_0x4639('0x9a'),_0x4639('0x9b'),_0x4639('0x9c'),'remoteUri',_0x4639('0x9d')]})[_0x4639('0x27')](handleEntityNotFound(_0xafab9e,null))[_0x4639('0x27')](function(_0x270c2e){if(_0x270c2e){_0x16ba2f=_0x270c2e['remoteUri'];var _0x571645=_0x16ba2f[_0x4639('0x9e')](-0x1);if(_0x571645==='/'){_0x16ba2f=_0x16ba2f[_0x4639('0x9f')](0x0,_0x16ba2f[_0x4639('0xa0')](_0x571645));}_0x1f5a68=util[_0x4639('0xa1')]('%s/api/now/doc/table/schema/',_0x16ba2f);_0x934aea=util['format'](_0x4639('0xa2'),_0x16ba2f);_0x273fa2={'user':_0x270c2e[_0x4639('0x9a')],'pass':_0x270c2e[_0x4639('0x9b')]};var _0x1d59d2={'method':'GET','uri':_0x1f5a68+_0x4639('0xa3'),'auth':_0x273fa2,'json':!![]};return rp(_0x1d59d2);}})[_0x4639('0x27')](function(_0x50ae6b){if(_0x50ae6b['result'][_0x4639('0x35')]>0x0){_0x5952f5=_0x50ae6b[_0x4639('0xa4')];}console[_0x4639('0xa5')](_0x4639('0xa6'),_0x5952f5);_0xb5e277=[];_0x59d503=Object[_0x4639('0xa7')]([],_0x5952f5);_[_0x4639('0xa8')](_0x59d503,function(_0x5ce54e){return!_0x275d1f[_0x4639('0xa9')](_0x5ce54e[_0x4639('0x29')]);});_0x59d503[_0x4639('0xaa')](function(_0x83f289){var _0x432c79=createFieldObject(_0x934aea,_0x273fa2,_0x83f289['internalType'],_0x83f289['name'],_0x83f289[_0x4639('0xab')],![]);_0xb5e277['push'](_0x432c79);});return Promise['all'](_0xb5e277);})['then'](function(_0x4a2a96){_0x1d806e=_0x4a2a96;_0x4aae70=Object[_0x4639('0xa7')]([],_0x5952f5);console[_0x4639('0xa5')]('TCL:\x20_object',_0x5952f5);_[_0x4639('0xa8')](_0x4aae70,function(_0x35df80){return _0x16cc7c[_0x4639('0xa9')](_0x35df80[_0x4639('0x29')]);});console[_0x4639('0xa5')](_0x4639('0xac'),_0x4aae70);_0xb5e277=[];_0x4aae70[_0x4639('0xaa')](function(_0xe983b7){var _0x43c3ce=createFieldObject(_0x934aea,_0x273fa2,_0xe983b7[_0x4639('0xad')],_0xe983b7[_0x4639('0x29')],_0xe983b7[_0x4639('0xab')],!![]);_0xb5e277[_0x4639('0xae')](_0x43c3ce);});return Promise[_0x4639('0xaf')](_0xb5e277);})[_0x4639('0x27')](function(_0x5f5aac){_0x36a72b=_0x5f5aac;var _0x10b947=_0x1d806e[_0x4639('0xb0')](_0x36a72b);return{'count':_0x10b947['length'],'rows':_0x10b947};})[_0x4639('0x27')](respondWithResult(_0xafab9e,null))[_0x4639('0x45')](function(_0x5cd86b){console['log']('ServiceNow\x20error:\x20'+_0x5cd86b);var _0x45814f=_0x855072['query'][_0x4639('0xb1')]?0x1f4:_0x5cd86b['statusCode']||0x1f4;logger['error'](_0x5cd86b['stack']);delete _0x5cd86b['name'];if(_0x45814f===0x191){_0x45814f=0x190;}_0xafab9e['status'](_0x45814f)['send'](_0x855072['query'][_0x4639('0xb1')]?{'message':_0x4639('0xb2'),'statusCode':_0x5cd86b[_0x4639('0xb3')]}:_0x5cd86b);});};function createFieldObject(_0xa5e959,_0x3bdd99,_0x3b5679,_0xa73b05,_0x2854b0,_0x211909){return new Promise(function(_0x49ecf0,_0x4a6a0f){var _0x3335fd={'id':_0xa73b05,'name':_0x2854b0,'custom':_0x211909};if(_0x3b5679===_0x4639('0xb4')){_0x3335fd[_0x4639('0x40')]=[{'name':_0x4639('0xb5'),'value':'true'},{'name':_0x4639('0xb6'),'value':_0x4639('0xb7')}];_0x49ecf0(_0x3335fd);}else{var _0x5cbeca={'method':_0x4639('0xb8'),'uri':_0xa5e959+_0x4639('0xb9')+_0xa73b05,'auth':_0x3bdd99,'json':!![]};return rp(_0x5cbeca)['then'](function(_0x8f1c46){var _0x31e3b9=[];if(_0x8f1c46['result'][_0x4639('0x35')]>0x0){_0x8f1c46[_0x4639('0xa4')]['forEach'](function(_0x57cb3b){if(_0x57cb3b[_0x4639('0xba')]===_0x4639('0xb7')){var _0x32c488={'name':_0x57cb3b[_0x4639('0xab')],'value':_0x57cb3b['value']};_0x31e3b9[_0x4639('0xae')](_0x32c488);}});}_0x3335fd[_0x4639('0x40')]=_0x31e3b9;if(_0x3335fd[_0x4639('0x40')][_0x4639('0x35')]>0x0){_0x49ecf0(_0x3335fd);}else{if(_0x211909==![]){_0x49ecf0();}else{_0x49ecf0(_0x3335fd);}}});}});} \ No newline at end of file +var _0xbd6d=['ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','count','offset','limit','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','index','map','ServicenowAccount','fieldName','type','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','VIRTUAL','filter','merge','options','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','update','getConfigurations','ServicenowConfiguration','order','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','getFields','made_sla','subcategory','notify','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','impact','active','work_notes_list','business_service','priority','rfc','time_worked','opened_at','business_duration','group_list','work_end','resolved_at','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','findOne','username','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','statusCode','send','Wrong\x20credentials','boolean','True','true','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x540ef9,_0x476a53){var _0x6ba76e=function(_0x43ceea){while(--_0x43ceea){_0x540ef9['push'](_0x540ef9['shift']());}};_0x6ba76e(++_0x476a53);}(_0xbd6d,0xb6));var _0xdbd6=function(_0x2e11c2,_0x2536f9){_0x2e11c2=_0x2e11c2-0x0;var _0x5abef7=_0xbd6d[_0x2e11c2];return _0x5abef7;};'use strict';var emlformat=require(_0xdbd6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdbd6('0x1'));var jsonpatch=require(_0xdbd6('0x2'));var rp=require(_0xdbd6('0x3'));var moment=require(_0xdbd6('0x4'));var BPromise=require(_0xdbd6('0x5'));var Mustache=require(_0xdbd6('0x6'));var util=require(_0xdbd6('0x7'));var path=require(_0xdbd6('0x8'));var sox=require(_0xdbd6('0x9'));var csv=require('to-csv');var ejs=require(_0xdbd6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdbd6('0xb'));var squel=require(_0xdbd6('0xc'));var crypto=require(_0xdbd6('0xd'));var jsforce=require(_0xdbd6('0xe'));var deskjs=require(_0xdbd6('0xf'));var toCsv=require(_0xdbd6('0x10'));var querystring=require(_0xdbd6('0x11'));var Papa=require(_0xdbd6('0x12'));var Redis=require(_0xdbd6('0x13'));var authService=require(_0xdbd6('0x14'));var qs=require(_0xdbd6('0x15'));var as=require(_0xdbd6('0x16'));var hardwareService=require(_0xdbd6('0x17'));var logger=require(_0xdbd6('0x18'))('api');var utils=require(_0xdbd6('0x19'));var config=require(_0xdbd6('0x1a'));var licenseUtil=require(_0xdbd6('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x25f2c7,_0x4b1be2){_0x4b1be2=_0x4b1be2||0xcc;return function(_0x13b733){if(_0x13b733){return _0x25f2c7[_0xdbd6('0x1c')](_0x4b1be2);}return _0x25f2c7['status'](_0x4b1be2)['end']();};}function respondWithResult(_0x5b89dc,_0x247926){_0x247926=_0x247926||0xc8;return function(_0x3c138c){if(_0x3c138c){return _0x5b89dc[_0xdbd6('0x1d')](_0x247926)['json'](_0x3c138c);}};}function respondWithFilteredResult(_0x38b0e1,_0x38c183){return function(_0x39c036){if(_0x39c036){var _0xcfb236=typeof _0x38c183['offset']===_0xdbd6('0x1e')&&typeof _0x38c183['limit']===_0xdbd6('0x1e');var _0x32d944=_0x39c036[_0xdbd6('0x1f')];var _0x5520cf=_0xcfb236?0x0:_0x38c183['offset'];var _0x123e27=_0xcfb236?_0x39c036[_0xdbd6('0x1f')]:_0x38c183[_0xdbd6('0x20')]+_0x38c183[_0xdbd6('0x21')];var _0x5127ba;if(_0x123e27>=_0x32d944){_0x123e27=_0x32d944;_0x5127ba=0xc8;}else{_0x5127ba=0xce;}_0x38b0e1[_0xdbd6('0x1d')](_0x5127ba);return _0x38b0e1['set'](_0xdbd6('0x22'),_0x5520cf+'-'+_0x123e27+'/'+_0x32d944)['json'](_0x39c036);}return null;};}function patchUpdates(_0x57db97){return function(_0x1de176){try{jsonpatch[_0xdbd6('0x23')](_0x1de176,_0x57db97,!![]);}catch(_0x4b592d){return BPromise[_0xdbd6('0x24')](_0x4b592d);}return _0x1de176[_0xdbd6('0x25')]();};}function saveUpdates(_0x29a63c,_0x2513ca){return function(_0x1711bf){if(_0x1711bf){return _0x1711bf['update'](_0x29a63c)['then'](function(_0x7f31b1){return _0x7f31b1;});}return null;};}function removeEntity(_0x15076e,_0x2b0392){return function(_0x75029c){if(_0x75029c){return _0x75029c[_0xdbd6('0x26')]()[_0xdbd6('0x27')](function(){_0x15076e[_0xdbd6('0x1d')](0xcc)[_0xdbd6('0x28')]();});}};}function handleEntityNotFound(_0x39482c,_0x3f4935){return function(_0x4c8922){if(!_0x4c8922){_0x39482c[_0xdbd6('0x1c')](0x194);}return _0x4c8922;};}function handleError(_0xa6f7f3,_0xca90ce){_0xca90ce=_0xca90ce||0x1f4;return function(_0x3a37ee){logger[_0xdbd6('0x29')](_0x3a37ee[_0xdbd6('0x2a')]);if(_0x3a37ee[_0xdbd6('0x2b')]){delete _0x3a37ee['name'];}_0xa6f7f3[_0xdbd6('0x1d')](_0xca90ce)['send'](_0x3a37ee);};}exports[_0xdbd6('0x2c')]=function(_0x2d5787,_0x2ff50f){var _0x170847={},_0xc3f72c={},_0x1f0baa={'count':0x0,'rows':[]};var _0x2c6796=_[_0xdbd6('0x2d')](db[_0xdbd6('0x2e')]['rawAttributes'],function(_0x34aee1){return{'name':_0x34aee1[_0xdbd6('0x2f')],'type':_0x34aee1[_0xdbd6('0x30')][_0xdbd6('0x31')]};});_0xc3f72c[_0xdbd6('0x32')]=_['map'](_0x2c6796,'name');_0xc3f72c['query']=_['keys'](_0x2d5787['query']);_0xc3f72c['filters']=_[_0xdbd6('0x33')](_0xc3f72c[_0xdbd6('0x32')],_0xc3f72c[_0xdbd6('0x34')]);_0x170847[_0xdbd6('0x35')]=_[_0xdbd6('0x33')](_0xc3f72c[_0xdbd6('0x32')],qs[_0xdbd6('0x36')](_0x2d5787[_0xdbd6('0x34')][_0xdbd6('0x36')]));_0x170847[_0xdbd6('0x35')]=_0x170847[_0xdbd6('0x35')][_0xdbd6('0x37')]?_0x170847[_0xdbd6('0x35')]:_0xc3f72c[_0xdbd6('0x32')];if(!_0x2d5787['query'][_0xdbd6('0x38')](_0xdbd6('0x39'))){_0x170847[_0xdbd6('0x21')]=qs[_0xdbd6('0x21')](_0x2d5787[_0xdbd6('0x34')][_0xdbd6('0x21')]);_0x170847['offset']=qs[_0xdbd6('0x20')](_0x2d5787[_0xdbd6('0x34')]['offset']);}_0x170847['order']=qs[_0xdbd6('0x3a')](_0x2d5787[_0xdbd6('0x34')][_0xdbd6('0x3a')]);_0x170847[_0xdbd6('0x3b')]=qs['filters'](_[_0xdbd6('0x3c')](_0x2d5787[_0xdbd6('0x34')],_0xc3f72c[_0xdbd6('0x3d')]),_0x2c6796);if(_0x2d5787[_0xdbd6('0x34')]['filter']){_0x170847['where']=_['merge'](_0x170847[_0xdbd6('0x3b')],{'$or':_['map'](_0x2c6796,function(_0x2de4ce){if(_0x2de4ce[_0xdbd6('0x30')]!==_0xdbd6('0x3e')){var _0x5885d8={};_0x5885d8[_0x2de4ce[_0xdbd6('0x2b')]]={'$like':'%'+_0x2d5787['query'][_0xdbd6('0x3f')]+'%'};return _0x5885d8;}})});}_0x170847=_[_0xdbd6('0x40')]({},_0x170847,_0x2d5787[_0xdbd6('0x41')]);var _0x52396b={'where':_0x170847[_0xdbd6('0x3b')]};return db[_0xdbd6('0x2e')][_0xdbd6('0x1f')](_0x52396b)[_0xdbd6('0x27')](function(_0x4f4d42){_0x1f0baa['count']=_0x4f4d42;if(_0x2d5787[_0xdbd6('0x34')]['includeAll']){_0x170847[_0xdbd6('0x42')]=[{'all':!![]}];}return db[_0xdbd6('0x2e')][_0xdbd6('0x43')](_0x170847);})['then'](function(_0x5c38e1){_0x1f0baa['rows']=_0x5c38e1;return _0x1f0baa;})['then'](respondWithFilteredResult(_0x2ff50f,_0x170847))[_0xdbd6('0x44')](handleError(_0x2ff50f,null));};exports[_0xdbd6('0x45')]=function(_0x302da6,_0x4a98a9){var _0x4fe91b={'raw':![],'where':{'id':_0x302da6[_0xdbd6('0x46')]['id']}},_0x2819e0={};_0x2819e0['model']=_[_0xdbd6('0x47')](db[_0xdbd6('0x2e')][_0xdbd6('0x48')]);_0x2819e0[_0xdbd6('0x34')]=_['keys'](_0x302da6[_0xdbd6('0x34')]);_0x2819e0[_0xdbd6('0x3d')]=_[_0xdbd6('0x33')](_0x2819e0['model'],_0x2819e0[_0xdbd6('0x34')]);_0x4fe91b[_0xdbd6('0x35')]=_[_0xdbd6('0x33')](_0x2819e0[_0xdbd6('0x32')],qs[_0xdbd6('0x36')](_0x302da6[_0xdbd6('0x34')][_0xdbd6('0x36')]));_0x4fe91b['attributes']=_0x4fe91b[_0xdbd6('0x35')]['length']?_0x4fe91b[_0xdbd6('0x35')]:_0x2819e0[_0xdbd6('0x32')];if(_0x302da6['query']['includeAll']){_0x4fe91b[_0xdbd6('0x42')]=[{'all':!![]}];}_0x4fe91b=_[_0xdbd6('0x40')]({},_0x4fe91b,_0x302da6['options']);return db['ServicenowAccount'][_0xdbd6('0x49')](_0x4fe91b)['then'](handleEntityNotFound(_0x4a98a9,null))['then'](respondWithResult(_0x4a98a9,null))[_0xdbd6('0x44')](handleError(_0x4a98a9,null));};exports[_0xdbd6('0x4a')]=function(_0x477948,_0x3b046c){return db[_0xdbd6('0x2e')]['create'](_0x477948[_0xdbd6('0x4b')],{})['then'](respondWithResult(_0x3b046c,0xc9))['catch'](handleError(_0x3b046c,null));};exports[_0xdbd6('0x4c')]=function(_0x22915d,_0x359f81){if(_0x22915d['body']['id']){delete _0x22915d[_0xdbd6('0x4b')]['id'];}return db['ServicenowAccount'][_0xdbd6('0x49')]({'where':{'id':_0x22915d[_0xdbd6('0x46')]['id']}})[_0xdbd6('0x27')](handleEntityNotFound(_0x359f81,null))['then'](saveUpdates(_0x22915d[_0xdbd6('0x4b')],null))['then'](respondWithResult(_0x359f81,null))[_0xdbd6('0x44')](handleError(_0x359f81,null));};exports[_0xdbd6('0x26')]=function(_0x537884,_0x26e86a){return db[_0xdbd6('0x2e')]['find']({'where':{'id':_0x537884[_0xdbd6('0x46')]['id']}})[_0xdbd6('0x27')](handleEntityNotFound(_0x26e86a,null))[_0xdbd6('0x27')](removeEntity(_0x26e86a,null))['catch'](handleError(_0x26e86a,null));};exports[_0xdbd6('0x4d')]=function(_0x5727cd,_0x2bffb8,_0x28b005){var _0x25f961={};var _0x47c261={};var _0x2c2b9a;var _0x4da4b9;return db[_0xdbd6('0x2e')]['findOne']({'where':{'id':_0x5727cd[_0xdbd6('0x46')]['id']}})['then'](handleEntityNotFound(_0x2bffb8,null))[_0xdbd6('0x27')](function(_0x229e6e){if(_0x229e6e){_0x2c2b9a=_0x229e6e;_0x47c261[_0xdbd6('0x32')]=_[_0xdbd6('0x47')](db[_0xdbd6('0x4e')][_0xdbd6('0x48')]);_0x47c261[_0xdbd6('0x34')]=_[_0xdbd6('0x47')](_0x5727cd[_0xdbd6('0x34')]);_0x47c261[_0xdbd6('0x3d')]=_[_0xdbd6('0x33')](_0x47c261[_0xdbd6('0x32')],_0x47c261['query']);_0x25f961['attributes']=_[_0xdbd6('0x33')](_0x47c261[_0xdbd6('0x32')],qs[_0xdbd6('0x36')](_0x5727cd[_0xdbd6('0x34')][_0xdbd6('0x36')]));_0x25f961['attributes']=_0x25f961[_0xdbd6('0x35')][_0xdbd6('0x37')]?_0x25f961[_0xdbd6('0x35')]:_0x47c261['model'];_0x25f961[_0xdbd6('0x4f')]=qs[_0xdbd6('0x3a')](_0x5727cd[_0xdbd6('0x34')][_0xdbd6('0x3a')]);_0x25f961[_0xdbd6('0x3b')]=qs[_0xdbd6('0x3d')](_[_0xdbd6('0x3c')](_0x5727cd[_0xdbd6('0x34')],_0x47c261[_0xdbd6('0x3d')]));if(_0x5727cd[_0xdbd6('0x34')][_0xdbd6('0x3f')]){_0x25f961[_0xdbd6('0x3b')]=_[_0xdbd6('0x40')](_0x25f961[_0xdbd6('0x3b')],{'$or':_[_0xdbd6('0x2d')](_0x25f961[_0xdbd6('0x35')],function(_0x5a1c64){var _0x5ac13c={};_0x5ac13c[_0x5a1c64]={'$like':'%'+_0x5727cd[_0xdbd6('0x34')][_0xdbd6('0x3f')]+'%'};return _0x5ac13c;})});}_0x25f961=_[_0xdbd6('0x40')]({},_0x25f961,_0x5727cd[_0xdbd6('0x41')]);return _0x2c2b9a[_0xdbd6('0x4d')](_0x25f961);}})[_0xdbd6('0x27')](function(_0x1a7282){if(_0x1a7282){_0x4da4b9=_0x1a7282[_0xdbd6('0x37')];if(!_0x5727cd[_0xdbd6('0x34')][_0xdbd6('0x38')](_0xdbd6('0x39'))){_0x25f961[_0xdbd6('0x21')]=qs[_0xdbd6('0x21')](_0x5727cd[_0xdbd6('0x34')][_0xdbd6('0x21')]);_0x25f961[_0xdbd6('0x20')]=qs['offset'](_0x5727cd[_0xdbd6('0x34')][_0xdbd6('0x20')]);}return _0x2c2b9a[_0xdbd6('0x4d')](_0x25f961);}})[_0xdbd6('0x27')](function(_0x123732){if(_0x123732){return _0x123732?{'count':_0x4da4b9,'rows':_0x123732}:null;}})['then'](respondWithResult(_0x2bffb8,null))[_0xdbd6('0x44')](handleError(_0x2bffb8,null));};exports[_0xdbd6('0x50')]=function(_0x36fd49,_0x5caec1,_0x177564){if(_0x36fd49[_0xdbd6('0x4b')]['id']){delete _0x36fd49[_0xdbd6('0x4b')]['id'];}return db[_0xdbd6('0x2e')]['findOne']({'where':{'id':_0x36fd49[_0xdbd6('0x46')]['id']}})['then'](handleEntityNotFound(_0x5caec1,null))[_0xdbd6('0x27')](function(_0x4fe1df){if(_0x4fe1df){_0x36fd49[_0xdbd6('0x4b')][_0xdbd6('0x51')]=_0x4fe1df['id'];_0x36fd49[_0xdbd6('0x4b')][_0xdbd6('0x52')]=integrations['getSubjects'](_0x36fd49['body']['channel'],_0x36fd49[_0xdbd6('0x4b')][_0xdbd6('0x30')]);_0x36fd49[_0xdbd6('0x4b')][_0xdbd6('0x53')]=integrations[_0xdbd6('0x54')](_0x36fd49[_0xdbd6('0x4b')]['channel'],_0x36fd49[_0xdbd6('0x4b')][_0xdbd6('0x30')]);return db[_0xdbd6('0x4e')][_0xdbd6('0x4a')](_0x36fd49[_0xdbd6('0x4b')],{'include':[{'model':db['ServicenowField'],'as':_0xdbd6('0x52')},{'model':db['ServicenowField'],'as':_0xdbd6('0x53')}]});}return null;})[_0xdbd6('0x27')](respondWithResult(_0x5caec1,null))[_0xdbd6('0x44')](handleError(_0x5caec1,null));};exports[_0xdbd6('0x55')]=function(_0x22cc76,_0x35aa22,_0x582fbc){var _0x1ed978=[_0xdbd6('0x56'),'hold_reason','knowledge',_0xdbd6('0x57'),'close_code',_0xdbd6('0x58'),'incident_state',_0xdbd6('0x59'),_0xdbd6('0x5a')];var _0x3fc272=[_0xdbd6('0x5b'),_0xdbd6('0x56'),_0xdbd6('0x5c'),_0xdbd6('0x5d'),_0xdbd6('0x5e'),_0xdbd6('0x5f'),_0xdbd6('0x60'),_0xdbd6('0x61'),_0xdbd6('0x62'),_0xdbd6('0x63'),_0xdbd6('0x64'),_0xdbd6('0x65'),_0xdbd6('0x66'),'user_input','sys_created_on',_0xdbd6('0x67'),_0xdbd6('0x68'),_0xdbd6('0x69'),'knowledge',_0xdbd6('0x4f'),_0xdbd6('0x6a'),'closed_at',_0xdbd6('0x6b'),'delivery_plan',_0xdbd6('0x6c'),_0xdbd6('0x6d'),_0xdbd6('0x6e'),_0xdbd6('0x6f'),_0xdbd6('0x70'),'sys_domain_path',_0xdbd6('0x71'),_0xdbd6('0x72'),'expected_start',_0xdbd6('0x73'),_0xdbd6('0x74'),_0xdbd6('0x75'),_0xdbd6('0x76'),'reopened_time',_0xdbd6('0x77'),'caller_id',_0xdbd6('0x78'),_0xdbd6('0x57'),_0xdbd6('0x79'),_0xdbd6('0x7a'),_0xdbd6('0x7b'),_0xdbd6('0x7c'),_0xdbd6('0x7d'),_0xdbd6('0x7e'),_0xdbd6('0x7f'),_0xdbd6('0x80'),_0xdbd6('0x81'),_0xdbd6('0x82'),_0xdbd6('0x83'),'notify',_0xdbd6('0x84'),_0xdbd6('0x85'),_0xdbd6('0x86'),_0xdbd6('0x87'),_0xdbd6('0x88'),_0xdbd6('0x89'),_0xdbd6('0x8a'),_0xdbd6('0x8b'),'incident_state',_0xdbd6('0x8c'),_0xdbd6('0x8d'),_0xdbd6('0x8e'),'reassignment_count',_0xdbd6('0x8f'),_0xdbd6('0x90'),_0xdbd6('0x59'),_0xdbd6('0x91'),_0xdbd6('0x92'),_0xdbd6('0x93'),_0xdbd6('0x94'),_0xdbd6('0x95'),_0xdbd6('0x96'),_0xdbd6('0x97'),_0xdbd6('0x98'),'escalation',_0xdbd6('0x99'),_0xdbd6('0x9a'),_0xdbd6('0x9b'),_0xdbd6('0x5a')];var _0xb1d9de='';var _0x3a5f07='';var _0x5d31c1=[];var _0x32116e='';var _0x3ced96='';var _0x57e9d0=[];var _0x19fb10='';var _0x790d14='';var _0x2a09e8={};var _0x2833d4='';return db[_0xdbd6('0x2e')][_0xdbd6('0x9c')]({'where':{'id':_0x22cc76['params']['id']},'attributes':['id',_0xdbd6('0x9d'),_0xdbd6('0x9e'),_0xdbd6('0x9f'),_0xdbd6('0xa0'),_0xdbd6('0xa1')]})[_0xdbd6('0x27')](handleEntityNotFound(_0x35aa22,null))[_0xdbd6('0x27')](function(_0x496146){if(_0x496146){_0x2833d4=_0x496146['remoteUri'];var _0x1b8713=_0x2833d4[_0xdbd6('0xa2')](-0x1);if(_0x1b8713==='/'){_0x2833d4=_0x2833d4[_0xdbd6('0xa3')](0x0,_0x2833d4['lastIndexOf'](_0x1b8713));}_0x790d14=util[_0xdbd6('0xa4')](_0xdbd6('0xa5'),_0x2833d4);_0x19fb10=util[_0xdbd6('0xa4')](_0xdbd6('0xa6'),_0x2833d4);_0x2a09e8={'user':_0x496146[_0xdbd6('0x9d')],'pass':_0x496146[_0xdbd6('0x9e')]};var _0x4a394a={'method':_0xdbd6('0xa7'),'uri':_0x790d14+_0xdbd6('0xa8'),'auth':_0x2a09e8,'json':!![]};return rp(_0x4a394a);}})[_0xdbd6('0x27')](function(_0x13b647){if(_0x13b647[_0xdbd6('0xa9')][_0xdbd6('0x37')]>0x0){_0xb1d9de=_0x13b647[_0xdbd6('0xa9')];}console[_0xdbd6('0xaa')]('incident\x20table\x20objects',_0xb1d9de);_0x57e9d0=[];_0x3a5f07=Object[_0xdbd6('0xab')]([],_0xb1d9de);_[_0xdbd6('0xac')](_0x3a5f07,function(_0x5e66e5){return!_0x1ed978[_0xdbd6('0xad')](_0x5e66e5[_0xdbd6('0x2b')]);});_0x3a5f07[_0xdbd6('0xae')](function(_0x5a95ec){var _0x52261e=createFieldObject(_0x19fb10,_0x2a09e8,_0x5a95ec[_0xdbd6('0xaf')],_0x5a95ec['name'],_0x5a95ec[_0xdbd6('0xb0')],![]);_0x57e9d0[_0xdbd6('0xb1')](_0x52261e);});return Promise[_0xdbd6('0xb2')](_0x57e9d0);})[_0xdbd6('0x27')](function(_0x2df92b){_0x5d31c1=_0x2df92b;_0x32116e=Object[_0xdbd6('0xab')]([],_0xb1d9de);console[_0xdbd6('0xaa')](_0xdbd6('0xb3'),_0xb1d9de);_[_0xdbd6('0xac')](_0x32116e,function(_0x4b2fc2){return _0x3fc272[_0xdbd6('0xad')](_0x4b2fc2[_0xdbd6('0x2b')]);});console['log'](_0xdbd6('0xb4'),_0x32116e);_0x57e9d0=[];_0x32116e[_0xdbd6('0xae')](function(_0x216e5e){var _0x588dd3=createFieldObject(_0x19fb10,_0x2a09e8,_0x216e5e[_0xdbd6('0xaf')],_0x216e5e['name'],_0x216e5e[_0xdbd6('0xb0')],!![]);_0x57e9d0[_0xdbd6('0xb1')](_0x588dd3);});return Promise[_0xdbd6('0xb2')](_0x57e9d0);})[_0xdbd6('0x27')](function(_0x5ef2d5){_0x3ced96=_0x5ef2d5;var _0x3e04fb=_0x5d31c1[_0xdbd6('0xb5')](_0x3ced96);return{'count':_0x3e04fb[_0xdbd6('0x37')],'rows':_0x3e04fb};})['then'](respondWithResult(_0x35aa22,null))[_0xdbd6('0x44')](function(_0x2c601b){console['log']('ServiceNow\x20error:\x20'+_0x2c601b);var _0x43e96e=_0x22cc76[_0xdbd6('0x34')]['test']?0x1f4:_0x2c601b[_0xdbd6('0xb6')]||0x1f4;logger[_0xdbd6('0x29')](_0x2c601b[_0xdbd6('0x2a')]);delete _0x2c601b[_0xdbd6('0x2b')];if(_0x43e96e===0x191){_0x43e96e=0x190;}_0x35aa22[_0xdbd6('0x1d')](_0x43e96e)[_0xdbd6('0xb7')](_0x22cc76[_0xdbd6('0x34')]['test']?{'message':_0xdbd6('0xb8'),'statusCode':_0x2c601b[_0xdbd6('0xb6')]}:_0x2c601b);});};function createFieldObject(_0x21236a,_0x8490b7,_0x325c7f,_0x32e8a0,_0x1dc1df,_0x3c9ce6){return new Promise(function(_0x5a4b45,_0x5501d1){var _0x44d8c7={'id':_0x32e8a0,'name':_0x1dc1df,'custom':_0x3c9ce6};if(_0x325c7f===_0xdbd6('0xb9')){_0x44d8c7[_0xdbd6('0x41')]=[{'name':_0xdbd6('0xba'),'value':_0xdbd6('0xbb')},{'name':'False','value':_0xdbd6('0xbc')}];_0x5a4b45(_0x44d8c7);}else{var _0x33824a={'method':_0xdbd6('0xa7'),'uri':_0x21236a+_0xdbd6('0xbd')+_0x32e8a0,'auth':_0x8490b7,'json':!![]};return rp(_0x33824a)[_0xdbd6('0x27')](function(_0x215e48){var _0x2bd078=[];if(_0x215e48['result'][_0xdbd6('0x37')]>0x0){_0x215e48[_0xdbd6('0xa9')]['forEach'](function(_0x2d557e){if(_0x2d557e[_0xdbd6('0xbe')]===_0xdbd6('0xbc')){var _0x5e9b75={'name':_0x2d557e[_0xdbd6('0xb0')],'value':_0x2d557e[_0xdbd6('0xbf')]};_0x2bd078['push'](_0x5e9b75);}});}_0x44d8c7[_0xdbd6('0x41')]=_0x2bd078;if(_0x44d8c7[_0xdbd6('0x41')]['length']>0x0){_0x5a4b45(_0x44d8c7);}else{if(_0x3c9ce6==![]){_0x5a4b45();}else{_0x5a4b45(_0x44d8c7);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 3d2d738..e2f58d9 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 _0x31f0=['./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x186015,_0x1e657a){var _0x574358=function(_0x3bbad6){while(--_0x3bbad6){_0x186015['push'](_0x186015['shift']());}};_0x574358(++_0x1e657a);}(_0x31f0,0xb7));var _0x031f=function(_0x322e29,_0x5e86a2){_0x322e29=_0x322e29-0x0;var _0x17438f=_0x31f0[_0x322e29];return _0x17438f;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x56328c,_0x3dc98e){return _0x56328c['define'](_0x031f('0x8'),attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f47=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','int_servicenow_accounts','util'];(function(_0x531b1e,_0x301978){var _0x1208b6=function(_0x3af74a){while(--_0x3af74a){_0x531b1e['push'](_0x531b1e['shift']());}};_0x1208b6(++_0x301978);}(_0x6f47,0xc7));var _0x76f4=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x6f47[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var logger=require(_0x76f4('0x1'))('api');var moment=require(_0x76f4('0x2'));var BPromise=require('bluebird');var rp=require(_0x76f4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var attributes=require(_0x76f4('0x6'));var integrations=require(_0x76f4('0x7'));module['exports']=function(_0x35602f,_0xfc2405){return _0x35602f[_0x76f4('0x8')]('ServicenowAccount',attributes,{'tableName':_0x76f4('0x9'),'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 c5981f4..bcf6f3f 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 _0x2abd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','ServicenowAccount','options','raw','where','attributes','include','map','model','GetServicenowAccount','ShowServicenowAccount','then','lodash'];(function(_0x353e56,_0x58c4f7){var _0x391ba6=function(_0x59af57){while(--_0x59af57){_0x353e56['push'](_0x353e56['shift']());}};_0x391ba6(++_0x58c4f7);}(_0x2abd,0xcb));var _0xd2ab=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x2abd[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xd2ab('0x0'));var util=require(_0xd2ab('0x1'));var moment=require(_0xd2ab('0x2'));var BPromise=require(_0xd2ab('0x3'));var rs=require(_0xd2ab('0x4'));var fs=require('fs');var Redis=require(_0xd2ab('0x5'));var db=require(_0xd2ab('0x6'))['db'];var utils=require(_0xd2ab('0x7'));var logger=require('../../config/logger')(_0xd2ab('0x8'));var config=require('../../config/environment');var jayson=require(_0xd2ab('0x9'));var client=jayson[_0xd2ab('0xa')][_0xd2ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4475a5,_0x25a8e4,_0x1e2916){return new BPromise(function(_0x4fdce6,_0x357397){return client[_0xd2ab('0xc')](_0x4475a5,_0x1e2916)['then'](function(_0x74eb6c){logger[_0xd2ab('0xd')](_0xd2ab('0xe'),_0x25a8e4,_0xd2ab('0xf'));logger[_0xd2ab('0x10')](_0xd2ab('0x11'),_0x25a8e4,_0xd2ab('0xf'),JSON[_0xd2ab('0x12')](_0x74eb6c));if(_0x74eb6c['error']){if(_0x74eb6c['error'][_0xd2ab('0x13')]===0x1f4){logger[_0xd2ab('0x14')](_0xd2ab('0xe'),_0x25a8e4,_0x74eb6c['error'][_0xd2ab('0x15')]);return _0x357397(_0x74eb6c['error'][_0xd2ab('0x15')]);}logger[_0xd2ab('0x14')](_0xd2ab('0xe'),_0x25a8e4,_0x74eb6c[_0xd2ab('0x14')][_0xd2ab('0x15')]);return _0x4fdce6(_0x74eb6c[_0xd2ab('0x14')][_0xd2ab('0x15')]);}else{logger[_0xd2ab('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x25a8e4,_0xd2ab('0xf'));_0x4fdce6(_0x74eb6c['result'][_0xd2ab('0x15')]);}})[_0xd2ab('0x16')](function(_0x566b67){logger[_0xd2ab('0x14')](_0xd2ab('0xe'),_0x25a8e4,_0x566b67);_0x357397(_0x566b67);});});}exports['GetServicenowAccount']=function(_0x26575c){var _0x5253a6=this;return new Promise(function(_0x20704e,_0x3e00fc){return db[_0xd2ab('0x17')]['findAll']({'raw':_0x26575c[_0xd2ab('0x18')]?_0x26575c[_0xd2ab('0x18')][_0xd2ab('0x19')]===undefined?!![]:![]:!![],'where':_0x26575c[_0xd2ab('0x18')]?_0x26575c[_0xd2ab('0x18')][_0xd2ab('0x1a')]||null:null,'attributes':_0x26575c[_0xd2ab('0x18')]?_0x26575c[_0xd2ab('0x18')][_0xd2ab('0x1b')]||null:null,'limit':_0x26575c[_0xd2ab('0x18')]?_0x26575c['options']['limit']||null:null,'include':_0x26575c[_0xd2ab('0x18')]?_0x26575c[_0xd2ab('0x18')][_0xd2ab('0x1c')]?_[_0xd2ab('0x1d')](_0x26575c[_0xd2ab('0x18')][_0xd2ab('0x1c')],function(_0x2b9502){return{'model':db[_0x2b9502[_0xd2ab('0x1e')]],'as':_0x2b9502['as'],'attributes':_0x2b9502['attributes'],'include':_0x2b9502[_0xd2ab('0x1c')]?_[_0xd2ab('0x1d')](_0x2b9502['include'],function(_0xeb56f){return{'model':db[_0xeb56f['model']],'as':_0xeb56f['as'],'attributes':_0xeb56f[_0xd2ab('0x1b')],'include':_0xeb56f[_0xd2ab('0x1c')]?_['map'](_0xeb56f[_0xd2ab('0x1c')],function(_0x1074d2){return{'model':db[_0x1074d2[_0xd2ab('0x1e')]],'as':_0x1074d2['as'],'attributes':_0x1074d2[_0xd2ab('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37b1a8){logger[_0xd2ab('0xd')](_0xd2ab('0x1f'),_0x26575c);logger['debug']('GetServicenowAccount',_0x26575c,JSON[_0xd2ab('0x12')](_0x37b1a8));_0x20704e(_0x37b1a8);})[_0xd2ab('0x16')](function(_0x2fc1f1){logger['error'](_0xd2ab('0x1f'),_0x2fc1f1['message'],_0x26575c);_0x3e00fc(_0x5253a6['error'](0x1f4,_0x2fc1f1[_0xd2ab('0x15')]));});});};exports[_0xd2ab('0x20')]=function(_0x5b2b44){var _0x2b0df5=this;return new Promise(function(_0x9c0e5d,_0x5ee85e){return db[_0xd2ab('0x17')]['find']({'raw':_0x5b2b44[_0xd2ab('0x18')]?_0x5b2b44['options'][_0xd2ab('0x19')]===undefined?!![]:![]:!![],'where':_0x5b2b44[_0xd2ab('0x18')]?_0x5b2b44[_0xd2ab('0x18')][_0xd2ab('0x1a')]||null:null,'attributes':_0x5b2b44[_0xd2ab('0x18')]?_0x5b2b44[_0xd2ab('0x18')][_0xd2ab('0x1b')]||null:null,'include':_0x5b2b44[_0xd2ab('0x18')]?_0x5b2b44[_0xd2ab('0x18')][_0xd2ab('0x1c')]?_[_0xd2ab('0x1d')](_0x5b2b44[_0xd2ab('0x18')][_0xd2ab('0x1c')],function(_0x69f67b){return{'model':db[_0x69f67b[_0xd2ab('0x1e')]],'as':_0x69f67b['as'],'attributes':_0x69f67b['attributes'],'include':_0x69f67b[_0xd2ab('0x1c')]?_[_0xd2ab('0x1d')](_0x69f67b[_0xd2ab('0x1c')],function(_0xd6fa73){return{'model':db[_0xd6fa73[_0xd2ab('0x1e')]],'as':_0xd6fa73['as'],'attributes':_0xd6fa73[_0xd2ab('0x1b')],'include':_0xd6fa73['include']?_[_0xd2ab('0x1d')](_0xd6fa73['include'],function(_0x2cd5d8){return{'model':db[_0x2cd5d8[_0xd2ab('0x1e')]],'as':_0x2cd5d8['as'],'attributes':_0x2cd5d8[_0xd2ab('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd2ab('0x21')](function(_0x29c1a0){logger[_0xd2ab('0xd')]('ShowServicenowAccount',_0x5b2b44);logger['debug']('ShowServicenowAccount',_0x5b2b44,JSON[_0xd2ab('0x12')](_0x29c1a0));_0x9c0e5d(_0x29c1a0);})[_0xd2ab('0x16')](function(_0x386b52){logger[_0xd2ab('0x14')](_0xd2ab('0x20'),_0x386b52[_0xd2ab('0x15')],_0x5b2b44);_0x5ee85e(_0x2b0df5['error'](0x1f4,_0x386b52[_0xd2ab('0x15')]));});});}; \ No newline at end of file +var _0x859b=['ServicenowAccount','options','raw','where','attributes','limit','include','model','map','catch','ShowServicenowAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','GetServicenowAccount'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x859b,0x12c));var _0xb859=function(_0x12deef,_0x40edf0){_0x12deef=_0x12deef-0x0;var _0x2ed207=_0x859b[_0x12deef];return _0x2ed207;};'use strict';var _=require(_0xb859('0x0'));var util=require(_0xb859('0x1'));var moment=require('moment');var BPromise=require(_0xb859('0x2'));var rs=require(_0xb859('0x3'));var fs=require('fs');var Redis=require(_0xb859('0x4'));var db=require(_0xb859('0x5'))['db'];var utils=require(_0xb859('0x6'));var logger=require(_0xb859('0x7'))(_0xb859('0x8'));var config=require(_0xb859('0x9'));var jayson=require(_0xb859('0xa'));var client=jayson['client'][_0xb859('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a3118,_0x1645a2,_0x15a96d){return new BPromise(function(_0x52f720,_0x4d1fdd){return client[_0xb859('0xc')](_0x3a3118,_0x15a96d)[_0xb859('0xd')](function(_0x1c9dbe){logger['info'](_0xb859('0xe'),_0x1645a2,_0xb859('0xf'));logger[_0xb859('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1645a2,_0xb859('0xf'),JSON[_0xb859('0x11')](_0x1c9dbe));if(_0x1c9dbe[_0xb859('0x12')]){if(_0x1c9dbe[_0xb859('0x12')][_0xb859('0x13')]===0x1f4){logger[_0xb859('0x12')](_0xb859('0xe'),_0x1645a2,_0x1c9dbe[_0xb859('0x12')][_0xb859('0x14')]);return _0x4d1fdd(_0x1c9dbe[_0xb859('0x12')][_0xb859('0x14')]);}logger['error'](_0xb859('0xe'),_0x1645a2,_0x1c9dbe['error'][_0xb859('0x14')]);return _0x52f720(_0x1c9dbe[_0xb859('0x12')]['message']);}else{logger[_0xb859('0x15')](_0xb859('0xe'),_0x1645a2,_0xb859('0xf'));_0x52f720(_0x1c9dbe[_0xb859('0x16')]['message']);}})['catch'](function(_0x283d9c){logger[_0xb859('0x12')](_0xb859('0xe'),_0x1645a2,_0x283d9c);_0x4d1fdd(_0x283d9c);});});}exports[_0xb859('0x17')]=function(_0x4cda80){var _0x5a1ed5=this;return new Promise(function(_0x261b72,_0x392f31){return db[_0xb859('0x18')]['findAll']({'raw':_0x4cda80[_0xb859('0x19')]?_0x4cda80[_0xb859('0x19')][_0xb859('0x1a')]===undefined?!![]:![]:!![],'where':_0x4cda80[_0xb859('0x19')]?_0x4cda80['options'][_0xb859('0x1b')]||null:null,'attributes':_0x4cda80[_0xb859('0x19')]?_0x4cda80[_0xb859('0x19')][_0xb859('0x1c')]||null:null,'limit':_0x4cda80[_0xb859('0x19')]?_0x4cda80[_0xb859('0x19')][_0xb859('0x1d')]||null:null,'include':_0x4cda80[_0xb859('0x19')]?_0x4cda80[_0xb859('0x19')][_0xb859('0x1e')]?_['map'](_0x4cda80[_0xb859('0x19')][_0xb859('0x1e')],function(_0x371026){return{'model':db[_0x371026[_0xb859('0x1f')]],'as':_0x371026['as'],'attributes':_0x371026[_0xb859('0x1c')],'include':_0x371026['include']?_[_0xb859('0x20')](_0x371026[_0xb859('0x1e')],function(_0x36ef9f){return{'model':db[_0x36ef9f[_0xb859('0x1f')]],'as':_0x36ef9f['as'],'attributes':_0x36ef9f[_0xb859('0x1c')],'include':_0x36ef9f[_0xb859('0x1e')]?_[_0xb859('0x20')](_0x36ef9f[_0xb859('0x1e')],function(_0x3fdd8b){return{'model':db[_0x3fdd8b[_0xb859('0x1f')]],'as':_0x3fdd8b['as'],'attributes':_0x3fdd8b[_0xb859('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb859('0xd')](function(_0x1dd6b8){logger[_0xb859('0x15')](_0xb859('0x17'),_0x4cda80);logger[_0xb859('0x10')](_0xb859('0x17'),_0x4cda80,JSON[_0xb859('0x11')](_0x1dd6b8));_0x261b72(_0x1dd6b8);})[_0xb859('0x21')](function(_0x1a0a36){logger[_0xb859('0x12')](_0xb859('0x17'),_0x1a0a36[_0xb859('0x14')],_0x4cda80);_0x392f31(_0x5a1ed5[_0xb859('0x12')](0x1f4,_0x1a0a36[_0xb859('0x14')]));});});};exports[_0xb859('0x22')]=function(_0x1fa46f){var _0x5d5900=this;return new Promise(function(_0x3ccb4a,_0xac7b9){return db['ServicenowAccount'][_0xb859('0x23')]({'raw':_0x1fa46f['options']?_0x1fa46f[_0xb859('0x19')][_0xb859('0x1a')]===undefined?!![]:![]:!![],'where':_0x1fa46f[_0xb859('0x19')]?_0x1fa46f[_0xb859('0x19')][_0xb859('0x1b')]||null:null,'attributes':_0x1fa46f['options']?_0x1fa46f[_0xb859('0x19')][_0xb859('0x1c')]||null:null,'include':_0x1fa46f['options']?_0x1fa46f[_0xb859('0x19')]['include']?_[_0xb859('0x20')](_0x1fa46f[_0xb859('0x19')]['include'],function(_0x2bbb06){return{'model':db[_0x2bbb06[_0xb859('0x1f')]],'as':_0x2bbb06['as'],'attributes':_0x2bbb06[_0xb859('0x1c')],'include':_0x2bbb06['include']?_[_0xb859('0x20')](_0x2bbb06[_0xb859('0x1e')],function(_0xefba9a){return{'model':db[_0xefba9a[_0xb859('0x1f')]],'as':_0xefba9a['as'],'attributes':_0xefba9a[_0xb859('0x1c')],'include':_0xefba9a['include']?_['map'](_0xefba9a[_0xb859('0x1e')],function(_0x104a6d){return{'model':db[_0x104a6d[_0xb859('0x1f')]],'as':_0x104a6d['as'],'attributes':_0x104a6d[_0xb859('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb859('0xd')](function(_0x58281){logger[_0xb859('0x15')](_0xb859('0x22'),_0x1fa46f);logger[_0xb859('0x10')](_0xb859('0x22'),_0x1fa46f,JSON[_0xb859('0x11')](_0x58281));_0x3ccb4a(_0x58281);})[_0xb859('0x21')](function(_0x24f047){logger[_0xb859('0x12')](_0xb859('0x22'),_0x24f047[_0xb859('0x14')],_0x1fa46f);_0xac7b9(_0x5d5900[_0xb859('0x12')](0x1f4,_0x24f047[_0xb859('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index f6d2311..2a8967a 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 _0xd35b=['get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated'];(function(_0x221300,_0x2ab897){var _0x5546d1=function(_0x617895){while(--_0x617895){_0x221300['push'](_0x221300['shift']());}};_0x5546d1(++_0x2ab897);}(_0xd35b,0x16e));var _0xbd35=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xd35b[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0xbd35('0x0'));var util=require(_0xbd35('0x1'));var path=require(_0xbd35('0x2'));var timeout=require(_0xbd35('0x3'));var express=require(_0xbd35('0x4'));var router=express['Router']();var fs_extra=require(_0xbd35('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbd35('0x6'));var controller=require(_0xbd35('0x7'));router['get']('/',auth[_0xbd35('0x8')](),controller['index']);router[_0xbd35('0x9')](_0xbd35('0xa'),auth[_0xbd35('0x8')](),controller[_0xbd35('0xb')]);router['get'](_0xbd35('0xc'),auth[_0xbd35('0x8')](),controller[_0xbd35('0xd')]);router[_0xbd35('0x9')](_0xbd35('0xe'),auth[_0xbd35('0x8')](),controller[_0xbd35('0xf')]);router[_0xbd35('0x9')](_0xbd35('0x10'),auth[_0xbd35('0x8')](),controller[_0xbd35('0x11')]);router[_0xbd35('0x12')]('/',auth[_0xbd35('0x8')](),controller[_0xbd35('0x13')]);router[_0xbd35('0x14')]('/:id',auth[_0xbd35('0x8')](),controller[_0xbd35('0x15')]);router[_0xbd35('0x16')](_0xbd35('0xa'),auth[_0xbd35('0x8')](),controller[_0xbd35('0x17')]);module[_0xbd35('0x18')]=router; \ No newline at end of file +var _0x85e8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x41bdd4,_0x3d5c76){var _0x5c03a6=function(_0x59634a){while(--_0x59634a){_0x41bdd4['push'](_0x41bdd4['shift']());}};_0x5c03a6(++_0x3d5c76);}(_0x85e8,0x140));var _0x885e=function(_0x57ec1a,_0x2b7624){_0x57ec1a=_0x57ec1a-0x0;var _0x2159ad=_0x85e8[_0x57ec1a];return _0x2159ad;};'use strict';var multer=require(_0x885e('0x0'));var util=require(_0x885e('0x1'));var path=require(_0x885e('0x2'));var timeout=require(_0x885e('0x3'));var express=require('express');var router=express[_0x885e('0x4')]();var fs_extra=require(_0x885e('0x5'));var auth=require(_0x885e('0x6'));var interaction=require(_0x885e('0x7'));var config=require(_0x885e('0x8'));var controller=require(_0x885e('0x9'));router['get']('/',auth[_0x885e('0xa')](),controller[_0x885e('0xb')]);router[_0x885e('0xc')](_0x885e('0xd'),auth[_0x885e('0xa')](),controller[_0x885e('0xe')]);router['get'](_0x885e('0xf'),auth[_0x885e('0xa')](),controller['getFields']);router['get'](_0x885e('0x10'),auth['isAuthenticated'](),controller[_0x885e('0x11')]);router[_0x885e('0xc')](_0x885e('0x12'),auth[_0x885e('0xa')](),controller[_0x885e('0x13')]);router[_0x885e('0x14')]('/',auth[_0x885e('0xa')](),controller[_0x885e('0x15')]);router['put'](_0x885e('0xd'),auth[_0x885e('0xa')](),controller[_0x885e('0x16')]);router[_0x885e('0x17')](_0x885e('0xd'),auth[_0x885e('0xa')](),controller[_0x885e('0x18')]);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 610bb2c..6bcd31b 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 _0x53c1=['sequelize','STRING'];(function(_0x27a1e0,_0x3ff2cb){var _0x1ca624=function(_0x435802){while(--_0x435802){_0x27a1e0['push'](_0x27a1e0['shift']());}};_0x1ca624(++_0x3ff2cb);}(_0x53c1,0x94));var _0x153c=function(_0x31957d,_0x56aed4){_0x31957d=_0x31957d-0x0;var _0x3717a9=_0x53c1[_0x31957d];return _0x3717a9;};'use strict';var Sequelize=require(_0x153c('0x0'));module['exports']={'name':{'type':Sequelize[_0x153c('0x1')]},'description':{'type':Sequelize[_0x153c('0x1')]}}; \ No newline at end of file +var _0x2d1e=['STRING','exports'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x2d1e,0x153));var _0xe2d1=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2d1e[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0xe2d1('0x0')]={'name':{'type':Sequelize[_0xe2d1('0x1')]},'description':{'type':Sequelize[_0xe2d1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index e53d7f3..984c681 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 _0x2746=['ServicenowConfiguration','findAll','rows','show','params','rawAttributes','keys','options','create','body','catch','find','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','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','status','end','json','undefined','limit','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include'];(function(_0x325e3d,_0x2c82b9){var _0x3285a5=function(_0x1528fc){while(--_0x1528fc){_0x325e3d['push'](_0x325e3d['shift']());}};_0x3285a5(++_0x2c82b9);}(_0x2746,0xb5));var _0x6274=function(_0x11e8ef,_0x4d8150){_0x11e8ef=_0x11e8ef-0x0;var _0x227d07=_0x2746[_0x11e8ef];return _0x227d07;};'use strict';var emlformat=require(_0x6274('0x0'));var rimraf=require(_0x6274('0x1'));var zipdir=require(_0x6274('0x2'));var jsonpatch=require(_0x6274('0x3'));var rp=require('request-promise');var moment=require(_0x6274('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6274('0x5'));var sox=require(_0x6274('0x6'));var csv=require(_0x6274('0x7'));var ejs=require(_0x6274('0x8'));var fs=require('fs');var fs_extra=require(_0x6274('0x9'));var _=require(_0x6274('0xa'));var squel=require('squel');var crypto=require(_0x6274('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6274('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6274('0xd'));var Papa=require(_0x6274('0xe'));var Redis=require(_0x6274('0xf'));var authService=require(_0x6274('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6274('0x11'));var hardwareService=require(_0x6274('0x12'));var logger=require(_0x6274('0x13'))(_0x6274('0x14'));var utils=require(_0x6274('0x15'));var config=require(_0x6274('0x16'));var licenseUtil=require(_0x6274('0x17'));var db=require(_0x6274('0x18'))['db'];function respondWithStatusCode(_0x4c35b2,_0x2d1d1e){_0x2d1d1e=_0x2d1d1e||0xcc;return function(_0x1421a2){if(_0x1421a2){return _0x4c35b2['sendStatus'](_0x2d1d1e);}return _0x4c35b2[_0x6274('0x19')](_0x2d1d1e)[_0x6274('0x1a')]();};}function respondWithResult(_0x1f2a0a,_0x14d93a){_0x14d93a=_0x14d93a||0xc8;return function(_0x50c7d7){if(_0x50c7d7){return _0x1f2a0a[_0x6274('0x19')](_0x14d93a)[_0x6274('0x1b')](_0x50c7d7);}};}function respondWithFilteredResult(_0x1a2ab1,_0x4e4e55){return function(_0x1fb7c4){if(_0x1fb7c4){var _0x1c0eb6=typeof _0x4e4e55['offset']===_0x6274('0x1c')&&typeof _0x4e4e55[_0x6274('0x1d')]==='undefined';var _0x24d392=_0x1fb7c4['count'];var _0x2e0147=_0x1c0eb6?0x0:_0x4e4e55[_0x6274('0x1e')];var _0x181b46=_0x1c0eb6?_0x1fb7c4['count']:_0x4e4e55[_0x6274('0x1e')]+_0x4e4e55[_0x6274('0x1d')];var _0x3144db;if(_0x181b46>=_0x24d392){_0x181b46=_0x24d392;_0x3144db=0xc8;}else{_0x3144db=0xce;}_0x1a2ab1[_0x6274('0x19')](_0x3144db);return _0x1a2ab1['set'](_0x6274('0x1f'),_0x2e0147+'-'+_0x181b46+'/'+_0x24d392)[_0x6274('0x1b')](_0x1fb7c4);}return null;};}function patchUpdates(_0x573c59){return function(_0x4ed021){try{jsonpatch[_0x6274('0x20')](_0x4ed021,_0x573c59,!![]);}catch(_0x1f478b){return BPromise[_0x6274('0x21')](_0x1f478b);}return _0x4ed021[_0x6274('0x22')]();};}function saveUpdates(_0x29d796,_0xce9b66){return function(_0x17a15a){if(_0x17a15a){return _0x17a15a[_0x6274('0x23')](_0x29d796)[_0x6274('0x24')](function(_0x358a96){return _0x358a96;});}return null;};}function removeEntity(_0x3f0729,_0x352253){return function(_0x2881cd){if(_0x2881cd){return _0x2881cd[_0x6274('0x25')]()[_0x6274('0x24')](function(){_0x3f0729[_0x6274('0x19')](0xcc)[_0x6274('0x1a')]();});}};}function handleEntityNotFound(_0x284eb4,_0x22942e){return function(_0x2ebbff){if(!_0x2ebbff){_0x284eb4[_0x6274('0x26')](0x194);}return _0x2ebbff;};}function handleError(_0x3c922e,_0x3f578b){_0x3f578b=_0x3f578b||0x1f4;return function(_0x2a0bfd){logger[_0x6274('0x27')](_0x2a0bfd[_0x6274('0x28')]);if(_0x2a0bfd['name']){delete _0x2a0bfd[_0x6274('0x29')];}_0x3c922e[_0x6274('0x19')](_0x3f578b)[_0x6274('0x2a')](_0x2a0bfd);};}exports[_0x6274('0x2b')]=function(_0x26ac33,_0x50fdec){var _0x404a1c={},_0x3b78c9={},_0x56d73d={'count':0x0,'rows':[]};var _0x22cd3b=_['map'](db['ServicenowConfiguration']['rawAttributes'],function(_0x3fea8e){return{'name':_0x3fea8e['fieldName'],'type':_0x3fea8e[_0x6274('0x2c')]['key']};});_0x3b78c9[_0x6274('0x2d')]=_[_0x6274('0x2e')](_0x22cd3b,_0x6274('0x29'));_0x3b78c9[_0x6274('0x2f')]=_['keys'](_0x26ac33[_0x6274('0x2f')]);_0x3b78c9[_0x6274('0x30')]=_[_0x6274('0x31')](_0x3b78c9[_0x6274('0x2d')],_0x3b78c9['query']);_0x404a1c[_0x6274('0x32')]=_[_0x6274('0x31')](_0x3b78c9[_0x6274('0x2d')],qs[_0x6274('0x33')](_0x26ac33[_0x6274('0x2f')][_0x6274('0x33')]));_0x404a1c[_0x6274('0x32')]=_0x404a1c[_0x6274('0x32')][_0x6274('0x34')]?_0x404a1c[_0x6274('0x32')]:_0x3b78c9['model'];if(!_0x26ac33['query'][_0x6274('0x35')](_0x6274('0x36'))){_0x404a1c['limit']=qs[_0x6274('0x1d')](_0x26ac33[_0x6274('0x2f')][_0x6274('0x1d')]);_0x404a1c['offset']=qs['offset'](_0x26ac33['query'][_0x6274('0x1e')]);}_0x404a1c[_0x6274('0x37')]=qs[_0x6274('0x38')](_0x26ac33[_0x6274('0x2f')][_0x6274('0x38')]);_0x404a1c[_0x6274('0x39')]=qs[_0x6274('0x30')](_[_0x6274('0x3a')](_0x26ac33[_0x6274('0x2f')],_0x3b78c9[_0x6274('0x30')]),_0x22cd3b);if(_0x26ac33[_0x6274('0x2f')][_0x6274('0x3b')]){_0x404a1c[_0x6274('0x39')]=_[_0x6274('0x3c')](_0x404a1c['where'],{'$or':_['map'](_0x22cd3b,function(_0x44775f){if(_0x44775f[_0x6274('0x2c')]!==_0x6274('0x3d')){var _0x578856={};_0x578856[_0x44775f[_0x6274('0x29')]]={'$like':'%'+_0x26ac33[_0x6274('0x2f')][_0x6274('0x3b')]+'%'};return _0x578856;}})});}_0x404a1c=_['merge']({},_0x404a1c,_0x26ac33['options']);var _0xf57cc2={'where':_0x404a1c[_0x6274('0x39')]};return db['ServicenowConfiguration'][_0x6274('0x3e')](_0xf57cc2)[_0x6274('0x24')](function(_0x3d6f63){_0x56d73d['count']=_0x3d6f63;if(_0x26ac33[_0x6274('0x2f')][_0x6274('0x3f')]){_0x404a1c[_0x6274('0x40')]=[{'all':!![]}];}return db[_0x6274('0x41')][_0x6274('0x42')](_0x404a1c);})[_0x6274('0x24')](function(_0x57eeb2){_0x56d73d[_0x6274('0x43')]=_0x57eeb2;return _0x56d73d;})[_0x6274('0x24')](respondWithFilteredResult(_0x50fdec,_0x404a1c))['catch'](handleError(_0x50fdec,null));};exports[_0x6274('0x44')]=function(_0x3a06fa,_0x20f459){var _0x539592={'raw':![],'where':{'id':_0x3a06fa[_0x6274('0x45')]['id']}},_0x36713b={};_0x36713b[_0x6274('0x2d')]=_['keys'](db['ServicenowConfiguration'][_0x6274('0x46')]);_0x36713b[_0x6274('0x2f')]=_[_0x6274('0x47')](_0x3a06fa[_0x6274('0x2f')]);_0x36713b[_0x6274('0x30')]=_[_0x6274('0x31')](_0x36713b[_0x6274('0x2d')],_0x36713b[_0x6274('0x2f')]);_0x539592[_0x6274('0x32')]=_['intersection'](_0x36713b[_0x6274('0x2d')],qs['fields'](_0x3a06fa[_0x6274('0x2f')]['fields']));_0x539592[_0x6274('0x32')]=_0x539592[_0x6274('0x32')][_0x6274('0x34')]?_0x539592[_0x6274('0x32')]:_0x36713b[_0x6274('0x2d')];if(_0x3a06fa[_0x6274('0x2f')][_0x6274('0x3f')]){_0x539592['include']=[{'all':!![]}];}_0x539592=_['merge']({},_0x539592,_0x3a06fa[_0x6274('0x48')]);return db[_0x6274('0x41')]['find'](_0x539592)[_0x6274('0x24')](handleEntityNotFound(_0x20f459,null))[_0x6274('0x24')](respondWithResult(_0x20f459,null))['catch'](handleError(_0x20f459,null));};exports[_0x6274('0x49')]=function(_0x4c08a9,_0x946530){return db[_0x6274('0x41')][_0x6274('0x49')](_0x4c08a9[_0x6274('0x4a')],{})['then'](respondWithResult(_0x946530,0xc9))[_0x6274('0x4b')](handleError(_0x946530,null));};exports[_0x6274('0x23')]=function(_0x60befe,_0x4aadf){if(_0x60befe[_0x6274('0x4a')]['id']){delete _0x60befe[_0x6274('0x4a')]['id'];}return db['ServicenowConfiguration'][_0x6274('0x4c')]({'where':{'id':_0x60befe[_0x6274('0x45')]['id']}})[_0x6274('0x24')](handleEntityNotFound(_0x4aadf,null))[_0x6274('0x24')](saveUpdates(_0x60befe[_0x6274('0x4a')],null))[_0x6274('0x24')](respondWithResult(_0x4aadf,null))[_0x6274('0x4b')](handleError(_0x4aadf,null));};exports[_0x6274('0x25')]=function(_0x3fc897,_0x44a293){return db[_0x6274('0x41')][_0x6274('0x4c')]({'where':{'id':_0x3fc897['params']['id']}})[_0x6274('0x24')](handleEntityNotFound(_0x44a293,null))[_0x6274('0x24')](removeEntity(_0x44a293,null))[_0x6274('0x4b')](handleError(_0x44a293,null));};exports[_0x6274('0x4d')]=function(_0x4cc4e6,_0x159c54,_0xab701){var _0x1865c5={};var _0xb4a600={};var _0x4a4894;var _0x1b548a;return db[_0x6274('0x41')][_0x6274('0x4e')]({'where':{'id':_0x4cc4e6[_0x6274('0x45')]['id']}})[_0x6274('0x24')](handleEntityNotFound(_0x159c54,null))[_0x6274('0x24')](function(_0x544195){if(_0x544195){_0x4a4894=_0x544195;_0xb4a600[_0x6274('0x2d')]=_[_0x6274('0x47')](db[_0x6274('0x4f')]['rawAttributes']);_0xb4a600['query']=_['keys'](_0x4cc4e6[_0x6274('0x2f')]);_0xb4a600[_0x6274('0x30')]=_['intersection'](_0xb4a600[_0x6274('0x2d')],_0xb4a600[_0x6274('0x2f')]);_0x1865c5[_0x6274('0x32')]=_[_0x6274('0x31')](_0xb4a600[_0x6274('0x2d')],qs[_0x6274('0x33')](_0x4cc4e6['query'][_0x6274('0x33')]));_0x1865c5[_0x6274('0x32')]=_0x1865c5['attributes'][_0x6274('0x34')]?_0x1865c5[_0x6274('0x32')]:_0xb4a600['model'];_0x1865c5['order']=qs[_0x6274('0x38')](_0x4cc4e6[_0x6274('0x2f')]['sort']);_0x1865c5[_0x6274('0x39')]=qs[_0x6274('0x30')](_[_0x6274('0x3a')](_0x4cc4e6[_0x6274('0x2f')],_0xb4a600[_0x6274('0x30')]));if(_0x4cc4e6[_0x6274('0x2f')]['filter']){_0x1865c5[_0x6274('0x39')]=_['merge'](_0x1865c5[_0x6274('0x39')],{'$or':_[_0x6274('0x2e')](_0x1865c5[_0x6274('0x32')],function(_0x56e9cf){var _0xf9b8a={};_0xf9b8a[_0x56e9cf]={'$like':'%'+_0x4cc4e6[_0x6274('0x2f')]['filter']+'%'};return _0xf9b8a;})});}_0x1865c5=_[_0x6274('0x3c')]({},_0x1865c5,_0x4cc4e6[_0x6274('0x48')]);return _0x4a4894[_0x6274('0x4d')](_0x1865c5);}})[_0x6274('0x24')](function(_0x26265d){if(_0x26265d){_0x1b548a=_0x26265d[_0x6274('0x34')];if(!_0x4cc4e6['query'][_0x6274('0x35')](_0x6274('0x36'))){_0x1865c5['limit']=qs[_0x6274('0x1d')](_0x4cc4e6[_0x6274('0x2f')]['limit']);_0x1865c5[_0x6274('0x1e')]=qs[_0x6274('0x1e')](_0x4cc4e6[_0x6274('0x2f')][_0x6274('0x1e')]);}return _0x4a4894[_0x6274('0x4d')](_0x1865c5);}})['then'](function(_0x43d4ea){if(_0x43d4ea){return _0x43d4ea?{'count':_0x1b548a,'rows':_0x43d4ea}:null;}})[_0x6274('0x24')](respondWithResult(_0x159c54,null))[_0x6274('0x4b')](handleError(_0x159c54,null));};exports['getSubjects']=function(_0x21caf6,_0x157a8a,_0x16aee4){var _0x1cadf7={};var _0x4a2f35={};var _0x53b7e5;var _0x34873f;return db[_0x6274('0x41')][_0x6274('0x4e')]({'where':{'id':_0x21caf6[_0x6274('0x45')]['id']}})[_0x6274('0x24')](handleEntityNotFound(_0x157a8a,null))[_0x6274('0x24')](function(_0x4a8afd){if(_0x4a8afd){_0x53b7e5=_0x4a8afd;_0x4a2f35[_0x6274('0x2d')]=_[_0x6274('0x47')](db['ServicenowField']['rawAttributes']);_0x4a2f35['query']=_[_0x6274('0x47')](_0x21caf6[_0x6274('0x2f')]);_0x4a2f35[_0x6274('0x30')]=_[_0x6274('0x31')](_0x4a2f35[_0x6274('0x2d')],_0x4a2f35[_0x6274('0x2f')]);_0x1cadf7[_0x6274('0x32')]=_[_0x6274('0x31')](_0x4a2f35['model'],qs[_0x6274('0x33')](_0x21caf6[_0x6274('0x2f')][_0x6274('0x33')]));_0x1cadf7[_0x6274('0x32')]=_0x1cadf7['attributes']['length']?_0x1cadf7[_0x6274('0x32')]:_0x4a2f35[_0x6274('0x2d')];_0x1cadf7['order']=qs['sort'](_0x21caf6[_0x6274('0x2f')]['sort']);_0x1cadf7[_0x6274('0x39')]=qs[_0x6274('0x30')](_[_0x6274('0x3a')](_0x21caf6[_0x6274('0x2f')],_0x4a2f35[_0x6274('0x30')]));if(_0x21caf6[_0x6274('0x2f')][_0x6274('0x3b')]){_0x1cadf7[_0x6274('0x39')]=_[_0x6274('0x3c')](_0x1cadf7['where'],{'$or':_[_0x6274('0x2e')](_0x1cadf7[_0x6274('0x32')],function(_0x408821){var _0x24add3={};_0x24add3[_0x408821]={'$like':'%'+_0x21caf6[_0x6274('0x2f')][_0x6274('0x3b')]+'%'};return _0x24add3;})});}_0x1cadf7=_[_0x6274('0x3c')]({},_0x1cadf7,_0x21caf6[_0x6274('0x48')]);return _0x53b7e5[_0x6274('0x50')](_0x1cadf7);}})[_0x6274('0x24')](function(_0x4991f3){if(_0x4991f3){_0x34873f=_0x4991f3['length'];if(!_0x21caf6[_0x6274('0x2f')][_0x6274('0x35')](_0x6274('0x36'))){_0x1cadf7['limit']=qs[_0x6274('0x1d')](_0x21caf6[_0x6274('0x2f')][_0x6274('0x1d')]);_0x1cadf7[_0x6274('0x1e')]=qs[_0x6274('0x1e')](_0x21caf6[_0x6274('0x2f')][_0x6274('0x1e')]);}return _0x53b7e5[_0x6274('0x50')](_0x1cadf7);}})[_0x6274('0x24')](function(_0x585f42){if(_0x585f42){return _0x585f42?{'count':_0x34873f,'rows':_0x585f42}:null;}})[_0x6274('0x24')](respondWithResult(_0x157a8a,null))[_0x6274('0x4b')](handleError(_0x157a8a,null));};exports[_0x6274('0x51')]=function(_0x52cab7,_0x28c55e,_0x384ff4){var _0x208144={};var _0x19ca4a={};var _0x4dcc4f;var _0x114fee;return db[_0x6274('0x41')][_0x6274('0x4e')]({'where':{'id':_0x52cab7[_0x6274('0x45')]['id']}})[_0x6274('0x24')](handleEntityNotFound(_0x28c55e,null))['then'](function(_0x71377a){if(_0x71377a){_0x4dcc4f=_0x71377a;_0x19ca4a['model']=_[_0x6274('0x47')](db['ServicenowField'][_0x6274('0x46')]);_0x19ca4a[_0x6274('0x2f')]=_[_0x6274('0x47')](_0x52cab7[_0x6274('0x2f')]);_0x19ca4a[_0x6274('0x30')]=_[_0x6274('0x31')](_0x19ca4a[_0x6274('0x2d')],_0x19ca4a[_0x6274('0x2f')]);_0x208144['attributes']=_[_0x6274('0x31')](_0x19ca4a[_0x6274('0x2d')],qs[_0x6274('0x33')](_0x52cab7[_0x6274('0x2f')][_0x6274('0x33')]));_0x208144[_0x6274('0x32')]=_0x208144[_0x6274('0x32')][_0x6274('0x34')]?_0x208144[_0x6274('0x32')]:_0x19ca4a[_0x6274('0x2d')];_0x208144[_0x6274('0x37')]=qs['sort'](_0x52cab7['query']['sort']);_0x208144['where']=qs['filters'](_[_0x6274('0x3a')](_0x52cab7[_0x6274('0x2f')],_0x19ca4a[_0x6274('0x30')]));if(_0x52cab7[_0x6274('0x2f')][_0x6274('0x3b')]){_0x208144[_0x6274('0x39')]=_[_0x6274('0x3c')](_0x208144[_0x6274('0x39')],{'$or':_[_0x6274('0x2e')](_0x208144[_0x6274('0x32')],function(_0x3ec87b){var _0x1f6944={};_0x1f6944[_0x3ec87b]={'$like':'%'+_0x52cab7[_0x6274('0x2f')][_0x6274('0x3b')]+'%'};return _0x1f6944;})});}_0x208144=_[_0x6274('0x3c')]({},_0x208144,_0x52cab7[_0x6274('0x48')]);return _0x4dcc4f['getDescriptions'](_0x208144);}})[_0x6274('0x24')](function(_0x2eaf4c){if(_0x2eaf4c){_0x114fee=_0x2eaf4c[_0x6274('0x34')];if(!_0x52cab7['query']['hasOwnProperty'](_0x6274('0x36'))){_0x208144['limit']=qs['limit'](_0x52cab7['query'][_0x6274('0x1d')]);_0x208144[_0x6274('0x1e')]=qs[_0x6274('0x1e')](_0x52cab7[_0x6274('0x2f')]['offset']);}return _0x4dcc4f['getDescriptions'](_0x208144);}})[_0x6274('0x24')](function(_0x4b081e){if(_0x4b081e){return _0x4b081e?{'count':_0x114fee,'rows':_0x4b081e}:null;}})[_0x6274('0x24')](respondWithResult(_0x28c55e,null))[_0x6274('0x4b')](handleError(_0x28c55e,null));}; \ No newline at end of file +var _0xafc8=['sort','where','filters','pick','type','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','fields','includeAll','create','body','find','params','destroy','getFields','findOne','ServicenowField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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','../../mysqldb','sendStatus','status','end','offset','limit','undefined','json','reject','save','update','then','name','send','index','map','ServicenowConfiguration','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x455ed5,_0xab57cc){var _0x481ac4=function(_0x4e2e61){while(--_0x4e2e61){_0x455ed5['push'](_0x455ed5['shift']());}};_0x481ac4(++_0xab57cc);}(_0xafc8,0x108));var _0x8afc=function(_0x19e17a,_0x5b3094){_0x19e17a=_0x19e17a-0x0;var _0xa14ec2=_0xafc8[_0x19e17a];return _0xa14ec2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8afc('0x0'));var zipdir=require(_0x8afc('0x1'));var jsonpatch=require(_0x8afc('0x2'));var rp=require(_0x8afc('0x3'));var moment=require(_0x8afc('0x4'));var BPromise=require(_0x8afc('0x5'));var Mustache=require('mustache');var util=require(_0x8afc('0x6'));var path=require('path');var sox=require(_0x8afc('0x7'));var csv=require(_0x8afc('0x8'));var ejs=require(_0x8afc('0x9'));var fs=require('fs');var fs_extra=require(_0x8afc('0xa'));var _=require(_0x8afc('0xb'));var squel=require(_0x8afc('0xc'));var crypto=require(_0x8afc('0xd'));var jsforce=require(_0x8afc('0xe'));var deskjs=require(_0x8afc('0xf'));var toCsv=require(_0x8afc('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8afc('0x10'));var authService=require(_0x8afc('0x11'));var qs=require(_0x8afc('0x12'));var as=require(_0x8afc('0x13'));var hardwareService=require(_0x8afc('0x14'));var logger=require(_0x8afc('0x15'))(_0x8afc('0x16'));var utils=require(_0x8afc('0x17'));var config=require(_0x8afc('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8afc('0x19'))['db'];function respondWithStatusCode(_0x595561,_0xd4f406){_0xd4f406=_0xd4f406||0xcc;return function(_0x29bca4){if(_0x29bca4){return _0x595561[_0x8afc('0x1a')](_0xd4f406);}return _0x595561[_0x8afc('0x1b')](_0xd4f406)[_0x8afc('0x1c')]();};}function respondWithResult(_0x3dac12,_0x40fbe3){_0x40fbe3=_0x40fbe3||0xc8;return function(_0x44e2a8){if(_0x44e2a8){return _0x3dac12['status'](_0x40fbe3)['json'](_0x44e2a8);}};}function respondWithFilteredResult(_0x4c5f0,_0x4b67a9){return function(_0xd4e3e2){if(_0xd4e3e2){var _0x4c168c=typeof _0x4b67a9[_0x8afc('0x1d')]==='undefined'&&typeof _0x4b67a9[_0x8afc('0x1e')]===_0x8afc('0x1f');var _0x54c1a2=_0xd4e3e2['count'];var _0x2d12e3=_0x4c168c?0x0:_0x4b67a9[_0x8afc('0x1d')];var _0x35887b=_0x4c168c?_0xd4e3e2['count']:_0x4b67a9[_0x8afc('0x1d')]+_0x4b67a9[_0x8afc('0x1e')];var _0x21e022;if(_0x35887b>=_0x54c1a2){_0x35887b=_0x54c1a2;_0x21e022=0xc8;}else{_0x21e022=0xce;}_0x4c5f0[_0x8afc('0x1b')](_0x21e022);return _0x4c5f0['set']('Content-Range',_0x2d12e3+'-'+_0x35887b+'/'+_0x54c1a2)[_0x8afc('0x20')](_0xd4e3e2);}return null;};}function patchUpdates(_0x48b337){return function(_0x5cfe56){try{jsonpatch['apply'](_0x5cfe56,_0x48b337,!![]);}catch(_0x1cd402){return BPromise[_0x8afc('0x21')](_0x1cd402);}return _0x5cfe56[_0x8afc('0x22')]();};}function saveUpdates(_0x4739ee,_0x3a0de9){return function(_0x4111ea){if(_0x4111ea){return _0x4111ea[_0x8afc('0x23')](_0x4739ee)[_0x8afc('0x24')](function(_0x6336fb){return _0x6336fb;});}return null;};}function removeEntity(_0x303ed5,_0x545be2){return function(_0x12916c){if(_0x12916c){return _0x12916c['destroy']()[_0x8afc('0x24')](function(){_0x303ed5[_0x8afc('0x1b')](0xcc)[_0x8afc('0x1c')]();});}};}function handleEntityNotFound(_0x46fd43,_0x15d372){return function(_0x5aa38b){if(!_0x5aa38b){_0x46fd43[_0x8afc('0x1a')](0x194);}return _0x5aa38b;};}function handleError(_0xad4900,_0x551728){_0x551728=_0x551728||0x1f4;return function(_0x43bee4){logger['error'](_0x43bee4['stack']);if(_0x43bee4[_0x8afc('0x25')]){delete _0x43bee4[_0x8afc('0x25')];}_0xad4900['status'](_0x551728)[_0x8afc('0x26')](_0x43bee4);};}exports[_0x8afc('0x27')]=function(_0x41ea40,_0x2e08f1){var _0x3f11bb={},_0x47749d={},_0x23c89f={'count':0x0,'rows':[]};var _0x3e33c4=_[_0x8afc('0x28')](db[_0x8afc('0x29')][_0x8afc('0x2a')],function(_0x4000f9){return{'name':_0x4000f9['fieldName'],'type':_0x4000f9['type']['key']};});_0x47749d[_0x8afc('0x2b')]=_[_0x8afc('0x28')](_0x3e33c4,_0x8afc('0x25'));_0x47749d['query']=_[_0x8afc('0x2c')](_0x41ea40[_0x8afc('0x2d')]);_0x47749d['filters']=_[_0x8afc('0x2e')](_0x47749d[_0x8afc('0x2b')],_0x47749d[_0x8afc('0x2d')]);_0x3f11bb[_0x8afc('0x2f')]=_[_0x8afc('0x2e')](_0x47749d[_0x8afc('0x2b')],qs['fields'](_0x41ea40[_0x8afc('0x2d')]['fields']));_0x3f11bb[_0x8afc('0x2f')]=_0x3f11bb[_0x8afc('0x2f')][_0x8afc('0x30')]?_0x3f11bb[_0x8afc('0x2f')]:_0x47749d[_0x8afc('0x2b')];if(!_0x41ea40[_0x8afc('0x2d')][_0x8afc('0x31')](_0x8afc('0x32'))){_0x3f11bb[_0x8afc('0x1e')]=qs['limit'](_0x41ea40[_0x8afc('0x2d')][_0x8afc('0x1e')]);_0x3f11bb['offset']=qs[_0x8afc('0x1d')](_0x41ea40[_0x8afc('0x2d')]['offset']);}_0x3f11bb[_0x8afc('0x33')]=qs[_0x8afc('0x34')](_0x41ea40[_0x8afc('0x2d')][_0x8afc('0x34')]);_0x3f11bb[_0x8afc('0x35')]=qs[_0x8afc('0x36')](_[_0x8afc('0x37')](_0x41ea40[_0x8afc('0x2d')],_0x47749d[_0x8afc('0x36')]),_0x3e33c4);if(_0x41ea40[_0x8afc('0x2d')]['filter']){_0x3f11bb[_0x8afc('0x35')]=_['merge'](_0x3f11bb[_0x8afc('0x35')],{'$or':_[_0x8afc('0x28')](_0x3e33c4,function(_0x138a20){if(_0x138a20[_0x8afc('0x38')]!==_0x8afc('0x39')){var _0x4d7823={};_0x4d7823[_0x138a20['name']]={'$like':'%'+_0x41ea40[_0x8afc('0x2d')][_0x8afc('0x3a')]+'%'};return _0x4d7823;}})});}_0x3f11bb=_[_0x8afc('0x3b')]({},_0x3f11bb,_0x41ea40[_0x8afc('0x3c')]);var _0x4ae9a9={'where':_0x3f11bb['where']};return db['ServicenowConfiguration'][_0x8afc('0x3d')](_0x4ae9a9)[_0x8afc('0x24')](function(_0xe934d6){_0x23c89f[_0x8afc('0x3d')]=_0xe934d6;if(_0x41ea40[_0x8afc('0x2d')]['includeAll']){_0x3f11bb[_0x8afc('0x3e')]=[{'all':!![]}];}return db[_0x8afc('0x29')][_0x8afc('0x3f')](_0x3f11bb);})[_0x8afc('0x24')](function(_0x53408d){_0x23c89f[_0x8afc('0x40')]=_0x53408d;return _0x23c89f;})[_0x8afc('0x24')](respondWithFilteredResult(_0x2e08f1,_0x3f11bb))[_0x8afc('0x41')](handleError(_0x2e08f1,null));};exports[_0x8afc('0x42')]=function(_0x42203d,_0x33f0f4){var _0x44c1fa={'raw':![],'where':{'id':_0x42203d['params']['id']}},_0x11bbce={};_0x11bbce['model']=_[_0x8afc('0x2c')](db[_0x8afc('0x29')][_0x8afc('0x2a')]);_0x11bbce[_0x8afc('0x2d')]=_[_0x8afc('0x2c')](_0x42203d[_0x8afc('0x2d')]);_0x11bbce[_0x8afc('0x36')]=_[_0x8afc('0x2e')](_0x11bbce[_0x8afc('0x2b')],_0x11bbce[_0x8afc('0x2d')]);_0x44c1fa[_0x8afc('0x2f')]=_[_0x8afc('0x2e')](_0x11bbce['model'],qs['fields'](_0x42203d[_0x8afc('0x2d')][_0x8afc('0x43')]));_0x44c1fa['attributes']=_0x44c1fa[_0x8afc('0x2f')][_0x8afc('0x30')]?_0x44c1fa['attributes']:_0x11bbce[_0x8afc('0x2b')];if(_0x42203d[_0x8afc('0x2d')][_0x8afc('0x44')]){_0x44c1fa[_0x8afc('0x3e')]=[{'all':!![]}];}_0x44c1fa=_[_0x8afc('0x3b')]({},_0x44c1fa,_0x42203d['options']);return db['ServicenowConfiguration']['find'](_0x44c1fa)[_0x8afc('0x24')](handleEntityNotFound(_0x33f0f4,null))[_0x8afc('0x24')](respondWithResult(_0x33f0f4,null))[_0x8afc('0x41')](handleError(_0x33f0f4,null));};exports['create']=function(_0x2e4962,_0x52fbbd){return db[_0x8afc('0x29')][_0x8afc('0x45')](_0x2e4962[_0x8afc('0x46')],{})['then'](respondWithResult(_0x52fbbd,0xc9))[_0x8afc('0x41')](handleError(_0x52fbbd,null));};exports['update']=function(_0xedca10,_0x4f8739){if(_0xedca10[_0x8afc('0x46')]['id']){delete _0xedca10[_0x8afc('0x46')]['id'];}return db[_0x8afc('0x29')][_0x8afc('0x47')]({'where':{'id':_0xedca10[_0x8afc('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f8739,null))[_0x8afc('0x24')](saveUpdates(_0xedca10[_0x8afc('0x46')],null))['then'](respondWithResult(_0x4f8739,null))[_0x8afc('0x41')](handleError(_0x4f8739,null));};exports[_0x8afc('0x49')]=function(_0x1f9d3b,_0x208885){return db[_0x8afc('0x29')][_0x8afc('0x47')]({'where':{'id':_0x1f9d3b[_0x8afc('0x48')]['id']}})[_0x8afc('0x24')](handleEntityNotFound(_0x208885,null))[_0x8afc('0x24')](removeEntity(_0x208885,null))[_0x8afc('0x41')](handleError(_0x208885,null));};exports[_0x8afc('0x4a')]=function(_0x5d3446,_0x1e7184,_0x26658e){var _0x8535d4={};var _0x28c2ae={};var _0x5d980a;var _0x297887;return db[_0x8afc('0x29')][_0x8afc('0x4b')]({'where':{'id':_0x5d3446[_0x8afc('0x48')]['id']}})[_0x8afc('0x24')](handleEntityNotFound(_0x1e7184,null))[_0x8afc('0x24')](function(_0x11559e){if(_0x11559e){_0x5d980a=_0x11559e;_0x28c2ae['model']=_[_0x8afc('0x2c')](db[_0x8afc('0x4c')][_0x8afc('0x2a')]);_0x28c2ae[_0x8afc('0x2d')]=_['keys'](_0x5d3446[_0x8afc('0x2d')]);_0x28c2ae[_0x8afc('0x36')]=_[_0x8afc('0x2e')](_0x28c2ae[_0x8afc('0x2b')],_0x28c2ae[_0x8afc('0x2d')]);_0x8535d4[_0x8afc('0x2f')]=_[_0x8afc('0x2e')](_0x28c2ae[_0x8afc('0x2b')],qs['fields'](_0x5d3446[_0x8afc('0x2d')][_0x8afc('0x43')]));_0x8535d4[_0x8afc('0x2f')]=_0x8535d4['attributes'][_0x8afc('0x30')]?_0x8535d4[_0x8afc('0x2f')]:_0x28c2ae[_0x8afc('0x2b')];_0x8535d4[_0x8afc('0x33')]=qs[_0x8afc('0x34')](_0x5d3446[_0x8afc('0x2d')][_0x8afc('0x34')]);_0x8535d4['where']=qs[_0x8afc('0x36')](_[_0x8afc('0x37')](_0x5d3446[_0x8afc('0x2d')],_0x28c2ae[_0x8afc('0x36')]));if(_0x5d3446['query']['filter']){_0x8535d4[_0x8afc('0x35')]=_[_0x8afc('0x3b')](_0x8535d4[_0x8afc('0x35')],{'$or':_[_0x8afc('0x28')](_0x8535d4['attributes'],function(_0x100a4b){var _0x3e88b8={};_0x3e88b8[_0x100a4b]={'$like':'%'+_0x5d3446[_0x8afc('0x2d')]['filter']+'%'};return _0x3e88b8;})});}_0x8535d4=_[_0x8afc('0x3b')]({},_0x8535d4,_0x5d3446['options']);return _0x5d980a['getFields'](_0x8535d4);}})['then'](function(_0x304dad){if(_0x304dad){_0x297887=_0x304dad[_0x8afc('0x30')];if(!_0x5d3446[_0x8afc('0x2d')][_0x8afc('0x31')](_0x8afc('0x32'))){_0x8535d4['limit']=qs[_0x8afc('0x1e')](_0x5d3446['query'][_0x8afc('0x1e')]);_0x8535d4['offset']=qs[_0x8afc('0x1d')](_0x5d3446['query'][_0x8afc('0x1d')]);}return _0x5d980a['getFields'](_0x8535d4);}})[_0x8afc('0x24')](function(_0x4b87fe){if(_0x4b87fe){return _0x4b87fe?{'count':_0x297887,'rows':_0x4b87fe}:null;}})[_0x8afc('0x24')](respondWithResult(_0x1e7184,null))['catch'](handleError(_0x1e7184,null));};exports[_0x8afc('0x4d')]=function(_0x649571,_0x333d86,_0x246048){var _0x4f2458={};var _0x221f5f={};var _0xdf6d4e;var _0x27c282;return db[_0x8afc('0x29')][_0x8afc('0x4b')]({'where':{'id':_0x649571[_0x8afc('0x48')]['id']}})['then'](handleEntityNotFound(_0x333d86,null))[_0x8afc('0x24')](function(_0x4fe3a6){if(_0x4fe3a6){_0xdf6d4e=_0x4fe3a6;_0x221f5f[_0x8afc('0x2b')]=_['keys'](db[_0x8afc('0x4c')][_0x8afc('0x2a')]);_0x221f5f['query']=_[_0x8afc('0x2c')](_0x649571['query']);_0x221f5f[_0x8afc('0x36')]=_['intersection'](_0x221f5f['model'],_0x221f5f[_0x8afc('0x2d')]);_0x4f2458[_0x8afc('0x2f')]=_[_0x8afc('0x2e')](_0x221f5f['model'],qs['fields'](_0x649571[_0x8afc('0x2d')][_0x8afc('0x43')]));_0x4f2458[_0x8afc('0x2f')]=_0x4f2458[_0x8afc('0x2f')]['length']?_0x4f2458[_0x8afc('0x2f')]:_0x221f5f['model'];_0x4f2458[_0x8afc('0x33')]=qs[_0x8afc('0x34')](_0x649571[_0x8afc('0x2d')][_0x8afc('0x34')]);_0x4f2458[_0x8afc('0x35')]=qs[_0x8afc('0x36')](_[_0x8afc('0x37')](_0x649571[_0x8afc('0x2d')],_0x221f5f[_0x8afc('0x36')]));if(_0x649571[_0x8afc('0x2d')][_0x8afc('0x3a')]){_0x4f2458[_0x8afc('0x35')]=_[_0x8afc('0x3b')](_0x4f2458[_0x8afc('0x35')],{'$or':_['map'](_0x4f2458[_0x8afc('0x2f')],function(_0x4850a3){var _0x1f97b2={};_0x1f97b2[_0x4850a3]={'$like':'%'+_0x649571['query'][_0x8afc('0x3a')]+'%'};return _0x1f97b2;})});}_0x4f2458=_[_0x8afc('0x3b')]({},_0x4f2458,_0x649571[_0x8afc('0x3c')]);return _0xdf6d4e[_0x8afc('0x4d')](_0x4f2458);}})['then'](function(_0x3cf13d){if(_0x3cf13d){_0x27c282=_0x3cf13d[_0x8afc('0x30')];if(!_0x649571['query'][_0x8afc('0x31')]('nolimit')){_0x4f2458[_0x8afc('0x1e')]=qs[_0x8afc('0x1e')](_0x649571[_0x8afc('0x2d')][_0x8afc('0x1e')]);_0x4f2458[_0x8afc('0x1d')]=qs['offset'](_0x649571['query'][_0x8afc('0x1d')]);}return _0xdf6d4e['getSubjects'](_0x4f2458);}})[_0x8afc('0x24')](function(_0x3002e3){if(_0x3002e3){return _0x3002e3?{'count':_0x27c282,'rows':_0x3002e3}:null;}})[_0x8afc('0x24')](respondWithResult(_0x333d86,null))[_0x8afc('0x41')](handleError(_0x333d86,null));};exports[_0x8afc('0x4e')]=function(_0x41861e,_0x227c54,_0x131f73){var _0x45f43e={};var _0x2bfbaa={};var _0x41dfd0;var _0x35028c;return db[_0x8afc('0x29')][_0x8afc('0x4b')]({'where':{'id':_0x41861e[_0x8afc('0x48')]['id']}})['then'](handleEntityNotFound(_0x227c54,null))[_0x8afc('0x24')](function(_0x1ed5ce){if(_0x1ed5ce){_0x41dfd0=_0x1ed5ce;_0x2bfbaa[_0x8afc('0x2b')]=_['keys'](db[_0x8afc('0x4c')][_0x8afc('0x2a')]);_0x2bfbaa['query']=_[_0x8afc('0x2c')](_0x41861e['query']);_0x2bfbaa[_0x8afc('0x36')]=_['intersection'](_0x2bfbaa['model'],_0x2bfbaa[_0x8afc('0x2d')]);_0x45f43e[_0x8afc('0x2f')]=_[_0x8afc('0x2e')](_0x2bfbaa[_0x8afc('0x2b')],qs[_0x8afc('0x43')](_0x41861e[_0x8afc('0x2d')][_0x8afc('0x43')]));_0x45f43e[_0x8afc('0x2f')]=_0x45f43e[_0x8afc('0x2f')][_0x8afc('0x30')]?_0x45f43e[_0x8afc('0x2f')]:_0x2bfbaa[_0x8afc('0x2b')];_0x45f43e[_0x8afc('0x33')]=qs[_0x8afc('0x34')](_0x41861e[_0x8afc('0x2d')][_0x8afc('0x34')]);_0x45f43e[_0x8afc('0x35')]=qs[_0x8afc('0x36')](_['pick'](_0x41861e[_0x8afc('0x2d')],_0x2bfbaa[_0x8afc('0x36')]));if(_0x41861e[_0x8afc('0x2d')][_0x8afc('0x3a')]){_0x45f43e[_0x8afc('0x35')]=_[_0x8afc('0x3b')](_0x45f43e[_0x8afc('0x35')],{'$or':_[_0x8afc('0x28')](_0x45f43e[_0x8afc('0x2f')],function(_0x4ea524){var _0x5dc1cd={};_0x5dc1cd[_0x4ea524]={'$like':'%'+_0x41861e[_0x8afc('0x2d')][_0x8afc('0x3a')]+'%'};return _0x5dc1cd;})});}_0x45f43e=_[_0x8afc('0x3b')]({},_0x45f43e,_0x41861e['options']);return _0x41dfd0[_0x8afc('0x4e')](_0x45f43e);}})[_0x8afc('0x24')](function(_0x2d90a8){if(_0x2d90a8){_0x35028c=_0x2d90a8[_0x8afc('0x30')];if(!_0x41861e[_0x8afc('0x2d')][_0x8afc('0x31')](_0x8afc('0x32'))){_0x45f43e['limit']=qs['limit'](_0x41861e['query'][_0x8afc('0x1e')]);_0x45f43e[_0x8afc('0x1d')]=qs['offset'](_0x41861e[_0x8afc('0x2d')]['offset']);}return _0x41dfd0[_0x8afc('0x4e')](_0x45f43e);}})[_0x8afc('0x24')](function(_0x5b34c3){if(_0x5b34c3){return _0x5b34c3?{'count':_0x35028c,'rows':_0x5b34c3}:null;}})['then'](respondWithResult(_0x227c54,null))[_0x8afc('0x41')](handleError(_0x227c54,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 7a3398c..8a0b7ed 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 _0x9672=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x223d59,_0x200318){var _0x25ef82=function(_0x298401){while(--_0x298401){_0x223d59['push'](_0x223d59['shift']());}};_0x25ef82(++_0x200318);}(_0x9672,0xee));var _0x2967=function(_0x3e2193,_0x377c4c){_0x3e2193=_0x3e2193-0x0;var _0x385da8=_0x9672[_0x3e2193];return _0x385da8;};'use strict';var _=require(_0x2967('0x0'));var util=require(_0x2967('0x1'));var logger=require('../../config/logger')(_0x2967('0x2'));var moment=require(_0x2967('0x3'));var BPromise=require(_0x2967('0x4'));var rp=require(_0x2967('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2967('0x6'));var config=require(_0x2967('0x7'));var attributes=require(_0x2967('0x8'));module['exports']=function(_0x4baad7,_0x24424d){return _0x4baad7[_0x2967('0x9')](_0x2967('0xa'),attributes,{'tableName':_0x2967('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc19f=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','int_servicenow_configurations','../../config/logger','api','request-promise','path'];(function(_0x55a777,_0x2c95f7){var _0x8ca6a1=function(_0x3cc973){while(--_0x3cc973){_0x55a777['push'](_0x55a777['shift']());}};_0x8ca6a1(++_0x2c95f7);}(_0xc19f,0x164));var _0xfc19=function(_0x2d0614,_0x325d18){_0x2d0614=_0x2d0614-0x0;var _0x133390=_0xc19f[_0x2d0614];return _0x133390;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfc19('0x0'))(_0xfc19('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfc19('0x2'));var fs=require('fs');var path=require(_0xfc19('0x3'));var rimraf=require(_0xfc19('0x4'));var config=require(_0xfc19('0x5'));var attributes=require(_0xfc19('0x6'));module[_0xfc19('0x7')]=function(_0x3ca66e,_0x56332d){return _0x3ca66e['define']('ServicenowConfiguration',attributes,{'tableName':_0xfc19('0x8'),'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 29aa0ed..17ed18b 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 _0x378f=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x378f,0xc9));var _0xf378=function(_0x1a473f,_0x1f4e67){_0x1a473f=_0x1a473f-0x0;var _0x3fb212=_0x378f[_0x1a473f];return _0x3fb212;};'use strict';var _=require(_0xf378('0x0'));var util=require(_0xf378('0x1'));var moment=require(_0xf378('0x2'));var BPromise=require(_0xf378('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf378('0x4'));var db=require(_0xf378('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf378('0x6'))(_0xf378('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf378('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x416467,_0x129d03,_0x5cbd63){return new BPromise(function(_0x9b1f5f,_0x8d8761){return client['request'](_0x416467,_0x5cbd63)['then'](function(_0x20ebc3){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x129d03,'request\x20sent');logger['debug'](_0xf378('0x9'),_0x129d03,_0xf378('0xa'),JSON[_0xf378('0xb')](_0x20ebc3));if(_0x20ebc3[_0xf378('0xc')]){if(_0x20ebc3[_0xf378('0xc')]['code']===0x1f4){logger[_0xf378('0xc')](_0xf378('0xd'),_0x129d03,_0x20ebc3[_0xf378('0xc')][_0xf378('0xe')]);return _0x8d8761(_0x20ebc3[_0xf378('0xc')][_0xf378('0xe')]);}logger[_0xf378('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x129d03,_0x20ebc3['error']['message']);return _0x9b1f5f(_0x20ebc3[_0xf378('0xc')][_0xf378('0xe')]);}else{logger['info'](_0xf378('0xd'),_0x129d03,_0xf378('0xa'));_0x9b1f5f(_0x20ebc3[_0xf378('0xf')][_0xf378('0xe')]);}})[_0xf378('0x10')](function(_0x3d97c6){logger[_0xf378('0xc')](_0xf378('0xd'),_0x129d03,_0x3d97c6);_0x8d8761(_0x3d97c6);});});} \ No newline at end of file +var _0x68fc=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x29a60c,_0x4ca1c1){var _0x422c82=function(_0x5c6bfc){while(--_0x5c6bfc){_0x29a60c['push'](_0x29a60c['shift']());}};_0x422c82(++_0x4ca1c1);}(_0x68fc,0x13b));var _0xc68f=function(_0x33be75,_0x29e8e3){_0x33be75=_0x33be75-0x0;var _0x167c71=_0x68fc[_0x33be75];return _0x167c71;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var moment=require(_0xc68f('0x2'));var BPromise=require(_0xc68f('0x3'));var rs=require(_0xc68f('0x4'));var fs=require('fs');var Redis=require(_0xc68f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc68f('0x6'))('rpc');var config=require(_0xc68f('0x7'));var jayson=require(_0xc68f('0x8'));var client=jayson[_0xc68f('0x9')][_0xc68f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b0792,_0x29265c,_0x1cbc28){return new BPromise(function(_0x4b38b7,_0x741460){return client[_0xc68f('0xb')](_0x4b0792,_0x1cbc28)[_0xc68f('0xc')](function(_0x17aed2){logger[_0xc68f('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x29265c,'request\x20sent');logger[_0xc68f('0xe')](_0xc68f('0xf'),_0x29265c,_0xc68f('0x10'),JSON[_0xc68f('0x11')](_0x17aed2));if(_0x17aed2[_0xc68f('0x12')]){if(_0x17aed2['error'][_0xc68f('0x13')]===0x1f4){logger[_0xc68f('0x12')](_0xc68f('0x14'),_0x29265c,_0x17aed2['error'][_0xc68f('0x15')]);return _0x741460(_0x17aed2[_0xc68f('0x12')][_0xc68f('0x15')]);}logger[_0xc68f('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x29265c,_0x17aed2[_0xc68f('0x12')][_0xc68f('0x15')]);return _0x4b38b7(_0x17aed2[_0xc68f('0x12')][_0xc68f('0x15')]);}else{logger[_0xc68f('0xd')](_0xc68f('0x14'),_0x29265c,'request\x20sent');_0x4b38b7(_0x17aed2[_0xc68f('0x16')][_0xc68f('0x15')]);}})[_0xc68f('0x17')](function(_0x52ac13){logger[_0xc68f('0x12')](_0xc68f('0x14'),_0x29265c,_0x52ac13);_0x741460(_0x52ac13);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 970c5fb..b226f1e 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 _0x34de=['../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','create','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x33314d,_0x499628){var _0x4ffe8e=function(_0xb1ec35){while(--_0xb1ec35){_0x33314d['push'](_0x33314d['shift']());}};_0x4ffe8e(++_0x499628);}(_0x34de,0x14e));var _0xe34d=function(_0x172ae4,_0x35f100){_0x172ae4=_0x172ae4-0x0;var _0x5e07eb=_0x34de[_0x172ae4];return _0x5e07eb;};'use strict';var multer=require(_0xe34d('0x0'));var util=require(_0xe34d('0x1'));var path=require(_0xe34d('0x2'));var timeout=require(_0xe34d('0x3'));var express=require(_0xe34d('0x4'));var router=express[_0xe34d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe34d('0x6'));var interaction=require(_0xe34d('0x7'));var config=require(_0xe34d('0x8'));var controller=require(_0xe34d('0x9'));router[_0xe34d('0xa')]('/',auth[_0xe34d('0xb')](),controller[_0xe34d('0xc')]);router['get'](_0xe34d('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe34d('0xe')]('/',auth['isAuthenticated'](),controller[_0xe34d('0xf')]);router['put']('/:id',auth[_0xe34d('0xb')](),controller['update']);router['delete'](_0xe34d('0xd'),auth['isAuthenticated'](),controller[_0xe34d('0x10')]);module[_0xe34d('0x11')]=router; \ No newline at end of file +var _0x3fb8=['fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','express','Router'];(function(_0x22ff0e,_0x19b81d){var _0x3f7f38=function(_0x13f00e){while(--_0x13f00e){_0x22ff0e['push'](_0x22ff0e['shift']());}};_0x3f7f38(++_0x19b81d);}(_0x3fb8,0xb0));var _0x83fb=function(_0x55e492,_0x398035){_0x55e492=_0x55e492-0x0;var _0x27b6a7=_0x3fb8[_0x55e492];return _0x27b6a7;};'use strict';var multer=require(_0x83fb('0x0'));var util=require(_0x83fb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x83fb('0x2'));var router=express[_0x83fb('0x3')]();var fs_extra=require(_0x83fb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x83fb('0x5'));var config=require(_0x83fb('0x6'));var controller=require(_0x83fb('0x7'));router[_0x83fb('0x8')]('/',auth[_0x83fb('0x9')](),controller[_0x83fb('0xa')]);router[_0x83fb('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x83fb('0xb')]);router[_0x83fb('0xc')]('/',auth['isAuthenticated'](),controller[_0x83fb('0xd')]);router[_0x83fb('0xe')](_0x83fb('0xf'),auth[_0x83fb('0x9')](),controller[_0x83fb('0x10')]);router[_0x83fb('0x11')](_0x83fb('0xf'),auth[_0x83fb('0x9')](),controller[_0x83fb('0x12')]);module[_0x83fb('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 6269686..b41b857 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 _0x40ed=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','sequelize'];(function(_0x147eb2,_0x517881){var _0x361644=function(_0x32ea89){while(--_0x32ea89){_0x147eb2['push'](_0x147eb2['shift']());}};_0x361644(++_0x517881);}(_0x40ed,0x8f));var _0xd40e=function(_0x45ed52,_0x1c1b06){_0x45ed52=_0x45ed52-0x0;var _0x42bebe=_0x40ed[_0x45ed52];return _0x42bebe;};'use strict';var Sequelize=require(_0xd40e('0x0'));module[_0xd40e('0x1')]={'type':{'type':Sequelize[_0xd40e('0x2')](_0xd40e('0x3'),_0xd40e('0x4'),'customVariable',_0xd40e('0x5'),_0xd40e('0x6')),'defaultValue':_0xd40e('0x3')},'content':{'type':Sequelize[_0xd40e('0x7')]},'key':{'type':Sequelize[_0xd40e('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xd40e('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd40e('0x7')]},'nameField':{'type':Sequelize[_0xd40e('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7db1=['string','variable','customVariable','picklist','STRING','sequelize','exports','ENUM'];(function(_0x32cb31,_0x24ea58){var _0xda9111=function(_0x46ca96){while(--_0x46ca96){_0x32cb31['push'](_0x32cb31['shift']());}};_0xda9111(++_0x24ea58);}(_0x7db1,0x1e5));var _0x17db=function(_0x354404,_0x141542){_0x354404=_0x354404-0x0;var _0x1c10f8=_0x7db1[_0x354404];return _0x1c10f8;};'use strict';var Sequelize=require(_0x17db('0x0'));module[_0x17db('0x1')]={'type':{'type':Sequelize[_0x17db('0x2')](_0x17db('0x3'),_0x17db('0x4'),_0x17db('0x5'),'keyValue',_0x17db('0x6')),'defaultValue':_0x17db('0x3')},'content':{'type':Sequelize[_0x17db('0x7')]},'key':{'type':Sequelize[_0x17db('0x7')]},'keyType':{'type':Sequelize[_0x17db('0x2')](_0x17db('0x3'),_0x17db('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x17db('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x17db('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x17db('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 326f013..47ba394 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 _0xe7c7=['limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','includeAll','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset'];(function(_0x24de89,_0x5d6491){var _0x42b287=function(_0x3f9478){while(--_0x3f9478){_0x24de89['push'](_0x24de89['shift']());}};_0x42b287(++_0x5d6491);}(_0xe7c7,0x10b));var _0x7e7c=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xe7c7[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x7e7c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e7c('0x1'));var jsonpatch=require(_0x7e7c('0x2'));var rp=require(_0x7e7c('0x3'));var moment=require(_0x7e7c('0x4'));var BPromise=require(_0x7e7c('0x5'));var Mustache=require(_0x7e7c('0x6'));var util=require(_0x7e7c('0x7'));var path=require(_0x7e7c('0x8'));var sox=require(_0x7e7c('0x9'));var csv=require('to-csv');var ejs=require(_0x7e7c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7e7c('0xb'));var crypto=require(_0x7e7c('0xc'));var jsforce=require(_0x7e7c('0xd'));var deskjs=require(_0x7e7c('0xe'));var toCsv=require(_0x7e7c('0xf'));var querystring=require('querystring');var Papa=require(_0x7e7c('0x10'));var Redis=require(_0x7e7c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7e7c('0x12'));var hardwareService=require(_0x7e7c('0x13'));var logger=require(_0x7e7c('0x14'))(_0x7e7c('0x15'));var utils=require(_0x7e7c('0x16'));var config=require(_0x7e7c('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ea808,_0x36b978){_0x36b978=_0x36b978||0xcc;return function(_0x536850){if(_0x536850){return _0x1ea808[_0x7e7c('0x18')](_0x36b978);}return _0x1ea808[_0x7e7c('0x19')](_0x36b978)[_0x7e7c('0x1a')]();};}function respondWithResult(_0x321282,_0x75dc38){_0x75dc38=_0x75dc38||0xc8;return function(_0x1056a8){if(_0x1056a8){return _0x321282[_0x7e7c('0x19')](_0x75dc38)[_0x7e7c('0x1b')](_0x1056a8);}};}function respondWithFilteredResult(_0x55cecf,_0x17732d){return function(_0x21b6b7){if(_0x21b6b7){var _0x211e3d=typeof _0x17732d[_0x7e7c('0x1c')]==='undefined'&&typeof _0x17732d[_0x7e7c('0x1d')]===_0x7e7c('0x1e');var _0xe0562=_0x21b6b7['count'];var _0x4fe236=_0x211e3d?0x0:_0x17732d[_0x7e7c('0x1c')];var _0x23d564=_0x211e3d?_0x21b6b7[_0x7e7c('0x1f')]:_0x17732d['offset']+_0x17732d[_0x7e7c('0x1d')];var _0x75d520;if(_0x23d564>=_0xe0562){_0x23d564=_0xe0562;_0x75d520=0xc8;}else{_0x75d520=0xce;}_0x55cecf['status'](_0x75d520);return _0x55cecf[_0x7e7c('0x20')](_0x7e7c('0x21'),_0x4fe236+'-'+_0x23d564+'/'+_0xe0562)[_0x7e7c('0x1b')](_0x21b6b7);}return null;};}function patchUpdates(_0x2b5cee){return function(_0x217f79){try{jsonpatch[_0x7e7c('0x22')](_0x217f79,_0x2b5cee,!![]);}catch(_0x443cd8){return BPromise[_0x7e7c('0x23')](_0x443cd8);}return _0x217f79['save']();};}function saveUpdates(_0x3df1b6,_0x17239b){return function(_0x589e43){if(_0x589e43){return _0x589e43[_0x7e7c('0x24')](_0x3df1b6)[_0x7e7c('0x25')](function(_0x20188b){return _0x20188b;});}return null;};}function removeEntity(_0x1a1510,_0x332904){return function(_0x2a5a3e){if(_0x2a5a3e){return _0x2a5a3e[_0x7e7c('0x26')]()['then'](function(){_0x1a1510['status'](0xcc)[_0x7e7c('0x1a')]();});}};}function handleEntityNotFound(_0x36db2a,_0x40c3ee){return function(_0x5d36c9){if(!_0x5d36c9){_0x36db2a[_0x7e7c('0x18')](0x194);}return _0x5d36c9;};}function handleError(_0x61850c,_0x3e94c5){_0x3e94c5=_0x3e94c5||0x1f4;return function(_0x52c64a){logger[_0x7e7c('0x27')](_0x52c64a['stack']);if(_0x52c64a[_0x7e7c('0x28')]){delete _0x52c64a[_0x7e7c('0x28')];}_0x61850c['status'](_0x3e94c5)[_0x7e7c('0x29')](_0x52c64a);};}exports[_0x7e7c('0x2a')]=function(_0x5663ae,_0x100840){var _0x310c66={},_0x407706={},_0x4db2ec={'count':0x0,'rows':[]};var _0x9334d1=_[_0x7e7c('0x2b')](db[_0x7e7c('0x2c')][_0x7e7c('0x2d')],function(_0x5c0b5d){return{'name':_0x5c0b5d[_0x7e7c('0x2e')],'type':_0x5c0b5d[_0x7e7c('0x2f')]['key']};});_0x407706[_0x7e7c('0x30')]=_[_0x7e7c('0x2b')](_0x9334d1,_0x7e7c('0x28'));_0x407706[_0x7e7c('0x31')]=_[_0x7e7c('0x32')](_0x5663ae['query']);_0x407706[_0x7e7c('0x33')]=_['intersection'](_0x407706['model'],_0x407706[_0x7e7c('0x31')]);_0x310c66[_0x7e7c('0x34')]=_[_0x7e7c('0x35')](_0x407706['model'],qs[_0x7e7c('0x36')](_0x5663ae[_0x7e7c('0x31')][_0x7e7c('0x36')]));_0x310c66[_0x7e7c('0x34')]=_0x310c66[_0x7e7c('0x34')][_0x7e7c('0x37')]?_0x310c66[_0x7e7c('0x34')]:_0x407706[_0x7e7c('0x30')];if(!_0x5663ae[_0x7e7c('0x31')][_0x7e7c('0x38')](_0x7e7c('0x39'))){_0x310c66['limit']=qs[_0x7e7c('0x1d')](_0x5663ae[_0x7e7c('0x31')]['limit']);_0x310c66['offset']=qs[_0x7e7c('0x1c')](_0x5663ae['query'][_0x7e7c('0x1c')]);}_0x310c66[_0x7e7c('0x3a')]=qs[_0x7e7c('0x3b')](_0x5663ae[_0x7e7c('0x31')]['sort']);_0x310c66[_0x7e7c('0x3c')]=qs[_0x7e7c('0x33')](_[_0x7e7c('0x3d')](_0x5663ae[_0x7e7c('0x31')],_0x407706[_0x7e7c('0x33')]),_0x9334d1);if(_0x5663ae[_0x7e7c('0x31')][_0x7e7c('0x3e')]){_0x310c66[_0x7e7c('0x3c')]=_[_0x7e7c('0x3f')](_0x310c66[_0x7e7c('0x3c')],{'$or':_[_0x7e7c('0x2b')](_0x9334d1,function(_0x22bdad){if(_0x22bdad[_0x7e7c('0x2f')]!==_0x7e7c('0x40')){var _0x2eb892={};_0x2eb892[_0x22bdad[_0x7e7c('0x28')]]={'$like':'%'+_0x5663ae['query']['filter']+'%'};return _0x2eb892;}})});}_0x310c66=_[_0x7e7c('0x3f')]({},_0x310c66,_0x5663ae[_0x7e7c('0x41')]);var _0x27a498={'where':_0x310c66[_0x7e7c('0x3c')]};return db[_0x7e7c('0x2c')][_0x7e7c('0x1f')](_0x27a498)[_0x7e7c('0x25')](function(_0x5e736c){_0x4db2ec[_0x7e7c('0x1f')]=_0x5e736c;if(_0x5663ae[_0x7e7c('0x31')]['includeAll']){_0x310c66[_0x7e7c('0x42')]=[{'all':!![]}];}return db[_0x7e7c('0x2c')][_0x7e7c('0x43')](_0x310c66);})[_0x7e7c('0x25')](function(_0x427b98){_0x4db2ec['rows']=_0x427b98;return _0x4db2ec;})[_0x7e7c('0x25')](respondWithFilteredResult(_0x100840,_0x310c66))[_0x7e7c('0x44')](handleError(_0x100840,null));};exports['show']=function(_0x508511,_0x3c7284){var _0x39ba39={'raw':!![],'where':{'id':_0x508511[_0x7e7c('0x45')]['id']}},_0x48c70c={};_0x48c70c[_0x7e7c('0x30')]=_[_0x7e7c('0x32')](db['ServicenowField'][_0x7e7c('0x2d')]);_0x48c70c[_0x7e7c('0x31')]=_[_0x7e7c('0x32')](_0x508511[_0x7e7c('0x31')]);_0x48c70c[_0x7e7c('0x33')]=_[_0x7e7c('0x35')](_0x48c70c[_0x7e7c('0x30')],_0x48c70c['query']);_0x39ba39[_0x7e7c('0x34')]=_['intersection'](_0x48c70c['model'],qs[_0x7e7c('0x36')](_0x508511['query'][_0x7e7c('0x36')]));_0x39ba39[_0x7e7c('0x34')]=_0x39ba39[_0x7e7c('0x34')][_0x7e7c('0x37')]?_0x39ba39[_0x7e7c('0x34')]:_0x48c70c[_0x7e7c('0x30')];if(_0x508511[_0x7e7c('0x31')][_0x7e7c('0x46')]){_0x39ba39['include']=[{'all':!![]}];}_0x39ba39=_[_0x7e7c('0x3f')]({},_0x39ba39,_0x508511[_0x7e7c('0x41')]);return db[_0x7e7c('0x2c')]['find'](_0x39ba39)[_0x7e7c('0x25')](handleEntityNotFound(_0x3c7284,null))[_0x7e7c('0x25')](respondWithResult(_0x3c7284,null))[_0x7e7c('0x44')](handleError(_0x3c7284,null));};exports[_0x7e7c('0x47')]=function(_0x2d361b,_0x38c49b){return db[_0x7e7c('0x2c')][_0x7e7c('0x47')](_0x2d361b[_0x7e7c('0x48')],{})['then'](respondWithResult(_0x38c49b,0xc9))[_0x7e7c('0x44')](handleError(_0x38c49b,null));};exports[_0x7e7c('0x24')]=function(_0x3c7f10,_0x2a8048){if(_0x3c7f10[_0x7e7c('0x48')]['id']){delete _0x3c7f10['body']['id'];}return db[_0x7e7c('0x2c')][_0x7e7c('0x49')]({'where':{'id':_0x3c7f10[_0x7e7c('0x45')]['id']}})[_0x7e7c('0x25')](handleEntityNotFound(_0x2a8048,null))[_0x7e7c('0x25')](saveUpdates(_0x3c7f10['body'],null))[_0x7e7c('0x25')](respondWithResult(_0x2a8048,null))[_0x7e7c('0x44')](handleError(_0x2a8048,null));};exports[_0x7e7c('0x26')]=function(_0x1639d0,_0xe14c29){return db[_0x7e7c('0x2c')][_0x7e7c('0x49')]({'where':{'id':_0x1639d0[_0x7e7c('0x45')]['id']}})[_0x7e7c('0x25')](handleEntityNotFound(_0xe14c29,null))[_0x7e7c('0x25')](removeEntity(_0xe14c29,null))[_0x7e7c('0x44')](handleError(_0xe14c29,null));}; \ No newline at end of file +var _0xb287=['pick','filter','where','VIRTUAL','merge','options','ServicenowField','includeAll','include','findAll','rows','show','params','keys','create','body','update','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/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','apply','reject','save','then','error','stack','name','index','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x1971e5,_0x5e8c04){var _0x54b937=function(_0x4ea2f1){while(--_0x4ea2f1){_0x1971e5['push'](_0x1971e5['shift']());}};_0x54b937(++_0x5e8c04);}(_0xb287,0x102));var _0x7b28=function(_0x48d8c3,_0xabfe17){_0x48d8c3=_0x48d8c3-0x0;var _0x1e534d=_0xb287[_0x48d8c3];return _0x1e534d;};'use strict';var emlformat=require(_0x7b28('0x0'));var rimraf=require(_0x7b28('0x1'));var zipdir=require(_0x7b28('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b28('0x3'));var moment=require(_0x7b28('0x4'));var BPromise=require(_0x7b28('0x5'));var Mustache=require(_0x7b28('0x6'));var util=require(_0x7b28('0x7'));var path=require(_0x7b28('0x8'));var sox=require(_0x7b28('0x9'));var csv=require(_0x7b28('0xa'));var ejs=require(_0x7b28('0xb'));var fs=require('fs');var fs_extra=require(_0x7b28('0xc'));var _=require(_0x7b28('0xd'));var squel=require(_0x7b28('0xe'));var crypto=require(_0x7b28('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7b28('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7b28('0x11'));var Papa=require(_0x7b28('0x12'));var Redis=require(_0x7b28('0x13'));var authService=require(_0x7b28('0x14'));var qs=require(_0x7b28('0x15'));var as=require(_0x7b28('0x16'));var hardwareService=require(_0x7b28('0x17'));var logger=require(_0x7b28('0x18'))(_0x7b28('0x19'));var utils=require(_0x7b28('0x1a'));var config=require(_0x7b28('0x1b'));var licenseUtil=require(_0x7b28('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c3b94,_0x446d67){_0x446d67=_0x446d67||0xcc;return function(_0x4c8557){if(_0x4c8557){return _0x4c3b94[_0x7b28('0x1d')](_0x446d67);}return _0x4c3b94[_0x7b28('0x1e')](_0x446d67)[_0x7b28('0x1f')]();};}function respondWithResult(_0x554240,_0x1707d1){_0x1707d1=_0x1707d1||0xc8;return function(_0x37e8e7){if(_0x37e8e7){return _0x554240[_0x7b28('0x1e')](_0x1707d1)[_0x7b28('0x20')](_0x37e8e7);}};}function respondWithFilteredResult(_0x4b4622,_0x39bde7){return function(_0x4f7c5c){if(_0x4f7c5c){var _0x4050ab=typeof _0x39bde7[_0x7b28('0x21')]==='undefined'&&typeof _0x39bde7[_0x7b28('0x22')]===_0x7b28('0x23');var _0x4cb22b=_0x4f7c5c['count'];var _0x150d6f=_0x4050ab?0x0:_0x39bde7[_0x7b28('0x21')];var _0x235c0a=_0x4050ab?_0x4f7c5c[_0x7b28('0x24')]:_0x39bde7[_0x7b28('0x21')]+_0x39bde7[_0x7b28('0x22')];var _0x5244e0;if(_0x235c0a>=_0x4cb22b){_0x235c0a=_0x4cb22b;_0x5244e0=0xc8;}else{_0x5244e0=0xce;}_0x4b4622[_0x7b28('0x1e')](_0x5244e0);return _0x4b4622[_0x7b28('0x25')](_0x7b28('0x26'),_0x150d6f+'-'+_0x235c0a+'/'+_0x4cb22b)[_0x7b28('0x20')](_0x4f7c5c);}return null;};}function patchUpdates(_0x42a73f){return function(_0x1b77b5){try{jsonpatch[_0x7b28('0x27')](_0x1b77b5,_0x42a73f,!![]);}catch(_0x4f9ce1){return BPromise[_0x7b28('0x28')](_0x4f9ce1);}return _0x1b77b5[_0x7b28('0x29')]();};}function saveUpdates(_0x2bf62d,_0x5e76ec){return function(_0xba5fcd){if(_0xba5fcd){return _0xba5fcd['update'](_0x2bf62d)[_0x7b28('0x2a')](function(_0x1d2302){return _0x1d2302;});}return null;};}function removeEntity(_0x4416b1,_0x5e8f73){return function(_0x4c7014){if(_0x4c7014){return _0x4c7014['destroy']()['then'](function(){_0x4416b1['status'](0xcc)[_0x7b28('0x1f')]();});}};}function handleEntityNotFound(_0x5719c4,_0x4f3ee2){return function(_0x5cd705){if(!_0x5cd705){_0x5719c4[_0x7b28('0x1d')](0x194);}return _0x5cd705;};}function handleError(_0x1bff6c,_0x1c2b7b){_0x1c2b7b=_0x1c2b7b||0x1f4;return function(_0x4786ec){logger[_0x7b28('0x2b')](_0x4786ec[_0x7b28('0x2c')]);if(_0x4786ec['name']){delete _0x4786ec[_0x7b28('0x2d')];}_0x1bff6c[_0x7b28('0x1e')](_0x1c2b7b)['send'](_0x4786ec);};}exports[_0x7b28('0x2e')]=function(_0x4ef0df,_0x31cc24){var _0x154ca0={},_0x56e0c2={},_0x33641c={'count':0x0,'rows':[]};var _0xad50ab=_['map'](db['ServicenowField'][_0x7b28('0x2f')],function(_0xf31ed2){return{'name':_0xf31ed2['fieldName'],'type':_0xf31ed2[_0x7b28('0x30')][_0x7b28('0x31')]};});_0x56e0c2['model']=_[_0x7b28('0x32')](_0xad50ab,_0x7b28('0x2d'));_0x56e0c2[_0x7b28('0x33')]=_['keys'](_0x4ef0df[_0x7b28('0x33')]);_0x56e0c2[_0x7b28('0x34')]=_[_0x7b28('0x35')](_0x56e0c2[_0x7b28('0x36')],_0x56e0c2[_0x7b28('0x33')]);_0x154ca0['attributes']=_[_0x7b28('0x35')](_0x56e0c2[_0x7b28('0x36')],qs['fields'](_0x4ef0df[_0x7b28('0x33')][_0x7b28('0x37')]));_0x154ca0[_0x7b28('0x38')]=_0x154ca0['attributes'][_0x7b28('0x39')]?_0x154ca0[_0x7b28('0x38')]:_0x56e0c2['model'];if(!_0x4ef0df[_0x7b28('0x33')][_0x7b28('0x3a')](_0x7b28('0x3b'))){_0x154ca0['limit']=qs[_0x7b28('0x22')](_0x4ef0df[_0x7b28('0x33')]['limit']);_0x154ca0[_0x7b28('0x21')]=qs[_0x7b28('0x21')](_0x4ef0df[_0x7b28('0x33')]['offset']);}_0x154ca0[_0x7b28('0x3c')]=qs[_0x7b28('0x3d')](_0x4ef0df[_0x7b28('0x33')][_0x7b28('0x3d')]);_0x154ca0['where']=qs['filters'](_[_0x7b28('0x3e')](_0x4ef0df[_0x7b28('0x33')],_0x56e0c2[_0x7b28('0x34')]),_0xad50ab);if(_0x4ef0df[_0x7b28('0x33')][_0x7b28('0x3f')]){_0x154ca0[_0x7b28('0x40')]=_['merge'](_0x154ca0['where'],{'$or':_[_0x7b28('0x32')](_0xad50ab,function(_0x28eeec){if(_0x28eeec['type']!==_0x7b28('0x41')){var _0x88343={};_0x88343[_0x28eeec[_0x7b28('0x2d')]]={'$like':'%'+_0x4ef0df['query'][_0x7b28('0x3f')]+'%'};return _0x88343;}})});}_0x154ca0=_[_0x7b28('0x42')]({},_0x154ca0,_0x4ef0df[_0x7b28('0x43')]);var _0x5e6be1={'where':_0x154ca0[_0x7b28('0x40')]};return db[_0x7b28('0x44')][_0x7b28('0x24')](_0x5e6be1)['then'](function(_0x46adee){_0x33641c['count']=_0x46adee;if(_0x4ef0df[_0x7b28('0x33')][_0x7b28('0x45')]){_0x154ca0[_0x7b28('0x46')]=[{'all':!![]}];}return db[_0x7b28('0x44')][_0x7b28('0x47')](_0x154ca0);})['then'](function(_0x46e745){_0x33641c[_0x7b28('0x48')]=_0x46e745;return _0x33641c;})[_0x7b28('0x2a')](respondWithFilteredResult(_0x31cc24,_0x154ca0))['catch'](handleError(_0x31cc24,null));};exports[_0x7b28('0x49')]=function(_0x570f8c,_0x195c2c){var _0x21fca8={'raw':!![],'where':{'id':_0x570f8c[_0x7b28('0x4a')]['id']}},_0xd97644={};_0xd97644['model']=_[_0x7b28('0x4b')](db[_0x7b28('0x44')][_0x7b28('0x2f')]);_0xd97644['query']=_['keys'](_0x570f8c[_0x7b28('0x33')]);_0xd97644[_0x7b28('0x34')]=_[_0x7b28('0x35')](_0xd97644['model'],_0xd97644[_0x7b28('0x33')]);_0x21fca8[_0x7b28('0x38')]=_[_0x7b28('0x35')](_0xd97644[_0x7b28('0x36')],qs[_0x7b28('0x37')](_0x570f8c[_0x7b28('0x33')][_0x7b28('0x37')]));_0x21fca8[_0x7b28('0x38')]=_0x21fca8[_0x7b28('0x38')][_0x7b28('0x39')]?_0x21fca8[_0x7b28('0x38')]:_0xd97644[_0x7b28('0x36')];if(_0x570f8c['query'][_0x7b28('0x45')]){_0x21fca8['include']=[{'all':!![]}];}_0x21fca8=_[_0x7b28('0x42')]({},_0x21fca8,_0x570f8c[_0x7b28('0x43')]);return db[_0x7b28('0x44')]['find'](_0x21fca8)[_0x7b28('0x2a')](handleEntityNotFound(_0x195c2c,null))[_0x7b28('0x2a')](respondWithResult(_0x195c2c,null))['catch'](handleError(_0x195c2c,null));};exports[_0x7b28('0x4c')]=function(_0x273177,_0x4b3e06){return db[_0x7b28('0x44')]['create'](_0x273177[_0x7b28('0x4d')],{})[_0x7b28('0x2a')](respondWithResult(_0x4b3e06,0xc9))['catch'](handleError(_0x4b3e06,null));};exports[_0x7b28('0x4e')]=function(_0x34d591,_0x265a61){if(_0x34d591['body']['id']){delete _0x34d591[_0x7b28('0x4d')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x34d591['params']['id']}})[_0x7b28('0x2a')](handleEntityNotFound(_0x265a61,null))['then'](saveUpdates(_0x34d591['body'],null))['then'](respondWithResult(_0x265a61,null))[_0x7b28('0x4f')](handleError(_0x265a61,null));};exports['destroy']=function(_0x470e39,_0x8c23b5){return db['ServicenowField']['find']({'where':{'id':_0x470e39[_0x7b28('0x4a')]['id']}})[_0x7b28('0x2a')](handleEntityNotFound(_0x8c23b5,null))[_0x7b28('0x2a')](removeEntity(_0x8c23b5,null))[_0x7b28('0x4f')](handleError(_0x8c23b5,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 7c8444a..6aa93cb 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 _0x061c=['./intServicenowField.attributes','ServicenowField','servicenow_unique_index','idField','util','api','moment','request-promise','path','rimraf'];(function(_0x1d6e3d,_0x51b0c5){var _0x27d1e4=function(_0x37d6c4){while(--_0x37d6c4){_0x1d6e3d['push'](_0x1d6e3d['shift']());}};_0x27d1e4(++_0x51b0c5);}(_0x061c,0x1d0));var _0xc061=function(_0x5f3fb2,_0x384327){_0x5f3fb2=_0x5f3fb2-0x0;var _0x160f2b=_0x061c[_0x5f3fb2];return _0x160f2b;};'use strict';var _=require('lodash');var util=require(_0xc061('0x0'));var logger=require('../../config/logger')(_0xc061('0x1'));var moment=require(_0xc061('0x2'));var BPromise=require('bluebird');var rp=require(_0xc061('0x3'));var fs=require('fs');var path=require(_0xc061('0x4'));var rimraf=require(_0xc061('0x5'));var config=require('../../config/environment');var attributes=require(_0xc061('0x6'));module['exports']=function(_0x40da6c,_0x49cef7){return _0x40da6c['define'](_0xc061('0x7'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xc061('0x8'),'fields':[_0xc061('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2509=['exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2509,0x95));var _0x9250=function(_0x480a07,_0x2147f2){_0x480a07=_0x480a07-0x0;var _0xed5d11=_0x2509[_0x480a07];return _0xed5d11;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9250('0x0'))('api');var moment=require(_0x9250('0x1'));var BPromise=require('bluebird');var rp=require(_0x9250('0x2'));var fs=require('fs');var path=require(_0x9250('0x3'));var rimraf=require(_0x9250('0x4'));var config=require(_0x9250('0x5'));var attributes=require(_0x9250('0x6'));module[_0x9250('0x7')]=function(_0x5f194e,_0x580443){return _0x5f194e[_0x9250('0x8')](_0x9250('0x9'),attributes,{'tableName':_0x9250('0xa'),'paranoid':![],'indexes':[{'name':_0x9250('0xb'),'fields':[_0x9250('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 eb33f07..ff6afc8 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 _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3d5aef,_0x64e2d5){_0x3d5aef=_0x3d5aef-0x0;var _0x33e385=_0xbdb7[_0x3d5aef];return _0x33e385;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x28fcd1,_0x423926){var _0x3381aa=function(_0x574569){while(--_0x574569){_0x28fcd1['push'](_0x28fcd1['shift']());}};_0x3381aa(++_0x423926);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1fd9e7,_0x24cdbe){_0x1fd9e7=_0x1fd9e7-0x0;var _0x1781f2=_0xcb91[_0x1fd9e7];return _0x1781f2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ServicenowField,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 189bffc..29efd5c 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x58ce3d,_0x535c28){var _0x3406ac=function(_0x335200){while(--_0x335200){_0x58ce3d['push'](_0x58ce3d['shift']());}};_0x3406ac(++_0x535c28);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x17bedc,_0x17023e){var _0x1dac15=function(_0x298ac8){while(--_0x298ac8){_0x17bedc['push'](_0x17bedc['shift']());}};_0x1dac15(++_0x17023e);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 7daf251..4bfdd42 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(_0x57aa9b,_0xf681e0){var _0x5ee142=function(_0x529fb0){while(--_0x529fb0){_0x57aa9b['push'](_0x57aa9b['shift']());}};_0x5ee142(++_0xf681e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x252fca,_0x10604a){var _0x2c4bc7=function(_0x1d4ad0){while(--_0x1d4ad0){_0x252fca['push'](_0x252fca['shift']());}};_0x2c4bc7(++_0x10604a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 10d84d2..4ea45b9 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 _0x226f=['destroy','error','stack','name','send','index','map','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','SugarcrmAccount','includeAll','include','findAll','rows','catch','show','params','find','create','body','SugarcrmConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','type','getFields','assigned_user_id','created_by','description','duration_minutes','parent_id','parent_type','direction','findOne','username','password','slice','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','values','includes','label','endsWith','value','statusCode','test','Wrong\x20credentials','zip-dir','fast-json-patch','moment','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','apply','save','update','then'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x226f,0x12d));var _0xf226=function(_0x5523d5,_0x356cc6){_0x5523d5=_0x5523d5-0x0;var _0x49b4a2=_0x226f[_0x5523d5];return _0x49b4a2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf226('0x0'));var jsonpatch=require(_0xf226('0x1'));var rp=require('request-promise');var moment=require(_0xf226('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf226('0x3'));var sox=require('sox');var csv=require(_0xf226('0x4'));var ejs=require(_0xf226('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf226('0x6'));var crypto=require(_0xf226('0x7'));var jsforce=require(_0xf226('0x8'));var deskjs=require(_0xf226('0x9'));var toCsv=require(_0xf226('0x4'));var querystring=require('querystring');var Papa=require(_0xf226('0xa'));var Redis=require(_0xf226('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xf226('0xc'));var as=require(_0xf226('0xd'));var hardwareService=require(_0xf226('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0xf226('0xf'));var config=require(_0xf226('0x10'));var licenseUtil=require(_0xf226('0x11'));var db=require(_0xf226('0x12'))['db'];var integrations=require(_0xf226('0x13'));function respondWithStatusCode(_0x4c2154,_0x2191e0){_0x2191e0=_0x2191e0||0xcc;return function(_0x802071){if(_0x802071){return _0x4c2154[_0xf226('0x14')](_0x2191e0);}return _0x4c2154[_0xf226('0x15')](_0x2191e0)[_0xf226('0x16')]();};}function respondWithResult(_0x4e30e7,_0x3a3ecc){_0x3a3ecc=_0x3a3ecc||0xc8;return function(_0x14481a){if(_0x14481a){return _0x4e30e7['status'](_0x3a3ecc)[_0xf226('0x17')](_0x14481a);}};}function respondWithFilteredResult(_0x167e8f,_0x1ec43d){return function(_0x3430ee){if(_0x3430ee){var _0x52cbcc=typeof _0x1ec43d[_0xf226('0x18')]==='undefined'&&typeof _0x1ec43d[_0xf226('0x19')]==='undefined';var _0x47e061=_0x3430ee['count'];var _0x23e282=_0x52cbcc?0x0:_0x1ec43d[_0xf226('0x18')];var _0x4e2e70=_0x52cbcc?_0x3430ee[_0xf226('0x1a')]:_0x1ec43d[_0xf226('0x18')]+_0x1ec43d[_0xf226('0x19')];var _0x4f4d54;if(_0x4e2e70>=_0x47e061){_0x4e2e70=_0x47e061;_0x4f4d54=0xc8;}else{_0x4f4d54=0xce;}_0x167e8f[_0xf226('0x15')](_0x4f4d54);return _0x167e8f[_0xf226('0x1b')]('Content-Range',_0x23e282+'-'+_0x4e2e70+'/'+_0x47e061)[_0xf226('0x17')](_0x3430ee);}return null;};}function patchUpdates(_0x4554bd){return function(_0x4caad9){try{jsonpatch[_0xf226('0x1c')](_0x4caad9,_0x4554bd,!![]);}catch(_0x42a9cd){return BPromise['reject'](_0x42a9cd);}return _0x4caad9[_0xf226('0x1d')]();};}function saveUpdates(_0x58917b,_0x54995f){return function(_0x5b752f){if(_0x5b752f){return _0x5b752f[_0xf226('0x1e')](_0x58917b)[_0xf226('0x1f')](function(_0xb6df2c){return _0xb6df2c;});}return null;};}function removeEntity(_0x55ae7f,_0x285b23){return function(_0x2d427f){if(_0x2d427f){return _0x2d427f[_0xf226('0x20')]()[_0xf226('0x1f')](function(){_0x55ae7f['status'](0xcc)[_0xf226('0x16')]();});}};}function handleEntityNotFound(_0x394407,_0x18db0a){return function(_0x462f64){if(!_0x462f64){_0x394407[_0xf226('0x14')](0x194);}return _0x462f64;};}function handleError(_0x308c6a,_0x4bab6e){_0x4bab6e=_0x4bab6e||0x1f4;return function(_0x1fb055){logger[_0xf226('0x21')](_0x1fb055[_0xf226('0x22')]);if(_0x1fb055[_0xf226('0x23')]){delete _0x1fb055[_0xf226('0x23')];}_0x308c6a[_0xf226('0x15')](_0x4bab6e)[_0xf226('0x24')](_0x1fb055);};}exports[_0xf226('0x25')]=function(_0x305ef5,_0x5a6932){var _0x4e4884={},_0x3bff2f={},_0x6f48d0={'count':0x0,'rows':[]};var _0x1bdde3=_[_0xf226('0x26')](db['SugarcrmAccount'][_0xf226('0x27')],function(_0x55cc8f){return{'name':_0x55cc8f['fieldName'],'type':_0x55cc8f['type']['key']};});_0x3bff2f[_0xf226('0x28')]=_[_0xf226('0x26')](_0x1bdde3,'name');_0x3bff2f['query']=_[_0xf226('0x29')](_0x305ef5[_0xf226('0x2a')]);_0x3bff2f[_0xf226('0x2b')]=_[_0xf226('0x2c')](_0x3bff2f['model'],_0x3bff2f[_0xf226('0x2a')]);_0x4e4884[_0xf226('0x2d')]=_[_0xf226('0x2c')](_0x3bff2f['model'],qs[_0xf226('0x2e')](_0x305ef5[_0xf226('0x2a')]['fields']));_0x4e4884[_0xf226('0x2d')]=_0x4e4884[_0xf226('0x2d')][_0xf226('0x2f')]?_0x4e4884[_0xf226('0x2d')]:_0x3bff2f[_0xf226('0x28')];if(!_0x305ef5[_0xf226('0x2a')][_0xf226('0x30')](_0xf226('0x31'))){_0x4e4884['limit']=qs[_0xf226('0x19')](_0x305ef5[_0xf226('0x2a')]['limit']);_0x4e4884['offset']=qs['offset'](_0x305ef5[_0xf226('0x2a')][_0xf226('0x18')]);}_0x4e4884[_0xf226('0x32')]=qs[_0xf226('0x33')](_0x305ef5[_0xf226('0x2a')][_0xf226('0x33')]);_0x4e4884['where']=qs[_0xf226('0x2b')](_[_0xf226('0x34')](_0x305ef5[_0xf226('0x2a')],_0x3bff2f[_0xf226('0x2b')]),_0x1bdde3);if(_0x305ef5[_0xf226('0x2a')]['filter']){_0x4e4884[_0xf226('0x35')]=_[_0xf226('0x36')](_0x4e4884['where'],{'$or':_['map'](_0x1bdde3,function(_0x4d011d){if(_0x4d011d['type']!==_0xf226('0x37')){var _0x47f6ea={};_0x47f6ea[_0x4d011d[_0xf226('0x23')]]={'$like':'%'+_0x305ef5[_0xf226('0x2a')][_0xf226('0x38')]+'%'};return _0x47f6ea;}})});}_0x4e4884=_[_0xf226('0x36')]({},_0x4e4884,_0x305ef5[_0xf226('0x39')]);var _0x4939c9={'where':_0x4e4884['where']};return db[_0xf226('0x3a')][_0xf226('0x1a')](_0x4939c9)[_0xf226('0x1f')](function(_0x5771cc){_0x6f48d0[_0xf226('0x1a')]=_0x5771cc;if(_0x305ef5[_0xf226('0x2a')][_0xf226('0x3b')]){_0x4e4884[_0xf226('0x3c')]=[{'all':!![]}];}return db[_0xf226('0x3a')][_0xf226('0x3d')](_0x4e4884);})['then'](function(_0x4071a7){_0x6f48d0[_0xf226('0x3e')]=_0x4071a7;return _0x6f48d0;})['then'](respondWithFilteredResult(_0x5a6932,_0x4e4884))[_0xf226('0x3f')](handleError(_0x5a6932,null));};exports[_0xf226('0x40')]=function(_0x552945,_0x31502c){var _0x2548dc={'raw':![],'where':{'id':_0x552945[_0xf226('0x41')]['id']}},_0x2ca994={};_0x2ca994[_0xf226('0x28')]=_[_0xf226('0x29')](db[_0xf226('0x3a')][_0xf226('0x27')]);_0x2ca994[_0xf226('0x2a')]=_[_0xf226('0x29')](_0x552945['query']);_0x2ca994[_0xf226('0x2b')]=_[_0xf226('0x2c')](_0x2ca994[_0xf226('0x28')],_0x2ca994[_0xf226('0x2a')]);_0x2548dc[_0xf226('0x2d')]=_['intersection'](_0x2ca994[_0xf226('0x28')],qs[_0xf226('0x2e')](_0x552945[_0xf226('0x2a')][_0xf226('0x2e')]));_0x2548dc['attributes']=_0x2548dc['attributes'][_0xf226('0x2f')]?_0x2548dc['attributes']:_0x2ca994[_0xf226('0x28')];if(_0x552945['query'][_0xf226('0x3b')]){_0x2548dc['include']=[{'all':!![]}];}_0x2548dc=_[_0xf226('0x36')]({},_0x2548dc,_0x552945['options']);return db[_0xf226('0x3a')][_0xf226('0x42')](_0x2548dc)[_0xf226('0x1f')](handleEntityNotFound(_0x31502c,null))[_0xf226('0x1f')](respondWithResult(_0x31502c,null))[_0xf226('0x3f')](handleError(_0x31502c,null));};exports[_0xf226('0x43')]=function(_0x13bd16,_0x1c79ce){return db[_0xf226('0x3a')]['create'](_0x13bd16[_0xf226('0x44')],{})[_0xf226('0x1f')](respondWithResult(_0x1c79ce,0xc9))[_0xf226('0x3f')](handleError(_0x1c79ce,null));};exports[_0xf226('0x1e')]=function(_0x480ca2,_0x16995e){if(_0x480ca2[_0xf226('0x44')]['id']){delete _0x480ca2[_0xf226('0x44')]['id'];}return db['SugarcrmAccount'][_0xf226('0x42')]({'where':{'id':_0x480ca2['params']['id']}})['then'](handleEntityNotFound(_0x16995e,null))['then'](saveUpdates(_0x480ca2['body'],null))[_0xf226('0x1f')](respondWithResult(_0x16995e,null))[_0xf226('0x3f')](handleError(_0x16995e,null));};exports[_0xf226('0x20')]=function(_0x19fd8a,_0x396af2){return db[_0xf226('0x3a')][_0xf226('0x42')]({'where':{'id':_0x19fd8a[_0xf226('0x41')]['id']}})[_0xf226('0x1f')](handleEntityNotFound(_0x396af2,null))[_0xf226('0x1f')](removeEntity(_0x396af2,null))[_0xf226('0x3f')](handleError(_0x396af2,null));};exports['getConfigurations']=function(_0x346dea,_0x251a48,_0x5598ac){var _0x22da18={};var _0x24990f={};var _0x5dc128;var _0x2536b8;return db[_0xf226('0x3a')]['findOne']({'where':{'id':_0x346dea[_0xf226('0x41')]['id']}})['then'](handleEntityNotFound(_0x251a48,null))['then'](function(_0x55592d){if(_0x55592d){_0x5dc128=_0x55592d;_0x24990f[_0xf226('0x28')]=_['keys'](db[_0xf226('0x45')][_0xf226('0x27')]);_0x24990f[_0xf226('0x2a')]=_['keys'](_0x346dea['query']);_0x24990f[_0xf226('0x2b')]=_[_0xf226('0x2c')](_0x24990f[_0xf226('0x28')],_0x24990f['query']);_0x22da18['attributes']=_['intersection'](_0x24990f['model'],qs[_0xf226('0x2e')](_0x346dea[_0xf226('0x2a')][_0xf226('0x2e')]));_0x22da18[_0xf226('0x2d')]=_0x22da18[_0xf226('0x2d')][_0xf226('0x2f')]?_0x22da18[_0xf226('0x2d')]:_0x24990f[_0xf226('0x28')];_0x22da18['order']=qs['sort'](_0x346dea[_0xf226('0x2a')][_0xf226('0x33')]);_0x22da18[_0xf226('0x35')]=qs[_0xf226('0x2b')](_[_0xf226('0x34')](_0x346dea[_0xf226('0x2a')],_0x24990f[_0xf226('0x2b')]));if(_0x346dea[_0xf226('0x2a')][_0xf226('0x38')]){_0x22da18[_0xf226('0x35')]=_['merge'](_0x22da18[_0xf226('0x35')],{'$or':_[_0xf226('0x26')](_0x22da18[_0xf226('0x2d')],function(_0x33e225){var _0x3e5a03={};_0x3e5a03[_0x33e225]={'$like':'%'+_0x346dea[_0xf226('0x2a')][_0xf226('0x38')]+'%'};return _0x3e5a03;})});}_0x22da18=_['merge']({},_0x22da18,_0x346dea[_0xf226('0x39')]);return _0x5dc128[_0xf226('0x46')](_0x22da18);}})[_0xf226('0x1f')](function(_0x52320d){if(_0x52320d){_0x2536b8=_0x52320d[_0xf226('0x2f')];if(!_0x346dea[_0xf226('0x2a')][_0xf226('0x30')](_0xf226('0x31'))){_0x22da18[_0xf226('0x19')]=qs[_0xf226('0x19')](_0x346dea['query'][_0xf226('0x19')]);_0x22da18[_0xf226('0x18')]=qs['offset'](_0x346dea[_0xf226('0x2a')][_0xf226('0x18')]);}return _0x5dc128[_0xf226('0x46')](_0x22da18);}})[_0xf226('0x1f')](function(_0x575990){if(_0x575990){return _0x575990?{'count':_0x2536b8,'rows':_0x575990}:null;}})[_0xf226('0x1f')](respondWithResult(_0x251a48,null))[_0xf226('0x3f')](handleError(_0x251a48,null));};exports[_0xf226('0x47')]=function(_0x549a44,_0x4f2e53,_0x2db55b){if(_0x549a44[_0xf226('0x44')]['id']){delete _0x549a44[_0xf226('0x44')]['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x549a44[_0xf226('0x41')]['id']}})[_0xf226('0x1f')](handleEntityNotFound(_0x4f2e53,null))[_0xf226('0x1f')](function(_0x27bd9a){if(_0x27bd9a){_0x549a44[_0xf226('0x44')][_0xf226('0x48')]=_0x27bd9a['id'];_0x549a44[_0xf226('0x44')][_0xf226('0x49')]=integrations['getSubjects'](_0x549a44[_0xf226('0x44')][_0xf226('0x4a')],_0x549a44[_0xf226('0x44')]['type']);_0x549a44[_0xf226('0x44')][_0xf226('0x4b')]=integrations[_0xf226('0x4c')](_0x549a44[_0xf226('0x44')][_0xf226('0x4a')],_0x549a44[_0xf226('0x44')][_0xf226('0x4d')]);return db[_0xf226('0x45')][_0xf226('0x43')](_0x549a44[_0xf226('0x44')],{'include':[{'model':db['SugarcrmField'],'as':_0xf226('0x49')},{'model':db['SugarcrmField'],'as':_0xf226('0x4b')}]});}return null;})[_0xf226('0x1f')](respondWithResult(_0x4f2e53,null))['catch'](handleError(_0x4f2e53,null));};exports[_0xf226('0x4e')]=function(_0x156a99,_0x4b5961,_0x25e994){var _0x2d489f='';var _0x4380ba=['id',_0xf226('0x23'),_0xf226('0x4f'),_0xf226('0x50'),_0xf226('0x51'),'date_start','duration_hours',_0xf226('0x52'),_0xf226('0x53'),_0xf226('0x54'),'parent_name',_0xf226('0x55')];return db['SugarcrmAccount'][_0xf226('0x56')]({'where':{'id':_0x156a99[_0xf226('0x41')]['id']},'attributes':['id',_0xf226('0x57'),_0xf226('0x58'),'remoteUri']})[_0xf226('0x1f')](handleEntityNotFound(_0x4b5961,null))[_0xf226('0x1f')](function(_0x550447){if(_0x550447){_0x2d489f=_0x550447['remoteUri'];var _0x1f68dd=_0x2d489f[_0xf226('0x59')](-0x1);if(_0x1f68dd==='/'){_0x2d489f=_0x2d489f['substring'](0x0,_0x2d489f[_0xf226('0x5a')](_0x1f68dd));}return rp({'method':_0xf226('0x5b'),'uri':util[_0xf226('0x5c')](_0xf226('0x5d'),_0x2d489f,_0xf226('0x5e')),'json':!![],'form':{'method':_0xf226('0x5f'),'input_type':_0xf226('0x60'),'response_type':_0xf226('0x60'),'rest_data':JSON[_0xf226('0x61')]({'user_auth':{'user_name':_0x550447['username'],'password':_0x550447[_0xf226('0x58')],'encryption':_0xf226('0x62')},'application':_0xf226('0x63')})}});}})[_0xf226('0x1f')](function(_0x42a1fb){if(_0x42a1fb&&_0x42a1fb[_0xf226('0x23')]!==_0xf226('0x64')&&_0x42a1fb[_0xf226('0x23')]!==_0xf226('0x65')){return rp({'method':_0xf226('0x5b'),'uri':util[_0xf226('0x5c')]('%s%s',_0x2d489f,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xf226('0x60'),'response_type':_0xf226('0x60'),'rest_data':JSON[_0xf226('0x61')]({'session':_0x42a1fb['id'],'module_name':_0xf226('0x66')})}})[_0xf226('0x1f')](function(_0x4e80ee){if(_0x4e80ee){var _0x13042d=_[_0xf226('0x67')](_0x4e80ee['module_fields']);_['remove'](_0x13042d,function(_0x32f909){return _0x4380ba[_0xf226('0x68')](_0x32f909[_0xf226('0x23')]);});return{'count':_0x13042d[_0xf226('0x2f')],'rows':_[_0xf226('0x26')](_0x13042d,function(_0x2ecac7){return{'id':_0x2ecac7[_0xf226('0x23')],'name':_0x2ecac7[_0xf226('0x69')],'custom':_[_0xf226('0x6a')](_0x2ecac7[_0xf226('0x23')],'_c')?!![]:![],'options':_0x2ecac7['options']?_[_0xf226('0x26')](_[_0xf226('0x67')](_0x2ecac7[_0xf226('0x39')]),function(_0x50b402){return{'name':_0x50b402[_0xf226('0x6b')],'value':_0x50b402[_0xf226('0x23')]};}):[]};})};}})[_0xf226('0x1f')](respondWithResult(_0x4b5961,null))['catch'](function(_0x4182b1){var _0x31f827=_0x156a99[_0xf226('0x2a')]['test']?0x1f4:_0x4182b1[_0xf226('0x6c')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x31f827,JSON['stringify'](_0x4182b1));delete _0x4182b1[_0xf226('0x23')];if(_0x31f827===0x191){_0x31f827=0x190;}_0x4b5961[_0xf226('0x15')](_0x31f827)[_0xf226('0x24')](_0x156a99[_0xf226('0x2a')][_0xf226('0x6d')]?{'message':_0xf226('0x6e'),'statusCode':_0x4182b1[_0xf226('0x6c')]}:_0x4182b1);});}else{var _0x5ef9d6=0x1f4;_0x4b5961[_0xf226('0x15')](_0x5ef9d6)[_0xf226('0x24')]({'message':_0xf226('0x6e'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xe8d3=['findOne','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmConfiguration','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','direction','username','password','remoteUri','slice','substring','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','POST','get_module_fields','values','module_fields','remove','label','endsWith','value','test','statusCode','error','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','mustache','util','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','getConfigurations'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe8d3,0x176));var _0x3e8d=function(_0x2ac6ca,_0x25564d){_0x2ac6ca=_0x2ac6ca-0x0;var _0x681361=_0xe8d3[_0x2ac6ca];return _0x681361;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e8d('0x0'));var zipdir=require(_0x3e8d('0x1'));var jsonpatch=require(_0x3e8d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3e8d('0x3'));var util=require(_0x3e8d('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3e8d('0x5'));var fs=require('fs');var fs_extra=require(_0x3e8d('0x6'));var _=require(_0x3e8d('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3e8d('0x8'));var toCsv=require('to-csv');var querystring=require(_0x3e8d('0x9'));var Papa=require(_0x3e8d('0xa'));var Redis=require('ioredis');var authService=require(_0x3e8d('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x3e8d('0xc'));var hardwareService=require(_0x3e8d('0xd'));var logger=require(_0x3e8d('0xe'))(_0x3e8d('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3e8d('0x10'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x382f0f,_0x4271dd){_0x4271dd=_0x4271dd||0xcc;return function(_0x20b4cb){if(_0x20b4cb){return _0x382f0f[_0x3e8d('0x11')](_0x4271dd);}return _0x382f0f['status'](_0x4271dd)[_0x3e8d('0x12')]();};}function respondWithResult(_0x2c7d8e,_0x5d31c7){_0x5d31c7=_0x5d31c7||0xc8;return function(_0x4d62a3){if(_0x4d62a3){return _0x2c7d8e[_0x3e8d('0x13')](_0x5d31c7)[_0x3e8d('0x14')](_0x4d62a3);}};}function respondWithFilteredResult(_0x158ef8,_0x7b8ac9){return function(_0x575e8d){if(_0x575e8d){var _0x2a467b=typeof _0x7b8ac9[_0x3e8d('0x15')]===_0x3e8d('0x16')&&typeof _0x7b8ac9['limit']==='undefined';var _0x31781d=_0x575e8d[_0x3e8d('0x17')];var _0x23d5ff=_0x2a467b?0x0:_0x7b8ac9[_0x3e8d('0x15')];var _0x336f5c=_0x2a467b?_0x575e8d[_0x3e8d('0x17')]:_0x7b8ac9['offset']+_0x7b8ac9[_0x3e8d('0x18')];var _0x12cbf4;if(_0x336f5c>=_0x31781d){_0x336f5c=_0x31781d;_0x12cbf4=0xc8;}else{_0x12cbf4=0xce;}_0x158ef8['status'](_0x12cbf4);return _0x158ef8[_0x3e8d('0x19')](_0x3e8d('0x1a'),_0x23d5ff+'-'+_0x336f5c+'/'+_0x31781d)[_0x3e8d('0x14')](_0x575e8d);}return null;};}function patchUpdates(_0x1e2dde){return function(_0x2bc0f9){try{jsonpatch[_0x3e8d('0x1b')](_0x2bc0f9,_0x1e2dde,!![]);}catch(_0x26140a){return BPromise[_0x3e8d('0x1c')](_0x26140a);}return _0x2bc0f9[_0x3e8d('0x1d')]();};}function saveUpdates(_0x381117,_0x3caad8){return function(_0x8cd8d7){if(_0x8cd8d7){return _0x8cd8d7[_0x3e8d('0x1e')](_0x381117)[_0x3e8d('0x1f')](function(_0x3d7f9d){return _0x3d7f9d;});}return null;};}function removeEntity(_0x5cf75e,_0x5734c6){return function(_0x2982fd){if(_0x2982fd){return _0x2982fd[_0x3e8d('0x20')]()[_0x3e8d('0x1f')](function(){_0x5cf75e[_0x3e8d('0x13')](0xcc)[_0x3e8d('0x12')]();});}};}function handleEntityNotFound(_0x189ca5,_0xfd539b){return function(_0x34ce65){if(!_0x34ce65){_0x189ca5[_0x3e8d('0x11')](0x194);}return _0x34ce65;};}function handleError(_0x1d1e3d,_0x1b3e22){_0x1b3e22=_0x1b3e22||0x1f4;return function(_0x22eb7e){logger['error'](_0x22eb7e['stack']);if(_0x22eb7e[_0x3e8d('0x21')]){delete _0x22eb7e[_0x3e8d('0x21')];}_0x1d1e3d[_0x3e8d('0x13')](_0x1b3e22)[_0x3e8d('0x22')](_0x22eb7e);};}exports['index']=function(_0x5398c5,_0x224e97){var _0x595e51={},_0x5909b2={},_0x458366={'count':0x0,'rows':[]};var _0x3e92ce=_['map'](db[_0x3e8d('0x23')][_0x3e8d('0x24')],function(_0x23fc6f){return{'name':_0x23fc6f[_0x3e8d('0x25')],'type':_0x23fc6f[_0x3e8d('0x26')][_0x3e8d('0x27')]};});_0x5909b2[_0x3e8d('0x28')]=_[_0x3e8d('0x29')](_0x3e92ce,_0x3e8d('0x21'));_0x5909b2['query']=_['keys'](_0x5398c5[_0x3e8d('0x2a')]);_0x5909b2['filters']=_[_0x3e8d('0x2b')](_0x5909b2['model'],_0x5909b2[_0x3e8d('0x2a')]);_0x595e51[_0x3e8d('0x2c')]=_[_0x3e8d('0x2b')](_0x5909b2[_0x3e8d('0x28')],qs[_0x3e8d('0x2d')](_0x5398c5[_0x3e8d('0x2a')][_0x3e8d('0x2d')]));_0x595e51['attributes']=_0x595e51[_0x3e8d('0x2c')][_0x3e8d('0x2e')]?_0x595e51[_0x3e8d('0x2c')]:_0x5909b2['model'];if(!_0x5398c5[_0x3e8d('0x2a')][_0x3e8d('0x2f')]('nolimit')){_0x595e51['limit']=qs[_0x3e8d('0x18')](_0x5398c5['query'][_0x3e8d('0x18')]);_0x595e51[_0x3e8d('0x15')]=qs[_0x3e8d('0x15')](_0x5398c5[_0x3e8d('0x2a')][_0x3e8d('0x15')]);}_0x595e51['order']=qs[_0x3e8d('0x30')](_0x5398c5[_0x3e8d('0x2a')][_0x3e8d('0x30')]);_0x595e51[_0x3e8d('0x31')]=qs[_0x3e8d('0x32')](_['pick'](_0x5398c5[_0x3e8d('0x2a')],_0x5909b2[_0x3e8d('0x32')]),_0x3e92ce);if(_0x5398c5[_0x3e8d('0x2a')][_0x3e8d('0x33')]){_0x595e51['where']=_[_0x3e8d('0x34')](_0x595e51[_0x3e8d('0x31')],{'$or':_[_0x3e8d('0x29')](_0x3e92ce,function(_0x5b1be7){if(_0x5b1be7[_0x3e8d('0x26')]!=='VIRTUAL'){var _0x3f8f5b={};_0x3f8f5b[_0x5b1be7[_0x3e8d('0x21')]]={'$like':'%'+_0x5398c5[_0x3e8d('0x2a')]['filter']+'%'};return _0x3f8f5b;}})});}_0x595e51=_['merge']({},_0x595e51,_0x5398c5[_0x3e8d('0x35')]);var _0x15ae23={'where':_0x595e51[_0x3e8d('0x31')]};return db[_0x3e8d('0x23')][_0x3e8d('0x17')](_0x15ae23)[_0x3e8d('0x1f')](function(_0x4f72e3){_0x458366[_0x3e8d('0x17')]=_0x4f72e3;if(_0x5398c5[_0x3e8d('0x2a')][_0x3e8d('0x36')]){_0x595e51[_0x3e8d('0x37')]=[{'all':!![]}];}return db[_0x3e8d('0x23')][_0x3e8d('0x38')](_0x595e51);})['then'](function(_0x67b539){_0x458366[_0x3e8d('0x39')]=_0x67b539;return _0x458366;})[_0x3e8d('0x1f')](respondWithFilteredResult(_0x224e97,_0x595e51))['catch'](handleError(_0x224e97,null));};exports[_0x3e8d('0x3a')]=function(_0x2294fd,_0x5e223e){var _0x5723d7={'raw':![],'where':{'id':_0x2294fd[_0x3e8d('0x3b')]['id']}},_0x259c34={};_0x259c34[_0x3e8d('0x28')]=_['keys'](db[_0x3e8d('0x23')][_0x3e8d('0x24')]);_0x259c34[_0x3e8d('0x2a')]=_[_0x3e8d('0x3c')](_0x2294fd[_0x3e8d('0x2a')]);_0x259c34[_0x3e8d('0x32')]=_[_0x3e8d('0x2b')](_0x259c34[_0x3e8d('0x28')],_0x259c34[_0x3e8d('0x2a')]);_0x5723d7['attributes']=_[_0x3e8d('0x2b')](_0x259c34[_0x3e8d('0x28')],qs[_0x3e8d('0x2d')](_0x2294fd[_0x3e8d('0x2a')][_0x3e8d('0x2d')]));_0x5723d7[_0x3e8d('0x2c')]=_0x5723d7[_0x3e8d('0x2c')][_0x3e8d('0x2e')]?_0x5723d7['attributes']:_0x259c34[_0x3e8d('0x28')];if(_0x2294fd[_0x3e8d('0x2a')][_0x3e8d('0x36')]){_0x5723d7[_0x3e8d('0x37')]=[{'all':!![]}];}_0x5723d7=_['merge']({},_0x5723d7,_0x2294fd[_0x3e8d('0x35')]);return db[_0x3e8d('0x23')][_0x3e8d('0x3d')](_0x5723d7)[_0x3e8d('0x1f')](handleEntityNotFound(_0x5e223e,null))[_0x3e8d('0x1f')](respondWithResult(_0x5e223e,null))[_0x3e8d('0x3e')](handleError(_0x5e223e,null));};exports['create']=function(_0x15fc1,_0x583e25){return db[_0x3e8d('0x23')][_0x3e8d('0x3f')](_0x15fc1[_0x3e8d('0x40')],{})[_0x3e8d('0x1f')](respondWithResult(_0x583e25,0xc9))[_0x3e8d('0x3e')](handleError(_0x583e25,null));};exports[_0x3e8d('0x1e')]=function(_0x20c9f4,_0x4d8ceb){if(_0x20c9f4[_0x3e8d('0x40')]['id']){delete _0x20c9f4[_0x3e8d('0x40')]['id'];}return db['SugarcrmAccount'][_0x3e8d('0x3d')]({'where':{'id':_0x20c9f4[_0x3e8d('0x3b')]['id']}})[_0x3e8d('0x1f')](handleEntityNotFound(_0x4d8ceb,null))[_0x3e8d('0x1f')](saveUpdates(_0x20c9f4[_0x3e8d('0x40')],null))[_0x3e8d('0x1f')](respondWithResult(_0x4d8ceb,null))[_0x3e8d('0x3e')](handleError(_0x4d8ceb,null));};exports[_0x3e8d('0x20')]=function(_0xb26b0d,_0x9ecf9){return db[_0x3e8d('0x23')]['find']({'where':{'id':_0xb26b0d[_0x3e8d('0x3b')]['id']}})[_0x3e8d('0x1f')](handleEntityNotFound(_0x9ecf9,null))['then'](removeEntity(_0x9ecf9,null))[_0x3e8d('0x3e')](handleError(_0x9ecf9,null));};exports[_0x3e8d('0x41')]=function(_0x326ec5,_0x403e65,_0x560539){var _0x2ce636={};var _0x21576f={};var _0x97e5e7;var _0x33b774;return db[_0x3e8d('0x23')][_0x3e8d('0x42')]({'where':{'id':_0x326ec5['params']['id']}})['then'](handleEntityNotFound(_0x403e65,null))['then'](function(_0x236423){if(_0x236423){_0x97e5e7=_0x236423;_0x21576f['model']=_[_0x3e8d('0x3c')](db['SugarcrmConfiguration'][_0x3e8d('0x24')]);_0x21576f[_0x3e8d('0x2a')]=_[_0x3e8d('0x3c')](_0x326ec5[_0x3e8d('0x2a')]);_0x21576f[_0x3e8d('0x32')]=_[_0x3e8d('0x2b')](_0x21576f[_0x3e8d('0x28')],_0x21576f[_0x3e8d('0x2a')]);_0x2ce636[_0x3e8d('0x2c')]=_[_0x3e8d('0x2b')](_0x21576f['model'],qs[_0x3e8d('0x2d')](_0x326ec5[_0x3e8d('0x2a')][_0x3e8d('0x2d')]));_0x2ce636[_0x3e8d('0x2c')]=_0x2ce636[_0x3e8d('0x2c')]['length']?_0x2ce636['attributes']:_0x21576f[_0x3e8d('0x28')];_0x2ce636['order']=qs['sort'](_0x326ec5['query'][_0x3e8d('0x30')]);_0x2ce636[_0x3e8d('0x31')]=qs[_0x3e8d('0x32')](_['pick'](_0x326ec5[_0x3e8d('0x2a')],_0x21576f[_0x3e8d('0x32')]));if(_0x326ec5[_0x3e8d('0x2a')][_0x3e8d('0x33')]){_0x2ce636[_0x3e8d('0x31')]=_['merge'](_0x2ce636[_0x3e8d('0x31')],{'$or':_[_0x3e8d('0x29')](_0x2ce636['attributes'],function(_0x17d817){var _0x3e6ca4={};_0x3e6ca4[_0x17d817]={'$like':'%'+_0x326ec5[_0x3e8d('0x2a')][_0x3e8d('0x33')]+'%'};return _0x3e6ca4;})});}_0x2ce636=_['merge']({},_0x2ce636,_0x326ec5['options']);return _0x97e5e7[_0x3e8d('0x41')](_0x2ce636);}})[_0x3e8d('0x1f')](function(_0x885616){if(_0x885616){_0x33b774=_0x885616[_0x3e8d('0x2e')];if(!_0x326ec5[_0x3e8d('0x2a')][_0x3e8d('0x2f')](_0x3e8d('0x43'))){_0x2ce636[_0x3e8d('0x18')]=qs[_0x3e8d('0x18')](_0x326ec5[_0x3e8d('0x2a')][_0x3e8d('0x18')]);_0x2ce636[_0x3e8d('0x15')]=qs[_0x3e8d('0x15')](_0x326ec5[_0x3e8d('0x2a')][_0x3e8d('0x15')]);}return _0x97e5e7[_0x3e8d('0x41')](_0x2ce636);}})['then'](function(_0x3eac0f){if(_0x3eac0f){return _0x3eac0f?{'count':_0x33b774,'rows':_0x3eac0f}:null;}})[_0x3e8d('0x1f')](respondWithResult(_0x403e65,null))[_0x3e8d('0x3e')](handleError(_0x403e65,null));};exports[_0x3e8d('0x44')]=function(_0x18139e,_0x4760e1,_0x1ed7b1){if(_0x18139e[_0x3e8d('0x40')]['id']){delete _0x18139e[_0x3e8d('0x40')]['id'];}return db[_0x3e8d('0x23')]['findOne']({'where':{'id':_0x18139e['params']['id']}})[_0x3e8d('0x1f')](handleEntityNotFound(_0x4760e1,null))[_0x3e8d('0x1f')](function(_0x4c6b68){if(_0x4c6b68){_0x18139e[_0x3e8d('0x40')][_0x3e8d('0x45')]=_0x4c6b68['id'];_0x18139e[_0x3e8d('0x40')][_0x3e8d('0x46')]=integrations[_0x3e8d('0x47')](_0x18139e[_0x3e8d('0x40')][_0x3e8d('0x48')],_0x18139e['body'][_0x3e8d('0x26')]);_0x18139e['body']['Descriptions']=integrations[_0x3e8d('0x49')](_0x18139e[_0x3e8d('0x40')][_0x3e8d('0x48')],_0x18139e[_0x3e8d('0x40')][_0x3e8d('0x26')]);return db[_0x3e8d('0x4a')]['create'](_0x18139e[_0x3e8d('0x40')],{'include':[{'model':db['SugarcrmField'],'as':_0x3e8d('0x46')},{'model':db['SugarcrmField'],'as':_0x3e8d('0x4b')}]});}return null;})['then'](respondWithResult(_0x4760e1,null))[_0x3e8d('0x3e')](handleError(_0x4760e1,null));};exports[_0x3e8d('0x4c')]=function(_0x364d61,_0x5cd8a4,_0x434193){var _0x134b20='';var _0x32280e=['id',_0x3e8d('0x21'),_0x3e8d('0x4d'),_0x3e8d('0x4e'),_0x3e8d('0x4f'),_0x3e8d('0x50'),'duration_hours',_0x3e8d('0x51'),_0x3e8d('0x52'),'parent_type','parent_name',_0x3e8d('0x53')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x364d61[_0x3e8d('0x3b')]['id']},'attributes':['id',_0x3e8d('0x54'),_0x3e8d('0x55'),_0x3e8d('0x56')]})[_0x3e8d('0x1f')](handleEntityNotFound(_0x5cd8a4,null))[_0x3e8d('0x1f')](function(_0x487e99){if(_0x487e99){_0x134b20=_0x487e99[_0x3e8d('0x56')];var _0x5bb7b7=_0x134b20[_0x3e8d('0x57')](-0x1);if(_0x5bb7b7==='/'){_0x134b20=_0x134b20[_0x3e8d('0x58')](0x0,_0x134b20['lastIndexOf'](_0x5bb7b7));}return rp({'method':'POST','uri':util[_0x3e8d('0x59')](_0x3e8d('0x5a'),_0x134b20,_0x3e8d('0x5b')),'json':!![],'form':{'method':_0x3e8d('0x5c'),'input_type':_0x3e8d('0x5d'),'response_type':_0x3e8d('0x5d'),'rest_data':JSON[_0x3e8d('0x5e')]({'user_auth':{'user_name':_0x487e99[_0x3e8d('0x54')],'password':_0x487e99[_0x3e8d('0x55')],'encryption':_0x3e8d('0x5f')},'application':_0x3e8d('0x60')})}});}})[_0x3e8d('0x1f')](function(_0x43e59c){if(_0x43e59c&&_0x43e59c[_0x3e8d('0x21')]!=='Invalid\x20Login'&&_0x43e59c[_0x3e8d('0x21')]!==_0x3e8d('0x61')){return rp({'method':_0x3e8d('0x62'),'uri':util[_0x3e8d('0x59')](_0x3e8d('0x5a'),_0x134b20,_0x3e8d('0x5b')),'json':!![],'form':{'method':_0x3e8d('0x63'),'input_type':_0x3e8d('0x5d'),'response_type':'JSON','rest_data':JSON[_0x3e8d('0x5e')]({'session':_0x43e59c['id'],'module_name':'Calls'})}})[_0x3e8d('0x1f')](function(_0x2eac2f){if(_0x2eac2f){var _0x13a648=_[_0x3e8d('0x64')](_0x2eac2f[_0x3e8d('0x65')]);_[_0x3e8d('0x66')](_0x13a648,function(_0x47d08e){return _0x32280e['includes'](_0x47d08e[_0x3e8d('0x21')]);});return{'count':_0x13a648['length'],'rows':_[_0x3e8d('0x29')](_0x13a648,function(_0x3aa006){return{'id':_0x3aa006[_0x3e8d('0x21')],'name':_0x3aa006[_0x3e8d('0x67')],'custom':_[_0x3e8d('0x68')](_0x3aa006[_0x3e8d('0x21')],'_c')?!![]:![],'options':_0x3aa006[_0x3e8d('0x35')]?_[_0x3e8d('0x29')](_[_0x3e8d('0x64')](_0x3aa006[_0x3e8d('0x35')]),function(_0x31a2d5){return{'name':_0x31a2d5[_0x3e8d('0x69')],'value':_0x31a2d5[_0x3e8d('0x21')]};}):[]};})};}})['then'](respondWithResult(_0x5cd8a4,null))[_0x3e8d('0x3e')](function(_0x5ed7b9){var _0x59ad66=_0x364d61[_0x3e8d('0x2a')][_0x3e8d('0x6a')]?0x1f4:_0x5ed7b9[_0x3e8d('0x6b')]||0x1f4;logger[_0x3e8d('0x6c')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x59ad66,JSON[_0x3e8d('0x5e')](_0x5ed7b9));delete _0x5ed7b9[_0x3e8d('0x21')];if(_0x59ad66===0x191){_0x59ad66=0x190;}_0x5cd8a4[_0x3e8d('0x13')](_0x59ad66)[_0x3e8d('0x22')](_0x364d61[_0x3e8d('0x2a')][_0x3e8d('0x6a')]?{'message':_0x3e8d('0x6d'),'statusCode':_0x5ed7b9['statusCode']}:_0x5ed7b9);});}else{var _0x1483bf=0x1f4;_0x5cd8a4[_0x3e8d('0x13')](_0x1483bf)[_0x3e8d('0x22')]({'message':_0x3e8d('0x6d'),'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 6711678..dd2abee 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 _0x2906=['rimraf','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','bluebird','request-promise','path'];(function(_0x2a4209,_0x2de4fe){var _0x1edd1c=function(_0x51dfac){while(--_0x51dfac){_0x2a4209['push'](_0x2a4209['shift']());}};_0x1edd1c(++_0x2de4fe);}(_0x2906,0xe0));var _0x6290=function(_0x15af2f,_0x3c0a01){_0x15af2f=_0x15af2f-0x0;var _0x359239=_0x2906[_0x15af2f];return _0x359239;};'use strict';var _=require(_0x6290('0x0'));var util=require(_0x6290('0x1'));var logger=require('../../config/logger')(_0x6290('0x2'));var moment=require('moment');var BPromise=require(_0x6290('0x3'));var rp=require(_0x6290('0x4'));var fs=require('fs');var path=require(_0x6290('0x5'));var rimraf=require(_0x6290('0x6'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x6290('0x7')]=function(_0x55ce99,_0x3467a9){return _0x55ce99['define'](_0x6290('0x8'),attributes,{'tableName':_0x6290('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9beb=['int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9beb,0x151));var _0xb9be=function(_0x4badbc,_0x4457e9){_0x4badbc=_0x4badbc-0x0;var _0x518450=_0x9beb[_0x4badbc];return _0x518450;};'use strict';var _=require(_0xb9be('0x0'));var util=require(_0xb9be('0x1'));var logger=require(_0xb9be('0x2'))(_0xb9be('0x3'));var moment=require(_0xb9be('0x4'));var BPromise=require(_0xb9be('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9be('0x6'));var rimraf=require('rimraf');var config=require(_0xb9be('0x7'));var attributes=require(_0xb9be('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xb9be('0x9')]=function(_0x40012c,_0x344a98){return _0x40012c['define'](_0xb9be('0xa'),attributes,{'tableName':_0xb9be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 8899607..0b4f449 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 _0xa038=['ShowSugarcrmAccount','where','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SugarcrmAccount','findAll','options','raw','attributes','limit','include','map','model','GetSugarcrmAccount','debug'];(function(_0x1a545b,_0x5a9a8e){var _0x3ccd0b=function(_0x1ee327){while(--_0x1ee327){_0x1a545b['push'](_0x1a545b['shift']());}};_0x3ccd0b(++_0x5a9a8e);}(_0xa038,0x1f1));var _0x8a03=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xa038[_0x172747];return _0x509692;};'use strict';var _=require(_0x8a03('0x0'));var util=require(_0x8a03('0x1'));var moment=require(_0x8a03('0x2'));var BPromise=require(_0x8a03('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a03('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a03('0x5'));var logger=require(_0x8a03('0x6'))(_0x8a03('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a03('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22776f,_0x337b77,_0x34365e){return new BPromise(function(_0x1b8b8e,_0x5a3ab6){return client['request'](_0x22776f,_0x34365e)[_0x8a03('0x9')](function(_0x16b02c){logger[_0x8a03('0xa')](_0x8a03('0xb'),_0x337b77,_0x8a03('0xc'));logger['debug'](_0x8a03('0xd'),_0x337b77,_0x8a03('0xc'),JSON[_0x8a03('0xe')](_0x16b02c));if(_0x16b02c[_0x8a03('0xf')]){if(_0x16b02c[_0x8a03('0xf')][_0x8a03('0x10')]===0x1f4){logger[_0x8a03('0xf')](_0x8a03('0xb'),_0x337b77,_0x16b02c[_0x8a03('0xf')][_0x8a03('0x11')]);return _0x5a3ab6(_0x16b02c[_0x8a03('0xf')]['message']);}logger[_0x8a03('0xf')](_0x8a03('0xb'),_0x337b77,_0x16b02c['error'][_0x8a03('0x11')]);return _0x1b8b8e(_0x16b02c[_0x8a03('0xf')]['message']);}else{logger[_0x8a03('0xa')](_0x8a03('0xb'),_0x337b77,_0x8a03('0xc'));_0x1b8b8e(_0x16b02c[_0x8a03('0x12')][_0x8a03('0x11')]);}})[_0x8a03('0x13')](function(_0x13d9f4){logger[_0x8a03('0xf')](_0x8a03('0xb'),_0x337b77,_0x13d9f4);_0x5a3ab6(_0x13d9f4);});});}exports['GetSugarcrmAccount']=function(_0x2c8118){var _0x388325=this;return new Promise(function(_0x57049b,_0x4a906e){return db[_0x8a03('0x14')][_0x8a03('0x15')]({'raw':_0x2c8118[_0x8a03('0x16')]?_0x2c8118[_0x8a03('0x16')][_0x8a03('0x17')]===undefined?!![]:![]:!![],'where':_0x2c8118[_0x8a03('0x16')]?_0x2c8118[_0x8a03('0x16')]['where']||null:null,'attributes':_0x2c8118[_0x8a03('0x16')]?_0x2c8118[_0x8a03('0x16')][_0x8a03('0x18')]||null:null,'limit':_0x2c8118[_0x8a03('0x16')]?_0x2c8118['options'][_0x8a03('0x19')]||null:null,'include':_0x2c8118[_0x8a03('0x16')]?_0x2c8118[_0x8a03('0x16')][_0x8a03('0x1a')]?_['map'](_0x2c8118[_0x8a03('0x16')]['include'],function(_0x1140b8){return{'model':db[_0x1140b8['model']],'as':_0x1140b8['as'],'attributes':_0x1140b8[_0x8a03('0x18')],'include':_0x1140b8[_0x8a03('0x1a')]?_[_0x8a03('0x1b')](_0x1140b8['include'],function(_0x204b80){return{'model':db[_0x204b80[_0x8a03('0x1c')]],'as':_0x204b80['as'],'attributes':_0x204b80['attributes'],'include':_0x204b80['include']?_[_0x8a03('0x1b')](_0x204b80[_0x8a03('0x1a')],function(_0x1bfc99){return{'model':db[_0x1bfc99[_0x8a03('0x1c')]],'as':_0x1bfc99['as'],'attributes':_0x1bfc99[_0x8a03('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8a03('0x9')](function(_0x1d182d){logger[_0x8a03('0xa')](_0x8a03('0x1d'),_0x2c8118);logger[_0x8a03('0x1e')]('GetSugarcrmAccount',_0x2c8118,JSON[_0x8a03('0xe')](_0x1d182d));_0x57049b(_0x1d182d);})[_0x8a03('0x13')](function(_0x4ef0e6){logger[_0x8a03('0xf')](_0x8a03('0x1d'),_0x4ef0e6[_0x8a03('0x11')],_0x2c8118);_0x4a906e(_0x388325[_0x8a03('0xf')](0x1f4,_0x4ef0e6[_0x8a03('0x11')]));});});};exports[_0x8a03('0x1f')]=function(_0x484ae9){var _0x3d41c8=this;return new Promise(function(_0x1cd942,_0x418c85){return db[_0x8a03('0x14')]['find']({'raw':_0x484ae9[_0x8a03('0x16')]?_0x484ae9[_0x8a03('0x16')][_0x8a03('0x17')]===undefined?!![]:![]:!![],'where':_0x484ae9['options']?_0x484ae9['options'][_0x8a03('0x20')]||null:null,'attributes':_0x484ae9[_0x8a03('0x16')]?_0x484ae9[_0x8a03('0x16')][_0x8a03('0x18')]||null:null,'include':_0x484ae9[_0x8a03('0x16')]?_0x484ae9[_0x8a03('0x16')][_0x8a03('0x1a')]?_[_0x8a03('0x1b')](_0x484ae9[_0x8a03('0x16')]['include'],function(_0x5c083c){return{'model':db[_0x5c083c[_0x8a03('0x1c')]],'as':_0x5c083c['as'],'attributes':_0x5c083c['attributes'],'include':_0x5c083c[_0x8a03('0x1a')]?_[_0x8a03('0x1b')](_0x5c083c[_0x8a03('0x1a')],function(_0x2b7856){return{'model':db[_0x2b7856[_0x8a03('0x1c')]],'as':_0x2b7856['as'],'attributes':_0x2b7856[_0x8a03('0x18')],'include':_0x2b7856[_0x8a03('0x1a')]?_['map'](_0x2b7856['include'],function(_0x5def17){return{'model':db[_0x5def17[_0x8a03('0x1c')]],'as':_0x5def17['as'],'attributes':_0x5def17[_0x8a03('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8a03('0x9')](function(_0x28d5cc){logger[_0x8a03('0xa')]('ShowSugarcrmAccount',_0x484ae9);logger['debug'](_0x8a03('0x1f'),_0x484ae9,JSON[_0x8a03('0xe')](_0x28d5cc));_0x1cd942(_0x28d5cc);})[_0x8a03('0x13')](function(_0x2ecf37){logger[_0x8a03('0xf')](_0x8a03('0x1f'),_0x2ecf37['message'],_0x484ae9);_0x418c85(_0x3d41c8[_0x8a03('0xf')](0x1f4,_0x2ecf37[_0x8a03('0x11')]));});});}; \ No newline at end of file +var _0xac2d=['stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','where','attributes','include','model','map','then','debug','find','raw','ShowSugarcrmAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2f1460,_0x201690){var _0x11db2b=function(_0x30c621){while(--_0x30c621){_0x2f1460['push'](_0x2f1460['shift']());}};_0x11db2b(++_0x201690);}(_0xac2d,0x1e7));var _0xdac2=function(_0x102ead,_0x271b76){_0x102ead=_0x102ead-0x0;var _0x41d886=_0xac2d[_0x102ead];return _0x41d886;};'use strict';var _=require(_0xdac2('0x0'));var util=require(_0xdac2('0x1'));var moment=require(_0xdac2('0x2'));var BPromise=require(_0xdac2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdac2('0x4'));var db=require(_0xdac2('0x5'))['db'];var utils=require(_0xdac2('0x6'));var logger=require('../../config/logger')(_0xdac2('0x7'));var config=require(_0xdac2('0x8'));var jayson=require(_0xdac2('0x9'));var client=jayson[_0xdac2('0xa')][_0xdac2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xff9810,_0x3810ea,_0x2b6d30){return new BPromise(function(_0x2be676,_0x5c3572){return client[_0xdac2('0xc')](_0xff9810,_0x2b6d30)['then'](function(_0x259d31){logger[_0xdac2('0xd')](_0xdac2('0xe'),_0x3810ea,_0xdac2('0xf'));logger['debug'](_0xdac2('0x10'),_0x3810ea,_0xdac2('0xf'),JSON[_0xdac2('0x11')](_0x259d31));if(_0x259d31[_0xdac2('0x12')]){if(_0x259d31[_0xdac2('0x12')][_0xdac2('0x13')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x3810ea,_0x259d31[_0xdac2('0x12')][_0xdac2('0x14')]);return _0x5c3572(_0x259d31[_0xdac2('0x12')][_0xdac2('0x14')]);}logger[_0xdac2('0x12')](_0xdac2('0xe'),_0x3810ea,_0x259d31['error'][_0xdac2('0x14')]);return _0x2be676(_0x259d31[_0xdac2('0x12')][_0xdac2('0x14')]);}else{logger['info'](_0xdac2('0xe'),_0x3810ea,_0xdac2('0xf'));_0x2be676(_0x259d31[_0xdac2('0x15')][_0xdac2('0x14')]);}})[_0xdac2('0x16')](function(_0x99af93){logger[_0xdac2('0x12')](_0xdac2('0xe'),_0x3810ea,_0x99af93);_0x5c3572(_0x99af93);});});}exports[_0xdac2('0x17')]=function(_0x5994fa){var _0x573283=this;return new Promise(function(_0x32b5a8,_0x186437){return db[_0xdac2('0x18')]['findAll']({'raw':_0x5994fa[_0xdac2('0x19')]?_0x5994fa['options']['raw']===undefined?!![]:![]:!![],'where':_0x5994fa[_0xdac2('0x19')]?_0x5994fa['options'][_0xdac2('0x1a')]||null:null,'attributes':_0x5994fa['options']?_0x5994fa[_0xdac2('0x19')][_0xdac2('0x1b')]||null:null,'limit':_0x5994fa['options']?_0x5994fa['options']['limit']||null:null,'include':_0x5994fa['options']?_0x5994fa[_0xdac2('0x19')]['include']?_['map'](_0x5994fa[_0xdac2('0x19')][_0xdac2('0x1c')],function(_0xd5e4da){return{'model':db[_0xd5e4da[_0xdac2('0x1d')]],'as':_0xd5e4da['as'],'attributes':_0xd5e4da[_0xdac2('0x1b')],'include':_0xd5e4da[_0xdac2('0x1c')]?_['map'](_0xd5e4da[_0xdac2('0x1c')],function(_0x4ba46c){return{'model':db[_0x4ba46c[_0xdac2('0x1d')]],'as':_0x4ba46c['as'],'attributes':_0x4ba46c[_0xdac2('0x1b')],'include':_0x4ba46c[_0xdac2('0x1c')]?_[_0xdac2('0x1e')](_0x4ba46c['include'],function(_0x29bbfc){return{'model':db[_0x29bbfc[_0xdac2('0x1d')]],'as':_0x29bbfc['as'],'attributes':_0x29bbfc[_0xdac2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdac2('0x1f')](function(_0x4d5117){logger[_0xdac2('0xd')]('GetSugarcrmAccount',_0x5994fa);logger[_0xdac2('0x20')]('GetSugarcrmAccount',_0x5994fa,JSON[_0xdac2('0x11')](_0x4d5117));_0x32b5a8(_0x4d5117);})['catch'](function(_0x259646){logger[_0xdac2('0x12')](_0xdac2('0x17'),_0x259646[_0xdac2('0x14')],_0x5994fa);_0x186437(_0x573283[_0xdac2('0x12')](0x1f4,_0x259646[_0xdac2('0x14')]));});});};exports['ShowSugarcrmAccount']=function(_0x472f35){var _0x225fbd=this;return new Promise(function(_0x5db772,_0x2f3a2e){return db[_0xdac2('0x18')][_0xdac2('0x21')]({'raw':_0x472f35['options']?_0x472f35['options'][_0xdac2('0x22')]===undefined?!![]:![]:!![],'where':_0x472f35[_0xdac2('0x19')]?_0x472f35[_0xdac2('0x19')][_0xdac2('0x1a')]||null:null,'attributes':_0x472f35['options']?_0x472f35[_0xdac2('0x19')]['attributes']||null:null,'include':_0x472f35[_0xdac2('0x19')]?_0x472f35[_0xdac2('0x19')]['include']?_[_0xdac2('0x1e')](_0x472f35[_0xdac2('0x19')][_0xdac2('0x1c')],function(_0xed3a3){return{'model':db[_0xed3a3[_0xdac2('0x1d')]],'as':_0xed3a3['as'],'attributes':_0xed3a3['attributes'],'include':_0xed3a3['include']?_['map'](_0xed3a3['include'],function(_0x1347f2){return{'model':db[_0x1347f2[_0xdac2('0x1d')]],'as':_0x1347f2['as'],'attributes':_0x1347f2[_0xdac2('0x1b')],'include':_0x1347f2[_0xdac2('0x1c')]?_[_0xdac2('0x1e')](_0x1347f2[_0xdac2('0x1c')],function(_0xa37123){return{'model':db[_0xa37123['model']],'as':_0xa37123['as'],'attributes':_0xa37123['attributes']};}):[]};}):[]};}):[]:[]})[_0xdac2('0x1f')](function(_0x4acdf3){logger['info'](_0xdac2('0x23'),_0x472f35);logger['debug'](_0xdac2('0x23'),_0x472f35,JSON[_0xdac2('0x11')](_0x4acdf3));_0x5db772(_0x4acdf3);})['catch'](function(_0x4f105e){logger['error']('ShowSugarcrmAccount',_0x4f105e[_0xdac2('0x14')],_0x472f35);_0x2f3a2e(_0x225fbd[_0xdac2('0x12')](0x1f4,_0x4f105e[_0xdac2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 001bfda..b6c6303 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 _0x0c96=['destroy','multer','util','express','Router','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','create','put','delete'];(function(_0x5d04d1,_0x31d44f){var _0x4b8e13=function(_0x22caff){while(--_0x22caff){_0x5d04d1['push'](_0x5d04d1['shift']());}};_0x4b8e13(++_0x31d44f);}(_0x0c96,0x9a));var _0x60c9=function(_0x1d4bdc,_0x4175f7){_0x1d4bdc=_0x1d4bdc-0x0;var _0x5892c4=_0x0c96[_0x1d4bdc];return _0x5892c4;};'use strict';var multer=require(_0x60c9('0x0'));var util=require(_0x60c9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x60c9('0x2'));var router=express[_0x60c9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x60c9('0x4'));router[_0x60c9('0x5')]('/',auth[_0x60c9('0x6')](),controller['index']);router[_0x60c9('0x5')](_0x60c9('0x7'),auth['isAuthenticated'](),controller[_0x60c9('0x8')]);router[_0x60c9('0x5')]('/:id/fields',auth[_0x60c9('0x6')](),controller[_0x60c9('0x9')]);router['get']('/:id/subjects',auth[_0x60c9('0x6')](),controller[_0x60c9('0xa')]);router['get'](_0x60c9('0xb'),auth[_0x60c9('0x6')](),controller[_0x60c9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x60c9('0xd')]);router[_0x60c9('0xe')](_0x60c9('0x7'),auth[_0x60c9('0x6')](),controller['update']);router[_0x60c9('0xf')](_0x60c9('0x7'),auth[_0x60c9('0x6')](),controller[_0x60c9('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa548=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller'];(function(_0x37cb4a,_0x570307){var _0x17190d=function(_0x5db3c9){while(--_0x5db3c9){_0x37cb4a['push'](_0x37cb4a['shift']());}};_0x17190d(++_0x570307);}(_0xa548,0x191));var _0x8a54=function(_0x434587,_0x23a54e){_0x434587=_0x434587-0x0;var _0x364b1a=_0xa548[_0x434587];return _0x364b1a;};'use strict';var multer=require(_0x8a54('0x0'));var util=require(_0x8a54('0x1'));var path=require(_0x8a54('0x2'));var timeout=require('connect-timeout');var express=require(_0x8a54('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8a54('0x4'));var interaction=require(_0x8a54('0x5'));var config=require('../../config/environment');var controller=require(_0x8a54('0x6'));router[_0x8a54('0x7')]('/',auth[_0x8a54('0x8')](),controller[_0x8a54('0x9')]);router[_0x8a54('0x7')](_0x8a54('0xa'),auth[_0x8a54('0x8')](),controller[_0x8a54('0xb')]);router['get'](_0x8a54('0xc'),auth['isAuthenticated'](),controller[_0x8a54('0xd')]);router['get'](_0x8a54('0xe'),auth['isAuthenticated'](),controller[_0x8a54('0xf')]);router[_0x8a54('0x7')](_0x8a54('0x10'),auth[_0x8a54('0x8')](),controller[_0x8a54('0x11')]);router[_0x8a54('0x12')]('/',auth[_0x8a54('0x8')](),controller[_0x8a54('0x13')]);router[_0x8a54('0x14')](_0x8a54('0xa'),auth[_0x8a54('0x8')](),controller[_0x8a54('0x15')]);router[_0x8a54('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8a54('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index b76a87d..cf9b2a8 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 _0x51cb=['STRING'];(function(_0x2b1a80,_0x52780d){var _0x4061c9=function(_0x24379c){while(--_0x24379c){_0x2b1a80['push'](_0x2b1a80['shift']());}};_0x4061c9(++_0x52780d);}(_0x51cb,0x1f0));var _0xb51c=function(_0xa059b5,_0x15063b){_0xa059b5=_0xa059b5-0x0;var _0xec4998=_0x51cb[_0xa059b5];return _0xec4998;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb51c('0x0')]}}; \ No newline at end of file +var _0xfeed=['STRING','exports'];(function(_0x23682a,_0x4ab4c3){var _0x880489=function(_0x5af40d){while(--_0x5af40d){_0x23682a['push'](_0x23682a['shift']());}};_0x880489(++_0x4ab4c3);}(_0xfeed,0xb1));var _0xdfee=function(_0x4e38b9,_0xa63c89){_0x4e38b9=_0x4e38b9-0x0;var _0x24dde8=_0xfeed[_0x4e38b9];return _0x24dde8;};'use strict';var Sequelize=require('sequelize');module[_0xdfee('0x0')]={'name':{'type':Sequelize[_0xdfee('0x1')]},'description':{'type':Sequelize[_0xdfee('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index e1c2eee..9a6517f 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 _0x82a8=['intersection','length','find','create','body','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','stack','index','SugarcrmConfiguration','rawAttributes','fieldName','type','model','map','name','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x4fa489,_0x4cba6b){var _0x41d2ce=function(_0x364060){while(--_0x364060){_0x4fa489['push'](_0x4fa489['shift']());}};_0x41d2ce(++_0x4cba6b);}(_0x82a8,0x195));var _0x882a=function(_0xce3b06,_0x2bc3b0){_0xce3b06=_0xce3b06-0x0;var _0x2761d3=_0x82a8[_0xce3b06];return _0x2761d3;};'use strict';var emlformat=require(_0x882a('0x0'));var rimraf=require(_0x882a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x882a('0x2'));var rp=require(_0x882a('0x3'));var moment=require(_0x882a('0x4'));var BPromise=require(_0x882a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x882a('0x6'));var csv=require('to-csv');var ejs=require(_0x882a('0x7'));var fs=require('fs');var fs_extra=require(_0x882a('0x8'));var _=require(_0x882a('0x9'));var squel=require(_0x882a('0xa'));var crypto=require('crypto');var jsforce=require(_0x882a('0xb'));var deskjs=require(_0x882a('0xc'));var toCsv=require(_0x882a('0xd'));var querystring=require(_0x882a('0xe'));var Papa=require(_0x882a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x882a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x882a('0x11'))(_0x882a('0x12'));var utils=require(_0x882a('0x13'));var config=require(_0x882a('0x14'));var licenseUtil=require(_0x882a('0x15'));var db=require(_0x882a('0x16'))['db'];function respondWithStatusCode(_0x338275,_0x40556b){_0x40556b=_0x40556b||0xcc;return function(_0x322c97){if(_0x322c97){return _0x338275[_0x882a('0x17')](_0x40556b);}return _0x338275[_0x882a('0x18')](_0x40556b)['end']();};}function respondWithResult(_0x3202c1,_0x3811b0){_0x3811b0=_0x3811b0||0xc8;return function(_0x4730ac){if(_0x4730ac){return _0x3202c1[_0x882a('0x18')](_0x3811b0)['json'](_0x4730ac);}};}function respondWithFilteredResult(_0xc9aaba,_0x2c41ef){return function(_0x181787){if(_0x181787){var _0x2af67d=typeof _0x2c41ef[_0x882a('0x19')]===_0x882a('0x1a')&&typeof _0x2c41ef[_0x882a('0x1b')]===_0x882a('0x1a');var _0xc4c8ae=_0x181787[_0x882a('0x1c')];var _0x36cdce=_0x2af67d?0x0:_0x2c41ef[_0x882a('0x19')];var _0x2971e4=_0x2af67d?_0x181787[_0x882a('0x1c')]:_0x2c41ef['offset']+_0x2c41ef[_0x882a('0x1b')];var _0x61e424;if(_0x2971e4>=_0xc4c8ae){_0x2971e4=_0xc4c8ae;_0x61e424=0xc8;}else{_0x61e424=0xce;}_0xc9aaba[_0x882a('0x18')](_0x61e424);return _0xc9aaba[_0x882a('0x1d')](_0x882a('0x1e'),_0x36cdce+'-'+_0x2971e4+'/'+_0xc4c8ae)[_0x882a('0x1f')](_0x181787);}return null;};}function patchUpdates(_0x3d9912){return function(_0x486908){try{jsonpatch[_0x882a('0x20')](_0x486908,_0x3d9912,!![]);}catch(_0x4dfd1d){return BPromise['reject'](_0x4dfd1d);}return _0x486908[_0x882a('0x21')]();};}function saveUpdates(_0x1ec880,_0x2dd7dd){return function(_0x5c468d){if(_0x5c468d){return _0x5c468d[_0x882a('0x22')](_0x1ec880)[_0x882a('0x23')](function(_0x4aadfc){return _0x4aadfc;});}return null;};}function removeEntity(_0x20495f,_0x50cf9d){return function(_0x4391c0){if(_0x4391c0){return _0x4391c0[_0x882a('0x24')]()[_0x882a('0x23')](function(){_0x20495f['status'](0xcc)[_0x882a('0x25')]();});}};}function handleEntityNotFound(_0x45a7d7,_0x4c364f){return function(_0x5514b0){if(!_0x5514b0){_0x45a7d7[_0x882a('0x17')](0x194);}return _0x5514b0;};}function handleError(_0x3046f7,_0x54e52d){_0x54e52d=_0x54e52d||0x1f4;return function(_0x4a54d6){logger['error'](_0x4a54d6[_0x882a('0x26')]);if(_0x4a54d6['name']){delete _0x4a54d6['name'];}_0x3046f7['status'](_0x54e52d)['send'](_0x4a54d6);};}exports[_0x882a('0x27')]=function(_0x5181a0,_0x2a8e42){var _0x4e33de={},_0x2d42f9={},_0x3d46c0={'count':0x0,'rows':[]};var _0x59df96=_['map'](db[_0x882a('0x28')][_0x882a('0x29')],function(_0x233941){return{'name':_0x233941[_0x882a('0x2a')],'type':_0x233941[_0x882a('0x2b')]['key']};});_0x2d42f9[_0x882a('0x2c')]=_[_0x882a('0x2d')](_0x59df96,_0x882a('0x2e'));_0x2d42f9[_0x882a('0x2f')]=_[_0x882a('0x30')](_0x5181a0['query']);_0x2d42f9[_0x882a('0x31')]=_['intersection'](_0x2d42f9['model'],_0x2d42f9[_0x882a('0x2f')]);_0x4e33de[_0x882a('0x32')]=_['intersection'](_0x2d42f9['model'],qs[_0x882a('0x33')](_0x5181a0[_0x882a('0x2f')][_0x882a('0x33')]));_0x4e33de[_0x882a('0x32')]=_0x4e33de['attributes']['length']?_0x4e33de[_0x882a('0x32')]:_0x2d42f9[_0x882a('0x2c')];if(!_0x5181a0[_0x882a('0x2f')][_0x882a('0x34')](_0x882a('0x35'))){_0x4e33de['limit']=qs[_0x882a('0x1b')](_0x5181a0[_0x882a('0x2f')][_0x882a('0x1b')]);_0x4e33de[_0x882a('0x19')]=qs['offset'](_0x5181a0['query']['offset']);}_0x4e33de[_0x882a('0x36')]=qs[_0x882a('0x37')](_0x5181a0[_0x882a('0x2f')][_0x882a('0x37')]);_0x4e33de[_0x882a('0x38')]=qs[_0x882a('0x31')](_[_0x882a('0x39')](_0x5181a0[_0x882a('0x2f')],_0x2d42f9['filters']),_0x59df96);if(_0x5181a0[_0x882a('0x2f')]['filter']){_0x4e33de[_0x882a('0x38')]=_[_0x882a('0x3a')](_0x4e33de[_0x882a('0x38')],{'$or':_[_0x882a('0x2d')](_0x59df96,function(_0x4260d5){if(_0x4260d5[_0x882a('0x2b')]!==_0x882a('0x3b')){var _0x3cf4c5={};_0x3cf4c5[_0x4260d5[_0x882a('0x2e')]]={'$like':'%'+_0x5181a0[_0x882a('0x2f')][_0x882a('0x3c')]+'%'};return _0x3cf4c5;}})});}_0x4e33de=_[_0x882a('0x3a')]({},_0x4e33de,_0x5181a0[_0x882a('0x3d')]);var _0x222813={'where':_0x4e33de[_0x882a('0x38')]};return db[_0x882a('0x28')]['count'](_0x222813)['then'](function(_0x15c1d8){_0x3d46c0['count']=_0x15c1d8;if(_0x5181a0[_0x882a('0x2f')][_0x882a('0x3e')]){_0x4e33de[_0x882a('0x3f')]=[{'all':!![]}];}return db[_0x882a('0x28')][_0x882a('0x40')](_0x4e33de);})['then'](function(_0x1e5550){_0x3d46c0[_0x882a('0x41')]=_0x1e5550;return _0x3d46c0;})['then'](respondWithFilteredResult(_0x2a8e42,_0x4e33de))[_0x882a('0x42')](handleError(_0x2a8e42,null));};exports[_0x882a('0x43')]=function(_0x3c03e0,_0x5bc6ec){var _0x3c44fb={'raw':![],'where':{'id':_0x3c03e0[_0x882a('0x44')]['id']}},_0x2bebe4={};_0x2bebe4[_0x882a('0x2c')]=_['keys'](db[_0x882a('0x28')]['rawAttributes']);_0x2bebe4[_0x882a('0x2f')]=_[_0x882a('0x30')](_0x3c03e0[_0x882a('0x2f')]);_0x2bebe4['filters']=_[_0x882a('0x45')](_0x2bebe4[_0x882a('0x2c')],_0x2bebe4[_0x882a('0x2f')]);_0x3c44fb['attributes']=_[_0x882a('0x45')](_0x2bebe4['model'],qs[_0x882a('0x33')](_0x3c03e0['query'][_0x882a('0x33')]));_0x3c44fb[_0x882a('0x32')]=_0x3c44fb[_0x882a('0x32')][_0x882a('0x46')]?_0x3c44fb[_0x882a('0x32')]:_0x2bebe4['model'];if(_0x3c03e0[_0x882a('0x2f')][_0x882a('0x3e')]){_0x3c44fb[_0x882a('0x3f')]=[{'all':!![]}];}_0x3c44fb=_['merge']({},_0x3c44fb,_0x3c03e0[_0x882a('0x3d')]);return db[_0x882a('0x28')][_0x882a('0x47')](_0x3c44fb)[_0x882a('0x23')](handleEntityNotFound(_0x5bc6ec,null))[_0x882a('0x23')](respondWithResult(_0x5bc6ec,null))['catch'](handleError(_0x5bc6ec,null));};exports[_0x882a('0x48')]=function(_0x5a256d,_0x496391){return db[_0x882a('0x28')]['create'](_0x5a256d[_0x882a('0x49')],{})[_0x882a('0x23')](respondWithResult(_0x496391,0xc9))['catch'](handleError(_0x496391,null));};exports['update']=function(_0x1eb8fe,_0x3d70ea){if(_0x1eb8fe[_0x882a('0x49')]['id']){delete _0x1eb8fe[_0x882a('0x49')]['id'];}return db[_0x882a('0x28')][_0x882a('0x47')]({'where':{'id':_0x1eb8fe[_0x882a('0x44')]['id']}})[_0x882a('0x23')](handleEntityNotFound(_0x3d70ea,null))['then'](saveUpdates(_0x1eb8fe[_0x882a('0x49')],null))[_0x882a('0x23')](respondWithResult(_0x3d70ea,null))[_0x882a('0x42')](handleError(_0x3d70ea,null));};exports[_0x882a('0x24')]=function(_0xf1283d,_0x392cc9){return db[_0x882a('0x28')][_0x882a('0x47')]({'where':{'id':_0xf1283d['params']['id']}})['then'](handleEntityNotFound(_0x392cc9,null))[_0x882a('0x23')](removeEntity(_0x392cc9,null))['catch'](handleError(_0x392cc9,null));};exports[_0x882a('0x4a')]=function(_0x48d297,_0x49fe56,_0x199a24){var _0x288c76={};var _0x42ee2b={};var _0x51d38d;var _0xad56ae;return db[_0x882a('0x28')][_0x882a('0x4b')]({'where':{'id':_0x48d297[_0x882a('0x44')]['id']}})[_0x882a('0x23')](handleEntityNotFound(_0x49fe56,null))['then'](function(_0x22e7d6){if(_0x22e7d6){_0x51d38d=_0x22e7d6;_0x42ee2b['model']=_[_0x882a('0x30')](db['SugarcrmField'][_0x882a('0x29')]);_0x42ee2b['query']=_['keys'](_0x48d297['query']);_0x42ee2b[_0x882a('0x31')]=_[_0x882a('0x45')](_0x42ee2b[_0x882a('0x2c')],_0x42ee2b[_0x882a('0x2f')]);_0x288c76[_0x882a('0x32')]=_[_0x882a('0x45')](_0x42ee2b[_0x882a('0x2c')],qs[_0x882a('0x33')](_0x48d297[_0x882a('0x2f')]['fields']));_0x288c76['attributes']=_0x288c76[_0x882a('0x32')][_0x882a('0x46')]?_0x288c76[_0x882a('0x32')]:_0x42ee2b[_0x882a('0x2c')];_0x288c76[_0x882a('0x36')]=qs[_0x882a('0x37')](_0x48d297[_0x882a('0x2f')]['sort']);_0x288c76[_0x882a('0x38')]=qs['filters'](_[_0x882a('0x39')](_0x48d297['query'],_0x42ee2b[_0x882a('0x31')]));if(_0x48d297[_0x882a('0x2f')]['filter']){_0x288c76[_0x882a('0x38')]=_[_0x882a('0x3a')](_0x288c76['where'],{'$or':_[_0x882a('0x2d')](_0x288c76[_0x882a('0x32')],function(_0x3555bb){var _0x57a27e={};_0x57a27e[_0x3555bb]={'$like':'%'+_0x48d297['query']['filter']+'%'};return _0x57a27e;})});}_0x288c76=_[_0x882a('0x3a')]({},_0x288c76,_0x48d297[_0x882a('0x3d')]);return _0x51d38d[_0x882a('0x4a')](_0x288c76);}})[_0x882a('0x23')](function(_0x537466){if(_0x537466){_0xad56ae=_0x537466[_0x882a('0x46')];if(!_0x48d297[_0x882a('0x2f')]['hasOwnProperty'](_0x882a('0x35'))){_0x288c76[_0x882a('0x1b')]=qs['limit'](_0x48d297['query']['limit']);_0x288c76[_0x882a('0x19')]=qs[_0x882a('0x19')](_0x48d297[_0x882a('0x2f')][_0x882a('0x19')]);}return _0x51d38d[_0x882a('0x4a')](_0x288c76);}})[_0x882a('0x23')](function(_0x5e2290){if(_0x5e2290){return _0x5e2290?{'count':_0xad56ae,'rows':_0x5e2290}:null;}})[_0x882a('0x23')](respondWithResult(_0x49fe56,null))[_0x882a('0x42')](handleError(_0x49fe56,null));};exports['getSubjects']=function(_0x2d9df8,_0x95e0fa,_0x2e5286){var _0x1e16b9={};var _0x3b5f9f={};var _0x34f5c;var _0x4c41d3;return db[_0x882a('0x28')][_0x882a('0x4b')]({'where':{'id':_0x2d9df8[_0x882a('0x44')]['id']}})[_0x882a('0x23')](handleEntityNotFound(_0x95e0fa,null))[_0x882a('0x23')](function(_0x352685){if(_0x352685){_0x34f5c=_0x352685;_0x3b5f9f[_0x882a('0x2c')]=_['keys'](db[_0x882a('0x4c')][_0x882a('0x29')]);_0x3b5f9f[_0x882a('0x2f')]=_[_0x882a('0x30')](_0x2d9df8[_0x882a('0x2f')]);_0x3b5f9f[_0x882a('0x31')]=_[_0x882a('0x45')](_0x3b5f9f[_0x882a('0x2c')],_0x3b5f9f[_0x882a('0x2f')]);_0x1e16b9[_0x882a('0x32')]=_[_0x882a('0x45')](_0x3b5f9f[_0x882a('0x2c')],qs[_0x882a('0x33')](_0x2d9df8[_0x882a('0x2f')][_0x882a('0x33')]));_0x1e16b9[_0x882a('0x32')]=_0x1e16b9[_0x882a('0x32')][_0x882a('0x46')]?_0x1e16b9[_0x882a('0x32')]:_0x3b5f9f['model'];_0x1e16b9[_0x882a('0x36')]=qs[_0x882a('0x37')](_0x2d9df8[_0x882a('0x2f')][_0x882a('0x37')]);_0x1e16b9[_0x882a('0x38')]=qs[_0x882a('0x31')](_[_0x882a('0x39')](_0x2d9df8[_0x882a('0x2f')],_0x3b5f9f['filters']));if(_0x2d9df8[_0x882a('0x2f')]['filter']){_0x1e16b9[_0x882a('0x38')]=_['merge'](_0x1e16b9[_0x882a('0x38')],{'$or':_['map'](_0x1e16b9['attributes'],function(_0x113d47){var _0x1d01b3={};_0x1d01b3[_0x113d47]={'$like':'%'+_0x2d9df8[_0x882a('0x2f')][_0x882a('0x3c')]+'%'};return _0x1d01b3;})});}_0x1e16b9=_[_0x882a('0x3a')]({},_0x1e16b9,_0x2d9df8[_0x882a('0x3d')]);return _0x34f5c[_0x882a('0x4d')](_0x1e16b9);}})[_0x882a('0x23')](function(_0x56ee1f){if(_0x56ee1f){_0x4c41d3=_0x56ee1f[_0x882a('0x46')];if(!_0x2d9df8[_0x882a('0x2f')][_0x882a('0x34')](_0x882a('0x35'))){_0x1e16b9[_0x882a('0x1b')]=qs[_0x882a('0x1b')](_0x2d9df8['query']['limit']);_0x1e16b9[_0x882a('0x19')]=qs[_0x882a('0x19')](_0x2d9df8[_0x882a('0x2f')][_0x882a('0x19')]);}return _0x34f5c[_0x882a('0x4d')](_0x1e16b9);}})[_0x882a('0x23')](function(_0x357ff8){if(_0x357ff8){return _0x357ff8?{'count':_0x4c41d3,'rows':_0x357ff8}:null;}})[_0x882a('0x23')](respondWithResult(_0x95e0fa,null))[_0x882a('0x42')](handleError(_0x95e0fa,null));};exports[_0x882a('0x4e')]=function(_0xe7e985,_0x2a9a25,_0x555ca8){var _0x1a46c2={};var _0x4ca5b1={};var _0x83888b;var _0x612218;return db[_0x882a('0x28')]['findOne']({'where':{'id':_0xe7e985[_0x882a('0x44')]['id']}})[_0x882a('0x23')](handleEntityNotFound(_0x2a9a25,null))[_0x882a('0x23')](function(_0x4610a7){if(_0x4610a7){_0x83888b=_0x4610a7;_0x4ca5b1['model']=_[_0x882a('0x30')](db[_0x882a('0x4c')][_0x882a('0x29')]);_0x4ca5b1[_0x882a('0x2f')]=_[_0x882a('0x30')](_0xe7e985[_0x882a('0x2f')]);_0x4ca5b1[_0x882a('0x31')]=_[_0x882a('0x45')](_0x4ca5b1[_0x882a('0x2c')],_0x4ca5b1[_0x882a('0x2f')]);_0x1a46c2[_0x882a('0x32')]=_[_0x882a('0x45')](_0x4ca5b1['model'],qs['fields'](_0xe7e985['query'][_0x882a('0x33')]));_0x1a46c2[_0x882a('0x32')]=_0x1a46c2[_0x882a('0x32')][_0x882a('0x46')]?_0x1a46c2[_0x882a('0x32')]:_0x4ca5b1[_0x882a('0x2c')];_0x1a46c2[_0x882a('0x36')]=qs[_0x882a('0x37')](_0xe7e985[_0x882a('0x2f')][_0x882a('0x37')]);_0x1a46c2[_0x882a('0x38')]=qs['filters'](_[_0x882a('0x39')](_0xe7e985[_0x882a('0x2f')],_0x4ca5b1[_0x882a('0x31')]));if(_0xe7e985[_0x882a('0x2f')][_0x882a('0x3c')]){_0x1a46c2[_0x882a('0x38')]=_[_0x882a('0x3a')](_0x1a46c2['where'],{'$or':_[_0x882a('0x2d')](_0x1a46c2[_0x882a('0x32')],function(_0x509cd8){var _0x2bf0d5={};_0x2bf0d5[_0x509cd8]={'$like':'%'+_0xe7e985[_0x882a('0x2f')]['filter']+'%'};return _0x2bf0d5;})});}_0x1a46c2=_[_0x882a('0x3a')]({},_0x1a46c2,_0xe7e985[_0x882a('0x3d')]);return _0x83888b[_0x882a('0x4e')](_0x1a46c2);}})[_0x882a('0x23')](function(_0x590998){if(_0x590998){_0x612218=_0x590998[_0x882a('0x46')];if(!_0xe7e985['query']['hasOwnProperty'](_0x882a('0x35'))){_0x1a46c2[_0x882a('0x1b')]=qs[_0x882a('0x1b')](_0xe7e985[_0x882a('0x2f')]['limit']);_0x1a46c2[_0x882a('0x19')]=qs[_0x882a('0x19')](_0xe7e985[_0x882a('0x2f')][_0x882a('0x19')]);}return _0x83888b[_0x882a('0x4e')](_0x1a46c2);}})[_0x882a('0x23')](function(_0x53a558){if(_0x53a558){return _0x53a558?{'count':_0x612218,'rows':_0x53a558}:null;}})[_0x882a('0x23')](respondWithResult(_0x2a9a25,null))[_0x882a('0x42')](handleError(_0x2a9a25,null));}; \ No newline at end of file +var _0x208b=['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','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','name','send','SugarcrmConfiguration','fieldName','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','show','rawAttributes','includeAll','find','catch','create','body','params','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs'];(function(_0x56daff,_0xadca9a){var _0x132c82=function(_0x19e0d7){while(--_0x19e0d7){_0x56daff['push'](_0x56daff['shift']());}};_0x132c82(++_0xadca9a);}(_0x208b,0x1e3));var _0xb208=function(_0x50c3de,_0x3d19b4){_0x50c3de=_0x50c3de-0x0;var _0x52b0e6=_0x208b[_0x50c3de];return _0x52b0e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb208('0x0'));var zipdir=require(_0xb208('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb208('0x2'));var moment=require(_0xb208('0x3'));var BPromise=require(_0xb208('0x4'));var Mustache=require(_0xb208('0x5'));var util=require(_0xb208('0x6'));var path=require('path');var sox=require(_0xb208('0x7'));var csv=require('to-csv');var ejs=require(_0xb208('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb208('0x9'));var squel=require(_0xb208('0xa'));var crypto=require(_0xb208('0xb'));var jsforce=require(_0xb208('0xc'));var deskjs=require(_0xb208('0xd'));var toCsv=require(_0xb208('0xe'));var querystring=require(_0xb208('0xf'));var Papa=require(_0xb208('0x10'));var Redis=require(_0xb208('0x11'));var authService=require(_0xb208('0x12'));var qs=require(_0xb208('0x13'));var as=require(_0xb208('0x14'));var hardwareService=require(_0xb208('0x15'));var logger=require(_0xb208('0x16'))(_0xb208('0x17'));var utils=require(_0xb208('0x18'));var config=require(_0xb208('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb208('0x1a'))['db'];function respondWithStatusCode(_0xcbf985,_0x5e2b86){_0x5e2b86=_0x5e2b86||0xcc;return function(_0x38bfc1){if(_0x38bfc1){return _0xcbf985[_0xb208('0x1b')](_0x5e2b86);}return _0xcbf985[_0xb208('0x1c')](_0x5e2b86)[_0xb208('0x1d')]();};}function respondWithResult(_0x5c6d23,_0x3fbbe9){_0x3fbbe9=_0x3fbbe9||0xc8;return function(_0x36109b){if(_0x36109b){return _0x5c6d23['status'](_0x3fbbe9)['json'](_0x36109b);}};}function respondWithFilteredResult(_0x314a79,_0x53a82d){return function(_0x3f9a17){if(_0x3f9a17){var _0x51ba1a=typeof _0x53a82d[_0xb208('0x1e')]===_0xb208('0x1f')&&typeof _0x53a82d[_0xb208('0x20')]==='undefined';var _0x39c12d=_0x3f9a17[_0xb208('0x21')];var _0x43f0f0=_0x51ba1a?0x0:_0x53a82d[_0xb208('0x1e')];var _0x3454ba=_0x51ba1a?_0x3f9a17[_0xb208('0x21')]:_0x53a82d['offset']+_0x53a82d['limit'];var _0x3fc018;if(_0x3454ba>=_0x39c12d){_0x3454ba=_0x39c12d;_0x3fc018=0xc8;}else{_0x3fc018=0xce;}_0x314a79[_0xb208('0x1c')](_0x3fc018);return _0x314a79['set']('Content-Range',_0x43f0f0+'-'+_0x3454ba+'/'+_0x39c12d)[_0xb208('0x22')](_0x3f9a17);}return null;};}function patchUpdates(_0x3c53af){return function(_0x31312a){try{jsonpatch[_0xb208('0x23')](_0x31312a,_0x3c53af,!![]);}catch(_0x3aa17a){return BPromise[_0xb208('0x24')](_0x3aa17a);}return _0x31312a[_0xb208('0x25')]();};}function saveUpdates(_0x45b822,_0x696af6){return function(_0x3a417d){if(_0x3a417d){return _0x3a417d[_0xb208('0x26')](_0x45b822)[_0xb208('0x27')](function(_0x1ca0f3){return _0x1ca0f3;});}return null;};}function removeEntity(_0x2a51a7,_0x4686ac){return function(_0x79e99f){if(_0x79e99f){return _0x79e99f[_0xb208('0x28')]()[_0xb208('0x27')](function(){_0x2a51a7[_0xb208('0x1c')](0xcc)[_0xb208('0x1d')]();});}};}function handleEntityNotFound(_0x2fad95,_0x2a2386){return function(_0x5b3acb){if(!_0x5b3acb){_0x2fad95['sendStatus'](0x194);}return _0x5b3acb;};}function handleError(_0x5a1300,_0x49db92){_0x49db92=_0x49db92||0x1f4;return function(_0xed9036){logger[_0xb208('0x29')](_0xed9036[_0xb208('0x2a')]);if(_0xed9036[_0xb208('0x2b')]){delete _0xed9036[_0xb208('0x2b')];}_0x5a1300[_0xb208('0x1c')](_0x49db92)[_0xb208('0x2c')](_0xed9036);};}exports['index']=function(_0x4af06a,_0x1d0db5){var _0x2a46c6={},_0x42f480={},_0x5d1967={'count':0x0,'rows':[]};var _0x234030=_['map'](db[_0xb208('0x2d')]['rawAttributes'],function(_0x53f807){return{'name':_0x53f807[_0xb208('0x2e')],'type':_0x53f807['type']['key']};});_0x42f480[_0xb208('0x2f')]=_[_0xb208('0x30')](_0x234030,_0xb208('0x2b'));_0x42f480[_0xb208('0x31')]=_[_0xb208('0x32')](_0x4af06a['query']);_0x42f480[_0xb208('0x33')]=_[_0xb208('0x34')](_0x42f480[_0xb208('0x2f')],_0x42f480[_0xb208('0x31')]);_0x2a46c6['attributes']=_[_0xb208('0x34')](_0x42f480[_0xb208('0x2f')],qs[_0xb208('0x35')](_0x4af06a['query'][_0xb208('0x35')]));_0x2a46c6[_0xb208('0x36')]=_0x2a46c6['attributes'][_0xb208('0x37')]?_0x2a46c6[_0xb208('0x36')]:_0x42f480['model'];if(!_0x4af06a[_0xb208('0x31')][_0xb208('0x38')](_0xb208('0x39'))){_0x2a46c6[_0xb208('0x20')]=qs['limit'](_0x4af06a['query']['limit']);_0x2a46c6[_0xb208('0x1e')]=qs[_0xb208('0x1e')](_0x4af06a[_0xb208('0x31')][_0xb208('0x1e')]);}_0x2a46c6[_0xb208('0x3a')]=qs[_0xb208('0x3b')](_0x4af06a['query'][_0xb208('0x3b')]);_0x2a46c6[_0xb208('0x3c')]=qs[_0xb208('0x33')](_[_0xb208('0x3d')](_0x4af06a[_0xb208('0x31')],_0x42f480[_0xb208('0x33')]),_0x234030);if(_0x4af06a['query'][_0xb208('0x3e')]){_0x2a46c6[_0xb208('0x3c')]=_[_0xb208('0x3f')](_0x2a46c6['where'],{'$or':_[_0xb208('0x30')](_0x234030,function(_0x56a2cd){if(_0x56a2cd[_0xb208('0x40')]!=='VIRTUAL'){var _0x839bea={};_0x839bea[_0x56a2cd[_0xb208('0x2b')]]={'$like':'%'+_0x4af06a[_0xb208('0x31')][_0xb208('0x3e')]+'%'};return _0x839bea;}})});}_0x2a46c6=_['merge']({},_0x2a46c6,_0x4af06a[_0xb208('0x41')]);var _0x4ef68c={'where':_0x2a46c6['where']};return db[_0xb208('0x2d')][_0xb208('0x21')](_0x4ef68c)[_0xb208('0x27')](function(_0x2b8c79){_0x5d1967[_0xb208('0x21')]=_0x2b8c79;if(_0x4af06a[_0xb208('0x31')]['includeAll']){_0x2a46c6[_0xb208('0x42')]=[{'all':!![]}];}return db[_0xb208('0x2d')][_0xb208('0x43')](_0x2a46c6);})[_0xb208('0x27')](function(_0x47e215){_0x5d1967[_0xb208('0x44')]=_0x47e215;return _0x5d1967;})[_0xb208('0x27')](respondWithFilteredResult(_0x1d0db5,_0x2a46c6))['catch'](handleError(_0x1d0db5,null));};exports[_0xb208('0x45')]=function(_0x47cde8,_0x1debba){var _0x2e9354={'raw':![],'where':{'id':_0x47cde8['params']['id']}},_0x122264={};_0x122264[_0xb208('0x2f')]=_[_0xb208('0x32')](db[_0xb208('0x2d')][_0xb208('0x46')]);_0x122264[_0xb208('0x31')]=_['keys'](_0x47cde8['query']);_0x122264[_0xb208('0x33')]=_[_0xb208('0x34')](_0x122264['model'],_0x122264['query']);_0x2e9354[_0xb208('0x36')]=_['intersection'](_0x122264[_0xb208('0x2f')],qs[_0xb208('0x35')](_0x47cde8[_0xb208('0x31')][_0xb208('0x35')]));_0x2e9354['attributes']=_0x2e9354['attributes'][_0xb208('0x37')]?_0x2e9354[_0xb208('0x36')]:_0x122264['model'];if(_0x47cde8['query'][_0xb208('0x47')]){_0x2e9354[_0xb208('0x42')]=[{'all':!![]}];}_0x2e9354=_['merge']({},_0x2e9354,_0x47cde8[_0xb208('0x41')]);return db['SugarcrmConfiguration'][_0xb208('0x48')](_0x2e9354)[_0xb208('0x27')](handleEntityNotFound(_0x1debba,null))['then'](respondWithResult(_0x1debba,null))[_0xb208('0x49')](handleError(_0x1debba,null));};exports[_0xb208('0x4a')]=function(_0x51599d,_0x5aaa8f){return db['SugarcrmConfiguration']['create'](_0x51599d[_0xb208('0x4b')],{})[_0xb208('0x27')](respondWithResult(_0x5aaa8f,0xc9))[_0xb208('0x49')](handleError(_0x5aaa8f,null));};exports[_0xb208('0x26')]=function(_0x552f58,_0xce2649){if(_0x552f58[_0xb208('0x4b')]['id']){delete _0x552f58['body']['id'];}return db['SugarcrmConfiguration'][_0xb208('0x48')]({'where':{'id':_0x552f58[_0xb208('0x4c')]['id']}})[_0xb208('0x27')](handleEntityNotFound(_0xce2649,null))[_0xb208('0x27')](saveUpdates(_0x552f58[_0xb208('0x4b')],null))[_0xb208('0x27')](respondWithResult(_0xce2649,null))['catch'](handleError(_0xce2649,null));};exports[_0xb208('0x28')]=function(_0xb34efc,_0x1e59ab){return db[_0xb208('0x2d')]['find']({'where':{'id':_0xb34efc[_0xb208('0x4c')]['id']}})[_0xb208('0x27')](handleEntityNotFound(_0x1e59ab,null))[_0xb208('0x27')](removeEntity(_0x1e59ab,null))['catch'](handleError(_0x1e59ab,null));};exports[_0xb208('0x4d')]=function(_0x5a7c7e,_0x19f5b2,_0xc8eb77){var _0x46f6a9={};var _0x5c669e={};var _0x5a8511;var _0x11a4e1;return db[_0xb208('0x2d')][_0xb208('0x4e')]({'where':{'id':_0x5a7c7e[_0xb208('0x4c')]['id']}})[_0xb208('0x27')](handleEntityNotFound(_0x19f5b2,null))[_0xb208('0x27')](function(_0x28be1e){if(_0x28be1e){_0x5a8511=_0x28be1e;_0x5c669e[_0xb208('0x2f')]=_[_0xb208('0x32')](db[_0xb208('0x4f')][_0xb208('0x46')]);_0x5c669e['query']=_[_0xb208('0x32')](_0x5a7c7e[_0xb208('0x31')]);_0x5c669e[_0xb208('0x33')]=_[_0xb208('0x34')](_0x5c669e['model'],_0x5c669e[_0xb208('0x31')]);_0x46f6a9[_0xb208('0x36')]=_[_0xb208('0x34')](_0x5c669e['model'],qs[_0xb208('0x35')](_0x5a7c7e[_0xb208('0x31')][_0xb208('0x35')]));_0x46f6a9[_0xb208('0x36')]=_0x46f6a9[_0xb208('0x36')][_0xb208('0x37')]?_0x46f6a9[_0xb208('0x36')]:_0x5c669e[_0xb208('0x2f')];_0x46f6a9[_0xb208('0x3a')]=qs[_0xb208('0x3b')](_0x5a7c7e[_0xb208('0x31')][_0xb208('0x3b')]);_0x46f6a9[_0xb208('0x3c')]=qs[_0xb208('0x33')](_[_0xb208('0x3d')](_0x5a7c7e[_0xb208('0x31')],_0x5c669e['filters']));if(_0x5a7c7e[_0xb208('0x31')][_0xb208('0x3e')]){_0x46f6a9['where']=_['merge'](_0x46f6a9[_0xb208('0x3c')],{'$or':_['map'](_0x46f6a9[_0xb208('0x36')],function(_0x4acef0){var _0x5f3c50={};_0x5f3c50[_0x4acef0]={'$like':'%'+_0x5a7c7e['query'][_0xb208('0x3e')]+'%'};return _0x5f3c50;})});}_0x46f6a9=_['merge']({},_0x46f6a9,_0x5a7c7e[_0xb208('0x41')]);return _0x5a8511[_0xb208('0x4d')](_0x46f6a9);}})[_0xb208('0x27')](function(_0x5144fd){if(_0x5144fd){_0x11a4e1=_0x5144fd[_0xb208('0x37')];if(!_0x5a7c7e[_0xb208('0x31')][_0xb208('0x38')](_0xb208('0x39'))){_0x46f6a9[_0xb208('0x20')]=qs['limit'](_0x5a7c7e[_0xb208('0x31')][_0xb208('0x20')]);_0x46f6a9[_0xb208('0x1e')]=qs[_0xb208('0x1e')](_0x5a7c7e[_0xb208('0x31')][_0xb208('0x1e')]);}return _0x5a8511[_0xb208('0x4d')](_0x46f6a9);}})['then'](function(_0x300f00){if(_0x300f00){return _0x300f00?{'count':_0x11a4e1,'rows':_0x300f00}:null;}})['then'](respondWithResult(_0x19f5b2,null))[_0xb208('0x49')](handleError(_0x19f5b2,null));};exports[_0xb208('0x50')]=function(_0x3d259e,_0x23d379,_0x20cbfa){var _0x371bb1={};var _0x198a78={};var _0x4bc1cc;var _0x4d10c9;return db[_0xb208('0x2d')][_0xb208('0x4e')]({'where':{'id':_0x3d259e[_0xb208('0x4c')]['id']}})[_0xb208('0x27')](handleEntityNotFound(_0x23d379,null))['then'](function(_0x4e55cc){if(_0x4e55cc){_0x4bc1cc=_0x4e55cc;_0x198a78['model']=_['keys'](db[_0xb208('0x4f')][_0xb208('0x46')]);_0x198a78['query']=_['keys'](_0x3d259e['query']);_0x198a78[_0xb208('0x33')]=_['intersection'](_0x198a78[_0xb208('0x2f')],_0x198a78[_0xb208('0x31')]);_0x371bb1[_0xb208('0x36')]=_[_0xb208('0x34')](_0x198a78[_0xb208('0x2f')],qs['fields'](_0x3d259e[_0xb208('0x31')][_0xb208('0x35')]));_0x371bb1['attributes']=_0x371bb1[_0xb208('0x36')][_0xb208('0x37')]?_0x371bb1[_0xb208('0x36')]:_0x198a78[_0xb208('0x2f')];_0x371bb1[_0xb208('0x3a')]=qs[_0xb208('0x3b')](_0x3d259e[_0xb208('0x31')][_0xb208('0x3b')]);_0x371bb1[_0xb208('0x3c')]=qs[_0xb208('0x33')](_['pick'](_0x3d259e['query'],_0x198a78[_0xb208('0x33')]));if(_0x3d259e[_0xb208('0x31')]['filter']){_0x371bb1['where']=_['merge'](_0x371bb1[_0xb208('0x3c')],{'$or':_[_0xb208('0x30')](_0x371bb1[_0xb208('0x36')],function(_0x31232b){var _0x3b7243={};_0x3b7243[_0x31232b]={'$like':'%'+_0x3d259e[_0xb208('0x31')][_0xb208('0x3e')]+'%'};return _0x3b7243;})});}_0x371bb1=_['merge']({},_0x371bb1,_0x3d259e['options']);return _0x4bc1cc['getSubjects'](_0x371bb1);}})['then'](function(_0x302b75){if(_0x302b75){_0x4d10c9=_0x302b75[_0xb208('0x37')];if(!_0x3d259e[_0xb208('0x31')][_0xb208('0x38')](_0xb208('0x39'))){_0x371bb1[_0xb208('0x20')]=qs['limit'](_0x3d259e[_0xb208('0x31')][_0xb208('0x20')]);_0x371bb1[_0xb208('0x1e')]=qs[_0xb208('0x1e')](_0x3d259e[_0xb208('0x31')][_0xb208('0x1e')]);}return _0x4bc1cc[_0xb208('0x50')](_0x371bb1);}})[_0xb208('0x27')](function(_0x5212dd){if(_0x5212dd){return _0x5212dd?{'count':_0x4d10c9,'rows':_0x5212dd}:null;}})[_0xb208('0x27')](respondWithResult(_0x23d379,null))[_0xb208('0x49')](handleError(_0x23d379,null));};exports[_0xb208('0x51')]=function(_0x30a3c1,_0x2a0d35,_0x39f021){var _0x49985f={};var _0x11bf14={};var _0x33e50a;var _0x37e7d6;return db[_0xb208('0x2d')][_0xb208('0x4e')]({'where':{'id':_0x30a3c1['params']['id']}})['then'](handleEntityNotFound(_0x2a0d35,null))['then'](function(_0x30a81d){if(_0x30a81d){_0x33e50a=_0x30a81d;_0x11bf14[_0xb208('0x2f')]=_[_0xb208('0x32')](db[_0xb208('0x4f')][_0xb208('0x46')]);_0x11bf14[_0xb208('0x31')]=_[_0xb208('0x32')](_0x30a3c1[_0xb208('0x31')]);_0x11bf14[_0xb208('0x33')]=_['intersection'](_0x11bf14[_0xb208('0x2f')],_0x11bf14[_0xb208('0x31')]);_0x49985f[_0xb208('0x36')]=_[_0xb208('0x34')](_0x11bf14[_0xb208('0x2f')],qs[_0xb208('0x35')](_0x30a3c1[_0xb208('0x31')]['fields']));_0x49985f['attributes']=_0x49985f[_0xb208('0x36')][_0xb208('0x37')]?_0x49985f[_0xb208('0x36')]:_0x11bf14[_0xb208('0x2f')];_0x49985f['order']=qs['sort'](_0x30a3c1[_0xb208('0x31')][_0xb208('0x3b')]);_0x49985f['where']=qs['filters'](_[_0xb208('0x3d')](_0x30a3c1[_0xb208('0x31')],_0x11bf14[_0xb208('0x33')]));if(_0x30a3c1[_0xb208('0x31')]['filter']){_0x49985f['where']=_['merge'](_0x49985f[_0xb208('0x3c')],{'$or':_[_0xb208('0x30')](_0x49985f[_0xb208('0x36')],function(_0x8a55c7){var _0x5e3d3c={};_0x5e3d3c[_0x8a55c7]={'$like':'%'+_0x30a3c1[_0xb208('0x31')]['filter']+'%'};return _0x5e3d3c;})});}_0x49985f=_['merge']({},_0x49985f,_0x30a3c1[_0xb208('0x41')]);return _0x33e50a['getDescriptions'](_0x49985f);}})[_0xb208('0x27')](function(_0x4662e7){if(_0x4662e7){_0x37e7d6=_0x4662e7[_0xb208('0x37')];if(!_0x30a3c1['query']['hasOwnProperty'](_0xb208('0x39'))){_0x49985f[_0xb208('0x20')]=qs[_0xb208('0x20')](_0x30a3c1[_0xb208('0x31')][_0xb208('0x20')]);_0x49985f[_0xb208('0x1e')]=qs['offset'](_0x30a3c1['query'][_0xb208('0x1e')]);}return _0x33e50a[_0xb208('0x51')](_0x49985f);}})[_0xb208('0x27')](function(_0x2a4b10){if(_0x2a4b10){return _0x2a4b10?{'count':_0x37e7d6,'rows':_0x2a4b10}:null;}})['then'](respondWithResult(_0x2a0d35,null))['catch'](handleError(_0x2a0d35,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index c1a6941..4a737cc 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 _0x5110=['moment','bluebird','request-promise','path','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api'];(function(_0x26e3c7,_0x3b3677){var _0xdd1004=function(_0x405d3c){while(--_0x405d3c){_0x26e3c7['push'](_0x26e3c7['shift']());}};_0xdd1004(++_0x3b3677);}(_0x5110,0x152));var _0x0511=function(_0x4e1045,_0xc8c1fb){_0x4e1045=_0x4e1045-0x0;var _0x2fa4e5=_0x5110[_0x4e1045];return _0x2fa4e5;};'use strict';var _=require(_0x0511('0x0'));var util=require(_0x0511('0x1'));var logger=require('../../config/logger')(_0x0511('0x2'));var moment=require(_0x0511('0x3'));var BPromise=require(_0x0511('0x4'));var rp=require(_0x0511('0x5'));var fs=require('fs');var path=require(_0x0511('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x0511('0x7')]=function(_0x2e5bee,_0x54b246){return _0x2e5bee[_0x0511('0x8')](_0x0511('0x9'),attributes,{'tableName':_0x0511('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd500=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util','../../config/logger'];(function(_0x2a2e72,_0x1de962){var _0x3cfb4a=function(_0x3d435c){while(--_0x3d435c){_0x2a2e72['push'](_0x2a2e72['shift']());}};_0x3cfb4a(++_0x1de962);}(_0xd500,0x1cb));var _0x0d50=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xd500[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x0d50('0x0'));var util=require(_0x0d50('0x1'));var logger=require(_0x0d50('0x2'))(_0x0d50('0x3'));var moment=require(_0x0d50('0x4'));var BPromise=require(_0x0d50('0x5'));var rp=require(_0x0d50('0x6'));var fs=require('fs');var path=require(_0x0d50('0x7'));var rimraf=require(_0x0d50('0x8'));var config=require(_0x0d50('0x9'));var attributes=require(_0x0d50('0xa'));module[_0x0d50('0xb')]=function(_0x160a58,_0xc359ac){return _0x160a58[_0x0d50('0xc')]('SugarcrmConfiguration',attributes,{'tableName':_0x0d50('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index a0213cf..e842cb0 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 _0xb19e=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','info','result','catch','lodash'];(function(_0x13489f,_0x299c9f){var _0x3286b3=function(_0x3c66fc){while(--_0x3c66fc){_0x13489f['push'](_0x13489f['shift']());}};_0x3286b3(++_0x299c9f);}(_0xb19e,0x113));var _0xeb19=function(_0x510c60,_0x50247e){_0x510c60=_0x510c60-0x0;var _0x49c4aa=_0xb19e[_0x510c60];return _0x49c4aa;};'use strict';var _=require(_0xeb19('0x0'));var util=require(_0xeb19('0x1'));var moment=require(_0xeb19('0x2'));var BPromise=require('bluebird');var rs=require(_0xeb19('0x3'));var fs=require('fs');var Redis=require(_0xeb19('0x4'));var db=require(_0xeb19('0x5'))['db'];var utils=require(_0xeb19('0x6'));var logger=require(_0xeb19('0x7'))(_0xeb19('0x8'));var config=require('../../config/environment');var jayson=require(_0xeb19('0x9'));var client=jayson['client'][_0xeb19('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48da5e,_0x369a8b,_0x1ca7d3){return new BPromise(function(_0x10d514,_0x13e695){return client[_0xeb19('0xb')](_0x48da5e,_0x1ca7d3)[_0xeb19('0xc')](function(_0x6261c4){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x369a8b,_0xeb19('0xd'));logger['debug'](_0xeb19('0xe'),_0x369a8b,_0xeb19('0xd'),JSON[_0xeb19('0xf')](_0x6261c4));if(_0x6261c4[_0xeb19('0x10')]){if(_0x6261c4[_0xeb19('0x10')][_0xeb19('0x11')]===0x1f4){logger[_0xeb19('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x369a8b,_0x6261c4[_0xeb19('0x10')][_0xeb19('0x12')]);return _0x13e695(_0x6261c4['error']['message']);}logger['error'](_0xeb19('0x13'),_0x369a8b,_0x6261c4[_0xeb19('0x10')][_0xeb19('0x12')]);return _0x10d514(_0x6261c4[_0xeb19('0x10')][_0xeb19('0x12')]);}else{logger[_0xeb19('0x14')](_0xeb19('0x13'),_0x369a8b,_0xeb19('0xd'));_0x10d514(_0x6261c4[_0xeb19('0x15')][_0xeb19('0x12')]);}})[_0xeb19('0x16')](function(_0x4f6c3a){logger[_0xeb19('0x10')](_0xeb19('0x13'),_0x369a8b,_0x4f6c3a);_0x13e695(_0x4f6c3a);});});} \ No newline at end of file +var _0x1040=['error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','result','lodash','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x203fe3,_0x4eec06){var _0x5d3225=function(_0x1eb0f6){while(--_0x1eb0f6){_0x203fe3['push'](_0x203fe3['shift']());}};_0x5d3225(++_0x4eec06);}(_0x1040,0xef));var _0x0104=function(_0x131e60,_0x5352ce){_0x131e60=_0x131e60-0x0;var _0x4bc497=_0x1040[_0x131e60];return _0x4bc497;};'use strict';var _=require(_0x0104('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0104('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0104('0x2'));var db=require(_0x0104('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0104('0x4'));var config=require(_0x0104('0x5'));var jayson=require(_0x0104('0x6'));var client=jayson[_0x0104('0x7')][_0x0104('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3095d9,_0x2b06d7,_0x4245d8){return new BPromise(function(_0x1ecd75,_0x1e68ff){return client[_0x0104('0x9')](_0x3095d9,_0x4245d8)[_0x0104('0xa')](function(_0x180393){logger[_0x0104('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2b06d7,_0x0104('0xc'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2b06d7,_0x0104('0xc'),JSON['stringify'](_0x180393));if(_0x180393['error']){if(_0x180393[_0x0104('0xd')][_0x0104('0xe')]===0x1f4){logger[_0x0104('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2b06d7,_0x180393[_0x0104('0xd')][_0x0104('0xf')]);return _0x1e68ff(_0x180393[_0x0104('0xd')]['message']);}logger[_0x0104('0xd')](_0x0104('0x10'),_0x2b06d7,_0x180393[_0x0104('0xd')][_0x0104('0xf')]);return _0x1ecd75(_0x180393[_0x0104('0xd')][_0x0104('0xf')]);}else{logger['info'](_0x0104('0x10'),_0x2b06d7,_0x0104('0xc'));_0x1ecd75(_0x180393[_0x0104('0x11')]['message']);}})['catch'](function(_0x15b7ef){logger['error'](_0x0104('0x10'),_0x2b06d7,_0x15b7ef);_0x1e68ff(_0x15b7ef);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index e4cf21a..07ccb41 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 _0xe799=['delete','destroy','exports','path','express','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','index','/:id','post','isAuthenticated','create','update'];(function(_0x1c4f4a,_0x1b254c){var _0x1e6a1b=function(_0x169c0b){while(--_0x169c0b){_0x1c4f4a['push'](_0x1c4f4a['shift']());}};_0x1e6a1b(++_0x1b254c);}(_0xe799,0x1d4));var _0x9e79=function(_0x386e1e,_0x245ed2){_0x386e1e=_0x386e1e-0x0;var _0x22e2a0=_0xe799[_0x386e1e];return _0x22e2a0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9e79('0x0'));var timeout=require('connect-timeout');var express=require(_0x9e79('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9e79('0x2'));var interaction=require(_0x9e79('0x3'));var config=require('../../config/environment');var controller=require(_0x9e79('0x4'));router[_0x9e79('0x5')]('/',auth['isAuthenticated'](),controller[_0x9e79('0x6')]);router[_0x9e79('0x5')](_0x9e79('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x9e79('0x8')]('/',auth[_0x9e79('0x9')](),controller[_0x9e79('0xa')]);router['put'](_0x9e79('0x7'),auth[_0x9e79('0x9')](),controller[_0x9e79('0xb')]);router[_0x9e79('0xc')](_0x9e79('0x7'),auth['isAuthenticated'](),controller[_0x9e79('0xd')]);module[_0x9e79('0xe')]=router; \ No newline at end of file +var _0xab5a=['destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','show','post','create','update','delete'];(function(_0x30b6cb,_0x832e62){var _0x4455a1=function(_0xd3aaab){while(--_0xd3aaab){_0x30b6cb['push'](_0x30b6cb['shift']());}};_0x4455a1(++_0x832e62);}(_0xab5a,0x17b));var _0xaab5=function(_0x48fe6d,_0x8ce37b){_0x48fe6d=_0x48fe6d-0x0;var _0x3407dc=_0xab5a[_0x48fe6d];return _0x3407dc;};'use strict';var multer=require(_0xaab5('0x0'));var util=require('util');var path=require(_0xaab5('0x1'));var timeout=require('connect-timeout');var express=require(_0xaab5('0x2'));var router=express[_0xaab5('0x3')]();var fs_extra=require(_0xaab5('0x4'));var auth=require(_0xaab5('0x5'));var interaction=require(_0xaab5('0x6'));var config=require(_0xaab5('0x7'));var controller=require(_0xaab5('0x8'));router[_0xaab5('0x9')]('/',auth[_0xaab5('0xa')](),controller['index']);router[_0xaab5('0x9')](_0xaab5('0xb'),auth['isAuthenticated'](),controller[_0xaab5('0xc')]);router[_0xaab5('0xd')]('/',auth[_0xaab5('0xa')](),controller[_0xaab5('0xe')]);router['put'](_0xaab5('0xb'),auth['isAuthenticated'](),controller[_0xaab5('0xf')]);router[_0xaab5('0x10')](_0xaab5('0xb'),auth[_0xaab5('0xa')](),controller[_0xaab5('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index aa5c45a..d3697b4 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 _0x4f55=['STRING','BOOLEAN','variable','customVariable','keyValue','picklist','string'];(function(_0x25a42a,_0x3d489b){var _0x1129b1=function(_0x4ae61b){while(--_0x4ae61b){_0x25a42a['push'](_0x25a42a['shift']());}};_0x1129b1(++_0x3d489b);}(_0x4f55,0xdb));var _0x54f5=function(_0x5105f2,_0x5f331e){_0x5105f2=_0x5105f2-0x0;var _0x151a91=_0x4f55[_0x5105f2];return _0x151a91;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x54f5('0x0'),_0x54f5('0x1'),_0x54f5('0x2'),_0x54f5('0x3')),'defaultValue':_0x54f5('0x4')},'content':{'type':Sequelize[_0x54f5('0x5')]},'key':{'type':Sequelize[_0x54f5('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x54f5('0x0'),_0x54f5('0x1'))},'keyContent':{'type':Sequelize[_0x54f5('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x54f5('0x5')]},'customField':{'type':Sequelize[_0x54f5('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x54f5('0x5')]}}; \ No newline at end of file +var _0xabbc=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xabbc,0xb5));var _0xcabb=function(_0x163691,_0x3d10c4){_0x163691=_0x163691-0x0;var _0x543ae5=_0xabbc[_0x163691];return _0x543ae5;};'use strict';var Sequelize=require(_0xcabb('0x0'));module[_0xcabb('0x1')]={'type':{'type':Sequelize[_0xcabb('0x2')](_0xcabb('0x3'),_0xcabb('0x4'),_0xcabb('0x5'),_0xcabb('0x6'),_0xcabb('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xcabb('0x8')]},'key':{'type':Sequelize[_0xcabb('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xcabb('0x3'),_0xcabb('0x4'),_0xcabb('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xcabb('0x8')]},'nameField':{'type':Sequelize[_0xcabb('0x8')]},'customField':{'type':Sequelize[_0xcabb('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcabb('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 0e001c7..ed6d7b1 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 _0xd740=['where','type','VIRTUAL','options','includeAll','include','rows','catch','show','keys','SugarcrmField','fields','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','stack','send','index','map','model','name','intersection','attributes','query','length','sort','filters','filter','merge'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd740,0x94));var _0x0d74=function(_0x111311,_0x1e2f69){_0x111311=_0x111311-0x0;var _0x4cef39=_0xd740[_0x111311];return _0x4cef39;};'use strict';var emlformat=require(_0x0d74('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d74('0x1'));var jsonpatch=require(_0x0d74('0x2'));var rp=require(_0x0d74('0x3'));var moment=require('moment');var BPromise=require(_0x0d74('0x4'));var Mustache=require(_0x0d74('0x5'));var util=require('util');var path=require(_0x0d74('0x6'));var sox=require('sox');var csv=require(_0x0d74('0x7'));var ejs=require(_0x0d74('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d74('0x9'));var squel=require(_0x0d74('0xa'));var crypto=require(_0x0d74('0xb'));var jsforce=require(_0x0d74('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0d74('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0d74('0xd'));var authService=require(_0x0d74('0xe'));var qs=require(_0x0d74('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d74('0x10'));var logger=require('../../config/logger')(_0x0d74('0x11'));var utils=require(_0x0d74('0x12'));var config=require(_0x0d74('0x13'));var licenseUtil=require(_0x0d74('0x14'));var db=require(_0x0d74('0x15'))['db'];function respondWithStatusCode(_0x3a2306,_0x286d9f){_0x286d9f=_0x286d9f||0xcc;return function(_0x56698e){if(_0x56698e){return _0x3a2306['sendStatus'](_0x286d9f);}return _0x3a2306['status'](_0x286d9f)[_0x0d74('0x16')]();};}function respondWithResult(_0x16dcb1,_0x10d745){_0x10d745=_0x10d745||0xc8;return function(_0x29f10e){if(_0x29f10e){return _0x16dcb1['status'](_0x10d745)[_0x0d74('0x17')](_0x29f10e);}};}function respondWithFilteredResult(_0x1e7f29,_0x5d586f){return function(_0x235088){if(_0x235088){var _0x269253=typeof _0x5d586f[_0x0d74('0x18')]==='undefined'&&typeof _0x5d586f[_0x0d74('0x19')]===_0x0d74('0x1a');var _0x2bcf96=_0x235088[_0x0d74('0x1b')];var _0x5c66e8=_0x269253?0x0:_0x5d586f[_0x0d74('0x18')];var _0x2756b0=_0x269253?_0x235088[_0x0d74('0x1b')]:_0x5d586f['offset']+_0x5d586f[_0x0d74('0x19')];var _0x584f85;if(_0x2756b0>=_0x2bcf96){_0x2756b0=_0x2bcf96;_0x584f85=0xc8;}else{_0x584f85=0xce;}_0x1e7f29[_0x0d74('0x1c')](_0x584f85);return _0x1e7f29[_0x0d74('0x1d')](_0x0d74('0x1e'),_0x5c66e8+'-'+_0x2756b0+'/'+_0x2bcf96)['json'](_0x235088);}return null;};}function patchUpdates(_0x61d7a9){return function(_0x370876){try{jsonpatch[_0x0d74('0x1f')](_0x370876,_0x61d7a9,!![]);}catch(_0x14849f){return BPromise[_0x0d74('0x20')](_0x14849f);}return _0x370876[_0x0d74('0x21')]();};}function saveUpdates(_0x327936,_0x5eeeab){return function(_0x22b503){if(_0x22b503){return _0x22b503[_0x0d74('0x22')](_0x327936)[_0x0d74('0x23')](function(_0x430220){return _0x430220;});}return null;};}function removeEntity(_0x59fec7,_0xaf8b4e){return function(_0x342474){if(_0x342474){return _0x342474['destroy']()[_0x0d74('0x23')](function(){_0x59fec7['status'](0xcc)[_0x0d74('0x16')]();});}};}function handleEntityNotFound(_0x37426d,_0x3a3817){return function(_0x2ff76a){if(!_0x2ff76a){_0x37426d['sendStatus'](0x194);}return _0x2ff76a;};}function handleError(_0x262df1,_0x3fc56a){_0x3fc56a=_0x3fc56a||0x1f4;return function(_0x71599c){logger['error'](_0x71599c[_0x0d74('0x24')]);if(_0x71599c['name']){delete _0x71599c['name'];}_0x262df1[_0x0d74('0x1c')](_0x3fc56a)[_0x0d74('0x25')](_0x71599c);};}exports[_0x0d74('0x26')]=function(_0x4640ec,_0x296fe9){var _0x2f4764={},_0x21e992={},_0x553ee8={'count':0x0,'rows':[]};var _0x50a93e=_[_0x0d74('0x27')](db['SugarcrmField']['rawAttributes'],function(_0xe2b146){return{'name':_0xe2b146['fieldName'],'type':_0xe2b146['type']['key']};});_0x21e992[_0x0d74('0x28')]=_['map'](_0x50a93e,_0x0d74('0x29'));_0x21e992['query']=_['keys'](_0x4640ec['query']);_0x21e992['filters']=_[_0x0d74('0x2a')](_0x21e992[_0x0d74('0x28')],_0x21e992['query']);_0x2f4764[_0x0d74('0x2b')]=_[_0x0d74('0x2a')](_0x21e992[_0x0d74('0x28')],qs['fields'](_0x4640ec[_0x0d74('0x2c')]['fields']));_0x2f4764[_0x0d74('0x2b')]=_0x2f4764[_0x0d74('0x2b')][_0x0d74('0x2d')]?_0x2f4764[_0x0d74('0x2b')]:_0x21e992['model'];if(!_0x4640ec[_0x0d74('0x2c')]['hasOwnProperty']('nolimit')){_0x2f4764[_0x0d74('0x19')]=qs['limit'](_0x4640ec[_0x0d74('0x2c')][_0x0d74('0x19')]);_0x2f4764[_0x0d74('0x18')]=qs[_0x0d74('0x18')](_0x4640ec[_0x0d74('0x2c')][_0x0d74('0x18')]);}_0x2f4764['order']=qs[_0x0d74('0x2e')](_0x4640ec[_0x0d74('0x2c')][_0x0d74('0x2e')]);_0x2f4764['where']=qs['filters'](_['pick'](_0x4640ec[_0x0d74('0x2c')],_0x21e992[_0x0d74('0x2f')]),_0x50a93e);if(_0x4640ec[_0x0d74('0x2c')][_0x0d74('0x30')]){_0x2f4764['where']=_[_0x0d74('0x31')](_0x2f4764[_0x0d74('0x32')],{'$or':_[_0x0d74('0x27')](_0x50a93e,function(_0x5a82eb){if(_0x5a82eb[_0x0d74('0x33')]!==_0x0d74('0x34')){var _0x1cb0c9={};_0x1cb0c9[_0x5a82eb[_0x0d74('0x29')]]={'$like':'%'+_0x4640ec['query'][_0x0d74('0x30')]+'%'};return _0x1cb0c9;}})});}_0x2f4764=_['merge']({},_0x2f4764,_0x4640ec[_0x0d74('0x35')]);var _0x1cb8af={'where':_0x2f4764[_0x0d74('0x32')]};return db['SugarcrmField']['count'](_0x1cb8af)['then'](function(_0x2df003){_0x553ee8[_0x0d74('0x1b')]=_0x2df003;if(_0x4640ec[_0x0d74('0x2c')][_0x0d74('0x36')]){_0x2f4764[_0x0d74('0x37')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x2f4764);})[_0x0d74('0x23')](function(_0x1164dd){_0x553ee8[_0x0d74('0x38')]=_0x1164dd;return _0x553ee8;})['then'](respondWithFilteredResult(_0x296fe9,_0x2f4764))[_0x0d74('0x39')](handleError(_0x296fe9,null));};exports[_0x0d74('0x3a')]=function(_0x389357,_0x19a598){var _0x383acd={'raw':!![],'where':{'id':_0x389357['params']['id']}},_0x594d59={};_0x594d59[_0x0d74('0x28')]=_[_0x0d74('0x3b')](db[_0x0d74('0x3c')]['rawAttributes']);_0x594d59[_0x0d74('0x2c')]=_['keys'](_0x389357[_0x0d74('0x2c')]);_0x594d59[_0x0d74('0x2f')]=_[_0x0d74('0x2a')](_0x594d59[_0x0d74('0x28')],_0x594d59[_0x0d74('0x2c')]);_0x383acd[_0x0d74('0x2b')]=_[_0x0d74('0x2a')](_0x594d59['model'],qs[_0x0d74('0x3d')](_0x389357[_0x0d74('0x2c')]['fields']));_0x383acd[_0x0d74('0x2b')]=_0x383acd['attributes'][_0x0d74('0x2d')]?_0x383acd[_0x0d74('0x2b')]:_0x594d59['model'];if(_0x389357[_0x0d74('0x2c')][_0x0d74('0x36')]){_0x383acd[_0x0d74('0x37')]=[{'all':!![]}];}_0x383acd=_[_0x0d74('0x31')]({},_0x383acd,_0x389357['options']);return db[_0x0d74('0x3c')][_0x0d74('0x3e')](_0x383acd)[_0x0d74('0x23')](handleEntityNotFound(_0x19a598,null))[_0x0d74('0x23')](respondWithResult(_0x19a598,null))[_0x0d74('0x39')](handleError(_0x19a598,null));};exports[_0x0d74('0x3f')]=function(_0x383ed6,_0x508d68){return db[_0x0d74('0x3c')][_0x0d74('0x3f')](_0x383ed6['body'],{})[_0x0d74('0x23')](respondWithResult(_0x508d68,0xc9))['catch'](handleError(_0x508d68,null));};exports['update']=function(_0x18d66e,_0x39260d){if(_0x18d66e[_0x0d74('0x40')]['id']){delete _0x18d66e[_0x0d74('0x40')]['id'];}return db[_0x0d74('0x3c')]['find']({'where':{'id':_0x18d66e[_0x0d74('0x41')]['id']}})[_0x0d74('0x23')](handleEntityNotFound(_0x39260d,null))['then'](saveUpdates(_0x18d66e[_0x0d74('0x40')],null))[_0x0d74('0x23')](respondWithResult(_0x39260d,null))[_0x0d74('0x39')](handleError(_0x39260d,null));};exports['destroy']=function(_0x3b70b9,_0x164881){return db[_0x0d74('0x3c')][_0x0d74('0x3e')]({'where':{'id':_0x3b70b9['params']['id']}})['then'](handleEntityNotFound(_0x164881,null))[_0x0d74('0x23')](removeEntity(_0x164881,null))[_0x0d74('0x39')](handleError(_0x164881,null));}; \ No newline at end of file +var _0x8962=['filters','filter','where','merge','VIRTUAL','options','includeAll','catch','show','params','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','SugarcrmField','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x14a5b8,_0x2849fa){var _0x4134b8=function(_0x53d843){while(--_0x53d843){_0x14a5b8['push'](_0x14a5b8['shift']());}};_0x4134b8(++_0x2849fa);}(_0x8962,0x171));var _0x2896=function(_0x2274a9,_0x49a840){_0x2274a9=_0x2274a9-0x0;var _0x1e613f=_0x8962[_0x2274a9];return _0x1e613f;};'use strict';var emlformat=require(_0x2896('0x0'));var rimraf=require(_0x2896('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2896('0x2'));var rp=require(_0x2896('0x3'));var moment=require(_0x2896('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2896('0x5'));var util=require(_0x2896('0x6'));var path=require('path');var sox=require(_0x2896('0x7'));var csv=require('to-csv');var ejs=require(_0x2896('0x8'));var fs=require('fs');var fs_extra=require(_0x2896('0x9'));var _=require('lodash');var squel=require(_0x2896('0xa'));var crypto=require(_0x2896('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2896('0xc'));var toCsv=require(_0x2896('0xd'));var querystring=require(_0x2896('0xe'));var Papa=require(_0x2896('0xf'));var Redis=require('ioredis');var authService=require(_0x2896('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2896('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2896('0x12'))('api');var utils=require(_0x2896('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2896('0x14'));var db=require(_0x2896('0x15'))['db'];function respondWithStatusCode(_0x24ce60,_0x6e410){_0x6e410=_0x6e410||0xcc;return function(_0x41b6a1){if(_0x41b6a1){return _0x24ce60[_0x2896('0x16')](_0x6e410);}return _0x24ce60[_0x2896('0x17')](_0x6e410)[_0x2896('0x18')]();};}function respondWithResult(_0x245b3a,_0x612947){_0x612947=_0x612947||0xc8;return function(_0x50c097){if(_0x50c097){return _0x245b3a[_0x2896('0x17')](_0x612947)['json'](_0x50c097);}};}function respondWithFilteredResult(_0x146352,_0x49bb74){return function(_0x47e60c){if(_0x47e60c){var _0x2411e3=typeof _0x49bb74['offset']===_0x2896('0x19')&&typeof _0x49bb74[_0x2896('0x1a')]==='undefined';var _0x167b4d=_0x47e60c[_0x2896('0x1b')];var _0x509912=_0x2411e3?0x0:_0x49bb74[_0x2896('0x1c')];var _0x4b11cb=_0x2411e3?_0x47e60c[_0x2896('0x1b')]:_0x49bb74[_0x2896('0x1c')]+_0x49bb74[_0x2896('0x1a')];var _0x5ac501;if(_0x4b11cb>=_0x167b4d){_0x4b11cb=_0x167b4d;_0x5ac501=0xc8;}else{_0x5ac501=0xce;}_0x146352['status'](_0x5ac501);return _0x146352['set'](_0x2896('0x1d'),_0x509912+'-'+_0x4b11cb+'/'+_0x167b4d)[_0x2896('0x1e')](_0x47e60c);}return null;};}function patchUpdates(_0x636dd2){return function(_0x830247){try{jsonpatch[_0x2896('0x1f')](_0x830247,_0x636dd2,!![]);}catch(_0x11989f){return BPromise[_0x2896('0x20')](_0x11989f);}return _0x830247[_0x2896('0x21')]();};}function saveUpdates(_0x180ed6,_0x295014){return function(_0x3471a1){if(_0x3471a1){return _0x3471a1[_0x2896('0x22')](_0x180ed6)[_0x2896('0x23')](function(_0x591609){return _0x591609;});}return null;};}function removeEntity(_0xb54f25,_0x3e0bac){return function(_0x223486){if(_0x223486){return _0x223486[_0x2896('0x24')]()[_0x2896('0x23')](function(){_0xb54f25[_0x2896('0x17')](0xcc)[_0x2896('0x18')]();});}};}function handleEntityNotFound(_0x3a351b,_0x3ec61a){return function(_0x37d133){if(!_0x37d133){_0x3a351b[_0x2896('0x16')](0x194);}return _0x37d133;};}function handleError(_0x29b952,_0xf4ce27){_0xf4ce27=_0xf4ce27||0x1f4;return function(_0x47efc3){logger['error'](_0x47efc3[_0x2896('0x25')]);if(_0x47efc3[_0x2896('0x26')]){delete _0x47efc3[_0x2896('0x26')];}_0x29b952['status'](_0xf4ce27)[_0x2896('0x27')](_0x47efc3);};}exports[_0x2896('0x28')]=function(_0x429cca,_0x106a9c){var _0x3e711d={},_0x3532bc={},_0x3ac8d0={'count':0x0,'rows':[]};var _0x237a05=_[_0x2896('0x29')](db[_0x2896('0x2a')][_0x2896('0x2b')],function(_0x24529b){return{'name':_0x24529b['fieldName'],'type':_0x24529b[_0x2896('0x2c')][_0x2896('0x2d')]};});_0x3532bc[_0x2896('0x2e')]=_[_0x2896('0x29')](_0x237a05,_0x2896('0x26'));_0x3532bc[_0x2896('0x2f')]=_[_0x2896('0x30')](_0x429cca[_0x2896('0x2f')]);_0x3532bc['filters']=_[_0x2896('0x31')](_0x3532bc['model'],_0x3532bc[_0x2896('0x2f')]);_0x3e711d[_0x2896('0x32')]=_[_0x2896('0x31')](_0x3532bc[_0x2896('0x2e')],qs[_0x2896('0x33')](_0x429cca[_0x2896('0x2f')][_0x2896('0x33')]));_0x3e711d['attributes']=_0x3e711d[_0x2896('0x32')][_0x2896('0x34')]?_0x3e711d[_0x2896('0x32')]:_0x3532bc['model'];if(!_0x429cca[_0x2896('0x2f')][_0x2896('0x35')](_0x2896('0x36'))){_0x3e711d['limit']=qs[_0x2896('0x1a')](_0x429cca['query'][_0x2896('0x1a')]);_0x3e711d[_0x2896('0x1c')]=qs['offset'](_0x429cca[_0x2896('0x2f')][_0x2896('0x1c')]);}_0x3e711d[_0x2896('0x37')]=qs['sort'](_0x429cca[_0x2896('0x2f')][_0x2896('0x38')]);_0x3e711d['where']=qs[_0x2896('0x39')](_['pick'](_0x429cca[_0x2896('0x2f')],_0x3532bc['filters']),_0x237a05);if(_0x429cca[_0x2896('0x2f')][_0x2896('0x3a')]){_0x3e711d[_0x2896('0x3b')]=_[_0x2896('0x3c')](_0x3e711d['where'],{'$or':_['map'](_0x237a05,function(_0x5208e){if(_0x5208e[_0x2896('0x2c')]!==_0x2896('0x3d')){var _0x2446d2={};_0x2446d2[_0x5208e['name']]={'$like':'%'+_0x429cca[_0x2896('0x2f')][_0x2896('0x3a')]+'%'};return _0x2446d2;}})});}_0x3e711d=_[_0x2896('0x3c')]({},_0x3e711d,_0x429cca[_0x2896('0x3e')]);var _0x3b1912={'where':_0x3e711d[_0x2896('0x3b')]};return db[_0x2896('0x2a')]['count'](_0x3b1912)[_0x2896('0x23')](function(_0x124151){_0x3ac8d0[_0x2896('0x1b')]=_0x124151;if(_0x429cca[_0x2896('0x2f')][_0x2896('0x3f')]){_0x3e711d['include']=[{'all':!![]}];}return db[_0x2896('0x2a')]['findAll'](_0x3e711d);})[_0x2896('0x23')](function(_0x18b038){_0x3ac8d0['rows']=_0x18b038;return _0x3ac8d0;})[_0x2896('0x23')](respondWithFilteredResult(_0x106a9c,_0x3e711d))[_0x2896('0x40')](handleError(_0x106a9c,null));};exports[_0x2896('0x41')]=function(_0x39f14e,_0x2a71ab){var _0x4fb8d1={'raw':!![],'where':{'id':_0x39f14e[_0x2896('0x42')]['id']}},_0x2c898a={};_0x2c898a[_0x2896('0x2e')]=_[_0x2896('0x30')](db[_0x2896('0x2a')][_0x2896('0x2b')]);_0x2c898a[_0x2896('0x2f')]=_[_0x2896('0x30')](_0x39f14e[_0x2896('0x2f')]);_0x2c898a[_0x2896('0x39')]=_['intersection'](_0x2c898a['model'],_0x2c898a[_0x2896('0x2f')]);_0x4fb8d1[_0x2896('0x32')]=_[_0x2896('0x31')](_0x2c898a[_0x2896('0x2e')],qs[_0x2896('0x33')](_0x39f14e[_0x2896('0x2f')][_0x2896('0x33')]));_0x4fb8d1[_0x2896('0x32')]=_0x4fb8d1['attributes'][_0x2896('0x34')]?_0x4fb8d1['attributes']:_0x2c898a[_0x2896('0x2e')];if(_0x39f14e[_0x2896('0x2f')][_0x2896('0x3f')]){_0x4fb8d1[_0x2896('0x43')]=[{'all':!![]}];}_0x4fb8d1=_['merge']({},_0x4fb8d1,_0x39f14e['options']);return db[_0x2896('0x2a')][_0x2896('0x44')](_0x4fb8d1)[_0x2896('0x23')](handleEntityNotFound(_0x2a71ab,null))[_0x2896('0x23')](respondWithResult(_0x2a71ab,null))[_0x2896('0x40')](handleError(_0x2a71ab,null));};exports[_0x2896('0x45')]=function(_0x1e444d,_0xb4e0ed){return db[_0x2896('0x2a')][_0x2896('0x45')](_0x1e444d[_0x2896('0x46')],{})[_0x2896('0x23')](respondWithResult(_0xb4e0ed,0xc9))[_0x2896('0x40')](handleError(_0xb4e0ed,null));};exports[_0x2896('0x22')]=function(_0x4ef410,_0x56efe2){if(_0x4ef410['body']['id']){delete _0x4ef410[_0x2896('0x46')]['id'];}return db[_0x2896('0x2a')]['find']({'where':{'id':_0x4ef410[_0x2896('0x42')]['id']}})[_0x2896('0x23')](handleEntityNotFound(_0x56efe2,null))[_0x2896('0x23')](saveUpdates(_0x4ef410[_0x2896('0x46')],null))['then'](respondWithResult(_0x56efe2,null))[_0x2896('0x40')](handleError(_0x56efe2,null));};exports['destroy']=function(_0x34134d,_0x456088){return db[_0x2896('0x2a')][_0x2896('0x44')]({'where':{'id':_0x34134d['params']['id']}})[_0x2896('0x23')](handleEntityNotFound(_0x456088,null))[_0x2896('0x23')](removeEntity(_0x456088,null))[_0x2896('0x40')](handleError(_0x456088,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 40b7ed4..b818bff 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 _0xb0b5=['./intSugarcrmField.attributes','exports','SugarcrmField','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x120ab8,_0x577eb9){var _0x597e51=function(_0x165bf4){while(--_0x165bf4){_0x120ab8['push'](_0x120ab8['shift']());}};_0x597e51(++_0x577eb9);}(_0xb0b5,0x12b));var _0x5b0b=function(_0x27657c,_0x36813e){_0x27657c=_0x27657c-0x0;var _0x12324a=_0xb0b5[_0x27657c];return _0x12324a;};'use strict';var _=require(_0x5b0b('0x0'));var util=require(_0x5b0b('0x1'));var logger=require(_0x5b0b('0x2'))(_0x5b0b('0x3'));var moment=require(_0x5b0b('0x4'));var BPromise=require(_0x5b0b('0x5'));var rp=require(_0x5b0b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b0b('0x7'));var config=require(_0x5b0b('0x8'));var attributes=require(_0x5b0b('0x9'));module[_0x5b0b('0xa')]=function(_0x1b6af7,_0x25481a){return _0x1b6af7['define'](_0x5b0b('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x5b0b('0xc'),_0x5b0b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4b16=['int_sugarcrm_fields','sugarcrm_unique_index','FieldId','util','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField'];(function(_0x43f406,_0x59700c){var _0x41988c=function(_0x5c2ef0){while(--_0x5c2ef0){_0x43f406['push'](_0x43f406['shift']());}};_0x41988c(++_0x59700c);}(_0x4b16,0x1a5));var _0x64b1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b16[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x64b1('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x64b1('0x1'));var rp=require(_0x64b1('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x64b1('0x3'));var config=require(_0x64b1('0x4'));var attributes=require(_0x64b1('0x5'));module['exports']=function(_0x2eaf01,_0x16fd45){return _0x2eaf01[_0x64b1('0x6')](_0x64b1('0x7'),attributes,{'tableName':_0x64b1('0x8'),'paranoid':![],'indexes':[{'name':_0x64b1('0x9'),'fields':['idField',_0x64b1('0xa')],'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 0fc7ebd..e426f17 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 _0xb9d2=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','client','http','request','SugarcrmField,\x20%s,\x20%s','request\x20sent'];(function(_0x357318,_0xc7771a){var _0x338002=function(_0x37d4ab){while(--_0x37d4ab){_0x357318['push'](_0x357318['shift']());}};_0x338002(++_0xc7771a);}(_0xb9d2,0xd0));var _0x2b9d=function(_0x19908f,_0xc32e70){_0x19908f=_0x19908f-0x0;var _0x36cfbe=_0xb9d2[_0x19908f];return _0x36cfbe;};'use strict';var _=require(_0x2b9d('0x0'));var util=require(_0x2b9d('0x1'));var moment=require(_0x2b9d('0x2'));var BPromise=require(_0x2b9d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b9d('0x4'))['db'];var utils=require(_0x2b9d('0x5'));var logger=require(_0x2b9d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2b9d('0x7')][_0x2b9d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e155f,_0x57f71e,_0x496b66){return new BPromise(function(_0x5f00a2,_0x7f7ad6){return client[_0x2b9d('0x9')](_0x1e155f,_0x496b66)['then'](function(_0x1ab8a1){logger['info'](_0x2b9d('0xa'),_0x57f71e,_0x2b9d('0xb'));logger['debug'](_0x2b9d('0xc'),_0x57f71e,_0x2b9d('0xb'),JSON[_0x2b9d('0xd')](_0x1ab8a1));if(_0x1ab8a1[_0x2b9d('0xe')]){if(_0x1ab8a1[_0x2b9d('0xe')][_0x2b9d('0xf')]===0x1f4){logger[_0x2b9d('0xe')](_0x2b9d('0xa'),_0x57f71e,_0x1ab8a1[_0x2b9d('0xe')][_0x2b9d('0x10')]);return _0x7f7ad6(_0x1ab8a1[_0x2b9d('0xe')][_0x2b9d('0x10')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x57f71e,_0x1ab8a1[_0x2b9d('0xe')][_0x2b9d('0x10')]);return _0x5f00a2(_0x1ab8a1[_0x2b9d('0xe')][_0x2b9d('0x10')]);}else{logger[_0x2b9d('0x11')](_0x2b9d('0xa'),_0x57f71e,_0x2b9d('0xb'));_0x5f00a2(_0x1ab8a1[_0x2b9d('0x12')][_0x2b9d('0x10')]);}})[_0x2b9d('0x13')](function(_0x1b7976){logger[_0x2b9d('0xe')](_0x2b9d('0xa'),_0x57f71e,_0x1b7976);_0x7f7ad6(_0x1b7976);});});} \ No newline at end of file +var _0x426a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmField,\x20%s,\x20%s','message','result','lodash','moment','bluebird','../../mysqldb'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x426a,0x1ca));var _0xa426=function(_0x29bb1f,_0x4226bf){_0x29bb1f=_0x29bb1f-0x0;var _0x15b73e=_0x426a[_0x29bb1f];return _0x15b73e;};'use strict';var _=require(_0xa426('0x0'));var util=require('util');var moment=require(_0xa426('0x1'));var BPromise=require(_0xa426('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa426('0x3'))['db'];var utils=require(_0xa426('0x4'));var logger=require(_0xa426('0x5'))(_0xa426('0x6'));var config=require(_0xa426('0x7'));var jayson=require(_0xa426('0x8'));var client=jayson[_0xa426('0x9')][_0xa426('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37f9f3,_0x17b02d,_0x5acdb2){return new BPromise(function(_0x489cbb,_0x1ed5d2){return client[_0xa426('0xb')](_0x37f9f3,_0x5acdb2)[_0xa426('0xc')](function(_0x2f013e){logger[_0xa426('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x17b02d,_0xa426('0xe'));logger[_0xa426('0xf')](_0xa426('0x10'),_0x17b02d,'request\x20sent',JSON[_0xa426('0x11')](_0x2f013e));if(_0x2f013e[_0xa426('0x12')]){if(_0x2f013e[_0xa426('0x12')]['code']===0x1f4){logger[_0xa426('0x12')](_0xa426('0x13'),_0x17b02d,_0x2f013e['error'][_0xa426('0x14')]);return _0x1ed5d2(_0x2f013e[_0xa426('0x12')][_0xa426('0x14')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x17b02d,_0x2f013e['error'][_0xa426('0x14')]);return _0x489cbb(_0x2f013e[_0xa426('0x12')][_0xa426('0x14')]);}else{logger[_0xa426('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x17b02d,_0xa426('0xe'));_0x489cbb(_0x2f013e[_0xa426('0x15')][_0xa426('0x14')]);}})['catch'](function(_0x585bc6){logger[_0xa426('0x12')](_0xa426('0x13'),_0x17b02d,_0x585bc6);_0x1ed5d2(_0x585bc6);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index a2faa13..97ed1ae 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 _0x5694=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete'];(function(_0x37c2a8,_0x20c9d9){var _0x5514f0=function(_0x2a0336){while(--_0x2a0336){_0x37c2a8['push'](_0x37c2a8['shift']());}};_0x5514f0(++_0x20c9d9);}(_0x5694,0x1ca));var _0x4569=function(_0x1906ef,_0x15aadc){_0x1906ef=_0x1906ef-0x0;var _0x141fd6=_0x5694[_0x1906ef];return _0x141fd6;};'use strict';var multer=require(_0x4569('0x0'));var util=require(_0x4569('0x1'));var path=require(_0x4569('0x2'));var timeout=require(_0x4569('0x3'));var express=require('express');var router=express[_0x4569('0x4')]();var fs_extra=require(_0x4569('0x5'));var auth=require(_0x4569('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4569('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x4569('0x8')]('/',auth[_0x4569('0x9')](),controller[_0x4569('0xa')]);router[_0x4569('0x8')](_0x4569('0xb'),auth[_0x4569('0x9')](),controller[_0x4569('0xc')]);router[_0x4569('0x8')](_0x4569('0xd'),auth[_0x4569('0x9')](),controller['getConfigurations']);router[_0x4569('0x8')](_0x4569('0xe'),auth[_0x4569('0x9')](),controller[_0x4569('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4569('0x10')]);router[_0x4569('0x11')](_0x4569('0xd'),auth['isAuthenticated'](),controller[_0x4569('0x12')]);router[_0x4569('0x13')]('/:id',auth[_0x4569('0x9')](),controller[_0x4569('0x14')]);router[_0x4569('0x15')](_0x4569('0xb'),auth['isAuthenticated'](),controller[_0x4569('0x16')]);module[_0x4569('0x17')]=router; \ No newline at end of file +var _0xfc1e=['fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','connect-timeout','express','Router'];(function(_0x23a49a,_0x45fd99){var _0x2e0cb8=function(_0x11a7e4){while(--_0x11a7e4){_0x23a49a['push'](_0x23a49a['shift']());}};_0x2e0cb8(++_0x45fd99);}(_0xfc1e,0x1c9));var _0xefc1=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0xfc1e[_0xbe40ad];return _0x50fac9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xefc1('0x0'));var express=require(_0xefc1('0x1'));var router=express[_0xefc1('0x2')]();var fs_extra=require(_0xefc1('0x3'));var auth=require(_0xefc1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xefc1('0x5'));var controller=require(_0xefc1('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xefc1('0x7')]);router[_0xefc1('0x8')](_0xefc1('0x9'),auth[_0xefc1('0xa')](),controller[_0xefc1('0xb')]);router[_0xefc1('0x8')](_0xefc1('0xc'),auth[_0xefc1('0xa')](),controller[_0xefc1('0xd')]);router[_0xefc1('0x8')](_0xefc1('0xe'),auth['isAuthenticated'](),controller[_0xefc1('0xf')]);router[_0xefc1('0x10')]('/',auth[_0xefc1('0xa')](),controller[_0xefc1('0x11')]);router[_0xefc1('0x10')](_0xefc1('0xc'),auth[_0xefc1('0xa')](),controller[_0xefc1('0x12')]);router[_0xefc1('0x13')](_0xefc1('0x9'),auth[_0xefc1('0xa')](),controller['update']);router[_0xefc1('0x14')](_0xefc1('0x9'),auth[_0xefc1('0xa')](),controller[_0xefc1('0x15')]);module[_0xefc1('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 5616ed9..792af27 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 _0xc288=['sequelize','STRING','HelpDesk'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xc288,0xfc));var _0x8c28=function(_0x81e374,_0x5e71f4){_0x81e374=_0x81e374-0x0;var _0x292b27=_0xc288[_0x81e374];return _0x292b27;};'use strict';var Sequelize=require(_0x8c28('0x0'));module['exports']={'name':{'type':Sequelize[_0x8c28('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8c28('0x1')]},'username':{'type':Sequelize[_0x8c28('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8c28('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8c28('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8c28('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x793e=['STRING','HelpDesk'];(function(_0x58aad3,_0x2a1647){var _0x2618d9=function(_0x3b760a){while(--_0x3b760a){_0x58aad3['push'](_0x58aad3['shift']());}};_0x2618d9(++_0x2a1647);}(_0x793e,0x186));var _0xe793=function(_0x29c42c,_0x12a918){_0x29c42c=_0x29c42c-0x0;var _0x5ea3db=_0x793e[_0x29c42c];return _0x5ea3db;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe793('0x0')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe793('0x1')},'remoteUri':{'type':Sequelize[_0xe793('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe793('0x0')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index d7674cc..0f0e420 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 _0xaca4=['login','result','token','describe','sessionName','reference','owner','remove','includes','label','startsWith','cf_','picklistValues','value','vTiger\x20error:\x20','test','statusCode','error','stringify','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','limit','undefined','count','offset','set','Content-Range','apply','update','destroy','then','stack','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','VtigerAccount','findAll','show','keys','rawAttributes','fields','includeAll','include','find','create','body','catch','params','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','format','%s/webservice.php','GET','success','POST'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0xaca4,0x179));var _0x4aca=function(_0x910a5b,_0x53c6f9){_0x910a5b=_0x910a5b-0x0;var _0x3a44b7=_0xaca4[_0x910a5b];return _0x3a44b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4aca('0x0'));var zipdir=require(_0x4aca('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4aca('0x2'));var moment=require(_0x4aca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4aca('0x4'));var util=require(_0x4aca('0x5'));var path=require('path');var sox=require(_0x4aca('0x6'));var csv=require(_0x4aca('0x7'));var ejs=require(_0x4aca('0x8'));var fs=require('fs');var fs_extra=require(_0x4aca('0x9'));var _=require(_0x4aca('0xa'));var squel=require(_0x4aca('0xb'));var crypto=require(_0x4aca('0xc'));var jsforce=require(_0x4aca('0xd'));var deskjs=require(_0x4aca('0xe'));var toCsv=require(_0x4aca('0x7'));var querystring=require(_0x4aca('0xf'));var Papa=require(_0x4aca('0x10'));var Redis=require(_0x4aca('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4aca('0x12'));var as=require(_0x4aca('0x13'));var hardwareService=require(_0x4aca('0x14'));var logger=require(_0x4aca('0x15'))(_0x4aca('0x16'));var utils=require(_0x4aca('0x17'));var config=require(_0x4aca('0x18'));var licenseUtil=require(_0x4aca('0x19'));var db=require(_0x4aca('0x1a'))['db'];var integrations=require(_0x4aca('0x1b'));function respondWithStatusCode(_0x2da08e,_0x4dd42c){_0x4dd42c=_0x4dd42c||0xcc;return function(_0x5257bd){if(_0x5257bd){return _0x2da08e['sendStatus'](_0x4dd42c);}return _0x2da08e[_0x4aca('0x1c')](_0x4dd42c)['end']();};}function respondWithResult(_0x50c6e5,_0x5b294d){_0x5b294d=_0x5b294d||0xc8;return function(_0x208084){if(_0x208084){return _0x50c6e5[_0x4aca('0x1c')](_0x5b294d)[_0x4aca('0x1d')](_0x208084);}};}function respondWithFilteredResult(_0x4417bf,_0x1028fb){return function(_0x45ffbc){if(_0x45ffbc){var _0x1006cc=typeof _0x1028fb['offset']==='undefined'&&typeof _0x1028fb[_0x4aca('0x1e')]===_0x4aca('0x1f');var _0xf7dbca=_0x45ffbc[_0x4aca('0x20')];var _0x39fa23=_0x1006cc?0x0:_0x1028fb[_0x4aca('0x21')];var _0x13f138=_0x1006cc?_0x45ffbc[_0x4aca('0x20')]:_0x1028fb[_0x4aca('0x21')]+_0x1028fb[_0x4aca('0x1e')];var _0x4d5dfb;if(_0x13f138>=_0xf7dbca){_0x13f138=_0xf7dbca;_0x4d5dfb=0xc8;}else{_0x4d5dfb=0xce;}_0x4417bf[_0x4aca('0x1c')](_0x4d5dfb);return _0x4417bf[_0x4aca('0x22')](_0x4aca('0x23'),_0x39fa23+'-'+_0x13f138+'/'+_0xf7dbca)[_0x4aca('0x1d')](_0x45ffbc);}return null;};}function patchUpdates(_0xa600e1){return function(_0x3081a5){try{jsonpatch[_0x4aca('0x24')](_0x3081a5,_0xa600e1,!![]);}catch(_0x2d6264){return BPromise['reject'](_0x2d6264);}return _0x3081a5['save']();};}function saveUpdates(_0x38d82b,_0x2c0fdb){return function(_0x4a4d9d){if(_0x4a4d9d){return _0x4a4d9d[_0x4aca('0x25')](_0x38d82b)['then'](function(_0x11ce9b){return _0x11ce9b;});}return null;};}function removeEntity(_0xc50608,_0x3d4d15){return function(_0x4d9474){if(_0x4d9474){return _0x4d9474[_0x4aca('0x26')]()[_0x4aca('0x27')](function(){_0xc50608['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d6378,_0x1f9a4a){return function(_0x447c19){if(!_0x447c19){_0x5d6378['sendStatus'](0x194);}return _0x447c19;};}function handleError(_0x7cbb33,_0x5821c7){_0x5821c7=_0x5821c7||0x1f4;return function(_0x1b97bc){logger['error'](_0x1b97bc[_0x4aca('0x28')]);if(_0x1b97bc[_0x4aca('0x29')]){delete _0x1b97bc[_0x4aca('0x29')];}_0x7cbb33['status'](_0x5821c7)[_0x4aca('0x2a')](_0x1b97bc);};}exports[_0x4aca('0x2b')]=function(_0x379f39,_0x14d333){var _0x131dc4={},_0x2a6823={},_0x1aa8a2={'count':0x0,'rows':[]};var _0x2f67c6=_[_0x4aca('0x2c')](db['VtigerAccount']['rawAttributes'],function(_0x2dc9ae){return{'name':_0x2dc9ae[_0x4aca('0x2d')],'type':_0x2dc9ae['type'][_0x4aca('0x2e')]};});_0x2a6823[_0x4aca('0x2f')]=_[_0x4aca('0x2c')](_0x2f67c6,_0x4aca('0x29'));_0x2a6823['query']=_['keys'](_0x379f39[_0x4aca('0x30')]);_0x2a6823[_0x4aca('0x31')]=_[_0x4aca('0x32')](_0x2a6823[_0x4aca('0x2f')],_0x2a6823[_0x4aca('0x30')]);_0x131dc4[_0x4aca('0x33')]=_['intersection'](_0x2a6823[_0x4aca('0x2f')],qs['fields'](_0x379f39[_0x4aca('0x30')]['fields']));_0x131dc4[_0x4aca('0x33')]=_0x131dc4['attributes'][_0x4aca('0x34')]?_0x131dc4['attributes']:_0x2a6823['model'];if(!_0x379f39[_0x4aca('0x30')]['hasOwnProperty'](_0x4aca('0x35'))){_0x131dc4['limit']=qs[_0x4aca('0x1e')](_0x379f39[_0x4aca('0x30')]['limit']);_0x131dc4['offset']=qs[_0x4aca('0x21')](_0x379f39[_0x4aca('0x30')][_0x4aca('0x21')]);}_0x131dc4[_0x4aca('0x36')]=qs[_0x4aca('0x37')](_0x379f39[_0x4aca('0x30')][_0x4aca('0x37')]);_0x131dc4[_0x4aca('0x38')]=qs[_0x4aca('0x31')](_[_0x4aca('0x39')](_0x379f39[_0x4aca('0x30')],_0x2a6823[_0x4aca('0x31')]),_0x2f67c6);if(_0x379f39[_0x4aca('0x30')]['filter']){_0x131dc4['where']=_[_0x4aca('0x3a')](_0x131dc4[_0x4aca('0x38')],{'$or':_[_0x4aca('0x2c')](_0x2f67c6,function(_0x43f2bf){if(_0x43f2bf[_0x4aca('0x3b')]!==_0x4aca('0x3c')){var _0x2468f5={};_0x2468f5[_0x43f2bf[_0x4aca('0x29')]]={'$like':'%'+_0x379f39[_0x4aca('0x30')][_0x4aca('0x3d')]+'%'};return _0x2468f5;}})});}_0x131dc4=_[_0x4aca('0x3a')]({},_0x131dc4,_0x379f39[_0x4aca('0x3e')]);var _0x1eb5c9={'where':_0x131dc4['where']};return db[_0x4aca('0x3f')]['count'](_0x1eb5c9)['then'](function(_0xa49c68){_0x1aa8a2['count']=_0xa49c68;if(_0x379f39[_0x4aca('0x30')]['includeAll']){_0x131dc4['include']=[{'all':!![]}];}return db['VtigerAccount'][_0x4aca('0x40')](_0x131dc4);})[_0x4aca('0x27')](function(_0x7965b6){_0x1aa8a2['rows']=_0x7965b6;return _0x1aa8a2;})['then'](respondWithFilteredResult(_0x14d333,_0x131dc4))['catch'](handleError(_0x14d333,null));};exports[_0x4aca('0x41')]=function(_0x24676b,_0x27e162){var _0x582a46={'raw':![],'where':{'id':_0x24676b['params']['id']}},_0x55b404={};_0x55b404[_0x4aca('0x2f')]=_[_0x4aca('0x42')](db['VtigerAccount'][_0x4aca('0x43')]);_0x55b404[_0x4aca('0x30')]=_[_0x4aca('0x42')](_0x24676b[_0x4aca('0x30')]);_0x55b404[_0x4aca('0x31')]=_[_0x4aca('0x32')](_0x55b404[_0x4aca('0x2f')],_0x55b404[_0x4aca('0x30')]);_0x582a46[_0x4aca('0x33')]=_['intersection'](_0x55b404[_0x4aca('0x2f')],qs['fields'](_0x24676b['query'][_0x4aca('0x44')]));_0x582a46[_0x4aca('0x33')]=_0x582a46[_0x4aca('0x33')][_0x4aca('0x34')]?_0x582a46[_0x4aca('0x33')]:_0x55b404[_0x4aca('0x2f')];if(_0x24676b[_0x4aca('0x30')][_0x4aca('0x45')]){_0x582a46[_0x4aca('0x46')]=[{'all':!![]}];}_0x582a46=_[_0x4aca('0x3a')]({},_0x582a46,_0x24676b[_0x4aca('0x3e')]);return db[_0x4aca('0x3f')][_0x4aca('0x47')](_0x582a46)[_0x4aca('0x27')](handleEntityNotFound(_0x27e162,null))[_0x4aca('0x27')](respondWithResult(_0x27e162,null))['catch'](handleError(_0x27e162,null));};exports[_0x4aca('0x48')]=function(_0x4e3025,_0x397dc6){return db['VtigerAccount']['create'](_0x4e3025[_0x4aca('0x49')],{})[_0x4aca('0x27')](respondWithResult(_0x397dc6,0xc9))[_0x4aca('0x4a')](handleError(_0x397dc6,null));};exports[_0x4aca('0x25')]=function(_0x15575b,_0x3bb134){if(_0x15575b[_0x4aca('0x49')]['id']){delete _0x15575b[_0x4aca('0x49')]['id'];}return db['VtigerAccount'][_0x4aca('0x47')]({'where':{'id':_0x15575b[_0x4aca('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3bb134,null))['then'](saveUpdates(_0x15575b[_0x4aca('0x49')],null))[_0x4aca('0x27')](respondWithResult(_0x3bb134,null))['catch'](handleError(_0x3bb134,null));};exports[_0x4aca('0x26')]=function(_0x350b74,_0x1cdc49){return db['VtigerAccount'][_0x4aca('0x47')]({'where':{'id':_0x350b74[_0x4aca('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1cdc49,null))['then'](removeEntity(_0x1cdc49,null))[_0x4aca('0x4a')](handleError(_0x1cdc49,null));};exports[_0x4aca('0x4c')]=function(_0x1b086d,_0x272869,_0x39be2a){var _0x11cd9f={};var _0x2bede2={};var _0x12f5c3;var _0x50a28c;return db[_0x4aca('0x3f')][_0x4aca('0x4d')]({'where':{'id':_0x1b086d[_0x4aca('0x4b')]['id']}})['then'](handleEntityNotFound(_0x272869,null))[_0x4aca('0x27')](function(_0x147d38){if(_0x147d38){_0x12f5c3=_0x147d38;_0x2bede2[_0x4aca('0x2f')]=_[_0x4aca('0x42')](db[_0x4aca('0x4e')][_0x4aca('0x43')]);_0x2bede2['query']=_[_0x4aca('0x42')](_0x1b086d[_0x4aca('0x30')]);_0x2bede2[_0x4aca('0x31')]=_[_0x4aca('0x32')](_0x2bede2[_0x4aca('0x2f')],_0x2bede2[_0x4aca('0x30')]);_0x11cd9f[_0x4aca('0x33')]=_[_0x4aca('0x32')](_0x2bede2[_0x4aca('0x2f')],qs[_0x4aca('0x44')](_0x1b086d[_0x4aca('0x30')][_0x4aca('0x44')]));_0x11cd9f[_0x4aca('0x33')]=_0x11cd9f[_0x4aca('0x33')][_0x4aca('0x34')]?_0x11cd9f['attributes']:_0x2bede2[_0x4aca('0x2f')];_0x11cd9f[_0x4aca('0x36')]=qs[_0x4aca('0x37')](_0x1b086d[_0x4aca('0x30')][_0x4aca('0x37')]);_0x11cd9f[_0x4aca('0x38')]=qs[_0x4aca('0x31')](_[_0x4aca('0x39')](_0x1b086d['query'],_0x2bede2[_0x4aca('0x31')]));if(_0x1b086d[_0x4aca('0x30')][_0x4aca('0x3d')]){_0x11cd9f[_0x4aca('0x38')]=_[_0x4aca('0x3a')](_0x11cd9f['where'],{'$or':_[_0x4aca('0x2c')](_0x11cd9f[_0x4aca('0x33')],function(_0xbc766e){var _0x31c15b={};_0x31c15b[_0xbc766e]={'$like':'%'+_0x1b086d[_0x4aca('0x30')][_0x4aca('0x3d')]+'%'};return _0x31c15b;})});}_0x11cd9f=_[_0x4aca('0x3a')]({},_0x11cd9f,_0x1b086d[_0x4aca('0x3e')]);return _0x12f5c3[_0x4aca('0x4c')](_0x11cd9f);}})[_0x4aca('0x27')](function(_0x4f86fd){if(_0x4f86fd){_0x50a28c=_0x4f86fd['length'];if(!_0x1b086d[_0x4aca('0x30')][_0x4aca('0x4f')](_0x4aca('0x35'))){_0x11cd9f[_0x4aca('0x1e')]=qs[_0x4aca('0x1e')](_0x1b086d[_0x4aca('0x30')][_0x4aca('0x1e')]);_0x11cd9f[_0x4aca('0x21')]=qs[_0x4aca('0x21')](_0x1b086d[_0x4aca('0x30')]['offset']);}return _0x12f5c3[_0x4aca('0x4c')](_0x11cd9f);}})[_0x4aca('0x27')](function(_0x4cf6c4){if(_0x4cf6c4){return _0x4cf6c4?{'count':_0x50a28c,'rows':_0x4cf6c4}:null;}})[_0x4aca('0x27')](respondWithResult(_0x272869,null))['catch'](handleError(_0x272869,null));};exports[_0x4aca('0x50')]=function(_0x16100c,_0x29a69a,_0x5b9890){if(_0x16100c[_0x4aca('0x49')]['id']){delete _0x16100c[_0x4aca('0x49')]['id'];}return db[_0x4aca('0x3f')][_0x4aca('0x4d')]({'where':{'id':_0x16100c[_0x4aca('0x4b')]['id']}})[_0x4aca('0x27')](handleEntityNotFound(_0x29a69a,null))['then'](function(_0x3b1f7b){if(_0x3b1f7b){_0x16100c[_0x4aca('0x49')][_0x4aca('0x51')]=_0x3b1f7b['id'];_0x16100c[_0x4aca('0x49')][_0x4aca('0x52')]=integrations[_0x4aca('0x53')](_0x16100c['body'][_0x4aca('0x54')],_0x16100c[_0x4aca('0x49')][_0x4aca('0x3b')]);_0x16100c[_0x4aca('0x49')]['Descriptions']=integrations[_0x4aca('0x55')](_0x16100c['body'][_0x4aca('0x54')],_0x16100c['body'][_0x4aca('0x3b')]);return db[_0x4aca('0x4e')][_0x4aca('0x48')](_0x16100c[_0x4aca('0x49')],{'include':[{'model':db[_0x4aca('0x56')],'as':'Subjects'},{'model':db[_0x4aca('0x56')],'as':'Descriptions'}]});}return null;})[_0x4aca('0x27')](respondWithResult(_0x29a69a,null))[_0x4aca('0x4a')](handleError(_0x29a69a,null));};var md5=require('md5');exports[_0x4aca('0x57')]=function(_0x17609f,_0x154688,_0x4bfa8a){var _0x1311a2=null;var _0x67b73b=null;var _0x51ac31=null;var _0x56d6d5=null;var _0x4feb85='';return db[_0x4aca('0x3f')]['findOne']({'where':{'id':_0x17609f[_0x4aca('0x4b')]['id']},'attributes':['id','name',_0x4aca('0x58'),'description',_0x4aca('0x59'),_0x4aca('0x5a'),_0x4aca('0x5b'),_0x4aca('0x5c')]})[_0x4aca('0x27')](handleEntityNotFound(_0x154688,null))['then'](function(_0x3b6548){if(_0x3b6548){_0x1311a2=_0x3b6548['username'];_0x67b73b=_0x3b6548[_0x4aca('0x5c')];_0x51ac31=_0x3b6548[_0x4aca('0x59')];_0x4feb85=_0x3b6548[_0x4aca('0x5a')];var _0x4eddef=_0x4feb85[_0x4aca('0x5d')](-0x1);if(_0x4eddef==='/'){_0x4feb85=_0x4feb85['substring'](0x0,_0x4feb85['lastIndexOf'](_0x4eddef));}_0x56d6d5=util[_0x4aca('0x5e')](_0x4aca('0x5f'),_0x4feb85);var _0x3d4532={'method':_0x4aca('0x60'),'uri':_0x56d6d5,'qs':{'operation':'getchallenge','username':_0x3b6548[_0x4aca('0x58')]},'json':!![]};return rp(_0x3d4532);}})[_0x4aca('0x27')](function(_0x50a478){if(_0x50a478[_0x4aca('0x61')]){var _0x1490d2={'method':_0x4aca('0x62'),'uri':_0x56d6d5,'form':{'operation':_0x4aca('0x63'),'username':_0x1311a2,'accessKey':md5(_0x50a478[_0x4aca('0x64')][_0x4aca('0x65')]+_0x67b73b)},'json':!![]};return rp(_0x1490d2);}})['then'](function(_0x3f3b7e){if(_0x3f3b7e[_0x4aca('0x61')]){var _0x14bec3={'method':_0x4aca('0x60'),'uri':_0x56d6d5,'qs':{'operation':_0x4aca('0x66'),'username':_0x1311a2,'sessionName':_0x3f3b7e[_0x4aca('0x64')][_0x4aca('0x67')],'elementType':_0x51ac31},'json':!![]};return rp(_0x14bec3);}})['then'](function(_0xade782){if(_0xade782[_0x4aca('0x61')]){var _0x40a3f2=['autogenerated',_0x4aca('0x68'),_0x4aca('0x69')];_[_0x4aca('0x6a')](_0xade782['result'][_0x4aca('0x44')],function(_0x4941e6){return _0x40a3f2[_0x4aca('0x6b')](_0x4941e6[_0x4aca('0x3b')][_0x4aca('0x29')]);});_['remove'](_0xade782[_0x4aca('0x64')][_0x4aca('0x44')],function(_0xad526d){return _0xad526d['editable']==='false';});return{'count':_0xade782['result'][_0x4aca('0x44')][_0x4aca('0x34')],'rows':_['map'](_0xade782[_0x4aca('0x64')][_0x4aca('0x44')],function(_0x2cb548){return{'id':_0x2cb548[_0x4aca('0x29')],'name':_0x2cb548[_0x4aca('0x6c')],'custom':_[_0x4aca('0x6d')](_0x2cb548[_0x4aca('0x29')],_0x4aca('0x6e'))?!![]:![],'options':_0x2cb548['type']['name']==='picklist'&&_0x2cb548[_0x4aca('0x3b')][_0x4aca('0x6f')][_0x4aca('0x34')]>0x0?_[_0x4aca('0x2c')](_0x2cb548[_0x4aca('0x3b')][_0x4aca('0x6f')],function(_0x2418bb){return{'name':_0x2418bb['label'],'value':_0x2418bb[_0x4aca('0x70')]};}):[]};})};}})['then'](respondWithResult(_0x154688,null))[_0x4aca('0x4a')](function(_0x378bf3){console['log'](_0x4aca('0x71')+_0x378bf3);var _0x2034d6=_0x17609f['query'][_0x4aca('0x72')]?0x1f4:_0x378bf3[_0x4aca('0x73')]||0x1f4;logger[_0x4aca('0x74')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2034d6,JSON[_0x4aca('0x75')](_0x378bf3));delete _0x378bf3[_0x4aca('0x29')];if(_0x2034d6===0x191){_0x2034d6=0x190;}_0x154688[_0x4aca('0x1c')](_0x2034d6)['send'](_0x17609f[_0x4aca('0x30')][_0x4aca('0x72')]?{'message':_0x4aca('0x76'),'statusCode':_0x378bf3['statusCode']}:_0x378bf3);});}; \ No newline at end of file +var _0xd775=['autogenerated','reference','owner','remove','includes','editable','false','startsWith','cf_','picklist','picklistValues','label','log','vTiger\x20error:\x20','test','statusCode','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','error','stack','send','index','map','VtigerAccount','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','getConfigurations','rawAttributes','sort','addConfiguration','findOne','AccountId','Subjects','getDescriptions','channel','Descriptions','md5','username','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','format','GET','getchallenge','success','POST','login','result','token','describe','sessionName'];(function(_0x1e37d5,_0x5b35bb){var _0x3d2298=function(_0x2c18d4){while(--_0x2c18d4){_0x1e37d5['push'](_0x1e37d5['shift']());}};_0x3d2298(++_0x5b35bb);}(_0xd775,0x17c));var _0x5d77=function(_0x5836d1,_0x54aa84){_0x5836d1=_0x5836d1-0x0;var _0xdd05ec=_0xd775[_0x5836d1];return _0xdd05ec;};'use strict';var emlformat=require(_0x5d77('0x0'));var rimraf=require(_0x5d77('0x1'));var zipdir=require(_0x5d77('0x2'));var jsonpatch=require(_0x5d77('0x3'));var rp=require(_0x5d77('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5d77('0x5'));var util=require(_0x5d77('0x6'));var path=require(_0x5d77('0x7'));var sox=require('sox');var csv=require(_0x5d77('0x8'));var ejs=require(_0x5d77('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d77('0xa'));var squel=require(_0x5d77('0xb'));var crypto=require(_0x5d77('0xc'));var jsforce=require(_0x5d77('0xd'));var deskjs=require(_0x5d77('0xe'));var toCsv=require(_0x5d77('0x8'));var querystring=require('querystring');var Papa=require(_0x5d77('0xf'));var Redis=require(_0x5d77('0x10'));var authService=require(_0x5d77('0x11'));var qs=require(_0x5d77('0x12'));var as=require(_0x5d77('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d77('0x14'))(_0x5d77('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5d77('0x16'));var db=require(_0x5d77('0x17'))['db'];var integrations=require(_0x5d77('0x18'));function respondWithStatusCode(_0x13f36d,_0x5189ab){_0x5189ab=_0x5189ab||0xcc;return function(_0x4b7798){if(_0x4b7798){return _0x13f36d[_0x5d77('0x19')](_0x5189ab);}return _0x13f36d[_0x5d77('0x1a')](_0x5189ab)[_0x5d77('0x1b')]();};}function respondWithResult(_0x32a2d1,_0x259511){_0x259511=_0x259511||0xc8;return function(_0x231b62){if(_0x231b62){return _0x32a2d1[_0x5d77('0x1a')](_0x259511)[_0x5d77('0x1c')](_0x231b62);}};}function respondWithFilteredResult(_0x2573c9,_0x394c3d){return function(_0x181f32){if(_0x181f32){var _0x393968=typeof _0x394c3d[_0x5d77('0x1d')]===_0x5d77('0x1e')&&typeof _0x394c3d['limit']===_0x5d77('0x1e');var _0x2e533f=_0x181f32[_0x5d77('0x1f')];var _0x1c43f4=_0x393968?0x0:_0x394c3d[_0x5d77('0x1d')];var _0x21466d=_0x393968?_0x181f32['count']:_0x394c3d[_0x5d77('0x1d')]+_0x394c3d[_0x5d77('0x20')];var _0x1acdb2;if(_0x21466d>=_0x2e533f){_0x21466d=_0x2e533f;_0x1acdb2=0xc8;}else{_0x1acdb2=0xce;}_0x2573c9[_0x5d77('0x1a')](_0x1acdb2);return _0x2573c9[_0x5d77('0x21')](_0x5d77('0x22'),_0x1c43f4+'-'+_0x21466d+'/'+_0x2e533f)['json'](_0x181f32);}return null;};}function patchUpdates(_0x39d758){return function(_0x484ee2){try{jsonpatch[_0x5d77('0x23')](_0x484ee2,_0x39d758,!![]);}catch(_0x5aa0c6){return BPromise[_0x5d77('0x24')](_0x5aa0c6);}return _0x484ee2['save']();};}function saveUpdates(_0x198752,_0xc3a982){return function(_0x486bb1){if(_0x486bb1){return _0x486bb1['update'](_0x198752)[_0x5d77('0x25')](function(_0x49c339){return _0x49c339;});}return null;};}function removeEntity(_0x35211f,_0x4f71f2){return function(_0x4610bf){if(_0x4610bf){return _0x4610bf[_0x5d77('0x26')]()['then'](function(){_0x35211f[_0x5d77('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x551d2f,_0x1ccadb){return function(_0xf7c5ab){if(!_0xf7c5ab){_0x551d2f['sendStatus'](0x194);}return _0xf7c5ab;};}function handleError(_0x3b7981,_0x4f2c63){_0x4f2c63=_0x4f2c63||0x1f4;return function(_0x23fbee){logger[_0x5d77('0x27')](_0x23fbee[_0x5d77('0x28')]);if(_0x23fbee['name']){delete _0x23fbee['name'];}_0x3b7981[_0x5d77('0x1a')](_0x4f2c63)[_0x5d77('0x29')](_0x23fbee);};}exports[_0x5d77('0x2a')]=function(_0x58b290,_0x3d7af2){var _0x1d84f2={},_0x3ab015={},_0x4493b4={'count':0x0,'rows':[]};var _0x1b6a89=_[_0x5d77('0x2b')](db[_0x5d77('0x2c')]['rawAttributes'],function(_0x46c670){return{'name':_0x46c670[_0x5d77('0x2d')],'type':_0x46c670['type'][_0x5d77('0x2e')]};});_0x3ab015[_0x5d77('0x2f')]=_['map'](_0x1b6a89,_0x5d77('0x30'));_0x3ab015[_0x5d77('0x31')]=_[_0x5d77('0x32')](_0x58b290[_0x5d77('0x31')]);_0x3ab015[_0x5d77('0x33')]=_['intersection'](_0x3ab015[_0x5d77('0x2f')],_0x3ab015[_0x5d77('0x31')]);_0x1d84f2['attributes']=_[_0x5d77('0x34')](_0x3ab015[_0x5d77('0x2f')],qs[_0x5d77('0x35')](_0x58b290[_0x5d77('0x31')][_0x5d77('0x35')]));_0x1d84f2[_0x5d77('0x36')]=_0x1d84f2[_0x5d77('0x36')]['length']?_0x1d84f2[_0x5d77('0x36')]:_0x3ab015['model'];if(!_0x58b290[_0x5d77('0x31')][_0x5d77('0x37')](_0x5d77('0x38'))){_0x1d84f2[_0x5d77('0x20')]=qs[_0x5d77('0x20')](_0x58b290[_0x5d77('0x31')]['limit']);_0x1d84f2[_0x5d77('0x1d')]=qs[_0x5d77('0x1d')](_0x58b290[_0x5d77('0x31')][_0x5d77('0x1d')]);}_0x1d84f2[_0x5d77('0x39')]=qs['sort'](_0x58b290['query']['sort']);_0x1d84f2[_0x5d77('0x3a')]=qs[_0x5d77('0x33')](_[_0x5d77('0x3b')](_0x58b290[_0x5d77('0x31')],_0x3ab015['filters']),_0x1b6a89);if(_0x58b290[_0x5d77('0x31')][_0x5d77('0x3c')]){_0x1d84f2['where']=_['merge'](_0x1d84f2[_0x5d77('0x3a')],{'$or':_[_0x5d77('0x2b')](_0x1b6a89,function(_0x527f84){if(_0x527f84[_0x5d77('0x3d')]!=='VIRTUAL'){var _0x30c5f2={};_0x30c5f2[_0x527f84[_0x5d77('0x30')]]={'$like':'%'+_0x58b290[_0x5d77('0x31')][_0x5d77('0x3c')]+'%'};return _0x30c5f2;}})});}_0x1d84f2=_[_0x5d77('0x3e')]({},_0x1d84f2,_0x58b290[_0x5d77('0x3f')]);var _0x2c18b0={'where':_0x1d84f2[_0x5d77('0x3a')]};return db[_0x5d77('0x2c')][_0x5d77('0x1f')](_0x2c18b0)[_0x5d77('0x25')](function(_0x20dfbe){_0x4493b4[_0x5d77('0x1f')]=_0x20dfbe;if(_0x58b290['query'][_0x5d77('0x40')]){_0x1d84f2[_0x5d77('0x41')]=[{'all':!![]}];}return db['VtigerAccount'][_0x5d77('0x42')](_0x1d84f2);})[_0x5d77('0x25')](function(_0x9ecf24){_0x4493b4[_0x5d77('0x43')]=_0x9ecf24;return _0x4493b4;})['then'](respondWithFilteredResult(_0x3d7af2,_0x1d84f2))[_0x5d77('0x44')](handleError(_0x3d7af2,null));};exports[_0x5d77('0x45')]=function(_0x32a05a,_0x5da138){var _0x125d88={'raw':![],'where':{'id':_0x32a05a['params']['id']}},_0x588c8a={};_0x588c8a[_0x5d77('0x2f')]=_[_0x5d77('0x32')](db['VtigerAccount']['rawAttributes']);_0x588c8a[_0x5d77('0x31')]=_[_0x5d77('0x32')](_0x32a05a['query']);_0x588c8a[_0x5d77('0x33')]=_[_0x5d77('0x34')](_0x588c8a['model'],_0x588c8a[_0x5d77('0x31')]);_0x125d88[_0x5d77('0x36')]=_['intersection'](_0x588c8a[_0x5d77('0x2f')],qs['fields'](_0x32a05a[_0x5d77('0x31')][_0x5d77('0x35')]));_0x125d88[_0x5d77('0x36')]=_0x125d88[_0x5d77('0x36')][_0x5d77('0x46')]?_0x125d88[_0x5d77('0x36')]:_0x588c8a[_0x5d77('0x2f')];if(_0x32a05a[_0x5d77('0x31')][_0x5d77('0x40')]){_0x125d88[_0x5d77('0x41')]=[{'all':!![]}];}_0x125d88=_['merge']({},_0x125d88,_0x32a05a[_0x5d77('0x3f')]);return db['VtigerAccount'][_0x5d77('0x47')](_0x125d88)[_0x5d77('0x25')](handleEntityNotFound(_0x5da138,null))[_0x5d77('0x25')](respondWithResult(_0x5da138,null))[_0x5d77('0x44')](handleError(_0x5da138,null));};exports[_0x5d77('0x48')]=function(_0x28a5f2,_0x15e020){return db[_0x5d77('0x2c')][_0x5d77('0x48')](_0x28a5f2[_0x5d77('0x49')],{})[_0x5d77('0x25')](respondWithResult(_0x15e020,0xc9))[_0x5d77('0x44')](handleError(_0x15e020,null));};exports['update']=function(_0x4beda7,_0x583ba0){if(_0x4beda7[_0x5d77('0x49')]['id']){delete _0x4beda7[_0x5d77('0x49')]['id'];}return db[_0x5d77('0x2c')][_0x5d77('0x47')]({'where':{'id':_0x4beda7[_0x5d77('0x4a')]['id']}})[_0x5d77('0x25')](handleEntityNotFound(_0x583ba0,null))[_0x5d77('0x25')](saveUpdates(_0x4beda7[_0x5d77('0x49')],null))[_0x5d77('0x25')](respondWithResult(_0x583ba0,null))[_0x5d77('0x44')](handleError(_0x583ba0,null));};exports['destroy']=function(_0x1eca74,_0x295301){return db['VtigerAccount'][_0x5d77('0x47')]({'where':{'id':_0x1eca74[_0x5d77('0x4a')]['id']}})[_0x5d77('0x25')](handleEntityNotFound(_0x295301,null))[_0x5d77('0x25')](removeEntity(_0x295301,null))['catch'](handleError(_0x295301,null));};exports[_0x5d77('0x4b')]=function(_0x452246,_0x35afb0,_0xc50653){var _0x51a590={};var _0x59cc74={};var _0x1164f1;var _0x58bf04;return db[_0x5d77('0x2c')]['findOne']({'where':{'id':_0x452246[_0x5d77('0x4a')]['id']}})['then'](handleEntityNotFound(_0x35afb0,null))[_0x5d77('0x25')](function(_0x269fcf){if(_0x269fcf){_0x1164f1=_0x269fcf;_0x59cc74['model']=_[_0x5d77('0x32')](db['VtigerConfiguration'][_0x5d77('0x4c')]);_0x59cc74[_0x5d77('0x31')]=_['keys'](_0x452246[_0x5d77('0x31')]);_0x59cc74[_0x5d77('0x33')]=_[_0x5d77('0x34')](_0x59cc74[_0x5d77('0x2f')],_0x59cc74[_0x5d77('0x31')]);_0x51a590['attributes']=_[_0x5d77('0x34')](_0x59cc74['model'],qs['fields'](_0x452246['query'][_0x5d77('0x35')]));_0x51a590['attributes']=_0x51a590[_0x5d77('0x36')][_0x5d77('0x46')]?_0x51a590[_0x5d77('0x36')]:_0x59cc74[_0x5d77('0x2f')];_0x51a590['order']=qs[_0x5d77('0x4d')](_0x452246[_0x5d77('0x31')][_0x5d77('0x4d')]);_0x51a590['where']=qs['filters'](_[_0x5d77('0x3b')](_0x452246['query'],_0x59cc74[_0x5d77('0x33')]));if(_0x452246['query'][_0x5d77('0x3c')]){_0x51a590[_0x5d77('0x3a')]=_[_0x5d77('0x3e')](_0x51a590[_0x5d77('0x3a')],{'$or':_[_0x5d77('0x2b')](_0x51a590[_0x5d77('0x36')],function(_0x3b3d94){var _0x436c10={};_0x436c10[_0x3b3d94]={'$like':'%'+_0x452246['query'][_0x5d77('0x3c')]+'%'};return _0x436c10;})});}_0x51a590=_[_0x5d77('0x3e')]({},_0x51a590,_0x452246['options']);return _0x1164f1['getConfigurations'](_0x51a590);}})[_0x5d77('0x25')](function(_0x4b494c){if(_0x4b494c){_0x58bf04=_0x4b494c[_0x5d77('0x46')];if(!_0x452246[_0x5d77('0x31')][_0x5d77('0x37')](_0x5d77('0x38'))){_0x51a590[_0x5d77('0x20')]=qs[_0x5d77('0x20')](_0x452246['query'][_0x5d77('0x20')]);_0x51a590[_0x5d77('0x1d')]=qs[_0x5d77('0x1d')](_0x452246[_0x5d77('0x31')][_0x5d77('0x1d')]);}return _0x1164f1[_0x5d77('0x4b')](_0x51a590);}})[_0x5d77('0x25')](function(_0x54d548){if(_0x54d548){return _0x54d548?{'count':_0x58bf04,'rows':_0x54d548}:null;}})[_0x5d77('0x25')](respondWithResult(_0x35afb0,null))[_0x5d77('0x44')](handleError(_0x35afb0,null));};exports[_0x5d77('0x4e')]=function(_0x4fbff6,_0x4d8481,_0x856bd){if(_0x4fbff6['body']['id']){delete _0x4fbff6[_0x5d77('0x49')]['id'];}return db['VtigerAccount'][_0x5d77('0x4f')]({'where':{'id':_0x4fbff6[_0x5d77('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4d8481,null))[_0x5d77('0x25')](function(_0x446f1e){if(_0x446f1e){_0x4fbff6[_0x5d77('0x49')][_0x5d77('0x50')]=_0x446f1e['id'];_0x4fbff6[_0x5d77('0x49')][_0x5d77('0x51')]=integrations['getSubjects'](_0x4fbff6[_0x5d77('0x49')]['channel'],_0x4fbff6['body'][_0x5d77('0x3d')]);_0x4fbff6[_0x5d77('0x49')]['Descriptions']=integrations[_0x5d77('0x52')](_0x4fbff6['body'][_0x5d77('0x53')],_0x4fbff6['body'][_0x5d77('0x3d')]);return db['VtigerConfiguration'][_0x5d77('0x48')](_0x4fbff6[_0x5d77('0x49')],{'include':[{'model':db['VtigerField'],'as':_0x5d77('0x51')},{'model':db['VtigerField'],'as':_0x5d77('0x54')}]});}return null;})[_0x5d77('0x25')](respondWithResult(_0x4d8481,null))[_0x5d77('0x44')](handleError(_0x4d8481,null));};var md5=require(_0x5d77('0x55'));exports['getFields']=function(_0x13a081,_0x4df716,_0x4a4487){var _0x40142b=null;var _0x2bcffb=null;var _0x27e981=null;var _0x3be094=null;var _0x5ec585='';return db[_0x5d77('0x2c')]['findOne']({'where':{'id':_0x13a081[_0x5d77('0x4a')]['id']},'attributes':['id',_0x5d77('0x30'),_0x5d77('0x56'),_0x5d77('0x57'),_0x5d77('0x58'),_0x5d77('0x59'),'serverUrl',_0x5d77('0x5a')]})[_0x5d77('0x25')](handleEntityNotFound(_0x4df716,null))['then'](function(_0x52d3f2){if(_0x52d3f2){_0x40142b=_0x52d3f2[_0x5d77('0x56')];_0x2bcffb=_0x52d3f2[_0x5d77('0x5a')];_0x27e981=_0x52d3f2['moduleName'];_0x5ec585=_0x52d3f2['remoteUri'];var _0x5e81a1=_0x5ec585[_0x5d77('0x5b')](-0x1);if(_0x5e81a1==='/'){_0x5ec585=_0x5ec585[_0x5d77('0x5c')](0x0,_0x5ec585[_0x5d77('0x5d')](_0x5e81a1));}_0x3be094=util[_0x5d77('0x5e')]('%s/webservice.php',_0x5ec585);var _0x50032b={'method':_0x5d77('0x5f'),'uri':_0x3be094,'qs':{'operation':_0x5d77('0x60'),'username':_0x52d3f2[_0x5d77('0x56')]},'json':!![]};return rp(_0x50032b);}})[_0x5d77('0x25')](function(_0x54c854){if(_0x54c854[_0x5d77('0x61')]){var _0x451372={'method':_0x5d77('0x62'),'uri':_0x3be094,'form':{'operation':_0x5d77('0x63'),'username':_0x40142b,'accessKey':md5(_0x54c854[_0x5d77('0x64')][_0x5d77('0x65')]+_0x2bcffb)},'json':!![]};return rp(_0x451372);}})['then'](function(_0x162ff0){if(_0x162ff0[_0x5d77('0x61')]){var _0x360470={'method':_0x5d77('0x5f'),'uri':_0x3be094,'qs':{'operation':_0x5d77('0x66'),'username':_0x40142b,'sessionName':_0x162ff0[_0x5d77('0x64')][_0x5d77('0x67')],'elementType':_0x27e981},'json':!![]};return rp(_0x360470);}})[_0x5d77('0x25')](function(_0x595a55){if(_0x595a55[_0x5d77('0x61')]){var _0x41e053=[_0x5d77('0x68'),_0x5d77('0x69'),_0x5d77('0x6a')];_[_0x5d77('0x6b')](_0x595a55['result'][_0x5d77('0x35')],function(_0x16e71c){return _0x41e053[_0x5d77('0x6c')](_0x16e71c['type'][_0x5d77('0x30')]);});_[_0x5d77('0x6b')](_0x595a55['result'][_0x5d77('0x35')],function(_0x33549d){return _0x33549d[_0x5d77('0x6d')]===_0x5d77('0x6e');});return{'count':_0x595a55['result'][_0x5d77('0x35')]['length'],'rows':_['map'](_0x595a55[_0x5d77('0x64')][_0x5d77('0x35')],function(_0x75c6b3){return{'id':_0x75c6b3['name'],'name':_0x75c6b3['label'],'custom':_[_0x5d77('0x6f')](_0x75c6b3[_0x5d77('0x30')],_0x5d77('0x70'))?!![]:![],'options':_0x75c6b3[_0x5d77('0x3d')][_0x5d77('0x30')]===_0x5d77('0x71')&&_0x75c6b3[_0x5d77('0x3d')][_0x5d77('0x72')][_0x5d77('0x46')]>0x0?_['map'](_0x75c6b3[_0x5d77('0x3d')][_0x5d77('0x72')],function(_0xbfbb33){return{'name':_0xbfbb33[_0x5d77('0x73')],'value':_0xbfbb33['value']};}):[]};})};}})[_0x5d77('0x25')](respondWithResult(_0x4df716,null))[_0x5d77('0x44')](function(_0x4b9059){console[_0x5d77('0x74')](_0x5d77('0x75')+_0x4b9059);var _0x13d0db=_0x13a081[_0x5d77('0x31')][_0x5d77('0x76')]?0x1f4:_0x4b9059[_0x5d77('0x77')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x13d0db,JSON[_0x5d77('0x78')](_0x4b9059));delete _0x4b9059[_0x5d77('0x30')];if(_0x13d0db===0x191){_0x13d0db=0x190;}_0x4df716[_0x5d77('0x1a')](_0x13d0db)[_0x5d77('0x29')](_0x13a081['query'][_0x5d77('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x4b9059[_0x5d77('0x77')]}:_0x4b9059);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 39c45c6..1940037 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 _0x29e4=['VtigerAccount','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x29e4,0x145));var _0x429e=function(_0x1775f9,_0x39665f){_0x1775f9=_0x1775f9-0x0;var _0x546b95=_0x29e4[_0x1775f9];return _0x546b95;};'use strict';var _=require(_0x429e('0x0'));var util=require(_0x429e('0x1'));var logger=require(_0x429e('0x2'))(_0x429e('0x3'));var moment=require(_0x429e('0x4'));var BPromise=require(_0x429e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x429e('0x6'));var config=require(_0x429e('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x429e('0x8'));module[_0x429e('0x9')]=function(_0x4d0dd4,_0x4f15f7){return _0x4d0dd4[_0x429e('0xa')](_0x429e('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x974c=['define','VtigerAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration'];(function(_0x3fcd90,_0x160e44){var _0x5668af=function(_0x3c5663){while(--_0x3c5663){_0x3fcd90['push'](_0x3fcd90['shift']());}};_0x5668af(++_0x160e44);}(_0x974c,0x147));var _0xc974=function(_0x188e8d,_0x5833f7){_0x188e8d=_0x188e8d-0x0;var _0x59fc69=_0x974c[_0x188e8d];return _0x59fc69;};'use strict';var _=require(_0xc974('0x0'));var util=require(_0xc974('0x1'));var logger=require(_0xc974('0x2'))(_0xc974('0x3'));var moment=require(_0xc974('0x4'));var BPromise=require(_0xc974('0x5'));var rp=require(_0xc974('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc974('0x7'));var config=require(_0xc974('0x8'));var attributes=require(_0xc974('0x9'));var integrations=require(_0xc974('0xa'));module['exports']=function(_0x2daf20,_0xe3becc){return _0x2daf20[_0xc974('0xb')](_0xc974('0xc'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 8e78b8d..51a3dc7 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 _0x7334=['code','message','request\x20sent','result','GetVtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','VtigerAccount','find','ShowVtigerAccount','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7334,0x184));var _0x4733=function(_0x323df2,_0x415c2b){_0x323df2=_0x323df2-0x0;var _0x4f1bde=_0x7334[_0x323df2];return _0x4f1bde;};'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});function respondWithRpcPromise(_0x283754,_0x12cafa,_0x43d95c){return new BPromise(function(_0x8257cf,_0x3562b7){return client[_0x4733('0xb')](_0x283754,_0x43d95c)[_0x4733('0xc')](function(_0x2d5fde){logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,'request\x20sent');logger[_0x4733('0xf')](_0x4733('0x10'),_0x12cafa,'request\x20sent',JSON[_0x4733('0x11')](_0x2d5fde));if(_0x2d5fde['error']){if(_0x2d5fde[_0x4733('0x12')][_0x4733('0x13')]===0x1f4){logger[_0x4733('0x12')](_0x4733('0xe'),_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x3562b7(_0x2d5fde[_0x4733('0x12')]['message']);}logger[_0x4733('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x8257cf(_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);}else{logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,_0x4733('0x15'));_0x8257cf(_0x2d5fde[_0x4733('0x16')][_0x4733('0x14')]);}})['catch'](function(_0x2c0031){logger[_0x4733('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x12cafa,_0x2c0031);_0x3562b7(_0x2c0031);});});}exports[_0x4733('0x17')]=function(_0x1d2fb6){var _0x2aa223=this;return new Promise(function(_0x384e0c,_0x579f67){return db['VtigerAccount'][_0x4733('0x18')]({'raw':_0x1d2fb6[_0x4733('0x19')]?_0x1d2fb6['options'][_0x4733('0x1a')]===undefined?!![]:![]:!![],'where':_0x1d2fb6[_0x4733('0x19')]?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1b')]||null:null,'attributes':_0x1d2fb6['options']?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1c')]||null:null,'limit':_0x1d2fb6['options']?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1d')]||null:null,'include':_0x1d2fb6['options']?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1e')],function(_0x24db74){return{'model':db[_0x24db74[_0x4733('0x20')]],'as':_0x24db74['as'],'attributes':_0x24db74[_0x4733('0x1c')],'include':_0x24db74['include']?_[_0x4733('0x1f')](_0x24db74[_0x4733('0x1e')],function(_0x7884e5){return{'model':db[_0x7884e5[_0x4733('0x20')]],'as':_0x7884e5['as'],'attributes':_0x7884e5[_0x4733('0x1c')],'include':_0x7884e5[_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x7884e5[_0x4733('0x1e')],function(_0x13bc12){return{'model':db[_0x13bc12[_0x4733('0x20')]],'as':_0x13bc12['as'],'attributes':_0x13bc12['attributes']};}):[]};}):[]};}):[]:[]})[_0x4733('0xc')](function(_0x4c91bc){logger['info'](_0x4733('0x17'),_0x1d2fb6);logger['debug'](_0x4733('0x17'),_0x1d2fb6,JSON['stringify'](_0x4c91bc));_0x384e0c(_0x4c91bc);})['catch'](function(_0x517c73){logger[_0x4733('0x12')](_0x4733('0x17'),_0x517c73[_0x4733('0x14')],_0x1d2fb6);_0x579f67(_0x2aa223[_0x4733('0x12')](0x1f4,_0x517c73['message']));});});};exports['ShowVtigerAccount']=function(_0x50f67e){var _0x2b2757=this;return new Promise(function(_0x56872b,_0x5a4814){return db[_0x4733('0x21')][_0x4733('0x22')]({'raw':_0x50f67e[_0x4733('0x19')]?_0x50f67e['options']['raw']===undefined?!![]:![]:!![],'where':_0x50f67e[_0x4733('0x19')]?_0x50f67e[_0x4733('0x19')][_0x4733('0x1b')]||null:null,'attributes':_0x50f67e[_0x4733('0x19')]?_0x50f67e[_0x4733('0x19')]['attributes']||null:null,'include':_0x50f67e[_0x4733('0x19')]?_0x50f67e[_0x4733('0x19')][_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x50f67e[_0x4733('0x19')]['include'],function(_0x570bc6){return{'model':db[_0x570bc6[_0x4733('0x20')]],'as':_0x570bc6['as'],'attributes':_0x570bc6[_0x4733('0x1c')],'include':_0x570bc6[_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x570bc6[_0x4733('0x1e')],function(_0x5e31c8){return{'model':db[_0x5e31c8[_0x4733('0x20')]],'as':_0x5e31c8['as'],'attributes':_0x5e31c8[_0x4733('0x1c')],'include':_0x5e31c8[_0x4733('0x1e')]?_['map'](_0x5e31c8[_0x4733('0x1e')],function(_0x10a5e9){return{'model':db[_0x10a5e9[_0x4733('0x20')]],'as':_0x10a5e9['as'],'attributes':_0x10a5e9[_0x4733('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4733('0xc')](function(_0x311c1d){logger[_0x4733('0xd')](_0x4733('0x23'),_0x50f67e);logger['debug'](_0x4733('0x23'),_0x50f67e,JSON['stringify'](_0x311c1d));_0x56872b(_0x311c1d);})[_0x4733('0x24')](function(_0x29db03){logger[_0x4733('0x12')](_0x4733('0x23'),_0x29db03[_0x4733('0x14')],_0x50f67e);_0x5a4814(_0x2b2757[_0x4733('0x12')](0x1f4,_0x29db03[_0x4733('0x14')]));});});}; \ No newline at end of file +var _0xde2c=['findAll','options','raw','where','limit','include','model','attributes','GetVtigerAccount','stringify','find','map','ShowVtigerAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','VtigerAccount'];(function(_0x5c619e,_0xd5d312){var _0x4e4572=function(_0x467172){while(--_0x467172){_0x5c619e['push'](_0x5c619e['shift']());}};_0x4e4572(++_0xd5d312);}(_0xde2c,0x7f));var _0xcde2=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0xde2c[_0x4843f9];return _0x193c6a;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var BPromise=require(_0xcde2('0x3'));var rs=require(_0xcde2('0x4'));var fs=require('fs');var Redis=require(_0xcde2('0x5'));var db=require(_0xcde2('0x6'))['db'];var utils=require(_0xcde2('0x7'));var logger=require('../../config/logger')(_0xcde2('0x8'));var config=require(_0xcde2('0x9'));var jayson=require(_0xcde2('0xa'));var client=jayson[_0xcde2('0xb')][_0xcde2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53c558,_0x2b27ef,_0x385e83){return new BPromise(function(_0x9c7036,_0x544235){return client['request'](_0x53c558,_0x385e83)[_0xcde2('0xd')](function(_0x1c8b3c){logger['info'](_0xcde2('0xe'),_0x2b27ef,_0xcde2('0xf'));logger[_0xcde2('0x10')](_0xcde2('0x11'),_0x2b27ef,'request\x20sent',JSON['stringify'](_0x1c8b3c));if(_0x1c8b3c[_0xcde2('0x12')]){if(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x13')]===0x1f4){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x1c8b3c[_0xcde2('0x12')]['message']);return _0x544235(_0x1c8b3c[_0xcde2('0x12')]['message']);}logger[_0xcde2('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x2b27ef,_0x1c8b3c['error'][_0xcde2('0x14')]);return _0x9c7036(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x14')]);}else{logger[_0xcde2('0x15')](_0xcde2('0xe'),_0x2b27ef,'request\x20sent');_0x9c7036(_0x1c8b3c[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x198840){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x198840);_0x544235(_0x198840);});});}exports['GetVtigerAccount']=function(_0x4fd5aa){var _0x4fe586=this;return new Promise(function(_0x2b4468,_0x582e84){return db[_0xcde2('0x18')][_0xcde2('0x19')]({'raw':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa['options'][_0xcde2('0x1b')]===undefined?!![]:![]:!![],'where':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1c')]||null:null,'attributes':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa['options']['attributes']||null:null,'limit':_0x4fd5aa['options']?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1d')]||null:null,'include':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1e')]?_['map'](_0x4fd5aa[_0xcde2('0x1a')]['include'],function(_0x280d8c){return{'model':db[_0x280d8c[_0xcde2('0x1f')]],'as':_0x280d8c['as'],'attributes':_0x280d8c[_0xcde2('0x20')],'include':_0x280d8c['include']?_['map'](_0x280d8c[_0xcde2('0x1e')],function(_0x207a12){return{'model':db[_0x207a12[_0xcde2('0x1f')]],'as':_0x207a12['as'],'attributes':_0x207a12[_0xcde2('0x20')],'include':_0x207a12[_0xcde2('0x1e')]?_['map'](_0x207a12[_0xcde2('0x1e')],function(_0x45275a){return{'model':db[_0x45275a[_0xcde2('0x1f')]],'as':_0x45275a['as'],'attributes':_0x45275a['attributes']};}):[]};}):[]};}):[]:[]})[_0xcde2('0xd')](function(_0x348ca1){logger[_0xcde2('0x15')](_0xcde2('0x21'),_0x4fd5aa);logger[_0xcde2('0x10')](_0xcde2('0x21'),_0x4fd5aa,JSON[_0xcde2('0x22')](_0x348ca1));_0x2b4468(_0x348ca1);})[_0xcde2('0x17')](function(_0x5bf1e6){logger[_0xcde2('0x12')]('GetVtigerAccount',_0x5bf1e6[_0xcde2('0x14')],_0x4fd5aa);_0x582e84(_0x4fe586[_0xcde2('0x12')](0x1f4,_0x5bf1e6[_0xcde2('0x14')]));});});};exports['ShowVtigerAccount']=function(_0xae46dc){var _0x28fedd=this;return new Promise(function(_0x58afb1,_0x26ec42){return db[_0xcde2('0x18')][_0xcde2('0x23')]({'raw':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x1b')]===undefined?!![]:![]:!![],'where':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')]['where']||null:null,'attributes':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x20')]||null:null,'include':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc['options'][_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x1e')],function(_0x498339){return{'model':db[_0x498339[_0xcde2('0x1f')]],'as':_0x498339['as'],'attributes':_0x498339[_0xcde2('0x20')],'include':_0x498339[_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0x498339['include'],function(_0xb9c8d2){return{'model':db[_0xb9c8d2[_0xcde2('0x1f')]],'as':_0xb9c8d2['as'],'attributes':_0xb9c8d2[_0xcde2('0x20')],'include':_0xb9c8d2[_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0xb9c8d2['include'],function(_0x2cd313){return{'model':db[_0x2cd313[_0xcde2('0x1f')]],'as':_0x2cd313['as'],'attributes':_0x2cd313[_0xcde2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcde2('0xd')](function(_0x4a64c1){logger['info'](_0xcde2('0x25'),_0xae46dc);logger[_0xcde2('0x10')](_0xcde2('0x25'),_0xae46dc,JSON[_0xcde2('0x22')](_0x4a64c1));_0x58afb1(_0x4a64c1);})[_0xcde2('0x17')](function(_0x45af6e){logger[_0xcde2('0x12')](_0xcde2('0x25'),_0x45af6e[_0xcde2('0x14')],_0xae46dc);_0x26ec42(_0x28fedd['error'](0x1f4,_0x45af6e[_0xcde2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 9109afa..1db3477 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 _0x0897=['create','put','delete','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post'];(function(_0x88e558,_0x4e8960){var _0x5c2b09=function(_0x47653c){while(--_0x47653c){_0x88e558['push'](_0x88e558['shift']());}};_0x5c2b09(++_0x4e8960);}(_0x0897,0x122));var _0x7089=function(_0x3b78b2,_0x252142){_0x3b78b2=_0x3b78b2-0x0;var _0x56ec38=_0x0897[_0x3b78b2];return _0x56ec38;};'use strict';var multer=require(_0x7089('0x0'));var util=require(_0x7089('0x1'));var path=require(_0x7089('0x2'));var timeout=require('connect-timeout');var express=require(_0x7089('0x3'));var router=express[_0x7089('0x4')]();var fs_extra=require(_0x7089('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7089('0x6'));var controller=require(_0x7089('0x7'));router['get']('/',auth[_0x7089('0x8')](),controller['index']);router[_0x7089('0x9')](_0x7089('0xa'),auth['isAuthenticated'](),controller[_0x7089('0xb')]);router[_0x7089('0x9')](_0x7089('0xc'),auth[_0x7089('0x8')](),controller[_0x7089('0xd')]);router[_0x7089('0x9')](_0x7089('0xe'),auth[_0x7089('0x8')](),controller[_0x7089('0xf')]);router['get'](_0x7089('0x10'),auth[_0x7089('0x8')](),controller['getDescriptions']);router[_0x7089('0x11')]('/',auth[_0x7089('0x8')](),controller[_0x7089('0x12')]);router[_0x7089('0x13')](_0x7089('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x7089('0x14')]('/:id',auth[_0x7089('0x8')](),controller['destroy']);module[_0x7089('0x15')]=router; \ No newline at end of file +var _0xdb0a=['/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x5d689f,_0x28c89d){var _0x35f888=function(_0x227db0){while(--_0x227db0){_0x5d689f['push'](_0x5d689f['shift']());}};_0x35f888(++_0x28c89d);}(_0xdb0a,0x1d8));var _0xadb0=function(_0x1a283d,_0x6afd52){_0x1a283d=_0x1a283d-0x0;var _0x323fe7=_0xdb0a[_0x1a283d];return _0x323fe7;};'use strict';var multer=require(_0xadb0('0x0'));var util=require(_0xadb0('0x1'));var path=require(_0xadb0('0x2'));var timeout=require(_0xadb0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xadb0('0x4'));var auth=require(_0xadb0('0x5'));var interaction=require(_0xadb0('0x6'));var config=require(_0xadb0('0x7'));var controller=require('./intVtigerConfiguration.controller');router[_0xadb0('0x8')]('/',auth[_0xadb0('0x9')](),controller[_0xadb0('0xa')]);router[_0xadb0('0x8')](_0xadb0('0xb'),auth[_0xadb0('0x9')](),controller[_0xadb0('0xc')]);router[_0xadb0('0x8')]('/:id/fields',auth[_0xadb0('0x9')](),controller[_0xadb0('0xd')]);router[_0xadb0('0x8')](_0xadb0('0xe'),auth[_0xadb0('0x9')](),controller[_0xadb0('0xf')]);router[_0xadb0('0x8')](_0xadb0('0x10'),auth[_0xadb0('0x9')](),controller['getDescriptions']);router[_0xadb0('0x11')]('/',auth[_0xadb0('0x9')](),controller['create']);router['put'](_0xadb0('0xb'),auth[_0xadb0('0x9')](),controller['update']);router[_0xadb0('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xadb0('0x13')]);module[_0xadb0('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index c45372e..86e4414 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 _0x2191=['exports','STRING'];(function(_0x2c8342,_0x323485){var _0x1716c1=function(_0x9b14d9){while(--_0x9b14d9){_0x2c8342['push'](_0x2c8342['shift']());}};_0x1716c1(++_0x323485);}(_0x2191,0x1ec));var _0x1219=function(_0x98eff7,_0x4fa7f9){_0x98eff7=_0x98eff7-0x0;var _0x593a9=_0x2191[_0x98eff7];return _0x593a9;};'use strict';var Sequelize=require('sequelize');module[_0x1219('0x0')]={'name':{'type':Sequelize[_0x1219('0x1')]},'description':{'type':Sequelize[_0x1219('0x1')]}}; \ No newline at end of file +var _0x8a36=['exports','STRING'];(function(_0x164e77,_0x4d36bc){var _0x5ced26=function(_0x407b5d){while(--_0x407b5d){_0x164e77['push'](_0x164e77['shift']());}};_0x5ced26(++_0x4d36bc);}(_0x8a36,0xd0));var _0x68a3=function(_0x5beeac,_0x1a53f7){_0x5beeac=_0x5beeac-0x0;var _0x456ca8=_0x8a36[_0x5beeac];return _0x456ca8;};'use strict';var Sequelize=require('sequelize');module[_0x68a3('0x0')]={'name':{'type':Sequelize[_0x68a3('0x1')]},'description':{'type':Sequelize[_0x68a3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index e9e5be4..7fcc163 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 _0xa62c=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','VtigerConfiguration','catch','show','params','find','create','body','getFields','VtigerField','order','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x8facad,_0x216fb6){var _0x140786=function(_0xb5c668){while(--_0xb5c668){_0x8facad['push'](_0x8facad['shift']());}};_0x140786(++_0x216fb6);}(_0xa62c,0x70));var _0xca62=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0xa62c[_0x277721];return _0x286051;};'use strict';var emlformat=require(_0xca62('0x0'));var rimraf=require(_0xca62('0x1'));var zipdir=require(_0xca62('0x2'));var jsonpatch=require(_0xca62('0x3'));var rp=require(_0xca62('0x4'));var moment=require(_0xca62('0x5'));var BPromise=require(_0xca62('0x6'));var Mustache=require('mustache');var util=require(_0xca62('0x7'));var path=require(_0xca62('0x8'));var sox=require(_0xca62('0x9'));var csv=require(_0xca62('0xa'));var ejs=require(_0xca62('0xb'));var fs=require('fs');var fs_extra=require(_0xca62('0xc'));var _=require(_0xca62('0xd'));var squel=require(_0xca62('0xe'));var crypto=require('crypto');var jsforce=require(_0xca62('0xf'));var deskjs=require(_0xca62('0x10'));var toCsv=require(_0xca62('0xa'));var querystring=require('querystring');var Papa=require(_0xca62('0x11'));var Redis=require(_0xca62('0x12'));var authService=require(_0xca62('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xca62('0x14'));var hardwareService=require(_0xca62('0x15'));var logger=require(_0xca62('0x16'))(_0xca62('0x17'));var utils=require(_0xca62('0x18'));var config=require(_0xca62('0x19'));var licenseUtil=require(_0xca62('0x1a'));var db=require(_0xca62('0x1b'))['db'];function respondWithStatusCode(_0x2ba621,_0x59cfd8){_0x59cfd8=_0x59cfd8||0xcc;return function(_0x23a20b){if(_0x23a20b){return _0x2ba621[_0xca62('0x1c')](_0x59cfd8);}return _0x2ba621[_0xca62('0x1d')](_0x59cfd8)['end']();};}function respondWithResult(_0x4a0835,_0x5446a3){_0x5446a3=_0x5446a3||0xc8;return function(_0x307a30){if(_0x307a30){return _0x4a0835['status'](_0x5446a3)[_0xca62('0x1e')](_0x307a30);}};}function respondWithFilteredResult(_0x1634b2,_0x539a04){return function(_0x4f93fc){if(_0x4f93fc){var _0x21eae8=typeof _0x539a04[_0xca62('0x1f')]===_0xca62('0x20')&&typeof _0x539a04['limit']===_0xca62('0x20');var _0x98db4c=_0x4f93fc[_0xca62('0x21')];var _0x58d6f6=_0x21eae8?0x0:_0x539a04[_0xca62('0x1f')];var _0x34a370=_0x21eae8?_0x4f93fc[_0xca62('0x21')]:_0x539a04[_0xca62('0x1f')]+_0x539a04[_0xca62('0x22')];var _0x1b62bb;if(_0x34a370>=_0x98db4c){_0x34a370=_0x98db4c;_0x1b62bb=0xc8;}else{_0x1b62bb=0xce;}_0x1634b2[_0xca62('0x1d')](_0x1b62bb);return _0x1634b2[_0xca62('0x23')](_0xca62('0x24'),_0x58d6f6+'-'+_0x34a370+'/'+_0x98db4c)[_0xca62('0x1e')](_0x4f93fc);}return null;};}function patchUpdates(_0x133132){return function(_0x1dff07){try{jsonpatch['apply'](_0x1dff07,_0x133132,!![]);}catch(_0x4c05c2){return BPromise['reject'](_0x4c05c2);}return _0x1dff07[_0xca62('0x25')]();};}function saveUpdates(_0x138177,_0x3f2a52){return function(_0x3d4730){if(_0x3d4730){return _0x3d4730[_0xca62('0x26')](_0x138177)[_0xca62('0x27')](function(_0x364c8d){return _0x364c8d;});}return null;};}function removeEntity(_0x3eb516,_0x4b1c5a){return function(_0x486763){if(_0x486763){return _0x486763[_0xca62('0x28')]()['then'](function(){_0x3eb516[_0xca62('0x1d')](0xcc)[_0xca62('0x29')]();});}};}function handleEntityNotFound(_0x32933c,_0x3e90eb){return function(_0x20e970){if(!_0x20e970){_0x32933c[_0xca62('0x1c')](0x194);}return _0x20e970;};}function handleError(_0x4e05d4,_0x483aae){_0x483aae=_0x483aae||0x1f4;return function(_0xd03a0b){logger[_0xca62('0x2a')](_0xd03a0b['stack']);if(_0xd03a0b['name']){delete _0xd03a0b[_0xca62('0x2b')];}_0x4e05d4['status'](_0x483aae)[_0xca62('0x2c')](_0xd03a0b);};}exports[_0xca62('0x2d')]=function(_0x1ed588,_0x107187){var _0x37dd79={},_0x4e4c0c={},_0x4958d7={'count':0x0,'rows':[]};var _0x403208=_[_0xca62('0x2e')](db['VtigerConfiguration'][_0xca62('0x2f')],function(_0x2b8aee){return{'name':_0x2b8aee[_0xca62('0x30')],'type':_0x2b8aee[_0xca62('0x31')][_0xca62('0x32')]};});_0x4e4c0c[_0xca62('0x33')]=_[_0xca62('0x2e')](_0x403208,_0xca62('0x2b'));_0x4e4c0c[_0xca62('0x34')]=_[_0xca62('0x35')](_0x1ed588[_0xca62('0x34')]);_0x4e4c0c[_0xca62('0x36')]=_[_0xca62('0x37')](_0x4e4c0c[_0xca62('0x33')],_0x4e4c0c[_0xca62('0x34')]);_0x37dd79[_0xca62('0x38')]=_[_0xca62('0x37')](_0x4e4c0c[_0xca62('0x33')],qs[_0xca62('0x39')](_0x1ed588[_0xca62('0x34')]['fields']));_0x37dd79['attributes']=_0x37dd79[_0xca62('0x38')][_0xca62('0x3a')]?_0x37dd79['attributes']:_0x4e4c0c['model'];if(!_0x1ed588[_0xca62('0x34')][_0xca62('0x3b')](_0xca62('0x3c'))){_0x37dd79[_0xca62('0x22')]=qs['limit'](_0x1ed588[_0xca62('0x34')][_0xca62('0x22')]);_0x37dd79['offset']=qs['offset'](_0x1ed588['query'][_0xca62('0x1f')]);}_0x37dd79['order']=qs[_0xca62('0x3d')](_0x1ed588[_0xca62('0x34')][_0xca62('0x3d')]);_0x37dd79[_0xca62('0x3e')]=qs[_0xca62('0x36')](_[_0xca62('0x3f')](_0x1ed588[_0xca62('0x34')],_0x4e4c0c['filters']),_0x403208);if(_0x1ed588[_0xca62('0x34')][_0xca62('0x40')]){_0x37dd79[_0xca62('0x3e')]=_[_0xca62('0x41')](_0x37dd79[_0xca62('0x3e')],{'$or':_[_0xca62('0x2e')](_0x403208,function(_0x45cc1a){if(_0x45cc1a[_0xca62('0x31')]!=='VIRTUAL'){var _0xa66fa4={};_0xa66fa4[_0x45cc1a[_0xca62('0x2b')]]={'$like':'%'+_0x1ed588['query']['filter']+'%'};return _0xa66fa4;}})});}_0x37dd79=_[_0xca62('0x41')]({},_0x37dd79,_0x1ed588[_0xca62('0x42')]);var _0x14645c={'where':_0x37dd79[_0xca62('0x3e')]};return db['VtigerConfiguration'][_0xca62('0x21')](_0x14645c)[_0xca62('0x27')](function(_0x117035){_0x4958d7['count']=_0x117035;if(_0x1ed588[_0xca62('0x34')][_0xca62('0x43')]){_0x37dd79[_0xca62('0x44')]=[{'all':!![]}];}return db[_0xca62('0x45')]['findAll'](_0x37dd79);})[_0xca62('0x27')](function(_0x3fe8e4){_0x4958d7['rows']=_0x3fe8e4;return _0x4958d7;})['then'](respondWithFilteredResult(_0x107187,_0x37dd79))[_0xca62('0x46')](handleError(_0x107187,null));};exports[_0xca62('0x47')]=function(_0x19e605,_0xd80dd3){var _0x2c1132={'raw':![],'where':{'id':_0x19e605[_0xca62('0x48')]['id']}},_0x51f7f8={};_0x51f7f8['model']=_[_0xca62('0x35')](db[_0xca62('0x45')][_0xca62('0x2f')]);_0x51f7f8[_0xca62('0x34')]=_[_0xca62('0x35')](_0x19e605[_0xca62('0x34')]);_0x51f7f8['filters']=_['intersection'](_0x51f7f8['model'],_0x51f7f8[_0xca62('0x34')]);_0x2c1132[_0xca62('0x38')]=_['intersection'](_0x51f7f8[_0xca62('0x33')],qs['fields'](_0x19e605[_0xca62('0x34')][_0xca62('0x39')]));_0x2c1132[_0xca62('0x38')]=_0x2c1132['attributes']['length']?_0x2c1132[_0xca62('0x38')]:_0x51f7f8[_0xca62('0x33')];if(_0x19e605[_0xca62('0x34')]['includeAll']){_0x2c1132[_0xca62('0x44')]=[{'all':!![]}];}_0x2c1132=_['merge']({},_0x2c1132,_0x19e605[_0xca62('0x42')]);return db[_0xca62('0x45')][_0xca62('0x49')](_0x2c1132)[_0xca62('0x27')](handleEntityNotFound(_0xd80dd3,null))[_0xca62('0x27')](respondWithResult(_0xd80dd3,null))[_0xca62('0x46')](handleError(_0xd80dd3,null));};exports[_0xca62('0x4a')]=function(_0x31e256,_0x1c14aa){return db[_0xca62('0x45')][_0xca62('0x4a')](_0x31e256[_0xca62('0x4b')],{})[_0xca62('0x27')](respondWithResult(_0x1c14aa,0xc9))[_0xca62('0x46')](handleError(_0x1c14aa,null));};exports[_0xca62('0x26')]=function(_0x510330,_0x39d3bf){if(_0x510330[_0xca62('0x4b')]['id']){delete _0x510330[_0xca62('0x4b')]['id'];}return db[_0xca62('0x45')]['find']({'where':{'id':_0x510330['params']['id']}})['then'](handleEntityNotFound(_0x39d3bf,null))[_0xca62('0x27')](saveUpdates(_0x510330[_0xca62('0x4b')],null))[_0xca62('0x27')](respondWithResult(_0x39d3bf,null))[_0xca62('0x46')](handleError(_0x39d3bf,null));};exports['destroy']=function(_0xe610f2,_0x363203){return db[_0xca62('0x45')][_0xca62('0x49')]({'where':{'id':_0xe610f2[_0xca62('0x48')]['id']}})[_0xca62('0x27')](handleEntityNotFound(_0x363203,null))[_0xca62('0x27')](removeEntity(_0x363203,null))[_0xca62('0x46')](handleError(_0x363203,null));};exports[_0xca62('0x4c')]=function(_0x3f4d4b,_0x3dd4df,_0x5414c6){var _0x41a3ec={};var _0x134b10={};var _0x5cc81a;var _0x511f58;return db[_0xca62('0x45')]['findOne']({'where':{'id':_0x3f4d4b[_0xca62('0x48')]['id']}})[_0xca62('0x27')](handleEntityNotFound(_0x3dd4df,null))[_0xca62('0x27')](function(_0x52702e){if(_0x52702e){_0x5cc81a=_0x52702e;_0x134b10[_0xca62('0x33')]=_[_0xca62('0x35')](db[_0xca62('0x4d')][_0xca62('0x2f')]);_0x134b10['query']=_[_0xca62('0x35')](_0x3f4d4b[_0xca62('0x34')]);_0x134b10[_0xca62('0x36')]=_[_0xca62('0x37')](_0x134b10[_0xca62('0x33')],_0x134b10[_0xca62('0x34')]);_0x41a3ec[_0xca62('0x38')]=_[_0xca62('0x37')](_0x134b10['model'],qs[_0xca62('0x39')](_0x3f4d4b[_0xca62('0x34')]['fields']));_0x41a3ec['attributes']=_0x41a3ec['attributes']['length']?_0x41a3ec['attributes']:_0x134b10[_0xca62('0x33')];_0x41a3ec[_0xca62('0x4e')]=qs[_0xca62('0x3d')](_0x3f4d4b[_0xca62('0x34')][_0xca62('0x3d')]);_0x41a3ec[_0xca62('0x3e')]=qs['filters'](_['pick'](_0x3f4d4b[_0xca62('0x34')],_0x134b10[_0xca62('0x36')]));if(_0x3f4d4b['query'][_0xca62('0x40')]){_0x41a3ec[_0xca62('0x3e')]=_[_0xca62('0x41')](_0x41a3ec[_0xca62('0x3e')],{'$or':_[_0xca62('0x2e')](_0x41a3ec['attributes'],function(_0x28869a){var _0x1d8e13={};_0x1d8e13[_0x28869a]={'$like':'%'+_0x3f4d4b[_0xca62('0x34')][_0xca62('0x40')]+'%'};return _0x1d8e13;})});}_0x41a3ec=_['merge']({},_0x41a3ec,_0x3f4d4b[_0xca62('0x42')]);return _0x5cc81a[_0xca62('0x4c')](_0x41a3ec);}})[_0xca62('0x27')](function(_0x4ac5e0){if(_0x4ac5e0){_0x511f58=_0x4ac5e0[_0xca62('0x3a')];if(!_0x3f4d4b['query'][_0xca62('0x3b')](_0xca62('0x3c'))){_0x41a3ec[_0xca62('0x22')]=qs[_0xca62('0x22')](_0x3f4d4b[_0xca62('0x34')]['limit']);_0x41a3ec[_0xca62('0x1f')]=qs[_0xca62('0x1f')](_0x3f4d4b[_0xca62('0x34')][_0xca62('0x1f')]);}return _0x5cc81a[_0xca62('0x4c')](_0x41a3ec);}})[_0xca62('0x27')](function(_0x4f8936){if(_0x4f8936){return _0x4f8936?{'count':_0x511f58,'rows':_0x4f8936}:null;}})[_0xca62('0x27')](respondWithResult(_0x3dd4df,null))['catch'](handleError(_0x3dd4df,null));};exports['getSubjects']=function(_0xa012c9,_0x434a72,_0x5343a6){var _0x23073c={};var _0x2448f3={};var _0x3bcb83;var _0x5e51c1;return db['VtigerConfiguration'][_0xca62('0x4f')]({'where':{'id':_0xa012c9[_0xca62('0x48')]['id']}})['then'](handleEntityNotFound(_0x434a72,null))['then'](function(_0x3e1cd4){if(_0x3e1cd4){_0x3bcb83=_0x3e1cd4;_0x2448f3[_0xca62('0x33')]=_[_0xca62('0x35')](db['VtigerField'][_0xca62('0x2f')]);_0x2448f3[_0xca62('0x34')]=_[_0xca62('0x35')](_0xa012c9[_0xca62('0x34')]);_0x2448f3[_0xca62('0x36')]=_[_0xca62('0x37')](_0x2448f3[_0xca62('0x33')],_0x2448f3[_0xca62('0x34')]);_0x23073c[_0xca62('0x38')]=_[_0xca62('0x37')](_0x2448f3['model'],qs[_0xca62('0x39')](_0xa012c9[_0xca62('0x34')]['fields']));_0x23073c[_0xca62('0x38')]=_0x23073c[_0xca62('0x38')][_0xca62('0x3a')]?_0x23073c[_0xca62('0x38')]:_0x2448f3['model'];_0x23073c[_0xca62('0x4e')]=qs[_0xca62('0x3d')](_0xa012c9[_0xca62('0x34')][_0xca62('0x3d')]);_0x23073c['where']=qs[_0xca62('0x36')](_[_0xca62('0x3f')](_0xa012c9[_0xca62('0x34')],_0x2448f3[_0xca62('0x36')]));if(_0xa012c9[_0xca62('0x34')][_0xca62('0x40')]){_0x23073c[_0xca62('0x3e')]=_[_0xca62('0x41')](_0x23073c[_0xca62('0x3e')],{'$or':_[_0xca62('0x2e')](_0x23073c[_0xca62('0x38')],function(_0x134691){var _0x8026f6={};_0x8026f6[_0x134691]={'$like':'%'+_0xa012c9[_0xca62('0x34')]['filter']+'%'};return _0x8026f6;})});}_0x23073c=_[_0xca62('0x41')]({},_0x23073c,_0xa012c9[_0xca62('0x42')]);return _0x3bcb83[_0xca62('0x50')](_0x23073c);}})['then'](function(_0x1a70d6){if(_0x1a70d6){_0x5e51c1=_0x1a70d6[_0xca62('0x3a')];if(!_0xa012c9[_0xca62('0x34')]['hasOwnProperty'](_0xca62('0x3c'))){_0x23073c[_0xca62('0x22')]=qs[_0xca62('0x22')](_0xa012c9['query'][_0xca62('0x22')]);_0x23073c[_0xca62('0x1f')]=qs[_0xca62('0x1f')](_0xa012c9[_0xca62('0x34')]['offset']);}return _0x3bcb83[_0xca62('0x50')](_0x23073c);}})[_0xca62('0x27')](function(_0x2c2db1){if(_0x2c2db1){return _0x2c2db1?{'count':_0x5e51c1,'rows':_0x2c2db1}:null;}})[_0xca62('0x27')](respondWithResult(_0x434a72,null))[_0xca62('0x46')](handleError(_0x434a72,null));};exports[_0xca62('0x51')]=function(_0x5f135b,_0x35ebd0,_0x10a9b2){var _0x5cf845={};var _0x92be6f={};var _0x3d0e8b;var _0x319650;return db['VtigerConfiguration'][_0xca62('0x4f')]({'where':{'id':_0x5f135b[_0xca62('0x48')]['id']}})[_0xca62('0x27')](handleEntityNotFound(_0x35ebd0,null))[_0xca62('0x27')](function(_0x5c18e1){if(_0x5c18e1){_0x3d0e8b=_0x5c18e1;_0x92be6f[_0xca62('0x33')]=_[_0xca62('0x35')](db[_0xca62('0x4d')][_0xca62('0x2f')]);_0x92be6f['query']=_[_0xca62('0x35')](_0x5f135b[_0xca62('0x34')]);_0x92be6f[_0xca62('0x36')]=_['intersection'](_0x92be6f[_0xca62('0x33')],_0x92be6f['query']);_0x5cf845[_0xca62('0x38')]=_[_0xca62('0x37')](_0x92be6f[_0xca62('0x33')],qs['fields'](_0x5f135b[_0xca62('0x34')][_0xca62('0x39')]));_0x5cf845[_0xca62('0x38')]=_0x5cf845[_0xca62('0x38')][_0xca62('0x3a')]?_0x5cf845[_0xca62('0x38')]:_0x92be6f[_0xca62('0x33')];_0x5cf845['order']=qs['sort'](_0x5f135b[_0xca62('0x34')]['sort']);_0x5cf845['where']=qs['filters'](_['pick'](_0x5f135b[_0xca62('0x34')],_0x92be6f['filters']));if(_0x5f135b[_0xca62('0x34')][_0xca62('0x40')]){_0x5cf845[_0xca62('0x3e')]=_[_0xca62('0x41')](_0x5cf845['where'],{'$or':_[_0xca62('0x2e')](_0x5cf845['attributes'],function(_0x52fb8b){var _0x3c79f7={};_0x3c79f7[_0x52fb8b]={'$like':'%'+_0x5f135b[_0xca62('0x34')]['filter']+'%'};return _0x3c79f7;})});}_0x5cf845=_[_0xca62('0x41')]({},_0x5cf845,_0x5f135b['options']);return _0x3d0e8b[_0xca62('0x51')](_0x5cf845);}})[_0xca62('0x27')](function(_0x194d3f){if(_0x194d3f){_0x319650=_0x194d3f['length'];if(!_0x5f135b[_0xca62('0x34')][_0xca62('0x3b')](_0xca62('0x3c'))){_0x5cf845[_0xca62('0x22')]=qs[_0xca62('0x22')](_0x5f135b[_0xca62('0x34')][_0xca62('0x22')]);_0x5cf845[_0xca62('0x1f')]=qs[_0xca62('0x1f')](_0x5f135b[_0xca62('0x34')][_0xca62('0x1f')]);}return _0x3d0e8b['getDescriptions'](_0x5cf845);}})['then'](function(_0x1109ed){if(_0x1109ed){return _0x1109ed?{'count':_0x319650,'rows':_0x1109ed}:null;}})[_0xca62('0x27')](respondWithResult(_0x35ebd0,null))[_0xca62('0x46')](handleError(_0x35ebd0,null));}; \ No newline at end of file +var _0xded4=['filter','where','merge','VIRTUAL','options','include','findAll','show','params','rawAttributes','length','includeAll','find','catch','body','destroy','getFields','findOne','VtigerField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','index','map','VtigerConfiguration','type','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','pick'];(function(_0x152a8d,_0x5c9019){var _0x144e3d=function(_0x4cdbf0){while(--_0x4cdbf0){_0x152a8d['push'](_0x152a8d['shift']());}};_0x144e3d(++_0x5c9019);}(_0xded4,0x19c));var _0x4ded=function(_0x3b6e40,_0x36464d){_0x3b6e40=_0x3b6e40-0x0;var _0x3f4203=_0xded4[_0x3b6e40];return _0x3f4203;};'use strict';var emlformat=require(_0x4ded('0x0'));var rimraf=require(_0x4ded('0x1'));var zipdir=require(_0x4ded('0x2'));var jsonpatch=require(_0x4ded('0x3'));var rp=require(_0x4ded('0x4'));var moment=require(_0x4ded('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ded('0x6'));var path=require('path');var sox=require(_0x4ded('0x7'));var csv=require(_0x4ded('0x8'));var ejs=require(_0x4ded('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ded('0xa'));var squel=require('squel');var crypto=require(_0x4ded('0xb'));var jsforce=require(_0x4ded('0xc'));var deskjs=require(_0x4ded('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4ded('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4ded('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4ded('0x10'));var hardwareService=require(_0x4ded('0x11'));var logger=require(_0x4ded('0x12'))(_0x4ded('0x13'));var utils=require(_0x4ded('0x14'));var config=require(_0x4ded('0x15'));var licenseUtil=require(_0x4ded('0x16'));var db=require(_0x4ded('0x17'))['db'];function respondWithStatusCode(_0x5754ad,_0xd7f963){_0xd7f963=_0xd7f963||0xcc;return function(_0x841353){if(_0x841353){return _0x5754ad[_0x4ded('0x18')](_0xd7f963);}return _0x5754ad['status'](_0xd7f963)[_0x4ded('0x19')]();};}function respondWithResult(_0x55d385,_0x5b2307){_0x5b2307=_0x5b2307||0xc8;return function(_0x44fb18){if(_0x44fb18){return _0x55d385[_0x4ded('0x1a')](_0x5b2307)[_0x4ded('0x1b')](_0x44fb18);}};}function respondWithFilteredResult(_0x33d999,_0x3427d9){return function(_0x398be6){if(_0x398be6){var _0x15160b=typeof _0x3427d9[_0x4ded('0x1c')]===_0x4ded('0x1d')&&typeof _0x3427d9['limit']==='undefined';var _0x431b6f=_0x398be6[_0x4ded('0x1e')];var _0x92f6a8=_0x15160b?0x0:_0x3427d9['offset'];var _0x124b2a=_0x15160b?_0x398be6[_0x4ded('0x1e')]:_0x3427d9[_0x4ded('0x1c')]+_0x3427d9['limit'];var _0x3ce590;if(_0x124b2a>=_0x431b6f){_0x124b2a=_0x431b6f;_0x3ce590=0xc8;}else{_0x3ce590=0xce;}_0x33d999[_0x4ded('0x1a')](_0x3ce590);return _0x33d999[_0x4ded('0x1f')](_0x4ded('0x20'),_0x92f6a8+'-'+_0x124b2a+'/'+_0x431b6f)[_0x4ded('0x1b')](_0x398be6);}return null;};}function patchUpdates(_0x428616){return function(_0x1ca9ef){try{jsonpatch[_0x4ded('0x21')](_0x1ca9ef,_0x428616,!![]);}catch(_0x4996d1){return BPromise[_0x4ded('0x22')](_0x4996d1);}return _0x1ca9ef['save']();};}function saveUpdates(_0x459ccb,_0x5c9a12){return function(_0x822532){if(_0x822532){return _0x822532[_0x4ded('0x23')](_0x459ccb)[_0x4ded('0x24')](function(_0x13def1){return _0x13def1;});}return null;};}function removeEntity(_0x1d8393,_0x419f4c){return function(_0x4d89d5){if(_0x4d89d5){return _0x4d89d5['destroy']()[_0x4ded('0x24')](function(){_0x1d8393['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x10cdb4,_0x5b1e0c){return function(_0x194d73){if(!_0x194d73){_0x10cdb4[_0x4ded('0x18')](0x194);}return _0x194d73;};}function handleError(_0x10ef4c,_0x4fc7d7){_0x4fc7d7=_0x4fc7d7||0x1f4;return function(_0x19aeac){logger[_0x4ded('0x25')](_0x19aeac[_0x4ded('0x26')]);if(_0x19aeac[_0x4ded('0x27')]){delete _0x19aeac[_0x4ded('0x27')];}_0x10ef4c['status'](_0x4fc7d7)['send'](_0x19aeac);};}exports[_0x4ded('0x28')]=function(_0x2a944,_0x122646){var _0x1e65b8={},_0x10ed1d={},_0x3f532e={'count':0x0,'rows':[]};var _0x5291d8=_[_0x4ded('0x29')](db[_0x4ded('0x2a')]['rawAttributes'],function(_0x341330){return{'name':_0x341330['fieldName'],'type':_0x341330[_0x4ded('0x2b')]['key']};});_0x10ed1d[_0x4ded('0x2c')]=_[_0x4ded('0x29')](_0x5291d8,_0x4ded('0x27'));_0x10ed1d['query']=_[_0x4ded('0x2d')](_0x2a944[_0x4ded('0x2e')]);_0x10ed1d[_0x4ded('0x2f')]=_['intersection'](_0x10ed1d[_0x4ded('0x2c')],_0x10ed1d[_0x4ded('0x2e')]);_0x1e65b8[_0x4ded('0x30')]=_[_0x4ded('0x31')](_0x10ed1d[_0x4ded('0x2c')],qs[_0x4ded('0x32')](_0x2a944[_0x4ded('0x2e')][_0x4ded('0x32')]));_0x1e65b8[_0x4ded('0x30')]=_0x1e65b8['attributes']['length']?_0x1e65b8[_0x4ded('0x30')]:_0x10ed1d[_0x4ded('0x2c')];if(!_0x2a944['query'][_0x4ded('0x33')]('nolimit')){_0x1e65b8['limit']=qs['limit'](_0x2a944['query'][_0x4ded('0x34')]);_0x1e65b8[_0x4ded('0x1c')]=qs[_0x4ded('0x1c')](_0x2a944['query']['offset']);}_0x1e65b8[_0x4ded('0x35')]=qs[_0x4ded('0x36')](_0x2a944['query'][_0x4ded('0x36')]);_0x1e65b8['where']=qs[_0x4ded('0x2f')](_[_0x4ded('0x37')](_0x2a944['query'],_0x10ed1d[_0x4ded('0x2f')]),_0x5291d8);if(_0x2a944['query'][_0x4ded('0x38')]){_0x1e65b8[_0x4ded('0x39')]=_[_0x4ded('0x3a')](_0x1e65b8[_0x4ded('0x39')],{'$or':_[_0x4ded('0x29')](_0x5291d8,function(_0x221e77){if(_0x221e77['type']!==_0x4ded('0x3b')){var _0x38911b={};_0x38911b[_0x221e77['name']]={'$like':'%'+_0x2a944[_0x4ded('0x2e')][_0x4ded('0x38')]+'%'};return _0x38911b;}})});}_0x1e65b8=_[_0x4ded('0x3a')]({},_0x1e65b8,_0x2a944[_0x4ded('0x3c')]);var _0x55484a={'where':_0x1e65b8['where']};return db[_0x4ded('0x2a')][_0x4ded('0x1e')](_0x55484a)[_0x4ded('0x24')](function(_0x586389){_0x3f532e[_0x4ded('0x1e')]=_0x586389;if(_0x2a944[_0x4ded('0x2e')]['includeAll']){_0x1e65b8[_0x4ded('0x3d')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x4ded('0x3e')](_0x1e65b8);})[_0x4ded('0x24')](function(_0x4a18e6){_0x3f532e['rows']=_0x4a18e6;return _0x3f532e;})[_0x4ded('0x24')](respondWithFilteredResult(_0x122646,_0x1e65b8))['catch'](handleError(_0x122646,null));};exports[_0x4ded('0x3f')]=function(_0x44aee1,_0x410fce){var _0x1155dc={'raw':![],'where':{'id':_0x44aee1[_0x4ded('0x40')]['id']}},_0x44b09d={};_0x44b09d[_0x4ded('0x2c')]=_[_0x4ded('0x2d')](db[_0x4ded('0x2a')][_0x4ded('0x41')]);_0x44b09d['query']=_[_0x4ded('0x2d')](_0x44aee1[_0x4ded('0x2e')]);_0x44b09d[_0x4ded('0x2f')]=_[_0x4ded('0x31')](_0x44b09d[_0x4ded('0x2c')],_0x44b09d[_0x4ded('0x2e')]);_0x1155dc['attributes']=_[_0x4ded('0x31')](_0x44b09d['model'],qs[_0x4ded('0x32')](_0x44aee1[_0x4ded('0x2e')][_0x4ded('0x32')]));_0x1155dc[_0x4ded('0x30')]=_0x1155dc[_0x4ded('0x30')][_0x4ded('0x42')]?_0x1155dc[_0x4ded('0x30')]:_0x44b09d[_0x4ded('0x2c')];if(_0x44aee1['query'][_0x4ded('0x43')]){_0x1155dc[_0x4ded('0x3d')]=[{'all':!![]}];}_0x1155dc=_[_0x4ded('0x3a')]({},_0x1155dc,_0x44aee1[_0x4ded('0x3c')]);return db[_0x4ded('0x2a')][_0x4ded('0x44')](_0x1155dc)[_0x4ded('0x24')](handleEntityNotFound(_0x410fce,null))['then'](respondWithResult(_0x410fce,null))[_0x4ded('0x45')](handleError(_0x410fce,null));};exports['create']=function(_0x2cb4a5,_0x25b6bb){return db['VtigerConfiguration']['create'](_0x2cb4a5['body'],{})[_0x4ded('0x24')](respondWithResult(_0x25b6bb,0xc9))['catch'](handleError(_0x25b6bb,null));};exports[_0x4ded('0x23')]=function(_0x7884,_0x4062af){if(_0x7884[_0x4ded('0x46')]['id']){delete _0x7884[_0x4ded('0x46')]['id'];}return db[_0x4ded('0x2a')][_0x4ded('0x44')]({'where':{'id':_0x7884[_0x4ded('0x40')]['id']}})[_0x4ded('0x24')](handleEntityNotFound(_0x4062af,null))[_0x4ded('0x24')](saveUpdates(_0x7884[_0x4ded('0x46')],null))[_0x4ded('0x24')](respondWithResult(_0x4062af,null))[_0x4ded('0x45')](handleError(_0x4062af,null));};exports[_0x4ded('0x47')]=function(_0x40be9a,_0x55da23){return db[_0x4ded('0x2a')][_0x4ded('0x44')]({'where':{'id':_0x40be9a[_0x4ded('0x40')]['id']}})[_0x4ded('0x24')](handleEntityNotFound(_0x55da23,null))[_0x4ded('0x24')](removeEntity(_0x55da23,null))[_0x4ded('0x45')](handleError(_0x55da23,null));};exports[_0x4ded('0x48')]=function(_0x4e360f,_0x2592d6,_0x2be092){var _0x1fd5e5={};var _0xb67998={};var _0x2821ea;var _0x580c27;return db['VtigerConfiguration'][_0x4ded('0x49')]({'where':{'id':_0x4e360f[_0x4ded('0x40')]['id']}})['then'](handleEntityNotFound(_0x2592d6,null))[_0x4ded('0x24')](function(_0x158e08){if(_0x158e08){_0x2821ea=_0x158e08;_0xb67998['model']=_['keys'](db[_0x4ded('0x4a')]['rawAttributes']);_0xb67998[_0x4ded('0x2e')]=_[_0x4ded('0x2d')](_0x4e360f['query']);_0xb67998['filters']=_[_0x4ded('0x31')](_0xb67998['model'],_0xb67998[_0x4ded('0x2e')]);_0x1fd5e5['attributes']=_['intersection'](_0xb67998['model'],qs[_0x4ded('0x32')](_0x4e360f[_0x4ded('0x2e')][_0x4ded('0x32')]));_0x1fd5e5['attributes']=_0x1fd5e5['attributes'][_0x4ded('0x42')]?_0x1fd5e5[_0x4ded('0x30')]:_0xb67998[_0x4ded('0x2c')];_0x1fd5e5['order']=qs[_0x4ded('0x36')](_0x4e360f['query']['sort']);_0x1fd5e5['where']=qs[_0x4ded('0x2f')](_[_0x4ded('0x37')](_0x4e360f[_0x4ded('0x2e')],_0xb67998[_0x4ded('0x2f')]));if(_0x4e360f[_0x4ded('0x2e')][_0x4ded('0x38')]){_0x1fd5e5[_0x4ded('0x39')]=_[_0x4ded('0x3a')](_0x1fd5e5[_0x4ded('0x39')],{'$or':_['map'](_0x1fd5e5[_0x4ded('0x30')],function(_0x3d946e){var _0x47b947={};_0x47b947[_0x3d946e]={'$like':'%'+_0x4e360f[_0x4ded('0x2e')][_0x4ded('0x38')]+'%'};return _0x47b947;})});}_0x1fd5e5=_[_0x4ded('0x3a')]({},_0x1fd5e5,_0x4e360f[_0x4ded('0x3c')]);return _0x2821ea[_0x4ded('0x48')](_0x1fd5e5);}})[_0x4ded('0x24')](function(_0x4037ed){if(_0x4037ed){_0x580c27=_0x4037ed['length'];if(!_0x4e360f['query'][_0x4ded('0x33')](_0x4ded('0x4b'))){_0x1fd5e5[_0x4ded('0x34')]=qs[_0x4ded('0x34')](_0x4e360f[_0x4ded('0x2e')][_0x4ded('0x34')]);_0x1fd5e5[_0x4ded('0x1c')]=qs[_0x4ded('0x1c')](_0x4e360f[_0x4ded('0x2e')][_0x4ded('0x1c')]);}return _0x2821ea['getFields'](_0x1fd5e5);}})[_0x4ded('0x24')](function(_0xe89ded){if(_0xe89ded){return _0xe89ded?{'count':_0x580c27,'rows':_0xe89ded}:null;}})[_0x4ded('0x24')](respondWithResult(_0x2592d6,null))[_0x4ded('0x45')](handleError(_0x2592d6,null));};exports[_0x4ded('0x4c')]=function(_0x237e63,_0x50c883,_0x14f37f){var _0x4c47fb={};var _0x434437={};var _0x4d5949;var _0x3cd737;return db[_0x4ded('0x2a')]['findOne']({'where':{'id':_0x237e63[_0x4ded('0x40')]['id']}})[_0x4ded('0x24')](handleEntityNotFound(_0x50c883,null))[_0x4ded('0x24')](function(_0x47c5fe){if(_0x47c5fe){_0x4d5949=_0x47c5fe;_0x434437[_0x4ded('0x2c')]=_[_0x4ded('0x2d')](db[_0x4ded('0x4a')][_0x4ded('0x41')]);_0x434437[_0x4ded('0x2e')]=_[_0x4ded('0x2d')](_0x237e63['query']);_0x434437[_0x4ded('0x2f')]=_[_0x4ded('0x31')](_0x434437['model'],_0x434437[_0x4ded('0x2e')]);_0x4c47fb[_0x4ded('0x30')]=_['intersection'](_0x434437[_0x4ded('0x2c')],qs[_0x4ded('0x32')](_0x237e63[_0x4ded('0x2e')][_0x4ded('0x32')]));_0x4c47fb[_0x4ded('0x30')]=_0x4c47fb[_0x4ded('0x30')][_0x4ded('0x42')]?_0x4c47fb['attributes']:_0x434437[_0x4ded('0x2c')];_0x4c47fb['order']=qs['sort'](_0x237e63[_0x4ded('0x2e')][_0x4ded('0x36')]);_0x4c47fb[_0x4ded('0x39')]=qs[_0x4ded('0x2f')](_[_0x4ded('0x37')](_0x237e63[_0x4ded('0x2e')],_0x434437[_0x4ded('0x2f')]));if(_0x237e63['query']['filter']){_0x4c47fb[_0x4ded('0x39')]=_[_0x4ded('0x3a')](_0x4c47fb[_0x4ded('0x39')],{'$or':_[_0x4ded('0x29')](_0x4c47fb['attributes'],function(_0x432154){var _0x133628={};_0x133628[_0x432154]={'$like':'%'+_0x237e63[_0x4ded('0x2e')]['filter']+'%'};return _0x133628;})});}_0x4c47fb=_[_0x4ded('0x3a')]({},_0x4c47fb,_0x237e63['options']);return _0x4d5949['getSubjects'](_0x4c47fb);}})[_0x4ded('0x24')](function(_0x66cf3b){if(_0x66cf3b){_0x3cd737=_0x66cf3b[_0x4ded('0x42')];if(!_0x237e63['query'][_0x4ded('0x33')]('nolimit')){_0x4c47fb[_0x4ded('0x34')]=qs['limit'](_0x237e63[_0x4ded('0x2e')]['limit']);_0x4c47fb[_0x4ded('0x1c')]=qs[_0x4ded('0x1c')](_0x237e63[_0x4ded('0x2e')]['offset']);}return _0x4d5949[_0x4ded('0x4c')](_0x4c47fb);}})[_0x4ded('0x24')](function(_0x53f369){if(_0x53f369){return _0x53f369?{'count':_0x3cd737,'rows':_0x53f369}:null;}})[_0x4ded('0x24')](respondWithResult(_0x50c883,null))[_0x4ded('0x45')](handleError(_0x50c883,null));};exports[_0x4ded('0x4d')]=function(_0x3181d0,_0x1a1d64,_0x271370){var _0x44a5ba={};var _0x12014d={};var _0x41c16d;var _0x10937c;return db[_0x4ded('0x2a')][_0x4ded('0x49')]({'where':{'id':_0x3181d0[_0x4ded('0x40')]['id']}})['then'](handleEntityNotFound(_0x1a1d64,null))[_0x4ded('0x24')](function(_0x38e2e3){if(_0x38e2e3){_0x41c16d=_0x38e2e3;_0x12014d[_0x4ded('0x2c')]=_[_0x4ded('0x2d')](db[_0x4ded('0x4a')][_0x4ded('0x41')]);_0x12014d['query']=_[_0x4ded('0x2d')](_0x3181d0[_0x4ded('0x2e')]);_0x12014d['filters']=_[_0x4ded('0x31')](_0x12014d[_0x4ded('0x2c')],_0x12014d[_0x4ded('0x2e')]);_0x44a5ba[_0x4ded('0x30')]=_[_0x4ded('0x31')](_0x12014d['model'],qs[_0x4ded('0x32')](_0x3181d0[_0x4ded('0x2e')]['fields']));_0x44a5ba[_0x4ded('0x30')]=_0x44a5ba[_0x4ded('0x30')][_0x4ded('0x42')]?_0x44a5ba[_0x4ded('0x30')]:_0x12014d[_0x4ded('0x2c')];_0x44a5ba[_0x4ded('0x35')]=qs[_0x4ded('0x36')](_0x3181d0['query'][_0x4ded('0x36')]);_0x44a5ba[_0x4ded('0x39')]=qs['filters'](_['pick'](_0x3181d0['query'],_0x12014d[_0x4ded('0x2f')]));if(_0x3181d0['query'][_0x4ded('0x38')]){_0x44a5ba[_0x4ded('0x39')]=_[_0x4ded('0x3a')](_0x44a5ba[_0x4ded('0x39')],{'$or':_[_0x4ded('0x29')](_0x44a5ba['attributes'],function(_0x37aba4){var _0x3a839e={};_0x3a839e[_0x37aba4]={'$like':'%'+_0x3181d0[_0x4ded('0x2e')][_0x4ded('0x38')]+'%'};return _0x3a839e;})});}_0x44a5ba=_[_0x4ded('0x3a')]({},_0x44a5ba,_0x3181d0[_0x4ded('0x3c')]);return _0x41c16d['getDescriptions'](_0x44a5ba);}})[_0x4ded('0x24')](function(_0x474eac){if(_0x474eac){_0x10937c=_0x474eac[_0x4ded('0x42')];if(!_0x3181d0['query'][_0x4ded('0x33')](_0x4ded('0x4b'))){_0x44a5ba[_0x4ded('0x34')]=qs[_0x4ded('0x34')](_0x3181d0[_0x4ded('0x2e')][_0x4ded('0x34')]);_0x44a5ba[_0x4ded('0x1c')]=qs['offset'](_0x3181d0[_0x4ded('0x2e')]['offset']);}return _0x41c16d[_0x4ded('0x4d')](_0x44a5ba);}})[_0x4ded('0x24')](function(_0x2d53b5){if(_0x2d53b5){return _0x2d53b5?{'count':_0x10937c,'rows':_0x2d53b5}:null;}})[_0x4ded('0x24')](respondWithResult(_0x1a1d64,null))[_0x4ded('0x45')](handleError(_0x1a1d64,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index a9e5220..a98c3b2 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 _0xdbc5=['lodash','api','moment','bluebird','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdbc5,0x1b8));var _0x5dbc=function(_0x3c9d1c,_0x5e0e35){_0x3c9d1c=_0x3c9d1c-0x0;var _0x5a0ba1=_0xdbc5[_0x3c9d1c];return _0x5a0ba1;};'use strict';var _=require(_0x5dbc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5dbc('0x1'));var moment=require(_0x5dbc('0x2'));var BPromise=require(_0x5dbc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5dbc('0x4'));var config=require(_0x5dbc('0x5'));var attributes=require(_0x5dbc('0x6'));module[_0x5dbc('0x7')]=function(_0x195f35,_0x35ac6a){return _0x195f35['define'](_0x5dbc('0x8'),attributes,{'tableName':_0x5dbc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81a0=['path','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5a488c,_0x4cc470){var _0x53a7d6=function(_0x43a0d8){while(--_0x43a0d8){_0x5a488c['push'](_0x5a488c['shift']());}};_0x53a7d6(++_0x4cc470);}(_0x81a0,0x17a));var _0x081a=function(_0x461c39,_0x47e809){_0x461c39=_0x461c39-0x0;var _0x42760b=_0x81a0[_0x461c39];return _0x42760b;};'use strict';var _=require(_0x081a('0x0'));var util=require(_0x081a('0x1'));var logger=require(_0x081a('0x2'))(_0x081a('0x3'));var moment=require(_0x081a('0x4'));var BPromise=require(_0x081a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x081a('0x6'));var rimraf=require(_0x081a('0x7'));var config=require('../../config/environment');var attributes=require(_0x081a('0x8'));module[_0x081a('0x9')]=function(_0x25cf4f,_0x1e249d){return _0x25cf4f[_0x081a('0xa')](_0x081a('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index e68b9d7..b067123 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 _0xcf47=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring'];(function(_0x48f128,_0x1c17a9){var _0x4cba68=function(_0x3f9d0b){while(--_0x3f9d0b){_0x48f128['push'](_0x48f128['shift']());}};_0x4cba68(++_0x1c17a9);}(_0xcf47,0x1df));var _0x7cf4=function(_0xe9cf54,_0x1a1855){_0xe9cf54=_0xe9cf54-0x0;var _0x142fc5=_0xcf47[_0xe9cf54];return _0x142fc5;};'use strict';var _=require(_0x7cf4('0x0'));var util=require(_0x7cf4('0x1'));var moment=require(_0x7cf4('0x2'));var BPromise=require('bluebird');var rs=require(_0x7cf4('0x3'));var fs=require('fs');var Redis=require(_0x7cf4('0x4'));var db=require(_0x7cf4('0x5'))['db'];var utils=require(_0x7cf4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x7cf4('0x7'));var jayson=require(_0x7cf4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3b3ae9,_0x9892ba,_0x174d4c){return new BPromise(function(_0x544799,_0x208267){return client[_0x7cf4('0x9')](_0x3b3ae9,_0x174d4c)[_0x7cf4('0xa')](function(_0x17f6db){logger[_0x7cf4('0xb')](_0x7cf4('0xc'),_0x9892ba,_0x7cf4('0xd'));logger[_0x7cf4('0xe')](_0x7cf4('0xf'),_0x9892ba,_0x7cf4('0xd'),JSON[_0x7cf4('0x10')](_0x17f6db));if(_0x17f6db['error']){if(_0x17f6db[_0x7cf4('0x11')]['code']===0x1f4){logger[_0x7cf4('0x11')](_0x7cf4('0xc'),_0x9892ba,_0x17f6db[_0x7cf4('0x11')][_0x7cf4('0x12')]);return _0x208267(_0x17f6db['error'][_0x7cf4('0x12')]);}logger[_0x7cf4('0x11')](_0x7cf4('0xc'),_0x9892ba,_0x17f6db['error'][_0x7cf4('0x12')]);return _0x544799(_0x17f6db['error'][_0x7cf4('0x12')]);}else{logger['info'](_0x7cf4('0xc'),_0x9892ba,'request\x20sent');_0x544799(_0x17f6db[_0x7cf4('0x13')][_0x7cf4('0x12')]);}})[_0x7cf4('0x14')](function(_0x5e23c5){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x9892ba,_0x5e23c5);_0x208267(_0x5e23c5);});});} \ No newline at end of file +var _0x1b75=['jayson/promise','client','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3a7db0,_0xe93c50){var _0x17cbba=function(_0x577f4c){while(--_0x577f4c){_0x3a7db0['push'](_0x3a7db0['shift']());}};_0x17cbba(++_0xe93c50);}(_0x1b75,0x19a));var _0x51b7=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0x1b75[_0x40dd56];return _0x4f850f;};'use strict';var _=require(_0x51b7('0x0'));var util=require(_0x51b7('0x1'));var moment=require(_0x51b7('0x2'));var BPromise=require(_0x51b7('0x3'));var rs=require(_0x51b7('0x4'));var fs=require('fs');var Redis=require(_0x51b7('0x5'));var db=require(_0x51b7('0x6'))['db'];var utils=require(_0x51b7('0x7'));var logger=require('../../config/logger')(_0x51b7('0x8'));var config=require(_0x51b7('0x9'));var jayson=require(_0x51b7('0xa'));var client=jayson[_0x51b7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30f3cd,_0x3b0c87,_0x43f78c){return new BPromise(function(_0x59ae2c,_0x1874a6){return client['request'](_0x30f3cd,_0x43f78c)[_0x51b7('0xc')](function(_0x48cb92){logger[_0x51b7('0xd')](_0x51b7('0xe'),_0x3b0c87,_0x51b7('0xf'));logger[_0x51b7('0x10')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3b0c87,_0x51b7('0xf'),JSON[_0x51b7('0x11')](_0x48cb92));if(_0x48cb92[_0x51b7('0x12')]){if(_0x48cb92[_0x51b7('0x12')]['code']===0x1f4){logger['error'](_0x51b7('0xe'),_0x3b0c87,_0x48cb92[_0x51b7('0x12')]['message']);return _0x1874a6(_0x48cb92[_0x51b7('0x12')][_0x51b7('0x13')]);}logger['error'](_0x51b7('0xe'),_0x3b0c87,_0x48cb92['error'][_0x51b7('0x13')]);return _0x59ae2c(_0x48cb92[_0x51b7('0x12')]['message']);}else{logger[_0x51b7('0xd')](_0x51b7('0xe'),_0x3b0c87,_0x51b7('0xf'));_0x59ae2c(_0x48cb92['result'][_0x51b7('0x13')]);}})[_0x51b7('0x14')](function(_0x42aa5e){logger[_0x51b7('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x3b0c87,_0x42aa5e);_0x1874a6(_0x42aa5e);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 08c145f..a4b8dc0 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 _0xe515=['./intVtigerField.controller','isAuthenticated','index','get','show','post','create','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x194525,_0x4ec962){var _0x2c7b77=function(_0x3a3a70){while(--_0x3a3a70){_0x194525['push'](_0x194525['shift']());}};_0x2c7b77(++_0x4ec962);}(_0xe515,0xab));var _0x5e51=function(_0x3d8e70,_0x1a49c0){_0x3d8e70=_0x3d8e70-0x0;var _0x4fb9ea=_0xe515[_0x3d8e70];return _0x4fb9ea;};'use strict';var multer=require(_0x5e51('0x0'));var util=require(_0x5e51('0x1'));var path=require('path');var timeout=require(_0x5e51('0x2'));var express=require(_0x5e51('0x3'));var router=express[_0x5e51('0x4')]();var fs_extra=require(_0x5e51('0x5'));var auth=require(_0x5e51('0x6'));var interaction=require(_0x5e51('0x7'));var config=require(_0x5e51('0x8'));var controller=require(_0x5e51('0x9'));router['get']('/',auth[_0x5e51('0xa')](),controller[_0x5e51('0xb')]);router[_0x5e51('0xc')]('/:id',auth[_0x5e51('0xa')](),controller[_0x5e51('0xd')]);router[_0x5e51('0xe')]('/',auth['isAuthenticated'](),controller[_0x5e51('0xf')]);router[_0x5e51('0x10')](_0x5e51('0x11'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x5e51('0x11'),auth[_0x5e51('0xa')](),controller[_0x5e51('0x12')]);module[_0x5e51('0x13')]=router; \ No newline at end of file +var _0x8dfa=['create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','index','get','/:id','isAuthenticated','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8dfa,0x110));var _0xa8df=function(_0x5a30fb,_0x206270){_0x5a30fb=_0x5a30fb-0x0;var _0x3b86aa=_0x8dfa[_0x5a30fb];return _0x3b86aa;};'use strict';var multer=require(_0xa8df('0x0'));var util=require(_0xa8df('0x1'));var path=require(_0xa8df('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa8df('0x3')]();var fs_extra=require(_0xa8df('0x4'));var auth=require(_0xa8df('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa8df('0x6'));var controller=require(_0xa8df('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa8df('0x8')]);router[_0xa8df('0x9')](_0xa8df('0xa'),auth[_0xa8df('0xb')](),controller['show']);router[_0xa8df('0xc')]('/',auth[_0xa8df('0xb')](),controller[_0xa8df('0xd')]);router[_0xa8df('0xe')]('/:id',auth[_0xa8df('0xb')](),controller[_0xa8df('0xf')]);router[_0xa8df('0x10')]('/:id',auth[_0xa8df('0xb')](),controller[_0xa8df('0x11')]);module[_0xa8df('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 4dd721f..46fcb3e 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 _0x486a=['ENUM','variable','customVariable','picklist','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x4f28e1,_0x14f715){var _0x5bb911=function(_0x3e5546){while(--_0x3e5546){_0x4f28e1['push'](_0x4f28e1['shift']());}};_0x5bb911(++_0x14f715);}(_0x486a,0x16f));var _0xa486=function(_0x55c3d9,_0x3bf75c){_0x55c3d9=_0x55c3d9-0x0;var _0x19fd97=_0x486a[_0x55c3d9];return _0x19fd97;};'use strict';var Sequelize=require(_0xa486('0x0'));module[_0xa486('0x1')]={'type':{'type':Sequelize[_0xa486('0x2')]('string',_0xa486('0x3'),_0xa486('0x4'),'keyValue',_0xa486('0x5')),'defaultValue':_0xa486('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa486('0x2')]('string',_0xa486('0x3'),_0xa486('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa486('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa486('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd1eb=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x5ac9cb,_0x371ca3){var _0x52f63d=function(_0x1fe37f){while(--_0x1fe37f){_0x5ac9cb['push'](_0x5ac9cb['shift']());}};_0x52f63d(++_0x371ca3);}(_0xd1eb,0x159));var _0xbd1e=function(_0x5bbdbb,_0x160d58){_0x5bbdbb=_0x5bbdbb-0x0;var _0x290fdd=_0xd1eb[_0x5bbdbb];return _0x290fdd;};'use strict';var Sequelize=require(_0xbd1e('0x0'));module[_0xbd1e('0x1')]={'type':{'type':Sequelize[_0xbd1e('0x2')]('string',_0xbd1e('0x3'),_0xbd1e('0x4'),_0xbd1e('0x5'),_0xbd1e('0x6')),'defaultValue':_0xbd1e('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xbd1e('0x8')]},'keyType':{'type':Sequelize[_0xbd1e('0x2')](_0xbd1e('0x7'),'variable',_0xbd1e('0x4'))},'keyContent':{'type':Sequelize[_0xbd1e('0x8')]},'idField':{'type':Sequelize[_0xbd1e('0x8')]},'nameField':{'type':Sequelize[_0xbd1e('0x8')]},'customField':{'type':Sequelize[_0xbd1e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbd1e('0x8')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 0f80656..2c1cfdd 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 _0xc997=['Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','VtigerField','findAll','rows','catch','show','keys','create','body','find','params','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','set'];(function(_0x4512b8,_0x4eea21){var _0x5c84cb=function(_0x523481){while(--_0x523481){_0x4512b8['push'](_0x4512b8['shift']());}};_0x5c84cb(++_0x4eea21);}(_0xc997,0x114));var _0x7c99=function(_0x9df8e0,_0x6e9a51){_0x9df8e0=_0x9df8e0-0x0;var _0x2fe4ff=_0xc997[_0x9df8e0];return _0x2fe4ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c99('0x0'));var zipdir=require(_0x7c99('0x1'));var jsonpatch=require(_0x7c99('0x2'));var rp=require('request-promise');var moment=require(_0x7c99('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7c99('0x4'));var path=require(_0x7c99('0x5'));var sox=require(_0x7c99('0x6'));var csv=require('to-csv');var ejs=require(_0x7c99('0x7'));var fs=require('fs');var fs_extra=require(_0x7c99('0x8'));var _=require(_0x7c99('0x9'));var squel=require(_0x7c99('0xa'));var crypto=require('crypto');var jsforce=require(_0x7c99('0xb'));var deskjs=require(_0x7c99('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7c99('0xd'));var Papa=require(_0x7c99('0xe'));var Redis=require(_0x7c99('0xf'));var authService=require(_0x7c99('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7c99('0x11'));var hardwareService=require(_0x7c99('0x12'));var logger=require(_0x7c99('0x13'))(_0x7c99('0x14'));var utils=require(_0x7c99('0x15'));var config=require(_0x7c99('0x16'));var licenseUtil=require(_0x7c99('0x17'));var db=require(_0x7c99('0x18'))['db'];function respondWithStatusCode(_0x3b2e5f,_0x2ea5db){_0x2ea5db=_0x2ea5db||0xcc;return function(_0x29aaf6){if(_0x29aaf6){return _0x3b2e5f[_0x7c99('0x19')](_0x2ea5db);}return _0x3b2e5f['status'](_0x2ea5db)[_0x7c99('0x1a')]();};}function respondWithResult(_0x495f87,_0x25e1c4){_0x25e1c4=_0x25e1c4||0xc8;return function(_0x44fca3){if(_0x44fca3){return _0x495f87[_0x7c99('0x1b')](_0x25e1c4)['json'](_0x44fca3);}};}function respondWithFilteredResult(_0x1adecd,_0xa86522){return function(_0x7ea8dd){if(_0x7ea8dd){var _0x282b41=typeof _0xa86522['offset']===_0x7c99('0x1c')&&typeof _0xa86522['limit']===_0x7c99('0x1c');var _0x56f073=_0x7ea8dd[_0x7c99('0x1d')];var _0x230ee6=_0x282b41?0x0:_0xa86522[_0x7c99('0x1e')];var _0x5868c0=_0x282b41?_0x7ea8dd[_0x7c99('0x1d')]:_0xa86522[_0x7c99('0x1e')]+_0xa86522['limit'];var _0x57d7dc;if(_0x5868c0>=_0x56f073){_0x5868c0=_0x56f073;_0x57d7dc=0xc8;}else{_0x57d7dc=0xce;}_0x1adecd[_0x7c99('0x1b')](_0x57d7dc);return _0x1adecd[_0x7c99('0x1f')](_0x7c99('0x20'),_0x230ee6+'-'+_0x5868c0+'/'+_0x56f073)[_0x7c99('0x21')](_0x7ea8dd);}return null;};}function patchUpdates(_0x1786b4){return function(_0x4ae440){try{jsonpatch[_0x7c99('0x22')](_0x4ae440,_0x1786b4,!![]);}catch(_0x4ae94b){return BPromise[_0x7c99('0x23')](_0x4ae94b);}return _0x4ae440[_0x7c99('0x24')]();};}function saveUpdates(_0x5162d3,_0x2d1df7){return function(_0x3415a3){if(_0x3415a3){return _0x3415a3[_0x7c99('0x25')](_0x5162d3)[_0x7c99('0x26')](function(_0x40a56){return _0x40a56;});}return null;};}function removeEntity(_0x359452,_0x2b25b8){return function(_0x2d2629){if(_0x2d2629){return _0x2d2629[_0x7c99('0x27')]()['then'](function(){_0x359452[_0x7c99('0x1b')](0xcc)[_0x7c99('0x1a')]();});}};}function handleEntityNotFound(_0x74e525,_0x35116b){return function(_0x4ca1cc){if(!_0x4ca1cc){_0x74e525[_0x7c99('0x19')](0x194);}return _0x4ca1cc;};}function handleError(_0xa9480,_0x58837d){_0x58837d=_0x58837d||0x1f4;return function(_0x8e7fa9){logger[_0x7c99('0x28')](_0x8e7fa9[_0x7c99('0x29')]);if(_0x8e7fa9['name']){delete _0x8e7fa9[_0x7c99('0x2a')];}_0xa9480['status'](_0x58837d)[_0x7c99('0x2b')](_0x8e7fa9);};}exports['index']=function(_0x2c4534,_0x33e8dd){var _0x4a2be2={},_0x15b47d={},_0x139330={'count':0x0,'rows':[]};var _0x40a818=_[_0x7c99('0x2c')](db['VtigerField']['rawAttributes'],function(_0x105ae2){return{'name':_0x105ae2['fieldName'],'type':_0x105ae2[_0x7c99('0x2d')][_0x7c99('0x2e')]};});_0x15b47d['model']=_['map'](_0x40a818,_0x7c99('0x2a'));_0x15b47d[_0x7c99('0x2f')]=_['keys'](_0x2c4534[_0x7c99('0x2f')]);_0x15b47d['filters']=_[_0x7c99('0x30')](_0x15b47d[_0x7c99('0x31')],_0x15b47d[_0x7c99('0x2f')]);_0x4a2be2[_0x7c99('0x32')]=_[_0x7c99('0x30')](_0x15b47d['model'],qs[_0x7c99('0x33')](_0x2c4534[_0x7c99('0x2f')][_0x7c99('0x33')]));_0x4a2be2[_0x7c99('0x32')]=_0x4a2be2['attributes'][_0x7c99('0x34')]?_0x4a2be2[_0x7c99('0x32')]:_0x15b47d[_0x7c99('0x31')];if(!_0x2c4534[_0x7c99('0x2f')][_0x7c99('0x35')](_0x7c99('0x36'))){_0x4a2be2[_0x7c99('0x37')]=qs['limit'](_0x2c4534['query'][_0x7c99('0x37')]);_0x4a2be2['offset']=qs[_0x7c99('0x1e')](_0x2c4534['query'][_0x7c99('0x1e')]);}_0x4a2be2[_0x7c99('0x38')]=qs[_0x7c99('0x39')](_0x2c4534[_0x7c99('0x2f')][_0x7c99('0x39')]);_0x4a2be2[_0x7c99('0x3a')]=qs[_0x7c99('0x3b')](_[_0x7c99('0x3c')](_0x2c4534[_0x7c99('0x2f')],_0x15b47d[_0x7c99('0x3b')]),_0x40a818);if(_0x2c4534[_0x7c99('0x2f')][_0x7c99('0x3d')]){_0x4a2be2[_0x7c99('0x3a')]=_[_0x7c99('0x3e')](_0x4a2be2[_0x7c99('0x3a')],{'$or':_[_0x7c99('0x2c')](_0x40a818,function(_0x56b1d9){if(_0x56b1d9[_0x7c99('0x2d')]!==_0x7c99('0x3f')){var _0x40e797={};_0x40e797[_0x56b1d9[_0x7c99('0x2a')]]={'$like':'%'+_0x2c4534['query']['filter']+'%'};return _0x40e797;}})});}_0x4a2be2=_[_0x7c99('0x3e')]({},_0x4a2be2,_0x2c4534[_0x7c99('0x40')]);var _0x2de59c={'where':_0x4a2be2[_0x7c99('0x3a')]};return db['VtigerField'][_0x7c99('0x1d')](_0x2de59c)[_0x7c99('0x26')](function(_0x18b119){_0x139330[_0x7c99('0x1d')]=_0x18b119;if(_0x2c4534[_0x7c99('0x2f')][_0x7c99('0x41')]){_0x4a2be2[_0x7c99('0x42')]=[{'all':!![]}];}return db[_0x7c99('0x43')][_0x7c99('0x44')](_0x4a2be2);})[_0x7c99('0x26')](function(_0x40d66e){_0x139330[_0x7c99('0x45')]=_0x40d66e;return _0x139330;})['then'](respondWithFilteredResult(_0x33e8dd,_0x4a2be2))[_0x7c99('0x46')](handleError(_0x33e8dd,null));};exports[_0x7c99('0x47')]=function(_0x43787,_0x16c630){var _0x4b07b0={'raw':!![],'where':{'id':_0x43787['params']['id']}},_0x59f95d={};_0x59f95d[_0x7c99('0x31')]=_[_0x7c99('0x48')](db['VtigerField']['rawAttributes']);_0x59f95d[_0x7c99('0x2f')]=_[_0x7c99('0x48')](_0x43787['query']);_0x59f95d[_0x7c99('0x3b')]=_[_0x7c99('0x30')](_0x59f95d[_0x7c99('0x31')],_0x59f95d['query']);_0x4b07b0['attributes']=_[_0x7c99('0x30')](_0x59f95d[_0x7c99('0x31')],qs['fields'](_0x43787['query']['fields']));_0x4b07b0[_0x7c99('0x32')]=_0x4b07b0[_0x7c99('0x32')][_0x7c99('0x34')]?_0x4b07b0[_0x7c99('0x32')]:_0x59f95d[_0x7c99('0x31')];if(_0x43787[_0x7c99('0x2f')][_0x7c99('0x41')]){_0x4b07b0[_0x7c99('0x42')]=[{'all':!![]}];}_0x4b07b0=_[_0x7c99('0x3e')]({},_0x4b07b0,_0x43787['options']);return db[_0x7c99('0x43')]['find'](_0x4b07b0)[_0x7c99('0x26')](handleEntityNotFound(_0x16c630,null))['then'](respondWithResult(_0x16c630,null))[_0x7c99('0x46')](handleError(_0x16c630,null));};exports[_0x7c99('0x49')]=function(_0x158235,_0x3028e5){return db[_0x7c99('0x43')][_0x7c99('0x49')](_0x158235['body'],{})['then'](respondWithResult(_0x3028e5,0xc9))[_0x7c99('0x46')](handleError(_0x3028e5,null));};exports[_0x7c99('0x25')]=function(_0x1d012f,_0x223ccd){if(_0x1d012f['body']['id']){delete _0x1d012f[_0x7c99('0x4a')]['id'];}return db[_0x7c99('0x43')][_0x7c99('0x4b')]({'where':{'id':_0x1d012f[_0x7c99('0x4c')]['id']}})[_0x7c99('0x26')](handleEntityNotFound(_0x223ccd,null))[_0x7c99('0x26')](saveUpdates(_0x1d012f[_0x7c99('0x4a')],null))[_0x7c99('0x26')](respondWithResult(_0x223ccd,null))[_0x7c99('0x46')](handleError(_0x223ccd,null));};exports[_0x7c99('0x27')]=function(_0x27be21,_0x2ec80e){return db[_0x7c99('0x43')]['find']({'where':{'id':_0x27be21[_0x7c99('0x4c')]['id']}})[_0x7c99('0x26')](handleEntityNotFound(_0x2ec80e,null))[_0x7c99('0x26')](removeEntity(_0x2ec80e,null))[_0x7c99('0x46')](handleError(_0x2ec80e,null));}; \ No newline at end of file +var _0x59e7=['create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','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','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerField','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','rawAttributes','options','find'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x59e7,0x9b));var _0x759e=function(_0x3a2559,_0x40c684){_0x3a2559=_0x3a2559-0x0;var _0x4e1ee5=_0x59e7[_0x3a2559];return _0x4e1ee5;};'use strict';var emlformat=require(_0x759e('0x0'));var rimraf=require(_0x759e('0x1'));var zipdir=require(_0x759e('0x2'));var jsonpatch=require(_0x759e('0x3'));var rp=require(_0x759e('0x4'));var moment=require(_0x759e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x759e('0x6'));var util=require(_0x759e('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x759e('0x8'));var fs=require('fs');var fs_extra=require(_0x759e('0x9'));var _=require('lodash');var squel=require(_0x759e('0xa'));var crypto=require(_0x759e('0xb'));var jsforce=require(_0x759e('0xc'));var deskjs=require(_0x759e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x759e('0xe'));var Papa=require(_0x759e('0xf'));var Redis=require(_0x759e('0x10'));var authService=require(_0x759e('0x11'));var qs=require(_0x759e('0x12'));var as=require(_0x759e('0x13'));var hardwareService=require(_0x759e('0x14'));var logger=require(_0x759e('0x15'))(_0x759e('0x16'));var utils=require(_0x759e('0x17'));var config=require(_0x759e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x759e('0x19'))['db'];function respondWithStatusCode(_0x3736c0,_0x4ed6b5){_0x4ed6b5=_0x4ed6b5||0xcc;return function(_0x2f2205){if(_0x2f2205){return _0x3736c0[_0x759e('0x1a')](_0x4ed6b5);}return _0x3736c0[_0x759e('0x1b')](_0x4ed6b5)[_0x759e('0x1c')]();};}function respondWithResult(_0x1c6077,_0x5b5886){_0x5b5886=_0x5b5886||0xc8;return function(_0x12be86){if(_0x12be86){return _0x1c6077['status'](_0x5b5886)[_0x759e('0x1d')](_0x12be86);}};}function respondWithFilteredResult(_0x6ffa4f,_0x4311e2){return function(_0x40fc6c){if(_0x40fc6c){var _0x42c62f=typeof _0x4311e2[_0x759e('0x1e')]===_0x759e('0x1f')&&typeof _0x4311e2['limit']===_0x759e('0x1f');var _0x180b28=_0x40fc6c[_0x759e('0x20')];var _0x87a686=_0x42c62f?0x0:_0x4311e2['offset'];var _0x7e8f04=_0x42c62f?_0x40fc6c[_0x759e('0x20')]:_0x4311e2[_0x759e('0x1e')]+_0x4311e2[_0x759e('0x21')];var _0x4e4afc;if(_0x7e8f04>=_0x180b28){_0x7e8f04=_0x180b28;_0x4e4afc=0xc8;}else{_0x4e4afc=0xce;}_0x6ffa4f[_0x759e('0x1b')](_0x4e4afc);return _0x6ffa4f['set'](_0x759e('0x22'),_0x87a686+'-'+_0x7e8f04+'/'+_0x180b28)[_0x759e('0x1d')](_0x40fc6c);}return null;};}function patchUpdates(_0x1a3631){return function(_0x28ad57){try{jsonpatch['apply'](_0x28ad57,_0x1a3631,!![]);}catch(_0x74cf42){return BPromise[_0x759e('0x23')](_0x74cf42);}return _0x28ad57[_0x759e('0x24')]();};}function saveUpdates(_0x24b40f,_0x2f709d){return function(_0x5099c5){if(_0x5099c5){return _0x5099c5[_0x759e('0x25')](_0x24b40f)[_0x759e('0x26')](function(_0x2e8780){return _0x2e8780;});}return null;};}function removeEntity(_0x44703f,_0x2a044d){return function(_0x36b769){if(_0x36b769){return _0x36b769[_0x759e('0x27')]()['then'](function(){_0x44703f[_0x759e('0x1b')](0xcc)[_0x759e('0x1c')]();});}};}function handleEntityNotFound(_0x75c0e6,_0x39cd9b){return function(_0x4b5c76){if(!_0x4b5c76){_0x75c0e6[_0x759e('0x1a')](0x194);}return _0x4b5c76;};}function handleError(_0x5c704,_0x135672){_0x135672=_0x135672||0x1f4;return function(_0x59d0b0){logger[_0x759e('0x28')](_0x59d0b0[_0x759e('0x29')]);if(_0x59d0b0[_0x759e('0x2a')]){delete _0x59d0b0[_0x759e('0x2a')];}_0x5c704[_0x759e('0x1b')](_0x135672)[_0x759e('0x2b')](_0x59d0b0);};}exports[_0x759e('0x2c')]=function(_0x5b1481,_0x408559){var _0x3e3c2f={},_0x571d20={},_0x1a926d={'count':0x0,'rows':[]};var _0x590970=_[_0x759e('0x2d')](db[_0x759e('0x2e')]['rawAttributes'],function(_0xa199e5){return{'name':_0xa199e5[_0x759e('0x2f')],'type':_0xa199e5[_0x759e('0x30')][_0x759e('0x31')]};});_0x571d20[_0x759e('0x32')]=_[_0x759e('0x2d')](_0x590970,_0x759e('0x2a'));_0x571d20[_0x759e('0x33')]=_[_0x759e('0x34')](_0x5b1481[_0x759e('0x33')]);_0x571d20[_0x759e('0x35')]=_['intersection'](_0x571d20[_0x759e('0x32')],_0x571d20['query']);_0x3e3c2f[_0x759e('0x36')]=_[_0x759e('0x37')](_0x571d20['model'],qs[_0x759e('0x38')](_0x5b1481[_0x759e('0x33')][_0x759e('0x38')]));_0x3e3c2f[_0x759e('0x36')]=_0x3e3c2f['attributes'][_0x759e('0x39')]?_0x3e3c2f[_0x759e('0x36')]:_0x571d20['model'];if(!_0x5b1481[_0x759e('0x33')]['hasOwnProperty']('nolimit')){_0x3e3c2f[_0x759e('0x21')]=qs['limit'](_0x5b1481[_0x759e('0x33')][_0x759e('0x21')]);_0x3e3c2f['offset']=qs['offset'](_0x5b1481[_0x759e('0x33')][_0x759e('0x1e')]);}_0x3e3c2f[_0x759e('0x3a')]=qs[_0x759e('0x3b')](_0x5b1481['query']['sort']);_0x3e3c2f[_0x759e('0x3c')]=qs[_0x759e('0x35')](_[_0x759e('0x3d')](_0x5b1481[_0x759e('0x33')],_0x571d20[_0x759e('0x35')]),_0x590970);if(_0x5b1481['query'][_0x759e('0x3e')]){_0x3e3c2f['where']=_[_0x759e('0x3f')](_0x3e3c2f[_0x759e('0x3c')],{'$or':_[_0x759e('0x2d')](_0x590970,function(_0x1198f9){if(_0x1198f9[_0x759e('0x30')]!=='VIRTUAL'){var _0x145689={};_0x145689[_0x1198f9[_0x759e('0x2a')]]={'$like':'%'+_0x5b1481[_0x759e('0x33')][_0x759e('0x3e')]+'%'};return _0x145689;}})});}_0x3e3c2f=_['merge']({},_0x3e3c2f,_0x5b1481['options']);var _0x5dd992={'where':_0x3e3c2f[_0x759e('0x3c')]};return db[_0x759e('0x2e')]['count'](_0x5dd992)[_0x759e('0x26')](function(_0x98e052){_0x1a926d[_0x759e('0x20')]=_0x98e052;if(_0x5b1481[_0x759e('0x33')][_0x759e('0x40')]){_0x3e3c2f[_0x759e('0x41')]=[{'all':!![]}];}return db[_0x759e('0x2e')][_0x759e('0x42')](_0x3e3c2f);})[_0x759e('0x26')](function(_0x264d3d){_0x1a926d[_0x759e('0x43')]=_0x264d3d;return _0x1a926d;})[_0x759e('0x26')](respondWithFilteredResult(_0x408559,_0x3e3c2f))['catch'](handleError(_0x408559,null));};exports[_0x759e('0x44')]=function(_0x2840c4,_0x7570b6){var _0x20557b={'raw':!![],'where':{'id':_0x2840c4[_0x759e('0x45')]['id']}},_0xc28203={};_0xc28203[_0x759e('0x32')]=_[_0x759e('0x34')](db[_0x759e('0x2e')][_0x759e('0x46')]);_0xc28203['query']=_[_0x759e('0x34')](_0x2840c4['query']);_0xc28203[_0x759e('0x35')]=_[_0x759e('0x37')](_0xc28203[_0x759e('0x32')],_0xc28203[_0x759e('0x33')]);_0x20557b[_0x759e('0x36')]=_[_0x759e('0x37')](_0xc28203[_0x759e('0x32')],qs['fields'](_0x2840c4[_0x759e('0x33')][_0x759e('0x38')]));_0x20557b['attributes']=_0x20557b[_0x759e('0x36')][_0x759e('0x39')]?_0x20557b[_0x759e('0x36')]:_0xc28203[_0x759e('0x32')];if(_0x2840c4[_0x759e('0x33')][_0x759e('0x40')]){_0x20557b[_0x759e('0x41')]=[{'all':!![]}];}_0x20557b=_[_0x759e('0x3f')]({},_0x20557b,_0x2840c4[_0x759e('0x47')]);return db[_0x759e('0x2e')][_0x759e('0x48')](_0x20557b)[_0x759e('0x26')](handleEntityNotFound(_0x7570b6,null))[_0x759e('0x26')](respondWithResult(_0x7570b6,null))['catch'](handleError(_0x7570b6,null));};exports['create']=function(_0x2a05e4,_0x6df00a){return db[_0x759e('0x2e')][_0x759e('0x49')](_0x2a05e4[_0x759e('0x4a')],{})['then'](respondWithResult(_0x6df00a,0xc9))[_0x759e('0x4b')](handleError(_0x6df00a,null));};exports[_0x759e('0x25')]=function(_0x1905ba,_0x238eba){if(_0x1905ba['body']['id']){delete _0x1905ba[_0x759e('0x4a')]['id'];}return db[_0x759e('0x2e')][_0x759e('0x48')]({'where':{'id':_0x1905ba[_0x759e('0x45')]['id']}})['then'](handleEntityNotFound(_0x238eba,null))[_0x759e('0x26')](saveUpdates(_0x1905ba['body'],null))['then'](respondWithResult(_0x238eba,null))[_0x759e('0x4b')](handleError(_0x238eba,null));};exports[_0x759e('0x27')]=function(_0x26ab95,_0x5a32ae){return db[_0x759e('0x2e')][_0x759e('0x48')]({'where':{'id':_0x26ab95[_0x759e('0x45')]['id']}})[_0x759e('0x26')](handleEntityNotFound(_0x5a32ae,null))[_0x759e('0x26')](removeEntity(_0x5a32ae,null))['catch'](handleError(_0x5a32ae,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index d09cdae..c0f340c 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 _0xb1a8=['bluebird','request-promise','path','rimraf','VtigerField','int_vtiger_fields','idField','FieldId','lodash','../../config/logger','moment'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xb1a8,0x105));var _0x8b1a=function(_0x7624c6,_0x9ff83a){_0x7624c6=_0x7624c6-0x0;var _0x37256d=_0xb1a8[_0x7624c6];return _0x37256d;};'use strict';var _=require(_0x8b1a('0x0'));var util=require('util');var logger=require(_0x8b1a('0x1'))('api');var moment=require(_0x8b1a('0x2'));var BPromise=require(_0x8b1a('0x3'));var rp=require(_0x8b1a('0x4'));var fs=require('fs');var path=require(_0x8b1a('0x5'));var rimraf=require(_0x8b1a('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x131ef5,_0x3b48a6){return _0x131ef5['define'](_0x8b1a('0x7'),attributes,{'tableName':_0x8b1a('0x8'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x8b1a('0x9'),_0x8b1a('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x23a2=['../../config/environment','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3a32e8,_0x274dcb){var _0xc379f8=function(_0x5a1d8e){while(--_0x5a1d8e){_0x3a32e8['push'](_0x3a32e8['shift']());}};_0xc379f8(++_0x274dcb);}(_0x23a2,0x173));var _0x223a=function(_0x2ee7c2,_0x135c18){_0x2ee7c2=_0x2ee7c2-0x0;var _0x5db59e=_0x23a2[_0x2ee7c2];return _0x5db59e;};'use strict';var _=require('lodash');var util=require(_0x223a('0x0'));var logger=require(_0x223a('0x1'))(_0x223a('0x2'));var moment=require(_0x223a('0x3'));var BPromise=require(_0x223a('0x4'));var rp=require(_0x223a('0x5'));var fs=require('fs');var path=require(_0x223a('0x6'));var rimraf=require('rimraf');var config=require(_0x223a('0x7'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x3db447,_0xfb010c){return _0x3db447[_0x223a('0x8')](_0x223a('0x9'),attributes,{'tableName':_0x223a('0xa'),'paranoid':![],'indexes':[{'name':_0x223a('0xb'),'fields':[_0x223a('0xc'),_0x223a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index e43407d..0b62428 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 _0x663e=['message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x663e,0x1d2));var _0xe663=function(_0xfd16b2,_0x1228e7){_0xfd16b2=_0xfd16b2-0x0;var _0x151d0a=_0x663e[_0xfd16b2];return _0x151d0a;};'use strict';var _=require('lodash');var util=require(_0xe663('0x0'));var moment=require('moment');var BPromise=require(_0xe663('0x1'));var rs=require(_0xe663('0x2'));var fs=require('fs');var Redis=require(_0xe663('0x3'));var db=require(_0xe663('0x4'))['db'];var utils=require(_0xe663('0x5'));var logger=require(_0xe663('0x6'))(_0xe663('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe663('0x8')][_0xe663('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x118d4f,_0xd845d1,_0x1817e4){return new BPromise(function(_0x5274a1,_0x11406e){return client['request'](_0x118d4f,_0x1817e4)['then'](function(_0x4c7e16){logger['info'](_0xe663('0xa'),_0xd845d1,_0xe663('0xb'));logger[_0xe663('0xc')](_0xe663('0xd'),_0xd845d1,_0xe663('0xb'),JSON[_0xe663('0xe')](_0x4c7e16));if(_0x4c7e16[_0xe663('0xf')]){if(_0x4c7e16[_0xe663('0xf')][_0xe663('0x10')]===0x1f4){logger['error'](_0xe663('0xa'),_0xd845d1,_0x4c7e16['error'][_0xe663('0x11')]);return _0x11406e(_0x4c7e16[_0xe663('0xf')][_0xe663('0x11')]);}logger[_0xe663('0xf')](_0xe663('0xa'),_0xd845d1,_0x4c7e16[_0xe663('0xf')][_0xe663('0x11')]);return _0x5274a1(_0x4c7e16[_0xe663('0xf')][_0xe663('0x11')]);}else{logger[_0xe663('0x12')](_0xe663('0xa'),_0xd845d1,_0xe663('0xb'));_0x5274a1(_0x4c7e16[_0xe663('0x13')]['message']);}})[_0xe663('0x14')](function(_0xea02c){logger[_0xe663('0xf')](_0xe663('0xa'),_0xd845d1,_0xea02c);_0x11406e(_0xea02c);});});} \ No newline at end of file +var _0x79db=['code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','request\x20sent','stringify','error'];(function(_0x222bf0,_0x5c6e4a){var _0x231a17=function(_0x567aa9){while(--_0x567aa9){_0x222bf0['push'](_0x222bf0['shift']());}};_0x231a17(++_0x5c6e4a);}(_0x79db,0x17f));var _0xb79d=function(_0x5ca353,_0x21eb37){_0x5ca353=_0x5ca353-0x0;var _0x4f2fe5=_0x79db[_0x5ca353];return _0x4f2fe5;};'use strict';var _=require(_0xb79d('0x0'));var util=require('util');var moment=require(_0xb79d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb79d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb79d('0x3'));var logger=require(_0xb79d('0x4'))(_0xb79d('0x5'));var config=require(_0xb79d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb79d('0x7')][_0xb79d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b66d0,_0x192e6a,_0x5434a0){return new BPromise(function(_0x123f81,_0x355017){return client[_0xb79d('0x9')](_0x5b66d0,_0x5434a0)[_0xb79d('0xa')](function(_0x5eb258){logger[_0xb79d('0xb')]('VtigerField,\x20%s,\x20%s',_0x192e6a,'request\x20sent');logger[_0xb79d('0xc')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x192e6a,_0xb79d('0xd'),JSON[_0xb79d('0xe')](_0x5eb258));if(_0x5eb258[_0xb79d('0xf')]){if(_0x5eb258[_0xb79d('0xf')][_0xb79d('0x10')]===0x1f4){logger['error'](_0xb79d('0x11'),_0x192e6a,_0x5eb258[_0xb79d('0xf')][_0xb79d('0x12')]);return _0x355017(_0x5eb258['error'][_0xb79d('0x12')]);}logger[_0xb79d('0xf')](_0xb79d('0x11'),_0x192e6a,_0x5eb258['error'][_0xb79d('0x12')]);return _0x123f81(_0x5eb258[_0xb79d('0xf')][_0xb79d('0x12')]);}else{logger[_0xb79d('0xb')](_0xb79d('0x11'),_0x192e6a,_0xb79d('0xd'));_0x123f81(_0x5eb258[_0xb79d('0x13')][_0xb79d('0x12')]);}})[_0xb79d('0x14')](function(_0x518b14){logger[_0xb79d('0xf')]('VtigerField,\x20%s,\x20%s',_0x192e6a,_0x518b14);_0x355017(_0x518b14);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 80808ea..c00f15a 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 _0x95a7=['isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x95a7,0x12c));var _0x795a=function(_0x150c44,_0x5636d5){_0x150c44=_0x150c44-0x0;var _0xe7b06=_0x95a7[_0x150c44];return _0xe7b06;};'use strict';var multer=require(_0x795a('0x0'));var util=require(_0x795a('0x1'));var path=require(_0x795a('0x2'));var timeout=require(_0x795a('0x3'));var express=require(_0x795a('0x4'));var router=express[_0x795a('0x5')]();var fs_extra=require(_0x795a('0x6'));var auth=require(_0x795a('0x7'));var interaction=require(_0x795a('0x8'));var config=require(_0x795a('0x9'));var controller=require(_0x795a('0xa'));router[_0x795a('0xb')]('/',auth[_0x795a('0xc')](),controller[_0x795a('0xd')]);router['get'](_0x795a('0xe'),auth[_0x795a('0xc')](),controller[_0x795a('0xf')]);router[_0x795a('0xb')]('/:id/configurations',auth[_0x795a('0xc')](),controller[_0x795a('0x10')]);router['get'](_0x795a('0x11'),auth[_0x795a('0xc')](),controller[_0x795a('0x12')]);router[_0x795a('0x13')]('/',auth[_0x795a('0xc')](),controller[_0x795a('0x14')]);router['post']('/:id/configurations',auth[_0x795a('0xc')](),controller[_0x795a('0x15')]);router[_0x795a('0x16')](_0x795a('0xe'),auth[_0x795a('0xc')](),controller[_0x795a('0x17')]);router['delete'](_0x795a('0xe'),auth[_0x795a('0xc')](),controller[_0x795a('0x18')]);module[_0x795a('0x19')]=router; \ No newline at end of file +var _0x733f=['index','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','/:id','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated'];(function(_0x3f2fad,_0x1ac783){var _0x11602d=function(_0xa4f848){while(--_0xa4f848){_0x3f2fad['push'](_0x3f2fad['shift']());}};_0x11602d(++_0x1ac783);}(_0x733f,0x120));var _0xf733=function(_0x158b49,_0x37457a){_0x158b49=_0x158b49-0x0;var _0xaff79=_0x733f[_0x158b49];return _0xaff79;};'use strict';var multer=require(_0xf733('0x0'));var util=require('util');var path=require(_0xf733('0x1'));var timeout=require(_0xf733('0x2'));var express=require(_0xf733('0x3'));var router=express['Router']();var fs_extra=require(_0xf733('0x4'));var auth=require(_0xf733('0x5'));var interaction=require(_0xf733('0x6'));var config=require(_0xf733('0x7'));var controller=require(_0xf733('0x8'));router[_0xf733('0x9')]('/',auth[_0xf733('0xa')](),controller[_0xf733('0xb')]);router[_0xf733('0x9')]('/:id',auth[_0xf733('0xa')](),controller[_0xf733('0xc')]);router['get'](_0xf733('0xd'),auth[_0xf733('0xa')](),controller[_0xf733('0xe')]);router[_0xf733('0x9')]('/:id/fields',auth[_0xf733('0xa')](),controller[_0xf733('0xf')]);router[_0xf733('0x10')]('/',auth[_0xf733('0xa')](),controller[_0xf733('0x11')]);router[_0xf733('0x10')](_0xf733('0xd'),auth['isAuthenticated'](),controller[_0xf733('0x12')]);router[_0xf733('0x13')](_0xf733('0x14'),auth[_0xf733('0xa')](),controller['update']);router[_0xf733('0x15')](_0xf733('0x14'),auth['isAuthenticated'](),controller[_0xf733('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 8fabda3..a017a4c 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 _0x7ed1=['password','token','integrationTab','newTab','sequelize','STRING','username','remoteUri','ENUM'];(function(_0x4f7c98,_0x3b5356){var _0x4486df=function(_0x4bbb0f){while(--_0x4bbb0f){_0x4f7c98['push'](_0x4f7c98['shift']());}};_0x4486df(++_0x3b5356);}(_0x7ed1,0xca));var _0x17ed=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x7ed1[_0x3d42d8];return _0x27fc41;};'use strict';var Sequelize=require(_0x17ed('0x0'));module['exports']={'name':{'type':Sequelize[_0x17ed('0x1')]},'description':{'type':Sequelize[_0x17ed('0x1')]},'username':{'type':Sequelize[_0x17ed('0x1')],'unique':_0x17ed('0x2')},'password':{'type':Sequelize[_0x17ed('0x1')]},'token':{'type':Sequelize[_0x17ed('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x17ed('0x3')},'authType':{'type':Sequelize[_0x17ed('0x4')](_0x17ed('0x5'),_0x17ed('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x17ed('0x4')](_0x17ed('0x7'),_0x17ed('0x8')),'defaultValue':_0x17ed('0x7')}}; \ No newline at end of file +var _0x6eec=['password','token','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x1b4d01,_0x5c3ab9){var _0x1a1003=function(_0x2785b7){while(--_0x2785b7){_0x1b4d01['push'](_0x1b4d01['shift']());}};_0x1a1003(++_0x5c3ab9);}(_0x6eec,0x1e0));var _0xc6ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6eec[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc6ee('0x0'));module[_0xc6ee('0x1')]={'name':{'type':Sequelize[_0xc6ee('0x2')]},'description':{'type':Sequelize[_0xc6ee('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc6ee('0x3')},'password':{'type':Sequelize[_0xc6ee('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc6ee('0x2')],'unique':_0xc6ee('0x4')},'authType':{'type':Sequelize[_0xc6ee('0x5')](_0xc6ee('0x6'),_0xc6ee('0x7')),'defaultValue':_0xc6ee('0x6')},'serverUrl':{'type':Sequelize[_0xc6ee('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc6ee('0x5')](_0xc6ee('0x8'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 3f2baff..a90f98e 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 _0xefda=['getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','group','assignee','remove','ticket_fields','includes','position','system_field_options','custom_field_options','test','statusCode','stringify','send','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','rawAttributes','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskAccount','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','AccountId','Subjects','channel','type','Descriptions'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0xefda,0x96));var _0xaefd=function(_0xf0ae5f,_0xd22ac7){_0xf0ae5f=_0xf0ae5f-0x0;var _0xf1ba5a=_0xefda[_0xf0ae5f];return _0xf1ba5a;};'use strict';var emlformat=require(_0xaefd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaefd('0x1'));var rp=require(_0xaefd('0x2'));var moment=require('moment');var BPromise=require(_0xaefd('0x3'));var Mustache=require(_0xaefd('0x4'));var util=require(_0xaefd('0x5'));var path=require(_0xaefd('0x6'));var sox=require(_0xaefd('0x7'));var csv=require(_0xaefd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaefd('0x9'));var _=require(_0xaefd('0xa'));var squel=require(_0xaefd('0xb'));var crypto=require(_0xaefd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaefd('0xd'));var toCsv=require(_0xaefd('0x8'));var querystring=require(_0xaefd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaefd('0xf'));var as=require(_0xaefd('0x10'));var hardwareService=require(_0xaefd('0x11'));var logger=require(_0xaefd('0x12'))(_0xaefd('0x13'));var utils=require(_0xaefd('0x14'));var config=require(_0xaefd('0x15'));var licenseUtil=require(_0xaefd('0x16'));var db=require(_0xaefd('0x17'))['db'];var integrations=require(_0xaefd('0x18'));function respondWithStatusCode(_0x2a310c,_0x4b2b5c){_0x4b2b5c=_0x4b2b5c||0xcc;return function(_0x3172d3){if(_0x3172d3){return _0x2a310c['sendStatus'](_0x4b2b5c);}return _0x2a310c[_0xaefd('0x19')](_0x4b2b5c)[_0xaefd('0x1a')]();};}function respondWithResult(_0x9dfdf6,_0x43b82a){_0x43b82a=_0x43b82a||0xc8;return function(_0x4ec92a){if(_0x4ec92a){return _0x9dfdf6[_0xaefd('0x19')](_0x43b82a)[_0xaefd('0x1b')](_0x4ec92a);}};}function respondWithFilteredResult(_0x41f345,_0x411701){return function(_0x10ee28){if(_0x10ee28){var _0x32f75e=typeof _0x411701[_0xaefd('0x1c')]===_0xaefd('0x1d')&&typeof _0x411701['limit']===_0xaefd('0x1d');var _0x109604=_0x10ee28[_0xaefd('0x1e')];var _0x1737a1=_0x32f75e?0x0:_0x411701[_0xaefd('0x1c')];var _0x244956=_0x32f75e?_0x10ee28['count']:_0x411701[_0xaefd('0x1c')]+_0x411701[_0xaefd('0x1f')];var _0x24f131;if(_0x244956>=_0x109604){_0x244956=_0x109604;_0x24f131=0xc8;}else{_0x24f131=0xce;}_0x41f345[_0xaefd('0x19')](_0x24f131);return _0x41f345[_0xaefd('0x20')](_0xaefd('0x21'),_0x1737a1+'-'+_0x244956+'/'+_0x109604)['json'](_0x10ee28);}return null;};}function patchUpdates(_0x463d48){return function(_0x18e71c){try{jsonpatch[_0xaefd('0x22')](_0x18e71c,_0x463d48,!![]);}catch(_0x3d9823){return BPromise[_0xaefd('0x23')](_0x3d9823);}return _0x18e71c['save']();};}function saveUpdates(_0x479486,_0x5b9967){return function(_0x21680a){if(_0x21680a){return _0x21680a[_0xaefd('0x24')](_0x479486)[_0xaefd('0x25')](function(_0x5a44ed){return _0x5a44ed;});}return null;};}function removeEntity(_0x23060f,_0x4cd9b2){return function(_0x3deec8){if(_0x3deec8){return _0x3deec8[_0xaefd('0x26')]()[_0xaefd('0x25')](function(){_0x23060f['status'](0xcc)[_0xaefd('0x1a')]();});}};}function handleEntityNotFound(_0x3ffc9c,_0x18e720){return function(_0x14cc9d){if(!_0x14cc9d){_0x3ffc9c[_0xaefd('0x27')](0x194);}return _0x14cc9d;};}function handleError(_0x5a170c,_0x2fe27e){_0x2fe27e=_0x2fe27e||0x1f4;return function(_0x58c008){logger[_0xaefd('0x28')](_0x58c008[_0xaefd('0x29')]);if(_0x58c008['name']){delete _0x58c008[_0xaefd('0x2a')];}_0x5a170c[_0xaefd('0x19')](_0x2fe27e)['send'](_0x58c008);};}exports[_0xaefd('0x2b')]=function(_0x114ec0,_0x36b6b7){var _0x4c0898={},_0x45f0e8={},_0x5c573b={'count':0x0,'rows':[]};var _0x109e19=_['map'](db['ZendeskAccount'][_0xaefd('0x2c')],function(_0x1b470c){return{'name':_0x1b470c['fieldName'],'type':_0x1b470c['type']['key']};});_0x45f0e8[_0xaefd('0x2d')]=_[_0xaefd('0x2e')](_0x109e19,'name');_0x45f0e8['query']=_[_0xaefd('0x2f')](_0x114ec0[_0xaefd('0x30')]);_0x45f0e8[_0xaefd('0x31')]=_[_0xaefd('0x32')](_0x45f0e8['model'],_0x45f0e8[_0xaefd('0x30')]);_0x4c0898[_0xaefd('0x33')]=_[_0xaefd('0x32')](_0x45f0e8[_0xaefd('0x2d')],qs[_0xaefd('0x34')](_0x114ec0[_0xaefd('0x30')][_0xaefd('0x34')]));_0x4c0898[_0xaefd('0x33')]=_0x4c0898[_0xaefd('0x33')][_0xaefd('0x35')]?_0x4c0898[_0xaefd('0x33')]:_0x45f0e8[_0xaefd('0x2d')];if(!_0x114ec0[_0xaefd('0x30')][_0xaefd('0x36')](_0xaefd('0x37'))){_0x4c0898[_0xaefd('0x1f')]=qs['limit'](_0x114ec0[_0xaefd('0x30')][_0xaefd('0x1f')]);_0x4c0898[_0xaefd('0x1c')]=qs['offset'](_0x114ec0[_0xaefd('0x30')]['offset']);}_0x4c0898[_0xaefd('0x38')]=qs[_0xaefd('0x39')](_0x114ec0[_0xaefd('0x30')][_0xaefd('0x39')]);_0x4c0898[_0xaefd('0x3a')]=qs[_0xaefd('0x31')](_[_0xaefd('0x3b')](_0x114ec0[_0xaefd('0x30')],_0x45f0e8[_0xaefd('0x31')]),_0x109e19);if(_0x114ec0[_0xaefd('0x30')][_0xaefd('0x3c')]){_0x4c0898[_0xaefd('0x3a')]=_[_0xaefd('0x3d')](_0x4c0898[_0xaefd('0x3a')],{'$or':_['map'](_0x109e19,function(_0x1cfd6d){if(_0x1cfd6d['type']!==_0xaefd('0x3e')){var _0x6562={};_0x6562[_0x1cfd6d[_0xaefd('0x2a')]]={'$like':'%'+_0x114ec0[_0xaefd('0x30')][_0xaefd('0x3c')]+'%'};return _0x6562;}})});}_0x4c0898=_[_0xaefd('0x3d')]({},_0x4c0898,_0x114ec0[_0xaefd('0x3f')]);var _0x145e9e={'where':_0x4c0898[_0xaefd('0x3a')]};return db[_0xaefd('0x40')]['count'](_0x145e9e)[_0xaefd('0x25')](function(_0x3296ac){_0x5c573b['count']=_0x3296ac;if(_0x114ec0[_0xaefd('0x30')][_0xaefd('0x41')]){_0x4c0898[_0xaefd('0x42')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x4c0898);})[_0xaefd('0x25')](function(_0x3d0abf){_0x5c573b[_0xaefd('0x43')]=_0x3d0abf;return _0x5c573b;})[_0xaefd('0x25')](respondWithFilteredResult(_0x36b6b7,_0x4c0898))[_0xaefd('0x44')](handleError(_0x36b6b7,null));};exports[_0xaefd('0x45')]=function(_0x2e17b5,_0x2e98aa){var _0x48a7af={'raw':![],'where':{'id':_0x2e17b5[_0xaefd('0x46')]['id']}},_0x26587e={};_0x26587e[_0xaefd('0x2d')]=_[_0xaefd('0x2f')](db[_0xaefd('0x40')][_0xaefd('0x2c')]);_0x26587e[_0xaefd('0x30')]=_[_0xaefd('0x2f')](_0x2e17b5['query']);_0x26587e['filters']=_[_0xaefd('0x32')](_0x26587e[_0xaefd('0x2d')],_0x26587e['query']);_0x48a7af['attributes']=_[_0xaefd('0x32')](_0x26587e[_0xaefd('0x2d')],qs[_0xaefd('0x34')](_0x2e17b5[_0xaefd('0x30')][_0xaefd('0x34')]));_0x48a7af[_0xaefd('0x33')]=_0x48a7af[_0xaefd('0x33')][_0xaefd('0x35')]?_0x48a7af[_0xaefd('0x33')]:_0x26587e['model'];if(_0x2e17b5[_0xaefd('0x30')][_0xaefd('0x41')]){_0x48a7af[_0xaefd('0x42')]=[{'all':!![]}];}_0x48a7af=_[_0xaefd('0x3d')]({},_0x48a7af,_0x2e17b5[_0xaefd('0x3f')]);return db[_0xaefd('0x40')][_0xaefd('0x47')](_0x48a7af)['then'](handleEntityNotFound(_0x2e98aa,null))[_0xaefd('0x25')](respondWithResult(_0x2e98aa,null))['catch'](handleError(_0x2e98aa,null));};exports[_0xaefd('0x48')]=function(_0x374845,_0x16c664){return db[_0xaefd('0x40')]['create'](_0x374845['body'],{})[_0xaefd('0x25')](respondWithResult(_0x16c664,0xc9))[_0xaefd('0x44')](handleError(_0x16c664,null));};exports[_0xaefd('0x24')]=function(_0x4eeb56,_0x2a836a){if(_0x4eeb56[_0xaefd('0x49')]['id']){delete _0x4eeb56['body']['id'];}return db[_0xaefd('0x40')][_0xaefd('0x47')]({'where':{'id':_0x4eeb56[_0xaefd('0x46')]['id']}})[_0xaefd('0x25')](handleEntityNotFound(_0x2a836a,null))[_0xaefd('0x25')](saveUpdates(_0x4eeb56[_0xaefd('0x49')],null))[_0xaefd('0x25')](respondWithResult(_0x2a836a,null))[_0xaefd('0x44')](handleError(_0x2a836a,null));};exports['destroy']=function(_0x567ceb,_0x1406b8){return db[_0xaefd('0x40')]['find']({'where':{'id':_0x567ceb[_0xaefd('0x46')]['id']}})['then'](handleEntityNotFound(_0x1406b8,null))[_0xaefd('0x25')](removeEntity(_0x1406b8,null))[_0xaefd('0x44')](handleError(_0x1406b8,null));};exports[_0xaefd('0x4a')]=function(_0x69185e,_0x27fd3f,_0xf727cd){var _0x4b709a={};var _0x56e180={};var _0x1fd0b0;var _0x338823;return db['ZendeskAccount'][_0xaefd('0x4b')]({'where':{'id':_0x69185e[_0xaefd('0x46')]['id']}})[_0xaefd('0x25')](handleEntityNotFound(_0x27fd3f,null))[_0xaefd('0x25')](function(_0x4a883b){if(_0x4a883b){_0x1fd0b0=_0x4a883b;_0x56e180['model']=_[_0xaefd('0x2f')](db[_0xaefd('0x4c')][_0xaefd('0x2c')]);_0x56e180[_0xaefd('0x30')]=_[_0xaefd('0x2f')](_0x69185e['query']);_0x56e180[_0xaefd('0x31')]=_[_0xaefd('0x32')](_0x56e180['model'],_0x56e180[_0xaefd('0x30')]);_0x4b709a[_0xaefd('0x33')]=_['intersection'](_0x56e180[_0xaefd('0x2d')],qs[_0xaefd('0x34')](_0x69185e[_0xaefd('0x30')]['fields']));_0x4b709a[_0xaefd('0x33')]=_0x4b709a[_0xaefd('0x33')]['length']?_0x4b709a[_0xaefd('0x33')]:_0x56e180[_0xaefd('0x2d')];_0x4b709a[_0xaefd('0x38')]=qs[_0xaefd('0x39')](_0x69185e['query']['sort']);_0x4b709a[_0xaefd('0x3a')]=qs[_0xaefd('0x31')](_[_0xaefd('0x3b')](_0x69185e[_0xaefd('0x30')],_0x56e180[_0xaefd('0x31')]));if(_0x69185e[_0xaefd('0x30')][_0xaefd('0x3c')]){_0x4b709a[_0xaefd('0x3a')]=_[_0xaefd('0x3d')](_0x4b709a[_0xaefd('0x3a')],{'$or':_['map'](_0x4b709a['attributes'],function(_0x324eb4){var _0x431c1a={};_0x431c1a[_0x324eb4]={'$like':'%'+_0x69185e[_0xaefd('0x30')][_0xaefd('0x3c')]+'%'};return _0x431c1a;})});}_0x4b709a=_['merge']({},_0x4b709a,_0x69185e[_0xaefd('0x3f')]);return _0x1fd0b0[_0xaefd('0x4a')](_0x4b709a);}})[_0xaefd('0x25')](function(_0x1ad04e){if(_0x1ad04e){_0x338823=_0x1ad04e[_0xaefd('0x35')];if(!_0x69185e[_0xaefd('0x30')][_0xaefd('0x36')](_0xaefd('0x37'))){_0x4b709a['limit']=qs[_0xaefd('0x1f')](_0x69185e[_0xaefd('0x30')][_0xaefd('0x1f')]);_0x4b709a[_0xaefd('0x1c')]=qs['offset'](_0x69185e[_0xaefd('0x30')]['offset']);}return _0x1fd0b0[_0xaefd('0x4a')](_0x4b709a);}})[_0xaefd('0x25')](function(_0x516913){if(_0x516913){return _0x516913?{'count':_0x338823,'rows':_0x516913}:null;}})['then'](respondWithResult(_0x27fd3f,null))[_0xaefd('0x44')](handleError(_0x27fd3f,null));};exports['addConfiguration']=function(_0x5e0068,_0x4e75bc,_0xe2397c){if(_0x5e0068[_0xaefd('0x49')]['id']){delete _0x5e0068[_0xaefd('0x49')]['id'];}return db[_0xaefd('0x40')][_0xaefd('0x4b')]({'where':{'id':_0x5e0068[_0xaefd('0x46')]['id']}})['then'](handleEntityNotFound(_0x4e75bc,null))['then'](function(_0x4f8e16){if(_0x4f8e16){_0x5e0068['body'][_0xaefd('0x4d')]=_0x4f8e16['id'];_0x5e0068['body'][_0xaefd('0x4e')]=integrations['getSubjects'](_0x5e0068[_0xaefd('0x49')][_0xaefd('0x4f')],_0x5e0068[_0xaefd('0x49')][_0xaefd('0x50')]);_0x5e0068[_0xaefd('0x49')][_0xaefd('0x51')]=integrations[_0xaefd('0x52')](_0x5e0068['body'][_0xaefd('0x4f')],_0x5e0068[_0xaefd('0x49')][_0xaefd('0x50')]);return db[_0xaefd('0x4c')]['create'](_0x5e0068[_0xaefd('0x49')],{'include':[{'model':db['ZendeskField'],'as':_0xaefd('0x4e')},{'model':db[_0xaefd('0x53')],'as':_0xaefd('0x51')}]});}return null;})[_0xaefd('0x25')](respondWithResult(_0x4e75bc,null))[_0xaefd('0x44')](handleError(_0x4e75bc,null));};exports[_0xaefd('0x54')]=function(_0x57776e,_0x1a6195,_0x3b39db){var _0x4a9fa5='';return db[_0xaefd('0x40')][_0xaefd('0x4b')]({'where':{'id':_0x57776e['params']['id']},'attributes':['id',_0xaefd('0x55'),_0xaefd('0x56'),_0xaefd('0x57'),_0xaefd('0x58'),_0xaefd('0x59')]})[_0xaefd('0x25')](handleEntityNotFound(_0x1a6195,null))[_0xaefd('0x25')](function(_0x6f99b0){if(_0x6f99b0){_0x4a9fa5=_0x6f99b0[_0xaefd('0x59')];var _0x1ec9be=_0x4a9fa5[_0xaefd('0x5a')](-0x1);if(_0x1ec9be==='/'){_0x4a9fa5=_0x4a9fa5[_0xaefd('0x5b')](0x0,_0x4a9fa5[_0xaefd('0x5c')](_0x1ec9be));}var _0x43338b={'method':_0xaefd('0x5d'),'uri':util[_0xaefd('0x5e')](_0xaefd('0x5f'),_0x4a9fa5,'ticket_fields'),'json':!![]};switch(_0x6f99b0[_0xaefd('0x58')]){case _0xaefd('0x56'):_0x43338b[_0xaefd('0x60')]={'Authorization':util['format'](_0xaefd('0x61'),new Buffer(util[_0xaefd('0x5e')](_0xaefd('0x62'),_0x6f99b0[_0xaefd('0x55')],_0x6f99b0['password']))[_0xaefd('0x63')]('base64'))};break;case _0xaefd('0x57'):_0x43338b['headers']={'Authorization':util[_0xaefd('0x5e')](_0xaefd('0x61'),new Buffer(util[_0xaefd('0x5e')]('%s/token:%s',_0x6f99b0['username'],_0x6f99b0[_0xaefd('0x57')]))[_0xaefd('0x63')](_0xaefd('0x64')))};break;default:throw new db[(_0xaefd('0x65'))][(_0xaefd('0x66'))](_0xaefd('0x67'));}return rp(_0x43338b);}})['then'](function(_0x499d7d){if(_0x499d7d){var _0x58c97c=['subject','description',_0xaefd('0x68'),_0xaefd('0x69')];_[_0xaefd('0x6a')](_0x499d7d[_0xaefd('0x6b')],function(_0x5ae635){return _0x58c97c[_0xaefd('0x6c')](_0x5ae635[_0xaefd('0x50')]);});return{'count':_0x499d7d['ticket_fields'][_0xaefd('0x35')],'rows':_['map'](_0x499d7d[_0xaefd('0x6b')],function(_0x51b6f1){return{'id':_0x51b6f1['id'],'name':_0x51b6f1[_0xaefd('0x6d')]>0x7?_0x51b6f1['title']:_0x51b6f1[_0xaefd('0x50')],'custom':_0x51b6f1['position']>0x7?!![]:![],'options':_0x51b6f1[_0xaefd('0x6e')]?_0x51b6f1[_0xaefd('0x6e')]:_0x51b6f1['custom_field_options']?_0x51b6f1[_0xaefd('0x6f')]:[]};})};}})[_0xaefd('0x25')](respondWithResult(_0x1a6195,null))[_0xaefd('0x44')](function(_0x564c89){var _0x42c55c=_0x57776e[_0xaefd('0x30')][_0xaefd('0x70')]?0x1f4:_0x564c89[_0xaefd('0x71')]||0x1f4;logger[_0xaefd('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0xaefd('0x54'),_0x42c55c,JSON[_0xaefd('0x72')](_0x564c89));delete _0x564c89['name'];if(_0x42c55c===0x191){_0x42c55c=0x190;}_0x1a6195[_0xaefd('0x19')](_0x42c55c)[_0xaefd('0x73')](_0x57776e[_0xaefd('0x30')][_0xaefd('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x564c89[_0xaefd('0x71')]}:_0x564c89);});}; \ No newline at end of file +var _0x0565=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','include','find','create','body','getConfigurations','ZendeskConfiguration','pick','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','Subjects','getFields','token','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','%s:%s','username','password','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials'];(function(_0x3ee6be,_0x810f6){var _0x3e1277=function(_0x1cf286){while(--_0x1cf286){_0x3ee6be['push'](_0x3ee6be['shift']());}};_0x3e1277(++_0x810f6);}(_0x0565,0xf2));var _0x5056=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x0565[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x5056('0x0'));var rimraf=require(_0x5056('0x1'));var zipdir=require(_0x5056('0x2'));var jsonpatch=require(_0x5056('0x3'));var rp=require(_0x5056('0x4'));var moment=require(_0x5056('0x5'));var BPromise=require(_0x5056('0x6'));var Mustache=require(_0x5056('0x7'));var util=require(_0x5056('0x8'));var path=require(_0x5056('0x9'));var sox=require('sox');var csv=require(_0x5056('0xa'));var ejs=require(_0x5056('0xb'));var fs=require('fs');var fs_extra=require(_0x5056('0xc'));var _=require(_0x5056('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5056('0xe'));var deskjs=require(_0x5056('0xf'));var toCsv=require(_0x5056('0xa'));var querystring=require(_0x5056('0x10'));var Papa=require(_0x5056('0x11'));var Redis=require(_0x5056('0x12'));var authService=require(_0x5056('0x13'));var qs=require(_0x5056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5056('0x15'));var logger=require(_0x5056('0x16'))(_0x5056('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5056('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x53e98a,_0x2d44fb){_0x2d44fb=_0x2d44fb||0xcc;return function(_0x4b183a){if(_0x4b183a){return _0x53e98a[_0x5056('0x19')](_0x2d44fb);}return _0x53e98a[_0x5056('0x1a')](_0x2d44fb)[_0x5056('0x1b')]();};}function respondWithResult(_0x543cee,_0x1e8b64){_0x1e8b64=_0x1e8b64||0xc8;return function(_0x29d05f){if(_0x29d05f){return _0x543cee[_0x5056('0x1a')](_0x1e8b64)[_0x5056('0x1c')](_0x29d05f);}};}function respondWithFilteredResult(_0x21561d,_0x6a044a){return function(_0x4ac332){if(_0x4ac332){var _0x2b7a17=typeof _0x6a044a['offset']===_0x5056('0x1d')&&typeof _0x6a044a[_0x5056('0x1e')]===_0x5056('0x1d');var _0x1f2ac6=_0x4ac332[_0x5056('0x1f')];var _0x51b21e=_0x2b7a17?0x0:_0x6a044a[_0x5056('0x20')];var _0x56537e=_0x2b7a17?_0x4ac332['count']:_0x6a044a['offset']+_0x6a044a[_0x5056('0x1e')];var _0x517bf3;if(_0x56537e>=_0x1f2ac6){_0x56537e=_0x1f2ac6;_0x517bf3=0xc8;}else{_0x517bf3=0xce;}_0x21561d[_0x5056('0x1a')](_0x517bf3);return _0x21561d[_0x5056('0x21')](_0x5056('0x22'),_0x51b21e+'-'+_0x56537e+'/'+_0x1f2ac6)[_0x5056('0x1c')](_0x4ac332);}return null;};}function patchUpdates(_0x33035c){return function(_0x4835fd){try{jsonpatch[_0x5056('0x23')](_0x4835fd,_0x33035c,!![]);}catch(_0x3cfd41){return BPromise['reject'](_0x3cfd41);}return _0x4835fd[_0x5056('0x24')]();};}function saveUpdates(_0x1bccef,_0x2564d0){return function(_0x58b16d){if(_0x58b16d){return _0x58b16d[_0x5056('0x25')](_0x1bccef)[_0x5056('0x26')](function(_0x5afbfe){return _0x5afbfe;});}return null;};}function removeEntity(_0x4a64be,_0x29e166){return function(_0x2f36a3){if(_0x2f36a3){return _0x2f36a3[_0x5056('0x27')]()[_0x5056('0x26')](function(){_0x4a64be['status'](0xcc)[_0x5056('0x1b')]();});}};}function handleEntityNotFound(_0x25409f,_0x5d1656){return function(_0x2c4290){if(!_0x2c4290){_0x25409f['sendStatus'](0x194);}return _0x2c4290;};}function handleError(_0x15f03f,_0x39d539){_0x39d539=_0x39d539||0x1f4;return function(_0x1106e5){logger[_0x5056('0x28')](_0x1106e5[_0x5056('0x29')]);if(_0x1106e5['name']){delete _0x1106e5[_0x5056('0x2a')];}_0x15f03f[_0x5056('0x1a')](_0x39d539)[_0x5056('0x2b')](_0x1106e5);};}exports[_0x5056('0x2c')]=function(_0x53e6db,_0x24d33e){var _0x5b0270={},_0x70246c={},_0x49fe67={'count':0x0,'rows':[]};var _0x56ccba=_['map'](db[_0x5056('0x2d')][_0x5056('0x2e')],function(_0x482939){return{'name':_0x482939[_0x5056('0x2f')],'type':_0x482939[_0x5056('0x30')][_0x5056('0x31')]};});_0x70246c[_0x5056('0x32')]=_[_0x5056('0x33')](_0x56ccba,_0x5056('0x2a'));_0x70246c[_0x5056('0x34')]=_[_0x5056('0x35')](_0x53e6db[_0x5056('0x34')]);_0x70246c[_0x5056('0x36')]=_[_0x5056('0x37')](_0x70246c['model'],_0x70246c['query']);_0x5b0270[_0x5056('0x38')]=_[_0x5056('0x37')](_0x70246c['model'],qs[_0x5056('0x39')](_0x53e6db[_0x5056('0x34')]['fields']));_0x5b0270[_0x5056('0x38')]=_0x5b0270[_0x5056('0x38')][_0x5056('0x3a')]?_0x5b0270[_0x5056('0x38')]:_0x70246c[_0x5056('0x32')];if(!_0x53e6db[_0x5056('0x34')][_0x5056('0x3b')](_0x5056('0x3c'))){_0x5b0270[_0x5056('0x1e')]=qs[_0x5056('0x1e')](_0x53e6db[_0x5056('0x34')][_0x5056('0x1e')]);_0x5b0270[_0x5056('0x20')]=qs[_0x5056('0x20')](_0x53e6db[_0x5056('0x34')]['offset']);}_0x5b0270[_0x5056('0x3d')]=qs['sort'](_0x53e6db[_0x5056('0x34')][_0x5056('0x3e')]);_0x5b0270[_0x5056('0x3f')]=qs[_0x5056('0x36')](_['pick'](_0x53e6db[_0x5056('0x34')],_0x70246c[_0x5056('0x36')]),_0x56ccba);if(_0x53e6db['query'][_0x5056('0x40')]){_0x5b0270['where']=_[_0x5056('0x41')](_0x5b0270[_0x5056('0x3f')],{'$or':_[_0x5056('0x33')](_0x56ccba,function(_0x502732){if(_0x502732[_0x5056('0x30')]!==_0x5056('0x42')){var _0x308133={};_0x308133[_0x502732[_0x5056('0x2a')]]={'$like':'%'+_0x53e6db[_0x5056('0x34')][_0x5056('0x40')]+'%'};return _0x308133;}})});}_0x5b0270=_[_0x5056('0x41')]({},_0x5b0270,_0x53e6db[_0x5056('0x43')]);var _0x15553e={'where':_0x5b0270[_0x5056('0x3f')]};return db[_0x5056('0x2d')][_0x5056('0x1f')](_0x15553e)[_0x5056('0x26')](function(_0x1e28f4){_0x49fe67[_0x5056('0x1f')]=_0x1e28f4;if(_0x53e6db[_0x5056('0x34')]['includeAll']){_0x5b0270['include']=[{'all':!![]}];}return db[_0x5056('0x2d')][_0x5056('0x44')](_0x5b0270);})[_0x5056('0x26')](function(_0x3a76d2){_0x49fe67[_0x5056('0x45')]=_0x3a76d2;return _0x49fe67;})[_0x5056('0x26')](respondWithFilteredResult(_0x24d33e,_0x5b0270))[_0x5056('0x46')](handleError(_0x24d33e,null));};exports[_0x5056('0x47')]=function(_0x48ab5e,_0x58f12f){var _0x68a385={'raw':![],'where':{'id':_0x48ab5e[_0x5056('0x48')]['id']}},_0x1b3a5e={};_0x1b3a5e['model']=_[_0x5056('0x35')](db['ZendeskAccount'][_0x5056('0x2e')]);_0x1b3a5e[_0x5056('0x34')]=_[_0x5056('0x35')](_0x48ab5e[_0x5056('0x34')]);_0x1b3a5e[_0x5056('0x36')]=_[_0x5056('0x37')](_0x1b3a5e['model'],_0x1b3a5e[_0x5056('0x34')]);_0x68a385[_0x5056('0x38')]=_[_0x5056('0x37')](_0x1b3a5e['model'],qs['fields'](_0x48ab5e['query']['fields']));_0x68a385[_0x5056('0x38')]=_0x68a385[_0x5056('0x38')][_0x5056('0x3a')]?_0x68a385[_0x5056('0x38')]:_0x1b3a5e[_0x5056('0x32')];if(_0x48ab5e['query']['includeAll']){_0x68a385[_0x5056('0x49')]=[{'all':!![]}];}_0x68a385=_[_0x5056('0x41')]({},_0x68a385,_0x48ab5e[_0x5056('0x43')]);return db[_0x5056('0x2d')][_0x5056('0x4a')](_0x68a385)[_0x5056('0x26')](handleEntityNotFound(_0x58f12f,null))[_0x5056('0x26')](respondWithResult(_0x58f12f,null))['catch'](handleError(_0x58f12f,null));};exports['create']=function(_0x14e3f5,_0x3c2988){return db['ZendeskAccount'][_0x5056('0x4b')](_0x14e3f5[_0x5056('0x4c')],{})['then'](respondWithResult(_0x3c2988,0xc9))['catch'](handleError(_0x3c2988,null));};exports[_0x5056('0x25')]=function(_0x1ab1a9,_0x50aa03){if(_0x1ab1a9['body']['id']){delete _0x1ab1a9[_0x5056('0x4c')]['id'];}return db[_0x5056('0x2d')]['find']({'where':{'id':_0x1ab1a9['params']['id']}})[_0x5056('0x26')](handleEntityNotFound(_0x50aa03,null))[_0x5056('0x26')](saveUpdates(_0x1ab1a9[_0x5056('0x4c')],null))[_0x5056('0x26')](respondWithResult(_0x50aa03,null))[_0x5056('0x46')](handleError(_0x50aa03,null));};exports[_0x5056('0x27')]=function(_0x97f7d8,_0x366ba2){return db[_0x5056('0x2d')][_0x5056('0x4a')]({'where':{'id':_0x97f7d8[_0x5056('0x48')]['id']}})[_0x5056('0x26')](handleEntityNotFound(_0x366ba2,null))[_0x5056('0x26')](removeEntity(_0x366ba2,null))[_0x5056('0x46')](handleError(_0x366ba2,null));};exports[_0x5056('0x4d')]=function(_0x4bf758,_0x5c1c29,_0x5bf887){var _0xb1fd25={};var _0x428701={};var _0x1c84b1;var _0x35776b;return db[_0x5056('0x2d')]['findOne']({'where':{'id':_0x4bf758[_0x5056('0x48')]['id']}})[_0x5056('0x26')](handleEntityNotFound(_0x5c1c29,null))[_0x5056('0x26')](function(_0x3d22cc){if(_0x3d22cc){_0x1c84b1=_0x3d22cc;_0x428701[_0x5056('0x32')]=_[_0x5056('0x35')](db[_0x5056('0x4e')][_0x5056('0x2e')]);_0x428701[_0x5056('0x34')]=_[_0x5056('0x35')](_0x4bf758[_0x5056('0x34')]);_0x428701[_0x5056('0x36')]=_[_0x5056('0x37')](_0x428701['model'],_0x428701[_0x5056('0x34')]);_0xb1fd25[_0x5056('0x38')]=_[_0x5056('0x37')](_0x428701['model'],qs[_0x5056('0x39')](_0x4bf758[_0x5056('0x34')][_0x5056('0x39')]));_0xb1fd25[_0x5056('0x38')]=_0xb1fd25['attributes']['length']?_0xb1fd25['attributes']:_0x428701[_0x5056('0x32')];_0xb1fd25['order']=qs[_0x5056('0x3e')](_0x4bf758[_0x5056('0x34')][_0x5056('0x3e')]);_0xb1fd25[_0x5056('0x3f')]=qs[_0x5056('0x36')](_[_0x5056('0x4f')](_0x4bf758['query'],_0x428701['filters']));if(_0x4bf758[_0x5056('0x34')][_0x5056('0x40')]){_0xb1fd25['where']=_[_0x5056('0x41')](_0xb1fd25[_0x5056('0x3f')],{'$or':_[_0x5056('0x33')](_0xb1fd25[_0x5056('0x38')],function(_0x44b75e){var _0x524308={};_0x524308[_0x44b75e]={'$like':'%'+_0x4bf758[_0x5056('0x34')][_0x5056('0x40')]+'%'};return _0x524308;})});}_0xb1fd25=_['merge']({},_0xb1fd25,_0x4bf758[_0x5056('0x43')]);return _0x1c84b1[_0x5056('0x4d')](_0xb1fd25);}})[_0x5056('0x26')](function(_0x1d59ac){if(_0x1d59ac){_0x35776b=_0x1d59ac[_0x5056('0x3a')];if(!_0x4bf758[_0x5056('0x34')][_0x5056('0x3b')](_0x5056('0x3c'))){_0xb1fd25[_0x5056('0x1e')]=qs[_0x5056('0x1e')](_0x4bf758[_0x5056('0x34')][_0x5056('0x1e')]);_0xb1fd25[_0x5056('0x20')]=qs['offset'](_0x4bf758[_0x5056('0x34')][_0x5056('0x20')]);}return _0x1c84b1[_0x5056('0x4d')](_0xb1fd25);}})[_0x5056('0x26')](function(_0x267ba4){if(_0x267ba4){return _0x267ba4?{'count':_0x35776b,'rows':_0x267ba4}:null;}})[_0x5056('0x26')](respondWithResult(_0x5c1c29,null))['catch'](handleError(_0x5c1c29,null));};exports[_0x5056('0x50')]=function(_0x4e343e,_0x1c3684,_0x277939){if(_0x4e343e['body']['id']){delete _0x4e343e['body']['id'];}return db[_0x5056('0x2d')][_0x5056('0x51')]({'where':{'id':_0x4e343e[_0x5056('0x48')]['id']}})[_0x5056('0x26')](handleEntityNotFound(_0x1c3684,null))['then'](function(_0x521384){if(_0x521384){_0x4e343e[_0x5056('0x4c')][_0x5056('0x52')]=_0x521384['id'];_0x4e343e[_0x5056('0x4c')]['Subjects']=integrations[_0x5056('0x53')](_0x4e343e['body'][_0x5056('0x54')],_0x4e343e[_0x5056('0x4c')][_0x5056('0x30')]);_0x4e343e['body'][_0x5056('0x55')]=integrations[_0x5056('0x56')](_0x4e343e[_0x5056('0x4c')][_0x5056('0x54')],_0x4e343e[_0x5056('0x4c')][_0x5056('0x30')]);return db[_0x5056('0x4e')]['create'](_0x4e343e[_0x5056('0x4c')],{'include':[{'model':db[_0x5056('0x57')],'as':_0x5056('0x58')},{'model':db['ZendeskField'],'as':_0x5056('0x55')}]});}return null;})['then'](respondWithResult(_0x1c3684,null))[_0x5056('0x46')](handleError(_0x1c3684,null));};exports[_0x5056('0x59')]=function(_0x3c7d5c,_0x45eac9,_0x5639a1){var _0x2a856c='';return db[_0x5056('0x2d')]['findOne']({'where':{'id':_0x3c7d5c[_0x5056('0x48')]['id']},'attributes':['id','username','password',_0x5056('0x5a'),_0x5056('0x5b'),_0x5056('0x5c')]})[_0x5056('0x26')](handleEntityNotFound(_0x45eac9,null))[_0x5056('0x26')](function(_0x88270d){if(_0x88270d){_0x2a856c=_0x88270d[_0x5056('0x5c')];var _0x3aa15f=_0x2a856c[_0x5056('0x5d')](-0x1);if(_0x3aa15f==='/'){_0x2a856c=_0x2a856c[_0x5056('0x5e')](0x0,_0x2a856c[_0x5056('0x5f')](_0x3aa15f));}var _0x153143={'method':'GET','uri':util[_0x5056('0x60')]('%s/%s',_0x2a856c,_0x5056('0x61')),'json':!![]};switch(_0x88270d[_0x5056('0x5b')]){case'password':_0x153143[_0x5056('0x62')]={'Authorization':util[_0x5056('0x60')](_0x5056('0x63'),new Buffer(util[_0x5056('0x60')](_0x5056('0x64'),_0x88270d[_0x5056('0x65')],_0x88270d[_0x5056('0x66')]))[_0x5056('0x67')]('base64'))};break;case _0x5056('0x5a'):_0x153143[_0x5056('0x62')]={'Authorization':util[_0x5056('0x60')](_0x5056('0x63'),new Buffer(util[_0x5056('0x60')]('%s/token:%s',_0x88270d[_0x5056('0x65')],_0x88270d['token']))[_0x5056('0x67')](_0x5056('0x68')))};break;default:throw new db[(_0x5056('0x69'))][(_0x5056('0x6a'))](_0x5056('0x6b'));}return rp(_0x153143);}})[_0x5056('0x26')](function(_0x2be789){if(_0x2be789){var _0x5f41de=[_0x5056('0x6c'),_0x5056('0x6d'),_0x5056('0x6e'),_0x5056('0x6f')];_[_0x5056('0x70')](_0x2be789[_0x5056('0x61')],function(_0x3f34b6){return _0x5f41de['includes'](_0x3f34b6['type']);});return{'count':_0x2be789['ticket_fields'][_0x5056('0x3a')],'rows':_['map'](_0x2be789[_0x5056('0x61')],function(_0x43d241){return{'id':_0x43d241['id'],'name':_0x43d241[_0x5056('0x71')]>0x7?_0x43d241['title']:_0x43d241[_0x5056('0x30')],'custom':_0x43d241['position']>0x7?!![]:![],'options':_0x43d241[_0x5056('0x72')]?_0x43d241[_0x5056('0x72')]:_0x43d241[_0x5056('0x73')]?_0x43d241['custom_field_options']:[]};})};}})[_0x5056('0x26')](respondWithResult(_0x45eac9,null))['catch'](function(_0x54b0ba){var _0x2ed978=_0x3c7d5c[_0x5056('0x34')]['test']?0x1f4:_0x54b0ba[_0x5056('0x74')]||0x1f4;logger['error'](_0x5056('0x75'),_0x5056('0x59'),_0x2ed978,JSON[_0x5056('0x76')](_0x54b0ba));delete _0x54b0ba[_0x5056('0x2a')];if(_0x2ed978===0x191){_0x2ed978=0x190;}_0x45eac9[_0x5056('0x1a')](_0x2ed978)[_0x5056('0x2b')](_0x3c7d5c['query'][_0x5056('0x77')]?{'message':_0x5056('0x78'),'statusCode':_0x54b0ba[_0x5056('0x74')]}:_0x54b0ba);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 0553cef..92fddc9 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 _0x0399=['path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','int_zendesk_accounts','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x67b97a,_0x503a86){var _0x1c50b2=function(_0x1f76d7){while(--_0x1f76d7){_0x67b97a['push'](_0x67b97a['shift']());}};_0x1c50b2(++_0x503a86);}(_0x0399,0x97));var _0x9039=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0399[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x9039('0x0'));var util=require('util');var logger=require(_0x9039('0x1'))(_0x9039('0x2'));var moment=require('moment');var BPromise=require(_0x9039('0x3'));var rp=require(_0x9039('0x4'));var fs=require('fs');var path=require(_0x9039('0x5'));var rimraf=require(_0x9039('0x6'));var config=require(_0x9039('0x7'));var attributes=require(_0x9039('0x8'));var integrations=require(_0x9039('0x9'));module[_0x9039('0xa')]=function(_0x21c2a3,_0x2ca415){return _0x21c2a3['define']('ZendeskAccount',attributes,{'tableName':_0x9039('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa31a=['./intZendeskAccount.attributes','exports','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x166acc,_0x111e4e){var _0x209f4d=function(_0x354b62){while(--_0x354b62){_0x166acc['push'](_0x166acc['shift']());}};_0x209f4d(++_0x111e4e);}(_0xa31a,0xe8));var _0xaa31=function(_0xfcfa7,_0x1b621b){_0xfcfa7=_0xfcfa7-0x0;var _0x2c1786=_0xa31a[_0xfcfa7];return _0x2c1786;};'use strict';var _=require(_0xaa31('0x0'));var util=require('util');var logger=require(_0xaa31('0x1'))(_0xaa31('0x2'));var moment=require(_0xaa31('0x3'));var BPromise=require(_0xaa31('0x4'));var rp=require(_0xaa31('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa31('0x6'));var config=require(_0xaa31('0x7'));var attributes=require(_0xaa31('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xaa31('0x9')]=function(_0x24d836,_0xa03776){return _0x24d836['define'](_0xaa31('0xa'),attributes,{'tableName':_0xaa31('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index b6951b3..923bafd 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 _0x37a5=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','GetZendeskAccount','findAll','options','map','include','model','attributes','then','catch','ShowZendeskAccount','ZendeskAccount','find','raw','where','lodash'];(function(_0x165359,_0x33a684){var _0xccb6d4=function(_0x36fc80){while(--_0x36fc80){_0x165359['push'](_0x165359['shift']());}};_0xccb6d4(++_0x33a684);}(_0x37a5,0x107));var _0x537a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x37a5[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0x537a('0x0'));var util=require(_0x537a('0x1'));var moment=require('moment');var BPromise=require(_0x537a('0x2'));var rs=require(_0x537a('0x3'));var fs=require('fs');var Redis=require(_0x537a('0x4'));var db=require(_0x537a('0x5'))['db'];var utils=require(_0x537a('0x6'));var logger=require(_0x537a('0x7'))(_0x537a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x537a('0x9')][_0x537a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x158608,_0x1ddd9d,_0x50d48c){return new BPromise(function(_0x539908,_0x4396b7){return client['request'](_0x158608,_0x50d48c)['then'](function(_0x46e190){logger[_0x537a('0xb')](_0x537a('0xc'),_0x1ddd9d,'request\x20sent');logger[_0x537a('0xd')](_0x537a('0xe'),_0x1ddd9d,_0x537a('0xf'),JSON[_0x537a('0x10')](_0x46e190));if(_0x46e190[_0x537a('0x11')]){if(_0x46e190['error']['code']===0x1f4){logger['error'](_0x537a('0xc'),_0x1ddd9d,_0x46e190['error']['message']);return _0x4396b7(_0x46e190[_0x537a('0x11')]['message']);}logger[_0x537a('0x11')](_0x537a('0xc'),_0x1ddd9d,_0x46e190[_0x537a('0x11')][_0x537a('0x12')]);return _0x539908(_0x46e190['error'][_0x537a('0x12')]);}else{logger['info'](_0x537a('0xc'),_0x1ddd9d,_0x537a('0xf'));_0x539908(_0x46e190['result'][_0x537a('0x12')]);}})['catch'](function(_0x53d3b7){logger[_0x537a('0x11')](_0x537a('0xc'),_0x1ddd9d,_0x53d3b7);_0x4396b7(_0x53d3b7);});});}exports[_0x537a('0x13')]=function(_0x38dc77){var _0x1ff490=this;return new Promise(function(_0x104bd5,_0x3e1e09){return db['ZendeskAccount'][_0x537a('0x14')]({'raw':_0x38dc77[_0x537a('0x15')]?_0x38dc77[_0x537a('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x38dc77[_0x537a('0x15')]?_0x38dc77[_0x537a('0x15')]['where']||null:null,'attributes':_0x38dc77['options']?_0x38dc77['options']['attributes']||null:null,'limit':_0x38dc77['options']?_0x38dc77[_0x537a('0x15')]['limit']||null:null,'include':_0x38dc77[_0x537a('0x15')]?_0x38dc77[_0x537a('0x15')]['include']?_[_0x537a('0x16')](_0x38dc77[_0x537a('0x15')][_0x537a('0x17')],function(_0x262f86){return{'model':db[_0x262f86[_0x537a('0x18')]],'as':_0x262f86['as'],'attributes':_0x262f86[_0x537a('0x19')],'include':_0x262f86[_0x537a('0x17')]?_['map'](_0x262f86[_0x537a('0x17')],function(_0x387396){return{'model':db[_0x387396[_0x537a('0x18')]],'as':_0x387396['as'],'attributes':_0x387396[_0x537a('0x19')],'include':_0x387396[_0x537a('0x17')]?_['map'](_0x387396['include'],function(_0xba0650){return{'model':db[_0xba0650[_0x537a('0x18')]],'as':_0xba0650['as'],'attributes':_0xba0650['attributes']};}):[]};}):[]};}):[]:[]})[_0x537a('0x1a')](function(_0x172f5b){logger[_0x537a('0xb')](_0x537a('0x13'),_0x38dc77);logger[_0x537a('0xd')](_0x537a('0x13'),_0x38dc77,JSON[_0x537a('0x10')](_0x172f5b));_0x104bd5(_0x172f5b);})[_0x537a('0x1b')](function(_0x1a23f5){logger[_0x537a('0x11')](_0x537a('0x13'),_0x1a23f5['message'],_0x38dc77);_0x3e1e09(_0x1ff490['error'](0x1f4,_0x1a23f5[_0x537a('0x12')]));});});};exports[_0x537a('0x1c')]=function(_0x5be5aa){var _0x164994=this;return new Promise(function(_0x12c959,_0x3d73fe){return db[_0x537a('0x1d')][_0x537a('0x1e')]({'raw':_0x5be5aa[_0x537a('0x15')]?_0x5be5aa[_0x537a('0x15')][_0x537a('0x1f')]===undefined?!![]:![]:!![],'where':_0x5be5aa[_0x537a('0x15')]?_0x5be5aa[_0x537a('0x15')][_0x537a('0x20')]||null:null,'attributes':_0x5be5aa[_0x537a('0x15')]?_0x5be5aa[_0x537a('0x15')][_0x537a('0x19')]||null:null,'include':_0x5be5aa[_0x537a('0x15')]?_0x5be5aa['options'][_0x537a('0x17')]?_[_0x537a('0x16')](_0x5be5aa[_0x537a('0x15')][_0x537a('0x17')],function(_0x5225e7){return{'model':db[_0x5225e7[_0x537a('0x18')]],'as':_0x5225e7['as'],'attributes':_0x5225e7[_0x537a('0x19')],'include':_0x5225e7[_0x537a('0x17')]?_[_0x537a('0x16')](_0x5225e7[_0x537a('0x17')],function(_0x28aa40){return{'model':db[_0x28aa40['model']],'as':_0x28aa40['as'],'attributes':_0x28aa40[_0x537a('0x19')],'include':_0x28aa40[_0x537a('0x17')]?_[_0x537a('0x16')](_0x28aa40[_0x537a('0x17')],function(_0x42fbb4){return{'model':db[_0x42fbb4[_0x537a('0x18')]],'as':_0x42fbb4['as'],'attributes':_0x42fbb4[_0x537a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2de105){logger['info'](_0x537a('0x1c'),_0x5be5aa);logger[_0x537a('0xd')]('ShowZendeskAccount',_0x5be5aa,JSON['stringify'](_0x2de105));_0x12c959(_0x2de105);})[_0x537a('0x1b')](function(_0x1ee887){logger[_0x537a('0x11')](_0x537a('0x1c'),_0x1ee887[_0x537a('0x12')],_0x5be5aa);_0x3d73fe(_0x164994[_0x537a('0x11')](0x1f4,_0x1ee887[_0x537a('0x12')]));});});}; \ No newline at end of file +var _0x4b69=['map','stringify','ShowZendeskAccount','find','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','model'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x4b69,0xb8));var _0x94b6=function(_0x4d865f,_0xb6abcd){_0x4d865f=_0x4d865f-0x0;var _0x11ad6c=_0x4b69[_0x4d865f];return _0x11ad6c;};'use strict';var _=require(_0x94b6('0x0'));var util=require('util');var moment=require(_0x94b6('0x1'));var BPromise=require(_0x94b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94b6('0x3'))['db'];var utils=require(_0x94b6('0x4'));var logger=require(_0x94b6('0x5'))(_0x94b6('0x6'));var config=require(_0x94b6('0x7'));var jayson=require(_0x94b6('0x8'));var client=jayson[_0x94b6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29bf80,_0x56206a,_0x5c3dd7){return new BPromise(function(_0x3c48b5,_0x3bbd1c){return client[_0x94b6('0xa')](_0x29bf80,_0x5c3dd7)[_0x94b6('0xb')](function(_0x7f0f3d){logger[_0x94b6('0xc')](_0x94b6('0xd'),_0x56206a,_0x94b6('0xe'));logger[_0x94b6('0xf')](_0x94b6('0x10'),_0x56206a,_0x94b6('0xe'),JSON['stringify'](_0x7f0f3d));if(_0x7f0f3d[_0x94b6('0x11')]){if(_0x7f0f3d[_0x94b6('0x11')][_0x94b6('0x12')]===0x1f4){logger['error'](_0x94b6('0xd'),_0x56206a,_0x7f0f3d[_0x94b6('0x11')]['message']);return _0x3bbd1c(_0x7f0f3d[_0x94b6('0x11')]['message']);}logger[_0x94b6('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x56206a,_0x7f0f3d[_0x94b6('0x11')][_0x94b6('0x13')]);return _0x3c48b5(_0x7f0f3d[_0x94b6('0x11')][_0x94b6('0x13')]);}else{logger['info'](_0x94b6('0xd'),_0x56206a,_0x94b6('0xe'));_0x3c48b5(_0x7f0f3d[_0x94b6('0x14')][_0x94b6('0x13')]);}})[_0x94b6('0x15')](function(_0xb8390){logger[_0x94b6('0x11')](_0x94b6('0xd'),_0x56206a,_0xb8390);_0x3bbd1c(_0xb8390);});});}exports[_0x94b6('0x16')]=function(_0x11385f){var _0x22326e=this;return new Promise(function(_0x41bbef,_0x36a98c){return db[_0x94b6('0x17')][_0x94b6('0x18')]({'raw':_0x11385f[_0x94b6('0x19')]?_0x11385f[_0x94b6('0x19')][_0x94b6('0x1a')]===undefined?!![]:![]:!![],'where':_0x11385f[_0x94b6('0x19')]?_0x11385f[_0x94b6('0x19')][_0x94b6('0x1b')]||null:null,'attributes':_0x11385f[_0x94b6('0x19')]?_0x11385f[_0x94b6('0x19')][_0x94b6('0x1c')]||null:null,'limit':_0x11385f[_0x94b6('0x19')]?_0x11385f[_0x94b6('0x19')][_0x94b6('0x1d')]||null:null,'include':_0x11385f[_0x94b6('0x19')]?_0x11385f['options'][_0x94b6('0x1e')]?_['map'](_0x11385f[_0x94b6('0x19')][_0x94b6('0x1e')],function(_0xf25c1e){return{'model':db[_0xf25c1e[_0x94b6('0x1f')]],'as':_0xf25c1e['as'],'attributes':_0xf25c1e[_0x94b6('0x1c')],'include':_0xf25c1e[_0x94b6('0x1e')]?_[_0x94b6('0x20')](_0xf25c1e['include'],function(_0x484eb6){return{'model':db[_0x484eb6[_0x94b6('0x1f')]],'as':_0x484eb6['as'],'attributes':_0x484eb6[_0x94b6('0x1c')],'include':_0x484eb6[_0x94b6('0x1e')]?_[_0x94b6('0x20')](_0x484eb6[_0x94b6('0x1e')],function(_0x4c7c7c){return{'model':db[_0x4c7c7c[_0x94b6('0x1f')]],'as':_0x4c7c7c['as'],'attributes':_0x4c7c7c[_0x94b6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x94b6('0xb')](function(_0x13d2a0){logger[_0x94b6('0xc')](_0x94b6('0x16'),_0x11385f);logger[_0x94b6('0xf')](_0x94b6('0x16'),_0x11385f,JSON[_0x94b6('0x21')](_0x13d2a0));_0x41bbef(_0x13d2a0);})['catch'](function(_0x2ae0ea){logger[_0x94b6('0x11')](_0x94b6('0x16'),_0x2ae0ea[_0x94b6('0x13')],_0x11385f);_0x36a98c(_0x22326e['error'](0x1f4,_0x2ae0ea[_0x94b6('0x13')]));});});};exports[_0x94b6('0x22')]=function(_0x6e7eb7){var _0x38acbe=this;return new Promise(function(_0x291bc7,_0x34cec5){return db[_0x94b6('0x17')][_0x94b6('0x23')]({'raw':_0x6e7eb7['options']?_0x6e7eb7[_0x94b6('0x19')][_0x94b6('0x1a')]===undefined?!![]:![]:!![],'where':_0x6e7eb7[_0x94b6('0x19')]?_0x6e7eb7[_0x94b6('0x19')][_0x94b6('0x1b')]||null:null,'attributes':_0x6e7eb7[_0x94b6('0x19')]?_0x6e7eb7[_0x94b6('0x19')]['attributes']||null:null,'include':_0x6e7eb7[_0x94b6('0x19')]?_0x6e7eb7[_0x94b6('0x19')]['include']?_[_0x94b6('0x20')](_0x6e7eb7['options'][_0x94b6('0x1e')],function(_0x2d60bc){return{'model':db[_0x2d60bc[_0x94b6('0x1f')]],'as':_0x2d60bc['as'],'attributes':_0x2d60bc[_0x94b6('0x1c')],'include':_0x2d60bc[_0x94b6('0x1e')]?_[_0x94b6('0x20')](_0x2d60bc[_0x94b6('0x1e')],function(_0x24f711){return{'model':db[_0x24f711['model']],'as':_0x24f711['as'],'attributes':_0x24f711[_0x94b6('0x1c')],'include':_0x24f711['include']?_[_0x94b6('0x20')](_0x24f711[_0x94b6('0x1e')],function(_0x4202e0){return{'model':db[_0x4202e0[_0x94b6('0x1f')]],'as':_0x4202e0['as'],'attributes':_0x4202e0[_0x94b6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x452c74){logger[_0x94b6('0xc')](_0x94b6('0x22'),_0x6e7eb7);logger['debug'](_0x94b6('0x22'),_0x6e7eb7,JSON[_0x94b6('0x21')](_0x452c74));_0x291bc7(_0x452c74);})[_0x94b6('0x15')](function(_0x8511f1){logger['error']('ShowZendeskAccount',_0x8511f1[_0x94b6('0x13')],_0x6e7eb7);_0x34cec5(_0x38acbe[_0x94b6('0x11')](0x1f4,_0x8511f1[_0x94b6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 2aa83db..9af44dd 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 _0x4483=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects'];(function(_0x4f4c11,_0xdb6add){var _0x4dfd33=function(_0x163cfe){while(--_0x163cfe){_0x4f4c11['push'](_0x4f4c11['shift']());}};_0x4dfd33(++_0xdb6add);}(_0x4483,0x1a3));var _0x3448=function(_0xfb9ab3,_0x4c6305){_0xfb9ab3=_0xfb9ab3-0x0;var _0x4fd663=_0x4483[_0xfb9ab3];return _0x4fd663;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/fields',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3448('0x13')]);router[_0x3448('0x14')]('/',auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x14')](_0x3448('0x16'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);router[_0x3448('0x18')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x19')]);router[_0x3448('0x1a')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x1b')]);module[_0x3448('0x1c')]=router; \ No newline at end of file +var _0x5eb8=['getTags','post','/:id/tags','setTags','put','update','destroy','exports','path','connect-timeout','express','Router','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','getDescriptions'];(function(_0x16051a,_0x57a1df){var _0x54bd15=function(_0x1ea0d9){while(--_0x1ea0d9){_0x16051a['push'](_0x16051a['shift']());}};_0x54bd15(++_0x57a1df);}(_0x5eb8,0xb0));var _0x85eb=function(_0x22205c,_0x473493){_0x22205c=_0x22205c-0x0;var _0x3f5efe=_0x5eb8[_0x22205c];return _0x3f5efe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x9')](_0x85eb('0x12'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x9')]('/:id/tags',auth[_0x85eb('0xa')](),controller[_0x85eb('0x14')]);router[_0x85eb('0x15')]('/',auth[_0x85eb('0xa')](),controller['create']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),controller[_0x85eb('0x17')]);router[_0x85eb('0x18')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x19')]);router['delete'](_0x85eb('0xc'),auth['isAuthenticated'](),controller[_0x85eb('0x1a')]);module[_0x85eb('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 8c1b049..2725b3d 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 _0x3a76=['STRING','sequelize'];(function(_0x3a5e3a,_0x55f194){var _0x3a6d39=function(_0x32ec72){while(--_0x32ec72){_0x3a5e3a['push'](_0x3a5e3a['shift']());}};_0x3a6d39(++_0x55f194);}(_0x3a76,0x183));var _0x63a7=function(_0x53ec6f,_0x30c3b7){_0x53ec6f=_0x53ec6f-0x0;var _0x310e60=_0x3a76[_0x53ec6f];return _0x310e60;};'use strict';var Sequelize=require(_0x63a7('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x63a7('0x1')]}}; \ No newline at end of file +var _0x79e4=['exports','STRING','sequelize'];(function(_0x34e386,_0x4aa7b5){var _0x1de185=function(_0x3b547b){while(--_0x3b547b){_0x34e386['push'](_0x34e386['shift']());}};_0x1de185(++_0x4aa7b5);}(_0x79e4,0xa1));var _0x479e=function(_0x4a4fef,_0xda38af){_0x4a4fef=_0x4a4fef-0x0;var _0x1fd208=_0x79e4[_0x4a4fef];return _0x1fd208;};'use strict';var Sequelize=require(_0x479e('0x0'));module[_0x479e('0x1')]={'name':{'type':Sequelize[_0x479e('0x2')]},'description':{'type':Sequelize[_0x479e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 2367c76..088405c 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 _0x262d=['end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','rows','catch','show','params','options','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','Tag','getTags','setTags','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x33f1e2,_0x2111bb){var _0x581421=function(_0x3a2628){while(--_0x3a2628){_0x33f1e2['push'](_0x33f1e2['shift']());}};_0x581421(++_0x2111bb);}(_0x262d,0x188));var _0xd262=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x262d[_0x1e7b16];return _0x37fadc;};'use strict';var emlformat=require(_0xd262('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd262('0x1'));var jsonpatch=require(_0xd262('0x2'));var rp=require(_0xd262('0x3'));var moment=require(_0xd262('0x4'));var BPromise=require(_0xd262('0x5'));var Mustache=require('mustache');var util=require(_0xd262('0x6'));var path=require(_0xd262('0x7'));var sox=require(_0xd262('0x8'));var csv=require(_0xd262('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd262('0xa'));var _=require(_0xd262('0xb'));var squel=require(_0xd262('0xc'));var crypto=require(_0xd262('0xd'));var jsforce=require(_0xd262('0xe'));var deskjs=require(_0xd262('0xf'));var toCsv=require(_0xd262('0x9'));var querystring=require(_0xd262('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd262('0x11'));var qs=require(_0xd262('0x12'));var as=require(_0xd262('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd262('0x14'))(_0xd262('0x15'));var utils=require(_0xd262('0x16'));var config=require(_0xd262('0x17'));var licenseUtil=require(_0xd262('0x18'));var db=require(_0xd262('0x19'))['db'];function respondWithStatusCode(_0x12069e,_0x2bc7da){_0x2bc7da=_0x2bc7da||0xcc;return function(_0x48617e){if(_0x48617e){return _0x12069e[_0xd262('0x1a')](_0x2bc7da);}return _0x12069e[_0xd262('0x1b')](_0x2bc7da)[_0xd262('0x1c')]();};}function respondWithResult(_0x33b4cc,_0x4ab450){_0x4ab450=_0x4ab450||0xc8;return function(_0x430f2b){if(_0x430f2b){return _0x33b4cc['status'](_0x4ab450)[_0xd262('0x1d')](_0x430f2b);}};}function respondWithFilteredResult(_0x3d20ae,_0x4623e5){return function(_0x443f27){if(_0x443f27){var _0x1ed260=typeof _0x4623e5[_0xd262('0x1e')]===_0xd262('0x1f')&&typeof _0x4623e5[_0xd262('0x20')]===_0xd262('0x1f');var _0x5dc57b=_0x443f27['count'];var _0xfc1474=_0x1ed260?0x0:_0x4623e5[_0xd262('0x1e')];var _0x31377e=_0x1ed260?_0x443f27[_0xd262('0x21')]:_0x4623e5[_0xd262('0x1e')]+_0x4623e5[_0xd262('0x20')];var _0x1b295d;if(_0x31377e>=_0x5dc57b){_0x31377e=_0x5dc57b;_0x1b295d=0xc8;}else{_0x1b295d=0xce;}_0x3d20ae[_0xd262('0x1b')](_0x1b295d);return _0x3d20ae[_0xd262('0x22')]('Content-Range',_0xfc1474+'-'+_0x31377e+'/'+_0x5dc57b)[_0xd262('0x1d')](_0x443f27);}return null;};}function patchUpdates(_0x3993a6){return function(_0x44659b){try{jsonpatch[_0xd262('0x23')](_0x44659b,_0x3993a6,!![]);}catch(_0x3167a8){return BPromise[_0xd262('0x24')](_0x3167a8);}return _0x44659b[_0xd262('0x25')]();};}function saveUpdates(_0x29fdbf,_0x474d83){return function(_0x1724cb){if(_0x1724cb){return _0x1724cb[_0xd262('0x26')](_0x29fdbf)[_0xd262('0x27')](function(_0xaf4c24){return _0xaf4c24;});}return null;};}function removeEntity(_0x205c36,_0x222025){return function(_0x5b79f3){if(_0x5b79f3){return _0x5b79f3[_0xd262('0x28')]()[_0xd262('0x27')](function(){_0x205c36['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38c59d,_0x844774){return function(_0x378260){if(!_0x378260){_0x38c59d['sendStatus'](0x194);}return _0x378260;};}function handleError(_0x355558,_0x5962a1){_0x5962a1=_0x5962a1||0x1f4;return function(_0x3f6c71){logger['error'](_0x3f6c71[_0xd262('0x29')]);if(_0x3f6c71[_0xd262('0x2a')]){delete _0x3f6c71[_0xd262('0x2a')];}_0x355558[_0xd262('0x1b')](_0x5962a1)[_0xd262('0x2b')](_0x3f6c71);};}exports[_0xd262('0x2c')]=function(_0x1dcd97,_0x3270b3){var _0x559d0d={},_0x1a0599={},_0x32ed66={'count':0x0,'rows':[]};var _0x30ecad=_[_0xd262('0x2d')](db[_0xd262('0x2e')][_0xd262('0x2f')],function(_0x128ff6){return{'name':_0x128ff6['fieldName'],'type':_0x128ff6[_0xd262('0x30')][_0xd262('0x31')]};});_0x1a0599[_0xd262('0x32')]=_[_0xd262('0x2d')](_0x30ecad,_0xd262('0x2a'));_0x1a0599[_0xd262('0x33')]=_[_0xd262('0x34')](_0x1dcd97[_0xd262('0x33')]);_0x1a0599['filters']=_[_0xd262('0x35')](_0x1a0599[_0xd262('0x32')],_0x1a0599[_0xd262('0x33')]);_0x559d0d[_0xd262('0x36')]=_[_0xd262('0x35')](_0x1a0599[_0xd262('0x32')],qs['fields'](_0x1dcd97[_0xd262('0x33')][_0xd262('0x37')]));_0x559d0d[_0xd262('0x36')]=_0x559d0d[_0xd262('0x36')][_0xd262('0x38')]?_0x559d0d[_0xd262('0x36')]:_0x1a0599['model'];if(!_0x1dcd97[_0xd262('0x33')][_0xd262('0x39')](_0xd262('0x3a'))){_0x559d0d['limit']=qs['limit'](_0x1dcd97[_0xd262('0x33')][_0xd262('0x20')]);_0x559d0d[_0xd262('0x1e')]=qs[_0xd262('0x1e')](_0x1dcd97[_0xd262('0x33')][_0xd262('0x1e')]);}_0x559d0d[_0xd262('0x3b')]=qs['sort'](_0x1dcd97[_0xd262('0x33')][_0xd262('0x3c')]);_0x559d0d[_0xd262('0x3d')]=qs[_0xd262('0x3e')](_[_0xd262('0x3f')](_0x1dcd97[_0xd262('0x33')],_0x1a0599['filters']),_0x30ecad);if(_0x1dcd97[_0xd262('0x33')][_0xd262('0x40')]){_0x559d0d[_0xd262('0x3d')]=_[_0xd262('0x41')](_0x559d0d[_0xd262('0x3d')],{'$or':_[_0xd262('0x2d')](_0x30ecad,function(_0x5c2cc8){if(_0x5c2cc8[_0xd262('0x30')]!=='VIRTUAL'){var _0x5a7cee={};_0x5a7cee[_0x5c2cc8[_0xd262('0x2a')]]={'$like':'%'+_0x1dcd97[_0xd262('0x33')][_0xd262('0x40')]+'%'};return _0x5a7cee;}})});}_0x559d0d=_[_0xd262('0x41')]({},_0x559d0d,_0x1dcd97['options']);var _0x4636f4={'where':_0x559d0d[_0xd262('0x3d')]};return db[_0xd262('0x2e')][_0xd262('0x21')](_0x4636f4)[_0xd262('0x27')](function(_0x3e5229){_0x32ed66[_0xd262('0x21')]=_0x3e5229;if(_0x1dcd97['query'][_0xd262('0x42')]){_0x559d0d[_0xd262('0x43')]=[{'all':!![]}];}return db[_0xd262('0x2e')]['findAll'](_0x559d0d);})[_0xd262('0x27')](function(_0x328f10){_0x32ed66[_0xd262('0x44')]=_0x328f10;return _0x32ed66;})[_0xd262('0x27')](respondWithFilteredResult(_0x3270b3,_0x559d0d))[_0xd262('0x45')](handleError(_0x3270b3,null));};exports[_0xd262('0x46')]=function(_0x4aa936,_0x3bf983){var _0x3c0072={'raw':![],'where':{'id':_0x4aa936[_0xd262('0x47')]['id']}},_0x3a184a={};_0x3a184a[_0xd262('0x32')]=_[_0xd262('0x34')](db[_0xd262('0x2e')][_0xd262('0x2f')]);_0x3a184a[_0xd262('0x33')]=_[_0xd262('0x34')](_0x4aa936[_0xd262('0x33')]);_0x3a184a[_0xd262('0x3e')]=_[_0xd262('0x35')](_0x3a184a['model'],_0x3a184a[_0xd262('0x33')]);_0x3c0072[_0xd262('0x36')]=_[_0xd262('0x35')](_0x3a184a[_0xd262('0x32')],qs[_0xd262('0x37')](_0x4aa936['query']['fields']));_0x3c0072[_0xd262('0x36')]=_0x3c0072[_0xd262('0x36')]['length']?_0x3c0072[_0xd262('0x36')]:_0x3a184a[_0xd262('0x32')];if(_0x4aa936['query']['includeAll']){_0x3c0072[_0xd262('0x43')]=[{'all':!![]}];}_0x3c0072=_[_0xd262('0x41')]({},_0x3c0072,_0x4aa936[_0xd262('0x48')]);return db[_0xd262('0x2e')][_0xd262('0x49')](_0x3c0072)[_0xd262('0x27')](handleEntityNotFound(_0x3bf983,null))[_0xd262('0x27')](respondWithResult(_0x3bf983,null))['catch'](handleError(_0x3bf983,null));};exports[_0xd262('0x4a')]=function(_0xec09fc,_0x15f061){return db[_0xd262('0x2e')][_0xd262('0x4a')](_0xec09fc['body'],{})['then'](respondWithResult(_0x15f061,0xc9))[_0xd262('0x45')](handleError(_0x15f061,null));};exports['update']=function(_0x46437b,_0x2d100c){if(_0x46437b['body']['id']){delete _0x46437b[_0xd262('0x4b')]['id'];}return db[_0xd262('0x2e')]['find']({'where':{'id':_0x46437b[_0xd262('0x47')]['id']}})['then'](handleEntityNotFound(_0x2d100c,null))['then'](saveUpdates(_0x46437b[_0xd262('0x4b')],null))[_0xd262('0x27')](respondWithResult(_0x2d100c,null))['catch'](handleError(_0x2d100c,null));};exports[_0xd262('0x28')]=function(_0xcc18f4,_0x174e55){return db[_0xd262('0x2e')][_0xd262('0x49')]({'where':{'id':_0xcc18f4[_0xd262('0x47')]['id']}})[_0xd262('0x27')](handleEntityNotFound(_0x174e55,null))[_0xd262('0x27')](removeEntity(_0x174e55,null))['catch'](handleError(_0x174e55,null));};exports[_0xd262('0x4c')]=function(_0x52ac93,_0x413347,_0x1201c3){var _0x364e15={};var _0xfec767={};var _0x5397ac;var _0x1655d1;return db[_0xd262('0x2e')][_0xd262('0x4d')]({'where':{'id':_0x52ac93['params']['id']}})[_0xd262('0x27')](handleEntityNotFound(_0x413347,null))[_0xd262('0x27')](function(_0x5def9f){if(_0x5def9f){_0x5397ac=_0x5def9f;_0xfec767[_0xd262('0x32')]=_[_0xd262('0x34')](db[_0xd262('0x4e')]['rawAttributes']);_0xfec767[_0xd262('0x33')]=_[_0xd262('0x34')](_0x52ac93['query']);_0xfec767[_0xd262('0x3e')]=_[_0xd262('0x35')](_0xfec767[_0xd262('0x32')],_0xfec767[_0xd262('0x33')]);_0x364e15[_0xd262('0x36')]=_['intersection'](_0xfec767[_0xd262('0x32')],qs['fields'](_0x52ac93[_0xd262('0x33')][_0xd262('0x37')]));_0x364e15['attributes']=_0x364e15[_0xd262('0x36')][_0xd262('0x38')]?_0x364e15[_0xd262('0x36')]:_0xfec767[_0xd262('0x32')];_0x364e15[_0xd262('0x3b')]=qs[_0xd262('0x3c')](_0x52ac93[_0xd262('0x33')][_0xd262('0x3c')]);_0x364e15['where']=qs[_0xd262('0x3e')](_['pick'](_0x52ac93[_0xd262('0x33')],_0xfec767[_0xd262('0x3e')]));if(_0x52ac93[_0xd262('0x33')][_0xd262('0x40')]){_0x364e15['where']=_[_0xd262('0x41')](_0x364e15[_0xd262('0x3d')],{'$or':_[_0xd262('0x2d')](_0x364e15[_0xd262('0x36')],function(_0x579e68){var _0x49e930={};_0x49e930[_0x579e68]={'$like':'%'+_0x52ac93[_0xd262('0x33')][_0xd262('0x40')]+'%'};return _0x49e930;})});}_0x364e15=_['merge']({},_0x364e15,_0x52ac93[_0xd262('0x48')]);return _0x5397ac[_0xd262('0x4c')](_0x364e15);}})[_0xd262('0x27')](function(_0x254c32){if(_0x254c32){_0x1655d1=_0x254c32['length'];if(!_0x52ac93[_0xd262('0x33')][_0xd262('0x39')]('nolimit')){_0x364e15[_0xd262('0x20')]=qs['limit'](_0x52ac93[_0xd262('0x33')]['limit']);_0x364e15[_0xd262('0x1e')]=qs[_0xd262('0x1e')](_0x52ac93[_0xd262('0x33')][_0xd262('0x1e')]);}return _0x5397ac[_0xd262('0x4c')](_0x364e15);}})['then'](function(_0x38278a){if(_0x38278a){return _0x38278a?{'count':_0x1655d1,'rows':_0x38278a}:null;}})[_0xd262('0x27')](respondWithResult(_0x413347,null))[_0xd262('0x45')](handleError(_0x413347,null));};exports[_0xd262('0x4f')]=function(_0x4a17f5,_0x1ae0a0,_0x4cdd4e){var _0x387b6e={};var _0x3ff0b9={};var _0x41ce30;var _0x59bf36;return db[_0xd262('0x2e')][_0xd262('0x4d')]({'where':{'id':_0x4a17f5[_0xd262('0x47')]['id']}})[_0xd262('0x27')](handleEntityNotFound(_0x1ae0a0,null))[_0xd262('0x27')](function(_0x7eb8b5){if(_0x7eb8b5){_0x41ce30=_0x7eb8b5;_0x3ff0b9['model']=_['keys'](db[_0xd262('0x4e')][_0xd262('0x2f')]);_0x3ff0b9[_0xd262('0x33')]=_['keys'](_0x4a17f5[_0xd262('0x33')]);_0x3ff0b9[_0xd262('0x3e')]=_[_0xd262('0x35')](_0x3ff0b9[_0xd262('0x32')],_0x3ff0b9['query']);_0x387b6e[_0xd262('0x36')]=_['intersection'](_0x3ff0b9[_0xd262('0x32')],qs[_0xd262('0x37')](_0x4a17f5[_0xd262('0x33')][_0xd262('0x37')]));_0x387b6e[_0xd262('0x36')]=_0x387b6e[_0xd262('0x36')][_0xd262('0x38')]?_0x387b6e['attributes']:_0x3ff0b9[_0xd262('0x32')];_0x387b6e[_0xd262('0x3b')]=qs[_0xd262('0x3c')](_0x4a17f5[_0xd262('0x33')][_0xd262('0x3c')]);_0x387b6e[_0xd262('0x3d')]=qs[_0xd262('0x3e')](_['pick'](_0x4a17f5[_0xd262('0x33')],_0x3ff0b9[_0xd262('0x3e')]));if(_0x4a17f5[_0xd262('0x33')][_0xd262('0x40')]){_0x387b6e[_0xd262('0x3d')]=_['merge'](_0x387b6e['where'],{'$or':_[_0xd262('0x2d')](_0x387b6e['attributes'],function(_0x3ca731){var _0x135f0c={};_0x135f0c[_0x3ca731]={'$like':'%'+_0x4a17f5[_0xd262('0x33')][_0xd262('0x40')]+'%'};return _0x135f0c;})});}_0x387b6e=_[_0xd262('0x41')]({},_0x387b6e,_0x4a17f5[_0xd262('0x48')]);return _0x41ce30['getSubjects'](_0x387b6e);}})[_0xd262('0x27')](function(_0x3b9e1c){if(_0x3b9e1c){_0x59bf36=_0x3b9e1c[_0xd262('0x38')];if(!_0x4a17f5['query'][_0xd262('0x39')](_0xd262('0x3a'))){_0x387b6e[_0xd262('0x20')]=qs[_0xd262('0x20')](_0x4a17f5[_0xd262('0x33')][_0xd262('0x20')]);_0x387b6e[_0xd262('0x1e')]=qs[_0xd262('0x1e')](_0x4a17f5[_0xd262('0x33')][_0xd262('0x1e')]);}return _0x41ce30['getSubjects'](_0x387b6e);}})['then'](function(_0x35ea20){if(_0x35ea20){return _0x35ea20?{'count':_0x59bf36,'rows':_0x35ea20}:null;}})[_0xd262('0x27')](respondWithResult(_0x1ae0a0,null))[_0xd262('0x45')](handleError(_0x1ae0a0,null));};exports[_0xd262('0x50')]=function(_0x721b3e,_0x102a02,_0x109e6a){var _0x5754c4={};var _0x3147cc={};var _0x4eedd9;var _0x58721c;return db[_0xd262('0x2e')]['findOne']({'where':{'id':_0x721b3e['params']['id']}})['then'](handleEntityNotFound(_0x102a02,null))[_0xd262('0x27')](function(_0x1afd1e){if(_0x1afd1e){_0x4eedd9=_0x1afd1e;_0x3147cc[_0xd262('0x32')]=_[_0xd262('0x34')](db[_0xd262('0x4e')][_0xd262('0x2f')]);_0x3147cc[_0xd262('0x33')]=_[_0xd262('0x34')](_0x721b3e['query']);_0x3147cc[_0xd262('0x3e')]=_[_0xd262('0x35')](_0x3147cc['model'],_0x3147cc[_0xd262('0x33')]);_0x5754c4[_0xd262('0x36')]=_[_0xd262('0x35')](_0x3147cc[_0xd262('0x32')],qs[_0xd262('0x37')](_0x721b3e[_0xd262('0x33')][_0xd262('0x37')]));_0x5754c4['attributes']=_0x5754c4[_0xd262('0x36')][_0xd262('0x38')]?_0x5754c4['attributes']:_0x3147cc[_0xd262('0x32')];_0x5754c4[_0xd262('0x3b')]=qs[_0xd262('0x3c')](_0x721b3e[_0xd262('0x33')][_0xd262('0x3c')]);_0x5754c4[_0xd262('0x3d')]=qs[_0xd262('0x3e')](_[_0xd262('0x3f')](_0x721b3e['query'],_0x3147cc[_0xd262('0x3e')]));if(_0x721b3e['query'][_0xd262('0x40')]){_0x5754c4[_0xd262('0x3d')]=_['merge'](_0x5754c4[_0xd262('0x3d')],{'$or':_[_0xd262('0x2d')](_0x5754c4['attributes'],function(_0x386250){var _0x4fe376={};_0x4fe376[_0x386250]={'$like':'%'+_0x721b3e['query']['filter']+'%'};return _0x4fe376;})});}_0x5754c4=_[_0xd262('0x41')]({},_0x5754c4,_0x721b3e[_0xd262('0x48')]);return _0x4eedd9[_0xd262('0x50')](_0x5754c4);}})[_0xd262('0x27')](function(_0x12fdcb){if(_0x12fdcb){_0x58721c=_0x12fdcb[_0xd262('0x38')];if(!_0x721b3e[_0xd262('0x33')][_0xd262('0x39')]('nolimit')){_0x5754c4[_0xd262('0x20')]=qs['limit'](_0x721b3e['query'][_0xd262('0x20')]);_0x5754c4[_0xd262('0x1e')]=qs['offset'](_0x721b3e[_0xd262('0x33')][_0xd262('0x1e')]);}return _0x4eedd9['getDescriptions'](_0x5754c4);}})[_0xd262('0x27')](function(_0x1a21e0){if(_0x1a21e0){return _0x1a21e0?{'count':_0x58721c,'rows':_0x1a21e0}:null;}})[_0xd262('0x27')](respondWithResult(_0x102a02,null))[_0xd262('0x45')](handleError(_0x102a02,null));};exports['getTags']=function(_0x25f1d9,_0x34fe3a,_0x12b93a){var _0x593bf6={};var _0x9b0e95={};var _0x97ec2c;var _0x58cc28;return db[_0xd262('0x2e')]['findOne']({'where':{'id':_0x25f1d9['params']['id']}})[_0xd262('0x27')](handleEntityNotFound(_0x34fe3a,null))['then'](function(_0x54b76f){if(_0x54b76f){_0x97ec2c=_0x54b76f;_0x9b0e95['model']=_[_0xd262('0x34')](db[_0xd262('0x51')][_0xd262('0x2f')]);_0x9b0e95['query']=_[_0xd262('0x34')](_0x25f1d9[_0xd262('0x33')]);_0x9b0e95['filters']=_['intersection'](_0x9b0e95[_0xd262('0x32')],_0x9b0e95['query']);_0x593bf6[_0xd262('0x36')]=_[_0xd262('0x35')](_0x9b0e95['model'],qs[_0xd262('0x37')](_0x25f1d9[_0xd262('0x33')][_0xd262('0x37')]));_0x593bf6[_0xd262('0x36')]=_0x593bf6[_0xd262('0x36')][_0xd262('0x38')]?_0x593bf6[_0xd262('0x36')]:_0x9b0e95[_0xd262('0x32')];_0x593bf6[_0xd262('0x3b')]=qs['sort'](_0x25f1d9['query'][_0xd262('0x3c')]);_0x593bf6[_0xd262('0x3d')]=qs[_0xd262('0x3e')](_[_0xd262('0x3f')](_0x25f1d9['query'],_0x9b0e95[_0xd262('0x3e')]));if(_0x25f1d9[_0xd262('0x33')][_0xd262('0x40')]){_0x593bf6[_0xd262('0x3d')]=_[_0xd262('0x41')](_0x593bf6[_0xd262('0x3d')],{'$or':_[_0xd262('0x2d')](_0x593bf6['attributes'],function(_0x448cc){var _0x18785e={};_0x18785e[_0x448cc]={'$like':'%'+_0x25f1d9['query'][_0xd262('0x40')]+'%'};return _0x18785e;})});}_0x593bf6=_['merge']({},_0x593bf6,_0x25f1d9[_0xd262('0x48')]);return _0x97ec2c[_0xd262('0x52')](_0x593bf6);}})['then'](function(_0x137730){if(_0x137730){_0x58cc28=_0x137730[_0xd262('0x38')];if(!_0x25f1d9[_0xd262('0x33')][_0xd262('0x39')]('nolimit')){_0x593bf6['limit']=qs['limit'](_0x25f1d9['query'][_0xd262('0x20')]);_0x593bf6[_0xd262('0x1e')]=qs[_0xd262('0x1e')](_0x25f1d9['query'][_0xd262('0x1e')]);}return _0x97ec2c[_0xd262('0x52')](_0x593bf6);}})[_0xd262('0x27')](function(_0x1b0990){if(_0x1b0990){return _0x1b0990?{'count':_0x58cc28,'rows':_0x1b0990}:null;}})[_0xd262('0x27')](respondWithResult(_0x34fe3a,null))[_0xd262('0x45')](handleError(_0x34fe3a,null));};exports[_0xd262('0x53')]=function(_0x5d988d,_0x186f21,_0x5c44fd){if(_0x5d988d['body']['id']){delete _0x5d988d[_0xd262('0x4b')]['id'];}return db[_0xd262('0x2e')][_0xd262('0x4d')]({'where':{'id':_0x5d988d[_0xd262('0x47')]['id']}})[_0xd262('0x27')](handleEntityNotFound(_0x186f21,null))[_0xd262('0x27')](function(_0xb3020e){if(_0xb3020e){return _0xb3020e[_0xd262('0x53')](_0x5d988d[_0xd262('0x4b')]['ids']||[]);}return null;})[_0xd262('0x27')](respondWithResult(_0x186f21,null))[_0xd262('0x45')](handleError(_0x186f21,null));}; \ No newline at end of file +var _0xd6e1=['length','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','then','destroy','stack','name','map','ZendeskConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params','getFields','findOne','ZendeskField'];(function(_0x5b7100,_0xd698d5){var _0x45dcba=function(_0x1905e2){while(--_0x1905e2){_0x5b7100['push'](_0x5b7100['shift']());}};_0x45dcba(++_0xd698d5);}(_0xd6e1,0x196));var _0x1d6e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd6e1[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x1d6e('0x0'));var rimraf=require(_0x1d6e('0x1'));var zipdir=require(_0x1d6e('0x2'));var jsonpatch=require(_0x1d6e('0x3'));var rp=require(_0x1d6e('0x4'));var moment=require(_0x1d6e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1d6e('0x6'));var path=require('path');var sox=require(_0x1d6e('0x7'));var csv=require(_0x1d6e('0x8'));var ejs=require(_0x1d6e('0x9'));var fs=require('fs');var fs_extra=require(_0x1d6e('0xa'));var _=require(_0x1d6e('0xb'));var squel=require(_0x1d6e('0xc'));var crypto=require(_0x1d6e('0xd'));var jsforce=require(_0x1d6e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1d6e('0x8'));var querystring=require(_0x1d6e('0xf'));var Papa=require(_0x1d6e('0x10'));var Redis=require(_0x1d6e('0x11'));var authService=require(_0x1d6e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1d6e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1d6e('0x14'));var config=require(_0x1d6e('0x15'));var licenseUtil=require(_0x1d6e('0x16'));var db=require(_0x1d6e('0x17'))['db'];function respondWithStatusCode(_0x49874b,_0x37bbe9){_0x37bbe9=_0x37bbe9||0xcc;return function(_0x5185f8){if(_0x5185f8){return _0x49874b[_0x1d6e('0x18')](_0x37bbe9);}return _0x49874b['status'](_0x37bbe9)[_0x1d6e('0x19')]();};}function respondWithResult(_0x1c3b9c,_0x2c5b82){_0x2c5b82=_0x2c5b82||0xc8;return function(_0x51d51c){if(_0x51d51c){return _0x1c3b9c['status'](_0x2c5b82)[_0x1d6e('0x1a')](_0x51d51c);}};}function respondWithFilteredResult(_0x250178,_0x4f8ec2){return function(_0x349bd2){if(_0x349bd2){var _0x4c6a7c=typeof _0x4f8ec2[_0x1d6e('0x1b')]===_0x1d6e('0x1c')&&typeof _0x4f8ec2[_0x1d6e('0x1d')]===_0x1d6e('0x1c');var _0x1a5936=_0x349bd2[_0x1d6e('0x1e')];var _0x56968a=_0x4c6a7c?0x0:_0x4f8ec2['offset'];var _0x18f7b7=_0x4c6a7c?_0x349bd2[_0x1d6e('0x1e')]:_0x4f8ec2[_0x1d6e('0x1b')]+_0x4f8ec2['limit'];var _0x4bf347;if(_0x18f7b7>=_0x1a5936){_0x18f7b7=_0x1a5936;_0x4bf347=0xc8;}else{_0x4bf347=0xce;}_0x250178[_0x1d6e('0x1f')](_0x4bf347);return _0x250178[_0x1d6e('0x20')]('Content-Range',_0x56968a+'-'+_0x18f7b7+'/'+_0x1a5936)[_0x1d6e('0x1a')](_0x349bd2);}return null;};}function patchUpdates(_0x4672b1){return function(_0x2a0d87){try{jsonpatch[_0x1d6e('0x21')](_0x2a0d87,_0x4672b1,!![]);}catch(_0x5cab15){return BPromise[_0x1d6e('0x22')](_0x5cab15);}return _0x2a0d87[_0x1d6e('0x23')]();};}function saveUpdates(_0x2d2eaa,_0x4e4549){return function(_0x3cbd47){if(_0x3cbd47){return _0x3cbd47['update'](_0x2d2eaa)[_0x1d6e('0x24')](function(_0x195ef5){return _0x195ef5;});}return null;};}function removeEntity(_0x16917b,_0x4b8b17){return function(_0x395310){if(_0x395310){return _0x395310[_0x1d6e('0x25')]()['then'](function(){_0x16917b[_0x1d6e('0x1f')](0xcc)[_0x1d6e('0x19')]();});}};}function handleEntityNotFound(_0x4dd36e,_0x2887df){return function(_0x37751f){if(!_0x37751f){_0x4dd36e[_0x1d6e('0x18')](0x194);}return _0x37751f;};}function handleError(_0x198d74,_0xb32385){_0xb32385=_0xb32385||0x1f4;return function(_0x2fc5fd){logger['error'](_0x2fc5fd[_0x1d6e('0x26')]);if(_0x2fc5fd[_0x1d6e('0x27')]){delete _0x2fc5fd[_0x1d6e('0x27')];}_0x198d74['status'](_0xb32385)['send'](_0x2fc5fd);};}exports['index']=function(_0x2b2dc9,_0x14a0c0){var _0x235e6b={},_0xa148f={},_0x3daefd={'count':0x0,'rows':[]};var _0x474a8b=_[_0x1d6e('0x28')](db[_0x1d6e('0x29')]['rawAttributes'],function(_0x344cd0){return{'name':_0x344cd0[_0x1d6e('0x2a')],'type':_0x344cd0[_0x1d6e('0x2b')][_0x1d6e('0x2c')]};});_0xa148f[_0x1d6e('0x2d')]=_[_0x1d6e('0x28')](_0x474a8b,_0x1d6e('0x27'));_0xa148f[_0x1d6e('0x2e')]=_[_0x1d6e('0x2f')](_0x2b2dc9['query']);_0xa148f['filters']=_[_0x1d6e('0x30')](_0xa148f[_0x1d6e('0x2d')],_0xa148f['query']);_0x235e6b[_0x1d6e('0x31')]=_[_0x1d6e('0x30')](_0xa148f['model'],qs[_0x1d6e('0x32')](_0x2b2dc9['query'][_0x1d6e('0x32')]));_0x235e6b[_0x1d6e('0x31')]=_0x235e6b['attributes']['length']?_0x235e6b['attributes']:_0xa148f[_0x1d6e('0x2d')];if(!_0x2b2dc9[_0x1d6e('0x2e')][_0x1d6e('0x33')](_0x1d6e('0x34'))){_0x235e6b[_0x1d6e('0x1d')]=qs['limit'](_0x2b2dc9['query'][_0x1d6e('0x1d')]);_0x235e6b[_0x1d6e('0x1b')]=qs[_0x1d6e('0x1b')](_0x2b2dc9[_0x1d6e('0x2e')][_0x1d6e('0x1b')]);}_0x235e6b[_0x1d6e('0x35')]=qs[_0x1d6e('0x36')](_0x2b2dc9[_0x1d6e('0x2e')][_0x1d6e('0x36')]);_0x235e6b['where']=qs[_0x1d6e('0x37')](_[_0x1d6e('0x38')](_0x2b2dc9[_0x1d6e('0x2e')],_0xa148f['filters']),_0x474a8b);if(_0x2b2dc9[_0x1d6e('0x2e')][_0x1d6e('0x39')]){_0x235e6b[_0x1d6e('0x3a')]=_[_0x1d6e('0x3b')](_0x235e6b[_0x1d6e('0x3a')],{'$or':_[_0x1d6e('0x28')](_0x474a8b,function(_0x5064d0){if(_0x5064d0['type']!=='VIRTUAL'){var _0x5e3b53={};_0x5e3b53[_0x5064d0['name']]={'$like':'%'+_0x2b2dc9[_0x1d6e('0x2e')][_0x1d6e('0x39')]+'%'};return _0x5e3b53;}})});}_0x235e6b=_[_0x1d6e('0x3b')]({},_0x235e6b,_0x2b2dc9[_0x1d6e('0x3c')]);var _0x19751a={'where':_0x235e6b['where']};return db['ZendeskConfiguration'][_0x1d6e('0x1e')](_0x19751a)[_0x1d6e('0x24')](function(_0x388c52){_0x3daefd[_0x1d6e('0x1e')]=_0x388c52;if(_0x2b2dc9[_0x1d6e('0x2e')][_0x1d6e('0x3d')]){_0x235e6b[_0x1d6e('0x3e')]=[{'all':!![]}];}return db[_0x1d6e('0x29')][_0x1d6e('0x3f')](_0x235e6b);})[_0x1d6e('0x24')](function(_0x5ac21d){_0x3daefd['rows']=_0x5ac21d;return _0x3daefd;})[_0x1d6e('0x24')](respondWithFilteredResult(_0x14a0c0,_0x235e6b))[_0x1d6e('0x40')](handleError(_0x14a0c0,null));};exports[_0x1d6e('0x41')]=function(_0x1cafa4,_0x93ade9){var _0x3de930={'raw':![],'where':{'id':_0x1cafa4['params']['id']}},_0xede749={};_0xede749[_0x1d6e('0x2d')]=_[_0x1d6e('0x2f')](db[_0x1d6e('0x29')][_0x1d6e('0x42')]);_0xede749['query']=_[_0x1d6e('0x2f')](_0x1cafa4[_0x1d6e('0x2e')]);_0xede749['filters']=_[_0x1d6e('0x30')](_0xede749[_0x1d6e('0x2d')],_0xede749[_0x1d6e('0x2e')]);_0x3de930[_0x1d6e('0x31')]=_[_0x1d6e('0x30')](_0xede749[_0x1d6e('0x2d')],qs['fields'](_0x1cafa4[_0x1d6e('0x2e')][_0x1d6e('0x32')]));_0x3de930['attributes']=_0x3de930[_0x1d6e('0x31')]['length']?_0x3de930[_0x1d6e('0x31')]:_0xede749[_0x1d6e('0x2d')];if(_0x1cafa4[_0x1d6e('0x2e')][_0x1d6e('0x3d')]){_0x3de930[_0x1d6e('0x3e')]=[{'all':!![]}];}_0x3de930=_[_0x1d6e('0x3b')]({},_0x3de930,_0x1cafa4[_0x1d6e('0x3c')]);return db[_0x1d6e('0x29')][_0x1d6e('0x43')](_0x3de930)[_0x1d6e('0x24')](handleEntityNotFound(_0x93ade9,null))[_0x1d6e('0x24')](respondWithResult(_0x93ade9,null))[_0x1d6e('0x40')](handleError(_0x93ade9,null));};exports[_0x1d6e('0x44')]=function(_0x53547c,_0x514eb6){return db[_0x1d6e('0x29')]['create'](_0x53547c[_0x1d6e('0x45')],{})[_0x1d6e('0x24')](respondWithResult(_0x514eb6,0xc9))[_0x1d6e('0x40')](handleError(_0x514eb6,null));};exports['update']=function(_0x11611d,_0x1b12b4){if(_0x11611d[_0x1d6e('0x45')]['id']){delete _0x11611d[_0x1d6e('0x45')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x11611d['params']['id']}})[_0x1d6e('0x24')](handleEntityNotFound(_0x1b12b4,null))[_0x1d6e('0x24')](saveUpdates(_0x11611d[_0x1d6e('0x45')],null))[_0x1d6e('0x24')](respondWithResult(_0x1b12b4,null))['catch'](handleError(_0x1b12b4,null));};exports[_0x1d6e('0x25')]=function(_0x4e7695,_0x404f3b){return db[_0x1d6e('0x29')][_0x1d6e('0x43')]({'where':{'id':_0x4e7695[_0x1d6e('0x46')]['id']}})[_0x1d6e('0x24')](handleEntityNotFound(_0x404f3b,null))['then'](removeEntity(_0x404f3b,null))[_0x1d6e('0x40')](handleError(_0x404f3b,null));};exports[_0x1d6e('0x47')]=function(_0xc7ae73,_0x1292f3,_0x53f4f1){var _0x3916fb={};var _0x9f15fc={};var _0x414306;var _0x4098a5;return db['ZendeskConfiguration'][_0x1d6e('0x48')]({'where':{'id':_0xc7ae73['params']['id']}})['then'](handleEntityNotFound(_0x1292f3,null))[_0x1d6e('0x24')](function(_0x117752){if(_0x117752){_0x414306=_0x117752;_0x9f15fc[_0x1d6e('0x2d')]=_['keys'](db[_0x1d6e('0x49')]['rawAttributes']);_0x9f15fc[_0x1d6e('0x2e')]=_['keys'](_0xc7ae73[_0x1d6e('0x2e')]);_0x9f15fc[_0x1d6e('0x37')]=_['intersection'](_0x9f15fc['model'],_0x9f15fc[_0x1d6e('0x2e')]);_0x3916fb[_0x1d6e('0x31')]=_[_0x1d6e('0x30')](_0x9f15fc[_0x1d6e('0x2d')],qs[_0x1d6e('0x32')](_0xc7ae73[_0x1d6e('0x2e')]['fields']));_0x3916fb['attributes']=_0x3916fb[_0x1d6e('0x31')][_0x1d6e('0x4a')]?_0x3916fb[_0x1d6e('0x31')]:_0x9f15fc[_0x1d6e('0x2d')];_0x3916fb[_0x1d6e('0x35')]=qs[_0x1d6e('0x36')](_0xc7ae73[_0x1d6e('0x2e')][_0x1d6e('0x36')]);_0x3916fb['where']=qs['filters'](_['pick'](_0xc7ae73[_0x1d6e('0x2e')],_0x9f15fc['filters']));if(_0xc7ae73[_0x1d6e('0x2e')][_0x1d6e('0x39')]){_0x3916fb[_0x1d6e('0x3a')]=_[_0x1d6e('0x3b')](_0x3916fb['where'],{'$or':_['map'](_0x3916fb[_0x1d6e('0x31')],function(_0x400598){var _0xd7658d={};_0xd7658d[_0x400598]={'$like':'%'+_0xc7ae73[_0x1d6e('0x2e')][_0x1d6e('0x39')]+'%'};return _0xd7658d;})});}_0x3916fb=_[_0x1d6e('0x3b')]({},_0x3916fb,_0xc7ae73[_0x1d6e('0x3c')]);return _0x414306[_0x1d6e('0x47')](_0x3916fb);}})['then'](function(_0x151d4d){if(_0x151d4d){_0x4098a5=_0x151d4d[_0x1d6e('0x4a')];if(!_0xc7ae73[_0x1d6e('0x2e')]['hasOwnProperty']('nolimit')){_0x3916fb['limit']=qs[_0x1d6e('0x1d')](_0xc7ae73[_0x1d6e('0x2e')][_0x1d6e('0x1d')]);_0x3916fb[_0x1d6e('0x1b')]=qs[_0x1d6e('0x1b')](_0xc7ae73[_0x1d6e('0x2e')][_0x1d6e('0x1b')]);}return _0x414306[_0x1d6e('0x47')](_0x3916fb);}})[_0x1d6e('0x24')](function(_0x3601be){if(_0x3601be){return _0x3601be?{'count':_0x4098a5,'rows':_0x3601be}:null;}})[_0x1d6e('0x24')](respondWithResult(_0x1292f3,null))[_0x1d6e('0x40')](handleError(_0x1292f3,null));};exports['getSubjects']=function(_0x2992a1,_0x4c4281,_0x49c700){var _0x3fac4c={};var _0x4754da={};var _0x3f9662;var _0x421c96;return db[_0x1d6e('0x29')]['findOne']({'where':{'id':_0x2992a1[_0x1d6e('0x46')]['id']}})[_0x1d6e('0x24')](handleEntityNotFound(_0x4c4281,null))[_0x1d6e('0x24')](function(_0x5ab2ce){if(_0x5ab2ce){_0x3f9662=_0x5ab2ce;_0x4754da['model']=_[_0x1d6e('0x2f')](db[_0x1d6e('0x49')][_0x1d6e('0x42')]);_0x4754da['query']=_[_0x1d6e('0x2f')](_0x2992a1[_0x1d6e('0x2e')]);_0x4754da['filters']=_[_0x1d6e('0x30')](_0x4754da['model'],_0x4754da['query']);_0x3fac4c['attributes']=_['intersection'](_0x4754da[_0x1d6e('0x2d')],qs[_0x1d6e('0x32')](_0x2992a1['query'][_0x1d6e('0x32')]));_0x3fac4c[_0x1d6e('0x31')]=_0x3fac4c[_0x1d6e('0x31')][_0x1d6e('0x4a')]?_0x3fac4c['attributes']:_0x4754da['model'];_0x3fac4c[_0x1d6e('0x35')]=qs[_0x1d6e('0x36')](_0x2992a1[_0x1d6e('0x2e')]['sort']);_0x3fac4c[_0x1d6e('0x3a')]=qs[_0x1d6e('0x37')](_[_0x1d6e('0x38')](_0x2992a1['query'],_0x4754da[_0x1d6e('0x37')]));if(_0x2992a1[_0x1d6e('0x2e')]['filter']){_0x3fac4c['where']=_[_0x1d6e('0x3b')](_0x3fac4c[_0x1d6e('0x3a')],{'$or':_['map'](_0x3fac4c[_0x1d6e('0x31')],function(_0x51d40b){var _0x14078b={};_0x14078b[_0x51d40b]={'$like':'%'+_0x2992a1[_0x1d6e('0x2e')]['filter']+'%'};return _0x14078b;})});}_0x3fac4c=_[_0x1d6e('0x3b')]({},_0x3fac4c,_0x2992a1['options']);return _0x3f9662['getSubjects'](_0x3fac4c);}})['then'](function(_0x5f30dd){if(_0x5f30dd){_0x421c96=_0x5f30dd['length'];if(!_0x2992a1[_0x1d6e('0x2e')]['hasOwnProperty'](_0x1d6e('0x34'))){_0x3fac4c[_0x1d6e('0x1d')]=qs['limit'](_0x2992a1['query'][_0x1d6e('0x1d')]);_0x3fac4c[_0x1d6e('0x1b')]=qs[_0x1d6e('0x1b')](_0x2992a1['query'][_0x1d6e('0x1b')]);}return _0x3f9662[_0x1d6e('0x4b')](_0x3fac4c);}})['then'](function(_0x21301c){if(_0x21301c){return _0x21301c?{'count':_0x421c96,'rows':_0x21301c}:null;}})[_0x1d6e('0x24')](respondWithResult(_0x4c4281,null))[_0x1d6e('0x40')](handleError(_0x4c4281,null));};exports[_0x1d6e('0x4c')]=function(_0x35c361,_0x5d12f3,_0x186978){var _0x25fe37={};var _0x936e68={};var _0x110cc5;var _0xdb2cc8;return db[_0x1d6e('0x29')][_0x1d6e('0x48')]({'where':{'id':_0x35c361['params']['id']}})[_0x1d6e('0x24')](handleEntityNotFound(_0x5d12f3,null))[_0x1d6e('0x24')](function(_0x3fcfb1){if(_0x3fcfb1){_0x110cc5=_0x3fcfb1;_0x936e68['model']=_[_0x1d6e('0x2f')](db[_0x1d6e('0x49')]['rawAttributes']);_0x936e68[_0x1d6e('0x2e')]=_['keys'](_0x35c361[_0x1d6e('0x2e')]);_0x936e68[_0x1d6e('0x37')]=_[_0x1d6e('0x30')](_0x936e68['model'],_0x936e68[_0x1d6e('0x2e')]);_0x25fe37[_0x1d6e('0x31')]=_[_0x1d6e('0x30')](_0x936e68[_0x1d6e('0x2d')],qs['fields'](_0x35c361[_0x1d6e('0x2e')][_0x1d6e('0x32')]));_0x25fe37[_0x1d6e('0x31')]=_0x25fe37['attributes'][_0x1d6e('0x4a')]?_0x25fe37[_0x1d6e('0x31')]:_0x936e68[_0x1d6e('0x2d')];_0x25fe37[_0x1d6e('0x35')]=qs[_0x1d6e('0x36')](_0x35c361[_0x1d6e('0x2e')][_0x1d6e('0x36')]);_0x25fe37[_0x1d6e('0x3a')]=qs[_0x1d6e('0x37')](_[_0x1d6e('0x38')](_0x35c361[_0x1d6e('0x2e')],_0x936e68['filters']));if(_0x35c361[_0x1d6e('0x2e')][_0x1d6e('0x39')]){_0x25fe37['where']=_['merge'](_0x25fe37[_0x1d6e('0x3a')],{'$or':_['map'](_0x25fe37[_0x1d6e('0x31')],function(_0x34b4b2){var _0x4d2f0d={};_0x4d2f0d[_0x34b4b2]={'$like':'%'+_0x35c361[_0x1d6e('0x2e')]['filter']+'%'};return _0x4d2f0d;})});}_0x25fe37=_['merge']({},_0x25fe37,_0x35c361[_0x1d6e('0x3c')]);return _0x110cc5['getDescriptions'](_0x25fe37);}})[_0x1d6e('0x24')](function(_0x8d63b8){if(_0x8d63b8){_0xdb2cc8=_0x8d63b8[_0x1d6e('0x4a')];if(!_0x35c361['query'][_0x1d6e('0x33')](_0x1d6e('0x34'))){_0x25fe37[_0x1d6e('0x1d')]=qs[_0x1d6e('0x1d')](_0x35c361[_0x1d6e('0x2e')][_0x1d6e('0x1d')]);_0x25fe37['offset']=qs['offset'](_0x35c361[_0x1d6e('0x2e')][_0x1d6e('0x1b')]);}return _0x110cc5[_0x1d6e('0x4c')](_0x25fe37);}})[_0x1d6e('0x24')](function(_0x49d136){if(_0x49d136){return _0x49d136?{'count':_0xdb2cc8,'rows':_0x49d136}:null;}})[_0x1d6e('0x24')](respondWithResult(_0x5d12f3,null))[_0x1d6e('0x40')](handleError(_0x5d12f3,null));};exports[_0x1d6e('0x4d')]=function(_0xd2ccb0,_0x4d7912,_0x530582){var _0x26a284={};var _0x1284cb={};var _0x567612;var _0x2123c2;return db[_0x1d6e('0x29')][_0x1d6e('0x48')]({'where':{'id':_0xd2ccb0[_0x1d6e('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d7912,null))[_0x1d6e('0x24')](function(_0x31c57e){if(_0x31c57e){_0x567612=_0x31c57e;_0x1284cb[_0x1d6e('0x2d')]=_[_0x1d6e('0x2f')](db[_0x1d6e('0x4e')][_0x1d6e('0x42')]);_0x1284cb['query']=_[_0x1d6e('0x2f')](_0xd2ccb0[_0x1d6e('0x2e')]);_0x1284cb[_0x1d6e('0x37')]=_[_0x1d6e('0x30')](_0x1284cb[_0x1d6e('0x2d')],_0x1284cb[_0x1d6e('0x2e')]);_0x26a284[_0x1d6e('0x31')]=_[_0x1d6e('0x30')](_0x1284cb[_0x1d6e('0x2d')],qs[_0x1d6e('0x32')](_0xd2ccb0[_0x1d6e('0x2e')][_0x1d6e('0x32')]));_0x26a284[_0x1d6e('0x31')]=_0x26a284['attributes']['length']?_0x26a284['attributes']:_0x1284cb[_0x1d6e('0x2d')];_0x26a284[_0x1d6e('0x35')]=qs[_0x1d6e('0x36')](_0xd2ccb0[_0x1d6e('0x2e')][_0x1d6e('0x36')]);_0x26a284['where']=qs[_0x1d6e('0x37')](_[_0x1d6e('0x38')](_0xd2ccb0[_0x1d6e('0x2e')],_0x1284cb[_0x1d6e('0x37')]));if(_0xd2ccb0[_0x1d6e('0x2e')][_0x1d6e('0x39')]){_0x26a284['where']=_[_0x1d6e('0x3b')](_0x26a284['where'],{'$or':_[_0x1d6e('0x28')](_0x26a284[_0x1d6e('0x31')],function(_0x58625a){var _0x4f8975={};_0x4f8975[_0x58625a]={'$like':'%'+_0xd2ccb0[_0x1d6e('0x2e')][_0x1d6e('0x39')]+'%'};return _0x4f8975;})});}_0x26a284=_[_0x1d6e('0x3b')]({},_0x26a284,_0xd2ccb0[_0x1d6e('0x3c')]);return _0x567612[_0x1d6e('0x4d')](_0x26a284);}})['then'](function(_0x200747){if(_0x200747){_0x2123c2=_0x200747[_0x1d6e('0x4a')];if(!_0xd2ccb0['query'][_0x1d6e('0x33')](_0x1d6e('0x34'))){_0x26a284[_0x1d6e('0x1d')]=qs[_0x1d6e('0x1d')](_0xd2ccb0[_0x1d6e('0x2e')][_0x1d6e('0x1d')]);_0x26a284[_0x1d6e('0x1b')]=qs['offset'](_0xd2ccb0[_0x1d6e('0x2e')]['offset']);}return _0x567612[_0x1d6e('0x4d')](_0x26a284);}})[_0x1d6e('0x24')](function(_0x248a17){if(_0x248a17){return _0x248a17?{'count':_0x2123c2,'rows':_0x248a17}:null;}})[_0x1d6e('0x24')](respondWithResult(_0x4d7912,null))[_0x1d6e('0x40')](handleError(_0x4d7912,null));};exports['setTags']=function(_0x32461d,_0x2819b0,_0x45f290){if(_0x32461d[_0x1d6e('0x45')]['id']){delete _0x32461d[_0x1d6e('0x45')]['id'];}return db[_0x1d6e('0x29')][_0x1d6e('0x48')]({'where':{'id':_0x32461d[_0x1d6e('0x46')]['id']}})[_0x1d6e('0x24')](handleEntityNotFound(_0x2819b0,null))[_0x1d6e('0x24')](function(_0x17dec0){if(_0x17dec0){return _0x17dec0[_0x1d6e('0x4f')](_0x32461d['body']['ids']||[]);}return null;})[_0x1d6e('0x24')](respondWithResult(_0x2819b0,null))[_0x1d6e('0x40')](handleError(_0x2819b0,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 7f246ab..3e87943 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 _0xb03e=['int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration'];(function(_0x4ddfe1,_0x35939d){var _0x4aaf51=function(_0x1e99a0){while(--_0x1e99a0){_0x4ddfe1['push'](_0x4ddfe1['shift']());}};_0x4aaf51(++_0x35939d);}(_0xb03e,0x1eb));var _0xeb03=function(_0x30121b,_0x17e097){_0x30121b=_0x30121b-0x0;var _0x4f3e23=_0xb03e[_0x30121b];return _0x4f3e23;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var logger=require(_0xeb03('0x1'))(_0xeb03('0x2'));var moment=require(_0xeb03('0x3'));var BPromise=require(_0xeb03('0x4'));var rp=require(_0xeb03('0x5'));var fs=require('fs');var path=require(_0xeb03('0x6'));var rimraf=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var attributes=require(_0xeb03('0x9'));module[_0xeb03('0xa')]=function(_0xee2291,_0x4e1cea){return _0xee2291[_0xeb03('0xb')](_0xeb03('0xc'),attributes,{'tableName':_0xeb03('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd4f=['exports','define','ZendeskConfiguration','lodash','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x593dcf,_0x414704){_0x593dcf=_0x593dcf-0x0;var _0x2c7eef=_0xdd4f[_0x593dcf];return _0x2c7eef;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfdd4('0x1'));var BPromise=require(_0xfdd4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdd4('0x3'));var rimraf=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xfdd4('0x6')]=function(_0x43cbcf,_0x30e080){return _0x43cbcf[_0xfdd4('0x7')](_0xfdd4('0x8'),attributes,{'tableName':'int_zendesk_configurations','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 fad80fe..55b83ca 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 _0xc081=['jayson/promise','client','http','then','info','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2b3dea,_0x198287){var _0x299979=function(_0x123eb2){while(--_0x123eb2){_0x2b3dea['push'](_0x2b3dea['shift']());}};_0x299979(++_0x198287);}(_0xc081,0x9f));var _0x1c08=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0xc081[_0x19a49f];return _0x5351ae;};'use strict';var _=require('lodash');var util=require(_0x1c08('0x0'));var moment=require(_0x1c08('0x1'));var BPromise=require(_0x1c08('0x2'));var rs=require(_0x1c08('0x3'));var fs=require('fs');var Redis=require(_0x1c08('0x4'));var db=require(_0x1c08('0x5'))['db'];var utils=require(_0x1c08('0x6'));var logger=require(_0x1c08('0x7'))(_0x1c08('0x8'));var config=require('../../config/environment');var jayson=require(_0x1c08('0x9'));var client=jayson[_0x1c08('0xa')][_0x1c08('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc4b6b3,_0x43c459,_0x15d005){return new BPromise(function(_0x262234,_0x45cd67){return client['request'](_0xc4b6b3,_0x15d005)[_0x1c08('0xc')](function(_0x525e13){logger[_0x1c08('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x43c459,'request\x20sent');logger[_0x1c08('0xe')](_0x1c08('0xf'),_0x43c459,_0x1c08('0x10'),JSON[_0x1c08('0x11')](_0x525e13));if(_0x525e13[_0x1c08('0x12')]){if(_0x525e13[_0x1c08('0x12')][_0x1c08('0x13')]===0x1f4){logger[_0x1c08('0x12')](_0x1c08('0x14'),_0x43c459,_0x525e13['error'][_0x1c08('0x15')]);return _0x45cd67(_0x525e13['error'][_0x1c08('0x15')]);}logger[_0x1c08('0x12')](_0x1c08('0x14'),_0x43c459,_0x525e13[_0x1c08('0x12')][_0x1c08('0x15')]);return _0x262234(_0x525e13[_0x1c08('0x12')][_0x1c08('0x15')]);}else{logger[_0x1c08('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x43c459,_0x1c08('0x10'));_0x262234(_0x525e13[_0x1c08('0x16')][_0x1c08('0x15')]);}})[_0x1c08('0x17')](function(_0x46162d){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x43c459,_0x46162d);_0x45cd67(_0x46162d);});});} \ No newline at end of file +var _0x37fd=['catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x26068a,_0x11058c){var _0x4c2517=function(_0xde27af){while(--_0xde27af){_0x26068a['push'](_0x26068a['shift']());}};_0x4c2517(++_0x11058c);}(_0x37fd,0xa9));var _0xd37f=function(_0x44fd6b,_0x338098){_0x44fd6b=_0x44fd6b-0x0;var _0x7cba12=_0x37fd[_0x44fd6b];return _0x7cba12;};'use strict';var _=require('lodash');var util=require(_0xd37f('0x0'));var moment=require(_0xd37f('0x1'));var BPromise=require('bluebird');var rs=require(_0xd37f('0x2'));var fs=require('fs');var Redis=require(_0xd37f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd37f('0x4'));var logger=require(_0xd37f('0x5'))(_0xd37f('0x6'));var config=require('../../config/environment');var jayson=require(_0xd37f('0x7'));var client=jayson[_0xd37f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x542f4e,_0x3fd763,_0x157919){return new BPromise(function(_0x51810c,_0x51792e){return client[_0xd37f('0x9')](_0x542f4e,_0x157919)[_0xd37f('0xa')](function(_0x2d25f4){logger[_0xd37f('0xb')](_0xd37f('0xc'),_0x3fd763,_0xd37f('0xd'));logger[_0xd37f('0xe')](_0xd37f('0xf'),_0x3fd763,_0xd37f('0xd'),JSON[_0xd37f('0x10')](_0x2d25f4));if(_0x2d25f4[_0xd37f('0x11')]){if(_0x2d25f4[_0xd37f('0x11')]['code']===0x1f4){logger[_0xd37f('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3fd763,_0x2d25f4['error'][_0xd37f('0x12')]);return _0x51792e(_0x2d25f4[_0xd37f('0x11')][_0xd37f('0x12')]);}logger[_0xd37f('0x11')](_0xd37f('0xc'),_0x3fd763,_0x2d25f4[_0xd37f('0x11')][_0xd37f('0x12')]);return _0x51810c(_0x2d25f4['error'][_0xd37f('0x12')]);}else{logger[_0xd37f('0xb')](_0xd37f('0xc'),_0x3fd763,_0xd37f('0xd'));_0x51810c(_0x2d25f4[_0xd37f('0x13')][_0xd37f('0x12')]);}})[_0xd37f('0x14')](function(_0x1aee93){logger[_0xd37f('0x11')](_0xd37f('0xc'),_0x3fd763,_0x1aee93);_0x51792e(_0x1aee93);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 1765074..5ea7cc4 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 _0xdcac=['update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','create'];(function(_0x7bb309,_0x528140){var _0x3613a4=function(_0x26cd31){while(--_0x26cd31){_0x7bb309['push'](_0x7bb309['shift']());}};_0x3613a4(++_0x528140);}(_0xdcac,0x19b));var _0xcdca=function(_0x4a2e7c,_0x458396){_0x4a2e7c=_0x4a2e7c-0x0;var _0x245ab0=_0xdcac[_0x4a2e7c];return _0x245ab0;};'use strict';var multer=require('multer');var util=require(_0xcdca('0x0'));var path=require(_0xcdca('0x1'));var timeout=require(_0xcdca('0x2'));var express=require('express');var router=express[_0xcdca('0x3')]();var fs_extra=require(_0xcdca('0x4'));var auth=require(_0xcdca('0x5'));var interaction=require(_0xcdca('0x6'));var config=require('../../config/environment');var controller=require(_0xcdca('0x7'));router['get']('/',auth[_0xcdca('0x8')](),controller[_0xcdca('0x9')]);router[_0xcdca('0xa')](_0xcdca('0xb'),auth[_0xcdca('0x8')](),controller[_0xcdca('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcdca('0xd')]);router['put'](_0xcdca('0xb'),auth[_0xcdca('0x8')](),controller[_0xcdca('0xe')]);router[_0xcdca('0xf')](_0xcdca('0xb'),auth[_0xcdca('0x8')](),controller[_0xcdca('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc7f5=['index','get','post','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated'];(function(_0x5e1db3,_0x303286){var _0x326590=function(_0x41d71e){while(--_0x41d71e){_0x5e1db3['push'](_0x5e1db3['shift']());}};_0x326590(++_0x303286);}(_0xc7f5,0x182));var _0x5c7f=function(_0x52fa77,_0x2b381b){_0x52fa77=_0x52fa77-0x0;var _0x477535=_0xc7f5[_0x52fa77];return _0x477535;};'use strict';var multer=require(_0x5c7f('0x0'));var util=require(_0x5c7f('0x1'));var path=require(_0x5c7f('0x2'));var timeout=require(_0x5c7f('0x3'));var express=require(_0x5c7f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5c7f('0x5'));var interaction=require(_0x5c7f('0x6'));var config=require(_0x5c7f('0x7'));var controller=require(_0x5c7f('0x8'));router['get']('/',auth[_0x5c7f('0x9')](),controller[_0x5c7f('0xa')]);router[_0x5c7f('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5c7f('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5c7f('0xd')](_0x5c7f('0xe'),auth[_0x5c7f('0x9')](),controller[_0x5c7f('0xf')]);router[_0x5c7f('0x10')](_0x5c7f('0xe'),auth[_0x5c7f('0x9')](),controller[_0x5c7f('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 5fa15d5..26360c9 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 _0xe7fa=['BOOLEAN','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x599aaf,_0x3d3622){var _0xd995f3=function(_0x19825e){while(--_0x19825e){_0x599aaf['push'](_0x599aaf['shift']());}};_0xd995f3(++_0x3d3622);}(_0xe7fa,0xf1));var _0xae7f=function(_0x5b0f84,_0x77fe11){_0x5b0f84=_0x5b0f84-0x0;var _0x96b11d=_0xe7fa[_0x5b0f84];return _0x96b11d;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xae7f('0x0')](_0xae7f('0x1'),_0xae7f('0x2'),_0xae7f('0x3'),_0xae7f('0x4'),_0xae7f('0x5')),'defaultValue':_0xae7f('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xae7f('0x0')](_0xae7f('0x1'),_0xae7f('0x2'),_0xae7f('0x3'))},'keyContent':{'type':Sequelize[_0xae7f('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xae7f('0x6')]},'customField':{'type':Sequelize[_0xae7f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xae7f('0x6')]}}; \ No newline at end of file +var _0xf546=['variable','keyValue','STRING','ENUM','customVariable','sequelize','exports','string'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf546,0x7d));var _0x6f54=function(_0x2bbc40,_0x38190){_0x2bbc40=_0x2bbc40-0x0;var _0x488a32=_0xf546[_0x2bbc40];return _0x488a32;};'use strict';var Sequelize=require(_0x6f54('0x0'));module[_0x6f54('0x1')]={'type':{'type':Sequelize['ENUM'](_0x6f54('0x2'),_0x6f54('0x3'),'customVariable',_0x6f54('0x4'),'picklist'),'defaultValue':_0x6f54('0x2')},'content':{'type':Sequelize[_0x6f54('0x5')]},'key':{'type':Sequelize[_0x6f54('0x5')]},'keyType':{'type':Sequelize[_0x6f54('0x6')](_0x6f54('0x2'),_0x6f54('0x3'),_0x6f54('0x7'))},'keyContent':{'type':Sequelize[_0x6f54('0x5')]},'idField':{'type':Sequelize[_0x6f54('0x5')]},'nameField':{'type':Sequelize[_0x6f54('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6f54('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index a04c325..5a00a59 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 _0xda51=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','json','apply','save','then','end','error','stack','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','show','includeAll','options','find','create','body','params','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x6357ad,_0x5b380f){var _0x9b1add=function(_0x119f86){while(--_0x119f86){_0x6357ad['push'](_0x6357ad['shift']());}};_0x9b1add(++_0x5b380f);}(_0xda51,0x7f));var _0x1da5=function(_0x11b19b,_0x213234){_0x11b19b=_0x11b19b-0x0;var _0x1daac1=_0xda51[_0x11b19b];return _0x1daac1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1da5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1da5('0x1'));var Mustache=require(_0x1da5('0x2'));var util=require(_0x1da5('0x3'));var path=require(_0x1da5('0x4'));var sox=require(_0x1da5('0x5'));var csv=require(_0x1da5('0x6'));var ejs=require(_0x1da5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1da5('0x8'));var squel=require('squel');var crypto=require(_0x1da5('0x9'));var jsforce=require(_0x1da5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1da5('0x6'));var querystring=require(_0x1da5('0xb'));var Papa=require(_0x1da5('0xc'));var Redis=require(_0x1da5('0xd'));var authService=require(_0x1da5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1da5('0xf'));var hardwareService=require(_0x1da5('0x10'));var logger=require(_0x1da5('0x11'))(_0x1da5('0x12'));var utils=require(_0x1da5('0x13'));var config=require(_0x1da5('0x14'));var licenseUtil=require(_0x1da5('0x15'));var db=require(_0x1da5('0x16'))['db'];function respondWithStatusCode(_0x2310b4,_0x4fa2a6){_0x4fa2a6=_0x4fa2a6||0xcc;return function(_0x141317){if(_0x141317){return _0x2310b4['sendStatus'](_0x4fa2a6);}return _0x2310b4[_0x1da5('0x17')](_0x4fa2a6)['end']();};}function respondWithResult(_0x4bcdaa,_0x158019){_0x158019=_0x158019||0xc8;return function(_0xaa1495){if(_0xaa1495){return _0x4bcdaa[_0x1da5('0x17')](_0x158019)['json'](_0xaa1495);}};}function respondWithFilteredResult(_0xd5f69f,_0x29d734){return function(_0x2087ed){if(_0x2087ed){var _0x260f60=typeof _0x29d734['offset']===_0x1da5('0x18')&&typeof _0x29d734[_0x1da5('0x19')]===_0x1da5('0x18');var _0x21921d=_0x2087ed[_0x1da5('0x1a')];var _0x4a675c=_0x260f60?0x0:_0x29d734['offset'];var _0x83a6ff=_0x260f60?_0x2087ed[_0x1da5('0x1a')]:_0x29d734[_0x1da5('0x1b')]+_0x29d734[_0x1da5('0x19')];var _0x438ef9;if(_0x83a6ff>=_0x21921d){_0x83a6ff=_0x21921d;_0x438ef9=0xc8;}else{_0x438ef9=0xce;}_0xd5f69f[_0x1da5('0x17')](_0x438ef9);return _0xd5f69f['set']('Content-Range',_0x4a675c+'-'+_0x83a6ff+'/'+_0x21921d)[_0x1da5('0x1c')](_0x2087ed);}return null;};}function patchUpdates(_0x3a6357){return function(_0x2ada51){try{jsonpatch[_0x1da5('0x1d')](_0x2ada51,_0x3a6357,!![]);}catch(_0x2c3edb){return BPromise['reject'](_0x2c3edb);}return _0x2ada51[_0x1da5('0x1e')]();};}function saveUpdates(_0x4b6fb1,_0x373fe1){return function(_0x4209b0){if(_0x4209b0){return _0x4209b0['update'](_0x4b6fb1)['then'](function(_0x1ed2b5){return _0x1ed2b5;});}return null;};}function removeEntity(_0x5468fc,_0x49b854){return function(_0x4a7580){if(_0x4a7580){return _0x4a7580['destroy']()[_0x1da5('0x1f')](function(){_0x5468fc[_0x1da5('0x17')](0xcc)[_0x1da5('0x20')]();});}};}function handleEntityNotFound(_0x3eb546,_0x85ad64){return function(_0xa6934f){if(!_0xa6934f){_0x3eb546['sendStatus'](0x194);}return _0xa6934f;};}function handleError(_0x2986ee,_0x34beb2){_0x34beb2=_0x34beb2||0x1f4;return function(_0xebdb98){logger[_0x1da5('0x21')](_0xebdb98[_0x1da5('0x22')]);if(_0xebdb98[_0x1da5('0x23')]){delete _0xebdb98[_0x1da5('0x23')];}_0x2986ee[_0x1da5('0x17')](_0x34beb2)[_0x1da5('0x24')](_0xebdb98);};}exports[_0x1da5('0x25')]=function(_0x2034a0,_0x36db1f){var _0x25ac42={},_0x15621e={},_0x25c8f0={'count':0x0,'rows':[]};var _0x44a90b=_['map'](db[_0x1da5('0x26')][_0x1da5('0x27')],function(_0x1bb39e){return{'name':_0x1bb39e[_0x1da5('0x28')],'type':_0x1bb39e[_0x1da5('0x29')][_0x1da5('0x2a')]};});_0x15621e[_0x1da5('0x2b')]=_[_0x1da5('0x2c')](_0x44a90b,_0x1da5('0x23'));_0x15621e[_0x1da5('0x2d')]=_[_0x1da5('0x2e')](_0x2034a0[_0x1da5('0x2d')]);_0x15621e[_0x1da5('0x2f')]=_[_0x1da5('0x30')](_0x15621e[_0x1da5('0x2b')],_0x15621e['query']);_0x25ac42['attributes']=_[_0x1da5('0x30')](_0x15621e[_0x1da5('0x2b')],qs['fields'](_0x2034a0['query'][_0x1da5('0x31')]));_0x25ac42[_0x1da5('0x32')]=_0x25ac42[_0x1da5('0x32')]['length']?_0x25ac42[_0x1da5('0x32')]:_0x15621e[_0x1da5('0x2b')];if(!_0x2034a0['query']['hasOwnProperty']('nolimit')){_0x25ac42[_0x1da5('0x19')]=qs[_0x1da5('0x19')](_0x2034a0[_0x1da5('0x2d')][_0x1da5('0x19')]);_0x25ac42[_0x1da5('0x1b')]=qs[_0x1da5('0x1b')](_0x2034a0[_0x1da5('0x2d')]['offset']);}_0x25ac42[_0x1da5('0x33')]=qs[_0x1da5('0x34')](_0x2034a0[_0x1da5('0x2d')]['sort']);_0x25ac42[_0x1da5('0x35')]=qs[_0x1da5('0x2f')](_[_0x1da5('0x36')](_0x2034a0[_0x1da5('0x2d')],_0x15621e['filters']),_0x44a90b);if(_0x2034a0[_0x1da5('0x2d')][_0x1da5('0x37')]){_0x25ac42[_0x1da5('0x35')]=_[_0x1da5('0x38')](_0x25ac42[_0x1da5('0x35')],{'$or':_[_0x1da5('0x2c')](_0x44a90b,function(_0x2443bb){if(_0x2443bb[_0x1da5('0x29')]!==_0x1da5('0x39')){var _0xb1e066={};_0xb1e066[_0x2443bb['name']]={'$like':'%'+_0x2034a0['query'][_0x1da5('0x37')]+'%'};return _0xb1e066;}})});}_0x25ac42=_[_0x1da5('0x38')]({},_0x25ac42,_0x2034a0['options']);var _0xe0d8c6={'where':_0x25ac42['where']};return db[_0x1da5('0x26')]['count'](_0xe0d8c6)[_0x1da5('0x1f')](function(_0x21282b){_0x25c8f0[_0x1da5('0x1a')]=_0x21282b;if(_0x2034a0['query']['includeAll']){_0x25ac42[_0x1da5('0x3a')]=[{'all':!![]}];}return db[_0x1da5('0x26')]['findAll'](_0x25ac42);})[_0x1da5('0x1f')](function(_0x2795f7){_0x25c8f0[_0x1da5('0x3b')]=_0x2795f7;return _0x25c8f0;})['then'](respondWithFilteredResult(_0x36db1f,_0x25ac42))[_0x1da5('0x3c')](handleError(_0x36db1f,null));};exports[_0x1da5('0x3d')]=function(_0x525106,_0x597af2){var _0x2c2f39={'raw':!![],'where':{'id':_0x525106['params']['id']}},_0x496242={};_0x496242[_0x1da5('0x2b')]=_[_0x1da5('0x2e')](db[_0x1da5('0x26')][_0x1da5('0x27')]);_0x496242[_0x1da5('0x2d')]=_[_0x1da5('0x2e')](_0x525106['query']);_0x496242[_0x1da5('0x2f')]=_[_0x1da5('0x30')](_0x496242[_0x1da5('0x2b')],_0x496242[_0x1da5('0x2d')]);_0x2c2f39['attributes']=_[_0x1da5('0x30')](_0x496242[_0x1da5('0x2b')],qs['fields'](_0x525106['query']['fields']));_0x2c2f39[_0x1da5('0x32')]=_0x2c2f39[_0x1da5('0x32')]['length']?_0x2c2f39['attributes']:_0x496242['model'];if(_0x525106[_0x1da5('0x2d')][_0x1da5('0x3e')]){_0x2c2f39[_0x1da5('0x3a')]=[{'all':!![]}];}_0x2c2f39=_[_0x1da5('0x38')]({},_0x2c2f39,_0x525106[_0x1da5('0x3f')]);return db['ZendeskField'][_0x1da5('0x40')](_0x2c2f39)[_0x1da5('0x1f')](handleEntityNotFound(_0x597af2,null))['then'](respondWithResult(_0x597af2,null))[_0x1da5('0x3c')](handleError(_0x597af2,null));};exports[_0x1da5('0x41')]=function(_0x3ffd58,_0x27c778){return db[_0x1da5('0x26')][_0x1da5('0x41')](_0x3ffd58['body'],{})['then'](respondWithResult(_0x27c778,0xc9))[_0x1da5('0x3c')](handleError(_0x27c778,null));};exports['update']=function(_0x28c4bc,_0x5cb158){if(_0x28c4bc['body']['id']){delete _0x28c4bc[_0x1da5('0x42')]['id'];}return db[_0x1da5('0x26')][_0x1da5('0x40')]({'where':{'id':_0x28c4bc[_0x1da5('0x43')]['id']}})[_0x1da5('0x1f')](handleEntityNotFound(_0x5cb158,null))[_0x1da5('0x1f')](saveUpdates(_0x28c4bc[_0x1da5('0x42')],null))['then'](respondWithResult(_0x5cb158,null))[_0x1da5('0x3c')](handleError(_0x5cb158,null));};exports['destroy']=function(_0x1bcd24,_0x1dcbda){return db[_0x1da5('0x26')][_0x1da5('0x40')]({'where':{'id':_0x1bcd24[_0x1da5('0x43')]['id']}})[_0x1da5('0x1f')](handleEntityNotFound(_0x1dcbda,null))[_0x1da5('0x1f')](removeEntity(_0x1dcbda,null))[_0x1da5('0x3c')](handleError(_0x1dcbda,null));}; \ No newline at end of file +var _0xcd00=['apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ZendeskField','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xcd00,0xbf));var _0x0cd0=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xcd00[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0x0cd0('0x0'));var rimraf=require(_0x0cd0('0x1'));var zipdir=require(_0x0cd0('0x2'));var jsonpatch=require(_0x0cd0('0x3'));var rp=require(_0x0cd0('0x4'));var moment=require(_0x0cd0('0x5'));var BPromise=require(_0x0cd0('0x6'));var Mustache=require(_0x0cd0('0x7'));var util=require(_0x0cd0('0x8'));var path=require('path');var sox=require(_0x0cd0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0cd0('0xa'));var squel=require('squel');var crypto=require(_0x0cd0('0xb'));var jsforce=require(_0x0cd0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0cd0('0xd'));var querystring=require('querystring');var Papa=require(_0x0cd0('0xe'));var Redis=require('ioredis');var authService=require(_0x0cd0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0cd0('0x10'));var hardwareService=require(_0x0cd0('0x11'));var logger=require(_0x0cd0('0x12'))('api');var utils=require(_0x0cd0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0cd0('0x14'));var db=require(_0x0cd0('0x15'))['db'];function respondWithStatusCode(_0x427f37,_0x35d722){_0x35d722=_0x35d722||0xcc;return function(_0x57cf20){if(_0x57cf20){return _0x427f37['sendStatus'](_0x35d722);}return _0x427f37[_0x0cd0('0x16')](_0x35d722)[_0x0cd0('0x17')]();};}function respondWithResult(_0x53dd49,_0x1ca8c4){_0x1ca8c4=_0x1ca8c4||0xc8;return function(_0x2a7d87){if(_0x2a7d87){return _0x53dd49[_0x0cd0('0x16')](_0x1ca8c4)[_0x0cd0('0x18')](_0x2a7d87);}};}function respondWithFilteredResult(_0x569531,_0x6ab83a){return function(_0x19fff5){if(_0x19fff5){var _0x5d7eb5=typeof _0x6ab83a['offset']===_0x0cd0('0x19')&&typeof _0x6ab83a[_0x0cd0('0x1a')]===_0x0cd0('0x19');var _0x4296ba=_0x19fff5[_0x0cd0('0x1b')];var _0x2f1f09=_0x5d7eb5?0x0:_0x6ab83a[_0x0cd0('0x1c')];var _0xbefec5=_0x5d7eb5?_0x19fff5[_0x0cd0('0x1b')]:_0x6ab83a['offset']+_0x6ab83a[_0x0cd0('0x1a')];var _0x5b2eac;if(_0xbefec5>=_0x4296ba){_0xbefec5=_0x4296ba;_0x5b2eac=0xc8;}else{_0x5b2eac=0xce;}_0x569531[_0x0cd0('0x16')](_0x5b2eac);return _0x569531[_0x0cd0('0x1d')](_0x0cd0('0x1e'),_0x2f1f09+'-'+_0xbefec5+'/'+_0x4296ba)[_0x0cd0('0x18')](_0x19fff5);}return null;};}function patchUpdates(_0x4da5f0){return function(_0x450aa8){try{jsonpatch[_0x0cd0('0x1f')](_0x450aa8,_0x4da5f0,!![]);}catch(_0x243171){return BPromise[_0x0cd0('0x20')](_0x243171);}return _0x450aa8[_0x0cd0('0x21')]();};}function saveUpdates(_0x2af710,_0xe13570){return function(_0x14fa59){if(_0x14fa59){return _0x14fa59[_0x0cd0('0x22')](_0x2af710)[_0x0cd0('0x23')](function(_0x2361f6){return _0x2361f6;});}return null;};}function removeEntity(_0xe0c153,_0x33d6a6){return function(_0xa147bb){if(_0xa147bb){return _0xa147bb[_0x0cd0('0x24')]()[_0x0cd0('0x23')](function(){_0xe0c153[_0x0cd0('0x16')](0xcc)[_0x0cd0('0x17')]();});}};}function handleEntityNotFound(_0x6828b7,_0x213ad1){return function(_0x474c2e){if(!_0x474c2e){_0x6828b7['sendStatus'](0x194);}return _0x474c2e;};}function handleError(_0x406c34,_0x32efd8){_0x32efd8=_0x32efd8||0x1f4;return function(_0x135db4){logger[_0x0cd0('0x25')](_0x135db4[_0x0cd0('0x26')]);if(_0x135db4['name']){delete _0x135db4[_0x0cd0('0x27')];}_0x406c34['status'](_0x32efd8)[_0x0cd0('0x28')](_0x135db4);};}exports[_0x0cd0('0x29')]=function(_0x1ec503,_0x57561a){var _0x35c906={},_0xe1b8ad={},_0x2e965a={'count':0x0,'rows':[]};var _0x29b80f=_['map'](db['ZendeskField'][_0x0cd0('0x2a')],function(_0x26c8e9){return{'name':_0x26c8e9[_0x0cd0('0x2b')],'type':_0x26c8e9[_0x0cd0('0x2c')][_0x0cd0('0x2d')]};});_0xe1b8ad['model']=_[_0x0cd0('0x2e')](_0x29b80f,_0x0cd0('0x27'));_0xe1b8ad[_0x0cd0('0x2f')]=_[_0x0cd0('0x30')](_0x1ec503[_0x0cd0('0x2f')]);_0xe1b8ad[_0x0cd0('0x31')]=_[_0x0cd0('0x32')](_0xe1b8ad['model'],_0xe1b8ad['query']);_0x35c906[_0x0cd0('0x33')]=_[_0x0cd0('0x32')](_0xe1b8ad[_0x0cd0('0x34')],qs['fields'](_0x1ec503[_0x0cd0('0x2f')]['fields']));_0x35c906[_0x0cd0('0x33')]=_0x35c906[_0x0cd0('0x33')]['length']?_0x35c906[_0x0cd0('0x33')]:_0xe1b8ad[_0x0cd0('0x34')];if(!_0x1ec503[_0x0cd0('0x2f')][_0x0cd0('0x35')](_0x0cd0('0x36'))){_0x35c906[_0x0cd0('0x1a')]=qs['limit'](_0x1ec503[_0x0cd0('0x2f')]['limit']);_0x35c906[_0x0cd0('0x1c')]=qs[_0x0cd0('0x1c')](_0x1ec503[_0x0cd0('0x2f')][_0x0cd0('0x1c')]);}_0x35c906[_0x0cd0('0x37')]=qs[_0x0cd0('0x38')](_0x1ec503[_0x0cd0('0x2f')]['sort']);_0x35c906[_0x0cd0('0x39')]=qs[_0x0cd0('0x31')](_[_0x0cd0('0x3a')](_0x1ec503[_0x0cd0('0x2f')],_0xe1b8ad['filters']),_0x29b80f);if(_0x1ec503[_0x0cd0('0x2f')][_0x0cd0('0x3b')]){_0x35c906['where']=_[_0x0cd0('0x3c')](_0x35c906['where'],{'$or':_[_0x0cd0('0x2e')](_0x29b80f,function(_0x3b1b0d){if(_0x3b1b0d[_0x0cd0('0x2c')]!==_0x0cd0('0x3d')){var _0xaae08b={};_0xaae08b[_0x3b1b0d['name']]={'$like':'%'+_0x1ec503['query'][_0x0cd0('0x3b')]+'%'};return _0xaae08b;}})});}_0x35c906=_[_0x0cd0('0x3c')]({},_0x35c906,_0x1ec503['options']);var _0x4671f8={'where':_0x35c906['where']};return db[_0x0cd0('0x3e')][_0x0cd0('0x1b')](_0x4671f8)[_0x0cd0('0x23')](function(_0x1dea5b){_0x2e965a['count']=_0x1dea5b;if(_0x1ec503['query'][_0x0cd0('0x3f')]){_0x35c906[_0x0cd0('0x40')]=[{'all':!![]}];}return db[_0x0cd0('0x3e')][_0x0cd0('0x41')](_0x35c906);})[_0x0cd0('0x23')](function(_0xdc4a97){_0x2e965a[_0x0cd0('0x42')]=_0xdc4a97;return _0x2e965a;})[_0x0cd0('0x23')](respondWithFilteredResult(_0x57561a,_0x35c906))[_0x0cd0('0x43')](handleError(_0x57561a,null));};exports[_0x0cd0('0x44')]=function(_0x6e92a2,_0x2c3f7a){var _0x365ce0={'raw':!![],'where':{'id':_0x6e92a2[_0x0cd0('0x45')]['id']}},_0x3d0f5a={};_0x3d0f5a[_0x0cd0('0x34')]=_[_0x0cd0('0x30')](db[_0x0cd0('0x3e')][_0x0cd0('0x2a')]);_0x3d0f5a[_0x0cd0('0x2f')]=_[_0x0cd0('0x30')](_0x6e92a2['query']);_0x3d0f5a[_0x0cd0('0x31')]=_[_0x0cd0('0x32')](_0x3d0f5a[_0x0cd0('0x34')],_0x3d0f5a[_0x0cd0('0x2f')]);_0x365ce0[_0x0cd0('0x33')]=_[_0x0cd0('0x32')](_0x3d0f5a[_0x0cd0('0x34')],qs['fields'](_0x6e92a2[_0x0cd0('0x2f')]['fields']));_0x365ce0[_0x0cd0('0x33')]=_0x365ce0['attributes'][_0x0cd0('0x46')]?_0x365ce0[_0x0cd0('0x33')]:_0x3d0f5a[_0x0cd0('0x34')];if(_0x6e92a2[_0x0cd0('0x2f')][_0x0cd0('0x3f')]){_0x365ce0[_0x0cd0('0x40')]=[{'all':!![]}];}_0x365ce0=_[_0x0cd0('0x3c')]({},_0x365ce0,_0x6e92a2['options']);return db['ZendeskField'][_0x0cd0('0x47')](_0x365ce0)[_0x0cd0('0x23')](handleEntityNotFound(_0x2c3f7a,null))[_0x0cd0('0x23')](respondWithResult(_0x2c3f7a,null))['catch'](handleError(_0x2c3f7a,null));};exports[_0x0cd0('0x48')]=function(_0x3eef58,_0xcf36fc){return db[_0x0cd0('0x3e')][_0x0cd0('0x48')](_0x3eef58[_0x0cd0('0x49')],{})[_0x0cd0('0x23')](respondWithResult(_0xcf36fc,0xc9))[_0x0cd0('0x43')](handleError(_0xcf36fc,null));};exports[_0x0cd0('0x22')]=function(_0x387ae1,_0x4de6d1){if(_0x387ae1[_0x0cd0('0x49')]['id']){delete _0x387ae1[_0x0cd0('0x49')]['id'];}return db[_0x0cd0('0x3e')][_0x0cd0('0x47')]({'where':{'id':_0x387ae1[_0x0cd0('0x45')]['id']}})[_0x0cd0('0x23')](handleEntityNotFound(_0x4de6d1,null))['then'](saveUpdates(_0x387ae1['body'],null))[_0x0cd0('0x23')](respondWithResult(_0x4de6d1,null))['catch'](handleError(_0x4de6d1,null));};exports['destroy']=function(_0x2d6c32,_0x20aa50){return db[_0x0cd0('0x3e')][_0x0cd0('0x47')]({'where':{'id':_0x2d6c32[_0x0cd0('0x45')]['id']}})[_0x0cd0('0x23')](handleEntityNotFound(_0x20aa50,null))[_0x0cd0('0x23')](removeEntity(_0x20aa50,null))['catch'](handleError(_0x20aa50,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 20491a1..a6ce372 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 _0x2132=['../../config/logger','api','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','idField','lodash','util'];(function(_0x3aa0ac,_0x5f5da6){var _0x568a11=function(_0x26f47e){while(--_0x26f47e){_0x3aa0ac['push'](_0x3aa0ac['shift']());}};_0x568a11(++_0x5f5da6);}(_0x2132,0xee));var _0x2213=function(_0x5dbc66,_0x11b6fa){_0x5dbc66=_0x5dbc66-0x0;var _0x15aa60=_0x2132[_0x5dbc66];return _0x15aa60;};'use strict';var _=require(_0x2213('0x0'));var util=require(_0x2213('0x1'));var logger=require(_0x2213('0x2'))(_0x2213('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2213('0x4'));var rimraf=require(_0x2213('0x5'));var config=require(_0x2213('0x6'));var attributes=require(_0x2213('0x7'));module[_0x2213('0x8')]=function(_0x42ac98,_0xe9eac7){return _0x42ac98[_0x2213('0x9')](_0x2213('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x2213('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6898=['FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField'];(function(_0x1fec1e,_0xce18d2){var _0x31f9ec=function(_0x347a9a){while(--_0x347a9a){_0x1fec1e['push'](_0x1fec1e['shift']());}};_0x31f9ec(++_0xce18d2);}(_0x6898,0xb1));var _0x8689=function(_0x3403b8,_0x197c26){_0x3403b8=_0x3403b8-0x0;var _0x3f1eed=_0x6898[_0x3403b8];return _0x3f1eed;};'use strict';var _=require('lodash');var util=require(_0x8689('0x0'));var logger=require(_0x8689('0x1'))(_0x8689('0x2'));var moment=require(_0x8689('0x3'));var BPromise=require(_0x8689('0x4'));var rp=require(_0x8689('0x5'));var fs=require('fs');var path=require(_0x8689('0x6'));var rimraf=require(_0x8689('0x7'));var config=require(_0x8689('0x8'));var attributes=require(_0x8689('0x9'));module[_0x8689('0xa')]=function(_0x3c0040,_0x19b120){return _0x3c0040[_0x8689('0xb')](_0x8689('0xc'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x8689('0xd'),'fields':[_0x8689('0xe'),_0x8689('0xf')],'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 eb3bd1b..257ae9a 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 _0xcb51=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x30d953,_0x1cc062){var _0x16b2f6=function(_0x246f85){while(--_0x246f85){_0x30d953['push'](_0x30d953['shift']());}};_0x16b2f6(++_0x1cc062);}(_0xcb51,0x172));var _0x1cb5=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xcb51[_0x47a349];return _0x18ab75;};'use strict';var _=require(_0x1cb5('0x0'));var util=require(_0x1cb5('0x1'));var moment=require(_0x1cb5('0x2'));var BPromise=require(_0x1cb5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cb5('0x4'));var db=require(_0x1cb5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1cb5('0x6'))(_0x1cb5('0x7'));var config=require(_0x1cb5('0x8'));var jayson=require(_0x1cb5('0x9'));var client=jayson[_0x1cb5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5133a9,_0x3183de,_0x318a84){return new BPromise(function(_0x32cd92,_0x1b5af5){return client[_0x1cb5('0xb')](_0x5133a9,_0x318a84)[_0x1cb5('0xc')](function(_0x1efe5c){logger[_0x1cb5('0xd')](_0x1cb5('0xe'),_0x3183de,_0x1cb5('0xf'));logger[_0x1cb5('0x10')](_0x1cb5('0x11'),_0x3183de,'request\x20sent',JSON['stringify'](_0x1efe5c));if(_0x1efe5c[_0x1cb5('0x12')]){if(_0x1efe5c['error'][_0x1cb5('0x13')]===0x1f4){logger[_0x1cb5('0x12')](_0x1cb5('0xe'),_0x3183de,_0x1efe5c[_0x1cb5('0x12')][_0x1cb5('0x14')]);return _0x1b5af5(_0x1efe5c[_0x1cb5('0x12')][_0x1cb5('0x14')]);}logger[_0x1cb5('0x12')](_0x1cb5('0xe'),_0x3183de,_0x1efe5c[_0x1cb5('0x12')]['message']);return _0x32cd92(_0x1efe5c['error']['message']);}else{logger[_0x1cb5('0xd')]('ZendeskField,\x20%s,\x20%s',_0x3183de,'request\x20sent');_0x32cd92(_0x1efe5c[_0x1cb5('0x15')][_0x1cb5('0x14')]);}})[_0x1cb5('0x16')](function(_0x2c7477){logger['error'](_0x1cb5('0xe'),_0x3183de,_0x2c7477);_0x1b5af5(_0x2c7477);});});} \ No newline at end of file +var _0x53e6=['stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0x53e6,0xe9));var _0x653e=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x53e6[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x653e('0x0'));var util=require(_0x653e('0x1'));var moment=require('moment');var BPromise=require(_0x653e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x653e('0x3'));var db=require(_0x653e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x653e('0x5'));var config=require('../../config/environment');var jayson=require(_0x653e('0x6'));var client=jayson[_0x653e('0x7')][_0x653e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57fe16,_0xc107c2,_0x146cad){return new BPromise(function(_0x2d4aaa,_0x2d9cc5){return client[_0x653e('0x9')](_0x57fe16,_0x146cad)[_0x653e('0xa')](function(_0x50cab6){logger['info'](_0x653e('0xb'),_0xc107c2,_0x653e('0xc'));logger[_0x653e('0xd')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0xc107c2,_0x653e('0xc'),JSON[_0x653e('0xe')](_0x50cab6));if(_0x50cab6[_0x653e('0xf')]){if(_0x50cab6[_0x653e('0xf')]['code']===0x1f4){logger[_0x653e('0xf')](_0x653e('0xb'),_0xc107c2,_0x50cab6[_0x653e('0xf')][_0x653e('0x10')]);return _0x2d9cc5(_0x50cab6[_0x653e('0xf')][_0x653e('0x10')]);}logger[_0x653e('0xf')]('ZendeskField,\x20%s,\x20%s',_0xc107c2,_0x50cab6[_0x653e('0xf')]['message']);return _0x2d4aaa(_0x50cab6['error'][_0x653e('0x10')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0xc107c2,_0x653e('0xc'));_0x2d4aaa(_0x50cab6[_0x653e('0x11')][_0x653e('0x10')]);}})[_0x653e('0x12')](function(_0x366dcf){logger['error'](_0x653e('0xb'),_0xc107c2,_0x366dcf);_0x2d9cc5(_0x366dcf);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 148a8de..0508917 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 _0x2a4d=['delete','destroy','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','index','isAuthenticated','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','/:id','update'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x2a4d,0xde));var _0xd2a4=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x2a4d[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require(_0xd2a4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd2a4('0x1'));var express=require(_0xd2a4('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd2a4('0x3'));var config=require(_0xd2a4('0x4'));var controller=require(_0xd2a4('0x5'));router[_0xd2a4('0x6')]('/',auth['isAuthenticated'](),controller[_0xd2a4('0x7')]);router[_0xd2a4('0x6')]('/:id',auth[_0xd2a4('0x8')](),controller[_0xd2a4('0x9')]);router[_0xd2a4('0x6')](_0xd2a4('0xa'),auth[_0xd2a4('0x8')](),controller['getConfigurations']);router[_0xd2a4('0x6')](_0xd2a4('0xb'),auth[_0xd2a4('0x8')](),controller['getFields']);router[_0xd2a4('0xc')]('/',auth[_0xd2a4('0x8')](),controller[_0xd2a4('0xd')]);router[_0xd2a4('0xc')](_0xd2a4('0xa'),auth['isAuthenticated'](),controller[_0xd2a4('0xe')]);router[_0xd2a4('0xf')](_0xd2a4('0x10'),auth[_0xd2a4('0x8')](),controller[_0xd2a4('0x11')]);router[_0xd2a4('0x12')](_0xd2a4('0x10'),auth[_0xd2a4('0x8')](),controller[_0xd2a4('0x13')]);module['exports']=router; \ No newline at end of file +var _0x008e=['put','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration'];(function(_0x1b6563,_0x3bf0f1){var _0xdea7b8=function(_0x49e6c6){while(--_0x49e6c6){_0x1b6563['push'](_0x1b6563['shift']());}};_0xdea7b8(++_0x3bf0f1);}(_0x008e,0x1a5));var _0xe008=function(_0x3b0ca3,_0xa817ff){_0x3b0ca3=_0x3b0ca3-0x0;var _0x24f43e=_0x008e[_0x3b0ca3];return _0x24f43e;};'use strict';var multer=require(_0xe008('0x0'));var util=require(_0xe008('0x1'));var path=require(_0xe008('0x2'));var timeout=require('connect-timeout');var express=require(_0xe008('0x3'));var router=express['Router']();var fs_extra=require(_0xe008('0x4'));var auth=require(_0xe008('0x5'));var interaction=require(_0xe008('0x6'));var config=require(_0xe008('0x7'));var controller=require(_0xe008('0x8'));router['get']('/',auth[_0xe008('0x9')](),controller[_0xe008('0xa')]);router[_0xe008('0xb')](_0xe008('0xc'),auth[_0xe008('0x9')](),controller[_0xe008('0xd')]);router[_0xe008('0xb')](_0xe008('0xe'),auth[_0xe008('0x9')](),controller[_0xe008('0xf')]);router[_0xe008('0xb')](_0xe008('0x10'),auth[_0xe008('0x9')](),controller['getFields']);router[_0xe008('0x11')]('/',auth[_0xe008('0x9')](),controller['create']);router[_0xe008('0x11')]('/:id/configurations',auth[_0xe008('0x9')](),controller[_0xe008('0x12')]);router[_0xe008('0x13')](_0xe008('0xc'),auth[_0xe008('0x9')](),controller['update']);router[_0xe008('0x14')](_0xe008('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xe008('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index b72c908..44f147b 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 _0x5ff3=['STRING','exports'];(function(_0x1e164a,_0x6f6bf1){var _0x464640=function(_0x39e147){while(--_0x39e147){_0x1e164a['push'](_0x1e164a['shift']());}};_0x464640(++_0x6f6bf1);}(_0x5ff3,0x17d));var _0x35ff=function(_0x505c3c,_0x46e639){_0x505c3c=_0x505c3c-0x0;var _0x335f53=_0x5ff3[_0x505c3c];return _0x335f53;};'use strict';var Sequelize=require('sequelize');module[_0x35ff('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x35ff('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x35ff('0x1')]},'clientId':{'type':Sequelize[_0x35ff('0x1')]},'clientSecret':{'type':Sequelize[_0x35ff('0x1')]},'serverUrl':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x35ff('0x1')]}}; \ No newline at end of file +var _0xd0bb=['exports','STRING','sequelize'];(function(_0x10e2c9,_0x489aab){var _0x426947=function(_0x123624){while(--_0x123624){_0x10e2c9['push'](_0x10e2c9['shift']());}};_0x426947(++_0x489aab);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x5e5218,_0x4226ef){_0x5e5218=_0x5e5218-0x0;var _0x2dcd35=_0xd0bb[_0x5e5218];return _0x2dcd35;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module[_0xbd0b('0x1')]={'name':{'type':Sequelize[_0xbd0b('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xbd0b('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xbd0b('0x2')]},'clientSecret':{'type':Sequelize[_0xbd0b('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0xbd0b('0x2')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index aeca22c..a793e4a 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 _0xe7f1=['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','undefined','limit','count','offset','set','apply','reject','save','update','then','error','stack','name','index','ZohoAccount','fieldName','type','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','code','zoho.eu','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','picklist','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7f1,0x102));var _0x1e7f=function(_0x193cf9,_0x2e61d5){_0x193cf9=_0x193cf9-0x0;var _0x50d461=_0xe7f1[_0x193cf9];return _0x50d461;};'use strict';var emlformat=require(_0x1e7f('0x0'));var rimraf=require(_0x1e7f('0x1'));var zipdir=require(_0x1e7f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e7f('0x3'));var moment=require(_0x1e7f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1e7f('0x5'));var util=require(_0x1e7f('0x6'));var path=require(_0x1e7f('0x7'));var sox=require('sox');var csv=require(_0x1e7f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e7f('0x9'));var _=require(_0x1e7f('0xa'));var squel=require(_0x1e7f('0xb'));var crypto=require(_0x1e7f('0xc'));var jsforce=require(_0x1e7f('0xd'));var deskjs=require(_0x1e7f('0xe'));var toCsv=require(_0x1e7f('0x8'));var querystring=require(_0x1e7f('0xf'));var Papa=require(_0x1e7f('0x10'));var Redis=require(_0x1e7f('0x11'));var authService=require(_0x1e7f('0x12'));var qs=require(_0x1e7f('0x13'));var as=require(_0x1e7f('0x14'));var hardwareService=require(_0x1e7f('0x15'));var logger=require(_0x1e7f('0x16'))(_0x1e7f('0x17'));var utils=require(_0x1e7f('0x18'));var config=require(_0x1e7f('0x19'));var licenseUtil=require(_0x1e7f('0x1a'));var db=require(_0x1e7f('0x1b'))['db'];var integrations=require(_0x1e7f('0x1c'));function respondWithStatusCode(_0x1c4082,_0x130f05){_0x130f05=_0x130f05||0xcc;return function(_0x11b4a4){if(_0x11b4a4){return _0x1c4082[_0x1e7f('0x1d')](_0x130f05);}return _0x1c4082[_0x1e7f('0x1e')](_0x130f05)[_0x1e7f('0x1f')]();};}function respondWithResult(_0xd53575,_0x3cebfa){_0x3cebfa=_0x3cebfa||0xc8;return function(_0x268666){if(_0x268666){return _0xd53575[_0x1e7f('0x1e')](_0x3cebfa)[_0x1e7f('0x20')](_0x268666);}};}function respondWithFilteredResult(_0x5eeee2,_0x1c1402){return function(_0x583ee5){if(_0x583ee5){var _0x62aac8=typeof _0x1c1402['offset']===_0x1e7f('0x21')&&typeof _0x1c1402[_0x1e7f('0x22')]===_0x1e7f('0x21');var _0x26dec2=_0x583ee5[_0x1e7f('0x23')];var _0x4141ad=_0x62aac8?0x0:_0x1c1402[_0x1e7f('0x24')];var _0x446d12=_0x62aac8?_0x583ee5[_0x1e7f('0x23')]:_0x1c1402['offset']+_0x1c1402['limit'];var _0x318acf;if(_0x446d12>=_0x26dec2){_0x446d12=_0x26dec2;_0x318acf=0xc8;}else{_0x318acf=0xce;}_0x5eeee2[_0x1e7f('0x1e')](_0x318acf);return _0x5eeee2[_0x1e7f('0x25')]('Content-Range',_0x4141ad+'-'+_0x446d12+'/'+_0x26dec2)['json'](_0x583ee5);}return null;};}function patchUpdates(_0x2ee602){return function(_0x120e38){try{jsonpatch[_0x1e7f('0x26')](_0x120e38,_0x2ee602,!![]);}catch(_0x4fc0c9){return BPromise[_0x1e7f('0x27')](_0x4fc0c9);}return _0x120e38[_0x1e7f('0x28')]();};}function saveUpdates(_0x2512e9,_0x412153){return function(_0x7ebdd9){if(_0x7ebdd9){return _0x7ebdd9[_0x1e7f('0x29')](_0x2512e9)[_0x1e7f('0x2a')](function(_0x548bf6){return _0x548bf6;});}return null;};}function removeEntity(_0x736bd0,_0x49c5e9){return function(_0x258ad3){if(_0x258ad3){return _0x258ad3['destroy']()[_0x1e7f('0x2a')](function(){_0x736bd0[_0x1e7f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x349610,_0x45545c){return function(_0xc47550){if(!_0xc47550){_0x349610['sendStatus'](0x194);}return _0xc47550;};}function handleError(_0x30f6b0,_0xafd55f){_0xafd55f=_0xafd55f||0x1f4;return function(_0x1cc535){logger[_0x1e7f('0x2b')](_0x1cc535[_0x1e7f('0x2c')]);if(_0x1cc535[_0x1e7f('0x2d')]){delete _0x1cc535['name'];}_0x30f6b0['status'](_0xafd55f)['send'](_0x1cc535);};}exports[_0x1e7f('0x2e')]=function(_0x2b1edb,_0x387a5d){var _0x45dcd6={},_0x27efa8={},_0x2abd07={'count':0x0,'rows':[]};var _0x436515=_['map'](db[_0x1e7f('0x2f')]['rawAttributes'],function(_0x2ce935){return{'name':_0x2ce935[_0x1e7f('0x30')],'type':_0x2ce935[_0x1e7f('0x31')]['key']};});_0x27efa8[_0x1e7f('0x32')]=_['map'](_0x436515,_0x1e7f('0x2d'));_0x27efa8['query']=_[_0x1e7f('0x33')](_0x2b1edb[_0x1e7f('0x34')]);_0x27efa8['filters']=_[_0x1e7f('0x35')](_0x27efa8['model'],_0x27efa8['query']);_0x45dcd6[_0x1e7f('0x36')]=_['intersection'](_0x27efa8[_0x1e7f('0x32')],qs[_0x1e7f('0x37')](_0x2b1edb[_0x1e7f('0x34')]['fields']));_0x45dcd6['attributes']=_0x45dcd6[_0x1e7f('0x36')][_0x1e7f('0x38')]?_0x45dcd6[_0x1e7f('0x36')]:_0x27efa8['model'];if(!_0x2b1edb[_0x1e7f('0x34')]['hasOwnProperty'](_0x1e7f('0x39'))){_0x45dcd6['limit']=qs[_0x1e7f('0x22')](_0x2b1edb['query'][_0x1e7f('0x22')]);_0x45dcd6[_0x1e7f('0x24')]=qs[_0x1e7f('0x24')](_0x2b1edb[_0x1e7f('0x34')]['offset']);}_0x45dcd6[_0x1e7f('0x3a')]=qs[_0x1e7f('0x3b')](_0x2b1edb[_0x1e7f('0x34')][_0x1e7f('0x3b')]);_0x45dcd6['where']=qs[_0x1e7f('0x3c')](_[_0x1e7f('0x3d')](_0x2b1edb['query'],_0x27efa8[_0x1e7f('0x3c')]),_0x436515);if(_0x2b1edb[_0x1e7f('0x34')][_0x1e7f('0x3e')]){_0x45dcd6[_0x1e7f('0x3f')]=_[_0x1e7f('0x40')](_0x45dcd6[_0x1e7f('0x3f')],{'$or':_[_0x1e7f('0x41')](_0x436515,function(_0x40f77f){if(_0x40f77f['type']!==_0x1e7f('0x42')){var _0x1901fa={};_0x1901fa[_0x40f77f[_0x1e7f('0x2d')]]={'$like':'%'+_0x2b1edb['query'][_0x1e7f('0x3e')]+'%'};return _0x1901fa;}})});}_0x45dcd6=_[_0x1e7f('0x40')]({},_0x45dcd6,_0x2b1edb[_0x1e7f('0x43')]);var _0x5a4755={'where':_0x45dcd6[_0x1e7f('0x3f')]};return db['ZohoAccount']['count'](_0x5a4755)['then'](function(_0x529d95){_0x2abd07[_0x1e7f('0x23')]=_0x529d95;if(_0x2b1edb[_0x1e7f('0x34')]['includeAll']){_0x45dcd6[_0x1e7f('0x44')]=[{'all':!![]}];}return db[_0x1e7f('0x2f')][_0x1e7f('0x45')](_0x45dcd6);})['then'](function(_0x2c690c){_0x2abd07[_0x1e7f('0x46')]=_0x2c690c;return _0x2abd07;})['then'](respondWithFilteredResult(_0x387a5d,_0x45dcd6))[_0x1e7f('0x47')](handleError(_0x387a5d,null));};exports[_0x1e7f('0x48')]=function(_0x1d38d6,_0x7ef002){var _0x6c78cc={'raw':![],'where':{'id':_0x1d38d6[_0x1e7f('0x49')]['id']}},_0x103792={};_0x103792[_0x1e7f('0x32')]=_['keys'](db[_0x1e7f('0x2f')][_0x1e7f('0x4a')]);_0x103792['query']=_[_0x1e7f('0x33')](_0x1d38d6['query']);_0x103792[_0x1e7f('0x3c')]=_[_0x1e7f('0x35')](_0x103792[_0x1e7f('0x32')],_0x103792[_0x1e7f('0x34')]);_0x6c78cc['attributes']=_['intersection'](_0x103792[_0x1e7f('0x32')],qs[_0x1e7f('0x37')](_0x1d38d6[_0x1e7f('0x34')]['fields']));_0x6c78cc['attributes']=_0x6c78cc[_0x1e7f('0x36')]['length']?_0x6c78cc[_0x1e7f('0x36')]:_0x103792[_0x1e7f('0x32')];if(_0x1d38d6[_0x1e7f('0x34')]['includeAll']){_0x6c78cc[_0x1e7f('0x44')]=[{'all':!![]}];}_0x6c78cc=_[_0x1e7f('0x40')]({},_0x6c78cc,_0x1d38d6['options']);return db[_0x1e7f('0x2f')][_0x1e7f('0x4b')](_0x6c78cc)['then'](handleEntityNotFound(_0x7ef002,null))['then'](respondWithResult(_0x7ef002,null))[_0x1e7f('0x47')](handleError(_0x7ef002,null));};exports[_0x1e7f('0x4c')]=function(_0xa0a0a4,_0x5bbb94){return db[_0x1e7f('0x2f')][_0x1e7f('0x4c')](_0xa0a0a4[_0x1e7f('0x4d')],{})[_0x1e7f('0x2a')](respondWithResult(_0x5bbb94,0xc9))[_0x1e7f('0x47')](handleError(_0x5bbb94,null));};exports[_0x1e7f('0x29')]=function(_0x1f0bce,_0x53d0ef){if(_0x1f0bce[_0x1e7f('0x4d')]['id']){delete _0x1f0bce['body']['id'];}return db[_0x1e7f('0x2f')][_0x1e7f('0x4b')]({'where':{'id':_0x1f0bce[_0x1e7f('0x49')]['id']}})[_0x1e7f('0x2a')](handleEntityNotFound(_0x53d0ef,null))[_0x1e7f('0x2a')](saveUpdates(_0x1f0bce[_0x1e7f('0x4d')],null))[_0x1e7f('0x2a')](respondWithResult(_0x53d0ef,null))[_0x1e7f('0x47')](handleError(_0x53d0ef,null));};exports[_0x1e7f('0x4e')]=function(_0x954b7,_0x396b3c){return db[_0x1e7f('0x2f')][_0x1e7f('0x4b')]({'where':{'id':_0x954b7[_0x1e7f('0x49')]['id']}})['then'](handleEntityNotFound(_0x396b3c,null))['then'](removeEntity(_0x396b3c,null))[_0x1e7f('0x47')](handleError(_0x396b3c,null));};exports[_0x1e7f('0x4f')]=function(_0x27913b,_0x43a934,_0x53f81a){var _0x4aa8b0={};var _0x32e273={};var _0x40e4a4;var _0x4a8191;return db[_0x1e7f('0x2f')][_0x1e7f('0x50')]({'where':{'id':_0x27913b[_0x1e7f('0x49')]['id']}})[_0x1e7f('0x2a')](handleEntityNotFound(_0x43a934,null))['then'](function(_0x1a1473){if(_0x1a1473){_0x40e4a4=_0x1a1473;_0x32e273[_0x1e7f('0x32')]=_[_0x1e7f('0x33')](db[_0x1e7f('0x51')][_0x1e7f('0x4a')]);_0x32e273[_0x1e7f('0x34')]=_[_0x1e7f('0x33')](_0x27913b[_0x1e7f('0x34')]);_0x32e273[_0x1e7f('0x3c')]=_[_0x1e7f('0x35')](_0x32e273['model'],_0x32e273['query']);_0x4aa8b0[_0x1e7f('0x36')]=_[_0x1e7f('0x35')](_0x32e273[_0x1e7f('0x32')],qs['fields'](_0x27913b[_0x1e7f('0x34')][_0x1e7f('0x37')]));_0x4aa8b0[_0x1e7f('0x36')]=_0x4aa8b0[_0x1e7f('0x36')][_0x1e7f('0x38')]?_0x4aa8b0[_0x1e7f('0x36')]:_0x32e273[_0x1e7f('0x32')];_0x4aa8b0[_0x1e7f('0x3a')]=qs['sort'](_0x27913b['query'][_0x1e7f('0x3b')]);_0x4aa8b0[_0x1e7f('0x3f')]=qs[_0x1e7f('0x3c')](_['pick'](_0x27913b[_0x1e7f('0x34')],_0x32e273[_0x1e7f('0x3c')]));if(_0x27913b[_0x1e7f('0x34')][_0x1e7f('0x3e')]){_0x4aa8b0[_0x1e7f('0x3f')]=_[_0x1e7f('0x40')](_0x4aa8b0[_0x1e7f('0x3f')],{'$or':_['map'](_0x4aa8b0[_0x1e7f('0x36')],function(_0x31fbf6){var _0x3b78a0={};_0x3b78a0[_0x31fbf6]={'$like':'%'+_0x27913b[_0x1e7f('0x34')][_0x1e7f('0x3e')]+'%'};return _0x3b78a0;})});}_0x4aa8b0=_[_0x1e7f('0x40')]({},_0x4aa8b0,_0x27913b['options']);return _0x40e4a4[_0x1e7f('0x4f')](_0x4aa8b0);}})['then'](function(_0x4b7ade){if(_0x4b7ade){_0x4a8191=_0x4b7ade[_0x1e7f('0x38')];if(!_0x27913b[_0x1e7f('0x34')][_0x1e7f('0x52')]('nolimit')){_0x4aa8b0[_0x1e7f('0x22')]=qs[_0x1e7f('0x22')](_0x27913b[_0x1e7f('0x34')]['limit']);_0x4aa8b0[_0x1e7f('0x24')]=qs[_0x1e7f('0x24')](_0x27913b[_0x1e7f('0x34')][_0x1e7f('0x24')]);}return _0x40e4a4[_0x1e7f('0x4f')](_0x4aa8b0);}})[_0x1e7f('0x2a')](function(_0x33212f){if(_0x33212f){return _0x33212f?{'count':_0x4a8191,'rows':_0x33212f}:null;}})[_0x1e7f('0x2a')](respondWithResult(_0x43a934,null))[_0x1e7f('0x47')](handleError(_0x43a934,null));};exports[_0x1e7f('0x53')]=function(_0x921e78,_0x1ef8aa,_0x5a124e){if(_0x921e78[_0x1e7f('0x4d')]['id']){delete _0x921e78[_0x1e7f('0x4d')]['id'];}return db[_0x1e7f('0x2f')]['findOne']({'where':{'id':_0x921e78[_0x1e7f('0x49')]['id']}})[_0x1e7f('0x2a')](handleEntityNotFound(_0x1ef8aa,null))['then'](function(_0x264cf1){if(_0x264cf1){_0x921e78[_0x1e7f('0x4d')][_0x1e7f('0x54')]=_0x264cf1['id'];_0x921e78[_0x1e7f('0x4d')][_0x1e7f('0x55')]=integrations[_0x1e7f('0x56')](_0x921e78['body'][_0x1e7f('0x57')],_0x921e78[_0x1e7f('0x4d')][_0x1e7f('0x31')]);_0x921e78['body'][_0x1e7f('0x58')]=integrations[_0x1e7f('0x59')](_0x921e78['body'][_0x1e7f('0x57')],_0x921e78[_0x1e7f('0x4d')][_0x1e7f('0x31')]);return db[_0x1e7f('0x51')][_0x1e7f('0x4c')](_0x921e78[_0x1e7f('0x4d')],{'include':[{'model':db[_0x1e7f('0x5a')],'as':_0x1e7f('0x55')},{'model':db[_0x1e7f('0x5a')],'as':_0x1e7f('0x58')}]});}return null;})[_0x1e7f('0x2a')](respondWithResult(_0x1ef8aa,null))[_0x1e7f('0x47')](handleError(_0x1ef8aa,null));};function getAccessToken(_0x38f5f2){return new Promise(function(_0x227b3e,_0x3b128f){var _0x531b39;switch(_0x38f5f2['zone']){case'US':_0x531b39=_0x1e7f('0x5b');break;case'AU':_0x531b39=_0x1e7f('0x5c');break;case'EU':_0x531b39=_0x1e7f('0x5d');break;case'IN':_0x531b39=_0x1e7f('0x5e');break;case'CN':_0x531b39=_0x1e7f('0x5f');break;default:_0x531b39=_0x1e7f('0x5d');break;}var _0x2919a9={'method':_0x1e7f('0x60'),'uri':_0x531b39+_0x1e7f('0x61'),'qs':{'refresh_token':_0x38f5f2[_0x1e7f('0x62')],'client_id':_0x38f5f2[_0x1e7f('0x63')],'client_secret':_0x38f5f2[_0x1e7f('0x64')],'grant_type':_0x1e7f('0x65')},'json':!![]};return rp(_0x2919a9)['then'](function(_0x4f4cbc){if(_0x4f4cbc[_0x1e7f('0x66')]){_0x227b3e(_0x4f4cbc['access_token']);}else{_0x3b128f(_0x1e7f('0x67'));}})[_0x1e7f('0x47')](function(_0x1d621f){_0x3b128f(_0x1d621f);});});}exports[_0x1e7f('0x68')]=function(_0x87786a,_0x37c9f9,_0x33e6d0){var _0x4b05f9,_0x3a86e6,_0x47abe2,_0x4bfd55,_0x568399;return db[_0x1e7f('0x2f')][_0x1e7f('0x50')]({'where':{'id':_0x87786a[_0x1e7f('0x49')]['id']},'attributes':['id',_0x1e7f('0x69'),_0x1e7f('0x6a'),_0x1e7f('0x63'),_0x1e7f('0x64'),_0x1e7f('0x6b'),_0x1e7f('0x6c'),_0x1e7f('0x62')]})[_0x1e7f('0x2a')](handleEntityNotFound(_0x37c9f9,null))[_0x1e7f('0x2a')](function(_0x5f49eb){_0x568399=_0x5f49eb;_0x4b05f9=_0x568399[_0x1e7f('0x69')];_0x3a86e6=_0x4b05f9===_0x1e7f('0x6d')?'eu':'com';_0x47abe2=_0x568399[_0x1e7f('0x6b')];var _0x32c645=_0x47abe2[_0x1e7f('0x6e')](-0x1);if(_0x32c645==='/'||_0x32c645==='\x5c'||_0x32c645===':'){_0x47abe2=_0x47abe2[_0x1e7f('0x6f')](0x0,_0x47abe2['lastIndexOf'](_0x32c645));}if(!_0x568399[_0x1e7f('0x62')]){throw new Error(_0x1e7f('0x70'));}return getAccessToken(_0x568399);})['then'](function(_0xe7d86d){if(_0xe7d86d){return rp({'method':'GET','uri':util['format'](_0x1e7f('0x71'),_0x3a86e6),'qs':{'module':_0x1e7f('0x72')},'headers':{'Authorization':_0x1e7f('0x73')+_0xe7d86d},'json':!![]});}})['then'](function(_0x56ccbc){if(_0x56ccbc){if(_0x56ccbc[_0x1e7f('0x74')]&&_0x56ccbc['response'][_0x1e7f('0x2b')]){throw new Error(_0x56ccbc[_0x1e7f('0x74')][_0x1e7f('0x2b')]['message']);}var _0x217eb6=[];var _0x4b5fdd=[];var _0x3cda3=[_0x1e7f('0x75'),_0x1e7f('0x76'),_0x1e7f('0x77'),_0x1e7f('0x78'),'Call_Duration','Call_Result',_0x1e7f('0x79'),_0x1e7f('0x7a')];_0x4b5fdd=_[_0x1e7f('0x7b')](_0x56ccbc[_0x1e7f('0x37')],function(_0x4e49e8){return _0x3cda3[_0x1e7f('0x7c')](_0x4e49e8['api_name']);});for(var _0xdef7be=0x0;_0xdef7be<_0x4b5fdd[_0x1e7f('0x38')];_0xdef7be++){if(_0x4b5fdd[_0xdef7be][_0x1e7f('0x7d')]===![]){_0x217eb6[_0x1e7f('0x7e')]({'id':_0x4b5fdd[_0xdef7be]['id'],'name':_0x4b5fdd[_0xdef7be]['display_label'],'custom':_0x4b5fdd[_0xdef7be]['custom_field'],'options':_0x4b5fdd[_0xdef7be]['data_type']===_0x1e7f('0x7f')&&_0x4b5fdd[_0xdef7be]['pick_list_values'][_0x1e7f('0x38')]>-0x1?_['map'](_0x4b5fdd[_0xdef7be]['pick_list_values'],function(_0x1fc036){return{'name':_0x1fc036,'value':_0x1fc036};}):[]});}}return{'count':_0x217eb6[_0x1e7f('0x38')],'rows':_0x217eb6};}else{return{'count':0x0,'rows':[]};}})[_0x1e7f('0x2a')](respondWithResult(_0x37c9f9,null))[_0x1e7f('0x47')](function(_0x3f2547){var _0xc16862=_0x87786a[_0x1e7f('0x34')][_0x1e7f('0x80')]?0x1f4:_0x3f2547[_0x1e7f('0x81')]||0x1f4;logger[_0x1e7f('0x2b')](_0x1e7f('0x82'),_0x1e7f('0x68'),_0xc16862,JSON[_0x1e7f('0x83')](_0x3f2547));delete _0x3f2547[_0x1e7f('0x2d')];if(_0xc16862===0x191){_0xc16862=0x190;}_0x37c9f9[_0x1e7f('0x1e')](_0xc16862)[_0x1e7f('0x84')](_0x87786a[_0x1e7f('0x34')][_0x1e7f('0x80')]?{'message':_0x1e7f('0x85'),'statusCode':_0x3f2547[_0x1e7f('0x81')]}:_0x3f2547);});}; \ No newline at end of file +var _0xc98e=['channel','type','ZohoConfiguration','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','host','serverUrl','code','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','error','stack','name','index','map','ZohoAccount','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','include','rows','params','keys','includeAll','options','catch','create','body','update','destroy','find','getConfigurations','pick','addConfiguration','findOne','AccountId','Subjects','getDescriptions'];(function(_0x18eff4,_0x4039fe){var _0x35f7ae=function(_0x565e1b){while(--_0x565e1b){_0x18eff4['push'](_0x18eff4['shift']());}};_0x35f7ae(++_0x4039fe);}(_0xc98e,0x1a7));var _0xec98=function(_0x489f0c,_0x3b6766){_0x489f0c=_0x489f0c-0x0;var _0x1c1fe4=_0xc98e[_0x489f0c];return _0x1c1fe4;};'use strict';var emlformat=require(_0xec98('0x0'));var rimraf=require(_0xec98('0x1'));var zipdir=require(_0xec98('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xec98('0x3'));var BPromise=require(_0xec98('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xec98('0x5'));var csv=require(_0xec98('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec98('0x7'));var _=require(_0xec98('0x8'));var squel=require(_0xec98('0x9'));var crypto=require(_0xec98('0xa'));var jsforce=require(_0xec98('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xec98('0x6'));var querystring=require(_0xec98('0xc'));var Papa=require('papaparse');var Redis=require(_0xec98('0xd'));var authService=require(_0xec98('0xe'));var qs=require(_0xec98('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec98('0x10'));var logger=require('../../config/logger')(_0xec98('0x11'));var utils=require('../../config/utils');var config=require(_0xec98('0x12'));var licenseUtil=require(_0xec98('0x13'));var db=require(_0xec98('0x14'))['db'];var integrations=require(_0xec98('0x15'));function respondWithStatusCode(_0x30e2c2,_0x3df74c){_0x3df74c=_0x3df74c||0xcc;return function(_0x2fd584){if(_0x2fd584){return _0x30e2c2[_0xec98('0x16')](_0x3df74c);}return _0x30e2c2[_0xec98('0x17')](_0x3df74c)[_0xec98('0x18')]();};}function respondWithResult(_0x320a4c,_0x3f4e6d){_0x3f4e6d=_0x3f4e6d||0xc8;return function(_0x4386ef){if(_0x4386ef){return _0x320a4c['status'](_0x3f4e6d)[_0xec98('0x19')](_0x4386ef);}};}function respondWithFilteredResult(_0x454bac,_0x3e2c99){return function(_0x3db545){if(_0x3db545){var _0x47c0c6=typeof _0x3e2c99[_0xec98('0x1a')]===_0xec98('0x1b')&&typeof _0x3e2c99['limit']==='undefined';var _0x32542a=_0x3db545['count'];var _0x2cb326=_0x47c0c6?0x0:_0x3e2c99[_0xec98('0x1a')];var _0x460761=_0x47c0c6?_0x3db545[_0xec98('0x1c')]:_0x3e2c99['offset']+_0x3e2c99[_0xec98('0x1d')];var _0x2cf8c7;if(_0x460761>=_0x32542a){_0x460761=_0x32542a;_0x2cf8c7=0xc8;}else{_0x2cf8c7=0xce;}_0x454bac[_0xec98('0x17')](_0x2cf8c7);return _0x454bac[_0xec98('0x1e')](_0xec98('0x1f'),_0x2cb326+'-'+_0x460761+'/'+_0x32542a)[_0xec98('0x19')](_0x3db545);}return null;};}function patchUpdates(_0x4cd890){return function(_0x97291a){try{jsonpatch[_0xec98('0x20')](_0x97291a,_0x4cd890,!![]);}catch(_0xb838c2){return BPromise[_0xec98('0x21')](_0xb838c2);}return _0x97291a['save']();};}function saveUpdates(_0xf0d62b,_0xc0a212){return function(_0x19fcf2){if(_0x19fcf2){return _0x19fcf2['update'](_0xf0d62b)['then'](function(_0x26043d){return _0x26043d;});}return null;};}function removeEntity(_0xb73948,_0x4ec5ba){return function(_0x16dfdf){if(_0x16dfdf){return _0x16dfdf['destroy']()[_0xec98('0x22')](function(){_0xb73948['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26eb87,_0xd5c9cb){return function(_0x43b6a8){if(!_0x43b6a8){_0x26eb87['sendStatus'](0x194);}return _0x43b6a8;};}function handleError(_0x289baf,_0x4c96df){_0x4c96df=_0x4c96df||0x1f4;return function(_0x469359){logger[_0xec98('0x23')](_0x469359[_0xec98('0x24')]);if(_0x469359[_0xec98('0x25')]){delete _0x469359[_0xec98('0x25')];}_0x289baf[_0xec98('0x17')](_0x4c96df)['send'](_0x469359);};}exports[_0xec98('0x26')]=function(_0xcb9954,_0x298e0e){var _0x1feeb5={},_0x127603={},_0x46a973={'count':0x0,'rows':[]};var _0xd2806b=_[_0xec98('0x27')](db[_0xec98('0x28')][_0xec98('0x29')],function(_0x16f734){return{'name':_0x16f734['fieldName'],'type':_0x16f734['type'][_0xec98('0x2a')]};});_0x127603[_0xec98('0x2b')]=_[_0xec98('0x27')](_0xd2806b,_0xec98('0x25'));_0x127603[_0xec98('0x2c')]=_['keys'](_0xcb9954[_0xec98('0x2c')]);_0x127603[_0xec98('0x2d')]=_[_0xec98('0x2e')](_0x127603[_0xec98('0x2b')],_0x127603[_0xec98('0x2c')]);_0x1feeb5[_0xec98('0x2f')]=_[_0xec98('0x2e')](_0x127603['model'],qs[_0xec98('0x30')](_0xcb9954[_0xec98('0x2c')][_0xec98('0x30')]));_0x1feeb5[_0xec98('0x2f')]=_0x1feeb5[_0xec98('0x2f')][_0xec98('0x31')]?_0x1feeb5[_0xec98('0x2f')]:_0x127603[_0xec98('0x2b')];if(!_0xcb9954['query'][_0xec98('0x32')](_0xec98('0x33'))){_0x1feeb5[_0xec98('0x1d')]=qs[_0xec98('0x1d')](_0xcb9954[_0xec98('0x2c')][_0xec98('0x1d')]);_0x1feeb5[_0xec98('0x1a')]=qs[_0xec98('0x1a')](_0xcb9954[_0xec98('0x2c')][_0xec98('0x1a')]);}_0x1feeb5[_0xec98('0x34')]=qs[_0xec98('0x35')](_0xcb9954['query'][_0xec98('0x35')]);_0x1feeb5['where']=qs[_0xec98('0x2d')](_['pick'](_0xcb9954['query'],_0x127603[_0xec98('0x2d')]),_0xd2806b);if(_0xcb9954[_0xec98('0x2c')]['filter']){_0x1feeb5[_0xec98('0x36')]=_[_0xec98('0x37')](_0x1feeb5['where'],{'$or':_['map'](_0xd2806b,function(_0xd0053e){if(_0xd0053e['type']!==_0xec98('0x38')){var _0x4051e4={};_0x4051e4[_0xd0053e['name']]={'$like':'%'+_0xcb9954[_0xec98('0x2c')][_0xec98('0x39')]+'%'};return _0x4051e4;}})});}_0x1feeb5=_[_0xec98('0x37')]({},_0x1feeb5,_0xcb9954['options']);var _0x33269a={'where':_0x1feeb5['where']};return db[_0xec98('0x28')]['count'](_0x33269a)['then'](function(_0x4483c2){_0x46a973[_0xec98('0x1c')]=_0x4483c2;if(_0xcb9954['query']['includeAll']){_0x1feeb5[_0xec98('0x3a')]=[{'all':!![]}];}return db[_0xec98('0x28')]['findAll'](_0x1feeb5);})[_0xec98('0x22')](function(_0x28e5a9){_0x46a973[_0xec98('0x3b')]=_0x28e5a9;return _0x46a973;})[_0xec98('0x22')](respondWithFilteredResult(_0x298e0e,_0x1feeb5))['catch'](handleError(_0x298e0e,null));};exports['show']=function(_0x193c9d,_0x36436f){var _0x4571f0={'raw':![],'where':{'id':_0x193c9d[_0xec98('0x3c')]['id']}},_0x352070={};_0x352070[_0xec98('0x2b')]=_[_0xec98('0x3d')](db[_0xec98('0x28')]['rawAttributes']);_0x352070[_0xec98('0x2c')]=_[_0xec98('0x3d')](_0x193c9d['query']);_0x352070[_0xec98('0x2d')]=_[_0xec98('0x2e')](_0x352070[_0xec98('0x2b')],_0x352070[_0xec98('0x2c')]);_0x4571f0[_0xec98('0x2f')]=_[_0xec98('0x2e')](_0x352070['model'],qs[_0xec98('0x30')](_0x193c9d[_0xec98('0x2c')]['fields']));_0x4571f0[_0xec98('0x2f')]=_0x4571f0[_0xec98('0x2f')]['length']?_0x4571f0[_0xec98('0x2f')]:_0x352070[_0xec98('0x2b')];if(_0x193c9d[_0xec98('0x2c')][_0xec98('0x3e')]){_0x4571f0[_0xec98('0x3a')]=[{'all':!![]}];}_0x4571f0=_[_0xec98('0x37')]({},_0x4571f0,_0x193c9d[_0xec98('0x3f')]);return db['ZohoAccount']['find'](_0x4571f0)[_0xec98('0x22')](handleEntityNotFound(_0x36436f,null))[_0xec98('0x22')](respondWithResult(_0x36436f,null))[_0xec98('0x40')](handleError(_0x36436f,null));};exports[_0xec98('0x41')]=function(_0x1a2e3b,_0x40974e){return db[_0xec98('0x28')][_0xec98('0x41')](_0x1a2e3b[_0xec98('0x42')],{})[_0xec98('0x22')](respondWithResult(_0x40974e,0xc9))[_0xec98('0x40')](handleError(_0x40974e,null));};exports[_0xec98('0x43')]=function(_0x5bcced,_0x5d5434){if(_0x5bcced[_0xec98('0x42')]['id']){delete _0x5bcced['body']['id'];}return db[_0xec98('0x28')]['find']({'where':{'id':_0x5bcced[_0xec98('0x3c')]['id']}})[_0xec98('0x22')](handleEntityNotFound(_0x5d5434,null))['then'](saveUpdates(_0x5bcced['body'],null))[_0xec98('0x22')](respondWithResult(_0x5d5434,null))[_0xec98('0x40')](handleError(_0x5d5434,null));};exports[_0xec98('0x44')]=function(_0x376189,_0x4ae0c3){return db['ZohoAccount'][_0xec98('0x45')]({'where':{'id':_0x376189[_0xec98('0x3c')]['id']}})[_0xec98('0x22')](handleEntityNotFound(_0x4ae0c3,null))[_0xec98('0x22')](removeEntity(_0x4ae0c3,null))[_0xec98('0x40')](handleError(_0x4ae0c3,null));};exports[_0xec98('0x46')]=function(_0x55662a,_0x39cfeb,_0x2dde79){var _0xfb418={};var _0xb8f5a9={};var _0x768d96;var _0x23d0f4;return db[_0xec98('0x28')]['findOne']({'where':{'id':_0x55662a['params']['id']}})[_0xec98('0x22')](handleEntityNotFound(_0x39cfeb,null))[_0xec98('0x22')](function(_0x41d8f5){if(_0x41d8f5){_0x768d96=_0x41d8f5;_0xb8f5a9[_0xec98('0x2b')]=_['keys'](db['ZohoConfiguration']['rawAttributes']);_0xb8f5a9[_0xec98('0x2c')]=_[_0xec98('0x3d')](_0x55662a[_0xec98('0x2c')]);_0xb8f5a9['filters']=_[_0xec98('0x2e')](_0xb8f5a9[_0xec98('0x2b')],_0xb8f5a9[_0xec98('0x2c')]);_0xfb418[_0xec98('0x2f')]=_[_0xec98('0x2e')](_0xb8f5a9['model'],qs[_0xec98('0x30')](_0x55662a[_0xec98('0x2c')][_0xec98('0x30')]));_0xfb418['attributes']=_0xfb418[_0xec98('0x2f')][_0xec98('0x31')]?_0xfb418[_0xec98('0x2f')]:_0xb8f5a9[_0xec98('0x2b')];_0xfb418[_0xec98('0x34')]=qs[_0xec98('0x35')](_0x55662a['query'][_0xec98('0x35')]);_0xfb418[_0xec98('0x36')]=qs[_0xec98('0x2d')](_[_0xec98('0x47')](_0x55662a[_0xec98('0x2c')],_0xb8f5a9[_0xec98('0x2d')]));if(_0x55662a[_0xec98('0x2c')]['filter']){_0xfb418[_0xec98('0x36')]=_['merge'](_0xfb418[_0xec98('0x36')],{'$or':_['map'](_0xfb418[_0xec98('0x2f')],function(_0x2e70bd){var _0x211b0d={};_0x211b0d[_0x2e70bd]={'$like':'%'+_0x55662a[_0xec98('0x2c')][_0xec98('0x39')]+'%'};return _0x211b0d;})});}_0xfb418=_[_0xec98('0x37')]({},_0xfb418,_0x55662a[_0xec98('0x3f')]);return _0x768d96[_0xec98('0x46')](_0xfb418);}})[_0xec98('0x22')](function(_0x15066a){if(_0x15066a){_0x23d0f4=_0x15066a[_0xec98('0x31')];if(!_0x55662a[_0xec98('0x2c')][_0xec98('0x32')](_0xec98('0x33'))){_0xfb418[_0xec98('0x1d')]=qs[_0xec98('0x1d')](_0x55662a[_0xec98('0x2c')]['limit']);_0xfb418[_0xec98('0x1a')]=qs[_0xec98('0x1a')](_0x55662a[_0xec98('0x2c')]['offset']);}return _0x768d96['getConfigurations'](_0xfb418);}})[_0xec98('0x22')](function(_0x3a94f5){if(_0x3a94f5){return _0x3a94f5?{'count':_0x23d0f4,'rows':_0x3a94f5}:null;}})[_0xec98('0x22')](respondWithResult(_0x39cfeb,null))[_0xec98('0x40')](handleError(_0x39cfeb,null));};exports[_0xec98('0x48')]=function(_0x3bae14,_0x14e74d,_0x14c52c){if(_0x3bae14['body']['id']){delete _0x3bae14['body']['id'];}return db[_0xec98('0x28')][_0xec98('0x49')]({'where':{'id':_0x3bae14[_0xec98('0x3c')]['id']}})['then'](handleEntityNotFound(_0x14e74d,null))[_0xec98('0x22')](function(_0x4d4977){if(_0x4d4977){_0x3bae14[_0xec98('0x42')][_0xec98('0x4a')]=_0x4d4977['id'];_0x3bae14[_0xec98('0x42')][_0xec98('0x4b')]=integrations['getSubjects'](_0x3bae14[_0xec98('0x42')]['channel'],_0x3bae14[_0xec98('0x42')]['type']);_0x3bae14[_0xec98('0x42')]['Descriptions']=integrations[_0xec98('0x4c')](_0x3bae14[_0xec98('0x42')][_0xec98('0x4d')],_0x3bae14['body'][_0xec98('0x4e')]);return db[_0xec98('0x4f')][_0xec98('0x41')](_0x3bae14[_0xec98('0x42')],{'include':[{'model':db[_0xec98('0x50')],'as':_0xec98('0x4b')},{'model':db['ZohoField'],'as':_0xec98('0x51')}]});}return null;})['then'](respondWithResult(_0x14e74d,null))[_0xec98('0x40')](handleError(_0x14e74d,null));};function getAccessToken(_0x543600){return new Promise(function(_0x537604,_0xfa8966){var _0x329d46;switch(_0x543600[_0xec98('0x52')]){case'US':_0x329d46=_0xec98('0x53');break;case'AU':_0x329d46=_0xec98('0x54');break;case'EU':_0x329d46=_0xec98('0x55');break;case'IN':_0x329d46='https://accounts.zoho.in';break;case'CN':_0x329d46=_0xec98('0x56');break;default:_0x329d46=_0xec98('0x55');break;}var _0x1ab597={'method':'POST','uri':_0x329d46+_0xec98('0x57'),'qs':{'refresh_token':_0x543600[_0xec98('0x58')],'client_id':_0x543600[_0xec98('0x59')],'client_secret':_0x543600[_0xec98('0x5a')],'grant_type':_0xec98('0x5b')},'json':!![]};return rp(_0x1ab597)[_0xec98('0x22')](function(_0x384279){if(_0x384279['access_token']){_0x537604(_0x384279['access_token']);}else{_0xfa8966('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xec98('0x40')](function(_0x1ab1b8){_0xfa8966(_0x1ab1b8);});});}exports['getFields']=function(_0x2eee32,_0xb05e9f,_0x38518a){var _0x408cbf,_0x312853,_0x2f7abd,_0x2c2112,_0x5490ba;return db[_0xec98('0x28')]['findOne']({'where':{'id':_0x2eee32[_0xec98('0x3c')]['id']},'attributes':['id',_0xec98('0x5c'),_0xec98('0x52'),_0xec98('0x59'),_0xec98('0x5a'),_0xec98('0x5d'),_0xec98('0x5e'),_0xec98('0x58')]})['then'](handleEntityNotFound(_0xb05e9f,null))[_0xec98('0x22')](function(_0x3b7f3f){_0x5490ba=_0x3b7f3f;_0x408cbf=_0x5490ba[_0xec98('0x5c')];_0x312853=_0x408cbf==='zoho.eu'?'eu':_0xec98('0x5f');_0x2f7abd=_0x5490ba[_0xec98('0x5d')];var _0x49658f=_0x2f7abd[_0xec98('0x60')](-0x1);if(_0x49658f==='/'||_0x49658f==='\x5c'||_0x49658f===':'){_0x2f7abd=_0x2f7abd[_0xec98('0x61')](0x0,_0x2f7abd[_0xec98('0x62')](_0x49658f));}if(!_0x5490ba[_0xec98('0x58')]){throw new Error(_0xec98('0x63'));}return getAccessToken(_0x5490ba);})[_0xec98('0x22')](function(_0x1698dc){if(_0x1698dc){return rp({'method':_0xec98('0x64'),'uri':util[_0xec98('0x65')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x312853),'qs':{'module':_0xec98('0x66')},'headers':{'Authorization':_0xec98('0x67')+_0x1698dc},'json':!![]});}})[_0xec98('0x22')](function(_0x5da16f){if(_0x5da16f){if(_0x5da16f[_0xec98('0x68')]&&_0x5da16f[_0xec98('0x68')][_0xec98('0x23')]){throw new Error(_0x5da16f[_0xec98('0x68')][_0xec98('0x23')][_0xec98('0x69')]);}var _0x5dd583=[];var _0x35586f=[];var _0x3285f8=[_0xec98('0x6a'),_0xec98('0x6b'),'Description','WhoId',_0xec98('0x6c'),_0xec98('0x6d'),_0xec98('0x6e'),_0xec98('0x6f')];_0x35586f=_[_0xec98('0x70')](_0x5da16f[_0xec98('0x30')],function(_0x2d0c77){return _0x3285f8[_0xec98('0x71')](_0x2d0c77[_0xec98('0x72')]);});for(var _0x56fc1f=0x0;_0x56fc1f<_0x35586f[_0xec98('0x31')];_0x56fc1f++){if(_0x35586f[_0x56fc1f][_0xec98('0x73')]===![]){_0x5dd583[_0xec98('0x74')]({'id':_0x35586f[_0x56fc1f]['id'],'name':_0x35586f[_0x56fc1f][_0xec98('0x75')],'custom':_0x35586f[_0x56fc1f]['custom_field'],'options':_0x35586f[_0x56fc1f][_0xec98('0x76')]===_0xec98('0x77')&&_0x35586f[_0x56fc1f][_0xec98('0x78')][_0xec98('0x31')]>-0x1?_['map'](_0x35586f[_0x56fc1f][_0xec98('0x78')],function(_0x3e5016){return{'name':_0x3e5016,'value':_0x3e5016};}):[]});}}return{'count':_0x5dd583[_0xec98('0x31')],'rows':_0x5dd583};}else{return{'count':0x0,'rows':[]};}})[_0xec98('0x22')](respondWithResult(_0xb05e9f,null))[_0xec98('0x40')](function(_0x1b9438){var _0x47115c=_0x2eee32[_0xec98('0x2c')]['test']?0x1f4:_0x1b9438['statusCode']||0x1f4;logger['error'](_0xec98('0x79'),'getFields',_0x47115c,JSON['stringify'](_0x1b9438));delete _0x1b9438[_0xec98('0x25')];if(_0x47115c===0x191){_0x47115c=0x190;}_0xb05e9f[_0xec98('0x17')](_0x47115c)['send'](_0x2eee32['query'][_0xec98('0x7a')]?{'message':_0xec98('0x7b'),'statusCode':_0x1b9438[_0xec98('0x7c')]}:_0x1b9438);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 1bfb439..53fdfac 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 _0x96f0=['parse','refresh_token','refreshToken','info','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','zone','POST','/oauth/v2/token','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','authorization_code','application/x-www-form-urlencoded','then'];(function(_0x422344,_0x276567){var _0x20efc8=function(_0x275ce9){while(--_0x275ce9){_0x422344['push'](_0x422344['shift']());}};_0x20efc8(++_0x276567);}(_0x96f0,0x116));var _0x096f=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x96f0[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x096f('0x0'));var util=require(_0x096f('0x1'));var logger=require(_0x096f('0x2'))(_0x096f('0x3'));var moment=require('moment');var BPromise=require(_0x096f('0x4'));var rp=require(_0x096f('0x5'));var fs=require('fs');var path=require(_0x096f('0x6'));var rimraf=require(_0x096f('0x7'));var config=require('../../config/environment');var attributes=require(_0x096f('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x096f('0x9')]=function(_0x59561a,_0x3759bb){return _0x59561a[_0x096f('0xa')](_0x096f('0xb'),attributes,{'tableName':_0x096f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x47a69b,_0x541c66,_0x106e4c){if(_0x47a69b[_0x096f('0xd')]('zone')||_0x47a69b['changed'](_0x096f('0xe'))||_0x47a69b[_0x096f('0xd')](_0x096f('0xf'))||_0x47a69b[_0x096f('0xd')](_0x096f('0x10'))||_0x47a69b[_0x096f('0xd')](_0x096f('0x11'))||_0x47a69b['changed'](_0x096f('0x12'))){var _0x4f442e,_0x57026c;_0x4f442e=_0x47a69b[_0x096f('0xe')];var _0x5866bc=_0x4f442e[_0x096f('0x13')](-0x1);if(_0x5866bc==='/'||_0x5866bc==='\x5c'||_0x5866bc===':'){_0x4f442e=_0x4f442e[_0x096f('0x14')](0x0,_0x4f442e[_0x096f('0x15')](_0x5866bc));}switch(_0x47a69b['zone']){case'US':_0x57026c=_0x096f('0x16');break;case'AU':_0x57026c=_0x096f('0x17');break;case'IN':_0x57026c=_0x096f('0x18');break;case'CN':_0x57026c=_0x096f('0x19');break;default:_0x57026c=_0x096f('0x1a');break;}var _0x5cc0d3={'method':'POST','uri':_0x57026c+'/oauth/v2/token','form':{'grant_type':_0x096f('0x1b'),'client_id':_0x47a69b[_0x096f('0xf')],'client_secret':_0x47a69b['clientSecret'],'redirect_uri':_0x47a69b[_0x096f('0xe')],'code':_0x47a69b['code']},'headers':{'Content-Type':_0x096f('0x1c')}};return rp(_0x5cc0d3)[_0x096f('0x1d')](function(_0xe10073){var _0x236cd0=JSON[_0x096f('0x1e')](_0xe10073);if(_0x236cd0[_0x096f('0x1f')]){_0x47a69b[_0x096f('0x20')]=_0x236cd0[_0x096f('0x1f')];logger[_0x096f('0x21')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x47a69b[_0x096f('0x22')],_0x47a69b['id']));}else{logger[_0x096f('0x23')](util['format'](_0x096f('0x24'),_0x47a69b[_0x096f('0x22')],_0x47a69b['id']),util[_0x096f('0x25')](_0x236cd0,{'showHidden':![],'depth':null}));}return _0x106e4c(null,_0x541c66);})[_0x096f('0x26')](function(_0x4c4b91){logger['error'](util['format'](_0x096f('0x24'),_0x47a69b[_0x096f('0x22')],_0x47a69b['id']),util[_0x096f('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x106e4c(_0x4c4b91);});}else{return _0x106e4c(null,_0x541c66);}},'beforeUpdate':function(_0x352b48,_0x5da564,_0x5567c8){if(_0x352b48['changed'](_0x096f('0x27'))||_0x352b48['changed'](_0x096f('0xe'))||_0x352b48[_0x096f('0xd')](_0x096f('0xf'))||_0x352b48['changed'](_0x096f('0x10'))||_0x352b48['changed']('code')||_0x352b48[_0x096f('0xd')](_0x096f('0x12'))){var _0x23e9ca,_0x44a776;_0x23e9ca=_0x352b48[_0x096f('0xe')];var _0x25d55f=_0x23e9ca['slice'](-0x1);if(_0x25d55f==='/'||_0x25d55f==='\x5c'||_0x25d55f===':'){_0x23e9ca=_0x23e9ca[_0x096f('0x14')](0x0,_0x23e9ca[_0x096f('0x15')](_0x25d55f));}switch(_0x352b48['zone']){case'US':_0x44a776=_0x096f('0x16');break;case'AU':_0x44a776=_0x096f('0x17');break;case'IN':_0x44a776=_0x096f('0x18');break;case'CN':_0x44a776=_0x096f('0x19');break;default:_0x44a776='https://accounts.zoho.eu';break;}var _0x3f6cb8={'method':_0x096f('0x28'),'uri':_0x44a776+_0x096f('0x29'),'form':{'grant_type':_0x096f('0x1b'),'client_id':_0x352b48[_0x096f('0xf')],'client_secret':_0x352b48['clientSecret'],'redirect_uri':_0x352b48[_0x096f('0xe')],'code':_0x352b48[_0x096f('0x11')]},'headers':{'Content-Type':_0x096f('0x1c')}};return rp(_0x3f6cb8)[_0x096f('0x1d')](function(_0x44448c){var _0x6306db=JSON[_0x096f('0x1e')](_0x44448c);if(_0x6306db[_0x096f('0x1f')]){_0x352b48[_0x096f('0x20')]=_0x6306db[_0x096f('0x1f')];logger[_0x096f('0x21')](util[_0x096f('0x2a')](_0x096f('0x2b'),_0x352b48[_0x096f('0x22')],_0x352b48['id']));}else{logger[_0x096f('0x23')](util[_0x096f('0x2a')](_0x096f('0x24'),_0x352b48[_0x096f('0x22')],_0x352b48['id']),util[_0x096f('0x25')](_0x6306db,{'showHidden':![],'depth':null}));}return _0x5567c8(null,_0x5da564);})[_0x096f('0x26')](function(_0x2e107c){logger[_0x096f('0x23')](util[_0x096f('0x2a')](_0x096f('0x24'),_0x352b48[_0x096f('0x22')],_0x352b48['id']),util[_0x096f('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x5567c8(_0x2e107c);});}else{return _0x5567c8(null,_0x5da564);}}}});}; \ No newline at end of file +var _0x010a=['define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','/oauth/v2/token','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.com.cn','https://accounts.zoho.eu','authorization_code','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x59bbd2,_0x449914){var _0x3bc07b=function(_0x265d6b){while(--_0x265d6b){_0x59bbd2['push'](_0x59bbd2['shift']());}};_0x3bc07b(++_0x449914);}(_0x010a,0xcd));var _0xa010=function(_0x690b8d,_0x42ff0b){_0x690b8d=_0x690b8d-0x0;var _0x4d7b27=_0x010a[_0x690b8d];return _0x4d7b27;};'use strict';var _=require(_0xa010('0x0'));var util=require('util');var logger=require(_0xa010('0x1'))('api');var moment=require(_0xa010('0x2'));var BPromise=require('bluebird');var rp=require(_0xa010('0x3'));var fs=require('fs');var path=require(_0xa010('0x4'));var rimraf=require(_0xa010('0x5'));var config=require(_0xa010('0x6'));var attributes=require(_0xa010('0x7'));var integrations=require(_0xa010('0x8'));module[_0xa010('0x9')]=function(_0x1fc7d2,_0x20f42a){return _0x1fc7d2[_0xa010('0xa')](_0xa010('0xb'),attributes,{'tableName':_0xa010('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x12af3d,_0x4cddc1,_0x16788a){if(_0x12af3d[_0xa010('0xd')](_0xa010('0xe'))||_0x12af3d['changed'](_0xa010('0xf'))||_0x12af3d[_0xa010('0xd')]('clientId')||_0x12af3d[_0xa010('0xd')](_0xa010('0x10'))||_0x12af3d[_0xa010('0xd')](_0xa010('0x11'))||_0x12af3d[_0xa010('0xd')](_0xa010('0x12'))){var _0x19f226,_0x571811;_0x19f226=_0x12af3d[_0xa010('0xf')];var _0x1d30c3=_0x19f226[_0xa010('0x13')](-0x1);if(_0x1d30c3==='/'||_0x1d30c3==='\x5c'||_0x1d30c3===':'){_0x19f226=_0x19f226[_0xa010('0x14')](0x0,_0x19f226[_0xa010('0x15')](_0x1d30c3));}switch(_0x12af3d[_0xa010('0xe')]){case'US':_0x571811=_0xa010('0x16');break;case'AU':_0x571811=_0xa010('0x17');break;case'IN':_0x571811=_0xa010('0x18');break;case'CN':_0x571811='https://accounts.zoho.com.cn';break;default:_0x571811='https://accounts.zoho.eu';break;}var _0x33756f={'method':_0xa010('0x19'),'uri':_0x571811+_0xa010('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x12af3d[_0xa010('0x1b')],'client_secret':_0x12af3d[_0xa010('0x10')],'redirect_uri':_0x12af3d['serverUrl'],'code':_0x12af3d['code']},'headers':{'Content-Type':_0xa010('0x1c')}};return rp(_0x33756f)[_0xa010('0x1d')](function(_0x1861e9){var _0x15d275=JSON[_0xa010('0x1e')](_0x1861e9);if(_0x15d275[_0xa010('0x1f')]){_0x12af3d['refreshToken']=_0x15d275[_0xa010('0x1f')];logger[_0xa010('0x20')](util['format'](_0xa010('0x21'),_0x12af3d[_0xa010('0x22')],_0x12af3d['id']));}else{logger[_0xa010('0x23')](util[_0xa010('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x12af3d[_0xa010('0x22')],_0x12af3d['id']),util[_0xa010('0x25')](_0x15d275,{'showHidden':![],'depth':null}));}return _0x16788a(null,_0x4cddc1);})[_0xa010('0x26')](function(_0x1913ef){logger[_0xa010('0x23')](util['format'](_0xa010('0x27'),_0x12af3d[_0xa010('0x22')],_0x12af3d['id']),util[_0xa010('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x16788a(_0x1913ef);});}else{return _0x16788a(null,_0x4cddc1);}},'beforeUpdate':function(_0x549b9f,_0x18b71c,_0x217e80){if(_0x549b9f[_0xa010('0xd')](_0xa010('0xe'))||_0x549b9f[_0xa010('0xd')](_0xa010('0xf'))||_0x549b9f[_0xa010('0xd')]('clientId')||_0x549b9f[_0xa010('0xd')]('clientSecret')||_0x549b9f[_0xa010('0xd')](_0xa010('0x11'))||_0x549b9f['changed'](_0xa010('0x12'))){var _0x170437,_0x9dc3ca;_0x170437=_0x549b9f[_0xa010('0xf')];var _0x21cbd6=_0x170437[_0xa010('0x13')](-0x1);if(_0x21cbd6==='/'||_0x21cbd6==='\x5c'||_0x21cbd6===':'){_0x170437=_0x170437['substring'](0x0,_0x170437[_0xa010('0x15')](_0x21cbd6));}switch(_0x549b9f['zone']){case'US':_0x9dc3ca='https://accounts.zoho.com';break;case'AU':_0x9dc3ca=_0xa010('0x17');break;case'IN':_0x9dc3ca=_0xa010('0x18');break;case'CN':_0x9dc3ca=_0xa010('0x28');break;default:_0x9dc3ca=_0xa010('0x29');break;}var _0x2d93e6={'method':_0xa010('0x19'),'uri':_0x9dc3ca+_0xa010('0x1a'),'form':{'grant_type':_0xa010('0x2a'),'client_id':_0x549b9f[_0xa010('0x1b')],'client_secret':_0x549b9f[_0xa010('0x10')],'redirect_uri':_0x549b9f['serverUrl'],'code':_0x549b9f[_0xa010('0x11')]},'headers':{'Content-Type':_0xa010('0x1c')}};return rp(_0x2d93e6)[_0xa010('0x1d')](function(_0x1c1f8f){var _0x5b39bb=JSON['parse'](_0x1c1f8f);if(_0x5b39bb[_0xa010('0x1f')]){_0x549b9f['refreshToken']=_0x5b39bb['refresh_token'];logger[_0xa010('0x20')](util[_0xa010('0x24')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x549b9f[_0xa010('0x22')],_0x549b9f['id']));}else{logger[_0xa010('0x23')](util[_0xa010('0x24')](_0xa010('0x27'),_0x549b9f['name'],_0x549b9f['id']),util[_0xa010('0x25')](_0x5b39bb,{'showHidden':![],'depth':null}));}return _0x217e80(null,_0x18b71c);})['catch'](function(_0x4dbf52){logger[_0xa010('0x23')](util[_0xa010('0x24')](_0xa010('0x27'),_0x549b9f[_0xa010('0x22')],_0x549b9f['id']),util[_0xa010('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x217e80(_0x4dbf52);});}else{return _0x217e80(null,_0x18b71c);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 0385126..74fb0d4 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 _0x4a03=['message','ZohoAccount,\x20%s,\x20%s','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','find','ShowZohoAccount','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4a03,0x16e));var _0x34a0=function(_0x4996d2,_0x410e09){_0x4996d2=_0x4996d2-0x0;var _0x2ac0dc=_0x4a03[_0x4996d2];return _0x2ac0dc;};'use strict';var _=require('lodash');var util=require(_0x34a0('0x0'));var moment=require(_0x34a0('0x1'));var BPromise=require(_0x34a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34a0('0x3'));var db=require(_0x34a0('0x4'))['db'];var utils=require(_0x34a0('0x5'));var logger=require('../../config/logger')(_0x34a0('0x6'));var config=require(_0x34a0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x34a0('0x8')][_0x34a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x491fe8,_0x44d6be,_0x2cf483){return new BPromise(function(_0x592827,_0xb182cc){return client[_0x34a0('0xa')](_0x491fe8,_0x2cf483)[_0x34a0('0xb')](function(_0x176571){logger[_0x34a0('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x44d6be,_0x34a0('0xd'));logger[_0x34a0('0xe')](_0x34a0('0xf'),_0x44d6be,_0x34a0('0xd'),JSON[_0x34a0('0x10')](_0x176571));if(_0x176571[_0x34a0('0x11')]){if(_0x176571[_0x34a0('0x11')][_0x34a0('0x12')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x44d6be,_0x176571[_0x34a0('0x11')][_0x34a0('0x13')]);return _0xb182cc(_0x176571['error'][_0x34a0('0x13')]);}logger[_0x34a0('0x11')](_0x34a0('0x14'),_0x44d6be,_0x176571[_0x34a0('0x11')][_0x34a0('0x13')]);return _0x592827(_0x176571[_0x34a0('0x11')][_0x34a0('0x13')]);}else{logger[_0x34a0('0xc')](_0x34a0('0x14'),_0x44d6be,_0x34a0('0xd'));_0x592827(_0x176571[_0x34a0('0x15')][_0x34a0('0x13')]);}})[_0x34a0('0x16')](function(_0x4134f0){logger[_0x34a0('0x11')](_0x34a0('0x14'),_0x44d6be,_0x4134f0);_0xb182cc(_0x4134f0);});});}exports[_0x34a0('0x17')]=function(_0x224cca){var _0xe380c8=this;return new Promise(function(_0x2c5325,_0x4fab3a){return db[_0x34a0('0x18')][_0x34a0('0x19')]({'raw':_0x224cca[_0x34a0('0x1a')]?_0x224cca[_0x34a0('0x1a')][_0x34a0('0x1b')]===undefined?!![]:![]:!![],'where':_0x224cca[_0x34a0('0x1a')]?_0x224cca['options'][_0x34a0('0x1c')]||null:null,'attributes':_0x224cca[_0x34a0('0x1a')]?_0x224cca[_0x34a0('0x1a')][_0x34a0('0x1d')]||null:null,'limit':_0x224cca[_0x34a0('0x1a')]?_0x224cca[_0x34a0('0x1a')]['limit']||null:null,'include':_0x224cca[_0x34a0('0x1a')]?_0x224cca[_0x34a0('0x1a')][_0x34a0('0x1e')]?_[_0x34a0('0x1f')](_0x224cca[_0x34a0('0x1a')][_0x34a0('0x1e')],function(_0x5354c7){return{'model':db[_0x5354c7[_0x34a0('0x20')]],'as':_0x5354c7['as'],'attributes':_0x5354c7[_0x34a0('0x1d')],'include':_0x5354c7['include']?_[_0x34a0('0x1f')](_0x5354c7[_0x34a0('0x1e')],function(_0x4fdbc3){return{'model':db[_0x4fdbc3[_0x34a0('0x20')]],'as':_0x4fdbc3['as'],'attributes':_0x4fdbc3[_0x34a0('0x1d')],'include':_0x4fdbc3[_0x34a0('0x1e')]?_[_0x34a0('0x1f')](_0x4fdbc3[_0x34a0('0x1e')],function(_0x5c49be){return{'model':db[_0x5c49be[_0x34a0('0x20')]],'as':_0x5c49be['as'],'attributes':_0x5c49be[_0x34a0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x34a0('0xb')](function(_0x159b33){logger[_0x34a0('0xc')](_0x34a0('0x17'),_0x224cca);logger['debug']('GetZohoAccount',_0x224cca,JSON[_0x34a0('0x10')](_0x159b33));_0x2c5325(_0x159b33);})['catch'](function(_0x333ecf){logger[_0x34a0('0x11')](_0x34a0('0x17'),_0x333ecf[_0x34a0('0x13')],_0x224cca);_0x4fab3a(_0xe380c8[_0x34a0('0x11')](0x1f4,_0x333ecf[_0x34a0('0x13')]));});});};exports['ShowZohoAccount']=function(_0x31bd8e){var _0x13ddbe=this;return new Promise(function(_0x6190d0,_0x134451){return db[_0x34a0('0x18')][_0x34a0('0x21')]({'raw':_0x31bd8e[_0x34a0('0x1a')]?_0x31bd8e[_0x34a0('0x1a')][_0x34a0('0x1b')]===undefined?!![]:![]:!![],'where':_0x31bd8e[_0x34a0('0x1a')]?_0x31bd8e[_0x34a0('0x1a')][_0x34a0('0x1c')]||null:null,'attributes':_0x31bd8e[_0x34a0('0x1a')]?_0x31bd8e[_0x34a0('0x1a')]['attributes']||null:null,'include':_0x31bd8e[_0x34a0('0x1a')]?_0x31bd8e[_0x34a0('0x1a')][_0x34a0('0x1e')]?_['map'](_0x31bd8e[_0x34a0('0x1a')]['include'],function(_0x26d9b8){return{'model':db[_0x26d9b8[_0x34a0('0x20')]],'as':_0x26d9b8['as'],'attributes':_0x26d9b8[_0x34a0('0x1d')],'include':_0x26d9b8[_0x34a0('0x1e')]?_[_0x34a0('0x1f')](_0x26d9b8[_0x34a0('0x1e')],function(_0x4cb7fd){return{'model':db[_0x4cb7fd[_0x34a0('0x20')]],'as':_0x4cb7fd['as'],'attributes':_0x4cb7fd['attributes'],'include':_0x4cb7fd[_0x34a0('0x1e')]?_[_0x34a0('0x1f')](_0x4cb7fd[_0x34a0('0x1e')],function(_0x5ecab4){return{'model':db[_0x5ecab4[_0x34a0('0x20')]],'as':_0x5ecab4['as'],'attributes':_0x5ecab4[_0x34a0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x34a0('0xb')](function(_0x1f629c){logger['info']('ShowZohoAccount',_0x31bd8e);logger[_0x34a0('0xe')](_0x34a0('0x22'),_0x31bd8e,JSON['stringify'](_0x1f629c));_0x6190d0(_0x1f629c);})[_0x34a0('0x16')](function(_0x135192){logger['error']('ShowZohoAccount',_0x135192['message'],_0x31bd8e);_0x134451(_0x13ddbe['error'](0x1f4,_0x135192[_0x34a0('0x13')]));});});}; \ No newline at end of file +var _0x4137=['stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','catch','ShowZohoAccount','ZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s'];(function(_0x40ffee,_0x2d731b){var _0x44b929=function(_0x17a578){while(--_0x17a578){_0x40ffee['push'](_0x40ffee['shift']());}};_0x44b929(++_0x2d731b);}(_0x4137,0xf8));var _0x7413=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4137[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});}exports[_0x7413('0x17')]=function(_0x19157f){var _0x12a01e=this;return new Promise(function(_0x2a3417,_0x26dafe){return db['ZohoAccount'][_0x7413('0x18')]({'raw':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1a')]===undefined?!![]:![]:!![],'where':_0x19157f['options']?_0x19157f[_0x7413('0x19')][_0x7413('0x1b')]||null:null,'attributes':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1c')]||null:null,'limit':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1d')]||null:null,'include':_0x19157f['options']?_0x19157f['options'][_0x7413('0x1e')]?_['map'](_0x19157f[_0x7413('0x19')][_0x7413('0x1e')],function(_0x3b0c81){return{'model':db[_0x3b0c81[_0x7413('0x1f')]],'as':_0x3b0c81['as'],'attributes':_0x3b0c81[_0x7413('0x1c')],'include':_0x3b0c81[_0x7413('0x1e')]?_[_0x7413('0x20')](_0x3b0c81[_0x7413('0x1e')],function(_0x1d455b){return{'model':db[_0x1d455b['model']],'as':_0x1d455b['as'],'attributes':_0x1d455b['attributes'],'include':_0x1d455b[_0x7413('0x1e')]?_['map'](_0x1d455b[_0x7413('0x1e')],function(_0x71cbb4){return{'model':db[_0x71cbb4[_0x7413('0x1f')]],'as':_0x71cbb4['as'],'attributes':_0x71cbb4['attributes']};}):[]};}):[]};}):[]:[]})[_0x7413('0x21')](function(_0x896552){logger[_0x7413('0xe')](_0x7413('0x17'),_0x19157f);logger[_0x7413('0x10')](_0x7413('0x17'),_0x19157f,JSON['stringify'](_0x896552));_0x2a3417(_0x896552);})[_0x7413('0x22')](function(_0x4ed662){logger[_0x7413('0x13')](_0x7413('0x17'),_0x4ed662[_0x7413('0x16')],_0x19157f);_0x26dafe(_0x12a01e[_0x7413('0x13')](0x1f4,_0x4ed662[_0x7413('0x16')]));});});};exports[_0x7413('0x23')]=function(_0x5bb3ea){var _0x1ffb6f=this;return new Promise(function(_0x17c342,_0x39db32){return db[_0x7413('0x24')][_0x7413('0x25')]({'raw':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')][_0x7413('0x1b')]||null:null,'attributes':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')]['attributes']||null:null,'include':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea['options'][_0x7413('0x1e')]?_[_0x7413('0x20')](_0x5bb3ea[_0x7413('0x19')]['include'],function(_0xe6b096){return{'model':db[_0xe6b096['model']],'as':_0xe6b096['as'],'attributes':_0xe6b096[_0x7413('0x1c')],'include':_0xe6b096[_0x7413('0x1e')]?_['map'](_0xe6b096['include'],function(_0x440bfe){return{'model':db[_0x440bfe[_0x7413('0x1f')]],'as':_0x440bfe['as'],'attributes':_0x440bfe[_0x7413('0x1c')],'include':_0x440bfe['include']?_['map'](_0x440bfe[_0x7413('0x1e')],function(_0x5a92ab){return{'model':db[_0x5a92ab['model']],'as':_0x5a92ab['as'],'attributes':_0x5a92ab[_0x7413('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ad12d){logger[_0x7413('0xe')](_0x7413('0x23'),_0x5bb3ea);logger[_0x7413('0x10')](_0x7413('0x23'),_0x5bb3ea,JSON['stringify'](_0x3ad12d));_0x17c342(_0x3ad12d);})[_0x7413('0x22')](function(_0x8dc047){logger[_0x7413('0x13')](_0x7413('0x23'),_0x8dc047[_0x7413('0x16')],_0x5bb3ea);_0x39db32(_0x1ffb6f[_0x7413('0x13')](0x1f4,_0x8dc047[_0x7413('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 8e087f0..975a0ae 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 _0xeb86=['show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x1b24c1,_0x504921){var _0x3ddd94=function(_0xeba046){while(--_0xeba046){_0x1b24c1['push'](_0x1b24c1['shift']());}};_0x3ddd94(++_0x504921);}(_0xeb86,0xa3));var _0x6eb8=function(_0x563284,_0x5da653){_0x563284=_0x563284-0x0;var _0x2fe1eb=_0xeb86[_0x563284];return _0x2fe1eb;};'use strict';var multer=require(_0x6eb8('0x0'));var util=require(_0x6eb8('0x1'));var path=require(_0x6eb8('0x2'));var timeout=require(_0x6eb8('0x3'));var express=require(_0x6eb8('0x4'));var router=express['Router']();var fs_extra=require(_0x6eb8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6eb8('0x6'));var config=require('../../config/environment');var controller=require(_0x6eb8('0x7'));router[_0x6eb8('0x8')]('/',auth[_0x6eb8('0x9')](),controller[_0x6eb8('0xa')]);router[_0x6eb8('0x8')](_0x6eb8('0xb'),auth['isAuthenticated'](),controller[_0x6eb8('0xc')]);router['get'](_0x6eb8('0xd'),auth[_0x6eb8('0x9')](),controller[_0x6eb8('0xe')]);router[_0x6eb8('0x8')](_0x6eb8('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x6eb8('0x10'),auth[_0x6eb8('0x9')](),controller[_0x6eb8('0x11')]);router[_0x6eb8('0x12')]('/',auth[_0x6eb8('0x9')](),controller[_0x6eb8('0x13')]);router[_0x6eb8('0x14')](_0x6eb8('0xb'),auth['isAuthenticated'](),controller[_0x6eb8('0x15')]);router[_0x6eb8('0x16')](_0x6eb8('0xb'),auth[_0x6eb8('0x9')](),controller[_0x6eb8('0x17')]);module[_0x6eb8('0x18')]=router; \ No newline at end of file +var _0xd6cf=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6cf,0xea));var _0xfd6c=function(_0x260073,_0xbe6af9){_0x260073=_0x260073-0x0;var _0x4ff033=_0xd6cf[_0x260073];return _0x4ff033;};'use strict';var multer=require(_0xfd6c('0x0'));var util=require(_0xfd6c('0x1'));var path=require('path');var timeout=require(_0xfd6c('0x2'));var express=require(_0xfd6c('0x3'));var router=express[_0xfd6c('0x4')]();var fs_extra=require(_0xfd6c('0x5'));var auth=require(_0xfd6c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfd6c('0x7'));var controller=require(_0xfd6c('0x8'));router[_0xfd6c('0x9')]('/',auth[_0xfd6c('0xa')](),controller['index']);router[_0xfd6c('0x9')](_0xfd6c('0xb'),auth[_0xfd6c('0xa')](),controller[_0xfd6c('0xc')]);router[_0xfd6c('0x9')](_0xfd6c('0xd'),auth['isAuthenticated'](),controller[_0xfd6c('0xe')]);router[_0xfd6c('0x9')](_0xfd6c('0xf'),auth[_0xfd6c('0xa')](),controller[_0xfd6c('0x10')]);router[_0xfd6c('0x9')]('/:id/descriptions',auth[_0xfd6c('0xa')](),controller[_0xfd6c('0x11')]);router[_0xfd6c('0x12')]('/',auth[_0xfd6c('0xa')](),controller[_0xfd6c('0x13')]);router[_0xfd6c('0x14')](_0xfd6c('0xb'),auth[_0xfd6c('0xa')](),controller[_0xfd6c('0x15')]);router[_0xfd6c('0x16')](_0xfd6c('0xb'),auth['isAuthenticated'](),controller[_0xfd6c('0x17')]);module[_0xfd6c('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index c42cc2b..e4a51ff 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 _0x77c6=['contact','nothing','lead','contact_lead','STRING','sequelize','ENUM'];(function(_0x46c72b,_0xd150e5){var _0x19b0ef=function(_0x27288e){while(--_0x27288e){_0x46c72b['push'](_0x46c72b['shift']());}};_0x19b0ef(++_0xd150e5);}(_0x77c6,0x1b7));var _0x677c=function(_0x55483d,_0x51831b){_0x55483d=_0x55483d-0x0;var _0x3ba5f2=_0x77c6[_0x55483d];return _0x3ba5f2;};'use strict';var Sequelize=require(_0x677c('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x677c('0x1')]('lead',_0x677c('0x2'),_0x677c('0x3')),'defaultValue':_0x677c('0x4')},'moduleSearch':{'type':Sequelize[_0x677c('0x1')](_0x677c('0x5'),'contact',_0x677c('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x677c('0x6')]}}; \ No newline at end of file +var _0x02d7=['exports','STRING','ENUM','lead','nothing','contact_lead','contact','sequelize'];(function(_0x22f3db,_0xc6a49b){var _0x3a6197=function(_0x3abc5a){while(--_0x3abc5a){_0x22f3db['push'](_0x22f3db['shift']());}};_0x3a6197(++_0xc6a49b);}(_0x02d7,0x13f));var _0x702d=function(_0x28b126,_0x3b351e){_0x28b126=_0x28b126-0x0;var _0x597853=_0x02d7[_0x28b126];return _0x597853;};'use strict';var Sequelize=require(_0x702d('0x0'));module[_0x702d('0x1')]={'name':{'type':Sequelize[_0x702d('0x2')]},'moduleCreate':{'type':Sequelize[_0x702d('0x3')](_0x702d('0x4'),'contact',_0x702d('0x5')),'defaultValue':_0x702d('0x4')},'moduleSearch':{'type':Sequelize[_0x702d('0x3')](_0x702d('0x6'),_0x702d('0x7'),'lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 411ba1f..a17142c 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 _0x1a19=['filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','destroy','findOne','ZohoField','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','error','stack','index','map','ZohoConfiguration','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1e8707,_0x24ffcb){var _0x42085a=function(_0x35dca1){while(--_0x35dca1){_0x1e8707['push'](_0x1e8707['shift']());}};_0x42085a(++_0x24ffcb);}(_0x1a19,0x15d));var _0x91a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a19[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x91a1('0x0'));var rimraf=require(_0x91a1('0x1'));var zipdir=require(_0x91a1('0x2'));var jsonpatch=require(_0x91a1('0x3'));var rp=require(_0x91a1('0x4'));var moment=require(_0x91a1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x91a1('0x6'));var util=require(_0x91a1('0x7'));var path=require(_0x91a1('0x8'));var sox=require(_0x91a1('0x9'));var csv=require('to-csv');var ejs=require(_0x91a1('0xa'));var fs=require('fs');var fs_extra=require(_0x91a1('0xb'));var _=require('lodash');var squel=require(_0x91a1('0xc'));var crypto=require(_0x91a1('0xd'));var jsforce=require(_0x91a1('0xe'));var deskjs=require(_0x91a1('0xf'));var toCsv=require(_0x91a1('0x10'));var querystring=require(_0x91a1('0x11'));var Papa=require(_0x91a1('0x12'));var Redis=require(_0x91a1('0x13'));var authService=require(_0x91a1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x91a1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x91a1('0x16'))(_0x91a1('0x17'));var utils=require(_0x91a1('0x18'));var config=require(_0x91a1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x91a1('0x1a'))['db'];function respondWithStatusCode(_0x529f68,_0x51035e){_0x51035e=_0x51035e||0xcc;return function(_0x57a2f6){if(_0x57a2f6){return _0x529f68[_0x91a1('0x1b')](_0x51035e);}return _0x529f68[_0x91a1('0x1c')](_0x51035e)[_0x91a1('0x1d')]();};}function respondWithResult(_0x332054,_0x22d039){_0x22d039=_0x22d039||0xc8;return function(_0x38fd6e){if(_0x38fd6e){return _0x332054[_0x91a1('0x1c')](_0x22d039)[_0x91a1('0x1e')](_0x38fd6e);}};}function respondWithFilteredResult(_0x3c5fb3,_0x4ff9f0){return function(_0x274d00){if(_0x274d00){var _0x45c26d=typeof _0x4ff9f0['offset']==='undefined'&&typeof _0x4ff9f0[_0x91a1('0x1f')]===_0x91a1('0x20');var _0xf8c8df=_0x274d00[_0x91a1('0x21')];var _0x3d5f5b=_0x45c26d?0x0:_0x4ff9f0[_0x91a1('0x22')];var _0x2428ba=_0x45c26d?_0x274d00[_0x91a1('0x21')]:_0x4ff9f0['offset']+_0x4ff9f0[_0x91a1('0x1f')];var _0x280486;if(_0x2428ba>=_0xf8c8df){_0x2428ba=_0xf8c8df;_0x280486=0xc8;}else{_0x280486=0xce;}_0x3c5fb3['status'](_0x280486);return _0x3c5fb3[_0x91a1('0x23')](_0x91a1('0x24'),_0x3d5f5b+'-'+_0x2428ba+'/'+_0xf8c8df)['json'](_0x274d00);}return null;};}function patchUpdates(_0x1c365a){return function(_0x1ee313){try{jsonpatch[_0x91a1('0x25')](_0x1ee313,_0x1c365a,!![]);}catch(_0x262f1e){return BPromise['reject'](_0x262f1e);}return _0x1ee313[_0x91a1('0x26')]();};}function saveUpdates(_0x34d101,_0x505787){return function(_0xb1e6ed){if(_0xb1e6ed){return _0xb1e6ed[_0x91a1('0x27')](_0x34d101)[_0x91a1('0x28')](function(_0xd93d87){return _0xd93d87;});}return null;};}function removeEntity(_0x543684,_0x4e85df){return function(_0x4ebcab){if(_0x4ebcab){return _0x4ebcab['destroy']()[_0x91a1('0x28')](function(){_0x543684[_0x91a1('0x1c')](0xcc)[_0x91a1('0x1d')]();});}};}function handleEntityNotFound(_0x1fd602,_0x440e4e){return function(_0x3a76b4){if(!_0x3a76b4){_0x1fd602[_0x91a1('0x1b')](0x194);}return _0x3a76b4;};}function handleError(_0x160476,_0x1a0a4f){_0x1a0a4f=_0x1a0a4f||0x1f4;return function(_0x589d2e){logger[_0x91a1('0x29')](_0x589d2e[_0x91a1('0x2a')]);if(_0x589d2e['name']){delete _0x589d2e['name'];}_0x160476['status'](_0x1a0a4f)['send'](_0x589d2e);};}exports[_0x91a1('0x2b')]=function(_0x3ea04e,_0x4ed94b){var _0x47e5ae={},_0x20c09d={},_0x386788={'count':0x0,'rows':[]};var _0x6ecf74=_[_0x91a1('0x2c')](db[_0x91a1('0x2d')]['rawAttributes'],function(_0x3f87a8){return{'name':_0x3f87a8[_0x91a1('0x2e')],'type':_0x3f87a8[_0x91a1('0x2f')]['key']};});_0x20c09d['model']=_[_0x91a1('0x2c')](_0x6ecf74,'name');_0x20c09d[_0x91a1('0x30')]=_[_0x91a1('0x31')](_0x3ea04e[_0x91a1('0x30')]);_0x20c09d[_0x91a1('0x32')]=_[_0x91a1('0x33')](_0x20c09d['model'],_0x20c09d[_0x91a1('0x30')]);_0x47e5ae['attributes']=_[_0x91a1('0x33')](_0x20c09d[_0x91a1('0x34')],qs['fields'](_0x3ea04e[_0x91a1('0x30')][_0x91a1('0x35')]));_0x47e5ae[_0x91a1('0x36')]=_0x47e5ae[_0x91a1('0x36')][_0x91a1('0x37')]?_0x47e5ae[_0x91a1('0x36')]:_0x20c09d['model'];if(!_0x3ea04e[_0x91a1('0x30')][_0x91a1('0x38')](_0x91a1('0x39'))){_0x47e5ae[_0x91a1('0x1f')]=qs['limit'](_0x3ea04e[_0x91a1('0x30')][_0x91a1('0x1f')]);_0x47e5ae['offset']=qs[_0x91a1('0x22')](_0x3ea04e[_0x91a1('0x30')][_0x91a1('0x22')]);}_0x47e5ae[_0x91a1('0x3a')]=qs[_0x91a1('0x3b')](_0x3ea04e[_0x91a1('0x30')][_0x91a1('0x3b')]);_0x47e5ae[_0x91a1('0x3c')]=qs[_0x91a1('0x32')](_['pick'](_0x3ea04e[_0x91a1('0x30')],_0x20c09d[_0x91a1('0x32')]),_0x6ecf74);if(_0x3ea04e[_0x91a1('0x30')][_0x91a1('0x3d')]){_0x47e5ae[_0x91a1('0x3c')]=_[_0x91a1('0x3e')](_0x47e5ae[_0x91a1('0x3c')],{'$or':_['map'](_0x6ecf74,function(_0x5db40f){if(_0x5db40f[_0x91a1('0x2f')]!=='VIRTUAL'){var _0x49d62f={};_0x49d62f[_0x5db40f['name']]={'$like':'%'+_0x3ea04e[_0x91a1('0x30')][_0x91a1('0x3d')]+'%'};return _0x49d62f;}})});}_0x47e5ae=_[_0x91a1('0x3e')]({},_0x47e5ae,_0x3ea04e['options']);var _0x2b1865={'where':_0x47e5ae['where']};return db[_0x91a1('0x2d')][_0x91a1('0x21')](_0x2b1865)['then'](function(_0x416a62){_0x386788[_0x91a1('0x21')]=_0x416a62;if(_0x3ea04e[_0x91a1('0x30')][_0x91a1('0x3f')]){_0x47e5ae[_0x91a1('0x40')]=[{'all':!![]}];}return db[_0x91a1('0x2d')][_0x91a1('0x41')](_0x47e5ae);})[_0x91a1('0x28')](function(_0xe2cf9b){_0x386788[_0x91a1('0x42')]=_0xe2cf9b;return _0x386788;})[_0x91a1('0x28')](respondWithFilteredResult(_0x4ed94b,_0x47e5ae))[_0x91a1('0x43')](handleError(_0x4ed94b,null));};exports[_0x91a1('0x44')]=function(_0x353b69,_0x5f2b21){var _0x2e8e14={'raw':![],'where':{'id':_0x353b69[_0x91a1('0x45')]['id']}},_0xc35e60={};_0xc35e60['model']=_[_0x91a1('0x31')](db[_0x91a1('0x2d')][_0x91a1('0x46')]);_0xc35e60['query']=_[_0x91a1('0x31')](_0x353b69[_0x91a1('0x30')]);_0xc35e60[_0x91a1('0x32')]=_['intersection'](_0xc35e60[_0x91a1('0x34')],_0xc35e60['query']);_0x2e8e14[_0x91a1('0x36')]=_[_0x91a1('0x33')](_0xc35e60[_0x91a1('0x34')],qs[_0x91a1('0x35')](_0x353b69['query']['fields']));_0x2e8e14['attributes']=_0x2e8e14['attributes']['length']?_0x2e8e14['attributes']:_0xc35e60[_0x91a1('0x34')];if(_0x353b69['query']['includeAll']){_0x2e8e14[_0x91a1('0x40')]=[{'all':!![]}];}_0x2e8e14=_[_0x91a1('0x3e')]({},_0x2e8e14,_0x353b69[_0x91a1('0x47')]);return db[_0x91a1('0x2d')][_0x91a1('0x48')](_0x2e8e14)[_0x91a1('0x28')](handleEntityNotFound(_0x5f2b21,null))['then'](respondWithResult(_0x5f2b21,null))['catch'](handleError(_0x5f2b21,null));};exports[_0x91a1('0x49')]=function(_0x344b92,_0x5b5025){return db[_0x91a1('0x2d')][_0x91a1('0x49')](_0x344b92[_0x91a1('0x4a')],{})[_0x91a1('0x28')](respondWithResult(_0x5b5025,0xc9))['catch'](handleError(_0x5b5025,null));};exports[_0x91a1('0x27')]=function(_0x33e68d,_0x14100c){if(_0x33e68d[_0x91a1('0x4a')]['id']){delete _0x33e68d[_0x91a1('0x4a')]['id'];}return db[_0x91a1('0x2d')][_0x91a1('0x48')]({'where':{'id':_0x33e68d[_0x91a1('0x45')]['id']}})[_0x91a1('0x28')](handleEntityNotFound(_0x14100c,null))['then'](saveUpdates(_0x33e68d['body'],null))[_0x91a1('0x28')](respondWithResult(_0x14100c,null))['catch'](handleError(_0x14100c,null));};exports[_0x91a1('0x4b')]=function(_0x493a94,_0xfa2e3b){return db[_0x91a1('0x2d')]['find']({'where':{'id':_0x493a94[_0x91a1('0x45')]['id']}})['then'](handleEntityNotFound(_0xfa2e3b,null))[_0x91a1('0x28')](removeEntity(_0xfa2e3b,null))['catch'](handleError(_0xfa2e3b,null));};exports['getFields']=function(_0x2c2081,_0x46fcdc,_0x349d92){var _0x538992={};var _0x9173b={};var _0x54b12f;var _0xe0da15;return db[_0x91a1('0x2d')][_0x91a1('0x4c')]({'where':{'id':_0x2c2081[_0x91a1('0x45')]['id']}})[_0x91a1('0x28')](handleEntityNotFound(_0x46fcdc,null))['then'](function(_0x3e2c5b){if(_0x3e2c5b){_0x54b12f=_0x3e2c5b;_0x9173b[_0x91a1('0x34')]=_[_0x91a1('0x31')](db[_0x91a1('0x4d')][_0x91a1('0x46')]);_0x9173b[_0x91a1('0x30')]=_['keys'](_0x2c2081[_0x91a1('0x30')]);_0x9173b[_0x91a1('0x32')]=_[_0x91a1('0x33')](_0x9173b['model'],_0x9173b['query']);_0x538992[_0x91a1('0x36')]=_[_0x91a1('0x33')](_0x9173b['model'],qs[_0x91a1('0x35')](_0x2c2081[_0x91a1('0x30')][_0x91a1('0x35')]));_0x538992[_0x91a1('0x36')]=_0x538992[_0x91a1('0x36')][_0x91a1('0x37')]?_0x538992[_0x91a1('0x36')]:_0x9173b[_0x91a1('0x34')];_0x538992['order']=qs['sort'](_0x2c2081['query'][_0x91a1('0x3b')]);_0x538992[_0x91a1('0x3c')]=qs['filters'](_[_0x91a1('0x4e')](_0x2c2081[_0x91a1('0x30')],_0x9173b['filters']));if(_0x2c2081[_0x91a1('0x30')]['filter']){_0x538992[_0x91a1('0x3c')]=_[_0x91a1('0x3e')](_0x538992[_0x91a1('0x3c')],{'$or':_[_0x91a1('0x2c')](_0x538992['attributes'],function(_0x1cc15a){var _0x2b3c1d={};_0x2b3c1d[_0x1cc15a]={'$like':'%'+_0x2c2081[_0x91a1('0x30')]['filter']+'%'};return _0x2b3c1d;})});}_0x538992=_['merge']({},_0x538992,_0x2c2081[_0x91a1('0x47')]);return _0x54b12f[_0x91a1('0x4f')](_0x538992);}})[_0x91a1('0x28')](function(_0x44b75e){if(_0x44b75e){_0xe0da15=_0x44b75e['length'];if(!_0x2c2081[_0x91a1('0x30')][_0x91a1('0x38')](_0x91a1('0x39'))){_0x538992[_0x91a1('0x1f')]=qs[_0x91a1('0x1f')](_0x2c2081['query'][_0x91a1('0x1f')]);_0x538992['offset']=qs['offset'](_0x2c2081['query']['offset']);}return _0x54b12f[_0x91a1('0x4f')](_0x538992);}})[_0x91a1('0x28')](function(_0x1b03e4){if(_0x1b03e4){return _0x1b03e4?{'count':_0xe0da15,'rows':_0x1b03e4}:null;}})[_0x91a1('0x28')](respondWithResult(_0x46fcdc,null))[_0x91a1('0x43')](handleError(_0x46fcdc,null));};exports[_0x91a1('0x50')]=function(_0xb6cddf,_0x596cf4,_0x3dbca1){var _0x128ba1={};var _0x510866={};var _0x51a071;var _0x164a71;return db[_0x91a1('0x2d')][_0x91a1('0x4c')]({'where':{'id':_0xb6cddf[_0x91a1('0x45')]['id']}})[_0x91a1('0x28')](handleEntityNotFound(_0x596cf4,null))[_0x91a1('0x28')](function(_0x390351){if(_0x390351){_0x51a071=_0x390351;_0x510866[_0x91a1('0x34')]=_[_0x91a1('0x31')](db['ZohoField'][_0x91a1('0x46')]);_0x510866['query']=_['keys'](_0xb6cddf[_0x91a1('0x30')]);_0x510866[_0x91a1('0x32')]=_[_0x91a1('0x33')](_0x510866[_0x91a1('0x34')],_0x510866['query']);_0x128ba1[_0x91a1('0x36')]=_[_0x91a1('0x33')](_0x510866['model'],qs[_0x91a1('0x35')](_0xb6cddf[_0x91a1('0x30')][_0x91a1('0x35')]));_0x128ba1[_0x91a1('0x36')]=_0x128ba1[_0x91a1('0x36')]['length']?_0x128ba1[_0x91a1('0x36')]:_0x510866[_0x91a1('0x34')];_0x128ba1['order']=qs['sort'](_0xb6cddf[_0x91a1('0x30')]['sort']);_0x128ba1[_0x91a1('0x3c')]=qs[_0x91a1('0x32')](_[_0x91a1('0x4e')](_0xb6cddf[_0x91a1('0x30')],_0x510866[_0x91a1('0x32')]));if(_0xb6cddf[_0x91a1('0x30')][_0x91a1('0x3d')]){_0x128ba1['where']=_['merge'](_0x128ba1[_0x91a1('0x3c')],{'$or':_['map'](_0x128ba1['attributes'],function(_0x3815de){var _0x29b3b2={};_0x29b3b2[_0x3815de]={'$like':'%'+_0xb6cddf[_0x91a1('0x30')][_0x91a1('0x3d')]+'%'};return _0x29b3b2;})});}_0x128ba1=_[_0x91a1('0x3e')]({},_0x128ba1,_0xb6cddf[_0x91a1('0x47')]);return _0x51a071[_0x91a1('0x50')](_0x128ba1);}})['then'](function(_0x1a290f){if(_0x1a290f){_0x164a71=_0x1a290f[_0x91a1('0x37')];if(!_0xb6cddf[_0x91a1('0x30')][_0x91a1('0x38')]('nolimit')){_0x128ba1['limit']=qs[_0x91a1('0x1f')](_0xb6cddf['query'][_0x91a1('0x1f')]);_0x128ba1['offset']=qs['offset'](_0xb6cddf[_0x91a1('0x30')][_0x91a1('0x22')]);}return _0x51a071[_0x91a1('0x50')](_0x128ba1);}})[_0x91a1('0x28')](function(_0x253097){if(_0x253097){return _0x253097?{'count':_0x164a71,'rows':_0x253097}:null;}})[_0x91a1('0x28')](respondWithResult(_0x596cf4,null))[_0x91a1('0x43')](handleError(_0x596cf4,null));};exports['getDescriptions']=function(_0x3845ea,_0x574a5a,_0x4aa3fc){var _0x25d6a3={};var _0x53877d={};var _0x2d5b50;var _0x3d57b5;return db[_0x91a1('0x2d')]['findOne']({'where':{'id':_0x3845ea[_0x91a1('0x45')]['id']}})[_0x91a1('0x28')](handleEntityNotFound(_0x574a5a,null))[_0x91a1('0x28')](function(_0x1c2e6a){if(_0x1c2e6a){_0x2d5b50=_0x1c2e6a;_0x53877d['model']=_[_0x91a1('0x31')](db['ZohoField']['rawAttributes']);_0x53877d[_0x91a1('0x30')]=_[_0x91a1('0x31')](_0x3845ea['query']);_0x53877d['filters']=_[_0x91a1('0x33')](_0x53877d[_0x91a1('0x34')],_0x53877d[_0x91a1('0x30')]);_0x25d6a3[_0x91a1('0x36')]=_[_0x91a1('0x33')](_0x53877d[_0x91a1('0x34')],qs[_0x91a1('0x35')](_0x3845ea[_0x91a1('0x30')]['fields']));_0x25d6a3[_0x91a1('0x36')]=_0x25d6a3[_0x91a1('0x36')][_0x91a1('0x37')]?_0x25d6a3['attributes']:_0x53877d[_0x91a1('0x34')];_0x25d6a3['order']=qs['sort'](_0x3845ea[_0x91a1('0x30')]['sort']);_0x25d6a3['where']=qs[_0x91a1('0x32')](_['pick'](_0x3845ea[_0x91a1('0x30')],_0x53877d[_0x91a1('0x32')]));if(_0x3845ea[_0x91a1('0x30')][_0x91a1('0x3d')]){_0x25d6a3['where']=_['merge'](_0x25d6a3['where'],{'$or':_[_0x91a1('0x2c')](_0x25d6a3[_0x91a1('0x36')],function(_0x3f11d0){var _0x1e6fc9={};_0x1e6fc9[_0x3f11d0]={'$like':'%'+_0x3845ea['query']['filter']+'%'};return _0x1e6fc9;})});}_0x25d6a3=_[_0x91a1('0x3e')]({},_0x25d6a3,_0x3845ea[_0x91a1('0x47')]);return _0x2d5b50['getDescriptions'](_0x25d6a3);}})[_0x91a1('0x28')](function(_0x23680a){if(_0x23680a){_0x3d57b5=_0x23680a[_0x91a1('0x37')];if(!_0x3845ea[_0x91a1('0x30')][_0x91a1('0x38')](_0x91a1('0x39'))){_0x25d6a3[_0x91a1('0x1f')]=qs[_0x91a1('0x1f')](_0x3845ea[_0x91a1('0x30')][_0x91a1('0x1f')]);_0x25d6a3[_0x91a1('0x22')]=qs[_0x91a1('0x22')](_0x3845ea[_0x91a1('0x30')][_0x91a1('0x22')]);}return _0x2d5b50[_0x91a1('0x51')](_0x25d6a3);}})['then'](function(_0x5aee37){if(_0x5aee37){return _0x5aee37?{'count':_0x3d57b5,'rows':_0x5aee37}:null;}})['then'](respondWithResult(_0x574a5a,null))['catch'](handleError(_0x574a5a,null));}; \ No newline at end of file +var _0xf80b=['send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','ZohoConfiguration','includeAll','include','findAll','rows','catch','params','find','create','body','findOne','ZohoField','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name'];(function(_0x284900,_0x580d3b){var _0x2e35ce=function(_0x3985b0){while(--_0x3985b0){_0x284900['push'](_0x284900['shift']());}};_0x2e35ce(++_0x580d3b);}(_0xf80b,0x1c9));var _0xbf80=function(_0x1ce5c1,_0x2b72ec){_0x1ce5c1=_0x1ce5c1-0x0;var _0x2e784b=_0xf80b[_0x1ce5c1];return _0x2e784b;};'use strict';var emlformat=require(_0xbf80('0x0'));var rimraf=require(_0xbf80('0x1'));var zipdir=require(_0xbf80('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf80('0x3'));var moment=require(_0xbf80('0x4'));var BPromise=require(_0xbf80('0x5'));var Mustache=require(_0xbf80('0x6'));var util=require(_0xbf80('0x7'));var path=require(_0xbf80('0x8'));var sox=require(_0xbf80('0x9'));var csv=require(_0xbf80('0xa'));var ejs=require(_0xbf80('0xb'));var fs=require('fs');var fs_extra=require(_0xbf80('0xc'));var _=require(_0xbf80('0xd'));var squel=require(_0xbf80('0xe'));var crypto=require(_0xbf80('0xf'));var jsforce=require(_0xbf80('0x10'));var deskjs=require(_0xbf80('0x11'));var toCsv=require('to-csv');var querystring=require(_0xbf80('0x12'));var Papa=require(_0xbf80('0x13'));var Redis=require('ioredis');var authService=require(_0xbf80('0x14'));var qs=require(_0xbf80('0x15'));var as=require(_0xbf80('0x16'));var hardwareService=require(_0xbf80('0x17'));var logger=require(_0xbf80('0x18'))(_0xbf80('0x19'));var utils=require(_0xbf80('0x1a'));var config=require(_0xbf80('0x1b'));var licenseUtil=require(_0xbf80('0x1c'));var db=require(_0xbf80('0x1d'))['db'];function respondWithStatusCode(_0xe17934,_0x1b3cb2){_0x1b3cb2=_0x1b3cb2||0xcc;return function(_0x11bed0){if(_0x11bed0){return _0xe17934[_0xbf80('0x1e')](_0x1b3cb2);}return _0xe17934['status'](_0x1b3cb2)['end']();};}function respondWithResult(_0x3ab04f,_0x3d177a){_0x3d177a=_0x3d177a||0xc8;return function(_0x568e23){if(_0x568e23){return _0x3ab04f[_0xbf80('0x1f')](_0x3d177a)[_0xbf80('0x20')](_0x568e23);}};}function respondWithFilteredResult(_0x7e9500,_0x3368cc){return function(_0x13b17e){if(_0x13b17e){var _0xe0b421=typeof _0x3368cc[_0xbf80('0x21')]===_0xbf80('0x22')&&typeof _0x3368cc['limit']==='undefined';var _0x587bf5=_0x13b17e['count'];var _0x3bdd44=_0xe0b421?0x0:_0x3368cc[_0xbf80('0x21')];var _0xc70b63=_0xe0b421?_0x13b17e['count']:_0x3368cc['offset']+_0x3368cc[_0xbf80('0x23')];var _0x485e89;if(_0xc70b63>=_0x587bf5){_0xc70b63=_0x587bf5;_0x485e89=0xc8;}else{_0x485e89=0xce;}_0x7e9500['status'](_0x485e89);return _0x7e9500['set'](_0xbf80('0x24'),_0x3bdd44+'-'+_0xc70b63+'/'+_0x587bf5)[_0xbf80('0x20')](_0x13b17e);}return null;};}function patchUpdates(_0x425988){return function(_0x5a5638){try{jsonpatch[_0xbf80('0x25')](_0x5a5638,_0x425988,!![]);}catch(_0x460df1){return BPromise[_0xbf80('0x26')](_0x460df1);}return _0x5a5638[_0xbf80('0x27')]();};}function saveUpdates(_0x413ee2,_0x50f737){return function(_0x20db5c){if(_0x20db5c){return _0x20db5c[_0xbf80('0x28')](_0x413ee2)[_0xbf80('0x29')](function(_0x1b80b7){return _0x1b80b7;});}return null;};}function removeEntity(_0x5ebd1b,_0x2ba0fe){return function(_0x2f617d){if(_0x2f617d){return _0x2f617d[_0xbf80('0x2a')]()[_0xbf80('0x29')](function(){_0x5ebd1b['status'](0xcc)[_0xbf80('0x2b')]();});}};}function handleEntityNotFound(_0x114eda,_0x5c4254){return function(_0x3341a7){if(!_0x3341a7){_0x114eda[_0xbf80('0x1e')](0x194);}return _0x3341a7;};}function handleError(_0x22dcc4,_0x1d07fc){_0x1d07fc=_0x1d07fc||0x1f4;return function(_0x430e30){logger[_0xbf80('0x2c')](_0x430e30[_0xbf80('0x2d')]);if(_0x430e30['name']){delete _0x430e30[_0xbf80('0x2e')];}_0x22dcc4['status'](_0x1d07fc)[_0xbf80('0x2f')](_0x430e30);};}exports['index']=function(_0x191fc1,_0x312f26){var _0x2157b0={},_0x4de738={},_0x563548={'count':0x0,'rows':[]};var _0x43fac1=_[_0xbf80('0x30')](db['ZohoConfiguration'][_0xbf80('0x31')],function(_0x13be84){return{'name':_0x13be84[_0xbf80('0x32')],'type':_0x13be84[_0xbf80('0x33')][_0xbf80('0x34')]};});_0x4de738[_0xbf80('0x35')]=_[_0xbf80('0x30')](_0x43fac1,_0xbf80('0x2e'));_0x4de738[_0xbf80('0x36')]=_[_0xbf80('0x37')](_0x191fc1[_0xbf80('0x36')]);_0x4de738[_0xbf80('0x38')]=_[_0xbf80('0x39')](_0x4de738[_0xbf80('0x35')],_0x4de738[_0xbf80('0x36')]);_0x2157b0[_0xbf80('0x3a')]=_[_0xbf80('0x39')](_0x4de738[_0xbf80('0x35')],qs[_0xbf80('0x3b')](_0x191fc1['query'][_0xbf80('0x3b')]));_0x2157b0[_0xbf80('0x3a')]=_0x2157b0[_0xbf80('0x3a')][_0xbf80('0x3c')]?_0x2157b0[_0xbf80('0x3a')]:_0x4de738[_0xbf80('0x35')];if(!_0x191fc1[_0xbf80('0x36')][_0xbf80('0x3d')]('nolimit')){_0x2157b0[_0xbf80('0x23')]=qs[_0xbf80('0x23')](_0x191fc1[_0xbf80('0x36')][_0xbf80('0x23')]);_0x2157b0[_0xbf80('0x21')]=qs[_0xbf80('0x21')](_0x191fc1[_0xbf80('0x36')][_0xbf80('0x21')]);}_0x2157b0[_0xbf80('0x3e')]=qs['sort'](_0x191fc1[_0xbf80('0x36')][_0xbf80('0x3f')]);_0x2157b0[_0xbf80('0x40')]=qs[_0xbf80('0x38')](_[_0xbf80('0x41')](_0x191fc1[_0xbf80('0x36')],_0x4de738[_0xbf80('0x38')]),_0x43fac1);if(_0x191fc1[_0xbf80('0x36')][_0xbf80('0x42')]){_0x2157b0['where']=_[_0xbf80('0x43')](_0x2157b0['where'],{'$or':_['map'](_0x43fac1,function(_0x46810c){if(_0x46810c['type']!=='VIRTUAL'){var _0x4fbc36={};_0x4fbc36[_0x46810c[_0xbf80('0x2e')]]={'$like':'%'+_0x191fc1[_0xbf80('0x36')][_0xbf80('0x42')]+'%'};return _0x4fbc36;}})});}_0x2157b0=_['merge']({},_0x2157b0,_0x191fc1[_0xbf80('0x44')]);var _0x281e81={'where':_0x2157b0[_0xbf80('0x40')]};return db[_0xbf80('0x45')]['count'](_0x281e81)[_0xbf80('0x29')](function(_0x13417c){_0x563548['count']=_0x13417c;if(_0x191fc1['query'][_0xbf80('0x46')]){_0x2157b0[_0xbf80('0x47')]=[{'all':!![]}];}return db[_0xbf80('0x45')][_0xbf80('0x48')](_0x2157b0);})[_0xbf80('0x29')](function(_0x2a3be6){_0x563548[_0xbf80('0x49')]=_0x2a3be6;return _0x563548;})[_0xbf80('0x29')](respondWithFilteredResult(_0x312f26,_0x2157b0))[_0xbf80('0x4a')](handleError(_0x312f26,null));};exports['show']=function(_0x2915e4,_0x40357f){var _0x2ac050={'raw':![],'where':{'id':_0x2915e4[_0xbf80('0x4b')]['id']}},_0x59a632={};_0x59a632['model']=_[_0xbf80('0x37')](db[_0xbf80('0x45')]['rawAttributes']);_0x59a632[_0xbf80('0x36')]=_[_0xbf80('0x37')](_0x2915e4['query']);_0x59a632[_0xbf80('0x38')]=_['intersection'](_0x59a632[_0xbf80('0x35')],_0x59a632[_0xbf80('0x36')]);_0x2ac050[_0xbf80('0x3a')]=_[_0xbf80('0x39')](_0x59a632[_0xbf80('0x35')],qs[_0xbf80('0x3b')](_0x2915e4['query']['fields']));_0x2ac050[_0xbf80('0x3a')]=_0x2ac050[_0xbf80('0x3a')][_0xbf80('0x3c')]?_0x2ac050[_0xbf80('0x3a')]:_0x59a632[_0xbf80('0x35')];if(_0x2915e4[_0xbf80('0x36')][_0xbf80('0x46')]){_0x2ac050['include']=[{'all':!![]}];}_0x2ac050=_[_0xbf80('0x43')]({},_0x2ac050,_0x2915e4[_0xbf80('0x44')]);return db[_0xbf80('0x45')][_0xbf80('0x4c')](_0x2ac050)['then'](handleEntityNotFound(_0x40357f,null))['then'](respondWithResult(_0x40357f,null))[_0xbf80('0x4a')](handleError(_0x40357f,null));};exports[_0xbf80('0x4d')]=function(_0x541dfd,_0x3eb702){return db[_0xbf80('0x45')][_0xbf80('0x4d')](_0x541dfd['body'],{})[_0xbf80('0x29')](respondWithResult(_0x3eb702,0xc9))['catch'](handleError(_0x3eb702,null));};exports[_0xbf80('0x28')]=function(_0x3a160a,_0xa24821){if(_0x3a160a['body']['id']){delete _0x3a160a[_0xbf80('0x4e')]['id'];}return db[_0xbf80('0x45')][_0xbf80('0x4c')]({'where':{'id':_0x3a160a[_0xbf80('0x4b')]['id']}})[_0xbf80('0x29')](handleEntityNotFound(_0xa24821,null))[_0xbf80('0x29')](saveUpdates(_0x3a160a['body'],null))[_0xbf80('0x29')](respondWithResult(_0xa24821,null))[_0xbf80('0x4a')](handleError(_0xa24821,null));};exports[_0xbf80('0x2a')]=function(_0x316187,_0x474c8b){return db[_0xbf80('0x45')][_0xbf80('0x4c')]({'where':{'id':_0x316187[_0xbf80('0x4b')]['id']}})[_0xbf80('0x29')](handleEntityNotFound(_0x474c8b,null))[_0xbf80('0x29')](removeEntity(_0x474c8b,null))[_0xbf80('0x4a')](handleError(_0x474c8b,null));};exports['getFields']=function(_0x2af46f,_0x2fb950,_0x43f983){var _0x1cd33b={};var _0x120852={};var _0x538fa7;var _0x35e8be;return db['ZohoConfiguration'][_0xbf80('0x4f')]({'where':{'id':_0x2af46f[_0xbf80('0x4b')]['id']}})[_0xbf80('0x29')](handleEntityNotFound(_0x2fb950,null))[_0xbf80('0x29')](function(_0x48d7cd){if(_0x48d7cd){_0x538fa7=_0x48d7cd;_0x120852[_0xbf80('0x35')]=_[_0xbf80('0x37')](db[_0xbf80('0x50')][_0xbf80('0x31')]);_0x120852[_0xbf80('0x36')]=_['keys'](_0x2af46f['query']);_0x120852[_0xbf80('0x38')]=_['intersection'](_0x120852[_0xbf80('0x35')],_0x120852[_0xbf80('0x36')]);_0x1cd33b[_0xbf80('0x3a')]=_['intersection'](_0x120852[_0xbf80('0x35')],qs[_0xbf80('0x3b')](_0x2af46f['query'][_0xbf80('0x3b')]));_0x1cd33b[_0xbf80('0x3a')]=_0x1cd33b[_0xbf80('0x3a')][_0xbf80('0x3c')]?_0x1cd33b['attributes']:_0x120852[_0xbf80('0x35')];_0x1cd33b['order']=qs[_0xbf80('0x3f')](_0x2af46f[_0xbf80('0x36')]['sort']);_0x1cd33b[_0xbf80('0x40')]=qs[_0xbf80('0x38')](_[_0xbf80('0x41')](_0x2af46f[_0xbf80('0x36')],_0x120852[_0xbf80('0x38')]));if(_0x2af46f[_0xbf80('0x36')][_0xbf80('0x42')]){_0x1cd33b[_0xbf80('0x40')]=_['merge'](_0x1cd33b[_0xbf80('0x40')],{'$or':_['map'](_0x1cd33b[_0xbf80('0x3a')],function(_0x387e98){var _0x4fdafb={};_0x4fdafb[_0x387e98]={'$like':'%'+_0x2af46f[_0xbf80('0x36')][_0xbf80('0x42')]+'%'};return _0x4fdafb;})});}_0x1cd33b=_[_0xbf80('0x43')]({},_0x1cd33b,_0x2af46f[_0xbf80('0x44')]);return _0x538fa7['getFields'](_0x1cd33b);}})[_0xbf80('0x29')](function(_0x3e4e28){if(_0x3e4e28){_0x35e8be=_0x3e4e28['length'];if(!_0x2af46f[_0xbf80('0x36')][_0xbf80('0x3d')]('nolimit')){_0x1cd33b[_0xbf80('0x23')]=qs[_0xbf80('0x23')](_0x2af46f['query'][_0xbf80('0x23')]);_0x1cd33b['offset']=qs[_0xbf80('0x21')](_0x2af46f[_0xbf80('0x36')][_0xbf80('0x21')]);}return _0x538fa7['getFields'](_0x1cd33b);}})[_0xbf80('0x29')](function(_0xc0ebcb){if(_0xc0ebcb){return _0xc0ebcb?{'count':_0x35e8be,'rows':_0xc0ebcb}:null;}})[_0xbf80('0x29')](respondWithResult(_0x2fb950,null))['catch'](handleError(_0x2fb950,null));};exports['getSubjects']=function(_0x22e1d8,_0x11f9c6,_0x1d9476){var _0x35ea6f={};var _0xe83b5f={};var _0x2f3921;var _0x1aa2ed;return db[_0xbf80('0x45')][_0xbf80('0x4f')]({'where':{'id':_0x22e1d8[_0xbf80('0x4b')]['id']}})[_0xbf80('0x29')](handleEntityNotFound(_0x11f9c6,null))[_0xbf80('0x29')](function(_0x58d0ef){if(_0x58d0ef){_0x2f3921=_0x58d0ef;_0xe83b5f[_0xbf80('0x35')]=_[_0xbf80('0x37')](db[_0xbf80('0x50')][_0xbf80('0x31')]);_0xe83b5f[_0xbf80('0x36')]=_[_0xbf80('0x37')](_0x22e1d8[_0xbf80('0x36')]);_0xe83b5f[_0xbf80('0x38')]=_[_0xbf80('0x39')](_0xe83b5f['model'],_0xe83b5f[_0xbf80('0x36')]);_0x35ea6f['attributes']=_[_0xbf80('0x39')](_0xe83b5f['model'],qs['fields'](_0x22e1d8['query'][_0xbf80('0x3b')]));_0x35ea6f['attributes']=_0x35ea6f[_0xbf80('0x3a')]['length']?_0x35ea6f['attributes']:_0xe83b5f[_0xbf80('0x35')];_0x35ea6f[_0xbf80('0x3e')]=qs[_0xbf80('0x3f')](_0x22e1d8[_0xbf80('0x36')][_0xbf80('0x3f')]);_0x35ea6f[_0xbf80('0x40')]=qs[_0xbf80('0x38')](_[_0xbf80('0x41')](_0x22e1d8[_0xbf80('0x36')],_0xe83b5f[_0xbf80('0x38')]));if(_0x22e1d8[_0xbf80('0x36')][_0xbf80('0x42')]){_0x35ea6f['where']=_[_0xbf80('0x43')](_0x35ea6f[_0xbf80('0x40')],{'$or':_['map'](_0x35ea6f['attributes'],function(_0x55eebd){var _0x4d0a95={};_0x4d0a95[_0x55eebd]={'$like':'%'+_0x22e1d8[_0xbf80('0x36')][_0xbf80('0x42')]+'%'};return _0x4d0a95;})});}_0x35ea6f=_[_0xbf80('0x43')]({},_0x35ea6f,_0x22e1d8[_0xbf80('0x44')]);return _0x2f3921[_0xbf80('0x51')](_0x35ea6f);}})['then'](function(_0x52e638){if(_0x52e638){_0x1aa2ed=_0x52e638['length'];if(!_0x22e1d8[_0xbf80('0x36')][_0xbf80('0x3d')](_0xbf80('0x52'))){_0x35ea6f['limit']=qs[_0xbf80('0x23')](_0x22e1d8[_0xbf80('0x36')][_0xbf80('0x23')]);_0x35ea6f[_0xbf80('0x21')]=qs[_0xbf80('0x21')](_0x22e1d8[_0xbf80('0x36')][_0xbf80('0x21')]);}return _0x2f3921['getSubjects'](_0x35ea6f);}})['then'](function(_0x3ba890){if(_0x3ba890){return _0x3ba890?{'count':_0x1aa2ed,'rows':_0x3ba890}:null;}})['then'](respondWithResult(_0x11f9c6,null))[_0xbf80('0x4a')](handleError(_0x11f9c6,null));};exports[_0xbf80('0x53')]=function(_0x39740a,_0x51cce0,_0x1550bf){var _0x324dda={};var _0x376494={};var _0x2e46cf;var _0x3475d7;return db[_0xbf80('0x45')][_0xbf80('0x4f')]({'where':{'id':_0x39740a[_0xbf80('0x4b')]['id']}})['then'](handleEntityNotFound(_0x51cce0,null))[_0xbf80('0x29')](function(_0x1106a6){if(_0x1106a6){_0x2e46cf=_0x1106a6;_0x376494['model']=_['keys'](db[_0xbf80('0x50')][_0xbf80('0x31')]);_0x376494[_0xbf80('0x36')]=_[_0xbf80('0x37')](_0x39740a[_0xbf80('0x36')]);_0x376494[_0xbf80('0x38')]=_[_0xbf80('0x39')](_0x376494[_0xbf80('0x35')],_0x376494[_0xbf80('0x36')]);_0x324dda[_0xbf80('0x3a')]=_[_0xbf80('0x39')](_0x376494['model'],qs[_0xbf80('0x3b')](_0x39740a[_0xbf80('0x36')][_0xbf80('0x3b')]));_0x324dda['attributes']=_0x324dda[_0xbf80('0x3a')][_0xbf80('0x3c')]?_0x324dda[_0xbf80('0x3a')]:_0x376494['model'];_0x324dda[_0xbf80('0x3e')]=qs[_0xbf80('0x3f')](_0x39740a[_0xbf80('0x36')][_0xbf80('0x3f')]);_0x324dda[_0xbf80('0x40')]=qs[_0xbf80('0x38')](_[_0xbf80('0x41')](_0x39740a[_0xbf80('0x36')],_0x376494['filters']));if(_0x39740a['query'][_0xbf80('0x42')]){_0x324dda[_0xbf80('0x40')]=_['merge'](_0x324dda[_0xbf80('0x40')],{'$or':_['map'](_0x324dda[_0xbf80('0x3a')],function(_0x4731bf){var _0x1503b4={};_0x1503b4[_0x4731bf]={'$like':'%'+_0x39740a['query']['filter']+'%'};return _0x1503b4;})});}_0x324dda=_[_0xbf80('0x43')]({},_0x324dda,_0x39740a['options']);return _0x2e46cf[_0xbf80('0x53')](_0x324dda);}})[_0xbf80('0x29')](function(_0x32c6cc){if(_0x32c6cc){_0x3475d7=_0x32c6cc['length'];if(!_0x39740a[_0xbf80('0x36')][_0xbf80('0x3d')](_0xbf80('0x52'))){_0x324dda[_0xbf80('0x23')]=qs[_0xbf80('0x23')](_0x39740a[_0xbf80('0x36')]['limit']);_0x324dda[_0xbf80('0x21')]=qs['offset'](_0x39740a[_0xbf80('0x36')][_0xbf80('0x21')]);}return _0x2e46cf[_0xbf80('0x53')](_0x324dda);}})[_0xbf80('0x29')](function(_0x264915){if(_0x264915){return _0x264915?{'count':_0x3475d7,'rows':_0x264915}:null;}})[_0xbf80('0x29')](respondWithResult(_0x51cce0,null))[_0xbf80('0x4a')](handleError(_0x51cce0,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 1f8a311..9771a09 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 _0x5fd9=['./intZohoConfiguration.attributes','exports','define','int_zoho_configurations','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x3f7595,_0x2c5b60){var _0x225030=function(_0x3e8545){while(--_0x3e8545){_0x3f7595['push'](_0x3f7595['shift']());}};_0x225030(++_0x2c5b60);}(_0x5fd9,0x13a));var _0x95fd=function(_0x37914d,_0x4209c0){_0x37914d=_0x37914d-0x0;var _0x2b4118=_0x5fd9[_0x37914d];return _0x2b4118;};'use strict';var _=require(_0x95fd('0x0'));var util=require(_0x95fd('0x1'));var logger=require(_0x95fd('0x2'))('api');var moment=require(_0x95fd('0x3'));var BPromise=require('bluebird');var rp=require(_0x95fd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95fd('0x5'));var config=require('../../config/environment');var attributes=require(_0x95fd('0x6'));module[_0x95fd('0x7')]=function(_0x189d7c,_0x5d3ff7){return _0x189d7c[_0x95fd('0x8')]('ZohoConfiguration',attributes,{'tableName':_0x95fd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8591=['ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define'];(function(_0x2802a8,_0xa188a3){var _0x4178ba=function(_0x54539c){while(--_0x54539c){_0x2802a8['push'](_0x2802a8['shift']());}};_0x4178ba(++_0xa188a3);}(_0x8591,0x13d));var _0x1859=function(_0x1b7ee7,_0x1f41db){_0x1b7ee7=_0x1b7ee7-0x0;var _0x2edf22=_0x8591[_0x1b7ee7];return _0x2edf22;};'use strict';var _=require(_0x1859('0x0'));var util=require(_0x1859('0x1'));var logger=require(_0x1859('0x2'))(_0x1859('0x3'));var moment=require(_0x1859('0x4'));var BPromise=require(_0x1859('0x5'));var rp=require(_0x1859('0x6'));var fs=require('fs');var path=require(_0x1859('0x7'));var rimraf=require(_0x1859('0x8'));var config=require(_0x1859('0x9'));var attributes=require(_0x1859('0xa'));module[_0x1859('0xb')]=function(_0x565f92,_0x10b060){return _0x565f92[_0x1859('0xc')](_0x1859('0xd'),attributes,{'tableName':_0x1859('0xe'),'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 e68672c..2216a61 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 _0x0e10=['rpc','../../config/environment','jayson/promise','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4e6eef,_0x212f65){var _0x36eff5=function(_0x165d32){while(--_0x165d32){_0x4e6eef['push'](_0x4e6eef['shift']());}};_0x36eff5(++_0x212f65);}(_0x0e10,0x126));var _0x00e1=function(_0x3fed61,_0x440894){_0x3fed61=_0x3fed61-0x0;var _0x5bf937=_0x0e10[_0x3fed61];return _0x5bf937;};'use strict';var _=require(_0x00e1('0x0'));var util=require(_0x00e1('0x1'));var moment=require('moment');var BPromise=require(_0x00e1('0x2'));var rs=require(_0x00e1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x00e1('0x4'))['db'];var utils=require(_0x00e1('0x5'));var logger=require('../../config/logger')(_0x00e1('0x6'));var config=require(_0x00e1('0x7'));var jayson=require(_0x00e1('0x8'));var client=jayson['client'][_0x00e1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x184475,_0x501e2f,_0x40ca59){return new BPromise(function(_0x5da53e,_0x154564){return client['request'](_0x184475,_0x40ca59)[_0x00e1('0xa')](function(_0x4e9ff6){logger[_0x00e1('0xb')](_0x00e1('0xc'),_0x501e2f,_0x00e1('0xd'));logger['debug'](_0x00e1('0xe'),_0x501e2f,_0x00e1('0xd'),JSON['stringify'](_0x4e9ff6));if(_0x4e9ff6['error']){if(_0x4e9ff6[_0x00e1('0xf')][_0x00e1('0x10')]===0x1f4){logger[_0x00e1('0xf')](_0x00e1('0xc'),_0x501e2f,_0x4e9ff6[_0x00e1('0xf')][_0x00e1('0x11')]);return _0x154564(_0x4e9ff6[_0x00e1('0xf')][_0x00e1('0x11')]);}logger[_0x00e1('0xf')](_0x00e1('0xc'),_0x501e2f,_0x4e9ff6[_0x00e1('0xf')]['message']);return _0x5da53e(_0x4e9ff6[_0x00e1('0xf')][_0x00e1('0x11')]);}else{logger[_0x00e1('0xb')](_0x00e1('0xc'),_0x501e2f,'request\x20sent');_0x5da53e(_0x4e9ff6[_0x00e1('0x12')][_0x00e1('0x11')]);}})[_0x00e1('0x13')](function(_0x19720e){logger[_0x00e1('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x501e2f,_0x19720e);_0x154564(_0x19720e);});});} \ No newline at end of file +var _0xea10=['result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x4b74bf,_0x22aa55){var _0x3e59e4=function(_0x917084){while(--_0x917084){_0x4b74bf['push'](_0x4b74bf['shift']());}};_0x3e59e4(++_0x22aa55);}(_0xea10,0x1cd));var _0x0ea1=function(_0x3b0369,_0x27cae8){_0x3b0369=_0x3b0369-0x0;var _0x37d926=_0xea10[_0x3b0369];return _0x37d926;};'use strict';var _=require(_0x0ea1('0x0'));var util=require('util');var moment=require(_0x0ea1('0x1'));var BPromise=require(_0x0ea1('0x2'));var rs=require(_0x0ea1('0x3'));var fs=require('fs');var Redis=require(_0x0ea1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ea1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0ea1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0ea1('0x7')][_0x0ea1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x433d71,_0x492fa9,_0x3b143e){return new BPromise(function(_0x38733d,_0x31fbca){return client[_0x0ea1('0x9')](_0x433d71,_0x3b143e)[_0x0ea1('0xa')](function(_0xcef72c){logger[_0x0ea1('0xb')](_0x0ea1('0xc'),_0x492fa9,'request\x20sent');logger[_0x0ea1('0xd')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x492fa9,_0x0ea1('0xe'),JSON[_0x0ea1('0xf')](_0xcef72c));if(_0xcef72c['error']){if(_0xcef72c[_0x0ea1('0x10')][_0x0ea1('0x11')]===0x1f4){logger[_0x0ea1('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x492fa9,_0xcef72c[_0x0ea1('0x10')][_0x0ea1('0x12')]);return _0x31fbca(_0xcef72c[_0x0ea1('0x10')][_0x0ea1('0x12')]);}logger[_0x0ea1('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x492fa9,_0xcef72c[_0x0ea1('0x10')][_0x0ea1('0x12')]);return _0x38733d(_0xcef72c['error'][_0x0ea1('0x12')]);}else{logger[_0x0ea1('0xb')](_0x0ea1('0xc'),_0x492fa9,_0x0ea1('0xe'));_0x38733d(_0xcef72c[_0x0ea1('0x13')][_0x0ea1('0x12')]);}})['catch'](function(_0x469027){logger[_0x0ea1('0x10')](_0x0ea1('0xc'),_0x492fa9,_0x469027);_0x31fbca(_0x469027);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 3894d8b..b4ed501 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 _0xcae1=['isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','post','create','update','delete'];(function(_0x113508,_0x445931){var _0x291e82=function(_0x4b9f85){while(--_0x4b9f85){_0x113508['push'](_0x113508['shift']());}};_0x291e82(++_0x445931);}(_0xcae1,0xdf));var _0x1cae=function(_0x374dd6,_0xadc0eb){_0x374dd6=_0x374dd6-0x0;var _0x1aadd0=_0xcae1[_0x374dd6];return _0x1aadd0;};'use strict';var multer=require(_0x1cae('0x0'));var util=require(_0x1cae('0x1'));var path=require(_0x1cae('0x2'));var timeout=require(_0x1cae('0x3'));var express=require(_0x1cae('0x4'));var router=express[_0x1cae('0x5')]();var fs_extra=require(_0x1cae('0x6'));var auth=require(_0x1cae('0x7'));var interaction=require(_0x1cae('0x8'));var config=require(_0x1cae('0x9'));var controller=require('./intZohoField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1cae('0xa')]);router[_0x1cae('0xb')](_0x1cae('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x1cae('0xd')]('/',auth['isAuthenticated'](),controller[_0x1cae('0xe')]);router['put'](_0x1cae('0xc'),auth['isAuthenticated'](),controller[_0x1cae('0xf')]);router[_0x1cae('0x10')](_0x1cae('0xc'),auth[_0x1cae('0x11')](),controller[_0x1cae('0x12')]);module[_0x1cae('0x13')]=router; \ No newline at end of file +var _0xd8e2=['get','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','isAuthenticated'];(function(_0x2c11eb,_0x2a68b1){var _0x467d26=function(_0x123032){while(--_0x123032){_0x2c11eb['push'](_0x2c11eb['shift']());}};_0x467d26(++_0x2a68b1);}(_0xd8e2,0xe7));var _0x2d8e=function(_0x547388,_0x519ad5){_0x547388=_0x547388-0x0;var _0x546c9a=_0xd8e2[_0x547388];return _0x546c9a;};'use strict';var multer=require(_0x2d8e('0x0'));var util=require('util');var path=require(_0x2d8e('0x1'));var timeout=require(_0x2d8e('0x2'));var express=require(_0x2d8e('0x3'));var router=express['Router']();var fs_extra=require(_0x2d8e('0x4'));var auth=require(_0x2d8e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoField.controller');router['get']('/',auth[_0x2d8e('0x6')](),controller['index']);router[_0x2d8e('0x7')]('/:id',auth[_0x2d8e('0x6')](),controller[_0x2d8e('0x8')]);router[_0x2d8e('0x9')]('/',auth[_0x2d8e('0x6')](),controller[_0x2d8e('0xa')]);router[_0x2d8e('0xb')](_0x2d8e('0xc'),auth[_0x2d8e('0x6')](),controller[_0x2d8e('0xd')]);router[_0x2d8e('0xe')](_0x2d8e('0xc'),auth[_0x2d8e('0x6')](),controller[_0x2d8e('0xf')]);module[_0x2d8e('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 a79d3d8..cdae16c 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 _0x3c2f=['BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','picklist','string','STRING','variable'];(function(_0x5e8e61,_0x3dfd31){var _0x4db3db=function(_0x38b1e2){while(--_0x38b1e2){_0x5e8e61['push'](_0x5e8e61['shift']());}};_0x4db3db(++_0x3dfd31);}(_0x3c2f,0xe7));var _0xf3c2=function(_0x4f484c,_0x9bccb4){_0x4f484c=_0x4f484c-0x0;var _0x276e95=_0x3c2f[_0x4f484c];return _0x276e95;};'use strict';var Sequelize=require(_0xf3c2('0x0'));module[_0xf3c2('0x1')]={'type':{'type':Sequelize[_0xf3c2('0x2')]('string','variable',_0xf3c2('0x3'),_0xf3c2('0x4'),_0xf3c2('0x5')),'defaultValue':_0xf3c2('0x6')},'content':{'type':Sequelize[_0xf3c2('0x7')]},'key':{'type':Sequelize[_0xf3c2('0x7')]},'keyType':{'type':Sequelize[_0xf3c2('0x2')](_0xf3c2('0x6'),_0xf3c2('0x8'),_0xf3c2('0x3'))},'keyContent':{'type':Sequelize[_0xf3c2('0x7')]},'idField':{'type':Sequelize[_0xf3c2('0x7')]},'nameField':{'type':Sequelize[_0xf3c2('0x7')]},'customField':{'type':Sequelize[_0xf3c2('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf3c2('0x7')]}}; \ No newline at end of file +var _0xd7fc=['ENUM','string','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x89ee68,_0x18ca4d){var _0x1dfd3b=function(_0x2f8d31){while(--_0x2f8d31){_0x89ee68['push'](_0x89ee68['shift']());}};_0x1dfd3b(++_0x18ca4d);}(_0xd7fc,0x12f));var _0xcd7f=function(_0x2a238a,_0x1d5054){_0x2a238a=_0x2a238a-0x0;var _0xeef802=_0xd7fc[_0x2a238a];return _0xeef802;};'use strict';var Sequelize=require(_0xcd7f('0x0'));module['exports']={'type':{'type':Sequelize[_0xcd7f('0x1')](_0xcd7f('0x2'),'variable',_0xcd7f('0x3'),_0xcd7f('0x4'),_0xcd7f('0x5')),'defaultValue':_0xcd7f('0x2')},'content':{'type':Sequelize[_0xcd7f('0x6')]},'key':{'type':Sequelize[_0xcd7f('0x6')]},'keyType':{'type':Sequelize[_0xcd7f('0x1')](_0xcd7f('0x2'),'variable',_0xcd7f('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xcd7f('0x6')]},'customField':{'type':Sequelize[_0xcd7f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcd7f('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 0ea781c..ff80bd2 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 _0x1eec=['end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','type','options','include','findAll','rows','show','params','includeAll','merge','find','create','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1eec,0xc9));var _0xc1ee=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x1eec[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0xc1ee('0x0'));var rimraf=require(_0xc1ee('0x1'));var zipdir=require(_0xc1ee('0x2'));var jsonpatch=require(_0xc1ee('0x3'));var rp=require('request-promise');var moment=require(_0xc1ee('0x4'));var BPromise=require(_0xc1ee('0x5'));var Mustache=require(_0xc1ee('0x6'));var util=require(_0xc1ee('0x7'));var path=require(_0xc1ee('0x8'));var sox=require('sox');var csv=require(_0xc1ee('0x9'));var ejs=require(_0xc1ee('0xa'));var fs=require('fs');var fs_extra=require(_0xc1ee('0xb'));var _=require(_0xc1ee('0xc'));var squel=require(_0xc1ee('0xd'));var crypto=require(_0xc1ee('0xe'));var jsforce=require(_0xc1ee('0xf'));var deskjs=require(_0xc1ee('0x10'));var toCsv=require(_0xc1ee('0x9'));var querystring=require(_0xc1ee('0x11'));var Papa=require(_0xc1ee('0x12'));var Redis=require(_0xc1ee('0x13'));var authService=require(_0xc1ee('0x14'));var qs=require(_0xc1ee('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc1ee('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc1ee('0x17'));var db=require(_0xc1ee('0x18'))['db'];function respondWithStatusCode(_0x8f7cd0,_0x3531a3){_0x3531a3=_0x3531a3||0xcc;return function(_0x254af1){if(_0x254af1){return _0x8f7cd0[_0xc1ee('0x19')](_0x3531a3);}return _0x8f7cd0[_0xc1ee('0x1a')](_0x3531a3)[_0xc1ee('0x1b')]();};}function respondWithResult(_0x112cc5,_0xe930fd){_0xe930fd=_0xe930fd||0xc8;return function(_0x134887){if(_0x134887){return _0x112cc5[_0xc1ee('0x1a')](_0xe930fd)[_0xc1ee('0x1c')](_0x134887);}};}function respondWithFilteredResult(_0x30083a,_0x15d4e2){return function(_0x18713b){if(_0x18713b){var _0x256f1b=typeof _0x15d4e2[_0xc1ee('0x1d')]==='undefined'&&typeof _0x15d4e2['limit']===_0xc1ee('0x1e');var _0x16e40f=_0x18713b[_0xc1ee('0x1f')];var _0x43b1c3=_0x256f1b?0x0:_0x15d4e2['offset'];var _0x12bf0f=_0x256f1b?_0x18713b[_0xc1ee('0x1f')]:_0x15d4e2[_0xc1ee('0x1d')]+_0x15d4e2[_0xc1ee('0x20')];var _0x363b61;if(_0x12bf0f>=_0x16e40f){_0x12bf0f=_0x16e40f;_0x363b61=0xc8;}else{_0x363b61=0xce;}_0x30083a['status'](_0x363b61);return _0x30083a[_0xc1ee('0x21')](_0xc1ee('0x22'),_0x43b1c3+'-'+_0x12bf0f+'/'+_0x16e40f)[_0xc1ee('0x1c')](_0x18713b);}return null;};}function patchUpdates(_0x370bac){return function(_0x315a83){try{jsonpatch[_0xc1ee('0x23')](_0x315a83,_0x370bac,!![]);}catch(_0xccf175){return BPromise[_0xc1ee('0x24')](_0xccf175);}return _0x315a83[_0xc1ee('0x25')]();};}function saveUpdates(_0x36e1df,_0x48919a){return function(_0x5be168){if(_0x5be168){return _0x5be168[_0xc1ee('0x26')](_0x36e1df)['then'](function(_0x26cbce){return _0x26cbce;});}return null;};}function removeEntity(_0x1df97d,_0x31442f){return function(_0x5c40f9){if(_0x5c40f9){return _0x5c40f9['destroy']()[_0xc1ee('0x27')](function(){_0x1df97d[_0xc1ee('0x1a')](0xcc)[_0xc1ee('0x1b')]();});}};}function handleEntityNotFound(_0x708558,_0x259de3){return function(_0xbee181){if(!_0xbee181){_0x708558[_0xc1ee('0x19')](0x194);}return _0xbee181;};}function handleError(_0xefe3e,_0x580e52){_0x580e52=_0x580e52||0x1f4;return function(_0x339f3d){logger['error'](_0x339f3d[_0xc1ee('0x28')]);if(_0x339f3d['name']){delete _0x339f3d[_0xc1ee('0x29')];}_0xefe3e[_0xc1ee('0x1a')](_0x580e52)[_0xc1ee('0x2a')](_0x339f3d);};}exports[_0xc1ee('0x2b')]=function(_0x3de5a5,_0x23bc7e){var _0x3b239f={},_0x5248b4={},_0x55cecd={'count':0x0,'rows':[]};var _0x3274dd=_[_0xc1ee('0x2c')](db[_0xc1ee('0x2d')][_0xc1ee('0x2e')],function(_0x48efe8){return{'name':_0x48efe8[_0xc1ee('0x2f')],'type':_0x48efe8['type']['key']};});_0x5248b4[_0xc1ee('0x30')]=_['map'](_0x3274dd,_0xc1ee('0x29'));_0x5248b4[_0xc1ee('0x31')]=_[_0xc1ee('0x32')](_0x3de5a5[_0xc1ee('0x31')]);_0x5248b4['filters']=_[_0xc1ee('0x33')](_0x5248b4['model'],_0x5248b4[_0xc1ee('0x31')]);_0x3b239f[_0xc1ee('0x34')]=_[_0xc1ee('0x33')](_0x5248b4[_0xc1ee('0x30')],qs[_0xc1ee('0x35')](_0x3de5a5[_0xc1ee('0x31')][_0xc1ee('0x35')]));_0x3b239f[_0xc1ee('0x34')]=_0x3b239f[_0xc1ee('0x34')][_0xc1ee('0x36')]?_0x3b239f[_0xc1ee('0x34')]:_0x5248b4[_0xc1ee('0x30')];if(!_0x3de5a5[_0xc1ee('0x31')]['hasOwnProperty'](_0xc1ee('0x37'))){_0x3b239f[_0xc1ee('0x20')]=qs[_0xc1ee('0x20')](_0x3de5a5[_0xc1ee('0x31')][_0xc1ee('0x20')]);_0x3b239f['offset']=qs[_0xc1ee('0x1d')](_0x3de5a5[_0xc1ee('0x31')][_0xc1ee('0x1d')]);}_0x3b239f[_0xc1ee('0x38')]=qs[_0xc1ee('0x39')](_0x3de5a5[_0xc1ee('0x31')]['sort']);_0x3b239f['where']=qs[_0xc1ee('0x3a')](_[_0xc1ee('0x3b')](_0x3de5a5[_0xc1ee('0x31')],_0x5248b4['filters']),_0x3274dd);if(_0x3de5a5[_0xc1ee('0x31')][_0xc1ee('0x3c')]){_0x3b239f['where']=_['merge'](_0x3b239f[_0xc1ee('0x3d')],{'$or':_[_0xc1ee('0x2c')](_0x3274dd,function(_0x2954fc){if(_0x2954fc[_0xc1ee('0x3e')]!=='VIRTUAL'){var _0x3f4405={};_0x3f4405[_0x2954fc[_0xc1ee('0x29')]]={'$like':'%'+_0x3de5a5[_0xc1ee('0x31')][_0xc1ee('0x3c')]+'%'};return _0x3f4405;}})});}_0x3b239f=_['merge']({},_0x3b239f,_0x3de5a5[_0xc1ee('0x3f')]);var _0x343279={'where':_0x3b239f[_0xc1ee('0x3d')]};return db[_0xc1ee('0x2d')][_0xc1ee('0x1f')](_0x343279)['then'](function(_0x263fee){_0x55cecd['count']=_0x263fee;if(_0x3de5a5[_0xc1ee('0x31')]['includeAll']){_0x3b239f[_0xc1ee('0x40')]=[{'all':!![]}];}return db[_0xc1ee('0x2d')][_0xc1ee('0x41')](_0x3b239f);})[_0xc1ee('0x27')](function(_0x385afa){_0x55cecd[_0xc1ee('0x42')]=_0x385afa;return _0x55cecd;})[_0xc1ee('0x27')](respondWithFilteredResult(_0x23bc7e,_0x3b239f))['catch'](handleError(_0x23bc7e,null));};exports[_0xc1ee('0x43')]=function(_0x287067,_0x292201){var _0x2229ae={'raw':!![],'where':{'id':_0x287067[_0xc1ee('0x44')]['id']}},_0x5ca242={};_0x5ca242[_0xc1ee('0x30')]=_[_0xc1ee('0x32')](db[_0xc1ee('0x2d')]['rawAttributes']);_0x5ca242['query']=_[_0xc1ee('0x32')](_0x287067[_0xc1ee('0x31')]);_0x5ca242[_0xc1ee('0x3a')]=_[_0xc1ee('0x33')](_0x5ca242[_0xc1ee('0x30')],_0x5ca242[_0xc1ee('0x31')]);_0x2229ae['attributes']=_['intersection'](_0x5ca242['model'],qs[_0xc1ee('0x35')](_0x287067[_0xc1ee('0x31')][_0xc1ee('0x35')]));_0x2229ae[_0xc1ee('0x34')]=_0x2229ae['attributes'][_0xc1ee('0x36')]?_0x2229ae['attributes']:_0x5ca242['model'];if(_0x287067[_0xc1ee('0x31')][_0xc1ee('0x45')]){_0x2229ae[_0xc1ee('0x40')]=[{'all':!![]}];}_0x2229ae=_[_0xc1ee('0x46')]({},_0x2229ae,_0x287067[_0xc1ee('0x3f')]);return db['ZohoField'][_0xc1ee('0x47')](_0x2229ae)[_0xc1ee('0x27')](handleEntityNotFound(_0x292201,null))['then'](respondWithResult(_0x292201,null))['catch'](handleError(_0x292201,null));};exports[_0xc1ee('0x48')]=function(_0x22ccd7,_0x147fbb){return db[_0xc1ee('0x2d')]['create'](_0x22ccd7[_0xc1ee('0x49')],{})[_0xc1ee('0x27')](respondWithResult(_0x147fbb,0xc9))['catch'](handleError(_0x147fbb,null));};exports[_0xc1ee('0x26')]=function(_0x439d44,_0x42fdc2){if(_0x439d44[_0xc1ee('0x49')]['id']){delete _0x439d44[_0xc1ee('0x49')]['id'];}return db[_0xc1ee('0x2d')][_0xc1ee('0x47')]({'where':{'id':_0x439d44[_0xc1ee('0x44')]['id']}})[_0xc1ee('0x27')](handleEntityNotFound(_0x42fdc2,null))['then'](saveUpdates(_0x439d44[_0xc1ee('0x49')],null))[_0xc1ee('0x27')](respondWithResult(_0x42fdc2,null))[_0xc1ee('0x4a')](handleError(_0x42fdc2,null));};exports[_0xc1ee('0x4b')]=function(_0x523017,_0xb67638){return db[_0xc1ee('0x2d')][_0xc1ee('0x47')]({'where':{'id':_0x523017[_0xc1ee('0x44')]['id']}})[_0xc1ee('0x27')](handleEntityNotFound(_0xb67638,null))[_0xc1ee('0x27')](removeEntity(_0xb67638,null))[_0xc1ee('0x4a')](handleError(_0xb67638,null));}; \ No newline at end of file +var _0xc3ed=['Content-Range','apply','save','then','destroy','end','error','stack','name','send','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ZohoField','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set'];(function(_0x505260,_0x167d6a){var _0x1642d8=function(_0x25cf81){while(--_0x25cf81){_0x505260['push'](_0x505260['shift']());}};_0x1642d8(++_0x167d6a);}(_0xc3ed,0x111));var _0xdc3e=function(_0x5c3854,_0x35b107){_0x5c3854=_0x5c3854-0x0;var _0x1cb08e=_0xc3ed[_0x5c3854];return _0x1cb08e;};'use strict';var emlformat=require(_0xdc3e('0x0'));var rimraf=require(_0xdc3e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc3e('0x2'));var rp=require(_0xdc3e('0x3'));var moment=require(_0xdc3e('0x4'));var BPromise=require(_0xdc3e('0x5'));var Mustache=require(_0xdc3e('0x6'));var util=require('util');var path=require(_0xdc3e('0x7'));var sox=require('sox');var csv=require(_0xdc3e('0x8'));var ejs=require(_0xdc3e('0x9'));var fs=require('fs');var fs_extra=require(_0xdc3e('0xa'));var _=require(_0xdc3e('0xb'));var squel=require(_0xdc3e('0xc'));var crypto=require(_0xdc3e('0xd'));var jsforce=require(_0xdc3e('0xe'));var deskjs=require(_0xdc3e('0xf'));var toCsv=require(_0xdc3e('0x8'));var querystring=require(_0xdc3e('0x10'));var Papa=require(_0xdc3e('0x11'));var Redis=require(_0xdc3e('0x12'));var authService=require(_0xdc3e('0x13'));var qs=require(_0xdc3e('0x14'));var as=require(_0xdc3e('0x15'));var hardwareService=require(_0xdc3e('0x16'));var logger=require(_0xdc3e('0x17'))('api');var utils=require(_0xdc3e('0x18'));var config=require(_0xdc3e('0x19'));var licenseUtil=require(_0xdc3e('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e4af6,_0x5befb6){_0x5befb6=_0x5befb6||0xcc;return function(_0x909deb){if(_0x909deb){return _0x2e4af6[_0xdc3e('0x1b')](_0x5befb6);}return _0x2e4af6['status'](_0x5befb6)['end']();};}function respondWithResult(_0x17da85,_0x4f9adb){_0x4f9adb=_0x4f9adb||0xc8;return function(_0x15133e){if(_0x15133e){return _0x17da85[_0xdc3e('0x1c')](_0x4f9adb)[_0xdc3e('0x1d')](_0x15133e);}};}function respondWithFilteredResult(_0x48a33f,_0x2b2f16){return function(_0x2c7396){if(_0x2c7396){var _0x384c96=typeof _0x2b2f16[_0xdc3e('0x1e')]==='undefined'&&typeof _0x2b2f16[_0xdc3e('0x1f')]===_0xdc3e('0x20');var _0x2175b2=_0x2c7396[_0xdc3e('0x21')];var _0x4d1136=_0x384c96?0x0:_0x2b2f16[_0xdc3e('0x1e')];var _0x1a0890=_0x384c96?_0x2c7396[_0xdc3e('0x21')]:_0x2b2f16[_0xdc3e('0x1e')]+_0x2b2f16[_0xdc3e('0x1f')];var _0x44b62f;if(_0x1a0890>=_0x2175b2){_0x1a0890=_0x2175b2;_0x44b62f=0xc8;}else{_0x44b62f=0xce;}_0x48a33f[_0xdc3e('0x1c')](_0x44b62f);return _0x48a33f[_0xdc3e('0x22')](_0xdc3e('0x23'),_0x4d1136+'-'+_0x1a0890+'/'+_0x2175b2)[_0xdc3e('0x1d')](_0x2c7396);}return null;};}function patchUpdates(_0x7b4ee){return function(_0x37f6be){try{jsonpatch[_0xdc3e('0x24')](_0x37f6be,_0x7b4ee,!![]);}catch(_0x18afb5){return BPromise['reject'](_0x18afb5);}return _0x37f6be[_0xdc3e('0x25')]();};}function saveUpdates(_0x55cb33,_0x2ae1e3){return function(_0x4f0a23){if(_0x4f0a23){return _0x4f0a23['update'](_0x55cb33)[_0xdc3e('0x26')](function(_0x34f5f2){return _0x34f5f2;});}return null;};}function removeEntity(_0x58ac4a,_0x31bb6a){return function(_0x2116b4){if(_0x2116b4){return _0x2116b4[_0xdc3e('0x27')]()[_0xdc3e('0x26')](function(){_0x58ac4a[_0xdc3e('0x1c')](0xcc)[_0xdc3e('0x28')]();});}};}function handleEntityNotFound(_0x5d597f,_0xd5e163){return function(_0x4e2e98){if(!_0x4e2e98){_0x5d597f[_0xdc3e('0x1b')](0x194);}return _0x4e2e98;};}function handleError(_0x1c95ca,_0x44cc9c){_0x44cc9c=_0x44cc9c||0x1f4;return function(_0x519a09){logger[_0xdc3e('0x29')](_0x519a09[_0xdc3e('0x2a')]);if(_0x519a09[_0xdc3e('0x2b')]){delete _0x519a09[_0xdc3e('0x2b')];}_0x1c95ca['status'](_0x44cc9c)[_0xdc3e('0x2c')](_0x519a09);};}exports['index']=function(_0x489b18,_0x2ff2c0){var _0x3d1e1f={},_0x1168bb={},_0x232e54={'count':0x0,'rows':[]};var _0x2f47c7=_['map'](db['ZohoField'][_0xdc3e('0x2d')],function(_0x282bae){return{'name':_0x282bae[_0xdc3e('0x2e')],'type':_0x282bae[_0xdc3e('0x2f')]['key']};});_0x1168bb['model']=_[_0xdc3e('0x30')](_0x2f47c7,_0xdc3e('0x2b'));_0x1168bb[_0xdc3e('0x31')]=_[_0xdc3e('0x32')](_0x489b18[_0xdc3e('0x31')]);_0x1168bb[_0xdc3e('0x33')]=_[_0xdc3e('0x34')](_0x1168bb[_0xdc3e('0x35')],_0x1168bb[_0xdc3e('0x31')]);_0x3d1e1f[_0xdc3e('0x36')]=_[_0xdc3e('0x34')](_0x1168bb['model'],qs[_0xdc3e('0x37')](_0x489b18['query'][_0xdc3e('0x37')]));_0x3d1e1f[_0xdc3e('0x36')]=_0x3d1e1f[_0xdc3e('0x36')][_0xdc3e('0x38')]?_0x3d1e1f[_0xdc3e('0x36')]:_0x1168bb[_0xdc3e('0x35')];if(!_0x489b18[_0xdc3e('0x31')]['hasOwnProperty'](_0xdc3e('0x39'))){_0x3d1e1f[_0xdc3e('0x1f')]=qs[_0xdc3e('0x1f')](_0x489b18[_0xdc3e('0x31')][_0xdc3e('0x1f')]);_0x3d1e1f[_0xdc3e('0x1e')]=qs[_0xdc3e('0x1e')](_0x489b18[_0xdc3e('0x31')][_0xdc3e('0x1e')]);}_0x3d1e1f[_0xdc3e('0x3a')]=qs[_0xdc3e('0x3b')](_0x489b18[_0xdc3e('0x31')][_0xdc3e('0x3b')]);_0x3d1e1f['where']=qs[_0xdc3e('0x33')](_[_0xdc3e('0x3c')](_0x489b18[_0xdc3e('0x31')],_0x1168bb[_0xdc3e('0x33')]),_0x2f47c7);if(_0x489b18[_0xdc3e('0x31')][_0xdc3e('0x3d')]){_0x3d1e1f[_0xdc3e('0x3e')]=_[_0xdc3e('0x3f')](_0x3d1e1f[_0xdc3e('0x3e')],{'$or':_['map'](_0x2f47c7,function(_0x387735){if(_0x387735[_0xdc3e('0x2f')]!==_0xdc3e('0x40')){var _0x16c547={};_0x16c547[_0x387735['name']]={'$like':'%'+_0x489b18[_0xdc3e('0x31')][_0xdc3e('0x3d')]+'%'};return _0x16c547;}})});}_0x3d1e1f=_[_0xdc3e('0x3f')]({},_0x3d1e1f,_0x489b18[_0xdc3e('0x41')]);var _0x42cf0c={'where':_0x3d1e1f[_0xdc3e('0x3e')]};return db[_0xdc3e('0x42')][_0xdc3e('0x21')](_0x42cf0c)['then'](function(_0x316167){_0x232e54[_0xdc3e('0x21')]=_0x316167;if(_0x489b18[_0xdc3e('0x31')][_0xdc3e('0x43')]){_0x3d1e1f['include']=[{'all':!![]}];}return db['ZohoField'][_0xdc3e('0x44')](_0x3d1e1f);})['then'](function(_0x481369){_0x232e54[_0xdc3e('0x45')]=_0x481369;return _0x232e54;})[_0xdc3e('0x26')](respondWithFilteredResult(_0x2ff2c0,_0x3d1e1f))[_0xdc3e('0x46')](handleError(_0x2ff2c0,null));};exports[_0xdc3e('0x47')]=function(_0x248b78,_0x3ee3e1){var _0x6b669f={'raw':!![],'where':{'id':_0x248b78['params']['id']}},_0x3145d1={};_0x3145d1[_0xdc3e('0x35')]=_[_0xdc3e('0x32')](db['ZohoField']['rawAttributes']);_0x3145d1[_0xdc3e('0x31')]=_['keys'](_0x248b78[_0xdc3e('0x31')]);_0x3145d1[_0xdc3e('0x33')]=_[_0xdc3e('0x34')](_0x3145d1['model'],_0x3145d1['query']);_0x6b669f[_0xdc3e('0x36')]=_[_0xdc3e('0x34')](_0x3145d1[_0xdc3e('0x35')],qs['fields'](_0x248b78['query']['fields']));_0x6b669f[_0xdc3e('0x36')]=_0x6b669f['attributes']['length']?_0x6b669f[_0xdc3e('0x36')]:_0x3145d1[_0xdc3e('0x35')];if(_0x248b78[_0xdc3e('0x31')]['includeAll']){_0x6b669f[_0xdc3e('0x48')]=[{'all':!![]}];}_0x6b669f=_['merge']({},_0x6b669f,_0x248b78[_0xdc3e('0x41')]);return db[_0xdc3e('0x42')][_0xdc3e('0x49')](_0x6b669f)[_0xdc3e('0x26')](handleEntityNotFound(_0x3ee3e1,null))[_0xdc3e('0x26')](respondWithResult(_0x3ee3e1,null))[_0xdc3e('0x46')](handleError(_0x3ee3e1,null));};exports[_0xdc3e('0x4a')]=function(_0x3da1ed,_0x5090f4){return db[_0xdc3e('0x42')][_0xdc3e('0x4a')](_0x3da1ed[_0xdc3e('0x4b')],{})[_0xdc3e('0x26')](respondWithResult(_0x5090f4,0xc9))[_0xdc3e('0x46')](handleError(_0x5090f4,null));};exports['update']=function(_0xe80659,_0x3a1bf6){if(_0xe80659['body']['id']){delete _0xe80659['body']['id'];}return db[_0xdc3e('0x42')][_0xdc3e('0x49')]({'where':{'id':_0xe80659[_0xdc3e('0x4c')]['id']}})[_0xdc3e('0x26')](handleEntityNotFound(_0x3a1bf6,null))[_0xdc3e('0x26')](saveUpdates(_0xe80659[_0xdc3e('0x4b')],null))[_0xdc3e('0x26')](respondWithResult(_0x3a1bf6,null))['catch'](handleError(_0x3a1bf6,null));};exports[_0xdc3e('0x27')]=function(_0x5a8c0a,_0x1f7545){return db[_0xdc3e('0x42')][_0xdc3e('0x49')]({'where':{'id':_0x5a8c0a[_0xdc3e('0x4c')]['id']}})[_0xdc3e('0x26')](handleEntityNotFound(_0x1f7545,null))[_0xdc3e('0x26')](removeEntity(_0x1f7545,null))[_0xdc3e('0x46')](handleError(_0x1f7545,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 00c9399..a7aa71a 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 _0x81c6=['../../config/environment','./intZohoField.attributes','exports','define','ZohoField','idField','FieldId','util','bluebird','request-promise','path'];(function(_0x5c284c,_0x2efdc1){var _0x398188=function(_0x19f0a0){while(--_0x19f0a0){_0x5c284c['push'](_0x5c284c['shift']());}};_0x398188(++_0x2efdc1);}(_0x81c6,0x1d5));var _0x681c=function(_0xe506a9,_0x3105d4){_0xe506a9=_0xe506a9-0x0;var _0x12ca6f=_0x81c6[_0xe506a9];return _0x12ca6f;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x681c('0x1'));var rp=require(_0x681c('0x2'));var fs=require('fs');var path=require(_0x681c('0x3'));var rimraf=require('rimraf');var config=require(_0x681c('0x4'));var attributes=require(_0x681c('0x5'));module[_0x681c('0x6')]=function(_0x1d31c8,_0x4ea522){return _0x1d31c8[_0x681c('0x7')](_0x681c('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x681c('0x9'),_0x681c('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x81c6=['../../config/environment','./intZohoField.attributes','exports','define','ZohoField','idField','FieldId','util','bluebird','request-promise','path'];(function(_0x5e174f,_0x4bf334){var _0x5ad57e=function(_0x1bf17a){while(--_0x1bf17a){_0x5e174f['push'](_0x5e174f['shift']());}};_0x5ad57e(++_0x4bf334);}(_0x81c6,0x1d5));var _0x681c=function(_0x592416,_0x2c75e9){_0x592416=_0x592416-0x0;var _0x3005fa=_0x81c6[_0x592416];return _0x3005fa;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x681c('0x1'));var rp=require(_0x681c('0x2'));var fs=require('fs');var path=require(_0x681c('0x3'));var rimraf=require('rimraf');var config=require(_0x681c('0x4'));var attributes=require(_0x681c('0x5'));module[_0x681c('0x6')]=function(_0x1d31c8,_0x4ea522){return _0x1d31c8[_0x681c('0x7')](_0x681c('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x681c('0x9'),_0x681c('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 d11bd95..82a959e 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 _0xf9f8=['moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','util'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xf9f8,0x197));var _0x8f9f=function(_0x2e20bc,_0xd603db){_0x2e20bc=_0x2e20bc-0x0;var _0x1aabd0=_0xf9f8[_0x2e20bc];return _0x1aabd0;};'use strict';var _=require('lodash');var util=require(_0x8f9f('0x0'));var moment=require(_0x8f9f('0x1'));var BPromise=require(_0x8f9f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f9f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f9f('0x4'));var logger=require(_0x8f9f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8f9f('0x6'));var client=jayson[_0x8f9f('0x7')][_0x8f9f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d3af5,_0x4a8df2,_0x7f69e4){return new BPromise(function(_0x44a661,_0x3b7c03){return client['request'](_0x2d3af5,_0x7f69e4)['then'](function(_0x5ca4c2){logger[_0x8f9f('0x9')](_0x8f9f('0xa'),_0x4a8df2,_0x8f9f('0xb'));logger[_0x8f9f('0xc')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x4a8df2,_0x8f9f('0xb'),JSON[_0x8f9f('0xd')](_0x5ca4c2));if(_0x5ca4c2[_0x8f9f('0xe')]){if(_0x5ca4c2[_0x8f9f('0xe')][_0x8f9f('0xf')]===0x1f4){logger[_0x8f9f('0xe')]('ZohoField,\x20%s,\x20%s',_0x4a8df2,_0x5ca4c2[_0x8f9f('0xe')][_0x8f9f('0x10')]);return _0x3b7c03(_0x5ca4c2[_0x8f9f('0xe')][_0x8f9f('0x10')]);}logger['error'](_0x8f9f('0xa'),_0x4a8df2,_0x5ca4c2['error']['message']);return _0x44a661(_0x5ca4c2[_0x8f9f('0xe')][_0x8f9f('0x10')]);}else{logger[_0x8f9f('0x9')](_0x8f9f('0xa'),_0x4a8df2,_0x8f9f('0xb'));_0x44a661(_0x5ca4c2['result']['message']);}})['catch'](function(_0x4a7751){logger[_0x8f9f('0xe')]('ZohoField,\x20%s,\x20%s',_0x4a8df2,_0x4a7751);_0x3b7c03(_0x4a7751);});});} \ No newline at end of file +var _0xb46c=['ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xb46c,0x1aa));var _0xcb46=function(_0x46115c,_0x354e87){_0x46115c=_0x46115c-0x0;var _0x4de5d4=_0xb46c[_0x46115c];return _0x4de5d4;};'use strict';var _=require(_0xcb46('0x0'));var util=require(_0xcb46('0x1'));var moment=require(_0xcb46('0x2'));var BPromise=require(_0xcb46('0x3'));var rs=require(_0xcb46('0x4'));var fs=require('fs');var Redis=require(_0xcb46('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcb46('0x6'))(_0xcb46('0x7'));var config=require(_0xcb46('0x8'));var jayson=require(_0xcb46('0x9'));var client=jayson[_0xcb46('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d56d8,_0x3c3b5e,_0x4468ed){return new BPromise(function(_0x32ea39,_0x3e8b69){return client['request'](_0x4d56d8,_0x4468ed)[_0xcb46('0xb')](function(_0x335b8a){logger[_0xcb46('0xc')](_0xcb46('0xd'),_0x3c3b5e,_0xcb46('0xe'));logger['debug'](_0xcb46('0xf'),_0x3c3b5e,'request\x20sent',JSON[_0xcb46('0x10')](_0x335b8a));if(_0x335b8a[_0xcb46('0x11')]){if(_0x335b8a['error'][_0xcb46('0x12')]===0x1f4){logger[_0xcb46('0x11')](_0xcb46('0xd'),_0x3c3b5e,_0x335b8a[_0xcb46('0x11')][_0xcb46('0x13')]);return _0x3e8b69(_0x335b8a[_0xcb46('0x11')][_0xcb46('0x13')]);}logger[_0xcb46('0x11')](_0xcb46('0xd'),_0x3c3b5e,_0x335b8a[_0xcb46('0x11')]['message']);return _0x32ea39(_0x335b8a['error'][_0xcb46('0x13')]);}else{logger[_0xcb46('0xc')](_0xcb46('0xd'),_0x3c3b5e,_0xcb46('0xe'));_0x32ea39(_0x335b8a[_0xcb46('0x14')][_0xcb46('0x13')]);}})['catch'](function(_0x1c4e9b){logger[_0xcb46('0x11')](_0xcb46('0xd'),_0x3c3b5e,_0x1c4e9b);_0x3e8b69(_0x1c4e9b);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 535795d..a3396d4 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3eb5f3,_0x2032f4){var _0xf43b85=function(_0x4e633a){while(--_0x4e633a){_0x3eb5f3['push'](_0x3eb5f3['shift']());}};_0xf43b85(++_0x2032f4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xcb91[_0x1147ab];return _0x55cb5a;};'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(_0x2d29d0,_0x4e9861){var _0x39e0d7=function(_0x26ed8a){while(--_0x26ed8a){_0x2d29d0['push'](_0x2d29d0['shift']());}};_0x39e0d7(++_0x4e9861);}(_0xe706,0xa3));var _0x6e70=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0xe706[_0x39fd11];return _0x302799;};'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 5016f9d..8eb9213 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 _0xf2b9=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x482340,_0x225de9){var _0x5f2926=function(_0x4a3254){while(--_0x4a3254){_0x482340['push'](_0x482340['shift']());}};_0x5f2926(++_0x225de9);}(_0xf2b9,0x183));var _0x9f2b=function(_0x59dc3f,_0x219ceb){_0x59dc3f=_0x59dc3f-0x0;var _0x17a7aa=_0xf2b9[_0x59dc3f];return _0x17a7aa;};'use strict';var Sequelize=require(_0x9f2b('0x0'));module[_0x9f2b('0x1')]={'name':{'type':Sequelize[_0x9f2b('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x9f2b('0x2')],'allowNull':![],'unique':_0x9f2b('0x3')},'main':{'type':Sequelize[_0x9f2b('0x2')],'defaultValue':_0x9f2b('0x4')},'filename':{'type':Sequelize[_0x9f2b('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9f2b('0x2')]},'size':{'type':Sequelize[_0x9f2b('0x5')]},'active':{'type':Sequelize[_0x9f2b('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x9f2b('0x2')]},'logo':{'type':Sequelize[_0x9f2b('0x2')]},'state':{'type':Sequelize[_0x9f2b('0x2')],'unique':_0x9f2b('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9f2b('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x5959=['BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x5612c5,_0x389dbc){var _0xa17ebc=function(_0x33078e){while(--_0x33078e){_0x5612c5['push'](_0x5612c5['shift']());}};_0xa17ebc(++_0x389dbc);}(_0x5959,0x17c));var _0x9595=function(_0x5447a8,_0x45c8e9){_0x5447a8=_0x5447a8-0x0;var _0x4c586b=_0x5959[_0x5447a8];return _0x4c586b;};'use strict';var Sequelize=require(_0x9595('0x0'));module[_0x9595('0x1')]={'name':{'type':Sequelize[_0x9595('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x9595('0x2')],'allowNull':![],'unique':_0x9595('0x3')},'main':{'type':Sequelize[_0x9595('0x2')],'defaultValue':_0x9595('0x4')},'filename':{'type':Sequelize[_0x9595('0x2')]},'path':{'type':Sequelize[_0x9595('0x2')]},'type':{'type':Sequelize[_0x9595('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x9595('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x9595('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x9595('0x2')],'unique':_0x9595('0x6')},'description':{'type':Sequelize[_0x9595('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index d22e954..0a25ada 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 _0x01d9=['map','Integration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index'];(function(_0x3196eb,_0x8502a8){var _0x420117=function(_0xeb0156){while(--_0xeb0156){_0x3196eb['push'](_0x3196eb['shift']());}};_0x420117(++_0x8502a8);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['Integration'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')](_0x24b6fa[_0x901d('0x4c')],{})[_0x901d('0x28')](respondWithResult(_0x27459b,0xc9))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x23f2a9,_0x4888e8){if(_0x23f2a9['body']['id']){delete _0x23f2a9[_0x901d('0x4c')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x23f2a9[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x4888e8,null))['then'](saveUpdates(_0x23f2a9['body'],null))[_0x901d('0x28')](respondWithResult(_0x4888e8,null))[_0x901d('0x46')](handleError(_0x4888e8,null));};exports['destroy']=function(_0x23673d,_0x165207){return db['Integration'][_0x901d('0x4a')]({'where':{'id':_0x23673d['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x165207,null))[_0x901d('0x28')](removeEntity(_0x165207,null))[_0x901d('0x46')](handleError(_0x165207,null));}; \ No newline at end of file +var _0x9f0e=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js'];(function(_0x27e3a0,_0x55e898){var _0x258d42=function(_0x2f45aa){while(--_0x2f45aa){_0x27e3a0['push'](_0x27e3a0['shift']());}};_0x258d42(++_0x55e898);}(_0x9f0e,0x116));var _0xe9f0=function(_0xb3472d,_0x22af5d){_0xb3472d=_0xb3472d-0x0;var _0x3ef883=_0x9f0e[_0xb3472d];return _0x3ef883;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x26')]();});}};}function handleEntityNotFound(_0x1321bb,_0x3c4ba9){return function(_0x3fce54){if(!_0x3fce54){_0x1321bb['sendStatus'](0x194);}return _0x3fce54;};}function handleError(_0x371095,_0x27541f){_0x27541f=_0x27541f||0x1f4;return function(_0x2ddfba){logger[_0xe9f0('0x27')](_0x2ddfba['stack']);if(_0x2ddfba[_0xe9f0('0x28')]){delete _0x2ddfba[_0xe9f0('0x28')];}_0x371095[_0xe9f0('0x1a')](_0x27541f)[_0xe9f0('0x29')](_0x2ddfba);};}exports[_0xe9f0('0x2a')]=function(_0x5457f6,_0x130f96){var _0xdc16bc={},_0x44fb5b={},_0xab3d81={'count':0x0,'rows':[]};var _0xa27c84=_[_0xe9f0('0x2b')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')],function(_0x2b6503){return{'name':_0x2b6503[_0xe9f0('0x2e')],'type':_0x2b6503[_0xe9f0('0x2f')][_0xe9f0('0x30')]};});_0x44fb5b[_0xe9f0('0x31')]=_[_0xe9f0('0x2b')](_0xa27c84,_0xe9f0('0x28'));_0x44fb5b[_0xe9f0('0x32')]=_[_0xe9f0('0x33')](_0x5457f6[_0xe9f0('0x32')]);_0x44fb5b[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x44fb5b[_0xe9f0('0x31')],_0x44fb5b[_0xe9f0('0x32')]);_0xdc16bc[_0xe9f0('0x36')]=_[_0xe9f0('0x35')](_0x44fb5b['model'],qs['fields'](_0x5457f6['query'][_0xe9f0('0x37')]));_0xdc16bc['attributes']=_0xdc16bc[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0xdc16bc['attributes']:_0x44fb5b[_0xe9f0('0x31')];if(!_0x5457f6['query']['hasOwnProperty']('nolimit')){_0xdc16bc[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x5457f6['query'][_0xe9f0('0x1d')]);_0xdc16bc[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x5457f6['query']['offset']);}_0xdc16bc[_0xe9f0('0x39')]=qs[_0xe9f0('0x3a')](_0x5457f6[_0xe9f0('0x32')]['sort']);_0xdc16bc[_0xe9f0('0x3b')]=qs[_0xe9f0('0x34')](_[_0xe9f0('0x3c')](_0x5457f6[_0xe9f0('0x32')],_0x44fb5b[_0xe9f0('0x34')]),_0xa27c84);if(_0x5457f6['query'][_0xe9f0('0x3d')]){_0xdc16bc[_0xe9f0('0x3b')]=_[_0xe9f0('0x3e')](_0xdc16bc['where'],{'$or':_[_0xe9f0('0x2b')](_0xa27c84,function(_0xbec11f){if(_0xbec11f['type']!==_0xe9f0('0x3f')){var _0x5154c3={};_0x5154c3[_0xbec11f[_0xe9f0('0x28')]]={'$like':'%'+_0x5457f6['query']['filter']+'%'};return _0x5154c3;}})});}_0xdc16bc=_['merge']({},_0xdc16bc,_0x5457f6['options']);var _0x5165f7={'where':_0xdc16bc[_0xe9f0('0x3b')]};return db[_0xe9f0('0x2c')][_0xe9f0('0x1e')](_0x5165f7)[_0xe9f0('0x24')](function(_0x2560c6){_0xab3d81[_0xe9f0('0x1e')]=_0x2560c6;if(_0x5457f6[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0xdc16bc[_0xe9f0('0x41')]=[{'all':!![]}];}return db['Integration'][_0xe9f0('0x42')](_0xdc16bc);})[_0xe9f0('0x24')](function(_0x36b00a){_0xab3d81['rows']=_0x36b00a;return _0xab3d81;})['then'](respondWithFilteredResult(_0x130f96,_0xdc16bc))[_0xe9f0('0x43')](handleError(_0x130f96,null));};exports['show']=function(_0x297689,_0x52613a){var _0x314f0e={'raw':![],'where':{'id':_0x297689['params']['id']}},_0x42d9d2={};_0x42d9d2[_0xe9f0('0x31')]=_[_0xe9f0('0x33')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')]);_0x42d9d2[_0xe9f0('0x32')]=_['keys'](_0x297689[_0xe9f0('0x32')]);_0x42d9d2[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x42d9d2[_0xe9f0('0x31')],_0x42d9d2[_0xe9f0('0x32')]);_0x314f0e['attributes']=_[_0xe9f0('0x35')](_0x42d9d2['model'],qs['fields'](_0x297689[_0xe9f0('0x32')][_0xe9f0('0x37')]));_0x314f0e['attributes']=_0x314f0e[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0x314f0e[_0xe9f0('0x36')]:_0x42d9d2[_0xe9f0('0x31')];if(_0x297689[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0x314f0e[_0xe9f0('0x41')]=[{'all':!![]}];}_0x314f0e=_['merge']({},_0x314f0e,_0x297689[_0xe9f0('0x44')]);return db['Integration'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['Integration'][_0xe9f0('0x46')](_0x2023b4[_0xe9f0('0x47')],{})[_0xe9f0('0x24')](respondWithResult(_0x422324,0xc9))[_0xe9f0('0x43')](handleError(_0x422324,null));};exports[_0xe9f0('0x23')]=function(_0x135175,_0x6ece3f){if(_0x135175[_0xe9f0('0x47')]['id']){delete _0x135175[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x135175[_0xe9f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x6ece3f,null))['then'](saveUpdates(_0x135175[_0xe9f0('0x47')],null))[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,null))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports['destroy']=function(_0x1ac381,_0x4d8b2e){return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x1ac381[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4d8b2e,null))['then'](removeEntity(_0x4d8b2e,null))[_0xe9f0('0x43')](handleError(_0x4d8b2e,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 1593586..97271bb 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 _0xfc56=['api','moment','bluebird','request-promise','path','./integration.attributes','define','Integration','integrations','lodash','util','../../config/logger'];(function(_0x3d6922,_0x42d0d8){var _0x2f1917=function(_0x7be18a){while(--_0x7be18a){_0x3d6922['push'](_0x3d6922['shift']());}};_0x2f1917(++_0x42d0d8);}(_0xfc56,0x1b9));var _0x6fc5=function(_0x399926,_0x420cfb){_0x399926=_0x399926-0x0;var _0xec23eb=_0xfc56[_0x399926];return _0xec23eb;};'use strict';var _=require(_0x6fc5('0x0'));var util=require(_0x6fc5('0x1'));var logger=require(_0x6fc5('0x2'))(_0x6fc5('0x3'));var moment=require(_0x6fc5('0x4'));var BPromise=require(_0x6fc5('0x5'));var rp=require(_0x6fc5('0x6'));var fs=require('fs');var path=require(_0x6fc5('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6fc5('0x8'));module['exports']=function(_0x12c87d,_0x365ace){return _0x12c87d[_0x6fc5('0x9')](_0x6fc5('0xa'),attributes,{'tableName':_0x6fc5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0df1=['bluebird','rimraf','../../config/environment','exports','define','Integration','lodash','util','api','moment'];(function(_0x25e6b9,_0x9d17ea){var _0x4bfb70=function(_0x5aafec){while(--_0x5aafec){_0x25e6b9['push'](_0x25e6b9['shift']());}};_0x4bfb70(++_0x9d17ea);}(_0x0df1,0x9c));var _0x10df=function(_0x5b8c2e,_0x28c7fb){_0x5b8c2e=_0x5b8c2e-0x0;var _0x374da4=_0x0df1[_0x5b8c2e];return _0x374da4;};'use strict';var _=require(_0x10df('0x0'));var util=require(_0x10df('0x1'));var logger=require('../../config/logger')(_0x10df('0x2'));var moment=require(_0x10df('0x3'));var BPromise=require(_0x10df('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x10df('0x5'));var config=require(_0x10df('0x6'));var attributes=require('./integration.attributes');module[_0x10df('0x7')]=function(_0x29fcaa,_0x2f1231){return _0x29fcaa[_0x10df('0x8')](_0x10df('0x9'),attributes,{'tableName':'integrations','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 a279006..01e2131 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 _0x6d38=['request','then','Integration,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x3974e6,_0x53f90d){var _0x27d460=function(_0x224f19){while(--_0x224f19){_0x3974e6['push'](_0x3974e6['shift']());}};_0x27d460(++_0x53f90d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6d38[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ 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','Integration,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x8e2d4d,_0x310930){var _0x5e3047=function(_0x4665e4){while(--_0x4665e4){_0x8e2d4d['push'](_0x8e2d4d['shift']());}};_0x5e3047(++_0x310930);}(_0xadb5,0xad));var _0x5adb=function(_0x5897f7,_0x52b411){_0x5897f7=_0x5897f7-0x0;var _0xde4ad4=_0xadb5[_0x5897f7];return _0xde4ad4;};'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']('Integration,\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/integrationReport/index.js b/server/api/integrationReport/index.js index 522fde4..176ce34 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(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xdb28,0x106));var _0x8db2=function(_0x2bc270,_0x7baa1){_0x2bc270=_0x2bc270-0x0;var _0x3259f6=_0xdb28[_0x2bc270];return _0x3259f6;};'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 _0x0b0e=['get','isAuthenticated','index','describe','/:id','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller'];(function(_0x2e409c,_0x2e8e9e){var _0xa455e6=function(_0x5b8edb){while(--_0x5b8edb){_0x2e409c['push'](_0x2e409c['shift']());}};_0xa455e6(++_0x2e8e9e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0x0b0e[_0x19d24c];return _0x2fae8d;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0xe')]('/',auth[_0xe0b0('0xa')](),controller['create']);router[_0xe0b0('0xf')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);module[_0xe0b0('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 7e907ed..0914eb1 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 _0xed6d=['SENDING','RECEIVED','FAILED','sequelize','STRING','INTEGER','BOOLEAN','DATE','TEXT','ENUM','SENT'];(function(_0x54ddb5,_0x3c6d18){var _0x39faee=function(_0x3ef1df){while(--_0x3ef1df){_0x54ddb5['push'](_0x54ddb5['shift']());}};_0x39faee(++_0x3c6d18);}(_0xed6d,0x1bb));var _0xded6=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0xed6d[_0x1f36bb];return _0xaf97fa;};'use strict';var Sequelize=require(_0xded6('0x0'));module['exports']={'integration':{'type':Sequelize[_0xded6('0x1')]},'eventChannel':{'type':Sequelize[_0xded6('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xded6('0x1')]},'integrationId':{'type':Sequelize[_0xded6('0x2')]},'contacts':{'type':Sequelize[_0xded6('0x1')]},'uniqueid':{'type':Sequelize[_0xded6('0x1')]},'calleridnum':{'type':Sequelize[_0xded6('0x1')]},'calleridname':{'type':Sequelize[_0xded6('0x1')]},'queue':{'type':Sequelize[_0xded6('0x1')]},'interface':{'type':Sequelize[_0xded6('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xded6('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xded6('0x4')]},'talktime':{'type':Sequelize[_0xded6('0x2')]},'agentacw':{'type':Sequelize[_0xded6('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xded6('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xded6('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xded6('0x4')]},'agentdump':{'type':Sequelize[_0xded6('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xded6('0x1')]},'channel':{'type':Sequelize[_0xded6('0x1')]},'channelstate':{'type':Sequelize[_0xded6('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xded6('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xded6('0x1')]},'context':{'type':Sequelize[_0xded6('0x1')]},'exten':{'type':Sequelize[_0xded6('0x1')]},'priority':{'type':Sequelize[_0xded6('0x1')]},'destchannel':{'type':Sequelize[_0xded6('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xded6('0x1')]},'destcalleridnum':{'type':Sequelize[_0xded6('0x1')]},'destcalleridname':{'type':Sequelize[_0xded6('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xded6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xded6('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xded6('0x1')]},'destcontext':{'type':Sequelize[_0xded6('0x1')]},'destexten':{'type':Sequelize[_0xded6('0x1')]},'destpriority':{'type':Sequelize[_0xded6('0x1')]},'destuniqueid':{'type':Sequelize[_0xded6('0x1')]},'messageId':{'type':Sequelize[_0xded6('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xded6('0x1')]},'to':{'type':Sequelize[_0xded6('0x1')]},'cc':{'type':Sequelize[_0xded6('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xded6('0x5')]},'text':{'type':Sequelize[_0xded6('0x5')]},'status':{'type':Sequelize[_0xded6('0x6')](_0xded6('0x7'),_0xded6('0x8'),_0xded6('0x9'),_0xded6('0xa'))},'url':{'type':Sequelize[_0xded6('0x1')]},'app':{'type':Sequelize[_0xded6('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x36ab=['FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','RECEIVED'];(function(_0x35d167,_0x18eabb){var _0x36cb4b=function(_0x5bdbc8){while(--_0x5bdbc8){_0x35d167['push'](_0x35d167['shift']());}};_0x36cb4b(++_0x18eabb);}(_0x36ab,0x157));var _0xb36a=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x36ab[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require('sequelize');module[_0xb36a('0x0')]={'integration':{'type':Sequelize[_0xb36a('0x1')]},'eventChannel':{'type':Sequelize[_0xb36a('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xb36a('0x2')]},'contacts':{'type':Sequelize[_0xb36a('0x1')]},'uniqueid':{'type':Sequelize[_0xb36a('0x1')]},'calleridnum':{'type':Sequelize[_0xb36a('0x1')]},'calleridname':{'type':Sequelize[_0xb36a('0x1')]},'queue':{'type':Sequelize[_0xb36a('0x1')]},'interface':{'type':Sequelize[_0xb36a('0x1')]},'membername':{'type':Sequelize[_0xb36a('0x1')]},'agentcalledAt':{'type':Sequelize[_0xb36a('0x3')]},'agentconnectAt':{'type':Sequelize[_0xb36a('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xb36a('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xb36a('0x3')]},'talktime':{'type':Sequelize[_0xb36a('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb36a('0x2')]},'reason':{'type':Sequelize[_0xb36a('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xb36a('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xb36a('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xb36a('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb36a('0x1')]},'channelstate':{'type':Sequelize[_0xb36a('0x2')]},'channelstatedesc':{'type':Sequelize[_0xb36a('0x1')]},'connectedlinenum':{'type':Sequelize[_0xb36a('0x1')]},'connectedlinename':{'type':Sequelize[_0xb36a('0x1')]},'language':{'type':Sequelize[_0xb36a('0x1')]},'accountcode':{'type':Sequelize[_0xb36a('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xb36a('0x1')]},'priority':{'type':Sequelize[_0xb36a('0x1')]},'destchannel':{'type':Sequelize[_0xb36a('0x1')]},'destchannelstate':{'type':Sequelize[_0xb36a('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xb36a('0x1')]},'destcalleridnum':{'type':Sequelize[_0xb36a('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xb36a('0x1')]},'destlanguage':{'type':Sequelize[_0xb36a('0x1')]},'destaccountcode':{'type':Sequelize[_0xb36a('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xb36a('0x1')]},'destpriority':{'type':Sequelize[_0xb36a('0x1')]},'destuniqueid':{'type':Sequelize[_0xb36a('0x1')]},'messageId':{'type':Sequelize[_0xb36a('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xb36a('0x1')]},'to':{'type':Sequelize[_0xb36a('0x1')]},'cc':{'type':Sequelize[_0xb36a('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xb36a('0x5')]},'text':{'type':Sequelize[_0xb36a('0x5')]},'status':{'type':Sequelize[_0xb36a('0x6')]('SENT','SENDING',_0xb36a('0x7'),_0xb36a('0x8'))},'url':{'type':Sequelize[_0xb36a('0x1')]},'app':{'type':Sequelize[_0xb36a('0x1')]},'appdata':{'type':Sequelize[_0xb36a('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 760f560..6b2a1e0 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 _0xbc67=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','count','offset','Content-Range','apply','save','update','then','error','stack','name','send','index','map','IntegrationReport','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','limit','order','sort','where','pick','merge','type','VIRTUAL','options','include','rows','catch','show','includeAll','find','body','params','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x3e2590,_0x52827d){var _0x1f3167=function(_0x342d1a){while(--_0x342d1a){_0x3e2590['push'](_0x3e2590['shift']());}};_0x1f3167(++_0x52827d);}(_0xbc67,0xcd));var _0x7bc6=function(_0x1bae76,_0x5de524){_0x1bae76=_0x1bae76-0x0;var _0x252334=_0xbc67[_0x1bae76];return _0x252334;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7bc6('0x0'));var jsonpatch=require(_0x7bc6('0x1'));var rp=require(_0x7bc6('0x2'));var moment=require(_0x7bc6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7bc6('0x4'));var util=require(_0x7bc6('0x5'));var path=require(_0x7bc6('0x6'));var sox=require(_0x7bc6('0x7'));var csv=require(_0x7bc6('0x8'));var ejs=require(_0x7bc6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7bc6('0xa'));var squel=require(_0x7bc6('0xb'));var crypto=require(_0x7bc6('0xc'));var jsforce=require(_0x7bc6('0xd'));var deskjs=require(_0x7bc6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7bc6('0xf'));var Papa=require(_0x7bc6('0x10'));var Redis=require(_0x7bc6('0x11'));var authService=require(_0x7bc6('0x12'));var qs=require(_0x7bc6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7bc6('0x14'));var logger=require(_0x7bc6('0x15'))(_0x7bc6('0x16'));var utils=require(_0x7bc6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7bc6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a8e9a,_0x58c2b5){_0x58c2b5=_0x58c2b5||0xcc;return function(_0xe6f06e){if(_0xe6f06e){return _0x2a8e9a[_0x7bc6('0x19')](_0x58c2b5);}return _0x2a8e9a['status'](_0x58c2b5)['end']();};}function respondWithResult(_0x25d0ed,_0x532c3a){_0x532c3a=_0x532c3a||0xc8;return function(_0x643b67){if(_0x643b67){return _0x25d0ed[_0x7bc6('0x1a')](_0x532c3a)[_0x7bc6('0x1b')](_0x643b67);}};}function respondWithFilteredResult(_0x4127ad,_0x54a805){return function(_0x32250c){if(_0x32250c){var _0x5a4233=typeof _0x54a805['offset']==='undefined'&&typeof _0x54a805['limit']===_0x7bc6('0x1c');var _0x245af5=_0x32250c[_0x7bc6('0x1d')];var _0x3429dc=_0x5a4233?0x0:_0x54a805[_0x7bc6('0x1e')];var _0x9125cc=_0x5a4233?_0x32250c[_0x7bc6('0x1d')]:_0x54a805['offset']+_0x54a805['limit'];var _0x349af8;if(_0x9125cc>=_0x245af5){_0x9125cc=_0x245af5;_0x349af8=0xc8;}else{_0x349af8=0xce;}_0x4127ad[_0x7bc6('0x1a')](_0x349af8);return _0x4127ad['set'](_0x7bc6('0x1f'),_0x3429dc+'-'+_0x9125cc+'/'+_0x245af5)[_0x7bc6('0x1b')](_0x32250c);}return null;};}function patchUpdates(_0x120ff6){return function(_0x40bf76){try{jsonpatch[_0x7bc6('0x20')](_0x40bf76,_0x120ff6,!![]);}catch(_0x1bc862){return BPromise['reject'](_0x1bc862);}return _0x40bf76[_0x7bc6('0x21')]();};}function saveUpdates(_0x5bbe95,_0x383fbf){return function(_0x2264a7){if(_0x2264a7){return _0x2264a7[_0x7bc6('0x22')](_0x5bbe95)[_0x7bc6('0x23')](function(_0x5b16fb){return _0x5b16fb;});}return null;};}function removeEntity(_0x339444,_0x510afc){return function(_0x441b2b){if(_0x441b2b){return _0x441b2b['destroy']()[_0x7bc6('0x23')](function(){_0x339444[_0x7bc6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18b639,_0x4a40ad){return function(_0x27716e){if(!_0x27716e){_0x18b639['sendStatus'](0x194);}return _0x27716e;};}function handleError(_0x34c12a,_0x46629b){_0x46629b=_0x46629b||0x1f4;return function(_0xcc87e3){logger[_0x7bc6('0x24')](_0xcc87e3[_0x7bc6('0x25')]);if(_0xcc87e3[_0x7bc6('0x26')]){delete _0xcc87e3[_0x7bc6('0x26')];}_0x34c12a[_0x7bc6('0x1a')](_0x46629b)[_0x7bc6('0x27')](_0xcc87e3);};}exports[_0x7bc6('0x28')]=function(_0x3aa7df,_0x459184){var _0x5d43a4={},_0x27cc85={},_0x1c6795={'count':0x0,'rows':[]};var _0x1334d3=_[_0x7bc6('0x29')](db[_0x7bc6('0x2a')]['rawAttributes'],function(_0x4df927){return{'name':_0x4df927[_0x7bc6('0x2b')],'type':_0x4df927['type'][_0x7bc6('0x2c')]};});_0x27cc85[_0x7bc6('0x2d')]=_[_0x7bc6('0x29')](_0x1334d3,'name');_0x27cc85[_0x7bc6('0x2e')]=_[_0x7bc6('0x2f')](_0x3aa7df[_0x7bc6('0x2e')]);_0x27cc85[_0x7bc6('0x30')]=_[_0x7bc6('0x31')](_0x27cc85[_0x7bc6('0x2d')],_0x27cc85[_0x7bc6('0x2e')]);_0x5d43a4['attributes']=_[_0x7bc6('0x31')](_0x27cc85[_0x7bc6('0x2d')],qs['fields'](_0x3aa7df[_0x7bc6('0x2e')][_0x7bc6('0x32')]));_0x5d43a4[_0x7bc6('0x33')]=_0x5d43a4[_0x7bc6('0x33')][_0x7bc6('0x34')]?_0x5d43a4['attributes']:_0x27cc85['model'];if(!_0x3aa7df[_0x7bc6('0x2e')]['hasOwnProperty']('nolimit')){_0x5d43a4['limit']=qs['limit'](_0x3aa7df[_0x7bc6('0x2e')][_0x7bc6('0x35')]);_0x5d43a4['offset']=qs[_0x7bc6('0x1e')](_0x3aa7df['query'][_0x7bc6('0x1e')]);}_0x5d43a4[_0x7bc6('0x36')]=qs[_0x7bc6('0x37')](_0x3aa7df[_0x7bc6('0x2e')][_0x7bc6('0x37')]);_0x5d43a4[_0x7bc6('0x38')]=qs[_0x7bc6('0x30')](_[_0x7bc6('0x39')](_0x3aa7df[_0x7bc6('0x2e')],_0x27cc85[_0x7bc6('0x30')]),_0x1334d3);if(_0x3aa7df[_0x7bc6('0x2e')]['filter']){_0x5d43a4[_0x7bc6('0x38')]=_[_0x7bc6('0x3a')](_0x5d43a4['where'],{'$or':_[_0x7bc6('0x29')](_0x1334d3,function(_0x5cb4fe){if(_0x5cb4fe[_0x7bc6('0x3b')]!==_0x7bc6('0x3c')){var _0x257ce2={};_0x257ce2[_0x5cb4fe[_0x7bc6('0x26')]]={'$like':'%'+_0x3aa7df[_0x7bc6('0x2e')]['filter']+'%'};return _0x257ce2;}})});}_0x5d43a4=_[_0x7bc6('0x3a')]({},_0x5d43a4,_0x3aa7df[_0x7bc6('0x3d')]);var _0x195328={'where':_0x5d43a4[_0x7bc6('0x38')]};return db[_0x7bc6('0x2a')]['count'](_0x195328)[_0x7bc6('0x23')](function(_0x18a6ee){_0x1c6795[_0x7bc6('0x1d')]=_0x18a6ee;if(_0x3aa7df[_0x7bc6('0x2e')]['includeAll']){_0x5d43a4[_0x7bc6('0x3e')]=[{'all':!![]}];}return db[_0x7bc6('0x2a')]['findAll'](_0x5d43a4);})['then'](function(_0xf63c00){_0x1c6795[_0x7bc6('0x3f')]=_0xf63c00;return _0x1c6795;})['then'](respondWithFilteredResult(_0x459184,_0x5d43a4))[_0x7bc6('0x40')](handleError(_0x459184,null));};exports[_0x7bc6('0x41')]=function(_0x5e5d4f,_0x75a334){var _0x58df1b={'raw':![],'where':{'id':_0x5e5d4f['params']['id']}},_0x12d901={};_0x12d901[_0x7bc6('0x2d')]=_[_0x7bc6('0x2f')](db['IntegrationReport']['rawAttributes']);_0x12d901[_0x7bc6('0x2e')]=_[_0x7bc6('0x2f')](_0x5e5d4f['query']);_0x12d901['filters']=_[_0x7bc6('0x31')](_0x12d901[_0x7bc6('0x2d')],_0x12d901[_0x7bc6('0x2e')]);_0x58df1b[_0x7bc6('0x33')]=_[_0x7bc6('0x31')](_0x12d901['model'],qs[_0x7bc6('0x32')](_0x5e5d4f[_0x7bc6('0x2e')][_0x7bc6('0x32')]));_0x58df1b[_0x7bc6('0x33')]=_0x58df1b[_0x7bc6('0x33')][_0x7bc6('0x34')]?_0x58df1b['attributes']:_0x12d901[_0x7bc6('0x2d')];if(_0x5e5d4f['query'][_0x7bc6('0x42')]){_0x58df1b[_0x7bc6('0x3e')]=[{'all':!![]}];}_0x58df1b=_[_0x7bc6('0x3a')]({},_0x58df1b,_0x5e5d4f[_0x7bc6('0x3d')]);return db['IntegrationReport'][_0x7bc6('0x43')](_0x58df1b)[_0x7bc6('0x23')](handleEntityNotFound(_0x75a334,null))[_0x7bc6('0x23')](respondWithResult(_0x75a334,null))[_0x7bc6('0x40')](handleError(_0x75a334,null));};exports['create']=function(_0x563b3b,_0x27bdfc){return db['IntegrationReport']['create'](_0x563b3b[_0x7bc6('0x44')],{})[_0x7bc6('0x23')](respondWithResult(_0x27bdfc,0xc9))[_0x7bc6('0x40')](handleError(_0x27bdfc,null));};exports[_0x7bc6('0x22')]=function(_0x2c8b0d,_0x11149e){if(_0x2c8b0d[_0x7bc6('0x44')]['id']){delete _0x2c8b0d[_0x7bc6('0x44')]['id'];}return db[_0x7bc6('0x2a')][_0x7bc6('0x43')]({'where':{'id':_0x2c8b0d[_0x7bc6('0x45')]['id']}})[_0x7bc6('0x23')](handleEntityNotFound(_0x11149e,null))['then'](saveUpdates(_0x2c8b0d[_0x7bc6('0x44')],null))[_0x7bc6('0x23')](respondWithResult(_0x11149e,null))[_0x7bc6('0x40')](handleError(_0x11149e,null));};exports[_0x7bc6('0x46')]=function(_0x455890,_0x544e98){return db[_0x7bc6('0x2a')]['find']({'where':{'id':_0x455890[_0x7bc6('0x45')]['id']}})[_0x7bc6('0x23')](handleEntityNotFound(_0x544e98,null))[_0x7bc6('0x23')](removeEntity(_0x544e98,null))[_0x7bc6('0x40')](handleError(_0x544e98,null));};exports[_0x7bc6('0x47')]=function(_0x2d9463,_0x4e99e5){return db[_0x7bc6('0x2a')][_0x7bc6('0x47')]()[_0x7bc6('0x23')](respondWithResult(_0x4e99e5,null))[_0x7bc6('0x40')](handleError(_0x4e99e5,null));}; \ No newline at end of file +var _0x44ea=['hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','IntegrationReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields'];(function(_0x47f696,_0x1ce906){var _0x250a57=function(_0x191981){while(--_0x191981){_0x47f696['push'](_0x47f696['shift']());}};_0x250a57(++_0x1ce906);}(_0x44ea,0xae));var _0xa44e=function(_0x26810f,_0x2cb1f2){_0x26810f=_0x26810f-0x0;var _0x2714d4=_0x44ea[_0x26810f];return _0x2714d4;};'use strict';var emlformat=require(_0xa44e('0x0'));var rimraf=require(_0xa44e('0x1'));var zipdir=require(_0xa44e('0x2'));var jsonpatch=require(_0xa44e('0x3'));var rp=require('request-promise');var moment=require(_0xa44e('0x4'));var BPromise=require(_0xa44e('0x5'));var Mustache=require(_0xa44e('0x6'));var util=require(_0xa44e('0x7'));var path=require(_0xa44e('0x8'));var sox=require(_0xa44e('0x9'));var csv=require(_0xa44e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa44e('0xb'));var _=require(_0xa44e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa44e('0xd'));var deskjs=require(_0xa44e('0xe'));var toCsv=require(_0xa44e('0xa'));var querystring=require(_0xa44e('0xf'));var Papa=require(_0xa44e('0x10'));var Redis=require(_0xa44e('0x11'));var authService=require(_0xa44e('0x12'));var qs=require(_0xa44e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa44e('0x14'))(_0xa44e('0x15'));var utils=require(_0xa44e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa44e('0x17'));var db=require(_0xa44e('0x18'))['db'];function respondWithStatusCode(_0x4b76eb,_0x6c1912){_0x6c1912=_0x6c1912||0xcc;return function(_0xf09914){if(_0xf09914){return _0x4b76eb['sendStatus'](_0x6c1912);}return _0x4b76eb[_0xa44e('0x19')](_0x6c1912)[_0xa44e('0x1a')]();};}function respondWithResult(_0x416a99,_0x3853d2){_0x3853d2=_0x3853d2||0xc8;return function(_0x583d46){if(_0x583d46){return _0x416a99[_0xa44e('0x19')](_0x3853d2)[_0xa44e('0x1b')](_0x583d46);}};}function respondWithFilteredResult(_0xf733e,_0xf82bcd){return function(_0x55a4b4){if(_0x55a4b4){var _0x244bc1=typeof _0xf82bcd[_0xa44e('0x1c')]==='undefined'&&typeof _0xf82bcd[_0xa44e('0x1d')]===_0xa44e('0x1e');var _0x5bbbf0=_0x55a4b4[_0xa44e('0x1f')];var _0x1e7f21=_0x244bc1?0x0:_0xf82bcd[_0xa44e('0x1c')];var _0x17a8e9=_0x244bc1?_0x55a4b4[_0xa44e('0x1f')]:_0xf82bcd[_0xa44e('0x1c')]+_0xf82bcd[_0xa44e('0x1d')];var _0x312d6c;if(_0x17a8e9>=_0x5bbbf0){_0x17a8e9=_0x5bbbf0;_0x312d6c=0xc8;}else{_0x312d6c=0xce;}_0xf733e[_0xa44e('0x19')](_0x312d6c);return _0xf733e[_0xa44e('0x20')](_0xa44e('0x21'),_0x1e7f21+'-'+_0x17a8e9+'/'+_0x5bbbf0)[_0xa44e('0x1b')](_0x55a4b4);}return null;};}function patchUpdates(_0x53300c){return function(_0x137bac){try{jsonpatch[_0xa44e('0x22')](_0x137bac,_0x53300c,!![]);}catch(_0x452296){return BPromise[_0xa44e('0x23')](_0x452296);}return _0x137bac[_0xa44e('0x24')]();};}function saveUpdates(_0x4b0937,_0x25fa70){return function(_0xd901f6){if(_0xd901f6){return _0xd901f6[_0xa44e('0x25')](_0x4b0937)[_0xa44e('0x26')](function(_0x41fd3e){return _0x41fd3e;});}return null;};}function removeEntity(_0x2b4592,_0x476fa0){return function(_0x5694d9){if(_0x5694d9){return _0x5694d9[_0xa44e('0x27')]()[_0xa44e('0x26')](function(){_0x2b4592[_0xa44e('0x19')](0xcc)[_0xa44e('0x1a')]();});}};}function handleEntityNotFound(_0x68d28c,_0x33edd9){return function(_0x24ce30){if(!_0x24ce30){_0x68d28c[_0xa44e('0x28')](0x194);}return _0x24ce30;};}function handleError(_0x316606,_0x12d8b6){_0x12d8b6=_0x12d8b6||0x1f4;return function(_0x53c081){logger[_0xa44e('0x29')](_0x53c081[_0xa44e('0x2a')]);if(_0x53c081[_0xa44e('0x2b')]){delete _0x53c081[_0xa44e('0x2b')];}_0x316606[_0xa44e('0x19')](_0x12d8b6)['send'](_0x53c081);};}exports[_0xa44e('0x2c')]=function(_0x1dd2c4,_0x2861ea){var _0x4fb4c0={},_0xd58b4b={},_0x493700={'count':0x0,'rows':[]};var _0x2f63f9=_[_0xa44e('0x2d')](db[_0xa44e('0x2e')][_0xa44e('0x2f')],function(_0x378e64){return{'name':_0x378e64[_0xa44e('0x30')],'type':_0x378e64['type'][_0xa44e('0x31')]};});_0xd58b4b[_0xa44e('0x32')]=_[_0xa44e('0x2d')](_0x2f63f9,_0xa44e('0x2b'));_0xd58b4b[_0xa44e('0x33')]=_[_0xa44e('0x34')](_0x1dd2c4[_0xa44e('0x33')]);_0xd58b4b[_0xa44e('0x35')]=_['intersection'](_0xd58b4b[_0xa44e('0x32')],_0xd58b4b[_0xa44e('0x33')]);_0x4fb4c0[_0xa44e('0x36')]=_[_0xa44e('0x37')](_0xd58b4b[_0xa44e('0x32')],qs[_0xa44e('0x38')](_0x1dd2c4[_0xa44e('0x33')][_0xa44e('0x38')]));_0x4fb4c0[_0xa44e('0x36')]=_0x4fb4c0[_0xa44e('0x36')]['length']?_0x4fb4c0[_0xa44e('0x36')]:_0xd58b4b[_0xa44e('0x32')];if(!_0x1dd2c4[_0xa44e('0x33')][_0xa44e('0x39')]('nolimit')){_0x4fb4c0['limit']=qs[_0xa44e('0x1d')](_0x1dd2c4[_0xa44e('0x33')]['limit']);_0x4fb4c0['offset']=qs[_0xa44e('0x1c')](_0x1dd2c4['query'][_0xa44e('0x1c')]);}_0x4fb4c0[_0xa44e('0x3a')]=qs['sort'](_0x1dd2c4['query']['sort']);_0x4fb4c0[_0xa44e('0x3b')]=qs[_0xa44e('0x35')](_[_0xa44e('0x3c')](_0x1dd2c4[_0xa44e('0x33')],_0xd58b4b['filters']),_0x2f63f9);if(_0x1dd2c4[_0xa44e('0x33')][_0xa44e('0x3d')]){_0x4fb4c0[_0xa44e('0x3b')]=_[_0xa44e('0x3e')](_0x4fb4c0[_0xa44e('0x3b')],{'$or':_['map'](_0x2f63f9,function(_0x390e70){if(_0x390e70[_0xa44e('0x3f')]!==_0xa44e('0x40')){var _0x1216b5={};_0x1216b5[_0x390e70['name']]={'$like':'%'+_0x1dd2c4['query']['filter']+'%'};return _0x1216b5;}})});}_0x4fb4c0=_[_0xa44e('0x3e')]({},_0x4fb4c0,_0x1dd2c4[_0xa44e('0x41')]);var _0x5d6265={'where':_0x4fb4c0['where']};return db[_0xa44e('0x2e')][_0xa44e('0x1f')](_0x5d6265)[_0xa44e('0x26')](function(_0x40062a){_0x493700[_0xa44e('0x1f')]=_0x40062a;if(_0x1dd2c4[_0xa44e('0x33')]['includeAll']){_0x4fb4c0[_0xa44e('0x42')]=[{'all':!![]}];}return db['IntegrationReport'][_0xa44e('0x43')](_0x4fb4c0);})[_0xa44e('0x26')](function(_0x3d2ee8){_0x493700[_0xa44e('0x44')]=_0x3d2ee8;return _0x493700;})[_0xa44e('0x26')](respondWithFilteredResult(_0x2861ea,_0x4fb4c0))['catch'](handleError(_0x2861ea,null));};exports[_0xa44e('0x45')]=function(_0x4262dc,_0x27db10){var _0x3c7510={'raw':![],'where':{'id':_0x4262dc[_0xa44e('0x46')]['id']}},_0x11b661={};_0x11b661[_0xa44e('0x32')]=_[_0xa44e('0x34')](db[_0xa44e('0x2e')][_0xa44e('0x2f')]);_0x11b661[_0xa44e('0x33')]=_[_0xa44e('0x34')](_0x4262dc[_0xa44e('0x33')]);_0x11b661['filters']=_['intersection'](_0x11b661['model'],_0x11b661[_0xa44e('0x33')]);_0x3c7510['attributes']=_[_0xa44e('0x37')](_0x11b661[_0xa44e('0x32')],qs[_0xa44e('0x38')](_0x4262dc[_0xa44e('0x33')]['fields']));_0x3c7510['attributes']=_0x3c7510['attributes']['length']?_0x3c7510[_0xa44e('0x36')]:_0x11b661[_0xa44e('0x32')];if(_0x4262dc[_0xa44e('0x33')][_0xa44e('0x47')]){_0x3c7510[_0xa44e('0x42')]=[{'all':!![]}];}_0x3c7510=_[_0xa44e('0x3e')]({},_0x3c7510,_0x4262dc['options']);return db[_0xa44e('0x2e')][_0xa44e('0x48')](_0x3c7510)[_0xa44e('0x26')](handleEntityNotFound(_0x27db10,null))[_0xa44e('0x26')](respondWithResult(_0x27db10,null))[_0xa44e('0x49')](handleError(_0x27db10,null));};exports['create']=function(_0x4a8d02,_0x5dc0d0){return db[_0xa44e('0x2e')][_0xa44e('0x4a')](_0x4a8d02[_0xa44e('0x4b')],{})[_0xa44e('0x26')](respondWithResult(_0x5dc0d0,0xc9))[_0xa44e('0x49')](handleError(_0x5dc0d0,null));};exports[_0xa44e('0x25')]=function(_0x28fac1,_0x1c7a81){if(_0x28fac1['body']['id']){delete _0x28fac1[_0xa44e('0x4b')]['id'];}return db['IntegrationReport'][_0xa44e('0x48')]({'where':{'id':_0x28fac1[_0xa44e('0x46')]['id']}})[_0xa44e('0x26')](handleEntityNotFound(_0x1c7a81,null))['then'](saveUpdates(_0x28fac1[_0xa44e('0x4b')],null))[_0xa44e('0x26')](respondWithResult(_0x1c7a81,null))['catch'](handleError(_0x1c7a81,null));};exports[_0xa44e('0x27')]=function(_0x27dff5,_0x54a5ea){return db[_0xa44e('0x2e')]['find']({'where':{'id':_0x27dff5[_0xa44e('0x46')]['id']}})[_0xa44e('0x26')](handleEntityNotFound(_0x54a5ea,null))[_0xa44e('0x26')](removeEntity(_0x54a5ea,null))['catch'](handleError(_0x54a5ea,null));};exports[_0xa44e('0x4c')]=function(_0x5347c6,_0x5984bb){return db[_0xa44e('0x2e')][_0xa44e('0x4c')]()['then'](respondWithResult(_0x5984bb,null))[_0xa44e('0x49')](handleError(_0x5984bb,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 1b307df..ddc5066 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 _0x3f43=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration'];(function(_0x4f6112,_0x536938){var _0x2af37c=function(_0x4d35b4){while(--_0x4d35b4){_0x4f6112['push'](_0x4f6112['shift']());}};_0x2af37c(++_0x536938);}(_0x3f43,0x16c));var _0x33f4=function(_0x5121b5,_0x15e4e7){_0x5121b5=_0x5121b5-0x0;var _0xfbbfc1=_0x3f43[_0x5121b5];return _0xfbbfc1;};'use strict';var _=require(_0x33f4('0x0'));var util=require('util');var logger=require(_0x33f4('0x1'))(_0x33f4('0x2'));var moment=require(_0x33f4('0x3'));var BPromise=require(_0x33f4('0x4'));var rp=require(_0x33f4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x33f4('0x6'));var config=require(_0x33f4('0x7'));var attributes=require(_0x33f4('0x8'));module[_0x33f4('0x9')]=function(_0x1a9f40,_0x2638ff){return _0x1a9f40[_0x33f4('0xa')](_0x33f4('0xb'),attributes,{'tableName':_0x33f4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e53=['report_integration','util','../../config/logger','moment','bluebird','path','rimraf','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x280c55,_0x4e43f1){var _0x439bce=function(_0x3d698f){while(--_0x3d698f){_0x280c55['push'](_0x280c55['shift']());}};_0x439bce(++_0x4e43f1);}(_0x1e53,0x140));var _0x31e5=function(_0x4dc46a,_0x4c8f59){_0x4dc46a=_0x4dc46a-0x0;var _0x304a3c=_0x1e53[_0x4dc46a];return _0x304a3c;};'use strict';var _=require('lodash');var util=require(_0x31e5('0x0'));var logger=require(_0x31e5('0x1'))('api');var moment=require(_0x31e5('0x2'));var BPromise=require(_0x31e5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31e5('0x4'));var rimraf=require(_0x31e5('0x5'));var config=require('../../config/environment');var attributes=require(_0x31e5('0x6'));module[_0x31e5('0x7')]=function(_0x505965,_0x509c08){return _0x505965[_0x31e5('0x8')](_0x31e5('0x9'),attributes,{'tableName':_0x31e5('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 bae533b..17611eb 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 _0x1967=['then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0x1967,0x173));var _0x7196=function(_0x438d96,_0x236924){_0x438d96=_0x438d96-0x0;var _0x34eb23=_0x1967[_0x438d96];return _0x34eb23;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file +var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x53ec,0x192));var _0xc53e=function(_0x461930,_0x329a2a){_0x461930=_0x461930-0x0;var _0x382394=_0x53ec[_0x461930];return _0x382394;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index b062eee..71e2b59 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 _0x2087=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2087,0xf3));var _0x7208=function(_0x5b6a9d,_0x2e6019){_0x5b6a9d=_0x5b6a9d-0x0;var _0x1dc718=_0x2087[_0x5b6a9d];return _0x1dc718;};'use strict';var multer=require(_0x7208('0x0'));var util=require(_0x7208('0x1'));var path=require(_0x7208('0x2'));var timeout=require(_0x7208('0x3'));var express=require('express');var router=express[_0x7208('0x4')]();var fs_extra=require(_0x7208('0x5'));var auth=require(_0x7208('0x6'));var interaction=require(_0x7208('0x7'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x7208('0x8')]('/',auth['isAuthenticated'](),controller[_0x7208('0x9')]);router['get'](_0x7208('0xa'),auth[_0x7208('0xb')](),controller[_0x7208('0xc')]);router[_0x7208('0x8')](_0x7208('0xd'),auth[_0x7208('0xb')](),controller[_0x7208('0xe')]);router['post']('/',auth[_0x7208('0xb')](),controller[_0x7208('0xf')]);router[_0x7208('0x10')](_0x7208('0xd'),auth[_0x7208('0xb')](),controller[_0x7208('0x11')]);router['post'](_0x7208('0x12'),auth[_0x7208('0xb')](),controller[_0x7208('0x13')]);router[_0x7208('0x14')](_0x7208('0xa'),auth[_0x7208('0xb')](),controller['update']);router[_0x7208('0x15')](_0x7208('0xa'),auth[_0x7208('0xb')](),controller[_0x7208('0x16')]);module[_0x7208('0x17')]=router; \ No newline at end of file +var _0x7d33=['../../components/interaction/service','../../config/environment','./interval.controller','index','get','/:id','show','/:id/sub_intervals','isAuthenticated','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x39b88e,_0x495930){var _0x11fe94=function(_0x400885){while(--_0x400885){_0x39b88e['push'](_0x39b88e['shift']());}};_0x11fe94(++_0x495930);}(_0x7d33,0x162));var _0x37d3=function(_0x4529f4,_0xbb66ee){_0x4529f4=_0x4529f4-0x0;var _0x3c9799=_0x7d33[_0x4529f4];return _0x3c9799;};'use strict';var multer=require(_0x37d3('0x0'));var util=require('util');var path=require(_0x37d3('0x1'));var timeout=require(_0x37d3('0x2'));var express=require(_0x37d3('0x3'));var router=express[_0x37d3('0x4')]();var fs_extra=require(_0x37d3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x37d3('0x6'));var config=require(_0x37d3('0x7'));var controller=require(_0x37d3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x37d3('0x9')]);router[_0x37d3('0xa')](_0x37d3('0xb'),auth['isAuthenticated'](),controller[_0x37d3('0xc')]);router[_0x37d3('0xa')](_0x37d3('0xd'),auth[_0x37d3('0xe')](),controller[_0x37d3('0xf')]);router[_0x37d3('0x10')]('/',auth['isAuthenticated'](),controller[_0x37d3('0x11')]);router[_0x37d3('0x10')](_0x37d3('0xd'),auth[_0x37d3('0xe')](),controller[_0x37d3('0x12')]);router[_0x37d3('0x10')](_0x37d3('0x13'),auth[_0x37d3('0xe')](),controller[_0x37d3('0x14')]);router[_0x37d3('0x15')](_0x37d3('0xb'),auth[_0x37d3('0xe')](),controller['update']);router[_0x37d3('0x16')](_0x37d3('0xb'),auth[_0x37d3('0xe')](),controller[_0x37d3('0x17')]);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 53cd0d9..1a21bc6 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 _0x92b1=['sequelize','STRING'];(function(_0xda90c,_0x1b67e0){var _0xedbd19=function(_0x44bae3){while(--_0x44bae3){_0xda90c['push'](_0xda90c['shift']());}};_0xedbd19(++_0x1b67e0);}(_0x92b1,0x100));var _0x192b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x92b1[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x192b('0x0'));module['exports']={'name':{'type':Sequelize[_0x192b('0x1')]},'description':{'type':Sequelize[_0x192b('0x1')]},'interval':{'type':Sequelize[_0x192b('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xf246=['STRING','sequelize'];(function(_0x3835be,_0x554f27){var _0x4fb848=function(_0x3b0a9e){while(--_0x3b0a9e){_0x3835be['push'](_0x3835be['shift']());}};_0x4fb848(++_0x554f27);}(_0xf246,0xe5));var _0x6f24=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf246[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6f24('0x0'));module['exports']={'name':{'type':Sequelize[_0x6f24('0x1')]},'description':{'type':Sequelize[_0x6f24('0x1')]},'interval':{'type':Sequelize[_0x6f24('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index f411cb8..4210011 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 _0xbaa6=['destroy','Intervals','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','filter','findAll','catch','show','params','keys','includeAll','include','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','order','hasOwnProperty','addIntervals','transaction','IntervalId','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then'];(function(_0x7e8765,_0x4c0c37){var _0x579621=function(_0x280a0c){while(--_0x280a0c){_0x7e8765['push'](_0x7e8765['shift']());}};_0x579621(++_0x4c0c37);}(_0xbaa6,0x1ae));var _0x6baa=function(_0x563af1,_0x37924c){_0x563af1=_0x563af1-0x0;var _0x58fccb=_0xbaa6[_0x563af1];return _0x58fccb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6baa('0x0'));var zipdir=require(_0x6baa('0x1'));var jsonpatch=require(_0x6baa('0x2'));var rp=require(_0x6baa('0x3'));var moment=require(_0x6baa('0x4'));var BPromise=require(_0x6baa('0x5'));var Mustache=require(_0x6baa('0x6'));var util=require(_0x6baa('0x7'));var path=require(_0x6baa('0x8'));var sox=require(_0x6baa('0x9'));var csv=require(_0x6baa('0xa'));var ejs=require(_0x6baa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6baa('0xc'));var squel=require(_0x6baa('0xd'));var crypto=require(_0x6baa('0xe'));var jsforce=require(_0x6baa('0xf'));var deskjs=require(_0x6baa('0x10'));var toCsv=require(_0x6baa('0xa'));var querystring=require('querystring');var Papa=require(_0x6baa('0x11'));var Redis=require(_0x6baa('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6baa('0x13'));var as=require(_0x6baa('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6baa('0x15'))(_0x6baa('0x16'));var utils=require(_0x6baa('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6baa('0x18'));var db=require(_0x6baa('0x19'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x26454e,_0x44bae1){_0x44bae1=_0x44bae1||0xcc;return function(_0x3e9587){if(_0x3e9587){return _0x26454e[_0x6baa('0x1a')](_0x44bae1);}return _0x26454e[_0x6baa('0x1b')](_0x44bae1)[_0x6baa('0x1c')]();};}function respondWithResult(_0x160d6d,_0x3296bb){_0x3296bb=_0x3296bb||0xc8;return function(_0x5ac8dc){if(_0x5ac8dc){return _0x160d6d['status'](_0x3296bb)['json'](_0x5ac8dc);}};}function respondWithFilteredResult(_0xa4eeb5,_0x130709){return function(_0x4c24be){if(_0x4c24be){var _0x369eed=typeof _0x130709[_0x6baa('0x1d')]===_0x6baa('0x1e')&&typeof _0x130709[_0x6baa('0x1f')]===_0x6baa('0x1e');var _0x7d4d50=_0x4c24be[_0x6baa('0x20')];var _0x212a82=_0x369eed?0x0:_0x130709[_0x6baa('0x1d')];var _0x284dd3=_0x369eed?_0x4c24be[_0x6baa('0x20')]:_0x130709['offset']+_0x130709[_0x6baa('0x1f')];var _0x212532;if(_0x284dd3>=_0x7d4d50){_0x284dd3=_0x7d4d50;_0x212532=0xc8;}else{_0x212532=0xce;}_0xa4eeb5[_0x6baa('0x1b')](_0x212532);return _0xa4eeb5[_0x6baa('0x21')](_0x6baa('0x22'),_0x212a82+'-'+_0x284dd3+'/'+_0x7d4d50)[_0x6baa('0x23')](_0x4c24be);}return null;};}function patchUpdates(_0x48f2d0){return function(_0x382152){try{jsonpatch['apply'](_0x382152,_0x48f2d0,!![]);}catch(_0x4c4695){return BPromise[_0x6baa('0x24')](_0x4c4695);}return _0x382152[_0x6baa('0x25')]();};}function saveUpdates(_0x4c5c8a,_0x1cd5d9){return function(_0x55baf7){if(_0x55baf7){return _0x55baf7[_0x6baa('0x26')](_0x4c5c8a)[_0x6baa('0x27')](function(_0x468140){return _0x468140;});}return null;};}function removeEntity(_0x2c9362,_0x3524e8){return function(_0x5a1088){if(_0x5a1088){return _0x5a1088[_0x6baa('0x28')]()[_0x6baa('0x27')](function(){var _0x164ff6=_0x5a1088['get']({'plain':!![]});var _0x2829df=_0x6baa('0x29');return db[_0x6baa('0x2a')][_0x6baa('0x28')]({'where':{'type':_0x2829df,'resourceId':_0x164ff6['id']}})[_0x6baa('0x27')](function(){return _0x5a1088;});})[_0x6baa('0x27')](function(){_0x2c9362[_0x6baa('0x1b')](0xcc)[_0x6baa('0x1c')]();});}};}function handleEntityNotFound(_0x492453,_0x54101e){return function(_0x49dda0){if(!_0x49dda0){_0x492453['sendStatus'](0x194);}return _0x49dda0;};}function handleError(_0x56dafb,_0x7b3f49){_0x7b3f49=_0x7b3f49||0x1f4;return function(_0x188941){logger[_0x6baa('0x2b')](_0x188941[_0x6baa('0x2c')]);if(_0x188941[_0x6baa('0x2d')]){delete _0x188941['name'];}_0x56dafb['status'](_0x7b3f49)[_0x6baa('0x2e')](_0x188941);};}exports[_0x6baa('0x2f')]=function(_0xc36e73,_0x55a246){var _0x2dd55c={},_0x174bc0={},_0x3521af={'count':0x0,'rows':[]};var _0x307a0d=_['map'](db[_0x6baa('0x30')][_0x6baa('0x31')],function(_0x545ff0){return{'name':_0x545ff0[_0x6baa('0x32')],'type':_0x545ff0[_0x6baa('0x33')][_0x6baa('0x34')]};});_0x174bc0[_0x6baa('0x35')]=_[_0x6baa('0x36')](_0x307a0d,'name');_0x174bc0[_0x6baa('0x37')]=_['keys'](_0xc36e73[_0x6baa('0x37')]);_0x174bc0['filters']=_['intersection'](_0x174bc0[_0x6baa('0x35')],_0x174bc0[_0x6baa('0x37')]);_0x2dd55c[_0x6baa('0x38')]=_[_0x6baa('0x39')](_0x174bc0[_0x6baa('0x35')],qs['fields'](_0xc36e73[_0x6baa('0x37')][_0x6baa('0x3a')]));_0x2dd55c[_0x6baa('0x38')]=_0x2dd55c[_0x6baa('0x38')][_0x6baa('0x3b')]?_0x2dd55c[_0x6baa('0x38')]:_0x174bc0[_0x6baa('0x35')];if(!_0xc36e73[_0x6baa('0x37')]['hasOwnProperty'](_0x6baa('0x3c'))){_0x2dd55c[_0x6baa('0x1f')]=qs[_0x6baa('0x1f')](_0xc36e73['query']['limit']);_0x2dd55c[_0x6baa('0x1d')]=qs[_0x6baa('0x1d')](_0xc36e73[_0x6baa('0x37')][_0x6baa('0x1d')]);}_0x2dd55c['order']=qs[_0x6baa('0x3d')](_0xc36e73['query']['sort']);_0x2dd55c[_0x6baa('0x3e')]=qs[_0x6baa('0x3f')](_[_0x6baa('0x40')](_0xc36e73[_0x6baa('0x37')],_0x174bc0['filters']),_0x307a0d);if(_0xc36e73[_0x6baa('0x37')][_0x6baa('0x41')]){_0x2dd55c[_0x6baa('0x3e')]=_['merge'](_0x2dd55c[_0x6baa('0x3e')],{'$or':_['map'](_0x307a0d,function(_0x23c23f){if(_0x23c23f[_0x6baa('0x33')]!=='VIRTUAL'){var _0x34d711={};_0x34d711[_0x23c23f[_0x6baa('0x2d')]]={'$like':'%'+_0xc36e73[_0x6baa('0x37')][_0x6baa('0x41')]+'%'};return _0x34d711;}})});}_0x2dd55c=_['merge']({},_0x2dd55c,_0xc36e73['options']);var _0x3738ca={'where':_0x2dd55c[_0x6baa('0x3e')]};return db[_0x6baa('0x30')][_0x6baa('0x20')](_0x3738ca)[_0x6baa('0x27')](function(_0x2b9b7c){_0x3521af[_0x6baa('0x20')]=_0x2b9b7c;if(_0xc36e73['query']['includeAll']){_0x2dd55c['include']=[{'all':!![]}];}return db[_0x6baa('0x30')][_0x6baa('0x42')](_0x2dd55c);})[_0x6baa('0x27')](function(_0x4499e2){_0x3521af['rows']=_0x4499e2;return _0x3521af;})[_0x6baa('0x27')](respondWithFilteredResult(_0x55a246,_0x2dd55c))[_0x6baa('0x43')](handleError(_0x55a246,null));};exports[_0x6baa('0x44')]=function(_0x4d291b,_0x1a89df){var _0x1ca3cc={'raw':!![],'where':{'id':_0x4d291b[_0x6baa('0x45')]['id']}},_0x1ddf11={};_0x1ddf11[_0x6baa('0x35')]=_[_0x6baa('0x46')](db[_0x6baa('0x30')][_0x6baa('0x31')]);_0x1ddf11[_0x6baa('0x37')]=_[_0x6baa('0x46')](_0x4d291b[_0x6baa('0x37')]);_0x1ddf11[_0x6baa('0x3f')]=_[_0x6baa('0x39')](_0x1ddf11[_0x6baa('0x35')],_0x1ddf11[_0x6baa('0x37')]);_0x1ca3cc[_0x6baa('0x38')]=_[_0x6baa('0x39')](_0x1ddf11[_0x6baa('0x35')],qs[_0x6baa('0x3a')](_0x4d291b[_0x6baa('0x37')][_0x6baa('0x3a')]));_0x1ca3cc['attributes']=_0x1ca3cc[_0x6baa('0x38')][_0x6baa('0x3b')]?_0x1ca3cc[_0x6baa('0x38')]:_0x1ddf11[_0x6baa('0x35')];if(_0x4d291b['query'][_0x6baa('0x47')]){_0x1ca3cc[_0x6baa('0x48')]=[{'all':!![]}];}_0x1ca3cc=_[_0x6baa('0x49')]({},_0x1ca3cc,_0x4d291b[_0x6baa('0x4a')]);return db['Interval'][_0x6baa('0x4b')](_0x1ca3cc)['then'](handleEntityNotFound(_0x1a89df,null))[_0x6baa('0x27')](respondWithResult(_0x1a89df,null))[_0x6baa('0x43')](handleError(_0x1a89df,null));};exports[_0x6baa('0x4c')]=function(_0x25f7c4,_0x226c50){return db[_0x6baa('0x30')]['create'](_0x25f7c4[_0x6baa('0x4d')],{})[_0x6baa('0x27')](function(_0x1cdd8f){var _0x40cabc=_0x25f7c4[_0x6baa('0x4e')]['get']({'plain':!![]});if(!_0x40cabc)throw new Error(_0x6baa('0x4f'));if(_0x40cabc[_0x6baa('0x50')]===_0x6baa('0x4e')){var _0x58079b=_0x1cdd8f[_0x6baa('0x51')]({'plain':!![]});var _0x49b38c=_0x6baa('0x29');return db['UserProfileSection'][_0x6baa('0x4b')]({'where':{'name':_0x49b38c,'userProfileId':_0x40cabc[_0x6baa('0x52')]},'raw':!![]})[_0x6baa('0x27')](function(_0x2779bd){if(_0x2779bd&&_0x2779bd[_0x6baa('0x53')]===0x0){return db[_0x6baa('0x2a')][_0x6baa('0x4c')]({'name':_0x58079b[_0x6baa('0x2d')],'resourceId':_0x58079b['id'],'type':_0x2779bd['name'],'sectionId':_0x2779bd['id']},{})['then'](function(){return _0x1cdd8f;});}else{return _0x1cdd8f;}})[_0x6baa('0x43')](function(_0x4edc27){logger[_0x6baa('0x2b')](_0x6baa('0x54'),_0x4edc27);throw _0x4edc27;});}return _0x1cdd8f;})['then'](respondWithResult(_0x226c50,0xc9))['catch'](handleError(_0x226c50,null));};exports[_0x6baa('0x26')]=function(_0x12aa93,_0x4e2666){if(_0x12aa93[_0x6baa('0x4d')]['id']){delete _0x12aa93['body']['id'];}return db[_0x6baa('0x30')][_0x6baa('0x4b')]({'where':{'id':_0x12aa93[_0x6baa('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e2666,null))[_0x6baa('0x27')](saveUpdates(_0x12aa93[_0x6baa('0x4d')],null))[_0x6baa('0x27')](respondWithResult(_0x4e2666,null))[_0x6baa('0x43')](handleError(_0x4e2666,null));};exports[_0x6baa('0x28')]=function(_0x524d82,_0xc2240a){return db[_0x6baa('0x30')]['find']({'where':{'id':_0x524d82[_0x6baa('0x45')]['id']}})[_0x6baa('0x27')](handleEntityNotFound(_0xc2240a,null))[_0x6baa('0x27')](removeEntity(_0xc2240a,null))['catch'](handleError(_0xc2240a,null));};exports[_0x6baa('0x55')]=function(_0x3522f4,_0x3f055d,_0xee6c26){if(_0x3522f4[_0x6baa('0x4d')]['id']){delete _0x3522f4[_0x6baa('0x4d')]['id'];}return db['Interval'][_0x6baa('0x4b')]({'where':{'id':_0x3522f4['params']['id']}})[_0x6baa('0x27')](handleEntityNotFound(_0x3f055d,null))[_0x6baa('0x27')](function(_0x2cd02e){if(_0x2cd02e){_0x3522f4[_0x6baa('0x4d')]['IntervalId']=_0x2cd02e['id'];return db[_0x6baa('0x30')][_0x6baa('0x4c')](_0x3522f4[_0x6baa('0x4d')]);}})[_0x6baa('0x27')](respondWithResult(_0x3f055d,null))[_0x6baa('0x43')](handleError(_0x3f055d,null));};exports[_0x6baa('0x56')]=function(_0x403593,_0x26aee6,_0x228641){var _0x1cf2a3={};var _0x1deede={};var _0x4d3377;var _0xb9cfd8;return db[_0x6baa('0x30')][_0x6baa('0x57')]({'where':{'id':_0x403593[_0x6baa('0x45')]['id']}})[_0x6baa('0x27')](handleEntityNotFound(_0x26aee6,null))[_0x6baa('0x27')](function(_0x5763b7){if(_0x5763b7){_0x4d3377=_0x5763b7;_0x1deede[_0x6baa('0x35')]=_[_0x6baa('0x46')](db['Interval'][_0x6baa('0x31')]);_0x1deede[_0x6baa('0x37')]=_['keys'](_0x403593[_0x6baa('0x37')]);_0x1deede[_0x6baa('0x3f')]=_[_0x6baa('0x39')](_0x1deede[_0x6baa('0x35')],_0x1deede['query']);_0x1cf2a3['attributes']=_[_0x6baa('0x39')](_0x1deede[_0x6baa('0x35')],qs[_0x6baa('0x3a')](_0x403593[_0x6baa('0x37')][_0x6baa('0x3a')]));_0x1cf2a3[_0x6baa('0x38')]=_0x1cf2a3[_0x6baa('0x38')]['length']?_0x1cf2a3[_0x6baa('0x38')]:_0x1deede[_0x6baa('0x35')];_0x1cf2a3[_0x6baa('0x58')]=qs[_0x6baa('0x3d')](_0x403593[_0x6baa('0x37')]['sort']);_0x1cf2a3['where']=qs[_0x6baa('0x3f')](_[_0x6baa('0x40')](_0x403593[_0x6baa('0x37')],_0x1deede[_0x6baa('0x3f')]));if(_0x403593[_0x6baa('0x37')]['filter']){_0x1cf2a3['where']=_[_0x6baa('0x49')](_0x1cf2a3['where'],{'$or':_[_0x6baa('0x36')](_0x1cf2a3[_0x6baa('0x38')],function(_0x1ef847){var _0x5badde={};_0x5badde[_0x1ef847]={'$like':'%'+_0x403593[_0x6baa('0x37')][_0x6baa('0x41')]+'%'};return _0x5badde;})});}_0x1cf2a3=_['merge']({},_0x1cf2a3,_0x403593[_0x6baa('0x4a')]);return _0x4d3377[_0x6baa('0x56')](_0x1cf2a3);}})[_0x6baa('0x27')](function(_0x3eeb2e){if(_0x3eeb2e){_0xb9cfd8=_0x3eeb2e[_0x6baa('0x3b')];if(!_0x403593[_0x6baa('0x37')][_0x6baa('0x59')]('nolimit')){_0x1cf2a3[_0x6baa('0x1f')]=qs['limit'](_0x403593['query'][_0x6baa('0x1f')]);_0x1cf2a3[_0x6baa('0x1d')]=qs['offset'](_0x403593[_0x6baa('0x37')][_0x6baa('0x1d')]);}return _0x4d3377[_0x6baa('0x56')](_0x1cf2a3);}})['then'](function(_0x47dec6){if(_0x47dec6){return _0x47dec6?{'count':_0xb9cfd8,'rows':_0x47dec6}:null;}})[_0x6baa('0x27')](respondWithResult(_0x26aee6,null))['catch'](handleError(_0x26aee6,null));};exports[_0x6baa('0x5a')]=function(_0x2ba796,_0x482516,_0x13238a){return db['Interval'][_0x6baa('0x57')]({'where':{'id':_0x2ba796['params']['id']}})[_0x6baa('0x27')](handleEntityNotFound(_0x482516,null))[_0x6baa('0x27')](function(_0x33ad4d){if(_0x33ad4d){return db['sequelize'][_0x6baa('0x5b')](function(_0x5917c0){return db[_0x6baa('0x30')]['destroy']({'where':{'IntervalId':_0x2ba796[_0x6baa('0x45')]['id']},'transaction':_0x5917c0})[_0x6baa('0x27')](function(_0x1e6789){var _0x1afc3a=_['map'](_0x2ba796[_0x6baa('0x4d')],function(_0x191fdd){delete _0x191fdd['id'];_0x191fdd[_0x6baa('0x5c')]=_0x2ba796[_0x6baa('0x45')]['id'];return _0x191fdd;});return db[_0x6baa('0x30')][_0x6baa('0x5d')](_0x1afc3a,{'transaction':_0x5917c0});});})[_0x6baa('0x27')](function(){return db['Interval'][_0x6baa('0x42')]({'where':{'IntervalId':_0x2ba796[_0x6baa('0x45')]['id']}});});}})[_0x6baa('0x27')](respondWithResult(_0x482516,null))[_0x6baa('0x43')](handleError(_0x482516,null));}; \ No newline at end of file +var _0x9ea3=['jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','offset','undefined','limit','count','json','reject','save','update','then','get','Intervals','UserProfileResource','end','sendStatus','stack','name','send','index','map','Interval','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','includeAll','findAll','rows','show','params','include','options','create','role','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','destroy','addInterval','IntervalId','getIntervals','findOne','filter','nolimit','addIntervals','bulkCreate','eml-format','zip-dir','mustache','util','sox','to-csv','ejs','fs-extra','squel'];(function(_0x337c32,_0x1ee74e){var _0xef168e=function(_0x464afe){while(--_0x464afe){_0x337c32['push'](_0x337c32['shift']());}};_0xef168e(++_0x1ee74e);}(_0x9ea3,0xf3));var _0x39ea=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x9ea3[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x39ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x39ea('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x39ea('0x2'));var util=require(_0x39ea('0x3'));var path=require('path');var sox=require(_0x39ea('0x4'));var csv=require(_0x39ea('0x5'));var ejs=require(_0x39ea('0x6'));var fs=require('fs');var fs_extra=require(_0x39ea('0x7'));var _=require('lodash');var squel=require(_0x39ea('0x8'));var crypto=require('crypto');var jsforce=require(_0x39ea('0x9'));var deskjs=require(_0x39ea('0xa'));var toCsv=require('to-csv');var querystring=require(_0x39ea('0xb'));var Papa=require(_0x39ea('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x39ea('0xd'));var as=require(_0x39ea('0xe'));var hardwareService=require(_0x39ea('0xf'));var logger=require('../../config/logger')(_0x39ea('0x10'));var utils=require(_0x39ea('0x11'));var config=require(_0x39ea('0x12'));var licenseUtil=require(_0x39ea('0x13'));var db=require(_0x39ea('0x14'))['db'];var extensions=require(_0x39ea('0x15'));function respondWithStatusCode(_0x321833,_0x48a690){_0x48a690=_0x48a690||0xcc;return function(_0x3c1566){if(_0x3c1566){return _0x321833['sendStatus'](_0x48a690);}return _0x321833['status'](_0x48a690)['end']();};}function respondWithResult(_0x144452,_0x156e8d){_0x156e8d=_0x156e8d||0xc8;return function(_0x516bbf){if(_0x516bbf){return _0x144452[_0x39ea('0x16')](_0x156e8d)['json'](_0x516bbf);}};}function respondWithFilteredResult(_0x212d2a,_0x4733e4){return function(_0x4d85b9){if(_0x4d85b9){var _0x46c5e7=typeof _0x4733e4[_0x39ea('0x17')]===_0x39ea('0x18')&&typeof _0x4733e4[_0x39ea('0x19')]===_0x39ea('0x18');var _0x48f7c3=_0x4d85b9[_0x39ea('0x1a')];var _0x322045=_0x46c5e7?0x0:_0x4733e4[_0x39ea('0x17')];var _0x20d5a1=_0x46c5e7?_0x4d85b9[_0x39ea('0x1a')]:_0x4733e4[_0x39ea('0x17')]+_0x4733e4['limit'];var _0x1d03aa;if(_0x20d5a1>=_0x48f7c3){_0x20d5a1=_0x48f7c3;_0x1d03aa=0xc8;}else{_0x1d03aa=0xce;}_0x212d2a[_0x39ea('0x16')](_0x1d03aa);return _0x212d2a['set']('Content-Range',_0x322045+'-'+_0x20d5a1+'/'+_0x48f7c3)[_0x39ea('0x1b')](_0x4d85b9);}return null;};}function patchUpdates(_0x55b677){return function(_0x3a4e14){try{jsonpatch['apply'](_0x3a4e14,_0x55b677,!![]);}catch(_0x1d0afa){return BPromise[_0x39ea('0x1c')](_0x1d0afa);}return _0x3a4e14[_0x39ea('0x1d')]();};}function saveUpdates(_0x5d9c95,_0x392b8f){return function(_0x4187a3){if(_0x4187a3){return _0x4187a3[_0x39ea('0x1e')](_0x5d9c95)[_0x39ea('0x1f')](function(_0xe62210){return _0xe62210;});}return null;};}function removeEntity(_0x42b96b,_0x1f7487){return function(_0x2118cc){if(_0x2118cc){return _0x2118cc['destroy']()['then'](function(){var _0x5a9384=_0x2118cc[_0x39ea('0x20')]({'plain':!![]});var _0x71dbb7=_0x39ea('0x21');return db[_0x39ea('0x22')]['destroy']({'where':{'type':_0x71dbb7,'resourceId':_0x5a9384['id']}})[_0x39ea('0x1f')](function(){return _0x2118cc;});})['then'](function(){_0x42b96b[_0x39ea('0x16')](0xcc)[_0x39ea('0x23')]();});}};}function handleEntityNotFound(_0x25eebc,_0x2c812d){return function(_0x1721a9){if(!_0x1721a9){_0x25eebc[_0x39ea('0x24')](0x194);}return _0x1721a9;};}function handleError(_0x3a4348,_0x24cb96){_0x24cb96=_0x24cb96||0x1f4;return function(_0x70b0d){logger['error'](_0x70b0d[_0x39ea('0x25')]);if(_0x70b0d['name']){delete _0x70b0d[_0x39ea('0x26')];}_0x3a4348[_0x39ea('0x16')](_0x24cb96)[_0x39ea('0x27')](_0x70b0d);};}exports[_0x39ea('0x28')]=function(_0xd1eadb,_0x266808){var _0x3f7c5e={},_0x51edb6={},_0x36abe3={'count':0x0,'rows':[]};var _0x41ea11=_[_0x39ea('0x29')](db[_0x39ea('0x2a')][_0x39ea('0x2b')],function(_0x128db6){return{'name':_0x128db6['fieldName'],'type':_0x128db6[_0x39ea('0x2c')][_0x39ea('0x2d')]};});_0x51edb6[_0x39ea('0x2e')]=_[_0x39ea('0x29')](_0x41ea11,_0x39ea('0x26'));_0x51edb6['query']=_[_0x39ea('0x2f')](_0xd1eadb[_0x39ea('0x30')]);_0x51edb6[_0x39ea('0x31')]=_[_0x39ea('0x32')](_0x51edb6[_0x39ea('0x2e')],_0x51edb6[_0x39ea('0x30')]);_0x3f7c5e[_0x39ea('0x33')]=_[_0x39ea('0x32')](_0x51edb6[_0x39ea('0x2e')],qs[_0x39ea('0x34')](_0xd1eadb['query'][_0x39ea('0x34')]));_0x3f7c5e['attributes']=_0x3f7c5e[_0x39ea('0x33')][_0x39ea('0x35')]?_0x3f7c5e[_0x39ea('0x33')]:_0x51edb6[_0x39ea('0x2e')];if(!_0xd1eadb[_0x39ea('0x30')][_0x39ea('0x36')]('nolimit')){_0x3f7c5e['limit']=qs[_0x39ea('0x19')](_0xd1eadb[_0x39ea('0x30')]['limit']);_0x3f7c5e['offset']=qs[_0x39ea('0x17')](_0xd1eadb[_0x39ea('0x30')][_0x39ea('0x17')]);}_0x3f7c5e['order']=qs[_0x39ea('0x37')](_0xd1eadb[_0x39ea('0x30')][_0x39ea('0x37')]);_0x3f7c5e['where']=qs[_0x39ea('0x31')](_[_0x39ea('0x38')](_0xd1eadb[_0x39ea('0x30')],_0x51edb6[_0x39ea('0x31')]),_0x41ea11);if(_0xd1eadb['query']['filter']){_0x3f7c5e[_0x39ea('0x39')]=_[_0x39ea('0x3a')](_0x3f7c5e[_0x39ea('0x39')],{'$or':_[_0x39ea('0x29')](_0x41ea11,function(_0xfb82a){if(_0xfb82a['type']!==_0x39ea('0x3b')){var _0x180b19={};_0x180b19[_0xfb82a[_0x39ea('0x26')]]={'$like':'%'+_0xd1eadb['query']['filter']+'%'};return _0x180b19;}})});}_0x3f7c5e=_[_0x39ea('0x3a')]({},_0x3f7c5e,_0xd1eadb['options']);var _0x42a350={'where':_0x3f7c5e[_0x39ea('0x39')]};return db['Interval'][_0x39ea('0x1a')](_0x42a350)[_0x39ea('0x1f')](function(_0x4686e9){_0x36abe3['count']=_0x4686e9;if(_0xd1eadb[_0x39ea('0x30')][_0x39ea('0x3c')]){_0x3f7c5e['include']=[{'all':!![]}];}return db['Interval'][_0x39ea('0x3d')](_0x3f7c5e);})[_0x39ea('0x1f')](function(_0x3eab08){_0x36abe3[_0x39ea('0x3e')]=_0x3eab08;return _0x36abe3;})['then'](respondWithFilteredResult(_0x266808,_0x3f7c5e))['catch'](handleError(_0x266808,null));};exports[_0x39ea('0x3f')]=function(_0x2e113e,_0x543a4d){var _0x23efde={'raw':!![],'where':{'id':_0x2e113e[_0x39ea('0x40')]['id']}},_0x2a3f62={};_0x2a3f62[_0x39ea('0x2e')]=_[_0x39ea('0x2f')](db[_0x39ea('0x2a')][_0x39ea('0x2b')]);_0x2a3f62[_0x39ea('0x30')]=_['keys'](_0x2e113e[_0x39ea('0x30')]);_0x2a3f62[_0x39ea('0x31')]=_['intersection'](_0x2a3f62[_0x39ea('0x2e')],_0x2a3f62[_0x39ea('0x30')]);_0x23efde['attributes']=_[_0x39ea('0x32')](_0x2a3f62['model'],qs[_0x39ea('0x34')](_0x2e113e['query']['fields']));_0x23efde[_0x39ea('0x33')]=_0x23efde[_0x39ea('0x33')][_0x39ea('0x35')]?_0x23efde[_0x39ea('0x33')]:_0x2a3f62[_0x39ea('0x2e')];if(_0x2e113e[_0x39ea('0x30')][_0x39ea('0x3c')]){_0x23efde[_0x39ea('0x41')]=[{'all':!![]}];}_0x23efde=_[_0x39ea('0x3a')]({},_0x23efde,_0x2e113e[_0x39ea('0x42')]);return db['Interval']['find'](_0x23efde)[_0x39ea('0x1f')](handleEntityNotFound(_0x543a4d,null))[_0x39ea('0x1f')](respondWithResult(_0x543a4d,null))['catch'](handleError(_0x543a4d,null));};exports['create']=function(_0x39b83a,_0x16c97b){return db[_0x39ea('0x2a')][_0x39ea('0x43')](_0x39b83a['body'],{})[_0x39ea('0x1f')](function(_0x575356){var _0x480291=_0x39b83a['user'][_0x39ea('0x20')]({'plain':!![]});if(!_0x480291)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x480291[_0x39ea('0x44')]==='user'){var _0xd969e2=_0x575356['get']({'plain':!![]});var _0x16f168='Intervals';return db['UserProfileSection']['find']({'where':{'name':_0x16f168,'userProfileId':_0x480291[_0x39ea('0x45')]},'raw':!![]})[_0x39ea('0x1f')](function(_0x27eaea){if(_0x27eaea&&_0x27eaea[_0x39ea('0x46')]===0x0){return db[_0x39ea('0x22')][_0x39ea('0x43')]({'name':_0xd969e2[_0x39ea('0x26')],'resourceId':_0xd969e2['id'],'type':_0x27eaea[_0x39ea('0x26')],'sectionId':_0x27eaea['id']},{})[_0x39ea('0x1f')](function(){return _0x575356;});}else{return _0x575356;}})[_0x39ea('0x47')](function(_0x45e3c3){logger['error'](_0x39ea('0x48'),_0x45e3c3);throw _0x45e3c3;});}return _0x575356;})[_0x39ea('0x1f')](respondWithResult(_0x16c97b,0xc9))['catch'](handleError(_0x16c97b,null));};exports[_0x39ea('0x1e')]=function(_0x46f35e,_0x1d948e){if(_0x46f35e[_0x39ea('0x49')]['id']){delete _0x46f35e['body']['id'];}return db[_0x39ea('0x2a')][_0x39ea('0x4a')]({'where':{'id':_0x46f35e[_0x39ea('0x40')]['id']}})[_0x39ea('0x1f')](handleEntityNotFound(_0x1d948e,null))[_0x39ea('0x1f')](saveUpdates(_0x46f35e[_0x39ea('0x49')],null))[_0x39ea('0x1f')](respondWithResult(_0x1d948e,null))[_0x39ea('0x47')](handleError(_0x1d948e,null));};exports[_0x39ea('0x4b')]=function(_0x276d70,_0x4d5e07){return db['Interval'][_0x39ea('0x4a')]({'where':{'id':_0x276d70[_0x39ea('0x40')]['id']}})[_0x39ea('0x1f')](handleEntityNotFound(_0x4d5e07,null))[_0x39ea('0x1f')](removeEntity(_0x4d5e07,null))[_0x39ea('0x47')](handleError(_0x4d5e07,null));};exports[_0x39ea('0x4c')]=function(_0x338279,_0x4d08c9,_0x187320){if(_0x338279[_0x39ea('0x49')]['id']){delete _0x338279[_0x39ea('0x49')]['id'];}return db['Interval'][_0x39ea('0x4a')]({'where':{'id':_0x338279[_0x39ea('0x40')]['id']}})[_0x39ea('0x1f')](handleEntityNotFound(_0x4d08c9,null))['then'](function(_0x96df99){if(_0x96df99){_0x338279['body'][_0x39ea('0x4d')]=_0x96df99['id'];return db[_0x39ea('0x2a')][_0x39ea('0x43')](_0x338279['body']);}})[_0x39ea('0x1f')](respondWithResult(_0x4d08c9,null))['catch'](handleError(_0x4d08c9,null));};exports[_0x39ea('0x4e')]=function(_0x2717ea,_0x72f99a,_0x311f29){var _0x346a1d={};var _0x3a5372={};var _0x2d62b1;var _0x45c50e;return db[_0x39ea('0x2a')][_0x39ea('0x4f')]({'where':{'id':_0x2717ea[_0x39ea('0x40')]['id']}})[_0x39ea('0x1f')](handleEntityNotFound(_0x72f99a,null))[_0x39ea('0x1f')](function(_0x2c41b4){if(_0x2c41b4){_0x2d62b1=_0x2c41b4;_0x3a5372[_0x39ea('0x2e')]=_[_0x39ea('0x2f')](db['Interval'][_0x39ea('0x2b')]);_0x3a5372[_0x39ea('0x30')]=_['keys'](_0x2717ea[_0x39ea('0x30')]);_0x3a5372[_0x39ea('0x31')]=_['intersection'](_0x3a5372[_0x39ea('0x2e')],_0x3a5372[_0x39ea('0x30')]);_0x346a1d[_0x39ea('0x33')]=_[_0x39ea('0x32')](_0x3a5372[_0x39ea('0x2e')],qs[_0x39ea('0x34')](_0x2717ea['query'][_0x39ea('0x34')]));_0x346a1d[_0x39ea('0x33')]=_0x346a1d[_0x39ea('0x33')][_0x39ea('0x35')]?_0x346a1d['attributes']:_0x3a5372[_0x39ea('0x2e')];_0x346a1d['order']=qs['sort'](_0x2717ea[_0x39ea('0x30')][_0x39ea('0x37')]);_0x346a1d['where']=qs['filters'](_['pick'](_0x2717ea['query'],_0x3a5372[_0x39ea('0x31')]));if(_0x2717ea['query'][_0x39ea('0x50')]){_0x346a1d[_0x39ea('0x39')]=_[_0x39ea('0x3a')](_0x346a1d[_0x39ea('0x39')],{'$or':_['map'](_0x346a1d[_0x39ea('0x33')],function(_0xf2488e){var _0x63cdac={};_0x63cdac[_0xf2488e]={'$like':'%'+_0x2717ea[_0x39ea('0x30')][_0x39ea('0x50')]+'%'};return _0x63cdac;})});}_0x346a1d=_[_0x39ea('0x3a')]({},_0x346a1d,_0x2717ea[_0x39ea('0x42')]);return _0x2d62b1['getIntervals'](_0x346a1d);}})[_0x39ea('0x1f')](function(_0x1c9781){if(_0x1c9781){_0x45c50e=_0x1c9781[_0x39ea('0x35')];if(!_0x2717ea[_0x39ea('0x30')][_0x39ea('0x36')](_0x39ea('0x51'))){_0x346a1d[_0x39ea('0x19')]=qs[_0x39ea('0x19')](_0x2717ea[_0x39ea('0x30')][_0x39ea('0x19')]);_0x346a1d['offset']=qs[_0x39ea('0x17')](_0x2717ea[_0x39ea('0x30')][_0x39ea('0x17')]);}return _0x2d62b1[_0x39ea('0x4e')](_0x346a1d);}})[_0x39ea('0x1f')](function(_0x21a012){if(_0x21a012){return _0x21a012?{'count':_0x45c50e,'rows':_0x21a012}:null;}})['then'](respondWithResult(_0x72f99a,null))[_0x39ea('0x47')](handleError(_0x72f99a,null));};exports[_0x39ea('0x52')]=function(_0x6b3aad,_0x4dbb9f,_0x17c4b3){return db['Interval'][_0x39ea('0x4f')]({'where':{'id':_0x6b3aad[_0x39ea('0x40')]['id']}})[_0x39ea('0x1f')](handleEntityNotFound(_0x4dbb9f,null))['then'](function(_0x4d6e89){if(_0x4d6e89){return db['sequelize']['transaction'](function(_0xd48e54){return db[_0x39ea('0x2a')]['destroy']({'where':{'IntervalId':_0x6b3aad[_0x39ea('0x40')]['id']},'transaction':_0xd48e54})[_0x39ea('0x1f')](function(_0x1b60bb){var _0x2556ef=_[_0x39ea('0x29')](_0x6b3aad[_0x39ea('0x49')],function(_0x2f1d15){delete _0x2f1d15['id'];_0x2f1d15[_0x39ea('0x4d')]=_0x6b3aad[_0x39ea('0x40')]['id'];return _0x2f1d15;});return db['Interval'][_0x39ea('0x53')](_0x2556ef,{'transaction':_0xd48e54});});})[_0x39ea('0x1f')](function(){return db[_0x39ea('0x2a')][_0x39ea('0x3d')]({'where':{'IntervalId':_0x6b3aad['params']['id']}});});}})[_0x39ea('0x1f')](respondWithResult(_0x4dbb9f,null))['catch'](handleError(_0x4dbb9f,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index c21b44e..dd0761b 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 _0x8d30=['path','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','moment','bluebird','request-promise'];(function(_0x161450,_0x5ca76c){var _0x5a3fda=function(_0x18a4bd){while(--_0x18a4bd){_0x161450['push'](_0x161450['shift']());}};_0x5a3fda(++_0x5ca76c);}(_0x8d30,0x7d));var _0x08d3=function(_0x3238bd,_0x4ea3ef){_0x3238bd=_0x3238bd-0x0;var _0xdc7a7e=_0x8d30[_0x3238bd];return _0xdc7a7e;};'use strict';var _=require(_0x08d3('0x0'));var util=require(_0x08d3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x08d3('0x2'));var BPromise=require(_0x08d3('0x3'));var rp=require(_0x08d3('0x4'));var fs=require('fs');var path=require(_0x08d3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x08d3('0x6'));var extensions=require(_0x08d3('0x7'));module[_0x08d3('0x8')]=function(_0x3e9ca2,_0xfe2ce){return _0x3e9ca2[_0x08d3('0x9')](_0x08d3('0xa'),attributes,{'tableName':_0x08d3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x449cf7,_0x573bcf){extensions[_0x08d3('0xc')](_0x3e9ca2,_0x449cf7);},'afterBulkCreate':function(_0x2be440,_0x19e3cd,_0x5d8840){_0x5d8840();extensions[_0x08d3('0xc')](_0x3e9ca2,_0x2be440[0x0]);},'afterUpdate':function(_0xa87b50,_0x2956be){extensions[_0x08d3('0xc')](_0x3e9ca2,_0xa87b50);},'afterDestroy':function(_0x13453c,_0x1ee30d){extensions[_0x08d3('0xc')](_0x3e9ca2,_0x13453c);}}});}; \ No newline at end of file +var _0x3944=['tools_intervals','rewrite','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports'];(function(_0xac9b71,_0x4c8fa2){var _0x276103=function(_0x97a41a){while(--_0x97a41a){_0xac9b71['push'](_0xac9b71['shift']());}};_0x276103(++_0x4c8fa2);}(_0x3944,0xf0));var _0x4394=function(_0x2040bb,_0x137951){_0x2040bb=_0x2040bb-0x0;var _0x14a234=_0x3944[_0x2040bb];return _0x14a234;};'use strict';var _=require('lodash');var util=require(_0x4394('0x0'));var logger=require(_0x4394('0x1'))(_0x4394('0x2'));var moment=require(_0x4394('0x3'));var BPromise=require(_0x4394('0x4'));var rp=require(_0x4394('0x5'));var fs=require('fs');var path=require(_0x4394('0x6'));var rimraf=require(_0x4394('0x7'));var config=require(_0x4394('0x8'));var attributes=require(_0x4394('0x9'));var extensions=require(_0x4394('0xa'));module[_0x4394('0xb')]=function(_0x4ee2d6,_0x58beeb){return _0x4ee2d6['define']('Interval',attributes,{'tableName':_0x4394('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x58d306,_0x5ddde1){extensions[_0x4394('0xd')](_0x4ee2d6,_0x58d306);},'afterBulkCreate':function(_0x2a4623,_0x104b6b,_0x9038fd){_0x9038fd();extensions['rewrite'](_0x4ee2d6,_0x2a4623[0x0]);},'afterUpdate':function(_0x534cc9,_0x385a62){extensions[_0x4394('0xd')](_0x4ee2d6,_0x534cc9);},'afterDestroy':function(_0x26a916,_0xbc9a99){extensions[_0x4394('0xd')](_0x4ee2d6,_0x26a916);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index b5261c3..0d1c107 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(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x2b5b44,_0x17189c){var _0x32cb66=function(_0x4ce183){while(--_0x4ce183){_0x2b5b44['push'](_0x2b5b44['shift']());}};_0x32cb66(++_0x17189c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 6ca1688..5ca33be 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x21d873,_0x3c7ffe){var _0x48eff9=function(_0x53fe25){while(--_0x53fe25){_0x21d873['push'](_0x21d873['shift']());}};_0x48eff9(++_0x3c7ffe);}(_0xdb28,0x106));var _0x8db2=function(_0x52d3e4,_0x6acd8){_0x52d3e4=_0x52d3e4-0x0;var _0xa41a32=_0xdb28[_0x52d3e4];return _0xa41a32;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x1de178,_0x2e0d43){var _0x1d6ba6=function(_0x354cfd){while(--_0x354cfd){_0x1de178['push'](_0x1de178['shift']());}};_0x1d6ba6(++_0x2e0d43);}(_0xadb5,0xad));var _0x5adb=function(_0x33fa5c,_0x3e3a94){_0x33fa5c=_0x33fa5c-0x0;var _0x5c7c8c=_0xadb5[_0x33fa5c];return _0x5c7c8c;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 7093ecf..de3fe75 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 _0xb862=['oldToken','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','toString','base64','request','setEncoding','utf8','data','status','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','send','body','x-forwarded-for','remoteAddress','socket','connection','https','../../config/logger','support','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','email'];(function(_0x7f05e9,_0x4fcac3){var _0x82831b=function(_0x3fb306){while(--_0x3fb306){_0x7f05e9['push'](_0x7f05e9['shift']());}};_0x82831b(++_0x4fcac3);}(_0xb862,0x1cb));var _0x2b86=function(_0x444e1c,_0x1aadb2){_0x444e1c=_0x444e1c-0x0;var _0x5a8b5d=_0xb862[_0x444e1c];return _0x5a8b5d;};'use strict';var BPromise=require('bluebird');var https=require(_0x2b86('0x0'));var logger=require(_0x2b86('0x1'))('api');var USERNAME=_0x2b86('0x2');var PASSWORD=_0x2b86('0x3');function openIssue(_0x88122d,_0x23c3a5){var _0x170050={'fields':{'project':{'key':_0x88122d['key']||_0x2b86('0x4')},'summary':(_0x88122d[_0x2b86('0x5')]||_0x2b86('0x6'))+_0x2b86('0x7')+_0x88122d['ip'],'description':_0x88122d[_0x2b86('0x8')]||JSON[_0x2b86('0x9')](_0x88122d),'issuetype':{'name':_0x88122d[_0x2b86('0xa')]||_0x2b86('0xb')}}};_0x170050[_0x2b86('0xc')]['customfield_11500']=_0x88122d[_0x2b86('0xd')];_0x170050[_0x2b86('0xc')]['customfield_11501']=_0x88122d[_0x2b86('0xe')];_0x170050[_0x2b86('0xc')][_0x2b86('0xf')]=_0x88122d[_0x2b86('0x10')];_0x170050[_0x2b86('0xc')]['customfield_11503']=_0x88122d[_0x2b86('0x11')];_0x170050[_0x2b86('0xc')][_0x2b86('0x12')]=_0x88122d[_0x2b86('0x13')];_0x170050[_0x2b86('0xc')][_0x2b86('0x14')]=_0x88122d['ip'];var _0x52d086={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x2b86('0x15'),'method':_0x2b86('0x16'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x2b86('0x17')](_0x2b86('0x18'))}};var _0x22066e=JSON[_0x2b86('0x9')](_0x170050);var _0x21fa07=https[_0x2b86('0x19')](_0x52d086,function(_0xf06047){_0xf06047[_0x2b86('0x1a')](_0x2b86('0x1b'));var _0x409edc='';_0xf06047['on'](_0x2b86('0x1c'),function(_0x2a88aa){_0x409edc+=_0x2a88aa;});_0xf06047['on']('end',function(){if(_0x23c3a5){return _0x23c3a5[_0x2b86('0x1d')](_0xf06047[_0x2b86('0x1e')])[_0x2b86('0x1f')](JSON['parse'](_0x409edc));}});});_0x21fa07['on'](_0x2b86('0x20'),function(_0x28acd6){if(_0x23c3a5){return _0x23c3a5[_0x2b86('0x1d')](0x1f4)['json']({'errors':[{'message':_0x2b86('0x21'),'type':_0x2b86('0x22')}]});}});_0x21fa07[_0x2b86('0x23')](_0x22066e);_0x21fa07[_0x2b86('0x24')]();}exports['openIssue']=openIssue;exports[_0x2b86('0x25')]=function(_0x33ef1f,_0x4028d6){_0x33ef1f[_0x2b86('0x26')]['ip']=_0x33ef1f['headers'][_0x2b86('0x27')]||_0x33ef1f['connection'][_0x2b86('0x28')]||_0x33ef1f[_0x2b86('0x29')][_0x2b86('0x28')]||_0x33ef1f[_0x2b86('0x2a')]['socket'][_0x2b86('0x28')];return openIssue(_0x33ef1f[_0x2b86('0x26')],_0x4028d6);}; \ No newline at end of file +var _0x5556=['reason','customfield_10102','track.xcallymotion.com','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','parse','error','json','api.jira','openIssue','send','body','headers','x-forwarded-for','socket','connection','bluebird','https','api','support','MOTGUI','Report','\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','customfield_11503','name','customfield_11504'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5556,0x1a5));var _0x6555=function(_0x55ffa0,_0x3c8d0e){_0x55ffa0=_0x55ffa0-0x0;var _0x644bfc=_0x5556[_0x55ffa0];return _0x644bfc;};'use strict';var BPromise=require(_0x6555('0x0'));var https=require(_0x6555('0x1'));var logger=require('../../config/logger')(_0x6555('0x2'));var USERNAME=_0x6555('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x311271,_0x588069){var _0x94e9a3={'fields':{'project':{'key':_0x311271['key']||_0x6555('0x4')},'summary':(_0x311271['summary']||_0x6555('0x5'))+_0x6555('0x6')+_0x311271['ip'],'description':_0x311271[_0x6555('0x7')]||JSON[_0x6555('0x8')](_0x311271),'issuetype':{'name':_0x311271['issuetype']||_0x6555('0x9')}}};_0x94e9a3[_0x6555('0xa')][_0x6555('0xb')]=_0x311271[_0x6555('0xc')];_0x94e9a3[_0x6555('0xa')][_0x6555('0xd')]=_0x311271[_0x6555('0xe')];_0x94e9a3['fields'][_0x6555('0xf')]=_0x311271['newToken'];_0x94e9a3[_0x6555('0xa')][_0x6555('0x10')]=_0x311271[_0x6555('0x11')];_0x94e9a3[_0x6555('0xa')][_0x6555('0x12')]=_0x311271[_0x6555('0x13')];_0x94e9a3[_0x6555('0xa')][_0x6555('0x14')]=_0x311271['ip'];var _0x16711f={'host':_0x6555('0x15'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x6555('0x16'),'Authorization':_0x6555('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x6555('0x18')](_0x6555('0x19'))}};var _0x5cfeca=JSON['stringify'](_0x94e9a3);var _0x19147a=https[_0x6555('0x1a')](_0x16711f,function(_0x2e036a){_0x2e036a[_0x6555('0x1b')](_0x6555('0x1c'));var _0xbe13cf='';_0x2e036a['on'](_0x6555('0x1d'),function(_0x19f1c8){_0xbe13cf+=_0x19f1c8;});_0x2e036a['on'](_0x6555('0x1e'),function(){if(_0x588069){return _0x588069[_0x6555('0x1f')](_0x2e036a[_0x6555('0x20')])['json'](JSON[_0x6555('0x21')](_0xbe13cf));}});});_0x19147a['on'](_0x6555('0x22'),function(_0x3e8c98){if(_0x588069){return _0x588069[_0x6555('0x1f')](0x1f4)[_0x6555('0x23')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x6555('0x24')}]});}});_0x19147a['write'](_0x5cfeca);_0x19147a[_0x6555('0x1e')]();}exports[_0x6555('0x25')]=openIssue;exports[_0x6555('0x26')]=function(_0xb9859,_0x21ed07){_0xb9859[_0x6555('0x27')]['ip']=_0xb9859[_0x6555('0x28')][_0x6555('0x29')]||_0xb9859['connection']['remoteAddress']||_0xb9859[_0x6555('0x2a')]['remoteAddress']||_0xb9859[_0x6555('0x2b')][_0x6555('0x2a')]['remoteAddress'];return openIssue(_0xb9859['body'],_0x21ed07);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index daf20a8..af0f15a 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 _0x668b=['get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','index'];(function(_0x398fca,_0x4a8a34){var _0x4987d0=function(_0x332dba){while(--_0x332dba){_0x398fca['push'](_0x398fca['shift']());}};_0x4987d0(++_0x4a8a34);}(_0x668b,0x140));var _0xb668=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0x668b[_0x5cab28];return _0xa3554d;};'use strict';var multer=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var path=require('path');var timeout=require(_0xb668('0x2'));var express=require(_0xb668('0x3'));var router=express['Router']();var fs_extra=require(_0xb668('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var controller=require(_0xb668('0x7'));router['get']('/',auth[_0xb668('0x8')](),controller[_0xb668('0x9')]);router[_0xb668('0xa')](_0xb668('0xb'),auth[_0xb668('0x8')](),controller[_0xb668('0xc')]);router['get'](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0xe')]);router[_0xb668('0xf')]('/',auth[_0xb668('0x8')](),controller[_0xb668('0x10')]);router[_0xb668('0x11')](_0xb668('0xd'),auth['isAuthenticated'](),controller[_0xb668('0x12')]);router[_0xb668('0x13')](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0x14')]);module[_0xb668('0x15')]=router; \ No newline at end of file +var _0xcb91=['get','index','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller'];(function(_0x21e9bb,_0x1db195){var _0x5303f7=function(_0x30dd13){while(--_0x30dd13){_0x21e9bb['push'](_0x21e9bb['shift']());}};_0x5303f7(++_0x1db195);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xcb91[_0x403c20];return _0x2b271a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')](_0x1cb9('0xb'),auth['isAuthenticated'](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 8d7d878..85f5d5a 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(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x7a54,0x106));var _0x47a5=function(_0x38ede1,_0xca81ac){_0x38ede1=_0x38ede1-0x0;var _0x4098bf=_0x7a54[_0x38ede1];return _0x4098bf;};'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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7a54,0x106));var _0x47a5=function(_0x2cee59,_0x6a7d22){_0x2cee59=_0x2cee59-0x0;var _0x1e9c59=_0x7a54[_0x2cee59];return _0x1e9c59;};'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 fff588b..0ac6bc9 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 _0xa4dc=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','JscriptyAnswerReport','includeAll','catch','show','params','keys','length','include','options','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x2ee881,_0x11fc32){var _0xabda6d=function(_0x2f5bb8){while(--_0x2f5bb8){_0x2ee881['push'](_0x2ee881['shift']());}};_0xabda6d(++_0x11fc32);}(_0xa4dc,0x16a));var _0xca4d=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xa4dc[_0x7e2eb0];return _0xd92de4;};'use strict';var emlformat=require(_0xca4d('0x0'));var rimraf=require(_0xca4d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xca4d('0x2'));var moment=require(_0xca4d('0x3'));var BPromise=require(_0xca4d('0x4'));var Mustache=require(_0xca4d('0x5'));var util=require(_0xca4d('0x6'));var path=require('path');var sox=require(_0xca4d('0x7'));var csv=require(_0xca4d('0x8'));var ejs=require(_0xca4d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xca4d('0xa'));var squel=require('squel');var crypto=require(_0xca4d('0xb'));var jsforce=require(_0xca4d('0xc'));var deskjs=require(_0xca4d('0xd'));var toCsv=require(_0xca4d('0x8'));var querystring=require('querystring');var Papa=require(_0xca4d('0xe'));var Redis=require(_0xca4d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xca4d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca4d('0x11'));var logger=require(_0xca4d('0x12'))(_0xca4d('0x13'));var utils=require(_0xca4d('0x14'));var config=require(_0xca4d('0x15'));var licenseUtil=require(_0xca4d('0x16'));var db=require(_0xca4d('0x17'))['db'];function respondWithStatusCode(_0x2009d4,_0x5e5163){_0x5e5163=_0x5e5163||0xcc;return function(_0x3fc3ab){if(_0x3fc3ab){return _0x2009d4['sendStatus'](_0x5e5163);}return _0x2009d4[_0xca4d('0x18')](_0x5e5163)[_0xca4d('0x19')]();};}function respondWithResult(_0x2e86ae,_0x4ab15d){_0x4ab15d=_0x4ab15d||0xc8;return function(_0x47285f){if(_0x47285f){return _0x2e86ae['status'](_0x4ab15d)[_0xca4d('0x1a')](_0x47285f);}};}function respondWithFilteredResult(_0x3dddc8,_0x33a7d6){return function(_0x334ab4){if(_0x334ab4){var _0x40e945=typeof _0x33a7d6[_0xca4d('0x1b')]===_0xca4d('0x1c')&&typeof _0x33a7d6['limit']===_0xca4d('0x1c');var _0x20ed84=_0x334ab4[_0xca4d('0x1d')];var _0x388ff7=_0x40e945?0x0:_0x33a7d6[_0xca4d('0x1b')];var _0x395319=_0x40e945?_0x334ab4[_0xca4d('0x1d')]:_0x33a7d6[_0xca4d('0x1b')]+_0x33a7d6[_0xca4d('0x1e')];var _0x5738b6;if(_0x395319>=_0x20ed84){_0x395319=_0x20ed84;_0x5738b6=0xc8;}else{_0x5738b6=0xce;}_0x3dddc8['status'](_0x5738b6);return _0x3dddc8[_0xca4d('0x1f')]('Content-Range',_0x388ff7+'-'+_0x395319+'/'+_0x20ed84)[_0xca4d('0x1a')](_0x334ab4);}return null;};}function patchUpdates(_0x555f0e){return function(_0x375efa){try{jsonpatch[_0xca4d('0x20')](_0x375efa,_0x555f0e,!![]);}catch(_0x35295c){return BPromise[_0xca4d('0x21')](_0x35295c);}return _0x375efa[_0xca4d('0x22')]();};}function saveUpdates(_0x4f692b,_0x58e346){return function(_0xe29bfc){if(_0xe29bfc){return _0xe29bfc[_0xca4d('0x23')](_0x4f692b)[_0xca4d('0x24')](function(_0x390634){return _0x390634;});}return null;};}function removeEntity(_0x5ef722,_0x2515fc){return function(_0x4d7f1a){if(_0x4d7f1a){return _0x4d7f1a[_0xca4d('0x25')]()['then'](function(){_0x5ef722[_0xca4d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1763f3,_0x3ffe67){return function(_0x3e0210){if(!_0x3e0210){_0x1763f3[_0xca4d('0x26')](0x194);}return _0x3e0210;};}function handleError(_0x57a079,_0x327006){_0x327006=_0x327006||0x1f4;return function(_0xfea1c5){logger[_0xca4d('0x27')](_0xfea1c5[_0xca4d('0x28')]);if(_0xfea1c5[_0xca4d('0x29')]){delete _0xfea1c5[_0xca4d('0x29')];}_0x57a079[_0xca4d('0x18')](_0x327006)[_0xca4d('0x2a')](_0xfea1c5);};}exports[_0xca4d('0x2b')]=function(_0x37d563,_0xfacacb){var _0x319dea={},_0x522be8={},_0x53efdb={'count':0x0,'rows':[]};var _0xcc6dd5=_[_0xca4d('0x2c')](db['JscriptyAnswerReport'][_0xca4d('0x2d')],function(_0x532066){return{'name':_0x532066[_0xca4d('0x2e')],'type':_0x532066[_0xca4d('0x2f')]['key']};});_0x522be8[_0xca4d('0x30')]=_[_0xca4d('0x2c')](_0xcc6dd5,_0xca4d('0x29'));_0x522be8[_0xca4d('0x31')]=_['keys'](_0x37d563[_0xca4d('0x31')]);_0x522be8[_0xca4d('0x32')]=_[_0xca4d('0x33')](_0x522be8[_0xca4d('0x30')],_0x522be8['query']);_0x319dea[_0xca4d('0x34')]=_[_0xca4d('0x33')](_0x522be8[_0xca4d('0x30')],qs[_0xca4d('0x35')](_0x37d563['query'][_0xca4d('0x35')]));_0x319dea[_0xca4d('0x34')]=_0x319dea[_0xca4d('0x34')]['length']?_0x319dea[_0xca4d('0x34')]:_0x522be8[_0xca4d('0x30')];if(!_0x37d563[_0xca4d('0x31')][_0xca4d('0x36')](_0xca4d('0x37'))){_0x319dea['limit']=qs[_0xca4d('0x1e')](_0x37d563[_0xca4d('0x31')][_0xca4d('0x1e')]);_0x319dea[_0xca4d('0x1b')]=qs[_0xca4d('0x1b')](_0x37d563['query'][_0xca4d('0x1b')]);}_0x319dea[_0xca4d('0x38')]=qs[_0xca4d('0x39')](_0x37d563[_0xca4d('0x31')]['sort']);_0x319dea['where']=qs[_0xca4d('0x32')](_[_0xca4d('0x3a')](_0x37d563['query'],_0x522be8[_0xca4d('0x32')]),_0xcc6dd5);if(_0x37d563['query'][_0xca4d('0x3b')]){_0x319dea['where']=_[_0xca4d('0x3c')](_0x319dea['where'],{'$or':_[_0xca4d('0x2c')](_0xcc6dd5,function(_0x2e7dd7){if(_0x2e7dd7[_0xca4d('0x2f')]!==_0xca4d('0x3d')){var _0x361835={};_0x361835[_0x2e7dd7['name']]={'$like':'%'+_0x37d563[_0xca4d('0x31')][_0xca4d('0x3b')]+'%'};return _0x361835;}})});}_0x319dea=_[_0xca4d('0x3c')]({},_0x319dea,_0x37d563['options']);var _0x1f0b3e={'where':_0x319dea[_0xca4d('0x3e')]};return db[_0xca4d('0x3f')]['count'](_0x1f0b3e)[_0xca4d('0x24')](function(_0x206391){_0x53efdb[_0xca4d('0x1d')]=_0x206391;if(_0x37d563['query'][_0xca4d('0x40')]){_0x319dea['include']=[{'all':!![]}];}return db[_0xca4d('0x3f')]['findAll'](_0x319dea);})['then'](function(_0x173bca){_0x53efdb['rows']=_0x173bca;return _0x53efdb;})['then'](respondWithFilteredResult(_0xfacacb,_0x319dea))[_0xca4d('0x41')](handleError(_0xfacacb,null));};exports[_0xca4d('0x42')]=function(_0x39dd75,_0x27f9da){var _0x44430c={'raw':!![],'where':{'id':_0x39dd75[_0xca4d('0x43')]['id']}},_0x164509={};_0x164509[_0xca4d('0x30')]=_[_0xca4d('0x44')](db['JscriptyAnswerReport']['rawAttributes']);_0x164509[_0xca4d('0x31')]=_[_0xca4d('0x44')](_0x39dd75[_0xca4d('0x31')]);_0x164509['filters']=_[_0xca4d('0x33')](_0x164509[_0xca4d('0x30')],_0x164509['query']);_0x44430c[_0xca4d('0x34')]=_[_0xca4d('0x33')](_0x164509[_0xca4d('0x30')],qs['fields'](_0x39dd75['query'][_0xca4d('0x35')]));_0x44430c[_0xca4d('0x34')]=_0x44430c[_0xca4d('0x34')][_0xca4d('0x45')]?_0x44430c[_0xca4d('0x34')]:_0x164509['model'];if(_0x39dd75[_0xca4d('0x31')][_0xca4d('0x40')]){_0x44430c[_0xca4d('0x46')]=[{'all':!![]}];}_0x44430c=_[_0xca4d('0x3c')]({},_0x44430c,_0x39dd75[_0xca4d('0x47')]);return db[_0xca4d('0x3f')][_0xca4d('0x48')](_0x44430c)[_0xca4d('0x24')](handleEntityNotFound(_0x27f9da,null))['then'](respondWithResult(_0x27f9da,null))[_0xca4d('0x41')](handleError(_0x27f9da,null));};exports['create']=function(_0x505fb7,_0x5f335c){return db[_0xca4d('0x3f')][_0xca4d('0x49')](_0x505fb7[_0xca4d('0x4a')],{})[_0xca4d('0x24')](respondWithResult(_0x5f335c,0xc9))[_0xca4d('0x41')](handleError(_0x5f335c,null));};exports[_0xca4d('0x23')]=function(_0x3bba4d,_0x3f7dd6){if(_0x3bba4d[_0xca4d('0x4a')]['id']){delete _0x3bba4d[_0xca4d('0x4a')]['id'];}return db[_0xca4d('0x3f')][_0xca4d('0x48')]({'where':{'id':_0x3bba4d[_0xca4d('0x43')]['id']}})[_0xca4d('0x24')](handleEntityNotFound(_0x3f7dd6,null))[_0xca4d('0x24')](saveUpdates(_0x3bba4d[_0xca4d('0x4a')],null))[_0xca4d('0x24')](respondWithResult(_0x3f7dd6,null))[_0xca4d('0x41')](handleError(_0x3f7dd6,null));};exports[_0xca4d('0x25')]=function(_0x3b91d3,_0x5a3a45){return db[_0xca4d('0x3f')][_0xca4d('0x48')]({'where':{'id':_0x3b91d3['params']['id']}})['then'](handleEntityNotFound(_0x5a3a45,null))[_0xca4d('0x24')](removeEntity(_0x5a3a45,null))[_0xca4d('0x41')](handleError(_0x5a3a45,null));};exports[_0xca4d('0x4b')]=function(_0x250fda,_0x4679c0){return db[_0xca4d('0x3f')][_0xca4d('0x4b')]()['then'](respondWithResult(_0x4679c0,null))[_0xca4d('0x41')](handleError(_0x4679c0,null));}; \ No newline at end of file +var _0xdc59=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','JscriptyAnswerReport','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','findAll','catch','show','params','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','moment'];(function(_0x5493aa,_0x24d453){var _0xc0ac3f=function(_0x3697e0){while(--_0x3697e0){_0x5493aa['push'](_0x5493aa['shift']());}};_0xc0ac3f(++_0x24d453);}(_0xdc59,0x12c));var _0x9dc5=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xdc59[_0x474bc0];return _0x4b24cf;};'use strict';var emlformat=require(_0x9dc5('0x0'));var rimraf=require(_0x9dc5('0x1'));var zipdir=require(_0x9dc5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9dc5('0x3'));var BPromise=require(_0x9dc5('0x4'));var Mustache=require(_0x9dc5('0x5'));var util=require(_0x9dc5('0x6'));var path=require(_0x9dc5('0x7'));var sox=require(_0x9dc5('0x8'));var csv=require(_0x9dc5('0x9'));var ejs=require(_0x9dc5('0xa'));var fs=require('fs');var fs_extra=require(_0x9dc5('0xb'));var _=require('lodash');var squel=require(_0x9dc5('0xc'));var crypto=require(_0x9dc5('0xd'));var jsforce=require(_0x9dc5('0xe'));var deskjs=require(_0x9dc5('0xf'));var toCsv=require(_0x9dc5('0x9'));var querystring=require(_0x9dc5('0x10'));var Papa=require(_0x9dc5('0x11'));var Redis=require(_0x9dc5('0x12'));var authService=require(_0x9dc5('0x13'));var qs=require(_0x9dc5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9dc5('0x15'));var logger=require(_0x9dc5('0x16'))(_0x9dc5('0x17'));var utils=require(_0x9dc5('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9dc5('0x19'));var db=require(_0x9dc5('0x1a'))['db'];function respondWithStatusCode(_0x36d236,_0x5612dc){_0x5612dc=_0x5612dc||0xcc;return function(_0x11427e){if(_0x11427e){return _0x36d236[_0x9dc5('0x1b')](_0x5612dc);}return _0x36d236[_0x9dc5('0x1c')](_0x5612dc)[_0x9dc5('0x1d')]();};}function respondWithResult(_0x312fe2,_0x239a0d){_0x239a0d=_0x239a0d||0xc8;return function(_0x786239){if(_0x786239){return _0x312fe2[_0x9dc5('0x1c')](_0x239a0d)[_0x9dc5('0x1e')](_0x786239);}};}function respondWithFilteredResult(_0x45912d,_0x4ac27c){return function(_0x26302e){if(_0x26302e){var _0x5ebe8b=typeof _0x4ac27c[_0x9dc5('0x1f')]===_0x9dc5('0x20')&&typeof _0x4ac27c['limit']===_0x9dc5('0x20');var _0x2f195a=_0x26302e[_0x9dc5('0x21')];var _0x16fca8=_0x5ebe8b?0x0:_0x4ac27c['offset'];var _0x4493c7=_0x5ebe8b?_0x26302e[_0x9dc5('0x21')]:_0x4ac27c[_0x9dc5('0x1f')]+_0x4ac27c[_0x9dc5('0x22')];var _0x4100e7;if(_0x4493c7>=_0x2f195a){_0x4493c7=_0x2f195a;_0x4100e7=0xc8;}else{_0x4100e7=0xce;}_0x45912d['status'](_0x4100e7);return _0x45912d[_0x9dc5('0x23')](_0x9dc5('0x24'),_0x16fca8+'-'+_0x4493c7+'/'+_0x2f195a)[_0x9dc5('0x1e')](_0x26302e);}return null;};}function patchUpdates(_0x4e6388){return function(_0x4ada0c){try{jsonpatch[_0x9dc5('0x25')](_0x4ada0c,_0x4e6388,!![]);}catch(_0x5e2da8){return BPromise[_0x9dc5('0x26')](_0x5e2da8);}return _0x4ada0c['save']();};}function saveUpdates(_0x191c88,_0x5c8956){return function(_0x100ae7){if(_0x100ae7){return _0x100ae7['update'](_0x191c88)[_0x9dc5('0x27')](function(_0x1c3726){return _0x1c3726;});}return null;};}function removeEntity(_0x255bff,_0x4ddea4){return function(_0x184d78){if(_0x184d78){return _0x184d78[_0x9dc5('0x28')]()[_0x9dc5('0x27')](function(){_0x255bff[_0x9dc5('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ba5d2,_0xdeab68){return function(_0xf6da02){if(!_0xf6da02){_0x4ba5d2[_0x9dc5('0x1b')](0x194);}return _0xf6da02;};}function handleError(_0x21e4fb,_0x5ea9b4){_0x5ea9b4=_0x5ea9b4||0x1f4;return function(_0x59a0bf){logger[_0x9dc5('0x29')](_0x59a0bf[_0x9dc5('0x2a')]);if(_0x59a0bf['name']){delete _0x59a0bf[_0x9dc5('0x2b')];}_0x21e4fb[_0x9dc5('0x1c')](_0x5ea9b4)[_0x9dc5('0x2c')](_0x59a0bf);};}exports['index']=function(_0x4777f0,_0x311dfc){var _0x4630e2={},_0x3fadbf={},_0x3659a6={'count':0x0,'rows':[]};var _0x2d73e5=_['map'](db[_0x9dc5('0x2d')][_0x9dc5('0x2e')],function(_0x21b243){return{'name':_0x21b243[_0x9dc5('0x2f')],'type':_0x21b243[_0x9dc5('0x30')]['key']};});_0x3fadbf['model']=_[_0x9dc5('0x31')](_0x2d73e5,_0x9dc5('0x2b'));_0x3fadbf['query']=_[_0x9dc5('0x32')](_0x4777f0[_0x9dc5('0x33')]);_0x3fadbf[_0x9dc5('0x34')]=_[_0x9dc5('0x35')](_0x3fadbf[_0x9dc5('0x36')],_0x3fadbf[_0x9dc5('0x33')]);_0x4630e2[_0x9dc5('0x37')]=_[_0x9dc5('0x35')](_0x3fadbf[_0x9dc5('0x36')],qs['fields'](_0x4777f0[_0x9dc5('0x33')][_0x9dc5('0x38')]));_0x4630e2[_0x9dc5('0x37')]=_0x4630e2[_0x9dc5('0x37')][_0x9dc5('0x39')]?_0x4630e2[_0x9dc5('0x37')]:_0x3fadbf['model'];if(!_0x4777f0[_0x9dc5('0x33')]['hasOwnProperty'](_0x9dc5('0x3a'))){_0x4630e2['limit']=qs[_0x9dc5('0x22')](_0x4777f0[_0x9dc5('0x33')][_0x9dc5('0x22')]);_0x4630e2[_0x9dc5('0x1f')]=qs[_0x9dc5('0x1f')](_0x4777f0[_0x9dc5('0x33')][_0x9dc5('0x1f')]);}_0x4630e2[_0x9dc5('0x3b')]=qs[_0x9dc5('0x3c')](_0x4777f0[_0x9dc5('0x33')][_0x9dc5('0x3c')]);_0x4630e2['where']=qs[_0x9dc5('0x34')](_['pick'](_0x4777f0[_0x9dc5('0x33')],_0x3fadbf[_0x9dc5('0x34')]),_0x2d73e5);if(_0x4777f0[_0x9dc5('0x33')]['filter']){_0x4630e2[_0x9dc5('0x3d')]=_[_0x9dc5('0x3e')](_0x4630e2[_0x9dc5('0x3d')],{'$or':_['map'](_0x2d73e5,function(_0x1781a7){if(_0x1781a7[_0x9dc5('0x30')]!==_0x9dc5('0x3f')){var _0x3f097e={};_0x3f097e[_0x1781a7['name']]={'$like':'%'+_0x4777f0[_0x9dc5('0x33')][_0x9dc5('0x40')]+'%'};return _0x3f097e;}})});}_0x4630e2=_[_0x9dc5('0x3e')]({},_0x4630e2,_0x4777f0[_0x9dc5('0x41')]);var _0x594b5e={'where':_0x4630e2[_0x9dc5('0x3d')]};return db['JscriptyAnswerReport'][_0x9dc5('0x21')](_0x594b5e)[_0x9dc5('0x27')](function(_0x222662){_0x3659a6[_0x9dc5('0x21')]=_0x222662;if(_0x4777f0['query']['includeAll']){_0x4630e2['include']=[{'all':!![]}];}return db[_0x9dc5('0x2d')][_0x9dc5('0x42')](_0x4630e2);})[_0x9dc5('0x27')](function(_0x1a9162){_0x3659a6['rows']=_0x1a9162;return _0x3659a6;})[_0x9dc5('0x27')](respondWithFilteredResult(_0x311dfc,_0x4630e2))[_0x9dc5('0x43')](handleError(_0x311dfc,null));};exports[_0x9dc5('0x44')]=function(_0x30ef89,_0x1781fa){var _0x4a7262={'raw':!![],'where':{'id':_0x30ef89[_0x9dc5('0x45')]['id']}},_0x5d2fe7={};_0x5d2fe7['model']=_[_0x9dc5('0x32')](db[_0x9dc5('0x2d')]['rawAttributes']);_0x5d2fe7[_0x9dc5('0x33')]=_[_0x9dc5('0x32')](_0x30ef89[_0x9dc5('0x33')]);_0x5d2fe7[_0x9dc5('0x34')]=_[_0x9dc5('0x35')](_0x5d2fe7[_0x9dc5('0x36')],_0x5d2fe7[_0x9dc5('0x33')]);_0x4a7262[_0x9dc5('0x37')]=_[_0x9dc5('0x35')](_0x5d2fe7['model'],qs[_0x9dc5('0x38')](_0x30ef89[_0x9dc5('0x33')]['fields']));_0x4a7262['attributes']=_0x4a7262[_0x9dc5('0x37')]['length']?_0x4a7262['attributes']:_0x5d2fe7[_0x9dc5('0x36')];if(_0x30ef89[_0x9dc5('0x33')][_0x9dc5('0x46')]){_0x4a7262[_0x9dc5('0x47')]=[{'all':!![]}];}_0x4a7262=_['merge']({},_0x4a7262,_0x30ef89[_0x9dc5('0x41')]);return db['JscriptyAnswerReport'][_0x9dc5('0x48')](_0x4a7262)[_0x9dc5('0x27')](handleEntityNotFound(_0x1781fa,null))[_0x9dc5('0x27')](respondWithResult(_0x1781fa,null))['catch'](handleError(_0x1781fa,null));};exports['create']=function(_0x44f8a3,_0x26d54e){return db[_0x9dc5('0x2d')][_0x9dc5('0x49')](_0x44f8a3['body'],{})[_0x9dc5('0x27')](respondWithResult(_0x26d54e,0xc9))[_0x9dc5('0x43')](handleError(_0x26d54e,null));};exports['update']=function(_0x5ca7e8,_0x188338){if(_0x5ca7e8[_0x9dc5('0x4a')]['id']){delete _0x5ca7e8[_0x9dc5('0x4a')]['id'];}return db[_0x9dc5('0x2d')][_0x9dc5('0x48')]({'where':{'id':_0x5ca7e8[_0x9dc5('0x45')]['id']}})['then'](handleEntityNotFound(_0x188338,null))[_0x9dc5('0x27')](saveUpdates(_0x5ca7e8[_0x9dc5('0x4a')],null))['then'](respondWithResult(_0x188338,null))[_0x9dc5('0x43')](handleError(_0x188338,null));};exports[_0x9dc5('0x28')]=function(_0x3d6260,_0x3ac2f2){return db['JscriptyAnswerReport'][_0x9dc5('0x48')]({'where':{'id':_0x3d6260[_0x9dc5('0x45')]['id']}})[_0x9dc5('0x27')](handleEntityNotFound(_0x3ac2f2,null))[_0x9dc5('0x27')](removeEntity(_0x3ac2f2,null))[_0x9dc5('0x43')](handleError(_0x3ac2f2,null));};exports[_0x9dc5('0x4b')]=function(_0x23f6cc,_0x171e33){return db[_0x9dc5('0x2d')]['describe']()[_0x9dc5('0x27')](respondWithResult(_0x171e33,null))[_0x9dc5('0x43')](handleError(_0x171e33,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 9696a26..d2fb311 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 _0x0d61=['../../config/logger','api','moment','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d61,0x1dd));var _0x10d6=function(_0x55157b,_0x19406b){_0x55157b=_0x55157b-0x0;var _0x2a2f2c=_0x0d61[_0x55157b];return _0x2a2f2c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x10d6('0x0'))(_0x10d6('0x1'));var moment=require(_0x10d6('0x2'));var BPromise=require('bluebird');var rp=require(_0x10d6('0x3'));var fs=require('fs');var path=require(_0x10d6('0x4'));var rimraf=require(_0x10d6('0x5'));var config=require('../../config/environment');var attributes=require(_0x10d6('0x6'));module['exports']=function(_0x12a7b9,_0x41b99d){return _0x12a7b9[_0x10d6('0x7')](_0x10d6('0x8'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7160=['bluebird','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','moment'];(function(_0x3327f4,_0xaa23a8){var _0x1bba49=function(_0x2054be){while(--_0x2054be){_0x3327f4['push'](_0x3327f4['shift']());}};_0x1bba49(++_0xaa23a8);}(_0x7160,0x1ab));var _0x0716=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x7160[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x0716('0x0'));var util=require('util');var logger=require(_0x0716('0x1'))('api');var moment=require(_0x0716('0x2'));var BPromise=require(_0x0716('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0716('0x4'));var attributes=require(_0x0716('0x5'));module[_0x0716('0x6')]=function(_0x1da6ff,_0x1b375b){return _0x1da6ff[_0x0716('0x7')](_0x0716('0x8'),attributes,{'tableName':_0x0716('0x9'),'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 9d5182c..70c06be 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 _0x7bc5=['code','message','info','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xe36e9d,_0x31e7a3){var _0xe596f3=function(_0x5dc713){while(--_0x5dc713){_0xe36e9d['push'](_0xe36e9d['shift']());}};_0xe596f3(++_0x31e7a3);}(_0x7bc5,0x7c));var _0x57bc=function(_0x14e9f0,_0x287f90){_0x14e9f0=_0x14e9f0-0x0;var _0xa63f7e=_0x7bc5[_0x14e9f0];return _0xa63f7e;};'use strict';var _=require(_0x57bc('0x0'));var util=require('util');var moment=require(_0x57bc('0x1'));var BPromise=require(_0x57bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57bc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x57bc('0x4'))(_0x57bc('0x5'));var config=require(_0x57bc('0x6'));var jayson=require(_0x57bc('0x7'));var client=jayson['client'][_0x57bc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x74e816,_0x174b9e,_0x2fe491){return new BPromise(function(_0x2b9602,_0x217af6){return client[_0x57bc('0x9')](_0x74e816,_0x2fe491)['then'](function(_0x3868d9){logger['info'](_0x57bc('0xa'),_0x174b9e,_0x57bc('0xb'));logger[_0x57bc('0xc')](_0x57bc('0xd'),_0x174b9e,_0x57bc('0xb'),JSON[_0x57bc('0xe')](_0x3868d9));if(_0x3868d9['error']){if(_0x3868d9[_0x57bc('0xf')][_0x57bc('0x10')]===0x1f4){logger[_0x57bc('0xf')](_0x57bc('0xa'),_0x174b9e,_0x3868d9[_0x57bc('0xf')][_0x57bc('0x11')]);return _0x217af6(_0x3868d9[_0x57bc('0xf')][_0x57bc('0x11')]);}logger[_0x57bc('0xf')](_0x57bc('0xa'),_0x174b9e,_0x3868d9['error'][_0x57bc('0x11')]);return _0x2b9602(_0x3868d9['error']['message']);}else{logger[_0x57bc('0x12')](_0x57bc('0xa'),_0x174b9e,_0x57bc('0xb'));_0x2b9602(_0x3868d9['result'][_0x57bc('0x11')]);}})[_0x57bc('0x13')](function(_0x57f2b6){logger[_0x57bc('0xf')](_0x57bc('0xa'),_0x174b9e,_0x57f2b6);_0x217af6(_0x57f2b6);});});} \ No newline at end of file +var _0x8956=['rpc','../../config/environment','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8956,0x1e8));var _0x6895=function(_0x3add29,_0x679341){_0x3add29=_0x3add29-0x0;var _0x5efb22=_0x8956[_0x3add29];return _0x5efb22;};'use strict';var _=require(_0x6895('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6895('0x1'));var fs=require('fs');var Redis=require(_0x6895('0x2'));var db=require(_0x6895('0x3'))['db'];var utils=require(_0x6895('0x4'));var logger=require(_0x6895('0x5'))(_0x6895('0x6'));var config=require(_0x6895('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6895('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bc41b,_0x542b68,_0x59063b){return new BPromise(function(_0x286e08,_0x3544dc){return client[_0x6895('0x9')](_0x4bc41b,_0x59063b)['then'](function(_0x4ac9a2){logger[_0x6895('0xa')](_0x6895('0xb'),_0x542b68,_0x6895('0xc'));logger['debug'](_0x6895('0xd'),_0x542b68,_0x6895('0xc'),JSON[_0x6895('0xe')](_0x4ac9a2));if(_0x4ac9a2[_0x6895('0xf')]){if(_0x4ac9a2[_0x6895('0xf')]['code']===0x1f4){logger[_0x6895('0xf')](_0x6895('0xb'),_0x542b68,_0x4ac9a2[_0x6895('0xf')]['message']);return _0x3544dc(_0x4ac9a2[_0x6895('0xf')][_0x6895('0x10')]);}logger[_0x6895('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x542b68,_0x4ac9a2[_0x6895('0xf')][_0x6895('0x10')]);return _0x286e08(_0x4ac9a2[_0x6895('0xf')]['message']);}else{logger['info'](_0x6895('0xb'),_0x542b68,'request\x20sent');_0x286e08(_0x4ac9a2[_0x6895('0x11')][_0x6895('0x10')]);}})[_0x6895('0x12')](function(_0x35bd71){logger[_0x6895('0xf')](_0x6895('0xb'),_0x542b68,_0x35bd71);_0x3544dc(_0x35bd71);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 8fb3703..e736b1b 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 _0x3e81=['create','/:id/clone','/:id','delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','isAuthenticated','30s','post'];(function(_0x33b259,_0x2036be){var _0xf95548=function(_0x5b3424){while(--_0x5b3424){_0x33b259['push'](_0x33b259['shift']());}};_0xf95548(++_0x2036be);}(_0x3e81,0x1d3));var _0x13e8=function(_0x180fc8,_0x169157){_0x180fc8=_0x180fc8-0x0;var _0x411749=_0x3e81[_0x180fc8];return _0x411749;};'use strict';var multer=require(_0x13e8('0x0'));var util=require(_0x13e8('0x1'));var path=require('path');var timeout=require(_0x13e8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x13e8('0x3'));var auth=require(_0x13e8('0x4'));var interaction=require(_0x13e8('0x5'));var config=require('../../config/environment');var controller=require(_0x13e8('0x6'));router[_0x13e8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x13e8('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x13e8('0x8'),auth['isAuthenticated'](),controller[_0x13e8('0x9')]);router['get'](_0x13e8('0xa'),auth['isAuthenticated'](),controller[_0x13e8('0xb')]);router[_0x13e8('0x7')](_0x13e8('0xc'),auth[_0x13e8('0xd')](),timeout(_0x13e8('0xe')),controller['getSummary']);router[_0x13e8('0xf')]('/',auth[_0x13e8('0xd')](),controller[_0x13e8('0x10')]);router[_0x13e8('0xf')](_0x13e8('0x11'),auth[_0x13e8('0xd')](),controller['clone']);router['put'](_0x13e8('0x12'),auth[_0x13e8('0xd')](),controller['update']);router[_0x13e8('0x13')](_0x13e8('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x13e8('0x14')]=router; \ No newline at end of file +var _0xfc16=['get','isAuthenticated','index','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','getSummary','post','create','/:id/clone','clone','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyProject.controller'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0xfc16,0x7e));var _0x6fc1=function(_0x471448,_0x1c0e9e){_0x471448=_0x471448-0x0;var _0x38190b=_0xfc16[_0x471448];return _0x38190b;};'use strict';var multer=require('multer');var util=require(_0x6fc1('0x0'));var path=require(_0x6fc1('0x1'));var timeout=require(_0x6fc1('0x2'));var express=require(_0x6fc1('0x3'));var router=express[_0x6fc1('0x4')]();var fs_extra=require(_0x6fc1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6fc1('0x6'));var config=require(_0x6fc1('0x7'));var controller=require(_0x6fc1('0x8'));router[_0x6fc1('0x9')]('/',auth[_0x6fc1('0xa')](),controller[_0x6fc1('0xb')]);router[_0x6fc1('0x9')]('/:id',auth[_0x6fc1('0xa')](),controller['show']);router['get'](_0x6fc1('0xc'),auth[_0x6fc1('0xa')](),controller[_0x6fc1('0xd')]);router['get'](_0x6fc1('0xe'),auth[_0x6fc1('0xa')](),controller[_0x6fc1('0xf')]);router[_0x6fc1('0x9')]('/:id/summary',auth[_0x6fc1('0xa')](),timeout(_0x6fc1('0x10')),controller[_0x6fc1('0x11')]);router[_0x6fc1('0x12')]('/',auth[_0x6fc1('0xa')](),controller[_0x6fc1('0x13')]);router[_0x6fc1('0x12')](_0x6fc1('0x14'),auth['isAuthenticated'](),controller[_0x6fc1('0x15')]);router[_0x6fc1('0x16')](_0x6fc1('0x17'),auth[_0x6fc1('0xa')](),controller[_0x6fc1('0x18')]);router[_0x6fc1('0x19')](_0x6fc1('0x17'),auth[_0x6fc1('0xa')](),controller['destroy']);module[_0x6fc1('0x1a')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 20a0e75..fffedf6 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 _0xca37=['formData','isString','setDataValue','getDataValue','BOOLEAN','sequelize','util','exports','name','STRING','TEXT','isObjectLike'];(function(_0x1a687f,_0x14bf1d){var _0x2d6acb=function(_0x1a6a8c){while(--_0x1a6a8c){_0x1a687f['push'](_0x1a687f['shift']());}};_0x2d6acb(++_0x14bf1d);}(_0xca37,0x1c1));var _0x7ca3=function(_0x3637ce,_0x39aa5a){_0x3637ce=_0x3637ce-0x0;var _0x357c17=_0xca37[_0x3637ce];return _0x357c17;};'use strict';var Sequelize=require(_0x7ca3('0x0'));var _=require('lodash');var util=require(_0x7ca3('0x1'));module[_0x7ca3('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x7ca3('0x3')},'description':{'type':Sequelize[_0x7ca3('0x4')]},'formData':{'type':Sequelize[_0x7ca3('0x5')]('long'),'set':function(_0x5a9c38){if(_[_0x7ca3('0x6')](_0x5a9c38)){this['setDataValue'](_0x7ca3('0x7'),JSON['stringify'](_0x5a9c38));}else if(_[_0x7ca3('0x8')](_0x5a9c38)){this[_0x7ca3('0x9')](_0x7ca3('0x7'),_0x5a9c38);}else{this['setDataValue']('formData',util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x7ca3('0xa')](_0x7ca3('0x3'))||'',this[_0x7ca3('0xa')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x7ca3('0xb')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x7ca3('0xb')],'defaultValue':![]}}; \ No newline at end of file +var _0xf8b8=['long','isObjectLike','formData','isString','setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','exports','STRING','TEXT'];(function(_0x36c25a,_0x51bab3){var _0x3c1790=function(_0x2b16e4){while(--_0x2b16e4){_0x36c25a['push'](_0x36c25a['shift']());}};_0x3c1790(++_0x51bab3);}(_0xf8b8,0x118));var _0x8f8b=function(_0x8aa416,_0x590577){_0x8aa416=_0x8aa416-0x0;var _0x4102c4=_0xf8b8[_0x8aa416];return _0x4102c4;};'use strict';var Sequelize=require(_0x8f8b('0x0'));var _=require(_0x8f8b('0x1'));var util=require('util');module[_0x8f8b('0x2')]={'name':{'type':Sequelize[_0x8f8b('0x3')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x8f8b('0x4')](_0x8f8b('0x5')),'set':function(_0x4e9fda){if(_[_0x8f8b('0x6')](_0x4e9fda)){this['setDataValue'](_0x8f8b('0x7'),JSON['stringify'](_0x4e9fda));}else if(_[_0x8f8b('0x8')](_0x4e9fda)){this[_0x8f8b('0x9')](_0x8f8b('0x7'),_0x4e9fda);}else{this[_0x8f8b('0x9')](_0x8f8b('0x7'),util['format'](_0x8f8b('0xa'),this[_0x8f8b('0xb')](_0x8f8b('0xc'))||'',this[_0x8f8b('0xb')](_0x8f8b('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x8f8b('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x8f8b('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 057e6bc..4e6e69a 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 _0x37e4=['getAnswers','JscriptyAnswerReport','hasOwnProperty','filter','number','fromCharCode','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','JscriptyProject','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','ProjectId','options'];(function(_0x4da300,_0x3c2f85){var _0x4b4f98=function(_0x3fd3bd){while(--_0x3fd3bd){_0x4da300['push'](_0x4da300['shift']());}};_0x4b4f98(++_0x3c2f85);}(_0x37e4,0x18e));var _0x437e=function(_0x1b9685,_0x41c1b4){_0x1b9685=_0x1b9685-0x0;var _0x226f0f=_0x37e4[_0x1b9685];return _0x226f0f;};'use strict';var emlformat=require(_0x437e('0x0'));var rimraf=require(_0x437e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x437e('0x2'));var rp=require(_0x437e('0x3'));var moment=require(_0x437e('0x4'));var BPromise=require(_0x437e('0x5'));var Mustache=require(_0x437e('0x6'));var util=require(_0x437e('0x7'));var path=require(_0x437e('0x8'));var sox=require(_0x437e('0x9'));var csv=require(_0x437e('0xa'));var ejs=require(_0x437e('0xb'));var fs=require('fs');var fs_extra=require(_0x437e('0xc'));var _=require(_0x437e('0xd'));var squel=require(_0x437e('0xe'));var crypto=require(_0x437e('0xf'));var jsforce=require(_0x437e('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x437e('0xa'));var querystring=require('querystring');var Papa=require(_0x437e('0x11'));var Redis=require(_0x437e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x437e('0x13'));var as=require(_0x437e('0x14'));var hardwareService=require(_0x437e('0x15'));var logger=require(_0x437e('0x16'))(_0x437e('0x17'));var utils=require(_0x437e('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3182b9,_0x268d1a){_0x268d1a=_0x268d1a||0xcc;return function(_0x1bee2b){if(_0x1bee2b){return _0x3182b9[_0x437e('0x19')](_0x268d1a);}return _0x3182b9[_0x437e('0x1a')](_0x268d1a)[_0x437e('0x1b')]();};}function respondWithResult(_0x158cdb,_0x204e1a){_0x204e1a=_0x204e1a||0xc8;return function(_0x1629be){if(_0x1629be){return _0x158cdb[_0x437e('0x1a')](_0x204e1a)[_0x437e('0x1c')](_0x1629be);}};}function respondWithFilteredResult(_0x1bab5a,_0x128156){return function(_0x5b3f56){if(_0x5b3f56){var _0x355c78=typeof _0x128156[_0x437e('0x1d')]===_0x437e('0x1e')&&typeof _0x128156[_0x437e('0x1f')]===_0x437e('0x1e');var _0x4ba700=_0x5b3f56['count'];var _0x58ef0f=_0x355c78?0x0:_0x128156['offset'];var _0x4ea09b=_0x355c78?_0x5b3f56['count']:_0x128156[_0x437e('0x1d')]+_0x128156['limit'];var _0x567a1a;if(_0x4ea09b>=_0x4ba700){_0x4ea09b=_0x4ba700;_0x567a1a=0xc8;}else{_0x567a1a=0xce;}_0x1bab5a[_0x437e('0x1a')](_0x567a1a);return _0x1bab5a['set'](_0x437e('0x20'),_0x58ef0f+'-'+_0x4ea09b+'/'+_0x4ba700)[_0x437e('0x1c')](_0x5b3f56);}return null;};}function patchUpdates(_0x595925){return function(_0x12b7db){try{jsonpatch[_0x437e('0x21')](_0x12b7db,_0x595925,!![]);}catch(_0x185559){return BPromise['reject'](_0x185559);}return _0x12b7db[_0x437e('0x22')]();};}function saveUpdates(_0x5e2997,_0x5ac03e){return function(_0x438db7){if(_0x438db7){return _0x438db7[_0x437e('0x23')](_0x5e2997)[_0x437e('0x24')](function(_0x151e64){return _0x151e64;});}return null;};}function removeEntity(_0x25dfca,_0x48e9a8){return function(_0x362821){if(_0x362821){return _0x362821[_0x437e('0x25')]()['then'](function(){var _0x36dfeb=_0x362821['get']({'plain':!![]});var _0x31b8e8='Projects';return db[_0x437e('0x26')][_0x437e('0x25')]({'where':{'type':_0x31b8e8,'resourceId':_0x36dfeb['id']}})[_0x437e('0x24')](function(){return _0x362821;});})['then'](function(){_0x25dfca['status'](0xcc)[_0x437e('0x1b')]();});}};}function handleEntityNotFound(_0x3b7baf,_0x5c546f){return function(_0x5a224c){if(!_0x5a224c){_0x3b7baf[_0x437e('0x19')](0x194);}return _0x5a224c;};}function handleError(_0x15cb81,_0x541087){_0x541087=_0x541087||0x1f4;return function(_0x27a269){logger[_0x437e('0x27')](_0x27a269[_0x437e('0x28')]);if(_0x27a269[_0x437e('0x29')]){delete _0x27a269[_0x437e('0x29')];}_0x15cb81[_0x437e('0x1a')](_0x541087)[_0x437e('0x2a')](_0x27a269);};}exports[_0x437e('0x2b')]=function(_0x2c54c8,_0x2950de){var _0x148320={},_0x397a33={},_0x1fab11={'count':0x0,'rows':[]};var _0x420437=_['map'](db[_0x437e('0x2c')][_0x437e('0x2d')],function(_0x16bdf1){return{'name':_0x16bdf1[_0x437e('0x2e')],'type':_0x16bdf1[_0x437e('0x2f')][_0x437e('0x30')]};});_0x397a33[_0x437e('0x31')]=_[_0x437e('0x32')](_0x420437,_0x437e('0x29'));_0x397a33[_0x437e('0x33')]=_[_0x437e('0x34')](_0x2c54c8[_0x437e('0x33')]);_0x397a33[_0x437e('0x35')]=_[_0x437e('0x36')](_0x397a33['model'],_0x397a33['query']);_0x148320['attributes']=_[_0x437e('0x36')](_0x397a33[_0x437e('0x31')],qs[_0x437e('0x37')](_0x2c54c8[_0x437e('0x33')][_0x437e('0x37')]));_0x148320['attributes']=_0x148320[_0x437e('0x38')][_0x437e('0x39')]?_0x148320['attributes']:_0x397a33['model'];if(!_0x2c54c8[_0x437e('0x33')]['hasOwnProperty'](_0x437e('0x3a'))){_0x148320[_0x437e('0x1f')]=qs[_0x437e('0x1f')](_0x2c54c8['query'][_0x437e('0x1f')]);_0x148320[_0x437e('0x1d')]=qs[_0x437e('0x1d')](_0x2c54c8['query'][_0x437e('0x1d')]);}_0x148320[_0x437e('0x3b')]=qs[_0x437e('0x3c')](_0x2c54c8[_0x437e('0x33')]['sort']);_0x148320[_0x437e('0x3d')]=qs[_0x437e('0x35')](_[_0x437e('0x3e')](_0x2c54c8[_0x437e('0x33')],_0x397a33[_0x437e('0x35')]),_0x420437);if(_0x2c54c8[_0x437e('0x33')]['filter']){_0x148320[_0x437e('0x3d')]=_['merge'](_0x148320[_0x437e('0x3d')],{'$or':_[_0x437e('0x32')](_0x420437,function(_0x52273f){if(_0x52273f[_0x437e('0x2f')]!==_0x437e('0x3f')){var _0x50be9f={};_0x50be9f[_0x52273f[_0x437e('0x29')]]={'$like':'%'+_0x2c54c8[_0x437e('0x33')]['filter']+'%'};return _0x50be9f;}})});}_0x148320=_[_0x437e('0x40')]({},_0x148320,_0x2c54c8['options']);var _0x4ee63b={'where':_0x148320[_0x437e('0x3d')]};return db['JscriptyProject'][_0x437e('0x41')](_0x4ee63b)['then'](function(_0x59a419){_0x1fab11['count']=_0x59a419;if(_0x2c54c8[_0x437e('0x33')][_0x437e('0x42')]){_0x148320[_0x437e('0x43')]=[{'all':!![]}];}return db[_0x437e('0x2c')][_0x437e('0x44')](_0x148320);})['then'](function(_0xe13d91){_0x1fab11[_0x437e('0x45')]=_0xe13d91;return _0x1fab11;})[_0x437e('0x24')](respondWithFilteredResult(_0x2950de,_0x148320))[_0x437e('0x46')](handleError(_0x2950de,null));};exports[_0x437e('0x47')]=function(_0x598dba,_0x1fc68b){var _0x298067={'raw':![],'where':{'id':_0x598dba[_0x437e('0x48')]['id']}},_0x16ffe6={};_0x16ffe6[_0x437e('0x31')]=_[_0x437e('0x34')](db[_0x437e('0x2c')][_0x437e('0x2d')]);_0x16ffe6['query']=_['keys'](_0x598dba['query']);_0x16ffe6['filters']=_[_0x437e('0x36')](_0x16ffe6['model'],_0x16ffe6[_0x437e('0x33')]);_0x298067[_0x437e('0x38')]=_['intersection'](_0x16ffe6[_0x437e('0x31')],qs['fields'](_0x598dba['query'][_0x437e('0x37')]));_0x298067[_0x437e('0x38')]=_0x298067[_0x437e('0x38')][_0x437e('0x39')]?_0x298067['attributes']:_0x16ffe6[_0x437e('0x31')];if(_0x598dba['query'][_0x437e('0x42')]){_0x298067[_0x437e('0x43')]=[{'all':!![]}];}_0x298067=_[_0x437e('0x40')]({},_0x298067,_0x598dba['options']);return db[_0x437e('0x2c')]['find'](_0x298067)[_0x437e('0x24')](handleEntityNotFound(_0x1fc68b,null))[_0x437e('0x24')](respondWithResult(_0x1fc68b,null))[_0x437e('0x46')](handleError(_0x1fc68b,null));};exports[_0x437e('0x49')]=function(_0x5b4811,_0x2cfd96){return db['JscriptyProject'][_0x437e('0x49')](_0x5b4811[_0x437e('0x4a')],{})['then'](function(_0x49a9cf){var _0x1cf57b=_0x5b4811[_0x437e('0x4b')][_0x437e('0x4c')]({'plain':!![]});if(!_0x1cf57b)throw new Error(_0x437e('0x4d'));if(_0x1cf57b[_0x437e('0x4e')]===_0x437e('0x4b')){var _0x396ec0=_0x49a9cf[_0x437e('0x4c')]({'plain':!![]});var _0xa243ae=_0x437e('0x4f');return db[_0x437e('0x50')][_0x437e('0x51')]({'where':{'name':_0xa243ae,'userProfileId':_0x1cf57b[_0x437e('0x52')]},'raw':!![]})['then'](function(_0x668d88){if(_0x668d88&&_0x668d88[_0x437e('0x53')]===0x0){return db[_0x437e('0x26')][_0x437e('0x49')]({'name':_0x396ec0[_0x437e('0x29')],'resourceId':_0x396ec0['id'],'type':_0x668d88['name'],'sectionId':_0x668d88['id']},{})[_0x437e('0x24')](function(){return _0x49a9cf;});}else{return _0x49a9cf;}})[_0x437e('0x46')](function(_0x2bdd62){logger[_0x437e('0x27')](_0x437e('0x54'),_0x2bdd62);throw _0x2bdd62;});}return _0x49a9cf;})[_0x437e('0x24')](respondWithResult(_0x2cfd96,0xc9))[_0x437e('0x46')](handleError(_0x2cfd96,null));};exports[_0x437e('0x55')]=function(_0x6f0527,_0x537f76){var _0xf9fa04={'where':{'id':_0x6f0527[_0x437e('0x48')]['id']}},_0x31c0b5={};_0x31c0b5[_0x437e('0x31')]=_[_0x437e('0x34')](db['JscriptyProject']['rawAttributes']);_0xf9fa04[_0x437e('0x38')]=_[_0x437e('0x36')](_0x31c0b5[_0x437e('0x31')],qs[_0x437e('0x37')](_0x6f0527[_0x437e('0x33')][_0x437e('0x37')]));_0xf9fa04[_0x437e('0x38')]=_0xf9fa04[_0x437e('0x38')][_0x437e('0x39')]?_0xf9fa04[_0x437e('0x38')]:_0x31c0b5[_0x437e('0x31')];if(_0x6f0527[_0x437e('0x33')][_0x437e('0x42')]){_0xf9fa04[_0x437e('0x43')]=[{'all':!![]}];}_0xf9fa04=_[_0x437e('0x40')]({},_0xf9fa04,_0x6f0527['options']);return db['JscriptyProject'][_0x437e('0x51')](_0xf9fa04)['then'](handleEntityNotFound(_0x537f76,null))['then'](function(_0x473c0b){if(_0x473c0b){var _0x2c493e=_0x473c0b[_0x437e('0x4c')]({'plain':!![]});_0x2c493e=qs[_0x437e('0x56')](_0x2c493e,['id',_0x437e('0x57'),_0x437e('0x58')]);_0x6f0527['body']=_['omit'](_0x6f0527[_0x437e('0x4a')],['id',_0x437e('0x57'),_0x437e('0x58')]);return db[_0x437e('0x2c')][_0x437e('0x49')](_[_0x437e('0x40')](_0x2c493e,_0x6f0527[_0x437e('0x4a')]),{'include':_0x6f0527[_0x437e('0x33')][_0x437e('0x42')]?[{'all':!![]}]:undefined})[_0x437e('0x24')](function(_0x3817f8){var _0x21f8c1=_0x6f0527[_0x437e('0x4b')][_0x437e('0x4c')]({'plain':!![]});if(!_0x21f8c1)throw new Error(_0x437e('0x4d'));if(_0x21f8c1['role']===_0x437e('0x4b')){var _0x50c527=_0x3817f8[_0x437e('0x4c')]({'plain':!![]});var _0x41162b=_0x437e('0x4f');return db['UserProfileSection'][_0x437e('0x51')]({'where':{'name':_0x41162b,'userProfileId':_0x21f8c1[_0x437e('0x52')]},'raw':!![]})[_0x437e('0x24')](function(_0x4e8f2f){if(_0x4e8f2f&&_0x4e8f2f['autoAssociation']===0x0){return db['UserProfileResource'][_0x437e('0x49')]({'name':_0x50c527['name'],'resourceId':_0x50c527['id'],'type':_0x4e8f2f[_0x437e('0x29')],'sectionId':_0x4e8f2f['id']},{})[_0x437e('0x24')](function(){return _0x3817f8;});}else{return _0x3817f8;}})[_0x437e('0x46')](function(_0x1570aa){logger[_0x437e('0x27')](_0x437e('0x54'),_0x1570aa);throw _0x1570aa;});}return _0x3817f8;});}})['then'](respondWithResult(_0x537f76,0xc9))[_0x437e('0x46')](handleError(_0x537f76,null));};exports[_0x437e('0x23')]=function(_0x3a3d17,_0x38513f){if(_0x3a3d17[_0x437e('0x4a')]['id']){delete _0x3a3d17[_0x437e('0x4a')]['id'];}return db[_0x437e('0x2c')][_0x437e('0x51')]({'where':{'id':_0x3a3d17[_0x437e('0x48')]['id']}})[_0x437e('0x24')](handleEntityNotFound(_0x38513f,null))[_0x437e('0x24')](saveUpdates(_0x3a3d17[_0x437e('0x4a')],null))['then'](respondWithResult(_0x38513f,null))[_0x437e('0x46')](handleError(_0x38513f,null));};exports[_0x437e('0x25')]=function(_0x1a3451,_0x205983){return db[_0x437e('0x2c')][_0x437e('0x51')]({'where':{'id':_0x1a3451[_0x437e('0x48')]['id']}})[_0x437e('0x24')](handleEntityNotFound(_0x205983,null))[_0x437e('0x24')](removeEntity(_0x205983,null))[_0x437e('0x46')](handleError(_0x205983,null));};exports[_0x437e('0x59')]=function(_0x54791d,_0x25520c,_0x4608ad){var _0x1d3f9b={'raw':!![],'where':{}};var _0x4136ac={};var _0x412add={'count':0x0,'rows':[]};return db[_0x437e('0x2c')][_0x437e('0x5a')]({'where':{'id':_0x54791d[_0x437e('0x48')]['id']}})['then'](handleEntityNotFound(_0x25520c,null))['then'](function(_0x17ad69){if(_0x17ad69){_0x4136ac[_0x437e('0x31')]=_[_0x437e('0x34')](db[_0x437e('0x5b')][_0x437e('0x2d')]);_0x4136ac[_0x437e('0x33')]=_[_0x437e('0x34')](_0x54791d[_0x437e('0x33')]);_0x4136ac[_0x437e('0x35')]=_['intersection'](_0x4136ac['model'],_0x4136ac[_0x437e('0x33')]);_0x1d3f9b[_0x437e('0x38')]=_[_0x437e('0x36')](_0x4136ac[_0x437e('0x31')],qs[_0x437e('0x37')](_0x54791d['query'][_0x437e('0x37')]));_0x1d3f9b[_0x437e('0x38')]=_0x1d3f9b[_0x437e('0x38')][_0x437e('0x39')]?_0x1d3f9b['attributes']:_0x4136ac[_0x437e('0x31')];if(!_0x54791d[_0x437e('0x33')]['hasOwnProperty']('nolimit')){_0x1d3f9b['limit']=qs[_0x437e('0x1f')](_0x54791d[_0x437e('0x33')][_0x437e('0x1f')]);_0x1d3f9b[_0x437e('0x1d')]=qs[_0x437e('0x1d')](_0x54791d[_0x437e('0x33')][_0x437e('0x1d')]);}_0x1d3f9b[_0x437e('0x3b')]=qs[_0x437e('0x3c')](_0x54791d[_0x437e('0x33')][_0x437e('0x3c')]);_0x1d3f9b[_0x437e('0x3d')]=qs[_0x437e('0x35')](_[_0x437e('0x3e')](_0x54791d[_0x437e('0x33')],_0x4136ac['filters']));_0x1d3f9b[_0x437e('0x3d')][_0x437e('0x5c')]=_0x17ad69['id'];if(_0x54791d[_0x437e('0x33')]['filter']){_0x1d3f9b[_0x437e('0x3d')]=_['merge'](_0x1d3f9b[_0x437e('0x3d')],{'$or':_[_0x437e('0x32')](_0x1d3f9b[_0x437e('0x38')],function(_0x5d1f14){var _0x208684={};_0x208684[_0x5d1f14]={'$like':'%'+_0x54791d['query']['filter']+'%'};return _0x208684;})});}_0x1d3f9b=_[_0x437e('0x40')]({},_0x1d3f9b,_0x54791d[_0x437e('0x5d')]);return db[_0x437e('0x5b')][_0x437e('0x41')]({'where':_0x1d3f9b[_0x437e('0x3d')]})[_0x437e('0x24')](function(_0x51adea){_0x412add[_0x437e('0x41')]=_0x51adea;if(_0x54791d[_0x437e('0x33')][_0x437e('0x42')]){_0x1d3f9b[_0x437e('0x43')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x1d3f9b);})[_0x437e('0x24')](function(_0x3ef5a4){_0x412add[_0x437e('0x45')]=_0x3ef5a4;return _0x412add;});}})[_0x437e('0x24')](respondWithFilteredResult(_0x25520c,_0x1d3f9b))[_0x437e('0x46')](handleError(_0x25520c,null));};exports[_0x437e('0x5e')]=function(_0x1afe8a,_0x45b950,_0x390143){var _0x2e6c8a={'raw':!![],'where':{}};var _0xd3b8b6={};var _0x170ac8={'count':0x0,'rows':[]};return db[_0x437e('0x2c')][_0x437e('0x5a')]({'where':{'id':_0x1afe8a[_0x437e('0x48')]['id']}})['then'](handleEntityNotFound(_0x45b950,null))[_0x437e('0x24')](function(_0x1416b9){if(_0x1416b9){_0xd3b8b6[_0x437e('0x31')]=_[_0x437e('0x34')](db[_0x437e('0x5f')][_0x437e('0x2d')]);_0xd3b8b6[_0x437e('0x33')]=_[_0x437e('0x34')](_0x1afe8a[_0x437e('0x33')]);_0xd3b8b6[_0x437e('0x35')]=_['intersection'](_0xd3b8b6[_0x437e('0x31')],_0xd3b8b6[_0x437e('0x33')]);_0x2e6c8a['attributes']=_[_0x437e('0x36')](_0xd3b8b6['model'],qs[_0x437e('0x37')](_0x1afe8a[_0x437e('0x33')]['fields']));_0x2e6c8a[_0x437e('0x38')]=_0x2e6c8a['attributes'][_0x437e('0x39')]?_0x2e6c8a[_0x437e('0x38')]:_0xd3b8b6[_0x437e('0x31')];if(!_0x1afe8a['query'][_0x437e('0x60')](_0x437e('0x3a'))){_0x2e6c8a[_0x437e('0x1f')]=qs[_0x437e('0x1f')](_0x1afe8a[_0x437e('0x33')]['limit']);_0x2e6c8a[_0x437e('0x1d')]=qs[_0x437e('0x1d')](_0x1afe8a['query']['offset']);}_0x2e6c8a[_0x437e('0x3b')]=qs[_0x437e('0x3c')](_0x1afe8a[_0x437e('0x33')][_0x437e('0x3c')]);_0x2e6c8a[_0x437e('0x3d')]=qs['filters'](_[_0x437e('0x3e')](_0x1afe8a['query'],_0xd3b8b6[_0x437e('0x35')]));_0x2e6c8a[_0x437e('0x3d')]['ProjectId']=_0x1416b9['id'];if(_0x1afe8a[_0x437e('0x33')][_0x437e('0x61')]){_0x2e6c8a['where']=_[_0x437e('0x40')](_0x2e6c8a[_0x437e('0x3d')],{'$or':_['map'](_0x2e6c8a['attributes'],function(_0x44f1b7){var _0x1052d0={};_0x1052d0[_0x44f1b7]={'$like':'%'+_0x1afe8a['query'][_0x437e('0x61')]+'%'};return _0x1052d0;})});}_0x2e6c8a=_['merge']({},_0x2e6c8a,_0x1afe8a[_0x437e('0x5d')]);return db['JscriptyAnswerReport'][_0x437e('0x41')]({'where':_0x2e6c8a[_0x437e('0x3d')]})['then'](function(_0xa94f57){_0x170ac8[_0x437e('0x41')]=_0xa94f57;if(_0x1afe8a['query'][_0x437e('0x42')]){_0x2e6c8a[_0x437e('0x43')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x437e('0x44')](_0x2e6c8a);})[_0x437e('0x24')](function(_0x96654){_0x170ac8[_0x437e('0x45')]=_0x96654;return _0x170ac8;});}})[_0x437e('0x24')](respondWithFilteredResult(_0x45b950,_0x2e6c8a))[_0x437e('0x46')](handleError(_0x45b950,null));};function char(_0x2e3306){return _0x437e('0x62')===typeof _0x2e3306?String[_0x437e('0x63')]['apply'](null,arguments):_0x2e3306;}function needsEncapsulation(_0x1f3495){return!!_0x1f3495&&(_0x1f3495['toString']()['indexOf'](char(0xd))>=0x0||_0x1f3495[_0x437e('0x64')]()[_0x437e('0x65')](char(0xa))>=0x0||_0x1f3495[_0x437e('0x64')]()['indexOf'](char(0x2c))>=0x0||_0x1f3495[_0x437e('0x64')]()[_0x437e('0x65')](char(0x22))>=0x0);}function encapsulate(_0x56faaf){var _0x4c3283=char(0x22),_0x4192bf='\x5c'+char(0x22),_0x19c924=_0x56faaf['toString']()[_0x437e('0x66')](new RegExp(_0x4c3283,'g'),_0x4192bf);return _0x4c3283+_0x19c924+_0x4c3283;}exports['getSummary']=function(_0x162ecc,_0x5071f7,_0x457c39){var _0x5cbf03,_0x2dd50c;var _0x894cc4={'where':{'ProjectId':_0x162ecc[_0x437e('0x48')]['id']}};if(_0x162ecc[_0x437e('0x33')][_0x437e('0x67')]){_0x894cc4['where'][_0x437e('0x68')]=JSON[_0x437e('0x69')](_0x162ecc[_0x437e('0x33')][_0x437e('0x67')]);}return db[_0x437e('0x5b')]['findAll'](_0x894cc4)[_0x437e('0x24')](handleEntityNotFound(_0x5071f7,null))[_0x437e('0x24')](function(_0x556db0){if(_0x556db0){_0x5cbf03=_0x556db0;return db[_0x437e('0x6a')][_0x437e('0x44')]({'where':{'SessionId':{'$in':_[_0x437e('0x32')](_0x5cbf03,'id')},'ProjectId':_0x162ecc[_0x437e('0x48')]['id']},'order':_0x437e('0x6b')});}})['then'](handleEntityNotFound(_0x5071f7,null))[_0x437e('0x24')](function(_0x3339e0){if(_0x3339e0){_0x2dd50c=_0x3339e0;var _0x3d9a49={};for(var _0x50783b=0x0,_0x56e8e4=_0x2dd50c['length'];_0x50783b<_0x56e8e4;_0x50783b++){if(!_0x3d9a49['hasOwnProperty'](_0x2dd50c[_0x50783b][_0x437e('0x6c')])){_0x3d9a49[_0x2dd50c[_0x50783b][_0x437e('0x6c')]]=needsEncapsulation(_0x2dd50c[_0x50783b][_0x437e('0x6d')])?encapsulate(_0x2dd50c[_0x50783b]['question']):_0x2dd50c[_0x50783b][_0x437e('0x6d')];}}var _0x48f1a6=[],_0x1c341d={};for(var _0x15e24d=0x0,_0x415ac4=_0x5cbf03[_0x437e('0x39')];_0x15e24d<_0x415ac4;_0x15e24d++){_0x1c341d={'ProjectId':_0x162ecc[_0x437e('0x48')]['id'],'SessionId':_0x5cbf03[_0x15e24d]['id'],'StartTime':moment(_0x5cbf03[_0x15e24d][_0x437e('0x68')])[_0x437e('0x6e')](_0x437e('0x6f'))};for(var _0x567d67=0x0,_0x4a955f=_0x2dd50c[_0x437e('0x39')];_0x567d67<_0x4a955f;_0x567d67++){if(_0x2dd50c[_0x567d67][_0x437e('0x70')]==_0x5cbf03[_0x15e24d]['id']&&_0x3d9a49[_0x437e('0x60')](_0x2dd50c[_0x567d67]['questionId'])){_0x1c341d[_0x3d9a49[_0x2dd50c[_0x567d67][_0x437e('0x6c')]]]=_0x2dd50c[_0x567d67]['answer'];}}for(var _0xfabd0f in _0x3d9a49){if(!_0x1c341d['hasOwnProperty'](_0x3d9a49[_0xfabd0f])){_0x1c341d[_0x3d9a49[_0xfabd0f]]=null;}}_0x48f1a6[_0x437e('0x71')](_0x1c341d);}return _0x48f1a6;}})['then'](function(_0x30e653){if(!_[_0x437e('0x72')](_0x30e653)){var _0x53748c=toCsv(_0x30e653);var _0x1b6c52=Date[_0x437e('0x73')]();fs['writeFileSync'](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x162ecc['params']['id'],_0x1b6c52),_0x53748c);_0x5071f7[_0x437e('0x74')](_0x437e('0x75'),_0x437e('0x76')+util[_0x437e('0x6e')](_0x437e('0x77'),_0x162ecc[_0x437e('0x48')]['id'],_0x1b6c52));_0x5071f7[_0x437e('0x74')](_0x437e('0x78'),_0x437e('0x79'));return _0x5071f7[_0x437e('0x7a')](util[_0x437e('0x6e')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x162ecc[_0x437e('0x48')]['id'],_0x1b6c52));}else{return _0x5071f7[_0x437e('0x19')](0xcc);}})[_0x437e('0x46')](handleError(_0x5071f7,null));}; \ No newline at end of file +var _0x6e9b=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','stack','name','send','index','map','JscriptyProject','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','JscriptySessionReport','order','ProjectId','JscriptyAnswerReport','number','toString','indexOf','getSummary','startTime','starttime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','now','writeFileSync','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv'];(function(_0x364b32,_0x4dec35){var _0x3f3ea0=function(_0x1911a8){while(--_0x1911a8){_0x364b32['push'](_0x364b32['shift']());}};_0x3f3ea0(++_0x4dec35);}(_0x6e9b,0xea));var _0xb6e9=function(_0x1245c1,_0x4d0f6e){_0x1245c1=_0x1245c1-0x0;var _0x140053=_0x6e9b[_0x1245c1];return _0x140053;};'use strict';var emlformat=require(_0xb6e9('0x0'));var rimraf=require(_0xb6e9('0x1'));var zipdir=require(_0xb6e9('0x2'));var jsonpatch=require(_0xb6e9('0x3'));var rp=require(_0xb6e9('0x4'));var moment=require('moment');var BPromise=require(_0xb6e9('0x5'));var Mustache=require(_0xb6e9('0x6'));var util=require(_0xb6e9('0x7'));var path=require('path');var sox=require(_0xb6e9('0x8'));var csv=require(_0xb6e9('0x9'));var ejs=require(_0xb6e9('0xa'));var fs=require('fs');var fs_extra=require(_0xb6e9('0xb'));var _=require(_0xb6e9('0xc'));var squel=require(_0xb6e9('0xd'));var crypto=require(_0xb6e9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb6e9('0xf'));var toCsv=require(_0xb6e9('0x9'));var querystring=require(_0xb6e9('0x10'));var Papa=require(_0xb6e9('0x11'));var Redis=require(_0xb6e9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb6e9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb6e9('0x14'));var utils=require(_0xb6e9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb6e9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2209df,_0xe6c44a){_0xe6c44a=_0xe6c44a||0xcc;return function(_0x3bd4e2){if(_0x3bd4e2){return _0x2209df[_0xb6e9('0x17')](_0xe6c44a);}return _0x2209df['status'](_0xe6c44a)[_0xb6e9('0x18')]();};}function respondWithResult(_0x4e0abc,_0x92e54c){_0x92e54c=_0x92e54c||0xc8;return function(_0xb14b72){if(_0xb14b72){return _0x4e0abc[_0xb6e9('0x19')](_0x92e54c)[_0xb6e9('0x1a')](_0xb14b72);}};}function respondWithFilteredResult(_0x3c5b8e,_0x348be6){return function(_0x1cf84d){if(_0x1cf84d){var _0x2777b8=typeof _0x348be6[_0xb6e9('0x1b')]===_0xb6e9('0x1c')&&typeof _0x348be6[_0xb6e9('0x1d')]===_0xb6e9('0x1c');var _0x2c1f07=_0x1cf84d['count'];var _0xca2aaa=_0x2777b8?0x0:_0x348be6[_0xb6e9('0x1b')];var _0xc4c632=_0x2777b8?_0x1cf84d[_0xb6e9('0x1e')]:_0x348be6[_0xb6e9('0x1b')]+_0x348be6['limit'];var _0xb59de7;if(_0xc4c632>=_0x2c1f07){_0xc4c632=_0x2c1f07;_0xb59de7=0xc8;}else{_0xb59de7=0xce;}_0x3c5b8e['status'](_0xb59de7);return _0x3c5b8e['set'](_0xb6e9('0x1f'),_0xca2aaa+'-'+_0xc4c632+'/'+_0x2c1f07)[_0xb6e9('0x1a')](_0x1cf84d);}return null;};}function patchUpdates(_0x4ba58e){return function(_0x4b35e7){try{jsonpatch[_0xb6e9('0x20')](_0x4b35e7,_0x4ba58e,!![]);}catch(_0x32736f){return BPromise[_0xb6e9('0x21')](_0x32736f);}return _0x4b35e7[_0xb6e9('0x22')]();};}function saveUpdates(_0x2888d7,_0x4f1252){return function(_0x449567){if(_0x449567){return _0x449567[_0xb6e9('0x23')](_0x2888d7)[_0xb6e9('0x24')](function(_0x2f28e0){return _0x2f28e0;});}return null;};}function removeEntity(_0x4e0c16,_0x494914){return function(_0x535531){if(_0x535531){return _0x535531[_0xb6e9('0x25')]()[_0xb6e9('0x24')](function(){var _0x31e343=_0x535531[_0xb6e9('0x26')]({'plain':!![]});var _0x63f7b9=_0xb6e9('0x27');return db[_0xb6e9('0x28')][_0xb6e9('0x25')]({'where':{'type':_0x63f7b9,'resourceId':_0x31e343['id']}})['then'](function(){return _0x535531;});})[_0xb6e9('0x24')](function(){_0x4e0c16['status'](0xcc)[_0xb6e9('0x18')]();});}};}function handleEntityNotFound(_0x1f9f47,_0x2b8f62){return function(_0x5d53c6){if(!_0x5d53c6){_0x1f9f47['sendStatus'](0x194);}return _0x5d53c6;};}function handleError(_0xc0b26b,_0x1823df){_0x1823df=_0x1823df||0x1f4;return function(_0x343af5){logger['error'](_0x343af5[_0xb6e9('0x29')]);if(_0x343af5[_0xb6e9('0x2a')]){delete _0x343af5['name'];}_0xc0b26b[_0xb6e9('0x19')](_0x1823df)[_0xb6e9('0x2b')](_0x343af5);};}exports[_0xb6e9('0x2c')]=function(_0x2442fb,_0x5dd6a2){var _0x48ae38={},_0x310ccb={},_0x289cec={'count':0x0,'rows':[]};var _0x2795ea=_[_0xb6e9('0x2d')](db[_0xb6e9('0x2e')][_0xb6e9('0x2f')],function(_0xb00e9d){return{'name':_0xb00e9d['fieldName'],'type':_0xb00e9d[_0xb6e9('0x30')][_0xb6e9('0x31')]};});_0x310ccb['model']=_[_0xb6e9('0x2d')](_0x2795ea,_0xb6e9('0x2a'));_0x310ccb[_0xb6e9('0x32')]=_[_0xb6e9('0x33')](_0x2442fb['query']);_0x310ccb[_0xb6e9('0x34')]=_[_0xb6e9('0x35')](_0x310ccb[_0xb6e9('0x36')],_0x310ccb[_0xb6e9('0x32')]);_0x48ae38[_0xb6e9('0x37')]=_[_0xb6e9('0x35')](_0x310ccb[_0xb6e9('0x36')],qs[_0xb6e9('0x38')](_0x2442fb[_0xb6e9('0x32')][_0xb6e9('0x38')]));_0x48ae38[_0xb6e9('0x37')]=_0x48ae38[_0xb6e9('0x37')][_0xb6e9('0x39')]?_0x48ae38[_0xb6e9('0x37')]:_0x310ccb['model'];if(!_0x2442fb[_0xb6e9('0x32')][_0xb6e9('0x3a')](_0xb6e9('0x3b'))){_0x48ae38[_0xb6e9('0x1d')]=qs[_0xb6e9('0x1d')](_0x2442fb[_0xb6e9('0x32')][_0xb6e9('0x1d')]);_0x48ae38[_0xb6e9('0x1b')]=qs['offset'](_0x2442fb['query']['offset']);}_0x48ae38['order']=qs[_0xb6e9('0x3c')](_0x2442fb[_0xb6e9('0x32')]['sort']);_0x48ae38[_0xb6e9('0x3d')]=qs['filters'](_[_0xb6e9('0x3e')](_0x2442fb['query'],_0x310ccb['filters']),_0x2795ea);if(_0x2442fb[_0xb6e9('0x32')][_0xb6e9('0x3f')]){_0x48ae38[_0xb6e9('0x3d')]=_[_0xb6e9('0x40')](_0x48ae38[_0xb6e9('0x3d')],{'$or':_[_0xb6e9('0x2d')](_0x2795ea,function(_0x3f078a){if(_0x3f078a[_0xb6e9('0x30')]!==_0xb6e9('0x41')){var _0x7aaf19={};_0x7aaf19[_0x3f078a['name']]={'$like':'%'+_0x2442fb['query'][_0xb6e9('0x3f')]+'%'};return _0x7aaf19;}})});}_0x48ae38=_[_0xb6e9('0x40')]({},_0x48ae38,_0x2442fb[_0xb6e9('0x42')]);var _0x36fbc={'where':_0x48ae38[_0xb6e9('0x3d')]};return db[_0xb6e9('0x2e')][_0xb6e9('0x1e')](_0x36fbc)[_0xb6e9('0x24')](function(_0x453edf){_0x289cec[_0xb6e9('0x1e')]=_0x453edf;if(_0x2442fb[_0xb6e9('0x32')]['includeAll']){_0x48ae38[_0xb6e9('0x43')]=[{'all':!![]}];}return db[_0xb6e9('0x2e')][_0xb6e9('0x44')](_0x48ae38);})[_0xb6e9('0x24')](function(_0x5e0bb4){_0x289cec['rows']=_0x5e0bb4;return _0x289cec;})[_0xb6e9('0x24')](respondWithFilteredResult(_0x5dd6a2,_0x48ae38))[_0xb6e9('0x45')](handleError(_0x5dd6a2,null));};exports[_0xb6e9('0x46')]=function(_0xfc9c21,_0x4cecb7){var _0x3366fe={'raw':![],'where':{'id':_0xfc9c21[_0xb6e9('0x47')]['id']}},_0x337814={};_0x337814['model']=_[_0xb6e9('0x33')](db[_0xb6e9('0x2e')][_0xb6e9('0x2f')]);_0x337814['query']=_['keys'](_0xfc9c21['query']);_0x337814[_0xb6e9('0x34')]=_['intersection'](_0x337814[_0xb6e9('0x36')],_0x337814[_0xb6e9('0x32')]);_0x3366fe[_0xb6e9('0x37')]=_['intersection'](_0x337814[_0xb6e9('0x36')],qs['fields'](_0xfc9c21['query'][_0xb6e9('0x38')]));_0x3366fe[_0xb6e9('0x37')]=_0x3366fe['attributes'][_0xb6e9('0x39')]?_0x3366fe[_0xb6e9('0x37')]:_0x337814[_0xb6e9('0x36')];if(_0xfc9c21[_0xb6e9('0x32')][_0xb6e9('0x48')]){_0x3366fe[_0xb6e9('0x43')]=[{'all':!![]}];}_0x3366fe=_[_0xb6e9('0x40')]({},_0x3366fe,_0xfc9c21[_0xb6e9('0x42')]);return db[_0xb6e9('0x2e')][_0xb6e9('0x49')](_0x3366fe)['then'](handleEntityNotFound(_0x4cecb7,null))[_0xb6e9('0x24')](respondWithResult(_0x4cecb7,null))[_0xb6e9('0x45')](handleError(_0x4cecb7,null));};exports[_0xb6e9('0x4a')]=function(_0x45b4cf,_0x397e19){return db['JscriptyProject']['create'](_0x45b4cf['body'],{})[_0xb6e9('0x24')](function(_0x463b14){var _0x42c763=_0x45b4cf[_0xb6e9('0x4b')][_0xb6e9('0x26')]({'plain':!![]});if(!_0x42c763)throw new Error(_0xb6e9('0x4c'));if(_0x42c763[_0xb6e9('0x4d')]===_0xb6e9('0x4b')){var _0x48a22b=_0x463b14[_0xb6e9('0x26')]({'plain':!![]});var _0x5f00cd=_0xb6e9('0x27');return db[_0xb6e9('0x4e')]['find']({'where':{'name':_0x5f00cd,'userProfileId':_0x42c763[_0xb6e9('0x4f')]},'raw':!![]})['then'](function(_0x7005d1){if(_0x7005d1&&_0x7005d1[_0xb6e9('0x50')]===0x0){return db[_0xb6e9('0x28')][_0xb6e9('0x4a')]({'name':_0x48a22b[_0xb6e9('0x2a')],'resourceId':_0x48a22b['id'],'type':_0x7005d1[_0xb6e9('0x2a')],'sectionId':_0x7005d1['id']},{})[_0xb6e9('0x24')](function(){return _0x463b14;});}else{return _0x463b14;}})[_0xb6e9('0x45')](function(_0x28dda0){logger[_0xb6e9('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28dda0);throw _0x28dda0;});}return _0x463b14;})[_0xb6e9('0x24')](respondWithResult(_0x397e19,0xc9))[_0xb6e9('0x45')](handleError(_0x397e19,null));};exports[_0xb6e9('0x52')]=function(_0x1e18d5,_0x11878f){var _0x226572={'where':{'id':_0x1e18d5['params']['id']}},_0x45a2fc={};_0x45a2fc[_0xb6e9('0x36')]=_['keys'](db[_0xb6e9('0x2e')][_0xb6e9('0x2f')]);_0x226572[_0xb6e9('0x37')]=_['intersection'](_0x45a2fc[_0xb6e9('0x36')],qs['fields'](_0x1e18d5[_0xb6e9('0x32')][_0xb6e9('0x38')]));_0x226572[_0xb6e9('0x37')]=_0x226572['attributes'][_0xb6e9('0x39')]?_0x226572[_0xb6e9('0x37')]:_0x45a2fc['model'];if(_0x1e18d5[_0xb6e9('0x32')][_0xb6e9('0x48')]){_0x226572[_0xb6e9('0x43')]=[{'all':!![]}];}_0x226572=_[_0xb6e9('0x40')]({},_0x226572,_0x1e18d5['options']);return db[_0xb6e9('0x2e')]['find'](_0x226572)[_0xb6e9('0x24')](handleEntityNotFound(_0x11878f,null))['then'](function(_0x5da1cb){if(_0x5da1cb){var _0x6bde=_0x5da1cb[_0xb6e9('0x26')]({'plain':!![]});_0x6bde=qs[_0xb6e9('0x53')](_0x6bde,['id',_0xb6e9('0x54'),_0xb6e9('0x55')]);_0x1e18d5[_0xb6e9('0x56')]=_[_0xb6e9('0x53')](_0x1e18d5['body'],['id',_0xb6e9('0x54'),_0xb6e9('0x55')]);return db['JscriptyProject']['create'](_[_0xb6e9('0x40')](_0x6bde,_0x1e18d5[_0xb6e9('0x56')]),{'include':_0x1e18d5[_0xb6e9('0x32')][_0xb6e9('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0xa1be3){var _0x44d276=_0x1e18d5[_0xb6e9('0x4b')][_0xb6e9('0x26')]({'plain':!![]});if(!_0x44d276)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44d276['role']==='user'){var _0x1806cb=_0xa1be3['get']({'plain':!![]});var _0x1490c5='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x1490c5,'userProfileId':_0x44d276['userProfileId']},'raw':!![]})[_0xb6e9('0x24')](function(_0x29b09a){if(_0x29b09a&&_0x29b09a[_0xb6e9('0x50')]===0x0){return db[_0xb6e9('0x28')][_0xb6e9('0x4a')]({'name':_0x1806cb['name'],'resourceId':_0x1806cb['id'],'type':_0x29b09a[_0xb6e9('0x2a')],'sectionId':_0x29b09a['id']},{})[_0xb6e9('0x24')](function(){return _0xa1be3;});}else{return _0xa1be3;}})['catch'](function(_0x49d7d3){logger['error'](_0xb6e9('0x57'),_0x49d7d3);throw _0x49d7d3;});}return _0xa1be3;});}})[_0xb6e9('0x24')](respondWithResult(_0x11878f,0xc9))[_0xb6e9('0x45')](handleError(_0x11878f,null));};exports[_0xb6e9('0x23')]=function(_0x595d69,_0x1ef71e){if(_0x595d69[_0xb6e9('0x56')]['id']){delete _0x595d69[_0xb6e9('0x56')]['id'];}return db[_0xb6e9('0x2e')]['find']({'where':{'id':_0x595d69[_0xb6e9('0x47')]['id']}})[_0xb6e9('0x24')](handleEntityNotFound(_0x1ef71e,null))[_0xb6e9('0x24')](saveUpdates(_0x595d69[_0xb6e9('0x56')],null))[_0xb6e9('0x24')](respondWithResult(_0x1ef71e,null))[_0xb6e9('0x45')](handleError(_0x1ef71e,null));};exports['destroy']=function(_0x446ff1,_0x55da86){return db[_0xb6e9('0x2e')][_0xb6e9('0x49')]({'where':{'id':_0x446ff1[_0xb6e9('0x47')]['id']}})[_0xb6e9('0x24')](handleEntityNotFound(_0x55da86,null))['then'](removeEntity(_0x55da86,null))[_0xb6e9('0x45')](handleError(_0x55da86,null));};exports[_0xb6e9('0x58')]=function(_0x10545b,_0x8a90bb,_0x5e1b84){var _0x21b99d={'raw':!![],'where':{}};var _0x1c8888={};var _0x23cf1={'count':0x0,'rows':[]};return db[_0xb6e9('0x2e')]['findOne']({'where':{'id':_0x10545b['params']['id']}})[_0xb6e9('0x24')](handleEntityNotFound(_0x8a90bb,null))[_0xb6e9('0x24')](function(_0x147096){if(_0x147096){_0x1c8888[_0xb6e9('0x36')]=_['keys'](db[_0xb6e9('0x59')][_0xb6e9('0x2f')]);_0x1c8888[_0xb6e9('0x32')]=_[_0xb6e9('0x33')](_0x10545b['query']);_0x1c8888['filters']=_[_0xb6e9('0x35')](_0x1c8888[_0xb6e9('0x36')],_0x1c8888[_0xb6e9('0x32')]);_0x21b99d[_0xb6e9('0x37')]=_[_0xb6e9('0x35')](_0x1c8888[_0xb6e9('0x36')],qs['fields'](_0x10545b[_0xb6e9('0x32')][_0xb6e9('0x38')]));_0x21b99d[_0xb6e9('0x37')]=_0x21b99d[_0xb6e9('0x37')][_0xb6e9('0x39')]?_0x21b99d[_0xb6e9('0x37')]:_0x1c8888[_0xb6e9('0x36')];if(!_0x10545b[_0xb6e9('0x32')]['hasOwnProperty'](_0xb6e9('0x3b'))){_0x21b99d['limit']=qs[_0xb6e9('0x1d')](_0x10545b[_0xb6e9('0x32')][_0xb6e9('0x1d')]);_0x21b99d[_0xb6e9('0x1b')]=qs['offset'](_0x10545b[_0xb6e9('0x32')][_0xb6e9('0x1b')]);}_0x21b99d[_0xb6e9('0x5a')]=qs[_0xb6e9('0x3c')](_0x10545b[_0xb6e9('0x32')][_0xb6e9('0x3c')]);_0x21b99d[_0xb6e9('0x3d')]=qs[_0xb6e9('0x34')](_['pick'](_0x10545b[_0xb6e9('0x32')],_0x1c8888[_0xb6e9('0x34')]));_0x21b99d['where'][_0xb6e9('0x5b')]=_0x147096['id'];if(_0x10545b[_0xb6e9('0x32')]['filter']){_0x21b99d[_0xb6e9('0x3d')]=_[_0xb6e9('0x40')](_0x21b99d[_0xb6e9('0x3d')],{'$or':_[_0xb6e9('0x2d')](_0x21b99d[_0xb6e9('0x37')],function(_0xb0dda9){var _0x53906e={};_0x53906e[_0xb0dda9]={'$like':'%'+_0x10545b[_0xb6e9('0x32')][_0xb6e9('0x3f')]+'%'};return _0x53906e;})});}_0x21b99d=_[_0xb6e9('0x40')]({},_0x21b99d,_0x10545b[_0xb6e9('0x42')]);return db[_0xb6e9('0x59')]['count']({'where':_0x21b99d['where']})[_0xb6e9('0x24')](function(_0x212fab){_0x23cf1['count']=_0x212fab;if(_0x10545b[_0xb6e9('0x32')][_0xb6e9('0x48')]){_0x21b99d['include']=[{'all':!![]}];}return db[_0xb6e9('0x59')]['findAll'](_0x21b99d);})[_0xb6e9('0x24')](function(_0x26dac7){_0x23cf1['rows']=_0x26dac7;return _0x23cf1;});}})[_0xb6e9('0x24')](respondWithFilteredResult(_0x8a90bb,_0x21b99d))[_0xb6e9('0x45')](handleError(_0x8a90bb,null));};exports['getAnswers']=function(_0x59218d,_0x5b6c85,_0xc2ef33){var _0x5e0fa2={'raw':!![],'where':{}};var _0xb2b1a3={};var _0x41f573={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x59218d[_0xb6e9('0x47')]['id']}})[_0xb6e9('0x24')](handleEntityNotFound(_0x5b6c85,null))[_0xb6e9('0x24')](function(_0x82d0f){if(_0x82d0f){_0xb2b1a3['model']=_['keys'](db[_0xb6e9('0x5c')]['rawAttributes']);_0xb2b1a3['query']=_[_0xb6e9('0x33')](_0x59218d['query']);_0xb2b1a3[_0xb6e9('0x34')]=_[_0xb6e9('0x35')](_0xb2b1a3['model'],_0xb2b1a3[_0xb6e9('0x32')]);_0x5e0fa2['attributes']=_[_0xb6e9('0x35')](_0xb2b1a3[_0xb6e9('0x36')],qs['fields'](_0x59218d[_0xb6e9('0x32')][_0xb6e9('0x38')]));_0x5e0fa2[_0xb6e9('0x37')]=_0x5e0fa2['attributes'][_0xb6e9('0x39')]?_0x5e0fa2['attributes']:_0xb2b1a3[_0xb6e9('0x36')];if(!_0x59218d['query'][_0xb6e9('0x3a')]('nolimit')){_0x5e0fa2[_0xb6e9('0x1d')]=qs[_0xb6e9('0x1d')](_0x59218d['query'][_0xb6e9('0x1d')]);_0x5e0fa2[_0xb6e9('0x1b')]=qs[_0xb6e9('0x1b')](_0x59218d[_0xb6e9('0x32')][_0xb6e9('0x1b')]);}_0x5e0fa2[_0xb6e9('0x5a')]=qs[_0xb6e9('0x3c')](_0x59218d[_0xb6e9('0x32')]['sort']);_0x5e0fa2[_0xb6e9('0x3d')]=qs[_0xb6e9('0x34')](_[_0xb6e9('0x3e')](_0x59218d['query'],_0xb2b1a3[_0xb6e9('0x34')]));_0x5e0fa2[_0xb6e9('0x3d')]['ProjectId']=_0x82d0f['id'];if(_0x59218d[_0xb6e9('0x32')][_0xb6e9('0x3f')]){_0x5e0fa2[_0xb6e9('0x3d')]=_['merge'](_0x5e0fa2['where'],{'$or':_[_0xb6e9('0x2d')](_0x5e0fa2[_0xb6e9('0x37')],function(_0xfb463a){var _0xba20dc={};_0xba20dc[_0xfb463a]={'$like':'%'+_0x59218d[_0xb6e9('0x32')][_0xb6e9('0x3f')]+'%'};return _0xba20dc;})});}_0x5e0fa2=_[_0xb6e9('0x40')]({},_0x5e0fa2,_0x59218d[_0xb6e9('0x42')]);return db[_0xb6e9('0x5c')]['count']({'where':_0x5e0fa2[_0xb6e9('0x3d')]})['then'](function(_0x47bfbb){_0x41f573[_0xb6e9('0x1e')]=_0x47bfbb;if(_0x59218d['query'][_0xb6e9('0x48')]){_0x5e0fa2[_0xb6e9('0x43')]=[{'all':!![]}];}return db[_0xb6e9('0x5c')][_0xb6e9('0x44')](_0x5e0fa2);})[_0xb6e9('0x24')](function(_0x1760bc){_0x41f573['rows']=_0x1760bc;return _0x41f573;});}})[_0xb6e9('0x24')](respondWithFilteredResult(_0x5b6c85,_0x5e0fa2))[_0xb6e9('0x45')](handleError(_0x5b6c85,null));};function char(_0x4d355e){return _0xb6e9('0x5d')===typeof _0x4d355e?String['fromCharCode']['apply'](null,arguments):_0x4d355e;}function needsEncapsulation(_0x39aad9){return!!_0x39aad9&&(_0x39aad9[_0xb6e9('0x5e')]()['indexOf'](char(0xd))>=0x0||_0x39aad9[_0xb6e9('0x5e')]()[_0xb6e9('0x5f')](char(0xa))>=0x0||_0x39aad9['toString']()['indexOf'](char(0x2c))>=0x0||_0x39aad9['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x2c198b){var _0x1fd538=char(0x22),_0x2ed751='\x5c'+char(0x22),_0x609641=_0x2c198b[_0xb6e9('0x5e')]()['replace'](new RegExp(_0x1fd538,'g'),_0x2ed751);return _0x1fd538+_0x609641+_0x1fd538;}exports[_0xb6e9('0x60')]=function(_0x3f621c,_0x236e7d,_0xe2215b){var _0x1543b2,_0x498db6;var _0x1f227a={'where':{'ProjectId':_0x3f621c['params']['id']}};if(_0x3f621c[_0xb6e9('0x32')][_0xb6e9('0x61')]){_0x1f227a[_0xb6e9('0x3d')][_0xb6e9('0x62')]=JSON[_0xb6e9('0x63')](_0x3f621c[_0xb6e9('0x32')]['startTime']);}return db[_0xb6e9('0x59')][_0xb6e9('0x44')](_0x1f227a)[_0xb6e9('0x24')](handleEntityNotFound(_0x236e7d,null))[_0xb6e9('0x24')](function(_0x53cc65){if(_0x53cc65){_0x1543b2=_0x53cc65;return db['JscriptyQuestionReport'][_0xb6e9('0x44')]({'where':{'SessionId':{'$in':_['map'](_0x1543b2,'id')},'ProjectId':_0x3f621c[_0xb6e9('0x47')]['id']},'order':_0xb6e9('0x64')});}})[_0xb6e9('0x24')](handleEntityNotFound(_0x236e7d,null))['then'](function(_0x5a449c){if(_0x5a449c){_0x498db6=_0x5a449c;var _0x408120={};for(var _0x2f441a=0x0,_0x2d813f=_0x498db6[_0xb6e9('0x39')];_0x2f441a<_0x2d813f;_0x2f441a++){if(!_0x408120[_0xb6e9('0x3a')](_0x498db6[_0x2f441a]['questionId'])){_0x408120[_0x498db6[_0x2f441a][_0xb6e9('0x65')]]=needsEncapsulation(_0x498db6[_0x2f441a][_0xb6e9('0x66')])?encapsulate(_0x498db6[_0x2f441a][_0xb6e9('0x66')]):_0x498db6[_0x2f441a][_0xb6e9('0x66')];}}var _0x5c2aad=[],_0xb4f6d8={};for(var _0xf305c4=0x0,_0x2bef68=_0x1543b2[_0xb6e9('0x39')];_0xf305c4<_0x2bef68;_0xf305c4++){_0xb4f6d8={'ProjectId':_0x3f621c[_0xb6e9('0x47')]['id'],'SessionId':_0x1543b2[_0xf305c4]['id'],'StartTime':moment(_0x1543b2[_0xf305c4][_0xb6e9('0x62')])[_0xb6e9('0x67')](_0xb6e9('0x68'))};for(var _0x212130=0x0,_0xeef82=_0x498db6[_0xb6e9('0x39')];_0x212130<_0xeef82;_0x212130++){if(_0x498db6[_0x212130]['SessionId']==_0x1543b2[_0xf305c4]['id']&&_0x408120[_0xb6e9('0x3a')](_0x498db6[_0x212130][_0xb6e9('0x65')])){_0xb4f6d8[_0x408120[_0x498db6[_0x212130]['questionId']]]=_0x498db6[_0x212130][_0xb6e9('0x69')];}}for(var _0x1ffa1e in _0x408120){if(!_0xb4f6d8[_0xb6e9('0x3a')](_0x408120[_0x1ffa1e])){_0xb4f6d8[_0x408120[_0x1ffa1e]]=null;}}_0x5c2aad[_0xb6e9('0x6a')](_0xb4f6d8);}return _0x5c2aad;}})['then'](function(_0x3f3b95){if(!_[_0xb6e9('0x6b')](_0x3f3b95)){var _0x155f82=toCsv(_0x3f3b95);var _0x2b4436=Date[_0xb6e9('0x6c')]();fs[_0xb6e9('0x6d')](util[_0xb6e9('0x67')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x3f621c['params']['id'],_0x2b4436),_0x155f82);_0x236e7d[_0xb6e9('0x6e')](_0xb6e9('0x6f'),'attachment;\x20filename='+util[_0xb6e9('0x67')](_0xb6e9('0x70'),_0x3f621c[_0xb6e9('0x47')]['id'],_0x2b4436));_0x236e7d[_0xb6e9('0x6e')](_0xb6e9('0x71'),_0xb6e9('0x72'));return _0x236e7d[_0xb6e9('0x73')](util['format'](_0xb6e9('0x74'),_0x3f621c[_0xb6e9('0x47')]['id'],_0x2b4436));}else{return _0x236e7d['sendStatus'](0xcc);}})[_0xb6e9('0x45')](handleError(_0x236e7d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index cb3aa7e..418441a 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 _0x2bae=['../../config/environment','exports','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2e7d62,_0x1bf94a){var _0x34b0e5=function(_0x52012b){while(--_0x52012b){_0x2e7d62['push'](_0x2e7d62['shift']());}};_0x34b0e5(++_0x1bf94a);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe2ba('0x0'));var util=require(_0xe2ba('0x1'));var logger=require(_0xe2ba('0x2'))(_0xe2ba('0x3'));var moment=require(_0xe2ba('0x4'));var BPromise=require(_0xe2ba('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2ba('0x6'));var rimraf=require('rimraf');var config=require(_0xe2ba('0x7'));var attributes=require('./jscriptyProject.attributes');module[_0xe2ba('0x8')]=function(_0x129677,_0x21601e){return _0x129677['define'](_0xe2ba('0x9'),attributes,{'tableName':_0xe2ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9335=['JscriptyProject','jscripty_projects','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5217f6,_0x424e27){var _0x50e6a5=function(_0x1e7320){while(--_0x1e7320){_0x5217f6['push'](_0x5217f6['shift']());}};_0x50e6a5(++_0x424e27);}(_0x9335,0xab));var _0x5933=function(_0x416298,_0x220752){_0x416298=_0x416298-0x0;var _0x356b76=_0x9335[_0x416298];return _0x356b76;};'use strict';var _=require(_0x5933('0x0'));var util=require(_0x5933('0x1'));var logger=require('../../config/logger')(_0x5933('0x2'));var moment=require(_0x5933('0x3'));var BPromise=require(_0x5933('0x4'));var rp=require(_0x5933('0x5'));var fs=require('fs');var path=require(_0x5933('0x6'));var rimraf=require(_0x5933('0x7'));var config=require(_0x5933('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x5933('0x9')]=function(_0x4de024,_0x553710){return _0x4de024[_0x5933('0xa')](_0x5933('0xb'),attributes,{'tableName':_0x5933('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 5af1e65..e17498c 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x45cb0c,_0x4dd70f){var _0x21c344=function(_0xdbfb44){while(--_0xdbfb44){_0x45cb0c['push'](_0x45cb0c['shift']());}};_0x21c344(++_0x4dd70f);}(_0xe706,0xa3));var _0x6e70=function(_0x175374,_0x3c2440){_0x175374=_0x175374-0x0;var _0x4e1f61=_0xe706[_0x175374];return _0x4e1f61;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4802ac,_0xf1b1cf){var _0x2055ea=function(_0xc71dde){while(--_0xc71dde){_0x4802ac['push'](_0x4802ac['shift']());}};_0x2055ea(++_0xf1b1cf);}(_0xaa88,0x137));var _0x8aa8=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xaa88[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index fdfc215..5c4795e 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 _0xd780=['get','show','post','create','update','/:id','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index'];(function(_0x112ac3,_0x53d887){var _0x5d1df3=function(_0x55d7df){while(--_0x55d7df){_0x112ac3['push'](_0x112ac3['shift']());}};_0x5d1df3(++_0x53d887);}(_0xd780,0x139));var _0x0d78=function(_0x492757,_0x149f12){_0x492757=_0x492757-0x0;var _0x5c3e4d=_0xd780[_0x492757];return _0x5c3e4d;};'use strict';var multer=require(_0x0d78('0x0'));var util=require(_0x0d78('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0d78('0x2'));var router=express[_0x0d78('0x3')]();var fs_extra=require(_0x0d78('0x4'));var auth=require(_0x0d78('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0d78('0x6'));var controller=require(_0x0d78('0x7'));router['get']('/',auth[_0x0d78('0x8')](),controller[_0x0d78('0x9')]);router['get']('/describe',auth[_0x0d78('0x8')](),controller['describe']);router[_0x0d78('0xa')]('/:id',auth[_0x0d78('0x8')](),controller[_0x0d78('0xb')]);router[_0x0d78('0xc')]('/',auth[_0x0d78('0x8')](),controller[_0x0d78('0xd')]);router['put']('/:id',auth[_0x0d78('0x8')](),controller[_0x0d78('0xe')]);router['delete'](_0x0d78('0xf'),auth[_0x0d78('0x8')](),controller['destroy']);module[_0x0d78('0x10')]=router; \ No newline at end of file +var _0xb618=['../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2e9ca7,_0x476d6f){var _0x33679b=function(_0x48a2f8){while(--_0x48a2f8){_0x2e9ca7['push'](_0x2e9ca7['shift']());}};_0x33679b(++_0x476d6f);}(_0xb618,0xfe));var _0x8b61=function(_0x57f334,_0x588a74){_0x57f334=_0x57f334-0x0;var _0x1005d6=_0xb618[_0x57f334];return _0x1005d6;};'use strict';var multer=require(_0x8b61('0x0'));var util=require('util');var path=require(_0x8b61('0x1'));var timeout=require('connect-timeout');var express=require(_0x8b61('0x2'));var router=express['Router']();var fs_extra=require(_0x8b61('0x3'));var auth=require(_0x8b61('0x4'));var interaction=require(_0x8b61('0x5'));var config=require(_0x8b61('0x6'));var controller=require(_0x8b61('0x7'));router[_0x8b61('0x8')]('/',auth[_0x8b61('0x9')](),controller['index']);router[_0x8b61('0x8')](_0x8b61('0xa'),auth[_0x8b61('0x9')](),controller[_0x8b61('0xb')]);router[_0x8b61('0x8')](_0x8b61('0xc'),auth['isAuthenticated'](),controller[_0x8b61('0xd')]);router[_0x8b61('0xe')]('/',auth[_0x8b61('0x9')](),controller[_0x8b61('0xf')]);router[_0x8b61('0x10')]('/:id',auth[_0x8b61('0x9')](),controller[_0x8b61('0x11')]);router['delete'](_0x8b61('0xc'),auth[_0x8b61('0x9')](),controller[_0x8b61('0x12')]);module[_0x8b61('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 17fc7c3..11388f9 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(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0x1335de,_0x1c9290){_0x1335de=_0x1335de-0x0;var _0x24f5cc=_0x7a54[_0x1335de];return _0x24f5cc;};'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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0x3a33ce,_0xe411a){_0x3a33ce=_0x3a33ce-0x0;var _0x37882d=_0x7a54[_0x3a33ce];return _0x37882d;};'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 ccd5374..600d116 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 _0x1ff8=['sendStatus','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','body','find','describe','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy'];(function(_0x428441,_0x1050f4){var _0x545acc=function(_0x43ce7a){while(--_0x43ce7a){_0x428441['push'](_0x428441['shift']());}};_0x545acc(++_0x1050f4);}(_0x1ff8,0x192));var _0x81ff=function(_0x1bba1a,_0xdb4f8b){_0x1bba1a=_0x1bba1a-0x0;var _0x4ed799=_0x1ff8[_0x1bba1a];return _0x4ed799;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x81ff('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x81ff('0x1'));var moment=require(_0x81ff('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x81ff('0x3'));var util=require(_0x81ff('0x4'));var path=require(_0x81ff('0x5'));var sox=require(_0x81ff('0x6'));var csv=require(_0x81ff('0x7'));var ejs=require(_0x81ff('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x81ff('0x9'));var squel=require(_0x81ff('0xa'));var crypto=require(_0x81ff('0xb'));var jsforce=require(_0x81ff('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x81ff('0x7'));var querystring=require(_0x81ff('0xd'));var Papa=require(_0x81ff('0xe'));var Redis=require('ioredis');var authService=require(_0x81ff('0xf'));var qs=require(_0x81ff('0x10'));var as=require(_0x81ff('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x81ff('0x12'));var utils=require(_0x81ff('0x13'));var config=require(_0x81ff('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x81ff('0x15'))['db'];function respondWithStatusCode(_0x4d817e,_0x1163f9){_0x1163f9=_0x1163f9||0xcc;return function(_0x3a0c17){if(_0x3a0c17){return _0x4d817e['sendStatus'](_0x1163f9);}return _0x4d817e[_0x81ff('0x16')](_0x1163f9)[_0x81ff('0x17')]();};}function respondWithResult(_0x114750,_0x23eeb9){_0x23eeb9=_0x23eeb9||0xc8;return function(_0x1da9e8){if(_0x1da9e8){return _0x114750[_0x81ff('0x16')](_0x23eeb9)[_0x81ff('0x18')](_0x1da9e8);}};}function respondWithFilteredResult(_0x5337f8,_0x532f09){return function(_0x46b22a){if(_0x46b22a){var _0x4e192c=typeof _0x532f09[_0x81ff('0x19')]===_0x81ff('0x1a')&&typeof _0x532f09[_0x81ff('0x1b')]===_0x81ff('0x1a');var _0x143d20=_0x46b22a[_0x81ff('0x1c')];var _0x1b16dd=_0x4e192c?0x0:_0x532f09['offset'];var _0x58b9c8=_0x4e192c?_0x46b22a[_0x81ff('0x1c')]:_0x532f09[_0x81ff('0x19')]+_0x532f09[_0x81ff('0x1b')];var _0x4fa37e;if(_0x58b9c8>=_0x143d20){_0x58b9c8=_0x143d20;_0x4fa37e=0xc8;}else{_0x4fa37e=0xce;}_0x5337f8[_0x81ff('0x16')](_0x4fa37e);return _0x5337f8[_0x81ff('0x1d')](_0x81ff('0x1e'),_0x1b16dd+'-'+_0x58b9c8+'/'+_0x143d20)['json'](_0x46b22a);}return null;};}function patchUpdates(_0x211fc8){return function(_0x1484d5){try{jsonpatch[_0x81ff('0x1f')](_0x1484d5,_0x211fc8,!![]);}catch(_0x4a7355){return BPromise[_0x81ff('0x20')](_0x4a7355);}return _0x1484d5[_0x81ff('0x21')]();};}function saveUpdates(_0x2f1a0f,_0x2f7c5c){return function(_0x253b28){if(_0x253b28){return _0x253b28['update'](_0x2f1a0f)[_0x81ff('0x22')](function(_0x341341){return _0x341341;});}return null;};}function removeEntity(_0x27bbb0,_0x33a052){return function(_0x25af22){if(_0x25af22){return _0x25af22[_0x81ff('0x23')]()[_0x81ff('0x22')](function(){_0x27bbb0[_0x81ff('0x16')](0xcc)[_0x81ff('0x17')]();});}};}function handleEntityNotFound(_0x15ebe0,_0x47cbbe){return function(_0x50b2cd){if(!_0x50b2cd){_0x15ebe0[_0x81ff('0x24')](0x194);}return _0x50b2cd;};}function handleError(_0x27dade,_0x5f5787){_0x5f5787=_0x5f5787||0x1f4;return function(_0x1f6d19){logger[_0x81ff('0x25')](_0x1f6d19[_0x81ff('0x26')]);if(_0x1f6d19[_0x81ff('0x27')]){delete _0x1f6d19[_0x81ff('0x27')];}_0x27dade[_0x81ff('0x16')](_0x5f5787)[_0x81ff('0x28')](_0x1f6d19);};}exports[_0x81ff('0x29')]=function(_0x2d2eb2,_0x56d0c2){var _0x37dce5={},_0x10415c={},_0x12b803={'count':0x0,'rows':[]};var _0x1b8519=_[_0x81ff('0x2a')](db[_0x81ff('0x2b')][_0x81ff('0x2c')],function(_0x5d2415){return{'name':_0x5d2415[_0x81ff('0x2d')],'type':_0x5d2415[_0x81ff('0x2e')]['key']};});_0x10415c[_0x81ff('0x2f')]=_[_0x81ff('0x2a')](_0x1b8519,_0x81ff('0x27'));_0x10415c['query']=_['keys'](_0x2d2eb2[_0x81ff('0x30')]);_0x10415c[_0x81ff('0x31')]=_[_0x81ff('0x32')](_0x10415c['model'],_0x10415c[_0x81ff('0x30')]);_0x37dce5['attributes']=_[_0x81ff('0x32')](_0x10415c[_0x81ff('0x2f')],qs[_0x81ff('0x33')](_0x2d2eb2[_0x81ff('0x30')][_0x81ff('0x33')]));_0x37dce5[_0x81ff('0x34')]=_0x37dce5[_0x81ff('0x34')][_0x81ff('0x35')]?_0x37dce5[_0x81ff('0x34')]:_0x10415c[_0x81ff('0x2f')];if(!_0x2d2eb2['query'][_0x81ff('0x36')]('nolimit')){_0x37dce5[_0x81ff('0x1b')]=qs['limit'](_0x2d2eb2[_0x81ff('0x30')][_0x81ff('0x1b')]);_0x37dce5[_0x81ff('0x19')]=qs[_0x81ff('0x19')](_0x2d2eb2[_0x81ff('0x30')][_0x81ff('0x19')]);}_0x37dce5[_0x81ff('0x37')]=qs['sort'](_0x2d2eb2[_0x81ff('0x30')][_0x81ff('0x38')]);_0x37dce5[_0x81ff('0x39')]=qs[_0x81ff('0x31')](_['pick'](_0x2d2eb2[_0x81ff('0x30')],_0x10415c[_0x81ff('0x31')]),_0x1b8519);if(_0x2d2eb2['query'][_0x81ff('0x3a')]){_0x37dce5[_0x81ff('0x39')]=_[_0x81ff('0x3b')](_0x37dce5[_0x81ff('0x39')],{'$or':_[_0x81ff('0x2a')](_0x1b8519,function(_0x409f7d){if(_0x409f7d[_0x81ff('0x2e')]!==_0x81ff('0x3c')){var _0x16a83b={};_0x16a83b[_0x409f7d[_0x81ff('0x27')]]={'$like':'%'+_0x2d2eb2[_0x81ff('0x30')][_0x81ff('0x3a')]+'%'};return _0x16a83b;}})});}_0x37dce5=_[_0x81ff('0x3b')]({},_0x37dce5,_0x2d2eb2[_0x81ff('0x3d')]);var _0x38ffc1={'where':_0x37dce5[_0x81ff('0x39')]};return db[_0x81ff('0x2b')][_0x81ff('0x1c')](_0x38ffc1)['then'](function(_0x4e4c87){_0x12b803[_0x81ff('0x1c')]=_0x4e4c87;if(_0x2d2eb2[_0x81ff('0x30')]['includeAll']){_0x37dce5[_0x81ff('0x3e')]=[{'all':!![]}];}return db[_0x81ff('0x2b')][_0x81ff('0x3f')](_0x37dce5);})['then'](function(_0x3af02f){_0x12b803[_0x81ff('0x40')]=_0x3af02f;return _0x12b803;})['then'](respondWithFilteredResult(_0x56d0c2,_0x37dce5))[_0x81ff('0x41')](handleError(_0x56d0c2,null));};exports[_0x81ff('0x42')]=function(_0xc83358,_0x78d4f4){var _0x3a9e55={'raw':!![],'where':{'id':_0xc83358[_0x81ff('0x43')]['id']}},_0x336459={};_0x336459[_0x81ff('0x2f')]=_[_0x81ff('0x44')](db[_0x81ff('0x2b')][_0x81ff('0x2c')]);_0x336459['query']=_[_0x81ff('0x44')](_0xc83358['query']);_0x336459[_0x81ff('0x31')]=_[_0x81ff('0x32')](_0x336459['model'],_0x336459[_0x81ff('0x30')]);_0x3a9e55['attributes']=_['intersection'](_0x336459[_0x81ff('0x2f')],qs[_0x81ff('0x33')](_0xc83358[_0x81ff('0x30')]['fields']));_0x3a9e55[_0x81ff('0x34')]=_0x3a9e55[_0x81ff('0x34')]['length']?_0x3a9e55['attributes']:_0x336459[_0x81ff('0x2f')];if(_0xc83358[_0x81ff('0x30')][_0x81ff('0x45')]){_0x3a9e55['include']=[{'all':!![]}];}_0x3a9e55=_[_0x81ff('0x3b')]({},_0x3a9e55,_0xc83358[_0x81ff('0x3d')]);return db[_0x81ff('0x2b')]['find'](_0x3a9e55)[_0x81ff('0x22')](handleEntityNotFound(_0x78d4f4,null))[_0x81ff('0x22')](respondWithResult(_0x78d4f4,null))['catch'](handleError(_0x78d4f4,null));};exports['create']=function(_0x29d89c,_0x1a1d37){return db['JscriptyQuestionReport']['create'](_0x29d89c[_0x81ff('0x46')],{})[_0x81ff('0x22')](respondWithResult(_0x1a1d37,0xc9))[_0x81ff('0x41')](handleError(_0x1a1d37,null));};exports['update']=function(_0x2627b1,_0x5e3f2f){if(_0x2627b1[_0x81ff('0x46')]['id']){delete _0x2627b1[_0x81ff('0x46')]['id'];}return db[_0x81ff('0x2b')][_0x81ff('0x47')]({'where':{'id':_0x2627b1['params']['id']}})[_0x81ff('0x22')](handleEntityNotFound(_0x5e3f2f,null))[_0x81ff('0x22')](saveUpdates(_0x2627b1['body'],null))['then'](respondWithResult(_0x5e3f2f,null))['catch'](handleError(_0x5e3f2f,null));};exports[_0x81ff('0x23')]=function(_0x579d84,_0x49a2f0){return db[_0x81ff('0x2b')][_0x81ff('0x47')]({'where':{'id':_0x579d84[_0x81ff('0x43')]['id']}})[_0x81ff('0x22')](handleEntityNotFound(_0x49a2f0,null))[_0x81ff('0x22')](removeEntity(_0x49a2f0,null))['catch'](handleError(_0x49a2f0,null));};exports[_0x81ff('0x48')]=function(_0x13daf2,_0x24b8a8){return db[_0x81ff('0x2b')][_0x81ff('0x48')]()[_0x81ff('0x22')](respondWithResult(_0x24b8a8,null))[_0x81ff('0x41')](handleError(_0x24b8a8,null));}; \ No newline at end of file +var _0xeca3=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','options','include','rows','catch','params','rawAttributes','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','name','send','map','JscriptyQuestionReport','model','keys','query'];(function(_0x31e009,_0x29f3dc){var _0x5342f7=function(_0x406f9a){while(--_0x406f9a){_0x31e009['push'](_0x31e009['shift']());}};_0x5342f7(++_0x29f3dc);}(_0xeca3,0x13f));var _0x3eca=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xeca3[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x3eca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3eca('0x1'));var jsonpatch=require(_0x3eca('0x2'));var rp=require(_0x3eca('0x3'));var moment=require(_0x3eca('0x4'));var BPromise=require(_0x3eca('0x5'));var Mustache=require(_0x3eca('0x6'));var util=require('util');var path=require(_0x3eca('0x7'));var sox=require(_0x3eca('0x8'));var csv=require('to-csv');var ejs=require(_0x3eca('0x9'));var fs=require('fs');var fs_extra=require(_0x3eca('0xa'));var _=require('lodash');var squel=require(_0x3eca('0xb'));var crypto=require(_0x3eca('0xc'));var jsforce=require(_0x3eca('0xd'));var deskjs=require(_0x3eca('0xe'));var toCsv=require(_0x3eca('0xf'));var querystring=require(_0x3eca('0x10'));var Papa=require(_0x3eca('0x11'));var Redis=require(_0x3eca('0x12'));var authService=require(_0x3eca('0x13'));var qs=require(_0x3eca('0x14'));var as=require(_0x3eca('0x15'));var hardwareService=require(_0x3eca('0x16'));var logger=require(_0x3eca('0x17'))(_0x3eca('0x18'));var utils=require(_0x3eca('0x19'));var config=require(_0x3eca('0x1a'));var licenseUtil=require(_0x3eca('0x1b'));var db=require(_0x3eca('0x1c'))['db'];function respondWithStatusCode(_0x484ea2,_0x57f953){_0x57f953=_0x57f953||0xcc;return function(_0x284bd1){if(_0x284bd1){return _0x484ea2['sendStatus'](_0x57f953);}return _0x484ea2[_0x3eca('0x1d')](_0x57f953)[_0x3eca('0x1e')]();};}function respondWithResult(_0x17746f,_0xf22896){_0xf22896=_0xf22896||0xc8;return function(_0xf954e4){if(_0xf954e4){return _0x17746f[_0x3eca('0x1d')](_0xf22896)['json'](_0xf954e4);}};}function respondWithFilteredResult(_0x45309e,_0xb7c1e0){return function(_0x401342){if(_0x401342){var _0x559eec=typeof _0xb7c1e0[_0x3eca('0x1f')]==='undefined'&&typeof _0xb7c1e0[_0x3eca('0x20')]===_0x3eca('0x21');var _0xa1f33b=_0x401342[_0x3eca('0x22')];var _0x32711d=_0x559eec?0x0:_0xb7c1e0[_0x3eca('0x1f')];var _0x19bfc4=_0x559eec?_0x401342[_0x3eca('0x22')]:_0xb7c1e0['offset']+_0xb7c1e0[_0x3eca('0x20')];var _0x42552d;if(_0x19bfc4>=_0xa1f33b){_0x19bfc4=_0xa1f33b;_0x42552d=0xc8;}else{_0x42552d=0xce;}_0x45309e[_0x3eca('0x1d')](_0x42552d);return _0x45309e['set'](_0x3eca('0x23'),_0x32711d+'-'+_0x19bfc4+'/'+_0xa1f33b)[_0x3eca('0x24')](_0x401342);}return null;};}function patchUpdates(_0x1f4ccf){return function(_0x3f2e79){try{jsonpatch['apply'](_0x3f2e79,_0x1f4ccf,!![]);}catch(_0x5f2afd){return BPromise[_0x3eca('0x25')](_0x5f2afd);}return _0x3f2e79[_0x3eca('0x26')]();};}function saveUpdates(_0x17baa2,_0x14665f){return function(_0x46852b){if(_0x46852b){return _0x46852b[_0x3eca('0x27')](_0x17baa2)[_0x3eca('0x28')](function(_0x16b50e){return _0x16b50e;});}return null;};}function removeEntity(_0x540833,_0x94f38b){return function(_0x2036f7){if(_0x2036f7){return _0x2036f7[_0x3eca('0x29')]()[_0x3eca('0x28')](function(){_0x540833['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2865a6,_0xb5bc98){return function(_0x26cf35){if(!_0x26cf35){_0x2865a6[_0x3eca('0x2a')](0x194);}return _0x26cf35;};}function handleError(_0x5a38e9,_0xc5901){_0xc5901=_0xc5901||0x1f4;return function(_0x13f3ad){logger[_0x3eca('0x2b')](_0x13f3ad['stack']);if(_0x13f3ad['name']){delete _0x13f3ad[_0x3eca('0x2c')];}_0x5a38e9['status'](_0xc5901)[_0x3eca('0x2d')](_0x13f3ad);};}exports['index']=function(_0x586d58,_0x188de4){var _0x44bb71={},_0x407d47={},_0x2c4270={'count':0x0,'rows':[]};var _0x5efff8=_[_0x3eca('0x2e')](db[_0x3eca('0x2f')]['rawAttributes'],function(_0x1cabf3){return{'name':_0x1cabf3['fieldName'],'type':_0x1cabf3['type']['key']};});_0x407d47[_0x3eca('0x30')]=_[_0x3eca('0x2e')](_0x5efff8,_0x3eca('0x2c'));_0x407d47['query']=_[_0x3eca('0x31')](_0x586d58[_0x3eca('0x32')]);_0x407d47[_0x3eca('0x33')]=_[_0x3eca('0x34')](_0x407d47['model'],_0x407d47[_0x3eca('0x32')]);_0x44bb71[_0x3eca('0x35')]=_[_0x3eca('0x34')](_0x407d47[_0x3eca('0x30')],qs['fields'](_0x586d58[_0x3eca('0x32')][_0x3eca('0x36')]));_0x44bb71[_0x3eca('0x35')]=_0x44bb71[_0x3eca('0x35')][_0x3eca('0x37')]?_0x44bb71[_0x3eca('0x35')]:_0x407d47[_0x3eca('0x30')];if(!_0x586d58[_0x3eca('0x32')][_0x3eca('0x38')]('nolimit')){_0x44bb71[_0x3eca('0x20')]=qs[_0x3eca('0x20')](_0x586d58[_0x3eca('0x32')][_0x3eca('0x20')]);_0x44bb71['offset']=qs[_0x3eca('0x1f')](_0x586d58[_0x3eca('0x32')]['offset']);}_0x44bb71[_0x3eca('0x39')]=qs[_0x3eca('0x3a')](_0x586d58[_0x3eca('0x32')][_0x3eca('0x3a')]);_0x44bb71[_0x3eca('0x3b')]=qs[_0x3eca('0x33')](_[_0x3eca('0x3c')](_0x586d58[_0x3eca('0x32')],_0x407d47[_0x3eca('0x33')]),_0x5efff8);if(_0x586d58[_0x3eca('0x32')]['filter']){_0x44bb71[_0x3eca('0x3b')]=_[_0x3eca('0x3d')](_0x44bb71['where'],{'$or':_['map'](_0x5efff8,function(_0x4819f9){if(_0x4819f9[_0x3eca('0x3e')]!=='VIRTUAL'){var _0x2c65f3={};_0x2c65f3[_0x4819f9[_0x3eca('0x2c')]]={'$like':'%'+_0x586d58[_0x3eca('0x32')]['filter']+'%'};return _0x2c65f3;}})});}_0x44bb71=_[_0x3eca('0x3d')]({},_0x44bb71,_0x586d58[_0x3eca('0x3f')]);var _0x2a992c={'where':_0x44bb71[_0x3eca('0x3b')]};return db[_0x3eca('0x2f')][_0x3eca('0x22')](_0x2a992c)[_0x3eca('0x28')](function(_0x4d687b){_0x2c4270[_0x3eca('0x22')]=_0x4d687b;if(_0x586d58[_0x3eca('0x32')]['includeAll']){_0x44bb71[_0x3eca('0x40')]=[{'all':!![]}];}return db[_0x3eca('0x2f')]['findAll'](_0x44bb71);})[_0x3eca('0x28')](function(_0x4caec8){_0x2c4270[_0x3eca('0x41')]=_0x4caec8;return _0x2c4270;})[_0x3eca('0x28')](respondWithFilteredResult(_0x188de4,_0x44bb71))[_0x3eca('0x42')](handleError(_0x188de4,null));};exports['show']=function(_0x2e7b53,_0x1bfab1){var _0x58c47d={'raw':!![],'where':{'id':_0x2e7b53[_0x3eca('0x43')]['id']}},_0x45d563={};_0x45d563[_0x3eca('0x30')]=_[_0x3eca('0x31')](db['JscriptyQuestionReport'][_0x3eca('0x44')]);_0x45d563[_0x3eca('0x32')]=_[_0x3eca('0x31')](_0x2e7b53[_0x3eca('0x32')]);_0x45d563[_0x3eca('0x33')]=_['intersection'](_0x45d563[_0x3eca('0x30')],_0x45d563[_0x3eca('0x32')]);_0x58c47d[_0x3eca('0x35')]=_[_0x3eca('0x34')](_0x45d563[_0x3eca('0x30')],qs['fields'](_0x2e7b53[_0x3eca('0x32')][_0x3eca('0x36')]));_0x58c47d[_0x3eca('0x35')]=_0x58c47d[_0x3eca('0x35')][_0x3eca('0x37')]?_0x58c47d[_0x3eca('0x35')]:_0x45d563[_0x3eca('0x30')];if(_0x2e7b53['query'][_0x3eca('0x45')]){_0x58c47d[_0x3eca('0x40')]=[{'all':!![]}];}_0x58c47d=_['merge']({},_0x58c47d,_0x2e7b53['options']);return db[_0x3eca('0x2f')][_0x3eca('0x46')](_0x58c47d)[_0x3eca('0x28')](handleEntityNotFound(_0x1bfab1,null))[_0x3eca('0x28')](respondWithResult(_0x1bfab1,null))[_0x3eca('0x42')](handleError(_0x1bfab1,null));};exports[_0x3eca('0x47')]=function(_0x56032d,_0x2a7a3b){return db['JscriptyQuestionReport'][_0x3eca('0x47')](_0x56032d[_0x3eca('0x48')],{})['then'](respondWithResult(_0x2a7a3b,0xc9))[_0x3eca('0x42')](handleError(_0x2a7a3b,null));};exports[_0x3eca('0x27')]=function(_0x40ac4e,_0xb8724d){if(_0x40ac4e[_0x3eca('0x48')]['id']){delete _0x40ac4e[_0x3eca('0x48')]['id'];}return db[_0x3eca('0x2f')][_0x3eca('0x46')]({'where':{'id':_0x40ac4e[_0x3eca('0x43')]['id']}})[_0x3eca('0x28')](handleEntityNotFound(_0xb8724d,null))[_0x3eca('0x28')](saveUpdates(_0x40ac4e[_0x3eca('0x48')],null))[_0x3eca('0x28')](respondWithResult(_0xb8724d,null))[_0x3eca('0x42')](handleError(_0xb8724d,null));};exports['destroy']=function(_0x56b2a2,_0x5772cc){return db[_0x3eca('0x2f')][_0x3eca('0x46')]({'where':{'id':_0x56b2a2[_0x3eca('0x43')]['id']}})[_0x3eca('0x28')](handleEntityNotFound(_0x5772cc,null))[_0x3eca('0x28')](removeEntity(_0x5772cc,null))[_0x3eca('0x42')](handleError(_0x5772cc,null));};exports[_0x3eca('0x49')]=function(_0x2a53c5,_0x353b65){return db[_0x3eca('0x2f')][_0x3eca('0x49')]()[_0x3eca('0x28')](respondWithResult(_0x353b65,null))[_0x3eca('0x42')](handleError(_0x353b65,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index cab2bdf..2005985 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 _0xc46e=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0x4805a6,_0x759130){var _0x2916f9=function(_0x465a47){while(--_0x465a47){_0x4805a6['push'](_0x4805a6['shift']());}};_0x2916f9(++_0x759130);}(_0xc46e,0x1ed));var _0xec46=function(_0x4efd3d,_0x2b9694){_0x4efd3d=_0x4efd3d-0x0;var _0x1293f2=_0xc46e[_0x4efd3d];return _0x1293f2;};'use strict';var _=require(_0xec46('0x0'));var util=require(_0xec46('0x1'));var logger=require(_0xec46('0x2'))(_0xec46('0x3'));var moment=require(_0xec46('0x4'));var BPromise=require(_0xec46('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec46('0x6'));var rimraf=require(_0xec46('0x7'));var config=require(_0xec46('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xec46('0x9')]=function(_0x42d4e8,_0x338593){return _0x42d4e8[_0xec46('0xa')](_0xec46('0xb'),attributes,{'tableName':_0xec46('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x834f=['lodash','util','api','moment','bluebird','request-promise','rimraf','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x490228,_0x222f01){var _0x17936a=function(_0x5aa977){while(--_0x5aa977){_0x490228['push'](_0x490228['shift']());}};_0x17936a(++_0x222f01);}(_0x834f,0x84));var _0xf834=function(_0xb6c61b,_0x52f72d){_0xb6c61b=_0xb6c61b-0x0;var _0x1413ac=_0x834f[_0xb6c61b];return _0x1413ac;};'use strict';var _=require(_0xf834('0x0'));var util=require(_0xf834('0x1'));var logger=require('../../config/logger')(_0xf834('0x2'));var moment=require(_0xf834('0x3'));var BPromise=require(_0xf834('0x4'));var rp=require(_0xf834('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf834('0x6'));var config=require('../../config/environment');var attributes=require(_0xf834('0x7'));module[_0xf834('0x8')]=function(_0x2b10c1,_0x50b413){return _0x2b10c1[_0xf834('0x9')](_0xf834('0xa'),attributes,{'tableName':_0xf834('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 9551752..d48646c 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 _0xdea9=['../../config/logger','../../config/environment','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4d5b07,_0x2d59df){var _0x3a10b0=function(_0x5693a2){while(--_0x5693a2){_0x4d5b07['push'](_0x4d5b07['shift']());}};_0x3a10b0(++_0x2d59df);}(_0xdea9,0x1b4));var _0x9dea=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xdea9[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9dea('0x0'));var rs=require(_0x9dea('0x1'));var fs=require('fs');var Redis=require(_0x9dea('0x2'));var db=require(_0x9dea('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9dea('0x4'))('rpc');var config=require(_0x9dea('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x9dea('0x6')][_0x9dea('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1460bd,_0x99a26c,_0x1d9f09){return new BPromise(function(_0x1416a7,_0x61cee1){return client[_0x9dea('0x8')](_0x1460bd,_0x1d9f09)['then'](function(_0x3bd6f7){logger[_0x9dea('0x9')](_0x9dea('0xa'),_0x99a26c,_0x9dea('0xb'));logger[_0x9dea('0xc')](_0x9dea('0xd'),_0x99a26c,_0x9dea('0xb'),JSON[_0x9dea('0xe')](_0x3bd6f7));if(_0x3bd6f7[_0x9dea('0xf')]){if(_0x3bd6f7['error'][_0x9dea('0x10')]===0x1f4){logger[_0x9dea('0xf')](_0x9dea('0xa'),_0x99a26c,_0x3bd6f7[_0x9dea('0xf')][_0x9dea('0x11')]);return _0x61cee1(_0x3bd6f7[_0x9dea('0xf')][_0x9dea('0x11')]);}logger['error'](_0x9dea('0xa'),_0x99a26c,_0x3bd6f7[_0x9dea('0xf')][_0x9dea('0x11')]);return _0x1416a7(_0x3bd6f7[_0x9dea('0xf')][_0x9dea('0x11')]);}else{logger[_0x9dea('0x9')](_0x9dea('0xa'),_0x99a26c,_0x9dea('0xb'));_0x1416a7(_0x3bd6f7[_0x9dea('0x12')][_0x9dea('0x11')]);}})[_0x9dea('0x13')](function(_0x3a663a){logger[_0x9dea('0xf')](_0x9dea('0xa'),_0x99a26c,_0x3a663a);_0x61cee1(_0x3a663a);});});} \ No newline at end of file +var _0x13b7=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13b7,0x1a3));var _0x713b=function(_0x2ec994,_0x3e9662){_0x2ec994=_0x2ec994-0x0;var _0x503af5=_0x13b7[_0x2ec994];return _0x503af5;};'use strict';var _=require(_0x713b('0x0'));var util=require(_0x713b('0x1'));var moment=require(_0x713b('0x2'));var BPromise=require(_0x713b('0x3'));var rs=require(_0x713b('0x4'));var fs=require('fs');var Redis=require(_0x713b('0x5'));var db=require(_0x713b('0x6'))['db'];var utils=require(_0x713b('0x7'));var logger=require(_0x713b('0x8'))(_0x713b('0x9'));var config=require('../../config/environment');var jayson=require(_0x713b('0xa'));var client=jayson[_0x713b('0xb')][_0x713b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b0320,_0x18d966,_0x4a2010){return new BPromise(function(_0xc47e0e,_0x5490e3){return client['request'](_0x1b0320,_0x4a2010)[_0x713b('0xd')](function(_0x27e6cc){logger[_0x713b('0xe')](_0x713b('0xf'),_0x18d966,_0x713b('0x10'));logger[_0x713b('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x18d966,_0x713b('0x10'),JSON[_0x713b('0x12')](_0x27e6cc));if(_0x27e6cc[_0x713b('0x13')]){if(_0x27e6cc[_0x713b('0x13')]['code']===0x1f4){logger[_0x713b('0x13')](_0x713b('0xf'),_0x18d966,_0x27e6cc['error'][_0x713b('0x14')]);return _0x5490e3(_0x27e6cc[_0x713b('0x13')][_0x713b('0x14')]);}logger[_0x713b('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x18d966,_0x27e6cc[_0x713b('0x13')]['message']);return _0xc47e0e(_0x27e6cc[_0x713b('0x13')][_0x713b('0x14')]);}else{logger[_0x713b('0xe')](_0x713b('0xf'),_0x18d966,'request\x20sent');_0xc47e0e(_0x27e6cc[_0x713b('0x15')][_0x713b('0x14')]);}})[_0x713b('0x16')](function(_0x1c3df5){logger['error'](_0x713b('0xf'),_0x18d966,_0x1c3df5);_0x5490e3(_0x1c3df5);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 05ecece..8976afc 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 _0xf51f=['isAuthenticated','describe','show','get','getQuestions','post','put','/:id','update','destroy','multer','util','path','../../components/auth/service','../../config/environment'];(function(_0x173452,_0x3aa870){var _0xee3fd0=function(_0x10eb01){while(--_0x10eb01){_0x173452['push'](_0x173452['shift']());}};_0xee3fd0(++_0x3aa870);}(_0xf51f,0xbe));var _0xff51=function(_0x199c03,_0x3254aa){_0x199c03=_0x199c03-0x0;var _0x11a7d4=_0xf51f[_0x199c03];return _0x11a7d4;};'use strict';var multer=require(_0xff51('0x0'));var util=require(_0xff51('0x1'));var path=require(_0xff51('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xff51('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xff51('0x4'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xff51('0x5')](),controller[_0xff51('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xff51('0x7')]);router[_0xff51('0x8')]('/:id/questions',auth[_0xff51('0x5')](),controller[_0xff51('0x9')]);router[_0xff51('0xa')]('/',auth[_0xff51('0x5')](),controller['create']);router[_0xff51('0xb')](_0xff51('0xc'),auth[_0xff51('0x5')](),controller[_0xff51('0xd')]);router['delete'](_0xff51('0xc'),auth[_0xff51('0x5')](),controller[_0xff51('0xe')]);module['exports']=router; \ No newline at end of file +var _0x34dc=['index','get','/describe','describe','/:id','getQuestions','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','isAuthenticated'];(function(_0x205b6a,_0x89e9c1){var _0xbc22c=function(_0x593d38){while(--_0x593d38){_0x205b6a['push'](_0x205b6a['shift']());}};_0xbc22c(++_0x89e9c1);}(_0x34dc,0xd3));var _0xc34d=function(_0x4cd50c,_0x2a517e){_0x4cd50c=_0x4cd50c-0x0;var _0x24f08c=_0x34dc[_0x4cd50c];return _0x24f08c;};'use strict';var multer=require(_0xc34d('0x0'));var util=require('util');var path=require(_0xc34d('0x1'));var timeout=require('connect-timeout');var express=require(_0xc34d('0x2'));var router=express[_0xc34d('0x3')]();var fs_extra=require(_0xc34d('0x4'));var auth=require(_0xc34d('0x5'));var interaction=require(_0xc34d('0x6'));var config=require('../../config/environment');var controller=require(_0xc34d('0x7'));router['get']('/',auth[_0xc34d('0x8')](),controller[_0xc34d('0x9')]);router[_0xc34d('0xa')](_0xc34d('0xb'),auth[_0xc34d('0x8')](),controller[_0xc34d('0xc')]);router['get'](_0xc34d('0xd'),auth[_0xc34d('0x8')](),controller['show']);router[_0xc34d('0xa')]('/:id/questions',auth['isAuthenticated'](),controller[_0xc34d('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc34d('0xf')]);router[_0xc34d('0x10')]('/:id',auth[_0xc34d('0x8')](),controller[_0xc34d('0x11')]);router[_0xc34d('0x12')]('/:id',auth[_0xc34d('0x8')](),controller[_0xc34d('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 430446e..579ecb9 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 _0x00a0=['setDataValue','starttime','format','STRING','BOOLEAN','moment','exports','DATE'];(function(_0x362bd8,_0x24dad2){var _0x5b25df=function(_0x2b0d39){while(--_0x2b0d39){_0x362bd8['push'](_0x362bd8['shift']());}};_0x5b25df(++_0x24dad2);}(_0x00a0,0xd5));var _0x000a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x00a0[_0x122ef9];return _0x42fba0;};'use strict';var moment=require(_0x000a('0x0'));var Sequelize=require('sequelize');module[_0x000a('0x1')]={'starttime':{'type':Sequelize[_0x000a('0x2')],'set':function(_0x37081){this[_0x000a('0x3')](_0x000a('0x4'),_0x37081);this[_0x000a('0x3')]('endtime',moment()[_0x000a('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x000a('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x000a('0x6')]},'queue':{'type':Sequelize[_0x000a('0x6')]},'uniqueid':{'type':Sequelize[_0x000a('0x6')]},'calleridname':{'type':Sequelize[_0x000a('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x000a('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x7782=['moment','sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x3d6293,_0x3c9ab5){var _0x103b21=function(_0x1e857a){while(--_0x1e857a){_0x3d6293['push'](_0x3d6293['shift']());}};_0x103b21(++_0x3c9ab5);}(_0x7782,0x134));var _0x2778=function(_0x4c5edd,_0x2233ae){_0x4c5edd=_0x4c5edd-0x0;var _0x14ecbe=_0x7782[_0x4c5edd];return _0x14ecbe;};'use strict';var moment=require(_0x2778('0x0'));var Sequelize=require(_0x2778('0x1'));module[_0x2778('0x2')]={'starttime':{'type':Sequelize[_0x2778('0x3')],'set':function(_0x597bcc){this[_0x2778('0x4')](_0x2778('0x5'),_0x597bcc);this[_0x2778('0x4')](_0x2778('0x6'),moment()[_0x2778('0x7')](_0x2778('0x8')));}},'endtime':{'type':Sequelize[_0x2778('0x3')]},'membername':{'type':Sequelize[_0x2778('0x9')]},'projectname':{'type':Sequelize[_0x2778('0x9')]},'queue':{'type':Sequelize[_0x2778('0x9')]},'uniqueid':{'type':Sequelize[_0x2778('0x9')]},'calleridname':{'type':Sequelize[_0x2778('0x9')]},'calleridnum':{'type':Sequelize[_0x2778('0x9')]},'completed':{'type':Sequelize[_0x2778('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 56fea6f..4b75bf4 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 _0x1613=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','show','body','find','params','getQuestions','findOne','rawAttributes','SessionId','JscriptyQuestionReport','findAll','rows','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','JscriptySessionReport'];(function(_0x2634a7,_0x118508){var _0xa52e2c=function(_0x400f75){while(--_0x400f75){_0x2634a7['push'](_0x2634a7['shift']());}};_0xa52e2c(++_0x118508);}(_0x1613,0x113));var _0x3161=function(_0x45b188,_0x2bdbd1){_0x45b188=_0x45b188-0x0;var _0x59ae2a=_0x1613[_0x45b188];return _0x59ae2a;};'use strict';var emlformat=require(_0x3161('0x0'));var rimraf=require(_0x3161('0x1'));var zipdir=require(_0x3161('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3161('0x3'));var moment=require('moment');var BPromise=require(_0x3161('0x4'));var Mustache=require(_0x3161('0x5'));var util=require(_0x3161('0x6'));var path=require(_0x3161('0x7'));var sox=require('sox');var csv=require(_0x3161('0x8'));var ejs=require(_0x3161('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3161('0xa'));var squel=require(_0x3161('0xb'));var crypto=require(_0x3161('0xc'));var jsforce=require(_0x3161('0xd'));var deskjs=require(_0x3161('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3161('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3161('0x10'));var qs=require(_0x3161('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3161('0x12'));var logger=require(_0x3161('0x13'))(_0x3161('0x14'));var utils=require(_0x3161('0x15'));var config=require(_0x3161('0x16'));var licenseUtil=require(_0x3161('0x17'));var db=require(_0x3161('0x18'))['db'];function respondWithStatusCode(_0x4b95c4,_0x47b656){_0x47b656=_0x47b656||0xcc;return function(_0x3b8b34){if(_0x3b8b34){return _0x4b95c4[_0x3161('0x19')](_0x47b656);}return _0x4b95c4[_0x3161('0x1a')](_0x47b656)[_0x3161('0x1b')]();};}function respondWithResult(_0x35a2b4,_0x582b5e){_0x582b5e=_0x582b5e||0xc8;return function(_0x3c8d71){if(_0x3c8d71){return _0x35a2b4[_0x3161('0x1a')](_0x582b5e)[_0x3161('0x1c')](_0x3c8d71);}};}function respondWithFilteredResult(_0x4951c0,_0x37b454){return function(_0x1c4ab1){if(_0x1c4ab1){var _0x38f339=typeof _0x37b454[_0x3161('0x1d')]===_0x3161('0x1e')&&typeof _0x37b454[_0x3161('0x1f')]===_0x3161('0x1e');var _0xdb212c=_0x1c4ab1[_0x3161('0x20')];var _0x60b9a3=_0x38f339?0x0:_0x37b454[_0x3161('0x1d')];var _0x12fe01=_0x38f339?_0x1c4ab1['count']:_0x37b454[_0x3161('0x1d')]+_0x37b454[_0x3161('0x1f')];var _0x5b326e;if(_0x12fe01>=_0xdb212c){_0x12fe01=_0xdb212c;_0x5b326e=0xc8;}else{_0x5b326e=0xce;}_0x4951c0[_0x3161('0x1a')](_0x5b326e);return _0x4951c0[_0x3161('0x21')](_0x3161('0x22'),_0x60b9a3+'-'+_0x12fe01+'/'+_0xdb212c)[_0x3161('0x1c')](_0x1c4ab1);}return null;};}function patchUpdates(_0x2cabf0){return function(_0x10f40){try{jsonpatch[_0x3161('0x23')](_0x10f40,_0x2cabf0,!![]);}catch(_0x472db9){return BPromise[_0x3161('0x24')](_0x472db9);}return _0x10f40['save']();};}function saveUpdates(_0x2fb66e,_0xce365d){return function(_0x5f2694){if(_0x5f2694){return _0x5f2694[_0x3161('0x25')](_0x2fb66e)[_0x3161('0x26')](function(_0x329b70){return _0x329b70;});}return null;};}function removeEntity(_0xa21526,_0x830b71){return function(_0x338c59){if(_0x338c59){return _0x338c59[_0x3161('0x27')]()[_0x3161('0x26')](function(){_0xa21526[_0x3161('0x1a')](0xcc)[_0x3161('0x1b')]();});}};}function handleEntityNotFound(_0x2ce7be,_0x1f9d42){return function(_0x478b7b){if(!_0x478b7b){_0x2ce7be[_0x3161('0x19')](0x194);}return _0x478b7b;};}function handleError(_0x1e21df,_0x1812cf){_0x1812cf=_0x1812cf||0x1f4;return function(_0x491b05){logger['error'](_0x491b05[_0x3161('0x28')]);if(_0x491b05[_0x3161('0x29')]){delete _0x491b05[_0x3161('0x29')];}_0x1e21df[_0x3161('0x1a')](_0x1812cf)[_0x3161('0x2a')](_0x491b05);};}exports['index']=function(_0x4c69c2,_0x35f4f6){var _0xf77233={},_0x193955={},_0x194853={'count':0x0,'rows':[]};var _0x47137c=_[_0x3161('0x2b')](db[_0x3161('0x2c')]['rawAttributes'],function(_0x3d8b99){return{'name':_0x3d8b99[_0x3161('0x2d')],'type':_0x3d8b99[_0x3161('0x2e')][_0x3161('0x2f')]};});_0x193955[_0x3161('0x30')]=_[_0x3161('0x2b')](_0x47137c,'name');_0x193955[_0x3161('0x31')]=_[_0x3161('0x32')](_0x4c69c2[_0x3161('0x31')]);_0x193955[_0x3161('0x33')]=_[_0x3161('0x34')](_0x193955['model'],_0x193955['query']);_0xf77233[_0x3161('0x35')]=_[_0x3161('0x34')](_0x193955[_0x3161('0x30')],qs['fields'](_0x4c69c2[_0x3161('0x31')][_0x3161('0x36')]));_0xf77233['attributes']=_0xf77233[_0x3161('0x35')][_0x3161('0x37')]?_0xf77233[_0x3161('0x35')]:_0x193955[_0x3161('0x30')];if(!_0x4c69c2['query'][_0x3161('0x38')](_0x3161('0x39'))){_0xf77233[_0x3161('0x1f')]=qs[_0x3161('0x1f')](_0x4c69c2[_0x3161('0x31')][_0x3161('0x1f')]);_0xf77233[_0x3161('0x1d')]=qs[_0x3161('0x1d')](_0x4c69c2[_0x3161('0x31')][_0x3161('0x1d')]);}_0xf77233[_0x3161('0x3a')]=qs['sort'](_0x4c69c2[_0x3161('0x31')][_0x3161('0x3b')]);_0xf77233[_0x3161('0x3c')]=qs[_0x3161('0x33')](_[_0x3161('0x3d')](_0x4c69c2[_0x3161('0x31')],_0x193955[_0x3161('0x33')]),_0x47137c);if(_0x4c69c2[_0x3161('0x31')]['filter']){_0xf77233[_0x3161('0x3c')]=_[_0x3161('0x3e')](_0xf77233['where'],{'$or':_[_0x3161('0x2b')](_0x47137c,function(_0x341cd7){if(_0x341cd7[_0x3161('0x2e')]!==_0x3161('0x3f')){var _0x2085d8={};_0x2085d8[_0x341cd7[_0x3161('0x29')]]={'$like':'%'+_0x4c69c2[_0x3161('0x31')][_0x3161('0x40')]+'%'};return _0x2085d8;}})});}_0xf77233=_[_0x3161('0x3e')]({},_0xf77233,_0x4c69c2[_0x3161('0x41')]);var _0x5b17cb={'where':_0xf77233[_0x3161('0x3c')]};return db[_0x3161('0x2c')][_0x3161('0x20')](_0x5b17cb)[_0x3161('0x26')](function(_0x18c4b9){_0x194853['count']=_0x18c4b9;if(_0x4c69c2['query'][_0x3161('0x42')]){_0xf77233[_0x3161('0x43')]=[{'all':!![]}];}return db[_0x3161('0x2c')]['findAll'](_0xf77233);})['then'](function(_0x6c1555){_0x194853['rows']=_0x6c1555;return _0x194853;})[_0x3161('0x26')](respondWithFilteredResult(_0x35f4f6,_0xf77233))[_0x3161('0x44')](handleError(_0x35f4f6,null));};exports[_0x3161('0x45')]=function(_0x3d5af5,_0x30adac){var _0x3b7df4={'raw':!![],'where':{'id':_0x3d5af5['params']['id']}},_0x1b0ac1={};_0x1b0ac1[_0x3161('0x30')]=_[_0x3161('0x32')](db['JscriptySessionReport']['rawAttributes']);_0x1b0ac1['query']=_[_0x3161('0x32')](_0x3d5af5['query']);_0x1b0ac1[_0x3161('0x33')]=_[_0x3161('0x34')](_0x1b0ac1[_0x3161('0x30')],_0x1b0ac1['query']);_0x3b7df4[_0x3161('0x35')]=_[_0x3161('0x34')](_0x1b0ac1[_0x3161('0x30')],qs[_0x3161('0x36')](_0x3d5af5[_0x3161('0x31')][_0x3161('0x36')]));_0x3b7df4[_0x3161('0x35')]=_0x3b7df4['attributes']['length']?_0x3b7df4[_0x3161('0x35')]:_0x1b0ac1[_0x3161('0x30')];if(_0x3d5af5['query'][_0x3161('0x42')]){_0x3b7df4[_0x3161('0x43')]=[{'all':!![]}];}_0x3b7df4=_[_0x3161('0x3e')]({},_0x3b7df4,_0x3d5af5[_0x3161('0x41')]);return db[_0x3161('0x2c')]['find'](_0x3b7df4)[_0x3161('0x26')](handleEntityNotFound(_0x30adac,null))[_0x3161('0x26')](respondWithResult(_0x30adac,null))['catch'](handleError(_0x30adac,null));};exports['create']=function(_0x1b17bc,_0x7eabc){return db['JscriptySessionReport']['create'](_0x1b17bc[_0x3161('0x46')],{})['then'](respondWithResult(_0x7eabc,0xc9))['catch'](handleError(_0x7eabc,null));};exports[_0x3161('0x25')]=function(_0x3387d0,_0x53f58d){if(_0x3387d0[_0x3161('0x46')]['id']){delete _0x3387d0[_0x3161('0x46')]['id'];}return db[_0x3161('0x2c')][_0x3161('0x47')]({'where':{'id':_0x3387d0[_0x3161('0x48')]['id']}})[_0x3161('0x26')](handleEntityNotFound(_0x53f58d,null))[_0x3161('0x26')](saveUpdates(_0x3387d0[_0x3161('0x46')],null))[_0x3161('0x26')](respondWithResult(_0x53f58d,null))[_0x3161('0x44')](handleError(_0x53f58d,null));};exports['destroy']=function(_0x43dc26,_0x3c37d3){return db[_0x3161('0x2c')][_0x3161('0x47')]({'where':{'id':_0x43dc26[_0x3161('0x48')]['id']}})[_0x3161('0x26')](handleEntityNotFound(_0x3c37d3,null))[_0x3161('0x26')](removeEntity(_0x3c37d3,null))[_0x3161('0x44')](handleError(_0x3c37d3,null));};exports['describe']=function(_0x237ad7,_0x16f6fe){return db['JscriptySessionReport']['describe']()[_0x3161('0x26')](respondWithResult(_0x16f6fe,null))[_0x3161('0x44')](handleError(_0x16f6fe,null));};exports[_0x3161('0x49')]=function(_0x26f13d,_0x2d8d71,_0x4295){var _0x32afde={'raw':!![],'where':{}};var _0x4f98b1={};var _0x3780d4={'count':0x0,'rows':[]};return db[_0x3161('0x2c')][_0x3161('0x4a')]({'where':{'id':_0x26f13d[_0x3161('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d8d71,null))[_0x3161('0x26')](function(_0x1cb1dc){if(_0x1cb1dc){_0x4f98b1['model']=_['keys'](db['JscriptyQuestionReport'][_0x3161('0x4b')]);_0x4f98b1[_0x3161('0x31')]=_[_0x3161('0x32')](_0x26f13d['query']);_0x4f98b1[_0x3161('0x33')]=_[_0x3161('0x34')](_0x4f98b1[_0x3161('0x30')],_0x4f98b1[_0x3161('0x31')]);_0x32afde[_0x3161('0x35')]=_['intersection'](_0x4f98b1['model'],qs[_0x3161('0x36')](_0x26f13d[_0x3161('0x31')][_0x3161('0x36')]));_0x32afde[_0x3161('0x35')]=_0x32afde[_0x3161('0x35')][_0x3161('0x37')]?_0x32afde['attributes']:_0x4f98b1['model'];if(!_0x26f13d['query']['hasOwnProperty'](_0x3161('0x39'))){_0x32afde['limit']=qs[_0x3161('0x1f')](_0x26f13d[_0x3161('0x31')][_0x3161('0x1f')]);_0x32afde[_0x3161('0x1d')]=qs[_0x3161('0x1d')](_0x26f13d[_0x3161('0x31')]['offset']);}_0x32afde[_0x3161('0x3a')]=qs['sort'](_0x26f13d[_0x3161('0x31')]['sort']);_0x32afde[_0x3161('0x3c')]=qs[_0x3161('0x33')](_[_0x3161('0x3d')](_0x26f13d['query'],_0x4f98b1[_0x3161('0x33')]));_0x32afde['where'][_0x3161('0x4c')]=_0x1cb1dc['id'];if(_0x26f13d[_0x3161('0x31')]['filter']){_0x32afde['where']=_[_0x3161('0x3e')](_0x32afde[_0x3161('0x3c')],{'$or':_['map'](_0x32afde[_0x3161('0x35')],function(_0x4adebd){var _0x4626ab={};_0x4626ab[_0x4adebd]={'$like':'%'+_0x26f13d[_0x3161('0x31')][_0x3161('0x40')]+'%'};return _0x4626ab;})});}_0x32afde=_[_0x3161('0x3e')]({},_0x32afde,_0x26f13d[_0x3161('0x41')]);return db[_0x3161('0x4d')][_0x3161('0x20')]({'where':_0x32afde[_0x3161('0x3c')]})[_0x3161('0x26')](function(_0xd28400){_0x3780d4[_0x3161('0x20')]=_0xd28400;if(_0x26f13d['query'][_0x3161('0x42')]){_0x32afde['include']=[{'all':!![]}];}return db[_0x3161('0x4d')][_0x3161('0x4e')](_0x32afde);})[_0x3161('0x26')](function(_0x3d8882){_0x3780d4[_0x3161('0x4f')]=_0x3d8882;return _0x3780d4;});}})[_0x3161('0x26')](respondWithFilteredResult(_0x2d8d71,_0x32afde))[_0x3161('0x44')](handleError(_0x2d8d71,null));}; \ No newline at end of file +var _0x84aa=['map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','params','JscriptySessionReport','create','body','find','describe','getQuestions','findOne','pick','SessionId','JscriptyQuestionReport','findAll','eml-format','rimraf','fast-json-patch','moment','mustache','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index'];(function(_0x34f545,_0x2bd2ee){var _0x1ff6b8=function(_0x582e3b){while(--_0x582e3b){_0x34f545['push'](_0x34f545['shift']());}};_0x1ff6b8(++_0x2bd2ee);}(_0x84aa,0xb8));var _0xa84a=function(_0x197d78,_0x173a86){_0x197d78=_0x197d78-0x0;var _0x2468b2=_0x84aa[_0x197d78];return _0x2468b2;};'use strict';var emlformat=require(_0xa84a('0x0'));var rimraf=require(_0xa84a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa84a('0x2'));var rp=require('request-promise');var moment=require(_0xa84a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa84a('0x4'));var util=require('util');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(_0xa84a('0x5'));var squel=require(_0xa84a('0x6'));var crypto=require(_0xa84a('0x7'));var jsforce=require(_0xa84a('0x8'));var deskjs=require(_0xa84a('0x9'));var toCsv=require(_0xa84a('0xa'));var querystring=require(_0xa84a('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa84a('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xa84a('0xd'));var hardwareService=require(_0xa84a('0xe'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa84a('0xf'));var licenseUtil=require(_0xa84a('0x10'));var db=require(_0xa84a('0x11'))['db'];function respondWithStatusCode(_0x1c1115,_0x49eca2){_0x49eca2=_0x49eca2||0xcc;return function(_0x320e31){if(_0x320e31){return _0x1c1115[_0xa84a('0x12')](_0x49eca2);}return _0x1c1115[_0xa84a('0x13')](_0x49eca2)[_0xa84a('0x14')]();};}function respondWithResult(_0x246214,_0x24762a){_0x24762a=_0x24762a||0xc8;return function(_0x1cda24){if(_0x1cda24){return _0x246214[_0xa84a('0x13')](_0x24762a)[_0xa84a('0x15')](_0x1cda24);}};}function respondWithFilteredResult(_0x14b8bc,_0x2a3255){return function(_0x45ee3b){if(_0x45ee3b){var _0x58f08e=typeof _0x2a3255[_0xa84a('0x16')]===_0xa84a('0x17')&&typeof _0x2a3255[_0xa84a('0x18')]==='undefined';var _0x2d8fb3=_0x45ee3b[_0xa84a('0x19')];var _0x512d67=_0x58f08e?0x0:_0x2a3255[_0xa84a('0x16')];var _0x46a694=_0x58f08e?_0x45ee3b['count']:_0x2a3255['offset']+_0x2a3255[_0xa84a('0x18')];var _0x35b56f;if(_0x46a694>=_0x2d8fb3){_0x46a694=_0x2d8fb3;_0x35b56f=0xc8;}else{_0x35b56f=0xce;}_0x14b8bc[_0xa84a('0x13')](_0x35b56f);return _0x14b8bc[_0xa84a('0x1a')](_0xa84a('0x1b'),_0x512d67+'-'+_0x46a694+'/'+_0x2d8fb3)['json'](_0x45ee3b);}return null;};}function patchUpdates(_0x1e366a){return function(_0xd6506c){try{jsonpatch[_0xa84a('0x1c')](_0xd6506c,_0x1e366a,!![]);}catch(_0xf9f5e3){return BPromise[_0xa84a('0x1d')](_0xf9f5e3);}return _0xd6506c[_0xa84a('0x1e')]();};}function saveUpdates(_0xb58ba3,_0x4ef6d4){return function(_0x5c90e5){if(_0x5c90e5){return _0x5c90e5[_0xa84a('0x1f')](_0xb58ba3)[_0xa84a('0x20')](function(_0x5ea1c7){return _0x5ea1c7;});}return null;};}function removeEntity(_0x12bcc1,_0x2c2eaf){return function(_0x5f4c24){if(_0x5f4c24){return _0x5f4c24[_0xa84a('0x21')]()['then'](function(){_0x12bcc1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x570836,_0x351220){return function(_0x310fa8){if(!_0x310fa8){_0x570836['sendStatus'](0x194);}return _0x310fa8;};}function handleError(_0xfac1ea,_0x34911b){_0x34911b=_0x34911b||0x1f4;return function(_0x571d14){logger['error'](_0x571d14[_0xa84a('0x22')]);if(_0x571d14[_0xa84a('0x23')]){delete _0x571d14['name'];}_0xfac1ea['status'](_0x34911b)[_0xa84a('0x24')](_0x571d14);};}exports[_0xa84a('0x25')]=function(_0x41d4c5,_0x1f0ee0){var _0x2330ac={},_0xfaba8={},_0x232965={'count':0x0,'rows':[]};var _0x558547=_[_0xa84a('0x26')](db['JscriptySessionReport'][_0xa84a('0x27')],function(_0x226b23){return{'name':_0x226b23['fieldName'],'type':_0x226b23[_0xa84a('0x28')][_0xa84a('0x29')]};});_0xfaba8['model']=_[_0xa84a('0x26')](_0x558547,_0xa84a('0x23'));_0xfaba8[_0xa84a('0x2a')]=_[_0xa84a('0x2b')](_0x41d4c5[_0xa84a('0x2a')]);_0xfaba8[_0xa84a('0x2c')]=_[_0xa84a('0x2d')](_0xfaba8[_0xa84a('0x2e')],_0xfaba8['query']);_0x2330ac[_0xa84a('0x2f')]=_[_0xa84a('0x2d')](_0xfaba8[_0xa84a('0x2e')],qs[_0xa84a('0x30')](_0x41d4c5[_0xa84a('0x2a')][_0xa84a('0x30')]));_0x2330ac['attributes']=_0x2330ac['attributes'][_0xa84a('0x31')]?_0x2330ac[_0xa84a('0x2f')]:_0xfaba8[_0xa84a('0x2e')];if(!_0x41d4c5[_0xa84a('0x2a')][_0xa84a('0x32')](_0xa84a('0x33'))){_0x2330ac[_0xa84a('0x18')]=qs['limit'](_0x41d4c5[_0xa84a('0x2a')][_0xa84a('0x18')]);_0x2330ac['offset']=qs[_0xa84a('0x16')](_0x41d4c5['query'][_0xa84a('0x16')]);}_0x2330ac[_0xa84a('0x34')]=qs['sort'](_0x41d4c5['query'][_0xa84a('0x35')]);_0x2330ac[_0xa84a('0x36')]=qs[_0xa84a('0x2c')](_['pick'](_0x41d4c5[_0xa84a('0x2a')],_0xfaba8[_0xa84a('0x2c')]),_0x558547);if(_0x41d4c5['query'][_0xa84a('0x37')]){_0x2330ac['where']=_[_0xa84a('0x38')](_0x2330ac[_0xa84a('0x36')],{'$or':_[_0xa84a('0x26')](_0x558547,function(_0x2e645d){if(_0x2e645d[_0xa84a('0x28')]!=='VIRTUAL'){var _0x44e13c={};_0x44e13c[_0x2e645d['name']]={'$like':'%'+_0x41d4c5[_0xa84a('0x2a')][_0xa84a('0x37')]+'%'};return _0x44e13c;}})});}_0x2330ac=_[_0xa84a('0x38')]({},_0x2330ac,_0x41d4c5[_0xa84a('0x39')]);var _0x364cdc={'where':_0x2330ac[_0xa84a('0x36')]};return db['JscriptySessionReport'][_0xa84a('0x19')](_0x364cdc)[_0xa84a('0x20')](function(_0x265a3f){_0x232965[_0xa84a('0x19')]=_0x265a3f;if(_0x41d4c5[_0xa84a('0x2a')][_0xa84a('0x3a')]){_0x2330ac[_0xa84a('0x3b')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x2330ac);})[_0xa84a('0x20')](function(_0x596c9e){_0x232965[_0xa84a('0x3c')]=_0x596c9e;return _0x232965;})[_0xa84a('0x20')](respondWithFilteredResult(_0x1f0ee0,_0x2330ac))[_0xa84a('0x3d')](handleError(_0x1f0ee0,null));};exports['show']=function(_0x44c410,_0x22ac68){var _0x1b59c5={'raw':!![],'where':{'id':_0x44c410[_0xa84a('0x3e')]['id']}},_0x5af659={};_0x5af659[_0xa84a('0x2e')]=_[_0xa84a('0x2b')](db['JscriptySessionReport'][_0xa84a('0x27')]);_0x5af659[_0xa84a('0x2a')]=_['keys'](_0x44c410[_0xa84a('0x2a')]);_0x5af659[_0xa84a('0x2c')]=_[_0xa84a('0x2d')](_0x5af659[_0xa84a('0x2e')],_0x5af659[_0xa84a('0x2a')]);_0x1b59c5['attributes']=_[_0xa84a('0x2d')](_0x5af659[_0xa84a('0x2e')],qs[_0xa84a('0x30')](_0x44c410[_0xa84a('0x2a')][_0xa84a('0x30')]));_0x1b59c5[_0xa84a('0x2f')]=_0x1b59c5[_0xa84a('0x2f')][_0xa84a('0x31')]?_0x1b59c5[_0xa84a('0x2f')]:_0x5af659['model'];if(_0x44c410[_0xa84a('0x2a')][_0xa84a('0x3a')]){_0x1b59c5[_0xa84a('0x3b')]=[{'all':!![]}];}_0x1b59c5=_[_0xa84a('0x38')]({},_0x1b59c5,_0x44c410[_0xa84a('0x39')]);return db[_0xa84a('0x3f')]['find'](_0x1b59c5)[_0xa84a('0x20')](handleEntityNotFound(_0x22ac68,null))[_0xa84a('0x20')](respondWithResult(_0x22ac68,null))[_0xa84a('0x3d')](handleError(_0x22ac68,null));};exports[_0xa84a('0x40')]=function(_0x1564c5,_0x55988a){return db[_0xa84a('0x3f')]['create'](_0x1564c5['body'],{})[_0xa84a('0x20')](respondWithResult(_0x55988a,0xc9))['catch'](handleError(_0x55988a,null));};exports[_0xa84a('0x1f')]=function(_0x5d8f21,_0x3fcb1d){if(_0x5d8f21[_0xa84a('0x41')]['id']){delete _0x5d8f21[_0xa84a('0x41')]['id'];}return db[_0xa84a('0x3f')][_0xa84a('0x42')]({'where':{'id':_0x5d8f21['params']['id']}})[_0xa84a('0x20')](handleEntityNotFound(_0x3fcb1d,null))['then'](saveUpdates(_0x5d8f21['body'],null))[_0xa84a('0x20')](respondWithResult(_0x3fcb1d,null))[_0xa84a('0x3d')](handleError(_0x3fcb1d,null));};exports[_0xa84a('0x21')]=function(_0x2a0592,_0x274998){return db[_0xa84a('0x3f')]['find']({'where':{'id':_0x2a0592[_0xa84a('0x3e')]['id']}})[_0xa84a('0x20')](handleEntityNotFound(_0x274998,null))[_0xa84a('0x20')](removeEntity(_0x274998,null))[_0xa84a('0x3d')](handleError(_0x274998,null));};exports['describe']=function(_0x58393a,_0x924d4a){return db[_0xa84a('0x3f')][_0xa84a('0x43')]()[_0xa84a('0x20')](respondWithResult(_0x924d4a,null))['catch'](handleError(_0x924d4a,null));};exports[_0xa84a('0x44')]=function(_0x88d900,_0x2a4cb9,_0x550c0e){var _0x2e543e={'raw':!![],'where':{}};var _0x51273e={};var _0xa9842d={'count':0x0,'rows':[]};return db[_0xa84a('0x3f')][_0xa84a('0x45')]({'where':{'id':_0x88d900[_0xa84a('0x3e')]['id']}})[_0xa84a('0x20')](handleEntityNotFound(_0x2a4cb9,null))['then'](function(_0x2979bb){if(_0x2979bb){_0x51273e['model']=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0x51273e['query']=_[_0xa84a('0x2b')](_0x88d900[_0xa84a('0x2a')]);_0x51273e[_0xa84a('0x2c')]=_[_0xa84a('0x2d')](_0x51273e[_0xa84a('0x2e')],_0x51273e[_0xa84a('0x2a')]);_0x2e543e[_0xa84a('0x2f')]=_[_0xa84a('0x2d')](_0x51273e[_0xa84a('0x2e')],qs[_0xa84a('0x30')](_0x88d900[_0xa84a('0x2a')][_0xa84a('0x30')]));_0x2e543e['attributes']=_0x2e543e[_0xa84a('0x2f')][_0xa84a('0x31')]?_0x2e543e[_0xa84a('0x2f')]:_0x51273e['model'];if(!_0x88d900[_0xa84a('0x2a')][_0xa84a('0x32')](_0xa84a('0x33'))){_0x2e543e[_0xa84a('0x18')]=qs['limit'](_0x88d900['query'][_0xa84a('0x18')]);_0x2e543e[_0xa84a('0x16')]=qs[_0xa84a('0x16')](_0x88d900['query']['offset']);}_0x2e543e['order']=qs[_0xa84a('0x35')](_0x88d900['query'][_0xa84a('0x35')]);_0x2e543e['where']=qs[_0xa84a('0x2c')](_[_0xa84a('0x46')](_0x88d900['query'],_0x51273e[_0xa84a('0x2c')]));_0x2e543e[_0xa84a('0x36')][_0xa84a('0x47')]=_0x2979bb['id'];if(_0x88d900[_0xa84a('0x2a')]['filter']){_0x2e543e[_0xa84a('0x36')]=_['merge'](_0x2e543e[_0xa84a('0x36')],{'$or':_[_0xa84a('0x26')](_0x2e543e['attributes'],function(_0x5892c4){var _0x27c825={};_0x27c825[_0x5892c4]={'$like':'%'+_0x88d900[_0xa84a('0x2a')][_0xa84a('0x37')]+'%'};return _0x27c825;})});}_0x2e543e=_[_0xa84a('0x38')]({},_0x2e543e,_0x88d900[_0xa84a('0x39')]);return db[_0xa84a('0x48')]['count']({'where':_0x2e543e['where']})[_0xa84a('0x20')](function(_0x55f2a0){_0xa9842d[_0xa84a('0x19')]=_0x55f2a0;if(_0x88d900['query'][_0xa84a('0x3a')]){_0x2e543e[_0xa84a('0x3b')]=[{'all':!![]}];}return db[_0xa84a('0x48')][_0xa84a('0x49')](_0x2e543e);})[_0xa84a('0x20')](function(_0x260c8b){_0xa9842d['rows']=_0x260c8b;return _0xa9842d;});}})['then'](respondWithFilteredResult(_0x2a4cb9,_0x2e543e))[_0xa84a('0x3d')](handleError(_0x2a4cb9,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index f07757a..b82a1d5 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 _0xeff8=['rimraf','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','lodash','util','api','moment','bluebird','path'];(function(_0x32b207,_0x39f76c){var _0x94d027=function(_0x5b73d8){while(--_0x5b73d8){_0x32b207['push'](_0x32b207['shift']());}};_0x94d027(++_0x39f76c);}(_0xeff8,0x186));var _0x8eff=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0xeff8[_0x5d7227];return _0x15ac55;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf69d=['report_jscripty_sessions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0xf69d,0xd3));var _0xdf69=function(_0x2769ec,_0x4da9aa){_0x2769ec=_0x2769ec-0x0;var _0x2f7bbe=_0xf69d[_0x2769ec];return _0x2f7bbe;};'use strict';var _=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var logger=require(_0xdf69('0x2'))(_0xdf69('0x3'));var moment=require(_0xdf69('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf69('0x5'));var fs=require('fs');var path=require(_0xdf69('0x6'));var rimraf=require(_0xdf69('0x7'));var config=require(_0xdf69('0x8'));var attributes=require(_0xdf69('0x9'));module[_0xdf69('0xa')]=function(_0x2d456f,_0x465b1b){return _0x2d456f[_0xdf69('0xb')](_0xdf69('0xc'),attributes,{'tableName':_0xdf69('0xd'),'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 bf1444f..eaf0ac1 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0120=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x700205,_0x2772c4){var _0x251fd4=function(_0x392325){while(--_0x392325){_0x700205['push'](_0x700205['shift']());}};_0x251fd4(++_0x2772c4);}(_0x0120,0x6f));var _0x0012=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x0120[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59980a,_0x95d441,_0x436af8){return new BPromise(function(_0x3d4c64,_0x30176d){return client[_0x0012('0xc')](_0x59980a,_0x436af8)['then'](function(_0x14991f){logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));logger['debug'](_0x0012('0x10'),_0x95d441,'request\x20sent',JSON[_0x0012('0x11')](_0x14991f));if(_0x14991f[_0x0012('0x12')]){if(_0x14991f[_0x0012('0x12')][_0x0012('0x13')]===0x1f4){logger[_0x0012('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x95d441,_0x14991f[_0x0012('0x12')]['message']);return _0x30176d(_0x14991f['error']['message']);}logger['error'](_0x0012('0xe'),_0x95d441,_0x14991f['error'][_0x0012('0x14')]);return _0x3d4c64(_0x14991f[_0x0012('0x12')]['message']);}else{logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));_0x3d4c64(_0x14991f[_0x0012('0x15')]['message']);}})['catch'](function(_0x1e7fbe){logger[_0x0012('0x12')](_0x0012('0xe'),_0x95d441,_0x1e7fbe);_0x30176d(_0x1e7fbe);});});} \ No newline at end of file +var _0x57ca=['client','http','request','info','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x321e62,_0x40d1b2){var _0x1d1334=function(_0xddb750){while(--_0xddb750){_0x321e62['push'](_0x321e62['shift']());}};_0x1d1334(++_0x40d1b2);}(_0x57ca,0x108));var _0xa57c=function(_0x2b1d65,_0x48391d){_0x2b1d65=_0x2b1d65-0x0;var _0x4453fb=_0x57ca[_0x2b1d65];return _0x4453fb;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index f7a3c0b..7e7b074 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 _0x10a8=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','downloadLogFile'];(function(_0x354b49,_0x1626fc){var _0x2e5754=function(_0x3acfc1){while(--_0x3acfc1){_0x354b49['push'](_0x354b49['shift']());}};_0x2e5754(++_0x1626fc);}(_0x10a8,0x1ee));var _0x810a=function(_0x1ff3e8,_0x427e2e){_0x1ff3e8=_0x1ff3e8-0x0;var _0x2ec3f0=_0x10a8[_0x1ff3e8];return _0x2ec3f0;};'use strict';var multer=require(_0x810a('0x0'));var util=require('util');var path=require(_0x810a('0x1'));var timeout=require(_0x810a('0x2'));var express=require(_0x810a('0x3'));var router=express[_0x810a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x810a('0x5'));var interaction=require(_0x810a('0x6'));var config=require(_0x810a('0x7'));var controller=require(_0x810a('0x8'));router[_0x810a('0x9')]('/',controller[_0x810a('0xa')]);router[_0x810a('0xb')](_0x810a('0xc'),auth[_0x810a('0xd')](),controller[_0x810a('0xe')]);router[_0x810a('0x9')]('/download_log_file',auth[_0x810a('0xd')](),controller[_0x810a('0xf')]);module[_0x810a('0x10')]=router; \ No newline at end of file +var _0x217c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','/download_log_file','downloadLogFile','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3795e9,_0x3ca153){var _0x58d50e=function(_0x1f764a){while(--_0x1f764a){_0x3795e9['push'](_0x3795e9['shift']());}};_0x58d50e(++_0x3ca153);}(_0x217c,0xca));var _0xc217=function(_0x436224,_0x18826f){_0x436224=_0x436224-0x0;var _0x1d578a=_0x217c[_0x436224];return _0x1d578a;};'use strict';var multer=require('multer');var util=require(_0xc217('0x0'));var path=require(_0xc217('0x1'));var timeout=require(_0xc217('0x2'));var express=require(_0xc217('0x3'));var router=express[_0xc217('0x4')]();var fs_extra=require(_0xc217('0x5'));var auth=require(_0xc217('0x6'));var interaction=require(_0xc217('0x7'));var config=require(_0xc217('0x8'));var controller=require(_0xc217('0x9'));router[_0xc217('0xa')]('/',controller[_0xc217('0xb')]);router['put'](_0xc217('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xc217('0xa')](_0xc217('0xd'),auth['isAuthenticated'](),controller[_0xc217('0xe')]);module[_0xc217('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 a6da00d..1a9be1d 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 _0x798a=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x205867,_0x2ab803){var _0x1b0374=function(_0x3ee3ac){while(--_0x3ee3ac){_0x205867['push'](_0x205867['shift']());}};_0x1b0374(++_0x2ab803);}(_0x798a,0x8f));var _0xa798=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x798a[_0x36884e];return _0x1cc367;};'use strict';var Sequelize=require(_0xa798('0x0'));module[_0xa798('0x1')]={'license':{'type':Sequelize[_0xa798('0x2')]},'data1':{'type':Sequelize[_0xa798('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xa798('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2341=['TEXT','STRING','INTEGER'];(function(_0x123304,_0xa616ee){var _0x14cd86=function(_0xfe7df2){while(--_0xfe7df2){_0x123304['push'](_0x123304['shift']());}};_0x14cd86(++_0xa616ee);}(_0x2341,0x1e3));var _0x1234=function(_0x4be5b7,_0x262aaf){_0x4be5b7=_0x4be5b7-0x0;var _0x2e1836=_0x2341[_0x4be5b7];return _0x2e1836;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0x1234('0x0')]},'data1':{'type':Sequelize[_0x1234('0x1')]},'data2':{'type':Sequelize[_0x1234('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x1234('0x2')],'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 bdaae53..d369081 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 _0xbdc0=['crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','end','error','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','options','catch','update','body','find','get','demo','downloadLogFile','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel'];(function(_0x1582ba,_0x1a027f){var _0x714be6=function(_0x380434){while(--_0x380434){_0x1582ba['push'](_0x1582ba['shift']());}};_0x714be6(++_0x1a027f);}(_0xbdc0,0x1c2));var _0x0bdc=function(_0x321135,_0x456a6b){_0x321135=_0x321135-0x0;var _0x3e9c0c=_0xbdc0[_0x321135];return _0x3e9c0c;};'use strict';var emlformat=require(_0x0bdc('0x0'));var rimraf=require(_0x0bdc('0x1'));var zipdir=require(_0x0bdc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bdc('0x3'));var moment=require(_0x0bdc('0x4'));var BPromise=require(_0x0bdc('0x5'));var Mustache=require(_0x0bdc('0x6'));var util=require(_0x0bdc('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bdc('0x8'));var fs=require('fs');var fs_extra=require(_0x0bdc('0x9'));var _=require(_0x0bdc('0xa'));var squel=require(_0x0bdc('0xb'));var crypto=require(_0x0bdc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0bdc('0xd'));var toCsv=require(_0x0bdc('0xe'));var querystring=require(_0x0bdc('0xf'));var Papa=require(_0x0bdc('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0bdc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0bdc('0x12'))(_0x0bdc('0x13'));var utils=require(_0x0bdc('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0bdc('0x15'))['db'];function respondWithStatusCode(_0x24b5b0,_0x5674d8){_0x5674d8=_0x5674d8||0xcc;return function(_0x14d15c){if(_0x14d15c){return _0x24b5b0[_0x0bdc('0x16')](_0x5674d8);}return _0x24b5b0[_0x0bdc('0x17')](_0x5674d8)['end']();};}function respondWithResult(_0x954f60,_0x2773b0){_0x2773b0=_0x2773b0||0xc8;return function(_0x2f2224){if(_0x2f2224){return _0x954f60[_0x0bdc('0x17')](_0x2773b0)['json'](_0x2f2224);}};}function respondWithFilteredResult(_0x394cfb,_0x18a2cd){return function(_0x210b2f){if(_0x210b2f){var _0xa862eb=typeof _0x18a2cd[_0x0bdc('0x18')]===_0x0bdc('0x19')&&typeof _0x18a2cd[_0x0bdc('0x1a')]==='undefined';var _0x55a1db=_0x210b2f[_0x0bdc('0x1b')];var _0xffa9e4=_0xa862eb?0x0:_0x18a2cd[_0x0bdc('0x18')];var _0x4dd329=_0xa862eb?_0x210b2f[_0x0bdc('0x1b')]:_0x18a2cd[_0x0bdc('0x18')]+_0x18a2cd['limit'];var _0x3967cf;if(_0x4dd329>=_0x55a1db){_0x4dd329=_0x55a1db;_0x3967cf=0xc8;}else{_0x3967cf=0xce;}_0x394cfb['status'](_0x3967cf);return _0x394cfb[_0x0bdc('0x1c')]('Content-Range',_0xffa9e4+'-'+_0x4dd329+'/'+_0x55a1db)[_0x0bdc('0x1d')](_0x210b2f);}return null;};}function patchUpdates(_0x1bf9d5){return function(_0x4fd584){try{jsonpatch[_0x0bdc('0x1e')](_0x4fd584,_0x1bf9d5,!![]);}catch(_0xef836d){return BPromise[_0x0bdc('0x1f')](_0xef836d);}return _0x4fd584[_0x0bdc('0x20')]();};}function saveUpdates(_0x16e728,_0x1897a2){return function(_0xbf644a){if(_0xbf644a){return _0xbf644a['update'](_0x16e728)[_0x0bdc('0x21')](function(_0x22248e){return _0x22248e;});}return null;};}function removeEntity(_0x5876ac,_0x12fe30){return function(_0x147389){if(_0x147389){return _0x147389[_0x0bdc('0x22')]()[_0x0bdc('0x21')](function(){_0x5876ac[_0x0bdc('0x17')](0xcc)[_0x0bdc('0x23')]();});}};}function handleEntityNotFound(_0x16944a,_0xbb3e3f){return function(_0x256d39){if(!_0x256d39){_0x16944a[_0x0bdc('0x16')](0x194);}return _0x256d39;};}function handleError(_0x3a3f5e,_0xeb0b0d){_0xeb0b0d=_0xeb0b0d||0x1f4;return function(_0x1854b0){logger[_0x0bdc('0x24')](_0x1854b0['stack']);if(_0x1854b0['name']){delete _0x1854b0[_0x0bdc('0x25')];}_0x3a3f5e[_0x0bdc('0x17')](_0xeb0b0d)[_0x0bdc('0x26')](_0x1854b0);};}var utilLicense=require('../../config/license/util');exports[_0x0bdc('0x27')]=function(_0x3548eb,_0x426808){var _0x4ae2ec={'raw':!![],'where':{'id':0x1}},_0x207331={};_0x207331[_0x0bdc('0x28')]=_[_0x0bdc('0x29')](db[_0x0bdc('0x2a')][_0x0bdc('0x2b')]);_0x207331['query']=_[_0x0bdc('0x29')](_0x3548eb[_0x0bdc('0x2c')]);_0x207331[_0x0bdc('0x2d')]=_[_0x0bdc('0x2e')](_0x207331[_0x0bdc('0x28')],_0x207331[_0x0bdc('0x2c')]);_0x4ae2ec[_0x0bdc('0x2f')]=_[_0x0bdc('0x2e')](_0x207331[_0x0bdc('0x28')],qs[_0x0bdc('0x30')](_0x3548eb[_0x0bdc('0x2c')][_0x0bdc('0x30')]));_0x4ae2ec[_0x0bdc('0x2f')]=_0x4ae2ec[_0x0bdc('0x2f')]['length']?_0x4ae2ec[_0x0bdc('0x2f')]:_0x207331[_0x0bdc('0x28')];_0x4ae2ec=_['merge']({},_0x4ae2ec,_0x3548eb[_0x0bdc('0x31')]);return utilLicense['getLicense'](_0x4ae2ec)[_0x0bdc('0x21')](respondWithResult(_0x426808,null))[_0x0bdc('0x32')](handleError(_0x426808,null));};exports[_0x0bdc('0x33')]=function(_0x4c8a60,_0x3303d8){if(_0x4c8a60[_0x0bdc('0x34')]['id']){delete _0x4c8a60[_0x0bdc('0x34')]['id'];}return db[_0x0bdc('0x2a')][_0x0bdc('0x35')]({'where':{'id':_0x4c8a60['params']['id']}})[_0x0bdc('0x21')](handleEntityNotFound(_0x3303d8,null))[_0x0bdc('0x21')](function(_0x4edd27){var _0x56bf90=_0x4edd27[_0x0bdc('0x36')]({'plain':!![]});return utilLicense['checkLicense'](_0x56bf90,_0x4c8a60['body']['key']);})[_0x0bdc('0x21')](function(_0x3ab2ef){if(!_0x3ab2ef[_0x0bdc('0x37')]){return saveUpdates(_0x4c8a60[_0x0bdc('0x34')],null);}return _0x3ab2ef;})['then'](respondWithResult(_0x3303d8,null))['catch'](handleError(_0x3303d8,null));};exports[_0x0bdc('0x38')]=function(_0x3c15ec,_0x4980a8){var _0x5939f2='license-info.log';var _0x52cbd1=path[_0x0bdc('0x39')](_0x0bdc('0x3a'),_0x0bdc('0x3b'),_0x0bdc('0x3c'),_0x5939f2);_0x4980a8[_0x0bdc('0x3d')](_0x0bdc('0x3e'),_0x0bdc('0x3f')+_0x5939f2);_0x4980a8[_0x0bdc('0x1c')](_0x0bdc('0x40'),_0x0bdc('0x41'));_0x4980a8['download'](_0x52cbd1);}; \ No newline at end of file +var _0x048c=['length','merge','options','body','params','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','log','xcally','setHeader','attachment;\x20filename=','text/plain','download','eml-format','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','undefined','offset','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','model','rawAttributes','query','keys','intersection','attributes','fields'];(function(_0x4d00ac,_0x514399){var _0xc91d8e=function(_0x5990cf){while(--_0x5990cf){_0x4d00ac['push'](_0x4d00ac['shift']());}};_0xc91d8e(++_0x514399);}(_0x048c,0xdb));var _0xc048=function(_0x7b068b,_0x3858dd){_0x7b068b=_0x7b068b-0x0;var _0xd1e78c=_0x048c[_0x7b068b];return _0xd1e78c;};'use strict';var emlformat=require(_0xc048('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc048('0x1'));var rp=require('request-promise');var moment=require(_0xc048('0x2'));var BPromise=require(_0xc048('0x3'));var Mustache=require('mustache');var util=require(_0xc048('0x4'));var path=require(_0xc048('0x5'));var sox=require(_0xc048('0x6'));var csv=require(_0xc048('0x7'));var ejs=require(_0xc048('0x8'));var fs=require('fs');var fs_extra=require(_0xc048('0x9'));var _=require(_0xc048('0xa'));var squel=require(_0xc048('0xb'));var crypto=require('crypto');var jsforce=require(_0xc048('0xc'));var deskjs=require(_0xc048('0xd'));var toCsv=require(_0xc048('0x7'));var querystring=require(_0xc048('0xe'));var Papa=require(_0xc048('0xf'));var Redis=require(_0xc048('0x10'));var authService=require(_0xc048('0x11'));var qs=require(_0xc048('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc048('0x13'));var logger=require(_0xc048('0x14'))(_0xc048('0x15'));var utils=require(_0xc048('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc048('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x215da1,_0x51bb57){_0x51bb57=_0x51bb57||0xcc;return function(_0x44e03f){if(_0x44e03f){return _0x215da1[_0xc048('0x18')](_0x51bb57);}return _0x215da1[_0xc048('0x19')](_0x51bb57)[_0xc048('0x1a')]();};}function respondWithResult(_0x3c0a79,_0x3c7e07){_0x3c7e07=_0x3c7e07||0xc8;return function(_0x20b0bc){if(_0x20b0bc){return _0x3c0a79[_0xc048('0x19')](_0x3c7e07)[_0xc048('0x1b')](_0x20b0bc);}};}function respondWithFilteredResult(_0x180a5b,_0x1505ef){return function(_0x7a8ac6){if(_0x7a8ac6){var _0x17f007=typeof _0x1505ef['offset']==='undefined'&&typeof _0x1505ef[_0xc048('0x1c')]===_0xc048('0x1d');var _0x193a74=_0x7a8ac6['count'];var _0xb76ff8=_0x17f007?0x0:_0x1505ef[_0xc048('0x1e')];var _0x32d229=_0x17f007?_0x7a8ac6['count']:_0x1505ef[_0xc048('0x1e')]+_0x1505ef[_0xc048('0x1c')];var _0x11531b;if(_0x32d229>=_0x193a74){_0x32d229=_0x193a74;_0x11531b=0xc8;}else{_0x11531b=0xce;}_0x180a5b[_0xc048('0x19')](_0x11531b);return _0x180a5b['set'](_0xc048('0x1f'),_0xb76ff8+'-'+_0x32d229+'/'+_0x193a74)['json'](_0x7a8ac6);}return null;};}function patchUpdates(_0x2efc0b){return function(_0x3d55fb){try{jsonpatch['apply'](_0x3d55fb,_0x2efc0b,!![]);}catch(_0x49bdc4){return BPromise[_0xc048('0x20')](_0x49bdc4);}return _0x3d55fb[_0xc048('0x21')]();};}function saveUpdates(_0x401bb5,_0x58973c){return function(_0x2ba571){if(_0x2ba571){return _0x2ba571[_0xc048('0x22')](_0x401bb5)['then'](function(_0x1a854d){return _0x1a854d;});}return null;};}function removeEntity(_0x35160c,_0xa2a309){return function(_0x4f4d3c){if(_0x4f4d3c){return _0x4f4d3c[_0xc048('0x23')]()[_0xc048('0x24')](function(){_0x35160c['status'](0xcc)[_0xc048('0x1a')]();});}};}function handleEntityNotFound(_0x44c3a0,_0x23c014){return function(_0xf2b8f3){if(!_0xf2b8f3){_0x44c3a0[_0xc048('0x18')](0x194);}return _0xf2b8f3;};}function handleError(_0x18a03a,_0x24b4e6){_0x24b4e6=_0x24b4e6||0x1f4;return function(_0x41de32){logger[_0xc048('0x25')](_0x41de32[_0xc048('0x26')]);if(_0x41de32['name']){delete _0x41de32[_0xc048('0x27')];}_0x18a03a['status'](_0x24b4e6)[_0xc048('0x28')](_0x41de32);};}var utilLicense=require(_0xc048('0x17'));exports[_0xc048('0x29')]=function(_0x1cda79,_0x3a421a){var _0x338747={'raw':!![],'where':{'id':0x1}},_0xd1883e={};_0xd1883e[_0xc048('0x2a')]=_['keys'](db['License'][_0xc048('0x2b')]);_0xd1883e[_0xc048('0x2c')]=_[_0xc048('0x2d')](_0x1cda79[_0xc048('0x2c')]);_0xd1883e['filters']=_[_0xc048('0x2e')](_0xd1883e[_0xc048('0x2a')],_0xd1883e[_0xc048('0x2c')]);_0x338747[_0xc048('0x2f')]=_['intersection'](_0xd1883e[_0xc048('0x2a')],qs[_0xc048('0x30')](_0x1cda79[_0xc048('0x2c')]['fields']));_0x338747['attributes']=_0x338747[_0xc048('0x2f')][_0xc048('0x31')]?_0x338747[_0xc048('0x2f')]:_0xd1883e['model'];_0x338747=_[_0xc048('0x32')]({},_0x338747,_0x1cda79[_0xc048('0x33')]);return utilLicense['getLicense'](_0x338747)[_0xc048('0x24')](respondWithResult(_0x3a421a,null))['catch'](handleError(_0x3a421a,null));};exports[_0xc048('0x22')]=function(_0x2f76ca,_0x936c5b){if(_0x2f76ca[_0xc048('0x34')]['id']){delete _0x2f76ca[_0xc048('0x34')]['id'];}return db['License']['find']({'where':{'id':_0x2f76ca[_0xc048('0x35')]['id']}})[_0xc048('0x24')](handleEntityNotFound(_0x936c5b,null))[_0xc048('0x24')](function(_0xaa4df4){var _0x5ae51e=_0xaa4df4[_0xc048('0x36')]({'plain':!![]});return utilLicense[_0xc048('0x37')](_0x5ae51e,_0x2f76ca[_0xc048('0x34')][_0xc048('0x38')]);})[_0xc048('0x24')](function(_0x29fb95){if(!_0x29fb95[_0xc048('0x39')]){return saveUpdates(_0x2f76ca[_0xc048('0x34')],null);}return _0x29fb95;})[_0xc048('0x24')](respondWithResult(_0x936c5b,null))['catch'](handleError(_0x936c5b,null));};exports[_0xc048('0x3a')]=function(_0x5ca49e,_0x366e9c){var _0x443781=_0xc048('0x3b');var _0x3b62f4=path[_0xc048('0x3c')]('/var',_0xc048('0x3d'),_0xc048('0x3e'),_0x443781);_0x366e9c[_0xc048('0x3f')]('Content-disposition',_0xc048('0x40')+_0x443781);_0x366e9c['set']('Content-Type',_0xc048('0x41'));_0x366e9c[_0xc048('0x42')](_0x3b62f4);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 099366a..0ed114b 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 _0x5828=['./license.attributes','License','license','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x418d65,_0x69d05c){var _0x3bb5e4=function(_0x43b92b){while(--_0x43b92b){_0x418d65['push'](_0x418d65['shift']());}};_0x3bb5e4(++_0x69d05c);}(_0x5828,0xea));var _0x8582=function(_0x57e35f,_0x2d3adc){_0x57e35f=_0x57e35f-0x0;var _0x17ea9f=_0x5828[_0x57e35f];return _0x17ea9f;};'use strict';var _=require(_0x8582('0x0'));var util=require(_0x8582('0x1'));var logger=require(_0x8582('0x2'))(_0x8582('0x3'));var moment=require(_0x8582('0x4'));var BPromise=require(_0x8582('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8582('0x6'));var rimraf=require('rimraf');var config=require(_0x8582('0x7'));var attributes=require(_0x8582('0x8'));module['exports']=function(_0x5c4e74,_0x5da159){return _0x5c4e74['define'](_0x8582('0x9'),attributes,{'tableName':_0x8582('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc39e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./license.attributes','exports','define','License','license','util'];(function(_0xe1e4a,_0x588c43){var _0x449048=function(_0x3749a7){while(--_0x3749a7){_0xe1e4a['push'](_0xe1e4a['shift']());}};_0x449048(++_0x588c43);}(_0xc39e,0x1b9));var _0xec39=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0xc39e[_0x18f152];return _0xa10b34;};'use strict';var _=require('lodash');var util=require(_0xec39('0x0'));var logger=require(_0xec39('0x1'))(_0xec39('0x2'));var moment=require(_0xec39('0x3'));var BPromise=require(_0xec39('0x4'));var rp=require(_0xec39('0x5'));var fs=require('fs');var path=require(_0xec39('0x6'));var rimraf=require(_0xec39('0x7'));var config=require('../../config/environment');var attributes=require(_0xec39('0x8'));module[_0xec39('0x9')]=function(_0x56b121,_0x58457a){return _0x56b121[_0xec39('0xa')](_0xec39('0xb'),attributes,{'tableName':_0xec39('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index a034bf0..8c377fe 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 _0xab8b=['then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0xab8b,0xe7));var _0xbab8=function(_0x4a38f4,_0x788125){_0x4a38f4=_0x4a38f4-0x0;var _0x5753f0=_0xab8b[_0x4a38f4];return _0x5753f0;};'use strict';var _=require('lodash');var util=require(_0xbab8('0x0'));var moment=require(_0xbab8('0x1'));var BPromise=require(_0xbab8('0x2'));var rs=require(_0xbab8('0x3'));var fs=require('fs');var Redis=require(_0xbab8('0x4'));var db=require(_0xbab8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbab8('0x6'))(_0xbab8('0x7'));var config=require('../../config/environment');var jayson=require(_0xbab8('0x8'));var client=jayson[_0xbab8('0x9')][_0xbab8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5abfd9,_0x357993,_0x10b09a){return new BPromise(function(_0x336c17,_0x4902f9){return client['request'](_0x5abfd9,_0x10b09a)[_0xbab8('0xb')](function(_0x9430b2){logger[_0xbab8('0xc')]('License,\x20%s,\x20%s',_0x357993,_0xbab8('0xd'));logger[_0xbab8('0xe')](_0xbab8('0xf'),_0x357993,'request\x20sent',JSON[_0xbab8('0x10')](_0x9430b2));if(_0x9430b2['error']){if(_0x9430b2[_0xbab8('0x11')][_0xbab8('0x12')]===0x1f4){logger[_0xbab8('0x11')](_0xbab8('0x13'),_0x357993,_0x9430b2[_0xbab8('0x11')][_0xbab8('0x14')]);return _0x4902f9(_0x9430b2['error'][_0xbab8('0x14')]);}logger['error']('License,\x20%s,\x20%s',_0x357993,_0x9430b2['error'][_0xbab8('0x14')]);return _0x336c17(_0x9430b2[_0xbab8('0x11')][_0xbab8('0x14')]);}else{logger[_0xbab8('0xc')](_0xbab8('0x13'),_0x357993,_0xbab8('0xd'));_0x336c17(_0x9430b2['result']['message']);}})[_0xbab8('0x15')](function(_0x50f6c3){logger['error']('License,\x20%s,\x20%s',_0x357993,_0x50f6c3);_0x4902f9(_0x50f6c3);});});} \ No newline at end of file +var _0xd834=['jayson/promise','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x4cda3b,_0x29b607){var _0x709570=function(_0x41c115){while(--_0x41c115){_0x4cda3b['push'](_0x4cda3b['shift']());}};_0x709570(++_0x29b607);}(_0xd834,0x1b0));var _0x4d83=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd834[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x4d83('0x0'));var util=require(_0x4d83('0x1'));var moment=require(_0x4d83('0x2'));var BPromise=require(_0x4d83('0x3'));var rs=require(_0x4d83('0x4'));var fs=require('fs');var Redis=require(_0x4d83('0x5'));var db=require(_0x4d83('0x6'))['db'];var utils=require(_0x4d83('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x4d83('0x8'));var jayson=require(_0x4d83('0x9'));var client=jayson['client'][_0x4d83('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x150e18,_0x1407fb,_0x313c43){return new BPromise(function(_0x30d7f8,_0x223623){return client[_0x4d83('0xb')](_0x150e18,_0x313c43)[_0x4d83('0xc')](function(_0x2716fc){logger['info'](_0x4d83('0xd'),_0x1407fb,_0x4d83('0xe'));logger[_0x4d83('0xf')]('License,\x20%s,\x20%s,\x20%s',_0x1407fb,_0x4d83('0xe'),JSON['stringify'](_0x2716fc));if(_0x2716fc['error']){if(_0x2716fc[_0x4d83('0x10')][_0x4d83('0x11')]===0x1f4){logger[_0x4d83('0x10')](_0x4d83('0xd'),_0x1407fb,_0x2716fc[_0x4d83('0x10')]['message']);return _0x223623(_0x2716fc[_0x4d83('0x10')]['message']);}logger[_0x4d83('0x10')](_0x4d83('0xd'),_0x1407fb,_0x2716fc[_0x4d83('0x10')][_0x4d83('0x12')]);return _0x30d7f8(_0x2716fc[_0x4d83('0x10')][_0x4d83('0x12')]);}else{logger['info']('License,\x20%s,\x20%s',_0x1407fb,'request\x20sent');_0x30d7f8(_0x2716fc[_0x4d83('0x13')]['message']);}})[_0x4d83('0x14')](function(_0x487088){logger['error'](_0x4d83('0xd'),_0x1407fb,_0x487088);_0x223623(_0x487088);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 73c588d..8632824 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 _0xd2a8=['removeSmtp','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addApplications','send','/:id','update','delete','removeDispositions','removeAnswers','removeImap'];(function(_0x56b479,_0x1a0112){var _0x128a46=function(_0x2561a5){while(--_0x2561a5){_0x56b479['push'](_0x56b479['shift']());}};_0x128a46(++_0x1a0112);}(_0xd2a8,0x1bc));var _0x8d2a=function(_0x2b4b5a,_0x3e1c81){_0x2b4b5a=_0x2b4b5a-0x0;var _0x18b32c=_0xd2a8[_0x2b4b5a];return _0x18b32c;};'use strict';var multer=require(_0x8d2a('0x0'));var util=require(_0x8d2a('0x1'));var path=require(_0x8d2a('0x2'));var timeout=require(_0x8d2a('0x3'));var express=require('express');var router=express[_0x8d2a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8d2a('0x5'));var controller=require('./mailAccount.controller');router[_0x8d2a('0x6')]('/',auth[_0x8d2a('0x7')](),controller[_0x8d2a('0x8')]);router[_0x8d2a('0x6')](_0x8d2a('0x9'),auth['isAuthenticated'](),controller[_0x8d2a('0xa')]);router[_0x8d2a('0x6')]('/:id',auth[_0x8d2a('0x7')](),controller['show']);router[_0x8d2a('0x6')](_0x8d2a('0xb'),auth[_0x8d2a('0x7')](),controller[_0x8d2a('0xc')]);router[_0x8d2a('0x6')](_0x8d2a('0xd'),auth[_0x8d2a('0x7')](),controller['getAnswers']);router['get'](_0x8d2a('0xe'),auth[_0x8d2a('0x7')](),controller[_0x8d2a('0xf')]);router['get'](_0x8d2a('0x10'),auth['isAuthenticated'](),controller[_0x8d2a('0x11')]);router[_0x8d2a('0x6')](_0x8d2a('0x12'),auth[_0x8d2a('0x7')](),controller['getInteractions']);router[_0x8d2a('0x6')](_0x8d2a('0x13'),auth[_0x8d2a('0x7')](),controller[_0x8d2a('0x14')]);router[_0x8d2a('0x6')](_0x8d2a('0x15'),auth['isAuthenticated'](),controller[_0x8d2a('0x16')]);router[_0x8d2a('0x6')](_0x8d2a('0x17'),auth[_0x8d2a('0x7')](),controller[_0x8d2a('0x18')]);router['get']('/:id/users',auth[_0x8d2a('0x7')](),controller[_0x8d2a('0x19')]);router[_0x8d2a('0x1a')](_0x8d2a('0xb'),auth[_0x8d2a('0x7')](),controller[_0x8d2a('0x1b')]);router[_0x8d2a('0x1a')]('/:id/canned_answers',auth[_0x8d2a('0x7')](),controller[_0x8d2a('0x1c')]);router[_0x8d2a('0x1a')]('/',auth[_0x8d2a('0x7')](),controller[_0x8d2a('0x1d')]);router[_0x8d2a('0x1a')](_0x8d2a('0xe'),auth[_0x8d2a('0x7')](),controller[_0x8d2a('0x1e')]);router['post']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x8d2a('0x1f')]);router[_0x8d2a('0x1a')](_0x8d2a('0x12'),auth[_0x8d2a('0x7')](),controller['addInteraction']);router[_0x8d2a('0x1a')]('/:id/applications',auth['isAuthenticated'](),controller[_0x8d2a('0x20')]);router[_0x8d2a('0x1a')]('/:id/send',auth[_0x8d2a('0x7')](),controller[_0x8d2a('0x21')]);router[_0x8d2a('0x1a')]('/:id/users',auth[_0x8d2a('0x7')](),controller['addAgents']);router['put'](_0x8d2a('0x22'),auth['isAuthenticated'](),controller[_0x8d2a('0x23')]);router[_0x8d2a('0x24')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8d2a('0x25')]);router[_0x8d2a('0x24')](_0x8d2a('0xd'),auth[_0x8d2a('0x7')](),controller[_0x8d2a('0x26')]);router[_0x8d2a('0x24')](_0x8d2a('0xe'),auth['isAuthenticated'](),controller[_0x8d2a('0x27')]);router[_0x8d2a('0x24')](_0x8d2a('0x10'),auth[_0x8d2a('0x7')](),controller[_0x8d2a('0x28')]);router[_0x8d2a('0x24')]('/:id',auth[_0x8d2a('0x7')](),controller['destroy']);router[_0x8d2a('0x24')](_0x8d2a('0x29'),auth['isAuthenticated'](),controller[_0x8d2a('0x2a')]);module[_0x8d2a('0x2b')]=router; \ No newline at end of file +var _0x0137=['./mailAccount.controller','get','isAuthenticated','index','describe','show','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','/:id/verify','verifySmtp','getAgents','post','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','/:id/users','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x39f527,_0x7b8fd1){var _0x3cb721=function(_0x11529e){while(--_0x11529e){_0x39f527['push'](_0x39f527['shift']());}};_0x3cb721(++_0x7b8fd1);}(_0x0137,0x15f));var _0x7013=function(_0x100f8e,_0x1efaa3){_0x100f8e=_0x100f8e-0x0;var _0x5587df=_0x0137[_0x100f8e];return _0x5587df;};'use strict';var multer=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var path=require(_0x7013('0x2'));var timeout=require(_0x7013('0x3'));var express=require(_0x7013('0x4'));var router=express[_0x7013('0x5')]();var fs_extra=require(_0x7013('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7013('0x7'));var config=require(_0x7013('0x8'));var controller=require(_0x7013('0x9'));router[_0x7013('0xa')]('/',auth[_0x7013('0xb')](),controller[_0x7013('0xc')]);router[_0x7013('0xa')]('/describe',auth[_0x7013('0xb')](),controller[_0x7013('0xd')]);router['get']('/:id',auth[_0x7013('0xb')](),controller[_0x7013('0xe')]);router['get']('/:id/dispositions',auth[_0x7013('0xb')](),controller['getDispositions']);router[_0x7013('0xa')]('/:id/canned_answers',auth[_0x7013('0xb')](),controller[_0x7013('0xf')]);router[_0x7013('0xa')]('/:id/in_servers',auth[_0x7013('0xb')](),controller[_0x7013('0x10')]);router[_0x7013('0xa')](_0x7013('0x11'),auth[_0x7013('0xb')](),controller[_0x7013('0x12')]);router[_0x7013('0xa')](_0x7013('0x13'),auth[_0x7013('0xb')](),controller['getInteractions']);router[_0x7013('0xa')](_0x7013('0x14'),auth['isAuthenticated'](),controller['getApplications']);router['get']('/:id/messages',auth[_0x7013('0xb')](),controller['getMessages']);router[_0x7013('0xa')](_0x7013('0x15'),auth['isAuthenticated'](),controller[_0x7013('0x16')]);router[_0x7013('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x7013('0x17')]);router[_0x7013('0x18')](_0x7013('0x19'),auth[_0x7013('0xb')](),controller[_0x7013('0x1a')]);router['post'](_0x7013('0x1b'),auth['isAuthenticated'](),controller[_0x7013('0x1c')]);router[_0x7013('0x18')]('/',auth[_0x7013('0xb')](),controller[_0x7013('0x1d')]);router['post'](_0x7013('0x1e'),auth['isAuthenticated'](),controller[_0x7013('0x1f')]);router['post'](_0x7013('0x11'),auth[_0x7013('0xb')](),controller[_0x7013('0x20')]);router[_0x7013('0x18')](_0x7013('0x13'),auth[_0x7013('0xb')](),controller[_0x7013('0x21')]);router['post'](_0x7013('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0x7013('0x18')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x7013('0x18')](_0x7013('0x22'),auth[_0x7013('0xb')](),controller[_0x7013('0x23')]);router[_0x7013('0x24')](_0x7013('0x25'),auth[_0x7013('0xb')](),controller[_0x7013('0x26')]);router[_0x7013('0x27')](_0x7013('0x19'),auth[_0x7013('0xb')](),controller[_0x7013('0x28')]);router[_0x7013('0x27')](_0x7013('0x1b'),auth[_0x7013('0xb')](),controller[_0x7013('0x29')]);router['delete'](_0x7013('0x1e'),auth[_0x7013('0xb')](),controller[_0x7013('0x2a')]);router['delete']('/:id/out_servers',auth[_0x7013('0xb')](),controller['removeSmtp']);router[_0x7013('0x27')](_0x7013('0x25'),auth['isAuthenticated'](),controller[_0x7013('0x2b')]);router[_0x7013('0x27')](_0x7013('0x22'),auth[_0x7013('0xb')](),controller[_0x7013('0x2c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index beaae7b..2dcf6c6 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 _0x2a10=['yahoo','outlook365','provider','getDataValue','custom','sequelize','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','setDataValue','mandatoryDisposition','ENUM','gmail','hotmail'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x2a10,0x101));var _0x02a1=function(_0x6ad2c7,_0xb22a9a){_0x6ad2c7=_0x6ad2c7-0x0;var _0x435d5f=_0x2a10[_0x6ad2c7];return _0x435d5f;};'use strict';var Sequelize=require(_0x02a1('0x0'));module[_0x02a1('0x1')]={'description':{'type':Sequelize[_0x02a1('0x2')]},'name':{'type':Sequelize[_0x02a1('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x02a1('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x02a1('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x02a1('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x02a1('0x4')]},'markAsUnread':{'type':Sequelize[_0x02a1('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x02a1('0x5')},'fontSize':{'type':Sequelize[_0x02a1('0x6')](0x2)[_0x02a1('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x02a1('0x4')],'defaultValue':function(){return _0x02a1('0x8');}},'notificationSound':{'type':Sequelize[_0x02a1('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x02a1('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x02a1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x02a1('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x02a1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x02a1('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x02a1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x02a1('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x02a1('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x02a1('0x3')],'defaultValue':![],'comment':_0x02a1('0xa'),'set':function(_0x533e4e){if(!_0x533e4e)this[_0x02a1('0xb')]('mandatoryDispositionPauseId',null);this[_0x02a1('0xb')](_0x02a1('0xc'),_0x533e4e);}},'provider':{'type':Sequelize[_0x02a1('0xd')](_0x02a1('0xe'),_0x02a1('0xf'),_0x02a1('0x10'),_0x02a1('0x11')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x02a1('0x12')))return'custom';return this[_0x02a1('0x13')](_0x02a1('0x12'));},'set':function(_0x3d9f86){if(_0x3d9f86===_0x02a1('0x14'))_0x3d9f86=null;return this[_0x02a1('0xb')]('provider',_0x3d9f86);}}}; \ No newline at end of file +var _0x03dd=['Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','yahoo','outlook365','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN','TEXT'];(function(_0xe98cde,_0x46c388){var _0x5147ae=function(_0x26e618){while(--_0x26e618){_0xe98cde['push'](_0xe98cde['shift']());}};_0x5147ae(++_0x46c388);}(_0x03dd,0x109));var _0xd03d=function(_0xf6e834,_0x1b8457){_0xf6e834=_0xf6e834-0x0;var _0x1ce4c8=_0x03dd[_0xf6e834];return _0x1ce4c8;};'use strict';var Sequelize=require(_0xd03d('0x0'));module[_0xd03d('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xd03d('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xd03d('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xd03d('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xd03d('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xd03d('0x4')]},'markAsUnread':{'type':Sequelize[_0xd03d('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd03d('0x5')},'fontSize':{'type':Sequelize[_0xd03d('0x6')](0x2)[_0xd03d('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xd03d('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0xd03d('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd03d('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd03d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd03d('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd03d('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xd03d('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xd03d('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x44d364){if(!_0x44d364)this[_0xd03d('0x9')](_0xd03d('0xa'),null);this[_0xd03d('0x9')](_0xd03d('0xb'),_0x44d364);}},'provider':{'type':Sequelize[_0xd03d('0xc')]('gmail','hotmail',_0xd03d('0xd'),_0xd03d('0xe')),'defaultValue':null,'get':function(){if(!this[_0xd03d('0xf')]('provider'))return _0xd03d('0x10');return this[_0xd03d('0xf')](_0xd03d('0x11'));},'set':function(_0x3751a5){if(_0x3751a5===_0xd03d('0x10'))_0x3751a5=null;return this[_0xd03d('0x9')](_0xd03d('0x11'),_0x3751a5);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 7b7c7be..0519140 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 _0xc003=['secure','CloudProviderId','params','update','describe','Disposition','create','hasOwnProperty','nolimit','order','MailAccountId','filter','removeDispositions','ids','addAnswer','CannedAnswer','findOne','pick','removeAnswers','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username','password','pass','host','port','service','authentication','key','custom','provider','ListId','active','description','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','finally','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','split','CmList','List','Contacts','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','email','attachments','join','root','getSmtpOptions','SendMail','sendMail','subject','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','addAgents','spread','emit','removeAgents','userMailAccount:remove','getAgents','moment','util','path','lodash','ioredis','../../components/parsers/qs','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','end','status','json','offset','undefined','limit','count','set','destroy','MailAccounts','UserProfileResource','sendStatus','stack','name','send','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','sort','where','merge','options','MailAccount','includeAll','include','findAll','rows','show','Smtp','find','body','modernAuthentication'];(function(_0x34c8ca,_0x12806d){var _0x25d326=function(_0x5ce300){while(--_0x5ce300){_0x34c8ca['push'](_0x34c8ca['shift']());}};_0x25d326(++_0x12806d);}(_0xc003,0x1dc));var _0x3c00=function(_0x495098,_0x411781){_0x495098=_0x495098-0x0;var _0x27ab66=_0xc003[_0x495098];return _0x27ab66;};'use strict';var moment=require(_0x3c00('0x0'));var BPromise=require('bluebird');var util=require(_0x3c00('0x1'));var path=require(_0x3c00('0x2'));var _=require(_0x3c00('0x3'));var juice=require('juice');var Redis=require(_0x3c00('0x4'));var qs=require(_0x3c00('0x5'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x3c00('0x6')]=_[_0x3c00('0x7')](config[_0x3c00('0x6')],{'host':_0x3c00('0x8'),'port':0x18eb});var socket=require(_0x3c00('0x9'))(new Redis(config[_0x3c00('0x6')]));require(_0x3c00('0xa'))['register'](socket);var jayson=require(_0x3c00('0xb'));var client=jayson[_0x3c00('0xc')][_0x3c00('0xd')]({'port':0x232b});function respondWithRpcPromise(_0x3b6836,_0x11b23e,_0x3ff18e,_0x7eca7){return new BPromise(function(_0x4c52ab,_0x555009){var _0x50b4c5=_0x7eca7||client;return _0x50b4c5[_0x3c00('0xe')](_0x3b6836,_0x3ff18e)[_0x3c00('0xf')](function(_0x46d410){logger[_0x3c00('0x10')](_0x3c00('0x11'),_0x11b23e,_0x3c00('0x12'));logger[_0x3c00('0x13')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x11b23e,_0x3c00('0x12'),JSON[_0x3c00('0x14')](_0x46d410));if(_0x46d410[_0x3c00('0x15')]){if(_0x46d410['error'][_0x3c00('0x16')]===0x1f4){logger[_0x3c00('0x15')](_0x3c00('0x11'),_0x11b23e,_0x46d410[_0x3c00('0x15')]['message']);return _0x555009(_0x46d410[_0x3c00('0x15')]['message']);}logger[_0x3c00('0x15')](_0x3c00('0x11'),_0x11b23e,_0x46d410[_0x3c00('0x15')][_0x3c00('0x17')]);return _0x4c52ab(_0x46d410['error']['message']);}else{logger['info'](_0x3c00('0x11'),_0x11b23e,_0x3c00('0x12'));_0x4c52ab(_0x46d410[_0x3c00('0x18')]['message']);}})[_0x3c00('0x19')](function(_0x3b3237){logger[_0x3c00('0x15')](_0x3c00('0x11'),_0x11b23e,_0x3b3237);_0x555009(_0x3b3237);});});}function respondWithStatusCode(_0x254cb4,_0x54909d){_0x54909d=_0x54909d||0xcc;return function(_0x4e6d00){if(_0x4e6d00){return _0x254cb4['sendStatus'](_0x54909d);}return _0x254cb4['status'](_0x54909d)[_0x3c00('0x1a')]();};}function respondWithResult(_0x46b4c0,_0x57be94){_0x57be94=_0x57be94||0xc8;return function(_0x2d5e3d){if(_0x2d5e3d){return _0x46b4c0[_0x3c00('0x1b')](_0x57be94)[_0x3c00('0x1c')](_0x2d5e3d);}};}function respondWithFilteredResult(_0x39c17c,_0x1f4413){return function(_0x2852b6){if(_0x2852b6){var _0x2ed44b=typeof _0x1f4413[_0x3c00('0x1d')]===_0x3c00('0x1e')&&typeof _0x1f4413[_0x3c00('0x1f')]===_0x3c00('0x1e');var _0x28b4dc=_0x2852b6[_0x3c00('0x20')];var _0x2f8162=_0x2ed44b?0x0:_0x1f4413[_0x3c00('0x1d')];var _0x4b142b=_0x2ed44b?_0x2852b6[_0x3c00('0x20')]:_0x1f4413['offset']+_0x1f4413[_0x3c00('0x1f')];var _0x2d52bc;if(_0x4b142b>=_0x28b4dc){_0x4b142b=_0x28b4dc;_0x2d52bc=0xc8;}else{_0x2d52bc=0xce;}_0x39c17c[_0x3c00('0x1b')](_0x2d52bc);return _0x39c17c[_0x3c00('0x21')]('Content-Range',_0x2f8162+'-'+_0x4b142b+'/'+_0x28b4dc)[_0x3c00('0x1c')](_0x2852b6);}return null;};}function saveUpdates(_0x3b6eb7){return function(_0x3fdfc5){if(_0x3fdfc5){return _0x3fdfc5['update'](_0x3b6eb7)[_0x3c00('0xf')](function(_0x4abf1d){return _0x4abf1d;});}return null;};}function removeEntity(_0x57bd3a){return function(_0x4d59d0){if(_0x4d59d0){return _0x4d59d0[_0x3c00('0x22')]()[_0x3c00('0xf')](function(){var _0x2bb773=_0x4d59d0['get']({'plain':!![]});var _0x20ecbe=_0x3c00('0x23');return db[_0x3c00('0x24')][_0x3c00('0x22')]({'where':{'type':_0x20ecbe,'resourceId':_0x2bb773['id']}})['then'](function(){return _0x4d59d0;});})['then'](function(){_0x57bd3a[_0x3c00('0x1b')](0xcc)[_0x3c00('0x1a')]();});}};}function handleEntityNotFound(_0x5b0a8e){return function(_0x18c6cf){if(!_0x18c6cf){_0x5b0a8e[_0x3c00('0x25')](0x194);}return _0x18c6cf;};}function handleError(_0xcb4512,_0x418e72){_0x418e72=_0x418e72||0x1f4;return function(_0x3d1125){logger['error'](_0x3d1125[_0x3c00('0x26')]);if(_0x3d1125[_0x3c00('0x27')]){delete _0x3d1125[_0x3c00('0x27')];}_0xcb4512['status'](_0x418e72)[_0x3c00('0x28')](_0x3d1125);};}exports['index']=function(_0x5b02b0,_0x54d33e){var _0x443853={'include':[{'model':db[_0x3c00('0x29')],'as':_0x3c00('0x2a')},{'model':db[_0x3c00('0x2b')],'as':'Smtp'},{'model':db[_0x3c00('0x2c')],'as':_0x3c00('0x2d')}]},_0x2650a0={},_0x1ed765={'count':0x0,'rows':[]};var _0x2680a1=_[_0x3c00('0x2e')](db['MailAccount'][_0x3c00('0x2f')],function(_0x25a3e5){return{'name':_0x25a3e5['fieldName'],'type':_0x25a3e5['type']['key']};});_0x2650a0[_0x3c00('0x30')]=_[_0x3c00('0x2e')](_0x2680a1,_0x3c00('0x27'));_0x2650a0[_0x3c00('0x31')]=_[_0x3c00('0x32')](_0x5b02b0[_0x3c00('0x31')]);_0x2650a0[_0x3c00('0x33')]=_['intersection'](_0x2650a0[_0x3c00('0x30')],_0x2650a0['query']);_0x443853[_0x3c00('0x34')]=_[_0x3c00('0x35')](_0x2650a0[_0x3c00('0x30')],qs[_0x3c00('0x36')](_0x5b02b0['query'][_0x3c00('0x36')]));_0x443853[_0x3c00('0x34')]=_0x443853[_0x3c00('0x34')][_0x3c00('0x37')]?_0x443853['attributes']:_0x2650a0[_0x3c00('0x30')];if(!_0x5b02b0[_0x3c00('0x31')]['hasOwnProperty']('nolimit')){_0x443853['limit']=qs[_0x3c00('0x1f')](_0x5b02b0[_0x3c00('0x31')][_0x3c00('0x1f')]);_0x443853[_0x3c00('0x1d')]=qs[_0x3c00('0x1d')](_0x5b02b0['query'][_0x3c00('0x1d')]);}_0x443853['order']=qs[_0x3c00('0x38')](_0x5b02b0[_0x3c00('0x31')][_0x3c00('0x38')]);_0x443853['where']=qs[_0x3c00('0x33')](_['pick'](_0x5b02b0[_0x3c00('0x31')],_0x2650a0['filters']),_0x2680a1);if(_0x5b02b0['query']['filter']){_0x443853[_0x3c00('0x39')]=_[_0x3c00('0x3a')](_0x443853['where'],{'$or':_[_0x3c00('0x2e')](_0x2680a1,function(_0x195525){if(_0x195525['type']!=='VIRTUAL'){var _0x1c59a4={};_0x1c59a4[_0x195525['name']]={'$like':'%'+_0x5b02b0['query']['filter']+'%'};return _0x1c59a4;}})});}_0x443853=_[_0x3c00('0x3a')]({},_0x443853,_0x5b02b0[_0x3c00('0x3b')]);var _0x12cc23={'where':_0x443853[_0x3c00('0x39')]};return db[_0x3c00('0x3c')][_0x3c00('0x20')](_0x12cc23)[_0x3c00('0xf')](function(_0x52af71){_0x1ed765[_0x3c00('0x20')]=_0x52af71;if(_0x5b02b0[_0x3c00('0x31')][_0x3c00('0x3d')]){_0x443853[_0x3c00('0x3e')]=[{'all':!![]}];}_0x443853['logging']=!![];return db[_0x3c00('0x3c')][_0x3c00('0x3f')](_0x443853);})[_0x3c00('0xf')](function(_0x58110f){_0x1ed765[_0x3c00('0x40')]=_0x58110f;return _0x1ed765;})[_0x3c00('0xf')](respondWithFilteredResult(_0x54d33e,_0x443853))[_0x3c00('0x19')](handleError(_0x54d33e,null));};exports[_0x3c00('0x41')]=function(_0x17dbb1,_0x3e512a){var _0x626212={'raw':![],'where':{'id':_0x17dbb1['params']['id']},'include':[{'model':db[_0x3c00('0x29')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x3c00('0x42')},{'model':db[_0x3c00('0x2c')],'as':_0x3c00('0x2d')}]},_0x256fd6={};_0x256fd6['model']=_['keys'](db[_0x3c00('0x3c')][_0x3c00('0x2f')]);_0x256fd6[_0x3c00('0x31')]=_['keys'](_0x17dbb1[_0x3c00('0x31')]);_0x256fd6['filters']=_[_0x3c00('0x35')](_0x256fd6['model'],_0x256fd6[_0x3c00('0x31')]);_0x626212[_0x3c00('0x34')]=_[_0x3c00('0x35')](_0x256fd6[_0x3c00('0x30')],qs[_0x3c00('0x36')](_0x17dbb1[_0x3c00('0x31')]['fields']));_0x626212['attributes']=_0x626212[_0x3c00('0x34')][_0x3c00('0x37')]?_0x626212[_0x3c00('0x34')]:_0x256fd6[_0x3c00('0x30')];if(_0x17dbb1[_0x3c00('0x31')][_0x3c00('0x3d')]){_0x626212[_0x3c00('0x3e')]=[{'all':!![]}];}_0x626212=_[_0x3c00('0x3a')]({},_0x626212,_0x17dbb1[_0x3c00('0x3b')]);return db[_0x3c00('0x3c')][_0x3c00('0x43')](_0x626212)[_0x3c00('0xf')](handleEntityNotFound(_0x3e512a,null))['then'](respondWithResult(_0x3e512a,null))[_0x3c00('0x19')](handleError(_0x3e512a,null));};exports['update']=function(_0x19702c,_0x3be529){if(_0x19702c[_0x3c00('0x44')]['id']){delete _0x19702c[_0x3c00('0x44')]['id'];}if(_0x19702c[_0x3c00('0x44')][_0x3c00('0x2a')]){if(!_0x19702c[_0x3c00('0x44')][_0x3c00('0x2a')][_0x3c00('0x45')]){_0x19702c[_0x3c00('0x44')][_0x3c00('0x2a')]['CloudProviderId']=null;}}if(_0x19702c[_0x3c00('0x44')][_0x3c00('0x42')]){if(_0x19702c[_0x3c00('0x44')][_0x3c00('0x42')][_0x3c00('0x45')]){_0x19702c[_0x3c00('0x44')][_0x3c00('0x42')][_0x3c00('0x46')]=![];}else{_0x19702c[_0x3c00('0x44')][_0x3c00('0x42')][_0x3c00('0x47')]=null;}}return db['MailAccount'][_0x3c00('0x43')]({'where':{'id':_0x19702c[_0x3c00('0x48')]['id']},'include':[{'model':db[_0x3c00('0x29')],'as':_0x3c00('0x2a')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x3c00('0x2c')],'as':'mandatoryDispositionPause'}]})[_0x3c00('0xf')](handleEntityNotFound(_0x3be529,null))[_0x3c00('0xf')](saveUpdates(_0x19702c[_0x3c00('0x44')],null))['then'](function(_0x23fd94){if(_0x23fd94&&_0x19702c[_0x3c00('0x44')][_0x3c00('0x2a')]){return db[_0x3c00('0x29')][_0x3c00('0x49')](_0x19702c[_0x3c00('0x44')][_0x3c00('0x2a')],{'where':{'MailAccountId':_0x23fd94['id']}})[_0x3c00('0xf')](function(){return _0x23fd94;});}return _0x23fd94;})[_0x3c00('0xf')](function(_0x140558){if(_0x140558&&_0x19702c[_0x3c00('0x44')]['Smtp']){return db['MailServerOut']['update'](_0x19702c[_0x3c00('0x44')][_0x3c00('0x42')],{'where':{'MailAccountId':_0x140558['id']}})[_0x3c00('0xf')](function(){return _0x140558;});}return _0x140558;})[_0x3c00('0xf')](respondWithResult(_0x3be529,null))[_0x3c00('0x19')](handleError(_0x3be529,null));};exports['describe']=function(_0x305a2e,_0x56c276){return db[_0x3c00('0x3c')][_0x3c00('0x4a')]()[_0x3c00('0xf')](respondWithResult(_0x56c276,null))[_0x3c00('0x19')](handleError(_0x56c276,null));};exports['addDisposition']=function(_0x4d8bf6,_0x571eb1){if(_0x4d8bf6[_0x3c00('0x44')]['id']){delete _0x4d8bf6['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x4d8bf6['params']['id']}})['then'](handleEntityNotFound(_0x571eb1,null))['then'](function(_0x504774){if(_0x504774){_0x4d8bf6[_0x3c00('0x44')]['MailAccountId']=_0x504774['id'];return db[_0x3c00('0x4b')][_0x3c00('0x4c')](_0x4d8bf6[_0x3c00('0x44')]);}})['then'](respondWithResult(_0x571eb1,null))[_0x3c00('0x19')](handleError(_0x571eb1,null));};exports['getDispositions']=function(_0x39aeb6,_0x1208c1){var _0x3f80a1={'raw':![],'where':{}};var _0x4b3000={};var _0x4d1469={'count':0x0,'rows':[]};return db[_0x3c00('0x3c')]['findOne']({'where':{'id':_0x39aeb6[_0x3c00('0x48')]['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0x1208c1,null))[_0x3c00('0xf')](function(_0x5051ab){if(_0x5051ab){_0x4b3000[_0x3c00('0x30')]=_[_0x3c00('0x32')](db[_0x3c00('0x4b')]['rawAttributes']);_0x4b3000[_0x3c00('0x31')]=_[_0x3c00('0x32')](_0x39aeb6['query']);_0x4b3000[_0x3c00('0x33')]=_['intersection'](_0x4b3000[_0x3c00('0x30')],_0x4b3000['query']);_0x3f80a1[_0x3c00('0x34')]=_[_0x3c00('0x35')](_0x4b3000['model'],qs[_0x3c00('0x36')](_0x39aeb6['query'][_0x3c00('0x36')]));_0x3f80a1[_0x3c00('0x34')]=_0x3f80a1[_0x3c00('0x34')][_0x3c00('0x37')]?_0x3f80a1[_0x3c00('0x34')]:_0x4b3000[_0x3c00('0x30')];if(!_0x39aeb6[_0x3c00('0x31')][_0x3c00('0x4d')](_0x3c00('0x4e'))){_0x3f80a1[_0x3c00('0x1f')]=qs[_0x3c00('0x1f')](_0x39aeb6[_0x3c00('0x31')][_0x3c00('0x1f')]);_0x3f80a1['offset']=qs[_0x3c00('0x1d')](_0x39aeb6[_0x3c00('0x31')][_0x3c00('0x1d')]);}_0x3f80a1[_0x3c00('0x4f')]=qs[_0x3c00('0x38')](_0x39aeb6['query'][_0x3c00('0x38')]);_0x3f80a1[_0x3c00('0x39')]=qs[_0x3c00('0x33')](_['pick'](_0x39aeb6[_0x3c00('0x31')],_0x4b3000['filters']));_0x3f80a1['where'][_0x3c00('0x50')]=_0x5051ab['id'];if(_0x39aeb6[_0x3c00('0x31')][_0x3c00('0x51')]){_0x3f80a1[_0x3c00('0x39')]=_[_0x3c00('0x3a')](_0x3f80a1[_0x3c00('0x39')],{'$or':_['map'](_0x3f80a1[_0x3c00('0x34')],function(_0x3d3e01){var _0x97d847={};_0x97d847[_0x3d3e01]={'$like':'%'+_0x39aeb6[_0x3c00('0x31')][_0x3c00('0x51')]+'%'};return _0x97d847;})});}_0x3f80a1=_[_0x3c00('0x3a')]({},_0x3f80a1,_0x39aeb6[_0x3c00('0x3b')]);return db[_0x3c00('0x4b')][_0x3c00('0x20')]({'where':_0x3f80a1['where']})[_0x3c00('0xf')](function(_0x3b1a95){_0x4d1469[_0x3c00('0x20')]=_0x3b1a95;if(_0x39aeb6[_0x3c00('0x31')]['includeAll']){_0x3f80a1[_0x3c00('0x3e')]=[{'all':!![]}];}return db[_0x3c00('0x4b')][_0x3c00('0x3f')](_0x3f80a1);})['then'](function(_0x370714){_0x4d1469[_0x3c00('0x40')]=_0x370714;return _0x4d1469;});}})[_0x3c00('0xf')](respondWithFilteredResult(_0x1208c1,_0x3f80a1))[_0x3c00('0x19')](handleError(_0x1208c1,null));};exports[_0x3c00('0x52')]=function(_0x228d57,_0x3e0beb){return db['MailAccount'][_0x3c00('0x43')]({'where':{'id':_0x228d57['params']['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0x3e0beb,null))[_0x3c00('0xf')](function(_0x469ef0){if(_0x469ef0){return _0x469ef0[_0x3c00('0x52')](_0x228d57[_0x3c00('0x31')][_0x3c00('0x53')]);}})[_0x3c00('0xf')](respondWithStatusCode(_0x3e0beb,null))[_0x3c00('0x19')](handleError(_0x3e0beb,null));};exports[_0x3c00('0x54')]=function(_0x489d60,_0x425a9d){if(_0x489d60[_0x3c00('0x44')]['id']){delete _0x489d60[_0x3c00('0x44')]['id'];}return db[_0x3c00('0x3c')][_0x3c00('0x43')]({'where':{'id':_0x489d60[_0x3c00('0x48')]['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0x425a9d,null))[_0x3c00('0xf')](function(_0x4d8987){if(_0x4d8987){_0x489d60['body'][_0x3c00('0x50')]=_0x4d8987['id'];return db[_0x3c00('0x55')][_0x3c00('0x4c')](_0x489d60[_0x3c00('0x44')]);}})[_0x3c00('0xf')](respondWithResult(_0x425a9d,null))[_0x3c00('0x19')](handleError(_0x425a9d,null));};exports['getAnswers']=function(_0x2d7a2d,_0x28e066){var _0x58d1df={'raw':![],'where':{}};var _0x52dec6={};var _0xf5b088={'count':0x0,'rows':[]};return db[_0x3c00('0x3c')][_0x3c00('0x56')]({'where':{'id':_0x2d7a2d[_0x3c00('0x48')]['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0x28e066,null))[_0x3c00('0xf')](function(_0x5d0ec1){if(_0x5d0ec1){_0x52dec6[_0x3c00('0x30')]=_[_0x3c00('0x32')](db[_0x3c00('0x55')][_0x3c00('0x2f')]);_0x52dec6[_0x3c00('0x31')]=_['keys'](_0x2d7a2d[_0x3c00('0x31')]);_0x52dec6[_0x3c00('0x33')]=_[_0x3c00('0x35')](_0x52dec6[_0x3c00('0x30')],_0x52dec6['query']);_0x58d1df[_0x3c00('0x34')]=_[_0x3c00('0x35')](_0x52dec6['model'],qs[_0x3c00('0x36')](_0x2d7a2d[_0x3c00('0x31')]['fields']));_0x58d1df[_0x3c00('0x34')]=_0x58d1df[_0x3c00('0x34')][_0x3c00('0x37')]?_0x58d1df[_0x3c00('0x34')]:_0x52dec6['model'];if(!_0x2d7a2d[_0x3c00('0x31')][_0x3c00('0x4d')]('nolimit')){_0x58d1df['limit']=qs[_0x3c00('0x1f')](_0x2d7a2d[_0x3c00('0x31')]['limit']);_0x58d1df[_0x3c00('0x1d')]=qs['offset'](_0x2d7a2d[_0x3c00('0x31')][_0x3c00('0x1d')]);}_0x58d1df['order']=qs[_0x3c00('0x38')](_0x2d7a2d['query'][_0x3c00('0x38')]);_0x58d1df[_0x3c00('0x39')]=qs[_0x3c00('0x33')](_[_0x3c00('0x57')](_0x2d7a2d[_0x3c00('0x31')],_0x52dec6[_0x3c00('0x33')]));_0x58d1df[_0x3c00('0x39')][_0x3c00('0x50')]=_0x5d0ec1['id'];if(_0x2d7a2d[_0x3c00('0x31')][_0x3c00('0x51')]){_0x58d1df['where']=_[_0x3c00('0x3a')](_0x58d1df[_0x3c00('0x39')],{'$or':_[_0x3c00('0x2e')](_0x58d1df[_0x3c00('0x34')],function(_0x223d78){var _0x16818e={};_0x16818e[_0x223d78]={'$like':'%'+_0x2d7a2d[_0x3c00('0x31')]['filter']+'%'};return _0x16818e;})});}_0x58d1df=_['merge']({},_0x58d1df,_0x2d7a2d['options']);return db[_0x3c00('0x55')][_0x3c00('0x20')]({'where':_0x58d1df[_0x3c00('0x39')]})[_0x3c00('0xf')](function(_0x52d67f){_0xf5b088[_0x3c00('0x20')]=_0x52d67f;if(_0x2d7a2d['query']['includeAll']){_0x58d1df[_0x3c00('0x3e')]=[{'all':!![]}];}return db[_0x3c00('0x55')][_0x3c00('0x3f')](_0x58d1df);})['then'](function(_0x5cda){_0xf5b088[_0x3c00('0x40')]=_0x5cda;return _0xf5b088;});}})[_0x3c00('0xf')](respondWithFilteredResult(_0x28e066,_0x58d1df))[_0x3c00('0x19')](handleError(_0x28e066,null));};exports[_0x3c00('0x58')]=function(_0x5c767d,_0x34f305){return db[_0x3c00('0x3c')]['find']({'where':{'id':_0x5c767d['params']['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0x34f305,null))[_0x3c00('0xf')](function(_0x124d3a){if(_0x124d3a){return _0x124d3a[_0x3c00('0x58')](_0x5c767d[_0x3c00('0x31')][_0x3c00('0x53')]);}})['then'](respondWithStatusCode(_0x34f305,null))['catch'](handleError(_0x34f305,null));};function getImapHost(_0x4ec3ba){switch(_0x4ec3ba){case _0x3c00('0x59'):return _0x3c00('0x5a');case _0x3c00('0x5b'):return _0x3c00('0x5c');case _0x3c00('0x5d'):return'imap-mail.outlook.com';case'outlook365':return _0x3c00('0x5e');}throw new Error(_0x3c00('0x5f'),_0x4ec3ba);}function getSmtpHost(_0xe83de2){switch(_0xe83de2){case _0x3c00('0x59'):return _0x3c00('0x60');case'yahoo':return _0x3c00('0x61');case'hotmail':return _0x3c00('0x62');case'outlook365':return'smtp.office365.com';}throw new Error(_0x3c00('0x5f'),_0xe83de2);}function getSmtpPort(_0x3a5489,_0x1d7368){switch(_0x3a5489){case _0x3c00('0x59'):return _0x1d7368===!![]?0x24b:0x1d1;case _0x3c00('0x5b'):return 0x1d1;case _0x3c00('0x5d'):return 0x24b;case'outlook365':return 0x24b;}throw new Error(_0x3c00('0x5f'),_0x3a5489);}function getAuthenticationOptions(_0x59c1f2,_0x27ec94){var _0x22a755={};var _0x15ac3f={};if(_0x59c1f2){_0x22a755[_0x3c00('0x63')]=_0x15ac3f[_0x3c00('0x63')]=_0x27ec94[_0x3c00('0x64')];_0x22a755[_0x3c00('0x65')]=_0x15ac3f[_0x3c00('0x66')]=_0x27ec94[_0x3c00('0x65')];if(_0x27ec94[_0x3c00('0x45')]){_0x22a755[_0x3c00('0x45')]=_0x15ac3f['modernAuthentication']=!![];_0x22a755[_0x3c00('0x47')]=_0x15ac3f[_0x3c00('0x47')]=_0x27ec94[_0x3c00('0x47')];_0x22a755[_0x3c00('0x65')]=_0x15ac3f['pass']=null;}else{_0x22a755[_0x3c00('0x47')]=_0x15ac3f['CloudProviderId']=null;}_0x22a755[_0x3c00('0x67')]=getImapHost(_0x59c1f2);_0x22a755[_0x3c00('0x68')]=0x3e1;_0x15ac3f[_0x3c00('0x67')]=getSmtpHost(_0x59c1f2);_0x15ac3f[_0x3c00('0x68')]=getSmtpPort(_0x59c1f2,_0x15ac3f[_0x3c00('0x46')]);_0x22a755[_0x3c00('0x69')]=_0x15ac3f['service']=null;}else{if(_0x27ec94[_0x3c00('0x6a')]){_0x22a755[_0x3c00('0x63')]=_0x15ac3f[_0x3c00('0x63')]=_0x27ec94[_0x3c00('0x64')];_0x22a755[_0x3c00('0x65')]=_0x15ac3f[_0x3c00('0x66')]=_0x27ec94[_0x3c00('0x65')];}else{_0x22a755[_0x3c00('0x6a')]=_0x15ac3f[_0x3c00('0x6a')]=![];_0x22a755[_0x3c00('0x63')]=_0x15ac3f[_0x3c00('0x63')]=null;_0x22a755[_0x3c00('0x65')]=_0x15ac3f[_0x3c00('0x66')]=null;}_0x22a755[_0x3c00('0x67')]=_0x27ec94[_0x3c00('0x2a')][_0x3c00('0x67')];_0x22a755[_0x3c00('0x68')]=_0x27ec94[_0x3c00('0x2a')][_0x3c00('0x68')];_0x15ac3f[_0x3c00('0x67')]=_0x27ec94[_0x3c00('0x42')][_0x3c00('0x67')];_0x15ac3f[_0x3c00('0x68')]=_0x27ec94[_0x3c00('0x42')][_0x3c00('0x68')];}return{'Imap':_0x22a755,'Smtp':_0x15ac3f};}exports['create']=function(_0x406bd9,_0xa17d0e){var _0x2fe47e={'name':_0x406bd9[_0x3c00('0x44')][_0x3c00('0x27')],'key':_0x406bd9['body'][_0x3c00('0x6b')],'provider':_0x406bd9[_0x3c00('0x44')]['provider']===_0x3c00('0x6c')?null:_0x406bd9['body'][_0x3c00('0x6d')],'email':_0x406bd9[_0x3c00('0x44')]['email'],'ListId':_0x406bd9['body'][_0x3c00('0x6e')],'active':!_['isNil'](_0x406bd9[_0x3c00('0x44')]['active'])?_0x406bd9[_0x3c00('0x44')][_0x3c00('0x6f')]:!![],'description':_0x406bd9['body'][_0x3c00('0x70')]||null};var _0xc40fd8=getAuthenticationOptions(_0x2fe47e[_0x3c00('0x6d')],_0x406bd9[_0x3c00('0x44')]);_0x2fe47e[_0x3c00('0x2a')]=_0xc40fd8[_0x3c00('0x2a')];_0x2fe47e[_0x3c00('0x42')]=_0xc40fd8[_0x3c00('0x42')];return db[_0x3c00('0x3c')]['create'](_0x2fe47e,{'include':[{'model':db[_0x3c00('0x2b')],'as':_0x3c00('0x42')},{'model':db[_0x3c00('0x29')],'as':_0x3c00('0x2a')}]})[_0x3c00('0xf')](function(_0x4eefb7){var _0x38c793=_0x406bd9[_0x3c00('0x63')][_0x3c00('0x71')]({'plain':!![]});if(!_0x38c793)throw new Error(_0x3c00('0x72'));if(_0x38c793['role']==='user'){var _0x233e51=_0x4eefb7[_0x3c00('0x71')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x3c00('0x23'),'userProfileId':_0x38c793['userProfileId']},'raw':!![]})[_0x3c00('0xf')](function(_0x1bae2f){if(_0x1bae2f&&_0x1bae2f[_0x3c00('0x73')]===0x0){return db['UserProfileResource'][_0x3c00('0x4c')]({'name':_0x233e51[_0x3c00('0x27')],'resourceId':_0x233e51['id'],'type':_0x1bae2f[_0x3c00('0x27')],'sectionId':_0x1bae2f['id']},{})[_0x3c00('0xf')](function(){return _0x4eefb7;});}else{return _0x4eefb7;}})[_0x3c00('0x19')](function(_0x46840e){logger[_0x3c00('0x15')](_0x3c00('0x74'),_0x46840e);throw _0x46840e;});}return _0x4eefb7;})['then'](respondWithResult(_0xa17d0e,0xc9))[_0x3c00('0x19')](handleError(_0xa17d0e,null));};exports[_0x3c00('0x75')]=function(_0x423936,_0x4af307){return db['MailAccount'][_0x3c00('0x56')]({'where':{'id':_0x423936['params']['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0x4af307,null))[_0x3c00('0xf')](function(_0x294165){if(_0x294165){return _0x294165['getImap']();}return null;})[_0x3c00('0xf')](respondWithResult(_0x4af307,null))[_0x3c00('0x19')](handleError(_0x4af307,null));};exports[_0x3c00('0x76')]=function(_0x4c1d83,_0x12c96e){if(_0x4c1d83['body']['id']){delete _0x4c1d83[_0x3c00('0x44')]['id'];}return db[_0x3c00('0x3c')][_0x3c00('0x43')]({'where':{'id':_0x4c1d83[_0x3c00('0x48')]['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0x12c96e,null))[_0x3c00('0xf')](function(_0x4e4a1d){if(_0x4e4a1d){_0x4c1d83[_0x3c00('0x44')][_0x3c00('0x50')]=_0x4e4a1d['id'];return db[_0x3c00('0x29')][_0x3c00('0x4c')](_0x4c1d83[_0x3c00('0x44')]);}})[_0x3c00('0xf')](respondWithResult(_0x12c96e,null))[_0x3c00('0x19')](handleError(_0x12c96e,null));};exports[_0x3c00('0x77')]=function(_0x4bf360,_0x18c367){return db[_0x3c00('0x3c')][_0x3c00('0x56')]({'where':{'id':_0x4bf360[_0x3c00('0x48')]['id']}})['then'](handleEntityNotFound(_0x18c367,null))['then'](function(_0xdcbf9e){if(_0xdcbf9e){return _0xdcbf9e[_0x3c00('0x78')](null);}return null;})['then'](respondWithStatusCode(_0x18c367,null))[_0x3c00('0x19')](handleError(_0x18c367,null));};exports[_0x3c00('0x79')]=function(_0x2a65a4,_0x3d6630){return db[_0x3c00('0x3c')][_0x3c00('0x56')]({'where':{'id':_0x2a65a4['params']['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0x3d6630,null))['then'](function(_0x2ebd47){if(_0x2ebd47){return _0x2ebd47[_0x3c00('0x79')]();}return null;})[_0x3c00('0xf')](respondWithResult(_0x3d6630,null))['catch'](handleError(_0x3d6630,null));};exports[_0x3c00('0x7a')]=function(_0x11926a,_0x1f824b){if(_0x11926a[_0x3c00('0x44')]['id']){delete _0x11926a[_0x3c00('0x44')]['id'];}return db[_0x3c00('0x3c')][_0x3c00('0x43')]({'where':{'id':_0x11926a[_0x3c00('0x48')]['id']}})['then'](handleEntityNotFound(_0x1f824b,null))[_0x3c00('0xf')](function(_0x37d65e){if(_0x37d65e){_0x11926a[_0x3c00('0x44')][_0x3c00('0x50')]=_0x37d65e['id'];return db[_0x3c00('0x2b')][_0x3c00('0x4c')](_0x11926a['body']);}})[_0x3c00('0xf')](respondWithResult(_0x1f824b,null))[_0x3c00('0x19')](handleError(_0x1f824b,null));};exports[_0x3c00('0x7b')]=function(_0x555c14,_0x16626e){return db[_0x3c00('0x3c')]['findOne']({'where':{'id':_0x555c14['params']['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0x16626e,null))['then'](function(_0x2070b1){if(_0x2070b1){return _0x2070b1[_0x3c00('0x7c')](null);}return null;})['then'](respondWithStatusCode(_0x16626e,null))[_0x3c00('0x19')](handleError(_0x16626e,null));};exports['addInteraction']=function(_0x266251,_0xbb078){return db[_0x3c00('0x7d')][_0x3c00('0x43')]({'where':{'id':_0x266251['params']['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0xbb078,null))[_0x3c00('0xf')](function(_0x2236d1){if(_0x2236d1){return _0x2236d1[_0x3c00('0x7e')](_0x266251[_0x3c00('0x44')]['ids'],_[_0x3c00('0x7f')](_0x266251[_0x3c00('0x44')],['ids','id'])||{});}})[_0x3c00('0xf')](respondWithResult(_0xbb078,null))['catch'](handleError(_0xbb078,null));};exports[_0x3c00('0x80')]=function(_0x2df064,_0x4278bd){var _0x322f2e={'raw':![],'where':{}};var _0x25a82a={};var _0x540f26={'count':0x0,'rows':[]};return db[_0x3c00('0x3c')][_0x3c00('0x56')]({'where':{'id':_0x2df064[_0x3c00('0x48')]['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0x4278bd,null))[_0x3c00('0xf')](function(_0x5926ad){if(_0x5926ad){_0x25a82a[_0x3c00('0x30')]=_[_0x3c00('0x32')](db[_0x3c00('0x7d')][_0x3c00('0x2f')]);_0x25a82a[_0x3c00('0x31')]=_[_0x3c00('0x32')](_0x2df064[_0x3c00('0x31')]);_0x25a82a[_0x3c00('0x33')]=_[_0x3c00('0x35')](_0x25a82a['model'],_0x25a82a[_0x3c00('0x31')]);_0x322f2e[_0x3c00('0x34')]=_[_0x3c00('0x35')](_0x25a82a[_0x3c00('0x30')],qs[_0x3c00('0x36')](_0x2df064[_0x3c00('0x31')][_0x3c00('0x36')]));_0x322f2e[_0x3c00('0x34')]=_0x322f2e[_0x3c00('0x34')][_0x3c00('0x37')]?_0x322f2e['attributes']:_0x25a82a['model'];if(!_0x2df064[_0x3c00('0x31')][_0x3c00('0x4d')](_0x3c00('0x4e'))){_0x322f2e[_0x3c00('0x1f')]=qs[_0x3c00('0x1f')](_0x2df064['query'][_0x3c00('0x1f')]);_0x322f2e[_0x3c00('0x1d')]=qs['offset'](_0x2df064[_0x3c00('0x31')][_0x3c00('0x1d')]);}_0x322f2e[_0x3c00('0x4f')]=qs['sort'](_0x2df064['query'][_0x3c00('0x38')]);_0x322f2e[_0x3c00('0x39')]=qs[_0x3c00('0x33')](_[_0x3c00('0x57')](_0x2df064['query'],_0x25a82a['filters']));_0x322f2e[_0x3c00('0x39')][_0x3c00('0x50')]=_0x5926ad['id'];if(_0x2df064[_0x3c00('0x31')][_0x3c00('0x51')]){_0x322f2e[_0x3c00('0x39')]=_[_0x3c00('0x3a')](_0x322f2e[_0x3c00('0x39')],{'$or':_[_0x3c00('0x2e')](_0x322f2e[_0x3c00('0x34')],function(_0x15eefb){var _0x1f8e8f={};_0x1f8e8f[_0x15eefb]={'$like':'%'+_0x2df064[_0x3c00('0x31')][_0x3c00('0x51')]+'%'};return _0x1f8e8f;})});}_0x322f2e=_['merge']({},_0x322f2e,_0x2df064['options']);return db[_0x3c00('0x7d')][_0x3c00('0x20')]({'where':_0x322f2e[_0x3c00('0x39')]})[_0x3c00('0xf')](function(_0x77beeb){_0x540f26[_0x3c00('0x20')]=_0x77beeb;if(_0x2df064[_0x3c00('0x31')][_0x3c00('0x3d')]){_0x322f2e[_0x3c00('0x3e')]=[{'model':db[_0x3c00('0x81')],'as':_0x3c00('0x82'),'required':![]},{'model':db[_0x3c00('0x83')],'as':_0x3c00('0x84'),'attributes':[_0x3c00('0x27'),_0x3c00('0x85'),_0x3c00('0x86')],'required':![]},{'model':db[_0x3c00('0x87')],'as':_0x3c00('0x88'),'attributes':['id','name','color'],'where':_0x2df064[_0x3c00('0x31')][_0x3c00('0x89')]?{'id':_0x2df064[_0x3c00('0x31')]['tag']}:undefined,'required':_0x2df064[_0x3c00('0x31')][_0x3c00('0x89')]?!![]:![]}];}return db['MailInteraction'][_0x3c00('0x3f')](_0x322f2e);})[_0x3c00('0xf')](function(_0x25aa21){_0x540f26[_0x3c00('0x40')]=_0x25aa21;return _0x540f26;});}})['then'](respondWithFilteredResult(_0x4278bd,_0x322f2e))[_0x3c00('0x19')](handleError(_0x4278bd,null));};exports['addApplications']=function addApplications(_0x1ccef1,_0x1ebf78){var _0x569fd0=_0x1ccef1[_0x3c00('0x48')]['id'];var _0x16b865=_0x1ccef1[_0x3c00('0x44')];var _0x575e9c=0xc8;var _0x3884ad=null;return db[_0x3c00('0x8a')][_0x3c00('0x8b')]({'isolationLevel':db[_0x3c00('0x8a')]['Transaction'][_0x3c00('0x8c')][_0x3c00('0x8d')]},function(_0xc2822a){return db['MailAccount'][_0x3c00('0x56')]({'where':{'id':_0x569fd0},'transaction':_0xc2822a})[_0x3c00('0xf')](function(_0x302420){if(_0x302420){return db[_0x3c00('0x8e')]['destroy']({'where':{'MailAccountId':_0x569fd0},'transaction':_0xc2822a})[_0x3c00('0xf')](function(){var _0x1e6bd7=_[_0x3c00('0x2e')](_0x16b865,function(_0xffd3fd){_0xffd3fd[_0x3c00('0x50')]=_0x569fd0;return _0xffd3fd;});return db[_0x3c00('0x8e')][_0x3c00('0x8f')](_0x1e6bd7,{'transaction':_0xc2822a});});}else{_0x575e9c=0x194;_0x3884ad=[];}});})[_0x3c00('0xf')](function(){if(_0x575e9c!==0x194){return db[_0x3c00('0x8e')]['findAndCountAll']({'where':{'MailAccountId':_0x569fd0},'order':_0x3c00('0x90')})[_0x3c00('0xf')](function(_0x250544){_0x3884ad=_0x250544;});}})[_0x3c00('0x19')](function(_0x502fd2){_0x575e9c=0x1f4;logger[_0x3c00('0x15')](_0x502fd2[_0x3c00('0x26')]);if(_0x502fd2[_0x3c00('0x27')]){delete _0x502fd2['name'];}_0x3884ad=_0x502fd2;})[_0x3c00('0x91')](function(){if(_0x3884ad===null){_0x1ebf78[_0x3c00('0x25')](_0x575e9c);}else{if(_0x575e9c===0x1f4){_0x1ebf78['status'](_0x575e9c)['send'](_0x3884ad);}else{_0x1ebf78[_0x3c00('0x1b')](_0x575e9c)[_0x3c00('0x1c')](_0x3884ad);}}});};exports['getApplications']=function(_0x51680d,_0x251fbb){var _0xb59a15={};var _0x1110be={};var _0x495a4a;var _0x400e94;return db[_0x3c00('0x3c')][_0x3c00('0x56')]({'where':{'id':_0x51680d[_0x3c00('0x48')]['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0x251fbb,null))['then'](function(_0x334321){if(_0x334321){_0x495a4a=_0x334321;_0x1110be[_0x3c00('0x30')]=_['keys'](db['MailApplication'][_0x3c00('0x2f')]);_0x1110be[_0x3c00('0x31')]=_['keys'](_0x51680d[_0x3c00('0x31')]);_0x1110be[_0x3c00('0x33')]=_[_0x3c00('0x35')](_0x1110be[_0x3c00('0x30')],_0x1110be[_0x3c00('0x31')]);_0xb59a15[_0x3c00('0x34')]=_[_0x3c00('0x35')](_0x1110be[_0x3c00('0x30')],qs['fields'](_0x51680d[_0x3c00('0x31')][_0x3c00('0x36')]));_0xb59a15[_0x3c00('0x34')]=_0xb59a15[_0x3c00('0x34')]['length']?_0xb59a15[_0x3c00('0x34')]:_0x1110be[_0x3c00('0x30')];_0xb59a15['order']=qs[_0x3c00('0x38')](_0x51680d['query'][_0x3c00('0x38')]);_0xb59a15[_0x3c00('0x39')]=qs[_0x3c00('0x33')](_['pick'](_0x51680d['query'],_0x1110be[_0x3c00('0x33')]));if(_0x51680d['query'][_0x3c00('0x51')]){_0xb59a15[_0x3c00('0x39')]=_['merge'](_0xb59a15['where'],{'$or':_[_0x3c00('0x2e')](_0xb59a15[_0x3c00('0x34')],function(_0x642f12){var _0x42ee06={};_0x42ee06[_0x642f12]={'$like':'%'+_0x51680d[_0x3c00('0x31')][_0x3c00('0x51')]+'%'};return _0x42ee06;})});}_0xb59a15=_[_0x3c00('0x3a')]({},_0xb59a15,_0x51680d['options']);return _0x495a4a[_0x3c00('0x92')](_0xb59a15);}})['then'](function(_0x1b9bda){if(_0x1b9bda){_0x400e94=_0x1b9bda['length'];if(!_0x51680d['query'][_0x3c00('0x4d')](_0x3c00('0x4e'))){_0xb59a15['limit']=qs[_0x3c00('0x1f')](_0x51680d[_0x3c00('0x31')]['limit']);_0xb59a15[_0x3c00('0x1d')]=qs[_0x3c00('0x1d')](_0x51680d['query']['offset']);}return _0x495a4a[_0x3c00('0x92')](_0xb59a15);}})[_0x3c00('0xf')](function(_0x27ff2a){if(_0x27ff2a){return _0x27ff2a?{'count':_0x400e94,'rows':_0x27ff2a}:null;}})['then'](respondWithResult(_0x251fbb,null))[_0x3c00('0x19')](handleError(_0x251fbb,null));};exports[_0x3c00('0x93')]=function(_0xfe2c48,_0x34bbcf){var _0x1b3cf1={'raw':!![],'where':{}};var _0x2574c3={};var _0x3cda4c={'count':0x0,'rows':[]};return db[_0x3c00('0x3c')][_0x3c00('0x56')]({'where':{'id':_0xfe2c48['params']['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0x34bbcf,null))[_0x3c00('0xf')](function(_0x103a2c){if(_0x103a2c){_0x2574c3[_0x3c00('0x30')]=_[_0x3c00('0x32')](db[_0x3c00('0x94')][_0x3c00('0x2f')]);_0x2574c3[_0x3c00('0x31')]=_[_0x3c00('0x32')](_0xfe2c48[_0x3c00('0x31')]);_0x2574c3[_0x3c00('0x33')]=_[_0x3c00('0x35')](_0x2574c3[_0x3c00('0x30')],_0x2574c3['query']);_0x1b3cf1[_0x3c00('0x34')]=_[_0x3c00('0x35')](_0x2574c3[_0x3c00('0x30')],qs[_0x3c00('0x36')](_0xfe2c48['query'][_0x3c00('0x36')]));_0x1b3cf1[_0x3c00('0x34')]=_0x1b3cf1['attributes']['length']?_0x1b3cf1[_0x3c00('0x34')]:_0x2574c3[_0x3c00('0x30')];if(!_0xfe2c48[_0x3c00('0x31')]['hasOwnProperty']('nolimit')){_0x1b3cf1[_0x3c00('0x1f')]=qs[_0x3c00('0x1f')](_0xfe2c48['query']['limit']);_0x1b3cf1[_0x3c00('0x1d')]=qs[_0x3c00('0x1d')](_0xfe2c48['query'][_0x3c00('0x1d')]);}_0x1b3cf1[_0x3c00('0x4f')]=qs['sort'](_0xfe2c48[_0x3c00('0x31')][_0x3c00('0x38')]);_0x1b3cf1[_0x3c00('0x39')]=qs[_0x3c00('0x33')](_[_0x3c00('0x57')](_0xfe2c48[_0x3c00('0x31')],_0x2574c3[_0x3c00('0x33')]));_0x1b3cf1[_0x3c00('0x39')][_0x3c00('0x50')]=_0x103a2c['id'];if(_0xfe2c48['query'][_0x3c00('0x51')]){_0x1b3cf1['where']=_[_0x3c00('0x3a')](_0x1b3cf1[_0x3c00('0x39')],{'$or':_[_0x3c00('0x2e')](_0x1b3cf1[_0x3c00('0x34')],function(_0x3c90e4){var _0x1febb0={};_0x1febb0[_0x3c90e4]={'$like':'%'+_0xfe2c48['query'][_0x3c00('0x51')]+'%'};return _0x1febb0;})});}if(_0xfe2c48[_0x3c00('0x31')][_0x3c00('0x95')]){var _0x5d23ba=_0xfe2c48['query'][_0x3c00('0x95')]['split'](',');var _0x2ff91d={};_0x2ff91d[_0x5d23ba[0x0]]={'$gte':moment(_0x5d23ba[0x1])[_0x3c00('0x96')](_0x3c00('0x97'))};_0x1b3cf1[_0x3c00('0x39')]=_[_0x3c00('0x3a')](_0x1b3cf1[_0x3c00('0x39')],_0x2ff91d);}_0x1b3cf1=_[_0x3c00('0x3a')]({},_0x1b3cf1,_0xfe2c48['options']);return db[_0x3c00('0x94')][_0x3c00('0x20')]({'where':_0x1b3cf1[_0x3c00('0x39')]})['then'](function(_0x5d8144){_0x3cda4c[_0x3c00('0x20')]=_0x5d8144;if(_0xfe2c48[_0x3c00('0x31')]['includeAll']){_0x1b3cf1[_0x3c00('0x3e')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x1b3cf1);})[_0x3c00('0xf')](function(_0x16a297){if(_0xfe2c48[_0x3c00('0x31')]['inlineCss']==='true'){for(var _0x17935b=0x0;_0x17935b<_0x16a297[_0x3c00('0x37')];_0x17935b++){_0x16a297[_0x17935b]['body']=juice(_0x16a297[_0x17935b]['body']);}}_0x3cda4c[_0x3c00('0x40')]=_0x16a297;return _0x3cda4c;});}})['then'](respondWithFilteredResult(_0x34bbcf,_0x1b3cf1))[_0x3c00('0x19')](handleError(_0x34bbcf,null));};exports[_0x3c00('0x28')]=function(_0x571614,_0x324ded){var _0x53967c,_0x13b600={},_0xe391c;if(_0x571614['body']['to']){_0xe391c=_0x571614[_0x3c00('0x44')]['to'][_0x3c00('0x98')](',')[0x0];}return db[_0x3c00('0x3c')][_0x3c00('0x43')]({'where':{'id':_0x571614[_0x3c00('0x48')]['id']},'include':[{'model':db[_0x3c00('0x99')],'as':_0x3c00('0x9a'),'include':[{'model':db[_0x3c00('0x81')],'as':_0x3c00('0x9b'),'where':{'email':_0xe391c},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x3c00('0x2b')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x3c00('0x9c')],'as':_0x3c00('0x9c'),'raw':!![]}]}]})[_0x3c00('0xf')](handleEntityNotFound(_0x324ded,null))[_0x3c00('0xf')](function(_0x2d1573){if(!_0x2d1573)return;_0x53967c=_0x2d1573;if(!_0x2d1573['Smtp'])throw new Error(_0x3c00('0x9d'));if(_[_0x3c00('0x9e')](_0x571614[_0x3c00('0x44')][_0x3c00('0x9f')])){_0x571614[_0x3c00('0x44')][_0x3c00('0x9f')]=util[_0x3c00('0x96')](_0x3c00('0xa0'),_0x2d1573[_0x3c00('0x27')],_0x2d1573[_0x3c00('0xa1')]||_0x2d1573[_0x3c00('0x42')][_0x3c00('0x63')]);}if(_0x571614['body'][_0x3c00('0xa2')]&&_0x571614[_0x3c00('0x44')][_0x3c00('0xa2')]['length']){for(var _0x4d21d3=0x0;_0x4d21d3<_0x571614[_0x3c00('0x44')][_0x3c00('0xa2')][_0x3c00('0x37')];_0x4d21d3+=0x1){_0x571614[_0x3c00('0x44')][_0x3c00('0xa2')][_0x4d21d3]={'filename':_0x571614[_0x3c00('0x44')][_0x3c00('0xa2')][_0x4d21d3][_0x3c00('0x27')],'path':path[_0x3c00('0xa3')](config[_0x3c00('0xa4')],'server/files/attachments',_0x571614[_0x3c00('0x44')][_0x3c00('0xa2')][_0x4d21d3]['basename'])};}}var _0x30e63b=_0x2d1573[_0x3c00('0xa5')]();return respondWithRpcPromise(_0x3c00('0xa6'),_0x3c00('0xa7'),{'account':_0x30e63b,'message':_0x571614[_0x3c00('0x44')]});})[_0x3c00('0xf')](function(_0x3a7eb8){if(!_0x3a7eb8)return;_0x13b600=_0x3a7eb8;if(!_0x53967c[_0x3c00('0x9a')])throw new Error('List\x20not\x20found');if(_0x53967c[_0x3c00('0x9a')]['Contacts'][_0x3c00('0x37')])return _0x53967c[_0x3c00('0x9a')][_0x3c00('0x9b')][0x0];return db[_0x3c00('0x81')]['create'](_['defaults'](_0x571614[_0x3c00('0x44')],{'firstName':_0x571614[_0x3c00('0x44')]['to'],'email':_0x571614['body']['to'],'phone':_0x571614[_0x3c00('0x44')]['to'],'ListId':_0x53967c[_0x3c00('0x6e')]}));})[_0x3c00('0xf')](function(_0x470f07){if(!_0x470f07)return;var _0x233b75={'UserId':_0x571614[_0x3c00('0x63')]['id'],'ContactId':_0x470f07['id'],'MailAccountId':_0x53967c['id'],'inReplyTo':_0x13b600['messageId'],'to':_0x571614[_0x3c00('0x44')][_0x3c00('0x9f')],'cc':_0x571614[_0x3c00('0x44')]['cc'],'subject':_0x571614[_0x3c00('0x44')][_0x3c00('0xa8')],'attach':_0x571614[_0x3c00('0x44')]['attach'],'firstMsgDirection':_0x3c00('0xa9'),'lastMsgAt':moment()['format'](_0x3c00('0x97')),'lastMsgDirection':_0x3c00('0xa9'),'Messages':[_['merge'](_0x571614[_0x3c00('0x44')],{'messageId':_0x13b600[_0x3c00('0xaa')],'sentAt':moment()['format'](_0x3c00('0x97')),'read':!![],'MailAccountId':_0x53967c['id'],'UserId':_0x571614[_0x3c00('0x63')]['id'],'ContactId':_0x470f07['id']})]};if(_0x571614[_0x3c00('0x44')]['Interaction']){_0x233b75=_[_0x3c00('0x3a')](_0x233b75,_0x571614[_0x3c00('0x44')][_0x3c00('0xab')]);}return db[_0x3c00('0x7d')][_0x3c00('0x4c')](_0x233b75,{'include':[{'model':db[_0x3c00('0x94')],'as':_0x3c00('0xac')}]});})['then'](respondWithResult(_0x324ded,null))[_0x3c00('0x19')](handleError(_0x324ded,null));};exports[_0x3c00('0xad')]=function(_0x1050a3,_0x32f131){return db[_0x3c00('0x3c')]['find']({'where':{'id':_0x1050a3[_0x3c00('0x48')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x3c00('0x42'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x3c00('0x9c'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x32f131,null))['then'](function(_0x3cbc2c){if(!_0x3cbc2c[_0x3c00('0x42')])return;var _0x2af19a=_0x3cbc2c[_0x3c00('0xa5')]();return respondWithRpcPromise(_0x3c00('0xae'),_0x3c00('0xad'),{'account':_0x2af19a});})[_0x3c00('0xf')](respondWithResult(_0x32f131,null))[_0x3c00('0x19')](handleError(_0x32f131,null));};exports[_0x3c00('0x22')]=function(_0xdfdb50,_0x5d47ec){return db[_0x3c00('0x3c')][_0x3c00('0x43')]({'where':{'id':_0xdfdb50['params']['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0x5d47ec,null))[_0x3c00('0xf')](function(_0x384e31){if(_0x384e31&&_0x384e31['service']){throw new db[(_0x3c00('0xaf'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x384e31;})[_0x3c00('0xf')](removeEntity(_0x5d47ec,null))[_0x3c00('0x19')](handleError(_0x5d47ec,null));};exports[_0x3c00('0xb0')]=function(_0xf53533,_0x5a1712){return db[_0x3c00('0x3c')][_0x3c00('0x43')]({'where':{'id':_0xf53533[_0x3c00('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a1712,null))['then'](function(_0x109834){if(_0x109834){return _0x109834[_0x3c00('0xb0')](_0xf53533[_0x3c00('0x44')][_0x3c00('0x53')],_['omit'](_0xf53533[_0x3c00('0x44')],[_0x3c00('0x53'),'id'])||{})[_0x3c00('0xb1')](function(_0xf0c421){for(var _0xad8a63=0x0;_0xad8a63<_0xf53533[_0x3c00('0x44')]['ids']['length'];_0xad8a63+=0x1){socket[_0x3c00('0xb2')]('userMailAccount:save',{'UserId':Number(_0xf53533[_0x3c00('0x44')][_0x3c00('0x53')][_0xad8a63]),'MailAccountId':Number(_0xf53533[_0x3c00('0x48')]['id'])});}return _0xf0c421;});}})[_0x3c00('0xf')](respondWithResult(_0x5a1712,null))[_0x3c00('0x19')](handleError(_0x5a1712,null));};exports[_0x3c00('0xb3')]=function(_0x88c007,_0x159a97){return db['MailAccount'][_0x3c00('0x43')]({'where':{'id':_0x88c007['params']['id']}})['then'](handleEntityNotFound(_0x159a97,null))[_0x3c00('0xf')](function(_0x5bfd4a){if(_0x5bfd4a){return _0x5bfd4a[_0x3c00('0xb3')](_0x88c007['query'][_0x3c00('0x53')])[_0x3c00('0xf')](function(){if(_['isArray'](_0x88c007['query'][_0x3c00('0x53')])){for(var _0xc602f5=0x0;_0xc602f5<_0x88c007[_0x3c00('0x31')][_0x3c00('0x53')]['length'];_0xc602f5+=0x1){socket[_0x3c00('0xb2')](_0x3c00('0xb4'),{'UserId':Number(_0x88c007[_0x3c00('0x31')][_0x3c00('0x53')][_0xc602f5]),'MailAccountId':Number(_0x88c007[_0x3c00('0x48')]['id'])});}}else{socket[_0x3c00('0xb2')]('userMailAccount:remove',{'UserId':Number(_0x88c007['query'][_0x3c00('0x53')]),'MailAccountId':Number(_0x88c007[_0x3c00('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x159a97,null))[_0x3c00('0x19')](handleError(_0x159a97,null));};exports['getAgents']=function(_0x56bbdf,_0xf769a2){var _0x24fa00={};var _0x167233={};var _0x5ef7ab;var _0x591136;return db['MailAccount'][_0x3c00('0x56')]({'where':{'id':_0x56bbdf['params']['id']}})[_0x3c00('0xf')](handleEntityNotFound(_0xf769a2,null))[_0x3c00('0xf')](function(_0x2a16e4){if(_0x2a16e4){_0x5ef7ab=_0x2a16e4;_0x167233[_0x3c00('0x30')]=_[_0x3c00('0x32')](db[_0x3c00('0x83')][_0x3c00('0x2f')]);_0x167233[_0x3c00('0x31')]=_[_0x3c00('0x32')](_0x56bbdf[_0x3c00('0x31')]);_0x167233['filters']=_[_0x3c00('0x35')](_0x167233[_0x3c00('0x30')],_0x167233[_0x3c00('0x31')]);_0x24fa00[_0x3c00('0x34')]=_[_0x3c00('0x35')](_0x167233[_0x3c00('0x30')],qs[_0x3c00('0x36')](_0x56bbdf[_0x3c00('0x31')][_0x3c00('0x36')]));_0x24fa00['attributes']=_0x24fa00[_0x3c00('0x34')][_0x3c00('0x37')]?_0x24fa00[_0x3c00('0x34')]:_0x167233[_0x3c00('0x30')];_0x24fa00[_0x3c00('0x4f')]=qs[_0x3c00('0x38')](_0x56bbdf['query'][_0x3c00('0x38')]);_0x24fa00[_0x3c00('0x39')]=qs['filters'](_[_0x3c00('0x57')](_0x56bbdf[_0x3c00('0x31')],_0x167233[_0x3c00('0x33')]));if(_0x56bbdf['query']['filter']){_0x24fa00[_0x3c00('0x39')]=_[_0x3c00('0x3a')](_0x24fa00[_0x3c00('0x39')],{'$or':_[_0x3c00('0x2e')](_0x24fa00[_0x3c00('0x34')],function(_0x389a8f){var _0x5290cd={};_0x5290cd[_0x389a8f]={'$like':'%'+_0x56bbdf[_0x3c00('0x31')][_0x3c00('0x51')]+'%'};return _0x5290cd;})});}_0x24fa00=_[_0x3c00('0x3a')]({},_0x24fa00,_0x56bbdf[_0x3c00('0x3b')]);return _0x5ef7ab[_0x3c00('0xb5')](_0x24fa00);}})[_0x3c00('0xf')](function(_0x4c4308){if(_0x4c4308){_0x591136=_0x4c4308['length'];if(!_0x56bbdf['query'][_0x3c00('0x4d')](_0x3c00('0x4e'))){_0x24fa00[_0x3c00('0x1f')]=qs['limit'](_0x56bbdf[_0x3c00('0x31')][_0x3c00('0x1f')]);_0x24fa00[_0x3c00('0x1d')]=qs[_0x3c00('0x1d')](_0x56bbdf[_0x3c00('0x31')][_0x3c00('0x1d')]);}return _0x5ef7ab[_0x3c00('0xb5')](_0x24fa00);}})['then'](function(_0x10328a){if(_0x10328a){return _0x10328a?{'count':_0x591136,'rows':_0x10328a}:null;}})[_0x3c00('0xf')](respondWithResult(_0xf769a2,null))[_0x3c00('0x19')](handleError(_0xf769a2,null));}; \ No newline at end of file +var _0xc595=['Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','email','attachments','join','basename','Contacts','ListId','messageId','subject','attach','out','Interaction','Messages','getSmtpOptions','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','update','MailAccounts','UserProfileResource','destroy','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','includeAll','include','logging','findAll','rows','catch','show','keys','merge','options','body','modernAuthentication','CloudProviderId','secure','find','params','describe','MailAccountId','create','getDispositions','Disposition','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','gmail','imap.gmail.com','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp-mail.outlook.com','smtp.office365.com','yahoo','hotmail','user','username','password','pass','host','port','service','authentication','provider','custom','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','getImap','findOne','addImap','removeImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','addApplications','sequelize','transaction'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xc595,0xf7));var _0x5c59=function(_0xc94e67,_0x397170){_0xc94e67=_0xc94e67-0x0;var _0x39b095=_0xc595[_0xc94e67];return _0x39b095;};'use strict';var moment=require(_0x5c59('0x0'));var BPromise=require(_0x5c59('0x1'));var util=require(_0x5c59('0x2'));var path=require(_0x5c59('0x3'));var _=require('lodash');var juice=require(_0x5c59('0x4'));var Redis=require(_0x5c59('0x5'));var qs=require(_0x5c59('0x6'));var logger=require(_0x5c59('0x7'))(_0x5c59('0x8'));var config=require(_0x5c59('0x9'));var db=require(_0x5c59('0xa'))['db'];config['redis']=_[_0x5c59('0xb')](config[_0x5c59('0xc')],{'host':_0x5c59('0xd'),'port':0x18eb});var socket=require(_0x5c59('0xe'))(new Redis(config[_0x5c59('0xc')]));require(_0x5c59('0xf'))['register'](socket);var jayson=require(_0x5c59('0x10'));var client=jayson[_0x5c59('0x11')]['http']({'port':0x232b});function respondWithRpcPromise(_0x46a2dd,_0x1c71da,_0x33ea84,_0x592fe5){return new BPromise(function(_0x3f0e4a,_0x4558dd){var _0x5461f9=_0x592fe5||client;return _0x5461f9[_0x5c59('0x12')](_0x46a2dd,_0x33ea84)[_0x5c59('0x13')](function(_0x5d79d7){logger[_0x5c59('0x14')](_0x5c59('0x15'),_0x1c71da,_0x5c59('0x16'));logger[_0x5c59('0x17')](_0x5c59('0x18'),_0x1c71da,_0x5c59('0x16'),JSON[_0x5c59('0x19')](_0x5d79d7));if(_0x5d79d7[_0x5c59('0x1a')]){if(_0x5d79d7['error'][_0x5c59('0x1b')]===0x1f4){logger[_0x5c59('0x1a')](_0x5c59('0x15'),_0x1c71da,_0x5d79d7[_0x5c59('0x1a')][_0x5c59('0x1c')]);return _0x4558dd(_0x5d79d7[_0x5c59('0x1a')]['message']);}logger[_0x5c59('0x1a')](_0x5c59('0x15'),_0x1c71da,_0x5d79d7[_0x5c59('0x1a')][_0x5c59('0x1c')]);return _0x3f0e4a(_0x5d79d7[_0x5c59('0x1a')][_0x5c59('0x1c')]);}else{logger['info'](_0x5c59('0x15'),_0x1c71da,_0x5c59('0x16'));_0x3f0e4a(_0x5d79d7[_0x5c59('0x1d')][_0x5c59('0x1c')]);}})['catch'](function(_0x4bd76c){logger[_0x5c59('0x1a')]('MailAccount,\x20%s,\x20%s',_0x1c71da,_0x4bd76c);_0x4558dd(_0x4bd76c);});});}function respondWithStatusCode(_0x51dcf1,_0x42bf8d){_0x42bf8d=_0x42bf8d||0xcc;return function(_0x3b351d){if(_0x3b351d){return _0x51dcf1[_0x5c59('0x1e')](_0x42bf8d);}return _0x51dcf1[_0x5c59('0x1f')](_0x42bf8d)[_0x5c59('0x20')]();};}function respondWithResult(_0x934c08,_0x4a2ade){_0x4a2ade=_0x4a2ade||0xc8;return function(_0x1839f0){if(_0x1839f0){return _0x934c08['status'](_0x4a2ade)[_0x5c59('0x21')](_0x1839f0);}};}function respondWithFilteredResult(_0xd88c55,_0x2ee915){return function(_0x4e3d16){if(_0x4e3d16){var _0x47bbe6=typeof _0x2ee915[_0x5c59('0x22')]===_0x5c59('0x23')&&typeof _0x2ee915[_0x5c59('0x24')]===_0x5c59('0x23');var _0x1bf7f1=_0x4e3d16['count'];var _0x4cd05d=_0x47bbe6?0x0:_0x2ee915[_0x5c59('0x22')];var _0x154bfa=_0x47bbe6?_0x4e3d16[_0x5c59('0x25')]:_0x2ee915[_0x5c59('0x22')]+_0x2ee915[_0x5c59('0x24')];var _0x523200;if(_0x154bfa>=_0x1bf7f1){_0x154bfa=_0x1bf7f1;_0x523200=0xc8;}else{_0x523200=0xce;}_0xd88c55[_0x5c59('0x1f')](_0x523200);return _0xd88c55['set']('Content-Range',_0x4cd05d+'-'+_0x154bfa+'/'+_0x1bf7f1)['json'](_0x4e3d16);}return null;};}function saveUpdates(_0x25d026){return function(_0xf8fd36){if(_0xf8fd36){return _0xf8fd36[_0x5c59('0x26')](_0x25d026)[_0x5c59('0x13')](function(_0x324c09){return _0x324c09;});}return null;};}function removeEntity(_0x18e1b1){return function(_0x3ec417){if(_0x3ec417){return _0x3ec417['destroy']()[_0x5c59('0x13')](function(){var _0x165ca7=_0x3ec417['get']({'plain':!![]});var _0x32e023=_0x5c59('0x27');return db[_0x5c59('0x28')][_0x5c59('0x29')]({'where':{'type':_0x32e023,'resourceId':_0x165ca7['id']}})[_0x5c59('0x13')](function(){return _0x3ec417;});})[_0x5c59('0x13')](function(){_0x18e1b1[_0x5c59('0x1f')](0xcc)[_0x5c59('0x20')]();});}};}function handleEntityNotFound(_0x913edc){return function(_0x4aca60){if(!_0x4aca60){_0x913edc[_0x5c59('0x1e')](0x194);}return _0x4aca60;};}function handleError(_0x371379,_0x1d86f3){_0x1d86f3=_0x1d86f3||0x1f4;return function(_0x2275c7){logger['error'](_0x2275c7[_0x5c59('0x2a')]);if(_0x2275c7[_0x5c59('0x2b')]){delete _0x2275c7[_0x5c59('0x2b')];}_0x371379['status'](_0x1d86f3)[_0x5c59('0x2c')](_0x2275c7);};}exports[_0x5c59('0x2d')]=function(_0x577be6,_0x367e2c){var _0x2ce25d={'include':[{'model':db[_0x5c59('0x2e')],'as':_0x5c59('0x2f')},{'model':db[_0x5c59('0x30')],'as':_0x5c59('0x31')},{'model':db[_0x5c59('0x32')],'as':_0x5c59('0x33')}]},_0x13a1fa={},_0x19c765={'count':0x0,'rows':[]};var _0x49b0de=_[_0x5c59('0x34')](db[_0x5c59('0x35')][_0x5c59('0x36')],function(_0x4ddec2){return{'name':_0x4ddec2[_0x5c59('0x37')],'type':_0x4ddec2[_0x5c59('0x38')][_0x5c59('0x39')]};});_0x13a1fa[_0x5c59('0x3a')]=_[_0x5c59('0x34')](_0x49b0de,_0x5c59('0x2b'));_0x13a1fa[_0x5c59('0x3b')]=_['keys'](_0x577be6[_0x5c59('0x3b')]);_0x13a1fa[_0x5c59('0x3c')]=_[_0x5c59('0x3d')](_0x13a1fa[_0x5c59('0x3a')],_0x13a1fa[_0x5c59('0x3b')]);_0x2ce25d[_0x5c59('0x3e')]=_['intersection'](_0x13a1fa['model'],qs['fields'](_0x577be6['query'][_0x5c59('0x3f')]));_0x2ce25d[_0x5c59('0x3e')]=_0x2ce25d[_0x5c59('0x3e')][_0x5c59('0x40')]?_0x2ce25d['attributes']:_0x13a1fa['model'];if(!_0x577be6[_0x5c59('0x3b')][_0x5c59('0x41')](_0x5c59('0x42'))){_0x2ce25d[_0x5c59('0x24')]=qs[_0x5c59('0x24')](_0x577be6[_0x5c59('0x3b')]['limit']);_0x2ce25d[_0x5c59('0x22')]=qs['offset'](_0x577be6[_0x5c59('0x3b')][_0x5c59('0x22')]);}_0x2ce25d['order']=qs['sort'](_0x577be6[_0x5c59('0x3b')][_0x5c59('0x43')]);_0x2ce25d['where']=qs[_0x5c59('0x3c')](_[_0x5c59('0x44')](_0x577be6[_0x5c59('0x3b')],_0x13a1fa['filters']),_0x49b0de);if(_0x577be6[_0x5c59('0x3b')][_0x5c59('0x45')]){_0x2ce25d[_0x5c59('0x46')]=_['merge'](_0x2ce25d[_0x5c59('0x46')],{'$or':_[_0x5c59('0x34')](_0x49b0de,function(_0x206a77){if(_0x206a77[_0x5c59('0x38')]!==_0x5c59('0x47')){var _0x50797f={};_0x50797f[_0x206a77['name']]={'$like':'%'+_0x577be6[_0x5c59('0x3b')][_0x5c59('0x45')]+'%'};return _0x50797f;}})});}_0x2ce25d=_['merge']({},_0x2ce25d,_0x577be6['options']);var _0x995e6c={'where':_0x2ce25d[_0x5c59('0x46')]};return db['MailAccount'][_0x5c59('0x25')](_0x995e6c)[_0x5c59('0x13')](function(_0x85f052){_0x19c765[_0x5c59('0x25')]=_0x85f052;if(_0x577be6[_0x5c59('0x3b')][_0x5c59('0x48')]){_0x2ce25d[_0x5c59('0x49')]=[{'all':!![]}];}_0x2ce25d[_0x5c59('0x4a')]=!![];return db[_0x5c59('0x35')][_0x5c59('0x4b')](_0x2ce25d);})[_0x5c59('0x13')](function(_0xd13136){_0x19c765[_0x5c59('0x4c')]=_0xd13136;return _0x19c765;})['then'](respondWithFilteredResult(_0x367e2c,_0x2ce25d))[_0x5c59('0x4d')](handleError(_0x367e2c,null));};exports[_0x5c59('0x4e')]=function(_0x18497b,_0x3a6116){var _0x475dcc={'raw':![],'where':{'id':_0x18497b['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x5c59('0x2f')},{'model':db['MailServerOut'],'as':_0x5c59('0x31')},{'model':db['Pause'],'as':_0x5c59('0x33')}]},_0x5306e2={};_0x5306e2[_0x5c59('0x3a')]=_[_0x5c59('0x4f')](db[_0x5c59('0x35')]['rawAttributes']);_0x5306e2[_0x5c59('0x3b')]=_['keys'](_0x18497b[_0x5c59('0x3b')]);_0x5306e2[_0x5c59('0x3c')]=_['intersection'](_0x5306e2['model'],_0x5306e2[_0x5c59('0x3b')]);_0x475dcc['attributes']=_[_0x5c59('0x3d')](_0x5306e2[_0x5c59('0x3a')],qs[_0x5c59('0x3f')](_0x18497b['query']['fields']));_0x475dcc['attributes']=_0x475dcc[_0x5c59('0x3e')][_0x5c59('0x40')]?_0x475dcc[_0x5c59('0x3e')]:_0x5306e2['model'];if(_0x18497b['query'][_0x5c59('0x48')]){_0x475dcc['include']=[{'all':!![]}];}_0x475dcc=_[_0x5c59('0x50')]({},_0x475dcc,_0x18497b[_0x5c59('0x51')]);return db[_0x5c59('0x35')]['find'](_0x475dcc)[_0x5c59('0x13')](handleEntityNotFound(_0x3a6116,null))[_0x5c59('0x13')](respondWithResult(_0x3a6116,null))[_0x5c59('0x4d')](handleError(_0x3a6116,null));};exports[_0x5c59('0x26')]=function(_0x3d8c88,_0x92efb4){if(_0x3d8c88[_0x5c59('0x52')]['id']){delete _0x3d8c88['body']['id'];}if(_0x3d8c88[_0x5c59('0x52')][_0x5c59('0x2f')]){if(!_0x3d8c88[_0x5c59('0x52')]['Imap'][_0x5c59('0x53')]){_0x3d8c88['body']['Imap'][_0x5c59('0x54')]=null;}}if(_0x3d8c88[_0x5c59('0x52')][_0x5c59('0x31')]){if(_0x3d8c88[_0x5c59('0x52')]['Smtp'][_0x5c59('0x53')]){_0x3d8c88[_0x5c59('0x52')][_0x5c59('0x31')][_0x5c59('0x55')]=![];}else{_0x3d8c88[_0x5c59('0x52')][_0x5c59('0x31')][_0x5c59('0x54')]=null;}}return db[_0x5c59('0x35')][_0x5c59('0x56')]({'where':{'id':_0x3d8c88[_0x5c59('0x57')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x5c59('0x31')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x5c59('0x13')](handleEntityNotFound(_0x92efb4,null))[_0x5c59('0x13')](saveUpdates(_0x3d8c88[_0x5c59('0x52')],null))[_0x5c59('0x13')](function(_0x21929b){if(_0x21929b&&_0x3d8c88[_0x5c59('0x52')][_0x5c59('0x2f')]){return db[_0x5c59('0x2e')][_0x5c59('0x26')](_0x3d8c88[_0x5c59('0x52')][_0x5c59('0x2f')],{'where':{'MailAccountId':_0x21929b['id']}})[_0x5c59('0x13')](function(){return _0x21929b;});}return _0x21929b;})[_0x5c59('0x13')](function(_0x2510ef){if(_0x2510ef&&_0x3d8c88[_0x5c59('0x52')][_0x5c59('0x31')]){return db[_0x5c59('0x30')][_0x5c59('0x26')](_0x3d8c88['body'][_0x5c59('0x31')],{'where':{'MailAccountId':_0x2510ef['id']}})[_0x5c59('0x13')](function(){return _0x2510ef;});}return _0x2510ef;})[_0x5c59('0x13')](respondWithResult(_0x92efb4,null))[_0x5c59('0x4d')](handleError(_0x92efb4,null));};exports[_0x5c59('0x58')]=function(_0xc757d1,_0x5c1bd5){return db['MailAccount'][_0x5c59('0x58')]()[_0x5c59('0x13')](respondWithResult(_0x5c1bd5,null))[_0x5c59('0x4d')](handleError(_0x5c1bd5,null));};exports['addDisposition']=function(_0x3a3a92,_0x16cb5f){if(_0x3a3a92[_0x5c59('0x52')]['id']){delete _0x3a3a92[_0x5c59('0x52')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x3a3a92[_0x5c59('0x57')]['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x16cb5f,null))[_0x5c59('0x13')](function(_0x20c08f){if(_0x20c08f){_0x3a3a92[_0x5c59('0x52')][_0x5c59('0x59')]=_0x20c08f['id'];return db['Disposition'][_0x5c59('0x5a')](_0x3a3a92['body']);}})[_0x5c59('0x13')](respondWithResult(_0x16cb5f,null))['catch'](handleError(_0x16cb5f,null));};exports[_0x5c59('0x5b')]=function(_0x1923b0,_0x568b4b){var _0x35c353={'raw':![],'where':{}};var _0x437e1b={};var _0x52a42d={'count':0x0,'rows':[]};return db[_0x5c59('0x35')]['findOne']({'where':{'id':_0x1923b0[_0x5c59('0x57')]['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x568b4b,null))[_0x5c59('0x13')](function(_0x4c6b5a){if(_0x4c6b5a){_0x437e1b[_0x5c59('0x3a')]=_[_0x5c59('0x4f')](db[_0x5c59('0x5c')][_0x5c59('0x36')]);_0x437e1b[_0x5c59('0x3b')]=_[_0x5c59('0x4f')](_0x1923b0['query']);_0x437e1b[_0x5c59('0x3c')]=_[_0x5c59('0x3d')](_0x437e1b[_0x5c59('0x3a')],_0x437e1b[_0x5c59('0x3b')]);_0x35c353[_0x5c59('0x3e')]=_[_0x5c59('0x3d')](_0x437e1b['model'],qs['fields'](_0x1923b0[_0x5c59('0x3b')][_0x5c59('0x3f')]));_0x35c353[_0x5c59('0x3e')]=_0x35c353[_0x5c59('0x3e')][_0x5c59('0x40')]?_0x35c353[_0x5c59('0x3e')]:_0x437e1b[_0x5c59('0x3a')];if(!_0x1923b0[_0x5c59('0x3b')][_0x5c59('0x41')](_0x5c59('0x42'))){_0x35c353[_0x5c59('0x24')]=qs[_0x5c59('0x24')](_0x1923b0[_0x5c59('0x3b')][_0x5c59('0x24')]);_0x35c353['offset']=qs[_0x5c59('0x22')](_0x1923b0[_0x5c59('0x3b')][_0x5c59('0x22')]);}_0x35c353[_0x5c59('0x5d')]=qs['sort'](_0x1923b0[_0x5c59('0x3b')][_0x5c59('0x43')]);_0x35c353[_0x5c59('0x46')]=qs[_0x5c59('0x3c')](_[_0x5c59('0x44')](_0x1923b0['query'],_0x437e1b[_0x5c59('0x3c')]));_0x35c353[_0x5c59('0x46')][_0x5c59('0x59')]=_0x4c6b5a['id'];if(_0x1923b0[_0x5c59('0x3b')]['filter']){_0x35c353['where']=_[_0x5c59('0x50')](_0x35c353[_0x5c59('0x46')],{'$or':_[_0x5c59('0x34')](_0x35c353[_0x5c59('0x3e')],function(_0x581df3){var _0x1478fe={};_0x1478fe[_0x581df3]={'$like':'%'+_0x1923b0[_0x5c59('0x3b')]['filter']+'%'};return _0x1478fe;})});}_0x35c353=_[_0x5c59('0x50')]({},_0x35c353,_0x1923b0['options']);return db[_0x5c59('0x5c')]['count']({'where':_0x35c353['where']})[_0x5c59('0x13')](function(_0x5c242c){_0x52a42d[_0x5c59('0x25')]=_0x5c242c;if(_0x1923b0[_0x5c59('0x3b')]['includeAll']){_0x35c353['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x35c353);})['then'](function(_0x3ca61e){_0x52a42d['rows']=_0x3ca61e;return _0x52a42d;});}})[_0x5c59('0x13')](respondWithFilteredResult(_0x568b4b,_0x35c353))[_0x5c59('0x4d')](handleError(_0x568b4b,null));};exports[_0x5c59('0x5e')]=function(_0x5bbcf6,_0x551d6a){return db[_0x5c59('0x35')][_0x5c59('0x56')]({'where':{'id':_0x5bbcf6[_0x5c59('0x57')]['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x551d6a,null))[_0x5c59('0x13')](function(_0xa9fc3e){if(_0xa9fc3e){return _0xa9fc3e[_0x5c59('0x5e')](_0x5bbcf6[_0x5c59('0x3b')]['ids']);}})[_0x5c59('0x13')](respondWithStatusCode(_0x551d6a,null))[_0x5c59('0x4d')](handleError(_0x551d6a,null));};exports[_0x5c59('0x5f')]=function(_0x334eee,_0x12dc2a){if(_0x334eee[_0x5c59('0x52')]['id']){delete _0x334eee[_0x5c59('0x52')]['id'];}return db['MailAccount'][_0x5c59('0x56')]({'where':{'id':_0x334eee['params']['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x12dc2a,null))[_0x5c59('0x13')](function(_0x1833ef){if(_0x1833ef){_0x334eee[_0x5c59('0x52')][_0x5c59('0x59')]=_0x1833ef['id'];return db[_0x5c59('0x60')][_0x5c59('0x5a')](_0x334eee[_0x5c59('0x52')]);}})[_0x5c59('0x13')](respondWithResult(_0x12dc2a,null))[_0x5c59('0x4d')](handleError(_0x12dc2a,null));};exports[_0x5c59('0x61')]=function(_0x249b7f,_0x260eea){var _0x50f83d={'raw':![],'where':{}};var _0x29e17b={};var _0x4e3795={'count':0x0,'rows':[]};return db[_0x5c59('0x35')]['findOne']({'where':{'id':_0x249b7f['params']['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x260eea,null))[_0x5c59('0x13')](function(_0x301d5f){if(_0x301d5f){_0x29e17b[_0x5c59('0x3a')]=_[_0x5c59('0x4f')](db['CannedAnswer'][_0x5c59('0x36')]);_0x29e17b['query']=_['keys'](_0x249b7f['query']);_0x29e17b[_0x5c59('0x3c')]=_[_0x5c59('0x3d')](_0x29e17b[_0x5c59('0x3a')],_0x29e17b[_0x5c59('0x3b')]);_0x50f83d['attributes']=_['intersection'](_0x29e17b[_0x5c59('0x3a')],qs[_0x5c59('0x3f')](_0x249b7f['query']['fields']));_0x50f83d[_0x5c59('0x3e')]=_0x50f83d[_0x5c59('0x3e')][_0x5c59('0x40')]?_0x50f83d[_0x5c59('0x3e')]:_0x29e17b['model'];if(!_0x249b7f[_0x5c59('0x3b')][_0x5c59('0x41')](_0x5c59('0x42'))){_0x50f83d[_0x5c59('0x24')]=qs['limit'](_0x249b7f[_0x5c59('0x3b')][_0x5c59('0x24')]);_0x50f83d[_0x5c59('0x22')]=qs['offset'](_0x249b7f[_0x5c59('0x3b')][_0x5c59('0x22')]);}_0x50f83d[_0x5c59('0x5d')]=qs[_0x5c59('0x43')](_0x249b7f[_0x5c59('0x3b')][_0x5c59('0x43')]);_0x50f83d['where']=qs[_0x5c59('0x3c')](_[_0x5c59('0x44')](_0x249b7f[_0x5c59('0x3b')],_0x29e17b[_0x5c59('0x3c')]));_0x50f83d[_0x5c59('0x46')]['MailAccountId']=_0x301d5f['id'];if(_0x249b7f[_0x5c59('0x3b')]['filter']){_0x50f83d['where']=_[_0x5c59('0x50')](_0x50f83d['where'],{'$or':_['map'](_0x50f83d[_0x5c59('0x3e')],function(_0x39db70){var _0x68298d={};_0x68298d[_0x39db70]={'$like':'%'+_0x249b7f['query'][_0x5c59('0x45')]+'%'};return _0x68298d;})});}_0x50f83d=_[_0x5c59('0x50')]({},_0x50f83d,_0x249b7f[_0x5c59('0x51')]);return db[_0x5c59('0x60')][_0x5c59('0x25')]({'where':_0x50f83d[_0x5c59('0x46')]})[_0x5c59('0x13')](function(_0x3e0855){_0x4e3795[_0x5c59('0x25')]=_0x3e0855;if(_0x249b7f[_0x5c59('0x3b')]['includeAll']){_0x50f83d['include']=[{'all':!![]}];}return db[_0x5c59('0x60')][_0x5c59('0x4b')](_0x50f83d);})['then'](function(_0x166a7f){_0x4e3795[_0x5c59('0x4c')]=_0x166a7f;return _0x4e3795;});}})[_0x5c59('0x13')](respondWithFilteredResult(_0x260eea,_0x50f83d))[_0x5c59('0x4d')](handleError(_0x260eea,null));};exports[_0x5c59('0x62')]=function(_0x74d24f,_0x3eaecd){return db[_0x5c59('0x35')][_0x5c59('0x56')]({'where':{'id':_0x74d24f[_0x5c59('0x57')]['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x3eaecd,null))['then'](function(_0x42c65e){if(_0x42c65e){return _0x42c65e['removeAnswers'](_0x74d24f['query'][_0x5c59('0x63')]);}})['then'](respondWithStatusCode(_0x3eaecd,null))[_0x5c59('0x4d')](handleError(_0x3eaecd,null));};function getImapHost(_0x1a21e2){switch(_0x1a21e2){case _0x5c59('0x64'):return _0x5c59('0x65');case'yahoo':return'imap.mail.yahoo.com';case'hotmail':return _0x5c59('0x66');case _0x5c59('0x67'):return'outlook.office365.com';}throw new Error(_0x5c59('0x68'),_0x1a21e2);}function getSmtpHost(_0x39ede2){switch(_0x39ede2){case _0x5c59('0x64'):return _0x5c59('0x69');case'yahoo':return'smtp.mail.yahoo.com';case'hotmail':return _0x5c59('0x6a');case _0x5c59('0x67'):return _0x5c59('0x6b');}throw new Error('Unknown\x20email\x20service\x20provider',_0x39ede2);}function getSmtpPort(_0x5be317,_0x54a56d){switch(_0x5be317){case'gmail':return _0x54a56d===!![]?0x24b:0x1d1;case _0x5c59('0x6c'):return 0x1d1;case _0x5c59('0x6d'):return 0x24b;case _0x5c59('0x67'):return 0x24b;}throw new Error(_0x5c59('0x68'),_0x5be317);}function getAuthenticationOptions(_0x217b37,_0x1c571b){var _0x578b1c={};var _0x574855={};if(_0x217b37){_0x578b1c[_0x5c59('0x6e')]=_0x574855['user']=_0x1c571b[_0x5c59('0x6f')];_0x578b1c[_0x5c59('0x70')]=_0x574855[_0x5c59('0x71')]=_0x1c571b[_0x5c59('0x70')];if(_0x1c571b[_0x5c59('0x53')]){_0x578b1c['modernAuthentication']=_0x574855[_0x5c59('0x53')]=!![];_0x578b1c[_0x5c59('0x54')]=_0x574855[_0x5c59('0x54')]=_0x1c571b[_0x5c59('0x54')];_0x578b1c[_0x5c59('0x70')]=_0x574855['pass']=null;}else{_0x578b1c[_0x5c59('0x54')]=_0x574855['CloudProviderId']=null;}_0x578b1c[_0x5c59('0x72')]=getImapHost(_0x217b37);_0x578b1c[_0x5c59('0x73')]=0x3e1;_0x574855[_0x5c59('0x72')]=getSmtpHost(_0x217b37);_0x574855[_0x5c59('0x73')]=getSmtpPort(_0x217b37,_0x574855[_0x5c59('0x55')]);_0x578b1c['service']=_0x574855[_0x5c59('0x74')]=null;}else{if(_0x1c571b['authentication']){_0x578b1c[_0x5c59('0x6e')]=_0x574855[_0x5c59('0x6e')]=_0x1c571b[_0x5c59('0x6f')];_0x578b1c[_0x5c59('0x70')]=_0x574855[_0x5c59('0x71')]=_0x1c571b[_0x5c59('0x70')];}else{_0x578b1c[_0x5c59('0x75')]=_0x574855[_0x5c59('0x75')]=![];_0x578b1c['user']=_0x574855[_0x5c59('0x6e')]=null;_0x578b1c[_0x5c59('0x70')]=_0x574855[_0x5c59('0x71')]=null;}_0x578b1c[_0x5c59('0x72')]=_0x1c571b[_0x5c59('0x2f')][_0x5c59('0x72')];_0x578b1c[_0x5c59('0x73')]=_0x1c571b[_0x5c59('0x2f')]['port'];_0x574855['host']=_0x1c571b[_0x5c59('0x31')][_0x5c59('0x72')];_0x574855[_0x5c59('0x73')]=_0x1c571b[_0x5c59('0x31')][_0x5c59('0x73')];}return{'Imap':_0x578b1c,'Smtp':_0x574855};}exports['create']=function(_0x2ba01a,_0x1788eb){var _0x3995a3={'name':_0x2ba01a['body'][_0x5c59('0x2b')],'key':_0x2ba01a['body'][_0x5c59('0x39')],'provider':_0x2ba01a[_0x5c59('0x52')][_0x5c59('0x76')]===_0x5c59('0x77')?null:_0x2ba01a[_0x5c59('0x52')]['provider'],'email':_0x2ba01a['body']['email'],'ListId':_0x2ba01a['body']['ListId'],'active':!_[_0x5c59('0x78')](_0x2ba01a[_0x5c59('0x52')][_0x5c59('0x79')])?_0x2ba01a[_0x5c59('0x52')][_0x5c59('0x79')]:!![],'description':_0x2ba01a[_0x5c59('0x52')]['description']||null};var _0x513ad9=getAuthenticationOptions(_0x3995a3[_0x5c59('0x76')],_0x2ba01a[_0x5c59('0x52')]);_0x3995a3[_0x5c59('0x2f')]=_0x513ad9['Imap'];_0x3995a3['Smtp']=_0x513ad9[_0x5c59('0x31')];return db[_0x5c59('0x35')][_0x5c59('0x5a')](_0x3995a3,{'include':[{'model':db[_0x5c59('0x30')],'as':'Smtp'},{'model':db[_0x5c59('0x2e')],'as':'Imap'}]})[_0x5c59('0x13')](function(_0x5244af){var _0x3bc0c2=_0x2ba01a[_0x5c59('0x6e')]['get']({'plain':!![]});if(!_0x3bc0c2)throw new Error(_0x5c59('0x7a'));if(_0x3bc0c2[_0x5c59('0x7b')]===_0x5c59('0x6e')){var _0x21adad=_0x5244af[_0x5c59('0x7c')]({'plain':!![]});return db[_0x5c59('0x7d')][_0x5c59('0x56')]({'where':{'name':_0x5c59('0x27'),'userProfileId':_0x3bc0c2[_0x5c59('0x7e')]},'raw':!![]})[_0x5c59('0x13')](function(_0x4c5777){if(_0x4c5777&&_0x4c5777[_0x5c59('0x7f')]===0x0){return db[_0x5c59('0x28')]['create']({'name':_0x21adad[_0x5c59('0x2b')],'resourceId':_0x21adad['id'],'type':_0x4c5777[_0x5c59('0x2b')],'sectionId':_0x4c5777['id']},{})[_0x5c59('0x13')](function(){return _0x5244af;});}else{return _0x5244af;}})[_0x5c59('0x4d')](function(_0x398614){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x398614);throw _0x398614;});}return _0x5244af;})['then'](respondWithResult(_0x1788eb,0xc9))['catch'](handleError(_0x1788eb,null));};exports[_0x5c59('0x80')]=function(_0x288d1d,_0x194a85){return db[_0x5c59('0x35')][_0x5c59('0x81')]({'where':{'id':_0x288d1d[_0x5c59('0x57')]['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x194a85,null))[_0x5c59('0x13')](function(_0x47dc80){if(_0x47dc80){return _0x47dc80['getImap']();}return null;})['then'](respondWithResult(_0x194a85,null))[_0x5c59('0x4d')](handleError(_0x194a85,null));};exports[_0x5c59('0x82')]=function(_0x133823,_0x4157d5){if(_0x133823['body']['id']){delete _0x133823['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x133823['params']['id']}})['then'](handleEntityNotFound(_0x4157d5,null))[_0x5c59('0x13')](function(_0x11e979){if(_0x11e979){_0x133823[_0x5c59('0x52')][_0x5c59('0x59')]=_0x11e979['id'];return db[_0x5c59('0x2e')][_0x5c59('0x5a')](_0x133823[_0x5c59('0x52')]);}})[_0x5c59('0x13')](respondWithResult(_0x4157d5,null))[_0x5c59('0x4d')](handleError(_0x4157d5,null));};exports[_0x5c59('0x83')]=function(_0x5d8612,_0x2ef5ce){return db[_0x5c59('0x35')][_0x5c59('0x81')]({'where':{'id':_0x5d8612[_0x5c59('0x57')]['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x2ef5ce,null))[_0x5c59('0x13')](function(_0x1b9f7b){if(_0x1b9f7b){return _0x1b9f7b['setImap'](null);}return null;})[_0x5c59('0x13')](respondWithStatusCode(_0x2ef5ce,null))[_0x5c59('0x4d')](handleError(_0x2ef5ce,null));};exports['getSmtp']=function(_0x221cd9,_0x5d237b){return db['MailAccount']['findOne']({'where':{'id':_0x221cd9[_0x5c59('0x57')]['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x5d237b,null))[_0x5c59('0x13')](function(_0x11c3dd){if(_0x11c3dd){return _0x11c3dd[_0x5c59('0x84')]();}return null;})[_0x5c59('0x13')](respondWithResult(_0x5d237b,null))['catch'](handleError(_0x5d237b,null));};exports[_0x5c59('0x85')]=function(_0x59e74f,_0x44e356){if(_0x59e74f[_0x5c59('0x52')]['id']){delete _0x59e74f[_0x5c59('0x52')]['id'];}return db[_0x5c59('0x35')]['find']({'where':{'id':_0x59e74f[_0x5c59('0x57')]['id']}})['then'](handleEntityNotFound(_0x44e356,null))[_0x5c59('0x13')](function(_0x1a603a){if(_0x1a603a){_0x59e74f['body']['MailAccountId']=_0x1a603a['id'];return db['MailServerOut'][_0x5c59('0x5a')](_0x59e74f[_0x5c59('0x52')]);}})[_0x5c59('0x13')](respondWithResult(_0x44e356,null))['catch'](handleError(_0x44e356,null));};exports['removeSmtp']=function(_0x3ef81f,_0x49ab64){return db[_0x5c59('0x35')][_0x5c59('0x81')]({'where':{'id':_0x3ef81f[_0x5c59('0x57')]['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x49ab64,null))[_0x5c59('0x13')](function(_0x2a1021){if(_0x2a1021){return _0x2a1021[_0x5c59('0x86')](null);}return null;})[_0x5c59('0x13')](respondWithStatusCode(_0x49ab64,null))[_0x5c59('0x4d')](handleError(_0x49ab64,null));};exports[_0x5c59('0x87')]=function(_0x2b70d3,_0x460008){return db[_0x5c59('0x88')]['find']({'where':{'id':_0x2b70d3[_0x5c59('0x57')]['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x460008,null))[_0x5c59('0x13')](function(_0x4d5e8f){if(_0x4d5e8f){return _0x4d5e8f['addInteraction'](_0x2b70d3[_0x5c59('0x52')]['ids'],_[_0x5c59('0x89')](_0x2b70d3[_0x5c59('0x52')],[_0x5c59('0x63'),'id'])||{});}})[_0x5c59('0x13')](respondWithResult(_0x460008,null))[_0x5c59('0x4d')](handleError(_0x460008,null));};exports[_0x5c59('0x8a')]=function(_0x2a50ab,_0x5d64fd){var _0x43f6c2={'raw':![],'where':{}};var _0x459eb1={};var _0x4cc092={'count':0x0,'rows':[]};return db[_0x5c59('0x35')][_0x5c59('0x81')]({'where':{'id':_0x2a50ab[_0x5c59('0x57')]['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x5d64fd,null))['then'](function(_0x5efe70){if(_0x5efe70){_0x459eb1[_0x5c59('0x3a')]=_['keys'](db[_0x5c59('0x88')][_0x5c59('0x36')]);_0x459eb1[_0x5c59('0x3b')]=_[_0x5c59('0x4f')](_0x2a50ab[_0x5c59('0x3b')]);_0x459eb1[_0x5c59('0x3c')]=_['intersection'](_0x459eb1['model'],_0x459eb1[_0x5c59('0x3b')]);_0x43f6c2[_0x5c59('0x3e')]=_['intersection'](_0x459eb1[_0x5c59('0x3a')],qs[_0x5c59('0x3f')](_0x2a50ab[_0x5c59('0x3b')][_0x5c59('0x3f')]));_0x43f6c2[_0x5c59('0x3e')]=_0x43f6c2[_0x5c59('0x3e')][_0x5c59('0x40')]?_0x43f6c2[_0x5c59('0x3e')]:_0x459eb1[_0x5c59('0x3a')];if(!_0x2a50ab[_0x5c59('0x3b')][_0x5c59('0x41')](_0x5c59('0x42'))){_0x43f6c2[_0x5c59('0x24')]=qs[_0x5c59('0x24')](_0x2a50ab['query'][_0x5c59('0x24')]);_0x43f6c2[_0x5c59('0x22')]=qs[_0x5c59('0x22')](_0x2a50ab[_0x5c59('0x3b')][_0x5c59('0x22')]);}_0x43f6c2[_0x5c59('0x5d')]=qs[_0x5c59('0x43')](_0x2a50ab['query'][_0x5c59('0x43')]);_0x43f6c2[_0x5c59('0x46')]=qs[_0x5c59('0x3c')](_['pick'](_0x2a50ab[_0x5c59('0x3b')],_0x459eb1['filters']));_0x43f6c2[_0x5c59('0x46')]['MailAccountId']=_0x5efe70['id'];if(_0x2a50ab['query'][_0x5c59('0x45')]){_0x43f6c2[_0x5c59('0x46')]=_[_0x5c59('0x50')](_0x43f6c2[_0x5c59('0x46')],{'$or':_['map'](_0x43f6c2[_0x5c59('0x3e')],function(_0x48e2f2){var _0x5e363e={};_0x5e363e[_0x48e2f2]={'$like':'%'+_0x2a50ab[_0x5c59('0x3b')][_0x5c59('0x45')]+'%'};return _0x5e363e;})});}_0x43f6c2=_[_0x5c59('0x50')]({},_0x43f6c2,_0x2a50ab[_0x5c59('0x51')]);return db['MailInteraction']['count']({'where':_0x43f6c2['where']})[_0x5c59('0x13')](function(_0x4fad78){_0x4cc092['count']=_0x4fad78;if(_0x2a50ab['query']['includeAll']){_0x43f6c2[_0x5c59('0x49')]=[{'model':db[_0x5c59('0x8b')],'as':_0x5c59('0x8c'),'required':![]},{'model':db[_0x5c59('0x8d')],'as':_0x5c59('0x8e'),'attributes':[_0x5c59('0x2b'),_0x5c59('0x8f'),_0x5c59('0x90')],'required':![]},{'model':db['Tag'],'as':_0x5c59('0x91'),'attributes':['id',_0x5c59('0x2b'),'color'],'where':_0x2a50ab['query']['tag']?{'id':_0x2a50ab[_0x5c59('0x3b')]['tag']}:undefined,'required':_0x2a50ab[_0x5c59('0x3b')]['tag']?!![]:![]}];}return db[_0x5c59('0x88')][_0x5c59('0x4b')](_0x43f6c2);})['then'](function(_0x3f464d){_0x4cc092['rows']=_0x3f464d;return _0x4cc092;});}})[_0x5c59('0x13')](respondWithFilteredResult(_0x5d64fd,_0x43f6c2))[_0x5c59('0x4d')](handleError(_0x5d64fd,null));};exports[_0x5c59('0x92')]=function addApplications(_0x2ed7e7,_0x48ec26){var _0x39e88e=_0x2ed7e7[_0x5c59('0x57')]['id'];var _0x475680=_0x2ed7e7['body'];var _0x2d1b45=0xc8;var _0x40662e=null;return db[_0x5c59('0x93')][_0x5c59('0x94')]({'isolationLevel':db[_0x5c59('0x93')][_0x5c59('0x95')][_0x5c59('0x96')][_0x5c59('0x97')]},function(_0x433f74){return db[_0x5c59('0x35')][_0x5c59('0x81')]({'where':{'id':_0x39e88e},'transaction':_0x433f74})[_0x5c59('0x13')](function(_0x58f247){if(_0x58f247){return db[_0x5c59('0x98')]['destroy']({'where':{'MailAccountId':_0x39e88e},'transaction':_0x433f74})[_0x5c59('0x13')](function(){var _0x22eb5e=_['map'](_0x475680,function(_0x8788d5){_0x8788d5[_0x5c59('0x59')]=_0x39e88e;return _0x8788d5;});return db[_0x5c59('0x98')][_0x5c59('0x99')](_0x22eb5e,{'transaction':_0x433f74});});}else{_0x2d1b45=0x194;_0x40662e=[];}});})[_0x5c59('0x13')](function(){if(_0x2d1b45!==0x194){return db[_0x5c59('0x98')][_0x5c59('0x9a')]({'where':{'MailAccountId':_0x39e88e},'order':_0x5c59('0x9b')})['then'](function(_0x33915f){_0x40662e=_0x33915f;});}})[_0x5c59('0x4d')](function(_0x36557f){_0x2d1b45=0x1f4;logger[_0x5c59('0x1a')](_0x36557f['stack']);if(_0x36557f[_0x5c59('0x2b')]){delete _0x36557f[_0x5c59('0x2b')];}_0x40662e=_0x36557f;})[_0x5c59('0x9c')](function(){if(_0x40662e===null){_0x48ec26['sendStatus'](_0x2d1b45);}else{if(_0x2d1b45===0x1f4){_0x48ec26[_0x5c59('0x1f')](_0x2d1b45)[_0x5c59('0x2c')](_0x40662e);}else{_0x48ec26[_0x5c59('0x1f')](_0x2d1b45)[_0x5c59('0x21')](_0x40662e);}}});};exports[_0x5c59('0x9d')]=function(_0x3307b6,_0x5336a2){var _0x2b13de={};var _0x470592={};var _0x373948;var _0x42e603;return db['MailAccount']['findOne']({'where':{'id':_0x3307b6[_0x5c59('0x57')]['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x5336a2,null))['then'](function(_0x4173ac){if(_0x4173ac){_0x373948=_0x4173ac;_0x470592[_0x5c59('0x3a')]=_[_0x5c59('0x4f')](db['MailApplication']['rawAttributes']);_0x470592[_0x5c59('0x3b')]=_[_0x5c59('0x4f')](_0x3307b6[_0x5c59('0x3b')]);_0x470592['filters']=_['intersection'](_0x470592[_0x5c59('0x3a')],_0x470592[_0x5c59('0x3b')]);_0x2b13de['attributes']=_[_0x5c59('0x3d')](_0x470592['model'],qs['fields'](_0x3307b6[_0x5c59('0x3b')][_0x5c59('0x3f')]));_0x2b13de[_0x5c59('0x3e')]=_0x2b13de[_0x5c59('0x3e')][_0x5c59('0x40')]?_0x2b13de[_0x5c59('0x3e')]:_0x470592[_0x5c59('0x3a')];_0x2b13de[_0x5c59('0x5d')]=qs[_0x5c59('0x43')](_0x3307b6[_0x5c59('0x3b')]['sort']);_0x2b13de[_0x5c59('0x46')]=qs[_0x5c59('0x3c')](_[_0x5c59('0x44')](_0x3307b6[_0x5c59('0x3b')],_0x470592[_0x5c59('0x3c')]));if(_0x3307b6[_0x5c59('0x3b')][_0x5c59('0x45')]){_0x2b13de[_0x5c59('0x46')]=_[_0x5c59('0x50')](_0x2b13de['where'],{'$or':_[_0x5c59('0x34')](_0x2b13de['attributes'],function(_0x549789){var _0x363324={};_0x363324[_0x549789]={'$like':'%'+_0x3307b6[_0x5c59('0x3b')][_0x5c59('0x45')]+'%'};return _0x363324;})});}_0x2b13de=_[_0x5c59('0x50')]({},_0x2b13de,_0x3307b6[_0x5c59('0x51')]);return _0x373948[_0x5c59('0x9d')](_0x2b13de);}})[_0x5c59('0x13')](function(_0x35225e){if(_0x35225e){_0x42e603=_0x35225e[_0x5c59('0x40')];if(!_0x3307b6[_0x5c59('0x3b')][_0x5c59('0x41')]('nolimit')){_0x2b13de[_0x5c59('0x24')]=qs[_0x5c59('0x24')](_0x3307b6[_0x5c59('0x3b')][_0x5c59('0x24')]);_0x2b13de[_0x5c59('0x22')]=qs['offset'](_0x3307b6['query'][_0x5c59('0x22')]);}return _0x373948[_0x5c59('0x9d')](_0x2b13de);}})[_0x5c59('0x13')](function(_0x308d1c){if(_0x308d1c){return _0x308d1c?{'count':_0x42e603,'rows':_0x308d1c}:null;}})[_0x5c59('0x13')](respondWithResult(_0x5336a2,null))[_0x5c59('0x4d')](handleError(_0x5336a2,null));};exports[_0x5c59('0x9e')]=function(_0x255795,_0x41ccc6){var _0x264849={'raw':!![],'where':{}};var _0x51eb7f={};var _0x4e1810={'count':0x0,'rows':[]};return db[_0x5c59('0x35')][_0x5c59('0x81')]({'where':{'id':_0x255795[_0x5c59('0x57')]['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x41ccc6,null))[_0x5c59('0x13')](function(_0x4f0dbf){if(_0x4f0dbf){_0x51eb7f['model']=_[_0x5c59('0x4f')](db[_0x5c59('0x9f')]['rawAttributes']);_0x51eb7f[_0x5c59('0x3b')]=_['keys'](_0x255795['query']);_0x51eb7f[_0x5c59('0x3c')]=_[_0x5c59('0x3d')](_0x51eb7f[_0x5c59('0x3a')],_0x51eb7f['query']);_0x264849[_0x5c59('0x3e')]=_[_0x5c59('0x3d')](_0x51eb7f[_0x5c59('0x3a')],qs[_0x5c59('0x3f')](_0x255795[_0x5c59('0x3b')][_0x5c59('0x3f')]));_0x264849[_0x5c59('0x3e')]=_0x264849[_0x5c59('0x3e')][_0x5c59('0x40')]?_0x264849[_0x5c59('0x3e')]:_0x51eb7f['model'];if(!_0x255795['query']['hasOwnProperty'](_0x5c59('0x42'))){_0x264849['limit']=qs[_0x5c59('0x24')](_0x255795[_0x5c59('0x3b')][_0x5c59('0x24')]);_0x264849['offset']=qs[_0x5c59('0x22')](_0x255795[_0x5c59('0x3b')][_0x5c59('0x22')]);}_0x264849[_0x5c59('0x5d')]=qs[_0x5c59('0x43')](_0x255795['query'][_0x5c59('0x43')]);_0x264849[_0x5c59('0x46')]=qs[_0x5c59('0x3c')](_[_0x5c59('0x44')](_0x255795[_0x5c59('0x3b')],_0x51eb7f[_0x5c59('0x3c')]));_0x264849[_0x5c59('0x46')][_0x5c59('0x59')]=_0x4f0dbf['id'];if(_0x255795[_0x5c59('0x3b')]['filter']){_0x264849[_0x5c59('0x46')]=_[_0x5c59('0x50')](_0x264849['where'],{'$or':_[_0x5c59('0x34')](_0x264849[_0x5c59('0x3e')],function(_0x37b812){var _0xdf3ef2={};_0xdf3ef2[_0x37b812]={'$like':'%'+_0x255795[_0x5c59('0x3b')][_0x5c59('0x45')]+'%'};return _0xdf3ef2;})});}if(_0x255795['query'][_0x5c59('0xa0')]){var _0x21b156=_0x255795[_0x5c59('0x3b')][_0x5c59('0xa0')][_0x5c59('0xa1')](',');var _0x519b30={};_0x519b30[_0x21b156[0x0]]={'$gte':moment(_0x21b156[0x1])[_0x5c59('0xa2')](_0x5c59('0xa3'))};_0x264849[_0x5c59('0x46')]=_['merge'](_0x264849[_0x5c59('0x46')],_0x519b30);}_0x264849=_[_0x5c59('0x50')]({},_0x264849,_0x255795['options']);return db[_0x5c59('0x9f')][_0x5c59('0x25')]({'where':_0x264849[_0x5c59('0x46')]})['then'](function(_0x44cc83){_0x4e1810[_0x5c59('0x25')]=_0x44cc83;if(_0x255795['query']['includeAll']){_0x264849[_0x5c59('0x49')]=[{'all':!![]}];}return db['MailMessage'][_0x5c59('0x4b')](_0x264849);})[_0x5c59('0x13')](function(_0x389cfe){if(_0x255795[_0x5c59('0x3b')][_0x5c59('0xa4')]===_0x5c59('0xa5')){for(var _0x11f03a=0x0;_0x11f03a<_0x389cfe[_0x5c59('0x40')];_0x11f03a++){_0x389cfe[_0x11f03a][_0x5c59('0x52')]=juice(_0x389cfe[_0x11f03a][_0x5c59('0x52')]);}}_0x4e1810[_0x5c59('0x4c')]=_0x389cfe;return _0x4e1810;});}})['then'](respondWithFilteredResult(_0x41ccc6,_0x264849))['catch'](handleError(_0x41ccc6,null));};exports['send']=function(_0x54ab79,_0x3af480){var _0x5b15c0,_0x4968c7={},_0x41a4bd;if(_0x54ab79[_0x5c59('0x52')]['to']){_0x41a4bd=_0x54ab79[_0x5c59('0x52')]['to'][_0x5c59('0xa1')](',')[0x0];}return db[_0x5c59('0x35')][_0x5c59('0x56')]({'where':{'id':_0x54ab79[_0x5c59('0x57')]['id']},'include':[{'model':db[_0x5c59('0xa6')],'as':_0x5c59('0xa7'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x41a4bd},'limit':0x1,'order':[['updatedAt',_0x5c59('0xa8')]]}]},{'model':db[_0x5c59('0x30')],'as':_0x5c59('0x31'),'raw':!![],'include':[{'model':db[_0x5c59('0xa9')],'as':_0x5c59('0xa9'),'raw':!![]}]}]})[_0x5c59('0x13')](handleEntityNotFound(_0x3af480,null))[_0x5c59('0x13')](function(_0xbebfb0){if(!_0xbebfb0)return;_0x5b15c0=_0xbebfb0;if(!_0xbebfb0[_0x5c59('0x31')])throw new Error(_0x5c59('0xaa'));if(_[_0x5c59('0x78')](_0x54ab79['body'][_0x5c59('0xab')])){_0x54ab79['body']['from']=util[_0x5c59('0xa2')]('%s\x20<%s>',_0xbebfb0['name'],_0xbebfb0[_0x5c59('0xac')]||_0xbebfb0[_0x5c59('0x31')][_0x5c59('0x6e')]);}if(_0x54ab79[_0x5c59('0x52')][_0x5c59('0xad')]&&_0x54ab79[_0x5c59('0x52')][_0x5c59('0xad')]['length']){for(var _0xb34966=0x0;_0xb34966<_0x54ab79[_0x5c59('0x52')][_0x5c59('0xad')]['length'];_0xb34966+=0x1){_0x54ab79['body'][_0x5c59('0xad')][_0xb34966]={'filename':_0x54ab79[_0x5c59('0x52')][_0x5c59('0xad')][_0xb34966]['name'],'path':path[_0x5c59('0xae')](config['root'],'server/files/attachments',_0x54ab79[_0x5c59('0x52')][_0x5c59('0xad')][_0xb34966][_0x5c59('0xaf')])};}}var _0x99a6f9=_0xbebfb0['getSmtpOptions']();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x99a6f9,'message':_0x54ab79[_0x5c59('0x52')]});})[_0x5c59('0x13')](function(_0x52c467){if(!_0x52c467)return;_0x4968c7=_0x52c467;if(!_0x5b15c0[_0x5c59('0xa7')])throw new Error('List\x20not\x20found');if(_0x5b15c0[_0x5c59('0xa7')]['Contacts']['length'])return _0x5b15c0[_0x5c59('0xa7')][_0x5c59('0xb0')][0x0];return db[_0x5c59('0x8b')]['create'](_[_0x5c59('0xb')](_0x54ab79[_0x5c59('0x52')],{'firstName':_0x54ab79[_0x5c59('0x52')]['to'],'email':_0x54ab79['body']['to'],'phone':_0x54ab79['body']['to'],'ListId':_0x5b15c0[_0x5c59('0xb1')]}));})[_0x5c59('0x13')](function(_0x415f1d){if(!_0x415f1d)return;var _0x2599ca={'UserId':_0x54ab79['user']['id'],'ContactId':_0x415f1d['id'],'MailAccountId':_0x5b15c0['id'],'inReplyTo':_0x4968c7[_0x5c59('0xb2')],'to':_0x54ab79['body'][_0x5c59('0xab')],'cc':_0x54ab79[_0x5c59('0x52')]['cc'],'subject':_0x54ab79['body'][_0x5c59('0xb3')],'attach':_0x54ab79[_0x5c59('0x52')][_0x5c59('0xb4')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x5c59('0xa2')](_0x5c59('0xa3')),'lastMsgDirection':_0x5c59('0xb5'),'Messages':[_[_0x5c59('0x50')](_0x54ab79['body'],{'messageId':_0x4968c7[_0x5c59('0xb2')],'sentAt':moment()[_0x5c59('0xa2')](_0x5c59('0xa3')),'read':!![],'MailAccountId':_0x5b15c0['id'],'UserId':_0x54ab79[_0x5c59('0x6e')]['id'],'ContactId':_0x415f1d['id']})]};if(_0x54ab79['body']['Interaction']){_0x2599ca=_[_0x5c59('0x50')](_0x2599ca,_0x54ab79[_0x5c59('0x52')][_0x5c59('0xb6')]);}return db[_0x5c59('0x88')][_0x5c59('0x5a')](_0x2599ca,{'include':[{'model':db['MailMessage'],'as':_0x5c59('0xb7')}]});})['then'](respondWithResult(_0x3af480,null))['catch'](handleError(_0x3af480,null));};exports['verifySmtp']=function(_0x5b77e9,_0x1ffb85){return db['MailAccount']['find']({'where':{'id':_0x5b77e9[_0x5c59('0x57')]['id']},'include':[{'model':db[_0x5c59('0x30')],'as':_0x5c59('0x31'),'raw':!![],'include':[{'model':db[_0x5c59('0xa9')],'as':_0x5c59('0xa9'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1ffb85,null))[_0x5c59('0x13')](function(_0x1f08a3){if(!_0x1f08a3[_0x5c59('0x31')])return;var _0x5e8eb2=_0x1f08a3[_0x5c59('0xb8')]();return respondWithRpcPromise(_0x5c59('0xb9'),_0x5c59('0xba'),{'account':_0x5e8eb2});})[_0x5c59('0x13')](respondWithResult(_0x1ffb85,null))[_0x5c59('0x4d')](handleError(_0x1ffb85,null));};exports[_0x5c59('0x29')]=function(_0x39e2c4,_0x6cba21){return db[_0x5c59('0x35')]['find']({'where':{'id':_0x39e2c4['params']['id']}})[_0x5c59('0x13')](handleEntityNotFound(_0x6cba21,null))['then'](function(_0x5b97b3){if(_0x5b97b3&&_0x5b97b3[_0x5c59('0x74')]){throw new db[(_0x5c59('0xbb'))][(_0x5c59('0xbc'))](_0x5c59('0xbd'));}return _0x5b97b3;})[_0x5c59('0x13')](removeEntity(_0x6cba21,null))[_0x5c59('0x4d')](handleError(_0x6cba21,null));};exports[_0x5c59('0xbe')]=function(_0xad386c,_0x1dca49){return db[_0x5c59('0x35')][_0x5c59('0x56')]({'where':{'id':_0xad386c[_0x5c59('0x57')]['id']}})['then'](handleEntityNotFound(_0x1dca49,null))[_0x5c59('0x13')](function(_0x17b881){if(_0x17b881){return _0x17b881['addAgents'](_0xad386c[_0x5c59('0x52')]['ids'],_['omit'](_0xad386c['body'],[_0x5c59('0x63'),'id'])||{})[_0x5c59('0xbf')](function(_0x14e506){for(var _0x2a4877=0x0;_0x2a4877<_0xad386c[_0x5c59('0x52')][_0x5c59('0x63')][_0x5c59('0x40')];_0x2a4877+=0x1){socket[_0x5c59('0xc0')](_0x5c59('0xc1'),{'UserId':Number(_0xad386c['body'][_0x5c59('0x63')][_0x2a4877]),'MailAccountId':Number(_0xad386c[_0x5c59('0x57')]['id'])});}return _0x14e506;});}})[_0x5c59('0x13')](respondWithResult(_0x1dca49,null))[_0x5c59('0x4d')](handleError(_0x1dca49,null));};exports['removeAgents']=function(_0x15f84d,_0x234607){return db[_0x5c59('0x35')][_0x5c59('0x56')]({'where':{'id':_0x15f84d[_0x5c59('0x57')]['id']}})['then'](handleEntityNotFound(_0x234607,null))[_0x5c59('0x13')](function(_0x1ad569){if(_0x1ad569){return _0x1ad569[_0x5c59('0xc2')](_0x15f84d[_0x5c59('0x3b')]['ids'])[_0x5c59('0x13')](function(){if(_[_0x5c59('0xc3')](_0x15f84d[_0x5c59('0x3b')][_0x5c59('0x63')])){for(var _0x11ca7e=0x0;_0x11ca7e<_0x15f84d[_0x5c59('0x3b')][_0x5c59('0x63')]['length'];_0x11ca7e+=0x1){socket[_0x5c59('0xc0')](_0x5c59('0xc4'),{'UserId':Number(_0x15f84d['query'][_0x5c59('0x63')][_0x11ca7e]),'MailAccountId':Number(_0x15f84d[_0x5c59('0x57')]['id'])});}}else{socket[_0x5c59('0xc0')](_0x5c59('0xc4'),{'UserId':Number(_0x15f84d['query'][_0x5c59('0x63')]),'MailAccountId':Number(_0x15f84d[_0x5c59('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x234607,null))[_0x5c59('0x4d')](handleError(_0x234607,null));};exports[_0x5c59('0xc5')]=function(_0x1871d4,_0x4d536b){var _0x5e46b7={};var _0x45c93c={};var _0x243416;var _0x1e0a64;return db[_0x5c59('0x35')][_0x5c59('0x81')]({'where':{'id':_0x1871d4[_0x5c59('0x57')]['id']}})['then'](handleEntityNotFound(_0x4d536b,null))[_0x5c59('0x13')](function(_0x4a94f8){if(_0x4a94f8){_0x243416=_0x4a94f8;_0x45c93c['model']=_[_0x5c59('0x4f')](db[_0x5c59('0x8d')][_0x5c59('0x36')]);_0x45c93c[_0x5c59('0x3b')]=_[_0x5c59('0x4f')](_0x1871d4[_0x5c59('0x3b')]);_0x45c93c['filters']=_['intersection'](_0x45c93c[_0x5c59('0x3a')],_0x45c93c[_0x5c59('0x3b')]);_0x5e46b7[_0x5c59('0x3e')]=_[_0x5c59('0x3d')](_0x45c93c[_0x5c59('0x3a')],qs['fields'](_0x1871d4['query'][_0x5c59('0x3f')]));_0x5e46b7[_0x5c59('0x3e')]=_0x5e46b7[_0x5c59('0x3e')][_0x5c59('0x40')]?_0x5e46b7['attributes']:_0x45c93c[_0x5c59('0x3a')];_0x5e46b7[_0x5c59('0x5d')]=qs[_0x5c59('0x43')](_0x1871d4[_0x5c59('0x3b')]['sort']);_0x5e46b7['where']=qs[_0x5c59('0x3c')](_[_0x5c59('0x44')](_0x1871d4[_0x5c59('0x3b')],_0x45c93c[_0x5c59('0x3c')]));if(_0x1871d4['query'][_0x5c59('0x45')]){_0x5e46b7[_0x5c59('0x46')]=_['merge'](_0x5e46b7[_0x5c59('0x46')],{'$or':_['map'](_0x5e46b7[_0x5c59('0x3e')],function(_0x2c4cfc){var _0x38428c={};_0x38428c[_0x2c4cfc]={'$like':'%'+_0x1871d4[_0x5c59('0x3b')][_0x5c59('0x45')]+'%'};return _0x38428c;})});}_0x5e46b7=_[_0x5c59('0x50')]({},_0x5e46b7,_0x1871d4[_0x5c59('0x51')]);return _0x243416[_0x5c59('0xc5')](_0x5e46b7);}})['then'](function(_0x59a25d){if(_0x59a25d){_0x1e0a64=_0x59a25d[_0x5c59('0x40')];if(!_0x1871d4[_0x5c59('0x3b')][_0x5c59('0x41')]('nolimit')){_0x5e46b7[_0x5c59('0x24')]=qs[_0x5c59('0x24')](_0x1871d4['query'][_0x5c59('0x24')]);_0x5e46b7['offset']=qs[_0x5c59('0x22')](_0x1871d4[_0x5c59('0x3b')][_0x5c59('0x22')]);}return _0x243416[_0x5c59('0xc5')](_0x5e46b7);}})[_0x5c59('0x13')](function(_0x5db747){if(_0x5db747){return _0x5db747?{'count':_0x1e0a64,'rows':_0x5db747}:null;}})[_0x5c59('0x13')](respondWithResult(_0x4d536b,null))[_0x5c59('0x4d')](handleError(_0x4d536b,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 8dc2be6..0f9261b 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 _0x3912=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x3912,0xa9));var _0x2391=function(_0x590c1f,_0x585eed){_0x590c1f=_0x590c1f-0x0;var _0xd82111=_0x3912[_0x590c1f];return _0xd82111;};'use strict';var EventEmitter=require(_0x2391('0x0'));var MailAccount=require(_0x2391('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x2391('0x2')](0x0);var events={'afterCreate':_0x2391('0x3'),'afterUpdate':_0x2391('0x4'),'afterDestroy':_0x2391('0x5')};function emitEvent(_0x3d9a69){return function(_0x447341,_0x22e7fd,_0x45aea9){MailAccountEvents[_0x2391('0x6')](_0x3d9a69+':'+_0x447341['id'],_0x447341);MailAccountEvents[_0x2391('0x6')](_0x3d9a69,_0x447341);_0x45aea9(null);};}for(var e in events){if(events[_0x2391('0x7')](e)){var event=events[e];MailAccount[_0x2391('0x8')](e,emitEvent(event));}}module[_0x2391('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x9505=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x4120e7,_0x52f421){var _0x2fc6a7=function(_0x4b20ab){while(--_0x4b20ab){_0x4120e7['push'](_0x4120e7['shift']());}};_0x2fc6a7(++_0x52f421);}(_0x9505,0x1e5));var _0x5950=function(_0x2960bc,_0x41555e){_0x2960bc=_0x2960bc-0x0;var _0x22a138=_0x9505[_0x2960bc];return _0x22a138;};'use strict';var EventEmitter=require(_0x5950('0x0'));var MailAccount=require(_0x5950('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x5950('0x2')](0x0);var events={'afterCreate':_0x5950('0x3'),'afterUpdate':_0x5950('0x4'),'afterDestroy':_0x5950('0x5')};function emitEvent(_0x1344e4){return function(_0x4d3220,_0x48219e,_0x2494fc){MailAccountEvents[_0x5950('0x6')](_0x1344e4+':'+_0x4d3220['id'],_0x4d3220);MailAccountEvents[_0x5950('0x6')](_0x1344e4,_0x4d3220);_0x2494fc(null);};}for(var e in events){if(events[_0x5950('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 5ddf677..006ed68 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 _0xdfff=['auth','user','data5','pass','exports','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found'];(function(_0x2156b1,_0x1d6c41){var _0x22361c=function(_0x5e1473){while(--_0x5e1473){_0x2156b1['push'](_0x2156b1['shift']());}};_0x22361c(++_0x1d6c41);}(_0xdfff,0x112));var _0xfdff=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdfff[_0x14add3];return _0x4a174f;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xfdff('0x0')]=function(_0x2c910a){return _0x2c910a[_0xfdff('0x1')](_0xfdff('0x2'),attributes,{'tableName':_0xfdff('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x24af16=this;var _0x24150f={'id':_0x24af16['id'],'tls':{'rejectUnauthorized':![]}};if(_0x24af16[_0xfdff('0x4')]!==_0xfdff('0x5')){_0x24150f[_0xfdff('0x6')]=_0x24af16[_0xfdff('0x4')];}else{_0x24150f[_0xfdff('0x7')]=_0x24af16[_0xfdff('0x8')][_0xfdff('0x7')];_0x24150f[_0xfdff('0x9')]=_0x24af16[_0xfdff('0x8')][_0xfdff('0x9')];_0x24150f[_0xfdff('0xa')]=_0x24af16[_0xfdff('0x8')][_0xfdff('0xa')];}if(_0x24af16['Smtp']['authentication']){if(_0x24af16['Smtp'][_0xfdff('0xb')]){if(!_0x24af16['Smtp'][_0xfdff('0xc')])throw new Error(_0xfdff('0xd'));_0x24150f[_0xfdff('0xe')]={'type':'OAuth2','user':_0x24af16['Smtp'][_0xfdff('0xf')],'accessToken':_0x24af16[_0xfdff('0x8')][_0xfdff('0xc')][_0xfdff('0x10')]};}else{_0x24150f[_0xfdff('0xe')]={'user':_0x24af16['Smtp']['user'],'pass':_0x24af16[_0xfdff('0x8')][_0xfdff('0x11')]};}}return _0x24150f;}}});}; \ No newline at end of file +var _0xe4e6=['provider','service','host','Smtp','port','secure','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','pass','./mailAccount.attributes','exports','MailAccount','mail_accounts'];(function(_0x354c6b,_0x10ef52){var _0x38ded8=function(_0x554afe){while(--_0x554afe){_0x354c6b['push'](_0x354c6b['shift']());}};_0x38ded8(++_0x10ef52);}(_0xe4e6,0x95));var _0x6e4e=function(_0x518f11,_0x408787){_0x518f11=_0x518f11-0x0;var _0x3bbed2=_0xe4e6[_0x518f11];return _0x3bbed2;};'use strict';var attributes=require(_0x6e4e('0x0'));module[_0x6e4e('0x1')]=function(_0x5b42a1){return _0x5b42a1['define'](_0x6e4e('0x2'),attributes,{'tableName':_0x6e4e('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x12127c=this;var _0x3ffcc0={'id':_0x12127c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x12127c[_0x6e4e('0x4')]!=='custom'){_0x3ffcc0[_0x6e4e('0x5')]=_0x12127c[_0x6e4e('0x4')];}else{_0x3ffcc0[_0x6e4e('0x6')]=_0x12127c[_0x6e4e('0x7')][_0x6e4e('0x6')];_0x3ffcc0[_0x6e4e('0x8')]=_0x12127c[_0x6e4e('0x7')][_0x6e4e('0x8')];_0x3ffcc0[_0x6e4e('0x9')]=_0x12127c[_0x6e4e('0x7')][_0x6e4e('0x9')];}if(_0x12127c[_0x6e4e('0x7')][_0x6e4e('0xa')]){if(_0x12127c[_0x6e4e('0x7')]['modernAuthentication']){if(!_0x12127c[_0x6e4e('0x7')][_0x6e4e('0xb')])throw new Error(_0x6e4e('0xc'));_0x3ffcc0[_0x6e4e('0xd')]={'type':_0x6e4e('0xe'),'user':_0x12127c['Smtp'][_0x6e4e('0xf')],'accessToken':_0x12127c[_0x6e4e('0x7')][_0x6e4e('0xb')]['data5']};}else{_0x3ffcc0[_0x6e4e('0xd')]={'user':_0x12127c['Smtp'][_0x6e4e('0xf')],'pass':_0x12127c[_0x6e4e('0x7')][_0x6e4e('0x10')]};}}return _0x3ffcc0;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 2ceda33..8f41933 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 _0xdb28=['DESC','MailApplication','Applications','CloudProvider','get','omit','smtpOptions','list','applications','orderBy','priority','asc','autoclose','push','length','*,*,*,*','Contacts','create','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','subject','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','Attachment','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','model','map','then','find','smtp','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','difference','rawAttributes','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact'];(function(_0x57d92a,_0x5c2c3e){var _0x2a64ec=function(_0x8ac2e2){while(--_0x8ac2e2){_0x57d92a['push'](_0x57d92a['shift']());}};_0x2a64ec(++_0x5c2c3e);}(_0xdb28,0x106));var _0x8db2=function(_0x50be22,_0x5618d9){_0x50be22=_0x50be22-0x0;var _0x42a6e4=_0xdb28[_0x50be22];return _0x42a6e4;};'use strict';var _=require(_0x8db2('0x0'));var moment=require(_0x8db2('0x1'));var BPromise=require(_0x8db2('0x2'));var rs=require(_0x8db2('0x3'));var Redis=require('ioredis');var db=require(_0x8db2('0x4'))['db'];var logger=require(_0x8db2('0x5'))(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var jayson=require(_0x8db2('0x8'));var client=jayson['client'][_0x8db2('0x9')]({'port':0x232c});config[_0x8db2('0xa')]=_['defaults'](config['redis'],{'host':_0x8db2('0xb'),'port':0x18eb});var socket=require(_0x8db2('0xc'))(new Redis(config[_0x8db2('0xa')]));require(_0x8db2('0xd'))[_0x8db2('0xe')](socket);function respondWithRpcPromise(_0x1ff362,_0x126c78,_0x4ba340){return new BPromise(function(_0x30dc90,_0x476216){return client[_0x8db2('0xf')](_0x1ff362,_0x4ba340)['then'](function(_0x1d9371){logger[_0x8db2('0x10')]('MailAccount,\x20%s,\x20%s',_0x126c78,_0x8db2('0x11'));logger[_0x8db2('0x12')](_0x8db2('0x13'),_0x126c78,_0x8db2('0x11'),JSON[_0x8db2('0x14')](_0x1d9371));if(_0x1d9371['error']){if(_0x1d9371['error'][_0x8db2('0x15')]===0x1f4){logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x126c78,_0x1d9371[_0x8db2('0x16')][_0x8db2('0x18')]);return _0x476216(_0x1d9371[_0x8db2('0x16')][_0x8db2('0x18')]);}logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x126c78,_0x1d9371[_0x8db2('0x16')]['message']);return _0x30dc90(_0x1d9371[_0x8db2('0x16')][_0x8db2('0x18')]);}else{logger['info'](_0x8db2('0x17'),_0x126c78,_0x8db2('0x11'));_0x30dc90(_0x1d9371[_0x8db2('0x19')][_0x8db2('0x18')]);}})[_0x8db2('0x1a')](function(_0x46ce14){logger['error']('MailAccount,\x20%s,\x20%s',_0x126c78,_0x46ce14);_0x476216(_0x46ce14);});});}exports[_0x8db2('0x1b')]=function(_0x104e33){var _0x1310d3=this;return new Promise(function(_0x1b64e4,_0x58562e){return db[_0x8db2('0x1c')][_0x8db2('0x1d')]({'raw':_0x104e33[_0x8db2('0x1e')]?_0x104e33[_0x8db2('0x1e')][_0x8db2('0x1f')]===undefined?!![]:![]:!![],'where':_0x104e33['options']?_0x104e33[_0x8db2('0x1e')][_0x8db2('0x20')]||null:null,'attributes':_0x104e33[_0x8db2('0x1e')]?_0x104e33[_0x8db2('0x1e')][_0x8db2('0x21')]||null:null,'limit':_0x104e33[_0x8db2('0x1e')]?_0x104e33[_0x8db2('0x1e')]['limit']||null:null,'include':_0x104e33[_0x8db2('0x1e')]?_0x104e33['options']['include']?_['map'](_0x104e33['options'][_0x8db2('0x22')],function(_0x29b5cd){return{'model':db[_0x29b5cd[_0x8db2('0x23')]],'as':_0x29b5cd['as'],'attributes':_0x29b5cd[_0x8db2('0x21')],'include':_0x29b5cd[_0x8db2('0x22')]?_[_0x8db2('0x24')](_0x29b5cd['include'],function(_0x3544ba){return{'model':db[_0x3544ba[_0x8db2('0x23')]],'as':_0x3544ba['as'],'attributes':_0x3544ba[_0x8db2('0x21')],'include':_0x3544ba[_0x8db2('0x22')]?_['map'](_0x3544ba[_0x8db2('0x22')],function(_0x11f398){return{'model':db[_0x11f398[_0x8db2('0x23')]],'as':_0x11f398['as'],'attributes':_0x11f398[_0x8db2('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0x25')](function(_0x21bae5){logger[_0x8db2('0x10')](_0x8db2('0x1b'),_0x104e33);logger[_0x8db2('0x12')]('GetMailAccount',_0x104e33,JSON[_0x8db2('0x14')](_0x21bae5));_0x1b64e4(_0x21bae5);})['catch'](function(_0x59cb77){logger[_0x8db2('0x16')](_0x8db2('0x1b'),_0x59cb77[_0x8db2('0x18')],_0x104e33);_0x58562e(_0x1310d3['error'](0x1f4,_0x59cb77[_0x8db2('0x18')]));});});};exports['ShowMailAccount']=function(_0x3f7aac){var _0x2b653b=this;return new Promise(function(_0x14bd12,_0x4d9e26){return db['MailAccount'][_0x8db2('0x26')]({'raw':_0x3f7aac[_0x8db2('0x1e')]?_0x3f7aac['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f7aac[_0x8db2('0x1e')]?_0x3f7aac[_0x8db2('0x1e')][_0x8db2('0x20')]||null:null,'attributes':_0x3f7aac[_0x8db2('0x1e')]?_0x3f7aac[_0x8db2('0x1e')][_0x8db2('0x21')]||null:null,'include':_0x3f7aac[_0x8db2('0x1e')]?_0x3f7aac[_0x8db2('0x1e')][_0x8db2('0x22')]?_[_0x8db2('0x24')](_0x3f7aac['options'][_0x8db2('0x22')],function(_0x304a72){return{'model':db[_0x304a72['model']],'as':_0x304a72['as'],'attributes':_0x304a72[_0x8db2('0x21')],'include':_0x304a72[_0x8db2('0x22')]?_['map'](_0x304a72['include'],function(_0x3c1983){return{'model':db[_0x3c1983['model']],'as':_0x3c1983['as'],'attributes':_0x3c1983[_0x8db2('0x21')],'include':_0x3c1983[_0x8db2('0x22')]?_[_0x8db2('0x24')](_0x3c1983[_0x8db2('0x22')],function(_0x5cc419){return{'model':db[_0x5cc419[_0x8db2('0x23')]],'as':_0x5cc419['as'],'attributes':_0x5cc419['attributes']};}):[]};}):[]};}):[]:[]})[_0x8db2('0x25')](function(_0xd550ae){if(_0x3f7aac[_0x8db2('0x1e')][_0x8db2('0x27')]===!![])_0xd550ae['setDataValue']('smtpOptions',_0xd550ae[_0x8db2('0x28')]());logger[_0x8db2('0x10')]('ShowMailAccount',_0x3f7aac);logger[_0x8db2('0x12')](_0x8db2('0x29'),_0x3f7aac,JSON[_0x8db2('0x14')](_0xd550ae));_0x14bd12(_0xd550ae);})['catch'](function(_0x152e15){logger[_0x8db2('0x16')](_0x8db2('0x29'),_0x152e15[_0x8db2('0x18')],_0x3f7aac);_0x4d9e26(_0x2b653b[_0x8db2('0x16')](0x1f4,_0x152e15[_0x8db2('0x18')]));});});};exports[_0x8db2('0x2a')]=function(_0x1575ea){var _0x3793a4=this;return new Promise(function(_0x63c561,_0x21cf7c){var _0x20bf0b={'body':_0x1575ea[_0x8db2('0x2b')],'channel':'mail'};var _0x3ee510=_[_0x8db2('0x2c')](_['keys'](db['CmContact'][_0x8db2('0x2d')]),['createdAt',_0x8db2('0x2e'),_0x8db2('0x2f'),_0x8db2('0x30')]);var _0x307783=![];if(_0x1575ea[_0x8db2('0x2b')]['id']){delete _0x1575ea[_0x8db2('0x2b')]['id'];}if(_[_0x8db2('0x31')](_0x1575ea['body'][_0x8db2('0x32')])){return _0x21cf7c(_0x3793a4[_0x8db2('0x16')](0x1f4,_0x8db2('0x33')));}if(_[_0x8db2('0x31')](_0x1575ea['body'][_0x8db2('0x2b')])||_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x2b')]===''){return _0x21cf7c(_0x3793a4[_0x8db2('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8db2('0x31')](_0x1575ea['body'][_0x8db2('0x34')])){return _0x21cf7c(_0x3793a4[_0x8db2('0x16')](0x1f4,_0x8db2('0x35')+_0x3ee510));}if(!_['includes'](_0x3ee510,_0x1575ea['body'][_0x8db2('0x34')])){return _0x21cf7c(_0x3793a4['error'](0x1f4,_0x8db2('0x36')+_0x3ee510));}var _0x467866={};_0x467866[_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x34')]]=_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x32')];return db[_0x8db2('0x1c')][_0x8db2('0x26')]({'where':{'id':_0x1575ea[_0x8db2('0x37')]['id']},'include':[{'model':db[_0x8db2('0x38')],'as':_0x8db2('0x39'),'include':[{'model':db[_0x8db2('0x3a')],'as':'Contacts','where':_0x467866,'limit':0x1,'order':[[_0x8db2('0x2e'),_0x8db2('0x3b')]]}]},{'model':db[_0x8db2('0x3c')],'as':_0x8db2('0x3d')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x8db2('0x3e')],'as':_0x8db2('0x3e')}]}]})[_0x8db2('0x25')](function(_0x4c66e5){if(_0x4c66e5&&_0x4c66e5['List']){var _0x494d6e=_0x4c66e5[_0x8db2('0x3f')]({'plain':!![]});_0x20bf0b[_0x8db2('0x37')]=_[_0x8db2('0x40')](_0x494d6e,[_0x8db2('0x3d'),_0x8db2('0x39')]);_0x20bf0b[_0x8db2('0x37')][_0x8db2('0x41')]=_0x4c66e5['getSmtpOptions']();_0x20bf0b['applications']=_0x494d6e[_0x8db2('0x3d')];_0x20bf0b[_0x8db2('0x42')]=_0x494d6e[_0x8db2('0x39')];_0x20bf0b[_0x8db2('0x43')]=_[_0x8db2('0x44')](_0x20bf0b[_0x8db2('0x43')],[_0x8db2('0x45')],[_0x8db2('0x46')]);if(_0x20bf0b[_0x8db2('0x37')]&&_0x20bf0b[_0x8db2('0x37')][_0x8db2('0x47')]){_0x20bf0b[_0x8db2('0x43')][_0x8db2('0x48')]({'id':0x0,'priority':_0x20bf0b[_0x8db2('0x43')][_0x8db2('0x49')]+0x1,'app':'close','appdata':_0x8db2('0x47'),'interval':_0x8db2('0x4a')});}if(_0x20bf0b['account'][_0x8db2('0x3d')]){delete _0x20bf0b[_0x8db2('0x37')][_0x8db2('0x3d')];}if(_0x20bf0b['account'][_0x8db2('0x39')]){delete _0x20bf0b[_0x8db2('0x37')][_0x8db2('0x39')];}if(_0x494d6e[_0x8db2('0x39')][_0x8db2('0x4b')]['length']){return _0x494d6e[_0x8db2('0x39')][_0x8db2('0x4b')][0x0];}var _0x469bc2=_['defaults'](_0x1575ea[_0x8db2('0x2b')],{'firstName':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x32')],'ListId':_0x494d6e[_0x8db2('0x30')]});_0x469bc2[_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x34')]]=_0x1575ea[_0x8db2('0x2b')]['from'];return db[_0x8db2('0x3a')][_0x8db2('0x4c')](_0x469bc2);}else{throw new Error('List\x20not\x20found');}})[_0x8db2('0x25')](function(_0x1683b8){_0x20bf0b['contact']=_0x1683b8;if(_0x1683b8){if(!_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4d')]){_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4d')]=rs[_0x8db2('0x4e')]()+'\x20'+_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x32')];}var _0x12fd12={'ContactId':_0x1683b8['id'],'MailAccountId':_0x1575ea[_0x8db2('0x37')]['id'],'inReplyTo':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4d')],'to':_0x1575ea[_0x8db2('0x2b')]['message'][_0x8db2('0x32')],'cc':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['cc'],'subject':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['subject'],'attach':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4f')],'lastMsgAt':moment()[_0x8db2('0x50')](_0x8db2('0x51')),'lastMsgDirection':'in'};return db[_0x8db2('0x52')][_0x8db2('0x26')]({'where':{'closed':![],'MailAccountId':_0x1575ea[_0x8db2('0x37')]['id']},'include':[{'model':db[_0x8db2('0x53')],'as':_0x8db2('0x54'),'attributes':[_0x8db2('0x4d')],'where':{'messageId':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x55')]}}]})[_0x8db2('0x25')](function(_0x270fc0){if(_0x270fc0){return[_0x270fc0,![]];}return db[_0x8db2('0x52')][_0x8db2('0x4c')](_0x12fd12)['then'](function(_0x3273dd){return[_0x3273dd,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x8db2('0x56')](function(_0x570c53,_0x3de11e){if(_0x570c53){_0x307783=_0x3de11e;if(!_0x3de11e){return _0x570c53[_0x8db2('0x57')]({'inReplyTo':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x4d')],'to':_0x1575ea['body']['message'][_0x8db2('0x32')],'cc':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['cc'],'subject':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x58')],'attach':_0x570c53[_0x8db2('0x4f')]?_0x570c53[_0x8db2('0x4f')]:_0x1575ea['body'][_0x8db2('0x18')][_0x8db2('0x4f')],'substatus':null,'substatusAt':moment()[_0x8db2('0x50')](_0x8db2('0x51')),'lastMsgAt':moment()[_0x8db2('0x50')](_0x8db2('0x51')),'lastMsgDirection':'in'});}else{return _0x570c53;}}})[_0x8db2('0x25')](function(_0x20caf0){_0x20bf0b['interaction']=_0x20caf0['get']({'plain':!![]});_0x20bf0b[_0x8db2('0x59')][_0x8db2('0x5a')]=_0x307783;return db[_0x8db2('0x53')][_0x8db2('0x4c')]({'body':_0x1575ea[_0x8db2('0x2b')]['body'],'MailAccountId':_0x1575ea['account']['id'],'MailInteractionId':_0x20caf0['id'],'direction':'in','ContactId':_0x20bf0b[_0x8db2('0x5b')]['id'],'messageId':_0x1575ea[_0x8db2('0x2b')]['message'][_0x8db2('0x4d')],'from':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['from'],'to':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['to'],'cc':_0x1575ea[_0x8db2('0x2b')]['message']['cc'],'subject':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x58')],'attach':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['attach'],'Attachments':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x5c')],'originTo':_0x1575ea['body']['message'][_0x8db2('0x5d')],'originCc':_0x1575ea[_0x8db2('0x2b')]['message'][_0x8db2('0x5e')],'bcc':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x5f')],'ChatWebsiteId':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x60')]||null,'originChannel':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')][_0x8db2('0x61')]||_0x8db2('0x62'),'ChatOfflineMessageId':_0x1575ea[_0x8db2('0x2b')][_0x8db2('0x18')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x8db2('0x63')],'as':'Attachments'}]});})[_0x8db2('0x25')](function(_0x3015ab){_0x20bf0b['message']=_0x3015ab;if(_0x20bf0b[_0x8db2('0x59')][_0x8db2('0x64')]){return db['User'][_0x8db2('0x26')]({'attributes':['id',_0x8db2('0x65')],'where':{'id':_0x20bf0b[_0x8db2('0x59')][_0x8db2('0x64')]}})[_0x8db2('0x25')](function(_0x31a095){if(_0x31a095){_0x20bf0b[_0x8db2('0x43')][_0x8db2('0x66')]({'id':0x0,'priority':0x0,'app':_0x8db2('0x67'),'appdata':_0x31a095['name']+','+(_0x20bf0b['account'][_0x8db2('0x68')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x8db2('0x69'),_0x8db2('0x6a'),_0x20bf0b);});}return respondWithRpcPromise(_0x8db2('0x69'),'startRouting',_0x20bf0b);})[_0x8db2('0x25')](function(_0x9675c1){_0x63c561(_0x9675c1);})[_0x8db2('0x1a')](function(_0x591c5d){_0x21cf7c(_0x3793a4[_0x8db2('0x16')](0x1f4,_0x591c5d[_0x8db2('0x18')]));});});}; \ No newline at end of file +var _0x9f0e=['updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','DESC','Applications','MailServerOut','Smtp','CloudProvider','get','omit','getSmtpOptions','applications','orderBy','asc','autoclose','push','close','*,*,*,*','length','defaults','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','create','Contact\x20not\x20found','update','interaction','created','MailMessage','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','options','where','attributes','limit','include','map','model','debug','ShowMailAccount','find','raw','smtp','setDataValue','smtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact'];(function(_0x31b0c7,_0x444345){var _0x37f88e=function(_0x389362){while(--_0x389362){_0x31b0c7['push'](_0x31b0c7['shift']());}};_0x37f88e(++_0x444345);}(_0x9f0e,0x116));var _0xe9f0=function(_0x2a53b0,_0x5d77a8){_0x2a53b0=_0x2a53b0-0x0;var _0x51df7e=_0x9f0e[_0x2a53b0];return _0x51df7e;};'use strict';var _=require(_0xe9f0('0x0'));var moment=require(_0xe9f0('0x1'));var BPromise=require(_0xe9f0('0x2'));var rs=require(_0xe9f0('0x3'));var Redis=require(_0xe9f0('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xe9f0('0x5'));var config=require(_0xe9f0('0x6'));var jayson=require(_0xe9f0('0x7'));var client=jayson[_0xe9f0('0x8')][_0xe9f0('0x9')]({'port':0x232c});config['redis']=_['defaults'](config[_0xe9f0('0xa')],{'host':_0xe9f0('0xb'),'port':0x18eb});var socket=require(_0xe9f0('0xc'))(new Redis(config['redis']));require(_0xe9f0('0xd'))[_0xe9f0('0xe')](socket);function respondWithRpcPromise(_0x20d602,_0x3386a8,_0xa523c0){return new BPromise(function(_0x240932,_0x807322){return client[_0xe9f0('0xf')](_0x20d602,_0xa523c0)[_0xe9f0('0x10')](function(_0x5352e0){logger[_0xe9f0('0x11')](_0xe9f0('0x12'),_0x3386a8,_0xe9f0('0x13'));logger['debug'](_0xe9f0('0x14'),_0x3386a8,'request\x20sent',JSON[_0xe9f0('0x15')](_0x5352e0));if(_0x5352e0[_0xe9f0('0x16')]){if(_0x5352e0[_0xe9f0('0x16')][_0xe9f0('0x17')]===0x1f4){logger['error'](_0xe9f0('0x12'),_0x3386a8,_0x5352e0['error'][_0xe9f0('0x18')]);return _0x807322(_0x5352e0[_0xe9f0('0x16')][_0xe9f0('0x18')]);}logger['error'](_0xe9f0('0x12'),_0x3386a8,_0x5352e0[_0xe9f0('0x16')][_0xe9f0('0x18')]);return _0x240932(_0x5352e0['error'][_0xe9f0('0x18')]);}else{logger[_0xe9f0('0x11')](_0xe9f0('0x12'),_0x3386a8,_0xe9f0('0x13'));_0x240932(_0x5352e0[_0xe9f0('0x19')][_0xe9f0('0x18')]);}})[_0xe9f0('0x1a')](function(_0x59bf5a){logger[_0xe9f0('0x16')](_0xe9f0('0x12'),_0x3386a8,_0x59bf5a);_0x807322(_0x59bf5a);});});}exports[_0xe9f0('0x1b')]=function(_0x5c4182){var _0x35e841=this;return new Promise(function(_0x30b8c7,_0x1698cf){return db[_0xe9f0('0x1c')]['findAll']({'raw':_0x5c4182[_0xe9f0('0x1d')]?_0x5c4182[_0xe9f0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5c4182['options']?_0x5c4182['options'][_0xe9f0('0x1e')]||null:null,'attributes':_0x5c4182[_0xe9f0('0x1d')]?_0x5c4182[_0xe9f0('0x1d')][_0xe9f0('0x1f')]||null:null,'limit':_0x5c4182[_0xe9f0('0x1d')]?_0x5c4182['options'][_0xe9f0('0x20')]||null:null,'include':_0x5c4182[_0xe9f0('0x1d')]?_0x5c4182[_0xe9f0('0x1d')][_0xe9f0('0x21')]?_[_0xe9f0('0x22')](_0x5c4182[_0xe9f0('0x1d')][_0xe9f0('0x21')],function(_0x1321bb){return{'model':db[_0x1321bb[_0xe9f0('0x23')]],'as':_0x1321bb['as'],'attributes':_0x1321bb[_0xe9f0('0x1f')],'include':_0x1321bb['include']?_[_0xe9f0('0x22')](_0x1321bb[_0xe9f0('0x21')],function(_0x2ddfba){return{'model':db[_0x2ddfba[_0xe9f0('0x23')]],'as':_0x2ddfba['as'],'attributes':_0x2ddfba['attributes'],'include':_0x2ddfba[_0xe9f0('0x21')]?_[_0xe9f0('0x22')](_0x2ddfba[_0xe9f0('0x21')],function(_0x1f98a7){return{'model':db[_0x1f98a7[_0xe9f0('0x23')]],'as':_0x1f98a7['as'],'attributes':_0x1f98a7['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9f0('0x10')](function(_0xdc16bc){logger[_0xe9f0('0x11')](_0xe9f0('0x1b'),_0x5c4182);logger[_0xe9f0('0x24')](_0xe9f0('0x1b'),_0x5c4182,JSON[_0xe9f0('0x15')](_0xdc16bc));_0x30b8c7(_0xdc16bc);})[_0xe9f0('0x1a')](function(_0x2b6503){logger[_0xe9f0('0x16')](_0xe9f0('0x1b'),_0x2b6503[_0xe9f0('0x18')],_0x5c4182);_0x1698cf(_0x35e841[_0xe9f0('0x16')](0x1f4,_0x2b6503[_0xe9f0('0x18')]));});});};exports[_0xe9f0('0x25')]=function(_0x2097c4){var _0x80e3ac=this;return new Promise(function(_0x3e1846,_0x2e7535){return db[_0xe9f0('0x1c')][_0xe9f0('0x26')]({'raw':_0x2097c4[_0xe9f0('0x1d')]?_0x2097c4[_0xe9f0('0x1d')][_0xe9f0('0x27')]===undefined?!![]:![]:!![],'where':_0x2097c4['options']?_0x2097c4['options']['where']||null:null,'attributes':_0x2097c4[_0xe9f0('0x1d')]?_0x2097c4['options'][_0xe9f0('0x1f')]||null:null,'include':_0x2097c4[_0xe9f0('0x1d')]?_0x2097c4['options'][_0xe9f0('0x21')]?_['map'](_0x2097c4['options']['include'],function(_0x165440){return{'model':db[_0x165440[_0xe9f0('0x23')]],'as':_0x165440['as'],'attributes':_0x165440['attributes'],'include':_0x165440[_0xe9f0('0x21')]?_[_0xe9f0('0x22')](_0x165440[_0xe9f0('0x21')],function(_0x4d4186){return{'model':db[_0x4d4186['model']],'as':_0x4d4186['as'],'attributes':_0x4d4186[_0xe9f0('0x1f')],'include':_0x4d4186[_0xe9f0('0x21')]?_[_0xe9f0('0x22')](_0x4d4186['include'],function(_0x3ca032){return{'model':db[_0x3ca032[_0xe9f0('0x23')]],'as':_0x3ca032['as'],'attributes':_0x3ca032[_0xe9f0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe9f0('0x10')](function(_0x2b38de){if(_0x2097c4['options'][_0xe9f0('0x28')]===!![])_0x2b38de[_0xe9f0('0x29')](_0xe9f0('0x2a'),_0x2b38de['getSmtpOptions']());logger[_0xe9f0('0x11')](_0xe9f0('0x25'),_0x2097c4);logger['debug'](_0xe9f0('0x25'),_0x2097c4,JSON['stringify'](_0x2b38de));_0x3e1846(_0x2b38de);})[_0xe9f0('0x1a')](function(_0x55c0bd){logger['error']('ShowMailAccount',_0x55c0bd['message'],_0x2097c4);_0x2e7535(_0x80e3ac['error'](0x1f4,_0x55c0bd[_0xe9f0('0x18')]));});});};exports[_0xe9f0('0x2b')]=function(_0x2d8f93){var _0x40c2c6=this;return new Promise(function(_0x2560c6,_0xd9b61b){var _0x3d4eb7={'body':_0x2d8f93[_0xe9f0('0x2c')],'channel':_0xe9f0('0x2d')};var _0x4e1c68=_[_0xe9f0('0x2e')](_[_0xe9f0('0x2f')](db[_0xe9f0('0x30')]['rawAttributes']),['createdAt',_0xe9f0('0x31'),'CompanyId',_0xe9f0('0x32')]);var _0x52613a=![];if(_0x2d8f93[_0xe9f0('0x2c')]['id']){delete _0x2d8f93[_0xe9f0('0x2c')]['id'];}if(_['isNil'](_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x33')])){return _0xd9b61b(_0x40c2c6[_0xe9f0('0x16')](0x1f4,_0xe9f0('0x34')));}if(_[_0xe9f0('0x35')](_0x2d8f93['body'][_0xe9f0('0x2c')])||_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x2c')]===''){return _0xd9b61b(_0x40c2c6[_0xe9f0('0x16')](0x1f4,_0xe9f0('0x36')));}if(_['isNil'](_0x2d8f93[_0xe9f0('0x2c')]['mapKey'])){return _0xd9b61b(_0x40c2c6['error'](0x1f4,_0xe9f0('0x37')+_0x4e1c68));}if(!_[_0xe9f0('0x38')](_0x4e1c68,_0x2d8f93['body'][_0xe9f0('0x39')])){return _0xd9b61b(_0x40c2c6[_0xe9f0('0x16')](0x1f4,_0xe9f0('0x3a')+_0x4e1c68));}var _0x7b167b={};_0x7b167b[_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x39')]]=_0x2d8f93[_0xe9f0('0x2c')]['from'];return db[_0xe9f0('0x1c')]['find']({'where':{'id':_0x2d8f93[_0xe9f0('0x3b')]['id']},'include':[{'model':db['CmList'],'as':_0xe9f0('0x3c'),'include':[{'model':db['CmContact'],'as':_0xe9f0('0x3d'),'where':_0x7b167b,'limit':0x1,'order':[[_0xe9f0('0x31'),_0xe9f0('0x3e')]]}]},{'model':db['MailApplication'],'as':_0xe9f0('0x3f')},{'model':db[_0xe9f0('0x40')],'as':_0xe9f0('0x41'),'include':[{'model':db[_0xe9f0('0x42')],'as':_0xe9f0('0x42')}]}]})[_0xe9f0('0x10')](function(_0x6ece3f){if(_0x6ece3f&&_0x6ece3f[_0xe9f0('0x3c')]){var _0x18fc2b=_0x6ece3f[_0xe9f0('0x43')]({'plain':!![]});_0x3d4eb7[_0xe9f0('0x3b')]=_[_0xe9f0('0x44')](_0x18fc2b,['Applications','List']);_0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x2a')]=_0x6ece3f[_0xe9f0('0x45')]();_0x3d4eb7['applications']=_0x18fc2b[_0xe9f0('0x3f')];_0x3d4eb7['list']=_0x18fc2b[_0xe9f0('0x3c')];_0x3d4eb7[_0xe9f0('0x46')]=_[_0xe9f0('0x47')](_0x3d4eb7[_0xe9f0('0x46')],['priority'],[_0xe9f0('0x48')]);if(_0x3d4eb7[_0xe9f0('0x3b')]&&_0x3d4eb7['account'][_0xe9f0('0x49')]){_0x3d4eb7[_0xe9f0('0x46')][_0xe9f0('0x4a')]({'id':0x0,'priority':_0x3d4eb7[_0xe9f0('0x46')]['length']+0x1,'app':_0xe9f0('0x4b'),'appdata':_0xe9f0('0x49'),'interval':_0xe9f0('0x4c')});}if(_0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x3f')]){delete _0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x3f')];}if(_0x3d4eb7[_0xe9f0('0x3b')]['List']){delete _0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x3c')];}if(_0x18fc2b[_0xe9f0('0x3c')][_0xe9f0('0x3d')][_0xe9f0('0x4d')]){return _0x18fc2b[_0xe9f0('0x3c')][_0xe9f0('0x3d')][0x0];}var _0xec9b3c=_[_0xe9f0('0x4e')](_0x2d8f93[_0xe9f0('0x2c')],{'firstName':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x33')],'ListId':_0x18fc2b[_0xe9f0('0x32')]});_0xec9b3c[_0x2d8f93[_0xe9f0('0x2c')]['mapKey']]=_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x33')];return db[_0xe9f0('0x30')]['create'](_0xec9b3c);}else{throw new Error('List\x20not\x20found');}})[_0xe9f0('0x10')](function(_0x57b904){_0x3d4eb7[_0xe9f0('0x4f')]=_0x57b904;if(_0x57b904){if(!_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['messageId']){_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x50')]=rs[_0xe9f0('0x51')]()+'\x20'+_0x2d8f93['body'][_0xe9f0('0x18')][_0xe9f0('0x33')];}var _0x28a66e={'ContactId':_0x57b904['id'],'MailAccountId':_0x2d8f93[_0xe9f0('0x3b')]['id'],'inReplyTo':_0x2d8f93['body']['message'][_0xe9f0('0x50')],'to':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x33')],'cc':_0x2d8f93[_0xe9f0('0x2c')]['message']['cc'],'subject':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x52')],'attach':_0x2d8f93['body'][_0xe9f0('0x18')][_0xe9f0('0x53')],'lastMsgAt':moment()[_0xe9f0('0x54')](_0xe9f0('0x55')),'lastMsgDirection':'in'};return db[_0xe9f0('0x56')]['find']({'where':{'closed':![],'MailAccountId':_0x2d8f93['account']['id']},'include':[{'model':db['MailMessage'],'as':_0xe9f0('0x57'),'attributes':[_0xe9f0('0x50')],'where':{'messageId':_0x2d8f93['body'][_0xe9f0('0x18')]['inReplyTo']}}]})['then'](function(_0x156c65){if(_0x156c65){return[_0x156c65,![]];}return db[_0xe9f0('0x56')][_0xe9f0('0x58')](_0x28a66e)[_0xe9f0('0x10')](function(_0x1d2fb2){return[_0x1d2fb2,!![]];});});}else{throw new Error(_0xe9f0('0x59'));}})['spread'](function(_0x5e4ad4,_0x1255e6){if(_0x5e4ad4){_0x52613a=_0x1255e6;if(!_0x1255e6){return _0x5e4ad4[_0xe9f0('0x5a')]({'inReplyTo':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['messageId'],'to':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x33')],'cc':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['cc'],'subject':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x52')],'attach':_0x5e4ad4[_0xe9f0('0x53')]?_0x5e4ad4[_0xe9f0('0x53')]:_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['attach'],'substatus':null,'substatusAt':moment()[_0xe9f0('0x54')](_0xe9f0('0x55')),'lastMsgAt':moment()[_0xe9f0('0x54')](_0xe9f0('0x55')),'lastMsgDirection':'in'});}else{return _0x5e4ad4;}}})[_0xe9f0('0x10')](function(_0x42aab8){_0x3d4eb7[_0xe9f0('0x5b')]=_0x42aab8[_0xe9f0('0x43')]({'plain':!![]});_0x3d4eb7[_0xe9f0('0x5b')][_0xe9f0('0x5c')]=_0x52613a;return db[_0xe9f0('0x5d')][_0xe9f0('0x58')]({'body':_0x2d8f93['body'][_0xe9f0('0x2c')],'MailAccountId':_0x2d8f93[_0xe9f0('0x3b')]['id'],'MailInteractionId':_0x42aab8['id'],'direction':'in','ContactId':_0x3d4eb7[_0xe9f0('0x4f')]['id'],'messageId':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x50')],'from':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x33')],'to':_0x2d8f93[_0xe9f0('0x2c')]['message']['to'],'cc':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['cc'],'subject':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x52')],'attach':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x53')],'Attachments':_0x2d8f93[_0xe9f0('0x2c')]['message']['attachments'],'originTo':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x5e')],'originCc':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x5f')],'bcc':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x60')],'ChatWebsiteId':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x61')]||null,'originChannel':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['originChannel']||_0xe9f0('0x62'),'ChatOfflineMessageId':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x63')]||null},{'include':[{'model':db[_0xe9f0('0x64')],'as':_0xe9f0('0x65')}]});})[_0xe9f0('0x10')](function(_0x114033){_0x3d4eb7['message']=_0x114033;if(_0x3d4eb7[_0xe9f0('0x5b')][_0xe9f0('0x66')]){return db[_0xe9f0('0x67')][_0xe9f0('0x26')]({'attributes':['id',_0xe9f0('0x68')],'where':{'id':_0x3d4eb7[_0xe9f0('0x5b')]['UserId']}})[_0xe9f0('0x10')](function(_0x568a13){if(_0x568a13){_0x3d4eb7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xe9f0('0x69'),'appdata':_0x568a13[_0xe9f0('0x68')]+','+(_0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x6a')]||0xa),'interval':_0xe9f0('0x4c')});}return respondWithRpcPromise(_0xe9f0('0x6b'),_0xe9f0('0x6c'),_0x3d4eb7);});}return respondWithRpcPromise(_0xe9f0('0x6b'),_0xe9f0('0x6c'),_0x3d4eb7);})['then'](function(_0x3b5047){_0x2560c6(_0x3b5047);})[_0xe9f0('0x1a')](function(_0xef6284){_0xd9b61b(_0x40c2c6[_0xe9f0('0x16')](0x1f4,_0xef6284[_0xe9f0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index c056ebd..807dc1c 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 _0x8d44=['register','length','mailAccount:','./mailAccount.events','save','update','removeListener'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x8d44,0x161));var _0x48d4=function(_0x1c8172,_0xb2959a){_0x1c8172=_0x1c8172-0x0;var _0x263664=_0x8d44[_0x1c8172];return _0x263664;};'use strict';var MailAccountEvents=require(_0x48d4('0x0'));var events=[_0x48d4('0x1'),'remove',_0x48d4('0x2')];function createListener(_0x1a6d24,_0x174135){return function(_0x3a7d36){_0x174135['emit'](_0x1a6d24,_0x3a7d36);};}function removeListener(_0x3fa84d,_0x5e5d76){return function(){MailAccountEvents[_0x48d4('0x3')](_0x3fa84d,_0x5e5d76);};}exports[_0x48d4('0x4')]=function(_0x4c7a24){for(var _0x32354d=0x0,_0x1b5f1b=events[_0x48d4('0x5')];_0x32354d<_0x1b5f1b;_0x32354d++){var _0x580d25=events[_0x32354d];var _0x17d57c=createListener(_0x48d4('0x6')+_0x580d25,_0x4c7a24);MailAccountEvents['on'](_0x580d25,_0x17d57c);}}; \ No newline at end of file +var _0x4a51=['remove','emit','register','mailAccount:','./mailAccount.events','save'];(function(_0x1a468b,_0x23e5ea){var _0x1a1ab7=function(_0x1c2a10){while(--_0x1c2a10){_0x1a468b['push'](_0x1a468b['shift']());}};_0x1a1ab7(++_0x23e5ea);}(_0x4a51,0x14e));var _0x14a5=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x4a51[_0x5608a3];return _0x1ed50a;};'use strict';var MailAccountEvents=require(_0x14a5('0x0'));var events=[_0x14a5('0x1'),_0x14a5('0x2'),'update'];function createListener(_0x292227,_0xb3dbdc){return function(_0x5f53a1){_0xb3dbdc[_0x14a5('0x3')](_0x292227,_0x5f53a1);};}function removeListener(_0x37f29d,_0x51ab5f){return function(){MailAccountEvents['removeListener'](_0x37f29d,_0x51ab5f);};}exports[_0x14a5('0x4')]=function(_0x5cb9bc){for(var _0x516a27=0x0,_0x5829df=events['length'];_0x516a27<_0x5829df;_0x516a27++){var _0x4ded21=events[_0x516a27];var _0x189910=createListener(_0x14a5('0x5')+_0x4ded21,_0x5cb9bc);MailAccountEvents['on'](_0x4ded21,_0x189910);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 9c002da..2bfbe1a 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 _0x1bf3=['delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','show','put','/:id'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x1bf3,0x182));var _0x31bf=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1bf3[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x31bf('0x0'));var util=require(_0x31bf('0x1'));var path=require('path');var timeout=require(_0x31bf('0x2'));var express=require(_0x31bf('0x3'));var router=express[_0x31bf('0x4')]();var fs_extra=require(_0x31bf('0x5'));var auth=require(_0x31bf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x31bf('0x7'));var controller=require(_0x31bf('0x8'));router[_0x31bf('0x9')]('/:id',auth[_0x31bf('0xa')](),controller[_0x31bf('0xb')]);router[_0x31bf('0xc')](_0x31bf('0xd'),auth[_0x31bf('0xa')](),controller['update']);router[_0x31bf('0xe')](_0x31bf('0xd'),auth[_0x31bf('0xa')](),controller['destroy']);module[_0x31bf('0xf')]=router; \ No newline at end of file +var _0x1c9f=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','exports','util'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x1c9f,0x194));var _0xf1c9=function(_0x227715,_0x43ec95){_0x227715=_0x227715-0x0;var _0x3c27a1=_0x1c9f[_0x227715];return _0x3c27a1;};'use strict';var multer=require('multer');var util=require(_0xf1c9('0x0'));var path=require(_0xf1c9('0x1'));var timeout=require(_0xf1c9('0x2'));var express=require('express');var router=express[_0xf1c9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf1c9('0x4'));var interaction=require(_0xf1c9('0x5'));var config=require('../../config/environment');var controller=require(_0xf1c9('0x6'));router[_0xf1c9('0x7')](_0xf1c9('0x8'),auth[_0xf1c9('0x9')](),controller[_0xf1c9('0xa')]);router[_0xf1c9('0xb')](_0xf1c9('0x8'),auth['isAuthenticated'](),controller[_0xf1c9('0xc')]);router[_0xf1c9('0xd')]('/:id',auth[_0xf1c9('0x9')](),controller['destroy']);module[_0xf1c9('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 8bd4e8e..c51d224 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 _0x2b2f=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x18e471,_0x1abfd7){var _0x35df73=function(_0x3e57b3){while(--_0x3e57b3){_0x18e471['push'](_0x18e471['shift']());}};_0x35df73(++_0x1abfd7);}(_0x2b2f,0xe7));var _0xf2b2=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2b2f[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xf2b2('0x0'));module[_0xf2b2('0x1')]={'priority':{'type':Sequelize[_0xf2b2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf2b2('0x3')],'allowNull':![],'defaultValue':_0xf2b2('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xf2b2('0x3')]},'interval':{'type':Sequelize[_0xf2b2('0x3')],'defaultValue':_0xf2b2('0x5')}}; \ No newline at end of file +var _0x2ef1=['sequelize','exports','INTEGER','STRING','*,*,*,*'];(function(_0x50ceed,_0x2cf670){var _0x9034e2=function(_0x3a4747){while(--_0x3a4747){_0x50ceed['push'](_0x50ceed['shift']());}};_0x9034e2(++_0x2cf670);}(_0x2ef1,0x12c));var _0x12ef=function(_0x28e683,_0x583154){_0x28e683=_0x28e683-0x0;var _0x1b1c9b=_0x2ef1[_0x28e683];return _0x1b1c9b;};'use strict';var Sequelize=require(_0x12ef('0x0'));module[_0x12ef('0x1')]={'priority':{'type':Sequelize[_0x12ef('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x12ef('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x12ef('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index c7c5744..a51279a 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(_0x98ac1f,_0x2effb0){var _0x1579d1=function(_0x54b8d7){while(--_0x54b8d7){_0x98ac1f['push'](_0x98ac1f['shift']());}};_0x1579d1(++_0x2effb0);}(_0x70e0,0x17b));var _0x070e=function(_0xce9e30,_0x1f7c7f){_0xce9e30=_0xce9e30-0x0;var _0xc2773c=_0x70e0[_0xce9e30];return _0xc2773c;};'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 _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x2e0dca,_0x45a901){var _0x31605b=function(_0x4dbb8a){while(--_0x4dbb8a){_0x2e0dca['push'](_0x2e0dca['shift']());}};_0x31605b(++_0x45a901);}(_0x9bde,0xe1));var _0xe9bd=function(_0x49c7fd,_0x528562){_0x49c7fd=_0x49c7fd-0x0;var _0x42b667=_0x9bde[_0x49c7fd];return _0x42b667;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 2f33c8e..3309365 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 _0x2423=['util','../../config/logger','api','bluebird','request-promise','rimraf','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2423,0x15e));var _0x3242=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2423[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x3242('0x0'));var logger=require(_0x3242('0x1'))(_0x3242('0x2'));var moment=require('moment');var BPromise=require(_0x3242('0x3'));var rp=require(_0x3242('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3242('0x5'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module['exports']=function(_0x3d9ddf,_0x5e7e3e){return _0x3d9ddf['define'](_0x3242('0x6'),attributes,{'tableName':_0x3242('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3242('0x8'),'collate':_0x3242('0x9')});}; \ No newline at end of file +var _0x2b66=['../../config/environment','./mailApplication.attributes','exports','mail_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x13fc38,_0x1e45b5){var _0xcf8110=function(_0x1724ef){while(--_0x1724ef){_0x13fc38['push'](_0x13fc38['shift']());}};_0xcf8110(++_0x1e45b5);}(_0x2b66,0xe9));var _0x62b6=function(_0x1bf7f4,_0x2df684){_0x1bf7f4=_0x1bf7f4-0x0;var _0x12bf07=_0x2b66[_0x1bf7f4];return _0x12bf07;};'use strict';var _=require(_0x62b6('0x0'));var util=require(_0x62b6('0x1'));var logger=require(_0x62b6('0x2'))('api');var moment=require(_0x62b6('0x3'));var BPromise=require(_0x62b6('0x4'));var rp=require(_0x62b6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x62b6('0x6'));var config=require(_0x62b6('0x7'));var attributes=require(_0x62b6('0x8'));module[_0x62b6('0x9')]=function(_0x50b312,_0x319370){return _0x50b312['define']('MailApplication',attributes,{'tableName':_0x62b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x62b6('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index f068995..68a423b 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 _0x0641=['../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','info','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x446980,_0x13bedd){var _0x2f2a23=function(_0x35c65f){while(--_0x35c65f){_0x446980['push'](_0x446980['shift']());}};_0x2f2a23(++_0x13bedd);}(_0x0641,0x1ac));var _0x1064=function(_0x375d79,_0x53be3d){_0x375d79=_0x375d79-0x0;var _0x2a07d4=_0x0641[_0x375d79];return _0x2a07d4;};'use strict';var _=require(_0x1064('0x0'));var util=require(_0x1064('0x1'));var moment=require(_0x1064('0x2'));var BPromise=require(_0x1064('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1064('0x4'));var db=require(_0x1064('0x5'))['db'];var utils=require(_0x1064('0x6'));var logger=require(_0x1064('0x7'))(_0x1064('0x8'));var config=require('../../config/environment');var jayson=require(_0x1064('0x9'));var client=jayson['client'][_0x1064('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x97a1f2,_0x236e9d,_0x2aff10){return new BPromise(function(_0x441998,_0x50fcd5){return client[_0x1064('0xb')](_0x97a1f2,_0x2aff10)[_0x1064('0xc')](function(_0x49ea23){logger['info'](_0x1064('0xd'),_0x236e9d,_0x1064('0xe'));logger[_0x1064('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x236e9d,_0x1064('0xe'),JSON['stringify'](_0x49ea23));if(_0x49ea23[_0x1064('0x10')]){if(_0x49ea23[_0x1064('0x10')][_0x1064('0x11')]===0x1f4){logger[_0x1064('0x10')](_0x1064('0xd'),_0x236e9d,_0x49ea23[_0x1064('0x10')][_0x1064('0x12')]);return _0x50fcd5(_0x49ea23['error']['message']);}logger[_0x1064('0x10')](_0x1064('0xd'),_0x236e9d,_0x49ea23[_0x1064('0x10')][_0x1064('0x12')]);return _0x441998(_0x49ea23[_0x1064('0x10')]['message']);}else{logger['info'](_0x1064('0xd'),_0x236e9d,_0x1064('0xe'));_0x441998(_0x49ea23[_0x1064('0x13')][_0x1064('0x12')]);}})['catch'](function(_0x4fce18){logger[_0x1064('0x10')](_0x1064('0xd'),_0x236e9d,_0x4fce18);_0x50fcd5(_0x4fce18);});});}exports[_0x1064('0x14')]=function(_0x5ceab5){var _0x419765=this;return new Promise(function(_0x189e7b,_0x484a37){return db[_0x1064('0x15')][_0x1064('0x16')](_0x5ceab5[_0x1064('0x17')],{'raw':_0x5ceab5[_0x1064('0x18')]?_0x5ceab5[_0x1064('0x18')][_0x1064('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ceab5[_0x1064('0x18')]?_0x5ceab5[_0x1064('0x18')][_0x1064('0x1a')]||null:null,'attributes':_0x5ceab5['options']?_0x5ceab5[_0x1064('0x18')][_0x1064('0x1b')]||null:null,'limit':_0x5ceab5[_0x1064('0x18')]?_0x5ceab5['options'][_0x1064('0x1c')]||null:null})[_0x1064('0xc')](function(_0x37e5df){logger[_0x1064('0x1d')]('UpdateMailApplication',_0x5ceab5);logger[_0x1064('0xf')](_0x1064('0x14'),_0x5ceab5,JSON[_0x1064('0x1e')](_0x37e5df));_0x189e7b(_0x37e5df);})['catch'](function(_0x282f03){logger[_0x1064('0x10')](_0x1064('0x14'),_0x282f03[_0x1064('0x12')],_0x5ceab5);_0x484a37(_0x419765['error'](0x1f4,_0x282f03[_0x1064('0x12')]));});});}; \ No newline at end of file +var _0x2487=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','MailApplication,\x20%s,\x20%s','message','error','result','catch','UpdateMailApplication','MailApplication','update','body','raw','options','where','attributes','limit','then','moment'];(function(_0x45dfd0,_0x43439b){var _0x1df4a2=function(_0x5f7f9a){while(--_0x5f7f9a){_0x45dfd0['push'](_0x45dfd0['shift']());}};_0x1df4a2(++_0x43439b);}(_0x2487,0x1b1));var _0x7248=function(_0x299527,_0x43c6e9){_0x299527=_0x299527-0x0;var _0x416ec4=_0x2487[_0x299527];return _0x416ec4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7248('0x0'));var BPromise=require(_0x7248('0x1'));var rs=require(_0x7248('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7248('0x3'))['db'];var utils=require(_0x7248('0x4'));var logger=require(_0x7248('0x5'))(_0x7248('0x6'));var config=require(_0x7248('0x7'));var jayson=require(_0x7248('0x8'));var client=jayson[_0x7248('0x9')][_0x7248('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381fe1,_0x3c3152,_0x181619){return new BPromise(function(_0x9a95f7,_0x4aa8c4){return client['request'](_0x381fe1,_0x181619)['then'](function(_0x275fd6){logger[_0x7248('0xb')]('MailApplication,\x20%s,\x20%s',_0x3c3152,_0x7248('0xc'));logger[_0x7248('0xd')](_0x7248('0xe'),_0x3c3152,_0x7248('0xc'),JSON[_0x7248('0xf')](_0x275fd6));if(_0x275fd6['error']){if(_0x275fd6['error']['code']===0x1f4){logger['error'](_0x7248('0x10'),_0x3c3152,_0x275fd6['error'][_0x7248('0x11')]);return _0x4aa8c4(_0x275fd6[_0x7248('0x12')][_0x7248('0x11')]);}logger[_0x7248('0x12')](_0x7248('0x10'),_0x3c3152,_0x275fd6[_0x7248('0x12')][_0x7248('0x11')]);return _0x9a95f7(_0x275fd6[_0x7248('0x12')][_0x7248('0x11')]);}else{logger['info'](_0x7248('0x10'),_0x3c3152,_0x7248('0xc'));_0x9a95f7(_0x275fd6[_0x7248('0x13')]['message']);}})[_0x7248('0x14')](function(_0x2ee440){logger[_0x7248('0x12')](_0x7248('0x10'),_0x3c3152,_0x2ee440);_0x4aa8c4(_0x2ee440);});});}exports[_0x7248('0x15')]=function(_0x4f9eea){var _0xd9c4a2=this;return new Promise(function(_0x518e3a,_0x523365){return db[_0x7248('0x16')][_0x7248('0x17')](_0x4f9eea[_0x7248('0x18')],{'raw':_0x4f9eea['options']?_0x4f9eea['options'][_0x7248('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f9eea[_0x7248('0x1a')]?_0x4f9eea[_0x7248('0x1a')][_0x7248('0x1b')]||null:null,'attributes':_0x4f9eea['options']?_0x4f9eea[_0x7248('0x1a')][_0x7248('0x1c')]||null:null,'limit':_0x4f9eea[_0x7248('0x1a')]?_0x4f9eea[_0x7248('0x1a')][_0x7248('0x1d')]||null:null})[_0x7248('0x1e')](function(_0x1bc05f){logger['info'](_0x7248('0x15'),_0x4f9eea);logger[_0x7248('0xd')](_0x7248('0x15'),_0x4f9eea,JSON[_0x7248('0xf')](_0x1bc05f));_0x518e3a(_0x1bc05f);})['catch'](function(_0x38924c){logger[_0x7248('0x12')](_0x7248('0x15'),_0x38924c[_0x7248('0x11')],_0x4f9eea);_0x523365(_0xd9c4a2[_0x7248('0x12')](0x1f4,_0x38924c[_0x7248('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 0f384c7..6b43ef5 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 _0x0e06=['describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index'];(function(_0x5dab13,_0x1e6c9f){var _0x110f88=function(_0x34e496){while(--_0x34e496){_0x5dab13['push'](_0x5dab13['shift']());}};_0x110f88(++_0x1e6c9f);}(_0x0e06,0x65));var _0x60e0=function(_0x3fbe3a,_0x34707c){_0x3fbe3a=_0x3fbe3a-0x0;var _0xd27028=_0x0e06[_0x3fbe3a];return _0xd27028;};'use strict';var express=require(_0x60e0('0x0'));var router=express['Router']();var auth=require(_0x60e0('0x1'));var interaction=require(_0x60e0('0x2'));var controller=require(_0x60e0('0x3'));router[_0x60e0('0x4')]('/',auth[_0x60e0('0x5')](),controller[_0x60e0('0x6')]);router[_0x60e0('0x4')]('/describe',auth[_0x60e0('0x5')](),controller[_0x60e0('0x7')]);router[_0x60e0('0x4')](_0x60e0('0x8'),auth[_0x60e0('0x5')](),controller[_0x60e0('0x9')]);router[_0x60e0('0x4')](_0x60e0('0xa'),auth[_0x60e0('0x5')](),controller[_0x60e0('0xb')]);router[_0x60e0('0x4')](_0x60e0('0xc'),auth[_0x60e0('0x5')](),controller[_0x60e0('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x60e0('0xe')](_0x60e0('0xa'),auth[_0x60e0('0x5')](),controller['addMessage']);router[_0x60e0('0xe')](_0x60e0('0xf'),auth[_0x60e0('0x5')](),interaction[_0x60e0('0x10')](_0x60e0('0x11'),_0x60e0('0x12')),controller[_0x60e0('0x13')]);router[_0x60e0('0x14')](_0x60e0('0x8'),auth['isAuthenticated'](),interaction[_0x60e0('0x10')]('mail',_0x60e0('0x15')),controller[_0x60e0('0x16')]);router[_0x60e0('0x17')](_0x60e0('0x8'),auth[_0x60e0('0x5')](),interaction['tracked'](_0x60e0('0x11'),_0x60e0('0x18')),controller[_0x60e0('0x19')]);router[_0x60e0('0x17')](_0x60e0('0xf'),auth[_0x60e0('0x5')](),controller[_0x60e0('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xc32f=['tracked','mail','mailinteraction:addtags','addTags','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','express','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','post','create','/:id/messages','addMessage','/:id/tags'];(function(_0x46673e,_0x10ec68){var _0x231529=function(_0x59061b){while(--_0x59061b){_0x46673e['push'](_0x46673e['shift']());}};_0x231529(++_0x10ec68);}(_0xc32f,0x142));var _0xfc32=function(_0x2f8eae,_0x5766b8){_0x2f8eae=_0x2f8eae-0x0;var _0x32eb69=_0xc32f[_0x2f8eae];return _0x32eb69;};'use strict';var express=require(_0xfc32('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xfc32('0x1'));var controller=require(_0xfc32('0x2'));router[_0xfc32('0x3')]('/',auth[_0xfc32('0x4')](),controller[_0xfc32('0x5')]);router[_0xfc32('0x3')](_0xfc32('0x6'),auth[_0xfc32('0x4')](),controller[_0xfc32('0x7')]);router[_0xfc32('0x3')](_0xfc32('0x8'),auth['isAuthenticated'](),controller[_0xfc32('0x9')]);router[_0xfc32('0x3')]('/:id/messages',auth[_0xfc32('0x4')](),controller[_0xfc32('0xa')]);router[_0xfc32('0x3')]('/:id/download',auth[_0xfc32('0x4')](),controller['download']);router[_0xfc32('0xb')]('/',auth['isAuthenticated'](),controller[_0xfc32('0xc')]);router[_0xfc32('0xb')](_0xfc32('0xd'),auth[_0xfc32('0x4')](),controller[_0xfc32('0xe')]);router[_0xfc32('0xb')](_0xfc32('0xf'),auth['isAuthenticated'](),interaction[_0xfc32('0x10')](_0xfc32('0x11'),_0xfc32('0x12')),controller[_0xfc32('0x13')]);router['put']('/:id',auth['isAuthenticated'](),interaction[_0xfc32('0x10')](_0xfc32('0x11'),_0xfc32('0x14')),controller[_0xfc32('0x15')]);router[_0xfc32('0x16')](_0xfc32('0x8'),auth[_0xfc32('0x4')](),interaction['tracked'](_0xfc32('0x11'),_0xfc32('0x17')),controller[_0xfc32('0x18')]);router['delete'](_0xfc32('0xf'),auth['isAuthenticated'](),controller[_0xfc32('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index b180fa1..c14197c 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 _0x7bae=['exports','BOOLEAN','STRING','TEXT','long','DATE','out','ENUM','iconv'];(function(_0x41bc47,_0xb64803){var _0x167b22=function(_0x6d2a24){while(--_0x6d2a24){_0x41bc47['push'](_0x41bc47['shift']());}};_0x167b22(++_0xb64803);}(_0x7bae,0xaa));var _0xe7ba=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7bae[_0x21aec3];return _0x288bbc;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xe7ba('0x0'));module[_0xe7ba('0x1')]={'closed':{'type':Sequelize[_0xe7ba('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xe7ba('0x3')]},'thirdDisposition':{'type':Sequelize[_0xe7ba('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xe7ba('0x3')](0x1fe)},'to':{'type':Sequelize[_0xe7ba('0x3')]},'cc':{'type':Sequelize[_0xe7ba('0x4')](_0xe7ba('0x5'))},'subject':{'type':Sequelize[_0xe7ba('0x4')]()},'attach':{'type':Sequelize[_0xe7ba('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xe7ba('0x6')]},'substatus':{'type':Sequelize[_0xe7ba('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xe7ba('0x6')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xe7ba('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe7ba('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xe7ba('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xe7ba('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x0275=['ENUM','out','BOOLEAN','iconv','exports','DATE','STRING','TEXT','long'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x0275,0xc0));var _0x5027=function(_0x1d219c,_0x3cfd53){_0x1d219c=_0x1d219c-0x0;var _0x337cbe=_0x0275[_0x1d219c];return _0x337cbe;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x5027('0x0'));module[_0x5027('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5027('0x2')]},'disposition':{'type':Sequelize[_0x5027('0x3')]},'secondDisposition':{'type':Sequelize[_0x5027('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5027('0x3')]},'note':{'type':Sequelize[_0x5027('0x3')]},'inReplyTo':{'type':Sequelize[_0x5027('0x3')](0x1fe)},'to':{'type':Sequelize[_0x5027('0x3')]},'cc':{'type':Sequelize[_0x5027('0x4')](_0x5027('0x5'))},'subject':{'type':Sequelize[_0x5027('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x5027('0x2')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x5027('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x5027('0x6')]('in',_0x5027('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5027('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index d7debff..874aaee 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 _0x6c45=['intersection','fields','length','model','hasOwnProperty','order','sort','where','select','field','from','u.id','u.fullname','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','unreadMessages','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','find','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','i.MailAccountId\x20IS\x20NOT\x20NULL','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','user','role','toString','sequelize','merge','MailInteraction','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','contactName','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.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','filters','includeAll','include','options','create','body','destroy','describe','addMessage','MailMessage','ids','omit','getMessages','nolimit','pick','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','addTags','setTags','spread','color','emit','mailInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','moment','bluebird','util','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','update','then','error','stack','name','send','Users','fullname','TagIds','Tags','push','findOne','out','plainBody','trimStart','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','map','rawAttributes','type','key','query','keys','attributes'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6c45,0xb1));var _0x56c4=function(_0x40aa8a,_0x3a1309){_0x40aa8a=_0x40aa8a-0x0;var _0x5ea886=_0x6c45[_0x40aa8a];return _0x5ea886;};'use strict';var emlformat=require(_0x56c4('0x0'));var rimraf=require(_0x56c4('0x1'));var zipdir=require('zip-dir');var moment=require(_0x56c4('0x2'));var BPromise=require(_0x56c4('0x3'));var util=require(_0x56c4('0x4'));var path=require(_0x56c4('0x5'));var fs=require('fs');var _=require(_0x56c4('0x6'));var squel=require(_0x56c4('0x7'));var juice=require(_0x56c4('0x8'));var Redis=require(_0x56c4('0x9'));var qs=require(_0x56c4('0xa'));var as=require(_0x56c4('0xb'));var logger=require(_0x56c4('0xc'))(_0x56c4('0xd'));var config=require(_0x56c4('0xe'));var db=require(_0x56c4('0xf'))['db'];var htmlEntities=require(_0x56c4('0x10'));config[_0x56c4('0x11')]=_[_0x56c4('0x12')](config[_0x56c4('0x11')],{'host':_0x56c4('0x13'),'port':0x18eb});var socket=require(_0x56c4('0x14'))(new Redis(config['redis']));require(_0x56c4('0x15'))[_0x56c4('0x16')](socket);function respondWithStatusCode(_0x311519,_0x108338){_0x108338=_0x108338||0xcc;return function(_0x4ed446){if(_0x4ed446){return _0x311519[_0x56c4('0x17')](_0x108338);}return _0x311519[_0x56c4('0x18')](_0x108338)[_0x56c4('0x19')]();};}function respondWithResult(_0x39de9c,_0x51fb33){_0x51fb33=_0x51fb33||0xc8;return function(_0x6d9810){if(_0x6d9810){return _0x39de9c['status'](_0x51fb33)['json'](_0x6d9810);}};}function respondWithFilteredResult(_0x2cb56e,_0xec63c0){return function(_0x4602b2){if(_0x4602b2){var _0x1f9bfb=typeof _0xec63c0[_0x56c4('0x1a')]==='undefined'&&typeof _0xec63c0[_0x56c4('0x1b')]===_0x56c4('0x1c');var _0x533968=_0x4602b2[_0x56c4('0x1d')];var _0xd0dd01=_0x1f9bfb?0x0:_0xec63c0[_0x56c4('0x1a')];var _0x2f0bb2=_0x1f9bfb?_0x4602b2['count']:_0xec63c0[_0x56c4('0x1a')]+_0xec63c0[_0x56c4('0x1b')];var _0x56324c;if(_0x2f0bb2>=_0x533968){_0x2f0bb2=_0x533968;_0x56324c=0xc8;}else{_0x56324c=0xce;}_0x2cb56e[_0x56c4('0x18')](_0x56324c);return _0x2cb56e[_0x56c4('0x1e')](_0x56c4('0x1f'),_0xd0dd01+'-'+_0x2f0bb2+'/'+_0x533968)[_0x56c4('0x20')](_0x4602b2);}return null;};}function saveUpdates(_0x4d6871){return function(_0x100a6e){if(_0x100a6e){return _0x100a6e[_0x56c4('0x21')](_0x4d6871)[_0x56c4('0x22')](function(_0x7a7612){return _0x7a7612;});}return null;};}function removeEntity(_0x35108){return function(_0x18a1b9){if(_0x18a1b9){return _0x18a1b9['destroy']()['then'](function(){_0x35108[_0x56c4('0x18')](0xcc)[_0x56c4('0x19')]();});}};}function handleEntityNotFound(_0x4cb83b){return function(_0x1cf6fc){if(!_0x1cf6fc){_0x4cb83b[_0x56c4('0x17')](0x194);}return _0x1cf6fc;};}function handleError(_0x10eae6,_0x23b11e){_0x23b11e=_0x23b11e||0x1f4;return function(_0x299dbc){logger[_0x56c4('0x23')](_0x299dbc[_0x56c4('0x24')]);if(_0x299dbc['name']){delete _0x299dbc[_0x56c4('0x25')];}_0x10eae6[_0x56c4('0x18')](_0x23b11e)[_0x56c4('0x26')](_0x299dbc);};}function getInteractionUsers(_0x5e7da1,_0xc8ed28){return new BPromise(function(_0x4d1d9c,_0x213cc6){try{if(_0xc8ed28[_0x5e7da1['id']]){_0x5e7da1[_0x56c4('0x27')]=_['map'](_0xc8ed28[_0x5e7da1['id']],function(_0x148268){return{'id':_0x148268['id'],'fullname':_0x148268[_0x56c4('0x28')]};});}}catch(_0x51dcf8){_0x213cc6(_0x51dcf8);}_0x4d1d9c(_0x5e7da1);});}function getInteractionTags(_0x4c4a8c,_0x57fa1c){return new BPromise(function(_0x23fadb,_0x2ac814){try{if(_0x4c4a8c[_0x56c4('0x29')]){_0x4c4a8c['Tags']=[];_0x4c4a8c[_0x56c4('0x29')]['split'](',')['forEach'](function(_0x5f9cc){_0x4c4a8c[_0x56c4('0x2a')][_0x56c4('0x2b')](_0x57fa1c[_0x5f9cc]);});}delete _0x4c4a8c[_0x56c4('0x29')];}catch(_0x3f9cc0){_0x2ac814(_0x3f9cc0);}_0x23fadb(_0x4c4a8c);});}function getLastMessageText(_0x431f48){return new BPromise(function(_0x49f0c2,_0x3c8db4){return db['MailMessage'][_0x56c4('0x2c')]({'where':{'$and':[{'MailInteractionId':_0x431f48['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x56c4('0x2d')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x56c4('0x2e')],'order':'-id','raw':!![]})[_0x56c4('0x22')](function(_0x367fec){if(_0x367fec&&_0x367fec[_0x56c4('0x2e')]){_0x431f48['lastMsgText']=_[_0x56c4('0x2f')](_0x367fec[_0x56c4('0x2e')]);}_0x49f0c2(_0x431f48);})['catch'](function(_0x3de2e7){_0x3c8db4(_0x3de2e7);});});}function updateMailInteraction(_0x5f1e92,_0x266aa6,_0x4157cd,_0x39a52e){return new BPromise(function(_0x513492,_0x2dfa7b){return getInteractionUsers(_0x5f1e92,_0x4157cd)['then'](function(_0x5533cc){return getInteractionTags(_0x5533cc,_0x266aa6);})[_0x56c4('0x22')](function(_0x110e97){return getStateInteraction(_0x110e97);})[_0x56c4('0x22')](function(_0x33a9e7){if(_0x39a52e){_0x513492(getLastMessageText(_0x33a9e7));}else{_0x513492(_0x33a9e7);}})[_0x56c4('0x30')](function(_0x4abe0f){_0x2dfa7b(_0x4abe0f);});});}function getStateInteraction(_0x25e822){return new BPromise(function(_0x3bea12){_0x25e822[_0x56c4('0x31')]=0x0;_0x25e822[_0x56c4('0x32')]=0x0;_0x25e822[_0x56c4('0x33')]=0x0;_0x25e822[_0x56c4('0x34')]=0x0;_0x25e822[_0x56c4('0x35')]=0x0;if(!_0x25e822['closed']&&!_0x25e822['UserId']){_0x25e822[_0x56c4('0x31')]+=0x1;}if(!_0x25e822[_0x56c4('0x36')]&&_0x25e822[_0x56c4('0x37')]){_0x25e822[_0x56c4('0x32')]+=0x1;if(_0x25e822[_0x56c4('0x31')]){_0x25e822['waiting']-=0x1;}}if(_0x25e822['closed']&&_0x25e822[_0x56c4('0x37')]){_0x25e822['answered']+=0x1;if(_0x25e822[_0x56c4('0x32')]){_0x25e822[_0x56c4('0x32')]-=0x1;}}if(_0x25e822[_0x56c4('0x36')]&&!_0x25e822[_0x56c4('0x37')]){_0x25e822['unmanaged']+=0x1;if(_0x25e822[_0x56c4('0x31')]){_0x25e822[_0x56c4('0x31')]-=0x1;}}_0x25e822[_0x56c4('0x35')]+=0x1;_0x3bea12(_0x25e822);});}exports[_0x56c4('0x38')]=function(_0x4ec104,_0xf2bdac){var _0x120713={},_0x5bdf0a={},_0x5c37a6={'count':0x0,'rows':[]};var _0x1db591=_[_0x56c4('0x39')](db['MailInteraction'][_0x56c4('0x3a')],function(_0x22e900){return{'name':_0x22e900['fieldName'],'type':_0x22e900[_0x56c4('0x3b')][_0x56c4('0x3c')]};});_0x5bdf0a['model']=_['map'](_0x1db591,_0x56c4('0x25'));_0x5bdf0a[_0x56c4('0x3d')]=_[_0x56c4('0x3e')](_0x4ec104[_0x56c4('0x3d')]);_0x5bdf0a['filters']=_['intersection'](_0x5bdf0a['model'],_0x5bdf0a[_0x56c4('0x3d')]);_0x120713[_0x56c4('0x3f')]=_[_0x56c4('0x40')](_0x5bdf0a['model'],qs[_0x56c4('0x41')](_0x4ec104[_0x56c4('0x3d')]['fields']));_0x120713[_0x56c4('0x3f')]=_0x120713[_0x56c4('0x3f')][_0x56c4('0x42')]?_0x120713[_0x56c4('0x3f')]:_0x5bdf0a[_0x56c4('0x43')];if(!_0x4ec104[_0x56c4('0x3d')][_0x56c4('0x44')]('nolimit')){_0x120713['limit']=qs[_0x56c4('0x1b')](_0x4ec104['query']['limit']);_0x120713[_0x56c4('0x1a')]=qs['offset'](_0x4ec104[_0x56c4('0x3d')][_0x56c4('0x1a')]);}_0x120713[_0x56c4('0x45')]=qs[_0x56c4('0x46')](_0x4ec104['query'][_0x56c4('0x46')]);_0x120713[_0x56c4('0x47')]=qs['filters'](_['pick'](_0x4ec104['query'],_0x5bdf0a['filters']),_0x1db591);var _0x2651aa=[];var _0x4b1304=squel[_0x56c4('0x48')]()['field']('id')[_0x56c4('0x49')]('name')[_0x56c4('0x49')]('color')[_0x56c4('0x4a')]('tools_tags');var _0x5950e5=squel[_0x56c4('0x48')]()[_0x56c4('0x49')](_0x56c4('0x4b'))[_0x56c4('0x49')](_0x56c4('0x4c'))[_0x56c4('0x49')]('ui.MailInteractionId')[_0x56c4('0x4a')](_0x56c4('0x4d'),'ui')[_0x56c4('0x4e')](_0x56c4('0x4f'),'u',_0x56c4('0x50'));var _0x1ca0fc=squel[_0x56c4('0x48')]()[_0x56c4('0x4a')]('mail_interactions','i')[_0x56c4('0x4e')](_0x56c4('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x56c4('0x4e')](_0x56c4('0x4f'),'o','o.id\x20=\x20i.UserId')[_0x56c4('0x4e')](_0x56c4('0x52'),'a',_0x56c4('0x53'))[_0x56c4('0x4e')](_0x56c4('0x54'),'me','me.MailInteractionId\x20=\x20i.id')[_0x56c4('0x4e')]('mail_interaction_has_tags','it',_0x56c4('0x55'))[_0x56c4('0x4e')]('tools_tags','t',_0x56c4('0x56'));var _0x2f7193=squel[_0x56c4('0x57')]();var _0x55b81f=[];var _0x3578f5=squel[_0x56c4('0x57')]();var _0x3cfc7f;if(_0x4ec104['query']['search']){_0x3cfc7f=as[_0x56c4('0x58')](_0x4ec104[_0x56c4('0x3d')]['search']);var _0x1bba97=_0x3cfc7f[_0x56c4('0x59')];for(var _0x192761=0x0;_0x192761<_0x3cfc7f[_0x56c4('0x5a')]['length'];_0x192761++){var _0x2c2c69=_0x3cfc7f[_0x56c4('0x5a')][_0x192761];var _0x29410e='i';var _0x15981c=_['find'](_0x1db591,[_0x56c4('0x25'),_0x2c2c69['field']]);if(!_0x15981c){switch(_0x2c2c69[_0x56c4('0x49')]){case _0x56c4('0x5b'):if(_0x2c2c69['value']==0x1){_0x1ca0fc[_0x56c4('0x5c')]('`'+_0x2c2c69[_0x56c4('0x49')]+'`\x20=\x200');}else{_0x1ca0fc['having']('`'+_0x2c2c69[_0x56c4('0x49')]+_0x56c4('0x5d'));}break;case'Contact':if(_0x2c2c69[_0x56c4('0x5e')]===_0x56c4('0x5f')){if(_0x2c2c69[_0x56c4('0x60')][_0x56c4('0x61')]('\x20')[_0x56c4('0x42')]>0x1){_0x2f7193[_0x1bba97](_0x56c4('0x62'),qs[_0x56c4('0x63')](_0x2c2c69[_0x56c4('0x60')]),null);}else{var _0x2d1f86='%'+_0x2c2c69[_0x56c4('0x60')]+'%';_0x2f7193[_0x1bba97]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2d1f86,_0x2d1f86,_0x2d1f86);}}else{_0x15981c=_[_0x56c4('0x64')](_0x1db591,[_0x56c4('0x25'),_0x56c4('0x65')]);_0x2c2c69[_0x56c4('0x49')]=_0x56c4('0x65');_0xa807be=as[_0x56c4('0x66')](_0x29410e,_0x15981c[_0x56c4('0x3b')],_0x2c2c69);_0x2f7193[_0x1bba97](_0xa807be[_0x56c4('0x67')],_0xa807be[_0x56c4('0x60')][_0x56c4('0x68')],_0xa807be['value'][_0x56c4('0x19')]);}break;case _0x56c4('0x69'):var _0x39e86f=_0x2c2c69['value'][_0x56c4('0x61')](',')['map'](function(_0x41643d){return Number(_0x41643d);});_0x39e86f[_0x56c4('0x6a')](function(_0x403c44){_0x3578f5['or'](_0x56c4('0x6b'),'%,'+_0x403c44+',%');});_0x55b81f=_[_0x56c4('0x6c')](_0x55b81f,_0x39e86f);break;case _0x56c4('0x6d'):if(_0x2c2c69[_0x56c4('0x5e')]===_0x56c4('0x5f')){_0x2f7193[_0x1bba97](_0x56c4('0x6e'),'%'+_0x2c2c69['value']+'%',null);}else{_0x15981c=_[_0x56c4('0x64')](_0x1db591,['name','UserId']);_0x2c2c69[_0x56c4('0x49')]=_0x56c4('0x37');_0xa807be=as['buildExpression'](_0x29410e,_0x15981c[_0x56c4('0x3b')],_0x2c2c69);_0x2f7193[_0x1bba97](_0xa807be['text'],_0xa807be['value'][_0x56c4('0x68')],_0xa807be[_0x56c4('0x60')]['end']);}break;case _0x56c4('0x2e'):_0xa807be=as[_0x56c4('0x66')]('me',null,_0x2c2c69);_0x2f7193[_0x1bba97](_0xa807be[_0x56c4('0x67')],_0xa807be[_0x56c4('0x60')][_0x56c4('0x68')],_0xa807be[_0x56c4('0x60')][_0x56c4('0x19')]);break;}}else{var _0xa807be=as['buildExpression'](_0x29410e,_0x15981c[_0x56c4('0x3b')],_0x2c2c69);_0x2f7193[_0x1bba97](_0xa807be[_0x56c4('0x67')],_0xa807be['value'][_0x56c4('0x68')],_0xa807be['value']['end']);}}}else{var _0x3bf1ea=_(_0x4ec104[_0x56c4('0x3d')])[_0x56c4('0x3e')]()[_0x56c4('0x39')](function(_0x49fb8c){return _[_0x56c4('0x6f')](_0x1db591,[_0x56c4('0x25'),_0x49fb8c])?_0x49fb8c:undefined;})[_0x56c4('0x70')]()[_0x56c4('0x60')]();if(!_[_0x56c4('0x71')](_0x3bf1ea)){_0x3bf1ea[_0x56c4('0x6a')](function(_0x2a4f44){if(_0x2a4f44===_0x56c4('0x72')){_0x1ca0fc['where'](_0x56c4('0x73'),[][_0x56c4('0x74')](_0x4ec104[_0x56c4('0x3d')][_0x2a4f44]));}else if(_0x2a4f44===_0x56c4('0x75')){var _0x4db4ce=JSON[_0x56c4('0x76')](_0x4ec104['query'][_0x2a4f44])[_0x56c4('0x77')];var _0x4b0d9c=JSON['parse'](_0x4ec104[_0x56c4('0x3d')][_0x2a4f44])['$lte'];_0x1ca0fc['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4db4ce,_0x4b0d9c);}else{if(_0x4ec104['query'][_0x2a4f44]===_0x56c4('0x78')){_0x1ca0fc[_0x56c4('0x47')]('i.'+_0x2a4f44+_0x56c4('0x79'));}else{_0x1ca0fc['where']('i.'+_0x2a4f44+_0x56c4('0x7a'),_0x4ec104['query'][_0x2a4f44]);}}});}if(_0x4ec104[_0x56c4('0x3d')]['read']){if(_0x4ec104[_0x56c4('0x3d')][_0x56c4('0x7b')]==0x1){_0x1ca0fc[_0x56c4('0x5c')]('`unreadMessages`\x20=\x200');}else{_0x1ca0fc[_0x56c4('0x5c')](_0x56c4('0x7c'));}}if(_0x4ec104['query']['tag']){_0x55b81f=_[_0x56c4('0x7d')](_0x4ec104[_0x56c4('0x3d')]['tag'])?_0x4ec104[_0x56c4('0x3d')][_0x56c4('0x7e')]:new Array(_0x4ec104['query']['tag']);_0x55b81f['forEach'](function(_0x21c9ff){_0x3578f5['or'](_0x56c4('0x6b'),'%,'+_0x21c9ff+',%');});}if(_0x4ec104[_0x56c4('0x3d')]['filter']){var _0x355abc=_0x4ec104[_0x56c4('0x3d')][_0x56c4('0x7f')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x56c4('0x80')](_0x355abc)){_0x2f7193['or'](_0x56c4('0x81'),_0x355abc+'%');}else if(qs['isEmail'](_0x355abc)){_0x2f7193['or'](_0x56c4('0x82'),_0x355abc+'%');}else{_0x2f7193['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x355abc))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x56c4('0x63')](_0x355abc));}}}_0x1ca0fc[_0x56c4('0x47')](_0x2f7193);_0x1ca0fc[_0x56c4('0x83')](_0x56c4('0x84'));var _0xc82779={'type':db[_0x56c4('0x85')][_0x56c4('0x86')][_0x56c4('0x87')],'raw':!![]};var _0x57e8dc=_0x1ca0fc[_0x56c4('0x88')]();_0x57e8dc[_0x56c4('0x49')]('i.id');_0x57e8dc[_0x56c4('0x49')](_0x56c4('0x89'),_0x56c4('0x5b'));if(_0x120713[_0x56c4('0x45')]){_0x120713['order'][_0x56c4('0x6a')](function(_0x8b83be){var _0x5568ad=_0x8b83be[0x0]==='contactName'?_0x8b83be[0x0]:'i.'+_0x8b83be[0x0];_0x1ca0fc[_0x56c4('0x45')](_0x5568ad,_0x8b83be[0x1]===_0x56c4('0x8a')?![]:!![]);});}if(!_[_0x56c4('0x71')](_0x55b81f)){_0x1ca0fc['having'](_0x3578f5);_0x57e8dc[_0x56c4('0x47')]('t.id\x20IN\x20?',_0x55b81f);}BPromise['resolve']()['then'](function(){if(!_0x3cfc7f){if(_0x4ec104[_0x56c4('0x3d')]['MailAccountId'])return;_0x57e8dc[_0x56c4('0x47')](_0x56c4('0x8b'));_0x1ca0fc[_0x56c4('0x47')](_0x56c4('0x8b'));return;}if(_0x4ec104['user']['role']!==_0x56c4('0x8c'))return;return _0x4ec104['user'][_0x56c4('0x8d')]({'attributes':['id'],'raw':!![]})[_0x56c4('0x22')](function(_0x253e95){if(_['isEmpty'](_0x253e95)){_0x57e8dc[_0x56c4('0x47')](_0x56c4('0x8e'));_0x1ca0fc[_0x56c4('0x47')](_0x56c4('0x8e'));}else{_0x57e8dc[_0x56c4('0x47')](_0x56c4('0x73'),_['map'](_0x253e95,'id'));_0x1ca0fc['where'](_0x56c4('0x73'),_[_0x56c4('0x39')](_0x253e95,'id'));}});})[_0x56c4('0x22')](function(){if(_0x4ec104[_0x56c4('0x8f')][_0x56c4('0x90')]===_0x56c4('0x8c')&&!_0x3cfc7f&&!_0x4ec104[_0x56c4('0x3d')][_0x56c4('0x72')])return[];return db['sequelize']['query'](_0x57e8dc[_0x56c4('0x91')](),_0xc82779);})['then'](function(_0x22c108){_0x5c37a6[_0x56c4('0x1d')]=_0x22c108[_0x56c4('0x42')];if(_0x5c37a6[_0x56c4('0x1d')]===0x0)return[];return db[_0x56c4('0x92')]['query'](_0x4b1304[_0x56c4('0x91')](),_0xc82779)[_0x56c4('0x22')](function(_0x3a40f2){_0x2651aa=_['keyBy'](_0x3a40f2,'id');_0xc82779=_[_0x56c4('0x93')](_0xc82779,{'model':db[_0x56c4('0x94')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4ec104[_0x56c4('0x3d')][_0x56c4('0x41')]){_0x120713[_0x56c4('0x3f')][_0x56c4('0x6a')](function(_0x34c4e1){_0x1ca0fc[_0x56c4('0x49')]('i.'+_0x34c4e1);});}else{_0x1ca0fc['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x1ca0fc['field'](_0x56c4('0x95'),_0x56c4('0x96'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0x97'),_0x56c4('0x98'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0x99'),_0x56c4('0x9a'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0x84'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0x9b'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0x9c'));_0x1ca0fc['field'](_0x56c4('0x9d'));_0x1ca0fc['field'](_0x56c4('0x9e'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0x9f'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0xa0'));_0x1ca0fc['field'](_0x56c4('0xa1'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0xa2'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0xa3'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0xa4'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0xa5'));_0x1ca0fc['field'](_0x56c4('0xa6'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0xa7'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0xa8'));_0x1ca0fc['field'](_0x56c4('0xa9'));_0x1ca0fc[_0x56c4('0x49')]('i.UserId');_0x1ca0fc[_0x56c4('0x49')]('c.firstName','Contact.firstName');_0x1ca0fc['field']('c.lastName',_0x56c4('0xaa'));_0x1ca0fc[_0x56c4('0x49')]('c.email',_0x56c4('0xab'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0xac'),'Contact.phone');_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0xad'),_0x56c4('0xae'));_0x1ca0fc['field'](_0x56c4('0xaf'),_0x56c4('0xb0'));_0x1ca0fc[_0x56c4('0x49')]('o.fullname','Owner.fullname');_0x1ca0fc['field'](_0x56c4('0xb1'),_0x56c4('0xb2'));_0x1ca0fc[_0x56c4('0x49')](_0x56c4('0xb3'),_0x56c4('0x29'));}if(_0x120713[_0x56c4('0x1b')])_0x1ca0fc[_0x56c4('0x1b')](_0x120713[_0x56c4('0x1b')]);if(_0x120713[_0x56c4('0x1a')])_0x1ca0fc['offset'](_0x120713['offset']);return db['sequelize']['query'](_0x1ca0fc[_0x56c4('0x91')](),_0xc82779);})[_0x56c4('0x22')](function(_0x2d1874){if(_0x2d1874['length']>0x0)_0x5950e5[_0x56c4('0x47')](_0x56c4('0xb4'),_['map'](_0x2d1874,'id'));return db['sequelize'][_0x56c4('0x3d')](_0x5950e5['toString'](),_0xc82779)[_0x56c4('0x22')](function(_0x9eb5d9){var _0x3d310b=_[_0x56c4('0xb5')](_0x9eb5d9,_0x56c4('0xb6'));var _0x3f9a5a=[];return db[_0x56c4('0xb7')][_0x56c4('0x2c')]({'attributes':[_0x56c4('0xb8')],'raw':!![]})[_0x56c4('0x22')](function(_0x3cb165){var _0x1900d9=_0x3cb165[_0x56c4('0xb8')];_0x2d1874['forEach'](function(_0x1a328f){_0x3f9a5a[_0x56c4('0x2b')](updateMailInteraction(_0x1a328f,_0x2651aa,_0x3d310b,_0x1900d9));});return BPromise[_0x56c4('0xb9')](_0x3f9a5a);});});});})[_0x56c4('0x22')](function(_0x59ba4f){_0x5c37a6[_0x56c4('0xba')]=_0x59ba4f;return _0x5c37a6;})[_0x56c4('0x22')](respondWithFilteredResult(_0xf2bdac,_0x120713))[_0x56c4('0x30')](handleError(_0xf2bdac,null));};exports[_0x56c4('0xbb')]=function(_0x5ce085,_0x2e3f8e){var _0x2524c5={'raw':![],'where':{'id':_0x5ce085[_0x56c4('0xbc')]['id']}},_0x3759a1={};_0x3759a1['model']=_[_0x56c4('0x3e')](db[_0x56c4('0x94')]['rawAttributes']);_0x3759a1[_0x56c4('0x3d')]=_[_0x56c4('0x3e')](_0x5ce085[_0x56c4('0x3d')]);_0x3759a1[_0x56c4('0xbd')]=_[_0x56c4('0x40')](_0x3759a1[_0x56c4('0x43')],_0x3759a1[_0x56c4('0x3d')]);_0x2524c5[_0x56c4('0x3f')]=_[_0x56c4('0x40')](_0x3759a1[_0x56c4('0x43')],qs[_0x56c4('0x41')](_0x5ce085[_0x56c4('0x3d')][_0x56c4('0x41')]));_0x2524c5[_0x56c4('0x3f')]=_0x2524c5[_0x56c4('0x3f')][_0x56c4('0x42')]?_0x2524c5[_0x56c4('0x3f')]:_0x3759a1['model'];if(_0x5ce085['query'][_0x56c4('0xbe')]){_0x2524c5[_0x56c4('0xbf')]=[{'all':!![]}];}_0x2524c5=_[_0x56c4('0x93')]({},_0x2524c5,_0x5ce085[_0x56c4('0xc0')]);return db[_0x56c4('0x94')][_0x56c4('0x64')](_0x2524c5)[_0x56c4('0x22')](handleEntityNotFound(_0x2e3f8e,null))[_0x56c4('0x22')](respondWithResult(_0x2e3f8e,null))[_0x56c4('0x30')](handleError(_0x2e3f8e,null));};exports[_0x56c4('0xc1')]=function(_0x5cd941,_0x4b479a){return db['MailInteraction'][_0x56c4('0xc1')](_0x5cd941[_0x56c4('0xc2')],{})[_0x56c4('0x22')](respondWithResult(_0x4b479a,0xc9))['catch'](handleError(_0x4b479a,null));};exports[_0x56c4('0x21')]=function(_0x36b208,_0x4d70ad){if(_0x36b208[_0x56c4('0xc2')]['id']){delete _0x36b208[_0x56c4('0xc2')]['id'];}return db[_0x56c4('0x94')][_0x56c4('0x64')]({'where':{'id':_0x36b208[_0x56c4('0xbc')]['id']}})[_0x56c4('0x22')](handleEntityNotFound(_0x4d70ad,null))[_0x56c4('0x22')](saveUpdates(_0x36b208['body'],null))[_0x56c4('0x22')](respondWithResult(_0x4d70ad,null))[_0x56c4('0x30')](handleError(_0x4d70ad,null));};exports[_0x56c4('0xc3')]=function(_0x43aecc,_0x35619a){return db[_0x56c4('0x94')][_0x56c4('0x64')]({'where':{'id':_0x43aecc[_0x56c4('0xbc')]['id']}})[_0x56c4('0x22')](handleEntityNotFound(_0x35619a,null))[_0x56c4('0x22')](removeEntity(_0x35619a,null))['catch'](handleError(_0x35619a,null));};exports[_0x56c4('0xc4')]=function(_0x29a9ca,_0x34a49b){return db[_0x56c4('0x94')][_0x56c4('0xc4')]()[_0x56c4('0x22')](respondWithResult(_0x34a49b,null))['catch'](handleError(_0x34a49b,null));};exports[_0x56c4('0xc5')]=function(_0x5c1f8b,_0x1131ce){return db[_0x56c4('0xc6')][_0x56c4('0x64')]({'where':{'id':_0x5c1f8b[_0x56c4('0xbc')]['id']}})[_0x56c4('0x22')](handleEntityNotFound(_0x1131ce,null))[_0x56c4('0x22')](function(_0x5317f9){if(_0x5317f9){return _0x5317f9['addMessage'](_0x5c1f8b[_0x56c4('0xc2')][_0x56c4('0xc7')],_[_0x56c4('0xc8')](_0x5c1f8b[_0x56c4('0xc2')],[_0x56c4('0xc7'),'id'])||{});}})[_0x56c4('0x22')](respondWithResult(_0x1131ce,null))[_0x56c4('0x30')](handleError(_0x1131ce,null));};exports[_0x56c4('0xc9')]=function(_0x36bff4,_0x2ddfea){var _0x4bf393={'raw':![],'where':{}};var _0x53bdeb={};var _0x2a9dd5={'count':0x0,'rows':[]};return db[_0x56c4('0x94')][_0x56c4('0x2c')]({'where':{'id':_0x36bff4[_0x56c4('0xbc')]['id']}})[_0x56c4('0x22')](handleEntityNotFound(_0x2ddfea,null))['then'](function(_0x189e43){if(_0x189e43){_0x53bdeb[_0x56c4('0x43')]=_[_0x56c4('0x3e')](db[_0x56c4('0xc6')][_0x56c4('0x3a')]);_0x53bdeb[_0x56c4('0x3d')]=_[_0x56c4('0x3e')](_0x36bff4[_0x56c4('0x3d')]);_0x53bdeb['filters']=_[_0x56c4('0x40')](_0x53bdeb[_0x56c4('0x43')],_0x53bdeb['query']);_0x4bf393[_0x56c4('0x3f')]=_[_0x56c4('0x40')](_0x53bdeb[_0x56c4('0x43')],qs[_0x56c4('0x41')](_0x36bff4[_0x56c4('0x3d')][_0x56c4('0x41')]));_0x4bf393[_0x56c4('0x3f')]=_0x4bf393[_0x56c4('0x3f')][_0x56c4('0x42')]?_0x4bf393['attributes']:_0x53bdeb[_0x56c4('0x43')];if(!_0x36bff4[_0x56c4('0x3d')][_0x56c4('0x44')](_0x56c4('0xca'))){_0x4bf393[_0x56c4('0x1b')]=qs[_0x56c4('0x1b')](_0x36bff4[_0x56c4('0x3d')][_0x56c4('0x1b')]);_0x4bf393[_0x56c4('0x1a')]=qs[_0x56c4('0x1a')](_0x36bff4[_0x56c4('0x3d')][_0x56c4('0x1a')]);}_0x4bf393[_0x56c4('0x45')]=qs[_0x56c4('0x46')](_0x36bff4[_0x56c4('0x3d')]['sort']);_0x4bf393[_0x56c4('0x47')]=qs[_0x56c4('0xbd')](_[_0x56c4('0xcb')](_0x36bff4[_0x56c4('0x3d')],_0x53bdeb[_0x56c4('0xbd')]));_0x4bf393['where'][_0x56c4('0xb6')]=_0x189e43['id'];if(_0x36bff4[_0x56c4('0x3d')][_0x56c4('0x7f')]){_0x4bf393[_0x56c4('0x47')]=_['merge'](_0x4bf393[_0x56c4('0x47')],{'$or':_['map'](_0x4bf393[_0x56c4('0x3f')],function(_0x363f41){var _0x4bdfd4={};_0x4bdfd4[_0x363f41]={'$like':'%'+_0x36bff4[_0x56c4('0x3d')][_0x56c4('0x7f')]+'%'};return _0x4bdfd4;})});}if(_0x36bff4[_0x56c4('0x3d')][_0x56c4('0x77')]){var _0x9e7843=_0x36bff4['query'][_0x56c4('0x77')][_0x56c4('0x61')](',');var _0x1ba5e9={};_0x1ba5e9[_0x9e7843[0x0]]={'$gte':moment(_0x9e7843[0x1])[_0x56c4('0xcc')](_0x56c4('0xcd'))};_0x4bf393[_0x56c4('0x47')]=_[_0x56c4('0x93')](_0x4bf393[_0x56c4('0x47')],_0x1ba5e9);}_0x4bf393=_[_0x56c4('0x93')]({},_0x4bf393,_0x36bff4[_0x56c4('0xc0')]);return db[_0x56c4('0xc6')][_0x56c4('0x1d')]({'where':_0x4bf393[_0x56c4('0x47')]})['then'](function(_0x1da341){_0x2a9dd5[_0x56c4('0x1d')]=_0x1da341;if(_0x36bff4[_0x56c4('0x3d')]['includeAll']){_0x4bf393[_0x56c4('0xbf')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x4bf393);})[_0x56c4('0x22')](function(_0x284b81){if(_0x36bff4[_0x56c4('0x3d')][_0x56c4('0xce')]===_0x56c4('0xcf')){for(var _0x1027ed=0x0;_0x1027ed<_0x284b81['length'];_0x1027ed++){_0x284b81[_0x1027ed][_0x56c4('0xc2')]=juice(_0x284b81[_0x1027ed][_0x56c4('0xc2')]);}}_0x2a9dd5[_0x56c4('0xba')]=_0x284b81;return _0x2a9dd5;});}})[_0x56c4('0x22')](respondWithFilteredResult(_0x2ddfea,_0x4bf393))[_0x56c4('0x30')](handleError(_0x2ddfea,null));};exports[_0x56c4('0xd0')]=function(_0x2caf9a,_0xc73296){return db['MailInteraction']['find']({'where':{'id':_0x2caf9a['params']['id']}})[_0x56c4('0x22')](handleEntityNotFound(_0xc73296,null))[_0x56c4('0x22')](function(_0x37d4f7){if(_0x37d4f7){return _0x37d4f7[_0x56c4('0xd1')](_0x2caf9a[_0x56c4('0xc2')][_0x56c4('0xc7')],_[_0x56c4('0xc8')](_0x2caf9a['body'],[_0x56c4('0xc7'),'id'])||{})[_0x56c4('0xd2')](function(){return db[_0x56c4('0x69')]['findAll']({'attributes':['id',_0x56c4('0x25'),_0x56c4('0xd3')],'where':{'id':_0x2caf9a['body'][_0x56c4('0xc7')]}});})[_0x56c4('0x22')](function(_0x204386){socket[_0x56c4('0xd4')](_0x56c4('0xd5'),{'id':Number(_0x2caf9a[_0x56c4('0xbc')]['id']),'tags':_0x204386||[]});return{'id':Number(_0x2caf9a[_0x56c4('0xbc')]['id']),'tags':_0x204386||[]};});}})['then'](respondWithResult(_0xc73296,null))[_0x56c4('0x30')](handleError(_0xc73296,null));};exports[_0x56c4('0xd6')]=function(_0x5209c9,_0x5950e4){return db[_0x56c4('0x94')][_0x56c4('0x64')]({'where':{'id':_0x5209c9['params']['id']}})[_0x56c4('0x22')](handleEntityNotFound(_0x5950e4,null))[_0x56c4('0x22')](function(_0x2445cc){if(_0x2445cc){return _0x2445cc[_0x56c4('0xd6')](_0x5209c9['query'][_0x56c4('0xc7')]);}})['then'](respondWithStatusCode(_0x5950e4,null))['catch'](handleError(_0x5950e4,null));};exports[_0x56c4('0xd7')]=function(_0x138156,_0xd86363){var _0x33f657=moment()[_0x56c4('0xd8')]()['toString']();var _0x525a0f=path[_0x56c4('0xd9')](config['root'],_0x56c4('0xda'),_0x56c4('0xdb'),_0x56c4('0xdc'));var _0x14ed7f=path['join'](config[_0x56c4('0xdd')],'server',_0x56c4('0xdb'),_0x56c4('0xde'));var _0x36530e=path[_0x56c4('0xd9')](_0x525a0f,_0x33f657);var _0x5c627b=util[_0x56c4('0xcc')](_0x56c4('0xdf'),_0x138156[_0x56c4('0xbc')]['id'],_0x33f657);var _0x30cd5c=path['join'](_0x525a0f,_0x5c627b);var _0x74b2a6=[];if(_0x138156[_0x56c4('0x3d')][_0x56c4('0xde')]){_0x74b2a6[_0x56c4('0x2b')]({'model':db[_0x56c4('0xe0')],'as':_0x56c4('0xe1'),'raw':!![]});}var _0x38f0af=[{'model':db[_0x56c4('0xc6')],'as':_0x56c4('0xe2'),'attributes':['id',_0x56c4('0xc2'),'from','to','cc',_0x56c4('0xe3'),_0x56c4('0xe4'),_0x56c4('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x74b2a6}];return db[_0x56c4('0x94')][_0x56c4('0x64')]({'where':{'id':_0x138156[_0x56c4('0xbc')]['id']},'include':_0x38f0af})['then'](handleEntityNotFound(_0xd86363,null))['then'](function(_0x12691f){if(_0x12691f&&_0x12691f['Messages']){var _0x5b148b=_0x12691f[_0x56c4('0xe5')]({'plain':!![]});fs[_0x56c4('0xe6')](_0x36530e);return BPromise[_0x56c4('0xe7')](_0x5b148b[_0x56c4('0xe2')],function(_0x500d68,_0xa4e299){var _0x35e94={'from':_0x500d68[_0x56c4('0x4a')],'to':_0x500d68['to'],'subject':_0x500d68[_0x56c4('0xe4')],'html':htmlEntities[_0x56c4('0xe8')](_0x500d68[_0x56c4('0xc2')]),'headers':{'Date':moment(_0x500d68[_0x56c4('0x75')])['format'](_0x56c4('0xe9'))},'attachments':[]};if(_0x500d68['cc']){_0x35e94['headers']['Cc']=_0x500d68['cc'];}if(_0x500d68[_0x56c4('0xe3')]){_0x35e94[_0x56c4('0xea')]['Bcc']=_0x500d68[_0x56c4('0xe3')];}return new BPromise(function(_0x48af15,_0x421910){if(_0x500d68['Attachments']){for(var _0x366689=0x0;_0x366689<_0x500d68[_0x56c4('0xe1')]['length'];_0x366689++){var _0x484464=_0x500d68['Attachments'][_0x366689];var _0x4bf2c7=path[_0x56c4('0xd9')](_0x14ed7f,_0x484464['basename']);if(fs[_0x56c4('0xeb')](_0x4bf2c7)){_0x35e94[_0x56c4('0xde')][_0x56c4('0x2b')]({'name':_0x484464[_0x56c4('0x25')],'contentType':_0x484464[_0x56c4('0x3b')],'data':fs[_0x56c4('0xec')](_0x4bf2c7)});}}}emlformat[_0x56c4('0xed')](_0x35e94,function(_0x21f504,_0x51bd96){if(_0x21f504)return _0x421910(_0x21f504);fs[_0x56c4('0xee')](path[_0x56c4('0xd9')](_0x36530e,util[_0x56c4('0xcc')](_0x56c4('0xef'),_0xa4e299)),_0x51bd96);return _0x48af15(_0x51bd96);});});})[_0x56c4('0x22')](function(){return new BPromise(function(_0x19f50a,_0xe10a55){zipdir(_0x36530e,{'saveTo':_0x30cd5c},function(_0x1e1e5f,_0x1151a4){if(_0x1e1e5f)return _0xe10a55(_0x1e1e5f);return _0x19f50a(_0x1151a4);});})[_0x56c4('0x22')](function(){return new BPromise(function(_0x3980e0,_0x1199ff){rimraf(_0x36530e,function(_0x4c23e3){if(_0x4c23e3)_0x1199ff(_0x4c23e3);return _0x3980e0();});});})['then'](function(){return _0xd86363[_0x56c4('0xd7')](_0x30cd5c,_0x5c627b,function(_0x357917){if(!_0x357917)fs[_0x56c4('0xf0')](_0x30cd5c);});});});}else{return _0xd86363[_0x56c4('0x17')](0xc8);}})[_0x56c4('0x30')](handleError(_0xd86363,null));}; \ No newline at end of file +var _0xd959=['mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','some','isEmpty','MailAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','i.id\x20LIKE\x20?','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)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','role','toString','count','sequelize','keyBy','merge','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.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','all','rows','rawAttributes','intersection','include','create','body','update','params','describe','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','omit','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','format','Attachment','Attachments','Messages','bcc','get','mkdirSync','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','writeFileSync','message%d.eml','eml-format','rimraf','zip-dir','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','html-entities','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','register','status','end','json','offset','undefined','limit','set','Content-Range','then','destroy','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','answered','unmanaged','total','closed','UserId','talking','index','MailInteraction','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','u.fullname','ui.MailInteractionId','left_join','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','o.id\x20=\x20i.UserId'];(function(_0x126a46,_0x2fcfcd){var _0xbe5786=function(_0x239a51){while(--_0x239a51){_0x126a46['push'](_0x126a46['shift']());}};_0xbe5786(++_0x2fcfcd);}(_0xd959,0x94));var _0x9d95=function(_0x442ce0,_0x4f7e4d){_0x442ce0=_0x442ce0-0x0;var _0x1e12e4=_0xd959[_0x442ce0];return _0x1e12e4;};'use strict';var emlformat=require(_0x9d95('0x0'));var rimraf=require(_0x9d95('0x1'));var zipdir=require(_0x9d95('0x2'));var moment=require('moment');var BPromise=require(_0x9d95('0x3'));var util=require(_0x9d95('0x4'));var path=require(_0x9d95('0x5'));var fs=require('fs');var _=require(_0x9d95('0x6'));var squel=require(_0x9d95('0x7'));var juice=require('juice');var Redis=require(_0x9d95('0x8'));var qs=require(_0x9d95('0x9'));var as=require(_0x9d95('0xa'));var logger=require(_0x9d95('0xb'))('api');var config=require(_0x9d95('0xc'));var db=require(_0x9d95('0xd'))['db'];var htmlEntities=require(_0x9d95('0xe'));config['redis']=_[_0x9d95('0xf')](config['redis'],{'host':_0x9d95('0x10'),'port':0x18eb});var socket=require(_0x9d95('0x11'))(new Redis(config[_0x9d95('0x12')]));require(_0x9d95('0x13'))[_0x9d95('0x14')](socket);function respondWithStatusCode(_0x554f40,_0x474664){_0x474664=_0x474664||0xcc;return function(_0x21f4be){if(_0x21f4be){return _0x554f40['sendStatus'](_0x474664);}return _0x554f40[_0x9d95('0x15')](_0x474664)[_0x9d95('0x16')]();};}function respondWithResult(_0x510b67,_0x53d59c){_0x53d59c=_0x53d59c||0xc8;return function(_0x10f862){if(_0x10f862){return _0x510b67[_0x9d95('0x15')](_0x53d59c)[_0x9d95('0x17')](_0x10f862);}};}function respondWithFilteredResult(_0x568622,_0x1ff6a9){return function(_0x430bfe){if(_0x430bfe){var _0x4a8a60=typeof _0x1ff6a9[_0x9d95('0x18')]===_0x9d95('0x19')&&typeof _0x1ff6a9[_0x9d95('0x1a')]==='undefined';var _0x2d5ab2=_0x430bfe['count'];var _0x4cabfd=_0x4a8a60?0x0:_0x1ff6a9[_0x9d95('0x18')];var _0x46650b=_0x4a8a60?_0x430bfe['count']:_0x1ff6a9[_0x9d95('0x18')]+_0x1ff6a9['limit'];var _0x466fa3;if(_0x46650b>=_0x2d5ab2){_0x46650b=_0x2d5ab2;_0x466fa3=0xc8;}else{_0x466fa3=0xce;}_0x568622[_0x9d95('0x15')](_0x466fa3);return _0x568622[_0x9d95('0x1b')](_0x9d95('0x1c'),_0x4cabfd+'-'+_0x46650b+'/'+_0x2d5ab2)[_0x9d95('0x17')](_0x430bfe);}return null;};}function saveUpdates(_0x5a2a22){return function(_0x2f76db){if(_0x2f76db){return _0x2f76db['update'](_0x5a2a22)[_0x9d95('0x1d')](function(_0x33a809){return _0x33a809;});}return null;};}function removeEntity(_0x28dd35){return function(_0x19cfc7){if(_0x19cfc7){return _0x19cfc7[_0x9d95('0x1e')]()[_0x9d95('0x1d')](function(){_0x28dd35[_0x9d95('0x15')](0xcc)[_0x9d95('0x16')]();});}};}function handleEntityNotFound(_0x4a6a8e){return function(_0x31e950){if(!_0x31e950){_0x4a6a8e['sendStatus'](0x194);}return _0x31e950;};}function handleError(_0x5d0a9a,_0x8081ae){_0x8081ae=_0x8081ae||0x1f4;return function(_0x3c3a06){logger['error'](_0x3c3a06[_0x9d95('0x1f')]);if(_0x3c3a06[_0x9d95('0x20')]){delete _0x3c3a06['name'];}_0x5d0a9a['status'](_0x8081ae)[_0x9d95('0x21')](_0x3c3a06);};}function getInteractionUsers(_0x2f4684,_0x41abf6){return new BPromise(function(_0x43c94e,_0x4c9abd){try{if(_0x41abf6[_0x2f4684['id']]){_0x2f4684[_0x9d95('0x22')]=_[_0x9d95('0x23')](_0x41abf6[_0x2f4684['id']],function(_0x11a7b2){return{'id':_0x11a7b2['id'],'fullname':_0x11a7b2[_0x9d95('0x24')]};});}}catch(_0x240d7f){_0x4c9abd(_0x240d7f);}_0x43c94e(_0x2f4684);});}function getInteractionTags(_0x6c3c73,_0x295f58){return new BPromise(function(_0x32067a,_0x154834){try{if(_0x6c3c73[_0x9d95('0x25')]){_0x6c3c73['Tags']=[];_0x6c3c73[_0x9d95('0x25')][_0x9d95('0x26')](',')[_0x9d95('0x27')](function(_0x880530){_0x6c3c73[_0x9d95('0x28')][_0x9d95('0x29')](_0x295f58[_0x880530]);});}delete _0x6c3c73[_0x9d95('0x25')];}catch(_0x2611bb){_0x154834(_0x2611bb);}_0x32067a(_0x6c3c73);});}function getLastMessageText(_0x3a40af){return new BPromise(function(_0x1af23a,_0x5c123d){return db[_0x9d95('0x2a')][_0x9d95('0x2b')]({'where':{'$and':[{'MailInteractionId':_0x3a40af['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9d95('0x2c')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9d95('0x2d')],'order':_0x9d95('0x2e'),'raw':!![]})['then'](function(_0x1d1787){if(_0x1d1787&&_0x1d1787[_0x9d95('0x2d')]){_0x3a40af[_0x9d95('0x2f')]=_[_0x9d95('0x30')](_0x1d1787['plainBody']);}_0x1af23a(_0x3a40af);})[_0x9d95('0x31')](function(_0x4e2d43){_0x5c123d(_0x4e2d43);});});}function updateMailInteraction(_0x182066,_0x29171d,_0x2e003d,_0x4c9303){return new BPromise(function(_0x311e9f,_0x584c2f){return getInteractionUsers(_0x182066,_0x2e003d)['then'](function(_0x25baca){return getInteractionTags(_0x25baca,_0x29171d);})['then'](function(_0x590409){return getStateInteraction(_0x590409);})[_0x9d95('0x1d')](function(_0x5cb498){if(_0x4c9303){_0x311e9f(getLastMessageText(_0x5cb498));}else{_0x311e9f(_0x5cb498);}})['catch'](function(_0x296557){_0x584c2f(_0x296557);});});}function getStateInteraction(_0x3c8614){return new BPromise(function(_0x336e18){_0x3c8614[_0x9d95('0x32')]=0x0;_0x3c8614['talking']=0x0;_0x3c8614[_0x9d95('0x33')]=0x0;_0x3c8614[_0x9d95('0x34')]=0x0;_0x3c8614[_0x9d95('0x35')]=0x0;if(!_0x3c8614[_0x9d95('0x36')]&&!_0x3c8614[_0x9d95('0x37')]){_0x3c8614[_0x9d95('0x32')]+=0x1;}if(!_0x3c8614[_0x9d95('0x36')]&&_0x3c8614[_0x9d95('0x37')]){_0x3c8614[_0x9d95('0x38')]+=0x1;if(_0x3c8614['waiting']){_0x3c8614['waiting']-=0x1;}}if(_0x3c8614[_0x9d95('0x36')]&&_0x3c8614[_0x9d95('0x37')]){_0x3c8614[_0x9d95('0x33')]+=0x1;if(_0x3c8614['talking']){_0x3c8614[_0x9d95('0x38')]-=0x1;}}if(_0x3c8614[_0x9d95('0x36')]&&!_0x3c8614[_0x9d95('0x37')]){_0x3c8614[_0x9d95('0x34')]+=0x1;if(_0x3c8614['waiting']){_0x3c8614[_0x9d95('0x32')]-=0x1;}}_0x3c8614[_0x9d95('0x35')]+=0x1;_0x336e18(_0x3c8614);});}exports[_0x9d95('0x39')]=function(_0x53c257,_0x190fda){var _0x559b1c={},_0xcabd42={},_0x380475={'count':0x0,'rows':[]};var _0x54dbfd=_['map'](db[_0x9d95('0x3a')]['rawAttributes'],function(_0x3c5e29){return{'name':_0x3c5e29[_0x9d95('0x3b')],'type':_0x3c5e29[_0x9d95('0x3c')][_0x9d95('0x3d')]};});_0xcabd42['model']=_[_0x9d95('0x23')](_0x54dbfd,'name');_0xcabd42[_0x9d95('0x3e')]=_[_0x9d95('0x3f')](_0x53c257[_0x9d95('0x3e')]);_0xcabd42[_0x9d95('0x40')]=_['intersection'](_0xcabd42[_0x9d95('0x41')],_0xcabd42[_0x9d95('0x3e')]);_0x559b1c[_0x9d95('0x42')]=_['intersection'](_0xcabd42[_0x9d95('0x41')],qs[_0x9d95('0x43')](_0x53c257[_0x9d95('0x3e')][_0x9d95('0x43')]));_0x559b1c[_0x9d95('0x42')]=_0x559b1c[_0x9d95('0x42')][_0x9d95('0x44')]?_0x559b1c[_0x9d95('0x42')]:_0xcabd42[_0x9d95('0x41')];if(!_0x53c257[_0x9d95('0x3e')][_0x9d95('0x45')](_0x9d95('0x46'))){_0x559b1c[_0x9d95('0x1a')]=qs[_0x9d95('0x1a')](_0x53c257[_0x9d95('0x3e')][_0x9d95('0x1a')]);_0x559b1c[_0x9d95('0x18')]=qs[_0x9d95('0x18')](_0x53c257[_0x9d95('0x3e')]['offset']);}_0x559b1c['order']=qs[_0x9d95('0x47')](_0x53c257[_0x9d95('0x3e')][_0x9d95('0x47')]);_0x559b1c[_0x9d95('0x48')]=qs[_0x9d95('0x40')](_[_0x9d95('0x49')](_0x53c257[_0x9d95('0x3e')],_0xcabd42[_0x9d95('0x40')]),_0x54dbfd);var _0x4d472a=[];var _0x5f3fe3=squel[_0x9d95('0x4a')]()['field']('id')[_0x9d95('0x4b')](_0x9d95('0x20'))[_0x9d95('0x4b')](_0x9d95('0x4c'))[_0x9d95('0x4d')]('tools_tags');var _0x3961ab=squel[_0x9d95('0x4a')]()[_0x9d95('0x4b')]('u.id')[_0x9d95('0x4b')](_0x9d95('0x4e'))[_0x9d95('0x4b')](_0x9d95('0x4f'))[_0x9d95('0x4d')]('user_has_mail_interactions','ui')[_0x9d95('0x50')]('users','u',_0x9d95('0x51'));var _0x43e5a7=squel[_0x9d95('0x4a')]()[_0x9d95('0x4d')](_0x9d95('0x52'),'i')['left_join'](_0x9d95('0x53'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x9d95('0x50')]('users','o',_0x9d95('0x54'))[_0x9d95('0x50')](_0x9d95('0x55'),'a',_0x9d95('0x56'))[_0x9d95('0x50')](_0x9d95('0x57'),'me',_0x9d95('0x58'))[_0x9d95('0x50')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')[_0x9d95('0x50')](_0x9d95('0x59'),'t','t.id\x20=\x20it.TagId');var _0x14aae9=squel[_0x9d95('0x5a')]();var _0x39e56f=[];var _0x25b32a=squel[_0x9d95('0x5a')]();var _0x4089ad;if(_0x53c257[_0x9d95('0x3e')][_0x9d95('0x5b')]){_0x4089ad=as[_0x9d95('0x5c')](_0x53c257['query'][_0x9d95('0x5b')]);var _0x41beaf=_0x4089ad['sqlOperator'];for(var _0x10e554=0x0;_0x10e554<_0x4089ad[_0x9d95('0x5d')][_0x9d95('0x44')];_0x10e554++){var _0x2ee9dc=_0x4089ad[_0x9d95('0x5d')][_0x10e554];var _0x3b76d6='i';var _0x3ec082=_[_0x9d95('0x5e')](_0x54dbfd,[_0x9d95('0x20'),_0x2ee9dc[_0x9d95('0x4b')]]);if(!_0x3ec082){switch(_0x2ee9dc[_0x9d95('0x4b')]){case _0x9d95('0x5f'):if(_0x2ee9dc[_0x9d95('0x60')]==0x1){_0x43e5a7['having']('`'+_0x2ee9dc[_0x9d95('0x4b')]+_0x9d95('0x61'));}else{_0x43e5a7[_0x9d95('0x62')]('`'+_0x2ee9dc['field']+_0x9d95('0x63'));}break;case _0x9d95('0x64'):if(_0x2ee9dc[_0x9d95('0x65')]===_0x9d95('0x66')){if(_0x2ee9dc[_0x9d95('0x60')]['split']('\x20')['length']>0x1){_0x14aae9[_0x41beaf](_0x9d95('0x67'),qs['getFullTextValue'](_0x2ee9dc[_0x9d95('0x60')]),null);}else{var _0x1d5208='%'+_0x2ee9dc[_0x9d95('0x60')]+'%';_0x14aae9[_0x41beaf]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1d5208,_0x1d5208,_0x1d5208);}}else{_0x3ec082=_[_0x9d95('0x5e')](_0x54dbfd,['name','ContactId']);_0x2ee9dc[_0x9d95('0x4b')]=_0x9d95('0x68');_0x58f288=as[_0x9d95('0x69')](_0x3b76d6,_0x3ec082[_0x9d95('0x3c')],_0x2ee9dc);_0x14aae9[_0x41beaf](_0x58f288[_0x9d95('0x6a')],_0x58f288[_0x9d95('0x60')][_0x9d95('0x6b')],_0x58f288[_0x9d95('0x60')][_0x9d95('0x16')]);}break;case _0x9d95('0x6c'):var _0x509ffd=_0x2ee9dc[_0x9d95('0x60')][_0x9d95('0x26')](',')['map'](function(_0x91e41c){return Number(_0x91e41c);});_0x509ffd[_0x9d95('0x27')](function(_0x56eef2){_0x25b32a['or'](_0x9d95('0x6d'),'%,'+_0x56eef2+',%');});_0x39e56f=_['union'](_0x39e56f,_0x509ffd);break;case _0x9d95('0x6e'):if(_0x2ee9dc[_0x9d95('0x65')]==='$substring'){_0x14aae9[_0x41beaf]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2ee9dc['value']+'%',null);}else{_0x3ec082=_[_0x9d95('0x5e')](_0x54dbfd,['name',_0x9d95('0x37')]);_0x2ee9dc[_0x9d95('0x4b')]=_0x9d95('0x37');_0x58f288=as[_0x9d95('0x69')](_0x3b76d6,_0x3ec082[_0x9d95('0x3c')],_0x2ee9dc);_0x14aae9[_0x41beaf](_0x58f288[_0x9d95('0x6a')],_0x58f288[_0x9d95('0x60')]['start'],_0x58f288[_0x9d95('0x60')][_0x9d95('0x16')]);}break;case _0x9d95('0x2d'):_0x58f288=as['buildExpression']('me',null,_0x2ee9dc);_0x14aae9[_0x41beaf](_0x58f288[_0x9d95('0x6a')],_0x58f288[_0x9d95('0x60')][_0x9d95('0x6b')],_0x58f288[_0x9d95('0x60')][_0x9d95('0x16')]);break;}}else{var _0x58f288=as[_0x9d95('0x69')](_0x3b76d6,_0x3ec082[_0x9d95('0x3c')],_0x2ee9dc);_0x14aae9[_0x41beaf](_0x58f288[_0x9d95('0x6a')],_0x58f288[_0x9d95('0x60')][_0x9d95('0x6b')],_0x58f288[_0x9d95('0x60')]['end']);}}}else{var _0x398576=_(_0x53c257[_0x9d95('0x3e')])[_0x9d95('0x3f')]()[_0x9d95('0x23')](function(_0x374a8e){return _[_0x9d95('0x6f')](_0x54dbfd,['name',_0x374a8e])?_0x374a8e:undefined;})['compact']()['value']();if(!_[_0x9d95('0x70')](_0x398576)){_0x398576[_0x9d95('0x27')](function(_0x1a5f6d){if(_0x1a5f6d===_0x9d95('0x71')){_0x43e5a7[_0x9d95('0x48')]('i.MailAccountId\x20IN\x20?',[][_0x9d95('0x72')](_0x53c257['query'][_0x1a5f6d]));}else if(_0x1a5f6d===_0x9d95('0x73')){var _0x63f517=JSON[_0x9d95('0x74')](_0x53c257[_0x9d95('0x3e')][_0x1a5f6d])[_0x9d95('0x75')];var _0x550989=JSON[_0x9d95('0x74')](_0x53c257[_0x9d95('0x3e')][_0x1a5f6d])[_0x9d95('0x76')];_0x43e5a7[_0x9d95('0x48')](_0x9d95('0x77'),_0x63f517,_0x550989);}else{if(_0x53c257[_0x9d95('0x3e')][_0x1a5f6d]==='null'){_0x43e5a7[_0x9d95('0x48')]('i.'+_0x1a5f6d+'\x20IS\x20NULL');}else{_0x43e5a7[_0x9d95('0x48')]('i.'+_0x1a5f6d+_0x9d95('0x78'),_0x53c257[_0x9d95('0x3e')][_0x1a5f6d]);}}});}if(_0x53c257[_0x9d95('0x3e')][_0x9d95('0x79')]){if(_0x53c257[_0x9d95('0x3e')][_0x9d95('0x79')]==0x1){_0x43e5a7['having'](_0x9d95('0x7a'));}else{_0x43e5a7[_0x9d95('0x62')](_0x9d95('0x7b'));}}if(_0x53c257['query'][_0x9d95('0x7c')]){_0x39e56f=_['isArray'](_0x53c257[_0x9d95('0x3e')][_0x9d95('0x7c')])?_0x53c257['query'][_0x9d95('0x7c')]:new Array(_0x53c257[_0x9d95('0x3e')][_0x9d95('0x7c')]);_0x39e56f[_0x9d95('0x27')](function(_0x2e765c){_0x25b32a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2e765c+',%');});}if(_0x53c257[_0x9d95('0x3e')][_0x9d95('0x7d')]){var _0x333cf8=_0x53c257[_0x9d95('0x3e')][_0x9d95('0x7d')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x333cf8)){_0x14aae9['or'](_0x9d95('0x7e'),_0x333cf8+'%');}else if(qs['isEmail'](_0x333cf8)){_0x14aae9['or'](_0x9d95('0x7f'),_0x333cf8+'%');}else{_0x14aae9['or'](_0x9d95('0x80'),qs[_0x9d95('0x81')](_0x333cf8))['or'](_0x9d95('0x82'),qs[_0x9d95('0x81')](_0x333cf8));}}}_0x43e5a7[_0x9d95('0x48')](_0x14aae9);_0x43e5a7[_0x9d95('0x83')](_0x9d95('0x84'));var _0x12fced={'type':db[_0x9d95('0x85')][_0x9d95('0x86')][_0x9d95('0x87')],'raw':!![]};var _0x54024f=_0x43e5a7[_0x9d95('0x88')]();_0x54024f[_0x9d95('0x4b')](_0x9d95('0x84'));_0x54024f['field'](_0x9d95('0x89'),_0x9d95('0x5f'));if(_0x559b1c[_0x9d95('0x8a')]){_0x559b1c[_0x9d95('0x8a')][_0x9d95('0x27')](function(_0x3110d3){var _0xba1a94=_0x3110d3[0x0]===_0x9d95('0x8b')?_0x3110d3[0x0]:'i.'+_0x3110d3[0x0];_0x43e5a7[_0x9d95('0x8a')](_0xba1a94,_0x3110d3[0x1]===_0x9d95('0x8c')?![]:!![]);});}if(!_['isEmpty'](_0x39e56f)){_0x43e5a7['having'](_0x25b32a);_0x54024f['where']('t.id\x20IN\x20?',_0x39e56f);}BPromise['resolve']()[_0x9d95('0x1d')](function(){if(!_0x4089ad){if(_0x53c257['query']['MailAccountId'])return;_0x54024f[_0x9d95('0x48')](_0x9d95('0x8d'));_0x43e5a7['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x53c257[_0x9d95('0x8e')]['role']!=='agent')return;return _0x53c257[_0x9d95('0x8e')][_0x9d95('0x8f')]({'attributes':['id'],'raw':!![]})[_0x9d95('0x1d')](function(_0x21ec7f){if(_[_0x9d95('0x70')](_0x21ec7f)){_0x54024f[_0x9d95('0x48')](_0x9d95('0x90'));_0x43e5a7[_0x9d95('0x48')]('i.MailAccountId\x20IS\x20NULL');}else{_0x54024f[_0x9d95('0x48')](_0x9d95('0x91'),_['map'](_0x21ec7f,'id'));_0x43e5a7[_0x9d95('0x48')]('i.MailAccountId\x20IN\x20?',_[_0x9d95('0x23')](_0x21ec7f,'id'));}});})[_0x9d95('0x1d')](function(){if(_0x53c257[_0x9d95('0x8e')][_0x9d95('0x92')]==='agent'&&!_0x4089ad&&!_0x53c257[_0x9d95('0x3e')][_0x9d95('0x71')])return[];return db['sequelize'][_0x9d95('0x3e')](_0x54024f[_0x9d95('0x93')](),_0x12fced);})['then'](function(_0x43654e){_0x380475[_0x9d95('0x94')]=_0x43654e['length'];if(_0x380475['count']===0x0)return[];return db[_0x9d95('0x95')][_0x9d95('0x3e')](_0x5f3fe3[_0x9d95('0x93')](),_0x12fced)[_0x9d95('0x1d')](function(_0x59cf93){_0x4d472a=_[_0x9d95('0x96')](_0x59cf93,'id');_0x12fced=_[_0x9d95('0x97')](_0x12fced,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x53c257[_0x9d95('0x3e')][_0x9d95('0x43')]){_0x559b1c[_0x9d95('0x42')][_0x9d95('0x27')](function(_0x50c457){_0x43e5a7[_0x9d95('0x4b')]('i.'+_0x50c457);});}else{_0x43e5a7[_0x9d95('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9d95('0x5f'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0x98'),_0x9d95('0x99'));_0x43e5a7['field'](_0x9d95('0x9a'),_0x9d95('0x9b'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0x9c'),'contactName');_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0x84'));_0x43e5a7['field'](_0x9d95('0x9d'));_0x43e5a7['field'](_0x9d95('0x9e'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0x9f'));_0x43e5a7['field']('i.closedAt');_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xa0'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xa1'));_0x43e5a7['field'](_0x9d95('0xa2'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xa3'));_0x43e5a7[_0x9d95('0x4b')]('i.disposition');_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xa4'));_0x43e5a7['field'](_0x9d95('0xa5'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xa6'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xa7'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xa8'));_0x43e5a7['field'](_0x9d95('0xa9'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xaa'));_0x43e5a7['field'](_0x9d95('0xab'),_0x9d95('0xac'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xad'),_0x9d95('0xae'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xaf'),_0x9d95('0xb0'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xb1'),'Contact.phone');_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xb2'),'Contact.mobile');_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xb3'),_0x9d95('0xb4'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xb5'),_0x9d95('0xb6'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xb7'),_0x9d95('0xb8'));_0x43e5a7[_0x9d95('0x4b')](_0x9d95('0xb9'),_0x9d95('0x25'));}if(_0x559b1c['limit'])_0x43e5a7[_0x9d95('0x1a')](_0x559b1c[_0x9d95('0x1a')]);if(_0x559b1c[_0x9d95('0x18')])_0x43e5a7['offset'](_0x559b1c['offset']);return db[_0x9d95('0x95')]['query'](_0x43e5a7[_0x9d95('0x93')](),_0x12fced);})[_0x9d95('0x1d')](function(_0x190473){if(_0x190473['length']>0x0)_0x3961ab[_0x9d95('0x48')](_0x9d95('0xba'),_[_0x9d95('0x23')](_0x190473,'id'));return db[_0x9d95('0x95')][_0x9d95('0x3e')](_0x3961ab[_0x9d95('0x93')](),_0x12fced)[_0x9d95('0x1d')](function(_0x33ce72){var _0xb0c7af=_['groupBy'](_0x33ce72,_0x9d95('0xbb'));var _0xda5448=[];return db[_0x9d95('0xbc')][_0x9d95('0x2b')]({'attributes':[_0x9d95('0xbd')],'raw':!![]})[_0x9d95('0x1d')](function(_0x4dd2cb){var _0x26487a=_0x4dd2cb[_0x9d95('0xbd')];_0x190473[_0x9d95('0x27')](function(_0x18440f){_0xda5448['push'](updateMailInteraction(_0x18440f,_0x4d472a,_0xb0c7af,_0x26487a));});return BPromise[_0x9d95('0xbe')](_0xda5448);});});});})['then'](function(_0x49fd42){_0x380475[_0x9d95('0xbf')]=_0x49fd42;return _0x380475;})[_0x9d95('0x1d')](respondWithFilteredResult(_0x190fda,_0x559b1c))[_0x9d95('0x31')](handleError(_0x190fda,null));};exports['show']=function(_0x5d1d96,_0xbf713c){var _0x4edc78={'raw':![],'where':{'id':_0x5d1d96['params']['id']}},_0x59b8ff={};_0x59b8ff['model']=_[_0x9d95('0x3f')](db[_0x9d95('0x3a')][_0x9d95('0xc0')]);_0x59b8ff['query']=_['keys'](_0x5d1d96['query']);_0x59b8ff[_0x9d95('0x40')]=_['intersection'](_0x59b8ff[_0x9d95('0x41')],_0x59b8ff[_0x9d95('0x3e')]);_0x4edc78[_0x9d95('0x42')]=_[_0x9d95('0xc1')](_0x59b8ff['model'],qs[_0x9d95('0x43')](_0x5d1d96[_0x9d95('0x3e')][_0x9d95('0x43')]));_0x4edc78[_0x9d95('0x42')]=_0x4edc78[_0x9d95('0x42')]['length']?_0x4edc78[_0x9d95('0x42')]:_0x59b8ff[_0x9d95('0x41')];if(_0x5d1d96['query']['includeAll']){_0x4edc78[_0x9d95('0xc2')]=[{'all':!![]}];}_0x4edc78=_['merge']({},_0x4edc78,_0x5d1d96['options']);return db[_0x9d95('0x3a')][_0x9d95('0x5e')](_0x4edc78)[_0x9d95('0x1d')](handleEntityNotFound(_0xbf713c,null))['then'](respondWithResult(_0xbf713c,null))['catch'](handleError(_0xbf713c,null));};exports['create']=function(_0x17ee62,_0x427dc3){return db['MailInteraction'][_0x9d95('0xc3')](_0x17ee62[_0x9d95('0xc4')],{})[_0x9d95('0x1d')](respondWithResult(_0x427dc3,0xc9))[_0x9d95('0x31')](handleError(_0x427dc3,null));};exports[_0x9d95('0xc5')]=function(_0x2c78f7,_0x1759d4){if(_0x2c78f7['body']['id']){delete _0x2c78f7[_0x9d95('0xc4')]['id'];}return db[_0x9d95('0x3a')]['find']({'where':{'id':_0x2c78f7['params']['id']}})[_0x9d95('0x1d')](handleEntityNotFound(_0x1759d4,null))['then'](saveUpdates(_0x2c78f7['body'],null))[_0x9d95('0x1d')](respondWithResult(_0x1759d4,null))[_0x9d95('0x31')](handleError(_0x1759d4,null));};exports[_0x9d95('0x1e')]=function(_0x9f9677,_0x57fe8b){return db[_0x9d95('0x3a')][_0x9d95('0x5e')]({'where':{'id':_0x9f9677[_0x9d95('0xc6')]['id']}})['then'](handleEntityNotFound(_0x57fe8b,null))['then'](removeEntity(_0x57fe8b,null))['catch'](handleError(_0x57fe8b,null));};exports['describe']=function(_0x5d7c94,_0x497a47){return db['MailInteraction'][_0x9d95('0xc7')]()[_0x9d95('0x1d')](respondWithResult(_0x497a47,null))[_0x9d95('0x31')](handleError(_0x497a47,null));};exports[_0x9d95('0xc8')]=function(_0x3f467f,_0xc47ffd){return db[_0x9d95('0x2a')]['find']({'where':{'id':_0x3f467f[_0x9d95('0xc6')]['id']}})[_0x9d95('0x1d')](handleEntityNotFound(_0xc47ffd,null))[_0x9d95('0x1d')](function(_0x3378ce){if(_0x3378ce){return _0x3378ce[_0x9d95('0xc8')](_0x3f467f[_0x9d95('0xc4')][_0x9d95('0xc9')],_['omit'](_0x3f467f[_0x9d95('0xc4')],[_0x9d95('0xc9'),'id'])||{});}})['then'](respondWithResult(_0xc47ffd,null))[_0x9d95('0x31')](handleError(_0xc47ffd,null));};exports[_0x9d95('0xca')]=function(_0x2f35e0,_0x567b71){var _0x1a0e71={'raw':![],'where':{}};var _0x48eff4={};var _0x1dcb7f={'count':0x0,'rows':[]};return db[_0x9d95('0x3a')][_0x9d95('0x2b')]({'where':{'id':_0x2f35e0['params']['id']}})[_0x9d95('0x1d')](handleEntityNotFound(_0x567b71,null))[_0x9d95('0x1d')](function(_0x590f1e){if(_0x590f1e){_0x48eff4['model']=_[_0x9d95('0x3f')](db['MailMessage']['rawAttributes']);_0x48eff4[_0x9d95('0x3e')]=_[_0x9d95('0x3f')](_0x2f35e0[_0x9d95('0x3e')]);_0x48eff4[_0x9d95('0x40')]=_[_0x9d95('0xc1')](_0x48eff4[_0x9d95('0x41')],_0x48eff4[_0x9d95('0x3e')]);_0x1a0e71[_0x9d95('0x42')]=_[_0x9d95('0xc1')](_0x48eff4[_0x9d95('0x41')],qs['fields'](_0x2f35e0['query'][_0x9d95('0x43')]));_0x1a0e71[_0x9d95('0x42')]=_0x1a0e71[_0x9d95('0x42')][_0x9d95('0x44')]?_0x1a0e71[_0x9d95('0x42')]:_0x48eff4[_0x9d95('0x41')];if(!_0x2f35e0[_0x9d95('0x3e')][_0x9d95('0x45')](_0x9d95('0x46'))){_0x1a0e71[_0x9d95('0x1a')]=qs['limit'](_0x2f35e0['query']['limit']);_0x1a0e71['offset']=qs['offset'](_0x2f35e0[_0x9d95('0x3e')][_0x9d95('0x18')]);}_0x1a0e71[_0x9d95('0x8a')]=qs[_0x9d95('0x47')](_0x2f35e0[_0x9d95('0x3e')][_0x9d95('0x47')]);_0x1a0e71[_0x9d95('0x48')]=qs[_0x9d95('0x40')](_[_0x9d95('0x49')](_0x2f35e0[_0x9d95('0x3e')],_0x48eff4[_0x9d95('0x40')]));_0x1a0e71[_0x9d95('0x48')][_0x9d95('0xbb')]=_0x590f1e['id'];if(_0x2f35e0[_0x9d95('0x3e')][_0x9d95('0x7d')]){_0x1a0e71['where']=_[_0x9d95('0x97')](_0x1a0e71[_0x9d95('0x48')],{'$or':_[_0x9d95('0x23')](_0x1a0e71[_0x9d95('0x42')],function(_0x8e7d5b){var _0x1f4121={};_0x1f4121[_0x8e7d5b]={'$like':'%'+_0x2f35e0[_0x9d95('0x3e')][_0x9d95('0x7d')]+'%'};return _0x1f4121;})});}if(_0x2f35e0[_0x9d95('0x3e')][_0x9d95('0x75')]){var _0x137154=_0x2f35e0[_0x9d95('0x3e')][_0x9d95('0x75')][_0x9d95('0x26')](',');var _0x1c729c={};_0x1c729c[_0x137154[0x0]]={'$gte':moment(_0x137154[0x1])['format'](_0x9d95('0xcb'))};_0x1a0e71['where']=_[_0x9d95('0x97')](_0x1a0e71[_0x9d95('0x48')],_0x1c729c);}_0x1a0e71=_[_0x9d95('0x97')]({},_0x1a0e71,_0x2f35e0[_0x9d95('0xcc')]);return db['MailMessage'][_0x9d95('0x94')]({'where':_0x1a0e71[_0x9d95('0x48')]})['then'](function(_0x4517e8){_0x1dcb7f['count']=_0x4517e8;if(_0x2f35e0[_0x9d95('0x3e')]['includeAll']){_0x1a0e71[_0x9d95('0xc2')]=[{'all':!![]}];}return db[_0x9d95('0x2a')][_0x9d95('0xcd')](_0x1a0e71);})[_0x9d95('0x1d')](function(_0x1db26c){if(_0x2f35e0[_0x9d95('0x3e')]['inlineCss']==='true'){for(var _0x51d0aa=0x0;_0x51d0aa<_0x1db26c[_0x9d95('0x44')];_0x51d0aa++){_0x1db26c[_0x51d0aa]['body']=juice(_0x1db26c[_0x51d0aa][_0x9d95('0xc4')]);}}_0x1dcb7f[_0x9d95('0xbf')]=_0x1db26c;return _0x1dcb7f;});}})[_0x9d95('0x1d')](respondWithFilteredResult(_0x567b71,_0x1a0e71))[_0x9d95('0x31')](handleError(_0x567b71,null));};exports[_0x9d95('0xce')]=function(_0x410881,_0x401dbb){return db[_0x9d95('0x3a')]['find']({'where':{'id':_0x410881[_0x9d95('0xc6')]['id']}})['then'](handleEntityNotFound(_0x401dbb,null))[_0x9d95('0x1d')](function(_0x5570e5){if(_0x5570e5){return _0x5570e5[_0x9d95('0xcf')](_0x410881[_0x9d95('0xc4')][_0x9d95('0xc9')],_[_0x9d95('0xd0')](_0x410881[_0x9d95('0xc4')],['ids','id'])||{})[_0x9d95('0xd1')](function(){return db[_0x9d95('0x6c')][_0x9d95('0xcd')]({'attributes':['id',_0x9d95('0x20'),_0x9d95('0x4c')],'where':{'id':_0x410881[_0x9d95('0xc4')]['ids']}});})[_0x9d95('0x1d')](function(_0x49d2ff){socket[_0x9d95('0xd2')](_0x9d95('0xd3'),{'id':Number(_0x410881[_0x9d95('0xc6')]['id']),'tags':_0x49d2ff||[]});return{'id':Number(_0x410881[_0x9d95('0xc6')]['id']),'tags':_0x49d2ff||[]};});}})['then'](respondWithResult(_0x401dbb,null))[_0x9d95('0x31')](handleError(_0x401dbb,null));};exports[_0x9d95('0xd4')]=function(_0x2e23a0,_0x1ba56e){return db[_0x9d95('0x3a')]['find']({'where':{'id':_0x2e23a0[_0x9d95('0xc6')]['id']}})['then'](handleEntityNotFound(_0x1ba56e,null))[_0x9d95('0x1d')](function(_0x4d2a96){if(_0x4d2a96){return _0x4d2a96[_0x9d95('0xd4')](_0x2e23a0[_0x9d95('0x3e')]['ids']);}})[_0x9d95('0x1d')](respondWithStatusCode(_0x1ba56e,null))['catch'](handleError(_0x1ba56e,null));};exports[_0x9d95('0xd5')]=function(_0x345e2f,_0x1faa07){var _0x212ffc=moment()[_0x9d95('0xd6')]()[_0x9d95('0x93')]();var _0x28e52a=path[_0x9d95('0xd7')](config[_0x9d95('0xd8')],_0x9d95('0xd9'),_0x9d95('0xda'),'tmp');var _0x39c79a=path['join'](config[_0x9d95('0xd8')],'server','files',_0x9d95('0xdb'));var _0x1c2fdc=path[_0x9d95('0xd7')](_0x28e52a,_0x212ffc);var _0xdd077f=util[_0x9d95('0xdc')]('transcript-%d-%s.zip',_0x345e2f[_0x9d95('0xc6')]['id'],_0x212ffc);var _0x4cb030=path[_0x9d95('0xd7')](_0x28e52a,_0xdd077f);var _0x299d36=[];if(_0x345e2f[_0x9d95('0x3e')][_0x9d95('0xdb')]){_0x299d36['push']({'model':db[_0x9d95('0xdd')],'as':_0x9d95('0xde'),'raw':!![]});}var _0x47f25c=[{'model':db['MailMessage'],'as':_0x9d95('0xdf'),'attributes':['id',_0x9d95('0xc4'),_0x9d95('0x4d'),'to','cc',_0x9d95('0xe0'),'subject',_0x9d95('0x73')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x299d36}];return db[_0x9d95('0x3a')][_0x9d95('0x5e')]({'where':{'id':_0x345e2f[_0x9d95('0xc6')]['id']},'include':_0x47f25c})[_0x9d95('0x1d')](handleEntityNotFound(_0x1faa07,null))[_0x9d95('0x1d')](function(_0x2ad762){if(_0x2ad762&&_0x2ad762[_0x9d95('0xdf')]){var _0x26ba09=_0x2ad762[_0x9d95('0xe1')]({'plain':!![]});fs[_0x9d95('0xe2')](_0x1c2fdc);return BPromise['each'](_0x26ba09[_0x9d95('0xdf')],function(_0x56a54a,_0x4b28ab){var _0x4c9e91={'from':_0x56a54a[_0x9d95('0x4d')],'to':_0x56a54a['to'],'subject':_0x56a54a['subject'],'html':htmlEntities['decode'](_0x56a54a[_0x9d95('0xc4')]),'headers':{'Date':moment(_0x56a54a[_0x9d95('0x73')])[_0x9d95('0xdc')](_0x9d95('0xe3'))},'attachments':[]};if(_0x56a54a['cc']){_0x4c9e91[_0x9d95('0xe4')]['Cc']=_0x56a54a['cc'];}if(_0x56a54a[_0x9d95('0xe0')]){_0x4c9e91[_0x9d95('0xe4')]['Bcc']=_0x56a54a['bcc'];}return new BPromise(function(_0x1223d5,_0x70d07d){if(_0x56a54a[_0x9d95('0xde')]){for(var _0x2d5eb0=0x0;_0x2d5eb0<_0x56a54a['Attachments']['length'];_0x2d5eb0++){var _0x2ac32d=_0x56a54a[_0x9d95('0xde')][_0x2d5eb0];var _0x407c50=path[_0x9d95('0xd7')](_0x39c79a,_0x2ac32d[_0x9d95('0xe5')]);if(fs[_0x9d95('0xe6')](_0x407c50)){_0x4c9e91[_0x9d95('0xdb')][_0x9d95('0x29')]({'name':_0x2ac32d[_0x9d95('0x20')],'contentType':_0x2ac32d['type'],'data':fs['readFileSync'](_0x407c50)});}}}emlformat['build'](_0x4c9e91,function(_0x360d0b,_0x7729e7){if(_0x360d0b)return _0x70d07d(_0x360d0b);fs[_0x9d95('0xe7')](path[_0x9d95('0xd7')](_0x1c2fdc,util['format'](_0x9d95('0xe8'),_0x4b28ab)),_0x7729e7);return _0x1223d5(_0x7729e7);});});})[_0x9d95('0x1d')](function(){return new BPromise(function(_0x3e6616,_0x3bd8ac){zipdir(_0x1c2fdc,{'saveTo':_0x4cb030},function(_0x57e1ea,_0x5854d5){if(_0x57e1ea)return _0x3bd8ac(_0x57e1ea);return _0x3e6616(_0x5854d5);});})[_0x9d95('0x1d')](function(){return new BPromise(function(_0xf05f1e,_0x58832c){rimraf(_0x1c2fdc,function(_0x4002a5){if(_0x4002a5)_0x58832c(_0x4002a5);return _0xf05f1e();});});})[_0x9d95('0x1d')](function(){return _0x1faa07['download'](_0x4cb030,_0xdd077f,function(_0x28e65c){if(!_0x28e65c)fs['unlinkSync'](_0x4cb030);});});});}else{return _0x1faa07['sendStatus'](0xc8);}})[_0x9d95('0x31')](handleError(_0x1faa07,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 78d3ccd..f6c00f0 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 _0x1d9c=['setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers'];(function(_0x3f268a,_0x4d28d5){var _0x5b8b99=function(_0x4457c6){while(--_0x4457c6){_0x3f268a['push'](_0x3f268a['shift']());}};_0x5b8b99(++_0x4d28d5);}(_0x1d9c,0x64));var _0xc1d9=function(_0x888a02,_0x5df389){_0x888a02=_0x888a02-0x0;var _0xedd786=_0x1d9c[_0x888a02];return _0xedd786;};'use strict';var EventEmitter=require(_0xc1d9('0x0'));var MailInteraction=require(_0xc1d9('0x1'))['db'][_0xc1d9('0x2')];var MailMessage=require(_0xc1d9('0x1'))['db'][_0xc1d9('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc1d9('0x4')](0x0);var events={'afterCreate':_0xc1d9('0x5'),'afterUpdate':'update','afterDestroy':_0xc1d9('0x6')};function emitEvent(_0x3e5975){return function(_0x5f0b89,_0x56601a,_0x210653){_0x5f0b89[_0xc1d9('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x53922){_0x5f0b89[_0xc1d9('0x8')](_0xc1d9('0x9'),_0x53922[_0xc1d9('0xa')](function(_0x28bc4d){return{'id':_0x28bc4d['id']};}));return MailMessage[_0xc1d9('0xb')]({'where':{'MailInteractionId':_0x5f0b89['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x53002f){_0x5f0b89[_0xc1d9('0x8')](_0xc1d9('0xc'),_0x53002f['length']);MailInteractionEvents[_0xc1d9('0xd')](_0x3e5975+':'+_0x5f0b89['id'],_0x5f0b89);MailInteractionEvents[_0xc1d9('0xd')](_0x3e5975,_0x5f0b89);_0x210653(null);})[_0xc1d9('0xe')](_0x210653(null));};}for(var e in events){if(events[_0xc1d9('0xf')](e)){var event=events[e];MailInteraction[_0xc1d9('0x10')](e,emitEvent(event));}}module[_0xc1d9('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x29cd=['exports','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x4936e9,_0x3383a1){var _0x4cad8c=function(_0x5c8f1b){while(--_0x5c8f1b){_0x4936e9['push'](_0x4936e9['shift']());}};_0x4cad8c(++_0x3383a1);}(_0x29cd,0x17b));var _0xd29c=function(_0xfc56e9,_0x36f45b){_0xfc56e9=_0xfc56e9-0x0;var _0x4ca192=_0x29cd[_0xfc56e9];return _0x4ca192;};'use strict';var EventEmitter=require(_0xd29c('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xd29c('0x1')];var MailMessage=require(_0xd29c('0x2'))['db'][_0xd29c('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xd29c('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd29c('0x5'),'afterDestroy':_0xd29c('0x6')};function emitEvent(_0x5e2b4a){return function(_0x58a4e5,_0x1220d6,_0x40db62){_0x58a4e5[_0xd29c('0x7')]({'attributes':['id'],'raw':!![]})[_0xd29c('0x8')](function(_0x48633d){_0x58a4e5[_0xd29c('0x9')](_0xd29c('0xa'),_0x48633d[_0xd29c('0xb')](function(_0x55bda2){return{'id':_0x55bda2['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x58a4e5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd29c('0x8')](function(_0xd644eb){_0x58a4e5[_0xd29c('0x9')](_0xd29c('0xc'),_0xd644eb['length']);MailInteractionEvents[_0xd29c('0xd')](_0x5e2b4a+':'+_0x58a4e5['id'],_0x58a4e5);MailInteractionEvents[_0xd29c('0xd')](_0x5e2b4a,_0x58a4e5);_0x40db62(null);})[_0xd29c('0xe')](_0x40db62(null));};}for(var e in events){if(events[_0xd29c('0xf')](e)){var event=events[e];MailInteraction[_0xd29c('0x10')](e,emitEvent(event));}}module[_0xd29c('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 1081797..41c5208 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 _0xa593=['moment','bluebird','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','models','get','then','catch','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x57fbf3,_0x450361){var _0x99aa2b=function(_0xfceb3e){while(--_0xfceb3e){_0x57fbf3['push'](_0x57fbf3['shift']());}};_0x99aa2b(++_0x450361);}(_0xa593,0xc4));var _0x3a59=function(_0x4b2dad,_0x506b66){_0x4b2dad=_0x4b2dad-0x0;var _0x354cc9=_0xa593[_0x4b2dad];return _0x354cc9;};'use strict';var _=require(_0x3a59('0x0'));var util=require(_0x3a59('0x1'));var logger=require(_0x3a59('0x2'))(_0x3a59('0x3'));var moment=require(_0x3a59('0x4'));var BPromise=require(_0x3a59('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3a59('0x6'));var attributes=require(_0x3a59('0x7'));module[_0x3a59('0x8')]=function(_0x26a5b3,_0x315254){return _0x26a5b3[_0x3a59('0x9')]('MailInteraction',attributes,{'tableName':_0x3a59('0xa'),'paranoid':![],'indexes':[{'name':_0x3a59('0xb'),'fields':[_0x3a59('0xc'),'to'],'type':_0x3a59('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x8eb74a,_0x26cd44,_0x4279e1){if(_0x8eb74a[_0x3a59('0xe')]){_0x8eb74a[_0x3a59('0xf')]=moment()[_0x3a59('0x10')](_0x3a59('0x11'));}if(_0x8eb74a[_0x3a59('0x12')]){_0x8eb74a['closedAt']=moment()[_0x3a59('0x10')](_0x3a59('0x11'));}_0x4279e1(null,_0x26cd44);},'beforeUpdate':function(_0x9a6707,_0x4a4294,_0x1aef6a){if(_0x9a6707['changed'](_0x3a59('0xe'))){_0x9a6707[_0x3a59('0xf')]=_0x9a6707['substatus']?moment()[_0x3a59('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x9a6707[_0x3a59('0x13')](_0x3a59('0x12'))){_0x9a6707['closedAt']=moment()[_0x3a59('0x10')](_0x3a59('0x11'));_0x9a6707[_0x3a59('0xe')]=null;_0x9a6707[_0x3a59('0xf')]=null;}_0x1aef6a(null,_0x9a6707);},'afterUpdate':function(_0x369c41,_0x40537c,_0x32bf31){var _0x9e830e=_0x26a5b3[_0x3a59('0x14')];var _0x5bc0bd=_0x369c41[_0x3a59('0x15')]({'plain':!![]});if(_0x5bc0bd[_0x3a59('0x12')]){return _0x9e830e['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x5bc0bd['id']}})[_0x3a59('0x16')](function(){_0x32bf31();})[_0x3a59('0x17')](function(_0x19a1d8){_0x32bf31(_0x19a1d8);});}else{_0x32bf31();}}},'charset':_0x3a59('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3409=['subject','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','format','changed','closedAt','models','get','MailMessage','update','then','catch','utf8mb4','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions'];(function(_0x1667df,_0x266940){var _0x341abf=function(_0x123c3f){while(--_0x123c3f){_0x1667df['push'](_0x1667df['shift']());}};_0x341abf(++_0x266940);}(_0x3409,0x96));var _0x9340=function(_0x2ed69d,_0x79dd48){_0x2ed69d=_0x2ed69d-0x0;var _0x1c825c=_0x3409[_0x2ed69d];return _0x1c825c;};'use strict';var _=require(_0x9340('0x0'));var util=require(_0x9340('0x1'));var logger=require(_0x9340('0x2'))('api');var moment=require(_0x9340('0x3'));var BPromise=require(_0x9340('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9340('0x5'));var rimraf=require('rimraf');var config=require(_0x9340('0x6'));var attributes=require(_0x9340('0x7'));module[_0x9340('0x8')]=function(_0x4dfcc1,_0x244d1b){return _0x4dfcc1['define'](_0x9340('0x9'),attributes,{'tableName':_0x9340('0xa'),'paranoid':![],'indexes':[{'name':_0x9340('0xb'),'fields':[_0x9340('0xc'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3783b4,_0x24bd23,_0x2c8f91){if(_0x3783b4[_0x9340('0xd')]){_0x3783b4[_0x9340('0xe')]=moment()['format'](_0x9340('0xf'));}if(_0x3783b4[_0x9340('0x10')]){_0x3783b4['closedAt']=moment()[_0x9340('0x11')](_0x9340('0xf'));}_0x2c8f91(null,_0x24bd23);},'beforeUpdate':function(_0xd3c151,_0x4d74e4,_0x5011e8){if(_0xd3c151[_0x9340('0x12')](_0x9340('0xd'))){_0xd3c151[_0x9340('0xe')]=_0xd3c151[_0x9340('0xd')]?moment()[_0x9340('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0xd3c151[_0x9340('0x12')]('closed')){_0xd3c151[_0x9340('0x13')]=moment()['format'](_0x9340('0xf'));_0xd3c151[_0x9340('0xd')]=null;_0xd3c151[_0x9340('0xe')]=null;}_0x5011e8(null,_0xd3c151);},'afterUpdate':function(_0x1ee437,_0x2c22b5,_0x26ebc3){var _0x45ce4a=_0x4dfcc1[_0x9340('0x14')];var _0x48ea1e=_0x1ee437[_0x9340('0x15')]({'plain':!![]});if(_0x48ea1e[_0x9340('0x10')]){return _0x45ce4a[_0x9340('0x16')][_0x9340('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x48ea1e['id']}})[_0x9340('0x18')](function(){_0x26ebc3();})[_0x9340('0x19')](function(_0x1d9235){_0x26ebc3(_0x1d9235);});}else{_0x26ebc3();}}},'charset':_0x9340('0x1a'),'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 2cad02d..cb67203 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 _0xf156=['limit','debug','UpdateMailInteraction','MailInteraction','addTags','ids','AddTags','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body','options','raw','where','attributes'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xf156,0x137));var _0x6f15=function(_0x43c834,_0x3d4706){_0x43c834=_0x43c834-0x0;var _0x445205=_0xf156[_0x43c834];return _0x445205;};'use strict';var _=require('lodash');var util=require(_0x6f15('0x0'));var moment=require(_0x6f15('0x1'));var BPromise=require('bluebird');var rs=require(_0x6f15('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f15('0x3'))['db'];var utils=require(_0x6f15('0x4'));var logger=require(_0x6f15('0x5'))(_0x6f15('0x6'));var config=require(_0x6f15('0x7'));var jayson=require(_0x6f15('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x6f15('0x9')]=_[_0x6f15('0xa')](config['redis'],{'host':_0x6f15('0xb'),'port':0x18eb});var socket=require(_0x6f15('0xc'))(new Redis(config[_0x6f15('0x9')]));require(_0x6f15('0xd'))['register'](socket);function respondWithRpcPromise(_0x5aa7f5,_0x352bf2,_0x2b5297){return new BPromise(function(_0x243eea,_0x11f16f){return client[_0x6f15('0xe')](_0x5aa7f5,_0x2b5297)[_0x6f15('0xf')](function(_0x20f597){logger[_0x6f15('0x10')](_0x6f15('0x11'),_0x352bf2,_0x6f15('0x12'));logger['debug'](_0x6f15('0x13'),_0x352bf2,'request\x20sent',JSON[_0x6f15('0x14')](_0x20f597));if(_0x20f597[_0x6f15('0x15')]){if(_0x20f597[_0x6f15('0x15')][_0x6f15('0x16')]===0x1f4){logger[_0x6f15('0x15')](_0x6f15('0x11'),_0x352bf2,_0x20f597[_0x6f15('0x15')][_0x6f15('0x17')]);return _0x11f16f(_0x20f597[_0x6f15('0x15')][_0x6f15('0x17')]);}logger['error'](_0x6f15('0x11'),_0x352bf2,_0x20f597['error'][_0x6f15('0x17')]);return _0x243eea(_0x20f597['error'][_0x6f15('0x17')]);}else{logger['info'](_0x6f15('0x11'),_0x352bf2,'request\x20sent');_0x243eea(_0x20f597[_0x6f15('0x18')]['message']);}})[_0x6f15('0x19')](function(_0x344cd2){logger[_0x6f15('0x15')](_0x6f15('0x11'),_0x352bf2,_0x344cd2);_0x11f16f(_0x344cd2);});});}exports['UpdateMailInteraction']=function(_0x596634){var _0xcb33c7=this;return new Promise(function(_0x12d96a,_0x23a5c3){return db['MailInteraction']['update'](_0x596634[_0x6f15('0x1a')],{'raw':_0x596634[_0x6f15('0x1b')]?_0x596634['options'][_0x6f15('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x596634['options']?_0x596634[_0x6f15('0x1b')][_0x6f15('0x1d')]||null:null,'attributes':_0x596634['options']?_0x596634['options'][_0x6f15('0x1e')]||null:null,'limit':_0x596634['options']?_0x596634[_0x6f15('0x1b')][_0x6f15('0x1f')]||null:null})[_0x6f15('0xf')](function(_0x31f785){logger[_0x6f15('0x10')]('UpdateMailInteraction',_0x596634);logger[_0x6f15('0x20')](_0x6f15('0x21'),_0x596634,JSON[_0x6f15('0x14')](_0x31f785));_0x12d96a(_0x31f785);})[_0x6f15('0x19')](function(_0x5ab978){logger[_0x6f15('0x15')](_0x6f15('0x21'),_0x5ab978[_0x6f15('0x17')],_0x596634);_0x23a5c3(_0xcb33c7[_0x6f15('0x15')](0x1f4,_0x5ab978['message']));});});};exports['AddTagsToMailInteraction']=function(_0x362dc3){return new Promise(function(_0x117128,_0x3226cc){return db[_0x6f15('0x22')]['find']({'where':_0x362dc3[_0x6f15('0x1b')]?_0x362dc3['options']['where']||null:null})[_0x6f15('0xf')](function(_0x1cc321){if(_0x1cc321){return _0x1cc321[_0x6f15('0x23')](_0x362dc3[_0x6f15('0x1a')][_0x6f15('0x24')],_['omit'](_0x362dc3[_0x6f15('0x1a')],[_0x6f15('0x24'),'id'])||{});}})['spread'](function(_0x38ba99){logger['info'](_0x6f15('0x25'),_0x362dc3);logger[_0x6f15('0x20')](_0x6f15('0x25'),_0x362dc3,JSON['stringify'](_0x38ba99));_0x117128(_0x38ba99);})[_0x6f15('0x19')](function(_0xb7ba68){logger[_0x6f15('0x15')](_0x6f15('0x25'),_0xb7ba68[_0x6f15('0x17')],_0x362dc3);_0x3226cc(_this[_0x6f15('0x15')](0x1f4,_0xb7ba68[_0x6f15('0x17')]));});});}; \ No newline at end of file +var _0x649e=['where','attributes','limit','UpdateMailInteraction','stringify','AddTagsToMailInteraction','body','ids','spread','AddTags','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','MailInteraction','update','options','raw'];(function(_0xc45624,_0x5f322c){var _0x34aa73=function(_0x192ba6){while(--_0x192ba6){_0xc45624['push'](_0xc45624['shift']());}};_0x34aa73(++_0x5f322c);}(_0x649e,0xdd));var _0xe649=function(_0x509409,_0x40025c){_0x509409=_0x509409-0x0;var _0x17316f=_0x649e[_0x509409];return _0x17316f;};'use strict';var _=require(_0xe649('0x0'));var util=require(_0xe649('0x1'));var moment=require(_0xe649('0x2'));var BPromise=require(_0xe649('0x3'));var rs=require(_0xe649('0x4'));var fs=require('fs');var Redis=require(_0xe649('0x5'));var db=require(_0xe649('0x6'))['db'];var utils=require(_0xe649('0x7'));var logger=require(_0xe649('0x8'))('rpc');var config=require(_0xe649('0x9'));var jayson=require(_0xe649('0xa'));var client=jayson[_0xe649('0xb')]['http']({'port':0x232a});config[_0xe649('0xc')]=_[_0xe649('0xd')](config[_0xe649('0xc')],{'host':_0xe649('0xe'),'port':0x18eb});var socket=require(_0xe649('0xf'))(new Redis(config[_0xe649('0xc')]));require(_0xe649('0x10'))[_0xe649('0x11')](socket);function respondWithRpcPromise(_0x48f631,_0x529405,_0x3b9880){return new BPromise(function(_0x4d27d1,_0x5aa502){return client['request'](_0x48f631,_0x3b9880)[_0xe649('0x12')](function(_0x340763){logger[_0xe649('0x13')](_0xe649('0x14'),_0x529405,_0xe649('0x15'));logger['debug'](_0xe649('0x16'),_0x529405,'request\x20sent',JSON['stringify'](_0x340763));if(_0x340763[_0xe649('0x17')]){if(_0x340763[_0xe649('0x17')]['code']===0x1f4){logger[_0xe649('0x17')]('MailInteraction,\x20%s,\x20%s',_0x529405,_0x340763[_0xe649('0x17')][_0xe649('0x18')]);return _0x5aa502(_0x340763[_0xe649('0x17')][_0xe649('0x18')]);}logger[_0xe649('0x17')](_0xe649('0x14'),_0x529405,_0x340763[_0xe649('0x17')][_0xe649('0x18')]);return _0x4d27d1(_0x340763[_0xe649('0x17')][_0xe649('0x18')]);}else{logger[_0xe649('0x13')](_0xe649('0x14'),_0x529405,'request\x20sent');_0x4d27d1(_0x340763[_0xe649('0x19')][_0xe649('0x18')]);}})[_0xe649('0x1a')](function(_0x1da5e4){logger[_0xe649('0x17')]('MailInteraction,\x20%s,\x20%s',_0x529405,_0x1da5e4);_0x5aa502(_0x1da5e4);});});}exports['UpdateMailInteraction']=function(_0x4cd929){var _0x5d6c3c=this;return new Promise(function(_0x7c1952,_0x382eb8){return db[_0xe649('0x1b')][_0xe649('0x1c')](_0x4cd929['body'],{'raw':_0x4cd929[_0xe649('0x1d')]?_0x4cd929[_0xe649('0x1d')][_0xe649('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cd929[_0xe649('0x1d')]?_0x4cd929[_0xe649('0x1d')][_0xe649('0x1f')]||null:null,'attributes':_0x4cd929[_0xe649('0x1d')]?_0x4cd929[_0xe649('0x1d')][_0xe649('0x20')]||null:null,'limit':_0x4cd929[_0xe649('0x1d')]?_0x4cd929['options'][_0xe649('0x21')]||null:null})[_0xe649('0x12')](function(_0x1f8c96){logger[_0xe649('0x13')](_0xe649('0x22'),_0x4cd929);logger['debug']('UpdateMailInteraction',_0x4cd929,JSON[_0xe649('0x23')](_0x1f8c96));_0x7c1952(_0x1f8c96);})['catch'](function(_0x4a42c4){logger['error']('UpdateMailInteraction',_0x4a42c4[_0xe649('0x18')],_0x4cd929);_0x382eb8(_0x5d6c3c['error'](0x1f4,_0x4a42c4[_0xe649('0x18')]));});});};exports[_0xe649('0x24')]=function(_0x5db1d9){return new Promise(function(_0x4405b8,_0x4b42d2){return db['MailInteraction']['find']({'where':_0x5db1d9[_0xe649('0x1d')]?_0x5db1d9[_0xe649('0x1d')]['where']||null:null})[_0xe649('0x12')](function(_0x4fcaa6){if(_0x4fcaa6){return _0x4fcaa6['addTags'](_0x5db1d9[_0xe649('0x25')][_0xe649('0x26')],_['omit'](_0x5db1d9[_0xe649('0x25')],[_0xe649('0x26'),'id'])||{});}})[_0xe649('0x27')](function(_0x3e8471){logger['info'](_0xe649('0x28'),_0x5db1d9);logger[_0xe649('0x29')]('AddTags',_0x5db1d9,JSON[_0xe649('0x23')](_0x3e8471));_0x4405b8(_0x3e8471);})[_0xe649('0x1a')](function(_0x3eb079){logger['error']('AddTags',_0x3eb079[_0xe649('0x18')],_0x5db1d9);_0x4b42d2(_this['error'](0x1f4,_0x3eb079[_0xe649('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index b437b5e..2e319e2 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 _0x343e=['update','emit','removeListener','register','mailInteraction:','./mailInteraction.events','remove'];(function(_0xee61f,_0x25bb94){var _0x27afc2=function(_0x5161cb){while(--_0x5161cb){_0xee61f['push'](_0xee61f['shift']());}};_0x27afc2(++_0x25bb94);}(_0x343e,0x178));var _0xe343=function(_0x172562,_0x51917a){_0x172562=_0x172562-0x0;var _0x38257b=_0x343e[_0x172562];return _0x38257b;};'use strict';var MailInteractionEvents=require(_0xe343('0x0'));var events=['save',_0xe343('0x1'),_0xe343('0x2')];function createListener(_0x30ba8b,_0x5c1f01){return function(_0x3c979a){_0x5c1f01[_0xe343('0x3')](_0x30ba8b,_0x3c979a);};}function removeListener(_0xaedaa7,_0x4657ab){return function(){MailInteractionEvents[_0xe343('0x4')](_0xaedaa7,_0x4657ab);};}exports[_0xe343('0x5')]=function(_0x5d6b6e){for(var _0x147d31=0x0,_0x378900=events['length'];_0x147d31<_0x378900;_0x147d31++){var _0x3395f5=events[_0x147d31];var _0x3d0dbb=createListener(_0xe343('0x6')+_0x3395f5,_0x5d6b6e);MailInteractionEvents['on'](_0x3395f5,_0x3d0dbb);}}; \ No newline at end of file +var _0xb041=['register','length','mailInteraction:','./mailInteraction.events','save','update','emit','removeListener'];(function(_0xbcc9e2,_0x10e91e){var _0x378805=function(_0x2ecbd7){while(--_0x2ecbd7){_0xbcc9e2['push'](_0xbcc9e2['shift']());}};_0x378805(++_0x10e91e);}(_0xb041,0xb3));var _0x1b04=function(_0x57323d,_0x414ad5){_0x57323d=_0x57323d-0x0;var _0x47d9d2=_0xb041[_0x57323d];return _0x47d9d2;};'use strict';var MailInteractionEvents=require(_0x1b04('0x0'));var events=[_0x1b04('0x1'),'remove',_0x1b04('0x2')];function createListener(_0x2da367,_0x922901){return function(_0x5d3419){_0x922901[_0x1b04('0x3')](_0x2da367,_0x5d3419);};}function removeListener(_0x4e9ec2,_0x3575f2){return function(){MailInteractionEvents[_0x1b04('0x4')](_0x4e9ec2,_0x3575f2);};}exports[_0x1b04('0x5')]=function(_0x201618){for(var _0x54f057=0x0,_0xc431d2=events[_0x1b04('0x6')];_0x54f057<_0xc431d2;_0x54f057++){var _0x51ba2f=events[_0x54f057];var _0x1348cc=createListener(_0x1b04('0x7')+_0x51ba2f,_0x201618);MailInteractionEvents['on'](_0x51ba2f,_0x1348cc);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 40237c6..5e035ba 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 _0x9649=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','index','isAuthenticated','describe','get','show','/:id/download','download','tracked','mailmessage:create','create','/:id','update','put','/:id/accept','accept','/:id/reject','delete','destroy','exports'];(function(_0x24b6ac,_0x2cfe6a){var _0xb30964=function(_0x4083ed){while(--_0x4083ed){_0x24b6ac['push'](_0x24b6ac['shift']());}};_0xb30964(++_0x2cfe6a);}(_0x9649,0x118));var _0x9964=function(_0xd85c4b,_0x4ce11b){_0xd85c4b=_0xd85c4b-0x0;var _0x5d4392=_0x9649[_0xd85c4b];return _0x5d4392;};'use strict';var multer=require(_0x9964('0x0'));var util=require(_0x9964('0x1'));var path=require('path');var timeout=require(_0x9964('0x2'));var express=require(_0x9964('0x3'));var router=express[_0x9964('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9964('0x5'));var interaction=require(_0x9964('0x6'));var config=require(_0x9964('0x7'));var controller=require(_0x9964('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9964('0x9')]);router['get']('/describe',auth[_0x9964('0xa')](),controller[_0x9964('0xb')]);router[_0x9964('0xc')]('/:id',auth[_0x9964('0xa')](),controller[_0x9964('0xd')]);router[_0x9964('0xc')](_0x9964('0xe'),auth['isAuthenticated'](),controller[_0x9964('0xf')]);router['post']('/',auth[_0x9964('0xa')](),interaction[_0x9964('0x10')]('mail',_0x9964('0x11')),controller[_0x9964('0x12')]);router['put'](_0x9964('0x13'),auth['isAuthenticated'](),controller[_0x9964('0x14')]);router[_0x9964('0x15')](_0x9964('0x16'),auth[_0x9964('0xa')](),controller[_0x9964('0x17')]);router[_0x9964('0x15')](_0x9964('0x18'),auth['isAuthenticated'](),controller['reject']);router[_0x9964('0x19')](_0x9964('0x13'),auth['isAuthenticated'](),controller[_0x9964('0x1a')]);module[_0x9964('0x1b')]=router; \ No newline at end of file +var _0x1b0b=['/:id','update','/:id/accept','accept','reject','destroy','exports','multer','util','path','express','Router','fs-extra','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id/download','download','post','tracked','mailmessage:create','create','put'];(function(_0x267711,_0x492d9b){var _0x329801=function(_0x1f6287){while(--_0x1f6287){_0x267711['push'](_0x267711['shift']());}};_0x329801(++_0x492d9b);}(_0x1b0b,0x173));var _0xb1b0=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x1b0b[_0x32f7d7];return _0x133d09;};'use strict';var multer=require(_0xb1b0('0x0'));var util=require(_0xb1b0('0x1'));var path=require(_0xb1b0('0x2'));var timeout=require('connect-timeout');var express=require(_0xb1b0('0x3'));var router=express[_0xb1b0('0x4')]();var fs_extra=require(_0xb1b0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb1b0('0x6'));router[_0xb1b0('0x7')]('/',auth[_0xb1b0('0x8')](),controller[_0xb1b0('0x9')]);router[_0xb1b0('0x7')](_0xb1b0('0xa'),auth[_0xb1b0('0x8')](),controller[_0xb1b0('0xb')]);router[_0xb1b0('0x7')]('/:id',auth[_0xb1b0('0x8')](),controller['show']);router['get'](_0xb1b0('0xc'),auth[_0xb1b0('0x8')](),controller[_0xb1b0('0xd')]);router[_0xb1b0('0xe')]('/',auth[_0xb1b0('0x8')](),interaction[_0xb1b0('0xf')]('mail',_0xb1b0('0x10')),controller[_0xb1b0('0x11')]);router[_0xb1b0('0x12')](_0xb1b0('0x13'),auth[_0xb1b0('0x8')](),controller[_0xb1b0('0x14')]);router[_0xb1b0('0x12')](_0xb1b0('0x15'),auth[_0xb1b0('0x8')](),controller[_0xb1b0('0x16')]);router[_0xb1b0('0x12')]('/:id/reject',auth[_0xb1b0('0x8')](),controller[_0xb1b0('0x17')]);router['delete'](_0xb1b0('0x13'),auth[_0xb1b0('0x8')](),controller[_0xb1b0('0x18')]);module[_0xb1b0('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index aee84a4..1770590 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 _0x70d5=['lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','INTEGER','Email'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x70d5,0x18c));var _0x570d=function(_0x2a607c,_0x2c0ede){_0x2a607c=_0x2a607c-0x0;var _0x46f19a=_0x70d5[_0x2a607c];return _0x46f19a;};'use strict';var Sequelize=require('sequelize');var _=require(_0x570d('0x0'));module[_0x570d('0x1')]={'body':{'type':Sequelize[_0x570d('0x2')](_0x570d('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x570d('0x2')](_0x570d('0x4'))},'read':{'type':Sequelize[_0x570d('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x570d('0x6')]('in',_0x570d('0x7')),'defaultValue':_0x570d('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x570d('0x8')](0x1fe)},'from':{'type':Sequelize[_0x570d('0x8')]},'to':{'type':Sequelize[_0x570d('0x2')](_0x570d('0x3'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize['TEXT'](_0x570d('0x3'))},'subject':{'type':Sequelize[_0x570d('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x570d('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x570d('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT'](_0x570d('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0x570d('0x3'))},'originChannel':{'type':Sequelize[_0x570d('0x6')](_0x570d('0xa'),'Chat'),'defaultValue':_0x570d('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x5bf2=['STRING','INTEGER','DATE','Chat','Email','sequelize','lodash','long','TEXT','BOOLEAN','ENUM','out'];(function(_0x2769fd,_0x197b60){var _0x5d1e3e=function(_0xc61259){while(--_0xc61259){_0x2769fd['push'](_0x2769fd['shift']());}};_0x5d1e3e(++_0x197b60);}(_0x5bf2,0x1f1));var _0x25bf=function(_0x47a822,_0xe6c0fa){_0x47a822=_0x47a822-0x0;var _0x1f9941=_0x5bf2[_0x47a822];return _0x1f9941;};'use strict';var Sequelize=require(_0x25bf('0x0'));var _=require(_0x25bf('0x1'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x25bf('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x25bf('0x3')]('medium')},'read':{'type':Sequelize[_0x25bf('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x25bf('0x5')]('in',_0x25bf('0x6')),'defaultValue':_0x25bf('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x25bf('0x7')]},'to':{'type':Sequelize[_0x25bf('0x3')](_0x25bf('0x2'))},'cc':{'type':Sequelize[_0x25bf('0x3')](_0x25bf('0x2'))},'bcc':{'type':Sequelize['TEXT'](_0x25bf('0x2'))},'subject':{'type':Sequelize[_0x25bf('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x25bf('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x25bf('0x9')]},'originTo':{'type':Sequelize[_0x25bf('0x3')]('long')},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x25bf('0x5')]('Email',_0x25bf('0xa')),'defaultValue':_0x25bf('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 8eee7b5..8881e10 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 _0xfdaa=['ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','MailInteraction','MailInteractionId','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','rejectmessage','download','unix','toString','root','server','files','tmp','from','createdAt','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','html-entities','./mailMessage.socket','register','jayson/promise','http','client','request','then','info','debug','request\x20sent','error','message','MailMessage,\x20%s,\x20%s','result','status','json','offset','limit','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','findAll','rows','catch','show','params','includeAll','include','merge','body','find','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','List','Contacts','DESC','MailServerOut','Smtp','CloudProvider','attachments','join','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','UserId','user','agent','isNil','read1stAt','interaction','get','role','AcceptMessage'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfdaa,0x171));var _0xafda=function(_0x1f9503,_0x8e450b){_0x1f9503=_0x1f9503-0x0;var _0xaab94f=_0xfdaa[_0x1f9503];return _0xaab94f;};'use strict';var emlformat=require(_0xafda('0x0'));var moment=require(_0xafda('0x1'));var BPromise=require(_0xafda('0x2'));var util=require(_0xafda('0x3'));var path=require(_0xafda('0x4'));var fs=require('fs');var _=require(_0xafda('0x5'));var Redis=require(_0xafda('0x6'));var htmlToText=require('html-to-text');var qs=require(_0xafda('0x7'));var logger=require(_0xafda('0x8'))(_0xafda('0x9'));var interaction_log=require(_0xafda('0x8'))(_0xafda('0xa'));var config=require(_0xafda('0xb'));var db=require(_0xafda('0xc'))['db'];config[_0xafda('0xd')]=_[_0xafda('0xe')](config[_0xafda('0xd')],{'host':_0xafda('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xafda('0xd')]));var htmlEntities=require(_0xafda('0x10'));require(_0xafda('0x11'))[_0xafda('0x12')](socket);var jayson=require(_0xafda('0x13'));var client=jayson['client'][_0xafda('0x14')]({'port':0x232c});var client9003=jayson['client'][_0xafda('0x14')]({'port':0x232b});var client9002=jayson[_0xafda('0x15')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a0bc4,_0x388f48,_0x1d2b91,_0x1d9254){return new BPromise(function(_0x1a5c18,_0x3d1ed4){var _0x5c0a5b=_0x1d9254||client;return _0x5c0a5b[_0xafda('0x16')](_0x2a0bc4,_0x1d2b91)[_0xafda('0x17')](function(_0xa1a9e5){logger[_0xafda('0x18')]('MailMessage,\x20%s,\x20%s',_0x388f48,'request\x20sent');logger[_0xafda('0x19')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x388f48,_0xafda('0x1a'),JSON['stringify'](_0xa1a9e5));if(_0xa1a9e5['error']){if(_0xa1a9e5[_0xafda('0x1b')]['code']===0x1f4){logger[_0xafda('0x1b')]('MailMessage,\x20%s,\x20%s',_0x388f48,_0xa1a9e5[_0xafda('0x1b')]['message']);return _0x3d1ed4(_0xa1a9e5[_0xafda('0x1b')][_0xafda('0x1c')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x388f48,_0xa1a9e5['error'][_0xafda('0x1c')]);return _0x1a5c18(_0xa1a9e5[_0xafda('0x1b')][_0xafda('0x1c')]);}else{logger[_0xafda('0x18')](_0xafda('0x1d'),_0x388f48,_0xafda('0x1a'));_0x1a5c18(_0xa1a9e5[_0xafda('0x1e')]['message']);}})['catch'](function(_0x1ae605){logger[_0xafda('0x1b')](_0xafda('0x1d'),_0x388f48,_0x1ae605);_0x3d1ed4(_0x1ae605);});});}function respondWithResult(_0x2f4a8c,_0x19eb42){_0x19eb42=_0x19eb42||0xc8;return function(_0x404ee5){if(_0x404ee5){return _0x2f4a8c[_0xafda('0x1f')](_0x19eb42)[_0xafda('0x20')](_0x404ee5);}};}function respondWithFilteredResult(_0x3207cf,_0xebdefe){return function(_0x256262){if(_0x256262){var _0xfaea9=typeof _0xebdefe[_0xafda('0x21')]==='undefined'&&typeof _0xebdefe[_0xafda('0x22')]==='undefined';var _0x4b7e6f=_0x256262[_0xafda('0x23')];var _0x1c21b7=_0xfaea9?0x0:_0xebdefe[_0xafda('0x21')];var _0x31957e=_0xfaea9?_0x256262['count']:_0xebdefe[_0xafda('0x21')]+_0xebdefe[_0xafda('0x22')];var _0x37a1de;if(_0x31957e>=_0x4b7e6f){_0x31957e=_0x4b7e6f;_0x37a1de=0xc8;}else{_0x37a1de=0xce;}_0x3207cf['status'](_0x37a1de);return _0x3207cf[_0xafda('0x24')](_0xafda('0x25'),_0x1c21b7+'-'+_0x31957e+'/'+_0x4b7e6f)[_0xafda('0x20')](_0x256262);}return null;};}function saveUpdates(_0x45d99e){return function(_0x4357be){if(_0x4357be){return _0x4357be[_0xafda('0x26')](_0x45d99e)['then'](function(_0x5a29b5){return _0x5a29b5;});}return null;};}function removeEntity(_0xa8a794){return function(_0x20a598){if(_0x20a598){return _0x20a598[_0xafda('0x27')]()[_0xafda('0x17')](function(){_0xa8a794['status'](0xcc)[_0xafda('0x28')]();});}};}function handleEntityNotFound(_0x4047e5){return function(_0x4abfd8){if(!_0x4abfd8){_0x4047e5[_0xafda('0x29')](0x194);}return _0x4abfd8;};}function handleError(_0x2abb82,_0x29bb08){_0x29bb08=_0x29bb08||0x1f4;return function(_0x3793a0){logger[_0xafda('0x1b')](_0x3793a0[_0xafda('0x2a')]);if(_0x3793a0[_0xafda('0x2b')]){delete _0x3793a0[_0xafda('0x2b')];}_0x2abb82[_0xafda('0x1f')](_0x29bb08)[_0xafda('0x2c')](_0x3793a0);};}exports[_0xafda('0x2d')]=function(_0x163695,_0x5758e2){var _0x53fc71={},_0xd7adc6={},_0x1194cc={'count':0x0,'rows':[]};var _0x5ba715=_[_0xafda('0x2e')](db[_0xafda('0x2f')][_0xafda('0x30')],function(_0x4f4d76){return{'name':_0x4f4d76[_0xafda('0x31')],'type':_0x4f4d76[_0xafda('0x32')][_0xafda('0x33')]};});_0xd7adc6['model']=_['map'](_0x5ba715,_0xafda('0x2b'));_0xd7adc6[_0xafda('0x34')]=_[_0xafda('0x35')](_0x163695[_0xafda('0x34')]);_0xd7adc6[_0xafda('0x36')]=_[_0xafda('0x37')](_0xd7adc6[_0xafda('0x38')],_0xd7adc6[_0xafda('0x34')]);_0x53fc71[_0xafda('0x39')]=_[_0xafda('0x37')](_0xd7adc6[_0xafda('0x38')],qs[_0xafda('0x3a')](_0x163695['query'][_0xafda('0x3a')]));_0x53fc71[_0xafda('0x39')]=_0x53fc71[_0xafda('0x39')][_0xafda('0x3b')]?_0x53fc71[_0xafda('0x39')]:_0xd7adc6[_0xafda('0x38')];if(!_0x163695[_0xafda('0x34')][_0xafda('0x3c')](_0xafda('0x3d'))){_0x53fc71[_0xafda('0x22')]=qs['limit'](_0x163695['query']['limit']);_0x53fc71[_0xafda('0x21')]=qs[_0xafda('0x21')](_0x163695['query'][_0xafda('0x21')]);}_0x53fc71[_0xafda('0x3e')]=qs[_0xafda('0x3f')](_0x163695[_0xafda('0x34')]['sort']);_0x53fc71[_0xafda('0x40')]=qs[_0xafda('0x36')](_[_0xafda('0x41')](_0x163695['query'],_0xd7adc6['filters']),_0x5ba715);if(_0x163695['query']['filter']){_0x53fc71[_0xafda('0x40')]=_['merge'](_0x53fc71['where'],{'$or':_[_0xafda('0x2e')](_0x5ba715,function(_0x30dd7d){if(_0x30dd7d['type']!==_0xafda('0x42')){var _0x21b695={};_0x21b695[_0x30dd7d['name']]={'$like':'%'+_0x163695[_0xafda('0x34')][_0xafda('0x43')]+'%'};return _0x21b695;}})});}_0x53fc71=_['merge']({},_0x53fc71,_0x163695[_0xafda('0x44')]);var _0x3d0ae9={'where':_0x53fc71[_0xafda('0x40')]};return db[_0xafda('0x2f')][_0xafda('0x23')](_0x3d0ae9)[_0xafda('0x17')](function(_0x1c016f){_0x1194cc['count']=_0x1c016f;if(_0x163695[_0xafda('0x34')]['includeAll']){_0x53fc71['include']=[{'all':!![]}];}return db[_0xafda('0x2f')][_0xafda('0x45')](_0x53fc71);})[_0xafda('0x17')](function(_0x45482b){_0x1194cc[_0xafda('0x46')]=_0x45482b;return _0x1194cc;})[_0xafda('0x17')](respondWithFilteredResult(_0x5758e2,_0x53fc71))[_0xafda('0x47')](handleError(_0x5758e2,null));};exports[_0xafda('0x48')]=function(_0x375f86,_0x111702){var _0xe14f21={'raw':!![],'where':{'id':_0x375f86[_0xafda('0x49')]['id']}},_0x2093a1={};_0x2093a1[_0xafda('0x38')]=_[_0xafda('0x35')](db[_0xafda('0x2f')][_0xafda('0x30')]);_0x2093a1[_0xafda('0x34')]=_[_0xafda('0x35')](_0x375f86[_0xafda('0x34')]);_0x2093a1[_0xafda('0x36')]=_[_0xafda('0x37')](_0x2093a1[_0xafda('0x38')],_0x2093a1['query']);_0xe14f21[_0xafda('0x39')]=_[_0xafda('0x37')](_0x2093a1[_0xafda('0x38')],qs['fields'](_0x375f86[_0xafda('0x34')][_0xafda('0x3a')]));_0xe14f21[_0xafda('0x39')]=_0xe14f21[_0xafda('0x39')][_0xafda('0x3b')]?_0xe14f21[_0xafda('0x39')]:_0x2093a1[_0xafda('0x38')];if(_0x375f86[_0xafda('0x34')][_0xafda('0x4a')]){_0xe14f21[_0xafda('0x4b')]=[{'all':!![]}];}_0xe14f21=_[_0xafda('0x4c')]({},_0xe14f21,_0x375f86[_0xafda('0x44')]);return db[_0xafda('0x2f')]['find'](_0xe14f21)[_0xafda('0x17')](handleEntityNotFound(_0x111702,null))[_0xafda('0x17')](respondWithResult(_0x111702,null))['catch'](handleError(_0x111702,null));};exports[_0xafda('0x26')]=function(_0x1bee4f,_0x1dde72){if(_0x1bee4f['body']['id']){delete _0x1bee4f[_0xafda('0x4d')]['id'];}return db[_0xafda('0x2f')][_0xafda('0x4e')]({'where':{'id':_0x1bee4f[_0xafda('0x49')]['id']}})[_0xafda('0x17')](handleEntityNotFound(_0x1dde72,null))[_0xafda('0x17')](saveUpdates(_0x1bee4f[_0xafda('0x4d')],null))[_0xafda('0x17')](respondWithResult(_0x1dde72,null))[_0xafda('0x47')](handleError(_0x1dde72,null));};exports[_0xafda('0x27')]=function(_0x17f6fb,_0x2ee8b1){return db['MailMessage'][_0xafda('0x4e')]({'where':{'id':_0x17f6fb['params']['id']}})[_0xafda('0x17')](handleEntityNotFound(_0x2ee8b1,null))[_0xafda('0x17')](removeEntity(_0x2ee8b1,null))['catch'](handleError(_0x2ee8b1,null));};exports['describe']=function(_0x44ec24,_0x38c192){return db[_0xafda('0x2f')][_0xafda('0x4f')]()['then'](respondWithResult(_0x38c192,null))[_0xafda('0x47')](handleError(_0x38c192,null));};exports[_0xafda('0x50')]=function(_0x70d858,_0x4c8155){return db[_0xafda('0x2f')]['create'](_0x70d858[_0xafda('0x4d')])[_0xafda('0x17')](function(_0x5dd4f2){if(_0x5dd4f2){if(_0x5dd4f2[_0xafda('0x51')]===_0xafda('0x52')&&!_0x5dd4f2[_0xafda('0x53')]){var _0x2af7f7,_0x45f012,_0x3dda85;if(_0x70d858[_0xafda('0x4d')]['to']){_0x45f012=_0x70d858['body']['to']['split'](',')[0x0];}return db[_0xafda('0x54')][_0xafda('0x55')]({'where':{'id':_0x5dd4f2[_0xafda('0x56')]},'include':[{'model':db['CmList'],'as':_0xafda('0x57'),'include':[{'model':db['CmContact'],'as':_0xafda('0x58'),'where':{'email':_0x45f012},'limit':0x1,'order':[['updatedAt',_0xafda('0x59')]]}]},{'model':db[_0xafda('0x5a')],'as':_0xafda('0x5b'),'raw':!![],'include':[{'model':db[_0xafda('0x5c')],'as':_0xafda('0x5c'),'raw':!![]}]}]})[_0xafda('0x17')](function(_0x339262){_0x2af7f7=_0x339262;if(!_0x2af7f7||!_0x2af7f7['Smtp'])return;var _0x3899f4=_0x2af7f7['getSmtpOptions']();if(_0x70d858[_0xafda('0x4d')][_0xafda('0x5d')]&&_0x70d858[_0xafda('0x4d')][_0xafda('0x5d')][_0xafda('0x3b')]){for(var _0x248d8a=0x0;_0x248d8a<_0x70d858[_0xafda('0x4d')][_0xafda('0x5d')]['length'];_0x248d8a+=0x1){_0x70d858[_0xafda('0x4d')][_0xafda('0x5d')][_0x248d8a]={'filename':_0x70d858['body'][_0xafda('0x5d')][_0x248d8a][_0xafda('0x2b')],'path':path[_0xafda('0x5e')](config['root'],_0xafda('0x5f'),_0x70d858['body'][_0xafda('0x5d')][_0x248d8a][_0xafda('0x60')])};}}_0x3dda85={'account':_0x3899f4,'message':_0x70d858[_0xafda('0x4d')]};return;})['then'](function(){if(_0x2af7f7['List']){if(_0x2af7f7[_0xafda('0x57')][_0xafda('0x58')][_0xafda('0x3b')]){return _0x2af7f7[_0xafda('0x57')][_0xafda('0x58')][0x0];}else{return db['CmContact'][_0xafda('0x50')](_['defaults'](_0x70d858[_0xafda('0x4d')],{'firstName':_0x70d858[_0xafda('0x4d')]['to'],'email':_0x70d858[_0xafda('0x4d')]['to'],'phone':_0x70d858[_0xafda('0x4d')]['to'],'ListId':_0x2af7f7[_0xafda('0x61')]}));}}else{throw new Error(_0xafda('0x62'));}})['then'](function(){if(_0x3dda85){return respondWithRpcPromise(_0xafda('0x63'),_0xafda('0x64'),_0x3dda85,client9003)[_0xafda('0x17')](function(_0x27e16a){return _0x5dd4f2['update']({'read':!![],'messageId':_0x27e16a['messageId'],'sentAt':moment()[_0xafda('0x65')](_0xafda('0x66'))});})[_0xafda('0x47')](function(_0x22eaca){logger[_0xafda('0x1b')]('%s',JSON[_0xafda('0x67')](_0x22eaca));return _0x5dd4f2;});}return _0x5dd4f2;});}return _0x5dd4f2;}})[_0xafda('0x17')](respondWithResult(_0x4c8155,0xc9))[_0xafda('0x47')](handleError(_0x4c8155,null));};exports[_0xafda('0x68')]=function(_0xfdf11,_0x41f8be){var _0x20b285={'agent':{},'channel':_0xafda('0x69')};if(_0xfdf11['body']['id']){delete _0xfdf11['body']['id'];}_0xfdf11[_0xafda('0x4d')][_0xafda('0x6a')]=!![];_0xfdf11['body'][_0xafda('0x6b')]=moment()[_0xafda('0x65')](_0xafda('0x66'));_0xfdf11[_0xafda('0x4d')][_0xafda('0x6c')]=_0xfdf11[_0xafda('0x4d')][_0xafda('0x6c')]||_0xfdf11[_0xafda('0x6d')]['id'];_0x20b285[_0xafda('0x6e')]['id']=_0xfdf11[_0xafda('0x4d')][_0xafda('0x6c')];return db[_0xafda('0x2f')]['find']({'where':{'id':_0xfdf11[_0xafda('0x49')]['id'],'UserId':null}})[_0xafda('0x17')](handleEntityNotFound(_0x41f8be,null))[_0xafda('0x17')](saveUpdates(_0xfdf11[_0xafda('0x4d')],null))[_0xafda('0x17')](function(_0x39ac5f){if(_0x39ac5f){_0x20b285[_0xafda('0x1c')]=_0x39ac5f['get']({'plain':!![]});return db['MailInteraction'][_0xafda('0x4e')]({'where':{'id':_0x39ac5f['MailInteractionId']}});}return null;})[_0xafda('0x17')](handleEntityNotFound(_0x41f8be,null))['then'](function(_0x4da346){if(_0x4da346){return _0x4da346[_0xafda('0x26')]({'UserId':_0xfdf11[_0xafda('0x4d')][_0xafda('0x6c')],'read1stAt':_[_0xafda('0x6f')](_0x4da346[_0xafda('0x70')])?moment()[_0xafda('0x65')](_0xafda('0x66')):undefined});}return null;})[_0xafda('0x17')](function(_0x3b50b4){if(_0x3b50b4){_0x20b285[_0xafda('0x71')]=_0x3b50b4[_0xafda('0x72')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xfdf11[_0xafda('0x6d')]['id'],_0xfdf11[_0xafda('0x6d')]['name'],_0xfdf11[_0xafda('0x6d')][_0xafda('0x73')],_0x20b285[_0xafda('0x71')]['id'],_0xfdf11[_0xafda('0x4d')]?JSON[_0xafda('0x67')](_0xfdf11[_0xafda('0x4d')]):'null');return respondWithRpcPromise(_0xafda('0x74'),'acceptMessage',_0x20b285);}return null;})[_0xafda('0x17')](function(_0x4273a8){var _0x253e94='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4273a8[_0xafda('0x1c')][_0xafda('0x75')];return db[_0xafda('0x76')][_0xafda('0x34')](_0x253e94,{'type':db[_0xafda('0x77')]['QueryTypes'][_0xafda('0x78')],'raw':!![]})[_0xafda('0x17')](function(_0x2f7eb7){return _0x2f7eb7;});})['then'](function(_0x160a19){if(_0x160a19){_0x20b285[_0xafda('0x1c')][_0xafda('0x79')]=_0x160a19[0x0];if(!_0xfdf11[_0xafda('0x4d')][_0xafda('0x6c')])return;return db[_0xafda('0x7a')][_0xafda('0x4e')]({'where':{'id':_0xfdf11['body'][_0xafda('0x6c')],'role':_0xafda('0x6e')},'attributes':['id','name',_0xafda('0x7b'),_0xafda('0x7c'),_0xafda('0x7d')],'raw':!![]});}return null;})['then'](function(_0xf04507){if(!_0xf04507)return null;_0x20b285['message'][_0xafda('0x6e')]=_0xf04507;return _0x20b285;})[_0xafda('0x17')](function(_0x4db7f7){if(_0x4db7f7){if(_0xfdf11[_0xafda('0x4d')][_0xafda('0x7e')]){_0x20b285[_0xafda('0x1c')][_0xafda('0x7f')]=util[_0xafda('0x65')]('SIP/%s',_0xfdf11[_0xafda('0x6d')]['name']);_0x20b285[_0xafda('0x1c')][_0xafda('0x80')]=_0x20b285['channel'];_0x20b285['message'][_0xafda('0x81')]=_0x20b285[_0xafda('0x80')];_0x20b285[_0xafda('0x1c')][_0xafda('0x82')]='accept';_0x20b285[_0xafda('0x1c')][_0xafda('0x4d')]=htmlToText[_0xafda('0x83')](_0x20b285[_0xafda('0x1c')][_0xafda('0x4d')]);return respondWithRpcPromise('EventManager',_0xafda('0x84'),{'event':_0xafda('0x85'),'message':_0x20b285['message']},client9002)[_0xafda('0x17')](function(){return _0x20b285;});}return _0x20b285;}return null;})['then'](respondWithResult(_0x41f8be,null))[_0xafda('0x47')](handleError(_0x41f8be,null));};exports[_0xafda('0x86')]=function(_0x5975e3,_0x491743){var _0xef8bb9={'agent':{},'channel':'mail'};if(_0x5975e3[_0xafda('0x4d')]['id']){delete _0x5975e3[_0xafda('0x4d')]['id'];}_0x5975e3[_0xafda('0x4d')]['UserId']=_0x5975e3[_0xafda('0x4d')]['UserId']||_0x5975e3['user']['id'];_0xef8bb9[_0xafda('0x6e')]['id']=_0x5975e3[_0xafda('0x4d')][_0xafda('0x6c')];return db['MailMessage']['find']({'where':{'id':_0x5975e3[_0xafda('0x49')]['id'],'UserId':null}})[_0xafda('0x17')](handleEntityNotFound(_0x491743,null))[_0xafda('0x17')](function(_0x78a63f){if(_0x78a63f){_0xef8bb9[_0xafda('0x1c')]=_0x78a63f[_0xafda('0x72')]({'plain':!![]});return db[_0xafda('0x87')]['find']({'where':{'id':_0x78a63f[_0xafda('0x88')]}});}return null;})[_0xafda('0x17')](handleEntityNotFound(_0x491743,null))[_0xafda('0x17')](function(_0x2f8c4b){if(_0x2f8c4b){_0xef8bb9[_0xafda('0x71')]=_0x2f8c4b['get']({'plain':!![]});interaction_log[_0xafda('0x18')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5975e3[_0xafda('0x6d')]['id'],_0x5975e3[_0xafda('0x6d')][_0xafda('0x2b')],_0x5975e3[_0xafda('0x6d')][_0xafda('0x73')],_0xef8bb9[_0xafda('0x71')]['id'],_0x5975e3[_0xafda('0x4d')]?JSON[_0xafda('0x67')](_0x5975e3[_0xafda('0x4d')]):_0xafda('0x89'));return respondWithRpcPromise('RejectMessage',_0xafda('0x8a'),_0xef8bb9);}return null;})[_0xafda('0x17')](function(_0x1c80b0){var _0x409a95=_0xafda('0x8b')+_0x1c80b0[_0xafda('0x1c')][_0xafda('0x75')];return db[_0xafda('0x76')][_0xafda('0x34')](_0x409a95,{'type':db[_0xafda('0x77')][_0xafda('0x8c')][_0xafda('0x78')],'raw':!![]})[_0xafda('0x17')](function(_0xa60d88){return _0xa60d88;});})[_0xafda('0x17')](function(_0x969c3d){if(_0x969c3d){_0xef8bb9[_0xafda('0x1c')][_0xafda('0x79')]=_0x969c3d[0x0];if(!_0x5975e3[_0xafda('0x4d')][_0xafda('0x6c')])return;return db[_0xafda('0x7a')][_0xafda('0x4e')]({'where':{'id':_0x5975e3[_0xafda('0x4d')][_0xafda('0x6c')],'role':_0xafda('0x6e')},'attributes':['id','name',_0xafda('0x7b'),'email',_0xafda('0x7d')],'raw':!![]});}return null;})[_0xafda('0x17')](function(_0x42d1ad){if(!_0x42d1ad)return null;_0xef8bb9[_0xafda('0x1c')]['agent']=_0x42d1ad;return _0xef8bb9;})[_0xafda('0x17')](function(_0x3988f0){if(_0x3988f0){_0x3988f0['message']['interface']=util[_0xafda('0x65')]('SIP/%s',_0x5975e3[_0xafda('0x6d')]['name']);_0x3988f0['message']['channel']=_0xef8bb9[_0xafda('0x80')];_0x3988f0[_0xafda('0x1c')]['motionChannel']=_0xef8bb9[_0xafda('0x80')];_0x3988f0[_0xafda('0x1c')][_0xafda('0x82')]=_0xafda('0x86');_0x3988f0[_0xafda('0x1c')][_0xafda('0x4d')]=htmlToText[_0xafda('0x83')](_0xef8bb9['message'][_0xafda('0x4d')]);respondWithRpcPromise('EventManager','EventManager',{'event':_0xafda('0x8d'),'message':_0x3988f0[_0xafda('0x1c')]},client9002);return _0xef8bb9;}return null;})[_0xafda('0x17')](respondWithResult(_0x491743,null))[_0xafda('0x47')](handleError(_0x491743,null));};exports[_0xafda('0x8e')]=function(_0x4cbe14,_0x2a3a97){var _0x2336bd=moment()[_0xafda('0x8f')]()[_0xafda('0x90')]();var _0x42e68e=path[_0xafda('0x5e')](config[_0xafda('0x91')],_0xafda('0x92'),_0xafda('0x93'),_0xafda('0x94'));var _0x5d7d0e=path[_0xafda('0x5e')](config[_0xafda('0x91')],'server',_0xafda('0x93'),_0xafda('0x5d'));var _0x4701d0=util[_0xafda('0x65')]('message-%s.eml',_0x2336bd);return db[_0xafda('0x2f')]['find']({'where':{'id':_0x4cbe14[_0xafda('0x49')]['id']},'attributes':['id',_0xafda('0x4d'),_0xafda('0x95'),'to','cc','bcc','subject',_0xafda('0x96')],'include':_0x4cbe14[_0xafda('0x34')]['attachments']?[{'model':db['Attachment'],'as':_0xafda('0x97')}]:undefined})['then'](handleEntityNotFound(_0x2a3a97,null))[_0xafda('0x17')](function(_0x3fd293){if(_0x3fd293){var _0x54a1b2=_0x3fd293;var _0x478e60={'from':_0x54a1b2[_0xafda('0x95')],'to':_0x54a1b2['to'],'subject':_0x54a1b2['subject'],'html':htmlEntities['decode'](_0x54a1b2[_0xafda('0x4d')]),'headers':{'Date':moment(_0x54a1b2[_0xafda('0x96')])['format'](_0xafda('0x98'))},'attachments':[]};if(_0x3fd293['cc']){_0x478e60[_0xafda('0x99')]['Cc']=_0x3fd293['cc'];}if(_0x3fd293[_0xafda('0x9a')]){_0x478e60[_0xafda('0x99')][_0xafda('0x9b')]=_0x3fd293[_0xafda('0x9a')];}return new BPromise(function(_0x4f016e,_0xec0694){if(_0x3fd293[_0xafda('0x97')]){for(var _0x205429=0x0;_0x205429<_0x3fd293[_0xafda('0x97')]['length'];_0x205429++){var _0x55f573=_0x3fd293[_0xafda('0x97')][_0x205429];var _0xd66a2f=path[_0xafda('0x5e')](_0x5d7d0e,_0x55f573[_0xafda('0x60')]);if(fs[_0xafda('0x9c')](_0xd66a2f)){_0x478e60[_0xafda('0x5d')][_0xafda('0x9d')]({'name':_0x55f573[_0xafda('0x2b')],'contentType':_0x55f573['type'],'data':fs[_0xafda('0x9e')](_0xd66a2f)});}}}emlformat[_0xafda('0x9f')](_0x478e60,function(_0x47f16e,_0x5c391a){if(_0x47f16e)return _0xec0694(_0x47f16e);fs[_0xafda('0xa0')](path[_0xafda('0x5e')](_0x42e68e,_0x4701d0),_0x5c391a);return _0x4f016e(_0x5c391a);});});}})[_0xafda('0x17')](function(_0x236a0d){if(_0x236a0d){return _0x2a3a97[_0xafda('0x8e')](path['join'](_0x42e68e,_0x4701d0),_0x4701d0,function(_0x5686a1){if(!_0x5686a1)fs[_0xafda('0xa1')](path[_0xafda('0x5e')](_0x42e68e,_0x4701d0));});}})[_0xafda('0x47')](handleError(_0x2a3a97,null));}; \ No newline at end of file +var _0x4aac=['length','include','find','body','describe','create','direction','out','split','MailAccount','findOne','CmList','List','CmContact','Contacts','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','ListId','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','UserId','user','agent','get','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','internal','interface','SIP/%s','channel','motionChannel','accept','fromString','EventManager','acceptmessage','reject','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','ContactId','QueryTypes','event','download','unix','toString','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachment','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','Attachments','existsSync','push','readFileSync','build','unlinkSync','eml-format','bluebird','util','path','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','keys','intersection'];(function(_0x22ae29,_0x181a8a){var _0x841040=function(_0xf13b7b){while(--_0xf13b7b){_0x22ae29['push'](_0x22ae29['shift']());}};_0x841040(++_0x181a8a);}(_0x4aac,0xf8));var _0xc4aa=function(_0x2ddabc,_0x50064a){_0x2ddabc=_0x2ddabc-0x0;var _0x2b2ecd=_0x4aac[_0x2ddabc];return _0x2b2ecd;};'use strict';var emlformat=require(_0xc4aa('0x0'));var moment=require('moment');var BPromise=require(_0xc4aa('0x1'));var util=require(_0xc4aa('0x2'));var path=require(_0xc4aa('0x3'));var fs=require('fs');var _=require(_0xc4aa('0x4'));var Redis=require('ioredis');var htmlToText=require(_0xc4aa('0x5'));var qs=require(_0xc4aa('0x6'));var logger=require(_0xc4aa('0x7'))(_0xc4aa('0x8'));var interaction_log=require(_0xc4aa('0x7'))(_0xc4aa('0x9'));var config=require(_0xc4aa('0xa'));var db=require('../../mysqldb')['db'];config[_0xc4aa('0xb')]=_[_0xc4aa('0xc')](config[_0xc4aa('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc4aa('0xd'))(new Redis(config[_0xc4aa('0xb')]));var htmlEntities=require(_0xc4aa('0xe'));require(_0xc4aa('0xf'))[_0xc4aa('0x10')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc4aa('0x11')][_0xc4aa('0x12')]({'port':0x232c});var client9003=jayson['client'][_0xc4aa('0x12')]({'port':0x232b});var client9002=jayson[_0xc4aa('0x11')][_0xc4aa('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x9640df,_0x1af8cf,_0x1357cf,_0x2ed0dc){return new BPromise(function(_0x1fd7b4,_0x3da970){var _0x499f57=_0x2ed0dc||client;return _0x499f57[_0xc4aa('0x13')](_0x9640df,_0x1357cf)[_0xc4aa('0x14')](function(_0x5795ce){logger['info'](_0xc4aa('0x15'),_0x1af8cf,_0xc4aa('0x16'));logger[_0xc4aa('0x17')](_0xc4aa('0x18'),_0x1af8cf,_0xc4aa('0x16'),JSON[_0xc4aa('0x19')](_0x5795ce));if(_0x5795ce[_0xc4aa('0x1a')]){if(_0x5795ce[_0xc4aa('0x1a')][_0xc4aa('0x1b')]===0x1f4){logger[_0xc4aa('0x1a')](_0xc4aa('0x15'),_0x1af8cf,_0x5795ce[_0xc4aa('0x1a')][_0xc4aa('0x1c')]);return _0x3da970(_0x5795ce[_0xc4aa('0x1a')][_0xc4aa('0x1c')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x1af8cf,_0x5795ce[_0xc4aa('0x1a')]['message']);return _0x1fd7b4(_0x5795ce['error'][_0xc4aa('0x1c')]);}else{logger[_0xc4aa('0x1d')](_0xc4aa('0x15'),_0x1af8cf,_0xc4aa('0x16'));_0x1fd7b4(_0x5795ce[_0xc4aa('0x1e')][_0xc4aa('0x1c')]);}})[_0xc4aa('0x1f')](function(_0x262e04){logger['error'](_0xc4aa('0x15'),_0x1af8cf,_0x262e04);_0x3da970(_0x262e04);});});}function respondWithResult(_0x2015c5,_0x59235e){_0x59235e=_0x59235e||0xc8;return function(_0xc8ae56){if(_0xc8ae56){return _0x2015c5[_0xc4aa('0x20')](_0x59235e)[_0xc4aa('0x21')](_0xc8ae56);}};}function respondWithFilteredResult(_0x14a09e,_0x237d3f){return function(_0x411a68){if(_0x411a68){var _0x17c9aa=typeof _0x237d3f[_0xc4aa('0x22')]===_0xc4aa('0x23')&&typeof _0x237d3f[_0xc4aa('0x24')]===_0xc4aa('0x23');var _0x31abeb=_0x411a68[_0xc4aa('0x25')];var _0x26714a=_0x17c9aa?0x0:_0x237d3f[_0xc4aa('0x22')];var _0x11063b=_0x17c9aa?_0x411a68[_0xc4aa('0x25')]:_0x237d3f[_0xc4aa('0x22')]+_0x237d3f['limit'];var _0x1be283;if(_0x11063b>=_0x31abeb){_0x11063b=_0x31abeb;_0x1be283=0xc8;}else{_0x1be283=0xce;}_0x14a09e['status'](_0x1be283);return _0x14a09e[_0xc4aa('0x26')](_0xc4aa('0x27'),_0x26714a+'-'+_0x11063b+'/'+_0x31abeb)[_0xc4aa('0x21')](_0x411a68);}return null;};}function saveUpdates(_0x2cdad1){return function(_0x3820cf){if(_0x3820cf){return _0x3820cf[_0xc4aa('0x28')](_0x2cdad1)['then'](function(_0x24e40b){return _0x24e40b;});}return null;};}function removeEntity(_0x2be133){return function(_0x1430ca){if(_0x1430ca){return _0x1430ca[_0xc4aa('0x29')]()[_0xc4aa('0x14')](function(){_0x2be133[_0xc4aa('0x20')](0xcc)[_0xc4aa('0x2a')]();});}};}function handleEntityNotFound(_0x3e93af){return function(_0x21060b){if(!_0x21060b){_0x3e93af[_0xc4aa('0x2b')](0x194);}return _0x21060b;};}function handleError(_0x3c360c,_0x5b2726){_0x5b2726=_0x5b2726||0x1f4;return function(_0x45a4b6){logger[_0xc4aa('0x1a')](_0x45a4b6[_0xc4aa('0x2c')]);if(_0x45a4b6[_0xc4aa('0x2d')]){delete _0x45a4b6['name'];}_0x3c360c['status'](_0x5b2726)['send'](_0x45a4b6);};}exports[_0xc4aa('0x2e')]=function(_0x184ffc,_0x136aca){var _0x3e7d34={},_0x4faf9b={},_0x3f320e={'count':0x0,'rows':[]};var _0x342082=_[_0xc4aa('0x2f')](db[_0xc4aa('0x30')][_0xc4aa('0x31')],function(_0x3cc931){return{'name':_0x3cc931[_0xc4aa('0x32')],'type':_0x3cc931[_0xc4aa('0x33')][_0xc4aa('0x34')]};});_0x4faf9b[_0xc4aa('0x35')]=_[_0xc4aa('0x2f')](_0x342082,'name');_0x4faf9b[_0xc4aa('0x36')]=_['keys'](_0x184ffc[_0xc4aa('0x36')]);_0x4faf9b[_0xc4aa('0x37')]=_['intersection'](_0x4faf9b[_0xc4aa('0x35')],_0x4faf9b[_0xc4aa('0x36')]);_0x3e7d34['attributes']=_['intersection'](_0x4faf9b['model'],qs['fields'](_0x184ffc['query'][_0xc4aa('0x38')]));_0x3e7d34[_0xc4aa('0x39')]=_0x3e7d34[_0xc4aa('0x39')]['length']?_0x3e7d34[_0xc4aa('0x39')]:_0x4faf9b[_0xc4aa('0x35')];if(!_0x184ffc[_0xc4aa('0x36')][_0xc4aa('0x3a')](_0xc4aa('0x3b'))){_0x3e7d34['limit']=qs['limit'](_0x184ffc[_0xc4aa('0x36')][_0xc4aa('0x24')]);_0x3e7d34['offset']=qs[_0xc4aa('0x22')](_0x184ffc[_0xc4aa('0x36')]['offset']);}_0x3e7d34[_0xc4aa('0x3c')]=qs['sort'](_0x184ffc[_0xc4aa('0x36')][_0xc4aa('0x3d')]);_0x3e7d34[_0xc4aa('0x3e')]=qs['filters'](_[_0xc4aa('0x3f')](_0x184ffc[_0xc4aa('0x36')],_0x4faf9b[_0xc4aa('0x37')]),_0x342082);if(_0x184ffc[_0xc4aa('0x36')][_0xc4aa('0x40')]){_0x3e7d34[_0xc4aa('0x3e')]=_[_0xc4aa('0x41')](_0x3e7d34[_0xc4aa('0x3e')],{'$or':_[_0xc4aa('0x2f')](_0x342082,function(_0x4bda17){if(_0x4bda17[_0xc4aa('0x33')]!=='VIRTUAL'){var _0x1c5b49={};_0x1c5b49[_0x4bda17[_0xc4aa('0x2d')]]={'$like':'%'+_0x184ffc[_0xc4aa('0x36')]['filter']+'%'};return _0x1c5b49;}})});}_0x3e7d34=_[_0xc4aa('0x41')]({},_0x3e7d34,_0x184ffc[_0xc4aa('0x42')]);var _0x48f830={'where':_0x3e7d34[_0xc4aa('0x3e')]};return db[_0xc4aa('0x30')][_0xc4aa('0x25')](_0x48f830)[_0xc4aa('0x14')](function(_0xa0a21a){_0x3f320e[_0xc4aa('0x25')]=_0xa0a21a;if(_0x184ffc[_0xc4aa('0x36')][_0xc4aa('0x43')]){_0x3e7d34['include']=[{'all':!![]}];}return db[_0xc4aa('0x30')][_0xc4aa('0x44')](_0x3e7d34);})[_0xc4aa('0x14')](function(_0x553e48){_0x3f320e[_0xc4aa('0x45')]=_0x553e48;return _0x3f320e;})[_0xc4aa('0x14')](respondWithFilteredResult(_0x136aca,_0x3e7d34))['catch'](handleError(_0x136aca,null));};exports[_0xc4aa('0x46')]=function(_0x4a25e8,_0x4f1d21){var _0x1be1e3={'raw':!![],'where':{'id':_0x4a25e8[_0xc4aa('0x47')]['id']}},_0x423a51={};_0x423a51[_0xc4aa('0x35')]=_[_0xc4aa('0x48')](db[_0xc4aa('0x30')][_0xc4aa('0x31')]);_0x423a51['query']=_[_0xc4aa('0x48')](_0x4a25e8[_0xc4aa('0x36')]);_0x423a51[_0xc4aa('0x37')]=_[_0xc4aa('0x49')](_0x423a51['model'],_0x423a51[_0xc4aa('0x36')]);_0x1be1e3[_0xc4aa('0x39')]=_[_0xc4aa('0x49')](_0x423a51['model'],qs[_0xc4aa('0x38')](_0x4a25e8['query']['fields']));_0x1be1e3[_0xc4aa('0x39')]=_0x1be1e3[_0xc4aa('0x39')][_0xc4aa('0x4a')]?_0x1be1e3[_0xc4aa('0x39')]:_0x423a51[_0xc4aa('0x35')];if(_0x4a25e8[_0xc4aa('0x36')]['includeAll']){_0x1be1e3[_0xc4aa('0x4b')]=[{'all':!![]}];}_0x1be1e3=_['merge']({},_0x1be1e3,_0x4a25e8[_0xc4aa('0x42')]);return db[_0xc4aa('0x30')][_0xc4aa('0x4c')](_0x1be1e3)[_0xc4aa('0x14')](handleEntityNotFound(_0x4f1d21,null))[_0xc4aa('0x14')](respondWithResult(_0x4f1d21,null))['catch'](handleError(_0x4f1d21,null));};exports[_0xc4aa('0x28')]=function(_0x4f1b38,_0x9fd8ac){if(_0x4f1b38[_0xc4aa('0x4d')]['id']){delete _0x4f1b38[_0xc4aa('0x4d')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x4f1b38[_0xc4aa('0x47')]['id']}})[_0xc4aa('0x14')](handleEntityNotFound(_0x9fd8ac,null))['then'](saveUpdates(_0x4f1b38[_0xc4aa('0x4d')],null))[_0xc4aa('0x14')](respondWithResult(_0x9fd8ac,null))['catch'](handleError(_0x9fd8ac,null));};exports[_0xc4aa('0x29')]=function(_0x2d0e41,_0x16f986){return db[_0xc4aa('0x30')][_0xc4aa('0x4c')]({'where':{'id':_0x2d0e41[_0xc4aa('0x47')]['id']}})[_0xc4aa('0x14')](handleEntityNotFound(_0x16f986,null))[_0xc4aa('0x14')](removeEntity(_0x16f986,null))[_0xc4aa('0x1f')](handleError(_0x16f986,null));};exports[_0xc4aa('0x4e')]=function(_0xc4d53,_0x4bad3a){return db[_0xc4aa('0x30')]['describe']()[_0xc4aa('0x14')](respondWithResult(_0x4bad3a,null))[_0xc4aa('0x1f')](handleError(_0x4bad3a,null));};exports[_0xc4aa('0x4f')]=function(_0x25ac8b,_0x26f482){return db[_0xc4aa('0x30')]['create'](_0x25ac8b[_0xc4aa('0x4d')])[_0xc4aa('0x14')](function(_0x58ffa6){if(_0x58ffa6){if(_0x58ffa6[_0xc4aa('0x50')]===_0xc4aa('0x51')&&!_0x58ffa6['secret']){var _0x1e7602,_0x27cbfe,_0x255591;if(_0x25ac8b[_0xc4aa('0x4d')]['to']){_0x27cbfe=_0x25ac8b[_0xc4aa('0x4d')]['to'][_0xc4aa('0x52')](',')[0x0];}return db[_0xc4aa('0x53')][_0xc4aa('0x54')]({'where':{'id':_0x58ffa6['MailAccountId']},'include':[{'model':db[_0xc4aa('0x55')],'as':_0xc4aa('0x56'),'include':[{'model':db[_0xc4aa('0x57')],'as':_0xc4aa('0x58'),'where':{'email':_0x27cbfe},'limit':0x1,'order':[['updatedAt',_0xc4aa('0x59')]]}]},{'model':db[_0xc4aa('0x5a')],'as':_0xc4aa('0x5b'),'raw':!![],'include':[{'model':db[_0xc4aa('0x5c')],'as':_0xc4aa('0x5c'),'raw':!![]}]}]})['then'](function(_0x41a99e){_0x1e7602=_0x41a99e;if(!_0x1e7602||!_0x1e7602[_0xc4aa('0x5b')])return;var _0x437153=_0x1e7602[_0xc4aa('0x5d')]();if(_0x25ac8b[_0xc4aa('0x4d')][_0xc4aa('0x5e')]&&_0x25ac8b[_0xc4aa('0x4d')][_0xc4aa('0x5e')][_0xc4aa('0x4a')]){for(var _0x5953cb=0x0;_0x5953cb<_0x25ac8b[_0xc4aa('0x4d')][_0xc4aa('0x5e')][_0xc4aa('0x4a')];_0x5953cb+=0x1){_0x25ac8b['body']['attachments'][_0x5953cb]={'filename':_0x25ac8b[_0xc4aa('0x4d')]['attachments'][_0x5953cb]['name'],'path':path[_0xc4aa('0x5f')](config[_0xc4aa('0x60')],'server/files/attachments',_0x25ac8b[_0xc4aa('0x4d')]['attachments'][_0x5953cb]['basename'])};}}_0x255591={'account':_0x437153,'message':_0x25ac8b[_0xc4aa('0x4d')]};return;})[_0xc4aa('0x14')](function(){if(_0x1e7602[_0xc4aa('0x56')]){if(_0x1e7602[_0xc4aa('0x56')]['Contacts'][_0xc4aa('0x4a')]){return _0x1e7602['List']['Contacts'][0x0];}else{return db['CmContact'][_0xc4aa('0x4f')](_[_0xc4aa('0xc')](_0x25ac8b[_0xc4aa('0x4d')],{'firstName':_0x25ac8b[_0xc4aa('0x4d')]['to'],'email':_0x25ac8b[_0xc4aa('0x4d')]['to'],'phone':_0x25ac8b[_0xc4aa('0x4d')]['to'],'ListId':_0x1e7602[_0xc4aa('0x61')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xc4aa('0x14')](function(){if(_0x255591){return respondWithRpcPromise(_0xc4aa('0x62'),_0xc4aa('0x63'),_0x255591,client9003)[_0xc4aa('0x14')](function(_0x2512cf){return _0x58ffa6['update']({'read':!![],'messageId':_0x2512cf[_0xc4aa('0x64')],'sentAt':moment()[_0xc4aa('0x65')](_0xc4aa('0x66'))});})[_0xc4aa('0x1f')](function(_0x51f23e){logger[_0xc4aa('0x1a')]('%s',JSON[_0xc4aa('0x19')](_0x51f23e));return _0x58ffa6;});}return _0x58ffa6;});}return _0x58ffa6;}})[_0xc4aa('0x14')](respondWithResult(_0x26f482,0xc9))['catch'](handleError(_0x26f482,null));};exports['accept']=function(_0x12ae03,_0x18ddb7){var _0x33fa72={'agent':{},'channel':_0xc4aa('0x67')};if(_0x12ae03[_0xc4aa('0x4d')]['id']){delete _0x12ae03[_0xc4aa('0x4d')]['id'];}_0x12ae03[_0xc4aa('0x4d')][_0xc4aa('0x68')]=!![];_0x12ae03[_0xc4aa('0x4d')]['readAt']=moment()[_0xc4aa('0x65')](_0xc4aa('0x66'));_0x12ae03['body']['UserId']=_0x12ae03[_0xc4aa('0x4d')][_0xc4aa('0x69')]||_0x12ae03[_0xc4aa('0x6a')]['id'];_0x33fa72[_0xc4aa('0x6b')]['id']=_0x12ae03[_0xc4aa('0x4d')]['UserId'];return db[_0xc4aa('0x30')][_0xc4aa('0x4c')]({'where':{'id':_0x12ae03[_0xc4aa('0x47')]['id'],'UserId':null}})[_0xc4aa('0x14')](handleEntityNotFound(_0x18ddb7,null))['then'](saveUpdates(_0x12ae03[_0xc4aa('0x4d')],null))['then'](function(_0x9c429c){if(_0x9c429c){_0x33fa72[_0xc4aa('0x1c')]=_0x9c429c[_0xc4aa('0x6c')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x9c429c[_0xc4aa('0x6d')]}});}return null;})[_0xc4aa('0x14')](handleEntityNotFound(_0x18ddb7,null))[_0xc4aa('0x14')](function(_0x1af743){if(_0x1af743){return _0x1af743[_0xc4aa('0x28')]({'UserId':_0x12ae03[_0xc4aa('0x4d')]['UserId'],'read1stAt':_['isNil'](_0x1af743[_0xc4aa('0x6e')])?moment()[_0xc4aa('0x65')](_0xc4aa('0x66')):undefined});}return null;})[_0xc4aa('0x14')](function(_0x31cdd7){if(_0x31cdd7){_0x33fa72[_0xc4aa('0x6f')]=_0x31cdd7[_0xc4aa('0x6c')]({'plain':!![]});interaction_log['info'](_0xc4aa('0x70'),_0x12ae03['user']['id'],_0x12ae03[_0xc4aa('0x6a')][_0xc4aa('0x2d')],_0x12ae03['user'][_0xc4aa('0x71')],_0x33fa72[_0xc4aa('0x6f')]['id'],_0x12ae03[_0xc4aa('0x4d')]?JSON[_0xc4aa('0x19')](_0x12ae03[_0xc4aa('0x4d')]):_0xc4aa('0x72'));return respondWithRpcPromise(_0xc4aa('0x73'),_0xc4aa('0x74'),_0x33fa72);}return null;})['then'](function(_0x32376b){var _0x44a357=_0xc4aa('0x75')+_0x32376b['message']['ContactId'];return db[_0xc4aa('0x76')]['query'](_0x44a357,{'type':db[_0xc4aa('0x77')]['QueryTypes'][_0xc4aa('0x78')],'raw':!![]})['then'](function(_0xe21e4e){return _0xe21e4e;});})['then'](function(_0x7ab56){if(_0x7ab56){_0x33fa72[_0xc4aa('0x1c')][_0xc4aa('0x79')]=_0x7ab56[0x0];if(!_0x12ae03[_0xc4aa('0x4d')][_0xc4aa('0x69')])return;return db[_0xc4aa('0x7a')]['find']({'where':{'id':_0x12ae03[_0xc4aa('0x4d')][_0xc4aa('0x69')],'role':_0xc4aa('0x6b')},'attributes':['id','name',_0xc4aa('0x7b'),'email',_0xc4aa('0x7c')],'raw':!![]});}return null;})[_0xc4aa('0x14')](function(_0x340933){if(!_0x340933)return null;_0x33fa72['message']['agent']=_0x340933;return _0x33fa72;})[_0xc4aa('0x14')](function(_0x39349c){if(_0x39349c){if(_0x12ae03['body']['manual']){_0x33fa72[_0xc4aa('0x1c')][_0xc4aa('0x7d')]=util[_0xc4aa('0x65')](_0xc4aa('0x7e'),_0x12ae03[_0xc4aa('0x6a')][_0xc4aa('0x2d')]);_0x33fa72[_0xc4aa('0x1c')][_0xc4aa('0x7f')]=_0x33fa72[_0xc4aa('0x7f')];_0x33fa72['message'][_0xc4aa('0x80')]=_0x33fa72[_0xc4aa('0x7f')];_0x33fa72['message']['event']=_0xc4aa('0x81');_0x33fa72['message'][_0xc4aa('0x4d')]=htmlToText[_0xc4aa('0x82')](_0x33fa72[_0xc4aa('0x1c')][_0xc4aa('0x4d')]);return respondWithRpcPromise(_0xc4aa('0x83'),_0xc4aa('0x83'),{'event':_0xc4aa('0x84'),'message':_0x33fa72[_0xc4aa('0x1c')]},client9002)['then'](function(){return _0x33fa72;});}return _0x33fa72;}return null;})[_0xc4aa('0x14')](respondWithResult(_0x18ddb7,null))['catch'](handleError(_0x18ddb7,null));};exports[_0xc4aa('0x85')]=function(_0x32677d,_0x2ce24f){var _0x4b5322={'agent':{},'channel':_0xc4aa('0x67')};if(_0x32677d[_0xc4aa('0x4d')]['id']){delete _0x32677d[_0xc4aa('0x4d')]['id'];}_0x32677d[_0xc4aa('0x4d')][_0xc4aa('0x69')]=_0x32677d['body'][_0xc4aa('0x69')]||_0x32677d[_0xc4aa('0x6a')]['id'];_0x4b5322['agent']['id']=_0x32677d[_0xc4aa('0x4d')][_0xc4aa('0x69')];return db[_0xc4aa('0x30')][_0xc4aa('0x4c')]({'where':{'id':_0x32677d[_0xc4aa('0x47')]['id'],'UserId':null}})[_0xc4aa('0x14')](handleEntityNotFound(_0x2ce24f,null))['then'](function(_0x5a8df0){if(_0x5a8df0){_0x4b5322[_0xc4aa('0x1c')]=_0x5a8df0[_0xc4aa('0x6c')]({'plain':!![]});return db[_0xc4aa('0x86')]['find']({'where':{'id':_0x5a8df0[_0xc4aa('0x6d')]}});}return null;})[_0xc4aa('0x14')](handleEntityNotFound(_0x2ce24f,null))[_0xc4aa('0x14')](function(_0x30306d){if(_0x30306d){_0x4b5322[_0xc4aa('0x6f')]=_0x30306d['get']({'plain':!![]});interaction_log[_0xc4aa('0x1d')](_0xc4aa('0x87'),_0x32677d['user']['id'],_0x32677d[_0xc4aa('0x6a')][_0xc4aa('0x2d')],_0x32677d[_0xc4aa('0x6a')][_0xc4aa('0x71')],_0x4b5322[_0xc4aa('0x6f')]['id'],_0x32677d[_0xc4aa('0x4d')]?JSON['stringify'](_0x32677d[_0xc4aa('0x4d')]):_0xc4aa('0x72'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x4b5322);}return null;})[_0xc4aa('0x14')](function(_0x6ba691){var _0x24925e=_0xc4aa('0x75')+_0x6ba691[_0xc4aa('0x1c')][_0xc4aa('0x88')];return db[_0xc4aa('0x76')][_0xc4aa('0x36')](_0x24925e,{'type':db['Sequelize'][_0xc4aa('0x89')][_0xc4aa('0x78')],'raw':!![]})[_0xc4aa('0x14')](function(_0x5aa2af){return _0x5aa2af;});})[_0xc4aa('0x14')](function(_0x1d543b){if(_0x1d543b){_0x4b5322[_0xc4aa('0x1c')][_0xc4aa('0x79')]=_0x1d543b[0x0];if(!_0x32677d[_0xc4aa('0x4d')][_0xc4aa('0x69')])return;return db['User']['find']({'where':{'id':_0x32677d['body']['UserId'],'role':_0xc4aa('0x6b')},'attributes':['id',_0xc4aa('0x2d'),_0xc4aa('0x7b'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x1a343d){if(!_0x1a343d)return null;_0x4b5322[_0xc4aa('0x1c')]['agent']=_0x1a343d;return _0x4b5322;})[_0xc4aa('0x14')](function(_0x183cf2){if(_0x183cf2){_0x183cf2[_0xc4aa('0x1c')]['interface']=util[_0xc4aa('0x65')](_0xc4aa('0x7e'),_0x32677d['user'][_0xc4aa('0x2d')]);_0x183cf2['message'][_0xc4aa('0x7f')]=_0x4b5322['channel'];_0x183cf2[_0xc4aa('0x1c')]['motionChannel']=_0x4b5322['channel'];_0x183cf2['message'][_0xc4aa('0x8a')]='reject';_0x183cf2[_0xc4aa('0x1c')][_0xc4aa('0x4d')]=htmlToText['fromString'](_0x4b5322['message'][_0xc4aa('0x4d')]);respondWithRpcPromise(_0xc4aa('0x83'),'EventManager',{'event':'rejectmessage','message':_0x183cf2[_0xc4aa('0x1c')]},client9002);return _0x4b5322;}return null;})[_0xc4aa('0x14')](respondWithResult(_0x2ce24f,null))[_0xc4aa('0x1f')](handleError(_0x2ce24f,null));};exports[_0xc4aa('0x8b')]=function(_0x71cd80,_0x5d6431){var _0x121aa4=moment()[_0xc4aa('0x8c')]()[_0xc4aa('0x8d')]();var _0x4dd16f=path[_0xc4aa('0x5f')](config[_0xc4aa('0x60')],_0xc4aa('0x8e'),_0xc4aa('0x8f'),_0xc4aa('0x90'));var _0x4f6e8b=path[_0xc4aa('0x5f')](config[_0xc4aa('0x60')],_0xc4aa('0x8e'),'files','attachments');var _0x28d493=util[_0xc4aa('0x65')](_0xc4aa('0x91'),_0x121aa4);return db[_0xc4aa('0x30')][_0xc4aa('0x4c')]({'where':{'id':_0x71cd80[_0xc4aa('0x47')]['id']},'attributes':['id',_0xc4aa('0x4d'),_0xc4aa('0x92'),'to','cc','bcc',_0xc4aa('0x93'),_0xc4aa('0x94')],'include':_0x71cd80[_0xc4aa('0x36')]['attachments']?[{'model':db[_0xc4aa('0x95')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x5d6431,null))[_0xc4aa('0x14')](function(_0x393b4b){if(_0x393b4b){var _0x3eaf97=_0x393b4b;var _0x189fa5={'from':_0x3eaf97[_0xc4aa('0x92')],'to':_0x3eaf97['to'],'subject':_0x3eaf97[_0xc4aa('0x93')],'html':htmlEntities[_0xc4aa('0x96')](_0x3eaf97['body']),'headers':{'Date':moment(_0x3eaf97[_0xc4aa('0x94')])[_0xc4aa('0x65')](_0xc4aa('0x97'))},'attachments':[]};if(_0x393b4b['cc']){_0x189fa5[_0xc4aa('0x98')]['Cc']=_0x393b4b['cc'];}if(_0x393b4b[_0xc4aa('0x99')]){_0x189fa5[_0xc4aa('0x98')][_0xc4aa('0x9a')]=_0x393b4b['bcc'];}return new BPromise(function(_0x1a31e6,_0x5d176c){if(_0x393b4b['Attachments']){for(var _0x3d829f=0x0;_0x3d829f<_0x393b4b['Attachments'][_0xc4aa('0x4a')];_0x3d829f++){var _0x45e8a8=_0x393b4b[_0xc4aa('0x9b')][_0x3d829f];var _0x331140=path[_0xc4aa('0x5f')](_0x4f6e8b,_0x45e8a8['basename']);if(fs[_0xc4aa('0x9c')](_0x331140)){_0x189fa5[_0xc4aa('0x5e')][_0xc4aa('0x9d')]({'name':_0x45e8a8['name'],'contentType':_0x45e8a8['type'],'data':fs[_0xc4aa('0x9e')](_0x331140)});}}}emlformat[_0xc4aa('0x9f')](_0x189fa5,function(_0x5002ff,_0x3fc8fc){if(_0x5002ff)return _0x5d176c(_0x5002ff);fs['writeFileSync'](path[_0xc4aa('0x5f')](_0x4dd16f,_0x28d493),_0x3fc8fc);return _0x1a31e6(_0x3fc8fc);});});}})[_0xc4aa('0x14')](function(_0xf343c0){if(_0xf343c0){return _0x5d6431[_0xc4aa('0x8b')](path[_0xc4aa('0x5f')](_0x4dd16f,_0x28d493),_0x28d493,function(_0x3addca){if(!_0x3addca)fs[_0xc4aa('0xa0')](path[_0xc4aa('0x5f')](_0x4dd16f,_0x28d493));});}})['catch'](handleError(_0x5d6431,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index f9eae2b..4d10701 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 _0xaef0=['update','remove','hasOwnProperty','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0x46c677,_0x350c0a){var _0x20bd84=function(_0x4cb52e){while(--_0x4cb52e){_0x46c677['push'](_0x46c677['shift']());}};_0x20bd84(++_0x350c0a);}(_0xaef0,0x15a));var _0x0aef=function(_0x592d48,_0x23f1ba){_0x592d48=_0x592d48-0x0;var _0x5d789e=_0xaef0[_0x592d48];return _0x5d789e;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x0aef('0x0'))['db'][_0x0aef('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0aef('0x2')](0x0);var events={'afterCreate':_0x0aef('0x3'),'afterUpdate':_0x0aef('0x4'),'afterDestroy':_0x0aef('0x5')};function emitEvent(_0x1b169c){return function(_0x39e00f,_0x246535,_0x52fd54){MailMessageEvents['emit'](_0x1b169c+':'+_0x39e00f['id'],_0x39e00f);MailMessageEvents['emit'](_0x1b169c,_0x39e00f);_0x52fd54(null);};}for(var e in events){if(events[_0x0aef('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x01e0=['../../mysqldb','MailMessage','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x21a2b3,_0x5d6564){var _0x4651a7=function(_0x285f59){while(--_0x285f59){_0x21a2b3['push'](_0x21a2b3['shift']());}};_0x4651a7(++_0x5d6564);}(_0x01e0,0x8f));var _0x001e=function(_0x3a887d,_0x439f75){_0x3a887d=_0x3a887d-0x0;var _0x280152=_0x01e0[_0x3a887d];return _0x280152;};'use strict';var EventEmitter=require(_0x001e('0x0'));var MailMessage=require(_0x001e('0x1'))['db'][_0x001e('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x001e('0x3'),'afterUpdate':_0x001e('0x4'),'afterDestroy':_0x001e('0x5')};function emitEvent(_0x5ddb7e){return function(_0x3a8014,_0x509397,_0x3ffc55){MailMessageEvents[_0x001e('0x6')](_0x5ddb7e+':'+_0x3a8014['id'],_0x3a8014);MailMessageEvents[_0x001e('0x6')](_0x5ddb7e,_0x3a8014);_0x3ffc55(null);};}for(var e in events){if(events[_0x001e('0x7')](e)){var event=events[e];MailMessage[_0x001e('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 e33c3df..fea787f 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 _0xefe5=['out','secret','UserId','MailInteraction','findOne','MailInteractionId','createdAt','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','models','get','direction'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xefe5,0x156));var _0x5efe=function(_0x6306d2,_0x4ae91b){_0x6306d2=_0x6306d2-0x0;var _0x4d13aa=_0xefe5[_0x6306d2];return _0x4d13aa;};'use strict';var _=require(_0x5efe('0x0'));var util=require(_0x5efe('0x1'));var logger=require(_0x5efe('0x2'))(_0x5efe('0x3'));var moment=require('moment');var BPromise=require(_0x5efe('0x4'));var rp=require(_0x5efe('0x5'));var htmlToText=require(_0x5efe('0x6'));var fs=require('fs');var path=require(_0x5efe('0x7'));var rimraf=require('rimraf');var config=require(_0x5efe('0x8'));var attributes=require(_0x5efe('0x9'));module[_0x5efe('0xa')]=function(_0x52ca2c,_0x310e69){return _0x52ca2c['define'](_0x5efe('0xb'),attributes,{'tableName':_0x5efe('0xc'),'paranoid':![],'indexes':[{'name':_0x5efe('0xd'),'fields':['messageId']},{'name':_0x5efe('0xe'),'fields':[_0x5efe('0xf'),_0x5efe('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x241ff6,_0x35ce70,_0x518246){if(_0x241ff6['body']){_0x241ff6[_0x5efe('0xf')]=htmlToText['fromString'](_0x241ff6[_0x5efe('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x518246(null,_0x35ce70);},'afterCreate':function(_0x5f3f6b,_0xcd64c8,_0x4b8124){var _0x48fea3=_0x52ca2c[_0x5efe('0x12')];var _0x42490d=_0x5f3f6b[_0x5efe('0x13')]({'plain':!![]});if(_0x42490d[_0x5efe('0x14')]['toLowerCase']()==='in'||_0x42490d['direction']['toLowerCase']()===_0x5efe('0x15')&&!_0x42490d[_0x5efe('0x16')]&&!_['isNil'](_0x42490d[_0x5efe('0x17')])){_0x48fea3[_0x5efe('0x18')][_0x5efe('0x19')]({'where':{'id':_0x42490d[_0x5efe('0x1a')]}})['then'](function(_0x1fd44d){if(_0x1fd44d){_0x1fd44d['update']({'lastMsgAt':_0x42490d[_0x5efe('0x1b')],'lastMsgDirection':_0x42490d['direction'][_0x5efe('0x1c')]()});}})[_0x5efe('0x1d')](function(_0x43826d){console[_0x5efe('0x1e')](_0x43826d);});}_0x4b8124();}},'charset':_0x5efe('0x1f'),'collate':_0x5efe('0x20')});}; \ No newline at end of file +var _0x449a=['body','fromString','models','get','toLowerCase','direction','out','UserId','MailInteraction','findOne','MailInteractionId','createdAt','catch','error','utf8mb4_unicode_ci','util','api','moment','bluebird','html-to-text','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','plainBody','subject','FULLTEXT'];(function(_0x2907b6,_0x35432d){var _0x33a0cb=function(_0x1fd1f6){while(--_0x1fd1f6){_0x2907b6['push'](_0x2907b6['shift']());}};_0x33a0cb(++_0x35432d);}(_0x449a,0x114));var _0xa449=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x449a[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0xa449('0x0'));var logger=require('../../config/logger')(_0xa449('0x1'));var moment=require(_0xa449('0x2'));var BPromise=require(_0xa449('0x3'));var rp=require('request-promise');var htmlToText=require(_0xa449('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa449('0x5'));var attributes=require(_0xa449('0x6'));module[_0xa449('0x7')]=function(_0x4b37ab,_0x52b12a){return _0x4b37ab[_0xa449('0x8')](_0xa449('0x9'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xa449('0xa')]},{'name':'fti_mail_messages','fields':[_0xa449('0xb'),_0xa449('0xc')],'type':_0xa449('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3e8437,_0xf8c7de,_0x1e7927){if(_0x3e8437[_0xa449('0xe')]){_0x3e8437[_0xa449('0xb')]=htmlToText[_0xa449('0xf')](_0x3e8437[_0xa449('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1e7927(null,_0xf8c7de);},'afterCreate':function(_0xfd400c,_0x3dc849,_0x532943){var _0x2b5a85=_0x4b37ab[_0xa449('0x10')];var _0x2b0c06=_0xfd400c[_0xa449('0x11')]({'plain':!![]});if(_0x2b0c06['direction'][_0xa449('0x12')]()==='in'||_0x2b0c06[_0xa449('0x13')][_0xa449('0x12')]()===_0xa449('0x14')&&!_0x2b0c06['secret']&&!_['isNil'](_0x2b0c06[_0xa449('0x15')])){_0x2b5a85[_0xa449('0x16')][_0xa449('0x17')]({'where':{'id':_0x2b0c06[_0xa449('0x18')]}})['then'](function(_0x221e09){if(_0x221e09){_0x221e09['update']({'lastMsgAt':_0x2b0c06[_0xa449('0x19')],'lastMsgDirection':_0x2b0c06['direction'][_0xa449('0x12')]()});}})[_0xa449('0x1a')](function(_0x1a184c){console[_0xa449('0x1b')](_0x1a184c);});}_0x532943();}},'charset':'utf8mb4','collate':_0xa449('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 64189f0..1a738ad 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 _0x6cb4=['result','catch','CreateMailMessage','MailMessage','create','body','options','raw','info','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6cb4,0xff));var _0x46cb=function(_0x56f147,_0x1fd168){_0x56f147=_0x56f147-0x0;var _0x22beb5=_0x6cb4[_0x56f147];return _0x22beb5;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var moment=require(_0x46cb('0x2'));var BPromise=require(_0x46cb('0x3'));var rs=require(_0x46cb('0x4'));var fs=require('fs');var Redis=require(_0x46cb('0x5'));var db=require(_0x46cb('0x6'))['db'];var utils=require(_0x46cb('0x7'));var logger=require(_0x46cb('0x8'))('rpc');var config=require(_0x46cb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x46cb('0xa')]['http']({'port':0x232a});config[_0x46cb('0xb')]=_[_0x46cb('0xc')](config[_0x46cb('0xb')],{'host':_0x46cb('0xd'),'port':0x18eb});var socket=require(_0x46cb('0xe'))(new Redis(config[_0x46cb('0xb')]));require('./mailMessage.socket')[_0x46cb('0xf')](socket);function respondWithRpcPromise(_0x34f9e9,_0x48101c,_0x206f10){return new BPromise(function(_0x106a87,_0x4a60b2){return client[_0x46cb('0x10')](_0x34f9e9,_0x206f10)[_0x46cb('0x11')](function(_0x570cfd){logger['info']('MailMessage,\x20%s,\x20%s',_0x48101c,_0x46cb('0x12'));logger[_0x46cb('0x13')](_0x46cb('0x14'),_0x48101c,_0x46cb('0x12'),JSON['stringify'](_0x570cfd));if(_0x570cfd[_0x46cb('0x15')]){if(_0x570cfd[_0x46cb('0x15')][_0x46cb('0x16')]===0x1f4){logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0x570cfd[_0x46cb('0x15')][_0x46cb('0x18')]);return _0x4a60b2(_0x570cfd[_0x46cb('0x15')][_0x46cb('0x18')]);}logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0x570cfd['error'][_0x46cb('0x18')]);return _0x106a87(_0x570cfd['error'][_0x46cb('0x18')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x48101c,'request\x20sent');_0x106a87(_0x570cfd[_0x46cb('0x19')][_0x46cb('0x18')]);}})[_0x46cb('0x1a')](function(_0xcc8e2){logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0xcc8e2);_0x4a60b2(_0xcc8e2);});});}exports[_0x46cb('0x1b')]=function(_0x32e9fe){var _0x90cd50=this;return new Promise(function(_0xfc9064,_0x149483){return db[_0x46cb('0x1c')][_0x46cb('0x1d')](_0x32e9fe[_0x46cb('0x1e')],{'raw':_0x32e9fe[_0x46cb('0x1f')]?_0x32e9fe[_0x46cb('0x1f')][_0x46cb('0x20')]===undefined?!![]:![]:!![]})[_0x46cb('0x11')](function(_0x41ecd2){logger[_0x46cb('0x21')](_0x46cb('0x1b'),_0x32e9fe);logger[_0x46cb('0x13')](_0x46cb('0x1b'),_0x32e9fe,JSON[_0x46cb('0x22')](_0x41ecd2));_0xfc9064(_0x41ecd2);})[_0x46cb('0x1a')](function(_0x5a1338){logger['error'](_0x46cb('0x1b'),_0x5a1338[_0x46cb('0x18')],_0x32e9fe);_0x149483(_0x90cd50[_0x46cb('0x15')](0x1f4,_0x5a1338[_0x46cb('0x18')]));});});}; \ No newline at end of file +var _0x8f4c=['body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','localhost','socket.io-emitter','redis','./mailMessage.socket','register','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8f4c,0x113));var _0xc8f4=function(_0x58a24f,_0x5314a2){_0x58a24f=_0x58a24f-0x0;var _0x571dcd=_0x8f4c[_0x58a24f];return _0x571dcd;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));var BPromise=require(_0xc8f4('0x3'));var rs=require(_0xc8f4('0x4'));var fs=require('fs');var Redis=require(_0xc8f4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8f4('0x6'));var logger=require(_0xc8f4('0x7'))(_0xc8f4('0x8'));var config=require('../../config/environment');var jayson=require(_0xc8f4('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xc8f4('0xa')](config['redis'],{'host':_0xc8f4('0xb'),'port':0x18eb});var socket=require(_0xc8f4('0xc'))(new Redis(config[_0xc8f4('0xd')]));require(_0xc8f4('0xe'))[_0xc8f4('0xf')](socket);function respondWithRpcPromise(_0x599de3,_0x38c41b,_0x191b92){return new BPromise(function(_0x2fba62,_0x3a2f8a){return client['request'](_0x599de3,_0x191b92)[_0xc8f4('0x10')](function(_0x52c699){logger[_0xc8f4('0x11')](_0xc8f4('0x12'),_0x38c41b,_0xc8f4('0x13'));logger[_0xc8f4('0x14')](_0xc8f4('0x15'),_0x38c41b,'request\x20sent',JSON[_0xc8f4('0x16')](_0x52c699));if(_0x52c699[_0xc8f4('0x17')]){if(_0x52c699[_0xc8f4('0x17')][_0xc8f4('0x18')]===0x1f4){logger[_0xc8f4('0x17')](_0xc8f4('0x12'),_0x38c41b,_0x52c699['error'][_0xc8f4('0x19')]);return _0x3a2f8a(_0x52c699[_0xc8f4('0x17')][_0xc8f4('0x19')]);}logger[_0xc8f4('0x17')](_0xc8f4('0x12'),_0x38c41b,_0x52c699['error'][_0xc8f4('0x19')]);return _0x2fba62(_0x52c699['error']['message']);}else{logger[_0xc8f4('0x11')](_0xc8f4('0x12'),_0x38c41b,_0xc8f4('0x13'));_0x2fba62(_0x52c699[_0xc8f4('0x1a')][_0xc8f4('0x19')]);}})[_0xc8f4('0x1b')](function(_0x2459ac){logger[_0xc8f4('0x17')](_0xc8f4('0x12'),_0x38c41b,_0x2459ac);_0x3a2f8a(_0x2459ac);});});}exports[_0xc8f4('0x1c')]=function(_0x3cd90c){var _0x3126e5=this;return new Promise(function(_0x22236c,_0x5f3264){return db[_0xc8f4('0x1d')][_0xc8f4('0x1e')](_0x3cd90c[_0xc8f4('0x1f')],{'raw':_0x3cd90c[_0xc8f4('0x20')]?_0x3cd90c[_0xc8f4('0x20')][_0xc8f4('0x21')]===undefined?!![]:![]:!![]})[_0xc8f4('0x10')](function(_0x43eb57){logger['info'](_0xc8f4('0x1c'),_0x3cd90c);logger[_0xc8f4('0x14')](_0xc8f4('0x1c'),_0x3cd90c,JSON[_0xc8f4('0x16')](_0x43eb57));_0x22236c(_0x43eb57);})['catch'](function(_0x39174f){logger['error'](_0xc8f4('0x1c'),_0x39174f['message'],_0x3cd90c);_0x5f3264(_0x3126e5[_0xc8f4('0x17')](0x1f4,_0x39174f[_0xc8f4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index d76d2aa..3d2137a 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 _0xd3d2=['length','./mailMessage.events','save','update','emit','removeListener','register'];(function(_0x156838,_0x39a171){var _0x5651b2=function(_0x30d8db){while(--_0x30d8db){_0x156838['push'](_0x156838['shift']());}};_0x5651b2(++_0x39a171);}(_0xd3d2,0x120));var _0x2d3d=function(_0x17f0c1,_0x593217){_0x17f0c1=_0x17f0c1-0x0;var _0x3615d5=_0xd3d2[_0x17f0c1];return _0x3615d5;};'use strict';var MailMessageEvents=require(_0x2d3d('0x0'));var events=[_0x2d3d('0x1'),'remove',_0x2d3d('0x2')];function createListener(_0x52d85e,_0x213430){return function(_0x4329a6){_0x213430[_0x2d3d('0x3')](_0x52d85e,_0x4329a6);};}function removeListener(_0x58cf52,_0x20a7a7){return function(){MailMessageEvents[_0x2d3d('0x4')](_0x58cf52,_0x20a7a7);};}exports[_0x2d3d('0x5')]=function(_0xe4a43){for(var _0x4081af=0x0,_0x49410b=events[_0x2d3d('0x6')];_0x4081af<_0x49410b;_0x4081af++){var _0x5c1115=events[_0x4081af];var _0x19be37=createListener('mailMessage:'+_0x5c1115,_0xe4a43);MailMessageEvents['on'](_0x5c1115,_0x19be37);}}; \ No newline at end of file +var _0x3514=['emit','removeListener','register','length','./mailMessage.events','save'];(function(_0x36fa31,_0x27f7f7){var _0x4eae42=function(_0x109d5a){while(--_0x109d5a){_0x36fa31['push'](_0x36fa31['shift']());}};_0x4eae42(++_0x27f7f7);}(_0x3514,0x118));var _0x4351=function(_0x528093,_0x2fbecd){_0x528093=_0x528093-0x0;var _0x40027d=_0x3514[_0x528093];return _0x40027d;};'use strict';var MailMessageEvents=require(_0x4351('0x0'));var events=[_0x4351('0x1'),'remove','update'];function createListener(_0x35c133,_0x343126){return function(_0x594939){_0x343126[_0x4351('0x2')](_0x35c133,_0x594939);};}function removeListener(_0x2d3f49,_0x2a0bf6){return function(){MailMessageEvents[_0x4351('0x3')](_0x2d3f49,_0x2a0bf6);};}exports[_0x4351('0x4')]=function(_0x8cabb){for(var _0x32db6a=0x0,_0x68fa63=events[_0x4351('0x5')];_0x32db6a<_0x68fa63;_0x32db6a++){var _0x3a7b7e=events[_0x32db6a];var _0x3d22a0=createListener('mailMessage:'+_0x3a7b7e,_0x8cabb);MailMessageEvents['on'](_0x3a7b7e,_0x3d22a0);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index c8e13da..1e27c3e 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 _0x856e=['getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x856e,0x142));var _0xe856=function(_0x5d6e35,_0x4d1ac0){_0x5d6e35=_0x5d6e35-0x0;var _0x5d7ada=_0x856e[_0x5d6e35];return _0x5d7ada;};'use strict';var multer=require(_0xe856('0x0'));var util=require(_0xe856('0x1'));var path=require(_0xe856('0x2'));var timeout=require(_0xe856('0x3'));var express=require(_0xe856('0x4'));var router=express['Router']();var fs_extra=require(_0xe856('0x5'));var auth=require(_0xe856('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe856('0x7'));var controller=require(_0xe856('0x8'));router['get']('/',auth[_0xe856('0x9')](),controller[_0xe856('0xa')]);router[_0xe856('0xb')](_0xe856('0xc'),auth[_0xe856('0x9')](),controller[_0xe856('0xd')]);router[_0xe856('0xb')](_0xe856('0xe'),auth['isAuthenticated'](),controller[_0xe856('0xf')]);router['get'](_0xe856('0x10'),auth['isAuthenticated'](),controller[_0xe856('0x11')]);router[_0xe856('0xb')](_0xe856('0x12'),auth[_0xe856('0x9')](),controller[_0xe856('0x13')]);router[_0xe856('0xb')](_0xe856('0x14'),auth[_0xe856('0x9')](),controller[_0xe856('0x15')]);router[_0xe856('0x16')]('/',auth[_0xe856('0x9')](),controller['create']);router[_0xe856('0x16')](_0xe856('0x12'),auth[_0xe856('0x9')](),controller[_0xe856('0x17')]);router[_0xe856('0x16')](_0xe856('0x14'),auth[_0xe856('0x9')](),controller[_0xe856('0x18')]);router[_0xe856('0x19')](_0xe856('0xe'),auth[_0xe856('0x9')](),controller['update']);router[_0xe856('0x1a')](_0xe856('0xe'),auth['isAuthenticated'](),controller[_0xe856('0x1b')]);router[_0xe856('0x1a')](_0xe856('0x12'),auth[_0xe856('0x9')](),controller[_0xe856('0x1c')]);router[_0xe856('0x1a')](_0xe856('0x14'),auth[_0xe856('0x9')](),controller[_0xe856('0x1d')]);module[_0xe856('0x1e')]=router; \ No newline at end of file +var _0x11c4=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/teams','/:id/users','getAgents','create'];(function(_0x2cff64,_0x5f40d5){var _0x3820a8=function(_0x5ace6b){while(--_0x5ace6b){_0x2cff64['push'](_0x2cff64['shift']());}};_0x3820a8(++_0x5f40d5);}(_0x11c4,0x18d));var _0x411c=function(_0x184b0a,_0x38d31a){_0x184b0a=_0x184b0a-0x0;var _0x340994=_0x11c4[_0x184b0a];return _0x340994;};'use strict';var multer=require(_0x411c('0x0'));var util=require(_0x411c('0x1'));var path=require(_0x411c('0x2'));var timeout=require(_0x411c('0x3'));var express=require('express');var router=express[_0x411c('0x4')]();var fs_extra=require(_0x411c('0x5'));var auth=require(_0x411c('0x6'));var interaction=require(_0x411c('0x7'));var config=require(_0x411c('0x8'));var controller=require(_0x411c('0x9'));router[_0x411c('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x411c('0xb')](),controller[_0x411c('0xc')]);router[_0x411c('0xa')](_0x411c('0xd'),auth[_0x411c('0xb')](),controller[_0x411c('0xe')]);router[_0x411c('0xa')]('/:id/members',auth[_0x411c('0xb')](),controller['getMembers']);router[_0x411c('0xa')](_0x411c('0xf'),auth[_0x411c('0xb')](),controller['getTeams']);router[_0x411c('0xa')](_0x411c('0x10'),auth[_0x411c('0xb')](),controller[_0x411c('0x11')]);router['post']('/',auth[_0x411c('0xb')](),controller[_0x411c('0x12')]);router[_0x411c('0x13')]('/:id/teams',auth[_0x411c('0xb')](),controller['addTeams']);router['post'](_0x411c('0x10'),auth[_0x411c('0xb')](),controller[_0x411c('0x14')]);router['put'](_0x411c('0xd'),auth['isAuthenticated'](),controller[_0x411c('0x15')]);router[_0x411c('0x16')](_0x411c('0xd'),auth[_0x411c('0xb')](),controller[_0x411c('0x17')]);router[_0x411c('0x16')]('/:id/teams',auth[_0x411c('0xb')](),controller[_0x411c('0x18')]);router[_0x411c('0x16')](_0x411c('0x10'),auth[_0x411c('0xb')](),controller[_0x411c('0x19')]);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 30b89de..77c985b 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 _0x0199=['sequelize','exports','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x32c9b9,_0x21a0cf){var _0x239eab=function(_0x25fceb){while(--_0x25fceb){_0x32c9b9['push'](_0x32c9b9['shift']());}};_0x239eab(++_0x21a0cf);}(_0x0199,0xa8));var _0x9019=function(_0xe1f130,_0x83fcef){_0xe1f130=_0xe1f130-0x0;var _0xbb1d66=_0x0199[_0xe1f130];return _0xbb1d66;};'use strict';var Sequelize=require(_0x9019('0x0'));module[_0x9019('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9019('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9019('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9019('0x4')](_0x9019('0x5'),_0x9019('0x6'),_0x9019('0x7'))}}; \ No newline at end of file +var _0xda4d=['exports','STRING','name','INTEGER','ENUM','rrmemory','sequelize'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xda4d,0xca));var _0xdda4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xda4d[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xdda4('0x0'));module[_0xdda4('0x1')]={'name':{'type':Sequelize[_0xdda4('0x2')],'unique':_0xdda4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdda4('0x2')]},'timeout':{'type':Sequelize[_0xdda4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdda4('0x5')](_0xdda4('0x6'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 102bef7..0581e8f 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 _0x9e6f=['socket.io-emitter','register','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','get','MailQueues','end','sendStatus','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','UserMailQueue','hasOwnProperty','nolimit','order','MailQueueId','options','findAndCountAll','UserId','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','addTeams','ids','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','Team','User','select','field','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeTeams','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','userMailQueue:save','getAgents','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x827637,_0x24805f){var _0xa773b8=function(_0x5d0575){while(--_0x5d0575){_0x827637['push'](_0x827637['shift']());}};_0xa773b8(++_0x24805f);}(_0x9e6f,0x76));var _0xf9e6=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9e6f[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0xf9e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf9e6('0x1'));var jsonpatch=require(_0xf9e6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf9e6('0x3'));var Mustache=require(_0xf9e6('0x4'));var util=require(_0xf9e6('0x5'));var path=require(_0xf9e6('0x6'));var sox=require(_0xf9e6('0x7'));var csv=require(_0xf9e6('0x8'));var ejs=require(_0xf9e6('0x9'));var fs=require('fs');var fs_extra=require(_0xf9e6('0xa'));var _=require('lodash');var squel=require(_0xf9e6('0xb'));var crypto=require(_0xf9e6('0xc'));var jsforce=require(_0xf9e6('0xd'));var deskjs=require(_0xf9e6('0xe'));var toCsv=require(_0xf9e6('0x8'));var querystring=require(_0xf9e6('0xf'));var Papa=require(_0xf9e6('0x10'));var Redis=require('ioredis');var authService=require(_0xf9e6('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf9e6('0x12'));var logger=require(_0xf9e6('0x13'))(_0xf9e6('0x14'));var utils=require(_0xf9e6('0x15'));var config=require(_0xf9e6('0x16'));var licenseUtil=require(_0xf9e6('0x17'));var db=require(_0xf9e6('0x18'))['db'];config[_0xf9e6('0x19')]=_[_0xf9e6('0x1a')](config[_0xf9e6('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf9e6('0x1b'))(new Redis(config[_0xf9e6('0x19')]));require('./mailQueue.socket')[_0xf9e6('0x1c')](socket);function respondWithStatusCode(_0xc375cf,_0x551068){_0x551068=_0x551068||0xcc;return function(_0x2f63a4){if(_0x2f63a4){return _0xc375cf['sendStatus'](_0x551068);}return _0xc375cf[_0xf9e6('0x1d')](_0x551068)['end']();};}function respondWithResult(_0x28721c,_0x331084){_0x331084=_0x331084||0xc8;return function(_0xcbcd41){if(_0xcbcd41){return _0x28721c[_0xf9e6('0x1d')](_0x331084)['json'](_0xcbcd41);}};}function respondWithFilteredResult(_0x3a683f,_0x1e1882){return function(_0x466631){if(_0x466631){var _0x199707=typeof _0x1e1882[_0xf9e6('0x1e')]===_0xf9e6('0x1f')&&typeof _0x1e1882['limit']===_0xf9e6('0x1f');var _0x53c89e=_0x466631[_0xf9e6('0x20')];var _0x218660=_0x199707?0x0:_0x1e1882['offset'];var _0x4d39c2=_0x199707?_0x466631[_0xf9e6('0x20')]:_0x1e1882[_0xf9e6('0x1e')]+_0x1e1882[_0xf9e6('0x21')];var _0x25b935;if(_0x4d39c2>=_0x53c89e){_0x4d39c2=_0x53c89e;_0x25b935=0xc8;}else{_0x25b935=0xce;}_0x3a683f[_0xf9e6('0x1d')](_0x25b935);return _0x3a683f[_0xf9e6('0x22')](_0xf9e6('0x23'),_0x218660+'-'+_0x4d39c2+'/'+_0x53c89e)[_0xf9e6('0x24')](_0x466631);}return null;};}function patchUpdates(_0xb37f5f){return function(_0x288157){try{jsonpatch['apply'](_0x288157,_0xb37f5f,!![]);}catch(_0x51ec80){return BPromise[_0xf9e6('0x25')](_0x51ec80);}return _0x288157[_0xf9e6('0x26')]();};}function saveUpdates(_0x1db708,_0xd3eb68){return function(_0x20010b){if(_0x20010b){return _0x20010b[_0xf9e6('0x27')](_0x1db708)['then'](function(_0x2d3186){return _0x2d3186;});}return null;};}function removeEntity(_0x2f02f8,_0x144575){return function(_0x4cc708){if(_0x4cc708){return _0x4cc708['destroy']()[_0xf9e6('0x28')](function(){var _0x3e43d5=_0x4cc708[_0xf9e6('0x29')]({'plain':!![]});var _0x2ea01a=_0xf9e6('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x2ea01a,'resourceId':_0x3e43d5['id']}})[_0xf9e6('0x28')](function(){return _0x4cc708;});})['then'](function(){_0x2f02f8['status'](0xcc)[_0xf9e6('0x2b')]();});}};}function handleEntityNotFound(_0xbf62bf,_0x2fd16e){return function(_0x1d247d){if(!_0x1d247d){_0xbf62bf[_0xf9e6('0x2c')](0x194);}return _0x1d247d;};}function handleError(_0x2da1be,_0x113cc7){_0x113cc7=_0x113cc7||0x1f4;return function(_0xf96f32){logger[_0xf9e6('0x2d')](_0xf96f32[_0xf9e6('0x2e')]);if(_0xf96f32['name']){delete _0xf96f32[_0xf9e6('0x2f')];}_0x2da1be[_0xf9e6('0x1d')](_0x113cc7)[_0xf9e6('0x30')](_0xf96f32);};}exports[_0xf9e6('0x31')]=function(_0x1bdf56,_0x5d05ff){var _0x310842={},_0x25c69c={},_0x54a5f3={'count':0x0,'rows':[]};var _0xabba9d=_[_0xf9e6('0x32')](db[_0xf9e6('0x33')][_0xf9e6('0x34')],function(_0x6aa0d4){return{'name':_0x6aa0d4[_0xf9e6('0x35')],'type':_0x6aa0d4[_0xf9e6('0x36')][_0xf9e6('0x37')]};});_0x25c69c[_0xf9e6('0x38')]=_['map'](_0xabba9d,_0xf9e6('0x2f'));_0x25c69c[_0xf9e6('0x39')]=_[_0xf9e6('0x3a')](_0x1bdf56[_0xf9e6('0x39')]);_0x25c69c['filters']=_[_0xf9e6('0x3b')](_0x25c69c[_0xf9e6('0x38')],_0x25c69c[_0xf9e6('0x39')]);_0x310842['attributes']=_[_0xf9e6('0x3b')](_0x25c69c['model'],qs[_0xf9e6('0x3c')](_0x1bdf56[_0xf9e6('0x39')]['fields']));_0x310842['attributes']=_0x310842[_0xf9e6('0x3d')][_0xf9e6('0x3e')]?_0x310842[_0xf9e6('0x3d')]:_0x25c69c[_0xf9e6('0x38')];if(!_0x1bdf56['query']['hasOwnProperty']('nolimit')){_0x310842[_0xf9e6('0x21')]=qs[_0xf9e6('0x21')](_0x1bdf56[_0xf9e6('0x39')][_0xf9e6('0x21')]);_0x310842[_0xf9e6('0x1e')]=qs[_0xf9e6('0x1e')](_0x1bdf56['query'][_0xf9e6('0x1e')]);}_0x310842['order']=qs[_0xf9e6('0x3f')](_0x1bdf56[_0xf9e6('0x39')][_0xf9e6('0x3f')]);_0x310842[_0xf9e6('0x40')]=qs[_0xf9e6('0x41')](_[_0xf9e6('0x42')](_0x1bdf56[_0xf9e6('0x39')],_0x25c69c['filters']),_0xabba9d);if(_0x1bdf56[_0xf9e6('0x39')][_0xf9e6('0x43')]){_0x310842[_0xf9e6('0x40')]=_[_0xf9e6('0x44')](_0x310842[_0xf9e6('0x40')],{'$or':_[_0xf9e6('0x32')](_0xabba9d,function(_0x121eec){if(_0x121eec[_0xf9e6('0x36')]!==_0xf9e6('0x45')){var _0x43b7c2={};_0x43b7c2[_0x121eec['name']]={'$like':'%'+_0x1bdf56[_0xf9e6('0x39')][_0xf9e6('0x43')]+'%'};return _0x43b7c2;}})});}_0x310842=_[_0xf9e6('0x44')]({},_0x310842,_0x1bdf56['options']);var _0xc9b06e={'where':_0x310842[_0xf9e6('0x40')]};return db[_0xf9e6('0x33')]['count'](_0xc9b06e)['then'](function(_0x3ee6ca){_0x54a5f3[_0xf9e6('0x20')]=_0x3ee6ca;if(_0x1bdf56['query'][_0xf9e6('0x46')]){_0x310842[_0xf9e6('0x47')]=[{'all':!![]}];}return db[_0xf9e6('0x33')][_0xf9e6('0x48')](_0x310842);})['then'](function(_0x4207ff){_0x54a5f3[_0xf9e6('0x49')]=_0x4207ff;return _0x54a5f3;})['then'](respondWithFilteredResult(_0x5d05ff,_0x310842))[_0xf9e6('0x4a')](handleError(_0x5d05ff,null));};exports[_0xf9e6('0x4b')]=function(_0x2e2d38,_0x58935b){var _0x3c3d9d={'raw':!![],'where':{'id':_0x2e2d38[_0xf9e6('0x4c')]['id']}},_0x46a53e={};_0x46a53e['model']=_['keys'](db[_0xf9e6('0x33')][_0xf9e6('0x34')]);_0x46a53e[_0xf9e6('0x39')]=_[_0xf9e6('0x3a')](_0x2e2d38[_0xf9e6('0x39')]);_0x46a53e[_0xf9e6('0x41')]=_[_0xf9e6('0x3b')](_0x46a53e[_0xf9e6('0x38')],_0x46a53e[_0xf9e6('0x39')]);_0x3c3d9d['attributes']=_[_0xf9e6('0x3b')](_0x46a53e['model'],qs[_0xf9e6('0x3c')](_0x2e2d38['query']['fields']));_0x3c3d9d[_0xf9e6('0x3d')]=_0x3c3d9d[_0xf9e6('0x3d')]['length']?_0x3c3d9d['attributes']:_0x46a53e['model'];if(_0x2e2d38[_0xf9e6('0x39')][_0xf9e6('0x46')]){_0x3c3d9d['include']=[{'all':!![]}];}_0x3c3d9d=_[_0xf9e6('0x44')]({},_0x3c3d9d,_0x2e2d38['options']);return db[_0xf9e6('0x33')][_0xf9e6('0x4d')](_0x3c3d9d)[_0xf9e6('0x28')](handleEntityNotFound(_0x58935b,null))[_0xf9e6('0x28')](respondWithResult(_0x58935b,null))[_0xf9e6('0x4a')](handleError(_0x58935b,null));};exports[_0xf9e6('0x4e')]=function(_0x3bd6aa,_0x141335){return db[_0xf9e6('0x33')][_0xf9e6('0x4e')](_0x3bd6aa['body'],{})[_0xf9e6('0x28')](function(_0xa62ed5){var _0x18d891=_0x3bd6aa['user'][_0xf9e6('0x29')]({'plain':!![]});if(!_0x18d891)throw new Error(_0xf9e6('0x4f'));if(_0x18d891[_0xf9e6('0x50')]==='user'){var _0x5a69d6=_0xa62ed5[_0xf9e6('0x29')]({'plain':!![]});var _0x9fdcad=_0xf9e6('0x2a');return db[_0xf9e6('0x51')][_0xf9e6('0x4d')]({'where':{'name':_0x9fdcad,'userProfileId':_0x18d891[_0xf9e6('0x52')]},'raw':!![]})[_0xf9e6('0x28')](function(_0x40b9fd){if(_0x40b9fd&&_0x40b9fd[_0xf9e6('0x53')]===0x0){return db[_0xf9e6('0x54')][_0xf9e6('0x4e')]({'name':_0x5a69d6[_0xf9e6('0x2f')],'resourceId':_0x5a69d6['id'],'type':_0x40b9fd[_0xf9e6('0x2f')],'sectionId':_0x40b9fd['id']},{})[_0xf9e6('0x28')](function(){return _0xa62ed5;});}else{return _0xa62ed5;}})[_0xf9e6('0x4a')](function(_0x5d671e){logger[_0xf9e6('0x2d')](_0xf9e6('0x55'),_0x5d671e);throw _0x5d671e;});}return _0xa62ed5;})[_0xf9e6('0x28')](respondWithResult(_0x141335,0xc9))[_0xf9e6('0x4a')](handleError(_0x141335,null));};exports[_0xf9e6('0x27')]=function(_0x524e5e,_0x57d553){if(_0x524e5e[_0xf9e6('0x56')]['id']){delete _0x524e5e[_0xf9e6('0x56')]['id'];}return db[_0xf9e6('0x33')][_0xf9e6('0x4d')]({'where':{'id':_0x524e5e[_0xf9e6('0x4c')]['id']}})[_0xf9e6('0x28')](handleEntityNotFound(_0x57d553,null))[_0xf9e6('0x28')](saveUpdates(_0x524e5e[_0xf9e6('0x56')],null))[_0xf9e6('0x28')](respondWithResult(_0x57d553,null))[_0xf9e6('0x4a')](handleError(_0x57d553,null));};exports[_0xf9e6('0x57')]=function(_0x2b85cd,_0x452356){return db['MailQueue'][_0xf9e6('0x4d')]({'where':{'id':_0x2b85cd[_0xf9e6('0x4c')]['id']}})[_0xf9e6('0x28')](handleEntityNotFound(_0x452356,null))[_0xf9e6('0x28')](removeEntity(_0x452356,null))[_0xf9e6('0x4a')](handleError(_0x452356,null));};exports['describe']=function(_0x2b2ea2,_0x22d3f0){return db[_0xf9e6('0x33')][_0xf9e6('0x58')]()[_0xf9e6('0x28')](respondWithResult(_0x22d3f0,null))[_0xf9e6('0x4a')](handleError(_0x22d3f0,null));};exports['getMembers']=function(_0x388c28,_0x5f0c7e,_0x5a17e7){var _0x30a6dd={'raw':!![],'where':{}},_0xcfa71e={},_0x43d88b;return db[_0xf9e6('0x33')]['findOne']({'where':{'id':_0x388c28['params']['id']}})[_0xf9e6('0x28')](handleEntityNotFound(_0x5f0c7e,null))[_0xf9e6('0x28')](function(_0x553be7){if(_0x553be7){_0x43d88b=_0x553be7[_0xf9e6('0x29')]({'plain':!![]});_0xcfa71e['model']=_[_0xf9e6('0x3a')](db[_0xf9e6('0x59')][_0xf9e6('0x34')]);_0xcfa71e['query']=_[_0xf9e6('0x3a')](_0x388c28[_0xf9e6('0x39')]);_0xcfa71e[_0xf9e6('0x41')]=_[_0xf9e6('0x3b')](_0xcfa71e[_0xf9e6('0x38')],_0xcfa71e['query']);_0x30a6dd[_0xf9e6('0x3d')]=_['intersection'](_0xcfa71e[_0xf9e6('0x38')],qs['fields'](_0x388c28[_0xf9e6('0x39')][_0xf9e6('0x3c')]));_0x30a6dd[_0xf9e6('0x3d')]=_0x30a6dd[_0xf9e6('0x3d')][_0xf9e6('0x3e')]?_0x30a6dd[_0xf9e6('0x3d')]:_0xcfa71e[_0xf9e6('0x38')];if(!_0x388c28[_0xf9e6('0x39')][_0xf9e6('0x5a')](_0xf9e6('0x5b'))){_0x30a6dd[_0xf9e6('0x21')]=qs[_0xf9e6('0x21')](_0x388c28[_0xf9e6('0x39')][_0xf9e6('0x21')]);_0x30a6dd[_0xf9e6('0x1e')]=qs[_0xf9e6('0x1e')](_0x388c28[_0xf9e6('0x39')]['offset']);}_0x30a6dd[_0xf9e6('0x5c')]=qs['sort'](_0x388c28[_0xf9e6('0x39')][_0xf9e6('0x3f')]);_0x30a6dd[_0xf9e6('0x40')]=qs[_0xf9e6('0x41')](_['pick'](_0x388c28[_0xf9e6('0x39')],_0xcfa71e[_0xf9e6('0x41')]));_0x30a6dd['where'][_0xf9e6('0x5d')]=_0x553be7['id'];if(_0x388c28[_0xf9e6('0x39')][_0xf9e6('0x43')]){_0x30a6dd[_0xf9e6('0x40')]=_[_0xf9e6('0x44')](_0x30a6dd[_0xf9e6('0x40')],{'$or':_[_0xf9e6('0x32')](_0x30a6dd['attributes'],function(_0x140125){var _0x28e032={};_0x28e032[_0x140125]={'$like':'%'+_0x388c28['query'][_0xf9e6('0x43')]+'%'};return _0x28e032;})});}_0x30a6dd=_[_0xf9e6('0x44')]({},_0x30a6dd,_0x388c28[_0xf9e6('0x5e')]);return db[_0xf9e6('0x59')][_0xf9e6('0x48')](_0x30a6dd);}})[_0xf9e6('0x28')](function(_0x25dc9c){if(_0x25dc9c){return db['User'][_0xf9e6('0x5f')]({'where':{'id':_[_0xf9e6('0x32')](_0x25dc9c,_0xf9e6('0x60')),'role':'agent'},'attributes':['id',_0xf9e6('0x2f'),_0xf9e6('0x61'),_0xf9e6('0x62'),_0xf9e6('0x63')]});}})[_0xf9e6('0x28')](function(_0x4a232d){if(_0x4a232d){return{'count':_0x4a232d[_0xf9e6('0x20')],'rows':_['map'](_0x4a232d['rows'],function(_0x151615){return{'membername':_0x151615[_0xf9e6('0x2f')],'UserId':_0x151615['id'],'queue_name':_0x43d88b[_0xf9e6('0x2f')],'MailQueueId':_0x43d88b['id'],'interface':util[_0xf9e6('0x64')](_0xf9e6('0x65'),_0xf9e6('0x66'),_0x151615[_0xf9e6('0x2f')]),'penalty':0x0,'paused':_0x151615[_0xf9e6('0x61')],'createdAt':_0x151615['createdAt'],'updatedAt':_0x151615[_0xf9e6('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf9e6('0x28')](respondWithFilteredResult(_0x5f0c7e,_0x30a6dd))[_0xf9e6('0x4a')](handleError(_0x5f0c7e,null));};exports[_0xf9e6('0x67')]=function(_0x3b4a54,_0x5c6ff7,_0x509f52){var _0x1e0d0f={};var _0x140c36={};var _0x1586c7;var _0x3894a4;return db[_0xf9e6('0x33')][_0xf9e6('0x68')]({'where':{'id':_0x3b4a54['params']['id']}})[_0xf9e6('0x28')](handleEntityNotFound(_0x5c6ff7,null))['then'](function(_0x2d3a93){if(_0x2d3a93){_0x1586c7=_0x2d3a93;_0x140c36[_0xf9e6('0x38')]=_[_0xf9e6('0x3a')](db['Team'][_0xf9e6('0x34')]);_0x140c36[_0xf9e6('0x39')]=_[_0xf9e6('0x3a')](_0x3b4a54[_0xf9e6('0x39')]);_0x140c36[_0xf9e6('0x41')]=_['intersection'](_0x140c36[_0xf9e6('0x38')],_0x140c36[_0xf9e6('0x39')]);_0x1e0d0f[_0xf9e6('0x3d')]=_[_0xf9e6('0x3b')](_0x140c36[_0xf9e6('0x38')],qs[_0xf9e6('0x3c')](_0x3b4a54[_0xf9e6('0x39')]['fields']));_0x1e0d0f[_0xf9e6('0x3d')]=_0x1e0d0f[_0xf9e6('0x3d')][_0xf9e6('0x3e')]?_0x1e0d0f[_0xf9e6('0x3d')]:_0x140c36['model'];_0x1e0d0f[_0xf9e6('0x5c')]=qs[_0xf9e6('0x3f')](_0x3b4a54[_0xf9e6('0x39')][_0xf9e6('0x3f')]);_0x1e0d0f[_0xf9e6('0x40')]=qs[_0xf9e6('0x41')](_[_0xf9e6('0x42')](_0x3b4a54[_0xf9e6('0x39')],_0x140c36[_0xf9e6('0x41')]));if(_0x3b4a54['query']['filter']){_0x1e0d0f[_0xf9e6('0x40')]=_[_0xf9e6('0x44')](_0x1e0d0f[_0xf9e6('0x40')],{'$or':_[_0xf9e6('0x32')](_0x1e0d0f[_0xf9e6('0x3d')],function(_0x2a5055){var _0x425ecb={};_0x425ecb[_0x2a5055]={'$like':'%'+_0x3b4a54['query']['filter']+'%'};return _0x425ecb;})});}_0x1e0d0f=_[_0xf9e6('0x44')]({},_0x1e0d0f,_0x3b4a54[_0xf9e6('0x5e')]);return _0x1586c7[_0xf9e6('0x67')](_0x1e0d0f);}})[_0xf9e6('0x28')](function(_0x59127c){if(_0x59127c){_0x3894a4=_0x59127c['length'];if(!_0x3b4a54[_0xf9e6('0x39')][_0xf9e6('0x5a')]('nolimit')){_0x1e0d0f[_0xf9e6('0x21')]=qs['limit'](_0x3b4a54[_0xf9e6('0x39')][_0xf9e6('0x21')]);_0x1e0d0f['offset']=qs[_0xf9e6('0x1e')](_0x3b4a54[_0xf9e6('0x39')][_0xf9e6('0x1e')]);}return _0x1586c7[_0xf9e6('0x67')](_0x1e0d0f);}})[_0xf9e6('0x28')](function(_0x2ce10e){if(_0x2ce10e){return _0x2ce10e?{'count':_0x3894a4,'rows':_0x2ce10e}:null;}})[_0xf9e6('0x28')](respondWithResult(_0x5c6ff7,null))['catch'](handleError(_0x5c6ff7,null));};exports[_0xf9e6('0x69')]=function(_0x112cea,_0x7c44eb,_0x27e2dd){var _0x3e08f5=_0x112cea[_0xf9e6('0x56')][_0xf9e6('0x6a')];return db['Team'][_0xf9e6('0x48')]({'where':{'id':_0x3e08f5},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online',_0xf9e6('0x6b'),_0xf9e6('0x6c')],'raw':!![]}]})[_0xf9e6('0x28')](function(_0x27812c){if(_0x27812c){var _0x41a8e0=_[_0xf9e6('0x6d')](_0x27812c,function(_0xb77731){var _0x28c652=_0xb77731[_0xf9e6('0x29')]({'plain':!![]});return _0x28c652[_0xf9e6('0x6e')];});return db['MailQueue'][_0xf9e6('0x4d')]({'where':{'id':_0x112cea[_0xf9e6('0x4c')]['id']}})['then'](function(_0x81d5e7){return db[_0xf9e6('0x6f')][_0xf9e6('0x70')](function(_0x4f3f6c){return _0x81d5e7['addTeams'](_0x3e08f5,{'transaction':_0x4f3f6c})[_0xf9e6('0x28')](function(){return BPromise[_0xf9e6('0x71')](_0x41a8e0,function(_0x2f0b49){return db[_0xf9e6('0x59')][_0xf9e6('0x72')]({'where':{'UserId':_0x2f0b49['id'],'MailQueueId':_0x112cea[_0xf9e6('0x4c')]['id']},'transaction':_0x4f3f6c});});})[_0xf9e6('0x28')](function(){_0x41a8e0['forEach'](function(_0x1f0757){socket[_0xf9e6('0x73')]('userMailQueue:save',{'UserId':_0x1f0757['id'],'MailQueueId':_0x81d5e7['id']});});});});});}})[_0xf9e6('0x28')](respondWithStatusCode(_0x7c44eb,null))[_0xf9e6('0x4a')](handleError(_0x7c44eb,null));};exports['removeTeams']=function(_0x465fa7,_0x1b1471,_0x40252e){return db[_0xf9e6('0x74')]['findAll']({'where':{'id':_0x465fa7['query'][_0xf9e6('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xf9e6('0x75')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf9e6('0x28')](handleEntityNotFound(_0x1b1471,null))['then'](function(_0x47cd6b){var _0x32b06a=_[_0xf9e6('0x32')](_0x47cd6b,'id');var _0x1e27bf=[];var _0x273e8e=[];var _0x217dc4=squel[_0xf9e6('0x76')]();_0x217dc4[_0xf9e6('0x77')](_0xf9e6('0x78'))[_0xf9e6('0x79')](_0xf9e6('0x7a'),'tq')[_0xf9e6('0x7b')]('user_has_teams','ut',_0xf9e6('0x7c'))['where'](_0xf9e6('0x7d'),_0x465fa7[_0xf9e6('0x4c')]['id']);for(var _0x3de43b=0x0;_0x3de43b<_0x47cd6b['length'];_0x3de43b+=0x1){let _0x403162=_0x47cd6b[_0x3de43b];for(var _0x134bcb=0x0;_0x134bcb<_0x403162[_0xf9e6('0x6e')][_0xf9e6('0x3e')];_0x134bcb+=0x1){let _0x341b69=_0x403162['Agents'][_0x134bcb];var _0x533af1=_0x217dc4['clone']();_0x533af1[_0xf9e6('0x40')]('ut.UserId\x20=\x20?',_0x341b69['id']);_0x273e8e[_0xf9e6('0x7e')](db[_0xf9e6('0x6f')]['query'](_0x533af1[_0xf9e6('0x7f')](),{'type':db[_0xf9e6('0x6f')][_0xf9e6('0x80')][_0xf9e6('0x81')]})[_0xf9e6('0x28')](function(_0x1c3595){if(_0x1c3595[_0xf9e6('0x3e')]===0x1){return _0x341b69['id'];}else{var _0x3554e1=_[_0xf9e6('0x82')](_[_0xf9e6('0x32')](_0x1c3595,_0xf9e6('0x83')),function(_0x3a6a12){return _[_0xf9e6('0x84')](_0x32b06a,_0x3a6a12);});if(_0x3554e1){return _0x341b69['id'];}}}));}}return BPromise[_0xf9e6('0x85')](_0x273e8e)['then'](function(_0x48ef25){_0x1e27bf=_(_0x1e27bf)['union'](_0x48ef25)[_0xf9e6('0x86')]()[_0xf9e6('0x87')]();return db[_0xf9e6('0x33')]['find']({'where':{'id':_0x465fa7[_0xf9e6('0x4c')]['id']}})[_0xf9e6('0x28')](function(_0x87bab8){return db[_0xf9e6('0x6f')][_0xf9e6('0x70')](function(_0x4bd5d5){return _0x87bab8[_0xf9e6('0x88')](_0x465fa7['query'][_0xf9e6('0x6a')],{'transaction':_0x4bd5d5})[_0xf9e6('0x28')](function(){if(!_[_0xf9e6('0x89')](_0x1e27bf)){return _0x87bab8[_0xf9e6('0x8a')](_0x1e27bf,{'transaction':_0x4bd5d5});}})['then'](function(){_0x1e27bf[_0xf9e6('0x8b')](function(_0x5b8bd9){socket[_0xf9e6('0x73')](_0xf9e6('0x8c'),{'UserId':_0x5b8bd9,'MailQueueId':_0x87bab8['id']});});});});});});})['then'](respondWithStatusCode(_0x1b1471,null))[_0xf9e6('0x4a')](handleError(_0x1b1471,null));};exports[_0xf9e6('0x8d')]=function(_0x14d653,_0x190c79,_0x21cc40){return db[_0xf9e6('0x33')][_0xf9e6('0x4d')]({'where':{'id':_0x14d653[_0xf9e6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x190c79,null))[_0xf9e6('0x28')](function(_0x4e7048){if(_0x4e7048){return _0x4e7048[_0xf9e6('0x8d')](_0x14d653[_0xf9e6('0x56')]['ids'],_[_0xf9e6('0x8e')](_0x14d653[_0xf9e6('0x56')],[_0xf9e6('0x6a'),'id'])||{})['spread'](function(_0x26ee80){for(var _0x57a53d=0x0;_0x57a53d<_0x14d653[_0xf9e6('0x56')][_0xf9e6('0x6a')]['length'];_0x57a53d+=0x1){socket[_0xf9e6('0x73')](_0xf9e6('0x8f'),{'UserId':Number(_0x14d653['body'][_0xf9e6('0x6a')][_0x57a53d]),'MailQueueId':Number(_0x14d653[_0xf9e6('0x4c')]['id'])});}return _0x26ee80;});}})[_0xf9e6('0x28')](respondWithResult(_0x190c79,null))[_0xf9e6('0x4a')](handleError(_0x190c79,null));};exports[_0xf9e6('0x8a')]=function(_0x314e16,_0x1043d7,_0x5b0dd4){return db[_0xf9e6('0x33')][_0xf9e6('0x4d')]({'where':{'id':_0x314e16[_0xf9e6('0x4c')]['id']}})[_0xf9e6('0x28')](handleEntityNotFound(_0x1043d7,null))['then'](function(_0x221a80){if(_0x221a80){return _0x221a80[_0xf9e6('0x8a')](_0x314e16['query'][_0xf9e6('0x6a')])['then'](function(){if(_['isArray'](_0x314e16[_0xf9e6('0x39')][_0xf9e6('0x6a')])){for(var _0xab8db9=0x0;_0xab8db9<_0x314e16[_0xf9e6('0x39')]['ids'][_0xf9e6('0x3e')];_0xab8db9+=0x1){socket[_0xf9e6('0x73')](_0xf9e6('0x8c'),{'UserId':Number(_0x314e16[_0xf9e6('0x39')][_0xf9e6('0x6a')][_0xab8db9]),'MailQueueId':Number(_0x314e16[_0xf9e6('0x4c')]['id'])});}}else{socket['emit'](_0xf9e6('0x8c'),{'UserId':Number(_0x314e16['query'][_0xf9e6('0x6a')]),'MailQueueId':Number(_0x314e16[_0xf9e6('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x1043d7,null))[_0xf9e6('0x4a')](handleError(_0x1043d7,null));};exports[_0xf9e6('0x90')]=function(_0x1000a2,_0x426d8f,_0x4caeed){var _0x5bae33={};var _0xe34f74={};var _0x175ae5;var _0x48d928;return db[_0xf9e6('0x33')][_0xf9e6('0x68')]({'where':{'id':_0x1000a2[_0xf9e6('0x4c')]['id']}})[_0xf9e6('0x28')](handleEntityNotFound(_0x426d8f,null))[_0xf9e6('0x28')](function(_0x3e4bfe){if(_0x3e4bfe){_0x175ae5=_0x3e4bfe;_0xe34f74[_0xf9e6('0x38')]=_[_0xf9e6('0x3a')](db[_0xf9e6('0x75')]['rawAttributes']);_0xe34f74[_0xf9e6('0x39')]=_[_0xf9e6('0x3a')](_0x1000a2[_0xf9e6('0x39')]);_0xe34f74[_0xf9e6('0x41')]=_[_0xf9e6('0x3b')](_0xe34f74[_0xf9e6('0x38')],_0xe34f74[_0xf9e6('0x39')]);_0x5bae33[_0xf9e6('0x3d')]=_[_0xf9e6('0x3b')](_0xe34f74['model'],qs[_0xf9e6('0x3c')](_0x1000a2[_0xf9e6('0x39')][_0xf9e6('0x3c')]));_0x5bae33[_0xf9e6('0x3d')]=_0x5bae33[_0xf9e6('0x3d')][_0xf9e6('0x3e')]?_0x5bae33['attributes']:_0xe34f74[_0xf9e6('0x38')];_0x5bae33[_0xf9e6('0x5c')]=qs['sort'](_0x1000a2[_0xf9e6('0x39')][_0xf9e6('0x3f')]);_0x5bae33[_0xf9e6('0x40')]=qs[_0xf9e6('0x41')](_[_0xf9e6('0x42')](_0x1000a2[_0xf9e6('0x39')],_0xe34f74[_0xf9e6('0x41')]));if(_0x1000a2[_0xf9e6('0x39')]['filter']){_0x5bae33[_0xf9e6('0x40')]=_[_0xf9e6('0x44')](_0x5bae33[_0xf9e6('0x40')],{'$or':_[_0xf9e6('0x32')](_0x5bae33[_0xf9e6('0x3d')],function(_0x4ae098){var _0x2e1963={};_0x2e1963[_0x4ae098]={'$like':'%'+_0x1000a2[_0xf9e6('0x39')][_0xf9e6('0x43')]+'%'};return _0x2e1963;})});}_0x5bae33=_[_0xf9e6('0x44')]({},_0x5bae33,_0x1000a2[_0xf9e6('0x5e')]);return _0x175ae5[_0xf9e6('0x90')](_0x5bae33);}})['then'](function(_0x2313aa){if(_0x2313aa){_0x48d928=_0x2313aa[_0xf9e6('0x3e')];if(!_0x1000a2[_0xf9e6('0x39')][_0xf9e6('0x5a')]('nolimit')){_0x5bae33['limit']=qs['limit'](_0x1000a2[_0xf9e6('0x39')][_0xf9e6('0x21')]);_0x5bae33[_0xf9e6('0x1e')]=qs[_0xf9e6('0x1e')](_0x1000a2[_0xf9e6('0x39')]['offset']);}return _0x175ae5['getAgents'](_0x5bae33);}})[_0xf9e6('0x28')](function(_0x22c0eb){if(_0x22c0eb){return _0x22c0eb?{'count':_0x48d928,'rows':_0x22c0eb}:null;}})['then'](respondWithResult(_0x426d8f,null))[_0xf9e6('0x4a')](handleError(_0x426d8f,null));}; \ No newline at end of file +var _0x5cfa=['Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','compact','value','isEmpty','userMailQueue:remove','addAgents','removeAgents','isArray','getAgents','eml-format','zip-dir','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','count','set','Content-Range','apply','save','update','destroy','then','get','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','includeAll','include','MailQueue','findAll','rows','show','keys','length','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserMailQueue','MailQueueId','filter','User','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','getTeams','addTeams','Team'];(function(_0x275c07,_0x5bcbf6){var _0xa7612b=function(_0x2bf80d){while(--_0x2bf80d){_0x275c07['push'](_0x275c07['shift']());}};_0xa7612b(++_0x5bcbf6);}(_0x5cfa,0x12b));var _0xa5cf=function(_0x3f7579,_0x281651){_0x3f7579=_0x3f7579-0x0;var _0x206ff7=_0x5cfa[_0x3f7579];return _0x206ff7;};'use strict';var emlformat=require(_0xa5cf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5cf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa5cf('0x2'));var sox=require(_0xa5cf('0x3'));var csv=require('to-csv');var ejs=require(_0xa5cf('0x4'));var fs=require('fs');var fs_extra=require(_0xa5cf('0x5'));var _=require(_0xa5cf('0x6'));var squel=require('squel');var crypto=require(_0xa5cf('0x7'));var jsforce=require(_0xa5cf('0x8'));var deskjs=require(_0xa5cf('0x9'));var toCsv=require(_0xa5cf('0xa'));var querystring=require(_0xa5cf('0xb'));var Papa=require('papaparse');var Redis=require(_0xa5cf('0xc'));var authService=require(_0xa5cf('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xa5cf('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5cf('0xf'))(_0xa5cf('0x10'));var utils=require(_0xa5cf('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xa5cf('0x12'));var db=require(_0xa5cf('0x13'))['db'];config['redis']=_[_0xa5cf('0x14')](config[_0xa5cf('0x15')],{'host':_0xa5cf('0x16'),'port':0x18eb});var socket=require(_0xa5cf('0x17'))(new Redis(config[_0xa5cf('0x15')]));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x5d27a,_0x238091){_0x238091=_0x238091||0xcc;return function(_0x5a8274){if(_0x5a8274){return _0x5d27a[_0xa5cf('0x18')](_0x238091);}return _0x5d27a['status'](_0x238091)[_0xa5cf('0x19')]();};}function respondWithResult(_0x5edcea,_0x23c4b7){_0x23c4b7=_0x23c4b7||0xc8;return function(_0x1be977){if(_0x1be977){return _0x5edcea[_0xa5cf('0x1a')](_0x23c4b7)['json'](_0x1be977);}};}function respondWithFilteredResult(_0xdce774,_0x36658c){return function(_0x5aac64){if(_0x5aac64){var _0x5ca6f6=typeof _0x36658c[_0xa5cf('0x1b')]===_0xa5cf('0x1c')&&typeof _0x36658c['limit']===_0xa5cf('0x1c');var _0x4b21d2=_0x5aac64[_0xa5cf('0x1d')];var _0x467fe4=_0x5ca6f6?0x0:_0x36658c[_0xa5cf('0x1b')];var _0x5c832d=_0x5ca6f6?_0x5aac64[_0xa5cf('0x1d')]:_0x36658c[_0xa5cf('0x1b')]+_0x36658c['limit'];var _0xdca3e0;if(_0x5c832d>=_0x4b21d2){_0x5c832d=_0x4b21d2;_0xdca3e0=0xc8;}else{_0xdca3e0=0xce;}_0xdce774[_0xa5cf('0x1a')](_0xdca3e0);return _0xdce774[_0xa5cf('0x1e')](_0xa5cf('0x1f'),_0x467fe4+'-'+_0x5c832d+'/'+_0x4b21d2)['json'](_0x5aac64);}return null;};}function patchUpdates(_0x4770f4){return function(_0x537b9c){try{jsonpatch[_0xa5cf('0x20')](_0x537b9c,_0x4770f4,!![]);}catch(_0x281ed3){return BPromise['reject'](_0x281ed3);}return _0x537b9c[_0xa5cf('0x21')]();};}function saveUpdates(_0x163c53,_0x577006){return function(_0x198296){if(_0x198296){return _0x198296[_0xa5cf('0x22')](_0x163c53)['then'](function(_0x50bc52){return _0x50bc52;});}return null;};}function removeEntity(_0x4e291d,_0x5adf2a){return function(_0x29b0db){if(_0x29b0db){return _0x29b0db[_0xa5cf('0x23')]()[_0xa5cf('0x24')](function(){var _0x57736e=_0x29b0db[_0xa5cf('0x25')]({'plain':!![]});var _0x2b73a4='MailQueues';return db['UserProfileResource'][_0xa5cf('0x23')]({'where':{'type':_0x2b73a4,'resourceId':_0x57736e['id']}})[_0xa5cf('0x24')](function(){return _0x29b0db;});})[_0xa5cf('0x24')](function(){_0x4e291d[_0xa5cf('0x1a')](0xcc)[_0xa5cf('0x19')]();});}};}function handleEntityNotFound(_0x38b80b,_0x34ead8){return function(_0xa4b703){if(!_0xa4b703){_0x38b80b[_0xa5cf('0x18')](0x194);}return _0xa4b703;};}function handleError(_0x279197,_0x5b469d){_0x5b469d=_0x5b469d||0x1f4;return function(_0xacd01){logger[_0xa5cf('0x26')](_0xacd01[_0xa5cf('0x27')]);if(_0xacd01['name']){delete _0xacd01[_0xa5cf('0x28')];}_0x279197['status'](_0x5b469d)[_0xa5cf('0x29')](_0xacd01);};}exports[_0xa5cf('0x2a')]=function(_0x33cbed,_0x203680){var _0x318d3b={},_0xf391d4={},_0x197bcd={'count':0x0,'rows':[]};var _0xdd126f=_[_0xa5cf('0x2b')](db['MailQueue'][_0xa5cf('0x2c')],function(_0x583553){return{'name':_0x583553[_0xa5cf('0x2d')],'type':_0x583553[_0xa5cf('0x2e')][_0xa5cf('0x2f')]};});_0xf391d4[_0xa5cf('0x30')]=_[_0xa5cf('0x2b')](_0xdd126f,_0xa5cf('0x28'));_0xf391d4[_0xa5cf('0x31')]=_['keys'](_0x33cbed[_0xa5cf('0x31')]);_0xf391d4[_0xa5cf('0x32')]=_[_0xa5cf('0x33')](_0xf391d4['model'],_0xf391d4['query']);_0x318d3b[_0xa5cf('0x34')]=_[_0xa5cf('0x33')](_0xf391d4[_0xa5cf('0x30')],qs[_0xa5cf('0x35')](_0x33cbed[_0xa5cf('0x31')]['fields']));_0x318d3b[_0xa5cf('0x34')]=_0x318d3b[_0xa5cf('0x34')]['length']?_0x318d3b['attributes']:_0xf391d4[_0xa5cf('0x30')];if(!_0x33cbed['query'][_0xa5cf('0x36')](_0xa5cf('0x37'))){_0x318d3b[_0xa5cf('0x38')]=qs['limit'](_0x33cbed[_0xa5cf('0x31')][_0xa5cf('0x38')]);_0x318d3b[_0xa5cf('0x1b')]=qs[_0xa5cf('0x1b')](_0x33cbed[_0xa5cf('0x31')]['offset']);}_0x318d3b[_0xa5cf('0x39')]=qs[_0xa5cf('0x3a')](_0x33cbed[_0xa5cf('0x31')][_0xa5cf('0x3a')]);_0x318d3b[_0xa5cf('0x3b')]=qs[_0xa5cf('0x32')](_[_0xa5cf('0x3c')](_0x33cbed['query'],_0xf391d4[_0xa5cf('0x32')]),_0xdd126f);if(_0x33cbed[_0xa5cf('0x31')]['filter']){_0x318d3b[_0xa5cf('0x3b')]=_['merge'](_0x318d3b['where'],{'$or':_[_0xa5cf('0x2b')](_0xdd126f,function(_0x321e55){if(_0x321e55[_0xa5cf('0x2e')]!=='VIRTUAL'){var _0x10b6f7={};_0x10b6f7[_0x321e55[_0xa5cf('0x28')]]={'$like':'%'+_0x33cbed[_0xa5cf('0x31')]['filter']+'%'};return _0x10b6f7;}})});}_0x318d3b=_[_0xa5cf('0x3d')]({},_0x318d3b,_0x33cbed['options']);var _0xe07db5={'where':_0x318d3b[_0xa5cf('0x3b')]};return db['MailQueue'][_0xa5cf('0x1d')](_0xe07db5)[_0xa5cf('0x24')](function(_0x2bf8dd){_0x197bcd[_0xa5cf('0x1d')]=_0x2bf8dd;if(_0x33cbed['query'][_0xa5cf('0x3e')]){_0x318d3b[_0xa5cf('0x3f')]=[{'all':!![]}];}return db[_0xa5cf('0x40')][_0xa5cf('0x41')](_0x318d3b);})[_0xa5cf('0x24')](function(_0x2d905a){_0x197bcd[_0xa5cf('0x42')]=_0x2d905a;return _0x197bcd;})[_0xa5cf('0x24')](respondWithFilteredResult(_0x203680,_0x318d3b))['catch'](handleError(_0x203680,null));};exports[_0xa5cf('0x43')]=function(_0x3c58d4,_0x31becf){var _0x9f724e={'raw':!![],'where':{'id':_0x3c58d4['params']['id']}},_0xaabf65={};_0xaabf65['model']=_[_0xa5cf('0x44')](db[_0xa5cf('0x40')]['rawAttributes']);_0xaabf65[_0xa5cf('0x31')]=_['keys'](_0x3c58d4['query']);_0xaabf65[_0xa5cf('0x32')]=_[_0xa5cf('0x33')](_0xaabf65[_0xa5cf('0x30')],_0xaabf65[_0xa5cf('0x31')]);_0x9f724e[_0xa5cf('0x34')]=_[_0xa5cf('0x33')](_0xaabf65[_0xa5cf('0x30')],qs[_0xa5cf('0x35')](_0x3c58d4[_0xa5cf('0x31')][_0xa5cf('0x35')]));_0x9f724e[_0xa5cf('0x34')]=_0x9f724e[_0xa5cf('0x34')][_0xa5cf('0x45')]?_0x9f724e[_0xa5cf('0x34')]:_0xaabf65[_0xa5cf('0x30')];if(_0x3c58d4[_0xa5cf('0x31')][_0xa5cf('0x3e')]){_0x9f724e['include']=[{'all':!![]}];}_0x9f724e=_['merge']({},_0x9f724e,_0x3c58d4[_0xa5cf('0x46')]);return db['MailQueue']['find'](_0x9f724e)['then'](handleEntityNotFound(_0x31becf,null))[_0xa5cf('0x24')](respondWithResult(_0x31becf,null))[_0xa5cf('0x47')](handleError(_0x31becf,null));};exports[_0xa5cf('0x48')]=function(_0xc92cd3,_0x34b2fa){return db[_0xa5cf('0x40')]['create'](_0xc92cd3[_0xa5cf('0x49')],{})[_0xa5cf('0x24')](function(_0x3418d5){var _0x5bc3c1=_0xc92cd3['user']['get']({'plain':!![]});if(!_0x5bc3c1)throw new Error(_0xa5cf('0x4a'));if(_0x5bc3c1[_0xa5cf('0x4b')]===_0xa5cf('0x4c')){var _0x3a6b7a=_0x3418d5[_0xa5cf('0x25')]({'plain':!![]});var _0x371437=_0xa5cf('0x4d');return db[_0xa5cf('0x4e')][_0xa5cf('0x4f')]({'where':{'name':_0x371437,'userProfileId':_0x5bc3c1[_0xa5cf('0x50')]},'raw':!![]})['then'](function(_0x33d56d){if(_0x33d56d&&_0x33d56d[_0xa5cf('0x51')]===0x0){return db['UserProfileResource'][_0xa5cf('0x48')]({'name':_0x3a6b7a[_0xa5cf('0x28')],'resourceId':_0x3a6b7a['id'],'type':_0x33d56d[_0xa5cf('0x28')],'sectionId':_0x33d56d['id']},{})[_0xa5cf('0x24')](function(){return _0x3418d5;});}else{return _0x3418d5;}})[_0xa5cf('0x47')](function(_0x2a0dae){logger[_0xa5cf('0x26')](_0xa5cf('0x52'),_0x2a0dae);throw _0x2a0dae;});}return _0x3418d5;})[_0xa5cf('0x24')](respondWithResult(_0x34b2fa,0xc9))[_0xa5cf('0x47')](handleError(_0x34b2fa,null));};exports[_0xa5cf('0x22')]=function(_0x13f591,_0x4a4eec){if(_0x13f591[_0xa5cf('0x49')]['id']){delete _0x13f591[_0xa5cf('0x49')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x13f591[_0xa5cf('0x53')]['id']}})[_0xa5cf('0x24')](handleEntityNotFound(_0x4a4eec,null))[_0xa5cf('0x24')](saveUpdates(_0x13f591['body'],null))[_0xa5cf('0x24')](respondWithResult(_0x4a4eec,null))['catch'](handleError(_0x4a4eec,null));};exports[_0xa5cf('0x23')]=function(_0x1f0e47,_0x4332cf){return db[_0xa5cf('0x40')][_0xa5cf('0x4f')]({'where':{'id':_0x1f0e47[_0xa5cf('0x53')]['id']}})['then'](handleEntityNotFound(_0x4332cf,null))[_0xa5cf('0x24')](removeEntity(_0x4332cf,null))['catch'](handleError(_0x4332cf,null));};exports[_0xa5cf('0x54')]=function(_0xf3406c,_0x4ac9f){return db[_0xa5cf('0x40')][_0xa5cf('0x54')]()[_0xa5cf('0x24')](respondWithResult(_0x4ac9f,null))['catch'](handleError(_0x4ac9f,null));};exports[_0xa5cf('0x55')]=function(_0x11cfca,_0x1c6e0e,_0x331081){var _0x3c658c={'raw':!![],'where':{}},_0x2da755={},_0x1bbcd2;return db[_0xa5cf('0x40')][_0xa5cf('0x56')]({'where':{'id':_0x11cfca['params']['id']}})['then'](handleEntityNotFound(_0x1c6e0e,null))[_0xa5cf('0x24')](function(_0x5befbd){if(_0x5befbd){_0x1bbcd2=_0x5befbd[_0xa5cf('0x25')]({'plain':!![]});_0x2da755[_0xa5cf('0x30')]=_[_0xa5cf('0x44')](db[_0xa5cf('0x57')][_0xa5cf('0x2c')]);_0x2da755[_0xa5cf('0x31')]=_[_0xa5cf('0x44')](_0x11cfca[_0xa5cf('0x31')]);_0x2da755[_0xa5cf('0x32')]=_[_0xa5cf('0x33')](_0x2da755[_0xa5cf('0x30')],_0x2da755[_0xa5cf('0x31')]);_0x3c658c[_0xa5cf('0x34')]=_['intersection'](_0x2da755[_0xa5cf('0x30')],qs[_0xa5cf('0x35')](_0x11cfca[_0xa5cf('0x31')][_0xa5cf('0x35')]));_0x3c658c[_0xa5cf('0x34')]=_0x3c658c[_0xa5cf('0x34')][_0xa5cf('0x45')]?_0x3c658c['attributes']:_0x2da755['model'];if(!_0x11cfca[_0xa5cf('0x31')][_0xa5cf('0x36')]('nolimit')){_0x3c658c[_0xa5cf('0x38')]=qs['limit'](_0x11cfca[_0xa5cf('0x31')][_0xa5cf('0x38')]);_0x3c658c[_0xa5cf('0x1b')]=qs[_0xa5cf('0x1b')](_0x11cfca[_0xa5cf('0x31')][_0xa5cf('0x1b')]);}_0x3c658c[_0xa5cf('0x39')]=qs[_0xa5cf('0x3a')](_0x11cfca['query']['sort']);_0x3c658c[_0xa5cf('0x3b')]=qs[_0xa5cf('0x32')](_[_0xa5cf('0x3c')](_0x11cfca[_0xa5cf('0x31')],_0x2da755[_0xa5cf('0x32')]));_0x3c658c['where'][_0xa5cf('0x58')]=_0x5befbd['id'];if(_0x11cfca['query'][_0xa5cf('0x59')]){_0x3c658c[_0xa5cf('0x3b')]=_[_0xa5cf('0x3d')](_0x3c658c[_0xa5cf('0x3b')],{'$or':_[_0xa5cf('0x2b')](_0x3c658c[_0xa5cf('0x34')],function(_0x2f8316){var _0xa62e80={};_0xa62e80[_0x2f8316]={'$like':'%'+_0x11cfca['query'][_0xa5cf('0x59')]+'%'};return _0xa62e80;})});}_0x3c658c=_[_0xa5cf('0x3d')]({},_0x3c658c,_0x11cfca[_0xa5cf('0x46')]);return db[_0xa5cf('0x57')][_0xa5cf('0x41')](_0x3c658c);}})[_0xa5cf('0x24')](function(_0x48f7a0){if(_0x48f7a0){return db[_0xa5cf('0x5a')]['findAndCountAll']({'where':{'id':_[_0xa5cf('0x2b')](_0x48f7a0,_0xa5cf('0x5b')),'role':_0xa5cf('0x5c')},'attributes':['id',_0xa5cf('0x28'),_0xa5cf('0x5d'),_0xa5cf('0x5e'),_0xa5cf('0x5f')]});}})[_0xa5cf('0x24')](function(_0x2a458b){if(_0x2a458b){return{'count':_0x2a458b[_0xa5cf('0x1d')],'rows':_['map'](_0x2a458b['rows'],function(_0x2b54f3){return{'membername':_0x2b54f3['name'],'UserId':_0x2b54f3['id'],'queue_name':_0x1bbcd2[_0xa5cf('0x28')],'MailQueueId':_0x1bbcd2['id'],'interface':util['format'](_0xa5cf('0x60'),'SIP',_0x2b54f3[_0xa5cf('0x28')]),'penalty':0x0,'paused':_0x2b54f3[_0xa5cf('0x5d')],'createdAt':_0x2b54f3[_0xa5cf('0x5f')],'updatedAt':_0x2b54f3[_0xa5cf('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa5cf('0x24')](respondWithFilteredResult(_0x1c6e0e,_0x3c658c))[_0xa5cf('0x47')](handleError(_0x1c6e0e,null));};exports[_0xa5cf('0x61')]=function(_0x3b49c7,_0x580fd6,_0x74c9f6){var _0x105348={};var _0x3712ef={};var _0x536080;var _0x230f5e;return db['MailQueue'][_0xa5cf('0x56')]({'where':{'id':_0x3b49c7[_0xa5cf('0x53')]['id']}})[_0xa5cf('0x24')](handleEntityNotFound(_0x580fd6,null))[_0xa5cf('0x24')](function(_0x4aee31){if(_0x4aee31){_0x536080=_0x4aee31;_0x3712ef[_0xa5cf('0x30')]=_['keys'](db['Team'][_0xa5cf('0x2c')]);_0x3712ef[_0xa5cf('0x31')]=_['keys'](_0x3b49c7[_0xa5cf('0x31')]);_0x3712ef['filters']=_[_0xa5cf('0x33')](_0x3712ef[_0xa5cf('0x30')],_0x3712ef[_0xa5cf('0x31')]);_0x105348[_0xa5cf('0x34')]=_['intersection'](_0x3712ef[_0xa5cf('0x30')],qs[_0xa5cf('0x35')](_0x3b49c7[_0xa5cf('0x31')]['fields']));_0x105348['attributes']=_0x105348[_0xa5cf('0x34')][_0xa5cf('0x45')]?_0x105348[_0xa5cf('0x34')]:_0x3712ef[_0xa5cf('0x30')];_0x105348[_0xa5cf('0x39')]=qs['sort'](_0x3b49c7['query'][_0xa5cf('0x3a')]);_0x105348[_0xa5cf('0x3b')]=qs[_0xa5cf('0x32')](_[_0xa5cf('0x3c')](_0x3b49c7[_0xa5cf('0x31')],_0x3712ef['filters']));if(_0x3b49c7[_0xa5cf('0x31')][_0xa5cf('0x59')]){_0x105348[_0xa5cf('0x3b')]=_[_0xa5cf('0x3d')](_0x105348[_0xa5cf('0x3b')],{'$or':_[_0xa5cf('0x2b')](_0x105348[_0xa5cf('0x34')],function(_0x585094){var _0x4ef230={};_0x4ef230[_0x585094]={'$like':'%'+_0x3b49c7[_0xa5cf('0x31')][_0xa5cf('0x59')]+'%'};return _0x4ef230;})});}_0x105348=_[_0xa5cf('0x3d')]({},_0x105348,_0x3b49c7['options']);return _0x536080[_0xa5cf('0x61')](_0x105348);}})[_0xa5cf('0x24')](function(_0x173fb2){if(_0x173fb2){_0x230f5e=_0x173fb2['length'];if(!_0x3b49c7['query'][_0xa5cf('0x36')]('nolimit')){_0x105348[_0xa5cf('0x38')]=qs['limit'](_0x3b49c7[_0xa5cf('0x31')][_0xa5cf('0x38')]);_0x105348['offset']=qs['offset'](_0x3b49c7[_0xa5cf('0x31')][_0xa5cf('0x1b')]);}return _0x536080[_0xa5cf('0x61')](_0x105348);}})[_0xa5cf('0x24')](function(_0x24ef31){if(_0x24ef31){return _0x24ef31?{'count':_0x230f5e,'rows':_0x24ef31}:null;}})[_0xa5cf('0x24')](respondWithResult(_0x580fd6,null))['catch'](handleError(_0x580fd6,null));};exports[_0xa5cf('0x62')]=function(_0xd4f970,_0x4c2c38,_0x4b0028){var _0x240af6=_0xd4f970[_0xa5cf('0x49')]['ids'];return db[_0xa5cf('0x63')]['findAll']({'where':{'id':_0x240af6},'attributes':['id'],'include':[{'model':db[_0xa5cf('0x5a')],'as':_0xa5cf('0x64'),'attributes':['id',_0xa5cf('0x28'),_0xa5cf('0x65'),_0xa5cf('0x66'),_0xa5cf('0x67')],'raw':!![]}]})[_0xa5cf('0x24')](function(_0x42ceb0){if(_0x42ceb0){var _0x3fda60=_['flatMap'](_0x42ceb0,function(_0x352278){var _0x59797a=_0x352278['get']({'plain':!![]});return _0x59797a[_0xa5cf('0x64')];});return db[_0xa5cf('0x40')]['find']({'where':{'id':_0xd4f970[_0xa5cf('0x53')]['id']}})[_0xa5cf('0x24')](function(_0x56638){return db[_0xa5cf('0x68')][_0xa5cf('0x69')](function(_0x4fd91c){return _0x56638[_0xa5cf('0x62')](_0x240af6,{'transaction':_0x4fd91c})[_0xa5cf('0x24')](function(){return BPromise[_0xa5cf('0x6a')](_0x3fda60,function(_0x24858d){return db['UserMailQueue'][_0xa5cf('0x6b')]({'where':{'UserId':_0x24858d['id'],'MailQueueId':_0xd4f970[_0xa5cf('0x53')]['id']},'transaction':_0x4fd91c});});})['then'](function(){_0x3fda60[_0xa5cf('0x6c')](function(_0x42e4ad){socket[_0xa5cf('0x6d')](_0xa5cf('0x6e'),{'UserId':_0x42e4ad['id'],'MailQueueId':_0x56638['id']});});});});});}})[_0xa5cf('0x24')](respondWithStatusCode(_0x4c2c38,null))[_0xa5cf('0x47')](handleError(_0x4c2c38,null));};exports[_0xa5cf('0x6f')]=function(_0x3eb3e3,_0x4860a2,_0x2dc03e){return db[_0xa5cf('0x63')]['findAll']({'where':{'id':_0x3eb3e3[_0xa5cf('0x31')][_0xa5cf('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa5cf('0x64'),'attributes':['id'],'raw':!![]}]})[_0xa5cf('0x24')](handleEntityNotFound(_0x4860a2,null))[_0xa5cf('0x24')](function(_0x171edc){var _0x20047b=_['map'](_0x171edc,'id');var _0x4f3aff=[];var _0x32d66e=[];var _0x346bfd=squel[_0xa5cf('0x71')]();_0x346bfd['field'](_0xa5cf('0x72'))[_0xa5cf('0x73')](_0xa5cf('0x74'),'tq')[_0xa5cf('0x75')]('user_has_teams','ut',_0xa5cf('0x76'))['where'](_0xa5cf('0x77'),_0x3eb3e3['params']['id']);for(var _0x552680=0x0;_0x552680<_0x171edc[_0xa5cf('0x45')];_0x552680+=0x1){let _0x79ed71=_0x171edc[_0x552680];for(var _0x575577=0x0;_0x575577<_0x79ed71[_0xa5cf('0x64')][_0xa5cf('0x45')];_0x575577+=0x1){let _0x31b37d=_0x79ed71[_0xa5cf('0x64')][_0x575577];var _0x1f4873=_0x346bfd['clone']();_0x1f4873[_0xa5cf('0x3b')]('ut.UserId\x20=\x20?',_0x31b37d['id']);_0x32d66e['push'](db[_0xa5cf('0x68')]['query'](_0x1f4873[_0xa5cf('0x78')](),{'type':db[_0xa5cf('0x68')][_0xa5cf('0x79')][_0xa5cf('0x7a')]})[_0xa5cf('0x24')](function(_0x3c2610){if(_0x3c2610[_0xa5cf('0x45')]===0x1){return _0x31b37d['id'];}else{var _0x404e77=_[_0xa5cf('0x7b')](_[_0xa5cf('0x2b')](_0x3c2610,_0xa5cf('0x7c')),function(_0x5b3c26){return _['includes'](_0x20047b,_0x5b3c26);});if(_0x404e77){return _0x31b37d['id'];}}}));}}return BPromise['all'](_0x32d66e)[_0xa5cf('0x24')](function(_0x5a4e5c){_0x4f3aff=_(_0x4f3aff)['union'](_0x5a4e5c)[_0xa5cf('0x7d')]()[_0xa5cf('0x7e')]();return db[_0xa5cf('0x40')]['find']({'where':{'id':_0x3eb3e3[_0xa5cf('0x53')]['id']}})['then'](function(_0x2b5596){return db[_0xa5cf('0x68')]['transaction'](function(_0x47dcd4){return _0x2b5596[_0xa5cf('0x6f')](_0x3eb3e3['query'][_0xa5cf('0x70')],{'transaction':_0x47dcd4})['then'](function(){if(!_[_0xa5cf('0x7f')](_0x4f3aff)){return _0x2b5596['removeAgents'](_0x4f3aff,{'transaction':_0x47dcd4});}})[_0xa5cf('0x24')](function(){_0x4f3aff[_0xa5cf('0x6c')](function(_0x2f0847){socket[_0xa5cf('0x6d')](_0xa5cf('0x80'),{'UserId':_0x2f0847,'MailQueueId':_0x2b5596['id']});});});});});});})[_0xa5cf('0x24')](respondWithStatusCode(_0x4860a2,null))[_0xa5cf('0x47')](handleError(_0x4860a2,null));};exports['addAgents']=function(_0x308629,_0xe8b1dd,_0x57c37b){return db[_0xa5cf('0x40')][_0xa5cf('0x4f')]({'where':{'id':_0x308629['params']['id']}})[_0xa5cf('0x24')](handleEntityNotFound(_0xe8b1dd,null))[_0xa5cf('0x24')](function(_0x408bcc){if(_0x408bcc){return _0x408bcc[_0xa5cf('0x81')](_0x308629[_0xa5cf('0x49')]['ids'],_['omit'](_0x308629[_0xa5cf('0x49')],[_0xa5cf('0x70'),'id'])||{})['spread'](function(_0x101dbf){for(var _0x844010=0x0;_0x844010<_0x308629[_0xa5cf('0x49')][_0xa5cf('0x70')][_0xa5cf('0x45')];_0x844010+=0x1){socket['emit'](_0xa5cf('0x6e'),{'UserId':Number(_0x308629['body'][_0xa5cf('0x70')][_0x844010]),'MailQueueId':Number(_0x308629['params']['id'])});}return _0x101dbf;});}})[_0xa5cf('0x24')](respondWithResult(_0xe8b1dd,null))['catch'](handleError(_0xe8b1dd,null));};exports[_0xa5cf('0x82')]=function(_0x4e6d0a,_0x381b07,_0x446064){return db['MailQueue']['find']({'where':{'id':_0x4e6d0a[_0xa5cf('0x53')]['id']}})[_0xa5cf('0x24')](handleEntityNotFound(_0x381b07,null))[_0xa5cf('0x24')](function(_0x341ada){if(_0x341ada){return _0x341ada['removeAgents'](_0x4e6d0a['query'][_0xa5cf('0x70')])[_0xa5cf('0x24')](function(){if(_[_0xa5cf('0x83')](_0x4e6d0a['query'][_0xa5cf('0x70')])){for(var _0xa5b112=0x0;_0xa5b112<_0x4e6d0a[_0xa5cf('0x31')][_0xa5cf('0x70')][_0xa5cf('0x45')];_0xa5b112+=0x1){socket[_0xa5cf('0x6d')](_0xa5cf('0x80'),{'UserId':Number(_0x4e6d0a[_0xa5cf('0x31')]['ids'][_0xa5b112]),'MailQueueId':Number(_0x4e6d0a['params']['id'])});}}else{socket[_0xa5cf('0x6d')](_0xa5cf('0x80'),{'UserId':Number(_0x4e6d0a[_0xa5cf('0x31')][_0xa5cf('0x70')]),'MailQueueId':Number(_0x4e6d0a[_0xa5cf('0x53')]['id'])});}});}})[_0xa5cf('0x24')](respondWithStatusCode(_0x381b07,null))['catch'](handleError(_0x381b07,null));};exports[_0xa5cf('0x84')]=function(_0x549ff9,_0x4f69bb,_0x2f4230){var _0x25dd9d={};var _0xdd4aa8={};var _0x4c671b;var _0x5cca5c;return db[_0xa5cf('0x40')]['findOne']({'where':{'id':_0x549ff9['params']['id']}})[_0xa5cf('0x24')](handleEntityNotFound(_0x4f69bb,null))['then'](function(_0x7a6a17){if(_0x7a6a17){_0x4c671b=_0x7a6a17;_0xdd4aa8[_0xa5cf('0x30')]=_['keys'](db[_0xa5cf('0x5a')][_0xa5cf('0x2c')]);_0xdd4aa8[_0xa5cf('0x31')]=_[_0xa5cf('0x44')](_0x549ff9[_0xa5cf('0x31')]);_0xdd4aa8[_0xa5cf('0x32')]=_[_0xa5cf('0x33')](_0xdd4aa8[_0xa5cf('0x30')],_0xdd4aa8[_0xa5cf('0x31')]);_0x25dd9d['attributes']=_['intersection'](_0xdd4aa8[_0xa5cf('0x30')],qs[_0xa5cf('0x35')](_0x549ff9[_0xa5cf('0x31')][_0xa5cf('0x35')]));_0x25dd9d['attributes']=_0x25dd9d[_0xa5cf('0x34')][_0xa5cf('0x45')]?_0x25dd9d[_0xa5cf('0x34')]:_0xdd4aa8[_0xa5cf('0x30')];_0x25dd9d[_0xa5cf('0x39')]=qs['sort'](_0x549ff9[_0xa5cf('0x31')]['sort']);_0x25dd9d[_0xa5cf('0x3b')]=qs[_0xa5cf('0x32')](_[_0xa5cf('0x3c')](_0x549ff9[_0xa5cf('0x31')],_0xdd4aa8[_0xa5cf('0x32')]));if(_0x549ff9[_0xa5cf('0x31')][_0xa5cf('0x59')]){_0x25dd9d[_0xa5cf('0x3b')]=_['merge'](_0x25dd9d[_0xa5cf('0x3b')],{'$or':_['map'](_0x25dd9d[_0xa5cf('0x34')],function(_0x154b65){var _0x3f2d82={};_0x3f2d82[_0x154b65]={'$like':'%'+_0x549ff9[_0xa5cf('0x31')]['filter']+'%'};return _0x3f2d82;})});}_0x25dd9d=_[_0xa5cf('0x3d')]({},_0x25dd9d,_0x549ff9[_0xa5cf('0x46')]);return _0x4c671b[_0xa5cf('0x84')](_0x25dd9d);}})[_0xa5cf('0x24')](function(_0x5a7275){if(_0x5a7275){_0x5cca5c=_0x5a7275[_0xa5cf('0x45')];if(!_0x549ff9[_0xa5cf('0x31')][_0xa5cf('0x36')](_0xa5cf('0x37'))){_0x25dd9d['limit']=qs[_0xa5cf('0x38')](_0x549ff9[_0xa5cf('0x31')][_0xa5cf('0x38')]);_0x25dd9d[_0xa5cf('0x1b')]=qs[_0xa5cf('0x1b')](_0x549ff9[_0xa5cf('0x31')][_0xa5cf('0x1b')]);}return _0x4c671b['getAgents'](_0x25dd9d);}})[_0xa5cf('0x24')](function(_0x1a5ff1){if(_0x1a5ff1){return _0x1a5ff1?{'count':_0x5cca5c,'rows':_0x1a5ff1}:null;}})[_0xa5cf('0x24')](respondWithResult(_0x4f69bb,null))[_0xa5cf('0x47')](handleError(_0x4f69bb,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index a2babcd..bd54e97 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 _0xd4e8=['../../mysqldb','MailQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3f88bc,_0xe38cf5){var _0x4df1c4=function(_0x111de1){while(--_0x111de1){_0x3f88bc['push'](_0x3f88bc['shift']());}};_0x4df1c4(++_0xe38cf5);}(_0xd4e8,0x1d5));var _0x8d4e=function(_0x8ed2fe,_0x19ca78){_0x8ed2fe=_0x8ed2fe-0x0;var _0x23a751=_0xd4e8[_0x8ed2fe];return _0x23a751;};'use strict';var EventEmitter=require(_0x8d4e('0x0'));var MailQueue=require(_0x8d4e('0x1'))['db'][_0x8d4e('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8d4e('0x3'),'afterUpdate':_0x8d4e('0x4'),'afterDestroy':_0x8d4e('0x5')};function emitEvent(_0x49f85c){return function(_0x32f19a,_0x75a8f4,_0xe33210){MailQueueEvents[_0x8d4e('0x6')](_0x49f85c+':'+_0x32f19a['id'],_0x32f19a);MailQueueEvents[_0x8d4e('0x6')](_0x49f85c,_0x32f19a);_0xe33210(null);};}for(var e in events){if(events[_0x8d4e('0x7')](e)){var event=events[e];MailQueue[_0x8d4e('0x8')](e,emitEvent(event));}}module[_0x8d4e('0x9')]=MailQueueEvents; \ No newline at end of file +var _0xc432=['save','remove','emit','exports','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x3f06d8,_0x372378){var _0x1475c1=function(_0x36e85f){while(--_0x36e85f){_0x3f06d8['push'](_0x3f06d8['shift']());}};_0x1475c1(++_0x372378);}(_0xc432,0x12c));var _0x2c43=function(_0x220aa4,_0x82a5ea){_0x220aa4=_0x220aa4-0x0;var _0x480fed=_0xc432[_0x220aa4];return _0x480fed;};'use strict';var EventEmitter=require(_0x2c43('0x0'));var MailQueue=require(_0x2c43('0x1'))['db'][_0x2c43('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x2c43('0x3')](0x0);var events={'afterCreate':_0x2c43('0x4'),'afterUpdate':'update','afterDestroy':_0x2c43('0x5')};function emitEvent(_0x2ef7c6){return function(_0x58a80c,_0x98274f,_0x4c63d0){MailQueueEvents[_0x2c43('0x6')](_0x2ef7c6+':'+_0x58a80c['id'],_0x58a80c);MailQueueEvents[_0x2c43('0x6')](_0x2ef7c6,_0x58a80c);_0x4c63d0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x2c43('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 0ba25c8..6093064 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 _0x9d2d=['../../config/environment','./mailQueue.attributes','define','mail_queues','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5e3f0f,_0x16c6c7){var _0xbd8d66=function(_0x3f4da4){while(--_0x3f4da4){_0x5e3f0f['push'](_0x5e3f0f['shift']());}};_0xbd8d66(++_0x16c6c7);}(_0x9d2d,0xd5));var _0xd9d2=function(_0x4f8779,_0x5ed2f2){_0x4f8779=_0x4f8779-0x0;var _0x285c5c=_0x9d2d[_0x4f8779];return _0x285c5c;};'use strict';var _=require(_0xd9d2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd9d2('0x1'));var moment=require(_0xd9d2('0x2'));var BPromise=require(_0xd9d2('0x3'));var rp=require(_0xd9d2('0x4'));var fs=require('fs');var path=require(_0xd9d2('0x5'));var rimraf=require(_0xd9d2('0x6'));var config=require(_0xd9d2('0x7'));var attributes=require(_0xd9d2('0x8'));module['exports']=function(_0x6c5c13,_0x586c2e){return _0x6c5c13[_0xd9d2('0x9')]('MailQueue',attributes,{'tableName':_0xd9d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c81=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x5abd66,_0x3abbff){var _0x13754c=function(_0x200d61){while(--_0x200d61){_0x5abd66['push'](_0x5abd66['shift']());}};_0x13754c(++_0x3abbff);}(_0x5c81,0x105));var _0x15c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5c81[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x15c8('0x0'));var util=require(_0x15c8('0x1'));var logger=require(_0x15c8('0x2'))(_0x15c8('0x3'));var moment=require('moment');var BPromise=require(_0x15c8('0x4'));var rp=require(_0x15c8('0x5'));var fs=require('fs');var path=require(_0x15c8('0x6'));var rimraf=require(_0x15c8('0x7'));var config=require(_0x15c8('0x8'));var attributes=require(_0x15c8('0x9'));module[_0x15c8('0xa')]=function(_0x393587,_0x187c12){return _0x393587[_0x15c8('0xb')](_0x15c8('0xc'),attributes,{'tableName':_0x15c8('0xd'),'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 872a50e..50728f3 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 _0xf2f5=['include','map','model','GetMailQueue','debug','ShowMailQueue','raw','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailQueue','findAll','options','attributes','limit'];(function(_0x4bb722,_0x1db86e){var _0x407977=function(_0xe856ab){while(--_0xe856ab){_0x4bb722['push'](_0x4bb722['shift']());}};_0x407977(++_0x1db86e);}(_0xf2f5,0x179));var _0x5f2f=function(_0x1406fd,_0x5b1a56){_0x1406fd=_0x1406fd-0x0;var _0x1a985e=_0xf2f5[_0x1406fd];return _0x1a985e;};'use strict';var _=require(_0x5f2f('0x0'));var util=require('util');var moment=require(_0x5f2f('0x1'));var BPromise=require('bluebird');var rs=require(_0x5f2f('0x2'));var fs=require('fs');var Redis=require(_0x5f2f('0x3'));var db=require(_0x5f2f('0x4'))['db'];var utils=require(_0x5f2f('0x5'));var logger=require(_0x5f2f('0x6'))(_0x5f2f('0x7'));var config=require(_0x5f2f('0x8'));var jayson=require(_0x5f2f('0x9'));var client=jayson[_0x5f2f('0xa')][_0x5f2f('0xb')]({'port':0x232a});config[_0x5f2f('0xc')]=_[_0x5f2f('0xd')](config[_0x5f2f('0xc')],{'host':_0x5f2f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5f2f('0xc')]));require(_0x5f2f('0xf'))['register'](socket);function respondWithRpcPromise(_0x4568ef,_0x1d7a67,_0x450487){return new BPromise(function(_0x32cc75,_0x1261af){return client[_0x5f2f('0x10')](_0x4568ef,_0x450487)[_0x5f2f('0x11')](function(_0x87acf1){logger[_0x5f2f('0x12')](_0x5f2f('0x13'),_0x1d7a67,_0x5f2f('0x14'));logger['debug'](_0x5f2f('0x15'),_0x1d7a67,_0x5f2f('0x14'),JSON[_0x5f2f('0x16')](_0x87acf1));if(_0x87acf1[_0x5f2f('0x17')]){if(_0x87acf1['error'][_0x5f2f('0x18')]===0x1f4){logger[_0x5f2f('0x17')]('MailQueue,\x20%s,\x20%s',_0x1d7a67,_0x87acf1[_0x5f2f('0x17')][_0x5f2f('0x19')]);return _0x1261af(_0x87acf1[_0x5f2f('0x17')][_0x5f2f('0x19')]);}logger[_0x5f2f('0x17')](_0x5f2f('0x13'),_0x1d7a67,_0x87acf1['error'][_0x5f2f('0x19')]);return _0x32cc75(_0x87acf1['error'][_0x5f2f('0x19')]);}else{logger['info'](_0x5f2f('0x13'),_0x1d7a67,_0x5f2f('0x14'));_0x32cc75(_0x87acf1[_0x5f2f('0x1a')]['message']);}})[_0x5f2f('0x1b')](function(_0x17b15f){logger[_0x5f2f('0x17')]('MailQueue,\x20%s,\x20%s',_0x1d7a67,_0x17b15f);_0x1261af(_0x17b15f);});});}exports['GetMailQueue']=function(_0x1583ac){var _0x45279b=this;return new Promise(function(_0x5f5db1,_0x187e87){return db[_0x5f2f('0x1c')][_0x5f2f('0x1d')]({'raw':_0x1583ac[_0x5f2f('0x1e')]?_0x1583ac[_0x5f2f('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1583ac[_0x5f2f('0x1e')]?_0x1583ac[_0x5f2f('0x1e')]['where']||null:null,'attributes':_0x1583ac[_0x5f2f('0x1e')]?_0x1583ac[_0x5f2f('0x1e')][_0x5f2f('0x1f')]||null:null,'limit':_0x1583ac['options']?_0x1583ac[_0x5f2f('0x1e')][_0x5f2f('0x20')]||null:null,'include':_0x1583ac[_0x5f2f('0x1e')]?_0x1583ac['options'][_0x5f2f('0x21')]?_[_0x5f2f('0x22')](_0x1583ac[_0x5f2f('0x1e')][_0x5f2f('0x21')],function(_0x492c1b){return{'model':db[_0x492c1b['model']],'as':_0x492c1b['as'],'attributes':_0x492c1b[_0x5f2f('0x1f')],'include':_0x492c1b['include']?_[_0x5f2f('0x22')](_0x492c1b['include'],function(_0x568479){return{'model':db[_0x568479[_0x5f2f('0x23')]],'as':_0x568479['as'],'attributes':_0x568479[_0x5f2f('0x1f')],'include':_0x568479[_0x5f2f('0x21')]?_[_0x5f2f('0x22')](_0x568479[_0x5f2f('0x21')],function(_0x376f75){return{'model':db[_0x376f75['model']],'as':_0x376f75['as'],'attributes':_0x376f75[_0x5f2f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5f2f('0x11')](function(_0x3250c9){logger[_0x5f2f('0x12')](_0x5f2f('0x24'),_0x1583ac);logger[_0x5f2f('0x25')](_0x5f2f('0x24'),_0x1583ac,JSON[_0x5f2f('0x16')](_0x3250c9));_0x5f5db1(_0x3250c9);})[_0x5f2f('0x1b')](function(_0x51fa98){logger['error']('GetMailQueue',_0x51fa98[_0x5f2f('0x19')],_0x1583ac);_0x187e87(_0x45279b[_0x5f2f('0x17')](0x1f4,_0x51fa98['message']));});});};exports[_0x5f2f('0x26')]=function(_0x4249be){var _0x737dc=this;return new Promise(function(_0x6a424d,_0x336835){return db[_0x5f2f('0x1c')]['find']({'raw':_0x4249be[_0x5f2f('0x1e')]?_0x4249be[_0x5f2f('0x1e')][_0x5f2f('0x27')]===undefined?!![]:![]:!![],'where':_0x4249be[_0x5f2f('0x1e')]?_0x4249be['options'][_0x5f2f('0x28')]||null:null,'attributes':_0x4249be[_0x5f2f('0x1e')]?_0x4249be['options'][_0x5f2f('0x1f')]||null:null,'include':_0x4249be[_0x5f2f('0x1e')]?_0x4249be[_0x5f2f('0x1e')][_0x5f2f('0x21')]?_[_0x5f2f('0x22')](_0x4249be[_0x5f2f('0x1e')][_0x5f2f('0x21')],function(_0x353c48){return{'model':db[_0x353c48[_0x5f2f('0x23')]],'as':_0x353c48['as'],'attributes':_0x353c48['attributes'],'include':_0x353c48['include']?_['map'](_0x353c48[_0x5f2f('0x21')],function(_0x45bbd6){return{'model':db[_0x45bbd6[_0x5f2f('0x23')]],'as':_0x45bbd6['as'],'attributes':_0x45bbd6['attributes'],'include':_0x45bbd6[_0x5f2f('0x21')]?_[_0x5f2f('0x22')](_0x45bbd6['include'],function(_0x3fedec){return{'model':db[_0x3fedec[_0x5f2f('0x23')]],'as':_0x3fedec['as'],'attributes':_0x3fedec[_0x5f2f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1551de){logger['info'](_0x5f2f('0x26'),_0x4249be);logger['debug']('ShowMailQueue',_0x4249be,JSON[_0x5f2f('0x16')](_0x1551de));_0x6a424d(_0x1551de);})[_0x5f2f('0x1b')](function(_0x1c436e){logger['error'](_0x5f2f('0x26'),_0x1c436e[_0x5f2f('0x19')],_0x4249be);_0x336835(_0x737dc[_0x5f2f('0x17')](0x1f4,_0x1c436e[_0x5f2f('0x19')]));});});}; \ No newline at end of file +var _0x7dde=['info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMailQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','MailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x7dde,0x66));var _0xe7dd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe7dd('0x0'));var util=require(_0xe7dd('0x1'));var moment=require(_0xe7dd('0x2'));var BPromise=require(_0xe7dd('0x3'));var rs=require(_0xe7dd('0x4'));var fs=require('fs');var Redis=require(_0xe7dd('0x5'));var db=require(_0xe7dd('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7dd('0x7'))(_0xe7dd('0x8'));var config=require(_0xe7dd('0x9'));var jayson=require(_0xe7dd('0xa'));var client=jayson['client'][_0xe7dd('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe7dd('0xc')],{'host':_0xe7dd('0xd'),'port':0x18eb});var socket=require(_0xe7dd('0xe'))(new Redis(config[_0xe7dd('0xc')]));require('./mailQueue.socket')[_0xe7dd('0xf')](socket);function respondWithRpcPromise(_0x45f0f8,_0x25e5c3,_0x415ea6){return new BPromise(function(_0x3c6c01,_0x29a744){return client[_0xe7dd('0x10')](_0x45f0f8,_0x415ea6)[_0xe7dd('0x11')](function(_0x2d4666){logger[_0xe7dd('0x12')](_0xe7dd('0x13'),_0x25e5c3,_0xe7dd('0x14'));logger[_0xe7dd('0x15')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x25e5c3,'request\x20sent',JSON[_0xe7dd('0x16')](_0x2d4666));if(_0x2d4666[_0xe7dd('0x17')]){if(_0x2d4666[_0xe7dd('0x17')][_0xe7dd('0x18')]===0x1f4){logger[_0xe7dd('0x17')](_0xe7dd('0x13'),_0x25e5c3,_0x2d4666[_0xe7dd('0x17')][_0xe7dd('0x19')]);return _0x29a744(_0x2d4666[_0xe7dd('0x17')]['message']);}logger['error'](_0xe7dd('0x13'),_0x25e5c3,_0x2d4666[_0xe7dd('0x17')][_0xe7dd('0x19')]);return _0x3c6c01(_0x2d4666[_0xe7dd('0x17')]['message']);}else{logger[_0xe7dd('0x12')](_0xe7dd('0x13'),_0x25e5c3,_0xe7dd('0x14'));_0x3c6c01(_0x2d4666[_0xe7dd('0x1a')][_0xe7dd('0x19')]);}})[_0xe7dd('0x1b')](function(_0x674853){logger['error'](_0xe7dd('0x13'),_0x25e5c3,_0x674853);_0x29a744(_0x674853);});});}exports[_0xe7dd('0x1c')]=function(_0x30379e){var _0x46244f=this;return new Promise(function(_0xb69066,_0x3dad64){return db['MailQueue'][_0xe7dd('0x1d')]({'raw':_0x30379e['options']?_0x30379e[_0xe7dd('0x1e')][_0xe7dd('0x1f')]===undefined?!![]:![]:!![],'where':_0x30379e[_0xe7dd('0x1e')]?_0x30379e[_0xe7dd('0x1e')][_0xe7dd('0x20')]||null:null,'attributes':_0x30379e['options']?_0x30379e[_0xe7dd('0x1e')][_0xe7dd('0x21')]||null:null,'limit':_0x30379e[_0xe7dd('0x1e')]?_0x30379e[_0xe7dd('0x1e')][_0xe7dd('0x22')]||null:null,'include':_0x30379e[_0xe7dd('0x1e')]?_0x30379e[_0xe7dd('0x1e')][_0xe7dd('0x23')]?_[_0xe7dd('0x24')](_0x30379e['options']['include'],function(_0x1bbeed){return{'model':db[_0x1bbeed[_0xe7dd('0x25')]],'as':_0x1bbeed['as'],'attributes':_0x1bbeed[_0xe7dd('0x21')],'include':_0x1bbeed[_0xe7dd('0x23')]?_['map'](_0x1bbeed[_0xe7dd('0x23')],function(_0x36e26f){return{'model':db[_0x36e26f[_0xe7dd('0x25')]],'as':_0x36e26f['as'],'attributes':_0x36e26f[_0xe7dd('0x21')],'include':_0x36e26f[_0xe7dd('0x23')]?_['map'](_0x36e26f[_0xe7dd('0x23')],function(_0x47f454){return{'model':db[_0x47f454[_0xe7dd('0x25')]],'as':_0x47f454['as'],'attributes':_0x47f454[_0xe7dd('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe7dd('0x11')](function(_0x1f05ac){logger[_0xe7dd('0x12')]('GetMailQueue',_0x30379e);logger['debug']('GetMailQueue',_0x30379e,JSON[_0xe7dd('0x16')](_0x1f05ac));_0xb69066(_0x1f05ac);})['catch'](function(_0x31b6bb){logger['error']('GetMailQueue',_0x31b6bb[_0xe7dd('0x19')],_0x30379e);_0x3dad64(_0x46244f[_0xe7dd('0x17')](0x1f4,_0x31b6bb['message']));});});};exports[_0xe7dd('0x26')]=function(_0x7664c3){var _0x25f7a7=this;return new Promise(function(_0xa2830a,_0x4f88e2){return db[_0xe7dd('0x27')]['find']({'raw':_0x7664c3[_0xe7dd('0x1e')]?_0x7664c3[_0xe7dd('0x1e')][_0xe7dd('0x1f')]===undefined?!![]:![]:!![],'where':_0x7664c3[_0xe7dd('0x1e')]?_0x7664c3['options'][_0xe7dd('0x20')]||null:null,'attributes':_0x7664c3[_0xe7dd('0x1e')]?_0x7664c3['options'][_0xe7dd('0x21')]||null:null,'include':_0x7664c3[_0xe7dd('0x1e')]?_0x7664c3[_0xe7dd('0x1e')][_0xe7dd('0x23')]?_[_0xe7dd('0x24')](_0x7664c3[_0xe7dd('0x1e')][_0xe7dd('0x23')],function(_0x16c865){return{'model':db[_0x16c865[_0xe7dd('0x25')]],'as':_0x16c865['as'],'attributes':_0x16c865[_0xe7dd('0x21')],'include':_0x16c865['include']?_[_0xe7dd('0x24')](_0x16c865[_0xe7dd('0x23')],function(_0x595c1b){return{'model':db[_0x595c1b[_0xe7dd('0x25')]],'as':_0x595c1b['as'],'attributes':_0x595c1b[_0xe7dd('0x21')],'include':_0x595c1b[_0xe7dd('0x23')]?_[_0xe7dd('0x24')](_0x595c1b[_0xe7dd('0x23')],function(_0x1edc5e){return{'model':db[_0x1edc5e[_0xe7dd('0x25')]],'as':_0x1edc5e['as'],'attributes':_0x1edc5e['attributes']};}):[]};}):[]};}):[]:[]})[_0xe7dd('0x11')](function(_0x3c3a35){logger['info'](_0xe7dd('0x26'),_0x7664c3);logger['debug']('ShowMailQueue',_0x7664c3,JSON[_0xe7dd('0x16')](_0x3c3a35));_0xa2830a(_0x3c3a35);})['catch'](function(_0x189214){logger[_0xe7dd('0x17')](_0xe7dd('0x26'),_0x189214[_0xe7dd('0x19')],_0x7664c3);_0x4f88e2(_0x25f7a7['error'](0x1f4,_0x189214[_0xe7dd('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 3d2afea..fba7b8a 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 _0xcbf0=['mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x5004d5,_0x50ab11){var _0x33469a=function(_0x270937){while(--_0x270937){_0x5004d5['push'](_0x5004d5['shift']());}};_0x33469a(++_0x50ab11);}(_0xcbf0,0xc1));var _0x0cbf=function(_0x2c5cc5,_0x1c9789){_0x2c5cc5=_0x2c5cc5-0x0;var _0x56aa0c=_0xcbf0[_0x2c5cc5];return _0x56aa0c;};'use strict';var MailQueueEvents=require(_0x0cbf('0x0'));var events=[_0x0cbf('0x1'),_0x0cbf('0x2'),_0x0cbf('0x3')];function createListener(_0x507948,_0x55d052){return function(_0x415e3d){_0x55d052[_0x0cbf('0x4')](_0x507948,_0x415e3d);};}function removeListener(_0x116ab1,_0x36cbc9){return function(){MailQueueEvents[_0x0cbf('0x5')](_0x116ab1,_0x36cbc9);};}exports[_0x0cbf('0x6')]=function(_0x45f816){for(var _0x4c97cd=0x0,_0x4996b0=events['length'];_0x4c97cd<_0x4996b0;_0x4c97cd++){var _0x17afd6=events[_0x4c97cd];var _0x4a91d8=createListener(_0x0cbf('0x7')+_0x17afd6,_0x45f816);MailQueueEvents['on'](_0x17afd6,_0x4a91d8);}}; \ No newline at end of file +var _0x4e52=['remove','update','emit','register','length','mailQueue:','./mailQueue.events','save'];(function(_0x13a64f,_0x3cae8c){var _0x1b5173=function(_0x56d5c6){while(--_0x56d5c6){_0x13a64f['push'](_0x13a64f['shift']());}};_0x1b5173(++_0x3cae8c);}(_0x4e52,0x6e));var _0x24e5=function(_0xeef2da,_0x47593a){_0xeef2da=_0xeef2da-0x0;var _0x3f5109=_0x4e52[_0xeef2da];return _0x3f5109;};'use strict';var MailQueueEvents=require(_0x24e5('0x0'));var events=[_0x24e5('0x1'),_0x24e5('0x2'),_0x24e5('0x3')];function createListener(_0x2f104d,_0x51e148){return function(_0x1d669f){_0x51e148[_0x24e5('0x4')](_0x2f104d,_0x1d669f);};}function removeListener(_0x860b70,_0x37bbd4){return function(){MailQueueEvents['removeListener'](_0x860b70,_0x37bbd4);};}exports[_0x24e5('0x5')]=function(_0x10f78d){for(var _0x539a1a=0x0,_0x43d53a=events[_0x24e5('0x6')];_0x539a1a<_0x43d53a;_0x539a1a++){var _0x2acfae=events[_0x539a1a];var _0x172210=createListener(_0x24e5('0x7')+_0x2acfae,_0x10f78d);MailQueueEvents['on'](_0x2acfae,_0x172210);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index a4d01fa..fac17f6 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 _0xf5c4=['get','/describe','show','create','put','/:id','update','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated'];(function(_0x16a637,_0x5eb627){var _0x25126d=function(_0x54e016){while(--_0x54e016){_0x16a637['push'](_0x16a637['shift']());}};_0x25126d(++_0x5eb627);}(_0xf5c4,0xab));var _0x4f5c=function(_0x332551,_0x21bdc3){_0x332551=_0x332551-0x0;var _0x5f26b5=_0xf5c4[_0x332551];return _0x5f26b5;};'use strict';var multer=require(_0x4f5c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f5c('0x1'));var express=require(_0x4f5c('0x2'));var router=express['Router']();var fs_extra=require(_0x4f5c('0x3'));var auth=require(_0x4f5c('0x4'));var interaction=require(_0x4f5c('0x5'));var config=require(_0x4f5c('0x6'));var controller=require(_0x4f5c('0x7'));router['get']('/',auth[_0x4f5c('0x8')](),controller['index']);router[_0x4f5c('0x9')](_0x4f5c('0xa'),auth[_0x4f5c('0x8')](),controller['describe']);router[_0x4f5c('0x9')]('/:id',auth[_0x4f5c('0x8')](),controller[_0x4f5c('0xb')]);router['post']('/',auth[_0x4f5c('0x8')](),controller[_0x4f5c('0xc')]);router[_0x4f5c('0xd')](_0x4f5c('0xe'),auth[_0x4f5c('0x8')](),controller[_0x4f5c('0xf')]);router['delete']('/:id',auth[_0x4f5c('0x8')](),controller[_0x4f5c('0x10')]);module[_0x4f5c('0x11')]=router; \ No newline at end of file +var _0xf6f6=['Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','index','describe','post','isAuthenticated','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x3b79aa,_0x380f92){var _0x3f5d04=function(_0x23eec8){while(--_0x23eec8){_0x3b79aa['push'](_0x3b79aa['shift']());}};_0x3f5d04(++_0x380f92);}(_0xf6f6,0xd8));var _0x6f6f=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0xf6f6[_0x35181c];return _0xe14bf9;};'use strict';var multer=require(_0x6f6f('0x0'));var util=require(_0x6f6f('0x1'));var path=require(_0x6f6f('0x2'));var timeout=require(_0x6f6f('0x3'));var express=require('express');var router=express[_0x6f6f('0x4')]();var fs_extra=require(_0x6f6f('0x5'));var auth=require(_0x6f6f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6f6f('0x7'));var controller=require(_0x6f6f('0x8'));router[_0x6f6f('0x9')]('/',auth['isAuthenticated'](),controller[_0x6f6f('0xa')]);router[_0x6f6f('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x6f6f('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6f6f('0xc')]('/',auth[_0x6f6f('0xd')](),controller[_0x6f6f('0xe')]);router[_0x6f6f('0xf')](_0x6f6f('0x10'),auth[_0x6f6f('0xd')](),controller[_0x6f6f('0x11')]);router[_0x6f6f('0x12')](_0x6f6f('0x10'),auth['isAuthenticated'](),controller[_0x6f6f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 4590667..dfbf5f4 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 _0x0c74=['DATE','sequelize','exports','STRING'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x0c74,0x1cd));var _0x40c7=function(_0x4057a1,_0x315235){_0x4057a1=_0x4057a1-0x0;var _0x12f4a3=_0x0c74[_0x4057a1];return _0x12f4a3;};'use strict';var moment=require('moment');var Sequelize=require(_0x40c7('0x0'));module[_0x40c7('0x1')]={'uniqueid':{'type':Sequelize[_0x40c7('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x40c7('0x2')]},'joinAt':{'type':Sequelize[_0x40c7('0x3')]},'leaveAt':{'type':Sequelize[_0x40c7('0x3')]},'acceptAt':{'type':Sequelize[_0x40c7('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x40c7('0x2')]}}; \ No newline at end of file +var _0x0b6b=['DATE','moment','STRING'];(function(_0x33bcdb,_0x11846b){var _0x18a9bf=function(_0x34417a){while(--_0x34417a){_0x33bcdb['push'](_0x33bcdb['shift']());}};_0x18a9bf(++_0x11846b);}(_0x0b6b,0xdf));var _0xb0b6=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x0b6b[_0x2283dc];return _0x16db90;};'use strict';var moment=require(_0xb0b6('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xb0b6('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xb0b6('0x1')]},'joinAt':{'type':Sequelize[_0xb0b6('0x2')]},'leaveAt':{'type':Sequelize[_0xb0b6('0x2')]},'acceptAt':{'type':Sequelize[_0xb0b6('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 5ad2ea6..362d851 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 _0x8e3f=['save','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','filter','options','MailQueueReport','includeAll','include','findAll','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8e3f[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xf8e3('0x0'));var rimraf=require(_0xf8e3('0x1'));var zipdir=require(_0xf8e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8e3('0x3'));var moment=require(_0xf8e3('0x4'));var BPromise=require(_0xf8e3('0x5'));var Mustache=require('mustache');var util=require(_0xf8e3('0x6'));var path=require(_0xf8e3('0x7'));var sox=require('sox');var csv=require(_0xf8e3('0x8'));var ejs=require(_0xf8e3('0x9'));var fs=require('fs');var fs_extra=require(_0xf8e3('0xa'));var _=require(_0xf8e3('0xb'));var squel=require('squel');var crypto=require(_0xf8e3('0xc'));var jsforce=require(_0xf8e3('0xd'));var deskjs=require(_0xf8e3('0xe'));var toCsv=require(_0xf8e3('0x8'));var querystring=require(_0xf8e3('0xf'));var Papa=require(_0xf8e3('0x10'));var Redis=require(_0xf8e3('0x11'));var authService=require(_0xf8e3('0x12'));var qs=require(_0xf8e3('0x13'));var as=require(_0xf8e3('0x14'));var hardwareService=require(_0xf8e3('0x15'));var logger=require(_0xf8e3('0x16'))('api');var utils=require(_0xf8e3('0x17'));var config=require(_0xf8e3('0x18'));var licenseUtil=require(_0xf8e3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40ae02,_0x41f85e){_0x41f85e=_0x41f85e||0xcc;return function(_0x336790){if(_0x336790){return _0x40ae02[_0xf8e3('0x1a')](_0x41f85e);}return _0x40ae02['status'](_0x41f85e)[_0xf8e3('0x1b')]();};}function respondWithResult(_0xa856f5,_0x2fe631){_0x2fe631=_0x2fe631||0xc8;return function(_0x4af736){if(_0x4af736){return _0xa856f5[_0xf8e3('0x1c')](_0x2fe631)['json'](_0x4af736);}};}function respondWithFilteredResult(_0x1ec773,_0x40c196){return function(_0x460629){if(_0x460629){var _0x570ee3=typeof _0x40c196['offset']===_0xf8e3('0x1d')&&typeof _0x40c196[_0xf8e3('0x1e')]===_0xf8e3('0x1d');var _0x3b01ac=_0x460629[_0xf8e3('0x1f')];var _0x11d4cc=_0x570ee3?0x0:_0x40c196[_0xf8e3('0x20')];var _0x2e27e3=_0x570ee3?_0x460629[_0xf8e3('0x1f')]:_0x40c196[_0xf8e3('0x20')]+_0x40c196['limit'];var _0x20cc64;if(_0x2e27e3>=_0x3b01ac){_0x2e27e3=_0x3b01ac;_0x20cc64=0xc8;}else{_0x20cc64=0xce;}_0x1ec773[_0xf8e3('0x1c')](_0x20cc64);return _0x1ec773[_0xf8e3('0x21')](_0xf8e3('0x22'),_0x11d4cc+'-'+_0x2e27e3+'/'+_0x3b01ac)[_0xf8e3('0x23')](_0x460629);}return null;};}function patchUpdates(_0x11c58e){return function(_0x1cae53){try{jsonpatch[_0xf8e3('0x24')](_0x1cae53,_0x11c58e,!![]);}catch(_0x5b99b1){return BPromise[_0xf8e3('0x25')](_0x5b99b1);}return _0x1cae53[_0xf8e3('0x26')]();};}function saveUpdates(_0x3c636d,_0xccbcc0){return function(_0x4a1e5f){if(_0x4a1e5f){return _0x4a1e5f[_0xf8e3('0x27')](_0x3c636d)['then'](function(_0x286059){return _0x286059;});}return null;};}function removeEntity(_0x225a1b,_0x33d526){return function(_0x2dc856){if(_0x2dc856){return _0x2dc856[_0xf8e3('0x28')]()[_0xf8e3('0x29')](function(){_0x225a1b['status'](0xcc)[_0xf8e3('0x1b')]();});}};}function handleEntityNotFound(_0x2fc674,_0x3373ca){return function(_0x417b42){if(!_0x417b42){_0x2fc674[_0xf8e3('0x1a')](0x194);}return _0x417b42;};}function handleError(_0x3b41a1,_0x2963ed){_0x2963ed=_0x2963ed||0x1f4;return function(_0x157a2d){logger['error'](_0x157a2d[_0xf8e3('0x2a')]);if(_0x157a2d[_0xf8e3('0x2b')]){delete _0x157a2d[_0xf8e3('0x2b')];}_0x3b41a1[_0xf8e3('0x1c')](_0x2963ed)[_0xf8e3('0x2c')](_0x157a2d);};}exports[_0xf8e3('0x2d')]=function(_0x16485e,_0xfaf15d){var _0x4f2ae9={},_0x21e1c0={},_0x243e28={'count':0x0,'rows':[]};var _0x492694=_[_0xf8e3('0x2e')](db['MailQueueReport'][_0xf8e3('0x2f')],function(_0x10cf28){return{'name':_0x10cf28[_0xf8e3('0x30')],'type':_0x10cf28[_0xf8e3('0x31')][_0xf8e3('0x32')]};});_0x21e1c0[_0xf8e3('0x33')]=_[_0xf8e3('0x2e')](_0x492694,_0xf8e3('0x2b'));_0x21e1c0['query']=_[_0xf8e3('0x34')](_0x16485e[_0xf8e3('0x35')]);_0x21e1c0['filters']=_['intersection'](_0x21e1c0['model'],_0x21e1c0[_0xf8e3('0x35')]);_0x4f2ae9['attributes']=_[_0xf8e3('0x36')](_0x21e1c0[_0xf8e3('0x33')],qs[_0xf8e3('0x37')](_0x16485e[_0xf8e3('0x35')]['fields']));_0x4f2ae9['attributes']=_0x4f2ae9[_0xf8e3('0x38')][_0xf8e3('0x39')]?_0x4f2ae9[_0xf8e3('0x38')]:_0x21e1c0[_0xf8e3('0x33')];if(!_0x16485e[_0xf8e3('0x35')][_0xf8e3('0x3a')]('nolimit')){_0x4f2ae9[_0xf8e3('0x1e')]=qs['limit'](_0x16485e['query'][_0xf8e3('0x1e')]);_0x4f2ae9[_0xf8e3('0x20')]=qs[_0xf8e3('0x20')](_0x16485e[_0xf8e3('0x35')]['offset']);}_0x4f2ae9['order']=qs[_0xf8e3('0x3b')](_0x16485e[_0xf8e3('0x35')]['sort']);_0x4f2ae9[_0xf8e3('0x3c')]=qs[_0xf8e3('0x3d')](_[_0xf8e3('0x3e')](_0x16485e[_0xf8e3('0x35')],_0x21e1c0['filters']),_0x492694);if(_0x16485e['query']['filter']){_0x4f2ae9[_0xf8e3('0x3c')]=_[_0xf8e3('0x3f')](_0x4f2ae9[_0xf8e3('0x3c')],{'$or':_[_0xf8e3('0x2e')](_0x492694,function(_0x53160a){if(_0x53160a[_0xf8e3('0x31')]!=='VIRTUAL'){var _0x20909b={};_0x20909b[_0x53160a[_0xf8e3('0x2b')]]={'$like':'%'+_0x16485e[_0xf8e3('0x35')][_0xf8e3('0x40')]+'%'};return _0x20909b;}})});}_0x4f2ae9=_[_0xf8e3('0x3f')]({},_0x4f2ae9,_0x16485e[_0xf8e3('0x41')]);var _0x82e778={'where':_0x4f2ae9[_0xf8e3('0x3c')]};return db[_0xf8e3('0x42')]['count'](_0x82e778)[_0xf8e3('0x29')](function(_0x537089){_0x243e28[_0xf8e3('0x1f')]=_0x537089;if(_0x16485e[_0xf8e3('0x35')][_0xf8e3('0x43')]){_0x4f2ae9[_0xf8e3('0x44')]=[{'all':!![]}];}return db[_0xf8e3('0x42')][_0xf8e3('0x45')](_0x4f2ae9);})[_0xf8e3('0x29')](function(_0x2f05b7){_0x243e28['rows']=_0x2f05b7;return _0x243e28;})[_0xf8e3('0x29')](respondWithFilteredResult(_0xfaf15d,_0x4f2ae9))[_0xf8e3('0x46')](handleError(_0xfaf15d,null));};exports[_0xf8e3('0x47')]=function(_0x382dbb,_0x6dd110){var _0xe7fcb9={'raw':!![],'where':{'id':_0x382dbb[_0xf8e3('0x48')]['id']}},_0x792190={};_0x792190['model']=_['keys'](db['MailQueueReport'][_0xf8e3('0x2f')]);_0x792190[_0xf8e3('0x35')]=_['keys'](_0x382dbb[_0xf8e3('0x35')]);_0x792190['filters']=_[_0xf8e3('0x36')](_0x792190[_0xf8e3('0x33')],_0x792190['query']);_0xe7fcb9[_0xf8e3('0x38')]=_['intersection'](_0x792190[_0xf8e3('0x33')],qs[_0xf8e3('0x37')](_0x382dbb['query'][_0xf8e3('0x37')]));_0xe7fcb9[_0xf8e3('0x38')]=_0xe7fcb9[_0xf8e3('0x38')][_0xf8e3('0x39')]?_0xe7fcb9['attributes']:_0x792190['model'];if(_0x382dbb['query'][_0xf8e3('0x43')]){_0xe7fcb9[_0xf8e3('0x44')]=[{'all':!![]}];}_0xe7fcb9=_[_0xf8e3('0x3f')]({},_0xe7fcb9,_0x382dbb['options']);return db[_0xf8e3('0x42')]['find'](_0xe7fcb9)[_0xf8e3('0x29')](handleEntityNotFound(_0x6dd110,null))[_0xf8e3('0x29')](respondWithResult(_0x6dd110,null))['catch'](handleError(_0x6dd110,null));};exports['create']=function(_0x128234,_0x2939e6){return db[_0xf8e3('0x42')][_0xf8e3('0x49')](_0x128234[_0xf8e3('0x4a')],{})[_0xf8e3('0x29')](respondWithResult(_0x2939e6,0xc9))[_0xf8e3('0x46')](handleError(_0x2939e6,null));};exports[_0xf8e3('0x27')]=function(_0xdc2430,_0x81898e){if(_0xdc2430[_0xf8e3('0x4a')]['id']){delete _0xdc2430['body']['id'];}return db[_0xf8e3('0x42')][_0xf8e3('0x4b')]({'where':{'id':_0xdc2430[_0xf8e3('0x48')]['id']}})[_0xf8e3('0x29')](handleEntityNotFound(_0x81898e,null))[_0xf8e3('0x29')](saveUpdates(_0xdc2430[_0xf8e3('0x4a')],null))['then'](respondWithResult(_0x81898e,null))[_0xf8e3('0x46')](handleError(_0x81898e,null));};exports[_0xf8e3('0x28')]=function(_0x39caae,_0x3e60a6){return db[_0xf8e3('0x42')][_0xf8e3('0x4b')]({'where':{'id':_0x39caae['params']['id']}})[_0xf8e3('0x29')](handleEntityNotFound(_0x3e60a6,null))[_0xf8e3('0x29')](removeEntity(_0x3e60a6,null))[_0xf8e3('0x46')](handleError(_0x3e60a6,null));};exports[_0xf8e3('0x4c')]=function(_0x113404,_0x2fef16){return db['MailQueueReport'][_0xf8e3('0x4c')]()[_0xf8e3('0x29')](respondWithResult(_0x2fef16,null))[_0xf8e3('0x46')](handleError(_0x2fef16,null));}; \ No newline at end of file +var _0x6a55=['eml-format','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','update','then','destroy','end','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','fields','create','body','find','describe'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6a55,0xdb));var _0x56a5=function(_0x47a12a,_0x70f591){_0x47a12a=_0x47a12a-0x0;var _0x30cd40=_0x6a55[_0x47a12a];return _0x30cd40;};'use strict';var emlformat=require(_0x56a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x56a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x56a5('0x2'));var util=require('util');var path=require(_0x56a5('0x3'));var sox=require('sox');var csv=require(_0x56a5('0x4'));var ejs=require(_0x56a5('0x5'));var fs=require('fs');var fs_extra=require(_0x56a5('0x6'));var _=require(_0x56a5('0x7'));var squel=require(_0x56a5('0x8'));var crypto=require(_0x56a5('0x9'));var jsforce=require(_0x56a5('0xa'));var deskjs=require(_0x56a5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x56a5('0xc'));var Papa=require(_0x56a5('0xd'));var Redis=require(_0x56a5('0xe'));var authService=require(_0x56a5('0xf'));var qs=require(_0x56a5('0x10'));var as=require(_0x56a5('0x11'));var hardwareService=require(_0x56a5('0x12'));var logger=require(_0x56a5('0x13'))(_0x56a5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x56a5('0x15'));var db=require(_0x56a5('0x16'))['db'];function respondWithStatusCode(_0x2b9d7d,_0x1a9bf0){_0x1a9bf0=_0x1a9bf0||0xcc;return function(_0x2de420){if(_0x2de420){return _0x2b9d7d[_0x56a5('0x17')](_0x1a9bf0);}return _0x2b9d7d['status'](_0x1a9bf0)['end']();};}function respondWithResult(_0x3e3ff6,_0x1e416f){_0x1e416f=_0x1e416f||0xc8;return function(_0x176c7b){if(_0x176c7b){return _0x3e3ff6[_0x56a5('0x18')](_0x1e416f)[_0x56a5('0x19')](_0x176c7b);}};}function respondWithFilteredResult(_0x2db112,_0xe3091f){return function(_0x5c4028){if(_0x5c4028){var _0x360297=typeof _0xe3091f['offset']===_0x56a5('0x1a')&&typeof _0xe3091f['limit']===_0x56a5('0x1a');var _0x3f3e5b=_0x5c4028[_0x56a5('0x1b')];var _0x28fe74=_0x360297?0x0:_0xe3091f[_0x56a5('0x1c')];var _0x143f3d=_0x360297?_0x5c4028[_0x56a5('0x1b')]:_0xe3091f['offset']+_0xe3091f[_0x56a5('0x1d')];var _0x3db687;if(_0x143f3d>=_0x3f3e5b){_0x143f3d=_0x3f3e5b;_0x3db687=0xc8;}else{_0x3db687=0xce;}_0x2db112[_0x56a5('0x18')](_0x3db687);return _0x2db112[_0x56a5('0x1e')]('Content-Range',_0x28fe74+'-'+_0x143f3d+'/'+_0x3f3e5b)[_0x56a5('0x19')](_0x5c4028);}return null;};}function patchUpdates(_0x1fdb7a){return function(_0xa274f4){try{jsonpatch[_0x56a5('0x1f')](_0xa274f4,_0x1fdb7a,!![]);}catch(_0x155d3b){return BPromise['reject'](_0x155d3b);}return _0xa274f4['save']();};}function saveUpdates(_0x29f181,_0x1c4ab8){return function(_0x487505){if(_0x487505){return _0x487505[_0x56a5('0x20')](_0x29f181)[_0x56a5('0x21')](function(_0x615d49){return _0x615d49;});}return null;};}function removeEntity(_0x15d9f8,_0xe1ded0){return function(_0x616922){if(_0x616922){return _0x616922[_0x56a5('0x22')]()[_0x56a5('0x21')](function(){_0x15d9f8[_0x56a5('0x18')](0xcc)[_0x56a5('0x23')]();});}};}function handleEntityNotFound(_0xcf212,_0x2f203f){return function(_0x460bc2){if(!_0x460bc2){_0xcf212['sendStatus'](0x194);}return _0x460bc2;};}function handleError(_0x5c76a7,_0x2d8e68){_0x2d8e68=_0x2d8e68||0x1f4;return function(_0x42cd45){logger[_0x56a5('0x24')](_0x42cd45[_0x56a5('0x25')]);if(_0x42cd45['name']){delete _0x42cd45[_0x56a5('0x26')];}_0x5c76a7['status'](_0x2d8e68)[_0x56a5('0x27')](_0x42cd45);};}exports[_0x56a5('0x28')]=function(_0x1b27b5,_0x284ee5){var _0x4e7afd={},_0x3b55e6={},_0x1f7aeb={'count':0x0,'rows':[]};var _0x178f11=_['map'](db[_0x56a5('0x29')][_0x56a5('0x2a')],function(_0xeb4378){return{'name':_0xeb4378[_0x56a5('0x2b')],'type':_0xeb4378[_0x56a5('0x2c')]['key']};});_0x3b55e6[_0x56a5('0x2d')]=_[_0x56a5('0x2e')](_0x178f11,_0x56a5('0x26'));_0x3b55e6[_0x56a5('0x2f')]=_[_0x56a5('0x30')](_0x1b27b5['query']);_0x3b55e6['filters']=_[_0x56a5('0x31')](_0x3b55e6[_0x56a5('0x2d')],_0x3b55e6[_0x56a5('0x2f')]);_0x4e7afd['attributes']=_[_0x56a5('0x31')](_0x3b55e6[_0x56a5('0x2d')],qs['fields'](_0x1b27b5['query']['fields']));_0x4e7afd['attributes']=_0x4e7afd[_0x56a5('0x32')][_0x56a5('0x33')]?_0x4e7afd[_0x56a5('0x32')]:_0x3b55e6['model'];if(!_0x1b27b5[_0x56a5('0x2f')]['hasOwnProperty'](_0x56a5('0x34'))){_0x4e7afd[_0x56a5('0x1d')]=qs['limit'](_0x1b27b5[_0x56a5('0x2f')]['limit']);_0x4e7afd[_0x56a5('0x1c')]=qs[_0x56a5('0x1c')](_0x1b27b5[_0x56a5('0x2f')]['offset']);}_0x4e7afd[_0x56a5('0x35')]=qs[_0x56a5('0x36')](_0x1b27b5[_0x56a5('0x2f')]['sort']);_0x4e7afd[_0x56a5('0x37')]=qs[_0x56a5('0x38')](_[_0x56a5('0x39')](_0x1b27b5[_0x56a5('0x2f')],_0x3b55e6[_0x56a5('0x38')]),_0x178f11);if(_0x1b27b5['query']['filter']){_0x4e7afd[_0x56a5('0x37')]=_[_0x56a5('0x3a')](_0x4e7afd[_0x56a5('0x37')],{'$or':_[_0x56a5('0x2e')](_0x178f11,function(_0xbf2db6){if(_0xbf2db6[_0x56a5('0x2c')]!==_0x56a5('0x3b')){var _0x652028={};_0x652028[_0xbf2db6[_0x56a5('0x26')]]={'$like':'%'+_0x1b27b5[_0x56a5('0x2f')][_0x56a5('0x3c')]+'%'};return _0x652028;}})});}_0x4e7afd=_[_0x56a5('0x3a')]({},_0x4e7afd,_0x1b27b5[_0x56a5('0x3d')]);var _0x389c01={'where':_0x4e7afd[_0x56a5('0x37')]};return db[_0x56a5('0x29')][_0x56a5('0x1b')](_0x389c01)[_0x56a5('0x21')](function(_0xf0f6c8){_0x1f7aeb[_0x56a5('0x1b')]=_0xf0f6c8;if(_0x1b27b5[_0x56a5('0x2f')][_0x56a5('0x3e')]){_0x4e7afd['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x56a5('0x3f')](_0x4e7afd);})['then'](function(_0x7c3c3e){_0x1f7aeb[_0x56a5('0x40')]=_0x7c3c3e;return _0x1f7aeb;})[_0x56a5('0x21')](respondWithFilteredResult(_0x284ee5,_0x4e7afd))[_0x56a5('0x41')](handleError(_0x284ee5,null));};exports[_0x56a5('0x42')]=function(_0x1160da,_0x5618f9){var _0x5c565a={'raw':!![],'where':{'id':_0x1160da[_0x56a5('0x43')]['id']}},_0x29ab9b={};_0x29ab9b[_0x56a5('0x2d')]=_[_0x56a5('0x30')](db[_0x56a5('0x29')][_0x56a5('0x2a')]);_0x29ab9b['query']=_[_0x56a5('0x30')](_0x1160da[_0x56a5('0x2f')]);_0x29ab9b['filters']=_[_0x56a5('0x31')](_0x29ab9b[_0x56a5('0x2d')],_0x29ab9b[_0x56a5('0x2f')]);_0x5c565a[_0x56a5('0x32')]=_['intersection'](_0x29ab9b[_0x56a5('0x2d')],qs['fields'](_0x1160da[_0x56a5('0x2f')][_0x56a5('0x44')]));_0x5c565a['attributes']=_0x5c565a[_0x56a5('0x32')]['length']?_0x5c565a[_0x56a5('0x32')]:_0x29ab9b[_0x56a5('0x2d')];if(_0x1160da['query'][_0x56a5('0x3e')]){_0x5c565a['include']=[{'all':!![]}];}_0x5c565a=_[_0x56a5('0x3a')]({},_0x5c565a,_0x1160da['options']);return db[_0x56a5('0x29')]['find'](_0x5c565a)[_0x56a5('0x21')](handleEntityNotFound(_0x5618f9,null))[_0x56a5('0x21')](respondWithResult(_0x5618f9,null))[_0x56a5('0x41')](handleError(_0x5618f9,null));};exports[_0x56a5('0x45')]=function(_0x30d377,_0x43196d){return db[_0x56a5('0x29')]['create'](_0x30d377['body'],{})['then'](respondWithResult(_0x43196d,0xc9))[_0x56a5('0x41')](handleError(_0x43196d,null));};exports[_0x56a5('0x20')]=function(_0x1e510a,_0x55d2e2){if(_0x1e510a[_0x56a5('0x46')]['id']){delete _0x1e510a[_0x56a5('0x46')]['id'];}return db[_0x56a5('0x29')]['find']({'where':{'id':_0x1e510a[_0x56a5('0x43')]['id']}})[_0x56a5('0x21')](handleEntityNotFound(_0x55d2e2,null))['then'](saveUpdates(_0x1e510a[_0x56a5('0x46')],null))[_0x56a5('0x21')](respondWithResult(_0x55d2e2,null))[_0x56a5('0x41')](handleError(_0x55d2e2,null));};exports[_0x56a5('0x22')]=function(_0xcb3cb9,_0x58d308){return db[_0x56a5('0x29')][_0x56a5('0x47')]({'where':{'id':_0xcb3cb9[_0x56a5('0x43')]['id']}})[_0x56a5('0x21')](handleEntityNotFound(_0x58d308,null))[_0x56a5('0x21')](removeEntity(_0x58d308,null))['catch'](handleError(_0x58d308,null));};exports[_0x56a5('0x48')]=function(_0x3bda32,_0x597e52){return db[_0x56a5('0x29')][_0x56a5('0x48')]()[_0x56a5('0x21')](respondWithResult(_0x597e52,null))['catch'](handleError(_0x597e52,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index d3e99eb..dc8e2cd 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 _0xd805=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','MailQueueReport','report_mail_queue','uniqueid','util'];(function(_0x43f967,_0xb4b42d){var _0xfd6032=function(_0x37be33){while(--_0x37be33){_0x43f967['push'](_0x43f967['shift']());}};_0xfd6032(++_0xb4b42d);}(_0xd805,0xcb));var _0x5d80=function(_0x3730b1,_0x28a04b){_0x3730b1=_0x3730b1-0x0;var _0x2a75db=_0xd805[_0x3730b1];return _0x2a75db;};'use strict';var _=require('lodash');var util=require(_0x5d80('0x0'));var logger=require(_0x5d80('0x1'))(_0x5d80('0x2'));var moment=require(_0x5d80('0x3'));var BPromise=require('bluebird');var rp=require(_0x5d80('0x4'));var fs=require('fs');var path=require(_0x5d80('0x5'));var rimraf=require(_0x5d80('0x6'));var config=require(_0x5d80('0x7'));var attributes=require(_0x5d80('0x8'));module['exports']=function(_0x4cc8b1,_0x242e87){return _0x4cc8b1['define'](_0x5d80('0x9'),attributes,{'tableName':_0x5d80('0xa'),'paranoid':![],'indexes':[{'name':_0x5d80('0xb'),'fields':[_0x5d80('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb74=['request-promise','path','rimraf','../../config/environment','exports','define','report_mail_queue','lodash','util','../../config/logger','api','moment'];(function(_0x29dd61,_0x115987){var _0x2cfb02=function(_0x4bbe1d){while(--_0x4bbe1d){_0x29dd61['push'](_0x29dd61['shift']());}};_0x2cfb02(++_0x115987);}(_0xcb74,0x7f));var _0x4cb7=function(_0x38d5ea,_0x53232e){_0x38d5ea=_0x38d5ea-0x0;var _0x2e5651=_0xcb74[_0x38d5ea];return _0x2e5651;};'use strict';var _=require(_0x4cb7('0x0'));var util=require(_0x4cb7('0x1'));var logger=require(_0x4cb7('0x2'))(_0x4cb7('0x3'));var moment=require(_0x4cb7('0x4'));var BPromise=require('bluebird');var rp=require(_0x4cb7('0x5'));var fs=require('fs');var path=require(_0x4cb7('0x6'));var rimraf=require(_0x4cb7('0x7'));var config=require(_0x4cb7('0x8'));var attributes=require('./mailQueueReport.attributes');module[_0x4cb7('0x9')]=function(_0x628ae0,_0x458678){return _0x628ae0[_0x4cb7('0xa')]('MailQueueReport',attributes,{'tableName':_0x4cb7('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 20e5ecd..18ed4f9 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x3e49be,_0x32573b){var _0x3c0873=function(_0x4e3d9f){while(--_0x4e3d9f){_0x3e49be['push'](_0x3e49be['shift']());}};_0x3c0873(++_0x32573b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x33eefe,_0x1ecaa1){var _0xa92adb=function(_0x25f6a8){while(--_0x25f6a8){_0x33eefe['push'](_0x33eefe['shift']());}};_0xa92adb(++_0x1ecaa1);}(_0x7a54,0x106));var _0x47a5=function(_0x3c277a,_0x230771){_0x3c277a=_0x3c277a-0x0;var _0x154bcb=_0x7a54[_0x3c277a];return _0x154bcb;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=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')]('CreateMailQueueReport',_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')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index b7d77d0..684703d 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3066cd,_0x466065){var _0x314f63=function(_0xb95b6a){while(--_0xb95b6a){_0x3066cd['push'](_0x3066cd['shift']());}};_0x314f63(++_0x466065);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 1ca7422..c1c7cf0 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 _0x51f4=['exports','STRING','INTEGER','BOOLEAN','INBOX','sequelize'];(function(_0x305875,_0x21022c){var _0x7e987=function(_0x1fce03){while(--_0x1fce03){_0x305875['push'](_0x305875['shift']());}};_0x7e987(++_0x21022c);}(_0x51f4,0x10d));var _0x451f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x51f4[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x451f('0x0'));module[_0x451f('0x1')]={'description':{'type':Sequelize[_0x451f('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x451f('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x451f('0x3')]},'tls':{'type':Sequelize[_0x451f('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x451f('0x2')],'defaultValue':_0x451f('0x5')},'connTimeout':{'type':Sequelize[_0x451f('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x451f('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x451f('0x2')]},'modernAuthentication':{'type':Sequelize[_0x451f('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xb724=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xb724,0x19f));var _0x4b72=function(_0x4cf742,_0x4cf7a3){_0x4cf742=_0x4cf742-0x0;var _0x496998=_0xb724[_0x4cf742];return _0x496998;};'use strict';var Sequelize=require(_0x4b72('0x0'));module[_0x4b72('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x4b72('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x4b72('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x4b72('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4b72('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x4b72('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x4b72('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x4b72('0x2')]},'modernAuthentication':{'type':Sequelize[_0x4b72('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index c25af69..791620c 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 _0xda6e=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes','define','mail_servers_in'];(function(_0xf65df5,_0x4f8a9f){var _0x90fac=function(_0x568b4c){while(--_0x568b4c){_0xf65df5['push'](_0xf65df5['shift']());}};_0x90fac(++_0x4f8a9f);}(_0xda6e,0x118));var _0xeda6=function(_0x3594bb,_0x2758c4){_0x3594bb=_0x3594bb-0x0;var _0x783930=_0xda6e[_0x3594bb];return _0x783930;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeda6('0x0'))(_0xeda6('0x1'));var moment=require(_0xeda6('0x2'));var BPromise=require(_0xeda6('0x3'));var rp=require(_0xeda6('0x4'));var fs=require('fs');var path=require(_0xeda6('0x5'));var rimraf=require('rimraf');var config=require(_0xeda6('0x6'));var attributes=require(_0xeda6('0x7'));module['exports']=function(_0x341472,_0x5c3f7b){return _0x341472[_0xeda6('0x8')]('MailServerIn',attributes,{'tableName':_0xeda6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3b6=['moment','bluebird','request-promise','path','rimraf','exports','define','mail_servers_in','lodash','util','../../config/logger'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0xe3b6,0x11b));var _0x6e3b=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xe3b6[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0x6e3b('0x0'));var util=require(_0x6e3b('0x1'));var logger=require(_0x6e3b('0x2'))('api');var moment=require(_0x6e3b('0x3'));var BPromise=require(_0x6e3b('0x4'));var rp=require(_0x6e3b('0x5'));var fs=require('fs');var path=require(_0x6e3b('0x6'));var rimraf=require(_0x6e3b('0x7'));var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0x6e3b('0x8')]=function(_0x3b46d8,_0x51af35){return _0x3b46d8[_0x6e3b('0x9')]('MailServerIn',attributes,{'tableName':_0x6e3b('0xa'),'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 c63d88e..ad1c744 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 _0x3140=['include','map','model','then','GetMailServerIn','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','catch','MailServerIn','findAll','options','where','attributes','limit'];(function(_0x53f0fd,_0x48fa41){var _0x416a85=function(_0x37b2c2){while(--_0x37b2c2){_0x53f0fd['push'](_0x53f0fd['shift']());}};_0x416a85(++_0x48fa41);}(_0x3140,0xaf));var _0x0314=function(_0x56d1b7,_0x1d88f5){_0x56d1b7=_0x56d1b7-0x0;var _0x184d91=_0x3140[_0x56d1b7];return _0x184d91;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var moment=require(_0x0314('0x2'));var BPromise=require(_0x0314('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0314('0x4'))['db'];var utils=require(_0x0314('0x5'));var logger=require(_0x0314('0x6'))(_0x0314('0x7'));var config=require(_0x0314('0x8'));var jayson=require(_0x0314('0x9'));var client=jayson[_0x0314('0xa')][_0x0314('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ee94,_0x44762d,_0x176944){return new BPromise(function(_0x495b27,_0x26031f){return client[_0x0314('0xc')](_0x11ee94,_0x176944)['then'](function(_0x5e9bca){logger[_0x0314('0xd')]('MailServerIn,\x20%s,\x20%s',_0x44762d,_0x0314('0xe'));logger[_0x0314('0xf')](_0x0314('0x10'),_0x44762d,_0x0314('0xe'),JSON[_0x0314('0x11')](_0x5e9bca));if(_0x5e9bca[_0x0314('0x12')]){if(_0x5e9bca['error'][_0x0314('0x13')]===0x1f4){logger[_0x0314('0x12')](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x26031f(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}logger['error'](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x495b27(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}else{logger[_0x0314('0xd')](_0x0314('0x14'),_0x44762d,_0x0314('0xe'));_0x495b27(_0x5e9bca['result'][_0x0314('0x15')]);}})[_0x0314('0x16')](function(_0x1f23c6){logger['error'](_0x0314('0x14'),_0x44762d,_0x1f23c6);_0x26031f(_0x1f23c6);});});}exports['GetMailServerIn']=function(_0x575b68){var _0x39db0b=this;return new Promise(function(_0x329679,_0x583d39){return db[_0x0314('0x17')][_0x0314('0x18')]({'raw':_0x575b68['options']?_0x575b68[_0x0314('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x575b68[_0x0314('0x19')]?_0x575b68[_0x0314('0x19')][_0x0314('0x1a')]||null:null,'attributes':_0x575b68[_0x0314('0x19')]?_0x575b68[_0x0314('0x19')][_0x0314('0x1b')]||null:null,'limit':_0x575b68['options']?_0x575b68['options'][_0x0314('0x1c')]||null:null,'include':_0x575b68[_0x0314('0x19')]?_0x575b68[_0x0314('0x19')][_0x0314('0x1d')]?_[_0x0314('0x1e')](_0x575b68[_0x0314('0x19')]['include'],function(_0x3c743e){return{'model':db[_0x3c743e[_0x0314('0x1f')]],'as':_0x3c743e['as'],'attributes':_0x3c743e['attributes'],'include':_0x3c743e[_0x0314('0x1d')]?_[_0x0314('0x1e')](_0x3c743e[_0x0314('0x1d')],function(_0x26c6a4){return{'model':db[_0x26c6a4[_0x0314('0x1f')]],'as':_0x26c6a4['as'],'attributes':_0x26c6a4[_0x0314('0x1b')],'include':_0x26c6a4['include']?_[_0x0314('0x1e')](_0x26c6a4[_0x0314('0x1d')],function(_0x2d636b){return{'model':db[_0x2d636b['model']],'as':_0x2d636b['as'],'attributes':_0x2d636b[_0x0314('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0314('0x20')](function(_0x47c102){logger['info'](_0x0314('0x21'),_0x575b68);logger[_0x0314('0xf')]('GetMailServerIn',_0x575b68,JSON[_0x0314('0x11')](_0x47c102));_0x329679(_0x47c102);})[_0x0314('0x16')](function(_0x5291c2){logger['error'](_0x0314('0x21'),_0x5291c2[_0x0314('0x15')],_0x575b68);_0x583d39(_0x39db0b['error'](0x1f4,_0x5291c2[_0x0314('0x15')]));});});}; \ No newline at end of file +var _0x407f=['attributes','debug','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','limit','map','include','model'];(function(_0x34a4b0,_0x3cad17){var _0x5cb84d=function(_0x36a2c0){while(--_0x36a2c0){_0x34a4b0['push'](_0x34a4b0['shift']());}};_0x5cb84d(++_0x3cad17);}(_0x407f,0xc2));var _0xf407=function(_0x3f37f1,_0x199544){_0x3f37f1=_0x3f37f1-0x0;var _0x216258=_0x407f[_0x3f37f1];return _0x216258;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf407('0x0'));var rs=require(_0xf407('0x1'));var fs=require('fs');var Redis=require(_0xf407('0x2'));var db=require(_0xf407('0x3'))['db'];var utils=require(_0xf407('0x4'));var logger=require(_0xf407('0x5'))(_0xf407('0x6'));var config=require(_0xf407('0x7'));var jayson=require(_0xf407('0x8'));var client=jayson[_0xf407('0x9')][_0xf407('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bce9d,_0x2d4ec6,_0x3ac774){return new BPromise(function(_0x38ee37,_0x3ab539){return client['request'](_0x2bce9d,_0x3ac774)[_0xf407('0xb')](function(_0xc3473a){logger[_0xf407('0xc')](_0xf407('0xd'),_0x2d4ec6,'request\x20sent');logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x2d4ec6,_0xf407('0xe'),JSON[_0xf407('0xf')](_0xc3473a));if(_0xc3473a[_0xf407('0x10')]){if(_0xc3473a[_0xf407('0x10')][_0xf407('0x11')]===0x1f4){logger['error'](_0xf407('0xd'),_0x2d4ec6,_0xc3473a[_0xf407('0x10')][_0xf407('0x12')]);return _0x3ab539(_0xc3473a[_0xf407('0x10')][_0xf407('0x12')]);}logger[_0xf407('0x10')](_0xf407('0xd'),_0x2d4ec6,_0xc3473a[_0xf407('0x10')]['message']);return _0x38ee37(_0xc3473a['error'][_0xf407('0x12')]);}else{logger['info'](_0xf407('0xd'),_0x2d4ec6,'request\x20sent');_0x38ee37(_0xc3473a['result'][_0xf407('0x12')]);}})[_0xf407('0x13')](function(_0x1cdc81){logger[_0xf407('0x10')](_0xf407('0xd'),_0x2d4ec6,_0x1cdc81);_0x3ab539(_0x1cdc81);});});}exports[_0xf407('0x14')]=function(_0x4ddbe6){var _0x2e346f=this;return new Promise(function(_0x588fe4,_0x128faf){return db[_0xf407('0x15')][_0xf407('0x16')]({'raw':_0x4ddbe6[_0xf407('0x17')]?_0x4ddbe6[_0xf407('0x17')][_0xf407('0x18')]===undefined?!![]:![]:!![],'where':_0x4ddbe6['options']?_0x4ddbe6[_0xf407('0x17')][_0xf407('0x19')]||null:null,'attributes':_0x4ddbe6[_0xf407('0x17')]?_0x4ddbe6[_0xf407('0x17')]['attributes']||null:null,'limit':_0x4ddbe6[_0xf407('0x17')]?_0x4ddbe6[_0xf407('0x17')][_0xf407('0x1a')]||null:null,'include':_0x4ddbe6[_0xf407('0x17')]?_0x4ddbe6['options']['include']?_[_0xf407('0x1b')](_0x4ddbe6[_0xf407('0x17')][_0xf407('0x1c')],function(_0x2cea00){return{'model':db[_0x2cea00[_0xf407('0x1d')]],'as':_0x2cea00['as'],'attributes':_0x2cea00[_0xf407('0x1e')],'include':_0x2cea00[_0xf407('0x1c')]?_['map'](_0x2cea00[_0xf407('0x1c')],function(_0x1996c8){return{'model':db[_0x1996c8[_0xf407('0x1d')]],'as':_0x1996c8['as'],'attributes':_0x1996c8['attributes'],'include':_0x1996c8[_0xf407('0x1c')]?_[_0xf407('0x1b')](_0x1996c8[_0xf407('0x1c')],function(_0x2c594a){return{'model':db[_0x2c594a[_0xf407('0x1d')]],'as':_0x2c594a['as'],'attributes':_0x2c594a[_0xf407('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3953c5){logger['info']('GetMailServerIn',_0x4ddbe6);logger[_0xf407('0x1f')](_0xf407('0x14'),_0x4ddbe6,JSON[_0xf407('0xf')](_0x3953c5));_0x588fe4(_0x3953c5);})[_0xf407('0x13')](function(_0x1c5335){logger[_0xf407('0x10')]('GetMailServerIn',_0x1c5335[_0xf407('0x12')],_0x4ddbe6);_0x128faf(_0x2e346f[_0xf407('0x10')](0x1f4,_0x1c5335[_0xf407('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 5fdadb1..1e00fbd 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(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +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(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x7a54,0x106));var _0x47a5=function(_0x491928,_0x34ae56){_0x491928=_0x491928-0x0;var _0x2aca3b=_0x7a54[_0x491928];return _0x2aca3b;};'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 43fe12c..f3a7f4a 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 _0xe2cf=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x15ceb9,_0x3bd34c){var _0x145606=function(_0x2bf411){while(--_0x2bf411){_0x15ceb9['push'](_0x15ceb9['shift']());}};_0x145606(++_0x3bd34c);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0xe3bb46,_0x4ba544){_0xe3bb46=_0xe3bb46-0x0;var _0x45001c=_0xe2cf[_0xe3bb46];return _0x45001c;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xfe2c('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xfe2c('0x1')]},'port':{'type':Sequelize[_0xfe2c('0x2')]},'secure':{'type':Sequelize[_0xfe2c('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xfe2c('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xfe2c('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x80ed=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x2709bd,_0x274e31){var _0x4b5d5c=function(_0x5f3a3b){while(--_0x5f3a3b){_0x2709bd['push'](_0x2709bd['shift']());}};_0x4b5d5c(++_0x274e31);}(_0x80ed,0x11c));var _0xd80e=function(_0x334679,_0x5b6dad){_0x334679=_0x334679-0x0;var _0x1d8abd=_0x80ed[_0x334679];return _0x1d8abd;};'use strict';var Sequelize=require(_0xd80e('0x0'));module['exports']={'description':{'type':Sequelize[_0xd80e('0x1')]},'host':{'type':Sequelize[_0xd80e('0x1')]},'user':{'type':Sequelize[_0xd80e('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd80e('0x2')]},'secure':{'type':Sequelize[_0xd80e('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xd80e('0x1')]},'authentication':{'type':Sequelize[_0xd80e('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index efb9fb5..b97b877 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 _0x6671=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','MailServerOut','fieldName','type','key','filters','intersection','query','attributes','model','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','merge','options','find','create','body','zip-dir'];(function(_0xc3450e,_0x214a1f){var _0x195fc9=function(_0x2116e9){while(--_0x2116e9){_0xc3450e['push'](_0xc3450e['shift']());}};_0x195fc9(++_0x214a1f);}(_0x6671,0x1bb));var _0x1667=function(_0x5b2568,_0x186e15){_0x5b2568=_0x5b2568-0x0;var _0xa533a9=_0x6671[_0x5b2568];return _0xa533a9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1667('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1667('0x1'));var moment=require(_0x1667('0x2'));var BPromise=require(_0x1667('0x3'));var Mustache=require(_0x1667('0x4'));var util=require(_0x1667('0x5'));var path=require(_0x1667('0x6'));var sox=require(_0x1667('0x7'));var csv=require(_0x1667('0x8'));var ejs=require(_0x1667('0x9'));var fs=require('fs');var fs_extra=require(_0x1667('0xa'));var _=require('lodash');var squel=require(_0x1667('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1667('0xc'));var toCsv=require(_0x1667('0x8'));var querystring=require(_0x1667('0xd'));var Papa=require(_0x1667('0xe'));var Redis=require(_0x1667('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1667('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1667('0x11'))(_0x1667('0x12'));var utils=require('../../config/utils');var config=require(_0x1667('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x1667('0x14'))['db'];function respondWithStatusCode(_0x5c0be3,_0x39d3fb){_0x39d3fb=_0x39d3fb||0xcc;return function(_0x59d403){if(_0x59d403){return _0x5c0be3[_0x1667('0x15')](_0x39d3fb);}return _0x5c0be3[_0x1667('0x16')](_0x39d3fb)[_0x1667('0x17')]();};}function respondWithResult(_0x1c8086,_0x4291d9){_0x4291d9=_0x4291d9||0xc8;return function(_0x47761d){if(_0x47761d){return _0x1c8086[_0x1667('0x16')](_0x4291d9)['json'](_0x47761d);}};}function respondWithFilteredResult(_0x3c30eb,_0x5cd61c){return function(_0x4bd2b8){if(_0x4bd2b8){var _0x44c9a7=typeof _0x5cd61c[_0x1667('0x18')]===_0x1667('0x19')&&typeof _0x5cd61c[_0x1667('0x1a')]===_0x1667('0x19');var _0x165491=_0x4bd2b8[_0x1667('0x1b')];var _0x35e52a=_0x44c9a7?0x0:_0x5cd61c[_0x1667('0x18')];var _0x2ab251=_0x44c9a7?_0x4bd2b8[_0x1667('0x1b')]:_0x5cd61c[_0x1667('0x18')]+_0x5cd61c['limit'];var _0x59ed91;if(_0x2ab251>=_0x165491){_0x2ab251=_0x165491;_0x59ed91=0xc8;}else{_0x59ed91=0xce;}_0x3c30eb['status'](_0x59ed91);return _0x3c30eb[_0x1667('0x1c')](_0x1667('0x1d'),_0x35e52a+'-'+_0x2ab251+'/'+_0x165491)[_0x1667('0x1e')](_0x4bd2b8);}return null;};}function patchUpdates(_0x5c48ef){return function(_0xab3668){try{jsonpatch[_0x1667('0x1f')](_0xab3668,_0x5c48ef,!![]);}catch(_0x842883){return BPromise[_0x1667('0x20')](_0x842883);}return _0xab3668['save']();};}function saveUpdates(_0x426d19,_0x35138b){return function(_0x45f34b){if(_0x45f34b){return _0x45f34b[_0x1667('0x21')](_0x426d19)['then'](function(_0x2250b1){return _0x2250b1;});}return null;};}function removeEntity(_0x1afb62,_0xb4d74f){return function(_0x54edc9){if(_0x54edc9){return _0x54edc9[_0x1667('0x22')]()[_0x1667('0x23')](function(){_0x1afb62[_0x1667('0x16')](0xcc)[_0x1667('0x17')]();});}};}function handleEntityNotFound(_0x335b32,_0x1922d5){return function(_0x13505e){if(!_0x13505e){_0x335b32[_0x1667('0x15')](0x194);}return _0x13505e;};}function handleError(_0x7f81e3,_0xf20714){_0xf20714=_0xf20714||0x1f4;return function(_0x1b9c92){logger[_0x1667('0x24')](_0x1b9c92[_0x1667('0x25')]);if(_0x1b9c92[_0x1667('0x26')]){delete _0x1b9c92[_0x1667('0x26')];}_0x7f81e3[_0x1667('0x16')](_0xf20714)[_0x1667('0x27')](_0x1b9c92);};}exports[_0x1667('0x28')]=function(_0x15b8a4,_0x36b97f){var _0x4d36e2={},_0x486db1={},_0x571966={'count':0x0,'rows':[]};var _0x268b7a=_[_0x1667('0x29')](db[_0x1667('0x2a')]['rawAttributes'],function(_0x5c73a1){return{'name':_0x5c73a1[_0x1667('0x2b')],'type':_0x5c73a1[_0x1667('0x2c')][_0x1667('0x2d')]};});_0x486db1['model']=_[_0x1667('0x29')](_0x268b7a,_0x1667('0x26'));_0x486db1['query']=_['keys'](_0x15b8a4['query']);_0x486db1[_0x1667('0x2e')]=_[_0x1667('0x2f')](_0x486db1['model'],_0x486db1[_0x1667('0x30')]);_0x4d36e2[_0x1667('0x31')]=_[_0x1667('0x2f')](_0x486db1[_0x1667('0x32')],qs[_0x1667('0x33')](_0x15b8a4[_0x1667('0x30')][_0x1667('0x33')]));_0x4d36e2['attributes']=_0x4d36e2[_0x1667('0x31')]['length']?_0x4d36e2[_0x1667('0x31')]:_0x486db1[_0x1667('0x32')];if(!_0x15b8a4[_0x1667('0x30')][_0x1667('0x34')](_0x1667('0x35'))){_0x4d36e2[_0x1667('0x1a')]=qs[_0x1667('0x1a')](_0x15b8a4['query'][_0x1667('0x1a')]);_0x4d36e2[_0x1667('0x18')]=qs[_0x1667('0x18')](_0x15b8a4[_0x1667('0x30')]['offset']);}_0x4d36e2[_0x1667('0x36')]=qs[_0x1667('0x37')](_0x15b8a4[_0x1667('0x30')][_0x1667('0x37')]);_0x4d36e2['where']=qs['filters'](_['pick'](_0x15b8a4[_0x1667('0x30')],_0x486db1[_0x1667('0x2e')]),_0x268b7a);if(_0x15b8a4[_0x1667('0x30')][_0x1667('0x38')]){_0x4d36e2[_0x1667('0x39')]=_['merge'](_0x4d36e2[_0x1667('0x39')],{'$or':_[_0x1667('0x29')](_0x268b7a,function(_0x2206e3){if(_0x2206e3['type']!==_0x1667('0x3a')){var _0x3b752c={};_0x3b752c[_0x2206e3[_0x1667('0x26')]]={'$like':'%'+_0x15b8a4[_0x1667('0x30')][_0x1667('0x38')]+'%'};return _0x3b752c;}})});}_0x4d36e2=_['merge']({},_0x4d36e2,_0x15b8a4['options']);var _0x3c9201={'where':_0x4d36e2[_0x1667('0x39')]};return db[_0x1667('0x2a')][_0x1667('0x1b')](_0x3c9201)['then'](function(_0x4308cc){_0x571966[_0x1667('0x1b')]=_0x4308cc;if(_0x15b8a4[_0x1667('0x30')][_0x1667('0x3b')]){_0x4d36e2[_0x1667('0x3c')]=[{'all':!![]}];}return db[_0x1667('0x2a')][_0x1667('0x3d')](_0x4d36e2);})[_0x1667('0x23')](function(_0x425717){_0x571966[_0x1667('0x3e')]=_0x425717;return _0x571966;})['then'](respondWithFilteredResult(_0x36b97f,_0x4d36e2))[_0x1667('0x3f')](handleError(_0x36b97f,null));};exports[_0x1667('0x40')]=function(_0x2f4d75,_0x33b86c){var _0x5c4861={'raw':!![],'where':{'id':_0x2f4d75[_0x1667('0x41')]['id']}},_0x515161={};_0x515161['model']=_[_0x1667('0x42')](db[_0x1667('0x2a')][_0x1667('0x43')]);_0x515161[_0x1667('0x30')]=_[_0x1667('0x42')](_0x2f4d75[_0x1667('0x30')]);_0x515161[_0x1667('0x2e')]=_[_0x1667('0x2f')](_0x515161[_0x1667('0x32')],_0x515161[_0x1667('0x30')]);_0x5c4861['attributes']=_[_0x1667('0x2f')](_0x515161['model'],qs[_0x1667('0x33')](_0x2f4d75[_0x1667('0x30')]['fields']));_0x5c4861['attributes']=_0x5c4861['attributes'][_0x1667('0x44')]?_0x5c4861[_0x1667('0x31')]:_0x515161[_0x1667('0x32')];if(_0x2f4d75[_0x1667('0x30')]['includeAll']){_0x5c4861[_0x1667('0x3c')]=[{'all':!![]}];}_0x5c4861=_[_0x1667('0x45')]({},_0x5c4861,_0x2f4d75[_0x1667('0x46')]);return db[_0x1667('0x2a')][_0x1667('0x47')](_0x5c4861)[_0x1667('0x23')](handleEntityNotFound(_0x33b86c,null))['then'](respondWithResult(_0x33b86c,null))['catch'](handleError(_0x33b86c,null));};exports['create']=function(_0x2a64f8,_0x3bb2fa){return db[_0x1667('0x2a')][_0x1667('0x48')](_0x2a64f8[_0x1667('0x49')],{})[_0x1667('0x23')](respondWithResult(_0x3bb2fa,0xc9))[_0x1667('0x3f')](handleError(_0x3bb2fa,null));};exports[_0x1667('0x21')]=function(_0x41813b,_0x1c86c6){if(_0x41813b['body']['id']){delete _0x41813b[_0x1667('0x49')]['id'];}return db[_0x1667('0x2a')][_0x1667('0x47')]({'where':{'id':_0x41813b['params']['id']}})[_0x1667('0x23')](handleEntityNotFound(_0x1c86c6,null))[_0x1667('0x23')](saveUpdates(_0x41813b[_0x1667('0x49')],null))[_0x1667('0x23')](respondWithResult(_0x1c86c6,null))['catch'](handleError(_0x1c86c6,null));};exports[_0x1667('0x22')]=function(_0x3a0cc9,_0x41e821){return db['MailServerOut']['find']({'where':{'id':_0x3a0cc9[_0x1667('0x41')]['id']}})['then'](handleEntityNotFound(_0x41e821,null))[_0x1667('0x23')](removeEntity(_0x41e821,null))[_0x1667('0x3f')](handleError(_0x41e821,null));}; \ No newline at end of file +var _0x9d80=['desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','attributes','fields','length','nolimit','order','pick','filters','filter','where','merge','type','VIRTUAL','options','MailServerOut','count','includeAll','rows','params','intersection','include','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce'];(function(_0x2f5fdd,_0x4acb2a){var _0x214ffd=function(_0x56b0f4){while(--_0x56b0f4){_0x2f5fdd['push'](_0x2f5fdd['shift']());}};_0x214ffd(++_0x4acb2a);}(_0x9d80,0x1a8));var _0x09d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9d80[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x09d8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x09d8('0x1'));var jsonpatch=require(_0x09d8('0x2'));var rp=require(_0x09d8('0x3'));var moment=require(_0x09d8('0x4'));var BPromise=require(_0x09d8('0x5'));var Mustache=require('mustache');var util=require(_0x09d8('0x6'));var path=require(_0x09d8('0x7'));var sox=require(_0x09d8('0x8'));var csv=require(_0x09d8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x09d8('0xa'));var _=require('lodash');var squel=require(_0x09d8('0xb'));var crypto=require(_0x09d8('0xc'));var jsforce=require(_0x09d8('0xd'));var deskjs=require(_0x09d8('0xe'));var toCsv=require(_0x09d8('0x9'));var querystring=require(_0x09d8('0xf'));var Papa=require(_0x09d8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x09d8('0x11'));var as=require(_0x09d8('0x12'));var hardwareService=require(_0x09d8('0x13'));var logger=require('../../config/logger')(_0x09d8('0x14'));var utils=require('../../config/utils');var config=require(_0x09d8('0x15'));var licenseUtil=require(_0x09d8('0x16'));var db=require(_0x09d8('0x17'))['db'];function respondWithStatusCode(_0x51800a,_0x456da1){_0x456da1=_0x456da1||0xcc;return function(_0x4fdaa6){if(_0x4fdaa6){return _0x51800a[_0x09d8('0x18')](_0x456da1);}return _0x51800a[_0x09d8('0x19')](_0x456da1)[_0x09d8('0x1a')]();};}function respondWithResult(_0x4072ac,_0x30f7bf){_0x30f7bf=_0x30f7bf||0xc8;return function(_0x48eade){if(_0x48eade){return _0x4072ac[_0x09d8('0x19')](_0x30f7bf)[_0x09d8('0x1b')](_0x48eade);}};}function respondWithFilteredResult(_0x52b9ff,_0x47f2c0){return function(_0x4f189f){if(_0x4f189f){var _0x48a791=typeof _0x47f2c0[_0x09d8('0x1c')]==='undefined'&&typeof _0x47f2c0[_0x09d8('0x1d')]==='undefined';var _0x243fea=_0x4f189f['count'];var _0x30dd98=_0x48a791?0x0:_0x47f2c0[_0x09d8('0x1c')];var _0x5612a1=_0x48a791?_0x4f189f['count']:_0x47f2c0['offset']+_0x47f2c0['limit'];var _0x4fc7aa;if(_0x5612a1>=_0x243fea){_0x5612a1=_0x243fea;_0x4fc7aa=0xc8;}else{_0x4fc7aa=0xce;}_0x52b9ff[_0x09d8('0x19')](_0x4fc7aa);return _0x52b9ff[_0x09d8('0x1e')](_0x09d8('0x1f'),_0x30dd98+'-'+_0x5612a1+'/'+_0x243fea)['json'](_0x4f189f);}return null;};}function patchUpdates(_0x146c54){return function(_0x236d51){try{jsonpatch[_0x09d8('0x20')](_0x236d51,_0x146c54,!![]);}catch(_0x3b7141){return BPromise[_0x09d8('0x21')](_0x3b7141);}return _0x236d51[_0x09d8('0x22')]();};}function saveUpdates(_0x1d788e,_0x1a5e2a){return function(_0x1ba666){if(_0x1ba666){return _0x1ba666[_0x09d8('0x23')](_0x1d788e)[_0x09d8('0x24')](function(_0x57c12b){return _0x57c12b;});}return null;};}function removeEntity(_0x4942ca,_0x4705d3){return function(_0x132010){if(_0x132010){return _0x132010[_0x09d8('0x25')]()[_0x09d8('0x24')](function(){_0x4942ca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f9783,_0xae137a){return function(_0x5119ab){if(!_0x5119ab){_0x1f9783[_0x09d8('0x18')](0x194);}return _0x5119ab;};}function handleError(_0x2e3525,_0x52a662){_0x52a662=_0x52a662||0x1f4;return function(_0x1418d4){logger[_0x09d8('0x26')](_0x1418d4[_0x09d8('0x27')]);if(_0x1418d4[_0x09d8('0x28')]){delete _0x1418d4[_0x09d8('0x28')];}_0x2e3525['status'](_0x52a662)[_0x09d8('0x29')](_0x1418d4);};}exports[_0x09d8('0x2a')]=function(_0x2cfda9,_0x3d2b1d){var _0x266cdc={},_0x2b14e4={},_0x369e9a={'count':0x0,'rows':[]};var _0x2ce9b6=_[_0x09d8('0x2b')](db['MailServerOut'][_0x09d8('0x2c')],function(_0x3eefde){return{'name':_0x3eefde['fieldName'],'type':_0x3eefde['type'][_0x09d8('0x2d')]};});_0x2b14e4[_0x09d8('0x2e')]=_[_0x09d8('0x2b')](_0x2ce9b6,'name');_0x2b14e4[_0x09d8('0x2f')]=_[_0x09d8('0x30')](_0x2cfda9[_0x09d8('0x2f')]);_0x2b14e4['filters']=_['intersection'](_0x2b14e4['model'],_0x2b14e4[_0x09d8('0x2f')]);_0x266cdc[_0x09d8('0x31')]=_['intersection'](_0x2b14e4['model'],qs[_0x09d8('0x32')](_0x2cfda9[_0x09d8('0x2f')][_0x09d8('0x32')]));_0x266cdc[_0x09d8('0x31')]=_0x266cdc['attributes'][_0x09d8('0x33')]?_0x266cdc[_0x09d8('0x31')]:_0x2b14e4[_0x09d8('0x2e')];if(!_0x2cfda9[_0x09d8('0x2f')]['hasOwnProperty'](_0x09d8('0x34'))){_0x266cdc[_0x09d8('0x1d')]=qs[_0x09d8('0x1d')](_0x2cfda9[_0x09d8('0x2f')][_0x09d8('0x1d')]);_0x266cdc[_0x09d8('0x1c')]=qs['offset'](_0x2cfda9['query'][_0x09d8('0x1c')]);}_0x266cdc[_0x09d8('0x35')]=qs['sort'](_0x2cfda9[_0x09d8('0x2f')]['sort']);_0x266cdc['where']=qs['filters'](_[_0x09d8('0x36')](_0x2cfda9['query'],_0x2b14e4[_0x09d8('0x37')]),_0x2ce9b6);if(_0x2cfda9['query'][_0x09d8('0x38')]){_0x266cdc[_0x09d8('0x39')]=_[_0x09d8('0x3a')](_0x266cdc[_0x09d8('0x39')],{'$or':_[_0x09d8('0x2b')](_0x2ce9b6,function(_0x2b40f0){if(_0x2b40f0[_0x09d8('0x3b')]!==_0x09d8('0x3c')){var _0x35690a={};_0x35690a[_0x2b40f0[_0x09d8('0x28')]]={'$like':'%'+_0x2cfda9[_0x09d8('0x2f')][_0x09d8('0x38')]+'%'};return _0x35690a;}})});}_0x266cdc=_['merge']({},_0x266cdc,_0x2cfda9[_0x09d8('0x3d')]);var _0x3527dd={'where':_0x266cdc[_0x09d8('0x39')]};return db[_0x09d8('0x3e')][_0x09d8('0x3f')](_0x3527dd)[_0x09d8('0x24')](function(_0x3af991){_0x369e9a['count']=_0x3af991;if(_0x2cfda9[_0x09d8('0x2f')][_0x09d8('0x40')]){_0x266cdc['include']=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x266cdc);})[_0x09d8('0x24')](function(_0x58824e){_0x369e9a[_0x09d8('0x41')]=_0x58824e;return _0x369e9a;})[_0x09d8('0x24')](respondWithFilteredResult(_0x3d2b1d,_0x266cdc))['catch'](handleError(_0x3d2b1d,null));};exports['show']=function(_0x211408,_0x523d80){var _0x2ea283={'raw':!![],'where':{'id':_0x211408[_0x09d8('0x42')]['id']}},_0x5a8193={};_0x5a8193[_0x09d8('0x2e')]=_[_0x09d8('0x30')](db[_0x09d8('0x3e')][_0x09d8('0x2c')]);_0x5a8193['query']=_['keys'](_0x211408[_0x09d8('0x2f')]);_0x5a8193[_0x09d8('0x37')]=_[_0x09d8('0x43')](_0x5a8193[_0x09d8('0x2e')],_0x5a8193[_0x09d8('0x2f')]);_0x2ea283['attributes']=_[_0x09d8('0x43')](_0x5a8193[_0x09d8('0x2e')],qs[_0x09d8('0x32')](_0x211408[_0x09d8('0x2f')][_0x09d8('0x32')]));_0x2ea283[_0x09d8('0x31')]=_0x2ea283[_0x09d8('0x31')][_0x09d8('0x33')]?_0x2ea283[_0x09d8('0x31')]:_0x5a8193[_0x09d8('0x2e')];if(_0x211408[_0x09d8('0x2f')][_0x09d8('0x40')]){_0x2ea283[_0x09d8('0x44')]=[{'all':!![]}];}_0x2ea283=_[_0x09d8('0x3a')]({},_0x2ea283,_0x211408[_0x09d8('0x3d')]);return db[_0x09d8('0x3e')][_0x09d8('0x45')](_0x2ea283)[_0x09d8('0x24')](handleEntityNotFound(_0x523d80,null))[_0x09d8('0x24')](respondWithResult(_0x523d80,null))[_0x09d8('0x46')](handleError(_0x523d80,null));};exports['create']=function(_0x12a500,_0x23dcc6){return db['MailServerOut'][_0x09d8('0x47')](_0x12a500[_0x09d8('0x48')],{})[_0x09d8('0x24')](respondWithResult(_0x23dcc6,0xc9))['catch'](handleError(_0x23dcc6,null));};exports[_0x09d8('0x23')]=function(_0x45b4f4,_0x32f139){if(_0x45b4f4[_0x09d8('0x48')]['id']){delete _0x45b4f4[_0x09d8('0x48')]['id'];}return db[_0x09d8('0x3e')]['find']({'where':{'id':_0x45b4f4[_0x09d8('0x42')]['id']}})[_0x09d8('0x24')](handleEntityNotFound(_0x32f139,null))['then'](saveUpdates(_0x45b4f4['body'],null))[_0x09d8('0x24')](respondWithResult(_0x32f139,null))[_0x09d8('0x46')](handleError(_0x32f139,null));};exports[_0x09d8('0x25')]=function(_0x3d7272,_0x3949be){return db[_0x09d8('0x3e')][_0x09d8('0x45')]({'where':{'id':_0x3d7272[_0x09d8('0x42')]['id']}})[_0x09d8('0x24')](handleEntityNotFound(_0x3949be,null))[_0x09d8('0x24')](removeEntity(_0x3949be,null))[_0x09d8('0x46')](handleError(_0x3949be,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 70d54ed..ac8bf77 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 _0x1a7f=['../../config/environment','./mailServerOut.attributes','exports','define','mail_servers_out','lodash','api','moment','bluebird','path','rimraf'];(function(_0x30a458,_0x41e4f4){var _0x3220f1=function(_0x524480){while(--_0x524480){_0x30a458['push'](_0x30a458['shift']());}};_0x3220f1(++_0x41e4f4);}(_0x1a7f,0x1bd));var _0xf1a7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1a7f[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xf1a7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf1a7('0x1'));var moment=require(_0xf1a7('0x2'));var BPromise=require(_0xf1a7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1a7('0x4'));var rimraf=require(_0xf1a7('0x5'));var config=require(_0xf1a7('0x6'));var attributes=require(_0xf1a7('0x7'));module[_0xf1a7('0x8')]=function(_0x52a9a4,_0x4429db){return _0x52a9a4[_0xf1a7('0x9')]('MailServerOut',attributes,{'tableName':_0xf1a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa13b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa13b,0x75));var _0xba13=function(_0x335de2,_0x3f859c){_0x335de2=_0x335de2-0x0;var _0x1d5da6=_0xa13b[_0x335de2];return _0x1d5da6;};'use strict';var _=require('lodash');var util=require(_0xba13('0x0'));var logger=require(_0xba13('0x1'))(_0xba13('0x2'));var moment=require(_0xba13('0x3'));var BPromise=require(_0xba13('0x4'));var rp=require(_0xba13('0x5'));var fs=require('fs');var path=require(_0xba13('0x6'));var rimraf=require(_0xba13('0x7'));var config=require(_0xba13('0x8'));var attributes=require(_0xba13('0x9'));module['exports']=function(_0x51fa45,_0x483dc7){return _0x51fa45[_0xba13('0xa')](_0xba13('0xb'),attributes,{'tableName':_0xba13('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 75650ae..0bbdeaa 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x26439d,_0x19e1ae){var _0xe2adde=function(_0x2edad8){while(--_0x2edad8){_0x26439d['push'](_0x26439d['shift']());}};_0xe2adde(++_0x19e1ae);}(_0x2ef3,0xba));var _0x32ef=function(_0x52af40,_0x415c49){_0x52af40=_0x52af40-0x0;var _0x2d8570=_0x2ef3[_0x52af40];return _0x2d8570;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0xf336e8,_0x137145){_0xf336e8=_0xf336e8-0x0;var _0x2d660c=_0x7a54[_0xf336e8];return _0x2d660c;};'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')]('MailServerOut,\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/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 32e2b50..d74499a 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 _0x72ea=['/:id','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put'];(function(_0x3bab91,_0x495b57){var _0x4698a0=function(_0x536395){while(--_0x536395){_0x3bab91['push'](_0x3bab91['shift']());}};_0x4698a0(++_0x495b57);}(_0x72ea,0x1a5));var _0xa72e=function(_0x2fc28b,_0x5aabcc){_0x2fc28b=_0x2fc28b-0x0;var _0x107356=_0x72ea[_0x2fc28b];return _0x107356;};'use strict';var multer=require(_0xa72e('0x0'));var util=require(_0xa72e('0x1'));var path=require(_0xa72e('0x2'));var timeout=require(_0xa72e('0x3'));var express=require('express');var router=express[_0xa72e('0x4')]();var fs_extra=require(_0xa72e('0x5'));var auth=require(_0xa72e('0x6'));var interaction=require(_0xa72e('0x7'));var config=require(_0xa72e('0x8'));var controller=require(_0xa72e('0x9'));router['get']('/',auth[_0xa72e('0xa')](),controller[_0xa72e('0xb')]);router[_0xa72e('0xc')](_0xa72e('0xd'),auth[_0xa72e('0xa')](),controller[_0xa72e('0xe')]);router[_0xa72e('0xc')]('/:id',auth[_0xa72e('0xa')](),controller[_0xa72e('0xf')]);router[_0xa72e('0x10')]('/',auth[_0xa72e('0xa')](),controller[_0xa72e('0x11')]);router[_0xa72e('0x12')](_0xa72e('0x13'),auth[_0xa72e('0xa')](),controller[_0xa72e('0x14')]);router[_0xa72e('0x15')](_0xa72e('0x13'),auth[_0xa72e('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x426a=['update','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','post','create'];(function(_0x58431a,_0x248615){var _0x5c8a3f=function(_0x31aa73){while(--_0x31aa73){_0x58431a['push'](_0x58431a['shift']());}};_0x5c8a3f(++_0x248615);}(_0x426a,0xfe));var _0xa426=function(_0x988312,_0x5b0275){_0x988312=_0x988312-0x0;var _0x377e97=_0x426a[_0x988312];return _0x377e97;};'use strict';var multer=require(_0xa426('0x0'));var util=require(_0xa426('0x1'));var path=require(_0xa426('0x2'));var timeout=require('connect-timeout');var express=require(_0xa426('0x3'));var router=express[_0xa426('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa426('0x5'));var interaction=require(_0xa426('0x6'));var config=require(_0xa426('0x7'));var controller=require(_0xa426('0x8'));router[_0xa426('0x9')]('/',auth[_0xa426('0xa')](),controller[_0xa426('0xb')]);router['get']('/describe',auth[_0xa426('0xa')](),controller[_0xa426('0xc')]);router[_0xa426('0x9')](_0xa426('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xa426('0xe')]('/',auth['isAuthenticated'](),controller[_0xa426('0xf')]);router['put'](_0xa426('0xd'),auth[_0xa426('0xa')](),controller[_0xa426('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa426('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 0adff93..ddf99fd 100644 --- a/server/api/mailSubstatus/mailSubstatus.attributes.js +++ b/server/api/mailSubstatus/mailSubstatus.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0295=['sequelize','name'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0x0295,0x1f0));var _0x5029=function(_0xcf2382,_0x1da16e){_0xcf2382=_0xcf2382-0x0;var _0x1ade36=_0x0295[_0xcf2382];return _0x1ade36;};'use strict';var Sequelize=require(_0x5029('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5029('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb934=['exports','STRING','sequelize'];(function(_0x35f5e8,_0x2b39fa){var _0x15ee16=function(_0xf6ef12){while(--_0xf6ef12){_0x35f5e8['push'](_0x35f5e8['shift']());}};_0x15ee16(++_0x2b39fa);}(_0xb934,0x92));var _0x4b93=function(_0x4e755c,_0x14df96){_0x4e755c=_0x4e755c-0x0;var _0x264771=_0xb934[_0x4e755c];return _0x264771;};'use strict';var Sequelize=require(_0x4b93('0x0'));module[_0x4b93('0x1')]={'name':{'type':Sequelize[_0x4b93('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4b93('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index cc8e61e..b514a4f 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 _0x3490=['json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','MailSubstatus','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','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','sendStatus','status'];(function(_0xab4c6c,_0x22ec80){var _0x3219d4=function(_0x26c8f7){while(--_0x26c8f7){_0xab4c6c['push'](_0xab4c6c['shift']());}};_0x3219d4(++_0x22ec80);}(_0x3490,0x83));var _0x0349=function(_0x245c4c,_0x312a5b){_0x245c4c=_0x245c4c-0x0;var _0x2b8e9f=_0x3490[_0x245c4c];return _0x2b8e9f;};'use strict';var emlformat=require(_0x0349('0x0'));var rimraf=require(_0x0349('0x1'));var zipdir=require(_0x0349('0x2'));var jsonpatch=require(_0x0349('0x3'));var rp=require(_0x0349('0x4'));var moment=require(_0x0349('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0349('0x6'));var util=require('util');var path=require(_0x0349('0x7'));var sox=require(_0x0349('0x8'));var csv=require(_0x0349('0x9'));var ejs=require(_0x0349('0xa'));var fs=require('fs');var fs_extra=require(_0x0349('0xb'));var _=require(_0x0349('0xc'));var squel=require('squel');var crypto=require(_0x0349('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0349('0xe'));var toCsv=require(_0x0349('0x9'));var querystring=require(_0x0349('0xf'));var Papa=require(_0x0349('0x10'));var Redis=require(_0x0349('0x11'));var authService=require(_0x0349('0x12'));var qs=require(_0x0349('0x13'));var as=require(_0x0349('0x14'));var hardwareService=require(_0x0349('0x15'));var logger=require(_0x0349('0x16'))(_0x0349('0x17'));var utils=require(_0x0349('0x18'));var config=require(_0x0349('0x19'));var licenseUtil=require(_0x0349('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b58b2,_0x36baff){_0x36baff=_0x36baff||0xcc;return function(_0x351d2f){if(_0x351d2f){return _0x5b58b2[_0x0349('0x1b')](_0x36baff);}return _0x5b58b2[_0x0349('0x1c')](_0x36baff)['end']();};}function respondWithResult(_0xa7d231,_0x2c6fef){_0x2c6fef=_0x2c6fef||0xc8;return function(_0x21993e){if(_0x21993e){return _0xa7d231[_0x0349('0x1c')](_0x2c6fef)[_0x0349('0x1d')](_0x21993e);}};}function respondWithFilteredResult(_0x17c959,_0x174c65){return function(_0x3d0fc1){if(_0x3d0fc1){var _0x3b4caa=typeof _0x174c65['offset']==='undefined'&&typeof _0x174c65[_0x0349('0x1e')]===_0x0349('0x1f');var _0x2bc9f6=_0x3d0fc1[_0x0349('0x20')];var _0x2a8dc1=_0x3b4caa?0x0:_0x174c65[_0x0349('0x21')];var _0x2e1c5a=_0x3b4caa?_0x3d0fc1['count']:_0x174c65['offset']+_0x174c65[_0x0349('0x1e')];var _0x560eff;if(_0x2e1c5a>=_0x2bc9f6){_0x2e1c5a=_0x2bc9f6;_0x560eff=0xc8;}else{_0x560eff=0xce;}_0x17c959[_0x0349('0x1c')](_0x560eff);return _0x17c959[_0x0349('0x22')](_0x0349('0x23'),_0x2a8dc1+'-'+_0x2e1c5a+'/'+_0x2bc9f6)[_0x0349('0x1d')](_0x3d0fc1);}return null;};}function patchUpdates(_0x5f369d){return function(_0x56468a){try{jsonpatch[_0x0349('0x24')](_0x56468a,_0x5f369d,!![]);}catch(_0xf5118f){return BPromise[_0x0349('0x25')](_0xf5118f);}return _0x56468a[_0x0349('0x26')]();};}function saveUpdates(_0x37efcc,_0x15bb0d){return function(_0x46885f){if(_0x46885f){return _0x46885f[_0x0349('0x27')](_0x37efcc)[_0x0349('0x28')](function(_0x220772){return _0x220772;});}return null;};}function removeEntity(_0x480d34,_0x2ebbab){return function(_0x2d0064){if(_0x2d0064){return _0x2d0064[_0x0349('0x29')]()[_0x0349('0x28')](function(){_0x480d34['status'](0xcc)[_0x0349('0x2a')]();});}};}function handleEntityNotFound(_0xbbc993,_0x34e8ab){return function(_0x24dc6d){if(!_0x24dc6d){_0xbbc993[_0x0349('0x1b')](0x194);}return _0x24dc6d;};}function handleError(_0x194eed,_0x4291bb){_0x4291bb=_0x4291bb||0x1f4;return function(_0x110643){logger[_0x0349('0x2b')](_0x110643[_0x0349('0x2c')]);if(_0x110643[_0x0349('0x2d')]){delete _0x110643[_0x0349('0x2d')];}_0x194eed[_0x0349('0x1c')](_0x4291bb)['send'](_0x110643);};}exports[_0x0349('0x2e')]=function(_0x128bfa,_0x2bf17e){var _0x284453={},_0x54b8f8={},_0x36d1fe={'count':0x0,'rows':[]};var _0x6bce11=_['map'](db[_0x0349('0x2f')]['rawAttributes'],function(_0x28a0b6){return{'name':_0x28a0b6[_0x0349('0x30')],'type':_0x28a0b6[_0x0349('0x31')][_0x0349('0x32')]};});_0x54b8f8[_0x0349('0x33')]=_[_0x0349('0x34')](_0x6bce11,'name');_0x54b8f8['query']=_[_0x0349('0x35')](_0x128bfa[_0x0349('0x36')]);_0x54b8f8[_0x0349('0x37')]=_[_0x0349('0x38')](_0x54b8f8['model'],_0x54b8f8[_0x0349('0x36')]);_0x284453[_0x0349('0x39')]=_[_0x0349('0x38')](_0x54b8f8[_0x0349('0x33')],qs[_0x0349('0x3a')](_0x128bfa[_0x0349('0x36')][_0x0349('0x3a')]));_0x284453[_0x0349('0x39')]=_0x284453[_0x0349('0x39')][_0x0349('0x3b')]?_0x284453[_0x0349('0x39')]:_0x54b8f8[_0x0349('0x33')];if(!_0x128bfa['query'][_0x0349('0x3c')](_0x0349('0x3d'))){_0x284453['limit']=qs[_0x0349('0x1e')](_0x128bfa[_0x0349('0x36')][_0x0349('0x1e')]);_0x284453['offset']=qs[_0x0349('0x21')](_0x128bfa[_0x0349('0x36')][_0x0349('0x21')]);}_0x284453[_0x0349('0x3e')]=qs[_0x0349('0x3f')](_0x128bfa[_0x0349('0x36')]['sort']);_0x284453[_0x0349('0x40')]=qs['filters'](_[_0x0349('0x41')](_0x128bfa['query'],_0x54b8f8[_0x0349('0x37')]),_0x6bce11);if(_0x128bfa[_0x0349('0x36')][_0x0349('0x42')]){_0x284453['where']=_[_0x0349('0x43')](_0x284453[_0x0349('0x40')],{'$or':_[_0x0349('0x34')](_0x6bce11,function(_0x2f89b1){if(_0x2f89b1['type']!==_0x0349('0x44')){var _0x540653={};_0x540653[_0x2f89b1[_0x0349('0x2d')]]={'$like':'%'+_0x128bfa[_0x0349('0x36')]['filter']+'%'};return _0x540653;}})});}_0x284453=_['merge']({},_0x284453,_0x128bfa[_0x0349('0x45')]);var _0x5f0a4={'where':_0x284453[_0x0349('0x40')]};return db['MailSubstatus'][_0x0349('0x20')](_0x5f0a4)[_0x0349('0x28')](function(_0x1274dc){_0x36d1fe[_0x0349('0x20')]=_0x1274dc;if(_0x128bfa[_0x0349('0x36')]['includeAll']){_0x284453[_0x0349('0x46')]=[{'all':!![]}];}return db['MailSubstatus'][_0x0349('0x47')](_0x284453);})[_0x0349('0x28')](function(_0x4b9c6b){_0x36d1fe['rows']=_0x4b9c6b;return _0x36d1fe;})[_0x0349('0x28')](respondWithFilteredResult(_0x2bf17e,_0x284453))[_0x0349('0x48')](handleError(_0x2bf17e,null));};exports[_0x0349('0x49')]=function(_0xa389ee,_0x51889c){var _0x299dbd={'raw':!![],'where':{'id':_0xa389ee[_0x0349('0x4a')]['id']}},_0x2c3631={};_0x2c3631[_0x0349('0x33')]=_[_0x0349('0x35')](db[_0x0349('0x2f')][_0x0349('0x4b')]);_0x2c3631['query']=_[_0x0349('0x35')](_0xa389ee[_0x0349('0x36')]);_0x2c3631['filters']=_[_0x0349('0x38')](_0x2c3631[_0x0349('0x33')],_0x2c3631[_0x0349('0x36')]);_0x299dbd[_0x0349('0x39')]=_[_0x0349('0x38')](_0x2c3631[_0x0349('0x33')],qs[_0x0349('0x3a')](_0xa389ee[_0x0349('0x36')][_0x0349('0x3a')]));_0x299dbd[_0x0349('0x39')]=_0x299dbd[_0x0349('0x39')]['length']?_0x299dbd['attributes']:_0x2c3631[_0x0349('0x33')];if(_0xa389ee[_0x0349('0x36')]['includeAll']){_0x299dbd[_0x0349('0x46')]=[{'all':!![]}];}_0x299dbd=_[_0x0349('0x43')]({},_0x299dbd,_0xa389ee[_0x0349('0x45')]);return db[_0x0349('0x2f')]['find'](_0x299dbd)[_0x0349('0x28')](handleEntityNotFound(_0x51889c,null))[_0x0349('0x28')](respondWithResult(_0x51889c,null))['catch'](handleError(_0x51889c,null));};exports[_0x0349('0x4c')]=function(_0x1b3c62,_0x3261c9){return db[_0x0349('0x2f')][_0x0349('0x4c')](_0x1b3c62['body'],{})[_0x0349('0x28')](respondWithResult(_0x3261c9,0xc9))[_0x0349('0x48')](handleError(_0x3261c9,null));};exports[_0x0349('0x27')]=function(_0x491821,_0x22bd06){if(_0x491821['body']['id']){delete _0x491821[_0x0349('0x4d')]['id'];}return db[_0x0349('0x2f')][_0x0349('0x4e')]({'where':{'id':_0x491821[_0x0349('0x4a')]['id']}})[_0x0349('0x28')](handleEntityNotFound(_0x22bd06,null))[_0x0349('0x28')](saveUpdates(_0x491821[_0x0349('0x4d')],null))[_0x0349('0x28')](respondWithResult(_0x22bd06,null))['catch'](handleError(_0x22bd06,null));};exports[_0x0349('0x29')]=function(_0xea3ea2,_0x346c8d){return db['MailSubstatus'][_0x0349('0x4e')]({'where':{'id':_0xea3ea2[_0x0349('0x4a')]['id']}})[_0x0349('0x28')](handleEntityNotFound(_0x346c8d,null))[_0x0349('0x28')](removeEntity(_0x346c8d,null))[_0x0349('0x48')](handleError(_0x346c8d,null));};exports[_0x0349('0x4f')]=function(_0x2f7f4e,_0x32aa87){return db['MailSubstatus'][_0x0349('0x4f')]()['then'](respondWithResult(_0x32aa87,null))[_0x0349('0x48')](handleError(_0x32aa87,null));}; \ No newline at end of file +var _0xa670=['apply','reject','then','end','sendStatus','error','stack','name','index','map','rawAttributes','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','MailSubstatus','findAll','rows','catch','show','params','includeAll','include','find','create','body','update','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','json','undefined','count','offset','limit','status','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa670,0x106));var _0x0a67=function(_0x48443e,_0xecb990){_0x48443e=_0x48443e-0x0;var _0x4b95fb=_0xa670[_0x48443e];return _0x4b95fb;};'use strict';var emlformat=require(_0x0a67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a67('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0a67('0x2'));var moment=require('moment');var BPromise=require(_0x0a67('0x3'));var Mustache=require(_0x0a67('0x4'));var util=require(_0x0a67('0x5'));var path=require(_0x0a67('0x6'));var sox=require(_0x0a67('0x7'));var csv=require(_0x0a67('0x8'));var ejs=require(_0x0a67('0x9'));var fs=require('fs');var fs_extra=require(_0x0a67('0xa'));var _=require(_0x0a67('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0a67('0xc'));var deskjs=require(_0x0a67('0xd'));var toCsv=require(_0x0a67('0x8'));var querystring=require(_0x0a67('0xe'));var Papa=require('papaparse');var Redis=require(_0x0a67('0xf'));var authService=require(_0x0a67('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0a67('0x11'));var hardwareService=require(_0x0a67('0x12'));var logger=require(_0x0a67('0x13'))(_0x0a67('0x14'));var utils=require(_0x0a67('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0a67('0x16'))['db'];function respondWithStatusCode(_0x42a54f,_0x5780b1){_0x5780b1=_0x5780b1||0xcc;return function(_0x84eda2){if(_0x84eda2){return _0x42a54f['sendStatus'](_0x5780b1);}return _0x42a54f['status'](_0x5780b1)['end']();};}function respondWithResult(_0x297b30,_0x236209){_0x236209=_0x236209||0xc8;return function(_0x6b19cb){if(_0x6b19cb){return _0x297b30['status'](_0x236209)[_0x0a67('0x17')](_0x6b19cb);}};}function respondWithFilteredResult(_0x3d6cae,_0x5f0be9){return function(_0x188c06){if(_0x188c06){var _0x3c45c5=typeof _0x5f0be9['offset']==='undefined'&&typeof _0x5f0be9['limit']===_0x0a67('0x18');var _0x56339e=_0x188c06[_0x0a67('0x19')];var _0x417db0=_0x3c45c5?0x0:_0x5f0be9[_0x0a67('0x1a')];var _0x9fa10c=_0x3c45c5?_0x188c06['count']:_0x5f0be9[_0x0a67('0x1a')]+_0x5f0be9[_0x0a67('0x1b')];var _0x73bf1e;if(_0x9fa10c>=_0x56339e){_0x9fa10c=_0x56339e;_0x73bf1e=0xc8;}else{_0x73bf1e=0xce;}_0x3d6cae[_0x0a67('0x1c')](_0x73bf1e);return _0x3d6cae['set'](_0x0a67('0x1d'),_0x417db0+'-'+_0x9fa10c+'/'+_0x56339e)[_0x0a67('0x17')](_0x188c06);}return null;};}function patchUpdates(_0x46898d){return function(_0x20633f){try{jsonpatch[_0x0a67('0x1e')](_0x20633f,_0x46898d,!![]);}catch(_0x781e7){return BPromise[_0x0a67('0x1f')](_0x781e7);}return _0x20633f['save']();};}function saveUpdates(_0x4d4b68,_0x4d6035){return function(_0x361aba){if(_0x361aba){return _0x361aba['update'](_0x4d4b68)[_0x0a67('0x20')](function(_0x5b2a60){return _0x5b2a60;});}return null;};}function removeEntity(_0x1b7832,_0x1f2728){return function(_0x9ba6e7){if(_0x9ba6e7){return _0x9ba6e7['destroy']()[_0x0a67('0x20')](function(){_0x1b7832['status'](0xcc)[_0x0a67('0x21')]();});}};}function handleEntityNotFound(_0x5dc024,_0x2a6be1){return function(_0x4e3096){if(!_0x4e3096){_0x5dc024[_0x0a67('0x22')](0x194);}return _0x4e3096;};}function handleError(_0x7414b7,_0x357621){_0x357621=_0x357621||0x1f4;return function(_0x4cb040){logger[_0x0a67('0x23')](_0x4cb040[_0x0a67('0x24')]);if(_0x4cb040['name']){delete _0x4cb040[_0x0a67('0x25')];}_0x7414b7['status'](_0x357621)['send'](_0x4cb040);};}exports[_0x0a67('0x26')]=function(_0x2549ff,_0x52163c){var _0x51411e={},_0x4f330a={},_0x14ff48={'count':0x0,'rows':[]};var _0x3df265=_[_0x0a67('0x27')](db['MailSubstatus'][_0x0a67('0x28')],function(_0x5f0412){return{'name':_0x5f0412['fieldName'],'type':_0x5f0412[_0x0a67('0x29')][_0x0a67('0x2a')]};});_0x4f330a[_0x0a67('0x2b')]=_[_0x0a67('0x27')](_0x3df265,'name');_0x4f330a['query']=_[_0x0a67('0x2c')](_0x2549ff['query']);_0x4f330a[_0x0a67('0x2d')]=_[_0x0a67('0x2e')](_0x4f330a[_0x0a67('0x2b')],_0x4f330a[_0x0a67('0x2f')]);_0x51411e['attributes']=_[_0x0a67('0x2e')](_0x4f330a[_0x0a67('0x2b')],qs[_0x0a67('0x30')](_0x2549ff[_0x0a67('0x2f')][_0x0a67('0x30')]));_0x51411e[_0x0a67('0x31')]=_0x51411e[_0x0a67('0x31')][_0x0a67('0x32')]?_0x51411e['attributes']:_0x4f330a[_0x0a67('0x2b')];if(!_0x2549ff[_0x0a67('0x2f')][_0x0a67('0x33')](_0x0a67('0x34'))){_0x51411e[_0x0a67('0x1b')]=qs['limit'](_0x2549ff[_0x0a67('0x2f')]['limit']);_0x51411e[_0x0a67('0x1a')]=qs['offset'](_0x2549ff['query']['offset']);}_0x51411e['order']=qs[_0x0a67('0x35')](_0x2549ff['query']['sort']);_0x51411e[_0x0a67('0x36')]=qs['filters'](_[_0x0a67('0x37')](_0x2549ff[_0x0a67('0x2f')],_0x4f330a['filters']),_0x3df265);if(_0x2549ff[_0x0a67('0x2f')][_0x0a67('0x38')]){_0x51411e[_0x0a67('0x36')]=_[_0x0a67('0x39')](_0x51411e['where'],{'$or':_[_0x0a67('0x27')](_0x3df265,function(_0x58f75f){if(_0x58f75f[_0x0a67('0x29')]!==_0x0a67('0x3a')){var _0x5809ec={};_0x5809ec[_0x58f75f[_0x0a67('0x25')]]={'$like':'%'+_0x2549ff[_0x0a67('0x2f')][_0x0a67('0x38')]+'%'};return _0x5809ec;}})});}_0x51411e=_[_0x0a67('0x39')]({},_0x51411e,_0x2549ff[_0x0a67('0x3b')]);var _0x59970e={'where':_0x51411e[_0x0a67('0x36')]};return db['MailSubstatus'][_0x0a67('0x19')](_0x59970e)['then'](function(_0x39754c){_0x14ff48['count']=_0x39754c;if(_0x2549ff[_0x0a67('0x2f')]['includeAll']){_0x51411e['include']=[{'all':!![]}];}return db[_0x0a67('0x3c')][_0x0a67('0x3d')](_0x51411e);})[_0x0a67('0x20')](function(_0x1d3fb4){_0x14ff48[_0x0a67('0x3e')]=_0x1d3fb4;return _0x14ff48;})['then'](respondWithFilteredResult(_0x52163c,_0x51411e))[_0x0a67('0x3f')](handleError(_0x52163c,null));};exports[_0x0a67('0x40')]=function(_0x30d1a3,_0xb2e1f){var _0x3aa827={'raw':!![],'where':{'id':_0x30d1a3[_0x0a67('0x41')]['id']}},_0xd266f2={};_0xd266f2['model']=_['keys'](db['MailSubstatus'][_0x0a67('0x28')]);_0xd266f2[_0x0a67('0x2f')]=_['keys'](_0x30d1a3[_0x0a67('0x2f')]);_0xd266f2[_0x0a67('0x2d')]=_[_0x0a67('0x2e')](_0xd266f2[_0x0a67('0x2b')],_0xd266f2['query']);_0x3aa827[_0x0a67('0x31')]=_['intersection'](_0xd266f2[_0x0a67('0x2b')],qs[_0x0a67('0x30')](_0x30d1a3[_0x0a67('0x2f')][_0x0a67('0x30')]));_0x3aa827[_0x0a67('0x31')]=_0x3aa827[_0x0a67('0x31')]['length']?_0x3aa827[_0x0a67('0x31')]:_0xd266f2['model'];if(_0x30d1a3[_0x0a67('0x2f')][_0x0a67('0x42')]){_0x3aa827[_0x0a67('0x43')]=[{'all':!![]}];}_0x3aa827=_[_0x0a67('0x39')]({},_0x3aa827,_0x30d1a3[_0x0a67('0x3b')]);return db[_0x0a67('0x3c')][_0x0a67('0x44')](_0x3aa827)['then'](handleEntityNotFound(_0xb2e1f,null))[_0x0a67('0x20')](respondWithResult(_0xb2e1f,null))[_0x0a67('0x3f')](handleError(_0xb2e1f,null));};exports[_0x0a67('0x45')]=function(_0x1eb36f,_0x139954){return db[_0x0a67('0x3c')][_0x0a67('0x45')](_0x1eb36f[_0x0a67('0x46')],{})['then'](respondWithResult(_0x139954,0xc9))[_0x0a67('0x3f')](handleError(_0x139954,null));};exports[_0x0a67('0x47')]=function(_0x5ce3b0,_0x425e66){if(_0x5ce3b0[_0x0a67('0x46')]['id']){delete _0x5ce3b0[_0x0a67('0x46')]['id'];}return db[_0x0a67('0x3c')][_0x0a67('0x44')]({'where':{'id':_0x5ce3b0[_0x0a67('0x41')]['id']}})[_0x0a67('0x20')](handleEntityNotFound(_0x425e66,null))[_0x0a67('0x20')](saveUpdates(_0x5ce3b0[_0x0a67('0x46')],null))['then'](respondWithResult(_0x425e66,null))['catch'](handleError(_0x425e66,null));};exports['destroy']=function(_0x505118,_0x30d395){return db[_0x0a67('0x3c')]['find']({'where':{'id':_0x505118['params']['id']}})[_0x0a67('0x20')](handleEntityNotFound(_0x30d395,null))[_0x0a67('0x20')](removeEntity(_0x30d395,null))[_0x0a67('0x3f')](handleError(_0x30d395,null));};exports[_0x0a67('0x48')]=function(_0x950184,_0x442941){return db['MailSubstatus'][_0x0a67('0x48')]()[_0x0a67('0x20')](respondWithResult(_0x442941,null))['catch'](handleError(_0x442941,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 07337c6..05c1846 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 _0x9b07=['../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook','events'];(function(_0x3f85b3,_0x5870a3){var _0x741189=function(_0x2e305e){while(--_0x2e305e){_0x3f85b3['push'](_0x3f85b3['shift']());}};_0x741189(++_0x5870a3);}(_0x9b07,0x1d4));var _0x79b0=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9b07[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x79b0('0x0'));var MailSubstatus=require(_0x79b0('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x79b0('0x2')](0x0);var events={'afterUpdate':_0x79b0('0x3')};function emitEvent(_0x89ecb0){return function(_0x5c3d97,_0x1bc73c,_0x24ada7){MailSubstatusEvents[_0x79b0('0x4')](_0x89ecb0+':'+_0x5c3d97['id'],_0x5c3d97);MailSubstatusEvents[_0x79b0('0x4')](_0x89ecb0,_0x5c3d97);_0x24ada7(null);};}for(var e in events){if(events[_0x79b0('0x5')](e)){var event=events[e];MailSubstatus[_0x79b0('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x651a=['exports','events','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x651a,0x129));var _0xa651=function(_0x2f2cb6,_0x5f5576){_0x2f2cb6=_0x2f2cb6-0x0;var _0x33c4a7=_0x651a[_0x2f2cb6];return _0x33c4a7;};'use strict';var EventEmitter=require(_0xa651('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0xa651('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xa651('0x2')](0x0);var events={'afterUpdate':_0xa651('0x3')};function emitEvent(_0x3b130a){return function(_0x49a17c,_0x69cb9e,_0x5d826b){MailSubstatusEvents[_0xa651('0x4')](_0x3b130a+':'+_0x49a17c['id'],_0x49a17c);MailSubstatusEvents['emit'](_0x3b130a,_0x49a17c);_0x5d826b(null);};}for(var e in events){if(events[_0xa651('0x5')](e)){var event=events[e];MailSubstatus[_0xa651('0x6')](e,emitEvent(event));}}module[_0xa651('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 4138b05..89765d3 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 _0xb910=['name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','models','define','MailSubstatus','mail_substatuses','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb910,0x1b2));var _0x0b91=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xb910[_0x1abb09];return _0xea1c07;};'use strict';var attributes=require(_0x0b91('0x0'));module['exports']=function(_0x3164da){var _0x9c5a53=_0x3164da[_0x0b91('0x1')];return _0x3164da[_0x0b91('0x2')](_0x0b91('0x3'),attributes,{'tableName':_0x0b91('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5e63c2,_0x1853ce,_0x21ab47){return _0x9c5a53['Condition'][_0x0b91('0x5')]({'value':_0x5e63c2[_0x0b91('0x6')]},{'where':{'field':_0x0b91('0x7'),'value':_0x5e63c2[_0x0b91('0x8')]['name']}})[_0x0b91('0x9')](function(){_0x21ab47();})[_0x0b91('0xa')](function(_0x470a9d){_0x21ab47(_0x470a9d);});}}});}; \ No newline at end of file +var _0xdd74=['define','mail_substatuses','Condition','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports'];(function(_0x327e47,_0x1f69a3){var _0xd2b5cd=function(_0x53feec){while(--_0x53feec){_0x327e47['push'](_0x327e47['shift']());}};_0xd2b5cd(++_0x1f69a3);}(_0xdd74,0x15c));var _0x4dd7=function(_0x349164,_0x58a515){_0x349164=_0x349164-0x0;var _0x1d64e2=_0xdd74[_0x349164];return _0x1d64e2;};'use strict';var attributes=require(_0x4dd7('0x0'));module[_0x4dd7('0x1')]=function(_0x383579){var _0x10a513=_0x383579['models'];return _0x383579[_0x4dd7('0x2')]('MailSubstatus',attributes,{'tableName':_0x4dd7('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0xb41da5,_0x3393f2,_0xd728f1){return _0x10a513[_0x4dd7('0x4')]['update']({'value':_0xb41da5[_0x4dd7('0x5')]},{'where':{'field':_0x4dd7('0x6'),'value':_0xb41da5[_0x4dd7('0x7')]['name']}})[_0x4dd7('0x8')](function(){_0xd728f1();})[_0x4dd7('0x9')](function(_0x1771ec){_0xd728f1(_0x1771ec);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index b6cb18e..dc5a24d 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 _0x115b=['then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request'];(function(_0x3a29ef,_0xe4270e){var _0x5de1d3=function(_0x3b206e){while(--_0x3b206e){_0x3a29ef['push'](_0x3a29ef['shift']());}};_0x5de1d3(++_0xe4270e);}(_0x115b,0x102));var _0xb115=function(_0x52f800,_0x114169){_0x52f800=_0x52f800-0x0;var _0x1c3e74=_0x115b[_0x52f800];return _0x1c3e74;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb115('0x0'));var rs=require(_0xb115('0x1'));var fs=require('fs');var Redis=require(_0xb115('0x2'));var db=require(_0xb115('0x3'))['db'];var utils=require(_0xb115('0x4'));var logger=require(_0xb115('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb115('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x475dad,_0x4b588b,_0x515478){return new BPromise(function(_0x1ad65b,_0x112161){return client[_0xb115('0x7')](_0x475dad,_0x515478)[_0xb115('0x8')](function(_0x33218d){logger[_0xb115('0x9')](_0xb115('0xa'),_0x4b588b,'request\x20sent');logger[_0xb115('0xb')](_0xb115('0xc'),_0x4b588b,_0xb115('0xd'),JSON[_0xb115('0xe')](_0x33218d));if(_0x33218d[_0xb115('0xf')]){if(_0x33218d[_0xb115('0xf')][_0xb115('0x10')]===0x1f4){logger['error'](_0xb115('0xa'),_0x4b588b,_0x33218d[_0xb115('0xf')][_0xb115('0x11')]);return _0x112161(_0x33218d[_0xb115('0xf')][_0xb115('0x11')]);}logger['error'](_0xb115('0xa'),_0x4b588b,_0x33218d[_0xb115('0xf')][_0xb115('0x11')]);return _0x1ad65b(_0x33218d['error']['message']);}else{logger[_0xb115('0x9')](_0xb115('0xa'),_0x4b588b,_0xb115('0xd'));_0x1ad65b(_0x33218d['result'][_0xb115('0x11')]);}})[_0xb115('0x12')](function(_0x59f421){logger[_0xb115('0xf')](_0xb115('0xa'),_0x4b588b,_0x59f421);_0x112161(_0x59f421);});});} \ No newline at end of file +var _0x5ab3=['MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x14ceda,_0x41422b){var _0x5846c4=function(_0x56c0c7){while(--_0x56c0c7){_0x14ceda['push'](_0x14ceda['shift']());}};_0x5846c4(++_0x41422b);}(_0x5ab3,0x180));var _0x35ab=function(_0x4c15d8,_0x245123){_0x4c15d8=_0x4c15d8-0x0;var _0x492d12=_0x5ab3[_0x4c15d8];return _0x492d12;};'use strict';var _=require(_0x35ab('0x0'));var util=require(_0x35ab('0x1'));var moment=require('moment');var BPromise=require(_0x35ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ab('0x3'));var db=require(_0x35ab('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x35ab('0x5'))(_0x35ab('0x6'));var config=require(_0x35ab('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x35ab('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x467284,_0xff8443,_0x1f5c31){return new BPromise(function(_0x3eea92,_0x2bfee7){return client[_0x35ab('0x9')](_0x467284,_0x1f5c31)[_0x35ab('0xa')](function(_0x2e12e2){logger[_0x35ab('0xb')](_0x35ab('0xc'),_0xff8443,_0x35ab('0xd'));logger[_0x35ab('0xe')](_0x35ab('0xf'),_0xff8443,_0x35ab('0xd'),JSON['stringify'](_0x2e12e2));if(_0x2e12e2[_0x35ab('0x10')]){if(_0x2e12e2[_0x35ab('0x10')][_0x35ab('0x11')]===0x1f4){logger['error'](_0x35ab('0xc'),_0xff8443,_0x2e12e2[_0x35ab('0x10')]['message']);return _0x2bfee7(_0x2e12e2[_0x35ab('0x10')][_0x35ab('0x12')]);}logger[_0x35ab('0x10')](_0x35ab('0xc'),_0xff8443,_0x2e12e2[_0x35ab('0x10')][_0x35ab('0x12')]);return _0x3eea92(_0x2e12e2['error'][_0x35ab('0x12')]);}else{logger[_0x35ab('0xb')](_0x35ab('0xc'),_0xff8443,'request\x20sent');_0x3eea92(_0x2e12e2[_0x35ab('0x13')][_0x35ab('0x12')]);}})[_0x35ab('0x14')](function(_0x2dde0c){logger[_0x35ab('0x10')](_0x35ab('0xc'),_0xff8443,_0x2dde0c);_0x2bfee7(_0x2dde0c);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 226cf33..dea5d3b 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 _0xe6a9=['describe','show','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','/describe','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe6a9,0x1aa));var _0x9e6a=function(_0x5aa90c,_0x40e79b){_0x5aa90c=_0x5aa90c-0x0;var _0x228251=_0xe6a9[_0x5aa90c];return _0x228251;};'use strict';var multer=require(_0x9e6a('0x0'));var util=require('util');var path=require(_0x9e6a('0x1'));var timeout=require(_0x9e6a('0x2'));var express=require(_0x9e6a('0x3'));var router=express[_0x9e6a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9e6a('0x5'));var interaction=require(_0x9e6a('0x6'));var config=require('../../config/environment');var controller=require(_0x9e6a('0x7'));router[_0x9e6a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9e6a('0x8')](_0x9e6a('0x9'),auth[_0x9e6a('0xa')](),controller[_0x9e6a('0xb')]);router[_0x9e6a('0x8')]('/:id',auth[_0x9e6a('0xa')](),controller[_0x9e6a('0xc')]);router['post']('/',auth[_0x9e6a('0xa')](),controller[_0x9e6a('0xd')]);router[_0x9e6a('0xe')](_0x9e6a('0xf'),auth['isAuthenticated'](),controller[_0x9e6a('0x10')]);router['delete'](_0x9e6a('0xf'),auth[_0x9e6a('0xa')](),controller[_0x9e6a('0x11')]);module[_0x9e6a('0x12')]=router; \ No newline at end of file +var _0xf773=['fs-extra','../../config/environment','isAuthenticated','index','get','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1053cd,_0x1d9a99){var _0x3f79e5=function(_0x583f5b){while(--_0x583f5b){_0x1053cd['push'](_0x1053cd['shift']());}};_0x3f79e5(++_0x1d9a99);}(_0xf773,0xc7));var _0x3f77=function(_0x4218d0,_0x427ba3){_0x4218d0=_0x4218d0-0x0;var _0x5bda9e=_0xf773[_0x4218d0];return _0x5bda9e;};'use strict';var multer=require(_0x3f77('0x0'));var util=require(_0x3f77('0x1'));var path=require(_0x3f77('0x2'));var timeout=require(_0x3f77('0x3'));var express=require(_0x3f77('0x4'));var router=express['Router']();var fs_extra=require(_0x3f77('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3f77('0x6'));var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0x3f77('0x7')](),controller[_0x3f77('0x8')]);router[_0x3f77('0x9')]('/describe',auth[_0x3f77('0x7')](),controller['describe']);router[_0x3f77('0x9')](_0x3f77('0xa'),auth[_0x3f77('0x7')](),controller[_0x3f77('0xb')]);router[_0x3f77('0xc')]('/',auth[_0x3f77('0x7')](),controller['create']);router['put']('/:id',auth[_0x3f77('0x7')](),controller[_0x3f77('0xd')]);router[_0x3f77('0xe')](_0x3f77('0xa'),auth[_0x3f77('0x7')](),controller[_0x3f77('0xf')]);module[_0x3f77('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 50084eb..cccc443 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x20aae1,_0x51efd4){var _0x510601=function(_0x20895f){while(--_0x20895f){_0x20aae1['push'](_0x20aae1['shift']());}};_0x510601(++_0x51efd4);}(_0x9bde,0xe1));var _0xe9bd=function(_0x19bd0f,_0x26f6f3){_0x19bd0f=_0x19bd0f-0x0;var _0xef83ae=_0x9bde[_0x19bd0f];return _0xef83ae;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x34b037,_0x2674da){var _0x2ecdf3=function(_0x51e652){while(--_0x51e652){_0x34b037['push'](_0x34b037['shift']());}};_0x2ecdf3(++_0x2674da);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2a6d45,_0x3c9321){_0x2a6d45=_0x2a6d45-0x0;var _0x295253=_0xf3cd[_0x2a6d45];return _0x295253;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index ed63b1d..6dde824 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 _0xf9f5=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','error','stack','name','index','MailTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra'];(function(_0xca167c,_0x439d26){var _0x30cc8b=function(_0x18ade9){while(--_0x18ade9){_0xca167c['push'](_0xca167c['shift']());}};_0x30cc8b(++_0x439d26);}(_0xf9f5,0x181));var _0x5f9f=function(_0x52f635,_0x3e910d){_0x52f635=_0x52f635-0x0;var _0x2a652c=_0xf9f5[_0x52f635];return _0x2a652c;};'use strict';var emlformat=require(_0x5f9f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f9f('0x1'));var jsonpatch=require(_0x5f9f('0x2'));var rp=require(_0x5f9f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5f9f('0x4'));var util=require(_0x5f9f('0x5'));var path=require(_0x5f9f('0x6'));var sox=require(_0x5f9f('0x7'));var csv=require('to-csv');var ejs=require(_0x5f9f('0x8'));var fs=require('fs');var fs_extra=require(_0x5f9f('0x9'));var _=require(_0x5f9f('0xa'));var squel=require(_0x5f9f('0xb'));var crypto=require(_0x5f9f('0xc'));var jsforce=require(_0x5f9f('0xd'));var deskjs=require(_0x5f9f('0xe'));var toCsv=require(_0x5f9f('0xf'));var querystring=require(_0x5f9f('0x10'));var Papa=require(_0x5f9f('0x11'));var Redis=require(_0x5f9f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5f9f('0x13'));var hardwareService=require(_0x5f9f('0x14'));var logger=require(_0x5f9f('0x15'))(_0x5f9f('0x16'));var utils=require(_0x5f9f('0x17'));var config=require(_0x5f9f('0x18'));var licenseUtil=require(_0x5f9f('0x19'));var db=require(_0x5f9f('0x1a'))['db'];function respondWithStatusCode(_0x5937ae,_0x1196ce){_0x1196ce=_0x1196ce||0xcc;return function(_0x5a8f51){if(_0x5a8f51){return _0x5937ae[_0x5f9f('0x1b')](_0x1196ce);}return _0x5937ae['status'](_0x1196ce)[_0x5f9f('0x1c')]();};}function respondWithResult(_0xbe5448,_0x2244b9){_0x2244b9=_0x2244b9||0xc8;return function(_0x23a5dd){if(_0x23a5dd){return _0xbe5448[_0x5f9f('0x1d')](_0x2244b9)['json'](_0x23a5dd);}};}function respondWithFilteredResult(_0x2b9492,_0x530476){return function(_0x25ae9c){if(_0x25ae9c){var _0x360815=typeof _0x530476[_0x5f9f('0x1e')]===_0x5f9f('0x1f')&&typeof _0x530476[_0x5f9f('0x20')]===_0x5f9f('0x1f');var _0x41c4bf=_0x25ae9c[_0x5f9f('0x21')];var _0x42f594=_0x360815?0x0:_0x530476['offset'];var _0x21e31b=_0x360815?_0x25ae9c[_0x5f9f('0x21')]:_0x530476[_0x5f9f('0x1e')]+_0x530476[_0x5f9f('0x20')];var _0x2ba5ba;if(_0x21e31b>=_0x41c4bf){_0x21e31b=_0x41c4bf;_0x2ba5ba=0xc8;}else{_0x2ba5ba=0xce;}_0x2b9492[_0x5f9f('0x1d')](_0x2ba5ba);return _0x2b9492['set'](_0x5f9f('0x22'),_0x42f594+'-'+_0x21e31b+'/'+_0x41c4bf)['json'](_0x25ae9c);}return null;};}function patchUpdates(_0x1f46ce){return function(_0x34127c){try{jsonpatch['apply'](_0x34127c,_0x1f46ce,!![]);}catch(_0x5b0319){return BPromise[_0x5f9f('0x23')](_0x5b0319);}return _0x34127c[_0x5f9f('0x24')]();};}function saveUpdates(_0x3860cd,_0x241bde){return function(_0x574449){if(_0x574449){return _0x574449[_0x5f9f('0x25')](_0x3860cd)['then'](function(_0x2046e1){return _0x2046e1;});}return null;};}function removeEntity(_0x4563fa,_0x4f78f1){return function(_0x46e849){if(_0x46e849){return _0x46e849[_0x5f9f('0x26')]()[_0x5f9f('0x27')](function(){_0x4563fa[_0x5f9f('0x1d')](0xcc)[_0x5f9f('0x1c')]();});}};}function handleEntityNotFound(_0x546dd3,_0x54e541){return function(_0x4d662c){if(!_0x4d662c){_0x546dd3['sendStatus'](0x194);}return _0x4d662c;};}function handleError(_0x35544a,_0x39545b){_0x39545b=_0x39545b||0x1f4;return function(_0x4a2326){logger[_0x5f9f('0x28')](_0x4a2326[_0x5f9f('0x29')]);if(_0x4a2326[_0x5f9f('0x2a')]){delete _0x4a2326[_0x5f9f('0x2a')];}_0x35544a['status'](_0x39545b)['send'](_0x4a2326);};}exports[_0x5f9f('0x2b')]=function(_0x2c7a79,_0x3c28cf){var _0x31af0f={},_0x5be3d3={},_0x4755a6={'count':0x0,'rows':[]};var _0x1669ca=_['map'](db[_0x5f9f('0x2c')][_0x5f9f('0x2d')],function(_0x2d3285){return{'name':_0x2d3285[_0x5f9f('0x2e')],'type':_0x2d3285[_0x5f9f('0x2f')][_0x5f9f('0x30')]};});_0x5be3d3[_0x5f9f('0x31')]=_[_0x5f9f('0x32')](_0x1669ca,'name');_0x5be3d3[_0x5f9f('0x33')]=_[_0x5f9f('0x34')](_0x2c7a79[_0x5f9f('0x33')]);_0x5be3d3[_0x5f9f('0x35')]=_[_0x5f9f('0x36')](_0x5be3d3[_0x5f9f('0x31')],_0x5be3d3['query']);_0x31af0f[_0x5f9f('0x37')]=_['intersection'](_0x5be3d3[_0x5f9f('0x31')],qs[_0x5f9f('0x38')](_0x2c7a79['query'][_0x5f9f('0x38')]));_0x31af0f['attributes']=_0x31af0f[_0x5f9f('0x37')][_0x5f9f('0x39')]?_0x31af0f['attributes']:_0x5be3d3[_0x5f9f('0x31')];if(!_0x2c7a79['query'][_0x5f9f('0x3a')](_0x5f9f('0x3b'))){_0x31af0f[_0x5f9f('0x20')]=qs[_0x5f9f('0x20')](_0x2c7a79[_0x5f9f('0x33')][_0x5f9f('0x20')]);_0x31af0f['offset']=qs[_0x5f9f('0x1e')](_0x2c7a79[_0x5f9f('0x33')]['offset']);}_0x31af0f[_0x5f9f('0x3c')]=qs['sort'](_0x2c7a79[_0x5f9f('0x33')][_0x5f9f('0x3d')]);_0x31af0f[_0x5f9f('0x3e')]=qs['filters'](_[_0x5f9f('0x3f')](_0x2c7a79[_0x5f9f('0x33')],_0x5be3d3[_0x5f9f('0x35')]),_0x1669ca);if(_0x2c7a79[_0x5f9f('0x33')]['filter']){_0x31af0f['where']=_[_0x5f9f('0x40')](_0x31af0f[_0x5f9f('0x3e')],{'$or':_[_0x5f9f('0x32')](_0x1669ca,function(_0x54acb7){if(_0x54acb7[_0x5f9f('0x2f')]!==_0x5f9f('0x41')){var _0x5d45de={};_0x5d45de[_0x54acb7['name']]={'$like':'%'+_0x2c7a79[_0x5f9f('0x33')][_0x5f9f('0x42')]+'%'};return _0x5d45de;}})});}_0x31af0f=_['merge']({},_0x31af0f,_0x2c7a79['options']);var _0x5473af={'where':_0x31af0f['where']};return db[_0x5f9f('0x2c')][_0x5f9f('0x21')](_0x5473af)[_0x5f9f('0x27')](function(_0x50d5d2){_0x4755a6[_0x5f9f('0x21')]=_0x50d5d2;if(_0x2c7a79[_0x5f9f('0x33')][_0x5f9f('0x43')]){_0x31af0f[_0x5f9f('0x44')]=[{'all':!![]}];}return db[_0x5f9f('0x2c')][_0x5f9f('0x45')](_0x31af0f);})[_0x5f9f('0x27')](function(_0x1ed82e){_0x4755a6[_0x5f9f('0x46')]=_0x1ed82e;return _0x4755a6;})[_0x5f9f('0x27')](respondWithFilteredResult(_0x3c28cf,_0x31af0f))['catch'](handleError(_0x3c28cf,null));};exports[_0x5f9f('0x47')]=function(_0x548a54,_0xeff8ec){var _0x2815ec={'raw':!![],'where':{'id':_0x548a54[_0x5f9f('0x48')]['id']}},_0x51829a={};_0x51829a[_0x5f9f('0x31')]=_[_0x5f9f('0x34')](db[_0x5f9f('0x2c')][_0x5f9f('0x2d')]);_0x51829a['query']=_[_0x5f9f('0x34')](_0x548a54[_0x5f9f('0x33')]);_0x51829a[_0x5f9f('0x35')]=_[_0x5f9f('0x36')](_0x51829a[_0x5f9f('0x31')],_0x51829a['query']);_0x2815ec[_0x5f9f('0x37')]=_[_0x5f9f('0x36')](_0x51829a[_0x5f9f('0x31')],qs[_0x5f9f('0x38')](_0x548a54[_0x5f9f('0x33')][_0x5f9f('0x38')]));_0x2815ec[_0x5f9f('0x37')]=_0x2815ec['attributes'][_0x5f9f('0x39')]?_0x2815ec['attributes']:_0x51829a[_0x5f9f('0x31')];if(_0x548a54[_0x5f9f('0x33')][_0x5f9f('0x43')]){_0x2815ec[_0x5f9f('0x44')]=[{'all':!![]}];}_0x2815ec=_['merge']({},_0x2815ec,_0x548a54[_0x5f9f('0x49')]);return db[_0x5f9f('0x2c')][_0x5f9f('0x4a')](_0x2815ec)[_0x5f9f('0x27')](handleEntityNotFound(_0xeff8ec,null))['then'](respondWithResult(_0xeff8ec,null))[_0x5f9f('0x4b')](handleError(_0xeff8ec,null));};exports[_0x5f9f('0x4c')]=function(_0x4f54d7,_0x2eca01){return db[_0x5f9f('0x2c')][_0x5f9f('0x4c')](_0x4f54d7[_0x5f9f('0x4d')],{})['then'](respondWithResult(_0x2eca01,0xc9))[_0x5f9f('0x4b')](handleError(_0x2eca01,null));};exports[_0x5f9f('0x25')]=function(_0x10350e,_0x551f66){if(_0x10350e[_0x5f9f('0x4d')]['id']){delete _0x10350e[_0x5f9f('0x4d')]['id'];}return db[_0x5f9f('0x2c')]['find']({'where':{'id':_0x10350e[_0x5f9f('0x48')]['id']}})[_0x5f9f('0x27')](handleEntityNotFound(_0x551f66,null))[_0x5f9f('0x27')](saveUpdates(_0x10350e[_0x5f9f('0x4d')],null))[_0x5f9f('0x27')](respondWithResult(_0x551f66,null))[_0x5f9f('0x4b')](handleError(_0x551f66,null));};exports[_0x5f9f('0x26')]=function(_0xc119c6,_0x28e70d){return db[_0x5f9f('0x2c')][_0x5f9f('0x4a')]({'where':{'id':_0xc119c6['params']['id']}})[_0x5f9f('0x27')](handleEntityNotFound(_0x28e70d,null))[_0x5f9f('0x27')](removeEntity(_0x28e70d,null))[_0x5f9f('0x4b')](handleError(_0x28e70d,null));};exports[_0x5f9f('0x4e')]=function(_0x149694,_0x34b185){return db['MailTransferReport']['describe']()[_0x5f9f('0x27')](respondWithResult(_0x34b185,null))[_0x5f9f('0x4b')](handleError(_0x34b185,null));}; \ No newline at end of file +var _0xfdee=['model','query','keys','intersection','attributes','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','fields','length','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xfdee,0x150));var _0xefde=function(_0xc6b104,_0x1d805a){_0xc6b104=_0xc6b104-0x0;var _0x1c6fce=_0xfdee[_0xc6b104];return _0x1c6fce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefde('0x0'));var zipdir=require(_0xefde('0x1'));var jsonpatch=require(_0xefde('0x2'));var rp=require('request-promise');var moment=require(_0xefde('0x3'));var BPromise=require(_0xefde('0x4'));var Mustache=require(_0xefde('0x5'));var util=require(_0xefde('0x6'));var path=require(_0xefde('0x7'));var sox=require(_0xefde('0x8'));var csv=require(_0xefde('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xefde('0xa'));var _=require(_0xefde('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xefde('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xefde('0x9'));var querystring=require(_0xefde('0xd'));var Papa=require(_0xefde('0xe'));var Redis=require(_0xefde('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xefde('0x10'));var as=require(_0xefde('0x11'));var hardwareService=require(_0xefde('0x12'));var logger=require(_0xefde('0x13'))(_0xefde('0x14'));var utils=require(_0xefde('0x15'));var config=require(_0xefde('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15adaf,_0x5e4898){_0x5e4898=_0x5e4898||0xcc;return function(_0x24d22d){if(_0x24d22d){return _0x15adaf[_0xefde('0x17')](_0x5e4898);}return _0x15adaf['status'](_0x5e4898)[_0xefde('0x18')]();};}function respondWithResult(_0x37c274,_0x3db265){_0x3db265=_0x3db265||0xc8;return function(_0x217996){if(_0x217996){return _0x37c274['status'](_0x3db265)[_0xefde('0x19')](_0x217996);}};}function respondWithFilteredResult(_0x2ac42c,_0x5bc806){return function(_0x31c11f){if(_0x31c11f){var _0x1e0d1f=typeof _0x5bc806[_0xefde('0x1a')]==='undefined'&&typeof _0x5bc806['limit']===_0xefde('0x1b');var _0x103b74=_0x31c11f['count'];var _0x29d9d0=_0x1e0d1f?0x0:_0x5bc806[_0xefde('0x1a')];var _0x31f8b9=_0x1e0d1f?_0x31c11f[_0xefde('0x1c')]:_0x5bc806[_0xefde('0x1a')]+_0x5bc806['limit'];var _0x2929e4;if(_0x31f8b9>=_0x103b74){_0x31f8b9=_0x103b74;_0x2929e4=0xc8;}else{_0x2929e4=0xce;}_0x2ac42c[_0xefde('0x1d')](_0x2929e4);return _0x2ac42c[_0xefde('0x1e')](_0xefde('0x1f'),_0x29d9d0+'-'+_0x31f8b9+'/'+_0x103b74)[_0xefde('0x19')](_0x31c11f);}return null;};}function patchUpdates(_0x3c71ec){return function(_0x1ed893){try{jsonpatch[_0xefde('0x20')](_0x1ed893,_0x3c71ec,!![]);}catch(_0x43f884){return BPromise[_0xefde('0x21')](_0x43f884);}return _0x1ed893[_0xefde('0x22')]();};}function saveUpdates(_0x2ae300,_0x29dc6c){return function(_0x2e751f){if(_0x2e751f){return _0x2e751f[_0xefde('0x23')](_0x2ae300)['then'](function(_0x280550){return _0x280550;});}return null;};}function removeEntity(_0x5e03ee,_0x195dc4){return function(_0xda7eef){if(_0xda7eef){return _0xda7eef[_0xefde('0x24')]()[_0xefde('0x25')](function(){_0x5e03ee[_0xefde('0x1d')](0xcc)[_0xefde('0x18')]();});}};}function handleEntityNotFound(_0x1a44ea,_0x5d5933){return function(_0x4b33b2){if(!_0x4b33b2){_0x1a44ea[_0xefde('0x17')](0x194);}return _0x4b33b2;};}function handleError(_0x1d5a13,_0x29dd1b){_0x29dd1b=_0x29dd1b||0x1f4;return function(_0x583c01){logger[_0xefde('0x26')](_0x583c01[_0xefde('0x27')]);if(_0x583c01[_0xefde('0x28')]){delete _0x583c01[_0xefde('0x28')];}_0x1d5a13[_0xefde('0x1d')](_0x29dd1b)[_0xefde('0x29')](_0x583c01);};}exports[_0xefde('0x2a')]=function(_0x35fdf8,_0x1b705){var _0x2e55c2={},_0x5c89d9={},_0x378df0={'count':0x0,'rows':[]};var _0x1347a9=_[_0xefde('0x2b')](db[_0xefde('0x2c')][_0xefde('0x2d')],function(_0x47dc2e){return{'name':_0x47dc2e[_0xefde('0x2e')],'type':_0x47dc2e[_0xefde('0x2f')][_0xefde('0x30')]};});_0x5c89d9[_0xefde('0x31')]=_[_0xefde('0x2b')](_0x1347a9,'name');_0x5c89d9[_0xefde('0x32')]=_[_0xefde('0x33')](_0x35fdf8[_0xefde('0x32')]);_0x5c89d9['filters']=_[_0xefde('0x34')](_0x5c89d9[_0xefde('0x31')],_0x5c89d9[_0xefde('0x32')]);_0x2e55c2[_0xefde('0x35')]=_[_0xefde('0x34')](_0x5c89d9[_0xefde('0x31')],qs['fields'](_0x35fdf8[_0xefde('0x32')]['fields']));_0x2e55c2[_0xefde('0x35')]=_0x2e55c2[_0xefde('0x35')]['length']?_0x2e55c2[_0xefde('0x35')]:_0x5c89d9[_0xefde('0x31')];if(!_0x35fdf8[_0xefde('0x32')][_0xefde('0x36')](_0xefde('0x37'))){_0x2e55c2['limit']=qs[_0xefde('0x38')](_0x35fdf8[_0xefde('0x32')][_0xefde('0x38')]);_0x2e55c2['offset']=qs[_0xefde('0x1a')](_0x35fdf8[_0xefde('0x32')][_0xefde('0x1a')]);}_0x2e55c2['order']=qs[_0xefde('0x39')](_0x35fdf8[_0xefde('0x32')][_0xefde('0x39')]);_0x2e55c2[_0xefde('0x3a')]=qs[_0xefde('0x3b')](_[_0xefde('0x3c')](_0x35fdf8[_0xefde('0x32')],_0x5c89d9[_0xefde('0x3b')]),_0x1347a9);if(_0x35fdf8['query'][_0xefde('0x3d')]){_0x2e55c2[_0xefde('0x3a')]=_[_0xefde('0x3e')](_0x2e55c2[_0xefde('0x3a')],{'$or':_['map'](_0x1347a9,function(_0x4af4a4){if(_0x4af4a4[_0xefde('0x2f')]!==_0xefde('0x3f')){var _0x472bc9={};_0x472bc9[_0x4af4a4['name']]={'$like':'%'+_0x35fdf8[_0xefde('0x32')][_0xefde('0x3d')]+'%'};return _0x472bc9;}})});}_0x2e55c2=_['merge']({},_0x2e55c2,_0x35fdf8['options']);var _0xf830a0={'where':_0x2e55c2[_0xefde('0x3a')]};return db[_0xefde('0x2c')]['count'](_0xf830a0)[_0xefde('0x25')](function(_0x3f0c65){_0x378df0['count']=_0x3f0c65;if(_0x35fdf8[_0xefde('0x32')][_0xefde('0x40')]){_0x2e55c2[_0xefde('0x41')]=[{'all':!![]}];}return db[_0xefde('0x2c')][_0xefde('0x42')](_0x2e55c2);})[_0xefde('0x25')](function(_0x4578f0){_0x378df0['rows']=_0x4578f0;return _0x378df0;})['then'](respondWithFilteredResult(_0x1b705,_0x2e55c2))[_0xefde('0x43')](handleError(_0x1b705,null));};exports[_0xefde('0x44')]=function(_0x32cc67,_0x5e3e49){var _0x33710d={'raw':!![],'where':{'id':_0x32cc67[_0xefde('0x45')]['id']}},_0x5461b4={};_0x5461b4[_0xefde('0x31')]=_[_0xefde('0x33')](db[_0xefde('0x2c')][_0xefde('0x2d')]);_0x5461b4['query']=_[_0xefde('0x33')](_0x32cc67[_0xefde('0x32')]);_0x5461b4['filters']=_['intersection'](_0x5461b4[_0xefde('0x31')],_0x5461b4[_0xefde('0x32')]);_0x33710d[_0xefde('0x35')]=_[_0xefde('0x34')](_0x5461b4['model'],qs[_0xefde('0x46')](_0x32cc67[_0xefde('0x32')][_0xefde('0x46')]));_0x33710d['attributes']=_0x33710d[_0xefde('0x35')][_0xefde('0x47')]?_0x33710d[_0xefde('0x35')]:_0x5461b4[_0xefde('0x31')];if(_0x32cc67['query'][_0xefde('0x40')]){_0x33710d[_0xefde('0x41')]=[{'all':!![]}];}_0x33710d=_[_0xefde('0x3e')]({},_0x33710d,_0x32cc67[_0xefde('0x48')]);return db[_0xefde('0x2c')][_0xefde('0x49')](_0x33710d)[_0xefde('0x25')](handleEntityNotFound(_0x5e3e49,null))['then'](respondWithResult(_0x5e3e49,null))['catch'](handleError(_0x5e3e49,null));};exports[_0xefde('0x4a')]=function(_0x22c6de,_0x5d2842){return db[_0xefde('0x2c')]['create'](_0x22c6de[_0xefde('0x4b')],{})[_0xefde('0x25')](respondWithResult(_0x5d2842,0xc9))[_0xefde('0x43')](handleError(_0x5d2842,null));};exports[_0xefde('0x23')]=function(_0x522f6e,_0x651240){if(_0x522f6e[_0xefde('0x4b')]['id']){delete _0x522f6e['body']['id'];}return db[_0xefde('0x2c')]['find']({'where':{'id':_0x522f6e[_0xefde('0x45')]['id']}})[_0xefde('0x25')](handleEntityNotFound(_0x651240,null))[_0xefde('0x25')](saveUpdates(_0x522f6e[_0xefde('0x4b')],null))[_0xefde('0x25')](respondWithResult(_0x651240,null))[_0xefde('0x43')](handleError(_0x651240,null));};exports[_0xefde('0x24')]=function(_0x4c0dda,_0x17f6eb){return db[_0xefde('0x2c')][_0xefde('0x49')]({'where':{'id':_0x4c0dda[_0xefde('0x45')]['id']}})[_0xefde('0x25')](handleEntityNotFound(_0x17f6eb,null))[_0xefde('0x25')](removeEntity(_0x17f6eb,null))['catch'](handleError(_0x17f6eb,null));};exports[_0xefde('0x4c')]=function(_0x357bac,_0x46c09c){return db[_0xefde('0x2c')][_0xefde('0x4c')]()[_0xefde('0x25')](respondWithResult(_0x46c09c,null))[_0xefde('0x43')](handleError(_0x46c09c,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index d937fbf..d6a13df 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 _0xd6d2=['util','api','moment','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash'];(function(_0x4f676e,_0x571ace){var _0x542a9b=function(_0x31a202){while(--_0x31a202){_0x4f676e['push'](_0x4f676e['shift']());}};_0x542a9b(++_0x571ace);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x2f3e0b,_0x589362){_0x2f3e0b=_0x2f3e0b-0x0;var _0x14ca0c=_0xd6d2[_0x2f3e0b];return _0x14ca0c;};'use strict';var _=require(_0x2d6d('0x0'));var util=require(_0x2d6d('0x1'));var logger=require('../../config/logger')(_0x2d6d('0x2'));var moment=require(_0x2d6d('0x3'));var BPromise=require('bluebird');var rp=require(_0x2d6d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d6d('0x5'));var config=require(_0x2d6d('0x6'));var attributes=require(_0x2d6d('0x7'));module['exports']=function(_0xfcdb1d,_0x132361){return _0xfcdb1d[_0x2d6d('0x8')](_0x2d6d('0x9'),attributes,{'tableName':_0x2d6d('0xa'),'paranoid':![],'indexes':[{'name':_0x2d6d('0xb'),'fields':[_0x2d6d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa44c=['path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','api','moment','bluebird','request-promise'];(function(_0x1ca1d2,_0xd4bf09){var _0x246e02=function(_0x11c2d3){while(--_0x11c2d3){_0x1ca1d2['push'](_0x1ca1d2['shift']());}};_0x246e02(++_0xd4bf09);}(_0xa44c,0x1a9));var _0xca44=function(_0x431e61,_0x30057f){_0x431e61=_0x431e61-0x0;var _0x542cc2=_0xa44c[_0x431e61];return _0x542cc2;};'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('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index ec8c62d..53482f8 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 _0x4754=['MailTransferReport,\x20%s,\x20%s','message','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4bc7e5,_0x54c463){var _0x35c7da=function(_0x52dcb5){while(--_0x52dcb5){_0x4bc7e5['push'](_0x4bc7e5['shift']());}};_0x35c7da(++_0x54c463);}(_0x4754,0x75));var _0x4475=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4754[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4475('0x0'));var BPromise=require(_0x4475('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4475('0x2'))['db'];var utils=require(_0x4475('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x4475('0x4'));var jayson=require(_0x4475('0x5'));var client=jayson[_0x4475('0x6')][_0x4475('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x103799,_0x99ae52,_0x41c0d3){return new BPromise(function(_0x57a445,_0x4abb91){return client[_0x4475('0x8')](_0x103799,_0x41c0d3)[_0x4475('0x9')](function(_0x423a4a){logger[_0x4475('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x99ae52,_0x4475('0xb'));logger[_0x4475('0xc')](_0x4475('0xd'),_0x99ae52,_0x4475('0xb'),JSON[_0x4475('0xe')](_0x423a4a));if(_0x423a4a[_0x4475('0xf')]){if(_0x423a4a[_0x4475('0xf')]['code']===0x1f4){logger['error'](_0x4475('0x10'),_0x99ae52,_0x423a4a['error']['message']);return _0x4abb91(_0x423a4a[_0x4475('0xf')]['message']);}logger[_0x4475('0xf')](_0x4475('0x10'),_0x99ae52,_0x423a4a[_0x4475('0xf')][_0x4475('0x11')]);return _0x57a445(_0x423a4a['error'][_0x4475('0x11')]);}else{logger[_0x4475('0xa')](_0x4475('0x10'),_0x99ae52,_0x4475('0xb'));_0x57a445(_0x423a4a['result'][_0x4475('0x11')]);}})[_0x4475('0x12')](function(_0x4f9bb7){logger[_0x4475('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x99ae52,_0x4f9bb7);_0x4abb91(_0x4f9bb7);});});} \ No newline at end of file +var _0x629c=['stringify','error','message','MailTransferReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x629c,0x96));var _0xc629=function(_0x2c93ac,_0x1b47b8){_0x2c93ac=_0x2c93ac-0x0;var _0xd3284d=_0x629c[_0x2c93ac];return _0xd3284d;};'use strict';var _=require(_0xc629('0x0'));var util=require('util');var moment=require(_0xc629('0x1'));var BPromise=require(_0xc629('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc629('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc629('0x4'));var config=require(_0xc629('0x5'));var jayson=require(_0xc629('0x6'));var client=jayson[_0xc629('0x7')][_0xc629('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b0913,_0x55211b,_0x2bf6fd){return new BPromise(function(_0x2c9e28,_0x5eda94){return client['request'](_0x4b0913,_0x2bf6fd)['then'](function(_0x27dd7b){logger[_0xc629('0x9')]('MailTransferReport,\x20%s,\x20%s',_0x55211b,_0xc629('0xa'));logger[_0xc629('0xb')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x55211b,_0xc629('0xa'),JSON[_0xc629('0xc')](_0x27dd7b));if(_0x27dd7b[_0xc629('0xd')]){if(_0x27dd7b[_0xc629('0xd')]['code']===0x1f4){logger[_0xc629('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x55211b,_0x27dd7b[_0xc629('0xd')][_0xc629('0xe')]);return _0x5eda94(_0x27dd7b[_0xc629('0xd')][_0xc629('0xe')]);}logger['error'](_0xc629('0xf'),_0x55211b,_0x27dd7b[_0xc629('0xd')][_0xc629('0xe')]);return _0x2c9e28(_0x27dd7b[_0xc629('0xd')]['message']);}else{logger[_0xc629('0x9')]('MailTransferReport,\x20%s,\x20%s',_0x55211b,_0xc629('0xa'));_0x2c9e28(_0x27dd7b[_0xc629('0x10')][_0xc629('0xe')]);}})[_0xc629('0x11')](function(_0x1cebcc){logger[_0xc629('0xd')](_0xc629('0xf'),_0x55211b,_0x1cebcc);_0x5eda94(_0x1cebcc);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 5541b30..0339baa 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 _0x85d7=['../../config/environment','./memberReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x48a8ec,_0x35e2f0){var _0x2998a2=function(_0x223042){while(--_0x223042){_0x48a8ec['push'](_0x48a8ec['shift']());}};_0x2998a2(++_0x35e2f0);}(_0x85d7,0x188));var _0x785d=function(_0x599aaf,_0x3d3622){_0x599aaf=_0x599aaf-0x0;var _0xd995f3=_0x85d7[_0x599aaf];return _0xd995f3;};'use strict';var multer=require(_0x785d('0x0'));var util=require('util');var path=require(_0x785d('0x1'));var timeout=require(_0x785d('0x2'));var express=require(_0x785d('0x3'));var router=express[_0x785d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x785d('0x5'));var interaction=require(_0x785d('0x6'));var config=require(_0x785d('0x7'));var controller=require(_0x785d('0x8'));router[_0x785d('0x9')]('/',auth[_0x785d('0xa')](),controller['index']);router['get'](_0x785d('0xb'),auth[_0x785d('0xa')](),controller['describe']);router[_0x785d('0x9')](_0x785d('0xc'),auth[_0x785d('0xa')](),controller[_0x785d('0xd')]);router[_0x785d('0xe')]('/',auth[_0x785d('0xa')](),controller[_0x785d('0xf')]);router[_0x785d('0x10')](_0x785d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x785d('0x11')](_0x785d('0xc'),auth[_0x785d('0xa')](),controller[_0x785d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x4d93=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','index','get','/describe','isAuthenticated','put','/:id','update','delete'];(function(_0x1fbc96,_0x2f8836){var _0x5577a6=function(_0xfb7a25){while(--_0xfb7a25){_0x1fbc96['push'](_0x1fbc96['shift']());}};_0x5577a6(++_0x2f8836);}(_0x4d93,0x145));var _0x34d9=function(_0x3a59ce,_0x8ad678){_0x3a59ce=_0x3a59ce-0x0;var _0x38bcd0=_0x4d93[_0x3a59ce];return _0x38bcd0;};'use strict';var multer=require(_0x34d9('0x0'));var util=require(_0x34d9('0x1'));var path=require(_0x34d9('0x2'));var timeout=require('connect-timeout');var express=require(_0x34d9('0x3'));var router=express[_0x34d9('0x4')]();var fs_extra=require(_0x34d9('0x5'));var auth=require(_0x34d9('0x6'));var interaction=require(_0x34d9('0x7'));var config=require('../../config/environment');var controller=require(_0x34d9('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x34d9('0x9')]);router[_0x34d9('0xa')](_0x34d9('0xb'),auth[_0x34d9('0xc')](),controller['describe']);router[_0x34d9('0xa')]('/:id',auth[_0x34d9('0xc')](),controller['show']);router['post']('/',auth[_0x34d9('0xc')](),controller['create']);router[_0x34d9('0xd')](_0x34d9('0xe'),auth['isAuthenticated'](),controller[_0x34d9('0xf')]);router[_0x34d9('0x10')](_0x34d9('0xe'),auth[_0x34d9('0xc')](),controller[_0x34d9('0x11')]);module[_0x34d9('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 8dc84aa..a13342b 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 _0x56c7=['exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','seconds','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56c7,0x6e));var _0x756c=function(_0x566168,_0x4c39af){_0x566168=_0x566168-0x0;var _0x4e1f7a=_0x56c7[_0x566168];return _0x4e1f7a;};'use strict';var Sequelize=require(_0x756c('0x0'));var moment=require(_0x756c('0x1'));module[_0x756c('0x2')]={'channel':{'type':Sequelize[_0x756c('0x3')]},'membername':{'type':Sequelize[_0x756c('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x756c('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x756c('0x4')},'duration':{'type':Sequelize[_0x756c('0x5')]},'enterAt':{'type':Sequelize[_0x756c('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x24a105){var _0x3161d2=moment(_0x24a105);var _0x5a52e9=moment(this['getDataValue'](_0x756c('0x7')));var _0x12e5f0=_0x3161d2['diff'](_0x5a52e9,_0x756c('0x8'));this[_0x756c('0x9')](_0x756c('0xa'),_0x24a105);this['setDataValue'](_0x756c('0xb'),_0x12e5f0>=0x0?_0x12e5f0:null);}},'data1':{'type':Sequelize[_0x756c('0x3')],'comment':_0x756c('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x756c('0xd')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x756c('0x3')],'comment':_0x756c('0xe')},'data5':{'type':Sequelize[_0x756c('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x756c('0x3')]},'internal':{'type':Sequelize[_0x756c('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4fb6=['talk:[queue]','INTEGER','sequelize','exports','STRING','DEFAULT\x20PAUSE','DATE','diff','setDataValue','exitAt','duration','talk:[dial\x20string]'];(function(_0x3f8fcf,_0x461a66){var _0x5c215c=function(_0x3b2671){while(--_0x3b2671){_0x3f8fcf['push'](_0x3f8fcf['shift']());}};_0x5c215c(++_0x461a66);}(_0x4fb6,0x92));var _0x64fb=function(_0x21d36e,_0x5dc096){_0x21d36e=_0x21d36e-0x0;var _0x4cc307=_0x4fb6[_0x21d36e];return _0x4cc307;};'use strict';var Sequelize=require(_0x64fb('0x0'));var moment=require('moment');module[_0x64fb('0x1')]={'channel':{'type':Sequelize[_0x64fb('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0x64fb('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x64fb('0x4')],'set':function(_0x442339){var _0x4e70df=moment(_0x442339);var _0x417444=moment(this['getDataValue']('enterAt'));var _0x4f9fd9=_0x4e70df[_0x64fb('0x5')](_0x417444,'seconds');this[_0x64fb('0x6')](_0x64fb('0x7'),_0x442339);this[_0x64fb('0x6')](_0x64fb('0x8'),_0x4f9fd9>=0x0?_0x4f9fd9:null);}},'data1':{'type':Sequelize[_0x64fb('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x64fb('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x64fb('0x2')],'comment':_0x64fb('0x9')},'data5':{'type':Sequelize['STRING'],'comment':_0x64fb('0xa')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x64fb('0xb')]},'uniqueid':{'type':Sequelize[_0x64fb('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 5bfd064..1d5f05f 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 _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x465178,_0x550786){var _0xfad3f3=function(_0x5d8b9b){while(--_0x5d8b9b){_0x465178['push'](_0x465178['shift']());}};_0xfad3f3(++_0x550786);}(_0x3e74,0x175));var _0x43e7=function(_0x474f1e,_0x128f29){_0x474f1e=_0x474f1e-0x0;var _0x31be22=_0x3e74[_0x474f1e];return _0x31be22;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,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(_0x1ac08f,_0x30db03){var _0x58c943=function(_0x15cac4){while(--_0x15cac4){_0x1ac08f['push'](_0x1ac08f['shift']());}};_0x58c943(++_0x30db03);}(_0x008c,0x188));var _0xc008=function(_0x449e84,_0x505ae7){_0x449e84=_0x449e84-0x0;var _0x72d311=_0x008c[_0x449e84];return _0x72d311;};'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 6a4a053..0610e55 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 _0xf51f=['path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','membername','interface','lodash','util','api','moment','request-promise'];(function(_0x1115fc,_0x3f6384){var _0x4fd5d5=function(_0x4a22b9){while(--_0x4a22b9){_0x1115fc['push'](_0x1115fc['shift']());}};_0x4fd5d5(++_0x3f6384);}(_0xf51f,0x19f));var _0xff51=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0xf51f[_0x1b1e76];return _0x3d743a;};'use strict';var _=require(_0xff51('0x0'));var util=require(_0xff51('0x1'));var logger=require('../../config/logger')(_0xff51('0x2'));var moment=require(_0xff51('0x3'));var BPromise=require('bluebird');var rp=require(_0xff51('0x4'));var fs=require('fs');var path=require(_0xff51('0x5'));var rimraf=require(_0xff51('0x6'));var config=require(_0xff51('0x7'));var attributes=require(_0xff51('0x8'));module[_0xff51('0x9')]=function(_0x38e3bc,_0x1cf663){return _0x38e3bc[_0xff51('0xa')](_0xff51('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xff51('0xc'),_0xff51('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['membername_interface','membername','interface','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','exports','define','report_member'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0x5fc3[_0x2bf466];return _0x856885;};'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')]('MemberReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xd'),_0x35fc('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 1b71bb7..25b087b 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 _0x90b1=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','map','include','model','then','create','CreateMemberReport','UpdateMemberReport','update','body','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90b1,0x1bb));var _0x190b=function(_0x29d34a,_0x3632d9){_0x29d34a=_0x29d34a-0x0;var _0x4baaa8=_0x90b1[_0x29d34a];return _0x4baaa8;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('MemberReport,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});}exports[_0x190b('0x14')]=function(_0x21e458){var _0x56d07a=this;return new Promise(function(_0x16c009,_0x50a3c4){return db[_0x190b('0x15')][_0x190b('0x16')]({'raw':_0x21e458[_0x190b('0x17')]?_0x21e458[_0x190b('0x17')][_0x190b('0x18')]===undefined?!![]:![]:!![],'where':_0x21e458[_0x190b('0x17')]?_0x21e458['options'][_0x190b('0x19')]||null:null,'attributes':_0x21e458[_0x190b('0x17')]?_0x21e458['options'][_0x190b('0x1a')]||null:null,'limit':_0x21e458['options']?_0x21e458['options'][_0x190b('0x1b')]||null:null,'include':_0x21e458[_0x190b('0x17')]?_0x21e458[_0x190b('0x17')]['include']?_[_0x190b('0x1c')](_0x21e458[_0x190b('0x17')][_0x190b('0x1d')],function(_0x292ce3){return{'model':db[_0x292ce3[_0x190b('0x1e')]],'as':_0x292ce3['as'],'attributes':_0x292ce3[_0x190b('0x1a')],'include':_0x292ce3[_0x190b('0x1d')]?_['map'](_0x292ce3['include'],function(_0x262a63){return{'model':db[_0x262a63[_0x190b('0x1e')]],'as':_0x262a63['as'],'attributes':_0x262a63['attributes'],'include':_0x262a63['include']?_[_0x190b('0x1c')](_0x262a63['include'],function(_0x328e5e){return{'model':db[_0x328e5e[_0x190b('0x1e')]],'as':_0x328e5e['as'],'attributes':_0x328e5e['attributes']};}):[]};}):[]};}):[]:[]})[_0x190b('0x1f')](function(_0x1deea6){logger['info'](_0x190b('0x14'),_0x21e458);logger[_0x190b('0xc')](_0x190b('0x14'),_0x21e458,JSON['stringify'](_0x1deea6));_0x16c009(_0x1deea6);})['catch'](function(_0x3730cc){logger['error'](_0x190b('0x14'),_0x3730cc[_0x190b('0x11')],_0x21e458);_0x50a3c4(_0x56d07a['error'](0x1f4,_0x3730cc[_0x190b('0x11')]));});});};exports['CreateMemberReport']=function(_0x40d060){var _0x4ff5a6=this;return new Promise(function(_0x19600d,_0x5650e1){return db[_0x190b('0x15')][_0x190b('0x20')](_0x40d060['body'],{'raw':_0x40d060[_0x190b('0x17')]?_0x40d060[_0x190b('0x17')][_0x190b('0x18')]===undefined?!![]:![]:!![]})[_0x190b('0x1f')](function(_0x3c7488){logger[_0x190b('0x9')](_0x190b('0x21'),_0x40d060);logger[_0x190b('0xc')]('CreateMemberReport',_0x40d060,JSON['stringify'](_0x3c7488));_0x19600d(_0x3c7488);})[_0x190b('0x13')](function(_0x2e44ed){logger['error'](_0x190b('0x21'),_0x2e44ed[_0x190b('0x11')],_0x40d060);_0x5650e1(_0x4ff5a6[_0x190b('0xf')](0x1f4,_0x2e44ed[_0x190b('0x11')]));});});};exports[_0x190b('0x22')]=function(_0x228c73){var _0x5bda80=this;return new Promise(function(_0x5492b0,_0x5f3b45){return db[_0x190b('0x15')][_0x190b('0x23')](_0x228c73[_0x190b('0x24')],{'raw':_0x228c73['options']?_0x228c73[_0x190b('0x17')][_0x190b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x228c73[_0x190b('0x17')]?_0x228c73['options'][_0x190b('0x19')]||null:null,'attributes':_0x228c73['options']?_0x228c73['options'][_0x190b('0x1a')]||null:null,'limit':_0x228c73[_0x190b('0x17')]?_0x228c73['options'][_0x190b('0x1b')]||null:null})[_0x190b('0x1f')](function(_0x161756){logger['info'](_0x190b('0x22'),_0x228c73);logger[_0x190b('0xc')]('UpdateMemberReport',_0x228c73,JSON['stringify'](_0x161756));_0x5492b0(_0x161756);})[_0x190b('0x13')](function(_0x4ab72d){logger[_0x190b('0xf')](_0x190b('0x22'),_0x4ab72d[_0x190b('0x11')],_0x228c73);_0x5f3b45(_0x5bda80[_0x190b('0xf')](0x1f4,_0x4ab72d['message']));});});}; \ No newline at end of file +var _0xbf25=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetMemberReport','CreateMemberReport','MemberReport','UpdateMemberReport'];(function(_0x188339,_0x26289f){var _0x2b52f3=function(_0x1f2bc6){while(--_0x1f2bc6){_0x188339['push'](_0x188339['shift']());}};_0x2b52f3(++_0x26289f);}(_0xbf25,0x15e));var _0x5bf2=function(_0x4c2ccd,_0x566137){_0x4c2ccd=_0x4c2ccd-0x0;var _0x328871=_0xbf25[_0x4c2ccd];return _0x328871;};'use strict';var _=require(_0x5bf2('0x0'));var util=require('util');var moment=require(_0x5bf2('0x1'));var BPromise=require(_0x5bf2('0x2'));var rs=require(_0x5bf2('0x3'));var fs=require('fs');var Redis=require(_0x5bf2('0x4'));var db=require(_0x5bf2('0x5'))['db'];var utils=require(_0x5bf2('0x6'));var logger=require('../../config/logger')(_0x5bf2('0x7'));var config=require('../../config/environment');var jayson=require(_0x5bf2('0x8'));var client=jayson[_0x5bf2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29c6c8,_0x382b52,_0x3fa095){return new BPromise(function(_0x53acc6,_0x45af34){return client[_0x5bf2('0xa')](_0x29c6c8,_0x3fa095)[_0x5bf2('0xb')](function(_0x4b8772){logger[_0x5bf2('0xc')](_0x5bf2('0xd'),_0x382b52,_0x5bf2('0xe'));logger[_0x5bf2('0xf')](_0x5bf2('0x10'),_0x382b52,_0x5bf2('0xe'),JSON[_0x5bf2('0x11')](_0x4b8772));if(_0x4b8772[_0x5bf2('0x12')]){if(_0x4b8772[_0x5bf2('0x12')][_0x5bf2('0x13')]===0x1f4){logger[_0x5bf2('0x12')](_0x5bf2('0xd'),_0x382b52,_0x4b8772[_0x5bf2('0x12')]['message']);return _0x45af34(_0x4b8772['error'][_0x5bf2('0x14')]);}logger[_0x5bf2('0x12')]('MemberReport,\x20%s,\x20%s',_0x382b52,_0x4b8772[_0x5bf2('0x12')][_0x5bf2('0x14')]);return _0x53acc6(_0x4b8772[_0x5bf2('0x12')][_0x5bf2('0x14')]);}else{logger[_0x5bf2('0xc')](_0x5bf2('0xd'),_0x382b52,_0x5bf2('0xe'));_0x53acc6(_0x4b8772[_0x5bf2('0x15')][_0x5bf2('0x14')]);}})[_0x5bf2('0x16')](function(_0x271a6d){logger[_0x5bf2('0x12')]('MemberReport,\x20%s,\x20%s',_0x382b52,_0x271a6d);_0x45af34(_0x271a6d);});});}exports['GetMemberReport']=function(_0x2f87ff){var _0x4af54a=this;return new Promise(function(_0x3df0cd,_0x300834){return db['MemberReport']['findAll']({'raw':_0x2f87ff[_0x5bf2('0x17')]?_0x2f87ff[_0x5bf2('0x17')][_0x5bf2('0x18')]===undefined?!![]:![]:!![],'where':_0x2f87ff[_0x5bf2('0x17')]?_0x2f87ff[_0x5bf2('0x17')][_0x5bf2('0x19')]||null:null,'attributes':_0x2f87ff[_0x5bf2('0x17')]?_0x2f87ff[_0x5bf2('0x17')][_0x5bf2('0x1a')]||null:null,'limit':_0x2f87ff['options']?_0x2f87ff['options'][_0x5bf2('0x1b')]||null:null,'include':_0x2f87ff[_0x5bf2('0x17')]?_0x2f87ff[_0x5bf2('0x17')][_0x5bf2('0x1c')]?_[_0x5bf2('0x1d')](_0x2f87ff[_0x5bf2('0x17')][_0x5bf2('0x1c')],function(_0x2eea63){return{'model':db[_0x2eea63[_0x5bf2('0x1e')]],'as':_0x2eea63['as'],'attributes':_0x2eea63[_0x5bf2('0x1a')],'include':_0x2eea63[_0x5bf2('0x1c')]?_[_0x5bf2('0x1d')](_0x2eea63[_0x5bf2('0x1c')],function(_0x5ae161){return{'model':db[_0x5ae161[_0x5bf2('0x1e')]],'as':_0x5ae161['as'],'attributes':_0x5ae161['attributes'],'include':_0x5ae161[_0x5bf2('0x1c')]?_[_0x5bf2('0x1d')](_0x5ae161['include'],function(_0xc028a0){return{'model':db[_0xc028a0[_0x5bf2('0x1e')]],'as':_0xc028a0['as'],'attributes':_0xc028a0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x8c54cd){logger[_0x5bf2('0xc')](_0x5bf2('0x1f'),_0x2f87ff);logger[_0x5bf2('0xf')]('GetMemberReport',_0x2f87ff,JSON[_0x5bf2('0x11')](_0x8c54cd));_0x3df0cd(_0x8c54cd);})[_0x5bf2('0x16')](function(_0x3cb9e6){logger[_0x5bf2('0x12')](_0x5bf2('0x1f'),_0x3cb9e6[_0x5bf2('0x14')],_0x2f87ff);_0x300834(_0x4af54a['error'](0x1f4,_0x3cb9e6[_0x5bf2('0x14')]));});});};exports[_0x5bf2('0x20')]=function(_0x44a6a3){var _0x59ac8b=this;return new Promise(function(_0x7023ae,_0x432de6){return db[_0x5bf2('0x21')]['create'](_0x44a6a3['body'],{'raw':_0x44a6a3['options']?_0x44a6a3[_0x5bf2('0x17')][_0x5bf2('0x18')]===undefined?!![]:![]:!![]})[_0x5bf2('0xb')](function(_0x36e535){logger[_0x5bf2('0xc')]('CreateMemberReport',_0x44a6a3);logger['debug'](_0x5bf2('0x20'),_0x44a6a3,JSON[_0x5bf2('0x11')](_0x36e535));_0x7023ae(_0x36e535);})[_0x5bf2('0x16')](function(_0x39303a){logger[_0x5bf2('0x12')](_0x5bf2('0x20'),_0x39303a[_0x5bf2('0x14')],_0x44a6a3);_0x432de6(_0x59ac8b[_0x5bf2('0x12')](0x1f4,_0x39303a[_0x5bf2('0x14')]));});});};exports[_0x5bf2('0x22')]=function(_0x3673f3){var _0x1a22c2=this;return new Promise(function(_0x4076de,_0x4d4d33){return db[_0x5bf2('0x21')]['update'](_0x3673f3['body'],{'raw':_0x3673f3['options']?_0x3673f3['options'][_0x5bf2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3673f3[_0x5bf2('0x17')]?_0x3673f3[_0x5bf2('0x17')][_0x5bf2('0x19')]||null:null,'attributes':_0x3673f3[_0x5bf2('0x17')]?_0x3673f3['options']['attributes']||null:null,'limit':_0x3673f3['options']?_0x3673f3[_0x5bf2('0x17')][_0x5bf2('0x1b')]||null:null})['then'](function(_0x4db032){logger['info']('UpdateMemberReport',_0x3673f3);logger[_0x5bf2('0xf')]('UpdateMemberReport',_0x3673f3,JSON[_0x5bf2('0x11')](_0x4db032));_0x4076de(_0x4db032);})[_0x5bf2('0x16')](function(_0x1e845e){logger[_0x5bf2('0x12')](_0x5bf2('0x22'),_0x1e845e['message'],_0x3673f3);_0x4d4d33(_0x1a22c2['error'](0x1f4,_0x1e845e[_0x5bf2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index f460828..e13907e 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 _0x9559=['index','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./migration.controller'];(function(_0x4ba48c,_0x56b83c){var _0x6d98c7=function(_0x1ad7d2){while(--_0x1ad7d2){_0x4ba48c['push'](_0x4ba48c['shift']());}};_0x6d98c7(++_0x56b83c);}(_0x9559,0x12b));var _0x9955=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0x9559[_0x2650e9];return _0x3511c8;};'use strict';var multer=require(_0x9955('0x0'));var util=require('util');var path=require(_0x9955('0x1'));var timeout=require('connect-timeout');var express=require(_0x9955('0x2'));var router=express[_0x9955('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9955('0x4'));var interaction=require(_0x9955('0x5'));var config=require('../../config/environment');var controller=require(_0x9955('0x6'));router['get']('/',controller[_0x9955('0x7')]);module[_0x9955('0x8')]=router; \ No newline at end of file +var _0xcea5=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','multer','util','path','connect-timeout','express'];(function(_0x512b1e,_0x4a8c9b){var _0x3e029b=function(_0x2d6a73){while(--_0x2d6a73){_0x512b1e['push'](_0x512b1e['shift']());}};_0x3e029b(++_0x4a8c9b);}(_0xcea5,0xed));var _0x5cea=function(_0x418627,_0x4e30ac){_0x418627=_0x418627-0x0;var _0x384d53=_0xcea5[_0x418627];return _0x384d53;};'use strict';var multer=require(_0x5cea('0x0'));var util=require(_0x5cea('0x1'));var path=require(_0x5cea('0x2'));var timeout=require(_0x5cea('0x3'));var express=require(_0x5cea('0x4'));var router=express['Router']();var fs_extra=require(_0x5cea('0x5'));var auth=require(_0x5cea('0x6'));var interaction=require(_0x5cea('0x7'));var config=require(_0x5cea('0x8'));var controller=require('./migration.controller');router[_0x5cea('0x9')]('/',controller[_0x5cea('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 0659d7a..a790778 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 _0xef0e=['version','exports','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xef0e,0xee));var _0xeef0=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xef0e[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require('sequelize');module[_0xeef0('0x0')]={'version':{'type':Sequelize[_0xeef0('0x1')],'unique':_0xeef0('0x2')}}; \ No newline at end of file +var _0x6873=['version','sequelize','exports'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x6873,0x112));var _0x3687=function(_0x8e9386,_0x3cc60f){_0x8e9386=_0x8e9386-0x0;var _0x4abf26=_0x6873[_0x8e9386];return _0x4abf26;};'use strict';var Sequelize=require(_0x3687('0x0'));module[_0x3687('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x3687('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index da74be0..de68238 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 _0xb987=['hasOwnProperty','nolimit','sort','filters','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','name','send','map','Migration','type','model','query','keys','attributes','intersection','fields','length'];(function(_0x3afea1,_0x508b08){var _0x40890d=function(_0x5540d6){while(--_0x5540d6){_0x3afea1['push'](_0x3afea1['shift']());}};_0x40890d(++_0x508b08);}(_0xb987,0x134));var _0x7b98=function(_0x57c60f,_0x508f52){_0x57c60f=_0x57c60f-0x0;var _0x8d8df=_0xb987[_0x57c60f];return _0x8d8df;};'use strict';var emlformat=require(_0x7b98('0x0'));var rimraf=require(_0x7b98('0x1'));var zipdir=require(_0x7b98('0x2'));var jsonpatch=require(_0x7b98('0x3'));var rp=require(_0x7b98('0x4'));var moment=require('moment');var BPromise=require(_0x7b98('0x5'));var Mustache=require(_0x7b98('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7b98('0x7'));var csv=require(_0x7b98('0x8'));var ejs=require(_0x7b98('0x9'));var fs=require('fs');var fs_extra=require(_0x7b98('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7b98('0xb'));var jsforce=require(_0x7b98('0xc'));var deskjs=require(_0x7b98('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7b98('0xe'));var Papa=require(_0x7b98('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7b98('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b98('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fa5dd,_0x4ad8a8){_0x4ad8a8=_0x4ad8a8||0xcc;return function(_0xb153bd){if(_0xb153bd){return _0x2fa5dd['sendStatus'](_0x4ad8a8);}return _0x2fa5dd['status'](_0x4ad8a8)[_0x7b98('0x12')]();};}function respondWithResult(_0x100305,_0x41d1bf){_0x41d1bf=_0x41d1bf||0xc8;return function(_0x4951f7){if(_0x4951f7){return _0x100305['status'](_0x41d1bf)['json'](_0x4951f7);}};}function respondWithFilteredResult(_0x1e6a65,_0x3bc31d){return function(_0xb4e839){if(_0xb4e839){var _0x5c9fd7=typeof _0x3bc31d[_0x7b98('0x13')]===_0x7b98('0x14')&&typeof _0x3bc31d['limit']===_0x7b98('0x14');var _0x2b6fb5=_0xb4e839['count'];var _0x3cd151=_0x5c9fd7?0x0:_0x3bc31d[_0x7b98('0x13')];var _0x2d617e=_0x5c9fd7?_0xb4e839[_0x7b98('0x15')]:_0x3bc31d['offset']+_0x3bc31d[_0x7b98('0x16')];var _0x48f39a;if(_0x2d617e>=_0x2b6fb5){_0x2d617e=_0x2b6fb5;_0x48f39a=0xc8;}else{_0x48f39a=0xce;}_0x1e6a65[_0x7b98('0x17')](_0x48f39a);return _0x1e6a65[_0x7b98('0x18')](_0x7b98('0x19'),_0x3cd151+'-'+_0x2d617e+'/'+_0x2b6fb5)[_0x7b98('0x1a')](_0xb4e839);}return null;};}function patchUpdates(_0xb0bb5c){return function(_0x2f2be6){try{jsonpatch[_0x7b98('0x1b')](_0x2f2be6,_0xb0bb5c,!![]);}catch(_0x1952d5){return BPromise[_0x7b98('0x1c')](_0x1952d5);}return _0x2f2be6['save']();};}function saveUpdates(_0x22b0c1,_0x99720f){return function(_0x2797f8){if(_0x2797f8){return _0x2797f8[_0x7b98('0x1d')](_0x22b0c1)[_0x7b98('0x1e')](function(_0x388c4d){return _0x388c4d;});}return null;};}function removeEntity(_0x2a2030,_0x3145a0){return function(_0x4a2b00){if(_0x4a2b00){return _0x4a2b00[_0x7b98('0x1f')]()[_0x7b98('0x1e')](function(){_0x2a2030[_0x7b98('0x17')](0xcc)[_0x7b98('0x12')]();});}};}function handleEntityNotFound(_0x2171c2,_0x203108){return function(_0x45d276){if(!_0x45d276){_0x2171c2[_0x7b98('0x20')](0x194);}return _0x45d276;};}function handleError(_0x3e23bc,_0x362c1b){_0x362c1b=_0x362c1b||0x1f4;return function(_0x55dad4){logger[_0x7b98('0x21')](_0x55dad4['stack']);if(_0x55dad4[_0x7b98('0x22')]){delete _0x55dad4[_0x7b98('0x22')];}_0x3e23bc[_0x7b98('0x17')](_0x362c1b)[_0x7b98('0x23')](_0x55dad4);};}exports['index']=function(_0x52bb9a,_0x498986){var _0x3ca5e4={},_0x1f92dd={},_0xeabb38={'count':0x0,'rows':[]};var _0x19be09=_[_0x7b98('0x24')](db[_0x7b98('0x25')]['rawAttributes'],function(_0x4584ff){return{'name':_0x4584ff['fieldName'],'type':_0x4584ff[_0x7b98('0x26')]['key']};});_0x1f92dd[_0x7b98('0x27')]=_['map'](_0x19be09,'name');_0x1f92dd[_0x7b98('0x28')]=_[_0x7b98('0x29')](_0x52bb9a[_0x7b98('0x28')]);_0x1f92dd['filters']=_['intersection'](_0x1f92dd[_0x7b98('0x27')],_0x1f92dd[_0x7b98('0x28')]);_0x3ca5e4[_0x7b98('0x2a')]=_[_0x7b98('0x2b')](_0x1f92dd['model'],qs[_0x7b98('0x2c')](_0x52bb9a['query'][_0x7b98('0x2c')]));_0x3ca5e4[_0x7b98('0x2a')]=_0x3ca5e4[_0x7b98('0x2a')][_0x7b98('0x2d')]?_0x3ca5e4[_0x7b98('0x2a')]:_0x1f92dd[_0x7b98('0x27')];if(!_0x52bb9a['query'][_0x7b98('0x2e')](_0x7b98('0x2f'))){_0x3ca5e4[_0x7b98('0x16')]=qs[_0x7b98('0x16')](_0x52bb9a[_0x7b98('0x28')][_0x7b98('0x16')]);_0x3ca5e4[_0x7b98('0x13')]=qs[_0x7b98('0x13')](_0x52bb9a[_0x7b98('0x28')][_0x7b98('0x13')]);}_0x3ca5e4['order']=qs[_0x7b98('0x30')](_0x52bb9a['query'][_0x7b98('0x30')]);_0x3ca5e4['where']=qs[_0x7b98('0x31')](_['pick'](_0x52bb9a[_0x7b98('0x28')],_0x1f92dd[_0x7b98('0x31')]),_0x19be09);if(_0x52bb9a[_0x7b98('0x28')][_0x7b98('0x32')]){_0x3ca5e4['where']=_[_0x7b98('0x33')](_0x3ca5e4['where'],{'$or':_[_0x7b98('0x24')](_0x19be09,function(_0x5941f2){if(_0x5941f2[_0x7b98('0x26')]!==_0x7b98('0x34')){var _0x2133a4={};_0x2133a4[_0x5941f2[_0x7b98('0x22')]]={'$like':'%'+_0x52bb9a['query'][_0x7b98('0x32')]+'%'};return _0x2133a4;}})});}_0x3ca5e4=_[_0x7b98('0x33')]({},_0x3ca5e4,_0x52bb9a[_0x7b98('0x35')]);var _0x55487f={'where':_0x3ca5e4[_0x7b98('0x36')]};return db[_0x7b98('0x25')][_0x7b98('0x15')](_0x55487f)[_0x7b98('0x1e')](function(_0x48526f){_0xeabb38[_0x7b98('0x15')]=_0x48526f;if(_0x52bb9a[_0x7b98('0x28')][_0x7b98('0x37')]){_0x3ca5e4[_0x7b98('0x38')]=[{'all':!![]}];}return db[_0x7b98('0x25')][_0x7b98('0x39')](_0x3ca5e4);})[_0x7b98('0x1e')](function(_0x4e3b01){_0xeabb38['rows']=_0x4e3b01;return _0xeabb38;})[_0x7b98('0x1e')](respondWithFilteredResult(_0x498986,_0x3ca5e4))[_0x7b98('0x3a')](handleError(_0x498986,null));}; \ No newline at end of file +var _0x3879=['stack','name','send','index','Migration','fieldName','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','error'];(function(_0x5d0e65,_0x512211){var _0x55a42d=function(_0x38e9c6){while(--_0x38e9c6){_0x5d0e65['push'](_0x5d0e65['shift']());}};_0x55a42d(++_0x512211);}(_0x3879,0x117));var _0x9387=function(_0x126399,_0x55cbce){_0x126399=_0x126399-0x0;var _0x336e95=_0x3879[_0x126399];return _0x336e95;};'use strict';var emlformat=require(_0x9387('0x0'));var rimraf=require(_0x9387('0x1'));var zipdir=require(_0x9387('0x2'));var jsonpatch=require(_0x9387('0x3'));var rp=require(_0x9387('0x4'));var moment=require('moment');var BPromise=require(_0x9387('0x5'));var Mustache=require(_0x9387('0x6'));var util=require('util');var path=require(_0x9387('0x7'));var sox=require(_0x9387('0x8'));var csv=require(_0x9387('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9387('0xa'));var crypto=require('crypto');var jsforce=require(_0x9387('0xb'));var deskjs=require(_0x9387('0xc'));var toCsv=require(_0x9387('0x9'));var querystring=require(_0x9387('0xd'));var Papa=require(_0x9387('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9387('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9387('0x10'));var logger=require(_0x9387('0x11'))(_0x9387('0x12'));var utils=require(_0x9387('0x13'));var config=require(_0x9387('0x14'));var licenseUtil=require(_0x9387('0x15'));var db=require(_0x9387('0x16'))['db'];function respondWithStatusCode(_0x1a4558,_0x25aeec){_0x25aeec=_0x25aeec||0xcc;return function(_0x2816c7){if(_0x2816c7){return _0x1a4558[_0x9387('0x17')](_0x25aeec);}return _0x1a4558[_0x9387('0x18')](_0x25aeec)[_0x9387('0x19')]();};}function respondWithResult(_0x8aee3e,_0x53df3f){_0x53df3f=_0x53df3f||0xc8;return function(_0x1d1b64){if(_0x1d1b64){return _0x8aee3e[_0x9387('0x18')](_0x53df3f)[_0x9387('0x1a')](_0x1d1b64);}};}function respondWithFilteredResult(_0x1c09f4,_0x4e4e73){return function(_0x353e5a){if(_0x353e5a){var _0x430937=typeof _0x4e4e73[_0x9387('0x1b')]===_0x9387('0x1c')&&typeof _0x4e4e73[_0x9387('0x1d')]===_0x9387('0x1c');var _0x5a30b3=_0x353e5a['count'];var _0x28f960=_0x430937?0x0:_0x4e4e73[_0x9387('0x1b')];var _0x52e0fe=_0x430937?_0x353e5a[_0x9387('0x1e')]:_0x4e4e73[_0x9387('0x1b')]+_0x4e4e73[_0x9387('0x1d')];var _0x1f6ba7;if(_0x52e0fe>=_0x5a30b3){_0x52e0fe=_0x5a30b3;_0x1f6ba7=0xc8;}else{_0x1f6ba7=0xce;}_0x1c09f4[_0x9387('0x18')](_0x1f6ba7);return _0x1c09f4[_0x9387('0x1f')]('Content-Range',_0x28f960+'-'+_0x52e0fe+'/'+_0x5a30b3)['json'](_0x353e5a);}return null;};}function patchUpdates(_0x4b26d8){return function(_0x1fe9c1){try{jsonpatch[_0x9387('0x20')](_0x1fe9c1,_0x4b26d8,!![]);}catch(_0x40e23e){return BPromise[_0x9387('0x21')](_0x40e23e);}return _0x1fe9c1['save']();};}function saveUpdates(_0x8e9a2c,_0x2a25bf){return function(_0x3fe15f){if(_0x3fe15f){return _0x3fe15f['update'](_0x8e9a2c)[_0x9387('0x22')](function(_0xe1f451){return _0xe1f451;});}return null;};}function removeEntity(_0x42aea2,_0x368f29){return function(_0x33bb48){if(_0x33bb48){return _0x33bb48['destroy']()[_0x9387('0x22')](function(){_0x42aea2[_0x9387('0x18')](0xcc)[_0x9387('0x19')]();});}};}function handleEntityNotFound(_0x254b8c,_0x3c46ff){return function(_0x5bf3af){if(!_0x5bf3af){_0x254b8c[_0x9387('0x17')](0x194);}return _0x5bf3af;};}function handleError(_0x48fe65,_0x521a2f){_0x521a2f=_0x521a2f||0x1f4;return function(_0x16c722){logger[_0x9387('0x23')](_0x16c722[_0x9387('0x24')]);if(_0x16c722[_0x9387('0x25')]){delete _0x16c722[_0x9387('0x25')];}_0x48fe65[_0x9387('0x18')](_0x521a2f)[_0x9387('0x26')](_0x16c722);};}exports[_0x9387('0x27')]=function(_0x4a9026,_0x513c10){var _0x5ba608={},_0x436cc6={},_0x3c6785={'count':0x0,'rows':[]};var _0x16cfab=_['map'](db[_0x9387('0x28')]['rawAttributes'],function(_0x4859e9){return{'name':_0x4859e9[_0x9387('0x29')],'type':_0x4859e9['type']['key']};});_0x436cc6[_0x9387('0x2a')]=_[_0x9387('0x2b')](_0x16cfab,_0x9387('0x25'));_0x436cc6['query']=_[_0x9387('0x2c')](_0x4a9026['query']);_0x436cc6['filters']=_[_0x9387('0x2d')](_0x436cc6[_0x9387('0x2a')],_0x436cc6[_0x9387('0x2e')]);_0x5ba608[_0x9387('0x2f')]=_[_0x9387('0x2d')](_0x436cc6['model'],qs[_0x9387('0x30')](_0x4a9026['query'][_0x9387('0x30')]));_0x5ba608['attributes']=_0x5ba608[_0x9387('0x2f')][_0x9387('0x31')]?_0x5ba608['attributes']:_0x436cc6[_0x9387('0x2a')];if(!_0x4a9026[_0x9387('0x2e')][_0x9387('0x32')]('nolimit')){_0x5ba608[_0x9387('0x1d')]=qs['limit'](_0x4a9026[_0x9387('0x2e')][_0x9387('0x1d')]);_0x5ba608['offset']=qs[_0x9387('0x1b')](_0x4a9026['query'][_0x9387('0x1b')]);}_0x5ba608[_0x9387('0x33')]=qs[_0x9387('0x34')](_0x4a9026['query']['sort']);_0x5ba608['where']=qs[_0x9387('0x35')](_['pick'](_0x4a9026[_0x9387('0x2e')],_0x436cc6['filters']),_0x16cfab);if(_0x4a9026[_0x9387('0x2e')][_0x9387('0x36')]){_0x5ba608[_0x9387('0x37')]=_['merge'](_0x5ba608[_0x9387('0x37')],{'$or':_[_0x9387('0x2b')](_0x16cfab,function(_0x470f37){if(_0x470f37[_0x9387('0x38')]!==_0x9387('0x39')){var _0x4223c0={};_0x4223c0[_0x470f37[_0x9387('0x25')]]={'$like':'%'+_0x4a9026[_0x9387('0x2e')][_0x9387('0x36')]+'%'};return _0x4223c0;}})});}_0x5ba608=_[_0x9387('0x3a')]({},_0x5ba608,_0x4a9026[_0x9387('0x3b')]);var _0x1cae19={'where':_0x5ba608['where']};return db[_0x9387('0x28')][_0x9387('0x1e')](_0x1cae19)[_0x9387('0x22')](function(_0x18290f){_0x3c6785[_0x9387('0x1e')]=_0x18290f;if(_0x4a9026[_0x9387('0x2e')][_0x9387('0x3c')]){_0x5ba608['include']=[{'all':!![]}];}return db[_0x9387('0x28')][_0x9387('0x3d')](_0x5ba608);})['then'](function(_0x374d6f){_0x3c6785[_0x9387('0x3e')]=_0x374d6f;return _0x3c6785;})[_0x9387('0x22')](respondWithFilteredResult(_0x513c10,_0x5ba608))['catch'](handleError(_0x513c10,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index aa4809b..f2cef47 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 _0x6cf1=['../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','lodash','util'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x6cf1,0x9e));var _0x16cf=function(_0x4be75e,_0x8423){_0x4be75e=_0x4be75e-0x0;var _0xb4d4b6=_0x6cf1[_0x4be75e];return _0xb4d4b6;};'use strict';var _=require(_0x16cf('0x0'));var util=require(_0x16cf('0x1'));var logger=require(_0x16cf('0x2'))('api');var moment=require(_0x16cf('0x3'));var BPromise=require(_0x16cf('0x4'));var rp=require(_0x16cf('0x5'));var fs=require('fs');var path=require(_0x16cf('0x6'));var rimraf=require(_0x16cf('0x7'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0x16cf('0x8')]=function(_0x4f3a7b,_0x20b8f9){return _0x4f3a7b[_0x16cf('0x9')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92b2=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Migration','migrations','lodash'];(function(_0x14af4b,_0x59ffc8){var _0x207208=function(_0x17b374){while(--_0x17b374){_0x14af4b['push'](_0x14af4b['shift']());}};_0x207208(++_0x59ffc8);}(_0x92b2,0x1bb));var _0x292b=function(_0x5418ad,_0x40742f){_0x5418ad=_0x5418ad-0x0;var _0x2cae56=_0x92b2[_0x5418ad];return _0x2cae56;};'use strict';var _=require(_0x292b('0x0'));var util=require(_0x292b('0x1'));var logger=require('../../config/logger')(_0x292b('0x2'));var moment=require(_0x292b('0x3'));var BPromise=require(_0x292b('0x4'));var rp=require(_0x292b('0x5'));var fs=require('fs');var path=require(_0x292b('0x6'));var rimraf=require(_0x292b('0x7'));var config=require(_0x292b('0x8'));var attributes=require('./migration.attributes');module[_0x292b('0x9')]=function(_0x46430f,_0x242497){return _0x46430f['define'](_0x292b('0xa'),attributes,{'tableName':_0x292b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 0ea8a80..844593c 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 _0x073e=['debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','http','then','info','Migration,\x20%s,\x20%s'];(function(_0xc54b52,_0x41294e){var _0x29287f=function(_0x25de9a){while(--_0x25de9a){_0xc54b52['push'](_0xc54b52['shift']());}};_0x29287f(++_0x41294e);}(_0x073e,0x181));var _0xe073=function(_0x5c8e89,_0x459e5c){_0x5c8e89=_0x5c8e89-0x0;var _0x3aa724=_0x073e[_0x5c8e89];return _0x3aa724;};'use strict';var _=require(_0xe073('0x0'));var util=require(_0xe073('0x1'));var moment=require(_0xe073('0x2'));var BPromise=require(_0xe073('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe073('0x4'));var logger=require(_0xe073('0x5'))(_0xe073('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe073('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44092d,_0x1bcaae,_0x3b4fc7){return new BPromise(function(_0x373bf6,_0x1a93da){return client['request'](_0x44092d,_0x3b4fc7)[_0xe073('0x8')](function(_0x7a1f21){logger[_0xe073('0x9')](_0xe073('0xa'),_0x1bcaae,'request\x20sent');logger[_0xe073('0xb')](_0xe073('0xc'),_0x1bcaae,_0xe073('0xd'),JSON[_0xe073('0xe')](_0x7a1f21));if(_0x7a1f21[_0xe073('0xf')]){if(_0x7a1f21[_0xe073('0xf')]['code']===0x1f4){logger[_0xe073('0xf')]('Migration,\x20%s,\x20%s',_0x1bcaae,_0x7a1f21[_0xe073('0xf')]['message']);return _0x1a93da(_0x7a1f21[_0xe073('0xf')]['message']);}logger[_0xe073('0xf')](_0xe073('0xa'),_0x1bcaae,_0x7a1f21[_0xe073('0xf')][_0xe073('0x10')]);return _0x373bf6(_0x7a1f21[_0xe073('0xf')][_0xe073('0x10')]);}else{logger[_0xe073('0x9')](_0xe073('0xa'),_0x1bcaae,_0xe073('0xd'));_0x373bf6(_0x7a1f21[_0xe073('0x11')][_0xe073('0x10')]);}})['catch'](function(_0x511ab2){logger['error'](_0xe073('0xa'),_0x1bcaae,_0x511ab2);_0x1a93da(_0x511ab2);});});} \ No newline at end of file +var _0x6f7a=['http','request','then','info','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x526046,_0x154040){var _0x5b92a2=function(_0x1e92af){while(--_0x1e92af){_0x526046['push'](_0x526046['shift']());}};_0x5b92a2(++_0x154040);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x3e2436,_0x4e5189){_0x3e2436=_0x3e2436-0x0;var _0xe41ba=_0x6f7a[_0x3e2436];return _0xe41ba;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require(_0xa6f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require(_0xa6f7('0x5'))['db'];var utils=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var config=require(_0xa6f7('0x9'));var jayson=require(_0xa6f7('0xa'));var client=jayson[_0xa6f7('0xb')][_0xa6f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x335aaa,_0x1a06d1,_0x481a8c){return new BPromise(function(_0x4b4f9e,_0x30f2a7){return client[_0xa6f7('0xd')](_0x335aaa,_0x481a8c)[_0xa6f7('0xe')](function(_0x362404){logger[_0xa6f7('0xf')]('Migration,\x20%s,\x20%s',_0x1a06d1,'request\x20sent');logger[_0xa6f7('0x10')](_0xa6f7('0x11'),_0x1a06d1,'request\x20sent',JSON[_0xa6f7('0x12')](_0x362404));if(_0x362404['error']){if(_0x362404[_0xa6f7('0x13')][_0xa6f7('0x14')]===0x1f4){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x30f2a7(_0x362404['error'][_0xa6f7('0x16')]);}logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x4b4f9e(_0x362404['error'][_0xa6f7('0x16')]);}else{logger['info'](_0xa6f7('0x15'),_0x1a06d1,_0xa6f7('0x17'));_0x4b4f9e(_0x362404[_0xa6f7('0x18')]['message']);}})[_0xa6f7('0x19')](function(_0x22635e){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x22635e);_0x30f2a7(_0x22635e);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 01e91d4..00a8c2d 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 _0x404d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','get','index','show','post','put','/:id','isAuthenticated','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x404d,0x1e9));var _0xd404=function(_0x4ed1a2,_0x7b259e){_0x4ed1a2=_0x4ed1a2-0x0;var _0x5727f4=_0x404d[_0x4ed1a2];return _0x5727f4;};'use strict';var multer=require(_0xd404('0x0'));var util=require(_0xd404('0x1'));var path=require(_0xd404('0x2'));var timeout=require(_0xd404('0x3'));var express=require(_0xd404('0x4'));var router=express[_0xd404('0x5')]();var fs_extra=require(_0xd404('0x6'));var auth=require(_0xd404('0x7'));var interaction=require(_0xd404('0x8'));var config=require('../../config/environment');var controller=require(_0xd404('0x9'));router[_0xd404('0xa')]('/',auth['isAuthenticated'](),controller[_0xd404('0xb')]);router[_0xd404('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd404('0xc')]);router[_0xd404('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd404('0xe')](_0xd404('0xf'),auth[_0xd404('0x10')](),controller[_0xd404('0x11')]);router['delete']('/:id',auth[_0xd404('0x10')](),controller[_0xd404('0x12')]);module['exports']=router; \ No newline at end of file +var _0xacd6=['/:id','isAuthenticated','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index'];(function(_0xb23b5f,_0x27b6a3){var _0x21e54c=function(_0xc9ea85){while(--_0xc9ea85){_0xb23b5f['push'](_0xb23b5f['shift']());}};_0x21e54c(++_0x27b6a3);}(_0xacd6,0xef));var _0x6acd=function(_0x15f8ad,_0x5275c3){_0x15f8ad=_0x15f8ad-0x0;var _0xc0238a=_0xacd6[_0x15f8ad];return _0xc0238a;};'use strict';var multer=require(_0x6acd('0x0'));var util=require(_0x6acd('0x1'));var path=require(_0x6acd('0x2'));var timeout=require(_0x6acd('0x3'));var express=require(_0x6acd('0x4'));var router=express[_0x6acd('0x5')]();var fs_extra=require(_0x6acd('0x6'));var auth=require(_0x6acd('0x7'));var interaction=require(_0x6acd('0x8'));var config=require(_0x6acd('0x9'));var controller=require(_0x6acd('0xa'));router[_0x6acd('0xb')]('/',auth['isAuthenticated'](),controller[_0x6acd('0xc')]);router[_0x6acd('0xb')](_0x6acd('0xd'),auth[_0x6acd('0xe')](),controller[_0x6acd('0xf')]);router[_0x6acd('0x10')]('/',auth[_0x6acd('0xe')](),controller[_0x6acd('0x11')]);router['put'](_0x6acd('0xd'),auth[_0x6acd('0xe')](),controller[_0x6acd('0x12')]);router[_0x6acd('0x13')](_0x6acd('0xd'),auth[_0x6acd('0xe')](),controller[_0x6acd('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 9a10da2..df71ebc 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 _0x4f52=['stun','turn','STRING','sequelize','ENUM','localnet','externip'];(function(_0x4c6232,_0x482617){var _0x2ed951=function(_0x406e6a){while(--_0x406e6a){_0x4c6232['push'](_0x4c6232['shift']());}};_0x2ed951(++_0x482617);}(_0x4f52,0x6c));var _0x24f5=function(_0x503c02,_0x1fefcb){_0x503c02=_0x503c02-0x0;var _0x1a49bf=_0x4f52[_0x503c02];return _0x1a49bf;};'use strict';var Sequelize=require(_0x24f5('0x0'));module['exports']={'type':{'type':Sequelize[_0x24f5('0x1')](_0x24f5('0x2'),_0x24f5('0x3'),_0x24f5('0x4'),_0x24f5('0x5'))},'value':{'type':Sequelize[_0x24f5('0x6')]},'username':{'type':Sequelize[_0x24f5('0x6')]},'password':{'type':Sequelize[_0x24f5('0x6')]}}; \ No newline at end of file +var _0x0273=['turn','exports','ENUM','localnet','stun'];(function(_0x2cc37d,_0x5b1496){var _0x1f468b=function(_0x1e2c01){while(--_0x1e2c01){_0x2cc37d['push'](_0x2cc37d['shift']());}};_0x1f468b(++_0x5b1496);}(_0x0273,0x1d7));var _0x3027=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0273[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x3027('0x0')]={'type':{'type':Sequelize[_0x3027('0x1')](_0x3027('0x2'),'externip',_0x3027('0x3'),_0x3027('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index ad5c490..81be25c 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 _0x416d=['/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','toLowerCase','server/files/templates/network.ejs','chan_sip.so','params','format','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','message','info','result','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','Network','fieldName','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','rawAttributes','keys','include','find','create','sequelize','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','/etc/asterisk/stun_xcally.conf','Reload','TURN','server/files/templates/turn_multiple.ejs','render','writeFileSync'];(function(_0x39f70c,_0x383618){var _0x53e782=function(_0x2c23f9){while(--_0x2c23f9){_0x39f70c['push'](_0x39f70c['shift']());}};_0x53e782(++_0x383618);}(_0x416d,0x1b7));var _0xd416=function(_0x4fb614,_0x3f1326){_0x4fb614=_0x4fb614-0x0;var _0x14222b=_0x416d[_0x4fb614];return _0x14222b;};'use strict';var emlformat=require(_0xd416('0x0'));var rimraf=require(_0xd416('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd416('0x2'));var rp=require(_0xd416('0x3'));var moment=require(_0xd416('0x4'));var BPromise=require(_0xd416('0x5'));var Mustache=require(_0xd416('0x6'));var util=require(_0xd416('0x7'));var path=require(_0xd416('0x8'));var sox=require(_0xd416('0x9'));var csv=require(_0xd416('0xa'));var ejs=require(_0xd416('0xb'));var fs=require('fs');var fs_extra=require(_0xd416('0xc'));var _=require('lodash');var squel=require(_0xd416('0xd'));var crypto=require(_0xd416('0xe'));var jsforce=require(_0xd416('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd416('0xa'));var querystring=require(_0xd416('0x10'));var Papa=require(_0xd416('0x11'));var Redis=require(_0xd416('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd416('0x13'));var logger=require(_0xd416('0x14'))(_0xd416('0x15'));var utils=require(_0xd416('0x16'));var config=require(_0xd416('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd416('0x18'))['db'];var jayson=require(_0xd416('0x19'));var client=jayson['client'][_0xd416('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x10809b,_0xb9c49e,_0x45851e,_0x3c069d){return new BPromise(function(_0x43bda0,_0x16f8e1){var _0x5e0d5b=_0x3c069d||client;return _0x5e0d5b[_0xd416('0x1b')](_0x10809b,_0x45851e)[_0xd416('0x1c')](function(_0x26772b){logger['info'](_0xd416('0x1d'),_0xb9c49e,_0xd416('0x1e'));logger['debug'](_0xd416('0x1f'),_0xb9c49e,_0xd416('0x1e'),JSON['stringify'](_0x26772b));if(_0x26772b[_0xd416('0x20')]){if(_0x26772b[_0xd416('0x20')][_0xd416('0x21')]===0x1f4){logger[_0xd416('0x20')](_0xd416('0x1d'),_0xb9c49e,_0x26772b[_0xd416('0x20')]['message']);return _0x16f8e1(_0x26772b['error']['message']);}logger['error'](_0xd416('0x1d'),_0xb9c49e,_0x26772b['error'][_0xd416('0x22')]);return _0x43bda0(_0x26772b[_0xd416('0x20')][_0xd416('0x22')]);}else{logger[_0xd416('0x23')]('Network,\x20%s,\x20%s',_0xb9c49e,_0xd416('0x1e'));_0x43bda0(_0x26772b[_0xd416('0x24')][_0xd416('0x22')]);}})['catch'](function(_0x539c31){logger[_0xd416('0x20')](_0xd416('0x1d'),_0xb9c49e,_0x539c31);_0x16f8e1(_0x539c31);});});}function respondWithStatusCode(_0x3acae7,_0x1b3125){_0x1b3125=_0x1b3125||0xcc;return function(_0x1ccdde){if(_0x1ccdde){return _0x3acae7['sendStatus'](_0x1b3125);}return _0x3acae7['status'](_0x1b3125)[_0xd416('0x25')]();};}function respondWithResult(_0x31804e,_0x4e4eeb){_0x4e4eeb=_0x4e4eeb||0xc8;return function(_0x27a373){if(_0x27a373){return _0x31804e[_0xd416('0x26')](_0x4e4eeb)['json'](_0x27a373);}};}function respondWithFilteredResult(_0x50bd5d,_0x3580b0){return function(_0x823293){if(_0x823293){var _0x61f446=typeof _0x3580b0[_0xd416('0x27')]===_0xd416('0x28')&&typeof _0x3580b0[_0xd416('0x29')]==='undefined';var _0x404a86=_0x823293[_0xd416('0x2a')];var _0x14c57c=_0x61f446?0x0:_0x3580b0['offset'];var _0xc0e911=_0x61f446?_0x823293[_0xd416('0x2a')]:_0x3580b0[_0xd416('0x27')]+_0x3580b0[_0xd416('0x29')];var _0x11b24e;if(_0xc0e911>=_0x404a86){_0xc0e911=_0x404a86;_0x11b24e=0xc8;}else{_0x11b24e=0xce;}_0x50bd5d[_0xd416('0x26')](_0x11b24e);return _0x50bd5d[_0xd416('0x2b')]('Content-Range',_0x14c57c+'-'+_0xc0e911+'/'+_0x404a86)[_0xd416('0x2c')](_0x823293);}return null;};}function patchUpdates(_0x3077be){return function(_0x30e76f){try{jsonpatch[_0xd416('0x2d')](_0x30e76f,_0x3077be,!![]);}catch(_0x4da09e){return BPromise[_0xd416('0x2e')](_0x4da09e);}return _0x30e76f[_0xd416('0x2f')]();};}function saveUpdates(_0x4dc4be,_0x57fb9d){return function(_0x1f23bd){if(_0x1f23bd){return _0x1f23bd[_0xd416('0x30')](_0x4dc4be)['then'](function(_0x14a80e){return _0x14a80e;});}return null;};}function removeEntity(_0x3683d1,_0x367874){return function(_0xe279fa){if(_0xe279fa){return _0xe279fa[_0xd416('0x31')]()[_0xd416('0x1c')](function(){_0x3683d1[_0xd416('0x26')](0xcc)[_0xd416('0x25')]();});}};}function handleEntityNotFound(_0x16466f,_0x3b43f5){return function(_0x210072){if(!_0x210072){_0x16466f[_0xd416('0x32')](0x194);}return _0x210072;};}function handleError(_0x49cf60,_0xa83b91){_0xa83b91=_0xa83b91||0x1f4;return function(_0x3daf53){logger['error'](_0x3daf53[_0xd416('0x33')]);if(_0x3daf53[_0xd416('0x34')]){delete _0x3daf53[_0xd416('0x34')];}_0x49cf60[_0xd416('0x26')](_0xa83b91)[_0xd416('0x35')](_0x3daf53);};}exports[_0xd416('0x36')]=function(_0x4b70a6,_0x487e68){var _0x5772f8={},_0x299ac9={},_0xa18697={'count':0x0,'rows':[]};var _0x57f311=_[_0xd416('0x37')](db[_0xd416('0x38')]['rawAttributes'],function(_0xd714ee){return{'name':_0xd714ee[_0xd416('0x39')],'type':_0xd714ee['type']['key']};});_0x299ac9['model']=_[_0xd416('0x37')](_0x57f311,_0xd416('0x34'));_0x299ac9[_0xd416('0x3a')]=_['keys'](_0x4b70a6['query']);_0x299ac9[_0xd416('0x3b')]=_[_0xd416('0x3c')](_0x299ac9[_0xd416('0x3d')],_0x299ac9[_0xd416('0x3a')]);_0x5772f8['attributes']=_[_0xd416('0x3c')](_0x299ac9[_0xd416('0x3d')],qs[_0xd416('0x3e')](_0x4b70a6[_0xd416('0x3a')][_0xd416('0x3e')]));_0x5772f8[_0xd416('0x3f')]=_0x5772f8[_0xd416('0x3f')][_0xd416('0x40')]?_0x5772f8[_0xd416('0x3f')]:_0x299ac9[_0xd416('0x3d')];if(!_0x4b70a6[_0xd416('0x3a')][_0xd416('0x41')](_0xd416('0x42'))){_0x5772f8['limit']=qs['limit'](_0x4b70a6['query'][_0xd416('0x29')]);_0x5772f8[_0xd416('0x27')]=qs[_0xd416('0x27')](_0x4b70a6[_0xd416('0x3a')]['offset']);}_0x5772f8[_0xd416('0x43')]=qs['sort'](_0x4b70a6[_0xd416('0x3a')][_0xd416('0x44')]);_0x5772f8[_0xd416('0x45')]=qs[_0xd416('0x3b')](_[_0xd416('0x46')](_0x4b70a6[_0xd416('0x3a')],_0x299ac9[_0xd416('0x3b')]),_0x57f311);if(_0x4b70a6[_0xd416('0x3a')]['filter']){_0x5772f8[_0xd416('0x45')]=_[_0xd416('0x47')](_0x5772f8['where'],{'$or':_[_0xd416('0x37')](_0x57f311,function(_0x218553){if(_0x218553[_0xd416('0x48')]!==_0xd416('0x49')){var _0x1f8f72={};_0x1f8f72[_0x218553[_0xd416('0x34')]]={'$like':'%'+_0x4b70a6['query'][_0xd416('0x4a')]+'%'};return _0x1f8f72;}})});}_0x5772f8=_[_0xd416('0x47')]({},_0x5772f8,_0x4b70a6[_0xd416('0x4b')]);var _0x5ec044={'where':_0x5772f8[_0xd416('0x45')]};return db['Network']['count'](_0x5ec044)[_0xd416('0x1c')](function(_0x464deb){_0xa18697[_0xd416('0x2a')]=_0x464deb;if(_0x4b70a6[_0xd416('0x3a')][_0xd416('0x4c')]){_0x5772f8['include']=[{'all':!![]}];}return db['Network'][_0xd416('0x4d')](_0x5772f8);})['then'](function(_0x21b758){_0xa18697[_0xd416('0x4e')]=_0x21b758;return _0xa18697;})[_0xd416('0x1c')](respondWithFilteredResult(_0x487e68,_0x5772f8))[_0xd416('0x4f')](handleError(_0x487e68,null));};exports[_0xd416('0x50')]=function(_0x44d2f9,_0x143e03){var _0x34897c={'raw':!![],'where':{'id':_0x44d2f9['params']['id']}},_0x1cd57e={};_0x1cd57e['model']=_['keys'](db[_0xd416('0x38')][_0xd416('0x51')]);_0x1cd57e[_0xd416('0x3a')]=_[_0xd416('0x52')](_0x44d2f9['query']);_0x1cd57e[_0xd416('0x3b')]=_['intersection'](_0x1cd57e[_0xd416('0x3d')],_0x1cd57e[_0xd416('0x3a')]);_0x34897c[_0xd416('0x3f')]=_[_0xd416('0x3c')](_0x1cd57e['model'],qs[_0xd416('0x3e')](_0x44d2f9[_0xd416('0x3a')][_0xd416('0x3e')]));_0x34897c[_0xd416('0x3f')]=_0x34897c[_0xd416('0x3f')]['length']?_0x34897c['attributes']:_0x1cd57e[_0xd416('0x3d')];if(_0x44d2f9['query'][_0xd416('0x4c')]){_0x34897c[_0xd416('0x53')]=[{'all':!![]}];}_0x34897c=_[_0xd416('0x47')]({},_0x34897c,_0x44d2f9['options']);return db[_0xd416('0x38')][_0xd416('0x54')](_0x34897c)[_0xd416('0x1c')](handleEntityNotFound(_0x143e03,null))[_0xd416('0x1c')](respondWithResult(_0x143e03,null))['catch'](handleError(_0x143e03,null));};exports[_0xd416('0x55')]=function(_0x4c3af2,_0x4c7610,_0x299065){var _0xc5412b;return db[_0xd416('0x56')]['transaction'](function(_0x494e20){return db[_0xd416('0x38')][_0xd416('0x55')](_0x4c3af2[_0xd416('0x57')],{'raw':!![]})['then'](function(_0x56d641){_0xc5412b=_0x56d641;return db[_0xd416('0x38')][_0xd416('0x4d')]({'where':{'type':_0x4c3af2[_0xd416('0x57')]['type']},'raw':!![]});})[_0xd416('0x1c')](function(_0x15d734){if(_0xc5412b[_0xd416('0x48')][_0xd416('0x58')]()==_0xd416('0x59')){var _0x4218a1=fs[_0xd416('0x5a')](path[_0xd416('0x5b')](config[_0xd416('0x5c')],_0xd416('0x5d')),_0xd416('0x5e'));var _0x3ea2c2=ejs['render'](_0x4218a1,{'networks':_0x15d734||[]});fs['writeFileSync'](_0xd416('0x5f'),_0x3ea2c2);return respondWithRpcPromise(_0xd416('0x60'),'create',{'module':'res_stun_monitor.so'});}else if(_0xc5412b[_0xd416('0x48')][_0xd416('0x58')]()==_0xd416('0x61')){var _0x1b8a61=fs[_0xd416('0x5a')](path[_0xd416('0x5b')](config['root'],_0xd416('0x62')),_0xd416('0x5e'));var _0x37ad67=ejs[_0xd416('0x63')](_0x1b8a61,{'networks':_0x15d734||[]});fs[_0xd416('0x64')](_0xd416('0x65'),_0x37ad67);return respondWithRpcPromise(_0xd416('0x60'),_0xd416('0x55'),{'module':_0xd416('0x66')});}else{var _0x457d4a=fs[_0xd416('0x5a')](path[_0xd416('0x5b')](config[_0xd416('0x5c')],'server/files/templates/network.ejs'),_0xd416('0x5e'));var _0x3c45a9=ejs[_0xd416('0x63')](_0x457d4a,{'networks':_0x15d734||[]});fs[_0xd416('0x64')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x4c3af2[_0xd416('0x57')][_0xd416('0x48')][_0xd416('0x67')]()),_0x3c45a9);return respondWithRpcPromise(_0xd416('0x60'),_0xd416('0x55'),{'module':'chan_sip.so'});}return null;})[_0xd416('0x1c')](function(){return _0xc5412b;});})[_0xd416('0x1c')](respondWithResult(_0x4c7610,0xc9))[_0xd416('0x4f')](handleError(_0x4c7610,null));};exports['update']=function(_0x135627,_0x4249dc,_0x5f292){var _0x24020e;return db[_0xd416('0x56')]['transaction'](function(_0x18662c){return db[_0xd416('0x38')][_0xd416('0x54')]({'where':{'id':_0x135627['params']['id']}})['then'](handleEntityNotFound(_0x4249dc,null))[_0xd416('0x1c')](saveUpdates(_0x135627['body'],null))[_0xd416('0x1c')](function(_0x46b884){if(_0x46b884){_0x24020e=_0x46b884;return db[_0xd416('0x38')][_0xd416('0x4d')]({'where':{'type':_0x24020e['type']},'raw':!![]});}return null;})[_0xd416('0x1c')](function(_0x13fb3c){if(_0x24020e['type'][_0xd416('0x58')]()==_0xd416('0x59')){var _0x5c030b=fs['readFileSync'](path[_0xd416('0x5b')](config[_0xd416('0x5c')],_0xd416('0x5d')),_0xd416('0x5e'));var _0x53d57a=ejs[_0xd416('0x63')](_0x5c030b,{'networks':_0x13fb3c||[]});fs[_0xd416('0x64')]('/etc/asterisk/stun_xcally.conf',_0x53d57a);return respondWithRpcPromise(_0xd416('0x60'),_0xd416('0x30'),{'module':_0xd416('0x66')});}else if(_0x24020e['type'][_0xd416('0x58')]()==_0xd416('0x61')){var _0x316f6b=fs[_0xd416('0x5a')](path[_0xd416('0x5b')](config[_0xd416('0x5c')],_0xd416('0x62')),'utf8');var _0x3a6d05=ejs[_0xd416('0x63')](_0x316f6b,{'networks':_0x13fb3c||[]});fs[_0xd416('0x64')]('/etc/asterisk/turn_xcally.conf',_0x3a6d05);return respondWithRpcPromise(_0xd416('0x60'),_0xd416('0x30'),{'module':_0xd416('0x66')});}else{var _0x52c8cb=fs[_0xd416('0x5a')](path[_0xd416('0x5b')](config[_0xd416('0x5c')],_0xd416('0x68')),'utf8');var _0x1caf40=ejs['render'](_0x52c8cb,{'networks':_0x13fb3c||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x135627[_0xd416('0x57')]['type'][_0xd416('0x67')]()),_0x1caf40);return respondWithRpcPromise('Reload',_0xd416('0x30'),{'module':_0xd416('0x69')});}return null;})[_0xd416('0x1c')](function(_0x1dece5){if(_0x1dece5){return _0x24020e;}return null;});})['then'](respondWithResult(_0x4249dc,null))[_0xd416('0x4f')](handleError(_0x4249dc,null));};exports[_0xd416('0x31')]=function(_0x31173c,_0xd255ef,_0x25daa7){var _0x2df8ca;return db['Network'][_0xd416('0x54')]({'where':{'id':_0x31173c[_0xd416('0x6a')]['id']}})[_0xd416('0x1c')](function(_0x5532a7){_0x2df8ca=_0x5532a7;return _0x5532a7;})[_0xd416('0x1c')](handleEntityNotFound(_0xd255ef,null))[_0xd416('0x1c')](removeEntity(_0xd255ef,null))[_0xd416('0x1c')](function(){if(_0x2df8ca){return db['Network'][_0xd416('0x4d')]({'where':{'type':_0x2df8ca[_0xd416('0x48')]},'raw':!![]});}})[_0xd416('0x1c')](function(_0x1ca22d){if(_0x2df8ca[_0xd416('0x48')][_0xd416('0x58')]()=='STUN'){var _0x59db08=fs[_0xd416('0x5a')](path[_0xd416('0x5b')](config[_0xd416('0x5c')],_0xd416('0x5d')),'utf8');var _0x59ad97=ejs['render'](_0x59db08,{'networks':_0x1ca22d||[]});fs[_0xd416('0x64')](_0xd416('0x5f'),_0x59ad97);return respondWithRpcPromise(_0xd416('0x60'),_0xd416('0x31'),{'module':_0xd416('0x66')});}else if(_0x2df8ca[_0xd416('0x48')][_0xd416('0x58')]()==_0xd416('0x61')){var _0x42d894=fs[_0xd416('0x5a')](path[_0xd416('0x5b')](config['root'],_0xd416('0x62')),'utf8');var _0x21933d=ejs[_0xd416('0x63')](_0x42d894,{'networks':_0x1ca22d||[]});fs[_0xd416('0x64')](_0xd416('0x65'),_0x21933d);return respondWithRpcPromise(_0xd416('0x60'),_0xd416('0x31'),{'module':_0xd416('0x66')});}else{var _0x2b832b=fs[_0xd416('0x5a')](path[_0xd416('0x5b')](config[_0xd416('0x5c')],_0xd416('0x68')),_0xd416('0x5e'));var _0x3aaa6a=ejs[_0xd416('0x63')](_0x2b832b,{'networks':_0x1ca22d||[]});fs['writeFileSync'](util[_0xd416('0x6b')]('/etc/asterisk/sip_xcally_%s.conf',_0x31173c[_0xd416('0x57')][_0xd416('0x48')]['toLowerCase']()),_0x3aaa6a);return respondWithRpcPromise('Reload',_0xd416('0x31'),{'module':_0xd416('0x69')});}return null;})[_0xd416('0x4f')](handleError(_0xd255ef,null));}; \ No newline at end of file +var _0xa922=['type','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','filter','merge','options','include','findAll','show','params','keys','find','create','sequelize','body','toUpperCase','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','root','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','catch','/etc/asterisk/sip_xcally_%s.conf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','Network,\x20%s,\x20%s','result','message','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','Network','rawAttributes','fieldName'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0xa922,0x1d4));var _0x2a92=function(_0x5a8d27,_0x188425){_0x5a8d27=_0x5a8d27-0x0;var _0x52dfa5=_0xa922[_0x5a8d27];return _0x52dfa5;};'use strict';var emlformat=require(_0x2a92('0x0'));var rimraf=require(_0x2a92('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a92('0x2'));var rp=require(_0x2a92('0x3'));var moment=require(_0x2a92('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2a92('0x5'));var util=require(_0x2a92('0x6'));var path=require(_0x2a92('0x7'));var sox=require(_0x2a92('0x8'));var csv=require(_0x2a92('0x9'));var ejs=require(_0x2a92('0xa'));var fs=require('fs');var fs_extra=require(_0x2a92('0xb'));var _=require(_0x2a92('0xc'));var squel=require('squel');var crypto=require(_0x2a92('0xd'));var jsforce=require(_0x2a92('0xe'));var deskjs=require(_0x2a92('0xf'));var toCsv=require(_0x2a92('0x9'));var querystring=require(_0x2a92('0x10'));var Papa=require(_0x2a92('0x11'));var Redis=require(_0x2a92('0x12'));var authService=require(_0x2a92('0x13'));var qs=require(_0x2a92('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a92('0x15'));var logger=require(_0x2a92('0x16'))(_0x2a92('0x17'));var utils=require(_0x2a92('0x18'));var config=require(_0x2a92('0x19'));var licenseUtil=require(_0x2a92('0x1a'));var db=require(_0x2a92('0x1b'))['db'];var jayson=require(_0x2a92('0x1c'));var client=jayson[_0x2a92('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42e795,_0x14307c,_0x1800e2,_0x18e598){return new BPromise(function(_0x6e1977,_0x151049){var _0x186351=_0x18e598||client;return _0x186351[_0x2a92('0x1e')](_0x42e795,_0x1800e2)[_0x2a92('0x1f')](function(_0x4623ab){logger[_0x2a92('0x20')]('Network,\x20%s,\x20%s',_0x14307c,_0x2a92('0x21'));logger[_0x2a92('0x22')]('Network,\x20%s,\x20%s,\x20%s',_0x14307c,_0x2a92('0x21'),JSON[_0x2a92('0x23')](_0x4623ab));if(_0x4623ab['error']){if(_0x4623ab[_0x2a92('0x24')][_0x2a92('0x25')]===0x1f4){logger[_0x2a92('0x24')](_0x2a92('0x26'),_0x14307c,_0x4623ab[_0x2a92('0x24')]['message']);return _0x151049(_0x4623ab['error']['message']);}logger[_0x2a92('0x24')](_0x2a92('0x26'),_0x14307c,_0x4623ab[_0x2a92('0x24')]['message']);return _0x6e1977(_0x4623ab[_0x2a92('0x24')]['message']);}else{logger[_0x2a92('0x20')](_0x2a92('0x26'),_0x14307c,'request\x20sent');_0x6e1977(_0x4623ab[_0x2a92('0x27')][_0x2a92('0x28')]);}})['catch'](function(_0x2ec4c1){logger[_0x2a92('0x24')]('Network,\x20%s,\x20%s',_0x14307c,_0x2ec4c1);_0x151049(_0x2ec4c1);});});}function respondWithStatusCode(_0x5b778a,_0x58284e){_0x58284e=_0x58284e||0xcc;return function(_0x437eb6){if(_0x437eb6){return _0x5b778a[_0x2a92('0x29')](_0x58284e);}return _0x5b778a[_0x2a92('0x2a')](_0x58284e)[_0x2a92('0x2b')]();};}function respondWithResult(_0x256e6a,_0xf9f455){_0xf9f455=_0xf9f455||0xc8;return function(_0x467aa7){if(_0x467aa7){return _0x256e6a[_0x2a92('0x2a')](_0xf9f455)[_0x2a92('0x2c')](_0x467aa7);}};}function respondWithFilteredResult(_0x5906d1,_0x49110a){return function(_0x4dcf3e){if(_0x4dcf3e){var _0x4cc21b=typeof _0x49110a[_0x2a92('0x2d')]===_0x2a92('0x2e')&&typeof _0x49110a[_0x2a92('0x2f')]==='undefined';var _0x1faa0b=_0x4dcf3e[_0x2a92('0x30')];var _0x4d1361=_0x4cc21b?0x0:_0x49110a[_0x2a92('0x2d')];var _0x2af46f=_0x4cc21b?_0x4dcf3e['count']:_0x49110a[_0x2a92('0x2d')]+_0x49110a[_0x2a92('0x2f')];var _0x10c9a0;if(_0x2af46f>=_0x1faa0b){_0x2af46f=_0x1faa0b;_0x10c9a0=0xc8;}else{_0x10c9a0=0xce;}_0x5906d1[_0x2a92('0x2a')](_0x10c9a0);return _0x5906d1['set'](_0x2a92('0x31'),_0x4d1361+'-'+_0x2af46f+'/'+_0x1faa0b)['json'](_0x4dcf3e);}return null;};}function patchUpdates(_0x353a60){return function(_0x2bd9c9){try{jsonpatch[_0x2a92('0x32')](_0x2bd9c9,_0x353a60,!![]);}catch(_0x1a3d39){return BPromise[_0x2a92('0x33')](_0x1a3d39);}return _0x2bd9c9[_0x2a92('0x34')]();};}function saveUpdates(_0x3f1ded,_0x5ca28d){return function(_0x47d862){if(_0x47d862){return _0x47d862[_0x2a92('0x35')](_0x3f1ded)['then'](function(_0x2b9095){return _0x2b9095;});}return null;};}function removeEntity(_0x2deae0,_0x30bd1f){return function(_0x429f27){if(_0x429f27){return _0x429f27[_0x2a92('0x36')]()[_0x2a92('0x1f')](function(){_0x2deae0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x955bab,_0x5bd9d4){return function(_0x245902){if(!_0x245902){_0x955bab[_0x2a92('0x29')](0x194);}return _0x245902;};}function handleError(_0x2788a3,_0x30ea7e){_0x30ea7e=_0x30ea7e||0x1f4;return function(_0x2ba4e1){logger[_0x2a92('0x24')](_0x2ba4e1[_0x2a92('0x37')]);if(_0x2ba4e1[_0x2a92('0x38')]){delete _0x2ba4e1[_0x2a92('0x38')];}_0x2788a3['status'](_0x30ea7e)[_0x2a92('0x39')](_0x2ba4e1);};}exports['index']=function(_0x362eaa,_0x3298d8){var _0x513778={},_0x2aad3f={},_0x445ba2={'count':0x0,'rows':[]};var _0x49ee51=_[_0x2a92('0x3a')](db[_0x2a92('0x3b')][_0x2a92('0x3c')],function(_0x4b07a6){return{'name':_0x4b07a6[_0x2a92('0x3d')],'type':_0x4b07a6[_0x2a92('0x3e')]['key']};});_0x2aad3f[_0x2a92('0x3f')]=_[_0x2a92('0x3a')](_0x49ee51,_0x2a92('0x38'));_0x2aad3f[_0x2a92('0x40')]=_['keys'](_0x362eaa[_0x2a92('0x40')]);_0x2aad3f[_0x2a92('0x41')]=_[_0x2a92('0x42')](_0x2aad3f[_0x2a92('0x3f')],_0x2aad3f['query']);_0x513778['attributes']=_[_0x2a92('0x42')](_0x2aad3f[_0x2a92('0x3f')],qs[_0x2a92('0x43')](_0x362eaa[_0x2a92('0x40')][_0x2a92('0x43')]));_0x513778[_0x2a92('0x44')]=_0x513778['attributes'][_0x2a92('0x45')]?_0x513778[_0x2a92('0x44')]:_0x2aad3f[_0x2a92('0x3f')];if(!_0x362eaa[_0x2a92('0x40')]['hasOwnProperty'](_0x2a92('0x46'))){_0x513778[_0x2a92('0x2f')]=qs[_0x2a92('0x2f')](_0x362eaa[_0x2a92('0x40')][_0x2a92('0x2f')]);_0x513778[_0x2a92('0x2d')]=qs['offset'](_0x362eaa[_0x2a92('0x40')][_0x2a92('0x2d')]);}_0x513778[_0x2a92('0x47')]=qs['sort'](_0x362eaa[_0x2a92('0x40')]['sort']);_0x513778[_0x2a92('0x48')]=qs[_0x2a92('0x41')](_['pick'](_0x362eaa[_0x2a92('0x40')],_0x2aad3f['filters']),_0x49ee51);if(_0x362eaa['query'][_0x2a92('0x49')]){_0x513778[_0x2a92('0x48')]=_[_0x2a92('0x4a')](_0x513778[_0x2a92('0x48')],{'$or':_[_0x2a92('0x3a')](_0x49ee51,function(_0x13141){if(_0x13141['type']!=='VIRTUAL'){var _0x489630={};_0x489630[_0x13141[_0x2a92('0x38')]]={'$like':'%'+_0x362eaa['query'][_0x2a92('0x49')]+'%'};return _0x489630;}})});}_0x513778=_[_0x2a92('0x4a')]({},_0x513778,_0x362eaa[_0x2a92('0x4b')]);var _0xf5f1b6={'where':_0x513778['where']};return db[_0x2a92('0x3b')][_0x2a92('0x30')](_0xf5f1b6)['then'](function(_0x4c4b4f){_0x445ba2[_0x2a92('0x30')]=_0x4c4b4f;if(_0x362eaa[_0x2a92('0x40')]['includeAll']){_0x513778[_0x2a92('0x4c')]=[{'all':!![]}];}return db[_0x2a92('0x3b')][_0x2a92('0x4d')](_0x513778);})['then'](function(_0x29b923){_0x445ba2['rows']=_0x29b923;return _0x445ba2;})[_0x2a92('0x1f')](respondWithFilteredResult(_0x3298d8,_0x513778))['catch'](handleError(_0x3298d8,null));};exports[_0x2a92('0x4e')]=function(_0x3a1ce2,_0x5b5974){var _0x40e9d9={'raw':!![],'where':{'id':_0x3a1ce2[_0x2a92('0x4f')]['id']}},_0x420892={};_0x420892[_0x2a92('0x3f')]=_[_0x2a92('0x50')](db[_0x2a92('0x3b')][_0x2a92('0x3c')]);_0x420892[_0x2a92('0x40')]=_['keys'](_0x3a1ce2[_0x2a92('0x40')]);_0x420892[_0x2a92('0x41')]=_[_0x2a92('0x42')](_0x420892[_0x2a92('0x3f')],_0x420892[_0x2a92('0x40')]);_0x40e9d9['attributes']=_[_0x2a92('0x42')](_0x420892[_0x2a92('0x3f')],qs[_0x2a92('0x43')](_0x3a1ce2[_0x2a92('0x40')][_0x2a92('0x43')]));_0x40e9d9[_0x2a92('0x44')]=_0x40e9d9['attributes'][_0x2a92('0x45')]?_0x40e9d9[_0x2a92('0x44')]:_0x420892[_0x2a92('0x3f')];if(_0x3a1ce2[_0x2a92('0x40')]['includeAll']){_0x40e9d9[_0x2a92('0x4c')]=[{'all':!![]}];}_0x40e9d9=_['merge']({},_0x40e9d9,_0x3a1ce2[_0x2a92('0x4b')]);return db[_0x2a92('0x3b')][_0x2a92('0x51')](_0x40e9d9)[_0x2a92('0x1f')](handleEntityNotFound(_0x5b5974,null))[_0x2a92('0x1f')](respondWithResult(_0x5b5974,null))['catch'](handleError(_0x5b5974,null));};exports[_0x2a92('0x52')]=function(_0x3203e6,_0x198c1e,_0x4a0a70){var _0x24f5cf;return db[_0x2a92('0x53')]['transaction'](function(_0x456f18){return db[_0x2a92('0x3b')]['create'](_0x3203e6[_0x2a92('0x54')],{'raw':!![]})[_0x2a92('0x1f')](function(_0x1f4c9d){_0x24f5cf=_0x1f4c9d;return db[_0x2a92('0x3b')][_0x2a92('0x4d')]({'where':{'type':_0x3203e6[_0x2a92('0x54')][_0x2a92('0x3e')]},'raw':!![]});})[_0x2a92('0x1f')](function(_0x3aca34){if(_0x24f5cf[_0x2a92('0x3e')][_0x2a92('0x55')]()==_0x2a92('0x56')){var _0x262c53=fs[_0x2a92('0x57')](path[_0x2a92('0x58')](config['root'],_0x2a92('0x59')),'utf8');var _0x5ed41f=ejs[_0x2a92('0x5a')](_0x262c53,{'networks':_0x3aca34||[]});fs[_0x2a92('0x5b')](_0x2a92('0x5c'),_0x5ed41f);return respondWithRpcPromise(_0x2a92('0x5d'),'create',{'module':_0x2a92('0x5e')});}else if(_0x24f5cf[_0x2a92('0x3e')][_0x2a92('0x55')]()==_0x2a92('0x5f')){var _0x45bef9=fs[_0x2a92('0x57')](path[_0x2a92('0x58')](config[_0x2a92('0x60')],_0x2a92('0x61')),_0x2a92('0x62'));var _0xf95cd8=ejs[_0x2a92('0x5a')](_0x45bef9,{'networks':_0x3aca34||[]});fs[_0x2a92('0x5b')](_0x2a92('0x63'),_0xf95cd8);return respondWithRpcPromise('Reload','create',{'module':_0x2a92('0x5e')});}else{var _0x1e5ecd=fs[_0x2a92('0x57')](path[_0x2a92('0x58')](config[_0x2a92('0x60')],_0x2a92('0x64')),'utf8');var _0x262fb1=ejs['render'](_0x1e5ecd,{'networks':_0x3aca34||[]});fs['writeFileSync'](util[_0x2a92('0x65')]('/etc/asterisk/sip_xcally_%s.conf',_0x3203e6[_0x2a92('0x54')]['type'][_0x2a92('0x66')]()),_0x262fb1);return respondWithRpcPromise(_0x2a92('0x5d'),_0x2a92('0x52'),{'module':_0x2a92('0x67')});}return null;})[_0x2a92('0x1f')](function(){return _0x24f5cf;});})['then'](respondWithResult(_0x198c1e,0xc9))[_0x2a92('0x68')](handleError(_0x198c1e,null));};exports[_0x2a92('0x35')]=function(_0x341cc2,_0xe97b8b,_0x418f50){var _0xa4faa8;return db[_0x2a92('0x53')]['transaction'](function(_0x15ae01){return db[_0x2a92('0x3b')][_0x2a92('0x51')]({'where':{'id':_0x341cc2[_0x2a92('0x4f')]['id']}})['then'](handleEntityNotFound(_0xe97b8b,null))[_0x2a92('0x1f')](saveUpdates(_0x341cc2[_0x2a92('0x54')],null))[_0x2a92('0x1f')](function(_0x2009cd){if(_0x2009cd){_0xa4faa8=_0x2009cd;return db['Network'][_0x2a92('0x4d')]({'where':{'type':_0xa4faa8['type']},'raw':!![]});}return null;})[_0x2a92('0x1f')](function(_0x129bf1){if(_0xa4faa8[_0x2a92('0x3e')][_0x2a92('0x55')]()==_0x2a92('0x56')){var _0x1cf266=fs[_0x2a92('0x57')](path[_0x2a92('0x58')](config[_0x2a92('0x60')],_0x2a92('0x59')),_0x2a92('0x62'));var _0x3876be=ejs['render'](_0x1cf266,{'networks':_0x129bf1||[]});fs[_0x2a92('0x5b')]('/etc/asterisk/stun_xcally.conf',_0x3876be);return respondWithRpcPromise(_0x2a92('0x5d'),_0x2a92('0x35'),{'module':_0x2a92('0x5e')});}else if(_0xa4faa8[_0x2a92('0x3e')]['toUpperCase']()==_0x2a92('0x5f')){var _0x2705d1=fs[_0x2a92('0x57')](path[_0x2a92('0x58')](config[_0x2a92('0x60')],'server/files/templates/turn_multiple.ejs'),_0x2a92('0x62'));var _0x50fae2=ejs[_0x2a92('0x5a')](_0x2705d1,{'networks':_0x129bf1||[]});fs[_0x2a92('0x5b')](_0x2a92('0x63'),_0x50fae2);return respondWithRpcPromise('Reload',_0x2a92('0x35'),{'module':_0x2a92('0x5e')});}else{var _0x3b3eab=fs[_0x2a92('0x57')](path[_0x2a92('0x58')](config[_0x2a92('0x60')],_0x2a92('0x64')),_0x2a92('0x62'));var _0x158d75=ejs['render'](_0x3b3eab,{'networks':_0x129bf1||[]});fs[_0x2a92('0x5b')](util['format'](_0x2a92('0x69'),_0x341cc2[_0x2a92('0x54')][_0x2a92('0x3e')][_0x2a92('0x66')]()),_0x158d75);return respondWithRpcPromise(_0x2a92('0x5d'),'update',{'module':_0x2a92('0x67')});}return null;})['then'](function(_0x3c8245){if(_0x3c8245){return _0xa4faa8;}return null;});})[_0x2a92('0x1f')](respondWithResult(_0xe97b8b,null))[_0x2a92('0x68')](handleError(_0xe97b8b,null));};exports[_0x2a92('0x36')]=function(_0x79f966,_0x588725,_0x470497){var _0x4d3579;return db[_0x2a92('0x3b')][_0x2a92('0x51')]({'where':{'id':_0x79f966['params']['id']}})[_0x2a92('0x1f')](function(_0x5e2505){_0x4d3579=_0x5e2505;return _0x5e2505;})[_0x2a92('0x1f')](handleEntityNotFound(_0x588725,null))[_0x2a92('0x1f')](removeEntity(_0x588725,null))[_0x2a92('0x1f')](function(){if(_0x4d3579){return db[_0x2a92('0x3b')][_0x2a92('0x4d')]({'where':{'type':_0x4d3579['type']},'raw':!![]});}})['then'](function(_0x18b0bf){if(_0x4d3579[_0x2a92('0x3e')]['toUpperCase']()==_0x2a92('0x56')){var _0x4f753d=fs[_0x2a92('0x57')](path[_0x2a92('0x58')](config['root'],_0x2a92('0x59')),_0x2a92('0x62'));var _0x451b59=ejs[_0x2a92('0x5a')](_0x4f753d,{'networks':_0x18b0bf||[]});fs[_0x2a92('0x5b')]('/etc/asterisk/stun_xcally.conf',_0x451b59);return respondWithRpcPromise(_0x2a92('0x5d'),'destroy',{'module':_0x2a92('0x5e')});}else if(_0x4d3579[_0x2a92('0x3e')][_0x2a92('0x55')]()==_0x2a92('0x5f')){var _0x16f3ab=fs[_0x2a92('0x57')](path['join'](config[_0x2a92('0x60')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x211156=ejs[_0x2a92('0x5a')](_0x16f3ab,{'networks':_0x18b0bf||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x211156);return respondWithRpcPromise(_0x2a92('0x5d'),_0x2a92('0x36'),{'module':'res_stun_monitor.so'});}else{var _0x2874e6=fs[_0x2a92('0x57')](path[_0x2a92('0x58')](config['root'],_0x2a92('0x64')),'utf8');var _0x60f833=ejs[_0x2a92('0x5a')](_0x2874e6,{'networks':_0x18b0bf||[]});fs['writeFileSync'](util[_0x2a92('0x65')]('/etc/asterisk/sip_xcally_%s.conf',_0x79f966[_0x2a92('0x54')][_0x2a92('0x3e')][_0x2a92('0x66')]()),_0x60f833);return respondWithRpcPromise(_0x2a92('0x5d'),'destroy',{'module':_0x2a92('0x67')});}return null;})['catch'](handleError(_0x588725,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 1e30163..034c216 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 _0x3a25=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','network','lodash'];(function(_0x23fdfb,_0x1814d4){var _0x2133e4=function(_0x4ab780){while(--_0x4ab780){_0x23fdfb['push'](_0x23fdfb['shift']());}};_0x2133e4(++_0x1814d4);}(_0x3a25,0x15d));var _0x53a2=function(_0x30d1c1,_0x340855){_0x30d1c1=_0x30d1c1-0x0;var _0x240b48=_0x3a25[_0x30d1c1];return _0x240b48;};'use strict';var _=require(_0x53a2('0x0'));var util=require(_0x53a2('0x1'));var logger=require(_0x53a2('0x2'))(_0x53a2('0x3'));var moment=require(_0x53a2('0x4'));var BPromise=require(_0x53a2('0x5'));var rp=require(_0x53a2('0x6'));var fs=require('fs');var path=require(_0x53a2('0x7'));var rimraf=require(_0x53a2('0x8'));var config=require(_0x53a2('0x9'));var attributes=require(_0x53a2('0xa'));module[_0x53a2('0xb')]=function(_0x2b4011,_0x346fc7){return _0x2b4011[_0x53a2('0xc')]('Network',attributes,{'tableName':_0x53a2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','moment','bluebird'];(function(_0x167e2b,_0xcb557b){var _0x538aa1=function(_0x198771){while(--_0x198771){_0x167e2b['push'](_0x167e2b['shift']());}};_0x538aa1(++_0xcb557b);}(_0xe706,0xa3));var _0x6e70=function(_0x13256a,_0x44d0a2){_0x13256a=_0x13256a-0x0;var _0x59ad3b=_0xe706[_0x13256a];return _0x59ad3b;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 15e3448..abc7dea 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1d1e2e,_0x560855){var _0x22c325=function(_0x45b3b2){while(--_0x45b3b2){_0x1d1e2e['push'](_0x1d1e2e['shift']());}};_0x22c325(++_0x560855);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x225ad2,_0x35d707){_0x225ad2=_0x225ad2-0x0;var _0x15a893=_0x7a54[_0x225ad2];return _0x15a893;};'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 16a387a..ea91492 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 _0x2597=['get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','addAnswer','notify','addApplications','/:id/users','send','put','/:id','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2597,0xf4));var _0x7259=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x2597[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require(_0x7259('0x0'));var util=require(_0x7259('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7259('0x2')]();var fs_extra=require(_0x7259('0x3'));var auth=require(_0x7259('0x4'));var interaction=require(_0x7259('0x5'));var config=require(_0x7259('0x6'));var controller=require(_0x7259('0x7'));router[_0x7259('0x8')]('/',auth[_0x7259('0x9')](),controller[_0x7259('0xa')]);router[_0x7259('0x8')](_0x7259('0xb'),auth[_0x7259('0x9')](),controller[_0x7259('0xc')]);router['get']('/:id',auth[_0x7259('0x9')](),controller[_0x7259('0xd')]);router[_0x7259('0x8')](_0x7259('0xe'),auth[_0x7259('0x9')](),controller['getDispositions']);router['get'](_0x7259('0xf'),auth[_0x7259('0x9')](),controller['getAnswers']);router['get'](_0x7259('0x10'),auth[_0x7259('0x9')](),controller[_0x7259('0x11')]);router['get'](_0x7259('0x12'),auth[_0x7259('0x9')](),controller[_0x7259('0x13')]);router[_0x7259('0x8')]('/:id/users',auth[_0x7259('0x9')](),controller[_0x7259('0x14')]);router[_0x7259('0x15')]('/',auth[_0x7259('0x9')](),controller[_0x7259('0x16')]);router[_0x7259('0x15')](_0x7259('0xe'),auth[_0x7259('0x9')](),controller[_0x7259('0x17')]);router[_0x7259('0x15')](_0x7259('0xf'),auth['isAuthenticated'](),controller[_0x7259('0x18')]);router[_0x7259('0x15')]('/:id/notify',controller[_0x7259('0x19')]);router[_0x7259('0x15')](_0x7259('0x10'),auth[_0x7259('0x9')](),controller[_0x7259('0x1a')]);router['post'](_0x7259('0x1b'),auth[_0x7259('0x9')](),controller['addAgents']);router[_0x7259('0x15')]('/:id/send',auth[_0x7259('0x9')](),controller[_0x7259('0x1c')]);router[_0x7259('0x1d')](_0x7259('0x1e'),auth[_0x7259('0x9')](),controller['update']);router[_0x7259('0x1f')](_0x7259('0x1e'),auth['isAuthenticated'](),controller['destroy']);router[_0x7259('0x1f')](_0x7259('0xe'),auth[_0x7259('0x9')](),controller[_0x7259('0x20')]);router[_0x7259('0x1f')](_0x7259('0xf'),auth[_0x7259('0x9')](),controller[_0x7259('0x21')]);router[_0x7259('0x1f')](_0x7259('0x1b'),auth[_0x7259('0x9')](),controller[_0x7259('0x22')]);module[_0x7259('0x23')]=router; \ No newline at end of file +var _0xcff7=['../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getDispositions','getAnswers','/:id/applications','/:id/interactions','getAgents','post','/:id/canned_answers','addAnswer','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','update','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','Router','fs-extra'];(function(_0x570503,_0x1051e8){var _0x190cd6=function(_0x124f8d){while(--_0x124f8d){_0x570503['push'](_0x570503['shift']());}};_0x190cd6(++_0x1051e8);}(_0xcff7,0x1ab));var _0x7cff=function(_0x4340bf,_0x2c94fd){_0x4340bf=_0x4340bf-0x0;var _0x2b9ceb=_0xcff7[_0x4340bf];return _0x2b9ceb;};'use strict';var multer=require(_0x7cff('0x0'));var util=require('util');var path=require(_0x7cff('0x1'));var timeout=require(_0x7cff('0x2'));var express=require('express');var router=express[_0x7cff('0x3')]();var fs_extra=require(_0x7cff('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7cff('0x5'));var config=require('../../config/environment');var controller=require(_0x7cff('0x6'));router['get']('/',auth[_0x7cff('0x7')](),controller[_0x7cff('0x8')]);router[_0x7cff('0x9')](_0x7cff('0xa'),auth[_0x7cff('0x7')](),controller[_0x7cff('0xb')]);router[_0x7cff('0x9')](_0x7cff('0xc'),auth['isAuthenticated'](),controller[_0x7cff('0xd')]);router[_0x7cff('0x9')]('/:id/dispositions',auth[_0x7cff('0x7')](),controller[_0x7cff('0xe')]);router['get']('/:id/canned_answers',auth[_0x7cff('0x7')](),controller[_0x7cff('0xf')]);router[_0x7cff('0x9')](_0x7cff('0x10'),auth[_0x7cff('0x7')](),controller['getApplications']);router[_0x7cff('0x9')](_0x7cff('0x11'),auth[_0x7cff('0x7')](),controller['getInteractions']);router[_0x7cff('0x9')]('/:id/users',auth[_0x7cff('0x7')](),controller[_0x7cff('0x12')]);router[_0x7cff('0x13')]('/',auth[_0x7cff('0x7')](),controller['create']);router['post']('/:id/dispositions',auth[_0x7cff('0x7')](),controller['addDisposition']);router['post'](_0x7cff('0x14'),auth['isAuthenticated'](),controller[_0x7cff('0x15')]);router['post']('/:id/notify',controller[_0x7cff('0x16')]);router[_0x7cff('0x13')](_0x7cff('0x10'),auth[_0x7cff('0x7')](),controller[_0x7cff('0x17')]);router['post'](_0x7cff('0x18'),auth[_0x7cff('0x7')](),controller[_0x7cff('0x19')]);router[_0x7cff('0x13')](_0x7cff('0x1a'),auth[_0x7cff('0x7')](),controller[_0x7cff('0x1b')]);router[_0x7cff('0x1c')](_0x7cff('0xc'),auth[_0x7cff('0x7')](),controller[_0x7cff('0x1d')]);router[_0x7cff('0x1e')]('/:id',auth[_0x7cff('0x7')](),controller[_0x7cff('0x1f')]);router['delete'](_0x7cff('0x20'),auth[_0x7cff('0x7')](),controller[_0x7cff('0x21')]);router[_0x7cff('0x1e')](_0x7cff('0x14'),auth[_0x7cff('0x7')](),controller[_0x7cff('0x22')]);router[_0x7cff('0x1e')](_0x7cff('0x18'),auth[_0x7cff('0x7')](),controller[_0x7cff('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 744bd46..0893e37 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 _0x34b9=['generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','randomstring','exports','STRING','name'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x34b9,0x8c));var _0x934b=function(_0x445879,_0x575780){_0x445879=_0x445879-0x0;var _0x325d43=_0x34b9[_0x445879];return _0x325d43;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x934b('0x0'));module[_0x934b('0x1')]={'name':{'type':Sequelize[_0x934b('0x2')],'unique':_0x934b('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x934b('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x934b('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x934b('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x934b('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x934b('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x934b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x934b('0x2')]},'queueTransfer':{'type':Sequelize[_0x934b('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x934b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x934b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x934b('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x934b('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x934b('0x9'),'set':function(_0xdf9400){if(!_0xdf9400)this[_0x934b('0xa')](_0x934b('0xb'),null);this[_0x934b('0xa')]('mandatoryDisposition',_0xdf9400);}}}; \ No newline at end of file +var _0x866f=['exports','STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring'];(function(_0x3687f1,_0x25fb23){var _0x18763f=function(_0x27f9f9){while(--_0x27f9f9){_0x3687f1['push'](_0x3687f1['shift']());}};_0x18763f(++_0x25fb23);}(_0x866f,0x148));var _0xf866=function(_0x339ef4,_0x174f8c){_0x339ef4=_0x339ef4-0x0;var _0x4bce32=_0x866f[_0x339ef4];return _0x4bce32;};'use strict';var Sequelize=require(_0xf866('0x0'));var rs=require(_0xf866('0x1'));module[_0xf866('0x2')]={'name':{'type':Sequelize[_0xf866('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xf866('0x3')]},'token':{'type':Sequelize[_0xf866('0x3')],'defaultValue':function(){return rs[_0xf866('0x4')]();}},'replyUri':{'type':Sequelize[_0xf866('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xf866('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf866('0x5');}},'notificationSound':{'type':Sequelize[_0xf866('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf866('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xf866('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf866('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf866('0x6')],'defaultValue':![],'comment':_0xf866('0x8'),'set':function(_0x72fa5a){if(!_0x72fa5a)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xf866('0x9')]('mandatoryDisposition',_0x72fa5a);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 05c4677..20b9c34 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 _0x7c0f=['catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','show','params','options','find','create','body','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','Disposition','getDispositions','findOne','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','findAll','removeAnswers','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','asc','ListId','firstName','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','contact','lastName','messageId','interaction','created','autoclose','close','*,*,*,*','AttachmentId','UserId','User','forcedOwnership','Start','startRouting','addApplications','sequelize','transaction','Transaction','findAndCountAll','finally','getApplications','Contact','Owner','internal','Tag','color','tag','addAgents','omit','emit','removeAgents','userOpenchannelAccount:remove','getAgents','CmList','defaults','user','OpenchannelMessage','dataValues','Messages','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5a57bf,_0x39f906){var _0x6a6949=function(_0x1da6ce){while(--_0x1da6ce){_0x5a57bf['push'](_0x5a57bf['shift']());}};_0x6a6949(++_0x39f906);}(_0x7c0f,0x91));var _0xf7c0=function(_0x4f6f94,_0x28f451){_0x4f6f94=_0x4f6f94-0x0;var _0x525925=_0x7c0f[_0x4f6f94];return _0x525925;};'use strict';var emlformat=require(_0xf7c0('0x0'));var rimraf=require(_0xf7c0('0x1'));var zipdir=require(_0xf7c0('0x2'));var jsonpatch=require(_0xf7c0('0x3'));var rp=require(_0xf7c0('0x4'));var moment=require(_0xf7c0('0x5'));var BPromise=require(_0xf7c0('0x6'));var Mustache=require(_0xf7c0('0x7'));var util=require(_0xf7c0('0x8'));var path=require(_0xf7c0('0x9'));var sox=require(_0xf7c0('0xa'));var csv=require(_0xf7c0('0xb'));var ejs=require(_0xf7c0('0xc'));var fs=require('fs');var fs_extra=require(_0xf7c0('0xd'));var _=require('lodash');var squel=require(_0xf7c0('0xe'));var crypto=require('crypto');var jsforce=require(_0xf7c0('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf7c0('0x10'));var Redis=require(_0xf7c0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf7c0('0x12'));var as=require(_0xf7c0('0x13'));var hardwareService=require(_0xf7c0('0x14'));var logger=require(_0xf7c0('0x15'))(_0xf7c0('0x16'));var utils=require(_0xf7c0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf7c0('0x18'));var db=require(_0xf7c0('0x19'))['db'];config[_0xf7c0('0x1a')]=_['defaults'](config[_0xf7c0('0x1a')],{'host':_0xf7c0('0x1b'),'port':0x18eb});var socket=require(_0xf7c0('0x1c'))(new Redis(config[_0xf7c0('0x1a')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xf7c0('0x1d')][_0xf7c0('0x1e')]({'port':0x232c});var client9002=jayson[_0xf7c0('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16990a,_0x2c64a0,_0x117390,_0x369f86){return new BPromise(function(_0x14170d,_0x118bc0){var _0x29daf6=_0x369f86||client;return _0x29daf6[_0xf7c0('0x1f')](_0x16990a,_0x117390)['then'](function(_0x13745b){logger[_0xf7c0('0x20')](_0xf7c0('0x21'),_0x2c64a0,_0xf7c0('0x22'));logger[_0xf7c0('0x23')](_0xf7c0('0x24'),_0x2c64a0,_0xf7c0('0x22'),JSON[_0xf7c0('0x25')](_0x13745b));if(_0x13745b[_0xf7c0('0x26')]){if(_0x13745b[_0xf7c0('0x26')][_0xf7c0('0x27')]===0x1f4){logger['error'](_0xf7c0('0x21'),_0x2c64a0,_0x13745b['error'][_0xf7c0('0x28')]);return _0x118bc0(_0x13745b[_0xf7c0('0x26')][_0xf7c0('0x28')]);}logger['error'](_0xf7c0('0x21'),_0x2c64a0,_0x13745b[_0xf7c0('0x26')]['message']);return _0x14170d(_0x13745b[_0xf7c0('0x26')][_0xf7c0('0x28')]);}else{logger[_0xf7c0('0x20')](_0xf7c0('0x21'),_0x2c64a0,_0xf7c0('0x22'));_0x14170d(_0x13745b['result'][_0xf7c0('0x28')]);}})[_0xf7c0('0x29')](function(_0x55298c){logger['error'](_0xf7c0('0x21'),_0x2c64a0,_0x55298c);_0x118bc0(_0x55298c);});});}function respondWithStatusCode(_0x2468d8,_0x1dbbb5){_0x1dbbb5=_0x1dbbb5||0xcc;return function(_0x45bc29){if(_0x45bc29){return _0x2468d8[_0xf7c0('0x2a')](_0x1dbbb5);}return _0x2468d8['status'](_0x1dbbb5)[_0xf7c0('0x2b')]();};}function respondWithResult(_0x108d67,_0x438d40){_0x438d40=_0x438d40||0xc8;return function(_0x49133b){if(_0x49133b){return _0x108d67[_0xf7c0('0x2c')](_0x438d40)[_0xf7c0('0x2d')](_0x49133b);}};}function respondWithFilteredResult(_0x167a6e,_0x53368a){return function(_0x5f09c8){if(_0x5f09c8){var _0x597247=typeof _0x53368a[_0xf7c0('0x2e')]===_0xf7c0('0x2f')&&typeof _0x53368a[_0xf7c0('0x30')]===_0xf7c0('0x2f');var _0x2a2c15=_0x5f09c8[_0xf7c0('0x31')];var _0x2ae721=_0x597247?0x0:_0x53368a[_0xf7c0('0x2e')];var _0x1ef53d=_0x597247?_0x5f09c8[_0xf7c0('0x31')]:_0x53368a['offset']+_0x53368a[_0xf7c0('0x30')];var _0x3cfb94;if(_0x1ef53d>=_0x2a2c15){_0x1ef53d=_0x2a2c15;_0x3cfb94=0xc8;}else{_0x3cfb94=0xce;}_0x167a6e['status'](_0x3cfb94);return _0x167a6e[_0xf7c0('0x32')](_0xf7c0('0x33'),_0x2ae721+'-'+_0x1ef53d+'/'+_0x2a2c15)[_0xf7c0('0x2d')](_0x5f09c8);}return null;};}function patchUpdates(_0x254656){return function(_0x14ca8c){try{jsonpatch[_0xf7c0('0x34')](_0x14ca8c,_0x254656,!![]);}catch(_0x561adb){return BPromise['reject'](_0x561adb);}return _0x14ca8c[_0xf7c0('0x35')]();};}function saveUpdates(_0x51d868,_0x52a66f){return function(_0x3a5e32){if(_0x3a5e32){return _0x3a5e32['update'](_0x51d868)[_0xf7c0('0x36')](function(_0x92fd83){return _0x92fd83;});}return null;};}function removeEntity(_0x38c03f,_0x56ed0a){return function(_0x44f03d){if(_0x44f03d){return _0x44f03d[_0xf7c0('0x37')]()[_0xf7c0('0x36')](function(){var _0xb333b4=_0x44f03d[_0xf7c0('0x38')]({'plain':!![]});var _0x4d4ab0=_0xf7c0('0x39');return db[_0xf7c0('0x3a')][_0xf7c0('0x37')]({'where':{'type':_0x4d4ab0,'resourceId':_0xb333b4['id']}})[_0xf7c0('0x36')](function(){return _0x44f03d;});})[_0xf7c0('0x36')](function(){_0x38c03f[_0xf7c0('0x2c')](0xcc)[_0xf7c0('0x2b')]();});}};}function handleEntityNotFound(_0x265638,_0x146356){return function(_0xd2b6e9){if(!_0xd2b6e9){_0x265638['sendStatus'](0x194);}return _0xd2b6e9;};}function handleError(_0x3ffcc7,_0x177971){_0x177971=_0x177971||0x1f4;return function(_0x452a81){logger['error'](_0x452a81[_0xf7c0('0x3b')]);if(_0x452a81[_0xf7c0('0x3c')]){delete _0x452a81[_0xf7c0('0x3c')];}_0x3ffcc7['status'](_0x177971)[_0xf7c0('0x3d')](_0x452a81);};}exports[_0xf7c0('0x3e')]=function(_0x313c3f,_0x4ccb22){var _0x1993c2={'include':[{'model':db[_0xf7c0('0x3f')],'as':_0xf7c0('0x40')}]},_0x163d38={},_0x5b8e1a={'count':0x0,'rows':[]};var _0x2c9dea=_[_0xf7c0('0x41')](db[_0xf7c0('0x42')][_0xf7c0('0x43')],function(_0x2f0261){return{'name':_0x2f0261['fieldName'],'type':_0x2f0261[_0xf7c0('0x44')][_0xf7c0('0x45')]};});_0x163d38['model']=_[_0xf7c0('0x41')](_0x2c9dea,'name');_0x163d38[_0xf7c0('0x46')]=_[_0xf7c0('0x47')](_0x313c3f[_0xf7c0('0x46')]);_0x163d38[_0xf7c0('0x48')]=_[_0xf7c0('0x49')](_0x163d38['model'],_0x163d38[_0xf7c0('0x46')]);_0x1993c2['attributes']=_['intersection'](_0x163d38[_0xf7c0('0x4a')],qs[_0xf7c0('0x4b')](_0x313c3f['query']['fields']));_0x1993c2[_0xf7c0('0x4c')]=_0x1993c2[_0xf7c0('0x4c')][_0xf7c0('0x4d')]?_0x1993c2[_0xf7c0('0x4c')]:_0x163d38[_0xf7c0('0x4a')];if(!_0x313c3f['query'][_0xf7c0('0x4e')](_0xf7c0('0x4f'))){_0x1993c2[_0xf7c0('0x30')]=qs[_0xf7c0('0x30')](_0x313c3f['query']['limit']);_0x1993c2['offset']=qs['offset'](_0x313c3f['query'][_0xf7c0('0x2e')]);}_0x1993c2[_0xf7c0('0x50')]=qs[_0xf7c0('0x51')](_0x313c3f['query'][_0xf7c0('0x51')]);_0x1993c2[_0xf7c0('0x52')]=qs[_0xf7c0('0x48')](_[_0xf7c0('0x53')](_0x313c3f['query'],_0x163d38[_0xf7c0('0x48')]),_0x2c9dea);if(_0x313c3f[_0xf7c0('0x46')]['filter']){_0x1993c2[_0xf7c0('0x52')]=_[_0xf7c0('0x54')](_0x1993c2[_0xf7c0('0x52')],{'$or':_[_0xf7c0('0x41')](_0x2c9dea,function(_0x8471cd){if(_0x8471cd[_0xf7c0('0x44')]!==_0xf7c0('0x55')){var _0xe2fb55={};_0xe2fb55[_0x8471cd[_0xf7c0('0x3c')]]={'$like':'%'+_0x313c3f[_0xf7c0('0x46')][_0xf7c0('0x56')]+'%'};return _0xe2fb55;}})});}_0x1993c2=_[_0xf7c0('0x54')]({},_0x1993c2,_0x313c3f['options']);var _0x2797b8={'where':_0x1993c2[_0xf7c0('0x52')]};return db[_0xf7c0('0x42')][_0xf7c0('0x31')](_0x2797b8)[_0xf7c0('0x36')](function(_0x576a51){_0x5b8e1a['count']=_0x576a51;if(_0x313c3f[_0xf7c0('0x46')][_0xf7c0('0x57')]){_0x1993c2[_0xf7c0('0x58')]=[{'all':!![]}];}return db[_0xf7c0('0x42')]['findAll'](_0x1993c2);})[_0xf7c0('0x36')](function(_0x4c1ee6){_0x5b8e1a[_0xf7c0('0x59')]=_0x4c1ee6;return _0x5b8e1a;})[_0xf7c0('0x36')](respondWithFilteredResult(_0x4ccb22,_0x1993c2))[_0xf7c0('0x29')](handleError(_0x4ccb22,null));};exports[_0xf7c0('0x5a')]=function(_0x5707c9,_0x1781a7){var _0x41920f={'raw':![],'where':{'id':_0x5707c9[_0xf7c0('0x5b')]['id']},'include':[{'model':db[_0xf7c0('0x3f')],'as':_0xf7c0('0x40')}]},_0x44983a={};_0x44983a['model']=_[_0xf7c0('0x47')](db[_0xf7c0('0x42')][_0xf7c0('0x43')]);_0x44983a[_0xf7c0('0x46')]=_['keys'](_0x5707c9[_0xf7c0('0x46')]);_0x44983a[_0xf7c0('0x48')]=_[_0xf7c0('0x49')](_0x44983a['model'],_0x44983a[_0xf7c0('0x46')]);_0x41920f[_0xf7c0('0x4c')]=_[_0xf7c0('0x49')](_0x44983a[_0xf7c0('0x4a')],qs[_0xf7c0('0x4b')](_0x5707c9[_0xf7c0('0x46')][_0xf7c0('0x4b')]));_0x41920f[_0xf7c0('0x4c')]=_0x41920f[_0xf7c0('0x4c')]['length']?_0x41920f[_0xf7c0('0x4c')]:_0x44983a[_0xf7c0('0x4a')];if(_0x5707c9[_0xf7c0('0x46')][_0xf7c0('0x57')]){_0x41920f[_0xf7c0('0x58')]=[{'all':!![]}];}_0x41920f=_[_0xf7c0('0x54')]({},_0x41920f,_0x5707c9[_0xf7c0('0x5c')]);return db[_0xf7c0('0x42')][_0xf7c0('0x5d')](_0x41920f)[_0xf7c0('0x36')](handleEntityNotFound(_0x1781a7,null))[_0xf7c0('0x36')](respondWithResult(_0x1781a7,null))[_0xf7c0('0x29')](handleError(_0x1781a7,null));};exports[_0xf7c0('0x5e')]=function(_0x5587e,_0x39ef18){return db[_0xf7c0('0x42')][_0xf7c0('0x5e')](_0x5587e[_0xf7c0('0x5f')],{})[_0xf7c0('0x36')](function(_0x4188d2){var _0x16621b=_0x5587e['user'][_0xf7c0('0x38')]({'plain':!![]});if(!_0x16621b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16621b[_0xf7c0('0x60')]==='user'){var _0x75a9f7=_0x4188d2[_0xf7c0('0x38')]({'plain':!![]});var _0x59bd09=_0xf7c0('0x39');return db[_0xf7c0('0x61')][_0xf7c0('0x5d')]({'where':{'name':_0x59bd09,'userProfileId':_0x16621b[_0xf7c0('0x62')]},'raw':!![]})[_0xf7c0('0x36')](function(_0x499093){if(_0x499093&&_0x499093[_0xf7c0('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x75a9f7['name'],'resourceId':_0x75a9f7['id'],'type':_0x499093[_0xf7c0('0x3c')],'sectionId':_0x499093['id']},{})['then'](function(){return _0x4188d2;});}else{return _0x4188d2;}})[_0xf7c0('0x29')](function(_0x2ac7e3){logger[_0xf7c0('0x26')](_0xf7c0('0x64'),_0x2ac7e3);throw _0x2ac7e3;});}return _0x4188d2;})[_0xf7c0('0x36')](respondWithResult(_0x39ef18,0xc9))[_0xf7c0('0x29')](handleError(_0x39ef18,null));};exports[_0xf7c0('0x65')]=function(_0x4ad69f,_0x2fa247){if(_0x4ad69f[_0xf7c0('0x5f')]['id']){delete _0x4ad69f[_0xf7c0('0x5f')]['id'];}return db[_0xf7c0('0x42')][_0xf7c0('0x5d')]({'where':{'id':_0x4ad69f['params']['id']},'include':[{'model':db[_0xf7c0('0x3f')],'as':_0xf7c0('0x40')}]})[_0xf7c0('0x36')](handleEntityNotFound(_0x2fa247,null))[_0xf7c0('0x36')](saveUpdates(_0x4ad69f[_0xf7c0('0x5f')],null))['then'](respondWithResult(_0x2fa247,null))[_0xf7c0('0x29')](handleError(_0x2fa247,null));};exports[_0xf7c0('0x37')]=function(_0x87a0b,_0x63512f){return db['OpenchannelAccount'][_0xf7c0('0x5d')]({'where':{'id':_0x87a0b[_0xf7c0('0x5b')]['id']}})[_0xf7c0('0x36')](handleEntityNotFound(_0x63512f,null))[_0xf7c0('0x36')](removeEntity(_0x63512f,null))[_0xf7c0('0x29')](handleError(_0x63512f,null));};exports['describe']=function(_0x1cdbc3,_0x11131c){return db[_0xf7c0('0x42')][_0xf7c0('0x66')]()[_0xf7c0('0x36')](respondWithResult(_0x11131c,null))[_0xf7c0('0x29')](handleError(_0x11131c,null));};exports['addDisposition']=function(_0xcf4729,_0x5c8c7d,_0x3ea068){if(_0xcf4729[_0xf7c0('0x5f')]['id']){delete _0xcf4729[_0xf7c0('0x5f')]['id'];}return db['OpenchannelAccount'][_0xf7c0('0x5d')]({'where':{'id':_0xcf4729[_0xf7c0('0x5b')]['id']}})[_0xf7c0('0x36')](handleEntityNotFound(_0x5c8c7d,null))[_0xf7c0('0x36')](function(_0x3e6acf){if(_0x3e6acf){_0xcf4729[_0xf7c0('0x5f')]['OpenchannelAccountId']=_0x3e6acf['id'];return db[_0xf7c0('0x67')][_0xf7c0('0x5e')](_0xcf4729[_0xf7c0('0x5f')]);}})['then'](respondWithResult(_0x5c8c7d,null))[_0xf7c0('0x29')](handleError(_0x5c8c7d,null));};exports[_0xf7c0('0x68')]=function(_0x37b5ba,_0x230340,_0x5460d2){var _0x52cdee={'raw':![],'where':{}};var _0x44dd49={};var _0x4d987a={'count':0x0,'rows':[]};return db[_0xf7c0('0x42')][_0xf7c0('0x69')]({'where':{'id':_0x37b5ba['params']['id']}})[_0xf7c0('0x36')](handleEntityNotFound(_0x230340,null))[_0xf7c0('0x36')](function(_0x536feb){if(_0x536feb){_0x44dd49['model']=_[_0xf7c0('0x47')](db['Disposition']['rawAttributes']);_0x44dd49[_0xf7c0('0x46')]=_[_0xf7c0('0x47')](_0x37b5ba['query']);_0x44dd49['filters']=_[_0xf7c0('0x49')](_0x44dd49[_0xf7c0('0x4a')],_0x44dd49[_0xf7c0('0x46')]);_0x52cdee[_0xf7c0('0x4c')]=_[_0xf7c0('0x49')](_0x44dd49[_0xf7c0('0x4a')],qs['fields'](_0x37b5ba[_0xf7c0('0x46')][_0xf7c0('0x4b')]));_0x52cdee['attributes']=_0x52cdee['attributes'][_0xf7c0('0x4d')]?_0x52cdee[_0xf7c0('0x4c')]:_0x44dd49['model'];if(!_0x37b5ba[_0xf7c0('0x46')][_0xf7c0('0x4e')]('nolimit')){_0x52cdee[_0xf7c0('0x30')]=qs['limit'](_0x37b5ba[_0xf7c0('0x46')][_0xf7c0('0x30')]);_0x52cdee[_0xf7c0('0x2e')]=qs[_0xf7c0('0x2e')](_0x37b5ba['query']['offset']);}_0x52cdee[_0xf7c0('0x50')]=qs[_0xf7c0('0x51')](_0x37b5ba['query']['sort']);_0x52cdee[_0xf7c0('0x52')]=qs[_0xf7c0('0x48')](_['pick'](_0x37b5ba[_0xf7c0('0x46')],_0x44dd49[_0xf7c0('0x48')]));_0x52cdee[_0xf7c0('0x52')][_0xf7c0('0x6a')]=_0x536feb['id'];if(_0x37b5ba[_0xf7c0('0x46')][_0xf7c0('0x56')]){_0x52cdee['where']=_[_0xf7c0('0x54')](_0x52cdee[_0xf7c0('0x52')],{'$or':_[_0xf7c0('0x41')](_0x52cdee['attributes'],function(_0x78fa99){var _0x3d7050={};_0x3d7050[_0x78fa99]={'$like':'%'+_0x37b5ba[_0xf7c0('0x46')][_0xf7c0('0x56')]+'%'};return _0x3d7050;})});}_0x52cdee=_[_0xf7c0('0x54')]({},_0x52cdee,_0x37b5ba[_0xf7c0('0x5c')]);return db['Disposition'][_0xf7c0('0x31')]({'where':_0x52cdee['where']})['then'](function(_0x348227){_0x4d987a[_0xf7c0('0x31')]=_0x348227;if(_0x37b5ba[_0xf7c0('0x46')][_0xf7c0('0x57')]){_0x52cdee[_0xf7c0('0x58')]=[{'all':!![]}];}return db[_0xf7c0('0x67')]['findAll'](_0x52cdee);})['then'](function(_0x5957f1){_0x4d987a[_0xf7c0('0x59')]=_0x5957f1;return _0x4d987a;});}})[_0xf7c0('0x36')](respondWithFilteredResult(_0x230340,_0x52cdee))[_0xf7c0('0x29')](handleError(_0x230340,null));};exports[_0xf7c0('0x6b')]=function(_0x5b490c,_0x4a2c4f,_0x88f760){return db[_0xf7c0('0x42')][_0xf7c0('0x5d')]({'where':{'id':_0x5b490c['params']['id']}})[_0xf7c0('0x36')](handleEntityNotFound(_0x4a2c4f,null))[_0xf7c0('0x36')](function(_0x2717de){if(_0x2717de){return _0x2717de['removeDispositions'](_0x5b490c['query'][_0xf7c0('0x6c')]);}})[_0xf7c0('0x36')](respondWithStatusCode(_0x4a2c4f,null))['catch'](handleError(_0x4a2c4f,null));};exports[_0xf7c0('0x6d')]=function(_0x1aab5d,_0x2c08d1,_0x3535d8){if(_0x1aab5d['body']['id']){delete _0x1aab5d[_0xf7c0('0x5f')]['id'];}return db['OpenchannelAccount'][_0xf7c0('0x5d')]({'where':{'id':_0x1aab5d['params']['id']}})['then'](handleEntityNotFound(_0x2c08d1,null))[_0xf7c0('0x36')](function(_0x2392ae){if(_0x2392ae){_0x1aab5d[_0xf7c0('0x5f')][_0xf7c0('0x6a')]=_0x2392ae['id'];return db[_0xf7c0('0x6e')][_0xf7c0('0x5e')](_0x1aab5d[_0xf7c0('0x5f')]);}})[_0xf7c0('0x36')](respondWithResult(_0x2c08d1,null))[_0xf7c0('0x29')](handleError(_0x2c08d1,null));};exports['getAnswers']=function(_0x222f3c,_0x502ae7,_0x2b80c3){var _0x55dfad={'raw':![],'where':{}};var _0x1f9b1b={};var _0x4a65a1={'count':0x0,'rows':[]};return db[_0xf7c0('0x42')][_0xf7c0('0x69')]({'where':{'id':_0x222f3c[_0xf7c0('0x5b')]['id']}})[_0xf7c0('0x36')](handleEntityNotFound(_0x502ae7,null))[_0xf7c0('0x36')](function(_0x32919c){if(_0x32919c){_0x1f9b1b[_0xf7c0('0x4a')]=_['keys'](db[_0xf7c0('0x6e')][_0xf7c0('0x43')]);_0x1f9b1b[_0xf7c0('0x46')]=_[_0xf7c0('0x47')](_0x222f3c[_0xf7c0('0x46')]);_0x1f9b1b[_0xf7c0('0x48')]=_[_0xf7c0('0x49')](_0x1f9b1b[_0xf7c0('0x4a')],_0x1f9b1b[_0xf7c0('0x46')]);_0x55dfad[_0xf7c0('0x4c')]=_[_0xf7c0('0x49')](_0x1f9b1b[_0xf7c0('0x4a')],qs[_0xf7c0('0x4b')](_0x222f3c[_0xf7c0('0x46')]['fields']));_0x55dfad[_0xf7c0('0x4c')]=_0x55dfad[_0xf7c0('0x4c')]['length']?_0x55dfad['attributes']:_0x1f9b1b[_0xf7c0('0x4a')];if(!_0x222f3c[_0xf7c0('0x46')]['hasOwnProperty']('nolimit')){_0x55dfad[_0xf7c0('0x30')]=qs[_0xf7c0('0x30')](_0x222f3c['query'][_0xf7c0('0x30')]);_0x55dfad[_0xf7c0('0x2e')]=qs['offset'](_0x222f3c[_0xf7c0('0x46')]['offset']);}_0x55dfad[_0xf7c0('0x50')]=qs[_0xf7c0('0x51')](_0x222f3c[_0xf7c0('0x46')][_0xf7c0('0x51')]);_0x55dfad[_0xf7c0('0x52')]=qs[_0xf7c0('0x48')](_[_0xf7c0('0x53')](_0x222f3c['query'],_0x1f9b1b[_0xf7c0('0x48')]));_0x55dfad[_0xf7c0('0x52')][_0xf7c0('0x6a')]=_0x32919c['id'];if(_0x222f3c['query'][_0xf7c0('0x56')]){_0x55dfad[_0xf7c0('0x52')]=_['merge'](_0x55dfad[_0xf7c0('0x52')],{'$or':_[_0xf7c0('0x41')](_0x55dfad['attributes'],function(_0x442a04){var _0x2ef726={};_0x2ef726[_0x442a04]={'$like':'%'+_0x222f3c[_0xf7c0('0x46')]['filter']+'%'};return _0x2ef726;})});}_0x55dfad=_[_0xf7c0('0x54')]({},_0x55dfad,_0x222f3c[_0xf7c0('0x5c')]);return db[_0xf7c0('0x6e')]['count']({'where':_0x55dfad['where']})[_0xf7c0('0x36')](function(_0x1d6efb){_0x4a65a1[_0xf7c0('0x31')]=_0x1d6efb;if(_0x222f3c[_0xf7c0('0x46')]['includeAll']){_0x55dfad[_0xf7c0('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf7c0('0x6f')](_0x55dfad);})[_0xf7c0('0x36')](function(_0x5e905f){_0x4a65a1[_0xf7c0('0x59')]=_0x5e905f;return _0x4a65a1;});}})[_0xf7c0('0x36')](respondWithFilteredResult(_0x502ae7,_0x55dfad))[_0xf7c0('0x29')](handleError(_0x502ae7,null));};exports[_0xf7c0('0x70')]=function(_0x365133,_0x51b807,_0x4ece12){return db[_0xf7c0('0x42')]['find']({'where':{'id':_0x365133[_0xf7c0('0x5b')]['id']}})[_0xf7c0('0x36')](handleEntityNotFound(_0x51b807,null))['then'](function(_0x549132){if(_0x549132){return _0x549132['removeAnswers'](_0x365133[_0xf7c0('0x46')][_0xf7c0('0x6c')]);}})['then'](respondWithStatusCode(_0x51b807,null))[_0xf7c0('0x29')](handleError(_0x51b807,null));};exports['notify']=function(_0x5da1cd,_0x471d03,_0x4cdc4d){var _0x1c0e33={'body':_0x5da1cd[_0xf7c0('0x5f')],'channel':'openchannel'};var _0x212ef5=[];var _0x316e7d=[];var _0x6600be={};var _0x6c0080=![];return db[_0xf7c0('0x71')]['describe']()['then'](function(_0x2586d9){if(!_0x2586d9){throw new db[(_0xf7c0('0x72'))][(_0xf7c0('0x73'))](_0xf7c0('0x74'));}_0x212ef5=_[_0xf7c0('0x75')](_[_0xf7c0('0x47')](_0x2586d9),[_0xf7c0('0x76'),_0xf7c0('0x77')]);_0x316e7d=_['difference'](_[_0xf7c0('0x47')](_0x2586d9),[_0xf7c0('0x76'),_0xf7c0('0x77'),_0xf7c0('0x78'),'ListId']);if(_0x5da1cd['body']['id']){delete _0x5da1cd[_0xf7c0('0x5f')]['id'];}if(_[_0xf7c0('0x79')](_0x5da1cd[_0xf7c0('0x5f')]['from'])){throw new db['Sequelize']['ValidationError'](_0xf7c0('0x7a'));}if(_[_0xf7c0('0x79')](_0x5da1cd[_0xf7c0('0x5f')]['body'])||_0x5da1cd[_0xf7c0('0x5f')][_0xf7c0('0x5f')]===''){throw new db[(_0xf7c0('0x72'))][(_0xf7c0('0x73'))](_0xf7c0('0x7b'));}if(_[_0xf7c0('0x79')](_0x5da1cd[_0xf7c0('0x5f')][_0xf7c0('0x7c')])){throw new db[(_0xf7c0('0x72'))][(_0xf7c0('0x73'))](_0xf7c0('0x7d')+_0x316e7d);}if(!_[_0xf7c0('0x7e')](_0x316e7d,_0x5da1cd[_0xf7c0('0x5f')]['mapKey'])){throw new db[(_0xf7c0('0x72'))][(_0xf7c0('0x73'))](_0xf7c0('0x7f')+_0x316e7d);}_0x6600be[_0x5da1cd[_0xf7c0('0x5f')][_0xf7c0('0x7c')]]=_0x5da1cd['body'][_0xf7c0('0x80')];})[_0xf7c0('0x36')](function(){return db[_0xf7c0('0x42')][_0xf7c0('0x5d')]({'where':{'id':_0x5da1cd[_0xf7c0('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0xf7c0('0x81'),'include':[{'model':db[_0xf7c0('0x71')],'as':_0xf7c0('0x82'),'where':_0x6600be,'limit':0x1,'order':[['updatedAt',_0xf7c0('0x83')]]}]},{'model':db[_0xf7c0('0x84')],'as':_0xf7c0('0x85')}]});})[_0xf7c0('0x36')](handleEntityNotFound(_0x471d03,null))[_0xf7c0('0x36')](function(_0x1f465e){if(_0x1f465e&&_0x1f465e[_0xf7c0('0x81')]){_0x1c0e33[_0xf7c0('0x86')]=_0x1f465e;_0x1c0e33[_0xf7c0('0x87')]=_0x1f465e[_0xf7c0('0x85')];_0x1c0e33['list']=_0x1f465e['List'];_0x1c0e33[_0xf7c0('0x87')]=_[_0xf7c0('0x88')](_0x1c0e33['applications'],[_0xf7c0('0x89')],[_0xf7c0('0x8a')]);if(_0x1c0e33[_0xf7c0('0x86')][_0xf7c0('0x85')]){delete _0x1c0e33[_0xf7c0('0x86')][_0xf7c0('0x85')];}if(_0x1c0e33[_0xf7c0('0x86')]['List']&&_0x1c0e33[_0xf7c0('0x86')][_0xf7c0('0x81')][_0xf7c0('0x82')][_0xf7c0('0x4d')]){return _0x1c0e33['account'][_0xf7c0('0x81')][_0xf7c0('0x82')][0x0];}var _0x558caf=_['defaults'](_0x5da1cd[_0xf7c0('0x5f')],{'firstName':_0x5da1cd[_0xf7c0('0x5f')][_0xf7c0('0x80')],'ListId':_0x1f465e[_0xf7c0('0x8b')]});_0x558caf[_0x5da1cd['body']['mapKey']]=_0x5da1cd[_0xf7c0('0x5f')]['from'];return db[_0xf7c0('0x71')][_0xf7c0('0x5e')](_0x558caf,{'fields':_0x212ef5,'raw':!![]});}})[_0xf7c0('0x36')](handleEntityNotFound(_0x471d03,null))[_0xf7c0('0x36')](function(_0x39a708){_0x1c0e33['contact']=_0x39a708;if(_0x39a708){var _0x29a207={'ContactId':_0x39a708['id'],'OpenchannelAccountId':_0x5da1cd['params']['id'],'from':(_0x39a708[_0xf7c0('0x8c')]||'')+'\x20'+(_0x39a708['lastName']||'')};var _0x344786={'OpenchannelAccountId':_0x5da1cd['params']['id'],'closed':![]};if(_0x5da1cd[_0xf7c0('0x5f')]['threadId']){_0x344786[_0xf7c0('0x8d')]=_0x5da1cd[_0xf7c0('0x5f')][_0xf7c0('0x8d')];return db['OpenchannelInteraction']['find']({'where':_0x344786})[_0xf7c0('0x36')](function(_0x3ee0d5){if(_0x3ee0d5){return[_0x3ee0d5,![]];}_0x29a207[_0xf7c0('0x8d')]=_0x5da1cd[_0xf7c0('0x5f')]['threadId'];_0x29a207[_0xf7c0('0x8e')]=_0x5da1cd[_0xf7c0('0x5f')][_0xf7c0('0x8e')];return db['OpenchannelInteraction'][_0xf7c0('0x5e')](_0x29a207)[_0xf7c0('0x36')](function(_0x4977a2){return[_0x4977a2,!![]];});});}else{_0x344786[_0xf7c0('0x8d')]=null;}_0x344786[_0xf7c0('0x8f')]=_0x39a708['id'];return db['OpenchannelInteraction']['find']({'where':_0x344786})[_0xf7c0('0x36')](function(_0xb657b9){if(_0xb657b9){return[_0xb657b9,![]];}return db[_0xf7c0('0x90')][_0xf7c0('0x5e')](_0x29a207)[_0xf7c0('0x36')](function(_0x16d596){return[_0x16d596,!![]];});});}})[_0xf7c0('0x91')](function(_0x4d0769,_0x281401){if(_0x4d0769){_0x6c0080=_0x281401;if(!_0x281401){var _0x4d0287={'from':(_0x1c0e33[_0xf7c0('0x92')]['firstName']||'')+'\x20'+(_0x1c0e33[_0xf7c0('0x92')][_0xf7c0('0x93')]||'')};if(_0x5da1cd['body'][_0xf7c0('0x8d')]&&_0x5da1cd[_0xf7c0('0x5f')]['messageId']&&_0x5da1cd['body'][_0xf7c0('0x8d')]!=_0x5da1cd[_0xf7c0('0x5f')][_0xf7c0('0x94')]){_0x4d0287[_0xf7c0('0x8d')]=_0x5da1cd['body'][_0xf7c0('0x94')];}return _0x4d0769[_0xf7c0('0x65')](_0x4d0287);}else{return _0x4d0769;}}})[_0xf7c0('0x36')](function(_0xb78048){_0x1c0e33[_0xf7c0('0x95')]=_0xb78048['get']({'plain':!![]});_0x1c0e33[_0xf7c0('0x95')][_0xf7c0('0x96')]=_0x6c0080;if(_0x1c0e33['interaction'][_0xf7c0('0x96')]){if(_0x1c0e33[_0xf7c0('0x86')][_0xf7c0('0x97')]){_0x1c0e33[_0xf7c0('0x87')]['push']({'id':0x0,'priority':_0x1c0e33['applications'][_0xf7c0('0x4d')]+0x1,'app':_0xf7c0('0x98'),'appdata':'unmanaged','interval':_0xf7c0('0x99')});}}return db['OpenchannelMessage'][_0xf7c0('0x5e')]({'body':_0x5da1cd['body'][_0xf7c0('0x5f')],'OpenchannelAccountId':_0x5da1cd['params']['id'],'OpenchannelInteractionId':_0xb78048['id'],'direction':'in','ContactId':_0x1c0e33[_0xf7c0('0x92')]['id'],'AttachmentId':_0x5da1cd[_0xf7c0('0x5f')][_0xf7c0('0x9a')]});})[_0xf7c0('0x36')](function(_0x2e226a){_0x1c0e33[_0xf7c0('0x28')]=_0x2e226a;if(_0x1c0e33[_0xf7c0('0x95')][_0xf7c0('0x9b')]){return db[_0xf7c0('0x9c')][_0xf7c0('0x5d')]({'attributes':['id','name'],'where':{'id':_0x1c0e33['interaction'][_0xf7c0('0x9b')]}})[_0xf7c0('0x36')](function(_0x18bc78){if(_0x18bc78){_0x1c0e33[_0xf7c0('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x18bc78['name']+','+(_0x1c0e33[_0xf7c0('0x86')]['waitForTheAssignedAgent']||0xa),'interval':_0xf7c0('0x99')});_0x1c0e33[_0xf7c0('0x9d')]=![];}return respondWithRpcPromise(_0xf7c0('0x9e'),'startRouting',_0x1c0e33);});}return respondWithRpcPromise('Start',_0xf7c0('0x9f'),_0x1c0e33);})[_0xf7c0('0x36')](function(_0x28323a){respondWithRpcPromise('EventManager','EventManager',{'event':'notify','message':_0x28323a},client9002);return _0x28323a;})[_0xf7c0('0x36')](respondWithResult(_0x471d03,null))[_0xf7c0('0x29')](handleError(_0x471d03,null));};exports[_0xf7c0('0xa0')]=function(_0x45a1f1,_0x4e79a8){var _0x381d29=_0x45a1f1[_0xf7c0('0x5b')]['id'];var _0x5a5c9d=_0x45a1f1[_0xf7c0('0x5f')];var _0x4031fa=0xc8;var _0x14af4b=null;return db[_0xf7c0('0xa1')][_0xf7c0('0xa2')]({'isolationLevel':db['sequelize'][_0xf7c0('0xa3')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x186abb){return db[_0xf7c0('0x42')][_0xf7c0('0x69')]({'where':{'id':_0x381d29},'transaction':_0x186abb})['then'](function(_0x1a6aac){if(_0x1a6aac){return db[_0xf7c0('0x84')][_0xf7c0('0x37')]({'where':{'OpenchannelAccountId':_0x381d29},'transaction':_0x186abb})[_0xf7c0('0x36')](function(){var _0xec0758=_[_0xf7c0('0x41')](_0x5a5c9d,function(_0x2543c3){_0x2543c3['OpenchannelAccountId']=_0x381d29;return _0x2543c3;});return db[_0xf7c0('0x84')]['bulkCreate'](_0xec0758,{'transaction':_0x186abb});});}else{_0x4031fa=0x194;_0x14af4b=[];}});})[_0xf7c0('0x36')](function(){if(_0x4031fa!==0x194){return db['OpenchannelApplication'][_0xf7c0('0xa4')]({'where':{'OpenchannelAccountId':_0x381d29},'order':_0xf7c0('0x89')})[_0xf7c0('0x36')](function(_0x5d93f8){_0x14af4b=_0x5d93f8;});}})[_0xf7c0('0x29')](function(_0x16cb39){_0x4031fa=0x1f4;logger[_0xf7c0('0x26')](_0x16cb39['stack']);if(_0x16cb39[_0xf7c0('0x3c')]){delete _0x16cb39[_0xf7c0('0x3c')];}_0x14af4b=_0x16cb39;})[_0xf7c0('0xa5')](function(){if(_0x14af4b===null){_0x4e79a8['sendStatus'](_0x4031fa);}else{if(_0x4031fa===0x1f4){_0x4e79a8['status'](_0x4031fa)[_0xf7c0('0x3d')](_0x14af4b);}else{_0x4e79a8[_0xf7c0('0x2c')](_0x4031fa)[_0xf7c0('0x2d')](_0x14af4b);}}});};exports['getApplications']=function(_0x2b7ad3,_0x5ee323,_0x45d0a0){var _0x10e9fb={};var _0x2c8e3d={};var _0x52fae0;var _0x4817a0;return db['OpenchannelAccount'][_0xf7c0('0x69')]({'where':{'id':_0x2b7ad3[_0xf7c0('0x5b')]['id']}})[_0xf7c0('0x36')](handleEntityNotFound(_0x5ee323,null))[_0xf7c0('0x36')](function(_0x7efbd9){if(_0x7efbd9){_0x52fae0=_0x7efbd9;_0x2c8e3d[_0xf7c0('0x4a')]=_[_0xf7c0('0x47')](db[_0xf7c0('0x84')][_0xf7c0('0x43')]);_0x2c8e3d[_0xf7c0('0x46')]=_[_0xf7c0('0x47')](_0x2b7ad3[_0xf7c0('0x46')]);_0x2c8e3d['filters']=_['intersection'](_0x2c8e3d['model'],_0x2c8e3d[_0xf7c0('0x46')]);_0x10e9fb[_0xf7c0('0x4c')]=_[_0xf7c0('0x49')](_0x2c8e3d[_0xf7c0('0x4a')],qs[_0xf7c0('0x4b')](_0x2b7ad3['query']['fields']));_0x10e9fb[_0xf7c0('0x4c')]=_0x10e9fb['attributes'][_0xf7c0('0x4d')]?_0x10e9fb[_0xf7c0('0x4c')]:_0x2c8e3d[_0xf7c0('0x4a')];_0x10e9fb[_0xf7c0('0x50')]=qs['sort'](_0x2b7ad3[_0xf7c0('0x46')][_0xf7c0('0x51')]);_0x10e9fb['where']=qs[_0xf7c0('0x48')](_['pick'](_0x2b7ad3[_0xf7c0('0x46')],_0x2c8e3d[_0xf7c0('0x48')]));if(_0x2b7ad3[_0xf7c0('0x46')][_0xf7c0('0x56')]){_0x10e9fb[_0xf7c0('0x52')]=_['merge'](_0x10e9fb['where'],{'$or':_[_0xf7c0('0x41')](_0x10e9fb[_0xf7c0('0x4c')],function(_0xa03036){var _0x1b94a3={};_0x1b94a3[_0xa03036]={'$like':'%'+_0x2b7ad3[_0xf7c0('0x46')]['filter']+'%'};return _0x1b94a3;})});}_0x10e9fb=_[_0xf7c0('0x54')]({},_0x10e9fb,_0x2b7ad3[_0xf7c0('0x5c')]);return _0x52fae0['getApplications'](_0x10e9fb);}})[_0xf7c0('0x36')](function(_0x2d3ceb){if(_0x2d3ceb){_0x4817a0=_0x2d3ceb['length'];if(!_0x2b7ad3[_0xf7c0('0x46')][_0xf7c0('0x4e')]('nolimit')){_0x10e9fb[_0xf7c0('0x30')]=qs[_0xf7c0('0x30')](_0x2b7ad3[_0xf7c0('0x46')][_0xf7c0('0x30')]);_0x10e9fb[_0xf7c0('0x2e')]=qs[_0xf7c0('0x2e')](_0x2b7ad3[_0xf7c0('0x46')][_0xf7c0('0x2e')]);}return _0x52fae0[_0xf7c0('0xa6')](_0x10e9fb);}})['then'](function(_0x159883){if(_0x159883){return _0x159883?{'count':_0x4817a0,'rows':_0x159883}:null;}})[_0xf7c0('0x36')](respondWithResult(_0x5ee323,null))[_0xf7c0('0x29')](handleError(_0x5ee323,null));};exports['getInteractions']=function(_0x5849f3,_0x454630,_0x1adea9){var _0x41d5a1={'raw':![],'where':{}};var _0x6db79f={};var _0x1a4ffc={'count':0x0,'rows':[]};return db[_0xf7c0('0x42')][_0xf7c0('0x69')]({'where':{'id':_0x5849f3[_0xf7c0('0x5b')]['id']}})['then'](handleEntityNotFound(_0x454630,null))[_0xf7c0('0x36')](function(_0x5b4216){if(_0x5b4216){_0x6db79f[_0xf7c0('0x4a')]=_[_0xf7c0('0x47')](db[_0xf7c0('0x90')]['rawAttributes']);_0x6db79f[_0xf7c0('0x46')]=_[_0xf7c0('0x47')](_0x5849f3['query']);_0x6db79f[_0xf7c0('0x48')]=_[_0xf7c0('0x49')](_0x6db79f[_0xf7c0('0x4a')],_0x6db79f[_0xf7c0('0x46')]);_0x41d5a1[_0xf7c0('0x4c')]=_[_0xf7c0('0x49')](_0x6db79f[_0xf7c0('0x4a')],qs[_0xf7c0('0x4b')](_0x5849f3[_0xf7c0('0x46')][_0xf7c0('0x4b')]));_0x41d5a1[_0xf7c0('0x4c')]=_0x41d5a1[_0xf7c0('0x4c')][_0xf7c0('0x4d')]?_0x41d5a1[_0xf7c0('0x4c')]:_0x6db79f['model'];if(!_0x5849f3[_0xf7c0('0x46')]['hasOwnProperty'](_0xf7c0('0x4f'))){_0x41d5a1['limit']=qs[_0xf7c0('0x30')](_0x5849f3[_0xf7c0('0x46')][_0xf7c0('0x30')]);_0x41d5a1[_0xf7c0('0x2e')]=qs[_0xf7c0('0x2e')](_0x5849f3[_0xf7c0('0x46')]['offset']);}_0x41d5a1['order']=qs[_0xf7c0('0x51')](_0x5849f3[_0xf7c0('0x46')][_0xf7c0('0x51')]);_0x41d5a1[_0xf7c0('0x52')]=qs[_0xf7c0('0x48')](_[_0xf7c0('0x53')](_0x5849f3[_0xf7c0('0x46')],_0x6db79f[_0xf7c0('0x48')]));_0x41d5a1['where'][_0xf7c0('0x6a')]=_0x5b4216['id'];if(_0x5849f3[_0xf7c0('0x46')]['filter']){_0x41d5a1[_0xf7c0('0x52')]=_[_0xf7c0('0x54')](_0x41d5a1[_0xf7c0('0x52')],{'$or':_[_0xf7c0('0x41')](_0x41d5a1[_0xf7c0('0x4c')],function(_0x3c3534){var _0x271caa={};_0x271caa[_0x3c3534]={'$like':'%'+_0x5849f3[_0xf7c0('0x46')][_0xf7c0('0x56')]+'%'};return _0x271caa;})});}_0x41d5a1=_['merge']({},_0x41d5a1,_0x5849f3['options']);return db[_0xf7c0('0x90')][_0xf7c0('0x31')]({'where':_0x41d5a1[_0xf7c0('0x52')]})[_0xf7c0('0x36')](function(_0x328b5b){_0x1a4ffc[_0xf7c0('0x31')]=_0x328b5b;if(_0x5849f3[_0xf7c0('0x46')][_0xf7c0('0x57')]){_0x41d5a1[_0xf7c0('0x58')]=[{'model':db[_0xf7c0('0x71')],'as':_0xf7c0('0xa7'),'required':![]},{'model':db[_0xf7c0('0x9c')],'as':_0xf7c0('0xa8'),'attributes':['name','fullname',_0xf7c0('0xa9')],'required':![]},{'model':db[_0xf7c0('0xaa')],'as':'Tags','attributes':['id',_0xf7c0('0x3c'),_0xf7c0('0xab')],'where':_0x5849f3['query'][_0xf7c0('0xac')]?{'id':_0x5849f3[_0xf7c0('0x46')][_0xf7c0('0xac')]}:undefined,'required':_0x5849f3[_0xf7c0('0x46')][_0xf7c0('0xac')]?!![]:![]}];}return db[_0xf7c0('0x90')][_0xf7c0('0x6f')](_0x41d5a1);})[_0xf7c0('0x36')](function(_0x99ad2a){_0x1a4ffc[_0xf7c0('0x59')]=_0x99ad2a;return _0x1a4ffc;});}})['then'](respondWithFilteredResult(_0x454630,_0x41d5a1))[_0xf7c0('0x29')](handleError(_0x454630,null));};exports['addAgents']=function(_0x2f5862,_0x468353,_0x5f7803){return db[_0xf7c0('0x42')][_0xf7c0('0x5d')]({'where':{'id':_0x2f5862['params']['id']}})['then'](handleEntityNotFound(_0x468353,null))[_0xf7c0('0x36')](function(_0x7b367a){if(_0x7b367a){return _0x7b367a[_0xf7c0('0xad')](_0x2f5862['body'][_0xf7c0('0x6c')],_[_0xf7c0('0xae')](_0x2f5862[_0xf7c0('0x5f')],[_0xf7c0('0x6c'),'id'])||{})[_0xf7c0('0x91')](function(_0x32a22a){for(var _0x350c45=0x0;_0x350c45<_0x2f5862['body']['ids'][_0xf7c0('0x4d')];_0x350c45+=0x1){socket[_0xf7c0('0xaf')]('userOpenchannelAccount:save',{'UserId':Number(_0x2f5862[_0xf7c0('0x5f')][_0xf7c0('0x6c')][_0x350c45]),'OpenchannelAccountId':Number(_0x2f5862[_0xf7c0('0x5b')]['id'])});}return _0x32a22a;});}})[_0xf7c0('0x36')](respondWithResult(_0x468353,null))[_0xf7c0('0x29')](handleError(_0x468353,null));};exports[_0xf7c0('0xb0')]=function(_0x2b2e80,_0x361d1b,_0x2d06a9){return db[_0xf7c0('0x42')][_0xf7c0('0x5d')]({'where':{'id':_0x2b2e80[_0xf7c0('0x5b')]['id']}})[_0xf7c0('0x36')](handleEntityNotFound(_0x361d1b,null))[_0xf7c0('0x36')](function(_0x38fea5){if(_0x38fea5){return _0x38fea5[_0xf7c0('0xb0')](_0x2b2e80[_0xf7c0('0x46')][_0xf7c0('0x6c')])['then'](function(){if(_['isArray'](_0x2b2e80['query'][_0xf7c0('0x6c')])){for(var _0x4fbe1b=0x0;_0x4fbe1b<_0x2b2e80['query']['ids'][_0xf7c0('0x4d')];_0x4fbe1b+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x2b2e80[_0xf7c0('0x46')][_0xf7c0('0x6c')][_0x4fbe1b]),'OpenchannelAccountId':Number(_0x2b2e80[_0xf7c0('0x5b')]['id'])});}}else{socket[_0xf7c0('0xaf')](_0xf7c0('0xb1'),{'UserId':Number(_0x2b2e80['query'][_0xf7c0('0x6c')]),'OpenchannelAccountId':Number(_0x2b2e80[_0xf7c0('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x361d1b,null))[_0xf7c0('0x29')](handleError(_0x361d1b,null));};exports[_0xf7c0('0xb2')]=function(_0x36f9ee,_0x5b2255,_0x46bcfe){var _0x351e88={};var _0x2dd778={};var _0x340f32;var _0x2707f2;return db[_0xf7c0('0x42')][_0xf7c0('0x69')]({'where':{'id':_0x36f9ee[_0xf7c0('0x5b')]['id']}})[_0xf7c0('0x36')](handleEntityNotFound(_0x5b2255,null))[_0xf7c0('0x36')](function(_0x59f2b6){if(_0x59f2b6){_0x340f32=_0x59f2b6;_0x2dd778[_0xf7c0('0x4a')]=_[_0xf7c0('0x47')](db[_0xf7c0('0x9c')]['rawAttributes']);_0x2dd778[_0xf7c0('0x46')]=_['keys'](_0x36f9ee[_0xf7c0('0x46')]);_0x2dd778[_0xf7c0('0x48')]=_[_0xf7c0('0x49')](_0x2dd778[_0xf7c0('0x4a')],_0x2dd778[_0xf7c0('0x46')]);_0x351e88[_0xf7c0('0x4c')]=_[_0xf7c0('0x49')](_0x2dd778[_0xf7c0('0x4a')],qs[_0xf7c0('0x4b')](_0x36f9ee[_0xf7c0('0x46')][_0xf7c0('0x4b')]));_0x351e88[_0xf7c0('0x4c')]=_0x351e88['attributes'][_0xf7c0('0x4d')]?_0x351e88['attributes']:_0x2dd778[_0xf7c0('0x4a')];_0x351e88[_0xf7c0('0x50')]=qs[_0xf7c0('0x51')](_0x36f9ee[_0xf7c0('0x46')][_0xf7c0('0x51')]);_0x351e88[_0xf7c0('0x52')]=qs['filters'](_[_0xf7c0('0x53')](_0x36f9ee[_0xf7c0('0x46')],_0x2dd778[_0xf7c0('0x48')]));if(_0x36f9ee[_0xf7c0('0x46')][_0xf7c0('0x56')]){_0x351e88['where']=_[_0xf7c0('0x54')](_0x351e88[_0xf7c0('0x52')],{'$or':_[_0xf7c0('0x41')](_0x351e88[_0xf7c0('0x4c')],function(_0x5962d4){var _0x454dc0={};_0x454dc0[_0x5962d4]={'$like':'%'+_0x36f9ee['query'][_0xf7c0('0x56')]+'%'};return _0x454dc0;})});}_0x351e88=_[_0xf7c0('0x54')]({},_0x351e88,_0x36f9ee['options']);return _0x340f32[_0xf7c0('0xb2')](_0x351e88);}})[_0xf7c0('0x36')](function(_0x549067){if(_0x549067){_0x2707f2=_0x549067[_0xf7c0('0x4d')];if(!_0x36f9ee[_0xf7c0('0x46')][_0xf7c0('0x4e')]('nolimit')){_0x351e88[_0xf7c0('0x30')]=qs[_0xf7c0('0x30')](_0x36f9ee[_0xf7c0('0x46')][_0xf7c0('0x30')]);_0x351e88[_0xf7c0('0x2e')]=qs[_0xf7c0('0x2e')](_0x36f9ee[_0xf7c0('0x46')]['offset']);}return _0x340f32[_0xf7c0('0xb2')](_0x351e88);}})[_0xf7c0('0x36')](function(_0x421ca1){if(_0x421ca1){return _0x421ca1?{'count':_0x2707f2,'rows':_0x421ca1}:null;}})[_0xf7c0('0x36')](respondWithResult(_0x5b2255,null))[_0xf7c0('0x29')](handleError(_0x5b2255,null));};exports['send']=function(_0x489b10,_0x10a6b1,_0x19071f){var _0x359a00,_0x21fc46,_0x422116;if(_['isNil'](_0x489b10[_0xf7c0('0x5f')]['body'])||_0x489b10[_0xf7c0('0x5f')][_0xf7c0('0x5f')]===''){throw new db[(_0xf7c0('0x72'))][(_0xf7c0('0x73'))](_0xf7c0('0x7b'));}if(_[_0xf7c0('0x79')](_0x489b10[_0xf7c0('0x5f')]['to'])){}_0x359a00=_0x489b10[_0xf7c0('0x5f')]['to'];return db[_0xf7c0('0x42')][_0xf7c0('0x69')]({'where':{'id':_0x489b10[_0xf7c0('0x5b')]['id']}})[_0xf7c0('0x36')](handleEntityNotFound(_0x10a6b1,null))['then'](function(_0x2b5d7d){if(_0x2b5d7d){return db[_0xf7c0('0x42')][_0xf7c0('0x5d')]({'where':{'id':_0x2b5d7d['id']},'include':[{'model':db[_0xf7c0('0xb3')],'as':_0xf7c0('0x81'),'include':[{'model':db[_0xf7c0('0x71')],'as':_0xf7c0('0x82'),'where':{[_0x2b5d7d[_0xf7c0('0x7c')]]:_0x359a00},'limit':0x1,'order':[[_0xf7c0('0x77'),'DESC']]}]}]})[_0xf7c0('0x36')](handleEntityNotFound(_0x10a6b1,null))[_0xf7c0('0x36')](function(_0x18249d){if(_0x18249d&&_0x18249d['List']){_0x21fc46=_0x18249d[_0xf7c0('0x38')]({'plain':!![]});if(_0x21fc46[_0xf7c0('0x81')]&&_0x21fc46[_0xf7c0('0x81')]['Contacts'][_0xf7c0('0x4d')]){return _0x21fc46['List']['Contacts'][0x0];}return db[_0xf7c0('0x71')][_0xf7c0('0x5e')](_[_0xf7c0('0xb4')](_0x489b10[_0xf7c0('0x5f')],{'firstName':_0x359a00,[_0x18249d[_0xf7c0('0x7c')]]:_0x359a00,'phone':_0x359a00,'ListId':_0x21fc46[_0xf7c0('0x8b')]}));}})['then'](handleEntityNotFound(_0x10a6b1,null))[_0xf7c0('0x36')](function(_0x520344){if(_0x520344){_0x422116=_0x520344;return db[_0xf7c0('0x90')][_0xf7c0('0x5d')]({'where':{'ContactId':_0x422116['id'],'closed':![],'OpenchannelAccountId':_0x21fc46['id']}})[_0xf7c0('0x36')](function(_0x419f5b){if(_0x419f5b){return[_0x419f5b,![]];}return db[_0xf7c0('0x90')][_0xf7c0('0x5e')]({'UserId':_0x489b10['user']['id'],'ContactId':_0x422116['id'],'OpenchannelAccountId':_0x21fc46['id'],'lastMsgDirection':'out','Messages':[_[_0xf7c0('0x54')](_0x489b10[_0xf7c0('0x5f')],{'read':![],'body':_0x489b10[_0xf7c0('0x5f')][_0xf7c0('0x5f')],'OpenchannelAccountId':_0x21fc46['id'],'UserId':_0x489b10[_0xf7c0('0xb5')]['id'],'ContactId':_0x422116['id']})]},{'include':[{'model':db[_0xf7c0('0xb6')],'as':'Messages'}]})[_0xf7c0('0x36')](function(_0x690066){return[_0x690066,!![]];});});}})[_0xf7c0('0x91')](function(_0x1d956f,_0x35bc5b){if(_0x35bc5b){return _0x1d956f;}return db[_0xf7c0('0xb6')]['create'](_[_0xf7c0('0x54')](_0x489b10[_0xf7c0('0x5f')],{'read':![],'body':_0x489b10[_0xf7c0('0x5f')][_0xf7c0('0x5f')],'OpenchannelAccountId':_0x21fc46['id'],'OpenchannelInteractionId':_0x1d956f['id'],'UserId':_0x489b10[_0xf7c0('0xb5')]['id'],'ContactId':_0x422116['id']}))[_0xf7c0('0x36')](function(_0xe7eeba){_0x1d956f['dataValues']['Messages']=[];_0x1d956f[_0xf7c0('0xb7')][_0xf7c0('0xb8')][_0xf7c0('0xb9')](_0xe7eeba[_0xf7c0('0xb7')]);return _0x1d956f;});});}})[_0xf7c0('0x36')](respondWithResult(_0x10a6b1,null))[_0xf7c0('0x29')](handleError(_0x10a6b1,null));}; \ No newline at end of file +var _0x83d5=['jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','filters','attributes','intersection','fields','query','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','OpenchannelAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','asc','CmContact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','contact','messageId','interaction','created','push','close','unmanaged','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','dataValues','Messages','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','crypto'];(function(_0x58ae8a,_0x3c619e){var _0x2f0b6b=function(_0x6db940){while(--_0x6db940){_0x58ae8a['push'](_0x58ae8a['shift']());}};_0x2f0b6b(++_0x3c619e);}(_0x83d5,0x171));var _0x583d=function(_0x475741,_0x30bf38){_0x475741=_0x475741-0x0;var _0x4e34ec=_0x83d5[_0x475741];return _0x4e34ec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x583d('0x0'));var zipdir=require(_0x583d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x583d('0x2'));var moment=require(_0x583d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x583d('0x4'));var util=require(_0x583d('0x5'));var path=require(_0x583d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x583d('0x7'));var fs=require('fs');var fs_extra=require(_0x583d('0x8'));var _=require(_0x583d('0x9'));var squel=require('squel');var crypto=require(_0x583d('0xa'));var jsforce=require(_0x583d('0xb'));var deskjs=require(_0x583d('0xc'));var toCsv=require(_0x583d('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x583d('0xe'));var qs=require(_0x583d('0xf'));var as=require(_0x583d('0x10'));var hardwareService=require(_0x583d('0x11'));var logger=require(_0x583d('0x12'))(_0x583d('0x13'));var utils=require('../../config/utils');var config=require(_0x583d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x583d('0x15'))['db'];config[_0x583d('0x16')]=_['defaults'](config[_0x583d('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x583d('0x16')]));require(_0x583d('0x17'))[_0x583d('0x18')](socket);var jayson=require(_0x583d('0x19'));var client=jayson[_0x583d('0x1a')][_0x583d('0x1b')]({'port':0x232c});var client9002=jayson[_0x583d('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2369cf,_0x43eed9,_0x3bb77c,_0x552ca8){return new BPromise(function(_0x131193,_0x6ad539){var _0x28d3fc=_0x552ca8||client;return _0x28d3fc[_0x583d('0x1c')](_0x2369cf,_0x3bb77c)[_0x583d('0x1d')](function(_0x366291){logger['info'](_0x583d('0x1e'),_0x43eed9,_0x583d('0x1f'));logger[_0x583d('0x20')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x43eed9,_0x583d('0x1f'),JSON[_0x583d('0x21')](_0x366291));if(_0x366291[_0x583d('0x22')]){if(_0x366291['error']['code']===0x1f4){logger[_0x583d('0x22')](_0x583d('0x1e'),_0x43eed9,_0x366291[_0x583d('0x22')][_0x583d('0x23')]);return _0x6ad539(_0x366291[_0x583d('0x22')]['message']);}logger[_0x583d('0x22')](_0x583d('0x1e'),_0x43eed9,_0x366291[_0x583d('0x22')][_0x583d('0x23')]);return _0x131193(_0x366291[_0x583d('0x22')][_0x583d('0x23')]);}else{logger[_0x583d('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x43eed9,_0x583d('0x1f'));_0x131193(_0x366291[_0x583d('0x25')][_0x583d('0x23')]);}})[_0x583d('0x26')](function(_0x144bfd){logger[_0x583d('0x22')](_0x583d('0x1e'),_0x43eed9,_0x144bfd);_0x6ad539(_0x144bfd);});});}function respondWithStatusCode(_0x45e70f,_0x24220d){_0x24220d=_0x24220d||0xcc;return function(_0x4b8fe5){if(_0x4b8fe5){return _0x45e70f[_0x583d('0x27')](_0x24220d);}return _0x45e70f['status'](_0x24220d)['end']();};}function respondWithResult(_0x428f08,_0x837940){_0x837940=_0x837940||0xc8;return function(_0x522364){if(_0x522364){return _0x428f08['status'](_0x837940)[_0x583d('0x28')](_0x522364);}};}function respondWithFilteredResult(_0x2a1174,_0x3b7c5c){return function(_0x4df6df){if(_0x4df6df){var _0x40d174=typeof _0x3b7c5c[_0x583d('0x29')]===_0x583d('0x2a')&&typeof _0x3b7c5c[_0x583d('0x2b')]===_0x583d('0x2a');var _0x2e6716=_0x4df6df[_0x583d('0x2c')];var _0x2f12a6=_0x40d174?0x0:_0x3b7c5c[_0x583d('0x29')];var _0x4a9687=_0x40d174?_0x4df6df[_0x583d('0x2c')]:_0x3b7c5c[_0x583d('0x29')]+_0x3b7c5c[_0x583d('0x2b')];var _0xa5a2fb;if(_0x4a9687>=_0x2e6716){_0x4a9687=_0x2e6716;_0xa5a2fb=0xc8;}else{_0xa5a2fb=0xce;}_0x2a1174[_0x583d('0x2d')](_0xa5a2fb);return _0x2a1174['set'](_0x583d('0x2e'),_0x2f12a6+'-'+_0x4a9687+'/'+_0x2e6716)['json'](_0x4df6df);}return null;};}function patchUpdates(_0x232ce3){return function(_0x316255){try{jsonpatch[_0x583d('0x2f')](_0x316255,_0x232ce3,!![]);}catch(_0x2b9c55){return BPromise[_0x583d('0x30')](_0x2b9c55);}return _0x316255[_0x583d('0x31')]();};}function saveUpdates(_0x1689dc,_0x2028a4){return function(_0x1d0442){if(_0x1d0442){return _0x1d0442[_0x583d('0x32')](_0x1689dc)[_0x583d('0x1d')](function(_0x461011){return _0x461011;});}return null;};}function removeEntity(_0x3703aa,_0x1c37fd){return function(_0x5225c5){if(_0x5225c5){return _0x5225c5[_0x583d('0x33')]()[_0x583d('0x1d')](function(){var _0x30a284=_0x5225c5[_0x583d('0x34')]({'plain':!![]});var _0xc4b0d=_0x583d('0x35');return db[_0x583d('0x36')][_0x583d('0x33')]({'where':{'type':_0xc4b0d,'resourceId':_0x30a284['id']}})['then'](function(){return _0x5225c5;});})[_0x583d('0x1d')](function(){_0x3703aa['status'](0xcc)[_0x583d('0x37')]();});}};}function handleEntityNotFound(_0x220958,_0x164977){return function(_0x57f82a){if(!_0x57f82a){_0x220958[_0x583d('0x27')](0x194);}return _0x57f82a;};}function handleError(_0x146c96,_0x42e786){_0x42e786=_0x42e786||0x1f4;return function(_0x14181c){logger[_0x583d('0x22')](_0x14181c[_0x583d('0x38')]);if(_0x14181c[_0x583d('0x39')]){delete _0x14181c[_0x583d('0x39')];}_0x146c96[_0x583d('0x2d')](_0x42e786)[_0x583d('0x3a')](_0x14181c);};}exports[_0x583d('0x3b')]=function(_0x7d5d76,_0x41d601){var _0x58067b={'include':[{'model':db[_0x583d('0x3c')],'as':_0x583d('0x3d')}]},_0x6f9e9c={},_0x507eb7={'count':0x0,'rows':[]};var _0x25332f=_[_0x583d('0x3e')](db['OpenchannelAccount'][_0x583d('0x3f')],function(_0x42818b){return{'name':_0x42818b[_0x583d('0x40')],'type':_0x42818b[_0x583d('0x41')][_0x583d('0x42')]};});_0x6f9e9c[_0x583d('0x43')]=_[_0x583d('0x3e')](_0x25332f,_0x583d('0x39'));_0x6f9e9c['query']=_[_0x583d('0x44')](_0x7d5d76['query']);_0x6f9e9c[_0x583d('0x45')]=_['intersection'](_0x6f9e9c['model'],_0x6f9e9c['query']);_0x58067b[_0x583d('0x46')]=_[_0x583d('0x47')](_0x6f9e9c[_0x583d('0x43')],qs[_0x583d('0x48')](_0x7d5d76[_0x583d('0x49')][_0x583d('0x48')]));_0x58067b['attributes']=_0x58067b[_0x583d('0x46')][_0x583d('0x4a')]?_0x58067b[_0x583d('0x46')]:_0x6f9e9c['model'];if(!_0x7d5d76[_0x583d('0x49')]['hasOwnProperty'](_0x583d('0x4b'))){_0x58067b[_0x583d('0x2b')]=qs[_0x583d('0x2b')](_0x7d5d76[_0x583d('0x49')][_0x583d('0x2b')]);_0x58067b[_0x583d('0x29')]=qs['offset'](_0x7d5d76[_0x583d('0x49')][_0x583d('0x29')]);}_0x58067b[_0x583d('0x4c')]=qs[_0x583d('0x4d')](_0x7d5d76['query']['sort']);_0x58067b[_0x583d('0x4e')]=qs[_0x583d('0x45')](_[_0x583d('0x4f')](_0x7d5d76[_0x583d('0x49')],_0x6f9e9c[_0x583d('0x45')]),_0x25332f);if(_0x7d5d76[_0x583d('0x49')]['filter']){_0x58067b['where']=_[_0x583d('0x50')](_0x58067b['where'],{'$or':_[_0x583d('0x3e')](_0x25332f,function(_0x5c023a){if(_0x5c023a['type']!==_0x583d('0x51')){var _0x5660be={};_0x5660be[_0x5c023a['name']]={'$like':'%'+_0x7d5d76[_0x583d('0x49')][_0x583d('0x52')]+'%'};return _0x5660be;}})});}_0x58067b=_[_0x583d('0x50')]({},_0x58067b,_0x7d5d76[_0x583d('0x53')]);var _0x989ec2={'where':_0x58067b[_0x583d('0x4e')]};return db[_0x583d('0x54')]['count'](_0x989ec2)[_0x583d('0x1d')](function(_0x10625e){_0x507eb7[_0x583d('0x2c')]=_0x10625e;if(_0x7d5d76['query'][_0x583d('0x55')]){_0x58067b[_0x583d('0x56')]=[{'all':!![]}];}return db[_0x583d('0x54')][_0x583d('0x57')](_0x58067b);})[_0x583d('0x1d')](function(_0x4d0b09){_0x507eb7[_0x583d('0x58')]=_0x4d0b09;return _0x507eb7;})['then'](respondWithFilteredResult(_0x41d601,_0x58067b))[_0x583d('0x26')](handleError(_0x41d601,null));};exports[_0x583d('0x59')]=function(_0x5ccadb,_0x5888a1){var _0x49463f={'raw':![],'where':{'id':_0x5ccadb[_0x583d('0x5a')]['id']},'include':[{'model':db[_0x583d('0x3c')],'as':_0x583d('0x3d')}]},_0x3a4277={};_0x3a4277[_0x583d('0x43')]=_[_0x583d('0x44')](db[_0x583d('0x54')][_0x583d('0x3f')]);_0x3a4277[_0x583d('0x49')]=_[_0x583d('0x44')](_0x5ccadb[_0x583d('0x49')]);_0x3a4277['filters']=_[_0x583d('0x47')](_0x3a4277[_0x583d('0x43')],_0x3a4277[_0x583d('0x49')]);_0x49463f[_0x583d('0x46')]=_[_0x583d('0x47')](_0x3a4277['model'],qs[_0x583d('0x48')](_0x5ccadb[_0x583d('0x49')][_0x583d('0x48')]));_0x49463f['attributes']=_0x49463f['attributes']['length']?_0x49463f['attributes']:_0x3a4277['model'];if(_0x5ccadb[_0x583d('0x49')][_0x583d('0x55')]){_0x49463f[_0x583d('0x56')]=[{'all':!![]}];}_0x49463f=_[_0x583d('0x50')]({},_0x49463f,_0x5ccadb[_0x583d('0x53')]);return db[_0x583d('0x54')][_0x583d('0x5b')](_0x49463f)[_0x583d('0x1d')](handleEntityNotFound(_0x5888a1,null))[_0x583d('0x1d')](respondWithResult(_0x5888a1,null))['catch'](handleError(_0x5888a1,null));};exports[_0x583d('0x5c')]=function(_0x724b7d,_0x4de627){return db['OpenchannelAccount'][_0x583d('0x5c')](_0x724b7d['body'],{})[_0x583d('0x1d')](function(_0x21d60d){var _0x203bf3=_0x724b7d[_0x583d('0x5d')][_0x583d('0x34')]({'plain':!![]});if(!_0x203bf3)throw new Error(_0x583d('0x5e'));if(_0x203bf3[_0x583d('0x5f')]==='user'){var _0x351732=_0x21d60d[_0x583d('0x34')]({'plain':!![]});var _0x4d355b='OpenchannelAccounts';return db[_0x583d('0x60')]['find']({'where':{'name':_0x4d355b,'userProfileId':_0x203bf3[_0x583d('0x61')]},'raw':!![]})[_0x583d('0x1d')](function(_0x246858){if(_0x246858&&_0x246858['autoAssociation']===0x0){return db[_0x583d('0x36')][_0x583d('0x5c')]({'name':_0x351732[_0x583d('0x39')],'resourceId':_0x351732['id'],'type':_0x246858[_0x583d('0x39')],'sectionId':_0x246858['id']},{})[_0x583d('0x1d')](function(){return _0x21d60d;});}else{return _0x21d60d;}})[_0x583d('0x26')](function(_0x7519ca){logger[_0x583d('0x22')](_0x583d('0x62'),_0x7519ca);throw _0x7519ca;});}return _0x21d60d;})[_0x583d('0x1d')](respondWithResult(_0x4de627,0xc9))['catch'](handleError(_0x4de627,null));};exports[_0x583d('0x32')]=function(_0x3a41db,_0x113a01){if(_0x3a41db[_0x583d('0x63')]['id']){delete _0x3a41db[_0x583d('0x63')]['id'];}return db['OpenchannelAccount'][_0x583d('0x5b')]({'where':{'id':_0x3a41db[_0x583d('0x5a')]['id']},'include':[{'model':db[_0x583d('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x583d('0x1d')](handleEntityNotFound(_0x113a01,null))['then'](saveUpdates(_0x3a41db[_0x583d('0x63')],null))['then'](respondWithResult(_0x113a01,null))[_0x583d('0x26')](handleError(_0x113a01,null));};exports[_0x583d('0x33')]=function(_0x32506c,_0x110f5b){return db[_0x583d('0x54')]['find']({'where':{'id':_0x32506c[_0x583d('0x5a')]['id']}})[_0x583d('0x1d')](handleEntityNotFound(_0x110f5b,null))['then'](removeEntity(_0x110f5b,null))[_0x583d('0x26')](handleError(_0x110f5b,null));};exports[_0x583d('0x64')]=function(_0x12ed30,_0x359244){return db['OpenchannelAccount']['describe']()[_0x583d('0x1d')](respondWithResult(_0x359244,null))[_0x583d('0x26')](handleError(_0x359244,null));};exports['addDisposition']=function(_0x157785,_0x509ef6,_0x42766e){if(_0x157785[_0x583d('0x63')]['id']){delete _0x157785[_0x583d('0x63')]['id'];}return db[_0x583d('0x54')][_0x583d('0x5b')]({'where':{'id':_0x157785[_0x583d('0x5a')]['id']}})[_0x583d('0x1d')](handleEntityNotFound(_0x509ef6,null))[_0x583d('0x1d')](function(_0x2110f7){if(_0x2110f7){_0x157785[_0x583d('0x63')][_0x583d('0x65')]=_0x2110f7['id'];return db['Disposition'][_0x583d('0x5c')](_0x157785[_0x583d('0x63')]);}})[_0x583d('0x1d')](respondWithResult(_0x509ef6,null))[_0x583d('0x26')](handleError(_0x509ef6,null));};exports[_0x583d('0x66')]=function(_0x2ad488,_0x561e07,_0x6b6313){var _0x58cbd7={'raw':![],'where':{}};var _0x2fa732={};var _0x24517c={'count':0x0,'rows':[]};return db[_0x583d('0x54')][_0x583d('0x67')]({'where':{'id':_0x2ad488[_0x583d('0x5a')]['id']}})[_0x583d('0x1d')](handleEntityNotFound(_0x561e07,null))[_0x583d('0x1d')](function(_0x7636b8){if(_0x7636b8){_0x2fa732[_0x583d('0x43')]=_['keys'](db[_0x583d('0x68')][_0x583d('0x3f')]);_0x2fa732[_0x583d('0x49')]=_[_0x583d('0x44')](_0x2ad488['query']);_0x2fa732['filters']=_['intersection'](_0x2fa732['model'],_0x2fa732[_0x583d('0x49')]);_0x58cbd7[_0x583d('0x46')]=_[_0x583d('0x47')](_0x2fa732[_0x583d('0x43')],qs[_0x583d('0x48')](_0x2ad488[_0x583d('0x49')][_0x583d('0x48')]));_0x58cbd7[_0x583d('0x46')]=_0x58cbd7[_0x583d('0x46')][_0x583d('0x4a')]?_0x58cbd7[_0x583d('0x46')]:_0x2fa732[_0x583d('0x43')];if(!_0x2ad488[_0x583d('0x49')]['hasOwnProperty'](_0x583d('0x4b'))){_0x58cbd7[_0x583d('0x2b')]=qs[_0x583d('0x2b')](_0x2ad488[_0x583d('0x49')]['limit']);_0x58cbd7[_0x583d('0x29')]=qs[_0x583d('0x29')](_0x2ad488[_0x583d('0x49')][_0x583d('0x29')]);}_0x58cbd7['order']=qs[_0x583d('0x4d')](_0x2ad488[_0x583d('0x49')][_0x583d('0x4d')]);_0x58cbd7['where']=qs[_0x583d('0x45')](_['pick'](_0x2ad488[_0x583d('0x49')],_0x2fa732[_0x583d('0x45')]));_0x58cbd7['where']['OpenchannelAccountId']=_0x7636b8['id'];if(_0x2ad488[_0x583d('0x49')]['filter']){_0x58cbd7[_0x583d('0x4e')]=_[_0x583d('0x50')](_0x58cbd7[_0x583d('0x4e')],{'$or':_[_0x583d('0x3e')](_0x58cbd7[_0x583d('0x46')],function(_0x47657a){var _0x4169bb={};_0x4169bb[_0x47657a]={'$like':'%'+_0x2ad488[_0x583d('0x49')][_0x583d('0x52')]+'%'};return _0x4169bb;})});}_0x58cbd7=_[_0x583d('0x50')]({},_0x58cbd7,_0x2ad488[_0x583d('0x53')]);return db[_0x583d('0x68')][_0x583d('0x2c')]({'where':_0x58cbd7[_0x583d('0x4e')]})['then'](function(_0xd804f6){_0x24517c[_0x583d('0x2c')]=_0xd804f6;if(_0x2ad488['query']['includeAll']){_0x58cbd7[_0x583d('0x56')]=[{'all':!![]}];}return db[_0x583d('0x68')][_0x583d('0x57')](_0x58cbd7);})[_0x583d('0x1d')](function(_0x182c4f){_0x24517c[_0x583d('0x58')]=_0x182c4f;return _0x24517c;});}})[_0x583d('0x1d')](respondWithFilteredResult(_0x561e07,_0x58cbd7))[_0x583d('0x26')](handleError(_0x561e07,null));};exports[_0x583d('0x69')]=function(_0x3d24b2,_0x396458,_0x4c4069){return db[_0x583d('0x54')][_0x583d('0x5b')]({'where':{'id':_0x3d24b2[_0x583d('0x5a')]['id']}})[_0x583d('0x1d')](handleEntityNotFound(_0x396458,null))['then'](function(_0x261bed){if(_0x261bed){return _0x261bed[_0x583d('0x69')](_0x3d24b2['query'][_0x583d('0x6a')]);}})[_0x583d('0x1d')](respondWithStatusCode(_0x396458,null))[_0x583d('0x26')](handleError(_0x396458,null));};exports['addAnswer']=function(_0x23cb8e,_0x1f39f2,_0x308f4f){if(_0x23cb8e[_0x583d('0x63')]['id']){delete _0x23cb8e[_0x583d('0x63')]['id'];}return db[_0x583d('0x54')]['find']({'where':{'id':_0x23cb8e[_0x583d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1f39f2,null))[_0x583d('0x1d')](function(_0x564bd9){if(_0x564bd9){_0x23cb8e[_0x583d('0x63')][_0x583d('0x65')]=_0x564bd9['id'];return db[_0x583d('0x6b')][_0x583d('0x5c')](_0x23cb8e[_0x583d('0x63')]);}})[_0x583d('0x1d')](respondWithResult(_0x1f39f2,null))['catch'](handleError(_0x1f39f2,null));};exports[_0x583d('0x6c')]=function(_0x241740,_0x551fa5,_0x136ce6){var _0x51beef={'raw':![],'where':{}};var _0x1f1b02={};var _0x5729ee={'count':0x0,'rows':[]};return db[_0x583d('0x54')][_0x583d('0x67')]({'where':{'id':_0x241740['params']['id']}})['then'](handleEntityNotFound(_0x551fa5,null))[_0x583d('0x1d')](function(_0x5acd32){if(_0x5acd32){_0x1f1b02[_0x583d('0x43')]=_[_0x583d('0x44')](db['CannedAnswer'][_0x583d('0x3f')]);_0x1f1b02[_0x583d('0x49')]=_[_0x583d('0x44')](_0x241740[_0x583d('0x49')]);_0x1f1b02['filters']=_['intersection'](_0x1f1b02[_0x583d('0x43')],_0x1f1b02['query']);_0x51beef['attributes']=_[_0x583d('0x47')](_0x1f1b02[_0x583d('0x43')],qs[_0x583d('0x48')](_0x241740[_0x583d('0x49')]['fields']));_0x51beef['attributes']=_0x51beef['attributes'][_0x583d('0x4a')]?_0x51beef[_0x583d('0x46')]:_0x1f1b02[_0x583d('0x43')];if(!_0x241740[_0x583d('0x49')][_0x583d('0x6d')](_0x583d('0x4b'))){_0x51beef[_0x583d('0x2b')]=qs[_0x583d('0x2b')](_0x241740['query']['limit']);_0x51beef[_0x583d('0x29')]=qs[_0x583d('0x29')](_0x241740[_0x583d('0x49')][_0x583d('0x29')]);}_0x51beef[_0x583d('0x4c')]=qs[_0x583d('0x4d')](_0x241740[_0x583d('0x49')][_0x583d('0x4d')]);_0x51beef[_0x583d('0x4e')]=qs[_0x583d('0x45')](_['pick'](_0x241740[_0x583d('0x49')],_0x1f1b02['filters']));_0x51beef['where'][_0x583d('0x65')]=_0x5acd32['id'];if(_0x241740['query'][_0x583d('0x52')]){_0x51beef[_0x583d('0x4e')]=_[_0x583d('0x50')](_0x51beef[_0x583d('0x4e')],{'$or':_['map'](_0x51beef[_0x583d('0x46')],function(_0x33afcd){var _0x297c63={};_0x297c63[_0x33afcd]={'$like':'%'+_0x241740['query'][_0x583d('0x52')]+'%'};return _0x297c63;})});}_0x51beef=_[_0x583d('0x50')]({},_0x51beef,_0x241740[_0x583d('0x53')]);return db[_0x583d('0x6b')]['count']({'where':_0x51beef[_0x583d('0x4e')]})[_0x583d('0x1d')](function(_0x1f54fd){_0x5729ee[_0x583d('0x2c')]=_0x1f54fd;if(_0x241740[_0x583d('0x49')][_0x583d('0x55')]){_0x51beef['include']=[{'all':!![]}];}return db[_0x583d('0x6b')][_0x583d('0x57')](_0x51beef);})[_0x583d('0x1d')](function(_0x28b0b1){_0x5729ee[_0x583d('0x58')]=_0x28b0b1;return _0x5729ee;});}})[_0x583d('0x1d')](respondWithFilteredResult(_0x551fa5,_0x51beef))['catch'](handleError(_0x551fa5,null));};exports[_0x583d('0x6e')]=function(_0x5205fc,_0x1a216b,_0x2c99e8){return db['OpenchannelAccount'][_0x583d('0x5b')]({'where':{'id':_0x5205fc[_0x583d('0x5a')]['id']}})[_0x583d('0x1d')](handleEntityNotFound(_0x1a216b,null))[_0x583d('0x1d')](function(_0x39b555){if(_0x39b555){return _0x39b555[_0x583d('0x6e')](_0x5205fc[_0x583d('0x49')][_0x583d('0x6a')]);}})['then'](respondWithStatusCode(_0x1a216b,null))[_0x583d('0x26')](handleError(_0x1a216b,null));};exports[_0x583d('0x6f')]=function(_0x18a05e,_0x30106e,_0x3381ee){var _0x5a11c7={'body':_0x18a05e[_0x583d('0x63')],'channel':_0x583d('0x70')};var _0xf1aa=[];var _0x1f1435=[];var _0x14301b={};var _0x611688=![];return db['CmContact'][_0x583d('0x64')]()[_0x583d('0x1d')](function(_0x45eddf){if(!_0x45eddf){throw new db[(_0x583d('0x71'))][(_0x583d('0x72'))](_0x583d('0x73'));}_0xf1aa=_[_0x583d('0x74')](_[_0x583d('0x44')](_0x45eddf),[_0x583d('0x75'),_0x583d('0x76')]);_0x1f1435=_['difference'](_['keys'](_0x45eddf),[_0x583d('0x75'),'updatedAt',_0x583d('0x77'),_0x583d('0x78')]);if(_0x18a05e[_0x583d('0x63')]['id']){delete _0x18a05e[_0x583d('0x63')]['id'];}if(_['isNil'](_0x18a05e[_0x583d('0x63')][_0x583d('0x79')])){throw new db[(_0x583d('0x71'))][(_0x583d('0x72'))](_0x583d('0x7a'));}if(_['isNil'](_0x18a05e[_0x583d('0x63')][_0x583d('0x63')])||_0x18a05e['body']['body']===''){throw new db[(_0x583d('0x71'))][(_0x583d('0x72'))](_0x583d('0x7b'));}if(_[_0x583d('0x7c')](_0x18a05e[_0x583d('0x63')][_0x583d('0x7d')])){throw new db['Sequelize']['ValidationError'](_0x583d('0x7e')+_0x1f1435);}if(!_[_0x583d('0x7f')](_0x1f1435,_0x18a05e[_0x583d('0x63')][_0x583d('0x7d')])){throw new db[(_0x583d('0x71'))][(_0x583d('0x72'))](_0x583d('0x80')+_0x1f1435);}_0x14301b[_0x18a05e[_0x583d('0x63')]['mapKey']]=_0x18a05e[_0x583d('0x63')]['from'];})['then'](function(){return db[_0x583d('0x54')]['find']({'where':{'id':_0x18a05e[_0x583d('0x5a')]['id']},'include':[{'model':db[_0x583d('0x81')],'as':_0x583d('0x82'),'include':[{'model':db['CmContact'],'as':_0x583d('0x83'),'where':_0x14301b,'limit':0x1,'order':[[_0x583d('0x76'),_0x583d('0x84')]]}]},{'model':db['OpenchannelApplication'],'as':_0x583d('0x85')}]});})['then'](handleEntityNotFound(_0x30106e,null))[_0x583d('0x1d')](function(_0x550d44){if(_0x550d44&&_0x550d44[_0x583d('0x82')]){_0x5a11c7[_0x583d('0x86')]=_0x550d44;_0x5a11c7[_0x583d('0x87')]=_0x550d44['Applications'];_0x5a11c7[_0x583d('0x88')]=_0x550d44[_0x583d('0x82')];_0x5a11c7[_0x583d('0x87')]=_[_0x583d('0x89')](_0x5a11c7[_0x583d('0x87')],[_0x583d('0x8a')],[_0x583d('0x8b')]);if(_0x5a11c7[_0x583d('0x86')][_0x583d('0x85')]){delete _0x5a11c7[_0x583d('0x86')][_0x583d('0x85')];}if(_0x5a11c7[_0x583d('0x86')][_0x583d('0x82')]&&_0x5a11c7[_0x583d('0x86')]['List'][_0x583d('0x83')][_0x583d('0x4a')]){return _0x5a11c7[_0x583d('0x86')][_0x583d('0x82')][_0x583d('0x83')][0x0];}var _0x54d872=_['defaults'](_0x18a05e['body'],{'firstName':_0x18a05e[_0x583d('0x63')][_0x583d('0x79')],'ListId':_0x550d44[_0x583d('0x78')]});_0x54d872[_0x18a05e['body']['mapKey']]=_0x18a05e['body'][_0x583d('0x79')];return db[_0x583d('0x8c')][_0x583d('0x5c')](_0x54d872,{'fields':_0xf1aa,'raw':!![]});}})[_0x583d('0x1d')](handleEntityNotFound(_0x30106e,null))[_0x583d('0x1d')](function(_0x30e70a){_0x5a11c7['contact']=_0x30e70a;if(_0x30e70a){var _0x3f3824={'ContactId':_0x30e70a['id'],'OpenchannelAccountId':_0x18a05e[_0x583d('0x5a')]['id'],'from':(_0x30e70a[_0x583d('0x8d')]||'')+'\x20'+(_0x30e70a[_0x583d('0x8e')]||'')};var _0x58895e={'OpenchannelAccountId':_0x18a05e[_0x583d('0x5a')]['id'],'closed':![]};if(_0x18a05e[_0x583d('0x63')][_0x583d('0x8f')]){_0x58895e[_0x583d('0x8f')]=_0x18a05e[_0x583d('0x63')][_0x583d('0x8f')];return db[_0x583d('0x90')][_0x583d('0x5b')]({'where':_0x58895e})[_0x583d('0x1d')](function(_0x3970cd){if(_0x3970cd){return[_0x3970cd,![]];}_0x3f3824[_0x583d('0x8f')]=_0x18a05e[_0x583d('0x63')][_0x583d('0x8f')];_0x3f3824[_0x583d('0x91')]=_0x18a05e[_0x583d('0x63')]['externalUrl'];return db['OpenchannelInteraction'][_0x583d('0x5c')](_0x3f3824)[_0x583d('0x1d')](function(_0x454e8c){return[_0x454e8c,!![]];});});}else{_0x58895e['threadId']=null;}_0x58895e['ContactId']=_0x30e70a['id'];return db['OpenchannelInteraction'][_0x583d('0x5b')]({'where':_0x58895e})[_0x583d('0x1d')](function(_0x37e92f){if(_0x37e92f){return[_0x37e92f,![]];}return db['OpenchannelInteraction'][_0x583d('0x5c')](_0x3f3824)[_0x583d('0x1d')](function(_0x228749){return[_0x228749,!![]];});});}})[_0x583d('0x92')](function(_0x29b685,_0x4d8267){if(_0x29b685){_0x611688=_0x4d8267;if(!_0x4d8267){var _0x225013={'from':(_0x5a11c7[_0x583d('0x93')]['firstName']||'')+'\x20'+(_0x5a11c7[_0x583d('0x93')][_0x583d('0x8e')]||'')};if(_0x18a05e['body'][_0x583d('0x8f')]&&_0x18a05e[_0x583d('0x63')][_0x583d('0x94')]&&_0x18a05e[_0x583d('0x63')][_0x583d('0x8f')]!=_0x18a05e[_0x583d('0x63')][_0x583d('0x94')]){_0x225013[_0x583d('0x8f')]=_0x18a05e[_0x583d('0x63')][_0x583d('0x94')];}return _0x29b685[_0x583d('0x32')](_0x225013);}else{return _0x29b685;}}})[_0x583d('0x1d')](function(_0x4e82cb){_0x5a11c7[_0x583d('0x95')]=_0x4e82cb[_0x583d('0x34')]({'plain':!![]});_0x5a11c7['interaction'][_0x583d('0x96')]=_0x611688;if(_0x5a11c7[_0x583d('0x95')][_0x583d('0x96')]){if(_0x5a11c7[_0x583d('0x86')]['autoclose']){_0x5a11c7[_0x583d('0x87')][_0x583d('0x97')]({'id':0x0,'priority':_0x5a11c7[_0x583d('0x87')][_0x583d('0x4a')]+0x1,'app':_0x583d('0x98'),'appdata':_0x583d('0x99'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0x583d('0x5c')]({'body':_0x18a05e[_0x583d('0x63')]['body'],'OpenchannelAccountId':_0x18a05e[_0x583d('0x5a')]['id'],'OpenchannelInteractionId':_0x4e82cb['id'],'direction':'in','ContactId':_0x5a11c7[_0x583d('0x93')]['id'],'AttachmentId':_0x18a05e[_0x583d('0x63')][_0x583d('0x9a')]});})['then'](function(_0x371b01){_0x5a11c7[_0x583d('0x23')]=_0x371b01;if(_0x5a11c7[_0x583d('0x95')][_0x583d('0x9b')]){return db[_0x583d('0x9c')]['find']({'attributes':['id',_0x583d('0x39')],'where':{'id':_0x5a11c7[_0x583d('0x95')][_0x583d('0x9b')]}})[_0x583d('0x1d')](function(_0x269f61){if(_0x269f61){_0x5a11c7[_0x583d('0x87')][_0x583d('0x9d')]({'id':0x0,'priority':0x0,'app':_0x583d('0x9e'),'appdata':_0x269f61[_0x583d('0x39')]+','+(_0x5a11c7['account'][_0x583d('0x9f')]||0xa),'interval':_0x583d('0xa0')});_0x5a11c7['forcedOwnership']=![];}return respondWithRpcPromise(_0x583d('0xa1'),_0x583d('0xa2'),_0x5a11c7);});}return respondWithRpcPromise(_0x583d('0xa1'),'startRouting',_0x5a11c7);})[_0x583d('0x1d')](function(_0x4943f4){respondWithRpcPromise(_0x583d('0xa3'),_0x583d('0xa3'),{'event':_0x583d('0x6f'),'message':_0x4943f4},client9002);return _0x4943f4;})[_0x583d('0x1d')](respondWithResult(_0x30106e,null))['catch'](handleError(_0x30106e,null));};exports[_0x583d('0xa4')]=function(_0x1c659c,_0xdeb096){var _0x5f29d7=_0x1c659c['params']['id'];var _0x56f6d2=_0x1c659c['body'];var _0x5ba891=0xc8;var _0x1fdf20=null;return db[_0x583d('0xa5')][_0x583d('0xa6')]({'isolationLevel':db[_0x583d('0xa5')]['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x4774fc){return db[_0x583d('0x54')][_0x583d('0x67')]({'where':{'id':_0x5f29d7},'transaction':_0x4774fc})[_0x583d('0x1d')](function(_0x447a29){if(_0x447a29){return db[_0x583d('0xa7')][_0x583d('0x33')]({'where':{'OpenchannelAccountId':_0x5f29d7},'transaction':_0x4774fc})[_0x583d('0x1d')](function(){var _0x365fcd=_['map'](_0x56f6d2,function(_0x11187d){_0x11187d[_0x583d('0x65')]=_0x5f29d7;return _0x11187d;});return db[_0x583d('0xa7')][_0x583d('0xa8')](_0x365fcd,{'transaction':_0x4774fc});});}else{_0x5ba891=0x194;_0x1fdf20=[];}});})['then'](function(){if(_0x5ba891!==0x194){return db[_0x583d('0xa7')][_0x583d('0xa9')]({'where':{'OpenchannelAccountId':_0x5f29d7},'order':'priority'})[_0x583d('0x1d')](function(_0x2b250e){_0x1fdf20=_0x2b250e;});}})['catch'](function(_0x33ae0d){_0x5ba891=0x1f4;logger['error'](_0x33ae0d['stack']);if(_0x33ae0d[_0x583d('0x39')]){delete _0x33ae0d[_0x583d('0x39')];}_0x1fdf20=_0x33ae0d;})['finally'](function(){if(_0x1fdf20===null){_0xdeb096[_0x583d('0x27')](_0x5ba891);}else{if(_0x5ba891===0x1f4){_0xdeb096[_0x583d('0x2d')](_0x5ba891)['send'](_0x1fdf20);}else{_0xdeb096['status'](_0x5ba891)[_0x583d('0x28')](_0x1fdf20);}}});};exports[_0x583d('0xaa')]=function(_0x1c20bd,_0x295259,_0x397691){var _0x5eb081={};var _0x1075af={};var _0x499786;var _0x28d556;return db[_0x583d('0x54')][_0x583d('0x67')]({'where':{'id':_0x1c20bd[_0x583d('0x5a')]['id']}})[_0x583d('0x1d')](handleEntityNotFound(_0x295259,null))['then'](function(_0xe0199c){if(_0xe0199c){_0x499786=_0xe0199c;_0x1075af['model']=_[_0x583d('0x44')](db[_0x583d('0xa7')][_0x583d('0x3f')]);_0x1075af[_0x583d('0x49')]=_['keys'](_0x1c20bd[_0x583d('0x49')]);_0x1075af[_0x583d('0x45')]=_[_0x583d('0x47')](_0x1075af[_0x583d('0x43')],_0x1075af[_0x583d('0x49')]);_0x5eb081[_0x583d('0x46')]=_[_0x583d('0x47')](_0x1075af[_0x583d('0x43')],qs[_0x583d('0x48')](_0x1c20bd['query'][_0x583d('0x48')]));_0x5eb081[_0x583d('0x46')]=_0x5eb081[_0x583d('0x46')]['length']?_0x5eb081[_0x583d('0x46')]:_0x1075af[_0x583d('0x43')];_0x5eb081['order']=qs[_0x583d('0x4d')](_0x1c20bd[_0x583d('0x49')][_0x583d('0x4d')]);_0x5eb081['where']=qs[_0x583d('0x45')](_['pick'](_0x1c20bd['query'],_0x1075af['filters']));if(_0x1c20bd['query'][_0x583d('0x52')]){_0x5eb081[_0x583d('0x4e')]=_['merge'](_0x5eb081[_0x583d('0x4e')],{'$or':_[_0x583d('0x3e')](_0x5eb081[_0x583d('0x46')],function(_0x2c1a4f){var _0x1a6910={};_0x1a6910[_0x2c1a4f]={'$like':'%'+_0x1c20bd[_0x583d('0x49')][_0x583d('0x52')]+'%'};return _0x1a6910;})});}_0x5eb081=_[_0x583d('0x50')]({},_0x5eb081,_0x1c20bd[_0x583d('0x53')]);return _0x499786[_0x583d('0xaa')](_0x5eb081);}})[_0x583d('0x1d')](function(_0x57d891){if(_0x57d891){_0x28d556=_0x57d891['length'];if(!_0x1c20bd[_0x583d('0x49')]['hasOwnProperty'](_0x583d('0x4b'))){_0x5eb081['limit']=qs[_0x583d('0x2b')](_0x1c20bd[_0x583d('0x49')][_0x583d('0x2b')]);_0x5eb081[_0x583d('0x29')]=qs[_0x583d('0x29')](_0x1c20bd['query']['offset']);}return _0x499786[_0x583d('0xaa')](_0x5eb081);}})[_0x583d('0x1d')](function(_0x323362){if(_0x323362){return _0x323362?{'count':_0x28d556,'rows':_0x323362}:null;}})[_0x583d('0x1d')](respondWithResult(_0x295259,null))[_0x583d('0x26')](handleError(_0x295259,null));};exports[_0x583d('0xab')]=function(_0x23ac3c,_0x265d96,_0x50f200){var _0x35f3ed={'raw':![],'where':{}};var _0x1513f8={};var _0x3ae16d={'count':0x0,'rows':[]};return db[_0x583d('0x54')][_0x583d('0x67')]({'where':{'id':_0x23ac3c[_0x583d('0x5a')]['id']}})[_0x583d('0x1d')](handleEntityNotFound(_0x265d96,null))['then'](function(_0x4a4e33){if(_0x4a4e33){_0x1513f8[_0x583d('0x43')]=_[_0x583d('0x44')](db['OpenchannelInteraction']['rawAttributes']);_0x1513f8[_0x583d('0x49')]=_['keys'](_0x23ac3c[_0x583d('0x49')]);_0x1513f8[_0x583d('0x45')]=_[_0x583d('0x47')](_0x1513f8[_0x583d('0x43')],_0x1513f8[_0x583d('0x49')]);_0x35f3ed[_0x583d('0x46')]=_[_0x583d('0x47')](_0x1513f8['model'],qs['fields'](_0x23ac3c[_0x583d('0x49')]['fields']));_0x35f3ed[_0x583d('0x46')]=_0x35f3ed[_0x583d('0x46')]['length']?_0x35f3ed[_0x583d('0x46')]:_0x1513f8['model'];if(!_0x23ac3c[_0x583d('0x49')][_0x583d('0x6d')]('nolimit')){_0x35f3ed[_0x583d('0x2b')]=qs[_0x583d('0x2b')](_0x23ac3c[_0x583d('0x49')]['limit']);_0x35f3ed['offset']=qs[_0x583d('0x29')](_0x23ac3c[_0x583d('0x49')][_0x583d('0x29')]);}_0x35f3ed['order']=qs[_0x583d('0x4d')](_0x23ac3c[_0x583d('0x49')]['sort']);_0x35f3ed[_0x583d('0x4e')]=qs[_0x583d('0x45')](_['pick'](_0x23ac3c['query'],_0x1513f8[_0x583d('0x45')]));_0x35f3ed[_0x583d('0x4e')][_0x583d('0x65')]=_0x4a4e33['id'];if(_0x23ac3c[_0x583d('0x49')][_0x583d('0x52')]){_0x35f3ed[_0x583d('0x4e')]=_['merge'](_0x35f3ed[_0x583d('0x4e')],{'$or':_[_0x583d('0x3e')](_0x35f3ed['attributes'],function(_0x425956){var _0x5b1c00={};_0x5b1c00[_0x425956]={'$like':'%'+_0x23ac3c[_0x583d('0x49')][_0x583d('0x52')]+'%'};return _0x5b1c00;})});}_0x35f3ed=_[_0x583d('0x50')]({},_0x35f3ed,_0x23ac3c[_0x583d('0x53')]);return db[_0x583d('0x90')][_0x583d('0x2c')]({'where':_0x35f3ed[_0x583d('0x4e')]})['then'](function(_0x510b50){_0x3ae16d[_0x583d('0x2c')]=_0x510b50;if(_0x23ac3c[_0x583d('0x49')][_0x583d('0x55')]){_0x35f3ed['include']=[{'model':db[_0x583d('0x8c')],'as':_0x583d('0xac'),'required':![]},{'model':db[_0x583d('0x9c')],'as':_0x583d('0xad'),'attributes':[_0x583d('0x39'),'fullname',_0x583d('0xae')],'required':![]},{'model':db[_0x583d('0xaf')],'as':_0x583d('0xb0'),'attributes':['id',_0x583d('0x39'),'color'],'where':_0x23ac3c[_0x583d('0x49')]['tag']?{'id':_0x23ac3c['query'][_0x583d('0xb1')]}:undefined,'required':_0x23ac3c[_0x583d('0x49')]['tag']?!![]:![]}];}return db[_0x583d('0x90')][_0x583d('0x57')](_0x35f3ed);})[_0x583d('0x1d')](function(_0x42b190){_0x3ae16d[_0x583d('0x58')]=_0x42b190;return _0x3ae16d;});}})[_0x583d('0x1d')](respondWithFilteredResult(_0x265d96,_0x35f3ed))[_0x583d('0x26')](handleError(_0x265d96,null));};exports['addAgents']=function(_0x3b0b85,_0x1a342c,_0x54932a){return db[_0x583d('0x54')][_0x583d('0x5b')]({'where':{'id':_0x3b0b85[_0x583d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1a342c,null))[_0x583d('0x1d')](function(_0x4530e0){if(_0x4530e0){return _0x4530e0[_0x583d('0xb2')](_0x3b0b85[_0x583d('0x63')][_0x583d('0x6a')],_[_0x583d('0xb3')](_0x3b0b85[_0x583d('0x63')],[_0x583d('0x6a'),'id'])||{})[_0x583d('0x92')](function(_0xf27542){for(var _0x2189c7=0x0;_0x2189c7<_0x3b0b85[_0x583d('0x63')]['ids'][_0x583d('0x4a')];_0x2189c7+=0x1){socket['emit'](_0x583d('0xb4'),{'UserId':Number(_0x3b0b85['body'][_0x583d('0x6a')][_0x2189c7]),'OpenchannelAccountId':Number(_0x3b0b85['params']['id'])});}return _0xf27542;});}})[_0x583d('0x1d')](respondWithResult(_0x1a342c,null))[_0x583d('0x26')](handleError(_0x1a342c,null));};exports[_0x583d('0xb5')]=function(_0x1faa54,_0x204961,_0x3208fb){return db['OpenchannelAccount'][_0x583d('0x5b')]({'where':{'id':_0x1faa54[_0x583d('0x5a')]['id']}})[_0x583d('0x1d')](handleEntityNotFound(_0x204961,null))[_0x583d('0x1d')](function(_0x49ffb4){if(_0x49ffb4){return _0x49ffb4[_0x583d('0xb5')](_0x1faa54['query'][_0x583d('0x6a')])[_0x583d('0x1d')](function(){if(_[_0x583d('0xb6')](_0x1faa54[_0x583d('0x49')][_0x583d('0x6a')])){for(var _0x570d2f=0x0;_0x570d2f<_0x1faa54[_0x583d('0x49')][_0x583d('0x6a')]['length'];_0x570d2f+=0x1){socket[_0x583d('0xb7')](_0x583d('0xb8'),{'UserId':Number(_0x1faa54['query'][_0x583d('0x6a')][_0x570d2f]),'OpenchannelAccountId':Number(_0x1faa54[_0x583d('0x5a')]['id'])});}}else{socket[_0x583d('0xb7')](_0x583d('0xb8'),{'UserId':Number(_0x1faa54[_0x583d('0x49')]['ids']),'OpenchannelAccountId':Number(_0x1faa54[_0x583d('0x5a')]['id'])});}});}})[_0x583d('0x1d')](respondWithStatusCode(_0x204961,null))[_0x583d('0x26')](handleError(_0x204961,null));};exports['getAgents']=function(_0xea0f4,_0x9c49ea,_0x966260){var _0x7ef686={};var _0x49a717={};var _0x14952e;var _0x2f105e;return db[_0x583d('0x54')][_0x583d('0x67')]({'where':{'id':_0xea0f4[_0x583d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x9c49ea,null))[_0x583d('0x1d')](function(_0x2a262a){if(_0x2a262a){_0x14952e=_0x2a262a;_0x49a717[_0x583d('0x43')]=_['keys'](db[_0x583d('0x9c')][_0x583d('0x3f')]);_0x49a717[_0x583d('0x49')]=_[_0x583d('0x44')](_0xea0f4[_0x583d('0x49')]);_0x49a717[_0x583d('0x45')]=_['intersection'](_0x49a717[_0x583d('0x43')],_0x49a717[_0x583d('0x49')]);_0x7ef686[_0x583d('0x46')]=_['intersection'](_0x49a717['model'],qs[_0x583d('0x48')](_0xea0f4['query'][_0x583d('0x48')]));_0x7ef686[_0x583d('0x46')]=_0x7ef686[_0x583d('0x46')][_0x583d('0x4a')]?_0x7ef686[_0x583d('0x46')]:_0x49a717[_0x583d('0x43')];_0x7ef686[_0x583d('0x4c')]=qs[_0x583d('0x4d')](_0xea0f4['query'][_0x583d('0x4d')]);_0x7ef686['where']=qs['filters'](_['pick'](_0xea0f4['query'],_0x49a717['filters']));if(_0xea0f4[_0x583d('0x49')][_0x583d('0x52')]){_0x7ef686[_0x583d('0x4e')]=_[_0x583d('0x50')](_0x7ef686[_0x583d('0x4e')],{'$or':_[_0x583d('0x3e')](_0x7ef686[_0x583d('0x46')],function(_0x5077d4){var _0xdabe53={};_0xdabe53[_0x5077d4]={'$like':'%'+_0xea0f4[_0x583d('0x49')][_0x583d('0x52')]+'%'};return _0xdabe53;})});}_0x7ef686=_[_0x583d('0x50')]({},_0x7ef686,_0xea0f4[_0x583d('0x53')]);return _0x14952e[_0x583d('0xb9')](_0x7ef686);}})[_0x583d('0x1d')](function(_0x160d07){if(_0x160d07){_0x2f105e=_0x160d07['length'];if(!_0xea0f4[_0x583d('0x49')]['hasOwnProperty']('nolimit')){_0x7ef686[_0x583d('0x2b')]=qs[_0x583d('0x2b')](_0xea0f4[_0x583d('0x49')]['limit']);_0x7ef686['offset']=qs['offset'](_0xea0f4[_0x583d('0x49')][_0x583d('0x29')]);}return _0x14952e[_0x583d('0xb9')](_0x7ef686);}})[_0x583d('0x1d')](function(_0x5d9a12){if(_0x5d9a12){return _0x5d9a12?{'count':_0x2f105e,'rows':_0x5d9a12}:null;}})[_0x583d('0x1d')](respondWithResult(_0x9c49ea,null))[_0x583d('0x26')](handleError(_0x9c49ea,null));};exports[_0x583d('0x3a')]=function(_0x1bad32,_0x86343e,_0x286e15){var _0x5ac23a,_0xfab45c,_0x593b54;if(_[_0x583d('0x7c')](_0x1bad32[_0x583d('0x63')][_0x583d('0x63')])||_0x1bad32[_0x583d('0x63')][_0x583d('0x63')]===''){throw new db[(_0x583d('0x71'))]['ValidationError'](_0x583d('0x7b'));}if(_['isNil'](_0x1bad32[_0x583d('0x63')]['to'])){}_0x5ac23a=_0x1bad32[_0x583d('0x63')]['to'];return db[_0x583d('0x54')][_0x583d('0x67')]({'where':{'id':_0x1bad32[_0x583d('0x5a')]['id']}})[_0x583d('0x1d')](handleEntityNotFound(_0x86343e,null))['then'](function(_0x6a720b){if(_0x6a720b){return db[_0x583d('0x54')][_0x583d('0x5b')]({'where':{'id':_0x6a720b['id']},'include':[{'model':db[_0x583d('0x81')],'as':_0x583d('0x82'),'include':[{'model':db['CmContact'],'as':_0x583d('0x83'),'where':{[_0x6a720b[_0x583d('0x7d')]]:_0x5ac23a},'limit':0x1,'order':[[_0x583d('0x76'),_0x583d('0x84')]]}]}]})[_0x583d('0x1d')](handleEntityNotFound(_0x86343e,null))[_0x583d('0x1d')](function(_0x1579f9){if(_0x1579f9&&_0x1579f9[_0x583d('0x82')]){_0xfab45c=_0x1579f9[_0x583d('0x34')]({'plain':!![]});if(_0xfab45c[_0x583d('0x82')]&&_0xfab45c['List'][_0x583d('0x83')]['length']){return _0xfab45c[_0x583d('0x82')][_0x583d('0x83')][0x0];}return db[_0x583d('0x8c')][_0x583d('0x5c')](_['defaults'](_0x1bad32[_0x583d('0x63')],{'firstName':_0x5ac23a,[_0x1579f9[_0x583d('0x7d')]]:_0x5ac23a,'phone':_0x5ac23a,'ListId':_0xfab45c['ListId']}));}})['then'](handleEntityNotFound(_0x86343e,null))[_0x583d('0x1d')](function(_0x18a97c){if(_0x18a97c){_0x593b54=_0x18a97c;return db[_0x583d('0x90')][_0x583d('0x5b')]({'where':{'ContactId':_0x593b54['id'],'closed':![],'OpenchannelAccountId':_0xfab45c['id']}})[_0x583d('0x1d')](function(_0x154d78){if(_0x154d78){return[_0x154d78,![]];}return db['OpenchannelInteraction'][_0x583d('0x5c')]({'UserId':_0x1bad32[_0x583d('0x5d')]['id'],'ContactId':_0x593b54['id'],'OpenchannelAccountId':_0xfab45c['id'],'lastMsgDirection':_0x583d('0xba'),'Messages':[_[_0x583d('0x50')](_0x1bad32['body'],{'read':![],'body':_0x1bad32[_0x583d('0x63')][_0x583d('0x63')],'OpenchannelAccountId':_0xfab45c['id'],'UserId':_0x1bad32[_0x583d('0x5d')]['id'],'ContactId':_0x593b54['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})['then'](function(_0x2e53da){return[_0x2e53da,!![]];});});}})['spread'](function(_0x24895e,_0xb2aebb){if(_0xb2aebb){return _0x24895e;}return db[_0x583d('0xbb')][_0x583d('0x5c')](_[_0x583d('0x50')](_0x1bad32['body'],{'read':![],'body':_0x1bad32[_0x583d('0x63')]['body'],'OpenchannelAccountId':_0xfab45c['id'],'OpenchannelInteractionId':_0x24895e['id'],'UserId':_0x1bad32[_0x583d('0x5d')]['id'],'ContactId':_0x593b54['id']}))['then'](function(_0x4349bb){_0x24895e[_0x583d('0xbc')][_0x583d('0xbd')]=[];_0x24895e[_0x583d('0xbc')][_0x583d('0xbd')][_0x583d('0x97')](_0x4349bb[_0x583d('0xbc')]);return _0x24895e;});});}})[_0x583d('0x1d')](respondWithResult(_0x86343e,null))[_0x583d('0x26')](handleError(_0x86343e,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index d125dac..f8ea212 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 _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','OpenchannelAccount','setMaxListeners'];(function(_0x24584d,_0x58da0c){var _0x2e3fc7=function(_0x31358e){while(--_0x31358e){_0x24584d['push'](_0x24584d['shift']());}};_0x2e3fc7(++_0x58da0c);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x49c4('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){OpenchannelAccountEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);OpenchannelAccountEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];OpenchannelAccount[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xee5b=['remove','emit','hasOwnProperty','hook','events','OpenchannelAccount','setMaxListeners','update'];(function(_0x4a4c9b,_0x7cec4a){var _0x493e11=function(_0x48fd70){while(--_0x48fd70){_0x4a4c9b['push'](_0x4a4c9b['shift']());}};_0x493e11(++_0x7cec4a);}(_0xee5b,0x1f4));var _0xbee5=function(_0x282833,_0x20f502){_0x282833=_0x282833-0x0;var _0x20ef9e=_0xee5b[_0x282833];return _0x20ef9e;};'use strict';var EventEmitter=require(_0xbee5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbee5('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbee5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbee5('0x3'),'afterDestroy':_0xbee5('0x4')};function emitEvent(_0x2eb857){return function(_0x210159,_0x4bd202,_0x5200b1){OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857+':'+_0x210159['id'],_0x210159);OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857,_0x210159);_0x5200b1(null);};}for(var e in events){if(events[_0xbee5('0x6')](e)){var event=events[e];OpenchannelAccount[_0xbee5('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index b76ba38..747be5a 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(_0x3e9a45,_0x426236){var _0xd89851=function(_0x15eb69){while(--_0x15eb69){_0x3e9a45['push'](_0x3e9a45['shift']());}};_0xd89851(++_0x426236);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x50e1a6,_0x278b34){var _0x59e8ac=function(_0x5aadb2){while(--_0x5aadb2){_0x50e1a6['push'](_0x50e1a6['shift']());}};_0x59e8ac(++_0x278b34);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 29b8f92..33864f3 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 _0xed3c=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','localhost','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment'];(function(_0x4e2007,_0x4610a6){var _0x2e024f=function(_0x3e6800){while(--_0x3e6800){_0x4e2007['push'](_0x4e2007['shift']());}};_0x2e024f(++_0x4610a6);}(_0xed3c,0x1a6));var _0xced3=function(_0x31c7b6,_0x5778bb){_0x31c7b6=_0x31c7b6-0x0;var _0x5ea4cc=_0xed3c[_0x31c7b6];return _0x5ea4cc;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xced3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xced3('0xc')](socket);function respondWithRpcPromise(_0x321c42,_0x3e5a04,_0x12612f){return new BPromise(function(_0x1cb639,_0x5934b2){return client[_0xced3('0xd')](_0x321c42,_0x12612f)[_0xced3('0xe')](function(_0x3da0ff){logger['info'](_0xced3('0xf'),_0x3e5a04,_0xced3('0x10'));logger[_0xced3('0x11')](_0xced3('0x12'),_0x3e5a04,_0xced3('0x10'),JSON[_0xced3('0x13')](_0x3da0ff));if(_0x3da0ff[_0xced3('0x14')]){if(_0x3da0ff['error'][_0xced3('0x15')]===0x1f4){logger['error'](_0xced3('0xf'),_0x3e5a04,_0x3da0ff[_0xced3('0x14')][_0xced3('0x16')]);return _0x5934b2(_0x3da0ff[_0xced3('0x14')]['message']);}logger[_0xced3('0x14')](_0xced3('0xf'),_0x3e5a04,_0x3da0ff['error'][_0xced3('0x16')]);return _0x1cb639(_0x3da0ff[_0xced3('0x14')][_0xced3('0x16')]);}else{logger[_0xced3('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x3e5a04,_0xced3('0x10'));_0x1cb639(_0x3da0ff['result'][_0xced3('0x16')]);}})[_0xced3('0x18')](function(_0x32c402){logger[_0xced3('0x14')](_0xced3('0xf'),_0x3e5a04,_0x32c402);_0x5934b2(_0x32c402);});});} \ No newline at end of file +var _0xac4a=['../../config/logger','rpc','../../config/environment','client','redis','localhost','./openchannelAccount.socket','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2aafbd,_0x2d7182){var _0x48bb54=function(_0x47ff8a){while(--_0x47ff8a){_0x2aafbd['push'](_0x2aafbd['shift']());}};_0x48bb54(++_0x2d7182);}(_0xac4a,0x13f));var _0xaac4=function(_0x363473,_0x1c091e){_0x363473=_0x363473-0x0;var _0x54750e=_0xac4a[_0x363473];return _0x54750e;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});config[_0xaac4('0xa')]=_['defaults'](config[_0xaac4('0xa')],{'host':_0xaac4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaac4('0xc'))['register'](socket);function respondWithRpcPromise(_0x452573,_0x59b992,_0x4f4c84){return new BPromise(function(_0xeb6b9a,_0x22cea4){return client[_0xaac4('0xd')](_0x452573,_0x4f4c84)[_0xaac4('0xe')](function(_0x3a983c){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x59b992,_0xaac4('0xf'));logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x59b992,'request\x20sent',JSON[_0xaac4('0x12')](_0x3a983c));if(_0x3a983c[_0xaac4('0x13')]){if(_0x3a983c['error'][_0xaac4('0x14')]===0x1f4){logger[_0xaac4('0x13')](_0xaac4('0x15'),_0x59b992,_0x3a983c[_0xaac4('0x13')][_0xaac4('0x16')]);return _0x22cea4(_0x3a983c[_0xaac4('0x13')][_0xaac4('0x16')]);}logger[_0xaac4('0x13')](_0xaac4('0x15'),_0x59b992,_0x3a983c[_0xaac4('0x13')][_0xaac4('0x16')]);return _0xeb6b9a(_0x3a983c[_0xaac4('0x13')][_0xaac4('0x16')]);}else{logger['info'](_0xaac4('0x15'),_0x59b992,'request\x20sent');_0xeb6b9a(_0x3a983c[_0xaac4('0x17')]['message']);}})[_0xaac4('0x18')](function(_0x27fe7b){logger[_0xaac4('0x13')](_0xaac4('0x15'),_0x59b992,_0x27fe7b);_0x22cea4(_0x27fe7b);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index aa55877..67e804d 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 _0xca66=['update','emit','register','length','./openchannelAccount.events'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xca66,0x8b));var _0x6ca6=function(_0x8fc917,_0x5b8be0){_0x8fc917=_0x8fc917-0x0;var _0xa6ecbc=_0xca66[_0x8fc917];return _0xa6ecbc;};'use strict';var OpenchannelAccountEvents=require(_0x6ca6('0x0'));var events=['save','remove',_0x6ca6('0x1')];function createListener(_0x1a863a,_0x44d1de){return function(_0x571335){_0x44d1de[_0x6ca6('0x2')](_0x1a863a,_0x571335);};}function removeListener(_0x4b1a10,_0x3ab489){return function(){OpenchannelAccountEvents['removeListener'](_0x4b1a10,_0x3ab489);};}exports[_0x6ca6('0x3')]=function(_0x27d8c6){for(var _0x34836f=0x0,_0x44019c=events[_0x6ca6('0x4')];_0x34836f<_0x44019c;_0x34836f++){var _0x27a210=events[_0x34836f];var _0x27d280=createListener('openchannelAccount:'+_0x27a210,_0x27d8c6);OpenchannelAccountEvents['on'](_0x27a210,_0x27d280);}}; \ No newline at end of file +var _0x3360=['register','length','openchannelAccount:','./openchannelAccount.events','save','removeListener'];(function(_0xf6c699,_0x41ead6){var _0x46fbef=function(_0x3fdf50){while(--_0x3fdf50){_0xf6c699['push'](_0xf6c699['shift']());}};_0x46fbef(++_0x41ead6);}(_0x3360,0x1d7));var _0x0336=function(_0x335b86,_0x2f9f34){_0x335b86=_0x335b86-0x0;var _0x2438bb=_0x3360[_0x335b86];return _0x2438bb;};'use strict';var OpenchannelAccountEvents=require(_0x0336('0x0'));var events=[_0x0336('0x1'),'remove','update'];function createListener(_0x5882e7,_0x12fd21){return function(_0x56bf8b){_0x12fd21['emit'](_0x5882e7,_0x56bf8b);};}function removeListener(_0x472555,_0xeb42d1){return function(){OpenchannelAccountEvents[_0x0336('0x2')](_0x472555,_0xeb42d1);};}exports[_0x0336('0x3')]=function(_0x340a8a){for(var _0x4aed6a=0x0,_0x4890e5=events[_0x0336('0x4')];_0x4aed6a<_0x4890e5;_0x4aed6a++){var _0x36a973=events[_0x4aed6a];var _0x310327=createListener(_0x0336('0x5')+_0x36a973,_0x340a8a);OpenchannelAccountEvents['on'](_0x36a973,_0x310327);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 0a7c1b7..94208f9 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 _0xab97=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','isAuthenticated','index','/:id','show','post','put','delete','destroy'];(function(_0x15fd5d,_0x9dff69){var _0x10f87e=function(_0x480eaf){while(--_0x480eaf){_0x15fd5d['push'](_0x15fd5d['shift']());}};_0x10f87e(++_0x9dff69);}(_0xab97,0x1bb));var _0x7ab9=function(_0x3f70d4,_0x552cdf){_0x3f70d4=_0x3f70d4-0x0;var _0x13bc23=_0xab97[_0x3f70d4];return _0x13bc23;};'use strict';var multer=require('multer');var util=require(_0x7ab9('0x0'));var path=require(_0x7ab9('0x1'));var timeout=require(_0x7ab9('0x2'));var express=require(_0x7ab9('0x3'));var router=express['Router']();var fs_extra=require(_0x7ab9('0x4'));var auth=require(_0x7ab9('0x5'));var interaction=require(_0x7ab9('0x6'));var config=require('../../config/environment');var controller=require(_0x7ab9('0x7'));router['get']('/',auth[_0x7ab9('0x8')](),controller[_0x7ab9('0x9')]);router['get'](_0x7ab9('0xa'),auth[_0x7ab9('0x8')](),controller[_0x7ab9('0xb')]);router[_0x7ab9('0xc')]('/',auth[_0x7ab9('0x8')](),controller['create']);router[_0x7ab9('0xd')](_0x7ab9('0xa'),auth[_0x7ab9('0x8')](),controller['update']);router[_0x7ab9('0xe')](_0x7ab9('0xa'),auth['isAuthenticated'](),controller[_0x7ab9('0xf')]);module[_0x7ab9('0x10')]=router; \ No newline at end of file +var _0xf349=['../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xf349,0x67));var _0x9f34=function(_0x8fb7a4,_0x607700){_0x8fb7a4=_0x8fb7a4-0x0;var _0x1fdca2=_0xf349[_0x8fb7a4];return _0x1fdca2;};'use strict';var multer=require(_0x9f34('0x0'));var util=require(_0x9f34('0x1'));var path=require(_0x9f34('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f34('0x3'));var router=express[_0x9f34('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9f34('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9f34('0x6'));var controller=require(_0x9f34('0x7'));router[_0x9f34('0x8')]('/',auth[_0x9f34('0x9')](),controller[_0x9f34('0xa')]);router[_0x9f34('0x8')](_0x9f34('0xb'),auth['isAuthenticated'](),controller[_0x9f34('0xc')]);router[_0x9f34('0xd')]('/',auth[_0x9f34('0x9')](),controller[_0x9f34('0xe')]);router[_0x9f34('0xf')](_0x9f34('0xb'),auth[_0x9f34('0x9')](),controller['update']);router['delete'](_0x9f34('0xb'),auth[_0x9f34('0x9')](),controller[_0x9f34('0x10')]);module[_0x9f34('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 4b63e14..44c8a79 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 _0xb6e9=['INTEGER','STRING','TEXT','sequelize','exports'];(function(_0x22f4e4,_0x16841b){var _0x325131=function(_0x3647f1){while(--_0x3647f1){_0x22f4e4['push'](_0x22f4e4['shift']());}};_0x325131(++_0x16841b);}(_0xb6e9,0x189));var _0x9b6e=function(_0x1a0030,_0x57793e){_0x1a0030=_0x1a0030-0x0;var _0x589db7=_0xb6e9[_0x1a0030];return _0x589db7;};'use strict';var Sequelize=require(_0x9b6e('0x0'));module[_0x9b6e('0x1')]={'priority':{'type':Sequelize[_0x9b6e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9b6e('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9b6e('0x4')]()},'description':{'type':Sequelize[_0x9b6e('0x3')]},'interval':{'type':Sequelize[_0x9b6e('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x126a=['TEXT','*,*,*,*','exports','STRING'];(function(_0x21f8e7,_0x5d8329){var _0x31a75d=function(_0x509c1d){while(--_0x509c1d){_0x21f8e7['push'](_0x21f8e7['shift']());}};_0x31a75d(++_0x5d8329);}(_0x126a,0x12a));var _0xa126=function(_0x5b8409,_0x11eac2){_0x5b8409=_0x5b8409-0x0;var _0x434163=_0x126a[_0x5b8409];return _0x434163;};'use strict';var Sequelize=require('sequelize');module[_0xa126('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xa126('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa126('0x2')]()},'description':{'type':Sequelize[_0xa126('0x1')]},'interval':{'type':Sequelize[_0xa126('0x1')],'defaultValue':_0xa126('0x3')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 936acc5..fb861b0 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 _0x2d8a=['to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','name','index','map','OpenchannelApplication','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','fast-json-patch','bluebird','path','sox'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2d8a,0x149));var _0xa2d8=function(_0x5968aa,_0x522247){_0x5968aa=_0x5968aa-0x0;var _0x9cab36=_0x2d8a[_0x5968aa];return _0x9cab36;};'use strict';var emlformat=require(_0xa2d8('0x0'));var rimraf=require(_0xa2d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa2d8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa2d8('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa2d8('0x4'));var sox=require(_0xa2d8('0x5'));var csv=require(_0xa2d8('0x6'));var ejs=require(_0xa2d8('0x7'));var fs=require('fs');var fs_extra=require(_0xa2d8('0x8'));var _=require(_0xa2d8('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa2d8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa2d8('0x6'));var querystring=require(_0xa2d8('0xb'));var Papa=require(_0xa2d8('0xc'));var Redis=require(_0xa2d8('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa2d8('0xe'));var as=require(_0xa2d8('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2d8('0x10'))('api');var utils=require(_0xa2d8('0x11'));var config=require(_0xa2d8('0x12'));var licenseUtil=require(_0xa2d8('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bfae0,_0x76cab0){_0x76cab0=_0x76cab0||0xcc;return function(_0x4b505d){if(_0x4b505d){return _0x3bfae0[_0xa2d8('0x14')](_0x76cab0);}return _0x3bfae0[_0xa2d8('0x15')](_0x76cab0)[_0xa2d8('0x16')]();};}function respondWithResult(_0x3e7812,_0x23f172){_0x23f172=_0x23f172||0xc8;return function(_0x3db36c){if(_0x3db36c){return _0x3e7812[_0xa2d8('0x15')](_0x23f172)[_0xa2d8('0x17')](_0x3db36c);}};}function respondWithFilteredResult(_0x57b072,_0x48ceea){return function(_0x574168){if(_0x574168){var _0x1c5944=typeof _0x48ceea[_0xa2d8('0x18')]==='undefined'&&typeof _0x48ceea[_0xa2d8('0x19')]===_0xa2d8('0x1a');var _0x316f85=_0x574168['count'];var _0x47b1e6=_0x1c5944?0x0:_0x48ceea[_0xa2d8('0x18')];var _0x5a735a=_0x1c5944?_0x574168[_0xa2d8('0x1b')]:_0x48ceea[_0xa2d8('0x18')]+_0x48ceea['limit'];var _0x6c8b1a;if(_0x5a735a>=_0x316f85){_0x5a735a=_0x316f85;_0x6c8b1a=0xc8;}else{_0x6c8b1a=0xce;}_0x57b072['status'](_0x6c8b1a);return _0x57b072[_0xa2d8('0x1c')]('Content-Range',_0x47b1e6+'-'+_0x5a735a+'/'+_0x316f85)['json'](_0x574168);}return null;};}function patchUpdates(_0x154f93){return function(_0x2c0db8){try{jsonpatch[_0xa2d8('0x1d')](_0x2c0db8,_0x154f93,!![]);}catch(_0x1d7e5d){return BPromise[_0xa2d8('0x1e')](_0x1d7e5d);}return _0x2c0db8['save']();};}function saveUpdates(_0x208346,_0x5a30f4){return function(_0x14b087){if(_0x14b087){return _0x14b087[_0xa2d8('0x1f')](_0x208346)[_0xa2d8('0x20')](function(_0x53a95c){return _0x53a95c;});}return null;};}function removeEntity(_0x540ed5,_0x260b2a){return function(_0x4ec174){if(_0x4ec174){return _0x4ec174[_0xa2d8('0x21')]()[_0xa2d8('0x20')](function(){_0x540ed5[_0xa2d8('0x15')](0xcc)[_0xa2d8('0x16')]();});}};}function handleEntityNotFound(_0x37fc62,_0x2bfe1f){return function(_0x36cd1d){if(!_0x36cd1d){_0x37fc62['sendStatus'](0x194);}return _0x36cd1d;};}function handleError(_0x1d98a5,_0x365f9c){_0x365f9c=_0x365f9c||0x1f4;return function(_0x46b05a){logger[_0xa2d8('0x22')](_0x46b05a['stack']);if(_0x46b05a[_0xa2d8('0x23')]){delete _0x46b05a[_0xa2d8('0x23')];}_0x1d98a5['status'](_0x365f9c)['send'](_0x46b05a);};}exports[_0xa2d8('0x24')]=function(_0x4f5622,_0x16b702){var _0x1311a0={},_0x387428={},_0x4c9106={'count':0x0,'rows':[]};var _0x4f6871=_[_0xa2d8('0x25')](db[_0xa2d8('0x26')][_0xa2d8('0x27')],function(_0x47c16f){return{'name':_0x47c16f['fieldName'],'type':_0x47c16f[_0xa2d8('0x28')][_0xa2d8('0x29')]};});_0x387428['model']=_[_0xa2d8('0x25')](_0x4f6871,_0xa2d8('0x23'));_0x387428[_0xa2d8('0x2a')]=_['keys'](_0x4f5622[_0xa2d8('0x2a')]);_0x387428[_0xa2d8('0x2b')]=_['intersection'](_0x387428[_0xa2d8('0x2c')],_0x387428['query']);_0x1311a0[_0xa2d8('0x2d')]=_[_0xa2d8('0x2e')](_0x387428[_0xa2d8('0x2c')],qs[_0xa2d8('0x2f')](_0x4f5622[_0xa2d8('0x2a')][_0xa2d8('0x2f')]));_0x1311a0[_0xa2d8('0x2d')]=_0x1311a0[_0xa2d8('0x2d')]['length']?_0x1311a0[_0xa2d8('0x2d')]:_0x387428[_0xa2d8('0x2c')];if(!_0x4f5622[_0xa2d8('0x2a')]['hasOwnProperty']('nolimit')){_0x1311a0[_0xa2d8('0x19')]=qs[_0xa2d8('0x19')](_0x4f5622[_0xa2d8('0x2a')][_0xa2d8('0x19')]);_0x1311a0[_0xa2d8('0x18')]=qs[_0xa2d8('0x18')](_0x4f5622[_0xa2d8('0x2a')][_0xa2d8('0x18')]);}_0x1311a0[_0xa2d8('0x30')]=qs[_0xa2d8('0x31')](_0x4f5622[_0xa2d8('0x2a')]['sort']);_0x1311a0[_0xa2d8('0x32')]=qs[_0xa2d8('0x2b')](_[_0xa2d8('0x33')](_0x4f5622[_0xa2d8('0x2a')],_0x387428['filters']),_0x4f6871);if(_0x4f5622[_0xa2d8('0x2a')][_0xa2d8('0x34')]){_0x1311a0[_0xa2d8('0x32')]=_['merge'](_0x1311a0[_0xa2d8('0x32')],{'$or':_['map'](_0x4f6871,function(_0x39c98a){if(_0x39c98a['type']!=='VIRTUAL'){var _0x2b323d={};_0x2b323d[_0x39c98a[_0xa2d8('0x23')]]={'$like':'%'+_0x4f5622[_0xa2d8('0x2a')][_0xa2d8('0x34')]+'%'};return _0x2b323d;}})});}_0x1311a0=_[_0xa2d8('0x35')]({},_0x1311a0,_0x4f5622[_0xa2d8('0x36')]);var _0xb0539e={'where':_0x1311a0[_0xa2d8('0x32')]};return db[_0xa2d8('0x26')][_0xa2d8('0x1b')](_0xb0539e)['then'](function(_0x149429){_0x4c9106[_0xa2d8('0x1b')]=_0x149429;if(_0x4f5622[_0xa2d8('0x2a')][_0xa2d8('0x37')]){_0x1311a0[_0xa2d8('0x38')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xa2d8('0x39')](_0x1311a0);})['then'](function(_0x39a565){_0x4c9106[_0xa2d8('0x3a')]=_0x39a565;return _0x4c9106;})[_0xa2d8('0x20')](respondWithFilteredResult(_0x16b702,_0x1311a0))[_0xa2d8('0x3b')](handleError(_0x16b702,null));};exports[_0xa2d8('0x3c')]=function(_0x591b1d,_0x45c612){var _0x129c37={'raw':!![],'where':{'id':_0x591b1d[_0xa2d8('0x3d')]['id']}},_0x3dac71={};_0x3dac71['model']=_[_0xa2d8('0x3e')](db[_0xa2d8('0x26')][_0xa2d8('0x27')]);_0x3dac71[_0xa2d8('0x2a')]=_[_0xa2d8('0x3e')](_0x591b1d[_0xa2d8('0x2a')]);_0x3dac71['filters']=_[_0xa2d8('0x2e')](_0x3dac71[_0xa2d8('0x2c')],_0x3dac71[_0xa2d8('0x2a')]);_0x129c37[_0xa2d8('0x2d')]=_[_0xa2d8('0x2e')](_0x3dac71[_0xa2d8('0x2c')],qs['fields'](_0x591b1d[_0xa2d8('0x2a')][_0xa2d8('0x2f')]));_0x129c37[_0xa2d8('0x2d')]=_0x129c37[_0xa2d8('0x2d')][_0xa2d8('0x3f')]?_0x129c37[_0xa2d8('0x2d')]:_0x3dac71['model'];if(_0x591b1d[_0xa2d8('0x2a')][_0xa2d8('0x37')]){_0x129c37['include']=[{'all':!![]}];}_0x129c37=_[_0xa2d8('0x35')]({},_0x129c37,_0x591b1d[_0xa2d8('0x36')]);return db['OpenchannelApplication'][_0xa2d8('0x40')](_0x129c37)[_0xa2d8('0x20')](handleEntityNotFound(_0x45c612,null))[_0xa2d8('0x20')](respondWithResult(_0x45c612,null))[_0xa2d8('0x3b')](handleError(_0x45c612,null));};exports[_0xa2d8('0x41')]=function(_0x533300,_0x4da02c){return db[_0xa2d8('0x26')][_0xa2d8('0x41')](_0x533300[_0xa2d8('0x42')],{})[_0xa2d8('0x20')](respondWithResult(_0x4da02c,0xc9))[_0xa2d8('0x3b')](handleError(_0x4da02c,null));};exports[_0xa2d8('0x1f')]=function(_0x49f5ff,_0xc42297){if(_0x49f5ff['body']['id']){delete _0x49f5ff[_0xa2d8('0x42')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x49f5ff['params']['id']}})['then'](handleEntityNotFound(_0xc42297,null))[_0xa2d8('0x20')](saveUpdates(_0x49f5ff[_0xa2d8('0x42')],null))[_0xa2d8('0x20')](respondWithResult(_0xc42297,null))[_0xa2d8('0x3b')](handleError(_0xc42297,null));};exports[_0xa2d8('0x21')]=function(_0x1b6a32,_0x2428d8){return db[_0xa2d8('0x26')][_0xa2d8('0x40')]({'where':{'id':_0x1b6a32[_0xa2d8('0x3d')]['id']}})[_0xa2d8('0x20')](handleEntityNotFound(_0x2428d8,null))[_0xa2d8('0x20')](removeEntity(_0x2428d8,null))[_0xa2d8('0x3b')](handleError(_0x2428d8,null));}; \ No newline at end of file +var _0x2350=['params','find','create','body','update','eml-format','rimraf','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','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','destroy','then','error','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','options','includeAll','include','rows','catch','show'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x2350,0x172));var _0x0235=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0x2350[_0x37a79c];return _0x561d89;};'use strict';var emlformat=require(_0x0235('0x0'));var rimraf=require(_0x0235('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0235('0x2'));var rp=require(_0x0235('0x3'));var moment=require(_0x0235('0x4'));var BPromise=require(_0x0235('0x5'));var Mustache=require(_0x0235('0x6'));var util=require('util');var path=require(_0x0235('0x7'));var sox=require(_0x0235('0x8'));var csv=require(_0x0235('0x9'));var ejs=require(_0x0235('0xa'));var fs=require('fs');var fs_extra=require(_0x0235('0xb'));var _=require('lodash');var squel=require(_0x0235('0xc'));var crypto=require(_0x0235('0xd'));var jsforce=require(_0x0235('0xe'));var deskjs=require(_0x0235('0xf'));var toCsv=require(_0x0235('0x9'));var querystring=require(_0x0235('0x10'));var Papa=require(_0x0235('0x11'));var Redis=require(_0x0235('0x12'));var authService=require(_0x0235('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0235('0x14'));var logger=require(_0x0235('0x15'))('api');var utils=require(_0x0235('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0235('0x17'));var db=require(_0x0235('0x18'))['db'];function respondWithStatusCode(_0x141ed7,_0x15a357){_0x15a357=_0x15a357||0xcc;return function(_0x31cd71){if(_0x31cd71){return _0x141ed7[_0x0235('0x19')](_0x15a357);}return _0x141ed7[_0x0235('0x1a')](_0x15a357)[_0x0235('0x1b')]();};}function respondWithResult(_0xc42c0e,_0x2caa6e){_0x2caa6e=_0x2caa6e||0xc8;return function(_0x209c16){if(_0x209c16){return _0xc42c0e[_0x0235('0x1a')](_0x2caa6e)[_0x0235('0x1c')](_0x209c16);}};}function respondWithFilteredResult(_0x176416,_0xf397b3){return function(_0x374bc4){if(_0x374bc4){var _0x287512=typeof _0xf397b3[_0x0235('0x1d')]===_0x0235('0x1e')&&typeof _0xf397b3[_0x0235('0x1f')]===_0x0235('0x1e');var _0x295dd7=_0x374bc4[_0x0235('0x20')];var _0x28ff85=_0x287512?0x0:_0xf397b3['offset'];var _0x37fe76=_0x287512?_0x374bc4[_0x0235('0x20')]:_0xf397b3['offset']+_0xf397b3['limit'];var _0x4cab4b;if(_0x37fe76>=_0x295dd7){_0x37fe76=_0x295dd7;_0x4cab4b=0xc8;}else{_0x4cab4b=0xce;}_0x176416['status'](_0x4cab4b);return _0x176416['set']('Content-Range',_0x28ff85+'-'+_0x37fe76+'/'+_0x295dd7)[_0x0235('0x1c')](_0x374bc4);}return null;};}function patchUpdates(_0x58e2a1){return function(_0x2475fe){try{jsonpatch[_0x0235('0x21')](_0x2475fe,_0x58e2a1,!![]);}catch(_0x18e0e8){return BPromise[_0x0235('0x22')](_0x18e0e8);}return _0x2475fe[_0x0235('0x23')]();};}function saveUpdates(_0x2af354,_0x908584){return function(_0x199d5c){if(_0x199d5c){return _0x199d5c['update'](_0x2af354)['then'](function(_0x226dda){return _0x226dda;});}return null;};}function removeEntity(_0x19b5fe,_0x1bba35){return function(_0x30a4c5){if(_0x30a4c5){return _0x30a4c5[_0x0235('0x24')]()[_0x0235('0x25')](function(){_0x19b5fe['status'](0xcc)[_0x0235('0x1b')]();});}};}function handleEntityNotFound(_0x151aa9,_0xe55d73){return function(_0x48f3b7){if(!_0x48f3b7){_0x151aa9['sendStatus'](0x194);}return _0x48f3b7;};}function handleError(_0x22706e,_0x1c0fa4){_0x1c0fa4=_0x1c0fa4||0x1f4;return function(_0x2fccc8){logger[_0x0235('0x26')](_0x2fccc8[_0x0235('0x27')]);if(_0x2fccc8[_0x0235('0x28')]){delete _0x2fccc8[_0x0235('0x28')];}_0x22706e[_0x0235('0x1a')](_0x1c0fa4)['send'](_0x2fccc8);};}exports[_0x0235('0x29')]=function(_0x592d50,_0x61d59a){var _0x15bdc8={},_0x589a3a={},_0x46ec41={'count':0x0,'rows':[]};var _0x3a598c=_[_0x0235('0x2a')](db[_0x0235('0x2b')][_0x0235('0x2c')],function(_0x37d2e6){return{'name':_0x37d2e6[_0x0235('0x2d')],'type':_0x37d2e6['type'][_0x0235('0x2e')]};});_0x589a3a[_0x0235('0x2f')]=_[_0x0235('0x2a')](_0x3a598c,'name');_0x589a3a[_0x0235('0x30')]=_[_0x0235('0x31')](_0x592d50[_0x0235('0x30')]);_0x589a3a[_0x0235('0x32')]=_[_0x0235('0x33')](_0x589a3a['model'],_0x589a3a[_0x0235('0x30')]);_0x15bdc8[_0x0235('0x34')]=_[_0x0235('0x33')](_0x589a3a[_0x0235('0x2f')],qs[_0x0235('0x35')](_0x592d50[_0x0235('0x30')][_0x0235('0x35')]));_0x15bdc8['attributes']=_0x15bdc8[_0x0235('0x34')][_0x0235('0x36')]?_0x15bdc8[_0x0235('0x34')]:_0x589a3a[_0x0235('0x2f')];if(!_0x592d50[_0x0235('0x30')][_0x0235('0x37')]('nolimit')){_0x15bdc8[_0x0235('0x1f')]=qs['limit'](_0x592d50[_0x0235('0x30')][_0x0235('0x1f')]);_0x15bdc8[_0x0235('0x1d')]=qs[_0x0235('0x1d')](_0x592d50[_0x0235('0x30')][_0x0235('0x1d')]);}_0x15bdc8[_0x0235('0x38')]=qs[_0x0235('0x39')](_0x592d50[_0x0235('0x30')]['sort']);_0x15bdc8[_0x0235('0x3a')]=qs[_0x0235('0x32')](_['pick'](_0x592d50[_0x0235('0x30')],_0x589a3a[_0x0235('0x32')]),_0x3a598c);if(_0x592d50['query'][_0x0235('0x3b')]){_0x15bdc8['where']=_[_0x0235('0x3c')](_0x15bdc8[_0x0235('0x3a')],{'$or':_['map'](_0x3a598c,function(_0x51c1ad){if(_0x51c1ad[_0x0235('0x3d')]!=='VIRTUAL'){var _0x3ee475={};_0x3ee475[_0x51c1ad[_0x0235('0x28')]]={'$like':'%'+_0x592d50[_0x0235('0x30')]['filter']+'%'};return _0x3ee475;}})});}_0x15bdc8=_[_0x0235('0x3c')]({},_0x15bdc8,_0x592d50[_0x0235('0x3e')]);var _0x2e0a99={'where':_0x15bdc8[_0x0235('0x3a')]};return db[_0x0235('0x2b')][_0x0235('0x20')](_0x2e0a99)[_0x0235('0x25')](function(_0x2e8d30){_0x46ec41[_0x0235('0x20')]=_0x2e8d30;if(_0x592d50[_0x0235('0x30')][_0x0235('0x3f')]){_0x15bdc8[_0x0235('0x40')]=[{'all':!![]}];}return db[_0x0235('0x2b')]['findAll'](_0x15bdc8);})[_0x0235('0x25')](function(_0x5915ab){_0x46ec41[_0x0235('0x41')]=_0x5915ab;return _0x46ec41;})['then'](respondWithFilteredResult(_0x61d59a,_0x15bdc8))[_0x0235('0x42')](handleError(_0x61d59a,null));};exports[_0x0235('0x43')]=function(_0xd1aa4,_0x323837){var _0xd7c6ca={'raw':!![],'where':{'id':_0xd1aa4[_0x0235('0x44')]['id']}},_0x4fa26b={};_0x4fa26b['model']=_[_0x0235('0x31')](db[_0x0235('0x2b')][_0x0235('0x2c')]);_0x4fa26b[_0x0235('0x30')]=_[_0x0235('0x31')](_0xd1aa4[_0x0235('0x30')]);_0x4fa26b[_0x0235('0x32')]=_[_0x0235('0x33')](_0x4fa26b['model'],_0x4fa26b[_0x0235('0x30')]);_0xd7c6ca['attributes']=_['intersection'](_0x4fa26b[_0x0235('0x2f')],qs[_0x0235('0x35')](_0xd1aa4['query'][_0x0235('0x35')]));_0xd7c6ca[_0x0235('0x34')]=_0xd7c6ca[_0x0235('0x34')]['length']?_0xd7c6ca[_0x0235('0x34')]:_0x4fa26b[_0x0235('0x2f')];if(_0xd1aa4['query'][_0x0235('0x3f')]){_0xd7c6ca[_0x0235('0x40')]=[{'all':!![]}];}_0xd7c6ca=_['merge']({},_0xd7c6ca,_0xd1aa4[_0x0235('0x3e')]);return db[_0x0235('0x2b')][_0x0235('0x45')](_0xd7c6ca)[_0x0235('0x25')](handleEntityNotFound(_0x323837,null))[_0x0235('0x25')](respondWithResult(_0x323837,null))['catch'](handleError(_0x323837,null));};exports[_0x0235('0x46')]=function(_0x5e6bbb,_0xc70f5b){return db[_0x0235('0x2b')][_0x0235('0x46')](_0x5e6bbb[_0x0235('0x47')],{})[_0x0235('0x25')](respondWithResult(_0xc70f5b,0xc9))[_0x0235('0x42')](handleError(_0xc70f5b,null));};exports[_0x0235('0x48')]=function(_0x9c2c12,_0x2cbc09){if(_0x9c2c12[_0x0235('0x47')]['id']){delete _0x9c2c12[_0x0235('0x47')]['id'];}return db[_0x0235('0x2b')][_0x0235('0x45')]({'where':{'id':_0x9c2c12[_0x0235('0x44')]['id']}})[_0x0235('0x25')](handleEntityNotFound(_0x2cbc09,null))['then'](saveUpdates(_0x9c2c12[_0x0235('0x47')],null))[_0x0235('0x25')](respondWithResult(_0x2cbc09,null))[_0x0235('0x42')](handleError(_0x2cbc09,null));};exports[_0x0235('0x24')]=function(_0x1599d2,_0x28e806){return db[_0x0235('0x2b')][_0x0235('0x45')]({'where':{'id':_0x1599d2[_0x0235('0x44')]['id']}})[_0x0235('0x25')](handleEntityNotFound(_0x28e806,null))['then'](removeEntity(_0x28e806,null))[_0x0235('0x42')](handleError(_0x28e806,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 2d29a3e..31b2e7e 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 _0xbe4d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xbe4d,0xad));var _0xdbe4=function(_0x14dfb7,_0x1fc019){_0x14dfb7=_0x14dfb7-0x0;var _0x5b9373=_0xbe4d[_0x14dfb7];return _0x5b9373;};'use strict';var _=require('lodash');var util=require(_0xdbe4('0x0'));var logger=require(_0xdbe4('0x1'))(_0xdbe4('0x2'));var moment=require(_0xdbe4('0x3'));var BPromise=require(_0xdbe4('0x4'));var rp=require(_0xdbe4('0x5'));var fs=require('fs');var path=require(_0xdbe4('0x6'));var rimraf=require(_0xdbe4('0x7'));var config=require(_0xdbe4('0x8'));var attributes=require(_0xdbe4('0x9'));module[_0xdbe4('0xa')]=function(_0xf52379,_0x55bf92){return _0xf52379[_0xdbe4('0xb')](_0xdbe4('0xc'),attributes,{'tableName':_0xdbe4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdbe4('0xe'),'collate':_0xdbe4('0xf')});}; \ No newline at end of file +var _0x2781=['utf8mb4','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications'];(function(_0x5c4a87,_0x1e4c1a){var _0x9fde42=function(_0xd3c0b3){while(--_0xd3c0b3){_0x5c4a87['push'](_0x5c4a87['shift']());}};_0x9fde42(++_0x1e4c1a);}(_0x2781,0xf8));var _0x1278=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x2781[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x1278('0x0'));var util=require(_0x1278('0x1'));var logger=require('../../config/logger')(_0x1278('0x2'));var moment=require(_0x1278('0x3'));var BPromise=require('bluebird');var rp=require(_0x1278('0x4'));var fs=require('fs');var path=require(_0x1278('0x5'));var rimraf=require(_0x1278('0x6'));var config=require(_0x1278('0x7'));var attributes=require(_0x1278('0x8'));module[_0x1278('0x9')]=function(_0x19d891,_0x3c6168){return _0x19d891['define'](_0x1278('0xa'),attributes,{'tableName':_0x1278('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1278('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 5bc5752..c9b1269 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 _0xebe6=['body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication'];(function(_0x2f7c40,_0xb36203){var _0x57a4a5=function(_0x47db35){while(--_0x47db35){_0x2f7c40['push'](_0x2f7c40['shift']());}};_0x57a4a5(++_0xb36203);}(_0xebe6,0x1f0));var _0x6ebe=function(_0x46891a,_0x3e3051){_0x46891a=_0x46891a-0x0;var _0x4c578d=_0xebe6[_0x46891a];return _0x4c578d;};'use strict';var _=require(_0x6ebe('0x0'));var util=require(_0x6ebe('0x1'));var moment=require(_0x6ebe('0x2'));var BPromise=require(_0x6ebe('0x3'));var rs=require(_0x6ebe('0x4'));var fs=require('fs');var Redis=require(_0x6ebe('0x5'));var db=require(_0x6ebe('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ebe('0x7'))('rpc');var config=require(_0x6ebe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6ebe('0x9')][_0x6ebe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4517f1,_0x4ef648,_0x1ba205){return new BPromise(function(_0x589951,_0x545140){return client[_0x6ebe('0xb')](_0x4517f1,_0x1ba205)[_0x6ebe('0xc')](function(_0xfd2ba3){logger[_0x6ebe('0xd')](_0x6ebe('0xe'),_0x4ef648,_0x6ebe('0xf'));logger[_0x6ebe('0x10')](_0x6ebe('0x11'),_0x4ef648,_0x6ebe('0xf'),JSON[_0x6ebe('0x12')](_0xfd2ba3));if(_0xfd2ba3[_0x6ebe('0x13')]){if(_0xfd2ba3[_0x6ebe('0x13')][_0x6ebe('0x14')]===0x1f4){logger['error'](_0x6ebe('0xe'),_0x4ef648,_0xfd2ba3[_0x6ebe('0x13')][_0x6ebe('0x15')]);return _0x545140(_0xfd2ba3[_0x6ebe('0x13')][_0x6ebe('0x15')]);}logger[_0x6ebe('0x13')](_0x6ebe('0xe'),_0x4ef648,_0xfd2ba3[_0x6ebe('0x13')][_0x6ebe('0x15')]);return _0x589951(_0xfd2ba3['error']['message']);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x4ef648,'request\x20sent');_0x589951(_0xfd2ba3[_0x6ebe('0x16')][_0x6ebe('0x15')]);}})[_0x6ebe('0x17')](function(_0x1fcb45){logger[_0x6ebe('0x13')](_0x6ebe('0xe'),_0x4ef648,_0x1fcb45);_0x545140(_0x1fcb45);});});}exports[_0x6ebe('0x18')]=function(_0x26bab4){var _0xc3b801=this;return new Promise(function(_0x4fc253,_0x438798){return db[_0x6ebe('0x19')]['update'](_0x26bab4[_0x6ebe('0x1a')],{'raw':_0x26bab4[_0x6ebe('0x1b')]?_0x26bab4[_0x6ebe('0x1b')][_0x6ebe('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26bab4[_0x6ebe('0x1b')]?_0x26bab4['options']['where']||null:null,'attributes':_0x26bab4[_0x6ebe('0x1b')]?_0x26bab4[_0x6ebe('0x1b')]['attributes']||null:null,'limit':_0x26bab4['options']?_0x26bab4[_0x6ebe('0x1b')]['limit']||null:null})['then'](function(_0x2ce4fb){logger['info']('UpdateOpenchannelApplication',_0x26bab4);logger[_0x6ebe('0x10')](_0x6ebe('0x18'),_0x26bab4,JSON[_0x6ebe('0x12')](_0x2ce4fb));_0x4fc253(_0x2ce4fb);})[_0x6ebe('0x17')](function(_0x16ee58){logger[_0x6ebe('0x13')](_0x6ebe('0x18'),_0x16ee58[_0x6ebe('0x15')],_0x26bab4);_0x438798(_0xc3b801[_0x6ebe('0x13')](0x1f4,_0x16ee58['message']));});});}; \ No newline at end of file +var _0x2f7b=['UpdateOpenchannelApplication','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','OpenchannelApplication','update','options','attributes','limit','then'];(function(_0x52bae5,_0x4e66e4){var _0x1bcd4b=function(_0xfacc54){while(--_0xfacc54){_0x52bae5['push'](_0x52bae5['shift']());}};_0x1bcd4b(++_0x4e66e4);}(_0x2f7b,0x1d5));var _0xb2f7=function(_0xdc8d0a,_0x3b36fd){_0xdc8d0a=_0xdc8d0a-0x0;var _0x7c3fd0=_0x2f7b[_0xdc8d0a];return _0x7c3fd0;};'use strict';var _=require('lodash');var util=require(_0xb2f7('0x0'));var moment=require('moment');var BPromise=require(_0xb2f7('0x1'));var rs=require(_0xb2f7('0x2'));var fs=require('fs');var Redis=require(_0xb2f7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb2f7('0x4'));var logger=require(_0xb2f7('0x5'))(_0xb2f7('0x6'));var config=require(_0xb2f7('0x7'));var jayson=require(_0xb2f7('0x8'));var client=jayson['client'][_0xb2f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbede27,_0xe73491,_0x49e16b){return new BPromise(function(_0x5a6372,_0x275a1b){return client['request'](_0xbede27,_0x49e16b)['then'](function(_0x5dc227){logger[_0xb2f7('0xa')]('OpenchannelApplication,\x20%s,\x20%s',_0xe73491,_0xb2f7('0xb'));logger[_0xb2f7('0xc')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0xe73491,'request\x20sent',JSON[_0xb2f7('0xd')](_0x5dc227));if(_0x5dc227[_0xb2f7('0xe')]){if(_0x5dc227[_0xb2f7('0xe')][_0xb2f7('0xf')]===0x1f4){logger[_0xb2f7('0xe')](_0xb2f7('0x10'),_0xe73491,_0x5dc227[_0xb2f7('0xe')]['message']);return _0x275a1b(_0x5dc227[_0xb2f7('0xe')][_0xb2f7('0x11')]);}logger[_0xb2f7('0xe')](_0xb2f7('0x10'),_0xe73491,_0x5dc227['error'][_0xb2f7('0x11')]);return _0x5a6372(_0x5dc227[_0xb2f7('0xe')]['message']);}else{logger[_0xb2f7('0xa')](_0xb2f7('0x10'),_0xe73491,_0xb2f7('0xb'));_0x5a6372(_0x5dc227[_0xb2f7('0x12')][_0xb2f7('0x11')]);}})['catch'](function(_0x32ba42){logger[_0xb2f7('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0xe73491,_0x32ba42);_0x275a1b(_0x32ba42);});});}exports['UpdateOpenchannelApplication']=function(_0x39c266){var _0x38948f=this;return new Promise(function(_0x4b4484,_0x5831fe){return db[_0xb2f7('0x13')][_0xb2f7('0x14')](_0x39c266['body'],{'raw':_0x39c266[_0xb2f7('0x15')]?_0x39c266['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39c266[_0xb2f7('0x15')]?_0x39c266[_0xb2f7('0x15')]['where']||null:null,'attributes':_0x39c266[_0xb2f7('0x15')]?_0x39c266[_0xb2f7('0x15')][_0xb2f7('0x16')]||null:null,'limit':_0x39c266['options']?_0x39c266[_0xb2f7('0x15')][_0xb2f7('0x17')]||null:null})[_0xb2f7('0x18')](function(_0x23cabe){logger[_0xb2f7('0xa')](_0xb2f7('0x19'),_0x39c266);logger[_0xb2f7('0xc')](_0xb2f7('0x19'),_0x39c266,JSON[_0xb2f7('0xd')](_0x23cabe));_0x4b4484(_0x23cabe);})['catch'](function(_0x34510b){logger['error']('UpdateOpenchannelApplication',_0x34510b[_0xb2f7('0x11')],_0x39c266);_0x5831fe(_0x38948f['error'](0x1f4,_0x34510b[_0xb2f7('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 54808d9..a239a2b 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 _0x5f00=['post','/:id/tags','tracked','openchannelinteraction:addtags','put','update','delete','/:id','openchannel','openchannelinteraction:destroy','destroy','removeTags','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','show','/:id/messages','getMessages','/:id/download','download'];(function(_0x1b5c09,_0x4acc27){var _0x148081=function(_0x3251b2){while(--_0x3251b2){_0x1b5c09['push'](_0x1b5c09['shift']());}};_0x148081(++_0x4acc27);}(_0x5f00,0x186));var _0x05f0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f00[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x05f0('0x0'));var path=require(_0x05f0('0x1'));var timeout=require('connect-timeout');var express=require(_0x05f0('0x2'));var router=express['Router']();var fs_extra=require(_0x05f0('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x05f0('0x4'));var config=require(_0x05f0('0x5'));var controller=require(_0x05f0('0x6'));router[_0x05f0('0x7')]('/',auth[_0x05f0('0x8')](),controller['index']);router[_0x05f0('0x7')](_0x05f0('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x05f0('0x7')]('/:id',auth[_0x05f0('0x8')](),controller[_0x05f0('0xa')]);router[_0x05f0('0x7')](_0x05f0('0xb'),auth[_0x05f0('0x8')](),controller[_0x05f0('0xc')]);router['get'](_0x05f0('0xd'),auth[_0x05f0('0x8')](),controller[_0x05f0('0xe')]);router[_0x05f0('0xf')]('/',auth[_0x05f0('0x8')](),controller['create']);router[_0x05f0('0xf')](_0x05f0('0xb'),auth[_0x05f0('0x8')](),controller['addMessage']);router[_0x05f0('0xf')](_0x05f0('0x10'),auth[_0x05f0('0x8')](),interaction[_0x05f0('0x11')]('openchannel',_0x05f0('0x12')),controller['addTags']);router[_0x05f0('0x13')]('/:id',auth[_0x05f0('0x8')](),interaction['tracked']('openchannel','openchannelinteraction:update'),controller[_0x05f0('0x14')]);router[_0x05f0('0x15')](_0x05f0('0x16'),auth[_0x05f0('0x8')](),interaction[_0x05f0('0x11')](_0x05f0('0x17'),_0x05f0('0x18')),controller[_0x05f0('0x19')]);router[_0x05f0('0x15')](_0x05f0('0x10'),auth[_0x05f0('0x8')](),controller[_0x05f0('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xb2d5=['show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x36ae90,_0x1eefbe){var _0x380c04=function(_0x55a64d){while(--_0x55a64d){_0x36ae90['push'](_0x36ae90['shift']());}};_0x380c04(++_0x1eefbe);}(_0xb2d5,0x91));var _0x5b2d=function(_0x15f8f8,_0x535a4b){_0x15f8f8=_0x15f8f8-0x0;var _0x38c5e5=_0xb2d5[_0x15f8f8];return _0x38c5e5;};'use strict';var multer=require('multer');var util=require(_0x5b2d('0x0'));var path=require(_0x5b2d('0x1'));var timeout=require(_0x5b2d('0x2'));var express=require(_0x5b2d('0x3'));var router=express['Router']();var fs_extra=require(_0x5b2d('0x4'));var auth=require(_0x5b2d('0x5'));var interaction=require(_0x5b2d('0x6'));var config=require(_0x5b2d('0x7'));var controller=require(_0x5b2d('0x8'));router[_0x5b2d('0x9')]('/',auth[_0x5b2d('0xa')](),controller[_0x5b2d('0xb')]);router['get'](_0x5b2d('0xc'),auth['isAuthenticated'](),controller[_0x5b2d('0xd')]);router[_0x5b2d('0x9')](_0x5b2d('0xe'),auth[_0x5b2d('0xa')](),controller[_0x5b2d('0xf')]);router[_0x5b2d('0x9')](_0x5b2d('0x10'),auth['isAuthenticated'](),controller[_0x5b2d('0x11')]);router['get'](_0x5b2d('0x12'),auth[_0x5b2d('0xa')](),controller[_0x5b2d('0x13')]);router['post']('/',auth[_0x5b2d('0xa')](),controller['create']);router[_0x5b2d('0x14')](_0x5b2d('0x10'),auth['isAuthenticated'](),controller[_0x5b2d('0x15')]);router[_0x5b2d('0x14')](_0x5b2d('0x16'),auth[_0x5b2d('0xa')](),interaction[_0x5b2d('0x17')]('openchannel',_0x5b2d('0x18')),controller[_0x5b2d('0x19')]);router[_0x5b2d('0x1a')]('/:id',auth[_0x5b2d('0xa')](),interaction[_0x5b2d('0x17')]('openchannel',_0x5b2d('0x1b')),controller['update']);router[_0x5b2d('0x1c')]('/:id',auth[_0x5b2d('0xa')](),interaction[_0x5b2d('0x17')]('openchannel',_0x5b2d('0x1d')),controller[_0x5b2d('0x1e')]);router['delete'](_0x5b2d('0x16'),auth['isAuthenticated'](),controller['removeTags']);module[_0x5b2d('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 5cf1375..a70062a 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 _0xecd9=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xecd9,0x13f));var _0x9ecd=function(_0x34d14d,_0x48cfff){_0x34d14d=_0x34d14d-0x0;var _0x33c5b2=_0xecd9[_0x34d14d];return _0x33c5b2;};'use strict';var Sequelize=require(_0x9ecd('0x0'));module[_0x9ecd('0x1')]={'closed':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9ecd('0x3')]},'disposition':{'type':Sequelize[_0x9ecd('0x4')]},'secondDisposition':{'type':Sequelize[_0x9ecd('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9ecd('0x4')]},'note':{'type':Sequelize[_0x9ecd('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x9ecd('0x4')]},'externalUrl':{'type':Sequelize[_0x9ecd('0x4')]},'lastMsgAt':{'type':Sequelize[_0x9ecd('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9ecd('0x5')]('in',_0x9ecd('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x44f8=['exports','BOOLEAN','STRING','DATE','ENUM','out','sequelize'];(function(_0xe19cc5,_0x7c5c3d){var _0xa6a5fb=function(_0x2124f6){while(--_0x2124f6){_0xe19cc5['push'](_0xe19cc5['shift']());}};_0xa6a5fb(++_0x7c5c3d);}(_0x44f8,0xfb));var _0x844f=function(_0xc9a460,_0x395528){_0xc9a460=_0xc9a460-0x0;var _0x209b8e=_0x44f8[_0xc9a460];return _0x209b8e;};'use strict';var Sequelize=require(_0x844f('0x0'));module[_0x844f('0x1')]={'closed':{'type':Sequelize[_0x844f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x844f('0x3')]},'secondDisposition':{'type':Sequelize[_0x844f('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x844f('0x4')]},'threadId':{'type':Sequelize[_0x844f('0x3')]},'externalUrl':{'type':Sequelize[_0x844f('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x844f('0x5')]('in',_0x844f('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x844f('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x844f('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 a293920..1745b4e 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 _0x2a15=['value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','end','Tag','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','buildExpression','some','compact','isEmpty','parse','$gte','$lte','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','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','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','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.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','push','all','rows','catch','show','params','intersection','includeAll','include','options','create','body','update','destroy','describe','addMessage','ids','omit','getMessages','OpenchannelMessage','OpenchannelInteractionId','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','openchannelInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','format','transcript-%d-%s.zip','User','CmContact','lastName','Attachment','Messages','createdAt','secret','Account','Owner','get','mkdirSync','N.A.','closedAt','disposition','threadId','Public','Private','basename','pipe','createWriteStream','direction','System','firstName','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Openchannel','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','waiting','talking','UserId','closed','answered','OpenchannelInteraction','rawAttributes','fieldName','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','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_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages'];(function(_0xa905bb,_0x554951){var _0x1a79ed=function(_0x29b944){while(--_0x29b944){_0xa905bb['push'](_0xa905bb['shift']());}};_0x1a79ed(++_0x554951);}(_0x2a15,0x96));var _0x52a1=function(_0x115c1d,_0x21c2e9){_0x115c1d=_0x115c1d-0x0;var _0x1b0bc7=_0x2a15[_0x115c1d];return _0x1b0bc7;};'use strict';var emlformat=require(_0x52a1('0x0'));var rimraf=require(_0x52a1('0x1'));var zipdir=require(_0x52a1('0x2'));var jsonpatch=require(_0x52a1('0x3'));var rp=require('request-promise');var moment=require(_0x52a1('0x4'));var BPromise=require(_0x52a1('0x5'));var Mustache=require('mustache');var util=require(_0x52a1('0x6'));var path=require(_0x52a1('0x7'));var sox=require('sox');var csv=require(_0x52a1('0x8'));var ejs=require(_0x52a1('0x9'));var fs=require('fs');var fs_extra=require(_0x52a1('0xa'));var _=require(_0x52a1('0xb'));var squel=require(_0x52a1('0xc'));var crypto=require(_0x52a1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x52a1('0xe'));var toCsv=require(_0x52a1('0x8'));var querystring=require(_0x52a1('0xf'));var Papa=require(_0x52a1('0x10'));var Redis=require(_0x52a1('0x11'));var authService=require(_0x52a1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x52a1('0x13'));var pdf=require(_0x52a1('0x14'));var hardwareService=require(_0x52a1('0x15'));var logger=require(_0x52a1('0x16'))(_0x52a1('0x17'));var utils=require(_0x52a1('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x52a1('0x19'));var db=require(_0x52a1('0x1a'))['db'];config[_0x52a1('0x1b')]=_[_0x52a1('0x1c')](config['redis'],{'host':_0x52a1('0x1d'),'port':0x18eb});var socket=require(_0x52a1('0x1e'))(new Redis(config[_0x52a1('0x1b')]));require(_0x52a1('0x1f'))[_0x52a1('0x20')](socket);function respondWithStatusCode(_0x5511bc,_0x1e5a8b){_0x1e5a8b=_0x1e5a8b||0xcc;return function(_0x4d2051){if(_0x4d2051){return _0x5511bc[_0x52a1('0x21')](_0x1e5a8b);}return _0x5511bc[_0x52a1('0x22')](_0x1e5a8b)['end']();};}function respondWithResult(_0x2d1efb,_0x36bd86){_0x36bd86=_0x36bd86||0xc8;return function(_0x5240ac){if(_0x5240ac){return _0x2d1efb[_0x52a1('0x22')](_0x36bd86)[_0x52a1('0x23')](_0x5240ac);}};}function respondWithFilteredResult(_0x314406,_0x249184){return function(_0x145d54){if(_0x145d54){var _0x45df8e=typeof _0x249184[_0x52a1('0x24')]==='undefined'&&typeof _0x249184[_0x52a1('0x25')]==='undefined';var _0x3f8d52=_0x145d54[_0x52a1('0x26')];var _0x399c9b=_0x45df8e?0x0:_0x249184[_0x52a1('0x24')];var _0x5ea749=_0x45df8e?_0x145d54['count']:_0x249184[_0x52a1('0x24')]+_0x249184[_0x52a1('0x25')];var _0x39a57d;if(_0x5ea749>=_0x3f8d52){_0x5ea749=_0x3f8d52;_0x39a57d=0xc8;}else{_0x39a57d=0xce;}_0x314406[_0x52a1('0x22')](_0x39a57d);return _0x314406[_0x52a1('0x27')](_0x52a1('0x28'),_0x399c9b+'-'+_0x5ea749+'/'+_0x3f8d52)[_0x52a1('0x23')](_0x145d54);}return null;};}function patchUpdates(_0x56dd3f){return function(_0x4efbe0){try{jsonpatch[_0x52a1('0x29')](_0x4efbe0,_0x56dd3f,!![]);}catch(_0x52a5fd){return BPromise[_0x52a1('0x2a')](_0x52a5fd);}return _0x4efbe0[_0x52a1('0x2b')]();};}function saveUpdates(_0x18e412,_0x1a23c6){return function(_0xb85e44){if(_0xb85e44){return _0xb85e44['update'](_0x18e412)[_0x52a1('0x2c')](function(_0x12ceae){return _0x12ceae;});}return null;};}function removeEntity(_0xa01c38,_0x133dab){return function(_0x3f2aaf){if(_0x3f2aaf){return _0x3f2aaf['destroy']()['then'](function(){_0xa01c38[_0x52a1('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1440f4,_0x5ce7c6){return function(_0x58b4ee){if(!_0x58b4ee){_0x1440f4['sendStatus'](0x194);}return _0x58b4ee;};}function handleError(_0x4d8960,_0x4730c0){_0x4730c0=_0x4730c0||0x1f4;return function(_0x100bb9){logger[_0x52a1('0x2d')](_0x100bb9[_0x52a1('0x2e')]);if(_0x100bb9[_0x52a1('0x2f')]){delete _0x100bb9['name'];}_0x4d8960[_0x52a1('0x22')](_0x4730c0)[_0x52a1('0x30')](_0x100bb9);};}function getInteractionUsers(_0x41a6fd,_0x5a7fec){return new BPromise(function(_0x1f0415,_0x2c594f){try{if(_0x5a7fec[_0x41a6fd['id']]){_0x41a6fd[_0x52a1('0x31')]=_[_0x52a1('0x32')](_0x5a7fec[_0x41a6fd['id']],function(_0x3b3207){return{'id':_0x3b3207['id'],'fullname':_0x3b3207[_0x52a1('0x33')]};});}}catch(_0xc7b4ae){_0x2c594f(_0xc7b4ae);}_0x1f0415(_0x41a6fd);});}function getInteractionTags(_0xcd0e4a,_0x4ea472){return new BPromise(function(_0x497194,_0x41ba16){try{if(_0xcd0e4a[_0x52a1('0x34')]){_0xcd0e4a[_0x52a1('0x35')]=[];_0xcd0e4a['TagIds']['split'](',')['forEach'](function(_0x2aeaa3){_0xcd0e4a['Tags']['push'](_0x4ea472[_0x2aeaa3]);});}delete _0xcd0e4a[_0x52a1('0x34')];}catch(_0x344939){_0x41ba16(_0x344939);}_0x497194(_0xcd0e4a);});}function updateOpenchannelInteraction(_0xa502dd,_0x570da6,_0x7d7c46){return new BPromise(function(_0x5bef44,_0x579dfc){return getInteractionUsers(_0xa502dd,_0x7d7c46)[_0x52a1('0x2c')](function(_0x513ad2){return getInteractionTags(_0x513ad2,_0x570da6);})[_0x52a1('0x2c')](function(_0x4090bd){return getStateInteraction(_0x4090bd);})[_0x52a1('0x2c')](function(_0x4fc8f8){_0x5bef44(_0x4fc8f8);})['catch'](function(_0x4638ea){_0x579dfc(_0x4638ea);});});}function getStateInteraction(_0x31abf6){return new BPromise(function(_0x51d35d){_0x31abf6[_0x52a1('0x36')]=0x0;_0x31abf6[_0x52a1('0x37')]=0x0;_0x31abf6['answered']=0x0;_0x31abf6['unmanaged']=0x0;_0x31abf6['total']=0x0;if(!_0x31abf6['closed']&&!_0x31abf6[_0x52a1('0x38')]){_0x31abf6[_0x52a1('0x36')]+=0x1;}if(!_0x31abf6[_0x52a1('0x39')]&&_0x31abf6[_0x52a1('0x38')]){_0x31abf6[_0x52a1('0x37')]+=0x1;if(_0x31abf6['waiting']){_0x31abf6[_0x52a1('0x36')]-=0x1;}}if(_0x31abf6[_0x52a1('0x39')]&&_0x31abf6[_0x52a1('0x38')]){_0x31abf6[_0x52a1('0x3a')]+=0x1;if(_0x31abf6[_0x52a1('0x37')]){_0x31abf6[_0x52a1('0x37')]-=0x1;}}if(_0x31abf6[_0x52a1('0x39')]&&!_0x31abf6['UserId']){_0x31abf6['unmanaged']+=0x1;if(_0x31abf6[_0x52a1('0x36')]){_0x31abf6[_0x52a1('0x36')]-=0x1;}}_0x31abf6['total']+=0x1;_0x51d35d(_0x31abf6);});}exports['index']=function(_0x4338e8,_0x8522fd){var _0x3d5477={},_0x3259af={},_0xc901c8={'count':0x0,'rows':[]};var _0x2f3393=_['map'](db[_0x52a1('0x3b')][_0x52a1('0x3c')],function(_0x1da5b6){return{'name':_0x1da5b6[_0x52a1('0x3d')],'type':_0x1da5b6['type'][_0x52a1('0x3e')]};});_0x3259af[_0x52a1('0x3f')]=_['map'](_0x2f3393,_0x52a1('0x2f'));_0x3259af[_0x52a1('0x40')]=_[_0x52a1('0x41')](_0x4338e8[_0x52a1('0x40')]);_0x3259af[_0x52a1('0x42')]=_['intersection'](_0x3259af['model'],_0x3259af[_0x52a1('0x40')]);_0x3d5477['attributes']=_['intersection'](_0x3259af[_0x52a1('0x3f')],qs[_0x52a1('0x43')](_0x4338e8['query'][_0x52a1('0x43')]));_0x3d5477[_0x52a1('0x44')]=_0x3d5477['attributes'][_0x52a1('0x45')]?_0x3d5477[_0x52a1('0x44')]:_0x3259af[_0x52a1('0x3f')];if(!_0x4338e8[_0x52a1('0x40')][_0x52a1('0x46')](_0x52a1('0x47'))){_0x3d5477[_0x52a1('0x25')]=qs[_0x52a1('0x25')](_0x4338e8[_0x52a1('0x40')]['limit']);_0x3d5477['offset']=qs[_0x52a1('0x24')](_0x4338e8[_0x52a1('0x40')][_0x52a1('0x24')]);}_0x3d5477[_0x52a1('0x48')]=qs[_0x52a1('0x49')](_0x4338e8[_0x52a1('0x40')][_0x52a1('0x49')]);_0x3d5477[_0x52a1('0x4a')]=qs['filters'](_[_0x52a1('0x4b')](_0x4338e8[_0x52a1('0x40')],_0x3259af[_0x52a1('0x42')]),_0x2f3393);var _0x22d85b=[];var _0x2ad034=squel[_0x52a1('0x4c')]()[_0x52a1('0x4d')]('id')[_0x52a1('0x4d')](_0x52a1('0x2f'))['field'](_0x52a1('0x4e'))[_0x52a1('0x4f')](_0x52a1('0x50'));var _0x3b41f8=squel['select']()[_0x52a1('0x4d')]('u.id')[_0x52a1('0x4d')](_0x52a1('0x51'))[_0x52a1('0x4d')]('ui.OpenchannelInteractionId')['from'](_0x52a1('0x52'),'ui')[_0x52a1('0x53')](_0x52a1('0x54'),'u',_0x52a1('0x55'));var _0xea5968=squel[_0x52a1('0x4c')]()['from'](_0x52a1('0x56'),'i')[_0x52a1('0x53')](_0x52a1('0x57'),'c',_0x52a1('0x58'))['left_join']('users','o',_0x52a1('0x59'))[_0x52a1('0x53')](_0x52a1('0x5a'),'a',_0x52a1('0x5b'))[_0x52a1('0x53')]('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x52a1('0x53')](_0x52a1('0x5c'),'it',_0x52a1('0x5d'))[_0x52a1('0x53')](_0x52a1('0x50'),'t',_0x52a1('0x5e'));var _0x24a492=squel[_0x52a1('0x5f')]();var _0x2c5e45=[];var _0x2a028e=squel[_0x52a1('0x5f')]();var _0x24b853;if(_0x4338e8[_0x52a1('0x40')][_0x52a1('0x60')]){_0x24b853=as[_0x52a1('0x61')](_0x4338e8['query'][_0x52a1('0x60')]);var _0x1bf25c=_0x24b853[_0x52a1('0x62')];for(var _0xa88f03=0x0;_0xa88f03<_0x24b853['conditions']['length'];_0xa88f03++){var _0x15eac6=_0x24b853[_0x52a1('0x63')][_0xa88f03];var _0x172f2a='i';var _0x2a3d10=_[_0x52a1('0x64')](_0x2f3393,[_0x52a1('0x2f'),_0x15eac6['field']]);if(!_0x2a3d10){switch(_0x15eac6[_0x52a1('0x4d')]){case _0x52a1('0x65'):if(_0x15eac6[_0x52a1('0x66')]==0x1){_0xea5968[_0x52a1('0x67')]('`'+_0x15eac6[_0x52a1('0x4d')]+'`\x20=\x200');}else{_0xea5968[_0x52a1('0x67')]('`'+_0x15eac6[_0x52a1('0x4d')]+_0x52a1('0x68'));}break;case _0x52a1('0x69'):if(_0x15eac6[_0x52a1('0x6a')]===_0x52a1('0x6b')){if(_0x15eac6[_0x52a1('0x66')]['split']('\x20')[_0x52a1('0x45')]>0x1){_0x24a492[_0x1bf25c](_0x52a1('0x6c'),qs['getFullTextValue'](_0x15eac6[_0x52a1('0x66')]),null);}else{var _0x47ae6a='%'+_0x15eac6[_0x52a1('0x66')]+'%';_0x24a492[_0x1bf25c](_0x52a1('0x6d'),_0x47ae6a,_0x47ae6a,_0x47ae6a);}}else{_0x2a3d10=_[_0x52a1('0x64')](_0x2f3393,[_0x52a1('0x2f'),_0x52a1('0x6e')]);_0x15eac6[_0x52a1('0x4d')]=_0x52a1('0x6e');_0x28970c=as['buildExpression'](_0x172f2a,_0x2a3d10['type'],_0x15eac6);_0x24a492[_0x1bf25c](_0x28970c[_0x52a1('0x6f')],_0x28970c[_0x52a1('0x66')][_0x52a1('0x70')],_0x28970c['value'][_0x52a1('0x71')]);}break;case _0x52a1('0x72'):var _0x424ad8=_0x15eac6['value'][_0x52a1('0x73')](',')[_0x52a1('0x32')](function(_0x201ee3){return Number(_0x201ee3);});_0x424ad8[_0x52a1('0x74')](function(_0x28a71c){_0x2a028e['or'](_0x52a1('0x75'),'%,'+_0x28a71c+',%');});_0x2c5e45=_['union'](_0x2c5e45,_0x424ad8);break;case'User':if(_0x15eac6[_0x52a1('0x6a')]===_0x52a1('0x6b')){_0x24a492[_0x1bf25c](_0x52a1('0x76'),'%'+_0x15eac6[_0x52a1('0x66')]+'%',null);}else{_0x2a3d10=_['find'](_0x2f3393,[_0x52a1('0x2f'),_0x52a1('0x38')]);_0x15eac6[_0x52a1('0x4d')]='UserId';_0x28970c=as['buildExpression'](_0x172f2a,_0x2a3d10[_0x52a1('0x77')],_0x15eac6);_0x24a492[_0x1bf25c](_0x28970c[_0x52a1('0x6f')],_0x28970c[_0x52a1('0x66')][_0x52a1('0x70')],_0x28970c[_0x52a1('0x66')]['end']);}break;case'body':_0x28970c=as[_0x52a1('0x78')]('me',null,_0x15eac6);_0x24a492[_0x1bf25c](_0x28970c[_0x52a1('0x6f')],_0x28970c[_0x52a1('0x66')][_0x52a1('0x70')],_0x28970c[_0x52a1('0x66')][_0x52a1('0x71')]);break;}}else{var _0x28970c=as[_0x52a1('0x78')](_0x172f2a,_0x2a3d10['type'],_0x15eac6);_0x24a492[_0x1bf25c](_0x28970c['text'],_0x28970c[_0x52a1('0x66')][_0x52a1('0x70')],_0x28970c[_0x52a1('0x66')]['end']);}}}else{var _0x388db8=_(_0x4338e8[_0x52a1('0x40')])[_0x52a1('0x41')]()[_0x52a1('0x32')](function(_0x23e255){return _[_0x52a1('0x79')](_0x2f3393,[_0x52a1('0x2f'),_0x23e255])?_0x23e255:undefined;})[_0x52a1('0x7a')]()['value']();if(!_[_0x52a1('0x7b')](_0x388db8)){_0x388db8[_0x52a1('0x74')](function(_0xd0ff16){if(_0xd0ff16==='OpenchannelAccountId'){_0xea5968['where']('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x4338e8[_0x52a1('0x40')][_0xd0ff16]));}else if(_0xd0ff16==='createdAt'){var _0x3315dd=JSON[_0x52a1('0x7c')](_0x4338e8[_0x52a1('0x40')][_0xd0ff16])[_0x52a1('0x7d')];var _0x15c131=JSON[_0x52a1('0x7c')](_0x4338e8[_0x52a1('0x40')][_0xd0ff16])[_0x52a1('0x7e')];_0xea5968['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3315dd,_0x15c131);}else{if(_0x4338e8['query'][_0xd0ff16]==='null'){_0xea5968[_0x52a1('0x4a')]('i.'+_0xd0ff16+'\x20IS\x20NULL');}else{_0xea5968['where']('i.'+_0xd0ff16+_0x52a1('0x7f'),_0x4338e8[_0x52a1('0x40')][_0xd0ff16]);}}});}if(_0x4338e8[_0x52a1('0x40')][_0x52a1('0x80')]){if(_0x4338e8[_0x52a1('0x40')]['read']==0x1){_0xea5968[_0x52a1('0x67')]('`unreadMessages`\x20=\x200');}else{_0xea5968[_0x52a1('0x67')](_0x52a1('0x81'));}}if(_0x4338e8[_0x52a1('0x40')][_0x52a1('0x82')]){_0x2c5e45=_[_0x52a1('0x83')](_0x4338e8[_0x52a1('0x40')][_0x52a1('0x82')])?_0x4338e8[_0x52a1('0x40')]['tag']:new Array(_0x4338e8[_0x52a1('0x40')]['tag']);_0x2c5e45[_0x52a1('0x74')](function(_0x3cae0a){_0x2a028e['or'](_0x52a1('0x75'),'%,'+_0x3cae0a+',%');});}if(_0x4338e8[_0x52a1('0x40')][_0x52a1('0x84')]){var _0x19a3ef=_0x4338e8[_0x52a1('0x40')][_0x52a1('0x84')][_0x52a1('0x85')]('\x5c','\x5c\x5c')[_0x52a1('0x85')](/'/g,'\x27\x27');if(qs[_0x52a1('0x86')](_0x19a3ef)){_0x24a492['or'](_0x52a1('0x87'),_0x19a3ef+'%');}else{_0x24a492['or'](_0x52a1('0x88'),qs[_0x52a1('0x89')](_0x19a3ef))['or']('i.from\x20LIKE\x20?',_0x19a3ef+'%')['or'](_0x52a1('0x8a'),_0x19a3ef+'%');}}}_0xea5968[_0x52a1('0x4a')](_0x24a492);_0xea5968[_0x52a1('0x8b')](_0x52a1('0x8c'));var _0x534116={'type':db['Sequelize'][_0x52a1('0x8d')][_0x52a1('0x8e')],'raw':!![]};var _0x1a568b=_0xea5968[_0x52a1('0x8f')]();_0x1a568b[_0x52a1('0x4d')](_0x52a1('0x8c'));_0x1a568b[_0x52a1('0x4d')](_0x52a1('0x90'),_0x52a1('0x65'));if(_0x3d5477['order']){_0x3d5477[_0x52a1('0x48')][_0x52a1('0x74')](function(_0x3baaab){var _0x1f1301=_0x3baaab[0x0]===_0x52a1('0x91')?_0x3baaab[0x0]:'i.'+_0x3baaab[0x0];_0xea5968[_0x52a1('0x48')](_0x1f1301,_0x3baaab[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x2c5e45)){_0xea5968[_0x52a1('0x67')](_0x2a028e);_0x1a568b['where'](_0x52a1('0x92'),_0x2c5e45);}BPromise[_0x52a1('0x93')]()[_0x52a1('0x2c')](function(){if(!_0x24b853){if(_0x4338e8[_0x52a1('0x40')][_0x52a1('0x94')])return;_0x1a568b['where'](_0x52a1('0x95'));_0xea5968['where'](_0x52a1('0x95'));return;}if(_0x4338e8['user'][_0x52a1('0x96')]!==_0x52a1('0x97'))return;return _0x4338e8[_0x52a1('0x98')][_0x52a1('0x99')]({'attributes':['id'],'raw':!![]})[_0x52a1('0x2c')](function(_0x5c01da){if(_[_0x52a1('0x7b')](_0x5c01da)){_0x1a568b[_0x52a1('0x4a')](_0x52a1('0x9a'));_0xea5968[_0x52a1('0x4a')](_0x52a1('0x9a'));}else{_0x1a568b[_0x52a1('0x4a')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x52a1('0x32')](_0x5c01da,'id'));_0xea5968[_0x52a1('0x4a')](_0x52a1('0x9b'),_[_0x52a1('0x32')](_0x5c01da,'id'));}});})['then'](function(){if(_0x4338e8['user']['role']===_0x52a1('0x97')&&!_0x24b853&&!_0x4338e8[_0x52a1('0x40')][_0x52a1('0x94')])return[];return db[_0x52a1('0x9c')][_0x52a1('0x40')](_0x1a568b[_0x52a1('0x9d')](),_0x534116);})[_0x52a1('0x2c')](function(_0xb03878){_0xc901c8[_0x52a1('0x26')]=_0xb03878[_0x52a1('0x45')];if(_0xc901c8['count']===0x0)return[];return db['sequelize']['query'](_0x2ad034[_0x52a1('0x9d')](),_0x534116)[_0x52a1('0x2c')](function(_0x4cee7c){_0x22d85b=_[_0x52a1('0x9e')](_0x4cee7c,'id');_0x534116=_[_0x52a1('0x9f')](_0x534116,{'model':db[_0x52a1('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4338e8[_0x52a1('0x40')][_0x52a1('0x43')]){_0x3d5477['attributes'][_0x52a1('0x74')](function(_0x5e7311){_0xea5968[_0x52a1('0x4d')]('i.'+_0x5e7311);});}else{_0xea5968[_0x52a1('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x52a1('0x65'));_0xea5968[_0x52a1('0x4d')](_0x52a1('0xa0'),_0x52a1('0xa1'));_0xea5968[_0x52a1('0x4d')](_0x52a1('0xa2'),_0x52a1('0xa3'));_0xea5968[_0x52a1('0x4d')](_0x52a1('0xa4'),_0x52a1('0x91'));_0xea5968[_0x52a1('0x4d')](_0x52a1('0xa5'));_0xea5968[_0x52a1('0x4d')](_0x52a1('0xa6'),_0x52a1('0xa7'));_0xea5968[_0x52a1('0x4d')]('c.lastName',_0x52a1('0xa8'));_0xea5968[_0x52a1('0x4d')](_0x52a1('0xa9'),'Contact.email');_0xea5968['field'](_0x52a1('0xaa'),_0x52a1('0xab'));_0xea5968[_0x52a1('0x4d')](_0x52a1('0xac'),_0x52a1('0xad'));_0xea5968[_0x52a1('0x4d')](_0x52a1('0xae'),_0x52a1('0xaf'));_0xea5968[_0x52a1('0x4d')](_0x52a1('0xb0'),'Owner.fullname');_0xea5968[_0x52a1('0x4d')](_0x52a1('0xb1'),'Owner.internal');_0xea5968['field'](_0x52a1('0xb2'),_0x52a1('0x34'));}if(_0x3d5477[_0x52a1('0x25')])_0xea5968[_0x52a1('0x25')](_0x3d5477['limit']);if(_0x3d5477[_0x52a1('0x24')])_0xea5968[_0x52a1('0x24')](_0x3d5477['offset']);return db['sequelize'][_0x52a1('0x40')](_0xea5968[_0x52a1('0x9d')](),_0x534116);})[_0x52a1('0x2c')](function(_0x2415a2){if(_0x2415a2[_0x52a1('0x45')]>0x0)_0x3b41f8[_0x52a1('0x4a')](_0x52a1('0xb3'),_[_0x52a1('0x32')](_0x2415a2,'id'));return db[_0x52a1('0x9c')]['query'](_0x3b41f8[_0x52a1('0x9d')](),_0x534116)['then'](function(_0x3b6b4f){var _0x40c126=_[_0x52a1('0xb4')](_0x3b6b4f,'OpenchannelInteractionId');var _0x1c3944=[];_0x2415a2['forEach'](function(_0x3033bd){_0x1c3944[_0x52a1('0xb5')](updateOpenchannelInteraction(_0x3033bd,_0x22d85b,_0x40c126));});return BPromise[_0x52a1('0xb6')](_0x1c3944);});});})['then'](function(_0x4748eb){_0xc901c8[_0x52a1('0xb7')]=_0x4748eb;return _0xc901c8;})[_0x52a1('0x2c')](respondWithFilteredResult(_0x8522fd,_0x3d5477))[_0x52a1('0xb8')](handleError(_0x8522fd,null));};exports[_0x52a1('0xb9')]=function(_0x357a8d,_0x3798b6){var _0x222a90={};if(_0x357a8d[_0x52a1('0x40')][_0x52a1('0x77')]&&_0x357a8d[_0x52a1('0x40')][_0x52a1('0x77')]===_0x52a1('0x4f')){_0x222a90[_0x52a1('0x4f')]=_0x357a8d[_0x52a1('0xba')]['id'];}else{_0x222a90['id']=_0x357a8d[_0x52a1('0xba')]['id'];}var _0x4b1da2={'raw':![],'where':_0x222a90},_0xe582d7={};_0xe582d7['model']=_[_0x52a1('0x41')](db[_0x52a1('0x3b')][_0x52a1('0x3c')]);_0xe582d7[_0x52a1('0x40')]=_[_0x52a1('0x41')](_0x357a8d['query']);_0xe582d7[_0x52a1('0x42')]=_[_0x52a1('0xbb')](_0xe582d7['model'],_0xe582d7[_0x52a1('0x40')]);_0x4b1da2[_0x52a1('0x44')]=_[_0x52a1('0xbb')](_0xe582d7[_0x52a1('0x3f')],qs[_0x52a1('0x43')](_0x357a8d[_0x52a1('0x40')][_0x52a1('0x43')]));_0x4b1da2[_0x52a1('0x44')]=_0x4b1da2['attributes'][_0x52a1('0x45')]?_0x4b1da2['attributes']:_0xe582d7[_0x52a1('0x3f')];if(_0x357a8d[_0x52a1('0x40')][_0x52a1('0xbc')]){_0x4b1da2[_0x52a1('0xbd')]=[{'all':!![]}];}_0x4b1da2=_['merge']({},_0x4b1da2,_0x357a8d[_0x52a1('0xbe')]);return db[_0x52a1('0x3b')][_0x52a1('0x64')](_0x4b1da2)[_0x52a1('0x2c')](handleEntityNotFound(_0x3798b6,null))[_0x52a1('0x2c')](respondWithResult(_0x3798b6,null))['catch'](handleError(_0x3798b6,null));};exports[_0x52a1('0xbf')]=function(_0x3584bd,_0x3d9499){return db[_0x52a1('0x3b')][_0x52a1('0xbf')](_0x3584bd[_0x52a1('0xc0')],{})[_0x52a1('0x2c')](respondWithResult(_0x3d9499,0xc9))['catch'](handleError(_0x3d9499,null));};exports[_0x52a1('0xc1')]=function(_0x47d73a,_0x3bcb15){if(_0x47d73a[_0x52a1('0xc0')]['id']){delete _0x47d73a[_0x52a1('0xc0')]['id'];}return db[_0x52a1('0x3b')][_0x52a1('0x64')]({'where':{'id':_0x47d73a[_0x52a1('0xba')]['id']}})['then'](handleEntityNotFound(_0x3bcb15,null))['then'](saveUpdates(_0x47d73a[_0x52a1('0xc0')],null))[_0x52a1('0x2c')](respondWithResult(_0x3bcb15,null))['catch'](handleError(_0x3bcb15,null));};exports[_0x52a1('0xc2')]=function(_0x1c0b4d,_0x54ab34){return db[_0x52a1('0x3b')][_0x52a1('0x64')]({'where':{'id':_0x1c0b4d['params']['id']}})['then'](handleEntityNotFound(_0x54ab34,null))[_0x52a1('0x2c')](removeEntity(_0x54ab34,null))[_0x52a1('0xb8')](handleError(_0x54ab34,null));};exports['describe']=function(_0x385f69,_0x6bc59c){return db[_0x52a1('0x3b')][_0x52a1('0xc3')]()['then'](respondWithResult(_0x6bc59c,null))[_0x52a1('0xb8')](handleError(_0x6bc59c,null));};exports['addMessage']=function(_0x11a5d5,_0x380c20,_0x52f29a){return db['OpenchannelMessage'][_0x52a1('0x64')]({'where':{'id':_0x11a5d5['params']['id']}})[_0x52a1('0x2c')](handleEntityNotFound(_0x380c20,null))['then'](function(_0x4888ae){if(_0x4888ae){return _0x4888ae[_0x52a1('0xc4')](_0x11a5d5['body'][_0x52a1('0xc5')],_[_0x52a1('0xc6')](_0x11a5d5['body'],[_0x52a1('0xc5'),'id'])||{});}})[_0x52a1('0x2c')](respondWithResult(_0x380c20,null))[_0x52a1('0xb8')](handleError(_0x380c20,null));};exports[_0x52a1('0xc7')]=function(_0x545ee8,_0x60e53e,_0x35f0d4){var _0x384c19={'raw':![],'where':{}};var _0x1d82c4={};var _0x18c734={'count':0x0,'rows':[]};return db[_0x52a1('0x3b')]['findOne']({'where':{'id':_0x545ee8['params']['id']}})[_0x52a1('0x2c')](handleEntityNotFound(_0x60e53e,null))[_0x52a1('0x2c')](function(_0x55599e){if(_0x55599e){_0x1d82c4[_0x52a1('0x3f')]=_[_0x52a1('0x41')](db[_0x52a1('0xc8')][_0x52a1('0x3c')]);_0x1d82c4['query']=_[_0x52a1('0x41')](_0x545ee8[_0x52a1('0x40')]);_0x1d82c4['filters']=_[_0x52a1('0xbb')](_0x1d82c4['model'],_0x1d82c4['query']);_0x384c19['attributes']=_[_0x52a1('0xbb')](_0x1d82c4['model'],qs[_0x52a1('0x43')](_0x545ee8[_0x52a1('0x40')][_0x52a1('0x43')]));_0x384c19[_0x52a1('0x44')]=_0x384c19[_0x52a1('0x44')][_0x52a1('0x45')]?_0x384c19[_0x52a1('0x44')]:_0x1d82c4[_0x52a1('0x3f')];if(!_0x545ee8['query'][_0x52a1('0x46')](_0x52a1('0x47'))){_0x384c19[_0x52a1('0x25')]=qs[_0x52a1('0x25')](_0x545ee8[_0x52a1('0x40')][_0x52a1('0x25')]);_0x384c19[_0x52a1('0x24')]=qs[_0x52a1('0x24')](_0x545ee8[_0x52a1('0x40')]['offset']);}_0x384c19[_0x52a1('0x48')]=qs['sort'](_0x545ee8['query'][_0x52a1('0x49')]);_0x384c19[_0x52a1('0x4a')]=qs[_0x52a1('0x42')](_[_0x52a1('0x4b')](_0x545ee8['query'],_0x1d82c4['filters']));_0x384c19[_0x52a1('0x4a')][_0x52a1('0xc9')]=_0x55599e['id'];if(_0x545ee8[_0x52a1('0x40')][_0x52a1('0x84')]){_0x384c19['where']=_[_0x52a1('0x9f')](_0x384c19[_0x52a1('0x4a')],{'$or':_[_0x52a1('0x32')](_0x384c19[_0x52a1('0x44')],function(_0x4879b5){var _0x1390a0={};_0x1390a0[_0x4879b5]={'$like':'%'+_0x545ee8[_0x52a1('0x40')][_0x52a1('0x84')]+'%'};return _0x1390a0;})});}if(_0x545ee8[_0x52a1('0x40')]['$gte']){var _0x11bd29=_0x545ee8['query'][_0x52a1('0x7d')][_0x52a1('0x73')](',');var _0x3f6d51={};_0x3f6d51[_0x11bd29[0x0]]={'$gte':moment(_0x11bd29[0x1])['format'](_0x52a1('0xca'))};_0x384c19['where']=_[_0x52a1('0x9f')](_0x384c19[_0x52a1('0x4a')],_0x3f6d51);}_0x384c19=_['merge']({},_0x384c19,_0x545ee8['options']);return db[_0x52a1('0xc8')]['count']({'where':_0x384c19['where']})['then'](function(_0xbc838f){_0x18c734['count']=_0xbc838f;if(_0x545ee8[_0x52a1('0x40')][_0x52a1('0xbc')]){_0x384c19[_0x52a1('0xbd')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x384c19);})[_0x52a1('0x2c')](function(_0x538a69){_0x18c734['rows']=_0x538a69;return _0x18c734;});}})['then'](respondWithFilteredResult(_0x60e53e,_0x384c19))[_0x52a1('0xb8')](handleError(_0x60e53e,null));};exports[_0x52a1('0xcb')]=function(_0x3e88f0,_0x1d0f4f,_0x365cf7){return db['OpenchannelInteraction'][_0x52a1('0x64')]({'where':{'id':_0x3e88f0['params']['id']}})[_0x52a1('0x2c')](handleEntityNotFound(_0x1d0f4f,null))[_0x52a1('0x2c')](function(_0x135b11){if(_0x135b11){return _0x135b11[_0x52a1('0xcc')](_0x3e88f0['body'][_0x52a1('0xc5')],_[_0x52a1('0xc6')](_0x3e88f0['body'],['ids','id'])||{})[_0x52a1('0xcd')](function(){return db[_0x52a1('0x72')][_0x52a1('0xce')]({'attributes':['id','name',_0x52a1('0x4e')],'where':{'id':_0x3e88f0[_0x52a1('0xc0')][_0x52a1('0xc5')]}});})[_0x52a1('0x2c')](function(_0x1364ac){socket['emit'](_0x52a1('0xcf'),{'id':Number(_0x3e88f0[_0x52a1('0xba')]['id']),'tags':_0x1364ac||[]});return{'id':Number(_0x3e88f0[_0x52a1('0xba')]['id']),'tags':_0x1364ac||[]};});}})['then'](respondWithResult(_0x1d0f4f,null))[_0x52a1('0xb8')](handleError(_0x1d0f4f,null));};exports[_0x52a1('0xd0')]=function(_0xfb711d,_0x1f9e50,_0x379b4e){return db[_0x52a1('0x3b')][_0x52a1('0x64')]({'where':{'id':_0xfb711d['params']['id']}})[_0x52a1('0x2c')](handleEntityNotFound(_0x1f9e50,null))[_0x52a1('0x2c')](function(_0x1ecf2d){if(_0x1ecf2d){return _0x1ecf2d[_0x52a1('0xd0')](_0xfb711d[_0x52a1('0x40')][_0x52a1('0xc5')]);}})[_0x52a1('0x2c')](respondWithStatusCode(_0x1f9e50,null))[_0x52a1('0xb8')](handleError(_0x1f9e50,null));};exports[_0x52a1('0xd1')]=function(_0x409b2a,_0x163db6){var _0x23a645=moment()[_0x52a1('0xd2')]()['toString']();var _0x2be8a5=path[_0x52a1('0xd3')](config[_0x52a1('0xd4')],'server',_0x52a1('0xd5'),_0x52a1('0xd6'));var _0xd52fa1=path[_0x52a1('0xd3')](config[_0x52a1('0xd4')],_0x52a1('0xd7'),'files',_0x52a1('0xd8'));var _0x1c1606=path['join'](_0x2be8a5,_0x23a645);var _0x3bb37c=util[_0x52a1('0xd9')](_0x52a1('0xda'),_0x409b2a[_0x52a1('0xba')]['id'],_0x23a645);var _0x3e1c2e=path[_0x52a1('0xd3')](_0x2be8a5,_0x3bb37c);var _0x179191=[];_0x179191[_0x52a1('0xb5')]({'model':db['User'],'as':_0x52a1('0xdb'),'attributes':['id',_0x52a1('0x33')],'raw':!![]});_0x179191['push']({'model':db[_0x52a1('0xdc')],'as':'Contact','attributes':['id','firstName',_0x52a1('0xdd')],'raw':!![]});if(_0x409b2a['query'][_0x52a1('0xd8')]){_0x179191[_0x52a1('0xb5')]({'model':db[_0x52a1('0xde')],'as':'Attachment','raw':!![]});}var _0x2f57d6=[{'model':db[_0x52a1('0xc8')],'as':_0x52a1('0xdf'),'attributes':['id','body',_0x52a1('0xe0'),'direction',_0x52a1('0xe1'),_0x52a1('0x80')],'include':_0x179191}];_0x2f57d6[_0x52a1('0xb5')]({'model':db['OpenchannelAccount'],'as':_0x52a1('0xe2'),'attributes':['id',_0x52a1('0x2f')]});_0x2f57d6[_0x52a1('0xb5')]({'model':db['User'],'as':_0x52a1('0xe3'),'attributes':['id','fullname']});return db[_0x52a1('0x3b')][_0x52a1('0x64')]({'where':{'id':_0x409b2a['params']['id']},'include':_0x2f57d6})[_0x52a1('0x2c')](handleEntityNotFound(_0x163db6,null))[_0x52a1('0x2c')](function(_0x28a303){if(_0x28a303){var _0x4d37c8=_0x28a303[_0x52a1('0xe4')]({'plain':!![]});fs[_0x52a1('0xe5')](_0x1c1606);var _0x1a63bd={'channel':'Openchannel','account':_0x4d37c8[_0x52a1('0xe2')]['name'],'agent':_0x4d37c8[_0x52a1('0xe3')]?_0x4d37c8[_0x52a1('0xe3')]['fullname']:_0x52a1('0xe6'),'createdAt':moment(_0x4d37c8['createdAt'])[_0x52a1('0xd9')](_0x52a1('0xca'))['toString'](),'closedAt':_0x4d37c8['closed']?moment(_0x4d37c8[_0x52a1('0xe7')])[_0x52a1('0xd9')](_0x52a1('0xca'))[_0x52a1('0x9d')]():'','disposition':_0x4d37c8[_0x52a1('0xe8')],'visibility':_0x4d37c8[_0x52a1('0xe9')]?_0x52a1('0xea'):_0x52a1('0xeb'),'messages':_(_0x4d37c8[_0x52a1('0xdf')])[_0x52a1('0x84')]({'secret':![]})[_0x52a1('0x32')](function(_0x5921dd){if(_0x5921dd[_0x52a1('0xde')]){var _0x5857f7=path['join'](_0xd52fa1,_0x5921dd[_0x52a1('0xde')][_0x52a1('0xec')]);if(fs['existsSync'](_0x5857f7)){fs['createReadStream'](_0x5857f7)[_0x52a1('0xed')](fs[_0x52a1('0xee')](path[_0x52a1('0xd3')](_0x1c1606,_0x5921dd[_0x52a1('0xde')]['basename'])));}}return{'date':moment(_0x5921dd[_0x52a1('0xe0')])[_0x52a1('0xd9')](_0x52a1('0xca'))['toString'](),'sender':_0x5921dd[_0x52a1('0xef')]==='out'?_0x5921dd[_0x52a1('0xdb')]?_0x5921dd[_0x52a1('0xdb')][_0x52a1('0x33')]:_0x52a1('0xf0'):_0x5921dd[_0x52a1('0x69')][_0x52a1('0xf1')]+(_0x5921dd[_0x52a1('0x69')]['lastName']?'\x20'+_0x5921dd[_0x52a1('0x69')][_0x52a1('0xdd')]:''),'body':_0x5921dd[_0x52a1('0xde')]?_0x5921dd[_0x52a1('0xde')][_0x52a1('0xec')]:_0x5921dd[_0x52a1('0xc0')],'direction':_0x5921dd[_0x52a1('0xef')]===_0x52a1('0xf2')?'A':'C','secret':_0x5921dd['secret'],'read':_0x5921dd[_0x52a1('0x80')],'attachment':_0x5921dd[_0x52a1('0xde')]};})[_0x52a1('0x66')]()};return ejs[_0x52a1('0xf3')](path['join'](config[_0x52a1('0xd4')],'server',_0x52a1('0xf4'),_0x52a1('0xf5')),{'interaction':_0x1a63bd})[_0x52a1('0x2c')](function(_0x26b273){var _0x5f7fdf=path[_0x52a1('0xd3')](_0x1c1606,_0x52a1('0xf6')+_0x4d37c8['id']+'-'+_0x23a645+_0x52a1('0xf7'));var _0x7f8075={'path':_0x5f7fdf,'channel':_0x52a1('0xf8'),'interactionId':_0x4d37c8['id']};return pdf['createPdfFromHTML'](_0x26b273,_0x7f8075);})[_0x52a1('0x2c')](function(){return new BPromise(function(_0xf82150,_0x330b1a){zipdir(_0x1c1606,{'saveTo':_0x3e1c2e},function(_0x5b53b6,_0x55a509){if(_0x5b53b6)return _0x330b1a(_0x5b53b6);return _0xf82150(_0x55a509);});})[_0x52a1('0x2c')](function(){return new BPromise(function(_0x3c4b9e,_0x423af3){rimraf(_0x1c1606,function(_0x415be5){if(_0x415be5)_0x423af3(_0x415be5);return _0x3c4b9e();});});})['then'](function(){return _0x163db6[_0x52a1('0xd1')](_0x3e1c2e,_0x3bb37c,function(_0x268794){if(_0x268794){console[_0x52a1('0xf9')](_0x52a1('0xfa'),_0x268794);}else{fs[_0x52a1('0xfb')](_0x3e1c2e);}});});});}else{return _0x163db6[_0x52a1('0x21')](0xc8);}})[_0x52a1('0xb8')](handleError(_0x163db6,null));}; \ No newline at end of file +var _0xa688=['Tags','split','forEach','push','then','catch','waiting','answered','unmanaged','total','closed','UserId','talking','index','map','OpenchannelInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','Contact','$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','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','body','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','`unreadMessages`\x20>\x200','tag','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?','i.id','Sequelize','SELECT','clone','contactName','resolve','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','show','params','rawAttributes','includeAll','include','create','update','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','setTags','spread','Tag','emit','openchannelInteractionTags:save','removeTags','join','root','server','files','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','read','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','disposition','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','System','out','secret','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','log','err','unlinkSync','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','destroy','stack','name','send','Users','fullname','TagIds'];(function(_0x5df918,_0x423fd9){var _0x492be7=function(_0x434268){while(--_0x434268){_0x5df918['push'](_0x5df918['shift']());}};_0x492be7(++_0x423fd9);}(_0xa688,0xc6));var _0x8a68=function(_0xb603f1,_0x31555a){_0xb603f1=_0xb603f1-0x0;var _0x5a77aa=_0xa688[_0xb603f1];return _0x5a77aa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8a68('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a68('0x1'));var moment=require(_0x8a68('0x2'));var BPromise=require(_0x8a68('0x3'));var Mustache=require(_0x8a68('0x4'));var util=require(_0x8a68('0x5'));var path=require(_0x8a68('0x6'));var sox=require(_0x8a68('0x7'));var csv=require(_0x8a68('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a68('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8a68('0xa'));var jsforce=require(_0x8a68('0xb'));var deskjs=require(_0x8a68('0xc'));var toCsv=require(_0x8a68('0x8'));var querystring=require(_0x8a68('0xd'));var Papa=require(_0x8a68('0xe'));var Redis=require(_0x8a68('0xf'));var authService=require(_0x8a68('0x10'));var qs=require(_0x8a68('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x8a68('0x12'));var hardwareService=require(_0x8a68('0x13'));var logger=require(_0x8a68('0x14'))(_0x8a68('0x15'));var utils=require('../../config/utils');var config=require(_0x8a68('0x16'));var licenseUtil=require(_0x8a68('0x17'));var db=require('../../mysqldb')['db'];config[_0x8a68('0x18')]=_[_0x8a68('0x19')](config['redis'],{'host':_0x8a68('0x1a'),'port':0x18eb});var socket=require(_0x8a68('0x1b'))(new Redis(config['redis']));require(_0x8a68('0x1c'))[_0x8a68('0x1d')](socket);function respondWithStatusCode(_0x32b294,_0x34df8f){_0x34df8f=_0x34df8f||0xcc;return function(_0x4988c9){if(_0x4988c9){return _0x32b294[_0x8a68('0x1e')](_0x34df8f);}return _0x32b294[_0x8a68('0x1f')](_0x34df8f)[_0x8a68('0x20')]();};}function respondWithResult(_0x270f30,_0xba887d){_0xba887d=_0xba887d||0xc8;return function(_0x3c2472){if(_0x3c2472){return _0x270f30[_0x8a68('0x1f')](_0xba887d)[_0x8a68('0x21')](_0x3c2472);}};}function respondWithFilteredResult(_0x4ae164,_0xe4b05){return function(_0x287ac9){if(_0x287ac9){var _0x2c71f1=typeof _0xe4b05[_0x8a68('0x22')]===_0x8a68('0x23')&&typeof _0xe4b05[_0x8a68('0x24')]==='undefined';var _0x5df630=_0x287ac9[_0x8a68('0x25')];var _0x2a73d5=_0x2c71f1?0x0:_0xe4b05[_0x8a68('0x22')];var _0x95d582=_0x2c71f1?_0x287ac9[_0x8a68('0x25')]:_0xe4b05[_0x8a68('0x22')]+_0xe4b05['limit'];var _0x4d4fe2;if(_0x95d582>=_0x5df630){_0x95d582=_0x5df630;_0x4d4fe2=0xc8;}else{_0x4d4fe2=0xce;}_0x4ae164[_0x8a68('0x1f')](_0x4d4fe2);return _0x4ae164['set'](_0x8a68('0x26'),_0x2a73d5+'-'+_0x95d582+'/'+_0x5df630)[_0x8a68('0x21')](_0x287ac9);}return null;};}function patchUpdates(_0x2886fd){return function(_0x218d15){try{jsonpatch[_0x8a68('0x27')](_0x218d15,_0x2886fd,!![]);}catch(_0x1ca78b){return BPromise['reject'](_0x1ca78b);}return _0x218d15['save']();};}function saveUpdates(_0x4f2cac,_0x10187e){return function(_0x32321d){if(_0x32321d){return _0x32321d['update'](_0x4f2cac)['then'](function(_0x1fa0dc){return _0x1fa0dc;});}return null;};}function removeEntity(_0x542d92,_0x936fa4){return function(_0xc2e74a){if(_0xc2e74a){return _0xc2e74a[_0x8a68('0x28')]()['then'](function(){_0x542d92[_0x8a68('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd37dcc,_0x52d02e){return function(_0x5a0e5d){if(!_0x5a0e5d){_0xd37dcc[_0x8a68('0x1e')](0x194);}return _0x5a0e5d;};}function handleError(_0x225185,_0xf40050){_0xf40050=_0xf40050||0x1f4;return function(_0x4e32aa){logger['error'](_0x4e32aa[_0x8a68('0x29')]);if(_0x4e32aa[_0x8a68('0x2a')]){delete _0x4e32aa['name'];}_0x225185[_0x8a68('0x1f')](_0xf40050)[_0x8a68('0x2b')](_0x4e32aa);};}function getInteractionUsers(_0x57ccc7,_0x428377){return new BPromise(function(_0x3e13aa,_0x17f8c5){try{if(_0x428377[_0x57ccc7['id']]){_0x57ccc7[_0x8a68('0x2c')]=_['map'](_0x428377[_0x57ccc7['id']],function(_0x2ffa91){return{'id':_0x2ffa91['id'],'fullname':_0x2ffa91[_0x8a68('0x2d')]};});}}catch(_0x3864a0){_0x17f8c5(_0x3864a0);}_0x3e13aa(_0x57ccc7);});}function getInteractionTags(_0x1c2e17,_0x13a619){return new BPromise(function(_0x526588,_0x372bf2){try{if(_0x1c2e17[_0x8a68('0x2e')]){_0x1c2e17[_0x8a68('0x2f')]=[];_0x1c2e17[_0x8a68('0x2e')][_0x8a68('0x30')](',')[_0x8a68('0x31')](function(_0x3dc621){_0x1c2e17[_0x8a68('0x2f')][_0x8a68('0x32')](_0x13a619[_0x3dc621]);});}delete _0x1c2e17['TagIds'];}catch(_0x15fcbf){_0x372bf2(_0x15fcbf);}_0x526588(_0x1c2e17);});}function updateOpenchannelInteraction(_0x11c758,_0xa71c55,_0x345609){return new BPromise(function(_0x4da47c,_0x3c0b68){return getInteractionUsers(_0x11c758,_0x345609)[_0x8a68('0x33')](function(_0x49f727){return getInteractionTags(_0x49f727,_0xa71c55);})[_0x8a68('0x33')](function(_0x112f67){return getStateInteraction(_0x112f67);})['then'](function(_0xab9469){_0x4da47c(_0xab9469);})[_0x8a68('0x34')](function(_0x435fcb){_0x3c0b68(_0x435fcb);});});}function getStateInteraction(_0x5a43c3){return new BPromise(function(_0x114c47){_0x5a43c3[_0x8a68('0x35')]=0x0;_0x5a43c3['talking']=0x0;_0x5a43c3[_0x8a68('0x36')]=0x0;_0x5a43c3[_0x8a68('0x37')]=0x0;_0x5a43c3[_0x8a68('0x38')]=0x0;if(!_0x5a43c3[_0x8a68('0x39')]&&!_0x5a43c3['UserId']){_0x5a43c3[_0x8a68('0x35')]+=0x1;}if(!_0x5a43c3['closed']&&_0x5a43c3['UserId']){_0x5a43c3['talking']+=0x1;if(_0x5a43c3['waiting']){_0x5a43c3['waiting']-=0x1;}}if(_0x5a43c3[_0x8a68('0x39')]&&_0x5a43c3[_0x8a68('0x3a')]){_0x5a43c3[_0x8a68('0x36')]+=0x1;if(_0x5a43c3[_0x8a68('0x3b')]){_0x5a43c3[_0x8a68('0x3b')]-=0x1;}}if(_0x5a43c3[_0x8a68('0x39')]&&!_0x5a43c3[_0x8a68('0x3a')]){_0x5a43c3[_0x8a68('0x37')]+=0x1;if(_0x5a43c3[_0x8a68('0x35')]){_0x5a43c3[_0x8a68('0x35')]-=0x1;}}_0x5a43c3[_0x8a68('0x38')]+=0x1;_0x114c47(_0x5a43c3);});}exports[_0x8a68('0x3c')]=function(_0x1eb560,_0xfa4414){var _0x191bdd={},_0xe5ecba={},_0x263d28={'count':0x0,'rows':[]};var _0xd3bf60=_[_0x8a68('0x3d')](db[_0x8a68('0x3e')]['rawAttributes'],function(_0x8082fc){return{'name':_0x8082fc[_0x8a68('0x3f')],'type':_0x8082fc[_0x8a68('0x40')][_0x8a68('0x41')]};});_0xe5ecba[_0x8a68('0x42')]=_['map'](_0xd3bf60,_0x8a68('0x2a'));_0xe5ecba[_0x8a68('0x43')]=_[_0x8a68('0x44')](_0x1eb560['query']);_0xe5ecba[_0x8a68('0x45')]=_[_0x8a68('0x46')](_0xe5ecba[_0x8a68('0x42')],_0xe5ecba[_0x8a68('0x43')]);_0x191bdd[_0x8a68('0x47')]=_['intersection'](_0xe5ecba[_0x8a68('0x42')],qs[_0x8a68('0x48')](_0x1eb560['query'][_0x8a68('0x48')]));_0x191bdd[_0x8a68('0x47')]=_0x191bdd[_0x8a68('0x47')][_0x8a68('0x49')]?_0x191bdd[_0x8a68('0x47')]:_0xe5ecba[_0x8a68('0x42')];if(!_0x1eb560[_0x8a68('0x43')][_0x8a68('0x4a')](_0x8a68('0x4b'))){_0x191bdd['limit']=qs[_0x8a68('0x24')](_0x1eb560[_0x8a68('0x43')]['limit']);_0x191bdd[_0x8a68('0x22')]=qs['offset'](_0x1eb560[_0x8a68('0x43')][_0x8a68('0x22')]);}_0x191bdd[_0x8a68('0x4c')]=qs[_0x8a68('0x4d')](_0x1eb560[_0x8a68('0x43')][_0x8a68('0x4d')]);_0x191bdd[_0x8a68('0x4e')]=qs['filters'](_[_0x8a68('0x4f')](_0x1eb560[_0x8a68('0x43')],_0xe5ecba[_0x8a68('0x45')]),_0xd3bf60);var _0x48737d=[];var _0x36724f=squel[_0x8a68('0x50')]()[_0x8a68('0x51')]('id')[_0x8a68('0x51')](_0x8a68('0x2a'))[_0x8a68('0x51')](_0x8a68('0x52'))['from'](_0x8a68('0x53'));var _0x33ab30=squel[_0x8a68('0x50')]()[_0x8a68('0x51')](_0x8a68('0x54'))[_0x8a68('0x51')](_0x8a68('0x55'))[_0x8a68('0x51')](_0x8a68('0x56'))[_0x8a68('0x57')](_0x8a68('0x58'),'ui')[_0x8a68('0x59')](_0x8a68('0x5a'),'u',_0x8a68('0x5b'));var _0x1cb311=squel[_0x8a68('0x50')]()[_0x8a68('0x57')](_0x8a68('0x5c'),'i')[_0x8a68('0x59')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x8a68('0x59')](_0x8a68('0x5a'),'o',_0x8a68('0x5d'))[_0x8a68('0x59')](_0x8a68('0x5e'),'a',_0x8a68('0x5f'))[_0x8a68('0x59')](_0x8a68('0x60'),'me',_0x8a68('0x61'))[_0x8a68('0x59')]('openchannel_interaction_has_tags','it',_0x8a68('0x62'))[_0x8a68('0x59')]('tools_tags','t',_0x8a68('0x63'));var _0xe2327f=squel[_0x8a68('0x64')]();var _0x28af49=[];var _0x217bbd=squel[_0x8a68('0x64')]();var _0x2f84e9;if(_0x1eb560[_0x8a68('0x43')]['search']){_0x2f84e9=as[_0x8a68('0x65')](_0x1eb560[_0x8a68('0x43')][_0x8a68('0x66')]);var _0xa9b5da=_0x2f84e9[_0x8a68('0x67')];for(var _0x19ac39=0x0;_0x19ac39<_0x2f84e9[_0x8a68('0x68')][_0x8a68('0x49')];_0x19ac39++){var _0x1a3bbd=_0x2f84e9[_0x8a68('0x68')][_0x19ac39];var _0x33f4b1='i';var _0x1e3bf7=_[_0x8a68('0x69')](_0xd3bf60,[_0x8a68('0x2a'),_0x1a3bbd[_0x8a68('0x51')]]);if(!_0x1e3bf7){switch(_0x1a3bbd[_0x8a68('0x51')]){case _0x8a68('0x6a'):if(_0x1a3bbd['value']==0x1){_0x1cb311[_0x8a68('0x6b')]('`'+_0x1a3bbd[_0x8a68('0x51')]+'`\x20=\x200');}else{_0x1cb311[_0x8a68('0x6b')]('`'+_0x1a3bbd['field']+_0x8a68('0x6c'));}break;case _0x8a68('0x6d'):if(_0x1a3bbd['operator']===_0x8a68('0x6e')){if(_0x1a3bbd['value'][_0x8a68('0x30')]('\x20')[_0x8a68('0x49')]>0x1){_0xe2327f[_0xa9b5da](_0x8a68('0x6f'),qs['getFullTextValue'](_0x1a3bbd[_0x8a68('0x70')]),null);}else{var _0x5ca87d='%'+_0x1a3bbd[_0x8a68('0x70')]+'%';_0xe2327f[_0xa9b5da](_0x8a68('0x71'),_0x5ca87d,_0x5ca87d,_0x5ca87d);}}else{_0x1e3bf7=_[_0x8a68('0x69')](_0xd3bf60,['name',_0x8a68('0x72')]);_0x1a3bbd[_0x8a68('0x51')]=_0x8a68('0x72');_0x214141=as[_0x8a68('0x73')](_0x33f4b1,_0x1e3bf7['type'],_0x1a3bbd);_0xe2327f[_0xa9b5da](_0x214141[_0x8a68('0x74')],_0x214141[_0x8a68('0x70')][_0x8a68('0x75')],_0x214141['value'][_0x8a68('0x20')]);}break;case'Tag':var _0x3adb5f=_0x1a3bbd[_0x8a68('0x70')][_0x8a68('0x30')](',')['map'](function(_0x5b8eb8){return Number(_0x5b8eb8);});_0x3adb5f[_0x8a68('0x31')](function(_0x43b34d){_0x217bbd['or'](_0x8a68('0x76'),'%,'+_0x43b34d+',%');});_0x28af49=_[_0x8a68('0x77')](_0x28af49,_0x3adb5f);break;case _0x8a68('0x78'):if(_0x1a3bbd[_0x8a68('0x79')]===_0x8a68('0x6e')){_0xe2327f[_0xa9b5da]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1a3bbd[_0x8a68('0x70')]+'%',null);}else{_0x1e3bf7=_[_0x8a68('0x69')](_0xd3bf60,[_0x8a68('0x2a'),_0x8a68('0x3a')]);_0x1a3bbd[_0x8a68('0x51')]='UserId';_0x214141=as['buildExpression'](_0x33f4b1,_0x1e3bf7['type'],_0x1a3bbd);_0xe2327f[_0xa9b5da](_0x214141[_0x8a68('0x74')],_0x214141[_0x8a68('0x70')][_0x8a68('0x75')],_0x214141[_0x8a68('0x70')][_0x8a68('0x20')]);}break;case _0x8a68('0x7a'):_0x214141=as[_0x8a68('0x73')]('me',null,_0x1a3bbd);_0xe2327f[_0xa9b5da](_0x214141[_0x8a68('0x74')],_0x214141[_0x8a68('0x70')][_0x8a68('0x75')],_0x214141[_0x8a68('0x70')][_0x8a68('0x20')]);break;}}else{var _0x214141=as[_0x8a68('0x73')](_0x33f4b1,_0x1e3bf7[_0x8a68('0x40')],_0x1a3bbd);_0xe2327f[_0xa9b5da](_0x214141[_0x8a68('0x74')],_0x214141[_0x8a68('0x70')][_0x8a68('0x75')],_0x214141[_0x8a68('0x70')][_0x8a68('0x20')]);}}}else{var _0x5b5984=_(_0x1eb560[_0x8a68('0x43')])[_0x8a68('0x44')]()[_0x8a68('0x3d')](function(_0x53e5bb){return _['some'](_0xd3bf60,[_0x8a68('0x2a'),_0x53e5bb])?_0x53e5bb:undefined;})[_0x8a68('0x7b')]()['value']();if(!_[_0x8a68('0x7c')](_0x5b5984)){_0x5b5984[_0x8a68('0x31')](function(_0x855ddf){if(_0x855ddf===_0x8a68('0x7d')){_0x1cb311[_0x8a68('0x4e')](_0x8a68('0x7e'),[][_0x8a68('0x7f')](_0x1eb560[_0x8a68('0x43')][_0x855ddf]));}else if(_0x855ddf==='createdAt'){var _0x511e43=JSON['parse'](_0x1eb560[_0x8a68('0x43')][_0x855ddf])[_0x8a68('0x80')];var _0x947911=JSON[_0x8a68('0x81')](_0x1eb560['query'][_0x855ddf])[_0x8a68('0x82')];_0x1cb311[_0x8a68('0x4e')](_0x8a68('0x83'),_0x511e43,_0x947911);}else{if(_0x1eb560[_0x8a68('0x43')][_0x855ddf]===_0x8a68('0x84')){_0x1cb311['where']('i.'+_0x855ddf+_0x8a68('0x85'));}else{_0x1cb311[_0x8a68('0x4e')]('i.'+_0x855ddf+'\x20=\x20?',_0x1eb560['query'][_0x855ddf]);}}});}if(_0x1eb560[_0x8a68('0x43')]['read']){if(_0x1eb560['query']['read']==0x1){_0x1cb311['having']('`unreadMessages`\x20=\x200');}else{_0x1cb311[_0x8a68('0x6b')](_0x8a68('0x86'));}}if(_0x1eb560[_0x8a68('0x43')][_0x8a68('0x87')]){_0x28af49=_[_0x8a68('0x88')](_0x1eb560[_0x8a68('0x43')][_0x8a68('0x87')])?_0x1eb560[_0x8a68('0x43')][_0x8a68('0x87')]:new Array(_0x1eb560[_0x8a68('0x43')]['tag']);_0x28af49['forEach'](function(_0x36da8a){_0x217bbd['or'](_0x8a68('0x76'),'%,'+_0x36da8a+',%');});}if(_0x1eb560[_0x8a68('0x43')][_0x8a68('0x89')]){var _0x352536=_0x1eb560[_0x8a68('0x43')][_0x8a68('0x89')]['replace']('\x5c','\x5c\x5c')[_0x8a68('0x8a')](/'/g,'\x27\x27');if(qs[_0x8a68('0x8b')](_0x352536)){_0xe2327f['or'](_0x8a68('0x8c'),_0x352536+'%');}else{_0xe2327f['or'](_0x8a68('0x8d'),qs[_0x8a68('0x8e')](_0x352536))['or']('i.from\x20LIKE\x20?',_0x352536+'%')['or'](_0x8a68('0x8f'),_0x352536+'%');}}}_0x1cb311[_0x8a68('0x4e')](_0xe2327f);_0x1cb311['group'](_0x8a68('0x90'));var _0x443425={'type':db[_0x8a68('0x91')]['QueryTypes'][_0x8a68('0x92')],'raw':!![]};var _0x245a3f=_0x1cb311[_0x8a68('0x93')]();_0x245a3f['field'](_0x8a68('0x90'));_0x245a3f['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8a68('0x6a'));if(_0x191bdd['order']){_0x191bdd[_0x8a68('0x4c')][_0x8a68('0x31')](function(_0x348991){var _0x59011d=_0x348991[0x0]===_0x8a68('0x94')?_0x348991[0x0]:'i.'+_0x348991[0x0];_0x1cb311['order'](_0x59011d,_0x348991[0x1]==='DESC'?![]:!![]);});}if(!_[_0x8a68('0x7c')](_0x28af49)){_0x1cb311[_0x8a68('0x6b')](_0x217bbd);_0x245a3f['where']('t.id\x20IN\x20?',_0x28af49);}BPromise[_0x8a68('0x95')]()[_0x8a68('0x33')](function(){if(!_0x2f84e9){if(_0x1eb560[_0x8a68('0x43')][_0x8a68('0x7d')])return;_0x245a3f['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x1cb311[_0x8a68('0x4e')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1eb560['user'][_0x8a68('0x96')]!==_0x8a68('0x97'))return;return _0x1eb560[_0x8a68('0x98')][_0x8a68('0x99')]({'attributes':['id'],'raw':!![]})[_0x8a68('0x33')](function(_0x1335b7){if(_[_0x8a68('0x7c')](_0x1335b7)){_0x245a3f[_0x8a68('0x4e')](_0x8a68('0x9a'));_0x1cb311[_0x8a68('0x4e')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x245a3f['where'](_0x8a68('0x7e'),_[_0x8a68('0x3d')](_0x1335b7,'id'));_0x1cb311[_0x8a68('0x4e')](_0x8a68('0x7e'),_[_0x8a68('0x3d')](_0x1335b7,'id'));}});})['then'](function(){if(_0x1eb560[_0x8a68('0x98')][_0x8a68('0x96')]===_0x8a68('0x97')&&!_0x2f84e9&&!_0x1eb560[_0x8a68('0x43')]['OpenchannelAccountId'])return[];return db[_0x8a68('0x9b')][_0x8a68('0x43')](_0x245a3f['toString'](),_0x443425);})[_0x8a68('0x33')](function(_0xa5d1d2){_0x263d28[_0x8a68('0x25')]=_0xa5d1d2[_0x8a68('0x49')];if(_0x263d28[_0x8a68('0x25')]===0x0)return[];return db[_0x8a68('0x9b')]['query'](_0x36724f['toString'](),_0x443425)[_0x8a68('0x33')](function(_0x561e82){_0x48737d=_['keyBy'](_0x561e82,'id');_0x443425=_[_0x8a68('0x9c')](_0x443425,{'model':db[_0x8a68('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1eb560[_0x8a68('0x43')][_0x8a68('0x48')]){_0x191bdd['attributes']['forEach'](function(_0x4404ba){_0x1cb311[_0x8a68('0x51')]('i.'+_0x4404ba);});}else{_0x1cb311[_0x8a68('0x51')](_0x8a68('0x9d'),'unreadMessages');_0x1cb311[_0x8a68('0x51')](_0x8a68('0x9e'),_0x8a68('0x9f'));_0x1cb311[_0x8a68('0x51')]('a.mandatoryDisposition',_0x8a68('0xa0'));_0x1cb311[_0x8a68('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',_0x8a68('0x94'));_0x1cb311[_0x8a68('0x51')](_0x8a68('0xa1'));_0x1cb311[_0x8a68('0x51')](_0x8a68('0xa2'),_0x8a68('0xa3'));_0x1cb311[_0x8a68('0x51')](_0x8a68('0xa4'),_0x8a68('0xa5'));_0x1cb311[_0x8a68('0x51')]('c.email',_0x8a68('0xa6'));_0x1cb311['field'](_0x8a68('0xa7'),'Contact.phone');_0x1cb311[_0x8a68('0x51')](_0x8a68('0xa8'),_0x8a68('0xa9'));_0x1cb311[_0x8a68('0x51')]('c.fax',_0x8a68('0xaa'));_0x1cb311['field'](_0x8a68('0xab'),_0x8a68('0xac'));_0x1cb311[_0x8a68('0x51')](_0x8a68('0xad'),_0x8a68('0xae'));_0x1cb311['field'](_0x8a68('0xaf'),'TagIds');}if(_0x191bdd[_0x8a68('0x24')])_0x1cb311[_0x8a68('0x24')](_0x191bdd[_0x8a68('0x24')]);if(_0x191bdd['offset'])_0x1cb311[_0x8a68('0x22')](_0x191bdd[_0x8a68('0x22')]);return db[_0x8a68('0x9b')]['query'](_0x1cb311[_0x8a68('0xb0')](),_0x443425);})[_0x8a68('0x33')](function(_0x5d4401){if(_0x5d4401[_0x8a68('0x49')]>0x0)_0x33ab30[_0x8a68('0x4e')](_0x8a68('0xb1'),_[_0x8a68('0x3d')](_0x5d4401,'id'));return db[_0x8a68('0x9b')]['query'](_0x33ab30[_0x8a68('0xb0')](),_0x443425)['then'](function(_0x1e58af){var _0x36dd9b=_['groupBy'](_0x1e58af,_0x8a68('0xb2'));var _0x31291e=[];_0x5d4401[_0x8a68('0x31')](function(_0x10b51b){_0x31291e[_0x8a68('0x32')](updateOpenchannelInteraction(_0x10b51b,_0x48737d,_0x36dd9b));});return BPromise[_0x8a68('0xb3')](_0x31291e);});});})[_0x8a68('0x33')](function(_0x59366b){_0x263d28[_0x8a68('0xb4')]=_0x59366b;return _0x263d28;})[_0x8a68('0x33')](respondWithFilteredResult(_0xfa4414,_0x191bdd))[_0x8a68('0x34')](handleError(_0xfa4414,null));};exports[_0x8a68('0xb5')]=function(_0x1aec4e,_0x4cfb4d){var _0x4a0ed6={};if(_0x1aec4e[_0x8a68('0x43')][_0x8a68('0x40')]&&_0x1aec4e[_0x8a68('0x43')][_0x8a68('0x40')]===_0x8a68('0x57')){_0x4a0ed6[_0x8a68('0x57')]=_0x1aec4e[_0x8a68('0xb6')]['id'];}else{_0x4a0ed6['id']=_0x1aec4e[_0x8a68('0xb6')]['id'];}var _0xab6149={'raw':![],'where':_0x4a0ed6},_0x5bcecb={};_0x5bcecb[_0x8a68('0x42')]=_[_0x8a68('0x44')](db['OpenchannelInteraction'][_0x8a68('0xb7')]);_0x5bcecb[_0x8a68('0x43')]=_[_0x8a68('0x44')](_0x1aec4e[_0x8a68('0x43')]);_0x5bcecb[_0x8a68('0x45')]=_[_0x8a68('0x46')](_0x5bcecb['model'],_0x5bcecb[_0x8a68('0x43')]);_0xab6149[_0x8a68('0x47')]=_[_0x8a68('0x46')](_0x5bcecb[_0x8a68('0x42')],qs[_0x8a68('0x48')](_0x1aec4e[_0x8a68('0x43')][_0x8a68('0x48')]));_0xab6149[_0x8a68('0x47')]=_0xab6149[_0x8a68('0x47')]['length']?_0xab6149['attributes']:_0x5bcecb[_0x8a68('0x42')];if(_0x1aec4e['query'][_0x8a68('0xb8')]){_0xab6149[_0x8a68('0xb9')]=[{'all':!![]}];}_0xab6149=_[_0x8a68('0x9c')]({},_0xab6149,_0x1aec4e['options']);return db[_0x8a68('0x3e')]['find'](_0xab6149)[_0x8a68('0x33')](handleEntityNotFound(_0x4cfb4d,null))['then'](respondWithResult(_0x4cfb4d,null))[_0x8a68('0x34')](handleError(_0x4cfb4d,null));};exports[_0x8a68('0xba')]=function(_0x2de12b,_0x343446){return db[_0x8a68('0x3e')][_0x8a68('0xba')](_0x2de12b[_0x8a68('0x7a')],{})['then'](respondWithResult(_0x343446,0xc9))[_0x8a68('0x34')](handleError(_0x343446,null));};exports[_0x8a68('0xbb')]=function(_0x45f241,_0x1fff62){if(_0x45f241[_0x8a68('0x7a')]['id']){delete _0x45f241['body']['id'];}return db['OpenchannelInteraction'][_0x8a68('0x69')]({'where':{'id':_0x45f241[_0x8a68('0xb6')]['id']}})[_0x8a68('0x33')](handleEntityNotFound(_0x1fff62,null))[_0x8a68('0x33')](saveUpdates(_0x45f241[_0x8a68('0x7a')],null))[_0x8a68('0x33')](respondWithResult(_0x1fff62,null))[_0x8a68('0x34')](handleError(_0x1fff62,null));};exports[_0x8a68('0x28')]=function(_0x2f96aa,_0xf3b75c){return db[_0x8a68('0x3e')][_0x8a68('0x69')]({'where':{'id':_0x2f96aa[_0x8a68('0xb6')]['id']}})['then'](handleEntityNotFound(_0xf3b75c,null))[_0x8a68('0x33')](removeEntity(_0xf3b75c,null))[_0x8a68('0x34')](handleError(_0xf3b75c,null));};exports[_0x8a68('0xbc')]=function(_0x361ce9,_0x11b380){return db['OpenchannelInteraction']['describe']()['then'](respondWithResult(_0x11b380,null))[_0x8a68('0x34')](handleError(_0x11b380,null));};exports[_0x8a68('0xbd')]=function(_0x465c40,_0x5b534c,_0x197107){return db[_0x8a68('0xbe')]['find']({'where':{'id':_0x465c40[_0x8a68('0xb6')]['id']}})['then'](handleEntityNotFound(_0x5b534c,null))[_0x8a68('0x33')](function(_0x57ea30){if(_0x57ea30){return _0x57ea30['addMessage'](_0x465c40[_0x8a68('0x7a')][_0x8a68('0xbf')],_['omit'](_0x465c40[_0x8a68('0x7a')],['ids','id'])||{});}})[_0x8a68('0x33')](respondWithResult(_0x5b534c,null))[_0x8a68('0x34')](handleError(_0x5b534c,null));};exports[_0x8a68('0xc0')]=function(_0x4ce755,_0x4cacbb,_0x35e02f){var _0x5307b4={'raw':![],'where':{}};var _0x2880f8={};var _0x126271={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x8a68('0xc1')]({'where':{'id':_0x4ce755[_0x8a68('0xb6')]['id']}})['then'](handleEntityNotFound(_0x4cacbb,null))['then'](function(_0x15d960){if(_0x15d960){_0x2880f8[_0x8a68('0x42')]=_[_0x8a68('0x44')](db[_0x8a68('0xbe')][_0x8a68('0xb7')]);_0x2880f8[_0x8a68('0x43')]=_[_0x8a68('0x44')](_0x4ce755[_0x8a68('0x43')]);_0x2880f8[_0x8a68('0x45')]=_['intersection'](_0x2880f8[_0x8a68('0x42')],_0x2880f8['query']);_0x5307b4['attributes']=_[_0x8a68('0x46')](_0x2880f8['model'],qs[_0x8a68('0x48')](_0x4ce755[_0x8a68('0x43')][_0x8a68('0x48')]));_0x5307b4[_0x8a68('0x47')]=_0x5307b4[_0x8a68('0x47')]['length']?_0x5307b4['attributes']:_0x2880f8['model'];if(!_0x4ce755[_0x8a68('0x43')][_0x8a68('0x4a')](_0x8a68('0x4b'))){_0x5307b4[_0x8a68('0x24')]=qs['limit'](_0x4ce755[_0x8a68('0x43')][_0x8a68('0x24')]);_0x5307b4[_0x8a68('0x22')]=qs[_0x8a68('0x22')](_0x4ce755[_0x8a68('0x43')][_0x8a68('0x22')]);}_0x5307b4[_0x8a68('0x4c')]=qs[_0x8a68('0x4d')](_0x4ce755[_0x8a68('0x43')][_0x8a68('0x4d')]);_0x5307b4[_0x8a68('0x4e')]=qs[_0x8a68('0x45')](_[_0x8a68('0x4f')](_0x4ce755[_0x8a68('0x43')],_0x2880f8[_0x8a68('0x45')]));_0x5307b4[_0x8a68('0x4e')]['OpenchannelInteractionId']=_0x15d960['id'];if(_0x4ce755[_0x8a68('0x43')]['filter']){_0x5307b4[_0x8a68('0x4e')]=_['merge'](_0x5307b4[_0x8a68('0x4e')],{'$or':_[_0x8a68('0x3d')](_0x5307b4['attributes'],function(_0x13b5a0){var _0x336f08={};_0x336f08[_0x13b5a0]={'$like':'%'+_0x4ce755[_0x8a68('0x43')][_0x8a68('0x89')]+'%'};return _0x336f08;})});}if(_0x4ce755[_0x8a68('0x43')]['$gte']){var _0x4e1f0d=_0x4ce755[_0x8a68('0x43')][_0x8a68('0x80')]['split'](',');var _0x44e2e8={};_0x44e2e8[_0x4e1f0d[0x0]]={'$gte':moment(_0x4e1f0d[0x1])[_0x8a68('0xc2')](_0x8a68('0xc3'))};_0x5307b4['where']=_['merge'](_0x5307b4[_0x8a68('0x4e')],_0x44e2e8);}_0x5307b4=_[_0x8a68('0x9c')]({},_0x5307b4,_0x4ce755[_0x8a68('0xc4')]);return db[_0x8a68('0xbe')][_0x8a68('0x25')]({'where':_0x5307b4['where']})[_0x8a68('0x33')](function(_0x271f05){_0x126271[_0x8a68('0x25')]=_0x271f05;if(_0x4ce755['query']['includeAll']){_0x5307b4[_0x8a68('0xb9')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x8a68('0xc5')](_0x5307b4);})['then'](function(_0x3a08b3){_0x126271[_0x8a68('0xb4')]=_0x3a08b3;return _0x126271;});}})[_0x8a68('0x33')](respondWithFilteredResult(_0x4cacbb,_0x5307b4))[_0x8a68('0x34')](handleError(_0x4cacbb,null));};exports['addTags']=function(_0x31e19a,_0x47563a,_0x4c2e11){return db[_0x8a68('0x3e')][_0x8a68('0x69')]({'where':{'id':_0x31e19a['params']['id']}})[_0x8a68('0x33')](handleEntityNotFound(_0x47563a,null))[_0x8a68('0x33')](function(_0x33ef91){if(_0x33ef91){return _0x33ef91[_0x8a68('0xc6')](_0x31e19a[_0x8a68('0x7a')]['ids'],_['omit'](_0x31e19a['body'],['ids','id'])||{})[_0x8a68('0xc7')](function(){return db[_0x8a68('0xc8')]['findAll']({'attributes':['id',_0x8a68('0x2a'),_0x8a68('0x52')],'where':{'id':_0x31e19a['body'][_0x8a68('0xbf')]}});})[_0x8a68('0x33')](function(_0x5e82b1){socket[_0x8a68('0xc9')](_0x8a68('0xca'),{'id':Number(_0x31e19a['params']['id']),'tags':_0x5e82b1||[]});return{'id':Number(_0x31e19a[_0x8a68('0xb6')]['id']),'tags':_0x5e82b1||[]};});}})[_0x8a68('0x33')](respondWithResult(_0x47563a,null))['catch'](handleError(_0x47563a,null));};exports['removeTags']=function(_0x4d2987,_0x4f58ca,_0x4ff2ef){return db['OpenchannelInteraction'][_0x8a68('0x69')]({'where':{'id':_0x4d2987[_0x8a68('0xb6')]['id']}})[_0x8a68('0x33')](handleEntityNotFound(_0x4f58ca,null))[_0x8a68('0x33')](function(_0x54502b){if(_0x54502b){return _0x54502b[_0x8a68('0xcb')](_0x4d2987[_0x8a68('0x43')][_0x8a68('0xbf')]);}})[_0x8a68('0x33')](respondWithStatusCode(_0x4f58ca,null))[_0x8a68('0x34')](handleError(_0x4f58ca,null));};exports['download']=function(_0x295a34,_0x415897){var _0x483897=moment()['unix']()['toString']();var _0x5f1f7f=path[_0x8a68('0xcc')](config[_0x8a68('0xcd')],_0x8a68('0xce'),'files','tmp');var _0x3bbb86=path['join'](config[_0x8a68('0xcd')],_0x8a68('0xce'),_0x8a68('0xcf'),_0x8a68('0xd0'));var _0x2dfd17=path[_0x8a68('0xcc')](_0x5f1f7f,_0x483897);var _0x4e6292=util[_0x8a68('0xc2')](_0x8a68('0xd1'),_0x295a34[_0x8a68('0xb6')]['id'],_0x483897);var _0x1c9ee7=path[_0x8a68('0xcc')](_0x5f1f7f,_0x4e6292);var _0x9b06b3=[];_0x9b06b3[_0x8a68('0x32')]({'model':db['User'],'as':_0x8a68('0x78'),'attributes':['id',_0x8a68('0x2d')],'raw':!![]});_0x9b06b3[_0x8a68('0x32')]({'model':db[_0x8a68('0xd2')],'as':_0x8a68('0x6d'),'attributes':['id',_0x8a68('0xd3'),_0x8a68('0xd4')],'raw':!![]});if(_0x295a34[_0x8a68('0x43')][_0x8a68('0xd0')]){_0x9b06b3['push']({'model':db[_0x8a68('0xd5')],'as':'Attachment','raw':!![]});}var _0x29d489=[{'model':db[_0x8a68('0xbe')],'as':_0x8a68('0xd6'),'attributes':['id','body',_0x8a68('0xd7'),_0x8a68('0xd8'),'secret',_0x8a68('0xd9')],'include':_0x9b06b3}];_0x29d489[_0x8a68('0x32')]({'model':db[_0x8a68('0xda')],'as':_0x8a68('0xdb'),'attributes':['id',_0x8a68('0x2a')]});_0x29d489[_0x8a68('0x32')]({'model':db[_0x8a68('0x78')],'as':_0x8a68('0xdc'),'attributes':['id',_0x8a68('0x2d')]});return db[_0x8a68('0x3e')][_0x8a68('0x69')]({'where':{'id':_0x295a34[_0x8a68('0xb6')]['id']},'include':_0x29d489})[_0x8a68('0x33')](handleEntityNotFound(_0x415897,null))[_0x8a68('0x33')](function(_0x445448){if(_0x445448){var _0x3ac0ab=_0x445448[_0x8a68('0xdd')]({'plain':!![]});fs[_0x8a68('0xde')](_0x2dfd17);var _0x5d6af4={'channel':_0x8a68('0xdf'),'account':_0x3ac0ab[_0x8a68('0xdb')][_0x8a68('0x2a')],'agent':_0x3ac0ab[_0x8a68('0xdc')]?_0x3ac0ab[_0x8a68('0xdc')]['fullname']:_0x8a68('0xe0'),'createdAt':moment(_0x3ac0ab[_0x8a68('0xd7')])[_0x8a68('0xc2')](_0x8a68('0xc3'))[_0x8a68('0xb0')](),'closedAt':_0x3ac0ab[_0x8a68('0x39')]?moment(_0x3ac0ab['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x3ac0ab[_0x8a68('0xe1')],'visibility':_0x3ac0ab['threadId']?_0x8a68('0xe2'):_0x8a68('0xe3'),'messages':_(_0x3ac0ab['Messages'])[_0x8a68('0x89')]({'secret':![]})['map'](function(_0x545109){if(_0x545109[_0x8a68('0xd5')]){var _0x2c1166=path[_0x8a68('0xcc')](_0x3bbb86,_0x545109[_0x8a68('0xd5')][_0x8a68('0xe4')]);if(fs[_0x8a68('0xe5')](_0x2c1166)){fs[_0x8a68('0xe6')](_0x2c1166)[_0x8a68('0xe7')](fs[_0x8a68('0xe8')](path[_0x8a68('0xcc')](_0x2dfd17,_0x545109['Attachment'][_0x8a68('0xe4')])));}}return{'date':moment(_0x545109[_0x8a68('0xd7')])[_0x8a68('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8a68('0xb0')](),'sender':_0x545109[_0x8a68('0xd8')]==='out'?_0x545109[_0x8a68('0x78')]?_0x545109[_0x8a68('0x78')]['fullname']:_0x8a68('0xe9'):_0x545109[_0x8a68('0x6d')]['firstName']+(_0x545109[_0x8a68('0x6d')][_0x8a68('0xd4')]?'\x20'+_0x545109[_0x8a68('0x6d')][_0x8a68('0xd4')]:''),'body':_0x545109['Attachment']?_0x545109[_0x8a68('0xd5')][_0x8a68('0xe4')]:_0x545109['body'],'direction':_0x545109[_0x8a68('0xd8')]===_0x8a68('0xea')?'A':'C','secret':_0x545109[_0x8a68('0xeb')],'read':_0x545109[_0x8a68('0xd9')],'attachment':_0x545109[_0x8a68('0xd5')]};})[_0x8a68('0x70')]()};return ejs[_0x8a68('0xec')](path[_0x8a68('0xcc')](config[_0x8a68('0xcd')],_0x8a68('0xce'),_0x8a68('0xed'),_0x8a68('0xee')),{'interaction':_0x5d6af4})['then'](function(_0x476507){var _0x2d774a=path[_0x8a68('0xcc')](_0x2dfd17,_0x8a68('0xef')+_0x3ac0ab['id']+'-'+_0x483897+'.pdf');var _0x4af634={'path':_0x2d774a,'channel':_0x8a68('0xdf'),'interactionId':_0x3ac0ab['id']};return pdf[_0x8a68('0xf0')](_0x476507,_0x4af634);})[_0x8a68('0x33')](function(){return new BPromise(function(_0x2387f7,_0x132d77){zipdir(_0x2dfd17,{'saveTo':_0x1c9ee7},function(_0x156a2a,_0x4822bd){if(_0x156a2a)return _0x132d77(_0x156a2a);return _0x2387f7(_0x4822bd);});})[_0x8a68('0x33')](function(){return new BPromise(function(_0x6e5561,_0x3c4231){rimraf(_0x2dfd17,function(_0x4bfa51){if(_0x4bfa51)_0x3c4231(_0x4bfa51);return _0x6e5561();});});})[_0x8a68('0x33')](function(){return _0x415897[_0x8a68('0xf1')](_0x1c9ee7,_0x4e6292,function(_0xd0c87c){if(_0xd0c87c){console[_0x8a68('0xf2')](_0x8a68('0xf3'),_0xd0c87c);}else{fs[_0x8a68('0xf4')](_0x1c9ee7);}});});});}else{return _0x415897['sendStatus'](0xc8);}})['catch'](handleError(_0x415897,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 2a2e3bd..a97fdc3 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 _0x5548=['remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hook','events','../../mysqldb','OpenchannelMessage','save','update'];(function(_0x569baa,_0x54f3df){var _0x472ff4=function(_0x580b3e){while(--_0x580b3e){_0x569baa['push'](_0x569baa['shift']());}};_0x472ff4(++_0x54f3df);}(_0x5548,0xfb));var _0x8554=function(_0x2beeb9,_0x415c85){_0x2beeb9=_0x2beeb9-0x0;var _0x3f7f25=_0x5548[_0x2beeb9];return _0x3f7f25;};'use strict';var EventEmitter=require(_0x8554('0x0'));var OpenchannelInteraction=require(_0x8554('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0x8554('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8554('0x3'),'afterUpdate':_0x8554('0x4'),'afterDestroy':_0x8554('0x5')};function emitEvent(_0x1878a1){return function(_0x27dd27,_0x3432c7,_0x13e0f1){_0x27dd27[_0x8554('0x6')]({'attributes':['id'],'raw':!![]})[_0x8554('0x7')](function(_0x42c298){_0x27dd27[_0x8554('0x8')](_0x8554('0x9'),_0x42c298['map'](function(_0x3d9fed){return{'id':_0x3d9fed['id']};}));return OpenchannelMessage[_0x8554('0xa')]({'where':{'OpenchannelInteractionId':_0x27dd27['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1eb655){_0x27dd27['setDataValue'](_0x8554('0xb'),_0x1eb655[_0x8554('0xc')]);OpenchannelInteractionEvents[_0x8554('0xd')](_0x1878a1+':'+_0x27dd27['id'],_0x27dd27);OpenchannelInteractionEvents[_0x8554('0xd')](_0x1878a1,_0x27dd27);_0x13e0f1(null);})[_0x8554('0xe')](_0x13e0f1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x8554('0xf')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0xbc2d=['emit','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x2fc89e,_0x31fa8b){var _0x49a5a3=function(_0x10dd11){while(--_0x10dd11){_0x2fc89e['push'](_0x2fc89e['shift']());}};_0x49a5a3(++_0x31fa8b);}(_0xbc2d,0xd0));var _0xdbc2=function(_0x324b42,_0x1231de){_0x324b42=_0x324b42-0x0;var _0x5ace8b=_0xbc2d[_0x324b42];return _0x5ace8b;};'use strict';var EventEmitter=require(_0xdbc2('0x0'));var OpenchannelInteraction=require(_0xdbc2('0x1'))['db'][_0xdbc2('0x2')];var OpenchannelMessage=require(_0xdbc2('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xdbc2('0x3')](0x0);var events={'afterCreate':_0xdbc2('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3f713c){return function(_0x4ec29d,_0x1f276a,_0x2224e9){_0x4ec29d[_0xdbc2('0x5')]({'attributes':['id'],'raw':!![]})[_0xdbc2('0x6')](function(_0xf86f33){_0x4ec29d[_0xdbc2('0x7')](_0xdbc2('0x8'),_0xf86f33[_0xdbc2('0x9')](function(_0x4eb4a0){return{'id':_0x4eb4a0['id']};}));return OpenchannelMessage[_0xdbc2('0xa')]({'where':{'OpenchannelInteractionId':_0x4ec29d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdbc2('0x6')](function(_0x569ac8){_0x4ec29d[_0xdbc2('0x7')](_0xdbc2('0xb'),_0x569ac8[_0xdbc2('0xc')]);OpenchannelInteractionEvents[_0xdbc2('0xd')](_0x3f713c+':'+_0x4ec29d['id'],_0x4ec29d);OpenchannelInteractionEvents['emit'](_0x3f713c,_0x4ec29d);_0x2224e9(null);})[_0xdbc2('0xe')](_0x2224e9(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xdbc2('0xf')](e,emitEvent(event));}}module[_0xdbc2('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 73e202c..b497412 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 _0x9f6b=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','closedAt'];(function(_0x58d66a,_0xc7f43f){var _0x3681bc=function(_0x12092b){while(--_0x12092b){_0x58d66a['push'](_0x58d66a['shift']());}};_0x3681bc(++_0xc7f43f);}(_0x9f6b,0x112));var _0xb9f6=function(_0x48e509,_0xd1975c){_0x48e509=_0x48e509-0x0;var _0x27d257=_0x9f6b[_0x48e509];return _0x27d257;};'use strict';var _=require(_0xb9f6('0x0'));var util=require(_0xb9f6('0x1'));var logger=require(_0xb9f6('0x2'))(_0xb9f6('0x3'));var moment=require('moment');var BPromise=require(_0xb9f6('0x4'));var rp=require(_0xb9f6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb9f6('0x6'));var attributes=require('./openchannelInteraction.attributes');module[_0xb9f6('0x7')]=function(_0x3364fc,_0x5b379a){return _0x3364fc[_0xb9f6('0x8')](_0xb9f6('0x9'),attributes,{'tableName':_0xb9f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb9f6('0xb'),'collate':_0xb9f6('0xc'),'hooks':{'beforeUpdate':function(_0x42d003,_0x20fc23,_0x1f74b9){if(_0x42d003['changed'](_0xb9f6('0xd'))){_0x42d003[_0xb9f6('0xe')]=moment()[_0xb9f6('0xf')](_0xb9f6('0x10'));}_0x1f74b9(null,_0x42d003);}}});}; \ No newline at end of file +var _0xdf42=['openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise','path','define','OpenchannelInteraction'];(function(_0xc8b023,_0x1033ea){var _0xf7a930=function(_0x331771){while(--_0x331771){_0xc8b023['push'](_0xc8b023['shift']());}};_0xf7a930(++_0x1033ea);}(_0xdf42,0x158));var _0x2df4=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xdf42[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x2df4('0x0'));var util=require('util');var logger=require(_0x2df4('0x1'))(_0x2df4('0x2'));var moment=require('moment');var BPromise=require(_0x2df4('0x3'));var rp=require(_0x2df4('0x4'));var fs=require('fs');var path=require(_0x2df4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x5019b5,_0xb9930){return _0x5019b5[_0x2df4('0x6')](_0x2df4('0x7'),attributes,{'tableName':_0x2df4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2df4('0x9'),'collate':_0x2df4('0xa'),'hooks':{'beforeUpdate':function(_0xda2758,_0x5a0576,_0x4c1a94){if(_0xda2758[_0x2df4('0xb')](_0x2df4('0xc'))){_0xda2758[_0x2df4('0xd')]=moment()[_0x2df4('0xe')](_0x2df4('0xf'));}_0x4c1a94(null,_0xda2758);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index a9b6e71..b61a766 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 _0xe506=['limit','then','stringify','AddTagsToOpenchannelInteraction','find','where','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','code','error','message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes'];(function(_0x15cea8,_0x16e264){var _0xd4515e=function(_0x3b5779){while(--_0x3b5779){_0x15cea8['push'](_0x15cea8['shift']());}};_0xd4515e(++_0x16e264);}(_0xe506,0x1cd));var _0x6e50=function(_0x29f241,_0x1e8fd8){_0x29f241=_0x29f241-0x0;var _0x5d0ca8=_0xe506[_0x29f241];return _0x5d0ca8;};'use strict';var _=require(_0x6e50('0x0'));var util=require(_0x6e50('0x1'));var moment=require(_0x6e50('0x2'));var BPromise=require(_0x6e50('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e50('0x4'));var db=require(_0x6e50('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e50('0x6'))(_0x6e50('0x7'));var config=require(_0x6e50('0x8'));var jayson=require(_0x6e50('0x9'));var client=jayson[_0x6e50('0xa')]['http']({'port':0x232a});config[_0x6e50('0xb')]=_[_0x6e50('0xc')](config[_0x6e50('0xb')],{'host':_0x6e50('0xd'),'port':0x18eb});var socket=require(_0x6e50('0xe'))(new Redis(config[_0x6e50('0xb')]));require(_0x6e50('0xf'))['register'](socket);function respondWithRpcPromise(_0x46de3c,_0x3dca4f,_0x224d81){return new BPromise(function(_0x5db44a,_0x5626a5){return client[_0x6e50('0x10')](_0x46de3c,_0x224d81)['then'](function(_0x43107a){logger[_0x6e50('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3dca4f,_0x6e50('0x12'));logger[_0x6e50('0x13')](_0x6e50('0x14'),_0x3dca4f,_0x6e50('0x12'),JSON['stringify'](_0x43107a));if(_0x43107a['error']){if(_0x43107a['error'][_0x6e50('0x15')]===0x1f4){logger[_0x6e50('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3dca4f,_0x43107a[_0x6e50('0x16')][_0x6e50('0x17')]);return _0x5626a5(_0x43107a[_0x6e50('0x16')][_0x6e50('0x17')]);}logger[_0x6e50('0x16')](_0x6e50('0x18'),_0x3dca4f,_0x43107a[_0x6e50('0x16')][_0x6e50('0x17')]);return _0x5db44a(_0x43107a['error'][_0x6e50('0x17')]);}else{logger[_0x6e50('0x11')](_0x6e50('0x18'),_0x3dca4f,_0x6e50('0x12'));_0x5db44a(_0x43107a[_0x6e50('0x19')][_0x6e50('0x17')]);}})[_0x6e50('0x1a')](function(_0x2eb440){logger['error'](_0x6e50('0x18'),_0x3dca4f,_0x2eb440);_0x5626a5(_0x2eb440);});});}exports[_0x6e50('0x1b')]=function(_0x3d02ad){var _0x2aa129=this;return new Promise(function(_0x31684a,_0xbb3b02){return db[_0x6e50('0x1c')][_0x6e50('0x1d')](_0x3d02ad[_0x6e50('0x1e')],{'raw':_0x3d02ad['options']?_0x3d02ad[_0x6e50('0x1f')][_0x6e50('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d02ad[_0x6e50('0x1f')]?_0x3d02ad['options']['where']||null:null,'attributes':_0x3d02ad['options']?_0x3d02ad[_0x6e50('0x1f')][_0x6e50('0x21')]||null:null,'limit':_0x3d02ad['options']?_0x3d02ad['options'][_0x6e50('0x22')]||null:null})[_0x6e50('0x23')](function(_0x34e987){logger[_0x6e50('0x11')]('UpdateOpenchannelInteraction',_0x3d02ad);logger[_0x6e50('0x13')]('UpdateOpenchannelInteraction',_0x3d02ad,JSON[_0x6e50('0x24')](_0x34e987));_0x31684a(_0x34e987);})[_0x6e50('0x1a')](function(_0x1ed048){logger['error'](_0x6e50('0x1b'),_0x1ed048[_0x6e50('0x17')],_0x3d02ad);_0xbb3b02(_0x2aa129['error'](0x1f4,_0x1ed048[_0x6e50('0x17')]));});});};exports[_0x6e50('0x25')]=function(_0xcdc486){return new Promise(function(_0xff6a50,_0x1794c0){return db[_0x6e50('0x1c')][_0x6e50('0x26')]({'where':_0xcdc486[_0x6e50('0x1f')]?_0xcdc486[_0x6e50('0x1f')][_0x6e50('0x27')]||null:null})[_0x6e50('0x23')](function(_0x43dd61){if(_0x43dd61){return _0x43dd61[_0x6e50('0x28')](_0xcdc486['body']['ids'],_[_0x6e50('0x29')](_0xcdc486[_0x6e50('0x1e')],[_0x6e50('0x2a'),'id'])||{});}})[_0x6e50('0x2b')](function(_0x23e49d){logger[_0x6e50('0x11')](_0x6e50('0x2c'),_0xcdc486);logger['debug']('AddTags',_0xcdc486,JSON['stringify'](_0x23e49d));_0xff6a50(_0x23e49d);})[_0x6e50('0x1a')](function(_0x2a168a){logger[_0x6e50('0x16')](_0x6e50('0x2c'),_0x2a168a[_0x6e50('0x17')],_0xcdc486);_0x1794c0(_this[_0x6e50('0x16')](0x1f4,_0x2a168a[_0x6e50('0x17')]));});});}; \ No newline at end of file +var _0x2edc=['lodash','util','moment','bluebird','../../mysqldb','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','message','OpenchannelInteraction,\x20%s,\x20%s','UpdateOpenchannelInteraction','update','body','options','limit','catch','AddTagsToOpenchannelInteraction','find','ids','spread','AddTags'];(function(_0x34e8f1,_0x4769c0){var _0x4bed53=function(_0x2aaef7){while(--_0x2aaef7){_0x34e8f1['push'](_0x34e8f1['shift']());}};_0x4bed53(++_0x4769c0);}(_0x2edc,0x181));var _0xc2ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2edc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc2ed('0x0'));var util=require(_0xc2ed('0x1'));var moment=require(_0xc2ed('0x2'));var BPromise=require(_0xc2ed('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2ed('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc2ed('0x5'));var config=require('../../config/environment');var jayson=require(_0xc2ed('0x6'));var client=jayson['client'][_0xc2ed('0x7')]({'port':0x232a});config['redis']=_[_0xc2ed('0x8')](config[_0xc2ed('0x9')],{'host':_0xc2ed('0xa'),'port':0x18eb});var socket=require(_0xc2ed('0xb'))(new Redis(config[_0xc2ed('0x9')]));require(_0xc2ed('0xc'))[_0xc2ed('0xd')](socket);function respondWithRpcPromise(_0xe45996,_0x1afe51,_0xc6e94a){return new BPromise(function(_0xc5c9be,_0x574a26){return client[_0xc2ed('0xe')](_0xe45996,_0xc6e94a)[_0xc2ed('0xf')](function(_0x143e0d){logger[_0xc2ed('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1afe51,_0xc2ed('0x11'));logger[_0xc2ed('0x12')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1afe51,_0xc2ed('0x11'),JSON[_0xc2ed('0x13')](_0x143e0d));if(_0x143e0d[_0xc2ed('0x14')]){if(_0x143e0d[_0xc2ed('0x14')][_0xc2ed('0x15')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x1afe51,_0x143e0d[_0xc2ed('0x14')]['message']);return _0x574a26(_0x143e0d[_0xc2ed('0x14')][_0xc2ed('0x16')]);}logger[_0xc2ed('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1afe51,_0x143e0d[_0xc2ed('0x14')][_0xc2ed('0x16')]);return _0xc5c9be(_0x143e0d[_0xc2ed('0x14')]['message']);}else{logger[_0xc2ed('0x10')](_0xc2ed('0x17'),_0x1afe51,_0xc2ed('0x11'));_0xc5c9be(_0x143e0d['result'][_0xc2ed('0x16')]);}})['catch'](function(_0x480161){logger[_0xc2ed('0x14')](_0xc2ed('0x17'),_0x1afe51,_0x480161);_0x574a26(_0x480161);});});}exports[_0xc2ed('0x18')]=function(_0x5077b3){var _0x328a5d=this;return new Promise(function(_0x2f37cb,_0x1201bc){return db['OpenchannelInteraction'][_0xc2ed('0x19')](_0x5077b3[_0xc2ed('0x1a')],{'raw':_0x5077b3['options']?_0x5077b3[_0xc2ed('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5077b3[_0xc2ed('0x1b')]?_0x5077b3[_0xc2ed('0x1b')]['where']||null:null,'attributes':_0x5077b3[_0xc2ed('0x1b')]?_0x5077b3['options']['attributes']||null:null,'limit':_0x5077b3[_0xc2ed('0x1b')]?_0x5077b3[_0xc2ed('0x1b')][_0xc2ed('0x1c')]||null:null})[_0xc2ed('0xf')](function(_0x43a058){logger[_0xc2ed('0x10')](_0xc2ed('0x18'),_0x5077b3);logger[_0xc2ed('0x12')](_0xc2ed('0x18'),_0x5077b3,JSON['stringify'](_0x43a058));_0x2f37cb(_0x43a058);})[_0xc2ed('0x1d')](function(_0x8d866){logger[_0xc2ed('0x14')](_0xc2ed('0x18'),_0x8d866[_0xc2ed('0x16')],_0x5077b3);_0x1201bc(_0x328a5d['error'](0x1f4,_0x8d866[_0xc2ed('0x16')]));});});};exports[_0xc2ed('0x1e')]=function(_0x16562b){return new Promise(function(_0x5aa795,_0x2c6969){return db['OpenchannelInteraction'][_0xc2ed('0x1f')]({'where':_0x16562b[_0xc2ed('0x1b')]?_0x16562b[_0xc2ed('0x1b')]['where']||null:null})[_0xc2ed('0xf')](function(_0x4b778f){if(_0x4b778f){return _0x4b778f['addTags'](_0x16562b[_0xc2ed('0x1a')][_0xc2ed('0x20')],_['omit'](_0x16562b['body'],[_0xc2ed('0x20'),'id'])||{});}})[_0xc2ed('0x21')](function(_0x35bd00){logger[_0xc2ed('0x10')]('AddTags',_0x16562b);logger[_0xc2ed('0x12')](_0xc2ed('0x22'),_0x16562b,JSON[_0xc2ed('0x13')](_0x35bd00));_0x5aa795(_0x35bd00);})[_0xc2ed('0x1d')](function(_0x2fdbf1){logger[_0xc2ed('0x14')](_0xc2ed('0x22'),_0x2fdbf1[_0xc2ed('0x16')],_0x16562b);_0x2c6969(_this[_0xc2ed('0x14')](0x1f4,_0x2fdbf1[_0xc2ed('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index ccf3bb9..8cf9bc6 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 _0x0104=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','emit'];(function(_0x5ed3b1,_0x3e59b2){var _0x3cc545=function(_0x2ed553){while(--_0x2ed553){_0x5ed3b1['push'](_0x5ed3b1['shift']());}};_0x3cc545(++_0x3e59b2);}(_0x0104,0x184));var _0x4010=function(_0xb83526,_0x473f03){_0xb83526=_0xb83526-0x0;var _0x1d686d=_0x0104[_0xb83526];return _0x1d686d;};'use strict';var OpenchannelInteractionEvents=require(_0x4010('0x0'));var events=[_0x4010('0x1'),_0x4010('0x2'),'update'];function createListener(_0x5b0a03,_0x517673){return function(_0xc65990){_0x517673[_0x4010('0x3')](_0x5b0a03,_0xc65990);};}function removeListener(_0x32591e,_0x665cf6){return function(){OpenchannelInteractionEvents[_0x4010('0x4')](_0x32591e,_0x665cf6);};}exports[_0x4010('0x5')]=function(_0x2691b0){for(var _0x313e13=0x0,_0xbc609d=events[_0x4010('0x6')];_0x313e13<_0xbc609d;_0x313e13++){var _0x17fc74=events[_0x313e13];var _0x2e02a1=createListener(_0x4010('0x7')+_0x17fc74,_0x2691b0);OpenchannelInteractionEvents['on'](_0x17fc74,_0x2e02a1);}}; \ No newline at end of file +var _0xa37a=['openchannelInteraction:','./openchannelInteraction.events','remove','register'];(function(_0x258ddd,_0x5e1fe5){var _0xed261b=function(_0x49cdd4){while(--_0x49cdd4){_0x258ddd['push'](_0x258ddd['shift']());}};_0xed261b(++_0x5e1fe5);}(_0xa37a,0x14d));var _0xaa37=function(_0x33743e,_0x2326aa){_0x33743e=_0x33743e-0x0;var _0x4878bd=_0xa37a[_0x33743e];return _0x4878bd;};'use strict';var OpenchannelInteractionEvents=require(_0xaa37('0x0'));var events=['save',_0xaa37('0x1'),'update'];function createListener(_0x25489d,_0x514318){return function(_0x40e189){_0x514318['emit'](_0x25489d,_0x40e189);};}function removeListener(_0x496b42,_0x23727a){return function(){OpenchannelInteractionEvents['removeListener'](_0x496b42,_0x23727a);};}exports[_0xaa37('0x2')]=function(_0x19e965){for(var _0x5a7c7b=0x0,_0x1235d9=events['length'];_0x5a7c7b<_0x1235d9;_0x5a7c7b++){var _0x470cd0=events[_0x5a7c7b];var _0x60d366=createListener(_0xaa37('0x3')+_0x470cd0,_0x19e965);OpenchannelInteractionEvents['on'](_0x470cd0,_0x60d366);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index c789fb8..565a8f5 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x24201a,_0x3ed184){var _0x36a6b9=function(_0x300d74){while(--_0x300d74){_0x24201a['push'](_0x24201a['shift']());}};_0x36a6b9(++_0x3ed184);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'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'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index be8abe1..d37917f 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 _0x9ffd=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1452e7,_0x4e97da){_0x1452e7=_0x1452e7-0x0;var _0x32dfff=_0x9ffd[_0x1452e7];return _0x32dfff;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'body':{'type':Sequelize[_0xd9ff('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd9ff('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd9ff('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9ff('0x4')]('in',_0xd9ff('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xd9ff('0x6')]},'providerName':{'type':Sequelize[_0xd9ff('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xba37=['sequelize','TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xba37,0xb6));var _0x7ba3=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xba37[_0x2dadb9];return _0x2f0097;};'use strict';var Sequelize=require(_0x7ba3('0x0'));module['exports']={'body':{'type':Sequelize[_0x7ba3('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7ba3('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7ba3('0x3')]('in',_0x7ba3('0x4')),'defaultValue':_0x7ba3('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7ba3('0x5')]},'providerName':{'type':Sequelize[_0x7ba3('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index d1d1ffe..fe678b7 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 _0x00cd=['redis','register','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','show','params','keys','length','create','body','find','describe','../../config/logger','openchannel-interactions','read','readAt','format','user','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','update','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE: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','contact','User','agent','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','internal','rejectmessage','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','localhost','socket.io-emitter'];(function(_0x3b606e,_0x1e94e4){var _0x14722c=function(_0x53441e){while(--_0x53441e){_0x3b606e['push'](_0x3b606e['shift']());}};_0x14722c(++_0x1e94e4);}(_0x00cd,0xee));var _0xd00c=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0x00cd[_0xf2f332];return _0x56cce3;};'use strict';var emlformat=require(_0xd00c('0x0'));var rimraf=require(_0xd00c('0x1'));var zipdir=require(_0xd00c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd00c('0x3'));var BPromise=require(_0xd00c('0x4'));var Mustache=require(_0xd00c('0x5'));var util=require(_0xd00c('0x6'));var path=require(_0xd00c('0x7'));var sox=require('sox');var csv=require(_0xd00c('0x8'));var ejs=require(_0xd00c('0x9'));var fs=require('fs');var fs_extra=require(_0xd00c('0xa'));var _=require(_0xd00c('0xb'));var squel=require(_0xd00c('0xc'));var crypto=require(_0xd00c('0xd'));var jsforce=require(_0xd00c('0xe'));var deskjs=require(_0xd00c('0xf'));var toCsv=require(_0xd00c('0x8'));var querystring=require(_0xd00c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd00c('0x11'));var qs=require(_0xd00c('0x12'));var as=require(_0xd00c('0x13'));var hardwareService=require(_0xd00c('0x14'));var logger=require('../../config/logger')(_0xd00c('0x15'));var utils=require('../../config/utils');var config=require(_0xd00c('0x16'));var licenseUtil=require(_0xd00c('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd00c('0x18'),'port':0x18eb});var socket=require(_0xd00c('0x19'))(new Redis(config[_0xd00c('0x1a')]));require('./openchannelMessage.socket')[_0xd00c('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd00c('0x1c')][_0xd00c('0x1d')]({'port':0x232c});var client9002=jayson[_0xd00c('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50b22e,_0x41f67c,_0x3ccf95,_0x15fddd){return new BPromise(function(_0x1d7728,_0x3462ca){var _0x2a5531=_0x15fddd||client;return _0x2a5531[_0xd00c('0x1e')](_0x50b22e,_0x3ccf95)[_0xd00c('0x1f')](function(_0x4e21ac){logger[_0xd00c('0x20')](_0xd00c('0x21'),_0x41f67c,_0xd00c('0x22'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x41f67c,_0xd00c('0x22'),JSON[_0xd00c('0x23')](_0x4e21ac));if(_0x4e21ac[_0xd00c('0x24')]){if(_0x4e21ac[_0xd00c('0x24')][_0xd00c('0x25')]===0x1f4){logger[_0xd00c('0x24')](_0xd00c('0x21'),_0x41f67c,_0x4e21ac['error'][_0xd00c('0x26')]);return _0x3462ca(_0x4e21ac[_0xd00c('0x24')][_0xd00c('0x26')]);}logger[_0xd00c('0x24')](_0xd00c('0x21'),_0x41f67c,_0x4e21ac['error']['message']);return _0x1d7728(_0x4e21ac[_0xd00c('0x24')][_0xd00c('0x26')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x41f67c,'request\x20sent');_0x1d7728(_0x4e21ac[_0xd00c('0x27')]['message']);}})[_0xd00c('0x28')](function(_0x4a918f){logger[_0xd00c('0x24')](_0xd00c('0x21'),_0x41f67c,_0x4a918f);_0x3462ca(_0x4a918f);});});}function respondWithStatusCode(_0x4fc631,_0x4c78e9){_0x4c78e9=_0x4c78e9||0xcc;return function(_0x24f5c8){if(_0x24f5c8){return _0x4fc631[_0xd00c('0x29')](_0x4c78e9);}return _0x4fc631[_0xd00c('0x2a')](_0x4c78e9)[_0xd00c('0x2b')]();};}function respondWithResult(_0x56f50f,_0x2f8853){_0x2f8853=_0x2f8853||0xc8;return function(_0x322b2e){if(_0x322b2e){return _0x56f50f[_0xd00c('0x2a')](_0x2f8853)[_0xd00c('0x2c')](_0x322b2e);}};}function respondWithFilteredResult(_0x4987c5,_0x17e58d){return function(_0x5bb7c4){if(_0x5bb7c4){var _0x3e7e2c=typeof _0x17e58d[_0xd00c('0x2d')]===_0xd00c('0x2e')&&typeof _0x17e58d[_0xd00c('0x2f')]===_0xd00c('0x2e');var _0x399f2d=_0x5bb7c4[_0xd00c('0x30')];var _0x2a4fa4=_0x3e7e2c?0x0:_0x17e58d[_0xd00c('0x2d')];var _0x4ad9b0=_0x3e7e2c?_0x5bb7c4[_0xd00c('0x30')]:_0x17e58d[_0xd00c('0x2d')]+_0x17e58d[_0xd00c('0x2f')];var _0x3a0837;if(_0x4ad9b0>=_0x399f2d){_0x4ad9b0=_0x399f2d;_0x3a0837=0xc8;}else{_0x3a0837=0xce;}_0x4987c5[_0xd00c('0x2a')](_0x3a0837);return _0x4987c5[_0xd00c('0x31')](_0xd00c('0x32'),_0x2a4fa4+'-'+_0x4ad9b0+'/'+_0x399f2d)[_0xd00c('0x2c')](_0x5bb7c4);}return null;};}function patchUpdates(_0x4af28e){return function(_0x560370){try{jsonpatch[_0xd00c('0x33')](_0x560370,_0x4af28e,!![]);}catch(_0x4b0eff){return BPromise[_0xd00c('0x34')](_0x4b0eff);}return _0x560370[_0xd00c('0x35')]();};}function saveUpdates(_0x3bc464,_0x1af90a){return function(_0x408ea5){if(_0x408ea5){return _0x408ea5['update'](_0x3bc464)[_0xd00c('0x1f')](function(_0x33850f){return _0x33850f;});}return null;};}function removeEntity(_0x4e894b,_0x7388d3){return function(_0x400ca1){if(_0x400ca1){return _0x400ca1[_0xd00c('0x36')]()[_0xd00c('0x1f')](function(){_0x4e894b[_0xd00c('0x2a')](0xcc)[_0xd00c('0x2b')]();});}};}function handleEntityNotFound(_0x57a91f,_0x40c501){return function(_0x5b6345){if(!_0x5b6345){_0x57a91f[_0xd00c('0x29')](0x194);}return _0x5b6345;};}function handleError(_0x55199e,_0x4ac41e){_0x4ac41e=_0x4ac41e||0x1f4;return function(_0x5c1773){logger[_0xd00c('0x24')](_0x5c1773[_0xd00c('0x37')]);if(_0x5c1773[_0xd00c('0x38')]){delete _0x5c1773['name'];}_0x55199e[_0xd00c('0x2a')](_0x4ac41e)[_0xd00c('0x39')](_0x5c1773);};}exports[_0xd00c('0x3a')]=function(_0x572b8e,_0x3ffd0a){var _0x3c2560={},_0x2a61d9={},_0x21b6be={'count':0x0,'rows':[]};var _0x19fb28=_[_0xd00c('0x3b')](db[_0xd00c('0x3c')][_0xd00c('0x3d')],function(_0x1fdc4d){return{'name':_0x1fdc4d[_0xd00c('0x3e')],'type':_0x1fdc4d['type'][_0xd00c('0x3f')]};});_0x2a61d9[_0xd00c('0x40')]=_['map'](_0x19fb28,_0xd00c('0x38'));_0x2a61d9[_0xd00c('0x41')]=_['keys'](_0x572b8e[_0xd00c('0x41')]);_0x2a61d9[_0xd00c('0x42')]=_[_0xd00c('0x43')](_0x2a61d9[_0xd00c('0x40')],_0x2a61d9[_0xd00c('0x41')]);_0x3c2560[_0xd00c('0x44')]=_[_0xd00c('0x43')](_0x2a61d9[_0xd00c('0x40')],qs['fields'](_0x572b8e[_0xd00c('0x41')][_0xd00c('0x45')]));_0x3c2560[_0xd00c('0x44')]=_0x3c2560[_0xd00c('0x44')]['length']?_0x3c2560[_0xd00c('0x44')]:_0x2a61d9[_0xd00c('0x40')];if(!_0x572b8e['query'][_0xd00c('0x46')](_0xd00c('0x47'))){_0x3c2560[_0xd00c('0x2f')]=qs['limit'](_0x572b8e[_0xd00c('0x41')]['limit']);_0x3c2560['offset']=qs[_0xd00c('0x2d')](_0x572b8e['query'][_0xd00c('0x2d')]);}_0x3c2560[_0xd00c('0x48')]=qs[_0xd00c('0x49')](_0x572b8e[_0xd00c('0x41')][_0xd00c('0x49')]);_0x3c2560[_0xd00c('0x4a')]=qs[_0xd00c('0x42')](_[_0xd00c('0x4b')](_0x572b8e[_0xd00c('0x41')],_0x2a61d9[_0xd00c('0x42')]),_0x19fb28);if(_0x572b8e[_0xd00c('0x41')]['filter']){_0x3c2560[_0xd00c('0x4a')]=_[_0xd00c('0x4c')](_0x3c2560[_0xd00c('0x4a')],{'$or':_['map'](_0x19fb28,function(_0x4316e4){if(_0x4316e4[_0xd00c('0x4d')]!=='VIRTUAL'){var _0x594d70={};_0x594d70[_0x4316e4['name']]={'$like':'%'+_0x572b8e[_0xd00c('0x41')][_0xd00c('0x4e')]+'%'};return _0x594d70;}})});}_0x3c2560=_[_0xd00c('0x4c')]({},_0x3c2560,_0x572b8e[_0xd00c('0x4f')]);var _0x9b2c24={'where':_0x3c2560[_0xd00c('0x4a')]};return db[_0xd00c('0x3c')][_0xd00c('0x30')](_0x9b2c24)['then'](function(_0x240b55){_0x21b6be[_0xd00c('0x30')]=_0x240b55;if(_0x572b8e[_0xd00c('0x41')][_0xd00c('0x50')]){_0x3c2560[_0xd00c('0x51')]=[{'all':!![]}];}return db[_0xd00c('0x3c')][_0xd00c('0x52')](_0x3c2560);})[_0xd00c('0x1f')](function(_0x1ec799){_0x21b6be[_0xd00c('0x53')]=_0x1ec799;return _0x21b6be;})[_0xd00c('0x1f')](respondWithFilteredResult(_0x3ffd0a,_0x3c2560))[_0xd00c('0x28')](handleError(_0x3ffd0a,null));};exports[_0xd00c('0x54')]=function(_0x3d0917,_0x570c0b){var _0x815a5d={'raw':!![],'where':{'id':_0x3d0917[_0xd00c('0x55')]['id']}},_0x2b69a4={};_0x2b69a4[_0xd00c('0x40')]=_[_0xd00c('0x56')](db[_0xd00c('0x3c')]['rawAttributes']);_0x2b69a4[_0xd00c('0x41')]=_[_0xd00c('0x56')](_0x3d0917[_0xd00c('0x41')]);_0x2b69a4['filters']=_[_0xd00c('0x43')](_0x2b69a4[_0xd00c('0x40')],_0x2b69a4[_0xd00c('0x41')]);_0x815a5d['attributes']=_['intersection'](_0x2b69a4[_0xd00c('0x40')],qs[_0xd00c('0x45')](_0x3d0917[_0xd00c('0x41')][_0xd00c('0x45')]));_0x815a5d[_0xd00c('0x44')]=_0x815a5d['attributes'][_0xd00c('0x57')]?_0x815a5d['attributes']:_0x2b69a4[_0xd00c('0x40')];if(_0x3d0917['query']['includeAll']){_0x815a5d[_0xd00c('0x51')]=[{'all':!![]}];}_0x815a5d=_[_0xd00c('0x4c')]({},_0x815a5d,_0x3d0917[_0xd00c('0x4f')]);return db[_0xd00c('0x3c')]['find'](_0x815a5d)['then'](handleEntityNotFound(_0x570c0b,null))['then'](respondWithResult(_0x570c0b,null))[_0xd00c('0x28')](handleError(_0x570c0b,null));};exports['create']=function(_0x283309,_0x451fdf){return db[_0xd00c('0x3c')][_0xd00c('0x58')](_0x283309[_0xd00c('0x59')],{})[_0xd00c('0x1f')](respondWithResult(_0x451fdf,0xc9))['catch'](handleError(_0x451fdf,null));};exports['update']=function(_0x2ea075,_0xf30c00){if(_0x2ea075['body']['id']){delete _0x2ea075[_0xd00c('0x59')]['id'];}return db['OpenchannelMessage'][_0xd00c('0x5a')]({'where':{'id':_0x2ea075[_0xd00c('0x55')]['id']}})['then'](handleEntityNotFound(_0xf30c00,null))[_0xd00c('0x1f')](saveUpdates(_0x2ea075[_0xd00c('0x59')],null))['then'](respondWithResult(_0xf30c00,null))[_0xd00c('0x28')](handleError(_0xf30c00,null));};exports['destroy']=function(_0x374a8c,_0x2e60f2){return db[_0xd00c('0x3c')][_0xd00c('0x5a')]({'where':{'id':_0x374a8c[_0xd00c('0x55')]['id']}})['then'](handleEntityNotFound(_0x2e60f2,null))[_0xd00c('0x1f')](removeEntity(_0x2e60f2,null))[_0xd00c('0x28')](handleError(_0x2e60f2,null));};exports[_0xd00c('0x5b')]=function(_0x188381,_0x5dc79f){return db[_0xd00c('0x3c')][_0xd00c('0x5b')]()['then'](respondWithResult(_0x5dc79f,null))[_0xd00c('0x28')](handleError(_0x5dc79f,null));};var interaction_log=require(_0xd00c('0x5c'))(_0xd00c('0x5d'));exports['accept']=function(_0x1fdc6e,_0x32a224,_0x5627cb){var _0x30b608={'agent':{},'channel':'openchannel'};if(_0x1fdc6e[_0xd00c('0x59')]['id']){delete _0x1fdc6e[_0xd00c('0x59')]['id'];}_0x1fdc6e[_0xd00c('0x59')][_0xd00c('0x5e')]=!![];_0x1fdc6e[_0xd00c('0x59')][_0xd00c('0x5f')]=moment()[_0xd00c('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x1fdc6e[_0xd00c('0x59')]['UserId']=_0x1fdc6e[_0xd00c('0x59')]['UserId']||_0x1fdc6e[_0xd00c('0x61')]['id'];_0x30b608['agent']['id']=_0x1fdc6e['body'][_0xd00c('0x62')];return db[_0xd00c('0x3c')][_0xd00c('0x5a')]({'where':{'id':_0x1fdc6e[_0xd00c('0x55')]['id'],'UserId':null}})[_0xd00c('0x1f')](handleEntityNotFound(_0x32a224,null))['then'](saveUpdates(_0x1fdc6e['body'],null))[_0xd00c('0x1f')](function(_0x3c3cb8){if(_0x3c3cb8){_0x30b608[_0xd00c('0x26')]=_0x3c3cb8[_0xd00c('0x63')]({'plain':!![]});return db[_0xd00c('0x64')][_0xd00c('0x5a')]({'where':{'id':_0x3c3cb8[_0xd00c('0x65')]}});}return null;})[_0xd00c('0x1f')](handleEntityNotFound(_0x32a224,null))['then'](function(_0x421b11){if(_0x421b11){return _0x421b11[_0xd00c('0x66')]({'UserId':_0x1fdc6e[_0xd00c('0x59')]['UserId'],'read1stAt':_[_0xd00c('0x67')](_0x421b11['read1stAt'])?moment()[_0xd00c('0x60')](_0xd00c('0x68')):undefined});}return null;})[_0xd00c('0x1f')](function(_0x29d5a2){if(_0x29d5a2){_0x30b608[_0xd00c('0x69')]=_0x29d5a2['get']({'plain':!![]});interaction_log['info'](_0xd00c('0x6a'),_0x1fdc6e[_0xd00c('0x61')]['id'],_0x1fdc6e[_0xd00c('0x61')]['name'],_0x1fdc6e['user'][_0xd00c('0x6b')],_0x30b608['interaction']['id'],_0x1fdc6e[_0xd00c('0x59')]?JSON['stringify'](_0x1fdc6e['body']):_0xd00c('0x6c'));return respondWithRpcPromise('AcceptMessage',_0xd00c('0x6d'),_0x30b608);}return null;})['then'](function(_0x5808fd){var _0x44071f=_0xd00c('0x6e')+_0x5808fd[_0xd00c('0x26')][_0xd00c('0x6f')];return db['sequelize'][_0xd00c('0x41')](_0x44071f,{'type':db[_0xd00c('0x70')][_0xd00c('0x71')][_0xd00c('0x72')],'raw':!![]})[_0xd00c('0x1f')](function(_0x483b01){return _0x483b01;});})[_0xd00c('0x1f')](function(_0x24a6ec){if(_0x24a6ec){_0x30b608[_0xd00c('0x26')][_0xd00c('0x73')]=_0x24a6ec[0x0];if(!_0x1fdc6e['body']['UserId'])return;return db[_0xd00c('0x74')][_0xd00c('0x5a')]({'where':{'id':_0x1fdc6e[_0xd00c('0x59')][_0xd00c('0x62')],'role':_0xd00c('0x75')},'attributes':['id',_0xd00c('0x38'),_0xd00c('0x76'),_0xd00c('0x77'),'internal'],'raw':!![]});}return null;})[_0xd00c('0x1f')](function(_0x540130){if(!_0x540130)return null;_0x30b608[_0xd00c('0x26')][_0xd00c('0x75')]=_0x540130;return _0x30b608;})[_0xd00c('0x1f')](function(_0x278db9){if(_0x278db9){if(_0x1fdc6e[_0xd00c('0x59')][_0xd00c('0x78')]){_0x30b608[_0xd00c('0x26')][_0xd00c('0x79')]=util[_0xd00c('0x60')](_0xd00c('0x7a'),_0x1fdc6e[_0xd00c('0x61')][_0xd00c('0x38')]);_0x30b608[_0xd00c('0x26')][_0xd00c('0x7b')]=_0x30b608[_0xd00c('0x7b')];_0x30b608[_0xd00c('0x26')][_0xd00c('0x7c')]=_0x30b608[_0xd00c('0x7b')];_0x30b608[_0xd00c('0x26')][_0xd00c('0x7d')]='accept';return respondWithRpcPromise(_0xd00c('0x7e'),_0xd00c('0x7e'),{'event':'acceptmessage','message':_0x30b608['message']},client9002)[_0xd00c('0x1f')](function(){return _0x30b608;});}return _0x30b608;}return null;})[_0xd00c('0x1f')](respondWithResult(_0x32a224,null))[_0xd00c('0x28')](handleError(_0x32a224,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports['reject']=function(_0x366cad,_0xfc5884,_0x425d6b){var _0x3e3b61={'agent':{},'channel':'openchannel'};if(_0x366cad[_0xd00c('0x59')]['id']){delete _0x366cad[_0xd00c('0x59')]['id'];}_0x366cad[_0xd00c('0x59')][_0xd00c('0x62')]=_0x366cad[_0xd00c('0x59')][_0xd00c('0x62')]||_0x366cad[_0xd00c('0x61')]['id'];_0x3e3b61[_0xd00c('0x75')]['id']=_0x366cad[_0xd00c('0x59')]['UserId'];return db[_0xd00c('0x3c')]['find']({'where':{'id':_0x366cad[_0xd00c('0x55')]['id'],'UserId':null}})[_0xd00c('0x1f')](handleEntityNotFound(_0xfc5884,null))[_0xd00c('0x1f')](function(_0x110242){if(_0x110242){_0x3e3b61['message']=_0x110242[_0xd00c('0x63')]({'plain':!![]});return db[_0xd00c('0x64')]['find']({'where':{'id':_0x110242[_0xd00c('0x65')]}});}return null;})[_0xd00c('0x1f')](handleEntityNotFound(_0xfc5884,null))['then'](function(_0x3586c5){if(_0x3586c5){_0x3e3b61[_0xd00c('0x69')]=_0x3586c5[_0xd00c('0x63')]({'plain':!![]});interaction_log[_0xd00c('0x20')](_0xd00c('0x7f'),_0x366cad[_0xd00c('0x61')]['id'],_0x366cad[_0xd00c('0x61')][_0xd00c('0x38')],_0x366cad[_0xd00c('0x61')][_0xd00c('0x6b')],_0x3e3b61[_0xd00c('0x69')]['id'],_0x366cad[_0xd00c('0x59')]?JSON[_0xd00c('0x23')](_0x366cad[_0xd00c('0x59')]):_0xd00c('0x6c'));return respondWithRpcPromise(_0xd00c('0x80'),'rejectMessage',_0x3e3b61);}return null;})[_0xd00c('0x1f')](function(_0x9e95c5){var _0x5426cc=_0xd00c('0x6e')+_0x9e95c5[_0xd00c('0x26')]['ContactId'];return db[_0xd00c('0x81')][_0xd00c('0x41')](_0x5426cc,{'type':db['Sequelize'][_0xd00c('0x71')][_0xd00c('0x72')],'raw':!![]})['then'](function(_0x35e56f){return _0x35e56f;});})['then'](function(_0x16b377){if(_0x16b377){_0x3e3b61[_0xd00c('0x26')][_0xd00c('0x73')]=_0x16b377[0x0];if(!_0x366cad['body']['UserId'])return;return db[_0xd00c('0x74')][_0xd00c('0x5a')]({'where':{'id':_0x366cad[_0xd00c('0x59')][_0xd00c('0x62')],'role':'agent'},'attributes':['id','name',_0xd00c('0x76'),_0xd00c('0x77'),_0xd00c('0x82')],'raw':!![]});}return null;})[_0xd00c('0x1f')](function(_0x366ec8){if(!_0x366ec8)return null;_0x3e3b61[_0xd00c('0x26')][_0xd00c('0x75')]=_0x366ec8;return _0x3e3b61;})[_0xd00c('0x1f')](function(_0x20dc16){if(_0x20dc16){_0x20dc16[_0xd00c('0x26')]['interface']=util[_0xd00c('0x60')]('SIP/%s',_0x366cad[_0xd00c('0x61')][_0xd00c('0x38')]);_0x20dc16[_0xd00c('0x26')][_0xd00c('0x7b')]=_0x3e3b61['channel'];_0x20dc16[_0xd00c('0x26')][_0xd00c('0x7c')]=_0x3e3b61[_0xd00c('0x7b')];_0x20dc16[_0xd00c('0x26')]['event']='reject';respondWithRpcPromise(_0xd00c('0x7e'),'EventManager',{'event':_0xd00c('0x83'),'message':_0x20dc16['message']},client9002);return _0x3e3b61;}return null;})[_0xd00c('0x1f')](respondWithResult(_0xfc5884,null))[_0xd00c('0x28')](handleError(_0xfc5884,null));}; \ No newline at end of file +var _0xf1bd=['SIP/%s','channel','motionChannel','event','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','QueryTypes','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','OpenchannelMessage','includeAll','include','findAll','catch','show','params','create','body','find','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','agent','fullname','email','internal','interface'];(function(_0x37829c,_0x1a9992){var _0xaeaa8c=function(_0x142323){while(--_0x142323){_0x37829c['push'](_0x37829c['shift']());}};_0xaeaa8c(++_0x1a9992);}(_0xf1bd,0x19a));var _0xdf1b=function(_0x353742,_0x5a4979){_0x353742=_0x353742-0x0;var _0x1471f7=_0xf1bd[_0x353742];return _0x1471f7;};'use strict';var emlformat=require(_0xdf1b('0x0'));var rimraf=require(_0xdf1b('0x1'));var zipdir=require(_0xdf1b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf1b('0x3'));var moment=require(_0xdf1b('0x4'));var BPromise=require(_0xdf1b('0x5'));var Mustache=require(_0xdf1b('0x6'));var util=require(_0xdf1b('0x7'));var path=require(_0xdf1b('0x8'));var sox=require(_0xdf1b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf1b('0xa'));var _=require(_0xdf1b('0xb'));var squel=require(_0xdf1b('0xc'));var crypto=require(_0xdf1b('0xd'));var jsforce=require(_0xdf1b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdf1b('0xf'));var querystring=require(_0xdf1b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdf1b('0x11'));var qs=require(_0xdf1b('0x12'));var as=require(_0xdf1b('0x13'));var hardwareService=require(_0xdf1b('0x14'));var logger=require(_0xdf1b('0x15'))('api');var utils=require(_0xdf1b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdf1b('0x17'))['db'];config[_0xdf1b('0x18')]=_[_0xdf1b('0x19')](config['redis'],{'host':_0xdf1b('0x1a'),'port':0x18eb});var socket=require(_0xdf1b('0x1b'))(new Redis(config[_0xdf1b('0x18')]));require('./openchannelMessage.socket')[_0xdf1b('0x1c')](socket);var jayson=require(_0xdf1b('0x1d'));var client=jayson[_0xdf1b('0x1e')][_0xdf1b('0x1f')]({'port':0x232c});var client9002=jayson[_0xdf1b('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eb4b5,_0x58a0ae,_0xb90f9,_0x421a31){return new BPromise(function(_0x51be2a,_0x585ea9){var _0x1b0365=_0x421a31||client;return _0x1b0365[_0xdf1b('0x20')](_0x3eb4b5,_0xb90f9)['then'](function(_0x3e66f2){logger['info'](_0xdf1b('0x21'),_0x58a0ae,_0xdf1b('0x22'));logger[_0xdf1b('0x23')](_0xdf1b('0x24'),_0x58a0ae,'request\x20sent',JSON[_0xdf1b('0x25')](_0x3e66f2));if(_0x3e66f2[_0xdf1b('0x26')]){if(_0x3e66f2[_0xdf1b('0x26')][_0xdf1b('0x27')]===0x1f4){logger[_0xdf1b('0x26')](_0xdf1b('0x21'),_0x58a0ae,_0x3e66f2[_0xdf1b('0x26')][_0xdf1b('0x28')]);return _0x585ea9(_0x3e66f2[_0xdf1b('0x26')][_0xdf1b('0x28')]);}logger[_0xdf1b('0x26')](_0xdf1b('0x21'),_0x58a0ae,_0x3e66f2[_0xdf1b('0x26')]['message']);return _0x51be2a(_0x3e66f2['error']['message']);}else{logger[_0xdf1b('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x58a0ae,'request\x20sent');_0x51be2a(_0x3e66f2[_0xdf1b('0x2a')]['message']);}})['catch'](function(_0x57939a){logger[_0xdf1b('0x26')](_0xdf1b('0x21'),_0x58a0ae,_0x57939a);_0x585ea9(_0x57939a);});});}function respondWithStatusCode(_0x189aa7,_0x2fb125){_0x2fb125=_0x2fb125||0xcc;return function(_0x162d47){if(_0x162d47){return _0x189aa7[_0xdf1b('0x2b')](_0x2fb125);}return _0x189aa7['status'](_0x2fb125)[_0xdf1b('0x2c')]();};}function respondWithResult(_0x490e78,_0x4a52a4){_0x4a52a4=_0x4a52a4||0xc8;return function(_0x52636d){if(_0x52636d){return _0x490e78[_0xdf1b('0x2d')](_0x4a52a4)['json'](_0x52636d);}};}function respondWithFilteredResult(_0x1a3dbd,_0x39f5ec){return function(_0x2b8bba){if(_0x2b8bba){var _0x1090c7=typeof _0x39f5ec['offset']==='undefined'&&typeof _0x39f5ec[_0xdf1b('0x2e')]===_0xdf1b('0x2f');var _0x35c7cd=_0x2b8bba['count'];var _0x108759=_0x1090c7?0x0:_0x39f5ec[_0xdf1b('0x30')];var _0x2359a6=_0x1090c7?_0x2b8bba[_0xdf1b('0x31')]:_0x39f5ec[_0xdf1b('0x30')]+_0x39f5ec['limit'];var _0x562647;if(_0x2359a6>=_0x35c7cd){_0x2359a6=_0x35c7cd;_0x562647=0xc8;}else{_0x562647=0xce;}_0x1a3dbd[_0xdf1b('0x2d')](_0x562647);return _0x1a3dbd[_0xdf1b('0x32')](_0xdf1b('0x33'),_0x108759+'-'+_0x2359a6+'/'+_0x35c7cd)[_0xdf1b('0x34')](_0x2b8bba);}return null;};}function patchUpdates(_0x3e627e){return function(_0x58042d){try{jsonpatch[_0xdf1b('0x35')](_0x58042d,_0x3e627e,!![]);}catch(_0x5c9444){return BPromise[_0xdf1b('0x36')](_0x5c9444);}return _0x58042d['save']();};}function saveUpdates(_0xc1d5b2,_0xa5c71f){return function(_0x565989){if(_0x565989){return _0x565989[_0xdf1b('0x37')](_0xc1d5b2)[_0xdf1b('0x38')](function(_0x2fcbb0){return _0x2fcbb0;});}return null;};}function removeEntity(_0x38f9f2,_0x24b114){return function(_0x297ee4){if(_0x297ee4){return _0x297ee4[_0xdf1b('0x39')]()['then'](function(){_0x38f9f2[_0xdf1b('0x2d')](0xcc)[_0xdf1b('0x2c')]();});}};}function handleEntityNotFound(_0x1c461b,_0x5860bf){return function(_0x19fc48){if(!_0x19fc48){_0x1c461b[_0xdf1b('0x2b')](0x194);}return _0x19fc48;};}function handleError(_0x507050,_0x54df53){_0x54df53=_0x54df53||0x1f4;return function(_0x409a65){logger['error'](_0x409a65[_0xdf1b('0x3a')]);if(_0x409a65[_0xdf1b('0x3b')]){delete _0x409a65[_0xdf1b('0x3b')];}_0x507050[_0xdf1b('0x2d')](_0x54df53)[_0xdf1b('0x3c')](_0x409a65);};}exports[_0xdf1b('0x3d')]=function(_0x303b7c,_0x45a7d6){var _0x719add={},_0x2640a3={},_0xf7a765={'count':0x0,'rows':[]};var _0x378ed3=_[_0xdf1b('0x3e')](db['OpenchannelMessage'][_0xdf1b('0x3f')],function(_0x163388){return{'name':_0x163388[_0xdf1b('0x40')],'type':_0x163388[_0xdf1b('0x41')]['key']};});_0x2640a3[_0xdf1b('0x42')]=_[_0xdf1b('0x3e')](_0x378ed3,_0xdf1b('0x3b'));_0x2640a3[_0xdf1b('0x43')]=_[_0xdf1b('0x44')](_0x303b7c[_0xdf1b('0x43')]);_0x2640a3[_0xdf1b('0x45')]=_[_0xdf1b('0x46')](_0x2640a3[_0xdf1b('0x42')],_0x2640a3[_0xdf1b('0x43')]);_0x719add['attributes']=_[_0xdf1b('0x46')](_0x2640a3['model'],qs[_0xdf1b('0x47')](_0x303b7c[_0xdf1b('0x43')][_0xdf1b('0x47')]));_0x719add[_0xdf1b('0x48')]=_0x719add[_0xdf1b('0x48')][_0xdf1b('0x49')]?_0x719add[_0xdf1b('0x48')]:_0x2640a3['model'];if(!_0x303b7c[_0xdf1b('0x43')]['hasOwnProperty'](_0xdf1b('0x4a'))){_0x719add[_0xdf1b('0x2e')]=qs[_0xdf1b('0x2e')](_0x303b7c[_0xdf1b('0x43')][_0xdf1b('0x2e')]);_0x719add[_0xdf1b('0x30')]=qs['offset'](_0x303b7c[_0xdf1b('0x43')][_0xdf1b('0x30')]);}_0x719add['order']=qs[_0xdf1b('0x4b')](_0x303b7c['query'][_0xdf1b('0x4b')]);_0x719add[_0xdf1b('0x4c')]=qs[_0xdf1b('0x45')](_[_0xdf1b('0x4d')](_0x303b7c['query'],_0x2640a3['filters']),_0x378ed3);if(_0x303b7c[_0xdf1b('0x43')][_0xdf1b('0x4e')]){_0x719add[_0xdf1b('0x4c')]=_['merge'](_0x719add[_0xdf1b('0x4c')],{'$or':_[_0xdf1b('0x3e')](_0x378ed3,function(_0x1de170){if(_0x1de170[_0xdf1b('0x41')]!==_0xdf1b('0x4f')){var _0x1d0aca={};_0x1d0aca[_0x1de170['name']]={'$like':'%'+_0x303b7c[_0xdf1b('0x43')][_0xdf1b('0x4e')]+'%'};return _0x1d0aca;}})});}_0x719add=_[_0xdf1b('0x50')]({},_0x719add,_0x303b7c[_0xdf1b('0x51')]);var _0x107c72={'where':_0x719add[_0xdf1b('0x4c')]};return db[_0xdf1b('0x52')][_0xdf1b('0x31')](_0x107c72)[_0xdf1b('0x38')](function(_0x10abd1){_0xf7a765['count']=_0x10abd1;if(_0x303b7c[_0xdf1b('0x43')][_0xdf1b('0x53')]){_0x719add[_0xdf1b('0x54')]=[{'all':!![]}];}return db[_0xdf1b('0x52')][_0xdf1b('0x55')](_0x719add);})[_0xdf1b('0x38')](function(_0x3f5e27){_0xf7a765['rows']=_0x3f5e27;return _0xf7a765;})[_0xdf1b('0x38')](respondWithFilteredResult(_0x45a7d6,_0x719add))[_0xdf1b('0x56')](handleError(_0x45a7d6,null));};exports[_0xdf1b('0x57')]=function(_0x566c1b,_0x26fcf1){var _0x2c6d49={'raw':!![],'where':{'id':_0x566c1b[_0xdf1b('0x58')]['id']}},_0x156284={};_0x156284[_0xdf1b('0x42')]=_['keys'](db['OpenchannelMessage'][_0xdf1b('0x3f')]);_0x156284['query']=_['keys'](_0x566c1b[_0xdf1b('0x43')]);_0x156284[_0xdf1b('0x45')]=_[_0xdf1b('0x46')](_0x156284[_0xdf1b('0x42')],_0x156284[_0xdf1b('0x43')]);_0x2c6d49[_0xdf1b('0x48')]=_['intersection'](_0x156284[_0xdf1b('0x42')],qs[_0xdf1b('0x47')](_0x566c1b['query'][_0xdf1b('0x47')]));_0x2c6d49[_0xdf1b('0x48')]=_0x2c6d49[_0xdf1b('0x48')][_0xdf1b('0x49')]?_0x2c6d49[_0xdf1b('0x48')]:_0x156284[_0xdf1b('0x42')];if(_0x566c1b['query'][_0xdf1b('0x53')]){_0x2c6d49[_0xdf1b('0x54')]=[{'all':!![]}];}_0x2c6d49=_[_0xdf1b('0x50')]({},_0x2c6d49,_0x566c1b[_0xdf1b('0x51')]);return db['OpenchannelMessage']['find'](_0x2c6d49)[_0xdf1b('0x38')](handleEntityNotFound(_0x26fcf1,null))[_0xdf1b('0x38')](respondWithResult(_0x26fcf1,null))[_0xdf1b('0x56')](handleError(_0x26fcf1,null));};exports[_0xdf1b('0x59')]=function(_0x1d4e53,_0x48eb09){return db[_0xdf1b('0x52')][_0xdf1b('0x59')](_0x1d4e53[_0xdf1b('0x5a')],{})[_0xdf1b('0x38')](respondWithResult(_0x48eb09,0xc9))[_0xdf1b('0x56')](handleError(_0x48eb09,null));};exports[_0xdf1b('0x37')]=function(_0x1246a8,_0x44c112){if(_0x1246a8[_0xdf1b('0x5a')]['id']){delete _0x1246a8[_0xdf1b('0x5a')]['id'];}return db['OpenchannelMessage'][_0xdf1b('0x5b')]({'where':{'id':_0x1246a8[_0xdf1b('0x58')]['id']}})[_0xdf1b('0x38')](handleEntityNotFound(_0x44c112,null))[_0xdf1b('0x38')](saveUpdates(_0x1246a8[_0xdf1b('0x5a')],null))['then'](respondWithResult(_0x44c112,null))[_0xdf1b('0x56')](handleError(_0x44c112,null));};exports[_0xdf1b('0x39')]=function(_0x42cf44,_0x254728){return db[_0xdf1b('0x52')][_0xdf1b('0x5b')]({'where':{'id':_0x42cf44['params']['id']}})[_0xdf1b('0x38')](handleEntityNotFound(_0x254728,null))[_0xdf1b('0x38')](removeEntity(_0x254728,null))[_0xdf1b('0x56')](handleError(_0x254728,null));};exports[_0xdf1b('0x5c')]=function(_0x3c86f1,_0x2db9a0){return db['OpenchannelMessage']['describe']()[_0xdf1b('0x38')](respondWithResult(_0x2db9a0,null))[_0xdf1b('0x56')](handleError(_0x2db9a0,null));};var interaction_log=require(_0xdf1b('0x15'))(_0xdf1b('0x5d'));exports[_0xdf1b('0x5e')]=function(_0x2610c8,_0xe630b9,_0x23a80e){var _0x16c930={'agent':{},'channel':_0xdf1b('0x5f')};if(_0x2610c8[_0xdf1b('0x5a')]['id']){delete _0x2610c8[_0xdf1b('0x5a')]['id'];}_0x2610c8[_0xdf1b('0x5a')][_0xdf1b('0x60')]=!![];_0x2610c8[_0xdf1b('0x5a')][_0xdf1b('0x61')]=moment()[_0xdf1b('0x62')](_0xdf1b('0x63'));_0x2610c8[_0xdf1b('0x5a')][_0xdf1b('0x64')]=_0x2610c8[_0xdf1b('0x5a')][_0xdf1b('0x64')]||_0x2610c8[_0xdf1b('0x65')]['id'];_0x16c930['agent']['id']=_0x2610c8['body'][_0xdf1b('0x64')];return db[_0xdf1b('0x52')]['find']({'where':{'id':_0x2610c8[_0xdf1b('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xe630b9,null))[_0xdf1b('0x38')](saveUpdates(_0x2610c8['body'],null))[_0xdf1b('0x38')](function(_0x4e0188){if(_0x4e0188){_0x16c930[_0xdf1b('0x28')]=_0x4e0188[_0xdf1b('0x66')]({'plain':!![]});return db[_0xdf1b('0x67')]['find']({'where':{'id':_0x4e0188[_0xdf1b('0x68')]}});}return null;})['then'](handleEntityNotFound(_0xe630b9,null))['then'](function(_0x1663ba){if(_0x1663ba){return _0x1663ba[_0xdf1b('0x37')]({'UserId':_0x2610c8[_0xdf1b('0x5a')][_0xdf1b('0x64')],'read1stAt':_[_0xdf1b('0x69')](_0x1663ba[_0xdf1b('0x6a')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdf1b('0x38')](function(_0x1f12a7){if(_0x1f12a7){_0x16c930[_0xdf1b('0x6b')]=_0x1f12a7[_0xdf1b('0x66')]({'plain':!![]});interaction_log[_0xdf1b('0x29')](_0xdf1b('0x6c'),_0x2610c8[_0xdf1b('0x65')]['id'],_0x2610c8[_0xdf1b('0x65')]['name'],_0x2610c8[_0xdf1b('0x65')][_0xdf1b('0x6d')],_0x16c930[_0xdf1b('0x6b')]['id'],_0x2610c8['body']?JSON[_0xdf1b('0x25')](_0x2610c8[_0xdf1b('0x5a')]):_0xdf1b('0x6e'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x16c930);}return null;})[_0xdf1b('0x38')](function(_0x374993){var _0x32440b=_0xdf1b('0x6f')+_0x374993[_0xdf1b('0x28')][_0xdf1b('0x70')];return db[_0xdf1b('0x71')]['query'](_0x32440b,{'type':db['Sequelize']['QueryTypes'][_0xdf1b('0x72')],'raw':!![]})[_0xdf1b('0x38')](function(_0x44305a){return _0x44305a;});})[_0xdf1b('0x38')](function(_0x37c223){if(_0x37c223){_0x16c930['message'][_0xdf1b('0x73')]=_0x37c223[0x0];if(!_0x2610c8[_0xdf1b('0x5a')][_0xdf1b('0x64')])return;return db[_0xdf1b('0x74')][_0xdf1b('0x5b')]({'where':{'id':_0x2610c8[_0xdf1b('0x5a')]['UserId'],'role':_0xdf1b('0x75')},'attributes':['id','name',_0xdf1b('0x76'),_0xdf1b('0x77'),_0xdf1b('0x78')],'raw':!![]});}return null;})[_0xdf1b('0x38')](function(_0x5216a4){if(!_0x5216a4)return null;_0x16c930['message']['agent']=_0x5216a4;return _0x16c930;})[_0xdf1b('0x38')](function(_0xad80c){if(_0xad80c){if(_0x2610c8[_0xdf1b('0x5a')]['manual']){_0x16c930[_0xdf1b('0x28')][_0xdf1b('0x79')]=util[_0xdf1b('0x62')](_0xdf1b('0x7a'),_0x2610c8['user'][_0xdf1b('0x3b')]);_0x16c930[_0xdf1b('0x28')][_0xdf1b('0x7b')]=_0x16c930[_0xdf1b('0x7b')];_0x16c930['message'][_0xdf1b('0x7c')]=_0x16c930[_0xdf1b('0x7b')];_0x16c930[_0xdf1b('0x28')][_0xdf1b('0x7d')]=_0xdf1b('0x5e');return respondWithRpcPromise(_0xdf1b('0x7e'),_0xdf1b('0x7e'),{'event':'acceptmessage','message':_0x16c930[_0xdf1b('0x28')]},client9002)[_0xdf1b('0x38')](function(){return _0x16c930;});}return _0x16c930;}return null;})[_0xdf1b('0x38')](respondWithResult(_0xe630b9,null))[_0xdf1b('0x56')](handleError(_0xe630b9,null));};var interaction_log=require('../../config/logger')(_0xdf1b('0x5d'));exports[_0xdf1b('0x36')]=function(_0x499537,_0x43e2b1,_0x2b476d){var _0x56948e={'agent':{},'channel':_0xdf1b('0x5f')};if(_0x499537[_0xdf1b('0x5a')]['id']){delete _0x499537['body']['id'];}_0x499537['body']['UserId']=_0x499537[_0xdf1b('0x5a')][_0xdf1b('0x64')]||_0x499537['user']['id'];_0x56948e[_0xdf1b('0x75')]['id']=_0x499537[_0xdf1b('0x5a')][_0xdf1b('0x64')];return db[_0xdf1b('0x52')][_0xdf1b('0x5b')]({'where':{'id':_0x499537[_0xdf1b('0x58')]['id'],'UserId':null}})[_0xdf1b('0x38')](handleEntityNotFound(_0x43e2b1,null))[_0xdf1b('0x38')](function(_0x2ecdcd){if(_0x2ecdcd){_0x56948e[_0xdf1b('0x28')]=_0x2ecdcd[_0xdf1b('0x66')]({'plain':!![]});return db[_0xdf1b('0x67')][_0xdf1b('0x5b')]({'where':{'id':_0x2ecdcd['OpenchannelInteractionId']}});}return null;})[_0xdf1b('0x38')](handleEntityNotFound(_0x43e2b1,null))[_0xdf1b('0x38')](function(_0x350b2c){if(_0x350b2c){_0x56948e['interaction']=_0x350b2c[_0xdf1b('0x66')]({'plain':!![]});interaction_log['info'](_0xdf1b('0x7f'),_0x499537['user']['id'],_0x499537['user']['name'],_0x499537['user'][_0xdf1b('0x6d')],_0x56948e[_0xdf1b('0x6b')]['id'],_0x499537[_0xdf1b('0x5a')]?JSON['stringify'](_0x499537[_0xdf1b('0x5a')]):'null');return respondWithRpcPromise(_0xdf1b('0x80'),_0xdf1b('0x81'),_0x56948e);}return null;})['then'](function(_0x4feec6){var _0x54c75d=_0xdf1b('0x6f')+_0x4feec6[_0xdf1b('0x28')][_0xdf1b('0x70')];return db['sequelize'][_0xdf1b('0x43')](_0x54c75d,{'type':db[_0xdf1b('0x82')][_0xdf1b('0x83')]['SELECT'],'raw':!![]})[_0xdf1b('0x38')](function(_0x54a55b){return _0x54a55b;});})[_0xdf1b('0x38')](function(_0x1784be){if(_0x1784be){_0x56948e[_0xdf1b('0x28')]['contact']=_0x1784be[0x0];if(!_0x499537[_0xdf1b('0x5a')][_0xdf1b('0x64')])return;return db['User'][_0xdf1b('0x5b')]({'where':{'id':_0x499537[_0xdf1b('0x5a')][_0xdf1b('0x64')],'role':'agent'},'attributes':['id',_0xdf1b('0x3b'),_0xdf1b('0x76'),'email',_0xdf1b('0x78')],'raw':!![]});}return null;})[_0xdf1b('0x38')](function(_0x1fbe19){if(!_0x1fbe19)return null;_0x56948e[_0xdf1b('0x28')][_0xdf1b('0x75')]=_0x1fbe19;return _0x56948e;})['then'](function(_0x3df004){if(_0x3df004){_0x3df004[_0xdf1b('0x28')]['interface']=util[_0xdf1b('0x62')](_0xdf1b('0x7a'),_0x499537[_0xdf1b('0x65')][_0xdf1b('0x3b')]);_0x3df004[_0xdf1b('0x28')][_0xdf1b('0x7b')]=_0x56948e[_0xdf1b('0x7b')];_0x3df004['message'][_0xdf1b('0x7c')]=_0x56948e['channel'];_0x3df004['message'][_0xdf1b('0x7d')]=_0xdf1b('0x36');respondWithRpcPromise(_0xdf1b('0x7e'),_0xdf1b('0x7e'),{'event':_0xdf1b('0x84'),'message':_0x3df004[_0xdf1b('0x28')]},client9002);return _0x56948e;}return null;})[_0xdf1b('0x38')](respondWithResult(_0x43e2b1,null))['catch'](handleError(_0x43e2b1,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index c6fdc7a..e0ef67c 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 _0x1aee=['events','../../mysqldb','OpenchannelMessage','save','update','remove','emit','exports'];(function(_0x5a26db,_0x2c5ccd){var _0x4619dd=function(_0x21e28f){while(--_0x21e28f){_0x5a26db['push'](_0x5a26db['shift']());}};_0x4619dd(++_0x2c5ccd);}(_0x1aee,0x1d0));var _0xe1ae=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x1aee[_0x10004e];return _0x5af990;};'use strict';var EventEmitter=require(_0xe1ae('0x0'));var OpenchannelMessage=require(_0xe1ae('0x1'))['db'][_0xe1ae('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe1ae('0x3'),'afterUpdate':_0xe1ae('0x4'),'afterDestroy':_0xe1ae('0x5')};function emitEvent(_0x4f450f){return function(_0x3c0db6,_0x5d2e12,_0x449ce4){OpenchannelMessageEvents['emit'](_0x4f450f+':'+_0x3c0db6['id'],_0x3c0db6);OpenchannelMessageEvents[_0xe1ae('0x6')](_0x4f450f,_0x3c0db6);_0x449ce4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xe1ae('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xf1c2=['update','hasOwnProperty','hook','exports','OpenchannelMessage','setMaxListeners'];(function(_0x27269f,_0x4e421b){var _0x385bdb=function(_0x2c0cbd){while(--_0x2c0cbd){_0x27269f['push'](_0x27269f['shift']());}};_0x385bdb(++_0x4e421b);}(_0xf1c2,0x1ae));var _0x2f1c=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0xf1c2[_0x5eb22e];return _0x27fed5;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0x2f1c('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2f1c('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2f1c('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5d19bb){return function(_0x3d226a,_0x4a3b70,_0x3aa828){OpenchannelMessageEvents['emit'](_0x5d19bb+':'+_0x3d226a['id'],_0x3d226a);OpenchannelMessageEvents['emit'](_0x5d19bb,_0x3d226a);_0x3aa828(null);};}for(var e in events){if(events[_0x2f1c('0x3')](e)){var event=events[e];OpenchannelMessage[_0x2f1c('0x4')](e,emitEvent(event));}}module[_0x2f1c('0x5')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 6dcdb86..7b42208 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 _0xb688=['then','replyUri','info','format','length','Interaction','omit','Contact','POST','threadId','update','OpenchannelMessage,\x20%s,\x20%s','afterCreate','inspect','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','catch','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','keys'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb688,0xcf));var _0x8b68=function(_0xd8192b,_0x1060c4){_0xd8192b=_0xd8192b-0x0;var _0x3c3a12=_0xb688[_0xd8192b];return _0x3c3a12;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[{'name':_0x8b68('0xc'),'fields':[_0x8b68('0xd')],'type':_0x8b68('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f9685,_0x261753,_0x21d944){var _0x24e0b0=_0x583d16[_0x8b68('0xf')];var _0x418775=_0x3f9685[_0x8b68('0x10')]({'plain':!![]});if(_0x418775[_0x8b68('0x11')]['toLowerCase']()==='in'||_0x418775[_0x8b68('0x11')][_0x8b68('0x12')]()===_0x8b68('0x13')&&!_0x418775[_0x8b68('0x14')]&&!_[_0x8b68('0x15')](_0x418775[_0x8b68('0x16')])){_0x24e0b0[_0x8b68('0x17')][_0x8b68('0x18')]({'where':{'id':_0x418775[_0x8b68('0x19')]}})['then'](function(_0xb2df35){if(_0xb2df35){_0xb2df35['update']({'lastMsgAt':_0x418775['createdAt'],'lastMsgDirection':_0x418775[_0x8b68('0x11')][_0x8b68('0x12')]()});}})[_0x8b68('0x1a')](function(_0x5d3468){console['error'](_0x5d3468);});}if(_0x418775[_0x8b68('0x11')]==='out'&&!_0x418775[_0x8b68('0x14')]){var _0xb44923;_0x24e0b0[_0x8b68('0x1b')][_0x8b68('0x1c')]()['then'](function(_0xd17693){return _0x24e0b0[_0x8b68('0x1d')]['find']({'where':{'id':_0x418775[_0x8b68('0x1e')]},'include':[{'model':_0x24e0b0[_0x8b68('0x17')],'as':_0x8b68('0x1f'),'where':{'id':_0x418775[_0x8b68('0x19')]},'limit':0x1,'include':[{'model':_0x24e0b0[_0x8b68('0x1b')],'as':'Contact','attributes':_[_0x8b68('0x20')](_0xd17693)}]}]});})[_0x8b68('0x21')](function(_0x59e9b1){_0xb44923=_0x59e9b1[_0x8b68('0x10')]({'plain':!![]});if(_0xb44923&&_0xb44923[_0x8b68('0x22')]){logger[_0x8b68('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x8b68('0x24')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x418775['id'],_0xb44923[_0x8b68('0x22')]));if(_0xb44923[_0x8b68('0x1f')]&&_0xb44923[_0x8b68('0x1f')][_0x8b68('0x25')]){_0x418775[_0x8b68('0x26')]=_[_0x8b68('0x27')](_0xb44923['Interactions'][0x0],_0x8b68('0x28'));_0x418775[_0x8b68('0x28')]=_0xb44923['Interactions'][0x0][_0x8b68('0x28')];}var _0x261753={'method':_0x8b68('0x29'),'uri':encodeURI(_0xb44923['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x261753['method']){case'GET':_0x261753['qs']=_0x418775;break;case _0x8b68('0x29'):_0x261753[_0x8b68('0xd')]=_0x418775;break;}return rp(_0x261753)[_0x8b68('0x21')](function(_0x583476){logger[_0x8b68('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x8b68('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x418775['id'],_0xb44923[_0x8b68('0x22')]));if(_0x583476[_0x8b68('0xd')]['threadId']&&_0x583476['body'][_0x8b68('0x2a')]!=_0x418775[_0x8b68('0x26')][_0x8b68('0x2a')]){return _0x24e0b0[_0x8b68('0x17')][_0x8b68('0x2b')]({'threadId':_0x583476[_0x8b68('0xd')][_0x8b68('0x2a')]},{'logging':!![],'where':{'id':_0x418775['Interaction']['id']}});}else{return;}})[_0x8b68('0x21')](function(){return _0x3f9685['update']({'read':!![]});})[_0x8b68('0x1a')](function(_0x133b75){logger['error'](_0x8b68('0x2c'),_0x8b68('0x2d'),util[_0x8b68('0x2e')](_0x133b75,{'showHidden':![],'depth':null}));_0x21d944();});}else{_0x21d944();}})['finally'](function(){_0x21d944();});}else{_0x21d944();}}},'charset':'utf8mb4','collate':_0x8b68('0x2f')});}; \ No newline at end of file +var _0xe511=['define','fti_openchannel_messages','body','models','get','toLowerCase','direction','out','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','OpenchannelAccount','find','OpenchannelAccountId','Contact','keys','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interactions','length','Interaction','omit','POST','info','format','threadId','OpenchannelMessage,\x20%s,\x20%s','inspect','finally','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports'];(function(_0x39503e,_0x1bc198){var _0x5505e8=function(_0x21bcf1){while(--_0x21bcf1){_0x39503e['push'](_0x39503e['shift']());}};_0x5505e8(++_0x1bc198);}(_0xe511,0x16f));var _0x1e51=function(_0x37dc1d,_0xbf91ef){_0x37dc1d=_0x37dc1d-0x0;var _0x4ac931=_0xe511[_0x37dc1d];return _0x4ac931;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var logger=require('../../config/logger')(_0x1e51('0x2'));var moment=require('moment');var BPromise=require(_0x1e51('0x3'));var rp=require(_0x1e51('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var attributes=require(_0x1e51('0x7'));module[_0x1e51('0x8')]=function(_0x480cca,_0x26b22c){return _0x480cca[_0x1e51('0x9')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x1e51('0xa'),'fields':[_0x1e51('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49d359,_0x658941,_0x2712e0){var _0x29da1f=_0x480cca[_0x1e51('0xc')];var _0x4241a6=_0x49d359[_0x1e51('0xd')]({'plain':!![]});if(_0x4241a6['direction'][_0x1e51('0xe')]()==='in'||_0x4241a6[_0x1e51('0xf')][_0x1e51('0xe')]()===_0x1e51('0x10')&&!_0x4241a6[_0x1e51('0x11')]&&!_[_0x1e51('0x12')](_0x4241a6['UserId'])){_0x29da1f[_0x1e51('0x13')][_0x1e51('0x14')]({'where':{'id':_0x4241a6[_0x1e51('0x15')]}})[_0x1e51('0x16')](function(_0x21bcbd){if(_0x21bcbd){_0x21bcbd[_0x1e51('0x17')]({'lastMsgAt':_0x4241a6[_0x1e51('0x18')],'lastMsgDirection':_0x4241a6[_0x1e51('0xf')][_0x1e51('0xe')]()});}})[_0x1e51('0x19')](function(_0x5a5c07){console[_0x1e51('0x1a')](_0x5a5c07);});}if(_0x4241a6[_0x1e51('0xf')]===_0x1e51('0x10')&&!_0x4241a6['secret']){var _0xa3b410;_0x29da1f['CmContact']['describe']()[_0x1e51('0x16')](function(_0x27dcad){return _0x29da1f[_0x1e51('0x1b')][_0x1e51('0x1c')]({'where':{'id':_0x4241a6[_0x1e51('0x1d')]},'include':[{'model':_0x29da1f[_0x1e51('0x13')],'as':'Interactions','where':{'id':_0x4241a6[_0x1e51('0x15')]},'limit':0x1,'include':[{'model':_0x29da1f['CmContact'],'as':_0x1e51('0x1e'),'attributes':_[_0x1e51('0x1f')](_0x27dcad)}]}]});})[_0x1e51('0x16')](function(_0x183a95){_0xa3b410=_0x183a95['get']({'plain':!![]});if(_0xa3b410&&_0xa3b410['replyUri']){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x1e51('0x20'),util['format'](_0x1e51('0x21'),_0x4241a6['id'],_0xa3b410[_0x1e51('0x22')]));if(_0xa3b410[_0x1e51('0x23')]&&_0xa3b410[_0x1e51('0x23')][_0x1e51('0x24')]){_0x4241a6[_0x1e51('0x25')]=_[_0x1e51('0x26')](_0xa3b410[_0x1e51('0x23')][0x0],'Contact');_0x4241a6['Contact']=_0xa3b410[_0x1e51('0x23')][0x0][_0x1e51('0x1e')];}var _0x658941={'method':_0x1e51('0x27'),'uri':encodeURI(_0xa3b410['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x658941['method']){case'GET':_0x658941['qs']=_0x4241a6;break;case _0x1e51('0x27'):_0x658941[_0x1e51('0xb')]=_0x4241a6;break;}return rp(_0x658941)[_0x1e51('0x16')](function(_0x5412bc){logger[_0x1e51('0x28')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x1e51('0x29')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x4241a6['id'],_0xa3b410[_0x1e51('0x22')]));if(_0x5412bc[_0x1e51('0xb')]['threadId']&&_0x5412bc[_0x1e51('0xb')][_0x1e51('0x2a')]!=_0x4241a6[_0x1e51('0x25')][_0x1e51('0x2a')]){return _0x29da1f['OpenchannelInteraction']['update']({'threadId':_0x5412bc['body'][_0x1e51('0x2a')]},{'logging':!![],'where':{'id':_0x4241a6[_0x1e51('0x25')]['id']}});}else{return;}})[_0x1e51('0x16')](function(){return _0x49d359[_0x1e51('0x17')]({'read':!![]});})[_0x1e51('0x19')](function(_0x27d9a2){logger[_0x1e51('0x1a')](_0x1e51('0x2b'),_0x1e51('0x20'),util[_0x1e51('0x2c')](_0x27d9a2,{'showHidden':![],'depth':null}));_0x2712e0();});}else{_0x2712e0();}})[_0x1e51('0x2d')](function(){_0x2712e0();});}else{_0x2712e0();}}},'charset':'utf8mb4','collate':_0x1e51('0x2e')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index bf8743e..24d1b56 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 _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x8e85da,_0x123600){var _0x419c05=function(_0x36d5ab){while(--_0x36d5ab){_0x8e85da['push'](_0x8e85da['shift']());}};_0x419c05(++_0x123600);}(_0xdb28,0x106));var _0x8db2=function(_0x1b6394,_0x2b649b){_0x1b6394=_0x1b6394-0x0;var _0x59547f=_0xdb28[_0x1b6394];return _0x59547f;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x1ef02d,_0x1d2dd6){var _0x23bd93=function(_0x20acf8){while(--_0x20acf8){_0x1ef02d['push'](_0x1ef02d['shift']());}};_0x23bd93(++_0x1d2dd6);}(_0xadb5,0xad));var _0x5adb=function(_0x17a44f,_0x26a7bb){_0x17a44f=_0x17a44f-0x0;var _0x5a7eda=_0xadb5[_0x17a44f];return _0x5a7eda;};'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});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index f387426..90cfe90 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 _0x0d55=['remove','emit','removeListener','register','openchannelMessage:','./openchannelMessage.events'];(function(_0x568a61,_0x2124f8){var _0x334c3b=function(_0x1afc39){while(--_0x1afc39){_0x568a61['push'](_0x568a61['shift']());}};_0x334c3b(++_0x2124f8);}(_0x0d55,0x179));var _0x50d5=function(_0x45b380,_0x478cbd){_0x45b380=_0x45b380-0x0;var _0x4cdb76=_0x0d55[_0x45b380];return _0x4cdb76;};'use strict';var OpenchannelMessageEvents=require(_0x50d5('0x0'));var events=['save',_0x50d5('0x1'),'update'];function createListener(_0x2c3984,_0x5f3c8b){return function(_0x15ced9){_0x5f3c8b[_0x50d5('0x2')](_0x2c3984,_0x15ced9);};}function removeListener(_0x1d4fb6,_0x16d217){return function(){OpenchannelMessageEvents[_0x50d5('0x3')](_0x1d4fb6,_0x16d217);};}exports[_0x50d5('0x4')]=function(_0x10716f){for(var _0x2e3fc5=0x0,_0xb0383f=events['length'];_0x2e3fc5<_0xb0383f;_0x2e3fc5++){var _0x32924d=events[_0x2e3fc5];var _0x23dadb=createListener(_0x50d5('0x5')+_0x32924d,_0x10716f);OpenchannelMessageEvents['on'](_0x32924d,_0x23dadb);}}; \ No newline at end of file +var _0xed5f=['update','emit','removeListener','register','length','openchannelMessage:','save','remove'];(function(_0x187326,_0x101065){var _0x40a27=function(_0xde2bc0){while(--_0xde2bc0){_0x187326['push'](_0x187326['shift']());}};_0x40a27(++_0x101065);}(_0xed5f,0x1e6));var _0xfed5=function(_0x16e342,_0x45b22c){_0x16e342=_0x16e342-0x0;var _0x272307=_0xed5f[_0x16e342];return _0x272307;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xfed5('0x0'),_0xfed5('0x1'),_0xfed5('0x2')];function createListener(_0x5d893b,_0x1b17f4){return function(_0x2ebed0){_0x1b17f4[_0xfed5('0x3')](_0x5d893b,_0x2ebed0);};}function removeListener(_0x1e5aae,_0x5df01a){return function(){OpenchannelMessageEvents[_0xfed5('0x4')](_0x1e5aae,_0x5df01a);};}exports[_0xfed5('0x5')]=function(_0x3d6edd){for(var _0x5a1dcc=0x0,_0x2128e=events[_0xfed5('0x6')];_0x5a1dcc<_0x2128e;_0x5a1dcc++){var _0x55f533=events[_0x5a1dcc];var _0x299fb6=createListener(_0xfed5('0x7')+_0x55f533,_0x3d6edd);OpenchannelMessageEvents['on'](_0x55f533,_0x299fb6);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 08fc4fd..f9cde17 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 _0x06e6=['/:id/members','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','update','destroy','delete','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x65d0ee,_0x2c7c57){var _0x4a506a=function(_0x388aa2){while(--_0x388aa2){_0x65d0ee['push'](_0x65d0ee['shift']());}};_0x4a506a(++_0x2c7c57);}(_0x06e6,0x112));var _0x606e=function(_0x69a748,_0x7e2ee1){_0x69a748=_0x69a748-0x0;var _0x116db0=_0x06e6[_0x69a748];return _0x116db0;};'use strict';var multer=require(_0x606e('0x0'));var util=require('util');var path=require(_0x606e('0x1'));var timeout=require(_0x606e('0x2'));var express=require(_0x606e('0x3'));var router=express['Router']();var fs_extra=require(_0x606e('0x4'));var auth=require(_0x606e('0x5'));var interaction=require(_0x606e('0x6'));var config=require(_0x606e('0x7'));var controller=require(_0x606e('0x8'));router['get']('/',auth[_0x606e('0x9')](),controller[_0x606e('0xa')]);router[_0x606e('0xb')](_0x606e('0xc'),auth['isAuthenticated'](),controller[_0x606e('0xd')]);router[_0x606e('0xb')](_0x606e('0xe'),auth['isAuthenticated'](),controller[_0x606e('0xf')]);router['get'](_0x606e('0x10'),auth['isAuthenticated'](),controller['getMembers']);router[_0x606e('0xb')](_0x606e('0x11'),auth['isAuthenticated'](),controller[_0x606e('0x12')]);router[_0x606e('0xb')](_0x606e('0x13'),auth[_0x606e('0x9')](),controller['getAgents']);router[_0x606e('0x14')]('/',auth[_0x606e('0x9')](),controller[_0x606e('0x15')]);router[_0x606e('0x14')]('/:id/teams',auth[_0x606e('0x9')](),controller[_0x606e('0x16')]);router[_0x606e('0x14')](_0x606e('0x13'),auth[_0x606e('0x9')](),controller['addAgents']);router[_0x606e('0x17')](_0x606e('0xe'),auth[_0x606e('0x9')](),controller[_0x606e('0x18')]);router['delete']('/:id',auth[_0x606e('0x9')](),controller[_0x606e('0x19')]);router['delete'](_0x606e('0x11'),auth[_0x606e('0x9')](),controller['removeTeams']);router[_0x606e('0x1a')]('/:id/users',auth[_0x606e('0x9')](),controller[_0x606e('0x1b')]);module[_0x606e('0x1c')]=router; \ No newline at end of file +var _0x17d3=['put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams'];(function(_0x2bf5cd,_0x468df8){var _0x2fee5a=function(_0x29ed2a){while(--_0x29ed2a){_0x2bf5cd['push'](_0x2bf5cd['shift']());}};_0x2fee5a(++_0x468df8);}(_0x17d3,0x10b));var _0x317d=function(_0x2c32df,_0x47f703){_0x2c32df=_0x2c32df-0x0;var _0x53ea7a=_0x17d3[_0x2c32df];return _0x53ea7a;};'use strict';var multer=require(_0x317d('0x0'));var util=require(_0x317d('0x1'));var path=require(_0x317d('0x2'));var timeout=require(_0x317d('0x3'));var express=require(_0x317d('0x4'));var router=express[_0x317d('0x5')]();var fs_extra=require(_0x317d('0x6'));var auth=require(_0x317d('0x7'));var interaction=require(_0x317d('0x8'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x317d('0x9')]('/',auth[_0x317d('0xa')](),controller[_0x317d('0xb')]);router[_0x317d('0x9')](_0x317d('0xc'),auth['isAuthenticated'](),controller[_0x317d('0xd')]);router[_0x317d('0x9')](_0x317d('0xe'),auth[_0x317d('0xa')](),controller[_0x317d('0xf')]);router[_0x317d('0x9')]('/:id/members',auth[_0x317d('0xa')](),controller[_0x317d('0x10')]);router[_0x317d('0x9')](_0x317d('0x11'),auth['isAuthenticated'](),controller[_0x317d('0x12')]);router[_0x317d('0x9')](_0x317d('0x13'),auth['isAuthenticated'](),controller[_0x317d('0x14')]);router[_0x317d('0x15')]('/',auth[_0x317d('0xa')](),controller['create']);router[_0x317d('0x15')](_0x317d('0x11'),auth[_0x317d('0xa')](),controller[_0x317d('0x16')]);router[_0x317d('0x15')](_0x317d('0x13'),auth['isAuthenticated'](),controller['addAgents']);router[_0x317d('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x317d('0x18')]);router[_0x317d('0x19')](_0x317d('0xe'),auth[_0x317d('0xa')](),controller['destroy']);router[_0x317d('0x19')](_0x317d('0x11'),auth[_0x317d('0xa')](),controller[_0x317d('0x1a')]);router[_0x317d('0x19')]('/:id/users',auth[_0x317d('0xa')](),controller[_0x317d('0x1b')]);module[_0x317d('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 4c58c65..bac2298 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 _0xff61=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory'];(function(_0x9be508,_0x10c8ba){var _0x16f3c3=function(_0x35c330){while(--_0x35c330){_0x9be508['push'](_0x9be508['shift']());}};_0x16f3c3(++_0x10c8ba);}(_0xff61,0x13c));var _0x1ff6=function(_0x5be446,_0xbbd82d){_0x5be446=_0x5be446-0x0;var _0x335111=_0xff61[_0x5be446];return _0x335111;};'use strict';var Sequelize=require(_0x1ff6('0x0'));module[_0x1ff6('0x1')]={'name':{'type':Sequelize[_0x1ff6('0x2')],'unique':_0x1ff6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1ff6('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1ff6('0x4')](_0x1ff6('0x5'),'beepall',_0x1ff6('0x6'))}}; \ No newline at end of file +var _0x77fb=['name','STRING','INTEGER','ENUM','rrmemory','roundrobin','exports'];(function(_0x58659b,_0xd9814d){var _0x43aebc=function(_0x166087){while(--_0x166087){_0x58659b['push'](_0x58659b['shift']());}};_0x43aebc(++_0xd9814d);}(_0x77fb,0x18e));var _0xb77f=function(_0x45c36e,_0x44909c){_0x45c36e=_0x45c36e-0x0;var _0x32208b=_0x77fb[_0x45c36e];return _0x32208b;};'use strict';var Sequelize=require('sequelize');module[_0xb77f('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb77f('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb77f('0x2')]},'timeout':{'type':Sequelize[_0xb77f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb77f('0x4')](_0xb77f('0x5'),'beepall',_0xb77f('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 1d0e08e..deb6720 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 _0x9a7d=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','apply','reject','update','get','OpenchannelQueues','UserProfileResource','destroy','then','error','stack','name','send','index','OpenchannelQueue','fieldName','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','OpenchannelQueueId','filter','User','findAndCountAll','UserId','openchannelPause','updatedAt','format','createdAt','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','each','findOrCreate','userOpenchannelQueue:save','field','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','all','union','compact','value','transaction','isEmpty','forEach','emit','addAgents','omit','spread','removeAgents','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis'];(function(_0x4a0340,_0x245814){var _0x4cb1ac=function(_0x5f5c9b){while(--_0x5f5c9b){_0x4a0340['push'](_0x4a0340['shift']());}};_0x4cb1ac(++_0x245814);}(_0x9a7d,0x7c));var _0xd9a7=function(_0x2578b1,_0x2dbb90){_0x2578b1=_0x2578b1-0x0;var _0x1c42b4=_0x9a7d[_0x2578b1];return _0x1c42b4;};'use strict';var emlformat=require(_0xd9a7('0x0'));var rimraf=require(_0xd9a7('0x1'));var zipdir=require(_0xd9a7('0x2'));var jsonpatch=require(_0xd9a7('0x3'));var rp=require(_0xd9a7('0x4'));var moment=require(_0xd9a7('0x5'));var BPromise=require(_0xd9a7('0x6'));var Mustache=require(_0xd9a7('0x7'));var util=require('util');var path=require(_0xd9a7('0x8'));var sox=require(_0xd9a7('0x9'));var csv=require(_0xd9a7('0xa'));var ejs=require(_0xd9a7('0xb'));var fs=require('fs');var fs_extra=require(_0xd9a7('0xc'));var _=require(_0xd9a7('0xd'));var squel=require('squel');var crypto=require(_0xd9a7('0xe'));var jsforce=require(_0xd9a7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd9a7('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd9a7('0x10'));var authService=require(_0xd9a7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd9a7('0x12'));var hardwareService=require(_0xd9a7('0x13'));var logger=require(_0xd9a7('0x14'))(_0xd9a7('0x15'));var utils=require(_0xd9a7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd9a7('0x17'));var db=require(_0xd9a7('0x18'))['db'];config[_0xd9a7('0x19')]=_[_0xd9a7('0x1a')](config[_0xd9a7('0x19')],{'host':_0xd9a7('0x1b'),'port':0x18eb});var socket=require(_0xd9a7('0x1c'))(new Redis(config[_0xd9a7('0x19')]));require(_0xd9a7('0x1d'))[_0xd9a7('0x1e')](socket);function respondWithStatusCode(_0x41943b,_0xaf400d){_0xaf400d=_0xaf400d||0xcc;return function(_0x1d879f){if(_0x1d879f){return _0x41943b[_0xd9a7('0x1f')](_0xaf400d);}return _0x41943b['status'](_0xaf400d)[_0xd9a7('0x20')]();};}function respondWithResult(_0xfa5e99,_0x184a8b){_0x184a8b=_0x184a8b||0xc8;return function(_0x17fa8f){if(_0x17fa8f){return _0xfa5e99[_0xd9a7('0x21')](_0x184a8b)['json'](_0x17fa8f);}};}function respondWithFilteredResult(_0x5b7850,_0x31df5d){return function(_0xfad32e){if(_0xfad32e){var _0x68e26d=typeof _0x31df5d[_0xd9a7('0x22')]==='undefined'&&typeof _0x31df5d['limit']===_0xd9a7('0x23');var _0x31e423=_0xfad32e[_0xd9a7('0x24')];var _0x380502=_0x68e26d?0x0:_0x31df5d[_0xd9a7('0x22')];var _0x31005a=_0x68e26d?_0xfad32e[_0xd9a7('0x24')]:_0x31df5d[_0xd9a7('0x22')]+_0x31df5d[_0xd9a7('0x25')];var _0x5c4c91;if(_0x31005a>=_0x31e423){_0x31005a=_0x31e423;_0x5c4c91=0xc8;}else{_0x5c4c91=0xce;}_0x5b7850[_0xd9a7('0x21')](_0x5c4c91);return _0x5b7850[_0xd9a7('0x26')](_0xd9a7('0x27'),_0x380502+'-'+_0x31005a+'/'+_0x31e423)['json'](_0xfad32e);}return null;};}function patchUpdates(_0x48bb21){return function(_0x3276d1){try{jsonpatch[_0xd9a7('0x28')](_0x3276d1,_0x48bb21,!![]);}catch(_0x3bd9c1){return BPromise[_0xd9a7('0x29')](_0x3bd9c1);}return _0x3276d1['save']();};}function saveUpdates(_0x43dfe4,_0x1332db){return function(_0x43a0a5){if(_0x43a0a5){return _0x43a0a5[_0xd9a7('0x2a')](_0x43dfe4)['then'](function(_0x4821dc){return _0x4821dc;});}return null;};}function removeEntity(_0x511382,_0x4f33dd){return function(_0x1d5107){if(_0x1d5107){return _0x1d5107['destroy']()['then'](function(){var _0x1a0411=_0x1d5107[_0xd9a7('0x2b')]({'plain':!![]});var _0x4f676e=_0xd9a7('0x2c');return db[_0xd9a7('0x2d')][_0xd9a7('0x2e')]({'where':{'type':_0x4f676e,'resourceId':_0x1a0411['id']}})['then'](function(){return _0x1d5107;});})[_0xd9a7('0x2f')](function(){_0x511382[_0xd9a7('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x206e3c,_0x506d87){return function(_0x981e46){if(!_0x981e46){_0x206e3c[_0xd9a7('0x1f')](0x194);}return _0x981e46;};}function handleError(_0x14a7f3,_0x2a99db){_0x2a99db=_0x2a99db||0x1f4;return function(_0x34f6e9){logger[_0xd9a7('0x30')](_0x34f6e9[_0xd9a7('0x31')]);if(_0x34f6e9['name']){delete _0x34f6e9[_0xd9a7('0x32')];}_0x14a7f3[_0xd9a7('0x21')](_0x2a99db)[_0xd9a7('0x33')](_0x34f6e9);};}exports[_0xd9a7('0x34')]=function(_0x3f4450,_0x28cf87){var _0x20f7bd={},_0x7d42a2={},_0x1ec85e={'count':0x0,'rows':[]};var _0x5d3b96=_['map'](db[_0xd9a7('0x35')]['rawAttributes'],function(_0x3584dd){return{'name':_0x3584dd[_0xd9a7('0x36')],'type':_0x3584dd['type']['key']};});_0x7d42a2['model']=_['map'](_0x5d3b96,'name');_0x7d42a2['query']=_[_0xd9a7('0x37')](_0x3f4450[_0xd9a7('0x38')]);_0x7d42a2[_0xd9a7('0x39')]=_[_0xd9a7('0x3a')](_0x7d42a2[_0xd9a7('0x3b')],_0x7d42a2[_0xd9a7('0x38')]);_0x20f7bd[_0xd9a7('0x3c')]=_[_0xd9a7('0x3a')](_0x7d42a2[_0xd9a7('0x3b')],qs[_0xd9a7('0x3d')](_0x3f4450['query'][_0xd9a7('0x3d')]));_0x20f7bd[_0xd9a7('0x3c')]=_0x20f7bd['attributes'][_0xd9a7('0x3e')]?_0x20f7bd[_0xd9a7('0x3c')]:_0x7d42a2['model'];if(!_0x3f4450[_0xd9a7('0x38')][_0xd9a7('0x3f')]('nolimit')){_0x20f7bd[_0xd9a7('0x25')]=qs['limit'](_0x3f4450[_0xd9a7('0x38')][_0xd9a7('0x25')]);_0x20f7bd[_0xd9a7('0x22')]=qs['offset'](_0x3f4450['query'][_0xd9a7('0x22')]);}_0x20f7bd[_0xd9a7('0x40')]=qs[_0xd9a7('0x41')](_0x3f4450[_0xd9a7('0x38')][_0xd9a7('0x41')]);_0x20f7bd[_0xd9a7('0x42')]=qs[_0xd9a7('0x39')](_[_0xd9a7('0x43')](_0x3f4450[_0xd9a7('0x38')],_0x7d42a2[_0xd9a7('0x39')]),_0x5d3b96);if(_0x3f4450['query']['filter']){_0x20f7bd['where']=_[_0xd9a7('0x44')](_0x20f7bd['where'],{'$or':_[_0xd9a7('0x45')](_0x5d3b96,function(_0x4e2e49){if(_0x4e2e49['type']!==_0xd9a7('0x46')){var _0x567f37={};_0x567f37[_0x4e2e49['name']]={'$like':'%'+_0x3f4450[_0xd9a7('0x38')]['filter']+'%'};return _0x567f37;}})});}_0x20f7bd=_['merge']({},_0x20f7bd,_0x3f4450[_0xd9a7('0x47')]);var _0x53ac36={'where':_0x20f7bd[_0xd9a7('0x42')]};return db[_0xd9a7('0x35')]['count'](_0x53ac36)['then'](function(_0x58bc22){_0x1ec85e[_0xd9a7('0x24')]=_0x58bc22;if(_0x3f4450['query'][_0xd9a7('0x48')]){_0x20f7bd[_0xd9a7('0x49')]=[{'all':!![]}];}return db[_0xd9a7('0x35')][_0xd9a7('0x4a')](_0x20f7bd);})[_0xd9a7('0x2f')](function(_0x503543){_0x1ec85e[_0xd9a7('0x4b')]=_0x503543;return _0x1ec85e;})[_0xd9a7('0x2f')](respondWithFilteredResult(_0x28cf87,_0x20f7bd))[_0xd9a7('0x4c')](handleError(_0x28cf87,null));};exports['show']=function(_0x23ec5b,_0x581fa3){var _0x4878b4={'raw':!![],'where':{'id':_0x23ec5b[_0xd9a7('0x4d')]['id']}},_0x19cadd={};_0x19cadd[_0xd9a7('0x3b')]=_[_0xd9a7('0x37')](db[_0xd9a7('0x35')][_0xd9a7('0x4e')]);_0x19cadd[_0xd9a7('0x38')]=_[_0xd9a7('0x37')](_0x23ec5b[_0xd9a7('0x38')]);_0x19cadd['filters']=_['intersection'](_0x19cadd[_0xd9a7('0x3b')],_0x19cadd[_0xd9a7('0x38')]);_0x4878b4[_0xd9a7('0x3c')]=_[_0xd9a7('0x3a')](_0x19cadd[_0xd9a7('0x3b')],qs[_0xd9a7('0x3d')](_0x23ec5b['query'][_0xd9a7('0x3d')]));_0x4878b4['attributes']=_0x4878b4['attributes']['length']?_0x4878b4[_0xd9a7('0x3c')]:_0x19cadd[_0xd9a7('0x3b')];if(_0x23ec5b['query'][_0xd9a7('0x48')]){_0x4878b4[_0xd9a7('0x49')]=[{'all':!![]}];}_0x4878b4=_[_0xd9a7('0x44')]({},_0x4878b4,_0x23ec5b[_0xd9a7('0x47')]);return db[_0xd9a7('0x35')][_0xd9a7('0x4f')](_0x4878b4)['then'](handleEntityNotFound(_0x581fa3,null))[_0xd9a7('0x2f')](respondWithResult(_0x581fa3,null))['catch'](handleError(_0x581fa3,null));};exports[_0xd9a7('0x50')]=function(_0x2a8ae6,_0x11cc3e){return db['OpenchannelQueue']['create'](_0x2a8ae6[_0xd9a7('0x51')],{})[_0xd9a7('0x2f')](function(_0x46d1a0){var _0x130c82=_0x2a8ae6[_0xd9a7('0x52')][_0xd9a7('0x2b')]({'plain':!![]});if(!_0x130c82)throw new Error(_0xd9a7('0x53'));if(_0x130c82['role']===_0xd9a7('0x52')){var _0x35d032=_0x46d1a0[_0xd9a7('0x2b')]({'plain':!![]});var _0x1d8e11=_0xd9a7('0x2c');return db[_0xd9a7('0x54')][_0xd9a7('0x4f')]({'where':{'name':_0x1d8e11,'userProfileId':_0x130c82[_0xd9a7('0x55')]},'raw':!![]})[_0xd9a7('0x2f')](function(_0x2d31d8){if(_0x2d31d8&&_0x2d31d8[_0xd9a7('0x56')]===0x0){return db['UserProfileResource'][_0xd9a7('0x50')]({'name':_0x35d032[_0xd9a7('0x32')],'resourceId':_0x35d032['id'],'type':_0x2d31d8[_0xd9a7('0x32')],'sectionId':_0x2d31d8['id']},{})[_0xd9a7('0x2f')](function(){return _0x46d1a0;});}else{return _0x46d1a0;}})[_0xd9a7('0x4c')](function(_0x4cd161){logger[_0xd9a7('0x30')](_0xd9a7('0x57'),_0x4cd161);throw _0x4cd161;});}return _0x46d1a0;})['then'](respondWithResult(_0x11cc3e,0xc9))['catch'](handleError(_0x11cc3e,null));};exports[_0xd9a7('0x2a')]=function(_0x1b0fcd,_0x5a09f7){if(_0x1b0fcd[_0xd9a7('0x51')]['id']){delete _0x1b0fcd[_0xd9a7('0x51')]['id'];}return db['OpenchannelQueue'][_0xd9a7('0x4f')]({'where':{'id':_0x1b0fcd[_0xd9a7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5a09f7,null))[_0xd9a7('0x2f')](saveUpdates(_0x1b0fcd[_0xd9a7('0x51')],null))['then'](respondWithResult(_0x5a09f7,null))[_0xd9a7('0x4c')](handleError(_0x5a09f7,null));};exports[_0xd9a7('0x2e')]=function(_0x1096e1,_0x352a47){return db[_0xd9a7('0x35')][_0xd9a7('0x4f')]({'where':{'id':_0x1096e1[_0xd9a7('0x4d')]['id']}})[_0xd9a7('0x2f')](handleEntityNotFound(_0x352a47,null))[_0xd9a7('0x2f')](removeEntity(_0x352a47,null))[_0xd9a7('0x4c')](handleError(_0x352a47,null));};exports[_0xd9a7('0x58')]=function(_0x22c340,_0x5c16eb){return db['OpenchannelQueue'][_0xd9a7('0x58')]()[_0xd9a7('0x2f')](respondWithResult(_0x5c16eb,null))['catch'](handleError(_0x5c16eb,null));};exports[_0xd9a7('0x59')]=function(_0x8dd64e,_0x45c302,_0x328627){var _0x5797f8={'raw':!![],'where':{}},_0x57a5b1={},_0x3095af;return db['OpenchannelQueue'][_0xd9a7('0x5a')]({'where':{'id':_0x8dd64e['params']['id']}})[_0xd9a7('0x2f')](handleEntityNotFound(_0x45c302,null))[_0xd9a7('0x2f')](function(_0x2bddc7){if(_0x2bddc7){_0x3095af=_0x2bddc7[_0xd9a7('0x2b')]({'plain':!![]});_0x57a5b1[_0xd9a7('0x3b')]=_[_0xd9a7('0x37')](db[_0xd9a7('0x5b')]['rawAttributes']);_0x57a5b1[_0xd9a7('0x38')]=_[_0xd9a7('0x37')](_0x8dd64e[_0xd9a7('0x38')]);_0x57a5b1[_0xd9a7('0x39')]=_['intersection'](_0x57a5b1[_0xd9a7('0x3b')],_0x57a5b1['query']);_0x5797f8[_0xd9a7('0x3c')]=_[_0xd9a7('0x3a')](_0x57a5b1[_0xd9a7('0x3b')],qs['fields'](_0x8dd64e[_0xd9a7('0x38')]['fields']));_0x5797f8[_0xd9a7('0x3c')]=_0x5797f8['attributes']['length']?_0x5797f8[_0xd9a7('0x3c')]:_0x57a5b1['model'];if(!_0x8dd64e[_0xd9a7('0x38')][_0xd9a7('0x3f')](_0xd9a7('0x5c'))){_0x5797f8[_0xd9a7('0x25')]=qs['limit'](_0x8dd64e[_0xd9a7('0x38')]['limit']);_0x5797f8[_0xd9a7('0x22')]=qs['offset'](_0x8dd64e[_0xd9a7('0x38')][_0xd9a7('0x22')]);}_0x5797f8['order']=qs[_0xd9a7('0x41')](_0x8dd64e['query'][_0xd9a7('0x41')]);_0x5797f8[_0xd9a7('0x42')]=qs[_0xd9a7('0x39')](_[_0xd9a7('0x43')](_0x8dd64e['query'],_0x57a5b1[_0xd9a7('0x39')]));_0x5797f8[_0xd9a7('0x42')][_0xd9a7('0x5d')]=_0x2bddc7['id'];if(_0x8dd64e[_0xd9a7('0x38')][_0xd9a7('0x5e')]){_0x5797f8[_0xd9a7('0x42')]=_[_0xd9a7('0x44')](_0x5797f8['where'],{'$or':_[_0xd9a7('0x45')](_0x5797f8[_0xd9a7('0x3c')],function(_0xadba55){var _0x3cdf0b={};_0x3cdf0b[_0xadba55]={'$like':'%'+_0x8dd64e[_0xd9a7('0x38')][_0xd9a7('0x5e')]+'%'};return _0x3cdf0b;})});}_0x5797f8=_[_0xd9a7('0x44')]({},_0x5797f8,_0x8dd64e[_0xd9a7('0x47')]);return db['UserOpenchannelQueue']['findAll'](_0x5797f8);}})[_0xd9a7('0x2f')](function(_0x1c03e1){if(_0x1c03e1){return db[_0xd9a7('0x5f')][_0xd9a7('0x60')]({'where':{'id':_[_0xd9a7('0x45')](_0x1c03e1,_0xd9a7('0x61')),'role':'agent'},'attributes':['id',_0xd9a7('0x32'),_0xd9a7('0x62'),_0xd9a7('0x63'),'createdAt']});}})[_0xd9a7('0x2f')](function(_0x81578c){if(_0x81578c){return{'count':_0x81578c[_0xd9a7('0x24')],'rows':_['map'](_0x81578c[_0xd9a7('0x4b')],function(_0x14c45c){return{'membername':_0x14c45c[_0xd9a7('0x32')],'UserId':_0x14c45c['id'],'queue_name':_0x3095af[_0xd9a7('0x32')],'OpenchannelQueueId':_0x3095af['id'],'interface':util[_0xd9a7('0x64')]('%s/%s','SIP',_0x14c45c[_0xd9a7('0x32')]),'penalty':0x0,'paused':_0x14c45c[_0xd9a7('0x62')],'createdAt':_0x14c45c[_0xd9a7('0x65')],'updatedAt':_0x14c45c[_0xd9a7('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd9a7('0x2f')](respondWithFilteredResult(_0x45c302,_0x5797f8))[_0xd9a7('0x4c')](handleError(_0x45c302,null));};exports['getTeams']=function(_0x60f7f1,_0x31a255,_0x5eaa84){var _0x38376e={};var _0x573271={};var _0xe005f2;var _0x23f11b;return db[_0xd9a7('0x35')][_0xd9a7('0x5a')]({'where':{'id':_0x60f7f1[_0xd9a7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x31a255,null))[_0xd9a7('0x2f')](function(_0x27ba16){if(_0x27ba16){_0xe005f2=_0x27ba16;_0x573271[_0xd9a7('0x3b')]=_[_0xd9a7('0x37')](db[_0xd9a7('0x66')]['rawAttributes']);_0x573271[_0xd9a7('0x38')]=_[_0xd9a7('0x37')](_0x60f7f1['query']);_0x573271[_0xd9a7('0x39')]=_[_0xd9a7('0x3a')](_0x573271['model'],_0x573271['query']);_0x38376e['attributes']=_['intersection'](_0x573271['model'],qs[_0xd9a7('0x3d')](_0x60f7f1[_0xd9a7('0x38')][_0xd9a7('0x3d')]));_0x38376e[_0xd9a7('0x3c')]=_0x38376e[_0xd9a7('0x3c')][_0xd9a7('0x3e')]?_0x38376e[_0xd9a7('0x3c')]:_0x573271['model'];_0x38376e[_0xd9a7('0x40')]=qs[_0xd9a7('0x41')](_0x60f7f1[_0xd9a7('0x38')][_0xd9a7('0x41')]);_0x38376e[_0xd9a7('0x42')]=qs[_0xd9a7('0x39')](_[_0xd9a7('0x43')](_0x60f7f1[_0xd9a7('0x38')],_0x573271[_0xd9a7('0x39')]));if(_0x60f7f1[_0xd9a7('0x38')][_0xd9a7('0x5e')]){_0x38376e[_0xd9a7('0x42')]=_[_0xd9a7('0x44')](_0x38376e[_0xd9a7('0x42')],{'$or':_[_0xd9a7('0x45')](_0x38376e['attributes'],function(_0x439115){var _0x5c7ce6={};_0x5c7ce6[_0x439115]={'$like':'%'+_0x60f7f1[_0xd9a7('0x38')][_0xd9a7('0x5e')]+'%'};return _0x5c7ce6;})});}_0x38376e=_[_0xd9a7('0x44')]({},_0x38376e,_0x60f7f1[_0xd9a7('0x47')]);return _0xe005f2['getTeams'](_0x38376e);}})[_0xd9a7('0x2f')](function(_0x815758){if(_0x815758){_0x23f11b=_0x815758['length'];if(!_0x60f7f1[_0xd9a7('0x38')][_0xd9a7('0x3f')](_0xd9a7('0x5c'))){_0x38376e[_0xd9a7('0x25')]=qs[_0xd9a7('0x25')](_0x60f7f1[_0xd9a7('0x38')][_0xd9a7('0x25')]);_0x38376e[_0xd9a7('0x22')]=qs[_0xd9a7('0x22')](_0x60f7f1['query'][_0xd9a7('0x22')]);}return _0xe005f2['getTeams'](_0x38376e);}})[_0xd9a7('0x2f')](function(_0x10f2a2){if(_0x10f2a2){return _0x10f2a2?{'count':_0x23f11b,'rows':_0x10f2a2}:null;}})[_0xd9a7('0x2f')](respondWithResult(_0x31a255,null))[_0xd9a7('0x4c')](handleError(_0x31a255,null));};exports[_0xd9a7('0x67')]=function(_0xda2228,_0x4c7370,_0xdfa542){var _0x338958=_0xda2228['body'][_0xd9a7('0x68')];return db[_0xd9a7('0x66')][_0xd9a7('0x4a')]({'where':{'id':_0x338958},'attributes':['id'],'include':[{'model':db[_0xd9a7('0x5f')],'as':'Agents','attributes':['id',_0xd9a7('0x32'),_0xd9a7('0x69'),_0xd9a7('0x6a'),_0xd9a7('0x6b')],'raw':!![]}]})[_0xd9a7('0x2f')](function(_0x1b6575){if(_0x1b6575){var _0x255ae4=_[_0xd9a7('0x6c')](_0x1b6575,function(_0x5c2203){var _0x2659a1=_0x5c2203['get']({'plain':!![]});return _0x2659a1[_0xd9a7('0x6d')];});return db['OpenchannelQueue'][_0xd9a7('0x4f')]({'where':{'id':_0xda2228[_0xd9a7('0x4d')]['id']}})[_0xd9a7('0x2f')](function(_0x4a8106){return db[_0xd9a7('0x6e')]['transaction'](function(_0x38d3a8){return _0x4a8106[_0xd9a7('0x67')](_0x338958,{'transaction':_0x38d3a8})[_0xd9a7('0x2f')](function(){return BPromise[_0xd9a7('0x6f')](_0x255ae4,function(_0x2ba45e){return db['UserOpenchannelQueue'][_0xd9a7('0x70')]({'where':{'UserId':_0x2ba45e['id'],'OpenchannelQueueId':_0xda2228['params']['id']},'transaction':_0x38d3a8});});})[_0xd9a7('0x2f')](function(){_0x255ae4['forEach'](function(_0x2be435){socket['emit'](_0xd9a7('0x71'),{'UserId':_0x2be435['id'],'OpenchannelQueueId':_0x4a8106['id']});});});});});}})['then'](respondWithStatusCode(_0x4c7370,null))[_0xd9a7('0x4c')](handleError(_0x4c7370,null));};exports['removeTeams']=function(_0x1ea5b5,_0x5a15c8,_0x10cf3c){return db[_0xd9a7('0x66')]['findAll']({'where':{'id':_0x1ea5b5['query'][_0xd9a7('0x68')]},'attributes':['id'],'include':[{'model':db[_0xd9a7('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xd9a7('0x2f')](handleEntityNotFound(_0x5a15c8,null))['then'](function(_0x2804ef){var _0x3e8a2d=_['map'](_0x2804ef,'id');var _0x50fe02=[];var _0x140cb9=[];var _0x4a0fe4=squel['select']();_0x4a0fe4[_0xd9a7('0x72')]('tq.TeamId')[_0xd9a7('0x73')](_0xd9a7('0x74'),'tq')['join'](_0xd9a7('0x75'),'ut',_0xd9a7('0x76'))[_0xd9a7('0x42')](_0xd9a7('0x77'),_0x1ea5b5[_0xd9a7('0x4d')]['id']);for(var _0x288945=0x0;_0x288945<_0x2804ef[_0xd9a7('0x3e')];_0x288945+=0x1){let _0x44efa7=_0x2804ef[_0x288945];for(var _0x1ec03c=0x0;_0x1ec03c<_0x44efa7[_0xd9a7('0x6d')][_0xd9a7('0x3e')];_0x1ec03c+=0x1){let _0x47a89c=_0x44efa7['Agents'][_0x1ec03c];var _0x1fa7fe=_0x4a0fe4[_0xd9a7('0x78')]();_0x1fa7fe[_0xd9a7('0x42')](_0xd9a7('0x79'),_0x47a89c['id']);_0x140cb9[_0xd9a7('0x7a')](db['sequelize'][_0xd9a7('0x38')](_0x1fa7fe[_0xd9a7('0x7b')](),{'type':db[_0xd9a7('0x6e')][_0xd9a7('0x7c')][_0xd9a7('0x7d')]})[_0xd9a7('0x2f')](function(_0x4c9ef6){if(_0x4c9ef6['length']===0x1){return _0x47a89c['id'];}else{var _0x2bbb4d=_['every'](_[_0xd9a7('0x45')](_0x4c9ef6,'TeamId'),function(_0x2b2593){return _[_0xd9a7('0x7e')](_0x3e8a2d,_0x2b2593);});if(_0x2bbb4d){return _0x47a89c['id'];}}}));}}return BPromise[_0xd9a7('0x7f')](_0x140cb9)['then'](function(_0x13f311){_0x50fe02=_(_0x50fe02)[_0xd9a7('0x80')](_0x13f311)[_0xd9a7('0x81')]()[_0xd9a7('0x82')]();return db[_0xd9a7('0x35')][_0xd9a7('0x4f')]({'where':{'id':_0x1ea5b5[_0xd9a7('0x4d')]['id']}})[_0xd9a7('0x2f')](function(_0x5df5d8){return db[_0xd9a7('0x6e')][_0xd9a7('0x83')](function(_0x1e2894){return _0x5df5d8['removeTeams'](_0x1ea5b5[_0xd9a7('0x38')]['ids'],{'transaction':_0x1e2894})[_0xd9a7('0x2f')](function(){if(!_[_0xd9a7('0x84')](_0x50fe02)){return _0x5df5d8['removeAgents'](_0x50fe02,{'transaction':_0x1e2894});}})['then'](function(){_0x50fe02[_0xd9a7('0x85')](function(_0x3a82fa){socket[_0xd9a7('0x86')]('userOpenchannelQueue:remove',{'UserId':_0x3a82fa,'OpenchannelQueueId':_0x5df5d8['id']});});});});});});})[_0xd9a7('0x2f')](respondWithStatusCode(_0x5a15c8,null))['catch'](handleError(_0x5a15c8,null));};exports[_0xd9a7('0x87')]=function(_0x3e15b0,_0x293369,_0x4955d0){return db[_0xd9a7('0x35')][_0xd9a7('0x4f')]({'where':{'id':_0x3e15b0[_0xd9a7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x293369,null))[_0xd9a7('0x2f')](function(_0x250d1b){if(_0x250d1b){return _0x250d1b[_0xd9a7('0x87')](_0x3e15b0[_0xd9a7('0x51')][_0xd9a7('0x68')],_[_0xd9a7('0x88')](_0x3e15b0[_0xd9a7('0x51')],[_0xd9a7('0x68'),'id'])||{})[_0xd9a7('0x89')](function(_0x76ff72){for(var _0x48028b=0x0;_0x48028b<_0x3e15b0['body'][_0xd9a7('0x68')][_0xd9a7('0x3e')];_0x48028b+=0x1){socket[_0xd9a7('0x86')](_0xd9a7('0x71'),{'UserId':Number(_0x3e15b0[_0xd9a7('0x51')][_0xd9a7('0x68')][_0x48028b]),'OpenchannelQueueId':Number(_0x3e15b0[_0xd9a7('0x4d')]['id'])});}return _0x76ff72;});}})[_0xd9a7('0x2f')](respondWithResult(_0x293369,null))[_0xd9a7('0x4c')](handleError(_0x293369,null));};exports[_0xd9a7('0x8a')]=function(_0x3d003e,_0x39fac2,_0x1e3c3d){return db[_0xd9a7('0x35')][_0xd9a7('0x4f')]({'where':{'id':_0x3d003e[_0xd9a7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x39fac2,null))['then'](function(_0x4bcb04){if(_0x4bcb04){return _0x4bcb04[_0xd9a7('0x8a')](_0x3d003e[_0xd9a7('0x38')][_0xd9a7('0x68')])['then'](function(){if(_['isArray'](_0x3d003e[_0xd9a7('0x38')][_0xd9a7('0x68')])){for(var _0x563b6a=0x0;_0x563b6a<_0x3d003e['query']['ids']['length'];_0x563b6a+=0x1){socket[_0xd9a7('0x86')](_0xd9a7('0x8b'),{'UserId':Number(_0x3d003e[_0xd9a7('0x38')][_0xd9a7('0x68')][_0x563b6a]),'OpenchannelQueueId':Number(_0x3d003e[_0xd9a7('0x4d')]['id'])});}}else{socket[_0xd9a7('0x86')](_0xd9a7('0x8b'),{'UserId':Number(_0x3d003e[_0xd9a7('0x38')][_0xd9a7('0x68')]),'OpenchannelQueueId':Number(_0x3d003e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x39fac2,null))[_0xd9a7('0x4c')](handleError(_0x39fac2,null));};exports[_0xd9a7('0x8c')]=function(_0x30ea1b,_0x49858c,_0x7a9251){var _0x545015={};var _0x32d16a={};var _0x1593ad;var _0x3cc867;return db[_0xd9a7('0x35')][_0xd9a7('0x5a')]({'where':{'id':_0x30ea1b[_0xd9a7('0x4d')]['id']}})[_0xd9a7('0x2f')](handleEntityNotFound(_0x49858c,null))[_0xd9a7('0x2f')](function(_0xf116ef){if(_0xf116ef){_0x1593ad=_0xf116ef;_0x32d16a[_0xd9a7('0x3b')]=_[_0xd9a7('0x37')](db[_0xd9a7('0x5f')][_0xd9a7('0x4e')]);_0x32d16a['query']=_[_0xd9a7('0x37')](_0x30ea1b[_0xd9a7('0x38')]);_0x32d16a[_0xd9a7('0x39')]=_['intersection'](_0x32d16a[_0xd9a7('0x3b')],_0x32d16a['query']);_0x545015[_0xd9a7('0x3c')]=_[_0xd9a7('0x3a')](_0x32d16a[_0xd9a7('0x3b')],qs[_0xd9a7('0x3d')](_0x30ea1b[_0xd9a7('0x38')][_0xd9a7('0x3d')]));_0x545015[_0xd9a7('0x3c')]=_0x545015[_0xd9a7('0x3c')]['length']?_0x545015['attributes']:_0x32d16a['model'];_0x545015[_0xd9a7('0x40')]=qs[_0xd9a7('0x41')](_0x30ea1b['query'][_0xd9a7('0x41')]);_0x545015[_0xd9a7('0x42')]=qs[_0xd9a7('0x39')](_[_0xd9a7('0x43')](_0x30ea1b['query'],_0x32d16a[_0xd9a7('0x39')]));if(_0x30ea1b['query']['filter']){_0x545015[_0xd9a7('0x42')]=_[_0xd9a7('0x44')](_0x545015[_0xd9a7('0x42')],{'$or':_['map'](_0x545015[_0xd9a7('0x3c')],function(_0x41bd8d){var _0xb325b1={};_0xb325b1[_0x41bd8d]={'$like':'%'+_0x30ea1b[_0xd9a7('0x38')][_0xd9a7('0x5e')]+'%'};return _0xb325b1;})});}_0x545015=_['merge']({},_0x545015,_0x30ea1b['options']);return _0x1593ad[_0xd9a7('0x8c')](_0x545015);}})[_0xd9a7('0x2f')](function(_0x256c16){if(_0x256c16){_0x3cc867=_0x256c16['length'];if(!_0x30ea1b[_0xd9a7('0x38')][_0xd9a7('0x3f')](_0xd9a7('0x5c'))){_0x545015[_0xd9a7('0x25')]=qs['limit'](_0x30ea1b[_0xd9a7('0x38')][_0xd9a7('0x25')]);_0x545015[_0xd9a7('0x22')]=qs[_0xd9a7('0x22')](_0x30ea1b[_0xd9a7('0x38')][_0xd9a7('0x22')]);}return _0x1593ad[_0xd9a7('0x8c')](_0x545015);}})['then'](function(_0x4cfabd){if(_0x4cfabd){return _0x4cfabd?{'count':_0x3cc867,'rows':_0x4cfabd}:null;}})[_0xd9a7('0x2f')](respondWithResult(_0x49858c,null))[_0xd9a7('0x4c')](handleError(_0x49858c,null));}; \ No newline at end of file +var _0xd31f=['status','end','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','send','index','rawAttributes','fieldName','type','key','model','map','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','OpenchannelQueue','includeAll','include','rows','show','params','length','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','OpenchannelQueueId','UserOpenchannelQueue','User','agent','updatedAt','createdAt','format','%s/%s','openchannelPause','getTeams','findOne','Team','addTeams','ids','findAll','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','emit','userOpenchannelQueue:save','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','every','TeamId','all','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd31f,0x198));var _0xfd31=function(_0x5b1e22,_0x1a8ea2){_0x5b1e22=_0x5b1e22-0x0;var _0x1e5f65=_0xd31f[_0x5b1e22];return _0x1e5f65;};'use strict';var emlformat=require(_0xfd31('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd31('0x1'));var jsonpatch=require(_0xfd31('0x2'));var rp=require(_0xfd31('0x3'));var moment=require(_0xfd31('0x4'));var BPromise=require(_0xfd31('0x5'));var Mustache=require(_0xfd31('0x6'));var util=require(_0xfd31('0x7'));var path=require('path');var sox=require(_0xfd31('0x8'));var csv=require(_0xfd31('0x9'));var ejs=require(_0xfd31('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfd31('0xb'));var squel=require(_0xfd31('0xc'));var crypto=require(_0xfd31('0xd'));var jsforce=require(_0xfd31('0xe'));var deskjs=require(_0xfd31('0xf'));var toCsv=require(_0xfd31('0x9'));var querystring=require(_0xfd31('0x10'));var Papa=require(_0xfd31('0x11'));var Redis=require(_0xfd31('0x12'));var authService=require(_0xfd31('0x13'));var qs=require(_0xfd31('0x14'));var as=require(_0xfd31('0x15'));var hardwareService=require(_0xfd31('0x16'));var logger=require(_0xfd31('0x17'))(_0xfd31('0x18'));var utils=require(_0xfd31('0x19'));var config=require(_0xfd31('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xfd31('0x1b'))['db'];config[_0xfd31('0x1c')]=_['defaults'](config['redis'],{'host':_0xfd31('0x1d'),'port':0x18eb});var socket=require(_0xfd31('0x1e'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xfd31('0x1f')](socket);function respondWithStatusCode(_0x3c42db,_0x35e6fc){_0x35e6fc=_0x35e6fc||0xcc;return function(_0x30b225){if(_0x30b225){return _0x3c42db[_0xfd31('0x20')](_0x35e6fc);}return _0x3c42db[_0xfd31('0x21')](_0x35e6fc)[_0xfd31('0x22')]();};}function respondWithResult(_0x3b41d9,_0x402e26){_0x402e26=_0x402e26||0xc8;return function(_0x448ae9){if(_0x448ae9){return _0x3b41d9[_0xfd31('0x21')](_0x402e26)['json'](_0x448ae9);}};}function respondWithFilteredResult(_0x444297,_0x475cf4){return function(_0x541ca9){if(_0x541ca9){var _0x337df9=typeof _0x475cf4[_0xfd31('0x23')]===_0xfd31('0x24')&&typeof _0x475cf4[_0xfd31('0x25')]===_0xfd31('0x24');var _0x122a51=_0x541ca9[_0xfd31('0x26')];var _0x4699c7=_0x337df9?0x0:_0x475cf4['offset'];var _0xe2b18f=_0x337df9?_0x541ca9['count']:_0x475cf4[_0xfd31('0x23')]+_0x475cf4[_0xfd31('0x25')];var _0x3e5d0;if(_0xe2b18f>=_0x122a51){_0xe2b18f=_0x122a51;_0x3e5d0=0xc8;}else{_0x3e5d0=0xce;}_0x444297[_0xfd31('0x21')](_0x3e5d0);return _0x444297[_0xfd31('0x27')](_0xfd31('0x28'),_0x4699c7+'-'+_0xe2b18f+'/'+_0x122a51)['json'](_0x541ca9);}return null;};}function patchUpdates(_0x5c2b9c){return function(_0x4b1ac6){try{jsonpatch[_0xfd31('0x29')](_0x4b1ac6,_0x5c2b9c,!![]);}catch(_0x4324df){return BPromise['reject'](_0x4324df);}return _0x4b1ac6[_0xfd31('0x2a')]();};}function saveUpdates(_0xaa3dac,_0x5d2b3c){return function(_0x18f432){if(_0x18f432){return _0x18f432['update'](_0xaa3dac)[_0xfd31('0x2b')](function(_0x1fff5c){return _0x1fff5c;});}return null;};}function removeEntity(_0x851a97,_0x8f03e0){return function(_0x58f2bb){if(_0x58f2bb){return _0x58f2bb[_0xfd31('0x2c')]()['then'](function(){var _0x3a44ba=_0x58f2bb[_0xfd31('0x2d')]({'plain':!![]});var _0x3f32ed=_0xfd31('0x2e');return db[_0xfd31('0x2f')][_0xfd31('0x2c')]({'where':{'type':_0x3f32ed,'resourceId':_0x3a44ba['id']}})[_0xfd31('0x2b')](function(){return _0x58f2bb;});})[_0xfd31('0x2b')](function(){_0x851a97[_0xfd31('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30a17e,_0x21faf0){return function(_0x946c26){if(!_0x946c26){_0x30a17e[_0xfd31('0x20')](0x194);}return _0x946c26;};}function handleError(_0x4844dc,_0x5b1e43){_0x5b1e43=_0x5b1e43||0x1f4;return function(_0x2b89cb){logger[_0xfd31('0x30')](_0x2b89cb[_0xfd31('0x31')]);if(_0x2b89cb['name']){delete _0x2b89cb['name'];}_0x4844dc[_0xfd31('0x21')](_0x5b1e43)[_0xfd31('0x32')](_0x2b89cb);};}exports[_0xfd31('0x33')]=function(_0x5a161d,_0x1b398f){var _0x4051fd={},_0x512cfb={},_0x19cc4e={'count':0x0,'rows':[]};var _0x4d5833=_['map'](db['OpenchannelQueue'][_0xfd31('0x34')],function(_0x513fb8){return{'name':_0x513fb8[_0xfd31('0x35')],'type':_0x513fb8[_0xfd31('0x36')][_0xfd31('0x37')]};});_0x512cfb[_0xfd31('0x38')]=_[_0xfd31('0x39')](_0x4d5833,_0xfd31('0x3a'));_0x512cfb[_0xfd31('0x3b')]=_[_0xfd31('0x3c')](_0x5a161d[_0xfd31('0x3b')]);_0x512cfb['filters']=_[_0xfd31('0x3d')](_0x512cfb[_0xfd31('0x38')],_0x512cfb[_0xfd31('0x3b')]);_0x4051fd[_0xfd31('0x3e')]=_[_0xfd31('0x3d')](_0x512cfb[_0xfd31('0x38')],qs[_0xfd31('0x3f')](_0x5a161d['query'][_0xfd31('0x3f')]));_0x4051fd[_0xfd31('0x3e')]=_0x4051fd[_0xfd31('0x3e')]['length']?_0x4051fd[_0xfd31('0x3e')]:_0x512cfb[_0xfd31('0x38')];if(!_0x5a161d['query'][_0xfd31('0x40')](_0xfd31('0x41'))){_0x4051fd[_0xfd31('0x25')]=qs[_0xfd31('0x25')](_0x5a161d[_0xfd31('0x3b')][_0xfd31('0x25')]);_0x4051fd[_0xfd31('0x23')]=qs[_0xfd31('0x23')](_0x5a161d[_0xfd31('0x3b')][_0xfd31('0x23')]);}_0x4051fd[_0xfd31('0x42')]=qs[_0xfd31('0x43')](_0x5a161d['query']['sort']);_0x4051fd[_0xfd31('0x44')]=qs[_0xfd31('0x45')](_[_0xfd31('0x46')](_0x5a161d[_0xfd31('0x3b')],_0x512cfb['filters']),_0x4d5833);if(_0x5a161d[_0xfd31('0x3b')][_0xfd31('0x47')]){_0x4051fd[_0xfd31('0x44')]=_[_0xfd31('0x48')](_0x4051fd[_0xfd31('0x44')],{'$or':_[_0xfd31('0x39')](_0x4d5833,function(_0x275929){if(_0x275929[_0xfd31('0x36')]!==_0xfd31('0x49')){var _0x562e1d={};_0x562e1d[_0x275929['name']]={'$like':'%'+_0x5a161d[_0xfd31('0x3b')][_0xfd31('0x47')]+'%'};return _0x562e1d;}})});}_0x4051fd=_[_0xfd31('0x48')]({},_0x4051fd,_0x5a161d[_0xfd31('0x4a')]);var _0x117f59={'where':_0x4051fd['where']};return db[_0xfd31('0x4b')][_0xfd31('0x26')](_0x117f59)[_0xfd31('0x2b')](function(_0x3bb17c){_0x19cc4e['count']=_0x3bb17c;if(_0x5a161d[_0xfd31('0x3b')][_0xfd31('0x4c')]){_0x4051fd[_0xfd31('0x4d')]=[{'all':!![]}];}return db[_0xfd31('0x4b')]['findAll'](_0x4051fd);})[_0xfd31('0x2b')](function(_0x57280c){_0x19cc4e[_0xfd31('0x4e')]=_0x57280c;return _0x19cc4e;})[_0xfd31('0x2b')](respondWithFilteredResult(_0x1b398f,_0x4051fd))['catch'](handleError(_0x1b398f,null));};exports[_0xfd31('0x4f')]=function(_0x43669d,_0x2c59cc){var _0x388992={'raw':!![],'where':{'id':_0x43669d[_0xfd31('0x50')]['id']}},_0x2ea6c8={};_0x2ea6c8[_0xfd31('0x38')]=_['keys'](db[_0xfd31('0x4b')]['rawAttributes']);_0x2ea6c8[_0xfd31('0x3b')]=_['keys'](_0x43669d[_0xfd31('0x3b')]);_0x2ea6c8[_0xfd31('0x45')]=_[_0xfd31('0x3d')](_0x2ea6c8[_0xfd31('0x38')],_0x2ea6c8['query']);_0x388992[_0xfd31('0x3e')]=_[_0xfd31('0x3d')](_0x2ea6c8[_0xfd31('0x38')],qs['fields'](_0x43669d[_0xfd31('0x3b')]['fields']));_0x388992[_0xfd31('0x3e')]=_0x388992['attributes'][_0xfd31('0x51')]?_0x388992[_0xfd31('0x3e')]:_0x2ea6c8[_0xfd31('0x38')];if(_0x43669d[_0xfd31('0x3b')][_0xfd31('0x4c')]){_0x388992['include']=[{'all':!![]}];}_0x388992=_[_0xfd31('0x48')]({},_0x388992,_0x43669d[_0xfd31('0x4a')]);return db[_0xfd31('0x4b')][_0xfd31('0x52')](_0x388992)['then'](handleEntityNotFound(_0x2c59cc,null))[_0xfd31('0x2b')](respondWithResult(_0x2c59cc,null))[_0xfd31('0x53')](handleError(_0x2c59cc,null));};exports['create']=function(_0x53bdfa,_0x1c7639){return db[_0xfd31('0x4b')][_0xfd31('0x54')](_0x53bdfa['body'],{})[_0xfd31('0x2b')](function(_0x1571a7){var _0xd9a125=_0x53bdfa['user'][_0xfd31('0x2d')]({'plain':!![]});if(!_0xd9a125)throw new Error(_0xfd31('0x55'));if(_0xd9a125[_0xfd31('0x56')]==='user'){var _0x35bc1f=_0x1571a7[_0xfd31('0x2d')]({'plain':!![]});var _0x20b479=_0xfd31('0x2e');return db[_0xfd31('0x57')][_0xfd31('0x52')]({'where':{'name':_0x20b479,'userProfileId':_0xd9a125['userProfileId']},'raw':!![]})[_0xfd31('0x2b')](function(_0x53764f){if(_0x53764f&&_0x53764f['autoAssociation']===0x0){return db[_0xfd31('0x2f')][_0xfd31('0x54')]({'name':_0x35bc1f['name'],'resourceId':_0x35bc1f['id'],'type':_0x53764f[_0xfd31('0x3a')],'sectionId':_0x53764f['id']},{})[_0xfd31('0x2b')](function(){return _0x1571a7;});}else{return _0x1571a7;}})[_0xfd31('0x53')](function(_0x177711){logger[_0xfd31('0x30')](_0xfd31('0x58'),_0x177711);throw _0x177711;});}return _0x1571a7;})[_0xfd31('0x2b')](respondWithResult(_0x1c7639,0xc9))['catch'](handleError(_0x1c7639,null));};exports[_0xfd31('0x59')]=function(_0x1860d9,_0x1c4df1){if(_0x1860d9['body']['id']){delete _0x1860d9['body']['id'];}return db[_0xfd31('0x4b')][_0xfd31('0x52')]({'where':{'id':_0x1860d9[_0xfd31('0x50')]['id']}})[_0xfd31('0x2b')](handleEntityNotFound(_0x1c4df1,null))['then'](saveUpdates(_0x1860d9[_0xfd31('0x5a')],null))[_0xfd31('0x2b')](respondWithResult(_0x1c4df1,null))[_0xfd31('0x53')](handleError(_0x1c4df1,null));};exports['destroy']=function(_0x1f3390,_0x83ff61){return db[_0xfd31('0x4b')]['find']({'where':{'id':_0x1f3390['params']['id']}})[_0xfd31('0x2b')](handleEntityNotFound(_0x83ff61,null))[_0xfd31('0x2b')](removeEntity(_0x83ff61,null))[_0xfd31('0x53')](handleError(_0x83ff61,null));};exports[_0xfd31('0x5b')]=function(_0x16805b,_0x58f7c7){return db['OpenchannelQueue']['describe']()['then'](respondWithResult(_0x58f7c7,null))[_0xfd31('0x53')](handleError(_0x58f7c7,null));};exports['getMembers']=function(_0x34e158,_0x3ee02e,_0x4ef90e){var _0x442bf5={'raw':!![],'where':{}},_0x46cbd1={},_0x232193;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x34e158[_0xfd31('0x50')]['id']}})[_0xfd31('0x2b')](handleEntityNotFound(_0x3ee02e,null))[_0xfd31('0x2b')](function(_0x491589){if(_0x491589){_0x232193=_0x491589['get']({'plain':!![]});_0x46cbd1[_0xfd31('0x38')]=_['keys'](db['UserOpenchannelQueue']['rawAttributes']);_0x46cbd1[_0xfd31('0x3b')]=_[_0xfd31('0x3c')](_0x34e158[_0xfd31('0x3b')]);_0x46cbd1[_0xfd31('0x45')]=_[_0xfd31('0x3d')](_0x46cbd1[_0xfd31('0x38')],_0x46cbd1[_0xfd31('0x3b')]);_0x442bf5[_0xfd31('0x3e')]=_[_0xfd31('0x3d')](_0x46cbd1['model'],qs[_0xfd31('0x3f')](_0x34e158[_0xfd31('0x3b')][_0xfd31('0x3f')]));_0x442bf5[_0xfd31('0x3e')]=_0x442bf5[_0xfd31('0x3e')][_0xfd31('0x51')]?_0x442bf5[_0xfd31('0x3e')]:_0x46cbd1['model'];if(!_0x34e158[_0xfd31('0x3b')][_0xfd31('0x40')](_0xfd31('0x41'))){_0x442bf5[_0xfd31('0x25')]=qs[_0xfd31('0x25')](_0x34e158['query'][_0xfd31('0x25')]);_0x442bf5[_0xfd31('0x23')]=qs[_0xfd31('0x23')](_0x34e158[_0xfd31('0x3b')][_0xfd31('0x23')]);}_0x442bf5['order']=qs['sort'](_0x34e158[_0xfd31('0x3b')][_0xfd31('0x43')]);_0x442bf5[_0xfd31('0x44')]=qs[_0xfd31('0x45')](_[_0xfd31('0x46')](_0x34e158[_0xfd31('0x3b')],_0x46cbd1[_0xfd31('0x45')]));_0x442bf5['where'][_0xfd31('0x5c')]=_0x491589['id'];if(_0x34e158[_0xfd31('0x3b')]['filter']){_0x442bf5[_0xfd31('0x44')]=_[_0xfd31('0x48')](_0x442bf5[_0xfd31('0x44')],{'$or':_[_0xfd31('0x39')](_0x442bf5[_0xfd31('0x3e')],function(_0x2f850b){var _0x1ee192={};_0x1ee192[_0x2f850b]={'$like':'%'+_0x34e158[_0xfd31('0x3b')][_0xfd31('0x47')]+'%'};return _0x1ee192;})});}_0x442bf5=_[_0xfd31('0x48')]({},_0x442bf5,_0x34e158[_0xfd31('0x4a')]);return db[_0xfd31('0x5d')]['findAll'](_0x442bf5);}})[_0xfd31('0x2b')](function(_0x5aa7e0){if(_0x5aa7e0){return db[_0xfd31('0x5e')]['findAndCountAll']({'where':{'id':_[_0xfd31('0x39')](_0x5aa7e0,'UserId'),'role':_0xfd31('0x5f')},'attributes':['id',_0xfd31('0x3a'),'openchannelPause',_0xfd31('0x60'),_0xfd31('0x61')]});}})[_0xfd31('0x2b')](function(_0xcc3b29){if(_0xcc3b29){return{'count':_0xcc3b29[_0xfd31('0x26')],'rows':_[_0xfd31('0x39')](_0xcc3b29[_0xfd31('0x4e')],function(_0x47f0ce){return{'membername':_0x47f0ce['name'],'UserId':_0x47f0ce['id'],'queue_name':_0x232193[_0xfd31('0x3a')],'OpenchannelQueueId':_0x232193['id'],'interface':util[_0xfd31('0x62')](_0xfd31('0x63'),'SIP',_0x47f0ce[_0xfd31('0x3a')]),'penalty':0x0,'paused':_0x47f0ce[_0xfd31('0x64')],'createdAt':_0x47f0ce['createdAt'],'updatedAt':_0x47f0ce[_0xfd31('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfd31('0x2b')](respondWithFilteredResult(_0x3ee02e,_0x442bf5))['catch'](handleError(_0x3ee02e,null));};exports[_0xfd31('0x65')]=function(_0x320e4f,_0x114746,_0xa45250){var _0x3d820f={};var _0x167947={};var _0x29250f;var _0x5a48b0;return db[_0xfd31('0x4b')][_0xfd31('0x66')]({'where':{'id':_0x320e4f[_0xfd31('0x50')]['id']}})[_0xfd31('0x2b')](handleEntityNotFound(_0x114746,null))[_0xfd31('0x2b')](function(_0x1f6400){if(_0x1f6400){_0x29250f=_0x1f6400;_0x167947['model']=_[_0xfd31('0x3c')](db[_0xfd31('0x67')][_0xfd31('0x34')]);_0x167947[_0xfd31('0x3b')]=_[_0xfd31('0x3c')](_0x320e4f[_0xfd31('0x3b')]);_0x167947[_0xfd31('0x45')]=_[_0xfd31('0x3d')](_0x167947[_0xfd31('0x38')],_0x167947['query']);_0x3d820f[_0xfd31('0x3e')]=_[_0xfd31('0x3d')](_0x167947[_0xfd31('0x38')],qs['fields'](_0x320e4f[_0xfd31('0x3b')][_0xfd31('0x3f')]));_0x3d820f[_0xfd31('0x3e')]=_0x3d820f[_0xfd31('0x3e')]['length']?_0x3d820f[_0xfd31('0x3e')]:_0x167947[_0xfd31('0x38')];_0x3d820f['order']=qs['sort'](_0x320e4f[_0xfd31('0x3b')][_0xfd31('0x43')]);_0x3d820f['where']=qs[_0xfd31('0x45')](_[_0xfd31('0x46')](_0x320e4f[_0xfd31('0x3b')],_0x167947['filters']));if(_0x320e4f[_0xfd31('0x3b')]['filter']){_0x3d820f[_0xfd31('0x44')]=_[_0xfd31('0x48')](_0x3d820f[_0xfd31('0x44')],{'$or':_[_0xfd31('0x39')](_0x3d820f[_0xfd31('0x3e')],function(_0x1456f8){var _0x478391={};_0x478391[_0x1456f8]={'$like':'%'+_0x320e4f['query'][_0xfd31('0x47')]+'%'};return _0x478391;})});}_0x3d820f=_['merge']({},_0x3d820f,_0x320e4f[_0xfd31('0x4a')]);return _0x29250f[_0xfd31('0x65')](_0x3d820f);}})[_0xfd31('0x2b')](function(_0x1eaa68){if(_0x1eaa68){_0x5a48b0=_0x1eaa68[_0xfd31('0x51')];if(!_0x320e4f[_0xfd31('0x3b')][_0xfd31('0x40')](_0xfd31('0x41'))){_0x3d820f[_0xfd31('0x25')]=qs['limit'](_0x320e4f[_0xfd31('0x3b')][_0xfd31('0x25')]);_0x3d820f[_0xfd31('0x23')]=qs[_0xfd31('0x23')](_0x320e4f[_0xfd31('0x3b')][_0xfd31('0x23')]);}return _0x29250f[_0xfd31('0x65')](_0x3d820f);}})['then'](function(_0x4ea036){if(_0x4ea036){return _0x4ea036?{'count':_0x5a48b0,'rows':_0x4ea036}:null;}})[_0xfd31('0x2b')](respondWithResult(_0x114746,null))[_0xfd31('0x53')](handleError(_0x114746,null));};exports[_0xfd31('0x68')]=function(_0x41d1c2,_0x30de5c,_0x57e9d6){var _0x48ce1a=_0x41d1c2['body'][_0xfd31('0x69')];return db[_0xfd31('0x67')][_0xfd31('0x6a')]({'where':{'id':_0x48ce1a},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfd31('0x6b'),'attributes':['id','name',_0xfd31('0x6c'),_0xfd31('0x6d'),_0xfd31('0x6e')],'raw':!![]}]})['then'](function(_0x4109df){if(_0x4109df){var _0xc954c9=_[_0xfd31('0x6f')](_0x4109df,function(_0x40e297){var _0xbe1b90=_0x40e297[_0xfd31('0x2d')]({'plain':!![]});return _0xbe1b90[_0xfd31('0x6b')];});return db[_0xfd31('0x4b')][_0xfd31('0x52')]({'where':{'id':_0x41d1c2[_0xfd31('0x50')]['id']}})['then'](function(_0x1bbfce){return db['sequelize'][_0xfd31('0x70')](function(_0x4ab5f6){return _0x1bbfce[_0xfd31('0x68')](_0x48ce1a,{'transaction':_0x4ab5f6})[_0xfd31('0x2b')](function(){return BPromise[_0xfd31('0x71')](_0xc954c9,function(_0x30484b){return db[_0xfd31('0x5d')][_0xfd31('0x72')]({'where':{'UserId':_0x30484b['id'],'OpenchannelQueueId':_0x41d1c2[_0xfd31('0x50')]['id']},'transaction':_0x4ab5f6});});})[_0xfd31('0x2b')](function(){_0xc954c9['forEach'](function(_0x2cee50){socket[_0xfd31('0x73')](_0xfd31('0x74'),{'UserId':_0x2cee50['id'],'OpenchannelQueueId':_0x1bbfce['id']});});});});});}})['then'](respondWithStatusCode(_0x30de5c,null))[_0xfd31('0x53')](handleError(_0x30de5c,null));};exports['removeTeams']=function(_0x26650b,_0x546a85,_0x19106f){return db[_0xfd31('0x67')][_0xfd31('0x6a')]({'where':{'id':_0x26650b[_0xfd31('0x3b')][_0xfd31('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfd31('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xfd31('0x2b')](handleEntityNotFound(_0x546a85,null))[_0xfd31('0x2b')](function(_0x1fc7b1){var _0x567332=_['map'](_0x1fc7b1,'id');var _0x25103d=[];var _0x246306=[];var _0x2d2e94=squel[_0xfd31('0x75')]();_0x2d2e94[_0xfd31('0x76')](_0xfd31('0x77'))[_0xfd31('0x78')](_0xfd31('0x79'),'tq')[_0xfd31('0x7a')](_0xfd31('0x7b'),'ut',_0xfd31('0x7c'))['where'](_0xfd31('0x7d'),_0x26650b['params']['id']);for(var _0x3c99c5=0x0;_0x3c99c5<_0x1fc7b1['length'];_0x3c99c5+=0x1){let _0x1156e2=_0x1fc7b1[_0x3c99c5];for(var _0x4fb55d=0x0;_0x4fb55d<_0x1156e2[_0xfd31('0x6b')][_0xfd31('0x51')];_0x4fb55d+=0x1){let _0x33dd2b=_0x1156e2[_0xfd31('0x6b')][_0x4fb55d];var _0x31ca3f=_0x2d2e94[_0xfd31('0x7e')]();_0x31ca3f[_0xfd31('0x44')](_0xfd31('0x7f'),_0x33dd2b['id']);_0x246306['push'](db['sequelize'][_0xfd31('0x3b')](_0x31ca3f[_0xfd31('0x80')](),{'type':db[_0xfd31('0x81')][_0xfd31('0x82')]['SELECT']})[_0xfd31('0x2b')](function(_0x4386a6){if(_0x4386a6[_0xfd31('0x51')]===0x1){return _0x33dd2b['id'];}else{var _0x1427b0=_[_0xfd31('0x83')](_[_0xfd31('0x39')](_0x4386a6,_0xfd31('0x84')),function(_0x2b8de8){return _['includes'](_0x567332,_0x2b8de8);});if(_0x1427b0){return _0x33dd2b['id'];}}}));}}return BPromise[_0xfd31('0x85')](_0x246306)[_0xfd31('0x2b')](function(_0x539b88){_0x25103d=_(_0x25103d)[_0xfd31('0x86')](_0x539b88)[_0xfd31('0x87')]()[_0xfd31('0x88')]();return db[_0xfd31('0x4b')][_0xfd31('0x52')]({'where':{'id':_0x26650b['params']['id']}})[_0xfd31('0x2b')](function(_0x26fdd4){return db[_0xfd31('0x81')][_0xfd31('0x70')](function(_0x43f6a6){return _0x26fdd4[_0xfd31('0x89')](_0x26650b[_0xfd31('0x3b')][_0xfd31('0x69')],{'transaction':_0x43f6a6})['then'](function(){if(!_[_0xfd31('0x8a')](_0x25103d)){return _0x26fdd4[_0xfd31('0x8b')](_0x25103d,{'transaction':_0x43f6a6});}})[_0xfd31('0x2b')](function(){_0x25103d[_0xfd31('0x8c')](function(_0x1d4456){socket[_0xfd31('0x73')](_0xfd31('0x8d'),{'UserId':_0x1d4456,'OpenchannelQueueId':_0x26fdd4['id']});});});});});});})[_0xfd31('0x2b')](respondWithStatusCode(_0x546a85,null))[_0xfd31('0x53')](handleError(_0x546a85,null));};exports[_0xfd31('0x8e')]=function(_0x57c4d2,_0x7fc7cf,_0x477b53){return db[_0xfd31('0x4b')][_0xfd31('0x52')]({'where':{'id':_0x57c4d2['params']['id']}})[_0xfd31('0x2b')](handleEntityNotFound(_0x7fc7cf,null))[_0xfd31('0x2b')](function(_0x21c552){if(_0x21c552){return _0x21c552[_0xfd31('0x8e')](_0x57c4d2['body'][_0xfd31('0x69')],_[_0xfd31('0x8f')](_0x57c4d2[_0xfd31('0x5a')],['ids','id'])||{})[_0xfd31('0x90')](function(_0x2f0b9b){for(var _0x158d14=0x0;_0x158d14<_0x57c4d2['body'][_0xfd31('0x69')]['length'];_0x158d14+=0x1){socket['emit'](_0xfd31('0x74'),{'UserId':Number(_0x57c4d2[_0xfd31('0x5a')]['ids'][_0x158d14]),'OpenchannelQueueId':Number(_0x57c4d2[_0xfd31('0x50')]['id'])});}return _0x2f0b9b;});}})[_0xfd31('0x2b')](respondWithResult(_0x7fc7cf,null))['catch'](handleError(_0x7fc7cf,null));};exports[_0xfd31('0x8b')]=function(_0x4578a0,_0x1786e9,_0x45f43b){return db[_0xfd31('0x4b')][_0xfd31('0x52')]({'where':{'id':_0x4578a0['params']['id']}})['then'](handleEntityNotFound(_0x1786e9,null))[_0xfd31('0x2b')](function(_0x50379b){if(_0x50379b){return _0x50379b[_0xfd31('0x8b')](_0x4578a0[_0xfd31('0x3b')][_0xfd31('0x69')])['then'](function(){if(_[_0xfd31('0x91')](_0x4578a0[_0xfd31('0x3b')][_0xfd31('0x69')])){for(var _0x2732ee=0x0;_0x2732ee<_0x4578a0[_0xfd31('0x3b')]['ids'][_0xfd31('0x51')];_0x2732ee+=0x1){socket[_0xfd31('0x73')](_0xfd31('0x8d'),{'UserId':Number(_0x4578a0[_0xfd31('0x3b')][_0xfd31('0x69')][_0x2732ee]),'OpenchannelQueueId':Number(_0x4578a0[_0xfd31('0x50')]['id'])});}}else{socket[_0xfd31('0x73')](_0xfd31('0x8d'),{'UserId':Number(_0x4578a0['query'][_0xfd31('0x69')]),'OpenchannelQueueId':Number(_0x4578a0['params']['id'])});}});}})[_0xfd31('0x2b')](respondWithStatusCode(_0x1786e9,null))[_0xfd31('0x53')](handleError(_0x1786e9,null));};exports[_0xfd31('0x92')]=function(_0x564227,_0x12529b,_0x2e3600){var _0x108e78={};var _0x4ee2be={};var _0x564308;var _0x4e5e1f;return db[_0xfd31('0x4b')][_0xfd31('0x66')]({'where':{'id':_0x564227[_0xfd31('0x50')]['id']}})[_0xfd31('0x2b')](handleEntityNotFound(_0x12529b,null))[_0xfd31('0x2b')](function(_0x544c31){if(_0x544c31){_0x564308=_0x544c31;_0x4ee2be['model']=_[_0xfd31('0x3c')](db['User'][_0xfd31('0x34')]);_0x4ee2be[_0xfd31('0x3b')]=_[_0xfd31('0x3c')](_0x564227[_0xfd31('0x3b')]);_0x4ee2be[_0xfd31('0x45')]=_['intersection'](_0x4ee2be['model'],_0x4ee2be[_0xfd31('0x3b')]);_0x108e78['attributes']=_['intersection'](_0x4ee2be[_0xfd31('0x38')],qs[_0xfd31('0x3f')](_0x564227[_0xfd31('0x3b')][_0xfd31('0x3f')]));_0x108e78[_0xfd31('0x3e')]=_0x108e78['attributes'][_0xfd31('0x51')]?_0x108e78[_0xfd31('0x3e')]:_0x4ee2be[_0xfd31('0x38')];_0x108e78['order']=qs[_0xfd31('0x43')](_0x564227[_0xfd31('0x3b')][_0xfd31('0x43')]);_0x108e78[_0xfd31('0x44')]=qs[_0xfd31('0x45')](_[_0xfd31('0x46')](_0x564227[_0xfd31('0x3b')],_0x4ee2be[_0xfd31('0x45')]));if(_0x564227[_0xfd31('0x3b')][_0xfd31('0x47')]){_0x108e78[_0xfd31('0x44')]=_[_0xfd31('0x48')](_0x108e78[_0xfd31('0x44')],{'$or':_[_0xfd31('0x39')](_0x108e78['attributes'],function(_0x4e3745){var _0x2453a9={};_0x2453a9[_0x4e3745]={'$like':'%'+_0x564227[_0xfd31('0x3b')][_0xfd31('0x47')]+'%'};return _0x2453a9;})});}_0x108e78=_[_0xfd31('0x48')]({},_0x108e78,_0x564227['options']);return _0x564308[_0xfd31('0x92')](_0x108e78);}})['then'](function(_0x2ba4a5){if(_0x2ba4a5){_0x4e5e1f=_0x2ba4a5[_0xfd31('0x51')];if(!_0x564227[_0xfd31('0x3b')]['hasOwnProperty'](_0xfd31('0x41'))){_0x108e78['limit']=qs['limit'](_0x564227['query'][_0xfd31('0x25')]);_0x108e78[_0xfd31('0x23')]=qs[_0xfd31('0x23')](_0x564227[_0xfd31('0x3b')]['offset']);}return _0x564308[_0xfd31('0x92')](_0x108e78);}})[_0xfd31('0x2b')](function(_0x15cb73){if(_0x15cb73){return _0x15cb73?{'count':_0x4e5e1f,'rows':_0x15cb73}:null;}})[_0xfd31('0x2b')](respondWithResult(_0x12529b,null))[_0xfd31('0x53')](handleError(_0x12529b,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 178dd63..39ee912 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 _0x5ecd=['../../mysqldb','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x58ea32,_0x17c124){var _0x28273e=function(_0x8899ac){while(--_0x8899ac){_0x58ea32['push'](_0x58ea32['shift']());}};_0x28273e(++_0x17c124);}(_0x5ecd,0x137));var _0xd5ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5ecd[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd5ec('0x0'));var OpenchannelQueue=require(_0xd5ec('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd5ec('0x2'),'afterUpdate':_0xd5ec('0x3'),'afterDestroy':_0xd5ec('0x4')};function emitEvent(_0x380a76){return function(_0x593892,_0x5aee7f,_0x5e6414){OpenchannelQueueEvents[_0xd5ec('0x5')](_0x380a76+':'+_0x593892['id'],_0x593892);OpenchannelQueueEvents['emit'](_0x380a76,_0x593892);_0x5e6414(null);};}for(var e in events){if(events[_0xd5ec('0x6')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xd5ec('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xf71b=['emit','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','remove'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0xf71b,0x1aa));var _0xbf71=function(_0x5a50cc,_0x15cba1){_0x5a50cc=_0x5a50cc-0x0;var _0xf7e8d2=_0xf71b[_0x5a50cc];return _0xf7e8d2;};'use strict';var EventEmitter=require(_0xbf71('0x0'));var OpenchannelQueue=require(_0xbf71('0x1'))['db'][_0xbf71('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xbf71('0x3')](0x0);var events={'afterCreate':_0xbf71('0x4'),'afterUpdate':'update','afterDestroy':_0xbf71('0x5')};function emitEvent(_0xf94c){return function(_0x1bafe7,_0x47f913,_0xbae6f7){OpenchannelQueueEvents['emit'](_0xf94c+':'+_0x1bafe7['id'],_0x1bafe7);OpenchannelQueueEvents[_0xbf71('0x6')](_0xf94c,_0x1bafe7);_0xbae6f7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xbf71('0x7')](e,emitEvent(event));}}module[_0xbf71('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 12c32ae..34d1121 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 _0x6bad=['OpenchannelQueue','openchannel_queues','util','api','moment','request-promise','rimraf','define'];(function(_0x1c7f72,_0x391abe){var _0x1f98b5=function(_0x19436b){while(--_0x19436b){_0x1c7f72['push'](_0x1c7f72['shift']());}};_0x1f98b5(++_0x391abe);}(_0x6bad,0x82));var _0xd6ba=function(_0x584ac1,_0x4c62d1){_0x584ac1=_0x584ac1-0x0;var _0x44e797=_0x6bad[_0x584ac1];return _0x44e797;};'use strict';var _=require('lodash');var util=require(_0xd6ba('0x0'));var logger=require('../../config/logger')(_0xd6ba('0x1'));var moment=require(_0xd6ba('0x2'));var BPromise=require('bluebird');var rp=require(_0xd6ba('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd6ba('0x4'));var config=require('../../config/environment');var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x5b1d9f,_0x2d6712){return _0x5b1d9f[_0xd6ba('0x5')](_0xd6ba('0x6'),attributes,{'tableName':_0xd6ba('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b41=['exports','openchannel_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x569fef,_0x49c37a){var _0x11f20b=function(_0x3721d8){while(--_0x3721d8){_0x569fef['push'](_0x569fef['shift']());}};_0x11f20b(++_0x49c37a);}(_0x0b41,0x12b));var _0x10b4=function(_0x28cff7,_0x3c9ada){_0x28cff7=_0x28cff7-0x0;var _0xc87ac7=_0x0b41[_0x28cff7];return _0xc87ac7;};'use strict';var _=require(_0x10b4('0x0'));var util=require(_0x10b4('0x1'));var logger=require(_0x10b4('0x2'))('api');var moment=require(_0x10b4('0x3'));var BPromise=require(_0x10b4('0x4'));var rp=require(_0x10b4('0x5'));var fs=require('fs');var path=require(_0x10b4('0x6'));var rimraf=require(_0x10b4('0x7'));var config=require(_0x10b4('0x8'));var attributes=require('./openchannelQueue.attributes');module[_0x10b4('0x9')]=function(_0x580d5e,_0x416e07){return _0x580d5e['define']('OpenchannelQueue',attributes,{'tableName':_0x10b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index f3239b6..028969b 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 _0xf70f=['where','ShowOpenchannelQueue','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','info','debug','request\x20sent','stringify','error','code','message','OpenchannelQueue,\x20%s,\x20%s','result','findAll','options','raw','attributes','limit','include','map','model','GetOpenchannelQueue','catch','OpenchannelQueue','find'];(function(_0x539e41,_0x46658f){var _0x416858=function(_0x5b27f0){while(--_0x5b27f0){_0x539e41['push'](_0x539e41['shift']());}};_0x416858(++_0x46658f);}(_0xf70f,0x188));var _0xff70=function(_0xd4e399,_0x4a8481){_0xd4e399=_0xd4e399-0x0;var _0x1186c9=_0xf70f[_0xd4e399];return _0x1186c9;};'use strict';var _=require('lodash');var util=require(_0xff70('0x0'));var moment=require('moment');var BPromise=require(_0xff70('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff70('0x2'));var db=require(_0xff70('0x3'))['db'];var utils=require(_0xff70('0x4'));var logger=require(_0xff70('0x5'))(_0xff70('0x6'));var config=require(_0xff70('0x7'));var jayson=require(_0xff70('0x8'));var client=jayson[_0xff70('0x9')][_0xff70('0xa')]({'port':0x232a});config[_0xff70('0xb')]=_[_0xff70('0xc')](config[_0xff70('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xff70('0xd'))(new Redis(config['redis']));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x42fd38,_0x1255d8,_0x2b0506){return new BPromise(function(_0x222e7c,_0x631af1){return client[_0xff70('0xe')](_0x42fd38,_0x2b0506)[_0xff70('0xf')](function(_0x5e6c26){logger[_0xff70('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x1255d8,'request\x20sent');logger[_0xff70('0x11')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1255d8,_0xff70('0x12'),JSON[_0xff70('0x13')](_0x5e6c26));if(_0x5e6c26['error']){if(_0x5e6c26[_0xff70('0x14')][_0xff70('0x15')]===0x1f4){logger[_0xff70('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x1255d8,_0x5e6c26[_0xff70('0x14')]['message']);return _0x631af1(_0x5e6c26[_0xff70('0x14')][_0xff70('0x16')]);}logger[_0xff70('0x14')](_0xff70('0x17'),_0x1255d8,_0x5e6c26[_0xff70('0x14')]['message']);return _0x222e7c(_0x5e6c26[_0xff70('0x14')][_0xff70('0x16')]);}else{logger[_0xff70('0x10')](_0xff70('0x17'),_0x1255d8,_0xff70('0x12'));_0x222e7c(_0x5e6c26[_0xff70('0x18')][_0xff70('0x16')]);}})['catch'](function(_0xd23b23){logger['error'](_0xff70('0x17'),_0x1255d8,_0xd23b23);_0x631af1(_0xd23b23);});});}exports['GetOpenchannelQueue']=function(_0x369b44){var _0x3650d1=this;return new Promise(function(_0x13db47,_0x55dfcc){return db['OpenchannelQueue'][_0xff70('0x19')]({'raw':_0x369b44[_0xff70('0x1a')]?_0x369b44[_0xff70('0x1a')][_0xff70('0x1b')]===undefined?!![]:![]:!![],'where':_0x369b44[_0xff70('0x1a')]?_0x369b44['options']['where']||null:null,'attributes':_0x369b44[_0xff70('0x1a')]?_0x369b44[_0xff70('0x1a')][_0xff70('0x1c')]||null:null,'limit':_0x369b44['options']?_0x369b44[_0xff70('0x1a')][_0xff70('0x1d')]||null:null,'include':_0x369b44[_0xff70('0x1a')]?_0x369b44[_0xff70('0x1a')][_0xff70('0x1e')]?_[_0xff70('0x1f')](_0x369b44[_0xff70('0x1a')][_0xff70('0x1e')],function(_0x151d80){return{'model':db[_0x151d80[_0xff70('0x20')]],'as':_0x151d80['as'],'attributes':_0x151d80[_0xff70('0x1c')],'include':_0x151d80[_0xff70('0x1e')]?_[_0xff70('0x1f')](_0x151d80[_0xff70('0x1e')],function(_0x12dc01){return{'model':db[_0x12dc01['model']],'as':_0x12dc01['as'],'attributes':_0x12dc01[_0xff70('0x1c')],'include':_0x12dc01[_0xff70('0x1e')]?_[_0xff70('0x1f')](_0x12dc01[_0xff70('0x1e')],function(_0x1bd360){return{'model':db[_0x1bd360['model']],'as':_0x1bd360['as'],'attributes':_0x1bd360['attributes']};}):[]};}):[]};}):[]:[]})[_0xff70('0xf')](function(_0xecaa92){logger[_0xff70('0x10')](_0xff70('0x21'),_0x369b44);logger['debug'](_0xff70('0x21'),_0x369b44,JSON[_0xff70('0x13')](_0xecaa92));_0x13db47(_0xecaa92);})[_0xff70('0x22')](function(_0xec1b95){logger[_0xff70('0x14')]('GetOpenchannelQueue',_0xec1b95['message'],_0x369b44);_0x55dfcc(_0x3650d1[_0xff70('0x14')](0x1f4,_0xec1b95[_0xff70('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x2352cf){var _0x4ef635=this;return new Promise(function(_0x55450d,_0x2f2cfe){return db[_0xff70('0x23')][_0xff70('0x24')]({'raw':_0x2352cf[_0xff70('0x1a')]?_0x2352cf['options'][_0xff70('0x1b')]===undefined?!![]:![]:!![],'where':_0x2352cf['options']?_0x2352cf[_0xff70('0x1a')][_0xff70('0x25')]||null:null,'attributes':_0x2352cf[_0xff70('0x1a')]?_0x2352cf[_0xff70('0x1a')][_0xff70('0x1c')]||null:null,'include':_0x2352cf[_0xff70('0x1a')]?_0x2352cf[_0xff70('0x1a')][_0xff70('0x1e')]?_[_0xff70('0x1f')](_0x2352cf[_0xff70('0x1a')][_0xff70('0x1e')],function(_0x4b54cc){return{'model':db[_0x4b54cc[_0xff70('0x20')]],'as':_0x4b54cc['as'],'attributes':_0x4b54cc[_0xff70('0x1c')],'include':_0x4b54cc['include']?_[_0xff70('0x1f')](_0x4b54cc['include'],function(_0x42e5f1){return{'model':db[_0x42e5f1[_0xff70('0x20')]],'as':_0x42e5f1['as'],'attributes':_0x42e5f1[_0xff70('0x1c')],'include':_0x42e5f1[_0xff70('0x1e')]?_[_0xff70('0x1f')](_0x42e5f1[_0xff70('0x1e')],function(_0x347e22){return{'model':db[_0x347e22[_0xff70('0x20')]],'as':_0x347e22['as'],'attributes':_0x347e22[_0xff70('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xff70('0xf')](function(_0x56fc55){logger['info']('ShowOpenchannelQueue',_0x2352cf);logger[_0xff70('0x11')](_0xff70('0x26'),_0x2352cf,JSON[_0xff70('0x13')](_0x56fc55));_0x55450d(_0x56fc55);})[_0xff70('0x22')](function(_0x1bc913){logger[_0xff70('0x14')](_0xff70('0x26'),_0x1bc913['message'],_0x2352cf);_0x2f2cfe(_0x4ef635[_0xff70('0x14')](0x1f4,_0x1bc913[_0xff70('0x16')]));});});}; \ No newline at end of file +var _0x69b7=['limit','map','include','model','stringify','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes'];(function(_0xb33f4,_0x337620){var _0x2ae66c=function(_0x122138){while(--_0x122138){_0xb33f4['push'](_0xb33f4['shift']());}};_0x2ae66c(++_0x337620);}(_0x69b7,0x88));var _0x769b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x69b7[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x769b('0x0'));var util=require(_0x769b('0x1'));var moment=require(_0x769b('0x2'));var BPromise=require(_0x769b('0x3'));var rs=require(_0x769b('0x4'));var fs=require('fs');var Redis=require(_0x769b('0x5'));var db=require(_0x769b('0x6'))['db'];var utils=require(_0x769b('0x7'));var logger=require('../../config/logger')(_0x769b('0x8'));var config=require(_0x769b('0x9'));var jayson=require(_0x769b('0xa'));var client=jayson[_0x769b('0xb')][_0x769b('0xc')]({'port':0x232a});config[_0x769b('0xd')]=_[_0x769b('0xe')](config[_0x769b('0xd')],{'host':_0x769b('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x769b('0xd')]));require(_0x769b('0x10'))[_0x769b('0x11')](socket);function respondWithRpcPromise(_0x281db8,_0x2ab00e,_0x11eb52){return new BPromise(function(_0x224cc8,_0x325876){return client[_0x769b('0x12')](_0x281db8,_0x11eb52)[_0x769b('0x13')](function(_0x1c92d2){logger[_0x769b('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x2ab00e,'request\x20sent');logger[_0x769b('0x15')](_0x769b('0x16'),_0x2ab00e,_0x769b('0x17'),JSON['stringify'](_0x1c92d2));if(_0x1c92d2[_0x769b('0x18')]){if(_0x1c92d2[_0x769b('0x18')][_0x769b('0x19')]===0x1f4){logger['error'](_0x769b('0x1a'),_0x2ab00e,_0x1c92d2[_0x769b('0x18')][_0x769b('0x1b')]);return _0x325876(_0x1c92d2[_0x769b('0x18')][_0x769b('0x1b')]);}logger[_0x769b('0x18')](_0x769b('0x1a'),_0x2ab00e,_0x1c92d2[_0x769b('0x18')][_0x769b('0x1b')]);return _0x224cc8(_0x1c92d2[_0x769b('0x18')]['message']);}else{logger[_0x769b('0x14')](_0x769b('0x1a'),_0x2ab00e,_0x769b('0x17'));_0x224cc8(_0x1c92d2[_0x769b('0x1c')][_0x769b('0x1b')]);}})[_0x769b('0x1d')](function(_0x23f0de){logger[_0x769b('0x18')](_0x769b('0x1a'),_0x2ab00e,_0x23f0de);_0x325876(_0x23f0de);});});}exports[_0x769b('0x1e')]=function(_0x429b8f){var _0x58b889=this;return new Promise(function(_0x28a15b,_0x383206){return db[_0x769b('0x1f')]['findAll']({'raw':_0x429b8f[_0x769b('0x20')]?_0x429b8f[_0x769b('0x20')][_0x769b('0x21')]===undefined?!![]:![]:!![],'where':_0x429b8f[_0x769b('0x20')]?_0x429b8f['options'][_0x769b('0x22')]||null:null,'attributes':_0x429b8f[_0x769b('0x20')]?_0x429b8f[_0x769b('0x20')][_0x769b('0x23')]||null:null,'limit':_0x429b8f[_0x769b('0x20')]?_0x429b8f[_0x769b('0x20')][_0x769b('0x24')]||null:null,'include':_0x429b8f[_0x769b('0x20')]?_0x429b8f[_0x769b('0x20')]['include']?_[_0x769b('0x25')](_0x429b8f[_0x769b('0x20')][_0x769b('0x26')],function(_0x5b7c4c){return{'model':db[_0x5b7c4c[_0x769b('0x27')]],'as':_0x5b7c4c['as'],'attributes':_0x5b7c4c[_0x769b('0x23')],'include':_0x5b7c4c['include']?_[_0x769b('0x25')](_0x5b7c4c['include'],function(_0x1a99c2){return{'model':db[_0x1a99c2['model']],'as':_0x1a99c2['as'],'attributes':_0x1a99c2[_0x769b('0x23')],'include':_0x1a99c2[_0x769b('0x26')]?_[_0x769b('0x25')](_0x1a99c2['include'],function(_0x45ebf6){return{'model':db[_0x45ebf6[_0x769b('0x27')]],'as':_0x45ebf6['as'],'attributes':_0x45ebf6[_0x769b('0x23')]};}):[]};}):[]};}):[]:[]})[_0x769b('0x13')](function(_0x5e11b5){logger[_0x769b('0x14')](_0x769b('0x1e'),_0x429b8f);logger['debug'](_0x769b('0x1e'),_0x429b8f,JSON[_0x769b('0x28')](_0x5e11b5));_0x28a15b(_0x5e11b5);})[_0x769b('0x1d')](function(_0x2dec49){logger[_0x769b('0x18')](_0x769b('0x1e'),_0x2dec49[_0x769b('0x1b')],_0x429b8f);_0x383206(_0x58b889[_0x769b('0x18')](0x1f4,_0x2dec49[_0x769b('0x1b')]));});});};exports[_0x769b('0x29')]=function(_0xcd5d30){var _0x3c2f90=this;return new Promise(function(_0x324564,_0x32946d){return db[_0x769b('0x1f')][_0x769b('0x2a')]({'raw':_0xcd5d30[_0x769b('0x20')]?_0xcd5d30[_0x769b('0x20')][_0x769b('0x21')]===undefined?!![]:![]:!![],'where':_0xcd5d30[_0x769b('0x20')]?_0xcd5d30[_0x769b('0x20')]['where']||null:null,'attributes':_0xcd5d30[_0x769b('0x20')]?_0xcd5d30['options']['attributes']||null:null,'include':_0xcd5d30[_0x769b('0x20')]?_0xcd5d30[_0x769b('0x20')][_0x769b('0x26')]?_[_0x769b('0x25')](_0xcd5d30['options'][_0x769b('0x26')],function(_0x205dd0){return{'model':db[_0x205dd0[_0x769b('0x27')]],'as':_0x205dd0['as'],'attributes':_0x205dd0[_0x769b('0x23')],'include':_0x205dd0[_0x769b('0x26')]?_['map'](_0x205dd0[_0x769b('0x26')],function(_0x1d4482){return{'model':db[_0x1d4482[_0x769b('0x27')]],'as':_0x1d4482['as'],'attributes':_0x1d4482[_0x769b('0x23')],'include':_0x1d4482[_0x769b('0x26')]?_[_0x769b('0x25')](_0x1d4482[_0x769b('0x26')],function(_0x17f827){return{'model':db[_0x17f827[_0x769b('0x27')]],'as':_0x17f827['as'],'attributes':_0x17f827[_0x769b('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a53d5){logger[_0x769b('0x14')]('ShowOpenchannelQueue',_0xcd5d30);logger[_0x769b('0x15')](_0x769b('0x29'),_0xcd5d30,JSON[_0x769b('0x28')](_0x1a53d5));_0x324564(_0x1a53d5);})[_0x769b('0x1d')](function(_0x55dcca){logger[_0x769b('0x18')](_0x769b('0x29'),_0x55dcca[_0x769b('0x1b')],_0xcd5d30);_0x32946d(_0x3c2f90['error'](0x1f4,_0x55dcca[_0x769b('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 7c841d0..af4eac3 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 _0xb945=['remove','register','length','./openchannelQueue.events','save'];(function(_0xcbd0bd,_0x2495d7){var _0x55105b=function(_0x2e39de){while(--_0x2e39de){_0xcbd0bd['push'](_0xcbd0bd['shift']());}};_0x55105b(++_0x2495d7);}(_0xb945,0x1ca));var _0x5b94=function(_0x6007a9,_0x187458){_0x6007a9=_0x6007a9-0x0;var _0x56cb7a=_0xb945[_0x6007a9];return _0x56cb7a;};'use strict';var OpenchannelQueueEvents=require(_0x5b94('0x0'));var events=[_0x5b94('0x1'),_0x5b94('0x2'),'update'];function createListener(_0x26e87c,_0x4c7cf3){return function(_0x3ba98b){_0x4c7cf3['emit'](_0x26e87c,_0x3ba98b);};}function removeListener(_0x4fb47e,_0x4e6e1a){return function(){OpenchannelQueueEvents['removeListener'](_0x4fb47e,_0x4e6e1a);};}exports[_0x5b94('0x3')]=function(_0x1f2421){for(var _0x2ed8c8=0x0,_0x3dc8da=events[_0x5b94('0x4')];_0x2ed8c8<_0x3dc8da;_0x2ed8c8++){var _0x5116f3=events[_0x2ed8c8];var _0x48bb89=createListener('openchannelQueue:'+_0x5116f3,_0x1f2421);OpenchannelQueueEvents['on'](_0x5116f3,_0x48bb89);}}; \ No newline at end of file +var _0x85ba=['register','length','openchannelQueue:','./openchannelQueue.events','removeListener'];(function(_0x287e09,_0x185de8){var _0x31ddc0=function(_0x107113){while(--_0x107113){_0x287e09['push'](_0x287e09['shift']());}};_0x31ddc0(++_0x185de8);}(_0x85ba,0xbc));var _0xa85b=function(_0x4565ba,_0x333915){_0x4565ba=_0x4565ba-0x0;var _0x39a2ba=_0x85ba[_0x4565ba];return _0x39a2ba;};'use strict';var OpenchannelQueueEvents=require(_0xa85b('0x0'));var events=['save','remove','update'];function createListener(_0x40f720,_0x57f63d){return function(_0x3d68f2){_0x57f63d['emit'](_0x40f720,_0x3d68f2);};}function removeListener(_0x5462d4,_0x29354a){return function(){OpenchannelQueueEvents[_0xa85b('0x1')](_0x5462d4,_0x29354a);};}exports[_0xa85b('0x2')]=function(_0x2073ca){for(var _0x1a6d32=0x0,_0x1c8e8c=events[_0xa85b('0x3')];_0x1a6d32<_0x1c8e8c;_0x1a6d32++){var _0xf10f6d=events[_0x1a6d32];var _0x3bb6c8=createListener(_0xa85b('0x4')+_0xf10f6d,_0x2073ca);OpenchannelQueueEvents['on'](_0xf10f6d,_0x3bb6c8);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 86e4d16..921042a 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 _0x890e=['../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','/describe','isAuthenticated','/:id','put','delete','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3e663f,_0x37ca6d){var _0xc48015=function(_0x40e7eb){while(--_0x40e7eb){_0x3e663f['push'](_0x3e663f['shift']());}};_0xc48015(++_0x37ca6d);}(_0x890e,0xaf));var _0xe890=function(_0x1ebbbb,_0x320187){_0x1ebbbb=_0x1ebbbb-0x0;var _0x57d8d8=_0x890e[_0x1ebbbb];return _0x57d8d8;};'use strict';var multer=require('multer');var util=require(_0xe890('0x0'));var path=require('path');var timeout=require(_0xe890('0x1'));var express=require(_0xe890('0x2'));var router=express['Router']();var fs_extra=require(_0xe890('0x3'));var auth=require(_0xe890('0x4'));var interaction=require(_0xe890('0x5'));var config=require(_0xe890('0x6'));var controller=require(_0xe890('0x7'));router[_0xe890('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe890('0x8')](_0xe890('0x9'),auth[_0xe890('0xa')](),controller['describe']);router[_0xe890('0x8')](_0xe890('0xb'),auth[_0xe890('0xa')](),controller['show']);router['post']('/',auth[_0xe890('0xa')](),controller['create']);router[_0xe890('0xc')](_0xe890('0xb'),auth[_0xe890('0xa')](),controller['update']);router[_0xe890('0xd')](_0xe890('0xb'),auth[_0xe890('0xa')](),controller[_0xe890('0xe')]);module['exports']=router; \ No newline at end of file +var _0xb686=['update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','put'];(function(_0x4e5d67,_0x54dffc){var _0x4acdf3=function(_0x53e5a3){while(--_0x53e5a3){_0x4e5d67['push'](_0x4e5d67['shift']());}};_0x4acdf3(++_0x54dffc);}(_0xb686,0x1c5));var _0x6b68=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb686[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x6b68('0x0'));var util=require('util');var path=require(_0x6b68('0x1'));var timeout=require(_0x6b68('0x2'));var express=require('express');var router=express[_0x6b68('0x3')]();var fs_extra=require(_0x6b68('0x4'));var auth=require(_0x6b68('0x5'));var interaction=require(_0x6b68('0x6'));var config=require(_0x6b68('0x7'));var controller=require('./openchannelQueueReport.controller');router[_0x6b68('0x8')]('/',auth[_0x6b68('0x9')](),controller['index']);router[_0x6b68('0x8')](_0x6b68('0xa'),auth[_0x6b68('0x9')](),controller[_0x6b68('0xb')]);router[_0x6b68('0x8')](_0x6b68('0xc'),auth['isAuthenticated'](),controller[_0x6b68('0xd')]);router['post']('/',auth[_0x6b68('0x9')](),controller['create']);router[_0x6b68('0xe')]('/:id',auth[_0x6b68('0x9')](),controller[_0x6b68('0xf')]);router[_0x6b68('0x10')](_0x6b68('0xc'),auth[_0x6b68('0x9')](),controller[_0x6b68('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 682eee9..8d225d0 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 _0x7801=['STRING','DATE','sequelize','exports'];(function(_0x40de1a,_0x581dc4){var _0x3b9c43=function(_0x4f25f9){while(--_0x4f25f9){_0x40de1a['push'](_0x40de1a['shift']());}};_0x3b9c43(++_0x581dc4);}(_0x7801,0x11a));var _0x1780=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x7801[_0x209941];return _0x1e8729;};'use strict';var moment=require('moment');var Sequelize=require(_0x1780('0x0'));module[_0x1780('0x1')]={'uniqueid':{'type':Sequelize[_0x1780('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1780('0x2')]},'joinAt':{'type':Sequelize[_0x1780('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1780('0x3')]},'exitAt':{'type':Sequelize[_0x1780('0x3')]},'reason':{'type':Sequelize[_0x1780('0x2')]}}; \ No newline at end of file +var _0xf293=['STRING','DATE','moment','sequelize','exports'];(function(_0x5137e4,_0x2dab6c){var _0x4201e0=function(_0x459410){while(--_0x459410){_0x5137e4['push'](_0x5137e4['shift']());}};_0x4201e0(++_0x2dab6c);}(_0xf293,0xde));var _0x3f29=function(_0x3fa703,_0x5ee620){_0x3fa703=_0x3fa703-0x0;var _0x33a179=_0xf293[_0x3fa703];return _0x33a179;};'use strict';var moment=require(_0x3f29('0x0'));var Sequelize=require(_0x3f29('0x1'));module[_0x3f29('0x2')]={'uniqueid':{'type':Sequelize[_0x3f29('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3f29('0x3')]},'joinAt':{'type':Sequelize[_0x3f29('0x4')]},'leaveAt':{'type':Sequelize[_0x3f29('0x4')]},'acceptAt':{'type':Sequelize[_0x3f29('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x3f29('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 5953399..969324e 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 _0x43eb=['find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelQueueReport','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body'];(function(_0x4ada92,_0x133919){var _0x357aeb=function(_0x3cb111){while(--_0x3cb111){_0x4ada92['push'](_0x4ada92['shift']());}};_0x357aeb(++_0x133919);}(_0x43eb,0x1e2));var _0xb43e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x43eb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb43e('0x0'));var rimraf=require(_0xb43e('0x1'));var zipdir=require(_0xb43e('0x2'));var jsonpatch=require(_0xb43e('0x3'));var rp=require(_0xb43e('0x4'));var moment=require(_0xb43e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb43e('0x6'));var util=require(_0xb43e('0x7'));var path=require(_0xb43e('0x8'));var sox=require(_0xb43e('0x9'));var csv=require('to-csv');var ejs=require(_0xb43e('0xa'));var fs=require('fs');var fs_extra=require(_0xb43e('0xb'));var _=require(_0xb43e('0xc'));var squel=require(_0xb43e('0xd'));var crypto=require(_0xb43e('0xe'));var jsforce=require(_0xb43e('0xf'));var deskjs=require(_0xb43e('0x10'));var toCsv=require(_0xb43e('0x11'));var querystring=require(_0xb43e('0x12'));var Papa=require(_0xb43e('0x13'));var Redis=require(_0xb43e('0x14'));var authService=require(_0xb43e('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xb43e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb43e('0x17'))(_0xb43e('0x18'));var utils=require(_0xb43e('0x19'));var config=require(_0xb43e('0x1a'));var licenseUtil=require(_0xb43e('0x1b'));var db=require(_0xb43e('0x1c'))['db'];function respondWithStatusCode(_0x99ec8e,_0xc2aa0e){_0xc2aa0e=_0xc2aa0e||0xcc;return function(_0x16b5a0){if(_0x16b5a0){return _0x99ec8e[_0xb43e('0x1d')](_0xc2aa0e);}return _0x99ec8e[_0xb43e('0x1e')](_0xc2aa0e)[_0xb43e('0x1f')]();};}function respondWithResult(_0x2c547f,_0xebbaaf){_0xebbaaf=_0xebbaaf||0xc8;return function(_0x30400b){if(_0x30400b){return _0x2c547f[_0xb43e('0x1e')](_0xebbaaf)[_0xb43e('0x20')](_0x30400b);}};}function respondWithFilteredResult(_0x16db35,_0x4380cd){return function(_0x50b44d){if(_0x50b44d){var _0x5a8e46=typeof _0x4380cd[_0xb43e('0x21')]===_0xb43e('0x22')&&typeof _0x4380cd[_0xb43e('0x23')]===_0xb43e('0x22');var _0x342aac=_0x50b44d['count'];var _0x343566=_0x5a8e46?0x0:_0x4380cd[_0xb43e('0x21')];var _0x35fd2a=_0x5a8e46?_0x50b44d[_0xb43e('0x24')]:_0x4380cd[_0xb43e('0x21')]+_0x4380cd[_0xb43e('0x23')];var _0x55c64d;if(_0x35fd2a>=_0x342aac){_0x35fd2a=_0x342aac;_0x55c64d=0xc8;}else{_0x55c64d=0xce;}_0x16db35[_0xb43e('0x1e')](_0x55c64d);return _0x16db35[_0xb43e('0x25')](_0xb43e('0x26'),_0x343566+'-'+_0x35fd2a+'/'+_0x342aac)['json'](_0x50b44d);}return null;};}function patchUpdates(_0x4218e5){return function(_0xeb7919){try{jsonpatch['apply'](_0xeb7919,_0x4218e5,!![]);}catch(_0x4201fa){return BPromise[_0xb43e('0x27')](_0x4201fa);}return _0xeb7919[_0xb43e('0x28')]();};}function saveUpdates(_0x1c5396,_0x751429){return function(_0xae7ad5){if(_0xae7ad5){return _0xae7ad5[_0xb43e('0x29')](_0x1c5396)[_0xb43e('0x2a')](function(_0x3cf5f5){return _0x3cf5f5;});}return null;};}function removeEntity(_0x56fa66,_0x2bc1eb){return function(_0x4ca00d){if(_0x4ca00d){return _0x4ca00d[_0xb43e('0x2b')]()[_0xb43e('0x2a')](function(){_0x56fa66[_0xb43e('0x1e')](0xcc)[_0xb43e('0x1f')]();});}};}function handleEntityNotFound(_0x15ae18,_0x3c534a){return function(_0x31da74){if(!_0x31da74){_0x15ae18[_0xb43e('0x1d')](0x194);}return _0x31da74;};}function handleError(_0x3bc610,_0xaaee4a){_0xaaee4a=_0xaaee4a||0x1f4;return function(_0x44327c){logger['error'](_0x44327c[_0xb43e('0x2c')]);if(_0x44327c[_0xb43e('0x2d')]){delete _0x44327c['name'];}_0x3bc610[_0xb43e('0x1e')](_0xaaee4a)[_0xb43e('0x2e')](_0x44327c);};}exports[_0xb43e('0x2f')]=function(_0x49f116,_0x2c3143){var _0x52bf2f={},_0x1e3db2={},_0x69f56b={'count':0x0,'rows':[]};var _0x2ccd06=_[_0xb43e('0x30')](db[_0xb43e('0x31')]['rawAttributes'],function(_0x1c63b3){return{'name':_0x1c63b3['fieldName'],'type':_0x1c63b3['type'][_0xb43e('0x32')]};});_0x1e3db2[_0xb43e('0x33')]=_[_0xb43e('0x30')](_0x2ccd06,_0xb43e('0x2d'));_0x1e3db2['query']=_[_0xb43e('0x34')](_0x49f116[_0xb43e('0x35')]);_0x1e3db2[_0xb43e('0x36')]=_[_0xb43e('0x37')](_0x1e3db2[_0xb43e('0x33')],_0x1e3db2[_0xb43e('0x35')]);_0x52bf2f[_0xb43e('0x38')]=_[_0xb43e('0x37')](_0x1e3db2['model'],qs['fields'](_0x49f116[_0xb43e('0x35')][_0xb43e('0x39')]));_0x52bf2f['attributes']=_0x52bf2f[_0xb43e('0x38')]['length']?_0x52bf2f[_0xb43e('0x38')]:_0x1e3db2[_0xb43e('0x33')];if(!_0x49f116[_0xb43e('0x35')][_0xb43e('0x3a')]('nolimit')){_0x52bf2f[_0xb43e('0x23')]=qs[_0xb43e('0x23')](_0x49f116[_0xb43e('0x35')][_0xb43e('0x23')]);_0x52bf2f[_0xb43e('0x21')]=qs[_0xb43e('0x21')](_0x49f116['query'][_0xb43e('0x21')]);}_0x52bf2f[_0xb43e('0x3b')]=qs[_0xb43e('0x3c')](_0x49f116[_0xb43e('0x35')][_0xb43e('0x3c')]);_0x52bf2f[_0xb43e('0x3d')]=qs['filters'](_[_0xb43e('0x3e')](_0x49f116[_0xb43e('0x35')],_0x1e3db2[_0xb43e('0x36')]),_0x2ccd06);if(_0x49f116[_0xb43e('0x35')]['filter']){_0x52bf2f[_0xb43e('0x3d')]=_['merge'](_0x52bf2f['where'],{'$or':_[_0xb43e('0x30')](_0x2ccd06,function(_0x23494d){if(_0x23494d[_0xb43e('0x3f')]!==_0xb43e('0x40')){var _0x26c461={};_0x26c461[_0x23494d['name']]={'$like':'%'+_0x49f116[_0xb43e('0x35')][_0xb43e('0x41')]+'%'};return _0x26c461;}})});}_0x52bf2f=_[_0xb43e('0x42')]({},_0x52bf2f,_0x49f116[_0xb43e('0x43')]);var _0x33523c={'where':_0x52bf2f['where']};return db[_0xb43e('0x31')][_0xb43e('0x24')](_0x33523c)['then'](function(_0x22e0f7){_0x69f56b[_0xb43e('0x24')]=_0x22e0f7;if(_0x49f116[_0xb43e('0x35')][_0xb43e('0x44')]){_0x52bf2f[_0xb43e('0x45')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xb43e('0x46')](_0x52bf2f);})[_0xb43e('0x2a')](function(_0xbd676a){_0x69f56b[_0xb43e('0x47')]=_0xbd676a;return _0x69f56b;})[_0xb43e('0x2a')](respondWithFilteredResult(_0x2c3143,_0x52bf2f))[_0xb43e('0x48')](handleError(_0x2c3143,null));};exports[_0xb43e('0x49')]=function(_0x444fbf,_0x355eb0){var _0x33466d={'raw':!![],'where':{'id':_0x444fbf[_0xb43e('0x4a')]['id']}},_0x1ee239={};_0x1ee239['model']=_[_0xb43e('0x34')](db[_0xb43e('0x31')]['rawAttributes']);_0x1ee239[_0xb43e('0x35')]=_[_0xb43e('0x34')](_0x444fbf[_0xb43e('0x35')]);_0x1ee239[_0xb43e('0x36')]=_['intersection'](_0x1ee239[_0xb43e('0x33')],_0x1ee239['query']);_0x33466d[_0xb43e('0x38')]=_[_0xb43e('0x37')](_0x1ee239[_0xb43e('0x33')],qs[_0xb43e('0x39')](_0x444fbf[_0xb43e('0x35')][_0xb43e('0x39')]));_0x33466d[_0xb43e('0x38')]=_0x33466d[_0xb43e('0x38')][_0xb43e('0x4b')]?_0x33466d['attributes']:_0x1ee239[_0xb43e('0x33')];if(_0x444fbf[_0xb43e('0x35')][_0xb43e('0x44')]){_0x33466d[_0xb43e('0x45')]=[{'all':!![]}];}_0x33466d=_['merge']({},_0x33466d,_0x444fbf[_0xb43e('0x43')]);return db[_0xb43e('0x31')]['find'](_0x33466d)[_0xb43e('0x2a')](handleEntityNotFound(_0x355eb0,null))[_0xb43e('0x2a')](respondWithResult(_0x355eb0,null))[_0xb43e('0x48')](handleError(_0x355eb0,null));};exports[_0xb43e('0x4c')]=function(_0xff6644,_0x4ffc2f){return db[_0xb43e('0x31')][_0xb43e('0x4c')](_0xff6644[_0xb43e('0x4d')],{})[_0xb43e('0x2a')](respondWithResult(_0x4ffc2f,0xc9))[_0xb43e('0x48')](handleError(_0x4ffc2f,null));};exports[_0xb43e('0x29')]=function(_0x4ceafc,_0x296467){if(_0x4ceafc[_0xb43e('0x4d')]['id']){delete _0x4ceafc[_0xb43e('0x4d')]['id'];}return db[_0xb43e('0x31')]['find']({'where':{'id':_0x4ceafc[_0xb43e('0x4a')]['id']}})[_0xb43e('0x2a')](handleEntityNotFound(_0x296467,null))[_0xb43e('0x2a')](saveUpdates(_0x4ceafc[_0xb43e('0x4d')],null))[_0xb43e('0x2a')](respondWithResult(_0x296467,null))[_0xb43e('0x48')](handleError(_0x296467,null));};exports['destroy']=function(_0x2f052a,_0x2aa05d){return db[_0xb43e('0x31')][_0xb43e('0x4e')]({'where':{'id':_0x2f052a[_0xb43e('0x4a')]['id']}})[_0xb43e('0x2a')](handleEntityNotFound(_0x2aa05d,null))[_0xb43e('0x2a')](removeEntity(_0x2aa05d,null))['catch'](handleError(_0x2aa05d,null));};exports[_0xb43e('0x4f')]=function(_0x42531c,_0x2d58a5){return db['OpenchannelQueueReport'][_0xb43e('0x4f')]()[_0xb43e('0x2a')](respondWithResult(_0x2d58a5,null))[_0xb43e('0x48')](handleError(_0x2d58a5,null));}; \ No newline at end of file +var _0x2ca4=['filters','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','type','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','create','body','find','describe','eml-format','rimraf','request-promise','moment','sox','ejs','fs-extra','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','index','map','OpenchannelQueueReport','key','model','query','keys'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x2ca4,0x9e));var _0x42ca=function(_0x253bd2,_0x4e88ff){_0x253bd2=_0x253bd2-0x0;var _0x457ff9=_0x2ca4[_0x253bd2];return _0x457ff9;};'use strict';var emlformat=require(_0x42ca('0x0'));var rimraf=require(_0x42ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x42ca('0x2'));var moment=require(_0x42ca('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x42ca('0x4'));var csv=require('to-csv');var ejs=require(_0x42ca('0x5'));var fs=require('fs');var fs_extra=require(_0x42ca('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x42ca('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x42ca('0x8'));var toCsv=require(_0x42ca('0x9'));var querystring=require('querystring');var Papa=require(_0x42ca('0xa'));var Redis=require(_0x42ca('0xb'));var authService=require(_0x42ca('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x42ca('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x42ca('0xe'))('api');var utils=require('../../config/utils');var config=require(_0x42ca('0xf'));var licenseUtil=require(_0x42ca('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a6f4a,_0x5d7c3d){_0x5d7c3d=_0x5d7c3d||0xcc;return function(_0x5f155a){if(_0x5f155a){return _0x5a6f4a[_0x42ca('0x11')](_0x5d7c3d);}return _0x5a6f4a['status'](_0x5d7c3d)[_0x42ca('0x12')]();};}function respondWithResult(_0x2b3247,_0x53464e){_0x53464e=_0x53464e||0xc8;return function(_0x41e62a){if(_0x41e62a){return _0x2b3247[_0x42ca('0x13')](_0x53464e)[_0x42ca('0x14')](_0x41e62a);}};}function respondWithFilteredResult(_0x141234,_0x1be27a){return function(_0x24c232){if(_0x24c232){var _0x4918e4=typeof _0x1be27a[_0x42ca('0x15')]===_0x42ca('0x16')&&typeof _0x1be27a[_0x42ca('0x17')]==='undefined';var _0x486a40=_0x24c232['count'];var _0x4a291f=_0x4918e4?0x0:_0x1be27a['offset'];var _0x32d225=_0x4918e4?_0x24c232[_0x42ca('0x18')]:_0x1be27a['offset']+_0x1be27a['limit'];var _0x155ab3;if(_0x32d225>=_0x486a40){_0x32d225=_0x486a40;_0x155ab3=0xc8;}else{_0x155ab3=0xce;}_0x141234[_0x42ca('0x13')](_0x155ab3);return _0x141234[_0x42ca('0x19')](_0x42ca('0x1a'),_0x4a291f+'-'+_0x32d225+'/'+_0x486a40)[_0x42ca('0x14')](_0x24c232);}return null;};}function patchUpdates(_0x1d1a3b){return function(_0x544082){try{jsonpatch[_0x42ca('0x1b')](_0x544082,_0x1d1a3b,!![]);}catch(_0x2cd695){return BPromise[_0x42ca('0x1c')](_0x2cd695);}return _0x544082[_0x42ca('0x1d')]();};}function saveUpdates(_0xf94df3,_0x27ea49){return function(_0x1e13cc){if(_0x1e13cc){return _0x1e13cc[_0x42ca('0x1e')](_0xf94df3)[_0x42ca('0x1f')](function(_0x374fbe){return _0x374fbe;});}return null;};}function removeEntity(_0x2617ef,_0x5438a7){return function(_0x5da304){if(_0x5da304){return _0x5da304['destroy']()['then'](function(){_0x2617ef[_0x42ca('0x13')](0xcc)[_0x42ca('0x12')]();});}};}function handleEntityNotFound(_0x27575f,_0x2890c3){return function(_0x4c7445){if(!_0x4c7445){_0x27575f[_0x42ca('0x11')](0x194);}return _0x4c7445;};}function handleError(_0x23f428,_0x4b3396){_0x4b3396=_0x4b3396||0x1f4;return function(_0xa0c31a){logger['error'](_0xa0c31a['stack']);if(_0xa0c31a[_0x42ca('0x20')]){delete _0xa0c31a[_0x42ca('0x20')];}_0x23f428['status'](_0x4b3396)['send'](_0xa0c31a);};}exports[_0x42ca('0x21')]=function(_0x123e81,_0xb2c2e7){var _0x3bede8={},_0x58fca8={},_0x16186d={'count':0x0,'rows':[]};var _0x204abb=_[_0x42ca('0x22')](db[_0x42ca('0x23')]['rawAttributes'],function(_0x50f72f){return{'name':_0x50f72f['fieldName'],'type':_0x50f72f['type'][_0x42ca('0x24')]};});_0x58fca8[_0x42ca('0x25')]=_[_0x42ca('0x22')](_0x204abb,_0x42ca('0x20'));_0x58fca8[_0x42ca('0x26')]=_[_0x42ca('0x27')](_0x123e81[_0x42ca('0x26')]);_0x58fca8[_0x42ca('0x28')]=_['intersection'](_0x58fca8[_0x42ca('0x25')],_0x58fca8[_0x42ca('0x26')]);_0x3bede8[_0x42ca('0x29')]=_['intersection'](_0x58fca8[_0x42ca('0x25')],qs[_0x42ca('0x2a')](_0x123e81['query']['fields']));_0x3bede8[_0x42ca('0x29')]=_0x3bede8[_0x42ca('0x29')][_0x42ca('0x2b')]?_0x3bede8[_0x42ca('0x29')]:_0x58fca8[_0x42ca('0x25')];if(!_0x123e81[_0x42ca('0x26')]['hasOwnProperty'](_0x42ca('0x2c'))){_0x3bede8['limit']=qs[_0x42ca('0x17')](_0x123e81[_0x42ca('0x26')][_0x42ca('0x17')]);_0x3bede8['offset']=qs[_0x42ca('0x15')](_0x123e81[_0x42ca('0x26')][_0x42ca('0x15')]);}_0x3bede8[_0x42ca('0x2d')]=qs['sort'](_0x123e81[_0x42ca('0x26')][_0x42ca('0x2e')]);_0x3bede8['where']=qs[_0x42ca('0x28')](_[_0x42ca('0x2f')](_0x123e81[_0x42ca('0x26')],_0x58fca8[_0x42ca('0x28')]),_0x204abb);if(_0x123e81['query'][_0x42ca('0x30')]){_0x3bede8['where']=_[_0x42ca('0x31')](_0x3bede8[_0x42ca('0x32')],{'$or':_[_0x42ca('0x22')](_0x204abb,function(_0x27c2ae){if(_0x27c2ae[_0x42ca('0x33')]!=='VIRTUAL'){var _0x227b40={};_0x227b40[_0x27c2ae['name']]={'$like':'%'+_0x123e81['query']['filter']+'%'};return _0x227b40;}})});}_0x3bede8=_[_0x42ca('0x31')]({},_0x3bede8,_0x123e81[_0x42ca('0x34')]);var _0x3020d4={'where':_0x3bede8['where']};return db[_0x42ca('0x23')][_0x42ca('0x18')](_0x3020d4)[_0x42ca('0x1f')](function(_0x4f9f98){_0x16186d[_0x42ca('0x18')]=_0x4f9f98;if(_0x123e81[_0x42ca('0x26')][_0x42ca('0x35')]){_0x3bede8[_0x42ca('0x36')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x42ca('0x37')](_0x3bede8);})['then'](function(_0x2bc1db){_0x16186d[_0x42ca('0x38')]=_0x2bc1db;return _0x16186d;})['then'](respondWithFilteredResult(_0xb2c2e7,_0x3bede8))[_0x42ca('0x39')](handleError(_0xb2c2e7,null));};exports[_0x42ca('0x3a')]=function(_0xd2f19,_0x40a485){var _0x27f61b={'raw':!![],'where':{'id':_0xd2f19[_0x42ca('0x3b')]['id']}},_0x4150de={};_0x4150de[_0x42ca('0x25')]=_[_0x42ca('0x27')](db[_0x42ca('0x23')][_0x42ca('0x3c')]);_0x4150de[_0x42ca('0x26')]=_['keys'](_0xd2f19['query']);_0x4150de[_0x42ca('0x28')]=_['intersection'](_0x4150de[_0x42ca('0x25')],_0x4150de[_0x42ca('0x26')]);_0x27f61b[_0x42ca('0x29')]=_[_0x42ca('0x3d')](_0x4150de[_0x42ca('0x25')],qs['fields'](_0xd2f19['query']['fields']));_0x27f61b['attributes']=_0x27f61b[_0x42ca('0x29')][_0x42ca('0x2b')]?_0x27f61b[_0x42ca('0x29')]:_0x4150de['model'];if(_0xd2f19['query'][_0x42ca('0x35')]){_0x27f61b[_0x42ca('0x36')]=[{'all':!![]}];}_0x27f61b=_[_0x42ca('0x31')]({},_0x27f61b,_0xd2f19['options']);return db['OpenchannelQueueReport']['find'](_0x27f61b)['then'](handleEntityNotFound(_0x40a485,null))['then'](respondWithResult(_0x40a485,null))[_0x42ca('0x39')](handleError(_0x40a485,null));};exports[_0x42ca('0x3e')]=function(_0x4e4139,_0x164072){return db['OpenchannelQueueReport'][_0x42ca('0x3e')](_0x4e4139[_0x42ca('0x3f')],{})[_0x42ca('0x1f')](respondWithResult(_0x164072,0xc9))[_0x42ca('0x39')](handleError(_0x164072,null));};exports[_0x42ca('0x1e')]=function(_0x342f20,_0x354465){if(_0x342f20['body']['id']){delete _0x342f20[_0x42ca('0x3f')]['id'];}return db[_0x42ca('0x23')][_0x42ca('0x40')]({'where':{'id':_0x342f20[_0x42ca('0x3b')]['id']}})[_0x42ca('0x1f')](handleEntityNotFound(_0x354465,null))[_0x42ca('0x1f')](saveUpdates(_0x342f20[_0x42ca('0x3f')],null))[_0x42ca('0x1f')](respondWithResult(_0x354465,null))['catch'](handleError(_0x354465,null));};exports['destroy']=function(_0x265b9b,_0x49da05){return db[_0x42ca('0x23')][_0x42ca('0x40')]({'where':{'id':_0x265b9b['params']['id']}})[_0x42ca('0x1f')](handleEntityNotFound(_0x49da05,null))[_0x42ca('0x1f')](removeEntity(_0x49da05,null))[_0x42ca('0x39')](handleError(_0x49da05,null));};exports[_0x42ca('0x41')]=function(_0x48ef11,_0x461e26){return db[_0x42ca('0x23')][_0x42ca('0x41')]()[_0x42ca('0x1f')](respondWithResult(_0x461e26,null))[_0x42ca('0x39')](handleError(_0x461e26,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index f24cd18..6a4e570 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x2f4621,_0x2e320b){var _0x162716=function(_0xd5160b){while(--_0xd5160b){_0x2f4621['push'](_0x2f4621['shift']());}};_0x162716(++_0x2e320b);}(_0x1261,0x144));var _0x1126=function(_0x1966f3,_0x210ea3){_0x1966f3=_0x1966f3-0x0;var _0x17575f=_0x1261[_0x1966f3];return _0x17575f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x1fb21c,_0x2e58c8){var _0x338832=function(_0x5420a9){while(--_0x5420a9){_0x1fb21c['push'](_0x1fb21c['shift']());}};_0x338832(++_0x2e58c8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 25cd05c..4c40eb7 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 _0x7fce=['options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','limit','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','client','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','create','body'];(function(_0x53faa3,_0x791da2){var _0x2b3ae8=function(_0x27f6e5){while(--_0x27f6e5){_0x53faa3['push'](_0x53faa3['shift']());}};_0x2b3ae8(++_0x791da2);}(_0x7fce,0xdc));var _0xe7fc=function(_0x3c24d3,_0x4d8806){_0x3c24d3=_0x3c24d3-0x0;var _0x4c3956=_0x7fce[_0x3c24d3];return _0x4c3956;};'use strict';var _=require(_0xe7fc('0x0'));var util=require(_0xe7fc('0x1'));var moment=require(_0xe7fc('0x2'));var BPromise=require('bluebird');var rs=require(_0xe7fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7fc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7fc('0x5'))(_0xe7fc('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe7fc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4665f6,_0x161dca,_0x296b2e){return new BPromise(function(_0x19eeef,_0x22fabf){return client['request'](_0x4665f6,_0x296b2e)[_0xe7fc('0x8')](function(_0x4a1209){logger[_0xe7fc('0x9')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x161dca,_0xe7fc('0xa'));logger[_0xe7fc('0xb')](_0xe7fc('0xc'),_0x161dca,_0xe7fc('0xa'),JSON['stringify'](_0x4a1209));if(_0x4a1209[_0xe7fc('0xd')]){if(_0x4a1209[_0xe7fc('0xd')]['code']===0x1f4){logger['error'](_0xe7fc('0xe'),_0x161dca,_0x4a1209['error'][_0xe7fc('0xf')]);return _0x22fabf(_0x4a1209['error']['message']);}logger[_0xe7fc('0xd')](_0xe7fc('0xe'),_0x161dca,_0x4a1209[_0xe7fc('0xd')][_0xe7fc('0xf')]);return _0x19eeef(_0x4a1209[_0xe7fc('0xd')]['message']);}else{logger[_0xe7fc('0x9')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x161dca,'request\x20sent');_0x19eeef(_0x4a1209[_0xe7fc('0x10')][_0xe7fc('0xf')]);}})[_0xe7fc('0x11')](function(_0x3a44a6){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x161dca,_0x3a44a6);_0x22fabf(_0x3a44a6);});});}exports['CreateOpenchannelQueueReport']=function(_0x4aa4f0){var _0x52902f=this;return new Promise(function(_0x490a99,_0x14515d){return db['OpenchannelQueueReport'][_0xe7fc('0x12')](_0x4aa4f0[_0xe7fc('0x13')],{'raw':_0x4aa4f0[_0xe7fc('0x14')]?_0x4aa4f0[_0xe7fc('0x14')][_0xe7fc('0x15')]===undefined?!![]:![]:!![]})[_0xe7fc('0x8')](function(_0x329051){logger[_0xe7fc('0x9')]('CreateOpenchannelQueueReport',_0x4aa4f0);logger[_0xe7fc('0xb')](_0xe7fc('0x16'),_0x4aa4f0,JSON['stringify'](_0x329051));_0x490a99(_0x329051);})['catch'](function(_0x35bb53){logger[_0xe7fc('0xd')](_0xe7fc('0x16'),_0x35bb53[_0xe7fc('0xf')],_0x4aa4f0);_0x14515d(_0x52902f[_0xe7fc('0xd')](0x1f4,_0x35bb53[_0xe7fc('0xf')]));});});};exports[_0xe7fc('0x17')]=function(_0x1731b6){var _0xb00cb9=this;return new Promise(function(_0x3e7e7e,_0x1d1348){return db[_0xe7fc('0x18')][_0xe7fc('0x19')](_0x1731b6['body'],{'raw':_0x1731b6[_0xe7fc('0x14')]?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1731b6[_0xe7fc('0x14')]?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x1a')]||null:null,'attributes':_0x1731b6['options']?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x1b')]||null:null,'limit':_0x1731b6[_0xe7fc('0x14')]?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x1c')]||null:null})[_0xe7fc('0x8')](function(_0x383ca6){logger['info'](_0xe7fc('0x17'),_0x1731b6);logger[_0xe7fc('0xb')]('UpdateOpenchannelQueueReport',_0x1731b6,JSON[_0xe7fc('0x1d')](_0x383ca6));_0x3e7e7e(_0x383ca6);})['catch'](function(_0x39d908){logger[_0xe7fc('0xd')]('UpdateOpenchannelQueueReport',_0x39d908[_0xe7fc('0xf')],_0x1731b6);_0x1d1348(_0xb00cb9['error'](0x1f4,_0x39d908[_0xe7fc('0xf')]));});});}; \ No newline at end of file +var _0x01d3=['attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','catch','CreateOpenchannelQueueReport','create','body','options','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where'];(function(_0x2602de,_0x1a5ad8){var _0xa156d3=function(_0x5c328d){while(--_0x5c328d){_0x2602de['push'](_0x2602de['shift']());}};_0xa156d3(++_0x1a5ad8);}(_0x01d3,0xa2));var _0x301d=function(_0x3a7bde,_0x46df2a){_0x3a7bde=_0x3a7bde-0x0;var _0x19cf48=_0x01d3[_0x3a7bde];return _0x19cf48;};'use strict';var _=require(_0x301d('0x0'));var util=require(_0x301d('0x1'));var moment=require(_0x301d('0x2'));var BPromise=require(_0x301d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x301d('0x4'));var db=require(_0x301d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x301d('0x6'))(_0x301d('0x7'));var config=require(_0x301d('0x8'));var jayson=require(_0x301d('0x9'));var client=jayson['client'][_0x301d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d8fc2,_0xe2b2d8,_0x3bbbde){return new BPromise(function(_0x35e760,_0x3ba019){return client[_0x301d('0xb')](_0x2d8fc2,_0x3bbbde)[_0x301d('0xc')](function(_0x35ae14){logger[_0x301d('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe2b2d8,_0x301d('0xe'));logger[_0x301d('0xf')](_0x301d('0x10'),_0xe2b2d8,'request\x20sent',JSON[_0x301d('0x11')](_0x35ae14));if(_0x35ae14[_0x301d('0x12')]){if(_0x35ae14['error']['code']===0x1f4){logger['error'](_0x301d('0x13'),_0xe2b2d8,_0x35ae14[_0x301d('0x12')][_0x301d('0x14')]);return _0x3ba019(_0x35ae14[_0x301d('0x12')][_0x301d('0x14')]);}logger[_0x301d('0x12')](_0x301d('0x13'),_0xe2b2d8,_0x35ae14['error']['message']);return _0x35e760(_0x35ae14[_0x301d('0x12')][_0x301d('0x14')]);}else{logger[_0x301d('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe2b2d8,'request\x20sent');_0x35e760(_0x35ae14['result']['message']);}})[_0x301d('0x15')](function(_0x3deffb){logger[_0x301d('0x12')](_0x301d('0x13'),_0xe2b2d8,_0x3deffb);_0x3ba019(_0x3deffb);});});}exports[_0x301d('0x16')]=function(_0x39e505){var _0x4c36a6=this;return new Promise(function(_0x40a9ed,_0x4ed038){return db['OpenchannelQueueReport'][_0x301d('0x17')](_0x39e505[_0x301d('0x18')],{'raw':_0x39e505['options']?_0x39e505[_0x301d('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x301d('0xc')](function(_0x3f300c){logger[_0x301d('0xd')]('CreateOpenchannelQueueReport',_0x39e505);logger[_0x301d('0xf')]('CreateOpenchannelQueueReport',_0x39e505,JSON[_0x301d('0x11')](_0x3f300c));_0x40a9ed(_0x3f300c);})[_0x301d('0x15')](function(_0x24b6fc){logger['error'](_0x301d('0x16'),_0x24b6fc[_0x301d('0x14')],_0x39e505);_0x4ed038(_0x4c36a6[_0x301d('0x12')](0x1f4,_0x24b6fc[_0x301d('0x14')]));});});};exports[_0x301d('0x1a')]=function(_0x1d8d00){var _0x36f26a=this;return new Promise(function(_0x52e758,_0x2f3b71){return db[_0x301d('0x1b')][_0x301d('0x1c')](_0x1d8d00['body'],{'raw':_0x1d8d00[_0x301d('0x19')]?_0x1d8d00[_0x301d('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d8d00[_0x301d('0x19')]?_0x1d8d00['options'][_0x301d('0x1d')]||null:null,'attributes':_0x1d8d00[_0x301d('0x19')]?_0x1d8d00['options'][_0x301d('0x1e')]||null:null,'limit':_0x1d8d00['options']?_0x1d8d00['options'][_0x301d('0x1f')]||null:null})[_0x301d('0xc')](function(_0x2a6652){logger['info'](_0x301d('0x1a'),_0x1d8d00);logger['debug']('UpdateOpenchannelQueueReport',_0x1d8d00,JSON['stringify'](_0x2a6652));_0x52e758(_0x2a6652);})[_0x301d('0x15')](function(_0x54e9a1){logger[_0x301d('0x12')](_0x301d('0x1a'),_0x54e9a1[_0x301d('0x14')],_0x1d8d00);_0x2f3b71(_0x36f26a[_0x301d('0x12')](0x1f4,_0x54e9a1[_0x301d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 8f6aeec..b1979a2 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 _0x6a64=['get','/describe','show','post','create','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index'];(function(_0xea17a7,_0x3f7d93){var _0x247ed5=function(_0x54e1be){while(--_0x54e1be){_0xea17a7['push'](_0xea17a7['shift']());}};_0x247ed5(++_0x3f7d93);}(_0x6a64,0x144));var _0x46a6=function(_0x78826,_0x3ae9b2){_0x78826=_0x78826-0x0;var _0x4403a9=_0x6a64[_0x78826];return _0x4403a9;};'use strict';var multer=require('multer');var util=require(_0x46a6('0x0'));var path=require(_0x46a6('0x1'));var timeout=require(_0x46a6('0x2'));var express=require(_0x46a6('0x3'));var router=express[_0x46a6('0x4')]();var fs_extra=require(_0x46a6('0x5'));var auth=require(_0x46a6('0x6'));var interaction=require(_0x46a6('0x7'));var config=require(_0x46a6('0x8'));var controller=require(_0x46a6('0x9'));router['get']('/',auth[_0x46a6('0xa')](),controller[_0x46a6('0xb')]);router[_0x46a6('0xc')](_0x46a6('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x46a6('0xc')]('/:id',auth[_0x46a6('0xa')](),controller[_0x46a6('0xe')]);router[_0x46a6('0xf')]('/',auth['isAuthenticated'](),controller[_0x46a6('0x10')]);router['put'](_0x46a6('0x11'),auth[_0x46a6('0xa')](),controller[_0x46a6('0x12')]);router[_0x46a6('0x13')](_0x46a6('0x11'),auth[_0x46a6('0xa')](),controller['destroy']);module[_0x46a6('0x14')]=router; \ No newline at end of file +var _0x67e5=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x33afbb,_0x10210c){var _0x1ebf44=function(_0x4a05e){while(--_0x4a05e){_0x33afbb['push'](_0x33afbb['shift']());}};_0x1ebf44(++_0x10210c);}(_0x67e5,0xed));var _0x567e=function(_0x420ce3,_0x5a37ef){_0x420ce3=_0x420ce3-0x0;var _0x129c8e=_0x67e5[_0x420ce3];return _0x129c8e;};'use strict';var multer=require(_0x567e('0x0'));var util=require(_0x567e('0x1'));var path=require('path');var timeout=require(_0x567e('0x2'));var express=require(_0x567e('0x3'));var router=express[_0x567e('0x4')]();var fs_extra=require(_0x567e('0x5'));var auth=require(_0x567e('0x6'));var interaction=require(_0x567e('0x7'));var config=require(_0x567e('0x8'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0x567e('0x9')](),controller[_0x567e('0xa')]);router[_0x567e('0xb')](_0x567e('0xc'),auth[_0x567e('0x9')](),controller[_0x567e('0xd')]);router[_0x567e('0xb')](_0x567e('0xe'),auth[_0x567e('0x9')](),controller[_0x567e('0xf')]);router[_0x567e('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x567e('0x11')](_0x567e('0xe'),auth['isAuthenticated'](),controller[_0x567e('0x12')]);router[_0x567e('0x13')](_0x567e('0xe'),auth[_0x567e('0x9')](),controller[_0x567e('0x14')]);module[_0x567e('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 9066919..f3b7c0f 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x13639d,_0x3c996b){var _0x52ef14=function(_0x3faf51){while(--_0x3faf51){_0x13639d['push'](_0x13639d['shift']());}};_0x52ef14(++_0x3c996b);}(_0x34e8,0x12c));var _0x834e=function(_0x34b36b,_0x6b057b){_0x34b36b=_0x34b36b-0x0;var _0x495325=_0x34e8[_0x34b36b];return _0x495325;};'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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1e43da,_0x408808){var _0x59f996=function(_0x54736f){while(--_0x54736f){_0x1e43da['push'](_0x1e43da['shift']());}};_0x59f996(++_0x408808);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ed054,_0x4d4f16){_0x3ed054=_0x3ed054-0x0;var _0x16dd95=_0xcb91[_0x3ed054];return _0x16dd95;};'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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index d7e0536..af292ea 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 _0x8c73=['options','findAll','rows','show','params','rawAttributes','intersection','length','includeAll','include','merge','find','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','OpenchannelTransferReport','fieldName','model','map','query','keys','filters','attributes','fields','limit','sort','where','pick','filter','VIRTUAL'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x8c73,0xde));var _0x38c7=function(_0x267beb,_0x10ddd9){_0x267beb=_0x267beb-0x0;var _0x248765=_0x8c73[_0x267beb];return _0x248765;};'use strict';var emlformat=require(_0x38c7('0x0'));var rimraf=require(_0x38c7('0x1'));var zipdir=require(_0x38c7('0x2'));var jsonpatch=require(_0x38c7('0x3'));var rp=require(_0x38c7('0x4'));var moment=require(_0x38c7('0x5'));var BPromise=require(_0x38c7('0x6'));var Mustache=require(_0x38c7('0x7'));var util=require('util');var path=require(_0x38c7('0x8'));var sox=require(_0x38c7('0x9'));var csv=require(_0x38c7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x38c7('0xb'));var crypto=require(_0x38c7('0xc'));var jsforce=require(_0x38c7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x38c7('0xa'));var querystring=require('querystring');var Papa=require(_0x38c7('0xe'));var Redis=require('ioredis');var authService=require(_0x38c7('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38c7('0x10'));var logger=require(_0x38c7('0x11'))(_0x38c7('0x12'));var utils=require('../../config/utils');var config=require(_0x38c7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x38c7('0x14'))['db'];function respondWithStatusCode(_0x41cff4,_0x393a2c){_0x393a2c=_0x393a2c||0xcc;return function(_0x381923){if(_0x381923){return _0x41cff4[_0x38c7('0x15')](_0x393a2c);}return _0x41cff4[_0x38c7('0x16')](_0x393a2c)[_0x38c7('0x17')]();};}function respondWithResult(_0x45ed5f,_0x235bdf){_0x235bdf=_0x235bdf||0xc8;return function(_0x1806e7){if(_0x1806e7){return _0x45ed5f[_0x38c7('0x16')](_0x235bdf)[_0x38c7('0x18')](_0x1806e7);}};}function respondWithFilteredResult(_0x209306,_0x1dc9da){return function(_0x14c57b){if(_0x14c57b){var _0x245077=typeof _0x1dc9da['offset']===_0x38c7('0x19')&&typeof _0x1dc9da['limit']==='undefined';var _0x827f4f=_0x14c57b[_0x38c7('0x1a')];var _0x478b45=_0x245077?0x0:_0x1dc9da['offset'];var _0x587b7a=_0x245077?_0x14c57b[_0x38c7('0x1a')]:_0x1dc9da[_0x38c7('0x1b')]+_0x1dc9da['limit'];var _0x161a40;if(_0x587b7a>=_0x827f4f){_0x587b7a=_0x827f4f;_0x161a40=0xc8;}else{_0x161a40=0xce;}_0x209306[_0x38c7('0x16')](_0x161a40);return _0x209306[_0x38c7('0x1c')]('Content-Range',_0x478b45+'-'+_0x587b7a+'/'+_0x827f4f)['json'](_0x14c57b);}return null;};}function patchUpdates(_0x2b6331){return function(_0x2b9089){try{jsonpatch[_0x38c7('0x1d')](_0x2b9089,_0x2b6331,!![]);}catch(_0x5dc7e5){return BPromise[_0x38c7('0x1e')](_0x5dc7e5);}return _0x2b9089[_0x38c7('0x1f')]();};}function saveUpdates(_0x297c6f,_0x2f3447){return function(_0x568602){if(_0x568602){return _0x568602[_0x38c7('0x20')](_0x297c6f)[_0x38c7('0x21')](function(_0x1e0473){return _0x1e0473;});}return null;};}function removeEntity(_0x188d00,_0x2b3ea6){return function(_0x15e960){if(_0x15e960){return _0x15e960[_0x38c7('0x22')]()[_0x38c7('0x21')](function(){_0x188d00['status'](0xcc)[_0x38c7('0x17')]();});}};}function handleEntityNotFound(_0x154a69,_0x4c6312){return function(_0x2b4221){if(!_0x2b4221){_0x154a69[_0x38c7('0x15')](0x194);}return _0x2b4221;};}function handleError(_0x1f1065,_0x1540da){_0x1540da=_0x1540da||0x1f4;return function(_0x2c4fb2){logger[_0x38c7('0x23')](_0x2c4fb2[_0x38c7('0x24')]);if(_0x2c4fb2[_0x38c7('0x25')]){delete _0x2c4fb2['name'];}_0x1f1065[_0x38c7('0x16')](_0x1540da)[_0x38c7('0x26')](_0x2c4fb2);};}exports['index']=function(_0x56a26e,_0x386a74){var _0x2815c6={},_0x4808d6={},_0x2afdcd={'count':0x0,'rows':[]};var _0x5d4f6b=_['map'](db[_0x38c7('0x27')]['rawAttributes'],function(_0x4cbd28){return{'name':_0x4cbd28[_0x38c7('0x28')],'type':_0x4cbd28['type']['key']};});_0x4808d6[_0x38c7('0x29')]=_[_0x38c7('0x2a')](_0x5d4f6b,'name');_0x4808d6[_0x38c7('0x2b')]=_[_0x38c7('0x2c')](_0x56a26e[_0x38c7('0x2b')]);_0x4808d6[_0x38c7('0x2d')]=_['intersection'](_0x4808d6[_0x38c7('0x29')],_0x4808d6[_0x38c7('0x2b')]);_0x2815c6[_0x38c7('0x2e')]=_['intersection'](_0x4808d6[_0x38c7('0x29')],qs[_0x38c7('0x2f')](_0x56a26e['query'][_0x38c7('0x2f')]));_0x2815c6[_0x38c7('0x2e')]=_0x2815c6[_0x38c7('0x2e')]['length']?_0x2815c6['attributes']:_0x4808d6['model'];if(!_0x56a26e[_0x38c7('0x2b')]['hasOwnProperty']('nolimit')){_0x2815c6['limit']=qs[_0x38c7('0x30')](_0x56a26e[_0x38c7('0x2b')][_0x38c7('0x30')]);_0x2815c6[_0x38c7('0x1b')]=qs['offset'](_0x56a26e[_0x38c7('0x2b')]['offset']);}_0x2815c6['order']=qs[_0x38c7('0x31')](_0x56a26e[_0x38c7('0x2b')][_0x38c7('0x31')]);_0x2815c6[_0x38c7('0x32')]=qs[_0x38c7('0x2d')](_[_0x38c7('0x33')](_0x56a26e[_0x38c7('0x2b')],_0x4808d6[_0x38c7('0x2d')]),_0x5d4f6b);if(_0x56a26e[_0x38c7('0x2b')][_0x38c7('0x34')]){_0x2815c6[_0x38c7('0x32')]=_['merge'](_0x2815c6['where'],{'$or':_[_0x38c7('0x2a')](_0x5d4f6b,function(_0x36fe93){if(_0x36fe93['type']!==_0x38c7('0x35')){var _0x502342={};_0x502342[_0x36fe93[_0x38c7('0x25')]]={'$like':'%'+_0x56a26e[_0x38c7('0x2b')][_0x38c7('0x34')]+'%'};return _0x502342;}})});}_0x2815c6=_['merge']({},_0x2815c6,_0x56a26e[_0x38c7('0x36')]);var _0x3ffedf={'where':_0x2815c6['where']};return db[_0x38c7('0x27')][_0x38c7('0x1a')](_0x3ffedf)['then'](function(_0x5d3614){_0x2afdcd[_0x38c7('0x1a')]=_0x5d3614;if(_0x56a26e['query']['includeAll']){_0x2815c6['include']=[{'all':!![]}];}return db[_0x38c7('0x27')][_0x38c7('0x37')](_0x2815c6);})['then'](function(_0x1efbbd){_0x2afdcd[_0x38c7('0x38')]=_0x1efbbd;return _0x2afdcd;})[_0x38c7('0x21')](respondWithFilteredResult(_0x386a74,_0x2815c6))['catch'](handleError(_0x386a74,null));};exports[_0x38c7('0x39')]=function(_0x1524d0,_0x8a5a31){var _0x1480d4={'raw':!![],'where':{'id':_0x1524d0[_0x38c7('0x3a')]['id']}},_0x3dd473={};_0x3dd473['model']=_[_0x38c7('0x2c')](db['OpenchannelTransferReport'][_0x38c7('0x3b')]);_0x3dd473[_0x38c7('0x2b')]=_[_0x38c7('0x2c')](_0x1524d0[_0x38c7('0x2b')]);_0x3dd473['filters']=_[_0x38c7('0x3c')](_0x3dd473[_0x38c7('0x29')],_0x3dd473[_0x38c7('0x2b')]);_0x1480d4[_0x38c7('0x2e')]=_[_0x38c7('0x3c')](_0x3dd473[_0x38c7('0x29')],qs[_0x38c7('0x2f')](_0x1524d0[_0x38c7('0x2b')][_0x38c7('0x2f')]));_0x1480d4[_0x38c7('0x2e')]=_0x1480d4[_0x38c7('0x2e')][_0x38c7('0x3d')]?_0x1480d4[_0x38c7('0x2e')]:_0x3dd473['model'];if(_0x1524d0['query'][_0x38c7('0x3e')]){_0x1480d4[_0x38c7('0x3f')]=[{'all':!![]}];}_0x1480d4=_[_0x38c7('0x40')]({},_0x1480d4,_0x1524d0['options']);return db['OpenchannelTransferReport'][_0x38c7('0x41')](_0x1480d4)[_0x38c7('0x21')](handleEntityNotFound(_0x8a5a31,null))[_0x38c7('0x21')](respondWithResult(_0x8a5a31,null))['catch'](handleError(_0x8a5a31,null));};exports['create']=function(_0xcadba0,_0x4a3cd2){return db[_0x38c7('0x27')]['create'](_0xcadba0[_0x38c7('0x42')],{})[_0x38c7('0x21')](respondWithResult(_0x4a3cd2,0xc9))['catch'](handleError(_0x4a3cd2,null));};exports[_0x38c7('0x20')]=function(_0x3bd114,_0x4b1d96){if(_0x3bd114[_0x38c7('0x42')]['id']){delete _0x3bd114[_0x38c7('0x42')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x3bd114[_0x38c7('0x3a')]['id']}})[_0x38c7('0x21')](handleEntityNotFound(_0x4b1d96,null))[_0x38c7('0x21')](saveUpdates(_0x3bd114[_0x38c7('0x42')],null))[_0x38c7('0x21')](respondWithResult(_0x4b1d96,null))[_0x38c7('0x43')](handleError(_0x4b1d96,null));};exports['destroy']=function(_0x561741,_0xfa1247){return db[_0x38c7('0x27')][_0x38c7('0x41')]({'where':{'id':_0x561741[_0x38c7('0x3a')]['id']}})['then'](handleEntityNotFound(_0xfa1247,null))[_0x38c7('0x21')](removeEntity(_0xfa1247,null))[_0x38c7('0x43')](handleError(_0xfa1247,null));};exports['describe']=function(_0x4cf5e4,_0x2cf908){return db[_0x38c7('0x27')][_0x38c7('0x44')]()[_0x38c7('0x21')](respondWithResult(_0x2cf908,null))['catch'](handleError(_0x2cf908,null));}; \ No newline at end of file +var _0x811a=['sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','OpenchannelTransferReport','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util'];(function(_0x14c945,_0x11d713){var _0x3ed9be=function(_0x9f4050){while(--_0x9f4050){_0x14c945['push'](_0x14c945['shift']());}};_0x3ed9be(++_0x11d713);}(_0x811a,0x15e));var _0xa811=function(_0x366ecb,_0xd8ee42){_0x366ecb=_0x366ecb-0x0;var _0x3a9f8e=_0x811a[_0x366ecb];return _0x3a9f8e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa811('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa811('0x1'));var moment=require('moment');var BPromise=require(_0xa811('0x2'));var Mustache=require(_0xa811('0x3'));var util=require(_0xa811('0x4'));var path=require('path');var sox=require(_0xa811('0x5'));var csv=require(_0xa811('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa811('0x7'));var _=require(_0xa811('0x8'));var squel=require(_0xa811('0x9'));var crypto=require('crypto');var jsforce=require(_0xa811('0xa'));var deskjs=require(_0xa811('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa811('0xc'));var Papa=require(_0xa811('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa811('0xe'));var as=require(_0xa811('0xf'));var hardwareService=require(_0xa811('0x10'));var logger=require('../../config/logger')(_0xa811('0x11'));var utils=require('../../config/utils');var config=require(_0xa811('0x12'));var licenseUtil=require(_0xa811('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d09cc,_0x25429e){_0x25429e=_0x25429e||0xcc;return function(_0x3b7be8){if(_0x3b7be8){return _0x3d09cc[_0xa811('0x14')](_0x25429e);}return _0x3d09cc[_0xa811('0x15')](_0x25429e)[_0xa811('0x16')]();};}function respondWithResult(_0x60c550,_0x53ebef){_0x53ebef=_0x53ebef||0xc8;return function(_0x37ac41){if(_0x37ac41){return _0x60c550['status'](_0x53ebef)[_0xa811('0x17')](_0x37ac41);}};}function respondWithFilteredResult(_0x28b9bf,_0xe8e4ff){return function(_0x3154c6){if(_0x3154c6){var _0x14a361=typeof _0xe8e4ff['offset']==='undefined'&&typeof _0xe8e4ff['limit']===_0xa811('0x18');var _0x403dde=_0x3154c6[_0xa811('0x19')];var _0x371bfb=_0x14a361?0x0:_0xe8e4ff[_0xa811('0x1a')];var _0x5eb55a=_0x14a361?_0x3154c6['count']:_0xe8e4ff[_0xa811('0x1a')]+_0xe8e4ff[_0xa811('0x1b')];var _0xaf9601;if(_0x5eb55a>=_0x403dde){_0x5eb55a=_0x403dde;_0xaf9601=0xc8;}else{_0xaf9601=0xce;}_0x28b9bf[_0xa811('0x15')](_0xaf9601);return _0x28b9bf[_0xa811('0x1c')]('Content-Range',_0x371bfb+'-'+_0x5eb55a+'/'+_0x403dde)[_0xa811('0x17')](_0x3154c6);}return null;};}function patchUpdates(_0x4b0017){return function(_0xe2001d){try{jsonpatch['apply'](_0xe2001d,_0x4b0017,!![]);}catch(_0x3766b3){return BPromise[_0xa811('0x1d')](_0x3766b3);}return _0xe2001d[_0xa811('0x1e')]();};}function saveUpdates(_0x4f9965,_0x454167){return function(_0x57bf64){if(_0x57bf64){return _0x57bf64[_0xa811('0x1f')](_0x4f9965)[_0xa811('0x20')](function(_0x4d07ba){return _0x4d07ba;});}return null;};}function removeEntity(_0x3ad135,_0x2eec40){return function(_0x32c331){if(_0x32c331){return _0x32c331[_0xa811('0x21')]()[_0xa811('0x20')](function(){_0x3ad135[_0xa811('0x15')](0xcc)[_0xa811('0x16')]();});}};}function handleEntityNotFound(_0x224a66,_0x4d7f77){return function(_0x17acb0){if(!_0x17acb0){_0x224a66[_0xa811('0x14')](0x194);}return _0x17acb0;};}function handleError(_0x21b39e,_0x177bf1){_0x177bf1=_0x177bf1||0x1f4;return function(_0x303e8b){logger[_0xa811('0x22')](_0x303e8b[_0xa811('0x23')]);if(_0x303e8b['name']){delete _0x303e8b[_0xa811('0x24')];}_0x21b39e[_0xa811('0x15')](_0x177bf1)[_0xa811('0x25')](_0x303e8b);};}exports[_0xa811('0x26')]=function(_0x17c8b7,_0xec2f8a){var _0x1e9fac={},_0x43d90a={},_0x19a0f3={'count':0x0,'rows':[]};var _0x50f590=_[_0xa811('0x27')](db['OpenchannelTransferReport'][_0xa811('0x28')],function(_0x4d2373){return{'name':_0x4d2373[_0xa811('0x29')],'type':_0x4d2373[_0xa811('0x2a')][_0xa811('0x2b')]};});_0x43d90a[_0xa811('0x2c')]=_[_0xa811('0x27')](_0x50f590,'name');_0x43d90a[_0xa811('0x2d')]=_[_0xa811('0x2e')](_0x17c8b7[_0xa811('0x2d')]);_0x43d90a[_0xa811('0x2f')]=_['intersection'](_0x43d90a[_0xa811('0x2c')],_0x43d90a[_0xa811('0x2d')]);_0x1e9fac[_0xa811('0x30')]=_[_0xa811('0x31')](_0x43d90a['model'],qs[_0xa811('0x32')](_0x17c8b7[_0xa811('0x2d')][_0xa811('0x32')]));_0x1e9fac['attributes']=_0x1e9fac['attributes'][_0xa811('0x33')]?_0x1e9fac['attributes']:_0x43d90a[_0xa811('0x2c')];if(!_0x17c8b7['query'][_0xa811('0x34')](_0xa811('0x35'))){_0x1e9fac[_0xa811('0x1b')]=qs[_0xa811('0x1b')](_0x17c8b7['query'][_0xa811('0x1b')]);_0x1e9fac[_0xa811('0x1a')]=qs['offset'](_0x17c8b7[_0xa811('0x2d')][_0xa811('0x1a')]);}_0x1e9fac[_0xa811('0x36')]=qs[_0xa811('0x37')](_0x17c8b7[_0xa811('0x2d')]['sort']);_0x1e9fac[_0xa811('0x38')]=qs[_0xa811('0x2f')](_[_0xa811('0x39')](_0x17c8b7[_0xa811('0x2d')],_0x43d90a[_0xa811('0x2f')]),_0x50f590);if(_0x17c8b7[_0xa811('0x2d')][_0xa811('0x3a')]){_0x1e9fac['where']=_['merge'](_0x1e9fac[_0xa811('0x38')],{'$or':_[_0xa811('0x27')](_0x50f590,function(_0x4ec294){if(_0x4ec294['type']!==_0xa811('0x3b')){var _0x20fd8e={};_0x20fd8e[_0x4ec294[_0xa811('0x24')]]={'$like':'%'+_0x17c8b7[_0xa811('0x2d')][_0xa811('0x3a')]+'%'};return _0x20fd8e;}})});}_0x1e9fac=_[_0xa811('0x3c')]({},_0x1e9fac,_0x17c8b7[_0xa811('0x3d')]);var _0x3e571b={'where':_0x1e9fac['where']};return db[_0xa811('0x3e')][_0xa811('0x19')](_0x3e571b)[_0xa811('0x20')](function(_0x35c01b){_0x19a0f3[_0xa811('0x19')]=_0x35c01b;if(_0x17c8b7[_0xa811('0x2d')][_0xa811('0x3f')]){_0x1e9fac[_0xa811('0x40')]=[{'all':!![]}];}return db[_0xa811('0x3e')][_0xa811('0x41')](_0x1e9fac);})[_0xa811('0x20')](function(_0x60e175){_0x19a0f3[_0xa811('0x42')]=_0x60e175;return _0x19a0f3;})['then'](respondWithFilteredResult(_0xec2f8a,_0x1e9fac))[_0xa811('0x43')](handleError(_0xec2f8a,null));};exports[_0xa811('0x44')]=function(_0x14349d,_0x2fc3e7){var _0x4636b8={'raw':!![],'where':{'id':_0x14349d['params']['id']}},_0x48f39d={};_0x48f39d[_0xa811('0x2c')]=_[_0xa811('0x2e')](db['OpenchannelTransferReport'][_0xa811('0x28')]);_0x48f39d[_0xa811('0x2d')]=_[_0xa811('0x2e')](_0x14349d[_0xa811('0x2d')]);_0x48f39d[_0xa811('0x2f')]=_['intersection'](_0x48f39d[_0xa811('0x2c')],_0x48f39d[_0xa811('0x2d')]);_0x4636b8[_0xa811('0x30')]=_[_0xa811('0x31')](_0x48f39d[_0xa811('0x2c')],qs['fields'](_0x14349d['query']['fields']));_0x4636b8['attributes']=_0x4636b8[_0xa811('0x30')]['length']?_0x4636b8[_0xa811('0x30')]:_0x48f39d[_0xa811('0x2c')];if(_0x14349d[_0xa811('0x2d')][_0xa811('0x3f')]){_0x4636b8[_0xa811('0x40')]=[{'all':!![]}];}_0x4636b8=_[_0xa811('0x3c')]({},_0x4636b8,_0x14349d[_0xa811('0x3d')]);return db[_0xa811('0x3e')]['find'](_0x4636b8)['then'](handleEntityNotFound(_0x2fc3e7,null))['then'](respondWithResult(_0x2fc3e7,null))['catch'](handleError(_0x2fc3e7,null));};exports['create']=function(_0x4be0d1,_0x4bf02a){return db['OpenchannelTransferReport'][_0xa811('0x45')](_0x4be0d1[_0xa811('0x46')],{})[_0xa811('0x20')](respondWithResult(_0x4bf02a,0xc9))[_0xa811('0x43')](handleError(_0x4bf02a,null));};exports['update']=function(_0x2bf3dc,_0x53f498){if(_0x2bf3dc[_0xa811('0x46')]['id']){delete _0x2bf3dc[_0xa811('0x46')]['id'];}return db[_0xa811('0x3e')][_0xa811('0x47')]({'where':{'id':_0x2bf3dc[_0xa811('0x48')]['id']}})[_0xa811('0x20')](handleEntityNotFound(_0x53f498,null))[_0xa811('0x20')](saveUpdates(_0x2bf3dc[_0xa811('0x46')],null))[_0xa811('0x20')](respondWithResult(_0x53f498,null))[_0xa811('0x43')](handleError(_0x53f498,null));};exports[_0xa811('0x21')]=function(_0x4907e8,_0x31e46c){return db[_0xa811('0x3e')][_0xa811('0x47')]({'where':{'id':_0x4907e8[_0xa811('0x48')]['id']}})[_0xa811('0x20')](handleEntityNotFound(_0x31e46c,null))[_0xa811('0x20')](removeEntity(_0x31e46c,null))[_0xa811('0x43')](handleError(_0x31e46c,null));};exports[_0xa811('0x49')]=function(_0x10dc8a,_0x51c46a){return db['OpenchannelTransferReport'][_0xa811('0x49')]()[_0xa811('0x20')](respondWithResult(_0x51c46a,null))['catch'](handleError(_0x51c46a,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a234b9e..92e91bd 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 _0x0ea2=['define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x3a59e2,_0x502e43){var _0x226b63=function(_0x3f184b){while(--_0x3f184b){_0x3a59e2['push'](_0x3a59e2['shift']());}};_0x226b63(++_0x502e43);}(_0x0ea2,0x12e));var _0x20ea=function(_0x4fb721,_0x245cab){_0x4fb721=_0x4fb721-0x0;var _0x8e7738=_0x0ea2[_0x4fb721];return _0x8e7738;};'use strict';var _=require(_0x20ea('0x0'));var util=require(_0x20ea('0x1'));var logger=require(_0x20ea('0x2'))(_0x20ea('0x3'));var moment=require(_0x20ea('0x4'));var BPromise=require(_0x20ea('0x5'));var rp=require(_0x20ea('0x6'));var fs=require('fs');var path=require(_0x20ea('0x7'));var rimraf=require('rimraf');var config=require(_0x20ea('0x8'));var attributes=require('./openchannelTransferReport.attributes');module[_0x20ea('0x9')]=function(_0x1945e2,_0x2db861){return _0x1945e2[_0x20ea('0xa')]('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x20ea('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2316=['request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','bluebird'];(function(_0x2ee565,_0x1f9764){var _0x3cc64c=function(_0x24c406){while(--_0x24c406){_0x2ee565['push'](_0x2ee565['shift']());}};_0x3cc64c(++_0x1f9764);}(_0x2316,0xf8));var _0x6231=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x2316[_0x1abb09];return _0xea1c07;};'use strict';var _=require(_0x6231('0x0'));var util=require(_0x6231('0x1'));var logger=require(_0x6231('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6231('0x3'));var rp=require(_0x6231('0x4'));var fs=require('fs');var path=require(_0x6231('0x5'));var rimraf=require(_0x6231('0x6'));var config=require(_0x6231('0x7'));var attributes=require(_0x6231('0x8'));module['exports']=function(_0x10db94,_0x37501d){return _0x10db94['define'](_0x6231('0x9'),attributes,{'tableName':_0x6231('0xa'),'paranoid':![],'indexes':[{'name':_0x6231('0xb'),'fields':[_0x6231('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 1d95fc3..496a436 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 _0xd13e=['OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3235c2,_0x1db520){var _0x3b9041=function(_0x593926){while(--_0x593926){_0x3235c2['push'](_0x3235c2['shift']());}};_0x3b9041(++_0x1db520);}(_0xd13e,0x193));var _0xed13=function(_0x51d0ab,_0x4fc3b6){_0x51d0ab=_0x51d0ab-0x0;var _0x3cf2a8=_0xd13e[_0x51d0ab];return _0x3cf2a8;};'use strict';var _=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var moment=require(_0xed13('0x2'));var BPromise=require(_0xed13('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed13('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed13('0x5'));var logger=require('../../config/logger')(_0xed13('0x6'));var config=require(_0xed13('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x95ff4c,_0x134929,_0xab0fff){return new BPromise(function(_0x3b3984,_0x369798){return client[_0xed13('0x8')](_0x95ff4c,_0xab0fff)[_0xed13('0x9')](function(_0x9bc191){logger[_0xed13('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x134929,_0xed13('0xb'));logger[_0xed13('0xc')](_0xed13('0xd'),_0x134929,_0xed13('0xb'),JSON[_0xed13('0xe')](_0x9bc191));if(_0x9bc191['error']){if(_0x9bc191[_0xed13('0xf')][_0xed13('0x10')]===0x1f4){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x9bc191[_0xed13('0xf')][_0xed13('0x12')]);return _0x369798(_0x9bc191['error'][_0xed13('0x12')]);}logger['error'](_0xed13('0x11'),_0x134929,_0x9bc191['error'][_0xed13('0x12')]);return _0x3b3984(_0x9bc191['error'][_0xed13('0x12')]);}else{logger['info'](_0xed13('0x11'),_0x134929,_0xed13('0xb'));_0x3b3984(_0x9bc191[_0xed13('0x13')][_0xed13('0x12')]);}})[_0xed13('0x14')](function(_0x1f8585){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x1f8585);_0x369798(_0x1f8585);});});} \ No newline at end of file +var _0x425d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x58ef3d,_0x3dbf0d){var _0x5ad285=function(_0x1f5b7b){while(--_0x1f5b7b){_0x58ef3d['push'](_0x58ef3d['shift']());}};_0x5ad285(++_0x3dbf0d);}(_0x425d,0x1e0));var _0xd425=function(_0x4077df,_0x10621c){_0x4077df=_0x4077df-0x0;var _0x57aeff=_0x425d[_0x4077df];return _0x57aeff;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var moment=require(_0xd425('0x1'));var BPromise=require(_0xd425('0x2'));var rs=require(_0xd425('0x3'));var fs=require('fs');var Redis=require(_0xd425('0x4'));var db=require(_0xd425('0x5'))['db'];var utils=require(_0xd425('0x6'));var logger=require(_0xd425('0x7'))('rpc');var config=require(_0xd425('0x8'));var jayson=require(_0xd425('0x9'));var client=jayson[_0xd425('0xa')][_0xd425('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d97d9,_0x1d2ed0,_0x50b061){return new BPromise(function(_0xb6ba8e,_0x374c3d){return client[_0xd425('0xc')](_0x1d97d9,_0x50b061)[_0xd425('0xd')](function(_0x2db9da){logger[_0xd425('0xe')](_0xd425('0xf'),_0x1d2ed0,_0xd425('0x10'));logger[_0xd425('0x11')](_0xd425('0x12'),_0x1d2ed0,_0xd425('0x10'),JSON[_0xd425('0x13')](_0x2db9da));if(_0x2db9da[_0xd425('0x14')]){if(_0x2db9da[_0xd425('0x14')][_0xd425('0x15')]===0x1f4){logger[_0xd425('0x14')](_0xd425('0xf'),_0x1d2ed0,_0x2db9da[_0xd425('0x14')][_0xd425('0x16')]);return _0x374c3d(_0x2db9da[_0xd425('0x14')]['message']);}logger[_0xd425('0x14')](_0xd425('0xf'),_0x1d2ed0,_0x2db9da[_0xd425('0x14')]['message']);return _0xb6ba8e(_0x2db9da[_0xd425('0x14')][_0xd425('0x16')]);}else{logger[_0xd425('0xe')](_0xd425('0xf'),_0x1d2ed0,_0xd425('0x10'));_0xb6ba8e(_0x2db9da['result'][_0xd425('0x16')]);}})[_0xd425('0x17')](function(_0x7e267e){logger[_0xd425('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1d2ed0,_0x7e267e);_0x374c3d(_0x7e267e);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 393bb89..d18096f 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 _0xd72b=['show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./pause.controller','isAuthenticated','index','/:id'];(function(_0x21205e,_0x7eb8e7){var _0x136ebb=function(_0x54aac2){while(--_0x54aac2){_0x21205e['push'](_0x21205e['shift']());}};_0x136ebb(++_0x7eb8e7);}(_0xd72b,0x1ed));var _0xbd72=function(_0x1a0ff4,_0x1baf76){_0x1a0ff4=_0x1a0ff4-0x0;var _0x418132=_0xd72b[_0x1a0ff4];return _0x418132;};'use strict';var multer=require(_0xbd72('0x0'));var util=require(_0xbd72('0x1'));var path=require('path');var timeout=require(_0xbd72('0x2'));var express=require(_0xbd72('0x3'));var router=express[_0xbd72('0x4')]();var fs_extra=require(_0xbd72('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbd72('0x6'));var controller=require(_0xbd72('0x7'));router['get']('/',auth[_0xbd72('0x8')](),controller[_0xbd72('0x9')]);router['get'](_0xbd72('0xa'),auth['isAuthenticated'](),controller[_0xbd72('0xb')]);router[_0xbd72('0xc')]('/',auth[_0xbd72('0x8')](),controller[_0xbd72('0xd')]);router[_0xbd72('0xe')](_0xbd72('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xbd72('0xf')](_0xbd72('0xa'),auth[_0xbd72('0x8')](),controller[_0xbd72('0x10')]);module[_0xbd72('0x11')]=router; \ No newline at end of file +var _0x88f4=['/:id','show','post','create','put','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x5b417d,_0x54e02e){var _0x110d26=function(_0x14bdd4){while(--_0x14bdd4){_0x5b417d['push'](_0x5b417d['shift']());}};_0x110d26(++_0x54e02e);}(_0x88f4,0x17d));var _0x488f=function(_0xb737b5,_0x53acc0){_0xb737b5=_0xb737b5-0x0;var _0x14aa48=_0x88f4[_0xb737b5];return _0x14aa48;};'use strict';var multer=require(_0x488f('0x0'));var util=require(_0x488f('0x1'));var path=require(_0x488f('0x2'));var timeout=require('connect-timeout');var express=require(_0x488f('0x3'));var router=express[_0x488f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x488f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x488f('0x6'));var controller=require('./pause.controller');router[_0x488f('0x7')]('/',auth[_0x488f('0x8')](),controller[_0x488f('0x9')]);router[_0x488f('0x7')](_0x488f('0xa'),auth[_0x488f('0x8')](),controller[_0x488f('0xb')]);router[_0x488f('0xc')]('/',auth[_0x488f('0x8')](),controller[_0x488f('0xd')]);router[_0x488f('0xe')](_0x488f('0xa'),auth[_0x488f('0x8')](),controller['update']);router[_0x488f('0xf')]('/:id',auth[_0x488f('0x8')](),controller['destroy']);module[_0x488f('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 782bf19..921d24c 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 _0x21da=['sequelize','exports','name','STRING'];(function(_0x279cc3,_0xa71b8){var _0x443bf8=function(_0x50e0c8){while(--_0x50e0c8){_0x279cc3['push'](_0x279cc3['shift']());}};_0x443bf8(++_0xa71b8);}(_0x21da,0xc4));var _0xa21d=function(_0xaf0510,_0x16791d){_0xaf0510=_0xaf0510-0x0;var _0x12791d=_0x21da[_0xaf0510];return _0x12791d;};'use strict';var Sequelize=require(_0xa21d('0x0'));module[_0xa21d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa21d('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xa21d('0x3')]}}; \ No newline at end of file +var _0xe59b=['exports','STRING','sequelize'];(function(_0x2acbce,_0x2b48d3){var _0x1de0e0=function(_0x36ae0e){while(--_0x36ae0e){_0x2acbce['push'](_0x2acbce['shift']());}};_0x1de0e0(++_0x2b48d3);}(_0xe59b,0x101));var _0xbe59=function(_0x32f5ff,_0x2879ff){_0x32f5ff=_0x32f5ff-0x0;var _0x24df63=_0xe59b[_0x32f5ff];return _0x24df63;};'use strict';var Sequelize=require(_0xbe59('0x0'));module[_0xbe59('0x1')]={'name':{'type':Sequelize[_0xbe59('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xbe59('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index bb16b2a..72de6fc 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 _0x23cd=['nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','merge','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','get','Pauses','UserProfileResource','sendStatus','stack','name','index','map','Pause','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x49bedd,_0x291387){var _0x1f2535=function(_0x451450){while(--_0x451450){_0x49bedd['push'](_0x49bedd['shift']());}};_0x1f2535(++_0x291387);}(_0x23cd,0x160));var _0xd23c=function(_0x113cc2,_0x3d0e2a){_0x113cc2=_0x113cc2-0x0;var _0x55d73b=_0x23cd[_0x113cc2];return _0x55d73b;};'use strict';var emlformat=require(_0xd23c('0x0'));var rimraf=require(_0xd23c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd23c('0x2'));var rp=require(_0xd23c('0x3'));var moment=require(_0xd23c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd23c('0x5'));var util=require(_0xd23c('0x6'));var path=require(_0xd23c('0x7'));var sox=require(_0xd23c('0x8'));var csv=require('to-csv');var ejs=require(_0xd23c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd23c('0xa'));var squel=require(_0xd23c('0xb'));var crypto=require(_0xd23c('0xc'));var jsforce=require(_0xd23c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd23c('0xe'));var Papa=require(_0xd23c('0xf'));var Redis=require('ioredis');var authService=require(_0xd23c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd23c('0x11'))(_0xd23c('0x12'));var utils=require(_0xd23c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd23c('0x14'));var db=require(_0xd23c('0x15'))['db'];function respondWithStatusCode(_0xbe87c5,_0x527861){_0x527861=_0x527861||0xcc;return function(_0x5e52ff){if(_0x5e52ff){return _0xbe87c5['sendStatus'](_0x527861);}return _0xbe87c5[_0xd23c('0x16')](_0x527861)[_0xd23c('0x17')]();};}function respondWithResult(_0x4e689b,_0x4f2dfd){_0x4f2dfd=_0x4f2dfd||0xc8;return function(_0x4c07d5){if(_0x4c07d5){return _0x4e689b[_0xd23c('0x16')](_0x4f2dfd)[_0xd23c('0x18')](_0x4c07d5);}};}function respondWithFilteredResult(_0x3e58ed,_0x3a721b){return function(_0x22ef83){if(_0x22ef83){var _0x3ee44e=typeof _0x3a721b[_0xd23c('0x19')]===_0xd23c('0x1a')&&typeof _0x3a721b[_0xd23c('0x1b')]===_0xd23c('0x1a');var _0x336a06=_0x22ef83[_0xd23c('0x1c')];var _0x438f77=_0x3ee44e?0x0:_0x3a721b[_0xd23c('0x19')];var _0x49276f=_0x3ee44e?_0x22ef83[_0xd23c('0x1c')]:_0x3a721b[_0xd23c('0x19')]+_0x3a721b[_0xd23c('0x1b')];var _0xb90f02;if(_0x49276f>=_0x336a06){_0x49276f=_0x336a06;_0xb90f02=0xc8;}else{_0xb90f02=0xce;}_0x3e58ed['status'](_0xb90f02);return _0x3e58ed['set'](_0xd23c('0x1d'),_0x438f77+'-'+_0x49276f+'/'+_0x336a06)[_0xd23c('0x18')](_0x22ef83);}return null;};}function patchUpdates(_0x4360f1){return function(_0x43cf7c){try{jsonpatch[_0xd23c('0x1e')](_0x43cf7c,_0x4360f1,!![]);}catch(_0x3fc25d){return BPromise['reject'](_0x3fc25d);}return _0x43cf7c[_0xd23c('0x1f')]();};}function saveUpdates(_0x5f1131,_0x3d2dd8){return function(_0xf4891c){if(_0xf4891c){return _0xf4891c['update'](_0x5f1131)[_0xd23c('0x20')](function(_0x3f10c2){return _0x3f10c2;});}return null;};}function removeEntity(_0x3319c5,_0x2eb271){return function(_0x432af9){if(_0x432af9){return _0x432af9[_0xd23c('0x21')]()[_0xd23c('0x20')](function(){var _0x2a217e=_0x432af9[_0xd23c('0x22')]({'plain':!![]});var _0x1c7053=_0xd23c('0x23');return db[_0xd23c('0x24')][_0xd23c('0x21')]({'where':{'type':_0x1c7053,'resourceId':_0x2a217e['id']}})[_0xd23c('0x20')](function(){return _0x432af9;});})[_0xd23c('0x20')](function(){_0x3319c5['status'](0xcc)[_0xd23c('0x17')]();});}};}function handleEntityNotFound(_0x453cae,_0x49e002){return function(_0x5b51f0){if(!_0x5b51f0){_0x453cae[_0xd23c('0x25')](0x194);}return _0x5b51f0;};}function handleError(_0x19be62,_0x596258){_0x596258=_0x596258||0x1f4;return function(_0x28831a){logger['error'](_0x28831a[_0xd23c('0x26')]);if(_0x28831a[_0xd23c('0x27')]){delete _0x28831a[_0xd23c('0x27')];}_0x19be62[_0xd23c('0x16')](_0x596258)['send'](_0x28831a);};}exports[_0xd23c('0x28')]=function(_0x2c8ed0,_0x2e05fa){var _0x910197={},_0x57943f={},_0x48a9a1={'count':0x0,'rows':[]};var _0xe7f13c=_[_0xd23c('0x29')](db[_0xd23c('0x2a')][_0xd23c('0x2b')],function(_0x331d04){return{'name':_0x331d04[_0xd23c('0x2c')],'type':_0x331d04['type'][_0xd23c('0x2d')]};});_0x57943f['model']=_[_0xd23c('0x29')](_0xe7f13c,_0xd23c('0x27'));_0x57943f[_0xd23c('0x2e')]=_[_0xd23c('0x2f')](_0x2c8ed0[_0xd23c('0x2e')]);_0x57943f[_0xd23c('0x30')]=_[_0xd23c('0x31')](_0x57943f[_0xd23c('0x32')],_0x57943f[_0xd23c('0x2e')]);_0x910197[_0xd23c('0x33')]=_[_0xd23c('0x31')](_0x57943f[_0xd23c('0x32')],qs[_0xd23c('0x34')](_0x2c8ed0[_0xd23c('0x2e')][_0xd23c('0x34')]));_0x910197[_0xd23c('0x33')]=_0x910197['attributes']['length']?_0x910197['attributes']:_0x57943f[_0xd23c('0x32')];if(!_0x2c8ed0['query']['hasOwnProperty'](_0xd23c('0x35'))){_0x910197[_0xd23c('0x1b')]=qs['limit'](_0x2c8ed0[_0xd23c('0x2e')][_0xd23c('0x1b')]);_0x910197[_0xd23c('0x19')]=qs[_0xd23c('0x19')](_0x2c8ed0[_0xd23c('0x2e')][_0xd23c('0x19')]);}_0x910197[_0xd23c('0x36')]=qs[_0xd23c('0x37')](_0x2c8ed0['query'][_0xd23c('0x37')]);_0x910197[_0xd23c('0x38')]=qs['filters'](_[_0xd23c('0x39')](_0x2c8ed0[_0xd23c('0x2e')],_0x57943f[_0xd23c('0x30')]),_0xe7f13c);if(_0x2c8ed0[_0xd23c('0x2e')][_0xd23c('0x3a')]){_0x910197[_0xd23c('0x38')]=_['merge'](_0x910197['where'],{'$or':_['map'](_0xe7f13c,function(_0x241d03){if(_0x241d03['type']!==_0xd23c('0x3b')){var _0x4498b4={};_0x4498b4[_0x241d03['name']]={'$like':'%'+_0x2c8ed0[_0xd23c('0x2e')]['filter']+'%'};return _0x4498b4;}})});}_0x910197=_['merge']({},_0x910197,_0x2c8ed0[_0xd23c('0x3c')]);var _0x51c3c5={'where':_0x910197[_0xd23c('0x38')]};return db[_0xd23c('0x2a')][_0xd23c('0x1c')](_0x51c3c5)['then'](function(_0x352df6){_0x48a9a1[_0xd23c('0x1c')]=_0x352df6;if(_0x2c8ed0[_0xd23c('0x2e')][_0xd23c('0x3d')]){_0x910197[_0xd23c('0x3e')]=[{'all':!![]}];}return db[_0xd23c('0x2a')][_0xd23c('0x3f')](_0x910197);})[_0xd23c('0x20')](function(_0x207603){_0x48a9a1[_0xd23c('0x40')]=_0x207603;return _0x48a9a1;})['then'](respondWithFilteredResult(_0x2e05fa,_0x910197))['catch'](handleError(_0x2e05fa,null));};exports[_0xd23c('0x41')]=function(_0x11f72a,_0x2a92c1){var _0x508b62={'raw':!![],'where':{'id':_0x11f72a[_0xd23c('0x42')]['id']}},_0x3669b2={};_0x3669b2[_0xd23c('0x32')]=_[_0xd23c('0x2f')](db['Pause'][_0xd23c('0x2b')]);_0x3669b2[_0xd23c('0x2e')]=_[_0xd23c('0x2f')](_0x11f72a[_0xd23c('0x2e')]);_0x3669b2[_0xd23c('0x30')]=_[_0xd23c('0x31')](_0x3669b2[_0xd23c('0x32')],_0x3669b2[_0xd23c('0x2e')]);_0x508b62[_0xd23c('0x33')]=_[_0xd23c('0x31')](_0x3669b2[_0xd23c('0x32')],qs[_0xd23c('0x34')](_0x11f72a[_0xd23c('0x2e')][_0xd23c('0x34')]));_0x508b62[_0xd23c('0x33')]=_0x508b62[_0xd23c('0x33')][_0xd23c('0x43')]?_0x508b62[_0xd23c('0x33')]:_0x3669b2[_0xd23c('0x32')];if(_0x11f72a[_0xd23c('0x2e')]['includeAll']){_0x508b62[_0xd23c('0x3e')]=[{'all':!![]}];}_0x508b62=_[_0xd23c('0x44')]({},_0x508b62,_0x11f72a[_0xd23c('0x3c')]);return db[_0xd23c('0x2a')]['find'](_0x508b62)['then'](handleEntityNotFound(_0x2a92c1,null))[_0xd23c('0x20')](respondWithResult(_0x2a92c1,null))[_0xd23c('0x45')](handleError(_0x2a92c1,null));};exports[_0xd23c('0x46')]=function(_0xf3443a,_0x407a3c){return db['Pause'][_0xd23c('0x46')](_0xf3443a['body'],{})[_0xd23c('0x20')](function(_0x5bbcae){var _0x33e515=_0xf3443a[_0xd23c('0x47')][_0xd23c('0x22')]({'plain':!![]});if(!_0x33e515)throw new Error(_0xd23c('0x48'));if(_0x33e515[_0xd23c('0x49')]===_0xd23c('0x47')){var _0x3b1a71=_0x5bbcae[_0xd23c('0x22')]({'plain':!![]});var _0x1a830e=_0xd23c('0x23');return db[_0xd23c('0x4a')][_0xd23c('0x4b')]({'where':{'name':_0x1a830e,'userProfileId':_0x33e515[_0xd23c('0x4c')]},'raw':!![]})['then'](function(_0x4d4ebb){if(_0x4d4ebb&&_0x4d4ebb[_0xd23c('0x4d')]===0x0){return db[_0xd23c('0x24')][_0xd23c('0x46')]({'name':_0x3b1a71[_0xd23c('0x27')],'resourceId':_0x3b1a71['id'],'type':_0x4d4ebb['name'],'sectionId':_0x4d4ebb['id']},{})[_0xd23c('0x20')](function(){return _0x5bbcae;});}else{return _0x5bbcae;}})[_0xd23c('0x45')](function(_0x31ad55){logger[_0xd23c('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31ad55);throw _0x31ad55;});}return _0x5bbcae;})[_0xd23c('0x20')](respondWithResult(_0x407a3c,0xc9))[_0xd23c('0x45')](handleError(_0x407a3c,null));};exports[_0xd23c('0x4f')]=function(_0x49d189,_0x1fabd7){if(_0x49d189[_0xd23c('0x50')]['id']){delete _0x49d189[_0xd23c('0x50')]['id'];}return db['Pause'][_0xd23c('0x4b')]({'where':{'id':_0x49d189[_0xd23c('0x42')]['id']}})[_0xd23c('0x20')](handleEntityNotFound(_0x1fabd7,null))[_0xd23c('0x20')](saveUpdates(_0x49d189[_0xd23c('0x50')],null))[_0xd23c('0x20')](respondWithResult(_0x1fabd7,null))[_0xd23c('0x45')](handleError(_0x1fabd7,null));};exports['destroy']=function(_0x1fdfdd,_0x1793c3){return db[_0xd23c('0x2a')][_0xd23c('0x4b')]({'where':{'id':_0x1fdfdd[_0xd23c('0x42')]['id']}})[_0xd23c('0x20')](handleEntityNotFound(_0x1793c3,null))[_0xd23c('0x20')](removeEntity(_0x1793c3,null))[_0xd23c('0x45')](handleError(_0x1793c3,null));}; \ No newline at end of file +var _0xfef1=['name','map','Pause','fieldName','type','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','length','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','Pauses','UserProfileResource','end','sendStatus','error'];(function(_0x1db78c,_0x37ea25){var _0x1e7df4=function(_0x3d60b7){while(--_0x3d60b7){_0x1db78c['push'](_0x1db78c['shift']());}};_0x1e7df4(++_0x37ea25);}(_0xfef1,0x1e6));var _0x1fef=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xfef1[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require(_0x1fef('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1fef('0x1'));var rp=require(_0x1fef('0x2'));var moment=require(_0x1fef('0x3'));var BPromise=require(_0x1fef('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1fef('0x5'));var csv=require(_0x1fef('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1fef('0x7'));var _=require(_0x1fef('0x8'));var squel=require(_0x1fef('0x9'));var crypto=require(_0x1fef('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1fef('0xb'));var toCsv=require(_0x1fef('0x6'));var querystring=require('querystring');var Papa=require(_0x1fef('0xc'));var Redis=require(_0x1fef('0xd'));var authService=require(_0x1fef('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1fef('0xf'));var hardwareService=require(_0x1fef('0x10'));var logger=require(_0x1fef('0x11'))(_0x1fef('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1fef('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55f9a9,_0x34fd24){_0x34fd24=_0x34fd24||0xcc;return function(_0x1687d9){if(_0x1687d9){return _0x55f9a9['sendStatus'](_0x34fd24);}return _0x55f9a9['status'](_0x34fd24)['end']();};}function respondWithResult(_0x5cc8b6,_0x4af813){_0x4af813=_0x4af813||0xc8;return function(_0xe1f5f){if(_0xe1f5f){return _0x5cc8b6[_0x1fef('0x14')](_0x4af813)[_0x1fef('0x15')](_0xe1f5f);}};}function respondWithFilteredResult(_0x1c18ca,_0x2335e7){return function(_0x56680b){if(_0x56680b){var _0x170733=typeof _0x2335e7['offset']==='undefined'&&typeof _0x2335e7['limit']===_0x1fef('0x16');var _0x1a0ba2=_0x56680b[_0x1fef('0x17')];var _0x40f509=_0x170733?0x0:_0x2335e7[_0x1fef('0x18')];var _0x1ec384=_0x170733?_0x56680b[_0x1fef('0x17')]:_0x2335e7['offset']+_0x2335e7[_0x1fef('0x19')];var _0x3c2fc2;if(_0x1ec384>=_0x1a0ba2){_0x1ec384=_0x1a0ba2;_0x3c2fc2=0xc8;}else{_0x3c2fc2=0xce;}_0x1c18ca[_0x1fef('0x14')](_0x3c2fc2);return _0x1c18ca[_0x1fef('0x1a')](_0x1fef('0x1b'),_0x40f509+'-'+_0x1ec384+'/'+_0x1a0ba2)[_0x1fef('0x15')](_0x56680b);}return null;};}function patchUpdates(_0x1093fd){return function(_0x2a203c){try{jsonpatch[_0x1fef('0x1c')](_0x2a203c,_0x1093fd,!![]);}catch(_0x3245b1){return BPromise[_0x1fef('0x1d')](_0x3245b1);}return _0x2a203c[_0x1fef('0x1e')]();};}function saveUpdates(_0x29a8e5,_0x974a93){return function(_0x42a634){if(_0x42a634){return _0x42a634[_0x1fef('0x1f')](_0x29a8e5)['then'](function(_0x44d14a){return _0x44d14a;});}return null;};}function removeEntity(_0x3e2b62,_0x4dae4b){return function(_0x34baff){if(_0x34baff){return _0x34baff['destroy']()[_0x1fef('0x20')](function(){var _0x56347c=_0x34baff[_0x1fef('0x21')]({'plain':!![]});var _0x351a9e=_0x1fef('0x22');return db[_0x1fef('0x23')]['destroy']({'where':{'type':_0x351a9e,'resourceId':_0x56347c['id']}})[_0x1fef('0x20')](function(){return _0x34baff;});})[_0x1fef('0x20')](function(){_0x3e2b62[_0x1fef('0x14')](0xcc)[_0x1fef('0x24')]();});}};}function handleEntityNotFound(_0x19ce06,_0xe910a0){return function(_0x3e841a){if(!_0x3e841a){_0x19ce06[_0x1fef('0x25')](0x194);}return _0x3e841a;};}function handleError(_0x973181,_0x40ceae){_0x40ceae=_0x40ceae||0x1f4;return function(_0xfa4861){logger[_0x1fef('0x26')](_0xfa4861['stack']);if(_0xfa4861[_0x1fef('0x27')]){delete _0xfa4861[_0x1fef('0x27')];}_0x973181[_0x1fef('0x14')](_0x40ceae)['send'](_0xfa4861);};}exports['index']=function(_0x4f2282,_0x3c62a6){var _0x44de94={},_0x19df3a={},_0x38813e={'count':0x0,'rows':[]};var _0x3736fe=_[_0x1fef('0x28')](db[_0x1fef('0x29')]['rawAttributes'],function(_0x4dda6c){return{'name':_0x4dda6c[_0x1fef('0x2a')],'type':_0x4dda6c[_0x1fef('0x2b')]['key']};});_0x19df3a[_0x1fef('0x2c')]=_['map'](_0x3736fe,_0x1fef('0x27'));_0x19df3a['query']=_[_0x1fef('0x2d')](_0x4f2282['query']);_0x19df3a[_0x1fef('0x2e')]=_[_0x1fef('0x2f')](_0x19df3a[_0x1fef('0x2c')],_0x19df3a[_0x1fef('0x30')]);_0x44de94[_0x1fef('0x31')]=_[_0x1fef('0x2f')](_0x19df3a['model'],qs[_0x1fef('0x32')](_0x4f2282['query']['fields']));_0x44de94[_0x1fef('0x31')]=_0x44de94[_0x1fef('0x31')]['length']?_0x44de94[_0x1fef('0x31')]:_0x19df3a['model'];if(!_0x4f2282[_0x1fef('0x30')][_0x1fef('0x33')](_0x1fef('0x34'))){_0x44de94['limit']=qs[_0x1fef('0x19')](_0x4f2282[_0x1fef('0x30')][_0x1fef('0x19')]);_0x44de94[_0x1fef('0x18')]=qs[_0x1fef('0x18')](_0x4f2282['query']['offset']);}_0x44de94[_0x1fef('0x35')]=qs[_0x1fef('0x36')](_0x4f2282[_0x1fef('0x30')][_0x1fef('0x36')]);_0x44de94[_0x1fef('0x37')]=qs[_0x1fef('0x2e')](_['pick'](_0x4f2282[_0x1fef('0x30')],_0x19df3a[_0x1fef('0x2e')]),_0x3736fe);if(_0x4f2282[_0x1fef('0x30')][_0x1fef('0x38')]){_0x44de94[_0x1fef('0x37')]=_[_0x1fef('0x39')](_0x44de94[_0x1fef('0x37')],{'$or':_[_0x1fef('0x28')](_0x3736fe,function(_0x93eecb){if(_0x93eecb[_0x1fef('0x2b')]!==_0x1fef('0x3a')){var _0x56cfaf={};_0x56cfaf[_0x93eecb[_0x1fef('0x27')]]={'$like':'%'+_0x4f2282[_0x1fef('0x30')][_0x1fef('0x38')]+'%'};return _0x56cfaf;}})});}_0x44de94=_[_0x1fef('0x39')]({},_0x44de94,_0x4f2282[_0x1fef('0x3b')]);var _0x291e3f={'where':_0x44de94[_0x1fef('0x37')]};return db[_0x1fef('0x29')][_0x1fef('0x17')](_0x291e3f)[_0x1fef('0x20')](function(_0x10ac53){_0x38813e[_0x1fef('0x17')]=_0x10ac53;if(_0x4f2282[_0x1fef('0x30')]['includeAll']){_0x44de94[_0x1fef('0x3c')]=[{'all':!![]}];}return db['Pause'][_0x1fef('0x3d')](_0x44de94);})[_0x1fef('0x20')](function(_0x2b7f50){_0x38813e[_0x1fef('0x3e')]=_0x2b7f50;return _0x38813e;})['then'](respondWithFilteredResult(_0x3c62a6,_0x44de94))[_0x1fef('0x3f')](handleError(_0x3c62a6,null));};exports['show']=function(_0x3797e8,_0x3fbd6c){var _0x4159c9={'raw':!![],'where':{'id':_0x3797e8[_0x1fef('0x40')]['id']}},_0x4d8b2d={};_0x4d8b2d[_0x1fef('0x2c')]=_['keys'](db[_0x1fef('0x29')]['rawAttributes']);_0x4d8b2d[_0x1fef('0x30')]=_[_0x1fef('0x2d')](_0x3797e8[_0x1fef('0x30')]);_0x4d8b2d[_0x1fef('0x2e')]=_['intersection'](_0x4d8b2d[_0x1fef('0x2c')],_0x4d8b2d[_0x1fef('0x30')]);_0x4159c9['attributes']=_[_0x1fef('0x2f')](_0x4d8b2d[_0x1fef('0x2c')],qs[_0x1fef('0x32')](_0x3797e8['query'][_0x1fef('0x32')]));_0x4159c9[_0x1fef('0x31')]=_0x4159c9[_0x1fef('0x31')][_0x1fef('0x41')]?_0x4159c9[_0x1fef('0x31')]:_0x4d8b2d[_0x1fef('0x2c')];if(_0x3797e8[_0x1fef('0x30')][_0x1fef('0x42')]){_0x4159c9['include']=[{'all':!![]}];}_0x4159c9=_[_0x1fef('0x39')]({},_0x4159c9,_0x3797e8[_0x1fef('0x3b')]);return db[_0x1fef('0x29')][_0x1fef('0x43')](_0x4159c9)[_0x1fef('0x20')](handleEntityNotFound(_0x3fbd6c,null))[_0x1fef('0x20')](respondWithResult(_0x3fbd6c,null))['catch'](handleError(_0x3fbd6c,null));};exports[_0x1fef('0x44')]=function(_0xb8e536,_0x324577){return db[_0x1fef('0x29')][_0x1fef('0x44')](_0xb8e536[_0x1fef('0x45')],{})[_0x1fef('0x20')](function(_0x5c18c4){var _0x24314d=_0xb8e536[_0x1fef('0x46')][_0x1fef('0x21')]({'plain':!![]});if(!_0x24314d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24314d[_0x1fef('0x47')]===_0x1fef('0x46')){var _0x80b6e5=_0x5c18c4['get']({'plain':!![]});var _0x50c187=_0x1fef('0x22');return db[_0x1fef('0x48')][_0x1fef('0x43')]({'where':{'name':_0x50c187,'userProfileId':_0x24314d[_0x1fef('0x49')]},'raw':!![]})[_0x1fef('0x20')](function(_0x4dfa45){if(_0x4dfa45&&_0x4dfa45['autoAssociation']===0x0){return db[_0x1fef('0x23')][_0x1fef('0x44')]({'name':_0x80b6e5[_0x1fef('0x27')],'resourceId':_0x80b6e5['id'],'type':_0x4dfa45[_0x1fef('0x27')],'sectionId':_0x4dfa45['id']},{})['then'](function(){return _0x5c18c4;});}else{return _0x5c18c4;}})[_0x1fef('0x3f')](function(_0x82648f){logger[_0x1fef('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x82648f);throw _0x82648f;});}return _0x5c18c4;})['then'](respondWithResult(_0x324577,0xc9))[_0x1fef('0x3f')](handleError(_0x324577,null));};exports[_0x1fef('0x1f')]=function(_0x2d9ca4,_0x2e9184){if(_0x2d9ca4[_0x1fef('0x45')]['id']){delete _0x2d9ca4[_0x1fef('0x45')]['id'];}return db[_0x1fef('0x29')][_0x1fef('0x43')]({'where':{'id':_0x2d9ca4['params']['id']}})[_0x1fef('0x20')](handleEntityNotFound(_0x2e9184,null))['then'](saveUpdates(_0x2d9ca4[_0x1fef('0x45')],null))['then'](respondWithResult(_0x2e9184,null))[_0x1fef('0x3f')](handleError(_0x2e9184,null));};exports[_0x1fef('0x4a')]=function(_0x5a8c31,_0x1a46eb){return db[_0x1fef('0x29')][_0x1fef('0x43')]({'where':{'id':_0x5a8c31[_0x1fef('0x40')]['id']}})[_0x1fef('0x20')](handleEntityNotFound(_0x1a46eb,null))['then'](removeEntity(_0x1a46eb,null))[_0x1fef('0x3f')](handleError(_0x1a46eb,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index ba72df3..d05df2f 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(_0x26e40e,_0x37b9a4){var _0x5b3b0f=function(_0x1c5258){while(--_0x1c5258){_0x26e40e['push'](_0x26e40e['shift']());}};_0x5b3b0f(++_0x37b9a4);}(_0x53ec,0x192));var _0xc53e=function(_0x426dd2,_0x4b0012){_0x426dd2=_0x426dd2-0x0;var _0x4bc76c=_0x53ec[_0x426dd2];return _0x4bc76c;};'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 _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index e2aff13..9c303db 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x173465,_0x8d6e68){var _0x1434be=function(_0x21a50a){while(--_0x21a50a){_0x173465['push'](_0x173465['shift']());}};_0x1434be(++_0x8d6e68);}(_0x7a54,0x106));var _0x47a5=function(_0x4e44c7,_0x10d378){_0x4e44c7=_0x4e44c7-0x0;var _0x107fb4=_0x7a54[_0x4e44c7];return _0x107fb4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x17e361,_0x4df325){var _0x2a965e=function(_0x525dcb){while(--_0x525dcb){_0x17e361['push'](_0x17e361['shift']());}};_0x2a965e(++_0x4df325);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ff685,_0x304b9e){_0x3ff685=_0x3ff685-0x0;var _0x2046c9=_0xb10b[_0x3ff685];return _0x2046c9;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 45c9e94..5083d5d 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 _0x2123=['join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','update','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','isAuthenticated','show','/:id/download','diskStorage'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2123,0x190));var _0x3212=function(_0x4b4d06,_0x4666f4){_0x4b4d06=_0x4b4d06-0x0;var _0x5c541a=_0x2123[_0x4b4d06];return _0x5c541a;};'use strict';var multer=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require(_0x3212('0x2'));var timeout=require(_0x3212('0x3'));var express=require(_0x3212('0x4'));var router=express[_0x3212('0x5')]();var fs_extra=require(_0x3212('0x6'));var auth=require(_0x3212('0x7'));var interaction=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var controller=require(_0x3212('0xa'));router[_0x3212('0xb')]('/',auth['isAuthenticated'](),controller[_0x3212('0xc')]);router[_0x3212('0xb')](_0x3212('0xd'),controller['webhookGet']);router[_0x3212('0xb')]('/:id',auth[_0x3212('0xe')](),controller[_0x3212('0xf')]);router[_0x3212('0xb')](_0x3212('0x10'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x3212('0x11')]({'destination':function(_0xf166c2,_0x1a3b2f,_0x23f7e3){_0x23f7e3(null,path[_0x3212('0x12')](config[_0x3212('0x13')],_0x3212('0x14')));},'filename':function(_0x359cef,_0x26c1c8,_0x2d5fce){_0x26c1c8[_0x3212('0x15')]=_0x26c1c8[_0x3212('0x15')][_0x3212('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2d5fce(null,util[_0x3212('0x17')](_0x3212('0x18'),path[_0x3212('0x19')](_0x26c1c8[_0x3212('0x15')],path[_0x3212('0x1a')](_0x26c1c8[_0x3212('0x15')])),Date[_0x3212('0x1b')](),path[_0x3212('0x1a')](_0x26c1c8[_0x3212('0x15')])));}})});router['post']('/',upload[_0x3212('0x1c')](_0x3212('0x1d')),controller[_0x3212('0x1e')]);router[_0x3212('0x1f')](_0x3212('0xd'),controller[_0x3212('0x20')]);router[_0x3212('0x21')]('/:id',auth['isAuthenticated'](),controller[_0x3212('0x22')]);router['delete'](_0x3212('0x23'),auth[_0x3212('0xe')](),controller[_0x3212('0x24')]);module[_0x3212('0x25')]=router; \ No newline at end of file +var _0xe14d=['isAuthenticated','index','webhookGet','/:id','show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','single','file','upload','/webhook','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','get'];(function(_0xab8aae,_0x39a7e5){var _0x5401b4=function(_0x3be859){while(--_0x3be859){_0xab8aae['push'](_0xab8aae['shift']());}};_0x5401b4(++_0x39a7e5);}(_0xe14d,0x1ee));var _0xde14=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xe14d[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var fs_extra=require(_0xde14('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var controller=require(_0xde14('0x8'));router[_0xde14('0x9')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0xb')]);router['get']('/webhook',controller[_0xde14('0xc')]);router[_0xde14('0x9')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0xe')]);router[_0xde14('0x9')](_0xde14('0xf'),auth[_0xde14('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xde14('0x10')]({'destination':function(_0xe785fb,_0x417269,_0x4357c7){_0x4357c7(null,path[_0xde14('0x11')](config[_0xde14('0x12')],_0xde14('0x13')));},'filename':function(_0x3d5a29,_0x34e28f,_0x29e3ca){_0x34e28f[_0xde14('0x14')]=_0x34e28f[_0xde14('0x14')][_0xde14('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x29e3ca(null,util[_0xde14('0x16')](_0xde14('0x17'),path['basename'](_0x34e28f['originalname'],path[_0xde14('0x18')](_0x34e28f[_0xde14('0x14')])),Date[_0xde14('0x19')](),path['extname'](_0x34e28f[_0xde14('0x14')])));}})});router[_0xde14('0x1a')]('/',upload[_0xde14('0x1b')](_0xde14('0x1c')),controller[_0xde14('0x1d')]);router[_0xde14('0x1a')](_0xde14('0x1e'),controller[_0xde14('0x1f')]);router[_0xde14('0x20')](_0xde14('0xd'),auth['isAuthenticated'](),controller[_0xde14('0x21')]);router[_0xde14('0x22')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller['delete']);module[_0xde14('0x23')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index db98f5c..1cdf4b5 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 _0xaca1=['ENUM','html','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','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING'];(function(_0x599f13,_0x1c0140){var _0x1ebd6a=function(_0x598f23){while(--_0x598f23){_0x599f13['push'](_0x599f13['shift']());}};_0x1ebd6a(++_0x1c0140);}(_0xaca1,0x13f));var _0x1aca=function(_0xfc11f4,_0x169022){_0xfc11f4=_0xfc11f4-0x0;var _0xa2082b=_0xaca1[_0xfc11f4];return _0xa2082b;};'use strict';var Sequelize=require(_0x1aca('0x0'));module[_0x1aca('0x1')]={'name':{'type':Sequelize[_0x1aca('0x2')]},'type':{'type':Sequelize[_0x1aca('0x3')](_0x1aca('0x4'),_0x1aca('0x5'))},'description':{'type':Sequelize[_0x1aca('0x6')]},'version':{'type':Sequelize[_0x1aca('0x6')]},'path':{'type':Sequelize[_0x1aca('0x2')],'comment':_0x1aca('0x7')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1aca('0x8')},'sidebar':{'type':Sequelize[_0x1aca('0x3')](_0x1aca('0x9'),_0x1aca('0xa'),_0x1aca('0xb'),_0x1aca('0xc')),'defaultValue':_0x1aca('0xb'),'comment':_0x1aca('0xd')},'icon':{'type':Sequelize[_0x1aca('0x2')]},'adminUrl':{'type':Sequelize[_0x1aca('0x2')]},'agentUrl':{'type':Sequelize[_0x1aca('0x2')]},'scriptName':{'type':Sequelize[_0x1aca('0x2')]},'scriptPath':{'type':Sequelize[_0x1aca('0x2')]}}; \ No newline at end of file +var _0xadbe=['exports','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x15ca1a,_0x30fc82){var _0x507626=function(_0x14c9bc){while(--_0x14c9bc){_0x15ca1a['push'](_0x15ca1a['shift']());}};_0x507626(++_0x30fc82);}(_0xadbe,0x1af));var _0xeadb=function(_0x1f1fcd,_0x3c69b4){_0x1f1fcd=_0x1f1fcd-0x0;var _0x45ee45=_0xadbe[_0x1f1fcd];return _0x45ee45;};'use strict';var Sequelize=require(_0xeadb('0x0'));module[_0xeadb('0x1')]={'name':{'type':Sequelize[_0xeadb('0x2')]},'type':{'type':Sequelize[_0xeadb('0x3')]('html',_0xeadb('0x4'))},'description':{'type':Sequelize[_0xeadb('0x5')]},'version':{'type':Sequelize[_0xeadb('0x5')]},'path':{'type':Sequelize[_0xeadb('0x2')],'comment':_0xeadb('0x6')},'active':{'type':Sequelize[_0xeadb('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xeadb('0x3')]('adminOnly',_0xeadb('0x8'),_0xeadb('0x9'),_0xeadb('0xa')),'defaultValue':'always','comment':_0xeadb('0xb')},'icon':{'type':Sequelize[_0xeadb('0x2')]},'adminUrl':{'type':Sequelize[_0xeadb('0x2')]},'agentUrl':{'type':Sequelize[_0xeadb('0x2')]},'scriptName':{'type':Sequelize[_0xeadb('0x2')]},'scriptPath':{'type':Sequelize[_0xeadb('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index e60064d..f1df790 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 _0xcd00=['lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','type','Invalid\x20manifest:\x20type\x20missing','version','parameters','views','Invalid\x20manifest:\x20views\x20missing','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','always','icon','icon-apps','html','admin','plugins','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','extract-zip','rimraf','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','update','then','get','Plugins','UserProfileResource','destroy','sendStatus','error','name','send','index','Plugin','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','rawAttributes','fields','options','find','download','root','server/files/plugins','%s.zip','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','join','dirname','basename','node_modules/**/*','attachments/**/*','finalize','Plugin\x20not\x20found','format','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure'];(function(_0x1442cc,_0x35c091){var _0x4a597e=function(_0x4ec0fe){while(--_0x4ec0fe){_0x1442cc['push'](_0x1442cc['shift']());}};_0x4a597e(++_0x35c091);}(_0xcd00,0x17e));var _0x0cd0=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xcd00[_0x51020b];return _0x371e47;};'use strict';var emlformat=require(_0x0cd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0cd0('0x1'));var jsonpatch=require(_0x0cd0('0x2'));var rp=require(_0x0cd0('0x3'));var moment=require('moment');var BPromise=require(_0x0cd0('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0cd0('0x5'));var sox=require(_0x0cd0('0x6'));var csv=require(_0x0cd0('0x7'));var ejs=require(_0x0cd0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0cd0('0x9'));var crypto=require(_0x0cd0('0xa'));var jsforce=require(_0x0cd0('0xb'));var deskjs=require(_0x0cd0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0cd0('0xd'));var Papa=require('papaparse');var extract=require(_0x0cd0('0xe'));var rimraf=require(_0x0cd0('0xf'));var archiver=require('archiver');var Redis=require(_0x0cd0('0x10'));var authService=require(_0x0cd0('0x11'));var qs=require(_0x0cd0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0cd0('0x13'));var logger=require(_0x0cd0('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x0cd0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0cd0('0x16'))['db'];config[_0x0cd0('0x17')]=_[_0x0cd0('0x18')](config['redis'],{'host':_0x0cd0('0x19'),'port':0x18eb});var socket=require(_0x0cd0('0x1a'))(new Redis(config[_0x0cd0('0x17')]));require(_0x0cd0('0x1b'))[_0x0cd0('0x1c')](socket);function respondWithStatusCode(_0x256865,_0x3f4173){_0x3f4173=_0x3f4173||0xcc;return function(_0x857744){if(_0x857744){return _0x256865['sendStatus'](_0x3f4173);}return _0x256865['status'](_0x3f4173)['end']();};}function respondWithResult(_0x1f132e,_0x3dc6f2){_0x3dc6f2=_0x3dc6f2||0xc8;return function(_0x1f0073){if(_0x1f0073){return _0x1f132e['status'](_0x3dc6f2)['json'](_0x1f0073);}};}function respondWithFilteredResult(_0x878e4,_0x2ec1f5){return function(_0x315020){if(_0x315020){var _0x6e3547=typeof _0x2ec1f5[_0x0cd0('0x1d')]===_0x0cd0('0x1e')&&typeof _0x2ec1f5[_0x0cd0('0x1f')]==='undefined';var _0x3db651=_0x315020[_0x0cd0('0x20')];var _0x3bad68=_0x6e3547?0x0:_0x2ec1f5[_0x0cd0('0x1d')];var _0x7c413b=_0x6e3547?_0x315020[_0x0cd0('0x20')]:_0x2ec1f5[_0x0cd0('0x1d')]+_0x2ec1f5['limit'];var _0x77edbc;if(_0x7c413b>=_0x3db651){_0x7c413b=_0x3db651;_0x77edbc=0xc8;}else{_0x77edbc=0xce;}_0x878e4[_0x0cd0('0x21')](_0x77edbc);return _0x878e4[_0x0cd0('0x22')](_0x0cd0('0x23'),_0x3bad68+'-'+_0x7c413b+'/'+_0x3db651)[_0x0cd0('0x24')](_0x315020);}return null;};}function patchUpdates(_0x3ffbeb){return function(_0x51be80){try{jsonpatch[_0x0cd0('0x25')](_0x51be80,_0x3ffbeb,!![]);}catch(_0x4bf7e4){return BPromise['reject'](_0x4bf7e4);}return _0x51be80[_0x0cd0('0x26')]();};}function saveUpdates(_0x27a184,_0x1815a0){return function(_0x4d3ba6){if(_0x4d3ba6){return _0x4d3ba6[_0x0cd0('0x27')](_0x27a184)[_0x0cd0('0x28')](function(_0x2a872f){return _0x2a872f;});}return null;};}function removeEntity(_0x36411e,_0xa21283){return function(_0xf4bf55){if(_0xf4bf55){return _0xf4bf55['destroy']()[_0x0cd0('0x28')](function(){var _0x1258ed=_0xf4bf55[_0x0cd0('0x29')]({'plain':!![]});var _0x56cdb3=_0x0cd0('0x2a');return db[_0x0cd0('0x2b')][_0x0cd0('0x2c')]({'where':{'type':_0x56cdb3,'resourceId':_0x1258ed['id']}})[_0x0cd0('0x28')](function(){return _0xf4bf55;});})[_0x0cd0('0x28')](function(){_0x36411e[_0x0cd0('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x561a99,_0x3657ff){return function(_0x56bddd){if(!_0x56bddd){_0x561a99[_0x0cd0('0x2d')](0x194);}return _0x56bddd;};}function handleError(_0x252699,_0x2e1a0f){_0x2e1a0f=_0x2e1a0f||0x1f4;return function(_0x26d58e){logger[_0x0cd0('0x2e')](_0x26d58e['stack']);if(_0x26d58e[_0x0cd0('0x2f')]){delete _0x26d58e[_0x0cd0('0x2f')];}_0x252699['status'](_0x2e1a0f)[_0x0cd0('0x30')](_0x26d58e);};}exports[_0x0cd0('0x31')]=function(_0x381fab,_0xe5c2d0){var _0x3103ea={},_0x4efb80={},_0x11df4b={'count':0x0,'rows':[]};var _0xc045f4=_['map'](db[_0x0cd0('0x32')]['rawAttributes'],function(_0x1a29aa){return{'name':_0x1a29aa['fieldName'],'type':_0x1a29aa['type'][_0x0cd0('0x33')]};});_0x4efb80[_0x0cd0('0x34')]=_[_0x0cd0('0x35')](_0xc045f4,'name');_0x4efb80[_0x0cd0('0x36')]=_[_0x0cd0('0x37')](_0x381fab[_0x0cd0('0x36')]);_0x4efb80[_0x0cd0('0x38')]=_[_0x0cd0('0x39')](_0x4efb80[_0x0cd0('0x34')],_0x4efb80['query']);_0x3103ea[_0x0cd0('0x3a')]=_[_0x0cd0('0x39')](_0x4efb80[_0x0cd0('0x34')],qs['fields'](_0x381fab[_0x0cd0('0x36')]['fields']));_0x3103ea[_0x0cd0('0x3a')]=_0x3103ea[_0x0cd0('0x3a')][_0x0cd0('0x3b')]?_0x3103ea[_0x0cd0('0x3a')]:_0x4efb80['model'];if(!_0x381fab[_0x0cd0('0x36')][_0x0cd0('0x3c')]('nolimit')){_0x3103ea['limit']=qs[_0x0cd0('0x1f')](_0x381fab['query'][_0x0cd0('0x1f')]);_0x3103ea['offset']=qs[_0x0cd0('0x1d')](_0x381fab[_0x0cd0('0x36')][_0x0cd0('0x1d')]);}_0x3103ea['order']=qs[_0x0cd0('0x3d')](_0x381fab['query'][_0x0cd0('0x3d')]);_0x3103ea[_0x0cd0('0x3e')]=qs[_0x0cd0('0x38')](_['pick'](_0x381fab['query'],_0x4efb80['filters']),_0xc045f4);if(_0x381fab[_0x0cd0('0x36')][_0x0cd0('0x3f')]){_0x3103ea[_0x0cd0('0x3e')]=_[_0x0cd0('0x40')](_0x3103ea[_0x0cd0('0x3e')],{'$or':_[_0x0cd0('0x35')](_0xc045f4,function(_0x1ea82c){if(_0x1ea82c['type']!==_0x0cd0('0x41')){var _0x5d9356={};_0x5d9356[_0x1ea82c['name']]={'$like':'%'+_0x381fab[_0x0cd0('0x36')][_0x0cd0('0x3f')]+'%'};return _0x5d9356;}})});}_0x3103ea=_[_0x0cd0('0x40')]({},_0x3103ea,_0x381fab['options']);var _0x3bbe5e={'where':_0x3103ea[_0x0cd0('0x3e')]};return db[_0x0cd0('0x32')][_0x0cd0('0x20')](_0x3bbe5e)['then'](function(_0x3591ac){_0x11df4b[_0x0cd0('0x20')]=_0x3591ac;if(_0x381fab['query'][_0x0cd0('0x42')]){_0x3103ea[_0x0cd0('0x43')]=[{'all':!![]}];}return db[_0x0cd0('0x32')]['findAll'](_0x3103ea);})[_0x0cd0('0x28')](function(_0x3bc149){_0x11df4b[_0x0cd0('0x44')]=_0x3bc149;return _0x11df4b;})[_0x0cd0('0x28')](respondWithFilteredResult(_0xe5c2d0,_0x3103ea))[_0x0cd0('0x45')](handleError(_0xe5c2d0,null));};exports['show']=function(_0x55f23d,_0x23df44){var _0x2b002b={'raw':!![],'where':{'id':_0x55f23d[_0x0cd0('0x46')]['id']}},_0x31d9b2={};_0x31d9b2[_0x0cd0('0x34')]=_[_0x0cd0('0x37')](db[_0x0cd0('0x32')][_0x0cd0('0x47')]);_0x31d9b2[_0x0cd0('0x36')]=_[_0x0cd0('0x37')](_0x55f23d[_0x0cd0('0x36')]);_0x31d9b2[_0x0cd0('0x38')]=_['intersection'](_0x31d9b2[_0x0cd0('0x34')],_0x31d9b2[_0x0cd0('0x36')]);_0x2b002b['attributes']=_[_0x0cd0('0x39')](_0x31d9b2[_0x0cd0('0x34')],qs['fields'](_0x55f23d[_0x0cd0('0x36')][_0x0cd0('0x48')]));_0x2b002b[_0x0cd0('0x3a')]=_0x2b002b[_0x0cd0('0x3a')][_0x0cd0('0x3b')]?_0x2b002b[_0x0cd0('0x3a')]:_0x31d9b2[_0x0cd0('0x34')];if(_0x55f23d[_0x0cd0('0x36')][_0x0cd0('0x42')]){_0x2b002b[_0x0cd0('0x43')]=[{'all':!![]}];}_0x2b002b=_[_0x0cd0('0x40')]({},_0x2b002b,_0x55f23d[_0x0cd0('0x49')]);return db['Plugin'][_0x0cd0('0x4a')](_0x2b002b)[_0x0cd0('0x28')](handleEntityNotFound(_0x23df44,null))[_0x0cd0('0x28')](respondWithResult(_0x23df44,null))[_0x0cd0('0x45')](handleError(_0x23df44,null));};exports[_0x0cd0('0x4b')]=function(_0x24a30d,_0x30802d,_0xb7021d){return db[_0x0cd0('0x32')]['find']({'where':{'id':_0x24a30d[_0x0cd0('0x46')]['id']},'attributes':['name',_0x0cd0('0x5')],'raw':!![]})[_0x0cd0('0x28')](handleEntityNotFound(_0x30802d,null))[_0x0cd0('0x28')](function(_0x5a2f61){if(_0x5a2f61){var _0x5089cd=path['join'](config[_0x0cd0('0x4c')],_0x0cd0('0x4d'),util['format'](_0x0cd0('0x4e'),path['basename'](_0x5a2f61[_0x0cd0('0x5')])));var _0x1812f7=fs[_0x0cd0('0x4f')](_0x5089cd);var _0x627e23=archiver(_0x0cd0('0x50'),{'zlib':{'level':0x9}});_0x627e23['on'](_0x0cd0('0x51'),function(_0x2f2817){if(_0x2f2817[_0x0cd0('0x52')]===_0x0cd0('0x53')){logger[_0x0cd0('0x2e')](_0x2f2817);}else{throw new db[(_0x0cd0('0x54'))]['Error'](_0x0cd0('0x55'));}});_0x627e23['on']('error',function(_0x4fda9e){throw new db[(_0x0cd0('0x54'))][(_0x0cd0('0x56'))](_0x0cd0('0x55'));});_0x627e23[_0x0cd0('0x57')](_0x1812f7);_0x627e23[_0x0cd0('0x58')](_0x0cd0('0x59'),{'cwd':path[_0x0cd0('0x5a')](config[_0x0cd0('0x4c')],_0x0cd0('0x4d'),path[_0x0cd0('0x5b')](_0x5a2f61[_0x0cd0('0x5')])),'ignore':[path[_0x0cd0('0x5a')](path[_0x0cd0('0x5c')](_0x5a2f61[_0x0cd0('0x5')]),_0x0cd0('0x5d')),path['join'](path[_0x0cd0('0x5c')](_0x5a2f61[_0x0cd0('0x5')]),_0x0cd0('0x5e'))],'nodir':!![]})[_0x0cd0('0x5f')]();_0x1812f7['on']('close',function(){if(!fs['existsSync'](_0x5089cd)){throw new db[(_0x0cd0('0x54'))][(_0x0cd0('0x56'))](_0x0cd0('0x60'));}return _0x30802d[_0x0cd0('0x4b')](_0x5089cd,util[_0x0cd0('0x61')]('%s.zip',path[_0x0cd0('0x5c')](_0x5a2f61[_0x0cd0('0x5')])),function(_0x2d1d6d){if(_0x2d1d6d){throw new db[(_0x0cd0('0x54'))][(_0x0cd0('0x56'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x0cd0('0x62')](_0x5089cd);logger[_0x0cd0('0x63')](_0x0cd0('0x64'));logger[_0x0cd0('0x63')](_0x0cd0('0x65'));});});}return null;})[_0x0cd0('0x45')](handleError(_0x30802d,null));};exports[_0x0cd0('0x66')]=function(_0x2d3df8,_0x1fea8f,_0x34b495){var _0x4b0e70=path[_0x0cd0('0x5c')](_0x2d3df8[_0x0cd0('0x67')][_0x0cd0('0x68')],path['extname'](_0x2d3df8[_0x0cd0('0x67')][_0x0cd0('0x68')]));var _0x2e3d4f=path[_0x0cd0('0x5a')](config[_0x0cd0('0x4c')],'server/files/plugins',_0x2d3df8['file'][_0x0cd0('0x68')]);var _0x5f3ad8=path[_0x0cd0('0x5a')](config[_0x0cd0('0x4c')],_0x0cd0('0x4d'),_0x4b0e70);logger['info'](_0x0cd0('0x69'),_0x2e3d4f);logger[_0x0cd0('0x63')](_0x0cd0('0x6a'),_0x5f3ad8);try{fs[_0x0cd0('0x6b')](_0x2e3d4f,parseInt('0777',0x8));extract(_0x2e3d4f,{'dir':_0x5f3ad8},function(_0x1958d0){if(_0x1958d0){logger[_0x0cd0('0x2e')](_0x1958d0);handleError(_0x1958d0,!![]);};var _0x26cb31=fs[_0x0cd0('0x6c')](_0x5f3ad8);if(_0x26cb31[_0x0cd0('0x3b')]>0x1){removeReferences(_0x2e3d4f,_0x5f3ad8);logger[_0x0cd0('0x2e')](_0x0cd0('0x6d'));return _0x34b495(new Error('Invalid\x20plugin\x20structure'));}var _0x28eab0=fs[_0x0cd0('0x6e')](path[_0x0cd0('0x5a')](_0x5f3ad8,_0x26cb31[0x0]));if(_0x28eab0[_0x0cd0('0x6f')]()){removeReferences(_0x2e3d4f,_0x5f3ad8);logger[_0x0cd0('0x2e')](_0x0cd0('0x6d'));return _0x34b495(new Error(_0x0cd0('0x6d')));}if(_0x28eab0[_0x0cd0('0x70')]()){var _0x371c54=fs['readdirSync'](path['join'](_0x5f3ad8,_0x26cb31[0x0]));if(_0x371c54[_0x0cd0('0x3b')]===0x0){removeReferences(_0x2e3d4f,_0x5f3ad8);logger[_0x0cd0('0x2e')]('Invalid\x20plugin\x20structure');return _0x34b495(new Error('Invalid\x20plugin\x20structure'));}var _0x2eee13=_0x371c54[_0x0cd0('0x71')](function(_0x47f8d5){return _0x47f8d5===_0x0cd0('0x72');});if(!_0x2eee13){return _0x34b495(new Error('Plugin\x20manifest\x20missing'));}var _0x2f2c11=fs[_0x0cd0('0x73')](path[_0x0cd0('0x5a')](_0x5f3ad8,_0x26cb31[0x0],_0x0cd0('0x72')));var _0x1f23dd=JSON[_0x0cd0('0x74')](_0x2f2c11);if(_0x0cd0('0x1e')==typeof _0x1f23dd[_0x0cd0('0x2f')]){return _0x34b495(new Error(_0x0cd0('0x75')));}if(_0x0cd0('0x1e')==typeof _0x1f23dd[_0x0cd0('0x76')]){return _0x34b495(new Error(_0x0cd0('0x77')));}if('undefined'==typeof _0x1f23dd[_0x0cd0('0x78')]){return _0x34b495(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x0cd0('0x1e')==typeof _0x1f23dd[_0x0cd0('0x79')]){return _0x34b495(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x1f23dd['type']==='html'){if(_0x0cd0('0x1e')==typeof _0x1f23dd[_0x0cd0('0x79')][_0x0cd0('0x7a')]){return _0x34b495(new Error(_0x0cd0('0x7b')));}if(_0x0cd0('0x1e')==typeof _0x1f23dd[_0x0cd0('0x79')][_0x0cd0('0x7a')]['admin']&&_0x0cd0('0x1e')==typeof _0x1f23dd[_0x0cd0('0x79')][_0x0cd0('0x7a')][_0x0cd0('0x7c')]){return _0x34b495(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1f23dd[_0x0cd0('0x76')]===_0x0cd0('0x7d')){if(_0x0cd0('0x1e')==typeof _0x1f23dd[_0x0cd0('0x79')][_0x0cd0('0x7e')]){return _0x34b495(new Error(_0x0cd0('0x7f')));}if(_0x0cd0('0x1e')==typeof _0x1f23dd[_0x0cd0('0x79')][_0x0cd0('0x80')]){return _0x34b495(new Error(_0x0cd0('0x81')));}}else{return _0x34b495(new Error(_0x0cd0('0x82')));}var _0xbac81=_0x1f23dd[_0x0cd0('0x2f')];var _0x14f037=_0x1f23dd['description'];var _0x53c198=_0x1f23dd[_0x0cd0('0x76')];var _0x23a6eb=_0x1f23dd['sidebar']?_0x1f23dd['sidebar']:_0x0cd0('0x83');var _0x312a4b=_0x1f23dd[_0x0cd0('0x84')]?_0x1f23dd['icon']:_0x0cd0('0x85');var _0x4316b6='';var _0x31045f='';var _0x3a352a='';var _0x32352e='';var _0x35f434=_0x1f23dd[_0x0cd0('0x78')];if(_0x53c198===_0x0cd0('0x86')){if(_0x0cd0('0x1e')!=typeof _0x1f23dd[_0x0cd0('0x79')]['views'][_0x0cd0('0x87')]){var _0x48b1d0=_0x1f23dd[_0x0cd0('0x79')][_0x0cd0('0x7a')][_0x0cd0('0x87')];if(!/^(f|ht)tps?:\/\//i['test'](_0x48b1d0)){_0x4316b6=path[_0x0cd0('0x5a')](_0x0cd0('0x88'),_0x4b0e70,_0x26cb31[0x0],_0x48b1d0);}else{_0x4316b6=_0x48b1d0;}}else{logger[_0x0cd0('0x63')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x1f23dd['parameters'][_0x0cd0('0x7a')]['agent']){var _0x2cf0d1=_0x1f23dd[_0x0cd0('0x79')][_0x0cd0('0x7a')][_0x0cd0('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x0cd0('0x89')](_0x2cf0d1)){_0x31045f=path['join'](_0x0cd0('0x88'),_0x4b0e70,_0x26cb31[0x0],_0x2cf0d1);}else{_0x31045f=_0x2cf0d1;}}else{logger['info'](_0x0cd0('0x8a'));}}else if(_0x53c198===_0x0cd0('0x7d')){_0x3a352a=_0x1f23dd[_0x0cd0('0x79')][_0x0cd0('0x7e')];_0x32352e=_0x1f23dd[_0x0cd0('0x79')][_0x0cd0('0x80')];if('undefined'!=typeof _0x1f23dd['parameters']['views']){if(_0x0cd0('0x1e')!=typeof _0x1f23dd[_0x0cd0('0x79')][_0x0cd0('0x7a')][_0x0cd0('0x87')]){var _0x48b1d0=_0x1f23dd[_0x0cd0('0x79')][_0x0cd0('0x7a')][_0x0cd0('0x87')];if(!/^(f|ht)tps?:\/\//i['test'](_0x48b1d0)){_0x4316b6=path['join'](_0x0cd0('0x88'),_0x4b0e70,_0x26cb31[0x0],_0x48b1d0);}else{_0x4316b6=_0x48b1d0;}}if(_0x0cd0('0x1e')!=typeof _0x1f23dd[_0x0cd0('0x79')]['views'][_0x0cd0('0x7c')]){var _0x2cf0d1=_0x1f23dd['parameters'][_0x0cd0('0x7a')][_0x0cd0('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x0cd0('0x89')](_0x2cf0d1)){_0x31045f=path['join'](_0x0cd0('0x88'),_0x4b0e70,_0x26cb31[0x0],_0x2cf0d1);}else{_0x31045f=_0x2cf0d1;}}}}var _0x5a663f={'name':_0xbac81,'description':_0x14f037,'path':path[_0x0cd0('0x5a')](_0x4b0e70,_0x26cb31[0x0]),'type':_0x53c198,'sidebar':_0x23a6eb,'icon':_0x312a4b,'adminUrl':_0x4316b6,'agentUrl':_0x31045f,'scriptName':_0x3a352a,'scriptPath':_0x32352e,'version':_0x35f434};removeReferences(_0x2e3d4f,null);return db[_0x0cd0('0x32')][_0x0cd0('0x8b')](_0x5a663f)[_0x0cd0('0x28')](function(_0x3d4d33){var _0x42cbf5={'role':_0x2d3df8[_0x0cd0('0x8c')][_0x0cd0('0x8d')],'userProfileId':_0x2d3df8[_0x0cd0('0x8c')][_0x0cd0('0x8e')]};if(!_0x42cbf5)throw new Error(_0x0cd0('0x8f'));if(_0x42cbf5[_0x0cd0('0x8d')]===_0x0cd0('0x90')){var _0x449289=_0x3d4d33[_0x0cd0('0x29')]({'plain':!![]});return db[_0x0cd0('0x91')]['find']({'where':{'name':_0x0cd0('0x2a'),'userProfileId':_0x42cbf5['userProfileId']},'raw':!![]})[_0x0cd0('0x28')](function(_0x2ab46a){if(_0x2ab46a&&_0x2ab46a[_0x0cd0('0x92')]===0x0){return db[_0x0cd0('0x2b')][_0x0cd0('0x8b')]({'name':_0x449289[_0x0cd0('0x2f')],'resourceId':_0x449289['id'],'type':_0x2ab46a[_0x0cd0('0x2f')],'sectionId':_0x2ab46a['id']},{})[_0x0cd0('0x28')](function(){return _0x3d4d33;});}else{return _0x3d4d33;}})[_0x0cd0('0x45')](function(_0x294cf9){logger[_0x0cd0('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x294cf9);throw _0x294cf9;});}return _0x3d4d33;})[_0x0cd0('0x28')](respondWithResult(_0x1fea8f,null))['catch'](handleError(_0x1fea8f,null));}});}catch(_0x91c53e){_0x1fea8f[_0x0cd0('0x21')](0x1f4)[_0x0cd0('0x30')](_0x91c53e);}};function removeReferences(_0x10586f,_0x307580){try{if(_0x10586f){fs['unlinkSync'](_0x10586f);logger[_0x0cd0('0x63')](_0x0cd0('0x93'));}if(_0x307580){rimraf(_0x307580,function(){});logger[_0x0cd0('0x63')](_0x0cd0('0x94'));}}catch(_0xf0eadf){logger[_0x0cd0('0x2e')](_0xf0eadf);}}exports[_0x0cd0('0x27')]=function(_0x1de4a9,_0x57e6b2,_0x319dfe){return db[_0x0cd0('0x32')][_0x0cd0('0x4a')]({'where':{'id':_0x1de4a9['params']['id']}})[_0x0cd0('0x28')](handleEntityNotFound(_0x57e6b2,null))['then'](saveUpdates(_0x1de4a9['body'],null))['then'](respondWithResult(_0x57e6b2,null))[_0x0cd0('0x45')](handleError(_0x57e6b2,null));};exports[_0x0cd0('0x95')]=function(_0x22ae1d,_0x3919a1,_0x33ffb5){return db[_0x0cd0('0x32')]['find']({'where':{'id':_0x22ae1d[_0x0cd0('0x46')]['id']}})[_0x0cd0('0x28')](function(_0x4c3fdd){if(_0x4c3fdd){return _0x4c3fdd['destroy']();}})['then'](function(_0x898726){rimraf(path['join'](config[_0x0cd0('0x4c')],'server/files/plugins',path[_0x0cd0('0x5b')](_0x898726[_0x0cd0('0x5')])),function(){});return _0x898726;})['then'](handleEntityNotFound(_0x3919a1,null))[_0x0cd0('0x28')](respondWithStatusCode(_0x3919a1,null))[_0x0cd0('0x45')](handleError(_0x3919a1,null));};exports['webhookGet']=function(_0xa8ab35,_0x3fe8ef,_0x2c6fd6){return BPromise[_0x0cd0('0x96')]()[_0x0cd0('0x28')](function(){if(!_0xa8ab35[_0x0cd0('0x36')][_0x0cd0('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xa8ab35[_0x0cd0('0x36')][_0x0cd0('0x97')]){throw new Error(_0x0cd0('0x98'));}var _0x52e940=_0xa8ab35['query']['hostname']?_0xa8ab35[_0x0cd0('0x36')][_0x0cd0('0x99')]+':'+_0xa8ab35[_0x0cd0('0x36')][_0x0cd0('0x97')]:_0x0cd0('0x9a')+_0xa8ab35['query'][_0x0cd0('0x97')];var _0x59a49c=_0xa8ab35[_0x0cd0('0x36')][_0x0cd0('0x24')]?_0xa8ab35[_0x0cd0('0x36')][_0x0cd0('0x24')]:!![];var _0x1b1779=_0xa8ab35[_0x0cd0('0x36')][_0x0cd0('0x9b')]?_0xa8ab35[_0x0cd0('0x36')]['encoding']:null;var _0x20e74a={'method':_0xa8ab35[_0x0cd0('0x9c')],'uri':util[_0x0cd0('0x61')](_0x0cd0('0x9d'),_0x52e940,_0xa8ab35['query']['path']),'json':_0x59a49c,'resolveWithFullResponse':!![],'encoding':_0x1b1779,'qs':_0xa8ab35[_0x0cd0('0x36')]};if(_0xa8ab35[_0x0cd0('0x9e')]){_0x20e74a[_0x0cd0('0x9e')]=_0xa8ab35[_0x0cd0('0x9e')];if(_0x20e74a[_0x0cd0('0x9e')][_0x0cd0('0x9f')]){delete _0x20e74a[_0x0cd0('0x9e')]['content-length'];}}if(_0x20e74a[_0x0cd0('0x9e')]['content-type']){delete _0x20e74a[_0x0cd0('0x9e')][_0x0cd0('0xa0')];}return rp(_0x20e74a);})[_0x0cd0('0x28')](function(_0x4d421d){if(_0x4d421d){_0x3fe8ef['set'](_0x4d421d[_0x0cd0('0x9e')]);logger[_0x0cd0('0x63')](_0x4d421d[_0x0cd0('0x8c')]);if(_[_0x0cd0('0xa1')](_0xa8ab35[_0x0cd0('0x36')][_0x0cd0('0x5')],_0x0cd0('0x4b'))&&_0x4d421d[_0x0cd0('0xa2')]==0x1f4){return _0x3fe8ef['sendStatus'](_0x4d421d[_0x0cd0('0xa2')]);}else{return _0x3fe8ef[_0x0cd0('0x21')](_0x4d421d[_0x0cd0('0xa2')])[_0x0cd0('0x30')](_0x4d421d[_0x0cd0('0x8c')]);}}else{return _0x3fe8ef[_0x0cd0('0x2d')](0xc8);}})[_0x0cd0('0x45')](handleError(_0x3fe8ef,null));};exports['webhookPost']=function(_0x31026e,_0x14fa19,_0x33f228){return BPromise[_0x0cd0('0x96')]()[_0x0cd0('0x28')](function(){if(!_0x31026e[_0x0cd0('0x36')]['path']){throw new Error(_0x0cd0('0xa3'));}if(!_0x31026e[_0x0cd0('0x36')][_0x0cd0('0x97')]){throw new Error(_0x0cd0('0x98'));}var _0x231060=_0x31026e[_0x0cd0('0x36')][_0x0cd0('0x99')]?_0x31026e[_0x0cd0('0x36')]['hostname']+':'+_0x31026e[_0x0cd0('0x36')][_0x0cd0('0x97')]:'http://localhost:'+_0x31026e['query'][_0x0cd0('0x97')];var _0x59e0eb=_0x31026e[_0x0cd0('0x36')][_0x0cd0('0x24')]?_0x31026e['query'][_0x0cd0('0x24')]:!![];var _0x4519e2=_0x31026e['query'][_0x0cd0('0x9b')]?_0x31026e[_0x0cd0('0x36')][_0x0cd0('0x9b')]:null;var _0x39e320={'method':_0x31026e['method'],'uri':util[_0x0cd0('0x61')](_0x0cd0('0x9d'),_0x231060,_0x31026e[_0x0cd0('0x36')][_0x0cd0('0x5')]),'json':_0x59e0eb,'resolveWithFullResponse':!![],'encoding':_0x4519e2,'body':_0x31026e[_0x0cd0('0x8c')]};if(_0x31026e[_0x0cd0('0x9e')]){_0x39e320['headers']=_0x31026e[_0x0cd0('0x9e')];if(_0x39e320[_0x0cd0('0x9e')]['content-length']){delete _0x39e320['headers'][_0x0cd0('0x9f')];}}if(_0x39e320[_0x0cd0('0x9e')]['content-type']){delete _0x39e320[_0x0cd0('0x9e')]['content-type'];}return rp(_0x39e320);})[_0x0cd0('0x28')](function(_0x238ec9){if(_0x238ec9){_0x14fa19['set'](_0x238ec9[_0x0cd0('0x9e')]);logger[_0x0cd0('0x63')](_0x238ec9['body']);return _0x14fa19[_0x0cd0('0x21')](_0x238ec9[_0x0cd0('0xa2')])[_0x0cd0('0x30')](_0x238ec9[_0x0cd0('0x8c')]);}else{return _0x14fa19[_0x0cd0('0x2d')](0xc8);}})[_0x0cd0('0x45')](handleError(_0x14fa19,null));}; \ No newline at end of file +var _0xdbd0=['root','server/files/plugins','format','%s.zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','basename','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','extract-zip','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','map','Plugin','rawAttributes','fieldName','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','intersection','find','download','params','join'];(function(_0x3661c1,_0x51a1c1){var _0x25c1da=function(_0x3df97e){while(--_0x3df97e){_0x3661c1['push'](_0x3661c1['shift']());}};_0x25c1da(++_0x51a1c1);}(_0xdbd0,0x108));var _0x0dbd=function(_0x3960d8,_0x4380c4){_0x3960d8=_0x3960d8-0x0;var _0x197fc3=_0xdbd0[_0x3960d8];return _0x197fc3;};'use strict';var emlformat=require(_0x0dbd('0x0'));var rimraf=require(_0x0dbd('0x1'));var zipdir=require(_0x0dbd('0x2'));var jsonpatch=require(_0x0dbd('0x3'));var rp=require(_0x0dbd('0x4'));var moment=require(_0x0dbd('0x5'));var BPromise=require(_0x0dbd('0x6'));var Mustache=require(_0x0dbd('0x7'));var util=require('util');var path=require(_0x0dbd('0x8'));var sox=require(_0x0dbd('0x9'));var csv=require(_0x0dbd('0xa'));var ejs=require(_0x0dbd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0dbd('0xc'));var crypto=require(_0x0dbd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0dbd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0dbd('0xf'));var Papa=require(_0x0dbd('0x10'));var extract=require(_0x0dbd('0x11'));var rimraf=require(_0x0dbd('0x1'));var archiver=require('archiver');var Redis=require(_0x0dbd('0x12'));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(_0x0dbd('0x13'))(_0x0dbd('0x14'));var utils=require(_0x0dbd('0x15'));var config=require(_0x0dbd('0x16'));var licenseUtil=require(_0x0dbd('0x17'));var db=require(_0x0dbd('0x18'))['db'];config[_0x0dbd('0x19')]=_[_0x0dbd('0x1a')](config[_0x0dbd('0x19')],{'host':_0x0dbd('0x1b'),'port':0x18eb});var socket=require(_0x0dbd('0x1c'))(new Redis(config[_0x0dbd('0x19')]));require(_0x0dbd('0x1d'))[_0x0dbd('0x1e')](socket);function respondWithStatusCode(_0x2a1b52,_0x147281){_0x147281=_0x147281||0xcc;return function(_0x41b7fe){if(_0x41b7fe){return _0x2a1b52[_0x0dbd('0x1f')](_0x147281);}return _0x2a1b52['status'](_0x147281)[_0x0dbd('0x20')]();};}function respondWithResult(_0x448eaf,_0x59423b){_0x59423b=_0x59423b||0xc8;return function(_0x5b3fef){if(_0x5b3fef){return _0x448eaf[_0x0dbd('0x21')](_0x59423b)[_0x0dbd('0x22')](_0x5b3fef);}};}function respondWithFilteredResult(_0x384e7e,_0x5581fd){return function(_0x1ec793){if(_0x1ec793){var _0xe5a8fc=typeof _0x5581fd['offset']===_0x0dbd('0x23')&&typeof _0x5581fd[_0x0dbd('0x24')]===_0x0dbd('0x23');var _0x592880=_0x1ec793[_0x0dbd('0x25')];var _0x4cf546=_0xe5a8fc?0x0:_0x5581fd[_0x0dbd('0x26')];var _0x59eb28=_0xe5a8fc?_0x1ec793['count']:_0x5581fd[_0x0dbd('0x26')]+_0x5581fd[_0x0dbd('0x24')];var _0x221852;if(_0x59eb28>=_0x592880){_0x59eb28=_0x592880;_0x221852=0xc8;}else{_0x221852=0xce;}_0x384e7e[_0x0dbd('0x21')](_0x221852);return _0x384e7e['set'](_0x0dbd('0x27'),_0x4cf546+'-'+_0x59eb28+'/'+_0x592880)[_0x0dbd('0x22')](_0x1ec793);}return null;};}function patchUpdates(_0x1486e3){return function(_0x5ab33c){try{jsonpatch['apply'](_0x5ab33c,_0x1486e3,!![]);}catch(_0x137500){return BPromise[_0x0dbd('0x28')](_0x137500);}return _0x5ab33c[_0x0dbd('0x29')]();};}function saveUpdates(_0x4d2d28,_0x1269bb){return function(_0x11621a){if(_0x11621a){return _0x11621a[_0x0dbd('0x2a')](_0x4d2d28)[_0x0dbd('0x2b')](function(_0x31bf2a){return _0x31bf2a;});}return null;};}function removeEntity(_0x6a0edf,_0x4bb810){return function(_0x463d78){if(_0x463d78){return _0x463d78[_0x0dbd('0x2c')]()[_0x0dbd('0x2b')](function(){var _0x136b6f=_0x463d78[_0x0dbd('0x2d')]({'plain':!![]});var _0x29a7ee=_0x0dbd('0x2e');return db[_0x0dbd('0x2f')][_0x0dbd('0x2c')]({'where':{'type':_0x29a7ee,'resourceId':_0x136b6f['id']}})['then'](function(){return _0x463d78;});})[_0x0dbd('0x2b')](function(){_0x6a0edf['status'](0xcc)[_0x0dbd('0x20')]();});}};}function handleEntityNotFound(_0x33ab57,_0x3a86dc){return function(_0xab6ca0){if(!_0xab6ca0){_0x33ab57['sendStatus'](0x194);}return _0xab6ca0;};}function handleError(_0x304351,_0x40ba4d){_0x40ba4d=_0x40ba4d||0x1f4;return function(_0x29703b){logger[_0x0dbd('0x30')](_0x29703b[_0x0dbd('0x31')]);if(_0x29703b[_0x0dbd('0x32')]){delete _0x29703b[_0x0dbd('0x32')];}_0x304351[_0x0dbd('0x21')](_0x40ba4d)[_0x0dbd('0x33')](_0x29703b);};}exports['index']=function(_0xf92503,_0x549cac){var _0x277562={},_0x509b0b={},_0x3d612a={'count':0x0,'rows':[]};var _0x60cad0=_[_0x0dbd('0x34')](db[_0x0dbd('0x35')][_0x0dbd('0x36')],function(_0x44c403){return{'name':_0x44c403[_0x0dbd('0x37')],'type':_0x44c403[_0x0dbd('0x38')][_0x0dbd('0x39')]};});_0x509b0b[_0x0dbd('0x3a')]=_['map'](_0x60cad0,_0x0dbd('0x32'));_0x509b0b[_0x0dbd('0x3b')]=_['keys'](_0xf92503[_0x0dbd('0x3b')]);_0x509b0b['filters']=_['intersection'](_0x509b0b[_0x0dbd('0x3a')],_0x509b0b[_0x0dbd('0x3b')]);_0x277562[_0x0dbd('0x3c')]=_['intersection'](_0x509b0b[_0x0dbd('0x3a')],qs[_0x0dbd('0x3d')](_0xf92503[_0x0dbd('0x3b')][_0x0dbd('0x3d')]));_0x277562[_0x0dbd('0x3c')]=_0x277562[_0x0dbd('0x3c')][_0x0dbd('0x3e')]?_0x277562[_0x0dbd('0x3c')]:_0x509b0b[_0x0dbd('0x3a')];if(!_0xf92503['query'][_0x0dbd('0x3f')](_0x0dbd('0x40'))){_0x277562[_0x0dbd('0x24')]=qs[_0x0dbd('0x24')](_0xf92503['query'][_0x0dbd('0x24')]);_0x277562[_0x0dbd('0x26')]=qs[_0x0dbd('0x26')](_0xf92503[_0x0dbd('0x3b')][_0x0dbd('0x26')]);}_0x277562[_0x0dbd('0x41')]=qs['sort'](_0xf92503[_0x0dbd('0x3b')][_0x0dbd('0x42')]);_0x277562[_0x0dbd('0x43')]=qs[_0x0dbd('0x44')](_['pick'](_0xf92503[_0x0dbd('0x3b')],_0x509b0b[_0x0dbd('0x44')]),_0x60cad0);if(_0xf92503['query'][_0x0dbd('0x45')]){_0x277562['where']=_[_0x0dbd('0x46')](_0x277562[_0x0dbd('0x43')],{'$or':_['map'](_0x60cad0,function(_0x400f93){if(_0x400f93['type']!==_0x0dbd('0x47')){var _0x161600={};_0x161600[_0x400f93['name']]={'$like':'%'+_0xf92503[_0x0dbd('0x3b')]['filter']+'%'};return _0x161600;}})});}_0x277562=_[_0x0dbd('0x46')]({},_0x277562,_0xf92503['options']);var _0x59cbae={'where':_0x277562[_0x0dbd('0x43')]};return db[_0x0dbd('0x35')][_0x0dbd('0x25')](_0x59cbae)['then'](function(_0x5e28ac){_0x3d612a[_0x0dbd('0x25')]=_0x5e28ac;if(_0xf92503[_0x0dbd('0x3b')][_0x0dbd('0x48')]){_0x277562[_0x0dbd('0x49')]=[{'all':!![]}];}return db['Plugin'][_0x0dbd('0x4a')](_0x277562);})['then'](function(_0x20953d){_0x3d612a[_0x0dbd('0x4b')]=_0x20953d;return _0x3d612a;})[_0x0dbd('0x2b')](respondWithFilteredResult(_0x549cac,_0x277562))[_0x0dbd('0x4c')](handleError(_0x549cac,null));};exports[_0x0dbd('0x4d')]=function(_0x188385,_0x2f54b4){var _0x466dec={'raw':!![],'where':{'id':_0x188385['params']['id']}},_0x1f2751={};_0x1f2751[_0x0dbd('0x3a')]=_[_0x0dbd('0x4e')](db[_0x0dbd('0x35')][_0x0dbd('0x36')]);_0x1f2751['query']=_[_0x0dbd('0x4e')](_0x188385[_0x0dbd('0x3b')]);_0x1f2751[_0x0dbd('0x44')]=_[_0x0dbd('0x4f')](_0x1f2751['model'],_0x1f2751[_0x0dbd('0x3b')]);_0x466dec['attributes']=_[_0x0dbd('0x4f')](_0x1f2751[_0x0dbd('0x3a')],qs[_0x0dbd('0x3d')](_0x188385[_0x0dbd('0x3b')][_0x0dbd('0x3d')]));_0x466dec[_0x0dbd('0x3c')]=_0x466dec[_0x0dbd('0x3c')][_0x0dbd('0x3e')]?_0x466dec[_0x0dbd('0x3c')]:_0x1f2751[_0x0dbd('0x3a')];if(_0x188385[_0x0dbd('0x3b')]['includeAll']){_0x466dec[_0x0dbd('0x49')]=[{'all':!![]}];}_0x466dec=_[_0x0dbd('0x46')]({},_0x466dec,_0x188385['options']);return db[_0x0dbd('0x35')][_0x0dbd('0x50')](_0x466dec)['then'](handleEntityNotFound(_0x2f54b4,null))[_0x0dbd('0x2b')](respondWithResult(_0x2f54b4,null))[_0x0dbd('0x4c')](handleError(_0x2f54b4,null));};exports[_0x0dbd('0x51')]=function(_0x3137cf,_0x42fac1,_0x1af669){return db[_0x0dbd('0x35')][_0x0dbd('0x50')]({'where':{'id':_0x3137cf[_0x0dbd('0x52')]['id']},'attributes':['name','path'],'raw':!![]})[_0x0dbd('0x2b')](handleEntityNotFound(_0x42fac1,null))[_0x0dbd('0x2b')](function(_0x48245f){if(_0x48245f){var _0x29f93c=path[_0x0dbd('0x53')](config[_0x0dbd('0x54')],_0x0dbd('0x55'),util[_0x0dbd('0x56')](_0x0dbd('0x57'),path['basename'](_0x48245f[_0x0dbd('0x8')])));var _0x321480=fs['createWriteStream'](_0x29f93c);var _0x556666=archiver('zip',{'zlib':{'level':0x9}});_0x556666['on'](_0x0dbd('0x58'),function(_0x43a1e7){if(_0x43a1e7[_0x0dbd('0x59')]==='ENOENT'){logger[_0x0dbd('0x30')](_0x43a1e7);}else{throw new db[(_0x0dbd('0x5a'))][(_0x0dbd('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x556666['on'](_0x0dbd('0x30'),function(_0x2b04b9){throw new db[(_0x0dbd('0x5a'))]['Error'](_0x0dbd('0x5c'));});_0x556666[_0x0dbd('0x5d')](_0x321480);_0x556666[_0x0dbd('0x5e')](_0x0dbd('0x5f'),{'cwd':path[_0x0dbd('0x53')](config['root'],_0x0dbd('0x55'),path[_0x0dbd('0x60')](_0x48245f['path'])),'ignore':[path[_0x0dbd('0x53')](path[_0x0dbd('0x61')](_0x48245f['path']),_0x0dbd('0x62')),path[_0x0dbd('0x53')](path['basename'](_0x48245f[_0x0dbd('0x8')]),_0x0dbd('0x63'))],'nodir':!![]})['finalize']();_0x321480['on'](_0x0dbd('0x64'),function(){if(!fs[_0x0dbd('0x65')](_0x29f93c)){throw new db[(_0x0dbd('0x5a'))][(_0x0dbd('0x5b'))](_0x0dbd('0x66'));}return _0x42fac1['download'](_0x29f93c,util['format'](_0x0dbd('0x57'),path[_0x0dbd('0x61')](_0x48245f[_0x0dbd('0x8')])),function(_0x4e038e){if(_0x4e038e){throw new db[(_0x0dbd('0x5a'))][(_0x0dbd('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x0dbd('0x67')](_0x29f93c);logger[_0x0dbd('0x68')]('Download\x20completed');logger[_0x0dbd('0x68')](_0x0dbd('0x69'));});});}return null;})[_0x0dbd('0x4c')](handleError(_0x42fac1,null));};exports[_0x0dbd('0x6a')]=function(_0x33df32,_0x554f8a,_0x1d6fad){var _0x20902e=path[_0x0dbd('0x61')](_0x33df32[_0x0dbd('0x6b')][_0x0dbd('0x6c')],path[_0x0dbd('0x6d')](_0x33df32['file'][_0x0dbd('0x6c')]));var _0x57b485=path['join'](config[_0x0dbd('0x54')],'server/files/plugins',_0x33df32[_0x0dbd('0x6b')][_0x0dbd('0x6c')]);var _0x51474a=path[_0x0dbd('0x53')](config[_0x0dbd('0x54')],_0x0dbd('0x55'),_0x20902e);logger[_0x0dbd('0x68')]('Plugin\x20upload\x20filepath:\x20%s',_0x57b485);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0x51474a);try{fs[_0x0dbd('0x6e')](_0x57b485,parseInt(_0x0dbd('0x6f'),0x8));extract(_0x57b485,{'dir':_0x51474a},function(_0x79941){if(_0x79941){logger[_0x0dbd('0x30')](_0x79941);handleError(_0x79941,!![]);};var _0x1f06ba=fs[_0x0dbd('0x70')](_0x51474a);if(_0x1f06ba[_0x0dbd('0x3e')]>0x1){removeReferences(_0x57b485,_0x51474a);logger[_0x0dbd('0x30')](_0x0dbd('0x71'));return _0x1d6fad(new Error('Invalid\x20plugin\x20structure'));}var _0x5b9ccc=fs['lstatSync'](path[_0x0dbd('0x53')](_0x51474a,_0x1f06ba[0x0]));if(_0x5b9ccc[_0x0dbd('0x72')]()){removeReferences(_0x57b485,_0x51474a);logger[_0x0dbd('0x30')](_0x0dbd('0x71'));return _0x1d6fad(new Error(_0x0dbd('0x71')));}if(_0x5b9ccc[_0x0dbd('0x73')]()){var _0x3528e1=fs[_0x0dbd('0x70')](path[_0x0dbd('0x53')](_0x51474a,_0x1f06ba[0x0]));if(_0x3528e1[_0x0dbd('0x3e')]===0x0){removeReferences(_0x57b485,_0x51474a);logger[_0x0dbd('0x30')]('Invalid\x20plugin\x20structure');return _0x1d6fad(new Error(_0x0dbd('0x71')));}var _0x5c11ee=_0x3528e1[_0x0dbd('0x74')](function(_0x4c0a54){return _0x4c0a54===_0x0dbd('0x75');});if(!_0x5c11ee){return _0x1d6fad(new Error(_0x0dbd('0x76')));}var _0x32be66=fs[_0x0dbd('0x77')](path[_0x0dbd('0x53')](_0x51474a,_0x1f06ba[0x0],_0x0dbd('0x75')));var _0x3abe81=JSON[_0x0dbd('0x78')](_0x32be66);if(_0x0dbd('0x23')==typeof _0x3abe81[_0x0dbd('0x32')]){return _0x1d6fad(new Error(_0x0dbd('0x79')));}if(_0x0dbd('0x23')==typeof _0x3abe81[_0x0dbd('0x38')]){return _0x1d6fad(new Error(_0x0dbd('0x7a')));}if(_0x0dbd('0x23')==typeof _0x3abe81[_0x0dbd('0x7b')]){return _0x1d6fad(new Error(_0x0dbd('0x7c')));}if(_0x0dbd('0x23')==typeof _0x3abe81[_0x0dbd('0x7d')]){return _0x1d6fad(new Error(_0x0dbd('0x7e')));}if(_0x3abe81[_0x0dbd('0x38')]==='html'){if('undefined'==typeof _0x3abe81[_0x0dbd('0x7d')][_0x0dbd('0x7f')]){return _0x1d6fad(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x3abe81[_0x0dbd('0x7d')]['views'][_0x0dbd('0x80')]&&'undefined'==typeof _0x3abe81[_0x0dbd('0x7d')][_0x0dbd('0x7f')][_0x0dbd('0x81')]){return _0x1d6fad(new Error(_0x0dbd('0x82')));}}else if(_0x3abe81[_0x0dbd('0x38')]===_0x0dbd('0x83')){if(_0x0dbd('0x23')==typeof _0x3abe81[_0x0dbd('0x7d')][_0x0dbd('0x84')]){return _0x1d6fad(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x0dbd('0x23')==typeof _0x3abe81[_0x0dbd('0x7d')]['scriptPath']){return _0x1d6fad(new Error(_0x0dbd('0x85')));}}else{return _0x1d6fad(new Error(_0x0dbd('0x86')));}var _0x1f9b87=_0x3abe81[_0x0dbd('0x32')];var _0x2bfbaf=_0x3abe81[_0x0dbd('0x87')];var _0x5c3fd8=_0x3abe81[_0x0dbd('0x38')];var _0x7edb75=_0x3abe81[_0x0dbd('0x88')]?_0x3abe81['sidebar']:'always';var _0x1f149e=_0x3abe81[_0x0dbd('0x89')]?_0x3abe81['icon']:_0x0dbd('0x8a');var _0x23bead='';var _0x436bae='';var _0x3ac7a2='';var _0x3b39e7='';var _0x17447b=_0x3abe81[_0x0dbd('0x7b')];if(_0x5c3fd8===_0x0dbd('0x8b')){if(_0x0dbd('0x23')!=typeof _0x3abe81['parameters'][_0x0dbd('0x7f')][_0x0dbd('0x80')]){var _0x3bb2ff=_0x3abe81[_0x0dbd('0x7d')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x0dbd('0x8c')](_0x3bb2ff)){_0x23bead=path[_0x0dbd('0x53')](_0x0dbd('0x8d'),_0x20902e,_0x1f06ba[0x0],_0x3bb2ff);}else{_0x23bead=_0x3bb2ff;}}else{logger[_0x0dbd('0x68')](_0x0dbd('0x8e'));}if(_0x0dbd('0x23')!=typeof _0x3abe81[_0x0dbd('0x7d')][_0x0dbd('0x7f')][_0x0dbd('0x81')]){var _0x44379a=_0x3abe81['parameters']['views']['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x44379a)){_0x436bae=path[_0x0dbd('0x53')](_0x0dbd('0x8d'),_0x20902e,_0x1f06ba[0x0],_0x44379a);}else{_0x436bae=_0x44379a;}}else{logger[_0x0dbd('0x68')](_0x0dbd('0x8f'));}}else if(_0x5c3fd8==='script'){_0x3ac7a2=_0x3abe81[_0x0dbd('0x7d')]['scriptName'];_0x3b39e7=_0x3abe81[_0x0dbd('0x7d')][_0x0dbd('0x90')];if('undefined'!=typeof _0x3abe81[_0x0dbd('0x7d')]['views']){if(_0x0dbd('0x23')!=typeof _0x3abe81[_0x0dbd('0x7d')][_0x0dbd('0x7f')]['admin']){var _0x3bb2ff=_0x3abe81[_0x0dbd('0x7d')][_0x0dbd('0x7f')][_0x0dbd('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x0dbd('0x8c')](_0x3bb2ff)){_0x23bead=path[_0x0dbd('0x53')](_0x0dbd('0x8d'),_0x20902e,_0x1f06ba[0x0],_0x3bb2ff);}else{_0x23bead=_0x3bb2ff;}}if('undefined'!=typeof _0x3abe81['parameters']['views'][_0x0dbd('0x81')]){var _0x44379a=_0x3abe81[_0x0dbd('0x7d')]['views'][_0x0dbd('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x44379a)){_0x436bae=path[_0x0dbd('0x53')](_0x0dbd('0x8d'),_0x20902e,_0x1f06ba[0x0],_0x44379a);}else{_0x436bae=_0x44379a;}}}}var _0x2f75fc={'name':_0x1f9b87,'description':_0x2bfbaf,'path':path[_0x0dbd('0x53')](_0x20902e,_0x1f06ba[0x0]),'type':_0x5c3fd8,'sidebar':_0x7edb75,'icon':_0x1f149e,'adminUrl':_0x23bead,'agentUrl':_0x436bae,'scriptName':_0x3ac7a2,'scriptPath':_0x3b39e7,'version':_0x17447b};removeReferences(_0x57b485,null);return db[_0x0dbd('0x35')][_0x0dbd('0x91')](_0x2f75fc)[_0x0dbd('0x2b')](function(_0x4a08c9){var _0x1b3c12={'role':_0x33df32[_0x0dbd('0x92')][_0x0dbd('0x93')],'userProfileId':_0x33df32[_0x0dbd('0x92')][_0x0dbd('0x94')]};if(!_0x1b3c12)throw new Error(_0x0dbd('0x95'));if(_0x1b3c12[_0x0dbd('0x93')]===_0x0dbd('0x96')){var _0x2cf726=_0x4a08c9['get']({'plain':!![]});return db[_0x0dbd('0x97')]['find']({'where':{'name':'Plugins','userProfileId':_0x1b3c12[_0x0dbd('0x94')]},'raw':!![]})[_0x0dbd('0x2b')](function(_0x190013){if(_0x190013&&_0x190013[_0x0dbd('0x98')]===0x0){return db[_0x0dbd('0x2f')]['create']({'name':_0x2cf726['name'],'resourceId':_0x2cf726['id'],'type':_0x190013['name'],'sectionId':_0x190013['id']},{})[_0x0dbd('0x2b')](function(){return _0x4a08c9;});}else{return _0x4a08c9;}})['catch'](function(_0x547284){logger[_0x0dbd('0x30')](_0x0dbd('0x99'),_0x547284);throw _0x547284;});}return _0x4a08c9;})[_0x0dbd('0x2b')](respondWithResult(_0x554f8a,null))[_0x0dbd('0x4c')](handleError(_0x554f8a,null));}});}catch(_0x205e9e){_0x554f8a['status'](0x1f4)[_0x0dbd('0x33')](_0x205e9e);}};function removeReferences(_0x126240,_0x11cfdb){try{if(_0x126240){fs[_0x0dbd('0x67')](_0x126240);logger[_0x0dbd('0x68')](_0x0dbd('0x9a'));}if(_0x11cfdb){rimraf(_0x11cfdb,function(){});logger[_0x0dbd('0x68')](_0x0dbd('0x9b'));}}catch(_0x3a92c4){logger[_0x0dbd('0x30')](_0x3a92c4);}}exports[_0x0dbd('0x2a')]=function(_0x59c7d9,_0x25747e,_0x328462){return db[_0x0dbd('0x35')][_0x0dbd('0x50')]({'where':{'id':_0x59c7d9['params']['id']}})[_0x0dbd('0x2b')](handleEntityNotFound(_0x25747e,null))[_0x0dbd('0x2b')](saveUpdates(_0x59c7d9[_0x0dbd('0x92')],null))[_0x0dbd('0x2b')](respondWithResult(_0x25747e,null))[_0x0dbd('0x4c')](handleError(_0x25747e,null));};exports[_0x0dbd('0x9c')]=function(_0x4fe519,_0x219a43,_0x324e8a){return db['Plugin'][_0x0dbd('0x50')]({'where':{'id':_0x4fe519[_0x0dbd('0x52')]['id']}})[_0x0dbd('0x2b')](function(_0x294c4b){if(_0x294c4b){return _0x294c4b[_0x0dbd('0x2c')]();}})['then'](function(_0x3791b2){rimraf(path[_0x0dbd('0x53')](config[_0x0dbd('0x54')],_0x0dbd('0x55'),path['dirname'](_0x3791b2[_0x0dbd('0x8')])),function(){});return _0x3791b2;})[_0x0dbd('0x2b')](handleEntityNotFound(_0x219a43,null))[_0x0dbd('0x2b')](respondWithStatusCode(_0x219a43,null))[_0x0dbd('0x4c')](handleError(_0x219a43,null));};exports[_0x0dbd('0x9d')]=function(_0x18e2cf,_0x4fdd4f,_0x2367f2){return BPromise[_0x0dbd('0x9e')]()['then'](function(){if(!_0x18e2cf[_0x0dbd('0x3b')][_0x0dbd('0x8')]){throw new Error(_0x0dbd('0x9f'));}if(!_0x18e2cf['query'][_0x0dbd('0xa0')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2ef70d=_0x18e2cf[_0x0dbd('0x3b')][_0x0dbd('0xa1')]?_0x18e2cf[_0x0dbd('0x3b')][_0x0dbd('0xa1')]+':'+_0x18e2cf[_0x0dbd('0x3b')][_0x0dbd('0xa0')]:_0x0dbd('0xa2')+_0x18e2cf['query']['port'];var _0x33a882=_0x18e2cf['query'][_0x0dbd('0x22')]?_0x18e2cf[_0x0dbd('0x3b')]['json']:!![];var _0x10a808=_0x18e2cf[_0x0dbd('0x3b')][_0x0dbd('0xa3')]?_0x18e2cf['query'][_0x0dbd('0xa3')]:null;var _0x6975f9={'method':_0x18e2cf[_0x0dbd('0xa4')],'uri':util[_0x0dbd('0x56')](_0x0dbd('0xa5'),_0x2ef70d,_0x18e2cf['query'][_0x0dbd('0x8')]),'json':_0x33a882,'resolveWithFullResponse':!![],'encoding':_0x10a808,'qs':_0x18e2cf[_0x0dbd('0x3b')]};if(_0x18e2cf[_0x0dbd('0xa6')]){_0x6975f9[_0x0dbd('0xa6')]=_0x18e2cf[_0x0dbd('0xa6')];if(_0x6975f9['headers']['content-length']){delete _0x6975f9[_0x0dbd('0xa6')][_0x0dbd('0xa7')];}}if(_0x6975f9[_0x0dbd('0xa6')][_0x0dbd('0xa8')]){delete _0x6975f9[_0x0dbd('0xa6')][_0x0dbd('0xa8')];}return rp(_0x6975f9);})[_0x0dbd('0x2b')](function(_0x422fd1){if(_0x422fd1){_0x4fdd4f[_0x0dbd('0xa9')](_0x422fd1[_0x0dbd('0xa6')]);logger[_0x0dbd('0x68')](_0x422fd1[_0x0dbd('0x92')]);if(_[_0x0dbd('0xaa')](_0x18e2cf[_0x0dbd('0x3b')][_0x0dbd('0x8')],_0x0dbd('0x51'))&&_0x422fd1['statusCode']==0x1f4){return _0x4fdd4f[_0x0dbd('0x1f')](_0x422fd1[_0x0dbd('0xab')]);}else{return _0x4fdd4f[_0x0dbd('0x21')](_0x422fd1[_0x0dbd('0xab')])[_0x0dbd('0x33')](_0x422fd1[_0x0dbd('0x92')]);}}else{return _0x4fdd4f['sendStatus'](0xc8);}})[_0x0dbd('0x4c')](handleError(_0x4fdd4f,null));};exports[_0x0dbd('0xac')]=function(_0x45ec86,_0x5b1cd8,_0x907f8d){return BPromise[_0x0dbd('0x9e')]()[_0x0dbd('0x2b')](function(){if(!_0x45ec86['query'][_0x0dbd('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x45ec86['query'][_0x0dbd('0xa0')]){throw new Error(_0x0dbd('0xad'));}var _0x4dadbe=_0x45ec86['query'][_0x0dbd('0xa1')]?_0x45ec86[_0x0dbd('0x3b')]['hostname']+':'+_0x45ec86[_0x0dbd('0x3b')]['port']:'http://localhost:'+_0x45ec86[_0x0dbd('0x3b')][_0x0dbd('0xa0')];var _0x5520d3=_0x45ec86[_0x0dbd('0x3b')][_0x0dbd('0x22')]?_0x45ec86[_0x0dbd('0x3b')]['json']:!![];var _0x2fb7ac=_0x45ec86['query'][_0x0dbd('0xa3')]?_0x45ec86[_0x0dbd('0x3b')]['encoding']:null;var _0x4d665e={'method':_0x45ec86['method'],'uri':util['format'](_0x0dbd('0xa5'),_0x4dadbe,_0x45ec86['query']['path']),'json':_0x5520d3,'resolveWithFullResponse':!![],'encoding':_0x2fb7ac,'body':_0x45ec86[_0x0dbd('0x92')]};if(_0x45ec86[_0x0dbd('0xa6')]){_0x4d665e[_0x0dbd('0xa6')]=_0x45ec86[_0x0dbd('0xa6')];if(_0x4d665e[_0x0dbd('0xa6')][_0x0dbd('0xa7')]){delete _0x4d665e[_0x0dbd('0xa6')][_0x0dbd('0xa7')];}}if(_0x4d665e[_0x0dbd('0xa6')]['content-type']){delete _0x4d665e['headers'][_0x0dbd('0xa8')];}return rp(_0x4d665e);})[_0x0dbd('0x2b')](function(_0x57df37){if(_0x57df37){_0x5b1cd8[_0x0dbd('0xa9')](_0x57df37[_0x0dbd('0xa6')]);logger[_0x0dbd('0x68')](_0x57df37[_0x0dbd('0x92')]);return _0x5b1cd8['status'](_0x57df37['statusCode'])[_0x0dbd('0x33')](_0x57df37['body']);}else{return _0x5b1cd8[_0x0dbd('0x1f')](0xc8);}})[_0x0dbd('0x4c')](handleError(_0x5b1cd8,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 0230591..693e13f 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 _0x49df=['hook','exports','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x40403d,_0x58deeb){var _0x13c2fa=function(_0x407748){while(--_0x407748){_0x40403d['push'](_0x40403d['shift']());}};_0x13c2fa(++_0x58deeb);}(_0x49df,0xad));var _0xf49d=function(_0x2db055,_0x5bde11){_0x2db055=_0x2db055-0x0;var _0xb2f3a4=_0x49df[_0x2db055];return _0xb2f3a4;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0xf49d('0x0')];var PluginEvents=new EventEmitter();PluginEvents[_0xf49d('0x1')](0x0);var events={'afterCreate':_0xf49d('0x2'),'afterUpdate':_0xf49d('0x3'),'afterDestroy':_0xf49d('0x4')};function emitEvent(_0x1ff84c){return function(_0x44b37e,_0x59cb9d,_0x4c519f){PluginEvents[_0xf49d('0x5')](_0x1ff84c+':'+_0x44b37e['id'],_0x44b37e);PluginEvents[_0xf49d('0x5')](_0x1ff84c,_0x44b37e);_0x4c519f(null);};}for(var e in events){if(events[_0xf49d('0x6')](e)){var event=events[e];Plugin[_0xf49d('0x7')](e,emitEvent(event));}}module[_0xf49d('0x8')]=PluginEvents; \ No newline at end of file +var _0x3714=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x19b725,_0x6bfa2d){var _0x48377d=function(_0x2009a0){while(--_0x2009a0){_0x19b725['push'](_0x19b725['shift']());}};_0x48377d(++_0x6bfa2d);}(_0x3714,0x95));var _0x4371=function(_0xbf8ee7,_0x2f80be){_0xbf8ee7=_0xbf8ee7-0x0;var _0x29f626=_0x3714[_0xbf8ee7];return _0x29f626;};'use strict';var EventEmitter=require(_0x4371('0x0'));var Plugin=require(_0x4371('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x4371('0x2')](0x0);var events={'afterCreate':_0x4371('0x3'),'afterUpdate':_0x4371('0x4'),'afterDestroy':'remove'};function emitEvent(_0x21bccf){return function(_0x20929e,_0x2c0435,_0x5a2ffa){PluginEvents[_0x4371('0x5')](_0x21bccf+':'+_0x20929e['id'],_0x20929e);PluginEvents['emit'](_0x21bccf,_0x20929e);_0x5a2ffa(null);};}for(var e in events){if(events[_0x4371('0x6')](e)){var event=events[e];Plugin[_0x4371('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 84b4b62..8c9d39d 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 _0xe3c5=['define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./plugin.attributes','exports'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xe3c5,0x17d));var _0x5e3c=function(_0x507403,_0x3f954d){_0x507403=_0x507403-0x0;var _0x1327c=_0xe3c5[_0x507403];return _0x1327c;};'use strict';var _=require(_0x5e3c('0x0'));var util=require(_0x5e3c('0x1'));var logger=require(_0x5e3c('0x2'))(_0x5e3c('0x3'));var moment=require(_0x5e3c('0x4'));var BPromise=require(_0x5e3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e3c('0x6'));var rimraf=require(_0x5e3c('0x7'));var config=require(_0x5e3c('0x8'));var attributes=require(_0x5e3c('0x9'));module[_0x5e3c('0xa')]=function(_0x31a878,_0x1e631d){return _0x31a878[_0x5e3c('0xb')](_0x5e3c('0xc'),attributes,{'tableName':_0x5e3c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xface=['request-promise','./plugin.attributes','exports','plugins','util','api','moment','bluebird'];(function(_0x26c6aa,_0x2ac757){var _0x55e06b=function(_0x292484){while(--_0x292484){_0x26c6aa['push'](_0x26c6aa['shift']());}};_0x55e06b(++_0x2ac757);}(_0xface,0x12c));var _0xefac=function(_0x1ef66c,_0x32d25b){_0x1ef66c=_0x1ef66c-0x0;var _0x3e1c61=_0xface[_0x1ef66c];return _0x3e1c61;};'use strict';var _=require('lodash');var util=require(_0xefac('0x0'));var logger=require('../../config/logger')(_0xefac('0x1'));var moment=require(_0xefac('0x2'));var BPromise=require(_0xefac('0x3'));var rp=require(_0xefac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xefac('0x5'));module[_0xefac('0x6')]=function(_0x27c37b,_0xfcad10){return _0x27c37b['define']('Plugin',attributes,{'tableName':_0xefac('0x7'),'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 0d158b8..91c2f2e 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 _0x9c5e=['info','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','Plugin','options','CreatePlugin','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x9c5e,0x8d));var _0xe9c5=function(_0x9e166e,_0xcb527a){_0x9e166e=_0x9e166e-0x0;var _0x380aa0=_0x9c5e[_0x9e166e];return _0x380aa0;};'use strict';var _=require(_0xe9c5('0x0'));var util=require(_0xe9c5('0x1'));var moment=require(_0xe9c5('0x2'));var BPromise=require(_0xe9c5('0x3'));var rs=require(_0xe9c5('0x4'));var fs=require('fs');var Redis=require(_0xe9c5('0x5'));var db=require(_0xe9c5('0x6'))['db'];var utils=require(_0xe9c5('0x7'));var logger=require('../../config/logger')(_0xe9c5('0x8'));var config=require(_0xe9c5('0x9'));var jayson=require(_0xe9c5('0xa'));var client=jayson[_0xe9c5('0xb')]['http']({'port':0x232a});config[_0xe9c5('0xc')]=_['defaults'](config['redis'],{'host':_0xe9c5('0xd'),'port':0x18eb});var socket=require(_0xe9c5('0xe'))(new Redis(config[_0xe9c5('0xc')]));require(_0xe9c5('0xf'))[_0xe9c5('0x10')](socket);function respondWithRpcPromise(_0x2099f0,_0x291fa9,_0x3f1284){return new BPromise(function(_0x197baa,_0x17cc07){return client[_0xe9c5('0x11')](_0x2099f0,_0x3f1284)[_0xe9c5('0x12')](function(_0x1624bf){logger[_0xe9c5('0x13')](_0xe9c5('0x14'),_0x291fa9,_0xe9c5('0x15'));logger[_0xe9c5('0x16')]('Plugin,\x20%s,\x20%s,\x20%s',_0x291fa9,_0xe9c5('0x15'),JSON['stringify'](_0x1624bf));if(_0x1624bf[_0xe9c5('0x17')]){if(_0x1624bf['error'][_0xe9c5('0x18')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x291fa9,_0x1624bf[_0xe9c5('0x17')][_0xe9c5('0x19')]);return _0x17cc07(_0x1624bf[_0xe9c5('0x17')][_0xe9c5('0x19')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x291fa9,_0x1624bf[_0xe9c5('0x17')][_0xe9c5('0x19')]);return _0x197baa(_0x1624bf[_0xe9c5('0x17')][_0xe9c5('0x19')]);}else{logger[_0xe9c5('0x13')]('Plugin,\x20%s,\x20%s',_0x291fa9,'request\x20sent');_0x197baa(_0x1624bf[_0xe9c5('0x1a')][_0xe9c5('0x19')]);}})['catch'](function(_0x50e1b5){logger[_0xe9c5('0x17')]('Plugin,\x20%s,\x20%s',_0x291fa9,_0x50e1b5);_0x17cc07(_0x50e1b5);});});}exports['CreatePlugin']=function(_0x53d512){var _0x5dee62=this;return new Promise(function(_0x2c19f8,_0x468c30){return db[_0xe9c5('0x1b')]['create'](_0x53d512['body'],{'raw':_0x53d512['options']?_0x53d512[_0xe9c5('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5286ca){logger[_0xe9c5('0x13')]('CreatePlugin',_0x53d512);logger[_0xe9c5('0x16')](_0xe9c5('0x1d'),_0x53d512,JSON[_0xe9c5('0x1e')](_0x5286ca));_0x2c19f8(_0x5286ca);})[_0xe9c5('0x1f')](function(_0x5f3f6f){logger[_0xe9c5('0x17')](_0xe9c5('0x1d'),_0x5f3f6f['message'],_0x53d512);_0x468c30(_0x5dee62[_0xe9c5('0x17')](0x1f4,_0x5f3f6f[_0xe9c5('0x19')]));});});}; \ No newline at end of file +var _0x3fd2=['options','raw','then','lodash','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','socket.io-emitter','redis','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreatePlugin','Plugin','create','body'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x3fd2,0x15f));var _0x23fd=function(_0x30bd30,_0x2a4dcd){_0x30bd30=_0x30bd30-0x0;var _0x35f7b=_0x3fd2[_0x30bd30];return _0x35f7b;};'use strict';var _=require(_0x23fd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x23fd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x23fd('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x23fd('0x3'));var logger=require('../../config/logger')(_0x23fd('0x4'));var config=require(_0x23fd('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x23fd('0x6')][_0x23fd('0x7')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x23fd('0x8'))(new Redis(config[_0x23fd('0x9')]));require(_0x23fd('0xa'))[_0x23fd('0xb')](socket);function respondWithRpcPromise(_0x17d374,_0x2c83d6,_0x3b8835){return new BPromise(function(_0x202289,_0xa90b4c){return client[_0x23fd('0xc')](_0x17d374,_0x3b8835)['then'](function(_0x4b717d){logger[_0x23fd('0xd')](_0x23fd('0xe'),_0x2c83d6,_0x23fd('0xf'));logger[_0x23fd('0x10')]('Plugin,\x20%s,\x20%s,\x20%s',_0x2c83d6,_0x23fd('0xf'),JSON['stringify'](_0x4b717d));if(_0x4b717d[_0x23fd('0x11')]){if(_0x4b717d[_0x23fd('0x11')][_0x23fd('0x12')]===0x1f4){logger[_0x23fd('0x11')]('Plugin,\x20%s,\x20%s',_0x2c83d6,_0x4b717d[_0x23fd('0x11')][_0x23fd('0x13')]);return _0xa90b4c(_0x4b717d['error'][_0x23fd('0x13')]);}logger[_0x23fd('0x11')]('Plugin,\x20%s,\x20%s',_0x2c83d6,_0x4b717d[_0x23fd('0x11')][_0x23fd('0x13')]);return _0x202289(_0x4b717d[_0x23fd('0x11')][_0x23fd('0x13')]);}else{logger[_0x23fd('0xd')](_0x23fd('0xe'),_0x2c83d6,_0x23fd('0xf'));_0x202289(_0x4b717d[_0x23fd('0x14')][_0x23fd('0x13')]);}})[_0x23fd('0x15')](function(_0x3f933c){logger[_0x23fd('0x11')](_0x23fd('0xe'),_0x2c83d6,_0x3f933c);_0xa90b4c(_0x3f933c);});});}exports[_0x23fd('0x16')]=function(_0x405060){var _0x1ca861=this;return new Promise(function(_0x28aad7,_0x427607){return db[_0x23fd('0x17')][_0x23fd('0x18')](_0x405060[_0x23fd('0x19')],{'raw':_0x405060['options']?_0x405060[_0x23fd('0x1a')][_0x23fd('0x1b')]===undefined?!![]:![]:!![]})[_0x23fd('0x1c')](function(_0x47a1b0){logger[_0x23fd('0xd')](_0x23fd('0x16'),_0x405060);logger[_0x23fd('0x10')](_0x23fd('0x16'),_0x405060,JSON['stringify'](_0x47a1b0));_0x28aad7(_0x47a1b0);})['catch'](function(_0x16d3ca){logger[_0x23fd('0x11')](_0x23fd('0x16'),_0x16d3ca[_0x23fd('0x13')],_0x405060);_0x427607(_0x1ca861[_0x23fd('0x11')](0x1f4,_0x16d3ca[_0x23fd('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index e2c50ee..67d5db5 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 _0x521f=['plugin:','./plugin.events','save','update','emit','removeListener','register'];(function(_0x372050,_0x5985d2){var _0x354c9d=function(_0x448d6b){while(--_0x448d6b){_0x372050['push'](_0x372050['shift']());}};_0x354c9d(++_0x5985d2);}(_0x521f,0xe8));var _0xf521=function(_0x2d2565,_0x4bce39){_0x2d2565=_0x2d2565-0x0;var _0x22f96b=_0x521f[_0x2d2565];return _0x22f96b;};'use strict';var PluginEvents=require(_0xf521('0x0'));var events=[_0xf521('0x1'),'remove',_0xf521('0x2')];function createListener(_0x128ee4,_0x2cb032){return function(_0x5abdf1){_0x2cb032[_0xf521('0x3')](_0x128ee4,_0x5abdf1);};}function removeListener(_0x201c06,_0x264719){return function(){PluginEvents[_0xf521('0x4')](_0x201c06,_0x264719);};}exports[_0xf521('0x5')]=function(_0x118887){for(var _0x1c6d36=0x0,_0x177ea0=events['length'];_0x1c6d36<_0x177ea0;_0x1c6d36++){var _0x20a054=events[_0x1c6d36];var _0x5ed0ad=createListener(_0xf521('0x6')+_0x20a054,_0x118887);PluginEvents['on'](_0x20a054,_0x5ed0ad);}}; \ No newline at end of file +var _0x03ab=['removeListener','length','./plugin.events','remove','emit'];(function(_0x5e5d39,_0x45c2e9){var _0x499861=function(_0x86c335){while(--_0x86c335){_0x5e5d39['push'](_0x5e5d39['shift']());}};_0x499861(++_0x45c2e9);}(_0x03ab,0x66));var _0xb03a=function(_0x9962af,_0x49c6f8){_0x9962af=_0x9962af-0x0;var _0x168abf=_0x03ab[_0x9962af];return _0x168abf;};'use strict';var PluginEvents=require(_0xb03a('0x0'));var events=['save',_0xb03a('0x1'),'update'];function createListener(_0xe9957e,_0x2c733c){return function(_0x46dd1b){_0x2c733c[_0xb03a('0x2')](_0xe9957e,_0x46dd1b);};}function removeListener(_0x2dbca8,_0x252734){return function(){PluginEvents[_0xb03a('0x3')](_0x2dbca8,_0x252734);};}exports['register']=function(_0x210067){for(var _0x2faec8=0x0,_0x526e6c=events[_0xb03a('0x4')];_0x2faec8<_0x526e6c;_0x2faec8++){var _0x22ac1e=events[_0x2faec8];var _0x5e2bdf=createListener('plugin:'+_0x22ac1e,_0x210067);PluginEvents['on'](_0x22ac1e,_0x5e2bdf);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 06bbcc9..25b213a 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(_0x595bc3,_0x5722ab){var _0x73ff32=function(_0x1f3fe9){while(--_0x1f3fe9){_0x595bc3['push'](_0x595bc3['shift']());}};_0x73ff32(++_0x5722ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x48e955,_0x198005){var _0x33f997=function(_0x9335b7){while(--_0x9335b7){_0x48e955['push'](_0x48e955['shift']());}};_0x33f997(++_0x198005);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 73ed80c..db36a34 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 _0x9b9b=['Unknown\x20status','delete','Unknown\x20id','../../config/pm2','path','child_process','exec','bluebird','sendStatus','status','json','name','npm\x20install','info','error','index','list','reject','express','motion2','length','then','show','describe','params','catch','create','body','script','join','../../files/plugins','cwd','chdir','dirname','dump','send','update','restart','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b9b,0x114));var _0xb9b9=function(_0xeed09a,_0x463e45){_0xeed09a=_0xeed09a-0x0;var _0x4ce84e=_0x9b9b[_0xeed09a];return _0x4ce84e;};'use strict';var _=require('lodash');var pm2=require(_0xb9b9('0x0'));var logger=require('../../config/logger')('api');var path=require(_0xb9b9('0x1'));var exec=require(_0xb9b9('0x2'))[_0xb9b9('0x3')];var BPromise=require(_0xb9b9('0x4'));function handleEntityNotFound(_0x1d6ab6,_0x43c8ff){return function(_0x23b016){if(!_0x23b016){_0x1d6ab6[_0xb9b9('0x5')](0x194);;}return _0x23b016;};}function respondWithResult(_0x79dd,_0x3d1a95){_0x3d1a95=_0x3d1a95||0xc8;return function(_0x85eec){if(_0x85eec){return _0x79dd[_0xb9b9('0x6')](_0x3d1a95)[_0xb9b9('0x7')](_0x85eec);}return null;};}function handleError(_0x297cb6,_0x222cba){_0x222cba=_0x222cba||0x1f4;return function(_0x319bb8){logger['error'](_0x319bb8['stack']);if(_0x319bb8[_0xb9b9('0x8')]){delete _0x319bb8[_0xb9b9('0x8')];}_0x297cb6[_0xb9b9('0x6')](_0x222cba)['send'](_0x319bb8);};}function execChildProcess(){return new BPromise(function(_0x3949d0,_0x3b6bb9){exec(_0xb9b9('0x9'),function(_0x4d8856,_0x3430a6,_0x277d86){logger[_0xb9b9('0xa')](_0x3430a6);logger[_0xb9b9('0xa')](_0x277d86);if(_0x4d8856){logger[_0xb9b9('0xb')](_0x4d8856);return _0x3b6bb9(_0x4d8856);}return _0x3949d0(_0x3430a6);});});}exports[_0xb9b9('0xc')]=function(_0x5bd18c,_0x539449){return pm2[_0xb9b9('0xd')]()['then'](function(_0xe78d58){if(_0xe78d58){var _0x50e5d6=_[_0xb9b9('0xe')](_0xe78d58,function(_0x23bac9){return _0x23bac9[_0xb9b9('0x8')]===_0xb9b9('0xf')||_0x23bac9[_0xb9b9('0x8')]===_0xb9b9('0x10');});return{'rows':_0x50e5d6,'count':_0x50e5d6[_0xb9b9('0x11')]};}return null;})[_0xb9b9('0x12')](respondWithResult(_0x539449,null))['catch'](handleError(_0x539449,null));};exports[_0xb9b9('0x13')]=function(_0x48d9ae,_0x403a5b){return pm2[_0xb9b9('0x14')](_0x48d9ae[_0xb9b9('0x15')]['id'])[_0xb9b9('0x12')](respondWithResult(_0x403a5b,null))['then'](handleEntityNotFound(_0x403a5b,null))[_0xb9b9('0x16')](handleError(_0x403a5b,null));};exports[_0xb9b9('0x17')]=function(_0x398f3d,_0xb01198){if(_0x398f3d[_0xb9b9('0x18')][_0xb9b9('0x8')]&&_0x398f3d[_0xb9b9('0x18')][_0xb9b9('0x19')]){var _0xb16391=path[_0xb9b9('0x1a')](__dirname,_0xb9b9('0x1b'),_0x398f3d[_0xb9b9('0x18')][_0xb9b9('0x19')]);var _0x4e33a0=process[_0xb9b9('0x1c')]();process[_0xb9b9('0x1d')](path[_0xb9b9('0x1e')](_0xb16391));return execChildProcess()['then'](function(_0x9898bc){process[_0xb9b9('0x1d')](_0x4e33a0);return pm2['start']({'name':_0x398f3d[_0xb9b9('0x18')][_0xb9b9('0x8')],'script':_0xb16391});})[_0xb9b9('0x12')](function(_0x40b801){pm2[_0xb9b9('0x1f')]();return _0x40b801[0x0];})['then'](respondWithResult(_0xb01198,0xc9))['catch'](handleError(_0xb01198,null));}else{return _0xb01198[_0xb9b9('0x6')](0x1f4)[_0xb9b9('0x20')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xb9b9('0x21')]=function(_0x134ed6,_0x20ffc1){if(_0x134ed6[_0xb9b9('0x18')]['id']){delete _0x134ed6[_0xb9b9('0x18')]['id'];}var _0x54bf18={'online':_0xb9b9('0x22'),'stopped':'stop'};if(_0x54bf18[_0xb9b9('0x23')](_0x134ed6[_0xb9b9('0x18')]['status'])){return pm2[_0x54bf18[_0x134ed6[_0xb9b9('0x18')][_0xb9b9('0x6')]]](_0x134ed6[_0xb9b9('0x15')]['id'])['then'](respondWithResult(_0x20ffc1,0xc8))[_0xb9b9('0x16')](handleError(_0x20ffc1,null));}else{return _0x20ffc1[_0xb9b9('0x6')](0x1f4)[_0xb9b9('0x20')]({'message':_0xb9b9('0x24')});}};exports['destroy']=function(_0xc40dda,_0xdbc1f1){if(_0xc40dda['body']['id']){delete _0xc40dda[_0xb9b9('0x18')]['id'];}if(_0xc40dda[_0xb9b9('0x15')]['id']){return pm2[_0xb9b9('0x25')](_0xc40dda[_0xb9b9('0x15')]['id'])['then'](function(_0xd66ace){pm2[_0xb9b9('0x1f')]();return _0xd66ace[0x0];})[_0xb9b9('0x12')](respondWithResult(_0xdbc1f1,null))[_0xb9b9('0x16')](handleError(_0xdbc1f1,null));}else{return _0xdbc1f1['status'](0x1f4)[_0xb9b9('0x20')]({'message':_0xb9b9('0x26')});}}; \ No newline at end of file +var _0x0713=['Unknown\x20status','destroy','../../config/logger','api','path','child_process','exec','sendStatus','status','json','error','name','send','npm\x20install','info','index','list','reject','express','motion2','length','then','catch','show','describe','params','create','body','../../files/plugins','script','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty'];(function(_0x30a528,_0x1d04f2){var _0x3e029c=function(_0x4e4b97){while(--_0x4e4b97){_0x30a528['push'](_0x30a528['shift']());}};_0x3e029c(++_0x1d04f2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var path=require(_0x3071('0x2'));var exec=require(_0x3071('0x3'))[_0x3071('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x2c547f,_0x7b18a4){return function(_0x33a70c){if(!_0x33a70c){_0x2c547f[_0x3071('0x5')](0x194);;}return _0x33a70c;};}function respondWithResult(_0xabd7b6,_0x41cf76){_0x41cf76=_0x41cf76||0xc8;return function(_0x1d3dd6){if(_0x1d3dd6){return _0xabd7b6[_0x3071('0x6')](_0x41cf76)[_0x3071('0x7')](_0x1d3dd6);}return null;};}function handleError(_0x22274c,_0x3e9a5e){_0x3e9a5e=_0x3e9a5e||0x1f4;return function(_0x2fce7a){logger[_0x3071('0x8')](_0x2fce7a['stack']);if(_0x2fce7a[_0x3071('0x9')]){delete _0x2fce7a[_0x3071('0x9')];}_0x22274c[_0x3071('0x6')](_0x3e9a5e)[_0x3071('0xa')](_0x2fce7a);};}function execChildProcess(){return new BPromise(function(_0x1ce844,_0x4a470a){exec(_0x3071('0xb'),function(_0x11a7ee,_0x401b4d,_0x3ed4a0){logger[_0x3071('0xc')](_0x401b4d);logger['info'](_0x3ed4a0);if(_0x11a7ee){logger['error'](_0x11a7ee);return _0x4a470a(_0x11a7ee);}return _0x1ce844(_0x401b4d);});});}exports[_0x3071('0xd')]=function(_0x5dc13b,_0x31c220){return pm2[_0x3071('0xe')]()['then'](function(_0x104e73){if(_0x104e73){var _0x4e1219=_[_0x3071('0xf')](_0x104e73,function(_0x45c93b){return _0x45c93b[_0x3071('0x9')]===_0x3071('0x10')||_0x45c93b[_0x3071('0x9')]===_0x3071('0x11');});return{'rows':_0x4e1219,'count':_0x4e1219[_0x3071('0x12')]};}return null;})[_0x3071('0x13')](respondWithResult(_0x31c220,null))[_0x3071('0x14')](handleError(_0x31c220,null));};exports[_0x3071('0x15')]=function(_0x5f3c22,_0x224996){return pm2[_0x3071('0x16')](_0x5f3c22[_0x3071('0x17')]['id'])[_0x3071('0x13')](respondWithResult(_0x224996,null))[_0x3071('0x13')](handleEntityNotFound(_0x224996,null))[_0x3071('0x14')](handleError(_0x224996,null));};exports[_0x3071('0x18')]=function(_0x26f113,_0x502a16){if(_0x26f113[_0x3071('0x19')][_0x3071('0x9')]&&_0x26f113[_0x3071('0x19')]['script']){var _0xb8f4e3=path['join'](__dirname,_0x3071('0x1a'),_0x26f113[_0x3071('0x19')][_0x3071('0x1b')]);var _0x457b57=process[_0x3071('0x1c')]();process[_0x3071('0x1d')](path[_0x3071('0x1e')](_0xb8f4e3));return execChildProcess()[_0x3071('0x13')](function(_0x542646){process['chdir'](_0x457b57);return pm2[_0x3071('0x1f')]({'name':_0x26f113[_0x3071('0x19')][_0x3071('0x9')],'script':_0xb8f4e3});})[_0x3071('0x13')](function(_0x2793ef){pm2[_0x3071('0x20')]();return _0x2793ef[0x0];})[_0x3071('0x13')](respondWithResult(_0x502a16,0xc9))[_0x3071('0x14')](handleError(_0x502a16,null));}else{return _0x502a16[_0x3071('0x6')](0x1f4)['send']({'message':_0x3071('0x21')});}};exports[_0x3071('0x22')]=function(_0x177138,_0x4d5c4b){if(_0x177138[_0x3071('0x19')]['id']){delete _0x177138[_0x3071('0x19')]['id'];}var _0x163604={'online':_0x3071('0x23'),'stopped':_0x3071('0x24')};if(_0x163604[_0x3071('0x25')](_0x177138[_0x3071('0x19')][_0x3071('0x6')])){return pm2[_0x163604[_0x177138[_0x3071('0x19')][_0x3071('0x6')]]](_0x177138[_0x3071('0x17')]['id'])['then'](respondWithResult(_0x4d5c4b,0xc8))['catch'](handleError(_0x4d5c4b,null));}else{return _0x4d5c4b[_0x3071('0x6')](0x1f4)[_0x3071('0xa')]({'message':_0x3071('0x26')});}};exports[_0x3071('0x27')]=function(_0x3f6d90,_0x29538c){if(_0x3f6d90[_0x3071('0x19')]['id']){delete _0x3f6d90[_0x3071('0x19')]['id'];}if(_0x3f6d90['params']['id']){return pm2['delete'](_0x3f6d90['params']['id'])[_0x3071('0x13')](function(_0x392800){pm2['dump']();return _0x392800[0x0];})[_0x3071('0x13')](respondWithResult(_0x29538c,null))[_0x3071('0x14')](handleError(_0x29538c,null));}else{return _0x29538c[_0x3071('0x6')](0x1f4)[_0x3071('0xa')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 5ac8b8d..5a4116d 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 _0xc2f4=['../../components/auth/service','./realtime.controller','get','isAuthenticated','/queues','getQueues','exports','Router'];(function(_0x3de51e,_0x24bf04){var _0x282f84=function(_0x21bdb4){while(--_0x21bdb4){_0x3de51e['push'](_0x3de51e['shift']());}};_0x282f84(++_0x24bf04);}(_0xc2f4,0x157));var _0x4c2f=function(_0x48bee1,_0x29f43d){_0x48bee1=_0x48bee1-0x0;var _0x582372=_0xc2f4[_0x48bee1];return _0x582372;};'use strict';var express=require('express');var router=express[_0x4c2f('0x0')]();var auth=require(_0x4c2f('0x1'));var controller=require(_0x4c2f('0x2'));router[_0x4c2f('0x3')]('/agents',auth[_0x4c2f('0x4')](),controller['getAgents']);router[_0x4c2f('0x3')](_0x4c2f('0x5'),auth[_0x4c2f('0x4')](),controller[_0x4c2f('0x6')]);module[_0x4c2f('0x7')]=router; \ No newline at end of file +var _0x9ddd=['/queues','express','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents'];(function(_0x1de641,_0x44d464){var _0xccacbc=function(_0x1ed9fb){while(--_0x1ed9fb){_0x1de641['push'](_0x1de641['shift']());}};_0xccacbc(++_0x44d464);}(_0x9ddd,0x184));var _0xd9dd=function(_0x732594,_0x1ff806){_0x732594=_0x732594-0x0;var _0x2fbe9d=_0x9ddd[_0x732594];return _0x2fbe9d;};'use strict';var express=require(_0xd9dd('0x0'));var router=express[_0xd9dd('0x1')]();var auth=require(_0xd9dd('0x2'));var controller=require(_0xd9dd('0x3'));router[_0xd9dd('0x4')](_0xd9dd('0x5'),auth[_0xd9dd('0x6')](),controller[_0xd9dd('0x7')]);router['get'](_0xd9dd('0x8'),auth['isAuthenticated'](),controller['getQueues']);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 3291d3a..aa32ce5 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 _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(_0x34d94a,_0x3cfd9a){var _0x6e6ff1=function(_0x39df54){while(--_0x39df54){_0x34d94a['push'](_0x34d94a['shift']());}};_0x6e6ff1(++_0x3cfd9a);}(_0x9536,0x179));var _0x6953=function(_0x5c8827,_0x5bc5d7){_0x5c8827=_0x5c8827-0x0;var _0x50ffd5=_0x9536[_0x5c8827];return _0x50ffd5;};'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 +var _0x31f0=['routealias','smsPause','resolve','fieldName','type','key','query','agent','getOptions','role','user','userProfileId','sort','filter','UserProfile','getResources','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','mail','sms','openchannel','fax','includes','channel','toLowerCase','rawAttributes','QueueCampaigns','Queues','all','util','jayson/promise','../../config/logger','api','../../mysqldb','client','http','undefined','limit','offset','count','status','Content-Range','json','error','stack','name','send','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','format','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','talking','paused','outbound','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','agents','loggedIn','busy','pick','length','some','connectedlinenum','internal','toString','find','UserId','accountcode','online','push','User','Queue','Pause','findAll','QueueId','loggedInDb','unknown','unavailable','ringing','chatPause','faxPause','mailPause','voicePause','every','idle','voiceStatus','pause','chatStatus','faxStatus','openchannelStatus','*pause','userpic','lastLoginAt','pauseType','openchannelPause','whatsappPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','whatsappStatus','chatStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording'];(function(_0x10faff,_0x525d72){var _0x5c5692=function(_0x194209){while(--_0x194209){_0x10faff['push'](_0x10faff['shift']());}};_0x5c5692(++_0x525d72);}(_0x31f0,0xb7));var _0x031f=function(_0x43bbd5,_0x305599){_0x43bbd5=_0x43bbd5-0x0;var _0x1e1aad=_0x31f0[_0x43bbd5];return _0x1e1aad;};'use strict';var util=require(_0x031f('0x0'));var _=require('lodash');var jayson=require(_0x031f('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x031f('0x2'))(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var amiClient=jayson[_0x031f('0x5')]['http']({'port':0x232a});var routingClient=jayson[_0x031f('0x5')][_0x031f('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x4f6059,_0x4c0f94){return function(_0x56328c){if(_0x56328c){var _0x3dc98e=typeof _0x4c0f94['offset']===_0x031f('0x7')&&typeof _0x4c0f94[_0x031f('0x8')]===_0x031f('0x7');var _0x3e41ed=_0x56328c['count'];var _0x2e5624=_0x3dc98e?0x0:_0x4c0f94[_0x031f('0x9')];var _0x327f11=_0x3dc98e?_0x56328c[_0x031f('0xa')]:_0x4c0f94[_0x031f('0x9')]+_0x4c0f94[_0x031f('0x8')];var _0x2202dc;if(_0x327f11>=_0x3e41ed){_0x327f11=_0x3e41ed;_0x2202dc=0xc8;}else{_0x2202dc=0xce;}_0x4f6059[_0x031f('0xb')](_0x2202dc);return _0x4f6059['set'](_0x031f('0xc'),_0x2e5624+'-'+_0x327f11+'/'+_0x3e41ed)[_0x031f('0xd')](_0x56328c);}return null;};}function handleError(_0x28da6e,_0x351052){_0x351052=_0x351052||0x1f4;return function(_0x3819bb){logger[_0x031f('0xe')](_0x3819bb[_0x031f('0xf')]);if(_0x3819bb['name']){delete _0x3819bb[_0x031f('0x10')];}_0x28da6e[_0x031f('0xb')](_0x351052)[_0x031f('0x11')](_0x3819bb);};}function getRealtimeAgents(){return new Promise(function(_0x2e3dfe,_0x2ea549){return amiClient['request']('Agents',{})[_0x031f('0x12')](function(_0x3a10aa){if(_0x3a10aa[_0x031f('0xe')])throw new Error(_0x031f('0x13'));var _0x5196b1=_0x3a10aa[_0x031f('0x14')];return routingClient[_0x031f('0x15')]('Agents',{})[_0x031f('0x12')](function(_0x535e70){if(_0x535e70[_0x031f('0xe')])throw new Error(_0x031f('0x16'));var _0x563bc8=_0x535e70[_0x031f('0x14')];return _0x2e3dfe(_[_0x031f('0x17')]({},_0x5196b1,_0x563bc8));});})[_0x031f('0x18')](function(_0x1b76d6){_0x2ea549(_0x1b76d6);});});}function getRealtimeQueues(_0x2825ef,_0xf76f1b){return new Promise(function(_0x345bde,_0x29dd6e){var _0x48a76e=_0xf76f1b===_0x031f('0x19')?amiClient:routingClient;return _0x48a76e[_0x031f('0x15')](_[_0x031f('0x1a')](_0xf76f1b)+'Queues',_0x2825ef)['then'](function(_0xa11a2b){if(_0xa11a2b['error'])throw new Error(util[_0x031f('0x1b')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0xf76f1b));return _0x345bde(_0xa11a2b['result']);})['catch'](function(_0x971691){_0x29dd6e(_0x971691);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x12c406,_0x2920cd){return amiClient[_0x031f('0x15')]('VoiceQueuesChannels',{})[_0x031f('0x12')](function(_0x5a64c0){if(_0x5a64c0[_0x031f('0xe')])throw new Error(_0x031f('0x1c'));return _0x12c406(_0x5a64c0[_0x031f('0x14')]);})['catch'](function(_0x35af16){_0x2920cd(_0x35af16);});});}function initializeQueues(_0x3b2a51,_0x54b44e,_0x3847b2,_0x28a617){var _0x2403e9=['loggedIn',_0x031f('0x1d'),_0x031f('0x1e'),_0x031f('0x1f'),_0x031f('0x20')];if(_0x3847b2===_0x031f('0x19')&&_0x28a617===_0x031f('0x21')){_0x2403e9['push'](_0x031f('0x22'),_0x031f('0x23'),_0x031f('0x24'),_0x031f('0x25'),_0x031f('0x26'),_0x031f('0x27'),_0x031f('0x28'),_0x031f('0x29'),_0x031f('0x2a'),_0x031f('0x2b'),_0x031f('0x2c'),'erlangBusyFactor',_0x031f('0x2d'),_0x031f('0x2e'),_0x031f('0x2f'),_0x031f('0x30'),_0x031f('0x31'),_0x031f('0x32'),_0x031f('0x33'),_0x031f('0x34'),_0x031f('0x35'),_0x031f('0x36'));}return _0x3b2a51[_0x031f('0x37')](function(_0x17217d){var _0x4610fa=_0x17217d['get']({'plain':!![]});_0x4610fa[_0x031f('0x38')]=[];_0x4610fa[_0x031f('0x20')]=0x0;_0x4610fa['loggedInDb']=0x0;_0x4610fa[_0x031f('0x39')]=0x0;_0x4610fa[_0x031f('0x1d')]=0x0;_0x4610fa['waiting']=0x0;if(_0x3847b2===_0x031f('0x19')){_0x4610fa[_0x031f('0x1f')]=0x0;_0x4610fa[_0x031f('0x3a')]=0x0;if(_0x28a617===_0x031f('0x21')){_0x4610fa['pTalking']=0x0;_0x4610fa['originated']=0x0;}}var _0x36ab13=_['find'](_0x54b44e,['id',_0x4610fa['id']]);if(_0x36ab13)_[_0x031f('0x17')](_0x4610fa,_[_0x031f('0x3b')](_0x36ab13,_0x2403e9));return _0x4610fa;});}function updateAgentVoiceStatus(_0x43ef89,_0x56a7f0,_0x5c33c5){var _0x3c1e48=_['filter'](_0x5c33c5,['queue',_0x56a7f0[_0x031f('0x10')]]);if(_0x3c1e48[_0x031f('0x3c')]===0x0)return _0x43ef89[_0x031f('0x3a')]=!![];if(_[_0x031f('0x3d')](_0x3c1e48,[_0x031f('0x3e'),_0x43ef89[_0x031f('0x3f')][_0x031f('0x40')]()]))return _0x43ef89['talking']=!![];if(!_0x43ef89[_0x031f('0x1f')])return _0x43ef89[_0x031f('0x3a')]=!![];}function getVoiceQueueAgents(_0xb3b188,_0x1e9302,_0x58daa2,_0x2be5d1){var _0x10f590=_[_0x031f('0x41')](_0x1e9302,['id',_0xb3b188['id']]);if(!_0x10f590)return _0xb3b188;return _0x10f590['getMembers']({'raw':!![]})[_0x031f('0x12')](function(_0x3b504c){for(var _0x5d6826=0x0;_0x5d6826<_0x3b504c[_0x031f('0x3c')];_0x5d6826++){var _0x268dc7=_['find'](_0x58daa2,['id',_0x3b504c[_0x5d6826]['UserId']]);if(!_0x268dc7){_0x268dc7={'id':_0x3b504c[_0x5d6826][_0x031f('0x42')],'name':_0x3b504c[_0x5d6826][_0x031f('0x42')],'accountcode':'','online':![]};}var _0x9efbc4={'id':_0x268dc7['id'],'name':_0x268dc7[_0x031f('0x10')],'internal':_0x268dc7[_0x031f('0x43')],'online':Boolean(_0x268dc7[_0x031f('0x44')]),'paused':Boolean(_0x3b504c[_0x5d6826][_0x031f('0x20')])};if(_0x268dc7['voiceStatus']===_0x031f('0x1f'))updateAgentVoiceStatus(_0x9efbc4,_0xb3b188,_0x2be5d1);if(_0x9efbc4[_0x031f('0x44')])_0xb3b188['loggedInDb']++;if(_0x9efbc4[_0x031f('0x3a')])_0xb3b188['busy']++;if(_0x9efbc4[_0x031f('0x20')]&&!_0x9efbc4[_0x031f('0x3a')]&&!_0x9efbc4['talking'])_0xb3b188[_0x031f('0x20')]++;_0xb3b188[_0x031f('0x38')][_0x031f('0x45')](_0x9efbc4);}return _0xb3b188;});}function getQueueAgents(_0x50f5d4,_0x98747f,_0x213e1c){var _0x1d3324=_0x031f('0x46')+_[_0x031f('0x1a')](_0x213e1c)+_0x031f('0x47');var _0x236a18=_0x213e1c+_0x031f('0x48');return db[_0x1d3324][_0x031f('0x49')]({'where':{[_['startCase'](_0x213e1c)+_0x031f('0x4a')]:_0x50f5d4['id']},'raw':!![]})[_0x031f('0x12')](function(_0x28f2b3){for(var _0x3205ce=0x0;_0x3205ce<_0x28f2b3[_0x031f('0x3c')];_0x3205ce++){var _0x2c879c=_[_0x031f('0x41')](_0x98747f,['id',_0x28f2b3[_0x3205ce][_0x031f('0x42')]]);if(!_0x2c879c){_0x2c879c={'id':_0x28f2b3[_0x3205ce][_0x031f('0x42')],'name':_0x28f2b3[_0x3205ce]['UserId'],'online':![],['pauseField']:![]};}var _0x38539a={'id':_0x2c879c['id'],'name':_0x2c879c['name'],'online':Boolean(_0x2c879c['online']),'paused':Boolean(_0x2c879c[_0x236a18])};if(_0x38539a[_0x031f('0x44')])_0x50f5d4[_0x031f('0x4b')]++;_0x50f5d4[_0x031f('0x38')][_0x031f('0x45')](_0x38539a);}return _0x50f5d4;});}function isIdle(_0x10d625){return _0x10d625==='idle'||_0x10d625===_0x031f('0x4c')||_0x10d625===_0x031f('0x4d')||_0x10d625===_0x031f('0x4e')||_['isNil'](_0x10d625);}function isAgentPaused(_0x274166,_0x2e7e35){var _0x2dba78=[_0x274166[_0x031f('0x4f')],_0x274166[_0x031f('0x50')],_0x274166[_0x031f('0x51')],_0x274166['openchannelPause'],_0x274166['smsPause'],_0x274166[_0x031f('0x52')],_0x274166['whatsappPause']];if(!_0x2e7e35)return _[_0x031f('0x53')](_0x2dba78);var _0x3bba44=_['filter'](_0x2dba78);return _0x3bba44[_0x031f('0x3c')]>0x0&&_0x3bba44['length']<_0x2dba78['length']?!![]:![];}function isAgentIdle(_0x35a949){if(_0x35a949['voiceStatus']!==_0x031f('0x54')&&_0x35a949['voicePause']){_0x35a949[_0x031f('0x55')]=_0x031f('0x56');return![];}return _['every']([_0x35a949[_0x031f('0x57')],_0x35a949[_0x031f('0x58')],_0x35a949['mailStatus'],_0x35a949[_0x031f('0x59')],_0x35a949['smsStatus'],_0x35a949[_0x031f('0x55')],_0x35a949['whatsappStatus']],isIdle);}function getAgentStatus(_0x1464df){var _0x24848b=_0x031f('0x4c');if(isAgentPaused(_0x1464df))_0x24848b=_0x031f('0x56');else if(isAgentPaused(_0x1464df,!![]))_0x24848b=_0x031f('0x5a');else if(isAgentIdle(_0x1464df))_0x24848b='idle';else _0x24848b=_0x031f('0x3a');return _0x24848b;}exports['getAgents']=function(_0x186957,_0x414350){var _0x4d49f8={'count':0x0,'rows':[]},_0x1f9c55={},_0x7ba7ce,_0x510d17,_0x3b3632=[_0x031f('0x5b'),'online',_0x031f('0x5c'),'lastPauseAt',_0x031f('0x5d'),'lastPauseAt',_0x031f('0x3f'),'address',_0x031f('0x4f'),_0x031f('0x5e'),'mailPause','smsPause',_0x031f('0x5f'),_0x031f('0x50'),'voicePause',_0x031f('0x60'),_0x031f('0x61'),_0x031f('0x62'),_0x031f('0x63'),_0x031f('0x64'),_0x031f('0x65'),_0x031f('0x66'),_0x031f('0x67'),'mailCurrentCapacity',_0x031f('0x68'),_0x031f('0x69'),_0x031f('0x6a'),'chatStatus',_0x031f('0x59'),_0x031f('0x6b'),'smsStatus',_0x031f('0x6c'),_0x031f('0x58'),_0x031f('0x55'),_0x031f('0x6d'),'openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime',_0x031f('0x6e'),_0x031f('0x6f'),'queue',_0x031f('0x70'),_0x031f('0x71'),'phoneBarEnableScreenRecordingByAgent',_0x031f('0x72'),_0x031f('0x73')],_0x154ad2=[_0x031f('0x4f'),_0x031f('0x5e'),_0x031f('0x51'),_0x031f('0x74'),_0x031f('0x5f'),_0x031f('0x50'),_0x031f('0x52'),'online'];Promise[_0x031f('0x75')]()['then'](function(){var _0x13409d=_[_0x031f('0x37')](db[_0x031f('0x46')]['rawAttributes'],function(_0x4c1b74){return{'name':_0x4c1b74[_0x031f('0x76')],'type':_0x4c1b74[_0x031f('0x77')][_0x031f('0x78')]};});_0x186957[_0x031f('0x79')]['role']=_0x031f('0x7a');_0x186957['query']['online']=!![];_0x1f9c55=qs[_0x031f('0x7b')](_0x13409d,_0x186957);_0x1f9c55['raw']=!![];if(_0x186957['user'][_0x031f('0x7c')]===_0x031f('0x7d')){var _0x248f8b={'params':{'id':_0x186957[_0x031f('0x7d')][_0x031f('0x7e')]},'query':{'section':'Agents','role':'agent','online':!![],'nolimit':_0x186957[_0x031f('0x79')]['nolimit'],'sort':_0x186957[_0x031f('0x79')][_0x031f('0x7f')],'filter':_0x186957['query'][_0x031f('0x80')],'raw':!![]}};return db[_0x031f('0x81')][_0x031f('0x82')](_0x248f8b);}return db[_0x031f('0x46')][_0x031f('0x83')](_0x1f9c55);})[_0x031f('0x12')](function(_0x5bea08){_0x4d49f8['count']=_0x5bea08[_0x031f('0xa')];_0x7ba7ce=_0x5bea08[_0x031f('0x84')];return getRealtimeAgents();})[_0x031f('0x12')](function(_0x1d973d){_0x510d17=_0x1d973d[_0x031f('0x84')];return _0x7ba7ce[_0x031f('0x37')](function(_0x3cfb21){var _0x5c99c6=_['find'](_0x510d17,['id',_0x3cfb21['id']]);if(_0x5c99c6)_['merge'](_0x3cfb21,_['pick'](_[_0x031f('0x85')](_0x5c99c6,_0x154ad2),_0x3b3632));_0x3cfb21[_0x031f('0x86')]=getAgentStatus(_0x3cfb21);return _0x3cfb21;});})[_0x031f('0x12')](function(_0x4fb931){if(_0x186957[_0x031f('0x79')][_0x031f('0x87')]){var _0x5133a6=_[_0x031f('0x80')](_0x4fb931,[_0x031f('0x86'),_0x186957[_0x031f('0x79')][_0x031f('0x87')]]);if(_0x186957[_0x031f('0x79')][_0x031f('0x88')]){_0x5133a6=_[_0x031f('0x80')](_0x5133a6,['pauseType',_0x186957['query'][_0x031f('0x88')]]);}}_0x4d49f8['rows']=_0x5133a6||_0x4fb931;return _0x4d49f8;})[_0x031f('0x12')](respondWithFilteredResult(_0x414350,_0x1f9c55))['catch'](handleError(_0x414350,null));};exports[_0x031f('0x89')]=function(_0x1cefb8,_0x3424c9){var _0x556fc6=[_0x031f('0x8a'),'chat',_0x031f('0x8b'),_0x031f('0x8c'),_0x031f('0x8d'),'whatsapp',_0x031f('0x19')];var _0x398e7c={'count':0x0,'rows':[]},_0x3c4b09={},_0x3e3ff5,_0x45330f,_0x5a55e7,_0x55284b,_0x282ab6;Promise[_0x031f('0x75')]()['then'](function(){if(_0x1cefb8[_0x031f('0x79')]['channel']){if(!_[_0x031f('0x8e')](_0x556fc6,_0x1cefb8[_0x031f('0x79')][_0x031f('0x8f')][_0x031f('0x90')]()))throw new Error('Invalid\x20channel');_0x3e3ff5=_0x1cefb8[_0x031f('0x79')][_0x031f('0x8f')][_0x031f('0x90')]();}var _0x5b336f=_[_0x031f('0x1a')](_0x3e3ff5)+_0x031f('0x47');var _0x4deefb=_[_0x031f('0x37')](db[_0x5b336f][_0x031f('0x91')],function(_0x11d498){return{'name':_0x11d498[_0x031f('0x76')],'type':_0x11d498[_0x031f('0x77')][_0x031f('0x78')]};});_0x3c4b09=qs[_0x031f('0x7b')](_0x4deefb,_0x1cefb8);if(_0x1cefb8['user'][_0x031f('0x7c')]===_0x031f('0x7d')){var _0x23cc40={'params':{'id':_0x1cefb8['user']['userProfileId']},'query':{'section':_0x3e3ff5===_0x031f('0x19')&&_0x1cefb8['query']['type']===_0x031f('0x21')?_0x031f('0x92'):_[_0x031f('0x1a')](_0x3e3ff5)+_0x031f('0x93'),'type':_0x1cefb8[_0x031f('0x79')][_0x031f('0x77')],'nolimit':!![],'sort':_0x031f('0x10'),'filter':_0x1cefb8[_0x031f('0x79')][_0x031f('0x80')]}};return db[_0x031f('0x81')][_0x031f('0x82')](_0x23cc40);}return db[_0x5b336f]['findAndCountAll'](_0x3c4b09);})[_0x031f('0x12')](function(_0x2d867f){_0x398e7c[_0x031f('0xa')]=_0x2d867f[_0x031f('0xa')];_0x45330f=_0x2d867f['rows'];return getRealtimeQueues(_0x1cefb8,_0x3e3ff5);})[_0x031f('0x12')](function(_0x5329c2){_0x55284b=_0x5329c2['rows'];return getRealtimeAgents();})[_0x031f('0x12')](function(_0x2f4d09){_0x5a55e7=_0x2f4d09['rows'];if(_0x3e3ff5!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x031f('0x12')](function(_0x62016){_0x282ab6=_0x62016?_0x62016[_0x031f('0x84')]:[];return initializeQueues(_0x45330f,_0x55284b,_0x3e3ff5,_0x1cefb8[_0x031f('0x79')][_0x031f('0x77')]);})[_0x031f('0x12')](function(_0x5e0853){var _0x263658=_0x5e0853[_0x031f('0x37')](function(_0x588f6c){if(_0x3e3ff5===_0x031f('0x19'))return getVoiceQueueAgents(_0x588f6c,_0x45330f,_0x5a55e7,_0x282ab6);else return getQueueAgents(_0x588f6c,_0x5a55e7,_0x3e3ff5);});return Promise[_0x031f('0x94')](_0x263658);})[_0x031f('0x12')](function(_0x14fc7e){_0x398e7c[_0x031f('0x84')]=_0x14fc7e;return _0x398e7c;})[_0x031f('0x12')](respondWithFilteredResult(_0x3424c9,_0x3c4b09))[_0x031f('0x18')](handleError(_0x3424c9,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index c38f122..393cdfb 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x478035,_0x54c7ff){var _0x50aac4=function(_0x104b33){while(--_0x104b33){_0x478035['push'](_0x478035['shift']());}};_0x50aac4(++_0x54c7ff);}(_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(_0x1043ea,_0x22d2bb){var _0x3b9cf6=function(_0x418b04){while(--_0x418b04){_0x1043ea['push'](_0x1043ea['shift']());}};_0x3b9cf6(++_0x22d2bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 02c55a2..0594791 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 _0x2706=['INTEGER','STRING','DATE','exports'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x2706,0x107));var _0x6270=function(_0x142322,_0x80403b){_0x142322=_0x142322-0x0;var _0x5c30c6=_0x2706[_0x142322];return _0x5c30c6;};'use strict';var Sequelize=require('sequelize');module[_0x6270('0x0')]={'state':{'type':Sequelize[_0x6270('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x6270('0x2')]},'scheduledat':{'type':Sequelize[_0x6270('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6270('0x3')]},'responsetime':{'type':Sequelize[_0x6270('0x3')]},'ringtime':{'type':Sequelize[_0x6270('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x6270('0x2')]},'campaigntype':{'type':Sequelize[_0x6270('0x2')]},'membername':{'type':Sequelize[_0x6270('0x2')]}}; \ No newline at end of file +var _0x36c3=['DATE','INTEGER','sequelize','exports','STRING'];(function(_0x3435d7,_0x2a68ad){var _0x27519f=function(_0x5884a9){while(--_0x5884a9){_0x3435d7['push'](_0x3435d7['shift']());}};_0x27519f(++_0x2a68ad);}(_0x36c3,0x1a6));var _0x336c=function(_0x73f87f,_0x2eb5c5){_0x73f87f=_0x73f87f-0x0;var _0x11899b=_0x36c3[_0x73f87f];return _0x11899b;};'use strict';var Sequelize=require(_0x336c('0x0'));module[_0x336c('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x336c('0x2')]},'scheduledat':{'type':Sequelize[_0x336c('0x3')]},'uniqueid':{'type':Sequelize[_0x336c('0x2')]},'starttime':{'type':Sequelize[_0x336c('0x3')]},'responsetime':{'type':Sequelize[_0x336c('0x3')]},'ringtime':{'type':Sequelize[_0x336c('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x336c('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x336c('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 178c149..2241037 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 _0x5bb2=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview'];(function(_0x486de9,_0x35dc61){var _0x24647a=function(_0x20721c){while(--_0x20721c){_0x486de9['push'](_0x486de9['shift']());}};_0x24647a(++_0x35dc61);}(_0x5bb2,0xa8));var _0x25bb=function(_0x2af384,_0x221c3c){_0x2af384=_0x2af384-0x0;var _0x790553=_0x5bb2[_0x2af384];return _0x790553;};'use strict';var _=require(_0x25bb('0x0'));var util=require(_0x25bb('0x1'));var logger=require(_0x25bb('0x2'))(_0x25bb('0x3'));var moment=require(_0x25bb('0x4'));var BPromise=require('bluebird');var rp=require(_0x25bb('0x5'));var fs=require('fs');var path=require(_0x25bb('0x6'));var rimraf=require(_0x25bb('0x7'));var config=require(_0x25bb('0x8'));var attributes=require(_0x25bb('0x9'));module[_0x25bb('0xa')]=function(_0x328528,_0x45950e){return _0x328528[_0x25bb('0xb')](_0x25bb('0xc'),attributes,{'tableName':_0x25bb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ed6=['moment','bluebird','request-promise','path','./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x9ed6,0x1c0));var _0x69ed=function(_0x2538f1,_0x1f49ac){_0x2538f1=_0x2538f1-0x0;var _0x504816=_0x9ed6[_0x2538f1];return _0x504816;};'use strict';var _=require(_0x69ed('0x0'));var util=require(_0x69ed('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x69ed('0x2'));var BPromise=require(_0x69ed('0x3'));var rp=require(_0x69ed('0x4'));var fs=require('fs');var path=require(_0x69ed('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x69ed('0x6'));module['exports']=function(_0x3983a5,_0x47c09e){return _0x3983a5['define'](_0x69ed('0x7'),attributes,{'tableName':_0x69ed('0x8'),'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 25b4326..cc7ea2c 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 _0xc6d7=['stringify','code','error','message','info','result','catch','create','options','raw','then','CreateReportAgentPreview','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','http','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s'];(function(_0x42020e,_0x4b92fb){var _0x561551=function(_0xf8216){while(--_0xf8216){_0x42020e['push'](_0x42020e['shift']());}};_0x561551(++_0x4b92fb);}(_0xc6d7,0x174));var _0x7c6d=function(_0x1cbeaa,_0x4a4246){_0x1cbeaa=_0x1cbeaa-0x0;var _0x2638d6=_0xc6d7[_0x1cbeaa];return _0x2638d6;};'use strict';var _=require(_0x7c6d('0x0'));var util=require('util');var moment=require(_0x7c6d('0x1'));var BPromise=require(_0x7c6d('0x2'));var rs=require(_0x7c6d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c6d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7c6d('0x5'));var config=require(_0x7c6d('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c6d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x30a90c,_0xbe91a9,_0x44277d){return new BPromise(function(_0x2b8ea2,_0x107d2c){return client['request'](_0x30a90c,_0x44277d)['then'](function(_0x252daa){logger['info'](_0x7c6d('0x8'),_0xbe91a9,_0x7c6d('0x9'));logger[_0x7c6d('0xa')](_0x7c6d('0xb'),_0xbe91a9,'request\x20sent',JSON[_0x7c6d('0xc')](_0x252daa));if(_0x252daa['error']){if(_0x252daa['error'][_0x7c6d('0xd')]===0x1f4){logger[_0x7c6d('0xe')](_0x7c6d('0x8'),_0xbe91a9,_0x252daa['error']['message']);return _0x107d2c(_0x252daa[_0x7c6d('0xe')][_0x7c6d('0xf')]);}logger['error'](_0x7c6d('0x8'),_0xbe91a9,_0x252daa[_0x7c6d('0xe')][_0x7c6d('0xf')]);return _0x2b8ea2(_0x252daa[_0x7c6d('0xe')][_0x7c6d('0xf')]);}else{logger[_0x7c6d('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0xbe91a9,_0x7c6d('0x9'));_0x2b8ea2(_0x252daa[_0x7c6d('0x11')][_0x7c6d('0xf')]);}})[_0x7c6d('0x12')](function(_0x2bd9d3){logger['error'](_0x7c6d('0x8'),_0xbe91a9,_0x2bd9d3);_0x107d2c(_0x2bd9d3);});});}exports['CreateReportAgentPreview']=function(_0x855d7a){var _0x3c9951=this;return new Promise(function(_0x5990c7,_0x48a606){return db['ReportAgentPreview'][_0x7c6d('0x13')](_0x855d7a['body'],{'raw':_0x855d7a[_0x7c6d('0x14')]?_0x855d7a[_0x7c6d('0x14')][_0x7c6d('0x15')]===undefined?!![]:![]:!![]})[_0x7c6d('0x16')](function(_0x22210c){logger[_0x7c6d('0x10')]('CreateReportAgentPreview',_0x855d7a);logger['debug'](_0x7c6d('0x17'),_0x855d7a,JSON[_0x7c6d('0xc')](_0x22210c));_0x5990c7(_0x22210c);})[_0x7c6d('0x12')](function(_0x311d73){logger[_0x7c6d('0xe')]('CreateReportAgentPreview',_0x311d73[_0x7c6d('0xf')],_0x855d7a);_0x48a606(_0x3c9951['error'](0x1f4,_0x311d73[_0x7c6d('0xf')]));});});}; \ No newline at end of file +var _0x2baf=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','options','raw','CreateReportAgentPreview','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1a60c7,_0x33680c){var _0x1f2269=function(_0x1c3c60){while(--_0x1c3c60){_0x1a60c7['push'](_0x1a60c7['shift']());}};_0x1f2269(++_0x33680c);}(_0x2baf,0xd2));var _0xf2ba=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0x2baf[_0xcf4569];return _0x7fef;};'use strict';var _=require(_0xf2ba('0x0'));var util=require('util');var moment=require(_0xf2ba('0x1'));var BPromise=require('bluebird');var rs=require(_0xf2ba('0x2'));var fs=require('fs');var Redis=require(_0xf2ba('0x3'));var db=require(_0xf2ba('0x4'))['db'];var utils=require(_0xf2ba('0x5'));var logger=require(_0xf2ba('0x6'))(_0xf2ba('0x7'));var config=require(_0xf2ba('0x8'));var jayson=require(_0xf2ba('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x227b87,_0x4ba1ae,_0x1514dd){return new BPromise(function(_0x11510c,_0x947fc6){return client[_0xf2ba('0xa')](_0x227b87,_0x1514dd)[_0xf2ba('0xb')](function(_0x4cb17e){logger[_0xf2ba('0xc')](_0xf2ba('0xd'),_0x4ba1ae,_0xf2ba('0xe'));logger[_0xf2ba('0xf')](_0xf2ba('0x10'),_0x4ba1ae,_0xf2ba('0xe'),JSON[_0xf2ba('0x11')](_0x4cb17e));if(_0x4cb17e[_0xf2ba('0x12')]){if(_0x4cb17e[_0xf2ba('0x12')][_0xf2ba('0x13')]===0x1f4){logger[_0xf2ba('0x12')](_0xf2ba('0xd'),_0x4ba1ae,_0x4cb17e[_0xf2ba('0x12')]['message']);return _0x947fc6(_0x4cb17e[_0xf2ba('0x12')][_0xf2ba('0x14')]);}logger[_0xf2ba('0x12')](_0xf2ba('0xd'),_0x4ba1ae,_0x4cb17e[_0xf2ba('0x12')][_0xf2ba('0x14')]);return _0x11510c(_0x4cb17e['error'][_0xf2ba('0x14')]);}else{logger[_0xf2ba('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x4ba1ae,_0xf2ba('0xe'));_0x11510c(_0x4cb17e[_0xf2ba('0x15')]['message']);}})[_0xf2ba('0x16')](function(_0x198b67){logger[_0xf2ba('0x12')](_0xf2ba('0xd'),_0x4ba1ae,_0x198b67);_0x947fc6(_0x198b67);});});}exports['CreateReportAgentPreview']=function(_0x1e29bb){var _0x4e5be6=this;return new Promise(function(_0x41c77b,_0x27ff6b){return db['ReportAgentPreview'][_0xf2ba('0x17')](_0x1e29bb['body'],{'raw':_0x1e29bb[_0xf2ba('0x18')]?_0x1e29bb[_0xf2ba('0x18')][_0xf2ba('0x19')]===undefined?!![]:![]:!![]})[_0xf2ba('0xb')](function(_0x4caa72){logger[_0xf2ba('0xc')](_0xf2ba('0x1a'),_0x1e29bb);logger['debug'](_0xf2ba('0x1a'),_0x1e29bb,JSON[_0xf2ba('0x11')](_0x4caa72));_0x41c77b(_0x4caa72);})[_0xf2ba('0x16')](function(_0x168f5f){logger[_0xf2ba('0x12')](_0xf2ba('0x1a'),_0x168f5f['message'],_0x1e29bb);_0x27ff6b(_0x4e5be6[_0xf2ba('0x12')](0x1f4,_0x168f5f[_0xf2ba('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 337f62d..99ea1ab 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 _0xa2a3=['whatsappQueues','/fax/queues','/voice/queues/preview/:id','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','multer','util','path','express','Router','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','get','/voice/queues','/chat/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues'];(function(_0x46d8b2,_0x3829c4){var _0x1a351f=function(_0x279ce5){while(--_0x279ce5){_0x46d8b2['push'](_0x46d8b2['shift']());}};_0x1a351f(++_0x3829c4);}(_0xa2a3,0x120));var _0x3a2a=function(_0x377ddf,_0x102e9a){_0x377ddf=_0x377ddf-0x0;var _0x5b8465=_0xa2a3[_0x377ddf];return _0x5b8465;};'use strict';var multer=require(_0x3a2a('0x0'));var util=require(_0x3a2a('0x1'));var path=require(_0x3a2a('0x2'));var express=require(_0x3a2a('0x3'));var router=express[_0x3a2a('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0x3a2a('0x5'));router['get'](_0x3a2a('0x6'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x8')]);router['get'](_0x3a2a('0x9'),auth[_0x3a2a('0x7')](),controller['voiceChannelMixMonitor']);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x3a2a('0x7')](),controller['voiceChannelStopMixMonitor']);router[_0x3a2a('0xa')](_0x3a2a('0xb'),auth[_0x3a2a('0x7')](),controller['voiceQueues']);router[_0x3a2a('0xa')](_0x3a2a('0xc'),auth[_0x3a2a('0x7')](),controller['chatQueues']);router[_0x3a2a('0xa')]('/mail/queues',auth[_0x3a2a('0x7')](),controller[_0x3a2a('0xd')]);router[_0x3a2a('0xa')](_0x3a2a('0xe'),auth[_0x3a2a('0x7')](),controller['mailAccounts']);router[_0x3a2a('0xa')](_0x3a2a('0xf'),auth['isAuthenticated'](),controller[_0x3a2a('0x10')]);router[_0x3a2a('0xa')](_0x3a2a('0x11'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x12')]);router[_0x3a2a('0xa')](_0x3a2a('0x13'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x14')]);router[_0x3a2a('0xa')](_0x3a2a('0x15'),auth[_0x3a2a('0x7')](),controller['faxQueues']);router['get'](_0x3a2a('0x16'),auth[_0x3a2a('0x7')](),controller['voiceQueuesPreview']);router[_0x3a2a('0xa')]('/voice/queues/channels',auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0x3a2a('0xa')](_0x3a2a('0x17'),auth[_0x3a2a('0x7')](),controller['voiceQueuesChannel']);router['get'](_0x3a2a('0x18'),auth[_0x3a2a('0x7')](),controller['voiceQueuesChannelHangup']);router[_0x3a2a('0xa')](_0x3a2a('0x19'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x1a')]);router[_0x3a2a('0xa')](_0x3a2a('0x1b'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x1c')]);router[_0x3a2a('0x1d')](_0x3a2a('0x1b'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x1e')]);router[_0x3a2a('0xa')](_0x3a2a('0x1f'),auth['isAuthenticated'](),controller['outbound']);router['get'](_0x3a2a('0x20'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x21')]);router[_0x3a2a('0xa')](_0x3a2a('0x22'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x23')]);router[_0x3a2a('0x1d')](_0x3a2a('0x24'),auth['isAuthenticated'](),controller[_0x3a2a('0x25')]);router['get'](_0x3a2a('0x26'),auth['isAuthenticated'](),controller[_0x3a2a('0x27')]);router[_0x3a2a('0xa')](_0x3a2a('0x28'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x29')]);router[_0x3a2a('0xa')](_0x3a2a('0x2a'),auth[_0x3a2a('0x7')](),controller['campaigns']);router['get'](_0x3a2a('0x2b'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x2c')]);router[_0x3a2a('0xa')](_0x3a2a('0x2d'),auth['isAuthenticated'](),controller[_0x3a2a('0x2e')]);router[_0x3a2a('0xa')](_0x3a2a('0x2f'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x30')]);router[_0x3a2a('0xa')](_0x3a2a('0x31'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x32')]);router[_0x3a2a('0xa')](_0x3a2a('0x33'),auth[_0x3a2a('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x3a2a('0xa')](_0x3a2a('0x34'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x35')]);router['get'](_0x3a2a('0x36'),auth[_0x3a2a('0x7')](),controller['whatsappQueuesWaitingInteractions']);router[_0x3a2a('0xa')](_0x3a2a('0x37'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x3a2a('0x38')](_0x3a2a('0x39'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x3a')]('mail'));router[_0x3a2a('0xa')](_0x3a2a('0x3b'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x3c')]);router['post'](_0x3a2a('0x3d'),auth[_0x3a2a('0x7')](),controller['queueNotify'](_0x3a2a('0x3e')));router[_0x3a2a('0xa')](_0x3a2a('0x3f'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x40')]);router[_0x3a2a('0x38')]('/fax/queues/:id/notify',auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x3a')]('fax'));router[_0x3a2a('0xa')]('/fax/queues/:id',auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x41')]);router['post']('/openchannel/queues/:id/notify',auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x3a')](_0x3a2a('0x42')));router[_0x3a2a('0xa')](_0x3a2a('0x43'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x44')]);router[_0x3a2a('0x38')](_0x3a2a('0x45'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x3a')](_0x3a2a('0x46')));router['post'](_0x3a2a('0x47'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x3a')]('whatsapp'));router[_0x3a2a('0xa')](_0x3a2a('0x48'),auth[_0x3a2a('0x7')](),controller[_0x3a2a('0x49')]);router[_0x3a2a('0xa')](_0x3a2a('0x4a'),auth[_0x3a2a('0x7')](),controller['showWhatsappQueues']);router[_0x3a2a('0x38')](_0x3a2a('0x4b'),auth['isAuthenticated'](),controller[_0x3a2a('0x4c')]);module['exports']=router; \ No newline at end of file +var _0xca41=['put','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','trunks','/campaigns','campaigns','/fax/accounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','path','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id'];(function(_0xcea16,_0x197063){var _0x155c9d=function(_0xc0cd08){while(--_0xc0cd08){_0xcea16['push'](_0xcea16['shift']());}};_0x155c9d(++_0x197063);}(_0xca41,0x129));var _0x1ca4=function(_0x4374ec,_0x2d53bd){_0x4374ec=_0x4374ec-0x0;var _0x22fa29=_0xca41[_0x4374ec];return _0x22fa29;};'use strict';var multer=require(_0x1ca4('0x0'));var util=require('util');var path=require(_0x1ca4('0x1'));var express=require(_0x1ca4('0x2'));var router=express[_0x1ca4('0x3')]();var auth=require(_0x1ca4('0x4'));var controller=require(_0x1ca4('0x5'));router['get'](_0x1ca4('0x6'),auth['isAuthenticated'](),controller[_0x1ca4('0x7')]);router[_0x1ca4('0x8')](_0x1ca4('0x9'),auth['isAuthenticated'](),controller[_0x1ca4('0xa')]);router[_0x1ca4('0x8')](_0x1ca4('0xb'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0xd')]);router[_0x1ca4('0x8')](_0x1ca4('0xe'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0xf')]);router[_0x1ca4('0x8')](_0x1ca4('0x10'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x11')]);router[_0x1ca4('0x8')](_0x1ca4('0x12'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x13')]);router['get']('/mail/accounts',auth['isAuthenticated'](),controller[_0x1ca4('0x14')]);router[_0x1ca4('0x8')]('/openchannel/queues',auth['isAuthenticated'](),controller[_0x1ca4('0x15')]);router[_0x1ca4('0x8')](_0x1ca4('0x16'),auth['isAuthenticated'](),controller[_0x1ca4('0x17')]);router[_0x1ca4('0x8')](_0x1ca4('0x18'),auth['isAuthenticated'](),controller['whatsappQueues']);router[_0x1ca4('0x8')](_0x1ca4('0x19'),auth[_0x1ca4('0xc')](),controller['faxQueues']);router[_0x1ca4('0x8')](_0x1ca4('0x1a'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x1b')]);router[_0x1ca4('0x8')](_0x1ca4('0x1c'),auth['isAuthenticated'](),controller[_0x1ca4('0x1d')]);router[_0x1ca4('0x8')](_0x1ca4('0x1e'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x1f')]);router['get'](_0x1ca4('0x20'),auth['isAuthenticated'](),controller[_0x1ca4('0x21')]);router[_0x1ca4('0x8')](_0x1ca4('0x22'),auth[_0x1ca4('0xc')](),controller['showVoiceQueues']);router[_0x1ca4('0x23')](_0x1ca4('0x22'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x24')]);router[_0x1ca4('0x8')](_0x1ca4('0x25'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x26')]);router[_0x1ca4('0x8')]('/outbound/channels',auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x27')]);router[_0x1ca4('0x8')](_0x1ca4('0x28'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x29')]);router[_0x1ca4('0x23')](_0x1ca4('0x2a'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x2b')]);router[_0x1ca4('0x8')]('/telephones',auth[_0x1ca4('0xc')](),controller['telephones']);router[_0x1ca4('0x8')]('/trunks',auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x2c')]);router[_0x1ca4('0x8')](_0x1ca4('0x2d'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x2e')]);router[_0x1ca4('0x8')](_0x1ca4('0x2f'),auth[_0x1ca4('0xc')](),controller['faxAccounts']);router[_0x1ca4('0x8')]('/chat/queues/waitinginteractions',auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x30')]);router[_0x1ca4('0x8')](_0x1ca4('0x31'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x32')]);router['get'](_0x1ca4('0x33'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x34')]);router[_0x1ca4('0x8')]('/openchannel/queues/:id/waitinginteractions',auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x35')]);router['get'](_0x1ca4('0x36'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x37')]);router[_0x1ca4('0x8')](_0x1ca4('0x38'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x39')]);router['get'](_0x1ca4('0x3a'),auth[_0x1ca4('0xc')](),controller['faxQueuesWaitingInteractions']);router[_0x1ca4('0x3b')]('/mail/queues/:id/notify',auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x3c')](_0x1ca4('0x3d')));router[_0x1ca4('0x8')]('/mail/queues/:id',auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x3e')]);router[_0x1ca4('0x3b')](_0x1ca4('0x3f'),auth[_0x1ca4('0xc')](),controller['queueNotify'](_0x1ca4('0x40')));router[_0x1ca4('0x8')](_0x1ca4('0x41'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x42')]);router[_0x1ca4('0x3b')](_0x1ca4('0x43'),auth['isAuthenticated'](),controller['queueNotify'](_0x1ca4('0x44')));router[_0x1ca4('0x8')](_0x1ca4('0x45'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x46')]);router[_0x1ca4('0x3b')](_0x1ca4('0x47'),auth['isAuthenticated'](),controller[_0x1ca4('0x3c')]('openchannel'));router[_0x1ca4('0x8')]('/openchannel/queues/:id',auth[_0x1ca4('0xc')](),controller['showOpenchannelQueues']);router['post'](_0x1ca4('0x48'),auth['isAuthenticated'](),controller[_0x1ca4('0x3c')](_0x1ca4('0x49')));router[_0x1ca4('0x3b')](_0x1ca4('0x4a'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x3c')](_0x1ca4('0x4b')));router[_0x1ca4('0x8')](_0x1ca4('0x4c'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x4d')]);router[_0x1ca4('0x8')](_0x1ca4('0x4e'),auth['isAuthenticated'](),controller[_0x1ca4('0x4f')]);router[_0x1ca4('0x3b')](_0x1ca4('0x50'),auth[_0x1ca4('0xc')](),controller[_0x1ca4('0x51')]);module[_0x1ca4('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 b85f1e1..126cdc5 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 _0x3e74=['http','client','then','error','code','message','result','sendStatus','stack','name','status','isNil','find','rows','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','showFaxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','MessageId','From','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','InteractionId','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','jayson/promise'];(function(_0x451009,_0x2b7f20){var _0x5e8d6e=function(_0x5e4784){while(--_0x5e4784){_0x451009['push'](_0x451009['shift']());}};_0x5e8d6e(++_0x2b7f20);}(_0x3e74,0x175));var _0x43e7=function(_0x2e5883,_0x50b5fd){_0x2e5883=_0x2e5883-0x0;var _0x59fa6a=_0x3e74[_0x2e5883];return _0x59fa6a;};'use strict';var BPromise=require(_0x43e7('0x0'));var moment=require('moment');var _=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var db=require(_0x43e7('0x3'))['db'];var logger=require('../../config/logger')('api');var jayson=require(_0x43e7('0x4'));var amiClient=jayson['client'][_0x43e7('0x5')]({'port':0x232a});var mailClient=jayson[_0x43e7('0x6')][_0x43e7('0x5')]({'port':0x232b});var routingClient=jayson[_0x43e7('0x6')][_0x43e7('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){var _0x21f491=_0x3491d6?_0x3491d6:amiClient;return _0x21f491['request'](_0x503698,_0x45a0d1)[_0x43e7('0x7')](function(_0x554d44){if(_0x554d44['error']){if(_0x554d44[_0x43e7('0x8')][_0x43e7('0x9')]===0x1f4){return _0x8528fc(_0x554d44['error'][_0x43e7('0xa')]);}return _0x2ede2d(_0x554d44['error'][_0x43e7('0xa')]);}else{_0x2ede2d(_0x554d44[_0x43e7('0xb')]);}})['catch'](function(_0x3eb206){_0x8528fc(_0x3eb206);});});}function respondWithResult(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xc8;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['status'](_0x2718d3)['json'](_0x3bb83f);}return _0xc960ea[_0x43e7('0xc')](0x194);};}function handleError(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0x1f4;return function(_0x51b974){logger['error'](_0x51b974[_0x43e7('0xd')]);if(_0x51b974[_0x43e7('0xe')]){delete _0x51b974[_0x43e7('0xe')];}_0x21fdd3[_0x43e7('0xf')](_0x44b0bd)['send'](_0x51b974);};}function findById(_0x5c4eaa){return function(_0xdf16c){if(!_[_0x43e7('0x10')](_0x5c4eaa)&&!_[_0x43e7('0x10')](_0xdf16c)&&!_['isNil'](_0xdf16c['rows'])){return _[_0x43e7('0x11')](_0xdf16c[_0x43e7('0x12')],function(_0x9037d3){return _0x9037d3['id']==_0x5c4eaa;});}return null;};}exports[_0x43e7('0x13')]=function(_0x3776f5,_0x1f24fb){return respondWithRpcPromise(_0x43e7('0x14'),_0x3776f5[_0x43e7('0x15')])[_0x43e7('0x7')](respondWithResult(_0x1f24fb,null))[_0x43e7('0x16')](handleError(_0x1f24fb,null));};exports[_0x43e7('0x17')]=function(_0x177ee1,_0x4b5d64){return respondWithRpcPromise(_0x43e7('0x18'),_[_0x43e7('0x19')](_0x177ee1['query'],_0x177ee1[_0x43e7('0x1a')]))[_0x43e7('0x7')](respondWithResult(_0x4b5d64,null))[_0x43e7('0x16')](handleError(_0x4b5d64,null));};exports[_0x43e7('0x1b')]=function(_0x4077fb,_0x2f4cb4){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x43e7('0x19')](_0x4077fb['query'],_0x4077fb['params']))[_0x43e7('0x7')](respondWithResult(_0x2f4cb4,null))[_0x43e7('0x16')](handleError(_0x2f4cb4,null));};exports['voiceQueues']=function(_0x1f0673,_0x4ca5cf){return respondWithRpcPromise(_0x43e7('0x1c'),_0x1f0673['query'])[_0x43e7('0x7')](respondWithResult(_0x4ca5cf,null))[_0x43e7('0x16')](handleError(_0x4ca5cf,null));};exports[_0x43e7('0x1d')]=function(_0x405f85,_0x51f4d7){return respondWithRpcPromise('VoiceQueues',_0x405f85[_0x43e7('0x15')])['then'](findById(_0x405f85[_0x43e7('0x1a')]['id']))[_0x43e7('0x7')](respondWithResult(_0x51f4d7,null))[_0x43e7('0x16')](handleError(_0x51f4d7,null));};exports[_0x43e7('0x1e')]=function(_0x5087d7,_0x33a1a5){return respondWithRpcPromise(_0x43e7('0x1f'),_[_0x43e7('0x19')](_0x5087d7[_0x43e7('0x20')],_0x5087d7[_0x43e7('0x1a')]))[_0x43e7('0x7')](respondWithResult(_0x33a1a5,null))[_0x43e7('0x16')](handleError(_0x33a1a5,null));};exports[_0x43e7('0x21')]=function(_0x3bf475,_0x35dbcd){return respondWithRpcPromise(_0x43e7('0x22'),_[_0x43e7('0x19')](_0x3bf475[_0x43e7('0x15')],_0x3bf475[_0x43e7('0x1a')]))['then'](respondWithResult(_0x35dbcd,null))[_0x43e7('0x16')](handleError(_0x35dbcd,null));};exports[_0x43e7('0x23')]=function(_0x3b8f78,_0x183c81){return respondWithRpcPromise(_0x43e7('0x24'),_0x3b8f78['query'])[_0x43e7('0x7')](respondWithResult(_0x183c81,null))[_0x43e7('0x16')](handleError(_0x183c81,null));};exports[_0x43e7('0x25')]=function(_0x3f280d,_0x4c61b9){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x3f280d[_0x43e7('0x15')],_0x3f280d[_0x43e7('0x1a')]))[_0x43e7('0x7')](respondWithResult(_0x4c61b9,null))[_0x43e7('0x16')](handleError(_0x4c61b9,null));};exports[_0x43e7('0x26')]=function(_0xde7ed,_0x485c6c){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0xde7ed['query'],_0xde7ed['params']))['then'](respondWithResult(_0x485c6c,null))['catch'](handleError(_0x485c6c,null));};exports[_0x43e7('0x27')]=function(_0x49cda6,_0x2b4bfd){return respondWithRpcPromise(_0x43e7('0x28'),_[_0x43e7('0x19')](_0x49cda6[_0x43e7('0x15')],_0x49cda6[_0x43e7('0x1a')]))[_0x43e7('0x7')](respondWithResult(_0x2b4bfd,null))[_0x43e7('0x16')](handleError(_0x2b4bfd,null));};exports['outbound']=function(_0x5332d9,_0x5d84f4){return respondWithRpcPromise(_0x43e7('0x29'),_0x5332d9[_0x43e7('0x15')])[_0x43e7('0x7')](respondWithResult(_0x5d84f4,null))[_0x43e7('0x16')](handleError(_0x5d84f4,null));};exports[_0x43e7('0x2a')]=function(_0x1ed538,_0x1d4589){return respondWithRpcPromise(_0x43e7('0x2b'),_0x1ed538['query'])[_0x43e7('0x7')](respondWithResult(_0x1d4589,null))[_0x43e7('0x16')](handleError(_0x1d4589,null));};exports['agents']=function(_0x2d54c1,_0x4c0c7a){var _0x44d8e4;return respondWithRpcPromise(_0x43e7('0x2c'),_0x2d54c1[_0x43e7('0x15')])[_0x43e7('0x7')](function(_0x35ac85){_0x44d8e4=_0x35ac85;return respondWithRpcPromise(_0x43e7('0x2c'),_0x2d54c1['query'],routingClient);})['then'](function(_0x30dfa9){return _[_0x43e7('0x19')]({},_0x30dfa9,_0x44d8e4);})[_0x43e7('0x7')](respondWithResult(_0x4c0c7a,null))[_0x43e7('0x16')](handleError(_0x4c0c7a,null));};exports[_0x43e7('0x2d')]=function(_0x4a4a85,_0x32a451){if(_0x4a4a85[_0x43e7('0x20')]&&_0x4a4a85['body'][_0x43e7('0x2e')]&&_0x4a4a85['user']&&_0x4a4a85[_0x43e7('0x2f')]['name']){for(var _0x3d81ae in _0x4a4a85[_0x43e7('0x20')][_0x43e7('0x2e')]){if(_0x4a4a85[_0x43e7('0x20')]['interaction']['hasOwnProperty'](_0x3d81ae)){db[_0x43e7('0x30')][_0x43e7('0x31')]({'where':{'channel':_0x3d81ae,'membername':_0x4a4a85[_0x43e7('0x2f')][_0x43e7('0xe')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4a4a85['body']['interaction'][_0x3d81ae]&&_0x4a4a85[_0x43e7('0x20')]['interaction'][_0x3d81ae][_0x43e7('0x32')]?{'$notIn':_0x4a4a85['body']['interaction'][_0x3d81ae]}:{'$ne':null}}})[_0x43e7('0x7')](function(_0x5ee1c5){var _0x2de14f=moment()[_0x43e7('0x33')](_0x43e7('0x34'));for(var _0x99b9e1=0x0,_0x4fc5e8=_0x5ee1c5[_0x43e7('0x32')];_0x99b9e1<_0x4fc5e8;_0x99b9e1+=0x1){_0x5ee1c5[_0x99b9e1][_0x43e7('0x35')]({'exitAt':_0x2de14f});}});for(var _0x23a611=0x0;_0x23a611<_0x4a4a85[_0x43e7('0x20')][_0x43e7('0x2e')][_0x3d81ae][_0x43e7('0x32')];_0x23a611+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x3d81ae,'membername':_0x4a4a85[_0x43e7('0x2f')][_0x43e7('0xe')],'type':_0x43e7('0x36'),'uniqueid':_0x4a4a85['body']['interaction'][_0x3d81ae][_0x23a611],'exitAt':null},'defaults':{'channel':_0x3d81ae,'membername':_0x4a4a85['user'][_0x43e7('0xe')],'interface':_[_0x43e7('0x10')](_0x4a4a85['user'][_0x43e7('0x37')])?util[_0x43e7('0x33')](_0x43e7('0x38'),_0x4a4a85['user']['name']):_0x4a4a85['user']['interface'],'type':_0x43e7('0x36'),'enterAt':moment()[_0x43e7('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x43e7('0x39'),'internal':_0x4a4a85[_0x43e7('0x2f')][_0x43e7('0x3a')],'uniqueid':_0x4a4a85[_0x43e7('0x20')]['interaction'][_0x3d81ae][_0x23a611]}});}}}}return respondWithRpcPromise(_0x43e7('0x3b'),{'id':_0x4a4a85['params']['id'],'capacity':_0x4a4a85['body'][_0x43e7('0x3c')]},routingClient)[_0x43e7('0x7')](respondWithResult(_0x32a451,null))[_0x43e7('0x16')](handleError(_0x32a451,null));};exports[_0x43e7('0x3d')]=function(_0x13503c,_0x2351cf){return respondWithRpcPromise(_0x43e7('0x3e'),_0x13503c[_0x43e7('0x15')])[_0x43e7('0x7')](respondWithResult(_0x2351cf,null))[_0x43e7('0x16')](handleError(_0x2351cf,null));};exports['trunks']=function(_0x119d34,_0x46c910){return respondWithRpcPromise('Trunks',_0x119d34[_0x43e7('0x15')])['then'](respondWithResult(_0x46c910,null))[_0x43e7('0x16')](handleError(_0x46c910,null));};exports[_0x43e7('0x3f')]=function(_0x34e2ec,_0x1f561f){return respondWithRpcPromise(_0x43e7('0x40'),_0x34e2ec['query'])['then'](respondWithResult(_0x1f561f,null))[_0x43e7('0x16')](handleError(_0x1f561f,null));};exports[_0x43e7('0x41')]=function(_0x399942,_0x29c53d){return respondWithRpcPromise(_0x43e7('0x42'),_0x399942[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](respondWithResult(_0x29c53d,null))[_0x43e7('0x16')](handleError(_0x29c53d,null));};exports[_0x43e7('0x43')]=function(_0x24e758,_0x312306){return respondWithRpcPromise('ChatQueues',_0x24e758[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](findById(_0x24e758['params']['id']))[_0x43e7('0x7')](respondWithResult(_0x312306,null))[_0x43e7('0x16')](handleError(_0x312306,null));};exports[_0x43e7('0x44')]=function(_0x558d54,_0x5d63c6){return respondWithRpcPromise(_0x43e7('0x45'),_0x558d54[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x5d63c6,null))[_0x43e7('0x16')](handleError(_0x5d63c6,null));};exports['showMailQueues']=function(_0x49a6ce,_0x1fa3f6){return respondWithRpcPromise(_0x43e7('0x45'),_0x49a6ce[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](findById(_0x49a6ce[_0x43e7('0x1a')]['id']))['then'](respondWithResult(_0x1fa3f6,null))[_0x43e7('0x16')](handleError(_0x1fa3f6,null));};exports[_0x43e7('0x46')]=function(_0x4d89bd,_0x20283b){return respondWithRpcPromise(_0x43e7('0x47'),_0x4d89bd[_0x43e7('0x15')],mailClient)['then'](respondWithResult(_0x20283b,null))['catch'](handleError(_0x20283b,null));};exports['openchannelQueues']=function(_0x2ada55,_0x4058ce){return respondWithRpcPromise(_0x43e7('0x48'),_0x2ada55[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x4058ce,null))['catch'](handleError(_0x4058ce,null));};exports[_0x43e7('0x49')]=function(_0x8b50bb,_0x140438){return respondWithRpcPromise(_0x43e7('0x48'),_0x8b50bb['query'],routingClient)[_0x43e7('0x7')](findById(_0x8b50bb[_0x43e7('0x1a')]['id']))[_0x43e7('0x7')](respondWithResult(_0x140438,null))[_0x43e7('0x16')](handleError(_0x140438,null));};exports[_0x43e7('0x4a')]=function(_0xd41e79,_0x4665db){return respondWithRpcPromise(_0x43e7('0x4b'),_0xd41e79[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](respondWithResult(_0x4665db,null))[_0x43e7('0x16')](handleError(_0x4665db,null));};exports['showSmsQueues']=function(_0x5f3824,_0x2b0711){return respondWithRpcPromise('SmsQueues',_0x5f3824['query'],routingClient)['then'](findById(_0x5f3824[_0x43e7('0x1a')]['id']))[_0x43e7('0x7')](respondWithResult(_0x2b0711,null))['catch'](handleError(_0x2b0711,null));};exports[_0x43e7('0x4c')]=function(_0x135791,_0x1d8438){return respondWithRpcPromise('WhatsappQueues',_0x135791[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](respondWithResult(_0x1d8438,null))[_0x43e7('0x16')](handleError(_0x1d8438,null));};exports[_0x43e7('0x4d')]=function(_0x2f43d7,_0x472a19){return respondWithRpcPromise(_0x43e7('0x4e'),_0x2f43d7['query'],routingClient)[_0x43e7('0x7')](findById(_0x2f43d7[_0x43e7('0x1a')]['id']))[_0x43e7('0x7')](respondWithResult(_0x472a19,null))['catch'](handleError(_0x472a19,null));};exports['faxQueues']=function(_0x30377a,_0x5c3ad8){return respondWithRpcPromise('FaxQueues',_0x30377a[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](respondWithResult(_0x5c3ad8,null))['catch'](handleError(_0x5c3ad8,null));};exports[_0x43e7('0x4f')]=function(_0x28b21d,_0x1e2fed){return respondWithRpcPromise(_0x43e7('0x50'),_0x28b21d[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](findById(_0x28b21d[_0x43e7('0x1a')]['id']))['then'](respondWithResult(_0x1e2fed,null))[_0x43e7('0x16')](handleError(_0x1e2fed,null));};exports[_0x43e7('0x51')]=function(_0x4e5956,_0x418213){return respondWithRpcPromise('FaxAccounts',_0x4e5956[_0x43e7('0x15')])[_0x43e7('0x7')](respondWithResult(_0x418213,null))[_0x43e7('0x16')](handleError(_0x418213,null));};exports[_0x43e7('0x52')]=function(_0x506361,_0x2d25b5){return respondWithRpcPromise(_0x43e7('0x53'),_0x506361[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x2d25b5,null))[_0x43e7('0x16')](handleError(_0x2d25b5,null));};exports[_0x43e7('0x54')]=function(_0x219dc6,_0x703a30){return respondWithRpcPromise(_0x43e7('0x55'),_0x219dc6['query'],routingClient)[_0x43e7('0x7')](respondWithResult(_0x703a30,null))[_0x43e7('0x16')](handleError(_0x703a30,null));};exports[_0x43e7('0x56')]=function(_0x2499ef,_0x433d3c){return respondWithRpcPromise(_0x43e7('0x57'),_0x2499ef[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x433d3c,null))['catch'](handleError(_0x433d3c,null));};exports[_0x43e7('0x58')]=function(_0x536477,_0x550036){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x536477[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](function(_0x230fda){if(_0x536477[_0x43e7('0x15')][_0x43e7('0x59')]!==undefined){var _0x1ae0c8=_(_0x230fda['rows'])[_0x43e7('0x5a')]([_0x536477[_0x43e7('0x15')][_0x43e7('0x59')],_0x536477['params']['id']])[_0x43e7('0x5b')](_0x43e7('0x5c'))[_0x43e7('0x5d')]()[_0x43e7('0x5e')]();return _0x230fda[_0x43e7('0x12')][_0x43e7('0x5a')](function(_0x1d4a29){return _0x1ae0c8[_0x43e7('0x5f')](_0x1d4a29['queue_id'])>-0x1;});}else{return _0x230fda['rows']['filter'](function(_0x156074){return _0x156074[_0x43e7('0x5c')]===parseInt(_0x536477['params']['id']);});}})[_0x43e7('0x7')](respondWithResult(_0x550036,null))[_0x43e7('0x16')](handleError(_0x550036,null));};exports[_0x43e7('0x60')]=function(_0x8e60f1,_0x5a5565){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x8e60f1['query'],routingClient)[_0x43e7('0x7')](respondWithResult(_0x5a5565,null))[_0x43e7('0x16')](handleError(_0x5a5565,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x58cbb7,_0x21adf7){return respondWithRpcPromise(_0x43e7('0x61'),_0x58cbb7[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x21adf7,null))[_0x43e7('0x16')](handleError(_0x21adf7,null));};exports[_0x43e7('0x62')]=function(_0x401654,_0xb04082){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x401654[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0xb04082,null))[_0x43e7('0x16')](handleError(_0xb04082,null));};exports[_0x43e7('0x63')]=function(_0x24a168){return function(_0x90667c,_0xa7cb2c){var _0x45adef,_0x126133;var _0x5e8d4e=_[_0x43e7('0x64')](_0x24a168);var _0x40257e=_0x24a168===_0x43e7('0x65')?_0x43e7('0x66'):'Account';return db[_0x5e8d4e+'Queue']['findOne']({'raw':!![],'where':{'id':_0x90667c[_0x43e7('0x1a')]['id']}})['then'](function(_0x240f0d){if(_[_0x43e7('0x10')](_0x240f0d)){throw new Error(_0x5e8d4e+_0x43e7('0x67'));}_0x45adef=_0x240f0d;return db[_0x5e8d4e+_0x43e7('0x68')][_0x43e7('0x69')]({'where':{'id':_0x90667c[_0x43e7('0x20')][_0x43e7('0x6a')]},'include':[{'model':db[_0x5e8d4e+_0x43e7('0x6b')],'as':_0x43e7('0x6b')},{'model':db[_0x5e8d4e+_0x40257e],'as':_0x43e7('0x6c')}]});})[_0x43e7('0x7')](function(_0x5b3565){if(_[_0x43e7('0x10')](_0x5b3565)){throw new Error(_0x5e8d4e+_0x43e7('0x6d'));}_0x126133=_0x5b3565;return _0x5b3565[_0x43e7('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x43e7('0x7')](function(){var _0x206e54={'uniqueid':_0x24a168+'.'+_0x126133['id']+'.'+_0x126133['Interaction']['id'],'FromUserId':_0x90667c['user']['id'],'type':_0x43e7('0x6f')};_0x206e54[_0x5e8d4e+_0x43e7('0x70')]=_0x126133['id'];_0x206e54[_0x5e8d4e+'InteractionId']=_0x126133[_0x43e7('0x6b')]['id'];_0x206e54[_0x43e7('0x71')+_0x5e8d4e+_0x40257e+'Id']=_0x126133['Account']['id'];_0x206e54['To'+_0x5e8d4e+'QueueId']=_0x45adef['id'];return db[_0x5e8d4e+_0x43e7('0x72')][_0x43e7('0x73')](_0x206e54);})[_0x43e7('0x7')](function(){return respondWithRpcPromise(_0x43e7('0x74'),{'channel':_0x24a168,'interaction':_0x126133[_0x43e7('0x6b')],'message':_0x126133,'account':_0x126133['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x45adef[_0x43e7('0xe')]+','+(_0x126133[_0x43e7('0x6c')][_0x43e7('0x75')]||0x12c),'interval':_0x43e7('0x76')}]},routingClient);})['then'](respondWithResult(_0xa7cb2c,null))[_0x43e7('0x16')](handleError(_0xa7cb2c,null));};};exports[_0x43e7('0x77')]=function(_0x1ed590,_0x15ee83){var _0x5bc060,_0x3a4962;if(_[_0x43e7('0x10')](_0x1ed590[_0x43e7('0x20')][_0x43e7('0x78')])){throw new Error(_0x43e7('0x79'));}var _0x4ef289=_0x1ed590[_0x43e7('0x20')][_0x43e7('0x78')];var _0x509d8d=_[_0x43e7('0x64')](_0x4ef289);var _0x2ca6fb=_0x4ef289===_0x43e7('0x65')?_0x43e7('0x66'):'Account';return db[_0x43e7('0x7a')]['findOne']({'raw':!![],'where':{'id':_0x1ed590[_0x43e7('0x1a')]['id'],'role':_0x43e7('0x39')}})[_0x43e7('0x7')](function(_0x2614ff){if(_[_0x43e7('0x10')](_0x2614ff)){throw new Error(_0x43e7('0x7b'));}_0x5bc060=_0x2614ff;return db[_0x509d8d+_0x43e7('0x68')][_0x43e7('0x69')]({'where':{'id':_0x1ed590[_0x43e7('0x20')]['messageId']},'include':[{'model':db[_0x509d8d+_0x43e7('0x6b')],'as':_0x43e7('0x6b')},{'model':db[_0x509d8d+_0x2ca6fb],'as':_0x43e7('0x6c')}]});})[_0x43e7('0x7')](function(_0x56593f){if(_['isNil'](_0x56593f)){throw new Error(_0x509d8d+_0x43e7('0x6d'));}_0x3a4962=_0x56593f;return _0x56593f[_0x43e7('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x43e7('0x7')](function(){var _0x4d30f7={'uniqueid':_0x4ef289+'.'+_0x3a4962['id']+'.'+_0x3a4962[_0x43e7('0x6b')]['id'],'FromUserId':_0x1ed590['user']['id'],'type':'queue','ToUserId':_0x5bc060['id']};_0x4d30f7[_0x509d8d+'MessageId']=_0x3a4962['id'];_0x4d30f7[_0x509d8d+_0x43e7('0x7c')]=_0x3a4962['Interaction']['id'];_0x4d30f7[_0x43e7('0x71')+_0x509d8d+_0x2ca6fb+'Id']=_0x3a4962[_0x43e7('0x6c')]['id'];return db[_0x509d8d+_0x43e7('0x72')][_0x43e7('0x73')](_0x4d30f7);})[_0x43e7('0x7')](function(){return respondWithRpcPromise('Start',{'channel':_0x4ef289,'interaction':_0x3a4962['Interaction'],'message':_0x3a4962,'account':_0x3a4962[_0x43e7('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x43e7('0x39'),'appdata':_0x5bc060['name']+','+(_0x3a4962[_0x43e7('0x6c')][_0x43e7('0x7d')]||0x12c),'interval':_0x43e7('0x76')}]},routingClient);})[_0x43e7('0x7')](respondWithResult(_0x15ee83,null))[_0x43e7('0x16')](handleError(_0x15ee83,null));}; \ No newline at end of file +var _0xf2ca=['voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','findAll','INTERACTION','length','findOrCreate','interface','format','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','WhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','map','uniq','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','QueueId','*,*,*,*','agentNotify','channel','User','Agent\x20not\x20found','Message','TransferReport','create','Start','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0xf2ca[_0x5a60ce];return _0x393e5e;};'use strict';var BPromise=require(_0xaf2c('0x0'));var moment=require(_0xaf2c('0x1'));var _=require(_0xaf2c('0x2'));var util=require('util');var db=require(_0xaf2c('0x3'))['db'];var logger=require(_0xaf2c('0x4'))(_0xaf2c('0x5'));var jayson=require(_0xaf2c('0x6'));var amiClient=jayson[_0xaf2c('0x7')][_0xaf2c('0x8')]({'port':0x232a});var mailClient=jayson['client'][_0xaf2c('0x8')]({'port':0x232b});var routingClient=jayson[_0xaf2c('0x7')][_0xaf2c('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x1f9531,_0x58351f,_0x37fedd){return new BPromise(function(_0x3c0421,_0x4a7397){var _0x2a011d=_0x37fedd?_0x37fedd:amiClient;return _0x2a011d['request'](_0x1f9531,_0x58351f)[_0xaf2c('0x9')](function(_0x4a0064){if(_0x4a0064[_0xaf2c('0xa')]){if(_0x4a0064[_0xaf2c('0xa')][_0xaf2c('0xb')]===0x1f4){return _0x4a7397(_0x4a0064[_0xaf2c('0xa')]['message']);}return _0x3c0421(_0x4a0064['error'][_0xaf2c('0xc')]);}else{_0x3c0421(_0x4a0064[_0xaf2c('0xd')]);}})[_0xaf2c('0xe')](function(_0xd56a5d){_0x4a7397(_0xd56a5d);});});}function respondWithResult(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xc8;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0xf')](_0x59a59b)[_0xaf2c('0x10')](_0x590126);}return _0x285dac[_0xaf2c('0x11')](0x194);};}function handleError(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0x1f4;return function(_0x152c73){logger[_0xaf2c('0xa')](_0x152c73[_0xaf2c('0x12')]);if(_0x152c73[_0xaf2c('0x13')]){delete _0x152c73[_0xaf2c('0x13')];}_0x18a8a5[_0xaf2c('0xf')](_0x293ca6)[_0xaf2c('0x14')](_0x152c73);};}function findById(_0x26bf7b){return function(_0x3432e4){if(!_[_0xaf2c('0x15')](_0x26bf7b)&&!_['isNil'](_0x3432e4)&&!_[_0xaf2c('0x15')](_0x3432e4['rows'])){return _[_0xaf2c('0x16')](_0x3432e4[_0xaf2c('0x17')],function(_0x1d544a){return _0x1d544a['id']==_0x26bf7b;});}return null;};}exports['voiceChannels']=function(_0x28ae7b,_0x297bcd){return respondWithRpcPromise(_0xaf2c('0x18'),_0x28ae7b[_0xaf2c('0x19')])[_0xaf2c('0x9')](respondWithResult(_0x297bcd,null))[_0xaf2c('0xe')](handleError(_0x297bcd,null));};exports['voiceChannelMixMonitor']=function(_0x35e712,_0x164bcb){return respondWithRpcPromise(_0xaf2c('0x1a'),_[_0xaf2c('0x1b')](_0x35e712[_0xaf2c('0x19')],_0x35e712['params']))[_0xaf2c('0x9')](respondWithResult(_0x164bcb,null))[_0xaf2c('0xe')](handleError(_0x164bcb,null));};exports[_0xaf2c('0x1c')]=function(_0x4be6ed,_0x59b113){return respondWithRpcPromise(_0xaf2c('0x1d'),_[_0xaf2c('0x1b')](_0x4be6ed[_0xaf2c('0x19')],_0x4be6ed[_0xaf2c('0x1e')]))['then'](respondWithResult(_0x59b113,null))[_0xaf2c('0xe')](handleError(_0x59b113,null));};exports[_0xaf2c('0x1f')]=function(_0x3a0145,_0x3c1ae6){return respondWithRpcPromise(_0xaf2c('0x20'),_0x3a0145[_0xaf2c('0x19')])[_0xaf2c('0x9')](respondWithResult(_0x3c1ae6,null))['catch'](handleError(_0x3c1ae6,null));};exports[_0xaf2c('0x21')]=function(_0x2051be,_0x36f37c){return respondWithRpcPromise(_0xaf2c('0x20'),_0x2051be['query'])[_0xaf2c('0x9')](findById(_0x2051be['params']['id']))[_0xaf2c('0x9')](respondWithResult(_0x36f37c,null))[_0xaf2c('0xe')](handleError(_0x36f37c,null));};exports[_0xaf2c('0x22')]=function(_0x5d685a,_0x2747bb){return respondWithRpcPromise(_0xaf2c('0x23'),_[_0xaf2c('0x1b')](_0x5d685a['body'],_0x5d685a[_0xaf2c('0x1e')]))[_0xaf2c('0x9')](respondWithResult(_0x2747bb,null))[_0xaf2c('0xe')](handleError(_0x2747bb,null));};exports[_0xaf2c('0x24')]=function(_0x59d858,_0x3da072){return respondWithRpcPromise(_0xaf2c('0x25'),_[_0xaf2c('0x1b')](_0x59d858['query'],_0x59d858['params']))[_0xaf2c('0x9')](respondWithResult(_0x3da072,null))['catch'](handleError(_0x3da072,null));};exports[_0xaf2c('0x26')]=function(_0x5e7247,_0x337cea){return respondWithRpcPromise(_0xaf2c('0x27'),_0x5e7247['query'])[_0xaf2c('0x9')](respondWithResult(_0x337cea,null))[_0xaf2c('0xe')](handleError(_0x337cea,null));};exports['voiceQueuesChannel']=function(_0x13ced2,_0xbec302){return respondWithRpcPromise(_0xaf2c('0x28'),_[_0xaf2c('0x1b')](_0x13ced2[_0xaf2c('0x19')],_0x13ced2[_0xaf2c('0x1e')]))['then'](respondWithResult(_0xbec302,null))[_0xaf2c('0xe')](handleError(_0xbec302,null));};exports['voiceQueuesChannelHangup']=function(_0x321f7c,_0x514bff){return respondWithRpcPromise(_0xaf2c('0x29'),_['merge'](_0x321f7c[_0xaf2c('0x19')],_0x321f7c['params']))[_0xaf2c('0x9')](respondWithResult(_0x514bff,null))['catch'](handleError(_0x514bff,null));};exports[_0xaf2c('0x2a')]=function(_0x356402,_0x1a6929){return respondWithRpcPromise(_0xaf2c('0x2b'),_[_0xaf2c('0x1b')](_0x356402['query'],_0x356402['params']))[_0xaf2c('0x9')](respondWithResult(_0x1a6929,null))[_0xaf2c('0xe')](handleError(_0x1a6929,null));};exports[_0xaf2c('0x2c')]=function(_0xa44813,_0x4eeecf){return respondWithRpcPromise(_0xaf2c('0x2d'),_0xa44813['query'])[_0xaf2c('0x9')](respondWithResult(_0x4eeecf,null))[_0xaf2c('0xe')](handleError(_0x4eeecf,null));};exports['outboundChannels']=function(_0x36081a,_0x24668d){return respondWithRpcPromise(_0xaf2c('0x2e'),_0x36081a[_0xaf2c('0x19')])[_0xaf2c('0x9')](respondWithResult(_0x24668d,null))[_0xaf2c('0xe')](handleError(_0x24668d,null));};exports[_0xaf2c('0x2f')]=function(_0x310d3b,_0x296ca8){var _0x106eb9;return respondWithRpcPromise(_0xaf2c('0x30'),_0x310d3b[_0xaf2c('0x19')])[_0xaf2c('0x9')](function(_0x4b524d){_0x106eb9=_0x4b524d;return respondWithRpcPromise('Agents',_0x310d3b['query'],routingClient);})[_0xaf2c('0x9')](function(_0x3cb075){return _[_0xaf2c('0x1b')]({},_0x3cb075,_0x106eb9);})[_0xaf2c('0x9')](respondWithResult(_0x296ca8,null))[_0xaf2c('0xe')](handleError(_0x296ca8,null));};exports[_0xaf2c('0x31')]=function(_0x51c441,_0x1d58bd){if(_0x51c441[_0xaf2c('0x32')]&&_0x51c441[_0xaf2c('0x32')]['interaction']&&_0x51c441['user']&&_0x51c441[_0xaf2c('0x33')]['name']){for(var _0x181787 in _0x51c441[_0xaf2c('0x32')][_0xaf2c('0x34')]){if(_0x51c441[_0xaf2c('0x32')]['interaction'][_0xaf2c('0x35')](_0x181787)){db['MemberReport'][_0xaf2c('0x36')]({'where':{'channel':_0x181787,'membername':_0x51c441[_0xaf2c('0x33')]['name'],'type':_0xaf2c('0x37'),'exitAt':null,'uniqueid':_0x51c441['body'][_0xaf2c('0x34')][_0x181787]&&_0x51c441[_0xaf2c('0x32')][_0xaf2c('0x34')][_0x181787][_0xaf2c('0x38')]?{'$notIn':_0x51c441[_0xaf2c('0x32')][_0xaf2c('0x34')][_0x181787]}:{'$ne':null}}})[_0xaf2c('0x9')](function(_0x16b469){var _0x922b9=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x18e62b=0x0,_0x4d0977=_0x16b469['length'];_0x18e62b<_0x4d0977;_0x18e62b+=0x1){_0x16b469[_0x18e62b]['updateAttributes']({'exitAt':_0x922b9});}});for(var _0x11a90a=0x0;_0x11a90a<_0x51c441[_0xaf2c('0x32')][_0xaf2c('0x34')][_0x181787][_0xaf2c('0x38')];_0x11a90a+=0x1){db['MemberReport'][_0xaf2c('0x39')]({'where':{'channel':_0x181787,'membername':_0x51c441['user'][_0xaf2c('0x13')],'type':'INTERACTION','uniqueid':_0x51c441[_0xaf2c('0x32')][_0xaf2c('0x34')][_0x181787][_0x11a90a],'exitAt':null},'defaults':{'channel':_0x181787,'membername':_0x51c441[_0xaf2c('0x33')][_0xaf2c('0x13')],'interface':_[_0xaf2c('0x15')](_0x51c441['user'][_0xaf2c('0x3a')])?util[_0xaf2c('0x3b')]('SIP/%s',_0x51c441['user'][_0xaf2c('0x13')]):_0x51c441['user'][_0xaf2c('0x3a')],'type':_0xaf2c('0x37'),'enterAt':moment()[_0xaf2c('0x3b')](_0xaf2c('0x3c')),'role':_0xaf2c('0x3d'),'internal':_0x51c441[_0xaf2c('0x33')][_0xaf2c('0x3e')],'uniqueid':_0x51c441[_0xaf2c('0x32')][_0xaf2c('0x34')][_0x181787][_0x11a90a]}});}}}}return respondWithRpcPromise(_0xaf2c('0x3f'),{'id':_0x51c441[_0xaf2c('0x1e')]['id'],'capacity':_0x51c441['body'][_0xaf2c('0x40')]},routingClient)[_0xaf2c('0x9')](respondWithResult(_0x1d58bd,null))['catch'](handleError(_0x1d58bd,null));};exports['telephones']=function(_0x56d7ce,_0x7ddca0){return respondWithRpcPromise(_0xaf2c('0x41'),_0x56d7ce['query'])[_0xaf2c('0x9')](respondWithResult(_0x7ddca0,null))[_0xaf2c('0xe')](handleError(_0x7ddca0,null));};exports[_0xaf2c('0x42')]=function(_0x3085e5,_0x265748){return respondWithRpcPromise(_0xaf2c('0x43'),_0x3085e5[_0xaf2c('0x19')])['then'](respondWithResult(_0x265748,null))[_0xaf2c('0xe')](handleError(_0x265748,null));};exports[_0xaf2c('0x44')]=function(_0x5771e5,_0x245797){return respondWithRpcPromise(_0xaf2c('0x45'),_0x5771e5[_0xaf2c('0x19')])[_0xaf2c('0x9')](respondWithResult(_0x245797,null))[_0xaf2c('0xe')](handleError(_0x245797,null));};exports[_0xaf2c('0x46')]=function(_0x332340,_0x15a335){return respondWithRpcPromise(_0xaf2c('0x47'),_0x332340[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](respondWithResult(_0x15a335,null))[_0xaf2c('0xe')](handleError(_0x15a335,null));};exports[_0xaf2c('0x48')]=function(_0x2356a0,_0x297a22){return respondWithRpcPromise(_0xaf2c('0x47'),_0x2356a0[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](findById(_0x2356a0[_0xaf2c('0x1e')]['id']))[_0xaf2c('0x9')](respondWithResult(_0x297a22,null))['catch'](handleError(_0x297a22,null));};exports[_0xaf2c('0x49')]=function(_0x3ac79c,_0xfe5928){return respondWithRpcPromise('MailQueues',_0x3ac79c[_0xaf2c('0x19')],routingClient)['then'](respondWithResult(_0xfe5928,null))[_0xaf2c('0xe')](handleError(_0xfe5928,null));};exports[_0xaf2c('0x4a')]=function(_0xb3ad9,_0x45918b){return respondWithRpcPromise(_0xaf2c('0x4b'),_0xb3ad9[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](findById(_0xb3ad9[_0xaf2c('0x1e')]['id']))[_0xaf2c('0x9')](respondWithResult(_0x45918b,null))['catch'](handleError(_0x45918b,null));};exports[_0xaf2c('0x4c')]=function(_0x400dcd,_0x262937){return respondWithRpcPromise(_0xaf2c('0x4d'),_0x400dcd[_0xaf2c('0x19')],mailClient)['then'](respondWithResult(_0x262937,null))[_0xaf2c('0xe')](handleError(_0x262937,null));};exports[_0xaf2c('0x4e')]=function(_0x506000,_0x33aa67){return respondWithRpcPromise(_0xaf2c('0x4f'),_0x506000['query'],routingClient)['then'](respondWithResult(_0x33aa67,null))[_0xaf2c('0xe')](handleError(_0x33aa67,null));};exports[_0xaf2c('0x50')]=function(_0xc83d19,_0x39c5d2){return respondWithRpcPromise('OpenchannelQueues',_0xc83d19[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](findById(_0xc83d19['params']['id']))[_0xaf2c('0x9')](respondWithResult(_0x39c5d2,null))['catch'](handleError(_0x39c5d2,null));};exports[_0xaf2c('0x51')]=function(_0xe6a251,_0x16e9f4){return respondWithRpcPromise(_0xaf2c('0x52'),_0xe6a251[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](respondWithResult(_0x16e9f4,null))[_0xaf2c('0xe')](handleError(_0x16e9f4,null));};exports[_0xaf2c('0x53')]=function(_0x1520ec,_0xc27601){return respondWithRpcPromise('SmsQueues',_0x1520ec[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](findById(_0x1520ec[_0xaf2c('0x1e')]['id']))[_0xaf2c('0x9')](respondWithResult(_0xc27601,null))[_0xaf2c('0xe')](handleError(_0xc27601,null));};exports['whatsappQueues']=function(_0xbfb776,_0x28b09f){return respondWithRpcPromise(_0xaf2c('0x54'),_0xbfb776[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](respondWithResult(_0x28b09f,null))['catch'](handleError(_0x28b09f,null));};exports['showWhatsappQueues']=function(_0x1166c9,_0x1ead61){return respondWithRpcPromise('WhatsappQueues',_0x1166c9[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](findById(_0x1166c9[_0xaf2c('0x1e')]['id']))['then'](respondWithResult(_0x1ead61,null))[_0xaf2c('0xe')](handleError(_0x1ead61,null));};exports[_0xaf2c('0x55')]=function(_0x18dcde,_0x2aae3a){return respondWithRpcPromise('FaxQueues',_0x18dcde[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](respondWithResult(_0x2aae3a,null))[_0xaf2c('0xe')](handleError(_0x2aae3a,null));};exports[_0xaf2c('0x56')]=function(_0x20c120,_0x1ecf97){return respondWithRpcPromise(_0xaf2c('0x57'),_0x20c120[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](findById(_0x20c120[_0xaf2c('0x1e')]['id']))[_0xaf2c('0x9')](respondWithResult(_0x1ecf97,null))['catch'](handleError(_0x1ecf97,null));};exports[_0xaf2c('0x58')]=function(_0x5d965c,_0x1a0795){return respondWithRpcPromise(_0xaf2c('0x59'),_0x5d965c['query'])[_0xaf2c('0x9')](respondWithResult(_0x1a0795,null))['catch'](handleError(_0x1a0795,null));};exports['chatQueuesWaitingInteractions']=function(_0x316333,_0x1d73ef){return respondWithRpcPromise(_0xaf2c('0x5a'),_0x316333['query'],routingClient)['then'](respondWithResult(_0x1d73ef,null))['catch'](handleError(_0x1d73ef,null));};exports[_0xaf2c('0x5b')]=function(_0x3e972c,_0x517f8d){return respondWithRpcPromise(_0xaf2c('0x5c'),_0x3e972c[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](respondWithResult(_0x517f8d,null))[_0xaf2c('0xe')](handleError(_0x517f8d,null));};exports[_0xaf2c('0x5d')]=function(_0x44303c,_0x4be47b){return respondWithRpcPromise(_0xaf2c('0x5e'),_0x44303c[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](respondWithResult(_0x4be47b,null))['catch'](handleError(_0x4be47b,null));};exports[_0xaf2c('0x5f')]=function(_0x3c53ff,_0x37ee02){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x3c53ff[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](function(_0x433f9e){if(_0x3c53ff[_0xaf2c('0x19')]['type']!==undefined){var _0x286a40=_(_0x433f9e[_0xaf2c('0x17')])[_0xaf2c('0x60')]([_0x3c53ff['query']['type'],_0x3c53ff[_0xaf2c('0x1e')]['id']])[_0xaf2c('0x61')]('queue_id')[_0xaf2c('0x62')]()[_0xaf2c('0x63')]();return _0x433f9e['rows'][_0xaf2c('0x60')](function(_0x31cf3e){return _0x286a40[_0xaf2c('0x64')](_0x31cf3e[_0xaf2c('0x65')])>-0x1;});}else{return _0x433f9e[_0xaf2c('0x17')]['filter'](function(_0x5831c9){return _0x5831c9[_0xaf2c('0x65')]===parseInt(_0x3c53ff[_0xaf2c('0x1e')]['id']);});}})[_0xaf2c('0x9')](respondWithResult(_0x37ee02,null))['catch'](handleError(_0x37ee02,null));};exports[_0xaf2c('0x66')]=function(_0x467a36,_0x3d8471){return respondWithRpcPromise(_0xaf2c('0x67'),_0x467a36[_0xaf2c('0x19')],routingClient)['then'](respondWithResult(_0x3d8471,null))[_0xaf2c('0xe')](handleError(_0x3d8471,null));};exports[_0xaf2c('0x68')]=function(_0x154f69,_0x1ef61f){return respondWithRpcPromise(_0xaf2c('0x69'),_0x154f69[_0xaf2c('0x19')],routingClient)['then'](respondWithResult(_0x1ef61f,null))[_0xaf2c('0xe')](handleError(_0x1ef61f,null));};exports[_0xaf2c('0x6a')]=function(_0x483774,_0x5beb89){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x483774[_0xaf2c('0x19')],routingClient)[_0xaf2c('0x9')](respondWithResult(_0x5beb89,null))[_0xaf2c('0xe')](handleError(_0x5beb89,null));};exports[_0xaf2c('0x6b')]=function(_0x499bbe){return function(_0x19fbd5,_0x2d7ca5){var _0x2b57d2,_0x430567;var _0x4ddf95=_[_0xaf2c('0x6c')](_0x499bbe);var _0x23aeac=_0x499bbe===_0xaf2c('0x6d')?_0xaf2c('0x6e'):_0xaf2c('0x6f');return db[_0x4ddf95+'Queue'][_0xaf2c('0x70')]({'raw':!![],'where':{'id':_0x19fbd5[_0xaf2c('0x1e')]['id']}})['then'](function(_0x516193){if(_[_0xaf2c('0x15')](_0x516193)){throw new Error(_0x4ddf95+_0xaf2c('0x71'));}_0x2b57d2=_0x516193;return db[_0x4ddf95+'Message'][_0xaf2c('0x70')]({'where':{'id':_0x19fbd5[_0xaf2c('0x32')][_0xaf2c('0x72')]},'include':[{'model':db[_0x4ddf95+_0xaf2c('0x73')],'as':_0xaf2c('0x73')},{'model':db[_0x4ddf95+_0x23aeac],'as':_0xaf2c('0x6f')}]});})[_0xaf2c('0x9')](function(_0x43c174){if(_['isNil'](_0x43c174)){throw new Error(_0x4ddf95+_0xaf2c('0x74'));}_0x430567=_0x43c174;return _0x43c174['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xaf2c('0x9')](function(){var _0x7724cc={'uniqueid':_0x499bbe+'.'+_0x430567['id']+'.'+_0x430567['Interaction']['id'],'FromUserId':_0x19fbd5['user']['id'],'type':_0xaf2c('0x75')};_0x7724cc[_0x4ddf95+_0xaf2c('0x76')]=_0x430567['id'];_0x7724cc[_0x4ddf95+_0xaf2c('0x77')]=_0x430567['Interaction']['id'];_0x7724cc[_0xaf2c('0x78')+_0x4ddf95+_0x23aeac+'Id']=_0x430567[_0xaf2c('0x6f')]['id'];_0x7724cc['To'+_0x4ddf95+_0xaf2c('0x79')]=_0x2b57d2['id'];return db[_0x4ddf95+'TransferReport']['create'](_0x7724cc);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x499bbe,'interaction':_0x430567[_0xaf2c('0x73')],'message':_0x430567,'account':_0x430567[_0xaf2c('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0xaf2c('0x75'),'appdata':_0x2b57d2[_0xaf2c('0x13')]+','+(_0x430567[_0xaf2c('0x6f')]['queueTransferTimeout']||0x12c),'interval':_0xaf2c('0x7a')}]},routingClient);})[_0xaf2c('0x9')](respondWithResult(_0x2d7ca5,null))['catch'](handleError(_0x2d7ca5,null));};};exports[_0xaf2c('0x7b')]=function(_0x4a3a61,_0x31f1d3){var _0x25d49c,_0x1e403a;if(_[_0xaf2c('0x15')](_0x4a3a61[_0xaf2c('0x32')][_0xaf2c('0x7c')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x47b971=_0x4a3a61[_0xaf2c('0x32')][_0xaf2c('0x7c')];var _0x1bc548=_[_0xaf2c('0x6c')](_0x47b971);var _0x118e78=_0x47b971===_0xaf2c('0x6d')?'Website':'Account';return db[_0xaf2c('0x7d')]['findOne']({'raw':!![],'where':{'id':_0x4a3a61[_0xaf2c('0x1e')]['id'],'role':'agent'}})[_0xaf2c('0x9')](function(_0x639b4b){if(_['isNil'](_0x639b4b)){throw new Error(_0xaf2c('0x7e'));}_0x25d49c=_0x639b4b;return db[_0x1bc548+_0xaf2c('0x7f')][_0xaf2c('0x70')]({'where':{'id':_0x4a3a61['body'][_0xaf2c('0x72')]},'include':[{'model':db[_0x1bc548+_0xaf2c('0x73')],'as':_0xaf2c('0x73')},{'model':db[_0x1bc548+_0x118e78],'as':_0xaf2c('0x6f')}]});})[_0xaf2c('0x9')](function(_0xb311e1){if(_['isNil'](_0xb311e1)){throw new Error(_0x1bc548+'\x20Message\x20not\x20found');}_0x1e403a=_0xb311e1;return _0xb311e1['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2db412={'uniqueid':_0x47b971+'.'+_0x1e403a['id']+'.'+_0x1e403a['Interaction']['id'],'FromUserId':_0x4a3a61[_0xaf2c('0x33')]['id'],'type':'queue','ToUserId':_0x25d49c['id']};_0x2db412[_0x1bc548+'MessageId']=_0x1e403a['id'];_0x2db412[_0x1bc548+_0xaf2c('0x77')]=_0x1e403a[_0xaf2c('0x73')]['id'];_0x2db412['From'+_0x1bc548+_0x118e78+'Id']=_0x1e403a[_0xaf2c('0x6f')]['id'];return db[_0x1bc548+_0xaf2c('0x80')][_0xaf2c('0x81')](_0x2db412);})[_0xaf2c('0x9')](function(){return respondWithRpcPromise(_0xaf2c('0x82'),{'channel':_0x47b971,'interaction':_0x1e403a[_0xaf2c('0x73')],'message':_0x1e403a,'account':_0x1e403a[_0xaf2c('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0xaf2c('0x3d'),'appdata':_0x25d49c[_0xaf2c('0x13')]+','+(_0x1e403a[_0xaf2c('0x6f')]['agentTransferTimeout']||0x12c),'interval':_0xaf2c('0x7a')}]},routingClient);})['then'](respondWithResult(_0x31f1d3,null))[_0xaf2c('0xe')](handleError(_0x31f1d3,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 3c2dbd8..1464b0f 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 _0xb620=['run','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/run'];(function(_0x39eb62,_0x2094e5){var _0x1ec179=function(_0x294ff1){while(--_0x294ff1){_0x39eb62['push'](_0x39eb62['shift']());}};_0x1ec179(++_0x2094e5);}(_0xb620,0x92));var _0x0b62=function(_0x1eaf12,_0x1ef3bf){_0x1eaf12=_0x1eaf12-0x0;var _0x10451c=_0xb620[_0x1eaf12];return _0x10451c;};'use strict';var multer=require(_0x0b62('0x0'));var util=require(_0x0b62('0x1'));var path=require(_0x0b62('0x2'));var timeout=require('connect-timeout');var express=require(_0x0b62('0x3'));var router=express[_0x0b62('0x4')]();var fs_extra=require(_0x0b62('0x5'));var auth=require(_0x0b62('0x6'));var interaction=require(_0x0b62('0x7'));var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0x0b62('0x8')]('/',auth['isAuthenticated'](),controller[_0x0b62('0x9')]);router[_0x0b62('0x8')](_0x0b62('0xa'),auth[_0x0b62('0xb')](),controller[_0x0b62('0xc')]);router[_0x0b62('0x8')](_0x0b62('0xd'),auth[_0x0b62('0xb')](),controller[_0x0b62('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0b62('0xf')]);router[_0x0b62('0x10')](_0x0b62('0xa'),auth['isAuthenticated'](),controller[_0x0b62('0x11')]);router[_0x0b62('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x0b62('0x13')]=router; \ No newline at end of file +var _0x6431=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/run','run','post','put','/:id','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x441c18,_0x50557a){var _0x39bdd3=function(_0x184280){while(--_0x184280){_0x441c18['push'](_0x441c18['shift']());}};_0x39bdd3(++_0x50557a);}(_0x6431,0x160));var _0x1643=function(_0xee95aa,_0x56bc39){_0xee95aa=_0xee95aa-0x0;var _0x301db2=_0x6431[_0xee95aa];return _0x301db2;};'use strict';var multer=require('multer');var util=require(_0x1643('0x0'));var path=require('path');var timeout=require(_0x1643('0x1'));var express=require(_0x1643('0x2'));var router=express[_0x1643('0x3')]();var fs_extra=require(_0x1643('0x4'));var auth=require(_0x1643('0x5'));var interaction=require(_0x1643('0x6'));var config=require(_0x1643('0x7'));var controller=require('./schedule.controller');router[_0x1643('0x8')]('/',auth[_0x1643('0x9')](),controller['index']);router[_0x1643('0x8')]('/:id',auth[_0x1643('0x9')](),controller[_0x1643('0xa')]);router[_0x1643('0x8')](_0x1643('0xb'),auth['isAuthenticated'](),controller[_0x1643('0xc')]);router[_0x1643('0xd')]('/',auth[_0x1643('0x9')](),controller['create']);router[_0x1643('0xe')](_0x1643('0xf'),auth[_0x1643('0x9')](),controller['update']);router['delete']('/:id',auth[_0x1643('0x9')](),controller['destroy']);module[_0x1643('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index abb0f3e..eadf125 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 _0x7101=['DATE','INTEGER','years','days','hours','ENUM','csv','pdf','xlsx','default','custom','TEXT','sequelize','exports','STRING','BOOLEAN'];(function(_0x505cba,_0x160403){var _0x1c800b=function(_0x360e6d){while(--_0x360e6d){_0x505cba['push'](_0x505cba['shift']());}};_0x1c800b(++_0x160403);}(_0x7101,0x9c));var _0x1710=function(_0x357d4f,_0x4a6935){_0x357d4f=_0x357d4f-0x0;var _0x2ed6a4=_0x7101[_0x357d4f];return _0x2ed6a4;};'use strict';var Sequelize=require(_0x1710('0x0'));module[_0x1710('0x1')]={'name':{'type':Sequelize[_0x1710('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1710('0x2')]},'active':{'type':Sequelize[_0x1710('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x1710('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x1710('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x1710('0x6'),'quarters','months','weeks',_0x1710('0x7'),_0x1710('0x8'),'minutes'),'allowNull':![],'defaultValue':_0x1710('0x7')},'output':{'type':Sequelize[_0x1710('0x9')](_0x1710('0xa'),_0x1710('0xb'),_0x1710('0xc')),'allowNull':![],'defaultValue':_0x1710('0xa')},'type':{'type':Sequelize['ENUM']('custom',_0x1710('0xd')),'allowNull':![],'defaultValue':_0x1710('0xe')},'sendMail':{'type':Sequelize[_0x1710('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x1710('0xf')]},'bcc':{'type':Sequelize[_0x1710('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x1710('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x26a0=['exports','STRING','BOOLEAN','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes','csv','xlsx','TEXT'];(function(_0x4897dd,_0x19533a){var _0x59120a=function(_0x15579b){while(--_0x15579b){_0x4897dd['push'](_0x4897dd['shift']());}};_0x59120a(++_0x19533a);}(_0x26a0,0x1e0));var _0x026a=function(_0x25993f,_0x15275f){_0x25993f=_0x25993f-0x0;var _0x1eaa86=_0x26a0[_0x25993f];return _0x1eaa86;};'use strict';var Sequelize=require('sequelize');module[_0x026a('0x0')]={'name':{'type':Sequelize[_0x026a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x026a('0x1')]},'active':{'type':Sequelize[_0x026a('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x026a('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x026a('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x026a('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x026a('0x5')](_0x026a('0x6'),_0x026a('0x7'),_0x026a('0x8'),_0x026a('0x9'),_0x026a('0xa'),_0x026a('0xb'),_0x026a('0xc')),'allowNull':![],'defaultValue':_0x026a('0xa')},'output':{'type':Sequelize[_0x026a('0x5')](_0x026a('0xd'),'pdf',_0x026a('0xe')),'allowNull':![],'defaultValue':_0x026a('0xd')},'type':{'type':Sequelize['ENUM']('custom','default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x026a('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x026a('0x1')]},'cc':{'type':Sequelize[_0x026a('0xf')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x026a('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 7c727d3..2abbfed 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 _0xa0f7=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Schedule','findAll','catch','show','params','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','update','run','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','index','map','fieldName'];(function(_0x193874,_0x30c7e3){var _0xebba4=function(_0x4d2e44){while(--_0x4d2e44){_0x193874['push'](_0x193874['shift']());}};_0xebba4(++_0x30c7e3);}(_0xa0f7,0x117));var _0x7a0f=function(_0x4ec834,_0x4feb6a){_0x4ec834=_0x4ec834-0x0;var _0x13d6ce=_0xa0f7[_0x4ec834];return _0x13d6ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a0f('0x0'));var zipdir=require(_0x7a0f('0x1'));var jsonpatch=require(_0x7a0f('0x2'));var rp=require(_0x7a0f('0x3'));var moment=require('moment');var BPromise=require(_0x7a0f('0x4'));var Mustache=require(_0x7a0f('0x5'));var util=require('util');var path=require(_0x7a0f('0x6'));var sox=require('sox');var csv=require(_0x7a0f('0x7'));var ejs=require(_0x7a0f('0x8'));var fs=require('fs');var fs_extra=require(_0x7a0f('0x9'));var _=require(_0x7a0f('0xa'));var squel=require(_0x7a0f('0xb'));var crypto=require(_0x7a0f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7a0f('0xd'));var toCsv=require(_0x7a0f('0x7'));var querystring=require(_0x7a0f('0xe'));var Papa=require(_0x7a0f('0xf'));var Redis=require(_0x7a0f('0x10'));var authService=require(_0x7a0f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7a0f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a0f('0x13'))(_0x7a0f('0x14'));var utils=require('../../config/utils');var config=require(_0x7a0f('0x15'));var licenseUtil=require(_0x7a0f('0x16'));var db=require(_0x7a0f('0x17'))['db'];function respondWithStatusCode(_0x56ec42,_0x35f217){_0x35f217=_0x35f217||0xcc;return function(_0x863653){if(_0x863653){return _0x56ec42[_0x7a0f('0x18')](_0x35f217);}return _0x56ec42['status'](_0x35f217)[_0x7a0f('0x19')]();};}function respondWithResult(_0x5b92f9,_0x1c8882){_0x1c8882=_0x1c8882||0xc8;return function(_0x30684e){if(_0x30684e){return _0x5b92f9[_0x7a0f('0x1a')](_0x1c8882)[_0x7a0f('0x1b')](_0x30684e);}};}function respondWithFilteredResult(_0x19388c,_0x4ef699){return function(_0xa9c875){if(_0xa9c875){var _0x2b9f8a=typeof _0x4ef699[_0x7a0f('0x1c')]===_0x7a0f('0x1d')&&typeof _0x4ef699[_0x7a0f('0x1e')]==='undefined';var _0x4f5ea4=_0xa9c875[_0x7a0f('0x1f')];var _0x4f6d0a=_0x2b9f8a?0x0:_0x4ef699[_0x7a0f('0x1c')];var _0x5ea117=_0x2b9f8a?_0xa9c875[_0x7a0f('0x1f')]:_0x4ef699[_0x7a0f('0x1c')]+_0x4ef699[_0x7a0f('0x1e')];var _0x1f14fe;if(_0x5ea117>=_0x4f5ea4){_0x5ea117=_0x4f5ea4;_0x1f14fe=0xc8;}else{_0x1f14fe=0xce;}_0x19388c[_0x7a0f('0x1a')](_0x1f14fe);return _0x19388c['set'](_0x7a0f('0x20'),_0x4f6d0a+'-'+_0x5ea117+'/'+_0x4f5ea4)[_0x7a0f('0x1b')](_0xa9c875);}return null;};}function patchUpdates(_0x2359d5){return function(_0x4eebc3){try{jsonpatch['apply'](_0x4eebc3,_0x2359d5,!![]);}catch(_0x273b1a){return BPromise[_0x7a0f('0x21')](_0x273b1a);}return _0x4eebc3['save']();};}function saveUpdates(_0x1e5cd7,_0x89b88){return function(_0x2c839b){if(_0x2c839b){return _0x2c839b['update'](_0x1e5cd7)[_0x7a0f('0x22')](function(_0x26495d){return _0x26495d;});}return null;};}function removeEntity(_0x638ea2,_0x9663b1){return function(_0x59be35){if(_0x59be35){return _0x59be35[_0x7a0f('0x23')]()[_0x7a0f('0x22')](function(){var _0x252f16=_0x59be35[_0x7a0f('0x24')]({'plain':!![]});var _0x58e34d=_0x7a0f('0x25');return db[_0x7a0f('0x26')][_0x7a0f('0x23')]({'where':{'type':_0x58e34d,'resourceId':_0x252f16['id']}})[_0x7a0f('0x22')](function(){return _0x59be35;});})[_0x7a0f('0x22')](function(){_0x638ea2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31db26,_0x4f390e){return function(_0x5805b4){if(!_0x5805b4){_0x31db26[_0x7a0f('0x18')](0x194);}return _0x5805b4;};}function handleError(_0x46ace3,_0x29cc9d){_0x29cc9d=_0x29cc9d||0x1f4;return function(_0x926b84){logger[_0x7a0f('0x27')](_0x926b84[_0x7a0f('0x28')]);if(_0x926b84['name']){delete _0x926b84[_0x7a0f('0x29')];}_0x46ace3[_0x7a0f('0x1a')](_0x29cc9d)['send'](_0x926b84);};}exports[_0x7a0f('0x2a')]=function(_0x3d369a,_0x180b73){var _0x5f0bd6={},_0x2b4df3={},_0xea3429={'count':0x0,'rows':[]};var _0x1dd60e=_[_0x7a0f('0x2b')](db['Schedule']['rawAttributes'],function(_0x3585af){return{'name':_0x3585af[_0x7a0f('0x2c')],'type':_0x3585af['type'][_0x7a0f('0x2d')]};});_0x2b4df3[_0x7a0f('0x2e')]=_['map'](_0x1dd60e,_0x7a0f('0x29'));_0x2b4df3[_0x7a0f('0x2f')]=_[_0x7a0f('0x30')](_0x3d369a[_0x7a0f('0x2f')]);_0x2b4df3[_0x7a0f('0x31')]=_[_0x7a0f('0x32')](_0x2b4df3[_0x7a0f('0x2e')],_0x2b4df3[_0x7a0f('0x2f')]);_0x5f0bd6[_0x7a0f('0x33')]=_['intersection'](_0x2b4df3[_0x7a0f('0x2e')],qs[_0x7a0f('0x34')](_0x3d369a[_0x7a0f('0x2f')][_0x7a0f('0x34')]));_0x5f0bd6[_0x7a0f('0x33')]=_0x5f0bd6['attributes'][_0x7a0f('0x35')]?_0x5f0bd6['attributes']:_0x2b4df3[_0x7a0f('0x2e')];if(!_0x3d369a[_0x7a0f('0x2f')][_0x7a0f('0x36')](_0x7a0f('0x37'))){_0x5f0bd6[_0x7a0f('0x1e')]=qs[_0x7a0f('0x1e')](_0x3d369a[_0x7a0f('0x2f')][_0x7a0f('0x1e')]);_0x5f0bd6['offset']=qs[_0x7a0f('0x1c')](_0x3d369a[_0x7a0f('0x2f')][_0x7a0f('0x1c')]);}_0x5f0bd6[_0x7a0f('0x38')]=qs[_0x7a0f('0x39')](_0x3d369a[_0x7a0f('0x2f')][_0x7a0f('0x39')]);_0x5f0bd6[_0x7a0f('0x3a')]=qs['filters'](_['pick'](_0x3d369a[_0x7a0f('0x2f')],_0x2b4df3[_0x7a0f('0x31')]),_0x1dd60e);if(_0x3d369a[_0x7a0f('0x2f')][_0x7a0f('0x3b')]){_0x5f0bd6['where']=_[_0x7a0f('0x3c')](_0x5f0bd6[_0x7a0f('0x3a')],{'$or':_[_0x7a0f('0x2b')](_0x1dd60e,function(_0x59ab7b){if(_0x59ab7b['type']!==_0x7a0f('0x3d')){var _0x42352f={};_0x42352f[_0x59ab7b[_0x7a0f('0x29')]]={'$like':'%'+_0x3d369a[_0x7a0f('0x2f')]['filter']+'%'};return _0x42352f;}})});}_0x5f0bd6=_['merge']({},_0x5f0bd6,_0x3d369a[_0x7a0f('0x3e')]);var _0x4e45ba={'where':_0x5f0bd6['where']};return db[_0x7a0f('0x3f')][_0x7a0f('0x1f')](_0x4e45ba)[_0x7a0f('0x22')](function(_0x2fc299){_0xea3429[_0x7a0f('0x1f')]=_0x2fc299;if(_0x3d369a[_0x7a0f('0x2f')]['includeAll']){_0x5f0bd6['include']=[{'all':!![]}];}return db[_0x7a0f('0x3f')][_0x7a0f('0x40')](_0x5f0bd6);})[_0x7a0f('0x22')](function(_0x312e31){_0xea3429['rows']=_0x312e31;return _0xea3429;})[_0x7a0f('0x22')](respondWithFilteredResult(_0x180b73,_0x5f0bd6))[_0x7a0f('0x41')](handleError(_0x180b73,null));};exports[_0x7a0f('0x42')]=function(_0x234ef9,_0x15da8b){var _0x52c15f={'raw':![],'where':{'id':_0x234ef9[_0x7a0f('0x43')]['id']}},_0x2e6164={};_0x2e6164[_0x7a0f('0x2e')]=_[_0x7a0f('0x30')](db[_0x7a0f('0x3f')][_0x7a0f('0x44')]);_0x2e6164[_0x7a0f('0x2f')]=_[_0x7a0f('0x30')](_0x234ef9['query']);_0x2e6164[_0x7a0f('0x31')]=_[_0x7a0f('0x32')](_0x2e6164[_0x7a0f('0x2e')],_0x2e6164[_0x7a0f('0x2f')]);_0x52c15f[_0x7a0f('0x33')]=_[_0x7a0f('0x32')](_0x2e6164['model'],qs[_0x7a0f('0x34')](_0x234ef9['query'][_0x7a0f('0x34')]));_0x52c15f['attributes']=_0x52c15f[_0x7a0f('0x33')][_0x7a0f('0x35')]?_0x52c15f['attributes']:_0x2e6164[_0x7a0f('0x2e')];if(_0x234ef9[_0x7a0f('0x2f')][_0x7a0f('0x45')]){_0x52c15f[_0x7a0f('0x46')]=[{'all':!![]}];}_0x52c15f=_[_0x7a0f('0x3c')]({},_0x52c15f,_0x234ef9[_0x7a0f('0x3e')]);return db['Schedule'][_0x7a0f('0x47')](_0x52c15f)['then'](handleEntityNotFound(_0x15da8b,null))[_0x7a0f('0x22')](respondWithResult(_0x15da8b,null))['catch'](handleError(_0x15da8b,null));};exports[_0x7a0f('0x48')]=function(_0x2fd117,_0x455aff){return db[_0x7a0f('0x3f')][_0x7a0f('0x48')](_0x2fd117[_0x7a0f('0x49')],{})[_0x7a0f('0x22')](function(_0x2c769a){var _0x2f1d6c=_0x2fd117[_0x7a0f('0x4a')][_0x7a0f('0x24')]({'plain':!![]});if(!_0x2f1d6c)throw new Error(_0x7a0f('0x4b'));if(_0x2f1d6c[_0x7a0f('0x4c')]===_0x7a0f('0x4a')){var _0x5c593b=_0x2c769a['get']({'plain':!![]});var _0x263aaf=_0x7a0f('0x25');return db[_0x7a0f('0x4d')][_0x7a0f('0x47')]({'where':{'name':_0x263aaf,'userProfileId':_0x2f1d6c['userProfileId']},'raw':!![]})[_0x7a0f('0x22')](function(_0x298ca8){if(_0x298ca8&&_0x298ca8[_0x7a0f('0x4e')]===0x0){return db[_0x7a0f('0x26')][_0x7a0f('0x48')]({'name':_0x5c593b['name'],'resourceId':_0x5c593b['id'],'type':_0x298ca8['name'],'sectionId':_0x298ca8['id']},{})['then'](function(){return _0x2c769a;});}else{return _0x2c769a;}})[_0x7a0f('0x41')](function(_0xf3fb47){logger[_0x7a0f('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf3fb47);throw _0xf3fb47;});}return _0x2c769a;})[_0x7a0f('0x22')](respondWithResult(_0x455aff,0xc9))[_0x7a0f('0x41')](handleError(_0x455aff,null));};exports[_0x7a0f('0x4f')]=function(_0x108a76,_0x5d005f){if(_0x108a76[_0x7a0f('0x49')]['id']){delete _0x108a76[_0x7a0f('0x49')]['id'];}return db[_0x7a0f('0x3f')][_0x7a0f('0x47')]({'where':{'id':_0x108a76[_0x7a0f('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d005f,null))[_0x7a0f('0x22')](saveUpdates(_0x108a76[_0x7a0f('0x49')],null))[_0x7a0f('0x22')](respondWithResult(_0x5d005f,null))['catch'](handleError(_0x5d005f,null));};exports[_0x7a0f('0x23')]=function(_0x1d646c,_0x9a6acb){return db[_0x7a0f('0x3f')][_0x7a0f('0x47')]({'where':{'id':_0x1d646c[_0x7a0f('0x43')]['id']}})[_0x7a0f('0x22')](handleEntityNotFound(_0x9a6acb,null))['then'](removeEntity(_0x9a6acb,null))[_0x7a0f('0x41')](handleError(_0x9a6acb,null));};exports[_0x7a0f('0x50')]=function(_0x43cb15,_0x465afd,_0x29423d){var _0x4a3e69=require('../../config/schedule');return db[_0x7a0f('0x3f')][_0x7a0f('0x47')]({'where':{'id':_0x43cb15[_0x7a0f('0x43')]['id']},'raw':!![]})[_0x7a0f('0x22')](handleEntityNotFound(_0x465afd,null))['then'](function(){_0x4a3e69[_0x7a0f('0x50')](_0x43cb15['params']['id']);})['then'](respondWithStatusCode(_0x465afd,null))[_0x7a0f('0x41')](handleError(_0x465afd,null));}; \ No newline at end of file +var _0xb959=['attributes','intersection','fields','length','hasOwnProperty','order','pick','filter','merge','where','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Scheduler','error','stack','name','map','Schedule','rawAttributes','fieldName','key','model','query','filters'];(function(_0x443336,_0x1bf874){var _0x462ded=function(_0x472e6a){while(--_0x472e6a){_0x443336['push'](_0x443336['shift']());}};_0x462ded(++_0x1bf874);}(_0xb959,0x11a));var _0x9b95=function(_0x3284cb,_0x39afe3){_0x3284cb=_0x3284cb-0x0;var _0x2d31ff=_0xb959[_0x3284cb];return _0x2d31ff;};'use strict';var emlformat=require(_0x9b95('0x0'));var rimraf=require(_0x9b95('0x1'));var zipdir=require(_0x9b95('0x2'));var jsonpatch=require(_0x9b95('0x3'));var rp=require(_0x9b95('0x4'));var moment=require('moment');var BPromise=require(_0x9b95('0x5'));var Mustache=require(_0x9b95('0x6'));var util=require('util');var path=require(_0x9b95('0x7'));var sox=require('sox');var csv=require(_0x9b95('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9b95('0x9'));var deskjs=require(_0x9b95('0xa'));var toCsv=require(_0x9b95('0x8'));var querystring=require(_0x9b95('0xb'));var Papa=require(_0x9b95('0xc'));var Redis=require(_0x9b95('0xd'));var authService=require(_0x9b95('0xe'));var qs=require(_0x9b95('0xf'));var as=require(_0x9b95('0x10'));var hardwareService=require(_0x9b95('0x11'));var logger=require(_0x9b95('0x12'))(_0x9b95('0x13'));var utils=require(_0x9b95('0x14'));var config=require(_0x9b95('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10480f,_0x2f1a9b){_0x2f1a9b=_0x2f1a9b||0xcc;return function(_0x2fa54e){if(_0x2fa54e){return _0x10480f[_0x9b95('0x16')](_0x2f1a9b);}return _0x10480f[_0x9b95('0x17')](_0x2f1a9b)[_0x9b95('0x18')]();};}function respondWithResult(_0x949d43,_0x280df8){_0x280df8=_0x280df8||0xc8;return function(_0x1525e3){if(_0x1525e3){return _0x949d43['status'](_0x280df8)[_0x9b95('0x19')](_0x1525e3);}};}function respondWithFilteredResult(_0x2faf47,_0x350783){return function(_0x3e11de){if(_0x3e11de){var _0x12c950=typeof _0x350783[_0x9b95('0x1a')]===_0x9b95('0x1b')&&typeof _0x350783[_0x9b95('0x1c')]===_0x9b95('0x1b');var _0x58d25a=_0x3e11de[_0x9b95('0x1d')];var _0x1be4ce=_0x12c950?0x0:_0x350783[_0x9b95('0x1a')];var _0x37e9a=_0x12c950?_0x3e11de['count']:_0x350783[_0x9b95('0x1a')]+_0x350783[_0x9b95('0x1c')];var _0x38b4f9;if(_0x37e9a>=_0x58d25a){_0x37e9a=_0x58d25a;_0x38b4f9=0xc8;}else{_0x38b4f9=0xce;}_0x2faf47['status'](_0x38b4f9);return _0x2faf47[_0x9b95('0x1e')](_0x9b95('0x1f'),_0x1be4ce+'-'+_0x37e9a+'/'+_0x58d25a)[_0x9b95('0x19')](_0x3e11de);}return null;};}function patchUpdates(_0x11053f){return function(_0x4ebb7e){try{jsonpatch[_0x9b95('0x20')](_0x4ebb7e,_0x11053f,!![]);}catch(_0x1e280d){return BPromise['reject'](_0x1e280d);}return _0x4ebb7e[_0x9b95('0x21')]();};}function saveUpdates(_0x534d51,_0x31f2b8){return function(_0x3f83f5){if(_0x3f83f5){return _0x3f83f5[_0x9b95('0x22')](_0x534d51)[_0x9b95('0x23')](function(_0x1d81c1){return _0x1d81c1;});}return null;};}function removeEntity(_0x54b3fd,_0x2fc558){return function(_0x1d4a62){if(_0x1d4a62){return _0x1d4a62[_0x9b95('0x24')]()[_0x9b95('0x23')](function(){var _0xd31399=_0x1d4a62[_0x9b95('0x25')]({'plain':!![]});var _0x22232e=_0x9b95('0x26');return db['UserProfileResource'][_0x9b95('0x24')]({'where':{'type':_0x22232e,'resourceId':_0xd31399['id']}})[_0x9b95('0x23')](function(){return _0x1d4a62;});})['then'](function(){_0x54b3fd[_0x9b95('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e0464,_0x6c88b7){return function(_0x4dce9e){if(!_0x4dce9e){_0x5e0464[_0x9b95('0x16')](0x194);}return _0x4dce9e;};}function handleError(_0x2a961b,_0x34e499){_0x34e499=_0x34e499||0x1f4;return function(_0x373f10){logger[_0x9b95('0x27')](_0x373f10[_0x9b95('0x28')]);if(_0x373f10[_0x9b95('0x29')]){delete _0x373f10['name'];}_0x2a961b[_0x9b95('0x17')](_0x34e499)['send'](_0x373f10);};}exports['index']=function(_0xb4c1bb,_0x724724){var _0x113594={},_0x33a9c6={},_0x22cd71={'count':0x0,'rows':[]};var _0x18a09c=_[_0x9b95('0x2a')](db[_0x9b95('0x2b')][_0x9b95('0x2c')],function(_0x32e1a1){return{'name':_0x32e1a1[_0x9b95('0x2d')],'type':_0x32e1a1['type'][_0x9b95('0x2e')]};});_0x33a9c6[_0x9b95('0x2f')]=_[_0x9b95('0x2a')](_0x18a09c,'name');_0x33a9c6[_0x9b95('0x30')]=_['keys'](_0xb4c1bb[_0x9b95('0x30')]);_0x33a9c6[_0x9b95('0x31')]=_['intersection'](_0x33a9c6[_0x9b95('0x2f')],_0x33a9c6[_0x9b95('0x30')]);_0x113594[_0x9b95('0x32')]=_[_0x9b95('0x33')](_0x33a9c6['model'],qs['fields'](_0xb4c1bb[_0x9b95('0x30')][_0x9b95('0x34')]));_0x113594[_0x9b95('0x32')]=_0x113594[_0x9b95('0x32')][_0x9b95('0x35')]?_0x113594['attributes']:_0x33a9c6[_0x9b95('0x2f')];if(!_0xb4c1bb['query'][_0x9b95('0x36')]('nolimit')){_0x113594[_0x9b95('0x1c')]=qs[_0x9b95('0x1c')](_0xb4c1bb['query']['limit']);_0x113594['offset']=qs[_0x9b95('0x1a')](_0xb4c1bb[_0x9b95('0x30')]['offset']);}_0x113594[_0x9b95('0x37')]=qs['sort'](_0xb4c1bb[_0x9b95('0x30')]['sort']);_0x113594['where']=qs[_0x9b95('0x31')](_[_0x9b95('0x38')](_0xb4c1bb[_0x9b95('0x30')],_0x33a9c6[_0x9b95('0x31')]),_0x18a09c);if(_0xb4c1bb[_0x9b95('0x30')][_0x9b95('0x39')]){_0x113594['where']=_[_0x9b95('0x3a')](_0x113594[_0x9b95('0x3b')],{'$or':_[_0x9b95('0x2a')](_0x18a09c,function(_0x508448){if(_0x508448[_0x9b95('0x3c')]!==_0x9b95('0x3d')){var _0x2d1110={};_0x2d1110[_0x508448[_0x9b95('0x29')]]={'$like':'%'+_0xb4c1bb['query'][_0x9b95('0x39')]+'%'};return _0x2d1110;}})});}_0x113594=_[_0x9b95('0x3a')]({},_0x113594,_0xb4c1bb['options']);var _0x4f3542={'where':_0x113594[_0x9b95('0x3b')]};return db['Schedule'][_0x9b95('0x1d')](_0x4f3542)[_0x9b95('0x23')](function(_0x40130b){_0x22cd71[_0x9b95('0x1d')]=_0x40130b;if(_0xb4c1bb[_0x9b95('0x30')][_0x9b95('0x3e')]){_0x113594[_0x9b95('0x3f')]=[{'all':!![]}];}return db[_0x9b95('0x2b')][_0x9b95('0x40')](_0x113594);})[_0x9b95('0x23')](function(_0x5dc129){_0x22cd71[_0x9b95('0x41')]=_0x5dc129;return _0x22cd71;})['then'](respondWithFilteredResult(_0x724724,_0x113594))['catch'](handleError(_0x724724,null));};exports[_0x9b95('0x42')]=function(_0x2c7418,_0x18babc){var _0x48aeac={'raw':![],'where':{'id':_0x2c7418[_0x9b95('0x43')]['id']}},_0x9487e5={};_0x9487e5[_0x9b95('0x2f')]=_['keys'](db[_0x9b95('0x2b')][_0x9b95('0x2c')]);_0x9487e5[_0x9b95('0x30')]=_['keys'](_0x2c7418[_0x9b95('0x30')]);_0x9487e5[_0x9b95('0x31')]=_[_0x9b95('0x33')](_0x9487e5[_0x9b95('0x2f')],_0x9487e5[_0x9b95('0x30')]);_0x48aeac[_0x9b95('0x32')]=_['intersection'](_0x9487e5['model'],qs['fields'](_0x2c7418[_0x9b95('0x30')][_0x9b95('0x34')]));_0x48aeac[_0x9b95('0x32')]=_0x48aeac['attributes'][_0x9b95('0x35')]?_0x48aeac[_0x9b95('0x32')]:_0x9487e5[_0x9b95('0x2f')];if(_0x2c7418[_0x9b95('0x30')][_0x9b95('0x3e')]){_0x48aeac[_0x9b95('0x3f')]=[{'all':!![]}];}_0x48aeac=_[_0x9b95('0x3a')]({},_0x48aeac,_0x2c7418[_0x9b95('0x44')]);return db['Schedule'][_0x9b95('0x45')](_0x48aeac)[_0x9b95('0x23')](handleEntityNotFound(_0x18babc,null))['then'](respondWithResult(_0x18babc,null))[_0x9b95('0x46')](handleError(_0x18babc,null));};exports[_0x9b95('0x47')]=function(_0xdfd5d0,_0x5002ee){return db['Schedule']['create'](_0xdfd5d0[_0x9b95('0x48')],{})[_0x9b95('0x23')](function(_0x43850d){var _0x214acd=_0xdfd5d0[_0x9b95('0x49')][_0x9b95('0x25')]({'plain':!![]});if(!_0x214acd)throw new Error(_0x9b95('0x4a'));if(_0x214acd[_0x9b95('0x4b')]==='user'){var _0x169c1a=_0x43850d[_0x9b95('0x25')]({'plain':!![]});var _0x3cfcdd=_0x9b95('0x26');return db[_0x9b95('0x4c')]['find']({'where':{'name':_0x3cfcdd,'userProfileId':_0x214acd[_0x9b95('0x4d')]},'raw':!![]})[_0x9b95('0x23')](function(_0x243ca7){if(_0x243ca7&&_0x243ca7[_0x9b95('0x4e')]===0x0){return db[_0x9b95('0x4f')][_0x9b95('0x47')]({'name':_0x169c1a['name'],'resourceId':_0x169c1a['id'],'type':_0x243ca7[_0x9b95('0x29')],'sectionId':_0x243ca7['id']},{})[_0x9b95('0x23')](function(){return _0x43850d;});}else{return _0x43850d;}})['catch'](function(_0x5cd5a0){logger[_0x9b95('0x27')](_0x9b95('0x50'),_0x5cd5a0);throw _0x5cd5a0;});}return _0x43850d;})[_0x9b95('0x23')](respondWithResult(_0x5002ee,0xc9))['catch'](handleError(_0x5002ee,null));};exports['update']=function(_0x8ab4da,_0x2c19c4){if(_0x8ab4da[_0x9b95('0x48')]['id']){delete _0x8ab4da['body']['id'];}return db['Schedule'][_0x9b95('0x45')]({'where':{'id':_0x8ab4da[_0x9b95('0x43')]['id']}})[_0x9b95('0x23')](handleEntityNotFound(_0x2c19c4,null))[_0x9b95('0x23')](saveUpdates(_0x8ab4da['body'],null))[_0x9b95('0x23')](respondWithResult(_0x2c19c4,null))[_0x9b95('0x46')](handleError(_0x2c19c4,null));};exports[_0x9b95('0x24')]=function(_0x41bcaa,_0x47bd76){return db['Schedule'][_0x9b95('0x45')]({'where':{'id':_0x41bcaa[_0x9b95('0x43')]['id']}})[_0x9b95('0x23')](handleEntityNotFound(_0x47bd76,null))[_0x9b95('0x23')](removeEntity(_0x47bd76,null))[_0x9b95('0x46')](handleError(_0x47bd76,null));};exports[_0x9b95('0x51')]=function(_0x3aa65b,_0xe7f0a2,_0x349ca1){var _0x500954=require(_0x9b95('0x52'));return db[_0x9b95('0x2b')][_0x9b95('0x45')]({'where':{'id':_0x3aa65b[_0x9b95('0x43')]['id']},'raw':!![]})[_0x9b95('0x23')](handleEntityNotFound(_0xe7f0a2,null))[_0x9b95('0x23')](function(){_0x500954['run'](_0x3aa65b['params']['id']);})[_0x9b95('0x23')](respondWithStatusCode(_0xe7f0a2,null))['catch'](handleError(_0xe7f0a2,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 2fdede7..0f09629 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 _0xdd38=['lodash','util','../../config/logger','api','bluebird','request-promise','path','define','Schedule','tools_schedules'];(function(_0x13b918,_0x4260bf){var _0x5492bb=function(_0x3099a8){while(--_0x3099a8){_0x13b918['push'](_0x13b918['shift']());}};_0x5492bb(++_0x4260bf);}(_0xdd38,0x12c));var _0x8dd3=function(_0x222472,_0x33ea87){_0x222472=_0x222472-0x0;var _0x5d601f=_0xdd38[_0x222472];return _0x5d601f;};'use strict';var _=require(_0x8dd3('0x0'));var util=require(_0x8dd3('0x1'));var logger=require(_0x8dd3('0x2'))(_0x8dd3('0x3'));var moment=require('moment');var BPromise=require(_0x8dd3('0x4'));var rp=require(_0x8dd3('0x5'));var fs=require('fs');var path=require(_0x8dd3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./schedule.attributes');module['exports']=function(_0x2c7f6e,_0x565ec4){return _0x2c7f6e[_0x8dd3('0x7')](_0x8dd3('0x8'),attributes,{'tableName':_0x8dd3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce45=['exports','define','tools_schedules','lodash','util','api','bluebird','request-promise','../../config/environment'];(function(_0x41588d,_0x2431ba){var _0x5a9db4=function(_0x58eeeb){while(--_0x58eeeb){_0x41588d['push'](_0x41588d['shift']());}};_0x5a9db4(++_0x2431ba);}(_0xce45,0x6f));var _0x5ce4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xce45[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x5ce4('0x0'));var util=require(_0x5ce4('0x1'));var logger=require('../../config/logger')(_0x5ce4('0x2'));var moment=require('moment');var BPromise=require(_0x5ce4('0x3'));var rp=require(_0x5ce4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5ce4('0x5'));var attributes=require('./schedule.attributes');module[_0x5ce4('0x6')]=function(_0x20197e,_0x2ed05b){return _0x20197e[_0x5ce4('0x7')]('Schedule',attributes,{'tableName':_0x5ce4('0x8'),'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 0f0083d..221b28c 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 _0x3ccf=['catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x17df09,_0x44dd69){var _0x143aab=function(_0xeab9d5){while(--_0xeab9d5){_0x17df09['push'](_0x17df09['shift']());}};_0x143aab(++_0x44dd69);}(_0x3ccf,0x18d));var _0xf3cc=function(_0x58c725,_0x286bc2){_0x58c725=_0x58c725-0x0;var _0x44f202=_0x3ccf[_0x58c725];return _0x44f202;};'use strict';var _=require(_0xf3cc('0x0'));var util=require('util');var moment=require(_0xf3cc('0x1'));var BPromise=require(_0xf3cc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3cc('0x3'))['db'];var utils=require(_0xf3cc('0x4'));var logger=require(_0xf3cc('0x5'))(_0xf3cc('0x6'));var config=require(_0xf3cc('0x7'));var jayson=require(_0xf3cc('0x8'));var client=jayson[_0xf3cc('0x9')][_0xf3cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1227cc,_0x5beaae,_0x5a1ea5){return new BPromise(function(_0x574401,_0x4ce5a2){return client[_0xf3cc('0xb')](_0x1227cc,_0x5a1ea5)[_0xf3cc('0xc')](function(_0x35aef){logger[_0xf3cc('0xd')](_0xf3cc('0xe'),_0x5beaae,_0xf3cc('0xf'));logger['debug'](_0xf3cc('0x10'),_0x5beaae,'request\x20sent',JSON[_0xf3cc('0x11')](_0x35aef));if(_0x35aef[_0xf3cc('0x12')]){if(_0x35aef[_0xf3cc('0x12')]['code']===0x1f4){logger[_0xf3cc('0x12')]('Schedule,\x20%s,\x20%s',_0x5beaae,_0x35aef['error'][_0xf3cc('0x13')]);return _0x4ce5a2(_0x35aef[_0xf3cc('0x12')]['message']);}logger['error'](_0xf3cc('0xe'),_0x5beaae,_0x35aef['error'][_0xf3cc('0x13')]);return _0x574401(_0x35aef[_0xf3cc('0x12')]['message']);}else{logger[_0xf3cc('0xd')]('Schedule,\x20%s,\x20%s',_0x5beaae,_0xf3cc('0xf'));_0x574401(_0x35aef[_0xf3cc('0x14')][_0xf3cc('0x13')]);}})[_0xf3cc('0x15')](function(_0x14f0d0){logger[_0xf3cc('0x12')](_0xf3cc('0xe'),_0x5beaae,_0x14f0d0);_0x4ce5a2(_0x14f0d0);});});} \ No newline at end of file +var _0xbb57=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x37bcf9,_0x4d1a77){var _0x5049d3=function(_0x1a14c7){while(--_0x1a14c7){_0x37bcf9['push'](_0x37bcf9['shift']());}};_0x5049d3(++_0x4d1a77);}(_0xbb57,0x15e));var _0x7bb5=function(_0x1dc968,_0x3722e0){_0x1dc968=_0x1dc968-0x0;var _0xed1a0b=_0xbb57[_0x1dc968];return _0xed1a0b;};'use strict';var _=require(_0x7bb5('0x0'));var util=require(_0x7bb5('0x1'));var moment=require(_0x7bb5('0x2'));var BPromise=require(_0x7bb5('0x3'));var rs=require(_0x7bb5('0x4'));var fs=require('fs');var Redis=require(_0x7bb5('0x5'));var db=require(_0x7bb5('0x6'))['db'];var utils=require(_0x7bb5('0x7'));var logger=require(_0x7bb5('0x8'))(_0x7bb5('0x9'));var config=require(_0x7bb5('0xa'));var jayson=require(_0x7bb5('0xb'));var client=jayson[_0x7bb5('0xc')][_0x7bb5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x46030d,_0x244707,_0x3146fb){return new BPromise(function(_0x21967f,_0x30b248){return client[_0x7bb5('0xe')](_0x46030d,_0x3146fb)[_0x7bb5('0xf')](function(_0x54e35a){logger[_0x7bb5('0x10')](_0x7bb5('0x11'),_0x244707,_0x7bb5('0x12'));logger[_0x7bb5('0x13')](_0x7bb5('0x14'),_0x244707,_0x7bb5('0x12'),JSON[_0x7bb5('0x15')](_0x54e35a));if(_0x54e35a[_0x7bb5('0x16')]){if(_0x54e35a[_0x7bb5('0x16')][_0x7bb5('0x17')]===0x1f4){logger[_0x7bb5('0x16')]('Schedule,\x20%s,\x20%s',_0x244707,_0x54e35a[_0x7bb5('0x16')][_0x7bb5('0x18')]);return _0x30b248(_0x54e35a['error']['message']);}logger[_0x7bb5('0x16')]('Schedule,\x20%s,\x20%s',_0x244707,_0x54e35a[_0x7bb5('0x16')][_0x7bb5('0x18')]);return _0x21967f(_0x54e35a[_0x7bb5('0x16')][_0x7bb5('0x18')]);}else{logger[_0x7bb5('0x10')](_0x7bb5('0x11'),_0x244707,'request\x20sent');_0x21967f(_0x54e35a[_0x7bb5('0x19')][_0x7bb5('0x18')]);}})[_0x7bb5('0x1a')](function(_0x495f12){logger[_0x7bb5('0x16')](_0x7bb5('0x11'),_0x244707,_0x495f12);_0x30b248(_0x495f12);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index c1e3af2..d14b462 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 _0x5d8d=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','/describe','isAuthenticated','describe','get','/:id','download','post','create','put','update','multer','util','path'];(function(_0x9ef61e,_0x2837d9){var _0x1fc375=function(_0x213a35){while(--_0x213a35){_0x9ef61e['push'](_0x9ef61e['shift']());}};_0x1fc375(++_0x2837d9);}(_0x5d8d,0x166));var _0xd5d8=function(_0x95a0f6,_0x1988ca){_0x95a0f6=_0x95a0f6-0x0;var _0x26abf0=_0x5d8d[_0x95a0f6];return _0x26abf0;};'use strict';var multer=require(_0xd5d8('0x0'));var util=require(_0xd5d8('0x1'));var path=require(_0xd5d8('0x2'));var timeout=require('connect-timeout');var express=require(_0xd5d8('0x3'));var router=express[_0xd5d8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd5d8('0x5'));var interaction=require(_0xd5d8('0x6'));var config=require(_0xd5d8('0x7'));var controller=require(_0xd5d8('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd5d8('0x9'),auth[_0xd5d8('0xa')](),controller[_0xd5d8('0xb')]);router[_0xd5d8('0xc')](_0xd5d8('0xd'),auth[_0xd5d8('0xa')](),controller['show']);router[_0xd5d8('0xc')]('/:id/download',auth[_0xd5d8('0xa')](),controller[_0xd5d8('0xe')]);router[_0xd5d8('0xf')]('/',auth[_0xd5d8('0xa')](),controller[_0xd5d8('0x10')]);router[_0xd5d8('0x11')]('/:id',auth[_0xd5d8('0xa')](),controller[_0xd5d8('0x12')]);router['delete'](_0xd5d8('0xd'),auth[_0xd5d8('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0033=['isAuthenticated','index','/describe','show','/:id/download','download','post','create','put','delete','/:id','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./screenRecording.controller','get'];(function(_0x1e45ec,_0x2e11eb){var _0x42f22d=function(_0x35bd42){while(--_0x35bd42){_0x1e45ec['push'](_0x1e45ec['shift']());}};_0x42f22d(++_0x2e11eb);}(_0x0033,0xf4));var _0x3003=function(_0x98197,_0xea7356){_0x98197=_0x98197-0x0;var _0x5d9199=_0x0033[_0x98197];return _0x5d9199;};'use strict';var multer=require(_0x3003('0x0'));var util=require(_0x3003('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3003('0x2'));var router=express[_0x3003('0x3')]();var fs_extra=require(_0x3003('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3003('0x5'));var config=require('../../config/environment');var controller=require(_0x3003('0x6'));router[_0x3003('0x7')]('/',auth[_0x3003('0x8')](),controller[_0x3003('0x9')]);router[_0x3003('0x7')](_0x3003('0xa'),auth[_0x3003('0x8')](),controller['describe']);router[_0x3003('0x7')]('/:id',auth[_0x3003('0x8')](),controller[_0x3003('0xb')]);router['get'](_0x3003('0xc'),auth[_0x3003('0x8')](),controller[_0x3003('0xd')]);router[_0x3003('0xe')]('/',auth['isAuthenticated'](),controller[_0x3003('0xf')]);router[_0x3003('0x10')]('/:id',auth[_0x3003('0x8')](),controller['update']);router[_0x3003('0x11')](_0x3003('0x12'),auth['isAuthenticated'](),controller[_0x3003('0x13')]);module[_0x3003('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 c58a802..1fa3590 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 _0xccde=['startedAt','MM-DD-YYYY\x20HH:mm','toString','closedAt','format','createdAt','sequelize','path','exports','VIRTUAL','extname','getDataValue','value','STRING','replace','setDataValue','INTEGER','duration','DATE'];(function(_0x5aca71,_0x583dfa){var _0x375f79=function(_0x3b2d5e){while(--_0x3b2d5e){_0x5aca71['push'](_0x5aca71['shift']());}};_0x375f79(++_0x583dfa);}(_0xccde,0x1e1));var _0xeccd=function(_0x3fb5eb,_0x5947a6){_0x3fb5eb=_0x3fb5eb-0x0;var _0x481291=_0xccde[_0x3fb5eb];return _0x481291;};'use strict';var Sequelize=require(_0xeccd('0x0'));var moment=require('moment');var path=require(_0xeccd('0x1'));var config=require('../../config/environment');module[_0xeccd('0x2')]={'format':{'type':Sequelize[_0xeccd('0x3')],'get':function(){return this['getDataValue']('value')?path[_0xeccd('0x4')](this[_0xeccd('0x5')](_0xeccd('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xeccd('0x7')]},'channel':{'type':Sequelize[_0xeccd('0x7')]},'value':{'type':Sequelize['STRING'],'set':function(_0x338742){var _0x130f1c=_0x338742[_0xeccd('0x8')](/\\/g,'/');this[_0xeccd('0x9')]('value',_0x130f1c);}},'rating':{'type':Sequelize[_0xeccd('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xeccd('0xa')],'set':function(_0x9dccd){this[_0xeccd('0x9')]('startedAt',moment()['subtract'](_0x9dccd,'ms'));this['setDataValue']('closedAt',moment());this[_0xeccd('0x9')](_0xeccd('0xb'),_0x9dccd);}},'startedAt':{'type':Sequelize[_0xeccd('0xc')],'get':function(){return moment(this[_0xeccd('0x5')](_0xeccd('0xd')))['format'](_0xeccd('0xe'))[_0xeccd('0xf')]();}},'closedAt':{'type':Sequelize[_0xeccd('0xc')],'get':function(){return moment(this[_0xeccd('0x5')](_0xeccd('0x10')))[_0xeccd('0x11')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0xeccd('0xc')],'get':function(){return moment(this[_0xeccd('0x5')](_0xeccd('0x12')))[_0xeccd('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xeccd('0xf')]();}},'updatedAt':{'type':Sequelize[_0xeccd('0xc')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0xeccd('0x11')](_0xeccd('0xe'))[_0xeccd('0xf')]();}}}; \ No newline at end of file +var _0x0a48=['exports','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','DATE','format','toString','closedAt','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','sequelize','moment','../../config/environment'];(function(_0x1d8f37,_0x4f532c){var _0x1f18ee=function(_0x5f1bf8){while(--_0x5f1bf8){_0x1d8f37['push'](_0x1d8f37['shift']());}};_0x1f18ee(++_0x4f532c);}(_0x0a48,0x95));var _0x80a4=function(_0x101249,_0x53cf00){_0x101249=_0x101249-0x0;var _0x3fb014=_0x0a48[_0x101249];return _0x3fb014;};'use strict';var Sequelize=require(_0x80a4('0x0'));var moment=require(_0x80a4('0x1'));var path=require('path');var config=require(_0x80a4('0x2'));module[_0x80a4('0x3')]={'format':{'type':Sequelize[_0x80a4('0x4')],'get':function(){return this[_0x80a4('0x5')](_0x80a4('0x6'))?path['extname'](this['getDataValue'](_0x80a4('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x80a4('0x7')]},'channel':{'type':Sequelize[_0x80a4('0x7')]},'value':{'type':Sequelize[_0x80a4('0x7')],'set':function(_0x5f3ac0){var _0x3ccc33=_0x5f3ac0['replace'](/\\/g,'/');this[_0x80a4('0x8')](_0x80a4('0x6'),_0x3ccc33);}},'rating':{'type':Sequelize[_0x80a4('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x5dfe4a){this[_0x80a4('0x8')](_0x80a4('0xa'),moment()[_0x80a4('0xb')](_0x5dfe4a,'ms'));this[_0x80a4('0x8')]('closedAt',moment());this[_0x80a4('0x8')]('duration',_0x5dfe4a);}},'startedAt':{'type':Sequelize[_0x80a4('0xc')],'get':function(){return moment(this['getDataValue'](_0x80a4('0xa')))[_0x80a4('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x80a4('0xe')]();}},'closedAt':{'type':Sequelize[_0x80a4('0xc')],'get':function(){return moment(this[_0x80a4('0x5')](_0x80a4('0xf')))[_0x80a4('0xd')](_0x80a4('0x10'))[_0x80a4('0xe')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x80a4('0x11')))[_0x80a4('0xd')](_0x80a4('0x10'))[_0x80a4('0xe')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x80a4('0x5')](_0x80a4('0x12')))[_0x80a4('0xd')](_0x80a4('0x10'))[_0x80a4('0xe')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 6800220..33d5816 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 _0x0e85=['duration','createdAt','closedAt','params','describe','download','uniqueid','join','root','value','existsSync','secrets','recording','server/files/screen_recordings','filename','extname','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','key','model','format','query','filters','intersection','attributes','length','nolimit','sort','filter','where','merge','type','options','include','findAll','rows','catch','keys','fields','find','create','body'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0x0e85,0x7c));var _0x50e8=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x0e85[_0x4e9d3c];return _0x2d0825;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];function respondWithStatusCode(_0x24d381,_0x508377){_0x508377=_0x508377||0xcc;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0x17')](_0x508377);}return _0x24d381[_0x50e8('0x18')](_0x508377)[_0x50e8('0x19')]();};}function respondWithResult(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xc8;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x18')](_0x54efd3)[_0x50e8('0x1a')](_0x18596f);}};}function respondWithFilteredResult(_0x5c3baa,_0x5524a3){return function(_0x30a872){if(_0x30a872){var _0xf02b48=typeof _0x5524a3[_0x50e8('0x1b')]===_0x50e8('0x1c')&&typeof _0x5524a3[_0x50e8('0x1d')]===_0x50e8('0x1c');var _0x5642bf=_0x30a872['count'];var _0x441f25=_0xf02b48?0x0:_0x5524a3[_0x50e8('0x1b')];var _0x40d060=_0xf02b48?_0x30a872[_0x50e8('0x1e')]:_0x5524a3[_0x50e8('0x1b')]+_0x5524a3[_0x50e8('0x1d')];var _0x1a451d;if(_0x40d060>=_0x5642bf){_0x40d060=_0x5642bf;_0x1a451d=0xc8;}else{_0x1a451d=0xce;}_0x5c3baa['status'](_0x1a451d);return _0x5c3baa[_0x50e8('0x1f')]('Content-Range',_0x441f25+'-'+_0x40d060+'/'+_0x5642bf)[_0x50e8('0x1a')](_0x30a872);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x20')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x21')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x22')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x23')](function(){_0xe7e56c[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();});}};}function handleEntityNotFound(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(!_0x13b6e9){_0x371a1f['sendStatus'](0x194);}return _0x13b6e9;};}function handleError(_0x3a6442,_0x396611){_0x396611=_0x396611||0x1f4;return function(_0x4b3a09){logger[_0x50e8('0x24')](_0x4b3a09[_0x50e8('0x25')]);if(_0x4b3a09[_0x50e8('0x26')]){delete _0x4b3a09[_0x50e8('0x26')];}_0x3a6442['status'](_0x396611)[_0x50e8('0x27')](_0x4b3a09);};}exports['index']=function(_0x30fedf,_0x39c0c6){var _0x42bbef={},_0x4f0b88={},_0x1041b9={'count':0x0,'rows':[]};var _0x126c99=_[_0x50e8('0x28')](db[_0x50e8('0x29')][_0x50e8('0x2a')],function(_0x18aa31){return{'name':_0x18aa31[_0x50e8('0x2b')],'type':_0x18aa31['type'][_0x50e8('0x2c')]};});_0x4f0b88[_0x50e8('0x2d')]=_['differenceBy'](_['map'](_0x126c99,_0x50e8('0x26')),[_0x50e8('0x2e')]);_0x4f0b88[_0x50e8('0x2f')]=_['keys'](_0x30fedf['query']);_0x4f0b88[_0x50e8('0x30')]=_[_0x50e8('0x31')](_0x4f0b88['model'],_0x4f0b88[_0x50e8('0x2f')]);_0x42bbef[_0x50e8('0x32')]=_[_0x50e8('0x31')](_0x4f0b88[_0x50e8('0x2d')],qs['fields'](_0x30fedf[_0x50e8('0x2f')]['fields']));_0x42bbef[_0x50e8('0x32')]=_0x42bbef[_0x50e8('0x32')][_0x50e8('0x33')]?_0x42bbef['attributes']:_0x4f0b88[_0x50e8('0x2d')];if(!_0x30fedf[_0x50e8('0x2f')]['hasOwnProperty'](_0x50e8('0x34'))){_0x42bbef[_0x50e8('0x1d')]=qs[_0x50e8('0x1d')](_0x30fedf[_0x50e8('0x2f')]['limit']);_0x42bbef[_0x50e8('0x1b')]=qs[_0x50e8('0x1b')](_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x1b')]);}_0x42bbef['order']=qs[_0x50e8('0x35')](_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x35')]);_0x42bbef['where']=qs['filters'](_['pick'](_0x30fedf[_0x50e8('0x2f')],_0x4f0b88[_0x50e8('0x30')]),_0x126c99);if(_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x36')]){_0x42bbef[_0x50e8('0x37')]=_[_0x50e8('0x38')](_0x42bbef[_0x50e8('0x37')],{'$or':_[_0x50e8('0x28')](_0x126c99,function(_0x35f802){if(_0x35f802[_0x50e8('0x39')]!=='VIRTUAL'){var _0x3371a4={};_0x3371a4[_0x35f802[_0x50e8('0x26')]]={'$like':'%'+_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x36')]+'%'};return _0x3371a4;}})});}_0x42bbef=_['merge']({},_0x42bbef,_0x30fedf[_0x50e8('0x3a')]);var _0x944e46={'where':_0x42bbef[_0x50e8('0x37')]};return db[_0x50e8('0x29')][_0x50e8('0x1e')](_0x944e46)['then'](function(_0x53b198){_0x1041b9[_0x50e8('0x1e')]=_0x53b198;if(_0x30fedf[_0x50e8('0x2f')]['includeAll']){_0x42bbef[_0x50e8('0x3b')]=[{'all':!![]}];}return db[_0x50e8('0x29')][_0x50e8('0x3c')](_0x42bbef);})[_0x50e8('0x23')](function(_0x251e1c){_0x1041b9[_0x50e8('0x3d')]=_0x251e1c;return _0x1041b9;})[_0x50e8('0x23')](respondWithFilteredResult(_0x39c0c6,_0x42bbef))[_0x50e8('0x3e')](handleError(_0x39c0c6,null));};exports['show']=function(_0x3d26bd,_0x44e0ca){var _0x3ea251={'raw':![],'where':{'id':_0x3d26bd['params']['id']}},_0x2adae0={};_0x2adae0[_0x50e8('0x2d')]=_[_0x50e8('0x3f')](db[_0x50e8('0x29')][_0x50e8('0x2a')]);_0x2adae0['query']=_[_0x50e8('0x3f')](_0x3d26bd['query']);_0x2adae0['filters']=_['intersection'](_0x2adae0[_0x50e8('0x2d')],_0x2adae0[_0x50e8('0x2f')]);_0x3ea251['attributes']=_[_0x50e8('0x31')](_0x2adae0[_0x50e8('0x2d')],qs[_0x50e8('0x40')](_0x3d26bd[_0x50e8('0x2f')][_0x50e8('0x40')]));_0x3ea251[_0x50e8('0x32')]=_0x3ea251['attributes'][_0x50e8('0x33')]?_0x3ea251['attributes']:_0x2adae0[_0x50e8('0x2d')];if(_0x3d26bd[_0x50e8('0x2f')]['includeAll']){_0x3ea251[_0x50e8('0x3b')]=[{'all':!![]}];}_0x3ea251=_['merge']({},_0x3ea251,_0x3d26bd[_0x50e8('0x3a')]);return db[_0x50e8('0x29')][_0x50e8('0x41')](_0x3ea251)[_0x50e8('0x23')](handleEntityNotFound(_0x44e0ca,null))[_0x50e8('0x23')](respondWithResult(_0x44e0ca,null))[_0x50e8('0x3e')](handleError(_0x44e0ca,null));};exports[_0x50e8('0x42')]=function(_0x3e52b3,_0x141bd4){return db[_0x50e8('0x29')][_0x50e8('0x42')](_0x3e52b3['body'],{})[_0x50e8('0x23')](respondWithResult(_0x141bd4,0xc9))[_0x50e8('0x3e')](handleError(_0x141bd4,null));};exports['update']=function(_0x3692ba,_0x58f14e){if(_0x3692ba[_0x50e8('0x43')]['id']){delete _0x3692ba['body']['id'];}delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x44')];delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x45')];delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x46')];delete _0x3692ba[_0x50e8('0x43')]['value'];return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':{'id':_0x3692ba[_0x50e8('0x47')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x58f14e,null))[_0x50e8('0x23')](saveUpdates(_0x3692ba[_0x50e8('0x43')],null))['then'](respondWithResult(_0x58f14e,null))[_0x50e8('0x3e')](handleError(_0x58f14e,null));};exports[_0x50e8('0x48')]=function(_0xff2e24,_0x27c80a){return db['ScreenRecording'][_0x50e8('0x48')]()[_0x50e8('0x23')](respondWithResult(_0x27c80a,null))[_0x50e8('0x3e')](handleError(_0x27c80a,null));};exports[_0x50e8('0x49')]=function(_0x207f06,_0x1372e3,_0x320b00){var _0x5f5220=require('../../components/encryptor');var _0x55083e=![];var _0x2b54ad={};if(_0x207f06[_0x50e8('0x2f')][_0x50e8('0x39')]&&_0x207f06[_0x50e8('0x2f')][_0x50e8('0x39')]===_0x50e8('0x4a')){_0x2b54ad['uniqueid']=_0x207f06[_0x50e8('0x47')]['id'];}else{_0x2b54ad['id']=_0x207f06[_0x50e8('0x47')]['id'];}return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':_0x2b54ad,'attributes':['id','value'],'raw':!![]})[_0x50e8('0x23')](handleEntityNotFound(_0x1372e3,null))[_0x50e8('0x23')](function(_0x373b41){if(_0x373b41){var _0x1cc5ba=path[_0x50e8('0x4b')](config[_0x50e8('0x4c')],'server/files/screen_recordings',_0x373b41[_0x50e8('0x4d')]);var _0x5d0d54=util['format']('%s.cypher',_0x1cc5ba);if(fs[_0x50e8('0x4e')](_0x5d0d54)){_0x55083e=!![];return _0x5f5220['decryptFile'](_0x5d0d54,_0x1cc5ba,config[_0x50e8('0x4f')][_0x50e8('0x50')])[_0x50e8('0x23')](function(){return _0x373b41;});}return _0x373b41;}})[_0x50e8('0x23')](function(_0x279cf4){if(_0x279cf4){var _0x12224d=path[_0x50e8('0x4b')](config['root'],_0x50e8('0x51'),_0x279cf4[_0x50e8('0x4d')]);if(!fs[_0x50e8('0x4e')](_0x12224d)){throw new db['Sequelize']['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x279cf4[_0x50e8('0x52')]){return _0x1372e3[_0x50e8('0x49')](_0x12224d,_0x279cf4[_0x50e8('0x52')]+path[_0x50e8('0x53')](_0x12224d),function(){if(_0x55083e){fs[_0x50e8('0x54')](_0x12224d);}});}else{return _0x1372e3[_0x50e8('0x49')](_0x12224d,function(_0x583d6a){if(_0x55083e){fs[_0x50e8('0x54')](_0x12224d);}});}}})['catch'](function(_0x255b48){if(_0x255b48[_0x50e8('0x55')]==='ScreenRecording\x20not\x20found'){_0x1372e3['status'](0x194)['send'](_0x50e8('0x56'));}else{return handleError(_0x1372e3,null);}});};exports[_0x50e8('0x57')]=function(_0x5d1fc8,_0x351047){return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':{'id':_0x5d1fc8[_0x50e8('0x47')]['id']}})[_0x50e8('0x23')](function(_0x47b428){if(_[_0x50e8('0x58')](_0x47b428)){throw new ReferenceError(_0x50e8('0x59'));}return _0x47b428;})[_0x50e8('0x23')](function(_0x4b80ac){var _0x583e58=path[_0x50e8('0x4b')](config[_0x50e8('0x4c')],_0x50e8('0x51'),_0x4b80ac[_0x50e8('0x4d')]);logger[_0x50e8('0x5a')](_0x50e8('0x5b'),_0x583e58);if(!_['isNil'](_0x4b80ac['value'])&&fs[_0x50e8('0x4e')](_0x583e58)){logger['info'](_0x50e8('0x5c')+_0x583e58+_0x50e8('0x5d'));fs['unlinkSync'](_0x583e58);}_0x583e58=_0x583e58+_0x50e8('0x5e');if(!_['isNil'](_0x4b80ac['value'])&&fs['existsSync'](_0x583e58)){logger[_0x50e8('0x5a')](_0x50e8('0x5c')+_0x583e58+_0x50e8('0x5d'));fs[_0x50e8('0x5f')](_0x583e58);}return _0x4b80ac;})['then'](function(_0x480362){if(!_0x480362)throw new InternalError();return _0x480362[_0x50e8('0x57')]();})[_0x50e8('0x23')](function(){_0x351047[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();})[_0x50e8('0x3e')](handleError(_0x351047,null));}; \ No newline at end of file +var _0x81bd=['Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','model','differenceBy','format','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','duration','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','root','%s.cypher','existsSync','secrets','recording','join','server/files/screen_recordings'];(function(_0x2bc4bb,_0x545b57){var _0x3587f4=function(_0x5abd4f){while(--_0x5abd4f){_0x2bc4bb['push'](_0x2bc4bb['shift']());}};_0x3587f4(++_0x545b57);}(_0x81bd,0x7c));var _0xd81b=function(_0x28d06c,_0xf80378){_0x28d06c=_0x28d06c-0x0;var _0x594317=_0x81bd[_0x28d06c];return _0x594317;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2ccedf,_0x1bf351){return function(_0x596389){if(!_0x596389){_0x2ccedf[_0xd81b('0x1b')](0x194);}return _0x596389;};}function handleError(_0x99dbc9,_0xe3637a){_0xe3637a=_0xe3637a||0x1f4;return function(_0x31b9fd){logger[_0xd81b('0x2a')](_0x31b9fd[_0xd81b('0x2b')]);if(_0x31b9fd[_0xd81b('0x2c')]){delete _0x31b9fd[_0xd81b('0x2c')];}_0x99dbc9[_0xd81b('0x1d')](_0xe3637a)['send'](_0x31b9fd);};}exports[_0xd81b('0x2d')]=function(_0x4e2eff,_0x5c8aee){var _0xb9ff9f={},_0x260310={},_0x5141e6={'count':0x0,'rows':[]};var _0x481454=_[_0xd81b('0x2e')](db[_0xd81b('0x2f')][_0xd81b('0x30')],function(_0x289f54){return{'name':_0x289f54[_0xd81b('0x31')],'type':_0x289f54[_0xd81b('0x32')]['key']};});_0x260310[_0xd81b('0x33')]=_[_0xd81b('0x34')](_['map'](_0x481454,'name'),[_0xd81b('0x35')]);_0x260310[_0xd81b('0x36')]=_['keys'](_0x4e2eff['query']);_0x260310['filters']=_[_0xd81b('0x37')](_0x260310[_0xd81b('0x33')],_0x260310[_0xd81b('0x36')]);_0xb9ff9f[_0xd81b('0x38')]=_[_0xd81b('0x37')](_0x260310[_0xd81b('0x33')],qs[_0xd81b('0x39')](_0x4e2eff['query'][_0xd81b('0x39')]));_0xb9ff9f['attributes']=_0xb9ff9f[_0xd81b('0x38')][_0xd81b('0x3a')]?_0xb9ff9f[_0xd81b('0x38')]:_0x260310[_0xd81b('0x33')];if(!_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x3b')](_0xd81b('0x3c'))){_0xb9ff9f[_0xd81b('0x20')]=qs[_0xd81b('0x20')](_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x20')]);_0xb9ff9f[_0xd81b('0x22')]=qs[_0xd81b('0x22')](_0x4e2eff['query']['offset']);}_0xb9ff9f[_0xd81b('0x3d')]=qs[_0xd81b('0x3e')](_0x4e2eff[_0xd81b('0x36')]['sort']);_0xb9ff9f[_0xd81b('0x3f')]=qs[_0xd81b('0x40')](_['pick'](_0x4e2eff[_0xd81b('0x36')],_0x260310[_0xd81b('0x40')]),_0x481454);if(_0x4e2eff['query'][_0xd81b('0x41')]){_0xb9ff9f['where']=_[_0xd81b('0x42')](_0xb9ff9f[_0xd81b('0x3f')],{'$or':_[_0xd81b('0x2e')](_0x481454,function(_0x3f6deb){if(_0x3f6deb['type']!==_0xd81b('0x43')){var _0x3444d4={};_0x3444d4[_0x3f6deb[_0xd81b('0x2c')]]={'$like':'%'+_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x41')]+'%'};return _0x3444d4;}})});}_0xb9ff9f=_[_0xd81b('0x42')]({},_0xb9ff9f,_0x4e2eff[_0xd81b('0x44')]);var _0x532ada={'where':_0xb9ff9f[_0xd81b('0x3f')]};return db[_0xd81b('0x2f')][_0xd81b('0x21')](_0x532ada)['then'](function(_0x3bea7d){_0x5141e6[_0xd81b('0x21')]=_0x3bea7d;if(_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x45')]){_0xb9ff9f[_0xd81b('0x46')]=[{'all':!![]}];}return db['ScreenRecording'][_0xd81b('0x47')](_0xb9ff9f);})[_0xd81b('0x28')](function(_0x448e24){_0x5141e6[_0xd81b('0x48')]=_0x448e24;return _0x5141e6;})[_0xd81b('0x28')](respondWithFilteredResult(_0x5c8aee,_0xb9ff9f))[_0xd81b('0x49')](handleError(_0x5c8aee,null));};exports[_0xd81b('0x4a')]=function(_0x486f0d,_0x4405a8){var _0x3ba339={'raw':![],'where':{'id':_0x486f0d['params']['id']}},_0x1e3690={};_0x1e3690[_0xd81b('0x33')]=_[_0xd81b('0x4b')](db[_0xd81b('0x2f')][_0xd81b('0x30')]);_0x1e3690[_0xd81b('0x36')]=_[_0xd81b('0x4b')](_0x486f0d[_0xd81b('0x36')]);_0x1e3690[_0xd81b('0x40')]=_['intersection'](_0x1e3690['model'],_0x1e3690[_0xd81b('0x36')]);_0x3ba339[_0xd81b('0x38')]=_[_0xd81b('0x37')](_0x1e3690[_0xd81b('0x33')],qs[_0xd81b('0x39')](_0x486f0d[_0xd81b('0x36')][_0xd81b('0x39')]));_0x3ba339[_0xd81b('0x38')]=_0x3ba339[_0xd81b('0x38')][_0xd81b('0x3a')]?_0x3ba339[_0xd81b('0x38')]:_0x1e3690[_0xd81b('0x33')];if(_0x486f0d['query'][_0xd81b('0x45')]){_0x3ba339[_0xd81b('0x46')]=[{'all':!![]}];}_0x3ba339=_[_0xd81b('0x42')]({},_0x3ba339,_0x486f0d[_0xd81b('0x44')]);return db[_0xd81b('0x2f')][_0xd81b('0x4c')](_0x3ba339)[_0xd81b('0x28')](handleEntityNotFound(_0x4405a8,null))[_0xd81b('0x28')](respondWithResult(_0x4405a8,null))[_0xd81b('0x49')](handleError(_0x4405a8,null));};exports['create']=function(_0xf401e0,_0x2368dd){return db[_0xd81b('0x2f')][_0xd81b('0x4d')](_0xf401e0['body'],{})[_0xd81b('0x28')](respondWithResult(_0x2368dd,0xc9))[_0xd81b('0x49')](handleError(_0x2368dd,null));};exports[_0xd81b('0x27')]=function(_0xe874b6,_0x2699e6){if(_0xe874b6[_0xd81b('0x4e')]['id']){delete _0xe874b6[_0xd81b('0x4e')]['id'];}delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x4f')];delete _0xe874b6['body']['createdAt'];delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x50')];delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x51')];return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':{'id':_0xe874b6[_0xd81b('0x52')]['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2699e6,null))['then'](saveUpdates(_0xe874b6[_0xd81b('0x4e')],null))[_0xd81b('0x28')](respondWithResult(_0x2699e6,null))[_0xd81b('0x49')](handleError(_0x2699e6,null));};exports[_0xd81b('0x53')]=function(_0x4651d3,_0x59b13b){return db[_0xd81b('0x2f')][_0xd81b('0x53')]()['then'](respondWithResult(_0x59b13b,null))[_0xd81b('0x49')](handleError(_0x59b13b,null));};exports[_0xd81b('0x54')]=function(_0x100319,_0x3b7ed7,_0x21cd71){var _0xa366c8=require(_0xd81b('0x55'));var _0x22f588=![];var _0x3ed626={};if(_0x100319[_0xd81b('0x36')][_0xd81b('0x32')]&&_0x100319['query'][_0xd81b('0x32')]==='uniqueid'){_0x3ed626[_0xd81b('0x56')]=_0x100319[_0xd81b('0x52')]['id'];}else{_0x3ed626['id']=_0x100319[_0xd81b('0x52')]['id'];}return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':_0x3ed626,'attributes':['id',_0xd81b('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x3b7ed7,null))[_0xd81b('0x28')](function(_0xe0c9c6){if(_0xe0c9c6){var _0x51f5a1=path['join'](config[_0xd81b('0x57')],'server/files/screen_recordings',_0xe0c9c6[_0xd81b('0x51')]);var _0x51f066=util[_0xd81b('0x35')](_0xd81b('0x58'),_0x51f5a1);if(fs[_0xd81b('0x59')](_0x51f066)){_0x22f588=!![];return _0xa366c8['decryptFile'](_0x51f066,_0x51f5a1,config[_0xd81b('0x5a')][_0xd81b('0x5b')])['then'](function(){return _0xe0c9c6;});}return _0xe0c9c6;}})[_0xd81b('0x28')](function(_0x108aaf){if(_0x108aaf){var _0x5951ec=path[_0xd81b('0x5c')](config['root'],_0xd81b('0x5d'),_0x108aaf[_0xd81b('0x51')]);if(!fs[_0xd81b('0x59')](_0x5951ec)){throw new db[(_0xd81b('0x5e'))][(_0xd81b('0x5f'))](_0xd81b('0x60'));}if(_0x108aaf[_0xd81b('0x61')]){return _0x3b7ed7[_0xd81b('0x54')](_0x5951ec,_0x108aaf[_0xd81b('0x61')]+path[_0xd81b('0x62')](_0x5951ec),function(){if(_0x22f588){fs['unlink'](_0x5951ec);}});}else{return _0x3b7ed7[_0xd81b('0x54')](_0x5951ec,function(_0x434434){if(_0x22f588){fs[_0xd81b('0x63')](_0x5951ec);}});}}})[_0xd81b('0x49')](function(_0x1bdf37){if(_0x1bdf37[_0xd81b('0x64')]===_0xd81b('0x60')){_0x3b7ed7['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x3b7ed7,null);}});};exports[_0xd81b('0x29')]=function(_0x12b0bf,_0x37507e){return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':{'id':_0x12b0bf[_0xd81b('0x52')]['id']}})[_0xd81b('0x28')](function(_0x5afecf){if(_[_0xd81b('0x65')](_0x5afecf)){throw new ReferenceError(_0xd81b('0x66'));}return _0x5afecf;})[_0xd81b('0x28')](function(_0x2090e9){var _0x41719b=path[_0xd81b('0x5c')](config[_0xd81b('0x57')],'server/files/screen_recordings',_0x2090e9[_0xd81b('0x51')]);logger[_0xd81b('0x67')](_0xd81b('0x68'),_0x41719b);if(!_[_0xd81b('0x65')](_0x2090e9[_0xd81b('0x51')])&&fs[_0xd81b('0x59')](_0x41719b)){logger[_0xd81b('0x67')](_0xd81b('0x69')+_0x41719b+_0xd81b('0x6a'));fs[_0xd81b('0x6b')](_0x41719b);}_0x41719b=_0x41719b+_0xd81b('0x6c');if(!_[_0xd81b('0x65')](_0x2090e9['value'])&&fs[_0xd81b('0x59')](_0x41719b)){logger['info'](_0xd81b('0x69')+_0x41719b+_0xd81b('0x6a'));fs[_0xd81b('0x6b')](_0x41719b);}return _0x2090e9;})[_0xd81b('0x28')](function(_0xb94a69){if(!_0xb94a69)throw new InternalError();return _0xb94a69[_0xd81b('0x29')]();})[_0xd81b('0x28')](function(){_0x37507e[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();})[_0xd81b('0x49')](handleError(_0x37507e,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index a51c2c9..7f7eefa 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 _0x8c3a=['interactionid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings'];(function(_0x3946d4,_0xd67c03){var _0x6e1edf=function(_0x30423b){while(--_0x30423b){_0x3946d4['push'](_0x3946d4['shift']());}};_0x6e1edf(++_0xd67c03);}(_0x8c3a,0x14b));var _0xa8c3=function(_0x135670,_0x4e71b8){_0x135670=_0x135670-0x0;var _0x2f7b12=_0x8c3a[_0x135670];return _0x2f7b12;};'use strict';var _=require(_0xa8c3('0x0'));var util=require(_0xa8c3('0x1'));var logger=require(_0xa8c3('0x2'))(_0xa8c3('0x3'));var moment=require(_0xa8c3('0x4'));var BPromise=require('bluebird');var rp=require(_0xa8c3('0x5'));var fs=require('fs');var path=require(_0xa8c3('0x6'));var rimraf=require(_0xa8c3('0x7'));var config=require(_0xa8c3('0x8'));var attributes=require(_0xa8c3('0x9'));module[_0xa8c3('0xa')]=function(_0x2a3c3a,_0x1aee54){return _0x2a3c3a[_0xa8c3('0xb')](_0xa8c3('0xc'),attributes,{'tableName':_0xa8c3('0xd'),'paranoid':![],'indexes':[{'name':_0xa8c3('0xe'),'fields':[_0xa8c3('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3782=['screen_recordings','interactionid','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording'];(function(_0x17aec9,_0x2724ad){var _0x5e5792=function(_0x117bc8){while(--_0x117bc8){_0x17aec9['push'](_0x17aec9['shift']());}};_0x5e5792(++_0x2724ad);}(_0x3782,0x84));var _0x2378=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3782[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2378('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2378('0x1'));var moment=require(_0x2378('0x2'));var BPromise=require(_0x2378('0x3'));var rp=require(_0x2378('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2378('0x5'));var config=require(_0x2378('0x6'));var attributes=require(_0x2378('0x7'));module[_0x2378('0x8')]=function(_0x16fccc,_0x5a51d5){return _0x16fccc[_0x2378('0x9')](_0x2378('0xa'),attributes,{'tableName':_0x2378('0xb'),'paranoid':![],'indexes':[{'name':_0x2378('0xc'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index fb45739..f2168a1 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 _0xe04e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2cb84f,_0x1c0944){var _0x52086b=function(_0x149856){while(--_0x149856){_0x2cb84f['push'](_0x2cb84f['shift']());}};_0x52086b(++_0x1c0944);}(_0xe04e,0x12b));var _0xee04=function(_0x5f343d,_0x1de7e2){_0x5f343d=_0x5f343d-0x0;var _0x47dbd7=_0xe04e[_0x5f343d];return _0x47dbd7;};'use strict';var _=require(_0xee04('0x0'));var util=require(_0xee04('0x1'));var moment=require(_0xee04('0x2'));var BPromise=require(_0xee04('0x3'));var rs=require(_0xee04('0x4'));var fs=require('fs');var Redis=require(_0xee04('0x5'));var db=require(_0xee04('0x6'))['db'];var utils=require(_0xee04('0x7'));var logger=require('../../config/logger')(_0xee04('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xee04('0x9')][_0xee04('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x246fe5,_0x5e6119,_0x670a5b){return new BPromise(function(_0x285e48,_0x31e588){return client[_0xee04('0xb')](_0x246fe5,_0x670a5b)[_0xee04('0xc')](function(_0x229993){logger[_0xee04('0xd')](_0xee04('0xe'),_0x5e6119,_0xee04('0xf'));logger['debug'](_0xee04('0x10'),_0x5e6119,_0xee04('0xf'),JSON[_0xee04('0x11')](_0x229993));if(_0x229993[_0xee04('0x12')]){if(_0x229993['error'][_0xee04('0x13')]===0x1f4){logger['error'](_0xee04('0xe'),_0x5e6119,_0x229993[_0xee04('0x12')][_0xee04('0x14')]);return _0x31e588(_0x229993[_0xee04('0x12')][_0xee04('0x14')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x5e6119,_0x229993['error'][_0xee04('0x14')]);return _0x285e48(_0x229993[_0xee04('0x12')]['message']);}else{logger['info'](_0xee04('0xe'),_0x5e6119,_0xee04('0xf'));_0x285e48(_0x229993[_0xee04('0x15')][_0xee04('0x14')]);}})[_0xee04('0x16')](function(_0x7dd0f3){logger[_0xee04('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x5e6119,_0x7dd0f3);_0x31e588(_0x7dd0f3);});});} \ No newline at end of file +var _0xb746=['bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xb746,0x6c));var _0x6b74=function(_0x59e510,_0x1698a9){_0x59e510=_0x59e510-0x0;var _0x4c612d=_0xb746[_0x59e510];return _0x4c612d;};'use strict';var _=require('lodash');var util=require(_0x6b74('0x0'));var moment=require(_0x6b74('0x1'));var BPromise=require(_0x6b74('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b74('0x3'))['db'];var utils=require(_0x6b74('0x4'));var logger=require(_0x6b74('0x5'))('rpc');var config=require(_0x6b74('0x6'));var jayson=require(_0x6b74('0x7'));var client=jayson[_0x6b74('0x8')][_0x6b74('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x81b1d0,_0x42d090,_0x9796cd){return new BPromise(function(_0x86f02e,_0x172f20){return client[_0x6b74('0xa')](_0x81b1d0,_0x9796cd)[_0x6b74('0xb')](function(_0x18ae1f){logger[_0x6b74('0xc')](_0x6b74('0xd'),_0x42d090,_0x6b74('0xe'));logger[_0x6b74('0xf')](_0x6b74('0x10'),_0x42d090,_0x6b74('0xe'),JSON['stringify'](_0x18ae1f));if(_0x18ae1f[_0x6b74('0x11')]){if(_0x18ae1f[_0x6b74('0x11')][_0x6b74('0x12')]===0x1f4){logger['error'](_0x6b74('0xd'),_0x42d090,_0x18ae1f[_0x6b74('0x11')][_0x6b74('0x13')]);return _0x172f20(_0x18ae1f[_0x6b74('0x11')]['message']);}logger[_0x6b74('0x11')](_0x6b74('0xd'),_0x42d090,_0x18ae1f[_0x6b74('0x11')][_0x6b74('0x13')]);return _0x86f02e(_0x18ae1f[_0x6b74('0x11')][_0x6b74('0x13')]);}else{logger[_0x6b74('0xc')](_0x6b74('0xd'),_0x42d090,_0x6b74('0xe'));_0x86f02e(_0x18ae1f[_0x6b74('0x14')][_0x6b74('0x13')]);}})[_0x6b74('0x15')](function(_0x4c1d7f){logger['error'](_0x6b74('0xd'),_0x42d090,_0x4c1d7f);_0x172f20(_0x4c1d7f);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 194e837..980488c 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 _0xcac9=['diskStorage','preferred','post','/:id/preferred','addPreferred','favicon','addFavicon','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/now','getDate','show','getLogo','/:id/logo_login','getPreferred','/:id/favicon','getFavicon','join','root','%s%s','logo','extname','originalname','/:id/logo','single','file','addLogo','server/files/images/logos/','format','addLogoLogin'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcac9,0x162));var _0x9cac=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xcac9[_0x1c8c28];return _0x1f59b4;};'use strict';var multer=require(_0x9cac('0x0'));var util=require(_0x9cac('0x1'));var path=require(_0x9cac('0x2'));var timeout=require(_0x9cac('0x3'));var express=require(_0x9cac('0x4'));var router=express[_0x9cac('0x5')]();var fs_extra=require(_0x9cac('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9cac('0x7'));var config=require(_0x9cac('0x8'));var controller=require('./setting.controller');router['get']('/',auth[_0x9cac('0x9')](),controller[_0x9cac('0xa')]);router[_0x9cac('0xb')](_0x9cac('0xc'),controller[_0x9cac('0xd')]);router[_0x9cac('0xb')]('/:id',controller[_0x9cac('0xe')]);router[_0x9cac('0xb')]('/:id/logo',controller[_0x9cac('0xf')]);router[_0x9cac('0xb')](_0x9cac('0x10'),controller['getLogoLogin']);router[_0x9cac('0xb')]('/:id/gdpr',controller['gdpr']);router[_0x9cac('0xb')]('/:id/preferred',controller[_0x9cac('0x11')]);router[_0x9cac('0xb')](_0x9cac('0x12'),controller[_0x9cac('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3889ce,_0x1aa9d7,_0x1eb310){_0x1eb310(null,path[_0x9cac('0x14')](config[_0x9cac('0x15')],'server/files/images/logos/'));},'filename':function(_0x5e88ba,_0x28ef7b,_0x14d4fc){_0x14d4fc(null,util['format'](_0x9cac('0x16'),_0x9cac('0x17'),path[_0x9cac('0x18')](_0x28ef7b[_0x9cac('0x19')])));}})});router['post'](_0x9cac('0x1a'),upload[_0x9cac('0x1b')](_0x9cac('0x1c')),controller[_0x9cac('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52fac9,_0x54e853,_0x2a0c32){_0x2a0c32(null,path['join'](config['root'],_0x9cac('0x1e')));},'filename':function(_0x24c8e5,_0xb447d2,_0x57be67){_0x57be67(null,util[_0x9cac('0x1f')]('%s%s','logologin',path[_0x9cac('0x18')](_0xb447d2[_0x9cac('0x19')])));}})});router['post'](_0x9cac('0x10'),upload[_0x9cac('0x1b')](_0x9cac('0x1c')),controller[_0x9cac('0x20')]);var upload=multer({'storage':multer[_0x9cac('0x21')]({'destination':function(_0x2077cd,_0x268697,_0x5b53fa){_0x5b53fa(null,path[_0x9cac('0x14')](config[_0x9cac('0x15')],_0x9cac('0x1e')));},'filename':function(_0x3d4d80,_0x12351d,_0x4fc716){_0x4fc716(null,util[_0x9cac('0x1f')](_0x9cac('0x16'),_0x9cac('0x22'),path[_0x9cac('0x18')](_0x12351d[_0x9cac('0x19')])));}})});router[_0x9cac('0x23')](_0x9cac('0x24'),upload[_0x9cac('0x1b')](_0x9cac('0x1c')),controller[_0x9cac('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1570b2,_0x5ac6c6,_0x414644){_0x414644(null,path['join'](config[_0x9cac('0x15')],'server/files/images/logos/'));},'filename':function(_0x3b9b04,_0x144ecf,_0x645ecc){_0x645ecc(null,util[_0x9cac('0x1f')]('%s%s',_0x9cac('0x26'),path[_0x9cac('0x18')](_0x144ecf['originalname'])));}})});router[_0x9cac('0x23')](_0x9cac('0x12'),upload['single']('file'),controller[_0x9cac('0x27')]);router['put'](_0x9cac('0x28'),auth[_0x9cac('0x9')](),controller[_0x9cac('0x29')]);module[_0x9cac('0x2a')]=router; \ No newline at end of file +var _0x1f12=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','post','single','file','addLogo','%s%s','extname','addLogoLogin','preferred','originalname','addFavicon','update'];(function(_0x2b3ddc,_0x34f2e2){var _0x36bbc5=function(_0x2301bb){while(--_0x2301bb){_0x2b3ddc['push'](_0x2b3ddc['shift']());}};_0x36bbc5(++_0x34f2e2);}(_0x1f12,0xce));var _0x21f1=function(_0x37c61b,_0x421fe2){_0x37c61b=_0x37c61b-0x0;var _0x1d1200=_0x1f12[_0x37c61b];return _0x1d1200;};'use strict';var multer=require('multer');var util=require(_0x21f1('0x0'));var path=require('path');var timeout=require(_0x21f1('0x1'));var express=require(_0x21f1('0x2'));var router=express[_0x21f1('0x3')]();var fs_extra=require(_0x21f1('0x4'));var auth=require(_0x21f1('0x5'));var interaction=require(_0x21f1('0x6'));var config=require('../../config/environment');var controller=require(_0x21f1('0x7'));router[_0x21f1('0x8')]('/',auth[_0x21f1('0x9')](),controller['index']);router[_0x21f1('0x8')](_0x21f1('0xa'),controller[_0x21f1('0xb')]);router[_0x21f1('0x8')](_0x21f1('0xc'),controller[_0x21f1('0xd')]);router[_0x21f1('0x8')](_0x21f1('0xe'),controller[_0x21f1('0xf')]);router['get'](_0x21f1('0x10'),controller['getLogoLogin']);router[_0x21f1('0x8')](_0x21f1('0x11'),controller[_0x21f1('0x12')]);router[_0x21f1('0x8')](_0x21f1('0x13'),controller[_0x21f1('0x14')]);router[_0x21f1('0x8')](_0x21f1('0x15'),controller[_0x21f1('0x16')]);var upload=multer({'storage':multer[_0x21f1('0x17')]({'destination':function(_0x3b57aa,_0x3159c6,_0x519b63){_0x519b63(null,path[_0x21f1('0x18')](config[_0x21f1('0x19')],_0x21f1('0x1a')));},'filename':function(_0x21866d,_0x5c05a4,_0x41b20a){_0x41b20a(null,util[_0x21f1('0x1b')]('%s%s',_0x21f1('0x1c'),path['extname'](_0x5c05a4['originalname'])));}})});router[_0x21f1('0x1d')](_0x21f1('0xe'),upload[_0x21f1('0x1e')](_0x21f1('0x1f')),controller[_0x21f1('0x20')]);var upload=multer({'storage':multer[_0x21f1('0x17')]({'destination':function(_0x472ac0,_0x543fbc,_0x2f5198){_0x2f5198(null,path[_0x21f1('0x18')](config[_0x21f1('0x19')],_0x21f1('0x1a')));},'filename':function(_0x4217ad,_0x3c18f1,_0x23d883){_0x23d883(null,util[_0x21f1('0x1b')](_0x21f1('0x21'),'logologin',path[_0x21f1('0x22')](_0x3c18f1['originalname'])));}})});router[_0x21f1('0x1d')](_0x21f1('0x10'),upload[_0x21f1('0x1e')](_0x21f1('0x1f')),controller[_0x21f1('0x23')]);var upload=multer({'storage':multer[_0x21f1('0x17')]({'destination':function(_0x6e53bc,_0x354e80,_0x42b934){_0x42b934(null,path[_0x21f1('0x18')](config['root'],_0x21f1('0x1a')));},'filename':function(_0x3905c8,_0x1806fa,_0x32afcd){_0x32afcd(null,util[_0x21f1('0x1b')](_0x21f1('0x21'),_0x21f1('0x24'),path['extname'](_0x1806fa['originalname'])));}})});router[_0x21f1('0x1d')](_0x21f1('0x13'),upload[_0x21f1('0x1e')](_0x21f1('0x1f')),controller['addPreferred']);var upload=multer({'storage':multer[_0x21f1('0x17')]({'destination':function(_0x107096,_0x53ea0b,_0x4f15de){_0x4f15de(null,path['join'](config[_0x21f1('0x19')],_0x21f1('0x1a')));},'filename':function(_0xd00776,_0x3b2d4a,_0x569f6c){_0x569f6c(null,util[_0x21f1('0x1b')](_0x21f1('0x21'),'favicon',path['extname'](_0x3b2d4a[_0x21f1('0x25')])));}})});router[_0x21f1('0x1d')](_0x21f1('0x15'),upload['single'](_0x21f1('0x1f')),controller[_0x21f1('0x26')]);router['put'](_0x21f1('0xc'),auth['isAuthenticated'](),controller[_0x21f1('0x27')]);module[_0x21f1('0x28')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index f6fd534..112efb3 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 _0x4f98=['min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','sequelize','exports','INTEGER','min_internal'];(function(_0x504bbc,_0x497f18){var _0x1dac57=function(_0xbd99a4){while(--_0xbd99a4){_0x504bbc['push'](_0x504bbc['shift']());}};_0x1dac57(++_0x497f18);}(_0x4f98,0x196));var _0x84f9=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0x4f98[_0x64aff8];return _0x5488a3;};'use strict';var Sequelize=require(_0x84f9('0x0'));module[_0x84f9('0x1')]={'min_internal':{'type':Sequelize[_0x84f9('0x2')](0xb),'unique':_0x84f9('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x84f9('0x2')](0xb),'unique':_0x84f9('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x84f9('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x84f9('0x5')},'logo':{'type':Sequelize[_0x84f9('0x6')]},'defaultLogo':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x84f9('0x6')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x84f9('0x6')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x84f9('0x6')]},'turnaddr':{'type':Sequelize[_0x84f9('0x6')]},'turnusername':{'type':Sequelize[_0x84f9('0x6')]},'turnpassword':{'type':Sequelize[_0x84f9('0x6')]},'pageTitle':{'type':Sequelize[_0x84f9('0x6')]},'defaultPageTitle':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x84f9('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x84f9('0x6')],'defaultValue':_0x84f9('0x8')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x84f9('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x84f9('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x84f9('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x84f9('0x6')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x84f9('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x84f9('0x6')]},'allowedLoginAttempts':{'type':Sequelize[_0x84f9('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x84f9('0x2')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x84f9('0x2')]},'sentimentRegion':{'type':Sequelize[_0x84f9('0x6')]},'language':{'type':Sequelize[_0x84f9('0x6')]},'bucket':{'type':Sequelize[_0x84f9('0x6')]},'googleSsoEnabled':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x84f9('0x2')](0x2)[_0x84f9('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0x84f9('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x84f9('0x2')](0x2)[_0x84f9('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x84f9('0x2')](0x2)[_0x84f9('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x84f9('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x84f9('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x84f9('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x84f9('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x84f9('0x2')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x84f9('0x7')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x84f9('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0x65ec=['sequelize','exports','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','UNSIGNED'];(function(_0x3de5f8,_0x562155){var _0x5ebd09=function(_0x247abd){while(--_0x247abd){_0x3de5f8['push'](_0x3de5f8['shift']());}};_0x5ebd09(++_0x562155);}(_0x65ec,0x16c));var _0xc65e=function(_0x1daf49,_0x2e839c){_0x1daf49=_0x1daf49-0x0;var _0x46edfc=_0x65ec[_0x1daf49];return _0x46edfc;};'use strict';var Sequelize=require(_0xc65e('0x0'));module[_0xc65e('0x1')]={'min_internal':{'type':Sequelize[_0xc65e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xc65e('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xc65e('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xc65e('0x3')],'defaultValue':_0xc65e('0x4')},'logo':{'type':Sequelize[_0xc65e('0x3')]},'defaultLogo':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xc65e('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xc65e('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xc65e('0x3')]},'turnaddr':{'type':Sequelize[_0xc65e('0x3')]},'turnusername':{'type':Sequelize[_0xc65e('0x3')]},'turnpassword':{'type':Sequelize[_0xc65e('0x3')]},'pageTitle':{'type':Sequelize[_0xc65e('0x3')]},'defaultPageTitle':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xc65e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xc65e('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xc65e('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xc65e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xc65e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xc65e('0x3')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0xc65e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xc65e('0x3')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xc65e('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xc65e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xc65e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xc65e('0x3')]},'defaultFavicon':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xc65e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xc65e('0x2')]},'transcribeRegion':{'type':Sequelize[_0xc65e('0x3')]},'sentiment':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xc65e('0x2')]},'sentimentRegion':{'type':Sequelize[_0xc65e('0x3')]},'language':{'type':Sequelize[_0xc65e('0x3')]},'bucket':{'type':Sequelize[_0xc65e('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xc65e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xc65e('0x2')](0x2)[_0xc65e('0x6')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xc65e('0x2')](0x2)[_0xc65e('0x6')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xc65e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xc65e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xc65e('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xc65e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xc65e('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xc65e('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xc65e('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xc65e('0x2')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xc65e('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 6b01f91..a2b8a4c 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 _0x59e5=['error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','Setting','includeAll','include','rows','show','params','rawAttributes','options','body','find','addLogo','file','filename','logo','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','custom','existsSync','Sequelize','getLogoLogin','favicon','default_loginLogo.svg','ValidationError','download','gdpr','../../config/license/util','getPreferred','default_preferred.png','\x20not\x20found','addFavicon','default_favicon.ico','getDate','utcOffset','now','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x56ca6b,_0x1339dc){var _0x35634d=function(_0x15bc95){while(--_0x15bc95){_0x56ca6b['push'](_0x56ca6b['shift']());}};_0x35634d(++_0x1339dc);}(_0x59e5,0x14d));var _0x559e=function(_0x25f12c,_0x4bb260){_0x25f12c=_0x25f12c-0x0;var _0xcf430f=_0x59e5[_0x25f12c];return _0xcf430f;};'use strict';var emlformat=require(_0x559e('0x0'));var rimraf=require(_0x559e('0x1'));var zipdir=require(_0x559e('0x2'));var jsonpatch=require(_0x559e('0x3'));var rp=require(_0x559e('0x4'));var moment=require('moment');var BPromise=require(_0x559e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x559e('0x6'));var sox=require(_0x559e('0x7'));var csv=require('to-csv');var ejs=require(_0x559e('0x8'));var fs=require('fs');var fs_extra=require(_0x559e('0x9'));var _=require(_0x559e('0xa'));var squel=require(_0x559e('0xb'));var crypto=require(_0x559e('0xc'));var jsforce=require(_0x559e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x559e('0xe'));var querystring=require(_0x559e('0xf'));var Papa=require(_0x559e('0x10'));var Redis=require(_0x559e('0x11'));var authService=require(_0x559e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x559e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x559e('0x14'))('api');var utils=require(_0x559e('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x559e('0x16'))['db'];var jayson=require(_0x559e('0x17'));var client=jayson[_0x559e('0x18')][_0x559e('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3eae8d,_0x180215,_0x337216,_0x4fc005){return new BPromise(function(_0x1dded5,_0x122453){var _0x3878e1=_0x4fc005||client;return _0x3878e1[_0x559e('0x1a')](_0x3eae8d,_0x337216)[_0x559e('0x1b')](function(_0x547dec){logger[_0x559e('0x1c')](_0x559e('0x1d'),_0x180215,_0x559e('0x1e'));logger[_0x559e('0x1f')](_0x559e('0x20'),_0x180215,_0x559e('0x1e'),JSON['stringify'](_0x547dec));if(_0x547dec[_0x559e('0x21')]){if(_0x547dec[_0x559e('0x21')][_0x559e('0x22')]===0x1f4){logger['error'](_0x559e('0x1d'),_0x180215,_0x547dec[_0x559e('0x21')][_0x559e('0x23')]);return _0x122453(_0x547dec['error'][_0x559e('0x23')]);}logger['error'](_0x559e('0x1d'),_0x180215,_0x547dec[_0x559e('0x21')][_0x559e('0x23')]);return _0x1dded5(_0x547dec[_0x559e('0x21')]['message']);}else{logger['info'](_0x559e('0x1d'),_0x180215,_0x559e('0x1e'));_0x1dded5(_0x547dec[_0x559e('0x24')][_0x559e('0x23')]);}})[_0x559e('0x25')](function(_0x4d7762){logger[_0x559e('0x21')](_0x559e('0x1d'),_0x180215,_0x4d7762);_0x122453(_0x4d7762);});});}function respondWithStatusCode(_0x3aeb59,_0x6a2f89){_0x6a2f89=_0x6a2f89||0xcc;return function(_0x154e7a){if(_0x154e7a){return _0x3aeb59[_0x559e('0x26')](_0x6a2f89);}return _0x3aeb59['status'](_0x6a2f89)[_0x559e('0x27')]();};}function respondWithResult(_0x3c7814,_0x5c1f63){_0x5c1f63=_0x5c1f63||0xc8;return function(_0x3964af){if(_0x3964af){return _0x3c7814[_0x559e('0x28')](_0x5c1f63)[_0x559e('0x29')](_0x3964af);}};}function respondWithFilteredResult(_0x1faf55,_0x4d74db){return function(_0x50bae0){if(_0x50bae0){var _0x2c69ef=typeof _0x4d74db['offset']===_0x559e('0x2a')&&typeof _0x4d74db[_0x559e('0x2b')]===_0x559e('0x2a');var _0x242d27=_0x50bae0[_0x559e('0x2c')];var _0x41a284=_0x2c69ef?0x0:_0x4d74db[_0x559e('0x2d')];var _0x61e1a2=_0x2c69ef?_0x50bae0['count']:_0x4d74db[_0x559e('0x2d')]+_0x4d74db[_0x559e('0x2b')];var _0x3910a0;if(_0x61e1a2>=_0x242d27){_0x61e1a2=_0x242d27;_0x3910a0=0xc8;}else{_0x3910a0=0xce;}_0x1faf55[_0x559e('0x28')](_0x3910a0);return _0x1faf55[_0x559e('0x2e')](_0x559e('0x2f'),_0x41a284+'-'+_0x61e1a2+'/'+_0x242d27)[_0x559e('0x29')](_0x50bae0);}return null;};}function patchUpdates(_0x5ec168){return function(_0x1e50ee){try{jsonpatch[_0x559e('0x30')](_0x1e50ee,_0x5ec168,!![]);}catch(_0x33a469){return BPromise[_0x559e('0x31')](_0x33a469);}return _0x1e50ee[_0x559e('0x32')]();};}function saveUpdates(_0x343c40,_0x4a5745){return function(_0x564400){if(_0x564400){return _0x564400[_0x559e('0x33')](_0x343c40)[_0x559e('0x1b')](function(_0x3497e7){return _0x3497e7;});}return null;};}function removeEntity(_0x2e7ead,_0x219f00){return function(_0x3e2d4a){if(_0x3e2d4a){return _0x3e2d4a[_0x559e('0x34')]()['then'](function(){_0x2e7ead['status'](0xcc)[_0x559e('0x27')]();});}};}function handleEntityNotFound(_0x4f69f8,_0x39143){return function(_0x133f89){if(!_0x133f89){_0x4f69f8[_0x559e('0x26')](0x194);}return _0x133f89;};}function handleError(_0x33a959,_0x671583){_0x671583=_0x671583||0x1f4;return function(_0x543d23){logger[_0x559e('0x21')](_0x543d23[_0x559e('0x35')]);if(_0x543d23[_0x559e('0x36')]){delete _0x543d23[_0x559e('0x36')];}_0x33a959[_0x559e('0x28')](_0x671583)[_0x559e('0x37')](_0x543d23);};}exports[_0x559e('0x38')]=function(_0x1c9c04,_0x1b4538){var _0x24c8a8={},_0x29765b={},_0x2eb92e={'count':0x0,'rows':[]};var _0x4c932d=_[_0x559e('0x39')](db['Setting']['rawAttributes'],function(_0x271c70){return{'name':_0x271c70[_0x559e('0x3a')],'type':_0x271c70[_0x559e('0x3b')][_0x559e('0x3c')]};});_0x29765b[_0x559e('0x3d')]=_[_0x559e('0x39')](_0x4c932d,_0x559e('0x36'));_0x29765b[_0x559e('0x3e')]=_[_0x559e('0x3f')](_0x1c9c04[_0x559e('0x3e')]);_0x29765b[_0x559e('0x40')]=_['intersection'](_0x29765b['model'],_0x29765b[_0x559e('0x3e')]);_0x24c8a8[_0x559e('0x41')]=_[_0x559e('0x42')](_0x29765b[_0x559e('0x3d')],qs[_0x559e('0x43')](_0x1c9c04[_0x559e('0x3e')][_0x559e('0x43')]));_0x24c8a8[_0x559e('0x41')]=_0x24c8a8['attributes'][_0x559e('0x44')]?_0x24c8a8[_0x559e('0x41')]:_0x29765b[_0x559e('0x3d')];if(!_0x1c9c04[_0x559e('0x3e')][_0x559e('0x45')]('nolimit')){_0x24c8a8[_0x559e('0x2b')]=qs[_0x559e('0x2b')](_0x1c9c04['query'][_0x559e('0x2b')]);_0x24c8a8[_0x559e('0x2d')]=qs['offset'](_0x1c9c04[_0x559e('0x3e')][_0x559e('0x2d')]);}_0x24c8a8[_0x559e('0x46')]=qs[_0x559e('0x47')](_0x1c9c04[_0x559e('0x3e')][_0x559e('0x47')]);_0x24c8a8[_0x559e('0x48')]=qs[_0x559e('0x40')](_[_0x559e('0x49')](_0x1c9c04[_0x559e('0x3e')],_0x29765b[_0x559e('0x40')]),_0x4c932d);if(_0x1c9c04[_0x559e('0x3e')]['filter']){_0x24c8a8[_0x559e('0x48')]=_[_0x559e('0x4a')](_0x24c8a8[_0x559e('0x48')],{'$or':_[_0x559e('0x39')](_0x4c932d,function(_0x16ff48){if(_0x16ff48[_0x559e('0x3b')]!=='VIRTUAL'){var _0x15683c={};_0x15683c[_0x16ff48['name']]={'$like':'%'+_0x1c9c04['query']['filter']+'%'};return _0x15683c;}})});}_0x24c8a8=_[_0x559e('0x4a')]({},_0x24c8a8,_0x1c9c04['options']);var _0x351950={'where':_0x24c8a8['where']};return db[_0x559e('0x4b')][_0x559e('0x2c')](_0x351950)[_0x559e('0x1b')](function(_0x25a55e){_0x2eb92e[_0x559e('0x2c')]=_0x25a55e;if(_0x1c9c04[_0x559e('0x3e')][_0x559e('0x4c')]){_0x24c8a8[_0x559e('0x4d')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x24c8a8);})[_0x559e('0x1b')](function(_0x873109){_0x2eb92e[_0x559e('0x4e')]=_0x873109;return _0x2eb92e;})[_0x559e('0x1b')](respondWithFilteredResult(_0x1b4538,_0x24c8a8))[_0x559e('0x25')](handleError(_0x1b4538,null));};exports[_0x559e('0x4f')]=function(_0x8e7413,_0x486a58){var _0x2621fc={'raw':![],'where':{'id':_0x8e7413[_0x559e('0x50')]['id']}},_0x1f9c20={};_0x1f9c20['model']=_[_0x559e('0x3f')](db[_0x559e('0x4b')][_0x559e('0x51')]);_0x1f9c20[_0x559e('0x3e')]=_[_0x559e('0x3f')](_0x8e7413[_0x559e('0x3e')]);_0x1f9c20[_0x559e('0x40')]=_[_0x559e('0x42')](_0x1f9c20[_0x559e('0x3d')],_0x1f9c20[_0x559e('0x3e')]);_0x2621fc[_0x559e('0x41')]=_['intersection'](_0x1f9c20[_0x559e('0x3d')],qs[_0x559e('0x43')](_0x8e7413['query'][_0x559e('0x43')]));_0x2621fc[_0x559e('0x41')]=_0x2621fc[_0x559e('0x41')][_0x559e('0x44')]?_0x2621fc[_0x559e('0x41')]:_0x1f9c20[_0x559e('0x3d')];if(_0x8e7413[_0x559e('0x3e')]['includeAll']){_0x2621fc[_0x559e('0x4d')]=[{'all':!![]}];}_0x2621fc=_[_0x559e('0x4a')]({},_0x2621fc,_0x8e7413[_0x559e('0x52')]);return db[_0x559e('0x4b')]['find'](_0x2621fc)['then'](handleEntityNotFound(_0x486a58,null))[_0x559e('0x1b')](respondWithResult(_0x486a58,null))[_0x559e('0x25')](handleError(_0x486a58,null));};exports['update']=function(_0x838c90,_0x3f1f06){if(_0x838c90[_0x559e('0x53')]['id']){delete _0x838c90[_0x559e('0x53')]['id'];}return db['Setting'][_0x559e('0x54')]({'where':{'id':_0x838c90[_0x559e('0x50')]['id']}})[_0x559e('0x1b')](handleEntityNotFound(_0x3f1f06,null))[_0x559e('0x1b')](saveUpdates(_0x838c90[_0x559e('0x53')],null))[_0x559e('0x1b')](respondWithResult(_0x3f1f06,null))[_0x559e('0x25')](handleError(_0x3f1f06,null));};exports[_0x559e('0x55')]=function(_0x587452,_0x33d0d3,_0x2b98e0){if(_0x587452[_0x559e('0x56')]&&_0x587452['file'][_0x559e('0x57')]){_0x587452[_0x559e('0x53')][_0x559e('0x58')]=_0x587452[_0x559e('0x56')][_0x559e('0x57')];}return db[_0x559e('0x4b')][_0x559e('0x54')]({'where':{'id':_0x587452[_0x559e('0x50')]['id']}})[_0x559e('0x1b')](handleEntityNotFound(_0x33d0d3,null))[_0x559e('0x1b')](saveUpdates(_0x587452[_0x559e('0x53')],null))[_0x559e('0x1b')](respondWithResult(_0x33d0d3,null))[_0x559e('0x25')](handleError(_0x33d0d3,null));};exports['addLogoLogin']=function(_0x409b37,_0x379a0d,_0x2ece31){if(_0x409b37['file']&&_0x409b37[_0x559e('0x56')]['filename']){_0x409b37[_0x559e('0x53')][_0x559e('0x59')]=_0x409b37['file'][_0x559e('0x57')];}return db[_0x559e('0x4b')]['find']({'where':{'id':_0x409b37[_0x559e('0x50')]['id']}})['then'](handleEntityNotFound(_0x379a0d,null))[_0x559e('0x1b')](saveUpdates(_0x409b37['body'],null))[_0x559e('0x1b')](respondWithResult(_0x379a0d,null))[_0x559e('0x25')](handleError(_0x379a0d,null));};var utilLicense=require('../../config/license/util');exports[_0x559e('0x5a')]=function(_0x31583c,_0x4b77e7,_0xf05be3){var _0x3048ae=_0x559e('0x5b');var _0x57f0cc={'custom':![]};return utilLicense[_0x559e('0x5c')]()[_0x559e('0x1b')](function(_0x4fa794){if(_0x4fa794){_0x57f0cc=_0x4fa794;}return db['Setting']['find']({'where':{'id':_0x31583c[_0x559e('0x50')]['id']},'attributes':[_0x559e('0x58'),'loginLogo',_0x559e('0x5d'),'favicon',_0x559e('0x5e'),_0x559e('0x5f'),_0x559e('0x60'),_0x559e('0x61')],'raw':!![]});})[_0x559e('0x1b')](handleEntityNotFound(_0x4b77e7,null))[_0x559e('0x1b')](function(_0x3cc3a9){if(_0x3cc3a9){var _0x16c59f=_0x3cc3a9['logo']&&fs['existsSync'](path[_0x559e('0x62')](config[_0x559e('0x63')],_0x3048ae,_[_0x559e('0x64')](_0x3cc3a9[_0x559e('0x58')])))?path['join'](config[_0x559e('0x63')],_0x3048ae,_[_0x559e('0x64')](_0x3cc3a9[_0x559e('0x58')])):path['join'](config[_0x559e('0x63')],_0x3048ae,_[_0x559e('0x64')](_0x559e('0x65')));var _0x36f19=_0x559e('0x66')+_[_0x559e('0x67')](_0x559e('0x58'));if(_0x3cc3a9[_0x36f19]||!_0x57f0cc[_0x559e('0x68')]){_0x16c59f=path[_0x559e('0x62')](config['root'],_0x3048ae,_['toLower'](_0x559e('0x65')));}if(!fs[_0x559e('0x69')](_0x16c59f)){throw new db[(_0x559e('0x6a'))]['ValidationError'](_[_0x559e('0x67')](_0x559e('0x58'))+'\x20not\x20found');}return _0x4b77e7['download'](_0x16c59f);}})[_0x559e('0x25')](handleError(_0x4b77e7,null));};var utilLicense=require('../../config/license/util');exports[_0x559e('0x6b')]=function(_0x4ea26b,_0x4e88cf,_0x423507){var _0x2bbc87='server/files/images/logos';var _0xdae88b={'custom':![]};return utilLicense[_0x559e('0x5c')]()[_0x559e('0x1b')](function(_0x58679b){if(_0x58679b){_0xdae88b=_0x58679b;}return db[_0x559e('0x4b')][_0x559e('0x54')]({'where':{'id':_0x4ea26b[_0x559e('0x50')]['id']},'attributes':[_0x559e('0x58'),_0x559e('0x59'),'preferred',_0x559e('0x6c'),_0x559e('0x5e'),_0x559e('0x5f'),_0x559e('0x60'),_0x559e('0x61')],'raw':!![]});})[_0x559e('0x1b')](handleEntityNotFound(_0x4e88cf,null))[_0x559e('0x1b')](function(_0x3af82e){if(_0x3af82e){var _0x481cf0=_0x3af82e[_0x559e('0x59')]&&fs[_0x559e('0x69')](path['join'](config['root'],_0x2bbc87,_[_0x559e('0x64')](_0x3af82e[_0x559e('0x59')])))?path['join'](config[_0x559e('0x63')],_0x2bbc87,_[_0x559e('0x64')](_0x3af82e[_0x559e('0x59')])):path['join'](config[_0x559e('0x63')],_0x2bbc87,_[_0x559e('0x64')](_0x559e('0x6d')));var _0x2021e9='default'+_[_0x559e('0x67')]('loginLogo');if(_0x3af82e[_0x2021e9]||!_0xdae88b['custom']){_0x481cf0=path[_0x559e('0x62')](config[_0x559e('0x63')],_0x2bbc87,_[_0x559e('0x64')](_0x559e('0x6d')));}if(!fs[_0x559e('0x69')](_0x481cf0)){throw new db[(_0x559e('0x6a'))][(_0x559e('0x6e'))](_[_0x559e('0x67')]('loginLogo')+'\x20not\x20found');}return _0x4e88cf[_0x559e('0x6f')](_0x481cf0);}})['catch'](handleError(_0x4e88cf,null));};exports[_0x559e('0x70')]=function(_0x53219a,_0x2768d2){return db['Setting'][_0x559e('0x54')]({'where':{'id':_0x53219a[_0x559e('0x50')]['id']},'attributes':['securePassword']})[_0x559e('0x1b')](respondWithResult(_0x2768d2,null))['catch'](handleError(_0x2768d2,null));};exports['addPreferred']=function(_0x29065c,_0x24e0fb,_0x3f64f1){if(_0x29065c['file']&&_0x29065c['file'][_0x559e('0x57')]){_0x29065c[_0x559e('0x53')][_0x559e('0x5d')]=_0x29065c['file'][_0x559e('0x57')];}return db['Setting'][_0x559e('0x54')]({'where':{'id':_0x29065c[_0x559e('0x50')]['id']}})[_0x559e('0x1b')](handleEntityNotFound(_0x24e0fb,null))[_0x559e('0x1b')](saveUpdates(_0x29065c[_0x559e('0x53')],null))['then'](respondWithResult(_0x24e0fb,null))[_0x559e('0x25')](handleError(_0x24e0fb,null));};var utilLicense=require(_0x559e('0x71'));exports[_0x559e('0x72')]=function(_0x4ae242,_0x5f36f2,_0x2f8e08){var _0x3e9ec9=_0x559e('0x5b');var _0x160596={'custom':![]};return utilLicense[_0x559e('0x5c')]()['then'](function(_0x1a2a91){if(_0x1a2a91){_0x160596=_0x1a2a91;}return db[_0x559e('0x4b')][_0x559e('0x54')]({'where':{'id':_0x4ae242[_0x559e('0x50')]['id']},'attributes':[_0x559e('0x58'),_0x559e('0x59'),_0x559e('0x5d'),'favicon',_0x559e('0x5e'),_0x559e('0x5f'),_0x559e('0x60'),_0x559e('0x61')],'raw':!![]});})[_0x559e('0x1b')](handleEntityNotFound(_0x5f36f2,null))[_0x559e('0x1b')](function(_0x338d06){if(_0x338d06){var _0x3391e8=_0x338d06['preferred']&&fs['existsSync'](path[_0x559e('0x62')](config[_0x559e('0x63')],_0x3e9ec9,_[_0x559e('0x64')](_0x338d06[_0x559e('0x5d')])))?path[_0x559e('0x62')](config[_0x559e('0x63')],_0x3e9ec9,_[_0x559e('0x64')](_0x338d06[_0x559e('0x5d')])):path[_0x559e('0x62')](config[_0x559e('0x63')],_0x3e9ec9,_[_0x559e('0x64')](_0x559e('0x73')));var _0x41711c=_0x559e('0x66')+_[_0x559e('0x67')](_0x559e('0x5d'));if(_0x338d06[_0x41711c]||!_0x160596[_0x559e('0x68')]||!_0x160596[_0x559e('0x5d')]){_0x3391e8=path['join'](config[_0x559e('0x63')],_0x3e9ec9,_[_0x559e('0x64')](_0x559e('0x73')));}if(!fs[_0x559e('0x69')](_0x3391e8)){throw new db[(_0x559e('0x6a'))][(_0x559e('0x6e'))](_[_0x559e('0x67')]('preferred')+_0x559e('0x74'));}return _0x5f36f2[_0x559e('0x6f')](_0x3391e8);}})[_0x559e('0x25')](handleError(_0x5f36f2,null));};exports[_0x559e('0x75')]=function(_0x3990b6,_0xd0d602,_0x175f30){if(_0x3990b6[_0x559e('0x56')]&&_0x3990b6['file'][_0x559e('0x57')]){_0x3990b6[_0x559e('0x53')]['favicon']=_0x3990b6['file'][_0x559e('0x57')];}return db[_0x559e('0x4b')][_0x559e('0x54')]({'where':{'id':_0x3990b6[_0x559e('0x50')]['id']}})['then'](handleEntityNotFound(_0xd0d602,null))[_0x559e('0x1b')](saveUpdates(_0x3990b6[_0x559e('0x53')],null))[_0x559e('0x1b')](respondWithResult(_0xd0d602,null))[_0x559e('0x25')](handleError(_0xd0d602,null));};var utilLicense=require(_0x559e('0x71'));exports['getFavicon']=function(_0x266245,_0x57775f,_0x9d1d33){var _0x2e5b7b=_0x559e('0x5b');var _0x4510f4={'custom':![]};return utilLicense[_0x559e('0x5c')]()['then'](function(_0xc43d37){if(_0xc43d37){_0x4510f4=_0xc43d37;}return db[_0x559e('0x4b')]['find']({'where':{'id':_0x266245[_0x559e('0x50')]['id']},'attributes':['logo',_0x559e('0x59'),'preferred',_0x559e('0x6c'),_0x559e('0x5e'),_0x559e('0x5f'),_0x559e('0x60'),'defaultFavicon'],'raw':!![]});})[_0x559e('0x1b')](handleEntityNotFound(_0x57775f,null))[_0x559e('0x1b')](function(_0x2bb8a4){if(_0x2bb8a4){var _0x2afcd9=_0x2bb8a4[_0x559e('0x6c')]&&fs[_0x559e('0x69')](path[_0x559e('0x62')](config[_0x559e('0x63')],_0x2e5b7b,_[_0x559e('0x64')](_0x2bb8a4[_0x559e('0x6c')])))?path[_0x559e('0x62')](config[_0x559e('0x63')],_0x2e5b7b,_[_0x559e('0x64')](_0x2bb8a4[_0x559e('0x6c')])):path[_0x559e('0x62')](config[_0x559e('0x63')],_0x2e5b7b,_[_0x559e('0x64')](_0x559e('0x76')));var _0x1f6c4d=_0x559e('0x66')+_[_0x559e('0x67')](_0x559e('0x6c'));if(_0x2bb8a4[_0x1f6c4d]||!_0x4510f4[_0x559e('0x68')]){_0x2afcd9=path[_0x559e('0x62')](config[_0x559e('0x63')],_0x2e5b7b,_[_0x559e('0x64')]('default_favicon.ico'));}if(!fs['existsSync'](_0x2afcd9)){throw new db[(_0x559e('0x6a'))]['ValidationError'](_[_0x559e('0x67')](_0x559e('0x6c'))+'\x20not\x20found');}return _0x57775f[_0x559e('0x6f')](_0x2afcd9);}})[_0x559e('0x25')](handleError(_0x57775f,null));};exports[_0x559e('0x77')]=function(_0xd569e6,_0x18a834){var _0x1d2eae={'offset':moment()[_0x559e('0x78')]()};_0x1d2eae[_0x559e('0x79')]=moment()['utcOffset'](_0x1d2eae[_0x559e('0x2d')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x18a834[_0x559e('0x28')](0xc8)[_0x559e('0x37')](_0x1d2eae);}; \ No newline at end of file +var _0x385b=['fields','attributes','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','Setting','includeAll','include','findAll','rows','catch','show','params','body','addLogo','file','filename','logo','find','getLogo','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','custom','default_logo.svg','Sequelize','ValidationError','upperFirst','download','../../config/license/util','getLogoLogin','server/files/images/logos','getLicense','default_loginLogo.svg','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','\x20not\x20found','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','then','destroy','end','send','index','map','rawAttributes','type','key','model','name','query','keys','intersection'];(function(_0x3bf8f3,_0x46e068){var _0x54cbe7=function(_0x40a256){while(--_0x40a256){_0x3bf8f3['push'](_0x3bf8f3['shift']());}};_0x54cbe7(++_0x46e068);}(_0x385b,0x1a7));var _0xb385=function(_0x51d22e,_0x276640){_0x51d22e=_0x51d22e-0x0;var _0x275be3=_0x385b[_0x51d22e];return _0x275be3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb385('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb385('0x1'));var rp=require(_0xb385('0x2'));var moment=require(_0xb385('0x3'));var BPromise=require(_0xb385('0x4'));var Mustache=require('mustache');var util=require(_0xb385('0x5'));var path=require(_0xb385('0x6'));var sox=require(_0xb385('0x7'));var csv=require(_0xb385('0x8'));var ejs=require(_0xb385('0x9'));var fs=require('fs');var fs_extra=require(_0xb385('0xa'));var _=require(_0xb385('0xb'));var squel=require(_0xb385('0xc'));var crypto=require('crypto');var jsforce=require(_0xb385('0xd'));var deskjs=require(_0xb385('0xe'));var toCsv=require(_0xb385('0x8'));var querystring=require(_0xb385('0xf'));var Papa=require('papaparse');var Redis=require(_0xb385('0x10'));var authService=require(_0xb385('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb385('0x12'));var hardwareService=require(_0xb385('0x13'));var logger=require(_0xb385('0x14'))(_0xb385('0x15'));var utils=require(_0xb385('0x16'));var config=require(_0xb385('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb385('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xb385('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4e859e,_0x1421c7,_0x886ece,_0x12a953){return new BPromise(function(_0x4fb070,_0x1577c5){var _0x3a42de=_0x12a953||client;return _0x3a42de[_0xb385('0x1a')](_0x4e859e,_0x886ece)['then'](function(_0x46a819){logger[_0xb385('0x1b')](_0xb385('0x1c'),_0x1421c7,'request\x20sent');logger[_0xb385('0x1d')](_0xb385('0x1e'),_0x1421c7,_0xb385('0x1f'),JSON[_0xb385('0x20')](_0x46a819));if(_0x46a819[_0xb385('0x21')]){if(_0x46a819[_0xb385('0x21')][_0xb385('0x22')]===0x1f4){logger[_0xb385('0x21')]('Setting,\x20%s,\x20%s',_0x1421c7,_0x46a819[_0xb385('0x21')][_0xb385('0x23')]);return _0x1577c5(_0x46a819[_0xb385('0x21')]['message']);}logger[_0xb385('0x21')](_0xb385('0x1c'),_0x1421c7,_0x46a819[_0xb385('0x21')][_0xb385('0x23')]);return _0x4fb070(_0x46a819[_0xb385('0x21')][_0xb385('0x23')]);}else{logger[_0xb385('0x1b')]('Setting,\x20%s,\x20%s',_0x1421c7,_0xb385('0x1f'));_0x4fb070(_0x46a819[_0xb385('0x24')][_0xb385('0x23')]);}})['catch'](function(_0x28a6e7){logger[_0xb385('0x21')]('Setting,\x20%s,\x20%s',_0x1421c7,_0x28a6e7);_0x1577c5(_0x28a6e7);});});}function respondWithStatusCode(_0x3a5a95,_0x51693d){_0x51693d=_0x51693d||0xcc;return function(_0x586737){if(_0x586737){return _0x3a5a95[_0xb385('0x25')](_0x51693d);}return _0x3a5a95['status'](_0x51693d)['end']();};}function respondWithResult(_0x17b887,_0x1357eb){_0x1357eb=_0x1357eb||0xc8;return function(_0x22b532){if(_0x22b532){return _0x17b887[_0xb385('0x26')](_0x1357eb)[_0xb385('0x27')](_0x22b532);}};}function respondWithFilteredResult(_0x34d727,_0x1bc0e0){return function(_0x18ec68){if(_0x18ec68){var _0x7ca0a9=typeof _0x1bc0e0[_0xb385('0x28')]===_0xb385('0x29')&&typeof _0x1bc0e0[_0xb385('0x2a')]===_0xb385('0x29');var _0x5f1c00=_0x18ec68[_0xb385('0x2b')];var _0x13fdb9=_0x7ca0a9?0x0:_0x1bc0e0[_0xb385('0x28')];var _0x5cc3c7=_0x7ca0a9?_0x18ec68[_0xb385('0x2b')]:_0x1bc0e0[_0xb385('0x28')]+_0x1bc0e0[_0xb385('0x2a')];var _0x3a10ea;if(_0x5cc3c7>=_0x5f1c00){_0x5cc3c7=_0x5f1c00;_0x3a10ea=0xc8;}else{_0x3a10ea=0xce;}_0x34d727[_0xb385('0x26')](_0x3a10ea);return _0x34d727[_0xb385('0x2c')]('Content-Range',_0x13fdb9+'-'+_0x5cc3c7+'/'+_0x5f1c00)['json'](_0x18ec68);}return null;};}function patchUpdates(_0x577bfc){return function(_0x31bc6c){try{jsonpatch['apply'](_0x31bc6c,_0x577bfc,!![]);}catch(_0x5c0da2){return BPromise[_0xb385('0x2d')](_0x5c0da2);}return _0x31bc6c['save']();};}function saveUpdates(_0x40bd39,_0x5cad1){return function(_0x295e0a){if(_0x295e0a){return _0x295e0a[_0xb385('0x2e')](_0x40bd39)[_0xb385('0x2f')](function(_0x51729){return _0x51729;});}return null;};}function removeEntity(_0x953c53,_0x29551){return function(_0x1f156f){if(_0x1f156f){return _0x1f156f[_0xb385('0x30')]()[_0xb385('0x2f')](function(){_0x953c53[_0xb385('0x26')](0xcc)[_0xb385('0x31')]();});}};}function handleEntityNotFound(_0x25e12,_0x15379b){return function(_0x397f55){if(!_0x397f55){_0x25e12['sendStatus'](0x194);}return _0x397f55;};}function handleError(_0x248123,_0x2662f5){_0x2662f5=_0x2662f5||0x1f4;return function(_0x5f19be){logger[_0xb385('0x21')](_0x5f19be['stack']);if(_0x5f19be['name']){delete _0x5f19be['name'];}_0x248123['status'](_0x2662f5)[_0xb385('0x32')](_0x5f19be);};}exports[_0xb385('0x33')]=function(_0x573b9b,_0x50f7da){var _0x51731c={},_0x48cc47={},_0x173191={'count':0x0,'rows':[]};var _0x4c2876=_[_0xb385('0x34')](db['Setting'][_0xb385('0x35')],function(_0x2be60c){return{'name':_0x2be60c['fieldName'],'type':_0x2be60c[_0xb385('0x36')][_0xb385('0x37')]};});_0x48cc47[_0xb385('0x38')]=_[_0xb385('0x34')](_0x4c2876,_0xb385('0x39'));_0x48cc47[_0xb385('0x3a')]=_[_0xb385('0x3b')](_0x573b9b[_0xb385('0x3a')]);_0x48cc47['filters']=_[_0xb385('0x3c')](_0x48cc47[_0xb385('0x38')],_0x48cc47[_0xb385('0x3a')]);_0x51731c['attributes']=_[_0xb385('0x3c')](_0x48cc47[_0xb385('0x38')],qs[_0xb385('0x3d')](_0x573b9b[_0xb385('0x3a')][_0xb385('0x3d')]));_0x51731c[_0xb385('0x3e')]=_0x51731c[_0xb385('0x3e')][_0xb385('0x3f')]?_0x51731c[_0xb385('0x3e')]:_0x48cc47[_0xb385('0x38')];if(!_0x573b9b[_0xb385('0x3a')][_0xb385('0x40')](_0xb385('0x41'))){_0x51731c[_0xb385('0x2a')]=qs[_0xb385('0x2a')](_0x573b9b[_0xb385('0x3a')][_0xb385('0x2a')]);_0x51731c[_0xb385('0x28')]=qs[_0xb385('0x28')](_0x573b9b[_0xb385('0x3a')]['offset']);}_0x51731c['order']=qs['sort'](_0x573b9b[_0xb385('0x3a')]['sort']);_0x51731c[_0xb385('0x42')]=qs[_0xb385('0x43')](_[_0xb385('0x44')](_0x573b9b[_0xb385('0x3a')],_0x48cc47[_0xb385('0x43')]),_0x4c2876);if(_0x573b9b[_0xb385('0x3a')][_0xb385('0x45')]){_0x51731c[_0xb385('0x42')]=_[_0xb385('0x46')](_0x51731c['where'],{'$or':_[_0xb385('0x34')](_0x4c2876,function(_0x546ec0){if(_0x546ec0[_0xb385('0x36')]!==_0xb385('0x47')){var _0xf8055={};_0xf8055[_0x546ec0[_0xb385('0x39')]]={'$like':'%'+_0x573b9b['query']['filter']+'%'};return _0xf8055;}})});}_0x51731c=_['merge']({},_0x51731c,_0x573b9b[_0xb385('0x48')]);var _0x438d79={'where':_0x51731c[_0xb385('0x42')]};return db[_0xb385('0x49')]['count'](_0x438d79)['then'](function(_0x485610){_0x173191[_0xb385('0x2b')]=_0x485610;if(_0x573b9b['query'][_0xb385('0x4a')]){_0x51731c[_0xb385('0x4b')]=[{'all':!![]}];}return db[_0xb385('0x49')][_0xb385('0x4c')](_0x51731c);})[_0xb385('0x2f')](function(_0x3c20af){_0x173191[_0xb385('0x4d')]=_0x3c20af;return _0x173191;})[_0xb385('0x2f')](respondWithFilteredResult(_0x50f7da,_0x51731c))[_0xb385('0x4e')](handleError(_0x50f7da,null));};exports[_0xb385('0x4f')]=function(_0x5d0e79,_0x25eee7){var _0x388400={'raw':![],'where':{'id':_0x5d0e79[_0xb385('0x50')]['id']}},_0x2ecdbb={};_0x2ecdbb[_0xb385('0x38')]=_['keys'](db[_0xb385('0x49')][_0xb385('0x35')]);_0x2ecdbb['query']=_[_0xb385('0x3b')](_0x5d0e79[_0xb385('0x3a')]);_0x2ecdbb[_0xb385('0x43')]=_['intersection'](_0x2ecdbb[_0xb385('0x38')],_0x2ecdbb[_0xb385('0x3a')]);_0x388400[_0xb385('0x3e')]=_['intersection'](_0x2ecdbb[_0xb385('0x38')],qs['fields'](_0x5d0e79[_0xb385('0x3a')][_0xb385('0x3d')]));_0x388400[_0xb385('0x3e')]=_0x388400[_0xb385('0x3e')][_0xb385('0x3f')]?_0x388400['attributes']:_0x2ecdbb[_0xb385('0x38')];if(_0x5d0e79[_0xb385('0x3a')][_0xb385('0x4a')]){_0x388400[_0xb385('0x4b')]=[{'all':!![]}];}_0x388400=_[_0xb385('0x46')]({},_0x388400,_0x5d0e79[_0xb385('0x48')]);return db[_0xb385('0x49')]['find'](_0x388400)[_0xb385('0x2f')](handleEntityNotFound(_0x25eee7,null))[_0xb385('0x2f')](respondWithResult(_0x25eee7,null))['catch'](handleError(_0x25eee7,null));};exports[_0xb385('0x2e')]=function(_0x19037d,_0xb4a4b2){if(_0x19037d[_0xb385('0x51')]['id']){delete _0x19037d[_0xb385('0x51')]['id'];}return db['Setting']['find']({'where':{'id':_0x19037d[_0xb385('0x50')]['id']}})[_0xb385('0x2f')](handleEntityNotFound(_0xb4a4b2,null))[_0xb385('0x2f')](saveUpdates(_0x19037d[_0xb385('0x51')],null))[_0xb385('0x2f')](respondWithResult(_0xb4a4b2,null))[_0xb385('0x4e')](handleError(_0xb4a4b2,null));};exports[_0xb385('0x52')]=function(_0x393ca9,_0x56655e,_0x260abb){if(_0x393ca9[_0xb385('0x53')]&&_0x393ca9[_0xb385('0x53')][_0xb385('0x54')]){_0x393ca9[_0xb385('0x51')][_0xb385('0x55')]=_0x393ca9[_0xb385('0x53')]['filename'];}return db['Setting']['find']({'where':{'id':_0x393ca9[_0xb385('0x50')]['id']}})[_0xb385('0x2f')](handleEntityNotFound(_0x56655e,null))[_0xb385('0x2f')](saveUpdates(_0x393ca9[_0xb385('0x51')],null))[_0xb385('0x2f')](respondWithResult(_0x56655e,null))['catch'](handleError(_0x56655e,null));};exports['addLogoLogin']=function(_0x5545f6,_0x8ec27c,_0x3c9ae7){if(_0x5545f6[_0xb385('0x53')]&&_0x5545f6[_0xb385('0x53')][_0xb385('0x54')]){_0x5545f6['body']['loginLogo']=_0x5545f6[_0xb385('0x53')][_0xb385('0x54')];}return db[_0xb385('0x49')][_0xb385('0x56')]({'where':{'id':_0x5545f6[_0xb385('0x50')]['id']}})[_0xb385('0x2f')](handleEntityNotFound(_0x8ec27c,null))[_0xb385('0x2f')](saveUpdates(_0x5545f6[_0xb385('0x51')],null))[_0xb385('0x2f')](respondWithResult(_0x8ec27c,null))[_0xb385('0x4e')](handleError(_0x8ec27c,null));};var utilLicense=require('../../config/license/util');exports[_0xb385('0x57')]=function(_0x5b61ff,_0xd25d06,_0x4a6e2c){var _0x566706='server/files/images/logos';var _0x39021b={'custom':![]};return utilLicense['getLicense']()[_0xb385('0x2f')](function(_0x4571d9){if(_0x4571d9){_0x39021b=_0x4571d9;}return db[_0xb385('0x49')][_0xb385('0x56')]({'where':{'id':_0x5b61ff[_0xb385('0x50')]['id']},'attributes':[_0xb385('0x55'),_0xb385('0x58'),_0xb385('0x59'),_0xb385('0x5a'),_0xb385('0x5b'),_0xb385('0x5c'),_0xb385('0x5d'),_0xb385('0x5e')],'raw':!![]});})[_0xb385('0x2f')](handleEntityNotFound(_0xd25d06,null))[_0xb385('0x2f')](function(_0x9c9847){if(_0x9c9847){var _0x2a9c74=_0x9c9847['logo']&&fs[_0xb385('0x5f')](path[_0xb385('0x60')](config[_0xb385('0x61')],_0x566706,_['toLower'](_0x9c9847[_0xb385('0x55')])))?path[_0xb385('0x60')](config[_0xb385('0x61')],_0x566706,_['toLower'](_0x9c9847[_0xb385('0x55')])):path[_0xb385('0x60')](config[_0xb385('0x61')],_0x566706,_[_0xb385('0x62')]('default_logo.svg'));var _0x2acb92=_0xb385('0x63')+_['upperFirst']('logo');if(_0x9c9847[_0x2acb92]||!_0x39021b[_0xb385('0x64')]){_0x2a9c74=path[_0xb385('0x60')](config[_0xb385('0x61')],_0x566706,_[_0xb385('0x62')](_0xb385('0x65')));}if(!fs['existsSync'](_0x2a9c74)){throw new db[(_0xb385('0x66'))][(_0xb385('0x67'))](_[_0xb385('0x68')]('logo')+'\x20not\x20found');}return _0xd25d06[_0xb385('0x69')](_0x2a9c74);}})[_0xb385('0x4e')](handleError(_0xd25d06,null));};var utilLicense=require(_0xb385('0x6a'));exports[_0xb385('0x6b')]=function(_0x1a4335,_0xc3d691,_0x46feb8){var _0xd28e7c=_0xb385('0x6c');var _0x5c8d90={'custom':![]};return utilLicense[_0xb385('0x6d')]()[_0xb385('0x2f')](function(_0x2d76eb){if(_0x2d76eb){_0x5c8d90=_0x2d76eb;}return db[_0xb385('0x49')][_0xb385('0x56')]({'where':{'id':_0x1a4335['params']['id']},'attributes':[_0xb385('0x55'),_0xb385('0x58'),_0xb385('0x59'),_0xb385('0x5a'),_0xb385('0x5b'),_0xb385('0x5c'),_0xb385('0x5d'),_0xb385('0x5e')],'raw':!![]});})[_0xb385('0x2f')](handleEntityNotFound(_0xc3d691,null))[_0xb385('0x2f')](function(_0x9a7492){if(_0x9a7492){var _0x3cb930=_0x9a7492[_0xb385('0x58')]&&fs['existsSync'](path[_0xb385('0x60')](config['root'],_0xd28e7c,_[_0xb385('0x62')](_0x9a7492['loginLogo'])))?path[_0xb385('0x60')](config[_0xb385('0x61')],_0xd28e7c,_['toLower'](_0x9a7492[_0xb385('0x58')])):path[_0xb385('0x60')](config['root'],_0xd28e7c,_[_0xb385('0x62')](_0xb385('0x6e')));var _0x3ae2ed=_0xb385('0x63')+_[_0xb385('0x68')](_0xb385('0x58'));if(_0x9a7492[_0x3ae2ed]||!_0x5c8d90[_0xb385('0x64')]){_0x3cb930=path[_0xb385('0x60')](config[_0xb385('0x61')],_0xd28e7c,_['toLower'](_0xb385('0x6e')));}if(!fs[_0xb385('0x5f')](_0x3cb930)){throw new db[(_0xb385('0x66'))][(_0xb385('0x67'))](_[_0xb385('0x68')](_0xb385('0x58'))+'\x20not\x20found');}return _0xc3d691[_0xb385('0x69')](_0x3cb930);}})[_0xb385('0x4e')](handleError(_0xc3d691,null));};exports['gdpr']=function(_0x4711e8,_0x1434fb){return db[_0xb385('0x49')]['find']({'where':{'id':_0x4711e8[_0xb385('0x50')]['id']},'attributes':['securePassword']})[_0xb385('0x2f')](respondWithResult(_0x1434fb,null))[_0xb385('0x4e')](handleError(_0x1434fb,null));};exports[_0xb385('0x6f')]=function(_0x5b094d,_0x41c233,_0x50a60e){if(_0x5b094d[_0xb385('0x53')]&&_0x5b094d['file']['filename']){_0x5b094d[_0xb385('0x51')]['preferred']=_0x5b094d[_0xb385('0x53')][_0xb385('0x54')];}return db[_0xb385('0x49')][_0xb385('0x56')]({'where':{'id':_0x5b094d[_0xb385('0x50')]['id']}})[_0xb385('0x2f')](handleEntityNotFound(_0x41c233,null))['then'](saveUpdates(_0x5b094d[_0xb385('0x51')],null))[_0xb385('0x2f')](respondWithResult(_0x41c233,null))[_0xb385('0x4e')](handleError(_0x41c233,null));};var utilLicense=require(_0xb385('0x6a'));exports[_0xb385('0x70')]=function(_0x52c1ea,_0x4f63ae,_0x58921c){var _0x5a4bd0=_0xb385('0x6c');var _0x1bd74c={'custom':![]};return utilLicense[_0xb385('0x6d')]()[_0xb385('0x2f')](function(_0x2a7106){if(_0x2a7106){_0x1bd74c=_0x2a7106;}return db[_0xb385('0x49')][_0xb385('0x56')]({'where':{'id':_0x52c1ea[_0xb385('0x50')]['id']},'attributes':['logo',_0xb385('0x58'),_0xb385('0x59'),_0xb385('0x5a'),_0xb385('0x5b'),_0xb385('0x5c'),_0xb385('0x5d'),'defaultFavicon'],'raw':!![]});})[_0xb385('0x2f')](handleEntityNotFound(_0x4f63ae,null))[_0xb385('0x2f')](function(_0x5d6b6d){if(_0x5d6b6d){var _0x355010=_0x5d6b6d['preferred']&&fs['existsSync'](path['join'](config[_0xb385('0x61')],_0x5a4bd0,_['toLower'](_0x5d6b6d['preferred'])))?path['join'](config[_0xb385('0x61')],_0x5a4bd0,_['toLower'](_0x5d6b6d[_0xb385('0x59')])):path[_0xb385('0x60')](config['root'],_0x5a4bd0,_['toLower'](_0xb385('0x71')));var _0x3bb043='default'+_[_0xb385('0x68')](_0xb385('0x59'));if(_0x5d6b6d[_0x3bb043]||!_0x1bd74c[_0xb385('0x64')]||!_0x1bd74c[_0xb385('0x59')]){_0x355010=path[_0xb385('0x60')](config[_0xb385('0x61')],_0x5a4bd0,_[_0xb385('0x62')](_0xb385('0x71')));}if(!fs[_0xb385('0x5f')](_0x355010)){throw new db[(_0xb385('0x66'))][(_0xb385('0x67'))](_[_0xb385('0x68')](_0xb385('0x59'))+'\x20not\x20found');}return _0x4f63ae[_0xb385('0x69')](_0x355010);}})['catch'](handleError(_0x4f63ae,null));};exports[_0xb385('0x72')]=function(_0x4ece6a,_0x2cb105,_0x32d52a){if(_0x4ece6a[_0xb385('0x53')]&&_0x4ece6a[_0xb385('0x53')][_0xb385('0x54')]){_0x4ece6a['body'][_0xb385('0x5a')]=_0x4ece6a[_0xb385('0x53')][_0xb385('0x54')];}return db['Setting'][_0xb385('0x56')]({'where':{'id':_0x4ece6a['params']['id']}})[_0xb385('0x2f')](handleEntityNotFound(_0x2cb105,null))[_0xb385('0x2f')](saveUpdates(_0x4ece6a[_0xb385('0x51')],null))[_0xb385('0x2f')](respondWithResult(_0x2cb105,null))[_0xb385('0x4e')](handleError(_0x2cb105,null));};var utilLicense=require(_0xb385('0x6a'));exports['getFavicon']=function(_0x1eea34,_0x544f99,_0x31edd6){var _0x18e8e6='server/files/images/logos';var _0x8ef234={'custom':![]};return utilLicense[_0xb385('0x6d')]()[_0xb385('0x2f')](function(_0x22fb78){if(_0x22fb78){_0x8ef234=_0x22fb78;}return db[_0xb385('0x49')]['find']({'where':{'id':_0x1eea34['params']['id']},'attributes':[_0xb385('0x55'),'loginLogo','preferred',_0xb385('0x5a'),_0xb385('0x5b'),_0xb385('0x5c'),_0xb385('0x5d'),'defaultFavicon'],'raw':!![]});})[_0xb385('0x2f')](handleEntityNotFound(_0x544f99,null))[_0xb385('0x2f')](function(_0x26af32){if(_0x26af32){var _0x431199=_0x26af32['favicon']&&fs['existsSync'](path[_0xb385('0x60')](config[_0xb385('0x61')],_0x18e8e6,_[_0xb385('0x62')](_0x26af32[_0xb385('0x5a')])))?path[_0xb385('0x60')](config[_0xb385('0x61')],_0x18e8e6,_[_0xb385('0x62')](_0x26af32[_0xb385('0x5a')])):path[_0xb385('0x60')](config[_0xb385('0x61')],_0x18e8e6,_['toLower']('default_favicon.ico'));var _0x4f363f=_0xb385('0x63')+_['upperFirst']('favicon');if(_0x26af32[_0x4f363f]||!_0x8ef234[_0xb385('0x64')]){_0x431199=path[_0xb385('0x60')](config[_0xb385('0x61')],_0x18e8e6,_['toLower'](_0xb385('0x73')));}if(!fs[_0xb385('0x5f')](_0x431199)){throw new db['Sequelize'][(_0xb385('0x67'))](_[_0xb385('0x68')]('favicon')+_0xb385('0x74'));}return _0x544f99[_0xb385('0x69')](_0x431199);}})[_0xb385('0x4e')](handleError(_0x544f99,null));};exports[_0xb385('0x75')]=function(_0x14fa05,_0x43f812){var _0x168383={'offset':moment()[_0xb385('0x76')]()};_0x168383[_0xb385('0x77')]=moment()[_0xb385('0x76')](_0x168383[_0xb385('0x28')])['format'](_0xb385('0x78'));return _0x43f812[_0xb385('0x26')](0xc8)[_0xb385('0x32')](_0x168383);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 9dc6eed..6d78df0 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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x5da041,_0x533866){var _0x20643b=function(_0x545f52){while(--_0x545f52){_0x5da041['push'](_0x5da041['shift']());}};_0x20643b(++_0x533866);}(_0x34e8,0x12c));var _0x834e=function(_0x42f2b1,_0x29a287){_0x42f2b1=_0x42f2b1-0x0;var _0x1a6644=_0x34e8[_0x42f2b1];return _0x1a6644;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index d37f4b3..78be7a8 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 _0x2031=['ShowSetting','Setting','options','raw','where','attributes','map','include','model','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch'];(function(_0x1cbbfe,_0x4a0eef){var _0x55bf8b=function(_0x4feda5){while(--_0x4feda5){_0x1cbbfe['push'](_0x1cbbfe['shift']());}};_0x55bf8b(++_0x4a0eef);}(_0x2031,0xfa));var _0x1203=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2031[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x1203('0x0'));var moment=require('moment');var BPromise=require(_0x1203('0x1'));var rs=require(_0x1203('0x2'));var fs=require('fs');var Redis=require(_0x1203('0x3'));var db=require(_0x1203('0x4'))['db'];var utils=require(_0x1203('0x5'));var logger=require('../../config/logger')(_0x1203('0x6'));var config=require('../../config/environment');var jayson=require(_0x1203('0x7'));var client=jayson[_0x1203('0x8')][_0x1203('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x325b41,_0x527a35,_0x3ab745){return new BPromise(function(_0x38b96d,_0x42c2ac){return client['request'](_0x325b41,_0x3ab745)[_0x1203('0xa')](function(_0x54067e){logger[_0x1203('0xb')](_0x1203('0xc'),_0x527a35,'request\x20sent');logger[_0x1203('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x527a35,_0x1203('0xe'),JSON['stringify'](_0x54067e));if(_0x54067e[_0x1203('0xf')]){if(_0x54067e['error'][_0x1203('0x10')]===0x1f4){logger[_0x1203('0xf')](_0x1203('0xc'),_0x527a35,_0x54067e[_0x1203('0xf')][_0x1203('0x11')]);return _0x42c2ac(_0x54067e[_0x1203('0xf')][_0x1203('0x11')]);}logger[_0x1203('0xf')](_0x1203('0xc'),_0x527a35,_0x54067e[_0x1203('0xf')]['message']);return _0x38b96d(_0x54067e[_0x1203('0xf')]['message']);}else{logger[_0x1203('0xb')](_0x1203('0xc'),_0x527a35,_0x1203('0xe'));_0x38b96d(_0x54067e[_0x1203('0x12')]['message']);}})[_0x1203('0x13')](function(_0x29ace1){logger[_0x1203('0xf')](_0x1203('0xc'),_0x527a35,_0x29ace1);_0x42c2ac(_0x29ace1);});});}exports[_0x1203('0x14')]=function(_0x2c8138){var _0x5051e3=this;return new Promise(function(_0x5c0614,_0x1bc769){return db[_0x1203('0x15')]['find']({'raw':_0x2c8138['options']?_0x2c8138[_0x1203('0x16')][_0x1203('0x17')]===undefined?!![]:![]:!![],'where':_0x2c8138[_0x1203('0x16')]?_0x2c8138['options'][_0x1203('0x18')]||null:null,'attributes':_0x2c8138[_0x1203('0x16')]?_0x2c8138[_0x1203('0x16')][_0x1203('0x19')]||null:null,'include':_0x2c8138[_0x1203('0x16')]?_0x2c8138[_0x1203('0x16')]['include']?_[_0x1203('0x1a')](_0x2c8138['options'][_0x1203('0x1b')],function(_0x31a11c){return{'model':db[_0x31a11c[_0x1203('0x1c')]],'as':_0x31a11c['as'],'attributes':_0x31a11c['attributes'],'include':_0x31a11c['include']?_['map'](_0x31a11c[_0x1203('0x1b')],function(_0x45b724){return{'model':db[_0x45b724[_0x1203('0x1c')]],'as':_0x45b724['as'],'attributes':_0x45b724[_0x1203('0x19')],'include':_0x45b724[_0x1203('0x1b')]?_[_0x1203('0x1a')](_0x45b724[_0x1203('0x1b')],function(_0x24dac3){return{'model':db[_0x24dac3[_0x1203('0x1c')]],'as':_0x24dac3['as'],'attributes':_0x24dac3['attributes']};}):[]};}):[]};}):[]:[]})[_0x1203('0xa')](function(_0x36c222){logger[_0x1203('0xb')](_0x1203('0x14'),_0x2c8138);logger[_0x1203('0xd')](_0x1203('0x14'),_0x2c8138,JSON[_0x1203('0x1d')](_0x36c222));_0x5c0614(_0x36c222);})[_0x1203('0x13')](function(_0x13db03){logger['error'](_0x1203('0x14'),_0x13db03[_0x1203('0x11')],_0x2c8138);_0x1bc769(_0x5051e3['error'](0x1f4,_0x13db03[_0x1203('0x11')]));});});}; \ No newline at end of file +var _0x4694=['model','map','ShowSetting','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Setting','find','options','raw','attributes','include'];(function(_0x4829ae,_0x7fe03){var _0x1485da=function(_0x1725c6){while(--_0x1725c6){_0x4829ae['push'](_0x4829ae['shift']());}};_0x1485da(++_0x7fe03);}(_0x4694,0x1c5));var _0x4469=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x4694[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x4469('0x0'));var util=require(_0x4469('0x1'));var moment=require('moment');var BPromise=require(_0x4469('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4469('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4469('0x4'));var logger=require(_0x4469('0x5'))('rpc');var config=require(_0x4469('0x6'));var jayson=require(_0x4469('0x7'));var client=jayson[_0x4469('0x8')][_0x4469('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x258a92,_0x135d81,_0x56bde2){return new BPromise(function(_0xbfaa96,_0x2faf16){return client['request'](_0x258a92,_0x56bde2)[_0x4469('0xa')](function(_0x3c4b62){logger[_0x4469('0xb')](_0x4469('0xc'),_0x135d81,_0x4469('0xd'));logger[_0x4469('0xe')](_0x4469('0xf'),_0x135d81,_0x4469('0xd'),JSON[_0x4469('0x10')](_0x3c4b62));if(_0x3c4b62[_0x4469('0x11')]){if(_0x3c4b62[_0x4469('0x11')]['code']===0x1f4){logger[_0x4469('0x11')](_0x4469('0xc'),_0x135d81,_0x3c4b62[_0x4469('0x11')]['message']);return _0x2faf16(_0x3c4b62[_0x4469('0x11')][_0x4469('0x12')]);}logger[_0x4469('0x11')](_0x4469('0xc'),_0x135d81,_0x3c4b62[_0x4469('0x11')][_0x4469('0x12')]);return _0xbfaa96(_0x3c4b62['error'][_0x4469('0x12')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x135d81,_0x4469('0xd'));_0xbfaa96(_0x3c4b62[_0x4469('0x13')][_0x4469('0x12')]);}})[_0x4469('0x14')](function(_0x2a93af){logger[_0x4469('0x11')]('Setting,\x20%s,\x20%s',_0x135d81,_0x2a93af);_0x2faf16(_0x2a93af);});});}exports['ShowSetting']=function(_0x193fda){var _0xf6e939=this;return new Promise(function(_0x3ca374,_0x4dec07){return db[_0x4469('0x15')][_0x4469('0x16')]({'raw':_0x193fda[_0x4469('0x17')]?_0x193fda[_0x4469('0x17')][_0x4469('0x18')]===undefined?!![]:![]:!![],'where':_0x193fda[_0x4469('0x17')]?_0x193fda[_0x4469('0x17')]['where']||null:null,'attributes':_0x193fda[_0x4469('0x17')]?_0x193fda['options'][_0x4469('0x19')]||null:null,'include':_0x193fda[_0x4469('0x17')]?_0x193fda['options'][_0x4469('0x1a')]?_['map'](_0x193fda[_0x4469('0x17')]['include'],function(_0x3f52ab){return{'model':db[_0x3f52ab[_0x4469('0x1b')]],'as':_0x3f52ab['as'],'attributes':_0x3f52ab['attributes'],'include':_0x3f52ab[_0x4469('0x1a')]?_[_0x4469('0x1c')](_0x3f52ab[_0x4469('0x1a')],function(_0x5231fa){return{'model':db[_0x5231fa[_0x4469('0x1b')]],'as':_0x5231fa['as'],'attributes':_0x5231fa[_0x4469('0x19')],'include':_0x5231fa[_0x4469('0x1a')]?_[_0x4469('0x1c')](_0x5231fa[_0x4469('0x1a')],function(_0x6d7b14){return{'model':db[_0x6d7b14['model']],'as':_0x6d7b14['as'],'attributes':_0x6d7b14['attributes']};}):[]};}):[]};}):[]:[]})[_0x4469('0xa')](function(_0x58444f){logger['info']('ShowSetting',_0x193fda);logger[_0x4469('0xe')](_0x4469('0x1d'),_0x193fda,JSON[_0x4469('0x10')](_0x58444f));_0x3ca374(_0x58444f);})['catch'](function(_0x68c664){logger[_0x4469('0x11')](_0x4469('0x1d'),_0x68c664[_0x4469('0x12')],_0x193fda);_0x4dec07(_0xf6e939['error'](0x1f4,_0x68c664[_0x4469('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 63af134..788e9e2 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 _0x326f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/status','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0x345ac8,_0x2daa49){var _0x552f86=function(_0x2210b8){while(--_0x2210b8){_0x345ac8['push'](_0x345ac8['shift']());}};_0x552f86(++_0x2daa49);}(_0x326f,0xd1));var _0xf326=function(_0xbb39ec,_0x4ad256){_0xbb39ec=_0xbb39ec-0x0;var _0x2722a7=_0x326f[_0xbb39ec];return _0x2722a7;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['get'](_0xf326('0x12'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x9')]('/:id/interactions',auth[_0xf326('0xa')](),controller[_0xf326('0x14')]);router[_0xf326('0x9')](_0xf326('0x15'),controller['statusGet']);router[_0xf326('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x16')]);router[_0xf326('0x17')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0x18')]);router[_0xf326('0x17')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0x19')]);router['post'](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x1a')]);router[_0xf326('0x17')](_0xf326('0x1b'),controller[_0xf326('0x1c')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xf326('0x1d')]);router[_0xf326('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xf326('0x1e')]);router['post']('/:id/status',controller[_0xf326('0x1f')]);router[_0xf326('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x20')]);router[_0xf326('0x21')]('/:id',auth[_0xf326('0xa')](),controller[_0xf326('0x22')]);router[_0xf326('0x23')](_0xf326('0x24'),auth[_0xf326('0xa')](),controller[_0xf326('0x25')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf326('0x26')]);router[_0xf326('0x23')](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x27')]);router[_0xf326('0x23')]('/:id/users',auth[_0xf326('0xa')](),controller[_0xf326('0x28')]);module[_0xf326('0x29')]=router; \ No newline at end of file +var _0x55ca=['describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0x55ca,0x126));var _0xa55c=function(_0x16d24f,_0x4686a5){_0x16d24f=_0x16d24f-0x0;var _0x3beec6=_0x55ca[_0x16d24f];return _0x3beec6;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getApplications']);router['get'](_0xa55c('0x11'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0xa55c('0x12'),controller[_0xa55c('0x13')]);router[_0xa55c('0x7')](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x17')](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);router[_0xa55c('0x17')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller['addAnswer']);router[_0xa55c('0x17')](_0xa55c('0x19'),controller[_0xa55c('0x1a')]);router[_0xa55c('0x17')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['addApplications']);router['post'](_0xa55c('0x1b'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x1c')]);router['post'](_0xa55c('0x12'),controller[_0xa55c('0x1d')]);router['post'](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x1e')]);router[_0xa55c('0x1f')](_0xa55c('0xb'),auth['isAuthenticated'](),controller[_0xa55c('0x20')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x21')]);router['delete'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x22')]);router[_0xa55c('0x23')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x24')]);router[_0xa55c('0x23')](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index b85e3bb..be16ada 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 _0x4236=['twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','name','generate','ENUM'];(function(_0x471d07,_0x30eaad){var _0x204c40=function(_0x20d7ed){while(--_0x20d7ed){_0x471d07['push'](_0x471d07['shift']());}};_0x204c40(++_0x30eaad);}(_0x4236,0x6e));var _0x6423=function(_0x2ac4e1,_0x1c3e95){_0x2ac4e1=_0x2ac4e1-0x0;var _0x1891a7=_0x4236[_0x2ac4e1];return _0x1891a7;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x6423('0x0'));module['exports']={'name':{'type':Sequelize[_0x6423('0x1')],'unique':_0x6423('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x6423('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x6423('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x6423('0x1')],'defaultValue':function(){return rs[_0x6423('0x3')]();}},'phone':{'type':Sequelize[_0x6423('0x1')]},'type':{'type':Sequelize[_0x6423('0x4')](_0x6423('0x5'),_0x6423('0x6'),_0x6423('0x7'),_0x6423('0x8'),_0x6423('0x9'),_0x6423('0xa'),_0x6423('0xb'),'csc',_0x6423('0xc'),_0x6423('0xd'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x6423('0x1')]},'authToken':{'type':Sequelize[_0x6423('0x1')]},'smsMethod':{'type':Sequelize[_0x6423('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x6423('0x1')]},'password':{'type':Sequelize[_0x6423('0x1')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x6423('0x1')]},'senderString':{'type':Sequelize[_0x6423('0x1')]},'deliveryReport':{'type':Sequelize[_0x6423('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x6423('0x1')]},'notificationTemplate':{'type':Sequelize[_0x6423('0xf')],'defaultValue':function(){return _0x6423('0x10');}},'notificationSound':{'type':Sequelize[_0x6423('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6423('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6423('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6423('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6423('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x6423('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6423('0x11')],'comment':_0x6423('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x6423('0xe')],'defaultValue':![],'comment':_0x6423('0x13'),'set':function(_0x3e1e78){if(!_0x3e1e78)this[_0x6423('0x14')](_0x6423('0x15'),null);this['setDataValue'](_0x6423('0x16'),_0x3e1e78);}}}; \ No newline at end of file +var _0x9b7b=['exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','infobip','intelepeer','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','sequelize','randomstring'];(function(_0x2a5264,_0x4b5d74){var _0x11e76f=function(_0x42634c){while(--_0x42634c){_0x2a5264['push'](_0x2a5264['shift']());}};_0x11e76f(++_0x4b5d74);}(_0x9b7b,0x1cc));var _0xb9b7=function(_0x53eccb,_0x23f286){_0x53eccb=_0x53eccb-0x0;var _0x3e8be7=_0x9b7b[_0x53eccb];return _0x3e8be7;};'use strict';var Sequelize=require(_0xb9b7('0x0'));var rs=require(_0xb9b7('0x1'));module[_0xb9b7('0x2')]={'name':{'type':Sequelize[_0xb9b7('0x3')],'unique':_0xb9b7('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xb9b7('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xb9b7('0x3')],'defaultValue':function(){return rs[_0xb9b7('0x5')]();}},'phone':{'type':Sequelize[_0xb9b7('0x3')]},'type':{'type':Sequelize[_0xb9b7('0x6')](_0xb9b7('0x7'),_0xb9b7('0x8'),_0xb9b7('0x9'),_0xb9b7('0xa'),_0xb9b7('0xb'),'clickatell','bandwidth','csc',_0xb9b7('0xc'),_0xb9b7('0xd'))},'accountSid':{'type':Sequelize[_0xb9b7('0x3')]},'authId':{'type':Sequelize[_0xb9b7('0x3')]},'authToken':{'type':Sequelize[_0xb9b7('0x3')]},'smsMethod':{'type':Sequelize[_0xb9b7('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb9b7('0x3')]},'apiKey':{'type':Sequelize[_0xb9b7('0x3')]},'applicationId':{'type':Sequelize[_0xb9b7('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xb9b7('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xb9b7('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb9b7('0xe');}},'notificationSound':{'type':Sequelize[_0xb9b7('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb9b7('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb9b7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb9b7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb9b7('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb9b7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb9b7('0x10')],'comment':_0xb9b7('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xb9b7('0xf')],'defaultValue':![],'comment':_0xb9b7('0x12'),'set':function(_0x498c9f){if(!_0x498c9f)this[_0xb9b7('0x13')](_0xb9b7('0x14'),null);this[_0xb9b7('0x13')]('mandatoryDisposition',_0x498c9f);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 2c8c834..0bbab40 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 _0xcd04=['removeAgents','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','update','then','destroy','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','rows','show','params','Pause','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','userProfileId','autoAssociation','describe','addDisposition','getDispositions','findOne','Disposition','SmsAccountId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','SmsApplication','account','orderBy','Applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','MessageSid','skebby','sender','clicksend','from','messageId','message_id','plivo','Text','infobip','results','text','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','sequelize','transaction','READ_COMMITTED','bulkCreate','sendStatus','getApplications','Contact','User','internal','Tag','Tags','color','tag','List','out','Messages','dataValues','inspect','skebby_dispatch_id','connectel','statusInt','status_code','DELIVERED','redif','error_code','groupName','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','csc','state','addAgents','emit'];(function(_0x2f7078,_0x9ef005){var _0x4e5655=function(_0x4b5739){while(--_0x4b5739){_0x2f7078['push'](_0x2f7078['shift']());}};_0x4e5655(++_0x9ef005);}(_0xcd04,0xe6));var _0x4cd0=function(_0x10c57c,_0x57827d){_0x10c57c=_0x10c57c-0x0;var _0x565f5f=_0xcd04[_0x10c57c];return _0x565f5f;};'use strict';var emlformat=require(_0x4cd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4cd0('0x1'));var jsonpatch=require(_0x4cd0('0x2'));var rp=require(_0x4cd0('0x3'));var moment=require(_0x4cd0('0x4'));var BPromise=require(_0x4cd0('0x5'));var Mustache=require(_0x4cd0('0x6'));var util=require('util');var path=require(_0x4cd0('0x7'));var sox=require(_0x4cd0('0x8'));var csv=require(_0x4cd0('0x9'));var ejs=require(_0x4cd0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4cd0('0xb'));var squel=require(_0x4cd0('0xc'));var crypto=require('crypto');var jsforce=require(_0x4cd0('0xd'));var deskjs=require(_0x4cd0('0xe'));var toCsv=require(_0x4cd0('0x9'));var querystring=require(_0x4cd0('0xf'));var Papa=require(_0x4cd0('0x10'));var Redis=require(_0x4cd0('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4cd0('0x12'));var hardwareService=require(_0x4cd0('0x13'));var logger=require(_0x4cd0('0x14'))(_0x4cd0('0x15'));var utils=require(_0x4cd0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4cd0('0x17'));var db=require(_0x4cd0('0x18'))['db'];config[_0x4cd0('0x19')]=_[_0x4cd0('0x1a')](config[_0x4cd0('0x19')],{'host':_0x4cd0('0x1b'),'port':0x18eb});var socket=require(_0x4cd0('0x1c'))(new Redis(config[_0x4cd0('0x19')]));require(_0x4cd0('0x1d'))[_0x4cd0('0x1e')](socket);var jayson=require(_0x4cd0('0x1f'));var client=jayson[_0x4cd0('0x20')][_0x4cd0('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x226ff8,_0x4db88e,_0x2ff8b8,_0x358618){return new BPromise(function(_0x29d7a6,_0x389bab){var _0x391486=_0x358618||client;return _0x391486[_0x4cd0('0x22')](_0x226ff8,_0x2ff8b8)['then'](function(_0x1068f8){logger['info'](_0x4cd0('0x23'),_0x4db88e,_0x4cd0('0x24'));logger[_0x4cd0('0x25')](_0x4cd0('0x26'),_0x4db88e,_0x4cd0('0x24'),JSON[_0x4cd0('0x27')](_0x1068f8));if(_0x1068f8[_0x4cd0('0x28')]){if(_0x1068f8[_0x4cd0('0x28')]['code']===0x1f4){logger[_0x4cd0('0x28')](_0x4cd0('0x23'),_0x4db88e,_0x1068f8[_0x4cd0('0x28')]['message']);return _0x389bab(_0x1068f8[_0x4cd0('0x28')][_0x4cd0('0x29')]);}logger[_0x4cd0('0x28')](_0x4cd0('0x23'),_0x4db88e,_0x1068f8[_0x4cd0('0x28')][_0x4cd0('0x29')]);return _0x29d7a6(_0x1068f8['error']['message']);}else{logger[_0x4cd0('0x2a')](_0x4cd0('0x23'),_0x4db88e,_0x4cd0('0x24'));_0x29d7a6(_0x1068f8[_0x4cd0('0x2b')][_0x4cd0('0x29')]);}})[_0x4cd0('0x2c')](function(_0x44c851){logger[_0x4cd0('0x28')](_0x4cd0('0x23'),_0x4db88e,_0x44c851);_0x389bab(_0x44c851);});});}function respondWithStatusCode(_0x1edbe4,_0x41b8d3){_0x41b8d3=_0x41b8d3||0xcc;return function(_0x2a26a9){if(_0x2a26a9){return _0x1edbe4['sendStatus'](_0x41b8d3);}return _0x1edbe4[_0x4cd0('0x2d')](_0x41b8d3)[_0x4cd0('0x2e')]();};}function respondWithResult(_0x10f66a,_0x47cd0d){_0x47cd0d=_0x47cd0d||0xc8;return function(_0x2d4c66){if(_0x2d4c66){return _0x10f66a[_0x4cd0('0x2d')](_0x47cd0d)['json'](_0x2d4c66);}};}function respondWithFilteredResult(_0x49d831,_0x2c7998){return function(_0x1ab6fa){if(_0x1ab6fa){var _0x1b4f7f=typeof _0x2c7998[_0x4cd0('0x2f')]===_0x4cd0('0x30')&&typeof _0x2c7998['limit']===_0x4cd0('0x30');var _0x277a60=_0x1ab6fa[_0x4cd0('0x31')];var _0x2064bb=_0x1b4f7f?0x0:_0x2c7998[_0x4cd0('0x2f')];var _0x2cc151=_0x1b4f7f?_0x1ab6fa[_0x4cd0('0x31')]:_0x2c7998[_0x4cd0('0x2f')]+_0x2c7998[_0x4cd0('0x32')];var _0x56a609;if(_0x2cc151>=_0x277a60){_0x2cc151=_0x277a60;_0x56a609=0xc8;}else{_0x56a609=0xce;}_0x49d831[_0x4cd0('0x2d')](_0x56a609);return _0x49d831[_0x4cd0('0x33')](_0x4cd0('0x34'),_0x2064bb+'-'+_0x2cc151+'/'+_0x277a60)[_0x4cd0('0x35')](_0x1ab6fa);}return null;};}function patchUpdates(_0x488af3){return function(_0x176a0d){try{jsonpatch['apply'](_0x176a0d,_0x488af3,!![]);}catch(_0x287f68){return BPromise[_0x4cd0('0x36')](_0x287f68);}return _0x176a0d['save']();};}function saveUpdates(_0x1bf9fb,_0x1fee25){return function(_0x3557b7){if(_0x3557b7){return _0x3557b7[_0x4cd0('0x37')](_0x1bf9fb)[_0x4cd0('0x38')](function(_0x29fe6d){return _0x29fe6d;});}return null;};}function removeEntity(_0x2c965e,_0xad3a76){return function(_0x43db94){if(_0x43db94){return _0x43db94[_0x4cd0('0x39')]()[_0x4cd0('0x38')](function(){var _0x560011=_0x43db94['get']({'plain':!![]});var _0x178942='SmsAccounts';return db[_0x4cd0('0x3a')]['destroy']({'where':{'type':_0x178942,'resourceId':_0x560011['id']}})[_0x4cd0('0x38')](function(){return _0x43db94;});})[_0x4cd0('0x38')](function(){_0x2c965e[_0x4cd0('0x2d')](0xcc)[_0x4cd0('0x2e')]();});}};}function handleEntityNotFound(_0x59e28b,_0x287ca4){return function(_0xb962d9){if(!_0xb962d9){_0x59e28b['sendStatus'](0x194);}return _0xb962d9;};}function handleError(_0x38ec65,_0x30a510){_0x30a510=_0x30a510||0x1f4;return function(_0x117fff){logger[_0x4cd0('0x28')](_0x117fff[_0x4cd0('0x3b')]);if(_0x117fff[_0x4cd0('0x3c')]){delete _0x117fff['name'];}_0x38ec65[_0x4cd0('0x2d')](_0x30a510)[_0x4cd0('0x3d')](_0x117fff);};}exports[_0x4cd0('0x3e')]=function(_0x570ba3,_0xff2d08){var _0x26a1b0={'include':[{'model':db['Pause'],'as':_0x4cd0('0x3f')}]},_0x3f6081={},_0x229c1e={'count':0x0,'rows':[]};var _0x1eaafe=_['map'](db[_0x4cd0('0x40')][_0x4cd0('0x41')],function(_0x4e0f6c){return{'name':_0x4e0f6c[_0x4cd0('0x42')],'type':_0x4e0f6c[_0x4cd0('0x43')][_0x4cd0('0x44')]};});_0x3f6081[_0x4cd0('0x45')]=_['map'](_0x1eaafe,_0x4cd0('0x3c'));_0x3f6081['query']=_[_0x4cd0('0x46')](_0x570ba3['query']);_0x3f6081[_0x4cd0('0x47')]=_['intersection'](_0x3f6081['model'],_0x3f6081[_0x4cd0('0x48')]);_0x26a1b0[_0x4cd0('0x49')]=_[_0x4cd0('0x4a')](_0x3f6081[_0x4cd0('0x45')],qs[_0x4cd0('0x4b')](_0x570ba3['query'][_0x4cd0('0x4b')]));_0x26a1b0[_0x4cd0('0x49')]=_0x26a1b0[_0x4cd0('0x49')][_0x4cd0('0x4c')]?_0x26a1b0[_0x4cd0('0x49')]:_0x3f6081[_0x4cd0('0x45')];if(!_0x570ba3[_0x4cd0('0x48')][_0x4cd0('0x4d')](_0x4cd0('0x4e'))){_0x26a1b0[_0x4cd0('0x32')]=qs['limit'](_0x570ba3['query'][_0x4cd0('0x32')]);_0x26a1b0['offset']=qs[_0x4cd0('0x2f')](_0x570ba3[_0x4cd0('0x48')][_0x4cd0('0x2f')]);}_0x26a1b0[_0x4cd0('0x4f')]=qs[_0x4cd0('0x50')](_0x570ba3[_0x4cd0('0x48')][_0x4cd0('0x50')]);_0x26a1b0[_0x4cd0('0x51')]=qs['filters'](_[_0x4cd0('0x52')](_0x570ba3[_0x4cd0('0x48')],_0x3f6081[_0x4cd0('0x47')]),_0x1eaafe);if(_0x570ba3['query'][_0x4cd0('0x53')]){_0x26a1b0['where']=_['merge'](_0x26a1b0[_0x4cd0('0x51')],{'$or':_[_0x4cd0('0x54')](_0x1eaafe,function(_0x3fad41){if(_0x3fad41[_0x4cd0('0x43')]!==_0x4cd0('0x55')){var _0xc75a56={};_0xc75a56[_0x3fad41[_0x4cd0('0x3c')]]={'$like':'%'+_0x570ba3['query']['filter']+'%'};return _0xc75a56;}})});}_0x26a1b0=_[_0x4cd0('0x56')]({},_0x26a1b0,_0x570ba3[_0x4cd0('0x57')]);var _0x35ca01={'where':_0x26a1b0[_0x4cd0('0x51')]};return db[_0x4cd0('0x40')][_0x4cd0('0x31')](_0x35ca01)['then'](function(_0x558397){_0x229c1e[_0x4cd0('0x31')]=_0x558397;if(_0x570ba3[_0x4cd0('0x48')][_0x4cd0('0x58')]){_0x26a1b0['include']=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x26a1b0);})[_0x4cd0('0x38')](function(_0x3b63d2){_0x229c1e[_0x4cd0('0x59')]=_0x3b63d2;return _0x229c1e;})[_0x4cd0('0x38')](respondWithFilteredResult(_0xff2d08,_0x26a1b0))[_0x4cd0('0x2c')](handleError(_0xff2d08,null));};exports[_0x4cd0('0x5a')]=function(_0x5ed00f,_0x3c7d82){var _0x50a30a={'raw':![],'where':{'id':_0x5ed00f[_0x4cd0('0x5b')]['id']},'include':[{'model':db[_0x4cd0('0x5c')],'as':_0x4cd0('0x3f')}]},_0x393c55={};_0x393c55['model']=_[_0x4cd0('0x46')](db[_0x4cd0('0x40')][_0x4cd0('0x41')]);_0x393c55['query']=_[_0x4cd0('0x46')](_0x5ed00f[_0x4cd0('0x48')]);_0x393c55['filters']=_[_0x4cd0('0x4a')](_0x393c55[_0x4cd0('0x45')],_0x393c55[_0x4cd0('0x48')]);_0x50a30a['attributes']=_[_0x4cd0('0x4a')](_0x393c55[_0x4cd0('0x45')],qs[_0x4cd0('0x4b')](_0x5ed00f['query']['fields']));_0x50a30a[_0x4cd0('0x49')]=_0x50a30a[_0x4cd0('0x49')]['length']?_0x50a30a['attributes']:_0x393c55[_0x4cd0('0x45')];if(_0x5ed00f[_0x4cd0('0x48')][_0x4cd0('0x58')]){_0x50a30a[_0x4cd0('0x5d')]=[{'all':!![]}];}_0x50a30a=_[_0x4cd0('0x56')]({},_0x50a30a,_0x5ed00f[_0x4cd0('0x57')]);return db[_0x4cd0('0x40')][_0x4cd0('0x5e')](_0x50a30a)['then'](handleEntityNotFound(_0x3c7d82,null))[_0x4cd0('0x38')](respondWithResult(_0x3c7d82,null))[_0x4cd0('0x2c')](handleError(_0x3c7d82,null));};exports[_0x4cd0('0x5f')]=function(_0x42801d,_0x44370b){return db['SmsAccount'][_0x4cd0('0x5f')](_0x42801d[_0x4cd0('0x60')],{})[_0x4cd0('0x38')](function(_0x571638){var _0x3a9336=_0x42801d[_0x4cd0('0x61')][_0x4cd0('0x62')]({'plain':!![]});if(!_0x3a9336)throw new Error(_0x4cd0('0x63'));if(_0x3a9336[_0x4cd0('0x64')]===_0x4cd0('0x61')){var _0x56588f=_0x571638[_0x4cd0('0x62')]({'plain':!![]});var _0x2708e3=_0x4cd0('0x65');return db['UserProfileSection']['find']({'where':{'name':_0x2708e3,'userProfileId':_0x3a9336[_0x4cd0('0x66')]},'raw':!![]})[_0x4cd0('0x38')](function(_0x492cfb){if(_0x492cfb&&_0x492cfb[_0x4cd0('0x67')]===0x0){return db[_0x4cd0('0x3a')]['create']({'name':_0x56588f[_0x4cd0('0x3c')],'resourceId':_0x56588f['id'],'type':_0x492cfb[_0x4cd0('0x3c')],'sectionId':_0x492cfb['id']},{})[_0x4cd0('0x38')](function(){return _0x571638;});}else{return _0x571638;}})['catch'](function(_0x4b56bc){logger[_0x4cd0('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b56bc);throw _0x4b56bc;});}return _0x571638;})[_0x4cd0('0x38')](respondWithResult(_0x44370b,0xc9))[_0x4cd0('0x2c')](handleError(_0x44370b,null));};exports[_0x4cd0('0x37')]=function(_0x2ee458,_0x4a20c6){if(_0x2ee458[_0x4cd0('0x60')]['id']){delete _0x2ee458[_0x4cd0('0x60')]['id'];}return db[_0x4cd0('0x40')]['find']({'where':{'id':_0x2ee458[_0x4cd0('0x5b')]['id']},'include':[{'model':db[_0x4cd0('0x5c')],'as':_0x4cd0('0x3f')}]})[_0x4cd0('0x38')](handleEntityNotFound(_0x4a20c6,null))[_0x4cd0('0x38')](saveUpdates(_0x2ee458[_0x4cd0('0x60')],null))[_0x4cd0('0x38')](respondWithResult(_0x4a20c6,null))['catch'](handleError(_0x4a20c6,null));};exports[_0x4cd0('0x39')]=function(_0x3ccab7,_0xfbad8){return db['SmsAccount'][_0x4cd0('0x5e')]({'where':{'id':_0x3ccab7['params']['id']}})[_0x4cd0('0x38')](handleEntityNotFound(_0xfbad8,null))[_0x4cd0('0x38')](removeEntity(_0xfbad8,null))[_0x4cd0('0x2c')](handleError(_0xfbad8,null));};exports[_0x4cd0('0x68')]=function(_0x2f4de3,_0x50ee45){return db[_0x4cd0('0x40')][_0x4cd0('0x68')]()[_0x4cd0('0x38')](respondWithResult(_0x50ee45,null))[_0x4cd0('0x2c')](handleError(_0x50ee45,null));};exports[_0x4cd0('0x69')]=function(_0x2a3ba9,_0x146947,_0x43f7c3){if(_0x2a3ba9[_0x4cd0('0x60')]['id']){delete _0x2a3ba9[_0x4cd0('0x60')]['id'];}return db[_0x4cd0('0x40')][_0x4cd0('0x5e')]({'where':{'id':_0x2a3ba9[_0x4cd0('0x5b')]['id']}})[_0x4cd0('0x38')](handleEntityNotFound(_0x146947,null))['then'](function(_0x521a07){if(_0x521a07){_0x2a3ba9[_0x4cd0('0x60')]['SmsAccountId']=_0x521a07['id'];return db['Disposition']['create'](_0x2a3ba9[_0x4cd0('0x60')]);}})[_0x4cd0('0x38')](respondWithResult(_0x146947,null))[_0x4cd0('0x2c')](handleError(_0x146947,null));};exports[_0x4cd0('0x6a')]=function(_0x10fc59,_0x290485,_0x43f451){var _0x5e1abf={'raw':![],'where':{}};var _0x2a4478={};var _0x1d13db={'count':0x0,'rows':[]};return db[_0x4cd0('0x40')][_0x4cd0('0x6b')]({'where':{'id':_0x10fc59[_0x4cd0('0x5b')]['id']}})[_0x4cd0('0x38')](handleEntityNotFound(_0x290485,null))[_0x4cd0('0x38')](function(_0x1c9dd4){if(_0x1c9dd4){_0x2a4478[_0x4cd0('0x45')]=_['keys'](db[_0x4cd0('0x6c')][_0x4cd0('0x41')]);_0x2a4478[_0x4cd0('0x48')]=_[_0x4cd0('0x46')](_0x10fc59['query']);_0x2a4478['filters']=_[_0x4cd0('0x4a')](_0x2a4478['model'],_0x2a4478['query']);_0x5e1abf[_0x4cd0('0x49')]=_[_0x4cd0('0x4a')](_0x2a4478['model'],qs[_0x4cd0('0x4b')](_0x10fc59['query'][_0x4cd0('0x4b')]));_0x5e1abf[_0x4cd0('0x49')]=_0x5e1abf[_0x4cd0('0x49')][_0x4cd0('0x4c')]?_0x5e1abf[_0x4cd0('0x49')]:_0x2a4478[_0x4cd0('0x45')];if(!_0x10fc59['query']['hasOwnProperty']('nolimit')){_0x5e1abf[_0x4cd0('0x32')]=qs[_0x4cd0('0x32')](_0x10fc59[_0x4cd0('0x48')][_0x4cd0('0x32')]);_0x5e1abf['offset']=qs['offset'](_0x10fc59[_0x4cd0('0x48')][_0x4cd0('0x2f')]);}_0x5e1abf[_0x4cd0('0x4f')]=qs[_0x4cd0('0x50')](_0x10fc59[_0x4cd0('0x48')][_0x4cd0('0x50')]);_0x5e1abf[_0x4cd0('0x51')]=qs['filters'](_[_0x4cd0('0x52')](_0x10fc59['query'],_0x2a4478[_0x4cd0('0x47')]));_0x5e1abf[_0x4cd0('0x51')][_0x4cd0('0x6d')]=_0x1c9dd4['id'];if(_0x10fc59['query'][_0x4cd0('0x53')]){_0x5e1abf[_0x4cd0('0x51')]=_[_0x4cd0('0x56')](_0x5e1abf[_0x4cd0('0x51')],{'$or':_[_0x4cd0('0x54')](_0x5e1abf[_0x4cd0('0x49')],function(_0x30971c){var _0x286123={};_0x286123[_0x30971c]={'$like':'%'+_0x10fc59[_0x4cd0('0x48')][_0x4cd0('0x53')]+'%'};return _0x286123;})});}_0x5e1abf=_[_0x4cd0('0x56')]({},_0x5e1abf,_0x10fc59[_0x4cd0('0x57')]);return db['Disposition'][_0x4cd0('0x31')]({'where':_0x5e1abf['where']})[_0x4cd0('0x38')](function(_0x1b744b){_0x1d13db[_0x4cd0('0x31')]=_0x1b744b;if(_0x10fc59[_0x4cd0('0x48')]['includeAll']){_0x5e1abf['include']=[{'all':!![]}];}return db['Disposition'][_0x4cd0('0x6e')](_0x5e1abf);})[_0x4cd0('0x38')](function(_0xc9697d){_0x1d13db[_0x4cd0('0x59')]=_0xc9697d;return _0x1d13db;});}})[_0x4cd0('0x38')](respondWithFilteredResult(_0x290485,_0x5e1abf))[_0x4cd0('0x2c')](handleError(_0x290485,null));};exports['removeDispositions']=function(_0x6721a,_0xd20a89,_0x1ddb3e){return db[_0x4cd0('0x40')]['find']({'where':{'id':_0x6721a['params']['id']}})['then'](handleEntityNotFound(_0xd20a89,null))['then'](function(_0x144d73){if(_0x144d73){return _0x144d73[_0x4cd0('0x6f')](_0x6721a['query'][_0x4cd0('0x70')]);}})[_0x4cd0('0x38')](respondWithStatusCode(_0xd20a89,null))[_0x4cd0('0x2c')](handleError(_0xd20a89,null));};exports[_0x4cd0('0x71')]=function(_0x34c7f7,_0x4d3345,_0xd74deb){if(_0x34c7f7['body']['id']){delete _0x34c7f7[_0x4cd0('0x60')]['id'];}return db[_0x4cd0('0x40')]['find']({'where':{'id':_0x34c7f7[_0x4cd0('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4d3345,null))['then'](function(_0x20126c){if(_0x20126c){_0x34c7f7[_0x4cd0('0x60')]['SmsAccountId']=_0x20126c['id'];return db[_0x4cd0('0x72')][_0x4cd0('0x5f')](_0x34c7f7[_0x4cd0('0x60')]);}})['then'](respondWithResult(_0x4d3345,null))[_0x4cd0('0x2c')](handleError(_0x4d3345,null));};exports[_0x4cd0('0x73')]=function(_0x37323d,_0x3a4d33,_0xb32f0f){var _0x1ff7c6={'raw':![],'where':{}};var _0x42770f={};var _0x1ed195={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x37323d['params']['id']}})[_0x4cd0('0x38')](handleEntityNotFound(_0x3a4d33,null))[_0x4cd0('0x38')](function(_0x439078){if(_0x439078){_0x42770f['model']=_[_0x4cd0('0x46')](db[_0x4cd0('0x72')][_0x4cd0('0x41')]);_0x42770f[_0x4cd0('0x48')]=_['keys'](_0x37323d[_0x4cd0('0x48')]);_0x42770f[_0x4cd0('0x47')]=_[_0x4cd0('0x4a')](_0x42770f[_0x4cd0('0x45')],_0x42770f['query']);_0x1ff7c6['attributes']=_[_0x4cd0('0x4a')](_0x42770f[_0x4cd0('0x45')],qs[_0x4cd0('0x4b')](_0x37323d[_0x4cd0('0x48')]['fields']));_0x1ff7c6['attributes']=_0x1ff7c6[_0x4cd0('0x49')][_0x4cd0('0x4c')]?_0x1ff7c6['attributes']:_0x42770f[_0x4cd0('0x45')];if(!_0x37323d[_0x4cd0('0x48')][_0x4cd0('0x4d')](_0x4cd0('0x4e'))){_0x1ff7c6[_0x4cd0('0x32')]=qs['limit'](_0x37323d[_0x4cd0('0x48')][_0x4cd0('0x32')]);_0x1ff7c6[_0x4cd0('0x2f')]=qs[_0x4cd0('0x2f')](_0x37323d[_0x4cd0('0x48')][_0x4cd0('0x2f')]);}_0x1ff7c6[_0x4cd0('0x4f')]=qs[_0x4cd0('0x50')](_0x37323d[_0x4cd0('0x48')][_0x4cd0('0x50')]);_0x1ff7c6['where']=qs[_0x4cd0('0x47')](_['pick'](_0x37323d[_0x4cd0('0x48')],_0x42770f[_0x4cd0('0x47')]));_0x1ff7c6['where'][_0x4cd0('0x6d')]=_0x439078['id'];if(_0x37323d[_0x4cd0('0x48')][_0x4cd0('0x53')]){_0x1ff7c6[_0x4cd0('0x51')]=_['merge'](_0x1ff7c6[_0x4cd0('0x51')],{'$or':_[_0x4cd0('0x54')](_0x1ff7c6[_0x4cd0('0x49')],function(_0x16bc48){var _0x3a5dc9={};_0x3a5dc9[_0x16bc48]={'$like':'%'+_0x37323d['query'][_0x4cd0('0x53')]+'%'};return _0x3a5dc9;})});}_0x1ff7c6=_[_0x4cd0('0x56')]({},_0x1ff7c6,_0x37323d['options']);return db[_0x4cd0('0x72')]['count']({'where':_0x1ff7c6[_0x4cd0('0x51')]})['then'](function(_0x585c84){_0x1ed195[_0x4cd0('0x31')]=_0x585c84;if(_0x37323d['query'][_0x4cd0('0x58')]){_0x1ff7c6['include']=[{'all':!![]}];}return db[_0x4cd0('0x72')]['findAll'](_0x1ff7c6);})[_0x4cd0('0x38')](function(_0x194342){_0x1ed195[_0x4cd0('0x59')]=_0x194342;return _0x1ed195;});}})[_0x4cd0('0x38')](respondWithFilteredResult(_0x3a4d33,_0x1ff7c6))[_0x4cd0('0x2c')](handleError(_0x3a4d33,null));};exports[_0x4cd0('0x74')]=function(_0x249a10,_0x217d08,_0x288fda){return db[_0x4cd0('0x40')]['find']({'where':{'id':_0x249a10[_0x4cd0('0x5b')]['id']}})[_0x4cd0('0x38')](handleEntityNotFound(_0x217d08,null))[_0x4cd0('0x38')](function(_0x59155c){if(_0x59155c){return _0x59155c[_0x4cd0('0x74')](_0x249a10[_0x4cd0('0x48')][_0x4cd0('0x70')]);}})[_0x4cd0('0x38')](respondWithStatusCode(_0x217d08,null))[_0x4cd0('0x2c')](handleError(_0x217d08,null));};exports[_0x4cd0('0x75')]=function(_0x45df70,_0x1dd66c,_0x578132){var _0x47cba8={'channel':'sms'};var _0x5211e9=[];var _0x1c729e=[];var _0x1ac607={};return db[_0x4cd0('0x40')][_0x4cd0('0x5e')]({'where':{'id':_0x45df70[_0x4cd0('0x5b')]['id']},'include':[{'model':db[_0x4cd0('0x76')],'as':'Applications'}]})[_0x4cd0('0x38')](handleEntityNotFound(_0x1dd66c,null))[_0x4cd0('0x38')](function(_0x28c5ba){_0x47cba8[_0x4cd0('0x77')]=_0x28c5ba;_0x47cba8['applications']=_[_0x4cd0('0x78')](_0x28c5ba[_0x4cd0('0x79')],['priority'],['asc']);if(_0x47cba8[_0x4cd0('0x77')]['Applications']){delete _0x47cba8['account'][_0x4cd0('0x79')];}return db[_0x4cd0('0x7a')][_0x4cd0('0x68')]();})[_0x4cd0('0x38')](function(_0x3c8849){if(!_0x3c8849){throw new db[(_0x4cd0('0x7b'))][(_0x4cd0('0x7c'))](_0x4cd0('0x7d'));}_0x5211e9=_['difference'](_[_0x4cd0('0x46')](_0x3c8849),[_0x4cd0('0x7e'),_0x4cd0('0x7f')]);_0x1c729e=_['difference'](_[_0x4cd0('0x46')](_0x3c8849),[_0x4cd0('0x7e'),_0x4cd0('0x7f'),_0x4cd0('0x80'),_0x4cd0('0x81')]);_0x47cba8['body']={'mapKey':_0x4cd0('0x82')};if(_0x47cba8['account'][_0x4cd0('0x43')]){switch(_0x47cba8[_0x4cd0('0x77')][_0x4cd0('0x43')]){case _0x4cd0('0x83'):_0x47cba8[_0x4cd0('0x60')]['from']=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x84')];_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x60')]=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x85')];_0x47cba8[_0x4cd0('0x60')]['messageId']=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x86')];break;case _0x4cd0('0x87'):_0x47cba8[_0x4cd0('0x60')]['from']='+'+_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x88')];_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x60')]=_0x45df70[_0x4cd0('0x60')]['text'];break;case'connectel':_0x47cba8['body']['from']=_0x45df70['body']['from'];_0x47cba8['body']['body']=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x29')];break;case _0x4cd0('0x89'):_0x47cba8['body'][_0x4cd0('0x8a')]=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x8a')];_0x47cba8['body'][_0x4cd0('0x60')]=_0x45df70['body'][_0x4cd0('0x60')];_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x8b')]=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x8c')];break;case _0x4cd0('0x8d'):_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x8a')]=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x84')];_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x60')]=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x8e')];_0x47cba8[_0x4cd0('0x60')]['messageId']=_0x45df70[_0x4cd0('0x60')]['MessageUUID'];break;case _0x4cd0('0x8f'):_0x47cba8[_0x4cd0('0x60')]['from']='+'+_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x90')][0x0]['from'];_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x60')]=_0x45df70['body']['results'][0x0][_0x4cd0('0x91')];_0x47cba8['body']['messageId']=_0x45df70['body'][_0x4cd0('0x90')][0x0][_0x4cd0('0x8b')];break;case'csc':_0x47cba8['body']['from']=_0x45df70['body'][_0x4cd0('0x92')];_0x47cba8['body']['body']=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x93')][_0x4cd0('0x29')];break;case _0x4cd0('0x94'):_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x8a')]=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x95')];_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x60')]=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x91')];_0x47cba8['body'][_0x4cd0('0x8b')]=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x96')];break;case _0x4cd0('0x97'):_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x8b')]=_0x45df70['body'][0x0][_0x4cd0('0x29')]['id'];_0x47cba8[_0x4cd0('0x60')]['from']=_0x45df70[_0x4cd0('0x60')][0x0][_0x4cd0('0x29')][_0x4cd0('0x8a')];_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x60')]=_0x45df70['body'][0x0][_0x4cd0('0x29')][_0x4cd0('0x91')];break;case _0x4cd0('0x98'):_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x8a')]=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x8a')];_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x60')]=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x29')];_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x8b')]=_0x45df70[_0x4cd0('0x60')][_0x4cd0('0x99')];break;}}if(_0x47cba8[_0x4cd0('0x60')]['id']){delete _0x47cba8[_0x4cd0('0x60')]['id'];}if(_['isNil'](_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x8a')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0x4cd0('0x9a')](_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x60')])||_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x60')]===''){throw new db[(_0x4cd0('0x7b'))][(_0x4cd0('0x7c'))](_0x4cd0('0x9b'));}if(_['isNil'](_0x47cba8[_0x4cd0('0x60')]['mapKey'])){throw new db['Sequelize'][(_0x4cd0('0x7c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c729e);}if(!_[_0x4cd0('0x9c')](_0x1c729e,_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x9d')])){throw new db[(_0x4cd0('0x7b'))][(_0x4cd0('0x7c'))](_0x4cd0('0x9e')+_0x1c729e);}_0x1ac607[_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x9d')]]=_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x8a')];return db[_0x4cd0('0x9f')][_0x4cd0('0x5e')]({'where':{'id':_0x47cba8[_0x4cd0('0x77')][_0x4cd0('0x81')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x1ac607,'limit':0x1,'order':[[_0x4cd0('0x7f'),_0x4cd0('0xa0')]]}]});})[_0x4cd0('0x38')](handleEntityNotFound(_0x1dd66c,null))[_0x4cd0('0x38')](function(_0x22f7cc){if(_0x22f7cc){_0x47cba8[_0x4cd0('0xa1')]=_[_0x4cd0('0xa2')](_0x22f7cc,[_0x4cd0('0xa3')]);if(_0x22f7cc[_0x4cd0('0xa3')][_0x4cd0('0x4c')]){return _0x22f7cc['Contacts'][0x0];}var _0x23df8f=_[_0x4cd0('0x1a')](_0x47cba8['body'],{'firstName':_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x8a')],'ListId':_0x22f7cc['id']});_0x23df8f[_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x9d')]]=_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x8a')];return db[_0x4cd0('0x7a')]['create'](_0x23df8f,{'fields':_0x5211e9,'raw':!![]});}})[_0x4cd0('0x38')](handleEntityNotFound(_0x1dd66c,null))[_0x4cd0('0x38')](function(_0x34c3a7){if(_0x34c3a7){_0x47cba8[_0x4cd0('0xa4')]=_0x34c3a7;var _0x58fa11={'ContactId':_0x34c3a7['id'],'phone':_0x47cba8['body'][_0x4cd0('0x8a')],'SmsAccountId':_0x45df70[_0x4cd0('0x5b')]['id']};var _0x4001c3={'ContactId':_0x34c3a7['id'],'SmsAccountId':_0x45df70[_0x4cd0('0x5b')]['id'],'closed':![]};return db[_0x4cd0('0xa5')][_0x4cd0('0x5e')]({'where':_0x4001c3})[_0x4cd0('0x38')](function(_0x4dd4ed){if(_0x4dd4ed){return[_0x4dd4ed,![]];}return db[_0x4cd0('0xa5')][_0x4cd0('0x5f')](_0x58fa11)[_0x4cd0('0x38')](function(_0x96655a){return[_0x96655a,!![]];});});}})[_0x4cd0('0xa6')](function(_0x94e724,_0xe16ffe){_0x47cba8[_0x4cd0('0xa7')]=_0x94e724['get']({'plain':!![]});_0x47cba8[_0x4cd0('0xa7')][_0x4cd0('0xa8')]=![];if(_0xe16ffe){if(_0x47cba8[_0x4cd0('0x77')][_0x4cd0('0xa9')]){_0x47cba8[_0x4cd0('0xaa')][_0x4cd0('0xab')]({'id':0x0,'priority':_0x47cba8[_0x4cd0('0xaa')][_0x4cd0('0x4c')]+0x1,'app':_0x4cd0('0xac'),'appdata':_0x4cd0('0xad'),'interval':_0x4cd0('0xae')});}_0x47cba8[_0x4cd0('0xa7')][_0x4cd0('0xa8')]=!![];}return db[_0x4cd0('0xaf')][_0x4cd0('0x5f')]({'phone':_0x47cba8[_0x4cd0('0x60')]['from'],'messageId':_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x8b')],'body':_0x47cba8[_0x4cd0('0x60')][_0x4cd0('0x60')],'SmsAccountId':_0x45df70['params']['id'],'SmsInteractionId':_0x94e724['id'],'direction':'in','ContactId':_0x94e724[_0x4cd0('0xb0')],'AttachmentId':_0x47cba8['body'][_0x4cd0('0xb1')]});})[_0x4cd0('0x38')](function(_0x2b9aa7){_0x47cba8[_0x4cd0('0x29')]=_0x2b9aa7;if(_0x47cba8[_0x4cd0('0xa7')][_0x4cd0('0xb2')]){return db['User'][_0x4cd0('0x5e')]({'attributes':['id',_0x4cd0('0x3c')],'where':{'id':_0x47cba8['interaction'][_0x4cd0('0xb2')]}})[_0x4cd0('0x38')](function(_0x3501be){if(_0x3501be){_0x47cba8[_0x4cd0('0xaa')][_0x4cd0('0xb3')]({'id':0x0,'priority':0x0,'app':_0x4cd0('0xb4'),'appdata':_0x3501be[_0x4cd0('0x3c')]+','+(_0x47cba8[_0x4cd0('0x77')][_0x4cd0('0xb5')]||0xa),'interval':_0x4cd0('0xae')});}return respondWithRpcPromise(_0x4cd0('0xb6'),_0x4cd0('0xb7'),_0x47cba8);});}return respondWithRpcPromise(_0x4cd0('0xb6'),_0x4cd0('0xb7'),_0x47cba8);})[_0x4cd0('0x38')](function(_0x3f2411){if(_0x3f2411){var _0x1a2b7b=0xc8;var _0x4d1f07=_0x4cd0('0xb8');logger[_0x4cd0('0x2a')](_0x4cd0('0x26'),_0x4d1f07,_0x1a2b7b,_0x4cd0('0xb9'));logger[_0x4cd0('0x25')](_0x4cd0('0xba'),_0x4d1f07,_0x1a2b7b,_0x4cd0('0xb9'),JSON[_0x4cd0('0x27')](_0x3f2411));if(_0x47cba8[_0x4cd0('0x77')][_0x4cd0('0x43')]==='twilio'){return _0x1dd66c[_0x4cd0('0x2d')](_0x1a2b7b)['set'](_0x4cd0('0xbb'),'text/xml')[_0x4cd0('0x3d')]('\x0a');}else{return _0x1dd66c['status'](_0x1a2b7b)[_0x4cd0('0x35')](_0x3f2411);}}})[_0x4cd0('0x2c')](handleError(_0x1dd66c,null));};exports['addApplications']=function(_0x3bfdf5,_0x325010){var _0x2233fa=_0x3bfdf5['params']['id'];var _0x4461f5=_0x3bfdf5['body'];var _0x2edfc6=0xc8;var _0x4f6cf5=null;return db[_0x4cd0('0xbc')][_0x4cd0('0xbd')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x4cd0('0xbe')]},function(_0x5d8a10){return db[_0x4cd0('0x40')][_0x4cd0('0x6b')]({'where':{'id':_0x2233fa},'transaction':_0x5d8a10})[_0x4cd0('0x38')](function(_0x3ae0ab){if(_0x3ae0ab){return db[_0x4cd0('0x76')]['destroy']({'where':{'SmsAccountId':_0x2233fa},'transaction':_0x5d8a10})[_0x4cd0('0x38')](function(){var _0x271c3a=_[_0x4cd0('0x54')](_0x4461f5,function(_0x3a9598){_0x3a9598[_0x4cd0('0x6d')]=_0x2233fa;return _0x3a9598;});return db[_0x4cd0('0x76')][_0x4cd0('0xbf')](_0x271c3a,{'transaction':_0x5d8a10});});}else{_0x2edfc6=0x194;_0x4f6cf5=[];}});})[_0x4cd0('0x38')](function(){if(_0x2edfc6!==0x194){return db[_0x4cd0('0x76')]['findAndCountAll']({'where':{'SmsAccountId':_0x2233fa},'order':'priority'})[_0x4cd0('0x38')](function(_0x483854){_0x4f6cf5=_0x483854;});}})[_0x4cd0('0x2c')](function(_0x3e6649){_0x2edfc6=0x1f4;logger[_0x4cd0('0x28')](_0x3e6649[_0x4cd0('0x3b')]);if(_0x3e6649[_0x4cd0('0x3c')]){delete _0x3e6649[_0x4cd0('0x3c')];}_0x4f6cf5=_0x3e6649;})['finally'](function(){if(_0x4f6cf5===null){_0x325010[_0x4cd0('0xc0')](_0x2edfc6);}else{if(_0x2edfc6===0x1f4){_0x325010[_0x4cd0('0x2d')](_0x2edfc6)['send'](_0x4f6cf5);}else{_0x325010[_0x4cd0('0x2d')](_0x2edfc6)[_0x4cd0('0x35')](_0x4f6cf5);}}});};exports[_0x4cd0('0xc1')]=function(_0x2d094a,_0x35071e,_0x251ae9){var _0x5f0a7b={};var _0xc29f87={};var _0x40ae1c;var _0x171f11;return db[_0x4cd0('0x40')][_0x4cd0('0x6b')]({'where':{'id':_0x2d094a[_0x4cd0('0x5b')]['id']}})[_0x4cd0('0x38')](handleEntityNotFound(_0x35071e,null))[_0x4cd0('0x38')](function(_0x5835c3){if(_0x5835c3){_0x40ae1c=_0x5835c3;_0xc29f87[_0x4cd0('0x45')]=_[_0x4cd0('0x46')](db[_0x4cd0('0x76')][_0x4cd0('0x41')]);_0xc29f87[_0x4cd0('0x48')]=_[_0x4cd0('0x46')](_0x2d094a[_0x4cd0('0x48')]);_0xc29f87[_0x4cd0('0x47')]=_[_0x4cd0('0x4a')](_0xc29f87['model'],_0xc29f87['query']);_0x5f0a7b['attributes']=_[_0x4cd0('0x4a')](_0xc29f87['model'],qs[_0x4cd0('0x4b')](_0x2d094a[_0x4cd0('0x48')][_0x4cd0('0x4b')]));_0x5f0a7b['attributes']=_0x5f0a7b[_0x4cd0('0x49')]['length']?_0x5f0a7b['attributes']:_0xc29f87[_0x4cd0('0x45')];_0x5f0a7b[_0x4cd0('0x4f')]=qs[_0x4cd0('0x50')](_0x2d094a['query'][_0x4cd0('0x50')]);_0x5f0a7b[_0x4cd0('0x51')]=qs['filters'](_[_0x4cd0('0x52')](_0x2d094a[_0x4cd0('0x48')],_0xc29f87[_0x4cd0('0x47')]));if(_0x2d094a['query'][_0x4cd0('0x53')]){_0x5f0a7b[_0x4cd0('0x51')]=_[_0x4cd0('0x56')](_0x5f0a7b['where'],{'$or':_[_0x4cd0('0x54')](_0x5f0a7b[_0x4cd0('0x49')],function(_0x4c182d){var _0x45caa5={};_0x45caa5[_0x4c182d]={'$like':'%'+_0x2d094a['query'][_0x4cd0('0x53')]+'%'};return _0x45caa5;})});}_0x5f0a7b=_['merge']({},_0x5f0a7b,_0x2d094a[_0x4cd0('0x57')]);return _0x40ae1c[_0x4cd0('0xc1')](_0x5f0a7b);}})[_0x4cd0('0x38')](function(_0x542722){if(_0x542722){_0x171f11=_0x542722[_0x4cd0('0x4c')];if(!_0x2d094a['query'][_0x4cd0('0x4d')]('nolimit')){_0x5f0a7b[_0x4cd0('0x32')]=qs[_0x4cd0('0x32')](_0x2d094a['query'][_0x4cd0('0x32')]);_0x5f0a7b[_0x4cd0('0x2f')]=qs['offset'](_0x2d094a[_0x4cd0('0x48')][_0x4cd0('0x2f')]);}return _0x40ae1c['getApplications'](_0x5f0a7b);}})['then'](function(_0x165458){if(_0x165458){return _0x165458?{'count':_0x171f11,'rows':_0x165458}:null;}})[_0x4cd0('0x38')](respondWithResult(_0x35071e,null))[_0x4cd0('0x2c')](handleError(_0x35071e,null));};exports['getInteractions']=function(_0x2448d9,_0x75861d,_0x420ded){var _0x4e3803={'raw':![],'where':{}};var _0x272c7e={};var _0x18a7d8={'count':0x0,'rows':[]};return db[_0x4cd0('0x40')][_0x4cd0('0x6b')]({'where':{'id':_0x2448d9[_0x4cd0('0x5b')]['id']}})['then'](handleEntityNotFound(_0x75861d,null))['then'](function(_0x4feae4){if(_0x4feae4){_0x272c7e[_0x4cd0('0x45')]=_['keys'](db[_0x4cd0('0xa5')]['rawAttributes']);_0x272c7e[_0x4cd0('0x48')]=_[_0x4cd0('0x46')](_0x2448d9[_0x4cd0('0x48')]);_0x272c7e[_0x4cd0('0x47')]=_[_0x4cd0('0x4a')](_0x272c7e[_0x4cd0('0x45')],_0x272c7e[_0x4cd0('0x48')]);_0x4e3803[_0x4cd0('0x49')]=_[_0x4cd0('0x4a')](_0x272c7e['model'],qs[_0x4cd0('0x4b')](_0x2448d9[_0x4cd0('0x48')][_0x4cd0('0x4b')]));_0x4e3803[_0x4cd0('0x49')]=_0x4e3803[_0x4cd0('0x49')][_0x4cd0('0x4c')]?_0x4e3803[_0x4cd0('0x49')]:_0x272c7e['model'];if(!_0x2448d9['query'][_0x4cd0('0x4d')](_0x4cd0('0x4e'))){_0x4e3803['limit']=qs['limit'](_0x2448d9[_0x4cd0('0x48')][_0x4cd0('0x32')]);_0x4e3803[_0x4cd0('0x2f')]=qs[_0x4cd0('0x2f')](_0x2448d9[_0x4cd0('0x48')][_0x4cd0('0x2f')]);}_0x4e3803[_0x4cd0('0x4f')]=qs[_0x4cd0('0x50')](_0x2448d9[_0x4cd0('0x48')][_0x4cd0('0x50')]);_0x4e3803[_0x4cd0('0x51')]=qs[_0x4cd0('0x47')](_[_0x4cd0('0x52')](_0x2448d9[_0x4cd0('0x48')],_0x272c7e['filters']));_0x4e3803[_0x4cd0('0x51')]['SmsAccountId']=_0x4feae4['id'];if(_0x2448d9[_0x4cd0('0x48')][_0x4cd0('0x53')]){_0x4e3803[_0x4cd0('0x51')]=_[_0x4cd0('0x56')](_0x4e3803[_0x4cd0('0x51')],{'$or':_[_0x4cd0('0x54')](_0x4e3803['attributes'],function(_0x27330f){var _0xad5a7={};_0xad5a7[_0x27330f]={'$like':'%'+_0x2448d9[_0x4cd0('0x48')][_0x4cd0('0x53')]+'%'};return _0xad5a7;})});}_0x4e3803=_['merge']({},_0x4e3803,_0x2448d9[_0x4cd0('0x57')]);return db[_0x4cd0('0xa5')]['count']({'where':_0x4e3803[_0x4cd0('0x51')]})['then'](function(_0x308454){_0x18a7d8[_0x4cd0('0x31')]=_0x308454;if(_0x2448d9[_0x4cd0('0x48')]['includeAll']){_0x4e3803[_0x4cd0('0x5d')]=[{'model':db[_0x4cd0('0x7a')],'as':_0x4cd0('0xc2'),'required':![]},{'model':db[_0x4cd0('0xc3')],'as':'Owner','attributes':[_0x4cd0('0x3c'),'fullname',_0x4cd0('0xc4')],'required':![]},{'model':db[_0x4cd0('0xc5')],'as':_0x4cd0('0xc6'),'attributes':['id',_0x4cd0('0x3c'),_0x4cd0('0xc7')],'where':_0x2448d9['query']['tag']?{'id':_0x2448d9[_0x4cd0('0x48')][_0x4cd0('0xc8')]}:undefined,'required':_0x2448d9[_0x4cd0('0x48')][_0x4cd0('0xc8')]?!![]:![]}];}return db[_0x4cd0('0xa5')][_0x4cd0('0x6e')](_0x4e3803);})[_0x4cd0('0x38')](function(_0x1574a4){_0x18a7d8[_0x4cd0('0x59')]=_0x1574a4;return _0x18a7d8;});}})[_0x4cd0('0x38')](respondWithFilteredResult(_0x75861d,_0x4e3803))['catch'](handleError(_0x75861d,null));};exports['send']=function(_0x4f2a18,_0x1d5d89,_0x3c597c){var _0xd6ecab,_0x417651,_0x17922e;if(_[_0x4cd0('0x9a')](_0x4f2a18[_0x4cd0('0x60')][_0x4cd0('0x60')])||_0x4f2a18[_0x4cd0('0x60')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x4cd0('0x9b'));}if(_[_0x4cd0('0x9a')](_0x4f2a18[_0x4cd0('0x60')]['to'])){throw new db['Sequelize']['ValidationError']('to\x20is\x20mandatory');}_0xd6ecab=_0x4f2a18[_0x4cd0('0x60')]['to'];return db[_0x4cd0('0x40')][_0x4cd0('0x5e')]({'where':{'id':_0x4f2a18[_0x4cd0('0x5b')]['id']},'include':[{'model':db[_0x4cd0('0x9f')],'as':'List','include':[{'model':db[_0x4cd0('0x7a')],'as':_0x4cd0('0xa3'),'where':{'mobile':_0xd6ecab},'limit':0x1,'order':[[_0x4cd0('0x7f'),_0x4cd0('0xa0')]]}]}]})[_0x4cd0('0x38')](handleEntityNotFound(_0x1d5d89,null))['then'](function(_0x48c4fd){if(_0x48c4fd&&_0x48c4fd['List']){_0x417651=_0x48c4fd[_0x4cd0('0x62')]({'plain':!![]});if(_0x417651['List']&&_0x417651[_0x4cd0('0xc9')][_0x4cd0('0xa3')][_0x4cd0('0x4c')]){return _0x417651[_0x4cd0('0xc9')][_0x4cd0('0xa3')][0x0];}return db[_0x4cd0('0x7a')][_0x4cd0('0x5f')](_['defaults'](_0x4f2a18[_0x4cd0('0x60')],{'firstName':_0xd6ecab,'mobile':_0xd6ecab,'phone':_0xd6ecab,'ListId':_0x417651[_0x4cd0('0x81')]}));}})[_0x4cd0('0x38')](handleEntityNotFound(_0x1d5d89,null))['then'](function(_0x218662){if(_0x218662){_0x17922e=_0x218662;return db[_0x4cd0('0xa5')]['find']({'where':{'ContactId':_0x17922e['id'],'closed':![],'SmsAccountId':_0x417651['id']}})[_0x4cd0('0x38')](function(_0x5d3cc1){if(_0x5d3cc1){return[_0x5d3cc1,![]];}return db[_0x4cd0('0xa5')][_0x4cd0('0x5f')]({'UserId':_0x4f2a18[_0x4cd0('0x61')]['id'],'ContactId':_0x17922e['id'],'SmsAccountId':_0x417651['id'],'phone':_0xd6ecab,'firstMsgDirection':_0x4cd0('0xca'),'Messages':[_[_0x4cd0('0x56')](_0x4f2a18[_0x4cd0('0x60')],{'read':![],'body':_0x4f2a18[_0x4cd0('0x60')]['body'],'phone':_0xd6ecab,'SmsAccountId':_0x417651['id'],'UserId':_0x4f2a18['user']['id'],'ContactId':_0x17922e['id']})]},{'include':[{'model':db[_0x4cd0('0xaf')],'as':_0x4cd0('0xcb')}]})[_0x4cd0('0x38')](function(_0x5cc0b3){return[_0x5cc0b3,!![]];});});}})[_0x4cd0('0xa6')](function(_0x34f88d,_0x44eddc){if(_0x44eddc){return _0x34f88d;}return db[_0x4cd0('0xaf')]['create'](_[_0x4cd0('0x56')](_0x4f2a18['body'],{'read':![],'body':_0x4f2a18[_0x4cd0('0x60')][_0x4cd0('0x60')],'phone':_0xd6ecab,'SmsAccountId':_0x417651['id'],'SmsInteractionId':_0x34f88d['id'],'UserId':_0x4f2a18['user']['id'],'ContactId':_0x17922e['id']}))[_0x4cd0('0x38')](function(_0x5e3e38){_0x34f88d['dataValues']['Messages']=[];_0x34f88d['dataValues'][_0x4cd0('0xcb')][_0x4cd0('0xab')](_0x5e3e38[_0x4cd0('0xcc')]);return _0x34f88d;});})[_0x4cd0('0x38')](respondWithResult(_0x1d5d89,null))[_0x4cd0('0x2c')](handleError(_0x1d5d89,null));};exports[_0x4cd0('0x2d')]=function(_0x158ad7,_0x22c65a,_0x323c65){if(_0x158ad7['body']['id']){delete _0x158ad7[_0x4cd0('0x60')]['id'];}var _0x417ea5,_0x3e6436,_0x40d257;return db[_0x4cd0('0x40')][_0x4cd0('0x5e')]({'where':{'id':_0x158ad7[_0x4cd0('0x5b')]['id']}})[_0x4cd0('0x38')](handleEntityNotFound(_0x22c65a,null))[_0x4cd0('0x38')](function(_0xd3f401){if(_0xd3f401){_0x40d257=_0xd3f401;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4cd0('0x2d'),'received\x20delivery\x20report\x20from',_0xd3f401[_0x4cd0('0x43')],util[_0x4cd0('0xcd')](_0x158ad7['body'],{'showHidden':![],'depth':null}));switch(_0xd3f401['type']){case _0x4cd0('0x87'):if(_0x158ad7['body'][_0x4cd0('0xce')]&&_0x158ad7[_0x4cd0('0x60')][_0x4cd0('0x2d')]){_0x3e6436=_0x158ad7[_0x4cd0('0x60')][_0x4cd0('0x2d')];return db[_0x4cd0('0xaf')][_0x4cd0('0x5e')]({'where':{'messageId':_0x158ad7['body'][_0x4cd0('0xce')]}});}break;case _0x4cd0('0xcf'):if(_0x158ad7[_0x4cd0('0x60')]['requestid']&&_0x158ad7[_0x4cd0('0x60')][_0x4cd0('0xd0')]){_0x3e6436=_0x158ad7[_0x4cd0('0x60')]['statusInt'];return db[_0x4cd0('0xaf')][_0x4cd0('0x5e')]({'where':{'messageId':_0x158ad7[_0x4cd0('0x60')]['requestid']}});}break;case _0x4cd0('0x89'):if(_0x158ad7[_0x4cd0('0x60')][_0x4cd0('0x8c')]&&_0x158ad7['body'][_0x4cd0('0xd1')]){_0x3e6436=_0x158ad7['body']['status_code'];return db[_0x4cd0('0xaf')][_0x4cd0('0x5e')]({'where':{'messageId':_0x158ad7[_0x4cd0('0x60')][_0x4cd0('0x8c')]}});}break;case _0x4cd0('0x8f'):var _0x317220=_0x158ad7['body'][_0x4cd0('0x90')][0x0];if(_0x317220[_0x4cd0('0x8b')]&&_0x317220[_0x4cd0('0x2d')]['groupName']===_0x4cd0('0xd2')){_0x3e6436=_0x317220[_0x4cd0('0x2d')]['groupName'];return db[_0x4cd0('0xaf')]['find']({'where':{'messageId':_0x317220[_0x4cd0('0x8b')]}});}break;case'clickatell':if(_0x158ad7[_0x4cd0('0x60')][_0x4cd0('0x8b')]&&_0x158ad7[_0x4cd0('0x60')][_0x4cd0('0x2d')]){_0x3e6436=_0x158ad7['body']['status'];return db[_0x4cd0('0xaf')][_0x4cd0('0x5e')]({'where':{'messageId':_0x158ad7[_0x4cd0('0x60')][_0x4cd0('0x8b')]}});}break;case _0x4cd0('0x97'):if(_0x158ad7[_0x4cd0('0x60')][0x0][_0x4cd0('0x29')]['id']){_0x3e6436=_0x158ad7[_0x4cd0('0x60')][0x0]['type'];return db['SmsMessage'][_0x4cd0('0x5e')]({'where':{'messageId':_0x158ad7['body'][0x0][_0x4cd0('0x29')]['id']}});}break;case _0x4cd0('0x98'):if(_0x158ad7[_0x4cd0('0x60')][_0x4cd0('0xd3')]&&_0x158ad7[_0x4cd0('0x60')][_0x4cd0('0x2d')]){_0x3e6436=_0x158ad7[_0x4cd0('0x60')]['status'];return db[_0x4cd0('0xaf')][_0x4cd0('0x5e')]({'where':{'messageId':_0x158ad7[_0x4cd0('0x60')]['redif']}});}break;}}})[_0x4cd0('0x38')](handleEntityNotFound(_0x22c65a,null))['then'](function(_0x11bc9b){if(_0x11bc9b){_0x417ea5=_0x11bc9b;switch(_0x40d257[_0x4cd0('0x43')]){case _0x4cd0('0x87'):if(_0x3e6436==='DELIVERED'){return _0x417ea5[_0x4cd0('0x37')]({'read':!![]});}else{logger['error'](_0x4cd0('0x26'),_0x4cd0('0x2d'),_0x4cd0('0x87'),util['inspect'](_0x158ad7[_0x4cd0('0x60')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x3e6436==='1'){return _0x417ea5[_0x4cd0('0x37')]({'read':!![]});}else{logger[_0x4cd0('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4cd0('0x2d'),'skebby',util[_0x4cd0('0xcd')](_0x158ad7['body'],{'showHidden':![],'depth':null}));}break;case _0x4cd0('0x89'):if(!_0x158ad7['body'][_0x4cd0('0xd4')]&&_0x3e6436>=0xc8&&_0x3e6436<=0xce){return _0x417ea5[_0x4cd0('0x37')]({'read':!![]});}else{logger['error'](_0x4cd0('0x26'),_0x4cd0('0x2d'),_0x4cd0('0x89'),util[_0x4cd0('0xcd')](_0x158ad7[_0x4cd0('0x60')],{'showHidden':![],'depth':null}));}break;case _0x4cd0('0x8f'):var _0x47b5ec=_0x158ad7[_0x4cd0('0x60')][_0x4cd0('0x90')][0x0];if(_0x47b5ec[_0x4cd0('0x2d')][_0x4cd0('0xd5')]===_0x4cd0('0xd2')){return _0x417ea5[_0x4cd0('0x37')]({'read':!![]});}else{logger[_0x4cd0('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4cd0('0x2d'),'infobip',util[_0x4cd0('0xcd')](_0x158ad7[_0x4cd0('0x60')],{'showHidden':![],'depth':null}));}break;case _0x4cd0('0x94'):if(_0x3e6436==_0x4cd0('0xd6')||_0x3e6436==_0x4cd0('0xd7')){return _0x417ea5['update']({'read':!![]});}else{logger[_0x4cd0('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4cd0('0x2d'),_0x4cd0('0x94'),util[_0x4cd0('0xcd')](_0x158ad7[_0x4cd0('0x60')],{'showHidden':![],'depth':null}));}break;case _0x4cd0('0x97'):if(_0x3e6436=='message-delivered'){return _0x417ea5['update']({'read':!![]});}else{logger[_0x4cd0('0x28')](_0x4cd0('0x26'),'status',_0x4cd0('0x97'),util['inspect'](_0x158ad7[_0x4cd0('0x60')],{'showHidden':![],'depth':null}));}break;case _0x4cd0('0x98'):if(_0x3e6436===_0x4cd0('0xd8')||_0x3e6436===_0x4cd0('0xd9')){return _0x417ea5[_0x4cd0('0x37')]({'read':!![]});}else{logger[_0x4cd0('0x28')](_0x4cd0('0x26'),_0x4cd0('0x2d'),'intelepeer',util[_0x4cd0('0xcd')](_0x158ad7['body'],{'showHidden':![],'depth':null}));}break;}return _0x417ea5;}})[_0x4cd0('0x38')](respondWithResult(_0x22c65a,null))['catch'](handleError(_0x22c65a,null));};exports[_0x4cd0('0xda')]=function(_0x43177f,_0x195a95,_0x524c4e){var _0x1536c8,_0x5dfeca,_0x32f6b2;return db[_0x4cd0('0x40')][_0x4cd0('0x5e')]({'where':{'id':_0x43177f['params']['id']}})[_0x4cd0('0x38')](handleEntityNotFound(_0x195a95,null))[_0x4cd0('0x38')](function(_0x100637){if(_0x100637){_0x32f6b2=_0x100637;logger[_0x4cd0('0x25')](_0x4cd0('0x26'),'status',_0x4cd0('0xdb'),_0x100637[_0x4cd0('0x43')],util[_0x4cd0('0xcd')](_0x43177f[_0x4cd0('0x48')],{'showHidden':![],'depth':null}));switch(_0x100637[_0x4cd0('0x43')]){case _0x4cd0('0xdc'):if(_0x43177f[_0x4cd0('0x48')]['message-id']&&_0x43177f['query'][_0x4cd0('0xdd')]){_0x5dfeca=_0x43177f[_0x4cd0('0x48')][_0x4cd0('0xdd')];return db['SmsMessage'][_0x4cd0('0x5e')]({'where':{'messageId':_0x43177f[_0x4cd0('0x48')]['message-id']}});}break;}}})[_0x4cd0('0x38')](handleEntityNotFound(_0x195a95,null))['then'](function(_0x25ff69){if(_0x25ff69){_0x1536c8=_0x25ff69;switch(_0x32f6b2['type']){case'csc':if(_0x5dfeca==='2'||_0x5dfeca==='6'){return _0x1536c8[_0x4cd0('0x37')]({'read':!![]});}else{logger[_0x4cd0('0x28')](_0x4cd0('0x26'),'status',_0x4cd0('0xdc'),util['inspect'](_0x43177f[_0x4cd0('0x48')],{'showHidden':![],'depth':null}));};break;}return _0x1536c8;}})[_0x4cd0('0x38')](respondWithResult(_0x195a95,null))['catch'](handleError(_0x195a95,null));};exports[_0x4cd0('0xde')]=function(_0x181d32,_0x283369,_0x23fe3b){return db['SmsAccount']['find']({'where':{'id':_0x181d32['params']['id']}})[_0x4cd0('0x38')](handleEntityNotFound(_0x283369,null))[_0x4cd0('0x38')](function(_0x18d8cf){if(_0x18d8cf){return _0x18d8cf[_0x4cd0('0xde')](_0x181d32[_0x4cd0('0x60')][_0x4cd0('0x70')],_[_0x4cd0('0xa2')](_0x181d32[_0x4cd0('0x60')],[_0x4cd0('0x70'),'id'])||{})['spread'](function(_0x4b1574){for(var _0x2bd4c6=0x0;_0x2bd4c6<_0x181d32[_0x4cd0('0x60')][_0x4cd0('0x70')][_0x4cd0('0x4c')];_0x2bd4c6+=0x1){socket[_0x4cd0('0xdf')]('userSmsAccount:save',{'UserId':Number(_0x181d32[_0x4cd0('0x60')]['ids'][_0x2bd4c6]),'SmsAccountId':Number(_0x181d32['params']['id'])});}return _0x4b1574;});}})['then'](respondWithResult(_0x283369,null))[_0x4cd0('0x2c')](handleError(_0x283369,null));};exports[_0x4cd0('0xe0')]=function(_0xf9c8f4,_0x36f324,_0x4de66a){return db[_0x4cd0('0x40')][_0x4cd0('0x5e')]({'where':{'id':_0xf9c8f4[_0x4cd0('0x5b')]['id']}})['then'](handleEntityNotFound(_0x36f324,null))['then'](function(_0x26d097){if(_0x26d097){return _0x26d097[_0x4cd0('0xe0')](_0xf9c8f4[_0x4cd0('0x48')]['ids'])[_0x4cd0('0x38')](function(){if(_['isArray'](_0xf9c8f4[_0x4cd0('0x48')][_0x4cd0('0x70')])){for(var _0x44f156=0x0;_0x44f156<_0xf9c8f4[_0x4cd0('0x48')][_0x4cd0('0x70')][_0x4cd0('0x4c')];_0x44f156+=0x1){socket[_0x4cd0('0xdf')]('userSmsAccount:remove',{'UserId':Number(_0xf9c8f4[_0x4cd0('0x48')][_0x4cd0('0x70')][_0x44f156]),'SmsAccountId':Number(_0xf9c8f4['params']['id'])});}}else{socket[_0x4cd0('0xdf')](_0x4cd0('0xe1'),{'UserId':Number(_0xf9c8f4[_0x4cd0('0x48')][_0x4cd0('0x70')]),'SmsAccountId':Number(_0xf9c8f4[_0x4cd0('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x36f324,null))[_0x4cd0('0x2c')](handleError(_0x36f324,null));};exports[_0x4cd0('0xe2')]=function(_0xf32261,_0x158044,_0x463f93){var _0xc78fdc={};var _0x2c1837={};var _0x23db52;var _0x39f174;return db[_0x4cd0('0x40')][_0x4cd0('0x6b')]({'where':{'id':_0xf32261['params']['id']}})[_0x4cd0('0x38')](handleEntityNotFound(_0x158044,null))[_0x4cd0('0x38')](function(_0x49dcab){if(_0x49dcab){_0x23db52=_0x49dcab;_0x2c1837['model']=_[_0x4cd0('0x46')](db[_0x4cd0('0xc3')][_0x4cd0('0x41')]);_0x2c1837[_0x4cd0('0x48')]=_['keys'](_0xf32261[_0x4cd0('0x48')]);_0x2c1837[_0x4cd0('0x47')]=_[_0x4cd0('0x4a')](_0x2c1837[_0x4cd0('0x45')],_0x2c1837[_0x4cd0('0x48')]);_0xc78fdc[_0x4cd0('0x49')]=_[_0x4cd0('0x4a')](_0x2c1837[_0x4cd0('0x45')],qs[_0x4cd0('0x4b')](_0xf32261[_0x4cd0('0x48')][_0x4cd0('0x4b')]));_0xc78fdc[_0x4cd0('0x49')]=_0xc78fdc[_0x4cd0('0x49')][_0x4cd0('0x4c')]?_0xc78fdc[_0x4cd0('0x49')]:_0x2c1837[_0x4cd0('0x45')];_0xc78fdc['order']=qs['sort'](_0xf32261[_0x4cd0('0x48')][_0x4cd0('0x50')]);_0xc78fdc[_0x4cd0('0x51')]=qs['filters'](_['pick'](_0xf32261[_0x4cd0('0x48')],_0x2c1837[_0x4cd0('0x47')]));if(_0xf32261['query'][_0x4cd0('0x53')]){_0xc78fdc[_0x4cd0('0x51')]=_['merge'](_0xc78fdc[_0x4cd0('0x51')],{'$or':_[_0x4cd0('0x54')](_0xc78fdc[_0x4cd0('0x49')],function(_0x56e3c0){var _0x528fa3={};_0x528fa3[_0x56e3c0]={'$like':'%'+_0xf32261['query'][_0x4cd0('0x53')]+'%'};return _0x528fa3;})});}_0xc78fdc=_['merge']({},_0xc78fdc,_0xf32261[_0x4cd0('0x57')]);return _0x23db52[_0x4cd0('0xe2')](_0xc78fdc);}})[_0x4cd0('0x38')](function(_0x2496f5){if(_0x2496f5){_0x39f174=_0x2496f5['length'];if(!_0xf32261[_0x4cd0('0x48')][_0x4cd0('0x4d')](_0x4cd0('0x4e'))){_0xc78fdc['limit']=qs[_0x4cd0('0x32')](_0xf32261['query'][_0x4cd0('0x32')]);_0xc78fdc[_0x4cd0('0x2f')]=qs['offset'](_0xf32261['query'][_0x4cd0('0x2f')]);}return _0x23db52[_0x4cd0('0xe2')](_0xc78fdc);}})[_0x4cd0('0x38')](function(_0x26f7ef){if(_0x26f7ef){return _0x26f7ef?{'count':_0x39f174,'rows':_0x26f7ef}:null;}})[_0x4cd0('0x38')](respondWithResult(_0x158044,null))['catch'](handleError(_0x158044,null));}; \ No newline at end of file +var _0x2b4b=['skebby','from','sender','connectel','clicksend','message_id','plivo','MessageUUID','results','text','originatingAddress','segmentedMessage','fromNumber','intelepeer','refid','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','contact','SmsInteraction','spread','interaction','created','applications','push','close','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','stack','finally','getApplications','Contact','Owner','fullname','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','List','out','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','infobip','groupName','clickatell','bandwidth','redif','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','sendStatus','status','end','json','offset','count','limit','apply','reject','save','update','get','SmsAccounts','UserProfileResource','destroy','name','send','index','map','SmsAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','mandatoryDispositionPause','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','Pause','describe','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','findOne','CannedAnswer','rawAttributes','removeAnswers','notify','SmsApplication','account','orderBy','priority','asc','Applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','mobile','twilio','From','Body','messageId','MessageSid'];(function(_0x3439ea,_0x1d81d4){var _0x1a55f3=function(_0x33db17){while(--_0x33db17){_0x3439ea['push'](_0x3439ea['shift']());}};_0x1a55f3(++_0x1d81d4);}(_0x2b4b,0x141));var _0xb2b4=function(_0x4ffebc,_0x8a5bd0){_0x4ffebc=_0x4ffebc-0x0;var _0x1cb473=_0x2b4b[_0x4ffebc];return _0x1cb473;};'use strict';var emlformat=require(_0xb2b4('0x0'));var rimraf=require(_0xb2b4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2b4('0x2'));var rp=require(_0xb2b4('0x3'));var moment=require(_0xb2b4('0x4'));var BPromise=require(_0xb2b4('0x5'));var Mustache=require(_0xb2b4('0x6'));var util=require(_0xb2b4('0x7'));var path=require(_0xb2b4('0x8'));var sox=require(_0xb2b4('0x9'));var csv=require(_0xb2b4('0xa'));var ejs=require(_0xb2b4('0xb'));var fs=require('fs');var fs_extra=require(_0xb2b4('0xc'));var _=require(_0xb2b4('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb2b4('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb2b4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb2b4('0x10'));var hardwareService=require(_0xb2b4('0x11'));var logger=require(_0xb2b4('0x12'))(_0xb2b4('0x13'));var utils=require(_0xb2b4('0x14'));var config=require(_0xb2b4('0x15'));var licenseUtil=require(_0xb2b4('0x16'));var db=require(_0xb2b4('0x17'))['db'];config[_0xb2b4('0x18')]=_[_0xb2b4('0x19')](config[_0xb2b4('0x18')],{'host':_0xb2b4('0x1a'),'port':0x18eb});var socket=require(_0xb2b4('0x1b'))(new Redis(config[_0xb2b4('0x18')]));require('./smsAccount.socket')[_0xb2b4('0x1c')](socket);var jayson=require(_0xb2b4('0x1d'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x59c272,_0x458b4d,_0x4023c3,_0x26568a){return new BPromise(function(_0x477f9f,_0x536482){var _0x49ec3b=_0x26568a||client;return _0x49ec3b['request'](_0x59c272,_0x4023c3)[_0xb2b4('0x1e')](function(_0x4c4500){logger['info'](_0xb2b4('0x1f'),_0x458b4d,_0xb2b4('0x20'));logger[_0xb2b4('0x21')](_0xb2b4('0x22'),_0x458b4d,_0xb2b4('0x20'),JSON[_0xb2b4('0x23')](_0x4c4500));if(_0x4c4500[_0xb2b4('0x24')]){if(_0x4c4500[_0xb2b4('0x24')]['code']===0x1f4){logger[_0xb2b4('0x24')](_0xb2b4('0x1f'),_0x458b4d,_0x4c4500[_0xb2b4('0x24')][_0xb2b4('0x25')]);return _0x536482(_0x4c4500[_0xb2b4('0x24')][_0xb2b4('0x25')]);}logger[_0xb2b4('0x24')]('SmsAccount,\x20%s,\x20%s',_0x458b4d,_0x4c4500['error'][_0xb2b4('0x25')]);return _0x477f9f(_0x4c4500['error'][_0xb2b4('0x25')]);}else{logger[_0xb2b4('0x26')](_0xb2b4('0x1f'),_0x458b4d,_0xb2b4('0x20'));_0x477f9f(_0x4c4500['result'][_0xb2b4('0x25')]);}})[_0xb2b4('0x27')](function(_0x29ef26){logger[_0xb2b4('0x24')](_0xb2b4('0x1f'),_0x458b4d,_0x29ef26);_0x536482(_0x29ef26);});});}function respondWithStatusCode(_0x1d313d,_0x4cf782){_0x4cf782=_0x4cf782||0xcc;return function(_0x1258c2){if(_0x1258c2){return _0x1d313d[_0xb2b4('0x28')](_0x4cf782);}return _0x1d313d[_0xb2b4('0x29')](_0x4cf782)[_0xb2b4('0x2a')]();};}function respondWithResult(_0x3873f6,_0x18db57){_0x18db57=_0x18db57||0xc8;return function(_0x28622a){if(_0x28622a){return _0x3873f6[_0xb2b4('0x29')](_0x18db57)[_0xb2b4('0x2b')](_0x28622a);}};}function respondWithFilteredResult(_0x4f465b,_0x1802d0){return function(_0x587dcb){if(_0x587dcb){var _0x54ed3e=typeof _0x1802d0[_0xb2b4('0x2c')]==='undefined'&&typeof _0x1802d0['limit']==='undefined';var _0x86302c=_0x587dcb[_0xb2b4('0x2d')];var _0x3d167e=_0x54ed3e?0x0:_0x1802d0[_0xb2b4('0x2c')];var _0x568446=_0x54ed3e?_0x587dcb[_0xb2b4('0x2d')]:_0x1802d0[_0xb2b4('0x2c')]+_0x1802d0[_0xb2b4('0x2e')];var _0x5c2949;if(_0x568446>=_0x86302c){_0x568446=_0x86302c;_0x5c2949=0xc8;}else{_0x5c2949=0xce;}_0x4f465b[_0xb2b4('0x29')](_0x5c2949);return _0x4f465b['set']('Content-Range',_0x3d167e+'-'+_0x568446+'/'+_0x86302c)['json'](_0x587dcb);}return null;};}function patchUpdates(_0x2a1b12){return function(_0xe2bad3){try{jsonpatch[_0xb2b4('0x2f')](_0xe2bad3,_0x2a1b12,!![]);}catch(_0x5e9678){return BPromise[_0xb2b4('0x30')](_0x5e9678);}return _0xe2bad3[_0xb2b4('0x31')]();};}function saveUpdates(_0x5c8207,_0x30737f){return function(_0x2605a2){if(_0x2605a2){return _0x2605a2[_0xb2b4('0x32')](_0x5c8207)[_0xb2b4('0x1e')](function(_0x21b44d){return _0x21b44d;});}return null;};}function removeEntity(_0x21fff7,_0x28f6b3){return function(_0x9c385d){if(_0x9c385d){return _0x9c385d['destroy']()['then'](function(){var _0x450300=_0x9c385d[_0xb2b4('0x33')]({'plain':!![]});var _0x243892=_0xb2b4('0x34');return db[_0xb2b4('0x35')][_0xb2b4('0x36')]({'where':{'type':_0x243892,'resourceId':_0x450300['id']}})[_0xb2b4('0x1e')](function(){return _0x9c385d;});})[_0xb2b4('0x1e')](function(){_0x21fff7[_0xb2b4('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34d02e,_0x47671e){return function(_0x1ce0d9){if(!_0x1ce0d9){_0x34d02e['sendStatus'](0x194);}return _0x1ce0d9;};}function handleError(_0xcbb26d,_0x41da27){_0x41da27=_0x41da27||0x1f4;return function(_0x1e2721){logger['error'](_0x1e2721['stack']);if(_0x1e2721[_0xb2b4('0x37')]){delete _0x1e2721['name'];}_0xcbb26d[_0xb2b4('0x29')](_0x41da27)[_0xb2b4('0x38')](_0x1e2721);};}exports[_0xb2b4('0x39')]=function(_0x3766f5,_0x5876d1){var _0x1781f5={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1d9c1b={},_0x3f50cd={'count':0x0,'rows':[]};var _0x29cebd=_[_0xb2b4('0x3a')](db[_0xb2b4('0x3b')]['rawAttributes'],function(_0x6839be){return{'name':_0x6839be[_0xb2b4('0x3c')],'type':_0x6839be[_0xb2b4('0x3d')][_0xb2b4('0x3e')]};});_0x1d9c1b[_0xb2b4('0x3f')]=_['map'](_0x29cebd,_0xb2b4('0x37'));_0x1d9c1b[_0xb2b4('0x40')]=_[_0xb2b4('0x41')](_0x3766f5['query']);_0x1d9c1b[_0xb2b4('0x42')]=_[_0xb2b4('0x43')](_0x1d9c1b[_0xb2b4('0x3f')],_0x1d9c1b[_0xb2b4('0x40')]);_0x1781f5[_0xb2b4('0x44')]=_[_0xb2b4('0x43')](_0x1d9c1b['model'],qs['fields'](_0x3766f5[_0xb2b4('0x40')][_0xb2b4('0x45')]));_0x1781f5['attributes']=_0x1781f5[_0xb2b4('0x44')]['length']?_0x1781f5[_0xb2b4('0x44')]:_0x1d9c1b['model'];if(!_0x3766f5[_0xb2b4('0x40')][_0xb2b4('0x46')](_0xb2b4('0x47'))){_0x1781f5[_0xb2b4('0x2e')]=qs[_0xb2b4('0x2e')](_0x3766f5[_0xb2b4('0x40')][_0xb2b4('0x2e')]);_0x1781f5[_0xb2b4('0x2c')]=qs['offset'](_0x3766f5[_0xb2b4('0x40')]['offset']);}_0x1781f5[_0xb2b4('0x48')]=qs[_0xb2b4('0x49')](_0x3766f5[_0xb2b4('0x40')][_0xb2b4('0x49')]);_0x1781f5[_0xb2b4('0x4a')]=qs[_0xb2b4('0x42')](_[_0xb2b4('0x4b')](_0x3766f5['query'],_0x1d9c1b['filters']),_0x29cebd);if(_0x3766f5[_0xb2b4('0x40')]['filter']){_0x1781f5[_0xb2b4('0x4a')]=_[_0xb2b4('0x4c')](_0x1781f5[_0xb2b4('0x4a')],{'$or':_[_0xb2b4('0x3a')](_0x29cebd,function(_0x341de9){if(_0x341de9[_0xb2b4('0x3d')]!==_0xb2b4('0x4d')){var _0x37bc8e={};_0x37bc8e[_0x341de9[_0xb2b4('0x37')]]={'$like':'%'+_0x3766f5[_0xb2b4('0x40')][_0xb2b4('0x4e')]+'%'};return _0x37bc8e;}})});}_0x1781f5=_['merge']({},_0x1781f5,_0x3766f5[_0xb2b4('0x4f')]);var _0x2931bc={'where':_0x1781f5[_0xb2b4('0x4a')]};return db[_0xb2b4('0x3b')]['count'](_0x2931bc)[_0xb2b4('0x1e')](function(_0x214faf){_0x3f50cd[_0xb2b4('0x2d')]=_0x214faf;if(_0x3766f5[_0xb2b4('0x40')][_0xb2b4('0x50')]){_0x1781f5[_0xb2b4('0x51')]=[{'all':!![]}];}return db[_0xb2b4('0x3b')][_0xb2b4('0x52')](_0x1781f5);})[_0xb2b4('0x1e')](function(_0x272450){_0x3f50cd[_0xb2b4('0x53')]=_0x272450;return _0x3f50cd;})[_0xb2b4('0x1e')](respondWithFilteredResult(_0x5876d1,_0x1781f5))[_0xb2b4('0x27')](handleError(_0x5876d1,null));};exports[_0xb2b4('0x54')]=function(_0x4b7ce8,_0x27c236){var _0x4d8ad2={'raw':![],'where':{'id':_0x4b7ce8['params']['id']},'include':[{'model':db['Pause'],'as':_0xb2b4('0x55')}]},_0xbb3c1={};_0xbb3c1[_0xb2b4('0x3f')]=_['keys'](db[_0xb2b4('0x3b')]['rawAttributes']);_0xbb3c1[_0xb2b4('0x40')]=_[_0xb2b4('0x41')](_0x4b7ce8[_0xb2b4('0x40')]);_0xbb3c1['filters']=_[_0xb2b4('0x43')](_0xbb3c1[_0xb2b4('0x3f')],_0xbb3c1['query']);_0x4d8ad2[_0xb2b4('0x44')]=_['intersection'](_0xbb3c1[_0xb2b4('0x3f')],qs[_0xb2b4('0x45')](_0x4b7ce8['query'][_0xb2b4('0x45')]));_0x4d8ad2[_0xb2b4('0x44')]=_0x4d8ad2['attributes'][_0xb2b4('0x56')]?_0x4d8ad2[_0xb2b4('0x44')]:_0xbb3c1[_0xb2b4('0x3f')];if(_0x4b7ce8[_0xb2b4('0x40')][_0xb2b4('0x50')]){_0x4d8ad2[_0xb2b4('0x51')]=[{'all':!![]}];}_0x4d8ad2=_['merge']({},_0x4d8ad2,_0x4b7ce8[_0xb2b4('0x4f')]);return db[_0xb2b4('0x3b')][_0xb2b4('0x57')](_0x4d8ad2)[_0xb2b4('0x1e')](handleEntityNotFound(_0x27c236,null))['then'](respondWithResult(_0x27c236,null))['catch'](handleError(_0x27c236,null));};exports[_0xb2b4('0x58')]=function(_0x3cf29d,_0x4a18cf){return db[_0xb2b4('0x3b')]['create'](_0x3cf29d[_0xb2b4('0x59')],{})[_0xb2b4('0x1e')](function(_0x2cc240){var _0x154c9d=_0x3cf29d[_0xb2b4('0x5a')][_0xb2b4('0x33')]({'plain':!![]});if(!_0x154c9d)throw new Error(_0xb2b4('0x5b'));if(_0x154c9d[_0xb2b4('0x5c')]===_0xb2b4('0x5a')){var _0x477f42=_0x2cc240[_0xb2b4('0x33')]({'plain':!![]});var _0x534cd1=_0xb2b4('0x34');return db[_0xb2b4('0x5d')]['find']({'where':{'name':_0x534cd1,'userProfileId':_0x154c9d[_0xb2b4('0x5e')]},'raw':!![]})['then'](function(_0x4f5c9a){if(_0x4f5c9a&&_0x4f5c9a[_0xb2b4('0x5f')]===0x0){return db[_0xb2b4('0x35')][_0xb2b4('0x58')]({'name':_0x477f42[_0xb2b4('0x37')],'resourceId':_0x477f42['id'],'type':_0x4f5c9a[_0xb2b4('0x37')],'sectionId':_0x4f5c9a['id']},{})[_0xb2b4('0x1e')](function(){return _0x2cc240;});}else{return _0x2cc240;}})[_0xb2b4('0x27')](function(_0x5eebff){logger[_0xb2b4('0x24')](_0xb2b4('0x60'),_0x5eebff);throw _0x5eebff;});}return _0x2cc240;})[_0xb2b4('0x1e')](respondWithResult(_0x4a18cf,0xc9))[_0xb2b4('0x27')](handleError(_0x4a18cf,null));};exports[_0xb2b4('0x32')]=function(_0xbac495,_0x4b40e2){if(_0xbac495[_0xb2b4('0x59')]['id']){delete _0xbac495[_0xb2b4('0x59')]['id'];}return db[_0xb2b4('0x3b')][_0xb2b4('0x57')]({'where':{'id':_0xbac495[_0xb2b4('0x61')]['id']},'include':[{'model':db[_0xb2b4('0x62')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4b40e2,null))['then'](saveUpdates(_0xbac495['body'],null))[_0xb2b4('0x1e')](respondWithResult(_0x4b40e2,null))[_0xb2b4('0x27')](handleError(_0x4b40e2,null));};exports[_0xb2b4('0x36')]=function(_0x536209,_0x301d27){return db[_0xb2b4('0x3b')]['find']({'where':{'id':_0x536209[_0xb2b4('0x61')]['id']}})[_0xb2b4('0x1e')](handleEntityNotFound(_0x301d27,null))['then'](removeEntity(_0x301d27,null))['catch'](handleError(_0x301d27,null));};exports[_0xb2b4('0x63')]=function(_0x4bc7ba,_0x44883b){return db['SmsAccount'][_0xb2b4('0x63')]()['then'](respondWithResult(_0x44883b,null))[_0xb2b4('0x27')](handleError(_0x44883b,null));};exports['addDisposition']=function(_0x1c7211,_0x386b37,_0x2727de){if(_0x1c7211[_0xb2b4('0x59')]['id']){delete _0x1c7211[_0xb2b4('0x59')]['id'];}return db[_0xb2b4('0x3b')][_0xb2b4('0x57')]({'where':{'id':_0x1c7211[_0xb2b4('0x61')]['id']}})['then'](handleEntityNotFound(_0x386b37,null))[_0xb2b4('0x1e')](function(_0x5c5a0f){if(_0x5c5a0f){_0x1c7211[_0xb2b4('0x59')][_0xb2b4('0x64')]=_0x5c5a0f['id'];return db[_0xb2b4('0x65')][_0xb2b4('0x58')](_0x1c7211[_0xb2b4('0x59')]);}})[_0xb2b4('0x1e')](respondWithResult(_0x386b37,null))[_0xb2b4('0x27')](handleError(_0x386b37,null));};exports[_0xb2b4('0x66')]=function(_0x84e6d8,_0x4d6103,_0xd4ae8d){var _0x2d22ca={'raw':![],'where':{}};var _0x3dcce1={};var _0xd5d845={'count':0x0,'rows':[]};return db[_0xb2b4('0x3b')]['findOne']({'where':{'id':_0x84e6d8[_0xb2b4('0x61')]['id']}})[_0xb2b4('0x1e')](handleEntityNotFound(_0x4d6103,null))[_0xb2b4('0x1e')](function(_0x513273){if(_0x513273){_0x3dcce1[_0xb2b4('0x3f')]=_[_0xb2b4('0x41')](db[_0xb2b4('0x65')]['rawAttributes']);_0x3dcce1[_0xb2b4('0x40')]=_['keys'](_0x84e6d8[_0xb2b4('0x40')]);_0x3dcce1[_0xb2b4('0x42')]=_[_0xb2b4('0x43')](_0x3dcce1[_0xb2b4('0x3f')],_0x3dcce1[_0xb2b4('0x40')]);_0x2d22ca[_0xb2b4('0x44')]=_[_0xb2b4('0x43')](_0x3dcce1[_0xb2b4('0x3f')],qs[_0xb2b4('0x45')](_0x84e6d8[_0xb2b4('0x40')][_0xb2b4('0x45')]));_0x2d22ca[_0xb2b4('0x44')]=_0x2d22ca[_0xb2b4('0x44')]['length']?_0x2d22ca[_0xb2b4('0x44')]:_0x3dcce1[_0xb2b4('0x3f')];if(!_0x84e6d8['query']['hasOwnProperty'](_0xb2b4('0x47'))){_0x2d22ca['limit']=qs[_0xb2b4('0x2e')](_0x84e6d8[_0xb2b4('0x40')][_0xb2b4('0x2e')]);_0x2d22ca['offset']=qs[_0xb2b4('0x2c')](_0x84e6d8[_0xb2b4('0x40')][_0xb2b4('0x2c')]);}_0x2d22ca[_0xb2b4('0x48')]=qs[_0xb2b4('0x49')](_0x84e6d8[_0xb2b4('0x40')][_0xb2b4('0x49')]);_0x2d22ca[_0xb2b4('0x4a')]=qs[_0xb2b4('0x42')](_[_0xb2b4('0x4b')](_0x84e6d8[_0xb2b4('0x40')],_0x3dcce1[_0xb2b4('0x42')]));_0x2d22ca[_0xb2b4('0x4a')][_0xb2b4('0x64')]=_0x513273['id'];if(_0x84e6d8['query'][_0xb2b4('0x4e')]){_0x2d22ca[_0xb2b4('0x4a')]=_['merge'](_0x2d22ca[_0xb2b4('0x4a')],{'$or':_[_0xb2b4('0x3a')](_0x2d22ca[_0xb2b4('0x44')],function(_0x3420ee){var _0x1a3ca3={};_0x1a3ca3[_0x3420ee]={'$like':'%'+_0x84e6d8['query'][_0xb2b4('0x4e')]+'%'};return _0x1a3ca3;})});}_0x2d22ca=_[_0xb2b4('0x4c')]({},_0x2d22ca,_0x84e6d8[_0xb2b4('0x4f')]);return db[_0xb2b4('0x65')][_0xb2b4('0x2d')]({'where':_0x2d22ca[_0xb2b4('0x4a')]})['then'](function(_0x43d604){_0xd5d845[_0xb2b4('0x2d')]=_0x43d604;if(_0x84e6d8['query'][_0xb2b4('0x50')]){_0x2d22ca[_0xb2b4('0x51')]=[{'all':!![]}];}return db[_0xb2b4('0x65')][_0xb2b4('0x52')](_0x2d22ca);})[_0xb2b4('0x1e')](function(_0x490c2d){_0xd5d845[_0xb2b4('0x53')]=_0x490c2d;return _0xd5d845;});}})[_0xb2b4('0x1e')](respondWithFilteredResult(_0x4d6103,_0x2d22ca))[_0xb2b4('0x27')](handleError(_0x4d6103,null));};exports[_0xb2b4('0x67')]=function(_0xf8cfee,_0x15efe0,_0xd3c1e6){return db[_0xb2b4('0x3b')][_0xb2b4('0x57')]({'where':{'id':_0xf8cfee[_0xb2b4('0x61')]['id']}})[_0xb2b4('0x1e')](handleEntityNotFound(_0x15efe0,null))[_0xb2b4('0x1e')](function(_0x3f26d3){if(_0x3f26d3){return _0x3f26d3[_0xb2b4('0x67')](_0xf8cfee[_0xb2b4('0x40')][_0xb2b4('0x68')]);}})[_0xb2b4('0x1e')](respondWithStatusCode(_0x15efe0,null))['catch'](handleError(_0x15efe0,null));};exports[_0xb2b4('0x69')]=function(_0x2395c4,_0x7d1019,_0x4be8e8){if(_0x2395c4[_0xb2b4('0x59')]['id']){delete _0x2395c4[_0xb2b4('0x59')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x2395c4[_0xb2b4('0x61')]['id']}})[_0xb2b4('0x1e')](handleEntityNotFound(_0x7d1019,null))[_0xb2b4('0x1e')](function(_0x4c7be7){if(_0x4c7be7){_0x2395c4[_0xb2b4('0x59')]['SmsAccountId']=_0x4c7be7['id'];return db['CannedAnswer'][_0xb2b4('0x58')](_0x2395c4[_0xb2b4('0x59')]);}})[_0xb2b4('0x1e')](respondWithResult(_0x7d1019,null))[_0xb2b4('0x27')](handleError(_0x7d1019,null));};exports['getAnswers']=function(_0x1b31bf,_0x274df8,_0x2f1caa){var _0x2d2beb={'raw':![],'where':{}};var _0x500c90={};var _0x3825b4={'count':0x0,'rows':[]};return db[_0xb2b4('0x3b')][_0xb2b4('0x6a')]({'where':{'id':_0x1b31bf[_0xb2b4('0x61')]['id']}})['then'](handleEntityNotFound(_0x274df8,null))[_0xb2b4('0x1e')](function(_0x4dd900){if(_0x4dd900){_0x500c90['model']=_[_0xb2b4('0x41')](db[_0xb2b4('0x6b')][_0xb2b4('0x6c')]);_0x500c90['query']=_[_0xb2b4('0x41')](_0x1b31bf[_0xb2b4('0x40')]);_0x500c90[_0xb2b4('0x42')]=_['intersection'](_0x500c90[_0xb2b4('0x3f')],_0x500c90[_0xb2b4('0x40')]);_0x2d2beb[_0xb2b4('0x44')]=_['intersection'](_0x500c90[_0xb2b4('0x3f')],qs[_0xb2b4('0x45')](_0x1b31bf['query'][_0xb2b4('0x45')]));_0x2d2beb['attributes']=_0x2d2beb[_0xb2b4('0x44')][_0xb2b4('0x56')]?_0x2d2beb['attributes']:_0x500c90['model'];if(!_0x1b31bf['query'][_0xb2b4('0x46')]('nolimit')){_0x2d2beb[_0xb2b4('0x2e')]=qs[_0xb2b4('0x2e')](_0x1b31bf['query'][_0xb2b4('0x2e')]);_0x2d2beb[_0xb2b4('0x2c')]=qs[_0xb2b4('0x2c')](_0x1b31bf[_0xb2b4('0x40')][_0xb2b4('0x2c')]);}_0x2d2beb[_0xb2b4('0x48')]=qs[_0xb2b4('0x49')](_0x1b31bf[_0xb2b4('0x40')][_0xb2b4('0x49')]);_0x2d2beb[_0xb2b4('0x4a')]=qs[_0xb2b4('0x42')](_[_0xb2b4('0x4b')](_0x1b31bf[_0xb2b4('0x40')],_0x500c90[_0xb2b4('0x42')]));_0x2d2beb[_0xb2b4('0x4a')][_0xb2b4('0x64')]=_0x4dd900['id'];if(_0x1b31bf[_0xb2b4('0x40')][_0xb2b4('0x4e')]){_0x2d2beb[_0xb2b4('0x4a')]=_[_0xb2b4('0x4c')](_0x2d2beb[_0xb2b4('0x4a')],{'$or':_['map'](_0x2d2beb[_0xb2b4('0x44')],function(_0x2eafb5){var _0x547fae={};_0x547fae[_0x2eafb5]={'$like':'%'+_0x1b31bf['query'][_0xb2b4('0x4e')]+'%'};return _0x547fae;})});}_0x2d2beb=_['merge']({},_0x2d2beb,_0x1b31bf['options']);return db[_0xb2b4('0x6b')]['count']({'where':_0x2d2beb['where']})[_0xb2b4('0x1e')](function(_0x483be1){_0x3825b4[_0xb2b4('0x2d')]=_0x483be1;if(_0x1b31bf['query'][_0xb2b4('0x50')]){_0x2d2beb[_0xb2b4('0x51')]=[{'all':!![]}];}return db[_0xb2b4('0x6b')][_0xb2b4('0x52')](_0x2d2beb);})[_0xb2b4('0x1e')](function(_0x147257){_0x3825b4['rows']=_0x147257;return _0x3825b4;});}})[_0xb2b4('0x1e')](respondWithFilteredResult(_0x274df8,_0x2d2beb))[_0xb2b4('0x27')](handleError(_0x274df8,null));};exports[_0xb2b4('0x6d')]=function(_0x15d572,_0xd3e963,_0x3260bd){return db[_0xb2b4('0x3b')][_0xb2b4('0x57')]({'where':{'id':_0x15d572[_0xb2b4('0x61')]['id']}})[_0xb2b4('0x1e')](handleEntityNotFound(_0xd3e963,null))[_0xb2b4('0x1e')](function(_0x2ff6f5){if(_0x2ff6f5){return _0x2ff6f5[_0xb2b4('0x6d')](_0x15d572['query'][_0xb2b4('0x68')]);}})[_0xb2b4('0x1e')](respondWithStatusCode(_0xd3e963,null))[_0xb2b4('0x27')](handleError(_0xd3e963,null));};exports[_0xb2b4('0x6e')]=function(_0x1c6842,_0x1185e8,_0x3cac8e){var _0x4c637a={'channel':'sms'};var _0x1a4dde=[];var _0x2d317b=[];var _0x43f18e={};return db[_0xb2b4('0x3b')][_0xb2b4('0x57')]({'where':{'id':_0x1c6842[_0xb2b4('0x61')]['id']},'include':[{'model':db[_0xb2b4('0x6f')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x1185e8,null))[_0xb2b4('0x1e')](function(_0x535d13){_0x4c637a[_0xb2b4('0x70')]=_0x535d13;_0x4c637a['applications']=_[_0xb2b4('0x71')](_0x535d13['Applications'],[_0xb2b4('0x72')],[_0xb2b4('0x73')]);if(_0x4c637a['account'][_0xb2b4('0x74')]){delete _0x4c637a['account'][_0xb2b4('0x74')];}return db[_0xb2b4('0x75')][_0xb2b4('0x63')]();})[_0xb2b4('0x1e')](function(_0x252dc5){if(!_0x252dc5){throw new db[(_0xb2b4('0x76'))][(_0xb2b4('0x77'))](_0xb2b4('0x78'));}_0x1a4dde=_[_0xb2b4('0x79')](_['keys'](_0x252dc5),['createdAt',_0xb2b4('0x7a')]);_0x2d317b=_[_0xb2b4('0x79')](_[_0xb2b4('0x41')](_0x252dc5),[_0xb2b4('0x7b'),_0xb2b4('0x7a'),_0xb2b4('0x7c'),'ListId']);_0x4c637a['body']={'mapKey':_0xb2b4('0x7d')};if(_0x4c637a['account']['type']){switch(_0x4c637a[_0xb2b4('0x70')]['type']){case _0xb2b4('0x7e'):_0x4c637a['body']['from']=_0x1c6842['body'][_0xb2b4('0x7f')];_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x59')]=_0x1c6842[_0xb2b4('0x59')][_0xb2b4('0x80')];_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x81')]=_0x1c6842[_0xb2b4('0x59')][_0xb2b4('0x82')];break;case _0xb2b4('0x83'):_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x84')]='+'+_0x1c6842['body'][_0xb2b4('0x85')];_0x4c637a[_0xb2b4('0x59')]['body']=_0x1c6842[_0xb2b4('0x59')]['text'];break;case _0xb2b4('0x86'):_0x4c637a['body'][_0xb2b4('0x84')]=_0x1c6842[_0xb2b4('0x59')][_0xb2b4('0x84')];_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x59')]=_0x1c6842[_0xb2b4('0x59')][_0xb2b4('0x25')];break;case _0xb2b4('0x87'):_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x84')]=_0x1c6842['body'][_0xb2b4('0x84')];_0x4c637a['body'][_0xb2b4('0x59')]=_0x1c6842[_0xb2b4('0x59')][_0xb2b4('0x59')];_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x81')]=_0x1c6842[_0xb2b4('0x59')][_0xb2b4('0x88')];break;case _0xb2b4('0x89'):_0x4c637a[_0xb2b4('0x59')]['from']=_0x1c6842[_0xb2b4('0x59')]['From'];_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x59')]=_0x1c6842[_0xb2b4('0x59')]['Text'];_0x4c637a['body'][_0xb2b4('0x81')]=_0x1c6842[_0xb2b4('0x59')][_0xb2b4('0x8a')];break;case'infobip':_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x84')]='+'+_0x1c6842[_0xb2b4('0x59')][_0xb2b4('0x8b')][0x0][_0xb2b4('0x84')];_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x59')]=_0x1c6842[_0xb2b4('0x59')][_0xb2b4('0x8b')][0x0][_0xb2b4('0x8c')];_0x4c637a['body'][_0xb2b4('0x81')]=_0x1c6842['body'][_0xb2b4('0x8b')][0x0][_0xb2b4('0x81')];break;case'csc':_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x84')]=_0x1c6842['body'][_0xb2b4('0x8d')];_0x4c637a[_0xb2b4('0x59')]['body']=_0x1c6842[_0xb2b4('0x59')][_0xb2b4('0x8e')][_0xb2b4('0x25')];break;case'clickatell':_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x84')]=_0x1c6842[_0xb2b4('0x59')][_0xb2b4('0x8f')];_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x59')]=_0x1c6842[_0xb2b4('0x59')][_0xb2b4('0x8c')];_0x4c637a[_0xb2b4('0x59')]['messageId']=_0x1c6842['body']['replyMessageId'];break;case'bandwidth':_0x4c637a['body'][_0xb2b4('0x81')]=_0x1c6842[_0xb2b4('0x59')][0x0][_0xb2b4('0x25')]['id'];_0x4c637a['body'][_0xb2b4('0x84')]=_0x1c6842[_0xb2b4('0x59')][0x0][_0xb2b4('0x25')][_0xb2b4('0x84')];_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x59')]=_0x1c6842[_0xb2b4('0x59')][0x0][_0xb2b4('0x25')][_0xb2b4('0x8c')];break;case _0xb2b4('0x90'):_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x84')]=_0x1c6842[_0xb2b4('0x59')][_0xb2b4('0x84')];_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x59')]=_0x1c6842[_0xb2b4('0x59')][_0xb2b4('0x25')];_0x4c637a['body'][_0xb2b4('0x81')]=_0x1c6842['body'][_0xb2b4('0x91')];break;}}if(_0x4c637a['body']['id']){delete _0x4c637a[_0xb2b4('0x59')]['id'];}if(_[_0xb2b4('0x92')](_0x4c637a[_0xb2b4('0x59')]['from'])){throw new db[(_0xb2b4('0x76'))][(_0xb2b4('0x77'))](_0xb2b4('0x93'));}if(_[_0xb2b4('0x92')](_0x4c637a['body']['body'])||_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x59')]===''){throw new db[(_0xb2b4('0x76'))][(_0xb2b4('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4c637a[_0xb2b4('0x59')]['mapKey'])){throw new db[(_0xb2b4('0x76'))][(_0xb2b4('0x77'))](_0xb2b4('0x94')+_0x2d317b);}if(!_[_0xb2b4('0x95')](_0x2d317b,_0x4c637a['body'][_0xb2b4('0x96')])){throw new db[(_0xb2b4('0x76'))][(_0xb2b4('0x77'))](_0xb2b4('0x97')+_0x2d317b);}_0x43f18e[_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x96')]]=_0x4c637a['body'][_0xb2b4('0x84')];return db[_0xb2b4('0x98')][_0xb2b4('0x57')]({'where':{'id':_0x4c637a['account'][_0xb2b4('0x99')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x43f18e,'limit':0x1,'order':[[_0xb2b4('0x7a'),'DESC']]}]});})[_0xb2b4('0x1e')](handleEntityNotFound(_0x1185e8,null))[_0xb2b4('0x1e')](function(_0x3061f0){if(_0x3061f0){_0x4c637a['list']=_['omit'](_0x3061f0,[_0xb2b4('0x9a')]);if(_0x3061f0[_0xb2b4('0x9a')][_0xb2b4('0x56')]){return _0x3061f0[_0xb2b4('0x9a')][0x0];}var _0x5551fe=_[_0xb2b4('0x19')](_0x4c637a[_0xb2b4('0x59')],{'firstName':_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x84')],'ListId':_0x3061f0['id']});_0x5551fe[_0x4c637a['body'][_0xb2b4('0x96')]]=_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x84')];return db['CmContact']['create'](_0x5551fe,{'fields':_0x1a4dde,'raw':!![]});}})['then'](handleEntityNotFound(_0x1185e8,null))['then'](function(_0x155709){if(_0x155709){_0x4c637a[_0xb2b4('0x9b')]=_0x155709;var _0x191da7={'ContactId':_0x155709['id'],'phone':_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x84')],'SmsAccountId':_0x1c6842[_0xb2b4('0x61')]['id']};var _0x39538c={'ContactId':_0x155709['id'],'SmsAccountId':_0x1c6842[_0xb2b4('0x61')]['id'],'closed':![]};return db[_0xb2b4('0x9c')][_0xb2b4('0x57')]({'where':_0x39538c})['then'](function(_0x2fbe8c){if(_0x2fbe8c){return[_0x2fbe8c,![]];}return db[_0xb2b4('0x9c')][_0xb2b4('0x58')](_0x191da7)['then'](function(_0x461ccb){return[_0x461ccb,!![]];});});}})[_0xb2b4('0x9d')](function(_0x476c12,_0xcabc8){_0x4c637a['interaction']=_0x476c12[_0xb2b4('0x33')]({'plain':!![]});_0x4c637a[_0xb2b4('0x9e')][_0xb2b4('0x9f')]=![];if(_0xcabc8){if(_0x4c637a['account']['autoclose']){_0x4c637a[_0xb2b4('0xa0')][_0xb2b4('0xa1')]({'id':0x0,'priority':_0x4c637a[_0xb2b4('0xa0')][_0xb2b4('0x56')]+0x1,'app':_0xb2b4('0xa2'),'appdata':'unmanaged','interval':_0xb2b4('0xa3')});}_0x4c637a[_0xb2b4('0x9e')][_0xb2b4('0x9f')]=!![];}return db[_0xb2b4('0xa4')][_0xb2b4('0x58')]({'phone':_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x84')],'messageId':_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x81')],'body':_0x4c637a[_0xb2b4('0x59')][_0xb2b4('0x59')],'SmsAccountId':_0x1c6842[_0xb2b4('0x61')]['id'],'SmsInteractionId':_0x476c12['id'],'direction':'in','ContactId':_0x476c12[_0xb2b4('0xa5')],'AttachmentId':_0x4c637a[_0xb2b4('0x59')]['AttachmentId']});})[_0xb2b4('0x1e')](function(_0x5c83b6){_0x4c637a[_0xb2b4('0x25')]=_0x5c83b6;if(_0x4c637a['interaction'][_0xb2b4('0xa6')]){return db[_0xb2b4('0xa7')][_0xb2b4('0x57')]({'attributes':['id',_0xb2b4('0x37')],'where':{'id':_0x4c637a[_0xb2b4('0x9e')][_0xb2b4('0xa6')]}})['then'](function(_0x5c49d5){if(_0x5c49d5){_0x4c637a[_0xb2b4('0xa0')][_0xb2b4('0xa8')]({'id':0x0,'priority':0x0,'app':_0xb2b4('0xa9'),'appdata':_0x5c49d5[_0xb2b4('0x37')]+','+(_0x4c637a['account'][_0xb2b4('0xaa')]||0xa),'interval':_0xb2b4('0xa3')});}return respondWithRpcPromise(_0xb2b4('0xab'),'startRouting',_0x4c637a);});}return respondWithRpcPromise(_0xb2b4('0xab'),'startRouting',_0x4c637a);})[_0xb2b4('0x1e')](function(_0x22b261){if(_0x22b261){var _0x17c560=0xc8;var _0x27dbb6='receiveMessage';logger['info'](_0xb2b4('0x22'),_0x27dbb6,_0x17c560,_0xb2b4('0xac'));logger[_0xb2b4('0x21')](_0xb2b4('0xad'),_0x27dbb6,_0x17c560,_0xb2b4('0xac'),JSON[_0xb2b4('0x23')](_0x22b261));if(_0x4c637a[_0xb2b4('0x70')][_0xb2b4('0x3d')]===_0xb2b4('0x7e')){return _0x1185e8[_0xb2b4('0x29')](_0x17c560)[_0xb2b4('0xae')](_0xb2b4('0xaf'),'text/xml')[_0xb2b4('0x38')](_0xb2b4('0xb0'));}else{return _0x1185e8[_0xb2b4('0x29')](_0x17c560)['json'](_0x22b261);}}})[_0xb2b4('0x27')](handleError(_0x1185e8,null));};exports[_0xb2b4('0xb1')]=function(_0x1541c4,_0x47caa6){var _0x59696b=_0x1541c4[_0xb2b4('0x61')]['id'];var _0x2741f0=_0x1541c4[_0xb2b4('0x59')];var _0x241af0=0xc8;var _0x40202a=null;return db[_0xb2b4('0xb2')][_0xb2b4('0xb3')]({'isolationLevel':db['sequelize'][_0xb2b4('0xb4')][_0xb2b4('0xb5')]['READ_COMMITTED']},function(_0x1f3250){return db['SmsAccount'][_0xb2b4('0x6a')]({'where':{'id':_0x59696b},'transaction':_0x1f3250})[_0xb2b4('0x1e')](function(_0x275c49){if(_0x275c49){return db['SmsApplication'][_0xb2b4('0x36')]({'where':{'SmsAccountId':_0x59696b},'transaction':_0x1f3250})[_0xb2b4('0x1e')](function(){var _0x104f46=_[_0xb2b4('0x3a')](_0x2741f0,function(_0x5a2441){_0x5a2441[_0xb2b4('0x64')]=_0x59696b;return _0x5a2441;});return db[_0xb2b4('0x6f')]['bulkCreate'](_0x104f46,{'transaction':_0x1f3250});});}else{_0x241af0=0x194;_0x40202a=[];}});})[_0xb2b4('0x1e')](function(){if(_0x241af0!==0x194){return db[_0xb2b4('0x6f')][_0xb2b4('0xb6')]({'where':{'SmsAccountId':_0x59696b},'order':_0xb2b4('0x72')})[_0xb2b4('0x1e')](function(_0x5cb11e){_0x40202a=_0x5cb11e;});}})[_0xb2b4('0x27')](function(_0x57f686){_0x241af0=0x1f4;logger[_0xb2b4('0x24')](_0x57f686[_0xb2b4('0xb7')]);if(_0x57f686[_0xb2b4('0x37')]){delete _0x57f686[_0xb2b4('0x37')];}_0x40202a=_0x57f686;})[_0xb2b4('0xb8')](function(){if(_0x40202a===null){_0x47caa6[_0xb2b4('0x28')](_0x241af0);}else{if(_0x241af0===0x1f4){_0x47caa6[_0xb2b4('0x29')](_0x241af0)[_0xb2b4('0x38')](_0x40202a);}else{_0x47caa6[_0xb2b4('0x29')](_0x241af0)[_0xb2b4('0x2b')](_0x40202a);}}});};exports[_0xb2b4('0xb9')]=function(_0x34d858,_0x45540e,_0x4d8376){var _0x30eef2={};var _0x443c81={};var _0x167ca7;var _0x2c1603;return db[_0xb2b4('0x3b')]['findOne']({'where':{'id':_0x34d858[_0xb2b4('0x61')]['id']}})[_0xb2b4('0x1e')](handleEntityNotFound(_0x45540e,null))[_0xb2b4('0x1e')](function(_0x52d11a){if(_0x52d11a){_0x167ca7=_0x52d11a;_0x443c81['model']=_[_0xb2b4('0x41')](db[_0xb2b4('0x6f')][_0xb2b4('0x6c')]);_0x443c81[_0xb2b4('0x40')]=_[_0xb2b4('0x41')](_0x34d858[_0xb2b4('0x40')]);_0x443c81['filters']=_[_0xb2b4('0x43')](_0x443c81[_0xb2b4('0x3f')],_0x443c81['query']);_0x30eef2[_0xb2b4('0x44')]=_[_0xb2b4('0x43')](_0x443c81['model'],qs['fields'](_0x34d858[_0xb2b4('0x40')][_0xb2b4('0x45')]));_0x30eef2[_0xb2b4('0x44')]=_0x30eef2[_0xb2b4('0x44')][_0xb2b4('0x56')]?_0x30eef2['attributes']:_0x443c81['model'];_0x30eef2['order']=qs[_0xb2b4('0x49')](_0x34d858[_0xb2b4('0x40')][_0xb2b4('0x49')]);_0x30eef2[_0xb2b4('0x4a')]=qs[_0xb2b4('0x42')](_[_0xb2b4('0x4b')](_0x34d858[_0xb2b4('0x40')],_0x443c81['filters']));if(_0x34d858['query'][_0xb2b4('0x4e')]){_0x30eef2['where']=_[_0xb2b4('0x4c')](_0x30eef2[_0xb2b4('0x4a')],{'$or':_[_0xb2b4('0x3a')](_0x30eef2[_0xb2b4('0x44')],function(_0x4e6cec){var _0x2e0edb={};_0x2e0edb[_0x4e6cec]={'$like':'%'+_0x34d858[_0xb2b4('0x40')][_0xb2b4('0x4e')]+'%'};return _0x2e0edb;})});}_0x30eef2=_[_0xb2b4('0x4c')]({},_0x30eef2,_0x34d858['options']);return _0x167ca7[_0xb2b4('0xb9')](_0x30eef2);}})[_0xb2b4('0x1e')](function(_0x679c0e){if(_0x679c0e){_0x2c1603=_0x679c0e[_0xb2b4('0x56')];if(!_0x34d858[_0xb2b4('0x40')]['hasOwnProperty']('nolimit')){_0x30eef2[_0xb2b4('0x2e')]=qs[_0xb2b4('0x2e')](_0x34d858[_0xb2b4('0x40')][_0xb2b4('0x2e')]);_0x30eef2[_0xb2b4('0x2c')]=qs[_0xb2b4('0x2c')](_0x34d858[_0xb2b4('0x40')][_0xb2b4('0x2c')]);}return _0x167ca7[_0xb2b4('0xb9')](_0x30eef2);}})['then'](function(_0x356bc0){if(_0x356bc0){return _0x356bc0?{'count':_0x2c1603,'rows':_0x356bc0}:null;}})[_0xb2b4('0x1e')](respondWithResult(_0x45540e,null))[_0xb2b4('0x27')](handleError(_0x45540e,null));};exports['getInteractions']=function(_0x1d8c84,_0x2bd171,_0x586931){var _0xea1191={'raw':![],'where':{}};var _0x4b872f={};var _0x441fc9={'count':0x0,'rows':[]};return db['SmsAccount'][_0xb2b4('0x6a')]({'where':{'id':_0x1d8c84[_0xb2b4('0x61')]['id']}})[_0xb2b4('0x1e')](handleEntityNotFound(_0x2bd171,null))[_0xb2b4('0x1e')](function(_0x2ee583){if(_0x2ee583){_0x4b872f[_0xb2b4('0x3f')]=_[_0xb2b4('0x41')](db[_0xb2b4('0x9c')]['rawAttributes']);_0x4b872f['query']=_['keys'](_0x1d8c84['query']);_0x4b872f[_0xb2b4('0x42')]=_[_0xb2b4('0x43')](_0x4b872f['model'],_0x4b872f['query']);_0xea1191[_0xb2b4('0x44')]=_['intersection'](_0x4b872f['model'],qs[_0xb2b4('0x45')](_0x1d8c84[_0xb2b4('0x40')][_0xb2b4('0x45')]));_0xea1191[_0xb2b4('0x44')]=_0xea1191[_0xb2b4('0x44')][_0xb2b4('0x56')]?_0xea1191[_0xb2b4('0x44')]:_0x4b872f[_0xb2b4('0x3f')];if(!_0x1d8c84[_0xb2b4('0x40')][_0xb2b4('0x46')](_0xb2b4('0x47'))){_0xea1191[_0xb2b4('0x2e')]=qs['limit'](_0x1d8c84[_0xb2b4('0x40')][_0xb2b4('0x2e')]);_0xea1191[_0xb2b4('0x2c')]=qs[_0xb2b4('0x2c')](_0x1d8c84[_0xb2b4('0x40')][_0xb2b4('0x2c')]);}_0xea1191[_0xb2b4('0x48')]=qs[_0xb2b4('0x49')](_0x1d8c84[_0xb2b4('0x40')][_0xb2b4('0x49')]);_0xea1191[_0xb2b4('0x4a')]=qs[_0xb2b4('0x42')](_[_0xb2b4('0x4b')](_0x1d8c84[_0xb2b4('0x40')],_0x4b872f[_0xb2b4('0x42')]));_0xea1191['where']['SmsAccountId']=_0x2ee583['id'];if(_0x1d8c84[_0xb2b4('0x40')]['filter']){_0xea1191[_0xb2b4('0x4a')]=_[_0xb2b4('0x4c')](_0xea1191[_0xb2b4('0x4a')],{'$or':_[_0xb2b4('0x3a')](_0xea1191[_0xb2b4('0x44')],function(_0x54e576){var _0x1de473={};_0x1de473[_0x54e576]={'$like':'%'+_0x1d8c84['query'][_0xb2b4('0x4e')]+'%'};return _0x1de473;})});}_0xea1191=_[_0xb2b4('0x4c')]({},_0xea1191,_0x1d8c84['options']);return db[_0xb2b4('0x9c')][_0xb2b4('0x2d')]({'where':_0xea1191[_0xb2b4('0x4a')]})[_0xb2b4('0x1e')](function(_0x544b8c){_0x441fc9[_0xb2b4('0x2d')]=_0x544b8c;if(_0x1d8c84[_0xb2b4('0x40')]['includeAll']){_0xea1191[_0xb2b4('0x51')]=[{'model':db[_0xb2b4('0x75')],'as':_0xb2b4('0xba'),'required':![]},{'model':db[_0xb2b4('0xa7')],'as':_0xb2b4('0xbb'),'attributes':['name',_0xb2b4('0xbc'),_0xb2b4('0xbd')],'required':![]},{'model':db[_0xb2b4('0xbe')],'as':_0xb2b4('0xbf'),'attributes':['id',_0xb2b4('0x37'),_0xb2b4('0xc0')],'where':_0x1d8c84[_0xb2b4('0x40')][_0xb2b4('0xc1')]?{'id':_0x1d8c84[_0xb2b4('0x40')]['tag']}:undefined,'required':_0x1d8c84[_0xb2b4('0x40')][_0xb2b4('0xc1')]?!![]:![]}];}return db['SmsInteraction'][_0xb2b4('0x52')](_0xea1191);})[_0xb2b4('0x1e')](function(_0x54516c){_0x441fc9[_0xb2b4('0x53')]=_0x54516c;return _0x441fc9;});}})[_0xb2b4('0x1e')](respondWithFilteredResult(_0x2bd171,_0xea1191))[_0xb2b4('0x27')](handleError(_0x2bd171,null));};exports['send']=function(_0x557cd0,_0x2ab3aa,_0x5a78ea){var _0xcca782,_0x5f078e,_0x1f345e;if(_[_0xb2b4('0x92')](_0x557cd0[_0xb2b4('0x59')][_0xb2b4('0x59')])||_0x557cd0['body'][_0xb2b4('0x59')]===''){throw new db['Sequelize'][(_0xb2b4('0x77'))](_0xb2b4('0xc2'));}if(_['isNil'](_0x557cd0['body']['to'])){throw new db[(_0xb2b4('0x76'))][(_0xb2b4('0x77'))]('to\x20is\x20mandatory');}_0xcca782=_0x557cd0[_0xb2b4('0x59')]['to'];return db['SmsAccount'][_0xb2b4('0x57')]({'where':{'id':_0x557cd0[_0xb2b4('0x61')]['id']},'include':[{'model':db[_0xb2b4('0x98')],'as':'List','include':[{'model':db[_0xb2b4('0x75')],'as':_0xb2b4('0x9a'),'where':{'mobile':_0xcca782},'limit':0x1,'order':[['updatedAt',_0xb2b4('0xc3')]]}]}]})[_0xb2b4('0x1e')](handleEntityNotFound(_0x2ab3aa,null))[_0xb2b4('0x1e')](function(_0x1430a0){if(_0x1430a0&&_0x1430a0[_0xb2b4('0xc4')]){_0x5f078e=_0x1430a0['get']({'plain':!![]});if(_0x5f078e[_0xb2b4('0xc4')]&&_0x5f078e[_0xb2b4('0xc4')][_0xb2b4('0x9a')][_0xb2b4('0x56')]){return _0x5f078e['List'][_0xb2b4('0x9a')][0x0];}return db[_0xb2b4('0x75')][_0xb2b4('0x58')](_[_0xb2b4('0x19')](_0x557cd0[_0xb2b4('0x59')],{'firstName':_0xcca782,'mobile':_0xcca782,'phone':_0xcca782,'ListId':_0x5f078e[_0xb2b4('0x99')]}));}})['then'](handleEntityNotFound(_0x2ab3aa,null))[_0xb2b4('0x1e')](function(_0x402daa){if(_0x402daa){_0x1f345e=_0x402daa;return db[_0xb2b4('0x9c')][_0xb2b4('0x57')]({'where':{'ContactId':_0x1f345e['id'],'closed':![],'SmsAccountId':_0x5f078e['id']}})[_0xb2b4('0x1e')](function(_0x332ff4){if(_0x332ff4){return[_0x332ff4,![]];}return db[_0xb2b4('0x9c')]['create']({'UserId':_0x557cd0['user']['id'],'ContactId':_0x1f345e['id'],'SmsAccountId':_0x5f078e['id'],'phone':_0xcca782,'firstMsgDirection':_0xb2b4('0xc5'),'Messages':[_[_0xb2b4('0x4c')](_0x557cd0[_0xb2b4('0x59')],{'read':![],'body':_0x557cd0[_0xb2b4('0x59')][_0xb2b4('0x59')],'phone':_0xcca782,'SmsAccountId':_0x5f078e['id'],'UserId':_0x557cd0[_0xb2b4('0x5a')]['id'],'ContactId':_0x1f345e['id']})]},{'include':[{'model':db[_0xb2b4('0xa4')],'as':'Messages'}]})[_0xb2b4('0x1e')](function(_0x2096b0){return[_0x2096b0,!![]];});});}})[_0xb2b4('0x9d')](function(_0x16374f,_0x56258b){if(_0x56258b){return _0x16374f;}return db[_0xb2b4('0xa4')][_0xb2b4('0x58')](_[_0xb2b4('0x4c')](_0x557cd0['body'],{'read':![],'body':_0x557cd0[_0xb2b4('0x59')]['body'],'phone':_0xcca782,'SmsAccountId':_0x5f078e['id'],'SmsInteractionId':_0x16374f['id'],'UserId':_0x557cd0[_0xb2b4('0x5a')]['id'],'ContactId':_0x1f345e['id']}))[_0xb2b4('0x1e')](function(_0x198145){_0x16374f[_0xb2b4('0xc6')][_0xb2b4('0xc7')]=[];_0x16374f[_0xb2b4('0xc6')][_0xb2b4('0xc7')][_0xb2b4('0xa1')](_0x198145['dataValues']);return _0x16374f;});})[_0xb2b4('0x1e')](respondWithResult(_0x2ab3aa,null))[_0xb2b4('0x27')](handleError(_0x2ab3aa,null));};exports[_0xb2b4('0x29')]=function(_0x361ee7,_0x224bfb,_0x4fbb29){if(_0x361ee7[_0xb2b4('0x59')]['id']){delete _0x361ee7[_0xb2b4('0x59')]['id'];}var _0x1ede56,_0x457b49,_0x4604e4;return db[_0xb2b4('0x3b')][_0xb2b4('0x57')]({'where':{'id':_0x361ee7[_0xb2b4('0x61')]['id']}})[_0xb2b4('0x1e')](handleEntityNotFound(_0x224bfb,null))[_0xb2b4('0x1e')](function(_0x5f1d7e){if(_0x5f1d7e){_0x4604e4=_0x5f1d7e;logger[_0xb2b4('0x21')](_0xb2b4('0x22'),_0xb2b4('0x29'),_0xb2b4('0xc8'),_0x5f1d7e[_0xb2b4('0x3d')],util[_0xb2b4('0xc9')](_0x361ee7['body'],{'showHidden':![],'depth':null}));switch(_0x5f1d7e[_0xb2b4('0x3d')]){case _0xb2b4('0x83'):if(_0x361ee7[_0xb2b4('0x59')][_0xb2b4('0xca')]&&_0x361ee7[_0xb2b4('0x59')][_0xb2b4('0x29')]){_0x457b49=_0x361ee7[_0xb2b4('0x59')]['status'];return db[_0xb2b4('0xa4')][_0xb2b4('0x57')]({'where':{'messageId':_0x361ee7[_0xb2b4('0x59')]['skebby_dispatch_id']}});}break;case _0xb2b4('0x86'):if(_0x361ee7[_0xb2b4('0x59')]['requestid']&&_0x361ee7[_0xb2b4('0x59')][_0xb2b4('0xcb')]){_0x457b49=_0x361ee7[_0xb2b4('0x59')][_0xb2b4('0xcb')];return db['SmsMessage']['find']({'where':{'messageId':_0x361ee7['body'][_0xb2b4('0xcc')]}});}break;case'clicksend':if(_0x361ee7['body']['message_id']&&_0x361ee7[_0xb2b4('0x59')][_0xb2b4('0xcd')]){_0x457b49=_0x361ee7[_0xb2b4('0x59')]['status_code'];return db[_0xb2b4('0xa4')][_0xb2b4('0x57')]({'where':{'messageId':_0x361ee7[_0xb2b4('0x59')][_0xb2b4('0x88')]}});}break;case _0xb2b4('0xce'):var _0xb2d0eb=_0x361ee7[_0xb2b4('0x59')]['results'][0x0];if(_0xb2d0eb[_0xb2b4('0x81')]&&_0xb2d0eb[_0xb2b4('0x29')][_0xb2b4('0xcf')]==='DELIVERED'){_0x457b49=_0xb2d0eb[_0xb2b4('0x29')][_0xb2b4('0xcf')];return db['SmsMessage'][_0xb2b4('0x57')]({'where':{'messageId':_0xb2d0eb[_0xb2b4('0x81')]}});}break;case _0xb2b4('0xd0'):if(_0x361ee7[_0xb2b4('0x59')][_0xb2b4('0x81')]&&_0x361ee7['body'][_0xb2b4('0x29')]){_0x457b49=_0x361ee7[_0xb2b4('0x59')][_0xb2b4('0x29')];return db[_0xb2b4('0xa4')][_0xb2b4('0x57')]({'where':{'messageId':_0x361ee7[_0xb2b4('0x59')][_0xb2b4('0x81')]}});}break;case _0xb2b4('0xd1'):if(_0x361ee7[_0xb2b4('0x59')][0x0][_0xb2b4('0x25')]['id']){_0x457b49=_0x361ee7[_0xb2b4('0x59')][0x0][_0xb2b4('0x3d')];return db['SmsMessage'][_0xb2b4('0x57')]({'where':{'messageId':_0x361ee7['body'][0x0][_0xb2b4('0x25')]['id']}});}break;case _0xb2b4('0x90'):if(_0x361ee7[_0xb2b4('0x59')][_0xb2b4('0xd2')]&&_0x361ee7[_0xb2b4('0x59')][_0xb2b4('0x29')]){_0x457b49=_0x361ee7['body'][_0xb2b4('0x29')];return db[_0xb2b4('0xa4')][_0xb2b4('0x57')]({'where':{'messageId':_0x361ee7[_0xb2b4('0x59')][_0xb2b4('0xd2')]}});}break;}}})[_0xb2b4('0x1e')](handleEntityNotFound(_0x224bfb,null))[_0xb2b4('0x1e')](function(_0x4a0ce5){if(_0x4a0ce5){_0x1ede56=_0x4a0ce5;switch(_0x4604e4[_0xb2b4('0x3d')]){case'skebby':if(_0x457b49===_0xb2b4('0xd3')){return _0x1ede56['update']({'read':!![]});}else{logger[_0xb2b4('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','skebby',util['inspect'](_0x361ee7[_0xb2b4('0x59')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x457b49==='1'){return _0x1ede56[_0xb2b4('0x32')]({'read':!![]});}else{logger['error'](_0xb2b4('0x22'),_0xb2b4('0x29'),_0xb2b4('0x83'),util[_0xb2b4('0xc9')](_0x361ee7[_0xb2b4('0x59')],{'showHidden':![],'depth':null}));}break;case _0xb2b4('0x87'):if(!_0x361ee7['body']['error_code']&&_0x457b49>=0xc8&&_0x457b49<=0xce){return _0x1ede56[_0xb2b4('0x32')]({'read':!![]});}else{logger['error'](_0xb2b4('0x22'),_0xb2b4('0x29'),_0xb2b4('0x87'),util[_0xb2b4('0xc9')](_0x361ee7[_0xb2b4('0x59')],{'showHidden':![],'depth':null}));}break;case _0xb2b4('0xce'):var _0x3d94eb=_0x361ee7[_0xb2b4('0x59')]['results'][0x0];if(_0x3d94eb['status']['groupName']==='DELIVERED'){return _0x1ede56[_0xb2b4('0x32')]({'read':!![]});}else{logger[_0xb2b4('0x24')](_0xb2b4('0x22'),_0xb2b4('0x29'),_0xb2b4('0xce'),util[_0xb2b4('0xc9')](_0x361ee7['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x457b49==_0xb2b4('0xd4')||_0x457b49==_0xb2b4('0xd5')){return _0x1ede56['update']({'read':!![]});}else{logger[_0xb2b4('0x24')](_0xb2b4('0x22'),_0xb2b4('0x29'),'clickatell',util[_0xb2b4('0xc9')](_0x361ee7['body'],{'showHidden':![],'depth':null}));}break;case _0xb2b4('0xd1'):if(_0x457b49==_0xb2b4('0xd6')){return _0x1ede56[_0xb2b4('0x32')]({'read':!![]});}else{logger['error'](_0xb2b4('0x22'),_0xb2b4('0x29'),'bandwidth',util[_0xb2b4('0xc9')](_0x361ee7[_0xb2b4('0x59')],{'showHidden':![],'depth':null}));}break;case _0xb2b4('0x90'):if(_0x457b49===_0xb2b4('0xd7')||_0x457b49===_0xb2b4('0xd8')){return _0x1ede56[_0xb2b4('0x32')]({'read':!![]});}else{logger[_0xb2b4('0x24')](_0xb2b4('0x22'),_0xb2b4('0x29'),_0xb2b4('0x90'),util['inspect'](_0x361ee7[_0xb2b4('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x1ede56;}})['then'](respondWithResult(_0x224bfb,null))[_0xb2b4('0x27')](handleError(_0x224bfb,null));};exports[_0xb2b4('0xd9')]=function(_0x2f0eb6,_0x45bf19,_0x581a06){var _0x338e74,_0xc61d85,_0x1b2dc8;return db['SmsAccount'][_0xb2b4('0x57')]({'where':{'id':_0x2f0eb6[_0xb2b4('0x61')]['id']}})[_0xb2b4('0x1e')](handleEntityNotFound(_0x45bf19,null))['then'](function(_0x21244e){if(_0x21244e){_0x1b2dc8=_0x21244e;logger[_0xb2b4('0x21')](_0xb2b4('0x22'),_0xb2b4('0x29'),'received\x20delivery\x20report\x20from',_0x21244e[_0xb2b4('0x3d')],util[_0xb2b4('0xc9')](_0x2f0eb6[_0xb2b4('0x40')],{'showHidden':![],'depth':null}));switch(_0x21244e[_0xb2b4('0x3d')]){case _0xb2b4('0xda'):if(_0x2f0eb6[_0xb2b4('0x40')][_0xb2b4('0xdb')]&&_0x2f0eb6[_0xb2b4('0x40')][_0xb2b4('0xdc')]){_0xc61d85=_0x2f0eb6[_0xb2b4('0x40')]['state'];return db[_0xb2b4('0xa4')][_0xb2b4('0x57')]({'where':{'messageId':_0x2f0eb6[_0xb2b4('0x40')]['message-id']}});}break;}}})[_0xb2b4('0x1e')](handleEntityNotFound(_0x45bf19,null))['then'](function(_0x18d84e){if(_0x18d84e){_0x338e74=_0x18d84e;switch(_0x1b2dc8[_0xb2b4('0x3d')]){case _0xb2b4('0xda'):if(_0xc61d85==='2'||_0xc61d85==='6'){return _0x338e74[_0xb2b4('0x32')]({'read':!![]});}else{logger[_0xb2b4('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb2b4('0x29'),_0xb2b4('0xda'),util['inspect'](_0x2f0eb6[_0xb2b4('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x338e74;}})['then'](respondWithResult(_0x45bf19,null))[_0xb2b4('0x27')](handleError(_0x45bf19,null));};exports['addAgents']=function(_0xca70a1,_0x2bf378,_0x58e098){return db[_0xb2b4('0x3b')]['find']({'where':{'id':_0xca70a1[_0xb2b4('0x61')]['id']}})[_0xb2b4('0x1e')](handleEntityNotFound(_0x2bf378,null))['then'](function(_0x2e8c48){if(_0x2e8c48){return _0x2e8c48[_0xb2b4('0xdd')](_0xca70a1[_0xb2b4('0x59')][_0xb2b4('0x68')],_['omit'](_0xca70a1[_0xb2b4('0x59')],[_0xb2b4('0x68'),'id'])||{})[_0xb2b4('0x9d')](function(_0x41066a){for(var _0x103456=0x0;_0x103456<_0xca70a1['body'][_0xb2b4('0x68')][_0xb2b4('0x56')];_0x103456+=0x1){socket[_0xb2b4('0xde')]('userSmsAccount:save',{'UserId':Number(_0xca70a1[_0xb2b4('0x59')][_0xb2b4('0x68')][_0x103456]),'SmsAccountId':Number(_0xca70a1['params']['id'])});}return _0x41066a;});}})[_0xb2b4('0x1e')](respondWithResult(_0x2bf378,null))[_0xb2b4('0x27')](handleError(_0x2bf378,null));};exports['removeAgents']=function(_0x104731,_0x6749b,_0x29a92d){return db['SmsAccount']['find']({'where':{'id':_0x104731[_0xb2b4('0x61')]['id']}})[_0xb2b4('0x1e')](handleEntityNotFound(_0x6749b,null))[_0xb2b4('0x1e')](function(_0x1ca157){if(_0x1ca157){return _0x1ca157[_0xb2b4('0xdf')](_0x104731[_0xb2b4('0x40')][_0xb2b4('0x68')])[_0xb2b4('0x1e')](function(){if(_['isArray'](_0x104731[_0xb2b4('0x40')]['ids'])){for(var _0x4063ff=0x0;_0x4063ff<_0x104731[_0xb2b4('0x40')][_0xb2b4('0x68')][_0xb2b4('0x56')];_0x4063ff+=0x1){socket[_0xb2b4('0xde')](_0xb2b4('0xe0'),{'UserId':Number(_0x104731[_0xb2b4('0x40')]['ids'][_0x4063ff]),'SmsAccountId':Number(_0x104731[_0xb2b4('0x61')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x104731['query']['ids']),'SmsAccountId':Number(_0x104731[_0xb2b4('0x61')]['id'])});}});}})[_0xb2b4('0x1e')](respondWithStatusCode(_0x6749b,null))[_0xb2b4('0x27')](handleError(_0x6749b,null));};exports[_0xb2b4('0xe1')]=function(_0x119e62,_0xea01c0,_0x1cb24c){var _0x13fc3f={};var _0x390847={};var _0x3b4be3;var _0x1da330;return db[_0xb2b4('0x3b')][_0xb2b4('0x6a')]({'where':{'id':_0x119e62['params']['id']}})['then'](handleEntityNotFound(_0xea01c0,null))[_0xb2b4('0x1e')](function(_0x382108){if(_0x382108){_0x3b4be3=_0x382108;_0x390847[_0xb2b4('0x3f')]=_[_0xb2b4('0x41')](db[_0xb2b4('0xa7')][_0xb2b4('0x6c')]);_0x390847[_0xb2b4('0x40')]=_[_0xb2b4('0x41')](_0x119e62[_0xb2b4('0x40')]);_0x390847[_0xb2b4('0x42')]=_['intersection'](_0x390847[_0xb2b4('0x3f')],_0x390847[_0xb2b4('0x40')]);_0x13fc3f['attributes']=_[_0xb2b4('0x43')](_0x390847[_0xb2b4('0x3f')],qs['fields'](_0x119e62[_0xb2b4('0x40')][_0xb2b4('0x45')]));_0x13fc3f[_0xb2b4('0x44')]=_0x13fc3f['attributes'][_0xb2b4('0x56')]?_0x13fc3f['attributes']:_0x390847['model'];_0x13fc3f['order']=qs[_0xb2b4('0x49')](_0x119e62['query'][_0xb2b4('0x49')]);_0x13fc3f[_0xb2b4('0x4a')]=qs['filters'](_[_0xb2b4('0x4b')](_0x119e62[_0xb2b4('0x40')],_0x390847['filters']));if(_0x119e62[_0xb2b4('0x40')][_0xb2b4('0x4e')]){_0x13fc3f[_0xb2b4('0x4a')]=_[_0xb2b4('0x4c')](_0x13fc3f[_0xb2b4('0x4a')],{'$or':_[_0xb2b4('0x3a')](_0x13fc3f['attributes'],function(_0x529753){var _0x1903a5={};_0x1903a5[_0x529753]={'$like':'%'+_0x119e62['query'][_0xb2b4('0x4e')]+'%'};return _0x1903a5;})});}_0x13fc3f=_[_0xb2b4('0x4c')]({},_0x13fc3f,_0x119e62['options']);return _0x3b4be3['getAgents'](_0x13fc3f);}})[_0xb2b4('0x1e')](function(_0x2e8ceb){if(_0x2e8ceb){_0x1da330=_0x2e8ceb[_0xb2b4('0x56')];if(!_0x119e62['query'][_0xb2b4('0x46')]('nolimit')){_0x13fc3f[_0xb2b4('0x2e')]=qs[_0xb2b4('0x2e')](_0x119e62[_0xb2b4('0x40')][_0xb2b4('0x2e')]);_0x13fc3f[_0xb2b4('0x2c')]=qs[_0xb2b4('0x2c')](_0x119e62[_0xb2b4('0x40')][_0xb2b4('0x2c')]);}return _0x3b4be3[_0xb2b4('0xe1')](_0x13fc3f);}})['then'](function(_0x4fb675){if(_0x4fb675){return _0x4fb675?{'count':_0x1da330,'rows':_0x4fb675}:null;}})[_0xb2b4('0x1e')](respondWithResult(_0xea01c0,null))['catch'](handleError(_0xea01c0,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 9a34808..6f346f8 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 _0xe5fe=['SmsAccount','setMaxListeners','save','update','remove','hasOwnProperty','events','../../mysqldb'];(function(_0x3c5203,_0x63fb03){var _0x46c93e=function(_0x593edd){while(--_0x593edd){_0x3c5203['push'](_0x3c5203['shift']());}};_0x46c93e(++_0x63fb03);}(_0xe5fe,0xe6));var _0xee5f=function(_0x70297b,_0x21dc91){_0x70297b=_0x70297b-0x0;var _0x37dbfc=_0xe5fe[_0x70297b];return _0x37dbfc;};'use strict';var EventEmitter=require(_0xee5f('0x0'));var SmsAccount=require(_0xee5f('0x1'))['db'][_0xee5f('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xee5f('0x3')](0x0);var events={'afterCreate':_0xee5f('0x4'),'afterUpdate':_0xee5f('0x5'),'afterDestroy':_0xee5f('0x6')};function emitEvent(_0x52e578){return function(_0x1fdb32,_0x526f41,_0x1c61a2){SmsAccountEvents['emit'](_0x52e578+':'+_0x1fdb32['id'],_0x1fdb32);SmsAccountEvents['emit'](_0x52e578,_0x1fdb32);_0x1c61a2(null);};}for(var e in events){if(events[_0xee5f('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xf854=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','save','update'];(function(_0x3256b1,_0x282acf){var _0x10177d=function(_0x292eab){while(--_0x292eab){_0x3256b1['push'](_0x3256b1['shift']());}};_0x10177d(++_0x282acf);}(_0xf854,0x127));var _0x4f85=function(_0x10b814,_0x1c6ecb){_0x10b814=_0x10b814-0x0;var _0x5c7191=_0xf854[_0x10b814];return _0x5c7191;};'use strict';var EventEmitter=require(_0x4f85('0x0'));var SmsAccount=require(_0x4f85('0x1'))['db'][_0x4f85('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f85('0x3'),'afterUpdate':_0x4f85('0x4'),'afterDestroy':_0x4f85('0x5')};function emitEvent(_0x1bcaee){return function(_0x1c6dd6,_0x12e26a,_0x3a6513){SmsAccountEvents[_0x4f85('0x6')](_0x1bcaee+':'+_0x1c6dd6['id'],_0x1c6dd6);SmsAccountEvents['emit'](_0x1bcaee,_0x1c6dd6);_0x3a6513(null);};}for(var e in events){if(events[_0x4f85('0x7')](e)){var event=events[e];SmsAccount[_0x4f85('0x8')](e,emitEvent(event));}}module[_0x4f85('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 34165b5..3a180a3 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 _0x5db0=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts'];(function(_0x1aeda2,_0x1217eb){var _0x32dc6d=function(_0x34a460){while(--_0x34a460){_0x1aeda2['push'](_0x1aeda2['shift']());}};_0x32dc6d(++_0x1217eb);}(_0x5db0,0x142));var _0x05db=function(_0x1f9402,_0x3a236c){_0x1f9402=_0x1f9402-0x0;var _0x230918=_0x5db0[_0x1f9402];return _0x230918;};'use strict';var _=require(_0x05db('0x0'));var util=require(_0x05db('0x1'));var logger=require('../../config/logger')(_0x05db('0x2'));var moment=require(_0x05db('0x3'));var BPromise=require(_0x05db('0x4'));var rp=require(_0x05db('0x5'));var fs=require('fs');var path=require(_0x05db('0x6'));var rimraf=require(_0x05db('0x7'));var config=require(_0x05db('0x8'));var attributes=require(_0x05db('0x9'));module[_0x05db('0xa')]=function(_0x22e736,_0x126ee5){return _0x22e736[_0x05db('0xb')](_0x05db('0xc'),attributes,{'tableName':_0x05db('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x183b=['request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','util','moment','bluebird'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x183b,0x189));var _0xb183=function(_0x4e8158,_0x12ce43){_0x4e8158=_0x4e8158-0x0;var _0x3d543b=_0x183b[_0x4e8158];return _0x3d543b;};'use strict';var _=require('lodash');var util=require(_0xb183('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb183('0x1'));var BPromise=require(_0xb183('0x2'));var rp=require(_0xb183('0x3'));var fs=require('fs');var path=require(_0xb183('0x4'));var rimraf=require(_0xb183('0x5'));var config=require(_0xb183('0x6'));var attributes=require(_0xb183('0x7'));module[_0xb183('0x8')]=function(_0x514618,_0xef41c0){return _0x514618[_0xb183('0x9')](_0xb183('0xa'),attributes,{'tableName':_0xb183('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 4b64775..f788625 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 _0x2061=['error','message','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','model','map','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x2061,0x147));var _0x1206=function(_0x1d222f,_0x35168f){_0x1d222f=_0x1d222f-0x0;var _0x188692=_0x2061[_0x1d222f];return _0x188692;};'use strict';var _=require('lodash');var util=require(_0x1206('0x0'));var moment=require(_0x1206('0x1'));var BPromise=require(_0x1206('0x2'));var rs=require(_0x1206('0x3'));var fs=require('fs');var Redis=require(_0x1206('0x4'));var db=require(_0x1206('0x5'))['db'];var utils=require(_0x1206('0x6'));var logger=require(_0x1206('0x7'))(_0x1206('0x8'));var config=require('../../config/environment');var jayson=require(_0x1206('0x9'));var client=jayson[_0x1206('0xa')][_0x1206('0xb')]({'port':0x232a});config[_0x1206('0xc')]=_[_0x1206('0xd')](config[_0x1206('0xc')],{'host':_0x1206('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')[_0x1206('0xf')](socket);function respondWithRpcPromise(_0x2c17d6,_0x413d7d,_0x143665){return new BPromise(function(_0x48a36d,_0xdc9ccb){return client[_0x1206('0x10')](_0x2c17d6,_0x143665)[_0x1206('0x11')](function(_0x4c6ea3){logger[_0x1206('0x12')](_0x1206('0x13'),_0x413d7d,'request\x20sent');logger[_0x1206('0x14')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x413d7d,_0x1206('0x15'),JSON[_0x1206('0x16')](_0x4c6ea3));if(_0x4c6ea3[_0x1206('0x17')]){if(_0x4c6ea3[_0x1206('0x17')]['code']===0x1f4){logger[_0x1206('0x17')](_0x1206('0x13'),_0x413d7d,_0x4c6ea3[_0x1206('0x17')][_0x1206('0x18')]);return _0xdc9ccb(_0x4c6ea3[_0x1206('0x17')][_0x1206('0x18')]);}logger[_0x1206('0x17')](_0x1206('0x13'),_0x413d7d,_0x4c6ea3[_0x1206('0x17')][_0x1206('0x18')]);return _0x48a36d(_0x4c6ea3['error']['message']);}else{logger['info'](_0x1206('0x13'),_0x413d7d,_0x1206('0x15'));_0x48a36d(_0x4c6ea3['result']['message']);}})[_0x1206('0x19')](function(_0x43a7d5){logger[_0x1206('0x17')]('SmsAccount,\x20%s,\x20%s',_0x413d7d,_0x43a7d5);_0xdc9ccb(_0x43a7d5);});});}exports[_0x1206('0x1a')]=function(_0x22935c){var _0xbf0170=this;return new Promise(function(_0x759910,_0x495637){return db[_0x1206('0x1b')][_0x1206('0x1c')]({'raw':_0x22935c[_0x1206('0x1d')]?_0x22935c['options']['raw']===undefined?!![]:![]:!![],'where':_0x22935c[_0x1206('0x1d')]?_0x22935c['options'][_0x1206('0x1e')]||null:null,'attributes':_0x22935c[_0x1206('0x1d')]?_0x22935c[_0x1206('0x1d')][_0x1206('0x1f')]||null:null,'include':_0x22935c[_0x1206('0x1d')]?_0x22935c[_0x1206('0x1d')]['include']?_['map'](_0x22935c[_0x1206('0x1d')][_0x1206('0x20')],function(_0xeef410){return{'model':db[_0xeef410[_0x1206('0x21')]],'as':_0xeef410['as'],'attributes':_0xeef410['attributes'],'include':_0xeef410[_0x1206('0x20')]?_['map'](_0xeef410[_0x1206('0x20')],function(_0x524af3){return{'model':db[_0x524af3['model']],'as':_0x524af3['as'],'attributes':_0x524af3['attributes'],'include':_0x524af3['include']?_[_0x1206('0x22')](_0x524af3[_0x1206('0x20')],function(_0x5bfd9d){return{'model':db[_0x5bfd9d[_0x1206('0x21')]],'as':_0x5bfd9d['as'],'attributes':_0x5bfd9d[_0x1206('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1206('0x11')](function(_0x3ea3c2){logger[_0x1206('0x12')](_0x1206('0x1a'),_0x22935c);logger[_0x1206('0x14')]('ShowSmsAccount',_0x22935c,JSON[_0x1206('0x16')](_0x3ea3c2));_0x759910(_0x3ea3c2);})['catch'](function(_0x4c4506){logger[_0x1206('0x17')]('ShowSmsAccount',_0x4c4506['message'],_0x22935c);_0x495637(_0xbf0170[_0x1206('0x17')](0x1f4,_0x4c4506[_0x1206('0x18')]));});});}; \ No newline at end of file +var _0x0a86=['model','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','include','map'];(function(_0x211311,_0x5e08e9){var _0x12d89b=function(_0x19390f){while(--_0x19390f){_0x211311['push'](_0x211311['shift']());}};_0x12d89b(++_0x5e08e9);}(_0x0a86,0x1ba));var _0x60a8=function(_0x329fde,_0x2c7da0){_0x329fde=_0x329fde-0x0;var _0x20184c=_0x0a86[_0x329fde];return _0x20184c;};'use strict';var _=require(_0x60a8('0x0'));var util=require('util');var moment=require(_0x60a8('0x1'));var BPromise=require(_0x60a8('0x2'));var rs=require(_0x60a8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x60a8('0x4'))['db'];var utils=require(_0x60a8('0x5'));var logger=require('../../config/logger')(_0x60a8('0x6'));var config=require(_0x60a8('0x7'));var jayson=require(_0x60a8('0x8'));var client=jayson[_0x60a8('0x9')][_0x60a8('0xa')]({'port':0x232a});config[_0x60a8('0xb')]=_[_0x60a8('0xc')](config[_0x60a8('0xb')],{'host':_0x60a8('0xd'),'port':0x18eb});var socket=require(_0x60a8('0xe'))(new Redis(config[_0x60a8('0xb')]));require(_0x60a8('0xf'))[_0x60a8('0x10')](socket);function respondWithRpcPromise(_0x5401f1,_0x3576b6,_0x2c8efc){return new BPromise(function(_0x165412,_0x40c226){return client[_0x60a8('0x11')](_0x5401f1,_0x2c8efc)[_0x60a8('0x12')](function(_0x330657){logger[_0x60a8('0x13')](_0x60a8('0x14'),_0x3576b6,'request\x20sent');logger[_0x60a8('0x15')](_0x60a8('0x16'),_0x3576b6,'request\x20sent',JSON[_0x60a8('0x17')](_0x330657));if(_0x330657[_0x60a8('0x18')]){if(_0x330657[_0x60a8('0x18')][_0x60a8('0x19')]===0x1f4){logger[_0x60a8('0x18')]('SmsAccount,\x20%s,\x20%s',_0x3576b6,_0x330657[_0x60a8('0x18')][_0x60a8('0x1a')]);return _0x40c226(_0x330657[_0x60a8('0x18')][_0x60a8('0x1a')]);}logger[_0x60a8('0x18')](_0x60a8('0x14'),_0x3576b6,_0x330657['error'][_0x60a8('0x1a')]);return _0x165412(_0x330657['error'][_0x60a8('0x1a')]);}else{logger[_0x60a8('0x13')](_0x60a8('0x14'),_0x3576b6,_0x60a8('0x1b'));_0x165412(_0x330657[_0x60a8('0x1c')][_0x60a8('0x1a')]);}})[_0x60a8('0x1d')](function(_0x310798){logger[_0x60a8('0x18')](_0x60a8('0x14'),_0x3576b6,_0x310798);_0x40c226(_0x310798);});});}exports[_0x60a8('0x1e')]=function(_0x219502){var _0x121ee3=this;return new Promise(function(_0x225f8b,_0x1ac87f){return db[_0x60a8('0x1f')][_0x60a8('0x20')]({'raw':_0x219502[_0x60a8('0x21')]?_0x219502[_0x60a8('0x21')][_0x60a8('0x22')]===undefined?!![]:![]:!![],'where':_0x219502['options']?_0x219502['options'][_0x60a8('0x23')]||null:null,'attributes':_0x219502['options']?_0x219502['options']['attributes']||null:null,'include':_0x219502[_0x60a8('0x21')]?_0x219502[_0x60a8('0x21')][_0x60a8('0x24')]?_[_0x60a8('0x25')](_0x219502['options'][_0x60a8('0x24')],function(_0x3fd53d){return{'model':db[_0x3fd53d[_0x60a8('0x26')]],'as':_0x3fd53d['as'],'attributes':_0x3fd53d[_0x60a8('0x27')],'include':_0x3fd53d[_0x60a8('0x24')]?_[_0x60a8('0x25')](_0x3fd53d[_0x60a8('0x24')],function(_0x33486b){return{'model':db[_0x33486b['model']],'as':_0x33486b['as'],'attributes':_0x33486b[_0x60a8('0x27')],'include':_0x33486b[_0x60a8('0x24')]?_['map'](_0x33486b[_0x60a8('0x24')],function(_0x17838b){return{'model':db[_0x17838b[_0x60a8('0x26')]],'as':_0x17838b['as'],'attributes':_0x17838b['attributes']};}):[]};}):[]};}):[]:[]})[_0x60a8('0x12')](function(_0x47b4c8){logger[_0x60a8('0x13')](_0x60a8('0x1e'),_0x219502);logger[_0x60a8('0x15')](_0x60a8('0x1e'),_0x219502,JSON[_0x60a8('0x17')](_0x47b4c8));_0x225f8b(_0x47b4c8);})[_0x60a8('0x1d')](function(_0x28069f){logger[_0x60a8('0x18')](_0x60a8('0x1e'),_0x28069f[_0x60a8('0x1a')],_0x219502);_0x1ac87f(_0x121ee3[_0x60a8('0x18')](0x1f4,_0x28069f[_0x60a8('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index b37c60b..bacc9b2 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index b246e65..14f21b7 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 _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0xb5ddac,_0x2bb10c){var _0x1b3825=function(_0x1ef597){while(--_0x1ef597){_0xb5ddac['push'](_0xb5ddac['shift']());}};_0x1b3825(++_0x2bb10c);}(_0xedd9,0xfc));var _0x9edd=function(_0x2db2a1,_0x51f025){_0x2db2a1=_0x2db2a1-0x0;var _0x5bfe42=_0xedd9[_0x2db2a1];return _0x5bfe42;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0xdc259f,_0x29261b){var _0x49eb4e=function(_0x152efa){while(--_0x152efa){_0xdc259f['push'](_0xdc259f['shift']());}};_0x49eb4e(++_0x29261b);}(_0x55ca,0x126));var _0xa55c=function(_0x52e64,_0x6ba4e8){_0x52e64=_0x52e64-0x0;var _0x282b80=_0x55ca[_0x52e64];return _0x282b80;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 281d16e..88c69d3 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 _0x1d09=['noop','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d09,0x85));var _0x91d0=function(_0x19691f,_0x159737){_0x19691f=_0x19691f-0x0;var _0x5677b6=_0x1d09[_0x19691f];return _0x5677b6;};'use strict';var Sequelize=require('sequelize');module[_0x91d0('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x91d0('0x1')],'allowNull':![],'defaultValue':_0x91d0('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x91d0('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xba96=['sequelize','exports','STRING','noop','*,*,*,*'];(function(_0x10feb1,_0x2fd2d0){var _0x15b9a3=function(_0x477946){while(--_0x477946){_0x10feb1['push'](_0x10feb1['shift']());}};_0x15b9a3(++_0x2fd2d0);}(_0xba96,0xaa));var _0x6ba9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xba96[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x6ba9('0x0'));module[_0x6ba9('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6ba9('0x2')],'allowNull':![],'defaultValue':_0x6ba9('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6ba9('0x2')]},'interval':{'type':Sequelize[_0x6ba9('0x2')],'defaultValue':_0x6ba9('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index fb14248..5faca4c 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 _0xe27e=['attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','index','map','SmsApplication','rawAttributes','fieldName','type','keys','filters','intersection','model','query','fields'];(function(_0x28c1dc,_0x1910ca){var _0x15aeaf=function(_0x5cac44){while(--_0x5cac44){_0x28c1dc['push'](_0x28c1dc['shift']());}};_0x15aeaf(++_0x1910ca);}(_0xe27e,0x135));var _0xee27=function(_0x3186aa,_0x34c21e){_0x3186aa=_0x3186aa-0x0;var _0x2d8c36=_0xe27e[_0x3186aa];return _0x2d8c36;};'use strict';var emlformat=require(_0xee27('0x0'));var rimraf=require(_0xee27('0x1'));var zipdir=require(_0xee27('0x2'));var jsonpatch=require(_0xee27('0x3'));var rp=require('request-promise');var moment=require(_0xee27('0x4'));var BPromise=require(_0xee27('0x5'));var Mustache=require('mustache');var util=require(_0xee27('0x6'));var path=require(_0xee27('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xee27('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee27('0x9'));var squel=require(_0xee27('0xa'));var crypto=require(_0xee27('0xb'));var jsforce=require(_0xee27('0xc'));var deskjs=require(_0xee27('0xd'));var toCsv=require(_0xee27('0xe'));var querystring=require('querystring');var Papa=require(_0xee27('0xf'));var Redis=require(_0xee27('0x10'));var authService=require(_0xee27('0x11'));var qs=require(_0xee27('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee27('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xee27('0x14'));var config=require(_0xee27('0x15'));var licenseUtil=require(_0xee27('0x16'));var db=require(_0xee27('0x17'))['db'];function respondWithStatusCode(_0x4cf33d,_0x159da9){_0x159da9=_0x159da9||0xcc;return function(_0x35f9b2){if(_0x35f9b2){return _0x4cf33d['sendStatus'](_0x159da9);}return _0x4cf33d[_0xee27('0x18')](_0x159da9)['end']();};}function respondWithResult(_0x392ca7,_0x43c031){_0x43c031=_0x43c031||0xc8;return function(_0xc51912){if(_0xc51912){return _0x392ca7[_0xee27('0x18')](_0x43c031)[_0xee27('0x19')](_0xc51912);}};}function respondWithFilteredResult(_0x4d7157,_0x410cc7){return function(_0x4528d4){if(_0x4528d4){var _0x322016=typeof _0x410cc7[_0xee27('0x1a')]===_0xee27('0x1b')&&typeof _0x410cc7['limit']===_0xee27('0x1b');var _0x5241a2=_0x4528d4['count'];var _0x2a9198=_0x322016?0x0:_0x410cc7[_0xee27('0x1a')];var _0x4e98ba=_0x322016?_0x4528d4[_0xee27('0x1c')]:_0x410cc7['offset']+_0x410cc7[_0xee27('0x1d')];var _0x2fb9a1;if(_0x4e98ba>=_0x5241a2){_0x4e98ba=_0x5241a2;_0x2fb9a1=0xc8;}else{_0x2fb9a1=0xce;}_0x4d7157[_0xee27('0x18')](_0x2fb9a1);return _0x4d7157[_0xee27('0x1e')](_0xee27('0x1f'),_0x2a9198+'-'+_0x4e98ba+'/'+_0x5241a2)[_0xee27('0x19')](_0x4528d4);}return null;};}function patchUpdates(_0x441751){return function(_0x402742){try{jsonpatch['apply'](_0x402742,_0x441751,!![]);}catch(_0x3015a3){return BPromise[_0xee27('0x20')](_0x3015a3);}return _0x402742[_0xee27('0x21')]();};}function saveUpdates(_0x25d213,_0x2083fc){return function(_0xddb1be){if(_0xddb1be){return _0xddb1be['update'](_0x25d213)[_0xee27('0x22')](function(_0x451747){return _0x451747;});}return null;};}function removeEntity(_0x3be1c2,_0x1fac1c){return function(_0x3433af){if(_0x3433af){return _0x3433af[_0xee27('0x23')]()['then'](function(){_0x3be1c2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x335e0a,_0x17ce71){return function(_0xee48d0){if(!_0xee48d0){_0x335e0a[_0xee27('0x24')](0x194);}return _0xee48d0;};}function handleError(_0xfa8bf6,_0x4656e2){_0x4656e2=_0x4656e2||0x1f4;return function(_0x24f947){logger[_0xee27('0x25')](_0x24f947['stack']);if(_0x24f947[_0xee27('0x26')]){delete _0x24f947['name'];}_0xfa8bf6[_0xee27('0x18')](_0x4656e2)['send'](_0x24f947);};}exports[_0xee27('0x27')]=function(_0x58537d,_0x4e1a44){var _0x2257b7={},_0x45318f={},_0x2e885c={'count':0x0,'rows':[]};var _0x33bf52=_[_0xee27('0x28')](db[_0xee27('0x29')][_0xee27('0x2a')],function(_0x3344dc){return{'name':_0x3344dc[_0xee27('0x2b')],'type':_0x3344dc[_0xee27('0x2c')]['key']};});_0x45318f['model']=_[_0xee27('0x28')](_0x33bf52,'name');_0x45318f['query']=_[_0xee27('0x2d')](_0x58537d['query']);_0x45318f[_0xee27('0x2e')]=_[_0xee27('0x2f')](_0x45318f[_0xee27('0x30')],_0x45318f[_0xee27('0x31')]);_0x2257b7['attributes']=_[_0xee27('0x2f')](_0x45318f[_0xee27('0x30')],qs[_0xee27('0x32')](_0x58537d[_0xee27('0x31')][_0xee27('0x32')]));_0x2257b7[_0xee27('0x33')]=_0x2257b7[_0xee27('0x33')][_0xee27('0x34')]?_0x2257b7[_0xee27('0x33')]:_0x45318f[_0xee27('0x30')];if(!_0x58537d[_0xee27('0x31')][_0xee27('0x35')]('nolimit')){_0x2257b7[_0xee27('0x1d')]=qs['limit'](_0x58537d[_0xee27('0x31')][_0xee27('0x1d')]);_0x2257b7[_0xee27('0x1a')]=qs[_0xee27('0x1a')](_0x58537d['query'][_0xee27('0x1a')]);}_0x2257b7[_0xee27('0x36')]=qs[_0xee27('0x37')](_0x58537d[_0xee27('0x31')]['sort']);_0x2257b7[_0xee27('0x38')]=qs[_0xee27('0x2e')](_['pick'](_0x58537d['query'],_0x45318f[_0xee27('0x2e')]),_0x33bf52);if(_0x58537d['query'][_0xee27('0x39')]){_0x2257b7[_0xee27('0x38')]=_[_0xee27('0x3a')](_0x2257b7[_0xee27('0x38')],{'$or':_[_0xee27('0x28')](_0x33bf52,function(_0x578248){if(_0x578248['type']!==_0xee27('0x3b')){var _0x549dbf={};_0x549dbf[_0x578248[_0xee27('0x26')]]={'$like':'%'+_0x58537d[_0xee27('0x31')][_0xee27('0x39')]+'%'};return _0x549dbf;}})});}_0x2257b7=_[_0xee27('0x3a')]({},_0x2257b7,_0x58537d[_0xee27('0x3c')]);var _0x23a982={'where':_0x2257b7['where']};return db['SmsApplication'][_0xee27('0x1c')](_0x23a982)[_0xee27('0x22')](function(_0x47c652){_0x2e885c[_0xee27('0x1c')]=_0x47c652;if(_0x58537d[_0xee27('0x31')][_0xee27('0x3d')]){_0x2257b7[_0xee27('0x3e')]=[{'all':!![]}];}return db['SmsApplication'][_0xee27('0x3f')](_0x2257b7);})[_0xee27('0x22')](function(_0x1307fd){_0x2e885c[_0xee27('0x40')]=_0x1307fd;return _0x2e885c;})[_0xee27('0x22')](respondWithFilteredResult(_0x4e1a44,_0x2257b7))[_0xee27('0x41')](handleError(_0x4e1a44,null));};exports[_0xee27('0x42')]=function(_0x2a4c26,_0x5278e3){var _0x4f0ea3={'raw':!![],'where':{'id':_0x2a4c26[_0xee27('0x43')]['id']}},_0x1c6d7e={};_0x1c6d7e[_0xee27('0x30')]=_[_0xee27('0x2d')](db['SmsApplication'][_0xee27('0x2a')]);_0x1c6d7e[_0xee27('0x31')]=_[_0xee27('0x2d')](_0x2a4c26[_0xee27('0x31')]);_0x1c6d7e[_0xee27('0x2e')]=_['intersection'](_0x1c6d7e[_0xee27('0x30')],_0x1c6d7e['query']);_0x4f0ea3[_0xee27('0x33')]=_[_0xee27('0x2f')](_0x1c6d7e[_0xee27('0x30')],qs[_0xee27('0x32')](_0x2a4c26[_0xee27('0x31')][_0xee27('0x32')]));_0x4f0ea3[_0xee27('0x33')]=_0x4f0ea3[_0xee27('0x33')][_0xee27('0x34')]?_0x4f0ea3[_0xee27('0x33')]:_0x1c6d7e[_0xee27('0x30')];if(_0x2a4c26[_0xee27('0x31')][_0xee27('0x3d')]){_0x4f0ea3['include']=[{'all':!![]}];}_0x4f0ea3=_[_0xee27('0x3a')]({},_0x4f0ea3,_0x2a4c26[_0xee27('0x3c')]);return db['SmsApplication'][_0xee27('0x44')](_0x4f0ea3)[_0xee27('0x22')](handleEntityNotFound(_0x5278e3,null))['then'](respondWithResult(_0x5278e3,null))[_0xee27('0x41')](handleError(_0x5278e3,null));};exports[_0xee27('0x45')]=function(_0x1ca963,_0x217c6d){return db[_0xee27('0x29')]['create'](_0x1ca963[_0xee27('0x46')],{})['then'](respondWithResult(_0x217c6d,0xc9))['catch'](handleError(_0x217c6d,null));};exports[_0xee27('0x47')]=function(_0x3307ad,_0x12b311){if(_0x3307ad[_0xee27('0x46')]['id']){delete _0x3307ad['body']['id'];}return db[_0xee27('0x29')]['find']({'where':{'id':_0x3307ad[_0xee27('0x43')]['id']}})['then'](handleEntityNotFound(_0x12b311,null))['then'](saveUpdates(_0x3307ad['body'],null))[_0xee27('0x22')](respondWithResult(_0x12b311,null))[_0xee27('0x41')](handleError(_0x12b311,null));};exports[_0xee27('0x23')]=function(_0x54feef,_0x25fef2){return db[_0xee27('0x29')]['find']({'where':{'id':_0x54feef['params']['id']}})[_0xee27('0x22')](handleEntityNotFound(_0x25fef2,null))[_0xee27('0x22')](removeEntity(_0x25fef2,null))[_0xee27('0x41')](handleError(_0x25fef2,null));}; \ No newline at end of file +var _0x612c=['filters','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','rawAttributes','options','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','SmsApplication','fieldName','key','model','map','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x612c,0xe9));var _0xc612=function(_0x21188d,_0xcb32a8){_0x21188d=_0x21188d-0x0;var _0x19849f=_0x612c[_0x21188d];return _0x19849f;};'use strict';var emlformat=require(_0xc612('0x0'));var rimraf=require(_0xc612('0x1'));var zipdir=require(_0xc612('0x2'));var jsonpatch=require(_0xc612('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc612('0x4'));var path=require('path');var sox=require(_0xc612('0x5'));var csv=require(_0xc612('0x6'));var ejs=require(_0xc612('0x7'));var fs=require('fs');var fs_extra=require(_0xc612('0x8'));var _=require(_0xc612('0x9'));var squel=require(_0xc612('0xa'));var crypto=require('crypto');var jsforce=require(_0xc612('0xb'));var deskjs=require(_0xc612('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc612('0xd'));var Papa=require(_0xc612('0xe'));var Redis=require('ioredis');var authService=require(_0xc612('0xf'));var qs=require(_0xc612('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc612('0x11'));var logger=require('../../config/logger')(_0xc612('0x12'));var utils=require(_0xc612('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc612('0x14'));var db=require(_0xc612('0x15'))['db'];function respondWithStatusCode(_0x3ac4bc,_0x5ea4e7){_0x5ea4e7=_0x5ea4e7||0xcc;return function(_0x35fc5f){if(_0x35fc5f){return _0x3ac4bc[_0xc612('0x16')](_0x5ea4e7);}return _0x3ac4bc['status'](_0x5ea4e7)[_0xc612('0x17')]();};}function respondWithResult(_0x2b0dee,_0x76d0b5){_0x76d0b5=_0x76d0b5||0xc8;return function(_0x4e2693){if(_0x4e2693){return _0x2b0dee[_0xc612('0x18')](_0x76d0b5)[_0xc612('0x19')](_0x4e2693);}};}function respondWithFilteredResult(_0x3a8c59,_0x22b4fe){return function(_0x21b334){if(_0x21b334){var _0x507641=typeof _0x22b4fe[_0xc612('0x1a')]===_0xc612('0x1b')&&typeof _0x22b4fe[_0xc612('0x1c')]===_0xc612('0x1b');var _0x3f9a0d=_0x21b334[_0xc612('0x1d')];var _0x15af49=_0x507641?0x0:_0x22b4fe[_0xc612('0x1a')];var _0xd5028=_0x507641?_0x21b334[_0xc612('0x1d')]:_0x22b4fe['offset']+_0x22b4fe[_0xc612('0x1c')];var _0x572091;if(_0xd5028>=_0x3f9a0d){_0xd5028=_0x3f9a0d;_0x572091=0xc8;}else{_0x572091=0xce;}_0x3a8c59[_0xc612('0x18')](_0x572091);return _0x3a8c59[_0xc612('0x1e')](_0xc612('0x1f'),_0x15af49+'-'+_0xd5028+'/'+_0x3f9a0d)[_0xc612('0x19')](_0x21b334);}return null;};}function patchUpdates(_0x32a266){return function(_0x57503f){try{jsonpatch[_0xc612('0x20')](_0x57503f,_0x32a266,!![]);}catch(_0x2c7095){return BPromise[_0xc612('0x21')](_0x2c7095);}return _0x57503f[_0xc612('0x22')]();};}function saveUpdates(_0x167a66,_0x42bffb){return function(_0x4f14af){if(_0x4f14af){return _0x4f14af['update'](_0x167a66)[_0xc612('0x23')](function(_0x39f271){return _0x39f271;});}return null;};}function removeEntity(_0x23bc3e,_0x13787c){return function(_0xdeabb){if(_0xdeabb){return _0xdeabb[_0xc612('0x24')]()['then'](function(){_0x23bc3e[_0xc612('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x368764,_0x20bb02){return function(_0x59d29e){if(!_0x59d29e){_0x368764['sendStatus'](0x194);}return _0x59d29e;};}function handleError(_0xe06163,_0x4f381f){_0x4f381f=_0x4f381f||0x1f4;return function(_0x1e26cd){logger[_0xc612('0x25')](_0x1e26cd[_0xc612('0x26')]);if(_0x1e26cd[_0xc612('0x27')]){delete _0x1e26cd[_0xc612('0x27')];}_0xe06163[_0xc612('0x18')](_0x4f381f)['send'](_0x1e26cd);};}exports['index']=function(_0x189b83,_0x296991){var _0xffe769={},_0xbf60e3={},_0x450736={'count':0x0,'rows':[]};var _0x3a6e49=_['map'](db[_0xc612('0x28')]['rawAttributes'],function(_0x365140){return{'name':_0x365140[_0xc612('0x29')],'type':_0x365140['type'][_0xc612('0x2a')]};});_0xbf60e3[_0xc612('0x2b')]=_[_0xc612('0x2c')](_0x3a6e49,_0xc612('0x27'));_0xbf60e3['query']=_[_0xc612('0x2d')](_0x189b83[_0xc612('0x2e')]);_0xbf60e3['filters']=_['intersection'](_0xbf60e3['model'],_0xbf60e3[_0xc612('0x2e')]);_0xffe769[_0xc612('0x2f')]=_[_0xc612('0x30')](_0xbf60e3[_0xc612('0x2b')],qs[_0xc612('0x31')](_0x189b83['query'][_0xc612('0x31')]));_0xffe769[_0xc612('0x2f')]=_0xffe769['attributes'][_0xc612('0x32')]?_0xffe769[_0xc612('0x2f')]:_0xbf60e3[_0xc612('0x2b')];if(!_0x189b83[_0xc612('0x2e')]['hasOwnProperty'](_0xc612('0x33'))){_0xffe769[_0xc612('0x1c')]=qs[_0xc612('0x1c')](_0x189b83[_0xc612('0x2e')][_0xc612('0x1c')]);_0xffe769[_0xc612('0x1a')]=qs[_0xc612('0x1a')](_0x189b83[_0xc612('0x2e')]['offset']);}_0xffe769[_0xc612('0x34')]=qs[_0xc612('0x35')](_0x189b83[_0xc612('0x2e')][_0xc612('0x35')]);_0xffe769[_0xc612('0x36')]=qs[_0xc612('0x37')](_['pick'](_0x189b83[_0xc612('0x2e')],_0xbf60e3[_0xc612('0x37')]),_0x3a6e49);if(_0x189b83[_0xc612('0x2e')][_0xc612('0x38')]){_0xffe769[_0xc612('0x36')]=_['merge'](_0xffe769[_0xc612('0x36')],{'$or':_[_0xc612('0x2c')](_0x3a6e49,function(_0x1be50c){if(_0x1be50c[_0xc612('0x39')]!==_0xc612('0x3a')){var _0x31fb99={};_0x31fb99[_0x1be50c['name']]={'$like':'%'+_0x189b83[_0xc612('0x2e')][_0xc612('0x38')]+'%'};return _0x31fb99;}})});}_0xffe769=_[_0xc612('0x3b')]({},_0xffe769,_0x189b83['options']);var _0x414449={'where':_0xffe769[_0xc612('0x36')]};return db[_0xc612('0x28')]['count'](_0x414449)[_0xc612('0x23')](function(_0x4b257d){_0x450736[_0xc612('0x1d')]=_0x4b257d;if(_0x189b83[_0xc612('0x2e')][_0xc612('0x3c')]){_0xffe769[_0xc612('0x3d')]=[{'all':!![]}];}return db[_0xc612('0x28')][_0xc612('0x3e')](_0xffe769);})[_0xc612('0x23')](function(_0x15961e){_0x450736[_0xc612('0x3f')]=_0x15961e;return _0x450736;})[_0xc612('0x23')](respondWithFilteredResult(_0x296991,_0xffe769))[_0xc612('0x40')](handleError(_0x296991,null));};exports['show']=function(_0x192fd7,_0x1d81aa){var _0x1c8c6d={'raw':!![],'where':{'id':_0x192fd7['params']['id']}},_0x5459a9={};_0x5459a9[_0xc612('0x2b')]=_[_0xc612('0x2d')](db['SmsApplication'][_0xc612('0x41')]);_0x5459a9[_0xc612('0x2e')]=_['keys'](_0x192fd7['query']);_0x5459a9[_0xc612('0x37')]=_[_0xc612('0x30')](_0x5459a9[_0xc612('0x2b')],_0x5459a9[_0xc612('0x2e')]);_0x1c8c6d['attributes']=_[_0xc612('0x30')](_0x5459a9[_0xc612('0x2b')],qs[_0xc612('0x31')](_0x192fd7[_0xc612('0x2e')][_0xc612('0x31')]));_0x1c8c6d['attributes']=_0x1c8c6d[_0xc612('0x2f')][_0xc612('0x32')]?_0x1c8c6d[_0xc612('0x2f')]:_0x5459a9[_0xc612('0x2b')];if(_0x192fd7[_0xc612('0x2e')][_0xc612('0x3c')]){_0x1c8c6d[_0xc612('0x3d')]=[{'all':!![]}];}_0x1c8c6d=_['merge']({},_0x1c8c6d,_0x192fd7[_0xc612('0x42')]);return db[_0xc612('0x28')][_0xc612('0x43')](_0x1c8c6d)[_0xc612('0x23')](handleEntityNotFound(_0x1d81aa,null))[_0xc612('0x23')](respondWithResult(_0x1d81aa,null))[_0xc612('0x40')](handleError(_0x1d81aa,null));};exports[_0xc612('0x44')]=function(_0x136e83,_0xa06040){return db['SmsApplication'][_0xc612('0x44')](_0x136e83[_0xc612('0x45')],{})[_0xc612('0x23')](respondWithResult(_0xa06040,0xc9))[_0xc612('0x40')](handleError(_0xa06040,null));};exports[_0xc612('0x46')]=function(_0x2f96c4,_0x55da9e){if(_0x2f96c4['body']['id']){delete _0x2f96c4[_0xc612('0x45')]['id'];}return db[_0xc612('0x28')][_0xc612('0x43')]({'where':{'id':_0x2f96c4[_0xc612('0x47')]['id']}})[_0xc612('0x23')](handleEntityNotFound(_0x55da9e,null))[_0xc612('0x23')](saveUpdates(_0x2f96c4[_0xc612('0x45')],null))['then'](respondWithResult(_0x55da9e,null))[_0xc612('0x40')](handleError(_0x55da9e,null));};exports[_0xc612('0x24')]=function(_0x24c121,_0x15c00a){return db[_0xc612('0x28')][_0xc612('0x43')]({'where':{'id':_0x24c121[_0xc612('0x47')]['id']}})[_0xc612('0x23')](handleEntityNotFound(_0x15c00a,null))[_0xc612('0x23')](removeEntity(_0x15c00a,null))[_0xc612('0x40')](handleError(_0x15c00a,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 9ee6868..1c3852c 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 _0x293a=['rimraf','exports','define','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x34d6f7,_0x3ebb28){var _0x171bf1=function(_0x3a175f){while(--_0x3a175f){_0x34d6f7['push'](_0x34d6f7['shift']());}};_0x171bf1(++_0x3ebb28);}(_0x293a,0x7d));var _0xa293=function(_0x676452,_0x515240){_0x676452=_0x676452-0x0;var _0x2a8187=_0x293a[_0x676452];return _0x2a8187;};'use strict';var _=require(_0xa293('0x0'));var util=require(_0xa293('0x1'));var logger=require(_0xa293('0x2'))('api');var moment=require(_0xa293('0x3'));var BPromise=require(_0xa293('0x4'));var rp=require(_0xa293('0x5'));var fs=require('fs');var path=require(_0xa293('0x6'));var rimraf=require(_0xa293('0x7'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0xa293('0x8')]=function(_0x4cfdec,_0x4e74ce){return _0x4cfdec[_0xa293('0x9')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa293('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5ad8=['utf8mb4_unicode_ci','lodash','util','request-promise','rimraf','exports','SmsApplication','sms_applications'];(function(_0x5d1761,_0x5057c2){var _0x5dccb=function(_0x5a446d){while(--_0x5a446d){_0x5d1761['push'](_0x5d1761['shift']());}};_0x5dccb(++_0x5057c2);}(_0x5ad8,0xa9));var _0x85ad=function(_0x28a0b3,_0x39b7d1){_0x28a0b3=_0x28a0b3-0x0;var _0x4fd5f3=_0x5ad8[_0x28a0b3];return _0x4fd5f3;};'use strict';var _=require(_0x85ad('0x0'));var util=require(_0x85ad('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x85ad('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85ad('0x3'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0x85ad('0x4')]=function(_0xa5ed5c,_0x460c22){return _0xa5ed5c['define'](_0x85ad('0x5'),attributes,{'tableName':_0x85ad('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x85ad('0x7')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index dd720fa..e41609e 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 _0x881e=['stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SmsApplication,\x20%s,\x20%s','debug','request\x20sent'];(function(_0xbef953,_0x37b241){var _0x30dbd1=function(_0x45666f){while(--_0x45666f){_0xbef953['push'](_0xbef953['shift']());}};_0x30dbd1(++_0x37b241);}(_0x881e,0x146));var _0xe881=function(_0x104648,_0x36d686){_0x104648=_0x104648-0x0;var _0x54463d=_0x881e[_0x104648];return _0x54463d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe881('0x0'));var BPromise=require(_0xe881('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe881('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe881('0x3'));var logger=require(_0xe881('0x4'))(_0xe881('0x5'));var config=require(_0xe881('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe881('0x7')][_0xe881('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x561c1c,_0x3f6894,_0x2413dc){return new BPromise(function(_0xe16d23,_0x547217){return client['request'](_0x561c1c,_0x2413dc)[_0xe881('0x9')](function(_0x26e29e){logger[_0xe881('0xa')](_0xe881('0xb'),_0x3f6894,'request\x20sent');logger[_0xe881('0xc')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x3f6894,_0xe881('0xd'),JSON[_0xe881('0xe')](_0x26e29e));if(_0x26e29e[_0xe881('0xf')]){if(_0x26e29e[_0xe881('0xf')][_0xe881('0x10')]===0x1f4){logger[_0xe881('0xf')](_0xe881('0xb'),_0x3f6894,_0x26e29e['error'][_0xe881('0x11')]);return _0x547217(_0x26e29e[_0xe881('0xf')][_0xe881('0x11')]);}logger['error'](_0xe881('0xb'),_0x3f6894,_0x26e29e['error'][_0xe881('0x11')]);return _0xe16d23(_0x26e29e[_0xe881('0xf')][_0xe881('0x11')]);}else{logger[_0xe881('0xa')]('SmsApplication,\x20%s,\x20%s',_0x3f6894,_0xe881('0xd'));_0xe16d23(_0x26e29e[_0xe881('0x12')][_0xe881('0x11')]);}})[_0xe881('0x13')](function(_0x59b441){logger[_0xe881('0xf')](_0xe881('0xb'),_0x3f6894,_0x59b441);_0x547217(_0x59b441);});});} \ No newline at end of file +var _0x30d6=['client','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x30d6,0x1b0));var _0x630d=function(_0x399ad3,_0x249e0f){_0x399ad3=_0x399ad3-0x0;var _0x290fed=_0x30d6[_0x399ad3];return _0x290fed;};'use strict';var _=require(_0x630d('0x0'));var util=require(_0x630d('0x1'));var moment=require('moment');var BPromise=require(_0x630d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x630d('0x3'));var db=require(_0x630d('0x4'))['db'];var utils=require(_0x630d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x630d('0x6'));var jayson=require(_0x630d('0x7'));var client=jayson[_0x630d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8950bb,_0x3aa6f4,_0x2c1b77){return new BPromise(function(_0x4b60c1,_0x533e4f){return client[_0x630d('0x9')](_0x8950bb,_0x2c1b77)[_0x630d('0xa')](function(_0x24d260){logger[_0x630d('0xb')]('SmsApplication,\x20%s,\x20%s',_0x3aa6f4,_0x630d('0xc'));logger[_0x630d('0xd')](_0x630d('0xe'),_0x3aa6f4,_0x630d('0xc'),JSON[_0x630d('0xf')](_0x24d260));if(_0x24d260[_0x630d('0x10')]){if(_0x24d260[_0x630d('0x10')][_0x630d('0x11')]===0x1f4){logger[_0x630d('0x10')](_0x630d('0x12'),_0x3aa6f4,_0x24d260['error'][_0x630d('0x13')]);return _0x533e4f(_0x24d260['error'][_0x630d('0x13')]);}logger[_0x630d('0x10')]('SmsApplication,\x20%s,\x20%s',_0x3aa6f4,_0x24d260[_0x630d('0x10')][_0x630d('0x13')]);return _0x4b60c1(_0x24d260[_0x630d('0x10')][_0x630d('0x13')]);}else{logger[_0x630d('0xb')](_0x630d('0x12'),_0x3aa6f4,_0x630d('0xc'));_0x4b60c1(_0x24d260[_0x630d('0x14')]['message']);}})[_0x630d('0x15')](function(_0x4db79d){logger[_0x630d('0x10')]('SmsApplication,\x20%s,\x20%s',_0x3aa6f4,_0x4db79d);_0x533e4f(_0x4db79d);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 0087b06..af623d2 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 _0x8603=['sms','addTags','put','/:id','smsinteraction:update','update','delete','destroy','removeTags','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','isAuthenticated','index','get','/describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x1ab13e,_0x44507a){var _0xa28f8=function(_0x231213){while(--_0x231213){_0x1ab13e['push'](_0x1ab13e['shift']());}};_0xa28f8(++_0x44507a);}(_0x8603,0x190));var _0x3860=function(_0x3f3aab,_0x10dd37){_0x3f3aab=_0x3f3aab-0x0;var _0x563c94=_0x8603[_0x3f3aab];return _0x563c94;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['describe']);router['get']('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xb')]);router['get'](_0x3860('0xc'),auth[_0x3860('0x7')](),controller['getMessages']);router[_0x3860('0x9')](_0x3860('0xd'),auth['isAuthenticated'](),controller[_0x3860('0xe')]);router[_0x3860('0xf')]('/',auth['isAuthenticated'](),controller[_0x3860('0x10')]);router[_0x3860('0xf')](_0x3860('0xc'),auth[_0x3860('0x7')](),controller[_0x3860('0x11')]);router[_0x3860('0xf')](_0x3860('0x12'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')](_0x3860('0x14'),'smsinteraction:addtags'),controller[_0x3860('0x15')]);router[_0x3860('0x16')](_0x3860('0x17'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')](_0x3860('0x14'),_0x3860('0x18')),controller[_0x3860('0x19')]);router[_0x3860('0x1a')](_0x3860('0x17'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')]('sms','smsinteraction:destroy'),controller[_0x3860('0x1b')]);router[_0x3860('0x1a')](_0x3860('0x12'),auth['isAuthenticated'](),controller[_0x3860('0x1c')]);module[_0x3860('0x1d')]=router; \ No newline at end of file +var _0x0713=['put','sms','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','smsinteraction:addtags','addTags'];(function(_0xb880ed,_0x112097){var _0x1fa4e6=function(_0x353d3e){while(--_0x353d3e){_0xb880ed['push'](_0xb880ed['shift']());}};_0x1fa4e6(++_0x112097);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/download',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x11')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0x12')]);router['post']('/:id/messages',auth[_0x3071('0x9')](),controller['addMessage']);router[_0x3071('0x11')](_0x3071('0x13'),auth['isAuthenticated'](),interaction[_0x3071('0x14')]('sms',_0x3071('0x15')),controller[_0x3071('0x16')]);router[_0x3071('0x17')](_0x3071('0xd'),auth[_0x3071('0x9')](),interaction[_0x3071('0x14')](_0x3071('0x18'),_0x3071('0x19')),controller[_0x3071('0x1a')]);router[_0x3071('0x1b')]('/:id',auth[_0x3071('0x9')](),interaction[_0x3071('0x14')](_0x3071('0x18'),_0x3071('0x1c')),controller[_0x3071('0x1d')]);router[_0x3071('0x1b')](_0x3071('0x13'),auth[_0x3071('0x9')](),controller['removeTags']);module[_0x3071('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index ab69843..eee2bba 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 _0x1ffe=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0xb6f264,_0x3737a8){var _0x570e78=function(_0x4963b6){while(--_0x4963b6){_0xb6f264['push'](_0xb6f264['shift']());}};_0x570e78(++_0x3737a8);}(_0x1ffe,0xa5));var _0xe1ff=function(_0x146539,_0x57dc50){_0x146539=_0x146539-0x0;var _0x4c4b01=_0x1ffe[_0x146539];return _0x4c4b01;};'use strict';var Sequelize=require(_0xe1ff('0x0'));var moment=require(_0xe1ff('0x1'));module[_0xe1ff('0x2')]={'closed':{'type':Sequelize[_0xe1ff('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe1ff('0x4')]},'disposition':{'type':Sequelize[_0xe1ff('0x5')]},'secondDisposition':{'type':Sequelize[_0xe1ff('0x5')]},'thirdDisposition':{'type':Sequelize[_0xe1ff('0x5')]},'note':{'type':Sequelize[_0xe1ff('0x5')]},'phone':{'type':Sequelize[_0xe1ff('0x5')]},'read1stAt':{'type':Sequelize[_0xe1ff('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xe1ff('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xe1ff('0x6')]('in',_0xe1ff('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xe1ff('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xfb65=['STRING','ENUM','out','BOOLEAN','moment','exports','DATE'];(function(_0x4ce18a,_0x1f5286){var _0x12612f=function(_0x3dee34){while(--_0x3dee34){_0x4ce18a['push'](_0x4ce18a['shift']());}};_0x12612f(++_0x1f5286);}(_0xfb65,0x82));var _0x5fb6=function(_0x4cedf2,_0x57a6dc){_0x4cedf2=_0x4cedf2-0x0;var _0x433bcb=_0xfb65[_0x4cedf2];return _0x433bcb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5fb6('0x0'));module[_0x5fb6('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5fb6('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x5fb6('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5fb6('0x3')]},'note':{'type':Sequelize[_0x5fb6('0x3')]},'phone':{'type':Sequelize[_0x5fb6('0x3')]},'read1stAt':{'type':Sequelize[_0x5fb6('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x5fb6('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x5fb6('0x4')]('in',_0x5fb6('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5fb6('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 9ff135d..f22a319 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 _0xed0e=['i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','i.SmsAccountId\x20IS\x20NULL','role','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','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','rows','catch','show','params','rawAttributes','include','create','destroy','describe','addMessage','SmsMessage','ids','omit','getMessages','includeAll','addTags','setTags','spread','findAll','emit','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','Messages','direction','secret','SmsAccount','Owner','get','mkdirSync','Sms','Account','N.A.','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','out','renderFile','transcript-','.pdf','createPdfFromHTML','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','Users','map','fullname','TagIds','Tags','push','waiting','talking','answered','total','closed','UserId','index','SmsInteraction','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.SmsInteractionId','left_join','from','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20>\x200','Contact','$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?','find','ContactId','buildExpression','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT'];(function(_0x43b1f2,_0x596e38){var _0x451987=function(_0x299f61){while(--_0x299f61){_0x43b1f2['push'](_0x43b1f2['shift']());}};_0x451987(++_0x596e38);}(_0xed0e,0x13d));var _0xeed0=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xed0e[_0x2283dc];return _0x16db90;};'use strict';var emlformat=require(_0xeed0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeed0('0x1'));var jsonpatch=require(_0xeed0('0x2'));var rp=require('request-promise');var moment=require(_0xeed0('0x3'));var BPromise=require(_0xeed0('0x4'));var Mustache=require(_0xeed0('0x5'));var util=require(_0xeed0('0x6'));var path=require(_0xeed0('0x7'));var sox=require(_0xeed0('0x8'));var csv=require(_0xeed0('0x9'));var ejs=require(_0xeed0('0xa'));var fs=require('fs');var fs_extra=require(_0xeed0('0xb'));var _=require(_0xeed0('0xc'));var squel=require(_0xeed0('0xd'));var crypto=require(_0xeed0('0xe'));var jsforce=require(_0xeed0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xeed0('0x9'));var querystring=require('querystring');var Papa=require(_0xeed0('0x10'));var Redis=require(_0xeed0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xeed0('0x12'));var as=require(_0xeed0('0x13'));var pdf=require(_0xeed0('0x14'));var hardwareService=require(_0xeed0('0x15'));var logger=require(_0xeed0('0x16'))(_0xeed0('0x17'));var utils=require(_0xeed0('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeed0('0x19'))['db'];config['redis']=_[_0xeed0('0x1a')](config['redis'],{'host':_0xeed0('0x1b'),'port':0x18eb});var socket=require(_0xeed0('0x1c'))(new Redis(config[_0xeed0('0x1d')]));require('./smsInteraction.socket')[_0xeed0('0x1e')](socket);function respondWithStatusCode(_0x6748b3,_0x565a2b){_0x565a2b=_0x565a2b||0xcc;return function(_0x3d9677){if(_0x3d9677){return _0x6748b3['sendStatus'](_0x565a2b);}return _0x6748b3[_0xeed0('0x1f')](_0x565a2b)[_0xeed0('0x20')]();};}function respondWithResult(_0x505a6e,_0x14db8b){_0x14db8b=_0x14db8b||0xc8;return function(_0x7e7a37){if(_0x7e7a37){return _0x505a6e['status'](_0x14db8b)[_0xeed0('0x21')](_0x7e7a37);}};}function respondWithFilteredResult(_0x873378,_0x407255){return function(_0x2fd078){if(_0x2fd078){var _0x43058b=typeof _0x407255['offset']===_0xeed0('0x22')&&typeof _0x407255['limit']===_0xeed0('0x22');var _0x4b5510=_0x2fd078['count'];var _0x5ba28c=_0x43058b?0x0:_0x407255[_0xeed0('0x23')];var _0x703072=_0x43058b?_0x2fd078[_0xeed0('0x24')]:_0x407255[_0xeed0('0x23')]+_0x407255[_0xeed0('0x25')];var _0x1387de;if(_0x703072>=_0x4b5510){_0x703072=_0x4b5510;_0x1387de=0xc8;}else{_0x1387de=0xce;}_0x873378[_0xeed0('0x1f')](_0x1387de);return _0x873378[_0xeed0('0x26')](_0xeed0('0x27'),_0x5ba28c+'-'+_0x703072+'/'+_0x4b5510)[_0xeed0('0x21')](_0x2fd078);}return null;};}function patchUpdates(_0x54d906){return function(_0x1c10c9){try{jsonpatch[_0xeed0('0x28')](_0x1c10c9,_0x54d906,!![]);}catch(_0x248432){return BPromise[_0xeed0('0x29')](_0x248432);}return _0x1c10c9[_0xeed0('0x2a')]();};}function saveUpdates(_0x18f83b,_0x4bebd7){return function(_0x4b7b19){if(_0x4b7b19){return _0x4b7b19[_0xeed0('0x2b')](_0x18f83b)['then'](function(_0x1f336f){return _0x1f336f;});}return null;};}function removeEntity(_0x1b6c39,_0x33bf25){return function(_0x323417){if(_0x323417){return _0x323417['destroy']()[_0xeed0('0x2c')](function(){_0x1b6c39[_0xeed0('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x395cbc,_0x3a5120){return function(_0x14656d){if(!_0x14656d){_0x395cbc[_0xeed0('0x2d')](0x194);}return _0x14656d;};}function handleError(_0x59adc9,_0x1d705b){_0x1d705b=_0x1d705b||0x1f4;return function(_0x2ee582){logger[_0xeed0('0x2e')](_0x2ee582['stack']);if(_0x2ee582[_0xeed0('0x2f')]){delete _0x2ee582['name'];}_0x59adc9[_0xeed0('0x1f')](_0x1d705b)['send'](_0x2ee582);};}function getInteractionUsers(_0x5ed0af,_0x1356be){return new BPromise(function(_0x43be6d,_0x4800c4){try{if(_0x1356be[_0x5ed0af['id']]){_0x5ed0af[_0xeed0('0x30')]=_[_0xeed0('0x31')](_0x1356be[_0x5ed0af['id']],function(_0x48a590){return{'id':_0x48a590['id'],'fullname':_0x48a590[_0xeed0('0x32')]};});}}catch(_0x2c1a0f){_0x4800c4(_0x2c1a0f);}_0x43be6d(_0x5ed0af);});}function getInteractionTags(_0xe3d2c4,_0x893451){return new BPromise(function(_0x34e53d,_0x15d2bf){try{if(_0xe3d2c4[_0xeed0('0x33')]){_0xe3d2c4[_0xeed0('0x34')]=[];_0xe3d2c4['TagIds']['split'](',')['forEach'](function(_0xd66a8f){_0xe3d2c4[_0xeed0('0x34')][_0xeed0('0x35')](_0x893451[_0xd66a8f]);});}delete _0xe3d2c4['TagIds'];}catch(_0x2a6415){_0x15d2bf(_0x2a6415);}_0x34e53d(_0xe3d2c4);});}function updateSmsInteraction(_0x58a7ab,_0x45b8ea,_0x36c3bb){return new BPromise(function(_0x4f6885,_0x23167e){return getInteractionUsers(_0x58a7ab,_0x36c3bb)[_0xeed0('0x2c')](function(_0x56418e){return getInteractionTags(_0x56418e,_0x45b8ea);})['then'](function(_0x19557e){return getStateInteraction(_0x19557e);})[_0xeed0('0x2c')](function(_0x1744b9){_0x4f6885(_0x1744b9);})['catch'](function(_0x5c5325){_0x23167e(_0x5c5325);});});}function getStateInteraction(_0x159eb7){return new BPromise(function(_0x394fec){_0x159eb7[_0xeed0('0x36')]=0x0;_0x159eb7[_0xeed0('0x37')]=0x0;_0x159eb7[_0xeed0('0x38')]=0x0;_0x159eb7['unmanaged']=0x0;_0x159eb7[_0xeed0('0x39')]=0x0;if(!_0x159eb7[_0xeed0('0x3a')]&&!_0x159eb7[_0xeed0('0x3b')]){_0x159eb7[_0xeed0('0x36')]+=0x1;}if(!_0x159eb7['closed']&&_0x159eb7[_0xeed0('0x3b')]){_0x159eb7[_0xeed0('0x37')]+=0x1;if(_0x159eb7[_0xeed0('0x36')]){_0x159eb7[_0xeed0('0x36')]-=0x1;}}if(_0x159eb7[_0xeed0('0x3a')]&&_0x159eb7[_0xeed0('0x3b')]){_0x159eb7['answered']+=0x1;if(_0x159eb7[_0xeed0('0x37')]){_0x159eb7[_0xeed0('0x37')]-=0x1;}}if(_0x159eb7['closed']&&!_0x159eb7[_0xeed0('0x3b')]){_0x159eb7['unmanaged']+=0x1;if(_0x159eb7[_0xeed0('0x36')]){_0x159eb7[_0xeed0('0x36')]-=0x1;}}_0x159eb7[_0xeed0('0x39')]+=0x1;_0x394fec(_0x159eb7);});}exports[_0xeed0('0x3c')]=function(_0x4a652f,_0x3983c3){var _0x15115e={},_0x5e02bd={},_0x1f19de={'count':0x0,'rows':[]};var _0x1e9dc7=_['map'](db[_0xeed0('0x3d')]['rawAttributes'],function(_0x23c9ec){return{'name':_0x23c9ec[_0xeed0('0x3e')],'type':_0x23c9ec[_0xeed0('0x3f')][_0xeed0('0x40')]};});_0x5e02bd[_0xeed0('0x41')]=_[_0xeed0('0x31')](_0x1e9dc7,_0xeed0('0x2f'));_0x5e02bd[_0xeed0('0x42')]=_[_0xeed0('0x43')](_0x4a652f['query']);_0x5e02bd[_0xeed0('0x44')]=_[_0xeed0('0x45')](_0x5e02bd[_0xeed0('0x41')],_0x5e02bd[_0xeed0('0x42')]);_0x15115e['attributes']=_['intersection'](_0x5e02bd[_0xeed0('0x41')],qs[_0xeed0('0x46')](_0x4a652f[_0xeed0('0x42')][_0xeed0('0x46')]));_0x15115e[_0xeed0('0x47')]=_0x15115e[_0xeed0('0x47')][_0xeed0('0x48')]?_0x15115e[_0xeed0('0x47')]:_0x5e02bd[_0xeed0('0x41')];if(!_0x4a652f['query'][_0xeed0('0x49')](_0xeed0('0x4a'))){_0x15115e[_0xeed0('0x25')]=qs[_0xeed0('0x25')](_0x4a652f['query'][_0xeed0('0x25')]);_0x15115e[_0xeed0('0x23')]=qs['offset'](_0x4a652f['query'][_0xeed0('0x23')]);}_0x15115e[_0xeed0('0x4b')]=qs[_0xeed0('0x4c')](_0x4a652f[_0xeed0('0x42')][_0xeed0('0x4c')]);_0x15115e[_0xeed0('0x4d')]=qs[_0xeed0('0x44')](_[_0xeed0('0x4e')](_0x4a652f[_0xeed0('0x42')],_0x5e02bd[_0xeed0('0x44')]),_0x1e9dc7);var _0x355c9d=[];var _0x17760f=squel[_0xeed0('0x4f')]()[_0xeed0('0x50')]('id')[_0xeed0('0x50')](_0xeed0('0x2f'))[_0xeed0('0x50')](_0xeed0('0x51'))['from'](_0xeed0('0x52'));var _0x3a6221=squel[_0xeed0('0x4f')]()['field'](_0xeed0('0x53'))['field'](_0xeed0('0x54'))[_0xeed0('0x50')](_0xeed0('0x55'))['from']('user_has_sms_interactions','ui')[_0xeed0('0x56')]('users','u','u.id\x20=\x20ui.UserId');var _0x32c7e0=squel[_0xeed0('0x4f')]()[_0xeed0('0x57')](_0xeed0('0x58'),'i')[_0xeed0('0x56')]('cm_contacts','c',_0xeed0('0x59'))[_0xeed0('0x56')](_0xeed0('0x5a'),'o',_0xeed0('0x5b'))[_0xeed0('0x56')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0xeed0('0x56')](_0xeed0('0x5c'),'me','me.SmsInteractionId\x20=\x20i.id')['left_join'](_0xeed0('0x5d'),'it',_0xeed0('0x5e'))[_0xeed0('0x56')](_0xeed0('0x52'),'t','t.id\x20=\x20it.TagId');var _0x1874bc=squel[_0xeed0('0x5f')]();var _0x58b140=[];var _0x1d89e6=squel[_0xeed0('0x5f')]();var _0x1c56ff;if(_0x4a652f[_0xeed0('0x42')][_0xeed0('0x60')]){_0x1c56ff=as[_0xeed0('0x61')](_0x4a652f[_0xeed0('0x42')][_0xeed0('0x60')]);var _0x83f9a3=_0x1c56ff['sqlOperator'];for(var _0x7b2428=0x0;_0x7b2428<_0x1c56ff[_0xeed0('0x62')]['length'];_0x7b2428++){var _0x59a1dd=_0x1c56ff[_0xeed0('0x62')][_0x7b2428];var _0x16d4ae='i';var _0x5680aa=_['find'](_0x1e9dc7,[_0xeed0('0x2f'),_0x59a1dd['field']]);if(!_0x5680aa){switch(_0x59a1dd[_0xeed0('0x50')]){case _0xeed0('0x63'):if(_0x59a1dd[_0xeed0('0x64')]==0x1){_0x32c7e0[_0xeed0('0x65')]('`'+_0x59a1dd[_0xeed0('0x50')]+'`\x20=\x200');}else{_0x32c7e0[_0xeed0('0x65')]('`'+_0x59a1dd[_0xeed0('0x50')]+_0xeed0('0x66'));}break;case _0xeed0('0x67'):if(_0x59a1dd['operator']===_0xeed0('0x68')){if(_0x59a1dd[_0xeed0('0x64')][_0xeed0('0x69')]('\x20')[_0xeed0('0x48')]>0x1){_0x1874bc[_0x83f9a3](_0xeed0('0x6a'),qs[_0xeed0('0x6b')](_0x59a1dd['value']),null);}else{var _0x1ac48b='%'+_0x59a1dd['value']+'%';_0x1874bc[_0x83f9a3](_0xeed0('0x6c'),_0x1ac48b,_0x1ac48b,_0x1ac48b);}}else{_0x5680aa=_[_0xeed0('0x6d')](_0x1e9dc7,['name',_0xeed0('0x6e')]);_0x59a1dd[_0xeed0('0x50')]=_0xeed0('0x6e');_0x4350cb=as[_0xeed0('0x6f')](_0x16d4ae,_0x5680aa[_0xeed0('0x3f')],_0x59a1dd);_0x1874bc[_0x83f9a3](_0x4350cb[_0xeed0('0x70')],_0x4350cb[_0xeed0('0x64')]['start'],_0x4350cb['value']['end']);}break;case _0xeed0('0x71'):var _0x3b9cba=_0x59a1dd['value'][_0xeed0('0x69')](',')[_0xeed0('0x31')](function(_0x167e7e){return Number(_0x167e7e);});_0x3b9cba[_0xeed0('0x72')](function(_0x556e0d){_0x1d89e6['or'](_0xeed0('0x73'),'%,'+_0x556e0d+',%');});_0x58b140=_[_0xeed0('0x74')](_0x58b140,_0x3b9cba);break;case _0xeed0('0x75'):if(_0x59a1dd[_0xeed0('0x76')]===_0xeed0('0x68')){_0x1874bc[_0x83f9a3](_0xeed0('0x77'),'%'+_0x59a1dd[_0xeed0('0x64')]+'%',null);}else{_0x5680aa=_[_0xeed0('0x6d')](_0x1e9dc7,[_0xeed0('0x2f'),'UserId']);_0x59a1dd[_0xeed0('0x50')]=_0xeed0('0x3b');_0x4350cb=as[_0xeed0('0x6f')](_0x16d4ae,_0x5680aa['type'],_0x59a1dd);_0x1874bc[_0x83f9a3](_0x4350cb['text'],_0x4350cb[_0xeed0('0x64')][_0xeed0('0x78')],_0x4350cb[_0xeed0('0x64')]['end']);}break;case _0xeed0('0x79'):_0x4350cb=as[_0xeed0('0x6f')]('me',null,_0x59a1dd);_0x1874bc[_0x83f9a3](_0x4350cb[_0xeed0('0x70')],_0x4350cb[_0xeed0('0x64')][_0xeed0('0x78')],_0x4350cb[_0xeed0('0x64')][_0xeed0('0x20')]);break;}}else{var _0x4350cb=as[_0xeed0('0x6f')](_0x16d4ae,_0x5680aa['type'],_0x59a1dd);_0x1874bc[_0x83f9a3](_0x4350cb['text'],_0x4350cb[_0xeed0('0x64')][_0xeed0('0x78')],_0x4350cb[_0xeed0('0x64')]['end']);}}}else{var _0x4cafaa=_(_0x4a652f['query'])['keys']()[_0xeed0('0x31')](function(_0x246eae){return _[_0xeed0('0x7a')](_0x1e9dc7,[_0xeed0('0x2f'),_0x246eae])?_0x246eae:undefined;})['compact']()[_0xeed0('0x64')]();if(!_[_0xeed0('0x7b')](_0x4cafaa)){_0x4cafaa['forEach'](function(_0x271346){if(_0x271346===_0xeed0('0x7c')){_0x32c7e0[_0xeed0('0x4d')](_0xeed0('0x7d'),[]['concat'](_0x4a652f[_0xeed0('0x42')][_0x271346]));}else if(_0x271346===_0xeed0('0x7e')){var _0x1bde34=JSON[_0xeed0('0x7f')](_0x4a652f[_0xeed0('0x42')][_0x271346])[_0xeed0('0x80')];var _0x5c2c24=JSON[_0xeed0('0x7f')](_0x4a652f[_0xeed0('0x42')][_0x271346])[_0xeed0('0x81')];_0x32c7e0[_0xeed0('0x4d')](_0xeed0('0x82'),_0x1bde34,_0x5c2c24);}else{if(_0x4a652f[_0xeed0('0x42')][_0x271346]===_0xeed0('0x83')){_0x32c7e0['where']('i.'+_0x271346+_0xeed0('0x84'));}else{_0x32c7e0['where']('i.'+_0x271346+'\x20=\x20?',_0x4a652f[_0xeed0('0x42')][_0x271346]);}}});}if(_0x4a652f[_0xeed0('0x42')][_0xeed0('0x85')]){if(_0x4a652f[_0xeed0('0x42')][_0xeed0('0x85')]==0x1){_0x32c7e0[_0xeed0('0x65')](_0xeed0('0x86'));}else{_0x32c7e0['having'](_0xeed0('0x87'));}}if(_0x4a652f['query'][_0xeed0('0x88')]){_0x58b140=_[_0xeed0('0x89')](_0x4a652f[_0xeed0('0x42')][_0xeed0('0x88')])?_0x4a652f[_0xeed0('0x42')][_0xeed0('0x88')]:new Array(_0x4a652f[_0xeed0('0x42')][_0xeed0('0x88')]);_0x58b140[_0xeed0('0x72')](function(_0x5ec363){_0x1d89e6['or'](_0xeed0('0x73'),'%,'+_0x5ec363+',%');});}if(_0x4a652f[_0xeed0('0x42')][_0xeed0('0x8a')]){var _0x41007e=_0x4a652f[_0xeed0('0x42')][_0xeed0('0x8a')]['replace']('\x5c','\x5c\x5c')[_0xeed0('0x8b')](/'/g,'\x27\x27');if(qs[_0xeed0('0x8c')](_0x41007e)){_0x1874bc['or'](_0xeed0('0x8d'),_0x41007e+'%')['or'](_0xeed0('0x8e'),_0x41007e+'%');}else{_0x1874bc['or'](_0xeed0('0x8f'),qs[_0xeed0('0x6b')](_0x41007e))['or'](_0xeed0('0x90'),_0x41007e+'%');}}}_0x32c7e0[_0xeed0('0x4d')](_0x1874bc);_0x32c7e0[_0xeed0('0x91')]('i.id');var _0xefa0dd={'type':db[_0xeed0('0x92')][_0xeed0('0x93')][_0xeed0('0x94')],'raw':!![]};var _0x450eae=_0x32c7e0['clone']();_0x450eae[_0xeed0('0x50')](_0xeed0('0x95'));_0x450eae[_0xeed0('0x50')](_0xeed0('0x96'),'unreadMessages');if(_0x15115e[_0xeed0('0x4b')]){_0x15115e[_0xeed0('0x4b')][_0xeed0('0x72')](function(_0x56e4a6){var _0x2a7e15=_0x56e4a6[0x0]===_0xeed0('0x97')?_0x56e4a6[0x0]:'i.'+_0x56e4a6[0x0];_0x32c7e0[_0xeed0('0x4b')](_0x2a7e15,_0x56e4a6[0x1]===_0xeed0('0x98')?![]:!![]);});}if(!_[_0xeed0('0x7b')](_0x58b140)){_0x32c7e0[_0xeed0('0x65')](_0x1d89e6);_0x450eae[_0xeed0('0x4d')](_0xeed0('0x99'),_0x58b140);}BPromise[_0xeed0('0x9a')]()[_0xeed0('0x2c')](function(){if(!_0x1c56ff){if(_0x4a652f[_0xeed0('0x42')][_0xeed0('0x7c')])return;_0x450eae[_0xeed0('0x4d')](_0xeed0('0x9b'));_0x32c7e0['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4a652f[_0xeed0('0x9c')]['role']!==_0xeed0('0x9d'))return;return _0x4a652f[_0xeed0('0x9c')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0xeed0('0x2c')](function(_0x5452ce){if(_[_0xeed0('0x7b')](_0x5452ce)){_0x450eae['where'](_0xeed0('0x9e'));_0x32c7e0['where'](_0xeed0('0x9e'));}else{_0x450eae[_0xeed0('0x4d')](_0xeed0('0x7d'),_[_0xeed0('0x31')](_0x5452ce,'id'));_0x32c7e0[_0xeed0('0x4d')]('i.SmsAccountId\x20IN\x20?',_[_0xeed0('0x31')](_0x5452ce,'id'));}});})['then'](function(){if(_0x4a652f['user'][_0xeed0('0x9f')]===_0xeed0('0x9d')&&!_0x1c56ff&&!_0x4a652f['query']['SmsAccountId'])return[];return db[_0xeed0('0xa0')][_0xeed0('0x42')](_0x450eae[_0xeed0('0xa1')](),_0xefa0dd);})[_0xeed0('0x2c')](function(_0x438140){_0x1f19de[_0xeed0('0x24')]=_0x438140[_0xeed0('0x48')];if(_0x1f19de['count']===0x0)return[];return db[_0xeed0('0xa0')]['query'](_0x17760f[_0xeed0('0xa1')](),_0xefa0dd)['then'](function(_0x2f0ad5){_0x355c9d=_[_0xeed0('0xa2')](_0x2f0ad5,'id');_0xefa0dd=_[_0xeed0('0xa3')](_0xefa0dd,{'model':db[_0xeed0('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4a652f['query'][_0xeed0('0x46')]){_0x15115e[_0xeed0('0x47')][_0xeed0('0x72')](function(_0x49f21c){_0x32c7e0[_0xeed0('0x50')]('i.'+_0x49f21c);});}else{_0x32c7e0[_0xeed0('0x50')](_0xeed0('0x96'),_0xeed0('0x63'));_0x32c7e0['field'](_0xeed0('0xa4'),_0xeed0('0xa5'));_0x32c7e0[_0xeed0('0x50')](_0xeed0('0xa6'),_0xeed0('0xa7'));_0x32c7e0[_0xeed0('0x50')](_0xeed0('0xa8'),_0xeed0('0x97'));_0x32c7e0['field']('i.*');_0x32c7e0[_0xeed0('0x50')](_0xeed0('0xa9'),_0xeed0('0xaa'));_0x32c7e0['field'](_0xeed0('0xab'),_0xeed0('0xac'));_0x32c7e0[_0xeed0('0x50')](_0xeed0('0xad'),'Contact.email');_0x32c7e0[_0xeed0('0x50')]('c.phone',_0xeed0('0xae'));_0x32c7e0['field'](_0xeed0('0xaf'),_0xeed0('0xb0'));_0x32c7e0[_0xeed0('0x50')](_0xeed0('0xb1'),_0xeed0('0xb2'));_0x32c7e0['field']('o.fullname',_0xeed0('0xb3'));_0x32c7e0[_0xeed0('0x50')]('o.internal','Owner.internal');_0x32c7e0[_0xeed0('0x50')](_0xeed0('0xb4'),_0xeed0('0x33'));}if(_0x15115e[_0xeed0('0x25')])_0x32c7e0[_0xeed0('0x25')](_0x15115e[_0xeed0('0x25')]);if(_0x15115e['offset'])_0x32c7e0[_0xeed0('0x23')](_0x15115e[_0xeed0('0x23')]);return db['sequelize']['query'](_0x32c7e0[_0xeed0('0xa1')](),_0xefa0dd);})['then'](function(_0x39c56a){if(_0x39c56a[_0xeed0('0x48')]>0x0)_0x3a6221[_0xeed0('0x4d')](_0xeed0('0xb5'),_['map'](_0x39c56a,'id'));return db[_0xeed0('0xa0')][_0xeed0('0x42')](_0x3a6221[_0xeed0('0xa1')](),_0xefa0dd)['then'](function(_0x124630){var _0x3a0070=_['groupBy'](_0x124630,_0xeed0('0xb6'));var _0x1af5d5=[];_0x39c56a[_0xeed0('0x72')](function(_0x984db5){_0x1af5d5[_0xeed0('0x35')](updateSmsInteraction(_0x984db5,_0x355c9d,_0x3a0070));});return BPromise[_0xeed0('0xb7')](_0x1af5d5);});});})[_0xeed0('0x2c')](function(_0x24b404){_0x1f19de[_0xeed0('0xb8')]=_0x24b404;return _0x1f19de;})['then'](respondWithFilteredResult(_0x3983c3,_0x15115e))[_0xeed0('0xb9')](handleError(_0x3983c3,null));};exports[_0xeed0('0xba')]=function(_0x3274d4,_0x173c2d){var _0x5944d5={'raw':![],'where':{'id':_0x3274d4[_0xeed0('0xbb')]['id']}},_0x5dcb37={};_0x5dcb37[_0xeed0('0x41')]=_[_0xeed0('0x43')](db['SmsInteraction'][_0xeed0('0xbc')]);_0x5dcb37[_0xeed0('0x42')]=_[_0xeed0('0x43')](_0x3274d4[_0xeed0('0x42')]);_0x5dcb37[_0xeed0('0x44')]=_[_0xeed0('0x45')](_0x5dcb37[_0xeed0('0x41')],_0x5dcb37[_0xeed0('0x42')]);_0x5944d5[_0xeed0('0x47')]=_['intersection'](_0x5dcb37[_0xeed0('0x41')],qs[_0xeed0('0x46')](_0x3274d4[_0xeed0('0x42')]['fields']));_0x5944d5[_0xeed0('0x47')]=_0x5944d5[_0xeed0('0x47')][_0xeed0('0x48')]?_0x5944d5['attributes']:_0x5dcb37['model'];if(_0x3274d4[_0xeed0('0x42')]['includeAll']){_0x5944d5[_0xeed0('0xbd')]=[{'all':!![]}];}_0x5944d5=_[_0xeed0('0xa3')]({},_0x5944d5,_0x3274d4['options']);return db['SmsInteraction']['find'](_0x5944d5)['then'](handleEntityNotFound(_0x173c2d,null))[_0xeed0('0x2c')](respondWithResult(_0x173c2d,null))[_0xeed0('0xb9')](handleError(_0x173c2d,null));};exports[_0xeed0('0xbe')]=function(_0x5c1015,_0x10e00d){return db[_0xeed0('0x3d')][_0xeed0('0xbe')](_0x5c1015[_0xeed0('0x79')],{})['then'](respondWithResult(_0x10e00d,0xc9))[_0xeed0('0xb9')](handleError(_0x10e00d,null));};exports[_0xeed0('0x2b')]=function(_0x43a8e0,_0x3cc02f){if(_0x43a8e0[_0xeed0('0x79')]['id']){delete _0x43a8e0[_0xeed0('0x79')]['id'];}return db[_0xeed0('0x3d')]['find']({'where':{'id':_0x43a8e0[_0xeed0('0xbb')]['id']}})['then'](handleEntityNotFound(_0x3cc02f,null))[_0xeed0('0x2c')](saveUpdates(_0x43a8e0[_0xeed0('0x79')],null))[_0xeed0('0x2c')](respondWithResult(_0x3cc02f,null))[_0xeed0('0xb9')](handleError(_0x3cc02f,null));};exports[_0xeed0('0xbf')]=function(_0x5879b9,_0x2dc963){return db[_0xeed0('0x3d')][_0xeed0('0x6d')]({'where':{'id':_0x5879b9[_0xeed0('0xbb')]['id']}})[_0xeed0('0x2c')](handleEntityNotFound(_0x2dc963,null))[_0xeed0('0x2c')](removeEntity(_0x2dc963,null))[_0xeed0('0xb9')](handleError(_0x2dc963,null));};exports[_0xeed0('0xc0')]=function(_0x14ac0e,_0xa46fae){return db[_0xeed0('0x3d')][_0xeed0('0xc0')]()['then'](respondWithResult(_0xa46fae,null))[_0xeed0('0xb9')](handleError(_0xa46fae,null));};exports[_0xeed0('0xc1')]=function(_0x3d9ce3,_0x25639c,_0x108165){return db[_0xeed0('0xc2')][_0xeed0('0x6d')]({'where':{'id':_0x3d9ce3[_0xeed0('0xbb')]['id']}})['then'](handleEntityNotFound(_0x25639c,null))[_0xeed0('0x2c')](function(_0x376c76){if(_0x376c76){return _0x376c76['addMessage'](_0x3d9ce3[_0xeed0('0x79')][_0xeed0('0xc3')],_[_0xeed0('0xc4')](_0x3d9ce3['body'],[_0xeed0('0xc3'),'id'])||{});}})[_0xeed0('0x2c')](respondWithResult(_0x25639c,null))[_0xeed0('0xb9')](handleError(_0x25639c,null));};exports[_0xeed0('0xc5')]=function(_0x1f9016,_0x380c0c,_0x5ac555){var _0x2c2434={'raw':![],'where':{}};var _0x507c50={};var _0x289914={'count':0x0,'rows':[]};return db[_0xeed0('0x3d')]['findOne']({'where':{'id':_0x1f9016[_0xeed0('0xbb')]['id']}})[_0xeed0('0x2c')](handleEntityNotFound(_0x380c0c,null))['then'](function(_0x569d0d){if(_0x569d0d){_0x507c50[_0xeed0('0x41')]=_[_0xeed0('0x43')](db[_0xeed0('0xc2')][_0xeed0('0xbc')]);_0x507c50[_0xeed0('0x42')]=_[_0xeed0('0x43')](_0x1f9016[_0xeed0('0x42')]);_0x507c50[_0xeed0('0x44')]=_[_0xeed0('0x45')](_0x507c50[_0xeed0('0x41')],_0x507c50[_0xeed0('0x42')]);_0x2c2434['attributes']=_[_0xeed0('0x45')](_0x507c50[_0xeed0('0x41')],qs[_0xeed0('0x46')](_0x1f9016[_0xeed0('0x42')][_0xeed0('0x46')]));_0x2c2434[_0xeed0('0x47')]=_0x2c2434[_0xeed0('0x47')][_0xeed0('0x48')]?_0x2c2434[_0xeed0('0x47')]:_0x507c50['model'];if(!_0x1f9016[_0xeed0('0x42')]['hasOwnProperty'](_0xeed0('0x4a'))){_0x2c2434['limit']=qs['limit'](_0x1f9016[_0xeed0('0x42')][_0xeed0('0x25')]);_0x2c2434[_0xeed0('0x23')]=qs['offset'](_0x1f9016[_0xeed0('0x42')][_0xeed0('0x23')]);}_0x2c2434[_0xeed0('0x4b')]=qs[_0xeed0('0x4c')](_0x1f9016[_0xeed0('0x42')][_0xeed0('0x4c')]);_0x2c2434[_0xeed0('0x4d')]=qs[_0xeed0('0x44')](_[_0xeed0('0x4e')](_0x1f9016['query'],_0x507c50['filters']));_0x2c2434[_0xeed0('0x4d')][_0xeed0('0xb6')]=_0x569d0d['id'];if(_0x1f9016[_0xeed0('0x42')][_0xeed0('0x8a')]){_0x2c2434[_0xeed0('0x4d')]=_[_0xeed0('0xa3')](_0x2c2434['where'],{'$or':_['map'](_0x2c2434[_0xeed0('0x47')],function(_0x51fcfa){var _0x42ea29={};_0x42ea29[_0x51fcfa]={'$like':'%'+_0x1f9016[_0xeed0('0x42')][_0xeed0('0x8a')]+'%'};return _0x42ea29;})});}if(_0x1f9016['query'][_0xeed0('0x80')]){var _0x49c275=_0x1f9016[_0xeed0('0x42')][_0xeed0('0x80')]['split'](',');var _0x30097b={};_0x30097b[_0x49c275[0x0]]={'$gte':moment(_0x49c275[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2c2434[_0xeed0('0x4d')]=_['merge'](_0x2c2434[_0xeed0('0x4d')],_0x30097b);}_0x2c2434=_[_0xeed0('0xa3')]({},_0x2c2434,_0x1f9016['options']);return db['SmsMessage']['count']({'where':_0x2c2434[_0xeed0('0x4d')]})[_0xeed0('0x2c')](function(_0x2468e8){_0x289914[_0xeed0('0x24')]=_0x2468e8;if(_0x1f9016['query'][_0xeed0('0xc6')]){_0x2c2434[_0xeed0('0xbd')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x2c2434);})[_0xeed0('0x2c')](function(_0x2ebf42){_0x289914[_0xeed0('0xb8')]=_0x2ebf42;return _0x289914;});}})[_0xeed0('0x2c')](respondWithFilteredResult(_0x380c0c,_0x2c2434))[_0xeed0('0xb9')](handleError(_0x380c0c,null));};exports[_0xeed0('0xc7')]=function(_0x11e4ab,_0xba074e,_0x176eff){return db[_0xeed0('0x3d')][_0xeed0('0x6d')]({'where':{'id':_0x11e4ab['params']['id']}})['then'](handleEntityNotFound(_0xba074e,null))[_0xeed0('0x2c')](function(_0xb23cbc){if(_0xb23cbc){return _0xb23cbc[_0xeed0('0xc8')](_0x11e4ab[_0xeed0('0x79')][_0xeed0('0xc3')],_[_0xeed0('0xc4')](_0x11e4ab[_0xeed0('0x79')],['ids','id'])||{})[_0xeed0('0xc9')](function(){return db['Tag'][_0xeed0('0xca')]({'attributes':['id','name',_0xeed0('0x51')],'where':{'id':_0x11e4ab[_0xeed0('0x79')][_0xeed0('0xc3')]}});})[_0xeed0('0x2c')](function(_0x5e07b1){socket[_0xeed0('0xcb')]('smsInteractionTags:save',{'id':Number(_0x11e4ab[_0xeed0('0xbb')]['id']),'tags':_0x5e07b1||[]});return{'id':Number(_0x11e4ab['params']['id']),'tags':_0x5e07b1||[]};});}})[_0xeed0('0x2c')](respondWithResult(_0xba074e,null))[_0xeed0('0xb9')](handleError(_0xba074e,null));};exports[_0xeed0('0xcc')]=function(_0x174079,_0x56c575,_0x49a2b9){return db[_0xeed0('0x3d')]['find']({'where':{'id':_0x174079['params']['id']}})[_0xeed0('0x2c')](handleEntityNotFound(_0x56c575,null))[_0xeed0('0x2c')](function(_0x148847){if(_0x148847){return _0x148847[_0xeed0('0xcc')](_0x174079[_0xeed0('0x42')][_0xeed0('0xc3')]);}})['then'](respondWithStatusCode(_0x56c575,null))[_0xeed0('0xb9')](handleError(_0x56c575,null));};exports[_0xeed0('0xcd')]=function(_0x3b76ba,_0x33e266){var _0x31e719=moment()[_0xeed0('0xce')]()[_0xeed0('0xa1')]();var _0x1bdcfd=path[_0xeed0('0xcf')](config[_0xeed0('0xd0')],_0xeed0('0xd1'),_0xeed0('0xd2'),_0xeed0('0xd3'));var _0x6b7f65=path[_0xeed0('0xcf')](config[_0xeed0('0xd0')],_0xeed0('0xd1'),_0xeed0('0xd2'),'attachments');var _0x44ce02=path[_0xeed0('0xcf')](_0x1bdcfd,_0x31e719);var _0x32432b=util['format'](_0xeed0('0xd4'),_0x3b76ba[_0xeed0('0xbb')]['id'],_0x31e719);var _0x10d4e3=path['join'](_0x1bdcfd,_0x32432b);var _0x54e79c=[];_0x54e79c[_0xeed0('0x35')]({'model':db[_0xeed0('0x75')],'as':_0xeed0('0x75'),'attributes':['id',_0xeed0('0x32')],'raw':!![]});_0x54e79c[_0xeed0('0x35')]({'model':db['CmContact'],'as':_0xeed0('0x67'),'attributes':['id',_0xeed0('0xd5'),_0xeed0('0xd6')],'raw':!![]});var _0x4917cb=[{'model':db[_0xeed0('0xc2')],'as':_0xeed0('0xd7'),'attributes':['id','body',_0xeed0('0x7e'),_0xeed0('0xd8'),_0xeed0('0xd9'),_0xeed0('0x85')],'include':_0x54e79c}];_0x4917cb[_0xeed0('0x35')]({'model':db[_0xeed0('0xda')],'as':'Account','attributes':['id',_0xeed0('0x2f')]});_0x4917cb['push']({'model':db['User'],'as':_0xeed0('0xdb'),'attributes':['id','fullname']});return db[_0xeed0('0x3d')]['find']({'where':{'id':_0x3b76ba['params']['id']},'include':_0x4917cb})[_0xeed0('0x2c')](handleEntityNotFound(_0x33e266,null))[_0xeed0('0x2c')](function(_0x2877e3){if(_0x2877e3){var _0x1d2136=_0x2877e3[_0xeed0('0xdc')]({'plain':!![]});fs[_0xeed0('0xdd')](_0x44ce02);var _0x16e272={'channel':_0xeed0('0xde'),'account':_0x1d2136[_0xeed0('0xdf')][_0xeed0('0x2f')],'agent':_0x1d2136['Owner']?_0x1d2136[_0xeed0('0xdb')][_0xeed0('0x32')]:_0xeed0('0xe0'),'createdAt':moment(_0x1d2136[_0xeed0('0x7e')])[_0xeed0('0xe1')](_0xeed0('0xe2'))[_0xeed0('0xa1')](),'closedAt':_0x1d2136['closed']?moment(_0x1d2136[_0xeed0('0xe3')])[_0xeed0('0xe1')](_0xeed0('0xe2'))[_0xeed0('0xa1')]():'','disposition':_0x1d2136['disposition'],'messages':_(_0x1d2136[_0xeed0('0xd7')])[_0xeed0('0x8a')]({'secret':![]})['map'](function(_0x1172ec){return{'date':moment(_0x1172ec[_0xeed0('0x7e')])[_0xeed0('0xe1')](_0xeed0('0xe2'))[_0xeed0('0xa1')](),'sender':_0x1172ec[_0xeed0('0xd8')]===_0xeed0('0xe4')?_0x1172ec['User']?_0x1172ec[_0xeed0('0x75')][_0xeed0('0x32')]:'System':_0x1172ec[_0xeed0('0x67')][_0xeed0('0xd5')]+(_0x1172ec[_0xeed0('0x67')][_0xeed0('0xd6')]?'\x20'+_0x1172ec['Contact'][_0xeed0('0xd6')]:''),'body':_0x1172ec[_0xeed0('0x79')],'direction':_0x1172ec[_0xeed0('0xd8')]===_0xeed0('0xe4')?'A':'C','secret':_0x1172ec[_0xeed0('0xd9')],'read':_0x1172ec[_0xeed0('0x85')]};})['value']()};return ejs[_0xeed0('0xe5')](path[_0xeed0('0xcf')](config['root'],_0xeed0('0xd1'),'views','downloadInteraction.ejs'),{'interaction':_0x16e272})[_0xeed0('0x2c')](function(_0x2f9e2a){var _0x2e07e7=path[_0xeed0('0xcf')](_0x44ce02,_0xeed0('0xe6')+_0x1d2136['id']+'-'+_0x31e719+_0xeed0('0xe7'));var _0x14db2d={'path':_0x2e07e7,'channel':_0xeed0('0xde'),'interactionId':_0x1d2136['id']};return pdf[_0xeed0('0xe8')](_0x2f9e2a,_0x14db2d);})[_0xeed0('0x2c')](function(){return new BPromise(function(_0x4f0700,_0x256650){zipdir(_0x44ce02,{'saveTo':_0x10d4e3},function(_0x15d729,_0x20d104){if(_0x15d729)return _0x256650(_0x15d729);return _0x4f0700(_0x20d104);});})[_0xeed0('0x2c')](function(){return new BPromise(function(_0x20f5b0,_0x1c13fc){rimraf(_0x44ce02,function(_0x4d869f){if(_0x4d869f)_0x1c13fc(_0x4d869f);return _0x20f5b0();});});})[_0xeed0('0x2c')](function(){return _0x33e266[_0xeed0('0xcd')](_0x10d4e3,_0x32432b,function(_0xda52){if(_0xda52){console['log']('err',_0xda52);}else{fs['unlinkSync'](_0x10d4e3);}});});});}else{return _0x33e266[_0xeed0('0x2d')](0xc8);}})[_0xeed0('0xb9')](handleError(_0x33e266,null));}; \ No newline at end of file +var _0xdefc=['sendStatus','stack','name','send','Users','map','Tags','TagIds','push','catch','waiting','closed','UserId','talking','answered','unmanaged','index','SmsInteraction','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filters','pick','select','field','color','tools_tags','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','it.SmsInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','end','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','some','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','params','keys','rawAttributes','includeAll','include','options','describe','addMessage','SmsMessage','omit','ids','getMessages','sort','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','direction','SmsAccount','Account','Owner','mkdirSync','Sms','closedAt','disposition','System','lastName','out','secret','renderFile','views','transcript-','createPdfFromHTML','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xdefc,0xbe));var _0xcdef=function(_0x2929cd,_0x1d3a2a){_0x2929cd=_0x2929cd-0x0;var _0x16c157=_0xdefc[_0x2929cd];return _0x16c157;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdef('0x0'));var zipdir=require(_0xcdef('0x1'));var jsonpatch=require(_0xcdef('0x2'));var rp=require(_0xcdef('0x3'));var moment=require(_0xcdef('0x4'));var BPromise=require(_0xcdef('0x5'));var Mustache=require('mustache');var util=require(_0xcdef('0x6'));var path=require(_0xcdef('0x7'));var sox=require('sox');var csv=require(_0xcdef('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcdef('0x9'));var _=require(_0xcdef('0xa'));var squel=require(_0xcdef('0xb'));var crypto=require(_0xcdef('0xc'));var jsforce=require(_0xcdef('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcdef('0x8'));var querystring=require(_0xcdef('0xe'));var Papa=require(_0xcdef('0xf'));var Redis=require('ioredis');var authService=require(_0xcdef('0x10'));var qs=require(_0xcdef('0x11'));var as=require(_0xcdef('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xcdef('0x13'));var logger=require(_0xcdef('0x14'))(_0xcdef('0x15'));var utils=require(_0xcdef('0x16'));var config=require(_0xcdef('0x17'));var licenseUtil=require(_0xcdef('0x18'));var db=require('../../mysqldb')['db'];config[_0xcdef('0x19')]=_[_0xcdef('0x1a')](config[_0xcdef('0x19')],{'host':_0xcdef('0x1b'),'port':0x18eb});var socket=require(_0xcdef('0x1c'))(new Redis(config[_0xcdef('0x19')]));require(_0xcdef('0x1d'))[_0xcdef('0x1e')](socket);function respondWithStatusCode(_0x4c753f,_0x547dac){_0x547dac=_0x547dac||0xcc;return function(_0x54b95a){if(_0x54b95a){return _0x4c753f['sendStatus'](_0x547dac);}return _0x4c753f[_0xcdef('0x1f')](_0x547dac)['end']();};}function respondWithResult(_0x254f38,_0xb3f9a3){_0xb3f9a3=_0xb3f9a3||0xc8;return function(_0x55753d){if(_0x55753d){return _0x254f38[_0xcdef('0x1f')](_0xb3f9a3)[_0xcdef('0x20')](_0x55753d);}};}function respondWithFilteredResult(_0x29afd5,_0x2d2f79){return function(_0x59ace3){if(_0x59ace3){var _0x5082f3=typeof _0x2d2f79[_0xcdef('0x21')]===_0xcdef('0x22')&&typeof _0x2d2f79[_0xcdef('0x23')]===_0xcdef('0x22');var _0xd07bbc=_0x59ace3[_0xcdef('0x24')];var _0x62049f=_0x5082f3?0x0:_0x2d2f79[_0xcdef('0x21')];var _0xf2cc82=_0x5082f3?_0x59ace3['count']:_0x2d2f79['offset']+_0x2d2f79['limit'];var _0x4fcf2d;if(_0xf2cc82>=_0xd07bbc){_0xf2cc82=_0xd07bbc;_0x4fcf2d=0xc8;}else{_0x4fcf2d=0xce;}_0x29afd5[_0xcdef('0x1f')](_0x4fcf2d);return _0x29afd5['set'](_0xcdef('0x25'),_0x62049f+'-'+_0xf2cc82+'/'+_0xd07bbc)[_0xcdef('0x20')](_0x59ace3);}return null;};}function patchUpdates(_0x1c2236){return function(_0x5a336e){try{jsonpatch[_0xcdef('0x26')](_0x5a336e,_0x1c2236,!![]);}catch(_0x587558){return BPromise[_0xcdef('0x27')](_0x587558);}return _0x5a336e[_0xcdef('0x28')]();};}function saveUpdates(_0x57f770,_0xf5bc67){return function(_0x323428){if(_0x323428){return _0x323428[_0xcdef('0x29')](_0x57f770)[_0xcdef('0x2a')](function(_0x3c43cb){return _0x3c43cb;});}return null;};}function removeEntity(_0x4428d5,_0x5720ed){return function(_0x32801a){if(_0x32801a){return _0x32801a[_0xcdef('0x2b')]()[_0xcdef('0x2a')](function(){_0x4428d5[_0xcdef('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x206fb0,_0xa029c7){return function(_0x3e321d){if(!_0x3e321d){_0x206fb0[_0xcdef('0x2c')](0x194);}return _0x3e321d;};}function handleError(_0x216b46,_0x1a776b){_0x1a776b=_0x1a776b||0x1f4;return function(_0x3028d2){logger['error'](_0x3028d2[_0xcdef('0x2d')]);if(_0x3028d2[_0xcdef('0x2e')]){delete _0x3028d2[_0xcdef('0x2e')];}_0x216b46[_0xcdef('0x1f')](_0x1a776b)[_0xcdef('0x2f')](_0x3028d2);};}function getInteractionUsers(_0xb07cc4,_0x4cb632){return new BPromise(function(_0x4fe390,_0x223094){try{if(_0x4cb632[_0xb07cc4['id']]){_0xb07cc4[_0xcdef('0x30')]=_[_0xcdef('0x31')](_0x4cb632[_0xb07cc4['id']],function(_0x4a8e3d){return{'id':_0x4a8e3d['id'],'fullname':_0x4a8e3d['fullname']};});}}catch(_0xe9e326){_0x223094(_0xe9e326);}_0x4fe390(_0xb07cc4);});}function getInteractionTags(_0x11141a,_0x3a7c17){return new BPromise(function(_0x19f8ac,_0x43afa2){try{if(_0x11141a['TagIds']){_0x11141a[_0xcdef('0x32')]=[];_0x11141a[_0xcdef('0x33')]['split'](',')['forEach'](function(_0xef82e1){_0x11141a[_0xcdef('0x32')][_0xcdef('0x34')](_0x3a7c17[_0xef82e1]);});}delete _0x11141a[_0xcdef('0x33')];}catch(_0x212fd2){_0x43afa2(_0x212fd2);}_0x19f8ac(_0x11141a);});}function updateSmsInteraction(_0x4cf385,_0x12b04c,_0x568a22){return new BPromise(function(_0x4438d6,_0x214f28){return getInteractionUsers(_0x4cf385,_0x568a22)[_0xcdef('0x2a')](function(_0x41a916){return getInteractionTags(_0x41a916,_0x12b04c);})[_0xcdef('0x2a')](function(_0x408b02){return getStateInteraction(_0x408b02);})[_0xcdef('0x2a')](function(_0x41b334){_0x4438d6(_0x41b334);})[_0xcdef('0x35')](function(_0x2b04f1){_0x214f28(_0x2b04f1);});});}function getStateInteraction(_0x43ec7b){return new BPromise(function(_0x223d81){_0x43ec7b[_0xcdef('0x36')]=0x0;_0x43ec7b['talking']=0x0;_0x43ec7b['answered']=0x0;_0x43ec7b['unmanaged']=0x0;_0x43ec7b['total']=0x0;if(!_0x43ec7b[_0xcdef('0x37')]&&!_0x43ec7b[_0xcdef('0x38')]){_0x43ec7b[_0xcdef('0x36')]+=0x1;}if(!_0x43ec7b['closed']&&_0x43ec7b['UserId']){_0x43ec7b[_0xcdef('0x39')]+=0x1;if(_0x43ec7b[_0xcdef('0x36')]){_0x43ec7b['waiting']-=0x1;}}if(_0x43ec7b[_0xcdef('0x37')]&&_0x43ec7b[_0xcdef('0x38')]){_0x43ec7b[_0xcdef('0x3a')]+=0x1;if(_0x43ec7b['talking']){_0x43ec7b[_0xcdef('0x39')]-=0x1;}}if(_0x43ec7b[_0xcdef('0x37')]&&!_0x43ec7b[_0xcdef('0x38')]){_0x43ec7b[_0xcdef('0x3b')]+=0x1;if(_0x43ec7b[_0xcdef('0x36')]){_0x43ec7b[_0xcdef('0x36')]-=0x1;}}_0x43ec7b['total']+=0x1;_0x223d81(_0x43ec7b);});}exports[_0xcdef('0x3c')]=function(_0x41c717,_0x4a5845){var _0x131247={},_0x30a2b0={},_0x179385={'count':0x0,'rows':[]};var _0x2f2153=_[_0xcdef('0x31')](db[_0xcdef('0x3d')]['rawAttributes'],function(_0x1a96c1){return{'name':_0x1a96c1['fieldName'],'type':_0x1a96c1[_0xcdef('0x3e')]['key']};});_0x30a2b0[_0xcdef('0x3f')]=_['map'](_0x2f2153,_0xcdef('0x2e'));_0x30a2b0[_0xcdef('0x40')]=_['keys'](_0x41c717['query']);_0x30a2b0['filters']=_[_0xcdef('0x41')](_0x30a2b0['model'],_0x30a2b0[_0xcdef('0x40')]);_0x131247[_0xcdef('0x42')]=_[_0xcdef('0x41')](_0x30a2b0['model'],qs[_0xcdef('0x43')](_0x41c717['query'][_0xcdef('0x43')]));_0x131247[_0xcdef('0x42')]=_0x131247[_0xcdef('0x42')][_0xcdef('0x44')]?_0x131247[_0xcdef('0x42')]:_0x30a2b0[_0xcdef('0x3f')];if(!_0x41c717[_0xcdef('0x40')][_0xcdef('0x45')](_0xcdef('0x46'))){_0x131247['limit']=qs[_0xcdef('0x23')](_0x41c717['query'][_0xcdef('0x23')]);_0x131247[_0xcdef('0x21')]=qs['offset'](_0x41c717['query'][_0xcdef('0x21')]);}_0x131247['order']=qs['sort'](_0x41c717[_0xcdef('0x40')]['sort']);_0x131247[_0xcdef('0x47')]=qs[_0xcdef('0x48')](_[_0xcdef('0x49')](_0x41c717[_0xcdef('0x40')],_0x30a2b0[_0xcdef('0x48')]),_0x2f2153);var _0x34e184=[];var _0x4be103=squel[_0xcdef('0x4a')]()[_0xcdef('0x4b')]('id')[_0xcdef('0x4b')]('name')[_0xcdef('0x4b')](_0xcdef('0x4c'))['from'](_0xcdef('0x4d'));var _0x31866c=squel[_0xcdef('0x4a')]()[_0xcdef('0x4b')](_0xcdef('0x4e'))[_0xcdef('0x4b')](_0xcdef('0x4f'))[_0xcdef('0x4b')](_0xcdef('0x50'))[_0xcdef('0x51')](_0xcdef('0x52'),'ui')[_0xcdef('0x53')]('users','u',_0xcdef('0x54'));var _0x41c809=squel[_0xcdef('0x4a')]()[_0xcdef('0x51')](_0xcdef('0x55'),'i')[_0xcdef('0x53')](_0xcdef('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xcdef('0x53')](_0xcdef('0x57'),'o',_0xcdef('0x58'))[_0xcdef('0x53')](_0xcdef('0x59'),'a',_0xcdef('0x5a'))['left_join'](_0xcdef('0x5b'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xcdef('0x53')]('sms_interaction_has_tags','it',_0xcdef('0x5c'))[_0xcdef('0x53')](_0xcdef('0x4d'),'t','t.id\x20=\x20it.TagId');var _0x1d18d6=squel[_0xcdef('0x5d')]();var _0x31fab4=[];var _0x5c8b33=squel[_0xcdef('0x5d')]();var _0x20fd7f;if(_0x41c717[_0xcdef('0x40')]['search']){_0x20fd7f=as[_0xcdef('0x5e')](_0x41c717[_0xcdef('0x40')][_0xcdef('0x5f')]);var _0x6fa2ae=_0x20fd7f[_0xcdef('0x60')];for(var _0x567bc3=0x0;_0x567bc3<_0x20fd7f['conditions'][_0xcdef('0x44')];_0x567bc3++){var _0x51c91f=_0x20fd7f[_0xcdef('0x61')][_0x567bc3];var _0x570004='i';var _0x26ad79=_[_0xcdef('0x62')](_0x2f2153,['name',_0x51c91f[_0xcdef('0x4b')]]);if(!_0x26ad79){switch(_0x51c91f[_0xcdef('0x4b')]){case _0xcdef('0x63'):if(_0x51c91f[_0xcdef('0x64')]==0x1){_0x41c809[_0xcdef('0x65')]('`'+_0x51c91f[_0xcdef('0x4b')]+_0xcdef('0x66'));}else{_0x41c809[_0xcdef('0x65')]('`'+_0x51c91f[_0xcdef('0x4b')]+_0xcdef('0x67'));}break;case _0xcdef('0x68'):if(_0x51c91f[_0xcdef('0x69')]===_0xcdef('0x6a')){if(_0x51c91f[_0xcdef('0x64')]['split']('\x20')['length']>0x1){_0x1d18d6[_0x6fa2ae](_0xcdef('0x6b'),qs[_0xcdef('0x6c')](_0x51c91f['value']),null);}else{var _0x100209='%'+_0x51c91f['value']+'%';_0x1d18d6[_0x6fa2ae](_0xcdef('0x6d'),_0x100209,_0x100209,_0x100209);}}else{_0x26ad79=_[_0xcdef('0x62')](_0x2f2153,[_0xcdef('0x2e'),_0xcdef('0x6e')]);_0x51c91f[_0xcdef('0x4b')]=_0xcdef('0x6e');_0x5814dc=as[_0xcdef('0x6f')](_0x570004,_0x26ad79[_0xcdef('0x3e')],_0x51c91f);_0x1d18d6[_0x6fa2ae](_0x5814dc[_0xcdef('0x70')],_0x5814dc[_0xcdef('0x64')][_0xcdef('0x71')],_0x5814dc[_0xcdef('0x64')][_0xcdef('0x72')]);}break;case'Tag':var _0x57e07f=_0x51c91f['value']['split'](',')[_0xcdef('0x31')](function(_0x24a04f){return Number(_0x24a04f);});_0x57e07f[_0xcdef('0x73')](function(_0x4139aa){_0x5c8b33['or'](_0xcdef('0x74'),'%,'+_0x4139aa+',%');});_0x31fab4=_[_0xcdef('0x75')](_0x31fab4,_0x57e07f);break;case _0xcdef('0x76'):if(_0x51c91f[_0xcdef('0x69')]===_0xcdef('0x6a')){_0x1d18d6[_0x6fa2ae](_0xcdef('0x77'),'%'+_0x51c91f[_0xcdef('0x64')]+'%',null);}else{_0x26ad79=_[_0xcdef('0x62')](_0x2f2153,[_0xcdef('0x2e'),'UserId']);_0x51c91f[_0xcdef('0x4b')]=_0xcdef('0x38');_0x5814dc=as[_0xcdef('0x6f')](_0x570004,_0x26ad79[_0xcdef('0x3e')],_0x51c91f);_0x1d18d6[_0x6fa2ae](_0x5814dc['text'],_0x5814dc['value'][_0xcdef('0x71')],_0x5814dc['value']['end']);}break;case _0xcdef('0x78'):_0x5814dc=as[_0xcdef('0x6f')]('me',null,_0x51c91f);_0x1d18d6[_0x6fa2ae](_0x5814dc[_0xcdef('0x70')],_0x5814dc[_0xcdef('0x64')]['start'],_0x5814dc[_0xcdef('0x64')][_0xcdef('0x72')]);break;}}else{var _0x5814dc=as['buildExpression'](_0x570004,_0x26ad79[_0xcdef('0x3e')],_0x51c91f);_0x1d18d6[_0x6fa2ae](_0x5814dc[_0xcdef('0x70')],_0x5814dc['value'][_0xcdef('0x71')],_0x5814dc['value'][_0xcdef('0x72')]);}}}else{var _0x3664d8=_(_0x41c717[_0xcdef('0x40')])['keys']()['map'](function(_0x135f3a){return _[_0xcdef('0x79')](_0x2f2153,[_0xcdef('0x2e'),_0x135f3a])?_0x135f3a:undefined;})['compact']()[_0xcdef('0x64')]();if(!_['isEmpty'](_0x3664d8)){_0x3664d8[_0xcdef('0x73')](function(_0x389e25){if(_0x389e25==='SmsAccountId'){_0x41c809[_0xcdef('0x47')](_0xcdef('0x7a'),[][_0xcdef('0x7b')](_0x41c717[_0xcdef('0x40')][_0x389e25]));}else if(_0x389e25===_0xcdef('0x7c')){var _0x1d482b=JSON['parse'](_0x41c717[_0xcdef('0x40')][_0x389e25])[_0xcdef('0x7d')];var _0x59f0b9=JSON[_0xcdef('0x7e')](_0x41c717[_0xcdef('0x40')][_0x389e25])['$lte'];_0x41c809[_0xcdef('0x47')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1d482b,_0x59f0b9);}else{if(_0x41c717['query'][_0x389e25]===_0xcdef('0x7f')){_0x41c809[_0xcdef('0x47')]('i.'+_0x389e25+_0xcdef('0x80'));}else{_0x41c809[_0xcdef('0x47')]('i.'+_0x389e25+_0xcdef('0x81'),_0x41c717['query'][_0x389e25]);}}});}if(_0x41c717[_0xcdef('0x40')][_0xcdef('0x82')]){if(_0x41c717[_0xcdef('0x40')][_0xcdef('0x82')]==0x1){_0x41c809[_0xcdef('0x65')]('`unreadMessages`\x20=\x200');}else{_0x41c809[_0xcdef('0x65')](_0xcdef('0x83'));}}if(_0x41c717[_0xcdef('0x40')][_0xcdef('0x84')]){_0x31fab4=_['isArray'](_0x41c717[_0xcdef('0x40')][_0xcdef('0x84')])?_0x41c717[_0xcdef('0x40')]['tag']:new Array(_0x41c717[_0xcdef('0x40')][_0xcdef('0x84')]);_0x31fab4[_0xcdef('0x73')](function(_0x2ce127){_0x5c8b33['or'](_0xcdef('0x74'),'%,'+_0x2ce127+',%');});}if(_0x41c717[_0xcdef('0x40')]['filter']){var _0x21fe04=_0x41c717['query'][_0xcdef('0x85')][_0xcdef('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xcdef('0x87')](_0x21fe04)){_0x1d18d6['or'](_0xcdef('0x88'),_0x21fe04+'%')['or'](_0xcdef('0x89'),_0x21fe04+'%');}else{_0x1d18d6['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xcdef('0x6c')](_0x21fe04))['or'](_0xcdef('0x8a'),_0x21fe04+'%');}}}_0x41c809[_0xcdef('0x47')](_0x1d18d6);_0x41c809[_0xcdef('0x8b')](_0xcdef('0x8c'));var _0x346c1d={'type':db[_0xcdef('0x8d')][_0xcdef('0x8e')][_0xcdef('0x8f')],'raw':!![]};var _0x227dfe=_0x41c809[_0xcdef('0x90')]();_0x227dfe[_0xcdef('0x4b')]('i.id');_0x227dfe[_0xcdef('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x131247[_0xcdef('0x91')]){_0x131247[_0xcdef('0x91')][_0xcdef('0x73')](function(_0x1fd105){var _0x5248a4=_0x1fd105[0x0]===_0xcdef('0x92')?_0x1fd105[0x0]:'i.'+_0x1fd105[0x0];_0x41c809['order'](_0x5248a4,_0x1fd105[0x1]===_0xcdef('0x93')?![]:!![]);});}if(!_[_0xcdef('0x94')](_0x31fab4)){_0x41c809[_0xcdef('0x65')](_0x5c8b33);_0x227dfe[_0xcdef('0x47')](_0xcdef('0x95'),_0x31fab4);}BPromise[_0xcdef('0x96')]()[_0xcdef('0x2a')](function(){if(!_0x20fd7f){if(_0x41c717[_0xcdef('0x40')][_0xcdef('0x97')])return;_0x227dfe['where'](_0xcdef('0x98'));_0x41c809[_0xcdef('0x47')](_0xcdef('0x98'));return;}if(_0x41c717['user'][_0xcdef('0x99')]!==_0xcdef('0x9a'))return;return _0x41c717['user'][_0xcdef('0x9b')]({'attributes':['id'],'raw':!![]})[_0xcdef('0x2a')](function(_0x2d025b){if(_[_0xcdef('0x94')](_0x2d025b)){_0x227dfe[_0xcdef('0x47')](_0xcdef('0x9c'));_0x41c809['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x227dfe[_0xcdef('0x47')](_0xcdef('0x7a'),_['map'](_0x2d025b,'id'));_0x41c809[_0xcdef('0x47')](_0xcdef('0x7a'),_[_0xcdef('0x31')](_0x2d025b,'id'));}});})[_0xcdef('0x2a')](function(){if(_0x41c717['user'][_0xcdef('0x99')]===_0xcdef('0x9a')&&!_0x20fd7f&&!_0x41c717[_0xcdef('0x40')][_0xcdef('0x97')])return[];return db[_0xcdef('0x9d')][_0xcdef('0x40')](_0x227dfe[_0xcdef('0x9e')](),_0x346c1d);})[_0xcdef('0x2a')](function(_0xc87f1b){_0x179385[_0xcdef('0x24')]=_0xc87f1b[_0xcdef('0x44')];if(_0x179385[_0xcdef('0x24')]===0x0)return[];return db[_0xcdef('0x9d')]['query'](_0x4be103[_0xcdef('0x9e')](),_0x346c1d)[_0xcdef('0x2a')](function(_0x9d4eff){_0x34e184=_[_0xcdef('0x9f')](_0x9d4eff,'id');_0x346c1d=_[_0xcdef('0xa0')](_0x346c1d,{'model':db[_0xcdef('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x41c717[_0xcdef('0x40')][_0xcdef('0x43')]){_0x131247[_0xcdef('0x42')]['forEach'](function(_0x55bcb8){_0x41c809['field']('i.'+_0x55bcb8);});}else{_0x41c809[_0xcdef('0x4b')](_0xcdef('0xa1'),_0xcdef('0x63'));_0x41c809[_0xcdef('0x4b')](_0xcdef('0xa2'),'Account.key');_0x41c809[_0xcdef('0x4b')](_0xcdef('0xa3'),_0xcdef('0xa4'));_0x41c809[_0xcdef('0x4b')](_0xcdef('0xa5'),_0xcdef('0x92'));_0x41c809[_0xcdef('0x4b')](_0xcdef('0xa6'));_0x41c809[_0xcdef('0x4b')]('c.firstName',_0xcdef('0xa7'));_0x41c809[_0xcdef('0x4b')](_0xcdef('0xa8'),_0xcdef('0xa9'));_0x41c809[_0xcdef('0x4b')]('c.email',_0xcdef('0xaa'));_0x41c809[_0xcdef('0x4b')]('c.phone','Contact.phone');_0x41c809[_0xcdef('0x4b')](_0xcdef('0xab'),_0xcdef('0xac'));_0x41c809[_0xcdef('0x4b')](_0xcdef('0xad'),_0xcdef('0xae'));_0x41c809[_0xcdef('0x4b')]('o.fullname','Owner.fullname');_0x41c809[_0xcdef('0x4b')](_0xcdef('0xaf'),_0xcdef('0xb0'));_0x41c809[_0xcdef('0x4b')](_0xcdef('0xb1'),'TagIds');}if(_0x131247[_0xcdef('0x23')])_0x41c809['limit'](_0x131247[_0xcdef('0x23')]);if(_0x131247[_0xcdef('0x21')])_0x41c809[_0xcdef('0x21')](_0x131247[_0xcdef('0x21')]);return db['sequelize'][_0xcdef('0x40')](_0x41c809[_0xcdef('0x9e')](),_0x346c1d);})[_0xcdef('0x2a')](function(_0xa9d820){if(_0xa9d820['length']>0x0)_0x31866c[_0xcdef('0x47')](_0xcdef('0xb2'),_['map'](_0xa9d820,'id'));return db[_0xcdef('0x9d')][_0xcdef('0x40')](_0x31866c['toString'](),_0x346c1d)[_0xcdef('0x2a')](function(_0xe9379a){var _0x47afc0=_[_0xcdef('0xb3')](_0xe9379a,_0xcdef('0xb4'));var _0x57b3e2=[];_0xa9d820[_0xcdef('0x73')](function(_0x14b484){_0x57b3e2[_0xcdef('0x34')](updateSmsInteraction(_0x14b484,_0x34e184,_0x47afc0));});return BPromise[_0xcdef('0xb5')](_0x57b3e2);});});})[_0xcdef('0x2a')](function(_0x3ded04){_0x179385[_0xcdef('0xb6')]=_0x3ded04;return _0x179385;})[_0xcdef('0x2a')](respondWithFilteredResult(_0x4a5845,_0x131247))['catch'](handleError(_0x4a5845,null));};exports['show']=function(_0x199c0a,_0x5e4e02){var _0x1e3f8a={'raw':![],'where':{'id':_0x199c0a[_0xcdef('0xb7')]['id']}},_0x3415a0={};_0x3415a0['model']=_[_0xcdef('0xb8')](db['SmsInteraction'][_0xcdef('0xb9')]);_0x3415a0['query']=_['keys'](_0x199c0a['query']);_0x3415a0[_0xcdef('0x48')]=_[_0xcdef('0x41')](_0x3415a0[_0xcdef('0x3f')],_0x3415a0[_0xcdef('0x40')]);_0x1e3f8a[_0xcdef('0x42')]=_[_0xcdef('0x41')](_0x3415a0[_0xcdef('0x3f')],qs[_0xcdef('0x43')](_0x199c0a['query']['fields']));_0x1e3f8a[_0xcdef('0x42')]=_0x1e3f8a[_0xcdef('0x42')][_0xcdef('0x44')]?_0x1e3f8a[_0xcdef('0x42')]:_0x3415a0[_0xcdef('0x3f')];if(_0x199c0a[_0xcdef('0x40')][_0xcdef('0xba')]){_0x1e3f8a[_0xcdef('0xbb')]=[{'all':!![]}];}_0x1e3f8a=_[_0xcdef('0xa0')]({},_0x1e3f8a,_0x199c0a[_0xcdef('0xbc')]);return db[_0xcdef('0x3d')][_0xcdef('0x62')](_0x1e3f8a)[_0xcdef('0x2a')](handleEntityNotFound(_0x5e4e02,null))[_0xcdef('0x2a')](respondWithResult(_0x5e4e02,null))['catch'](handleError(_0x5e4e02,null));};exports['create']=function(_0x38d935,_0x36f4df){return db[_0xcdef('0x3d')]['create'](_0x38d935['body'],{})['then'](respondWithResult(_0x36f4df,0xc9))['catch'](handleError(_0x36f4df,null));};exports[_0xcdef('0x29')]=function(_0x50d1de,_0x14ead5){if(_0x50d1de['body']['id']){delete _0x50d1de[_0xcdef('0x78')]['id'];}return db[_0xcdef('0x3d')]['find']({'where':{'id':_0x50d1de[_0xcdef('0xb7')]['id']}})[_0xcdef('0x2a')](handleEntityNotFound(_0x14ead5,null))[_0xcdef('0x2a')](saveUpdates(_0x50d1de[_0xcdef('0x78')],null))[_0xcdef('0x2a')](respondWithResult(_0x14ead5,null))[_0xcdef('0x35')](handleError(_0x14ead5,null));};exports[_0xcdef('0x2b')]=function(_0x3171da,_0x13ad35){return db['SmsInteraction'][_0xcdef('0x62')]({'where':{'id':_0x3171da[_0xcdef('0xb7')]['id']}})[_0xcdef('0x2a')](handleEntityNotFound(_0x13ad35,null))['then'](removeEntity(_0x13ad35,null))[_0xcdef('0x35')](handleError(_0x13ad35,null));};exports[_0xcdef('0xbd')]=function(_0x577db8,_0x4840fb){return db[_0xcdef('0x3d')][_0xcdef('0xbd')]()[_0xcdef('0x2a')](respondWithResult(_0x4840fb,null))[_0xcdef('0x35')](handleError(_0x4840fb,null));};exports[_0xcdef('0xbe')]=function(_0x5893d7,_0x3d1dab,_0x2f21e8){return db[_0xcdef('0xbf')][_0xcdef('0x62')]({'where':{'id':_0x5893d7[_0xcdef('0xb7')]['id']}})[_0xcdef('0x2a')](handleEntityNotFound(_0x3d1dab,null))[_0xcdef('0x2a')](function(_0x2f1af0){if(_0x2f1af0){return _0x2f1af0[_0xcdef('0xbe')](_0x5893d7[_0xcdef('0x78')]['ids'],_[_0xcdef('0xc0')](_0x5893d7[_0xcdef('0x78')],[_0xcdef('0xc1'),'id'])||{});}})['then'](respondWithResult(_0x3d1dab,null))[_0xcdef('0x35')](handleError(_0x3d1dab,null));};exports[_0xcdef('0xc2')]=function(_0x256841,_0xcb9292,_0x44e6f8){var _0x1ab6a6={'raw':![],'where':{}};var _0x873e63={};var _0xec1421={'count':0x0,'rows':[]};return db[_0xcdef('0x3d')]['findOne']({'where':{'id':_0x256841[_0xcdef('0xb7')]['id']}})[_0xcdef('0x2a')](handleEntityNotFound(_0xcb9292,null))[_0xcdef('0x2a')](function(_0x4057b9){if(_0x4057b9){_0x873e63[_0xcdef('0x3f')]=_[_0xcdef('0xb8')](db[_0xcdef('0xbf')][_0xcdef('0xb9')]);_0x873e63[_0xcdef('0x40')]=_[_0xcdef('0xb8')](_0x256841[_0xcdef('0x40')]);_0x873e63[_0xcdef('0x48')]=_[_0xcdef('0x41')](_0x873e63[_0xcdef('0x3f')],_0x873e63[_0xcdef('0x40')]);_0x1ab6a6['attributes']=_[_0xcdef('0x41')](_0x873e63[_0xcdef('0x3f')],qs[_0xcdef('0x43')](_0x256841[_0xcdef('0x40')]['fields']));_0x1ab6a6[_0xcdef('0x42')]=_0x1ab6a6[_0xcdef('0x42')][_0xcdef('0x44')]?_0x1ab6a6[_0xcdef('0x42')]:_0x873e63[_0xcdef('0x3f')];if(!_0x256841[_0xcdef('0x40')][_0xcdef('0x45')](_0xcdef('0x46'))){_0x1ab6a6[_0xcdef('0x23')]=qs[_0xcdef('0x23')](_0x256841[_0xcdef('0x40')][_0xcdef('0x23')]);_0x1ab6a6['offset']=qs[_0xcdef('0x21')](_0x256841['query']['offset']);}_0x1ab6a6['order']=qs['sort'](_0x256841[_0xcdef('0x40')][_0xcdef('0xc3')]);_0x1ab6a6[_0xcdef('0x47')]=qs[_0xcdef('0x48')](_['pick'](_0x256841[_0xcdef('0x40')],_0x873e63['filters']));_0x1ab6a6['where']['SmsInteractionId']=_0x4057b9['id'];if(_0x256841[_0xcdef('0x40')]['filter']){_0x1ab6a6['where']=_[_0xcdef('0xa0')](_0x1ab6a6[_0xcdef('0x47')],{'$or':_[_0xcdef('0x31')](_0x1ab6a6['attributes'],function(_0x585ee0){var _0x1b6d4f={};_0x1b6d4f[_0x585ee0]={'$like':'%'+_0x256841[_0xcdef('0x40')]['filter']+'%'};return _0x1b6d4f;})});}if(_0x256841[_0xcdef('0x40')][_0xcdef('0x7d')]){var _0x2b2d68=_0x256841[_0xcdef('0x40')][_0xcdef('0x7d')][_0xcdef('0xc4')](',');var _0x31fbbc={};_0x31fbbc[_0x2b2d68[0x0]]={'$gte':moment(_0x2b2d68[0x1])[_0xcdef('0xc5')](_0xcdef('0xc6'))};_0x1ab6a6['where']=_['merge'](_0x1ab6a6[_0xcdef('0x47')],_0x31fbbc);}_0x1ab6a6=_[_0xcdef('0xa0')]({},_0x1ab6a6,_0x256841[_0xcdef('0xbc')]);return db['SmsMessage'][_0xcdef('0x24')]({'where':_0x1ab6a6[_0xcdef('0x47')]})[_0xcdef('0x2a')](function(_0x1f7cba){_0xec1421[_0xcdef('0x24')]=_0x1f7cba;if(_0x256841[_0xcdef('0x40')][_0xcdef('0xba')]){_0x1ab6a6[_0xcdef('0xbb')]=[{'all':!![]}];}return db[_0xcdef('0xbf')][_0xcdef('0xc7')](_0x1ab6a6);})[_0xcdef('0x2a')](function(_0x345f0b){_0xec1421[_0xcdef('0xb6')]=_0x345f0b;return _0xec1421;});}})[_0xcdef('0x2a')](respondWithFilteredResult(_0xcb9292,_0x1ab6a6))[_0xcdef('0x35')](handleError(_0xcb9292,null));};exports[_0xcdef('0xc8')]=function(_0xaf5535,_0x3dde4c,_0x100413){return db[_0xcdef('0x3d')]['find']({'where':{'id':_0xaf5535[_0xcdef('0xb7')]['id']}})[_0xcdef('0x2a')](handleEntityNotFound(_0x3dde4c,null))['then'](function(_0x55eaff){if(_0x55eaff){return _0x55eaff[_0xcdef('0xc9')](_0xaf5535[_0xcdef('0x78')][_0xcdef('0xc1')],_[_0xcdef('0xc0')](_0xaf5535['body'],[_0xcdef('0xc1'),'id'])||{})[_0xcdef('0xca')](function(){return db[_0xcdef('0xcb')][_0xcdef('0xc7')]({'attributes':['id','name',_0xcdef('0x4c')],'where':{'id':_0xaf5535[_0xcdef('0x78')][_0xcdef('0xc1')]}});})[_0xcdef('0x2a')](function(_0x53c487){socket[_0xcdef('0xcc')](_0xcdef('0xcd'),{'id':Number(_0xaf5535[_0xcdef('0xb7')]['id']),'tags':_0x53c487||[]});return{'id':Number(_0xaf5535['params']['id']),'tags':_0x53c487||[]};});}})['then'](respondWithResult(_0x3dde4c,null))[_0xcdef('0x35')](handleError(_0x3dde4c,null));};exports[_0xcdef('0xce')]=function(_0x39f0d2,_0x4d5b45,_0x47d021){return db[_0xcdef('0x3d')]['find']({'where':{'id':_0x39f0d2[_0xcdef('0xb7')]['id']}})['then'](handleEntityNotFound(_0x4d5b45,null))[_0xcdef('0x2a')](function(_0x5d4b57){if(_0x5d4b57){return _0x5d4b57[_0xcdef('0xce')](_0x39f0d2[_0xcdef('0x40')]['ids']);}})['then'](respondWithStatusCode(_0x4d5b45,null))[_0xcdef('0x35')](handleError(_0x4d5b45,null));};exports[_0xcdef('0xcf')]=function(_0x244ce7,_0x3f02f3){var _0x4b8834=moment()[_0xcdef('0xd0')]()[_0xcdef('0x9e')]();var _0x189833=path[_0xcdef('0xd1')](config[_0xcdef('0xd2')],_0xcdef('0xd3'),'files','tmp');var _0x4113a8=path['join'](config[_0xcdef('0xd2')],_0xcdef('0xd3'),'files',_0xcdef('0xd4'));var _0x3753b6=path['join'](_0x189833,_0x4b8834);var _0x513b92=util[_0xcdef('0xc5')](_0xcdef('0xd5'),_0x244ce7[_0xcdef('0xb7')]['id'],_0x4b8834);var _0x20c1b4=path[_0xcdef('0xd1')](_0x189833,_0x513b92);var _0x571cf3=[];_0x571cf3['push']({'model':db[_0xcdef('0x76')],'as':_0xcdef('0x76'),'attributes':['id',_0xcdef('0xd6')],'raw':!![]});_0x571cf3[_0xcdef('0x34')]({'model':db[_0xcdef('0xd7')],'as':'Contact','attributes':['id',_0xcdef('0xd8'),'lastName'],'raw':!![]});var _0x21c9f9=[{'model':db[_0xcdef('0xbf')],'as':'Messages','attributes':['id',_0xcdef('0x78'),_0xcdef('0x7c'),_0xcdef('0xd9'),'secret',_0xcdef('0x82')],'include':_0x571cf3}];_0x21c9f9[_0xcdef('0x34')]({'model':db[_0xcdef('0xda')],'as':_0xcdef('0xdb'),'attributes':['id',_0xcdef('0x2e')]});_0x21c9f9['push']({'model':db['User'],'as':_0xcdef('0xdc'),'attributes':['id','fullname']});return db[_0xcdef('0x3d')][_0xcdef('0x62')]({'where':{'id':_0x244ce7[_0xcdef('0xb7')]['id']},'include':_0x21c9f9})[_0xcdef('0x2a')](handleEntityNotFound(_0x3f02f3,null))[_0xcdef('0x2a')](function(_0x3d82c0){if(_0x3d82c0){var _0xb56399=_0x3d82c0['get']({'plain':!![]});fs[_0xcdef('0xdd')](_0x3753b6);var _0x146b71={'channel':_0xcdef('0xde'),'account':_0xb56399[_0xcdef('0xdb')][_0xcdef('0x2e')],'agent':_0xb56399[_0xcdef('0xdc')]?_0xb56399['Owner'][_0xcdef('0xd6')]:'N.A.','createdAt':moment(_0xb56399['createdAt'])[_0xcdef('0xc5')](_0xcdef('0xc6'))[_0xcdef('0x9e')](),'closedAt':_0xb56399[_0xcdef('0x37')]?moment(_0xb56399[_0xcdef('0xdf')])[_0xcdef('0xc5')](_0xcdef('0xc6'))[_0xcdef('0x9e')]():'','disposition':_0xb56399[_0xcdef('0xe0')],'messages':_(_0xb56399['Messages'])[_0xcdef('0x85')]({'secret':![]})[_0xcdef('0x31')](function(_0x2975c5){return{'date':moment(_0x2975c5[_0xcdef('0x7c')])['format'](_0xcdef('0xc6'))[_0xcdef('0x9e')](),'sender':_0x2975c5[_0xcdef('0xd9')]==='out'?_0x2975c5['User']?_0x2975c5[_0xcdef('0x76')][_0xcdef('0xd6')]:_0xcdef('0xe1'):_0x2975c5[_0xcdef('0x68')]['firstName']+(_0x2975c5['Contact']['lastName']?'\x20'+_0x2975c5[_0xcdef('0x68')][_0xcdef('0xe2')]:''),'body':_0x2975c5[_0xcdef('0x78')],'direction':_0x2975c5[_0xcdef('0xd9')]===_0xcdef('0xe3')?'A':'C','secret':_0x2975c5[_0xcdef('0xe4')],'read':_0x2975c5[_0xcdef('0x82')]};})[_0xcdef('0x64')]()};return ejs[_0xcdef('0xe5')](path[_0xcdef('0xd1')](config[_0xcdef('0xd2')],_0xcdef('0xd3'),_0xcdef('0xe6'),'downloadInteraction.ejs'),{'interaction':_0x146b71})[_0xcdef('0x2a')](function(_0x440c00){var _0x15211a=path[_0xcdef('0xd1')](_0x3753b6,_0xcdef('0xe7')+_0xb56399['id']+'-'+_0x4b8834+'.pdf');var _0x24bf9a={'path':_0x15211a,'channel':'Sms','interactionId':_0xb56399['id']};return pdf[_0xcdef('0xe8')](_0x440c00,_0x24bf9a);})[_0xcdef('0x2a')](function(){return new BPromise(function(_0xcdbd14,_0x34f358){zipdir(_0x3753b6,{'saveTo':_0x20c1b4},function(_0x4f9ec4,_0xac36d8){if(_0x4f9ec4)return _0x34f358(_0x4f9ec4);return _0xcdbd14(_0xac36d8);});})['then'](function(){return new BPromise(function(_0x498453,_0x371246){rimraf(_0x3753b6,function(_0x5ec8ad){if(_0x5ec8ad)_0x371246(_0x5ec8ad);return _0x498453();});});})['then'](function(){return _0x3f02f3[_0xcdef('0xcf')](_0x20c1b4,_0x513b92,function(_0x46920d){if(_0x46920d){console['log']('err',_0x46920d);}else{fs[_0xcdef('0xe9')](_0x20c1b4);}});});});}else{return _0x3f02f3['sendStatus'](0xc8);}})[_0xcdef('0x35')](handleError(_0x3f02f3,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 47e6aa8..493ab66 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 _0x583c=['../../mysqldb','SmsInteraction','setMaxListeners','save','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','hasOwnProperty','hook','events'];(function(_0x280604,_0x4e3836){var _0x524697=function(_0x552adc){while(--_0x552adc){_0x280604['push'](_0x280604['shift']());}};_0x524697(++_0x4e3836);}(_0x583c,0x12b));var _0xc583=function(_0x72895a,_0x433607){_0x72895a=_0x72895a-0x0;var _0x5226d5=_0x583c[_0x72895a];return _0x5226d5;};'use strict';var EventEmitter=require(_0xc583('0x0'));var SmsInteraction=require(_0xc583('0x1'))['db'][_0xc583('0x2')];var SmsMessage=require(_0xc583('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc583('0x3')](0x0);var events={'afterCreate':_0xc583('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x13b8a7){return function(_0xf03852,_0x5b7292,_0xd3a750){_0xf03852[_0xc583('0x5')]({'attributes':['id'],'raw':!![]})[_0xc583('0x6')](function(_0x1dd37c){_0xf03852['setDataValue'](_0xc583('0x7'),_0x1dd37c[_0xc583('0x8')](function(_0x5b456e){return{'id':_0x5b456e['id']};}));return SmsMessage[_0xc583('0x9')]({'where':{'SmsInteractionId':_0xf03852['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc583('0x6')](function(_0x25f8d3){_0xf03852[_0xc583('0xa')](_0xc583('0xb'),_0x25f8d3['length']);SmsInteractionEvents[_0xc583('0xc')](_0x13b8a7+':'+_0xf03852['id'],_0xf03852);SmsInteractionEvents[_0xc583('0xc')](_0x13b8a7,_0xf03852);_0xd3a750(null);})['catch'](_0xd3a750(null));};}for(var e in events){if(events[_0xc583('0xd')](e)){var event=events[e];SmsInteraction[_0xc583('0xe')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x6d11=['../../mysqldb','SmsInteraction','SmsMessage','save','update','getUsers','then','setDataValue','findAll','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x2f00f3,_0x170a5d){var _0x3b1b4d=function(_0x59e3bb){while(--_0x59e3bb){_0x2f00f3['push'](_0x2f00f3['shift']());}};_0x3b1b4d(++_0x170a5d);}(_0x6d11,0xbf));var _0x16d1=function(_0x76276a,_0x27008f){_0x76276a=_0x76276a-0x0;var _0x3dadcc=_0x6d11[_0x76276a];return _0x3dadcc;};'use strict';var EventEmitter=require(_0x16d1('0x0'));var SmsInteraction=require(_0x16d1('0x1'))['db'][_0x16d1('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0x16d1('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x16d1('0x4'),'afterUpdate':_0x16d1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x48754e){return function(_0x3e0e86,_0x46f7d7,_0x3eb9e2){_0x3e0e86[_0x16d1('0x6')]({'attributes':['id'],'raw':!![]})[_0x16d1('0x7')](function(_0x150217){_0x3e0e86[_0x16d1('0x8')]('Users',_0x150217['map'](function(_0x4fca47){return{'id':_0x4fca47['id']};}));return SmsMessage[_0x16d1('0x9')]({'where':{'SmsInteractionId':_0x3e0e86['id'],'direction':'in','read':![]},'raw':!![]});})[_0x16d1('0x7')](function(_0xe67758){_0x3e0e86[_0x16d1('0x8')]('unreadMessages',_0xe67758[_0x16d1('0xa')]);SmsInteractionEvents[_0x16d1('0xb')](_0x48754e+':'+_0x3e0e86['id'],_0x3e0e86);SmsInteractionEvents[_0x16d1('0xb')](_0x48754e,_0x3e0e86);_0x3eb9e2(null);})[_0x16d1('0xc')](_0x3eb9e2(null));};}for(var e in events){if(events[_0x16d1('0xd')](e)){var event=events[e];SmsInteraction[_0x16d1('0xe')](e,emitEvent(event));}}module[_0x16d1('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 0bc1f6b..4e9241e 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 _0x0895=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','sms_interactions','changed','closedAt','format'];(function(_0x2d948d,_0x2b55cd){var _0x766a39=function(_0x2498d0){while(--_0x2498d0){_0x2d948d['push'](_0x2d948d['shift']());}};_0x766a39(++_0x2b55cd);}(_0x0895,0x1c7));var _0x5089=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0895[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5089('0x0'));var util=require(_0x5089('0x1'));var logger=require(_0x5089('0x2'))(_0x5089('0x3'));var moment=require(_0x5089('0x4'));var BPromise=require(_0x5089('0x5'));var rp=require(_0x5089('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5089('0x7'));var config=require(_0x5089('0x8'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x392b9f,_0x9f8b63){return _0x392b9f['define']('SmsInteraction',attributes,{'tableName':_0x5089('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x32c346,_0x5b14c4,_0x422cd0){if(_0x32c346[_0x5089('0xa')]('closed')){_0x32c346[_0x5089('0xb')]=moment()[_0x5089('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x422cd0(null,_0x32c346);}}});}; \ No newline at end of file +var _0x4ccb=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','closed','closedAt'];(function(_0x1bd887,_0x1003f8){var _0x5596ca=function(_0x460049){while(--_0x460049){_0x1bd887['push'](_0x1bd887['shift']());}};_0x5596ca(++_0x1003f8);}(_0x4ccb,0x15b));var _0xb4cc=function(_0x29c74c,_0x3a40ae){_0x29c74c=_0x29c74c-0x0;var _0x350a29=_0x4ccb[_0x29c74c];return _0x350a29;};'use strict';var _=require(_0xb4cc('0x0'));var util=require('util');var logger=require(_0xb4cc('0x1'))(_0xb4cc('0x2'));var moment=require(_0xb4cc('0x3'));var BPromise=require('bluebird');var rp=require(_0xb4cc('0x4'));var fs=require('fs');var path=require(_0xb4cc('0x5'));var rimraf=require(_0xb4cc('0x6'));var config=require('../../config/environment');var attributes=require(_0xb4cc('0x7'));module['exports']=function(_0x413722,_0x395031){return _0x413722[_0xb4cc('0x8')](_0xb4cc('0x9'),attributes,{'tableName':_0xb4cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e43e1,_0x5ae43a,_0x5487ea){if(_0x2e43e1['changed'](_0xb4cc('0xb'))){_0x2e43e1[_0xb4cc('0xc')]=moment()[_0xb4cc('0xd')](_0xb4cc('0xe'));}_0x5487ea(null,_0x2e43e1);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a6bd835..512fb30 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 _0x65a6=['http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','SmsInteraction','update','body','options','raw','where','attributes','UpdateSmsInteraction','AddTagsToSmsInteraction','addTags','ids','AddTags','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1095fc,_0x371fd8){var _0xd801f8=function(_0xd51217){while(--_0xd51217){_0x1095fc['push'](_0x1095fc['shift']());}};_0xd801f8(++_0x371fd8);}(_0x65a6,0x73));var _0x665a=function(_0x21353c,_0x2ea587){_0x21353c=_0x21353c-0x0;var _0xa99120=_0x65a6[_0x21353c];return _0xa99120;};'use strict';var _=require('lodash');var util=require(_0x665a('0x0'));var moment=require(_0x665a('0x1'));var BPromise=require(_0x665a('0x2'));var rs=require(_0x665a('0x3'));var fs=require('fs');var Redis=require(_0x665a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x665a('0x5'));var logger=require(_0x665a('0x6'))(_0x665a('0x7'));var config=require(_0x665a('0x8'));var jayson=require(_0x665a('0x9'));var client=jayson[_0x665a('0xa')][_0x665a('0xb')]({'port':0x232a});config[_0x665a('0xc')]=_['defaults'](config[_0x665a('0xc')],{'host':_0x665a('0xd'),'port':0x18eb});var socket=require(_0x665a('0xe'))(new Redis(config[_0x665a('0xc')]));require(_0x665a('0xf'))[_0x665a('0x10')](socket);function respondWithRpcPromise(_0x46fca6,_0x4e7ff8,_0x203e72){return new BPromise(function(_0x223c42,_0x554a45){return client[_0x665a('0x11')](_0x46fca6,_0x203e72)[_0x665a('0x12')](function(_0x381269){logger['info'](_0x665a('0x13'),_0x4e7ff8,'request\x20sent');logger[_0x665a('0x14')](_0x665a('0x15'),_0x4e7ff8,_0x665a('0x16'),JSON[_0x665a('0x17')](_0x381269));if(_0x381269['error']){if(_0x381269[_0x665a('0x18')][_0x665a('0x19')]===0x1f4){logger['error'](_0x665a('0x13'),_0x4e7ff8,_0x381269['error'][_0x665a('0x1a')]);return _0x554a45(_0x381269[_0x665a('0x18')]['message']);}logger[_0x665a('0x18')](_0x665a('0x13'),_0x4e7ff8,_0x381269[_0x665a('0x18')][_0x665a('0x1a')]);return _0x223c42(_0x381269[_0x665a('0x18')][_0x665a('0x1a')]);}else{logger[_0x665a('0x1b')](_0x665a('0x13'),_0x4e7ff8,_0x665a('0x16'));_0x223c42(_0x381269[_0x665a('0x1c')][_0x665a('0x1a')]);}})['catch'](function(_0x1addf7){logger[_0x665a('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x4e7ff8,_0x1addf7);_0x554a45(_0x1addf7);});});}exports['UpdateSmsInteraction']=function(_0x106fa0){var _0x13f1f7=this;return new Promise(function(_0x3c49a1,_0x167980){return db[_0x665a('0x1d')][_0x665a('0x1e')](_0x106fa0[_0x665a('0x1f')],{'raw':_0x106fa0[_0x665a('0x20')]?_0x106fa0[_0x665a('0x20')][_0x665a('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x106fa0[_0x665a('0x20')]?_0x106fa0[_0x665a('0x20')][_0x665a('0x22')]||null:null,'attributes':_0x106fa0['options']?_0x106fa0['options'][_0x665a('0x23')]||null:null,'limit':_0x106fa0[_0x665a('0x20')]?_0x106fa0['options']['limit']||null:null})['then'](function(_0x28470a){logger['info'](_0x665a('0x24'),_0x106fa0);logger[_0x665a('0x14')]('UpdateSmsInteraction',_0x106fa0,JSON[_0x665a('0x17')](_0x28470a));_0x3c49a1(_0x28470a);})['catch'](function(_0x26969a){logger['error'](_0x665a('0x24'),_0x26969a[_0x665a('0x1a')],_0x106fa0);_0x167980(_0x13f1f7[_0x665a('0x18')](0x1f4,_0x26969a['message']));});});};exports[_0x665a('0x25')]=function(_0x540d28){return new Promise(function(_0x3238bd,_0x3766d0){return db['SmsInteraction']['find']({'where':_0x540d28[_0x665a('0x20')]?_0x540d28['options'][_0x665a('0x22')]||null:null})[_0x665a('0x12')](function(_0x3b6be1){if(_0x3b6be1){return _0x3b6be1[_0x665a('0x26')](_0x540d28[_0x665a('0x1f')][_0x665a('0x27')],_['omit'](_0x540d28[_0x665a('0x1f')],[_0x665a('0x27'),'id'])||{});}})['spread'](function(_0x246e83){logger['info']('AddTags',_0x540d28);logger['debug'](_0x665a('0x28'),_0x540d28,JSON['stringify'](_0x246e83));_0x3238bd(_0x246e83);})[_0x665a('0x29')](function(_0x1b0685){logger[_0x665a('0x18')](_0x665a('0x28'),_0x1b0685[_0x665a('0x1a')],_0x540d28);_0x3766d0(_this[_0x665a('0x18')](0x1f4,_0x1b0685[_0x665a('0x1a')]));});});}; \ No newline at end of file +var _0xef39=['SmsInteraction','update','body','options','where','attributes','stringify','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateSmsInteraction'];(function(_0x1e9a62,_0x974d3a){var _0x30c9ce=function(_0x33f39f){while(--_0x33f39f){_0x1e9a62['push'](_0x1e9a62['shift']());}};_0x30c9ce(++_0x974d3a);}(_0xef39,0x8f));var _0x9ef3=function(_0x5d4dd8,_0x4bf552){_0x5d4dd8=_0x5d4dd8-0x0;var _0x3bce32=_0xef39[_0x5d4dd8];return _0x3bce32;};'use strict';var _=require(_0x9ef3('0x0'));var util=require(_0x9ef3('0x1'));var moment=require(_0x9ef3('0x2'));var BPromise=require(_0x9ef3('0x3'));var rs=require(_0x9ef3('0x4'));var fs=require('fs');var Redis=require(_0x9ef3('0x5'));var db=require(_0x9ef3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ef3('0x7'))(_0x9ef3('0x8'));var config=require(_0x9ef3('0x9'));var jayson=require(_0x9ef3('0xa'));var client=jayson[_0x9ef3('0xb')][_0x9ef3('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9ef3('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x9ef3('0xe'))(new Redis(config[_0x9ef3('0xd')]));require('./smsInteraction.socket')[_0x9ef3('0xf')](socket);function respondWithRpcPromise(_0xb94a2b,_0x109e90,_0x5ac425){return new BPromise(function(_0x2f83b5,_0x2246e0){return client[_0x9ef3('0x10')](_0xb94a2b,_0x5ac425)[_0x9ef3('0x11')](function(_0x33e792){logger[_0x9ef3('0x12')](_0x9ef3('0x13'),_0x109e90,_0x9ef3('0x14'));logger[_0x9ef3('0x15')](_0x9ef3('0x16'),_0x109e90,_0x9ef3('0x14'),JSON['stringify'](_0x33e792));if(_0x33e792[_0x9ef3('0x17')]){if(_0x33e792[_0x9ef3('0x17')][_0x9ef3('0x18')]===0x1f4){logger[_0x9ef3('0x17')](_0x9ef3('0x13'),_0x109e90,_0x33e792[_0x9ef3('0x17')][_0x9ef3('0x19')]);return _0x2246e0(_0x33e792[_0x9ef3('0x17')][_0x9ef3('0x19')]);}logger['error'](_0x9ef3('0x13'),_0x109e90,_0x33e792[_0x9ef3('0x17')][_0x9ef3('0x19')]);return _0x2f83b5(_0x33e792[_0x9ef3('0x17')][_0x9ef3('0x19')]);}else{logger[_0x9ef3('0x12')](_0x9ef3('0x13'),_0x109e90,_0x9ef3('0x14'));_0x2f83b5(_0x33e792[_0x9ef3('0x1a')][_0x9ef3('0x19')]);}})[_0x9ef3('0x1b')](function(_0x3920bb){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x109e90,_0x3920bb);_0x2246e0(_0x3920bb);});});}exports[_0x9ef3('0x1c')]=function(_0x3a96d2){var _0x334ec9=this;return new Promise(function(_0x331df1,_0x4e05c7){return db[_0x9ef3('0x1d')][_0x9ef3('0x1e')](_0x3a96d2[_0x9ef3('0x1f')],{'raw':_0x3a96d2[_0x9ef3('0x20')]?_0x3a96d2[_0x9ef3('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a96d2[_0x9ef3('0x20')]?_0x3a96d2[_0x9ef3('0x20')][_0x9ef3('0x21')]||null:null,'attributes':_0x3a96d2[_0x9ef3('0x20')]?_0x3a96d2['options'][_0x9ef3('0x22')]||null:null,'limit':_0x3a96d2['options']?_0x3a96d2[_0x9ef3('0x20')]['limit']||null:null})[_0x9ef3('0x11')](function(_0x1113c9){logger['info']('UpdateSmsInteraction',_0x3a96d2);logger[_0x9ef3('0x15')](_0x9ef3('0x1c'),_0x3a96d2,JSON[_0x9ef3('0x23')](_0x1113c9));_0x331df1(_0x1113c9);})[_0x9ef3('0x1b')](function(_0x34b0ad){logger[_0x9ef3('0x17')](_0x9ef3('0x1c'),_0x34b0ad[_0x9ef3('0x19')],_0x3a96d2);_0x4e05c7(_0x334ec9[_0x9ef3('0x17')](0x1f4,_0x34b0ad[_0x9ef3('0x19')]));});});};exports[_0x9ef3('0x24')]=function(_0x3fb8ef){return new Promise(function(_0x538a6c,_0x27ea5){return db[_0x9ef3('0x1d')][_0x9ef3('0x25')]({'where':_0x3fb8ef[_0x9ef3('0x20')]?_0x3fb8ef[_0x9ef3('0x20')][_0x9ef3('0x21')]||null:null})[_0x9ef3('0x11')](function(_0x4e2f57){if(_0x4e2f57){return _0x4e2f57[_0x9ef3('0x26')](_0x3fb8ef[_0x9ef3('0x1f')][_0x9ef3('0x27')],_[_0x9ef3('0x28')](_0x3fb8ef[_0x9ef3('0x1f')],['ids','id'])||{});}})[_0x9ef3('0x29')](function(_0x36feca){logger['info']('AddTags',_0x3fb8ef);logger[_0x9ef3('0x15')](_0x9ef3('0x2a'),_0x3fb8ef,JSON[_0x9ef3('0x23')](_0x36feca));_0x538a6c(_0x36feca);})[_0x9ef3('0x1b')](function(_0x482407){logger[_0x9ef3('0x17')](_0x9ef3('0x2a'),_0x482407[_0x9ef3('0x19')],_0x3fb8ef);_0x27ea5(_this[_0x9ef3('0x17')](0x1f4,_0x482407['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 0fa2495..4ebb1cb 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 _0x198f=['./smsInteraction.events','emit','removeListener','register','length'];(function(_0x402b7e,_0x35fdf7){var _0x55f359=function(_0x20721e){while(--_0x20721e){_0x402b7e['push'](_0x402b7e['shift']());}};_0x55f359(++_0x35fdf7);}(_0x198f,0xa5));var _0xf198=function(_0xe90990,_0x539ad6){_0xe90990=_0xe90990-0x0;var _0x3d7171=_0x198f[_0xe90990];return _0x3d7171;};'use strict';var SmsInteractionEvents=require(_0xf198('0x0'));var events=['save','remove','update'];function createListener(_0x164d4a,_0xf50ea){return function(_0x4b3fe5){_0xf50ea[_0xf198('0x1')](_0x164d4a,_0x4b3fe5);};}function removeListener(_0x362794,_0x3b6445){return function(){SmsInteractionEvents[_0xf198('0x2')](_0x362794,_0x3b6445);};}exports[_0xf198('0x3')]=function(_0x49b316){for(var _0x235059=0x0,_0x1ae999=events[_0xf198('0x4')];_0x235059<_0x1ae999;_0x235059++){var _0x4dc5f7=events[_0x235059];var _0x4dfb02=createListener('smsInteraction:'+_0x4dc5f7,_0x49b316);SmsInteractionEvents['on'](_0x4dc5f7,_0x4dfb02);}}; \ No newline at end of file +var _0xe51f=['update','emit','removeListener','register','length','./smsInteraction.events','save','remove'];(function(_0x5c85c2,_0x268476){var _0xfacfbb=function(_0xe3abe4){while(--_0xe3abe4){_0x5c85c2['push'](_0x5c85c2['shift']());}};_0xfacfbb(++_0x268476);}(_0xe51f,0x1d5));var _0xfe51=function(_0x308184,_0x52c89f){_0x308184=_0x308184-0x0;var _0x38c016=_0xe51f[_0x308184];return _0x38c016;};'use strict';var SmsInteractionEvents=require(_0xfe51('0x0'));var events=[_0xfe51('0x1'),_0xfe51('0x2'),_0xfe51('0x3')];function createListener(_0x59058d,_0x4784fa){return function(_0x260dcd){_0x4784fa[_0xfe51('0x4')](_0x59058d,_0x260dcd);};}function removeListener(_0xb25465,_0x2cd030){return function(){SmsInteractionEvents[_0xfe51('0x5')](_0xb25465,_0x2cd030);};}exports[_0xfe51('0x6')]=function(_0x13aa8b){for(var _0x4de179=0x0,_0x335d2c=events[_0xfe51('0x7')];_0x4de179<_0x335d2c;_0x4de179++){var _0x42e735=events[_0x4de179];var _0x52f6d2=createListener('smsInteraction:'+_0x42e735,_0x13aa8b);SmsInteractionEvents['on'](_0x42e735,_0x52f6d2);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index bd1f8d0..caa5229 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 _0xfba1=['get','index','/describe','describe','/:id','isAuthenticated','show','tracked','sms','smsmessage:create','post','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller'];(function(_0x3f9890,_0x5b969a){var _0xb60ab6=function(_0x3813fb){while(--_0x3813fb){_0x3f9890['push'](_0x3f9890['shift']());}};_0xb60ab6(++_0x5b969a);}(_0xfba1,0x1e5));var _0x1fba=function(_0x593bc8,_0x16635a){_0x593bc8=_0x593bc8-0x0;var _0x1e2089=_0xfba1[_0x593bc8];return _0x1e2089;};'use strict';var multer=require('multer');var util=require(_0x1fba('0x0'));var path=require('path');var timeout=require(_0x1fba('0x1'));var express=require(_0x1fba('0x2'));var router=express[_0x1fba('0x3')]();var fs_extra=require(_0x1fba('0x4'));var auth=require(_0x1fba('0x5'));var interaction=require(_0x1fba('0x6'));var config=require('../../config/environment');var controller=require(_0x1fba('0x7'));router[_0x1fba('0x8')]('/',auth['isAuthenticated'](),controller[_0x1fba('0x9')]);router[_0x1fba('0x8')](_0x1fba('0xa'),auth['isAuthenticated'](),controller[_0x1fba('0xb')]);router['get'](_0x1fba('0xc'),auth[_0x1fba('0xd')](),controller[_0x1fba('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x1fba('0xf')](_0x1fba('0x10'),_0x1fba('0x11')),controller['create']);router[_0x1fba('0x12')](_0x1fba('0x13'),controller[_0x1fba('0x14')]);router[_0x1fba('0x15')](_0x1fba('0xc'),auth[_0x1fba('0xd')](),controller[_0x1fba('0x16')]);router[_0x1fba('0x15')](_0x1fba('0x17'),auth[_0x1fba('0xd')](),controller[_0x1fba('0x18')]);router['put'](_0x1fba('0x19'),auth[_0x1fba('0xd')](),controller[_0x1fba('0x1a')]);router['delete'](_0x1fba('0xc'),auth[_0x1fba('0xd')](),controller[_0x1fba('0x1b')]);module[_0x1fba('0x1c')]=router; \ No newline at end of file +var _0xc9cb=['status','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/:id','show','post','tracked','smsmessage:create','create','/:id/status'];(function(_0x2c2528,_0x66874d){var _0x407fd8=function(_0x167c59){while(--_0x167c59){_0x2c2528['push'](_0x2c2528['shift']());}};_0x407fd8(++_0x66874d);}(_0xc9cb,0x14d));var _0xbc9c=function(_0x5c4185,_0x3026c5){_0x5c4185=_0x5c4185-0x0;var _0x592c7b=_0xc9cb[_0x5c4185];return _0x592c7b;};'use strict';var multer=require(_0xbc9c('0x0'));var util=require('util');var path=require(_0xbc9c('0x1'));var timeout=require(_0xbc9c('0x2'));var express=require(_0xbc9c('0x3'));var router=express['Router']();var fs_extra=require(_0xbc9c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbc9c('0x5'));var config=require(_0xbc9c('0x6'));var controller=require(_0xbc9c('0x7'));router['get']('/',auth[_0xbc9c('0x8')](),controller[_0xbc9c('0x9')]);router[_0xbc9c('0xa')]('/describe',auth[_0xbc9c('0x8')](),controller['describe']);router[_0xbc9c('0xa')](_0xbc9c('0xb'),auth[_0xbc9c('0x8')](),controller[_0xbc9c('0xc')]);router[_0xbc9c('0xd')]('/',auth[_0xbc9c('0x8')](),interaction[_0xbc9c('0xe')]('sms',_0xbc9c('0xf')),controller[_0xbc9c('0x10')]);router['post'](_0xbc9c('0x11'),controller[_0xbc9c('0x12')]);router[_0xbc9c('0x13')](_0xbc9c('0xb'),auth[_0xbc9c('0x8')](),controller[_0xbc9c('0x14')]);router[_0xbc9c('0x13')](_0xbc9c('0x15'),auth[_0xbc9c('0x8')](),controller[_0xbc9c('0x16')]);router[_0xbc9c('0x13')](_0xbc9c('0x17'),auth[_0xbc9c('0x8')](),controller['reject']);router[_0xbc9c('0x18')]('/:id',auth[_0xbc9c('0x8')](),controller[_0xbc9c('0x19')]);module[_0xbc9c('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index e114bfd..054de16 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 _0x9494=['out','STRING','DATE','TEXT','exports','BOOLEAN','ENUM'];(function(_0xcee9e8,_0x26cbf4){var _0x5cad14=function(_0xe4ebb2){while(--_0xe4ebb2){_0xcee9e8['push'](_0xcee9e8['shift']());}};_0x5cad14(++_0x26cbf4);}(_0x9494,0xcf));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x4949('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4949('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4949('0x2')]('in',_0x4949('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x4949('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x4949('0x5')]},'secret':{'type':Sequelize[_0x4949('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x4949('0x6')]}}; \ No newline at end of file +var _0xdbcf=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x2b68eb,_0x1ba4e7){var _0x5d93d5=function(_0x2a26e9){while(--_0x2a26e9){_0x2b68eb['push'](_0x2b68eb['shift']());}};_0x5d93d5(++_0x1ba4e7);}(_0xdbcf,0x158));var _0xfdbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdbcf[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfdbc('0x0'));module[_0xfdbc('0x1')]={'body':{'type':Sequelize[_0xfdbc('0x2')](_0xfdbc('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xfdbc('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfdbc('0x5')]('in',_0xfdbc('0x6')),'defaultValue':_0xfdbc('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xfdbc('0x7')]},'secret':{'type':Sequelize[_0xfdbc('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xfdbc('0x8')]},'providerResponse':{'type':Sequelize[_0xfdbc('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index b78cabe..f3e47ae 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 _0xd4ad=['UserId','user','agent','get','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','channel','event','EventManager','acceptmessage','sms-interactions','reject','SmsInteraction','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','fullname','SIP/%s','motionChannel','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageUUID','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./smsMessage.socket','client','request','info','request\x20sent','debug','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','stack','name','index','rawAttributes','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','SmsMessage','then','includeAll','include','findAll','rows','show','params','create','body','catch','find','describe','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x6907a5,_0x5861a8){var _0x5d852c=function(_0x19a651){while(--_0x19a651){_0x6907a5['push'](_0x6907a5['shift']());}};_0x5d852c(++_0x5861a8);}(_0xd4ad,0x158));var _0xdd4a=function(_0x22af33,_0x490a9d){_0x22af33=_0x22af33-0x0;var _0x4d1b60=_0xd4ad[_0x22af33];return _0x4d1b60;};'use strict';var emlformat=require(_0xdd4a('0x0'));var rimraf=require(_0xdd4a('0x1'));var zipdir=require(_0xdd4a('0x2'));var jsonpatch=require(_0xdd4a('0x3'));var rp=require('request-promise');var moment=require(_0xdd4a('0x4'));var BPromise=require(_0xdd4a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdd4a('0x6'));var sox=require(_0xdd4a('0x7'));var csv=require('to-csv');var ejs=require(_0xdd4a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd4a('0x9'));var squel=require(_0xdd4a('0xa'));var crypto=require('crypto');var jsforce=require(_0xdd4a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdd4a('0xc'));var querystring=require(_0xdd4a('0xd'));var Papa=require(_0xdd4a('0xe'));var Redis=require(_0xdd4a('0xf'));var authService=require(_0xdd4a('0x10'));var qs=require(_0xdd4a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd4a('0x12'))('api');var utils=require(_0xdd4a('0x13'));var config=require(_0xdd4a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd4a('0x15'))['db'];config[_0xdd4a('0x16')]=_['defaults'](config[_0xdd4a('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd4a('0x17'))(new Redis(config['redis']));require(_0xdd4a('0x18'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xdd4a('0x19')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2971b6,_0x898d87,_0xe41bc0,_0x2bdd14){return new BPromise(function(_0x37d755,_0x335bb6){var _0x154364=_0x2bdd14||client;return _0x154364[_0xdd4a('0x1a')](_0x2971b6,_0xe41bc0)['then'](function(_0x3c3fdd){logger[_0xdd4a('0x1b')]('SmsMessage,\x20%s,\x20%s',_0x898d87,_0xdd4a('0x1c'));logger[_0xdd4a('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x898d87,_0xdd4a('0x1c'),JSON[_0xdd4a('0x1e')](_0x3c3fdd));if(_0x3c3fdd[_0xdd4a('0x1f')]){if(_0x3c3fdd[_0xdd4a('0x1f')][_0xdd4a('0x20')]===0x1f4){logger[_0xdd4a('0x1f')](_0xdd4a('0x21'),_0x898d87,_0x3c3fdd['error']['message']);return _0x335bb6(_0x3c3fdd['error']['message']);}logger[_0xdd4a('0x1f')](_0xdd4a('0x21'),_0x898d87,_0x3c3fdd[_0xdd4a('0x1f')][_0xdd4a('0x22')]);return _0x37d755(_0x3c3fdd[_0xdd4a('0x1f')]['message']);}else{logger[_0xdd4a('0x1b')](_0xdd4a('0x21'),_0x898d87,_0xdd4a('0x1c'));_0x37d755(_0x3c3fdd[_0xdd4a('0x23')]['message']);}})['catch'](function(_0x5301ee){logger['error'](_0xdd4a('0x21'),_0x898d87,_0x5301ee);_0x335bb6(_0x5301ee);});});}function respondWithStatusCode(_0x516667,_0x537099){_0x537099=_0x537099||0xcc;return function(_0x26846d){if(_0x26846d){return _0x516667[_0xdd4a('0x24')](_0x537099);}return _0x516667[_0xdd4a('0x25')](_0x537099)[_0xdd4a('0x26')]();};}function respondWithResult(_0x6eaea3,_0x28e499){_0x28e499=_0x28e499||0xc8;return function(_0x4d2b89){if(_0x4d2b89){return _0x6eaea3[_0xdd4a('0x25')](_0x28e499)[_0xdd4a('0x27')](_0x4d2b89);}};}function respondWithFilteredResult(_0x540597,_0x10cf52){return function(_0x48cd1e){if(_0x48cd1e){var _0x5f1a9e=typeof _0x10cf52[_0xdd4a('0x28')]===_0xdd4a('0x29')&&typeof _0x10cf52[_0xdd4a('0x2a')]==='undefined';var _0x117d2a=_0x48cd1e[_0xdd4a('0x2b')];var _0x292d67=_0x5f1a9e?0x0:_0x10cf52['offset'];var _0x2b6d01=_0x5f1a9e?_0x48cd1e['count']:_0x10cf52[_0xdd4a('0x28')]+_0x10cf52[_0xdd4a('0x2a')];var _0x87a9a7;if(_0x2b6d01>=_0x117d2a){_0x2b6d01=_0x117d2a;_0x87a9a7=0xc8;}else{_0x87a9a7=0xce;}_0x540597['status'](_0x87a9a7);return _0x540597[_0xdd4a('0x2c')](_0xdd4a('0x2d'),_0x292d67+'-'+_0x2b6d01+'/'+_0x117d2a)['json'](_0x48cd1e);}return null;};}function patchUpdates(_0x40c826){return function(_0x456627){try{jsonpatch['apply'](_0x456627,_0x40c826,!![]);}catch(_0x17f253){return BPromise['reject'](_0x17f253);}return _0x456627[_0xdd4a('0x2e')]();};}function saveUpdates(_0x20c9d5,_0x122d4a){return function(_0x342182){if(_0x342182){return _0x342182[_0xdd4a('0x2f')](_0x20c9d5)['then'](function(_0x1bc986){return _0x1bc986;});}return null;};}function removeEntity(_0xff5437,_0x32abdd){return function(_0x18777b){if(_0x18777b){return _0x18777b[_0xdd4a('0x30')]()['then'](function(){_0xff5437['status'](0xcc)[_0xdd4a('0x26')]();});}};}function handleEntityNotFound(_0x19b9df,_0x50c38d){return function(_0x187660){if(!_0x187660){_0x19b9df['sendStatus'](0x194);}return _0x187660;};}function handleError(_0x1fd026,_0x14b9b0){_0x14b9b0=_0x14b9b0||0x1f4;return function(_0x52abd1){logger[_0xdd4a('0x1f')](_0x52abd1[_0xdd4a('0x31')]);if(_0x52abd1['name']){delete _0x52abd1[_0xdd4a('0x32')];}_0x1fd026['status'](_0x14b9b0)['send'](_0x52abd1);};}exports[_0xdd4a('0x33')]=function(_0x26cb9e,_0x1d4eed){var _0x441646={},_0x2b2cc6={},_0x72710b={'count':0x0,'rows':[]};var _0x3f676e=_['map'](db['SmsMessage'][_0xdd4a('0x34')],function(_0x2f4417){return{'name':_0x2f4417['fieldName'],'type':_0x2f4417[_0xdd4a('0x35')][_0xdd4a('0x36')]};});_0x2b2cc6[_0xdd4a('0x37')]=_[_0xdd4a('0x38')](_0x3f676e,'name');_0x2b2cc6['query']=_[_0xdd4a('0x39')](_0x26cb9e[_0xdd4a('0x3a')]);_0x2b2cc6[_0xdd4a('0x3b')]=_['intersection'](_0x2b2cc6[_0xdd4a('0x37')],_0x2b2cc6[_0xdd4a('0x3a')]);_0x441646[_0xdd4a('0x3c')]=_[_0xdd4a('0x3d')](_0x2b2cc6[_0xdd4a('0x37')],qs['fields'](_0x26cb9e[_0xdd4a('0x3a')][_0xdd4a('0x3e')]));_0x441646[_0xdd4a('0x3c')]=_0x441646[_0xdd4a('0x3c')][_0xdd4a('0x3f')]?_0x441646['attributes']:_0x2b2cc6[_0xdd4a('0x37')];if(!_0x26cb9e[_0xdd4a('0x3a')]['hasOwnProperty'](_0xdd4a('0x40'))){_0x441646[_0xdd4a('0x2a')]=qs[_0xdd4a('0x2a')](_0x26cb9e[_0xdd4a('0x3a')]['limit']);_0x441646['offset']=qs[_0xdd4a('0x28')](_0x26cb9e['query'][_0xdd4a('0x28')]);}_0x441646[_0xdd4a('0x41')]=qs[_0xdd4a('0x42')](_0x26cb9e[_0xdd4a('0x3a')][_0xdd4a('0x42')]);_0x441646[_0xdd4a('0x43')]=qs[_0xdd4a('0x3b')](_['pick'](_0x26cb9e[_0xdd4a('0x3a')],_0x2b2cc6[_0xdd4a('0x3b')]),_0x3f676e);if(_0x26cb9e[_0xdd4a('0x3a')][_0xdd4a('0x44')]){_0x441646[_0xdd4a('0x43')]=_['merge'](_0x441646[_0xdd4a('0x43')],{'$or':_[_0xdd4a('0x38')](_0x3f676e,function(_0x3572fb){if(_0x3572fb[_0xdd4a('0x35')]!==_0xdd4a('0x45')){var _0x235f1b={};_0x235f1b[_0x3572fb[_0xdd4a('0x32')]]={'$like':'%'+_0x26cb9e[_0xdd4a('0x3a')][_0xdd4a('0x44')]+'%'};return _0x235f1b;}})});}_0x441646=_[_0xdd4a('0x46')]({},_0x441646,_0x26cb9e[_0xdd4a('0x47')]);var _0x2e1544={'where':_0x441646[_0xdd4a('0x43')]};return db[_0xdd4a('0x48')][_0xdd4a('0x2b')](_0x2e1544)[_0xdd4a('0x49')](function(_0x583cfb){_0x72710b[_0xdd4a('0x2b')]=_0x583cfb;if(_0x26cb9e['query'][_0xdd4a('0x4a')]){_0x441646[_0xdd4a('0x4b')]=[{'all':!![]}];}return db[_0xdd4a('0x48')][_0xdd4a('0x4c')](_0x441646);})[_0xdd4a('0x49')](function(_0x543b31){_0x72710b[_0xdd4a('0x4d')]=_0x543b31;return _0x72710b;})['then'](respondWithFilteredResult(_0x1d4eed,_0x441646))['catch'](handleError(_0x1d4eed,null));};exports[_0xdd4a('0x4e')]=function(_0x24da0c,_0x1df8ee){var _0x5ef072={'raw':!![],'where':{'id':_0x24da0c[_0xdd4a('0x4f')]['id']}},_0x36d033={};_0x36d033['model']=_[_0xdd4a('0x39')](db[_0xdd4a('0x48')]['rawAttributes']);_0x36d033[_0xdd4a('0x3a')]=_[_0xdd4a('0x39')](_0x24da0c['query']);_0x36d033[_0xdd4a('0x3b')]=_[_0xdd4a('0x3d')](_0x36d033['model'],_0x36d033[_0xdd4a('0x3a')]);_0x5ef072[_0xdd4a('0x3c')]=_[_0xdd4a('0x3d')](_0x36d033[_0xdd4a('0x37')],qs[_0xdd4a('0x3e')](_0x24da0c['query']['fields']));_0x5ef072[_0xdd4a('0x3c')]=_0x5ef072[_0xdd4a('0x3c')][_0xdd4a('0x3f')]?_0x5ef072[_0xdd4a('0x3c')]:_0x36d033[_0xdd4a('0x37')];if(_0x24da0c['query'][_0xdd4a('0x4a')]){_0x5ef072[_0xdd4a('0x4b')]=[{'all':!![]}];}_0x5ef072=_[_0xdd4a('0x46')]({},_0x5ef072,_0x24da0c[_0xdd4a('0x47')]);return db[_0xdd4a('0x48')]['find'](_0x5ef072)['then'](handleEntityNotFound(_0x1df8ee,null))[_0xdd4a('0x49')](respondWithResult(_0x1df8ee,null))['catch'](handleError(_0x1df8ee,null));};exports[_0xdd4a('0x50')]=function(_0x303f3b,_0xc5b22){return db[_0xdd4a('0x48')][_0xdd4a('0x50')](_0x303f3b[_0xdd4a('0x51')],{})['then'](respondWithResult(_0xc5b22,0xc9))[_0xdd4a('0x52')](handleError(_0xc5b22,null));};exports[_0xdd4a('0x2f')]=function(_0xa71a66,_0x5f097e){if(_0xa71a66[_0xdd4a('0x51')]['id']){delete _0xa71a66['body']['id'];}return db[_0xdd4a('0x48')][_0xdd4a('0x53')]({'where':{'id':_0xa71a66['params']['id']}})['then'](handleEntityNotFound(_0x5f097e,null))[_0xdd4a('0x49')](saveUpdates(_0xa71a66[_0xdd4a('0x51')],null))[_0xdd4a('0x49')](respondWithResult(_0x5f097e,null))['catch'](handleError(_0x5f097e,null));};exports[_0xdd4a('0x30')]=function(_0x419c1f,_0x5dcfe1){return db[_0xdd4a('0x48')][_0xdd4a('0x53')]({'where':{'id':_0x419c1f[_0xdd4a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5dcfe1,null))['then'](removeEntity(_0x5dcfe1,null))[_0xdd4a('0x52')](handleError(_0x5dcfe1,null));};exports[_0xdd4a('0x54')]=function(_0x2cdcff,_0x36a6d3){return db[_0xdd4a('0x48')][_0xdd4a('0x54')]()['then'](respondWithResult(_0x36a6d3,null))[_0xdd4a('0x52')](handleError(_0x36a6d3,null));};var interaction_log=require(_0xdd4a('0x12'))('sms-interactions');exports[_0xdd4a('0x55')]=function(_0x5040b4,_0x342d4f,_0x14fbb9){var _0x371ca3={'agent':{},'channel':_0xdd4a('0x56')};if(_0x5040b4[_0xdd4a('0x51')]['id']){delete _0x5040b4[_0xdd4a('0x51')]['id'];}_0x5040b4[_0xdd4a('0x51')][_0xdd4a('0x57')]=!![];_0x5040b4[_0xdd4a('0x51')][_0xdd4a('0x58')]=moment()[_0xdd4a('0x59')](_0xdd4a('0x5a'));_0x5040b4[_0xdd4a('0x51')][_0xdd4a('0x5b')]=_0x5040b4['body'][_0xdd4a('0x5b')]||_0x5040b4[_0xdd4a('0x5c')]['id'];_0x371ca3[_0xdd4a('0x5d')]['id']=_0x5040b4[_0xdd4a('0x51')][_0xdd4a('0x5b')];return db[_0xdd4a('0x48')][_0xdd4a('0x53')]({'where':{'id':_0x5040b4[_0xdd4a('0x4f')]['id'],'UserId':null}})[_0xdd4a('0x49')](handleEntityNotFound(_0x342d4f,null))[_0xdd4a('0x49')](saveUpdates(_0x5040b4[_0xdd4a('0x51')],null))['then'](function(_0x12a3d3){if(_0x12a3d3){_0x371ca3[_0xdd4a('0x22')]=_0x12a3d3[_0xdd4a('0x5e')]({'plain':!![]});return db['SmsInteraction'][_0xdd4a('0x53')]({'where':{'id':_0x12a3d3['SmsInteractionId']}});}return null;})[_0xdd4a('0x49')](handleEntityNotFound(_0x342d4f,null))['then'](function(_0x549933){if(_0x549933){return _0x549933[_0xdd4a('0x2f')]({'UserId':_0x5040b4[_0xdd4a('0x51')]['UserId'],'read1stAt':_[_0xdd4a('0x5f')](_0x549933[_0xdd4a('0x60')])?moment()[_0xdd4a('0x59')](_0xdd4a('0x5a')):undefined});}return null;})[_0xdd4a('0x49')](function(_0x52136f){if(_0x52136f){_0x371ca3['interaction']=_0x52136f[_0xdd4a('0x5e')]({'plain':!![]});interaction_log[_0xdd4a('0x1b')](_0xdd4a('0x61'),_0x5040b4[_0xdd4a('0x5c')]['id'],_0x5040b4[_0xdd4a('0x5c')]['name'],_0x5040b4[_0xdd4a('0x5c')][_0xdd4a('0x62')],_0x371ca3[_0xdd4a('0x63')]['id'],_0x5040b4[_0xdd4a('0x51')]?JSON[_0xdd4a('0x1e')](_0x5040b4['body']):_0xdd4a('0x64'));return respondWithRpcPromise(_0xdd4a('0x65'),_0xdd4a('0x66'),_0x371ca3);}return null;})[_0xdd4a('0x49')](function(_0x17ffb2){var _0x1a96f2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x17ffb2[_0xdd4a('0x22')]['ContactId'];return db[_0xdd4a('0x67')][_0xdd4a('0x3a')](_0x1a96f2,{'type':db['Sequelize'][_0xdd4a('0x68')][_0xdd4a('0x69')],'raw':!![]})[_0xdd4a('0x49')](function(_0x52ea04){return _0x52ea04;});})[_0xdd4a('0x49')](function(_0x4b5202){if(_0x4b5202){_0x371ca3[_0xdd4a('0x22')][_0xdd4a('0x6a')]=_0x4b5202[0x0];if(!_0x5040b4['body'][_0xdd4a('0x5b')])return;return db[_0xdd4a('0x6b')]['find']({'where':{'id':_0x5040b4[_0xdd4a('0x51')][_0xdd4a('0x5b')],'role':'agent'},'attributes':['id',_0xdd4a('0x32'),'fullname',_0xdd4a('0x6c'),_0xdd4a('0x6d')],'raw':!![]});}return null;})[_0xdd4a('0x49')](function(_0x31ee1e){if(!_0x31ee1e)return null;_0x371ca3[_0xdd4a('0x22')][_0xdd4a('0x5d')]=_0x31ee1e;return _0x371ca3;})[_0xdd4a('0x49')](function(_0x7e6e50){if(_0x7e6e50){if(_0x5040b4['body'][_0xdd4a('0x6e')]){_0x371ca3[_0xdd4a('0x22')][_0xdd4a('0x6f')]=util['format']('SIP/%s',_0x5040b4[_0xdd4a('0x5c')][_0xdd4a('0x32')]);_0x371ca3[_0xdd4a('0x22')]['channel']=_0x371ca3['channel'];_0x371ca3[_0xdd4a('0x22')]['motionChannel']=_0x371ca3[_0xdd4a('0x70')];_0x371ca3[_0xdd4a('0x22')][_0xdd4a('0x71')]=_0xdd4a('0x55');return respondWithRpcPromise(_0xdd4a('0x72'),'EventManager',{'event':_0xdd4a('0x73'),'message':_0x371ca3[_0xdd4a('0x22')]},client9002)['then'](function(){return _0x371ca3;});}return _0x371ca3;}return null;})['then'](respondWithResult(_0x342d4f,null))['catch'](handleError(_0x342d4f,null));};var interaction_log=require(_0xdd4a('0x12'))(_0xdd4a('0x74'));exports[_0xdd4a('0x75')]=function(_0x51d996,_0x2715e0,_0x1a1e12){var _0x23ffe7={'agent':{},'channel':'sms'};if(_0x51d996[_0xdd4a('0x51')]['id']){delete _0x51d996[_0xdd4a('0x51')]['id'];}_0x51d996[_0xdd4a('0x51')][_0xdd4a('0x5b')]=_0x51d996[_0xdd4a('0x51')][_0xdd4a('0x5b')]||_0x51d996['user']['id'];_0x23ffe7['agent']['id']=_0x51d996[_0xdd4a('0x51')][_0xdd4a('0x5b')];return db[_0xdd4a('0x48')][_0xdd4a('0x53')]({'where':{'id':_0x51d996[_0xdd4a('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2715e0,null))[_0xdd4a('0x49')](function(_0xb957be){if(_0xb957be){_0x23ffe7[_0xdd4a('0x22')]=_0xb957be[_0xdd4a('0x5e')]({'plain':!![]});return db[_0xdd4a('0x76')][_0xdd4a('0x53')]({'where':{'id':_0xb957be[_0xdd4a('0x77')]}});}return null;})[_0xdd4a('0x49')](handleEntityNotFound(_0x2715e0,null))[_0xdd4a('0x49')](function(_0x2ece25){if(_0x2ece25){_0x23ffe7[_0xdd4a('0x63')]=_0x2ece25[_0xdd4a('0x5e')]({'plain':!![]});interaction_log['info'](_0xdd4a('0x78'),_0x51d996[_0xdd4a('0x5c')]['id'],_0x51d996[_0xdd4a('0x5c')][_0xdd4a('0x32')],_0x51d996[_0xdd4a('0x5c')][_0xdd4a('0x62')],_0x23ffe7[_0xdd4a('0x63')]['id'],_0x51d996[_0xdd4a('0x51')]?JSON['stringify'](_0x51d996['body']):_0xdd4a('0x64'));return respondWithRpcPromise(_0xdd4a('0x79'),_0xdd4a('0x7a'),_0x23ffe7);}return null;})[_0xdd4a('0x49')](function(_0x1bca5f){var _0x61e573=_0xdd4a('0x7b')+_0x1bca5f['message'][_0xdd4a('0x7c')];return db[_0xdd4a('0x67')][_0xdd4a('0x3a')](_0x61e573,{'type':db[_0xdd4a('0x7d')][_0xdd4a('0x68')]['SELECT'],'raw':!![]})[_0xdd4a('0x49')](function(_0x4a29da){return _0x4a29da;});})[_0xdd4a('0x49')](function(_0x471d4f){if(_0x471d4f){_0x23ffe7[_0xdd4a('0x22')]['contact']=_0x471d4f[0x0];if(!_0x51d996['body']['UserId'])return;return db[_0xdd4a('0x6b')][_0xdd4a('0x53')]({'where':{'id':_0x51d996[_0xdd4a('0x51')]['UserId'],'role':_0xdd4a('0x5d')},'attributes':['id','name',_0xdd4a('0x7e'),'email',_0xdd4a('0x6d')],'raw':!![]});}return null;})[_0xdd4a('0x49')](function(_0x10097f){if(!_0x10097f)return null;_0x23ffe7[_0xdd4a('0x22')][_0xdd4a('0x5d')]=_0x10097f;return _0x23ffe7;})[_0xdd4a('0x49')](function(_0x147732){if(_0x147732){_0x147732[_0xdd4a('0x22')][_0xdd4a('0x6f')]=util[_0xdd4a('0x59')](_0xdd4a('0x7f'),_0x51d996['user']['name']);_0x147732['message'][_0xdd4a('0x70')]=_0x23ffe7[_0xdd4a('0x70')];_0x147732[_0xdd4a('0x22')][_0xdd4a('0x80')]=_0x23ffe7[_0xdd4a('0x70')];_0x147732[_0xdd4a('0x22')]['event']=_0xdd4a('0x75');respondWithRpcPromise(_0xdd4a('0x72'),'EventManager',{'event':_0xdd4a('0x81'),'message':_0x147732[_0xdd4a('0x22')]},client9002);return _0x23ffe7;}return null;})['then'](respondWithResult(_0x2715e0,null))[_0xdd4a('0x52')](handleError(_0x2715e0,null));};exports[_0xdd4a('0x25')]=function(_0x1fba0e,_0x2f86dd,_0x530eab){if(_0x1fba0e[_0xdd4a('0x51')]['id']){delete _0x1fba0e[_0xdd4a('0x51')]['id'];}var _0x326df2;return db[_0xdd4a('0x48')][_0xdd4a('0x53')]({'where':{'id':_0x1fba0e[_0xdd4a('0x4f')]['id']}})[_0xdd4a('0x49')](handleEntityNotFound(_0x2f86dd,null))[_0xdd4a('0x49')](function(_0x5acb5b){if(_0x5acb5b){_0x326df2=_0x5acb5b;return db['SmsAccount'][_0xdd4a('0x53')]({'where':{'id':_0x5acb5b[_0xdd4a('0x82')]}});}})[_0xdd4a('0x49')](handleEntityNotFound(_0x2f86dd,null))[_0xdd4a('0x49')](function(_0x2f5e23){if(_0x2f5e23){logger[_0xdd4a('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdd4a('0x25'),_0xdd4a('0x83'),_0x2f5e23[_0xdd4a('0x35')],util[_0xdd4a('0x84')](_0x1fba0e[_0xdd4a('0x51')],{'showHidden':![],'depth':null}));switch(_0x2f5e23[_0xdd4a('0x35')]){case _0xdd4a('0x85'):if(_0x1fba0e['body'][_0xdd4a('0x86')]&&_0x1fba0e[_0xdd4a('0x51')][_0xdd4a('0x86')]===_0x326df2[_0xdd4a('0x87')]){return _0x326df2[_0xdd4a('0x2f')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdd4a('0x25'),_0xdd4a('0x85'),util[_0xdd4a('0x84')](_0x1fba0e[_0xdd4a('0x51')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x1fba0e[_0xdd4a('0x51')][_0xdd4a('0x88')]&&_0x1fba0e[_0xdd4a('0x51')][_0xdd4a('0x88')]===_0x326df2[_0xdd4a('0x87')]&&_['indexOf']([_0xdd4a('0x89'),_0xdd4a('0x8a')],_0x1fba0e[_0xdd4a('0x51')]['Status'])>=0x0){return _0x326df2['update']({'read':!![]});}else{logger[_0xdd4a('0x1f')](_0xdd4a('0x8b'),'status',_0xdd4a('0x8c'),util[_0xdd4a('0x84')](_0x1fba0e[_0xdd4a('0x51')],{'showHidden':![],'depth':null}));}break;case _0xdd4a('0x8d'):var _0x21db59=_0x1fba0e['body'][_0xdd4a('0x8e')][0x0];if(_0x21db59['status'][_0xdd4a('0x8f')]===_0xdd4a('0x90')){return _0x326df2[_0xdd4a('0x2f')]({'read':!![]});}else{logger['error'](_0xdd4a('0x8b'),_0xdd4a('0x25'),_0xdd4a('0x8d'),util[_0xdd4a('0x84')](_0x1fba0e[_0xdd4a('0x51')],{'showHidden':![],'depth':null}));}break;}return _0x326df2;}})[_0xdd4a('0x49')](respondWithResult(_0x2f86dd,null))['catch'](handleError(_0x2f86dd,null));}; \ No newline at end of file +var _0x285b=['options','includeAll','include','show','length','create','body','find','params','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','SIP/%s','channel','event','EventManager','../../config/logger','get','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','motionChannel','rejectmessage','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','Status','plivio','infobip','results','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x29a29f,_0x155ce7){var _0x443ea3=function(_0xe0dd24){while(--_0xe0dd24){_0x29a29f['push'](_0x29a29f['shift']());}};_0x443ea3(++_0x155ce7);}(_0x285b,0x171));var _0xb285=function(_0x2efa70,_0x4daf92){_0x2efa70=_0x2efa70-0x0;var _0x2b82ac=_0x285b[_0x2efa70];return _0x2b82ac;};'use strict';var emlformat=require(_0xb285('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb285('0x1'));var jsonpatch=require(_0xb285('0x2'));var rp=require('request-promise');var moment=require(_0xb285('0x3'));var BPromise=require(_0xb285('0x4'));var Mustache=require(_0xb285('0x5'));var util=require(_0xb285('0x6'));var path=require(_0xb285('0x7'));var sox=require(_0xb285('0x8'));var csv=require(_0xb285('0x9'));var ejs=require(_0xb285('0xa'));var fs=require('fs');var fs_extra=require(_0xb285('0xb'));var _=require(_0xb285('0xc'));var squel=require('squel');var crypto=require(_0xb285('0xd'));var jsforce=require(_0xb285('0xe'));var deskjs=require(_0xb285('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb285('0x10'));var Redis=require(_0xb285('0x11'));var authService=require(_0xb285('0x12'));var qs=require(_0xb285('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb285('0x14'));var logger=require('../../config/logger')(_0xb285('0x15'));var utils=require(_0xb285('0x16'));var config=require(_0xb285('0x17'));var licenseUtil=require(_0xb285('0x18'));var db=require(_0xb285('0x19'))['db'];config[_0xb285('0x1a')]=_[_0xb285('0x1b')](config[_0xb285('0x1a')],{'host':_0xb285('0x1c'),'port':0x18eb});var socket=require(_0xb285('0x1d'))(new Redis(config['redis']));require('./smsMessage.socket')[_0xb285('0x1e')](socket);var jayson=require(_0xb285('0x1f'));var client=jayson[_0xb285('0x20')][_0xb285('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xb285('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3f104a,_0x281725,_0x4164e7,_0x4a822b){return new BPromise(function(_0x410a46,_0x49410c){var _0x50ae0a=_0x4a822b||client;return _0x50ae0a[_0xb285('0x22')](_0x3f104a,_0x4164e7)[_0xb285('0x23')](function(_0x5de924){logger[_0xb285('0x24')](_0xb285('0x25'),_0x281725,_0xb285('0x26'));logger[_0xb285('0x27')](_0xb285('0x28'),_0x281725,_0xb285('0x26'),JSON[_0xb285('0x29')](_0x5de924));if(_0x5de924[_0xb285('0x2a')]){if(_0x5de924[_0xb285('0x2a')]['code']===0x1f4){logger[_0xb285('0x2a')](_0xb285('0x25'),_0x281725,_0x5de924[_0xb285('0x2a')][_0xb285('0x2b')]);return _0x49410c(_0x5de924['error'][_0xb285('0x2b')]);}logger[_0xb285('0x2a')]('SmsMessage,\x20%s,\x20%s',_0x281725,_0x5de924[_0xb285('0x2a')][_0xb285('0x2b')]);return _0x410a46(_0x5de924['error']['message']);}else{logger[_0xb285('0x24')](_0xb285('0x25'),_0x281725,_0xb285('0x26'));_0x410a46(_0x5de924[_0xb285('0x2c')][_0xb285('0x2b')]);}})[_0xb285('0x2d')](function(_0x40a994){logger[_0xb285('0x2a')](_0xb285('0x25'),_0x281725,_0x40a994);_0x49410c(_0x40a994);});});}function respondWithStatusCode(_0xf3be,_0x2c8e4f){_0x2c8e4f=_0x2c8e4f||0xcc;return function(_0x4b4a61){if(_0x4b4a61){return _0xf3be[_0xb285('0x2e')](_0x2c8e4f);}return _0xf3be[_0xb285('0x2f')](_0x2c8e4f)['end']();};}function respondWithResult(_0x164f52,_0x53edd4){_0x53edd4=_0x53edd4||0xc8;return function(_0x20972e){if(_0x20972e){return _0x164f52[_0xb285('0x2f')](_0x53edd4)[_0xb285('0x30')](_0x20972e);}};}function respondWithFilteredResult(_0x4377aa,_0x5d269a){return function(_0x436783){if(_0x436783){var _0x160827=typeof _0x5d269a[_0xb285('0x31')]===_0xb285('0x32')&&typeof _0x5d269a['limit']===_0xb285('0x32');var _0x3af675=_0x436783[_0xb285('0x33')];var _0x348e9a=_0x160827?0x0:_0x5d269a[_0xb285('0x31')];var _0x1c6174=_0x160827?_0x436783[_0xb285('0x33')]:_0x5d269a['offset']+_0x5d269a[_0xb285('0x34')];var _0x35d9b4;if(_0x1c6174>=_0x3af675){_0x1c6174=_0x3af675;_0x35d9b4=0xc8;}else{_0x35d9b4=0xce;}_0x4377aa[_0xb285('0x2f')](_0x35d9b4);return _0x4377aa[_0xb285('0x35')](_0xb285('0x36'),_0x348e9a+'-'+_0x1c6174+'/'+_0x3af675)['json'](_0x436783);}return null;};}function patchUpdates(_0x4ed2b5){return function(_0x2ab5a6){try{jsonpatch[_0xb285('0x37')](_0x2ab5a6,_0x4ed2b5,!![]);}catch(_0x35121c){return BPromise[_0xb285('0x38')](_0x35121c);}return _0x2ab5a6[_0xb285('0x39')]();};}function saveUpdates(_0x2001ee,_0x1b59ed){return function(_0x4a261c){if(_0x4a261c){return _0x4a261c[_0xb285('0x3a')](_0x2001ee)[_0xb285('0x23')](function(_0x53cd25){return _0x53cd25;});}return null;};}function removeEntity(_0x71936e,_0x4d8906){return function(_0x2eae2a){if(_0x2eae2a){return _0x2eae2a[_0xb285('0x3b')]()[_0xb285('0x23')](function(){_0x71936e[_0xb285('0x2f')](0xcc)[_0xb285('0x3c')]();});}};}function handleEntityNotFound(_0x322478,_0x5ee979){return function(_0x1b4c21){if(!_0x1b4c21){_0x322478[_0xb285('0x2e')](0x194);}return _0x1b4c21;};}function handleError(_0x546f55,_0x420fa8){_0x420fa8=_0x420fa8||0x1f4;return function(_0x21edbf){logger['error'](_0x21edbf[_0xb285('0x3d')]);if(_0x21edbf[_0xb285('0x3e')]){delete _0x21edbf['name'];}_0x546f55[_0xb285('0x2f')](_0x420fa8)[_0xb285('0x3f')](_0x21edbf);};}exports[_0xb285('0x40')]=function(_0x2caa56,_0x1afa35){var _0x142394={},_0x331351={},_0xffe6a={'count':0x0,'rows':[]};var _0xfb3ad6=_['map'](db[_0xb285('0x41')][_0xb285('0x42')],function(_0x3a3d72){return{'name':_0x3a3d72[_0xb285('0x43')],'type':_0x3a3d72[_0xb285('0x44')][_0xb285('0x45')]};});_0x331351['model']=_[_0xb285('0x46')](_0xfb3ad6,_0xb285('0x3e'));_0x331351[_0xb285('0x47')]=_[_0xb285('0x48')](_0x2caa56[_0xb285('0x47')]);_0x331351[_0xb285('0x49')]=_[_0xb285('0x4a')](_0x331351[_0xb285('0x4b')],_0x331351['query']);_0x142394[_0xb285('0x4c')]=_['intersection'](_0x331351[_0xb285('0x4b')],qs[_0xb285('0x4d')](_0x2caa56[_0xb285('0x47')][_0xb285('0x4d')]));_0x142394[_0xb285('0x4c')]=_0x142394['attributes']['length']?_0x142394[_0xb285('0x4c')]:_0x331351['model'];if(!_0x2caa56[_0xb285('0x47')][_0xb285('0x4e')](_0xb285('0x4f'))){_0x142394[_0xb285('0x34')]=qs['limit'](_0x2caa56[_0xb285('0x47')][_0xb285('0x34')]);_0x142394['offset']=qs[_0xb285('0x31')](_0x2caa56[_0xb285('0x47')][_0xb285('0x31')]);}_0x142394[_0xb285('0x50')]=qs[_0xb285('0x51')](_0x2caa56[_0xb285('0x47')][_0xb285('0x51')]);_0x142394[_0xb285('0x52')]=qs[_0xb285('0x49')](_[_0xb285('0x53')](_0x2caa56[_0xb285('0x47')],_0x331351[_0xb285('0x49')]),_0xfb3ad6);if(_0x2caa56[_0xb285('0x47')][_0xb285('0x54')]){_0x142394[_0xb285('0x52')]=_['merge'](_0x142394[_0xb285('0x52')],{'$or':_['map'](_0xfb3ad6,function(_0x401317){if(_0x401317[_0xb285('0x44')]!==_0xb285('0x55')){var _0x14e1cd={};_0x14e1cd[_0x401317[_0xb285('0x3e')]]={'$like':'%'+_0x2caa56[_0xb285('0x47')][_0xb285('0x54')]+'%'};return _0x14e1cd;}})});}_0x142394=_[_0xb285('0x56')]({},_0x142394,_0x2caa56[_0xb285('0x57')]);var _0x22a2cb={'where':_0x142394[_0xb285('0x52')]};return db[_0xb285('0x41')][_0xb285('0x33')](_0x22a2cb)['then'](function(_0x5f1bf6){_0xffe6a[_0xb285('0x33')]=_0x5f1bf6;if(_0x2caa56[_0xb285('0x47')][_0xb285('0x58')]){_0x142394[_0xb285('0x59')]=[{'all':!![]}];}return db[_0xb285('0x41')]['findAll'](_0x142394);})[_0xb285('0x23')](function(_0x5bcf53){_0xffe6a['rows']=_0x5bcf53;return _0xffe6a;})['then'](respondWithFilteredResult(_0x1afa35,_0x142394))[_0xb285('0x2d')](handleError(_0x1afa35,null));};exports[_0xb285('0x5a')]=function(_0x33350c,_0x72e2ca){var _0x3afd35={'raw':!![],'where':{'id':_0x33350c['params']['id']}},_0x476a38={};_0x476a38['model']=_[_0xb285('0x48')](db[_0xb285('0x41')]['rawAttributes']);_0x476a38['query']=_[_0xb285('0x48')](_0x33350c[_0xb285('0x47')]);_0x476a38[_0xb285('0x49')]=_[_0xb285('0x4a')](_0x476a38[_0xb285('0x4b')],_0x476a38[_0xb285('0x47')]);_0x3afd35[_0xb285('0x4c')]=_[_0xb285('0x4a')](_0x476a38[_0xb285('0x4b')],qs[_0xb285('0x4d')](_0x33350c[_0xb285('0x47')][_0xb285('0x4d')]));_0x3afd35[_0xb285('0x4c')]=_0x3afd35['attributes'][_0xb285('0x5b')]?_0x3afd35[_0xb285('0x4c')]:_0x476a38[_0xb285('0x4b')];if(_0x33350c[_0xb285('0x47')]['includeAll']){_0x3afd35[_0xb285('0x59')]=[{'all':!![]}];}_0x3afd35=_[_0xb285('0x56')]({},_0x3afd35,_0x33350c['options']);return db['SmsMessage']['find'](_0x3afd35)[_0xb285('0x23')](handleEntityNotFound(_0x72e2ca,null))[_0xb285('0x23')](respondWithResult(_0x72e2ca,null))[_0xb285('0x2d')](handleError(_0x72e2ca,null));};exports[_0xb285('0x5c')]=function(_0x3e704c,_0x283c44){return db[_0xb285('0x41')]['create'](_0x3e704c[_0xb285('0x5d')],{})['then'](respondWithResult(_0x283c44,0xc9))['catch'](handleError(_0x283c44,null));};exports[_0xb285('0x3a')]=function(_0x335149,_0x5b9015){if(_0x335149[_0xb285('0x5d')]['id']){delete _0x335149['body']['id'];}return db[_0xb285('0x41')][_0xb285('0x5e')]({'where':{'id':_0x335149[_0xb285('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5b9015,null))[_0xb285('0x23')](saveUpdates(_0x335149[_0xb285('0x5d')],null))['then'](respondWithResult(_0x5b9015,null))[_0xb285('0x2d')](handleError(_0x5b9015,null));};exports[_0xb285('0x3b')]=function(_0x493ff7,_0x23ae86){return db['SmsMessage']['find']({'where':{'id':_0x493ff7['params']['id']}})[_0xb285('0x23')](handleEntityNotFound(_0x23ae86,null))[_0xb285('0x23')](removeEntity(_0x23ae86,null))[_0xb285('0x2d')](handleError(_0x23ae86,null));};exports[_0xb285('0x60')]=function(_0x3df09a,_0x2a67b3){return db[_0xb285('0x41')][_0xb285('0x60')]()[_0xb285('0x23')](respondWithResult(_0x2a67b3,null))[_0xb285('0x2d')](handleError(_0x2a67b3,null));};var interaction_log=require('../../config/logger')(_0xb285('0x61'));exports[_0xb285('0x62')]=function(_0x452517,_0x22a1d6,_0x27fd39){var _0x2fbd72={'agent':{},'channel':_0xb285('0x63')};if(_0x452517['body']['id']){delete _0x452517['body']['id'];}_0x452517[_0xb285('0x5d')][_0xb285('0x64')]=!![];_0x452517[_0xb285('0x5d')][_0xb285('0x65')]=moment()[_0xb285('0x66')](_0xb285('0x67'));_0x452517[_0xb285('0x5d')][_0xb285('0x68')]=_0x452517[_0xb285('0x5d')]['UserId']||_0x452517[_0xb285('0x69')]['id'];_0x2fbd72[_0xb285('0x6a')]['id']=_0x452517[_0xb285('0x5d')][_0xb285('0x68')];return db[_0xb285('0x41')][_0xb285('0x5e')]({'where':{'id':_0x452517[_0xb285('0x5f')]['id'],'UserId':null}})[_0xb285('0x23')](handleEntityNotFound(_0x22a1d6,null))[_0xb285('0x23')](saveUpdates(_0x452517[_0xb285('0x5d')],null))[_0xb285('0x23')](function(_0x414c30){if(_0x414c30){_0x2fbd72[_0xb285('0x2b')]=_0x414c30['get']({'plain':!![]});return db[_0xb285('0x6b')][_0xb285('0x5e')]({'where':{'id':_0x414c30[_0xb285('0x6c')]}});}return null;})[_0xb285('0x23')](handleEntityNotFound(_0x22a1d6,null))[_0xb285('0x23')](function(_0x269c5c){if(_0x269c5c){return _0x269c5c[_0xb285('0x3a')]({'UserId':_0x452517['body'][_0xb285('0x68')],'read1stAt':_[_0xb285('0x6d')](_0x269c5c[_0xb285('0x6e')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb285('0x23')](function(_0x2bf565){if(_0x2bf565){_0x2fbd72['interaction']=_0x2bf565['get']({'plain':!![]});interaction_log[_0xb285('0x24')](_0xb285('0x6f'),_0x452517[_0xb285('0x69')]['id'],_0x452517[_0xb285('0x69')][_0xb285('0x3e')],_0x452517[_0xb285('0x69')][_0xb285('0x70')],_0x2fbd72[_0xb285('0x71')]['id'],_0x452517[_0xb285('0x5d')]?JSON[_0xb285('0x29')](_0x452517[_0xb285('0x5d')]):_0xb285('0x72'));return respondWithRpcPromise('AcceptMessage',_0xb285('0x73'),_0x2fbd72);}return null;})[_0xb285('0x23')](function(_0x15de5a){var _0x56d52b=_0xb285('0x74')+_0x15de5a['message'][_0xb285('0x75')];return db[_0xb285('0x76')][_0xb285('0x47')](_0x56d52b,{'type':db[_0xb285('0x77')][_0xb285('0x78')][_0xb285('0x79')],'raw':!![]})[_0xb285('0x23')](function(_0x405e9b){return _0x405e9b;});})[_0xb285('0x23')](function(_0x3772d5){if(_0x3772d5){_0x2fbd72[_0xb285('0x2b')]['contact']=_0x3772d5[0x0];if(!_0x452517[_0xb285('0x5d')][_0xb285('0x68')])return;return db[_0xb285('0x7a')][_0xb285('0x5e')]({'where':{'id':_0x452517['body']['UserId'],'role':_0xb285('0x6a')},'attributes':['id',_0xb285('0x3e'),'fullname',_0xb285('0x7b'),_0xb285('0x7c')],'raw':!![]});}return null;})[_0xb285('0x23')](function(_0x4f68ef){if(!_0x4f68ef)return null;_0x2fbd72[_0xb285('0x2b')][_0xb285('0x6a')]=_0x4f68ef;return _0x2fbd72;})[_0xb285('0x23')](function(_0x16540e){if(_0x16540e){if(_0x452517[_0xb285('0x5d')][_0xb285('0x7d')]){_0x2fbd72['message'][_0xb285('0x7e')]=util[_0xb285('0x66')](_0xb285('0x7f'),_0x452517[_0xb285('0x69')][_0xb285('0x3e')]);_0x2fbd72['message']['channel']=_0x2fbd72[_0xb285('0x80')];_0x2fbd72[_0xb285('0x2b')]['motionChannel']=_0x2fbd72[_0xb285('0x80')];_0x2fbd72[_0xb285('0x2b')][_0xb285('0x81')]=_0xb285('0x62');return respondWithRpcPromise('EventManager',_0xb285('0x82'),{'event':'acceptmessage','message':_0x2fbd72['message']},client9002)[_0xb285('0x23')](function(){return _0x2fbd72;});}return _0x2fbd72;}return null;})[_0xb285('0x23')](respondWithResult(_0x22a1d6,null))[_0xb285('0x2d')](handleError(_0x22a1d6,null));};var interaction_log=require(_0xb285('0x83'))(_0xb285('0x61'));exports[_0xb285('0x38')]=function(_0x49192d,_0x3b2898,_0x32e48a){var _0x3f8bb9={'agent':{},'channel':_0xb285('0x63')};if(_0x49192d[_0xb285('0x5d')]['id']){delete _0x49192d[_0xb285('0x5d')]['id'];}_0x49192d[_0xb285('0x5d')][_0xb285('0x68')]=_0x49192d[_0xb285('0x5d')][_0xb285('0x68')]||_0x49192d[_0xb285('0x69')]['id'];_0x3f8bb9['agent']['id']=_0x49192d['body'][_0xb285('0x68')];return db[_0xb285('0x41')][_0xb285('0x5e')]({'where':{'id':_0x49192d['params']['id'],'UserId':null}})[_0xb285('0x23')](handleEntityNotFound(_0x3b2898,null))[_0xb285('0x23')](function(_0xbda990){if(_0xbda990){_0x3f8bb9[_0xb285('0x2b')]=_0xbda990[_0xb285('0x84')]({'plain':!![]});return db[_0xb285('0x6b')][_0xb285('0x5e')]({'where':{'id':_0xbda990['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3b2898,null))['then'](function(_0x2b3423){if(_0x2b3423){_0x3f8bb9['interaction']=_0x2b3423[_0xb285('0x84')]({'plain':!![]});interaction_log[_0xb285('0x24')](_0xb285('0x85'),_0x49192d[_0xb285('0x69')]['id'],_0x49192d[_0xb285('0x69')][_0xb285('0x3e')],_0x49192d[_0xb285('0x69')][_0xb285('0x70')],_0x3f8bb9['interaction']['id'],_0x49192d['body']?JSON[_0xb285('0x29')](_0x49192d[_0xb285('0x5d')]):'null');return respondWithRpcPromise(_0xb285('0x86'),_0xb285('0x87'),_0x3f8bb9);}return null;})[_0xb285('0x23')](function(_0x3f50fe){var _0x138f93=_0xb285('0x74')+_0x3f50fe[_0xb285('0x2b')]['ContactId'];return db['sequelize'][_0xb285('0x47')](_0x138f93,{'type':db['Sequelize'][_0xb285('0x78')][_0xb285('0x79')],'raw':!![]})[_0xb285('0x23')](function(_0xf7d063){return _0xf7d063;});})[_0xb285('0x23')](function(_0x49f40f){if(_0x49f40f){_0x3f8bb9[_0xb285('0x2b')][_0xb285('0x88')]=_0x49f40f[0x0];if(!_0x49192d[_0xb285('0x5d')][_0xb285('0x68')])return;return db[_0xb285('0x7a')][_0xb285('0x5e')]({'where':{'id':_0x49192d[_0xb285('0x5d')]['UserId'],'role':_0xb285('0x6a')},'attributes':['id',_0xb285('0x3e'),'fullname','email',_0xb285('0x7c')],'raw':!![]});}return null;})[_0xb285('0x23')](function(_0x10126b){if(!_0x10126b)return null;_0x3f8bb9[_0xb285('0x2b')][_0xb285('0x6a')]=_0x10126b;return _0x3f8bb9;})[_0xb285('0x23')](function(_0x95a582){if(_0x95a582){_0x95a582[_0xb285('0x2b')][_0xb285('0x7e')]=util[_0xb285('0x66')](_0xb285('0x7f'),_0x49192d['user'][_0xb285('0x3e')]);_0x95a582['message'][_0xb285('0x80')]=_0x3f8bb9[_0xb285('0x80')];_0x95a582[_0xb285('0x2b')][_0xb285('0x89')]=_0x3f8bb9[_0xb285('0x80')];_0x95a582['message']['event']=_0xb285('0x38');respondWithRpcPromise(_0xb285('0x82'),_0xb285('0x82'),{'event':_0xb285('0x8a'),'message':_0x95a582[_0xb285('0x2b')]},client9002);return _0x3f8bb9;}return null;})['then'](respondWithResult(_0x3b2898,null))[_0xb285('0x2d')](handleError(_0x3b2898,null));};exports[_0xb285('0x2f')]=function(_0x1bdddf,_0x2201be,_0x5bf5c4){if(_0x1bdddf[_0xb285('0x5d')]['id']){delete _0x1bdddf['body']['id'];}var _0x17d7c2;return db[_0xb285('0x41')][_0xb285('0x5e')]({'where':{'id':_0x1bdddf[_0xb285('0x5f')]['id']}})[_0xb285('0x23')](handleEntityNotFound(_0x2201be,null))['then'](function(_0x4cc118){if(_0x4cc118){_0x17d7c2=_0x4cc118;return db['SmsAccount'][_0xb285('0x5e')]({'where':{'id':_0x4cc118[_0xb285('0x8b')]}});}})[_0xb285('0x23')](handleEntityNotFound(_0x2201be,null))[_0xb285('0x23')](function(_0x2565a0){if(_0x2565a0){logger[_0xb285('0x27')](_0xb285('0x28'),_0xb285('0x2f'),'received\x20delivery\x20report\x20from',_0x2565a0[_0xb285('0x44')],util[_0xb285('0x8c')](_0x1bdddf[_0xb285('0x5d')],{'showHidden':![],'depth':null}));switch(_0x2565a0[_0xb285('0x44')]){case _0xb285('0x8d'):if(_0x1bdddf[_0xb285('0x5d')]['MessageSid']&&_0x1bdddf['body'][_0xb285('0x8e')]===_0x17d7c2[_0xb285('0x8f')]){return _0x17d7c2['update']({'read':!![]});}else{logger[_0xb285('0x2a')](_0xb285('0x90'),_0xb285('0x2f'),'twilio',util[_0xb285('0x8c')](_0x1bdddf[_0xb285('0x5d')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x1bdddf['body'][_0xb285('0x91')]&&_0x1bdddf[_0xb285('0x5d')]['MessageUUID']===_0x17d7c2[_0xb285('0x8f')]&&_[_0xb285('0x92')]([_0xb285('0x93'),'delivered'],_0x1bdddf[_0xb285('0x5d')][_0xb285('0x94')])>=0x0){return _0x17d7c2[_0xb285('0x3a')]({'read':!![]});}else{logger[_0xb285('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb285('0x2f'),_0xb285('0x95'),util[_0xb285('0x8c')](_0x1bdddf[_0xb285('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xb285('0x96'):var _0x2db3b7=_0x1bdddf[_0xb285('0x5d')][_0xb285('0x97')][0x0];if(_0x2db3b7[_0xb285('0x2f')]['groupName']==='DELIVERED'){return _0x17d7c2[_0xb285('0x3a')]({'read':!![]});}else{logger['error'](_0xb285('0x90'),_0xb285('0x2f'),_0xb285('0x96'),util[_0xb285('0x8c')](_0x1bdddf[_0xb285('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x17d7c2;}})[_0xb285('0x23')](respondWithResult(_0x2201be,null))[_0xb285('0x2d')](handleError(_0x2201be,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index cafdeb8..f401d54 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 _0xd7a6=['exports','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7a6,0x1a9));var _0x6d7a=function(_0x113913,_0x2f9301){_0x113913=_0x113913-0x0;var _0x4afad0=_0xd7a6[_0x113913];return _0x4afad0;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x6d7a('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6d7a('0x1')](0x0);var events={'afterCreate':_0x6d7a('0x2'),'afterUpdate':'update','afterDestroy':_0x6d7a('0x3')};function emitEvent(_0x1c8011){return function(_0x281210,_0x37831f,_0x2f353e){SmsMessageEvents[_0x6d7a('0x4')](_0x1c8011+':'+_0x281210['id'],_0x281210);SmsMessageEvents[_0x6d7a('0x4')](_0x1c8011,_0x281210);_0x2f353e(null);};}for(var e in events){if(events[_0x6d7a('0x5')](e)){var event=events[e];SmsMessage[_0x6d7a('0x6')](e,emitEvent(event));}}module[_0x6d7a('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0xbd35=['../../mysqldb','SmsMessage','setMaxListeners','update','remove','emit','hasOwnProperty','events'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0xbd35,0x197));var _0x5bd3=function(_0x2b5763,_0x556298){_0x2b5763=_0x2b5763-0x0;var _0x104231=_0xbd35[_0x2b5763];return _0x104231;};'use strict';var EventEmitter=require(_0x5bd3('0x0'));var SmsMessage=require(_0x5bd3('0x1'))['db'][_0x5bd3('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5bd3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5bd3('0x4'),'afterDestroy':_0x5bd3('0x5')};function emitEvent(_0x826e3e){return function(_0x2c5433,_0x3cd688,_0x54a37d){SmsMessageEvents[_0x5bd3('0x6')](_0x826e3e+':'+_0x2c5433['id'],_0x2c5433);SmsMessageEvents['emit'](_0x826e3e,_0x2c5433);_0x54a37d(null);};}for(var e in events){if(events[_0x5bd3('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 0ce957a..512b911 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 _0xa00d=['get','direction','toLowerCase','secret','UserId','SmsInteractionId','SmsInteraction','then','createdAt','error','SmsAccount','SmsAccountId','type','twilio','authToken','phone','accountSid','create','remote','/api/sms/messages/','/status?token=','token','sid','update','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','total_sent','internal_order_id','deliveryReport','read','skebby','inspect','connectel','senderString','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','format','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','messages','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','keys','sort','apiKey','md5','digest','hex','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','apiMessageId','clickatell','bandwidth','accountId','/messages','applicationId','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','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','messageId','body','models'];(function(_0x367995,_0x129ae2){var _0x22daa8=function(_0x4a2ceb){while(--_0x4a2ceb){_0x367995['push'](_0x367995['shift']());}};_0x22daa8(++_0x129ae2);}(_0xa00d,0xe5));var _0xda00=function(_0x143d8a,_0x51a218){_0x143d8a=_0x143d8a-0x0;var _0x4b7474=_0xa00d[_0x143d8a];return _0x4b7474;};'use strict';var _=require(_0xda00('0x0'));var util=require(_0xda00('0x1'));var logger=require(_0xda00('0x2'))(_0xda00('0x3'));var moment=require(_0xda00('0x4'));var BPromise=require(_0xda00('0x5'));var rp=require(_0xda00('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda00('0x7'));var config=require(_0xda00('0x8'));var attributes=require(_0xda00('0x9'));module[_0xda00('0xa')]=function(_0x1ab1e9,_0x551aa1){return _0x1ab1e9['define'](_0xda00('0xb'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xda00('0xc'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0xda00('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x465e72,_0x2cd58f,_0x234581){var _0x436629=_0x1ab1e9[_0xda00('0xe')];var _0x369597=_0x465e72[_0xda00('0xf')]({'plain':!![]});if(_0x369597[_0xda00('0x10')][_0xda00('0x11')]()==='in'||_0x369597[_0xda00('0x10')][_0xda00('0x11')]()==='out'&&!_0x369597[_0xda00('0x12')]&&!_['isNil'](_0x369597[_0xda00('0x13')])&&!_['isNil'](_0x369597[_0xda00('0x14')])){_0x436629[_0xda00('0x15')]['findOne']({'where':{'id':_0x369597['SmsInteractionId']}})[_0xda00('0x16')](function(_0x4cdeab){if(_0x4cdeab){_0x4cdeab['update']({'lastMsgAt':_0x369597[_0xda00('0x17')],'lastMsgDirection':_0x369597[_0xda00('0x10')][_0xda00('0x11')]()});}})['catch'](function(_0x350749){console[_0xda00('0x18')](_0x350749);});}if(_0x369597[_0xda00('0x10')]==='out'&&!_0x369597[_0xda00('0x12')]){var _0x3917f8;_0x436629[_0xda00('0x19')]['find']({'where':{'id':_0x369597[_0xda00('0x1a')]},'raw':!![]})[_0xda00('0x16')](function(_0xef0c09){_0x3917f8=_0xef0c09;if(_0x3917f8&&_0x3917f8['type']){switch(_0x3917f8[_0xda00('0x1b')]){case _0xda00('0x1c'):var _0x4b7ff9=require(_0xda00('0x1c'));if(_0x3917f8['accountSid']&&_0x3917f8[_0xda00('0x1d')]&&_0x3917f8[_0xda00('0x1e')]){var _0xcdecfa=new _0x4b7ff9(_0x3917f8[_0xda00('0x1f')],_0x3917f8[_0xda00('0x1d')]);_0xcdecfa['messages'][_0xda00('0x20')]({'body':_0x369597[_0xda00('0xd')],'to':_0x369597['phone'],'from':_0x3917f8['phone'],'statusCallback':_0x3917f8[_0xda00('0x21')]+_0xda00('0x22')+_0x369597['id']+_0xda00('0x23')+_0x3917f8[_0xda00('0x24')]})[_0xda00('0x16')](function(_0x72ef7f){if(_0x72ef7f[_0xda00('0x25')]){return _0x465e72[_0xda00('0x26')]({'messageId':_0x72ef7f[_0xda00('0x25')]});}})[_0xda00('0x27')](function(_0x2749ee){logger[_0xda00('0x18')](_0xda00('0x28'),_0xda00('0x29'),_0xda00('0x1c'),util['inspect'](_0x2749ee,{'showHidden':![],'depth':null}));});}else{logger[_0xda00('0x18')](_0xda00('0x28'),_0xda00('0x29'),'twilio',_0xda00('0x2a'));}break;case'skebby':var _0x459d87=_0xda00('0x2b');if(_0x3917f8[_0xda00('0x2c')]&&_0x3917f8[_0xda00('0x2d')]){var _0x168c82={'recipient':[_0x369597[_0xda00('0x1e')]],'message':_0x369597[_0xda00('0xd')],'message_type':_0x3917f8[_0xda00('0x2e')]};if(_0x3917f8['smsMethod']&&_0x3917f8[_0xda00('0x2e')]!=='SI'){_0x168c82[_0xda00('0x2f')]=_0x3917f8[_0xda00('0x1e')];}var _0x4c5c83={'url':_0x459d87+_0xda00('0x30')+_0x3917f8['username']+_0xda00('0x31')+_0x3917f8[_0xda00('0x2d')],'method':_0xda00('0x32')};rp(_0x4c5c83)['then'](function(_0x5444fa){var _0x2fd4a6=_0x5444fa[_0xda00('0x33')](';');var _0x51ce03={'user_key':_0x2fd4a6[0x0],'session_key':_0x2fd4a6[0x1]};_0x4c5c83={'url':_0x459d87+_0xda00('0x34'),'method':_0xda00('0x35'),'headers':{'user_key':_0x51ce03['user_key'],'Session_key':_0x51ce03['session_key']},'json':!![],'body':_0x168c82};return rp(_0x4c5c83);})[_0xda00('0x16')](function(_0x2d8ce6){if(_0x2d8ce6[_0xda00('0x36')]>=0x1){var _0x39b3f7={'messageId':_0x2d8ce6[_0xda00('0x37')]};if(_0x3917f8['smsMethod']!=='GP'||!_0x3917f8[_0xda00('0x38')]){_0x39b3f7[_0xda00('0x39')]=!![];}return _0x465e72[_0xda00('0x26')](_0x39b3f7);}else{return logger[_0xda00('0x18')](_0xda00('0x28'),'afterCreate',_0xda00('0x3a'),util[_0xda00('0x3b')](_0x2d8ce6,{'showHidden':![],'depth':null}));}})[_0xda00('0x27')](function(_0x22982f){return logger[_0xda00('0x18')](_0xda00('0x28'),_0xda00('0x29'),_0xda00('0x3a'),util[_0xda00('0x3b')](_0x22982f,{'showHidden':![],'depth':null}));});}else{logger[_0xda00('0x18')](_0xda00('0x28'),'afterCreate','skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0xda00('0x3c'):if(_0x3917f8[_0xda00('0x1d')]){var _0x37fcd2={'recipient':_0x369597[_0xda00('0x1e')],'message':_0x369597[_0xda00('0xd')],'sender':_0x3917f8[_0xda00('0x3d')]||_0x3917f8[_0xda00('0x1e')],'authorization':_0x3917f8['authToken']};var _0x2cd58f={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x37fcd2,'json':!![]};rp(_0x2cd58f)[_0xda00('0x16')](function(_0x20e417){var _0x555e96={'messageId':_0x20e417[_0xda00('0x3e')]};if(!_0x3917f8['deliveryReport']){_0x555e96['read']=!![];}return _0x465e72[_0xda00('0x26')](_0x555e96);})[_0xda00('0x27')](function(_0x12abfd){logger['error'](_0xda00('0x28'),'afterCreate',_0xda00('0x3c'),util[_0xda00('0x3b')](_0x12abfd,{'showHidden':![],'depth':null}));});}else{logger[_0xda00('0x18')](_0xda00('0x28'),_0xda00('0x29'),_0xda00('0x3c'),_0xda00('0x3f'));}break;case'clicksend':if(_0x3917f8[_0xda00('0x2c')]&&_0x3917f8[_0xda00('0x2d')]){var _0x37fcd2={'messages':[{'source':_0xda00('0x40'),'to':_0x369597[_0xda00('0x1e')],'body':_0x369597[_0xda00('0xd')],'from':_0x3917f8[_0xda00('0x3d')]||_0x3917f8[_0xda00('0x1e')]}]};var _0x50de6a=util['format'](_0xda00('0x41'),_0x3917f8[_0xda00('0x2c')],_0x3917f8[_0xda00('0x2d')]);var _0x2cd58f={'method':_0xda00('0x35'),'uri':_0xda00('0x42'),'body':_0x37fcd2,'headers':{'Authorization':util['format'](_0xda00('0x43'),new Buffer(_0x50de6a)['toString'](_0xda00('0x44')))},'json':!![]};rp(_0x2cd58f)['then'](function(_0x4d6653){if(_0x4d6653[_0xda00('0x45')]>=0xc8&&_0x4d6653[_0xda00('0x45')]<=0xce){if(_0x4d6653[_0xda00('0x46')]&&_0x4d6653[_0xda00('0x46')][_0xda00('0x47')]>0x0){var _0x2695c6=_[_0xda00('0x48')](_0x4d6653[_0xda00('0x46')]['messages']);var _0x2a3e33={'messageId':_0x2695c6[_0xda00('0x49')]};if(!_0x3917f8[_0xda00('0x38')]){_0x2a3e33['read']=!![];}return _0x465e72['update'](_0x2a3e33);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xda00('0x29'),'clickSend',util[_0xda00('0x3b')](_0x4d6653,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xda00('0x28'),_0xda00('0x29'),_0xda00('0x4a'),util[_0xda00('0x3b')](_0x4d6653,{'showHidden':![],'depth':null}));}})[_0xda00('0x27')](function(_0x4d3d93){logger['error'](_0xda00('0x28'),_0xda00('0x29'),_0xda00('0x4a'),util[_0xda00('0x3b')](_0x4d3d93,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xda00('0x28'),'afterCreate',_0xda00('0x4a'),_0xda00('0x4b'));}break;case _0xda00('0x4c'):if(_0x3917f8[_0xda00('0x4d')]&&_0x3917f8['authToken']){var _0x37fcd2={'dst':_0x369597[_0xda00('0x1e')],'text':_0x369597[_0xda00('0xd')],'src':_0x3917f8[_0xda00('0x3d')]||_0x3917f8[_0xda00('0x1e')],'url':_0x3917f8['remote']+_0xda00('0x22')+_0x369597['id']+_0xda00('0x23')+_0x3917f8['token']};var _0x50de6a=util[_0xda00('0x4e')](_0xda00('0x41'),_0x3917f8[_0xda00('0x4d')],_0x3917f8[_0xda00('0x1d')]);var _0x2cd58f={'method':_0xda00('0x35'),'uri':util[_0xda00('0x4e')](_0xda00('0x4f'),_0x3917f8[_0xda00('0x4d')]),'body':_0x37fcd2,'headers':{'Authorization':util[_0xda00('0x4e')](_0xda00('0x43'),new Buffer(_0x50de6a)[_0xda00('0x50')]('base64'))},'json':!![]};rp(_0x2cd58f)[_0xda00('0x16')](function(_0x37f101){var _0x104ea7={'messageId':_0x37f101[_0xda00('0x51')][0x0]};return _0x465e72['update'](_0x104ea7);})[_0xda00('0x27')](function(_0x17311a){logger[_0xda00('0x18')](_0xda00('0x28'),_0xda00('0x29'),_0xda00('0x4c'),util[_0xda00('0x3b')](_0x17311a,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xda00('0x29'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xda00('0x52'):if(_0x3917f8[_0xda00('0x2c')]&&_0x3917f8[_0xda00('0x2d')]){if(_0x3917f8['baseUrl']){var _0x5a40bf={'method':_0xda00('0x35'),'uri':_0x3917f8[_0xda00('0x53')]+_0xda00('0x54'),'body':{'username':_0x3917f8[_0xda00('0x2c')],'password':_0x3917f8[_0xda00('0x2d')]},'json':!![]};return rp(_0x5a40bf)[_0xda00('0x16')](function(_0x469297){var _0x3d8048={'method':_0xda00('0x35'),'uri':_0x3917f8[_0xda00('0x53')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x3917f8[_0xda00('0x1e')],'destinations':[{'to':_0x369597[_0xda00('0x1e')]}],'text':_0x369597['body'],'notifyUrl':_0x3917f8[_0xda00('0x21')]+_0xda00('0x22')+_0x369597['id']+'/status?token='+_0x3917f8['token'],'notifyContentType':_0xda00('0x55'),'callbackData':_0x3917f8[_0xda00('0x1e')]+';'+_0x369597[_0xda00('0xd')]}]},'headers':{'Authorization':_0xda00('0x56')+_0x469297['token']},'json':!![]};return rp(_0x3d8048)[_0xda00('0x16')](function(_0x3fa73f){if(_0x3fa73f[_0xda00('0x57')]){var _0x3bd877={'messageId':_0x3fa73f['messages'][0x0][_0xda00('0xc')]};if(!_0x3917f8[_0xda00('0x38')]){_0x3bd877['read']=!![];}return _0x465e72[_0xda00('0x26')](_0x3bd877);}else{return logger[_0xda00('0x18')](_0xda00('0x28'),_0xda00('0x29'),_0xda00('0x52'),util[_0xda00('0x3b')](_0x3fa73f,{'showHidden':![],'depth':null}));}});})[_0xda00('0x27')](function(_0x1adfa1){return logger[_0xda00('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xda00('0x29'),_0xda00('0x52'),util['inspect'](_0x1adfa1,{'showHidden':![],'depth':null}));});}else{logger[_0xda00('0x18')](_0xda00('0x28'),_0xda00('0x29'),_0xda00('0x52'),_0xda00('0x58'));}}else{logger[_0xda00('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xda00('0x29'),_0xda00('0x52'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xda00('0x59'):var _0xe280f2=require(_0xda00('0x5a'));if(_0x3917f8['apiKey']){var _0x31c627={};_0x31c627[_0xda00('0x5b')]=_0x3917f8[_0xda00('0x2c')];_0x31c627[_0xda00('0x1e')]=_0x369597[_0xda00('0x1e')];_0x31c627[_0xda00('0x2f')]=_0x3917f8[_0xda00('0x1e')];_0x31c627[_0xda00('0x5c')]=_0x369597[_0xda00('0xd')];_0x31c627[_0xda00('0x5d')]=+new Date();var _0x8306c9='';var _0x2d73e2='';var _0x146fb6=Object[_0xda00('0x5e')](_0x31c627);_0x146fb6[_0xda00('0x5f')]();for(var _0x5b711e=0x0;_0x5b711e<_0x146fb6['length'];_0x5b711e++){if(_0x8306c9!=''){_0x8306c9+='&';}_0x8306c9+=_0x146fb6[_0x5b711e]+'='+encodeURIComponent(_0x31c627[_0x146fb6[_0x5b711e]]);_0x2d73e2+=_0x31c627[_0x146fb6[_0x5b711e]];}_0x2d73e2+=_0x3917f8[_0xda00('0x60')];_0x2d73e2=_0xe280f2['createHash'](_0xda00('0x61'))['update'](_0x2d73e2)[_0xda00('0x62')](_0xda00('0x63'));if(_0x8306c9!==''){_0x8306c9+='&';}_0x8306c9+='signature='+_0x2d73e2;var _0x4c5c83={'method':_0xda00('0x32'),'uri':_0x3917f8[_0xda00('0x53')]+_0xda00('0x64')+_0x8306c9,'json':!![]};return rp(_0x4c5c83)['then'](function(_0x7949ee){var _0x210caa=Object[_0xda00('0x5e')](_0x7949ee);if(_0x7949ee[_0x210caa[0x0]][_0xda00('0x18')]&&parseInt(_0x7949ee[_0x210caa[0x0]]['error'])===0x0){var _0xff0d84={'messageId':_0x7949ee[_0x210caa[0x0]][_0xda00('0x65')]};if(!_0x3917f8['deliveryReport']){_0xff0d84[_0xda00('0x39')]=!![];}return _0x465e72[_0xda00('0x26')](_0xff0d84);}else{return logger[_0xda00('0x18')](_0xda00('0x28'),'afterCreate',_0xda00('0x59'),util[_0xda00('0x3b')](_0x7949ee[_0xda00('0x18')],{'showHidden':![],'depth':null}));}})[_0xda00('0x27')](function(_0x264183){return logger[_0xda00('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xda00('0x29'),_0xda00('0x59'),util[_0xda00('0x3b')](_0x264183,{'showHidden':![],'depth':null}));});}else{logger[_0xda00('0x18')](_0xda00('0x28'),_0xda00('0x29'),'csc',_0xda00('0x66'));}break;case'clickatell':if(_0x3917f8[_0xda00('0x60')]){var _0x25a0a0={'method':'POST','uri':_0xda00('0x67'),'headers':{'Authorization':_0x3917f8[_0xda00('0x60')]},'body':{'content':_0x369597['body'],'to':[_0x369597['phone']],'from':_0x3917f8[_0xda00('0x1e')],'binary':![],'clientMessageId':_0xda00('0x68'),'charset':'UTF-8'},'json':!![]};rp(_0x25a0a0)[_0xda00('0x16')](function(_0x577954){if(!_0x577954[_0xda00('0x18')]){var _0x2bd5bb={'messageId':_0x577954[_0xda00('0x57')][0x0][_0xda00('0x69')]};if(!_0x3917f8[_0xda00('0x38')]){_0x2bd5bb[_0xda00('0x39')]=!![];}return _0x465e72[_0xda00('0x26')](_0x2bd5bb);}else{return logger[_0xda00('0x18')](_0xda00('0x28'),_0xda00('0x29'),_0xda00('0x6a'),util[_0xda00('0x3b')](_0x577954[_0xda00('0x18')],{'showHidden':![],'depth':null}));}})[_0xda00('0x27')](function(_0x405de2){return logger[_0xda00('0x18')](_0xda00('0x28'),_0xda00('0x29'),_0xda00('0x6a'),util[_0xda00('0x3b')](_0x405de2,{'showHidden':![],'depth':null}));});}else{logger[_0xda00('0x18')](_0xda00('0x28'),'afterCreate',_0xda00('0x6a'),_0xda00('0x66'));}break;case _0xda00('0x6b'):if(_0x3917f8['username']&&_0x3917f8['password']){var _0x50de6a=util[_0xda00('0x4e')]('%s:%s',_0x3917f8[_0xda00('0x2c')],_0x3917f8[_0xda00('0x2d')]);var _0x2cd58f={'method':_0xda00('0x35'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x3917f8[_0xda00('0x6c')]+_0xda00('0x6d'),'body':{'to':[_0x369597[_0xda00('0x1e')]],'text':_0x369597[_0xda00('0xd')],'from':_0x3917f8['phone'],'applicationId':_0x3917f8[_0xda00('0x6e')]},'headers':{'Authorization':util['format'](_0xda00('0x43'),new Buffer(_0x50de6a)[_0xda00('0x50')](_0xda00('0x44')))},'json':!![]};rp(_0x2cd58f)['then'](function(_0x464f80){if(_0x464f80['id']){var _0x29d32c={'messageId':_0x464f80['id']};return _0x465e72[_0xda00('0x26')](_0x29d32c);}else{logger['error'](_0xda00('0x28'),_0xda00('0x29'),_0xda00('0x6b'),util[_0xda00('0x3b')](_0x464f80,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3e6a7e){logger['error'](_0xda00('0x28'),_0xda00('0x29'),_0xda00('0x6b'),util['inspect'](_0x3e6a7e,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xda00('0x29'),_0xda00('0x6b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xda00('0x6f'):if(_0x3917f8['apiKey']){var _0x2f4ea9={};var _0x4c5c83={'method':_0xda00('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xda00('0x70')+_0x3917f8[_0xda00('0x60')],'Content-Type':_0xda00('0x55')},'body':{'from':_0x3917f8[_0xda00('0x1e')],'to':_0x369597[_0xda00('0x1e')],'text':_0x369597[_0xda00('0xd')]},'json':!![]};return rp(_0x4c5c83)[_0xda00('0x16')](function(_0x78365d){if(_0x78365d[_0xda00('0x71')]==0xca){_0x2f4ea9[_0xda00('0x72')]=_0x78365d;var _0x4d65e2={'method':'POST','uri':_0xda00('0x73'),'headers':{'Authorization':'Bearer\x20'+_0x3917f8[_0xda00('0x60')],'Content-Type':_0xda00('0x55')},'body':{'refid':_0x2f4ea9[_0xda00('0x72')][_0xda00('0x74')]},'json':!![]};return rp(_0x4d65e2)['then'](function(_0x4880ef){_0x2f4ea9[_0xda00('0x75')]=_0x4880ef;var _0x2d00e7={'messageId':_0x2f4ea9['message'][_0xda00('0x74')],'read':!![]};return _0x465e72[_0xda00('0x26')](_0x2d00e7);});}else{return logger[_0xda00('0x18')](_0xda00('0x28'),_0xda00('0x29'),'intelepeer',util['inspect'](_0x78365d,{'showHidden':![],'depth':null}));}})[_0xda00('0x27')](function(_0x18a30f){return logger[_0xda00('0x18')](_0xda00('0x28'),_0xda00('0x29'),_0xda00('0x6f'),util['inspect'](_0x18a30f,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xda00('0x29'),_0xda00('0x6f'),_0xda00('0x76'));}break;}}})[_0xda00('0x77')](function(){_0x234581();});}else{_0x234581();}}},'charset':_0xda00('0x78'),'collate':_0xda00('0x79')});}; \ No newline at end of file +var _0x8526=['plivo','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','sort','length','createHash','md5','digest','hex','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','bandwidth','accountId','/messages','applicationId','base64','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','message','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./smsMessage.attributes','exports','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','SmsInteractionId','createdAt','catch','error','SmsAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','update','skebby','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','http_code','data','queued_count','head','message_id','deliveryReport','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/'];(function(_0x4b38a,_0x45fdf7){var _0xf0592b=function(_0x400581){while(--_0x400581){_0x4b38a['push'](_0x4b38a['shift']());}};_0xf0592b(++_0x45fdf7);}(_0x8526,0x19d));var _0x6852=function(_0xab5b18,_0x1dd56b){_0xab5b18=_0xab5b18-0x0;var _0x4a0dc8=_0x8526[_0xab5b18];return _0x4a0dc8;};'use strict';var _=require(_0x6852('0x0'));var util=require(_0x6852('0x1'));var logger=require(_0x6852('0x2'))(_0x6852('0x3'));var moment=require(_0x6852('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6852('0x5'));var rimraf=require(_0x6852('0x6'));var config=require(_0x6852('0x7'));var attributes=require(_0x6852('0x8'));module[_0x6852('0x9')]=function(_0x5e50cb,_0x4c14ff){return _0x5e50cb['define']('SmsMessage',attributes,{'tableName':_0x6852('0xa'),'paranoid':![],'indexes':[{'name':_0x6852('0xb'),'fields':[_0x6852('0xb')]},{'name':_0x6852('0xc'),'fields':['body'],'type':_0x6852('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x371614,_0x1cb327,_0x44f60b){var _0x2494fd=_0x5e50cb[_0x6852('0xe')];var _0x548be2=_0x371614['get']({'plain':!![]});if(_0x548be2[_0x6852('0xf')][_0x6852('0x10')]()==='in'||_0x548be2[_0x6852('0xf')]['toLowerCase']()===_0x6852('0x11')&&!_0x548be2[_0x6852('0x12')]&&!_[_0x6852('0x13')](_0x548be2['UserId'])&&!_[_0x6852('0x13')](_0x548be2[_0x6852('0x14')])){_0x2494fd['SmsInteraction']['findOne']({'where':{'id':_0x548be2[_0x6852('0x14')]}})['then'](function(_0x2e14ae){if(_0x2e14ae){_0x2e14ae['update']({'lastMsgAt':_0x548be2[_0x6852('0x15')],'lastMsgDirection':_0x548be2[_0x6852('0xf')][_0x6852('0x10')]()});}})[_0x6852('0x16')](function(_0x2a5202){console[_0x6852('0x17')](_0x2a5202);});}if(_0x548be2[_0x6852('0xf')]==='out'&&!_0x548be2[_0x6852('0x12')]){var _0x37ed94;_0x2494fd['SmsAccount']['find']({'where':{'id':_0x548be2[_0x6852('0x18')]},'raw':!![]})[_0x6852('0x19')](function(_0x3723d6){_0x37ed94=_0x3723d6;if(_0x37ed94&&_0x37ed94[_0x6852('0x1a')]){switch(_0x37ed94['type']){case _0x6852('0x1b'):var _0x1349e2=require(_0x6852('0x1b'));if(_0x37ed94[_0x6852('0x1c')]&&_0x37ed94[_0x6852('0x1d')]&&_0x37ed94[_0x6852('0x1e')]){var _0xe7d72c=new _0x1349e2(_0x37ed94[_0x6852('0x1c')],_0x37ed94[_0x6852('0x1d')]);_0xe7d72c[_0x6852('0x1f')][_0x6852('0x20')]({'body':_0x548be2[_0x6852('0x21')],'to':_0x548be2['phone'],'from':_0x37ed94[_0x6852('0x1e')],'statusCallback':_0x37ed94[_0x6852('0x22')]+_0x6852('0x23')+_0x548be2['id']+_0x6852('0x24')+_0x37ed94[_0x6852('0x25')]})['then'](function(_0x5b92f5){if(_0x5b92f5[_0x6852('0x26')]){return _0x371614['update']({'messageId':_0x5b92f5[_0x6852('0x26')]});}})[_0x6852('0x16')](function(_0x3d0301){logger[_0x6852('0x17')](_0x6852('0x27'),_0x6852('0x28'),_0x6852('0x1b'),util['inspect'](_0x3d0301,{'showHidden':![],'depth':null}));});}else{logger[_0x6852('0x17')](_0x6852('0x27'),_0x6852('0x28'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x27fbe5=_0x6852('0x29');if(_0x37ed94[_0x6852('0x2a')]&&_0x37ed94[_0x6852('0x2b')]){var _0x1635fc={'recipient':[_0x548be2['phone']],'message':_0x548be2[_0x6852('0x21')],'message_type':_0x37ed94[_0x6852('0x2c')]};if(_0x37ed94[_0x6852('0x2c')]&&_0x37ed94[_0x6852('0x2c')]!=='SI'){_0x1635fc[_0x6852('0x2d')]=_0x37ed94['phone'];}var _0x1426e2={'url':_0x27fbe5+_0x6852('0x2e')+_0x37ed94[_0x6852('0x2a')]+_0x6852('0x2f')+_0x37ed94[_0x6852('0x2b')],'method':_0x6852('0x30')};rp(_0x1426e2)[_0x6852('0x19')](function(_0x24669f){var _0x510f82=_0x24669f[_0x6852('0x31')](';');var _0x21afe4={'user_key':_0x510f82[0x0],'session_key':_0x510f82[0x1]};_0x1426e2={'url':_0x27fbe5+_0x6852('0x32'),'method':_0x6852('0x33'),'headers':{'user_key':_0x21afe4[_0x6852('0x34')],'Session_key':_0x21afe4[_0x6852('0x35')]},'json':!![],'body':_0x1635fc};return rp(_0x1426e2);})[_0x6852('0x19')](function(_0x4c4c70){if(_0x4c4c70['total_sent']>=0x1){var _0x3f78ec={'messageId':_0x4c4c70['internal_order_id']};if(_0x37ed94['smsMethod']!=='GP'||!_0x37ed94['deliveryReport']){_0x3f78ec['read']=!![];}return _0x371614[_0x6852('0x36')](_0x3f78ec);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6852('0x28'),_0x6852('0x37'),util[_0x6852('0x38')](_0x4c4c70,{'showHidden':![],'depth':null}));}})[_0x6852('0x16')](function(_0x133a6a){return logger[_0x6852('0x17')](_0x6852('0x27'),'afterCreate',_0x6852('0x37'),util['inspect'](_0x133a6a,{'showHidden':![],'depth':null}));});}else{logger[_0x6852('0x17')](_0x6852('0x27'),_0x6852('0x28'),_0x6852('0x37'),_0x6852('0x39'));}break;case _0x6852('0x3a'):if(_0x37ed94[_0x6852('0x1d')]){var _0x351da4={'recipient':_0x548be2[_0x6852('0x1e')],'message':_0x548be2[_0x6852('0x21')],'sender':_0x37ed94[_0x6852('0x3b')]||_0x37ed94[_0x6852('0x1e')],'authorization':_0x37ed94['authToken']};var _0x1cb327={'method':'POST','uri':_0x6852('0x3c'),'body':_0x351da4,'json':!![]};rp(_0x1cb327)[_0x6852('0x19')](function(_0x545f05){var _0x13d051={'messageId':_0x545f05[_0x6852('0x3d')]};if(!_0x37ed94['deliveryReport']){_0x13d051[_0x6852('0x3e')]=!![];}return _0x371614['update'](_0x13d051);})[_0x6852('0x16')](function(_0x37b43a){logger[_0x6852('0x17')](_0x6852('0x27'),_0x6852('0x28'),'connectel',util[_0x6852('0x38')](_0x37b43a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6852('0x27'),_0x6852('0x28'),_0x6852('0x3a'),_0x6852('0x3f'));}break;case _0x6852('0x40'):if(_0x37ed94[_0x6852('0x2a')]&&_0x37ed94['password']){var _0x351da4={'messages':[{'source':_0x6852('0x41'),'to':_0x548be2[_0x6852('0x1e')],'body':_0x548be2[_0x6852('0x21')],'from':_0x37ed94[_0x6852('0x3b')]||_0x37ed94[_0x6852('0x1e')]}]};var _0x3735d4=util[_0x6852('0x42')](_0x6852('0x43'),_0x37ed94[_0x6852('0x2a')],_0x37ed94[_0x6852('0x2b')]);var _0x1cb327={'method':_0x6852('0x33'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x351da4,'headers':{'Authorization':util['format'](_0x6852('0x44'),new Buffer(_0x3735d4)[_0x6852('0x45')]('base64'))},'json':!![]};rp(_0x1cb327)['then'](function(_0x1b68e0){if(_0x1b68e0[_0x6852('0x46')]>=0xc8&&_0x1b68e0['http_code']<=0xce){if(_0x1b68e0[_0x6852('0x47')]&&_0x1b68e0['data'][_0x6852('0x48')]>0x0){var _0x4ad99f=_[_0x6852('0x49')](_0x1b68e0[_0x6852('0x47')]['messages']);var _0x585720={'messageId':_0x4ad99f[_0x6852('0x4a')]};if(!_0x37ed94[_0x6852('0x4b')]){_0x585720['read']=!![];}return _0x371614[_0x6852('0x36')](_0x585720);}else{logger[_0x6852('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6852('0x28'),_0x6852('0x4c'),util[_0x6852('0x38')](_0x1b68e0,{'showHidden':![],'depth':null}));}}else{logger[_0x6852('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6852('0x28'),_0x6852('0x4c'),util[_0x6852('0x38')](_0x1b68e0,{'showHidden':![],'depth':null}));}})['catch'](function(_0x26d104){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6852('0x28'),_0x6852('0x4c'),util['inspect'](_0x26d104,{'showHidden':![],'depth':null}));});}else{logger[_0x6852('0x17')](_0x6852('0x27'),_0x6852('0x28'),_0x6852('0x4c'),_0x6852('0x39'));}break;case'plivo':if(_0x37ed94[_0x6852('0x4d')]&&_0x37ed94[_0x6852('0x1d')]){var _0x351da4={'dst':_0x548be2[_0x6852('0x1e')],'text':_0x548be2[_0x6852('0x21')],'src':_0x37ed94[_0x6852('0x3b')]||_0x37ed94['phone'],'url':_0x37ed94['remote']+'/api/sms/messages/'+_0x548be2['id']+_0x6852('0x24')+_0x37ed94[_0x6852('0x25')]};var _0x3735d4=util[_0x6852('0x42')](_0x6852('0x43'),_0x37ed94[_0x6852('0x4d')],_0x37ed94[_0x6852('0x1d')]);var _0x1cb327={'method':_0x6852('0x33'),'uri':util[_0x6852('0x42')](_0x6852('0x4e'),_0x37ed94['authId']),'body':_0x351da4,'headers':{'Authorization':util[_0x6852('0x42')](_0x6852('0x44'),new Buffer(_0x3735d4)[_0x6852('0x45')]('base64'))},'json':!![]};rp(_0x1cb327)[_0x6852('0x19')](function(_0x4baac2){var _0x561d80={'messageId':_0x4baac2['message_uuid'][0x0]};return _0x371614[_0x6852('0x36')](_0x561d80);})['catch'](function(_0x269959){logger[_0x6852('0x17')](_0x6852('0x27'),'afterCreate',_0x6852('0x4f'),util[_0x6852('0x38')](_0x269959,{'showHidden':![],'depth':null}));});}else{logger[_0x6852('0x17')](_0x6852('0x27'),_0x6852('0x28'),_0x6852('0x4f'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x6852('0x50'):if(_0x37ed94['username']&&_0x37ed94[_0x6852('0x2b')]){if(_0x37ed94[_0x6852('0x51')]){var _0x1fa79d={'method':'POST','uri':_0x37ed94[_0x6852('0x51')]+_0x6852('0x52'),'body':{'username':_0x37ed94[_0x6852('0x2a')],'password':_0x37ed94[_0x6852('0x2b')]},'json':!![]};return rp(_0x1fa79d)[_0x6852('0x19')](function(_0x52a9a8){var _0x8a55f5={'method':_0x6852('0x33'),'uri':_0x37ed94['baseUrl']+_0x6852('0x53'),'body':{'messages':[{'from':_0x37ed94[_0x6852('0x1e')],'destinations':[{'to':_0x548be2['phone']}],'text':_0x548be2[_0x6852('0x21')],'notifyUrl':_0x37ed94[_0x6852('0x22')]+_0x6852('0x23')+_0x548be2['id']+_0x6852('0x24')+_0x37ed94[_0x6852('0x25')],'notifyContentType':_0x6852('0x54'),'callbackData':_0x37ed94[_0x6852('0x1e')]+';'+_0x548be2[_0x6852('0x21')]}]},'headers':{'Authorization':_0x6852('0x55')+_0x52a9a8['token']},'json':!![]};return rp(_0x8a55f5)['then'](function(_0x59c831){if(_0x59c831[_0x6852('0x1f')]){var _0x36685d={'messageId':_0x59c831[_0x6852('0x1f')][0x0][_0x6852('0xb')]};if(!_0x37ed94['deliveryReport']){_0x36685d[_0x6852('0x3e')]=!![];}return _0x371614['update'](_0x36685d);}else{return logger[_0x6852('0x17')](_0x6852('0x27'),_0x6852('0x28'),_0x6852('0x50'),util[_0x6852('0x38')](_0x59c831,{'showHidden':![],'depth':null}));}});})[_0x6852('0x16')](function(_0x50b994){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6852('0x50'),util[_0x6852('0x38')](_0x50b994,{'showHidden':![],'depth':null}));});}else{logger[_0x6852('0x17')](_0x6852('0x27'),_0x6852('0x28'),_0x6852('0x50'),_0x6852('0x56'));}}else{logger[_0x6852('0x17')](_0x6852('0x27'),_0x6852('0x28'),_0x6852('0x50'),_0x6852('0x39'));}break;case _0x6852('0x57'):var _0x212f33=require(_0x6852('0x58'));if(_0x37ed94[_0x6852('0x59')]){var _0x596c71={};_0x596c71[_0x6852('0x5a')]=_0x37ed94[_0x6852('0x2a')];_0x596c71[_0x6852('0x1e')]=_0x548be2['phone'];_0x596c71[_0x6852('0x2d')]=_0x37ed94['phone'];_0x596c71[_0x6852('0x5b')]=_0x548be2['body'];_0x596c71[_0x6852('0x5c')]=+new Date();var _0x4311bf='';var _0x40def4='';var _0x98752=Object['keys'](_0x596c71);_0x98752[_0x6852('0x5d')]();for(var _0x5226f2=0x0;_0x5226f2<_0x98752[_0x6852('0x5e')];_0x5226f2++){if(_0x4311bf!=''){_0x4311bf+='&';}_0x4311bf+=_0x98752[_0x5226f2]+'='+encodeURIComponent(_0x596c71[_0x98752[_0x5226f2]]);_0x40def4+=_0x596c71[_0x98752[_0x5226f2]];}_0x40def4+=_0x37ed94[_0x6852('0x59')];_0x40def4=_0x212f33[_0x6852('0x5f')](_0x6852('0x60'))['update'](_0x40def4)[_0x6852('0x61')](_0x6852('0x62'));if(_0x4311bf!==''){_0x4311bf+='&';}_0x4311bf+='signature='+_0x40def4;var _0x1426e2={'method':_0x6852('0x30'),'uri':_0x37ed94[_0x6852('0x51')]+_0x6852('0x63')+_0x4311bf,'json':!![]};return rp(_0x1426e2)[_0x6852('0x19')](function(_0x4e54fc){var _0x3f97a4=Object[_0x6852('0x64')](_0x4e54fc);if(_0x4e54fc[_0x3f97a4[0x0]]['error']&&parseInt(_0x4e54fc[_0x3f97a4[0x0]]['error'])===0x0){var _0x4d3fb1={'messageId':_0x4e54fc[_0x3f97a4[0x0]][_0x6852('0x65')]};if(!_0x37ed94[_0x6852('0x4b')]){_0x4d3fb1[_0x6852('0x3e')]=!![];}return _0x371614[_0x6852('0x36')](_0x4d3fb1);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6852('0x28'),_0x6852('0x57'),util[_0x6852('0x38')](_0x4e54fc[_0x6852('0x17')],{'showHidden':![],'depth':null}));}})[_0x6852('0x16')](function(_0xd15a1f){return logger[_0x6852('0x17')](_0x6852('0x27'),_0x6852('0x28'),_0x6852('0x57'),util[_0x6852('0x38')](_0xd15a1f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6852('0x27'),_0x6852('0x28'),_0x6852('0x57'),_0x6852('0x66'));}break;case _0x6852('0x67'):if(_0x37ed94[_0x6852('0x59')]){var _0xd4f8bd={'method':_0x6852('0x33'),'uri':_0x6852('0x68'),'headers':{'Authorization':_0x37ed94[_0x6852('0x59')]},'body':{'content':_0x548be2[_0x6852('0x21')],'to':[_0x548be2[_0x6852('0x1e')]],'from':_0x37ed94['phone'],'binary':![],'clientMessageId':_0x6852('0x69'),'charset':'UTF-8'},'json':!![]};rp(_0xd4f8bd)[_0x6852('0x19')](function(_0x197fce){if(!_0x197fce[_0x6852('0x17')]){var _0x224394={'messageId':_0x197fce['messages'][0x0][_0x6852('0x6a')]};if(!_0x37ed94[_0x6852('0x4b')]){_0x224394[_0x6852('0x3e')]=!![];}return _0x371614[_0x6852('0x36')](_0x224394);}else{return logger['error'](_0x6852('0x27'),_0x6852('0x28'),_0x6852('0x67'),util[_0x6852('0x38')](_0x197fce[_0x6852('0x17')],{'showHidden':![],'depth':null}));}})[_0x6852('0x16')](function(_0x4b20e0){return logger[_0x6852('0x17')](_0x6852('0x27'),'afterCreate','clickatell',util[_0x6852('0x38')](_0x4b20e0,{'showHidden':![],'depth':null}));});}else{logger[_0x6852('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6852('0x28'),_0x6852('0x67'),_0x6852('0x66'));}break;case _0x6852('0x6b'):if(_0x37ed94['username']&&_0x37ed94[_0x6852('0x2b')]){var _0x3735d4=util[_0x6852('0x42')](_0x6852('0x43'),_0x37ed94['username'],_0x37ed94[_0x6852('0x2b')]);var _0x1cb327={'method':_0x6852('0x33'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x37ed94[_0x6852('0x6c')]+_0x6852('0x6d'),'body':{'to':[_0x548be2['phone']],'text':_0x548be2[_0x6852('0x21')],'from':_0x37ed94[_0x6852('0x1e')],'applicationId':_0x37ed94[_0x6852('0x6e')]},'headers':{'Authorization':util[_0x6852('0x42')](_0x6852('0x44'),new Buffer(_0x3735d4)[_0x6852('0x45')](_0x6852('0x6f')))},'json':!![]};rp(_0x1cb327)[_0x6852('0x19')](function(_0x159352){if(_0x159352['id']){var _0x437aab={'messageId':_0x159352['id']};return _0x371614[_0x6852('0x36')](_0x437aab);}else{logger[_0x6852('0x17')](_0x6852('0x27'),_0x6852('0x28'),'bandwidth',util[_0x6852('0x38')](_0x159352,{'showHidden':![],'depth':null}));}})[_0x6852('0x16')](function(_0x4c04b7){logger[_0x6852('0x17')](_0x6852('0x27'),_0x6852('0x28'),_0x6852('0x6b'),util[_0x6852('0x38')](_0x4c04b7,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6852('0x28'),_0x6852('0x6b'),_0x6852('0x39'));}break;case _0x6852('0x70'):if(_0x37ed94[_0x6852('0x59')]){var _0x22e4d2={};var _0x1426e2={'method':_0x6852('0x33'),'uri':_0x6852('0x71'),'headers':{'Authorization':_0x6852('0x72')+_0x37ed94['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x37ed94[_0x6852('0x1e')],'to':_0x548be2[_0x6852('0x1e')],'text':_0x548be2[_0x6852('0x21')]},'json':!![]};return rp(_0x1426e2)[_0x6852('0x19')](function(_0x4de214){if(_0x4de214[_0x6852('0x73')]==0xca){_0x22e4d2['message']=_0x4de214;var _0x2c7327={'method':_0x6852('0x33'),'uri':_0x6852('0x74'),'headers':{'Authorization':_0x6852('0x72')+_0x37ed94['apiKey'],'Content-Type':_0x6852('0x54')},'body':{'refid':_0x22e4d2['message'][_0x6852('0x75')]},'json':!![]};return rp(_0x2c7327)[_0x6852('0x19')](function(_0xd3c9e8){_0x22e4d2[_0x6852('0x76')]=_0xd3c9e8;var _0xb62ba7={'messageId':_0x22e4d2[_0x6852('0x77')]['refid'],'read':!![]};return _0x371614[_0x6852('0x36')](_0xb62ba7);});}else{return logger[_0x6852('0x17')](_0x6852('0x27'),_0x6852('0x28'),_0x6852('0x70'),util['inspect'](_0x4de214,{'showHidden':![],'depth':null}));}})[_0x6852('0x16')](function(_0x48faaa){return logger[_0x6852('0x17')](_0x6852('0x27'),'afterCreate',_0x6852('0x70'),util[_0x6852('0x38')](_0x48faaa,{'showHidden':![],'depth':null}));});}else{return logger[_0x6852('0x17')](_0x6852('0x27'),_0x6852('0x28'),_0x6852('0x70'),_0x6852('0x78'));}break;}}})[_0x6852('0x79')](function(){_0x44f60b();});}else{_0x44f60b();}}},'charset':'utf8mb4','collate':_0x6852('0x7a')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 5ea6e7a..0c9088a 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 _0xd8b3=['request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSmsMessage','create','body','options','raw','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8b3,0xd2));var _0x3d8b=function(_0x5c8827,_0x5bc5d7){_0x5c8827=_0x5c8827-0x0;var _0x50ffd5=_0xd8b3[_0x5c8827];return _0x50ffd5;};'use strict';var _=require(_0x3d8b('0x0'));var util=require(_0x3d8b('0x1'));var moment=require('moment');var BPromise=require(_0x3d8b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d8b('0x3'));var db=require(_0x3d8b('0x4'))['db'];var utils=require(_0x3d8b('0x5'));var logger=require(_0x3d8b('0x6'))(_0x3d8b('0x7'));var config=require(_0x3d8b('0x8'));var jayson=require(_0x3d8b('0x9'));var client=jayson[_0x3d8b('0xa')][_0x3d8b('0xb')]({'port':0x232a});config[_0x3d8b('0xc')]=_['defaults'](config[_0x3d8b('0xc')],{'host':_0x3d8b('0xd'),'port':0x18eb});var socket=require(_0x3d8b('0xe'))(new Redis(config[_0x3d8b('0xc')]));require(_0x3d8b('0xf'))[_0x3d8b('0x10')](socket);function respondWithRpcPromise(_0x2b8fa7,_0x4ed95b,_0x299cb9){return new BPromise(function(_0x379814,_0x34f95f){return client[_0x3d8b('0x11')](_0x2b8fa7,_0x299cb9)[_0x3d8b('0x12')](function(_0xec179f){logger[_0x3d8b('0x13')](_0x3d8b('0x14'),_0x4ed95b,_0x3d8b('0x15'));logger['debug'](_0x3d8b('0x16'),_0x4ed95b,_0x3d8b('0x15'),JSON[_0x3d8b('0x17')](_0xec179f));if(_0xec179f[_0x3d8b('0x18')]){if(_0xec179f[_0x3d8b('0x18')]['code']===0x1f4){logger[_0x3d8b('0x18')](_0x3d8b('0x14'),_0x4ed95b,_0xec179f[_0x3d8b('0x18')][_0x3d8b('0x19')]);return _0x34f95f(_0xec179f[_0x3d8b('0x18')][_0x3d8b('0x19')]);}logger[_0x3d8b('0x18')](_0x3d8b('0x14'),_0x4ed95b,_0xec179f[_0x3d8b('0x18')][_0x3d8b('0x19')]);return _0x379814(_0xec179f[_0x3d8b('0x18')]['message']);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x4ed95b,'request\x20sent');_0x379814(_0xec179f[_0x3d8b('0x1a')][_0x3d8b('0x19')]);}})['catch'](function(_0x331c96){logger[_0x3d8b('0x18')]('SmsMessage,\x20%s,\x20%s',_0x4ed95b,_0x331c96);_0x34f95f(_0x331c96);});});}exports[_0x3d8b('0x1b')]=function(_0x52d679){var _0x1d7b33=this;return new Promise(function(_0x281c6b,_0x349a58){return db['SmsMessage'][_0x3d8b('0x1c')](_0x52d679[_0x3d8b('0x1d')],{'raw':_0x52d679['options']?_0x52d679[_0x3d8b('0x1e')][_0x3d8b('0x1f')]===undefined?!![]:![]:!![]})[_0x3d8b('0x12')](function(_0x52a640){logger['info'](_0x3d8b('0x1b'),_0x52d679);logger['debug'](_0x3d8b('0x1b'),_0x52d679,JSON[_0x3d8b('0x17')](_0x52a640));_0x281c6b(_0x52a640);})[_0x3d8b('0x20')](function(_0x1ea05c){logger['error'](_0x3d8b('0x1b'),_0x1ea05c[_0x3d8b('0x19')],_0x52d679);_0x349a58(_0x1d7b33[_0x3d8b('0x18')](0x1f4,_0x1ea05c[_0x3d8b('0x19')]));});});}; \ No newline at end of file +var _0xa73b=['then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch','CreateSmsMessage','create','body','options','raw','stringify','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x3e3d12,_0x5d8c29){var _0x2685a8=function(_0x10943b){while(--_0x10943b){_0x3e3d12['push'](_0x3e3d12['shift']());}};_0x2685a8(++_0x5d8c29);}(_0xa73b,0x143));var _0xba73=function(_0x19dcd6,_0x4f1106){_0x19dcd6=_0x19dcd6-0x0;var _0x1e6009=_0xa73b[_0x19dcd6];return _0x1e6009;};'use strict';var _=require('lodash');var util=require(_0xba73('0x0'));var moment=require(_0xba73('0x1'));var BPromise=require('bluebird');var rs=require(_0xba73('0x2'));var fs=require('fs');var Redis=require(_0xba73('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xba73('0x4'));var logger=require(_0xba73('0x5'))(_0xba73('0x6'));var config=require(_0xba73('0x7'));var jayson=require(_0xba73('0x8'));var client=jayson[_0xba73('0x9')][_0xba73('0xa')]({'port':0x232a});config[_0xba73('0xb')]=_[_0xba73('0xc')](config[_0xba73('0xb')],{'host':_0xba73('0xd'),'port':0x18eb});var socket=require(_0xba73('0xe'))(new Redis(config[_0xba73('0xb')]));require('./smsMessage.socket')[_0xba73('0xf')](socket);function respondWithRpcPromise(_0x3c32cc,_0x2c0f6c,_0x57f2fb){return new BPromise(function(_0x258573,_0x1296b6){return client[_0xba73('0x10')](_0x3c32cc,_0x57f2fb)[_0xba73('0x11')](function(_0x4b9c29){logger[_0xba73('0x12')]('SmsMessage,\x20%s,\x20%s',_0x2c0f6c,_0xba73('0x13'));logger[_0xba73('0x14')](_0xba73('0x15'),_0x2c0f6c,_0xba73('0x13'),JSON['stringify'](_0x4b9c29));if(_0x4b9c29['error']){if(_0x4b9c29[_0xba73('0x16')][_0xba73('0x17')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x2c0f6c,_0x4b9c29[_0xba73('0x16')]['message']);return _0x1296b6(_0x4b9c29['error'][_0xba73('0x18')]);}logger[_0xba73('0x16')]('SmsMessage,\x20%s,\x20%s',_0x2c0f6c,_0x4b9c29[_0xba73('0x16')]['message']);return _0x258573(_0x4b9c29[_0xba73('0x16')][_0xba73('0x18')]);}else{logger[_0xba73('0x12')](_0xba73('0x19'),_0x2c0f6c,_0xba73('0x13'));_0x258573(_0x4b9c29[_0xba73('0x1a')][_0xba73('0x18')]);}})[_0xba73('0x1b')](function(_0xc9b47a){logger[_0xba73('0x16')](_0xba73('0x19'),_0x2c0f6c,_0xc9b47a);_0x1296b6(_0xc9b47a);});});}exports[_0xba73('0x1c')]=function(_0x2ec51e){var _0x48d34a=this;return new Promise(function(_0x36fd3a,_0x308805){return db['SmsMessage'][_0xba73('0x1d')](_0x2ec51e[_0xba73('0x1e')],{'raw':_0x2ec51e[_0xba73('0x1f')]?_0x2ec51e[_0xba73('0x1f')][_0xba73('0x20')]===undefined?!![]:![]:!![]})[_0xba73('0x11')](function(_0x141caa){logger[_0xba73('0x12')](_0xba73('0x1c'),_0x2ec51e);logger[_0xba73('0x14')](_0xba73('0x1c'),_0x2ec51e,JSON[_0xba73('0x21')](_0x141caa));_0x36fd3a(_0x141caa);})[_0xba73('0x1b')](function(_0x1fef6b){logger[_0xba73('0x16')](_0xba73('0x1c'),_0x1fef6b[_0xba73('0x18')],_0x2ec51e);_0x308805(_0x48d34a[_0xba73('0x16')](0x1f4,_0x1fef6b['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 5c62763..769ccf9 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 _0xd49d=['length','smsMessage:','./smsMessage.events','save','remove','emit','removeListener'];(function(_0x140308,_0x3443fc){var _0xc1f132=function(_0x26c0e6){while(--_0x26c0e6){_0x140308['push'](_0x140308['shift']());}};_0xc1f132(++_0x3443fc);}(_0xd49d,0x13d));var _0xdd49=function(_0x5ae6e8,_0x32052c){_0x5ae6e8=_0x5ae6e8-0x0;var _0x2f1fdd=_0xd49d[_0x5ae6e8];return _0x2f1fdd;};'use strict';var SmsMessageEvents=require(_0xdd49('0x0'));var events=[_0xdd49('0x1'),_0xdd49('0x2'),'update'];function createListener(_0x712d81,_0x5a2baf){return function(_0x2a5313){_0x5a2baf[_0xdd49('0x3')](_0x712d81,_0x2a5313);};}function removeListener(_0xfbf979,_0x52dc43){return function(){SmsMessageEvents[_0xdd49('0x4')](_0xfbf979,_0x52dc43);};}exports['register']=function(_0x379e46){for(var _0x3a26b3=0x0,_0x3dfe3f=events[_0xdd49('0x5')];_0x3a26b3<_0x3dfe3f;_0x3a26b3++){var _0x537903=events[_0x3a26b3];var _0x542c59=createListener(_0xdd49('0x6')+_0x537903,_0x379e46);SmsMessageEvents['on'](_0x537903,_0x542c59);}}; \ No newline at end of file +var _0xf711=['save','remove','update','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x2d5f54,_0x461d76){var _0x1389df=function(_0x237a01){while(--_0x237a01){_0x2d5f54['push'](_0x2d5f54['shift']());}};_0x1389df(++_0x461d76);}(_0xf711,0xaf));var _0x1f71=function(_0x37ed9f,_0x453ade){_0x37ed9f=_0x37ed9f-0x0;var _0x300ebb=_0xf711[_0x37ed9f];return _0x300ebb;};'use strict';var SmsMessageEvents=require(_0x1f71('0x0'));var events=[_0x1f71('0x1'),_0x1f71('0x2'),_0x1f71('0x3')];function createListener(_0x195d41,_0x502238){return function(_0x4f1291){_0x502238['emit'](_0x195d41,_0x4f1291);};}function removeListener(_0x1f5e9d,_0x210b71){return function(){SmsMessageEvents[_0x1f71('0x4')](_0x1f5e9d,_0x210b71);};}exports[_0x1f71('0x5')]=function(_0x2eacfe){for(var _0x54b4bc=0x0,_0x55abc0=events[_0x1f71('0x6')];_0x54b4bc<_0x55abc0;_0x54b4bc++){var _0x4fa23c=events[_0x54b4bc];var _0x4b5a1e=createListener(_0x1f71('0x7')+_0x4fa23c,_0x2eacfe);SmsMessageEvents['on'](_0x4fa23c,_0x4b5a1e);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 4d8d2cd..63693c3 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 _0x012a=['/describe','isAuthenticated','describe','show','getMembers','getTeams','getAgents','post','create','/:id/teams','addTeams','/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index'];(function(_0x5c950c,_0x3e2032){var _0x16e034=function(_0x19d311){while(--_0x19d311){_0x5c950c['push'](_0x5c950c['shift']());}};_0x16e034(++_0x3e2032);}(_0x012a,0x115));var _0xa012=function(_0x5e244c,_0x2f9ee4){_0x5e244c=_0x5e244c-0x0;var _0x236356=_0x012a[_0x5e244c];return _0x236356;};'use strict';var multer=require(_0xa012('0x0'));var util=require(_0xa012('0x1'));var path=require(_0xa012('0x2'));var timeout=require(_0xa012('0x3'));var express=require('express');var router=express[_0xa012('0x4')]();var fs_extra=require(_0xa012('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa012('0x6'));var config=require(_0xa012('0x7'));var controller=require(_0xa012('0x8'));router[_0xa012('0x9')]('/',auth['isAuthenticated'](),controller[_0xa012('0xa')]);router[_0xa012('0x9')](_0xa012('0xb'),auth[_0xa012('0xc')](),controller[_0xa012('0xd')]);router[_0xa012('0x9')]('/:id',auth[_0xa012('0xc')](),controller[_0xa012('0xe')]);router['get']('/:id/members',auth[_0xa012('0xc')](),controller[_0xa012('0xf')]);router[_0xa012('0x9')]('/:id/teams',auth[_0xa012('0xc')](),controller[_0xa012('0x10')]);router[_0xa012('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xa012('0x11')]);router[_0xa012('0x12')]('/',auth[_0xa012('0xc')](),controller[_0xa012('0x13')]);router['post'](_0xa012('0x14'),auth['isAuthenticated'](),controller[_0xa012('0x15')]);router[_0xa012('0x12')](_0xa012('0x16'),auth['isAuthenticated'](),controller[_0xa012('0x17')]);router[_0xa012('0x18')](_0xa012('0x19'),auth[_0xa012('0xc')](),controller[_0xa012('0x1a')]);router[_0xa012('0x1b')](_0xa012('0x19'),auth[_0xa012('0xc')](),controller[_0xa012('0x1c')]);router['delete'](_0xa012('0x14'),auth[_0xa012('0xc')](),controller[_0xa012('0x1d')]);router['delete'](_0xa012('0x16'),auth[_0xa012('0xc')](),controller[_0xa012('0x1e')]);module[_0xa012('0x1f')]=router; \ No newline at end of file +var _0xc6c7=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','destroy','delete','/:id/teams','removeTeams','removeAgents','exports','util','path','express','Router','fs-extra','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc6c7,0xae));var _0x7c6c=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0xc6c7[_0x378b4];return _0x11d07b;};'use strict';var multer=require('multer');var util=require(_0x7c6c('0x0'));var path=require(_0x7c6c('0x1'));var timeout=require('connect-timeout');var express=require(_0x7c6c('0x2'));var router=express[_0x7c6c('0x3')]();var fs_extra=require(_0x7c6c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7c6c('0x5'));var controller=require('./smsQueue.controller');router[_0x7c6c('0x6')]('/',auth[_0x7c6c('0x7')](),controller[_0x7c6c('0x8')]);router[_0x7c6c('0x6')](_0x7c6c('0x9'),auth[_0x7c6c('0x7')](),controller[_0x7c6c('0xa')]);router[_0x7c6c('0x6')](_0x7c6c('0xb'),auth[_0x7c6c('0x7')](),controller[_0x7c6c('0xc')]);router[_0x7c6c('0x6')](_0x7c6c('0xd'),auth[_0x7c6c('0x7')](),controller[_0x7c6c('0xe')]);router[_0x7c6c('0x6')]('/:id/teams',auth[_0x7c6c('0x7')](),controller[_0x7c6c('0xf')]);router['get']('/:id/users',auth[_0x7c6c('0x7')](),controller[_0x7c6c('0x10')]);router[_0x7c6c('0x11')]('/',auth[_0x7c6c('0x7')](),controller[_0x7c6c('0x12')]);router['post']('/:id/teams',auth[_0x7c6c('0x7')](),controller[_0x7c6c('0x13')]);router[_0x7c6c('0x11')](_0x7c6c('0x14'),auth[_0x7c6c('0x7')](),controller[_0x7c6c('0x15')]);router[_0x7c6c('0x16')]('/:id',auth[_0x7c6c('0x7')](),controller[_0x7c6c('0x17')]);router['delete'](_0x7c6c('0xb'),auth['isAuthenticated'](),controller[_0x7c6c('0x18')]);router[_0x7c6c('0x19')](_0x7c6c('0x1a'),auth[_0x7c6c('0x7')](),controller[_0x7c6c('0x1b')]);router['delete'](_0x7c6c('0x14'),auth[_0x7c6c('0x7')](),controller[_0x7c6c('0x1c')]);module[_0x7c6c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index e5fa5c1..c90ebed 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 _0xe86d=['sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x3f2fea,_0x3c4ea8){var _0x69a4d5=function(_0x223109){while(--_0x223109){_0x3f2fea['push'](_0x3f2fea['shift']());}};_0x69a4d5(++_0x3c4ea8);}(_0xe86d,0x1d5));var _0xde86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe86d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xde86('0x0'));module[_0xde86('0x1')]={'name':{'type':Sequelize[_0xde86('0x2')],'unique':_0xde86('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xde86('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xde86('0x4')](_0xde86('0x5'),_0xde86('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x5836=['name','STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5836,0x6e));var _0x6583=function(_0x3c3982,_0x163010){_0x3c3982=_0x3c3982-0x0;var _0x66448f=_0x5836[_0x3c3982];return _0x66448f;};'use strict';var Sequelize=require(_0x6583('0x0'));module[_0x6583('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6583('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6583('0x3')]},'timeout':{'type':Sequelize[_0x6583('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x6583('0x5'),_0x6583('0x6'),_0x6583('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 6667fa0..43a59cb 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 _0x1b07=['to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','SmsQueues','UserProfileResource','destroy','error','name','send','index','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','options','includeAll','findAll','catch','show','params','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','body','find','describe','nolimit','SmsQueueId','UserSmsQueue','findAndCountAll','UserId','smsPause','updatedAt','createdAt','map','rows','format','SIP','getTeams','Team','addTeams','User','Agents','voicePause','interface','flatMap','sequelize','transaction','each','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','ids','omit','spread','isArray','userSmsQueue:remove','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox'];(function(_0x1caee0,_0x3debcd){var _0x28d148=function(_0x285da7){while(--_0x285da7){_0x1caee0['push'](_0x1caee0['shift']());}};_0x28d148(++_0x3debcd);}(_0x1b07,0x198));var _0x71b0=function(_0x1d7300,_0x17f109){_0x1d7300=_0x1d7300-0x0;var _0x46ee98=_0x1b07[_0x1d7300];return _0x46ee98;};'use strict';var emlformat=require(_0x71b0('0x0'));var rimraf=require(_0x71b0('0x1'));var zipdir=require(_0x71b0('0x2'));var jsonpatch=require(_0x71b0('0x3'));var rp=require('request-promise');var moment=require(_0x71b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x71b0('0x5'));var util=require(_0x71b0('0x6'));var path=require(_0x71b0('0x7'));var sox=require(_0x71b0('0x8'));var csv=require(_0x71b0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71b0('0xa'));var _=require('lodash');var squel=require(_0x71b0('0xb'));var crypto=require(_0x71b0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x71b0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x71b0('0xe'));var Papa=require(_0x71b0('0xf'));var Redis=require(_0x71b0('0x10'));var authService=require(_0x71b0('0x11'));var qs=require(_0x71b0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x71b0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x71b0('0x14'));var config=require(_0x71b0('0x15'));var licenseUtil=require(_0x71b0('0x16'));var db=require(_0x71b0('0x17'))['db'];config[_0x71b0('0x18')]=_[_0x71b0('0x19')](config[_0x71b0('0x18')],{'host':_0x71b0('0x1a'),'port':0x18eb});var socket=require(_0x71b0('0x1b'))(new Redis(config[_0x71b0('0x18')]));require('./smsQueue.socket')[_0x71b0('0x1c')](socket);function respondWithStatusCode(_0x38c588,_0x52215c){_0x52215c=_0x52215c||0xcc;return function(_0x22a878){if(_0x22a878){return _0x38c588['sendStatus'](_0x52215c);}return _0x38c588[_0x71b0('0x1d')](_0x52215c)[_0x71b0('0x1e')]();};}function respondWithResult(_0x4832ee,_0x467bdc){_0x467bdc=_0x467bdc||0xc8;return function(_0x55d343){if(_0x55d343){return _0x4832ee[_0x71b0('0x1d')](_0x467bdc)[_0x71b0('0x1f')](_0x55d343);}};}function respondWithFilteredResult(_0x24cf0b,_0x2cbf01){return function(_0x1a2934){if(_0x1a2934){var _0x3fbdce=typeof _0x2cbf01[_0x71b0('0x20')]===_0x71b0('0x21')&&typeof _0x2cbf01[_0x71b0('0x22')]===_0x71b0('0x21');var _0x5c7359=_0x1a2934[_0x71b0('0x23')];var _0x270963=_0x3fbdce?0x0:_0x2cbf01[_0x71b0('0x20')];var _0x3b2866=_0x3fbdce?_0x1a2934['count']:_0x2cbf01['offset']+_0x2cbf01[_0x71b0('0x22')];var _0x162846;if(_0x3b2866>=_0x5c7359){_0x3b2866=_0x5c7359;_0x162846=0xc8;}else{_0x162846=0xce;}_0x24cf0b[_0x71b0('0x1d')](_0x162846);return _0x24cf0b[_0x71b0('0x24')](_0x71b0('0x25'),_0x270963+'-'+_0x3b2866+'/'+_0x5c7359)[_0x71b0('0x1f')](_0x1a2934);}return null;};}function patchUpdates(_0xf6b808){return function(_0x30d450){try{jsonpatch[_0x71b0('0x26')](_0x30d450,_0xf6b808,!![]);}catch(_0x4faad1){return BPromise[_0x71b0('0x27')](_0x4faad1);}return _0x30d450[_0x71b0('0x28')]();};}function saveUpdates(_0x94e361,_0x1b4e7d){return function(_0x4590db){if(_0x4590db){return _0x4590db[_0x71b0('0x29')](_0x94e361)[_0x71b0('0x2a')](function(_0x1b4921){return _0x1b4921;});}return null;};}function removeEntity(_0x2191f4,_0x1ec02b){return function(_0x55cb16){if(_0x55cb16){return _0x55cb16['destroy']()[_0x71b0('0x2a')](function(){var _0x3f54ab=_0x55cb16[_0x71b0('0x2b')]({'plain':!![]});var _0x1874a0=_0x71b0('0x2c');return db[_0x71b0('0x2d')][_0x71b0('0x2e')]({'where':{'type':_0x1874a0,'resourceId':_0x3f54ab['id']}})['then'](function(){return _0x55cb16;});})[_0x71b0('0x2a')](function(){_0x2191f4['status'](0xcc)[_0x71b0('0x1e')]();});}};}function handleEntityNotFound(_0x309052,_0x3062b3){return function(_0x53ca45){if(!_0x53ca45){_0x309052['sendStatus'](0x194);}return _0x53ca45;};}function handleError(_0x78b0b5,_0x100aa3){_0x100aa3=_0x100aa3||0x1f4;return function(_0x13fabd){logger[_0x71b0('0x2f')](_0x13fabd['stack']);if(_0x13fabd[_0x71b0('0x30')]){delete _0x13fabd[_0x71b0('0x30')];}_0x78b0b5[_0x71b0('0x1d')](_0x100aa3)[_0x71b0('0x31')](_0x13fabd);};}exports[_0x71b0('0x32')]=function(_0x2cce89,_0x26cdb4){var _0x2f89cc={},_0x248004={},_0x267883={'count':0x0,'rows':[]};var _0x4f8b11=_['map'](db[_0x71b0('0x33')][_0x71b0('0x34')],function(_0x14caaa){return{'name':_0x14caaa[_0x71b0('0x35')],'type':_0x14caaa[_0x71b0('0x36')][_0x71b0('0x37')]};});_0x248004[_0x71b0('0x38')]=_['map'](_0x4f8b11,_0x71b0('0x30'));_0x248004[_0x71b0('0x39')]=_[_0x71b0('0x3a')](_0x2cce89[_0x71b0('0x39')]);_0x248004[_0x71b0('0x3b')]=_[_0x71b0('0x3c')](_0x248004[_0x71b0('0x38')],_0x248004['query']);_0x2f89cc['attributes']=_[_0x71b0('0x3c')](_0x248004[_0x71b0('0x38')],qs['fields'](_0x2cce89[_0x71b0('0x39')][_0x71b0('0x3d')]));_0x2f89cc[_0x71b0('0x3e')]=_0x2f89cc['attributes'][_0x71b0('0x3f')]?_0x2f89cc['attributes']:_0x248004[_0x71b0('0x38')];if(!_0x2cce89['query'][_0x71b0('0x40')]('nolimit')){_0x2f89cc[_0x71b0('0x22')]=qs['limit'](_0x2cce89[_0x71b0('0x39')][_0x71b0('0x22')]);_0x2f89cc[_0x71b0('0x20')]=qs['offset'](_0x2cce89[_0x71b0('0x39')]['offset']);}_0x2f89cc[_0x71b0('0x41')]=qs[_0x71b0('0x42')](_0x2cce89[_0x71b0('0x39')]['sort']);_0x2f89cc['where']=qs[_0x71b0('0x3b')](_[_0x71b0('0x43')](_0x2cce89[_0x71b0('0x39')],_0x248004[_0x71b0('0x3b')]),_0x4f8b11);if(_0x2cce89[_0x71b0('0x39')][_0x71b0('0x44')]){_0x2f89cc['where']=_[_0x71b0('0x45')](_0x2f89cc[_0x71b0('0x46')],{'$or':_['map'](_0x4f8b11,function(_0x3d054b){if(_0x3d054b[_0x71b0('0x36')]!=='VIRTUAL'){var _0xbc8454={};_0xbc8454[_0x3d054b[_0x71b0('0x30')]]={'$like':'%'+_0x2cce89[_0x71b0('0x39')]['filter']+'%'};return _0xbc8454;}})});}_0x2f89cc=_['merge']({},_0x2f89cc,_0x2cce89[_0x71b0('0x47')]);var _0x33e7e9={'where':_0x2f89cc['where']};return db[_0x71b0('0x33')]['count'](_0x33e7e9)['then'](function(_0x4dcfd1){_0x267883[_0x71b0('0x23')]=_0x4dcfd1;if(_0x2cce89[_0x71b0('0x39')][_0x71b0('0x48')]){_0x2f89cc['include']=[{'all':!![]}];}return db['SmsQueue'][_0x71b0('0x49')](_0x2f89cc);})[_0x71b0('0x2a')](function(_0x4ae2e0){_0x267883['rows']=_0x4ae2e0;return _0x267883;})['then'](respondWithFilteredResult(_0x26cdb4,_0x2f89cc))[_0x71b0('0x4a')](handleError(_0x26cdb4,null));};exports[_0x71b0('0x4b')]=function(_0x28ed42,_0xaf12a){var _0x368044={'raw':!![],'where':{'id':_0x28ed42[_0x71b0('0x4c')]['id']}},_0x199bc2={};_0x199bc2[_0x71b0('0x38')]=_['keys'](db[_0x71b0('0x33')]['rawAttributes']);_0x199bc2[_0x71b0('0x39')]=_[_0x71b0('0x3a')](_0x28ed42['query']);_0x199bc2['filters']=_[_0x71b0('0x3c')](_0x199bc2[_0x71b0('0x38')],_0x199bc2[_0x71b0('0x39')]);_0x368044[_0x71b0('0x3e')]=_[_0x71b0('0x3c')](_0x199bc2[_0x71b0('0x38')],qs[_0x71b0('0x3d')](_0x28ed42[_0x71b0('0x39')][_0x71b0('0x3d')]));_0x368044[_0x71b0('0x3e')]=_0x368044[_0x71b0('0x3e')][_0x71b0('0x3f')]?_0x368044[_0x71b0('0x3e')]:_0x199bc2[_0x71b0('0x38')];if(_0x28ed42[_0x71b0('0x39')][_0x71b0('0x48')]){_0x368044[_0x71b0('0x4d')]=[{'all':!![]}];}_0x368044=_[_0x71b0('0x45')]({},_0x368044,_0x28ed42[_0x71b0('0x47')]);return db[_0x71b0('0x33')]['find'](_0x368044)['then'](handleEntityNotFound(_0xaf12a,null))[_0x71b0('0x2a')](respondWithResult(_0xaf12a,null))[_0x71b0('0x4a')](handleError(_0xaf12a,null));};exports[_0x71b0('0x4e')]=function(_0x443744,_0x5bfa41){return db[_0x71b0('0x33')][_0x71b0('0x4e')](_0x443744['body'],{})[_0x71b0('0x2a')](function(_0x2a62f5){var _0x47f78a=_0x443744[_0x71b0('0x4f')][_0x71b0('0x2b')]({'plain':!![]});if(!_0x47f78a)throw new Error(_0x71b0('0x50'));if(_0x47f78a['role']===_0x71b0('0x4f')){var _0x168577=_0x2a62f5[_0x71b0('0x2b')]({'plain':!![]});var _0x37fc43=_0x71b0('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x37fc43,'userProfileId':_0x47f78a[_0x71b0('0x51')]},'raw':!![]})['then'](function(_0x24f50c){if(_0x24f50c&&_0x24f50c[_0x71b0('0x52')]===0x0){return db[_0x71b0('0x2d')][_0x71b0('0x4e')]({'name':_0x168577[_0x71b0('0x30')],'resourceId':_0x168577['id'],'type':_0x24f50c[_0x71b0('0x30')],'sectionId':_0x24f50c['id']},{})[_0x71b0('0x2a')](function(){return _0x2a62f5;});}else{return _0x2a62f5;}})[_0x71b0('0x4a')](function(_0x42287d){logger[_0x71b0('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42287d);throw _0x42287d;});}return _0x2a62f5;})[_0x71b0('0x2a')](respondWithResult(_0x5bfa41,0xc9))[_0x71b0('0x4a')](handleError(_0x5bfa41,null));};exports['update']=function(_0x5df56d,_0x3fc865){if(_0x5df56d[_0x71b0('0x53')]['id']){delete _0x5df56d[_0x71b0('0x53')]['id'];}return db[_0x71b0('0x33')][_0x71b0('0x54')]({'where':{'id':_0x5df56d[_0x71b0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3fc865,null))[_0x71b0('0x2a')](saveUpdates(_0x5df56d['body'],null))['then'](respondWithResult(_0x3fc865,null))[_0x71b0('0x4a')](handleError(_0x3fc865,null));};exports[_0x71b0('0x2e')]=function(_0x495aee,_0x2d0b9d){return db[_0x71b0('0x33')][_0x71b0('0x54')]({'where':{'id':_0x495aee[_0x71b0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2d0b9d,null))[_0x71b0('0x2a')](removeEntity(_0x2d0b9d,null))[_0x71b0('0x4a')](handleError(_0x2d0b9d,null));};exports[_0x71b0('0x55')]=function(_0x560814,_0x2feb5c){return db[_0x71b0('0x33')][_0x71b0('0x55')]()[_0x71b0('0x2a')](respondWithResult(_0x2feb5c,null))[_0x71b0('0x4a')](handleError(_0x2feb5c,null));};exports['getMembers']=function(_0x5f3351,_0xd376cb,_0x48696a){var _0x52f00c={'raw':!![],'where':{}},_0x1b817f={},_0x468da2;return db['SmsQueue']['findOne']({'where':{'id':_0x5f3351['params']['id']}})[_0x71b0('0x2a')](handleEntityNotFound(_0xd376cb,null))[_0x71b0('0x2a')](function(_0x76c96a){if(_0x76c96a){_0x468da2=_0x76c96a['get']({'plain':!![]});_0x1b817f['model']=_[_0x71b0('0x3a')](db['UserSmsQueue'][_0x71b0('0x34')]);_0x1b817f[_0x71b0('0x39')]=_[_0x71b0('0x3a')](_0x5f3351[_0x71b0('0x39')]);_0x1b817f[_0x71b0('0x3b')]=_[_0x71b0('0x3c')](_0x1b817f[_0x71b0('0x38')],_0x1b817f[_0x71b0('0x39')]);_0x52f00c[_0x71b0('0x3e')]=_[_0x71b0('0x3c')](_0x1b817f[_0x71b0('0x38')],qs[_0x71b0('0x3d')](_0x5f3351['query']['fields']));_0x52f00c[_0x71b0('0x3e')]=_0x52f00c[_0x71b0('0x3e')][_0x71b0('0x3f')]?_0x52f00c[_0x71b0('0x3e')]:_0x1b817f['model'];if(!_0x5f3351[_0x71b0('0x39')][_0x71b0('0x40')](_0x71b0('0x56'))){_0x52f00c[_0x71b0('0x22')]=qs[_0x71b0('0x22')](_0x5f3351[_0x71b0('0x39')][_0x71b0('0x22')]);_0x52f00c['offset']=qs[_0x71b0('0x20')](_0x5f3351[_0x71b0('0x39')]['offset']);}_0x52f00c['order']=qs[_0x71b0('0x42')](_0x5f3351['query'][_0x71b0('0x42')]);_0x52f00c[_0x71b0('0x46')]=qs[_0x71b0('0x3b')](_[_0x71b0('0x43')](_0x5f3351['query'],_0x1b817f[_0x71b0('0x3b')]));_0x52f00c[_0x71b0('0x46')][_0x71b0('0x57')]=_0x76c96a['id'];if(_0x5f3351[_0x71b0('0x39')][_0x71b0('0x44')]){_0x52f00c[_0x71b0('0x46')]=_[_0x71b0('0x45')](_0x52f00c[_0x71b0('0x46')],{'$or':_['map'](_0x52f00c[_0x71b0('0x3e')],function(_0x368cce){var _0xc1a7dd={};_0xc1a7dd[_0x368cce]={'$like':'%'+_0x5f3351['query'][_0x71b0('0x44')]+'%'};return _0xc1a7dd;})});}_0x52f00c=_[_0x71b0('0x45')]({},_0x52f00c,_0x5f3351['options']);return db[_0x71b0('0x58')]['findAll'](_0x52f00c);}})[_0x71b0('0x2a')](function(_0x5433f9){if(_0x5433f9){return db['User'][_0x71b0('0x59')]({'where':{'id':_['map'](_0x5433f9,_0x71b0('0x5a')),'role':'agent'},'attributes':['id',_0x71b0('0x30'),_0x71b0('0x5b'),_0x71b0('0x5c'),_0x71b0('0x5d')]});}})['then'](function(_0x17a6cf){if(_0x17a6cf){return{'count':_0x17a6cf[_0x71b0('0x23')],'rows':_[_0x71b0('0x5e')](_0x17a6cf[_0x71b0('0x5f')],function(_0xb24caf){return{'membername':_0xb24caf[_0x71b0('0x30')],'UserId':_0xb24caf['id'],'queue_name':_0x468da2['name'],'SmsQueueId':_0x468da2['id'],'interface':util[_0x71b0('0x60')]('%s/%s',_0x71b0('0x61'),_0xb24caf[_0x71b0('0x30')]),'penalty':0x0,'paused':_0xb24caf[_0x71b0('0x5b')],'createdAt':_0xb24caf['createdAt'],'updatedAt':_0xb24caf[_0x71b0('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x71b0('0x2a')](respondWithFilteredResult(_0xd376cb,_0x52f00c))[_0x71b0('0x4a')](handleError(_0xd376cb,null));};exports[_0x71b0('0x62')]=function(_0x50cc8e,_0x47186a,_0x97f461){var _0x57f10b={};var _0x295b5f={};var _0x4a01c0;var _0x7847;return db[_0x71b0('0x33')]['findOne']({'where':{'id':_0x50cc8e[_0x71b0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x47186a,null))[_0x71b0('0x2a')](function(_0x556692){if(_0x556692){_0x4a01c0=_0x556692;_0x295b5f['model']=_[_0x71b0('0x3a')](db[_0x71b0('0x63')][_0x71b0('0x34')]);_0x295b5f[_0x71b0('0x39')]=_[_0x71b0('0x3a')](_0x50cc8e[_0x71b0('0x39')]);_0x295b5f[_0x71b0('0x3b')]=_['intersection'](_0x295b5f[_0x71b0('0x38')],_0x295b5f['query']);_0x57f10b[_0x71b0('0x3e')]=_[_0x71b0('0x3c')](_0x295b5f['model'],qs[_0x71b0('0x3d')](_0x50cc8e[_0x71b0('0x39')][_0x71b0('0x3d')]));_0x57f10b['attributes']=_0x57f10b[_0x71b0('0x3e')][_0x71b0('0x3f')]?_0x57f10b['attributes']:_0x295b5f[_0x71b0('0x38')];_0x57f10b['order']=qs[_0x71b0('0x42')](_0x50cc8e[_0x71b0('0x39')][_0x71b0('0x42')]);_0x57f10b[_0x71b0('0x46')]=qs[_0x71b0('0x3b')](_[_0x71b0('0x43')](_0x50cc8e[_0x71b0('0x39')],_0x295b5f[_0x71b0('0x3b')]));if(_0x50cc8e[_0x71b0('0x39')]['filter']){_0x57f10b[_0x71b0('0x46')]=_[_0x71b0('0x45')](_0x57f10b[_0x71b0('0x46')],{'$or':_[_0x71b0('0x5e')](_0x57f10b[_0x71b0('0x3e')],function(_0x88ea4d){var _0x54280c={};_0x54280c[_0x88ea4d]={'$like':'%'+_0x50cc8e[_0x71b0('0x39')]['filter']+'%'};return _0x54280c;})});}_0x57f10b=_[_0x71b0('0x45')]({},_0x57f10b,_0x50cc8e[_0x71b0('0x47')]);return _0x4a01c0[_0x71b0('0x62')](_0x57f10b);}})[_0x71b0('0x2a')](function(_0x1742a2){if(_0x1742a2){_0x7847=_0x1742a2[_0x71b0('0x3f')];if(!_0x50cc8e[_0x71b0('0x39')][_0x71b0('0x40')](_0x71b0('0x56'))){_0x57f10b['limit']=qs[_0x71b0('0x22')](_0x50cc8e[_0x71b0('0x39')][_0x71b0('0x22')]);_0x57f10b[_0x71b0('0x20')]=qs[_0x71b0('0x20')](_0x50cc8e[_0x71b0('0x39')]['offset']);}return _0x4a01c0[_0x71b0('0x62')](_0x57f10b);}})[_0x71b0('0x2a')](function(_0x4bd050){if(_0x4bd050){return _0x4bd050?{'count':_0x7847,'rows':_0x4bd050}:null;}})[_0x71b0('0x2a')](respondWithResult(_0x47186a,null))[_0x71b0('0x4a')](handleError(_0x47186a,null));};exports[_0x71b0('0x64')]=function(_0x1a243e,_0x393bb3,_0x43ac9e){var _0x2b9a5b=_0x1a243e[_0x71b0('0x53')]['ids'];return db['Team']['findAll']({'where':{'id':_0x2b9a5b},'attributes':['id'],'include':[{'model':db[_0x71b0('0x65')],'as':_0x71b0('0x66'),'attributes':['id',_0x71b0('0x30'),'online',_0x71b0('0x67'),_0x71b0('0x68')],'raw':!![]}]})[_0x71b0('0x2a')](function(_0x14486e){if(_0x14486e){var _0x1aa286=_[_0x71b0('0x69')](_0x14486e,function(_0x4d7c0b){var _0xd23f3a=_0x4d7c0b[_0x71b0('0x2b')]({'plain':!![]});return _0xd23f3a['Agents'];});return db[_0x71b0('0x33')][_0x71b0('0x54')]({'where':{'id':_0x1a243e[_0x71b0('0x4c')]['id']}})[_0x71b0('0x2a')](function(_0x289541){return db[_0x71b0('0x6a')][_0x71b0('0x6b')](function(_0x37a4e7){return _0x289541['addTeams'](_0x2b9a5b,{'transaction':_0x37a4e7})[_0x71b0('0x2a')](function(){return BPromise[_0x71b0('0x6c')](_0x1aa286,function(_0x223365){return db[_0x71b0('0x58')]['findOrCreate']({'where':{'UserId':_0x223365['id'],'SmsQueueId':_0x1a243e['params']['id']},'transaction':_0x37a4e7});});})['then'](function(){_0x1aa286['forEach'](function(_0x4c566e){socket[_0x71b0('0x6d')](_0x71b0('0x6e'),{'UserId':_0x4c566e['id'],'SmsQueueId':_0x289541['id']});});});});});}})[_0x71b0('0x2a')](respondWithStatusCode(_0x393bb3,null))[_0x71b0('0x4a')](handleError(_0x393bb3,null));};exports[_0x71b0('0x6f')]=function(_0x4eec07,_0x3822c1,_0x580709){return db['Team'][_0x71b0('0x49')]({'where':{'id':_0x4eec07[_0x71b0('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x71b0('0x65')],'as':_0x71b0('0x66'),'attributes':['id'],'raw':!![]}]})[_0x71b0('0x2a')](handleEntityNotFound(_0x3822c1,null))['then'](function(_0x218a3e){var _0x5cc9df=_[_0x71b0('0x5e')](_0x218a3e,'id');var _0x5ded9a=[];var _0x2fcb57=[];var _0x438ec1=squel[_0x71b0('0x70')]();_0x438ec1[_0x71b0('0x71')](_0x71b0('0x72'))['from'](_0x71b0('0x73'),'tq')[_0x71b0('0x74')](_0x71b0('0x75'),'ut',_0x71b0('0x76'))['where']('SmsQueueId\x20=\x20?',_0x4eec07['params']['id']);for(var _0x53eb86=0x0;_0x53eb86<_0x218a3e[_0x71b0('0x3f')];_0x53eb86+=0x1){let _0x2b86e4=_0x218a3e[_0x53eb86];for(var _0x5b4183=0x0;_0x5b4183<_0x2b86e4[_0x71b0('0x66')][_0x71b0('0x3f')];_0x5b4183+=0x1){let _0x3a7233=_0x2b86e4[_0x71b0('0x66')][_0x5b4183];var _0x1845b2=_0x438ec1[_0x71b0('0x77')]();_0x1845b2[_0x71b0('0x46')](_0x71b0('0x78'),_0x3a7233['id']);_0x2fcb57['push'](db['sequelize'][_0x71b0('0x39')](_0x1845b2['toString'](),{'type':db[_0x71b0('0x6a')][_0x71b0('0x79')]['SELECT']})[_0x71b0('0x2a')](function(_0x4b6b91){if(_0x4b6b91[_0x71b0('0x3f')]===0x1){return _0x3a7233['id'];}else{var _0x2ace7e=_[_0x71b0('0x7a')](_[_0x71b0('0x5e')](_0x4b6b91,_0x71b0('0x7b')),function(_0x35850f){return _[_0x71b0('0x7c')](_0x5cc9df,_0x35850f);});if(_0x2ace7e){return _0x3a7233['id'];}}}));}}return BPromise[_0x71b0('0x7d')](_0x2fcb57)['then'](function(_0x30407a){_0x5ded9a=_(_0x5ded9a)[_0x71b0('0x7e')](_0x30407a)[_0x71b0('0x7f')]()[_0x71b0('0x80')]();return db[_0x71b0('0x33')]['find']({'where':{'id':_0x4eec07[_0x71b0('0x4c')]['id']}})['then'](function(_0x4d23c6){return db['sequelize']['transaction'](function(_0x2e6fb5){return _0x4d23c6[_0x71b0('0x6f')](_0x4eec07[_0x71b0('0x39')]['ids'],{'transaction':_0x2e6fb5})[_0x71b0('0x2a')](function(){if(!_[_0x71b0('0x81')](_0x5ded9a)){return _0x4d23c6[_0x71b0('0x82')](_0x5ded9a,{'transaction':_0x2e6fb5});}})[_0x71b0('0x2a')](function(){_0x5ded9a['forEach'](function(_0x302ae5){socket[_0x71b0('0x6d')]('userSmsQueue:remove',{'UserId':_0x302ae5,'SmsQueueId':_0x4d23c6['id']});});});});});});})[_0x71b0('0x2a')](respondWithStatusCode(_0x3822c1,null))['catch'](handleError(_0x3822c1,null));};exports[_0x71b0('0x83')]=function(_0x49c113,_0x55c155,_0x15775e){return db[_0x71b0('0x33')][_0x71b0('0x54')]({'where':{'id':_0x49c113[_0x71b0('0x4c')]['id']}})[_0x71b0('0x2a')](handleEntityNotFound(_0x55c155,null))[_0x71b0('0x2a')](function(_0x5a3a39){if(_0x5a3a39){return _0x5a3a39['addAgents'](_0x49c113[_0x71b0('0x53')][_0x71b0('0x84')],_[_0x71b0('0x85')](_0x49c113[_0x71b0('0x53')],[_0x71b0('0x84'),'id'])||{})[_0x71b0('0x86')](function(_0x138ee9){for(var _0x5b068a=0x0;_0x5b068a<_0x49c113['body'][_0x71b0('0x84')][_0x71b0('0x3f')];_0x5b068a+=0x1){socket[_0x71b0('0x6d')](_0x71b0('0x6e'),{'UserId':Number(_0x49c113['body'][_0x71b0('0x84')][_0x5b068a]),'SmsQueueId':Number(_0x49c113['params']['id'])});}return _0x138ee9;});}})[_0x71b0('0x2a')](respondWithResult(_0x55c155,null))[_0x71b0('0x4a')](handleError(_0x55c155,null));};exports['removeAgents']=function(_0x1b2f00,_0x4a2ac2,_0x5f27c8){return db[_0x71b0('0x33')][_0x71b0('0x54')]({'where':{'id':_0x1b2f00[_0x71b0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4a2ac2,null))[_0x71b0('0x2a')](function(_0x3e97d8){if(_0x3e97d8){return _0x3e97d8['removeAgents'](_0x1b2f00['query'][_0x71b0('0x84')])[_0x71b0('0x2a')](function(){if(_[_0x71b0('0x87')](_0x1b2f00[_0x71b0('0x39')]['ids'])){for(var _0x58bd88=0x0;_0x58bd88<_0x1b2f00[_0x71b0('0x39')]['ids'][_0x71b0('0x3f')];_0x58bd88+=0x1){socket[_0x71b0('0x6d')](_0x71b0('0x88'),{'UserId':Number(_0x1b2f00[_0x71b0('0x39')][_0x71b0('0x84')][_0x58bd88]),'SmsQueueId':Number(_0x1b2f00[_0x71b0('0x4c')]['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x1b2f00[_0x71b0('0x39')][_0x71b0('0x84')]),'SmsQueueId':Number(_0x1b2f00['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4a2ac2,null))[_0x71b0('0x4a')](handleError(_0x4a2ac2,null));};exports[_0x71b0('0x89')]=function(_0x21bf3c,_0x54d5e5,_0x40df2b){var _0x531319={};var _0x4e1e6f={};var _0x4229b0;var _0x3c6e24;return db[_0x71b0('0x33')][_0x71b0('0x8a')]({'where':{'id':_0x21bf3c[_0x71b0('0x4c')]['id']}})[_0x71b0('0x2a')](handleEntityNotFound(_0x54d5e5,null))[_0x71b0('0x2a')](function(_0x9c2f46){if(_0x9c2f46){_0x4229b0=_0x9c2f46;_0x4e1e6f[_0x71b0('0x38')]=_[_0x71b0('0x3a')](db['User'][_0x71b0('0x34')]);_0x4e1e6f[_0x71b0('0x39')]=_[_0x71b0('0x3a')](_0x21bf3c[_0x71b0('0x39')]);_0x4e1e6f[_0x71b0('0x3b')]=_['intersection'](_0x4e1e6f[_0x71b0('0x38')],_0x4e1e6f[_0x71b0('0x39')]);_0x531319['attributes']=_[_0x71b0('0x3c')](_0x4e1e6f['model'],qs[_0x71b0('0x3d')](_0x21bf3c['query'][_0x71b0('0x3d')]));_0x531319[_0x71b0('0x3e')]=_0x531319['attributes'][_0x71b0('0x3f')]?_0x531319[_0x71b0('0x3e')]:_0x4e1e6f[_0x71b0('0x38')];_0x531319[_0x71b0('0x41')]=qs[_0x71b0('0x42')](_0x21bf3c[_0x71b0('0x39')][_0x71b0('0x42')]);_0x531319['where']=qs[_0x71b0('0x3b')](_[_0x71b0('0x43')](_0x21bf3c[_0x71b0('0x39')],_0x4e1e6f[_0x71b0('0x3b')]));if(_0x21bf3c['query'][_0x71b0('0x44')]){_0x531319[_0x71b0('0x46')]=_[_0x71b0('0x45')](_0x531319[_0x71b0('0x46')],{'$or':_[_0x71b0('0x5e')](_0x531319[_0x71b0('0x3e')],function(_0x5ef150){var _0x4dca7b={};_0x4dca7b[_0x5ef150]={'$like':'%'+_0x21bf3c['query']['filter']+'%'};return _0x4dca7b;})});}_0x531319=_['merge']({},_0x531319,_0x21bf3c['options']);return _0x4229b0[_0x71b0('0x89')](_0x531319);}})[_0x71b0('0x2a')](function(_0x120e98){if(_0x120e98){_0x3c6e24=_0x120e98[_0x71b0('0x3f')];if(!_0x21bf3c[_0x71b0('0x39')]['hasOwnProperty'](_0x71b0('0x56'))){_0x531319[_0x71b0('0x22')]=qs[_0x71b0('0x22')](_0x21bf3c[_0x71b0('0x39')][_0x71b0('0x22')]);_0x531319[_0x71b0('0x20')]=qs[_0x71b0('0x20')](_0x21bf3c[_0x71b0('0x39')][_0x71b0('0x20')]);}return _0x4229b0[_0x71b0('0x89')](_0x531319);}})[_0x71b0('0x2a')](function(_0x2257e3){if(_0x2257e3){return _0x2257e3?{'count':_0x3c6e24,'rows':_0x2257e3}:null;}})[_0x71b0('0x2a')](respondWithResult(_0x54d5e5,null))[_0x71b0('0x4a')](handleError(_0x54d5e5,null));}; \ No newline at end of file +var _0x9b85=['merge','where','map','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','SmsQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','SmsQueueId','UserSmsQueue','User','findAndCountAll','UserId','smsPause','updatedAt','SIP','getTeams','addTeams','ids','online','interface','flatMap','Agents','sequelize','transaction','each','forEach','userSmsQueue:save','removeTeams','Team','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','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/license/util','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','status','offset','limit','undefined','json','apply','reject','save','then','destroy','get','UserProfileResource','end','sendStatus','error','name','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x6ca119,_0x343116){var _0x4c4690=function(_0xa4032d){while(--_0xa4032d){_0x6ca119['push'](_0x6ca119['shift']());}};_0x4c4690(++_0x343116);}(_0x9b85,0xd7));var _0x59b8=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x9b85[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x59b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x59b8('0x1'));var rp=require(_0x59b8('0x2'));var moment=require(_0x59b8('0x3'));var BPromise=require(_0x59b8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x59b8('0x5'));var csv=require(_0x59b8('0x6'));var ejs=require(_0x59b8('0x7'));var fs=require('fs');var fs_extra=require(_0x59b8('0x8'));var _=require(_0x59b8('0x9'));var squel=require(_0x59b8('0xa'));var crypto=require(_0x59b8('0xb'));var jsforce=require(_0x59b8('0xc'));var deskjs=require(_0x59b8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x59b8('0xe'));var authService=require(_0x59b8('0xf'));var qs=require(_0x59b8('0x10'));var as=require(_0x59b8('0x11'));var hardwareService=require(_0x59b8('0x12'));var logger=require(_0x59b8('0x13'))(_0x59b8('0x14'));var utils=require(_0x59b8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x59b8('0x16'));var db=require(_0x59b8('0x17'))['db'];config[_0x59b8('0x18')]=_[_0x59b8('0x19')](config[_0x59b8('0x18')],{'host':_0x59b8('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x59b8('0x1b'))['register'](socket);function respondWithStatusCode(_0x2b27d3,_0x349278){_0x349278=_0x349278||0xcc;return function(_0x561539){if(_0x561539){return _0x2b27d3['sendStatus'](_0x349278);}return _0x2b27d3[_0x59b8('0x1c')](_0x349278)['end']();};}function respondWithResult(_0x51b43a,_0x1cfc3c){_0x1cfc3c=_0x1cfc3c||0xc8;return function(_0x1b2eca){if(_0x1b2eca){return _0x51b43a[_0x59b8('0x1c')](_0x1cfc3c)['json'](_0x1b2eca);}};}function respondWithFilteredResult(_0x284866,_0x45e9d1){return function(_0x2b09a4){if(_0x2b09a4){var _0xa6b6d3=typeof _0x45e9d1[_0x59b8('0x1d')]==='undefined'&&typeof _0x45e9d1[_0x59b8('0x1e')]===_0x59b8('0x1f');var _0x5d86ee=_0x2b09a4['count'];var _0x1b8aa4=_0xa6b6d3?0x0:_0x45e9d1[_0x59b8('0x1d')];var _0x2637b0=_0xa6b6d3?_0x2b09a4['count']:_0x45e9d1[_0x59b8('0x1d')]+_0x45e9d1[_0x59b8('0x1e')];var _0x57350a;if(_0x2637b0>=_0x5d86ee){_0x2637b0=_0x5d86ee;_0x57350a=0xc8;}else{_0x57350a=0xce;}_0x284866['status'](_0x57350a);return _0x284866['set']('Content-Range',_0x1b8aa4+'-'+_0x2637b0+'/'+_0x5d86ee)[_0x59b8('0x20')](_0x2b09a4);}return null;};}function patchUpdates(_0x45370c){return function(_0x2734df){try{jsonpatch[_0x59b8('0x21')](_0x2734df,_0x45370c,!![]);}catch(_0x401be1){return BPromise[_0x59b8('0x22')](_0x401be1);}return _0x2734df[_0x59b8('0x23')]();};}function saveUpdates(_0x15af8a,_0x6ce5d4){return function(_0x15d032){if(_0x15d032){return _0x15d032['update'](_0x15af8a)[_0x59b8('0x24')](function(_0x5264d2){return _0x5264d2;});}return null;};}function removeEntity(_0x3b566f,_0x5e8bfb){return function(_0x52ddf8){if(_0x52ddf8){return _0x52ddf8[_0x59b8('0x25')]()['then'](function(){var _0x2148ce=_0x52ddf8[_0x59b8('0x26')]({'plain':!![]});var _0x2e42dd='SmsQueues';return db[_0x59b8('0x27')]['destroy']({'where':{'type':_0x2e42dd,'resourceId':_0x2148ce['id']}})[_0x59b8('0x24')](function(){return _0x52ddf8;});})['then'](function(){_0x3b566f[_0x59b8('0x1c')](0xcc)[_0x59b8('0x28')]();});}};}function handleEntityNotFound(_0x3ef890,_0x2a86d6){return function(_0x46e994){if(!_0x46e994){_0x3ef890[_0x59b8('0x29')](0x194);}return _0x46e994;};}function handleError(_0x11e5fe,_0x48f36c){_0x48f36c=_0x48f36c||0x1f4;return function(_0x41b34d){logger[_0x59b8('0x2a')](_0x41b34d['stack']);if(_0x41b34d[_0x59b8('0x2b')]){delete _0x41b34d[_0x59b8('0x2b')];}_0x11e5fe[_0x59b8('0x1c')](_0x48f36c)['send'](_0x41b34d);};}exports['index']=function(_0xc613c8,_0x1af07f){var _0x4d9397={},_0x49f8d8={},_0x31a7ce={'count':0x0,'rows':[]};var _0x12f5fd=_['map'](db[_0x59b8('0x2c')][_0x59b8('0x2d')],function(_0x20a026){return{'name':_0x20a026[_0x59b8('0x2e')],'type':_0x20a026[_0x59b8('0x2f')][_0x59b8('0x30')]};});_0x49f8d8[_0x59b8('0x31')]=_['map'](_0x12f5fd,_0x59b8('0x2b'));_0x49f8d8[_0x59b8('0x32')]=_[_0x59b8('0x33')](_0xc613c8[_0x59b8('0x32')]);_0x49f8d8[_0x59b8('0x34')]=_[_0x59b8('0x35')](_0x49f8d8[_0x59b8('0x31')],_0x49f8d8[_0x59b8('0x32')]);_0x4d9397['attributes']=_[_0x59b8('0x35')](_0x49f8d8['model'],qs[_0x59b8('0x36')](_0xc613c8[_0x59b8('0x32')][_0x59b8('0x36')]));_0x4d9397[_0x59b8('0x37')]=_0x4d9397[_0x59b8('0x37')][_0x59b8('0x38')]?_0x4d9397['attributes']:_0x49f8d8[_0x59b8('0x31')];if(!_0xc613c8[_0x59b8('0x32')][_0x59b8('0x39')](_0x59b8('0x3a'))){_0x4d9397[_0x59b8('0x1e')]=qs[_0x59b8('0x1e')](_0xc613c8['query'][_0x59b8('0x1e')]);_0x4d9397[_0x59b8('0x1d')]=qs['offset'](_0xc613c8[_0x59b8('0x32')][_0x59b8('0x1d')]);}_0x4d9397[_0x59b8('0x3b')]=qs[_0x59b8('0x3c')](_0xc613c8[_0x59b8('0x32')][_0x59b8('0x3c')]);_0x4d9397['where']=qs[_0x59b8('0x34')](_[_0x59b8('0x3d')](_0xc613c8[_0x59b8('0x32')],_0x49f8d8[_0x59b8('0x34')]),_0x12f5fd);if(_0xc613c8[_0x59b8('0x32')][_0x59b8('0x3e')]){_0x4d9397['where']=_[_0x59b8('0x3f')](_0x4d9397[_0x59b8('0x40')],{'$or':_[_0x59b8('0x41')](_0x12f5fd,function(_0x11373b){if(_0x11373b['type']!==_0x59b8('0x42')){var _0x17cc15={};_0x17cc15[_0x11373b['name']]={'$like':'%'+_0xc613c8[_0x59b8('0x32')][_0x59b8('0x3e')]+'%'};return _0x17cc15;}})});}_0x4d9397=_[_0x59b8('0x3f')]({},_0x4d9397,_0xc613c8[_0x59b8('0x43')]);var _0x320fd6={'where':_0x4d9397[_0x59b8('0x40')]};return db[_0x59b8('0x2c')][_0x59b8('0x44')](_0x320fd6)[_0x59b8('0x24')](function(_0x4c5595){_0x31a7ce[_0x59b8('0x44')]=_0x4c5595;if(_0xc613c8[_0x59b8('0x32')][_0x59b8('0x45')]){_0x4d9397['include']=[{'all':!![]}];}return db[_0x59b8('0x2c')][_0x59b8('0x46')](_0x4d9397);})['then'](function(_0x12cb2f){_0x31a7ce[_0x59b8('0x47')]=_0x12cb2f;return _0x31a7ce;})['then'](respondWithFilteredResult(_0x1af07f,_0x4d9397))[_0x59b8('0x48')](handleError(_0x1af07f,null));};exports[_0x59b8('0x49')]=function(_0x11b6b4,_0x42dc46){var _0x47d3c7={'raw':!![],'where':{'id':_0x11b6b4[_0x59b8('0x4a')]['id']}},_0x464add={};_0x464add[_0x59b8('0x31')]=_[_0x59b8('0x33')](db[_0x59b8('0x2c')]['rawAttributes']);_0x464add[_0x59b8('0x32')]=_[_0x59b8('0x33')](_0x11b6b4[_0x59b8('0x32')]);_0x464add[_0x59b8('0x34')]=_[_0x59b8('0x35')](_0x464add[_0x59b8('0x31')],_0x464add[_0x59b8('0x32')]);_0x47d3c7[_0x59b8('0x37')]=_[_0x59b8('0x35')](_0x464add['model'],qs[_0x59b8('0x36')](_0x11b6b4['query'][_0x59b8('0x36')]));_0x47d3c7[_0x59b8('0x37')]=_0x47d3c7[_0x59b8('0x37')][_0x59b8('0x38')]?_0x47d3c7[_0x59b8('0x37')]:_0x464add[_0x59b8('0x31')];if(_0x11b6b4[_0x59b8('0x32')]['includeAll']){_0x47d3c7[_0x59b8('0x4b')]=[{'all':!![]}];}_0x47d3c7=_[_0x59b8('0x3f')]({},_0x47d3c7,_0x11b6b4[_0x59b8('0x43')]);return db['SmsQueue'][_0x59b8('0x4c')](_0x47d3c7)[_0x59b8('0x24')](handleEntityNotFound(_0x42dc46,null))[_0x59b8('0x24')](respondWithResult(_0x42dc46,null))['catch'](handleError(_0x42dc46,null));};exports[_0x59b8('0x4d')]=function(_0x866a31,_0x32916f){return db[_0x59b8('0x2c')][_0x59b8('0x4d')](_0x866a31['body'],{})[_0x59b8('0x24')](function(_0x32f57e){var _0x1dc886=_0x866a31['user']['get']({'plain':!![]});if(!_0x1dc886)throw new Error(_0x59b8('0x4e'));if(_0x1dc886['role']===_0x59b8('0x4f')){var _0x34696a=_0x32f57e['get']({'plain':!![]});var _0x17790a=_0x59b8('0x50');return db[_0x59b8('0x51')][_0x59b8('0x4c')]({'where':{'name':_0x17790a,'userProfileId':_0x1dc886['userProfileId']},'raw':!![]})[_0x59b8('0x24')](function(_0x3cf1af){if(_0x3cf1af&&_0x3cf1af[_0x59b8('0x52')]===0x0){return db[_0x59b8('0x27')][_0x59b8('0x4d')]({'name':_0x34696a['name'],'resourceId':_0x34696a['id'],'type':_0x3cf1af[_0x59b8('0x2b')],'sectionId':_0x3cf1af['id']},{})['then'](function(){return _0x32f57e;});}else{return _0x32f57e;}})[_0x59b8('0x48')](function(_0x2a28af){logger[_0x59b8('0x2a')](_0x59b8('0x53'),_0x2a28af);throw _0x2a28af;});}return _0x32f57e;})[_0x59b8('0x24')](respondWithResult(_0x32916f,0xc9))[_0x59b8('0x48')](handleError(_0x32916f,null));};exports[_0x59b8('0x54')]=function(_0x511d52,_0x5bc4d0){if(_0x511d52[_0x59b8('0x55')]['id']){delete _0x511d52[_0x59b8('0x55')]['id'];}return db[_0x59b8('0x2c')][_0x59b8('0x4c')]({'where':{'id':_0x511d52[_0x59b8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bc4d0,null))[_0x59b8('0x24')](saveUpdates(_0x511d52[_0x59b8('0x55')],null))[_0x59b8('0x24')](respondWithResult(_0x5bc4d0,null))[_0x59b8('0x48')](handleError(_0x5bc4d0,null));};exports[_0x59b8('0x25')]=function(_0x25e28e,_0x29e132){return db['SmsQueue'][_0x59b8('0x4c')]({'where':{'id':_0x25e28e[_0x59b8('0x4a')]['id']}})[_0x59b8('0x24')](handleEntityNotFound(_0x29e132,null))[_0x59b8('0x24')](removeEntity(_0x29e132,null))[_0x59b8('0x48')](handleError(_0x29e132,null));};exports[_0x59b8('0x56')]=function(_0x1e6007,_0x51bb4e){return db[_0x59b8('0x2c')][_0x59b8('0x56')]()['then'](respondWithResult(_0x51bb4e,null))[_0x59b8('0x48')](handleError(_0x51bb4e,null));};exports[_0x59b8('0x57')]=function(_0x31816f,_0x188b8b,_0x4742c0){var _0x122cbe={'raw':!![],'where':{}},_0x4a527b={},_0x45fa45;return db['SmsQueue'][_0x59b8('0x58')]({'where':{'id':_0x31816f[_0x59b8('0x4a')]['id']}})[_0x59b8('0x24')](handleEntityNotFound(_0x188b8b,null))[_0x59b8('0x24')](function(_0x43d53e){if(_0x43d53e){_0x45fa45=_0x43d53e[_0x59b8('0x26')]({'plain':!![]});_0x4a527b[_0x59b8('0x31')]=_[_0x59b8('0x33')](db['UserSmsQueue'][_0x59b8('0x2d')]);_0x4a527b[_0x59b8('0x32')]=_['keys'](_0x31816f[_0x59b8('0x32')]);_0x4a527b[_0x59b8('0x34')]=_['intersection'](_0x4a527b[_0x59b8('0x31')],_0x4a527b[_0x59b8('0x32')]);_0x122cbe[_0x59b8('0x37')]=_[_0x59b8('0x35')](_0x4a527b[_0x59b8('0x31')],qs[_0x59b8('0x36')](_0x31816f[_0x59b8('0x32')][_0x59b8('0x36')]));_0x122cbe[_0x59b8('0x37')]=_0x122cbe[_0x59b8('0x37')][_0x59b8('0x38')]?_0x122cbe['attributes']:_0x4a527b[_0x59b8('0x31')];if(!_0x31816f['query']['hasOwnProperty'](_0x59b8('0x3a'))){_0x122cbe[_0x59b8('0x1e')]=qs[_0x59b8('0x1e')](_0x31816f[_0x59b8('0x32')][_0x59b8('0x1e')]);_0x122cbe['offset']=qs[_0x59b8('0x1d')](_0x31816f['query']['offset']);}_0x122cbe[_0x59b8('0x3b')]=qs[_0x59b8('0x3c')](_0x31816f[_0x59b8('0x32')][_0x59b8('0x3c')]);_0x122cbe[_0x59b8('0x40')]=qs[_0x59b8('0x34')](_['pick'](_0x31816f[_0x59b8('0x32')],_0x4a527b['filters']));_0x122cbe[_0x59b8('0x40')][_0x59b8('0x59')]=_0x43d53e['id'];if(_0x31816f[_0x59b8('0x32')]['filter']){_0x122cbe['where']=_['merge'](_0x122cbe[_0x59b8('0x40')],{'$or':_[_0x59b8('0x41')](_0x122cbe[_0x59b8('0x37')],function(_0x6dbe0e){var _0x398492={};_0x398492[_0x6dbe0e]={'$like':'%'+_0x31816f['query'][_0x59b8('0x3e')]+'%'};return _0x398492;})});}_0x122cbe=_[_0x59b8('0x3f')]({},_0x122cbe,_0x31816f[_0x59b8('0x43')]);return db[_0x59b8('0x5a')][_0x59b8('0x46')](_0x122cbe);}})[_0x59b8('0x24')](function(_0x4040d1){if(_0x4040d1){return db[_0x59b8('0x5b')][_0x59b8('0x5c')]({'where':{'id':_[_0x59b8('0x41')](_0x4040d1,_0x59b8('0x5d')),'role':'agent'},'attributes':['id',_0x59b8('0x2b'),_0x59b8('0x5e'),_0x59b8('0x5f'),'createdAt']});}})[_0x59b8('0x24')](function(_0x50faf7){if(_0x50faf7){return{'count':_0x50faf7['count'],'rows':_[_0x59b8('0x41')](_0x50faf7[_0x59b8('0x47')],function(_0x381ca1){return{'membername':_0x381ca1[_0x59b8('0x2b')],'UserId':_0x381ca1['id'],'queue_name':_0x45fa45[_0x59b8('0x2b')],'SmsQueueId':_0x45fa45['id'],'interface':util['format']('%s/%s',_0x59b8('0x60'),_0x381ca1[_0x59b8('0x2b')]),'penalty':0x0,'paused':_0x381ca1[_0x59b8('0x5e')],'createdAt':_0x381ca1['createdAt'],'updatedAt':_0x381ca1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x59b8('0x24')](respondWithFilteredResult(_0x188b8b,_0x122cbe))[_0x59b8('0x48')](handleError(_0x188b8b,null));};exports[_0x59b8('0x61')]=function(_0x4ddf0e,_0x543413,_0x44a10e){var _0x502eb3={};var _0x32ea04={};var _0x251a21;var _0x30c2c5;return db['SmsQueue'][_0x59b8('0x58')]({'where':{'id':_0x4ddf0e[_0x59b8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x543413,null))[_0x59b8('0x24')](function(_0xb5aa7b){if(_0xb5aa7b){_0x251a21=_0xb5aa7b;_0x32ea04[_0x59b8('0x31')]=_[_0x59b8('0x33')](db['Team'][_0x59b8('0x2d')]);_0x32ea04[_0x59b8('0x32')]=_['keys'](_0x4ddf0e['query']);_0x32ea04[_0x59b8('0x34')]=_['intersection'](_0x32ea04[_0x59b8('0x31')],_0x32ea04[_0x59b8('0x32')]);_0x502eb3[_0x59b8('0x37')]=_[_0x59b8('0x35')](_0x32ea04[_0x59b8('0x31')],qs['fields'](_0x4ddf0e[_0x59b8('0x32')]['fields']));_0x502eb3[_0x59b8('0x37')]=_0x502eb3[_0x59b8('0x37')][_0x59b8('0x38')]?_0x502eb3[_0x59b8('0x37')]:_0x32ea04[_0x59b8('0x31')];_0x502eb3[_0x59b8('0x3b')]=qs[_0x59b8('0x3c')](_0x4ddf0e[_0x59b8('0x32')]['sort']);_0x502eb3['where']=qs[_0x59b8('0x34')](_[_0x59b8('0x3d')](_0x4ddf0e[_0x59b8('0x32')],_0x32ea04[_0x59b8('0x34')]));if(_0x4ddf0e['query'][_0x59b8('0x3e')]){_0x502eb3['where']=_[_0x59b8('0x3f')](_0x502eb3[_0x59b8('0x40')],{'$or':_[_0x59b8('0x41')](_0x502eb3['attributes'],function(_0x1887c5){var _0xeb3054={};_0xeb3054[_0x1887c5]={'$like':'%'+_0x4ddf0e[_0x59b8('0x32')][_0x59b8('0x3e')]+'%'};return _0xeb3054;})});}_0x502eb3=_[_0x59b8('0x3f')]({},_0x502eb3,_0x4ddf0e[_0x59b8('0x43')]);return _0x251a21[_0x59b8('0x61')](_0x502eb3);}})['then'](function(_0x117bb4){if(_0x117bb4){_0x30c2c5=_0x117bb4[_0x59b8('0x38')];if(!_0x4ddf0e[_0x59b8('0x32')][_0x59b8('0x39')](_0x59b8('0x3a'))){_0x502eb3[_0x59b8('0x1e')]=qs[_0x59b8('0x1e')](_0x4ddf0e[_0x59b8('0x32')][_0x59b8('0x1e')]);_0x502eb3['offset']=qs[_0x59b8('0x1d')](_0x4ddf0e[_0x59b8('0x32')][_0x59b8('0x1d')]);}return _0x251a21[_0x59b8('0x61')](_0x502eb3);}})[_0x59b8('0x24')](function(_0x19367c){if(_0x19367c){return _0x19367c?{'count':_0x30c2c5,'rows':_0x19367c}:null;}})[_0x59b8('0x24')](respondWithResult(_0x543413,null))[_0x59b8('0x48')](handleError(_0x543413,null));};exports[_0x59b8('0x62')]=function(_0x44d912,_0x1f1b4d,_0x1076e9){var _0x5adf6b=_0x44d912[_0x59b8('0x55')][_0x59b8('0x63')];return db['Team'][_0x59b8('0x46')]({'where':{'id':_0x5adf6b},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x59b8('0x64'),'voicePause',_0x59b8('0x65')],'raw':!![]}]})['then'](function(_0x3e68eb){if(_0x3e68eb){var _0x26474b=_[_0x59b8('0x66')](_0x3e68eb,function(_0x31db82){var _0x35bc1b=_0x31db82[_0x59b8('0x26')]({'plain':!![]});return _0x35bc1b[_0x59b8('0x67')];});return db['SmsQueue']['find']({'where':{'id':_0x44d912[_0x59b8('0x4a')]['id']}})[_0x59b8('0x24')](function(_0x3012be){return db[_0x59b8('0x68')][_0x59b8('0x69')](function(_0x2567cc){return _0x3012be[_0x59b8('0x62')](_0x5adf6b,{'transaction':_0x2567cc})[_0x59b8('0x24')](function(){return BPromise[_0x59b8('0x6a')](_0x26474b,function(_0x7a6af3){return db[_0x59b8('0x5a')]['findOrCreate']({'where':{'UserId':_0x7a6af3['id'],'SmsQueueId':_0x44d912[_0x59b8('0x4a')]['id']},'transaction':_0x2567cc});});})[_0x59b8('0x24')](function(){_0x26474b[_0x59b8('0x6b')](function(_0x23ebf7){socket['emit'](_0x59b8('0x6c'),{'UserId':_0x23ebf7['id'],'SmsQueueId':_0x3012be['id']});});});});});}})[_0x59b8('0x24')](respondWithStatusCode(_0x1f1b4d,null))[_0x59b8('0x48')](handleError(_0x1f1b4d,null));};exports[_0x59b8('0x6d')]=function(_0x378846,_0x1b2e2b,_0x36eae4){return db[_0x59b8('0x6e')][_0x59b8('0x46')]({'where':{'id':_0x378846[_0x59b8('0x32')][_0x59b8('0x63')]},'attributes':['id'],'include':[{'model':db[_0x59b8('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x59b8('0x24')](handleEntityNotFound(_0x1b2e2b,null))['then'](function(_0x41a67e){var _0x30d0c9=_[_0x59b8('0x41')](_0x41a67e,'id');var _0x1aa493=[];var _0x5f0259=[];var _0x5b4c75=squel['select']();_0x5b4c75[_0x59b8('0x6f')](_0x59b8('0x70'))['from'](_0x59b8('0x71'),'tq')[_0x59b8('0x72')](_0x59b8('0x73'),'ut',_0x59b8('0x74'))[_0x59b8('0x40')](_0x59b8('0x75'),_0x378846['params']['id']);for(var _0x5c91b1=0x0;_0x5c91b1<_0x41a67e['length'];_0x5c91b1+=0x1){let _0x292d32=_0x41a67e[_0x5c91b1];for(var _0x15423d=0x0;_0x15423d<_0x292d32['Agents'][_0x59b8('0x38')];_0x15423d+=0x1){let _0x28397c=_0x292d32[_0x59b8('0x67')][_0x15423d];var _0x4efd51=_0x5b4c75[_0x59b8('0x76')]();_0x4efd51[_0x59b8('0x40')](_0x59b8('0x77'),_0x28397c['id']);_0x5f0259[_0x59b8('0x78')](db[_0x59b8('0x68')][_0x59b8('0x32')](_0x4efd51[_0x59b8('0x79')](),{'type':db[_0x59b8('0x68')]['QueryTypes'][_0x59b8('0x7a')]})['then'](function(_0x18783e){if(_0x18783e[_0x59b8('0x38')]===0x1){return _0x28397c['id'];}else{var _0x554440=_[_0x59b8('0x7b')](_[_0x59b8('0x41')](_0x18783e,_0x59b8('0x7c')),function(_0x114ddd){return _[_0x59b8('0x7d')](_0x30d0c9,_0x114ddd);});if(_0x554440){return _0x28397c['id'];}}}));}}return BPromise[_0x59b8('0x7e')](_0x5f0259)[_0x59b8('0x24')](function(_0x7a71e){_0x1aa493=_(_0x1aa493)[_0x59b8('0x7f')](_0x7a71e)[_0x59b8('0x80')]()[_0x59b8('0x81')]();return db['SmsQueue'][_0x59b8('0x4c')]({'where':{'id':_0x378846[_0x59b8('0x4a')]['id']}})[_0x59b8('0x24')](function(_0x22ba67){return db[_0x59b8('0x68')][_0x59b8('0x69')](function(_0x25ecc5){return _0x22ba67[_0x59b8('0x6d')](_0x378846[_0x59b8('0x32')][_0x59b8('0x63')],{'transaction':_0x25ecc5})[_0x59b8('0x24')](function(){if(!_[_0x59b8('0x82')](_0x1aa493)){return _0x22ba67[_0x59b8('0x83')](_0x1aa493,{'transaction':_0x25ecc5});}})[_0x59b8('0x24')](function(){_0x1aa493[_0x59b8('0x6b')](function(_0x31110e){socket[_0x59b8('0x84')](_0x59b8('0x85'),{'UserId':_0x31110e,'SmsQueueId':_0x22ba67['id']});});});});});});})[_0x59b8('0x24')](respondWithStatusCode(_0x1b2e2b,null))[_0x59b8('0x48')](handleError(_0x1b2e2b,null));};exports['addAgents']=function(_0x856198,_0x2de0ef,_0x479704){return db[_0x59b8('0x2c')][_0x59b8('0x4c')]({'where':{'id':_0x856198[_0x59b8('0x4a')]['id']}})[_0x59b8('0x24')](handleEntityNotFound(_0x2de0ef,null))[_0x59b8('0x24')](function(_0x2810bb){if(_0x2810bb){return _0x2810bb[_0x59b8('0x86')](_0x856198[_0x59b8('0x55')][_0x59b8('0x63')],_[_0x59b8('0x87')](_0x856198[_0x59b8('0x55')],['ids','id'])||{})[_0x59b8('0x88')](function(_0x51bcc9){for(var _0x5568fe=0x0;_0x5568fe<_0x856198[_0x59b8('0x55')][_0x59b8('0x63')][_0x59b8('0x38')];_0x5568fe+=0x1){socket[_0x59b8('0x84')](_0x59b8('0x6c'),{'UserId':Number(_0x856198[_0x59b8('0x55')]['ids'][_0x5568fe]),'SmsQueueId':Number(_0x856198[_0x59b8('0x4a')]['id'])});}return _0x51bcc9;});}})['then'](respondWithResult(_0x2de0ef,null))['catch'](handleError(_0x2de0ef,null));};exports['removeAgents']=function(_0x381001,_0x4fea39,_0x25275d){return db['SmsQueue']['find']({'where':{'id':_0x381001[_0x59b8('0x4a')]['id']}})[_0x59b8('0x24')](handleEntityNotFound(_0x4fea39,null))['then'](function(_0x4758aa){if(_0x4758aa){return _0x4758aa['removeAgents'](_0x381001['query'][_0x59b8('0x63')])['then'](function(){if(_[_0x59b8('0x89')](_0x381001[_0x59b8('0x32')][_0x59b8('0x63')])){for(var _0x2c26ac=0x0;_0x2c26ac<_0x381001[_0x59b8('0x32')][_0x59b8('0x63')]['length'];_0x2c26ac+=0x1){socket[_0x59b8('0x84')](_0x59b8('0x85'),{'UserId':Number(_0x381001[_0x59b8('0x32')]['ids'][_0x2c26ac]),'SmsQueueId':Number(_0x381001['params']['id'])});}}else{socket[_0x59b8('0x84')](_0x59b8('0x85'),{'UserId':Number(_0x381001['query'][_0x59b8('0x63')]),'SmsQueueId':Number(_0x381001[_0x59b8('0x4a')]['id'])});}});}})[_0x59b8('0x24')](respondWithStatusCode(_0x4fea39,null))['catch'](handleError(_0x4fea39,null));};exports['getAgents']=function(_0x142fa2,_0x4e82c3,_0x2914d1){var _0x1d5c67={};var _0x310134={};var _0x256ad7;var _0x4d52ac;return db[_0x59b8('0x2c')][_0x59b8('0x58')]({'where':{'id':_0x142fa2[_0x59b8('0x4a')]['id']}})[_0x59b8('0x24')](handleEntityNotFound(_0x4e82c3,null))[_0x59b8('0x24')](function(_0x30e994){if(_0x30e994){_0x256ad7=_0x30e994;_0x310134['model']=_['keys'](db[_0x59b8('0x5b')][_0x59b8('0x2d')]);_0x310134[_0x59b8('0x32')]=_['keys'](_0x142fa2[_0x59b8('0x32')]);_0x310134[_0x59b8('0x34')]=_[_0x59b8('0x35')](_0x310134[_0x59b8('0x31')],_0x310134[_0x59b8('0x32')]);_0x1d5c67[_0x59b8('0x37')]=_[_0x59b8('0x35')](_0x310134[_0x59b8('0x31')],qs[_0x59b8('0x36')](_0x142fa2[_0x59b8('0x32')][_0x59b8('0x36')]));_0x1d5c67[_0x59b8('0x37')]=_0x1d5c67[_0x59b8('0x37')]['length']?_0x1d5c67['attributes']:_0x310134[_0x59b8('0x31')];_0x1d5c67['order']=qs[_0x59b8('0x3c')](_0x142fa2[_0x59b8('0x32')][_0x59b8('0x3c')]);_0x1d5c67[_0x59b8('0x40')]=qs['filters'](_['pick'](_0x142fa2[_0x59b8('0x32')],_0x310134['filters']));if(_0x142fa2[_0x59b8('0x32')][_0x59b8('0x3e')]){_0x1d5c67[_0x59b8('0x40')]=_[_0x59b8('0x3f')](_0x1d5c67[_0x59b8('0x40')],{'$or':_[_0x59b8('0x41')](_0x1d5c67['attributes'],function(_0x2c110c){var _0x5e975f={};_0x5e975f[_0x2c110c]={'$like':'%'+_0x142fa2[_0x59b8('0x32')]['filter']+'%'};return _0x5e975f;})});}_0x1d5c67=_[_0x59b8('0x3f')]({},_0x1d5c67,_0x142fa2[_0x59b8('0x43')]);return _0x256ad7[_0x59b8('0x8a')](_0x1d5c67);}})[_0x59b8('0x24')](function(_0x570312){if(_0x570312){_0x4d52ac=_0x570312[_0x59b8('0x38')];if(!_0x142fa2[_0x59b8('0x32')][_0x59b8('0x39')]('nolimit')){_0x1d5c67[_0x59b8('0x1e')]=qs[_0x59b8('0x1e')](_0x142fa2['query'][_0x59b8('0x1e')]);_0x1d5c67[_0x59b8('0x1d')]=qs['offset'](_0x142fa2[_0x59b8('0x32')][_0x59b8('0x1d')]);}return _0x256ad7['getAgents'](_0x1d5c67);}})[_0x59b8('0x24')](function(_0x42644b){if(_0x42644b){return _0x42644b?{'count':_0x4d52ac,'rows':_0x42644b}:null;}})['then'](respondWithResult(_0x4e82c3,null))[_0x59b8('0x48')](handleError(_0x4e82c3,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 80bed09..2615a17 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 _0xc8b2=['../../mysqldb','SmsQueue','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x1adf6b,_0x357418){var _0x1a7fcc=function(_0x1a20c7){while(--_0x1a20c7){_0x1adf6b['push'](_0x1adf6b['shift']());}};_0x1a7fcc(++_0x357418);}(_0xc8b2,0xc0));var _0x2c8b=function(_0x369b32,_0x3ed53f){_0x369b32=_0x369b32-0x0;var _0x50172b=_0xc8b2[_0x369b32];return _0x50172b;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x2c8b('0x0'))['db'][_0x2c8b('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x2c8b('0x2')](0x0);var events={'afterCreate':_0x2c8b('0x3'),'afterUpdate':'update','afterDestroy':_0x2c8b('0x4')};function emitEvent(_0x5ed03b){return function(_0x3176ff,_0x5bad2e,_0x2b3cd7){SmsQueueEvents[_0x2c8b('0x5')](_0x5ed03b+':'+_0x3176ff['id'],_0x3176ff);SmsQueueEvents[_0x2c8b('0x5')](_0x5ed03b,_0x3176ff);_0x2b3cd7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x2c8b('0x6')](e,emitEvent(event));}}module[_0x2c8b('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x3d26=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','SmsQueue'];(function(_0x274ea2,_0x4cdefa){var _0x5cdcfc=function(_0x6b188c){while(--_0x6b188c){_0x274ea2['push'](_0x274ea2['shift']());}};_0x5cdcfc(++_0x4cdefa);}(_0x3d26,0x1d2));var _0x63d2=function(_0x2026bf,_0x5b64c1){_0x2026bf=_0x2026bf-0x0;var _0x912553=_0x3d26[_0x2026bf];return _0x912553;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x63d2('0x0'))['db'][_0x63d2('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x63d2('0x2')](0x0);var events={'afterCreate':_0x63d2('0x3'),'afterUpdate':_0x63d2('0x4'),'afterDestroy':_0x63d2('0x5')};function emitEvent(_0x3efcb8){return function(_0x40e872,_0x340523,_0x1000fa){SmsQueueEvents[_0x63d2('0x6')](_0x3efcb8+':'+_0x40e872['id'],_0x40e872);SmsQueueEvents[_0x63d2('0x6')](_0x3efcb8,_0x40e872);_0x1000fa(null);};}for(var e in events){if(events[_0x63d2('0x7')](e)){var event=events[e];SmsQueue[_0x63d2('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 863947b..f27766d 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 _0x63b1=['SmsQueue','sms_queues','lodash','util','../../config/logger','api','path','../../config/environment','./smsQueue.attributes','exports','define'];(function(_0x138fc4,_0x2a4d0e){var _0x37b82d=function(_0x4c3fd1){while(--_0x4c3fd1){_0x138fc4['push'](_0x138fc4['shift']());}};_0x37b82d(++_0x2a4d0e);}(_0x63b1,0x120));var _0x163b=function(_0x31e964,_0x533231){_0x31e964=_0x31e964-0x0;var _0x5d443d=_0x63b1[_0x31e964];return _0x5d443d;};'use strict';var _=require(_0x163b('0x0'));var util=require(_0x163b('0x1'));var logger=require(_0x163b('0x2'))(_0x163b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x163b('0x4'));var rimraf=require('rimraf');var config=require(_0x163b('0x5'));var attributes=require(_0x163b('0x6'));module[_0x163b('0x7')]=function(_0x3e5179,_0x918000){return _0x3e5179[_0x163b('0x8')](_0x163b('0x9'),attributes,{'tableName':_0x163b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0e1=['exports','define','lodash','util','../../config/logger','request-promise','path','./smsQueue.attributes'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xc0e1,0x6a));var _0x1c0e=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0xc0e1[_0xb24fad];return _0x173226;};'use strict';var _=require(_0x1c0e('0x0'));var util=require(_0x1c0e('0x1'));var logger=require(_0x1c0e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1c0e('0x3'));var fs=require('fs');var path=require(_0x1c0e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1c0e('0x5'));module[_0x1c0e('0x6')]=function(_0x14fd4a,_0x5d2cfa){return _0x14fd4a[_0x1c0e('0x7')]('SmsQueue',attributes,{'tableName':'sms_queues','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 245580a..45d5662 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 _0xb5a3=['lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','attributes','limit','include','map','model','ShowSmsQueue','find','where'];(function(_0x1490cf,_0x31f4e8){var _0x3002cb=function(_0xbafdb2){while(--_0xbafdb2){_0x1490cf['push'](_0x1490cf['shift']());}};_0x3002cb(++_0x31f4e8);}(_0xb5a3,0x138));var _0x3b5a=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0xb5a3[_0x1f3aec];return _0x409f0d;};'use strict';var _=require(_0x3b5a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3b5a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b5a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b5a('0x3'));var logger=require(_0x3b5a('0x4'))(_0x3b5a('0x5'));var config=require(_0x3b5a('0x6'));var jayson=require(_0x3b5a('0x7'));var client=jayson[_0x3b5a('0x8')][_0x3b5a('0x9')]({'port':0x232a});config[_0x3b5a('0xa')]=_[_0x3b5a('0xb')](config['redis'],{'host':_0x3b5a('0xc'),'port':0x18eb});var socket=require(_0x3b5a('0xd'))(new Redis(config[_0x3b5a('0xa')]));require(_0x3b5a('0xe'))[_0x3b5a('0xf')](socket);function respondWithRpcPromise(_0x3eb1d8,_0x32ff24,_0x2cdd29){return new BPromise(function(_0x34e75a,_0x642142){return client['request'](_0x3eb1d8,_0x2cdd29)[_0x3b5a('0x10')](function(_0x1e1ada){logger[_0x3b5a('0x11')](_0x3b5a('0x12'),_0x32ff24,_0x3b5a('0x13'));logger[_0x3b5a('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x32ff24,_0x3b5a('0x13'),JSON[_0x3b5a('0x15')](_0x1e1ada));if(_0x1e1ada['error']){if(_0x1e1ada[_0x3b5a('0x16')][_0x3b5a('0x17')]===0x1f4){logger[_0x3b5a('0x16')](_0x3b5a('0x12'),_0x32ff24,_0x1e1ada[_0x3b5a('0x16')][_0x3b5a('0x18')]);return _0x642142(_0x1e1ada[_0x3b5a('0x16')][_0x3b5a('0x18')]);}logger[_0x3b5a('0x16')]('SmsQueue,\x20%s,\x20%s',_0x32ff24,_0x1e1ada[_0x3b5a('0x16')]['message']);return _0x34e75a(_0x1e1ada['error']['message']);}else{logger[_0x3b5a('0x11')](_0x3b5a('0x12'),_0x32ff24,_0x3b5a('0x13'));_0x34e75a(_0x1e1ada['result'][_0x3b5a('0x18')]);}})[_0x3b5a('0x19')](function(_0xc771cc){logger[_0x3b5a('0x16')](_0x3b5a('0x12'),_0x32ff24,_0xc771cc);_0x642142(_0xc771cc);});});}exports[_0x3b5a('0x1a')]=function(_0x35b7c4){var _0x15f661=this;return new Promise(function(_0x25fd4b,_0x1d6245){return db[_0x3b5a('0x1b')][_0x3b5a('0x1c')]({'raw':_0x35b7c4[_0x3b5a('0x1d')]?_0x35b7c4['options'][_0x3b5a('0x1e')]===undefined?!![]:![]:!![],'where':_0x35b7c4['options']?_0x35b7c4[_0x3b5a('0x1d')]['where']||null:null,'attributes':_0x35b7c4[_0x3b5a('0x1d')]?_0x35b7c4[_0x3b5a('0x1d')][_0x3b5a('0x1f')]||null:null,'limit':_0x35b7c4[_0x3b5a('0x1d')]?_0x35b7c4['options'][_0x3b5a('0x20')]||null:null,'include':_0x35b7c4[_0x3b5a('0x1d')]?_0x35b7c4[_0x3b5a('0x1d')]['include']?_['map'](_0x35b7c4[_0x3b5a('0x1d')]['include'],function(_0x10fd70){return{'model':db[_0x10fd70['model']],'as':_0x10fd70['as'],'attributes':_0x10fd70[_0x3b5a('0x1f')],'include':_0x10fd70[_0x3b5a('0x21')]?_[_0x3b5a('0x22')](_0x10fd70[_0x3b5a('0x21')],function(_0x9bf644){return{'model':db[_0x9bf644['model']],'as':_0x9bf644['as'],'attributes':_0x9bf644[_0x3b5a('0x1f')],'include':_0x9bf644[_0x3b5a('0x21')]?_['map'](_0x9bf644[_0x3b5a('0x21')],function(_0x2ea494){return{'model':db[_0x2ea494[_0x3b5a('0x23')]],'as':_0x2ea494['as'],'attributes':_0x2ea494[_0x3b5a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x160461){logger[_0x3b5a('0x11')](_0x3b5a('0x1a'),_0x35b7c4);logger[_0x3b5a('0x14')]('GetSmsQueue',_0x35b7c4,JSON[_0x3b5a('0x15')](_0x160461));_0x25fd4b(_0x160461);})[_0x3b5a('0x19')](function(_0x5e50c7){logger[_0x3b5a('0x16')](_0x3b5a('0x1a'),_0x5e50c7[_0x3b5a('0x18')],_0x35b7c4);_0x1d6245(_0x15f661['error'](0x1f4,_0x5e50c7['message']));});});};exports[_0x3b5a('0x24')]=function(_0x3b169e){var _0x379625=this;return new Promise(function(_0x3662cd,_0xa33e8f){return db[_0x3b5a('0x1b')][_0x3b5a('0x25')]({'raw':_0x3b169e[_0x3b5a('0x1d')]?_0x3b169e[_0x3b5a('0x1d')][_0x3b5a('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b169e[_0x3b5a('0x1d')]?_0x3b169e['options'][_0x3b5a('0x26')]||null:null,'attributes':_0x3b169e['options']?_0x3b169e['options'][_0x3b5a('0x1f')]||null:null,'include':_0x3b169e[_0x3b5a('0x1d')]?_0x3b169e[_0x3b5a('0x1d')][_0x3b5a('0x21')]?_[_0x3b5a('0x22')](_0x3b169e['options'][_0x3b5a('0x21')],function(_0x3d48e7){return{'model':db[_0x3d48e7[_0x3b5a('0x23')]],'as':_0x3d48e7['as'],'attributes':_0x3d48e7[_0x3b5a('0x1f')],'include':_0x3d48e7[_0x3b5a('0x21')]?_[_0x3b5a('0x22')](_0x3d48e7['include'],function(_0x264f85){return{'model':db[_0x264f85['model']],'as':_0x264f85['as'],'attributes':_0x264f85[_0x3b5a('0x1f')],'include':_0x264f85[_0x3b5a('0x21')]?_[_0x3b5a('0x22')](_0x264f85[_0x3b5a('0x21')],function(_0x2818a6){return{'model':db[_0x2818a6[_0x3b5a('0x23')]],'as':_0x2818a6['as'],'attributes':_0x2818a6[_0x3b5a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3b5a('0x10')](function(_0x56163d){logger[_0x3b5a('0x11')](_0x3b5a('0x24'),_0x3b169e);logger['debug'](_0x3b5a('0x24'),_0x3b169e,JSON[_0x3b5a('0x15')](_0x56163d));_0x3662cd(_0x56163d);})[_0x3b5a('0x19')](function(_0x542b15){logger[_0x3b5a('0x16')](_0x3b5a('0x24'),_0x542b15[_0x3b5a('0x18')],_0x3b169e);_0xa33e8f(_0x379625['error'](0x1f4,_0x542b15[_0x3b5a('0x18')]));});});}; \ No newline at end of file +var _0xb04c=['lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','http','redis','defaults','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSmsQueue','findAll','options','raw','where','attributes','limit','include','model','map','debug','SmsQueue','find','ShowSmsQueue','stringify'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xb04c,0xbe));var _0xcb04=function(_0x556a38,_0x12adcb){_0x556a38=_0x556a38-0x0;var _0x302a7c=_0xb04c[_0x556a38];return _0x302a7c;};'use strict';var _=require(_0xcb04('0x0'));var util=require(_0xcb04('0x1'));var moment=require(_0xcb04('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb04('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcb04('0x4'));var logger=require(_0xcb04('0x5'))(_0xcb04('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xcb04('0x7')]({'port':0x232a});config[_0xcb04('0x8')]=_[_0xcb04('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcb04('0x8')]));require(_0xcb04('0xa'))[_0xcb04('0xb')](socket);function respondWithRpcPromise(_0x1cc806,_0x5495a7,_0x9d5970){return new BPromise(function(_0x103a64,_0x115c32){return client[_0xcb04('0xc')](_0x1cc806,_0x9d5970)[_0xcb04('0xd')](function(_0x3f6c1f){logger[_0xcb04('0xe')](_0xcb04('0xf'),_0x5495a7,_0xcb04('0x10'));logger['debug'](_0xcb04('0x11'),_0x5495a7,_0xcb04('0x10'),JSON['stringify'](_0x3f6c1f));if(_0x3f6c1f[_0xcb04('0x12')]){if(_0x3f6c1f[_0xcb04('0x12')][_0xcb04('0x13')]===0x1f4){logger[_0xcb04('0x12')](_0xcb04('0xf'),_0x5495a7,_0x3f6c1f[_0xcb04('0x12')][_0xcb04('0x14')]);return _0x115c32(_0x3f6c1f[_0xcb04('0x12')][_0xcb04('0x14')]);}logger[_0xcb04('0x12')](_0xcb04('0xf'),_0x5495a7,_0x3f6c1f[_0xcb04('0x12')][_0xcb04('0x14')]);return _0x103a64(_0x3f6c1f[_0xcb04('0x12')][_0xcb04('0x14')]);}else{logger[_0xcb04('0xe')]('SmsQueue,\x20%s,\x20%s',_0x5495a7,'request\x20sent');_0x103a64(_0x3f6c1f[_0xcb04('0x15')]['message']);}})[_0xcb04('0x16')](function(_0x2321be){logger[_0xcb04('0x12')](_0xcb04('0xf'),_0x5495a7,_0x2321be);_0x115c32(_0x2321be);});});}exports[_0xcb04('0x17')]=function(_0x2e8291){var _0x176b10=this;return new Promise(function(_0x5396b0,_0x45cc48){return db['SmsQueue'][_0xcb04('0x18')]({'raw':_0x2e8291[_0xcb04('0x19')]?_0x2e8291['options'][_0xcb04('0x1a')]===undefined?!![]:![]:!![],'where':_0x2e8291[_0xcb04('0x19')]?_0x2e8291[_0xcb04('0x19')][_0xcb04('0x1b')]||null:null,'attributes':_0x2e8291['options']?_0x2e8291[_0xcb04('0x19')][_0xcb04('0x1c')]||null:null,'limit':_0x2e8291[_0xcb04('0x19')]?_0x2e8291[_0xcb04('0x19')][_0xcb04('0x1d')]||null:null,'include':_0x2e8291[_0xcb04('0x19')]?_0x2e8291[_0xcb04('0x19')]['include']?_['map'](_0x2e8291[_0xcb04('0x19')][_0xcb04('0x1e')],function(_0x2f606d){return{'model':db[_0x2f606d[_0xcb04('0x1f')]],'as':_0x2f606d['as'],'attributes':_0x2f606d[_0xcb04('0x1c')],'include':_0x2f606d[_0xcb04('0x1e')]?_[_0xcb04('0x20')](_0x2f606d[_0xcb04('0x1e')],function(_0x5a8558){return{'model':db[_0x5a8558[_0xcb04('0x1f')]],'as':_0x5a8558['as'],'attributes':_0x5a8558[_0xcb04('0x1c')],'include':_0x5a8558[_0xcb04('0x1e')]?_['map'](_0x5a8558[_0xcb04('0x1e')],function(_0x34ec90){return{'model':db[_0x34ec90[_0xcb04('0x1f')]],'as':_0x34ec90['as'],'attributes':_0x34ec90[_0xcb04('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcb04('0xd')](function(_0x1fb7eb){logger['info']('GetSmsQueue',_0x2e8291);logger[_0xcb04('0x21')](_0xcb04('0x17'),_0x2e8291,JSON['stringify'](_0x1fb7eb));_0x5396b0(_0x1fb7eb);})[_0xcb04('0x16')](function(_0x4feb74){logger[_0xcb04('0x12')](_0xcb04('0x17'),_0x4feb74[_0xcb04('0x14')],_0x2e8291);_0x45cc48(_0x176b10[_0xcb04('0x12')](0x1f4,_0x4feb74['message']));});});};exports['ShowSmsQueue']=function(_0x2f247d){var _0x5976fa=this;return new Promise(function(_0x45980d,_0xffa335){return db[_0xcb04('0x22')][_0xcb04('0x23')]({'raw':_0x2f247d[_0xcb04('0x19')]?_0x2f247d['options'][_0xcb04('0x1a')]===undefined?!![]:![]:!![],'where':_0x2f247d[_0xcb04('0x19')]?_0x2f247d['options']['where']||null:null,'attributes':_0x2f247d[_0xcb04('0x19')]?_0x2f247d[_0xcb04('0x19')][_0xcb04('0x1c')]||null:null,'include':_0x2f247d[_0xcb04('0x19')]?_0x2f247d[_0xcb04('0x19')][_0xcb04('0x1e')]?_[_0xcb04('0x20')](_0x2f247d[_0xcb04('0x19')][_0xcb04('0x1e')],function(_0x51e025){return{'model':db[_0x51e025[_0xcb04('0x1f')]],'as':_0x51e025['as'],'attributes':_0x51e025['attributes'],'include':_0x51e025[_0xcb04('0x1e')]?_['map'](_0x51e025['include'],function(_0x443edc){return{'model':db[_0x443edc[_0xcb04('0x1f')]],'as':_0x443edc['as'],'attributes':_0x443edc[_0xcb04('0x1c')],'include':_0x443edc[_0xcb04('0x1e')]?_[_0xcb04('0x20')](_0x443edc[_0xcb04('0x1e')],function(_0x1a6ca7){return{'model':db[_0x1a6ca7['model']],'as':_0x1a6ca7['as'],'attributes':_0x1a6ca7[_0xcb04('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcb04('0xd')](function(_0x5eeb79){logger[_0xcb04('0xe')](_0xcb04('0x24'),_0x2f247d);logger[_0xcb04('0x21')](_0xcb04('0x24'),_0x2f247d,JSON[_0xcb04('0x25')](_0x5eeb79));_0x45980d(_0x5eeb79);})[_0xcb04('0x16')](function(_0x43c40c){logger[_0xcb04('0x12')](_0xcb04('0x24'),_0x43c40c[_0xcb04('0x14')],_0x2f247d);_0xffa335(_0x5976fa['error'](0x1f4,_0x43c40c['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index f4d77ee..ff3380b 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 _0x6e96=['smsQueue:','length'];(function(_0x151ae3,_0x3a9195){var _0x564680=function(_0x244bf7){while(--_0x244bf7){_0x151ae3['push'](_0x151ae3['shift']());}};_0x564680(++_0x3a9195);}(_0x6e96,0x89));var _0x66e9=function(_0x1f2002,_0x4b63f7){_0x1f2002=_0x1f2002-0x0;var _0x3814e2=_0x6e96[_0x1f2002];return _0x3814e2;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save','remove','update'];function createListener(_0x28e4b2,_0x2a4862){return function(_0x1cd73d){_0x2a4862['emit'](_0x28e4b2,_0x1cd73d);};}function removeListener(_0x2679a6,_0x23a686){return function(){SmsQueueEvents['removeListener'](_0x2679a6,_0x23a686);};}exports['register']=function(_0x283804){for(var _0x4ee7ad=0x0,_0xd2d892=events[_0x66e9('0x0')];_0x4ee7ad<_0xd2d892;_0x4ee7ad++){var _0x2f83eb=events[_0x4ee7ad];var _0x26d53c=createListener(_0x66e9('0x1')+_0x2f83eb,_0x283804);SmsQueueEvents['on'](_0x2f83eb,_0x26d53c);}}; \ No newline at end of file +var _0xf600=['emit','removeListener','register','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x4486e8,_0x3ebb8e){var _0x462a09=function(_0x3869c0){while(--_0x3869c0){_0x4486e8['push'](_0x4486e8['shift']());}};_0x462a09(++_0x3ebb8e);}(_0xf600,0x17f));var _0x0f60=function(_0x51b948,_0x4216c1){_0x51b948=_0x51b948-0x0;var _0x2db727=_0xf600[_0x51b948];return _0x2db727;};'use strict';var SmsQueueEvents=require(_0x0f60('0x0'));var events=[_0x0f60('0x1'),_0x0f60('0x2'),_0x0f60('0x3')];function createListener(_0x96a68,_0x1a6bfa){return function(_0x440128){_0x1a6bfa[_0x0f60('0x4')](_0x96a68,_0x440128);};}function removeListener(_0x48dc7b,_0x381eb){return function(){SmsQueueEvents[_0x0f60('0x5')](_0x48dc7b,_0x381eb);};}exports[_0x0f60('0x6')]=function(_0x2525ec){for(var _0x531e88=0x0,_0x58be63=events[_0x0f60('0x7')];_0x531e88<_0x58be63;_0x531e88++){var _0x1b1814=events[_0x531e88];var _0x2da563=createListener(_0x0f60('0x8')+_0x1b1814,_0x2525ec);SmsQueueEvents['on'](_0x1b1814,_0x2da563);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index d048228..a5ff2cc 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 _0x1e6c=['describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x1e6c,0x11a));var _0xc1e6=function(_0x12f4af,_0x4a2bb9){_0x12f4af=_0x12f4af-0x0;var _0x4c4d50=_0x1e6c[_0x12f4af];return _0x4c4d50;};'use strict';var multer=require(_0xc1e6('0x0'));var util=require('util');var path=require(_0xc1e6('0x1'));var timeout=require(_0xc1e6('0x2'));var express=require(_0xc1e6('0x3'));var router=express[_0xc1e6('0x4')]();var fs_extra=require(_0xc1e6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc1e6('0x6'));var controller=require(_0xc1e6('0x7'));router[_0xc1e6('0x8')]('/',auth[_0xc1e6('0x9')](),controller[_0xc1e6('0xa')]);router[_0xc1e6('0x8')](_0xc1e6('0xb'),auth['isAuthenticated'](),controller[_0xc1e6('0xc')]);router['get'](_0xc1e6('0xd'),auth['isAuthenticated'](),controller[_0xc1e6('0xe')]);router[_0xc1e6('0xf')]('/',auth[_0xc1e6('0x9')](),controller[_0xc1e6('0x10')]);router['put']('/:id',auth[_0xc1e6('0x9')](),controller[_0xc1e6('0x11')]);router[_0xc1e6('0x12')]('/:id',auth[_0xc1e6('0x9')](),controller[_0xc1e6('0x13')]);module[_0xc1e6('0x14')]=router; \ No newline at end of file +var _0x6379=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','update','delete','destroy','multer'];(function(_0x176d68,_0xddb23c){var _0x15b715=function(_0x5c8c40){while(--_0x5c8c40){_0x176d68['push'](_0x176d68['shift']());}};_0x15b715(++_0xddb23c);}(_0x6379,0x84));var _0x9637=function(_0x3bd78d,_0x381dbf){_0x3bd78d=_0x3bd78d-0x0;var _0x1c5bad=_0x6379[_0x3bd78d];return _0x1c5bad;};'use strict';var multer=require(_0x9637('0x0'));var util=require(_0x9637('0x1'));var path=require(_0x9637('0x2'));var timeout=require(_0x9637('0x3'));var express=require(_0x9637('0x4'));var router=express['Router']();var fs_extra=require(_0x9637('0x5'));var auth=require(_0x9637('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9637('0x7'));router[_0x9637('0x8')]('/',auth[_0x9637('0x9')](),controller[_0x9637('0xa')]);router[_0x9637('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x9637('0xb')]);router[_0x9637('0x8')](_0x9637('0xc'),auth[_0x9637('0x9')](),controller['show']);router[_0x9637('0xd')]('/',auth[_0x9637('0x9')](),controller[_0x9637('0xe')]);router[_0x9637('0xf')](_0x9637('0xc'),auth[_0x9637('0x9')](),controller[_0x9637('0x10')]);router[_0x9637('0x11')](_0x9637('0xc'),auth['isAuthenticated'](),controller[_0x9637('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 9816d97..00d12d0 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 _0xa258=['moment','sequelize','exports','STRING','DATE'];(function(_0x18183c,_0xc6873a){var _0x4c5764=function(_0x3e0d1c){while(--_0x3e0d1c){_0x18183c['push'](_0x18183c['shift']());}};_0x4c5764(++_0xc6873a);}(_0xa258,0x78));var _0x8a25=function(_0x44d892,_0x28a1c0){_0x44d892=_0x44d892-0x0;var _0x19097d=_0xa258[_0x44d892];return _0x19097d;};'use strict';var moment=require(_0x8a25('0x0'));var Sequelize=require(_0x8a25('0x1'));module[_0x8a25('0x2')]={'uniqueid':{'type':Sequelize[_0x8a25('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8a25('0x4')]},'leaveAt':{'type':Sequelize[_0x8a25('0x4')]},'acceptAt':{'type':Sequelize[_0x8a25('0x4')]},'exitAt':{'type':Sequelize[_0x8a25('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1e6b=['DATE','moment','exports','STRING'];(function(_0x4de8e2,_0x11e9dc){var _0x2a81de=function(_0x559aa8){while(--_0x559aa8){_0x4de8e2['push'](_0x4de8e2['shift']());}};_0x2a81de(++_0x11e9dc);}(_0x1e6b,0x89));var _0xb1e6=function(_0x21312f,_0xfa26d4){_0x21312f=_0x21312f-0x0;var _0x400301=_0x1e6b[_0x21312f];return _0x400301;};'use strict';var moment=require(_0xb1e6('0x0'));var Sequelize=require('sequelize');module[_0xb1e6('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb1e6('0x2')]},'joinAt':{'type':Sequelize[_0xb1e6('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb1e6('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 6a72734..7d43963 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 _0xcca3=['../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','save','update','then','error','name','send','map','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','options','SmsQueueReport','includeAll','include','rows','catch','show','params','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x35c33d,_0x46defa){var _0x5139b3=function(_0x427391){while(--_0x427391){_0x35c33d['push'](_0x35c33d['shift']());}};_0x5139b3(++_0x46defa);}(_0xcca3,0x10c));var _0x3cca=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xcca3[_0x3511d3];return _0x5d6321;};'use strict';var emlformat=require(_0x3cca('0x0'));var rimraf=require(_0x3cca('0x1'));var zipdir=require(_0x3cca('0x2'));var jsonpatch=require(_0x3cca('0x3'));var rp=require('request-promise');var moment=require(_0x3cca('0x4'));var BPromise=require(_0x3cca('0x5'));var Mustache=require(_0x3cca('0x6'));var util=require(_0x3cca('0x7'));var path=require('path');var sox=require(_0x3cca('0x8'));var csv=require('to-csv');var ejs=require(_0x3cca('0x9'));var fs=require('fs');var fs_extra=require(_0x3cca('0xa'));var _=require(_0x3cca('0xb'));var squel=require(_0x3cca('0xc'));var crypto=require('crypto');var jsforce=require(_0x3cca('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3cca('0xe'));var Papa=require(_0x3cca('0xf'));var Redis=require(_0x3cca('0x10'));var authService=require(_0x3cca('0x11'));var qs=require(_0x3cca('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3cca('0x13'));var logger=require(_0x3cca('0x14'))(_0x3cca('0x15'));var utils=require(_0x3cca('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3cca('0x17'))['db'];function respondWithStatusCode(_0x20523c,_0x1c8dea){_0x1c8dea=_0x1c8dea||0xcc;return function(_0x28731b){if(_0x28731b){return _0x20523c[_0x3cca('0x18')](_0x1c8dea);}return _0x20523c[_0x3cca('0x19')](_0x1c8dea)[_0x3cca('0x1a')]();};}function respondWithResult(_0x6bade6,_0x58c10f){_0x58c10f=_0x58c10f||0xc8;return function(_0x152dea){if(_0x152dea){return _0x6bade6['status'](_0x58c10f)['json'](_0x152dea);}};}function respondWithFilteredResult(_0x3f87d5,_0x48da1b){return function(_0x284b58){if(_0x284b58){var _0x26dd5f=typeof _0x48da1b[_0x3cca('0x1b')]==='undefined'&&typeof _0x48da1b['limit']===_0x3cca('0x1c');var _0x52edaf=_0x284b58[_0x3cca('0x1d')];var _0x4c7f15=_0x26dd5f?0x0:_0x48da1b['offset'];var _0x1ba8bd=_0x26dd5f?_0x284b58[_0x3cca('0x1d')]:_0x48da1b[_0x3cca('0x1b')]+_0x48da1b[_0x3cca('0x1e')];var _0x3a164d;if(_0x1ba8bd>=_0x52edaf){_0x1ba8bd=_0x52edaf;_0x3a164d=0xc8;}else{_0x3a164d=0xce;}_0x3f87d5[_0x3cca('0x19')](_0x3a164d);return _0x3f87d5['set'](_0x3cca('0x1f'),_0x4c7f15+'-'+_0x1ba8bd+'/'+_0x52edaf)[_0x3cca('0x20')](_0x284b58);}return null;};}function patchUpdates(_0x5586ea){return function(_0x3c6adb){try{jsonpatch['apply'](_0x3c6adb,_0x5586ea,!![]);}catch(_0x45afdc){return BPromise[_0x3cca('0x21')](_0x45afdc);}return _0x3c6adb[_0x3cca('0x22')]();};}function saveUpdates(_0x11b4b7,_0x484ef8){return function(_0x16f3c9){if(_0x16f3c9){return _0x16f3c9[_0x3cca('0x23')](_0x11b4b7)['then'](function(_0x53beff){return _0x53beff;});}return null;};}function removeEntity(_0x333572,_0x30a443){return function(_0x1d5435){if(_0x1d5435){return _0x1d5435['destroy']()[_0x3cca('0x24')](function(){_0x333572['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x451366,_0x4445a8){return function(_0x50facf){if(!_0x50facf){_0x451366['sendStatus'](0x194);}return _0x50facf;};}function handleError(_0x1d3762,_0x386e6b){_0x386e6b=_0x386e6b||0x1f4;return function(_0x2e7b94){logger[_0x3cca('0x25')](_0x2e7b94['stack']);if(_0x2e7b94[_0x3cca('0x26')]){delete _0x2e7b94[_0x3cca('0x26')];}_0x1d3762[_0x3cca('0x19')](_0x386e6b)[_0x3cca('0x27')](_0x2e7b94);};}exports['index']=function(_0x3092ba,_0x205455){var _0x38f899={},_0x269e14={},_0x845917={'count':0x0,'rows':[]};var _0x45039d=_[_0x3cca('0x28')](db['SmsQueueReport']['rawAttributes'],function(_0x3f1e69){return{'name':_0x3f1e69[_0x3cca('0x29')],'type':_0x3f1e69[_0x3cca('0x2a')][_0x3cca('0x2b')]};});_0x269e14['model']=_[_0x3cca('0x28')](_0x45039d,_0x3cca('0x26'));_0x269e14['query']=_[_0x3cca('0x2c')](_0x3092ba[_0x3cca('0x2d')]);_0x269e14[_0x3cca('0x2e')]=_[_0x3cca('0x2f')](_0x269e14[_0x3cca('0x30')],_0x269e14[_0x3cca('0x2d')]);_0x38f899[_0x3cca('0x31')]=_[_0x3cca('0x2f')](_0x269e14[_0x3cca('0x30')],qs['fields'](_0x3092ba[_0x3cca('0x2d')][_0x3cca('0x32')]));_0x38f899['attributes']=_0x38f899[_0x3cca('0x31')][_0x3cca('0x33')]?_0x38f899[_0x3cca('0x31')]:_0x269e14[_0x3cca('0x30')];if(!_0x3092ba[_0x3cca('0x2d')][_0x3cca('0x34')]('nolimit')){_0x38f899[_0x3cca('0x1e')]=qs[_0x3cca('0x1e')](_0x3092ba[_0x3cca('0x2d')][_0x3cca('0x1e')]);_0x38f899[_0x3cca('0x1b')]=qs[_0x3cca('0x1b')](_0x3092ba[_0x3cca('0x2d')][_0x3cca('0x1b')]);}_0x38f899[_0x3cca('0x35')]=qs[_0x3cca('0x36')](_0x3092ba[_0x3cca('0x2d')]['sort']);_0x38f899['where']=qs[_0x3cca('0x2e')](_[_0x3cca('0x37')](_0x3092ba[_0x3cca('0x2d')],_0x269e14[_0x3cca('0x2e')]),_0x45039d);if(_0x3092ba['query'][_0x3cca('0x38')]){_0x38f899['where']=_[_0x3cca('0x39')](_0x38f899[_0x3cca('0x3a')],{'$or':_[_0x3cca('0x28')](_0x45039d,function(_0x551dc7){if(_0x551dc7['type']!=='VIRTUAL'){var _0x50ac0b={};_0x50ac0b[_0x551dc7[_0x3cca('0x26')]]={'$like':'%'+_0x3092ba[_0x3cca('0x2d')][_0x3cca('0x38')]+'%'};return _0x50ac0b;}})});}_0x38f899=_[_0x3cca('0x39')]({},_0x38f899,_0x3092ba[_0x3cca('0x3b')]);var _0x144439={'where':_0x38f899[_0x3cca('0x3a')]};return db[_0x3cca('0x3c')][_0x3cca('0x1d')](_0x144439)[_0x3cca('0x24')](function(_0x177f74){_0x845917[_0x3cca('0x1d')]=_0x177f74;if(_0x3092ba[_0x3cca('0x2d')][_0x3cca('0x3d')]){_0x38f899[_0x3cca('0x3e')]=[{'all':!![]}];}return db[_0x3cca('0x3c')]['findAll'](_0x38f899);})[_0x3cca('0x24')](function(_0x3d7a2c){_0x845917[_0x3cca('0x3f')]=_0x3d7a2c;return _0x845917;})['then'](respondWithFilteredResult(_0x205455,_0x38f899))[_0x3cca('0x40')](handleError(_0x205455,null));};exports[_0x3cca('0x41')]=function(_0x1133e4,_0x8aeedb){var _0x2f8f3d={'raw':!![],'where':{'id':_0x1133e4[_0x3cca('0x42')]['id']}},_0x2231d3={};_0x2231d3[_0x3cca('0x30')]=_[_0x3cca('0x2c')](db['SmsQueueReport']['rawAttributes']);_0x2231d3[_0x3cca('0x2d')]=_[_0x3cca('0x2c')](_0x1133e4[_0x3cca('0x2d')]);_0x2231d3[_0x3cca('0x2e')]=_[_0x3cca('0x2f')](_0x2231d3[_0x3cca('0x30')],_0x2231d3[_0x3cca('0x2d')]);_0x2f8f3d[_0x3cca('0x31')]=_[_0x3cca('0x2f')](_0x2231d3[_0x3cca('0x30')],qs[_0x3cca('0x32')](_0x1133e4['query'][_0x3cca('0x32')]));_0x2f8f3d[_0x3cca('0x31')]=_0x2f8f3d['attributes']['length']?_0x2f8f3d[_0x3cca('0x31')]:_0x2231d3[_0x3cca('0x30')];if(_0x1133e4[_0x3cca('0x2d')][_0x3cca('0x3d')]){_0x2f8f3d['include']=[{'all':!![]}];}_0x2f8f3d=_[_0x3cca('0x39')]({},_0x2f8f3d,_0x1133e4[_0x3cca('0x3b')]);return db['SmsQueueReport']['find'](_0x2f8f3d)[_0x3cca('0x24')](handleEntityNotFound(_0x8aeedb,null))[_0x3cca('0x24')](respondWithResult(_0x8aeedb,null))[_0x3cca('0x40')](handleError(_0x8aeedb,null));};exports[_0x3cca('0x43')]=function(_0x123503,_0x527a4c){return db[_0x3cca('0x3c')][_0x3cca('0x43')](_0x123503[_0x3cca('0x44')],{})[_0x3cca('0x24')](respondWithResult(_0x527a4c,0xc9))[_0x3cca('0x40')](handleError(_0x527a4c,null));};exports[_0x3cca('0x23')]=function(_0x4ece24,_0xf5ac90){if(_0x4ece24['body']['id']){delete _0x4ece24['body']['id'];}return db[_0x3cca('0x3c')][_0x3cca('0x45')]({'where':{'id':_0x4ece24[_0x3cca('0x42')]['id']}})[_0x3cca('0x24')](handleEntityNotFound(_0xf5ac90,null))[_0x3cca('0x24')](saveUpdates(_0x4ece24[_0x3cca('0x44')],null))[_0x3cca('0x24')](respondWithResult(_0xf5ac90,null))[_0x3cca('0x40')](handleError(_0xf5ac90,null));};exports[_0x3cca('0x46')]=function(_0x1b993e,_0x3f89d1){return db['SmsQueueReport'][_0x3cca('0x45')]({'where':{'id':_0x1b993e[_0x3cca('0x42')]['id']}})[_0x3cca('0x24')](handleEntityNotFound(_0x3f89d1,null))[_0x3cca('0x24')](removeEntity(_0x3f89d1,null))[_0x3cca('0x40')](handleError(_0x3f89d1,null));};exports[_0x3cca('0x47')]=function(_0x434680,_0x102b12){return db[_0x3cca('0x3c')][_0x3cca('0x47')]()['then'](respondWithResult(_0x102b12,null))[_0x3cca('0x40')](handleError(_0x102b12,null));}; \ No newline at end of file +var _0x0201=['error','stack','name','send','index','map','SmsQueueReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','then','includeAll','rows','catch','show','params','keys','length','include','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x58c567,_0x437a3b){var _0x59cb6e=function(_0x43802b){while(--_0x43802b){_0x58c567['push'](_0x58c567['shift']());}};_0x59cb6e(++_0x437a3b);}(_0x0201,0x123));var _0x1020=function(_0x4d50ab,_0x35ed55){_0x4d50ab=_0x4d50ab-0x0;var _0x55c39a=_0x0201[_0x4d50ab];return _0x55c39a;};'use strict';var emlformat=require(_0x1020('0x0'));var rimraf=require(_0x1020('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1020('0x2'));var rp=require(_0x1020('0x3'));var moment=require(_0x1020('0x4'));var BPromise=require(_0x1020('0x5'));var Mustache=require(_0x1020('0x6'));var util=require(_0x1020('0x7'));var path=require(_0x1020('0x8'));var sox=require(_0x1020('0x9'));var csv=require(_0x1020('0xa'));var ejs=require(_0x1020('0xb'));var fs=require('fs');var fs_extra=require(_0x1020('0xc'));var _=require(_0x1020('0xd'));var squel=require('squel');var crypto=require(_0x1020('0xe'));var jsforce=require(_0x1020('0xf'));var deskjs=require(_0x1020('0x10'));var toCsv=require(_0x1020('0xa'));var querystring=require(_0x1020('0x11'));var Papa=require(_0x1020('0x12'));var Redis=require(_0x1020('0x13'));var authService=require(_0x1020('0x14'));var qs=require(_0x1020('0x15'));var as=require(_0x1020('0x16'));var hardwareService=require(_0x1020('0x17'));var logger=require(_0x1020('0x18'))(_0x1020('0x19'));var utils=require(_0x1020('0x1a'));var config=require(_0x1020('0x1b'));var licenseUtil=require(_0x1020('0x1c'));var db=require(_0x1020('0x1d'))['db'];function respondWithStatusCode(_0xa38f86,_0x4807bd){_0x4807bd=_0x4807bd||0xcc;return function(_0x5c4cf3){if(_0x5c4cf3){return _0xa38f86[_0x1020('0x1e')](_0x4807bd);}return _0xa38f86[_0x1020('0x1f')](_0x4807bd)[_0x1020('0x20')]();};}function respondWithResult(_0x304e19,_0x127fb6){_0x127fb6=_0x127fb6||0xc8;return function(_0x343e33){if(_0x343e33){return _0x304e19[_0x1020('0x1f')](_0x127fb6)[_0x1020('0x21')](_0x343e33);}};}function respondWithFilteredResult(_0x300bea,_0x421b81){return function(_0x3a80e6){if(_0x3a80e6){var _0x563a6a=typeof _0x421b81['offset']===_0x1020('0x22')&&typeof _0x421b81[_0x1020('0x23')]==='undefined';var _0x54cd89=_0x3a80e6['count'];var _0x3eca43=_0x563a6a?0x0:_0x421b81[_0x1020('0x24')];var _0x10b62a=_0x563a6a?_0x3a80e6[_0x1020('0x25')]:_0x421b81['offset']+_0x421b81['limit'];var _0x2ab7b5;if(_0x10b62a>=_0x54cd89){_0x10b62a=_0x54cd89;_0x2ab7b5=0xc8;}else{_0x2ab7b5=0xce;}_0x300bea['status'](_0x2ab7b5);return _0x300bea[_0x1020('0x26')](_0x1020('0x27'),_0x3eca43+'-'+_0x10b62a+'/'+_0x54cd89)[_0x1020('0x21')](_0x3a80e6);}return null;};}function patchUpdates(_0x421d1f){return function(_0xc10396){try{jsonpatch[_0x1020('0x28')](_0xc10396,_0x421d1f,!![]);}catch(_0x45e74c){return BPromise[_0x1020('0x29')](_0x45e74c);}return _0xc10396[_0x1020('0x2a')]();};}function saveUpdates(_0x57b510,_0xb68b7){return function(_0x46abd9){if(_0x46abd9){return _0x46abd9[_0x1020('0x2b')](_0x57b510)['then'](function(_0x321ea4){return _0x321ea4;});}return null;};}function removeEntity(_0x34fc61,_0x16f61c){return function(_0x5aaef0){if(_0x5aaef0){return _0x5aaef0[_0x1020('0x2c')]()['then'](function(){_0x34fc61[_0x1020('0x1f')](0xcc)[_0x1020('0x20')]();});}};}function handleEntityNotFound(_0x45238a,_0x295d6e){return function(_0x502970){if(!_0x502970){_0x45238a[_0x1020('0x1e')](0x194);}return _0x502970;};}function handleError(_0x268453,_0x208e1a){_0x208e1a=_0x208e1a||0x1f4;return function(_0x45bb20){logger[_0x1020('0x2d')](_0x45bb20[_0x1020('0x2e')]);if(_0x45bb20[_0x1020('0x2f')]){delete _0x45bb20[_0x1020('0x2f')];}_0x268453[_0x1020('0x1f')](_0x208e1a)[_0x1020('0x30')](_0x45bb20);};}exports[_0x1020('0x31')]=function(_0x2ac924,_0x4b29e4){var _0x255153={},_0x38f355={},_0x50ff65={'count':0x0,'rows':[]};var _0x1cb87f=_[_0x1020('0x32')](db[_0x1020('0x33')][_0x1020('0x34')],function(_0x259f90){return{'name':_0x259f90['fieldName'],'type':_0x259f90['type'][_0x1020('0x35')]};});_0x38f355[_0x1020('0x36')]=_['map'](_0x1cb87f,_0x1020('0x2f'));_0x38f355[_0x1020('0x37')]=_['keys'](_0x2ac924[_0x1020('0x37')]);_0x38f355[_0x1020('0x38')]=_[_0x1020('0x39')](_0x38f355['model'],_0x38f355[_0x1020('0x37')]);_0x255153[_0x1020('0x3a')]=_[_0x1020('0x39')](_0x38f355[_0x1020('0x36')],qs[_0x1020('0x3b')](_0x2ac924[_0x1020('0x37')][_0x1020('0x3b')]));_0x255153[_0x1020('0x3a')]=_0x255153[_0x1020('0x3a')]['length']?_0x255153[_0x1020('0x3a')]:_0x38f355[_0x1020('0x36')];if(!_0x2ac924['query'][_0x1020('0x3c')](_0x1020('0x3d'))){_0x255153[_0x1020('0x23')]=qs['limit'](_0x2ac924[_0x1020('0x37')][_0x1020('0x23')]);_0x255153[_0x1020('0x24')]=qs['offset'](_0x2ac924[_0x1020('0x37')]['offset']);}_0x255153[_0x1020('0x3e')]=qs[_0x1020('0x3f')](_0x2ac924[_0x1020('0x37')]['sort']);_0x255153[_0x1020('0x40')]=qs[_0x1020('0x38')](_[_0x1020('0x41')](_0x2ac924[_0x1020('0x37')],_0x38f355[_0x1020('0x38')]),_0x1cb87f);if(_0x2ac924[_0x1020('0x37')]['filter']){_0x255153[_0x1020('0x40')]=_[_0x1020('0x42')](_0x255153['where'],{'$or':_[_0x1020('0x32')](_0x1cb87f,function(_0x30199e){if(_0x30199e[_0x1020('0x43')]!==_0x1020('0x44')){var _0x9d0fbf={};_0x9d0fbf[_0x30199e['name']]={'$like':'%'+_0x2ac924[_0x1020('0x37')][_0x1020('0x45')]+'%'};return _0x9d0fbf;}})});}_0x255153=_[_0x1020('0x42')]({},_0x255153,_0x2ac924[_0x1020('0x46')]);var _0x2d8a21={'where':_0x255153[_0x1020('0x40')]};return db['SmsQueueReport'][_0x1020('0x25')](_0x2d8a21)[_0x1020('0x47')](function(_0x14eaa1){_0x50ff65[_0x1020('0x25')]=_0x14eaa1;if(_0x2ac924[_0x1020('0x37')][_0x1020('0x48')]){_0x255153['include']=[{'all':!![]}];}return db[_0x1020('0x33')]['findAll'](_0x255153);})['then'](function(_0x31caa8){_0x50ff65[_0x1020('0x49')]=_0x31caa8;return _0x50ff65;})[_0x1020('0x47')](respondWithFilteredResult(_0x4b29e4,_0x255153))[_0x1020('0x4a')](handleError(_0x4b29e4,null));};exports[_0x1020('0x4b')]=function(_0x3ed3ef,_0x3aca2d){var _0x32d5db={'raw':!![],'where':{'id':_0x3ed3ef[_0x1020('0x4c')]['id']}},_0x4071d9={};_0x4071d9['model']=_[_0x1020('0x4d')](db[_0x1020('0x33')][_0x1020('0x34')]);_0x4071d9['query']=_['keys'](_0x3ed3ef[_0x1020('0x37')]);_0x4071d9[_0x1020('0x38')]=_[_0x1020('0x39')](_0x4071d9[_0x1020('0x36')],_0x4071d9['query']);_0x32d5db['attributes']=_[_0x1020('0x39')](_0x4071d9[_0x1020('0x36')],qs[_0x1020('0x3b')](_0x3ed3ef['query'][_0x1020('0x3b')]));_0x32d5db['attributes']=_0x32d5db[_0x1020('0x3a')][_0x1020('0x4e')]?_0x32d5db[_0x1020('0x3a')]:_0x4071d9[_0x1020('0x36')];if(_0x3ed3ef[_0x1020('0x37')]['includeAll']){_0x32d5db[_0x1020('0x4f')]=[{'all':!![]}];}_0x32d5db=_[_0x1020('0x42')]({},_0x32d5db,_0x3ed3ef[_0x1020('0x46')]);return db['SmsQueueReport']['find'](_0x32d5db)[_0x1020('0x47')](handleEntityNotFound(_0x3aca2d,null))[_0x1020('0x47')](respondWithResult(_0x3aca2d,null))[_0x1020('0x4a')](handleError(_0x3aca2d,null));};exports[_0x1020('0x50')]=function(_0x171bbd,_0x24d684){return db[_0x1020('0x33')][_0x1020('0x50')](_0x171bbd[_0x1020('0x51')],{})[_0x1020('0x47')](respondWithResult(_0x24d684,0xc9))['catch'](handleError(_0x24d684,null));};exports[_0x1020('0x2b')]=function(_0x299867,_0x4ebca0){if(_0x299867[_0x1020('0x51')]['id']){delete _0x299867[_0x1020('0x51')]['id'];}return db['SmsQueueReport'][_0x1020('0x52')]({'where':{'id':_0x299867['params']['id']}})[_0x1020('0x47')](handleEntityNotFound(_0x4ebca0,null))[_0x1020('0x47')](saveUpdates(_0x299867[_0x1020('0x51')],null))[_0x1020('0x47')](respondWithResult(_0x4ebca0,null))[_0x1020('0x4a')](handleError(_0x4ebca0,null));};exports['destroy']=function(_0x4008ef,_0x18413b){return db[_0x1020('0x33')]['find']({'where':{'id':_0x4008ef[_0x1020('0x4c')]['id']}})['then'](handleEntityNotFound(_0x18413b,null))[_0x1020('0x47')](removeEntity(_0x18413b,null))[_0x1020('0x4a')](handleError(_0x18413b,null));};exports[_0x1020('0x53')]=function(_0x469e7c,_0x474a67){return db[_0x1020('0x33')][_0x1020('0x53')]()[_0x1020('0x47')](respondWithResult(_0x474a67,null))[_0x1020('0x4a')](handleError(_0x474a67,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 9d7f9f3..c317ac1 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x27d443,_0x4ee5ec){var _0x21b822=function(_0x4c6296){while(--_0x4c6296){_0x27d443['push'](_0x27d443['shift']());}};_0x21b822(++_0x4ee5ec);}(_0xe706,0xa3));var _0x6e70=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0xe706[_0x44216d];return _0xeca523;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x21ae22,_0x54911f){var _0x1e610a=function(_0x1d2cef){while(--_0x1d2cef){_0x21ae22['push'](_0x21ae22['shift']());}};_0x1e610a(++_0x54911f);}(_0xe706,0xa3));var _0x6e70=function(_0x4fde9a,_0x5d1eda){_0x4fde9a=_0x4fde9a-0x0;var _0x58f321=_0xe706[_0x4fde9a];return _0x58f321;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index a05b4d0..d2e84c7 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 _0xfb91=['UpdateSmsQueueReport','update','where','limit','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','body','options','raw','catch'];(function(_0x5eb868,_0x3edfb0){var _0x278458=function(_0x266273){while(--_0x266273){_0x5eb868['push'](_0x5eb868['shift']());}};_0x278458(++_0x3edfb0);}(_0xfb91,0xe5));var _0x1fb9=function(_0x247090,_0x48c119){_0x247090=_0x247090-0x0;var _0x31696b=_0xfb91[_0x247090];return _0x31696b;};'use strict';var _=require(_0x1fb9('0x0'));var util=require(_0x1fb9('0x1'));var moment=require('moment');var BPromise=require(_0x1fb9('0x2'));var rs=require(_0x1fb9('0x3'));var fs=require('fs');var Redis=require(_0x1fb9('0x4'));var db=require(_0x1fb9('0x5'))['db'];var utils=require(_0x1fb9('0x6'));var logger=require(_0x1fb9('0x7'))(_0x1fb9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1fb9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x208a87,_0x23c11d,_0x3b458d){return new BPromise(function(_0x2e43a7,_0x2daa4d){return client[_0x1fb9('0xa')](_0x208a87,_0x3b458d)['then'](function(_0x4d6dc8){logger[_0x1fb9('0xb')](_0x1fb9('0xc'),_0x23c11d,'request\x20sent');logger[_0x1fb9('0xd')](_0x1fb9('0xe'),_0x23c11d,_0x1fb9('0xf'),JSON[_0x1fb9('0x10')](_0x4d6dc8));if(_0x4d6dc8[_0x1fb9('0x11')]){if(_0x4d6dc8['error'][_0x1fb9('0x12')]===0x1f4){logger[_0x1fb9('0x11')](_0x1fb9('0xc'),_0x23c11d,_0x4d6dc8[_0x1fb9('0x11')]['message']);return _0x2daa4d(_0x4d6dc8[_0x1fb9('0x11')][_0x1fb9('0x13')]);}logger[_0x1fb9('0x11')](_0x1fb9('0xc'),_0x23c11d,_0x4d6dc8[_0x1fb9('0x11')][_0x1fb9('0x13')]);return _0x2e43a7(_0x4d6dc8[_0x1fb9('0x11')][_0x1fb9('0x13')]);}else{logger['info'](_0x1fb9('0xc'),_0x23c11d,'request\x20sent');_0x2e43a7(_0x4d6dc8[_0x1fb9('0x14')][_0x1fb9('0x13')]);}})['catch'](function(_0x130339){logger[_0x1fb9('0x11')](_0x1fb9('0xc'),_0x23c11d,_0x130339);_0x2daa4d(_0x130339);});});}exports[_0x1fb9('0x15')]=function(_0x57e64c){var _0x34c1a3=this;return new Promise(function(_0x4d6fbc,_0x446530){return db[_0x1fb9('0x16')]['create'](_0x57e64c[_0x1fb9('0x17')],{'raw':_0x57e64c[_0x1fb9('0x18')]?_0x57e64c[_0x1fb9('0x18')][_0x1fb9('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5a09d3){logger[_0x1fb9('0xb')](_0x1fb9('0x15'),_0x57e64c);logger[_0x1fb9('0xd')](_0x1fb9('0x15'),_0x57e64c,JSON['stringify'](_0x5a09d3));_0x4d6fbc(_0x5a09d3);})[_0x1fb9('0x1a')](function(_0xb9e56e){logger[_0x1fb9('0x11')](_0x1fb9('0x15'),_0xb9e56e[_0x1fb9('0x13')],_0x57e64c);_0x446530(_0x34c1a3[_0x1fb9('0x11')](0x1f4,_0xb9e56e[_0x1fb9('0x13')]));});});};exports[_0x1fb9('0x1b')]=function(_0x4cde44){var _0x365036=this;return new Promise(function(_0x19a83c,_0x2f11c6){return db[_0x1fb9('0x16')][_0x1fb9('0x1c')](_0x4cde44[_0x1fb9('0x17')],{'raw':_0x4cde44['options']?_0x4cde44[_0x1fb9('0x18')][_0x1fb9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cde44[_0x1fb9('0x18')]?_0x4cde44['options'][_0x1fb9('0x1d')]||null:null,'attributes':_0x4cde44['options']?_0x4cde44[_0x1fb9('0x18')]['attributes']||null:null,'limit':_0x4cde44['options']?_0x4cde44[_0x1fb9('0x18')][_0x1fb9('0x1e')]||null:null})[_0x1fb9('0x1f')](function(_0x564e66){logger[_0x1fb9('0xb')](_0x1fb9('0x1b'),_0x4cde44);logger[_0x1fb9('0xd')](_0x1fb9('0x1b'),_0x4cde44,JSON[_0x1fb9('0x10')](_0x564e66));_0x19a83c(_0x564e66);})[_0x1fb9('0x1a')](function(_0x59499a){logger[_0x1fb9('0x11')]('UpdateSmsQueueReport',_0x59499a['message'],_0x4cde44);_0x2f11c6(_0x365036[_0x1fb9('0x11')](0x1f4,_0x59499a[_0x1fb9('0x13')]));});});}; \ No newline at end of file +var _0xce1e=['UpdateSmsQueueReport','update','body','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','result','catch','SmsQueueReport','create','options','CreateSmsQueueReport'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0xce1e,0xac));var _0xece1=function(_0x187a7c,_0x95c10e){_0x187a7c=_0x187a7c-0x0;var _0x564efe=_0xce1e[_0x187a7c];return _0x564efe;};'use strict';var _=require(_0xece1('0x0'));var util=require('util');var moment=require(_0xece1('0x1'));var BPromise=require(_0xece1('0x2'));var rs=require(_0xece1('0x3'));var fs=require('fs');var Redis=require(_0xece1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xece1('0x5'))(_0xece1('0x6'));var config=require(_0xece1('0x7'));var jayson=require(_0xece1('0x8'));var client=jayson['client'][_0xece1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x561a08,_0x6f7811,_0x10be92){return new BPromise(function(_0x32af7c,_0x5745ea){return client[_0xece1('0xa')](_0x561a08,_0x10be92)[_0xece1('0xb')](function(_0xd69f13){logger[_0xece1('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x6f7811,_0xece1('0xd'));logger[_0xece1('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x6f7811,_0xece1('0xd'),JSON[_0xece1('0xf')](_0xd69f13));if(_0xd69f13[_0xece1('0x10')]){if(_0xd69f13[_0xece1('0x10')][_0xece1('0x11')]===0x1f4){logger['error'](_0xece1('0x12'),_0x6f7811,_0xd69f13[_0xece1('0x10')][_0xece1('0x13')]);return _0x5745ea(_0xd69f13[_0xece1('0x10')][_0xece1('0x13')]);}logger[_0xece1('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x6f7811,_0xd69f13['error']['message']);return _0x32af7c(_0xd69f13['error'][_0xece1('0x13')]);}else{logger[_0xece1('0xc')](_0xece1('0x12'),_0x6f7811,_0xece1('0xd'));_0x32af7c(_0xd69f13[_0xece1('0x14')][_0xece1('0x13')]);}})[_0xece1('0x15')](function(_0x3ce58d){logger[_0xece1('0x10')](_0xece1('0x12'),_0x6f7811,_0x3ce58d);_0x5745ea(_0x3ce58d);});});}exports['CreateSmsQueueReport']=function(_0x55cad5){var _0x15cff9=this;return new Promise(function(_0x26ce10,_0x44706f){return db[_0xece1('0x16')][_0xece1('0x17')](_0x55cad5['body'],{'raw':_0x55cad5[_0xece1('0x18')]?_0x55cad5[_0xece1('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xece1('0xb')](function(_0x266f8d){logger[_0xece1('0xc')](_0xece1('0x19'),_0x55cad5);logger[_0xece1('0xe')](_0xece1('0x19'),_0x55cad5,JSON[_0xece1('0xf')](_0x266f8d));_0x26ce10(_0x266f8d);})[_0xece1('0x15')](function(_0x4ff27c){logger['error'](_0xece1('0x19'),_0x4ff27c[_0xece1('0x13')],_0x55cad5);_0x44706f(_0x15cff9[_0xece1('0x10')](0x1f4,_0x4ff27c[_0xece1('0x13')]));});});};exports[_0xece1('0x1a')]=function(_0x4a4af7){var _0x3b6b87=this;return new Promise(function(_0x5a79ac,_0x43998c){return db['SmsQueueReport'][_0xece1('0x1b')](_0x4a4af7[_0xece1('0x1c')],{'raw':_0x4a4af7[_0xece1('0x18')]?_0x4a4af7[_0xece1('0x18')][_0xece1('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a4af7[_0xece1('0x18')]?_0x4a4af7[_0xece1('0x18')][_0xece1('0x1e')]||null:null,'attributes':_0x4a4af7[_0xece1('0x18')]?_0x4a4af7['options'][_0xece1('0x1f')]||null:null,'limit':_0x4a4af7['options']?_0x4a4af7[_0xece1('0x18')][_0xece1('0x20')]||null:null})[_0xece1('0xb')](function(_0xec9ab2){logger['info'](_0xece1('0x1a'),_0x4a4af7);logger[_0xece1('0xe')](_0xece1('0x1a'),_0x4a4af7,JSON[_0xece1('0xf')](_0xec9ab2));_0x5a79ac(_0xec9ab2);})[_0xece1('0x15')](function(_0x4e9336){logger[_0xece1('0x10')](_0xece1('0x1a'),_0x4e9336[_0xece1('0x13')],_0x4a4af7);_0x43998c(_0x3b6b87['error'](0x1f4,_0x4e9336['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index bac778c..423ed49 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 _0x3e74=['get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsTransferReport.controller'];(function(_0x790467,_0x496fd6){var _0x4bdcae=function(_0x2b0421){while(--_0x2b0421){_0x790467['push'](_0x790467['shift']());}};_0x4bdcae(++_0x496fd6);}(_0x3e74,0x175));var _0x43e7=function(_0x20f547,_0x37b575){_0x20f547=_0x20f547-0x0;var _0x5812ea=_0x3e74[_0x20f547];return _0x5812ea;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['update']);router[_0x43e7('0x10')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0x11')]);module[_0x43e7('0x12')]=router; \ No newline at end of file +var _0xce50=['index','describe','/:id','show','post','create','update','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated'];(function(_0x910b22,_0x57e873){var _0x1f594d=function(_0x19dfa3){while(--_0x19dfa3){_0x910b22['push'](_0x910b22['shift']());}};_0x1f594d(++_0x57e873);}(_0xce50,0x1d8));var _0x0ce5=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xce50[_0x1ccdf7];return _0x52a0ae;};'use strict';var multer=require('multer');var util=require(_0x0ce5('0x0'));var path=require(_0x0ce5('0x1'));var timeout=require(_0x0ce5('0x2'));var express=require(_0x0ce5('0x3'));var router=express[_0x0ce5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0ce5('0x5'));var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0x0ce5('0x6')]('/',auth[_0x0ce5('0x7')](),controller[_0x0ce5('0x8')]);router[_0x0ce5('0x6')]('/describe',auth[_0x0ce5('0x7')](),controller[_0x0ce5('0x9')]);router['get'](_0x0ce5('0xa'),auth['isAuthenticated'](),controller[_0x0ce5('0xb')]);router[_0x0ce5('0xc')]('/',auth[_0x0ce5('0x7')](),controller[_0x0ce5('0xd')]);router['put'](_0x0ce5('0xa'),auth[_0x0ce5('0x7')](),controller[_0x0ce5('0xe')]);router[_0x0ce5('0xf')](_0x0ce5('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 93f2f7b..d7e7be7 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x42dd22,_0x24d2d7){var _0x1cd42a=function(_0x116de6){while(--_0x116de6){_0x42dd22['push'](_0x42dd22['shift']());}};_0x1cd42a(++_0x24d2d7);}(_0x70e0,0x17b));var _0x070e=function(_0xddb8b5,_0x2a3af0){_0xddb8b5=_0xddb8b5-0x0;var _0x9d9d9e=_0x70e0[_0xddb8b5];return _0x9d9d9e;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x59a53d,_0x7e804f){var _0x2ac072=function(_0x1991e4){while(--_0x1991e4){_0x59a53d['push'](_0x59a53d['shift']());}};_0x2ac072(++_0x7e804f);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2a7b12,_0x29db70){_0x2a7b12=_0x2a7b12-0x0;var _0x23df84=_0xf4eb[_0x2a7b12];return _0x23df84;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 1c47ecc..f071515 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 _0x5718=['end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','key','map','keys','query','filters','intersection','model','fields','attributes','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','params','SmsTransferReport','length','options','find','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5e53ae,_0x24af4f){var _0x27a8a2=function(_0xa6a715){while(--_0xa6a715){_0x5e53ae['push'](_0x5e53ae['shift']());}};_0x27a8a2(++_0x24af4f);}(_0x5718,0xc2));var _0x8571=function(_0x5858f3,_0x2c5430){_0x5858f3=_0x5858f3-0x0;var _0x2abeda=_0x5718[_0x5858f3];return _0x2abeda;};'use strict';var emlformat=require(_0x8571('0x0'));var rimraf=require(_0x8571('0x1'));var zipdir=require(_0x8571('0x2'));var jsonpatch=require(_0x8571('0x3'));var rp=require(_0x8571('0x4'));var moment=require(_0x8571('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8571('0x6'));var util=require(_0x8571('0x7'));var path=require(_0x8571('0x8'));var sox=require(_0x8571('0x9'));var csv=require(_0x8571('0xa'));var ejs=require(_0x8571('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8571('0xc'));var squel=require(_0x8571('0xd'));var crypto=require(_0x8571('0xe'));var jsforce=require(_0x8571('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8571('0xa'));var querystring=require(_0x8571('0x10'));var Papa=require(_0x8571('0x11'));var Redis=require(_0x8571('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8571('0x13'));var hardwareService=require(_0x8571('0x14'));var logger=require(_0x8571('0x15'))(_0x8571('0x16'));var utils=require(_0x8571('0x17'));var config=require(_0x8571('0x18'));var licenseUtil=require(_0x8571('0x19'));var db=require(_0x8571('0x1a'))['db'];function respondWithStatusCode(_0x504e3b,_0x489d63){_0x489d63=_0x489d63||0xcc;return function(_0x34fd45){if(_0x34fd45){return _0x504e3b[_0x8571('0x1b')](_0x489d63);}return _0x504e3b['status'](_0x489d63)[_0x8571('0x1c')]();};}function respondWithResult(_0x5ee125,_0xce656b){_0xce656b=_0xce656b||0xc8;return function(_0x31b71d){if(_0x31b71d){return _0x5ee125[_0x8571('0x1d')](_0xce656b)[_0x8571('0x1e')](_0x31b71d);}};}function respondWithFilteredResult(_0x2903b1,_0x3cb682){return function(_0x57beef){if(_0x57beef){var _0x4c9666=typeof _0x3cb682[_0x8571('0x1f')]===_0x8571('0x20')&&typeof _0x3cb682[_0x8571('0x21')]===_0x8571('0x20');var _0x394195=_0x57beef[_0x8571('0x22')];var _0x21dfda=_0x4c9666?0x0:_0x3cb682['offset'];var _0x137265=_0x4c9666?_0x57beef[_0x8571('0x22')]:_0x3cb682[_0x8571('0x1f')]+_0x3cb682[_0x8571('0x21')];var _0x4dca82;if(_0x137265>=_0x394195){_0x137265=_0x394195;_0x4dca82=0xc8;}else{_0x4dca82=0xce;}_0x2903b1[_0x8571('0x1d')](_0x4dca82);return _0x2903b1['set'](_0x8571('0x23'),_0x21dfda+'-'+_0x137265+'/'+_0x394195)[_0x8571('0x1e')](_0x57beef);}return null;};}function patchUpdates(_0x4f63c2){return function(_0x38df9d){try{jsonpatch[_0x8571('0x24')](_0x38df9d,_0x4f63c2,!![]);}catch(_0x19001e){return BPromise['reject'](_0x19001e);}return _0x38df9d[_0x8571('0x25')]();};}function saveUpdates(_0x1d2e43,_0x5c075b){return function(_0x105c42){if(_0x105c42){return _0x105c42[_0x8571('0x26')](_0x1d2e43)[_0x8571('0x27')](function(_0x3f65f5){return _0x3f65f5;});}return null;};}function removeEntity(_0x3c9e77,_0x424205){return function(_0x4e53f8){if(_0x4e53f8){return _0x4e53f8[_0x8571('0x28')]()[_0x8571('0x27')](function(){_0x3c9e77[_0x8571('0x1d')](0xcc)[_0x8571('0x1c')]();});}};}function handleEntityNotFound(_0x28ad5e,_0x38041e){return function(_0x345452){if(!_0x345452){_0x28ad5e[_0x8571('0x1b')](0x194);}return _0x345452;};}function handleError(_0x75146e,_0x9f813d){_0x9f813d=_0x9f813d||0x1f4;return function(_0x5054f5){logger[_0x8571('0x29')](_0x5054f5[_0x8571('0x2a')]);if(_0x5054f5[_0x8571('0x2b')]){delete _0x5054f5['name'];}_0x75146e[_0x8571('0x1d')](_0x9f813d)[_0x8571('0x2c')](_0x5054f5);};}exports[_0x8571('0x2d')]=function(_0x5151f9,_0x108340){var _0x16643e={},_0x2d81ee={},_0x237943={'count':0x0,'rows':[]};var _0xbfdd33=_['map'](db['SmsTransferReport'][_0x8571('0x2e')],function(_0x5c1b23){return{'name':_0x5c1b23['fieldName'],'type':_0x5c1b23['type'][_0x8571('0x2f')]};});_0x2d81ee['model']=_[_0x8571('0x30')](_0xbfdd33,_0x8571('0x2b'));_0x2d81ee['query']=_[_0x8571('0x31')](_0x5151f9[_0x8571('0x32')]);_0x2d81ee[_0x8571('0x33')]=_[_0x8571('0x34')](_0x2d81ee['model'],_0x2d81ee[_0x8571('0x32')]);_0x16643e['attributes']=_['intersection'](_0x2d81ee[_0x8571('0x35')],qs['fields'](_0x5151f9[_0x8571('0x32')][_0x8571('0x36')]));_0x16643e[_0x8571('0x37')]=_0x16643e[_0x8571('0x37')]['length']?_0x16643e[_0x8571('0x37')]:_0x2d81ee[_0x8571('0x35')];if(!_0x5151f9['query']['hasOwnProperty']('nolimit')){_0x16643e['limit']=qs[_0x8571('0x21')](_0x5151f9[_0x8571('0x32')][_0x8571('0x21')]);_0x16643e[_0x8571('0x1f')]=qs[_0x8571('0x1f')](_0x5151f9[_0x8571('0x32')][_0x8571('0x1f')]);}_0x16643e[_0x8571('0x38')]=qs[_0x8571('0x39')](_0x5151f9[_0x8571('0x32')]['sort']);_0x16643e[_0x8571('0x3a')]=qs[_0x8571('0x33')](_[_0x8571('0x3b')](_0x5151f9[_0x8571('0x32')],_0x2d81ee[_0x8571('0x33')]),_0xbfdd33);if(_0x5151f9['query'][_0x8571('0x3c')]){_0x16643e[_0x8571('0x3a')]=_[_0x8571('0x3d')](_0x16643e[_0x8571('0x3a')],{'$or':_['map'](_0xbfdd33,function(_0x3854bc){if(_0x3854bc['type']!=='VIRTUAL'){var _0x273d17={};_0x273d17[_0x3854bc[_0x8571('0x2b')]]={'$like':'%'+_0x5151f9[_0x8571('0x32')]['filter']+'%'};return _0x273d17;}})});}_0x16643e=_['merge']({},_0x16643e,_0x5151f9['options']);var _0x113b82={'where':_0x16643e['where']};return db['SmsTransferReport']['count'](_0x113b82)[_0x8571('0x27')](function(_0x185930){_0x237943[_0x8571('0x22')]=_0x185930;if(_0x5151f9[_0x8571('0x32')][_0x8571('0x3e')]){_0x16643e[_0x8571('0x3f')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x8571('0x40')](_0x16643e);})['then'](function(_0xd38140){_0x237943[_0x8571('0x41')]=_0xd38140;return _0x237943;})[_0x8571('0x27')](respondWithFilteredResult(_0x108340,_0x16643e))['catch'](handleError(_0x108340,null));};exports['show']=function(_0x5f10c9,_0x1a9589){var _0x359ce9={'raw':!![],'where':{'id':_0x5f10c9[_0x8571('0x42')]['id']}},_0x5f1435={};_0x5f1435[_0x8571('0x35')]=_[_0x8571('0x31')](db[_0x8571('0x43')][_0x8571('0x2e')]);_0x5f1435[_0x8571('0x32')]=_[_0x8571('0x31')](_0x5f10c9[_0x8571('0x32')]);_0x5f1435['filters']=_[_0x8571('0x34')](_0x5f1435['model'],_0x5f1435[_0x8571('0x32')]);_0x359ce9[_0x8571('0x37')]=_[_0x8571('0x34')](_0x5f1435['model'],qs[_0x8571('0x36')](_0x5f10c9[_0x8571('0x32')]['fields']));_0x359ce9[_0x8571('0x37')]=_0x359ce9[_0x8571('0x37')][_0x8571('0x44')]?_0x359ce9['attributes']:_0x5f1435[_0x8571('0x35')];if(_0x5f10c9[_0x8571('0x32')][_0x8571('0x3e')]){_0x359ce9['include']=[{'all':!![]}];}_0x359ce9=_[_0x8571('0x3d')]({},_0x359ce9,_0x5f10c9[_0x8571('0x45')]);return db['SmsTransferReport'][_0x8571('0x46')](_0x359ce9)[_0x8571('0x27')](handleEntityNotFound(_0x1a9589,null))[_0x8571('0x27')](respondWithResult(_0x1a9589,null))['catch'](handleError(_0x1a9589,null));};exports['create']=function(_0x228483,_0x2d634f){return db[_0x8571('0x43')]['create'](_0x228483[_0x8571('0x47')],{})[_0x8571('0x27')](respondWithResult(_0x2d634f,0xc9))[_0x8571('0x48')](handleError(_0x2d634f,null));};exports[_0x8571('0x26')]=function(_0x257310,_0x2a871d){if(_0x257310['body']['id']){delete _0x257310[_0x8571('0x47')]['id'];}return db['SmsTransferReport'][_0x8571('0x46')]({'where':{'id':_0x257310[_0x8571('0x42')]['id']}})['then'](handleEntityNotFound(_0x2a871d,null))[_0x8571('0x27')](saveUpdates(_0x257310[_0x8571('0x47')],null))[_0x8571('0x27')](respondWithResult(_0x2a871d,null))['catch'](handleError(_0x2a871d,null));};exports['destroy']=function(_0x51e138,_0x314bf2){return db[_0x8571('0x43')][_0x8571('0x46')]({'where':{'id':_0x51e138[_0x8571('0x42')]['id']}})[_0x8571('0x27')](handleEntityNotFound(_0x314bf2,null))['then'](removeEntity(_0x314bf2,null))[_0x8571('0x48')](handleError(_0x314bf2,null));};exports[_0x8571('0x49')]=function(_0x45d35e,_0x594314){return db[_0x8571('0x43')][_0x8571('0x49')]()[_0x8571('0x27')](respondWithResult(_0x594314,null))['catch'](handleError(_0x594314,null));}; \ No newline at end of file +var _0xac27=['util','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','SmsTransferReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','rimraf','fast-json-patch','request-promise','moment','mustache'];(function(_0x2de6b9,_0x396c83){var _0x41c57d=function(_0xce0232){while(--_0xce0232){_0x2de6b9['push'](_0x2de6b9['shift']());}};_0x41c57d(++_0x396c83);}(_0xac27,0xd3));var _0x7ac2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xac27[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ac2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ac2('0x1'));var rp=require(_0x7ac2('0x2'));var moment=require(_0x7ac2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7ac2('0x4'));var util=require(_0x7ac2('0x5'));var path=require(_0x7ac2('0x6'));var sox=require(_0x7ac2('0x7'));var csv=require(_0x7ac2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ac2('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ac2('0xa'));var deskjs=require(_0x7ac2('0xb'));var toCsv=require(_0x7ac2('0x8'));var querystring=require(_0x7ac2('0xc'));var Papa=require('papaparse');var Redis=require(_0x7ac2('0xd'));var authService=require(_0x7ac2('0xe'));var qs=require(_0x7ac2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ac2('0x10'));var logger=require(_0x7ac2('0x11'))('api');var utils=require(_0x7ac2('0x12'));var config=require(_0x7ac2('0x13'));var licenseUtil=require(_0x7ac2('0x14'));var db=require(_0x7ac2('0x15'))['db'];function respondWithStatusCode(_0x4adf00,_0x1bedb5){_0x1bedb5=_0x1bedb5||0xcc;return function(_0x3ff55b){if(_0x3ff55b){return _0x4adf00[_0x7ac2('0x16')](_0x1bedb5);}return _0x4adf00['status'](_0x1bedb5)[_0x7ac2('0x17')]();};}function respondWithResult(_0x331bb1,_0x1aa39f){_0x1aa39f=_0x1aa39f||0xc8;return function(_0x1498f3){if(_0x1498f3){return _0x331bb1[_0x7ac2('0x18')](_0x1aa39f)[_0x7ac2('0x19')](_0x1498f3);}};}function respondWithFilteredResult(_0x4a2ef5,_0x300d38){return function(_0x199129){if(_0x199129){var _0x3f8a2e=typeof _0x300d38[_0x7ac2('0x1a')]===_0x7ac2('0x1b')&&typeof _0x300d38[_0x7ac2('0x1c')]===_0x7ac2('0x1b');var _0x5e589b=_0x199129[_0x7ac2('0x1d')];var _0x11ed1e=_0x3f8a2e?0x0:_0x300d38[_0x7ac2('0x1a')];var _0x42f5ca=_0x3f8a2e?_0x199129[_0x7ac2('0x1d')]:_0x300d38[_0x7ac2('0x1a')]+_0x300d38[_0x7ac2('0x1c')];var _0xd3d428;if(_0x42f5ca>=_0x5e589b){_0x42f5ca=_0x5e589b;_0xd3d428=0xc8;}else{_0xd3d428=0xce;}_0x4a2ef5['status'](_0xd3d428);return _0x4a2ef5[_0x7ac2('0x1e')](_0x7ac2('0x1f'),_0x11ed1e+'-'+_0x42f5ca+'/'+_0x5e589b)['json'](_0x199129);}return null;};}function patchUpdates(_0x4a42a2){return function(_0x87ae44){try{jsonpatch[_0x7ac2('0x20')](_0x87ae44,_0x4a42a2,!![]);}catch(_0x3ba54e){return BPromise[_0x7ac2('0x21')](_0x3ba54e);}return _0x87ae44[_0x7ac2('0x22')]();};}function saveUpdates(_0x59c29c,_0x247f2f){return function(_0x3f3355){if(_0x3f3355){return _0x3f3355[_0x7ac2('0x23')](_0x59c29c)['then'](function(_0x280b10){return _0x280b10;});}return null;};}function removeEntity(_0x570a9b,_0x2db1d6){return function(_0x748a8f){if(_0x748a8f){return _0x748a8f[_0x7ac2('0x24')]()[_0x7ac2('0x25')](function(){_0x570a9b[_0x7ac2('0x18')](0xcc)[_0x7ac2('0x17')]();});}};}function handleEntityNotFound(_0x506bb9,_0x161d34){return function(_0x17a1ee){if(!_0x17a1ee){_0x506bb9['sendStatus'](0x194);}return _0x17a1ee;};}function handleError(_0x44a34c,_0x4d69f9){_0x4d69f9=_0x4d69f9||0x1f4;return function(_0x4f2c02){logger[_0x7ac2('0x26')](_0x4f2c02[_0x7ac2('0x27')]);if(_0x4f2c02[_0x7ac2('0x28')]){delete _0x4f2c02['name'];}_0x44a34c[_0x7ac2('0x18')](_0x4d69f9)['send'](_0x4f2c02);};}exports[_0x7ac2('0x29')]=function(_0x403e33,_0x3cd930){var _0x2256c8={},_0x1f1ee6={},_0x550553={'count':0x0,'rows':[]};var _0x54a85c=_['map'](db[_0x7ac2('0x2a')][_0x7ac2('0x2b')],function(_0x41bcc4){return{'name':_0x41bcc4[_0x7ac2('0x2c')],'type':_0x41bcc4[_0x7ac2('0x2d')][_0x7ac2('0x2e')]};});_0x1f1ee6[_0x7ac2('0x2f')]=_['map'](_0x54a85c,_0x7ac2('0x28'));_0x1f1ee6['query']=_[_0x7ac2('0x30')](_0x403e33[_0x7ac2('0x31')]);_0x1f1ee6['filters']=_[_0x7ac2('0x32')](_0x1f1ee6['model'],_0x1f1ee6[_0x7ac2('0x31')]);_0x2256c8[_0x7ac2('0x33')]=_[_0x7ac2('0x32')](_0x1f1ee6[_0x7ac2('0x2f')],qs['fields'](_0x403e33[_0x7ac2('0x31')][_0x7ac2('0x34')]));_0x2256c8['attributes']=_0x2256c8[_0x7ac2('0x33')]['length']?_0x2256c8[_0x7ac2('0x33')]:_0x1f1ee6[_0x7ac2('0x2f')];if(!_0x403e33[_0x7ac2('0x31')][_0x7ac2('0x35')](_0x7ac2('0x36'))){_0x2256c8[_0x7ac2('0x1c')]=qs[_0x7ac2('0x1c')](_0x403e33[_0x7ac2('0x31')][_0x7ac2('0x1c')]);_0x2256c8['offset']=qs['offset'](_0x403e33['query']['offset']);}_0x2256c8[_0x7ac2('0x37')]=qs[_0x7ac2('0x38')](_0x403e33[_0x7ac2('0x31')][_0x7ac2('0x38')]);_0x2256c8['where']=qs['filters'](_['pick'](_0x403e33['query'],_0x1f1ee6[_0x7ac2('0x39')]),_0x54a85c);if(_0x403e33[_0x7ac2('0x31')][_0x7ac2('0x3a')]){_0x2256c8[_0x7ac2('0x3b')]=_[_0x7ac2('0x3c')](_0x2256c8[_0x7ac2('0x3b')],{'$or':_[_0x7ac2('0x3d')](_0x54a85c,function(_0x424a50){if(_0x424a50[_0x7ac2('0x2d')]!==_0x7ac2('0x3e')){var _0x577238={};_0x577238[_0x424a50['name']]={'$like':'%'+_0x403e33[_0x7ac2('0x31')][_0x7ac2('0x3a')]+'%'};return _0x577238;}})});}_0x2256c8=_[_0x7ac2('0x3c')]({},_0x2256c8,_0x403e33[_0x7ac2('0x3f')]);var _0x362261={'where':_0x2256c8['where']};return db['SmsTransferReport'][_0x7ac2('0x1d')](_0x362261)[_0x7ac2('0x25')](function(_0x5c6c56){_0x550553[_0x7ac2('0x1d')]=_0x5c6c56;if(_0x403e33[_0x7ac2('0x31')][_0x7ac2('0x40')]){_0x2256c8[_0x7ac2('0x41')]=[{'all':!![]}];}return db[_0x7ac2('0x2a')][_0x7ac2('0x42')](_0x2256c8);})[_0x7ac2('0x25')](function(_0x905f1c){_0x550553['rows']=_0x905f1c;return _0x550553;})[_0x7ac2('0x25')](respondWithFilteredResult(_0x3cd930,_0x2256c8))[_0x7ac2('0x43')](handleError(_0x3cd930,null));};exports['show']=function(_0x48f777,_0x423dfa){var _0x535384={'raw':!![],'where':{'id':_0x48f777[_0x7ac2('0x44')]['id']}},_0x475c42={};_0x475c42[_0x7ac2('0x2f')]=_[_0x7ac2('0x30')](db[_0x7ac2('0x2a')][_0x7ac2('0x2b')]);_0x475c42[_0x7ac2('0x31')]=_['keys'](_0x48f777[_0x7ac2('0x31')]);_0x475c42[_0x7ac2('0x39')]=_['intersection'](_0x475c42[_0x7ac2('0x2f')],_0x475c42['query']);_0x535384[_0x7ac2('0x33')]=_['intersection'](_0x475c42['model'],qs[_0x7ac2('0x34')](_0x48f777['query'][_0x7ac2('0x34')]));_0x535384['attributes']=_0x535384[_0x7ac2('0x33')]['length']?_0x535384[_0x7ac2('0x33')]:_0x475c42['model'];if(_0x48f777[_0x7ac2('0x31')][_0x7ac2('0x40')]){_0x535384[_0x7ac2('0x41')]=[{'all':!![]}];}_0x535384=_['merge']({},_0x535384,_0x48f777[_0x7ac2('0x3f')]);return db[_0x7ac2('0x2a')][_0x7ac2('0x45')](_0x535384)[_0x7ac2('0x25')](handleEntityNotFound(_0x423dfa,null))[_0x7ac2('0x25')](respondWithResult(_0x423dfa,null))[_0x7ac2('0x43')](handleError(_0x423dfa,null));};exports['create']=function(_0x28e3a5,_0x5b5c15){return db[_0x7ac2('0x2a')][_0x7ac2('0x46')](_0x28e3a5[_0x7ac2('0x47')],{})[_0x7ac2('0x25')](respondWithResult(_0x5b5c15,0xc9))[_0x7ac2('0x43')](handleError(_0x5b5c15,null));};exports[_0x7ac2('0x23')]=function(_0x5c0632,_0x4d8ea7){if(_0x5c0632[_0x7ac2('0x47')]['id']){delete _0x5c0632[_0x7ac2('0x47')]['id'];}return db['SmsTransferReport'][_0x7ac2('0x45')]({'where':{'id':_0x5c0632['params']['id']}})['then'](handleEntityNotFound(_0x4d8ea7,null))[_0x7ac2('0x25')](saveUpdates(_0x5c0632['body'],null))[_0x7ac2('0x25')](respondWithResult(_0x4d8ea7,null))[_0x7ac2('0x43')](handleError(_0x4d8ea7,null));};exports[_0x7ac2('0x24')]=function(_0x1287b1,_0x1194f4){return db['SmsTransferReport'][_0x7ac2('0x45')]({'where':{'id':_0x1287b1[_0x7ac2('0x44')]['id']}})['then'](handleEntityNotFound(_0x1194f4,null))[_0x7ac2('0x25')](removeEntity(_0x1194f4,null))[_0x7ac2('0x43')](handleError(_0x1194f4,null));};exports['describe']=function(_0x33e294,_0x190901){return db[_0x7ac2('0x2a')]['describe']()[_0x7ac2('0x25')](respondWithResult(_0x190901,null))[_0x7ac2('0x43')](handleError(_0x190901,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 1023773..034ab84 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 _0x9c5b=['define','report_sms_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports'];(function(_0x1eba25,_0x434961){var _0x3851c6=function(_0x109248){while(--_0x109248){_0x1eba25['push'](_0x1eba25['shift']());}};_0x3851c6(++_0x434961);}(_0x9c5b,0x1cb));var _0xb9c5=function(_0x1fed24,_0x43cb6b){_0x1fed24=_0x1fed24-0x0;var _0x1cbf4d=_0x9c5b[_0x1fed24];return _0x1cbf4d;};'use strict';var _=require(_0xb9c5('0x0'));var util=require('util');var logger=require(_0xb9c5('0x1'))('api');var moment=require(_0xb9c5('0x2'));var BPromise=require(_0xb9c5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9c5('0x4'));var rimraf=require(_0xb9c5('0x5'));var config=require(_0xb9c5('0x6'));var attributes=require(_0xb9c5('0x7'));module[_0xb9c5('0x8')]=function(_0x4a4dd7,_0x44675b){return _0x4a4dd7[_0xb9c5('0x9')]('SmsTransferReport',attributes,{'tableName':_0xb9c5('0xa'),'paranoid':![],'indexes':[{'name':_0xb9c5('0xb'),'fields':[_0xb9c5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3d6d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x38519b,_0x3bc537){var _0x37ed79=function(_0x4d78df){while(--_0x4d78df){_0x38519b['push'](_0x38519b['shift']());}};_0x37ed79(++_0x3bc537);}(_0x3d6d,0xb3));var _0xd3d6=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0x3d6d[_0x59616b];return _0x5c4523;};'use strict';var _=require(_0xd3d6('0x0'));var util=require(_0xd3d6('0x1'));var logger=require(_0xd3d6('0x2'))(_0xd3d6('0x3'));var moment=require(_0xd3d6('0x4'));var BPromise=require(_0xd3d6('0x5'));var rp=require(_0xd3d6('0x6'));var fs=require('fs');var path=require(_0xd3d6('0x7'));var rimraf=require(_0xd3d6('0x8'));var config=require(_0xd3d6('0x9'));var attributes=require(_0xd3d6('0xa'));module['exports']=function(_0x5400f8,_0x3f36){return _0x5400f8[_0xd3d6('0xb')](_0xd3d6('0xc'),attributes,{'tableName':_0xd3d6('0xd'),'paranoid':![],'indexes':[{'name':_0xd3d6('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 3920673..e0a3098 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 _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x5b1edc,_0xd5fa84){var _0xe44ac8=function(_0x5532bd){while(--_0x5532bd){_0x5b1edc['push'](_0x5b1edc['shift']());}};_0xe44ac8(++_0xd5fa84);}(_0x00bb,0x1d8));var _0xb00b=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x00bb[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file +var _0xcb41=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x3f70cd,_0x6bf4ed){var _0x3feb93=function(_0x4a045a){while(--_0x4a045a){_0x3f70cd['push'](_0x3f70cd['shift']());}};_0x3feb93(++_0x6bf4ed);}(_0xcb41,0x1df));var _0x1cb4=function(_0x4d1a24,_0x38d7e1){_0x4d1a24=_0x4d1a24-0x0;var _0xe3f67a=_0xcb41[_0x4d1a24];return _0xe3f67a;};'use strict';var _=require(_0x1cb4('0x0'));var util=require(_0x1cb4('0x1'));var moment=require(_0x1cb4('0x2'));var BPromise=require(_0x1cb4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cb4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb4('0x5'));var logger=require(_0x1cb4('0x6'))(_0x1cb4('0x7'));var config=require(_0x1cb4('0x8'));var jayson=require(_0x1cb4('0x9'));var client=jayson[_0x1cb4('0xa')][_0x1cb4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42e7fe,_0x4fd3b6,_0x2b51e3){return new BPromise(function(_0x2a5095,_0x50b603){return client[_0x1cb4('0xc')](_0x42e7fe,_0x2b51e3)[_0x1cb4('0xd')](function(_0x26f5ba){logger['info'](_0x1cb4('0xe'),_0x4fd3b6,_0x1cb4('0xf'));logger[_0x1cb4('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x4fd3b6,'request\x20sent',JSON[_0x1cb4('0x11')](_0x26f5ba));if(_0x26f5ba['error']){if(_0x26f5ba[_0x1cb4('0x12')][_0x1cb4('0x13')]===0x1f4){logger[_0x1cb4('0x12')](_0x1cb4('0xe'),_0x4fd3b6,_0x26f5ba[_0x1cb4('0x12')]['message']);return _0x50b603(_0x26f5ba[_0x1cb4('0x12')]['message']);}logger[_0x1cb4('0x12')](_0x1cb4('0xe'),_0x4fd3b6,_0x26f5ba[_0x1cb4('0x12')][_0x1cb4('0x14')]);return _0x2a5095(_0x26f5ba[_0x1cb4('0x12')][_0x1cb4('0x14')]);}else{logger[_0x1cb4('0x15')](_0x1cb4('0xe'),_0x4fd3b6,_0x1cb4('0xf'));_0x2a5095(_0x26f5ba[_0x1cb4('0x16')]['message']);}})[_0x1cb4('0x17')](function(_0x514285){logger[_0x1cb4('0x12')](_0x1cb4('0xe'),_0x4fd3b6,_0x514285);_0x50b603(_0x514285);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index aa8d17b..7e3d16e 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 _0x7f6d=['get','isAuthenticated','index','/:id','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','post','single','file','create','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller'];(function(_0x5985ff,_0x5621a5){var _0x5cbe61=function(_0x3e712b){while(--_0x3e712b){_0x5985ff['push'](_0x5985ff['shift']());}};_0x5cbe61(++_0x5621a5);}(_0x7f6d,0x97));var _0xd7f6=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x7f6d[_0xa148b7];return _0x51efd3;};'use strict';var multer=require(_0xd7f6('0x0'));var util=require(_0xd7f6('0x1'));var path=require(_0xd7f6('0x2'));var timeout=require(_0xd7f6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd7f6('0x4'));var auth=require(_0xd7f6('0x5'));var interaction=require(_0xd7f6('0x6'));var config=require(_0xd7f6('0x7'));var controller=require(_0xd7f6('0x8'));router[_0xd7f6('0x9')]('/',auth[_0xd7f6('0xa')](),controller[_0xd7f6('0xb')]);router[_0xd7f6('0x9')](_0xd7f6('0xc'),auth[_0xd7f6('0xa')](),controller[_0xd7f6('0xd')]);router[_0xd7f6('0x9')]('/:id/download',auth[_0xd7f6('0xa')](),controller[_0xd7f6('0xe')]);var upload=multer({'storage':multer[_0xd7f6('0xf')]({'destination':function(_0x2865c9,_0xb46d95,_0x29e3ce){_0x29e3ce(null,path[_0xd7f6('0x10')](config[_0xd7f6('0x11')],_0xd7f6('0x12')));},'filename':function(_0x2c60ff,_0x5a3f6b,_0x199b13){_0x5a3f6b[_0xd7f6('0x13')]=_0x5a3f6b['originalname'][_0xd7f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x199b13(null,util[_0xd7f6('0x15')](_0xd7f6('0x16'),path['basename'](_0x5a3f6b['originalname'],path[_0xd7f6('0x17')](_0x5a3f6b['originalname'])),Date[_0xd7f6('0x18')](),path['extname'](_0x5a3f6b[_0xd7f6('0x13')])));}})});router[_0xd7f6('0x19')]('/',upload[_0xd7f6('0x1a')](_0xd7f6('0x1b')),controller[_0xd7f6('0x1c')]);router['put'](_0xd7f6('0xc'),auth[_0xd7f6('0xa')](),controller[_0xd7f6('0x1d')]);router[_0xd7f6('0x1e')](_0xd7f6('0xc'),auth[_0xd7f6('0xa')](),controller[_0xd7f6('0x1e')]);module[_0xd7f6('0x1f')]=router; \ No newline at end of file +var _0x6b08=['now','extname','single','file','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','/:id','isAuthenticated','/:id/download','download','diskStorage','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename'];(function(_0x5c45d4,_0x554b6a){var _0x12e79b=function(_0x40ea62){while(--_0x40ea62){_0x5c45d4['push'](_0x5c45d4['shift']());}};_0x12e79b(++_0x554b6a);}(_0x6b08,0x99));var _0x86b0=function(_0x5626e6,_0x30834c){_0x5626e6=_0x5626e6-0x0;var _0x18bb0b=_0x6b08[_0x5626e6];return _0x18bb0b;};'use strict';var multer=require(_0x86b0('0x0'));var util=require(_0x86b0('0x1'));var path=require(_0x86b0('0x2'));var timeout=require(_0x86b0('0x3'));var express=require(_0x86b0('0x4'));var router=express[_0x86b0('0x5')]();var fs_extra=require(_0x86b0('0x6'));var auth=require(_0x86b0('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x86b0('0x8')]('/',auth['isAuthenticated'](),controller[_0x86b0('0x9')]);router['get'](_0x86b0('0xa'),auth[_0x86b0('0xb')](),controller['show']);router[_0x86b0('0x8')](_0x86b0('0xc'),auth[_0x86b0('0xb')](),controller[_0x86b0('0xd')]);var upload=multer({'storage':multer[_0x86b0('0xe')]({'destination':function(_0x40fe2b,_0x4e4486,_0x3227aa){_0x3227aa(null,path['join'](config['root'],_0x86b0('0xf')));},'filename':function(_0xde5ad,_0x1bda6a,_0x110901){_0x1bda6a['originalname']=_0x1bda6a[_0x86b0('0x10')][_0x86b0('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x110901(null,util[_0x86b0('0x12')](_0x86b0('0x13'),path[_0x86b0('0x14')](_0x1bda6a[_0x86b0('0x10')],path['extname'](_0x1bda6a['originalname'])),Date[_0x86b0('0x15')](),path[_0x86b0('0x16')](_0x1bda6a[_0x86b0('0x10')])));}})});router['post']('/',upload[_0x86b0('0x17')](_0x86b0('0x18')),controller['create']);router[_0x86b0('0x19')](_0x86b0('0xa'),auth[_0x86b0('0xb')](),controller[_0x86b0('0x1a')]);router[_0x86b0('0x1b')](_0x86b0('0xa'),auth[_0x86b0('0xb')](),controller['delete']);module[_0x86b0('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 21da832..2e3363f 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 _0xb56f=['exports','STRING','FLOAT','INTEGER','BIGINT','sequelize'];(function(_0x57fe19,_0xa1b632){var _0x3488f7=function(_0xf46cff){while(--_0xf46cff){_0x57fe19['push'](_0x57fe19['shift']());}};_0x3488f7(++_0xa1b632);}(_0xb56f,0x113));var _0xfb56=function(_0x1cb571,_0x581903){_0x1cb571=_0x1cb571-0x0;var _0x5afa85=_0xb56f[_0x1cb571];return _0x5afa85;};'use strict';var Sequelize=require(_0xfb56('0x0'));module[_0xfb56('0x1')]={'name':{'type':Sequelize[_0xfb56('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xfb56('0x2')]},'display_name':{'type':Sequelize[_0xfb56('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xfb56('0x2')]},'original_duration':{'type':Sequelize[_0xfb56('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xfb56('0x4')]},'original_bitRate':{'type':Sequelize[_0xfb56('0x5')]},'original_sampleRate':{'type':Sequelize[_0xfb56('0x4')]},'converted_format':{'type':Sequelize[_0xfb56('0x2')]},'converted_duration':{'type':Sequelize[_0xfb56('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xfb56('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xfb56('0x4')]}}; \ No newline at end of file +var _0xe63c=['BIGINT','STRING','name','FLOAT','INTEGER'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xe63c,0x15f));var _0xce63=function(_0x535bb4,_0x4ef0c7){_0x535bb4=_0x535bb4-0x0;var _0x275848=_0xe63c[_0x535bb4];return _0x275848;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xce63('0x0')],'unique':_0xce63('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xce63('0x0')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xce63('0x0')]},'original_duration':{'type':Sequelize[_0xce63('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xce63('0x3')]},'original_bitRate':{'type':Sequelize[_0xce63('0x4')]},'original_sampleRate':{'type':Sequelize[_0xce63('0x3')]},'converted_format':{'type':Sequelize[_0xce63('0x0')]},'converted_duration':{'type':Sequelize[_0xce63('0x2')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xce63('0x3')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index e1153e1..35358b9 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 _0xf5da=['save','update','then','destroy','get','Sounds','UserProfileResource','error','name','send','index','map','Sound','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','catch','show','params','rawAttributes','keys','options','find','download','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','substring','wav','server/files/sounds/original','filename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_bitRate','converted_sampleRate','0777','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject'];(function(_0x34cd28,_0x5ecccb){var _0x3b8f62=function(_0x13e33e){while(--_0x13e33e){_0x34cd28['push'](_0x34cd28['shift']());}};_0x3b8f62(++_0x5ecccb);}(_0xf5da,0x15e));var _0xaf5d=function(_0x54aea3,_0xae7d81){_0x54aea3=_0x54aea3-0x0;var _0x21ae46=_0xf5da[_0x54aea3];return _0x21ae46;};'use strict';var emlformat=require(_0xaf5d('0x0'));var rimraf=require(_0xaf5d('0x1'));var zipdir=require(_0xaf5d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf5d('0x3'));var moment=require(_0xaf5d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaf5d('0x5'));var util=require(_0xaf5d('0x6'));var path=require(_0xaf5d('0x7'));var sox=require(_0xaf5d('0x8'));var csv=require('to-csv');var ejs=require(_0xaf5d('0x9'));var fs=require('fs');var fs_extra=require(_0xaf5d('0xa'));var _=require(_0xaf5d('0xb'));var squel=require(_0xaf5d('0xc'));var crypto=require(_0xaf5d('0xd'));var jsforce=require(_0xaf5d('0xe'));var deskjs=require(_0xaf5d('0xf'));var toCsv=require(_0xaf5d('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaf5d('0x11'));var authService=require(_0xaf5d('0x12'));var qs=require(_0xaf5d('0x13'));var as=require(_0xaf5d('0x14'));var hardwareService=require(_0xaf5d('0x15'));var logger=require(_0xaf5d('0x16'))('api');var utils=require(_0xaf5d('0x17'));var config=require(_0xaf5d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf5d('0x19'))['db'];function respondWithStatusCode(_0x2d930d,_0x40bfb8){_0x40bfb8=_0x40bfb8||0xcc;return function(_0x228775){if(_0x228775){return _0x2d930d[_0xaf5d('0x1a')](_0x40bfb8);}return _0x2d930d[_0xaf5d('0x1b')](_0x40bfb8)[_0xaf5d('0x1c')]();};}function respondWithResult(_0x70405e,_0xde119c){_0xde119c=_0xde119c||0xc8;return function(_0x1a2758){if(_0x1a2758){return _0x70405e['status'](_0xde119c)[_0xaf5d('0x1d')](_0x1a2758);}};}function respondWithFilteredResult(_0x1fefef,_0x63ecc5){return function(_0x5bd3d9){if(_0x5bd3d9){var _0x20060f=typeof _0x63ecc5[_0xaf5d('0x1e')]===_0xaf5d('0x1f')&&typeof _0x63ecc5[_0xaf5d('0x20')]===_0xaf5d('0x1f');var _0x502299=_0x5bd3d9[_0xaf5d('0x21')];var _0x44379a=_0x20060f?0x0:_0x63ecc5[_0xaf5d('0x1e')];var _0x3c7255=_0x20060f?_0x5bd3d9[_0xaf5d('0x21')]:_0x63ecc5[_0xaf5d('0x1e')]+_0x63ecc5[_0xaf5d('0x20')];var _0x28e397;if(_0x3c7255>=_0x502299){_0x3c7255=_0x502299;_0x28e397=0xc8;}else{_0x28e397=0xce;}_0x1fefef[_0xaf5d('0x1b')](_0x28e397);return _0x1fefef[_0xaf5d('0x22')](_0xaf5d('0x23'),_0x44379a+'-'+_0x3c7255+'/'+_0x502299)['json'](_0x5bd3d9);}return null;};}function patchUpdates(_0x3024e4){return function(_0x54cf72){try{jsonpatch['apply'](_0x54cf72,_0x3024e4,!![]);}catch(_0x27a4ca){return BPromise[_0xaf5d('0x24')](_0x27a4ca);}return _0x54cf72[_0xaf5d('0x25')]();};}function saveUpdates(_0x48f7ef,_0x47de7c){return function(_0xaa7326){if(_0xaa7326){return _0xaa7326[_0xaf5d('0x26')](_0x48f7ef)[_0xaf5d('0x27')](function(_0x7cfd37){return _0x7cfd37;});}return null;};}function removeEntity(_0x11c73d,_0x473fa4){return function(_0x5a7f1d){if(_0x5a7f1d){return _0x5a7f1d[_0xaf5d('0x28')]()[_0xaf5d('0x27')](function(){var _0x14a5a7=_0x5a7f1d[_0xaf5d('0x29')]({'plain':!![]});var _0x25225a=_0xaf5d('0x2a');return db[_0xaf5d('0x2b')][_0xaf5d('0x28')]({'where':{'type':_0x25225a,'resourceId':_0x14a5a7['id']}})[_0xaf5d('0x27')](function(){return _0x5a7f1d;});})[_0xaf5d('0x27')](function(){_0x11c73d[_0xaf5d('0x1b')](0xcc)[_0xaf5d('0x1c')]();});}};}function handleEntityNotFound(_0x3d78a9,_0x1f6ddf){return function(_0x34c763){if(!_0x34c763){_0x3d78a9[_0xaf5d('0x1a')](0x194);}return _0x34c763;};}function handleError(_0x39a4bd,_0x2077cd){_0x2077cd=_0x2077cd||0x1f4;return function(_0xc76249){logger[_0xaf5d('0x2c')](_0xc76249['stack']);if(_0xc76249[_0xaf5d('0x2d')]){delete _0xc76249[_0xaf5d('0x2d')];}_0x39a4bd[_0xaf5d('0x1b')](_0x2077cd)[_0xaf5d('0x2e')](_0xc76249);};}exports[_0xaf5d('0x2f')]=function(_0x3b8f8b,_0x1233c3){var _0x1a1292={},_0x15923c={},_0x2d2a50={'count':0x0,'rows':[]};var _0x570d65=_[_0xaf5d('0x30')](db[_0xaf5d('0x31')]['rawAttributes'],function(_0x29c201){return{'name':_0x29c201[_0xaf5d('0x32')],'type':_0x29c201[_0xaf5d('0x33')][_0xaf5d('0x34')]};});_0x15923c[_0xaf5d('0x35')]=_[_0xaf5d('0x30')](_0x570d65,_0xaf5d('0x2d'));_0x15923c[_0xaf5d('0x36')]=_['keys'](_0x3b8f8b[_0xaf5d('0x36')]);_0x15923c[_0xaf5d('0x37')]=_[_0xaf5d('0x38')](_0x15923c[_0xaf5d('0x35')],_0x15923c[_0xaf5d('0x36')]);_0x1a1292[_0xaf5d('0x39')]=_[_0xaf5d('0x38')](_0x15923c[_0xaf5d('0x35')],qs[_0xaf5d('0x3a')](_0x3b8f8b[_0xaf5d('0x36')][_0xaf5d('0x3a')]));_0x1a1292[_0xaf5d('0x39')]=_0x1a1292[_0xaf5d('0x39')][_0xaf5d('0x3b')]?_0x1a1292[_0xaf5d('0x39')]:_0x15923c['model'];if(!_0x3b8f8b[_0xaf5d('0x36')][_0xaf5d('0x3c')](_0xaf5d('0x3d'))){_0x1a1292[_0xaf5d('0x20')]=qs['limit'](_0x3b8f8b[_0xaf5d('0x36')][_0xaf5d('0x20')]);_0x1a1292[_0xaf5d('0x1e')]=qs[_0xaf5d('0x1e')](_0x3b8f8b[_0xaf5d('0x36')][_0xaf5d('0x1e')]);}_0x1a1292[_0xaf5d('0x3e')]=qs[_0xaf5d('0x3f')](_0x3b8f8b[_0xaf5d('0x36')][_0xaf5d('0x3f')]);_0x1a1292['where']=qs[_0xaf5d('0x37')](_[_0xaf5d('0x40')](_0x3b8f8b[_0xaf5d('0x36')],_0x15923c[_0xaf5d('0x37')]),_0x570d65);if(_0x3b8f8b['query'][_0xaf5d('0x41')]){_0x1a1292[_0xaf5d('0x42')]=_[_0xaf5d('0x43')](_0x1a1292[_0xaf5d('0x42')],{'$or':_[_0xaf5d('0x30')](_0x570d65,function(_0x317f2e){if(_0x317f2e[_0xaf5d('0x33')]!=='VIRTUAL'){var _0x5e33d5={};_0x5e33d5[_0x317f2e[_0xaf5d('0x2d')]]={'$like':'%'+_0x3b8f8b[_0xaf5d('0x36')][_0xaf5d('0x41')]+'%'};return _0x5e33d5;}})});}_0x1a1292=_[_0xaf5d('0x43')]({},_0x1a1292,_0x3b8f8b['options']);var _0x530e6a={'where':_0x1a1292[_0xaf5d('0x42')]};return db[_0xaf5d('0x31')][_0xaf5d('0x21')](_0x530e6a)[_0xaf5d('0x27')](function(_0x5cb423){_0x2d2a50['count']=_0x5cb423;if(_0x3b8f8b[_0xaf5d('0x36')][_0xaf5d('0x44')]){_0x1a1292[_0xaf5d('0x45')]=[{'all':!![]}];}return db[_0xaf5d('0x31')]['findAll'](_0x1a1292);})['then'](function(_0x26d704){_0x2d2a50['rows']=_0x26d704;return _0x2d2a50;})[_0xaf5d('0x27')](respondWithFilteredResult(_0x1233c3,_0x1a1292))[_0xaf5d('0x46')](handleError(_0x1233c3,null));};exports[_0xaf5d('0x47')]=function(_0x4a01c6,_0x233016){var _0x657065={'raw':!![],'where':{'id':_0x4a01c6[_0xaf5d('0x48')]['id']}},_0x3c60bd={};_0x3c60bd['model']=_['keys'](db['Sound'][_0xaf5d('0x49')]);_0x3c60bd[_0xaf5d('0x36')]=_[_0xaf5d('0x4a')](_0x4a01c6['query']);_0x3c60bd[_0xaf5d('0x37')]=_[_0xaf5d('0x38')](_0x3c60bd[_0xaf5d('0x35')],_0x3c60bd['query']);_0x657065[_0xaf5d('0x39')]=_['intersection'](_0x3c60bd[_0xaf5d('0x35')],qs[_0xaf5d('0x3a')](_0x4a01c6[_0xaf5d('0x36')]['fields']));_0x657065[_0xaf5d('0x39')]=_0x657065[_0xaf5d('0x39')]['length']?_0x657065['attributes']:_0x3c60bd[_0xaf5d('0x35')];if(_0x4a01c6[_0xaf5d('0x36')][_0xaf5d('0x44')]){_0x657065[_0xaf5d('0x45')]=[{'all':!![]}];}_0x657065=_['merge']({},_0x657065,_0x4a01c6[_0xaf5d('0x4b')]);return db['Sound'][_0xaf5d('0x4c')](_0x657065)[_0xaf5d('0x27')](handleEntityNotFound(_0x233016,null))[_0xaf5d('0x27')](respondWithResult(_0x233016,null))[_0xaf5d('0x46')](handleError(_0x233016,null));};exports[_0xaf5d('0x4d')]=function(_0x2615fb,_0x454288,_0x14e4f6){return db[_0xaf5d('0x31')][_0xaf5d('0x4c')]({'where':{'id':_0x2615fb['params']['id']},'attributes':['name','save_name',_0xaf5d('0x4e')],'raw':!![]})[_0xaf5d('0x27')](handleEntityNotFound(_0x454288,null))['then'](function(_0x5d9be1){if(_0x5d9be1){if(!fs[_0xaf5d('0x4f')](path[_0xaf5d('0x50')](config[_0xaf5d('0x51')],_0xaf5d('0x52'),_0x5d9be1[_0xaf5d('0x53')]+'.'+_0x5d9be1[_0xaf5d('0x4e')]))){throw new db[(_0xaf5d('0x54'))]['ValidationError'](_0xaf5d('0x55'));}return _0x454288[_0xaf5d('0x4d')](path[_0xaf5d('0x50')](config[_0xaf5d('0x51')],_0xaf5d('0x52'),util[_0xaf5d('0x56')](_0xaf5d('0x57'),_0x5d9be1[_0xaf5d('0x53')],_0x5d9be1['converted_format'])),util[_0xaf5d('0x56')](_0xaf5d('0x57'),_0x5d9be1[_0xaf5d('0x2d')],_0x5d9be1[_0xaf5d('0x4e')]));}return null;})[_0xaf5d('0x46')](handleError(_0x454288,null));};exports[_0xaf5d('0x58')]=function(_0x5434df,_0x33ada4,_0x50bd8a){var _0x99face={'name':path[_0xaf5d('0x59')](_0x5434df[_0xaf5d('0x5a')][_0xaf5d('0x5b')],path['extname'](_0x5434df['file']['originalname'])),'save_name':path[_0xaf5d('0x59')](_0x5434df['file']['filename'],path[_0xaf5d('0x5c')](_0x5434df[_0xaf5d('0x5a')]['filename'])),'original_format':path[_0xaf5d('0x5c')](_0x5434df['file']['originalname'])[_0xaf5d('0x5d')](0x1),'converted_format':_0xaf5d('0x5e')};var _0x67dca3=path[_0xaf5d('0x50')](config[_0xaf5d('0x51')],_0xaf5d('0x5f'),_0x5434df[_0xaf5d('0x5a')][_0xaf5d('0x60')]);var _0x5e7578=path[_0xaf5d('0x50')](config[_0xaf5d('0x51')],_0xaf5d('0x52'),util[_0xaf5d('0x56')](_0xaf5d('0x57'),path['basename'](_0x5434df[_0xaf5d('0x5a')][_0xaf5d('0x60')],path[_0xaf5d('0x5c')](_0x5434df[_0xaf5d('0x5a')][_0xaf5d('0x60')])),_0x99face['converted_format']));logger[_0xaf5d('0x61')](_0xaf5d('0x62'),_0x67dca3);logger['info'](_0xaf5d('0x63'),_0x5e7578);try{fs[_0xaf5d('0x64')](_0x67dca3,parseInt('0777',0x8));var _0x6cae63=sox[_0xaf5d('0x65')](_0x67dca3,_0x5e7578,{'sampleRate':0x1f40,'format':_0xaf5d('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x6cae63['on'](_0xaf5d('0x2c'),function(_0x15d5a9){fs['unlinkSync'](_0x67dca3);_0x33ada4[_0xaf5d('0x1b')](0x1f4)['send'](_0x15d5a9);});_0x6cae63['on'](_0xaf5d('0x66'),function(_0x8533de){_0x99face[_0xaf5d('0x67')]=isNaN(_0x8533de[_0xaf5d('0x68')])?null:_0x8533de['duration']*0x3e8;_0x99face[_0xaf5d('0x69')]=isNaN(_0x8533de['sampleCount'])?null:_0x8533de[_0xaf5d('0x6a')];_0x99face[_0xaf5d('0x6b')]=isNaN(_0x8533de[_0xaf5d('0x6c')])?null:_0x8533de[_0xaf5d('0x6c')];_0x99face[_0xaf5d('0x6d')]=isNaN(_0x8533de['bitRate'])?null:_0x8533de[_0xaf5d('0x6e')];_0x99face[_0xaf5d('0x6f')]=isNaN(_0x8533de['sampleRate'])?null:_0x8533de[_0xaf5d('0x70')];});_0x6cae63['on'](_0xaf5d('0x71'),function(_0xc02f63){_0x99face[_0xaf5d('0x72')]=isNaN(_0xc02f63['duration'])?null:_0xc02f63[_0xaf5d('0x68')]*0x3e8;_0x99face['converted_sampleCount']=isNaN(_0xc02f63[_0xaf5d('0x6a')])?null:_0xc02f63[_0xaf5d('0x6a')];_0x99face['converted_channelCount']=isNaN(_0xc02f63[_0xaf5d('0x6c')])?null:_0xc02f63[_0xaf5d('0x6c')];_0x99face[_0xaf5d('0x73')]=isNaN(_0xc02f63[_0xaf5d('0x6e')])?null:_0xc02f63[_0xaf5d('0x6e')];_0x99face[_0xaf5d('0x74')]=isNaN(_0xc02f63[_0xaf5d('0x70')])?null:_0xc02f63[_0xaf5d('0x70')];});_0x6cae63['on']('end',function(){fs['chmodSync'](_0x5e7578,parseInt(_0xaf5d('0x75'),0x8));return db[_0xaf5d('0x31')][_0xaf5d('0x58')](_0x99face)[_0xaf5d('0x27')](function(_0x1cbe8a){var _0x45db91={'role':_0x5434df[_0xaf5d('0x76')][_0xaf5d('0x77')],'userProfileId':_0x5434df[_0xaf5d('0x76')]['userProfileId']};if(!_0x45db91)throw new Error(_0xaf5d('0x78'));if(_0x45db91[_0xaf5d('0x77')]===_0xaf5d('0x79')){var _0x97af96=_0x1cbe8a[_0xaf5d('0x29')]({'plain':!![]});return db[_0xaf5d('0x7a')][_0xaf5d('0x4c')]({'where':{'name':_0xaf5d('0x2a'),'userProfileId':_0x45db91['userProfileId']},'raw':!![]})[_0xaf5d('0x27')](function(_0xd85a03){if(_0xd85a03&&_0xd85a03[_0xaf5d('0x7b')]===0x0){return db[_0xaf5d('0x2b')][_0xaf5d('0x58')]({'name':_0x97af96[_0xaf5d('0x2d')],'resourceId':_0x97af96['id'],'type':_0xd85a03[_0xaf5d('0x2d')],'sectionId':_0xd85a03['id']},{})[_0xaf5d('0x27')](function(){return _0x1cbe8a;});}else{return _0x1cbe8a;}})['catch'](function(_0x5e6876){logger[_0xaf5d('0x2c')](_0xaf5d('0x7c'),_0x5e6876);throw _0x5e6876;});}return _0x1cbe8a;})[_0xaf5d('0x27')](respondWithResult(_0x33ada4,null))[_0xaf5d('0x46')](handleError(_0x33ada4,null));});_0x6cae63['start']();}catch(_0x1e5eb5){_0x33ada4[_0xaf5d('0x1b')](0x1f4)[_0xaf5d('0x2e')](_0x1e5eb5);}};exports['update']=function(_0x30a309,_0x5bcec1,_0x29f7f9){return db[_0xaf5d('0x31')][_0xaf5d('0x4c')]({'where':{'id':_0x30a309[_0xaf5d('0x48')]['id']}})[_0xaf5d('0x27')](handleEntityNotFound(_0x5bcec1,null))[_0xaf5d('0x27')](saveUpdates(_[_0xaf5d('0x40')](_0x30a309[_0xaf5d('0x76')],[_0xaf5d('0x2d'),_0xaf5d('0x7d')]),null))[_0xaf5d('0x27')](respondWithResult(_0x5bcec1,null))[_0xaf5d('0x46')](handleError(_0x5bcec1,null));};exports[_0xaf5d('0x7e')]=function(_0x4903db,_0x1b4552,_0xc8d0e0){return db[_0xaf5d('0x31')]['find']({'where':{'id':_0x4903db[_0xaf5d('0x48')]['id']}})['then'](function(_0x4b1b6b){if(_0x4b1b6b){return _0x4b1b6b[_0xaf5d('0x28')]();}})[_0xaf5d('0x27')](function(_0x320910){var _0x352cc6=path[_0xaf5d('0x50')](config[_0xaf5d('0x51')],_0xaf5d('0x5f'),util[_0xaf5d('0x56')](_0xaf5d('0x57'),_0x320910[_0xaf5d('0x53')],_0x320910[_0xaf5d('0x7f')]));var _0x16a43f=path['join'](config[_0xaf5d('0x51')],'server/files/sounds/converted',util['format'](_0xaf5d('0x57'),_0x320910[_0xaf5d('0x53')],_0x320910[_0xaf5d('0x4e')]));fs[_0xaf5d('0x80')](_0x352cc6);fs[_0xaf5d('0x80')](_0x16a43f);return _0x320910;})[_0xaf5d('0x27')](function(_0x1522b){if(_0x1522b){return _0x1b4552[_0xaf5d('0x1b')](0xcc)[_0xaf5d('0x1c')]();}})[_0xaf5d('0x27')](handleEntityNotFound(_0x1b4552,null))['catch'](handleError(_0x1b4552,null));}; \ No newline at end of file +var _0x6673=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','Sounds','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','Sound','includeAll','findAll','rows','catch','show','params','length','options','find','download','save_name','existsSync','join','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','root','format','create','basename','file','originalname','filename','extname','substring','wav','%s.%s','converted_format','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','original_duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','duration','converted_channelCount','converted_bitRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','update','delete','original_format'];(function(_0x4a8812,_0x430080){var _0x55a784=function(_0x4b25cf){while(--_0x4b25cf){_0x4a8812['push'](_0x4a8812['shift']());}};_0x55a784(++_0x430080);}(_0x6673,0x17d));var _0x3667=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x6673[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0x3667('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3667('0x1'));var jsonpatch=require(_0x3667('0x2'));var rp=require(_0x3667('0x3'));var moment=require(_0x3667('0x4'));var BPromise=require(_0x3667('0x5'));var Mustache=require(_0x3667('0x6'));var util=require(_0x3667('0x7'));var path=require(_0x3667('0x8'));var sox=require(_0x3667('0x9'));var csv=require('to-csv');var ejs=require(_0x3667('0xa'));var fs=require('fs');var fs_extra=require(_0x3667('0xb'));var _=require('lodash');var squel=require(_0x3667('0xc'));var crypto=require(_0x3667('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3667('0xe'));var querystring=require('querystring');var Papa=require(_0x3667('0xf'));var Redis=require('ioredis');var authService=require(_0x3667('0x10'));var qs=require(_0x3667('0x11'));var as=require(_0x3667('0x12'));var hardwareService=require(_0x3667('0x13'));var logger=require(_0x3667('0x14'))(_0x3667('0x15'));var utils=require(_0x3667('0x16'));var config=require(_0x3667('0x17'));var licenseUtil=require(_0x3667('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32b5a,_0x265ab3){_0x265ab3=_0x265ab3||0xcc;return function(_0x2a6ebd){if(_0x2a6ebd){return _0x32b5a[_0x3667('0x19')](_0x265ab3);}return _0x32b5a['status'](_0x265ab3)['end']();};}function respondWithResult(_0x24040d,_0x1b95d0){_0x1b95d0=_0x1b95d0||0xc8;return function(_0x508a0e){if(_0x508a0e){return _0x24040d[_0x3667('0x1a')](_0x1b95d0)['json'](_0x508a0e);}};}function respondWithFilteredResult(_0x5a297b,_0x22b3aa){return function(_0x5cfaa0){if(_0x5cfaa0){var _0x10f8cc=typeof _0x22b3aa[_0x3667('0x1b')]===_0x3667('0x1c')&&typeof _0x22b3aa[_0x3667('0x1d')]===_0x3667('0x1c');var _0x3aed75=_0x5cfaa0[_0x3667('0x1e')];var _0x18cb63=_0x10f8cc?0x0:_0x22b3aa['offset'];var _0x266064=_0x10f8cc?_0x5cfaa0[_0x3667('0x1e')]:_0x22b3aa[_0x3667('0x1b')]+_0x22b3aa[_0x3667('0x1d')];var _0x2e02c9;if(_0x266064>=_0x3aed75){_0x266064=_0x3aed75;_0x2e02c9=0xc8;}else{_0x2e02c9=0xce;}_0x5a297b[_0x3667('0x1a')](_0x2e02c9);return _0x5a297b[_0x3667('0x1f')](_0x3667('0x20'),_0x18cb63+'-'+_0x266064+'/'+_0x3aed75)['json'](_0x5cfaa0);}return null;};}function patchUpdates(_0xce6246){return function(_0x447a08){try{jsonpatch[_0x3667('0x21')](_0x447a08,_0xce6246,!![]);}catch(_0x564837){return BPromise[_0x3667('0x22')](_0x564837);}return _0x447a08[_0x3667('0x23')]();};}function saveUpdates(_0x4e8d2d,_0xcec732){return function(_0x58687c){if(_0x58687c){return _0x58687c['update'](_0x4e8d2d)['then'](function(_0x4616dc){return _0x4616dc;});}return null;};}function removeEntity(_0xb25e33,_0x4950fd){return function(_0x3cb686){if(_0x3cb686){return _0x3cb686[_0x3667('0x24')]()[_0x3667('0x25')](function(){var _0x4ead55=_0x3cb686[_0x3667('0x26')]({'plain':!![]});var _0x5e1cd3=_0x3667('0x27');return db[_0x3667('0x28')][_0x3667('0x24')]({'where':{'type':_0x5e1cd3,'resourceId':_0x4ead55['id']}})['then'](function(){return _0x3cb686;});})[_0x3667('0x25')](function(){_0xb25e33[_0x3667('0x1a')](0xcc)[_0x3667('0x29')]();});}};}function handleEntityNotFound(_0x1d7690,_0x28674b){return function(_0x2e3722){if(!_0x2e3722){_0x1d7690[_0x3667('0x19')](0x194);}return _0x2e3722;};}function handleError(_0x39a5c9,_0x2e7bca){_0x2e7bca=_0x2e7bca||0x1f4;return function(_0x440a17){logger[_0x3667('0x2a')](_0x440a17[_0x3667('0x2b')]);if(_0x440a17[_0x3667('0x2c')]){delete _0x440a17[_0x3667('0x2c')];}_0x39a5c9['status'](_0x2e7bca)[_0x3667('0x2d')](_0x440a17);};}exports[_0x3667('0x2e')]=function(_0x5acc25,_0x3fbfc2){var _0x5096b1={},_0xde6d31={},_0x3dc639={'count':0x0,'rows':[]};var _0x5674a2=_[_0x3667('0x2f')](db['Sound'][_0x3667('0x30')],function(_0x248f8c){return{'name':_0x248f8c[_0x3667('0x31')],'type':_0x248f8c['type'][_0x3667('0x32')]};});_0xde6d31['model']=_[_0x3667('0x2f')](_0x5674a2,_0x3667('0x2c'));_0xde6d31['query']=_[_0x3667('0x33')](_0x5acc25[_0x3667('0x34')]);_0xde6d31[_0x3667('0x35')]=_[_0x3667('0x36')](_0xde6d31[_0x3667('0x37')],_0xde6d31['query']);_0x5096b1[_0x3667('0x38')]=_[_0x3667('0x36')](_0xde6d31['model'],qs['fields'](_0x5acc25['query'][_0x3667('0x39')]));_0x5096b1[_0x3667('0x38')]=_0x5096b1[_0x3667('0x38')]['length']?_0x5096b1[_0x3667('0x38')]:_0xde6d31[_0x3667('0x37')];if(!_0x5acc25[_0x3667('0x34')][_0x3667('0x3a')](_0x3667('0x3b'))){_0x5096b1[_0x3667('0x1d')]=qs[_0x3667('0x1d')](_0x5acc25[_0x3667('0x34')][_0x3667('0x1d')]);_0x5096b1[_0x3667('0x1b')]=qs[_0x3667('0x1b')](_0x5acc25[_0x3667('0x34')][_0x3667('0x1b')]);}_0x5096b1[_0x3667('0x3c')]=qs['sort'](_0x5acc25[_0x3667('0x34')][_0x3667('0x3d')]);_0x5096b1[_0x3667('0x3e')]=qs[_0x3667('0x35')](_['pick'](_0x5acc25[_0x3667('0x34')],_0xde6d31[_0x3667('0x35')]),_0x5674a2);if(_0x5acc25[_0x3667('0x34')][_0x3667('0x3f')]){_0x5096b1[_0x3667('0x3e')]=_[_0x3667('0x40')](_0x5096b1[_0x3667('0x3e')],{'$or':_[_0x3667('0x2f')](_0x5674a2,function(_0x411ecb){if(_0x411ecb[_0x3667('0x41')]!==_0x3667('0x42')){var _0x23d528={};_0x23d528[_0x411ecb[_0x3667('0x2c')]]={'$like':'%'+_0x5acc25[_0x3667('0x34')]['filter']+'%'};return _0x23d528;}})});}_0x5096b1=_[_0x3667('0x40')]({},_0x5096b1,_0x5acc25['options']);var _0x397c7f={'where':_0x5096b1[_0x3667('0x3e')]};return db[_0x3667('0x43')][_0x3667('0x1e')](_0x397c7f)[_0x3667('0x25')](function(_0x71880f){_0x3dc639[_0x3667('0x1e')]=_0x71880f;if(_0x5acc25[_0x3667('0x34')][_0x3667('0x44')]){_0x5096b1['include']=[{'all':!![]}];}return db[_0x3667('0x43')][_0x3667('0x45')](_0x5096b1);})[_0x3667('0x25')](function(_0x44ff0a){_0x3dc639[_0x3667('0x46')]=_0x44ff0a;return _0x3dc639;})[_0x3667('0x25')](respondWithFilteredResult(_0x3fbfc2,_0x5096b1))[_0x3667('0x47')](handleError(_0x3fbfc2,null));};exports[_0x3667('0x48')]=function(_0x46f5d8,_0xd7a081){var _0x44c9b6={'raw':!![],'where':{'id':_0x46f5d8[_0x3667('0x49')]['id']}},_0x17e008={};_0x17e008[_0x3667('0x37')]=_['keys'](db['Sound'][_0x3667('0x30')]);_0x17e008[_0x3667('0x34')]=_[_0x3667('0x33')](_0x46f5d8[_0x3667('0x34')]);_0x17e008[_0x3667('0x35')]=_[_0x3667('0x36')](_0x17e008[_0x3667('0x37')],_0x17e008[_0x3667('0x34')]);_0x44c9b6[_0x3667('0x38')]=_[_0x3667('0x36')](_0x17e008[_0x3667('0x37')],qs[_0x3667('0x39')](_0x46f5d8[_0x3667('0x34')][_0x3667('0x39')]));_0x44c9b6[_0x3667('0x38')]=_0x44c9b6[_0x3667('0x38')][_0x3667('0x4a')]?_0x44c9b6['attributes']:_0x17e008['model'];if(_0x46f5d8['query'][_0x3667('0x44')]){_0x44c9b6['include']=[{'all':!![]}];}_0x44c9b6=_['merge']({},_0x44c9b6,_0x46f5d8[_0x3667('0x4b')]);return db[_0x3667('0x43')][_0x3667('0x4c')](_0x44c9b6)['then'](handleEntityNotFound(_0xd7a081,null))[_0x3667('0x25')](respondWithResult(_0xd7a081,null))['catch'](handleError(_0xd7a081,null));};exports[_0x3667('0x4d')]=function(_0x384e8c,_0x2e72b4,_0x77d2ce){return db[_0x3667('0x43')][_0x3667('0x4c')]({'where':{'id':_0x384e8c[_0x3667('0x49')]['id']},'attributes':[_0x3667('0x2c'),_0x3667('0x4e'),'converted_format'],'raw':!![]})[_0x3667('0x25')](handleEntityNotFound(_0x2e72b4,null))['then'](function(_0xeba46){if(_0xeba46){if(!fs[_0x3667('0x4f')](path[_0x3667('0x50')](config['root'],_0x3667('0x51'),_0xeba46[_0x3667('0x4e')]+'.'+_0xeba46['converted_format']))){throw new db['Sequelize'][(_0x3667('0x52'))](_0x3667('0x53'));}return _0x2e72b4['download'](path[_0x3667('0x50')](config[_0x3667('0x54')],_0x3667('0x51'),util['format']('%s.%s',_0xeba46[_0x3667('0x4e')],_0xeba46['converted_format'])),util[_0x3667('0x55')]('%s.%s',_0xeba46[_0x3667('0x2c')],_0xeba46['converted_format']));}return null;})[_0x3667('0x47')](handleError(_0x2e72b4,null));};exports[_0x3667('0x56')]=function(_0x5b0c51,_0x4cf608,_0x38720c){var _0x3faa28={'name':path[_0x3667('0x57')](_0x5b0c51[_0x3667('0x58')][_0x3667('0x59')],path['extname'](_0x5b0c51[_0x3667('0x58')]['originalname'])),'save_name':path['basename'](_0x5b0c51[_0x3667('0x58')][_0x3667('0x5a')],path[_0x3667('0x5b')](_0x5b0c51[_0x3667('0x58')]['filename'])),'original_format':path[_0x3667('0x5b')](_0x5b0c51['file'][_0x3667('0x59')])[_0x3667('0x5c')](0x1),'converted_format':_0x3667('0x5d')};var _0x35b856=path[_0x3667('0x50')](config['root'],'server/files/sounds/original',_0x5b0c51['file'][_0x3667('0x5a')]);var _0x5ce971=path['join'](config[_0x3667('0x54')],_0x3667('0x51'),util[_0x3667('0x55')](_0x3667('0x5e'),path[_0x3667('0x57')](_0x5b0c51[_0x3667('0x58')][_0x3667('0x5a')],path[_0x3667('0x5b')](_0x5b0c51[_0x3667('0x58')][_0x3667('0x5a')])),_0x3faa28[_0x3667('0x5f')]));logger[_0x3667('0x60')](_0x3667('0x61'),_0x35b856);logger[_0x3667('0x60')](_0x3667('0x62'),_0x5ce971);try{fs[_0x3667('0x63')](_0x35b856,parseInt(_0x3667('0x64'),0x8));var _0x18221e=sox[_0x3667('0x65')](_0x35b856,_0x5ce971,{'sampleRate':0x1f40,'format':_0x3667('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x18221e['on'](_0x3667('0x2a'),function(_0x332fee){fs[_0x3667('0x66')](_0x35b856);_0x4cf608[_0x3667('0x1a')](0x1f4)[_0x3667('0x2d')](_0x332fee);});_0x18221e['on']('src',function(_0xee6f25){_0x3faa28[_0x3667('0x67')]=isNaN(_0xee6f25['duration'])?null:_0xee6f25['duration']*0x3e8;_0x3faa28[_0x3667('0x68')]=isNaN(_0xee6f25[_0x3667('0x69')])?null:_0xee6f25[_0x3667('0x69')];_0x3faa28[_0x3667('0x6a')]=isNaN(_0xee6f25[_0x3667('0x6b')])?null:_0xee6f25[_0x3667('0x6b')];_0x3faa28[_0x3667('0x6c')]=isNaN(_0xee6f25[_0x3667('0x6d')])?null:_0xee6f25[_0x3667('0x6d')];_0x3faa28[_0x3667('0x6e')]=isNaN(_0xee6f25['sampleRate'])?null:_0xee6f25[_0x3667('0x6f')];});_0x18221e['on'](_0x3667('0x70'),function(_0x2be7da){_0x3faa28[_0x3667('0x71')]=isNaN(_0x2be7da[_0x3667('0x72')])?null:_0x2be7da[_0x3667('0x72')]*0x3e8;_0x3faa28['converted_sampleCount']=isNaN(_0x2be7da[_0x3667('0x69')])?null:_0x2be7da[_0x3667('0x69')];_0x3faa28[_0x3667('0x73')]=isNaN(_0x2be7da[_0x3667('0x6b')])?null:_0x2be7da[_0x3667('0x6b')];_0x3faa28[_0x3667('0x74')]=isNaN(_0x2be7da['bitRate'])?null:_0x2be7da[_0x3667('0x6d')];_0x3faa28['converted_sampleRate']=isNaN(_0x2be7da[_0x3667('0x6f')])?null:_0x2be7da[_0x3667('0x6f')];});_0x18221e['on']('end',function(){fs[_0x3667('0x63')](_0x5ce971,parseInt(_0x3667('0x64'),0x8));return db[_0x3667('0x43')][_0x3667('0x56')](_0x3faa28)[_0x3667('0x25')](function(_0xc6d78a){var _0x408785={'role':_0x5b0c51[_0x3667('0x75')][_0x3667('0x76')],'userProfileId':_0x5b0c51['body']['userProfileId']};if(!_0x408785)throw new Error(_0x3667('0x77'));if(_0x408785[_0x3667('0x76')]===_0x3667('0x78')){var _0x4e9fc4=_0xc6d78a[_0x3667('0x26')]({'plain':!![]});return db[_0x3667('0x79')][_0x3667('0x4c')]({'where':{'name':_0x3667('0x27'),'userProfileId':_0x408785[_0x3667('0x7a')]},'raw':!![]})[_0x3667('0x25')](function(_0x463baf){if(_0x463baf&&_0x463baf[_0x3667('0x7b')]===0x0){return db[_0x3667('0x28')]['create']({'name':_0x4e9fc4[_0x3667('0x2c')],'resourceId':_0x4e9fc4['id'],'type':_0x463baf[_0x3667('0x2c')],'sectionId':_0x463baf['id']},{})[_0x3667('0x25')](function(){return _0xc6d78a;});}else{return _0xc6d78a;}})[_0x3667('0x47')](function(_0x5a4fd1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a4fd1);throw _0x5a4fd1;});}return _0xc6d78a;})[_0x3667('0x25')](respondWithResult(_0x4cf608,null))[_0x3667('0x47')](handleError(_0x4cf608,null));});_0x18221e['start']();}catch(_0x2186e6){_0x4cf608[_0x3667('0x1a')](0x1f4)['send'](_0x2186e6);}};exports[_0x3667('0x7c')]=function(_0x4477a4,_0x8beea1,_0x3ee162){return db[_0x3667('0x43')][_0x3667('0x4c')]({'where':{'id':_0x4477a4['params']['id']}})[_0x3667('0x25')](handleEntityNotFound(_0x8beea1,null))['then'](saveUpdates(_['pick'](_0x4477a4[_0x3667('0x75')],[_0x3667('0x2c'),'description']),null))[_0x3667('0x25')](respondWithResult(_0x8beea1,null))[_0x3667('0x47')](handleError(_0x8beea1,null));};exports[_0x3667('0x7d')]=function(_0x104aa2,_0x4771e6,_0x2d83dc){return db[_0x3667('0x43')][_0x3667('0x4c')]({'where':{'id':_0x104aa2[_0x3667('0x49')]['id']}})[_0x3667('0x25')](function(_0x5e7739){if(_0x5e7739){return _0x5e7739[_0x3667('0x24')]();}})[_0x3667('0x25')](function(_0x35a9e3){var _0x67127f=path[_0x3667('0x50')](config[_0x3667('0x54')],'server/files/sounds/original',util['format'](_0x3667('0x5e'),_0x35a9e3[_0x3667('0x4e')],_0x35a9e3[_0x3667('0x7e')]));var _0x1b6e3e=path['join'](config['root'],_0x3667('0x51'),util[_0x3667('0x55')](_0x3667('0x5e'),_0x35a9e3[_0x3667('0x4e')],_0x35a9e3[_0x3667('0x5f')]));fs[_0x3667('0x66')](_0x67127f);fs[_0x3667('0x66')](_0x1b6e3e);return _0x35a9e3;})[_0x3667('0x25')](function(_0x2d7db2){if(_0x2d7db2){return _0x4771e6['status'](0xcc)['end']();}})[_0x3667('0x25')](handleEntityNotFound(_0x4771e6,null))[_0x3667('0x47')](handleError(_0x4771e6,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 0fbcf3c..a3aabc0 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 _0x9a97=['../../config/environment','./sound.attributes','exports','define','tools_sounds','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x9a97,0x7d));var _0x79a9=function(_0x555f06,_0x15b692){_0x555f06=_0x555f06-0x0;var _0x1c9e4c=_0x9a97[_0x555f06];return _0x1c9e4c;};'use strict';var _=require(_0x79a9('0x0'));var util=require('util');var logger=require(_0x79a9('0x1'))(_0x79a9('0x2'));var moment=require(_0x79a9('0x3'));var BPromise=require(_0x79a9('0x4'));var rp=require(_0x79a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79a9('0x6'));var config=require(_0x79a9('0x7'));var attributes=require(_0x79a9('0x8'));module[_0x79a9('0x9')]=function(_0x37f0f9,_0x1cfeec){return _0x37f0f9[_0x79a9('0xa')]('Sound',attributes,{'tableName':_0x79a9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e57=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','util','../../config/logger'];(function(_0x124e0f,_0x474f63){var _0x54c56b=function(_0xf57d3e){while(--_0xf57d3e){_0x124e0f['push'](_0x124e0f['shift']());}};_0x54c56b(++_0x474f63);}(_0x3e57,0xc1));var _0x73e5=function(_0x112fe3,_0x16b642){_0x112fe3=_0x112fe3-0x0;var _0x1ec903=_0x3e57[_0x112fe3];return _0x1ec903;};'use strict';var _=require('lodash');var util=require(_0x73e5('0x0'));var logger=require(_0x73e5('0x1'))(_0x73e5('0x2'));var moment=require(_0x73e5('0x3'));var BPromise=require(_0x73e5('0x4'));var rp=require(_0x73e5('0x5'));var fs=require('fs');var path=require(_0x73e5('0x6'));var rimraf=require(_0x73e5('0x7'));var config=require(_0x73e5('0x8'));var attributes=require(_0x73e5('0x9'));module[_0x73e5('0xa')]=function(_0x1a9968,_0x16d72c){return _0x1a9968[_0x73e5('0xb')](_0x73e5('0xc'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index ba58e89..b1f3b4d 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 _0xcbfa=['result','catch','options','where','attributes','model','include','map','ShowSound','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x53f005,_0xfae300){var _0x3c3464=function(_0xb01fe8){while(--_0xb01fe8){_0x53f005['push'](_0x53f005['shift']());}};_0x3c3464(++_0xfae300);}(_0xcbfa,0x1b9));var _0xacbf=function(_0x5ca58f,_0x31ee9a){_0x5ca58f=_0x5ca58f-0x0;var _0x59eefb=_0xcbfa[_0x5ca58f];return _0x59eefb;};'use strict';var _=require(_0xacbf('0x0'));var util=require('util');var moment=require(_0xacbf('0x1'));var BPromise=require('bluebird');var rs=require(_0xacbf('0x2'));var fs=require('fs');var Redis=require(_0xacbf('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xacbf('0x4'))(_0xacbf('0x5'));var config=require(_0xacbf('0x6'));var jayson=require(_0xacbf('0x7'));var client=jayson['client'][_0xacbf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x248b7d,_0x4ff871,_0x502266){return new BPromise(function(_0x1ae334,_0x228326){return client['request'](_0x248b7d,_0x502266)[_0xacbf('0x9')](function(_0x533c12){logger[_0xacbf('0xa')](_0xacbf('0xb'),_0x4ff871,_0xacbf('0xc'));logger['debug'](_0xacbf('0xd'),_0x4ff871,_0xacbf('0xc'),JSON[_0xacbf('0xe')](_0x533c12));if(_0x533c12[_0xacbf('0xf')]){if(_0x533c12[_0xacbf('0xf')][_0xacbf('0x10')]===0x1f4){logger[_0xacbf('0xf')](_0xacbf('0xb'),_0x4ff871,_0x533c12[_0xacbf('0xf')]['message']);return _0x228326(_0x533c12[_0xacbf('0xf')]['message']);}logger[_0xacbf('0xf')](_0xacbf('0xb'),_0x4ff871,_0x533c12[_0xacbf('0xf')][_0xacbf('0x11')]);return _0x1ae334(_0x533c12[_0xacbf('0xf')][_0xacbf('0x11')]);}else{logger[_0xacbf('0xa')](_0xacbf('0xb'),_0x4ff871,_0xacbf('0xc'));_0x1ae334(_0x533c12[_0xacbf('0x12')][_0xacbf('0x11')]);}})[_0xacbf('0x13')](function(_0x468708){logger[_0xacbf('0xf')]('Sound,\x20%s,\x20%s',_0x4ff871,_0x468708);_0x228326(_0x468708);});});}exports['ShowSound']=function(_0x798e85){var _0x1d20f5=this;return new Promise(function(_0x8d8199,_0x139a4d){return db['Sound']['find']({'raw':_0x798e85[_0xacbf('0x14')]?_0x798e85['options']['raw']===undefined?!![]:![]:!![],'where':_0x798e85['options']?_0x798e85[_0xacbf('0x14')][_0xacbf('0x15')]||null:null,'attributes':_0x798e85[_0xacbf('0x14')]?_0x798e85[_0xacbf('0x14')][_0xacbf('0x16')]||null:null,'include':_0x798e85[_0xacbf('0x14')]?_0x798e85['options']['include']?_['map'](_0x798e85[_0xacbf('0x14')]['include'],function(_0x3cde3a){return{'model':db[_0x3cde3a[_0xacbf('0x17')]],'as':_0x3cde3a['as'],'attributes':_0x3cde3a[_0xacbf('0x16')],'include':_0x3cde3a[_0xacbf('0x18')]?_['map'](_0x3cde3a['include'],function(_0x370cd2){return{'model':db[_0x370cd2[_0xacbf('0x17')]],'as':_0x370cd2['as'],'attributes':_0x370cd2[_0xacbf('0x16')],'include':_0x370cd2[_0xacbf('0x18')]?_[_0xacbf('0x19')](_0x370cd2['include'],function(_0x17cda2){return{'model':db[_0x17cda2['model']],'as':_0x17cda2['as'],'attributes':_0x17cda2[_0xacbf('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4358b9){logger[_0xacbf('0xa')](_0xacbf('0x1a'),_0x798e85);logger['debug'](_0xacbf('0x1a'),_0x798e85,JSON[_0xacbf('0xe')](_0x4358b9));_0x8d8199(_0x4358b9);})[_0xacbf('0x13')](function(_0x4d3bab){logger['error'](_0xacbf('0x1a'),_0x4d3bab['message'],_0x798e85);_0x139a4d(_0x1d20f5[_0xacbf('0xf')](0x1f4,_0x4d3bab['message']));});});}; \ No newline at end of file +var _0xcc5c=['message','request\x20sent','result','catch','ShowSound','find','options','raw','attributes','include','map','model','then','stringify','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x495aab,_0x50ce56){var _0x11e8ec=function(_0x356667){while(--_0x356667){_0x495aab['push'](_0x495aab['shift']());}};_0x11e8ec(++_0x50ce56);}(_0xcc5c,0x163));var _0xccc5=function(_0x4ece4e,_0x907bc1){_0x4ece4e=_0x4ece4e-0x0;var _0x2501a1=_0xcc5c[_0x4ece4e];return _0x2501a1;};'use strict';var _=require(_0xccc5('0x0'));var util=require('util');var moment=require(_0xccc5('0x1'));var BPromise=require(_0xccc5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xccc5('0x3'))['db'];var utils=require(_0xccc5('0x4'));var logger=require(_0xccc5('0x5'))(_0xccc5('0x6'));var config=require(_0xccc5('0x7'));var jayson=require(_0xccc5('0x8'));var client=jayson['client'][_0xccc5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x562d5d,_0x3b737f,_0x223c85){return new BPromise(function(_0x102cce,_0x11be8c){return client[_0xccc5('0xa')](_0x562d5d,_0x223c85)['then'](function(_0x408774){logger[_0xccc5('0xb')](_0xccc5('0xc'),_0x3b737f,'request\x20sent');logger[_0xccc5('0xd')](_0xccc5('0xe'),_0x3b737f,'request\x20sent',JSON['stringify'](_0x408774));if(_0x408774[_0xccc5('0xf')]){if(_0x408774[_0xccc5('0xf')][_0xccc5('0x10')]===0x1f4){logger[_0xccc5('0xf')]('Sound,\x20%s,\x20%s',_0x3b737f,_0x408774['error']['message']);return _0x11be8c(_0x408774[_0xccc5('0xf')]['message']);}logger['error']('Sound,\x20%s,\x20%s',_0x3b737f,_0x408774['error']['message']);return _0x102cce(_0x408774[_0xccc5('0xf')][_0xccc5('0x11')]);}else{logger['info'](_0xccc5('0xc'),_0x3b737f,_0xccc5('0x12'));_0x102cce(_0x408774[_0xccc5('0x13')][_0xccc5('0x11')]);}})[_0xccc5('0x14')](function(_0x6eb0d8){logger[_0xccc5('0xf')](_0xccc5('0xc'),_0x3b737f,_0x6eb0d8);_0x11be8c(_0x6eb0d8);});});}exports[_0xccc5('0x15')]=function(_0x3e5ea1){var _0x198d78=this;return new Promise(function(_0x5db1c6,_0x15ad14){return db['Sound'][_0xccc5('0x16')]({'raw':_0x3e5ea1[_0xccc5('0x17')]?_0x3e5ea1['options'][_0xccc5('0x18')]===undefined?!![]:![]:!![],'where':_0x3e5ea1[_0xccc5('0x17')]?_0x3e5ea1[_0xccc5('0x17')]['where']||null:null,'attributes':_0x3e5ea1[_0xccc5('0x17')]?_0x3e5ea1[_0xccc5('0x17')][_0xccc5('0x19')]||null:null,'include':_0x3e5ea1[_0xccc5('0x17')]?_0x3e5ea1[_0xccc5('0x17')][_0xccc5('0x1a')]?_[_0xccc5('0x1b')](_0x3e5ea1[_0xccc5('0x17')][_0xccc5('0x1a')],function(_0x5dc1f8){return{'model':db[_0x5dc1f8['model']],'as':_0x5dc1f8['as'],'attributes':_0x5dc1f8[_0xccc5('0x19')],'include':_0x5dc1f8['include']?_[_0xccc5('0x1b')](_0x5dc1f8[_0xccc5('0x1a')],function(_0x4a35e7){return{'model':db[_0x4a35e7[_0xccc5('0x1c')]],'as':_0x4a35e7['as'],'attributes':_0x4a35e7[_0xccc5('0x19')],'include':_0x4a35e7[_0xccc5('0x1a')]?_['map'](_0x4a35e7[_0xccc5('0x1a')],function(_0xfc48a7){return{'model':db[_0xfc48a7['model']],'as':_0xfc48a7['as'],'attributes':_0xfc48a7[_0xccc5('0x19')]};}):[]};}):[]};}):[]:[]})[_0xccc5('0x1d')](function(_0x2c9caf){logger[_0xccc5('0xb')](_0xccc5('0x15'),_0x3e5ea1);logger['debug'](_0xccc5('0x15'),_0x3e5ea1,JSON[_0xccc5('0x1e')](_0x2c9caf));_0x5db1c6(_0x2c9caf);})[_0xccc5('0x14')](function(_0x145823){logger[_0xccc5('0xf')](_0xccc5('0x15'),_0x145823['message'],_0x3e5ea1);_0x15ad14(_0x198d78['error'](0x1f4,_0x145823[_0xccc5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 151eb33..a625c2e 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 _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x423b10,_0x36cad4){var _0x1338d9=function(_0xeb09ac){while(--_0xeb09ac){_0x423b10['push'](_0x423b10['shift']());}};_0x1338d9(++_0x36cad4);}(_0xda2d,0x102));var _0xdda2=function(_0xbd8439,_0xdf569f){_0xbd8439=_0xbd8439-0x0;var _0x57e1eb=_0xda2d[_0xbd8439];return _0x57e1eb;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file +var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x1ccd8a,_0x5bf417){var _0x5a69d8=function(_0x336fdb){while(--_0x336fdb){_0x1ccd8a['push'](_0x1ccd8a['shift']());}};_0x5a69d8(++_0x5bf417);}(_0xda2d,0x102));var _0xdda2=function(_0x393c1a,_0x2a06cb){_0x393c1a=_0x393c1a-0x0;var _0x19804c=_0xda2d[_0x393c1a];return _0x19804c;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 2e1e23d..c418832 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 _0xddba=['exports','STRING','TEXT','medium','out','sequelize'];(function(_0x399d5c,_0x526cf0){var _0x128d52=function(_0x2f6351){while(--_0x2f6351){_0x399d5c['push'](_0x399d5c['shift']());}};_0x128d52(++_0x526cf0);}(_0xddba,0x6b));var _0xaddb=function(_0x57a963,_0x3cd742){_0x57a963=_0x57a963-0x0;var _0x126377=_0xddba[_0x57a963];return _0x126377;};'use strict';var Sequelize=require(_0xaddb('0x0'));module[_0xaddb('0x1')]={'uniqueid':{'type':Sequelize[_0xaddb('0x2')]},'body':{'type':Sequelize[_0xaddb('0x3')](_0xaddb('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xaddb('0x5')),'defaultValue':_0xaddb('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xaddb('0x2')]},'providerResponse':{'type':Sequelize[_0xaddb('0x3')]}}; \ No newline at end of file +var _0x20eb=['medium','ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x5ac9b9,_0x1a2212){var _0x4e1ca1=function(_0x5ef15b){while(--_0x5ef15b){_0x5ac9b9['push'](_0x5ac9b9['shift']());}};_0x4e1ca1(++_0x1a2212);}(_0x20eb,0xc7));var _0xb20e=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x20eb[_0x5317b5];return _0x3b7ce2;};'use strict';var Sequelize=require(_0xb20e('0x0'));module[_0xb20e('0x1')]={'uniqueid':{'type':Sequelize[_0xb20e('0x2')]},'body':{'type':Sequelize[_0xb20e('0x3')](_0xb20e('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xb20e('0x5')]('in','out'),'defaultValue':_0xb20e('0x6'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb20e('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 74acb35..71aad46 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 _0xbc72=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','SquareMessage','findAll','rows','catch','params','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x159dcf,_0x1c75f9){var _0x531d85=function(_0x5a8563){while(--_0x5a8563){_0x159dcf['push'](_0x159dcf['shift']());}};_0x531d85(++_0x1c75f9);}(_0xbc72,0x18e));var _0x2bc7=function(_0x4356af,_0x20fbe7){_0x4356af=_0x4356af-0x0;var _0x884e96=_0xbc72[_0x4356af];return _0x884e96;};'use strict';var emlformat=require(_0x2bc7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2bc7('0x1'));var jsonpatch=require(_0x2bc7('0x2'));var rp=require('request-promise');var moment=require(_0x2bc7('0x3'));var BPromise=require(_0x2bc7('0x4'));var Mustache=require('mustache');var util=require(_0x2bc7('0x5'));var path=require(_0x2bc7('0x6'));var sox=require('sox');var csv=require(_0x2bc7('0x7'));var ejs=require(_0x2bc7('0x8'));var fs=require('fs');var fs_extra=require(_0x2bc7('0x9'));var _=require(_0x2bc7('0xa'));var squel=require(_0x2bc7('0xb'));var crypto=require(_0x2bc7('0xc'));var jsforce=require(_0x2bc7('0xd'));var deskjs=require(_0x2bc7('0xe'));var toCsv=require(_0x2bc7('0x7'));var querystring=require(_0x2bc7('0xf'));var Papa=require('papaparse');var Redis=require(_0x2bc7('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2bc7('0x11'));var hardwareService=require(_0x2bc7('0x12'));var logger=require(_0x2bc7('0x13'))('api');var utils=require(_0x2bc7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2bc7('0x15'));var db=require(_0x2bc7('0x16'))['db'];function respondWithStatusCode(_0x2637af,_0x27ee4a){_0x27ee4a=_0x27ee4a||0xcc;return function(_0x1e2141){if(_0x1e2141){return _0x2637af[_0x2bc7('0x17')](_0x27ee4a);}return _0x2637af[_0x2bc7('0x18')](_0x27ee4a)[_0x2bc7('0x19')]();};}function respondWithResult(_0x317ab2,_0x69f582){_0x69f582=_0x69f582||0xc8;return function(_0x58ae98){if(_0x58ae98){return _0x317ab2[_0x2bc7('0x18')](_0x69f582)[_0x2bc7('0x1a')](_0x58ae98);}};}function respondWithFilteredResult(_0x5a1d7d,_0x339e43){return function(_0x50e00c){if(_0x50e00c){var _0x52a23d=typeof _0x339e43[_0x2bc7('0x1b')]==='undefined'&&typeof _0x339e43[_0x2bc7('0x1c')]===_0x2bc7('0x1d');var _0x1724ed=_0x50e00c[_0x2bc7('0x1e')];var _0x56a504=_0x52a23d?0x0:_0x339e43[_0x2bc7('0x1b')];var _0x12b7d0=_0x52a23d?_0x50e00c['count']:_0x339e43[_0x2bc7('0x1b')]+_0x339e43[_0x2bc7('0x1c')];var _0x27ca93;if(_0x12b7d0>=_0x1724ed){_0x12b7d0=_0x1724ed;_0x27ca93=0xc8;}else{_0x27ca93=0xce;}_0x5a1d7d[_0x2bc7('0x18')](_0x27ca93);return _0x5a1d7d['set'](_0x2bc7('0x1f'),_0x56a504+'-'+_0x12b7d0+'/'+_0x1724ed)['json'](_0x50e00c);}return null;};}function patchUpdates(_0x456b49){return function(_0x49a073){try{jsonpatch['apply'](_0x49a073,_0x456b49,!![]);}catch(_0xc0ad24){return BPromise[_0x2bc7('0x20')](_0xc0ad24);}return _0x49a073['save']();};}function saveUpdates(_0x57ae67,_0x80950a){return function(_0x5edd4a){if(_0x5edd4a){return _0x5edd4a[_0x2bc7('0x21')](_0x57ae67)[_0x2bc7('0x22')](function(_0xe56ed5){return _0xe56ed5;});}return null;};}function removeEntity(_0x491c3b,_0x3e9ee6){return function(_0x4240d4){if(_0x4240d4){return _0x4240d4[_0x2bc7('0x23')]()[_0x2bc7('0x22')](function(){_0x491c3b['status'](0xcc)[_0x2bc7('0x19')]();});}};}function handleEntityNotFound(_0x33a78b,_0x4515a0){return function(_0x1e82f7){if(!_0x1e82f7){_0x33a78b[_0x2bc7('0x17')](0x194);}return _0x1e82f7;};}function handleError(_0x199faa,_0x446342){_0x446342=_0x446342||0x1f4;return function(_0x54e2b7){logger[_0x2bc7('0x24')](_0x54e2b7[_0x2bc7('0x25')]);if(_0x54e2b7[_0x2bc7('0x26')]){delete _0x54e2b7['name'];}_0x199faa[_0x2bc7('0x18')](_0x446342)['send'](_0x54e2b7);};}exports[_0x2bc7('0x27')]=function(_0x26fcb1,_0x1f2431){var _0x4f81ef={},_0xc54fd4={},_0x53e7c5={'count':0x0,'rows':[]};var _0x29e3d7=_[_0x2bc7('0x28')](db['SquareMessage'][_0x2bc7('0x29')],function(_0x58a382){return{'name':_0x58a382['fieldName'],'type':_0x58a382[_0x2bc7('0x2a')]['key']};});_0xc54fd4['model']=_['map'](_0x29e3d7,_0x2bc7('0x26'));_0xc54fd4[_0x2bc7('0x2b')]=_[_0x2bc7('0x2c')](_0x26fcb1[_0x2bc7('0x2b')]);_0xc54fd4[_0x2bc7('0x2d')]=_[_0x2bc7('0x2e')](_0xc54fd4[_0x2bc7('0x2f')],_0xc54fd4[_0x2bc7('0x2b')]);_0x4f81ef['attributes']=_['intersection'](_0xc54fd4[_0x2bc7('0x2f')],qs[_0x2bc7('0x30')](_0x26fcb1[_0x2bc7('0x2b')][_0x2bc7('0x30')]));_0x4f81ef['attributes']=_0x4f81ef[_0x2bc7('0x31')][_0x2bc7('0x32')]?_0x4f81ef[_0x2bc7('0x31')]:_0xc54fd4[_0x2bc7('0x2f')];if(!_0x26fcb1['query'][_0x2bc7('0x33')](_0x2bc7('0x34'))){_0x4f81ef[_0x2bc7('0x1c')]=qs[_0x2bc7('0x1c')](_0x26fcb1[_0x2bc7('0x2b')]['limit']);_0x4f81ef['offset']=qs[_0x2bc7('0x1b')](_0x26fcb1[_0x2bc7('0x2b')]['offset']);}_0x4f81ef[_0x2bc7('0x35')]=qs[_0x2bc7('0x36')](_0x26fcb1[_0x2bc7('0x2b')][_0x2bc7('0x36')]);_0x4f81ef['where']=qs[_0x2bc7('0x2d')](_['pick'](_0x26fcb1['query'],_0xc54fd4['filters']),_0x29e3d7);if(_0x26fcb1[_0x2bc7('0x2b')][_0x2bc7('0x37')]){_0x4f81ef[_0x2bc7('0x38')]=_[_0x2bc7('0x39')](_0x4f81ef[_0x2bc7('0x38')],{'$or':_[_0x2bc7('0x28')](_0x29e3d7,function(_0x266a0f){if(_0x266a0f['type']!=='VIRTUAL'){var _0x29cd3b={};_0x29cd3b[_0x266a0f[_0x2bc7('0x26')]]={'$like':'%'+_0x26fcb1[_0x2bc7('0x2b')][_0x2bc7('0x37')]+'%'};return _0x29cd3b;}})});}_0x4f81ef=_[_0x2bc7('0x39')]({},_0x4f81ef,_0x26fcb1[_0x2bc7('0x3a')]);var _0x5bf6d7={'where':_0x4f81ef[_0x2bc7('0x38')]};return db['SquareMessage'][_0x2bc7('0x1e')](_0x5bf6d7)[_0x2bc7('0x22')](function(_0x14ee18){_0x53e7c5['count']=_0x14ee18;if(_0x26fcb1['query'][_0x2bc7('0x3b')]){_0x4f81ef[_0x2bc7('0x3c')]=[{'all':!![]}];}return db[_0x2bc7('0x3d')][_0x2bc7('0x3e')](_0x4f81ef);})[_0x2bc7('0x22')](function(_0x434306){_0x53e7c5[_0x2bc7('0x3f')]=_0x434306;return _0x53e7c5;})[_0x2bc7('0x22')](respondWithFilteredResult(_0x1f2431,_0x4f81ef))[_0x2bc7('0x40')](handleError(_0x1f2431,null));};exports['show']=function(_0x1eeacc,_0x2ed559){var _0x110969={'raw':!![],'where':{'id':_0x1eeacc[_0x2bc7('0x41')]['id']}},_0x8cddf={};_0x8cddf['model']=_[_0x2bc7('0x2c')](db[_0x2bc7('0x3d')][_0x2bc7('0x29')]);_0x8cddf[_0x2bc7('0x2b')]=_[_0x2bc7('0x2c')](_0x1eeacc['query']);_0x8cddf[_0x2bc7('0x2d')]=_[_0x2bc7('0x2e')](_0x8cddf[_0x2bc7('0x2f')],_0x8cddf['query']);_0x110969[_0x2bc7('0x31')]=_['intersection'](_0x8cddf[_0x2bc7('0x2f')],qs[_0x2bc7('0x30')](_0x1eeacc['query'][_0x2bc7('0x30')]));_0x110969[_0x2bc7('0x31')]=_0x110969[_0x2bc7('0x31')][_0x2bc7('0x32')]?_0x110969[_0x2bc7('0x31')]:_0x8cddf[_0x2bc7('0x2f')];if(_0x1eeacc[_0x2bc7('0x2b')][_0x2bc7('0x3b')]){_0x110969['include']=[{'all':!![]}];}_0x110969=_[_0x2bc7('0x39')]({},_0x110969,_0x1eeacc[_0x2bc7('0x3a')]);return db[_0x2bc7('0x3d')][_0x2bc7('0x42')](_0x110969)[_0x2bc7('0x22')](handleEntityNotFound(_0x2ed559,null))[_0x2bc7('0x22')](respondWithResult(_0x2ed559,null))[_0x2bc7('0x40')](handleError(_0x2ed559,null));};exports[_0x2bc7('0x43')]=function(_0x2e4c04,_0x1b3f07){return db[_0x2bc7('0x3d')][_0x2bc7('0x43')](_0x2e4c04[_0x2bc7('0x44')],{})[_0x2bc7('0x22')](respondWithResult(_0x1b3f07,0xc9))['catch'](handleError(_0x1b3f07,null));};exports[_0x2bc7('0x21')]=function(_0x3e1ed4,_0xf928cb){if(_0x3e1ed4[_0x2bc7('0x44')]['id']){delete _0x3e1ed4[_0x2bc7('0x44')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x3e1ed4['params']['id']}})['then'](handleEntityNotFound(_0xf928cb,null))[_0x2bc7('0x22')](saveUpdates(_0x3e1ed4[_0x2bc7('0x44')],null))[_0x2bc7('0x22')](respondWithResult(_0xf928cb,null))[_0x2bc7('0x40')](handleError(_0xf928cb,null));};exports[_0x2bc7('0x23')]=function(_0x4626c6,_0x2c345d){return db[_0x2bc7('0x3d')][_0x2bc7('0x42')]({'where':{'id':_0x4626c6[_0x2bc7('0x41')]['id']}})[_0x2bc7('0x22')](handleEntityNotFound(_0x2c345d,null))[_0x2bc7('0x22')](removeEntity(_0x2c345d,null))['catch'](handleError(_0x2c345d,null));}; \ No newline at end of file +var _0x38c1=['../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','SquareMessage','include','rows','catch','show','params','includeAll','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x1f808f,_0x172b10){var _0x282348=function(_0xfa8c2){while(--_0xfa8c2){_0x1f808f['push'](_0x1f808f['shift']());}};_0x282348(++_0x172b10);}(_0x38c1,0x7f));var _0x138c=function(_0x2b01a2,_0x3b4040){_0x2b01a2=_0x2b01a2-0x0;var _0xcce4ab=_0x38c1[_0x2b01a2];return _0xcce4ab;};'use strict';var emlformat=require(_0x138c('0x0'));var rimraf=require(_0x138c('0x1'));var zipdir=require(_0x138c('0x2'));var jsonpatch=require(_0x138c('0x3'));var rp=require(_0x138c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x138c('0x5'));var util=require(_0x138c('0x6'));var path=require(_0x138c('0x7'));var sox=require(_0x138c('0x8'));var csv=require(_0x138c('0x9'));var ejs=require(_0x138c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x138c('0xb'));var squel=require(_0x138c('0xc'));var crypto=require(_0x138c('0xd'));var jsforce=require(_0x138c('0xe'));var deskjs=require(_0x138c('0xf'));var toCsv=require(_0x138c('0x9'));var querystring=require(_0x138c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x138c('0x11'));var qs=require(_0x138c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x138c('0x13'))('api');var utils=require(_0x138c('0x14'));var config=require(_0x138c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x138c('0x16'))['db'];function respondWithStatusCode(_0x11f8b5,_0x518468){_0x518468=_0x518468||0xcc;return function(_0x2da971){if(_0x2da971){return _0x11f8b5[_0x138c('0x17')](_0x518468);}return _0x11f8b5[_0x138c('0x18')](_0x518468)[_0x138c('0x19')]();};}function respondWithResult(_0x5313c6,_0xf42e9b){_0xf42e9b=_0xf42e9b||0xc8;return function(_0x28896a){if(_0x28896a){return _0x5313c6[_0x138c('0x18')](_0xf42e9b)['json'](_0x28896a);}};}function respondWithFilteredResult(_0x2a4ae3,_0x1a3560){return function(_0x2ab6ae){if(_0x2ab6ae){var _0x2b2fd8=typeof _0x1a3560[_0x138c('0x1a')]===_0x138c('0x1b')&&typeof _0x1a3560['limit']===_0x138c('0x1b');var _0x15a778=_0x2ab6ae[_0x138c('0x1c')];var _0x1a7bdf=_0x2b2fd8?0x0:_0x1a3560[_0x138c('0x1a')];var _0x393f2a=_0x2b2fd8?_0x2ab6ae['count']:_0x1a3560[_0x138c('0x1a')]+_0x1a3560[_0x138c('0x1d')];var _0x351f5e;if(_0x393f2a>=_0x15a778){_0x393f2a=_0x15a778;_0x351f5e=0xc8;}else{_0x351f5e=0xce;}_0x2a4ae3[_0x138c('0x18')](_0x351f5e);return _0x2a4ae3[_0x138c('0x1e')](_0x138c('0x1f'),_0x1a7bdf+'-'+_0x393f2a+'/'+_0x15a778)[_0x138c('0x20')](_0x2ab6ae);}return null;};}function patchUpdates(_0x156738){return function(_0xb4b501){try{jsonpatch[_0x138c('0x21')](_0xb4b501,_0x156738,!![]);}catch(_0x4a4741){return BPromise[_0x138c('0x22')](_0x4a4741);}return _0xb4b501['save']();};}function saveUpdates(_0x9225f6,_0x5db8e0){return function(_0x5a93df){if(_0x5a93df){return _0x5a93df[_0x138c('0x23')](_0x9225f6)['then'](function(_0x377acc){return _0x377acc;});}return null;};}function removeEntity(_0x114df4,_0x2aa302){return function(_0x14ad50){if(_0x14ad50){return _0x14ad50[_0x138c('0x24')]()[_0x138c('0x25')](function(){_0x114df4[_0x138c('0x18')](0xcc)[_0x138c('0x19')]();});}};}function handleEntityNotFound(_0x1fb283,_0x262f28){return function(_0x5c6ec1){if(!_0x5c6ec1){_0x1fb283['sendStatus'](0x194);}return _0x5c6ec1;};}function handleError(_0x1e108e,_0x1e7fbd){_0x1e7fbd=_0x1e7fbd||0x1f4;return function(_0x39b233){logger[_0x138c('0x26')](_0x39b233[_0x138c('0x27')]);if(_0x39b233[_0x138c('0x28')]){delete _0x39b233['name'];}_0x1e108e[_0x138c('0x18')](_0x1e7fbd)[_0x138c('0x29')](_0x39b233);};}exports[_0x138c('0x2a')]=function(_0x12e446,_0x45f7dd){var _0x50b4bf={},_0x1d1abc={},_0x6d5c3e={'count':0x0,'rows':[]};var _0x32185b=_[_0x138c('0x2b')](db['SquareMessage'][_0x138c('0x2c')],function(_0x4e5244){return{'name':_0x4e5244['fieldName'],'type':_0x4e5244[_0x138c('0x2d')]['key']};});_0x1d1abc[_0x138c('0x2e')]=_[_0x138c('0x2b')](_0x32185b,'name');_0x1d1abc['query']=_[_0x138c('0x2f')](_0x12e446[_0x138c('0x30')]);_0x1d1abc[_0x138c('0x31')]=_[_0x138c('0x32')](_0x1d1abc[_0x138c('0x2e')],_0x1d1abc[_0x138c('0x30')]);_0x50b4bf[_0x138c('0x33')]=_[_0x138c('0x32')](_0x1d1abc[_0x138c('0x2e')],qs[_0x138c('0x34')](_0x12e446[_0x138c('0x30')][_0x138c('0x34')]));_0x50b4bf[_0x138c('0x33')]=_0x50b4bf[_0x138c('0x33')]['length']?_0x50b4bf[_0x138c('0x33')]:_0x1d1abc['model'];if(!_0x12e446['query'][_0x138c('0x35')](_0x138c('0x36'))){_0x50b4bf['limit']=qs[_0x138c('0x1d')](_0x12e446[_0x138c('0x30')][_0x138c('0x1d')]);_0x50b4bf[_0x138c('0x1a')]=qs[_0x138c('0x1a')](_0x12e446[_0x138c('0x30')][_0x138c('0x1a')]);}_0x50b4bf['order']=qs[_0x138c('0x37')](_0x12e446[_0x138c('0x30')][_0x138c('0x37')]);_0x50b4bf[_0x138c('0x38')]=qs[_0x138c('0x31')](_[_0x138c('0x39')](_0x12e446[_0x138c('0x30')],_0x1d1abc['filters']),_0x32185b);if(_0x12e446[_0x138c('0x30')][_0x138c('0x3a')]){_0x50b4bf['where']=_['merge'](_0x50b4bf['where'],{'$or':_[_0x138c('0x2b')](_0x32185b,function(_0x574ebb){if(_0x574ebb['type']!==_0x138c('0x3b')){var _0x6c8219={};_0x6c8219[_0x574ebb['name']]={'$like':'%'+_0x12e446[_0x138c('0x30')][_0x138c('0x3a')]+'%'};return _0x6c8219;}})});}_0x50b4bf=_['merge']({},_0x50b4bf,_0x12e446[_0x138c('0x3c')]);var _0x57ad79={'where':_0x50b4bf[_0x138c('0x38')]};return db[_0x138c('0x3d')][_0x138c('0x1c')](_0x57ad79)[_0x138c('0x25')](function(_0x1539b1){_0x6d5c3e[_0x138c('0x1c')]=_0x1539b1;if(_0x12e446[_0x138c('0x30')]['includeAll']){_0x50b4bf[_0x138c('0x3e')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x50b4bf);})['then'](function(_0x59f013){_0x6d5c3e[_0x138c('0x3f')]=_0x59f013;return _0x6d5c3e;})[_0x138c('0x25')](respondWithFilteredResult(_0x45f7dd,_0x50b4bf))[_0x138c('0x40')](handleError(_0x45f7dd,null));};exports[_0x138c('0x41')]=function(_0x1258ce,_0x38f23f){var _0x19a226={'raw':!![],'where':{'id':_0x1258ce[_0x138c('0x42')]['id']}},_0x120e68={};_0x120e68[_0x138c('0x2e')]=_[_0x138c('0x2f')](db[_0x138c('0x3d')]['rawAttributes']);_0x120e68[_0x138c('0x30')]=_[_0x138c('0x2f')](_0x1258ce[_0x138c('0x30')]);_0x120e68['filters']=_[_0x138c('0x32')](_0x120e68[_0x138c('0x2e')],_0x120e68[_0x138c('0x30')]);_0x19a226[_0x138c('0x33')]=_[_0x138c('0x32')](_0x120e68[_0x138c('0x2e')],qs['fields'](_0x1258ce[_0x138c('0x30')][_0x138c('0x34')]));_0x19a226['attributes']=_0x19a226[_0x138c('0x33')]['length']?_0x19a226[_0x138c('0x33')]:_0x120e68[_0x138c('0x2e')];if(_0x1258ce[_0x138c('0x30')][_0x138c('0x43')]){_0x19a226['include']=[{'all':!![]}];}_0x19a226=_[_0x138c('0x44')]({},_0x19a226,_0x1258ce[_0x138c('0x3c')]);return db[_0x138c('0x3d')][_0x138c('0x45')](_0x19a226)[_0x138c('0x25')](handleEntityNotFound(_0x38f23f,null))[_0x138c('0x25')](respondWithResult(_0x38f23f,null))['catch'](handleError(_0x38f23f,null));};exports[_0x138c('0x46')]=function(_0x1b7dc6,_0x3425a2){return db[_0x138c('0x3d')]['create'](_0x1b7dc6['body'],{})['then'](respondWithResult(_0x3425a2,0xc9))[_0x138c('0x40')](handleError(_0x3425a2,null));};exports[_0x138c('0x23')]=function(_0x2d701c,_0x3efd7d){if(_0x2d701c['body']['id']){delete _0x2d701c['body']['id'];}return db[_0x138c('0x3d')][_0x138c('0x45')]({'where':{'id':_0x2d701c[_0x138c('0x42')]['id']}})[_0x138c('0x25')](handleEntityNotFound(_0x3efd7d,null))[_0x138c('0x25')](saveUpdates(_0x2d701c[_0x138c('0x47')],null))['then'](respondWithResult(_0x3efd7d,null))[_0x138c('0x40')](handleError(_0x3efd7d,null));};exports['destroy']=function(_0xfa3a08,_0x42069d){return db[_0x138c('0x3d')][_0x138c('0x45')]({'where':{'id':_0xfa3a08[_0x138c('0x42')]['id']}})['then'](handleEntityNotFound(_0x42069d,null))[_0x138c('0x25')](removeEntity(_0x42069d,null))[_0x138c('0x40')](handleError(_0x42069d,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 5a117ad..613713d 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 _0xbd2e=['path','rimraf','../../config/environment','./squareMessage.attributes','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xbd2e,0x166));var _0xebd2=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbd2e[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xebd2('0x0'));var util=require('util');var logger=require(_0xebd2('0x1'))(_0xebd2('0x2'));var moment=require(_0xebd2('0x3'));var BPromise=require(_0xebd2('0x4'));var rp=require(_0xebd2('0x5'));var fs=require('fs');var path=require(_0xebd2('0x6'));var rimraf=require(_0xebd2('0x7'));var config=require(_0xebd2('0x8'));var attributes=require(_0xebd2('0x9'));module['exports']=function(_0x9ce4a0,_0xcd59){return _0x9ce4a0[_0xebd2('0xa')](_0xebd2('0xb'),attributes,{'tableName':_0xebd2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb13b=['rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','path'];(function(_0x3d6843,_0x309cd0){var _0x291cd6=function(_0x34d643){while(--_0x34d643){_0x3d6843['push'](_0x3d6843['shift']());}};_0x291cd6(++_0x309cd0);}(_0xb13b,0xc7));var _0xbb13=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xb13b[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0xbb13('0x0'));var util=require('util');var logger=require(_0xbb13('0x1'))(_0xbb13('0x2'));var moment=require(_0xbb13('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb13('0x4'));var rimraf=require(_0xbb13('0x5'));var config=require(_0xbb13('0x6'));var attributes=require(_0xbb13('0x7'));module[_0xbb13('0x8')]=function(_0x3f1e99,_0x30e699){return _0x3f1e99[_0xbb13('0x9')](_0xbb13('0xa'),attributes,{'tableName':_0xbb13('0xb'),'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 752479b..935b5de 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 _0x46b3=['code','message','catch','CreateSquareMessage','create','body','options','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x46b3,0x1ac));var _0x346b=function(_0x475a96,_0x3fecf8){_0x475a96=_0x475a96-0x0;var _0x34bf94=_0x46b3[_0x475a96];return _0x34bf94;};'use strict';var _=require(_0x346b('0x0'));var util=require(_0x346b('0x1'));var moment=require('moment');var BPromise=require(_0x346b('0x2'));var rs=require(_0x346b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x346b('0x4'))['db'];var utils=require(_0x346b('0x5'));var logger=require('../../config/logger')(_0x346b('0x6'));var config=require(_0x346b('0x7'));var jayson=require(_0x346b('0x8'));var client=jayson[_0x346b('0x9')][_0x346b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x307ba2,_0x80444c,_0x132a57){return new BPromise(function(_0x2554f5,_0x2393da){return client[_0x346b('0xb')](_0x307ba2,_0x132a57)[_0x346b('0xc')](function(_0x28895f){logger[_0x346b('0xd')](_0x346b('0xe'),_0x80444c,_0x346b('0xf'));logger[_0x346b('0x10')](_0x346b('0x11'),_0x80444c,_0x346b('0xf'),JSON[_0x346b('0x12')](_0x28895f));if(_0x28895f[_0x346b('0x13')]){if(_0x28895f['error'][_0x346b('0x14')]===0x1f4){logger[_0x346b('0x13')](_0x346b('0xe'),_0x80444c,_0x28895f[_0x346b('0x13')][_0x346b('0x15')]);return _0x2393da(_0x28895f[_0x346b('0x13')][_0x346b('0x15')]);}logger['error'](_0x346b('0xe'),_0x80444c,_0x28895f[_0x346b('0x13')][_0x346b('0x15')]);return _0x2554f5(_0x28895f[_0x346b('0x13')][_0x346b('0x15')]);}else{logger[_0x346b('0xd')](_0x346b('0xe'),_0x80444c,_0x346b('0xf'));_0x2554f5(_0x28895f['result'][_0x346b('0x15')]);}})[_0x346b('0x16')](function(_0x3163b0){logger['error'](_0x346b('0xe'),_0x80444c,_0x3163b0);_0x2393da(_0x3163b0);});});}exports[_0x346b('0x17')]=function(_0x1f520d){var _0x4f5a26=this;return new Promise(function(_0x1206ca,_0x381416){return db['SquareMessage'][_0x346b('0x18')](_0x1f520d[_0x346b('0x19')],{'raw':_0x1f520d[_0x346b('0x1a')]?_0x1f520d[_0x346b('0x1a')][_0x346b('0x1b')]===undefined?!![]:![]:!![]})[_0x346b('0xc')](function(_0xef1a36){logger[_0x346b('0xd')]('CreateSquareMessage',_0x1f520d);logger[_0x346b('0x10')](_0x346b('0x17'),_0x1f520d,JSON[_0x346b('0x12')](_0xef1a36));_0x1206ca(_0xef1a36);})['catch'](function(_0x231ad6){logger[_0x346b('0x13')](_0x346b('0x17'),_0x231ad6[_0x346b('0x15')],_0x1f520d);_0x381416(_0x4f5a26[_0x346b('0x13')](0x1f4,_0x231ad6[_0x346b('0x15')]));});});}; \ No newline at end of file +var _0xea48=['request\x20sent','debug','error','code','message','result','catch','SquareMessage','create','body','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','SquareMessage,\x20%s,\x20%s'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0xea48,0x178));var _0x8ea4=function(_0x1d3241,_0x587d91){_0x1d3241=_0x1d3241-0x0;var _0x3a55a5=_0xea48[_0x1d3241];return _0x3a55a5;};'use strict';var _=require(_0x8ea4('0x0'));var util=require(_0x8ea4('0x1'));var moment=require(_0x8ea4('0x2'));var BPromise=require(_0x8ea4('0x3'));var rs=require(_0x8ea4('0x4'));var fs=require('fs');var Redis=require(_0x8ea4('0x5'));var db=require(_0x8ea4('0x6'))['db'];var utils=require(_0x8ea4('0x7'));var logger=require('../../config/logger')(_0x8ea4('0x8'));var config=require(_0x8ea4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8ea4('0xa')][_0x8ea4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4321a8,_0x47541c,_0x19f4ae){return new BPromise(function(_0x4f1af2,_0x310f2b){return client['request'](_0x4321a8,_0x19f4ae)['then'](function(_0x556565){logger[_0x8ea4('0xc')](_0x8ea4('0xd'),_0x47541c,_0x8ea4('0xe'));logger[_0x8ea4('0xf')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x47541c,_0x8ea4('0xe'),JSON['stringify'](_0x556565));if(_0x556565[_0x8ea4('0x10')]){if(_0x556565[_0x8ea4('0x10')][_0x8ea4('0x11')]===0x1f4){logger[_0x8ea4('0x10')]('SquareMessage,\x20%s,\x20%s',_0x47541c,_0x556565[_0x8ea4('0x10')][_0x8ea4('0x12')]);return _0x310f2b(_0x556565[_0x8ea4('0x10')]['message']);}logger[_0x8ea4('0x10')](_0x8ea4('0xd'),_0x47541c,_0x556565[_0x8ea4('0x10')][_0x8ea4('0x12')]);return _0x4f1af2(_0x556565[_0x8ea4('0x10')][_0x8ea4('0x12')]);}else{logger[_0x8ea4('0xc')](_0x8ea4('0xd'),_0x47541c,_0x8ea4('0xe'));_0x4f1af2(_0x556565[_0x8ea4('0x13')]['message']);}})[_0x8ea4('0x14')](function(_0x20a881){logger[_0x8ea4('0x10')]('SquareMessage,\x20%s,\x20%s',_0x47541c,_0x20a881);_0x310f2b(_0x20a881);});});}exports['CreateSquareMessage']=function(_0x1497af){var _0x118158=this;return new Promise(function(_0x205c3a,_0x256216){return db[_0x8ea4('0x15')][_0x8ea4('0x16')](_0x1497af[_0x8ea4('0x17')],{'raw':_0x1497af['options']?_0x1497af['options'][_0x8ea4('0x18')]===undefined?!![]:![]:!![]})[_0x8ea4('0x19')](function(_0xa26a3c){logger['info']('CreateSquareMessage',_0x1497af);logger['debug']('CreateSquareMessage',_0x1497af,JSON['stringify'](_0xa26a3c));_0x205c3a(_0xa26a3c);})['catch'](function(_0x350abb){logger['error']('CreateSquareMessage',_0x350abb[_0x8ea4('0x12')],_0x1497af);_0x256216(_0x118158[_0x8ea4('0x10')](0x1f4,_0x350abb[_0x8ea4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index d8a652f..0e6e393 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 _0x3531=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','test','post','create','update','delete','destroy','exports'];(function(_0x32444a,_0x1d1591){var _0x431bee=function(_0x3bd4b3){while(--_0x3bd4b3){_0x32444a['push'](_0x32444a['shift']());}};_0x431bee(++_0x1d1591);}(_0x3531,0x165));var _0x1353=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x3531[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require(_0x1353('0x0'));var util=require(_0x1353('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1353('0x2'));var router=express[_0x1353('0x3')]();var fs_extra=require(_0x1353('0x4'));var auth=require(_0x1353('0x5'));var interaction=require(_0x1353('0x6'));var config=require(_0x1353('0x7'));var controller=require(_0x1353('0x8'));router[_0x1353('0x9')]('/',auth[_0x1353('0xa')](),controller[_0x1353('0xb')]);router[_0x1353('0x9')](_0x1353('0xc'),auth[_0x1353('0xa')](),controller[_0x1353('0xd')]);router['get']('/:id/test',auth[_0x1353('0xa')](),timeout('15s'),controller[_0x1353('0xe')]);router[_0x1353('0xf')]('/',auth[_0x1353('0xa')](),controller[_0x1353('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1353('0x11')]);router[_0x1353('0x12')](_0x1353('0xc'),auth[_0x1353('0xa')](),controller[_0x1353('0x13')]);module[_0x1353('0x14')]=router; \ No newline at end of file +var _0x9040=['update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','./squareOdbc.controller','get','isAuthenticated','/:id','show','/:id/test','15s','post','create'];(function(_0xc3aae7,_0x3bfa91){var _0x1f365a=function(_0x465838){while(--_0x465838){_0xc3aae7['push'](_0xc3aae7['shift']());}};_0x1f365a(++_0x3bfa91);}(_0x9040,0x121));var _0x0904=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x9040[_0x3054be];return _0x3df150;};'use strict';var multer=require('multer');var util=require(_0x0904('0x0'));var path=require('path');var timeout=require(_0x0904('0x1'));var express=require(_0x0904('0x2'));var router=express[_0x0904('0x3')]();var fs_extra=require(_0x0904('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0904('0x5'));var controller=require(_0x0904('0x6'));router[_0x0904('0x7')]('/',auth[_0x0904('0x8')](),controller['index']);router[_0x0904('0x7')](_0x0904('0x9'),auth[_0x0904('0x8')](),controller[_0x0904('0xa')]);router[_0x0904('0x7')](_0x0904('0xb'),auth[_0x0904('0x8')](),timeout(_0x0904('0xc')),controller['test']);router[_0x0904('0xd')]('/',auth[_0x0904('0x8')](),controller[_0x0904('0xe')]);router['put'](_0x0904('0x9'),auth[_0x0904('0x8')](),controller[_0x0904('0xf')]);router[_0x0904('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x0904('0x11')]);module[_0x0904('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 890a160..c455105 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 _0x7db1=['sequelize','exports','STRING','name'];(function(_0x57414f,_0x2f2ca9){var _0xe98996=function(_0x2430b6){while(--_0x2430b6){_0x57414f['push'](_0x57414f['shift']());}};_0xe98996(++_0x2f2ca9);}(_0x7db1,0xa0));var _0x17db=function(_0x559e51,_0x2836f7){_0x559e51=_0x559e51-0x0;var _0x3d228c=_0x7db1[_0x559e51];return _0x3d228c;};'use strict';var Sequelize=require(_0x17db('0x0'));module[_0x17db('0x1')]={'name':{'type':Sequelize[_0x17db('0x2')],'unique':_0x17db('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x17db('0x2')]},'description':{'type':Sequelize[_0x17db('0x2')]}}; \ No newline at end of file +var _0xde6f=['name','sequelize','STRING'];(function(_0x5b5d52,_0x380d08){var _0x4cfc05=function(_0x4a3658){while(--_0x4a3658){_0x5b5d52['push'](_0x5b5d52['shift']());}};_0x4cfc05(++_0x380d08);}(_0xde6f,0xdf));var _0xfde6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde6f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xfde6('0x0'));module['exports']={'name':{'type':Sequelize[_0xfde6('0x1')],'unique':_0xfde6('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xfde6('0x1')]},'description':{'type':Sequelize[_0xfde6('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 797c0af..c103425 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 _0xc32e=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','odbc','openSync','dsn','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','get','ODBC','destroy','error','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','where','filters','pick','filter','VIRTUAL','merge','options','SquareOdbc','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','user'];(function(_0x50a684,_0x13e443){var _0x3e3fe3=function(_0x24b6bf){while(--_0x24b6bf){_0x50a684['push'](_0x50a684['shift']());}};_0x3e3fe3(++_0x13e443);}(_0xc32e,0xac));var _0xec32=function(_0x1ce86e,_0x2008d3){_0x1ce86e=_0x1ce86e-0x0;var _0x3e4c87=_0xc32e[_0x1ce86e];return _0x3e4c87;};'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(_0xec32('0x0'));var moment=require(_0xec32('0x1'));var BPromise=require(_0xec32('0x2'));var Mustache=require(_0xec32('0x3'));var util=require('util');var path=require('path');var sox=require(_0xec32('0x4'));var csv=require('to-csv');var ejs=require(_0xec32('0x5'));var fs=require('fs');var fs_extra=require(_0xec32('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xec32('0x7'));var jsforce=require('jsforce');var deskjs=require(_0xec32('0x8'));var toCsv=require(_0xec32('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xec32('0xa'));var authService=require(_0xec32('0xb'));var qs=require(_0xec32('0xc'));var as=require(_0xec32('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec32('0xe'))(_0xec32('0xf'));var utils=require(_0xec32('0x10'));var config=require(_0xec32('0x11'));var licenseUtil=require(_0xec32('0x12'));var db=require(_0xec32('0x13'))['db'];function respondWithStatusCode(_0x47c99a,_0x4553ca){_0x4553ca=_0x4553ca||0xcc;return function(_0x3d07d7){if(_0x3d07d7){return _0x47c99a[_0xec32('0x14')](_0x4553ca);}return _0x47c99a[_0xec32('0x15')](_0x4553ca)[_0xec32('0x16')]();};}function respondWithResult(_0x4f370f,_0xb4ab64){_0xb4ab64=_0xb4ab64||0xc8;return function(_0x472b02){if(_0x472b02){return _0x4f370f[_0xec32('0x15')](_0xb4ab64)[_0xec32('0x17')](_0x472b02);}};}function respondWithFilteredResult(_0x5f3a78,_0x96b1e6){return function(_0x479c81){if(_0x479c81){var _0x2808e3=typeof _0x96b1e6[_0xec32('0x18')]===_0xec32('0x19')&&typeof _0x96b1e6['limit']===_0xec32('0x19');var _0x49dfe3=_0x479c81[_0xec32('0x1a')];var _0x14b069=_0x2808e3?0x0:_0x96b1e6[_0xec32('0x18')];var _0x112173=_0x2808e3?_0x479c81[_0xec32('0x1a')]:_0x96b1e6[_0xec32('0x18')]+_0x96b1e6[_0xec32('0x1b')];var _0x925777;if(_0x112173>=_0x49dfe3){_0x112173=_0x49dfe3;_0x925777=0xc8;}else{_0x925777=0xce;}_0x5f3a78[_0xec32('0x15')](_0x925777);return _0x5f3a78[_0xec32('0x1c')](_0xec32('0x1d'),_0x14b069+'-'+_0x112173+'/'+_0x49dfe3)['json'](_0x479c81);}return null;};}function patchUpdates(_0x34c1de){return function(_0x2c12bc){try{jsonpatch[_0xec32('0x1e')](_0x2c12bc,_0x34c1de,!![]);}catch(_0x25b678){return BPromise[_0xec32('0x1f')](_0x25b678);}return _0x2c12bc['save']();};}function saveUpdates(_0x473fbd,_0x5b5b7d){return function(_0x17d8d2){if(_0x17d8d2){return _0x17d8d2['update'](_0x473fbd)[_0xec32('0x20')](function(_0xc5c732){return _0xc5c732;});}return null;};}function removeEntity(_0x121e2b,_0x5a7d82){return function(_0x3f205d){if(_0x3f205d){return _0x3f205d['destroy']()[_0xec32('0x20')](function(){var _0x445a4d=_0x3f205d[_0xec32('0x21')]({'plain':!![]});var _0x3fbca6=_0xec32('0x22');return db['UserProfileResource'][_0xec32('0x23')]({'where':{'type':_0x3fbca6,'resourceId':_0x445a4d['id']}})['then'](function(){return _0x3f205d;});})['then'](function(){_0x121e2b[_0xec32('0x15')](0xcc)[_0xec32('0x16')]();});}};}function handleEntityNotFound(_0x445672,_0x3e3549){return function(_0x297e4b){if(!_0x297e4b){_0x445672['sendStatus'](0x194);}return _0x297e4b;};}function handleError(_0x3167ac,_0x574046){_0x574046=_0x574046||0x1f4;return function(_0x4a3794){logger[_0xec32('0x24')](_0x4a3794['stack']);if(_0x4a3794[_0xec32('0x25')]){delete _0x4a3794['name'];}_0x3167ac[_0xec32('0x15')](_0x574046)[_0xec32('0x26')](_0x4a3794);};}exports[_0xec32('0x27')]=function(_0x4c7373,_0x4b5c09){var _0x2b55bd={},_0x4e18be={},_0x1d4a76={'count':0x0,'rows':[]};var _0x16a34b=_[_0xec32('0x28')](db['SquareOdbc'][_0xec32('0x29')],function(_0x4cf14d){return{'name':_0x4cf14d[_0xec32('0x2a')],'type':_0x4cf14d[_0xec32('0x2b')]['key']};});_0x4e18be[_0xec32('0x2c')]=_[_0xec32('0x28')](_0x16a34b,_0xec32('0x25'));_0x4e18be[_0xec32('0x2d')]=_['keys'](_0x4c7373[_0xec32('0x2d')]);_0x4e18be['filters']=_['intersection'](_0x4e18be[_0xec32('0x2c')],_0x4e18be[_0xec32('0x2d')]);_0x2b55bd['attributes']=_[_0xec32('0x2e')](_0x4e18be[_0xec32('0x2c')],qs[_0xec32('0x2f')](_0x4c7373[_0xec32('0x2d')][_0xec32('0x2f')]));_0x2b55bd[_0xec32('0x30')]=_0x2b55bd['attributes']['length']?_0x2b55bd[_0xec32('0x30')]:_0x4e18be[_0xec32('0x2c')];if(!_0x4c7373[_0xec32('0x2d')][_0xec32('0x31')](_0xec32('0x32'))){_0x2b55bd[_0xec32('0x1b')]=qs[_0xec32('0x1b')](_0x4c7373[_0xec32('0x2d')][_0xec32('0x1b')]);_0x2b55bd[_0xec32('0x18')]=qs['offset'](_0x4c7373[_0xec32('0x2d')]['offset']);}_0x2b55bd['order']=qs['sort'](_0x4c7373['query']['sort']);_0x2b55bd[_0xec32('0x33')]=qs[_0xec32('0x34')](_[_0xec32('0x35')](_0x4c7373[_0xec32('0x2d')],_0x4e18be['filters']),_0x16a34b);if(_0x4c7373[_0xec32('0x2d')][_0xec32('0x36')]){_0x2b55bd[_0xec32('0x33')]=_['merge'](_0x2b55bd[_0xec32('0x33')],{'$or':_['map'](_0x16a34b,function(_0x43304f){if(_0x43304f['type']!==_0xec32('0x37')){var _0xc48db4={};_0xc48db4[_0x43304f['name']]={'$like':'%'+_0x4c7373['query'][_0xec32('0x36')]+'%'};return _0xc48db4;}})});}_0x2b55bd=_[_0xec32('0x38')]({},_0x2b55bd,_0x4c7373[_0xec32('0x39')]);var _0x349d80={'where':_0x2b55bd[_0xec32('0x33')]};return db[_0xec32('0x3a')][_0xec32('0x1a')](_0x349d80)[_0xec32('0x20')](function(_0x518a0f){_0x1d4a76['count']=_0x518a0f;if(_0x4c7373[_0xec32('0x2d')][_0xec32('0x3b')]){_0x2b55bd[_0xec32('0x3c')]=[{'all':!![]}];}return db[_0xec32('0x3a')][_0xec32('0x3d')](_0x2b55bd);})[_0xec32('0x20')](function(_0x24b195){_0x1d4a76[_0xec32('0x3e')]=_0x24b195;return _0x1d4a76;})['then'](respondWithFilteredResult(_0x4b5c09,_0x2b55bd))['catch'](handleError(_0x4b5c09,null));};exports[_0xec32('0x3f')]=function(_0x59e529,_0x4041ea){var _0xd4b2d0={'raw':!![],'where':{'id':_0x59e529[_0xec32('0x40')]['id']}},_0x14ae8a={};_0x14ae8a[_0xec32('0x2c')]=_[_0xec32('0x41')](db[_0xec32('0x3a')][_0xec32('0x29')]);_0x14ae8a[_0xec32('0x2d')]=_['keys'](_0x59e529[_0xec32('0x2d')]);_0x14ae8a[_0xec32('0x34')]=_['intersection'](_0x14ae8a[_0xec32('0x2c')],_0x14ae8a[_0xec32('0x2d')]);_0xd4b2d0[_0xec32('0x30')]=_[_0xec32('0x2e')](_0x14ae8a[_0xec32('0x2c')],qs[_0xec32('0x2f')](_0x59e529[_0xec32('0x2d')][_0xec32('0x2f')]));_0xd4b2d0[_0xec32('0x30')]=_0xd4b2d0[_0xec32('0x30')][_0xec32('0x42')]?_0xd4b2d0['attributes']:_0x14ae8a[_0xec32('0x2c')];if(_0x59e529[_0xec32('0x2d')]['includeAll']){_0xd4b2d0[_0xec32('0x3c')]=[{'all':!![]}];}_0xd4b2d0=_['merge']({},_0xd4b2d0,_0x59e529[_0xec32('0x39')]);return db['SquareOdbc'][_0xec32('0x43')](_0xd4b2d0)[_0xec32('0x20')](handleEntityNotFound(_0x4041ea,null))[_0xec32('0x20')](respondWithResult(_0x4041ea,null))[_0xec32('0x44')](handleError(_0x4041ea,null));};exports['create']=function(_0x301622,_0x11aaa3){return db[_0xec32('0x3a')][_0xec32('0x45')](_0x301622['body'],{})['then'](function(_0x59fd56){var _0x339529=_0x301622[_0xec32('0x46')][_0xec32('0x21')]({'plain':!![]});if(!_0x339529)throw new Error(_0xec32('0x47'));if(_0x339529['role']===_0xec32('0x46')){var _0x4b89bb=_0x59fd56['get']({'plain':!![]});var _0x32e81c=_0xec32('0x22');return db[_0xec32('0x48')]['find']({'where':{'name':_0x32e81c,'userProfileId':_0x339529['userProfileId']},'raw':!![]})[_0xec32('0x20')](function(_0x2806aa){if(_0x2806aa&&_0x2806aa[_0xec32('0x49')]===0x0){return db[_0xec32('0x4a')]['create']({'name':_0x4b89bb[_0xec32('0x25')],'resourceId':_0x4b89bb['id'],'type':_0x2806aa['name'],'sectionId':_0x2806aa['id']},{})['then'](function(){return _0x59fd56;});}else{return _0x59fd56;}})[_0xec32('0x44')](function(_0x24ebdb){logger[_0xec32('0x24')](_0xec32('0x4b'),_0x24ebdb);throw _0x24ebdb;});}return _0x59fd56;})[_0xec32('0x20')](respondWithResult(_0x11aaa3,0xc9))[_0xec32('0x44')](handleError(_0x11aaa3,null));};exports['update']=function(_0x41ec9b,_0x2dafb9){if(_0x41ec9b[_0xec32('0x4c')]['id']){delete _0x41ec9b['body']['id'];}return db[_0xec32('0x3a')][_0xec32('0x43')]({'where':{'id':_0x41ec9b[_0xec32('0x40')]['id']}})[_0xec32('0x20')](handleEntityNotFound(_0x2dafb9,null))[_0xec32('0x20')](saveUpdates(_0x41ec9b['body'],null))['then'](respondWithResult(_0x2dafb9,null))[_0xec32('0x44')](handleError(_0x2dafb9,null));};exports[_0xec32('0x23')]=function(_0x377ba8,_0x245214){return db[_0xec32('0x3a')]['find']({'where':{'id':_0x377ba8['params']['id']}})[_0xec32('0x20')](handleEntityNotFound(_0x245214,null))[_0xec32('0x20')](removeEntity(_0x245214,null))[_0xec32('0x44')](handleError(_0x245214,null));};exports[_0xec32('0x4d')]=function(_0x558049,_0x244d7d,_0x526516){var _0xde101a;return db[_0xec32('0x3a')][_0xec32('0x43')]({'where':{'id':_0x558049[_0xec32('0x40')]['id']},'attributes':['id','dsn']})[_0xec32('0x20')](handleEntityNotFound(_0x244d7d,null))[_0xec32('0x20')](function(_0x511334){if(_0x511334){var _0x45883f=require(_0xec32('0x4e'))();_0x45883f[_0xec32('0x4f')](_0x511334[_0xec32('0x50')]);_0x45883f['closeSync']();return _0x511334;}})[_0xec32('0x20')](respondWithResult(_0x244d7d,null))[_0xec32('0x44')](handleError(_0x244d7d,null));}; \ No newline at end of file +var _0xcbde=['../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','SquareOdbc','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ODBC','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1227ec,_0x285a7){var _0x587e85=function(_0x5d71ce){while(--_0x5d71ce){_0x1227ec['push'](_0x1227ec['shift']());}};_0x587e85(++_0x285a7);}(_0xcbde,0x159));var _0xecbd=function(_0x2a47a3,_0x2b3a5e){_0x2a47a3=_0x2a47a3-0x0;var _0x34936a=_0xcbde[_0x2a47a3];return _0x34936a;};'use strict';var emlformat=require(_0xecbd('0x0'));var rimraf=require(_0xecbd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xecbd('0x2'));var rp=require(_0xecbd('0x3'));var moment=require(_0xecbd('0x4'));var BPromise=require(_0xecbd('0x5'));var Mustache=require(_0xecbd('0x6'));var util=require(_0xecbd('0x7'));var path=require(_0xecbd('0x8'));var sox=require('sox');var csv=require(_0xecbd('0x9'));var ejs=require(_0xecbd('0xa'));var fs=require('fs');var fs_extra=require(_0xecbd('0xb'));var _=require(_0xecbd('0xc'));var squel=require(_0xecbd('0xd'));var crypto=require(_0xecbd('0xe'));var jsforce=require(_0xecbd('0xf'));var deskjs=require(_0xecbd('0x10'));var toCsv=require(_0xecbd('0x9'));var querystring=require(_0xecbd('0x11'));var Papa=require(_0xecbd('0x12'));var Redis=require(_0xecbd('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xecbd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xecbd('0x15'));var logger=require(_0xecbd('0x16'))(_0xecbd('0x17'));var utils=require(_0xecbd('0x18'));var config=require(_0xecbd('0x19'));var licenseUtil=require(_0xecbd('0x1a'));var db=require(_0xecbd('0x1b'))['db'];function respondWithStatusCode(_0x1586cc,_0x2fb551){_0x2fb551=_0x2fb551||0xcc;return function(_0x381e44){if(_0x381e44){return _0x1586cc[_0xecbd('0x1c')](_0x2fb551);}return _0x1586cc['status'](_0x2fb551)[_0xecbd('0x1d')]();};}function respondWithResult(_0x4547d9,_0x474e10){_0x474e10=_0x474e10||0xc8;return function(_0x2d62e4){if(_0x2d62e4){return _0x4547d9['status'](_0x474e10)[_0xecbd('0x1e')](_0x2d62e4);}};}function respondWithFilteredResult(_0x20de60,_0x3b78c7){return function(_0x3a1c52){if(_0x3a1c52){var _0xd55501=typeof _0x3b78c7[_0xecbd('0x1f')]===_0xecbd('0x20')&&typeof _0x3b78c7[_0xecbd('0x21')]===_0xecbd('0x20');var _0xa2f18d=_0x3a1c52[_0xecbd('0x22')];var _0x1affe4=_0xd55501?0x0:_0x3b78c7[_0xecbd('0x1f')];var _0x14ac48=_0xd55501?_0x3a1c52[_0xecbd('0x22')]:_0x3b78c7[_0xecbd('0x1f')]+_0x3b78c7['limit'];var _0x1acf34;if(_0x14ac48>=_0xa2f18d){_0x14ac48=_0xa2f18d;_0x1acf34=0xc8;}else{_0x1acf34=0xce;}_0x20de60[_0xecbd('0x23')](_0x1acf34);return _0x20de60[_0xecbd('0x24')](_0xecbd('0x25'),_0x1affe4+'-'+_0x14ac48+'/'+_0xa2f18d)['json'](_0x3a1c52);}return null;};}function patchUpdates(_0x24c6ac){return function(_0x32a312){try{jsonpatch[_0xecbd('0x26')](_0x32a312,_0x24c6ac,!![]);}catch(_0x54352e){return BPromise[_0xecbd('0x27')](_0x54352e);}return _0x32a312[_0xecbd('0x28')]();};}function saveUpdates(_0x13ff39,_0x8f512){return function(_0x321e2c){if(_0x321e2c){return _0x321e2c[_0xecbd('0x29')](_0x13ff39)[_0xecbd('0x2a')](function(_0x1a74c1){return _0x1a74c1;});}return null;};}function removeEntity(_0xad81b4,_0x6c6082){return function(_0x5dffbd){if(_0x5dffbd){return _0x5dffbd[_0xecbd('0x2b')]()['then'](function(){var _0x581000=_0x5dffbd[_0xecbd('0x2c')]({'plain':!![]});var _0x265263='ODBC';return db['UserProfileResource'][_0xecbd('0x2b')]({'where':{'type':_0x265263,'resourceId':_0x581000['id']}})[_0xecbd('0x2a')](function(){return _0x5dffbd;});})[_0xecbd('0x2a')](function(){_0xad81b4['status'](0xcc)[_0xecbd('0x1d')]();});}};}function handleEntityNotFound(_0x16d52f,_0x2ead91){return function(_0x5e7ddd){if(!_0x5e7ddd){_0x16d52f[_0xecbd('0x1c')](0x194);}return _0x5e7ddd;};}function handleError(_0x1907df,_0x114ef0){_0x114ef0=_0x114ef0||0x1f4;return function(_0x295e7e){logger[_0xecbd('0x2d')](_0x295e7e[_0xecbd('0x2e')]);if(_0x295e7e[_0xecbd('0x2f')]){delete _0x295e7e[_0xecbd('0x2f')];}_0x1907df[_0xecbd('0x23')](_0x114ef0)[_0xecbd('0x30')](_0x295e7e);};}exports['index']=function(_0x94fd62,_0x1db4c0){var _0x55e457={},_0x2bd41a={},_0x5307b1={'count':0x0,'rows':[]};var _0x461347=_[_0xecbd('0x31')](db['SquareOdbc']['rawAttributes'],function(_0x118377){return{'name':_0x118377[_0xecbd('0x32')],'type':_0x118377['type'][_0xecbd('0x33')]};});_0x2bd41a[_0xecbd('0x34')]=_[_0xecbd('0x31')](_0x461347,_0xecbd('0x2f'));_0x2bd41a['query']=_[_0xecbd('0x35')](_0x94fd62[_0xecbd('0x36')]);_0x2bd41a[_0xecbd('0x37')]=_[_0xecbd('0x38')](_0x2bd41a[_0xecbd('0x34')],_0x2bd41a[_0xecbd('0x36')]);_0x55e457[_0xecbd('0x39')]=_[_0xecbd('0x38')](_0x2bd41a['model'],qs[_0xecbd('0x3a')](_0x94fd62['query']['fields']));_0x55e457[_0xecbd('0x39')]=_0x55e457[_0xecbd('0x39')][_0xecbd('0x3b')]?_0x55e457[_0xecbd('0x39')]:_0x2bd41a['model'];if(!_0x94fd62['query'][_0xecbd('0x3c')](_0xecbd('0x3d'))){_0x55e457[_0xecbd('0x21')]=qs['limit'](_0x94fd62['query'][_0xecbd('0x21')]);_0x55e457[_0xecbd('0x1f')]=qs[_0xecbd('0x1f')](_0x94fd62[_0xecbd('0x36')][_0xecbd('0x1f')]);}_0x55e457[_0xecbd('0x3e')]=qs[_0xecbd('0x3f')](_0x94fd62['query'][_0xecbd('0x3f')]);_0x55e457[_0xecbd('0x40')]=qs[_0xecbd('0x37')](_['pick'](_0x94fd62['query'],_0x2bd41a[_0xecbd('0x37')]),_0x461347);if(_0x94fd62[_0xecbd('0x36')]['filter']){_0x55e457['where']=_[_0xecbd('0x41')](_0x55e457['where'],{'$or':_[_0xecbd('0x31')](_0x461347,function(_0x3fdb31){if(_0x3fdb31[_0xecbd('0x42')]!==_0xecbd('0x43')){var _0x4272d6={};_0x4272d6[_0x3fdb31[_0xecbd('0x2f')]]={'$like':'%'+_0x94fd62[_0xecbd('0x36')][_0xecbd('0x44')]+'%'};return _0x4272d6;}})});}_0x55e457=_[_0xecbd('0x41')]({},_0x55e457,_0x94fd62[_0xecbd('0x45')]);var _0x23099c={'where':_0x55e457[_0xecbd('0x40')]};return db[_0xecbd('0x46')][_0xecbd('0x22')](_0x23099c)[_0xecbd('0x2a')](function(_0x561db8){_0x5307b1[_0xecbd('0x22')]=_0x561db8;if(_0x94fd62[_0xecbd('0x36')][_0xecbd('0x47')]){_0x55e457[_0xecbd('0x48')]=[{'all':!![]}];}return db[_0xecbd('0x46')][_0xecbd('0x49')](_0x55e457);})[_0xecbd('0x2a')](function(_0x59fa22){_0x5307b1['rows']=_0x59fa22;return _0x5307b1;})[_0xecbd('0x2a')](respondWithFilteredResult(_0x1db4c0,_0x55e457))['catch'](handleError(_0x1db4c0,null));};exports[_0xecbd('0x4a')]=function(_0x395ac0,_0x4e0793){var _0x4d90cc={'raw':!![],'where':{'id':_0x395ac0[_0xecbd('0x4b')]['id']}},_0x3e344a={};_0x3e344a[_0xecbd('0x34')]=_[_0xecbd('0x35')](db[_0xecbd('0x46')][_0xecbd('0x4c')]);_0x3e344a[_0xecbd('0x36')]=_[_0xecbd('0x35')](_0x395ac0[_0xecbd('0x36')]);_0x3e344a[_0xecbd('0x37')]=_[_0xecbd('0x38')](_0x3e344a[_0xecbd('0x34')],_0x3e344a[_0xecbd('0x36')]);_0x4d90cc['attributes']=_[_0xecbd('0x38')](_0x3e344a[_0xecbd('0x34')],qs[_0xecbd('0x3a')](_0x395ac0['query'][_0xecbd('0x3a')]));_0x4d90cc['attributes']=_0x4d90cc[_0xecbd('0x39')]['length']?_0x4d90cc[_0xecbd('0x39')]:_0x3e344a[_0xecbd('0x34')];if(_0x395ac0['query'][_0xecbd('0x47')]){_0x4d90cc['include']=[{'all':!![]}];}_0x4d90cc=_[_0xecbd('0x41')]({},_0x4d90cc,_0x395ac0[_0xecbd('0x45')]);return db[_0xecbd('0x46')][_0xecbd('0x4d')](_0x4d90cc)[_0xecbd('0x2a')](handleEntityNotFound(_0x4e0793,null))['then'](respondWithResult(_0x4e0793,null))[_0xecbd('0x4e')](handleError(_0x4e0793,null));};exports[_0xecbd('0x4f')]=function(_0x4eddce,_0x480157){return db[_0xecbd('0x46')][_0xecbd('0x4f')](_0x4eddce[_0xecbd('0x50')],{})[_0xecbd('0x2a')](function(_0x5f5a95){var _0x1628d2=_0x4eddce[_0xecbd('0x51')][_0xecbd('0x2c')]({'plain':!![]});if(!_0x1628d2)throw new Error(_0xecbd('0x52'));if(_0x1628d2['role']==='user'){var _0x29766a=_0x5f5a95['get']({'plain':!![]});var _0x4cb955=_0xecbd('0x53');return db[_0xecbd('0x54')]['find']({'where':{'name':_0x4cb955,'userProfileId':_0x1628d2['userProfileId']},'raw':!![]})[_0xecbd('0x2a')](function(_0x195c26){if(_0x195c26&&_0x195c26[_0xecbd('0x55')]===0x0){return db[_0xecbd('0x56')][_0xecbd('0x4f')]({'name':_0x29766a[_0xecbd('0x2f')],'resourceId':_0x29766a['id'],'type':_0x195c26[_0xecbd('0x2f')],'sectionId':_0x195c26['id']},{})[_0xecbd('0x2a')](function(){return _0x5f5a95;});}else{return _0x5f5a95;}})['catch'](function(_0x2d2276){logger[_0xecbd('0x2d')](_0xecbd('0x57'),_0x2d2276);throw _0x2d2276;});}return _0x5f5a95;})[_0xecbd('0x2a')](respondWithResult(_0x480157,0xc9))[_0xecbd('0x4e')](handleError(_0x480157,null));};exports['update']=function(_0x20745c,_0x401246){if(_0x20745c[_0xecbd('0x50')]['id']){delete _0x20745c[_0xecbd('0x50')]['id'];}return db[_0xecbd('0x46')][_0xecbd('0x4d')]({'where':{'id':_0x20745c[_0xecbd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x401246,null))[_0xecbd('0x2a')](saveUpdates(_0x20745c[_0xecbd('0x50')],null))[_0xecbd('0x2a')](respondWithResult(_0x401246,null))[_0xecbd('0x4e')](handleError(_0x401246,null));};exports['destroy']=function(_0x3fae72,_0x2b44e1){return db['SquareOdbc'][_0xecbd('0x4d')]({'where':{'id':_0x3fae72[_0xecbd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2b44e1,null))[_0xecbd('0x2a')](removeEntity(_0x2b44e1,null))[_0xecbd('0x4e')](handleError(_0x2b44e1,null));};exports[_0xecbd('0x58')]=function(_0x327771,_0x4a255a,_0x54cef3){var _0x310103;return db[_0xecbd('0x46')][_0xecbd('0x4d')]({'where':{'id':_0x327771[_0xecbd('0x4b')]['id']},'attributes':['id',_0xecbd('0x59')]})[_0xecbd('0x2a')](handleEntityNotFound(_0x4a255a,null))['then'](function(_0x160f4e){if(_0x160f4e){var _0x5f57a9=require(_0xecbd('0x5a'))();_0x5f57a9[_0xecbd('0x5b')](_0x160f4e[_0xecbd('0x59')]);_0x5f57a9[_0xecbd('0x5c')]();return _0x160f4e;}})[_0xecbd('0x2a')](respondWithResult(_0x4a255a,null))[_0xecbd('0x4e')](handleError(_0x4a255a,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index dc27629..bc943e5 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 _0xa6aa=['SquareOdbc','square_odbc','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','define'];(function(_0x24ee3c,_0x2b1b1e){var _0x2900bf=function(_0x3486c9){while(--_0x3486c9){_0x24ee3c['push'](_0x24ee3c['shift']());}};_0x2900bf(++_0x2b1b1e);}(_0xa6aa,0x182));var _0xaa6a=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xa6aa[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0xaa6a('0x0'));var util=require(_0xaa6a('0x1'));var logger=require('../../config/logger')(_0xaa6a('0x2'));var moment=require(_0xaa6a('0x3'));var BPromise=require(_0xaa6a('0x4'));var rp=require(_0xaa6a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa6a('0x6'));var config=require(_0xaa6a('0x7'));var attributes=require(_0xaa6a('0x8'));module['exports']=function(_0x36593c,_0x3fa6c9){return _0x36593c[_0xaa6a('0x9')](_0xaa6a('0xa'),attributes,{'tableName':_0xaa6a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84ff=['../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x5d7f8a,_0xc5488a){var _0x125d9f=function(_0x220e1a){while(--_0x220e1a){_0x5d7f8a['push'](_0x5d7f8a['shift']());}};_0x125d9f(++_0xc5488a);}(_0x84ff,0x13e));var _0xf84f=function(_0x34c76d,_0x7e8649){_0x34c76d=_0x34c76d-0x0;var _0x4512f6=_0x84ff[_0x34c76d];return _0x4512f6;};'use strict';var _=require(_0xf84f('0x0'));var util=require(_0xf84f('0x1'));var logger=require('../../config/logger')(_0xf84f('0x2'));var moment=require('moment');var BPromise=require(_0xf84f('0x3'));var rp=require(_0xf84f('0x4'));var fs=require('fs');var path=require(_0xf84f('0x5'));var rimraf=require(_0xf84f('0x6'));var config=require(_0xf84f('0x7'));var attributes=require(_0xf84f('0x8'));module[_0xf84f('0x9')]=function(_0x30e05a,_0x2c9820){return _0x30e05a[_0xf84f('0xa')](_0xf84f('0xb'),attributes,{'tableName':_0xf84f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 58da3d0..3a0201b 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 _0x6d53=['client','http','request','then','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','request\x20sent','result','catch','ShowSquareOdbc','SquareOdbc','find','options','where','include','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x6d53,0x1af));var _0x36d5=function(_0x5b869d,_0x4fdce9){_0x5b869d=_0x5b869d-0x0;var _0x35eec9=_0x6d53[_0x5b869d];return _0x35eec9;};'use strict';var _=require(_0x36d5('0x0'));var util=require(_0x36d5('0x1'));var moment=require(_0x36d5('0x2'));var BPromise=require(_0x36d5('0x3'));var rs=require(_0x36d5('0x4'));var fs=require('fs');var Redis=require(_0x36d5('0x5'));var db=require(_0x36d5('0x6'))['db'];var utils=require(_0x36d5('0x7'));var logger=require(_0x36d5('0x8'))(_0x36d5('0x9'));var config=require(_0x36d5('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x36d5('0xb')][_0x36d5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33f150,_0x30b3fe,_0x2d57bd){return new BPromise(function(_0x1598cf,_0xcb6c34){return client[_0x36d5('0xd')](_0x33f150,_0x2d57bd)[_0x36d5('0xe')](function(_0x11be67){logger[_0x36d5('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x30b3fe,'request\x20sent');logger[_0x36d5('0x10')](_0x36d5('0x11'),_0x30b3fe,'request\x20sent',JSON[_0x36d5('0x12')](_0x11be67));if(_0x11be67[_0x36d5('0x13')]){if(_0x11be67[_0x36d5('0x13')][_0x36d5('0x14')]===0x1f4){logger[_0x36d5('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x30b3fe,_0x11be67[_0x36d5('0x13')]['message']);return _0xcb6c34(_0x11be67['error']['message']);}logger['error'](_0x36d5('0x15'),_0x30b3fe,_0x11be67[_0x36d5('0x13')][_0x36d5('0x16')]);return _0x1598cf(_0x11be67[_0x36d5('0x13')][_0x36d5('0x16')]);}else{logger[_0x36d5('0xf')](_0x36d5('0x15'),_0x30b3fe,_0x36d5('0x17'));_0x1598cf(_0x11be67[_0x36d5('0x18')][_0x36d5('0x16')]);}})[_0x36d5('0x19')](function(_0x3b66cd){logger[_0x36d5('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x30b3fe,_0x3b66cd);_0xcb6c34(_0x3b66cd);});});}exports[_0x36d5('0x1a')]=function(_0x26c3c2){var _0x3827a6=this;return new Promise(function(_0x14fabd,_0x3a01fb){return db[_0x36d5('0x1b')][_0x36d5('0x1c')]({'raw':_0x26c3c2[_0x36d5('0x1d')]?_0x26c3c2[_0x36d5('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x26c3c2[_0x36d5('0x1d')]?_0x26c3c2[_0x36d5('0x1d')][_0x36d5('0x1e')]||null:null,'attributes':_0x26c3c2['options']?_0x26c3c2[_0x36d5('0x1d')]['attributes']||null:null,'include':_0x26c3c2[_0x36d5('0x1d')]?_0x26c3c2[_0x36d5('0x1d')][_0x36d5('0x1f')]?_['map'](_0x26c3c2['options'][_0x36d5('0x1f')],function(_0x4d2e58){return{'model':db[_0x4d2e58[_0x36d5('0x20')]],'as':_0x4d2e58['as'],'attributes':_0x4d2e58[_0x36d5('0x21')],'include':_0x4d2e58[_0x36d5('0x1f')]?_['map'](_0x4d2e58['include'],function(_0x39eece){return{'model':db[_0x39eece[_0x36d5('0x20')]],'as':_0x39eece['as'],'attributes':_0x39eece[_0x36d5('0x21')],'include':_0x39eece['include']?_['map'](_0x39eece[_0x36d5('0x1f')],function(_0x4ae06c){return{'model':db[_0x4ae06c['model']],'as':_0x4ae06c['as'],'attributes':_0x4ae06c['attributes']};}):[]};}):[]};}):[]:[]})[_0x36d5('0xe')](function(_0xd29649){logger[_0x36d5('0xf')]('ShowSquareOdbc',_0x26c3c2);logger[_0x36d5('0x10')](_0x36d5('0x1a'),_0x26c3c2,JSON[_0x36d5('0x12')](_0xd29649));_0x14fabd(_0xd29649);})['catch'](function(_0x8dcab1){logger[_0x36d5('0x13')](_0x36d5('0x1a'),_0x8dcab1[_0x36d5('0x16')],_0x26c3c2);_0x3a01fb(_0x3827a6[_0x36d5('0x13')](0x1f4,_0x8dcab1[_0x36d5('0x16')]));});});}; \ No newline at end of file +var _0x4d5a=['request\x20sent','error','SquareOdbc,\x20%s,\x20%s','message','result','SquareOdbc','find','options','where','attributes','include','map','model','then','ShowSquareOdbc','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x274a1e,_0x4fa1fc){var _0x5a0c3f=function(_0x398801){while(--_0x398801){_0x274a1e['push'](_0x274a1e['shift']());}};_0x5a0c3f(++_0x4fa1fc);}(_0x4d5a,0x1c2));var _0xa4d5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4d5a[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xa4d5('0x0'));var util=require(_0xa4d5('0x1'));var moment=require(_0xa4d5('0x2'));var BPromise=require('bluebird');var rs=require(_0xa4d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4d5('0x4'))['db'];var utils=require(_0xa4d5('0x5'));var logger=require('../../config/logger')(_0xa4d5('0x6'));var config=require(_0xa4d5('0x7'));var jayson=require(_0xa4d5('0x8'));var client=jayson[_0xa4d5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8b01cc,_0x5310b6,_0x586b7a){return new BPromise(function(_0x1bf802,_0x2570b6){return client[_0xa4d5('0xa')](_0x8b01cc,_0x586b7a)['then'](function(_0x405a6a){logger[_0xa4d5('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x5310b6,'request\x20sent');logger[_0xa4d5('0xc')](_0xa4d5('0xd'),_0x5310b6,_0xa4d5('0xe'),JSON['stringify'](_0x405a6a));if(_0x405a6a[_0xa4d5('0xf')]){if(_0x405a6a[_0xa4d5('0xf')]['code']===0x1f4){logger['error'](_0xa4d5('0x10'),_0x5310b6,_0x405a6a['error']['message']);return _0x2570b6(_0x405a6a[_0xa4d5('0xf')][_0xa4d5('0x11')]);}logger[_0xa4d5('0xf')](_0xa4d5('0x10'),_0x5310b6,_0x405a6a[_0xa4d5('0xf')][_0xa4d5('0x11')]);return _0x1bf802(_0x405a6a[_0xa4d5('0xf')][_0xa4d5('0x11')]);}else{logger[_0xa4d5('0xb')](_0xa4d5('0x10'),_0x5310b6,_0xa4d5('0xe'));_0x1bf802(_0x405a6a[_0xa4d5('0x12')][_0xa4d5('0x11')]);}})['catch'](function(_0x22069f){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x5310b6,_0x22069f);_0x2570b6(_0x22069f);});});}exports['ShowSquareOdbc']=function(_0x1dfcb4){var _0x57d959=this;return new Promise(function(_0x221da1,_0x23af00){return db[_0xa4d5('0x13')][_0xa4d5('0x14')]({'raw':_0x1dfcb4[_0xa4d5('0x15')]?_0x1dfcb4[_0xa4d5('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1dfcb4[_0xa4d5('0x15')]?_0x1dfcb4[_0xa4d5('0x15')][_0xa4d5('0x16')]||null:null,'attributes':_0x1dfcb4[_0xa4d5('0x15')]?_0x1dfcb4['options'][_0xa4d5('0x17')]||null:null,'include':_0x1dfcb4['options']?_0x1dfcb4[_0xa4d5('0x15')][_0xa4d5('0x18')]?_[_0xa4d5('0x19')](_0x1dfcb4[_0xa4d5('0x15')][_0xa4d5('0x18')],function(_0x536786){return{'model':db[_0x536786[_0xa4d5('0x1a')]],'as':_0x536786['as'],'attributes':_0x536786[_0xa4d5('0x17')],'include':_0x536786[_0xa4d5('0x18')]?_['map'](_0x536786[_0xa4d5('0x18')],function(_0x1a7396){return{'model':db[_0x1a7396[_0xa4d5('0x1a')]],'as':_0x1a7396['as'],'attributes':_0x1a7396[_0xa4d5('0x17')],'include':_0x1a7396[_0xa4d5('0x18')]?_['map'](_0x1a7396['include'],function(_0x26cdb9){return{'model':db[_0x26cdb9['model']],'as':_0x26cdb9['as'],'attributes':_0x26cdb9['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4d5('0x1b')](function(_0x3e0c78){logger[_0xa4d5('0xb')](_0xa4d5('0x1c'),_0x1dfcb4);logger[_0xa4d5('0xc')](_0xa4d5('0x1c'),_0x1dfcb4,JSON['stringify'](_0x3e0c78));_0x221da1(_0x3e0c78);})['catch'](function(_0x245ee7){logger[_0xa4d5('0xf')](_0xa4d5('0x1c'),_0x245ee7[_0xa4d5('0x11')],_0x1dfcb4);_0x23af00(_0x57d959[_0xa4d5('0xf')](0x1f4,_0x245ee7[_0xa4d5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 55db3ba..07c8e08 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 _0x23a3=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','/:id/users','post','create','addUsers','put','update','delete','connect-timeout'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x23a3,0x131));var _0x323a=function(_0x2ef4fc,_0x841c7c){_0x2ef4fc=_0x2ef4fc-0x0;var _0x568bc1=_0x23a3[_0x2ef4fc];return _0x568bc1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x323a('0x0'));var express=require('express');var router=express[_0x323a('0x1')]();var fs_extra=require(_0x323a('0x2'));var auth=require(_0x323a('0x3'));var interaction=require(_0x323a('0x4'));var config=require(_0x323a('0x5'));var controller=require(_0x323a('0x6'));router[_0x323a('0x7')]('/',auth[_0x323a('0x8')](),controller[_0x323a('0x9')]);router['get'](_0x323a('0xa'),auth[_0x323a('0x8')](),controller['show']);router[_0x323a('0x7')](_0x323a('0xb'),auth[_0x323a('0x8')](),controller['getUsers']);router[_0x323a('0xc')]('/',auth[_0x323a('0x8')](),controller[_0x323a('0xd')]);router[_0x323a('0xc')](_0x323a('0xb'),auth[_0x323a('0x8')](),controller[_0x323a('0xe')]);router[_0x323a('0xf')](_0x323a('0xa'),auth[_0x323a('0x8')](),controller[_0x323a('0x10')]);router[_0x323a('0x11')](_0x323a('0xa'),auth[_0x323a('0x8')](),controller['destroy']);router[_0x323a('0x11')]('/:id/users',auth[_0x323a('0x8')](),controller['removeUsers']);module['exports']=router; \ No newline at end of file +var _0x9458=['/:id/users','getUsers','post','put','update','delete','destroy','exports','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9458,0x1b8));var _0x8945=function(_0x18ed89,_0x129ce7){_0x18ed89=_0x18ed89-0x0;var _0x54232e=_0x9458[_0x18ed89];return _0x54232e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8945('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8945('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x8945('0x2'));var interaction=require(_0x8945('0x3'));var config=require(_0x8945('0x4'));var controller=require(_0x8945('0x5'));router[_0x8945('0x6')]('/',auth[_0x8945('0x7')](),controller[_0x8945('0x8')]);router[_0x8945('0x6')](_0x8945('0x9'),auth[_0x8945('0x7')](),controller['show']);router[_0x8945('0x6')](_0x8945('0xa'),auth[_0x8945('0x7')](),controller[_0x8945('0xb')]);router[_0x8945('0xc')]('/',auth[_0x8945('0x7')](),controller['create']);router[_0x8945('0xc')](_0x8945('0xa'),auth['isAuthenticated'](),controller['addUsers']);router[_0x8945('0xd')]('/:id',auth[_0x8945('0x7')](),controller[_0x8945('0xe')]);router[_0x8945('0xf')](_0x8945('0x9'),auth[_0x8945('0x7')](),controller[_0x8945('0x10')]);router['delete'](_0x8945('0xa'),auth[_0x8945('0x7')](),controller['removeUsers']);module[_0x8945('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 7fa4def..52858d0 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 _0x80c4=['long','preproduction','getDataValue','toString','utf8','production','DATE','sequelize','STRING','name','TEXT','BLOB'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x80c4,0xa3));var _0x480c=function(_0x6b47e2,_0x9a9230){_0x6b47e2=_0x6b47e2-0x0;var _0x494494=_0x80c4[_0x6b47e2];return _0x494494;};'use strict';var Sequelize=require(_0x480c('0x0'));module['exports']={'name':{'type':Sequelize[_0x480c('0x1')],'unique':_0x480c('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x480c('0x1')]},'notes':{'type':Sequelize[_0x480c('0x3')]},'preproduction':{'type':Sequelize[_0x480c('0x4')](_0x480c('0x5')),'get':function(){if(this['getDataValue'](_0x480c('0x6'))){return this[_0x480c('0x7')](_0x480c('0x6'))[_0x480c('0x8')](_0x480c('0x9'));}}},'production':{'type':Sequelize[_0x480c('0x4')](_0x480c('0x5')),'get':function(){if(this[_0x480c('0x7')](_0x480c('0xa'))){return this['getDataValue'](_0x480c('0xa'))[_0x480c('0x8')](_0x480c('0x9'));}}},'savedAt':{'type':Sequelize[_0x480c('0xb')]},'publishedAt':{'type':Sequelize[_0x480c('0xb')]}}; \ No newline at end of file +var _0xa329=['production','DATE','sequelize','exports','name','TEXT','BLOB','preproduction','getDataValue','toString','utf8'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xa329,0x162));var _0x9a32=function(_0x3b55ba,_0x4ebed6){_0x3b55ba=_0x3b55ba-0x0;var _0x20ad38=_0xa329[_0x3b55ba];return _0x20ad38;};'use strict';var Sequelize=require(_0x9a32('0x0'));module[_0x9a32('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9a32('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x9a32('0x3')]},'preproduction':{'type':Sequelize[_0x9a32('0x4')]('long'),'get':function(){if(this['getDataValue'](_0x9a32('0x5'))){return this[_0x9a32('0x6')](_0x9a32('0x5'))[_0x9a32('0x7')](_0x9a32('0x8'));}}},'production':{'type':Sequelize[_0x9a32('0x4')]('long'),'get':function(){if(this['getDataValue']('production')){return this[_0x9a32('0x6')](_0x9a32('0x9'))['toString'](_0x9a32('0x8'));}}},'savedAt':{'type':Sequelize[_0x9a32('0xa')]},'publishedAt':{'type':Sequelize[_0x9a32('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index cbfb0c9..2741809 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 _0x5c7c=['nolimit','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./squareProject.socket','register','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','SquareProjects','UserProfileResource','sendStatus','stack','name','map','SquareProject','rawAttributes','fieldName','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User'];(function(_0x5c4585,_0x59300c){var _0x32962a=function(_0x53323e){while(--_0x53323e){_0x5c4585['push'](_0x5c4585['shift']());}};_0x32962a(++_0x59300c);}(_0x5c7c,0xb9));var _0xc5c7=function(_0x25b298,_0x5d4fc6){_0x25b298=_0x25b298-0x0;var _0x2bc16c=_0x5c7c[_0x25b298];return _0x2bc16c;};'use strict';var emlformat=require(_0xc5c7('0x0'));var rimraf=require(_0xc5c7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc5c7('0x2'));var BPromise=require(_0xc5c7('0x3'));var Mustache=require(_0xc5c7('0x4'));var util=require(_0xc5c7('0x5'));var path=require(_0xc5c7('0x6'));var sox=require(_0xc5c7('0x7'));var csv=require(_0xc5c7('0x8'));var ejs=require(_0xc5c7('0x9'));var fs=require('fs');var fs_extra=require(_0xc5c7('0xa'));var _=require('lodash');var squel=require(_0xc5c7('0xb'));var crypto=require(_0xc5c7('0xc'));var jsforce=require(_0xc5c7('0xd'));var deskjs=require(_0xc5c7('0xe'));var toCsv=require(_0xc5c7('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc5c7('0xf'));var qs=require(_0xc5c7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c7('0x11'));var logger=require(_0xc5c7('0x12'))(_0xc5c7('0x13'));var utils=require('../../config/utils');var config=require(_0xc5c7('0x14'));var licenseUtil=require(_0xc5c7('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xc5c7('0x16')],{'host':_0xc5c7('0x17'),'port':0x18eb});var socket=require(_0xc5c7('0x18'))(new Redis(config[_0xc5c7('0x16')]));require(_0xc5c7('0x19'))[_0xc5c7('0x1a')](socket);function respondWithStatusCode(_0x19b516,_0x1de52c){_0x1de52c=_0x1de52c||0xcc;return function(_0x277466){if(_0x277466){return _0x19b516['sendStatus'](_0x1de52c);}return _0x19b516['status'](_0x1de52c)[_0xc5c7('0x1b')]();};}function respondWithResult(_0x3a9fba,_0x50d7ed){_0x50d7ed=_0x50d7ed||0xc8;return function(_0x267b07){if(_0x267b07){return _0x3a9fba[_0xc5c7('0x1c')](_0x50d7ed)[_0xc5c7('0x1d')](_0x267b07);}};}function respondWithFilteredResult(_0x3991be,_0x2927b8){return function(_0x4d99a8){if(_0x4d99a8){var _0x1fbca1=typeof _0x2927b8[_0xc5c7('0x1e')]===_0xc5c7('0x1f')&&typeof _0x2927b8[_0xc5c7('0x20')]===_0xc5c7('0x1f');var _0x4b6a8a=_0x4d99a8[_0xc5c7('0x21')];var _0x43bd3b=_0x1fbca1?0x0:_0x2927b8[_0xc5c7('0x1e')];var _0x13de6e=_0x1fbca1?_0x4d99a8['count']:_0x2927b8['offset']+_0x2927b8['limit'];var _0x28ba97;if(_0x13de6e>=_0x4b6a8a){_0x13de6e=_0x4b6a8a;_0x28ba97=0xc8;}else{_0x28ba97=0xce;}_0x3991be[_0xc5c7('0x1c')](_0x28ba97);return _0x3991be['set'](_0xc5c7('0x22'),_0x43bd3b+'-'+_0x13de6e+'/'+_0x4b6a8a)[_0xc5c7('0x1d')](_0x4d99a8);}return null;};}function patchUpdates(_0x39b559){return function(_0x55357e){try{jsonpatch['apply'](_0x55357e,_0x39b559,!![]);}catch(_0x2c00c8){return BPromise[_0xc5c7('0x23')](_0x2c00c8);}return _0x55357e[_0xc5c7('0x24')]();};}function saveUpdates(_0x23d535,_0x1640c6){return function(_0x4d10c2){if(_0x4d10c2){return _0x4d10c2[_0xc5c7('0x25')](_0x23d535)[_0xc5c7('0x26')](function(_0x107a0c){return _0x107a0c;});}return null;};}function removeEntity(_0x42f002,_0x459959){return function(_0x3b4efb){if(_0x3b4efb){return _0x3b4efb[_0xc5c7('0x27')]()[_0xc5c7('0x26')](function(){var _0x34f307=_0x3b4efb['get']({'plain':!![]});var _0x570be5=_0xc5c7('0x28');return db[_0xc5c7('0x29')][_0xc5c7('0x27')]({'where':{'type':_0x570be5,'resourceId':_0x34f307['id']}})[_0xc5c7('0x26')](function(){return _0x3b4efb;});})[_0xc5c7('0x26')](function(){_0x42f002['status'](0xcc)[_0xc5c7('0x1b')]();});}};}function handleEntityNotFound(_0x37e3fe,_0x215b73){return function(_0xd1be5e){if(!_0xd1be5e){_0x37e3fe[_0xc5c7('0x2a')](0x194);}return _0xd1be5e;};}function handleError(_0x22e777,_0xb3e3a7){_0xb3e3a7=_0xb3e3a7||0x1f4;return function(_0x468ec9){logger['error'](_0x468ec9[_0xc5c7('0x2b')]);if(_0x468ec9[_0xc5c7('0x2c')]){delete _0x468ec9[_0xc5c7('0x2c')];}_0x22e777['status'](_0xb3e3a7)['send'](_0x468ec9);};}exports['index']=function(_0x196d6f,_0x1d4fb1){var _0x518539={},_0x280cb0={},_0x466e91={'count':0x0,'rows':[]};var _0x31f480=_[_0xc5c7('0x2d')](db[_0xc5c7('0x2e')][_0xc5c7('0x2f')],function(_0x2b178f){return{'name':_0x2b178f[_0xc5c7('0x30')],'type':_0x2b178f['type'][_0xc5c7('0x31')]};});_0x280cb0['model']=_[_0xc5c7('0x2d')](_0x31f480,_0xc5c7('0x2c'));_0x280cb0['query']=_[_0xc5c7('0x32')](_0x196d6f[_0xc5c7('0x33')]);_0x280cb0[_0xc5c7('0x34')]=_[_0xc5c7('0x35')](_0x280cb0[_0xc5c7('0x36')],_0x280cb0[_0xc5c7('0x33')]);_0x518539['attributes']=_[_0xc5c7('0x35')](_0x280cb0[_0xc5c7('0x36')],qs['fields'](_0x196d6f[_0xc5c7('0x33')][_0xc5c7('0x37')]));_0x518539[_0xc5c7('0x38')]=_0x518539[_0xc5c7('0x38')][_0xc5c7('0x39')]?_0x518539[_0xc5c7('0x38')]:_0x280cb0[_0xc5c7('0x36')];if(!_0x196d6f[_0xc5c7('0x33')][_0xc5c7('0x3a')]('nolimit')){_0x518539[_0xc5c7('0x20')]=qs[_0xc5c7('0x20')](_0x196d6f[_0xc5c7('0x33')][_0xc5c7('0x20')]);_0x518539['offset']=qs[_0xc5c7('0x1e')](_0x196d6f[_0xc5c7('0x33')][_0xc5c7('0x1e')]);}_0x518539[_0xc5c7('0x3b')]=qs[_0xc5c7('0x3c')](_0x196d6f[_0xc5c7('0x33')][_0xc5c7('0x3c')]);_0x518539[_0xc5c7('0x3d')]=qs[_0xc5c7('0x34')](_[_0xc5c7('0x3e')](_0x196d6f[_0xc5c7('0x33')],_0x280cb0[_0xc5c7('0x34')]),_0x31f480);if(_0x196d6f[_0xc5c7('0x33')][_0xc5c7('0x3f')]){_0x518539[_0xc5c7('0x3d')]=_[_0xc5c7('0x40')](_0x518539['where'],{'$or':_[_0xc5c7('0x2d')](_0x31f480,function(_0x3bc412){if(_0x3bc412[_0xc5c7('0x41')]!=='VIRTUAL'){var _0x515a49={};_0x515a49[_0x3bc412[_0xc5c7('0x2c')]]={'$like':'%'+_0x196d6f[_0xc5c7('0x33')][_0xc5c7('0x3f')]+'%'};return _0x515a49;}})});}_0x518539=_[_0xc5c7('0x40')]({},_0x518539,_0x196d6f[_0xc5c7('0x42')]);var _0x1bf958={'where':_0x518539[_0xc5c7('0x3d')]};return db[_0xc5c7('0x2e')]['count'](_0x1bf958)[_0xc5c7('0x26')](function(_0x4927ed){_0x466e91[_0xc5c7('0x21')]=_0x4927ed;if(_0x196d6f['query'][_0xc5c7('0x43')]){_0x518539[_0xc5c7('0x44')]=[{'all':!![]}];}return db[_0xc5c7('0x2e')]['findAll'](_0x518539);})[_0xc5c7('0x26')](function(_0x780a66){_0x466e91[_0xc5c7('0x45')]=_0x780a66;return _0x466e91;})[_0xc5c7('0x26')](respondWithFilteredResult(_0x1d4fb1,_0x518539))['catch'](handleError(_0x1d4fb1,null));};exports[_0xc5c7('0x46')]=function(_0x478b03,_0x598105){var _0x2a44fb={'raw':![],'where':{'id':_0x478b03[_0xc5c7('0x47')]['id']}},_0x1f30fd={};_0x1f30fd[_0xc5c7('0x36')]=_[_0xc5c7('0x32')](db[_0xc5c7('0x2e')][_0xc5c7('0x2f')]);_0x1f30fd[_0xc5c7('0x33')]=_['keys'](_0x478b03[_0xc5c7('0x33')]);_0x1f30fd[_0xc5c7('0x34')]=_['intersection'](_0x1f30fd['model'],_0x1f30fd[_0xc5c7('0x33')]);_0x2a44fb[_0xc5c7('0x38')]=_[_0xc5c7('0x35')](_0x1f30fd['model'],qs[_0xc5c7('0x37')](_0x478b03[_0xc5c7('0x33')]['fields']));_0x2a44fb['attributes']=_0x2a44fb[_0xc5c7('0x38')][_0xc5c7('0x39')]?_0x2a44fb['attributes']:_0x1f30fd[_0xc5c7('0x36')];if(_0x478b03['query']['includeAll']){_0x2a44fb[_0xc5c7('0x44')]=[{'all':!![]}];}_0x2a44fb=_['merge']({},_0x2a44fb,_0x478b03[_0xc5c7('0x42')]);return db['SquareProject'][_0xc5c7('0x48')](_0x2a44fb)['then'](handleEntityNotFound(_0x598105,null))[_0xc5c7('0x26')](respondWithResult(_0x598105,null))[_0xc5c7('0x49')](handleError(_0x598105,null));};exports[_0xc5c7('0x4a')]=function(_0x3f64d8,_0xb93f47){return db[_0xc5c7('0x2e')]['create'](_0x3f64d8[_0xc5c7('0x4b')],{})[_0xc5c7('0x26')](function(_0x49218d){var _0x231a28=_0x3f64d8[_0xc5c7('0x4c')]['get']({'plain':!![]});if(!_0x231a28)throw new Error(_0xc5c7('0x4d'));if(_0x231a28[_0xc5c7('0x4e')]===_0xc5c7('0x4c')){var _0x7aacdd=_0x49218d['get']({'plain':!![]});var _0x9e1793=_0xc5c7('0x28');return db[_0xc5c7('0x4f')]['find']({'where':{'name':_0x9e1793,'userProfileId':_0x231a28['userProfileId']},'raw':!![]})[_0xc5c7('0x26')](function(_0x21bdb7){if(_0x21bdb7&&_0x21bdb7['autoAssociation']===0x0){return db[_0xc5c7('0x29')][_0xc5c7('0x4a')]({'name':_0x7aacdd[_0xc5c7('0x2c')],'resourceId':_0x7aacdd['id'],'type':_0x21bdb7[_0xc5c7('0x2c')],'sectionId':_0x21bdb7['id']},{})['then'](function(){return _0x49218d;});}else{return _0x49218d;}})[_0xc5c7('0x49')](function(_0x320851){logger[_0xc5c7('0x50')](_0xc5c7('0x51'),_0x320851);throw _0x320851;});}return _0x49218d;})[_0xc5c7('0x26')](respondWithResult(_0xb93f47,0xc9))[_0xc5c7('0x49')](handleError(_0xb93f47,null));};exports[_0xc5c7('0x25')]=function(_0x51dd1a,_0x253af1){if(_0x51dd1a[_0xc5c7('0x4b')]['id']){delete _0x51dd1a[_0xc5c7('0x4b')]['id'];}return db[_0xc5c7('0x2e')][_0xc5c7('0x48')]({'where':{'id':_0x51dd1a[_0xc5c7('0x47')]['id']}})[_0xc5c7('0x26')](handleEntityNotFound(_0x253af1,null))[_0xc5c7('0x26')](saveUpdates(_0x51dd1a[_0xc5c7('0x4b')],null))[_0xc5c7('0x26')](respondWithResult(_0x253af1,null))['catch'](handleError(_0x253af1,null));};exports[_0xc5c7('0x27')]=function(_0x544099,_0x14baeb){return db[_0xc5c7('0x2e')]['find']({'where':{'id':_0x544099[_0xc5c7('0x47')]['id']}})[_0xc5c7('0x26')](handleEntityNotFound(_0x14baeb,null))['then'](removeEntity(_0x14baeb,null))['catch'](handleError(_0x14baeb,null));};exports[_0xc5c7('0x52')]=function(_0x547b38,_0x515ef4,_0x2ca603){return db[_0xc5c7('0x2e')][_0xc5c7('0x48')]({'where':{'id':_0x547b38[_0xc5c7('0x47')]['id']}})['then'](handleEntityNotFound(_0x515ef4,null))['then'](function(_0x4cef78){if(_0x4cef78){return _0x4cef78[_0xc5c7('0x52')](_0x547b38['body'][_0xc5c7('0x53')],_[_0xc5c7('0x54')](_0x547b38[_0xc5c7('0x4b')],[_0xc5c7('0x53'),'id'])||{});}})[_0xc5c7('0x26')](respondWithResult(_0x515ef4,null))[_0xc5c7('0x49')](handleError(_0x515ef4,null));};exports[_0xc5c7('0x55')]=function(_0x5ba8a5,_0x32bff1,_0x522609){return db['SquareProject']['find']({'where':{'id':_0x5ba8a5[_0xc5c7('0x47')]['id']}})[_0xc5c7('0x26')](handleEntityNotFound(_0x32bff1,null))['then'](function(_0xa3d9bb){if(_0xa3d9bb){return _0xa3d9bb[_0xc5c7('0x55')](_0x5ba8a5[_0xc5c7('0x33')][_0xc5c7('0x53')])[_0xc5c7('0x26')](function(){if(_[_0xc5c7('0x56')](_0x5ba8a5[_0xc5c7('0x33')]['ids'])){for(var _0x298e18=0x0;_0x298e18<_0x5ba8a5[_0xc5c7('0x33')]['ids'][_0xc5c7('0x39')];_0x298e18+=0x1){socket[_0xc5c7('0x57')](_0xc5c7('0x58'),{'UserId':Number(_0x5ba8a5[_0xc5c7('0x33')]['ids'][_0x298e18]),'SquareProjectId':Number(_0x5ba8a5[_0xc5c7('0x47')]['id'])});}}else{socket[_0xc5c7('0x57')]('userSquareProject:remove',{'UserId':Number(_0x5ba8a5[_0xc5c7('0x33')][_0xc5c7('0x53')]),'SquareProjectId':Number(_0x5ba8a5[_0xc5c7('0x47')]['id'])});}});}})[_0xc5c7('0x26')](respondWithStatusCode(_0x32bff1,null))[_0xc5c7('0x49')](handleError(_0x32bff1,null));};exports[_0xc5c7('0x59')]=function(_0x41a1dc,_0x3df675,_0x50fd9e){var _0x2be1e1={};var _0x1401b4={};var _0x38ddb0;var _0x2a8b26;return db['SquareProject']['findOne']({'where':{'id':_0x41a1dc[_0xc5c7('0x47')]['id']}})[_0xc5c7('0x26')](handleEntityNotFound(_0x3df675,null))[_0xc5c7('0x26')](function(_0x3edec0){if(_0x3edec0){_0x38ddb0=_0x3edec0;_0x1401b4['model']=_[_0xc5c7('0x32')](db[_0xc5c7('0x5a')][_0xc5c7('0x2f')]);_0x1401b4[_0xc5c7('0x33')]=_[_0xc5c7('0x32')](_0x41a1dc[_0xc5c7('0x33')]);_0x1401b4[_0xc5c7('0x34')]=_['intersection'](_0x1401b4[_0xc5c7('0x36')],_0x1401b4[_0xc5c7('0x33')]);_0x2be1e1[_0xc5c7('0x38')]=_[_0xc5c7('0x35')](_0x1401b4[_0xc5c7('0x36')],qs[_0xc5c7('0x37')](_0x41a1dc[_0xc5c7('0x33')][_0xc5c7('0x37')]));_0x2be1e1[_0xc5c7('0x38')]=_0x2be1e1[_0xc5c7('0x38')][_0xc5c7('0x39')]?_0x2be1e1[_0xc5c7('0x38')]:_0x1401b4['model'];_0x2be1e1[_0xc5c7('0x3b')]=qs[_0xc5c7('0x3c')](_0x41a1dc[_0xc5c7('0x33')]['sort']);_0x2be1e1[_0xc5c7('0x3d')]=qs[_0xc5c7('0x34')](_['pick'](_0x41a1dc[_0xc5c7('0x33')],_0x1401b4[_0xc5c7('0x34')]));if(_0x41a1dc[_0xc5c7('0x33')][_0xc5c7('0x3f')]){_0x2be1e1[_0xc5c7('0x3d')]=_['merge'](_0x2be1e1[_0xc5c7('0x3d')],{'$or':_[_0xc5c7('0x2d')](_0x2be1e1[_0xc5c7('0x38')],function(_0x4fd49b){var _0x45e261={};_0x45e261[_0x4fd49b]={'$like':'%'+_0x41a1dc[_0xc5c7('0x33')]['filter']+'%'};return _0x45e261;})});}_0x2be1e1=_[_0xc5c7('0x40')]({},_0x2be1e1,_0x41a1dc[_0xc5c7('0x42')]);return _0x38ddb0[_0xc5c7('0x59')](_0x2be1e1);}})[_0xc5c7('0x26')](function(_0x59ef7f){if(_0x59ef7f){_0x2a8b26=_0x59ef7f[_0xc5c7('0x39')];if(!_0x41a1dc['query'][_0xc5c7('0x3a')](_0xc5c7('0x5b'))){_0x2be1e1[_0xc5c7('0x20')]=qs[_0xc5c7('0x20')](_0x41a1dc['query'][_0xc5c7('0x20')]);_0x2be1e1[_0xc5c7('0x1e')]=qs[_0xc5c7('0x1e')](_0x41a1dc[_0xc5c7('0x33')]['offset']);}return _0x38ddb0[_0xc5c7('0x59')](_0x2be1e1);}})['then'](function(_0x4f4b11){if(_0x4f4b11){return _0x4f4b11?{'count':_0x2a8b26,'rows':_0x4f4b11}:null;}})['then'](respondWithResult(_0x3df675,null))[_0xc5c7('0x49')](handleError(_0x3df675,null));}; \ No newline at end of file +var _0xf258=['sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','get','SquareProjects','UserProfileResource','sendStatus','error','name','send','map','SquareProject','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','omit','ids','removeUsers','isArray','userSquareProject:remove','getUsers','findOne','pick','eml-format','rimraf','zip-dir','request-promise','bluebird','path'];(function(_0x5d434f,_0xfe72d6){var _0x23dc4a=function(_0x508417){while(--_0x508417){_0x5d434f['push'](_0x5d434f['shift']());}};_0x23dc4a(++_0xfe72d6);}(_0xf258,0x172));var _0x8f25=function(_0xb04e79,_0x2f4bb5){_0xb04e79=_0xb04e79-0x0;var _0x1b17ef=_0xf258[_0xb04e79];return _0x1b17ef;};'use strict';var emlformat=require(_0x8f25('0x0'));var rimraf=require(_0x8f25('0x1'));var zipdir=require(_0x8f25('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f25('0x3'));var moment=require('moment');var BPromise=require(_0x8f25('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8f25('0x5'));var sox=require(_0x8f25('0x6'));var csv=require(_0x8f25('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f25('0x8'));var squel=require('squel');var crypto=require(_0x8f25('0x9'));var jsforce=require(_0x8f25('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8f25('0xb'));var Papa=require(_0x8f25('0xc'));var Redis=require(_0x8f25('0xd'));var authService=require(_0x8f25('0xe'));var qs=require(_0x8f25('0xf'));var as=require(_0x8f25('0x10'));var hardwareService=require(_0x8f25('0x11'));var logger=require(_0x8f25('0x12'))(_0x8f25('0x13'));var utils=require('../../config/utils');var config=require(_0x8f25('0x14'));var licenseUtil=require(_0x8f25('0x15'));var db=require(_0x8f25('0x16'))['db'];config['redis']=_[_0x8f25('0x17')](config[_0x8f25('0x18')],{'host':_0x8f25('0x19'),'port':0x18eb});var socket=require(_0x8f25('0x1a'))(new Redis(config[_0x8f25('0x18')]));require(_0x8f25('0x1b'))[_0x8f25('0x1c')](socket);function respondWithStatusCode(_0x66f786,_0x4f7bc0){_0x4f7bc0=_0x4f7bc0||0xcc;return function(_0x231bd3){if(_0x231bd3){return _0x66f786['sendStatus'](_0x4f7bc0);}return _0x66f786[_0x8f25('0x1d')](_0x4f7bc0)[_0x8f25('0x1e')]();};}function respondWithResult(_0x26e64f,_0x5d7d16){_0x5d7d16=_0x5d7d16||0xc8;return function(_0x1f23e0){if(_0x1f23e0){return _0x26e64f[_0x8f25('0x1d')](_0x5d7d16)[_0x8f25('0x1f')](_0x1f23e0);}};}function respondWithFilteredResult(_0x45b4c6,_0x32dec1){return function(_0x2c1607){if(_0x2c1607){var _0x5c4c77=typeof _0x32dec1[_0x8f25('0x20')]===_0x8f25('0x21')&&typeof _0x32dec1[_0x8f25('0x22')]==='undefined';var _0x57042e=_0x2c1607[_0x8f25('0x23')];var _0x569c9f=_0x5c4c77?0x0:_0x32dec1[_0x8f25('0x20')];var _0x5d3626=_0x5c4c77?_0x2c1607[_0x8f25('0x23')]:_0x32dec1['offset']+_0x32dec1[_0x8f25('0x22')];var _0x56f0e1;if(_0x5d3626>=_0x57042e){_0x5d3626=_0x57042e;_0x56f0e1=0xc8;}else{_0x56f0e1=0xce;}_0x45b4c6[_0x8f25('0x1d')](_0x56f0e1);return _0x45b4c6[_0x8f25('0x24')]('Content-Range',_0x569c9f+'-'+_0x5d3626+'/'+_0x57042e)[_0x8f25('0x1f')](_0x2c1607);}return null;};}function patchUpdates(_0x291086){return function(_0x23ac13){try{jsonpatch[_0x8f25('0x25')](_0x23ac13,_0x291086,!![]);}catch(_0x1145c5){return BPromise['reject'](_0x1145c5);}return _0x23ac13['save']();};}function saveUpdates(_0x52f4bc,_0x143dde){return function(_0x27a6bf){if(_0x27a6bf){return _0x27a6bf[_0x8f25('0x26')](_0x52f4bc)[_0x8f25('0x27')](function(_0xa0ce45){return _0xa0ce45;});}return null;};}function removeEntity(_0x374eee,_0x3c77f4){return function(_0x419e03){if(_0x419e03){return _0x419e03[_0x8f25('0x28')]()['then'](function(){var _0x20ef2b=_0x419e03[_0x8f25('0x29')]({'plain':!![]});var _0x46d9ec=_0x8f25('0x2a');return db[_0x8f25('0x2b')][_0x8f25('0x28')]({'where':{'type':_0x46d9ec,'resourceId':_0x20ef2b['id']}})['then'](function(){return _0x419e03;});})[_0x8f25('0x27')](function(){_0x374eee[_0x8f25('0x1d')](0xcc)[_0x8f25('0x1e')]();});}};}function handleEntityNotFound(_0x25576b,_0x1174b1){return function(_0xc0f0af){if(!_0xc0f0af){_0x25576b[_0x8f25('0x2c')](0x194);}return _0xc0f0af;};}function handleError(_0x20e078,_0x1337e0){_0x1337e0=_0x1337e0||0x1f4;return function(_0x579cd5){logger[_0x8f25('0x2d')](_0x579cd5['stack']);if(_0x579cd5['name']){delete _0x579cd5[_0x8f25('0x2e')];}_0x20e078[_0x8f25('0x1d')](_0x1337e0)[_0x8f25('0x2f')](_0x579cd5);};}exports['index']=function(_0x844f5c,_0x1d9fca){var _0x10d91e={},_0xe17f0e={},_0x165043={'count':0x0,'rows':[]};var _0x40dc3c=_[_0x8f25('0x30')](db[_0x8f25('0x31')][_0x8f25('0x32')],function(_0x47f2e9){return{'name':_0x47f2e9['fieldName'],'type':_0x47f2e9['type'][_0x8f25('0x33')]};});_0xe17f0e[_0x8f25('0x34')]=_[_0x8f25('0x30')](_0x40dc3c,_0x8f25('0x2e'));_0xe17f0e[_0x8f25('0x35')]=_[_0x8f25('0x36')](_0x844f5c[_0x8f25('0x35')]);_0xe17f0e[_0x8f25('0x37')]=_[_0x8f25('0x38')](_0xe17f0e['model'],_0xe17f0e[_0x8f25('0x35')]);_0x10d91e['attributes']=_['intersection'](_0xe17f0e[_0x8f25('0x34')],qs[_0x8f25('0x39')](_0x844f5c[_0x8f25('0x35')][_0x8f25('0x39')]));_0x10d91e[_0x8f25('0x3a')]=_0x10d91e[_0x8f25('0x3a')][_0x8f25('0x3b')]?_0x10d91e[_0x8f25('0x3a')]:_0xe17f0e[_0x8f25('0x34')];if(!_0x844f5c[_0x8f25('0x35')][_0x8f25('0x3c')](_0x8f25('0x3d'))){_0x10d91e[_0x8f25('0x22')]=qs['limit'](_0x844f5c[_0x8f25('0x35')][_0x8f25('0x22')]);_0x10d91e['offset']=qs[_0x8f25('0x20')](_0x844f5c[_0x8f25('0x35')]['offset']);}_0x10d91e[_0x8f25('0x3e')]=qs[_0x8f25('0x3f')](_0x844f5c[_0x8f25('0x35')][_0x8f25('0x3f')]);_0x10d91e[_0x8f25('0x40')]=qs[_0x8f25('0x37')](_['pick'](_0x844f5c[_0x8f25('0x35')],_0xe17f0e[_0x8f25('0x37')]),_0x40dc3c);if(_0x844f5c[_0x8f25('0x35')][_0x8f25('0x41')]){_0x10d91e[_0x8f25('0x40')]=_[_0x8f25('0x42')](_0x10d91e['where'],{'$or':_[_0x8f25('0x30')](_0x40dc3c,function(_0x12b051){if(_0x12b051[_0x8f25('0x43')]!==_0x8f25('0x44')){var _0x8de311={};_0x8de311[_0x12b051[_0x8f25('0x2e')]]={'$like':'%'+_0x844f5c[_0x8f25('0x35')]['filter']+'%'};return _0x8de311;}})});}_0x10d91e=_[_0x8f25('0x42')]({},_0x10d91e,_0x844f5c[_0x8f25('0x45')]);var _0x459c0e={'where':_0x10d91e['where']};return db[_0x8f25('0x31')][_0x8f25('0x23')](_0x459c0e)[_0x8f25('0x27')](function(_0x852cb6){_0x165043[_0x8f25('0x23')]=_0x852cb6;if(_0x844f5c[_0x8f25('0x35')]['includeAll']){_0x10d91e[_0x8f25('0x46')]=[{'all':!![]}];}return db['SquareProject'][_0x8f25('0x47')](_0x10d91e);})[_0x8f25('0x27')](function(_0x3c0823){_0x165043['rows']=_0x3c0823;return _0x165043;})[_0x8f25('0x27')](respondWithFilteredResult(_0x1d9fca,_0x10d91e))[_0x8f25('0x48')](handleError(_0x1d9fca,null));};exports[_0x8f25('0x49')]=function(_0x39769d,_0x27f496){var _0xbb7137={'raw':![],'where':{'id':_0x39769d['params']['id']}},_0x3bae3b={};_0x3bae3b['model']=_[_0x8f25('0x36')](db[_0x8f25('0x31')][_0x8f25('0x32')]);_0x3bae3b[_0x8f25('0x35')]=_['keys'](_0x39769d[_0x8f25('0x35')]);_0x3bae3b[_0x8f25('0x37')]=_[_0x8f25('0x38')](_0x3bae3b['model'],_0x3bae3b[_0x8f25('0x35')]);_0xbb7137['attributes']=_[_0x8f25('0x38')](_0x3bae3b[_0x8f25('0x34')],qs[_0x8f25('0x39')](_0x39769d[_0x8f25('0x35')]['fields']));_0xbb7137['attributes']=_0xbb7137[_0x8f25('0x3a')]['length']?_0xbb7137[_0x8f25('0x3a')]:_0x3bae3b[_0x8f25('0x34')];if(_0x39769d[_0x8f25('0x35')][_0x8f25('0x4a')]){_0xbb7137[_0x8f25('0x46')]=[{'all':!![]}];}_0xbb7137=_[_0x8f25('0x42')]({},_0xbb7137,_0x39769d[_0x8f25('0x45')]);return db[_0x8f25('0x31')][_0x8f25('0x4b')](_0xbb7137)[_0x8f25('0x27')](handleEntityNotFound(_0x27f496,null))[_0x8f25('0x27')](respondWithResult(_0x27f496,null))[_0x8f25('0x48')](handleError(_0x27f496,null));};exports[_0x8f25('0x4c')]=function(_0x47c6eb,_0x1d3001){return db['SquareProject'][_0x8f25('0x4c')](_0x47c6eb[_0x8f25('0x4d')],{})[_0x8f25('0x27')](function(_0x4ca7b1){var _0x4ca09f=_0x47c6eb[_0x8f25('0x4e')][_0x8f25('0x29')]({'plain':!![]});if(!_0x4ca09f)throw new Error(_0x8f25('0x4f'));if(_0x4ca09f[_0x8f25('0x50')]===_0x8f25('0x4e')){var _0x455122=_0x4ca7b1['get']({'plain':!![]});var _0x87d3e6=_0x8f25('0x2a');return db[_0x8f25('0x51')][_0x8f25('0x4b')]({'where':{'name':_0x87d3e6,'userProfileId':_0x4ca09f[_0x8f25('0x52')]},'raw':!![]})[_0x8f25('0x27')](function(_0x794d3b){if(_0x794d3b&&_0x794d3b['autoAssociation']===0x0){return db['UserProfileResource'][_0x8f25('0x4c')]({'name':_0x455122['name'],'resourceId':_0x455122['id'],'type':_0x794d3b[_0x8f25('0x2e')],'sectionId':_0x794d3b['id']},{})[_0x8f25('0x27')](function(){return _0x4ca7b1;});}else{return _0x4ca7b1;}})['catch'](function(_0x21134f){logger[_0x8f25('0x2d')](_0x8f25('0x53'),_0x21134f);throw _0x21134f;});}return _0x4ca7b1;})[_0x8f25('0x27')](respondWithResult(_0x1d3001,0xc9))[_0x8f25('0x48')](handleError(_0x1d3001,null));};exports[_0x8f25('0x26')]=function(_0x281d54,_0x454896){if(_0x281d54[_0x8f25('0x4d')]['id']){delete _0x281d54[_0x8f25('0x4d')]['id'];}return db['SquareProject']['find']({'where':{'id':_0x281d54[_0x8f25('0x54')]['id']}})[_0x8f25('0x27')](handleEntityNotFound(_0x454896,null))[_0x8f25('0x27')](saveUpdates(_0x281d54[_0x8f25('0x4d')],null))['then'](respondWithResult(_0x454896,null))['catch'](handleError(_0x454896,null));};exports[_0x8f25('0x28')]=function(_0x36f37e,_0x49edde){return db['SquareProject']['find']({'where':{'id':_0x36f37e[_0x8f25('0x54')]['id']}})['then'](handleEntityNotFound(_0x49edde,null))[_0x8f25('0x27')](removeEntity(_0x49edde,null))[_0x8f25('0x48')](handleError(_0x49edde,null));};exports[_0x8f25('0x55')]=function(_0x2089d7,_0x2e3234,_0x47366f){return db[_0x8f25('0x31')][_0x8f25('0x4b')]({'where':{'id':_0x2089d7[_0x8f25('0x54')]['id']}})['then'](handleEntityNotFound(_0x2e3234,null))['then'](function(_0x561c6d){if(_0x561c6d){return _0x561c6d[_0x8f25('0x55')](_0x2089d7['body']['ids'],_[_0x8f25('0x56')](_0x2089d7[_0x8f25('0x4d')],[_0x8f25('0x57'),'id'])||{});}})[_0x8f25('0x27')](respondWithResult(_0x2e3234,null))[_0x8f25('0x48')](handleError(_0x2e3234,null));};exports[_0x8f25('0x58')]=function(_0x4b0523,_0xd6555a,_0x450376){return db[_0x8f25('0x31')]['find']({'where':{'id':_0x4b0523[_0x8f25('0x54')]['id']}})[_0x8f25('0x27')](handleEntityNotFound(_0xd6555a,null))[_0x8f25('0x27')](function(_0x2975e3){if(_0x2975e3){return _0x2975e3[_0x8f25('0x58')](_0x4b0523[_0x8f25('0x35')][_0x8f25('0x57')])['then'](function(){if(_[_0x8f25('0x59')](_0x4b0523[_0x8f25('0x35')][_0x8f25('0x57')])){for(var _0x4c720c=0x0;_0x4c720c<_0x4b0523[_0x8f25('0x35')][_0x8f25('0x57')][_0x8f25('0x3b')];_0x4c720c+=0x1){socket['emit'](_0x8f25('0x5a'),{'UserId':Number(_0x4b0523['query'][_0x8f25('0x57')][_0x4c720c]),'SquareProjectId':Number(_0x4b0523[_0x8f25('0x54')]['id'])});}}else{socket['emit'](_0x8f25('0x5a'),{'UserId':Number(_0x4b0523[_0x8f25('0x35')][_0x8f25('0x57')]),'SquareProjectId':Number(_0x4b0523[_0x8f25('0x54')]['id'])});}});}})[_0x8f25('0x27')](respondWithStatusCode(_0xd6555a,null))[_0x8f25('0x48')](handleError(_0xd6555a,null));};exports[_0x8f25('0x5b')]=function(_0x416994,_0x2fec90,_0x131e6d){var _0x1483a0={};var _0x4e17c2={};var _0x3a27ab;var _0x33b7ee;return db['SquareProject'][_0x8f25('0x5c')]({'where':{'id':_0x416994[_0x8f25('0x54')]['id']}})[_0x8f25('0x27')](handleEntityNotFound(_0x2fec90,null))[_0x8f25('0x27')](function(_0x25095d){if(_0x25095d){_0x3a27ab=_0x25095d;_0x4e17c2['model']=_[_0x8f25('0x36')](db['User']['rawAttributes']);_0x4e17c2[_0x8f25('0x35')]=_[_0x8f25('0x36')](_0x416994[_0x8f25('0x35')]);_0x4e17c2['filters']=_['intersection'](_0x4e17c2[_0x8f25('0x34')],_0x4e17c2[_0x8f25('0x35')]);_0x1483a0[_0x8f25('0x3a')]=_['intersection'](_0x4e17c2[_0x8f25('0x34')],qs[_0x8f25('0x39')](_0x416994['query'][_0x8f25('0x39')]));_0x1483a0[_0x8f25('0x3a')]=_0x1483a0[_0x8f25('0x3a')][_0x8f25('0x3b')]?_0x1483a0[_0x8f25('0x3a')]:_0x4e17c2[_0x8f25('0x34')];_0x1483a0[_0x8f25('0x3e')]=qs[_0x8f25('0x3f')](_0x416994[_0x8f25('0x35')][_0x8f25('0x3f')]);_0x1483a0['where']=qs['filters'](_[_0x8f25('0x5d')](_0x416994[_0x8f25('0x35')],_0x4e17c2['filters']));if(_0x416994[_0x8f25('0x35')][_0x8f25('0x41')]){_0x1483a0[_0x8f25('0x40')]=_['merge'](_0x1483a0['where'],{'$or':_['map'](_0x1483a0[_0x8f25('0x3a')],function(_0x22f030){var _0x40e2ed={};_0x40e2ed[_0x22f030]={'$like':'%'+_0x416994[_0x8f25('0x35')][_0x8f25('0x41')]+'%'};return _0x40e2ed;})});}_0x1483a0=_['merge']({},_0x1483a0,_0x416994[_0x8f25('0x45')]);return _0x3a27ab[_0x8f25('0x5b')](_0x1483a0);}})[_0x8f25('0x27')](function(_0x7c67c2){if(_0x7c67c2){_0x33b7ee=_0x7c67c2[_0x8f25('0x3b')];if(!_0x416994['query']['hasOwnProperty'](_0x8f25('0x3d'))){_0x1483a0[_0x8f25('0x22')]=qs[_0x8f25('0x22')](_0x416994[_0x8f25('0x35')][_0x8f25('0x22')]);_0x1483a0[_0x8f25('0x20')]=qs[_0x8f25('0x20')](_0x416994[_0x8f25('0x35')][_0x8f25('0x20')]);}return _0x3a27ab[_0x8f25('0x5b')](_0x1483a0);}})[_0x8f25('0x27')](function(_0x4618fe){if(_0x4618fe){return _0x4618fe?{'count':_0x33b7ee,'rows':_0x4618fe}:null;}})[_0x8f25('0x27')](respondWithResult(_0x2fec90,null))[_0x8f25('0x48')](handleError(_0x2fec90,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 4310307..8b15a58 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 _0xc062=['hasOwnProperty','exports','events','../../mysqldb','SquareProject','setMaxListeners','update','remove','emit'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0xc062,0x146));var _0x2c06=function(_0x2de52a,_0x2b7e79){_0x2de52a=_0x2de52a-0x0;var _0x30b652=_0xc062[_0x2de52a];return _0x30b652;};'use strict';var EventEmitter=require(_0x2c06('0x0'));var SquareProject=require(_0x2c06('0x1'))['db'][_0x2c06('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x2c06('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2c06('0x4'),'afterDestroy':_0x2c06('0x5')};function emitEvent(_0x4b4e4f){return function(_0x9fd678,_0x3128a3,_0x44c97f){SquareProjectEvents[_0x2c06('0x6')](_0x4b4e4f+':'+_0x9fd678['id'],_0x9fd678);SquareProjectEvents['emit'](_0x4b4e4f,_0x9fd678);_0x44c97f(null);};}for(var e in events){if(events[_0x2c06('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x2c06('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x59e1=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x2d04af,_0x3d13f1){var _0xae3c32=function(_0xb90701){while(--_0xb90701){_0x2d04af['push'](_0x2d04af['shift']());}};_0xae3c32(++_0x3d13f1);}(_0x59e1,0x158));var _0x159e=function(_0x3a76cf,_0x4ea41f){_0x3a76cf=_0x3a76cf-0x0;var _0x4ae12a=_0x59e1[_0x3a76cf];return _0x4ae12a;};'use strict';var EventEmitter=require(_0x159e('0x0'));var SquareProject=require(_0x159e('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x159e('0x2')](0x0);var events={'afterCreate':_0x159e('0x3'),'afterUpdate':_0x159e('0x4'),'afterDestroy':_0x159e('0x5')};function emitEvent(_0x52fc3c){return function(_0x57b07d,_0x5a4f49,_0x42b872){SquareProjectEvents[_0x159e('0x6')](_0x52fc3c+':'+_0x57b07d['id'],_0x57b07d);SquareProjectEvents[_0x159e('0x6')](_0x52fc3c,_0x57b07d);_0x42b872(null);};}for(var e in events){if(events[_0x159e('0x7')](e)){var event=events[e];SquareProject[_0x159e('0x8')](e,emitEvent(event));}}module[_0x159e('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 10fe4ac..750ac5a 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 _0x3413=['moment','bluebird','request-promise','path','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x3413,0x8e));var _0x3341=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3413[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3341('0x0'));var util=require(_0x3341('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3341('0x2'));var BPromise=require(_0x3341('0x3'));var rp=require(_0x3341('0x4'));var fs=require('fs');var path=require(_0x3341('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3341('0x6'));module[_0x3341('0x7')]=function(_0x56191a,_0xaf43f6){return _0x56191a[_0x3341('0x8')](_0x3341('0x9'),attributes,{'tableName':_0x3341('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48d522,_0x4400f1,_0x2d84e7){if(_0x48d522[_0x3341('0xb')](_0x3341('0xc'))){_0x48d522[_0x3341('0xd')]=moment()[_0x3341('0xe')](_0x3341('0xf'));}if(_0x48d522[_0x3341('0xb')](_0x3341('0x10'))){_0x48d522[_0x3341('0x11')]=moment()[_0x3341('0xe')](_0x3341('0xf'));}_0x2d84e7(null,_0x48d522);}}});}; \ No newline at end of file +var _0x30f8=['SquareProject','changed','preproduction','production','publishedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareProject.attributes','exports','define'];(function(_0xd00e71,_0x2322c4){var _0x1dbf0a=function(_0xdc6f6f){while(--_0xdc6f6f){_0xd00e71['push'](_0xd00e71['shift']());}};_0x1dbf0a(++_0x2322c4);}(_0x30f8,0x16f));var _0x830f=function(_0x301c37,_0x8c80cf){_0x301c37=_0x301c37-0x0;var _0x233eef=_0x30f8[_0x301c37];return _0x233eef;};'use strict';var _=require(_0x830f('0x0'));var util=require(_0x830f('0x1'));var logger=require(_0x830f('0x2'))(_0x830f('0x3'));var moment=require(_0x830f('0x4'));var BPromise=require(_0x830f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x830f('0x6'));var rimraf=require('rimraf');var config=require(_0x830f('0x7'));var attributes=require(_0x830f('0x8'));module[_0x830f('0x9')]=function(_0x54952d,_0x42df5f){return _0x54952d[_0x830f('0xa')](_0x830f('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f0b69,_0x5737ce,_0x2ffe9e){if(_0x1f0b69[_0x830f('0xc')](_0x830f('0xd'))){_0x1f0b69['savedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1f0b69['changed'](_0x830f('0xe'))){_0x1f0b69[_0x830f('0xf')]=moment()[_0x830f('0x10')](_0x830f('0x11'));}_0x2ffe9e(null,_0x1f0b69);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 9055500..bc65206 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 _0xedca=['socket.io-emitter','./squareProject.socket','register','request','then','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','model','map','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis'];(function(_0x3b0515,_0x1fa41d){var _0x198d7a=function(_0x17b712){while(--_0x17b712){_0x3b0515['push'](_0x3b0515['shift']());}};_0x198d7a(++_0x1fa41d);}(_0xedca,0x15c));var _0xaedc=function(_0xb8603b,_0x1a86c5){_0xb8603b=_0xb8603b-0x0;var _0x32b026=_0xedca[_0xb8603b];return _0x32b026;};'use strict';var _=require(_0xaedc('0x0'));var util=require(_0xaedc('0x1'));var moment=require(_0xaedc('0x2'));var BPromise=require(_0xaedc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaedc('0x4'))['db'];var utils=require(_0xaedc('0x5'));var logger=require(_0xaedc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaedc('0x7'));var client=jayson[_0xaedc('0x8')][_0xaedc('0x9')]({'port':0x232a});config['redis']=_[_0xaedc('0xa')](config[_0xaedc('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xaedc('0xc'))(new Redis(config[_0xaedc('0xb')]));require(_0xaedc('0xd'))[_0xaedc('0xe')](socket);function respondWithRpcPromise(_0xd302ca,_0x1c5b0b,_0x502c58){return new BPromise(function(_0x13b548,_0x1e8a88){return client[_0xaedc('0xf')](_0xd302ca,_0x502c58)[_0xaedc('0x10')](function(_0x5765b4){logger['info'](_0xaedc('0x11'),_0x1c5b0b,_0xaedc('0x12'));logger['debug'](_0xaedc('0x13'),_0x1c5b0b,'request\x20sent',JSON[_0xaedc('0x14')](_0x5765b4));if(_0x5765b4['error']){if(_0x5765b4[_0xaedc('0x15')][_0xaedc('0x16')]===0x1f4){logger[_0xaedc('0x15')]('SquareProject,\x20%s,\x20%s',_0x1c5b0b,_0x5765b4['error']['message']);return _0x1e8a88(_0x5765b4['error'][_0xaedc('0x17')]);}logger['error']('SquareProject,\x20%s,\x20%s',_0x1c5b0b,_0x5765b4[_0xaedc('0x15')][_0xaedc('0x17')]);return _0x13b548(_0x5765b4[_0xaedc('0x15')][_0xaedc('0x17')]);}else{logger[_0xaedc('0x18')](_0xaedc('0x11'),_0x1c5b0b,'request\x20sent');_0x13b548(_0x5765b4['result']['message']);}})['catch'](function(_0x1db9df){logger[_0xaedc('0x15')](_0xaedc('0x11'),_0x1c5b0b,_0x1db9df);_0x1e8a88(_0x1db9df);});});}exports[_0xaedc('0x19')]=function(_0x63131b){var _0x1269ea=this;return new Promise(function(_0x1feb13,_0x1b4937){return db[_0xaedc('0x1a')][_0xaedc('0x1b')]({'raw':_0x63131b[_0xaedc('0x1c')]?_0x63131b[_0xaedc('0x1c')][_0xaedc('0x1d')]===undefined?!![]:![]:!![],'where':_0x63131b[_0xaedc('0x1c')]?_0x63131b['options'][_0xaedc('0x1e')]||null:null,'attributes':_0x63131b[_0xaedc('0x1c')]?_0x63131b[_0xaedc('0x1c')][_0xaedc('0x1f')]||null:null,'include':_0x63131b[_0xaedc('0x1c')]?_0x63131b[_0xaedc('0x1c')]['include']?_['map'](_0x63131b['options'][_0xaedc('0x20')],function(_0x1e0fca){return{'model':db[_0x1e0fca[_0xaedc('0x21')]],'as':_0x1e0fca['as'],'attributes':_0x1e0fca[_0xaedc('0x1f')],'include':_0x1e0fca[_0xaedc('0x20')]?_[_0xaedc('0x22')](_0x1e0fca[_0xaedc('0x20')],function(_0x30c9e1){return{'model':db[_0x30c9e1[_0xaedc('0x21')]],'as':_0x30c9e1['as'],'attributes':_0x30c9e1['attributes'],'include':_0x30c9e1[_0xaedc('0x20')]?_[_0xaedc('0x22')](_0x30c9e1[_0xaedc('0x20')],function(_0x2b7e5a){return{'model':db[_0x2b7e5a[_0xaedc('0x21')]],'as':_0x2b7e5a['as'],'attributes':_0x2b7e5a['attributes']};}):[]};}):[]};}):[]:[]})[_0xaedc('0x10')](function(_0x41f57a){logger[_0xaedc('0x18')](_0xaedc('0x19'),_0x63131b);logger[_0xaedc('0x23')]('ShowSquareProject',_0x63131b,JSON[_0xaedc('0x14')](_0x41f57a));_0x1feb13(_0x41f57a);})['catch'](function(_0x2e0609){logger['error'](_0xaedc('0x19'),_0x2e0609[_0xaedc('0x17')],_0x63131b);_0x1b4937(_0x1269ea[_0xaedc('0x15')](0x1f4,_0x2e0609[_0xaedc('0x17')]));});});}; \ No newline at end of file +var _0xd3d7=['result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','socket.io-emitter','./squareProject.socket','register','request','then','SquareProject,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0xd3d7,0x181));var _0x7d3d=function(_0x4a9034,_0x10bd07){_0x4a9034=_0x4a9034-0x0;var _0x5bf58f=_0xd3d7[_0x4a9034];return _0x5bf58f;};'use strict';var _=require(_0x7d3d('0x0'));var util=require(_0x7d3d('0x1'));var moment=require(_0x7d3d('0x2'));var BPromise=require(_0x7d3d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d3d('0x4'));var db=require(_0x7d3d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7d3d('0x6'));var config=require(_0x7d3d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7d3d('0x8')][_0x7d3d('0x9')]({'port':0x232a});config[_0x7d3d('0xa')]=_['defaults'](config[_0x7d3d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7d3d('0xb'))(new Redis(config['redis']));require(_0x7d3d('0xc'))[_0x7d3d('0xd')](socket);function respondWithRpcPromise(_0x47c2de,_0x22057c,_0x6444e7){return new BPromise(function(_0x3eb348,_0x55ac37){return client[_0x7d3d('0xe')](_0x47c2de,_0x6444e7)[_0x7d3d('0xf')](function(_0x522051){logger['info'](_0x7d3d('0x10'),_0x22057c,'request\x20sent');logger[_0x7d3d('0x11')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x22057c,_0x7d3d('0x12'),JSON[_0x7d3d('0x13')](_0x522051));if(_0x522051[_0x7d3d('0x14')]){if(_0x522051[_0x7d3d('0x14')]['code']===0x1f4){logger['error']('SquareProject,\x20%s,\x20%s',_0x22057c,_0x522051[_0x7d3d('0x14')][_0x7d3d('0x15')]);return _0x55ac37(_0x522051[_0x7d3d('0x14')][_0x7d3d('0x15')]);}logger['error'](_0x7d3d('0x10'),_0x22057c,_0x522051[_0x7d3d('0x14')]['message']);return _0x3eb348(_0x522051['error']['message']);}else{logger[_0x7d3d('0x16')]('SquareProject,\x20%s,\x20%s',_0x22057c,_0x7d3d('0x12'));_0x3eb348(_0x522051[_0x7d3d('0x17')]['message']);}})[_0x7d3d('0x18')](function(_0xce279d){logger[_0x7d3d('0x14')](_0x7d3d('0x10'),_0x22057c,_0xce279d);_0x55ac37(_0xce279d);});});}exports[_0x7d3d('0x19')]=function(_0x109a8f){var _0x294abd=this;return new Promise(function(_0x936188,_0x150f3a){return db[_0x7d3d('0x1a')][_0x7d3d('0x1b')]({'raw':_0x109a8f[_0x7d3d('0x1c')]?_0x109a8f[_0x7d3d('0x1c')][_0x7d3d('0x1d')]===undefined?!![]:![]:!![],'where':_0x109a8f['options']?_0x109a8f[_0x7d3d('0x1c')][_0x7d3d('0x1e')]||null:null,'attributes':_0x109a8f[_0x7d3d('0x1c')]?_0x109a8f[_0x7d3d('0x1c')][_0x7d3d('0x1f')]||null:null,'include':_0x109a8f[_0x7d3d('0x1c')]?_0x109a8f[_0x7d3d('0x1c')][_0x7d3d('0x20')]?_[_0x7d3d('0x21')](_0x109a8f['options'][_0x7d3d('0x20')],function(_0x4f1165){return{'model':db[_0x4f1165['model']],'as':_0x4f1165['as'],'attributes':_0x4f1165[_0x7d3d('0x1f')],'include':_0x4f1165[_0x7d3d('0x20')]?_['map'](_0x4f1165[_0x7d3d('0x20')],function(_0x49e84f){return{'model':db[_0x49e84f['model']],'as':_0x49e84f['as'],'attributes':_0x49e84f['attributes'],'include':_0x49e84f[_0x7d3d('0x20')]?_['map'](_0x49e84f['include'],function(_0x341ff2){return{'model':db[_0x341ff2['model']],'as':_0x341ff2['as'],'attributes':_0x341ff2[_0x7d3d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7d3d('0xf')](function(_0xb902f0){logger[_0x7d3d('0x16')](_0x7d3d('0x19'),_0x109a8f);logger['debug'](_0x7d3d('0x19'),_0x109a8f,JSON[_0x7d3d('0x13')](_0xb902f0));_0x936188(_0xb902f0);})[_0x7d3d('0x18')](function(_0x8c0e1e){logger[_0x7d3d('0x14')](_0x7d3d('0x19'),_0x8c0e1e[_0x7d3d('0x15')],_0x109a8f);_0x150f3a(_0x294abd[_0x7d3d('0x14')](0x1f4,_0x8c0e1e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 98545ca..99f11ac 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 _0x1917=['emit','removeListener','register','length','squareProject:','./squareProject.events','remove'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x1917,0x9f));var _0x7191=function(_0x27514d,_0x159de7){_0x27514d=_0x27514d-0x0;var _0x39da5a=_0x1917[_0x27514d];return _0x39da5a;};'use strict';var SquareProjectEvents=require(_0x7191('0x0'));var events=['save',_0x7191('0x1'),'update'];function createListener(_0xafe940,_0x35b533){return function(_0x26ea29){_0x35b533[_0x7191('0x2')](_0xafe940,_0x26ea29);};}function removeListener(_0x4942eb,_0x51d7a3){return function(){SquareProjectEvents[_0x7191('0x3')](_0x4942eb,_0x51d7a3);};}exports[_0x7191('0x4')]=function(_0x48b3f9){for(var _0x3cf3c8=0x0,_0x370bba=events[_0x7191('0x5')];_0x3cf3c8<_0x370bba;_0x3cf3c8++){var _0x1a78b0=events[_0x3cf3c8];var _0x4989f9=createListener(_0x7191('0x6')+_0x1a78b0,_0x48b3f9);SquareProjectEvents['on'](_0x1a78b0,_0x4989f9);}}; \ No newline at end of file +var _0xee84=['save','remove','emit','length','squareProject:','./squareProject.events'];(function(_0x31f136,_0xf14e02){var _0x3f85cc=function(_0x36d478){while(--_0x36d478){_0x31f136['push'](_0x31f136['shift']());}};_0x3f85cc(++_0xf14e02);}(_0xee84,0xef));var _0x4ee8=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xee84[_0x3ab9ee];return _0x82ee88;};'use strict';var SquareProjectEvents=require(_0x4ee8('0x0'));var events=[_0x4ee8('0x1'),_0x4ee8('0x2'),'update'];function createListener(_0x55bbc0,_0x3bff87){return function(_0x3d13e6){_0x3bff87[_0x4ee8('0x3')](_0x55bbc0,_0x3d13e6);};}function removeListener(_0x174672,_0x463df4){return function(){SquareProjectEvents['removeListener'](_0x174672,_0x463df4);};}exports['register']=function(_0x4ee1fb){for(var _0x19ea54=0x0,_0x9e8704=events[_0x4ee8('0x4')];_0x19ea54<_0x9e8704;_0x19ea54++){var _0x333bd7=events[_0x19ea54];var _0x1659fa=createListener(_0x4ee8('0x5')+_0x333bd7,_0x4ee1fb);SquareProjectEvents['on'](_0x333bd7,_0x1659fa);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b7a5d74..bb8bdc2 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 _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0x372b02,_0x46dede){var _0x2057e9=function(_0x14f872){while(--_0x14f872){_0x372b02['push'](_0x372b02['shift']());}};_0x2057e9(++_0x46dede);}(_0x53ec,0x192));var _0xc53e=function(_0x4f7014,_0x3649ef){_0x4f7014=_0x4f7014-0x0;var _0x8fa130=_0x53ec[_0x4f7014];return _0x8fa130;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file +var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x2f2a0e,_0x2f5593){var _0x4b2d9d=function(_0x5a3c2b){while(--_0x5a3c2b){_0x2f2a0e['push'](_0x2f2a0e['shift']());}};_0x4b2d9d(++_0x2f5593);}(_0x326f,0xd1));var _0xf326=function(_0x36f83c,_0x65a047){_0x36f83c=_0x36f83c-0x0;var _0x3d14a7=_0x326f[_0x36f83c];return _0x3d14a7;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 2953002..e978297 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 _0x8ef6=['VIRTUAL','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x1b4c04,_0x8d961d){var _0x374f5d=function(_0x11dc31){while(--_0x11dc31){_0x1b4c04['push'](_0x1b4c04['shift']());}};_0x374f5d(++_0x8d961d);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5abcde,_0x15e663){_0x5abcde=_0x5abcde-0x0;var _0x38927e=_0x8ef6[_0x5abcde];return _0x38927e;};'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 +var _0xdbf5=['lastIndexOf','exports','STRING','VIRTUAL','savePath'];(function(_0x311a59,_0x26ee70){var _0x6fc8a1=function(_0x4a52a2){while(--_0x4a52a2){_0x311a59['push'](_0x311a59['shift']());}};_0x6fc8a1(++_0x26ee70);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x408aba,_0xb57212){_0x408aba=_0x408aba-0x0;var _0x135560=_0xdbf5[_0x408aba];return _0x135560;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5dbf('0x1')]},'context':{'type':Sequelize[_0x5dbf('0x1')]},'extension':{'type':Sequelize[_0x5dbf('0x1')]},'priority':{'type':Sequelize[_0x5dbf('0x1')]},'accountcode':{'type':Sequelize[_0x5dbf('0x1')]},'dnid':{'type':Sequelize[_0x5dbf('0x1')]},'projectName':{'type':Sequelize[_0x5dbf('0x1')]},'saveName':{'type':Sequelize[_0x5dbf('0x1')]},'filename':{'type':Sequelize[_0x5dbf('0x1')]},'savePath':{'type':Sequelize[_0x5dbf('0x1')]},'format':{'type':Sequelize[_0x5dbf('0x2')],'get':function(){var _0x88128e='';var _0x93e657=this['getDataValue'](_0x5dbf('0x3'));if(_0x93e657){_0x88128e=_0x93e657['substring'](_0x93e657[_0x5dbf('0x4')]('.'));}return _0x88128e;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 80b587e..84f94d8 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 _0x8507=['jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','status','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','SquareRecording','includeAll','include','findAll','show','params','keys','length','catch','create','body','find','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','squel','crypto'];(function(_0x6de857,_0x3f9ded){var _0x21ce78=function(_0x4d1a72){while(--_0x4d1a72){_0x6de857['push'](_0x6de857['shift']());}};_0x21ce78(++_0x3f9ded);}(_0x8507,0x16d));var _0x7850=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8507[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x7850('0x0'));var rimraf=require(_0x7850('0x1'));var zipdir=require(_0x7850('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7850('0x3'));var moment=require('moment');var BPromise=require(_0x7850('0x4'));var Mustache=require('mustache');var util=require(_0x7850('0x5'));var path=require(_0x7850('0x6'));var sox=require(_0x7850('0x7'));var csv=require(_0x7850('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7850('0x9'));var crypto=require(_0x7850('0xa'));var jsforce=require(_0x7850('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7850('0x8'));var querystring=require(_0x7850('0xc'));var Papa=require('papaparse');var Redis=require(_0x7850('0xd'));var authService=require(_0x7850('0xe'));var qs=require(_0x7850('0xf'));var as=require(_0x7850('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7850('0x11'))('api');var utils=require(_0x7850('0x12'));var config=require(_0x7850('0x13'));var licenseUtil=require(_0x7850('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x349261,_0x1970b6){_0x1970b6=_0x1970b6||0xcc;return function(_0x3cda46){if(_0x3cda46){return _0x349261[_0x7850('0x15')](_0x1970b6);}return _0x349261['status'](_0x1970b6)[_0x7850('0x16')]();};}function respondWithResult(_0x1b009d,_0x57c94c){_0x57c94c=_0x57c94c||0xc8;return function(_0x345570){if(_0x345570){return _0x1b009d['status'](_0x57c94c)[_0x7850('0x17')](_0x345570);}};}function respondWithFilteredResult(_0xfaefc9,_0xa8fd68){return function(_0x188691){if(_0x188691){var _0x328777=typeof _0xa8fd68[_0x7850('0x18')]==='undefined'&&typeof _0xa8fd68[_0x7850('0x19')]===_0x7850('0x1a');var _0x2cb217=_0x188691[_0x7850('0x1b')];var _0xc6830f=_0x328777?0x0:_0xa8fd68['offset'];var _0x48e585=_0x328777?_0x188691[_0x7850('0x1b')]:_0xa8fd68[_0x7850('0x18')]+_0xa8fd68[_0x7850('0x19')];var _0x947ebb;if(_0x48e585>=_0x2cb217){_0x48e585=_0x2cb217;_0x947ebb=0xc8;}else{_0x947ebb=0xce;}_0xfaefc9['status'](_0x947ebb);return _0xfaefc9[_0x7850('0x1c')](_0x7850('0x1d'),_0xc6830f+'-'+_0x48e585+'/'+_0x2cb217)[_0x7850('0x17')](_0x188691);}return null;};}function patchUpdates(_0x1d7e68){return function(_0x25ddc1){try{jsonpatch[_0x7850('0x1e')](_0x25ddc1,_0x1d7e68,!![]);}catch(_0x5567dd){return BPromise['reject'](_0x5567dd);}return _0x25ddc1[_0x7850('0x1f')]();};}function saveUpdates(_0x56b695,_0x14a9d1){return function(_0x410bf8){if(_0x410bf8){return _0x410bf8[_0x7850('0x20')](_0x56b695)[_0x7850('0x21')](function(_0x4f0f26){return _0x4f0f26;});}return null;};}function removeEntity(_0x5e53d6,_0x2df22f){return function(_0x2d5e50){if(_0x2d5e50){return _0x2d5e50[_0x7850('0x22')]()[_0x7850('0x21')](function(){_0x5e53d6['status'](0xcc)[_0x7850('0x16')]();});}};}function handleEntityNotFound(_0xf14701,_0x48885f){return function(_0x4b8546){if(!_0x4b8546){_0xf14701['sendStatus'](0x194);}return _0x4b8546;};}function handleError(_0x2b8c0a,_0xe1bc5b){_0xe1bc5b=_0xe1bc5b||0x1f4;return function(_0x5bfd27){logger[_0x7850('0x23')](_0x5bfd27['stack']);if(_0x5bfd27['name']){delete _0x5bfd27[_0x7850('0x24')];}_0x2b8c0a[_0x7850('0x25')](_0xe1bc5b)[_0x7850('0x26')](_0x5bfd27);};}exports[_0x7850('0x27')]=function(_0x42b259,_0x22798a){var _0x5a2a13={},_0x47c1d6={},_0x16fca8={'count':0x0,'rows':[]};var _0x33a4da=_[_0x7850('0x28')](db['SquareRecording'][_0x7850('0x29')],function(_0x44f16f){return{'name':_0x44f16f[_0x7850('0x2a')],'type':_0x44f16f[_0x7850('0x2b')]['key']};});_0x47c1d6[_0x7850('0x2c')]=_[_0x7850('0x28')](_0x33a4da,_0x7850('0x24'));_0x47c1d6[_0x7850('0x2d')]=_['keys'](_0x42b259[_0x7850('0x2d')]);_0x47c1d6[_0x7850('0x2e')]=_[_0x7850('0x2f')](_0x47c1d6['model'],_0x47c1d6[_0x7850('0x2d')]);_0x5a2a13[_0x7850('0x30')]=_[_0x7850('0x2f')](_0x47c1d6[_0x7850('0x2c')],qs[_0x7850('0x31')](_0x42b259[_0x7850('0x2d')][_0x7850('0x31')]));_0x5a2a13['attributes']=_0x5a2a13[_0x7850('0x30')]['length']?_0x5a2a13['attributes']:_0x47c1d6[_0x7850('0x2c')];if(!_0x42b259[_0x7850('0x2d')]['hasOwnProperty'](_0x7850('0x32'))){_0x5a2a13[_0x7850('0x19')]=qs['limit'](_0x42b259[_0x7850('0x2d')][_0x7850('0x19')]);_0x5a2a13[_0x7850('0x18')]=qs[_0x7850('0x18')](_0x42b259[_0x7850('0x2d')]['offset']);}_0x5a2a13[_0x7850('0x33')]=qs[_0x7850('0x34')](_0x42b259[_0x7850('0x2d')][_0x7850('0x34')]);_0x5a2a13[_0x7850('0x35')]=qs[_0x7850('0x2e')](_[_0x7850('0x36')](_0x42b259[_0x7850('0x2d')],_0x47c1d6[_0x7850('0x2e')]),_0x33a4da);if(_0x42b259[_0x7850('0x2d')][_0x7850('0x37')]){_0x5a2a13[_0x7850('0x35')]=_[_0x7850('0x38')](_0x5a2a13[_0x7850('0x35')],{'$or':_[_0x7850('0x28')](_0x33a4da,function(_0x2d84e0){if(_0x2d84e0[_0x7850('0x2b')]!=='VIRTUAL'){var _0x402c3c={};_0x402c3c[_0x2d84e0[_0x7850('0x24')]]={'$like':'%'+_0x42b259[_0x7850('0x2d')]['filter']+'%'};return _0x402c3c;}})});}_0x5a2a13=_['merge']({},_0x5a2a13,_0x42b259['options']);var _0xd4c5b1={'where':_0x5a2a13[_0x7850('0x35')]};return db[_0x7850('0x39')][_0x7850('0x1b')](_0xd4c5b1)[_0x7850('0x21')](function(_0x2b7c50){_0x16fca8[_0x7850('0x1b')]=_0x2b7c50;if(_0x42b259[_0x7850('0x2d')][_0x7850('0x3a')]){_0x5a2a13[_0x7850('0x3b')]=[{'all':!![]}];}return db[_0x7850('0x39')][_0x7850('0x3c')](_0x5a2a13);})['then'](function(_0xeb1c23){_0x16fca8['rows']=_0xeb1c23;return _0x16fca8;})['then'](respondWithFilteredResult(_0x22798a,_0x5a2a13))['catch'](handleError(_0x22798a,null));};exports[_0x7850('0x3d')]=function(_0x3b5569,_0x2dae9a){var _0x4ece56={'raw':!![],'where':{'id':_0x3b5569[_0x7850('0x3e')]['id']}},_0x18bb73={};_0x18bb73[_0x7850('0x2c')]=_[_0x7850('0x3f')](db['SquareRecording'][_0x7850('0x29')]);_0x18bb73[_0x7850('0x2d')]=_[_0x7850('0x3f')](_0x3b5569['query']);_0x18bb73[_0x7850('0x2e')]=_[_0x7850('0x2f')](_0x18bb73[_0x7850('0x2c')],_0x18bb73['query']);_0x4ece56[_0x7850('0x30')]=_[_0x7850('0x2f')](_0x18bb73[_0x7850('0x2c')],qs[_0x7850('0x31')](_0x3b5569[_0x7850('0x2d')][_0x7850('0x31')]));_0x4ece56[_0x7850('0x30')]=_0x4ece56[_0x7850('0x30')][_0x7850('0x40')]?_0x4ece56[_0x7850('0x30')]:_0x18bb73['model'];if(_0x3b5569[_0x7850('0x2d')][_0x7850('0x3a')]){_0x4ece56['include']=[{'all':!![]}];}_0x4ece56=_[_0x7850('0x38')]({},_0x4ece56,_0x3b5569['options']);return db['SquareRecording']['find'](_0x4ece56)[_0x7850('0x21')](handleEntityNotFound(_0x2dae9a,null))['then'](respondWithResult(_0x2dae9a,null))[_0x7850('0x41')](handleError(_0x2dae9a,null));};exports['create']=function(_0xc0d241,_0xc46e5c){return db['SquareRecording'][_0x7850('0x42')](_0xc0d241[_0x7850('0x43')],{})['then'](respondWithResult(_0xc46e5c,0xc9))[_0x7850('0x41')](handleError(_0xc46e5c,null));};exports[_0x7850('0x20')]=function(_0x3f53eb,_0x34eb76){if(_0x3f53eb[_0x7850('0x43')]['id']){delete _0x3f53eb['body']['id'];}return db[_0x7850('0x39')][_0x7850('0x44')]({'where':{'id':_0x3f53eb['params']['id']}})['then'](handleEntityNotFound(_0x34eb76,null))['then'](saveUpdates(_0x3f53eb['body'],null))[_0x7850('0x21')](respondWithResult(_0x34eb76,null))[_0x7850('0x41')](handleError(_0x34eb76,null));};exports[_0x7850('0x45')]=function(_0x18a5e5,_0x4e156b,_0x18bdee){var _0x51f91e=require(_0x7850('0x46'));var _0x12d3d7=![];var _0x2f2627={};if(_0x18a5e5['query'][_0x7850('0x2b')]&&_0x18a5e5['query'][_0x7850('0x2b')]===_0x7850('0x47')){_0x2f2627[_0x7850('0x47')]=_0x18a5e5[_0x7850('0x3e')]['id'];}else{_0x2f2627['id']=_0x18a5e5[_0x7850('0x3e')]['id'];}return db[_0x7850('0x39')][_0x7850('0x44')]({'where':_0x2f2627,'attributes':['id',_0x7850('0x48'),_0x7850('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x4e156b,null))[_0x7850('0x21')](function(_0x1b2f2a){if(_0x1b2f2a){var _0x1978c0=_0x1b2f2a[_0x7850('0x48')];var _0x1d21d9=util[_0x7850('0x4a')](_0x7850('0x4b'),_0x1978c0);if(fs[_0x7850('0x4c')](_0x1d21d9)){_0x12d3d7=!![];return _0x51f91e[_0x7850('0x4d')](_0x1d21d9,_0x1978c0,config[_0x7850('0x4e')][_0x7850('0x4f')])[_0x7850('0x21')](function(){return _0x1b2f2a;});}return _0x1b2f2a;}})['then'](function(_0x31260f){if(_0x31260f){var _0x50e704=_0x31260f[_0x7850('0x48')];if(!fs['existsSync'](_0x50e704)){throw new db[(_0x7850('0x50'))][(_0x7850('0x51'))](_0x7850('0x52'));}if(_0x31260f[_0x7850('0x49')]){return _0x4e156b['download'](_0x50e704,_0x31260f[_0x7850('0x49')]+path[_0x7850('0x53')](_0x50e704),function(){if(_0x12d3d7){fs['unlink'](_0x50e704);}});}else{return _0x4e156b['download'](_0x50e704,function(_0x3d9d03){if(_0x12d3d7){fs[_0x7850('0x54')](_0x50e704);}});}}})[_0x7850('0x41')](function(_0x3bcf2a){if(_0x3bcf2a[_0x7850('0x55')]===_0x7850('0x52')){_0x4e156b[_0x7850('0x25')](0x194)[_0x7850('0x26')](_0x7850('0x56'));}else{return handleError(_0x4e156b,null);}});};exports['destroy']=function(_0x184841,_0x353c3d){return db[_0x7850('0x39')]['find']({'where':{'id':_0x184841['params']['id']}})[_0x7850('0x21')](function(_0x289d19){if(_[_0x7850('0x57')](_0x289d19)){throw new ReferenceError(_0x7850('0x58'));}return _0x289d19;})['then'](function(_0x1caf77){var _0x210038=_0x1caf77[_0x7850('0x48')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x210038);if(!_[_0x7850('0x57')](_0x1caf77[_0x7850('0x48')])&&fs['existsSync'](_0x210038)){logger[_0x7850('0x59')](_0x7850('0x5a')+_0x210038+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x210038);}_0x210038=_0x210038+_0x7850('0x5b');if(!_[_0x7850('0x57')](_0x1caf77[_0x7850('0x48')])&&fs[_0x7850('0x4c')](_0x210038)){logger[_0x7850('0x59')]('File:\x20\x22'+_0x210038+_0x7850('0x5c'));fs[_0x7850('0x5d')](_0x210038);}return _0x1caf77;})[_0x7850('0x21')](function(_0x1af21a){if(!_0x1af21a)throw new InternalError();return _0x1af21a['destroy']();})[_0x7850('0x21')](function(){_0x353c3d[_0x7850('0x25')](0xcc)[_0x7850('0x16')]();})[_0x7850('0x41')](handleError(_0x353c3d,null));}; \ No newline at end of file +var _0xf151=['apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','SquareRecording','include','findAll','rows','catch','show','params','includeAll','create','body','find','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','recording','Sequelize','ValidationError','filename','extname','unlink','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf151,0x15f));var _0x1f15=function(_0x129987,_0x1ba53a){_0x129987=_0x129987-0x0;var _0x310b57=_0xf151[_0x129987];return _0x310b57;};'use strict';var emlformat=require(_0x1f15('0x0'));var rimraf=require(_0x1f15('0x1'));var zipdir=require(_0x1f15('0x2'));var jsonpatch=require(_0x1f15('0x3'));var rp=require(_0x1f15('0x4'));var moment=require('moment');var BPromise=require(_0x1f15('0x5'));var Mustache=require(_0x1f15('0x6'));var util=require('util');var path=require(_0x1f15('0x7'));var sox=require(_0x1f15('0x8'));var csv=require(_0x1f15('0x9'));var ejs=require(_0x1f15('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f15('0xb'));var squel=require(_0x1f15('0xc'));var crypto=require(_0x1f15('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1f15('0xe'));var toCsv=require(_0x1f15('0x9'));var querystring=require(_0x1f15('0xf'));var Papa=require('papaparse');var Redis=require(_0x1f15('0x10'));var authService=require(_0x1f15('0x11'));var qs=require(_0x1f15('0x12'));var as=require(_0x1f15('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f15('0x14'))('api');var utils=require(_0x1f15('0x15'));var config=require(_0x1f15('0x16'));var licenseUtil=require(_0x1f15('0x17'));var db=require(_0x1f15('0x18'))['db'];function respondWithStatusCode(_0x25c0f4,_0x5d899c){_0x5d899c=_0x5d899c||0xcc;return function(_0x333b91){if(_0x333b91){return _0x25c0f4[_0x1f15('0x19')](_0x5d899c);}return _0x25c0f4['status'](_0x5d899c)[_0x1f15('0x1a')]();};}function respondWithResult(_0x5222c1,_0x5d6db1){_0x5d6db1=_0x5d6db1||0xc8;return function(_0x84c2a3){if(_0x84c2a3){return _0x5222c1['status'](_0x5d6db1)[_0x1f15('0x1b')](_0x84c2a3);}};}function respondWithFilteredResult(_0x3e702a,_0x4e6788){return function(_0x12068d){if(_0x12068d){var _0x195fcd=typeof _0x4e6788[_0x1f15('0x1c')]===_0x1f15('0x1d')&&typeof _0x4e6788[_0x1f15('0x1e')]==='undefined';var _0x577b9f=_0x12068d['count'];var _0x25548c=_0x195fcd?0x0:_0x4e6788[_0x1f15('0x1c')];var _0x143f9f=_0x195fcd?_0x12068d[_0x1f15('0x1f')]:_0x4e6788[_0x1f15('0x1c')]+_0x4e6788[_0x1f15('0x1e')];var _0x155d1d;if(_0x143f9f>=_0x577b9f){_0x143f9f=_0x577b9f;_0x155d1d=0xc8;}else{_0x155d1d=0xce;}_0x3e702a[_0x1f15('0x20')](_0x155d1d);return _0x3e702a['set']('Content-Range',_0x25548c+'-'+_0x143f9f+'/'+_0x577b9f)[_0x1f15('0x1b')](_0x12068d);}return null;};}function patchUpdates(_0x318fac){return function(_0x1c57c8){try{jsonpatch[_0x1f15('0x21')](_0x1c57c8,_0x318fac,!![]);}catch(_0x4a34f3){return BPromise[_0x1f15('0x22')](_0x4a34f3);}return _0x1c57c8[_0x1f15('0x23')]();};}function saveUpdates(_0x1bfaa6,_0x2fcf15){return function(_0x46b624){if(_0x46b624){return _0x46b624[_0x1f15('0x24')](_0x1bfaa6)[_0x1f15('0x25')](function(_0x24ea7f){return _0x24ea7f;});}return null;};}function removeEntity(_0x36e8eb,_0x4bc901){return function(_0x55e8cf){if(_0x55e8cf){return _0x55e8cf[_0x1f15('0x26')]()[_0x1f15('0x25')](function(){_0x36e8eb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24058d,_0xbf1de3){return function(_0x2ce5c0){if(!_0x2ce5c0){_0x24058d[_0x1f15('0x19')](0x194);}return _0x2ce5c0;};}function handleError(_0x4bae08,_0x2d6147){_0x2d6147=_0x2d6147||0x1f4;return function(_0x2dc59a){logger[_0x1f15('0x27')](_0x2dc59a['stack']);if(_0x2dc59a['name']){delete _0x2dc59a[_0x1f15('0x28')];}_0x4bae08['status'](_0x2d6147)[_0x1f15('0x29')](_0x2dc59a);};}exports[_0x1f15('0x2a')]=function(_0x2ec4ca,_0xc85374){var _0x2d7f75={},_0x985082={},_0x5cac1d={'count':0x0,'rows':[]};var _0x8ccb9e=_['map'](db['SquareRecording'][_0x1f15('0x2b')],function(_0x5c2585){return{'name':_0x5c2585['fieldName'],'type':_0x5c2585[_0x1f15('0x2c')][_0x1f15('0x2d')]};});_0x985082[_0x1f15('0x2e')]=_[_0x1f15('0x2f')](_0x8ccb9e,'name');_0x985082[_0x1f15('0x30')]=_[_0x1f15('0x31')](_0x2ec4ca['query']);_0x985082['filters']=_[_0x1f15('0x32')](_0x985082[_0x1f15('0x2e')],_0x985082[_0x1f15('0x30')]);_0x2d7f75[_0x1f15('0x33')]=_[_0x1f15('0x32')](_0x985082[_0x1f15('0x2e')],qs[_0x1f15('0x34')](_0x2ec4ca['query'][_0x1f15('0x34')]));_0x2d7f75[_0x1f15('0x33')]=_0x2d7f75[_0x1f15('0x33')]['length']?_0x2d7f75[_0x1f15('0x33')]:_0x985082[_0x1f15('0x2e')];if(!_0x2ec4ca[_0x1f15('0x30')][_0x1f15('0x35')](_0x1f15('0x36'))){_0x2d7f75['limit']=qs['limit'](_0x2ec4ca[_0x1f15('0x30')][_0x1f15('0x1e')]);_0x2d7f75[_0x1f15('0x1c')]=qs[_0x1f15('0x1c')](_0x2ec4ca[_0x1f15('0x30')][_0x1f15('0x1c')]);}_0x2d7f75['order']=qs[_0x1f15('0x37')](_0x2ec4ca[_0x1f15('0x30')][_0x1f15('0x37')]);_0x2d7f75[_0x1f15('0x38')]=qs['filters'](_[_0x1f15('0x39')](_0x2ec4ca[_0x1f15('0x30')],_0x985082[_0x1f15('0x3a')]),_0x8ccb9e);if(_0x2ec4ca['query'][_0x1f15('0x3b')]){_0x2d7f75[_0x1f15('0x38')]=_[_0x1f15('0x3c')](_0x2d7f75[_0x1f15('0x38')],{'$or':_['map'](_0x8ccb9e,function(_0x535f8c){if(_0x535f8c[_0x1f15('0x2c')]!==_0x1f15('0x3d')){var _0x468295={};_0x468295[_0x535f8c[_0x1f15('0x28')]]={'$like':'%'+_0x2ec4ca[_0x1f15('0x30')][_0x1f15('0x3b')]+'%'};return _0x468295;}})});}_0x2d7f75=_[_0x1f15('0x3c')]({},_0x2d7f75,_0x2ec4ca[_0x1f15('0x3e')]);var _0xf513f8={'where':_0x2d7f75[_0x1f15('0x38')]};return db[_0x1f15('0x3f')]['count'](_0xf513f8)[_0x1f15('0x25')](function(_0x39259e){_0x5cac1d['count']=_0x39259e;if(_0x2ec4ca['query']['includeAll']){_0x2d7f75[_0x1f15('0x40')]=[{'all':!![]}];}return db[_0x1f15('0x3f')][_0x1f15('0x41')](_0x2d7f75);})[_0x1f15('0x25')](function(_0x161afe){_0x5cac1d[_0x1f15('0x42')]=_0x161afe;return _0x5cac1d;})[_0x1f15('0x25')](respondWithFilteredResult(_0xc85374,_0x2d7f75))[_0x1f15('0x43')](handleError(_0xc85374,null));};exports[_0x1f15('0x44')]=function(_0x10de4f,_0x10f525){var _0x314d3c={'raw':!![],'where':{'id':_0x10de4f[_0x1f15('0x45')]['id']}},_0x497adf={};_0x497adf['model']=_['keys'](db['SquareRecording'][_0x1f15('0x2b')]);_0x497adf[_0x1f15('0x30')]=_[_0x1f15('0x31')](_0x10de4f[_0x1f15('0x30')]);_0x497adf['filters']=_[_0x1f15('0x32')](_0x497adf[_0x1f15('0x2e')],_0x497adf[_0x1f15('0x30')]);_0x314d3c[_0x1f15('0x33')]=_[_0x1f15('0x32')](_0x497adf[_0x1f15('0x2e')],qs[_0x1f15('0x34')](_0x10de4f[_0x1f15('0x30')][_0x1f15('0x34')]));_0x314d3c['attributes']=_0x314d3c[_0x1f15('0x33')]['length']?_0x314d3c[_0x1f15('0x33')]:_0x497adf['model'];if(_0x10de4f['query'][_0x1f15('0x46')]){_0x314d3c[_0x1f15('0x40')]=[{'all':!![]}];}_0x314d3c=_[_0x1f15('0x3c')]({},_0x314d3c,_0x10de4f[_0x1f15('0x3e')]);return db['SquareRecording']['find'](_0x314d3c)[_0x1f15('0x25')](handleEntityNotFound(_0x10f525,null))[_0x1f15('0x25')](respondWithResult(_0x10f525,null))[_0x1f15('0x43')](handleError(_0x10f525,null));};exports['create']=function(_0x57753f,_0x2ab4bb){return db[_0x1f15('0x3f')][_0x1f15('0x47')](_0x57753f[_0x1f15('0x48')],{})[_0x1f15('0x25')](respondWithResult(_0x2ab4bb,0xc9))['catch'](handleError(_0x2ab4bb,null));};exports[_0x1f15('0x24')]=function(_0x502a8f,_0xd20a8e){if(_0x502a8f['body']['id']){delete _0x502a8f['body']['id'];}return db[_0x1f15('0x3f')][_0x1f15('0x49')]({'where':{'id':_0x502a8f[_0x1f15('0x45')]['id']}})[_0x1f15('0x25')](handleEntityNotFound(_0xd20a8e,null))[_0x1f15('0x25')](saveUpdates(_0x502a8f[_0x1f15('0x48')],null))[_0x1f15('0x25')](respondWithResult(_0xd20a8e,null))[_0x1f15('0x43')](handleError(_0xd20a8e,null));};exports[_0x1f15('0x4a')]=function(_0x5f5393,_0x42710b,_0x5beb03){var _0x457240=require(_0x1f15('0x4b'));var _0x11a2b0=![];var _0x29f2cf={};if(_0x5f5393[_0x1f15('0x30')][_0x1f15('0x2c')]&&_0x5f5393[_0x1f15('0x30')][_0x1f15('0x2c')]==='uniqueid'){_0x29f2cf[_0x1f15('0x4c')]=_0x5f5393[_0x1f15('0x45')]['id'];}else{_0x29f2cf['id']=_0x5f5393['params']['id'];}return db['SquareRecording'][_0x1f15('0x49')]({'where':_0x29f2cf,'attributes':['id',_0x1f15('0x4d'),'filename'],'raw':!![]})[_0x1f15('0x25')](handleEntityNotFound(_0x42710b,null))[_0x1f15('0x25')](function(_0x4f7da7){if(_0x4f7da7){var _0x2c8f1b=_0x4f7da7[_0x1f15('0x4d')];var _0x3f9013=util[_0x1f15('0x4e')](_0x1f15('0x4f'),_0x2c8f1b);if(fs[_0x1f15('0x50')](_0x3f9013)){_0x11a2b0=!![];return _0x457240['decryptFile'](_0x3f9013,_0x2c8f1b,config['secrets'][_0x1f15('0x51')])[_0x1f15('0x25')](function(){return _0x4f7da7;});}return _0x4f7da7;}})['then'](function(_0x556431){if(_0x556431){var _0x56081c=_0x556431[_0x1f15('0x4d')];if(!fs['existsSync'](_0x56081c)){throw new db[(_0x1f15('0x52'))][(_0x1f15('0x53'))]('SquareRecording\x20not\x20found');}if(_0x556431['filename']){return _0x42710b['download'](_0x56081c,_0x556431[_0x1f15('0x54')]+path[_0x1f15('0x55')](_0x56081c),function(){if(_0x11a2b0){fs[_0x1f15('0x56')](_0x56081c);}});}else{return _0x42710b[_0x1f15('0x4a')](_0x56081c,function(_0x224cd8){if(_0x11a2b0){fs[_0x1f15('0x56')](_0x56081c);}});}}})[_0x1f15('0x43')](function(_0x2ba528){if(_0x2ba528['message']==='SquareRecording\x20not\x20found'){_0x42710b[_0x1f15('0x20')](0x194)[_0x1f15('0x29')](_0x1f15('0x57'));}else{return handleError(_0x42710b,null);}});};exports[_0x1f15('0x26')]=function(_0x28e65f,_0x5cb203){return db['SquareRecording'][_0x1f15('0x49')]({'where':{'id':_0x28e65f[_0x1f15('0x45')]['id']}})[_0x1f15('0x25')](function(_0x52e728){if(_['isNil'](_0x52e728)){throw new ReferenceError(_0x1f15('0x58'));}return _0x52e728;})[_0x1f15('0x25')](function(_0x3f3a07){var _0xa8f44b=_0x3f3a07['savePath'];logger[_0x1f15('0x59')](_0x1f15('0x5a'),_0xa8f44b);if(!_[_0x1f15('0x5b')](_0x3f3a07[_0x1f15('0x4d')])&&fs[_0x1f15('0x50')](_0xa8f44b)){logger[_0x1f15('0x59')](_0x1f15('0x5c')+_0xa8f44b+_0x1f15('0x5d'));fs[_0x1f15('0x5e')](_0xa8f44b);}_0xa8f44b=_0xa8f44b+_0x1f15('0x5f');if(!_['isNil'](_0x3f3a07[_0x1f15('0x4d')])&&fs[_0x1f15('0x50')](_0xa8f44b)){logger[_0x1f15('0x59')](_0x1f15('0x5c')+_0xa8f44b+_0x1f15('0x5d'));fs[_0x1f15('0x5e')](_0xa8f44b);}return _0x3f3a07;})[_0x1f15('0x25')](function(_0x3fb58b){if(!_0x3fb58b)throw new InternalError();return _0x3fb58b['destroy']();})['then'](function(){_0x5cb203[_0x1f15('0x20')](0xcc)[_0x1f15('0x1a')]();})[_0x1f15('0x43')](handleError(_0x5cb203,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 552626d..da7573f 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 _0x7a2f=['moment','bluebird','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','api'];(function(_0x591f3d,_0x1ed163){var _0x4f87cf=function(_0x87eb42){while(--_0x87eb42){_0x591f3d['push'](_0x591f3d['shift']());}};_0x4f87cf(++_0x1ed163);}(_0x7a2f,0x99));var _0xf7a2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a2f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf7a2('0x0'));var util=require(_0xf7a2('0x1'));var logger=require('../../config/logger')(_0xf7a2('0x2'));var moment=require(_0xf7a2('0x3'));var BPromise=require(_0xf7a2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf7a2('0x5'));var rimraf=require(_0xf7a2('0x6'));var config=require(_0xf7a2('0x7'));var attributes=require(_0xf7a2('0x8'));module[_0xf7a2('0x9')]=function(_0x2680b9,_0x5698e1){return _0x2680b9[_0xf7a2('0xa')](_0xf7a2('0xb'),attributes,{'tableName':_0xf7a2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00b3=['bluebird','path','rimraf','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment'];(function(_0x32fad0,_0x544f40){var _0x303715=function(_0x820e3e){while(--_0x820e3e){_0x32fad0['push'](_0x32fad0['shift']());}};_0x303715(++_0x544f40);}(_0x00b3,0x157));var _0x300b=function(_0x3e419c,_0x3eacb9){_0x3e419c=_0x3e419c-0x0;var _0x1e3e1f=_0x00b3[_0x3e419c];return _0x1e3e1f;};'use strict';var _=require(_0x300b('0x0'));var util=require(_0x300b('0x1'));var logger=require(_0x300b('0x2'))(_0x300b('0x3'));var moment=require(_0x300b('0x4'));var BPromise=require(_0x300b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x300b('0x6'));var rimraf=require(_0x300b('0x7'));var config=require('../../config/environment');var attributes=require(_0x300b('0x8'));module['exports']=function(_0x2bd6ef,_0x345454){return _0x2bd6ef[_0x300b('0x9')](_0x300b('0xa'),attributes,{'tableName':_0x300b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index c281061..8bae3ad 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 _0xef50=['request\x20sent','stringify','error','code','message','result','catch','CreateSquareRecording','create','then','debug','lodash','moment','bluebird','randomstring','ioredis','jayson/promise','client','info','SquareRecording,\x20%s,\x20%s'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xef50,0x6f));var _0x0ef5=function(_0x343542,_0x32d936){_0x343542=_0x343542-0x0;var _0x45ecc3=_0xef50[_0x343542];return _0x45ecc3;};'use strict';var _=require(_0x0ef5('0x0'));var util=require('util');var moment=require(_0x0ef5('0x1'));var BPromise=require(_0x0ef5('0x2'));var rs=require(_0x0ef5('0x3'));var fs=require('fs');var Redis=require(_0x0ef5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0ef5('0x5'));var client=jayson[_0x0ef5('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11a74e,_0x337c70,_0x1ad08f){return new BPromise(function(_0x4470c3,_0x4dee08){return client['request'](_0x11a74e,_0x1ad08f)['then'](function(_0x4b1060){logger[_0x0ef5('0x7')](_0x0ef5('0x8'),_0x337c70,_0x0ef5('0x9'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x337c70,_0x0ef5('0x9'),JSON[_0x0ef5('0xa')](_0x4b1060));if(_0x4b1060[_0x0ef5('0xb')]){if(_0x4b1060[_0x0ef5('0xb')][_0x0ef5('0xc')]===0x1f4){logger[_0x0ef5('0xb')]('SquareRecording,\x20%s,\x20%s',_0x337c70,_0x4b1060[_0x0ef5('0xb')]['message']);return _0x4dee08(_0x4b1060['error'][_0x0ef5('0xd')]);}logger[_0x0ef5('0xb')]('SquareRecording,\x20%s,\x20%s',_0x337c70,_0x4b1060[_0x0ef5('0xb')][_0x0ef5('0xd')]);return _0x4470c3(_0x4b1060['error'][_0x0ef5('0xd')]);}else{logger[_0x0ef5('0x7')](_0x0ef5('0x8'),_0x337c70,'request\x20sent');_0x4470c3(_0x4b1060[_0x0ef5('0xe')][_0x0ef5('0xd')]);}})[_0x0ef5('0xf')](function(_0x425903){logger[_0x0ef5('0xb')](_0x0ef5('0x8'),_0x337c70,_0x425903);_0x4dee08(_0x425903);});});}exports[_0x0ef5('0x10')]=function(_0x48ad2f){var _0x440fe3=this;return new Promise(function(_0x319825,_0x5c10fa){return db['SquareRecording'][_0x0ef5('0x11')](_0x48ad2f['body'],{'raw':_0x48ad2f['options']?_0x48ad2f['options']['raw']===undefined?!![]:![]:!![]})[_0x0ef5('0x12')](function(_0x3959c8){logger[_0x0ef5('0x7')](_0x0ef5('0x10'),_0x48ad2f);logger[_0x0ef5('0x13')](_0x0ef5('0x10'),_0x48ad2f,JSON[_0x0ef5('0xa')](_0x3959c8));_0x319825(_0x3959c8);})[_0x0ef5('0xf')](function(_0x45f678){logger[_0x0ef5('0xb')](_0x0ef5('0x10'),_0x45f678[_0x0ef5('0xd')],_0x48ad2f);_0x5c10fa(_0x440fe3['error'](0x1f4,_0x45f678[_0x0ef5('0xd')]));});});}; \ No newline at end of file +var _0x7342=['bluebird','../../mysqldb','../../config/logger','http','request','info','debug','request\x20sent','error','code','SquareRecording,\x20%s,\x20%s','message','result','CreateSquareRecording','body','options','raw','then','stringify','catch','util'];(function(_0x599e3f,_0x1f81e1){var _0x46c863=function(_0x43669a){while(--_0x43669a){_0x599e3f['push'](_0x599e3f['shift']());}};_0x46c863(++_0x1f81e1);}(_0x7342,0x1e2));var _0x2734=function(_0x3c7465,_0x18e1ee){_0x3c7465=_0x3c7465-0x0;var _0x4ab48f=_0x7342[_0x3c7465];return _0x4ab48f;};'use strict';var _=require('lodash');var util=require(_0x2734('0x0'));var moment=require('moment');var BPromise=require(_0x2734('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2734('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x2734('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2734('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x17f1a4,_0x35393f,_0x250497){return new BPromise(function(_0xe0e7b7,_0x13514b){return client[_0x2734('0x5')](_0x17f1a4,_0x250497)['then'](function(_0x351c3a){logger[_0x2734('0x6')]('SquareRecording,\x20%s,\x20%s',_0x35393f,'request\x20sent');logger[_0x2734('0x7')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x35393f,_0x2734('0x8'),JSON['stringify'](_0x351c3a));if(_0x351c3a[_0x2734('0x9')]){if(_0x351c3a[_0x2734('0x9')][_0x2734('0xa')]===0x1f4){logger[_0x2734('0x9')](_0x2734('0xb'),_0x35393f,_0x351c3a[_0x2734('0x9')][_0x2734('0xc')]);return _0x13514b(_0x351c3a['error']['message']);}logger[_0x2734('0x9')](_0x2734('0xb'),_0x35393f,_0x351c3a['error'][_0x2734('0xc')]);return _0xe0e7b7(_0x351c3a[_0x2734('0x9')]['message']);}else{logger[_0x2734('0x6')](_0x2734('0xb'),_0x35393f,'request\x20sent');_0xe0e7b7(_0x351c3a[_0x2734('0xd')][_0x2734('0xc')]);}})['catch'](function(_0x2d1d94){logger[_0x2734('0x9')](_0x2734('0xb'),_0x35393f,_0x2d1d94);_0x13514b(_0x2d1d94);});});}exports[_0x2734('0xe')]=function(_0xe95d6f){var _0x624fd8=this;return new Promise(function(_0x5306e0,_0x4c6a12){return db['SquareRecording']['create'](_0xe95d6f[_0x2734('0xf')],{'raw':_0xe95d6f['options']?_0xe95d6f[_0x2734('0x10')][_0x2734('0x11')]===undefined?!![]:![]:!![]})[_0x2734('0x12')](function(_0x30639f){logger[_0x2734('0x6')](_0x2734('0xe'),_0xe95d6f);logger[_0x2734('0x7')](_0x2734('0xe'),_0xe95d6f,JSON[_0x2734('0x13')](_0x30639f));_0x5306e0(_0x30639f);})[_0x2734('0x14')](function(_0x4a6048){logger[_0x2734('0x9')](_0x2734('0xe'),_0x4a6048[_0x2734('0xc')],_0xe95d6f);_0x4c6a12(_0x624fd8[_0x2734('0x9')](0x1f4,_0x4a6048[_0x2734('0xc')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 3745212..6ef56dc 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(_0x40bdbc,_0x3fabcd){var _0xc603a8=function(_0x17c0e6){while(--_0x17c0e6){_0x40bdbc['push'](_0x40bdbc['shift']());}};_0xc603a8(++_0x3fabcd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x3dc928,_0x3f5268){var _0x3faa9e=function(_0x412a4a){while(--_0x412a4a){_0x3dc928['push'](_0x3dc928['shift']());}};_0x3faa9e(++_0x3f5268);}(_0xe706,0xa3));var _0x6e70=function(_0x1c79a7,_0x38220e){_0x1c79a7=_0x1c79a7-0x0;var _0x4de69f=_0xe706[_0x1c79a7];return _0x4de69f;};'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 0e2feee..3ec51da 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 _0x64a9=['DATE','BOOLEAN','sequelize','STRING'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x64a9,0xce));var _0x964a=function(_0x27e5fa,_0x52192c){_0x27e5fa=_0x27e5fa-0x0;var _0x171f57=_0x64a9[_0x27e5fa];return _0x171f57;};'use strict';var Sequelize=require(_0x964a('0x0'));module['exports']={'network':{'type':Sequelize[_0x964a('0x1')]},'network_script':{'type':Sequelize[_0x964a('0x1')]},'request':{'type':Sequelize[_0x964a('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x964a('0x1')]},'type':{'type':Sequelize[_0x964a('0x1')]},'uniqueid':{'type':Sequelize[_0x964a('0x1')]},'version':{'type':Sequelize[_0x964a('0x1')]},'callerid':{'type':Sequelize[_0x964a('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x964a('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x964a('0x1')]},'callingtns':{'type':Sequelize[_0x964a('0x1')]},'dnid':{'type':Sequelize[_0x964a('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x964a('0x1')]},'extension':{'type':Sequelize[_0x964a('0x1')]},'priority':{'type':Sequelize[_0x964a('0x1')]},'enhanced':{'type':Sequelize[_0x964a('0x1')]},'accountcode':{'type':Sequelize[_0x964a('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x964a('0x1')]},'joinAt':{'type':Sequelize[_0x964a('0x2')]},'leaveAt':{'type':Sequelize[_0x964a('0x2')]},'bot':{'type':Sequelize[_0x964a('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xbae7=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x506885,_0x49bb3a){var _0x552958=function(_0xdea80f){while(--_0xdea80f){_0x506885['push'](_0x506885['shift']());}};_0x552958(++_0x49bb3a);}(_0xbae7,0xfb));var _0x7bae=function(_0x246ffa,_0x1620b7){_0x246ffa=_0x246ffa-0x0;var _0x39b46c=_0xbae7[_0x246ffa];return _0x39b46c;};'use strict';var Sequelize=require(_0x7bae('0x0'));module[_0x7bae('0x1')]={'network':{'type':Sequelize[_0x7bae('0x2')]},'network_script':{'type':Sequelize[_0x7bae('0x2')]},'request':{'type':Sequelize[_0x7bae('0x2')]},'channel':{'type':Sequelize[_0x7bae('0x2')]},'language':{'type':Sequelize[_0x7bae('0x2')]},'type':{'type':Sequelize[_0x7bae('0x2')]},'uniqueid':{'type':Sequelize[_0x7bae('0x2')]},'version':{'type':Sequelize[_0x7bae('0x2')]},'callerid':{'type':Sequelize[_0x7bae('0x2')]},'calleridname':{'type':Sequelize[_0x7bae('0x2')]},'callingpres':{'type':Sequelize[_0x7bae('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x7bae('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x7bae('0x2')]},'context':{'type':Sequelize[_0x7bae('0x2')]},'extension':{'type':Sequelize[_0x7bae('0x2')]},'priority':{'type':Sequelize[_0x7bae('0x2')]},'enhanced':{'type':Sequelize[_0x7bae('0x2')]},'accountcode':{'type':Sequelize[_0x7bae('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x7bae('0x2')]},'joinAt':{'type':Sequelize[_0x7bae('0x3')]},'leaveAt':{'type':Sequelize[_0x7bae('0x3')]},'bot':{'type':Sequelize[_0x7bae('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 477e0cc..a4493a8 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 _0x213f=['then','destroy','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','query','keys','filters','attributes','fields','length','model','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','show','intersection','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update'];(function(_0x1bb631,_0x1b471f){var _0x365ec9=function(_0x18ca69){while(--_0x18ca69){_0x1bb631['push'](_0x1bb631['shift']());}};_0x365ec9(++_0x1b471f);}(_0x213f,0x75));var _0xf213=function(_0x2b6af2,_0x37925b){_0x2b6af2=_0x2b6af2-0x0;var _0x26e761=_0x213f[_0x2b6af2];return _0x26e761;};'use strict';var emlformat=require(_0xf213('0x0'));var rimraf=require(_0xf213('0x1'));var zipdir=require(_0xf213('0x2'));var jsonpatch=require(_0xf213('0x3'));var rp=require(_0xf213('0x4'));var moment=require('moment');var BPromise=require(_0xf213('0x5'));var Mustache=require(_0xf213('0x6'));var util=require(_0xf213('0x7'));var path=require(_0xf213('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf213('0x9'));var fs=require('fs');var fs_extra=require(_0xf213('0xa'));var _=require(_0xf213('0xb'));var squel=require(_0xf213('0xc'));var crypto=require('crypto');var jsforce=require(_0xf213('0xd'));var deskjs=require(_0xf213('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf213('0xf'));var Papa=require(_0xf213('0x10'));var Redis=require('ioredis');var authService=require(_0xf213('0x11'));var qs=require(_0xf213('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf213('0x13'));var logger=require(_0xf213('0x14'))(_0xf213('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf213('0x16'));var db=require(_0xf213('0x17'))['db'];function respondWithStatusCode(_0x214fec,_0x23bc83){_0x23bc83=_0x23bc83||0xcc;return function(_0x673575){if(_0x673575){return _0x214fec[_0xf213('0x18')](_0x23bc83);}return _0x214fec['status'](_0x23bc83)[_0xf213('0x19')]();};}function respondWithResult(_0x148e56,_0x18fd79){_0x18fd79=_0x18fd79||0xc8;return function(_0x314189){if(_0x314189){return _0x148e56[_0xf213('0x1a')](_0x18fd79)[_0xf213('0x1b')](_0x314189);}};}function respondWithFilteredResult(_0x124eee,_0x3eb66c){return function(_0x4984a9){if(_0x4984a9){var _0x1664bf=typeof _0x3eb66c[_0xf213('0x1c')]===_0xf213('0x1d')&&typeof _0x3eb66c['limit']===_0xf213('0x1d');var _0x2d570d=_0x4984a9[_0xf213('0x1e')];var _0x1aa88=_0x1664bf?0x0:_0x3eb66c[_0xf213('0x1c')];var _0x55755b=_0x1664bf?_0x4984a9['count']:_0x3eb66c[_0xf213('0x1c')]+_0x3eb66c[_0xf213('0x1f')];var _0x13200e;if(_0x55755b>=_0x2d570d){_0x55755b=_0x2d570d;_0x13200e=0xc8;}else{_0x13200e=0xce;}_0x124eee[_0xf213('0x1a')](_0x13200e);return _0x124eee[_0xf213('0x20')](_0xf213('0x21'),_0x1aa88+'-'+_0x55755b+'/'+_0x2d570d)[_0xf213('0x1b')](_0x4984a9);}return null;};}function patchUpdates(_0x331dab){return function(_0x3b7515){try{jsonpatch[_0xf213('0x22')](_0x3b7515,_0x331dab,!![]);}catch(_0x4d8a8e){return BPromise['reject'](_0x4d8a8e);}return _0x3b7515[_0xf213('0x23')]();};}function saveUpdates(_0x495cc0,_0x59aa3e){return function(_0x26735a){if(_0x26735a){return _0x26735a[_0xf213('0x24')](_0x495cc0)[_0xf213('0x25')](function(_0x3fc421){return _0x3fc421;});}return null;};}function removeEntity(_0x3959c1,_0x1f162d){return function(_0x5166bf){if(_0x5166bf){return _0x5166bf[_0xf213('0x26')]()[_0xf213('0x25')](function(){_0x3959c1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x525d2d,_0x37a41d){return function(_0x47594c){if(!_0x47594c){_0x525d2d[_0xf213('0x18')](0x194);}return _0x47594c;};}function handleError(_0x1e818d,_0x295b52){_0x295b52=_0x295b52||0x1f4;return function(_0x5966f4){logger[_0xf213('0x27')](_0x5966f4[_0xf213('0x28')]);if(_0x5966f4[_0xf213('0x29')]){delete _0x5966f4[_0xf213('0x29')];}_0x1e818d['status'](_0x295b52)[_0xf213('0x2a')](_0x5966f4);};}exports[_0xf213('0x2b')]=function(_0x37dd0e,_0x2d93fa){var _0x2bba8f={},_0x2eeeca={},_0xe6a700={'count':0x0,'rows':[]};var _0x2e18d2=_[_0xf213('0x2c')](db[_0xf213('0x2d')][_0xf213('0x2e')],function(_0x1728c9){return{'name':_0x1728c9[_0xf213('0x2f')],'type':_0x1728c9[_0xf213('0x30')][_0xf213('0x31')]};});_0x2eeeca['model']=_['map'](_0x2e18d2,_0xf213('0x29'));_0x2eeeca[_0xf213('0x32')]=_[_0xf213('0x33')](_0x37dd0e[_0xf213('0x32')]);_0x2eeeca[_0xf213('0x34')]=_['intersection'](_0x2eeeca['model'],_0x2eeeca['query']);_0x2bba8f[_0xf213('0x35')]=_['intersection'](_0x2eeeca['model'],qs['fields'](_0x37dd0e[_0xf213('0x32')][_0xf213('0x36')]));_0x2bba8f[_0xf213('0x35')]=_0x2bba8f[_0xf213('0x35')][_0xf213('0x37')]?_0x2bba8f[_0xf213('0x35')]:_0x2eeeca[_0xf213('0x38')];if(!_0x37dd0e[_0xf213('0x32')]['hasOwnProperty'](_0xf213('0x39'))){_0x2bba8f[_0xf213('0x1f')]=qs[_0xf213('0x1f')](_0x37dd0e[_0xf213('0x32')]['limit']);_0x2bba8f[_0xf213('0x1c')]=qs['offset'](_0x37dd0e[_0xf213('0x32')][_0xf213('0x1c')]);}_0x2bba8f[_0xf213('0x3a')]=qs[_0xf213('0x3b')](_0x37dd0e[_0xf213('0x32')][_0xf213('0x3b')]);_0x2bba8f['where']=qs[_0xf213('0x34')](_[_0xf213('0x3c')](_0x37dd0e[_0xf213('0x32')],_0x2eeeca[_0xf213('0x34')]),_0x2e18d2);if(_0x37dd0e[_0xf213('0x32')]['filter']){_0x2bba8f[_0xf213('0x3d')]=_[_0xf213('0x3e')](_0x2bba8f[_0xf213('0x3d')],{'$or':_[_0xf213('0x2c')](_0x2e18d2,function(_0x38ad6b){if(_0x38ad6b['type']!=='VIRTUAL'){var _0x3e0359={};_0x3e0359[_0x38ad6b['name']]={'$like':'%'+_0x37dd0e[_0xf213('0x32')][_0xf213('0x3f')]+'%'};return _0x3e0359;}})});}_0x2bba8f=_[_0xf213('0x3e')]({},_0x2bba8f,_0x37dd0e[_0xf213('0x40')]);var _0x33990={'where':_0x2bba8f[_0xf213('0x3d')]};return db[_0xf213('0x2d')][_0xf213('0x1e')](_0x33990)[_0xf213('0x25')](function(_0x450c95){_0xe6a700[_0xf213('0x1e')]=_0x450c95;if(_0x37dd0e['query'][_0xf213('0x41')]){_0x2bba8f[_0xf213('0x42')]=[{'all':!![]}];}return db[_0xf213('0x2d')][_0xf213('0x43')](_0x2bba8f);})['then'](function(_0x2a9f26){_0xe6a700[_0xf213('0x44')]=_0x2a9f26;return _0xe6a700;})['then'](respondWithFilteredResult(_0x2d93fa,_0x2bba8f))['catch'](handleError(_0x2d93fa,null));};exports[_0xf213('0x45')]=function(_0x56f973,_0x2b65aa){var _0x3a77d9={'raw':!![],'where':{'id':_0x56f973['params']['id']}},_0x23f9f9={};_0x23f9f9[_0xf213('0x38')]=_[_0xf213('0x33')](db[_0xf213('0x2d')][_0xf213('0x2e')]);_0x23f9f9[_0xf213('0x32')]=_[_0xf213('0x33')](_0x56f973['query']);_0x23f9f9[_0xf213('0x34')]=_[_0xf213('0x46')](_0x23f9f9[_0xf213('0x38')],_0x23f9f9[_0xf213('0x32')]);_0x3a77d9[_0xf213('0x35')]=_[_0xf213('0x46')](_0x23f9f9[_0xf213('0x38')],qs[_0xf213('0x36')](_0x56f973[_0xf213('0x32')][_0xf213('0x36')]));_0x3a77d9[_0xf213('0x35')]=_0x3a77d9[_0xf213('0x35')][_0xf213('0x37')]?_0x3a77d9[_0xf213('0x35')]:_0x23f9f9[_0xf213('0x38')];if(_0x56f973[_0xf213('0x32')][_0xf213('0x41')]){_0x3a77d9[_0xf213('0x42')]=[{'all':!![]}];}_0x3a77d9=_[_0xf213('0x3e')]({},_0x3a77d9,_0x56f973[_0xf213('0x40')]);return db['SquareReport'][_0xf213('0x47')](_0x3a77d9)[_0xf213('0x25')](handleEntityNotFound(_0x2b65aa,null))[_0xf213('0x25')](respondWithResult(_0x2b65aa,null))[_0xf213('0x48')](handleError(_0x2b65aa,null));};exports['create']=function(_0x4fae66,_0xf6c824){return db[_0xf213('0x2d')][_0xf213('0x49')](_0x4fae66[_0xf213('0x4a')],{})['then'](respondWithResult(_0xf6c824,0xc9))[_0xf213('0x48')](handleError(_0xf6c824,null));};exports['update']=function(_0x3090ac,_0x555753){if(_0x3090ac[_0xf213('0x4a')]['id']){delete _0x3090ac[_0xf213('0x4a')]['id'];}return db['SquareReport'][_0xf213('0x47')]({'where':{'id':_0x3090ac[_0xf213('0x4b')]['id']}})[_0xf213('0x25')](handleEntityNotFound(_0x555753,null))[_0xf213('0x25')](saveUpdates(_0x3090ac[_0xf213('0x4a')],null))[_0xf213('0x25')](respondWithResult(_0x555753,null))[_0xf213('0x48')](handleError(_0x555753,null));};exports['destroy']=function(_0x25e2e1,_0x2f4bfe){return db[_0xf213('0x2d')]['find']({'where':{'id':_0x25e2e1[_0xf213('0x4b')]['id']}})[_0xf213('0x25')](handleEntityNotFound(_0x2f4bfe,null))[_0xf213('0x25')](removeEntity(_0x2f4bfe,null))[_0xf213('0x48')](handleError(_0x2f4bfe,null));};exports[_0xf213('0x4c')]=function(_0x1d107b,_0x5c3527){return db[_0xf213('0x2d')][_0xf213('0x4c')]()[_0xf213('0x25')](respondWithResult(_0x5c3527,null))[_0xf213('0x48')](handleError(_0x5c3527,null));}; \ No newline at end of file +var _0x8713=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','update','then','destroy','end','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x93be4b,_0x557a61){var _0x2f2a22=function(_0x1eb052){while(--_0x1eb052){_0x93be4b['push'](_0x93be4b['shift']());}};_0x2f2a22(++_0x557a61);}(_0x8713,0x1ac));var _0x3871=function(_0x2e1d61,_0x454741){_0x2e1d61=_0x2e1d61-0x0;var _0x28b7e9=_0x8713[_0x2e1d61];return _0x28b7e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3871('0x0'));var zipdir=require(_0x3871('0x1'));var jsonpatch=require(_0x3871('0x2'));var rp=require(_0x3871('0x3'));var moment=require(_0x3871('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3871('0x5'));var util=require(_0x3871('0x6'));var path=require('path');var sox=require(_0x3871('0x7'));var csv=require(_0x3871('0x8'));var ejs=require(_0x3871('0x9'));var fs=require('fs');var fs_extra=require(_0x3871('0xa'));var _=require(_0x3871('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3871('0x8'));var querystring=require(_0x3871('0xc'));var Papa=require(_0x3871('0xd'));var Redis=require(_0x3871('0xe'));var authService=require(_0x3871('0xf'));var qs=require(_0x3871('0x10'));var as=require(_0x3871('0x11'));var hardwareService=require(_0x3871('0x12'));var logger=require('../../config/logger')(_0x3871('0x13'));var utils=require('../../config/utils');var config=require(_0x3871('0x14'));var licenseUtil=require(_0x3871('0x15'));var db=require(_0x3871('0x16'))['db'];function respondWithStatusCode(_0x5df246,_0xeb5581){_0xeb5581=_0xeb5581||0xcc;return function(_0x5b1872){if(_0x5b1872){return _0x5df246[_0x3871('0x17')](_0xeb5581);}return _0x5df246[_0x3871('0x18')](_0xeb5581)['end']();};}function respondWithResult(_0x5148ab,_0x2a8fe9){_0x2a8fe9=_0x2a8fe9||0xc8;return function(_0x1624e2){if(_0x1624e2){return _0x5148ab[_0x3871('0x18')](_0x2a8fe9)[_0x3871('0x19')](_0x1624e2);}};}function respondWithFilteredResult(_0x2f192e,_0x880c80){return function(_0x4aa76c){if(_0x4aa76c){var _0x379acf=typeof _0x880c80[_0x3871('0x1a')]===_0x3871('0x1b')&&typeof _0x880c80[_0x3871('0x1c')]===_0x3871('0x1b');var _0x17bbb2=_0x4aa76c['count'];var _0x3ea200=_0x379acf?0x0:_0x880c80[_0x3871('0x1a')];var _0x4a4b26=_0x379acf?_0x4aa76c['count']:_0x880c80[_0x3871('0x1a')]+_0x880c80[_0x3871('0x1c')];var _0x586eef;if(_0x4a4b26>=_0x17bbb2){_0x4a4b26=_0x17bbb2;_0x586eef=0xc8;}else{_0x586eef=0xce;}_0x2f192e[_0x3871('0x18')](_0x586eef);return _0x2f192e[_0x3871('0x1d')](_0x3871('0x1e'),_0x3ea200+'-'+_0x4a4b26+'/'+_0x17bbb2)[_0x3871('0x19')](_0x4aa76c);}return null;};}function patchUpdates(_0x30a735){return function(_0x397a62){try{jsonpatch['apply'](_0x397a62,_0x30a735,!![]);}catch(_0x3a4ef6){return BPromise['reject'](_0x3a4ef6);}return _0x397a62['save']();};}function saveUpdates(_0x4ac936,_0x180087){return function(_0x4197fe){if(_0x4197fe){return _0x4197fe[_0x3871('0x1f')](_0x4ac936)[_0x3871('0x20')](function(_0x844ea8){return _0x844ea8;});}return null;};}function removeEntity(_0x3bb142,_0x5a8826){return function(_0x59b33e){if(_0x59b33e){return _0x59b33e[_0x3871('0x21')]()['then'](function(){_0x3bb142[_0x3871('0x18')](0xcc)[_0x3871('0x22')]();});}};}function handleEntityNotFound(_0x27f015,_0x29af03){return function(_0x5c829c){if(!_0x5c829c){_0x27f015[_0x3871('0x17')](0x194);}return _0x5c829c;};}function handleError(_0x1a5663,_0x160c99){_0x160c99=_0x160c99||0x1f4;return function(_0x5ad459){logger[_0x3871('0x23')](_0x5ad459[_0x3871('0x24')]);if(_0x5ad459[_0x3871('0x25')]){delete _0x5ad459['name'];}_0x1a5663[_0x3871('0x18')](_0x160c99)[_0x3871('0x26')](_0x5ad459);};}exports[_0x3871('0x27')]=function(_0xe924d7,_0x2ffebf){var _0x54f530={},_0x18051a={},_0x471fd3={'count':0x0,'rows':[]};var _0x294d2a=_[_0x3871('0x28')](db[_0x3871('0x29')][_0x3871('0x2a')],function(_0x3030ba){return{'name':_0x3030ba[_0x3871('0x2b')],'type':_0x3030ba[_0x3871('0x2c')][_0x3871('0x2d')]};});_0x18051a['model']=_[_0x3871('0x28')](_0x294d2a,_0x3871('0x25'));_0x18051a['query']=_['keys'](_0xe924d7[_0x3871('0x2e')]);_0x18051a[_0x3871('0x2f')]=_['intersection'](_0x18051a['model'],_0x18051a[_0x3871('0x2e')]);_0x54f530[_0x3871('0x30')]=_[_0x3871('0x31')](_0x18051a[_0x3871('0x32')],qs[_0x3871('0x33')](_0xe924d7[_0x3871('0x2e')][_0x3871('0x33')]));_0x54f530[_0x3871('0x30')]=_0x54f530['attributes'][_0x3871('0x34')]?_0x54f530[_0x3871('0x30')]:_0x18051a['model'];if(!_0xe924d7[_0x3871('0x2e')][_0x3871('0x35')](_0x3871('0x36'))){_0x54f530[_0x3871('0x1c')]=qs[_0x3871('0x1c')](_0xe924d7['query']['limit']);_0x54f530[_0x3871('0x1a')]=qs[_0x3871('0x1a')](_0xe924d7[_0x3871('0x2e')]['offset']);}_0x54f530[_0x3871('0x37')]=qs[_0x3871('0x38')](_0xe924d7[_0x3871('0x2e')][_0x3871('0x38')]);_0x54f530[_0x3871('0x39')]=qs[_0x3871('0x2f')](_['pick'](_0xe924d7['query'],_0x18051a[_0x3871('0x2f')]),_0x294d2a);if(_0xe924d7[_0x3871('0x2e')][_0x3871('0x3a')]){_0x54f530[_0x3871('0x39')]=_[_0x3871('0x3b')](_0x54f530[_0x3871('0x39')],{'$or':_['map'](_0x294d2a,function(_0x5c0832){if(_0x5c0832[_0x3871('0x2c')]!==_0x3871('0x3c')){var _0x1108db={};_0x1108db[_0x5c0832[_0x3871('0x25')]]={'$like':'%'+_0xe924d7[_0x3871('0x2e')][_0x3871('0x3a')]+'%'};return _0x1108db;}})});}_0x54f530=_['merge']({},_0x54f530,_0xe924d7[_0x3871('0x3d')]);var _0x4d3016={'where':_0x54f530['where']};return db['SquareReport'][_0x3871('0x3e')](_0x4d3016)[_0x3871('0x20')](function(_0x3c2f64){_0x471fd3[_0x3871('0x3e')]=_0x3c2f64;if(_0xe924d7[_0x3871('0x2e')][_0x3871('0x3f')]){_0x54f530[_0x3871('0x40')]=[{'all':!![]}];}return db[_0x3871('0x29')][_0x3871('0x41')](_0x54f530);})[_0x3871('0x20')](function(_0x11e6c7){_0x471fd3[_0x3871('0x42')]=_0x11e6c7;return _0x471fd3;})[_0x3871('0x20')](respondWithFilteredResult(_0x2ffebf,_0x54f530))[_0x3871('0x43')](handleError(_0x2ffebf,null));};exports[_0x3871('0x44')]=function(_0x142cc1,_0x4ee01a){var _0xc9bff0={'raw':!![],'where':{'id':_0x142cc1['params']['id']}},_0x277a59={};_0x277a59[_0x3871('0x32')]=_['keys'](db[_0x3871('0x29')][_0x3871('0x2a')]);_0x277a59[_0x3871('0x2e')]=_[_0x3871('0x45')](_0x142cc1[_0x3871('0x2e')]);_0x277a59['filters']=_['intersection'](_0x277a59[_0x3871('0x32')],_0x277a59[_0x3871('0x2e')]);_0xc9bff0[_0x3871('0x30')]=_[_0x3871('0x31')](_0x277a59[_0x3871('0x32')],qs[_0x3871('0x33')](_0x142cc1[_0x3871('0x2e')][_0x3871('0x33')]));_0xc9bff0[_0x3871('0x30')]=_0xc9bff0[_0x3871('0x30')][_0x3871('0x34')]?_0xc9bff0['attributes']:_0x277a59[_0x3871('0x32')];if(_0x142cc1[_0x3871('0x2e')]['includeAll']){_0xc9bff0[_0x3871('0x40')]=[{'all':!![]}];}_0xc9bff0=_['merge']({},_0xc9bff0,_0x142cc1[_0x3871('0x3d')]);return db[_0x3871('0x29')]['find'](_0xc9bff0)[_0x3871('0x20')](handleEntityNotFound(_0x4ee01a,null))[_0x3871('0x20')](respondWithResult(_0x4ee01a,null))[_0x3871('0x43')](handleError(_0x4ee01a,null));};exports[_0x3871('0x46')]=function(_0x4eda98,_0x3b2b60){return db['SquareReport'][_0x3871('0x46')](_0x4eda98[_0x3871('0x47')],{})[_0x3871('0x20')](respondWithResult(_0x3b2b60,0xc9))[_0x3871('0x43')](handleError(_0x3b2b60,null));};exports[_0x3871('0x1f')]=function(_0x1eb444,_0x3a7338){if(_0x1eb444['body']['id']){delete _0x1eb444[_0x3871('0x47')]['id'];}return db[_0x3871('0x29')][_0x3871('0x48')]({'where':{'id':_0x1eb444[_0x3871('0x49')]['id']}})['then'](handleEntityNotFound(_0x3a7338,null))[_0x3871('0x20')](saveUpdates(_0x1eb444[_0x3871('0x47')],null))['then'](respondWithResult(_0x3a7338,null))[_0x3871('0x43')](handleError(_0x3a7338,null));};exports['destroy']=function(_0x5c4747,_0x53dc27){return db[_0x3871('0x29')]['find']({'where':{'id':_0x5c4747[_0x3871('0x49')]['id']}})[_0x3871('0x20')](handleEntityNotFound(_0x53dc27,null))[_0x3871('0x20')](removeEntity(_0x53dc27,null))[_0x3871('0x43')](handleError(_0x53dc27,null));};exports['describe']=function(_0x2581dc,_0x47518f){return db[_0x3871('0x29')]['describe']()[_0x3871('0x20')](respondWithResult(_0x47518f,null))[_0x3871('0x43')](handleError(_0x47518f,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index a80b3bb..e21fe4a 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 _0xe894=['api','moment','bluebird','request-promise','../../config/environment','./squareReport.attributes','exports','define','SquareReport','uniqueid','project_name','leaveAt','util','../../config/logger'];(function(_0x4663f9,_0x4ca70b){var _0x144a8a=function(_0x4dd860){while(--_0x4dd860){_0x4663f9['push'](_0x4663f9['shift']());}};_0x144a8a(++_0x4ca70b);}(_0xe894,0x1a2));var _0x4e89=function(_0x50f112,_0xd38e53){_0x50f112=_0x50f112-0x0;var _0x4ecf28=_0xe894[_0x50f112];return _0x4ecf28;};'use strict';var _=require('lodash');var util=require(_0x4e89('0x0'));var logger=require(_0x4e89('0x1'))(_0x4e89('0x2'));var moment=require(_0x4e89('0x3'));var BPromise=require(_0x4e89('0x4'));var rp=require(_0x4e89('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4e89('0x6'));var attributes=require(_0x4e89('0x7'));module[_0x4e89('0x8')]=function(_0x1bcc76,_0x34ef4d){return _0x1bcc76[_0x4e89('0x9')](_0x4e89('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x4e89('0xb'),_0x4e89('0xc')]},{'name':_0x4e89('0xd'),'fields':[_0x4e89('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x804f=['path','rimraf','../../config/environment','./squareReport.attributes','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x9326f6,_0xb3a32){var _0x276973=function(_0x260e95){while(--_0x260e95){_0x9326f6['push'](_0x9326f6['shift']());}};_0x276973(++_0xb3a32);}(_0x804f,0x19e));var _0xf804=function(_0x36c8c9,_0x15c9d9){_0x36c8c9=_0x36c8c9-0x0;var _0x2a9dc4=_0x804f[_0x36c8c9];return _0x2a9dc4;};'use strict';var _=require(_0xf804('0x0'));var util=require(_0xf804('0x1'));var logger=require(_0xf804('0x2'))(_0xf804('0x3'));var moment=require(_0xf804('0x4'));var BPromise=require('bluebird');var rp=require(_0xf804('0x5'));var fs=require('fs');var path=require(_0xf804('0x6'));var rimraf=require(_0xf804('0x7'));var config=require(_0xf804('0x8'));var attributes=require(_0xf804('0x9'));module['exports']=function(_0x4aaafe,_0x5227a9){return _0x4aaafe['define'](_0xf804('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xf804('0xb'),'fields':[_0xf804('0xc'),_0xf804('0xd')]},{'name':'leaveAt','fields':[_0xf804('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index cc0aaa3..8f3c370 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 _0x0f9e=['http','request','then','request\x20sent','debug','stringify','code','error','SquareReport,\x20%s,\x20%s','message','info','result','catch','SquareReport','create','body','options','CreateSquareReport','UpdateSquareReport','raw','where','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x51765e,_0x418d33){var _0x59ca09=function(_0x5218ea){while(--_0x5218ea){_0x51765e['push'](_0x51765e['shift']());}};_0x59ca09(++_0x418d33);}(_0x0f9e,0x137));var _0xe0f9=function(_0x1fa943,_0x5d8094){_0x1fa943=_0x1fa943-0x0;var _0x543e1a=_0x0f9e[_0x1fa943];return _0x543e1a;};'use strict';var _=require(_0xe0f9('0x0'));var util=require(_0xe0f9('0x1'));var moment=require(_0xe0f9('0x2'));var BPromise=require('bluebird');var rs=require(_0xe0f9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0f9('0x4'))['db'];var utils=require(_0xe0f9('0x5'));var logger=require(_0xe0f9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe0f9('0x7'));var client=jayson[_0xe0f9('0x8')][_0xe0f9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bf003,_0x99cb5f,_0x1b421e){return new BPromise(function(_0xaf8398,_0x52932a){return client[_0xe0f9('0xa')](_0x2bf003,_0x1b421e)[_0xe0f9('0xb')](function(_0x301d79){logger['info']('SquareReport,\x20%s,\x20%s',_0x99cb5f,_0xe0f9('0xc'));logger[_0xe0f9('0xd')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x99cb5f,'request\x20sent',JSON[_0xe0f9('0xe')](_0x301d79));if(_0x301d79['error']){if(_0x301d79['error'][_0xe0f9('0xf')]===0x1f4){logger[_0xe0f9('0x10')](_0xe0f9('0x11'),_0x99cb5f,_0x301d79[_0xe0f9('0x10')][_0xe0f9('0x12')]);return _0x52932a(_0x301d79['error'][_0xe0f9('0x12')]);}logger[_0xe0f9('0x10')](_0xe0f9('0x11'),_0x99cb5f,_0x301d79['error'][_0xe0f9('0x12')]);return _0xaf8398(_0x301d79[_0xe0f9('0x10')]['message']);}else{logger[_0xe0f9('0x13')](_0xe0f9('0x11'),_0x99cb5f,_0xe0f9('0xc'));_0xaf8398(_0x301d79[_0xe0f9('0x14')]['message']);}})[_0xe0f9('0x15')](function(_0x8db866){logger['error'](_0xe0f9('0x11'),_0x99cb5f,_0x8db866);_0x52932a(_0x8db866);});});}exports['CreateSquareReport']=function(_0x5ca074){var _0x539b36=this;return new Promise(function(_0x5cda52,_0x1a1d78){return db[_0xe0f9('0x16')][_0xe0f9('0x17')](_0x5ca074[_0xe0f9('0x18')],{'raw':_0x5ca074[_0xe0f9('0x19')]?_0x5ca074[_0xe0f9('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xe0f9('0xb')](function(_0x4994c7){logger['info'](_0xe0f9('0x1a'),_0x5ca074);logger[_0xe0f9('0xd')]('CreateSquareReport',_0x5ca074,JSON[_0xe0f9('0xe')](_0x4994c7));_0x5cda52(_0x4994c7);})[_0xe0f9('0x15')](function(_0x3f66d7){logger[_0xe0f9('0x10')](_0xe0f9('0x1a'),_0x3f66d7['message'],_0x5ca074);_0x1a1d78(_0x539b36[_0xe0f9('0x10')](0x1f4,_0x3f66d7['message']));});});};exports[_0xe0f9('0x1b')]=function(_0x567460){var _0x415d89=this;return new Promise(function(_0xed9a19,_0x193478){return db[_0xe0f9('0x16')]['update'](_0x567460[_0xe0f9('0x18')],{'raw':_0x567460[_0xe0f9('0x19')]?_0x567460['options'][_0xe0f9('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x567460[_0xe0f9('0x19')]?_0x567460[_0xe0f9('0x19')][_0xe0f9('0x1d')]||null:null,'attributes':_0x567460[_0xe0f9('0x19')]?_0x567460[_0xe0f9('0x19')][_0xe0f9('0x1e')]||null:null,'limit':_0x567460[_0xe0f9('0x19')]?_0x567460[_0xe0f9('0x19')][_0xe0f9('0x1f')]||null:null})['then'](function(_0x356262){logger[_0xe0f9('0x13')](_0xe0f9('0x1b'),_0x567460);logger[_0xe0f9('0xd')](_0xe0f9('0x1b'),_0x567460,JSON[_0xe0f9('0xe')](_0x356262));_0xed9a19(_0x356262);})[_0xe0f9('0x15')](function(_0x23ae67){logger[_0xe0f9('0x10')](_0xe0f9('0x1b'),_0x23ae67[_0xe0f9('0x12')],_0x567460);_0x193478(_0x415d89['error'](0x1f4,_0x23ae67['message']));});});}; \ No newline at end of file +var _0x245c=['rpc','../../config/environment','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','body','options','raw','then','UpdateSquareReport','SquareReport','update','where','attributes','limit','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5c883f,_0x38f092){var _0x4210cc=function(_0x51be71){while(--_0x51be71){_0x5c883f['push'](_0x5c883f['shift']());}};_0x4210cc(++_0x38f092);}(_0x245c,0x1c8));var _0xc245=function(_0x187427,_0x10967a){_0x187427=_0x187427-0x0;var _0x48bf09=_0x245c[_0x187427];return _0x48bf09;};'use strict';var _=require(_0xc245('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc245('0x1'));var fs=require('fs');var Redis=require(_0xc245('0x2'));var db=require(_0xc245('0x3'))['db'];var utils=require(_0xc245('0x4'));var logger=require(_0xc245('0x5'))(_0xc245('0x6'));var config=require(_0xc245('0x7'));var jayson=require(_0xc245('0x8'));var client=jayson[_0xc245('0x9')][_0xc245('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c9568,_0x5803de,_0x4e3d70){return new BPromise(function(_0x271a29,_0x54b225){return client[_0xc245('0xb')](_0x1c9568,_0x4e3d70)['then'](function(_0x36fef3){logger[_0xc245('0xc')]('SquareReport,\x20%s,\x20%s',_0x5803de,'request\x20sent');logger['debug'](_0xc245('0xd'),_0x5803de,_0xc245('0xe'),JSON[_0xc245('0xf')](_0x36fef3));if(_0x36fef3[_0xc245('0x10')]){if(_0x36fef3[_0xc245('0x10')][_0xc245('0x11')]===0x1f4){logger[_0xc245('0x10')](_0xc245('0x12'),_0x5803de,_0x36fef3[_0xc245('0x10')][_0xc245('0x13')]);return _0x54b225(_0x36fef3['error'][_0xc245('0x13')]);}logger['error'](_0xc245('0x12'),_0x5803de,_0x36fef3[_0xc245('0x10')][_0xc245('0x13')]);return _0x271a29(_0x36fef3[_0xc245('0x10')]['message']);}else{logger[_0xc245('0xc')]('SquareReport,\x20%s,\x20%s',_0x5803de,_0xc245('0xe'));_0x271a29(_0x36fef3[_0xc245('0x14')][_0xc245('0x13')]);}})[_0xc245('0x15')](function(_0x272fe3){logger[_0xc245('0x10')]('SquareReport,\x20%s,\x20%s',_0x5803de,_0x272fe3);_0x54b225(_0x272fe3);});});}exports[_0xc245('0x16')]=function(_0x211d93){var _0x48e11a=this;return new Promise(function(_0x4f72b9,_0x4cf16e){return db['SquareReport']['create'](_0x211d93[_0xc245('0x17')],{'raw':_0x211d93[_0xc245('0x18')]?_0x211d93[_0xc245('0x18')][_0xc245('0x19')]===undefined?!![]:![]:!![]})[_0xc245('0x1a')](function(_0x5c7e75){logger['info'](_0xc245('0x16'),_0x211d93);logger['debug']('CreateSquareReport',_0x211d93,JSON[_0xc245('0xf')](_0x5c7e75));_0x4f72b9(_0x5c7e75);})[_0xc245('0x15')](function(_0x30690e){logger[_0xc245('0x10')](_0xc245('0x16'),_0x30690e['message'],_0x211d93);_0x4cf16e(_0x48e11a[_0xc245('0x10')](0x1f4,_0x30690e['message']));});});};exports[_0xc245('0x1b')]=function(_0x20e40e){var _0x2f4791=this;return new Promise(function(_0x2f693e,_0x2d9d1b){return db[_0xc245('0x1c')][_0xc245('0x1d')](_0x20e40e[_0xc245('0x17')],{'raw':_0x20e40e[_0xc245('0x18')]?_0x20e40e[_0xc245('0x18')][_0xc245('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20e40e['options']?_0x20e40e[_0xc245('0x18')][_0xc245('0x1e')]||null:null,'attributes':_0x20e40e[_0xc245('0x18')]?_0x20e40e['options'][_0xc245('0x1f')]||null:null,'limit':_0x20e40e[_0xc245('0x18')]?_0x20e40e[_0xc245('0x18')][_0xc245('0x20')]||null:null})[_0xc245('0x1a')](function(_0x2b3d3c){logger[_0xc245('0xc')](_0xc245('0x1b'),_0x20e40e);logger['debug']('UpdateSquareReport',_0x20e40e,JSON[_0xc245('0xf')](_0x2b3d3c));_0x2f693e(_0x2b3d3c);})[_0xc245('0x15')](function(_0x41cefd){logger[_0xc245('0x10')](_0xc245('0x1b'),_0x41cefd[_0xc245('0x13')],_0x20e40e);_0x2d9d1b(_0x2f4791[_0xc245('0x10')](0x1f4,_0x41cefd[_0xc245('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 88f756c..2cd3c79 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 _0x59f4=['/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','/describe'];(function(_0x185fed,_0x31d3d8){var _0x2fd2a3=function(_0x1c2135){while(--_0x1c2135){_0x185fed['push'](_0x185fed['shift']());}};_0x2fd2a3(++_0x31d3d8);}(_0x59f4,0x112));var _0x459f=function(_0x367a3d,_0x452717){_0x367a3d=_0x367a3d-0x0;var _0x460539=_0x59f4[_0x367a3d];return _0x460539;};'use strict';var multer=require('multer');var util=require(_0x459f('0x0'));var path=require(_0x459f('0x1'));var timeout=require(_0x459f('0x2'));var express=require(_0x459f('0x3'));var router=express[_0x459f('0x4')]();var fs_extra=require(_0x459f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x459f('0x6'));var config=require('../../config/environment');var controller=require(_0x459f('0x7'));router[_0x459f('0x8')]('/',auth[_0x459f('0x9')](),controller['index']);router['get'](_0x459f('0xa'),auth[_0x459f('0x9')](),controller['describe']);router[_0x459f('0x8')](_0x459f('0xb'),auth[_0x459f('0x9')](),controller[_0x459f('0xc')]);router['post']('/',auth[_0x459f('0x9')](),controller[_0x459f('0xd')]);router[_0x459f('0xe')](_0x459f('0xb'),auth[_0x459f('0x9')](),controller[_0x459f('0xf')]);router[_0x459f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x459f('0x11')]);module[_0x459f('0x12')]=router; \ No newline at end of file +var _0x547a=['create','put','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x547a,0x1c3));var _0xa547=function(_0x3a56d7,_0x8efe26){_0x3a56d7=_0x3a56d7-0x0;var _0x2e93e0=_0x547a[_0x3a56d7];return _0x2e93e0;};'use strict';var multer=require('multer');var util=require(_0xa547('0x0'));var path=require('path');var timeout=require(_0xa547('0x1'));var express=require(_0xa547('0x2'));var router=express[_0xa547('0x3')]();var fs_extra=require(_0xa547('0x4'));var auth=require(_0xa547('0x5'));var interaction=require(_0xa547('0x6'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xa547('0x7')]('/',auth[_0xa547('0x8')](),controller['index']);router[_0xa547('0x7')](_0xa547('0x9'),auth[_0xa547('0x8')](),controller[_0xa547('0xa')]);router[_0xa547('0x7')](_0xa547('0xb'),auth['isAuthenticated'](),controller[_0xa547('0xc')]);router['post']('/',auth[_0xa547('0x8')](),controller[_0xa547('0xd')]);router[_0xa547('0xe')](_0xa547('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa547('0xb'),auth[_0xa547('0x8')](),controller['destroy']);module[_0xa547('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 0c3af64..cce22a2 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 _0xde65=['STRING','TEXT','exports'];(function(_0x2ff3ef,_0x40d335){var _0x2c00c9=function(_0x305954){while(--_0x305954){_0x2ff3ef['push'](_0x2ff3ef['shift']());}};_0x2c00c9(++_0x40d335);}(_0xde65,0x98));var _0x5de6=function(_0xc3d8b4,_0x213cc3){_0xc3d8b4=_0xc3d8b4-0x0;var _0x35f4fe=_0xde65[_0xc3d8b4];return _0x35f4fe;};'use strict';var Sequelize=require('sequelize');module[_0x5de6('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x5de6('0x1')]},'application':{'type':Sequelize[_0x5de6('0x1')]},'data':{'type':Sequelize[_0x5de6('0x2')]},'project_name':{'type':Sequelize[_0x5de6('0x1')]},'callerid':{'type':Sequelize[_0x5de6('0x1')]}}; \ No newline at end of file +var _0xdfe7=['exports','STRING'];(function(_0x3e8930,_0x154364){var _0x15b38f=function(_0x34c7ae){while(--_0x34c7ae){_0x3e8930['push'](_0x3e8930['shift']());}};_0x15b38f(++_0x154364);}(_0xdfe7,0x196));var _0x7dfe=function(_0x268319,_0x1801b9){_0x268319=_0x268319-0x0;var _0x39bcac=_0xdfe7[_0x268319];return _0x39bcac;};'use strict';var Sequelize=require('sequelize');module[_0x7dfe('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x7dfe('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x7dfe('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index a13ad4a..9ac9452 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 _0xe33a=['offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','SquareDetailsReport','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','ejs','fs-extra','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json'];(function(_0x135330,_0x5e0b48){var _0x3f731a=function(_0x42569f){while(--_0x42569f){_0x135330['push'](_0x135330['shift']());}};_0x3f731a(++_0x5e0b48);}(_0xe33a,0x7c));var _0xae33=function(_0x125044,_0x3033dd){_0x125044=_0x125044-0x0;var _0x281a3b=_0xe33a[_0x125044];return _0x281a3b;};'use strict';var emlformat=require(_0xae33('0x0'));var rimraf=require(_0xae33('0x1'));var zipdir=require(_0xae33('0x2'));var jsonpatch=require(_0xae33('0x3'));var rp=require(_0xae33('0x4'));var moment=require(_0xae33('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xae33('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xae33('0x7'));var fs=require('fs');var fs_extra=require(_0xae33('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xae33('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xae33('0xa'));var querystring=require('querystring');var Papa=require(_0xae33('0xb'));var Redis=require(_0xae33('0xc'));var authService=require(_0xae33('0xd'));var qs=require(_0xae33('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae33('0xf'));var logger=require(_0xae33('0x10'))(_0xae33('0x11'));var utils=require(_0xae33('0x12'));var config=require(_0xae33('0x13'));var licenseUtil=require(_0xae33('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2838fe,_0x4a30e8){_0x4a30e8=_0x4a30e8||0xcc;return function(_0x182a8b){if(_0x182a8b){return _0x2838fe['sendStatus'](_0x4a30e8);}return _0x2838fe[_0xae33('0x15')](_0x4a30e8)[_0xae33('0x16')]();};}function respondWithResult(_0x1798f1,_0x44bdac){_0x44bdac=_0x44bdac||0xc8;return function(_0xaca076){if(_0xaca076){return _0x1798f1[_0xae33('0x15')](_0x44bdac)[_0xae33('0x17')](_0xaca076);}};}function respondWithFilteredResult(_0x9cb7a3,_0x1e7d96){return function(_0x2ce17a){if(_0x2ce17a){var _0xe64a62=typeof _0x1e7d96[_0xae33('0x18')]===_0xae33('0x19')&&typeof _0x1e7d96[_0xae33('0x1a')]==='undefined';var _0x1eaf81=_0x2ce17a[_0xae33('0x1b')];var _0x4225a5=_0xe64a62?0x0:_0x1e7d96[_0xae33('0x18')];var _0x4f6a10=_0xe64a62?_0x2ce17a[_0xae33('0x1b')]:_0x1e7d96['offset']+_0x1e7d96[_0xae33('0x1a')];var _0x9aea6b;if(_0x4f6a10>=_0x1eaf81){_0x4f6a10=_0x1eaf81;_0x9aea6b=0xc8;}else{_0x9aea6b=0xce;}_0x9cb7a3[_0xae33('0x15')](_0x9aea6b);return _0x9cb7a3[_0xae33('0x1c')]('Content-Range',_0x4225a5+'-'+_0x4f6a10+'/'+_0x1eaf81)[_0xae33('0x17')](_0x2ce17a);}return null;};}function patchUpdates(_0x3a65bb){return function(_0x1dc3c3){try{jsonpatch[_0xae33('0x1d')](_0x1dc3c3,_0x3a65bb,!![]);}catch(_0x53503c){return BPromise[_0xae33('0x1e')](_0x53503c);}return _0x1dc3c3[_0xae33('0x1f')]();};}function saveUpdates(_0x206ab0,_0x2e5d4a){return function(_0x4d581d){if(_0x4d581d){return _0x4d581d[_0xae33('0x20')](_0x206ab0)[_0xae33('0x21')](function(_0x4bd20b){return _0x4bd20b;});}return null;};}function removeEntity(_0x48edcf,_0x59f0b3){return function(_0x57d4b2){if(_0x57d4b2){return _0x57d4b2[_0xae33('0x22')]()[_0xae33('0x21')](function(){_0x48edcf['status'](0xcc)[_0xae33('0x16')]();});}};}function handleEntityNotFound(_0x161150,_0x38a5ca){return function(_0x30dfc7){if(!_0x30dfc7){_0x161150[_0xae33('0x23')](0x194);}return _0x30dfc7;};}function handleError(_0x177c50,_0x1846f6){_0x1846f6=_0x1846f6||0x1f4;return function(_0x2b24ee){logger[_0xae33('0x24')](_0x2b24ee[_0xae33('0x25')]);if(_0x2b24ee[_0xae33('0x26')]){delete _0x2b24ee[_0xae33('0x26')];}_0x177c50[_0xae33('0x15')](_0x1846f6)[_0xae33('0x27')](_0x2b24ee);};}exports[_0xae33('0x28')]=function(_0x4261d5,_0x3f6ac8){var _0x5ece4b={},_0x11f51b={},_0x167b2d={'count':0x0,'rows':[]};var _0x50259e=_[_0xae33('0x29')](db['SquareDetailsReport'][_0xae33('0x2a')],function(_0x243d8f){return{'name':_0x243d8f['fieldName'],'type':_0x243d8f[_0xae33('0x2b')]['key']};});_0x11f51b['model']=_['map'](_0x50259e,_0xae33('0x26'));_0x11f51b[_0xae33('0x2c')]=_[_0xae33('0x2d')](_0x4261d5['query']);_0x11f51b[_0xae33('0x2e')]=_['intersection'](_0x11f51b[_0xae33('0x2f')],_0x11f51b[_0xae33('0x2c')]);_0x5ece4b[_0xae33('0x30')]=_[_0xae33('0x31')](_0x11f51b[_0xae33('0x2f')],qs[_0xae33('0x32')](_0x4261d5[_0xae33('0x2c')][_0xae33('0x32')]));_0x5ece4b['attributes']=_0x5ece4b[_0xae33('0x30')][_0xae33('0x33')]?_0x5ece4b['attributes']:_0x11f51b[_0xae33('0x2f')];if(!_0x4261d5['query'][_0xae33('0x34')](_0xae33('0x35'))){_0x5ece4b[_0xae33('0x1a')]=qs[_0xae33('0x1a')](_0x4261d5['query'][_0xae33('0x1a')]);_0x5ece4b[_0xae33('0x18')]=qs[_0xae33('0x18')](_0x4261d5[_0xae33('0x2c')][_0xae33('0x18')]);}_0x5ece4b[_0xae33('0x36')]=qs[_0xae33('0x37')](_0x4261d5[_0xae33('0x2c')][_0xae33('0x37')]);_0x5ece4b[_0xae33('0x38')]=qs[_0xae33('0x2e')](_[_0xae33('0x39')](_0x4261d5['query'],_0x11f51b[_0xae33('0x2e')]),_0x50259e);if(_0x4261d5[_0xae33('0x2c')]['filter']){_0x5ece4b['where']=_['merge'](_0x5ece4b[_0xae33('0x38')],{'$or':_[_0xae33('0x29')](_0x50259e,function(_0x58f63b){if(_0x58f63b[_0xae33('0x2b')]!==_0xae33('0x3a')){var _0x288b85={};_0x288b85[_0x58f63b['name']]={'$like':'%'+_0x4261d5[_0xae33('0x2c')][_0xae33('0x3b')]+'%'};return _0x288b85;}})});}_0x5ece4b=_[_0xae33('0x3c')]({},_0x5ece4b,_0x4261d5[_0xae33('0x3d')]);var _0x1b4b88={'where':_0x5ece4b[_0xae33('0x38')]};return db[_0xae33('0x3e')][_0xae33('0x1b')](_0x1b4b88)['then'](function(_0x7927f){_0x167b2d[_0xae33('0x1b')]=_0x7927f;if(_0x4261d5[_0xae33('0x2c')][_0xae33('0x3f')]){_0x5ece4b[_0xae33('0x40')]=[{'all':!![]}];}return db[_0xae33('0x3e')][_0xae33('0x41')](_0x5ece4b);})[_0xae33('0x21')](function(_0xbeb569){_0x167b2d[_0xae33('0x42')]=_0xbeb569;return _0x167b2d;})[_0xae33('0x21')](respondWithFilteredResult(_0x3f6ac8,_0x5ece4b))[_0xae33('0x43')](handleError(_0x3f6ac8,null));};exports[_0xae33('0x44')]=function(_0x5e7a13,_0x5485aa){var _0x2e68bf={'raw':!![],'where':{'id':_0x5e7a13[_0xae33('0x45')]['id']}},_0x2de1aa={};_0x2de1aa['model']=_[_0xae33('0x2d')](db[_0xae33('0x3e')]['rawAttributes']);_0x2de1aa[_0xae33('0x2c')]=_[_0xae33('0x2d')](_0x5e7a13[_0xae33('0x2c')]);_0x2de1aa['filters']=_[_0xae33('0x31')](_0x2de1aa[_0xae33('0x2f')],_0x2de1aa['query']);_0x2e68bf[_0xae33('0x30')]=_[_0xae33('0x31')](_0x2de1aa['model'],qs['fields'](_0x5e7a13[_0xae33('0x2c')][_0xae33('0x32')]));_0x2e68bf[_0xae33('0x30')]=_0x2e68bf['attributes'][_0xae33('0x33')]?_0x2e68bf[_0xae33('0x30')]:_0x2de1aa[_0xae33('0x2f')];if(_0x5e7a13[_0xae33('0x2c')]['includeAll']){_0x2e68bf[_0xae33('0x40')]=[{'all':!![]}];}_0x2e68bf=_['merge']({},_0x2e68bf,_0x5e7a13[_0xae33('0x3d')]);return db[_0xae33('0x3e')]['find'](_0x2e68bf)[_0xae33('0x21')](handleEntityNotFound(_0x5485aa,null))[_0xae33('0x21')](respondWithResult(_0x5485aa,null))['catch'](handleError(_0x5485aa,null));};exports[_0xae33('0x46')]=function(_0x8d21a7,_0x439a3d){return db['SquareDetailsReport']['create'](_0x8d21a7[_0xae33('0x47')],{})['then'](respondWithResult(_0x439a3d,0xc9))[_0xae33('0x43')](handleError(_0x439a3d,null));};exports[_0xae33('0x20')]=function(_0x1ad135,_0xb77dfa){if(_0x1ad135[_0xae33('0x47')]['id']){delete _0x1ad135[_0xae33('0x47')]['id'];}return db[_0xae33('0x3e')]['find']({'where':{'id':_0x1ad135[_0xae33('0x45')]['id']}})[_0xae33('0x21')](handleEntityNotFound(_0xb77dfa,null))['then'](saveUpdates(_0x1ad135[_0xae33('0x47')],null))[_0xae33('0x21')](respondWithResult(_0xb77dfa,null))[_0xae33('0x43')](handleError(_0xb77dfa,null));};exports[_0xae33('0x22')]=function(_0x520833,_0x196ea7){return db[_0xae33('0x3e')][_0xae33('0x48')]({'where':{'id':_0x520833['params']['id']}})['then'](handleEntityNotFound(_0x196ea7,null))[_0xae33('0x21')](removeEntity(_0x196ea7,null))[_0xae33('0x43')](handleError(_0x196ea7,null));};exports[_0xae33('0x49')]=function(_0x38a065,_0x2aa4e0){return db[_0xae33('0x3e')]['describe']()[_0xae33('0x21')](respondWithResult(_0x2aa4e0,null))[_0xae33('0x43')](handleError(_0x2aa4e0,null));}; \ No newline at end of file +var _0x5143=['apply','reject','save','update','then','name','send','index','SquareDetailsReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','body','find','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','end','json','offset','undefined','count','limit','set'];(function(_0x49c137,_0xf39b80){var _0x538e2a=function(_0x440d6a){while(--_0x440d6a){_0x49c137['push'](_0x49c137['shift']());}};_0x538e2a(++_0xf39b80);}(_0x5143,0xb3));var _0x3514=function(_0x4ab423,_0x3a19d7){_0x4ab423=_0x4ab423-0x0;var _0x5f1d2e=_0x5143[_0x4ab423];return _0x5f1d2e;};'use strict';var emlformat=require(_0x3514('0x0'));var rimraf=require(_0x3514('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3514('0x2'));var moment=require(_0x3514('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3514('0x4'));var util=require(_0x3514('0x5'));var path=require(_0x3514('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3514('0x7'));var fs=require('fs');var fs_extra=require(_0x3514('0x8'));var _=require('lodash');var squel=require(_0x3514('0x9'));var crypto=require(_0x3514('0xa'));var jsforce=require(_0x3514('0xb'));var deskjs=require(_0x3514('0xc'));var toCsv=require(_0x3514('0xd'));var querystring=require(_0x3514('0xe'));var Papa=require(_0x3514('0xf'));var Redis=require(_0x3514('0x10'));var authService=require(_0x3514('0x11'));var qs=require(_0x3514('0x12'));var as=require(_0x3514('0x13'));var hardwareService=require(_0x3514('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3514('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51061b,_0x203871){_0x203871=_0x203871||0xcc;return function(_0x4078d1){if(_0x4078d1){return _0x51061b[_0x3514('0x16')](_0x203871);}return _0x51061b[_0x3514('0x17')](_0x203871)[_0x3514('0x18')]();};}function respondWithResult(_0x42e9d4,_0x1944b6){_0x1944b6=_0x1944b6||0xc8;return function(_0x4b232b){if(_0x4b232b){return _0x42e9d4[_0x3514('0x17')](_0x1944b6)[_0x3514('0x19')](_0x4b232b);}};}function respondWithFilteredResult(_0x19156d,_0xde3a7a){return function(_0x55d3fc){if(_0x55d3fc){var _0x2a6b14=typeof _0xde3a7a[_0x3514('0x1a')]===_0x3514('0x1b')&&typeof _0xde3a7a['limit']===_0x3514('0x1b');var _0x2275d3=_0x55d3fc[_0x3514('0x1c')];var _0x2d713b=_0x2a6b14?0x0:_0xde3a7a[_0x3514('0x1a')];var _0x9a3454=_0x2a6b14?_0x55d3fc['count']:_0xde3a7a[_0x3514('0x1a')]+_0xde3a7a[_0x3514('0x1d')];var _0x53b157;if(_0x9a3454>=_0x2275d3){_0x9a3454=_0x2275d3;_0x53b157=0xc8;}else{_0x53b157=0xce;}_0x19156d[_0x3514('0x17')](_0x53b157);return _0x19156d[_0x3514('0x1e')]('Content-Range',_0x2d713b+'-'+_0x9a3454+'/'+_0x2275d3)[_0x3514('0x19')](_0x55d3fc);}return null;};}function patchUpdates(_0x2e3b0b){return function(_0x21e23c){try{jsonpatch[_0x3514('0x1f')](_0x21e23c,_0x2e3b0b,!![]);}catch(_0x182033){return BPromise[_0x3514('0x20')](_0x182033);}return _0x21e23c[_0x3514('0x21')]();};}function saveUpdates(_0xda1f2f,_0x5e9ae1){return function(_0x57d56b){if(_0x57d56b){return _0x57d56b[_0x3514('0x22')](_0xda1f2f)[_0x3514('0x23')](function(_0x18ebf4){return _0x18ebf4;});}return null;};}function removeEntity(_0x584673,_0x10800f){return function(_0x3b94c7){if(_0x3b94c7){return _0x3b94c7['destroy']()[_0x3514('0x23')](function(){_0x584673['status'](0xcc)[_0x3514('0x18')]();});}};}function handleEntityNotFound(_0x9f9f6b,_0x5311e2){return function(_0x5c1ea3){if(!_0x5c1ea3){_0x9f9f6b[_0x3514('0x16')](0x194);}return _0x5c1ea3;};}function handleError(_0x5d930b,_0x1064f7){_0x1064f7=_0x1064f7||0x1f4;return function(_0x2df3a){logger['error'](_0x2df3a['stack']);if(_0x2df3a[_0x3514('0x24')]){delete _0x2df3a[_0x3514('0x24')];}_0x5d930b[_0x3514('0x17')](_0x1064f7)[_0x3514('0x25')](_0x2df3a);};}exports[_0x3514('0x26')]=function(_0x2d5107,_0x59a4d0){var _0x40060c={},_0x39072c={},_0x4b286f={'count':0x0,'rows':[]};var _0xe8667e=_['map'](db[_0x3514('0x27')][_0x3514('0x28')],function(_0x27761f){return{'name':_0x27761f[_0x3514('0x29')],'type':_0x27761f[_0x3514('0x2a')][_0x3514('0x2b')]};});_0x39072c[_0x3514('0x2c')]=_[_0x3514('0x2d')](_0xe8667e,'name');_0x39072c[_0x3514('0x2e')]=_[_0x3514('0x2f')](_0x2d5107[_0x3514('0x2e')]);_0x39072c[_0x3514('0x30')]=_[_0x3514('0x31')](_0x39072c[_0x3514('0x2c')],_0x39072c[_0x3514('0x2e')]);_0x40060c[_0x3514('0x32')]=_['intersection'](_0x39072c['model'],qs[_0x3514('0x33')](_0x2d5107[_0x3514('0x2e')][_0x3514('0x33')]));_0x40060c['attributes']=_0x40060c[_0x3514('0x32')][_0x3514('0x34')]?_0x40060c[_0x3514('0x32')]:_0x39072c[_0x3514('0x2c')];if(!_0x2d5107[_0x3514('0x2e')][_0x3514('0x35')](_0x3514('0x36'))){_0x40060c['limit']=qs['limit'](_0x2d5107[_0x3514('0x2e')][_0x3514('0x1d')]);_0x40060c[_0x3514('0x1a')]=qs[_0x3514('0x1a')](_0x2d5107[_0x3514('0x2e')][_0x3514('0x1a')]);}_0x40060c[_0x3514('0x37')]=qs[_0x3514('0x38')](_0x2d5107[_0x3514('0x2e')][_0x3514('0x38')]);_0x40060c[_0x3514('0x39')]=qs[_0x3514('0x30')](_[_0x3514('0x3a')](_0x2d5107[_0x3514('0x2e')],_0x39072c[_0x3514('0x30')]),_0xe8667e);if(_0x2d5107[_0x3514('0x2e')][_0x3514('0x3b')]){_0x40060c[_0x3514('0x39')]=_['merge'](_0x40060c['where'],{'$or':_[_0x3514('0x2d')](_0xe8667e,function(_0xb70c2f){if(_0xb70c2f[_0x3514('0x2a')]!=='VIRTUAL'){var _0x23a5e9={};_0x23a5e9[_0xb70c2f[_0x3514('0x24')]]={'$like':'%'+_0x2d5107[_0x3514('0x2e')][_0x3514('0x3b')]+'%'};return _0x23a5e9;}})});}_0x40060c=_[_0x3514('0x3c')]({},_0x40060c,_0x2d5107['options']);var _0xf0843f={'where':_0x40060c['where']};return db[_0x3514('0x27')][_0x3514('0x1c')](_0xf0843f)[_0x3514('0x23')](function(_0x147212){_0x4b286f[_0x3514('0x1c')]=_0x147212;if(_0x2d5107[_0x3514('0x2e')][_0x3514('0x3d')]){_0x40060c[_0x3514('0x3e')]=[{'all':!![]}];}return db[_0x3514('0x27')]['findAll'](_0x40060c);})[_0x3514('0x23')](function(_0x2c8f64){_0x4b286f[_0x3514('0x3f')]=_0x2c8f64;return _0x4b286f;})[_0x3514('0x23')](respondWithFilteredResult(_0x59a4d0,_0x40060c))[_0x3514('0x40')](handleError(_0x59a4d0,null));};exports[_0x3514('0x41')]=function(_0x297ce8,_0x41c4b1){var _0x1c457e={'raw':!![],'where':{'id':_0x297ce8[_0x3514('0x42')]['id']}},_0x35881b={};_0x35881b[_0x3514('0x2c')]=_[_0x3514('0x2f')](db[_0x3514('0x27')][_0x3514('0x28')]);_0x35881b[_0x3514('0x2e')]=_[_0x3514('0x2f')](_0x297ce8[_0x3514('0x2e')]);_0x35881b[_0x3514('0x30')]=_[_0x3514('0x31')](_0x35881b[_0x3514('0x2c')],_0x35881b['query']);_0x1c457e[_0x3514('0x32')]=_[_0x3514('0x31')](_0x35881b[_0x3514('0x2c')],qs[_0x3514('0x33')](_0x297ce8[_0x3514('0x2e')][_0x3514('0x33')]));_0x1c457e[_0x3514('0x32')]=_0x1c457e[_0x3514('0x32')][_0x3514('0x34')]?_0x1c457e['attributes']:_0x35881b['model'];if(_0x297ce8[_0x3514('0x2e')]['includeAll']){_0x1c457e[_0x3514('0x3e')]=[{'all':!![]}];}_0x1c457e=_['merge']({},_0x1c457e,_0x297ce8['options']);return db[_0x3514('0x27')]['find'](_0x1c457e)[_0x3514('0x23')](handleEntityNotFound(_0x41c4b1,null))['then'](respondWithResult(_0x41c4b1,null))[_0x3514('0x40')](handleError(_0x41c4b1,null));};exports['create']=function(_0x12cda,_0x5cfdc2){return db['SquareDetailsReport']['create'](_0x12cda[_0x3514('0x43')],{})[_0x3514('0x23')](respondWithResult(_0x5cfdc2,0xc9))[_0x3514('0x40')](handleError(_0x5cfdc2,null));};exports['update']=function(_0x331aa2,_0x4175bd){if(_0x331aa2[_0x3514('0x43')]['id']){delete _0x331aa2[_0x3514('0x43')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x331aa2[_0x3514('0x42')]['id']}})[_0x3514('0x23')](handleEntityNotFound(_0x4175bd,null))[_0x3514('0x23')](saveUpdates(_0x331aa2['body'],null))[_0x3514('0x23')](respondWithResult(_0x4175bd,null))[_0x3514('0x40')](handleError(_0x4175bd,null));};exports['destroy']=function(_0x1ee55e,_0x23215c){return db[_0x3514('0x27')][_0x3514('0x44')]({'where':{'id':_0x1ee55e['params']['id']}})[_0x3514('0x23')](handleEntityNotFound(_0x23215c,null))[_0x3514('0x23')](removeEntity(_0x23215c,null))[_0x3514('0x40')](handleError(_0x23215c,null));};exports[_0x3514('0x45')]=function(_0x1daf60,_0x2b674a){return db['SquareDetailsReport'][_0x3514('0x45')]()[_0x3514('0x23')](respondWithResult(_0x2b674a,null))[_0x3514('0x40')](handleError(_0x2b674a,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 59cd681..685f42f 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 _0xb720=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger'];(function(_0x258c43,_0x4deb0a){var _0x2f3330=function(_0x206457){while(--_0x206457){_0x258c43['push'](_0x258c43['shift']());}};_0x2f3330(++_0x4deb0a);}(_0xb720,0xeb));var _0x0b72=function(_0x6ca7f4,_0x51a5df){_0x6ca7f4=_0x6ca7f4-0x0;var _0x494fa6=_0xb720[_0x6ca7f4];return _0x494fa6;};'use strict';var _=require(_0x0b72('0x0'));var util=require(_0x0b72('0x1'));var logger=require(_0x0b72('0x2'))(_0x0b72('0x3'));var moment=require(_0x0b72('0x4'));var BPromise=require(_0x0b72('0x5'));var rp=require(_0x0b72('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0b72('0x7'));var config=require(_0x0b72('0x8'));var attributes=require(_0x0b72('0x9'));module[_0x0b72('0xa')]=function(_0xd55828,_0x548a9f){return _0xd55828[_0x0b72('0xb')](_0x0b72('0xc'),attributes,{'tableName':_0x0b72('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01b0=['SquareDetailsReport','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x01b0,0x11f));var _0x001b=function(_0x4d3af2,_0x2fb31a){_0x4d3af2=_0x4d3af2-0x0;var _0x3f78d6=_0x01b0[_0x4d3af2];return _0x3f78d6;};'use strict';var _=require(_0x001b('0x0'));var util=require(_0x001b('0x1'));var logger=require(_0x001b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x001b('0x3'));var rp=require(_0x001b('0x4'));var fs=require('fs');var path=require(_0x001b('0x5'));var rimraf=require(_0x001b('0x6'));var config=require(_0x001b('0x7'));var attributes=require(_0x001b('0x8'));module['exports']=function(_0x499063,_0x5cd1b0){return _0x499063[_0x001b('0x9')](_0x001b('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 48644d5..ccf4e7b 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 _0x94df=['client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x128c2b,_0x3c64b0){var _0x3c0b7c=function(_0x4c0a8c){while(--_0x4c0a8c){_0x128c2b['push'](_0x128c2b['shift']());}};_0x3c0b7c(++_0x3c64b0);}(_0x94df,0xa3));var _0xf94d=function(_0x35ab62,_0x36daaa){_0x35ab62=_0x35ab62-0x0;var _0x1f711a=_0x94df[_0x35ab62];return _0x1f711a;};'use strict';var _=require(_0xf94d('0x0'));var util=require(_0xf94d('0x1'));var moment=require(_0xf94d('0x2'));var BPromise=require(_0xf94d('0x3'));var rs=require(_0xf94d('0x4'));var fs=require('fs');var Redis=require(_0xf94d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf94d('0x6'));var logger=require(_0xf94d('0x7'))(_0xf94d('0x8'));var config=require(_0xf94d('0x9'));var jayson=require(_0xf94d('0xa'));var client=jayson[_0xf94d('0xb')][_0xf94d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18a11a,_0x1ebc19,_0xf285b5){return new BPromise(function(_0x1832e9,_0x504670){return client[_0xf94d('0xd')](_0x18a11a,_0xf285b5)[_0xf94d('0xe')](function(_0x145f5b){logger[_0xf94d('0xf')](_0xf94d('0x10'),_0x1ebc19,_0xf94d('0x11'));logger['debug'](_0xf94d('0x12'),_0x1ebc19,_0xf94d('0x11'),JSON[_0xf94d('0x13')](_0x145f5b));if(_0x145f5b[_0xf94d('0x14')]){if(_0x145f5b[_0xf94d('0x14')]['code']===0x1f4){logger['error'](_0xf94d('0x10'),_0x1ebc19,_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);return _0x504670(_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);}logger[_0xf94d('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0x1ebc19,_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);return _0x1832e9(_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);}else{logger[_0xf94d('0xf')](_0xf94d('0x10'),_0x1ebc19,_0xf94d('0x11'));_0x1832e9(_0x145f5b[_0xf94d('0x16')]['message']);}})[_0xf94d('0x17')](function(_0x5cd967){logger[_0xf94d('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0x1ebc19,_0x5cd967);_0x504670(_0x5cd967);});});}exports[_0xf94d('0x18')]=function(_0x559e0c){var _0x30d231=this;return new Promise(function(_0x3bf001,_0x510eef){return db[_0xf94d('0x19')]['create'](_0x559e0c[_0xf94d('0x1a')],{'raw':_0x559e0c['options']?_0x559e0c[_0xf94d('0x1b')][_0xf94d('0x1c')]===undefined?!![]:![]:!![]})[_0xf94d('0xe')](function(_0x2ede5b){logger['info'](_0xf94d('0x18'),_0x559e0c);logger['debug'](_0xf94d('0x18'),_0x559e0c,JSON[_0xf94d('0x13')](_0x2ede5b));_0x3bf001(_0x2ede5b);})[_0xf94d('0x17')](function(_0x56e5f5){logger[_0xf94d('0x14')](_0xf94d('0x18'),_0x56e5f5[_0xf94d('0x15')],_0x559e0c);_0x510eef(_0x30d231[_0xf94d('0x14')](0x1f4,_0x56e5f5[_0xf94d('0x15')]));});});}; \ No newline at end of file +var _0x8caf=['../../config/environment','jayson/promise','client','http','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x56b534,_0x2d3736){var _0x44ff9a=function(_0x145935){while(--_0x145935){_0x56b534['push'](_0x56b534['shift']());}};_0x44ff9a(++_0x2d3736);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x3baa05,_0x207228){_0x3baa05=_0x3baa05-0x0;var _0x3b2b8d=_0x8caf[_0x3baa05];return _0x3b2b8d;};'use strict';var _=require('lodash');var util=require(_0xf8ca('0x0'));var moment=require(_0xf8ca('0x1'));var BPromise=require(_0xf8ca('0x2'));var rs=require(_0xf8ca('0x3'));var fs=require('fs');var Redis=require(_0xf8ca('0x4'));var db=require(_0xf8ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8ca('0x6'))(_0xf8ca('0x7'));var config=require(_0xf8ca('0x8'));var jayson=require(_0xf8ca('0x9'));var client=jayson[_0xf8ca('0xa')][_0xf8ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x562eea,_0x773b9f,_0x3abd58){return new BPromise(function(_0x3a91d3,_0x31300c){return client['request'](_0x562eea,_0x3abd58)['then'](function(_0x3a9674){logger['info'](_0xf8ca('0xc'),_0x773b9f,_0xf8ca('0xd'));logger[_0xf8ca('0xe')](_0xf8ca('0xf'),_0x773b9f,'request\x20sent',JSON[_0xf8ca('0x10')](_0x3a9674));if(_0x3a9674[_0xf8ca('0x11')]){if(_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x12')]===0x1f4){logger['error'](_0xf8ca('0xc'),_0x773b9f,_0x3a9674[_0xf8ca('0x11')]['message']);return _0x31300c(_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x13')]);}logger[_0xf8ca('0x11')](_0xf8ca('0xc'),_0x773b9f,_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x13')]);return _0x3a91d3(_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x13')]);}else{logger[_0xf8ca('0x14')](_0xf8ca('0xc'),_0x773b9f,'request\x20sent');_0x3a91d3(_0x3a9674[_0xf8ca('0x15')][_0xf8ca('0x13')]);}})[_0xf8ca('0x16')](function(_0x12e8f0){logger[_0xf8ca('0x11')](_0xf8ca('0xc'),_0x773b9f,_0x12e8f0);_0x31300c(_0x12e8f0);});});}exports[_0xf8ca('0x17')]=function(_0x127119){var _0x50e805=this;return new Promise(function(_0x237f44,_0x3b5400){return db[_0xf8ca('0x18')][_0xf8ca('0x19')](_0x127119['body'],{'raw':_0x127119[_0xf8ca('0x1a')]?_0x127119[_0xf8ca('0x1a')][_0xf8ca('0x1b')]===undefined?!![]:![]:!![]})[_0xf8ca('0x1c')](function(_0x18e8da){logger[_0xf8ca('0x14')]('CreateSquareDetailsReport',_0x127119);logger[_0xf8ca('0xe')]('CreateSquareDetailsReport',_0x127119,JSON[_0xf8ca('0x10')](_0x18e8da));_0x237f44(_0x18e8da);})[_0xf8ca('0x16')](function(_0x179a48){logger[_0xf8ca('0x11')](_0xf8ca('0x17'),_0x179a48[_0xf8ca('0x13')],_0x127119);_0x3b5400(_0x50e805['error'](0x1f4,_0x179a48['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index acaf018..159457e 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 _0xb764=['killProcess','exports','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xb764,0x1c2));var _0x4b76=function(_0x23601a,_0x148985){_0x23601a=_0x23601a-0x0;var _0x35bd1d=_0xb764[_0x23601a];return _0x35bd1d;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x4b76('0x0'));var controller=require(_0x4b76('0x1'));router[_0x4b76('0x2')]('/',auth[_0x4b76('0x3')](),controller[_0x4b76('0x4')]);router[_0x4b76('0x2')](_0x4b76('0x5'),auth['isAuthenticated'](),controller[_0x4b76('0x6')]);module[_0x4b76('0x7')]=router; \ No newline at end of file +var _0x140e=['./system.controller','get','isAuthenticated','index','killProcess','exports','express'];(function(_0x36961d,_0x146b6d){var _0x4e810f=function(_0x2302d4){while(--_0x2302d4){_0x36961d['push'](_0x36961d['shift']());}};_0x4e810f(++_0x146b6d);}(_0x140e,0x102));var _0xe140=function(_0x3a7d6d,_0x2618ed){_0x3a7d6d=_0x3a7d6d-0x0;var _0x1ebfb7=_0x140e[_0x3a7d6d];return _0x1ebfb7;};'use strict';var express=require(_0xe140('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xe140('0x1'));router[_0xe140('0x2')]('/',auth[_0xe140('0x3')](),controller[_0xe140('0x4')]);router[_0xe140('0x2')]('/process/:pid/kill',auth[_0xe140('0x3')](),controller[_0xe140('0x5')]);module[_0xe140('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 3078c7b..ce92df3 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 _0x4cf8=['then','status','json','catch','killProcess','components/import/cm','format','params','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send'];(function(_0x5ed1cb,_0x4388e4){var _0x4823b9=function(_0x227b6b){while(--_0x227b6b){_0x5ed1cb['push'](_0x5ed1cb['shift']());}};_0x4823b9(++_0x4388e4);}(_0x4cf8,0x7f));var _0x84cf=function(_0x33feca,_0x2bd9ae){_0x33feca=_0x33feca-0x0;var _0x3c558f=_0x4cf8[_0x33feca];return _0x3c558f;};'use strict';var info=require(_0x84cf('0x0'));var exec=require(_0x84cf('0x1'))[_0x84cf('0x2')];var logger=require(_0x84cf('0x3'))(_0x84cf('0x4'));var util=require(_0x84cf('0x5'));var BPromise=require(_0x84cf('0x6'));var _=require(_0x84cf('0x7'));function handleError(_0x3379da,_0x30f1c0,_0x55632b){_0x30f1c0=_0x30f1c0||0x1f4;return function(_0x5bf5f9){logger[_0x84cf('0x8')](_0x84cf('0x9'),_0x55632b,_0x30f1c0,util[_0x84cf('0xa')](_0x5bf5f9,{'showHidden':![],'depth':null}));delete _0x5bf5f9[_0x84cf('0xb')];_0x3379da['status'](_0x30f1c0)[_0x84cf('0xc')](_0x5bf5f9);};}exports['index']=function(_0x1f7b46,_0x4b9243){return info['getAllData']()[_0x84cf('0xd')](function(_0x38e46c){return _0x4b9243[_0x84cf('0xe')](0xc8)[_0x84cf('0xf')](_0x38e46c);})[_0x84cf('0x10')](function(_0x990acf){return _0x4b9243[_0x84cf('0xe')](0x1f4)[_0x84cf('0xf')](_0x990acf);});};exports[_0x84cf('0x11')]=function(_0x59696f,_0x2f077c){var _0x44160d=[_0x84cf('0x12')];return new BPromise(function(_0x530b7e,_0x18a42e){return exec(util[_0x84cf('0x13')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x59696f[_0x84cf('0x14')][_0x84cf('0x15')]),function(_0x579709,_0x1e7e7e,_0x5078b5){if(_0x579709){return _0x18a42e(_0x579709);}return _0x530b7e(_0x1e7e7e);});})[_0x84cf('0xd')](function(_0x2bef26){var _0x2c9d91=![];var _0x2c8449=_0x2bef26[_0x84cf('0x16')](/\n/);for(var _0x4aaf5e=0x0,_0xab36cd=_0x44160d['length'];_0x4aaf5e<_0xab36cd,_0x2c9d91===![];_0x4aaf5e+=0x1){if(_0x2bef26[_0x84cf('0x17')](_0x44160d[_0x4aaf5e])>=0x0){_0x2c9d91=!![];}}if(!_0x2c9d91){throw new Error(util['format'](_0x84cf('0x18'),_0x59696f['params'][_0x84cf('0x15')]));}process[_0x84cf('0x19')](_0x59696f['params'][_0x84cf('0x15')],_0x84cf('0x1a'));return _0x2f077c['status'](0xc8)[_0x84cf('0xf')]({'message':util['format'](_0x84cf('0x1b'),_0x59696f[_0x84cf('0x14')]['pid'])});})[_0x84cf('0x10')](handleError(_0x2f077c,null,_0x84cf('0x11')));}; \ No newline at end of file +var _0xa539=['inspect','status','send','index','getAllData','catch','json','killProcess','format','params','pid','split','length','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s'];(function(_0x1fcdf0,_0x452001){var _0x39e6ba=function(_0x3e27b4){while(--_0x3e27b4){_0x1fcdf0['push'](_0x1fcdf0['shift']());}};_0x39e6ba(++_0x452001);}(_0xa539,0x6b));var _0x9a53=function(_0x387ed2,_0x50aa0a){_0x387ed2=_0x387ed2-0x0;var _0x3a2434=_0xa539[_0x387ed2];return _0x3a2434;};'use strict';var info=require(_0x9a53('0x0'));var exec=require('child_process')[_0x9a53('0x1')];var logger=require(_0x9a53('0x2'))(_0x9a53('0x3'));var util=require(_0x9a53('0x4'));var BPromise=require('bluebird');var _=require(_0x9a53('0x5'));function handleError(_0x60de30,_0x12a698,_0x22b326){_0x12a698=_0x12a698||0x1f4;return function(_0x695a61){logger[_0x9a53('0x6')](_0x9a53('0x7'),_0x22b326,_0x12a698,util[_0x9a53('0x8')](_0x695a61,{'showHidden':![],'depth':null}));delete _0x695a61['name'];_0x60de30[_0x9a53('0x9')](_0x12a698)[_0x9a53('0xa')](_0x695a61);};}exports[_0x9a53('0xb')]=function(_0x4562aa,_0x1e53b3){return info[_0x9a53('0xc')]()['then'](function(_0x1462d4){return _0x1e53b3[_0x9a53('0x9')](0xc8)['json'](_0x1462d4);})[_0x9a53('0xd')](function(_0x43d80c){return _0x1e53b3[_0x9a53('0x9')](0x1f4)[_0x9a53('0xe')](_0x43d80c);});};exports[_0x9a53('0xf')]=function(_0x1af74a,_0xcdcc37){var _0x3ac67a=['components/import/cm'];return new BPromise(function(_0x1a1ff3,_0x3e4b26){return exec(util[_0x9a53('0x10')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x1af74a[_0x9a53('0x11')][_0x9a53('0x12')]),function(_0x361d2e,_0x3c0bde,_0x33db49){if(_0x361d2e){return _0x3e4b26(_0x361d2e);}return _0x1a1ff3(_0x3c0bde);});})['then'](function(_0x2bf5b9){var _0x730fc4=![];var _0x499609=_0x2bf5b9[_0x9a53('0x13')](/\n/);for(var _0x589ef2=0x0,_0x2dcfbd=_0x3ac67a[_0x9a53('0x14')];_0x589ef2<_0x2dcfbd,_0x730fc4===![];_0x589ef2+=0x1){if(_0x2bf5b9['indexOf'](_0x3ac67a[_0x589ef2])>=0x0){_0x730fc4=!![];}}if(!_0x730fc4){throw new Error(util[_0x9a53('0x10')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x1af74a['params']['pid']));}process[_0x9a53('0x15')](_0x1af74a[_0x9a53('0x11')]['pid'],'SIGINT');return _0xcdcc37[_0x9a53('0x9')](0xc8)[_0x9a53('0xe')]({'message':util[_0x9a53('0x10')](_0x9a53('0x16'),_0x1af74a['params'][_0x9a53('0x12')])});})[_0x9a53('0xd')](handleError(_0xcdcc37,null,_0x9a53('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 10963d8..6e483bf 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 _0xee24=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','index','get','/:id','isAuthenticated','post','create','update','exports','multer','util','path','connect-timeout','express'];(function(_0x5ca58f,_0x31ee9a){var _0x59eefb=function(_0x5c90fb){while(--_0x5c90fb){_0x5ca58f['push'](_0x5ca58f['shift']());}};_0x59eefb(++_0x31ee9a);}(_0xee24,0x80));var _0x4ee2=function(_0x4c5e48,_0xc065e){_0x4c5e48=_0x4c5e48-0x0;var _0x39e96d=_0xee24[_0x4c5e48];return _0x39e96d;};'use strict';var multer=require(_0x4ee2('0x0'));var util=require(_0x4ee2('0x1'));var path=require(_0x4ee2('0x2'));var timeout=require(_0x4ee2('0x3'));var express=require(_0x4ee2('0x4'));var router=express[_0x4ee2('0x5')]();var fs_extra=require(_0x4ee2('0x6'));var auth=require(_0x4ee2('0x7'));var interaction=require(_0x4ee2('0x8'));var config=require(_0x4ee2('0x9'));var controller=require(_0x4ee2('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x4ee2('0xb')]);router[_0x4ee2('0xc')](_0x4ee2('0xd'),auth[_0x4ee2('0xe')](),controller['show']);router[_0x4ee2('0xf')]('/',auth[_0x4ee2('0xe')](),controller[_0x4ee2('0x10')]);router['put'](_0x4ee2('0xd'),auth['isAuthenticated'](),controller[_0x4ee2('0x11')]);router['delete'](_0x4ee2('0xd'),auth[_0x4ee2('0xe')](),controller['destroy']);module[_0x4ee2('0x12')]=router; \ No newline at end of file +var _0x1777=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','util'];(function(_0x169e53,_0x46be55){var _0x252bb3=function(_0x521e7a){while(--_0x521e7a){_0x169e53['push'](_0x169e53['shift']());}};_0x252bb3(++_0x46be55);}(_0x1777,0x168));var _0x7177=function(_0x5b0053,_0x2e002b){_0x5b0053=_0x5b0053-0x0;var _0x43f1c2=_0x1777[_0x5b0053];return _0x43f1c2;};'use strict';var multer=require('multer');var util=require(_0x7177('0x0'));var path=require(_0x7177('0x1'));var timeout=require(_0x7177('0x2'));var express=require(_0x7177('0x3'));var router=express['Router']();var fs_extra=require(_0x7177('0x4'));var auth=require(_0x7177('0x5'));var interaction=require(_0x7177('0x6'));var config=require(_0x7177('0x7'));var controller=require(_0x7177('0x8'));router[_0x7177('0x9')]('/',auth[_0x7177('0xa')](),controller[_0x7177('0xb')]);router[_0x7177('0x9')](_0x7177('0xc'),auth[_0x7177('0xa')](),controller[_0x7177('0xd')]);router[_0x7177('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7177('0xf')](_0x7177('0xc'),auth[_0x7177('0xa')](),controller['update']);router[_0x7177('0x10')]('/:id',auth[_0x7177('0xa')](),controller[_0x7177('0x11')]);module[_0x7177('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 3eb9a3b..fbeeadb 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 _0x9d9b=['STRING','exports'];(function(_0x209511,_0x231622){var _0x39b937=function(_0x4005a3){while(--_0x4005a3){_0x209511['push'](_0x209511['shift']());}};_0x39b937(++_0x231622);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x1bd854,_0x83db09){_0x1bd854=_0x1bd854-0x0;var _0x5bb0e8=_0x9d9b[_0x1bd854];return _0x5bb0e8;};'use strict';var Sequelize=require('sequelize');module[_0xb9d9('0x0')]={'name':{'type':Sequelize[_0xb9d9('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xb9d9('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xb9d9('0x1')]}}; \ No newline at end of file +var _0x438a=['sequelize','exports','STRING','name','#0091EA'];(function(_0x1b5aea,_0x1afe6f){var _0x51cae9=function(_0x1494a6){while(--_0x1494a6){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x51cae9(++_0x1afe6f);}(_0x438a,0x18b));var _0xa438=function(_0x51a909,_0x18b079){_0x51a909=_0x51a909-0x0;var _0x4dd80b=_0x438a[_0x51a909];return _0x4dd80b;};'use strict';var Sequelize=require(_0xa438('0x0'));module[_0xa438('0x1')]={'name':{'type':Sequelize[_0xa438('0x2')],'unique':_0xa438('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa438('0x2')],'defaultValue':_0xa438('0x4')},'description':{'type':Sequelize[_0xa438('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 065d53d..6f47555 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 _0x68fc=['params','eml-format','rimraf','zip-dir','moment','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','get','Tags','destroy','end','error','stack','name','send','index','map','Tag','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','find','role','user','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x203416,_0x4f30fa){var _0x431296=function(_0x27a78c){while(--_0x27a78c){_0x203416['push'](_0x203416['shift']());}};_0x431296(++_0x4f30fa);}(_0x68fc,0xa5));var _0xc68f=function(_0x21bf66,_0x1b7270){_0x21bf66=_0x21bf66-0x0;var _0x320684=_0x68fc[_0x21bf66];return _0x320684;};'use strict';var emlformat=require(_0xc68f('0x0'));var rimraf=require(_0xc68f('0x1'));var zipdir=require(_0xc68f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc68f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc68f('0x4'));var util=require('util');var path=require('path');var sox=require(_0xc68f('0x5'));var csv=require(_0xc68f('0x6'));var ejs=require(_0xc68f('0x7'));var fs=require('fs');var fs_extra=require(_0xc68f('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc68f('0x9'));var jsforce=require(_0xc68f('0xa'));var deskjs=require(_0xc68f('0xb'));var toCsv=require(_0xc68f('0x6'));var querystring=require(_0xc68f('0xc'));var Papa=require(_0xc68f('0xd'));var Redis=require(_0xc68f('0xe'));var authService=require(_0xc68f('0xf'));var qs=require(_0xc68f('0x10'));var as=require(_0xc68f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc68f('0x12'))(_0xc68f('0x13'));var utils=require(_0xc68f('0x14'));var config=require(_0xc68f('0x15'));var licenseUtil=require(_0xc68f('0x16'));var db=require(_0xc68f('0x17'))['db'];function respondWithStatusCode(_0x3ccebe,_0x41aeb8){_0x41aeb8=_0x41aeb8||0xcc;return function(_0x151bde){if(_0x151bde){return _0x3ccebe[_0xc68f('0x18')](_0x41aeb8);}return _0x3ccebe[_0xc68f('0x19')](_0x41aeb8)['end']();};}function respondWithResult(_0x2ea1c4,_0x90ccbd){_0x90ccbd=_0x90ccbd||0xc8;return function(_0x2b1d30){if(_0x2b1d30){return _0x2ea1c4[_0xc68f('0x19')](_0x90ccbd)[_0xc68f('0x1a')](_0x2b1d30);}};}function respondWithFilteredResult(_0x2673b4,_0x3d1406){return function(_0x209d16){if(_0x209d16){var _0x4648c6=typeof _0x3d1406['offset']==='undefined'&&typeof _0x3d1406[_0xc68f('0x1b')]===_0xc68f('0x1c');var _0x171eea=_0x209d16[_0xc68f('0x1d')];var _0x2d9d85=_0x4648c6?0x0:_0x3d1406[_0xc68f('0x1e')];var _0x50fab4=_0x4648c6?_0x209d16[_0xc68f('0x1d')]:_0x3d1406[_0xc68f('0x1e')]+_0x3d1406[_0xc68f('0x1b')];var _0x2c058c;if(_0x50fab4>=_0x171eea){_0x50fab4=_0x171eea;_0x2c058c=0xc8;}else{_0x2c058c=0xce;}_0x2673b4[_0xc68f('0x19')](_0x2c058c);return _0x2673b4[_0xc68f('0x1f')](_0xc68f('0x20'),_0x2d9d85+'-'+_0x50fab4+'/'+_0x171eea)[_0xc68f('0x1a')](_0x209d16);}return null;};}function patchUpdates(_0x582301){return function(_0xcc11a3){try{jsonpatch[_0xc68f('0x21')](_0xcc11a3,_0x582301,!![]);}catch(_0x2e27b9){return BPromise['reject'](_0x2e27b9);}return _0xcc11a3[_0xc68f('0x22')]();};}function saveUpdates(_0x1daac5,_0x116203){return function(_0x2064db){if(_0x2064db){return _0x2064db[_0xc68f('0x23')](_0x1daac5)[_0xc68f('0x24')](function(_0x2412a9){return _0x2412a9;});}return null;};}function removeEntity(_0x547d46,_0x38c3a0){return function(_0x288957){if(_0x288957){return _0x288957['destroy']()[_0xc68f('0x24')](function(){var _0x8399e6=_0x288957[_0xc68f('0x25')]({'plain':!![]});var _0x44c4b2=_0xc68f('0x26');return db['UserProfileResource'][_0xc68f('0x27')]({'where':{'type':_0x44c4b2,'resourceId':_0x8399e6['id']}})[_0xc68f('0x24')](function(){return _0x288957;});})['then'](function(){_0x547d46[_0xc68f('0x19')](0xcc)[_0xc68f('0x28')]();});}};}function handleEntityNotFound(_0x4d26e3,_0x3f6c07){return function(_0xdde47e){if(!_0xdde47e){_0x4d26e3[_0xc68f('0x18')](0x194);}return _0xdde47e;};}function handleError(_0x3abc1e,_0x58dd95){_0x58dd95=_0x58dd95||0x1f4;return function(_0x477a1c){logger[_0xc68f('0x29')](_0x477a1c[_0xc68f('0x2a')]);if(_0x477a1c[_0xc68f('0x2b')]){delete _0x477a1c[_0xc68f('0x2b')];}_0x3abc1e[_0xc68f('0x19')](_0x58dd95)[_0xc68f('0x2c')](_0x477a1c);};}exports[_0xc68f('0x2d')]=function(_0x4bb052,_0x37f947){var _0x352eb9={},_0x4b64da={},_0x323677={'count':0x0,'rows':[]};var _0x6d2d34=_[_0xc68f('0x2e')](db[_0xc68f('0x2f')]['rawAttributes'],function(_0x1deee7){return{'name':_0x1deee7[_0xc68f('0x30')],'type':_0x1deee7['type'][_0xc68f('0x31')]};});_0x4b64da[_0xc68f('0x32')]=_[_0xc68f('0x2e')](_0x6d2d34,_0xc68f('0x2b'));_0x4b64da[_0xc68f('0x33')]=_['keys'](_0x4bb052['query']);_0x4b64da[_0xc68f('0x34')]=_[_0xc68f('0x35')](_0x4b64da[_0xc68f('0x32')],_0x4b64da[_0xc68f('0x33')]);_0x352eb9[_0xc68f('0x36')]=_['intersection'](_0x4b64da['model'],qs[_0xc68f('0x37')](_0x4bb052['query'][_0xc68f('0x37')]));_0x352eb9[_0xc68f('0x36')]=_0x352eb9[_0xc68f('0x36')][_0xc68f('0x38')]?_0x352eb9[_0xc68f('0x36')]:_0x4b64da[_0xc68f('0x32')];if(!_0x4bb052[_0xc68f('0x33')]['hasOwnProperty'](_0xc68f('0x39'))){_0x352eb9[_0xc68f('0x1b')]=qs[_0xc68f('0x1b')](_0x4bb052[_0xc68f('0x33')][_0xc68f('0x1b')]);_0x352eb9[_0xc68f('0x1e')]=qs[_0xc68f('0x1e')](_0x4bb052[_0xc68f('0x33')][_0xc68f('0x1e')]);}_0x352eb9[_0xc68f('0x3a')]=qs[_0xc68f('0x3b')](_0x4bb052['query']['sort']);_0x352eb9['where']=qs[_0xc68f('0x34')](_[_0xc68f('0x3c')](_0x4bb052[_0xc68f('0x33')],_0x4b64da[_0xc68f('0x34')]),_0x6d2d34);if(_0x4bb052['query'][_0xc68f('0x3d')]){_0x352eb9[_0xc68f('0x3e')]=_[_0xc68f('0x3f')](_0x352eb9['where'],{'$or':_[_0xc68f('0x2e')](_0x6d2d34,function(_0x4386cb){if(_0x4386cb['type']!==_0xc68f('0x40')){var _0x236684={};_0x236684[_0x4386cb[_0xc68f('0x2b')]]={'$like':'%'+_0x4bb052['query'][_0xc68f('0x3d')]+'%'};return _0x236684;}})});}_0x352eb9=_[_0xc68f('0x3f')]({},_0x352eb9,_0x4bb052[_0xc68f('0x41')]);var _0x1615e6={'where':_0x352eb9[_0xc68f('0x3e')]};return db[_0xc68f('0x2f')][_0xc68f('0x1d')](_0x1615e6)['then'](function(_0x192942){_0x323677[_0xc68f('0x1d')]=_0x192942;if(_0x4bb052[_0xc68f('0x33')][_0xc68f('0x42')]){_0x352eb9[_0xc68f('0x43')]=[{'all':!![]}];}return db[_0xc68f('0x2f')][_0xc68f('0x44')](_0x352eb9);})[_0xc68f('0x24')](function(_0x1e8141){_0x323677['rows']=_0x1e8141;return _0x323677;})[_0xc68f('0x24')](respondWithFilteredResult(_0x37f947,_0x352eb9))[_0xc68f('0x45')](handleError(_0x37f947,null));};exports[_0xc68f('0x46')]=function(_0x34a889,_0x45782f){var _0x3683c0={'raw':!![],'where':{'id':_0x34a889['params']['id']}},_0x3e7b43={};_0x3e7b43[_0xc68f('0x32')]=_['keys'](db['Tag'][_0xc68f('0x47')]);_0x3e7b43[_0xc68f('0x33')]=_['keys'](_0x34a889['query']);_0x3e7b43[_0xc68f('0x34')]=_[_0xc68f('0x35')](_0x3e7b43[_0xc68f('0x32')],_0x3e7b43[_0xc68f('0x33')]);_0x3683c0[_0xc68f('0x36')]=_[_0xc68f('0x35')](_0x3e7b43[_0xc68f('0x32')],qs[_0xc68f('0x37')](_0x34a889[_0xc68f('0x33')][_0xc68f('0x37')]));_0x3683c0[_0xc68f('0x36')]=_0x3683c0['attributes'][_0xc68f('0x38')]?_0x3683c0['attributes']:_0x3e7b43[_0xc68f('0x32')];if(_0x34a889[_0xc68f('0x33')]['includeAll']){_0x3683c0[_0xc68f('0x43')]=[{'all':!![]}];}_0x3683c0=_[_0xc68f('0x3f')]({},_0x3683c0,_0x34a889[_0xc68f('0x41')]);return db[_0xc68f('0x2f')][_0xc68f('0x48')](_0x3683c0)[_0xc68f('0x24')](handleEntityNotFound(_0x45782f,null))[_0xc68f('0x24')](respondWithResult(_0x45782f,null))[_0xc68f('0x45')](handleError(_0x45782f,null));};exports['create']=function(_0x2920d5,_0x15eaa2){return db[_0xc68f('0x2f')]['create'](_0x2920d5['body'],{})['then'](function(_0x27ca32){var _0x237327=_0x2920d5['user'][_0xc68f('0x25')]({'plain':!![]});if(!_0x237327)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x237327[_0xc68f('0x49')]===_0xc68f('0x4a')){var _0x44efa8=_0x27ca32[_0xc68f('0x25')]({'plain':!![]});var _0x3b9a4c=_0xc68f('0x26');return db[_0xc68f('0x4b')][_0xc68f('0x48')]({'where':{'name':_0x3b9a4c,'userProfileId':_0x237327[_0xc68f('0x4c')]},'raw':!![]})[_0xc68f('0x24')](function(_0x1374e0){if(_0x1374e0&&_0x1374e0['autoAssociation']===0x0){return db[_0xc68f('0x4d')][_0xc68f('0x4e')]({'name':_0x44efa8['name'],'resourceId':_0x44efa8['id'],'type':_0x1374e0['name'],'sectionId':_0x1374e0['id']},{})[_0xc68f('0x24')](function(){return _0x27ca32;});}else{return _0x27ca32;}})[_0xc68f('0x45')](function(_0xa9c6b1){logger['error'](_0xc68f('0x4f'),_0xa9c6b1);throw _0xa9c6b1;});}return _0x27ca32;})[_0xc68f('0x24')](respondWithResult(_0x15eaa2,0xc9))['catch'](handleError(_0x15eaa2,null));};exports['update']=function(_0x2eb1e8,_0x4281a5){if(_0x2eb1e8[_0xc68f('0x50')]['id']){delete _0x2eb1e8[_0xc68f('0x50')]['id'];}return db[_0xc68f('0x2f')][_0xc68f('0x48')]({'where':{'id':_0x2eb1e8[_0xc68f('0x51')]['id']}})[_0xc68f('0x24')](handleEntityNotFound(_0x4281a5,null))[_0xc68f('0x24')](saveUpdates(_0x2eb1e8[_0xc68f('0x50')],null))[_0xc68f('0x24')](respondWithResult(_0x4281a5,null))[_0xc68f('0x45')](handleError(_0x4281a5,null));};exports[_0xc68f('0x27')]=function(_0x331d9b,_0x23ebdd){return db[_0xc68f('0x2f')][_0xc68f('0x48')]({'where':{'id':_0x331d9b[_0xc68f('0x51')]['id']}})[_0xc68f('0x24')](handleEntityNotFound(_0x23ebdd,null))[_0xc68f('0x24')](removeEntity(_0x23ebdd,null))[_0xc68f('0x45')](handleError(_0x23ebdd,null));}; \ No newline at end of file +var _0xa0bc=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','Tags','UserProfileResource','sendStatus','error','stack','name','send','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca0b('0x0'));var zipdir=require(_0xca0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca0b('0x2'));var moment=require(_0xca0b('0x3'));var BPromise=require(_0xca0b('0x4'));var Mustache=require(_0xca0b('0x5'));var util=require(_0xca0b('0x6'));var path=require(_0xca0b('0x7'));var sox=require(_0xca0b('0x8'));var csv=require(_0xca0b('0x9'));var ejs=require(_0xca0b('0xa'));var fs=require('fs');var fs_extra=require(_0xca0b('0xb'));var _=require(_0xca0b('0xc'));var squel=require(_0xca0b('0xd'));var crypto=require(_0xca0b('0xe'));var jsforce=require(_0xca0b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xca0b('0x9'));var querystring=require(_0xca0b('0x10'));var Papa=require(_0xca0b('0x11'));var Redis=require(_0xca0b('0x12'));var authService=require(_0xca0b('0x13'));var qs=require(_0xca0b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca0b('0x15'));var logger=require(_0xca0b('0x16'))(_0xca0b('0x17'));var utils=require(_0xca0b('0x18'));var config=require(_0xca0b('0x19'));var licenseUtil=require(_0xca0b('0x1a'));var db=require(_0xca0b('0x1b'))['db'];function respondWithStatusCode(_0x3a2e25,_0x22ca9d){_0x22ca9d=_0x22ca9d||0xcc;return function(_0x2ce366){if(_0x2ce366){return _0x3a2e25['sendStatus'](_0x22ca9d);}return _0x3a2e25[_0xca0b('0x1c')](_0x22ca9d)[_0xca0b('0x1d')]();};}function respondWithResult(_0x358972,_0x5da205){_0x5da205=_0x5da205||0xc8;return function(_0x106ed6){if(_0x106ed6){return _0x358972[_0xca0b('0x1c')](_0x5da205)[_0xca0b('0x1e')](_0x106ed6);}};}function respondWithFilteredResult(_0x2beba9,_0x42b68e){return function(_0x404c6d){if(_0x404c6d){var _0x4d7620=typeof _0x42b68e[_0xca0b('0x1f')]===_0xca0b('0x20')&&typeof _0x42b68e['limit']===_0xca0b('0x20');var _0x5db810=_0x404c6d[_0xca0b('0x21')];var _0x5050b7=_0x4d7620?0x0:_0x42b68e[_0xca0b('0x1f')];var _0x32eff7=_0x4d7620?_0x404c6d[_0xca0b('0x21')]:_0x42b68e['offset']+_0x42b68e[_0xca0b('0x22')];var _0x2c0c53;if(_0x32eff7>=_0x5db810){_0x32eff7=_0x5db810;_0x2c0c53=0xc8;}else{_0x2c0c53=0xce;}_0x2beba9['status'](_0x2c0c53);return _0x2beba9[_0xca0b('0x23')](_0xca0b('0x24'),_0x5050b7+'-'+_0x32eff7+'/'+_0x5db810)[_0xca0b('0x1e')](_0x404c6d);}return null;};}function patchUpdates(_0x59bda9){return function(_0x865393){try{jsonpatch[_0xca0b('0x25')](_0x865393,_0x59bda9,!![]);}catch(_0x484e26){return BPromise[_0xca0b('0x26')](_0x484e26);}return _0x865393[_0xca0b('0x27')]();};}function saveUpdates(_0x2ae93b,_0x49e695){return function(_0x119589){if(_0x119589){return _0x119589[_0xca0b('0x28')](_0x2ae93b)[_0xca0b('0x29')](function(_0x504d91){return _0x504d91;});}return null;};}function removeEntity(_0x54fb03,_0x11f5c3){return function(_0x428459){if(_0x428459){return _0x428459[_0xca0b('0x2a')]()[_0xca0b('0x29')](function(){var _0x3ae1dc=_0x428459['get']({'plain':!![]});var _0xe122e8=_0xca0b('0x2b');return db[_0xca0b('0x2c')][_0xca0b('0x2a')]({'where':{'type':_0xe122e8,'resourceId':_0x3ae1dc['id']}})[_0xca0b('0x29')](function(){return _0x428459;});})['then'](function(){_0x54fb03['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44a6fd,_0xa71d57){return function(_0x3fd832){if(!_0x3fd832){_0x44a6fd[_0xca0b('0x2d')](0x194);}return _0x3fd832;};}function handleError(_0xe7673b,_0x515f83){_0x515f83=_0x515f83||0x1f4;return function(_0x23af62){logger[_0xca0b('0x2e')](_0x23af62[_0xca0b('0x2f')]);if(_0x23af62[_0xca0b('0x30')]){delete _0x23af62[_0xca0b('0x30')];}_0xe7673b[_0xca0b('0x1c')](_0x515f83)[_0xca0b('0x31')](_0x23af62);};}exports['index']=function(_0x6016f6,_0x17a365){var _0x3b72b2={},_0x26f168={},_0x5a8c2f={'count':0x0,'rows':[]};var _0x43cf1a=_[_0xca0b('0x32')](db[_0xca0b('0x33')][_0xca0b('0x34')],function(_0x3beea0){return{'name':_0x3beea0[_0xca0b('0x35')],'type':_0x3beea0[_0xca0b('0x36')][_0xca0b('0x37')]};});_0x26f168[_0xca0b('0x38')]=_[_0xca0b('0x32')](_0x43cf1a,_0xca0b('0x30'));_0x26f168[_0xca0b('0x39')]=_[_0xca0b('0x3a')](_0x6016f6[_0xca0b('0x39')]);_0x26f168[_0xca0b('0x3b')]=_['intersection'](_0x26f168[_0xca0b('0x38')],_0x26f168[_0xca0b('0x39')]);_0x3b72b2[_0xca0b('0x3c')]=_[_0xca0b('0x3d')](_0x26f168['model'],qs[_0xca0b('0x3e')](_0x6016f6[_0xca0b('0x39')]['fields']));_0x3b72b2[_0xca0b('0x3c')]=_0x3b72b2[_0xca0b('0x3c')][_0xca0b('0x3f')]?_0x3b72b2[_0xca0b('0x3c')]:_0x26f168[_0xca0b('0x38')];if(!_0x6016f6[_0xca0b('0x39')][_0xca0b('0x40')](_0xca0b('0x41'))){_0x3b72b2['limit']=qs['limit'](_0x6016f6[_0xca0b('0x39')][_0xca0b('0x22')]);_0x3b72b2[_0xca0b('0x1f')]=qs[_0xca0b('0x1f')](_0x6016f6[_0xca0b('0x39')][_0xca0b('0x1f')]);}_0x3b72b2[_0xca0b('0x42')]=qs[_0xca0b('0x43')](_0x6016f6[_0xca0b('0x39')][_0xca0b('0x43')]);_0x3b72b2[_0xca0b('0x44')]=qs[_0xca0b('0x3b')](_[_0xca0b('0x45')](_0x6016f6[_0xca0b('0x39')],_0x26f168[_0xca0b('0x3b')]),_0x43cf1a);if(_0x6016f6[_0xca0b('0x39')][_0xca0b('0x46')]){_0x3b72b2[_0xca0b('0x44')]=_[_0xca0b('0x47')](_0x3b72b2[_0xca0b('0x44')],{'$or':_[_0xca0b('0x32')](_0x43cf1a,function(_0x25a5a1){if(_0x25a5a1[_0xca0b('0x36')]!==_0xca0b('0x48')){var _0x90dc6c={};_0x90dc6c[_0x25a5a1['name']]={'$like':'%'+_0x6016f6['query'][_0xca0b('0x46')]+'%'};return _0x90dc6c;}})});}_0x3b72b2=_[_0xca0b('0x47')]({},_0x3b72b2,_0x6016f6['options']);var _0x54890e={'where':_0x3b72b2['where']};return db[_0xca0b('0x33')][_0xca0b('0x21')](_0x54890e)[_0xca0b('0x29')](function(_0xf9e175){_0x5a8c2f[_0xca0b('0x21')]=_0xf9e175;if(_0x6016f6['query']['includeAll']){_0x3b72b2[_0xca0b('0x49')]=[{'all':!![]}];}return db['Tag'][_0xca0b('0x4a')](_0x3b72b2);})['then'](function(_0x57bab3){_0x5a8c2f['rows']=_0x57bab3;return _0x5a8c2f;})[_0xca0b('0x29')](respondWithFilteredResult(_0x17a365,_0x3b72b2))[_0xca0b('0x4b')](handleError(_0x17a365,null));};exports[_0xca0b('0x4c')]=function(_0x3448ab,_0x19f760){var _0xcc9be0={'raw':!![],'where':{'id':_0x3448ab[_0xca0b('0x4d')]['id']}},_0x54bcb7={};_0x54bcb7[_0xca0b('0x38')]=_[_0xca0b('0x3a')](db[_0xca0b('0x33')][_0xca0b('0x34')]);_0x54bcb7['query']=_['keys'](_0x3448ab[_0xca0b('0x39')]);_0x54bcb7[_0xca0b('0x3b')]=_[_0xca0b('0x3d')](_0x54bcb7[_0xca0b('0x38')],_0x54bcb7['query']);_0xcc9be0[_0xca0b('0x3c')]=_[_0xca0b('0x3d')](_0x54bcb7[_0xca0b('0x38')],qs[_0xca0b('0x3e')](_0x3448ab['query']['fields']));_0xcc9be0[_0xca0b('0x3c')]=_0xcc9be0[_0xca0b('0x3c')][_0xca0b('0x3f')]?_0xcc9be0['attributes']:_0x54bcb7[_0xca0b('0x38')];if(_0x3448ab[_0xca0b('0x39')]['includeAll']){_0xcc9be0['include']=[{'all':!![]}];}_0xcc9be0=_['merge']({},_0xcc9be0,_0x3448ab[_0xca0b('0x4e')]);return db[_0xca0b('0x33')][_0xca0b('0x4f')](_0xcc9be0)['then'](handleEntityNotFound(_0x19f760,null))['then'](respondWithResult(_0x19f760,null))[_0xca0b('0x4b')](handleError(_0x19f760,null));};exports[_0xca0b('0x50')]=function(_0x250288,_0x174e81){return db[_0xca0b('0x33')][_0xca0b('0x50')](_0x250288['body'],{})['then'](function(_0x499b43){var _0x456ea1=_0x250288[_0xca0b('0x51')]['get']({'plain':!![]});if(!_0x456ea1)throw new Error(_0xca0b('0x52'));if(_0x456ea1[_0xca0b('0x53')]===_0xca0b('0x51')){var _0x535cce=_0x499b43[_0xca0b('0x54')]({'plain':!![]});var _0x5a3734=_0xca0b('0x2b');return db[_0xca0b('0x55')][_0xca0b('0x4f')]({'where':{'name':_0x5a3734,'userProfileId':_0x456ea1[_0xca0b('0x56')]},'raw':!![]})[_0xca0b('0x29')](function(_0x1d569e){if(_0x1d569e&&_0x1d569e[_0xca0b('0x57')]===0x0){return db[_0xca0b('0x2c')][_0xca0b('0x50')]({'name':_0x535cce[_0xca0b('0x30')],'resourceId':_0x535cce['id'],'type':_0x1d569e[_0xca0b('0x30')],'sectionId':_0x1d569e['id']},{})[_0xca0b('0x29')](function(){return _0x499b43;});}else{return _0x499b43;}})[_0xca0b('0x4b')](function(_0x21d2d5){logger[_0xca0b('0x2e')](_0xca0b('0x58'),_0x21d2d5);throw _0x21d2d5;});}return _0x499b43;})[_0xca0b('0x29')](respondWithResult(_0x174e81,0xc9))[_0xca0b('0x4b')](handleError(_0x174e81,null));};exports['update']=function(_0x27fdbd,_0xbef02e){if(_0x27fdbd['body']['id']){delete _0x27fdbd[_0xca0b('0x59')]['id'];}return db[_0xca0b('0x33')][_0xca0b('0x4f')]({'where':{'id':_0x27fdbd[_0xca0b('0x4d')]['id']}})[_0xca0b('0x29')](handleEntityNotFound(_0xbef02e,null))[_0xca0b('0x29')](saveUpdates(_0x27fdbd[_0xca0b('0x59')],null))[_0xca0b('0x29')](respondWithResult(_0xbef02e,null))['catch'](handleError(_0xbef02e,null));};exports[_0xca0b('0x2a')]=function(_0x36feaa,_0x416fd5){return db[_0xca0b('0x33')]['find']({'where':{'id':_0x36feaa['params']['id']}})[_0xca0b('0x29')](handleEntityNotFound(_0x416fd5,null))[_0xca0b('0x29')](removeEntity(_0x416fd5,null))['catch'](handleError(_0x416fd5,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index a981ba9..1d2ce16 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 _0x0c66=['../../config/environment','./tag.attributes','exports','Tag','tools_tags','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x1400ca,_0x4b79cc){var _0x43e66d=function(_0xbe6ebb){while(--_0xbe6ebb){_0x1400ca['push'](_0x1400ca['shift']());}};_0x43e66d(++_0x4b79cc);}(_0x0c66,0x161));var _0x60c6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x0c66[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x60c6('0x0'));var util=require(_0x60c6('0x1'));var logger=require(_0x60c6('0x2'))('api');var moment=require(_0x60c6('0x3'));var BPromise=require(_0x60c6('0x4'));var rp=require(_0x60c6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x60c6('0x6'));var config=require(_0x60c6('0x7'));var attributes=require(_0x60c6('0x8'));module[_0x60c6('0x9')]=function(_0x7543ca,_0x3d9367){return _0x7543ca['define'](_0x60c6('0xa'),attributes,{'tableName':_0x60c6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf240=['define','Tag','tools_tags','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./tag.attributes','exports'];(function(_0x7cef42,_0x3d3af5){var _0x2fef54=function(_0x5af3b4){while(--_0x5af3b4){_0x7cef42['push'](_0x7cef42['shift']());}};_0x2fef54(++_0x3d3af5);}(_0xf240,0xcf));var _0x0f24=function(_0x56f344,_0x2e5624){_0x56f344=_0x56f344-0x0;var _0x9155df=_0xf240[_0x56f344];return _0x9155df;};'use strict';var _=require(_0x0f24('0x0'));var util=require(_0x0f24('0x1'));var logger=require('../../config/logger')(_0x0f24('0x2'));var moment=require(_0x0f24('0x3'));var BPromise=require(_0x0f24('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0f24('0x5'));var config=require(_0x0f24('0x6'));var attributes=require(_0x0f24('0x7'));module[_0x0f24('0x8')]=function(_0x48e531,_0x3919f4){return _0x48e531[_0x0f24('0x9')](_0x0f24('0xa'),attributes,{'tableName':_0x0f24('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 72a4dc2..7eb7df0 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 _0xcb99=['moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','Tag,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcb99,0x8b));var _0x9cb9=function(_0x12d2d7,_0x253ea8){_0x12d2d7=_0x12d2d7-0x0;var _0x1defcb=_0xcb99[_0x12d2d7];return _0x1defcb;};'use strict';var _=require(_0x9cb9('0x0'));var util=require('util');var moment=require(_0x9cb9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cb9('0x2'));var db=require(_0x9cb9('0x3'))['db'];var utils=require(_0x9cb9('0x4'));var logger=require('../../config/logger')(_0x9cb9('0x5'));var config=require(_0x9cb9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9cb9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ed26a,_0xa84493,_0x1bf9b7){return new BPromise(function(_0x1dd62f,_0x82e3e){return client[_0x9cb9('0x8')](_0x2ed26a,_0x1bf9b7)[_0x9cb9('0x9')](function(_0x3da50b){logger['info']('Tag,\x20%s,\x20%s',_0xa84493,_0x9cb9('0xa'));logger[_0x9cb9('0xb')](_0x9cb9('0xc'),_0xa84493,'request\x20sent',JSON[_0x9cb9('0xd')](_0x3da50b));if(_0x3da50b[_0x9cb9('0xe')]){if(_0x3da50b['error']['code']===0x1f4){logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);return _0x82e3e(_0x3da50b['error'][_0x9cb9('0x10')]);}logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);return _0x1dd62f(_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);}else{logger[_0x9cb9('0x11')](_0x9cb9('0xf'),_0xa84493,_0x9cb9('0xa'));_0x1dd62f(_0x3da50b[_0x9cb9('0x12')][_0x9cb9('0x10')]);}})[_0x9cb9('0x13')](function(_0x140910){logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x140910);_0x82e3e(_0x140910);});});} \ No newline at end of file +var _0xb66c=['../../config/environment','jayson/promise','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x5a1b72,_0x479ece){var _0x31d1fc=function(_0x46b53f){while(--_0x46b53f){_0x5a1b72['push'](_0x5a1b72['shift']());}};_0x31d1fc(++_0x479ece);}(_0xb66c,0x175));var _0xcb66=function(_0x473d25,_0xbab1c0){_0x473d25=_0x473d25-0x0;var _0x8f50d1=_0xb66c[_0x473d25];return _0x8f50d1;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var moment=require(_0xcb66('0x1'));var BPromise=require('bluebird');var rs=require(_0xcb66('0x2'));var fs=require('fs');var Redis=require(_0xcb66('0x3'));var db=require(_0xcb66('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb66('0x5'))(_0xcb66('0x6'));var config=require(_0xcb66('0x7'));var jayson=require(_0xcb66('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19adf5,_0x1b6852,_0xa3993){return new BPromise(function(_0x439f3d,_0xf7bc39){return client['request'](_0x19adf5,_0xa3993)[_0xcb66('0x9')](function(_0x3047f7){logger[_0xcb66('0xa')](_0xcb66('0xb'),_0x1b6852,_0xcb66('0xc'));logger['debug'](_0xcb66('0xd'),_0x1b6852,_0xcb66('0xc'),JSON[_0xcb66('0xe')](_0x3047f7));if(_0x3047f7[_0xcb66('0xf')]){if(_0x3047f7['error'][_0xcb66('0x10')]===0x1f4){logger[_0xcb66('0xf')](_0xcb66('0xb'),_0x1b6852,_0x3047f7[_0xcb66('0xf')]['message']);return _0xf7bc39(_0x3047f7[_0xcb66('0xf')][_0xcb66('0x11')]);}logger[_0xcb66('0xf')](_0xcb66('0xb'),_0x1b6852,_0x3047f7['error'][_0xcb66('0x11')]);return _0x439f3d(_0x3047f7['error'][_0xcb66('0x11')]);}else{logger['info'](_0xcb66('0xb'),_0x1b6852,'request\x20sent');_0x439f3d(_0x3047f7['result'][_0xcb66('0x11')]);}})[_0xcb66('0x12')](function(_0x681ce3){logger[_0xcb66('0xf')]('Tag,\x20%s,\x20%s',_0x1b6852,_0x681ce3);_0xf7bc39(_0x681ce3);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 18b61fa..331f11d 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 38c6ad7..3891a14 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 _0x0713=['STRING','name'];(function(_0x57bbd7,_0x5ada0d){var _0x476213=function(_0x416a01){while(--_0x416a01){_0x57bbd7['push'](_0x57bbd7['shift']());}};_0x476213(++_0x5ada0d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x1602fb,_0x20b6b3){var _0x461831=function(_0x4a19f1){while(--_0x4a19f1){_0x1602fb['push'](_0x1602fb['shift']());}};_0x461831(++_0x20b6b3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 20b2582..4224ca9 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 _0x25cd=['key','model','query','filters','intersection','attributes','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','length','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','transaction','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','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','UserVoicePrefix','VoicePrefixId','Teams','send','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','keys','capitalize','toLowerCase','Queue','addQueues','Queues','removeQueues','remove','ids','addAgents','Voice','Chat','Mail','Fax','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','all','TeamVoicePrefix','removeAgents','isArray','Sms','Openchannel','Whatsapp','user','Queue:remove','getAgents','options','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','error','stack','name','map','Team','fieldName','type'];(function(_0x28ee9c,_0x1ae563){var _0x36f796=function(_0x4b9d9a){while(--_0x4b9d9a){_0x28ee9c['push'](_0x28ee9c['shift']());}};_0x36f796(++_0x1ae563);}(_0x25cd,0x1a7));var _0xd25c=function(_0x45eacc,_0x3727a4){_0x45eacc=_0x45eacc-0x0;var _0x3f1252=_0x25cd[_0x45eacc];return _0x3f1252;};'use strict';var emlformat=require(_0xd25c('0x0'));var rimraf=require(_0xd25c('0x1'));var zipdir=require(_0xd25c('0x2'));var jsonpatch=require(_0xd25c('0x3'));var rp=require('request-promise');var moment=require(_0xd25c('0x4'));var BPromise=require(_0xd25c('0x5'));var Mustache=require(_0xd25c('0x6'));var util=require('util');var path=require(_0xd25c('0x7'));var sox=require('sox');var csv=require(_0xd25c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd25c('0x9'));var _=require('lodash');var squel=require(_0xd25c('0xa'));var crypto=require(_0xd25c('0xb'));var jsforce=require(_0xd25c('0xc'));var deskjs=require(_0xd25c('0xd'));var toCsv=require(_0xd25c('0x8'));var querystring=require(_0xd25c('0xe'));var Papa=require(_0xd25c('0xf'));var Redis=require(_0xd25c('0x10'));var authService=require(_0xd25c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd25c('0x12'));var logger=require(_0xd25c('0x13'))(_0xd25c('0x14'));var utils=require(_0xd25c('0x15'));var config=require(_0xd25c('0x16'));var licenseUtil=require(_0xd25c('0x17'));var db=require(_0xd25c('0x18'))['db'];config['redis']=_[_0xd25c('0x19')](config[_0xd25c('0x1a')],{'host':_0xd25c('0x1b'),'port':0x18eb});var socket=require(_0xd25c('0x1c'))(new Redis(config[_0xd25c('0x1a')]));require(_0xd25c('0x1d'))[_0xd25c('0x1e')](socket);function respondWithStatusCode(_0xe74f6c,_0x24b080){_0x24b080=_0x24b080||0xcc;return function(_0x2f7f43){if(_0x2f7f43){return _0xe74f6c[_0xd25c('0x1f')](_0x24b080);}return _0xe74f6c[_0xd25c('0x20')](_0x24b080)['end']();};}function respondWithResult(_0x353c9f,_0x350ad2){_0x350ad2=_0x350ad2||0xc8;return function(_0x3186c0){if(_0x3186c0){return _0x353c9f[_0xd25c('0x20')](_0x350ad2)[_0xd25c('0x21')](_0x3186c0);}};}function respondWithFilteredResult(_0x28953f,_0x6c5f18){return function(_0x32ba39){if(_0x32ba39){var _0x36a656=typeof _0x6c5f18['offset']===_0xd25c('0x22')&&typeof _0x6c5f18[_0xd25c('0x23')]==='undefined';var _0x42b748=_0x32ba39['count'];var _0x279049=_0x36a656?0x0:_0x6c5f18[_0xd25c('0x24')];var _0x41cd65=_0x36a656?_0x32ba39[_0xd25c('0x25')]:_0x6c5f18[_0xd25c('0x24')]+_0x6c5f18[_0xd25c('0x23')];var _0x14a658;if(_0x41cd65>=_0x42b748){_0x41cd65=_0x42b748;_0x14a658=0xc8;}else{_0x14a658=0xce;}_0x28953f[_0xd25c('0x20')](_0x14a658);return _0x28953f[_0xd25c('0x26')](_0xd25c('0x27'),_0x279049+'-'+_0x41cd65+'/'+_0x42b748)[_0xd25c('0x21')](_0x32ba39);}return null;};}function patchUpdates(_0x40a2b7){return function(_0x5d66a7){try{jsonpatch[_0xd25c('0x28')](_0x5d66a7,_0x40a2b7,!![]);}catch(_0x2f3b15){return BPromise['reject'](_0x2f3b15);}return _0x5d66a7[_0xd25c('0x29')]();};}function saveUpdates(_0x42837f,_0x501678){return function(_0x2509a3){if(_0x2509a3){return _0x2509a3[_0xd25c('0x2a')](_0x42837f)[_0xd25c('0x2b')](function(_0x184b64){return _0x184b64;});}return null;};}function handleEntityNotFound(_0x5dfa09,_0x1d6385){return function(_0x1ef8f3){if(!_0x1ef8f3){_0x5dfa09['sendStatus'](0x194);}return _0x1ef8f3;};}function handleError(_0x1a561a,_0x489441){_0x489441=_0x489441||0x1f4;return function(_0x574eff){logger[_0xd25c('0x2c')](_0x574eff[_0xd25c('0x2d')]);if(_0x574eff[_0xd25c('0x2e')]){delete _0x574eff[_0xd25c('0x2e')];}_0x1a561a['status'](_0x489441)['send'](_0x574eff);};}exports['index']=function(_0x4344bc,_0x3d8d83){var _0x282568={},_0x4c6cb8={},_0x505ae4={'count':0x0,'rows':[]};var _0x206ef6=_[_0xd25c('0x2f')](db[_0xd25c('0x30')]['rawAttributes'],function(_0x49e858){return{'name':_0x49e858[_0xd25c('0x31')],'type':_0x49e858[_0xd25c('0x32')][_0xd25c('0x33')]};});_0x4c6cb8[_0xd25c('0x34')]=_[_0xd25c('0x2f')](_0x206ef6,_0xd25c('0x2e'));_0x4c6cb8[_0xd25c('0x35')]=_['keys'](_0x4344bc[_0xd25c('0x35')]);_0x4c6cb8[_0xd25c('0x36')]=_[_0xd25c('0x37')](_0x4c6cb8[_0xd25c('0x34')],_0x4c6cb8['query']);_0x282568[_0xd25c('0x38')]=_[_0xd25c('0x37')](_0x4c6cb8[_0xd25c('0x34')],qs['fields'](_0x4344bc[_0xd25c('0x35')]['fields']));_0x282568[_0xd25c('0x38')]=_0x282568[_0xd25c('0x38')]['length']?_0x282568[_0xd25c('0x38')]:_0x4c6cb8[_0xd25c('0x34')];if(!_0x4344bc[_0xd25c('0x35')]['hasOwnProperty']('nolimit')){_0x282568[_0xd25c('0x23')]=qs[_0xd25c('0x23')](_0x4344bc['query']['limit']);_0x282568[_0xd25c('0x24')]=qs[_0xd25c('0x24')](_0x4344bc[_0xd25c('0x35')][_0xd25c('0x24')]);}_0x282568[_0xd25c('0x39')]=qs[_0xd25c('0x3a')](_0x4344bc[_0xd25c('0x35')][_0xd25c('0x3a')]);_0x282568['where']=qs[_0xd25c('0x36')](_[_0xd25c('0x3b')](_0x4344bc['query'],_0x4c6cb8[_0xd25c('0x36')]),_0x206ef6);if(_0x4344bc[_0xd25c('0x35')][_0xd25c('0x3c')]){_0x282568[_0xd25c('0x3d')]=_[_0xd25c('0x3e')](_0x282568[_0xd25c('0x3d')],{'$or':_[_0xd25c('0x2f')](_0x206ef6,function(_0x462f66){if(_0x462f66[_0xd25c('0x32')]!==_0xd25c('0x3f')){var _0x12f0b2={};_0x12f0b2[_0x462f66[_0xd25c('0x2e')]]={'$like':'%'+_0x4344bc['query'][_0xd25c('0x3c')]+'%'};return _0x12f0b2;}})});}_0x282568=_['merge']({},_0x282568,_0x4344bc['options']);var _0x370fc2={'where':_0x282568[_0xd25c('0x3d')]};return db[_0xd25c('0x30')][_0xd25c('0x25')](_0x370fc2)[_0xd25c('0x2b')](function(_0xf795c4){_0x505ae4[_0xd25c('0x25')]=_0xf795c4;if(_0x4344bc['query'][_0xd25c('0x40')]){_0x282568[_0xd25c('0x41')]=[{'all':!![]}];}return db[_0xd25c('0x30')][_0xd25c('0x42')](_0x282568);})[_0xd25c('0x2b')](function(_0x626ce7){_0x505ae4[_0xd25c('0x43')]=_0x626ce7;return _0x505ae4;})[_0xd25c('0x2b')](respondWithFilteredResult(_0x3d8d83,_0x282568))[_0xd25c('0x44')](handleError(_0x3d8d83,null));};exports[_0xd25c('0x45')]=function(_0x220cc8,_0x1554bc){var _0x20057f={'raw':![],'where':{'id':_0x220cc8[_0xd25c('0x46')]['id']}},_0x5501be={};_0x5501be[_0xd25c('0x34')]=_['keys'](db[_0xd25c('0x30')][_0xd25c('0x47')]);_0x5501be[_0xd25c('0x35')]=_['keys'](_0x220cc8[_0xd25c('0x35')]);_0x5501be['filters']=_[_0xd25c('0x37')](_0x5501be[_0xd25c('0x34')],_0x5501be['query']);_0x20057f[_0xd25c('0x38')]=_[_0xd25c('0x37')](_0x5501be['model'],qs[_0xd25c('0x48')](_0x220cc8[_0xd25c('0x35')]['fields']));_0x20057f[_0xd25c('0x38')]=_0x20057f[_0xd25c('0x38')][_0xd25c('0x49')]?_0x20057f[_0xd25c('0x38')]:_0x5501be[_0xd25c('0x34')];if(_0x220cc8['query'][_0xd25c('0x40')]){_0x20057f[_0xd25c('0x41')]=[{'all':!![]}];}_0x20057f=_['merge']({},_0x20057f,_0x220cc8['options']);return db[_0xd25c('0x30')]['find'](_0x20057f)[_0xd25c('0x2b')](handleEntityNotFound(_0x1554bc,null))[_0xd25c('0x2b')](respondWithResult(_0x1554bc,null))[_0xd25c('0x44')](handleError(_0x1554bc,null));};exports[_0xd25c('0x4a')]=function(_0x3ebb57,_0x360990){return db[_0xd25c('0x30')]['create'](_0x3ebb57['body'],{})[_0xd25c('0x2b')](function(_0x24ea1e){var _0xcdad01=_0x3ebb57['user'][_0xd25c('0x4b')]({'plain':!![]});if(!_0xcdad01)throw new Error(_0xd25c('0x4c'));if(_0xcdad01[_0xd25c('0x4d')]==='user'){var _0x3473e6=_0x24ea1e[_0xd25c('0x4b')]({'plain':!![]});var _0x510d89='Teams';return db[_0xd25c('0x4e')][_0xd25c('0x4f')]({'where':{'name':_0x510d89,'userProfileId':_0xcdad01[_0xd25c('0x50')]},'raw':!![]})[_0xd25c('0x2b')](function(_0x27b43a){if(_0x27b43a&&_0x27b43a[_0xd25c('0x51')]===0x0){return db[_0xd25c('0x52')][_0xd25c('0x4a')]({'name':_0x3473e6['name'],'resourceId':_0x3473e6['id'],'type':_0x27b43a['name'],'sectionId':_0x27b43a['id']},{})[_0xd25c('0x2b')](function(){return _0x24ea1e;});}else{return _0x24ea1e;}})[_0xd25c('0x44')](function(_0x513e27){logger['error'](_0xd25c('0x53'),_0x513e27);throw _0x513e27;});}return _0x24ea1e;})[_0xd25c('0x2b')](respondWithResult(_0x360990,0xc9))[_0xd25c('0x44')](handleError(_0x360990,null));};exports[_0xd25c('0x2a')]=function(_0x59cbb7,_0x51201d){if(_0x59cbb7['body']['id']){delete _0x59cbb7[_0xd25c('0x54')]['id'];}return db[_0xd25c('0x30')][_0xd25c('0x4f')]({'where':{'id':_0x59cbb7[_0xd25c('0x46')]['id']}})[_0xd25c('0x2b')](handleEntityNotFound(_0x51201d,null))[_0xd25c('0x2b')](saveUpdates(_0x59cbb7[_0xd25c('0x54')],null))[_0xd25c('0x2b')](respondWithResult(_0x51201d,null))[_0xd25c('0x44')](handleError(_0x51201d,null));};exports[_0xd25c('0x55')]=function(_0x3d3eed,_0x182ea1){var _0x18ebdc=_0x3d3eed[_0xd25c('0x46')]['id'];var _0x339980=[];return db[_0xd25c('0x56')][_0xd25c('0x57')](function(_0x2d8716){var _0x3d82be='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x18ebdc;return db['sequelize'][_0xd25c('0x35')](_0x3d82be,{'type':db[_0xd25c('0x58')][_0xd25c('0x59')]['SELECT'],'raw':!![],'transaction':_0x2d8716})[_0xd25c('0x2b')](function(_0x3a69a7){_0x339980=_[_0xd25c('0x2f')](_0x3a69a7,function(_0x426797){return Number(_0x426797[_0xd25c('0x5a')]);});})['then'](function(){var _0x513252=_0xd25c('0x5b')+_0x18ebdc;return db[_0xd25c('0x56')][_0xd25c('0x35')](_0x513252,{'type':db[_0xd25c('0x58')][_0xd25c('0x59')][_0xd25c('0x5c')],'raw':!![],'transaction':_0x2d8716});})['then'](function(_0x303afb){var _0x291a93=_['map'](_0x303afb,function(_0x350c38){return Number(_0x350c38['VoiceQueueId']);});return db['UserVoiceQueue'][_0xd25c('0x55')]({'where':{'UserId':{'$in':_0x339980},'VoiceQueueId':{'$in':_0x291a93}},'transaction':_0x2d8716});})[_0xd25c('0x2b')](function(){var _0xc96d94='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x18ebdc;return db[_0xd25c('0x56')][_0xd25c('0x35')](_0xc96d94,{'type':db[_0xd25c('0x58')][_0xd25c('0x59')]['SELECT'],'raw':!![],'transaction':_0x2d8716});})[_0xd25c('0x2b')](function(_0xf82a32){var _0x13a9b7=_[_0xd25c('0x2f')](_0xf82a32,function(_0x1c4ed4){return Number(_0x1c4ed4[_0xd25c('0x5d')]);});return db[_0xd25c('0x5e')][_0xd25c('0x55')]({'where':{'UserId':{'$in':_0x339980},'MailQueueId':{'$in':_0x13a9b7}},'transaction':_0x2d8716});})[_0xd25c('0x2b')](function(){var _0x4d0157='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x18ebdc;return db[_0xd25c('0x56')][_0xd25c('0x35')](_0x4d0157,{'type':db['Sequelize'][_0xd25c('0x59')][_0xd25c('0x5c')],'raw':!![],'transaction':_0x2d8716});})[_0xd25c('0x2b')](function(_0x2adc0d){var _0x88fd58=_[_0xd25c('0x2f')](_0x2adc0d,function(_0x3b5c57){return Number(_0x3b5c57[_0xd25c('0x5f')]);});return db[_0xd25c('0x60')][_0xd25c('0x55')]({'where':{'UserId':{'$in':_0x339980},'SmsQueueId':{'$in':_0x88fd58}},'transaction':_0x2d8716});})['then'](function(){var _0x11209a=_0xd25c('0x61')+_0x18ebdc;return db[_0xd25c('0x56')][_0xd25c('0x35')](_0x11209a,{'type':db[_0xd25c('0x58')][_0xd25c('0x59')][_0xd25c('0x5c')],'raw':!![],'transaction':_0x2d8716});})[_0xd25c('0x2b')](function(_0xa2506e){var _0x2918ca=_['map'](_0xa2506e,function(_0x3ce77a){return Number(_0x3ce77a['ChatQueueId']);});return db[_0xd25c('0x62')]['destroy']({'where':{'UserId':{'$in':_0x339980},'ChatQueueId':{'$in':_0x2918ca}},'transaction':_0x2d8716});})[_0xd25c('0x2b')](function(){var _0x4e528d=_0xd25c('0x63')+_0x18ebdc;return db[_0xd25c('0x56')]['query'](_0x4e528d,{'type':db['Sequelize']['QueryTypes'][_0xd25c('0x5c')],'raw':!![],'transaction':_0x2d8716});})[_0xd25c('0x2b')](function(_0x340232){var _0x242ba2=_[_0xd25c('0x2f')](_0x340232,function(_0x39c7df){return Number(_0x39c7df['FaxQueueId']);});return db[_0xd25c('0x64')]['destroy']({'where':{'UserId':{'$in':_0x339980},'FaxQueueId':{'$in':_0x242ba2}},'transaction':_0x2d8716});})[_0xd25c('0x2b')](function(){var _0x539b9c=_0xd25c('0x65')+_0x18ebdc;return db[_0xd25c('0x56')][_0xd25c('0x35')](_0x539b9c,{'type':db[_0xd25c('0x58')][_0xd25c('0x59')][_0xd25c('0x5c')],'raw':!![],'transaction':_0x2d8716});})[_0xd25c('0x2b')](function(_0x2350b6){var _0x1ccc7a=_['map'](_0x2350b6,function(_0x2f17b1){return Number(_0x2f17b1[_0xd25c('0x66')]);});return db[_0xd25c('0x67')][_0xd25c('0x55')]({'where':{'UserId':{'$in':_0x339980},'OpenchannelQueueId':{'$in':_0x1ccc7a}},'transaction':_0x2d8716});})[_0xd25c('0x2b')](function(){var _0x5474cd=_0xd25c('0x68')+_0x18ebdc;return db[_0xd25c('0x56')][_0xd25c('0x35')](_0x5474cd,{'type':db[_0xd25c('0x58')][_0xd25c('0x59')][_0xd25c('0x5c')],'raw':!![],'transaction':_0x2d8716});})['then'](function(_0x19bc96){var _0x12f99e=_[_0xd25c('0x2f')](_0x19bc96,function(_0x24163c){return Number(_0x24163c[_0xd25c('0x69')]);});return db[_0xd25c('0x6a')][_0xd25c('0x55')]({'where':{'UserId':{'$in':_0x339980},'WhatsappQueueId':{'$in':_0x12f99e}},'transaction':_0x2d8716});})[_0xd25c('0x2b')](function(){return db['TeamVoicePrefix'][_0xd25c('0x4f')]({'where':{'TeamId':_0x18ebdc}});})[_0xd25c('0x2b')](function(_0x1b24c7){if(_0x1b24c7===null){return;}return db[_0xd25c('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x339980},'VoicePrefixId':_0x1b24c7[_0xd25c('0x6c')]},'transaction':_0x2d8716});})['then'](function(){return db[_0xd25c('0x30')]['destroy']({'where':{'id':_0x18ebdc},'cascade':!![],'transaction':_0x2d8716});})[_0xd25c('0x2b')](function(_0x593d2c){if(_0x593d2c===0x0){_0x182ea1[_0xd25c('0x1f')](0x194);}else{return db[_0xd25c('0x52')][_0xd25c('0x55')]({'where':{'type':_0xd25c('0x6d'),'resourceId':_0x18ebdc},'cascade':!![],'transaction':_0x2d8716})[_0xd25c('0x2b')](function(){_0x182ea1[_0xd25c('0x20')](0xcc)['end']();});}})[_0xd25c('0x44')](function(_0x581d23){_0x182ea1[_0xd25c('0x20')](0x1f4)[_0xd25c('0x6e')](_0x581d23);});});};exports[_0xd25c('0x6f')]=function(_0x4af7af,_0x2538f5,_0x3aa697){return db[_0xd25c('0x30')][_0xd25c('0x70')]({'where':{'id':_0x4af7af[_0xd25c('0x46')]['id']}})[_0xd25c('0x2b')](handleEntityNotFound(_0x2538f5,null))['then'](function(_0x468ca4){if(!_0x4af7af[_0xd25c('0x35')][_0xd25c('0x71')]||!utils[_0xd25c('0x72')](_0x4af7af['query'][_0xd25c('0x71')])){throw new db[(_0xd25c('0x58'))][(_0xd25c('0x73'))](_0xd25c('0x74'));}var _0x122b64={};var _0x236bee={};_0x236bee[_0xd25c('0x34')]=_[_0xd25c('0x75')](db[_[_0xd25c('0x76')](_0x4af7af['query'][_0xd25c('0x71')][_0xd25c('0x77')]())+_0xd25c('0x78')]['rawAttributes']);_0x236bee['query']=_['keys'](_0x4af7af[_0xd25c('0x35')]);_0x236bee[_0xd25c('0x36')]=_['intersection'](_0x236bee[_0xd25c('0x34')],_0x236bee[_0xd25c('0x35')]);_0x122b64[_0xd25c('0x38')]=_[_0xd25c('0x37')](_0x236bee[_0xd25c('0x34')],qs[_0xd25c('0x48')](_0x4af7af[_0xd25c('0x35')][_0xd25c('0x48')]));_0x122b64[_0xd25c('0x38')]=_0x122b64['attributes'][_0xd25c('0x49')]?_0x122b64['attributes']:_0x236bee[_0xd25c('0x34')];_0x122b64['limit']=qs[_0xd25c('0x23')](_0x4af7af[_0xd25c('0x35')]['limit']);_0x122b64[_0xd25c('0x24')]=qs[_0xd25c('0x24')](_0x4af7af[_0xd25c('0x35')][_0xd25c('0x24')]);_0x122b64[_0xd25c('0x39')]=qs[_0xd25c('0x3a')](_0x4af7af[_0xd25c('0x35')][_0xd25c('0x3a')]);_0x122b64[_0xd25c('0x3d')]=qs[_0xd25c('0x36')](_[_0xd25c('0x3b')](_0x4af7af[_0xd25c('0x35')],_0x236bee[_0xd25c('0x36')]));_0x122b64=_[_0xd25c('0x3e')]({},_0x122b64,_0x4af7af['options']);return _0x468ca4[_0xd25c('0x4b')+_['capitalize'](_0x4af7af[_0xd25c('0x35')]['channel'][_0xd25c('0x77')]())+'Queues'](_0x122b64);})['then'](respondWithResult(_0x2538f5,null))[_0xd25c('0x44')](handleError(_0x2538f5,null));};exports[_0xd25c('0x79')]=function(_0x294a7f,_0x5c3b86,_0x4b79d4){return db[_0xd25c('0x30')]['findOne']({'where':{'id':_0x294a7f[_0xd25c('0x46')]['id']}})[_0xd25c('0x2b')](function(_0x9c3887){if(_0x9c3887){if(!_0x294a7f['body'][_0xd25c('0x71')]||!utils[_0xd25c('0x72')](_0x294a7f['body'][_0xd25c('0x71')])){throw new db[(_0xd25c('0x58'))][(_0xd25c('0x73'))](_0xd25c('0x74'));}return _0x9c3887['add'+_[_0xd25c('0x76')](_0x294a7f[_0xd25c('0x54')][_0xd25c('0x71')][_0xd25c('0x77')]())+_0xd25c('0x7a')](_0x294a7f['body']['ids']);}return null;})['then'](handleEntityNotFound(_0x5c3b86,null))[_0xd25c('0x2b')](respondWithStatusCode(_0x5c3b86,null))['catch'](handleError(_0x5c3b86,null));};exports[_0xd25c('0x7b')]=function(_0x46b09f,_0xa5052d,_0x20095b){return db[_0xd25c('0x30')][_0xd25c('0x70')]({'where':{'id':_0x46b09f[_0xd25c('0x46')]['id']}})[_0xd25c('0x2b')](function(_0x2670b6){if(_0x2670b6){if(!_0x46b09f[_0xd25c('0x35')][_0xd25c('0x71')]||!utils[_0xd25c('0x72')](_0x46b09f[_0xd25c('0x35')][_0xd25c('0x71')])){throw new db[(_0xd25c('0x58'))]['ValidationError'](_0xd25c('0x74'));}return _0x2670b6[_0xd25c('0x7c')+_[_0xd25c('0x76')](_0x46b09f[_0xd25c('0x35')][_0xd25c('0x71')]['toLowerCase']())+_0xd25c('0x7a')](_0x46b09f[_0xd25c('0x35')][_0xd25c('0x7d')]);}return null;})[_0xd25c('0x2b')](handleEntityNotFound(_0xa5052d,null))[_0xd25c('0x2b')](respondWithStatusCode(_0xa5052d,null))[_0xd25c('0x44')](handleError(_0xa5052d,null));};exports[_0xd25c('0x7e')]=function(_0x51b0a5,_0x117958){var _0x3287f4=_['isArray'](_0x51b0a5[_0xd25c('0x54')][_0xd25c('0x7d')])?_0x51b0a5[_0xd25c('0x54')]['ids']:[_0x51b0a5[_0xd25c('0x54')][_0xd25c('0x7d')]];var _0x49c715=_0x51b0a5[_0xd25c('0x46')]['id'];return db[_0xd25c('0x30')][_0xd25c('0x4f')]({'where':{'id':_0x49c715}})['then'](handleEntityNotFound(_0x117958,null))[_0xd25c('0x2b')](function(_0x138e1e){if(_0x138e1e){var _0x7a2e8c=[_0xd25c('0x7f'),_0xd25c('0x80'),_0xd25c('0x81'),'Sms',_0xd25c('0x82'),'Openchannel','Whatsapp'];return db[_0xd25c('0x56')][_0xd25c('0x57')](function(_0x164eab){var _0x525b72=_['map'](_0x7a2e8c,function(_0x39ce9){var _0x32b11f={'attributes':['id',_0xd25c('0x2e')]};if(_0x39ce9==='Voice'){_0x32b11f['through']={'attributes':[_0xd25c('0x83')]};}return _0x138e1e[_0xd25c('0x4b')+_0x39ce9+'Queues'](_0x32b11f)[_0xd25c('0x2b')](function(_0xed8a30){var _0xdd154e=_[_0xd25c('0x2f')](_0xed8a30,function(_0x4abf3d){var _0x16d1cb=_['map'](_0x3287f4,function(_0x2fed94){var _0x37260a={'where':{'UserId':_0x2fed94,[_0x39ce9+_0xd25c('0x84')]:_0x4abf3d['id']},'transaction':_0x164eab};if(_0x39ce9==='Voice'){_0x37260a[_0xd25c('0x19')]={'penalty':_0x4abf3d[_0xd25c('0x85')][_0xd25c('0x83')]};}return db[_0xd25c('0x86')+_0x39ce9+_0xd25c('0x78')][_0xd25c('0x87')](_0x37260a)[_0xd25c('0x2b')](function(){socket[_0xd25c('0x88')]('user'+_0x39ce9+'Queue:save',{'UserId':_0x2fed94,[_0x39ce9+_0xd25c('0x84')]:_0x4abf3d['id']});if(_0x39ce9!==_0xd25c('0x7f')){return;}return db[_0xd25c('0x86')][_0xd25c('0x42')]({'where':{'id':_0x3287f4,'online':0x1},'attributes':['id',_0xd25c('0x2e'),_0xd25c('0x89'),_0xd25c('0x8a'),'interface'],'raw':!![]})[_0xd25c('0x2b')](function(_0x5de358){var _0xeb2a31=_[_0xd25c('0x2f')](_0x5de358,function(_0x47818f){return db[_0xd25c('0x8b')][_0xd25c('0x8c')]({'membername':_0x47818f[_0xd25c('0x2e')],'UserId':_0x47818f['id'],'queue_name':_0x4abf3d[_0xd25c('0x2e')],'VoiceQueueId':_0x4abf3d['id'],'interface':_[_0xd25c('0x8d')](_0x47818f[_0xd25c('0x8e')])?util[_0xd25c('0x8f')](_0xd25c('0x90'),_0x47818f['name']):_0x47818f[_0xd25c('0x8e')],'paused':_0x47818f[_0xd25c('0x8a')]||![],'penalty':_0x4abf3d[_0xd25c('0x85')][_0xd25c('0x83')]},{'transaction':_0x164eab});});return Promise[_0xd25c('0x91')](_0xeb2a31);});});});return Promise['all'](_0x16d1cb);});return Promise[_0xd25c('0x91')](_0xdd154e);})[_0xd25c('0x2b')](function(){return db[_0xd25c('0x92')][_0xd25c('0x70')]({'where':{'teamId':_0x49c715}})[_0xd25c('0x2b')](function(_0x1d7b25){if(_0x1d7b25){var _0x3cc982=_[_0xd25c('0x2f')](_0x3287f4,function(_0x48fac4){db['UserVoicePrefix']['upsert']({'UserId':_0x48fac4,'VoicePrefixId':_0x1d7b25['VoicePrefixId']});});return Promise[_0xd25c('0x91')](_0x3cc982);}});});});return Promise[_0xd25c('0x91')](_0x525b72)[_0xd25c('0x2b')](function(){return _0x138e1e[_0xd25c('0x7e')](_0x3287f4,{'transaction':_0x164eab})['spread'](function(_0x5d81af){return _0x5d81af;});});});}})[_0xd25c('0x2b')](respondWithResult(_0x117958,null))[_0xd25c('0x44')](handleError(_0x117958,null));};exports[_0xd25c('0x93')]=function(_0x11682a,_0x3b17b5){var _0x2c6ba8=_[_0xd25c('0x94')](_0x11682a[_0xd25c('0x35')][_0xd25c('0x7d')])?_0x11682a[_0xd25c('0x35')][_0xd25c('0x7d')]:[_0x11682a[_0xd25c('0x35')][_0xd25c('0x7d')]];var _0x8f37fe=_0x11682a[_0xd25c('0x46')]['id'];return db[_0xd25c('0x30')][_0xd25c('0x4f')]({'where':{'id':_0x8f37fe}})[_0xd25c('0x2b')](handleEntityNotFound(_0x3b17b5,null))[_0xd25c('0x2b')](function(_0x2e86ed){if(_0x2e86ed){var _0x4cfeae=[_0xd25c('0x7f'),_0xd25c('0x80'),_0xd25c('0x81'),_0xd25c('0x95'),_0xd25c('0x82'),_0xd25c('0x96'),_0xd25c('0x97')];return db[_0xd25c('0x56')]['transaction'](function(_0x104a31){var _0x47ef95=_[_0xd25c('0x2f')](_0x4cfeae,function(_0x269d8c){var _0x8b12e1={'attributes':['id','name']};return _0x2e86ed[_0xd25c('0x4b')+_0x269d8c+_0xd25c('0x7a')](_0x8b12e1)[_0xd25c('0x2b')](function(_0x1a11eb){var _0x4c9dfb=_[_0xd25c('0x2f')](_0x1a11eb,function(_0x43f478){return _0x43f478[_0xd25c('0x93')](_0x2c6ba8,{'transaction':_0x104a31})['then'](function(){var _0x422951=_[_0xd25c('0x2f')](_0x2c6ba8,function(_0x5585e0){socket[_0xd25c('0x88')](_0xd25c('0x98')+_0x269d8c+_0xd25c('0x99'),{'UserId':Number(_0x5585e0),[_0x269d8c+_0xd25c('0x84')]:_0x43f478['id']});if(_0x269d8c!==_0xd25c('0x7f')){return;}return db['UserVoiceQueueRt'][_0xd25c('0x55')]({'where':{'VoiceQueueId':_0x43f478['id'],'UserId':_0x5585e0},'transaction':_0x104a31});});return Promise[_0xd25c('0x91')](_0x422951);});});return Promise[_0xd25c('0x91')](_0x4c9dfb);});});return Promise['all'](_0x47ef95)[_0xd25c('0x2b')](function(){return _0x2e86ed[_0xd25c('0x93')](_0x2c6ba8,{'transaction':_0x104a31});})[_0xd25c('0x2b')](function(){return db[_0xd25c('0x92')]['findOne']({'where':{'teamId':_0x8f37fe}})['then'](function(_0x32ccd4){if(_0x32ccd4){var _0x3f376c=_['map'](_0x2c6ba8,function(_0x11c0a9){db['UserVoicePrefix'][_0xd25c('0x55')]({'where':{'UserId':_0x11c0a9,'VoicePrefixId':_0x32ccd4['VoicePrefixId']}});});return Promise[_0xd25c('0x91')](_0x3f376c);}});});});}})['then'](respondWithStatusCode(_0x3b17b5,null))['catch'](handleError(_0x3b17b5,null));};exports[_0xd25c('0x9a')]=function(_0x4c0b4d,_0x206c09,_0x35a1dc){var _0x2de062={};var _0x42f36c={};var _0x2ad665;var _0x3f8496;return db[_0xd25c('0x30')]['findOne']({'where':{'id':_0x4c0b4d['params']['id']}})[_0xd25c('0x2b')](handleEntityNotFound(_0x206c09,null))[_0xd25c('0x2b')](function(_0x37d619){if(_0x37d619){_0x2ad665=_0x37d619;_0x42f36c[_0xd25c('0x34')]=_[_0xd25c('0x75')](db[_0xd25c('0x86')]['rawAttributes']);_0x42f36c['query']=_[_0xd25c('0x75')](_0x4c0b4d[_0xd25c('0x35')]);_0x42f36c[_0xd25c('0x36')]=_[_0xd25c('0x37')](_0x42f36c[_0xd25c('0x34')],_0x42f36c['query']);_0x2de062[_0xd25c('0x38')]=_[_0xd25c('0x37')](_0x42f36c['model'],qs[_0xd25c('0x48')](_0x4c0b4d[_0xd25c('0x35')][_0xd25c('0x48')]));_0x2de062[_0xd25c('0x38')]=_0x2de062['attributes']['length']?_0x2de062[_0xd25c('0x38')]:_0x42f36c[_0xd25c('0x34')];_0x2de062[_0xd25c('0x39')]=qs[_0xd25c('0x3a')](_0x4c0b4d[_0xd25c('0x35')][_0xd25c('0x3a')]);_0x2de062[_0xd25c('0x3d')]=qs[_0xd25c('0x36')](_[_0xd25c('0x3b')](_0x4c0b4d[_0xd25c('0x35')],_0x42f36c[_0xd25c('0x36')]));if(_0x4c0b4d['query'][_0xd25c('0x3c')]){_0x2de062[_0xd25c('0x3d')]=_['merge'](_0x2de062[_0xd25c('0x3d')],{'$or':_['map'](_0x2de062[_0xd25c('0x38')],function(_0x4922b9){var _0x2e7263={};_0x2e7263[_0x4922b9]={'$like':'%'+_0x4c0b4d[_0xd25c('0x35')][_0xd25c('0x3c')]+'%'};return _0x2e7263;})});}_0x2de062=_[_0xd25c('0x3e')]({},_0x2de062,_0x4c0b4d[_0xd25c('0x9b')]);return _0x2ad665[_0xd25c('0x9a')](_0x2de062);}})[_0xd25c('0x2b')](function(_0x351f32){if(_0x351f32){_0x3f8496=_0x351f32['length'];if(!_0x4c0b4d[_0xd25c('0x35')][_0xd25c('0x9c')](_0xd25c('0x9d'))){_0x2de062[_0xd25c('0x23')]=qs['limit'](_0x4c0b4d['query'][_0xd25c('0x23')]);_0x2de062[_0xd25c('0x24')]=qs['offset'](_0x4c0b4d[_0xd25c('0x35')][_0xd25c('0x24')]);}return _0x2ad665[_0xd25c('0x9a')](_0x2de062);}})[_0xd25c('0x2b')](function(_0x16fe22){if(_0x16fe22){return _0x16fe22?{'count':_0x3f8496,'rows':_0x16fe22}:null;}})[_0xd25c('0x2b')](respondWithResult(_0x206c09,null))[_0xd25c('0x44')](handleError(_0x206c09,null));}; \ No newline at end of file +var _0xdb80=['VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','FaxQueueId','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','TeamVoicePrefix','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','rawAttributes','add','Queues','ids','removeQueues','remove','isArray','Voice','Chat','Mail','Sms','Fax','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','online','voicePause','interface','UserVoiceQueueRt','format','all','UserVoicePrefix','upsert','VoicePrefixId','spread','removeAgents','Whatsapp','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','stack','name','send','index','map','Team','type','key','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','then','catch','show','params','keys','intersection','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'];(function(_0x3e33b9,_0x52d9a5){var _0x2fe330=function(_0x559167){while(--_0x559167){_0x3e33b9['push'](_0x3e33b9['shift']());}};_0x2fe330(++_0x52d9a5);}(_0xdb80,0x167));var _0x0db8=function(_0x58257c,_0x26762b){_0x58257c=_0x58257c-0x0;var _0x407df3=_0xdb80[_0x58257c];return _0x407df3;};'use strict';var emlformat=require(_0x0db8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0db8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0db8('0x2'));var moment=require(_0x0db8('0x3'));var BPromise=require(_0x0db8('0x4'));var Mustache=require('mustache');var util=require(_0x0db8('0x5'));var path=require(_0x0db8('0x6'));var sox=require(_0x0db8('0x7'));var csv=require('to-csv');var ejs=require(_0x0db8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0db8('0x9'));var squel=require(_0x0db8('0xa'));var crypto=require('crypto');var jsforce=require(_0x0db8('0xb'));var deskjs=require(_0x0db8('0xc'));var toCsv=require(_0x0db8('0xd'));var querystring=require('querystring');var Papa=require(_0x0db8('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0db8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0db8('0x10'))('api');var utils=require(_0x0db8('0x11'));var config=require(_0x0db8('0x12'));var licenseUtil=require(_0x0db8('0x13'));var db=require(_0x0db8('0x14'))['db'];config[_0x0db8('0x15')]=_[_0x0db8('0x16')](config[_0x0db8('0x15')],{'host':_0x0db8('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0db8('0x18'))[_0x0db8('0x19')](socket);function respondWithStatusCode(_0x4286d1,_0x31f8eb){_0x31f8eb=_0x31f8eb||0xcc;return function(_0x63722e){if(_0x63722e){return _0x4286d1[_0x0db8('0x1a')](_0x31f8eb);}return _0x4286d1[_0x0db8('0x1b')](_0x31f8eb)[_0x0db8('0x1c')]();};}function respondWithResult(_0x21ada7,_0x4506bf){_0x4506bf=_0x4506bf||0xc8;return function(_0x1d0064){if(_0x1d0064){return _0x21ada7['status'](_0x4506bf)[_0x0db8('0x1d')](_0x1d0064);}};}function respondWithFilteredResult(_0x514b7c,_0x5c0be0){return function(_0xf74ee){if(_0xf74ee){var _0x28fc46=typeof _0x5c0be0[_0x0db8('0x1e')]===_0x0db8('0x1f')&&typeof _0x5c0be0['limit']===_0x0db8('0x1f');var _0x46fa0a=_0xf74ee[_0x0db8('0x20')];var _0x573455=_0x28fc46?0x0:_0x5c0be0['offset'];var _0xfab8fc=_0x28fc46?_0xf74ee['count']:_0x5c0be0[_0x0db8('0x1e')]+_0x5c0be0[_0x0db8('0x21')];var _0x13105a;if(_0xfab8fc>=_0x46fa0a){_0xfab8fc=_0x46fa0a;_0x13105a=0xc8;}else{_0x13105a=0xce;}_0x514b7c[_0x0db8('0x1b')](_0x13105a);return _0x514b7c[_0x0db8('0x22')]('Content-Range',_0x573455+'-'+_0xfab8fc+'/'+_0x46fa0a)['json'](_0xf74ee);}return null;};}function patchUpdates(_0x5ed2a9){return function(_0xab882f){try{jsonpatch[_0x0db8('0x23')](_0xab882f,_0x5ed2a9,!![]);}catch(_0x5eff71){return BPromise['reject'](_0x5eff71);}return _0xab882f[_0x0db8('0x24')]();};}function saveUpdates(_0x44cf6f,_0x3ff0de){return function(_0x4e8200){if(_0x4e8200){return _0x4e8200[_0x0db8('0x25')](_0x44cf6f)['then'](function(_0x3c5672){return _0x3c5672;});}return null;};}function handleEntityNotFound(_0x57079a,_0x5b5df0){return function(_0x393610){if(!_0x393610){_0x57079a[_0x0db8('0x1a')](0x194);}return _0x393610;};}function handleError(_0x1031b5,_0x323659){_0x323659=_0x323659||0x1f4;return function(_0x22a4e9){logger['error'](_0x22a4e9[_0x0db8('0x26')]);if(_0x22a4e9[_0x0db8('0x27')]){delete _0x22a4e9[_0x0db8('0x27')];}_0x1031b5[_0x0db8('0x1b')](_0x323659)[_0x0db8('0x28')](_0x22a4e9);};}exports[_0x0db8('0x29')]=function(_0x509a0d,_0x533d8c){var _0x15e65f={},_0x3b2349={},_0x3d8608={'count':0x0,'rows':[]};var _0x48a17a=_[_0x0db8('0x2a')](db[_0x0db8('0x2b')]['rawAttributes'],function(_0x5b6800){return{'name':_0x5b6800['fieldName'],'type':_0x5b6800[_0x0db8('0x2c')][_0x0db8('0x2d')]};});_0x3b2349['model']=_['map'](_0x48a17a,_0x0db8('0x27'));_0x3b2349[_0x0db8('0x2e')]=_['keys'](_0x509a0d[_0x0db8('0x2e')]);_0x3b2349[_0x0db8('0x2f')]=_['intersection'](_0x3b2349[_0x0db8('0x30')],_0x3b2349[_0x0db8('0x2e')]);_0x15e65f['attributes']=_['intersection'](_0x3b2349[_0x0db8('0x30')],qs['fields'](_0x509a0d['query'][_0x0db8('0x31')]));_0x15e65f[_0x0db8('0x32')]=_0x15e65f[_0x0db8('0x32')][_0x0db8('0x33')]?_0x15e65f['attributes']:_0x3b2349[_0x0db8('0x30')];if(!_0x509a0d[_0x0db8('0x2e')][_0x0db8('0x34')](_0x0db8('0x35'))){_0x15e65f[_0x0db8('0x21')]=qs[_0x0db8('0x21')](_0x509a0d[_0x0db8('0x2e')][_0x0db8('0x21')]);_0x15e65f[_0x0db8('0x1e')]=qs[_0x0db8('0x1e')](_0x509a0d[_0x0db8('0x2e')]['offset']);}_0x15e65f[_0x0db8('0x36')]=qs[_0x0db8('0x37')](_0x509a0d[_0x0db8('0x2e')]['sort']);_0x15e65f[_0x0db8('0x38')]=qs[_0x0db8('0x2f')](_[_0x0db8('0x39')](_0x509a0d[_0x0db8('0x2e')],_0x3b2349[_0x0db8('0x2f')]),_0x48a17a);if(_0x509a0d[_0x0db8('0x2e')][_0x0db8('0x3a')]){_0x15e65f[_0x0db8('0x38')]=_[_0x0db8('0x3b')](_0x15e65f['where'],{'$or':_['map'](_0x48a17a,function(_0x89c0fe){if(_0x89c0fe['type']!==_0x0db8('0x3c')){var _0x2e1955={};_0x2e1955[_0x89c0fe[_0x0db8('0x27')]]={'$like':'%'+_0x509a0d[_0x0db8('0x2e')][_0x0db8('0x3a')]+'%'};return _0x2e1955;}})});}_0x15e65f=_[_0x0db8('0x3b')]({},_0x15e65f,_0x509a0d[_0x0db8('0x3d')]);var _0x1bf00b={'where':_0x15e65f[_0x0db8('0x38')]};return db[_0x0db8('0x2b')][_0x0db8('0x20')](_0x1bf00b)['then'](function(_0x2aabeb){_0x3d8608['count']=_0x2aabeb;if(_0x509a0d[_0x0db8('0x2e')]['includeAll']){_0x15e65f['include']=[{'all':!![]}];}return db[_0x0db8('0x2b')][_0x0db8('0x3e')](_0x15e65f);})['then'](function(_0x3981bd){_0x3d8608[_0x0db8('0x3f')]=_0x3981bd;return _0x3d8608;})[_0x0db8('0x40')](respondWithFilteredResult(_0x533d8c,_0x15e65f))[_0x0db8('0x41')](handleError(_0x533d8c,null));};exports[_0x0db8('0x42')]=function(_0xee8345,_0x11531b){var _0x4277b6={'raw':![],'where':{'id':_0xee8345[_0x0db8('0x43')]['id']}},_0x21d336={};_0x21d336['model']=_[_0x0db8('0x44')](db[_0x0db8('0x2b')]['rawAttributes']);_0x21d336['query']=_['keys'](_0xee8345[_0x0db8('0x2e')]);_0x21d336[_0x0db8('0x2f')]=_['intersection'](_0x21d336[_0x0db8('0x30')],_0x21d336['query']);_0x4277b6[_0x0db8('0x32')]=_[_0x0db8('0x45')](_0x21d336[_0x0db8('0x30')],qs[_0x0db8('0x31')](_0xee8345[_0x0db8('0x2e')][_0x0db8('0x31')]));_0x4277b6['attributes']=_0x4277b6[_0x0db8('0x32')]['length']?_0x4277b6['attributes']:_0x21d336[_0x0db8('0x30')];if(_0xee8345[_0x0db8('0x2e')][_0x0db8('0x46')]){_0x4277b6[_0x0db8('0x47')]=[{'all':!![]}];}_0x4277b6=_['merge']({},_0x4277b6,_0xee8345[_0x0db8('0x3d')]);return db['Team'][_0x0db8('0x48')](_0x4277b6)['then'](handleEntityNotFound(_0x11531b,null))['then'](respondWithResult(_0x11531b,null))[_0x0db8('0x41')](handleError(_0x11531b,null));};exports[_0x0db8('0x49')]=function(_0x4cf447,_0x434a53){return db[_0x0db8('0x2b')][_0x0db8('0x49')](_0x4cf447[_0x0db8('0x4a')],{})[_0x0db8('0x40')](function(_0x148d20){var _0x51b088=_0x4cf447[_0x0db8('0x4b')]['get']({'plain':!![]});if(!_0x51b088)throw new Error(_0x0db8('0x4c'));if(_0x51b088[_0x0db8('0x4d')]===_0x0db8('0x4b')){var _0x1d6567=_0x148d20[_0x0db8('0x4e')]({'plain':!![]});var _0x360bd6=_0x0db8('0x4f');return db[_0x0db8('0x50')][_0x0db8('0x48')]({'where':{'name':_0x360bd6,'userProfileId':_0x51b088[_0x0db8('0x51')]},'raw':!![]})[_0x0db8('0x40')](function(_0x456df1){if(_0x456df1&&_0x456df1[_0x0db8('0x52')]===0x0){return db[_0x0db8('0x53')][_0x0db8('0x49')]({'name':_0x1d6567[_0x0db8('0x27')],'resourceId':_0x1d6567['id'],'type':_0x456df1['name'],'sectionId':_0x456df1['id']},{})[_0x0db8('0x40')](function(){return _0x148d20;});}else{return _0x148d20;}})[_0x0db8('0x41')](function(_0x43af9b){logger['error'](_0x0db8('0x54'),_0x43af9b);throw _0x43af9b;});}return _0x148d20;})['then'](respondWithResult(_0x434a53,0xc9))['catch'](handleError(_0x434a53,null));};exports[_0x0db8('0x25')]=function(_0x5efbcb,_0x3bd88c){if(_0x5efbcb[_0x0db8('0x4a')]['id']){delete _0x5efbcb['body']['id'];}return db[_0x0db8('0x2b')][_0x0db8('0x48')]({'where':{'id':_0x5efbcb[_0x0db8('0x43')]['id']}})[_0x0db8('0x40')](handleEntityNotFound(_0x3bd88c,null))[_0x0db8('0x40')](saveUpdates(_0x5efbcb[_0x0db8('0x4a')],null))[_0x0db8('0x40')](respondWithResult(_0x3bd88c,null))[_0x0db8('0x41')](handleError(_0x3bd88c,null));};exports[_0x0db8('0x55')]=function(_0x13449d,_0x4713ba){var _0x19b16e=_0x13449d[_0x0db8('0x43')]['id'];var _0x3516b1=[];return db[_0x0db8('0x56')][_0x0db8('0x57')](function(_0x38dc4f){var _0x5f26c8=_0x0db8('0x58')+_0x19b16e;return db['sequelize'][_0x0db8('0x2e')](_0x5f26c8,{'type':db[_0x0db8('0x59')][_0x0db8('0x5a')][_0x0db8('0x5b')],'raw':!![],'transaction':_0x38dc4f})[_0x0db8('0x40')](function(_0x36715e){_0x3516b1=_[_0x0db8('0x2a')](_0x36715e,function(_0x2f904e){return Number(_0x2f904e[_0x0db8('0x5c')]);});})[_0x0db8('0x40')](function(){var _0x180a47=_0x0db8('0x5d')+_0x19b16e;return db[_0x0db8('0x56')]['query'](_0x180a47,{'type':db[_0x0db8('0x59')][_0x0db8('0x5a')][_0x0db8('0x5b')],'raw':!![],'transaction':_0x38dc4f});})[_0x0db8('0x40')](function(_0x2c09da){var _0x327c73=_[_0x0db8('0x2a')](_0x2c09da,function(_0x31b532){return Number(_0x31b532[_0x0db8('0x5e')]);});return db[_0x0db8('0x5f')][_0x0db8('0x55')]({'where':{'UserId':{'$in':_0x3516b1},'VoiceQueueId':{'$in':_0x327c73}},'transaction':_0x38dc4f});})['then'](function(){var _0x552e6f=_0x0db8('0x60')+_0x19b16e;return db[_0x0db8('0x56')][_0x0db8('0x2e')](_0x552e6f,{'type':db['Sequelize'][_0x0db8('0x5a')][_0x0db8('0x5b')],'raw':!![],'transaction':_0x38dc4f});})[_0x0db8('0x40')](function(_0x2114b7){var _0x2b4407=_[_0x0db8('0x2a')](_0x2114b7,function(_0x31c96e){return Number(_0x31c96e[_0x0db8('0x61')]);});return db[_0x0db8('0x62')][_0x0db8('0x55')]({'where':{'UserId':{'$in':_0x3516b1},'MailQueueId':{'$in':_0x2b4407}},'transaction':_0x38dc4f});})[_0x0db8('0x40')](function(){var _0x251578=_0x0db8('0x63')+_0x19b16e;return db[_0x0db8('0x56')][_0x0db8('0x2e')](_0x251578,{'type':db[_0x0db8('0x59')][_0x0db8('0x5a')][_0x0db8('0x5b')],'raw':!![],'transaction':_0x38dc4f});})['then'](function(_0x11429f){var _0x2c6262=_['map'](_0x11429f,function(_0x540105){return Number(_0x540105[_0x0db8('0x64')]);});return db[_0x0db8('0x65')]['destroy']({'where':{'UserId':{'$in':_0x3516b1},'SmsQueueId':{'$in':_0x2c6262}},'transaction':_0x38dc4f});})['then'](function(){var _0x36e255=_0x0db8('0x66')+_0x19b16e;return db[_0x0db8('0x56')][_0x0db8('0x2e')](_0x36e255,{'type':db[_0x0db8('0x59')][_0x0db8('0x5a')][_0x0db8('0x5b')],'raw':!![],'transaction':_0x38dc4f});})['then'](function(_0x1110ae){var _0x54b695=_[_0x0db8('0x2a')](_0x1110ae,function(_0x3e7b9f){return Number(_0x3e7b9f[_0x0db8('0x67')]);});return db['UserChatQueue'][_0x0db8('0x55')]({'where':{'UserId':{'$in':_0x3516b1},'ChatQueueId':{'$in':_0x54b695}},'transaction':_0x38dc4f});})[_0x0db8('0x40')](function(){var _0x42a6a5='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x19b16e;return db[_0x0db8('0x56')]['query'](_0x42a6a5,{'type':db[_0x0db8('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x38dc4f});})[_0x0db8('0x40')](function(_0x571542){var _0x24d3f4=_[_0x0db8('0x2a')](_0x571542,function(_0x4d6362){return Number(_0x4d6362[_0x0db8('0x68')]);});return db[_0x0db8('0x69')][_0x0db8('0x55')]({'where':{'UserId':{'$in':_0x3516b1},'FaxQueueId':{'$in':_0x24d3f4}},'transaction':_0x38dc4f});})[_0x0db8('0x40')](function(){var _0x48b7a1=_0x0db8('0x6a')+_0x19b16e;return db[_0x0db8('0x56')][_0x0db8('0x2e')](_0x48b7a1,{'type':db['Sequelize'][_0x0db8('0x5a')][_0x0db8('0x5b')],'raw':!![],'transaction':_0x38dc4f});})['then'](function(_0x22f007){var _0x6d53ec=_['map'](_0x22f007,function(_0x1717d8){return Number(_0x1717d8[_0x0db8('0x6b')]);});return db[_0x0db8('0x6c')][_0x0db8('0x55')]({'where':{'UserId':{'$in':_0x3516b1},'OpenchannelQueueId':{'$in':_0x6d53ec}},'transaction':_0x38dc4f});})[_0x0db8('0x40')](function(){var _0x402225=_0x0db8('0x6d')+_0x19b16e;return db['sequelize'][_0x0db8('0x2e')](_0x402225,{'type':db[_0x0db8('0x59')][_0x0db8('0x5a')][_0x0db8('0x5b')],'raw':!![],'transaction':_0x38dc4f});})['then'](function(_0x559356){var _0xfe1d07=_[_0x0db8('0x2a')](_0x559356,function(_0x53a088){return Number(_0x53a088['WhatsappQueueId']);});return db['UserWhatsappQueue'][_0x0db8('0x55')]({'where':{'UserId':{'$in':_0x3516b1},'WhatsappQueueId':{'$in':_0xfe1d07}},'transaction':_0x38dc4f});})[_0x0db8('0x40')](function(){return db[_0x0db8('0x6e')]['find']({'where':{'TeamId':_0x19b16e}});})[_0x0db8('0x40')](function(_0x5f43fb){if(_0x5f43fb===null){return;}return db['UserVoicePrefix'][_0x0db8('0x55')]({'where':{'UserId':{'$in':_0x3516b1},'VoicePrefixId':_0x5f43fb['VoicePrefixId']},'transaction':_0x38dc4f});})[_0x0db8('0x40')](function(){return db['Team'][_0x0db8('0x55')]({'where':{'id':_0x19b16e},'cascade':!![],'transaction':_0x38dc4f});})['then'](function(_0x21e245){if(_0x21e245===0x0){_0x4713ba[_0x0db8('0x1a')](0x194);}else{return db['UserProfileResource']['destroy']({'where':{'type':_0x0db8('0x4f'),'resourceId':_0x19b16e},'cascade':!![],'transaction':_0x38dc4f})[_0x0db8('0x40')](function(){_0x4713ba[_0x0db8('0x1b')](0xcc)['end']();});}})['catch'](function(_0x4d6d69){_0x4713ba[_0x0db8('0x1b')](0x1f4)['send'](_0x4d6d69);});});};exports[_0x0db8('0x6f')]=function(_0x5b0686,_0x537bef,_0x523164){return db[_0x0db8('0x2b')][_0x0db8('0x70')]({'where':{'id':_0x5b0686[_0x0db8('0x43')]['id']}})[_0x0db8('0x40')](handleEntityNotFound(_0x537bef,null))[_0x0db8('0x40')](function(_0x497c1a){if(!_0x5b0686[_0x0db8('0x2e')][_0x0db8('0x71')]||!utils[_0x0db8('0x72')](_0x5b0686[_0x0db8('0x2e')][_0x0db8('0x71')])){throw new db[(_0x0db8('0x59'))][(_0x0db8('0x73'))](_0x0db8('0x74'));}var _0x352181={};var _0x17bc8e={};_0x17bc8e[_0x0db8('0x30')]=_['keys'](db[_[_0x0db8('0x75')](_0x5b0686['query'][_0x0db8('0x71')][_0x0db8('0x76')]())+_0x0db8('0x77')][_0x0db8('0x78')]);_0x17bc8e['query']=_['keys'](_0x5b0686[_0x0db8('0x2e')]);_0x17bc8e[_0x0db8('0x2f')]=_['intersection'](_0x17bc8e['model'],_0x17bc8e[_0x0db8('0x2e')]);_0x352181[_0x0db8('0x32')]=_['intersection'](_0x17bc8e[_0x0db8('0x30')],qs[_0x0db8('0x31')](_0x5b0686[_0x0db8('0x2e')][_0x0db8('0x31')]));_0x352181['attributes']=_0x352181['attributes'][_0x0db8('0x33')]?_0x352181[_0x0db8('0x32')]:_0x17bc8e[_0x0db8('0x30')];_0x352181[_0x0db8('0x21')]=qs[_0x0db8('0x21')](_0x5b0686[_0x0db8('0x2e')]['limit']);_0x352181[_0x0db8('0x1e')]=qs[_0x0db8('0x1e')](_0x5b0686[_0x0db8('0x2e')][_0x0db8('0x1e')]);_0x352181['order']=qs[_0x0db8('0x37')](_0x5b0686[_0x0db8('0x2e')][_0x0db8('0x37')]);_0x352181[_0x0db8('0x38')]=qs[_0x0db8('0x2f')](_[_0x0db8('0x39')](_0x5b0686['query'],_0x17bc8e[_0x0db8('0x2f')]));_0x352181=_[_0x0db8('0x3b')]({},_0x352181,_0x5b0686['options']);return _0x497c1a[_0x0db8('0x4e')+_['capitalize'](_0x5b0686[_0x0db8('0x2e')][_0x0db8('0x71')]['toLowerCase']())+'Queues'](_0x352181);})[_0x0db8('0x40')](respondWithResult(_0x537bef,null))[_0x0db8('0x41')](handleError(_0x537bef,null));};exports['addQueues']=function(_0x39273f,_0x3a427c,_0x50edb5){return db[_0x0db8('0x2b')]['findOne']({'where':{'id':_0x39273f[_0x0db8('0x43')]['id']}})['then'](function(_0x21dab9){if(_0x21dab9){if(!_0x39273f[_0x0db8('0x4a')][_0x0db8('0x71')]||!utils['isValidChannel'](_0x39273f[_0x0db8('0x4a')][_0x0db8('0x71')])){throw new db[(_0x0db8('0x59'))]['ValidationError'](_0x0db8('0x74'));}return _0x21dab9[_0x0db8('0x79')+_[_0x0db8('0x75')](_0x39273f[_0x0db8('0x4a')]['channel']['toLowerCase']())+_0x0db8('0x7a')](_0x39273f['body'][_0x0db8('0x7b')]);}return null;})[_0x0db8('0x40')](handleEntityNotFound(_0x3a427c,null))['then'](respondWithStatusCode(_0x3a427c,null))[_0x0db8('0x41')](handleError(_0x3a427c,null));};exports[_0x0db8('0x7c')]=function(_0x5c36b9,_0xfa9bd2,_0x5ecc0c){return db[_0x0db8('0x2b')][_0x0db8('0x70')]({'where':{'id':_0x5c36b9[_0x0db8('0x43')]['id']}})[_0x0db8('0x40')](function(_0x55feb0){if(_0x55feb0){if(!_0x5c36b9[_0x0db8('0x2e')][_0x0db8('0x71')]||!utils[_0x0db8('0x72')](_0x5c36b9[_0x0db8('0x2e')][_0x0db8('0x71')])){throw new db['Sequelize'][(_0x0db8('0x73'))]('Unknown\x20channel');}return _0x55feb0[_0x0db8('0x7d')+_[_0x0db8('0x75')](_0x5c36b9[_0x0db8('0x2e')][_0x0db8('0x71')][_0x0db8('0x76')]())+_0x0db8('0x7a')](_0x5c36b9[_0x0db8('0x2e')][_0x0db8('0x7b')]);}return null;})[_0x0db8('0x40')](handleEntityNotFound(_0xfa9bd2,null))['then'](respondWithStatusCode(_0xfa9bd2,null))[_0x0db8('0x41')](handleError(_0xfa9bd2,null));};exports['addAgents']=function(_0x21fd21,_0x4250c4){var _0x6766e=_[_0x0db8('0x7e')](_0x21fd21[_0x0db8('0x4a')]['ids'])?_0x21fd21['body']['ids']:[_0x21fd21[_0x0db8('0x4a')][_0x0db8('0x7b')]];var _0x3fba9c=_0x21fd21[_0x0db8('0x43')]['id'];return db[_0x0db8('0x2b')]['find']({'where':{'id':_0x3fba9c}})[_0x0db8('0x40')](handleEntityNotFound(_0x4250c4,null))['then'](function(_0x1e235e){if(_0x1e235e){var _0x263f57=[_0x0db8('0x7f'),_0x0db8('0x80'),_0x0db8('0x81'),_0x0db8('0x82'),_0x0db8('0x83'),'Openchannel','Whatsapp'];return db[_0x0db8('0x56')][_0x0db8('0x57')](function(_0x5a84aa){var _0x363413=_['map'](_0x263f57,function(_0x2ec201){var _0x324358={'attributes':['id',_0x0db8('0x27')]};if(_0x2ec201===_0x0db8('0x7f')){_0x324358[_0x0db8('0x84')]={'attributes':[_0x0db8('0x85')]};}return _0x1e235e[_0x0db8('0x4e')+_0x2ec201+_0x0db8('0x7a')](_0x324358)[_0x0db8('0x40')](function(_0x41e03c){var _0x396b4e=_[_0x0db8('0x2a')](_0x41e03c,function(_0x5406c6){var _0x102140=_['map'](_0x6766e,function(_0x4280ec){var _0x17e15a={'where':{'UserId':_0x4280ec,[_0x2ec201+_0x0db8('0x86')]:_0x5406c6['id']},'transaction':_0x5a84aa};if(_0x2ec201==='Voice'){_0x17e15a[_0x0db8('0x16')]={'penalty':_0x5406c6[_0x0db8('0x87')]['penalty']};}return db[_0x0db8('0x88')+_0x2ec201+_0x0db8('0x77')][_0x0db8('0x89')](_0x17e15a)[_0x0db8('0x40')](function(){socket['emit'](_0x0db8('0x4b')+_0x2ec201+'Queue:save',{'UserId':_0x4280ec,[_0x2ec201+_0x0db8('0x86')]:_0x5406c6['id']});if(_0x2ec201!==_0x0db8('0x7f')){return;}return db[_0x0db8('0x88')][_0x0db8('0x3e')]({'where':{'id':_0x6766e,'online':0x1},'attributes':['id',_0x0db8('0x27'),_0x0db8('0x8a'),_0x0db8('0x8b'),_0x0db8('0x8c')],'raw':!![]})[_0x0db8('0x40')](function(_0xded19d){var _0x5bdf91=_[_0x0db8('0x2a')](_0xded19d,function(_0x527086){return db[_0x0db8('0x8d')]['upsert']({'membername':_0x527086['name'],'UserId':_0x527086['id'],'queue_name':_0x5406c6[_0x0db8('0x27')],'VoiceQueueId':_0x5406c6['id'],'interface':_['isNil'](_0x527086[_0x0db8('0x8c')])?util[_0x0db8('0x8e')]('SIP/%s',_0x527086['name']):_0x527086['interface'],'paused':_0x527086[_0x0db8('0x8b')]||![],'penalty':_0x5406c6['TeamVoiceQueue'][_0x0db8('0x85')]},{'transaction':_0x5a84aa});});return Promise[_0x0db8('0x8f')](_0x5bdf91);});});});return Promise[_0x0db8('0x8f')](_0x102140);});return Promise[_0x0db8('0x8f')](_0x396b4e);})[_0x0db8('0x40')](function(){return db[_0x0db8('0x6e')]['findOne']({'where':{'teamId':_0x3fba9c}})['then'](function(_0x2e0716){if(_0x2e0716){var _0xd196b1=_[_0x0db8('0x2a')](_0x6766e,function(_0x3b378b){db[_0x0db8('0x90')][_0x0db8('0x91')]({'UserId':_0x3b378b,'VoicePrefixId':_0x2e0716[_0x0db8('0x92')]});});return Promise['all'](_0xd196b1);}});});});return Promise[_0x0db8('0x8f')](_0x363413)[_0x0db8('0x40')](function(){return _0x1e235e['addAgents'](_0x6766e,{'transaction':_0x5a84aa})[_0x0db8('0x93')](function(_0x3c9e9f){return _0x3c9e9f;});});});}})[_0x0db8('0x40')](respondWithResult(_0x4250c4,null))[_0x0db8('0x41')](handleError(_0x4250c4,null));};exports[_0x0db8('0x94')]=function(_0x500840,_0x2aec01){var _0x57e97a=_[_0x0db8('0x7e')](_0x500840[_0x0db8('0x2e')][_0x0db8('0x7b')])?_0x500840[_0x0db8('0x2e')][_0x0db8('0x7b')]:[_0x500840[_0x0db8('0x2e')][_0x0db8('0x7b')]];var _0x4bd59e=_0x500840[_0x0db8('0x43')]['id'];return db[_0x0db8('0x2b')]['find']({'where':{'id':_0x4bd59e}})['then'](handleEntityNotFound(_0x2aec01,null))['then'](function(_0x5eb473){if(_0x5eb473){var _0x4fd9b3=[_0x0db8('0x7f'),_0x0db8('0x80'),'Mail',_0x0db8('0x82'),_0x0db8('0x83'),'Openchannel',_0x0db8('0x95')];return db['sequelize']['transaction'](function(_0xbb5990){var _0x38554f=_[_0x0db8('0x2a')](_0x4fd9b3,function(_0x460fff){var _0x4b64c3={'attributes':['id',_0x0db8('0x27')]};return _0x5eb473[_0x0db8('0x4e')+_0x460fff+_0x0db8('0x7a')](_0x4b64c3)[_0x0db8('0x40')](function(_0x14f1ae){var _0x10638a=_[_0x0db8('0x2a')](_0x14f1ae,function(_0x429d45){return _0x429d45[_0x0db8('0x94')](_0x57e97a,{'transaction':_0xbb5990})[_0x0db8('0x40')](function(){var _0x5a13d9=_['map'](_0x57e97a,function(_0xf26cc9){socket['emit'](_0x0db8('0x4b')+_0x460fff+'Queue:remove',{'UserId':Number(_0xf26cc9),[_0x460fff+_0x0db8('0x86')]:_0x429d45['id']});if(_0x460fff!==_0x0db8('0x7f')){return;}return db[_0x0db8('0x8d')]['destroy']({'where':{'VoiceQueueId':_0x429d45['id'],'UserId':_0xf26cc9},'transaction':_0xbb5990});});return Promise[_0x0db8('0x8f')](_0x5a13d9);});});return Promise[_0x0db8('0x8f')](_0x10638a);});});return Promise[_0x0db8('0x8f')](_0x38554f)['then'](function(){return _0x5eb473['removeAgents'](_0x57e97a,{'transaction':_0xbb5990});})['then'](function(){return db[_0x0db8('0x6e')][_0x0db8('0x70')]({'where':{'teamId':_0x4bd59e}})[_0x0db8('0x40')](function(_0x420918){if(_0x420918){var _0x1651eb=_[_0x0db8('0x2a')](_0x57e97a,function(_0x19d287){db[_0x0db8('0x90')][_0x0db8('0x55')]({'where':{'UserId':_0x19d287,'VoicePrefixId':_0x420918[_0x0db8('0x92')]}});});return Promise[_0x0db8('0x8f')](_0x1651eb);}});});});}})[_0x0db8('0x40')](respondWithStatusCode(_0x2aec01,null))[_0x0db8('0x41')](handleError(_0x2aec01,null));};exports['getAgents']=function(_0x165e17,_0x4dea81,_0x568b2d){var _0x112b13={};var _0x4c03ee={};var _0x2bc009;var _0x2a9fe2;return db[_0x0db8('0x2b')][_0x0db8('0x70')]({'where':{'id':_0x165e17[_0x0db8('0x43')]['id']}})[_0x0db8('0x40')](handleEntityNotFound(_0x4dea81,null))[_0x0db8('0x40')](function(_0x2e7731){if(_0x2e7731){_0x2bc009=_0x2e7731;_0x4c03ee[_0x0db8('0x30')]=_[_0x0db8('0x44')](db[_0x0db8('0x88')][_0x0db8('0x78')]);_0x4c03ee[_0x0db8('0x2e')]=_['keys'](_0x165e17[_0x0db8('0x2e')]);_0x4c03ee['filters']=_[_0x0db8('0x45')](_0x4c03ee[_0x0db8('0x30')],_0x4c03ee[_0x0db8('0x2e')]);_0x112b13['attributes']=_['intersection'](_0x4c03ee[_0x0db8('0x30')],qs['fields'](_0x165e17['query'][_0x0db8('0x31')]));_0x112b13[_0x0db8('0x32')]=_0x112b13[_0x0db8('0x32')][_0x0db8('0x33')]?_0x112b13[_0x0db8('0x32')]:_0x4c03ee[_0x0db8('0x30')];_0x112b13['order']=qs[_0x0db8('0x37')](_0x165e17[_0x0db8('0x2e')][_0x0db8('0x37')]);_0x112b13[_0x0db8('0x38')]=qs[_0x0db8('0x2f')](_['pick'](_0x165e17[_0x0db8('0x2e')],_0x4c03ee[_0x0db8('0x2f')]));if(_0x165e17[_0x0db8('0x2e')][_0x0db8('0x3a')]){_0x112b13[_0x0db8('0x38')]=_[_0x0db8('0x3b')](_0x112b13[_0x0db8('0x38')],{'$or':_['map'](_0x112b13[_0x0db8('0x32')],function(_0x921314){var _0x1b89da={};_0x1b89da[_0x921314]={'$like':'%'+_0x165e17[_0x0db8('0x2e')][_0x0db8('0x3a')]+'%'};return _0x1b89da;})});}_0x112b13=_[_0x0db8('0x3b')]({},_0x112b13,_0x165e17[_0x0db8('0x3d')]);return _0x2bc009[_0x0db8('0x96')](_0x112b13);}})[_0x0db8('0x40')](function(_0x1ff47a){if(_0x1ff47a){_0x2a9fe2=_0x1ff47a[_0x0db8('0x33')];if(!_0x165e17[_0x0db8('0x2e')][_0x0db8('0x34')](_0x0db8('0x35'))){_0x112b13[_0x0db8('0x21')]=qs[_0x0db8('0x21')](_0x165e17[_0x0db8('0x2e')][_0x0db8('0x21')]);_0x112b13[_0x0db8('0x1e')]=qs[_0x0db8('0x1e')](_0x165e17['query'][_0x0db8('0x1e')]);}return _0x2bc009[_0x0db8('0x96')](_0x112b13);}})['then'](function(_0x2abf55){if(_0x2abf55){return _0x2abf55?{'count':_0x2a9fe2,'rows':_0x2abf55}:null;}})['then'](respondWithResult(_0x4dea81,null))[_0x0db8('0x41')](handleError(_0x4dea81,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 16fb091..cc51a02 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 _0x37b3=['hook','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x37b3,0xf1));var _0x337b=function(_0x42bb6d,_0x412255){_0x42bb6d=_0x42bb6d-0x0;var _0x1db89b=_0x37b3[_0x42bb6d];return _0x1db89b;};'use strict';var EventEmitter=require(_0x337b('0x0'));var Team=require(_0x337b('0x1'))['db'][_0x337b('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x337b('0x3')](0x0);var events={'afterCreate':_0x337b('0x4'),'afterUpdate':_0x337b('0x5'),'afterDestroy':_0x337b('0x6')};function emitEvent(_0xcfb269){return function(_0x4d8e5c,_0x31449f,_0x17be91){TeamEvents[_0x337b('0x7')](_0xcfb269+':'+_0x4d8e5c['id'],_0x4d8e5c);TeamEvents[_0x337b('0x7')](_0xcfb269,_0x4d8e5c);_0x17be91(null);};}for(var e in events){if(events[_0x337b('0x8')](e)){var event=events[e];Team[_0x337b('0x9')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x62c9=['emit','exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove'];(function(_0x2b360d,_0x28b204){var _0x5f4ce8=function(_0x105be7){while(--_0x105be7){_0x2b360d['push'](_0x2b360d['shift']());}};_0x5f4ce8(++_0x28b204);}(_0x62c9,0x92));var _0x962c=function(_0x57f164,_0x17c1af){_0x57f164=_0x57f164-0x0;var _0x21126a=_0x62c9[_0x57f164];return _0x21126a;};'use strict';var EventEmitter=require(_0x962c('0x0'));var Team=require(_0x962c('0x1'))['db'][_0x962c('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x962c('0x3')](0x0);var events={'afterCreate':_0x962c('0x4'),'afterUpdate':_0x962c('0x5'),'afterDestroy':_0x962c('0x6')};function emitEvent(_0x3efd9b){return function(_0x3e8090,_0x1f1f93,_0x2bedac){TeamEvents[_0x962c('0x7')](_0x3efd9b+':'+_0x3e8090['id'],_0x3e8090);TeamEvents[_0x962c('0x7')](_0x3efd9b,_0x3e8090);_0x2bedac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x962c('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 974d54b..343acb3 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 _0x541f=['define','Team','teams','lodash','util','../../config/logger','api','bluebird','request-promise','path','exports'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0x541f,0x137));var _0xf541=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x541f[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xf541('0x0'));var util=require(_0xf541('0x1'));var logger=require(_0xf541('0x2'))(_0xf541('0x3'));var moment=require('moment');var BPromise=require(_0xf541('0x4'));var rp=require(_0xf541('0x5'));var fs=require('fs');var path=require(_0xf541('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0xf541('0x7')]=function(_0x20302e,_0x3db66d){return _0x20302e[_0xf541('0x8')](_0xf541('0x9'),attributes,{'tableName':_0xf541('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3fac=['../../config/environment','./team.attributes','Team','teams','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x54a4d5,_0x29bac0){var _0x49c11d=function(_0x2fe97d){while(--_0x2fe97d){_0x54a4d5['push'](_0x54a4d5['shift']());}};_0x49c11d(++_0x29bac0);}(_0x3fac,0x13c));var _0xc3fa=function(_0x559bc0,_0x326de8){_0x559bc0=_0x559bc0-0x0;var _0x5a635e=_0x3fac[_0x559bc0];return _0x5a635e;};'use strict';var _=require(_0xc3fa('0x0'));var util=require(_0xc3fa('0x1'));var logger=require(_0xc3fa('0x2'))(_0xc3fa('0x3'));var moment=require(_0xc3fa('0x4'));var BPromise=require(_0xc3fa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3fa('0x6'));var rimraf=require(_0xc3fa('0x7'));var config=require(_0xc3fa('0x8'));var attributes=require(_0xc3fa('0x9'));module['exports']=function(_0x5da3b5,_0x3ce0bc){return _0x5da3b5['define'](_0xc3fa('0xa'),attributes,{'tableName':_0xc3fa('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 144e615..58b43cd 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 _0x2ac4=['Team,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Team,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./team.socket','request','info','debug'];(function(_0xd2f4f5,_0x341930){var _0x41fc10=function(_0x496824){while(--_0x496824){_0xd2f4f5['push'](_0xd2f4f5['shift']());}};_0x41fc10(++_0x341930);}(_0x2ac4,0x68));var _0x42ac=function(_0x2f1d2f,_0x527d85){_0x2f1d2f=_0x2f1d2f-0x0;var _0x2874cf=_0x2ac4[_0x2f1d2f];return _0x2874cf;};'use strict';var _=require('lodash');var util=require(_0x42ac('0x0'));var moment=require('moment');var BPromise=require(_0x42ac('0x1'));var rs=require(_0x42ac('0x2'));var fs=require('fs');var Redis=require(_0x42ac('0x3'));var db=require(_0x42ac('0x4'))['db'];var utils=require(_0x42ac('0x5'));var logger=require('../../config/logger')(_0x42ac('0x6'));var config=require(_0x42ac('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x42ac('0x8')]['http']({'port':0x232a});config[_0x42ac('0x9')]=_['defaults'](config[_0x42ac('0x9')],{'host':_0x42ac('0xa'),'port':0x18eb});var socket=require(_0x42ac('0xb'))(new Redis(config[_0x42ac('0x9')]));require(_0x42ac('0xc'))['register'](socket);function respondWithRpcPromise(_0x417c05,_0xf2ff24,_0x52134d){return new BPromise(function(_0x558262,_0xd2763){return client[_0x42ac('0xd')](_0x417c05,_0x52134d)['then'](function(_0x955de7){logger[_0x42ac('0xe')]('Team,\x20%s,\x20%s',_0xf2ff24,'request\x20sent');logger[_0x42ac('0xf')](_0x42ac('0x10'),_0xf2ff24,_0x42ac('0x11'),JSON['stringify'](_0x955de7));if(_0x955de7[_0x42ac('0x12')]){if(_0x955de7[_0x42ac('0x12')][_0x42ac('0x13')]===0x1f4){logger[_0x42ac('0x12')](_0x42ac('0x14'),_0xf2ff24,_0x955de7[_0x42ac('0x12')][_0x42ac('0x15')]);return _0xd2763(_0x955de7['error']['message']);}logger[_0x42ac('0x12')]('Team,\x20%s,\x20%s',_0xf2ff24,_0x955de7[_0x42ac('0x12')][_0x42ac('0x15')]);return _0x558262(_0x955de7[_0x42ac('0x12')][_0x42ac('0x15')]);}else{logger[_0x42ac('0xe')](_0x42ac('0x14'),_0xf2ff24,'request\x20sent');_0x558262(_0x955de7[_0x42ac('0x16')][_0x42ac('0x15')]);}})[_0x42ac('0x17')](function(_0x42f384){logger[_0x42ac('0x12')]('Team,\x20%s,\x20%s',_0xf2ff24,_0x42f384);_0xd2763(_0x42f384);});});} \ No newline at end of file +var _0x12e9=['result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x200045,_0x4e5da1){var _0x566a8d=function(_0x46b5a1){while(--_0x46b5a1){_0x200045['push'](_0x200045['shift']());}};_0x566a8d(++_0x4e5da1);}(_0x12e9,0x66));var _0x912e=function(_0x52684e,_0x510622){_0x52684e=_0x52684e-0x0;var _0x54d29c=_0x12e9[_0x52684e];return _0x54d29c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x912e('0x0'));var BPromise=require('bluebird');var rs=require(_0x912e('0x1'));var fs=require('fs');var Redis=require(_0x912e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x912e('0x3'));var logger=require(_0x912e('0x4'))('rpc');var config=require(_0x912e('0x5'));var jayson=require(_0x912e('0x6'));var client=jayson[_0x912e('0x7')][_0x912e('0x8')]({'port':0x232a});config['redis']=_[_0x912e('0x9')](config[_0x912e('0xa')],{'host':_0x912e('0xb'),'port':0x18eb});var socket=require(_0x912e('0xc'))(new Redis(config[_0x912e('0xa')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x4ee627,_0x1919ab,_0x2344a0){return new BPromise(function(_0x360119,_0x1b2571){return client[_0x912e('0xd')](_0x4ee627,_0x2344a0)['then'](function(_0xfe85d2){logger[_0x912e('0xe')](_0x912e('0xf'),_0x1919ab,_0x912e('0x10'));logger[_0x912e('0x11')](_0x912e('0x12'),_0x1919ab,_0x912e('0x10'),JSON[_0x912e('0x13')](_0xfe85d2));if(_0xfe85d2[_0x912e('0x14')]){if(_0xfe85d2[_0x912e('0x14')][_0x912e('0x15')]===0x1f4){logger[_0x912e('0x14')]('Team,\x20%s,\x20%s',_0x1919ab,_0xfe85d2[_0x912e('0x14')]['message']);return _0x1b2571(_0xfe85d2['error'][_0x912e('0x16')]);}logger[_0x912e('0x14')](_0x912e('0xf'),_0x1919ab,_0xfe85d2['error']['message']);return _0x360119(_0xfe85d2[_0x912e('0x14')][_0x912e('0x16')]);}else{logger[_0x912e('0xe')]('Team,\x20%s,\x20%s',_0x1919ab,_0x912e('0x10'));_0x360119(_0xfe85d2[_0x912e('0x17')][_0x912e('0x16')]);}})[_0x912e('0x18')](function(_0xacbc3b){logger['error'](_0x912e('0xf'),_0x1919ab,_0xacbc3b);_0x1b2571(_0xacbc3b);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 67f9bfb..16fa118 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 _0x22fb=['save','remove','emit','removeListener','register','length','team:','./team.events'];(function(_0x308f09,_0x9c9367){var _0x2b58fd=function(_0x51b231){while(--_0x51b231){_0x308f09['push'](_0x308f09['shift']());}};_0x2b58fd(++_0x9c9367);}(_0x22fb,0x18f));var _0xb22f=function(_0x44d664,_0x4da8c9){_0x44d664=_0x44d664-0x0;var _0x40540d=_0x22fb[_0x44d664];return _0x40540d;};'use strict';var TeamEvents=require(_0xb22f('0x0'));var events=[_0xb22f('0x1'),_0xb22f('0x2'),'update'];function createListener(_0x2b5587,_0x3ba8e1){return function(_0x51a5b6){_0x3ba8e1[_0xb22f('0x3')](_0x2b5587,_0x51a5b6);};}function removeListener(_0x1936df,_0x16a46e){return function(){TeamEvents[_0xb22f('0x4')](_0x1936df,_0x16a46e);};}exports[_0xb22f('0x5')]=function(_0x179f8a){for(var _0x3485cd=0x0,_0x5bf93a=events[_0xb22f('0x6')];_0x3485cd<_0x5bf93a;_0x3485cd++){var _0x5e1f1b=events[_0x3485cd];var _0x5465c5=createListener(_0xb22f('0x7')+_0x5e1f1b,_0x179f8a);TeamEvents['on'](_0x5e1f1b,_0x5465c5);}}; \ No newline at end of file +var _0x4503=['team:','save','remove','update','emit','removeListener','register','length'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4503,0x111));var _0x3450=function(_0x29c796,_0x106fb4){_0x29c796=_0x29c796-0x0;var _0xfa19b1=_0x4503[_0x29c796];return _0xfa19b1;};'use strict';var TeamEvents=require('./team.events');var events=[_0x3450('0x0'),_0x3450('0x1'),_0x3450('0x2')];function createListener(_0x497e96,_0x44f63d){return function(_0x3ffdaa){_0x44f63d[_0x3450('0x3')](_0x497e96,_0x3ffdaa);};}function removeListener(_0x5e7d24,_0x47627f){return function(){TeamEvents[_0x3450('0x4')](_0x5e7d24,_0x47627f);};}exports[_0x3450('0x5')]=function(_0x500161){for(var _0x2a0acb=0x0,_0x358ef3=events[_0x3450('0x6')];_0x2a0acb<_0x358ef3;_0x2a0acb++){var _0x252d2f=events[_0x2a0acb];var _0x5457b9=createListener(_0x3450('0x7')+_0x252d2f,_0x500161);TeamEvents['on'](_0x252d2f,_0x5457b9);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 5b92db4..c3591b0 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 _0x59e0=['exports','INTEGER'];(function(_0x1508ce,_0x6ff40d){var _0x3011ec=function(_0x297bb7){while(--_0x297bb7){_0x1508ce['push'](_0x1508ce['shift']());}};_0x3011ec(++_0x6ff40d);}(_0x59e0,0x1f4));var _0x059e=function(_0x38ee15,_0x2ac0ae){_0x38ee15=_0x38ee15-0x0;var _0x15df1e=_0x59e0[_0x38ee15];return _0x15df1e;};'use strict';var Sequelize=require('sequelize');module[_0x059e('0x0')]={'TeamId':{'type':Sequelize[_0x059e('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x059e('0x1')]}}; \ No newline at end of file +var _0x9c44=['INTEGER'];(function(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module['exports']={'TeamId':{'type':Sequelize[_0x49c4('0x0')]},'VoicePrefixId':{'type':Sequelize[_0x49c4('0x0')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index c7f4149..f4f4050 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 _0x4dd3=['rimraf','../../config/environment','exports','define','TeamVoicePrefix','lodash','util','../../config/logger','bluebird','path'];(function(_0x273f29,_0x2b695b){var _0x5140b4=function(_0xc74a54){while(--_0xc74a54){_0x273f29['push'](_0x273f29['shift']());}};_0x5140b4(++_0x2b695b);}(_0x4dd3,0xf5));var _0x34dd=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x4dd3[_0x363ef8];return _0x148822;};'use strict';var _=require(_0x34dd('0x0'));var util=require(_0x34dd('0x1'));var logger=require(_0x34dd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x34dd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34dd('0x4'));var rimraf=require(_0x34dd('0x5'));var config=require(_0x34dd('0x6'));var attributes=require('./teamVoicePrefix.attributes');module[_0x34dd('0x7')]=function(_0x704165,_0x37ce1d){return _0x704165[_0x34dd('0x8')](_0x34dd('0x9'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc698=['team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','path','../../config/environment','exports','define','TeamVoicePrefix'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc698,0x85));var _0x8c69=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0xc698[_0x424501];return _0xb719af;};'use strict';var _=require(_0x8c69('0x0'));var util=require(_0x8c69('0x1'));var logger=require(_0x8c69('0x2'))(_0x8c69('0x3'));var moment=require(_0x8c69('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c69('0x5'));var rimraf=require('rimraf');var config=require(_0x8c69('0x6'));var attributes=require('./teamVoicePrefix.attributes');module[_0x8c69('0x7')]=function(_0x5e8069,_0x5c0109){return _0x5e8069[_0x8c69('0x8')](_0x8c69('0x9'),attributes,{'tableName':_0x8c69('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 59ae73d..012f519 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3f1385,_0x3620ff){var _0x5e13d0=function(_0x13680a){while(--_0x13680a){_0x3f1385['push'](_0x3f1385['shift']());}};_0x5e13d0(++_0x3620ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2251c9,_0x2a2091){var _0x56d17b=function(_0x3fd083){while(--_0x3fd083){_0x2251c9['push'](_0x2251c9['shift']());}};_0x56d17b(++_0x2a2091);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index a6d230b..0ef3ab8 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 _0xf8cc=['sequelize','exports','INTEGER'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf8cc,0x189));var _0xcf8c=function(_0x1b5138,_0x2047d0){_0x1b5138=_0x1b5138-0x0;var _0x45f453=_0xf8cc[_0x1b5138];return _0x45f453;};'use strict';var Sequelize=require(_0xcf8c('0x0'));module[_0xcf8c('0x1')]={'penalty':{'type':Sequelize[_0xcf8c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc117=['exports','INTEGER'];(function(_0x17a065,_0x395e96){var _0x3acbc1=function(_0x1e34c3){while(--_0x1e34c3){_0x17a065['push'](_0x17a065['shift']());}};_0x3acbc1(++_0x395e96);}(_0xc117,0x12a));var _0x7c11=function(_0x11650b,_0x265f0e){_0x11650b=_0x11650b-0x0;var _0x1c95d6=_0xc117[_0x11650b];return _0x1c95d6;};'use strict';var Sequelize=require('sequelize');module[_0x7c11('0x0')]={'penalty':{'type':Sequelize[_0x7c11('0x1')],'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 130de1f..5308d56 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 _0x0d4e=['exports','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./teamVoiceQueue.attributes'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0x0d4e,0x1ca));var _0xe0d4=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0d4e[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xe0d4('0x0'));var util=require(_0xe0d4('0x1'));var logger=require(_0xe0d4('0x2'))(_0xe0d4('0x3'));var moment=require(_0xe0d4('0x4'));var BPromise=require(_0xe0d4('0x5'));var rp=require(_0xe0d4('0x6'));var fs=require('fs');var path=require(_0xe0d4('0x7'));var rimraf=require(_0xe0d4('0x8'));var config=require('../../config/environment');var attributes=require(_0xe0d4('0x9'));module[_0xe0d4('0xa')]=function(_0x2cc782,_0x25bdbe){return _0x2cc782['define']('TeamVoiceQueue',attributes,{'tableName':_0xe0d4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ab=['rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','path'];(function(_0xd8d5df,_0x15a670){var _0x4c0d48=function(_0x2bcac2){while(--_0x2bcac2){_0xd8d5df['push'](_0xd8d5df['shift']());}};_0x4c0d48(++_0x15a670);}(_0xc6ab,0x96));var _0xbc6a=function(_0x302429,_0x1f8e6d){_0x302429=_0x302429-0x0;var _0x130764=_0xc6ab[_0x302429];return _0x130764;};'use strict';var _=require(_0xbc6a('0x0'));var util=require(_0xbc6a('0x1'));var logger=require(_0xbc6a('0x2'))(_0xbc6a('0x3'));var moment=require(_0xbc6a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc6a('0x5'));var rimraf=require(_0xbc6a('0x6'));var config=require(_0xbc6a('0x7'));var attributes=require(_0xbc6a('0x8'));module[_0xbc6a('0x9')]=function(_0x4ccd07,_0x45ed96){return _0x4ccd07[_0xbc6a('0xa')](_0xbc6a('0xb'),attributes,{'tableName':_0xbc6a('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 8679894..4c5220d 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 _0xaad1=['debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x319e2e,_0x2f727f){var _0x302524=function(_0x5cad9d){while(--_0x5cad9d){_0x319e2e['push'](_0x319e2e['shift']());}};_0x302524(++_0x2f727f);}(_0xaad1,0x148));var _0x1aad=function(_0x348a5b,_0x19379b){_0x348a5b=_0x348a5b-0x0;var _0x91b6a2=_0xaad1[_0x348a5b];return _0x91b6a2;};'use strict';var _=require(_0x1aad('0x0'));var util=require('util');var moment=require(_0x1aad('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1aad('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1aad('0x3'))('rpc');var config=require(_0x1aad('0x4'));var jayson=require(_0x1aad('0x5'));var client=jayson[_0x1aad('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x637b35,_0x57b1cf,_0x5b219e){return new BPromise(function(_0x1f69d4,_0x56f5ad){return client[_0x1aad('0x7')](_0x637b35,_0x5b219e)[_0x1aad('0x8')](function(_0x310112){logger[_0x1aad('0x9')](_0x1aad('0xa'),_0x57b1cf,_0x1aad('0xb'));logger[_0x1aad('0xc')](_0x1aad('0xd'),_0x57b1cf,'request\x20sent',JSON[_0x1aad('0xe')](_0x310112));if(_0x310112[_0x1aad('0xf')]){if(_0x310112['error'][_0x1aad('0x10')]===0x1f4){logger[_0x1aad('0xf')](_0x1aad('0xa'),_0x57b1cf,_0x310112[_0x1aad('0xf')]['message']);return _0x56f5ad(_0x310112[_0x1aad('0xf')][_0x1aad('0x11')]);}logger[_0x1aad('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x57b1cf,_0x310112[_0x1aad('0xf')][_0x1aad('0x11')]);return _0x1f69d4(_0x310112['error'][_0x1aad('0x11')]);}else{logger[_0x1aad('0x9')]('TeamVoiceQueue,\x20%s,\x20%s',_0x57b1cf,_0x1aad('0xb'));_0x1f69d4(_0x310112[_0x1aad('0x12')][_0x1aad('0x11')]);}})[_0x1aad('0x13')](function(_0x2e0a3e){logger[_0x1aad('0xf')](_0x1aad('0xa'),_0x57b1cf,_0x2e0a3e);_0x56f5ad(_0x2e0a3e);});});} \ No newline at end of file +var _0xeb0d=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x15256c,_0x462fee){_0x15256c=_0x15256c-0x0;var _0x16a958=_0xeb0d[_0x15256c];return _0x16a958;};'use strict';var _=require(_0xdeb0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdeb0('0x1'));var fs=require('fs');var Redis=require(_0xdeb0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdeb0('0x3'));var logger=require(_0xdeb0('0x4'))(_0xdeb0('0x5'));var config=require(_0xdeb0('0x6'));var jayson=require(_0xdeb0('0x7'));var client=jayson[_0xdeb0('0x8')][_0xdeb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27ebaa,_0x55ffce,_0x28a1a4){return new BPromise(function(_0x16b36b,_0x541d8b){return client[_0xdeb0('0xa')](_0x27ebaa,_0x28a1a4)[_0xdeb0('0xb')](function(_0x3336a6){logger[_0xdeb0('0xc')](_0xdeb0('0xd'),_0x55ffce,_0xdeb0('0xe'));logger[_0xdeb0('0xf')](_0xdeb0('0x10'),_0x55ffce,'request\x20sent',JSON['stringify'](_0x3336a6));if(_0x3336a6[_0xdeb0('0x11')]){if(_0x3336a6['error'][_0xdeb0('0x12')]===0x1f4){logger[_0xdeb0('0x11')](_0xdeb0('0xd'),_0x55ffce,_0x3336a6[_0xdeb0('0x11')][_0xdeb0('0x13')]);return _0x541d8b(_0x3336a6[_0xdeb0('0x11')][_0xdeb0('0x13')]);}logger[_0xdeb0('0x11')](_0xdeb0('0xd'),_0x55ffce,_0x3336a6['error'][_0xdeb0('0x13')]);return _0x16b36b(_0x3336a6[_0xdeb0('0x11')][_0xdeb0('0x13')]);}else{logger[_0xdeb0('0xc')](_0xdeb0('0xd'),_0x55ffce,'request\x20sent');_0x16b36b(_0x3336a6[_0xdeb0('0x14')]['message']);}})[_0xdeb0('0x15')](function(_0x473fb9){logger[_0xdeb0('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x55ffce,_0x473fb9);_0x541d8b(_0x473fb9);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 266bfaf..5e00a97 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 _0xc7bd=['show','post','put','/:id','update','delete','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index'];(function(_0x26502d,_0x167dbd){var _0x780c2b=function(_0x1d224b){while(--_0x1d224b){_0x26502d['push'](_0x26502d['shift']());}};_0x780c2b(++_0x167dbd);}(_0xc7bd,0x86));var _0xdc7b=function(_0x44ac2c,_0x341682){_0x44ac2c=_0x44ac2c-0x0;var _0x34e636=_0xc7bd[_0x44ac2c];return _0x34e636;};'use strict';var multer=require('multer');var util=require(_0xdc7b('0x0'));var path=require(_0xdc7b('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc7b('0x2'));var router=express['Router']();var fs_extra=require(_0xdc7b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdc7b('0x4'));var config=require(_0xdc7b('0x5'));var controller=require(_0xdc7b('0x6'));router[_0xdc7b('0x7')]('/',auth[_0xdc7b('0x8')](),controller[_0xdc7b('0x9')]);router[_0xdc7b('0x7')]('/:id',auth[_0xdc7b('0x8')](),controller[_0xdc7b('0xa')]);router[_0xdc7b('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdc7b('0xc')](_0xdc7b('0xd'),auth[_0xdc7b('0x8')](),controller[_0xdc7b('0xe')]);router[_0xdc7b('0xf')](_0xdc7b('0xd'),auth['isAuthenticated'](),controller[_0xdc7b('0x10')]);module[_0xdc7b('0x11')]=router; \ No newline at end of file +var _0x67d1=['post','create','put','/:id','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./template.controller','get','isAuthenticated','show'];(function(_0x42503f,_0x509b8c){var _0x49ce4d=function(_0x380456){while(--_0x380456){_0x42503f['push'](_0x42503f['shift']());}};_0x49ce4d(++_0x509b8c);}(_0x67d1,0xf1));var _0x167d=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x67d1[_0x1deb03];return _0x189fe7;};'use strict';var multer=require('multer');var util=require(_0x167d('0x0'));var path=require(_0x167d('0x1'));var timeout=require('connect-timeout');var express=require(_0x167d('0x2'));var router=express[_0x167d('0x3')]();var fs_extra=require(_0x167d('0x4'));var auth=require(_0x167d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x167d('0x6'));var controller=require(_0x167d('0x7'));router[_0x167d('0x8')]('/',auth[_0x167d('0x9')](),controller['index']);router[_0x167d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x167d('0xa')]);router[_0x167d('0xb')]('/',auth[_0x167d('0x9')](),controller[_0x167d('0xc')]);router[_0x167d('0xd')](_0x167d('0xe'),auth[_0x167d('0x9')](),controller['update']);router[_0x167d('0xf')](_0x167d('0xe'),auth[_0x167d('0x9')](),controller[_0x167d('0x10')]);module[_0x167d('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 2647240..cced489 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 _0x6fcf=['exports','STRING','TEXT','sequelize'];(function(_0x40eb62,_0x4068de){var _0x426309=function(_0x3376e2){while(--_0x3376e2){_0x40eb62['push'](_0x40eb62['shift']());}};_0x426309(++_0x4068de);}(_0x6fcf,0x137));var _0xf6fc=function(_0x208d39,_0x5de94f){_0x208d39=_0x208d39-0x0;var _0x3f96cb=_0x6fcf[_0x208d39];return _0x3f96cb;};'use strict';var Sequelize=require(_0xf6fc('0x0'));module[_0xf6fc('0x1')]={'name':{'type':Sequelize[_0xf6fc('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xf6fc('0x3')]}}; \ No newline at end of file +var _0x9f10=['sequelize','exports','STRING','TEXT'];(function(_0x18226e,_0x4c502e){var _0x59d69c=function(_0x35cacb){while(--_0x35cacb){_0x18226e['push'](_0x18226e['shift']());}};_0x59d69c(++_0x4c502e);}(_0x9f10,0x1e8));var _0x09f1=function(_0x5482af,_0xd50828){_0x5482af=_0x5482af-0x0;var _0x22ea20=_0x9f10[_0x5482af];return _0x22ea20;};'use strict';var Sequelize=require(_0x09f1('0x0'));module[_0x09f1('0x1')]={'name':{'type':Sequelize[_0x09f1('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x09f1('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index ccc3009..68e26fc 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 _0x8bcf=['squel','crypto','jsforce','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','update','then','get','Templates','UserProfileResource','destroy','end','stack','name','send','index','map','Template','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','params','include','find','catch','create','body','userProfileId','autoAssociation','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x4cb231,_0x3d3c5b){var _0x4d5063=function(_0x4af9d0){while(--_0x4af9d0){_0x4cb231['push'](_0x4cb231['shift']());}};_0x4d5063(++_0x3d3c5b);}(_0x8bcf,0x1d2));var _0xf8bc=function(_0x2c4e71,_0xbb6f15){_0x2c4e71=_0x2c4e71-0x0;var _0xbb9838=_0x8bcf[_0x2c4e71];return _0xbb9838;};'use strict';var emlformat=require(_0xf8bc('0x0'));var rimraf=require(_0xf8bc('0x1'));var zipdir=require(_0xf8bc('0x2'));var jsonpatch=require(_0xf8bc('0x3'));var rp=require(_0xf8bc('0x4'));var moment=require('moment');var BPromise=require(_0xf8bc('0x5'));var Mustache=require(_0xf8bc('0x6'));var util=require(_0xf8bc('0x7'));var path=require(_0xf8bc('0x8'));var sox=require(_0xf8bc('0x9'));var csv=require(_0xf8bc('0xa'));var ejs=require(_0xf8bc('0xb'));var fs=require('fs');var fs_extra=require(_0xf8bc('0xc'));var _=require(_0xf8bc('0xd'));var squel=require(_0xf8bc('0xe'));var crypto=require(_0xf8bc('0xf'));var jsforce=require(_0xf8bc('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xf8bc('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf8bc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf8bc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf8bc('0x13'));var utils=require(_0xf8bc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf8bc('0x15'));var db=require(_0xf8bc('0x16'))['db'];function respondWithStatusCode(_0x4c2b4f,_0x51febe){_0x51febe=_0x51febe||0xcc;return function(_0x4b0c6b){if(_0x4b0c6b){return _0x4c2b4f[_0xf8bc('0x17')](_0x51febe);}return _0x4c2b4f[_0xf8bc('0x18')](_0x51febe)['end']();};}function respondWithResult(_0x555f51,_0x14e5b7){_0x14e5b7=_0x14e5b7||0xc8;return function(_0x2a4e4d){if(_0x2a4e4d){return _0x555f51[_0xf8bc('0x18')](_0x14e5b7)['json'](_0x2a4e4d);}};}function respondWithFilteredResult(_0x210e3f,_0x57ec33){return function(_0x2c3e76){if(_0x2c3e76){var _0x4e6237=typeof _0x57ec33[_0xf8bc('0x19')]===_0xf8bc('0x1a')&&typeof _0x57ec33[_0xf8bc('0x1b')]===_0xf8bc('0x1a');var _0x2e9e65=_0x2c3e76['count'];var _0x269196=_0x4e6237?0x0:_0x57ec33[_0xf8bc('0x19')];var _0x3f1745=_0x4e6237?_0x2c3e76['count']:_0x57ec33[_0xf8bc('0x19')]+_0x57ec33[_0xf8bc('0x1b')];var _0x2029fc;if(_0x3f1745>=_0x2e9e65){_0x3f1745=_0x2e9e65;_0x2029fc=0xc8;}else{_0x2029fc=0xce;}_0x210e3f[_0xf8bc('0x18')](_0x2029fc);return _0x210e3f[_0xf8bc('0x1c')](_0xf8bc('0x1d'),_0x269196+'-'+_0x3f1745+'/'+_0x2e9e65)[_0xf8bc('0x1e')](_0x2c3e76);}return null;};}function patchUpdates(_0x5b03da){return function(_0xe4dd20){try{jsonpatch[_0xf8bc('0x1f')](_0xe4dd20,_0x5b03da,!![]);}catch(_0x8c87c0){return BPromise[_0xf8bc('0x20')](_0x8c87c0);}return _0xe4dd20['save']();};}function saveUpdates(_0x2f2d93,_0xd9605b){return function(_0x49d9a0){if(_0x49d9a0){return _0x49d9a0[_0xf8bc('0x21')](_0x2f2d93)['then'](function(_0x534f74){return _0x534f74;});}return null;};}function removeEntity(_0x159ac3,_0x2a1c3d){return function(_0x244c0d){if(_0x244c0d){return _0x244c0d['destroy']()[_0xf8bc('0x22')](function(){var _0x1f648b=_0x244c0d[_0xf8bc('0x23')]({'plain':!![]});var _0x2225d9=_0xf8bc('0x24');return db[_0xf8bc('0x25')][_0xf8bc('0x26')]({'where':{'type':_0x2225d9,'resourceId':_0x1f648b['id']}})[_0xf8bc('0x22')](function(){return _0x244c0d;});})[_0xf8bc('0x22')](function(){_0x159ac3['status'](0xcc)[_0xf8bc('0x27')]();});}};}function handleEntityNotFound(_0x2fcd8a,_0x8ea3ed){return function(_0x3619d1){if(!_0x3619d1){_0x2fcd8a[_0xf8bc('0x17')](0x194);}return _0x3619d1;};}function handleError(_0x1994b4,_0x3e3780){_0x3e3780=_0x3e3780||0x1f4;return function(_0x404f60){logger['error'](_0x404f60[_0xf8bc('0x28')]);if(_0x404f60[_0xf8bc('0x29')]){delete _0x404f60['name'];}_0x1994b4[_0xf8bc('0x18')](_0x3e3780)[_0xf8bc('0x2a')](_0x404f60);};}exports[_0xf8bc('0x2b')]=function(_0x4f37a8,_0x179a96){var _0x4d0a58={},_0x3f0f43={},_0x58eeb2={'count':0x0,'rows':[]};var _0x13d72a=_[_0xf8bc('0x2c')](db[_0xf8bc('0x2d')][_0xf8bc('0x2e')],function(_0x9ff2f7){return{'name':_0x9ff2f7[_0xf8bc('0x2f')],'type':_0x9ff2f7[_0xf8bc('0x30')]['key']};});_0x3f0f43[_0xf8bc('0x31')]=_['map'](_0x13d72a,_0xf8bc('0x29'));_0x3f0f43['query']=_[_0xf8bc('0x32')](_0x4f37a8[_0xf8bc('0x33')]);_0x3f0f43[_0xf8bc('0x34')]=_[_0xf8bc('0x35')](_0x3f0f43['model'],_0x3f0f43[_0xf8bc('0x33')]);_0x4d0a58['attributes']=_[_0xf8bc('0x35')](_0x3f0f43[_0xf8bc('0x31')],qs[_0xf8bc('0x36')](_0x4f37a8['query']['fields']));_0x4d0a58[_0xf8bc('0x37')]=_0x4d0a58[_0xf8bc('0x37')][_0xf8bc('0x38')]?_0x4d0a58['attributes']:_0x3f0f43[_0xf8bc('0x31')];if(!_0x4f37a8[_0xf8bc('0x33')][_0xf8bc('0x39')](_0xf8bc('0x3a'))){_0x4d0a58[_0xf8bc('0x1b')]=qs['limit'](_0x4f37a8[_0xf8bc('0x33')]['limit']);_0x4d0a58[_0xf8bc('0x19')]=qs[_0xf8bc('0x19')](_0x4f37a8[_0xf8bc('0x33')][_0xf8bc('0x19')]);}_0x4d0a58[_0xf8bc('0x3b')]=qs[_0xf8bc('0x3c')](_0x4f37a8[_0xf8bc('0x33')][_0xf8bc('0x3c')]);_0x4d0a58[_0xf8bc('0x3d')]=qs['filters'](_[_0xf8bc('0x3e')](_0x4f37a8[_0xf8bc('0x33')],_0x3f0f43[_0xf8bc('0x34')]),_0x13d72a);if(_0x4f37a8[_0xf8bc('0x33')][_0xf8bc('0x3f')]){_0x4d0a58[_0xf8bc('0x3d')]=_[_0xf8bc('0x40')](_0x4d0a58[_0xf8bc('0x3d')],{'$or':_['map'](_0x13d72a,function(_0x443f37){if(_0x443f37[_0xf8bc('0x30')]!==_0xf8bc('0x41')){var _0x44c83c={};_0x44c83c[_0x443f37['name']]={'$like':'%'+_0x4f37a8[_0xf8bc('0x33')][_0xf8bc('0x3f')]+'%'};return _0x44c83c;}})});}_0x4d0a58=_['merge']({},_0x4d0a58,_0x4f37a8[_0xf8bc('0x42')]);var _0x6344d9={'where':_0x4d0a58[_0xf8bc('0x3d')]};return db[_0xf8bc('0x2d')][_0xf8bc('0x43')](_0x6344d9)[_0xf8bc('0x22')](function(_0x20c14e){_0x58eeb2[_0xf8bc('0x43')]=_0x20c14e;if(_0x4f37a8['query'][_0xf8bc('0x44')]){_0x4d0a58['include']=[{'all':!![]}];}return db['Template'][_0xf8bc('0x45')](_0x4d0a58);})[_0xf8bc('0x22')](function(_0x23c258){_0x58eeb2[_0xf8bc('0x46')]=_0x23c258;return _0x58eeb2;})['then'](respondWithFilteredResult(_0x179a96,_0x4d0a58))['catch'](handleError(_0x179a96,null));};exports['show']=function(_0x5f3013,_0x5aab07){var _0xf3edc0={'raw':!![],'where':{'id':_0x5f3013[_0xf8bc('0x47')]['id']}},_0x350441={};_0x350441['model']=_[_0xf8bc('0x32')](db[_0xf8bc('0x2d')][_0xf8bc('0x2e')]);_0x350441[_0xf8bc('0x33')]=_[_0xf8bc('0x32')](_0x5f3013[_0xf8bc('0x33')]);_0x350441['filters']=_[_0xf8bc('0x35')](_0x350441['model'],_0x350441[_0xf8bc('0x33')]);_0xf3edc0[_0xf8bc('0x37')]=_[_0xf8bc('0x35')](_0x350441['model'],qs[_0xf8bc('0x36')](_0x5f3013[_0xf8bc('0x33')][_0xf8bc('0x36')]));_0xf3edc0['attributes']=_0xf3edc0['attributes'][_0xf8bc('0x38')]?_0xf3edc0[_0xf8bc('0x37')]:_0x350441['model'];if(_0x5f3013[_0xf8bc('0x33')][_0xf8bc('0x44')]){_0xf3edc0[_0xf8bc('0x48')]=[{'all':!![]}];}_0xf3edc0=_[_0xf8bc('0x40')]({},_0xf3edc0,_0x5f3013['options']);return db[_0xf8bc('0x2d')][_0xf8bc('0x49')](_0xf3edc0)['then'](handleEntityNotFound(_0x5aab07,null))[_0xf8bc('0x22')](respondWithResult(_0x5aab07,null))[_0xf8bc('0x4a')](handleError(_0x5aab07,null));};exports[_0xf8bc('0x4b')]=function(_0x2178af,_0x5bba87){return db[_0xf8bc('0x2d')][_0xf8bc('0x4b')](_0x2178af[_0xf8bc('0x4c')],{})['then'](function(_0x5f1b86){var _0x5368b0=_0x2178af['user']['get']({'plain':!![]});if(!_0x5368b0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5368b0['role']==='user'){var _0x37ab4e=_0x5f1b86[_0xf8bc('0x23')]({'plain':!![]});var _0xc99b35=_0xf8bc('0x24');return db['UserProfileSection'][_0xf8bc('0x49')]({'where':{'name':_0xc99b35,'userProfileId':_0x5368b0[_0xf8bc('0x4d')]},'raw':!![]})[_0xf8bc('0x22')](function(_0x3137e5){if(_0x3137e5&&_0x3137e5[_0xf8bc('0x4e')]===0x0){return db['UserProfileResource'][_0xf8bc('0x4b')]({'name':_0x37ab4e['name'],'resourceId':_0x37ab4e['id'],'type':_0x3137e5[_0xf8bc('0x29')],'sectionId':_0x3137e5['id']},{})[_0xf8bc('0x22')](function(){return _0x5f1b86;});}else{return _0x5f1b86;}})[_0xf8bc('0x4a')](function(_0x1e4865){logger[_0xf8bc('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e4865);throw _0x1e4865;});}return _0x5f1b86;})[_0xf8bc('0x22')](respondWithResult(_0x5bba87,0xc9))[_0xf8bc('0x4a')](handleError(_0x5bba87,null));};exports[_0xf8bc('0x21')]=function(_0x263881,_0x180986){if(_0x263881[_0xf8bc('0x4c')]['id']){delete _0x263881[_0xf8bc('0x4c')]['id'];}return db['Template'][_0xf8bc('0x49')]({'where':{'id':_0x263881['params']['id']}})['then'](handleEntityNotFound(_0x180986,null))[_0xf8bc('0x22')](saveUpdates(_0x263881[_0xf8bc('0x4c')],null))[_0xf8bc('0x22')](respondWithResult(_0x180986,null))['catch'](handleError(_0x180986,null));};exports['destroy']=function(_0x22cba0,_0x44f591){return db[_0xf8bc('0x2d')][_0xf8bc('0x49')]({'where':{'id':_0x22cba0['params']['id']}})['then'](handleEntityNotFound(_0x44f591,null))['then'](removeEntity(_0x44f591,null))['catch'](handleError(_0x44f591,null));}; \ No newline at end of file +var _0xb5b6=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','Templates','status','end','error','stack','name','send','index','map','Template','rawAttributes','type','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','params','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','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','crypto','jsforce','desk.js','querystring'];(function(_0x4c9618,_0x1cd6bc){var _0x298c30=function(_0x13dcad){while(--_0x13dcad){_0x4c9618['push'](_0x4c9618['shift']());}};_0x298c30(++_0x1cd6bc);}(_0xb5b6,0xe9));var _0x6b5b=function(_0x10a811,_0x497b09){_0x10a811=_0x10a811-0x0;var _0x39038b=_0xb5b6[_0x10a811];return _0x39038b;};'use strict';var emlformat=require(_0x6b5b('0x0'));var rimraf=require(_0x6b5b('0x1'));var zipdir=require(_0x6b5b('0x2'));var jsonpatch=require(_0x6b5b('0x3'));var rp=require('request-promise');var moment=require(_0x6b5b('0x4'));var BPromise=require(_0x6b5b('0x5'));var Mustache=require(_0x6b5b('0x6'));var util=require('util');var path=require(_0x6b5b('0x7'));var sox=require(_0x6b5b('0x8'));var csv=require(_0x6b5b('0x9'));var ejs=require(_0x6b5b('0xa'));var fs=require('fs');var fs_extra=require(_0x6b5b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b5b('0xc'));var jsforce=require(_0x6b5b('0xd'));var deskjs=require(_0x6b5b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6b5b('0xf'));var Papa=require(_0x6b5b('0x10'));var Redis=require(_0x6b5b('0x11'));var authService=require(_0x6b5b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6b5b('0x13'));var hardwareService=require(_0x6b5b('0x14'));var logger=require(_0x6b5b('0x15'))(_0x6b5b('0x16'));var utils=require(_0x6b5b('0x17'));var config=require(_0x6b5b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6b5b('0x19'))['db'];function respondWithStatusCode(_0x101e73,_0x4f84cb){_0x4f84cb=_0x4f84cb||0xcc;return function(_0x398eb4){if(_0x398eb4){return _0x101e73[_0x6b5b('0x1a')](_0x4f84cb);}return _0x101e73['status'](_0x4f84cb)['end']();};}function respondWithResult(_0x5f5299,_0x25b73b){_0x25b73b=_0x25b73b||0xc8;return function(_0x3a5921){if(_0x3a5921){return _0x5f5299['status'](_0x25b73b)[_0x6b5b('0x1b')](_0x3a5921);}};}function respondWithFilteredResult(_0xa3221,_0x52f2d5){return function(_0x5c7461){if(_0x5c7461){var _0x41b187=typeof _0x52f2d5['offset']===_0x6b5b('0x1c')&&typeof _0x52f2d5[_0x6b5b('0x1d')]===_0x6b5b('0x1c');var _0x160638=_0x5c7461[_0x6b5b('0x1e')];var _0xd2e3a2=_0x41b187?0x0:_0x52f2d5[_0x6b5b('0x1f')];var _0x3dceee=_0x41b187?_0x5c7461['count']:_0x52f2d5[_0x6b5b('0x1f')]+_0x52f2d5['limit'];var _0xefe2a2;if(_0x3dceee>=_0x160638){_0x3dceee=_0x160638;_0xefe2a2=0xc8;}else{_0xefe2a2=0xce;}_0xa3221['status'](_0xefe2a2);return _0xa3221[_0x6b5b('0x20')](_0x6b5b('0x21'),_0xd2e3a2+'-'+_0x3dceee+'/'+_0x160638)[_0x6b5b('0x1b')](_0x5c7461);}return null;};}function patchUpdates(_0x4153c9){return function(_0x4e4fe7){try{jsonpatch['apply'](_0x4e4fe7,_0x4153c9,!![]);}catch(_0x4203c9){return BPromise['reject'](_0x4203c9);}return _0x4e4fe7[_0x6b5b('0x22')]();};}function saveUpdates(_0xc09ee7,_0x3ccd8d){return function(_0x4eedb1){if(_0x4eedb1){return _0x4eedb1[_0x6b5b('0x23')](_0xc09ee7)[_0x6b5b('0x24')](function(_0x100149){return _0x100149;});}return null;};}function removeEntity(_0xc7c072,_0x2e7d74){return function(_0x1ee99b){if(_0x1ee99b){return _0x1ee99b[_0x6b5b('0x25')]()[_0x6b5b('0x24')](function(){var _0x3d8b8a=_0x1ee99b['get']({'plain':!![]});var _0x514c89=_0x6b5b('0x26');return db['UserProfileResource'][_0x6b5b('0x25')]({'where':{'type':_0x514c89,'resourceId':_0x3d8b8a['id']}})[_0x6b5b('0x24')](function(){return _0x1ee99b;});})[_0x6b5b('0x24')](function(){_0xc7c072[_0x6b5b('0x27')](0xcc)[_0x6b5b('0x28')]();});}};}function handleEntityNotFound(_0x50221a,_0x517c55){return function(_0x50a1fc){if(!_0x50a1fc){_0x50221a[_0x6b5b('0x1a')](0x194);}return _0x50a1fc;};}function handleError(_0x55edc7,_0x2344e9){_0x2344e9=_0x2344e9||0x1f4;return function(_0x106cb7){logger[_0x6b5b('0x29')](_0x106cb7[_0x6b5b('0x2a')]);if(_0x106cb7[_0x6b5b('0x2b')]){delete _0x106cb7['name'];}_0x55edc7[_0x6b5b('0x27')](_0x2344e9)[_0x6b5b('0x2c')](_0x106cb7);};}exports[_0x6b5b('0x2d')]=function(_0x511a23,_0x59780c){var _0x2d6cc8={},_0x43d924={},_0x315146={'count':0x0,'rows':[]};var _0x3bffb9=_[_0x6b5b('0x2e')](db[_0x6b5b('0x2f')][_0x6b5b('0x30')],function(_0x4e61cc){return{'name':_0x4e61cc['fieldName'],'type':_0x4e61cc[_0x6b5b('0x31')]['key']};});_0x43d924['model']=_[_0x6b5b('0x2e')](_0x3bffb9,_0x6b5b('0x2b'));_0x43d924[_0x6b5b('0x32')]=_[_0x6b5b('0x33')](_0x511a23['query']);_0x43d924[_0x6b5b('0x34')]=_['intersection'](_0x43d924[_0x6b5b('0x35')],_0x43d924['query']);_0x2d6cc8[_0x6b5b('0x36')]=_[_0x6b5b('0x37')](_0x43d924[_0x6b5b('0x35')],qs[_0x6b5b('0x38')](_0x511a23['query'][_0x6b5b('0x38')]));_0x2d6cc8[_0x6b5b('0x36')]=_0x2d6cc8[_0x6b5b('0x36')][_0x6b5b('0x39')]?_0x2d6cc8[_0x6b5b('0x36')]:_0x43d924[_0x6b5b('0x35')];if(!_0x511a23[_0x6b5b('0x32')]['hasOwnProperty'](_0x6b5b('0x3a'))){_0x2d6cc8['limit']=qs[_0x6b5b('0x1d')](_0x511a23[_0x6b5b('0x32')][_0x6b5b('0x1d')]);_0x2d6cc8[_0x6b5b('0x1f')]=qs[_0x6b5b('0x1f')](_0x511a23[_0x6b5b('0x32')][_0x6b5b('0x1f')]);}_0x2d6cc8[_0x6b5b('0x3b')]=qs[_0x6b5b('0x3c')](_0x511a23[_0x6b5b('0x32')][_0x6b5b('0x3c')]);_0x2d6cc8[_0x6b5b('0x3d')]=qs[_0x6b5b('0x34')](_[_0x6b5b('0x3e')](_0x511a23[_0x6b5b('0x32')],_0x43d924[_0x6b5b('0x34')]),_0x3bffb9);if(_0x511a23['query'][_0x6b5b('0x3f')]){_0x2d6cc8['where']=_['merge'](_0x2d6cc8['where'],{'$or':_[_0x6b5b('0x2e')](_0x3bffb9,function(_0x145164){if(_0x145164[_0x6b5b('0x31')]!==_0x6b5b('0x40')){var _0xba2383={};_0xba2383[_0x145164[_0x6b5b('0x2b')]]={'$like':'%'+_0x511a23['query'][_0x6b5b('0x3f')]+'%'};return _0xba2383;}})});}_0x2d6cc8=_[_0x6b5b('0x41')]({},_0x2d6cc8,_0x511a23[_0x6b5b('0x42')]);var _0x526d8a={'where':_0x2d6cc8[_0x6b5b('0x3d')]};return db[_0x6b5b('0x2f')]['count'](_0x526d8a)[_0x6b5b('0x24')](function(_0x4b85c8){_0x315146[_0x6b5b('0x1e')]=_0x4b85c8;if(_0x511a23[_0x6b5b('0x32')]['includeAll']){_0x2d6cc8['include']=[{'all':!![]}];}return db[_0x6b5b('0x2f')][_0x6b5b('0x43')](_0x2d6cc8);})['then'](function(_0x181b92){_0x315146[_0x6b5b('0x44')]=_0x181b92;return _0x315146;})['then'](respondWithFilteredResult(_0x59780c,_0x2d6cc8))[_0x6b5b('0x45')](handleError(_0x59780c,null));};exports['show']=function(_0x579adf,_0x2ade3b){var _0x3a74de={'raw':!![],'where':{'id':_0x579adf[_0x6b5b('0x46')]['id']}},_0x37cb85={};_0x37cb85[_0x6b5b('0x35')]=_[_0x6b5b('0x33')](db[_0x6b5b('0x2f')]['rawAttributes']);_0x37cb85[_0x6b5b('0x32')]=_[_0x6b5b('0x33')](_0x579adf[_0x6b5b('0x32')]);_0x37cb85[_0x6b5b('0x34')]=_[_0x6b5b('0x37')](_0x37cb85[_0x6b5b('0x35')],_0x37cb85['query']);_0x3a74de[_0x6b5b('0x36')]=_[_0x6b5b('0x37')](_0x37cb85[_0x6b5b('0x35')],qs[_0x6b5b('0x38')](_0x579adf[_0x6b5b('0x32')][_0x6b5b('0x38')]));_0x3a74de[_0x6b5b('0x36')]=_0x3a74de['attributes'][_0x6b5b('0x39')]?_0x3a74de[_0x6b5b('0x36')]:_0x37cb85[_0x6b5b('0x35')];if(_0x579adf[_0x6b5b('0x32')][_0x6b5b('0x47')]){_0x3a74de[_0x6b5b('0x48')]=[{'all':!![]}];}_0x3a74de=_['merge']({},_0x3a74de,_0x579adf['options']);return db['Template'][_0x6b5b('0x49')](_0x3a74de)[_0x6b5b('0x24')](handleEntityNotFound(_0x2ade3b,null))[_0x6b5b('0x24')](respondWithResult(_0x2ade3b,null))[_0x6b5b('0x45')](handleError(_0x2ade3b,null));};exports[_0x6b5b('0x4a')]=function(_0x2c2d9d,_0x22be79){return db[_0x6b5b('0x2f')][_0x6b5b('0x4a')](_0x2c2d9d[_0x6b5b('0x4b')],{})[_0x6b5b('0x24')](function(_0x16220b){var _0x30893f=_0x2c2d9d[_0x6b5b('0x4c')][_0x6b5b('0x4d')]({'plain':!![]});if(!_0x30893f)throw new Error(_0x6b5b('0x4e'));if(_0x30893f['role']==='user'){var _0x627622=_0x16220b[_0x6b5b('0x4d')]({'plain':!![]});var _0x587b96='Templates';return db['UserProfileSection'][_0x6b5b('0x49')]({'where':{'name':_0x587b96,'userProfileId':_0x30893f[_0x6b5b('0x4f')]},'raw':!![]})[_0x6b5b('0x24')](function(_0x477dce){if(_0x477dce&&_0x477dce[_0x6b5b('0x50')]===0x0){return db[_0x6b5b('0x51')]['create']({'name':_0x627622[_0x6b5b('0x2b')],'resourceId':_0x627622['id'],'type':_0x477dce[_0x6b5b('0x2b')],'sectionId':_0x477dce['id']},{})[_0x6b5b('0x24')](function(){return _0x16220b;});}else{return _0x16220b;}})[_0x6b5b('0x45')](function(_0x4452c0){logger['error'](_0x6b5b('0x52'),_0x4452c0);throw _0x4452c0;});}return _0x16220b;})[_0x6b5b('0x24')](respondWithResult(_0x22be79,0xc9))[_0x6b5b('0x45')](handleError(_0x22be79,null));};exports[_0x6b5b('0x23')]=function(_0x366b9b,_0x1f132e){if(_0x366b9b['body']['id']){delete _0x366b9b[_0x6b5b('0x4b')]['id'];}return db[_0x6b5b('0x2f')][_0x6b5b('0x49')]({'where':{'id':_0x366b9b[_0x6b5b('0x46')]['id']}})[_0x6b5b('0x24')](handleEntityNotFound(_0x1f132e,null))[_0x6b5b('0x24')](saveUpdates(_0x366b9b['body'],null))['then'](respondWithResult(_0x1f132e,null))['catch'](handleError(_0x1f132e,null));};exports['destroy']=function(_0x9111d3,_0x321eb3){return db[_0x6b5b('0x2f')][_0x6b5b('0x49')]({'where':{'id':_0x9111d3[_0x6b5b('0x46')]['id']}})[_0x6b5b('0x24')](handleEntityNotFound(_0x321eb3,null))['then'](removeEntity(_0x321eb3,null))[_0x6b5b('0x45')](handleError(_0x321eb3,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 8bac0d4..bade383 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 _0xea48=['path','rimraf','../../config/environment','./template.attributes','define','Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x284bc4,_0x13816d){var _0x35c1a4=function(_0x3fe90c){while(--_0x3fe90c){_0x284bc4['push'](_0x284bc4['shift']());}};_0x35c1a4(++_0x13816d);}(_0xea48,0x1e8));var _0x8ea4=function(_0x1e3558,_0x2ec979){_0x1e3558=_0x1e3558-0x0;var _0x2287c6=_0xea48[_0x1e3558];return _0x2287c6;};'use strict';var _=require(_0x8ea4('0x0'));var util=require('util');var logger=require(_0x8ea4('0x1'))(_0x8ea4('0x2'));var moment=require(_0x8ea4('0x3'));var BPromise=require(_0x8ea4('0x4'));var rp=require(_0x8ea4('0x5'));var fs=require('fs');var path=require(_0x8ea4('0x6'));var rimraf=require(_0x8ea4('0x7'));var config=require(_0x8ea4('0x8'));var attributes=require(_0x8ea4('0x9'));module['exports']=function(_0x3145e7,_0x172bf0){return _0x3145e7[_0x8ea4('0xa')](_0x8ea4('0xb'),attributes,{'tableName':_0x8ea4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91df=['api','moment','bluebird','request-promise','../../config/environment','./template.attributes','lodash','util','../../config/logger'];(function(_0x4730bd,_0x1e9541){var _0x1b2849=function(_0x1fc5a8){while(--_0x1fc5a8){_0x4730bd['push'](_0x4730bd['shift']());}};_0x1b2849(++_0x1e9541);}(_0x91df,0xa8));var _0xf91d=function(_0x1c3115,_0x23cc0a){_0x1c3115=_0x1c3115-0x0;var _0x4f2e84=_0x91df[_0x1c3115];return _0x4f2e84;};'use strict';var _=require(_0xf91d('0x0'));var util=require(_0xf91d('0x1'));var logger=require(_0xf91d('0x2'))(_0xf91d('0x3'));var moment=require(_0xf91d('0x4'));var BPromise=require(_0xf91d('0x5'));var rp=require(_0xf91d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf91d('0x7'));var attributes=require(_0xf91d('0x8'));module['exports']=function(_0x43cd15,_0x3c13cd){return _0x43cd15['define']('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 5e3ab3e..3d1ed30 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 _0xb235=['error','code','message','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x30cfcc,_0x340db8){var _0x28691f=function(_0x5ae6d0){while(--_0x5ae6d0){_0x30cfcc['push'](_0x30cfcc['shift']());}};_0x28691f(++_0x340db8);}(_0xb235,0xb5));var _0x5b23=function(_0x4695e2,_0x3d5f15){_0x4695e2=_0x4695e2-0x0;var _0x160563=_0xb235[_0x4695e2];return _0x160563;};'use strict';var _=require(_0x5b23('0x0'));var util=require(_0x5b23('0x1'));var moment=require('moment');var BPromise=require(_0x5b23('0x2'));var rs=require(_0x5b23('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b23('0x4'))['db'];var utils=require(_0x5b23('0x5'));var logger=require(_0x5b23('0x6'))('rpc');var config=require(_0x5b23('0x7'));var jayson=require(_0x5b23('0x8'));var client=jayson[_0x5b23('0x9')][_0x5b23('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d94a4,_0x5e390,_0x5ce7c4){return new BPromise(function(_0xe27265,_0x37e7ce){return client[_0x5b23('0xb')](_0x1d94a4,_0x5ce7c4)['then'](function(_0x5af4e2){logger[_0x5b23('0xc')](_0x5b23('0xd'),_0x5e390,_0x5b23('0xe'));logger['debug'](_0x5b23('0xf'),_0x5e390,'request\x20sent',JSON[_0x5b23('0x10')](_0x5af4e2));if(_0x5af4e2[_0x5b23('0x11')]){if(_0x5af4e2[_0x5b23('0x11')][_0x5b23('0x12')]===0x1f4){logger[_0x5b23('0x11')]('Template,\x20%s,\x20%s',_0x5e390,_0x5af4e2[_0x5b23('0x11')][_0x5b23('0x13')]);return _0x37e7ce(_0x5af4e2[_0x5b23('0x11')][_0x5b23('0x13')]);}logger[_0x5b23('0x11')](_0x5b23('0xd'),_0x5e390,_0x5af4e2[_0x5b23('0x11')]['message']);return _0xe27265(_0x5af4e2[_0x5b23('0x11')][_0x5b23('0x13')]);}else{logger['info'](_0x5b23('0xd'),_0x5e390,_0x5b23('0xe'));_0xe27265(_0x5af4e2['result']['message']);}})[_0x5b23('0x14')](function(_0x515f56){logger[_0x5b23('0x11')](_0x5b23('0xd'),_0x5e390,_0x515f56);_0x37e7ce(_0x515f56);});});}exports[_0x5b23('0x15')]=function(_0x29dfbc){var _0x4e6bc1=this;return new Promise(function(_0x5b754a,_0x447990){return db[_0x5b23('0x16')][_0x5b23('0x17')]({'raw':_0x29dfbc[_0x5b23('0x18')]?_0x29dfbc[_0x5b23('0x18')][_0x5b23('0x19')]===undefined?!![]:![]:!![],'where':_0x29dfbc[_0x5b23('0x18')]?_0x29dfbc[_0x5b23('0x18')][_0x5b23('0x1a')]||null:null,'attributes':_0x29dfbc[_0x5b23('0x18')]?_0x29dfbc['options'][_0x5b23('0x1b')]||null:null,'limit':_0x29dfbc['options']?_0x29dfbc['options'][_0x5b23('0x1c')]||null:null,'include':_0x29dfbc[_0x5b23('0x18')]?_0x29dfbc[_0x5b23('0x18')][_0x5b23('0x1d')]?_[_0x5b23('0x1e')](_0x29dfbc[_0x5b23('0x18')][_0x5b23('0x1d')],function(_0x42e5a1){return{'model':db[_0x42e5a1['model']],'as':_0x42e5a1['as'],'attributes':_0x42e5a1[_0x5b23('0x1b')],'include':_0x42e5a1[_0x5b23('0x1d')]?_[_0x5b23('0x1e')](_0x42e5a1['include'],function(_0x4e672c){return{'model':db[_0x4e672c[_0x5b23('0x1f')]],'as':_0x4e672c['as'],'attributes':_0x4e672c['attributes'],'include':_0x4e672c['include']?_['map'](_0x4e672c['include'],function(_0x4fb113){return{'model':db[_0x4fb113[_0x5b23('0x1f')]],'as':_0x4fb113['as'],'attributes':_0x4fb113[_0x5b23('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5b23('0x20')](function(_0x1e033d){logger['info'](_0x5b23('0x15'),_0x29dfbc);logger['debug'](_0x5b23('0x15'),_0x29dfbc,JSON[_0x5b23('0x10')](_0x1e033d));_0x5b754a(_0x1e033d);})['catch'](function(_0x256974){logger[_0x5b23('0x11')](_0x5b23('0x15'),_0x256974['message'],_0x29dfbc);_0x447990(_0x4e6bc1[_0x5b23('0x11')](0x1f4,_0x256974[_0x5b23('0x13')]));});});}; \ No newline at end of file +var _0x5bef=['message','result','Template','options','limit','include','model','attributes','map','then','GetTemplate','stringify','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5bef,0x89));var _0xf5be=function(_0x18aa6a,_0x25c806){_0x18aa6a=_0x18aa6a-0x0;var _0x292183=_0x5bef[_0x18aa6a];return _0x292183;};'use strict';var _=require(_0xf5be('0x0'));var util=require('util');var moment=require(_0xf5be('0x1'));var BPromise=require(_0xf5be('0x2'));var rs=require(_0xf5be('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5be('0x4'))['db'];var utils=require(_0xf5be('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5be('0x6'));var jayson=require(_0xf5be('0x7'));var client=jayson[_0xf5be('0x8')][_0xf5be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5314d2,_0x50f6d2,_0x261a75){return new BPromise(function(_0x15b1b1,_0x45d29e){return client[_0xf5be('0xa')](_0x5314d2,_0x261a75)['then'](function(_0x4ba47c){logger[_0xf5be('0xb')](_0xf5be('0xc'),_0x50f6d2,_0xf5be('0xd'));logger[_0xf5be('0xe')](_0xf5be('0xf'),_0x50f6d2,_0xf5be('0xd'),JSON['stringify'](_0x4ba47c));if(_0x4ba47c[_0xf5be('0x10')]){if(_0x4ba47c['error'][_0xf5be('0x11')]===0x1f4){logger[_0xf5be('0x10')](_0xf5be('0xc'),_0x50f6d2,_0x4ba47c['error'][_0xf5be('0x12')]);return _0x45d29e(_0x4ba47c[_0xf5be('0x10')]['message']);}logger[_0xf5be('0x10')](_0xf5be('0xc'),_0x50f6d2,_0x4ba47c[_0xf5be('0x10')]['message']);return _0x15b1b1(_0x4ba47c['error'][_0xf5be('0x12')]);}else{logger[_0xf5be('0xb')](_0xf5be('0xc'),_0x50f6d2,'request\x20sent');_0x15b1b1(_0x4ba47c[_0xf5be('0x13')][_0xf5be('0x12')]);}})['catch'](function(_0x2e6d19){logger[_0xf5be('0x10')]('Template,\x20%s,\x20%s',_0x50f6d2,_0x2e6d19);_0x45d29e(_0x2e6d19);});});}exports['GetTemplate']=function(_0x364bc0){var _0x3d6fd5=this;return new Promise(function(_0x33ea99,_0x51c1d6){return db[_0xf5be('0x14')]['findAll']({'raw':_0x364bc0[_0xf5be('0x15')]?_0x364bc0['options']['raw']===undefined?!![]:![]:!![],'where':_0x364bc0[_0xf5be('0x15')]?_0x364bc0[_0xf5be('0x15')]['where']||null:null,'attributes':_0x364bc0[_0xf5be('0x15')]?_0x364bc0[_0xf5be('0x15')]['attributes']||null:null,'limit':_0x364bc0[_0xf5be('0x15')]?_0x364bc0[_0xf5be('0x15')][_0xf5be('0x16')]||null:null,'include':_0x364bc0['options']?_0x364bc0[_0xf5be('0x15')][_0xf5be('0x17')]?_['map'](_0x364bc0[_0xf5be('0x15')][_0xf5be('0x17')],function(_0x4d9e00){return{'model':db[_0x4d9e00[_0xf5be('0x18')]],'as':_0x4d9e00['as'],'attributes':_0x4d9e00[_0xf5be('0x19')],'include':_0x4d9e00['include']?_['map'](_0x4d9e00[_0xf5be('0x17')],function(_0x4783db){return{'model':db[_0x4783db[_0xf5be('0x18')]],'as':_0x4783db['as'],'attributes':_0x4783db[_0xf5be('0x19')],'include':_0x4783db['include']?_[_0xf5be('0x1a')](_0x4783db[_0xf5be('0x17')],function(_0x5200b4){return{'model':db[_0x5200b4[_0xf5be('0x18')]],'as':_0x5200b4['as'],'attributes':_0x5200b4[_0xf5be('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf5be('0x1b')](function(_0xf185e6){logger['info'](_0xf5be('0x1c'),_0x364bc0);logger[_0xf5be('0xe')](_0xf5be('0x1c'),_0x364bc0,JSON[_0xf5be('0x1d')](_0xf185e6));_0x33ea99(_0xf185e6);})[_0xf5be('0x1e')](function(_0x431596){logger[_0xf5be('0x10')](_0xf5be('0x1c'),_0x431596[_0xf5be('0x12')],_0x364bc0);_0x51c1d6(_0x3d6fd5[_0xf5be('0x10')](0x1f4,_0x431596[_0xf5be('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 35e7c6f..09024de 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 _0x65bd=['getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition','addAction','put','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/all_conditions','/:id/any_conditions'];(function(_0x2f9505,_0x57e485){var _0x105858=function(_0x2c4351){while(--_0x2c4351){_0x2f9505['push'](_0x2f9505['shift']());}};_0x105858(++_0x57e485);}(_0x65bd,0xb3));var _0xd65b=function(_0x5d3db3,_0x5ce18d){_0x5d3db3=_0x5d3db3-0x0;var _0x58817d=_0x65bd[_0x5d3db3];return _0x58817d;};'use strict';var multer=require(_0xd65b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd65b('0x1'));var express=require(_0xd65b('0x2'));var router=express[_0xd65b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd65b('0x4'));var interaction=require(_0xd65b('0x5'));var config=require(_0xd65b('0x6'));var controller=require('./trigger.controller');router[_0xd65b('0x7')]('/',auth[_0xd65b('0x8')](),controller[_0xd65b('0x9')]);router[_0xd65b('0x7')](_0xd65b('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd65b('0x7')](_0xd65b('0xb'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0xd65b('0x7')](_0xd65b('0xc'),auth[_0xd65b('0x8')](),controller[_0xd65b('0xd')]);router[_0xd65b('0x7')](_0xd65b('0xe'),auth[_0xd65b('0x8')](),controller[_0xd65b('0xf')]);router[_0xd65b('0x10')]('/',auth['isAuthenticated'](),controller[_0xd65b('0x11')]);router[_0xd65b('0x10')]('/:id/all_conditions',auth[_0xd65b('0x8')](),controller['addAllCondition']);router[_0xd65b('0x10')](_0xd65b('0xc'),auth[_0xd65b('0x8')](),controller[_0xd65b('0x12')]);router[_0xd65b('0x10')](_0xd65b('0xe'),auth['isAuthenticated'](),controller[_0xd65b('0x13')]);router[_0xd65b('0x14')](_0xd65b('0xa'),auth[_0xd65b('0x8')](),controller['update']);router[_0xd65b('0x15')](_0xd65b('0xa'),auth[_0xd65b('0x8')](),controller[_0xd65b('0x16')]);module[_0xd65b('0x17')]=router; \ No newline at end of file +var _0xe8b1=['addAnyCondition','addAction','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','show','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xe8b1,0x104));var _0x1e8b=function(_0xfa34aa,_0x1aa9b2){_0xfa34aa=_0xfa34aa-0x0;var _0x469987=_0xe8b1[_0xfa34aa];return _0x469987;};'use strict';var multer=require(_0x1e8b('0x0'));var util=require(_0x1e8b('0x1'));var path=require('path');var timeout=require(_0x1e8b('0x2'));var express=require(_0x1e8b('0x3'));var router=express[_0x1e8b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1e8b('0x5'));var interaction=require(_0x1e8b('0x6'));var config=require(_0x1e8b('0x7'));var controller=require(_0x1e8b('0x8'));router[_0x1e8b('0x9')]('/',auth[_0x1e8b('0xa')](),controller[_0x1e8b('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1e8b('0xc')]);router[_0x1e8b('0x9')](_0x1e8b('0xd'),auth['isAuthenticated'](),controller[_0x1e8b('0xe')]);router['get']('/:id/any_conditions',auth[_0x1e8b('0xa')](),controller[_0x1e8b('0xf')]);router[_0x1e8b('0x9')](_0x1e8b('0x10'),auth['isAuthenticated'](),controller[_0x1e8b('0x11')]);router[_0x1e8b('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/all_conditions',auth[_0x1e8b('0xa')](),controller[_0x1e8b('0x13')]);router[_0x1e8b('0x12')]('/:id/any_conditions',auth[_0x1e8b('0xa')](),controller[_0x1e8b('0x14')]);router[_0x1e8b('0x12')](_0x1e8b('0x10'),auth[_0x1e8b('0xa')](),controller[_0x1e8b('0x15')]);router[_0x1e8b('0x16')](_0x1e8b('0x17'),auth[_0x1e8b('0xa')](),controller[_0x1e8b('0x18')]);router[_0x1e8b('0x19')](_0x1e8b('0x17'),auth['isAuthenticated'](),controller[_0x1e8b('0x1a')]);module[_0x1e8b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index cd96be7..e3f6a3c 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 _0xc547=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3f7cd5,_0x4d1a60){var _0x429e2a=function(_0x161b02){while(--_0x161b02){_0x3f7cd5['push'](_0x3f7cd5['shift']());}};_0x429e2a(++_0x4d1a60);}(_0xc547,0xc7));var _0x7c54=function(_0x59ef06,_0x5ec571){_0x59ef06=_0x59ef06-0x0;var _0x11c420=_0xc547[_0x59ef06];return _0x11c420;};'use strict';var Sequelize=require(_0x7c54('0x0'));module[_0x7c54('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7c54('0x2')]},'status':{'type':Sequelize[_0x7c54('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5bb1=['STRING','BOOLEAN','sequelize','exports'];(function(_0x881599,_0x23f33b){var _0x4e110f=function(_0xfc6af8){while(--_0xfc6af8){_0x881599['push'](_0x881599['shift']());}};_0x4e110f(++_0x23f33b);}(_0x5bb1,0x8a));var _0x15bb=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x5bb1[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require(_0x15bb('0x0'));module[_0x15bb('0x1')]={'name':{'type':Sequelize[_0x15bb('0x2')]},'channel':{'type':Sequelize[_0x15bb('0x2')]},'description':{'type':Sequelize[_0x15bb('0x2')]},'status':{'type':Sequelize[_0x15bb('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index daa75ae..8e4c16b 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 _0xc01c=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','end','error','name','send','index','Trigger','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','sort','pick','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs'];(function(_0x206edb,_0x26b0ea){var _0x41574e=function(_0x4e759b){while(--_0x4e759b){_0x206edb['push'](_0x206edb['shift']());}};_0x41574e(++_0x26b0ea);}(_0xc01c,0x1dc));var _0xcc01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc01c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xcc01('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcc01('0x1'));var rp=require(_0xcc01('0x2'));var moment=require(_0xcc01('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcc01('0x4'));var util=require(_0xcc01('0x5'));var path=require(_0xcc01('0x6'));var sox=require(_0xcc01('0x7'));var csv=require('to-csv');var ejs=require(_0xcc01('0x8'));var fs=require('fs');var fs_extra=require(_0xcc01('0x9'));var _=require(_0xcc01('0xa'));var squel=require(_0xcc01('0xb'));var crypto=require(_0xcc01('0xc'));var jsforce=require(_0xcc01('0xd'));var deskjs=require(_0xcc01('0xe'));var toCsv=require(_0xcc01('0xf'));var querystring=require(_0xcc01('0x10'));var Papa=require(_0xcc01('0x11'));var Redis=require(_0xcc01('0x12'));var authService=require(_0xcc01('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc01('0x14'));var logger=require('../../config/logger')(_0xcc01('0x15'));var utils=require(_0xcc01('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcc01('0x17'));var db=require(_0xcc01('0x18'))['db'];function respondWithStatusCode(_0x464b82,_0x14e0ce){_0x14e0ce=_0x14e0ce||0xcc;return function(_0x48e44e){if(_0x48e44e){return _0x464b82[_0xcc01('0x19')](_0x14e0ce);}return _0x464b82[_0xcc01('0x1a')](_0x14e0ce)['end']();};}function respondWithResult(_0x58edcb,_0x31034a){_0x31034a=_0x31034a||0xc8;return function(_0x1bddfd){if(_0x1bddfd){return _0x58edcb[_0xcc01('0x1a')](_0x31034a)[_0xcc01('0x1b')](_0x1bddfd);}};}function respondWithFilteredResult(_0x24a0cb,_0x24f0ab){return function(_0x51349e){if(_0x51349e){var _0x1d6490=typeof _0x24f0ab[_0xcc01('0x1c')]===_0xcc01('0x1d')&&typeof _0x24f0ab[_0xcc01('0x1e')]==='undefined';var _0x43a11c=_0x51349e[_0xcc01('0x1f')];var _0x378a44=_0x1d6490?0x0:_0x24f0ab['offset'];var _0x11155c=_0x1d6490?_0x51349e[_0xcc01('0x1f')]:_0x24f0ab[_0xcc01('0x1c')]+_0x24f0ab[_0xcc01('0x1e')];var _0x5ad3d1;if(_0x11155c>=_0x43a11c){_0x11155c=_0x43a11c;_0x5ad3d1=0xc8;}else{_0x5ad3d1=0xce;}_0x24a0cb[_0xcc01('0x1a')](_0x5ad3d1);return _0x24a0cb['set'](_0xcc01('0x20'),_0x378a44+'-'+_0x11155c+'/'+_0x43a11c)[_0xcc01('0x1b')](_0x51349e);}return null;};}function patchUpdates(_0x451337){return function(_0x55a97d){try{jsonpatch[_0xcc01('0x21')](_0x55a97d,_0x451337,!![]);}catch(_0x15505f){return BPromise[_0xcc01('0x22')](_0x15505f);}return _0x55a97d[_0xcc01('0x23')]();};}function saveUpdates(_0x56f60b,_0x8b5d22){return function(_0x170cb6){if(_0x170cb6){return _0x170cb6[_0xcc01('0x24')](_0x56f60b)['then'](function(_0x169ca8){return _0x169ca8;});}return null;};}function removeEntity(_0x56ad36,_0xe36a67){return function(_0x52e615){if(_0x52e615){return _0x52e615[_0xcc01('0x25')]()[_0xcc01('0x26')](function(){var _0x2d35d3=_0x52e615[_0xcc01('0x27')]({'plain':!![]});var _0x1d9929='Triggers';return db[_0xcc01('0x28')][_0xcc01('0x25')]({'where':{'type':_0x1d9929,'resourceId':_0x2d35d3['id']}})[_0xcc01('0x26')](function(){return _0x52e615;});})[_0xcc01('0x26')](function(){_0x56ad36[_0xcc01('0x1a')](0xcc)[_0xcc01('0x29')]();});}};}function handleEntityNotFound(_0x2e1c0f,_0x10c524){return function(_0x1d54c4){if(!_0x1d54c4){_0x2e1c0f[_0xcc01('0x19')](0x194);}return _0x1d54c4;};}function handleError(_0x3f08f4,_0x26966b){_0x26966b=_0x26966b||0x1f4;return function(_0x52534b){logger[_0xcc01('0x2a')](_0x52534b['stack']);if(_0x52534b[_0xcc01('0x2b')]){delete _0x52534b[_0xcc01('0x2b')];}_0x3f08f4[_0xcc01('0x1a')](_0x26966b)[_0xcc01('0x2c')](_0x52534b);};}exports[_0xcc01('0x2d')]=function(_0x49f63a,_0x453ed6){var _0x1b9382={},_0x580fb8={},_0x4223a4={'count':0x0,'rows':[]};var _0x416d02=_['map'](db[_0xcc01('0x2e')][_0xcc01('0x2f')],function(_0x3af1cf){return{'name':_0x3af1cf[_0xcc01('0x30')],'type':_0x3af1cf[_0xcc01('0x31')]['key']};});_0x580fb8[_0xcc01('0x32')]=_[_0xcc01('0x33')](_0x416d02,_0xcc01('0x2b'));_0x580fb8[_0xcc01('0x34')]=_[_0xcc01('0x35')](_0x49f63a[_0xcc01('0x34')]);_0x580fb8[_0xcc01('0x36')]=_[_0xcc01('0x37')](_0x580fb8[_0xcc01('0x32')],_0x580fb8[_0xcc01('0x34')]);_0x1b9382['attributes']=_[_0xcc01('0x37')](_0x580fb8[_0xcc01('0x32')],qs[_0xcc01('0x38')](_0x49f63a[_0xcc01('0x34')][_0xcc01('0x38')]));_0x1b9382[_0xcc01('0x39')]=_0x1b9382['attributes'][_0xcc01('0x3a')]?_0x1b9382['attributes']:_0x580fb8['model'];if(!_0x49f63a['query'][_0xcc01('0x3b')](_0xcc01('0x3c'))){_0x1b9382[_0xcc01('0x1e')]=qs[_0xcc01('0x1e')](_0x49f63a[_0xcc01('0x34')][_0xcc01('0x1e')]);_0x1b9382[_0xcc01('0x1c')]=qs[_0xcc01('0x1c')](_0x49f63a[_0xcc01('0x34')][_0xcc01('0x1c')]);}_0x1b9382[_0xcc01('0x3d')]=qs['sort'](_0x49f63a[_0xcc01('0x34')]['sort']);_0x1b9382[_0xcc01('0x3e')]=qs[_0xcc01('0x36')](_['pick'](_0x49f63a['query'],_0x580fb8['filters']),_0x416d02);if(_0x49f63a[_0xcc01('0x34')]['filter']){_0x1b9382[_0xcc01('0x3e')]=_[_0xcc01('0x3f')](_0x1b9382[_0xcc01('0x3e')],{'$or':_['map'](_0x416d02,function(_0x57e5d9){if(_0x57e5d9[_0xcc01('0x31')]!==_0xcc01('0x40')){var _0x1962d1={};_0x1962d1[_0x57e5d9[_0xcc01('0x2b')]]={'$like':'%'+_0x49f63a[_0xcc01('0x34')][_0xcc01('0x41')]+'%'};return _0x1962d1;}})});}_0x1b9382=_[_0xcc01('0x3f')]({},_0x1b9382,_0x49f63a[_0xcc01('0x42')]);var _0x2de2eb={'where':_0x1b9382[_0xcc01('0x3e')]};return db[_0xcc01('0x2e')][_0xcc01('0x1f')](_0x2de2eb)[_0xcc01('0x26')](function(_0x2cbd1d){_0x4223a4['count']=_0x2cbd1d;if(_0x49f63a['query'][_0xcc01('0x43')]){_0x1b9382[_0xcc01('0x44')]=[{'all':!![]}];}return db['Trigger'][_0xcc01('0x45')](_0x1b9382);})['then'](function(_0xb0bfee){_0x4223a4['rows']=_0xb0bfee;return _0x4223a4;})[_0xcc01('0x26')](respondWithFilteredResult(_0x453ed6,_0x1b9382))[_0xcc01('0x46')](handleError(_0x453ed6,null));};exports[_0xcc01('0x47')]=function(_0x55bca2,_0x7d4269){var _0x43fdc1={'raw':![],'where':{'id':_0x55bca2[_0xcc01('0x48')]['id']}},_0x361d2c={};_0x361d2c[_0xcc01('0x32')]=_[_0xcc01('0x35')](db[_0xcc01('0x2e')]['rawAttributes']);_0x361d2c[_0xcc01('0x34')]=_[_0xcc01('0x35')](_0x55bca2[_0xcc01('0x34')]);_0x361d2c[_0xcc01('0x36')]=_[_0xcc01('0x37')](_0x361d2c[_0xcc01('0x32')],_0x361d2c[_0xcc01('0x34')]);_0x43fdc1[_0xcc01('0x39')]=_[_0xcc01('0x37')](_0x361d2c[_0xcc01('0x32')],qs[_0xcc01('0x38')](_0x55bca2[_0xcc01('0x34')][_0xcc01('0x38')]));_0x43fdc1[_0xcc01('0x39')]=_0x43fdc1[_0xcc01('0x39')][_0xcc01('0x3a')]?_0x43fdc1['attributes']:_0x361d2c['model'];if(_0x55bca2[_0xcc01('0x34')][_0xcc01('0x43')]){_0x43fdc1[_0xcc01('0x44')]=[{'all':!![]}];}_0x43fdc1=_['merge']({},_0x43fdc1,_0x55bca2[_0xcc01('0x42')]);return db[_0xcc01('0x2e')][_0xcc01('0x49')](_0x43fdc1)[_0xcc01('0x26')](handleEntityNotFound(_0x7d4269,null))[_0xcc01('0x26')](respondWithResult(_0x7d4269,null))[_0xcc01('0x46')](handleError(_0x7d4269,null));};exports['create']=function(_0x49ab0e,_0x237dce){return db[_0xcc01('0x2e')]['create'](_0x49ab0e[_0xcc01('0x4a')],{})[_0xcc01('0x26')](function(_0x54f438){var _0x2d36c5=_0x49ab0e[_0xcc01('0x4b')][_0xcc01('0x27')]({'plain':!![]});if(!_0x2d36c5)throw new Error(_0xcc01('0x4c'));if(_0x2d36c5[_0xcc01('0x4d')]===_0xcc01('0x4b')){var _0xdddf2f=_0x54f438[_0xcc01('0x27')]({'plain':!![]});var _0x17dd0f=_0xcc01('0x4e');return db[_0xcc01('0x4f')][_0xcc01('0x49')]({'where':{'name':_0x17dd0f,'userProfileId':_0x2d36c5[_0xcc01('0x50')]},'raw':!![]})[_0xcc01('0x26')](function(_0x3b16fe){if(_0x3b16fe&&_0x3b16fe[_0xcc01('0x51')]===0x0){return db[_0xcc01('0x28')][_0xcc01('0x52')]({'name':_0xdddf2f[_0xcc01('0x2b')],'resourceId':_0xdddf2f['id'],'type':_0x3b16fe['name'],'sectionId':_0x3b16fe['id']},{})[_0xcc01('0x26')](function(){return _0x54f438;});}else{return _0x54f438;}})[_0xcc01('0x46')](function(_0x3755b9){logger['error'](_0xcc01('0x53'),_0x3755b9);throw _0x3755b9;});}return _0x54f438;})[_0xcc01('0x26')](respondWithResult(_0x237dce,0xc9))['catch'](handleError(_0x237dce,null));};exports['update']=function(_0x9afdee,_0x44bb2b){if(_0x9afdee[_0xcc01('0x4a')]['id']){delete _0x9afdee[_0xcc01('0x4a')]['id'];}return db['Trigger'][_0xcc01('0x49')]({'where':{'id':_0x9afdee[_0xcc01('0x48')]['id']}})[_0xcc01('0x26')](handleEntityNotFound(_0x44bb2b,null))[_0xcc01('0x26')](saveUpdates(_0x9afdee[_0xcc01('0x4a')],null))['then'](respondWithResult(_0x44bb2b,null))[_0xcc01('0x46')](handleError(_0x44bb2b,null));};exports[_0xcc01('0x25')]=function(_0x46dd97,_0x4cf858){return db[_0xcc01('0x2e')][_0xcc01('0x49')]({'where':{'id':_0x46dd97['params']['id']}})['then'](handleEntityNotFound(_0x4cf858,null))[_0xcc01('0x26')](removeEntity(_0x4cf858,null))[_0xcc01('0x46')](handleError(_0x4cf858,null));};exports[_0xcc01('0x54')]=function(_0x45fe0c,_0x59ac26,_0x38331e){if(_0x45fe0c[_0xcc01('0x4a')]['id']){delete _0x45fe0c['body']['id'];}return db[_0xcc01('0x2e')][_0xcc01('0x49')]({'where':{'id':_0x45fe0c[_0xcc01('0x48')]['id']}})['then'](handleEntityNotFound(_0x59ac26,null))['then'](function(_0x3f9f16){if(_0x3f9f16){_0x45fe0c[_0xcc01('0x4a')][_0xcc01('0x55')]=_0x3f9f16['id'];return db[_0xcc01('0x56')]['create'](_0x45fe0c[_0xcc01('0x4a')]);}})[_0xcc01('0x26')](respondWithResult(_0x59ac26,null))[_0xcc01('0x46')](handleError(_0x59ac26,null));};exports['addAnyCondition']=function(_0x4c9c6b,_0x13d1aa,_0x4273b6){if(_0x4c9c6b[_0xcc01('0x4a')]['id']){delete _0x4c9c6b[_0xcc01('0x4a')]['id'];}return db[_0xcc01('0x2e')][_0xcc01('0x49')]({'where':{'id':_0x4c9c6b[_0xcc01('0x48')]['id']}})[_0xcc01('0x26')](handleEntityNotFound(_0x13d1aa,null))[_0xcc01('0x26')](function(_0x17c07f){if(_0x17c07f){_0x4c9c6b['body'][_0xcc01('0x57')]=_0x17c07f['id'];return db[_0xcc01('0x56')][_0xcc01('0x52')](_0x4c9c6b[_0xcc01('0x4a')]);}})[_0xcc01('0x26')](respondWithResult(_0x13d1aa,null))['catch'](handleError(_0x13d1aa,null));};exports[_0xcc01('0x58')]=function(_0x23ad39,_0x397fd5,_0x143320){var _0xe0d8fd={};var _0x53a753={};var _0x205d1b;var _0x4ed3d5;return db[_0xcc01('0x2e')]['findOne']({'where':{'id':_0x23ad39['params']['id']}})[_0xcc01('0x26')](handleEntityNotFound(_0x397fd5,null))['then'](function(_0xe33660){if(_0xe33660){_0x205d1b=_0xe33660;_0x53a753['model']=_[_0xcc01('0x35')](db[_0xcc01('0x56')][_0xcc01('0x2f')]);_0x53a753['query']=_[_0xcc01('0x35')](_0x23ad39[_0xcc01('0x34')]);_0x53a753[_0xcc01('0x36')]=_[_0xcc01('0x37')](_0x53a753[_0xcc01('0x32')],_0x53a753[_0xcc01('0x34')]);_0xe0d8fd[_0xcc01('0x39')]=_[_0xcc01('0x37')](_0x53a753[_0xcc01('0x32')],qs[_0xcc01('0x38')](_0x23ad39[_0xcc01('0x34')][_0xcc01('0x38')]));_0xe0d8fd[_0xcc01('0x39')]=_0xe0d8fd[_0xcc01('0x39')][_0xcc01('0x3a')]?_0xe0d8fd[_0xcc01('0x39')]:_0x53a753[_0xcc01('0x32')];_0xe0d8fd[_0xcc01('0x3d')]=qs[_0xcc01('0x59')](_0x23ad39[_0xcc01('0x34')][_0xcc01('0x59')]);_0xe0d8fd[_0xcc01('0x3e')]=qs[_0xcc01('0x36')](_[_0xcc01('0x5a')](_0x23ad39['query'],_0x53a753['filters']));if(_0x23ad39[_0xcc01('0x34')][_0xcc01('0x41')]){_0xe0d8fd[_0xcc01('0x3e')]=_[_0xcc01('0x3f')](_0xe0d8fd[_0xcc01('0x3e')],{'$or':_[_0xcc01('0x33')](_0xe0d8fd[_0xcc01('0x39')],function(_0x33c076){var _0x294376={};_0x294376[_0x33c076]={'$like':'%'+_0x23ad39['query'][_0xcc01('0x41')]+'%'};return _0x294376;})});}_0xe0d8fd=_['merge']({},_0xe0d8fd,_0x23ad39[_0xcc01('0x42')]);return _0x205d1b[_0xcc01('0x58')](_0xe0d8fd);}})['then'](function(_0x5a9e1b){if(_0x5a9e1b){_0x4ed3d5=_0x5a9e1b[_0xcc01('0x3a')];if(!_0x23ad39[_0xcc01('0x34')][_0xcc01('0x3b')](_0xcc01('0x3c'))){_0xe0d8fd[_0xcc01('0x1e')]=qs[_0xcc01('0x1e')](_0x23ad39[_0xcc01('0x34')][_0xcc01('0x1e')]);_0xe0d8fd['offset']=qs[_0xcc01('0x1c')](_0x23ad39[_0xcc01('0x34')][_0xcc01('0x1c')]);}return _0x205d1b['getAllConditions'](_0xe0d8fd);}})[_0xcc01('0x26')](function(_0x4af432){if(_0x4af432){return _0x4af432?{'count':_0x4ed3d5,'rows':_0x4af432}:null;}})[_0xcc01('0x26')](respondWithResult(_0x397fd5,null))[_0xcc01('0x46')](handleError(_0x397fd5,null));};exports['getAnyConditions']=function(_0x5c8361,_0x15c7bb,_0x5346bd){var _0x12b94a={};var _0x3928a5={};var _0x38799b;var _0x514fdb;return db[_0xcc01('0x2e')][_0xcc01('0x5b')]({'where':{'id':_0x5c8361['params']['id']}})[_0xcc01('0x26')](handleEntityNotFound(_0x15c7bb,null))[_0xcc01('0x26')](function(_0x2bd6cf){if(_0x2bd6cf){_0x38799b=_0x2bd6cf;_0x3928a5['model']=_[_0xcc01('0x35')](db[_0xcc01('0x56')][_0xcc01('0x2f')]);_0x3928a5[_0xcc01('0x34')]=_[_0xcc01('0x35')](_0x5c8361[_0xcc01('0x34')]);_0x3928a5[_0xcc01('0x36')]=_['intersection'](_0x3928a5[_0xcc01('0x32')],_0x3928a5[_0xcc01('0x34')]);_0x12b94a[_0xcc01('0x39')]=_['intersection'](_0x3928a5[_0xcc01('0x32')],qs[_0xcc01('0x38')](_0x5c8361[_0xcc01('0x34')][_0xcc01('0x38')]));_0x12b94a[_0xcc01('0x39')]=_0x12b94a['attributes'][_0xcc01('0x3a')]?_0x12b94a[_0xcc01('0x39')]:_0x3928a5['model'];_0x12b94a['order']=qs[_0xcc01('0x59')](_0x5c8361[_0xcc01('0x34')][_0xcc01('0x59')]);_0x12b94a['where']=qs[_0xcc01('0x36')](_[_0xcc01('0x5a')](_0x5c8361['query'],_0x3928a5['filters']));if(_0x5c8361['query'][_0xcc01('0x41')]){_0x12b94a[_0xcc01('0x3e')]=_['merge'](_0x12b94a[_0xcc01('0x3e')],{'$or':_[_0xcc01('0x33')](_0x12b94a[_0xcc01('0x39')],function(_0x20077a){var _0x1c6ac2={};_0x1c6ac2[_0x20077a]={'$like':'%'+_0x5c8361[_0xcc01('0x34')][_0xcc01('0x41')]+'%'};return _0x1c6ac2;})});}_0x12b94a=_[_0xcc01('0x3f')]({},_0x12b94a,_0x5c8361[_0xcc01('0x42')]);return _0x38799b[_0xcc01('0x5c')](_0x12b94a);}})[_0xcc01('0x26')](function(_0x2050af){if(_0x2050af){_0x514fdb=_0x2050af[_0xcc01('0x3a')];if(!_0x5c8361[_0xcc01('0x34')][_0xcc01('0x3b')](_0xcc01('0x3c'))){_0x12b94a[_0xcc01('0x1e')]=qs[_0xcc01('0x1e')](_0x5c8361[_0xcc01('0x34')][_0xcc01('0x1e')]);_0x12b94a[_0xcc01('0x1c')]=qs[_0xcc01('0x1c')](_0x5c8361['query']['offset']);}return _0x38799b['getAnyConditions'](_0x12b94a);}})['then'](function(_0x337480){if(_0x337480){return _0x337480?{'count':_0x514fdb,'rows':_0x337480}:null;}})['then'](respondWithResult(_0x15c7bb,null))['catch'](handleError(_0x15c7bb,null));};exports[_0xcc01('0x5d')]=function(_0xe3d4d4,_0xb419b3,_0x5a8e75){if(_0xe3d4d4['body']['id']){delete _0xe3d4d4[_0xcc01('0x4a')]['id'];}return db[_0xcc01('0x2e')][_0xcc01('0x49')]({'where':{'id':_0xe3d4d4[_0xcc01('0x48')]['id']}})[_0xcc01('0x26')](handleEntityNotFound(_0xb419b3,null))[_0xcc01('0x26')](function(_0x2f2847){if(_0x2f2847){_0xe3d4d4[_0xcc01('0x4a')][_0xcc01('0x5e')]=_0x2f2847['id'];return db[_0xcc01('0x5f')][_0xcc01('0x52')](_0xe3d4d4[_0xcc01('0x4a')]);}})[_0xcc01('0x26')](respondWithResult(_0xb419b3,null))[_0xcc01('0x46')](handleError(_0xb419b3,null));};exports[_0xcc01('0x60')]=function(_0x434846,_0x3d0aed,_0x1bc03d){var _0xf06d90={};var _0xbe298={};var _0x23ac29;var _0x23544e;return db[_0xcc01('0x2e')][_0xcc01('0x5b')]({'where':{'id':_0x434846[_0xcc01('0x48')]['id']}})[_0xcc01('0x26')](handleEntityNotFound(_0x3d0aed,null))['then'](function(_0x28f709){if(_0x28f709){_0x23ac29=_0x28f709;_0xbe298[_0xcc01('0x32')]=_[_0xcc01('0x35')](db[_0xcc01('0x5f')][_0xcc01('0x2f')]);_0xbe298[_0xcc01('0x34')]=_['keys'](_0x434846[_0xcc01('0x34')]);_0xbe298['filters']=_['intersection'](_0xbe298[_0xcc01('0x32')],_0xbe298['query']);_0xf06d90['attributes']=_[_0xcc01('0x37')](_0xbe298[_0xcc01('0x32')],qs[_0xcc01('0x38')](_0x434846['query'][_0xcc01('0x38')]));_0xf06d90['attributes']=_0xf06d90[_0xcc01('0x39')][_0xcc01('0x3a')]?_0xf06d90[_0xcc01('0x39')]:_0xbe298[_0xcc01('0x32')];_0xf06d90['order']=qs[_0xcc01('0x59')](_0x434846[_0xcc01('0x34')][_0xcc01('0x59')]);_0xf06d90[_0xcc01('0x3e')]=qs[_0xcc01('0x36')](_[_0xcc01('0x5a')](_0x434846[_0xcc01('0x34')],_0xbe298['filters']));if(_0x434846[_0xcc01('0x34')][_0xcc01('0x41')]){_0xf06d90[_0xcc01('0x3e')]=_[_0xcc01('0x3f')](_0xf06d90['where'],{'$or':_['map'](_0xf06d90[_0xcc01('0x39')],function(_0x59957b){var _0x1bd724={};_0x1bd724[_0x59957b]={'$like':'%'+_0x434846['query'][_0xcc01('0x41')]+'%'};return _0x1bd724;})});}_0xf06d90=_[_0xcc01('0x3f')]({},_0xf06d90,_0x434846[_0xcc01('0x42')]);return _0x23ac29[_0xcc01('0x60')](_0xf06d90);}})[_0xcc01('0x26')](function(_0xc8d081){if(_0xc8d081){_0x23544e=_0xc8d081['length'];if(!_0x434846['query']['hasOwnProperty'](_0xcc01('0x3c'))){_0xf06d90[_0xcc01('0x1e')]=qs['limit'](_0x434846['query'][_0xcc01('0x1e')]);_0xf06d90[_0xcc01('0x1c')]=qs[_0xcc01('0x1c')](_0x434846['query'][_0xcc01('0x1c')]);}return _0x23ac29[_0xcc01('0x60')](_0xf06d90);}})[_0xcc01('0x26')](function(_0x1921a8){if(_0x1921a8){return _0x1921a8?{'count':_0x23544e,'rows':_0x1921a8}:null;}})[_0xcc01('0x26')](respondWithResult(_0x3d0aed,null))[_0xcc01('0x46')](handleError(_0x3d0aed,null));}; \ No newline at end of file +var _0xea87=['Triggers','UserProfileResource','then','error','stack','name','send','map','Trigger','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','addAllCondition','Condition','addAnyCondition','getAllConditions','findOne','order','getAnyConditions','addAction','TriggerId','getActions','Action','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','get'];(function(_0x4be935,_0x5e323c){var _0x2fb30d=function(_0x114ea9){while(--_0x114ea9){_0x4be935['push'](_0x4be935['shift']());}};_0x2fb30d(++_0x5e323c);}(_0xea87,0x1bd));var _0x7ea8=function(_0x2e76e7,_0x86bb0a){_0x2e76e7=_0x2e76e7-0x0;var _0x3c3a5e=_0xea87[_0x2e76e7];return _0x3c3a5e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7ea8('0x0'));var jsonpatch=require(_0x7ea8('0x1'));var rp=require(_0x7ea8('0x2'));var moment=require(_0x7ea8('0x3'));var BPromise=require(_0x7ea8('0x4'));var Mustache=require(_0x7ea8('0x5'));var util=require(_0x7ea8('0x6'));var path=require(_0x7ea8('0x7'));var sox=require(_0x7ea8('0x8'));var csv=require(_0x7ea8('0x9'));var ejs=require(_0x7ea8('0xa'));var fs=require('fs');var fs_extra=require(_0x7ea8('0xb'));var _=require(_0x7ea8('0xc'));var squel=require(_0x7ea8('0xd'));var crypto=require('crypto');var jsforce=require(_0x7ea8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7ea8('0x9'));var querystring=require(_0x7ea8('0xf'));var Papa=require(_0x7ea8('0x10'));var Redis=require('ioredis');var authService=require(_0x7ea8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7ea8('0x12'));var hardwareService=require(_0x7ea8('0x13'));var logger=require(_0x7ea8('0x14'))(_0x7ea8('0x15'));var utils=require(_0x7ea8('0x16'));var config=require(_0x7ea8('0x17'));var licenseUtil=require(_0x7ea8('0x18'));var db=require(_0x7ea8('0x19'))['db'];function respondWithStatusCode(_0x4413ef,_0xcce978){_0xcce978=_0xcce978||0xcc;return function(_0x131d38){if(_0x131d38){return _0x4413ef[_0x7ea8('0x1a')](_0xcce978);}return _0x4413ef[_0x7ea8('0x1b')](_0xcce978)[_0x7ea8('0x1c')]();};}function respondWithResult(_0x3c0ca7,_0x9e7ee7){_0x9e7ee7=_0x9e7ee7||0xc8;return function(_0xa33d35){if(_0xa33d35){return _0x3c0ca7['status'](_0x9e7ee7)[_0x7ea8('0x1d')](_0xa33d35);}};}function respondWithFilteredResult(_0xb05df4,_0x2c5cb9){return function(_0xfa2517){if(_0xfa2517){var _0x2f3d35=typeof _0x2c5cb9[_0x7ea8('0x1e')]===_0x7ea8('0x1f')&&typeof _0x2c5cb9[_0x7ea8('0x20')]==='undefined';var _0x4b98bc=_0xfa2517[_0x7ea8('0x21')];var _0x240c1b=_0x2f3d35?0x0:_0x2c5cb9[_0x7ea8('0x1e')];var _0x2a6bb7=_0x2f3d35?_0xfa2517['count']:_0x2c5cb9['offset']+_0x2c5cb9[_0x7ea8('0x20')];var _0x4a0d7a;if(_0x2a6bb7>=_0x4b98bc){_0x2a6bb7=_0x4b98bc;_0x4a0d7a=0xc8;}else{_0x4a0d7a=0xce;}_0xb05df4[_0x7ea8('0x1b')](_0x4a0d7a);return _0xb05df4[_0x7ea8('0x22')](_0x7ea8('0x23'),_0x240c1b+'-'+_0x2a6bb7+'/'+_0x4b98bc)[_0x7ea8('0x1d')](_0xfa2517);}return null;};}function patchUpdates(_0x18a747){return function(_0xc632e0){try{jsonpatch[_0x7ea8('0x24')](_0xc632e0,_0x18a747,!![]);}catch(_0xbc42ee){return BPromise['reject'](_0xbc42ee);}return _0xc632e0[_0x7ea8('0x25')]();};}function saveUpdates(_0x5e21a4,_0x85d8aa){return function(_0x4e3953){if(_0x4e3953){return _0x4e3953['update'](_0x5e21a4)['then'](function(_0x4b6302){return _0x4b6302;});}return null;};}function removeEntity(_0x1a8201,_0x9fd9bf){return function(_0x5472a3){if(_0x5472a3){return _0x5472a3[_0x7ea8('0x26')]()['then'](function(){var _0x510efd=_0x5472a3[_0x7ea8('0x27')]({'plain':!![]});var _0x497203=_0x7ea8('0x28');return db[_0x7ea8('0x29')]['destroy']({'where':{'type':_0x497203,'resourceId':_0x510efd['id']}})[_0x7ea8('0x2a')](function(){return _0x5472a3;});})[_0x7ea8('0x2a')](function(){_0x1a8201[_0x7ea8('0x1b')](0xcc)[_0x7ea8('0x1c')]();});}};}function handleEntityNotFound(_0x1886c6,_0x428717){return function(_0x3735c8){if(!_0x3735c8){_0x1886c6['sendStatus'](0x194);}return _0x3735c8;};}function handleError(_0x47ed39,_0x25996f){_0x25996f=_0x25996f||0x1f4;return function(_0x4516ec){logger[_0x7ea8('0x2b')](_0x4516ec[_0x7ea8('0x2c')]);if(_0x4516ec[_0x7ea8('0x2d')]){delete _0x4516ec[_0x7ea8('0x2d')];}_0x47ed39[_0x7ea8('0x1b')](_0x25996f)[_0x7ea8('0x2e')](_0x4516ec);};}exports['index']=function(_0x5d3856,_0x32119b){var _0x3c0388={},_0x20c141={},_0x5107ee={'count':0x0,'rows':[]};var _0x2ac208=_[_0x7ea8('0x2f')](db[_0x7ea8('0x30')][_0x7ea8('0x31')],function(_0x5dfa46){return{'name':_0x5dfa46[_0x7ea8('0x32')],'type':_0x5dfa46[_0x7ea8('0x33')][_0x7ea8('0x34')]};});_0x20c141[_0x7ea8('0x35')]=_[_0x7ea8('0x2f')](_0x2ac208,_0x7ea8('0x2d'));_0x20c141[_0x7ea8('0x36')]=_[_0x7ea8('0x37')](_0x5d3856[_0x7ea8('0x36')]);_0x20c141['filters']=_[_0x7ea8('0x38')](_0x20c141[_0x7ea8('0x35')],_0x20c141[_0x7ea8('0x36')]);_0x3c0388['attributes']=_['intersection'](_0x20c141[_0x7ea8('0x35')],qs[_0x7ea8('0x39')](_0x5d3856[_0x7ea8('0x36')]['fields']));_0x3c0388['attributes']=_0x3c0388[_0x7ea8('0x3a')][_0x7ea8('0x3b')]?_0x3c0388[_0x7ea8('0x3a')]:_0x20c141['model'];if(!_0x5d3856[_0x7ea8('0x36')][_0x7ea8('0x3c')](_0x7ea8('0x3d'))){_0x3c0388[_0x7ea8('0x20')]=qs[_0x7ea8('0x20')](_0x5d3856[_0x7ea8('0x36')]['limit']);_0x3c0388['offset']=qs[_0x7ea8('0x1e')](_0x5d3856[_0x7ea8('0x36')][_0x7ea8('0x1e')]);}_0x3c0388['order']=qs[_0x7ea8('0x3e')](_0x5d3856[_0x7ea8('0x36')]['sort']);_0x3c0388[_0x7ea8('0x3f')]=qs[_0x7ea8('0x40')](_[_0x7ea8('0x41')](_0x5d3856[_0x7ea8('0x36')],_0x20c141[_0x7ea8('0x40')]),_0x2ac208);if(_0x5d3856[_0x7ea8('0x36')][_0x7ea8('0x42')]){_0x3c0388[_0x7ea8('0x3f')]=_[_0x7ea8('0x43')](_0x3c0388[_0x7ea8('0x3f')],{'$or':_[_0x7ea8('0x2f')](_0x2ac208,function(_0x5b4557){if(_0x5b4557['type']!==_0x7ea8('0x44')){var _0x5f1b09={};_0x5f1b09[_0x5b4557[_0x7ea8('0x2d')]]={'$like':'%'+_0x5d3856['query']['filter']+'%'};return _0x5f1b09;}})});}_0x3c0388=_[_0x7ea8('0x43')]({},_0x3c0388,_0x5d3856['options']);var _0x15df6e={'where':_0x3c0388[_0x7ea8('0x3f')]};return db[_0x7ea8('0x30')][_0x7ea8('0x21')](_0x15df6e)[_0x7ea8('0x2a')](function(_0x5ba40b){_0x5107ee[_0x7ea8('0x21')]=_0x5ba40b;if(_0x5d3856[_0x7ea8('0x36')]['includeAll']){_0x3c0388[_0x7ea8('0x45')]=[{'all':!![]}];}return db['Trigger'][_0x7ea8('0x46')](_0x3c0388);})[_0x7ea8('0x2a')](function(_0xbea90){_0x5107ee[_0x7ea8('0x47')]=_0xbea90;return _0x5107ee;})[_0x7ea8('0x2a')](respondWithFilteredResult(_0x32119b,_0x3c0388))[_0x7ea8('0x48')](handleError(_0x32119b,null));};exports[_0x7ea8('0x49')]=function(_0x368b16,_0xfebf18){var _0x4fab93={'raw':![],'where':{'id':_0x368b16[_0x7ea8('0x4a')]['id']}},_0x43adad={};_0x43adad[_0x7ea8('0x35')]=_['keys'](db[_0x7ea8('0x30')][_0x7ea8('0x31')]);_0x43adad[_0x7ea8('0x36')]=_[_0x7ea8('0x37')](_0x368b16[_0x7ea8('0x36')]);_0x43adad[_0x7ea8('0x40')]=_[_0x7ea8('0x38')](_0x43adad[_0x7ea8('0x35')],_0x43adad['query']);_0x4fab93[_0x7ea8('0x3a')]=_[_0x7ea8('0x38')](_0x43adad[_0x7ea8('0x35')],qs[_0x7ea8('0x39')](_0x368b16[_0x7ea8('0x36')][_0x7ea8('0x39')]));_0x4fab93[_0x7ea8('0x3a')]=_0x4fab93[_0x7ea8('0x3a')][_0x7ea8('0x3b')]?_0x4fab93['attributes']:_0x43adad[_0x7ea8('0x35')];if(_0x368b16[_0x7ea8('0x36')][_0x7ea8('0x4b')]){_0x4fab93[_0x7ea8('0x45')]=[{'all':!![]}];}_0x4fab93=_['merge']({},_0x4fab93,_0x368b16[_0x7ea8('0x4c')]);return db[_0x7ea8('0x30')][_0x7ea8('0x4d')](_0x4fab93)['then'](handleEntityNotFound(_0xfebf18,null))['then'](respondWithResult(_0xfebf18,null))['catch'](handleError(_0xfebf18,null));};exports[_0x7ea8('0x4e')]=function(_0x3a4315,_0x4bc707){return db[_0x7ea8('0x30')][_0x7ea8('0x4e')](_0x3a4315[_0x7ea8('0x4f')],{})[_0x7ea8('0x2a')](function(_0x2fd605){var _0x2022f3=_0x3a4315['user'][_0x7ea8('0x27')]({'plain':!![]});if(!_0x2022f3)throw new Error(_0x7ea8('0x50'));if(_0x2022f3[_0x7ea8('0x51')]==='user'){var _0x5e92ac=_0x2fd605[_0x7ea8('0x27')]({'plain':!![]});var _0x184cbc='Triggers';return db[_0x7ea8('0x52')][_0x7ea8('0x4d')]({'where':{'name':_0x184cbc,'userProfileId':_0x2022f3[_0x7ea8('0x53')]},'raw':!![]})[_0x7ea8('0x2a')](function(_0x473c6f){if(_0x473c6f&&_0x473c6f[_0x7ea8('0x54')]===0x0){return db[_0x7ea8('0x29')]['create']({'name':_0x5e92ac[_0x7ea8('0x2d')],'resourceId':_0x5e92ac['id'],'type':_0x473c6f[_0x7ea8('0x2d')],'sectionId':_0x473c6f['id']},{})[_0x7ea8('0x2a')](function(){return _0x2fd605;});}else{return _0x2fd605;}})[_0x7ea8('0x48')](function(_0x203029){logger[_0x7ea8('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x203029);throw _0x203029;});}return _0x2fd605;})['then'](respondWithResult(_0x4bc707,0xc9))[_0x7ea8('0x48')](handleError(_0x4bc707,null));};exports[_0x7ea8('0x55')]=function(_0x25d1da,_0x50b57b){if(_0x25d1da[_0x7ea8('0x4f')]['id']){delete _0x25d1da[_0x7ea8('0x4f')]['id'];}return db[_0x7ea8('0x30')][_0x7ea8('0x4d')]({'where':{'id':_0x25d1da[_0x7ea8('0x4a')]['id']}})[_0x7ea8('0x2a')](handleEntityNotFound(_0x50b57b,null))['then'](saveUpdates(_0x25d1da[_0x7ea8('0x4f')],null))[_0x7ea8('0x2a')](respondWithResult(_0x50b57b,null))[_0x7ea8('0x48')](handleError(_0x50b57b,null));};exports[_0x7ea8('0x26')]=function(_0x12f021,_0x310b3e){return db[_0x7ea8('0x30')]['find']({'where':{'id':_0x12f021[_0x7ea8('0x4a')]['id']}})[_0x7ea8('0x2a')](handleEntityNotFound(_0x310b3e,null))['then'](removeEntity(_0x310b3e,null))[_0x7ea8('0x48')](handleError(_0x310b3e,null));};exports[_0x7ea8('0x56')]=function(_0x321a96,_0x210a48,_0xad26b8){if(_0x321a96[_0x7ea8('0x4f')]['id']){delete _0x321a96[_0x7ea8('0x4f')]['id'];}return db[_0x7ea8('0x30')]['find']({'where':{'id':_0x321a96[_0x7ea8('0x4a')]['id']}})[_0x7ea8('0x2a')](handleEntityNotFound(_0x210a48,null))['then'](function(_0xd00ca){if(_0xd00ca){_0x321a96[_0x7ea8('0x4f')]['TriggerAllId']=_0xd00ca['id'];return db[_0x7ea8('0x57')][_0x7ea8('0x4e')](_0x321a96['body']);}})[_0x7ea8('0x2a')](respondWithResult(_0x210a48,null))[_0x7ea8('0x48')](handleError(_0x210a48,null));};exports[_0x7ea8('0x58')]=function(_0x49cf11,_0x152ae9,_0x46fdc1){if(_0x49cf11[_0x7ea8('0x4f')]['id']){delete _0x49cf11[_0x7ea8('0x4f')]['id'];}return db[_0x7ea8('0x30')][_0x7ea8('0x4d')]({'where':{'id':_0x49cf11[_0x7ea8('0x4a')]['id']}})[_0x7ea8('0x2a')](handleEntityNotFound(_0x152ae9,null))['then'](function(_0x2f4598){if(_0x2f4598){_0x49cf11[_0x7ea8('0x4f')]['TriggerAnyId']=_0x2f4598['id'];return db[_0x7ea8('0x57')][_0x7ea8('0x4e')](_0x49cf11[_0x7ea8('0x4f')]);}})['then'](respondWithResult(_0x152ae9,null))[_0x7ea8('0x48')](handleError(_0x152ae9,null));};exports[_0x7ea8('0x59')]=function(_0x13617d,_0x298b4b,_0x5f49d6){var _0x43882c={};var _0x3cb983={};var _0x3b7567;var _0x39bf77;return db[_0x7ea8('0x30')][_0x7ea8('0x5a')]({'where':{'id':_0x13617d[_0x7ea8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x298b4b,null))[_0x7ea8('0x2a')](function(_0x5f5363){if(_0x5f5363){_0x3b7567=_0x5f5363;_0x3cb983[_0x7ea8('0x35')]=_[_0x7ea8('0x37')](db[_0x7ea8('0x57')]['rawAttributes']);_0x3cb983[_0x7ea8('0x36')]=_['keys'](_0x13617d[_0x7ea8('0x36')]);_0x3cb983[_0x7ea8('0x40')]=_[_0x7ea8('0x38')](_0x3cb983[_0x7ea8('0x35')],_0x3cb983[_0x7ea8('0x36')]);_0x43882c['attributes']=_['intersection'](_0x3cb983[_0x7ea8('0x35')],qs[_0x7ea8('0x39')](_0x13617d[_0x7ea8('0x36')][_0x7ea8('0x39')]));_0x43882c['attributes']=_0x43882c['attributes'][_0x7ea8('0x3b')]?_0x43882c['attributes']:_0x3cb983['model'];_0x43882c[_0x7ea8('0x5b')]=qs[_0x7ea8('0x3e')](_0x13617d[_0x7ea8('0x36')][_0x7ea8('0x3e')]);_0x43882c[_0x7ea8('0x3f')]=qs[_0x7ea8('0x40')](_['pick'](_0x13617d[_0x7ea8('0x36')],_0x3cb983[_0x7ea8('0x40')]));if(_0x13617d[_0x7ea8('0x36')][_0x7ea8('0x42')]){_0x43882c[_0x7ea8('0x3f')]=_[_0x7ea8('0x43')](_0x43882c[_0x7ea8('0x3f')],{'$or':_[_0x7ea8('0x2f')](_0x43882c[_0x7ea8('0x3a')],function(_0x34f05e){var _0x3c5fed={};_0x3c5fed[_0x34f05e]={'$like':'%'+_0x13617d['query'][_0x7ea8('0x42')]+'%'};return _0x3c5fed;})});}_0x43882c=_[_0x7ea8('0x43')]({},_0x43882c,_0x13617d[_0x7ea8('0x4c')]);return _0x3b7567['getAllConditions'](_0x43882c);}})[_0x7ea8('0x2a')](function(_0x2b810f){if(_0x2b810f){_0x39bf77=_0x2b810f[_0x7ea8('0x3b')];if(!_0x13617d[_0x7ea8('0x36')]['hasOwnProperty'](_0x7ea8('0x3d'))){_0x43882c['limit']=qs[_0x7ea8('0x20')](_0x13617d[_0x7ea8('0x36')][_0x7ea8('0x20')]);_0x43882c[_0x7ea8('0x1e')]=qs['offset'](_0x13617d[_0x7ea8('0x36')][_0x7ea8('0x1e')]);}return _0x3b7567[_0x7ea8('0x59')](_0x43882c);}})[_0x7ea8('0x2a')](function(_0x27c6d8){if(_0x27c6d8){return _0x27c6d8?{'count':_0x39bf77,'rows':_0x27c6d8}:null;}})[_0x7ea8('0x2a')](respondWithResult(_0x298b4b,null))['catch'](handleError(_0x298b4b,null));};exports[_0x7ea8('0x5c')]=function(_0x1cb98b,_0x476d03,_0x475222){var _0x50d7e6={};var _0x774535={};var _0x53c24b;var _0x1646d0;return db['Trigger']['findOne']({'where':{'id':_0x1cb98b[_0x7ea8('0x4a')]['id']}})[_0x7ea8('0x2a')](handleEntityNotFound(_0x476d03,null))[_0x7ea8('0x2a')](function(_0x16d7c6){if(_0x16d7c6){_0x53c24b=_0x16d7c6;_0x774535['model']=_['keys'](db[_0x7ea8('0x57')][_0x7ea8('0x31')]);_0x774535['query']=_[_0x7ea8('0x37')](_0x1cb98b[_0x7ea8('0x36')]);_0x774535['filters']=_[_0x7ea8('0x38')](_0x774535[_0x7ea8('0x35')],_0x774535['query']);_0x50d7e6[_0x7ea8('0x3a')]=_[_0x7ea8('0x38')](_0x774535['model'],qs[_0x7ea8('0x39')](_0x1cb98b[_0x7ea8('0x36')][_0x7ea8('0x39')]));_0x50d7e6[_0x7ea8('0x3a')]=_0x50d7e6[_0x7ea8('0x3a')][_0x7ea8('0x3b')]?_0x50d7e6[_0x7ea8('0x3a')]:_0x774535[_0x7ea8('0x35')];_0x50d7e6[_0x7ea8('0x5b')]=qs['sort'](_0x1cb98b[_0x7ea8('0x36')][_0x7ea8('0x3e')]);_0x50d7e6[_0x7ea8('0x3f')]=qs['filters'](_[_0x7ea8('0x41')](_0x1cb98b[_0x7ea8('0x36')],_0x774535['filters']));if(_0x1cb98b[_0x7ea8('0x36')]['filter']){_0x50d7e6['where']=_[_0x7ea8('0x43')](_0x50d7e6[_0x7ea8('0x3f')],{'$or':_['map'](_0x50d7e6[_0x7ea8('0x3a')],function(_0x113787){var _0x571cda={};_0x571cda[_0x113787]={'$like':'%'+_0x1cb98b[_0x7ea8('0x36')][_0x7ea8('0x42')]+'%'};return _0x571cda;})});}_0x50d7e6=_[_0x7ea8('0x43')]({},_0x50d7e6,_0x1cb98b[_0x7ea8('0x4c')]);return _0x53c24b[_0x7ea8('0x5c')](_0x50d7e6);}})[_0x7ea8('0x2a')](function(_0x39e1da){if(_0x39e1da){_0x1646d0=_0x39e1da[_0x7ea8('0x3b')];if(!_0x1cb98b['query'][_0x7ea8('0x3c')]('nolimit')){_0x50d7e6['limit']=qs[_0x7ea8('0x20')](_0x1cb98b[_0x7ea8('0x36')]['limit']);_0x50d7e6[_0x7ea8('0x1e')]=qs[_0x7ea8('0x1e')](_0x1cb98b[_0x7ea8('0x36')]['offset']);}return _0x53c24b[_0x7ea8('0x5c')](_0x50d7e6);}})[_0x7ea8('0x2a')](function(_0x4e72ac){if(_0x4e72ac){return _0x4e72ac?{'count':_0x1646d0,'rows':_0x4e72ac}:null;}})['then'](respondWithResult(_0x476d03,null))[_0x7ea8('0x48')](handleError(_0x476d03,null));};exports[_0x7ea8('0x5d')]=function(_0x582491,_0x3122a7,_0x1ea11e){if(_0x582491[_0x7ea8('0x4f')]['id']){delete _0x582491[_0x7ea8('0x4f')]['id'];}return db[_0x7ea8('0x30')][_0x7ea8('0x4d')]({'where':{'id':_0x582491['params']['id']}})[_0x7ea8('0x2a')](handleEntityNotFound(_0x3122a7,null))[_0x7ea8('0x2a')](function(_0x531782){if(_0x531782){_0x582491[_0x7ea8('0x4f')][_0x7ea8('0x5e')]=_0x531782['id'];return db['Action'][_0x7ea8('0x4e')](_0x582491['body']);}})[_0x7ea8('0x2a')](respondWithResult(_0x3122a7,null))[_0x7ea8('0x48')](handleError(_0x3122a7,null));};exports[_0x7ea8('0x5f')]=function(_0x108596,_0x4a123c,_0x4b4a73){var _0xc0de2c={};var _0x46221a={};var _0x29d81f;var _0x421de5;return db[_0x7ea8('0x30')]['findOne']({'where':{'id':_0x108596[_0x7ea8('0x4a')]['id']}})[_0x7ea8('0x2a')](handleEntityNotFound(_0x4a123c,null))[_0x7ea8('0x2a')](function(_0x35c70d){if(_0x35c70d){_0x29d81f=_0x35c70d;_0x46221a[_0x7ea8('0x35')]=_[_0x7ea8('0x37')](db[_0x7ea8('0x60')]['rawAttributes']);_0x46221a['query']=_['keys'](_0x108596[_0x7ea8('0x36')]);_0x46221a['filters']=_[_0x7ea8('0x38')](_0x46221a[_0x7ea8('0x35')],_0x46221a['query']);_0xc0de2c['attributes']=_[_0x7ea8('0x38')](_0x46221a['model'],qs[_0x7ea8('0x39')](_0x108596[_0x7ea8('0x36')][_0x7ea8('0x39')]));_0xc0de2c[_0x7ea8('0x3a')]=_0xc0de2c['attributes'][_0x7ea8('0x3b')]?_0xc0de2c[_0x7ea8('0x3a')]:_0x46221a['model'];_0xc0de2c['order']=qs[_0x7ea8('0x3e')](_0x108596[_0x7ea8('0x36')][_0x7ea8('0x3e')]);_0xc0de2c[_0x7ea8('0x3f')]=qs['filters'](_[_0x7ea8('0x41')](_0x108596[_0x7ea8('0x36')],_0x46221a[_0x7ea8('0x40')]));if(_0x108596[_0x7ea8('0x36')][_0x7ea8('0x42')]){_0xc0de2c[_0x7ea8('0x3f')]=_[_0x7ea8('0x43')](_0xc0de2c[_0x7ea8('0x3f')],{'$or':_[_0x7ea8('0x2f')](_0xc0de2c[_0x7ea8('0x3a')],function(_0x3b9feb){var _0x1c37d6={};_0x1c37d6[_0x3b9feb]={'$like':'%'+_0x108596[_0x7ea8('0x36')]['filter']+'%'};return _0x1c37d6;})});}_0xc0de2c=_[_0x7ea8('0x43')]({},_0xc0de2c,_0x108596[_0x7ea8('0x4c')]);return _0x29d81f['getActions'](_0xc0de2c);}})[_0x7ea8('0x2a')](function(_0x357624){if(_0x357624){_0x421de5=_0x357624['length'];if(!_0x108596[_0x7ea8('0x36')][_0x7ea8('0x3c')](_0x7ea8('0x3d'))){_0xc0de2c[_0x7ea8('0x20')]=qs[_0x7ea8('0x20')](_0x108596[_0x7ea8('0x36')][_0x7ea8('0x20')]);_0xc0de2c[_0x7ea8('0x1e')]=qs[_0x7ea8('0x1e')](_0x108596[_0x7ea8('0x36')][_0x7ea8('0x1e')]);}return _0x29d81f[_0x7ea8('0x5f')](_0xc0de2c);}})[_0x7ea8('0x2a')](function(_0x5ed214){if(_0x5ed214){return _0x5ed214?{'count':_0x421de5,'rows':_0x5ed214}:null;}})[_0x7ea8('0x2a')](respondWithResult(_0x4a123c,null))[_0x7ea8('0x48')](handleError(_0x4a123c,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index d327651..faf1eca 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 _0x80d9=['api','moment','request-promise','path','rimraf','../../config/environment','./trigger.attributes','tools_triggers','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80d9,0x15c));var _0x980d=function(_0x3b7175,_0x7cf2ee){_0x3b7175=_0x3b7175-0x0;var _0xbb859e=_0x80d9[_0x3b7175];return _0xbb859e;};'use strict';var _=require(_0x980d('0x0'));var util=require('util');var logger=require(_0x980d('0x1'))(_0x980d('0x2'));var moment=require(_0x980d('0x3'));var BPromise=require('bluebird');var rp=require(_0x980d('0x4'));var fs=require('fs');var path=require(_0x980d('0x5'));var rimraf=require(_0x980d('0x6'));var config=require(_0x980d('0x7'));var attributes=require(_0x980d('0x8'));module['exports']=function(_0x4c3533,_0x2fd4b9){return _0x4c3533['define']('Trigger',attributes,{'tableName':_0x980d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x746f=['../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x322f33,_0x255ecd){var _0x106219=function(_0x32a19c){while(--_0x32a19c){_0x322f33['push'](_0x322f33['shift']());}};_0x106219(++_0x255ecd);}(_0x746f,0x9c));var _0xf746=function(_0x463c85,_0x4bf05a){_0x463c85=_0x463c85-0x0;var _0x429c94=_0x746f[_0x463c85];return _0x429c94;};'use strict';var _=require(_0xf746('0x0'));var util=require(_0xf746('0x1'));var logger=require(_0xf746('0x2'))(_0xf746('0x3'));var moment=require(_0xf746('0x4'));var BPromise=require(_0xf746('0x5'));var rp=require(_0xf746('0x6'));var fs=require('fs');var path=require(_0xf746('0x7'));var rimraf=require(_0xf746('0x8'));var config=require(_0xf746('0x9'));var attributes=require(_0xf746('0xa'));module[_0xf746('0xb')]=function(_0x19d855,_0x2f0f3c){return _0x19d855[_0xf746('0xc')](_0xf746('0xd'),attributes,{'tableName':_0xf746('0xe'),'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 9044c87..dbc6e06 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 _0xe267=['raw','ShowTrigger','lodash','util','moment','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','options','where','attributes','limit','include','map','model','debug'];(function(_0x2c0235,_0x50ffce){var _0x148a72=function(_0x4898e1){while(--_0x4898e1){_0x2c0235['push'](_0x2c0235['shift']());}};_0x148a72(++_0x50ffce);}(_0xe267,0x182));var _0x7e26=function(_0x253141,_0x396c1e){_0x253141=_0x253141-0x0;var _0x4472f3=_0xe267[_0x253141];return _0x4472f3;};'use strict';var _=require(_0x7e26('0x0'));var util=require(_0x7e26('0x1'));var moment=require(_0x7e26('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7e26('0x3'));var logger=require('../../config/logger')(_0x7e26('0x4'));var config=require(_0x7e26('0x5'));var jayson=require(_0x7e26('0x6'));var client=jayson[_0x7e26('0x7')][_0x7e26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x354da0,_0x262009,_0x246780){return new BPromise(function(_0x2259bf,_0x116e5d){return client[_0x7e26('0x9')](_0x354da0,_0x246780)[_0x7e26('0xa')](function(_0x39756c){logger[_0x7e26('0xb')](_0x7e26('0xc'),_0x262009,_0x7e26('0xd'));logger['debug'](_0x7e26('0xe'),_0x262009,_0x7e26('0xd'),JSON[_0x7e26('0xf')](_0x39756c));if(_0x39756c['error']){if(_0x39756c[_0x7e26('0x10')][_0x7e26('0x11')]===0x1f4){logger[_0x7e26('0x10')](_0x7e26('0xc'),_0x262009,_0x39756c[_0x7e26('0x10')]['message']);return _0x116e5d(_0x39756c[_0x7e26('0x10')][_0x7e26('0x12')]);}logger[_0x7e26('0x10')](_0x7e26('0xc'),_0x262009,_0x39756c['error'][_0x7e26('0x12')]);return _0x2259bf(_0x39756c['error'][_0x7e26('0x12')]);}else{logger['info'](_0x7e26('0xc'),_0x262009,_0x7e26('0xd'));_0x2259bf(_0x39756c[_0x7e26('0x13')]['message']);}})[_0x7e26('0x14')](function(_0x32e69d){logger[_0x7e26('0x10')](_0x7e26('0xc'),_0x262009,_0x32e69d);_0x116e5d(_0x32e69d);});});}exports[_0x7e26('0x15')]=function(_0x100ef7){var _0x3405a9=this;return new Promise(function(_0x5e6978,_0xdd52f8){return db['Trigger']['findAll']({'raw':_0x100ef7['options']?_0x100ef7[_0x7e26('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x100ef7[_0x7e26('0x16')]?_0x100ef7[_0x7e26('0x16')][_0x7e26('0x17')]||null:null,'attributes':_0x100ef7[_0x7e26('0x16')]?_0x100ef7['options'][_0x7e26('0x18')]||null:null,'limit':_0x100ef7[_0x7e26('0x16')]?_0x100ef7[_0x7e26('0x16')][_0x7e26('0x19')]||null:null,'include':_0x100ef7[_0x7e26('0x16')]?_0x100ef7[_0x7e26('0x16')][_0x7e26('0x1a')]?_[_0x7e26('0x1b')](_0x100ef7[_0x7e26('0x16')]['include'],function(_0x4c803e){return{'model':db[_0x4c803e['model']],'as':_0x4c803e['as'],'attributes':_0x4c803e[_0x7e26('0x18')],'include':_0x4c803e[_0x7e26('0x1a')]?_['map'](_0x4c803e[_0x7e26('0x1a')],function(_0x2e4e91){return{'model':db[_0x2e4e91[_0x7e26('0x1c')]],'as':_0x2e4e91['as'],'attributes':_0x2e4e91['attributes'],'include':_0x2e4e91['include']?_[_0x7e26('0x1b')](_0x2e4e91[_0x7e26('0x1a')],function(_0x523c33){return{'model':db[_0x523c33[_0x7e26('0x1c')]],'as':_0x523c33['as'],'attributes':_0x523c33['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e26('0xa')](function(_0x5ece14){logger[_0x7e26('0xb')](_0x7e26('0x15'),_0x100ef7);logger[_0x7e26('0x1d')](_0x7e26('0x15'),_0x100ef7,JSON[_0x7e26('0xf')](_0x5ece14));_0x5e6978(_0x5ece14);})[_0x7e26('0x14')](function(_0x27895f){logger[_0x7e26('0x10')](_0x7e26('0x15'),_0x27895f[_0x7e26('0x12')],_0x100ef7);_0xdd52f8(_0x3405a9[_0x7e26('0x10')](0x1f4,_0x27895f['message']));});});};exports['ShowTrigger']=function(_0x3fe94e){var _0x5d3ba=this;return new Promise(function(_0x22fcf5,_0x1faed1){return db['Trigger']['find']({'raw':_0x3fe94e[_0x7e26('0x16')]?_0x3fe94e[_0x7e26('0x16')][_0x7e26('0x1e')]===undefined?!![]:![]:!![],'where':_0x3fe94e[_0x7e26('0x16')]?_0x3fe94e['options'][_0x7e26('0x17')]||null:null,'attributes':_0x3fe94e[_0x7e26('0x16')]?_0x3fe94e[_0x7e26('0x16')]['attributes']||null:null,'include':_0x3fe94e[_0x7e26('0x16')]?_0x3fe94e[_0x7e26('0x16')][_0x7e26('0x1a')]?_['map'](_0x3fe94e['options'][_0x7e26('0x1a')],function(_0x502894){return{'model':db[_0x502894[_0x7e26('0x1c')]],'as':_0x502894['as'],'attributes':_0x502894[_0x7e26('0x18')],'include':_0x502894['include']?_[_0x7e26('0x1b')](_0x502894['include'],function(_0x52521b){return{'model':db[_0x52521b[_0x7e26('0x1c')]],'as':_0x52521b['as'],'attributes':_0x52521b[_0x7e26('0x18')],'include':_0x52521b['include']?_['map'](_0x52521b[_0x7e26('0x1a')],function(_0x223010){return{'model':db[_0x223010[_0x7e26('0x1c')]],'as':_0x223010['as'],'attributes':_0x223010['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e26('0xa')](function(_0x47dfc0){logger[_0x7e26('0xb')](_0x7e26('0x1f'),_0x3fe94e);logger[_0x7e26('0x1d')](_0x7e26('0x1f'),_0x3fe94e,JSON['stringify'](_0x47dfc0));_0x22fcf5(_0x47dfc0);})[_0x7e26('0x14')](function(_0x1d779e){logger[_0x7e26('0x10')](_0x7e26('0x1f'),_0x1d779e['message'],_0x3fe94e);_0x1faed1(_0x5d3ba[_0x7e26('0x10')](0x1f4,_0x1d779e[_0x7e26('0x12')]));});});}; \ No newline at end of file +var _0xa07d=['rpc','../../config/environment','jayson/promise','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetTrigger','options','raw','where','attributes','limit','include','map','model','stringify','ShowTrigger','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x185051,_0xa9c1a3){var _0x9226ba=function(_0x393166){while(--_0x393166){_0x185051['push'](_0x185051['shift']());}};_0x9226ba(++_0xa9c1a3);}(_0xa07d,0x138));var _0xda07=function(_0x5a1533,_0x1dc425){_0x5a1533=_0x5a1533-0x0;var _0x3fba08=_0xa07d[_0x5a1533];return _0x3fba08;};'use strict';var _=require(_0xda07('0x0'));var util=require(_0xda07('0x1'));var moment=require(_0xda07('0x2'));var BPromise=require(_0xda07('0x3'));var rs=require(_0xda07('0x4'));var fs=require('fs');var Redis=require(_0xda07('0x5'));var db=require(_0xda07('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xda07('0x7'))(_0xda07('0x8'));var config=require(_0xda07('0x9'));var jayson=require(_0xda07('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e8453,_0x42f3db,_0xa38307){return new BPromise(function(_0x2cc9ea,_0x14b83e){return client['request'](_0x4e8453,_0xa38307)[_0xda07('0xb')](function(_0x23dc1c){logger[_0xda07('0xc')](_0xda07('0xd'),_0x42f3db,_0xda07('0xe'));logger[_0xda07('0xf')](_0xda07('0x10'),_0x42f3db,_0xda07('0xe'),JSON['stringify'](_0x23dc1c));if(_0x23dc1c['error']){if(_0x23dc1c['error']['code']===0x1f4){logger[_0xda07('0x11')]('Trigger,\x20%s,\x20%s',_0x42f3db,_0x23dc1c['error'][_0xda07('0x12')]);return _0x14b83e(_0x23dc1c[_0xda07('0x11')][_0xda07('0x12')]);}logger[_0xda07('0x11')](_0xda07('0xd'),_0x42f3db,_0x23dc1c['error']['message']);return _0x2cc9ea(_0x23dc1c[_0xda07('0x11')][_0xda07('0x12')]);}else{logger[_0xda07('0xc')]('Trigger,\x20%s,\x20%s',_0x42f3db,_0xda07('0xe'));_0x2cc9ea(_0x23dc1c[_0xda07('0x13')][_0xda07('0x12')]);}})[_0xda07('0x14')](function(_0xb52fbc){logger[_0xda07('0x11')](_0xda07('0xd'),_0x42f3db,_0xb52fbc);_0x14b83e(_0xb52fbc);});});}exports[_0xda07('0x15')]=function(_0xf10030){var _0x462a7f=this;return new Promise(function(_0x2acb55,_0x5aa730){return db['Trigger']['findAll']({'raw':_0xf10030[_0xda07('0x16')]?_0xf10030['options'][_0xda07('0x17')]===undefined?!![]:![]:!![],'where':_0xf10030[_0xda07('0x16')]?_0xf10030[_0xda07('0x16')][_0xda07('0x18')]||null:null,'attributes':_0xf10030[_0xda07('0x16')]?_0xf10030[_0xda07('0x16')][_0xda07('0x19')]||null:null,'limit':_0xf10030[_0xda07('0x16')]?_0xf10030[_0xda07('0x16')][_0xda07('0x1a')]||null:null,'include':_0xf10030[_0xda07('0x16')]?_0xf10030[_0xda07('0x16')][_0xda07('0x1b')]?_[_0xda07('0x1c')](_0xf10030[_0xda07('0x16')]['include'],function(_0x48e7f0){return{'model':db[_0x48e7f0['model']],'as':_0x48e7f0['as'],'attributes':_0x48e7f0[_0xda07('0x19')],'include':_0x48e7f0[_0xda07('0x1b')]?_[_0xda07('0x1c')](_0x48e7f0['include'],function(_0xbbd99f){return{'model':db[_0xbbd99f[_0xda07('0x1d')]],'as':_0xbbd99f['as'],'attributes':_0xbbd99f[_0xda07('0x19')],'include':_0xbbd99f[_0xda07('0x1b')]?_[_0xda07('0x1c')](_0xbbd99f[_0xda07('0x1b')],function(_0x1771ad){return{'model':db[_0x1771ad['model']],'as':_0x1771ad['as'],'attributes':_0x1771ad['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x37d9b2){logger[_0xda07('0xc')]('GetTrigger',_0xf10030);logger[_0xda07('0xf')](_0xda07('0x15'),_0xf10030,JSON[_0xda07('0x1e')](_0x37d9b2));_0x2acb55(_0x37d9b2);})['catch'](function(_0x98632f){logger[_0xda07('0x11')](_0xda07('0x15'),_0x98632f['message'],_0xf10030);_0x5aa730(_0x462a7f[_0xda07('0x11')](0x1f4,_0x98632f[_0xda07('0x12')]));});});};exports[_0xda07('0x1f')]=function(_0x16ef1a){var _0x1f7b3f=this;return new Promise(function(_0xb4640a,_0x5d40af){return db['Trigger']['find']({'raw':_0x16ef1a[_0xda07('0x16')]?_0x16ef1a[_0xda07('0x16')][_0xda07('0x17')]===undefined?!![]:![]:!![],'where':_0x16ef1a[_0xda07('0x16')]?_0x16ef1a[_0xda07('0x16')][_0xda07('0x18')]||null:null,'attributes':_0x16ef1a[_0xda07('0x16')]?_0x16ef1a[_0xda07('0x16')][_0xda07('0x19')]||null:null,'include':_0x16ef1a[_0xda07('0x16')]?_0x16ef1a[_0xda07('0x16')][_0xda07('0x1b')]?_[_0xda07('0x1c')](_0x16ef1a[_0xda07('0x16')][_0xda07('0x1b')],function(_0x54e5f8){return{'model':db[_0x54e5f8[_0xda07('0x1d')]],'as':_0x54e5f8['as'],'attributes':_0x54e5f8[_0xda07('0x19')],'include':_0x54e5f8[_0xda07('0x1b')]?_['map'](_0x54e5f8[_0xda07('0x1b')],function(_0x4544da){return{'model':db[_0x4544da['model']],'as':_0x4544da['as'],'attributes':_0x4544da[_0xda07('0x19')],'include':_0x4544da[_0xda07('0x1b')]?_['map'](_0x4544da[_0xda07('0x1b')],function(_0x7cb01a){return{'model':db[_0x7cb01a['model']],'as':_0x7cb01a['as'],'attributes':_0x7cb01a[_0xda07('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c2f26){logger['info'](_0xda07('0x1f'),_0x16ef1a);logger['debug'](_0xda07('0x1f'),_0x16ef1a,JSON['stringify'](_0x1c2f26));_0xb4640a(_0x1c2f26);})[_0xda07('0x14')](function(_0x4ab492){logger[_0xda07('0x11')](_0xda07('0x1f'),_0x4ab492[_0xda07('0x12')],_0x16ef1a);_0x5d40af(_0x1f7b3f['error'](0x1f4,_0x4ab492['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index dad9d29..6aaa971 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 _0xfe70=['./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x250e26,_0x104bbf){var _0x395640=function(_0x178bca){while(--_0x178bca){_0x250e26['push'](_0x250e26['shift']());}};_0x395640(++_0x104bbf);}(_0xfe70,0xfe));var _0x0fe7=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0xfe70[_0x1dbaf7];return _0x593f05;};'use strict';var multer=require(_0x0fe7('0x0'));var util=require(_0x0fe7('0x1'));var path=require(_0x0fe7('0x2'));var timeout=require(_0x0fe7('0x3'));var express=require(_0x0fe7('0x4'));var router=express[_0x0fe7('0x5')]();var fs_extra=require(_0x0fe7('0x6'));var auth=require(_0x0fe7('0x7'));var interaction=require(_0x0fe7('0x8'));var config=require(_0x0fe7('0x9'));var controller=require(_0x0fe7('0xa'));router[_0x0fe7('0xb')]('/',auth[_0x0fe7('0xc')](),controller[_0x0fe7('0xd')]);router[_0x0fe7('0xb')](_0x0fe7('0xe'),auth['isAuthenticated'](),controller[_0x0fe7('0xf')]);router[_0x0fe7('0x10')](_0x0fe7('0x11'),auth[_0x0fe7('0xc')](),controller[_0x0fe7('0x12')]);router[_0x0fe7('0x10')]('/',auth[_0x0fe7('0xc')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0fe7('0x13')]);router[_0x0fe7('0x14')](_0x0fe7('0xe'),auth[_0x0fe7('0xc')](),controller[_0x0fe7('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0787=['put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','./trunk.controller','get','/:id','isAuthenticated','post','clone'];(function(_0x1d4e21,_0x4e8096){var _0x178fef=function(_0x515879){while(--_0x515879){_0x1d4e21['push'](_0x1d4e21['shift']());}};_0x178fef(++_0x4e8096);}(_0x0787,0x1c4));var _0x7078=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0x0787[_0x1faaa1];return _0x994ec;};'use strict';var multer=require('multer');var util=require(_0x7078('0x0'));var path=require(_0x7078('0x1'));var timeout=require(_0x7078('0x2'));var express=require(_0x7078('0x3'));var router=express[_0x7078('0x4')]();var fs_extra=require(_0x7078('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7078('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7078('0x7')](_0x7078('0x8'),auth[_0x7078('0x9')](),controller['show']);router[_0x7078('0xa')]('/:id/clone',auth[_0x7078('0x9')](),controller[_0x7078('0xb')]);router[_0x7078('0xa')]('/',auth[_0x7078('0x9')](),controller['create']);router[_0x7078('0xc')](_0x7078('0x8'),auth[_0x7078('0x9')](),controller[_0x7078('0xd')]);router[_0x7078('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7078('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index e8f6f10..14f67cf 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 _0xfad6=['INTEGER','always','accept','refuse','uac','uas','pai','fingerprint','certificate','passive','actpass','dynamic','update','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','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(_0x2306c6,_0x22531b){var _0x2a1df9=function(_0xd3fde5){while(--_0xd3fde5){_0x2306c6['push'](_0x2306c6['shift']());}};_0x2a1df9(++_0x22531b);}(_0xfad6,0x1d0));var _0x6fad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfad6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6fad('0x0'));module[_0x6fad('0x1')]={'name':{'type':Sequelize[_0x6fad('0x2')],'allowNull':![],'unique':_0x6fad('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x5'),'user','peer'),'allowNull':![],'defaultValue':_0x6fad('0x5')},'context':{'type':Sequelize[_0x6fad('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x6fad('0x6'),_0x6fad('0x7'),_0x6fad('0x8'),'PROHIB_NOT_SCREENED',_0x6fad('0x9'),_0x6fad('0xa'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x6fad('0x2')]},'secret':{'type':Sequelize[_0x6fad('0x2')]},'md5secret':{'type':Sequelize[_0x6fad('0x2')]},'remotesecret':{'type':Sequelize[_0x6fad('0x2')]},'transport':{'type':Sequelize[_0x6fad('0x2')],'defaultValue':_0x6fad('0xb'),'set':function(_0x479604){this[_0x6fad('0xc')](_0x6fad('0xd'),_0x479604?_0x479604[_0x6fad('0xe')](','):null);},'get':function(){return this[_0x6fad('0xf')](_0x6fad('0xd'))?this[_0x6fad('0xf')](_0x6fad('0xd'))[_0x6fad('0x10')](','):null;},'comment':_0x6fad('0x11')},'dtmfmode':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x12'),_0x6fad('0x13'),_0x6fad('0x14'),_0x6fad('0x15'),_0x6fad('0x16')),'defaultValue':_0x6fad('0x12')},'directmedia':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no',_0x6fad('0x18'),'update',_0x6fad('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6fad('0x2')]},'directmediadeny':{'type':Sequelize[_0x6fad('0x2')]},'nat':{'type':Sequelize[_0x6fad('0x2')],'defaultValue':_0x6fad('0x1a'),'set':function(_0x341d8f){this[_0x6fad('0xc')](_0x6fad('0x1b'),_0x341d8f?_0x341d8f[_0x6fad('0xe')](','):null);},'get':function(){return this[_0x6fad('0xf')](_0x6fad('0x1b'))?this['getDataValue']('nat')[_0x6fad('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x6fad('0x2')]},'pickupgroup':{'type':Sequelize[_0x6fad('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x6fad('0x2')]},'language':{'type':Sequelize[_0x6fad('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6fad('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x6fad('0x2')],'defaultValue':_0x6fad('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6fad('0x1d'),'set':function(_0x37388e){this[_0x6fad('0xc')](_0x6fad('0x1e'),_0x37388e?_0x37388e[_0x6fad('0xe')](';'):_0x6fad('0x1d'));},'get':function(){return this[_0x6fad('0xf')](_0x6fad('0x1e'))?this[_0x6fad('0xf')](_0x6fad('0x1e'))[_0x6fad('0x10')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize[_0x6fad('0x2')],'defaultValue':_0x6fad('0x1f'),'set':function(_0x16b34e){this[_0x6fad('0xc')](_0x6fad('0x20'),_0x16b34e?_0x16b34e['join'](','):null);},'get':function(){return this[_0x6fad('0xf')]('insecure')?this[_0x6fad('0xf')](_0x6fad('0x20'))[_0x6fad('0x10')](','):null;},'comment':_0x6fad('0x21')},'trustrpid':{'type':Sequelize['ENUM'](_0x6fad('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x6fad('0x17'),'no',_0x6fad('0x22'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x6fad('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x6fad('0x23')},'amaflags':{'type':Sequelize[_0x6fad('0x2')]},'callcounter':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no'),'defaultValue':_0x6fad('0x17')},'busylevel':{'type':Sequelize[_0x6fad('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0x6fad('0x2')]},'template':{'type':Sequelize[_0x6fad('0x2')]},'videosupport':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no',_0x6fad('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6fad('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x6fad('0x17'),'no')},'mailbox':{'type':Sequelize[_0x6fad('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x6fad('0x26'),_0x6fad('0x27'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x6fad('0x24')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x6fad('0x28'),_0x6fad('0x29')),'defaultValue':_0x6fad('0x29')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x6fad('0x2')]},'fromuser':{'type':Sequelize[_0x6fad('0x2')]},'port':{'type':Sequelize[_0x6fad('0x24')](0x5)},'qualify':{'type':Sequelize[_0x6fad('0x4')]('yes','no'),'defaultValue':_0x6fad('0x17')},'keepalive':{'type':Sequelize[_0x6fad('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x6fad('0x2')]},'defaultuser':{'type':Sequelize[_0x6fad('0x2')]},'rtptimeout':{'type':Sequelize[_0x6fad('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x6fad('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x6fad('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x6fad('0x4')]('yes','no',_0x6fad('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6fad('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x6fad('0x24')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x6fad('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x6fad('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x6fad('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x6fad('0x2')]},'use_q850_reason':{'type':Sequelize[_0x6fad('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x6fad('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no')},'force_avp':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no')},'icesupport':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x6fad('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no',_0x6fad('0x2b'),_0x6fad('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x6fad('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x6fad('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x6fad('0x2')]},'dtlscipher':{'type':Sequelize[_0x6fad('0x2')]},'dtlscafile':{'type':Sequelize[_0x6fad('0x2')]},'dtlscapath':{'type':Sequelize[_0x6fad('0x2')]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x6fad('0x2d'),_0x6fad('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6fad('0x2')]},'usereqphone':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6fad('0x2')]},'recordofffeature':{'type':Sequelize[_0x6fad('0x2')]},'call_limit':{'type':Sequelize[_0x6fad('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x6fad('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x6fad('0x4')]('yes','no')},'vmexten':{'type':Sequelize[_0x6fad('0x2')]},'mohinterpret':{'type':Sequelize[_0x6fad('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0x6fad('0x2f')},'canreinvite':{'type':Sequelize[_0x6fad('0x4')](_0x6fad('0x17'),'no',_0x6fad('0x18'),_0x6fad('0x30'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x6fad('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x6fad('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xd9b0=['PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','refuse','originate','uas','fingerprint','certificate','active','dynamic','update','update,nonat','BOOLEAN','sequelize','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_FAILED_SCREEN','ALLOWED'];(function(_0x477a28,_0x20dd95){var _0x361aaa=function(_0x571010){while(--_0x571010){_0x477a28['push'](_0x477a28['shift']());}};_0x361aaa(++_0x20dd95);}(_0xd9b0,0x17f));var _0x0d9b=function(_0x4a9ff9,_0x14917a){_0x4a9ff9=_0x4a9ff9-0x0;var _0x5b8bf9=_0xd9b0[_0x4a9ff9];return _0x5b8bf9;};'use strict';var Sequelize=require(_0x0d9b('0x0'));module['exports']={'name':{'type':Sequelize[_0x0d9b('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x3'),_0x0d9b('0x4'),_0x0d9b('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0d9b('0x6')},'callingpres':{'type':Sequelize[_0x0d9b('0x2')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x0d9b('0x7'),_0x0d9b('0x8'),_0x0d9b('0x9'),_0x0d9b('0xa'),'PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0x0d9b('0x1')]},'permit':{'type':Sequelize[_0x0d9b('0x1')]},'secret':{'type':Sequelize[_0x0d9b('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x0d9b('0x1')],'defaultValue':_0x0d9b('0xb'),'set':function(_0x618896){this[_0x0d9b('0xc')](_0x0d9b('0xd'),_0x618896?_0x618896[_0x0d9b('0xe')](','):null);},'get':function(){return this[_0x0d9b('0xf')]('transport')?this['getDataValue'](_0x0d9b('0xd'))[_0x0d9b('0x10')](','):null;},'comment':_0x0d9b('0x11')},'dtmfmode':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x12'),_0x0d9b('0x13'),_0x0d9b('0x14'),_0x0d9b('0x15'),_0x0d9b('0x16')),'defaultValue':_0x0d9b('0x12')},'directmedia':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no',_0x0d9b('0x18'),'update',_0x0d9b('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0d9b('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0d9b('0x1')]},'directmediadeny':{'type':Sequelize[_0x0d9b('0x1')]},'nat':{'type':Sequelize[_0x0d9b('0x1')],'defaultValue':_0x0d9b('0x1a'),'set':function(_0x236af8){this['setDataValue'](_0x0d9b('0x1b'),_0x236af8?_0x236af8[_0x0d9b('0xe')](','):null);},'get':function(){return this[_0x0d9b('0xf')]('nat')?this[_0x0d9b('0xf')](_0x0d9b('0x1b'))[_0x0d9b('0x10')](','):null;},'comment':_0x0d9b('0x1c')},'callgroup':{'type':Sequelize[_0x0d9b('0x1')]},'namedcallgroup':{'type':Sequelize[_0x0d9b('0x1')]},'pickupgroup':{'type':Sequelize[_0x0d9b('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0d9b('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0d9b('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0d9b('0x1')],'defaultValue':_0x0d9b('0x1d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0d9b('0x1e'),'set':function(_0x4f0f37){this[_0x0d9b('0xc')](_0x0d9b('0x1f'),_0x4f0f37?_0x4f0f37[_0x0d9b('0xe')](';'):_0x0d9b('0x1e'));},'get':function(){return this[_0x0d9b('0xf')]('allow')?this['getDataValue'](_0x0d9b('0x1f'))[_0x0d9b('0x10')](';'):null;},'comment':_0x0d9b('0x20')},'autoframing':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x0d9b('0x21'),'set':function(_0xc67486){this[_0x0d9b('0xc')]('insecure',_0xc67486?_0xc67486[_0x0d9b('0xe')](','):null);},'get':function(){return this[_0x0d9b('0xf')](_0x0d9b('0x22'))?this[_0x0d9b('0xf')](_0x0d9b('0x22'))[_0x0d9b('0x10')](','):null;},'comment':_0x0d9b('0x23')},'trustrpid':{'type':Sequelize[_0x0d9b('0x2')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0d9b('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0d9b('0x2')]('yes','no',_0x0d9b('0x24'))},'promiscredir':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x0d9b('0x2')]('yes','no')},'accountcode':{'type':Sequelize[_0x0d9b('0x25')](0xb)},'setvar':{'type':Sequelize[_0x0d9b('0x1')]},'callerid':{'type':Sequelize[_0x0d9b('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x0d9b('0x1')]},'callcounter':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x0d9b('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x0d9b('0x2')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x0d9b('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0x0d9b('0x17'),'no',_0x0d9b('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0d9b('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0d9b('0x2')]('yes','no')},'mailbox':{'type':Sequelize[_0x0d9b('0x1')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x0d9b('0x27'),_0x0d9b('0x28'))},'session_expires':{'type':Sequelize[_0x0d9b('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x0d9b('0x25')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x0d9b('0x29')),'defaultValue':_0x0d9b('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x0d9b('0x1')]},'regexten':{'type':Sequelize[_0x0d9b('0x1')]},'fromdomain':{'type':Sequelize[_0x0d9b('0x1')]},'fromuser':{'type':Sequelize[_0x0d9b('0x1')]},'port':{'type':Sequelize[_0x0d9b('0x25')](0x5)},'qualify':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no'),'defaultValue':_0x0d9b('0x17')},'keepalive':{'type':Sequelize[_0x0d9b('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x0d9b('0x1')]},'defaultuser':{'type':Sequelize[_0x0d9b('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0d9b('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0d9b('0x25')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x0d9b('0x17'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0d9b('0x1')]},'callbackextension':{'type':Sequelize[_0x0d9b('0x1')]},'timert1':{'type':Sequelize[_0x0d9b('0x25')](0xb)},'timerb':{'type':Sequelize[_0x0d9b('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x0d9b('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x0d9b('0x1')]},'contactdeny':{'type':Sequelize[_0x0d9b('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x0d9b('0x1')]},'use_q850_reason':{'type':Sequelize[_0x0d9b('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no')},'force_avp':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no')},'icesupport':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no',_0x0d9b('0x2a'),_0x0d9b('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x0d9b('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x0d9b('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x0d9b('0x1')]},'dtlscipher':{'type':Sequelize[_0x0d9b('0x1')]},'dtlscafile':{'type':Sequelize[_0x0d9b('0x1')]},'dtlscapath':{'type':Sequelize[_0x0d9b('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x0d9b('0x2c'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0d9b('0x1')]},'usereqphone':{'type':Sequelize['ENUM'](_0x0d9b('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0d9b('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x0d9b('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no')},'vmexten':{'type':Sequelize[_0x0d9b('0x1')]},'mohinterpret':{'type':Sequelize[_0x0d9b('0x1')]},'mohsuggest':{'type':Sequelize[_0x0d9b('0x1')]},'parkinglot':{'type':Sequelize[_0x0d9b('0x1')]},'description':{'type':Sequelize[_0x0d9b('0x1')]},'host':{'type':Sequelize[_0x0d9b('0x1')],'defaultValue':_0x0d9b('0x2d')},'canreinvite':{'type':Sequelize[_0x0d9b('0x2')](_0x0d9b('0x17'),'no','nonat',_0x0d9b('0x2e'),_0x0d9b('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0d9b('0x1')]},'otherFields':{'type':Sequelize[_0x0d9b('0x1')]},'active':{'type':Sequelize[_0x0d9b('0x30')],'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 c34ee2c..a0ad215 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 _0xa41a=['server/files/templates/registry.ejs','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','destroy','get','UserProfileResource','end','name','send','map','Trunk','fieldName','type','key','query','intersection','model','attributes','fields','length','order','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','createdAt','updatedAt','body','create','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','Trunks','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload'];(function(_0x185a70,_0x576d8b){var _0x4d599c=function(_0x1923bb){while(--_0x1923bb){_0x185a70['push'](_0x185a70['shift']());}};_0x4d599c(++_0x576d8b);}(_0xa41a,0x6b));var _0xaa41=function(_0x189d4a,_0x32d334){_0x189d4a=_0x189d4a-0x0;var _0x42bf83=_0xa41a[_0x189d4a];return _0x42bf83;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xaa41('0x19'));var client=jayson['client'][_0xaa41('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12d9e6,_0x2f64bc,_0x889d44,_0x6f9ade){return new BPromise(function(_0x4eaf81,_0x1e9d7f){var _0x178170=_0x6f9ade||client;return _0x178170[_0xaa41('0x1b')](_0x12d9e6,_0x889d44)[_0xaa41('0x1c')](function(_0x2a6988){logger[_0xaa41('0x1d')](_0xaa41('0x1e'),_0x2f64bc,'request\x20sent');logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2f64bc,_0xaa41('0x21'),JSON[_0xaa41('0x22')](_0x2a6988));if(_0x2a6988[_0xaa41('0x23')]){if(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x24')]===0x1f4){logger[_0xaa41('0x23')](_0xaa41('0x1e'),_0x2f64bc,_0x2a6988['error']['message']);return _0x1e9d7f(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);}logger[_0xaa41('0x23')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);return _0x4eaf81(_0x2a6988['error']['message']);}else{logger[_0xaa41('0x1d')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0xaa41('0x21'));_0x4eaf81(_0x2a6988[_0xaa41('0x26')][_0xaa41('0x25')]);}})[_0xaa41('0x27')](function(_0x1d623c){logger['error'](_0xaa41('0x1e'),_0x2f64bc,_0x1d623c);_0x1e9d7f(_0x1d623c);});});}function respondWithStatusCode(_0x43a85c,_0x448a21){_0x448a21=_0x448a21||0xcc;return function(_0x21f596){if(_0x21f596){return _0x43a85c[_0xaa41('0x28')](_0x448a21);}return _0x43a85c[_0xaa41('0x29')](_0x448a21)['end']();};}function respondWithResult(_0x5795f4,_0x16aec5){_0x16aec5=_0x16aec5||0xc8;return function(_0x527cac){if(_0x527cac){return _0x5795f4['status'](_0x16aec5)[_0xaa41('0x2a')](_0x527cac);}};}function respondWithFilteredResult(_0x59707f,_0x536bed){return function(_0x2d0ac0){if(_0x2d0ac0){var _0x9c8c21=typeof _0x536bed[_0xaa41('0x2b')]===_0xaa41('0x2c')&&typeof _0x536bed[_0xaa41('0x2d')]===_0xaa41('0x2c');var _0x57ef96=_0x2d0ac0[_0xaa41('0x2e')];var _0x1f0275=_0x9c8c21?0x0:_0x536bed[_0xaa41('0x2b')];var _0x9a16e3=_0x9c8c21?_0x2d0ac0[_0xaa41('0x2e')]:_0x536bed[_0xaa41('0x2b')]+_0x536bed[_0xaa41('0x2d')];var _0x104a95;if(_0x9a16e3>=_0x57ef96){_0x9a16e3=_0x57ef96;_0x104a95=0xc8;}else{_0x104a95=0xce;}_0x59707f['status'](_0x104a95);return _0x59707f[_0xaa41('0x2f')]('Content-Range',_0x1f0275+'-'+_0x9a16e3+'/'+_0x57ef96)['json'](_0x2d0ac0);}return null;};}function patchUpdates(_0x714537){return function(_0x1176bd){try{jsonpatch['apply'](_0x1176bd,_0x714537,!![]);}catch(_0x392b5d){return BPromise[_0xaa41('0x30')](_0x392b5d);}return _0x1176bd['save']();};}function saveUpdates(_0x5022fb,_0x5c25fb){return function(_0x1cf3da){if(_0x1cf3da){return _0x1cf3da[_0xaa41('0x31')](_0x5022fb)[_0xaa41('0x1c')](function(_0x38afc4){return _0x38afc4;});}return null;};}function removeEntity(_0x58f203,_0x289c4a){return function(_0x45c8fe){if(_0x45c8fe){return _0x45c8fe[_0xaa41('0x32')]()['then'](function(){var _0x387c55=_0x45c8fe[_0xaa41('0x33')]({'plain':!![]});var _0x321eb7='Trunks';return db[_0xaa41('0x34')][_0xaa41('0x32')]({'where':{'type':_0x321eb7,'resourceId':_0x387c55['id']}})['then'](function(){return _0x45c8fe;});})[_0xaa41('0x1c')](function(){_0x58f203[_0xaa41('0x29')](0xcc)[_0xaa41('0x35')]();});}};}function handleEntityNotFound(_0x5cec87,_0x22b272){return function(_0x48335f){if(!_0x48335f){_0x5cec87[_0xaa41('0x28')](0x194);}return _0x48335f;};}function handleError(_0x199b24,_0xf13742){_0xf13742=_0xf13742||0x1f4;return function(_0x49b77a){logger['error'](_0x49b77a['stack']);if(_0x49b77a[_0xaa41('0x36')]){delete _0x49b77a[_0xaa41('0x36')];}_0x199b24[_0xaa41('0x29')](_0xf13742)[_0xaa41('0x37')](_0x49b77a);};}exports['index']=function(_0x53a2e4,_0x267999){var _0x5673c={},_0x951e52={},_0x4e8d2e={'count':0x0,'rows':[]};var _0xba115a=_[_0xaa41('0x38')](db[_0xaa41('0x39')]['rawAttributes'],function(_0x3adc28){return{'name':_0x3adc28[_0xaa41('0x3a')],'type':_0x3adc28[_0xaa41('0x3b')][_0xaa41('0x3c')]};});_0x951e52['model']=_['map'](_0xba115a,_0xaa41('0x36'));_0x951e52[_0xaa41('0x3d')]=_['keys'](_0x53a2e4[_0xaa41('0x3d')]);_0x951e52['filters']=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],_0x951e52[_0xaa41('0x3d')]);_0x5673c[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x53a2e4[_0xaa41('0x3d')]['fields']));_0x5673c[_0xaa41('0x40')]=_0x5673c[_0xaa41('0x40')][_0xaa41('0x42')]?_0x5673c[_0xaa41('0x40')]:_0x951e52[_0xaa41('0x3f')];if(!_0x53a2e4[_0xaa41('0x3d')]['hasOwnProperty']('nolimit')){_0x5673c[_0xaa41('0x2d')]=qs['limit'](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2d')]);_0x5673c[_0xaa41('0x2b')]=qs[_0xaa41('0x2b')](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2b')]);}_0x5673c[_0xaa41('0x43')]=qs['sort'](_0x53a2e4[_0xaa41('0x3d')]['sort']);_0x5673c['where']=qs[_0xaa41('0x44')](_['pick'](_0x53a2e4['query'],_0x951e52['filters']),_0xba115a);if(_0x53a2e4[_0xaa41('0x3d')]['filter']){_0x5673c[_0xaa41('0x45')]=_[_0xaa41('0x46')](_0x5673c['where'],{'$or':_['map'](_0xba115a,function(_0xe58f5e){if(_0xe58f5e[_0xaa41('0x3b')]!==_0xaa41('0x47')){var _0x2af8ba={};_0x2af8ba[_0xe58f5e[_0xaa41('0x36')]]={'$like':'%'+_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x48')]+'%'};return _0x2af8ba;}})});}_0x5673c=_[_0xaa41('0x46')]({},_0x5673c,_0x53a2e4[_0xaa41('0x49')]);var _0x4e1ac4={'where':_0x5673c[_0xaa41('0x45')]};return db[_0xaa41('0x39')][_0xaa41('0x2e')](_0x4e1ac4)[_0xaa41('0x1c')](function(_0x206d86){_0x4e8d2e[_0xaa41('0x2e')]=_0x206d86;if(_0x53a2e4['query'][_0xaa41('0x4a')]){_0x5673c[_0xaa41('0x4b')]=[{'all':!![]}];}return db[_0xaa41('0x39')][_0xaa41('0x4c')](_0x5673c);})['then'](function(_0x23bc61){_0x4e8d2e['rows']=_0x23bc61;return _0x4e8d2e;})['then'](respondWithFilteredResult(_0x267999,_0x5673c))[_0xaa41('0x27')](handleError(_0x267999,null));};exports[_0xaa41('0x4d')]=function(_0x3e16ef,_0x4ca114){var _0xb4773b={'raw':![],'where':{'id':_0x3e16ef[_0xaa41('0x4e')]['id']}},_0x3e1a73={};_0x3e1a73['model']=_[_0xaa41('0x4f')](db[_0xaa41('0x39')][_0xaa41('0x50')]);_0x3e1a73[_0xaa41('0x3d')]=_[_0xaa41('0x4f')](_0x3e16ef[_0xaa41('0x3d')]);_0x3e1a73[_0xaa41('0x44')]=_[_0xaa41('0x3e')](_0x3e1a73['model'],_0x3e1a73[_0xaa41('0x3d')]);_0xb4773b['attributes']=_['intersection'](_0x3e1a73[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x41')]));_0xb4773b[_0xaa41('0x40')]=_0xb4773b[_0xaa41('0x40')][_0xaa41('0x42')]?_0xb4773b[_0xaa41('0x40')]:_0x3e1a73['model'];if(_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0xb4773b[_0xaa41('0x4b')]=[{'all':!![]}];}_0xb4773b=_['merge']({},_0xb4773b,_0x3e16ef[_0xaa41('0x49')]);return db[_0xaa41('0x39')]['find'](_0xb4773b)[_0xaa41('0x1c')](handleEntityNotFound(_0x4ca114,null))[_0xaa41('0x1c')](respondWithResult(_0x4ca114,null))[_0xaa41('0x27')](handleError(_0x4ca114,null));};exports['clone']=function(_0x2cf32c,_0xc8e626){var _0x4e3b13={'where':{'id':_0x2cf32c[_0xaa41('0x4e')]['id']}},_0x49789a={};_0x49789a[_0xaa41('0x3f')]=_[_0xaa41('0x4f')](db['Trunk'][_0xaa41('0x50')]);_0x4e3b13[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x49789a[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x2cf32c['query'][_0xaa41('0x41')]));_0x4e3b13['attributes']=_0x4e3b13['attributes'][_0xaa41('0x42')]?_0x4e3b13['attributes']:_0x49789a[_0xaa41('0x3f')];if(_0x2cf32c[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0x4e3b13['include']=[{'all':!![]}];}_0x4e3b13=_[_0xaa41('0x46')]({},_0x4e3b13,_0x2cf32c[_0xaa41('0x49')]);return db[_0xaa41('0x39')][_0xaa41('0x51')](_0x4e3b13)[_0xaa41('0x1c')](handleEntityNotFound(_0xc8e626,null))[_0xaa41('0x1c')](function(_0xc56018){if(_0xc56018){var _0x337059=_0xc56018[_0xaa41('0x33')]({'plain':!![]});_0x337059=qs['omit'](_0x337059,['id',_0xaa41('0x52'),_0xaa41('0x53')]);_0x2cf32c[_0xaa41('0x54')]=_['omit'](_0x2cf32c[_0xaa41('0x54')],['id',_0xaa41('0x52'),_0xaa41('0x53')]);return db[_0xaa41('0x39')][_0xaa41('0x55')](_[_0xaa41('0x46')](_0x337059,_0x2cf32c[_0xaa41('0x54')]),{'include':_0x2cf32c['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x540325){var _0x4ec357=_0x2cf32c['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x4ec357)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ec357['role']===_0xaa41('0x56')){var _0x40a524=_0x540325[_0xaa41('0x33')]({'plain':!![]});var _0x312eee='Trunks';return db[_0xaa41('0x57')][_0xaa41('0x51')]({'where':{'name':_0x312eee,'userProfileId':_0x4ec357[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0xa71432){if(_0xa71432&&_0xa71432[_0xaa41('0x59')]===0x0){return db[_0xaa41('0x34')][_0xaa41('0x55')]({'name':_0x40a524[_0xaa41('0x36')],'resourceId':_0x40a524['id'],'type':_0xa71432['name'],'sectionId':_0xa71432['id']},{})[_0xaa41('0x1c')](function(){return _0x540325;});}else{return _0x540325;}})[_0xaa41('0x27')](function(_0x50170f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50170f);throw _0x50170f;});}return _0x540325;});}})[_0xaa41('0x1c')](respondWithResult(_0xc8e626,0xc9))['catch'](handleError(_0xc8e626,null));};exports[_0xaa41('0x55')]=function(_0x5c8028,_0x5423b6,_0x18d18b){var _0x4b1ec4;return db[_0xaa41('0x39')][_0xaa41('0x55')](_0x5c8028[_0xaa41('0x54')],{'raw':!![]})[_0xaa41('0x1c')](function(_0x5a2683){_0x4b1ec4=_0x5a2683;return db['Trunk'][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x4d6d0c){var _0x5954ba=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x5a385e=fs[_0xaa41('0x5a')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x19ec63=ejs[_0xaa41('0x5f')](_0x5954ba,{'trunks':_0x4d6d0c||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x19ec63);if(_0x4b1ec4[_0xaa41('0x61')]){var _0x19ed68=ejs[_0xaa41('0x5f')](_0x5a385e,{'trunks':_0x4d6d0c||[]});fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x19ed68);}})[_0xaa41('0x1c')](function(){return respondWithRpcPromise('Reload',_0xaa41('0x55'),{'module':_0xaa41('0x64')});})[_0xaa41('0x1c')](function(){var _0x175ca9=_0x5c8028['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x175ca9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x175ca9[_0xaa41('0x65')]===_0xaa41('0x56')){var _0x2b9e68=_0x4b1ec4[_0xaa41('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xaa41('0x51')]({'where':{'name':_0xaa41('0x66'),'userProfileId':_0x175ca9[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0x59052d){if(_0x59052d&&_0x59052d[_0xaa41('0x59')]===0x0){return db['UserProfileResource'][_0xaa41('0x55')]({'name':_0x2b9e68[_0xaa41('0x36')],'resourceId':_0x2b9e68['id'],'type':_0x59052d['name'],'sectionId':_0x59052d['id']},{})[_0xaa41('0x1c')](function(){return _0x4b1ec4;});}else{return _0x4b1ec4;}})[_0xaa41('0x27')](function(_0x2ba160){logger[_0xaa41('0x23')](_0xaa41('0x67'),_0x2ba160);throw _0x2ba160;});}return _0x4b1ec4;})[_0xaa41('0x1c')](respondWithResult(_0x5423b6,0xc9))[_0xaa41('0x27')](handleError(_0x5423b6,null));};exports[_0xaa41('0x31')]=function(_0x33b5f4,_0x3d4f1e,_0x25a064){var _0x59a30b;return db[_0xaa41('0x39')][_0xaa41('0x51')]({'where':{'id':_0x33b5f4[_0xaa41('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d4f1e,null))['then'](saveUpdates(_0x33b5f4[_0xaa41('0x54')],null))[_0xaa41('0x1c')](function(_0x59fd6a){if(_0x59fd6a){_0x59a30b=_0x59fd6a;return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});}})['then'](function(_0x305050){if(_0x305050){var _0x3dd47e=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x1472be=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x44154f=ejs[_0xaa41('0x5f')](_0x3dd47e,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x44154f);var _0x404c38=ejs[_0xaa41('0x5f')](_0x1472be,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x63'),_0x404c38);return respondWithRpcPromise(_0xaa41('0x68'),'update',{'module':_0xaa41('0x64')});}return null;})['then'](function(_0x53faf4){if(_0x53faf4){return _0x59a30b;}})[_0xaa41('0x1c')](respondWithResult(_0x3d4f1e,null))[_0xaa41('0x27')](handleError(_0x3d4f1e,null));};exports['destroy']=function(_0x5a8cb0,_0x241e1a,_0x1726ec){var _0x3c189d;return db[_0xaa41('0x39')]['find']({'where':{'id':_0x5a8cb0[_0xaa41('0x4e')]['id']}})[_0xaa41('0x1c')](handleEntityNotFound(_0x241e1a,null))[_0xaa41('0x1c')](removeEntity(_0x241e1a,null))['then'](function(){return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x5697b6){var _0x183b36=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],_0xaa41('0x5d')),'utf8');var _0x399fbd=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config['root'],_0xaa41('0x69')),_0xaa41('0x5e'));var _0x1a2deb=ejs[_0xaa41('0x5f')](_0x183b36,{'trunks':_0x5697b6});var _0x38f5d0=ejs['render'](_0x399fbd,{'trunks':_0x5697b6});fs[_0xaa41('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1a2deb);fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x38f5d0);return respondWithRpcPromise(_0xaa41('0x68'),_0xaa41('0x32'),{'module':_0xaa41('0x64')});})[_0xaa41('0x27')](handleError(_0x241e1a,null));}; \ No newline at end of file +var _0x24ca=['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','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','then','end','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','keys','find','clone','length','omit','createdAt','updatedAt','create','user','role','userProfileId','autoAssociation','body','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x3d784e,_0x357e85){var _0x6747e5=function(_0xcc9d71){while(--_0xcc9d71){_0x3d784e['push'](_0x3d784e['shift']());}};_0x6747e5(++_0x357e85);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x24ca[_0x1f36bb];return _0xaf97fa;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];var jayson=require(_0xa24c('0x1b'));var client=jayson[_0xa24c('0x1c')][_0xa24c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5a9486,_0x3ad0bf,_0x3c23fc,_0x26ff28){return new BPromise(function(_0x2fcd8b,_0x1cb08e){var _0x2d185c=_0x26ff28||client;return _0x2d185c[_0xa24c('0x1e')](_0x5a9486,_0x3c23fc)['then'](function(_0x47a063){logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,'request\x20sent');logger['debug'](_0xa24c('0x21'),_0x3ad0bf,_0xa24c('0x22'),JSON['stringify'](_0x47a063));if(_0x47a063[_0xa24c('0x23')]){if(_0x47a063['error'][_0xa24c('0x24')]===0x1f4){logger[_0xa24c('0x23')](_0xa24c('0x20'),_0x3ad0bf,_0x47a063[_0xa24c('0x23')]['message']);return _0x1cb08e(_0x47a063[_0xa24c('0x23')][_0xa24c('0x25')]);}logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x47a063['error']['message']);return _0x2fcd8b(_0x47a063['error'][_0xa24c('0x25')]);}else{logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,_0xa24c('0x22'));_0x2fcd8b(_0x47a063['result'][_0xa24c('0x25')]);}})['catch'](function(_0x224bca){logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x224bca);_0x1cb08e(_0x224bca);});});}function respondWithStatusCode(_0x346ee8,_0x363d52){_0x363d52=_0x363d52||0xcc;return function(_0x43a0c0){if(_0x43a0c0){return _0x346ee8[_0xa24c('0x26')](_0x363d52);}return _0x346ee8[_0xa24c('0x27')](_0x363d52)['end']();};}function respondWithResult(_0xec9167,_0x5cc9cb){_0x5cc9cb=_0x5cc9cb||0xc8;return function(_0x2365f9){if(_0x2365f9){return _0xec9167[_0xa24c('0x27')](_0x5cc9cb)[_0xa24c('0x28')](_0x2365f9);}};}function respondWithFilteredResult(_0x51dc3f,_0x1beb55){return function(_0x31c4d9){if(_0x31c4d9){var _0x14fd5a=typeof _0x1beb55[_0xa24c('0x29')]===_0xa24c('0x2a')&&typeof _0x1beb55[_0xa24c('0x2b')]===_0xa24c('0x2a');var _0x5b23f4=_0x31c4d9[_0xa24c('0x2c')];var _0x28675f=_0x14fd5a?0x0:_0x1beb55[_0xa24c('0x29')];var _0x12dbdc=_0x14fd5a?_0x31c4d9['count']:_0x1beb55[_0xa24c('0x29')]+_0x1beb55[_0xa24c('0x2b')];var _0x97c08;if(_0x12dbdc>=_0x5b23f4){_0x12dbdc=_0x5b23f4;_0x97c08=0xc8;}else{_0x97c08=0xce;}_0x51dc3f['status'](_0x97c08);return _0x51dc3f[_0xa24c('0x2d')](_0xa24c('0x2e'),_0x28675f+'-'+_0x12dbdc+'/'+_0x5b23f4)[_0xa24c('0x28')](_0x31c4d9);}return null;};}function patchUpdates(_0x4ae35c){return function(_0x245fb2){try{jsonpatch['apply'](_0x245fb2,_0x4ae35c,!![]);}catch(_0x1102ab){return BPromise[_0xa24c('0x2f')](_0x1102ab);}return _0x245fb2[_0xa24c('0x30')]();};}function saveUpdates(_0x5d025a,_0x1f52f8){return function(_0x53f90){if(_0x53f90){return _0x53f90[_0xa24c('0x31')](_0x5d025a)['then'](function(_0x1c1ed3){return _0x1c1ed3;});}return null;};}function removeEntity(_0x57c340,_0xa20091){return function(_0x42ba21){if(_0x42ba21){return _0x42ba21['destroy']()['then'](function(){var _0x20a276=_0x42ba21[_0xa24c('0x32')]({'plain':!![]});var _0x182e86=_0xa24c('0x33');return db[_0xa24c('0x34')][_0xa24c('0x35')]({'where':{'type':_0x182e86,'resourceId':_0x20a276['id']}})[_0xa24c('0x36')](function(){return _0x42ba21;});})['then'](function(){_0x57c340[_0xa24c('0x27')](0xcc)[_0xa24c('0x37')]();});}};}function handleEntityNotFound(_0x12825d,_0xbd24c0){return function(_0xc6337b){if(!_0xc6337b){_0x12825d[_0xa24c('0x26')](0x194);}return _0xc6337b;};}function handleError(_0x86902f,_0x81d471){_0x81d471=_0x81d471||0x1f4;return function(_0x1ea166){logger[_0xa24c('0x23')](_0x1ea166['stack']);if(_0x1ea166[_0xa24c('0x38')]){delete _0x1ea166[_0xa24c('0x38')];}_0x86902f[_0xa24c('0x27')](_0x81d471)[_0xa24c('0x39')](_0x1ea166);};}exports['index']=function(_0x56a485,_0x19a65f){var _0x56ef4d={},_0xb690b5={},_0x13f272={'count':0x0,'rows':[]};var _0x22a316=_[_0xa24c('0x3a')](db[_0xa24c('0x3b')]['rawAttributes'],function(_0x532875){return{'name':_0x532875[_0xa24c('0x3c')],'type':_0x532875[_0xa24c('0x3d')][_0xa24c('0x3e')]};});_0xb690b5[_0xa24c('0x3f')]=_[_0xa24c('0x3a')](_0x22a316,_0xa24c('0x38'));_0xb690b5['query']=_['keys'](_0x56a485[_0xa24c('0x40')]);_0xb690b5[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],_0xb690b5[_0xa24c('0x40')]);_0x56ef4d['attributes']=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],qs['fields'](_0x56a485['query'][_0xa24c('0x43')]));_0x56ef4d[_0xa24c('0x44')]=_0x56ef4d[_0xa24c('0x44')]['length']?_0x56ef4d['attributes']:_0xb690b5[_0xa24c('0x3f')];if(!_0x56a485[_0xa24c('0x40')][_0xa24c('0x45')](_0xa24c('0x46'))){_0x56ef4d[_0xa24c('0x2b')]=qs[_0xa24c('0x2b')](_0x56a485[_0xa24c('0x40')][_0xa24c('0x2b')]);_0x56ef4d['offset']=qs['offset'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x29')]);}_0x56ef4d[_0xa24c('0x47')]=qs['sort'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x48')]);_0x56ef4d[_0xa24c('0x49')]=qs[_0xa24c('0x41')](_[_0xa24c('0x4a')](_0x56a485[_0xa24c('0x40')],_0xb690b5[_0xa24c('0x41')]),_0x22a316);if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]){_0x56ef4d[_0xa24c('0x49')]=_['merge'](_0x56ef4d[_0xa24c('0x49')],{'$or':_[_0xa24c('0x3a')](_0x22a316,function(_0x39a6cd){if(_0x39a6cd['type']!==_0xa24c('0x4c')){var _0x247d2c={};_0x247d2c[_0x39a6cd[_0xa24c('0x38')]]={'$like':'%'+_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]+'%'};return _0x247d2c;}})});}_0x56ef4d=_[_0xa24c('0x4d')]({},_0x56ef4d,_0x56a485[_0xa24c('0x4e')]);var _0x46f725={'where':_0x56ef4d[_0xa24c('0x49')]};return db[_0xa24c('0x3b')][_0xa24c('0x2c')](_0x46f725)['then'](function(_0x29a84d){_0x13f272[_0xa24c('0x2c')]=_0x29a84d;if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x56ef4d[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x3b')][_0xa24c('0x51')](_0x56ef4d);})[_0xa24c('0x36')](function(_0x184179){_0x13f272['rows']=_0x184179;return _0x13f272;})['then'](respondWithFilteredResult(_0x19a65f,_0x56ef4d))[_0xa24c('0x52')](handleError(_0x19a65f,null));};exports['show']=function(_0xc078ef,_0x1f436c){var _0x4ec677={'raw':![],'where':{'id':_0xc078ef[_0xa24c('0x53')]['id']}},_0x24b3df={};_0x24b3df[_0xa24c('0x3f')]=_['keys'](db['Trunk'][_0xa24c('0x54')]);_0x24b3df['query']=_[_0xa24c('0x55')](_0xc078ef[_0xa24c('0x40')]);_0x24b3df[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],_0x24b3df[_0xa24c('0x40')]);_0x4ec677[_0xa24c('0x44')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0xc078ef['query'][_0xa24c('0x43')]));_0x4ec677[_0xa24c('0x44')]=_0x4ec677[_0xa24c('0x44')]['length']?_0x4ec677['attributes']:_0x24b3df['model'];if(_0xc078ef[_0xa24c('0x40')]['includeAll']){_0x4ec677[_0xa24c('0x50')]=[{'all':!![]}];}_0x4ec677=_[_0xa24c('0x4d')]({},_0x4ec677,_0xc078ef['options']);return db[_0xa24c('0x3b')][_0xa24c('0x56')](_0x4ec677)[_0xa24c('0x36')](handleEntityNotFound(_0x1f436c,null))[_0xa24c('0x36')](respondWithResult(_0x1f436c,null))[_0xa24c('0x52')](handleError(_0x1f436c,null));};exports[_0xa24c('0x57')]=function(_0x3816f7,_0xbeab78){var _0x518c2a={'where':{'id':_0x3816f7['params']['id']}},_0x172645={};_0x172645['model']=_['keys'](db['Trunk']['rawAttributes']);_0x518c2a[_0xa24c('0x44')]=_['intersection'](_0x172645[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0x3816f7[_0xa24c('0x40')][_0xa24c('0x43')]));_0x518c2a[_0xa24c('0x44')]=_0x518c2a[_0xa24c('0x44')][_0xa24c('0x58')]?_0x518c2a[_0xa24c('0x44')]:_0x172645[_0xa24c('0x3f')];if(_0x3816f7[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x518c2a[_0xa24c('0x50')]=[{'all':!![]}];}_0x518c2a=_[_0xa24c('0x4d')]({},_0x518c2a,_0x3816f7[_0xa24c('0x4e')]);return db[_0xa24c('0x3b')]['find'](_0x518c2a)[_0xa24c('0x36')](handleEntityNotFound(_0xbeab78,null))[_0xa24c('0x36')](function(_0x5264a7){if(_0x5264a7){var _0x1e08bb=_0x5264a7[_0xa24c('0x32')]({'plain':!![]});_0x1e08bb=qs[_0xa24c('0x59')](_0x1e08bb,['id',_0xa24c('0x5a'),'updatedAt']);_0x3816f7['body']=_[_0xa24c('0x59')](_0x3816f7['body'],['id','createdAt',_0xa24c('0x5b')]);return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_[_0xa24c('0x4d')](_0x1e08bb,_0x3816f7['body']),{'include':_0x3816f7['query'][_0xa24c('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x52a895){var _0xfcc193=_0x3816f7[_0xa24c('0x5d')][_0xa24c('0x32')]({'plain':!![]});if(!_0xfcc193)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcc193[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5c3285=_0x52a895[_0xa24c('0x32')]({'plain':!![]});var _0x3f306d=_0xa24c('0x33');return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0x3f306d,'userProfileId':_0xfcc193[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x7aab6e){if(_0x7aab6e&&_0x7aab6e[_0xa24c('0x60')]===0x0){return db['UserProfileResource'][_0xa24c('0x5c')]({'name':_0x5c3285[_0xa24c('0x38')],'resourceId':_0x5c3285['id'],'type':_0x7aab6e[_0xa24c('0x38')],'sectionId':_0x7aab6e['id']},{})[_0xa24c('0x36')](function(){return _0x52a895;});}else{return _0x52a895;}})[_0xa24c('0x52')](function(_0x2ca3fa){logger[_0xa24c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca3fa);throw _0x2ca3fa;});}return _0x52a895;});}})[_0xa24c('0x36')](respondWithResult(_0xbeab78,0xc9))[_0xa24c('0x52')](handleError(_0xbeab78,null));};exports['create']=function(_0xb1048a,_0x3e455b,_0x14da5e){var _0xb460b4;return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_0xb1048a[_0xa24c('0x61')],{'raw':!![]})[_0xa24c('0x36')](function(_0x38cc30){_0xb460b4=_0x38cc30;return db[_0xa24c('0x3b')]['findAll']({'raw':!![]});})[_0xa24c('0x36')](function(_0x3a4abd){var _0x3b894f=fs['readFileSync'](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x64')),'utf8');var _0x3ac3a0=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4f9b56=ejs['render'](_0x3b894f,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f9b56);if(_0xb460b4[_0xa24c('0x69')]){var _0x1879ae=ejs[_0xa24c('0x6a')](_0x3ac3a0,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')](_0xa24c('0x6b'),_0x1879ae);}})['then'](function(){return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x5c'),{'module':_0xa24c('0x6d')});})[_0xa24c('0x36')](function(){var _0x987aca=_0xb1048a[_0xa24c('0x5d')]['get']({'plain':!![]});if(!_0x987aca)throw new Error(_0xa24c('0x6e'));if(_0x987aca[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5b9ad7=_0xb460b4['get']({'plain':!![]});return db[_0xa24c('0x6f')]['find']({'where':{'name':_0xa24c('0x33'),'userProfileId':_0x987aca[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x180da2){if(_0x180da2&&_0x180da2['autoAssociation']===0x0){return db[_0xa24c('0x34')][_0xa24c('0x5c')]({'name':_0x5b9ad7['name'],'resourceId':_0x5b9ad7['id'],'type':_0x180da2[_0xa24c('0x38')],'sectionId':_0x180da2['id']},{})[_0xa24c('0x36')](function(){return _0xb460b4;});}else{return _0xb460b4;}})[_0xa24c('0x52')](function(_0x3e0c08){logger[_0xa24c('0x23')](_0xa24c('0x70'),_0x3e0c08);throw _0x3e0c08;});}return _0xb460b4;})[_0xa24c('0x36')](respondWithResult(_0x3e455b,0xc9))[_0xa24c('0x52')](handleError(_0x3e455b,null));};exports['update']=function(_0x12508e,_0x3c2726,_0x2cae90){var _0x28c3ff;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x12508e[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3c2726,null))[_0xa24c('0x36')](saveUpdates(_0x12508e[_0xa24c('0x61')],null))[_0xa24c('0x36')](function(_0x5b0127){if(_0x5b0127){_0x28c3ff=_0x5b0127;return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});}})['then'](function(_0x141ccf){if(_0x141ccf){var _0x3f212f=fs[_0xa24c('0x65')](path['join'](config['root'],_0xa24c('0x64')),_0xa24c('0x67'));var _0x53928f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x336898=ejs['render'](_0x3f212f,{'trunks':_0x141ccf||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x336898);var _0x263dab=ejs['render'](_0x53928f,{'trunks':_0x141ccf||[]});fs['writeFileSync'](_0xa24c('0x6b'),_0x263dab);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x31'),{'module':_0xa24c('0x6d')});}return null;})[_0xa24c('0x36')](function(_0x45b2fe){if(_0x45b2fe){return _0x28c3ff;}})[_0xa24c('0x36')](respondWithResult(_0x3c2726,null))[_0xa24c('0x52')](handleError(_0x3c2726,null));};exports[_0xa24c('0x35')]=function(_0x4ee10d,_0x3897ca,_0xa077c8){var _0x16e1db;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x4ee10d[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3897ca,null))[_0xa24c('0x36')](removeEntity(_0x3897ca,null))[_0xa24c('0x36')](function(){return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});})[_0xa24c('0x36')](function(_0x4ecbe9){var _0x1fe0f3=fs[_0xa24c('0x65')](path['join'](config[_0xa24c('0x63')],_0xa24c('0x64')),_0xa24c('0x67'));var _0x4af78f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config['root'],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4c108f=ejs['render'](_0x1fe0f3,{'trunks':_0x4ecbe9});var _0x124d52=ejs[_0xa24c('0x6a')](_0x4af78f,{'trunks':_0x4ecbe9});fs[_0xa24c('0x68')](_0xa24c('0x71'),_0x4c108f);fs['writeFileSync'](_0xa24c('0x6b'),_0x124d52);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3897ca,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 195f8bd..06fcfed 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 _0x78b5=['../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x15c9b2,_0x45a28d){var _0x237154=function(_0x45ac0b){while(--_0x45ac0b){_0x15c9b2['push'](_0x15c9b2['shift']());}};_0x237154(++_0x45a28d);}(_0x78b5,0xf4));var _0x578b=function(_0x1d4946,_0x33ce4e){_0x1d4946=_0x1d4946-0x0;var _0xe0d9ba=_0x78b5[_0x1d4946];return _0xe0d9ba;};'use strict';var _=require(_0x578b('0x0'));var util=require(_0x578b('0x1'));var logger=require('../../config/logger')(_0x578b('0x2'));var moment=require(_0x578b('0x3'));var BPromise=require(_0x578b('0x4'));var rp=require(_0x578b('0x5'));var fs=require('fs');var path=require(_0x578b('0x6'));var rimraf=require(_0x578b('0x7'));var config=require(_0x578b('0x8'));var attributes=require(_0x578b('0x9'));module[_0x578b('0xa')]=function(_0x4cf4a2,_0x241280){return _0x4cf4a2[_0x578b('0xb')](_0x578b('0xc'),attributes,{'tableName':_0x578b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a82=['tools_trunks','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define','Trunk'];(function(_0x9ebf13,_0xde48cb){var _0x56848e=function(_0x1375b2){while(--_0x1375b2){_0x9ebf13['push'](_0x9ebf13['shift']());}};_0x56848e(++_0xde48cb);}(_0x3a82,0xb1));var _0x23a8=function(_0x3ff1b2,_0x22d2ed){_0x3ff1b2=_0x3ff1b2-0x0;var _0x43ebca=_0x3a82[_0x3ff1b2];return _0x43ebca;};'use strict';var _=require(_0x23a8('0x0'));var util=require(_0x23a8('0x1'));var logger=require(_0x23a8('0x2'))(_0x23a8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x23a8('0x4'));var rimraf=require(_0x23a8('0x5'));var config=require(_0x23a8('0x6'));var attributes=require('./trunk.attributes');module[_0x23a8('0x7')]=function(_0x4f42d8,_0x4ea51){return _0x4f42d8[_0x23a8('0x8')](_0x23a8('0x9'),attributes,{'tableName':_0x23a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 9f76e79..c95590e 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 _0x322f=['request','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','Trunk,\x20%s,\x20%s','message','catch','Trunk','findAll','options','raw','where','attributes','limit','include','model','map','then','GetTrunk','ShowTrunk','find','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x322f,0x1bd));var _0xf322=function(_0x323f99,_0x906add){_0x323f99=_0x323f99-0x0;var _0x35eb59=_0x322f[_0x323f99];return _0x35eb59;};'use strict';var _=require(_0xf322('0x0'));var util=require(_0xf322('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf322('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf322('0x3'));var logger=require(_0xf322('0x4'))(_0xf322('0x5'));var config=require(_0xf322('0x6'));var jayson=require(_0xf322('0x7'));var client=jayson[_0xf322('0x8')][_0xf322('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31a86e,_0xefc004,_0x511723){return new BPromise(function(_0xbcdf7b,_0x5460db){return client[_0xf322('0xa')](_0x31a86e,_0x511723)['then'](function(_0x505a23){logger[_0xf322('0xb')]('Trunk,\x20%s,\x20%s',_0xefc004,_0xf322('0xc'));logger[_0xf322('0xd')](_0xf322('0xe'),_0xefc004,_0xf322('0xc'),JSON[_0xf322('0xf')](_0x505a23));if(_0x505a23[_0xf322('0x10')]){if(_0x505a23[_0xf322('0x10')][_0xf322('0x11')]===0x1f4){logger[_0xf322('0x10')](_0xf322('0x12'),_0xefc004,_0x505a23[_0xf322('0x10')][_0xf322('0x13')]);return _0x5460db(_0x505a23[_0xf322('0x10')][_0xf322('0x13')]);}logger['error'](_0xf322('0x12'),_0xefc004,_0x505a23[_0xf322('0x10')]['message']);return _0xbcdf7b(_0x505a23[_0xf322('0x10')][_0xf322('0x13')]);}else{logger[_0xf322('0xb')](_0xf322('0x12'),_0xefc004,_0xf322('0xc'));_0xbcdf7b(_0x505a23['result'][_0xf322('0x13')]);}})[_0xf322('0x14')](function(_0x56253f){logger[_0xf322('0x10')](_0xf322('0x12'),_0xefc004,_0x56253f);_0x5460db(_0x56253f);});});}exports['GetTrunk']=function(_0x5800ff){var _0x37b853=this;return new Promise(function(_0x5e738a,_0x58b863){return db[_0xf322('0x15')][_0xf322('0x16')]({'raw':_0x5800ff[_0xf322('0x17')]?_0x5800ff[_0xf322('0x17')][_0xf322('0x18')]===undefined?!![]:![]:!![],'where':_0x5800ff['options']?_0x5800ff['options'][_0xf322('0x19')]||null:null,'attributes':_0x5800ff[_0xf322('0x17')]?_0x5800ff[_0xf322('0x17')][_0xf322('0x1a')]||null:null,'limit':_0x5800ff[_0xf322('0x17')]?_0x5800ff[_0xf322('0x17')][_0xf322('0x1b')]||null:null,'include':_0x5800ff[_0xf322('0x17')]?_0x5800ff[_0xf322('0x17')][_0xf322('0x1c')]?_['map'](_0x5800ff[_0xf322('0x17')][_0xf322('0x1c')],function(_0x3cd5bc){return{'model':db[_0x3cd5bc[_0xf322('0x1d')]],'as':_0x3cd5bc['as'],'attributes':_0x3cd5bc[_0xf322('0x1a')],'include':_0x3cd5bc[_0xf322('0x1c')]?_[_0xf322('0x1e')](_0x3cd5bc['include'],function(_0x1f9441){return{'model':db[_0x1f9441[_0xf322('0x1d')]],'as':_0x1f9441['as'],'attributes':_0x1f9441[_0xf322('0x1a')],'include':_0x1f9441[_0xf322('0x1c')]?_[_0xf322('0x1e')](_0x1f9441[_0xf322('0x1c')],function(_0x1cfc1e){return{'model':db[_0x1cfc1e[_0xf322('0x1d')]],'as':_0x1cfc1e['as'],'attributes':_0x1cfc1e[_0xf322('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf322('0x1f')](function(_0x476709){logger[_0xf322('0xb')](_0xf322('0x20'),_0x5800ff);logger[_0xf322('0xd')]('GetTrunk',_0x5800ff,JSON[_0xf322('0xf')](_0x476709));_0x5e738a(_0x476709);})[_0xf322('0x14')](function(_0x6c3052){logger[_0xf322('0x10')](_0xf322('0x20'),_0x6c3052['message'],_0x5800ff);_0x58b863(_0x37b853[_0xf322('0x10')](0x1f4,_0x6c3052[_0xf322('0x13')]));});});};exports[_0xf322('0x21')]=function(_0x57db17){var _0xcffdd0=this;return new Promise(function(_0x3e08c8,_0x414e64){return db['Trunk'][_0xf322('0x22')]({'raw':_0x57db17[_0xf322('0x17')]?_0x57db17[_0xf322('0x17')][_0xf322('0x18')]===undefined?!![]:![]:!![],'where':_0x57db17['options']?_0x57db17['options'][_0xf322('0x19')]||null:null,'attributes':_0x57db17['options']?_0x57db17['options'][_0xf322('0x1a')]||null:null,'include':_0x57db17[_0xf322('0x17')]?_0x57db17[_0xf322('0x17')][_0xf322('0x1c')]?_[_0xf322('0x1e')](_0x57db17[_0xf322('0x17')]['include'],function(_0x5caf58){return{'model':db[_0x5caf58[_0xf322('0x1d')]],'as':_0x5caf58['as'],'attributes':_0x5caf58['attributes'],'include':_0x5caf58[_0xf322('0x1c')]?_['map'](_0x5caf58[_0xf322('0x1c')],function(_0x3fd76e){return{'model':db[_0x3fd76e[_0xf322('0x1d')]],'as':_0x3fd76e['as'],'attributes':_0x3fd76e[_0xf322('0x1a')],'include':_0x3fd76e[_0xf322('0x1c')]?_['map'](_0x3fd76e['include'],function(_0x1ce88c){return{'model':db[_0x1ce88c[_0xf322('0x1d')]],'as':_0x1ce88c['as'],'attributes':_0x1ce88c[_0xf322('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf322('0x1f')](function(_0x3969ff){logger[_0xf322('0xb')](_0xf322('0x21'),_0x57db17);logger['debug'](_0xf322('0x21'),_0x57db17,JSON['stringify'](_0x3969ff));_0x3e08c8(_0x3969ff);})['catch'](function(_0x99d40e){logger[_0xf322('0x10')](_0xf322('0x21'),_0x99d40e[_0xf322('0x13')],_0x57db17);_0x414e64(_0xcffdd0[_0xf322('0x10')](0x1f4,_0x99d40e[_0xf322('0x13')]));});});}; \ No newline at end of file +var _0x05e7=['find','where','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetTrunk','Trunk','findAll','options','raw','attributes','include','map','model','ShowTrunk'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x05e7,0x1c9));var _0x705e=function(_0x286d2d,_0x503218){_0x286d2d=_0x286d2d-0x0;var _0x32c173=_0x05e7[_0x286d2d];return _0x32c173;};'use strict';var _=require(_0x705e('0x0'));var util=require(_0x705e('0x1'));var moment=require(_0x705e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x705e('0x3'));var db=require(_0x705e('0x4'))['db'];var utils=require(_0x705e('0x5'));var logger=require(_0x705e('0x6'))(_0x705e('0x7'));var config=require(_0x705e('0x8'));var jayson=require(_0x705e('0x9'));var client=jayson[_0x705e('0xa')][_0x705e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e87fd,_0x5f48ba,_0x3dee34){return new BPromise(function(_0xb3b7a,_0x16234d){return client[_0x705e('0xc')](_0x3e87fd,_0x3dee34)[_0x705e('0xd')](function(_0x57a1cb){logger['info'](_0x705e('0xe'),_0x5f48ba,_0x705e('0xf'));logger[_0x705e('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5f48ba,'request\x20sent',JSON[_0x705e('0x11')](_0x57a1cb));if(_0x57a1cb[_0x705e('0x12')]){if(_0x57a1cb[_0x705e('0x12')]['code']===0x1f4){logger[_0x705e('0x12')](_0x705e('0xe'),_0x5f48ba,_0x57a1cb['error'][_0x705e('0x13')]);return _0x16234d(_0x57a1cb['error']['message']);}logger['error']('Trunk,\x20%s,\x20%s',_0x5f48ba,_0x57a1cb[_0x705e('0x12')][_0x705e('0x13')]);return _0xb3b7a(_0x57a1cb[_0x705e('0x12')][_0x705e('0x13')]);}else{logger[_0x705e('0x14')](_0x705e('0xe'),_0x5f48ba,_0x705e('0xf'));_0xb3b7a(_0x57a1cb[_0x705e('0x15')][_0x705e('0x13')]);}})[_0x705e('0x16')](function(_0x979c26){logger[_0x705e('0x12')](_0x705e('0xe'),_0x5f48ba,_0x979c26);_0x16234d(_0x979c26);});});}exports[_0x705e('0x17')]=function(_0x48875f){var _0x3b65b9=this;return new Promise(function(_0x5cbe77,_0xe45586){return db[_0x705e('0x18')][_0x705e('0x19')]({'raw':_0x48875f[_0x705e('0x1a')]?_0x48875f['options'][_0x705e('0x1b')]===undefined?!![]:![]:!![],'where':_0x48875f['options']?_0x48875f[_0x705e('0x1a')]['where']||null:null,'attributes':_0x48875f['options']?_0x48875f[_0x705e('0x1a')][_0x705e('0x1c')]||null:null,'limit':_0x48875f[_0x705e('0x1a')]?_0x48875f[_0x705e('0x1a')]['limit']||null:null,'include':_0x48875f[_0x705e('0x1a')]?_0x48875f[_0x705e('0x1a')][_0x705e('0x1d')]?_[_0x705e('0x1e')](_0x48875f[_0x705e('0x1a')][_0x705e('0x1d')],function(_0x4577c2){return{'model':db[_0x4577c2['model']],'as':_0x4577c2['as'],'attributes':_0x4577c2[_0x705e('0x1c')],'include':_0x4577c2[_0x705e('0x1d')]?_[_0x705e('0x1e')](_0x4577c2[_0x705e('0x1d')],function(_0x3e9aa3){return{'model':db[_0x3e9aa3[_0x705e('0x1f')]],'as':_0x3e9aa3['as'],'attributes':_0x3e9aa3['attributes'],'include':_0x3e9aa3['include']?_[_0x705e('0x1e')](_0x3e9aa3['include'],function(_0x95953a){return{'model':db[_0x95953a[_0x705e('0x1f')]],'as':_0x95953a['as'],'attributes':_0x95953a[_0x705e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ad69f){logger[_0x705e('0x14')](_0x705e('0x17'),_0x48875f);logger[_0x705e('0x10')](_0x705e('0x17'),_0x48875f,JSON['stringify'](_0x1ad69f));_0x5cbe77(_0x1ad69f);})[_0x705e('0x16')](function(_0x2eed63){logger[_0x705e('0x12')](_0x705e('0x17'),_0x2eed63[_0x705e('0x13')],_0x48875f);_0xe45586(_0x3b65b9[_0x705e('0x12')](0x1f4,_0x2eed63[_0x705e('0x13')]));});});};exports[_0x705e('0x20')]=function(_0xe26cda){var _0x343436=this;return new Promise(function(_0x33dd81,_0x3ca8c0){return db[_0x705e('0x18')][_0x705e('0x21')]({'raw':_0xe26cda['options']?_0xe26cda[_0x705e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xe26cda[_0x705e('0x1a')]?_0xe26cda['options'][_0x705e('0x22')]||null:null,'attributes':_0xe26cda[_0x705e('0x1a')]?_0xe26cda['options']['attributes']||null:null,'include':_0xe26cda[_0x705e('0x1a')]?_0xe26cda[_0x705e('0x1a')][_0x705e('0x1d')]?_['map'](_0xe26cda[_0x705e('0x1a')][_0x705e('0x1d')],function(_0x5a0221){return{'model':db[_0x5a0221[_0x705e('0x1f')]],'as':_0x5a0221['as'],'attributes':_0x5a0221[_0x705e('0x1c')],'include':_0x5a0221['include']?_[_0x705e('0x1e')](_0x5a0221[_0x705e('0x1d')],function(_0x25f701){return{'model':db[_0x25f701[_0x705e('0x1f')]],'as':_0x25f701['as'],'attributes':_0x25f701[_0x705e('0x1c')],'include':_0x25f701[_0x705e('0x1d')]?_[_0x705e('0x1e')](_0x25f701[_0x705e('0x1d')],function(_0x10c0a6){return{'model':db[_0x10c0a6['model']],'as':_0x10c0a6['as'],'attributes':_0x10c0a6[_0x705e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x705e('0xd')](function(_0x1174c0){logger[_0x705e('0x14')]('ShowTrunk',_0xe26cda);logger[_0x705e('0x10')](_0x705e('0x20'),_0xe26cda,JSON[_0x705e('0x11')](_0x1174c0));_0x33dd81(_0x1174c0);})[_0x705e('0x16')](function(_0x3578b5){logger[_0x705e('0x12')](_0x705e('0x20'),_0x3578b5[_0x705e('0x13')],_0xe26cda);_0x3ca8c0(_0x343436[_0x705e('0x12')](0x1f4,_0x3578b5[_0x705e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 100e02e..024dcd0 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71ec=['./user-setting.controller','put','/:id','isAuthenticated','update','exports','../../components/auth/service'];(function(_0x276a84,_0x579fab){var _0x4893c4=function(_0x28eba7){while(--_0x28eba7){_0x276a84['push'](_0x276a84['shift']());}};_0x4893c4(++_0x579fab);}(_0x71ec,0x13a));var _0xc71e=function(_0x3e25ba,_0x4d5399){_0x3e25ba=_0x3e25ba-0x0;var _0x393fb8=_0x71ec[_0x3e25ba];return _0x393fb8;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xc71e('0x0'));var controller=require(_0xc71e('0x1'));router[_0xc71e('0x2')](_0xc71e('0x3'),auth[_0xc71e('0x4')](),controller[_0xc71e('0x5')]);module[_0xc71e('0x6')]=router; \ No newline at end of file +var _0x700b=['../../components/auth/service','./user-setting.controller','put','/:id','update','exports','express','Router'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x700b,0xee));var _0xb700=function(_0x2c0236,_0x2ed459){_0x2c0236=_0x2c0236-0x0;var _0x577d74=_0x700b[_0x2c0236];return _0x577d74;};'use strict';var express=require(_0xb700('0x0'));var router=express[_0xb700('0x1')]();var auth=require(_0xb700('0x2'));var controller=require(_0xb700('0x3'));router[_0xb700('0x4')](_0xb700('0x5'),auth['isAuthenticated'](),controller[_0xb700('0x6')]);module[_0xb700('0x7')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 24990e6..2373698 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7184=['error','warning','debug','exports','ENUM','BOOLEAN','TEXT','INTEGER','UserId','sequelize'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x7184,0x149));var _0x4718=function(_0xaecc27,_0x3b15ab){_0xaecc27=_0xaecc27-0x0;var _0x2203ec=_0x7184[_0xaecc27];return _0x2203ec;};'use strict';var Sequelize=require(_0x4718('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x4718('0x1'),_0x4718('0x2'),'info',_0x4718('0x3')];module[_0x4718('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x4718('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x4718('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x4718('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x4718('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x4718('0x8')],'unique':_0x4718('0x9')}}; \ No newline at end of file +var _0x1b1b=['debug','exports','ENUM','BOOLEAN','TEXT','DATE','UserId','sequelize','error','warning','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1b1b,0x104));var _0xb1b1=function(_0x5c8d06,_0x2e02e6){_0x5c8d06=_0x5c8d06-0x0;var _0x1516c3=_0x1b1b[_0x5c8d06];return _0x1516c3;};'use strict';var Sequelize=require(_0xb1b1('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xb1b1('0x1'),_0xb1b1('0x2'),_0xb1b1('0x3'),_0xb1b1('0x4')];module[_0xb1b1('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0xb1b1('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xb1b1('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xb1b1('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xb1b1('0x9')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0xb1b1('0xa')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index d095104..cb2bc60 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39a9=['json','update','then','sendStatus','error','stack','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','localhost','status'];(function(_0x5b36bd,_0x4dfb36){var _0x1614fe=function(_0x559b7c){while(--_0x559b7c){_0x5b36bd['push'](_0x5b36bd['shift']());}};_0x1614fe(++_0x4dfb36);}(_0x39a9,0x1d0));var _0x939a=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x39a9[_0x525af9];return _0x129fbf;};'use strict';var _=require(_0x939a('0x0'));var Redis=require(_0x939a('0x1'));var logger=require(_0x939a('0x2'))(_0x939a('0x3'));var config=require(_0x939a('0x4'));var db=require(_0x939a('0x5'))['db'];var socket=require(_0x939a('0x6'))(new Redis(config[_0x939a('0x7')]));require(_0x939a('0x8'))[_0x939a('0x9')](socket);config[_0x939a('0x7')]=_['defaults'](config[_0x939a('0x7')],{'host':_0x939a('0xa'),'port':0x18eb});function respondWithResult(_0x12cd66,_0x1c97c1){_0x1c97c1=_0x1c97c1||0xc8;return function(_0x3bed20){if(_0x3bed20){return _0x12cd66[_0x939a('0xb')](_0x1c97c1)[_0x939a('0xc')](_0x3bed20);}};}function saveUpdates(_0x7a6c61){return function(_0x529156){if(_0x529156){return _0x529156[_0x939a('0xd')](_0x7a6c61)[_0x939a('0xe')](function(_0x27fc39){return _0x27fc39;});}return null;};}function handleEntityNotFound(_0x5e81d6){return function(_0x11d9db){if(!_0x11d9db){_0x5e81d6[_0x939a('0xf')](0x194);}return _0x11d9db;};}function handleError(_0x2f8636,_0x5a84d8){_0x5a84d8=_0x5a84d8||0x1f4;return function(_0x3032c4){logger[_0x939a('0x10')](_0x3032c4[_0x939a('0x11')]);if(_0x3032c4['name']){delete _0x3032c4['name'];}_0x2f8636[_0x939a('0xb')](_0x5a84d8)[_0x939a('0x12')](_0x3032c4);};}exports[_0x939a('0xd')]=function(_0x5e22be,_0x3dbc7f){if(_0x5e22be[_0x939a('0x13')][_0x939a('0x14')]!==_0x939a('0x15'))throw new Error(_0x939a('0x16'));if(isNaN(Number(_0x5e22be[_0x939a('0x17')]['id'])))throw new Error(_0x939a('0x18'));return db['UserSetting'][_0x939a('0x19')]({'where':{'id':_0x5e22be['params']['id']}})[_0x939a('0xe')](handleEntityNotFound(_0x3dbc7f,null))['then'](saveUpdates(_0x5e22be[_0x939a('0x1a')],null))[_0x939a('0xe')](respondWithResult(_0x3dbc7f,null))[_0x939a('0x1b')](handleError(_0x3dbc7f,null));}; \ No newline at end of file +var _0xa631=['user','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','ioredis','../../config/logger','api','../../mysqldb','./user-setting.socket','register','redis','status','update','then','sendStatus','stack','name','send'];(function(_0x2552c2,_0x5013b2){var _0xd5794b=function(_0x4133c2){while(--_0x4133c2){_0x2552c2['push'](_0x2552c2['shift']());}};_0xd5794b(++_0x5013b2);}(_0xa631,0xe4));var _0x1a63=function(_0x1c2a1,_0x20979d){_0x1c2a1=_0x1c2a1-0x0;var _0x2da71b=_0xa631[_0x1c2a1];return _0x2da71b;};'use strict';var _=require('lodash');var Redis=require(_0x1a63('0x0'));var logger=require(_0x1a63('0x1'))(_0x1a63('0x2'));var config=require('../../config/environment');var db=require(_0x1a63('0x3'))['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1a63('0x4'))[_0x1a63('0x5')](socket);config[_0x1a63('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0x5df65f,_0x2a8dd9){_0x2a8dd9=_0x2a8dd9||0xc8;return function(_0xf1cb96){if(_0xf1cb96){return _0x5df65f[_0x1a63('0x7')](_0x2a8dd9)['json'](_0xf1cb96);}};}function saveUpdates(_0x47a292){return function(_0xc39ccf){if(_0xc39ccf){return _0xc39ccf[_0x1a63('0x8')](_0x47a292)[_0x1a63('0x9')](function(_0x334902){return _0x334902;});}return null;};}function handleEntityNotFound(_0x38b2be){return function(_0x58dd88){if(!_0x58dd88){_0x38b2be[_0x1a63('0xa')](0x194);}return _0x58dd88;};}function handleError(_0x1047cb,_0x1899b9){_0x1899b9=_0x1899b9||0x1f4;return function(_0x121a94){logger['error'](_0x121a94[_0x1a63('0xb')]);if(_0x121a94[_0x1a63('0xc')]){delete _0x121a94[_0x1a63('0xc')];}_0x1047cb['status'](_0x1899b9)[_0x1a63('0xd')](_0x121a94);};}exports['update']=function(_0x169244,_0x4485ea){if(_0x169244[_0x1a63('0xe')]['role']!=='admin')throw new Error(_0x1a63('0xf'));if(isNaN(Number(_0x169244[_0x1a63('0x10')]['id'])))throw new Error(_0x1a63('0x11'));return db[_0x1a63('0x12')][_0x1a63('0x13')]({'where':{'id':_0x169244['params']['id']}})[_0x1a63('0x9')](handleEntityNotFound(_0x4485ea,null))['then'](saveUpdates(_0x169244[_0x1a63('0x14')],null))[_0x1a63('0x9')](respondWithResult(_0x4485ea,null))[_0x1a63('0x15')](handleError(_0x4485ea,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 7d6ebbe..4847223 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4285=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserSetting'];(function(_0x9e6439,_0x1686bb){var _0x58fb8f=function(_0x5aaf02){while(--_0x5aaf02){_0x9e6439['push'](_0x9e6439['shift']());}};_0x58fb8f(++_0x1686bb);}(_0x4285,0xb8));var _0x5428=function(_0x59b330,_0x2802d3){_0x59b330=_0x59b330-0x0;var _0x579775=_0x4285[_0x59b330];return _0x579775;};'use strict';var EventEmitter=require(_0x5428('0x0'));var UserSetting=require(_0x5428('0x1'))['db'][_0x5428('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x5428('0x3')](0x0);var events={'afterCreate':_0x5428('0x4'),'afterUpdate':_0x5428('0x5'),'afterDestroy':_0x5428('0x6')};function emitEvent(_0x445e43){return function(_0x4a4a99,_0x24a0d4,_0x240c72){UserSettingEvents[_0x5428('0x7')](_0x445e43+':'+_0x4a4a99['id'],_0x4a4a99);UserSettingEvents[_0x5428('0x7')](_0x445e43,_0x4a4a99);_0x240c72(null);};}for(var e in events){if(events[_0x5428('0x8')](e)){var event=events[e];UserSetting[_0x5428('0x9')](e,emitEvent(event));}}module[_0x5428('0xa')]=UserSettingEvents; \ No newline at end of file +var _0x6c6a=['hook','exports','events','../../mysqldb','UserSetting','setMaxListeners','emit','hasOwnProperty'];(function(_0x3c18b0,_0x93f508){var _0x3577c5=function(_0x2b93cf){while(--_0x2b93cf){_0x3c18b0['push'](_0x3c18b0['shift']());}};_0x3577c5(++_0x93f508);}(_0x6c6a,0x122));var _0xa6c6=function(_0x3fb059,_0x28b3b0){_0x3fb059=_0x3fb059-0x0;var _0x24d254=_0x6c6a[_0x3fb059];return _0x24d254;};'use strict';var EventEmitter=require(_0xa6c6('0x0'));var UserSetting=require(_0xa6c6('0x1'))['db'][_0xa6c6('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xa6c6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x112436){return function(_0x31fcaf,_0x2453e7,_0x5780e7){UserSettingEvents[_0xa6c6('0x4')](_0x112436+':'+_0x31fcaf['id'],_0x31fcaf);UserSettingEvents[_0xa6c6('0x4')](_0x112436,_0x31fcaf);_0x5780e7(null);};}for(var e in events){if(events[_0xa6c6('0x5')](e)){var event=events[e];UserSetting[_0xa6c6('0x6')](e,emitEvent(event));}}module[_0xa6c6('0x7')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 4ce02db..760cf51 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x878f=['define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','exports'];(function(_0x9096d,_0x5b12fa){var _0x15ad4e=function(_0x52010c){while(--_0x52010c){_0x9096d['push'](_0x9096d['shift']());}};_0x15ad4e(++_0x5b12fa);}(_0x878f,0x173));var _0xf878=function(_0x3da7b1,_0x263399){_0x3da7b1=_0x3da7b1-0x0;var _0x56474a=_0x878f[_0x3da7b1];return _0x56474a;};'use strict';var attributes=require('./user-setting.attributes');module[_0xf878('0x0')]=function(_0x658976){return _0x658976[_0xf878('0x1')](_0xf878('0x2'),attributes,{'tableName':_0xf878('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d74cf){if(!_0x3d74cf[_0xf878('0x4')])_0x3d74cf[_0xf878('0x5')]=null;else if(_0x3d74cf[_0xf878('0x5')]===null)_0x3d74cf[_0xf878('0x5')]=new Date();}}});}; \ No newline at end of file +var _0xceb0=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','UserSetting'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0xceb0,0x173));var _0x0ceb=function(_0x2ff798,_0x59746a){_0x2ff798=_0x2ff798-0x0;var _0x143207=_0xceb0[_0x2ff798];return _0x143207;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x54382b){return _0x54382b['define'](_0x0ceb('0x0'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1659e3){if(!_0x1659e3[_0x0ceb('0x1')])_0x1659e3[_0x0ceb('0x2')]=null;else if(_0x1659e3['clientSideLoggingEnabledSince']===null)_0x1659e3['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 785a947..2c9d196 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f77=['user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId','length'];(function(_0x4d2d43,_0x478abf){var _0x56a718=function(_0x46ed3d){while(--_0x46ed3d){_0x4d2d43['push'](_0x4d2d43['shift']());}};_0x56a718(++_0x478abf);}(_0x8f77,0x19b));var _0x78f7=function(_0x55d85b,_0x4a39d0){_0x55d85b=_0x55d85b-0x0;var _0x183bb0=_0x8f77[_0x55d85b];return _0x183bb0;};'use strict';var UserSettingEvents=require(_0x78f7('0x0'));var events=[_0x78f7('0x1'),_0x78f7('0x2'),_0x78f7('0x3')];function createListener(_0x2d2596,_0x4e69db){return function(_0x496bb7){_0x4e69db[_0x78f7('0x4')](_0x2d2596,_0x496bb7);if(_0x2d2596===_0x78f7('0x5')){_0x4e69db[_0x78f7('0x4')](_0x78f7('0x6')+_0x496bb7[_0x78f7('0x7')],_0x496bb7);}};}exports['register']=function(_0xb2f3c8){for(var _0x33e4e4=0x0,_0x383b36=events[_0x78f7('0x8')];_0x33e4e4<_0x383b36;_0x33e4e4++){var _0x5dcd2f=events[_0x33e4e4];var _0x3fb5cf=createListener(_0x78f7('0x9')+_0x5dcd2f,_0xb2f3c8);UserSettingEvents['on'](_0x5dcd2f,_0x3fb5cf);}}; \ No newline at end of file +var _0x307a=['./user-setting.events','save','remove','update','emit','user-setting:update','user-setting:update:user-','register','length','user-setting:'];(function(_0x3f3fd0,_0x2a75b7){var _0x359426=function(_0x56ce54){while(--_0x56ce54){_0x3f3fd0['push'](_0x3f3fd0['shift']());}};_0x359426(++_0x2a75b7);}(_0x307a,0xfa));var _0xa307=function(_0x50f308,_0x49cb3f){_0x50f308=_0x50f308-0x0;var _0x48c4c1=_0x307a[_0x50f308];return _0x48c4c1;};'use strict';var UserSettingEvents=require(_0xa307('0x0'));var events=[_0xa307('0x1'),_0xa307('0x2'),_0xa307('0x3')];function createListener(_0x4d1d70,_0x4c912b){return function(_0x499ff4){_0x4c912b[_0xa307('0x4')](_0x4d1d70,_0x499ff4);if(_0x4d1d70===_0xa307('0x5')){_0x4c912b[_0xa307('0x4')](_0xa307('0x6')+_0x499ff4['UserId'],_0x499ff4);}};}exports[_0xa307('0x7')]=function(_0x39d76f){for(var _0x14227f=0x0,_0x118eb3=events[_0xa307('0x8')];_0x14227f<_0x118eb3;_0x14227f++){var _0x44bd1b=events[_0x14227f];var _0x3e87fb=createListener(_0xa307('0x9')+_0x44bd1b,_0x39d76f);UserSettingEvents['on'](_0x44bd1b,_0x3e87fb);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 4e27e82..75c02a5 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 _0x325f=['bulkCreate','addQueues','diskStorage','join','root','format','%s-%s','now','originalname','single','file','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','addSmsAccounts','addWhatsappAccounts','addSquareProjects','put','/:id','update','/:id/password','removeQueues','delete','removeTeams','destroy','/:id/chat_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','index','isAuthenticated','describe','/whoami','whoami','/presence','getPresence','show','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many'];(function(_0x2d80e3,_0x3a3a0a){var _0x2b0ba1=function(_0xf96714){while(--_0xf96714){_0x2d80e3['push'](_0x2d80e3['shift']());}};_0x2b0ba1(++_0x3a3a0a);}(_0x325f,0x12a));var _0xf325=function(_0x18fa95,_0x17988d){_0x18fa95=_0x18fa95-0x0;var _0x2ba38f=_0x325f[_0x18fa95];return _0x2ba38f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf325('0x0'));var timeout=require(_0xf325('0x1'));var express=require(_0xf325('0x2'));var router=express[_0xf325('0x3')]();var fs_extra=require(_0xf325('0x4'));var auth=require(_0xf325('0x5'));var interaction=require(_0xf325('0x6'));var config=require('../../config/environment');var controller=require(_0xf325('0x7'));router[_0xf325('0x8')]('/',auth['isAuthenticated'](),controller[_0xf325('0x9')]);router[_0xf325('0x8')]('/describe',auth[_0xf325('0xa')](),controller[_0xf325('0xb')]);router[_0xf325('0x8')](_0xf325('0xc'),auth['isAuthenticated'](),controller[_0xf325('0xd')]);router[_0xf325('0x8')](_0xf325('0xe'),auth[_0xf325('0xa')](),controller[_0xf325('0xf')]);router[_0xf325('0x8')]('/:id',auth[_0xf325('0xa')](),controller[_0xf325('0x10')]);router['get']('/:id/avatar',controller[_0xf325('0x11')]);router[_0xf325('0x8')]('/:id/open_tabs',auth[_0xf325('0xa')](),controller['getOpenTabs']);router[_0xf325('0x8')](_0xf325('0x12'),auth[_0xf325('0xa')](),controller[_0xf325('0x13')]);router[_0xf325('0x8')](_0xf325('0x14'),auth[_0xf325('0xa')](),controller[_0xf325('0x15')]);router['get'](_0xf325('0x16'),auth['isAuthenticated'](),controller[_0xf325('0x17')]);router['get'](_0xf325('0x18'),auth[_0xf325('0xa')](),controller['getGroups']);router['get']('/:id/recordings',auth[_0xf325('0xa')](),controller[_0xf325('0x19')]);router[_0xf325('0x8')](_0xf325('0x1a'),auth[_0xf325('0xa')](),controller[_0xf325('0x1b')]);router[_0xf325('0x8')](_0xf325('0x1c'),auth[_0xf325('0xa')](),controller[_0xf325('0x1d')]);router[_0xf325('0x8')](_0xf325('0x1e'),auth[_0xf325('0xa')](),controller[_0xf325('0x1f')]);router[_0xf325('0x8')]('/:id/mail/interactions',auth[_0xf325('0xa')](),controller[_0xf325('0x20')]);router['get'](_0xf325('0x21'),auth[_0xf325('0xa')](),controller[_0xf325('0x22')]);router['get'](_0xf325('0x23'),auth[_0xf325('0xa')](),controller['getFaxInteractions']);router[_0xf325('0x8')]('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller[_0xf325('0x24')]);router[_0xf325('0x8')](_0xf325('0x25'),auth[_0xf325('0xa')](),controller[_0xf325('0x26')]);router['get'](_0xf325('0x27'),auth['isAuthenticated'](),controller[_0xf325('0x28')]);router[_0xf325('0x8')](_0xf325('0x29'),auth[_0xf325('0xa')](),controller[_0xf325('0x2a')]);router[_0xf325('0x8')](_0xf325('0x2b'),auth[_0xf325('0xa')](),controller[_0xf325('0x2c')]);router[_0xf325('0x8')](_0xf325('0x2d'),auth[_0xf325('0xa')](),controller[_0xf325('0x2e')]);router['get']('/:id/mail_accounts',auth['isAuthenticated'](),controller['getMailAccounts']);router[_0xf325('0x8')]('/:id/openchannel_accounts',auth[_0xf325('0xa')](),controller[_0xf325('0x2f')]);router[_0xf325('0x8')]('/:id/sms_accounts',auth[_0xf325('0xa')](),controller[_0xf325('0x30')]);router['get'](_0xf325('0x31'),auth['isAuthenticated'](),controller[_0xf325('0x32')]);router[_0xf325('0x8')](_0xf325('0x33'),auth[_0xf325('0xa')](),controller[_0xf325('0x34')]);router[_0xf325('0x8')](_0xf325('0x35'),auth[_0xf325('0xa')](),controller['getSquareProjects']);router[_0xf325('0x8')](_0xf325('0x36'),auth[_0xf325('0xa')](),controller[_0xf325('0x37')]);router[_0xf325('0x8')](_0xf325('0x38'),auth[_0xf325('0xa')](),controller[_0xf325('0x39')]);router[_0xf325('0x3a')](_0xf325('0x12'),auth['isAuthenticated'](),controller[_0xf325('0x3b')]);router[_0xf325('0x3a')]('/',auth[_0xf325('0xa')](),controller[_0xf325('0x3c')]);router[_0xf325('0x3a')](_0xf325('0x3d'),auth[_0xf325('0xa')](),controller[_0xf325('0x3e')]);router[_0xf325('0x3a')](_0xf325('0x14'),auth[_0xf325('0xa')](),controller[_0xf325('0x3f')]);var upload=multer({'storage':multer[_0xf325('0x40')]({'destination':function(_0x233605,_0x4df1e5,_0xea3062){_0xea3062(null,path[_0xf325('0x41')](config[_0xf325('0x42')],'server/files/images/'));},'filename':function(_0x4d5e9a,_0xecf1c,_0x237a24){_0x237a24(null,util[_0xf325('0x43')](_0xf325('0x44'),Date[_0xf325('0x45')](),_0xecf1c[_0xf325('0x46')]));}})});router[_0xf325('0x3a')]('/:id/avatar',upload[_0xf325('0x47')](_0xf325('0x48')),controller['addAvatar']);router['post'](_0xf325('0x49'),auth[_0xf325('0xa')](),controller[_0xf325('0x4a')]);router[_0xf325('0x3a')](_0xf325('0x4b'),auth[_0xf325('0xa')](),controller[_0xf325('0x4c')]);router['post'](_0xf325('0x4d'),auth[_0xf325('0xa')](),controller[_0xf325('0x4e')]);router['post'](_0xf325('0x4f'),auth[_0xf325('0xa')](),controller[_0xf325('0x50')]);router[_0xf325('0x3a')](_0xf325('0x25'),auth['isAuthenticated'](),controller[_0xf325('0x51')]);router[_0xf325('0x3a')]('/:id/chat_interactions',auth[_0xf325('0xa')](),controller[_0xf325('0x52')]);router['post'](_0xf325('0x53'),auth[_0xf325('0xa')](),controller[_0xf325('0x54')]);router['post'](_0xf325('0x55'),auth[_0xf325('0xa')](),controller[_0xf325('0x56')]);router['post'](_0xf325('0x57'),auth[_0xf325('0xa')](),controller[_0xf325('0x58')]);router['post'](_0xf325('0x59'),auth[_0xf325('0xa')](),controller['addOpenchannelInteractions']);router['post'](_0xf325('0x5a'),auth['isAuthenticated'](),controller[_0xf325('0x5b')]);router['post']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xf325('0x5c')]);router[_0xf325('0x3a')](_0xf325('0x5d'),auth['isAuthenticated'](),controller[_0xf325('0x5e')]);router['post'](_0xf325('0x5f'),auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router[_0xf325('0x3a')](_0xf325('0x60'),auth['isAuthenticated'](),controller[_0xf325('0x61')]);router[_0xf325('0x3a')]('/:id/chat_websites',auth[_0xf325('0xa')](),controller['addChatWebsites']);router[_0xf325('0x3a')](_0xf325('0x33'),auth[_0xf325('0xa')](),controller[_0xf325('0x62')]);router['post'](_0xf325('0x35'),auth[_0xf325('0xa')](),controller[_0xf325('0x63')]);router['post'](_0xf325('0x38'),auth[_0xf325('0xa')](),controller['createApiKey']);router[_0xf325('0x64')](_0xf325('0x65'),auth[_0xf325('0xa')](),controller[_0xf325('0x66')]);router[_0xf325('0x64')](_0xf325('0x67'),auth[_0xf325('0xa')](),controller['changePassword']);router['delete']('/:id/queues',auth['isAuthenticated'](),controller[_0xf325('0x68')]);router[_0xf325('0x69')](_0xf325('0x25'),auth[_0xf325('0xa')](),controller[_0xf325('0x6a')]);router[_0xf325('0x69')]('/:id',auth['isAuthenticated'](),controller[_0xf325('0x6b')]);router[_0xf325('0x69')](_0xf325('0x6c'),auth[_0xf325('0xa')](),controller['removeChatInteractions']);router['delete']('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xf325('0x6d')]);router['delete'](_0xf325('0x55'),auth[_0xf325('0xa')](),controller[_0xf325('0x6e')]);router[_0xf325('0x69')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xf325('0x6f')]);router[_0xf325('0x69')](_0xf325('0x59'),auth[_0xf325('0xa')](),controller[_0xf325('0x70')]);router[_0xf325('0x69')](_0xf325('0x5a'),auth[_0xf325('0xa')](),controller[_0xf325('0x71')]);router[_0xf325('0x69')](_0xf325('0x2d'),auth['isAuthenticated'](),controller[_0xf325('0x72')]);router[_0xf325('0x69')](_0xf325('0x5d'),auth[_0xf325('0xa')](),controller['removeMailAccounts']);router['delete'](_0xf325('0x5f'),auth[_0xf325('0xa')](),controller[_0xf325('0x73')]);router[_0xf325('0x69')]('/:id/sms_accounts',auth['isAuthenticated'](),controller['removeSmsAccounts']);router['delete'](_0xf325('0x31'),auth[_0xf325('0xa')](),controller[_0xf325('0x74')]);router[_0xf325('0x69')](_0xf325('0x33'),auth[_0xf325('0xa')](),controller[_0xf325('0x75')]);router[_0xf325('0x69')](_0xf325('0x35'),auth[_0xf325('0xa')](),controller[_0xf325('0x76')]);router[_0xf325('0x69')]('/:id/api_key',auth[_0xf325('0xa')](),controller[_0xf325('0x77')]);module['exports']=router; \ No newline at end of file +var _0x568b=['isAuthenticated','describe','get','whoami','/presence','getPresence','/:id','getAvatar','getOpenTabs','getContacts','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/mail/interactions','/:id/sms/interactions','/:id/fax/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','/:id/contacts','addContacts','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','now','single','file','addAvatar','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','changePassword','delete','/:id/queues','removeQueues','removeTeams','destroy','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','index','/describe'];(function(_0x3d3d1d,_0x772eba){var _0x43c7b2=function(_0xbf60ec){while(--_0xbf60ec){_0x3d3d1d['push'](_0x3d3d1d['shift']());}};_0x43c7b2(++_0x772eba);}(_0x568b,0x1af));var _0xb568=function(_0x4b737d,_0x50bccd){_0x4b737d=_0x4b737d-0x0;var _0x4e123a=_0x568b[_0x4b737d];return _0x4e123a;};'use strict';var multer=require(_0xb568('0x0'));var util=require('util');var path=require(_0xb568('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb568('0x2')]();var fs_extra=require(_0xb568('0x3'));var auth=require(_0xb568('0x4'));var interaction=require(_0xb568('0x5'));var config=require('../../config/environment');var controller=require(_0xb568('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xb568('0x7')]);router['get'](_0xb568('0x8'),auth[_0xb568('0x9')](),controller[_0xb568('0xa')]);router[_0xb568('0xb')]('/whoami',auth['isAuthenticated'](),controller[_0xb568('0xc')]);router[_0xb568('0xb')](_0xb568('0xd'),auth[_0xb568('0x9')](),controller[_0xb568('0xe')]);router[_0xb568('0xb')](_0xb568('0xf'),auth[_0xb568('0x9')](),controller['show']);router[_0xb568('0xb')]('/:id/avatar',controller[_0xb568('0x10')]);router['get']('/:id/open_tabs',auth[_0xb568('0x9')](),controller[_0xb568('0x11')]);router[_0xb568('0xb')]('/:id/contacts',auth[_0xb568('0x9')](),controller[_0xb568('0x12')]);router['get']('/:id/queues',auth[_0xb568('0x9')](),controller[_0xb568('0x13')]);router[_0xb568('0xb')](_0xb568('0x14'),auth[_0xb568('0x9')](),controller['getVoiceQueuesRt']);router['get'](_0xb568('0x15'),auth[_0xb568('0x9')](),controller[_0xb568('0x16')]);router[_0xb568('0xb')](_0xb568('0x17'),auth['isAuthenticated'](),controller[_0xb568('0x18')]);router['get'](_0xb568('0x19'),auth[_0xb568('0x9')](),controller[_0xb568('0x1a')]);router[_0xb568('0xb')](_0xb568('0x1b'),auth[_0xb568('0x9')](),controller[_0xb568('0x1c')]);router[_0xb568('0xb')]('/:id/openchannel/interactions',auth[_0xb568('0x9')](),controller['getOpenchannelInteractions']);router['get'](_0xb568('0x1d'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0xb568('0xb')](_0xb568('0x1e'),auth[_0xb568('0x9')](),controller['getSmsInteractions']);router['get'](_0xb568('0x1f'),auth[_0xb568('0x9')](),controller['getFaxInteractions']);router['get']('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller[_0xb568('0x20')]);router['get'](_0xb568('0x21'),auth[_0xb568('0x9')](),controller[_0xb568('0x22')]);router[_0xb568('0xb')](_0xb568('0x23'),auth[_0xb568('0x9')](),controller['getLists']);router[_0xb568('0xb')](_0xb568('0x24'),auth[_0xb568('0x9')](),controller[_0xb568('0x25')]);router['get'](_0xb568('0x26'),auth[_0xb568('0x9')](),controller['getVoicePrefixes']);router[_0xb568('0xb')](_0xb568('0x27'),auth[_0xb568('0x9')](),controller[_0xb568('0x28')]);router['get'](_0xb568('0x29'),auth[_0xb568('0x9')](),controller[_0xb568('0x2a')]);router[_0xb568('0xb')](_0xb568('0x2b'),auth[_0xb568('0x9')](),controller['getOpenchannelAccounts']);router['get'](_0xb568('0x2c'),auth[_0xb568('0x9')](),controller[_0xb568('0x2d')]);router['get'](_0xb568('0x2e'),auth[_0xb568('0x9')](),controller['getChatWebsites']);router[_0xb568('0xb')](_0xb568('0x2f'),auth[_0xb568('0x9')](),controller[_0xb568('0x30')]);router[_0xb568('0xb')](_0xb568('0x31'),auth['isAuthenticated'](),controller[_0xb568('0x32')]);router['get'](_0xb568('0x33'),auth[_0xb568('0x9')](),controller[_0xb568('0x34')]);router[_0xb568('0xb')](_0xb568('0x35'),auth[_0xb568('0x9')](),controller['getApiKey']);router[_0xb568('0x36')](_0xb568('0x37'),auth[_0xb568('0x9')](),controller[_0xb568('0x38')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb568('0x39')]);router['post']('/create_many',auth[_0xb568('0x9')](),controller[_0xb568('0x3a')]);router[_0xb568('0x36')]('/:id/queues',auth[_0xb568('0x9')](),controller[_0xb568('0x3b')]);var upload=multer({'storage':multer[_0xb568('0x3c')]({'destination':function(_0x10967a,_0x2594b4,_0x4e60cc){_0x4e60cc(null,path[_0xb568('0x3d')](config[_0xb568('0x3e')],_0xb568('0x3f')));},'filename':function(_0x318d4a,_0x373db4,_0x45c13e){_0x45c13e(null,util['format']('%s-%s',Date[_0xb568('0x40')](),_0x373db4['originalname']));}})});router[_0xb568('0x36')]('/:id/avatar',upload[_0xb568('0x41')](_0xb568('0x42')),controller[_0xb568('0x43')]);router[_0xb568('0x36')](_0xb568('0x44'),auth[_0xb568('0x9')](),controller['login']);router[_0xb568('0x36')](_0xb568('0x45'),auth[_0xb568('0x9')](),controller['logout']);router[_0xb568('0x36')](_0xb568('0x46'),auth['isAuthenticated'](),controller[_0xb568('0x47')]);router['post'](_0xb568('0x48'),auth[_0xb568('0x9')](),controller['unpause']);router['post'](_0xb568('0x21'),auth[_0xb568('0x9')](),controller['addTeams']);router[_0xb568('0x36')](_0xb568('0x49'),auth['isAuthenticated'](),controller[_0xb568('0x4a')]);router[_0xb568('0x36')](_0xb568('0x4b'),auth['isAuthenticated'](),controller['addMailInteractions']);router[_0xb568('0x36')](_0xb568('0x4c'),auth[_0xb568('0x9')](),controller['addFaxInteractions']);router[_0xb568('0x36')](_0xb568('0x4d'),auth[_0xb568('0x9')](),controller[_0xb568('0x4e')]);router[_0xb568('0x36')]('/:id/openchannel_interactions',auth[_0xb568('0x9')](),controller['addOpenchannelInteractions']);router[_0xb568('0x36')](_0xb568('0x4f'),auth['isAuthenticated'](),controller[_0xb568('0x50')]);router[_0xb568('0x36')](_0xb568('0x27'),auth[_0xb568('0x9')](),controller[_0xb568('0x51')]);router[_0xb568('0x36')](_0xb568('0x29'),auth[_0xb568('0x9')](),controller[_0xb568('0x52')]);router[_0xb568('0x36')](_0xb568('0x2b'),auth[_0xb568('0x9')](),controller[_0xb568('0x53')]);router['post'](_0xb568('0x2c'),auth[_0xb568('0x9')](),controller[_0xb568('0x54')]);router[_0xb568('0x36')](_0xb568('0x2e'),auth[_0xb568('0x9')](),controller[_0xb568('0x55')]);router[_0xb568('0x36')](_0xb568('0x2f'),auth[_0xb568('0x9')](),controller[_0xb568('0x56')]);router[_0xb568('0x36')]('/:id/square_projects',auth[_0xb568('0x9')](),controller[_0xb568('0x57')]);router[_0xb568('0x36')]('/:id/api_key',auth[_0xb568('0x9')](),controller[_0xb568('0x58')]);router[_0xb568('0x59')](_0xb568('0xf'),auth[_0xb568('0x9')](),controller[_0xb568('0x5a')]);router[_0xb568('0x59')]('/:id/password',auth[_0xb568('0x9')](),controller[_0xb568('0x5b')]);router[_0xb568('0x5c')](_0xb568('0x5d'),auth[_0xb568('0x9')](),controller[_0xb568('0x5e')]);router[_0xb568('0x5c')](_0xb568('0x21'),auth[_0xb568('0x9')](),controller[_0xb568('0x5f')]);router[_0xb568('0x5c')](_0xb568('0xf'),auth[_0xb568('0x9')](),controller[_0xb568('0x60')]);router[_0xb568('0x5c')](_0xb568('0x49'),auth[_0xb568('0x9')](),controller['removeChatInteractions']);router[_0xb568('0x5c')](_0xb568('0x4b'),auth[_0xb568('0x9')](),controller[_0xb568('0x61')]);router[_0xb568('0x5c')](_0xb568('0x4c'),auth[_0xb568('0x9')](),controller[_0xb568('0x62')]);router['delete'](_0xb568('0x4d'),auth['isAuthenticated'](),controller[_0xb568('0x63')]);router[_0xb568('0x5c')](_0xb568('0x64'),auth[_0xb568('0x9')](),controller[_0xb568('0x65')]);router[_0xb568('0x5c')](_0xb568('0x4f'),auth[_0xb568('0x9')](),controller[_0xb568('0x66')]);router['delete'](_0xb568('0x27'),auth[_0xb568('0x9')](),controller[_0xb568('0x67')]);router[_0xb568('0x5c')]('/:id/mail_accounts',auth[_0xb568('0x9')](),controller[_0xb568('0x68')]);router[_0xb568('0x5c')](_0xb568('0x2b'),auth['isAuthenticated'](),controller[_0xb568('0x69')]);router[_0xb568('0x5c')](_0xb568('0x2c'),auth[_0xb568('0x9')](),controller['removeSmsAccounts']);router[_0xb568('0x5c')](_0xb568('0x2e'),auth['isAuthenticated'](),controller[_0xb568('0x6a')]);router[_0xb568('0x5c')](_0xb568('0x2f'),auth[_0xb568('0x9')](),controller[_0xb568('0x6b')]);router[_0xb568('0x5c')](_0xb568('0x31'),auth[_0xb568('0x9')](),controller[_0xb568('0x6c')]);router[_0xb568('0x5c')](_0xb568('0x35'),auth[_0xb568('0x9')](),controller[_0xb568('0x6d')]);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 a27b05a..4dfcccd 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 _0xf86c=['active','passive','actpass','update,nonat','TEXT','showWebBar','wss','encryption','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','icesupport','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','true','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','util','lodash','exports','name','setDataValue','STRING','fullname','callerid','format','getDataValue','internal','email','ENUM','admin','user','agent','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','nonat','update','outgoing','yes','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]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','fingerprint','certificate'];(function(_0x5d2c13,_0x4f6eb6){var _0x2d0d52=function(_0x2c076e){while(--_0x2c076e){_0x5d2c13['push'](_0x5d2c13['shift']());}};_0x2d0d52(++_0x4f6eb6);}(_0xf86c,0x6f));var _0xcf86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf86c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcf86('0x0'));var moment=require('moment');var util=require(_0xcf86('0x1'));var _=require(_0xcf86('0x2'));module[_0xcf86('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcf86('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x24971a){this[_0xcf86('0x5')](_0xcf86('0x4'),_0x24971a);this['setDataValue']('defaultuser',_0x24971a);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xcf86('0x6')],'allowNull':![],'set':function(_0x4fd088){this[_0xcf86('0x5')](_0xcf86('0x7'),_0x4fd088);this[_0xcf86('0x5')](_0xcf86('0x8'),util[_0xcf86('0x9')]('\x22%s\x22\x20<%s>',_0x4fd088,this[_0xcf86('0xa')](_0xcf86('0xb'))));}},'alias':{'type':Sequelize[_0xcf86('0x6')]},'email':{'type':Sequelize[_0xcf86('0x6')],'allowNull':![],'unique':_0xcf86('0xc'),'validate':{'isEmail':!![]},'set':function(_0x189abf){if(_0x189abf){this[_0xcf86('0x5')](_0xcf86('0xc'),_0x189abf['toLowerCase']());}}},'role':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0xe'),_0xcf86('0xf'),_0xcf86('0x10'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xcf86('0x6')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xcf86('0x6')],'defaultValue':_0xcf86('0x11')},'internal':{'type':Sequelize[_0xcf86('0x12')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4ec35b){this['setDataValue'](_0xcf86('0xb'),_0x4ec35b);this[_0xcf86('0x5')](_0xcf86('0x13'),_0x4ec35b);this[_0xcf86('0x5')](_0xcf86('0x8'),util['format'](_0xcf86('0x14'),this['getDataValue'](_0xcf86('0x7')),_0x4ec35b));}},'salt':{'type':Sequelize[_0xcf86('0x6')]},'phone':{'type':Sequelize[_0xcf86('0x6')]},'mobile':{'type':Sequelize[_0xcf86('0x6')]},'address':{'type':Sequelize[_0xcf86('0x6')]},'zipcode':{'type':Sequelize[_0xcf86('0x6')]},'userpic':{'type':Sequelize[_0xcf86('0x6')]},'city':{'type':Sequelize[_0xcf86('0x6')]},'country':{'type':Sequelize[_0xcf86('0x6')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xcf86('0x6')],'defaultValue':_0xcf86('0x16')},'lastPauseAt':{'type':Sequelize[_0xcf86('0x17')]},'chatCapacity':{'type':Sequelize[_0xcf86('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xcf86('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xcf86('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xcf86('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xcf86('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xcf86('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xcf86('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'host':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![],'defaultValue':_0xcf86('0x18')},'ipaddr':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'port':{'type':Sequelize[_0xcf86('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xcf86('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x19'),_0xcf86('0xf'),'peer'),'allowNull':!![],'defaultValue':_0xcf86('0x19')},'context':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x1a'),_0xcf86('0x1b'),_0xcf86('0x1c'),_0xcf86('0x1d'),'PROHIB_NOT_SCREENED',_0xcf86('0x1e'),'PROHIB_FAILED_SCREEN',_0xcf86('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'secret':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xcf86('0x20'),'set':function(_0x2f5bfa){this[_0xcf86('0x5')](_0xcf86('0x21'),_0x2f5bfa?_0x2f5bfa[_0xcf86('0x22')](','):null);},'get':function(){return this[_0xcf86('0xa')](_0xcf86('0x21'))?this[_0xcf86('0xa')](_0xcf86('0x21'))['split'](','):null;},'comment':_0xcf86('0x23')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xcf86('0x24'),_0xcf86('0x25'),_0xcf86('0x26'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xcf86('0xd')]('yes','no',_0xcf86('0x27'),_0xcf86('0x28'),_0xcf86('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'nat':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![],'defaultValue':_0xcf86('0x2b'),'set':function(_0x56f445){this[_0xcf86('0x5')](_0xcf86('0x2c'),_0x56f445?_0x56f445[_0xcf86('0x22')](','):null);},'get':function(){return this[_0xcf86('0xa')](_0xcf86('0x2c'))?this['getDataValue'](_0xcf86('0x2c'))[_0xcf86('0x2d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xcf86('0x6')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xcf86('0x6')]},'namedpickupgroup':{'type':Sequelize[_0xcf86('0x6')]},'language':{'type':Sequelize[_0xcf86('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xcf86('0x6')],'allowNull':![],'defaultValue':_0xcf86('0x2e')},'allow':{'type':Sequelize[_0xcf86('0x6')],'allowNull':![],'defaultValue':_0xcf86('0x2f'),'set':function(_0x31fdc3){this[_0xcf86('0x5')]('allow',_0x31fdc3?_0x31fdc3['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xcf86('0xa')]('allow')?this['getDataValue'](_0xcf86('0x30'))[_0xcf86('0x2d')](';'):null;},'comment':_0xcf86('0x31')},'autoframing':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x186224){this[_0xcf86('0x5')](_0xcf86('0x32'),_0x186224?_0x186224[_0xcf86('0x22')](','):null);},'get':function(){return this[_0xcf86('0xa')]('insecure')?this['getDataValue'](_0xcf86('0x32'))[_0xcf86('0x2d')](','):null;},'comment':_0xcf86('0x33')},'trustrpid':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no',_0xcf86('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xcf86('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![],'defaultValue':_0xcf86('0x35')},'amaflags':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xcf86('0x2a')},'busylevel':{'type':Sequelize[_0xcf86('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xcf86('0xd')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xcf86('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xcf86('0xd')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xcf86('0x2a'),'no',_0xcf86('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xcf86('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x37'),_0xcf86('0x38'),_0xcf86('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xcf86('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xcf86('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x3a'),'uas'),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xcf86('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xcf86('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xcf86('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xcf86('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xcf86('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xcf86('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xcf86('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xcf86('0xd')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no',_0xcf86('0x3b'),_0xcf86('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x3d'),_0xcf86('0x3e'),_0xcf86('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xcf86('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xcf86('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xcf86('0xd')]('yes','no',_0xcf86('0x27'),_0xcf86('0x28'),_0xcf86('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xcf86('0x6')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0xcf86('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xcf86('0x41')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x40da11){this[_0xcf86('0x5')](_0xcf86('0x42'),_0x40da11);var _0x4ce242=this['get']({'plain':!![]});switch(_0x40da11){case 0x0:case 0x1:var _0xee9c3d=_0x4ce242[_0xcf86('0x21')]?_['isArray'](_0x4ce242[_0xcf86('0x21')])?_0x4ce242['transport'][_0xcf86('0x22')]():_0x4ce242[_0xcf86('0x21')]:'udp';if(_0xee9c3d===_0xcf86('0x43')){_0xee9c3d='udp';}this[_0xcf86('0x5')](_0xcf86('0x21'),_0xee9c3d);this['setDataValue'](_0xcf86('0x44'),'no');this[_0xcf86('0x5')]('avpf',null);this[_0xcf86('0x5')](_0xcf86('0x45'),null);this[_0xcf86('0x5')]('icesupport',null);this[_0xcf86('0x5')](_0xcf86('0x46'),null);this['setDataValue'](_0xcf86('0x47'),null);this[_0xcf86('0x5')](_0xcf86('0x48'),null);this['setDataValue'](_0xcf86('0x49'),null);this[_0xcf86('0x5')](_0xcf86('0x4a'),null);this[_0xcf86('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0xcf86('0x21'),_0xcf86('0x43'));this[_0xcf86('0x5')](_0xcf86('0x44'),_0xcf86('0x2a'));this[_0xcf86('0x5')]('avpf','yes');this['setDataValue'](_0xcf86('0x45'),_0xcf86('0x2a'));this[_0xcf86('0x5')](_0xcf86('0x4b'),'yes');this[_0xcf86('0x5')]('dtlsenable',_0xcf86('0x2a'));this[_0xcf86('0x5')](_0xcf86('0x47'),'no');this[_0xcf86('0x5')](_0xcf86('0x48'),'actpass');this['setDataValue'](_0xcf86('0x49'),_0x4ce242['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0xcf86('0x5')](_0xcf86('0x4a'),_0x4ce242[_0xcf86('0x4a')]||_0xcf86('0x4c'));this[_0xcf86('0x5')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0xcf86('0x41')],'set':function(_0x3a0115){this['setDataValue'](_0xcf86('0x4d'),_0x3a0115?_0x3a0115[_0xcf86('0x22')](','):[]);},'get':function(){return this[_0xcf86('0xa')](_0xcf86('0x4d'))?_[_0xcf86('0x4e')](this[_0xcf86('0xa')](_0xcf86('0x4d'))[_0xcf86('0x2d')](','),function(_0x352136){return parseInt(_0x352136,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xcf86('0x6')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xcf86('0x6')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xcf86('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xcf86('0x6')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xcf86('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xcf86('0xd')](_0xcf86('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xcf86('0x6')]},'phoneBarEnableJaws':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xcf86('0xa')](_0xcf86('0x4f'))?this[_0xcf86('0xa')](_0xcf86('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xcf86('0x6')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xcf86('0x6')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x11f546){if(typeof _0x11f546==='string'){var _0x5ddfef=_0x11f546==='1'?!![]:_0x11f546==='0'?![]:_0x11f546===_0xcf86('0x50')?!![]:_0x11f546==='false'?![]:![];this[_0xcf86('0x5')](_0xcf86('0x51'),_0x5ddfef);}else{this[_0xcf86('0x5')](_0xcf86('0x51'),_0x11f546);}}},'blocked':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![],'set':function(_0x5c4c92){this[_0xcf86('0x5')](_0xcf86('0x52'),_0x5c4c92);if(_0x5c4c92===!![]){this[_0xcf86('0x5')](_0xcf86('0x53'),moment());this[_0xcf86('0x5')](_0xcf86('0x54'),0x0);}else{this[_0xcf86('0x5')](_0xcf86('0x53'),null);}}},'blockedAt':{'type':Sequelize[_0xcf86('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xcf86('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xcf86('0x12')](0x5)[_0xcf86('0x55')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xcf86('0x15')],'defaultValue':![]}}; \ No newline at end of file +var _0x7cd9=['certificate','active','passive','actpass','showWebBar','isArray','wss','encryption','force_avp','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','moment','exports','STRING','name','setDataValue','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','telephone','local','INTEGER','accountcode','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','user','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','join','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<>','accept','refuse','originate','uac','uas','fingerprint'];(function(_0x94511e,_0x598dfa){var _0x198a35=function(_0xf846be){while(--_0xf846be){_0x94511e['push'](_0x94511e['shift']());}};_0x198a35(++_0x598dfa);}(_0x7cd9,0xd1));var _0x97cd=function(_0x23f795,_0x44cc18){_0x23f795=_0x23f795-0x0;var _0x14b9ad=_0x7cd9[_0x23f795];return _0x14b9ad;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x97cd('0x0'));var util=require('util');var _=require('lodash');module[_0x97cd('0x1')]={'name':{'type':Sequelize[_0x97cd('0x2')],'allowNull':![],'unique':_0x97cd('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xe08b48){this[_0x97cd('0x4')](_0x97cd('0x3'),_0xe08b48);this[_0x97cd('0x4')]('defaultuser',_0xe08b48);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x97cd('0x2')],'allowNull':![],'set':function(_0xf0e22e){this[_0x97cd('0x4')](_0x97cd('0x5'),_0xf0e22e);this[_0x97cd('0x4')](_0x97cd('0x6'),util[_0x97cd('0x7')](_0x97cd('0x8'),_0xf0e22e,this['getDataValue'](_0x97cd('0x9'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x97cd('0x2')],'allowNull':![],'unique':_0x97cd('0xa'),'validate':{'isEmail':!![]},'set':function(_0x3557d4){if(_0x3557d4){this[_0x97cd('0x4')](_0x97cd('0xa'),_0x3557d4[_0x97cd('0xb')]());}}},'role':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0xd'),'user','agent',_0x97cd('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x97cd('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x97cd('0xf')},'internal':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':![],'unique':_0x97cd('0x9'),'set':function(_0x2d1338){this['setDataValue'](_0x97cd('0x9'),_0x2d1338);this[_0x97cd('0x4')](_0x97cd('0x11'),_0x2d1338);this[_0x97cd('0x4')](_0x97cd('0x6'),util[_0x97cd('0x7')](_0x97cd('0x8'),this[_0x97cd('0x12')]('fullname'),_0x2d1338));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x97cd('0x2')]},'mobile':{'type':Sequelize[_0x97cd('0x2')]},'address':{'type':Sequelize[_0x97cd('0x2')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x97cd('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x97cd('0x2')]},'online':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x97cd('0x14')]},'voicePause':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x97cd('0x2')],'defaultValue':_0x97cd('0x15')},'lastPauseAt':{'type':Sequelize[_0x97cd('0x14')]},'chatCapacity':{'type':Sequelize[_0x97cd('0x10')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x97cd('0x10')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x97cd('0x10')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x97cd('0x10')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x97cd('0x10')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'host':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![],'defaultValue':_0x97cd('0x16')},'ipaddr':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'port':{'type':Sequelize[_0x97cd('0x10')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x97cd('0xc')]('friend',_0x97cd('0x17'),_0x97cd('0x18')),'allowNull':!![],'defaultValue':_0x97cd('0x19')},'context':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![],'defaultValue':_0x97cd('0x1a')},'callingpres':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x1b'),_0x97cd('0x1c'),_0x97cd('0x1d'),_0x97cd('0x1e'),_0x97cd('0x1f'),'PROHIB_PASSED_SCREEN',_0x97cd('0x20'),_0x97cd('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'permit':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'secret':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'transport':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![],'defaultValue':_0x97cd('0x22'),'set':function(_0x4a237e){this[_0x97cd('0x4')](_0x97cd('0x23'),_0x4a237e?_0x4a237e['join'](','):null);},'get':function(){return this[_0x97cd('0x12')](_0x97cd('0x23'))?this[_0x97cd('0x12')](_0x97cd('0x23'))[_0x97cd('0x24')](','):null;},'comment':_0x97cd('0x25')},'dtmfmode':{'type':Sequelize[_0x97cd('0xc')]('rfc2833',_0x97cd('0x26'),'shortinfo',_0x97cd('0x27'),_0x97cd('0x28')),'allowNull':!![],'defaultValue':_0x97cd('0x29')},'directmedia':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no',_0x97cd('0x2b'),_0x97cd('0x2c'),_0x97cd('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x97cd('0x2e'),'set':function(_0x36c56d){this[_0x97cd('0x4')](_0x97cd('0x2f'),_0x36c56d?_0x36c56d[_0x97cd('0x30')](','):null);},'get':function(){return this[_0x97cd('0x12')](_0x97cd('0x2f'))?this[_0x97cd('0x12')]('nat')[_0x97cd('0x24')](','):null;},'comment':_0x97cd('0x31')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x97cd('0x2')]},'pickupgroup':{'type':Sequelize[_0x97cd('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x97cd('0x2')]},'language':{'type':Sequelize[_0x97cd('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x97cd('0x2')]},'disallow':{'type':Sequelize[_0x97cd('0x2')],'allowNull':![],'defaultValue':_0x97cd('0x32')},'allow':{'type':Sequelize[_0x97cd('0x2')],'allowNull':![],'defaultValue':_0x97cd('0x33'),'set':function(_0x54cb8e){this['setDataValue']('allow',_0x54cb8e?_0x54cb8e['join'](';'):_0x97cd('0x33'));},'get':function(){return this[_0x97cd('0x12')]('allow')?this['getDataValue'](_0x97cd('0x34'))[_0x97cd('0x24')](';'):null;},'comment':_0x97cd('0x35')},'autoframing':{'type':Sequelize['ENUM'](_0x97cd('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![],'set':function(_0x525bc8){this['setDataValue'](_0x97cd('0x36'),_0x525bc8?_0x525bc8[_0x97cd('0x30')](','):null);},'get':function(){return this[_0x97cd('0x12')](_0x97cd('0x36'))?this[_0x97cd('0x12')](_0x97cd('0x36'))[_0x97cd('0x24')](','):null;},'comment':_0x97cd('0x37')},'trustrpid':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x97cd('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no',_0x97cd('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x97cd('0x39')},'amaflags':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x97cd('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'template':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM']('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x3a'),_0x97cd('0x3b'),_0x97cd('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x3d'),_0x97cd('0x3e')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x97cd('0x2a')},'keepalive':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x97cd('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x97cd('0x3f'),_0x97cd('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x41'),_0x97cd('0x42'),_0x97cd('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x97cd('0x10')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x97cd('0xc')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x97cd('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x97cd('0xc')]('yes','no',_0x97cd('0x2b'),_0x97cd('0x2c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x97cd('0x2')]},'resetPasswordExpires':{'type':Sequelize[_0x97cd('0x14')]},'passwordResetAt':{'type':Sequelize[_0x97cd('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x97cd('0x10')],'defaultValue':0x0,'set':function(_0x3fa865){this[_0x97cd('0x4')](_0x97cd('0x44'),_0x3fa865);var _0x28c2bb=this['get']({'plain':!![]});switch(_0x3fa865){case 0x0:case 0x1:var _0x4955b6=_0x28c2bb['transport']?_[_0x97cd('0x45')](_0x28c2bb['transport'])?_0x28c2bb[_0x97cd('0x23')]['join']():_0x28c2bb[_0x97cd('0x23')]:'udp';if(_0x4955b6===_0x97cd('0x46')){_0x4955b6=_0x97cd('0x22');}this['setDataValue'](_0x97cd('0x23'),_0x4955b6);this[_0x97cd('0x4')](_0x97cd('0x47'),'no');this[_0x97cd('0x4')]('avpf',null);this['setDataValue'](_0x97cd('0x48'),null);this[_0x97cd('0x4')]('icesupport',null);this[_0x97cd('0x4')](_0x97cd('0x49'),null);this[_0x97cd('0x4')]('dtlsverify',null);this[_0x97cd('0x4')](_0x97cd('0x4a'),null);this[_0x97cd('0x4')](_0x97cd('0x4b'),null);this[_0x97cd('0x4')](_0x97cd('0x4c'),null);this[_0x97cd('0x4')](_0x97cd('0x4d'),'no');break;case 0x2:this[_0x97cd('0x4')](_0x97cd('0x23'),_0x97cd('0x46'));this[_0x97cd('0x4')](_0x97cd('0x47'),_0x97cd('0x2a'));this['setDataValue'](_0x97cd('0x4e'),_0x97cd('0x2a'));this[_0x97cd('0x4')]('force_avp',_0x97cd('0x2a'));this['setDataValue']('icesupport',_0x97cd('0x2a'));this[_0x97cd('0x4')](_0x97cd('0x49'),_0x97cd('0x2a'));this[_0x97cd('0x4')]('dtlsverify','no');this[_0x97cd('0x4')](_0x97cd('0x4a'),'actpass');this[_0x97cd('0x4')](_0x97cd('0x4b'),_0x28c2bb[_0x97cd('0x4b')]||_0x97cd('0x4f'));this[_0x97cd('0x4')]('dtlsprivatekey',_0x28c2bb[_0x97cd('0x4c')]||_0x97cd('0x50'));this[_0x97cd('0x4')]('rtcp_mux',_0x97cd('0x2a'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x3aad61){this[_0x97cd('0x4')](_0x97cd('0x51'),_0x3aad61?_0x3aad61['join'](','):[]);},'get':function(){return this[_0x97cd('0x12')](_0x97cd('0x51'))?_[_0x97cd('0x52')](this[_0x97cd('0x12')](_0x97cd('0x51'))[_0x97cd('0x24')](','),function(_0x83b0e2){return parseInt(_0x83b0e2,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x97cd('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x97cd('0x2')]},'phoneBarBusyNumber':{'type':Sequelize[_0x97cd('0x2')]},'phoneBarUnconditional':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x97cd('0x10')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x97cd('0x2')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x97cd('0x10')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x97cd('0xc')](_0x97cd('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x97cd('0x2')]},'phoneBarEnableJaws':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x97cd('0x12')](_0x97cd('0x53'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x97cd('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![],'set':function(_0xac57b8){if(typeof _0xac57b8===_0x97cd('0x54')){var _0x5ed6c7=_0xac57b8==='1'?!![]:_0xac57b8==='0'?![]:_0xac57b8===_0x97cd('0x55')?!![]:_0xac57b8===_0x97cd('0x56')?![]:![];this['setDataValue'](_0x97cd('0x57'),_0x5ed6c7);}else{this['setDataValue'](_0x97cd('0x57'),_0xac57b8);}}},'blocked':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![],'set':function(_0x541713){this[_0x97cd('0x4')](_0x97cd('0x58'),_0x541713);if(_0x541713===!![]){this[_0x97cd('0x4')](_0x97cd('0x59'),moment());this[_0x97cd('0x4')](_0x97cd('0x5a'),0x0);}else{this['setDataValue'](_0x97cd('0x59'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x97cd('0x10')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x97cd('0x13')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 15a5156..a65bebd 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 _0xd8ba=['channel','online','loginInPause','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','SIP/%s','voicePause','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','addAvatar','userpic','file','filename','getAvatar','root','server/files/images/logos/default_profile.png','download','existsSync','join','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','filters','order','sort','options','getContacts','hasOwnProperty','CmList','List','Tag','Tags','tag','getQueues','Queue','pick','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','WhatsappInteraction','getWhatsappInteractions','login','mobile','interface','format','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','LOGININPAUSE','MemberReport','isMiddleware','resolve','logout','pause','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','lastPauseAt','QueuePause','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','Chat','Mail','getSmsQueues','Sms','Whatsapp','Fax','flatten','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','getWhatsappQueues','getOpenchannelQueues','removeAgent','VoicePrefixId','Queue:remove','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','CmHopper','$or','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','phone','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','VoiceQueue','inbound','lower','col','toString','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unavailable','ringing','voiceStatus','busy','slice','charAt','select','ui.','InteractionId','user_has_','_interactions','moment','util','path','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','./user.socket','register','redis','defaults','localhost','client','http','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','then','destroy','get','role','admin','user','Agents','agent','telephone','filter','ignore','value','includes','find','name','UserProfileResource','end','stack','send','index','User','rawAttributes','map','fieldName','type','key','password','getOptions','where','query','includeAll','include','userSetting','true','UserSetting','attributes','push','rows','length','chat','dataValues','sms','openchannel','whatsapp','params','model','differenceBy','salt','keys','intersection','fields','merge','openTabs','fax','mail','update','body','describe','addContacts','ids','omit','internal','Setting','findById','validatePasswordPattern','max','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','102','104','105','106','107','108','109','111','114','115','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','Telephones','autoAssociation','bulkCreate','Unauthorized','some','all','each','findAll','isEmpty','compact','changePassword','oldPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','securePassword','passwordHistoryLimit','previousPasswords','updatePasswordsHistory'];(function(_0x822956,_0x41d171){var _0x319333=function(_0x10fa79){while(--_0x10fa79){_0x822956['push'](_0x822956['shift']());}};_0x319333(++_0x41d171);}(_0xd8ba,0x100));var _0xad8b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd8ba[_0x57b54c];return _0x59cc19;};'use strict';var moment=require(_0xad8b('0x0'));var BPromise=require('bluebird');var util=require(_0xad8b('0x1'));var path=require(_0xad8b('0x2'));var fs=require('fs');var _=require(_0xad8b('0x3'));var squel=require(_0xad8b('0x4'));var jayson=require('jayson/promise');var Redis=require(_0xad8b('0x5'));var authService=require(_0xad8b('0x6'));var qs=require(_0xad8b('0x7'));var logger=require(_0xad8b('0x8'))(_0xad8b('0x9'));var utils=require(_0xad8b('0xa'));var config=require(_0xad8b('0xb'));var licenseUtil=require('../../config/license/util');var db=require(_0xad8b('0xc'))['db'];var socket=require(_0xad8b('0xd'))(new Redis(config['redis']));require(_0xad8b('0xe'))[_0xad8b('0xf')](socket);config[_0xad8b('0x10')]=_[_0xad8b('0x11')](config[_0xad8b('0x10')],{'host':_0xad8b('0x12'),'port':0x18eb});var client=jayson[_0xad8b('0x13')][_0xad8b('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2298b2,_0x1f85a7,_0x16baca,_0x3fd225){return new BPromise(function(_0x4375db,_0x54fd11){var _0x5e03a5=_0x3fd225||client;return _0x5e03a5['request'](_0x2298b2,_0x16baca)['then'](function(_0x4d740a){logger[_0xad8b('0x15')](_0xad8b('0x16'),_0x1f85a7,_0xad8b('0x17'));logger[_0xad8b('0x18')]('User,\x20%s,\x20%s,\x20%s',_0x1f85a7,_0xad8b('0x17'),JSON[_0xad8b('0x19')](_0x4d740a));if(_0x4d740a[_0xad8b('0x1a')]){if(_0x4d740a[_0xad8b('0x1a')]['code']===0x1f4){logger['error'](_0xad8b('0x16'),_0x1f85a7,_0x4d740a['error'][_0xad8b('0x1b')]);return _0x54fd11(_0x4d740a[_0xad8b('0x1a')]['message']);}logger[_0xad8b('0x1a')]('User,\x20%s,\x20%s',_0x1f85a7,_0x4d740a['error'][_0xad8b('0x1b')]);return _0x4375db(_0x4d740a[_0xad8b('0x1a')][_0xad8b('0x1b')]);}else{logger[_0xad8b('0x15')](_0xad8b('0x16'),_0x1f85a7,_0xad8b('0x17'));_0x4375db(_0x4d740a[_0xad8b('0x1c')][_0xad8b('0x1b')]);}})[_0xad8b('0x1d')](function(_0x342bcd){logger[_0xad8b('0x1a')](_0xad8b('0x16'),_0x1f85a7,_0x342bcd);_0x54fd11(_0x342bcd);});});}function respondWithStatusCode(_0x16eb99,_0x57f7b9){_0x57f7b9=_0x57f7b9||0xcc;return function(_0x4238b7){if(_0x4238b7){return _0x16eb99[_0xad8b('0x1e')](_0x57f7b9);}return _0x16eb99[_0xad8b('0x1f')](_0x57f7b9)['end']();};}function respondWithResult(_0x3f1bab,_0x33e83a){_0x33e83a=_0x33e83a||0xc8;return function(_0x1fac5f){if(_0x1fac5f){return _0x3f1bab[_0xad8b('0x1f')](_0x33e83a)['json'](_0x1fac5f);}};}function respondWithFilteredResult(_0x37c25a,_0x1dc804){return function(_0x406e41){if(_0x406e41){var _0x42b9e0=typeof _0x1dc804[_0xad8b('0x20')]===_0xad8b('0x21')&&typeof _0x1dc804[_0xad8b('0x22')]===_0xad8b('0x21');var _0x23783d=_0x406e41['count'];var _0x607df0=_0x42b9e0?0x0:_0x1dc804[_0xad8b('0x20')];var _0x5e8b99=_0x42b9e0?_0x406e41[_0xad8b('0x23')]:_0x1dc804[_0xad8b('0x20')]+_0x1dc804[_0xad8b('0x22')];var _0x22e9f5;if(_0x5e8b99>=_0x23783d){_0x5e8b99=_0x23783d;_0x22e9f5=0xc8;}else{_0x22e9f5=0xce;}_0x37c25a[_0xad8b('0x1f')](_0x22e9f5);return _0x37c25a[_0xad8b('0x24')](_0xad8b('0x25'),_0x607df0+'-'+_0x5e8b99+'/'+_0x23783d)[_0xad8b('0x26')](_0x406e41);}return null;};}function saveUpdates(_0x240918){return function(_0x219728){if(_0x219728){return _0x219728['update'](_0x240918)[_0xad8b('0x27')](function(_0x2ea6bc){return _0x2ea6bc;});}return null;};}function removeEntity(_0x493831){return function(_0x2589f2){if(_0x2589f2){return _0x2589f2[_0xad8b('0x28')]()[_0xad8b('0x27')](function(){var _0x3901c3=_0x2589f2[_0xad8b('0x29')]({'plain':!![]});if(_0x3901c3[_0xad8b('0x2a')]===_0xad8b('0x2b'))return;var _0xd43add=[{'name':'Users','value':_0xad8b('0x2c'),'ignore':!![]},{'name':_0xad8b('0x2d'),'value':_0xad8b('0x2e'),'ignore':![]},{'name':'Telephones','value':_0xad8b('0x2f'),'ignore':![]}];var _0x471304=_(_0xd43add)[_0xad8b('0x30')](_0xad8b('0x31'))['map'](_0xad8b('0x32'))[_0xad8b('0x32')]();if(_[_0xad8b('0x33')](_0x471304,_0x3901c3['role'])){return;}var _0x144641=_[_0xad8b('0x34')](_0xd43add,[_0xad8b('0x32'),_0x3901c3['role']])[_0xad8b('0x35')];return db[_0xad8b('0x36')][_0xad8b('0x28')]({'where':{'type':_0x144641,'resourceId':_0x3901c3['id']}})[_0xad8b('0x27')](function(){return _0x2589f2;});})[_0xad8b('0x27')](function(){_0x493831[_0xad8b('0x1f')](0xcc)[_0xad8b('0x37')]();});}};}function handleEntityNotFound(_0x1f428d){return function(_0x2801dc){if(!_0x2801dc){_0x1f428d[_0xad8b('0x1e')](0x194);}return _0x2801dc;};}function handleError(_0x33ea50,_0x3b8035){_0x3b8035=_0x3b8035||0x1f4;return function(_0x18629f){logger[_0xad8b('0x1a')](_0x18629f[_0xad8b('0x38')]);if(_0x18629f[_0xad8b('0x35')]){delete _0x18629f[_0xad8b('0x35')];}_0x33ea50[_0xad8b('0x1f')](_0x3b8035)[_0xad8b('0x39')](_0x18629f);};}exports[_0xad8b('0x3a')]=function(_0x498908,_0x347350){var _0x1927d2={},_0x3ea444={'count':0x0,'rows':[]};var _0x1f93f8=_(db[_0xad8b('0x3b')][_0xad8b('0x3c')])[_0xad8b('0x3d')](function(_0x18f4e1){return{'name':_0x18f4e1[_0xad8b('0x3e')],'type':_0x18f4e1[_0xad8b('0x3f')][_0xad8b('0x40')]};})['filter'](function(_0x528446){return!_[_0xad8b('0x33')]([_0xad8b('0x41'),'salt'],_0x528446['name']);})[_0xad8b('0x32')]();_0x1927d2=qs[_0xad8b('0x42')](_0x1f93f8,_0x498908);var _0x2da81f={'where':_0x1927d2[_0xad8b('0x43')]};return db[_0xad8b('0x3b')][_0xad8b('0x23')](_0x2da81f)[_0xad8b('0x27')](function(_0x210a5b){_0x3ea444[_0xad8b('0x23')]=_0x210a5b;if(_0x498908[_0xad8b('0x44')][_0xad8b('0x45')]){_0x1927d2[_0xad8b('0x46')]=[{'all':!![]}];}if(_0x498908[_0xad8b('0x44')][_0xad8b('0x47')]===_0xad8b('0x48')){_0x1927d2[_0xad8b('0x46')]=[{'model':db[_0xad8b('0x49')],'as':'userSetting'}];}if(!_[_0xad8b('0x33')](_0x1927d2[_0xad8b('0x4a')],'id')){_0x1927d2[_0xad8b('0x4a')][_0xad8b('0x4b')]('id');}return db[_0xad8b('0x3b')]['findAll'](_0x1927d2);})[_0xad8b('0x27')](function(_0x381436){_0x3ea444[_0xad8b('0x4c')]=_0x381436;if(_0x498908[_0xad8b('0x44')]['openTabs']===_0xad8b('0x48')){var _0x16e036=[];for(var _0xca05c8=0x0;_0xca05c8<_0x3ea444[_0xad8b('0x4c')][_0xad8b('0x4d')];_0xca05c8++){_0x16e036[_0xad8b('0x4b')](get_open_tabs(_0xad8b('0x4e'),_0x3ea444['rows'][_0xca05c8][_0xad8b('0x4f')]));_0x16e036[_0xad8b('0x4b')](get_open_tabs(_0xad8b('0x50'),_0x3ea444[_0xad8b('0x4c')][_0xca05c8][_0xad8b('0x4f')]));_0x16e036[_0xad8b('0x4b')](get_open_tabs('fax',_0x3ea444[_0xad8b('0x4c')][_0xca05c8][_0xad8b('0x4f')]));_0x16e036[_0xad8b('0x4b')](get_open_tabs('mail',_0x3ea444[_0xad8b('0x4c')][_0xca05c8][_0xad8b('0x4f')]));_0x16e036[_0xad8b('0x4b')](get_open_tabs(_0xad8b('0x51'),_0x3ea444['rows'][_0xca05c8][_0xad8b('0x4f')]));_0x16e036['push'](get_open_tabs(_0xad8b('0x52'),_0x3ea444['rows'][_0xca05c8][_0xad8b('0x4f')]));}return BPromise['all'](_0x16e036)[_0xad8b('0x27')](function(){return _0x3ea444;});}else{return _0x3ea444;}})[_0xad8b('0x27')](respondWithFilteredResult(_0x347350,_0x1927d2))[_0xad8b('0x1d')](handleError(_0x347350,null));};exports['show']=function(_0x394e98,_0x32217a){var _0x227e3c={'raw':![],'where':{'id':_0x394e98[_0xad8b('0x53')]['id']}},_0x52f7e6={};_0x52f7e6[_0xad8b('0x54')]=_[_0xad8b('0x55')](_['keys'](db[_0xad8b('0x3b')][_0xad8b('0x3c')]),[_0xad8b('0x41'),_0xad8b('0x56')]);_0x52f7e6[_0xad8b('0x44')]=_[_0xad8b('0x57')](_0x394e98['query']);_0x52f7e6['filters']=_['intersection'](_0x52f7e6[_0xad8b('0x54')],_0x52f7e6[_0xad8b('0x44')]);_0x227e3c['attributes']=_[_0xad8b('0x58')](_0x52f7e6['model'],qs[_0xad8b('0x59')](_0x394e98[_0xad8b('0x44')]['fields']));_0x227e3c[_0xad8b('0x4a')]=_0x227e3c[_0xad8b('0x4a')][_0xad8b('0x4d')]?_0x227e3c[_0xad8b('0x4a')]:_0x52f7e6['model'];if(_0x394e98[_0xad8b('0x44')]['includeAll']){_0x227e3c[_0xad8b('0x46')]=[{'all':!![]}];}if(_0x394e98[_0xad8b('0x44')][_0xad8b('0x47')]===_0xad8b('0x48')){_0x227e3c[_0xad8b('0x46')]=[{'model':db[_0xad8b('0x49')],'as':_0xad8b('0x47')}];}_0x227e3c=_[_0xad8b('0x5a')]({},_0x227e3c,_0x394e98['options']);if(!_[_0xad8b('0x33')](_0x227e3c[_0xad8b('0x4a')],'id')){_0x227e3c['attributes'][_0xad8b('0x4b')]('id');}return db[_0xad8b('0x3b')][_0xad8b('0x34')](_0x227e3c)[_0xad8b('0x27')](handleEntityNotFound(_0x32217a,null))[_0xad8b('0x27')](function(_0x4c8048){var _0x1d9a11=[];values=_0x4c8048;if(_0x394e98['query'][_0xad8b('0x5b')]===_0xad8b('0x48')){_0x1d9a11[_0xad8b('0x4b')](get_open_tabs(_0xad8b('0x4e'),_0x4c8048['dataValues']));_0x1d9a11[_0xad8b('0x4b')](get_open_tabs(_0xad8b('0x50'),_0x4c8048[_0xad8b('0x4f')]));_0x1d9a11['push'](get_open_tabs('openchannel',_0x4c8048[_0xad8b('0x4f')]));_0x1d9a11[_0xad8b('0x4b')](get_open_tabs(_0xad8b('0x52'),_0x4c8048[_0xad8b('0x4f')]));_0x1d9a11[_0xad8b('0x4b')](get_open_tabs(_0xad8b('0x5c'),_0x4c8048[_0xad8b('0x4f')]));_0x1d9a11[_0xad8b('0x4b')](get_open_tabs(_0xad8b('0x5d'),_0x4c8048[_0xad8b('0x4f')]));return BPromise['all'](_0x1d9a11);}else{return values;}})[_0xad8b('0x27')](function(){return values;})[_0xad8b('0x27')](respondWithResult(_0x32217a,null))[_0xad8b('0x1d')](handleError(_0x32217a,null));};exports[_0xad8b('0x5e')]=function(_0x1ad7fc,_0x7a0e46){if(_0x1ad7fc[_0xad8b('0x5f')]['id']){delete _0x1ad7fc[_0xad8b('0x5f')]['id'];}delete _0x1ad7fc['body'][_0xad8b('0x2a')];return db[_0xad8b('0x3b')][_0xad8b('0x34')]({'where':{'id':_0x1ad7fc['params']['id']}})['then'](handleEntityNotFound(_0x7a0e46,null))[_0xad8b('0x27')](saveUpdates(_0x1ad7fc[_0xad8b('0x5f')],null))[_0xad8b('0x27')](respondWithResult(_0x7a0e46,null))['catch'](handleError(_0x7a0e46,null));};exports[_0xad8b('0x60')]=function(_0x49f99a,_0x59d001){return db['User'][_0xad8b('0x60')]()[_0xad8b('0x27')](respondWithResult(_0x59d001,null))['catch'](handleError(_0x59d001,null));};exports[_0xad8b('0x61')]=function(_0x3b9a84,_0x1e5f5f){return db['User'][_0xad8b('0x34')]({'where':{'id':_0x3b9a84[_0xad8b('0x53')]['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x1e5f5f,null))['then'](function(_0x5282a6){if(_0x5282a6){return _0x5282a6['addContacts'](_0x3b9a84[_0xad8b('0x5f')][_0xad8b('0x62')],_[_0xad8b('0x63')](_0x3b9a84[_0xad8b('0x5f')],[_0xad8b('0x62'),'id'])||{});}})[_0xad8b('0x27')](respondWithResult(_0x1e5f5f,null))[_0xad8b('0x1d')](handleError(_0x1e5f5f,null));};function validateUser(_0x579f73){return new BPromise(function(_0x531687,_0x39f977){if(_0x579f73[_0xad8b('0x64')])return _0x531687(_0x579f73);return db[_0xad8b('0x65')][_0xad8b('0x66')](0x1)[_0xad8b('0x27')](function(_0x2b6f81){if(_0x2b6f81['securePassword'])authService[_0xad8b('0x67')](_0x579f73[_0xad8b('0x41')]);db[_0xad8b('0x3b')][_0xad8b('0x68')]('internal')[_0xad8b('0x27')](function(_0x32caf2){if(_[_0xad8b('0x69')](_0x32caf2)){_0x579f73['internal']=_0x2b6f81[_0xad8b('0x6a')]||0x1;return;}if(_[_0xad8b('0x69')](_0x2b6f81[_0xad8b('0x6a')])||_0x2b6f81[_0xad8b('0x6a')]===_0x32caf2){_0x579f73[_0xad8b('0x64')]=_0x32caf2+0x1;return;}if(_0x2b6f81[_0xad8b('0x6a')]>_0x32caf2){_0x579f73[_0xad8b('0x64')]=_0x2b6f81[_0xad8b('0x6a')];return;}return db[_0xad8b('0x6b')]['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db['sequelize'][_0xad8b('0x6c')][_0xad8b('0x6d')]})[_0xad8b('0x27')](function(_0x22cb84){if(_0x22cb84&&_0x22cb84[_0xad8b('0x4d')]){for(var _0x2fc00e=0x0,_0x158d20=_0x22cb84[_0xad8b('0x4d')];_0x2fc00e<_0x158d20&&_[_0xad8b('0x69')](_0x579f73[_0xad8b('0x64')]);_0x2fc00e++){if(_0x2b6f81[_0xad8b('0x6a')]<=_0x22cb84[_0x2fc00e][_0xad8b('0x6e')]){_0x579f73[_0xad8b('0x64')]=_0x22cb84[_0x2fc00e]['from'];}else if(_0x2b6f81[_0xad8b('0x6a')]>_0x22cb84[_0x2fc00e][_0xad8b('0x6e')]&&_0x2b6f81['min_internal']<=_0x22cb84[_0x2fc00e]['to']){_0x579f73[_0xad8b('0x64')]=_0x2b6f81[_0xad8b('0x6a')];}}}if(_[_0xad8b('0x69')](_0x579f73[_0xad8b('0x64')])){_0x579f73['internal']=_0x32caf2+0x1;}return _0x531687(_0x579f73);});});})[_0xad8b('0x1d')](function(_0x179989){_0x39f977(_0x179989);});});}function updateUser(_0x540021){return new BPromise(function(_0x1ec3f6,_0x3250f9){try{if(_0x540021[_0xad8b('0x6f')]){_0x540021[_0xad8b('0x70')]=_0x540021[_0xad8b('0x64')];_0x540021[_0xad8b('0x71')]={'mailbox':_0x540021[_0xad8b('0x64')],'password':_0x540021['password'],'fullname':_0x540021[_0xad8b('0x72')],'email':_0x540021[_0xad8b('0x73')]};}if(_0x540021[_0xad8b('0x2a')]==='agent'){if(!_0x540021[_0xad8b('0x74')])_0x540021[_0xad8b('0x74')]=['101',_0xad8b('0x75'),'103','113','110',_0xad8b('0x76'),_0xad8b('0x77'),_0xad8b('0x78'),_0xad8b('0x79'),_0xad8b('0x7a'),_0xad8b('0x7b'),'100',_0xad8b('0x7c'),_0xad8b('0x7d'),_0xad8b('0x7e')];}_0x1ec3f6(_0x540021);}catch(_0x29a462){_0x3250f9(_0x29a462);}});}exports[_0xad8b('0x7f')]=function(_0x671596,_0x2e472a){if(_0x671596[_0xad8b('0x2c')][_0xad8b('0x2a')]===_0xad8b('0x2e'))throw new Error('Unauthorized');if(_0x671596['body']['role']===_0xad8b('0x2c')&&_0x671596[_0xad8b('0x2c')][_0xad8b('0x2a')]!==_0xad8b('0x2b')){throw new Error(_0xad8b('0x80'));}if(_0x671596['body']['role']===_0xad8b('0x2b')&&_0x671596[_0xad8b('0x2c')][_0xad8b('0x2a')]!==_0xad8b('0x2b')){throw new Error(_0xad8b('0x81'));}return licenseUtil[_0xad8b('0x82')]([_0x671596['body']])[_0xad8b('0x27')](function(){return validateUser(_0x671596[_0xad8b('0x5f')]);})[_0xad8b('0x27')](function(_0x426f92){return updateUser(_0x426f92)[_0xad8b('0x27')](function(_0x45d4c5){if(_0x45d4c5[_0xad8b('0x2a')]===_0xad8b('0x2b')){_0x45d4c5[_0xad8b('0x83')]=_0x671596[_0xad8b('0x2c')]['settingsEnabled'];delete _0x45d4c5[_0xad8b('0x84')];}return _0x45d4c5;});})[_0xad8b('0x27')](function(_0x34c211){return db[_0xad8b('0x3b')][_0xad8b('0x7f')](_0x34c211,{'include':[{'model':db[_0xad8b('0x71')],'as':_0xad8b('0x71')}]});})[_0xad8b('0x27')](function(_0x200f64){if(_0x671596['body'][_0xad8b('0x2a')]===_0xad8b('0x2c'))return _0x200f64;if(_0x671596[_0xad8b('0x2c')]['role']!==_0xad8b('0x2c'))return _0x200f64;return db['UserProfileSection']['find']({'where':{'name':_0x200f64['role']===_0xad8b('0x2e')?_0xad8b('0x2d'):_0xad8b('0x85'),'userProfileId':_0x671596['user'][_0xad8b('0x84')]},'raw':!![]})[_0xad8b('0x27')](function(_0x38d914){if(!_0x38d914||_0x38d914[_0xad8b('0x86')]!=0x0)return _0x200f64;return db[_0xad8b('0x36')][_0xad8b('0x7f')]({'name':_0x200f64[_0xad8b('0x35')],'resourceId':_0x200f64['id'],'type':_0x38d914[_0xad8b('0x35')],'sectionId':_0x38d914['id']},{})[_0xad8b('0x27')](function(){return _0x200f64;});})['catch'](function(_0x617b39){logger[_0xad8b('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x617b39);throw _0x617b39;});})[_0xad8b('0x27')](respondWithResult(_0x2e472a,0xc9))[_0xad8b('0x1d')](handleError(_0x2e472a,null));};exports[_0xad8b('0x87')]=function(_0x2fc0b2,_0x3a30f2){var _0x27d0d5=_0x2fc0b2[_0xad8b('0x5f')];var _0x45805b=[];if(_0x2fc0b2[_0xad8b('0x2c')][_0xad8b('0x2a')]===_0xad8b('0x2e'))throw new Error(_0xad8b('0x88'));if(_[_0xad8b('0x89')](_0x27d0d5,[_0xad8b('0x2a'),_0xad8b('0x2c')])&&_0x2fc0b2[_0xad8b('0x2c')][_0xad8b('0x2a')]!==_0xad8b('0x2b')){throw new Error(_0xad8b('0x80'));}if(_[_0xad8b('0x89')](_0x27d0d5,[_0xad8b('0x2a'),_0xad8b('0x2b')])&&_0x2fc0b2['user'][_0xad8b('0x2a')]!==_0xad8b('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xad8b('0x82')](_0x27d0d5)[_0xad8b('0x27')](function(){return validateUser(_0x27d0d5[0x0]);})[_0xad8b('0x27')](function(){for(var _0x34cb27=0x1;_0x34cb27<_0x27d0d5[_0xad8b('0x4d')];_0x34cb27++){var _0x51f4a1=_0x27d0d5[_0x34cb27-0x1][_0xad8b('0x64')];if(!_0x27d0d5[_0x34cb27][_0xad8b('0x64')])_0x27d0d5[_0x34cb27][_0xad8b('0x64')]=_0x51f4a1+0x1;_0x45805b[_0xad8b('0x4b')](validateUser(_0x27d0d5[_0x34cb27]));}return BPromise[_0xad8b('0x8a')](_0x45805b);})[_0xad8b('0x27')](function(){_0x45805b=[];for(var _0x4ce2d8=0x0;_0x4ce2d8<_0x27d0d5[_0xad8b('0x4d')];_0x4ce2d8++){_0x45805b[_0xad8b('0x4b')](updateUser(_0x27d0d5[_0x4ce2d8]));}return BPromise[_0xad8b('0x8a')](_0x45805b);})['then'](function(){return BPromise[_0xad8b('0x8b')](_0x27d0d5,function(_0x549ea7){return db[_0xad8b('0x3b')]['create'](_0x549ea7,{'include':[{'model':db[_0xad8b('0x71')],'as':_0xad8b('0x71')}]})[_0xad8b('0x27')](function(_0x210f6e){_0x549ea7['id']=_0x210f6e['id'];return _0x549ea7;});});})['then'](function(_0x1dde7e){if(_0x2fc0b2[_0xad8b('0x5f')][_0xad8b('0x2a')]===_0xad8b('0x2c'))return _0x1dde7e;if(_0x2fc0b2['user'][_0xad8b('0x2a')]!==_0xad8b('0x2c'))return _0x1dde7e;var _0x31342a=_[_0xad8b('0x89')](_0x1dde7e,function(_0x52775d){return _0x52775d[_0xad8b('0x2a')]==='agent'||_0x52775d[_0xad8b('0x2a')]===_0xad8b('0x2f');});if(!_0x31342a)return _0x1dde7e;return db['UserProfileSection'][_0xad8b('0x8c')]({'where':{'name':{'$or':[_0xad8b('0x2d'),_0xad8b('0x85')]},'userProfileId':_0x2fc0b2['user'][_0xad8b('0x84')]},'raw':!![]})[_0xad8b('0x27')](function(_0xa009e8){if(_[_0xad8b('0x8d')](_0xa009e8)||!_[_0xad8b('0x89')](_0xa009e8,['autoAssociation',0x0]))return _0x1dde7e;_0x45805b=[];var _0x327273=_(_0xa009e8)[_0xad8b('0x3d')](function(_0xadcc48){if(_0xadcc48[_0xad8b('0x86')]===0x1)return;return _0xadcc48['name']===_0xad8b('0x2d')?_0xad8b('0x2e'):_0xad8b('0x2f');})[_0xad8b('0x8e')]()[_0xad8b('0x32')]();for(var _0xe734f1=0x0;_0xe734f1<_0x1dde7e['length'];_0xe734f1++){if(!_[_0xad8b('0x33')](_0x327273,_0x1dde7e[_0xe734f1][_0xad8b('0x2a')]))return;var _0x13d2c7=_0x1dde7e[_0xe734f1][_0xad8b('0x2a')]===_0xad8b('0x2e')?_0xad8b('0x2d'):_0xad8b('0x85');_0x45805b[_0xad8b('0x4b')](db[_0xad8b('0x36')][_0xad8b('0x7f')]({'name':_0x1dde7e[_0xe734f1][_0xad8b('0x35')],'resourceId':_0x1dde7e[_0xe734f1]['id'],'type':_0x13d2c7,'sectionId':_[_0xad8b('0x34')](_0xa009e8,[_0xad8b('0x35'),_0x13d2c7])['id']},{}));}return BPromise['all'](_0x45805b);});})[_0xad8b('0x27')](respondWithResult(_0x3a30f2,0xc9))[_0xad8b('0x1d')](handleError(_0x3a30f2,null));};exports[_0xad8b('0x8f')]=function(_0xdf65ce,_0x3eb3ba){if(_0xdf65ce[_0xad8b('0x5f')]['id']){delete _0xdf65ce[_0xad8b('0x5f')]['id'];}return db[_0xad8b('0x3b')]['find']({'where':{'id':_0xdf65ce[_0xad8b('0x53')]['id']}})[_0xad8b('0x27')](function(_0x395c06){if(!_0x395c06)return null;if(_0x395c06['id']===_0xdf65ce[_0xad8b('0x2c')]['id']){if(!_0xdf65ce[_0xad8b('0x5f')][_0xad8b('0x90')]||!_0xdf65ce[_0xad8b('0x5f')]['newPassword']){throw new db['Sequelize'][(_0xad8b('0x91'))](_0xad8b('0x92'));}if(!_0x395c06[_0xad8b('0x93')](_0xdf65ce[_0xad8b('0x5f')][_0xad8b('0x90')])){throw new db[(_0xad8b('0x94'))][(_0xad8b('0x91'))](_0xad8b('0x95'));}if(_0xdf65ce[_0xad8b('0x5f')]['oldPassword']===_0xdf65ce[_0xad8b('0x5f')][_0xad8b('0x96')]){throw new db[(_0xad8b('0x94'))]['ValidationError'](_0xad8b('0x97'));}}else if(_0xdf65ce[_0xad8b('0x2c')][_0xad8b('0x2a')]===_0xad8b('0x2b')){if(!_0xdf65ce[_0xad8b('0x5f')][_0xad8b('0x96')]){throw new db['Sequelize'][(_0xad8b('0x91'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0xdf65ce[_0xad8b('0x2c')][_0xad8b('0x2a')]===_0xad8b('0x2c')){if(!_0xdf65ce['body'][_0xad8b('0x96')]){throw new db['Sequelize'][(_0xad8b('0x91'))](_0xad8b('0x98'));}if(_0x395c06[_0xad8b('0x2a')]!==_0xad8b('0x2e')){throw new db[(_0xad8b('0x94'))][(_0xad8b('0x91'))]('Unauthorized');}}else{throw new db[(_0xad8b('0x94'))][(_0xad8b('0x91'))](_0xad8b('0x88'));}return _0x395c06;})[_0xad8b('0x27')](handleEntityNotFound(_0x3eb3ba,null))[_0xad8b('0x27')](function(_0x423b3a){return db[_0xad8b('0x65')][_0xad8b('0x99')]({'attributes':['id',_0xad8b('0x9a'),'enforcePasswordHistory',_0xad8b('0x9b')]})[_0xad8b('0x27')](function(_0x1adebb){if(_0x1adebb[_0xad8b('0x9a')])authService[_0xad8b('0x67')](_0xdf65ce[_0xad8b('0x5f')]['newPassword']);if(!_0x1adebb['enforcePasswordHistory']||!_0x423b3a[_0xad8b('0x9c')])return _0x423b3a;authService['validatePasswordHistory'](_0xdf65ce[_0xad8b('0x5f')][_0xad8b('0x96')],_0x423b3a[_0xad8b('0x9c')],_0x1adebb[_0xad8b('0x9b')]);return _0x423b3a;})[_0xad8b('0x27')](saveUpdates({'password':_0xdf65ce[_0xad8b('0x5f')][_0xad8b('0x96')],'passwordResetAt':_0xdf65ce['user']['id']==_0xdf65ce['params']['id']?moment():null,'previousPasswords':authService[_0xad8b('0x9d')](_0xdf65ce[_0xad8b('0x5f')][_0xad8b('0x96')],_0x423b3a['previousPasswords'])},null));})[_0xad8b('0x27')](respondWithResult(_0x3eb3ba,null))[_0xad8b('0x1d')](handleError(_0x3eb3ba,null));};exports['addQueues']=function(_0x59e59a,_0x5ac7c7){var _0x93ae65=_0x59e59a[_0xad8b('0x5f')][_0xad8b('0x9e')];return db[_0xad8b('0x3b')][_0xad8b('0x34')]({'where':{'id':_0x59e59a['params']['id']},'attributes':['id',_0xad8b('0x35'),'role',_0xad8b('0x9f'),_0xad8b('0xa0'),'voicePause','interface']})[_0xad8b('0x27')](handleEntityNotFound(_0x5ac7c7,null))[_0xad8b('0x27')](function(_0x53940e){if(_0x53940e){if(!utils[_0xad8b('0xa1')](_0x93ae65)){throw new db[(_0xad8b('0x94'))][(_0xad8b('0x91'))](_0xad8b('0xa2'));}return _0x53940e[_0xad8b('0xa3')+_[_0xad8b('0xa4')](_0x93ae65[_0xad8b('0xa5')]())+_0xad8b('0xa6')](_0x59e59a[_0xad8b('0x5f')][_0xad8b('0x62')],{'penalty':_0x59e59a['body'][_0xad8b('0xa7')]||0x0})[_0xad8b('0xa8')](function(_0x4d0185){for(var _0x3e6065=0x0;_0x3e6065<_0x59e59a[_0xad8b('0x5f')]['ids'][_0xad8b('0x4d')];_0x3e6065+=0x1){var _0x14df4d={'UserId':Number(_0x59e59a['params']['id'])};_0x14df4d[_[_0xad8b('0xa4')](_0x93ae65[_0xad8b('0xa5')]())+_0xad8b('0xa9')]=Number(_0x59e59a[_0xad8b('0x5f')][_0xad8b('0x62')][_0x3e6065]);socket[_0xad8b('0xaa')](_0xad8b('0x2c')+_[_0xad8b('0xa4')](_0x93ae65['toLowerCase']())+_0xad8b('0xab'),_0x14df4d);}return _0x4d0185;})[_0xad8b('0x27')](function(){if(_0x93ae65==='voice'){return db['VoiceQueue'][_0xad8b('0x8c')]({'where':{'id':_0x59e59a[_0xad8b('0x5f')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x2cf508){var _0xef60ee=_0x53940e['get']({'plain':!![]});var _0xae8658=[];if(_0x93ae65===_0xad8b('0xac')&&_0xef60ee[_0xad8b('0x2a')]==='agent'&&_0xef60ee[_0xad8b('0x9f')]){for(var _0x2051f9=0x0;_0x2051f9<_0x2cf508[_0xad8b('0x4d')];_0x2051f9+=0x1){_0xae8658[_0xad8b('0x4b')]({'membername':_0xef60ee[_0xad8b('0x35')],'UserId':_0xef60ee['id'],'queue_name':_0x2cf508[_0x2051f9]['name'],'VoiceQueueId':_0x2cf508[_0x2051f9]['id'],'interface':_[_0xad8b('0x69')](_0xef60ee['interface'])?util['format'](_0xad8b('0xad'),_0xef60ee[_0xad8b('0x35')]):_0xef60ee['interface'],'paused':_0xef60ee[_0xad8b('0xae')]||![],'penalty':_0x59e59a[_0xad8b('0x5f')][_0xad8b('0xa7')]||0x0});}return BPromise[_0xad8b('0x8b')](_0xae8658,function(_0x553b9e){return db[_0xad8b('0xaf')][_0xad8b('0xb0')](_0x553b9e);});}return _0x53940e;});}})[_0xad8b('0x27')](respondWithStatusCode(_0x5ac7c7,null))[_0xad8b('0x1d')](handleError(_0x5ac7c7,null));};exports[_0xad8b('0xb1')]=function(_0x3c738a,_0x187118){var _0x459769,_0x59c870;return db[_0xad8b('0x3b')]['find']({'where':{'id':_0x3c738a['params']['id']},'attributes':['id',_0xad8b('0x35'),'role']})['then'](handleEntityNotFound(_0x187118,null))[_0xad8b('0x27')](function(_0x216431){if(_0x216431){_0x459769=_0x216431;if(!_0x3c738a[_0xad8b('0x44')]['channel']||!utils[_0xad8b('0xa1')](_0x3c738a['query'][_0xad8b('0x9e')])){throw new db[(_0xad8b('0x94'))]['ValidationError'](_0xad8b('0xa2'));}return _0x216431[_0xad8b('0xb2')+_[_0xad8b('0xa4')](_0x3c738a[_0xad8b('0x44')][_0xad8b('0x9e')][_0xad8b('0xa5')]())+_0xad8b('0xa6')](_0x3c738a[_0xad8b('0x44')][_0xad8b('0x62')]);}})['then'](function(_0x2d3e35){if(_[_0xad8b('0xb3')](_0x3c738a[_0xad8b('0x44')][_0xad8b('0x62')])){for(var _0x474f8e=0x0;_0x474f8e<_0x3c738a['query']['ids'][_0xad8b('0x4d')];_0x474f8e+=0x1){_0x59c870={'UserId':Number(_0x3c738a[_0xad8b('0x53')]['id'])};_0x59c870[_[_0xad8b('0xa4')](_0x3c738a['query']['channel'][_0xad8b('0xa5')]())+'QueueId']=Number(_0x3c738a[_0xad8b('0x44')][_0xad8b('0x62')][_0x474f8e]);socket[_0xad8b('0xaa')](_0xad8b('0x2c')+_[_0xad8b('0xa4')](_0x3c738a['query']['channel']['toLowerCase']())+'Queue:remove',_0x59c870);}}else{_0x59c870={'UserId':Number(_0x3c738a[_0xad8b('0x53')]['id'])};_0x59c870[_['capitalize'](_0x3c738a[_0xad8b('0x44')]['channel']['toLowerCase']())+_0xad8b('0xa9')]=Number(_0x3c738a[_0xad8b('0x44')][_0xad8b('0x62')]);socket['emit']('user'+_[_0xad8b('0xa4')](_0x3c738a[_0xad8b('0x44')][_0xad8b('0x9e')][_0xad8b('0xa5')]())+'Queue:remove',_0x59c870);}return _0x2d3e35;})[_0xad8b('0x27')](function(){if(_0x3c738a[_0xad8b('0x44')][_0xad8b('0x9e')]==='voice'){return db['UserVoiceQueueRt'][_0xad8b('0x28')]({'where':{'UserId':_0x3c738a[_0xad8b('0x53')]['id'],'VoiceQueueId':_0x3c738a[_0xad8b('0x44')][_0xad8b('0x62')]},'individualHooks':!![]})['then'](function(){return _0x459769;});}return _0x459769;})[_0xad8b('0x27')](respondWithStatusCode(_0x187118,null))[_0xad8b('0x1d')](handleError(_0x187118,null));};exports[_0xad8b('0xb4')]=function(_0x2c05e7,_0x1a9d6d){_0x2c05e7[_0xad8b('0x5f')][_0xad8b('0xb5')]=_0x2c05e7[_0xad8b('0xb6')][_0xad8b('0xb7')];return db[_0xad8b('0x3b')][_0xad8b('0x34')]({'where':{'id':_0x2c05e7[_0xad8b('0x53')]['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x1a9d6d,null))['then'](saveUpdates(_0x2c05e7[_0xad8b('0x5f')],null))['then'](respondWithResult(_0x1a9d6d,null))[_0xad8b('0x1d')](handleError(_0x1a9d6d,null));};exports[_0xad8b('0xb8')]=function(_0x36af7c,_0x2924e0){var _0x4e82cf=path['join'](config[_0xad8b('0xb9')],_0xad8b('0xba'));return db[_0xad8b('0x3b')][_0xad8b('0x34')]({'where':{'id':_0x36af7c['params']['id']},'attributes':['id',_0xad8b('0xb5')],'raw':!![]})[_0xad8b('0x27')](handleEntityNotFound(_0x2924e0,null))[_0xad8b('0x27')](function(_0x441cf){if(_0x441cf){if(_[_0xad8b('0x69')](_0x441cf[_0xad8b('0xb5')])){return _0x2924e0[_0xad8b('0xbb')](_0x4e82cf);}else{if(!fs[_0xad8b('0xbc')](path[_0xad8b('0xbd')](config[_0xad8b('0xb9')],_0xad8b('0xbe'),_0x441cf[_0xad8b('0xb5')]))){return _0x2924e0[_0xad8b('0xbb')](_0x4e82cf);}return _0x2924e0[_0xad8b('0xbb')](path['join'](config[_0xad8b('0xb9')],_0xad8b('0xbe'),_0x441cf['userpic']));}}})[_0xad8b('0x1d')](handleError(_0x2924e0,null));};exports[_0xad8b('0xbf')]=function(_0x53a1b5,_0x3701f3){return db[_0xad8b('0x3b')][_0xad8b('0x34')]({'where':{'id':_0x53a1b5[_0xad8b('0x53')]['id']},'attributes':['id']})[_0xad8b('0x27')](handleEntityNotFound(_0x3701f3,null))[_0xad8b('0x27')](function(_0x215839){var _0x135923=[];values=_0x215839[_0xad8b('0x4f')];_0x135923[_0xad8b('0x4b')](get_open_tabs(_0xad8b('0x4e'),_0x215839['dataValues']));_0x135923['push'](get_open_tabs(_0xad8b('0x50'),_0x215839['dataValues']));_0x135923[_0xad8b('0x4b')](get_open_tabs(_0xad8b('0x51'),_0x215839['dataValues']));_0x135923[_0xad8b('0x4b')](get_open_tabs(_0xad8b('0x52'),_0x215839['dataValues']));_0x135923['push'](get_open_tabs(_0xad8b('0x5c'),_0x215839[_0xad8b('0x4f')]));_0x135923['push'](get_open_tabs(_0xad8b('0x5d'),_0x215839[_0xad8b('0x4f')]));return BPromise[_0xad8b('0x8a')](_0x135923);})[_0xad8b('0x27')](function(_0x1e1406){if(_0x1e1406){var _0x52aa95=_[_0xad8b('0x3d')](values[_0xad8b('0xc0')],function(_0x44f508){return{'channel':_0xad8b('0xc1'),'id':_0x44f508['id'],'createdAt':_0x44f508['createdAt']};});var _0x39e981=_[_0xad8b('0x3d')](values[_0xad8b('0xc2')],function(_0x208f19){return{'channel':'FAX','id':_0x208f19['id'],'createdAt':_0x208f19[_0xad8b('0xc3')]};});var _0x249f41=_[_0xad8b('0x3d')](values[_0xad8b('0xc4')],function(_0x4986ad){return{'channel':_0xad8b('0xc5'),'id':_0x4986ad['id'],'createdAt':_0x4986ad[_0xad8b('0xc3')]};});var _0x417569=_[_0xad8b('0x3d')](values[_0xad8b('0xc6')],function(_0x5a5c87){return{'channel':'MAIL','id':_0x5a5c87['id'],'createdAt':_0x5a5c87['createdAt']};});var _0x4bbace=_['map'](values[_0xad8b('0xc7')],function(_0x2c1d13){return{'channel':_0xad8b('0xc8'),'id':_0x2c1d13['id'],'createdAt':_0x2c1d13['createdAt']};});var _0x32916c=_['map'](values[_0xad8b('0xc9')],function(_0x5d199a){return{'channel':_0xad8b('0xca'),'id':_0x5d199a['id'],'createdAt':_0x5d199a[_0xad8b('0xc3')]};});var _0x167cea=_[_0xad8b('0xcb')](_0x52aa95,_0x39e981,_0x249f41,_0x417569,_0x4bbace,_0x32916c);var _0x216a54={'count':_0x167cea[_0xad8b('0x4d')],'rows':_0x167cea};return _0x216a54;}else return null;})[_0xad8b('0x27')](respondWithResult(_0x3701f3,null))['catch'](handleError(_0x3701f3,null));};exports['getContacts']=function(_0x58d654,_0x536450){var _0x38d2bb={};var _0x1b0a6f={};var _0x2ab013;var _0x1ae0e1;return db[_0xad8b('0x3b')][_0xad8b('0x99')]({'where':{'id':_0x58d654[_0xad8b('0x53')]['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x536450,null))[_0xad8b('0x27')](function(_0x459593){if(_0x459593){_0x2ab013=_0x459593;_0x1b0a6f['model']=_[_0xad8b('0x57')](db['CmContact'][_0xad8b('0x3c')]);_0x1b0a6f['query']=_['keys'](_0x58d654[_0xad8b('0x44')]);_0x1b0a6f[_0xad8b('0xcc')]=_[_0xad8b('0x58')](_0x1b0a6f[_0xad8b('0x54')],_0x1b0a6f[_0xad8b('0x44')]);_0x38d2bb['attributes']=_[_0xad8b('0x58')](_0x1b0a6f[_0xad8b('0x54')],qs['fields'](_0x58d654['query'][_0xad8b('0x59')]));_0x38d2bb['attributes']=_0x38d2bb['attributes'][_0xad8b('0x4d')]?_0x38d2bb['attributes']:_0x1b0a6f[_0xad8b('0x54')];_0x38d2bb[_0xad8b('0xcd')]=qs[_0xad8b('0xce')](_0x58d654['query']['sort']);_0x38d2bb[_0xad8b('0x43')]=qs[_0xad8b('0xcc')](_['pick'](_0x58d654[_0xad8b('0x44')],_0x1b0a6f['filters']));if(_0x58d654[_0xad8b('0x44')]['filter']){_0x38d2bb['where']=_['merge'](_0x38d2bb['where'],{'$or':_[_0xad8b('0x3d')](_0x38d2bb[_0xad8b('0x4a')],function(_0x23b774){var _0x4d1941={};_0x4d1941[_0x23b774]={'$like':'%'+_0x58d654[_0xad8b('0x44')][_0xad8b('0x30')]+'%'};return _0x4d1941;})});}_0x38d2bb=_[_0xad8b('0x5a')]({},_0x38d2bb,_0x58d654[_0xad8b('0xcf')]);return _0x2ab013[_0xad8b('0xd0')](_0x38d2bb);}})[_0xad8b('0x27')](function(_0x544d63){if(_0x544d63){_0x1ae0e1=_0x544d63[_0xad8b('0x4d')];if(_0x58d654[_0xad8b('0x44')][_0xad8b('0xd1')](_0xad8b('0x45'))){_0x38d2bb[_0xad8b('0x46')]=[{'model':db[_0xad8b('0xd2')],'as':_0xad8b('0xd3'),'required':![]},{'model':db[_0xad8b('0xd4')],'as':_0xad8b('0xd5'),'attributes':['id',_0xad8b('0x35'),'color'],'where':_0x58d654['query'][_0xad8b('0xd6')]?{'id':_0x58d654[_0xad8b('0x44')]['tag']}:undefined,'required':_0x58d654[_0xad8b('0x44')][_0xad8b('0xd6')]?!![]:![]}];}if(!_0x58d654['query'][_0xad8b('0xd1')]('nolimit')){_0x38d2bb[_0xad8b('0x22')]=qs[_0xad8b('0x22')](_0x58d654[_0xad8b('0x44')][_0xad8b('0x22')]);_0x38d2bb[_0xad8b('0x20')]=qs[_0xad8b('0x20')](_0x58d654['query']['offset']);}return _0x2ab013[_0xad8b('0xd0')](_0x38d2bb);}})[_0xad8b('0x27')](function(_0x5abb38){if(_0x5abb38){return _0x5abb38?{'count':_0x1ae0e1,'rows':_0x5abb38}:null;}})[_0xad8b('0x27')](respondWithResult(_0x536450,null))[_0xad8b('0x1d')](handleError(_0x536450,null));};exports[_0xad8b('0xd7')]=function(_0x2f1069,_0x1429bc){var _0x23335d;var _0x505c76={};var _0x43abdf;return db[_0xad8b('0x3b')]['findOne']({'where':{'id':_0x2f1069['params']['id']},'attributes':['id',_0xad8b('0x35'),'role']})[_0xad8b('0x27')](handleEntityNotFound(_0x1429bc,null))['then'](function(_0x15a8b9){if(!utils[_0xad8b('0xa1')](_0x2f1069['query']['channel'])){throw new db[(_0xad8b('0x94'))][(_0xad8b('0x91'))](_0xad8b('0xa2'));}_0x23335d=_0x15a8b9;var _0x59dc47={};_0x59dc47[_0xad8b('0x54')]=_[_0xad8b('0x57')](db[_['capitalize'](_0x2f1069[_0xad8b('0x44')]['channel'])+_0xad8b('0xd8')][_0xad8b('0x3c')]);_0x59dc47[_0xad8b('0x44')]=_[_0xad8b('0x57')](_0x2f1069[_0xad8b('0x44')]);_0x59dc47[_0xad8b('0xcc')]=_[_0xad8b('0x58')](_0x59dc47['model'],_0x59dc47['query']);_0x505c76[_0xad8b('0x4a')]=_['intersection'](_0x59dc47[_0xad8b('0x54')],qs[_0xad8b('0x59')](_0x2f1069[_0xad8b('0x44')][_0xad8b('0x59')]));_0x505c76['attributes']=_0x505c76['attributes'][_0xad8b('0x4d')]?_0x505c76[_0xad8b('0x4a')]:_0x59dc47[_0xad8b('0x54')];_0x505c76[_0xad8b('0xcd')]=qs[_0xad8b('0xce')](_0x2f1069['query'][_0xad8b('0xce')]);_0x505c76['where']=qs[_0xad8b('0xcc')](_[_0xad8b('0xd9')](_0x2f1069[_0xad8b('0x44')],_0x59dc47[_0xad8b('0xcc')]));if(_0x2f1069['query']['filter']){_0x505c76[_0xad8b('0x43')]=_[_0xad8b('0x5a')](_0x505c76[_0xad8b('0x43')],{'$or':_[_0xad8b('0x3d')](_0x505c76['attributes'],function(_0x2d952d){var _0xb2e72b={};_0xb2e72b[_0x2d952d]={'$like':'%'+_0x2f1069[_0xad8b('0x44')][_0xad8b('0x30')]+'%'};return _0xb2e72b;})});}_0x505c76=_['merge']({},_0x505c76,_0x2f1069[_0xad8b('0xcf')]);switch(_0x23335d[_0xad8b('0x2a')]){case _0xad8b('0x2b'):return db[_[_0xad8b('0xa4')](_0x2f1069[_0xad8b('0x44')][_0xad8b('0x9e')])+_0xad8b('0xd8')][_0xad8b('0x8c')](_0x505c76);case _0xad8b('0x2c'):case _0xad8b('0x2e'):return _0x23335d['get'+_['capitalize'](_0x2f1069[_0xad8b('0x44')][_0xad8b('0x9e')])+_0xad8b('0xa6')](_0x505c76);default:throw new db[(_0xad8b('0x94'))]['ValidationError'](_0xad8b('0xda'));}})[_0xad8b('0x27')](function(_0x5946f2){_0x43abdf=_0x5946f2[_0xad8b('0x4d')];if(!_0x2f1069[_0xad8b('0x44')][_0xad8b('0xd1')](_0xad8b('0xdb'))){_0x505c76[_0xad8b('0x22')]=qs['limit'](_0x2f1069['query'][_0xad8b('0x22')]);_0x505c76[_0xad8b('0x20')]=qs[_0xad8b('0x20')](_0x2f1069['query']['offset']);}switch(_0x23335d[_0xad8b('0x2a')]){case _0xad8b('0x2b'):return db[_[_0xad8b('0xa4')](_0x2f1069[_0xad8b('0x44')][_0xad8b('0x9e')])+_0xad8b('0xd8')]['findAll'](_0x505c76);case'user':case _0xad8b('0x2e'):return _0x23335d[_0xad8b('0x29')+_[_0xad8b('0xa4')](_0x2f1069[_0xad8b('0x44')]['channel'])+_0xad8b('0xa6')](_0x505c76);}})['then'](function(_0xcee5a2){return{'count':_0x43abdf,'rows':_0xcee5a2};})[_0xad8b('0x27')](respondWithResult(_0x1429bc,null))[_0xad8b('0x1d')](handleError(_0x1429bc,null));};exports[_0xad8b('0xdc')]=function(_0x3777b1,_0x422c92){var _0x5578b5={};var _0x326df0={};var _0x4720af;var _0x520b14;return db[_0xad8b('0x3b')][_0xad8b('0x99')]({'where':{'id':_0x3777b1[_0xad8b('0x53')]['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x422c92,null))[_0xad8b('0x27')](function(_0x421820){if(_0x421820){_0x4720af=_0x421820;_0x326df0[_0xad8b('0x54')]=_['keys'](db[_0xad8b('0xaf')][_0xad8b('0x3c')]);_0x326df0[_0xad8b('0x44')]=_[_0xad8b('0x57')](_0x3777b1[_0xad8b('0x44')]);_0x326df0[_0xad8b('0xcc')]=_[_0xad8b('0x58')](_0x326df0[_0xad8b('0x54')],_0x326df0[_0xad8b('0x44')]);_0x5578b5[_0xad8b('0x4a')]=_[_0xad8b('0x58')](_0x326df0['model'],qs['fields'](_0x3777b1[_0xad8b('0x44')][_0xad8b('0x59')]));_0x5578b5[_0xad8b('0x4a')]=_0x5578b5[_0xad8b('0x4a')][_0xad8b('0x4d')]?_0x5578b5[_0xad8b('0x4a')]:_0x326df0[_0xad8b('0x54')];_0x5578b5[_0xad8b('0xcd')]=qs[_0xad8b('0xce')](_0x3777b1[_0xad8b('0x44')][_0xad8b('0xce')]);_0x5578b5[_0xad8b('0x43')]=qs[_0xad8b('0xcc')](_[_0xad8b('0xd9')](_0x3777b1['query'],_0x326df0[_0xad8b('0xcc')]));if(_0x3777b1['query'][_0xad8b('0x30')]){_0x5578b5['where']=_[_0xad8b('0x5a')](_0x5578b5[_0xad8b('0x43')],{'$or':_['map'](_0x5578b5[_0xad8b('0x4a')],function(_0x158b34){var _0xc2d3e5={};_0xc2d3e5[_0x158b34]={'$like':'%'+_0x3777b1['query'][_0xad8b('0x30')]+'%'};return _0xc2d3e5;})});}_0x5578b5=_[_0xad8b('0x5a')]({},_0x5578b5,_0x3777b1[_0xad8b('0xcf')]);return _0x4720af[_0xad8b('0xdc')](_0x5578b5);}})[_0xad8b('0x27')](function(_0x515a5e){if(_0x515a5e){_0x520b14=_0x515a5e[_0xad8b('0x4d')];if(!_0x3777b1['query'][_0xad8b('0xd1')]('nolimit')){_0x5578b5['limit']=qs['limit'](_0x3777b1[_0xad8b('0x44')]['limit']);_0x5578b5[_0xad8b('0x20')]=qs[_0xad8b('0x20')](_0x3777b1[_0xad8b('0x44')][_0xad8b('0x20')]);}return _0x4720af[_0xad8b('0xdc')](_0x5578b5);}})[_0xad8b('0x27')](function(_0x5d7097){if(_0x5d7097){return _0x5d7097?{'count':_0x520b14,'rows':_0x5d7097}:null;}})['then'](respondWithResult(_0x422c92,null))['catch'](handleError(_0x422c92,null));};exports[_0xad8b('0xdd')]=function(_0x1c88ce,_0x30c5b2){var _0x2b9b68={};var _0xd6db38={};var _0x50b741;var _0x1d1ba7;return db['User'][_0xad8b('0x99')]({'where':{'id':_0x1c88ce['params']['id']}})['then'](handleEntityNotFound(_0x30c5b2,null))[_0xad8b('0x27')](function(_0x599efb){if(_0x599efb){_0x50b741=_0x599efb;_0xd6db38[_0xad8b('0x54')]=_[_0xad8b('0x57')](db[_0xad8b('0xde')][_0xad8b('0x3c')]);_0xd6db38[_0xad8b('0x44')]=_[_0xad8b('0x57')](_0x1c88ce[_0xad8b('0x44')]);_0xd6db38[_0xad8b('0xcc')]=_[_0xad8b('0x58')](_0xd6db38[_0xad8b('0x54')],_0xd6db38[_0xad8b('0x44')]);_0x2b9b68['attributes']=_[_0xad8b('0x58')](_0xd6db38[_0xad8b('0x54')],qs[_0xad8b('0x59')](_0x1c88ce['query'][_0xad8b('0x59')]));_0x2b9b68[_0xad8b('0x4a')]=_0x2b9b68[_0xad8b('0x4a')]['length']?_0x2b9b68[_0xad8b('0x4a')]:_0xd6db38[_0xad8b('0x54')];_0x2b9b68[_0xad8b('0xcd')]=qs[_0xad8b('0xce')](_0x1c88ce[_0xad8b('0x44')][_0xad8b('0xce')]);_0x2b9b68[_0xad8b('0x43')]=qs[_0xad8b('0xcc')](_[_0xad8b('0xd9')](_0x1c88ce[_0xad8b('0x44')],_0xd6db38[_0xad8b('0xcc')]));if(_0x1c88ce[_0xad8b('0x44')]['filter']){_0x2b9b68['where']=_[_0xad8b('0x5a')](_0x2b9b68[_0xad8b('0x43')],{'$or':_['map'](_0x2b9b68[_0xad8b('0x4a')],function(_0x3e0412){var _0x263512={};_0x263512[_0x3e0412]={'$like':'%'+_0x1c88ce[_0xad8b('0x44')]['filter']+'%'};return _0x263512;})});}_0x2b9b68=_[_0xad8b('0x5a')]({},_0x2b9b68,_0x1c88ce[_0xad8b('0xcf')]);return _0x50b741[_0xad8b('0xdd')](_0x2b9b68);}})[_0xad8b('0x27')](function(_0xfb27f3){if(_0xfb27f3){_0x1d1ba7=_0xfb27f3[_0xad8b('0x4d')];if(!_0x1c88ce['query'][_0xad8b('0xd1')](_0xad8b('0xdb'))){_0x2b9b68[_0xad8b('0x22')]=qs[_0xad8b('0x22')](_0x1c88ce[_0xad8b('0x44')][_0xad8b('0x22')]);_0x2b9b68[_0xad8b('0x20')]=qs[_0xad8b('0x20')](_0x1c88ce[_0xad8b('0x44')]['offset']);}return _0x50b741[_0xad8b('0xdd')](_0x2b9b68);}})['then'](function(_0x43e239){if(_0x43e239){return _0x43e239?{'count':_0x1d1ba7,'rows':_0x43e239}:null;}})[_0xad8b('0x27')](respondWithResult(_0x30c5b2,null))['catch'](handleError(_0x30c5b2,null));};exports[_0xad8b('0xdf')]=function(_0x2ecbc8,_0x5cfd44){var _0x1f6bcb={'raw':!![],'where':{}};var _0x123660={};var _0x572fa4={'count':0x0,'rows':[]};return db[_0xad8b('0x3b')][_0xad8b('0x99')]({'where':{'id':_0x2ecbc8[_0xad8b('0x53')]['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x5cfd44,null))['then'](function(_0x44d14e){if(_0x44d14e){_0x123660[_0xad8b('0x54')]=_[_0xad8b('0x57')](db[_0xad8b('0xe0')][_0xad8b('0x3c')]);_0x123660['query']=_[_0xad8b('0x57')](_0x2ecbc8[_0xad8b('0x44')]);_0x123660['filters']=_['intersection'](_0x123660[_0xad8b('0x54')],_0x123660[_0xad8b('0x44')]);_0x1f6bcb[_0xad8b('0x4a')]=_[_0xad8b('0x58')](_0x123660[_0xad8b('0x54')],qs['fields'](_0x2ecbc8['query']['fields']));_0x1f6bcb[_0xad8b('0x4a')]=_0x1f6bcb[_0xad8b('0x4a')][_0xad8b('0x4d')]?_0x1f6bcb['attributes']:_0x123660['model'];if(!_0x2ecbc8[_0xad8b('0x44')][_0xad8b('0xd1')](_0xad8b('0xdb'))){_0x1f6bcb[_0xad8b('0x22')]=qs['limit'](_0x2ecbc8[_0xad8b('0x44')][_0xad8b('0x22')]);_0x1f6bcb[_0xad8b('0x20')]=qs[_0xad8b('0x20')](_0x2ecbc8[_0xad8b('0x44')][_0xad8b('0x20')]);}_0x1f6bcb[_0xad8b('0xcd')]=qs['sort'](_0x2ecbc8[_0xad8b('0x44')][_0xad8b('0xce')]);_0x1f6bcb[_0xad8b('0x43')]=qs['filters'](_[_0xad8b('0xd9')](_0x2ecbc8[_0xad8b('0x44')],_0x123660[_0xad8b('0xcc')]));_0x1f6bcb['where'][_0xad8b('0xe1')]=_0x44d14e['id'];if(_0x2ecbc8[_0xad8b('0x44')]['filter']){_0x1f6bcb['where']=_[_0xad8b('0x5a')](_0x1f6bcb['where'],{'$or':_[_0xad8b('0x3d')](_0x1f6bcb[_0xad8b('0x4a')],function(_0x49a9a3){var _0x44a247={};_0x44a247[_0x49a9a3]={'$like':'%'+_0x2ecbc8['query']['filter']+'%'};return _0x44a247;})});}_0x1f6bcb=_[_0xad8b('0x5a')]({},_0x1f6bcb,_0x2ecbc8[_0xad8b('0xcf')]);return db[_0xad8b('0xe0')][_0xad8b('0x23')]({'where':_0x1f6bcb[_0xad8b('0x43')]})['then'](function(_0x5d0e33){_0x572fa4[_0xad8b('0x23')]=_0x5d0e33;if(_0x2ecbc8[_0xad8b('0x44')][_0xad8b('0x45')]){_0x1f6bcb[_0xad8b('0x46')]=[{'all':!![]}];}return db[_0xad8b('0xe0')]['findAll'](_0x1f6bcb);})['then'](function(_0x2b88e7){_0x572fa4[_0xad8b('0x4c')]=_0x2b88e7;return _0x572fa4;});}})[_0xad8b('0x27')](respondWithFilteredResult(_0x5cfd44,_0x1f6bcb))['catch'](handleError(_0x5cfd44,null));};exports[_0xad8b('0xe2')]=function(_0x45c0f8,_0x1331b1){var _0x2ab60d={'raw':!![],'where':{}};var _0x944bff={};var _0x20ceab={'count':0x0,'rows':[]};return db[_0xad8b('0x3b')][_0xad8b('0x99')]({'where':{'id':_0x45c0f8[_0xad8b('0x53')]['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x1331b1,null))['then'](function(_0x2a4587){if(_0x2a4587){_0x944bff['model']=_['keys'](db[_0xad8b('0xe3')][_0xad8b('0x3c')]);_0x944bff[_0xad8b('0x44')]=_[_0xad8b('0x57')](_0x45c0f8[_0xad8b('0x44')]);_0x944bff[_0xad8b('0xcc')]=_['intersection'](_0x944bff[_0xad8b('0x54')],_0x944bff['query']);_0x2ab60d['attributes']=_[_0xad8b('0x58')](_0x944bff[_0xad8b('0x54')],qs[_0xad8b('0x59')](_0x45c0f8[_0xad8b('0x44')][_0xad8b('0x59')]));_0x2ab60d[_0xad8b('0x4a')]=_0x2ab60d[_0xad8b('0x4a')]['length']?_0x2ab60d['attributes']:_0x944bff[_0xad8b('0x54')];if(!_0x45c0f8[_0xad8b('0x44')][_0xad8b('0xd1')]('nolimit')){_0x2ab60d[_0xad8b('0x22')]=qs[_0xad8b('0x22')](_0x45c0f8[_0xad8b('0x44')][_0xad8b('0x22')]);_0x2ab60d['offset']=qs[_0xad8b('0x20')](_0x45c0f8[_0xad8b('0x44')][_0xad8b('0x20')]);}_0x2ab60d[_0xad8b('0xcd')]=qs[_0xad8b('0xce')](_0x45c0f8['query'][_0xad8b('0xce')]);_0x2ab60d['where']=qs[_0xad8b('0xcc')](_[_0xad8b('0xd9')](_0x45c0f8[_0xad8b('0x44')],_0x944bff[_0xad8b('0xcc')]));_0x2ab60d[_0xad8b('0x43')][_0xad8b('0xe1')]=_0x2a4587['id'];if(_0x45c0f8[_0xad8b('0x44')][_0xad8b('0x30')]){_0x2ab60d[_0xad8b('0x43')]=_[_0xad8b('0x5a')](_0x2ab60d['where'],{'$or':_[_0xad8b('0x3d')](_0x2ab60d[_0xad8b('0x4a')],function(_0x1ccced){var _0x399d18={};_0x399d18[_0x1ccced]={'$like':'%'+_0x45c0f8[_0xad8b('0x44')][_0xad8b('0x30')]+'%'};return _0x399d18;})});}_0x2ab60d=_[_0xad8b('0x5a')]({},_0x2ab60d,_0x45c0f8[_0xad8b('0xcf')]);return db[_0xad8b('0xe3')][_0xad8b('0x23')]({'where':_0x2ab60d['where']})['then'](function(_0x2aaf6a){_0x20ceab['count']=_0x2aaf6a;if(_0x45c0f8[_0xad8b('0x44')]['includeAll']){_0x2ab60d[_0xad8b('0x46')]=[{'all':!![]}];}return db['ScreenRecording'][_0xad8b('0x8c')](_0x2ab60d);})[_0xad8b('0x27')](function(_0x362fbf){_0x20ceab[_0xad8b('0x4c')]=_0x362fbf;return _0x20ceab;});}})[_0xad8b('0x27')](respondWithFilteredResult(_0x1331b1,_0x2ab60d))[_0xad8b('0x1d')](handleError(_0x1331b1,null));};exports['getChatInteractions']=function(_0x34a29b,_0x35b668){var _0xe1d836={};var _0x36f4d={};var _0x5fc09c;var _0x5efa5f;return db[_0xad8b('0x3b')][_0xad8b('0x99')]({'where':{'id':_0x34a29b[_0xad8b('0x53')]['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x35b668,null))[_0xad8b('0x27')](function(_0x534b84){if(_0x534b84){_0x5fc09c=_0x534b84;_0x36f4d[_0xad8b('0x54')]=_[_0xad8b('0x57')](db['ChatInteraction']['rawAttributes']);_0x36f4d[_0xad8b('0x44')]=_['keys'](_0x34a29b['query']);_0x36f4d[_0xad8b('0xcc')]=_[_0xad8b('0x58')](_0x36f4d['model'],_0x36f4d[_0xad8b('0x44')]);_0xe1d836[_0xad8b('0x4a')]=_[_0xad8b('0x58')](_0x36f4d[_0xad8b('0x54')],qs[_0xad8b('0x59')](_0x34a29b['query'][_0xad8b('0x59')]));_0xe1d836[_0xad8b('0x4a')]=_0xe1d836[_0xad8b('0x4a')][_0xad8b('0x4d')]?_0xe1d836[_0xad8b('0x4a')]:_0x36f4d[_0xad8b('0x54')];_0xe1d836['order']=qs[_0xad8b('0xce')](_0x34a29b[_0xad8b('0x44')][_0xad8b('0xce')]);_0xe1d836[_0xad8b('0x43')]=qs[_0xad8b('0xcc')](_[_0xad8b('0xd9')](_0x34a29b[_0xad8b('0x44')],_0x36f4d[_0xad8b('0xcc')]));if(_0x34a29b['query']['filter']){_0xe1d836['where']=_[_0xad8b('0x5a')](_0xe1d836[_0xad8b('0x43')],{'$or':_[_0xad8b('0x3d')](_0xe1d836[_0xad8b('0x4a')],function(_0x1f08e0){var _0x3e0163={};_0x3e0163[_0x1f08e0]={'$like':'%'+_0x34a29b[_0xad8b('0x44')]['filter']+'%'};return _0x3e0163;})});}_0xe1d836=_['merge']({},_0xe1d836,_0x34a29b[_0xad8b('0xcf')]);return _0x5fc09c[_0xad8b('0xe4')](_0xe1d836);}})[_0xad8b('0x27')](function(_0x276dbb){if(_0x276dbb){_0x5efa5f=_0x276dbb[_0xad8b('0x4d')];if(!_0x34a29b[_0xad8b('0x44')][_0xad8b('0xd1')]('nolimit')){_0xe1d836[_0xad8b('0x22')]=qs['limit'](_0x34a29b[_0xad8b('0x44')][_0xad8b('0x22')]);_0xe1d836[_0xad8b('0x20')]=qs[_0xad8b('0x20')](_0x34a29b[_0xad8b('0x44')][_0xad8b('0x20')]);}return _0x5fc09c[_0xad8b('0xe4')](_0xe1d836);}})[_0xad8b('0x27')](function(_0x4cf758){if(_0x4cf758){return _0x4cf758?{'count':_0x5efa5f,'rows':_0x4cf758}:null;}})['then'](respondWithResult(_0x35b668,null))[_0xad8b('0x1d')](handleError(_0x35b668,null));};exports[_0xad8b('0xe5')]=function(_0x347248,_0x1cb2af){var _0xa62ec4={};var _0x4a58a2={};var _0x1b820a;var _0xe53180;return db['User']['findOne']({'where':{'id':_0x347248[_0xad8b('0x53')]['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x1cb2af,null))['then'](function(_0x29103b){if(_0x29103b){_0x1b820a=_0x29103b;_0x4a58a2['model']=_[_0xad8b('0x57')](db['OpenchannelInteraction'][_0xad8b('0x3c')]);_0x4a58a2[_0xad8b('0x44')]=_[_0xad8b('0x57')](_0x347248['query']);_0x4a58a2[_0xad8b('0xcc')]=_['intersection'](_0x4a58a2[_0xad8b('0x54')],_0x4a58a2[_0xad8b('0x44')]);_0xa62ec4[_0xad8b('0x4a')]=_['intersection'](_0x4a58a2['model'],qs['fields'](_0x347248[_0xad8b('0x44')]['fields']));_0xa62ec4[_0xad8b('0x4a')]=_0xa62ec4[_0xad8b('0x4a')][_0xad8b('0x4d')]?_0xa62ec4[_0xad8b('0x4a')]:_0x4a58a2['model'];_0xa62ec4[_0xad8b('0xcd')]=qs[_0xad8b('0xce')](_0x347248[_0xad8b('0x44')]['sort']);_0xa62ec4['where']=qs['filters'](_[_0xad8b('0xd9')](_0x347248[_0xad8b('0x44')],_0x4a58a2[_0xad8b('0xcc')]));if(_0x347248[_0xad8b('0x44')]['filter']){_0xa62ec4[_0xad8b('0x43')]=_[_0xad8b('0x5a')](_0xa62ec4['where'],{'$or':_[_0xad8b('0x3d')](_0xa62ec4[_0xad8b('0x4a')],function(_0x3e6da5){var _0xd35e69={};_0xd35e69[_0x3e6da5]={'$like':'%'+_0x347248[_0xad8b('0x44')]['filter']+'%'};return _0xd35e69;})});}_0xa62ec4=_[_0xad8b('0x5a')]({},_0xa62ec4,_0x347248[_0xad8b('0xcf')]);return _0x1b820a[_0xad8b('0xe5')](_0xa62ec4);}})['then'](function(_0x4b956e){if(_0x4b956e){_0xe53180=_0x4b956e[_0xad8b('0x4d')];if(!_0x347248[_0xad8b('0x44')][_0xad8b('0xd1')](_0xad8b('0xdb'))){_0xa62ec4['limit']=qs['limit'](_0x347248['query']['limit']);_0xa62ec4[_0xad8b('0x20')]=qs[_0xad8b('0x20')](_0x347248[_0xad8b('0x44')][_0xad8b('0x20')]);}return _0x1b820a[_0xad8b('0xe5')](_0xa62ec4);}})[_0xad8b('0x27')](function(_0x54d840){if(_0x54d840){return _0x54d840?{'count':_0xe53180,'rows':_0x54d840}:null;}})['then'](respondWithResult(_0x1cb2af,null))['catch'](handleError(_0x1cb2af,null));};exports[_0xad8b('0xe6')]=function(_0x136c51,_0x4ac254){var _0xd9838={'raw':!![],'where':{}};var _0x8853d0={};var _0x1814ac={'count':0x0,'rows':[]};return db[_0xad8b('0x3b')]['findOne']({'where':{'id':_0x136c51[_0xad8b('0x53')]['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x4ac254,null))[_0xad8b('0x27')](function(_0x5da62f){if(_0x5da62f){_0x8853d0[_0xad8b('0x54')]=_[_0xad8b('0x57')](db[_0xad8b('0xe7')]['rawAttributes']);_0x8853d0[_0xad8b('0x44')]=_[_0xad8b('0x57')](_0x136c51[_0xad8b('0x44')]);_0x8853d0[_0xad8b('0xcc')]=_[_0xad8b('0x58')](_0x8853d0[_0xad8b('0x54')],_0x8853d0[_0xad8b('0x44')]);_0xd9838[_0xad8b('0x4a')]=_[_0xad8b('0x58')](_0x8853d0[_0xad8b('0x54')],qs[_0xad8b('0x59')](_0x136c51[_0xad8b('0x44')][_0xad8b('0x59')]));_0xd9838[_0xad8b('0x4a')]=_0xd9838['attributes']['length']?_0xd9838[_0xad8b('0x4a')]:_0x8853d0[_0xad8b('0x54')];if(!_0x136c51[_0xad8b('0x44')][_0xad8b('0xd1')]('nolimit')){_0xd9838[_0xad8b('0x22')]=qs[_0xad8b('0x22')](_0x136c51[_0xad8b('0x44')][_0xad8b('0x22')]);_0xd9838[_0xad8b('0x20')]=qs[_0xad8b('0x20')](_0x136c51[_0xad8b('0x44')][_0xad8b('0x20')]);}_0xd9838[_0xad8b('0xcd')]=qs[_0xad8b('0xce')](_0x136c51[_0xad8b('0x44')]['sort']);_0xd9838[_0xad8b('0x43')]=qs[_0xad8b('0xcc')](_[_0xad8b('0xd9')](_0x136c51[_0xad8b('0x44')],_0x8853d0[_0xad8b('0xcc')]));_0xd9838['where'][_0xad8b('0xe1')]=_0x5da62f['id'];if(_0x136c51[_0xad8b('0x44')][_0xad8b('0x30')]){_0xd9838['where']=_[_0xad8b('0x5a')](_0xd9838[_0xad8b('0x43')],{'$or':_[_0xad8b('0x3d')](_0xd9838[_0xad8b('0x4a')],function(_0x3828f4){var _0x13a572={};_0x13a572[_0x3828f4]={'$like':'%'+_0x136c51[_0xad8b('0x44')][_0xad8b('0x30')]+'%'};return _0x13a572;})});}_0xd9838=_['merge']({},_0xd9838,_0x136c51[_0xad8b('0xcf')]);return db['MailInteraction'][_0xad8b('0x23')]({'where':_0xd9838[_0xad8b('0x43')]})[_0xad8b('0x27')](function(_0x502353){_0x1814ac[_0xad8b('0x23')]=_0x502353;if(_0x136c51[_0xad8b('0x44')][_0xad8b('0x45')]){_0xd9838[_0xad8b('0x46')]=[{'all':!![]}];}return db['MailInteraction'][_0xad8b('0x8c')](_0xd9838);})[_0xad8b('0x27')](function(_0x31c399){_0x1814ac[_0xad8b('0x4c')]=_0x31c399;return _0x1814ac;});}})[_0xad8b('0x27')](respondWithFilteredResult(_0x4ac254,_0xd9838))[_0xad8b('0x1d')](handleError(_0x4ac254,null));};exports[_0xad8b('0xe8')]=function(_0x32ded9,_0x152ade){var _0x4d1e17={};var _0x13274c={};var _0x1bb0f2;var _0x185a25;return db[_0xad8b('0x3b')][_0xad8b('0x99')]({'where':{'id':_0x32ded9['params']['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x152ade,null))[_0xad8b('0x27')](function(_0x4119dc){if(_0x4119dc){_0x1bb0f2=_0x4119dc;_0x13274c[_0xad8b('0x54')]=_[_0xad8b('0x57')](db[_0xad8b('0xe9')]['rawAttributes']);_0x13274c[_0xad8b('0x44')]=_[_0xad8b('0x57')](_0x32ded9[_0xad8b('0x44')]);_0x13274c[_0xad8b('0xcc')]=_['intersection'](_0x13274c[_0xad8b('0x54')],_0x13274c[_0xad8b('0x44')]);_0x4d1e17[_0xad8b('0x4a')]=_[_0xad8b('0x58')](_0x13274c['model'],qs['fields'](_0x32ded9[_0xad8b('0x44')]['fields']));_0x4d1e17['attributes']=_0x4d1e17[_0xad8b('0x4a')][_0xad8b('0x4d')]?_0x4d1e17['attributes']:_0x13274c[_0xad8b('0x54')];_0x4d1e17[_0xad8b('0xcd')]=qs[_0xad8b('0xce')](_0x32ded9[_0xad8b('0x44')][_0xad8b('0xce')]);_0x4d1e17['where']=qs['filters'](_[_0xad8b('0xd9')](_0x32ded9[_0xad8b('0x44')],_0x13274c['filters']));if(_0x32ded9[_0xad8b('0x44')]['filter']){_0x4d1e17[_0xad8b('0x43')]=_['merge'](_0x4d1e17[_0xad8b('0x43')],{'$or':_[_0xad8b('0x3d')](_0x4d1e17[_0xad8b('0x4a')],function(_0x28b471){var _0x75b8ca={};_0x75b8ca[_0x28b471]={'$like':'%'+_0x32ded9['query'][_0xad8b('0x30')]+'%'};return _0x75b8ca;})});}_0x4d1e17=_[_0xad8b('0x5a')]({},_0x4d1e17,_0x32ded9[_0xad8b('0xcf')]);return _0x1bb0f2[_0xad8b('0xe8')](_0x4d1e17);}})[_0xad8b('0x27')](function(_0x4bcb35){if(_0x4bcb35){_0x185a25=_0x4bcb35[_0xad8b('0x4d')];if(!_0x32ded9[_0xad8b('0x44')]['hasOwnProperty'](_0xad8b('0xdb'))){_0x4d1e17[_0xad8b('0x22')]=qs['limit'](_0x32ded9[_0xad8b('0x44')][_0xad8b('0x22')]);_0x4d1e17['offset']=qs['offset'](_0x32ded9[_0xad8b('0x44')][_0xad8b('0x20')]);}return _0x1bb0f2[_0xad8b('0xe8')](_0x4d1e17);}})[_0xad8b('0x27')](function(_0x4f2915){if(_0x4f2915){return _0x4f2915?{'count':_0x185a25,'rows':_0x4f2915}:null;}})[_0xad8b('0x27')](respondWithResult(_0x152ade,null))[_0xad8b('0x1d')](handleError(_0x152ade,null));};exports[_0xad8b('0xea')]=function(_0x2e6a57,_0x565434){var _0x48cffb={};var _0x159e80={};var _0x389b54;var _0x6f2d2b;return db[_0xad8b('0x3b')][_0xad8b('0x99')]({'where':{'id':_0x2e6a57['params']['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x565434,null))[_0xad8b('0x27')](function(_0x4fbce0){if(_0x4fbce0){_0x389b54=_0x4fbce0;_0x159e80[_0xad8b('0x54')]=_['keys'](db[_0xad8b('0xeb')][_0xad8b('0x3c')]);_0x159e80[_0xad8b('0x44')]=_[_0xad8b('0x57')](_0x2e6a57['query']);_0x159e80['filters']=_['intersection'](_0x159e80[_0xad8b('0x54')],_0x159e80[_0xad8b('0x44')]);_0x48cffb['attributes']=_[_0xad8b('0x58')](_0x159e80['model'],qs[_0xad8b('0x59')](_0x2e6a57['query'][_0xad8b('0x59')]));_0x48cffb['attributes']=_0x48cffb['attributes'][_0xad8b('0x4d')]?_0x48cffb['attributes']:_0x159e80[_0xad8b('0x54')];_0x48cffb[_0xad8b('0xcd')]=qs['sort'](_0x2e6a57[_0xad8b('0x44')][_0xad8b('0xce')]);_0x48cffb[_0xad8b('0x43')]=qs[_0xad8b('0xcc')](_['pick'](_0x2e6a57[_0xad8b('0x44')],_0x159e80['filters']));if(_0x2e6a57[_0xad8b('0x44')][_0xad8b('0x30')]){_0x48cffb['where']=_['merge'](_0x48cffb[_0xad8b('0x43')],{'$or':_[_0xad8b('0x3d')](_0x48cffb['attributes'],function(_0x367d8c){var _0xcc85bd={};_0xcc85bd[_0x367d8c]={'$like':'%'+_0x2e6a57[_0xad8b('0x44')][_0xad8b('0x30')]+'%'};return _0xcc85bd;})});}_0x48cffb=_[_0xad8b('0x5a')]({},_0x48cffb,_0x2e6a57[_0xad8b('0xcf')]);return _0x389b54['getFaxInteractions'](_0x48cffb);}})['then'](function(_0x31753c){if(_0x31753c){_0x6f2d2b=_0x31753c['length'];if(!_0x2e6a57[_0xad8b('0x44')][_0xad8b('0xd1')](_0xad8b('0xdb'))){_0x48cffb[_0xad8b('0x22')]=qs[_0xad8b('0x22')](_0x2e6a57['query'][_0xad8b('0x22')]);_0x48cffb[_0xad8b('0x20')]=qs[_0xad8b('0x20')](_0x2e6a57[_0xad8b('0x44')]['offset']);}return _0x389b54[_0xad8b('0xea')](_0x48cffb);}})[_0xad8b('0x27')](function(_0x48b1d8){if(_0x48b1d8){return _0x48b1d8?{'count':_0x6f2d2b,'rows':_0x48b1d8}:null;}})[_0xad8b('0x27')](respondWithResult(_0x565434,null))['catch'](handleError(_0x565434,null));};exports['getWhatsappInteractions']=function(_0x324293,_0x58ea1b){var _0x3d8f6b={};var _0x55a0c8={};var _0xb47bfd;var _0x1ca6c9;return db[_0xad8b('0x3b')][_0xad8b('0x99')]({'where':{'id':_0x324293[_0xad8b('0x53')]['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x58ea1b,null))[_0xad8b('0x27')](function(_0x2b6835){if(_0x2b6835){_0xb47bfd=_0x2b6835;_0x55a0c8[_0xad8b('0x54')]=_[_0xad8b('0x57')](db[_0xad8b('0xec')]['rawAttributes']);_0x55a0c8[_0xad8b('0x44')]=_[_0xad8b('0x57')](_0x324293[_0xad8b('0x44')]);_0x55a0c8[_0xad8b('0xcc')]=_[_0xad8b('0x58')](_0x55a0c8[_0xad8b('0x54')],_0x55a0c8[_0xad8b('0x44')]);_0x3d8f6b[_0xad8b('0x4a')]=_[_0xad8b('0x58')](_0x55a0c8[_0xad8b('0x54')],qs[_0xad8b('0x59')](_0x324293[_0xad8b('0x44')][_0xad8b('0x59')]));_0x3d8f6b[_0xad8b('0x4a')]=_0x3d8f6b[_0xad8b('0x4a')][_0xad8b('0x4d')]?_0x3d8f6b['attributes']:_0x55a0c8[_0xad8b('0x54')];_0x3d8f6b['order']=qs[_0xad8b('0xce')](_0x324293[_0xad8b('0x44')][_0xad8b('0xce')]);_0x3d8f6b[_0xad8b('0x43')]=qs['filters'](_['pick'](_0x324293[_0xad8b('0x44')],_0x55a0c8[_0xad8b('0xcc')]));if(_0x324293[_0xad8b('0x44')][_0xad8b('0x30')]){_0x3d8f6b['where']=_['merge'](_0x3d8f6b[_0xad8b('0x43')],{'$or':_['map'](_0x3d8f6b['attributes'],function(_0x3d4029){var _0x14839a={};_0x14839a[_0x3d4029]={'$like':'%'+_0x324293[_0xad8b('0x44')][_0xad8b('0x30')]+'%'};return _0x14839a;})});}_0x3d8f6b=_[_0xad8b('0x5a')]({},_0x3d8f6b,_0x324293[_0xad8b('0xcf')]);return _0xb47bfd[_0xad8b('0xed')](_0x3d8f6b);}})[_0xad8b('0x27')](function(_0x4de76f){if(_0x4de76f){_0x1ca6c9=_0x4de76f['length'];if(!_0x324293[_0xad8b('0x44')][_0xad8b('0xd1')](_0xad8b('0xdb'))){_0x3d8f6b['limit']=qs['limit'](_0x324293['query']['limit']);_0x3d8f6b[_0xad8b('0x20')]=qs['offset'](_0x324293[_0xad8b('0x44')]['offset']);}return _0xb47bfd[_0xad8b('0xed')](_0x3d8f6b);}})[_0xad8b('0x27')](function(_0x30e9cf){if(_0x30e9cf){return _0x30e9cf?{'count':_0x1ca6c9,'rows':_0x30e9cf}:null;}})[_0xad8b('0x27')](respondWithResult(_0x58ea1b,null))[_0xad8b('0x1d')](handleError(_0x58ea1b,null));};exports[_0xad8b('0xee')]=function(_0x511f35,_0x4ad5d6,_0x1340a0){var _0x535dff;var _0x2e37a4;var _0x35eaae;var _0x24e089=!_['isNil'](_0x511f35['params']['id'])?_0x511f35[_0xad8b('0x53')]['id']:!_[_0xad8b('0x69')](_0x511f35['user']['id'])?_0x511f35[_0xad8b('0x2c')]['id']:null;return db[_0xad8b('0x3b')][_0xad8b('0x34')]({'where':{'id':_0x24e089,'role':{'$or':[_0xad8b('0x2b'),_0xad8b('0x2c'),'agent']}},'attributes':['id',_0xad8b('0x35'),'phone',_0xad8b('0xef'),_0xad8b('0x2a'),'internal','loginInPause']})[_0xad8b('0x27')](function(_0x3fd82f){if(_0x3fd82f){if(_0x3fd82f[_0xad8b('0x2a')]===_0xad8b('0x2e')){_0x535dff=_0x3fd82f;if(_0x511f35['body'][_0xad8b('0xf0')]){_0x35eaae=util[_0xad8b('0xf1')](_0xad8b('0xf2'),_0x535dff[_0x511f35[_0xad8b('0x5f')][_0xad8b('0xf0')]]);}else if(_0x511f35[_0xad8b('0x5f')][_0xad8b('0xf3')]){_0x35eaae=util[_0xad8b('0xf1')](_0xad8b('0xad'),_0x511f35[_0xad8b('0x5f')]['intrf']);}else{_0x35eaae=util[_0xad8b('0xf1')](_0xad8b('0xad'),_0x535dff[_0xad8b('0x35')]);}socket['to'](util[_0xad8b('0xf1')](_0xad8b('0xf4'),_0x535dff['name']))[_0xad8b('0xaa')](_0xad8b('0xf5'),{'user':{'id':_0x535dff['id'],'name':_0x535dff[_0xad8b('0x35')]},'ip':_0x511f35[_0xad8b('0xf6')][_0xad8b('0xf7')]||_0x511f35[_0xad8b('0xf8')][_0xad8b('0xf9')]||_0x511f35[_0xad8b('0xfa')]['remoteAddress']||_0x511f35[_0xad8b('0xf8')]['socket'][_0xad8b('0xf9')]});return db['UserVoiceQueueRt'][_0xad8b('0x28')]({'where':{'membername':_0x535dff[_0xad8b('0x35')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0xad8b('0x91'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xad8b('0x27')](function(){if(_0x535dff){return _0x535dff[_0xad8b('0xfb')]({'raw':!![]});}})[_0xad8b('0x27')](function(_0x135172){if(_0x535dff){var _0x4b124c=[];if(_0x135172){_0x2e37a4=_0x135172;if(_0x2e37a4[_0xad8b('0x4d')]){for(var _0x4b775e=0x0;_0x4b775e<_0x2e37a4['length'];_0x4b775e++){_0x4b124c['push']({'membername':_0x535dff['name'],'UserId':_0x535dff['id'],'queue_name':_0x2e37a4[_0x4b775e]['name'],'VoiceQueueId':_0x2e37a4[_0x4b775e]['id'],'interface':_0x35eaae,'paused':_0x535dff[_0xad8b('0xa0')]||![],'penalty':_0x2e37a4[_0x4b775e][_0xad8b('0xfc')]||0x0});}return BPromise[_0xad8b('0x8b')](_0x4b124c,function(_0x5a0690){return db[_0xad8b('0xaf')][_0xad8b('0xb0')](_0x5a0690);});}}}})['then'](function(){if(_0x535dff){return db['MemberReport'][_0xad8b('0x8c')]({'where':{'membername':_0x535dff['name'],'exitAt':null}});}})[_0xad8b('0x27')](function(_0x4d7b05){if(_0x535dff){var _0x23d93a=[];_0x4d7b05[_0xad8b('0xfd')](function(_0x47104e){_0x23d93a[_0xad8b('0x4b')](_0x47104e[_0xad8b('0x5e')]({'exitAt':moment()[_0xad8b('0xf1')](_0xad8b('0xfe'))}));});return BPromise[_0xad8b('0x8a')](_0x23d93a);}})[_0xad8b('0x27')](function(){if(_0x535dff){var _0x396ec2=[];var _0x317cc8=[];var _0x3136b8=utils[_0xad8b('0xff')]();var _0x4a512c={'membername':_0x535dff['name'],'interface':_0x35eaae,'enterAt':moment()[_0xad8b('0xf1')](_0xad8b('0xfe')),'role':_0x535dff[_0xad8b('0x2a')],'internal':_0x535dff[_0xad8b('0x64')]};_0x3136b8['forEach'](function(_0x210ce3){_0x396ec2[_0xad8b('0x4b')](_[_0xad8b('0x5a')]({'channel':_0x210ce3,'type':_0xad8b('0x100'),'data1':_0x511f35[_0xad8b('0x5f')]['device'],'data2':_0x35eaae},_0x4a512c));if(_0x535dff['loginInPause']){_0x317cc8['push'](_[_0xad8b('0x5a')]({'channel':_0x210ce3,'type':_0xad8b('0x101'),'data1':_0xad8b('0x102')},_0x4a512c));}});return db[_0xad8b('0x103')][_0xad8b('0x87')](_0x396ec2[_0xad8b('0xcb')](_0x317cc8),{'individualHooks':!![]});}})[_0xad8b('0x27')](function(){if(_0x535dff){return _0x535dff[_0xad8b('0x5e')]({'online':!![],'lastLoginAt':moment()[_0xad8b('0xf1')](_0xad8b('0xfe')),'voicePause':_0x535dff[_0xad8b('0xa0')]||![],'mailPause':_0x535dff[_0xad8b('0xa0')]||![],'chatPause':_0x535dff[_0xad8b('0xa0')]||![],'faxPause':_0x535dff[_0xad8b('0xa0')]||![],'smsPause':_0x535dff[_0xad8b('0xa0')]||![],'openchannelPause':_0x535dff['loginInPause']||![],'whatsappPause':_0x535dff[_0xad8b('0xa0')]||![],'pauseType':_0x535dff[_0xad8b('0xa0')]?'LOGININPAUSE':null,'interface':_0x35eaae,'lastPauseAt':moment()[_0xad8b('0xf1')](_0xad8b('0xfe'))});}})['then'](function(_0x54ba82){if(_0x511f35[_0xad8b('0x104')]){return _0x1340a0();}else{return BPromise[_0xad8b('0x105')](_0x54ba82)[_0xad8b('0x27')](respondWithResult(_0x4ad5d6,null));}})['catch'](handleError(_0x4ad5d6,null));};exports[_0xad8b('0x106')]=function(_0x33a46a,_0x3fffe7){var _0x222d66;return db[_0xad8b('0x3b')][_0xad8b('0x34')]({'where':{'id':_0x33a46a['params']['id'],'role':_0xad8b('0x2e')},'attributes':['id',_0xad8b('0x35'),_0xad8b('0x2a')]})[_0xad8b('0x27')](handleEntityNotFound(_0x3fffe7,null))[_0xad8b('0x27')](function(_0x1d43ec){if(_0x1d43ec){_0x222d66=_0x1d43ec;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x222d66[_0xad8b('0x35')]},'individualHooks':!![]});}})[_0xad8b('0x27')](function(){return db['MemberReport'][_0xad8b('0x8c')]({'where':{'membername':_0x222d66[_0xad8b('0x35')],'exitAt':null}});})['then'](function(_0x2ce2d5){var _0x527b4b=[];_0x2ce2d5[_0xad8b('0xfd')](function(_0x44c0b0){_0x527b4b['push'](_0x44c0b0[_0xad8b('0x5e')]({'exitAt':moment()[_0xad8b('0xf1')](_0xad8b('0xfe'))}));});return BPromise[_0xad8b('0x8a')](_0x527b4b);})[_0xad8b('0x27')](function(){return _0x222d66[_0xad8b('0x5e')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x3fffe7,null))[_0xad8b('0x1d')](handleError(_0x3fffe7,null));};exports[_0xad8b('0x107')]=function(_0x2bce30,_0x480eb6){var _0x4eefdd;return db[_0xad8b('0xaf')][_0xad8b('0x5e')]({'paused':0x1},{'where':{'UserId':_0x2bce30[_0xad8b('0x53')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xad8b('0x3b')]['find']({'where':{'id':_0x2bce30[_0xad8b('0x53')]['id'],'role':_0xad8b('0x2e')},'attributes':['id',_0xad8b('0x35'),'role','internal',_0xad8b('0xf0')]});})[_0xad8b('0x27')](handleEntityNotFound(_0x480eb6,null))['then'](function(_0x3b8f66){if(_0x3b8f66){_0x4eefdd=_0x3b8f66;return respondWithRpcPromise('QueuePause',_0xad8b('0x107'),{'id':_0x4eefdd['id'],'name':_0x4eefdd[_0xad8b('0x35')],'pause':!![]});}})[_0xad8b('0x27')](function(){if(_0x4eefdd){return db[_0xad8b('0x103')][_0xad8b('0x8c')]({'where':{'membername':_0x4eefdd[_0xad8b('0x35')],'type':'PAUSE','exitAt':null}});}})[_0xad8b('0x27')](function(_0x471fd6){if(_0x471fd6['length']){var _0x177301=moment()[_0xad8b('0xf1')](_0xad8b('0xfe'));for(var _0x227ae4=0x0,_0x83414e=_0x471fd6[_0xad8b('0x4d')];_0x227ae4<_0x83414e;_0x227ae4++){_0x471fd6[_0x227ae4]['updateAttributes']({'exitAt':_0x177301});}}})[_0xad8b('0x27')](function(){var _0x4f6af8=[];var _0x38860a=utils[_0xad8b('0xff')]();_0x38860a['forEach'](function(_0x24a72d){_0x4f6af8['push']({'channel':_0x24a72d,'membername':_0x4eefdd[_0xad8b('0x35')],'interface':_[_0xad8b('0x69')](_0x4eefdd['interface'])?util['format'](_0xad8b('0xad'),_0x4eefdd[_0xad8b('0x35')]):_0x4eefdd[_0xad8b('0xf0')],'type':_0xad8b('0x101'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2bce30[_0xad8b('0x5f')][_0xad8b('0x3f')]||'DEFAULT\x20PAUSE','role':_0x4eefdd[_0xad8b('0x2a')],'internal':_0x4eefdd[_0xad8b('0x64')]});});return db[_0xad8b('0x103')][_0xad8b('0x87')](_0x4f6af8,{'individualHooks':!![]});})[_0xad8b('0x27')](function(){return _0x4eefdd[_0xad8b('0x5e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2bce30[_0xad8b('0x5f')][_0xad8b('0x3f')]||_0xad8b('0x108'),'lastPauseAt':moment()[_0xad8b('0xf1')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xad8b('0x27')](respondWithResult(_0x480eb6,null))[_0xad8b('0x1d')](handleError(_0x480eb6,null));};exports[_0xad8b('0x109')]=function(_0x4c80e9,_0x499018){var _0x24c4dd;return db[_0xad8b('0x3b')]['find']({'where':{'id':_0x4c80e9[_0xad8b('0x53')]['id']},'attributes':['id','name','role',_0xad8b('0xae'),_0xad8b('0x10a'),_0xad8b('0x10b'),_0xad8b('0x10c'),_0xad8b('0x10d'),_0xad8b('0x10e'),_0xad8b('0x10f'),'pauseType',_0xad8b('0x110')]})[_0xad8b('0x27')](handleEntityNotFound(_0x499018,null))[_0xad8b('0x27')](function(_0x132b19){if(_0x132b19){_0x24c4dd=_0x132b19;if(_0x4c80e9[_0xad8b('0x5f')]['channel']&&!utils[_0xad8b('0xa1')](_0x4c80e9[_0xad8b('0x5f')]['channel'])){throw new db['Sequelize'][(_0xad8b('0x91'))](_0xad8b('0xa2'));}switch(_0x4c80e9[_0xad8b('0x5f')][_0xad8b('0x9e')]){case _0xad8b('0xac'):return respondWithRpcPromise(_0xad8b('0x111'),'unpause',{'id':_0x24c4dd['id'],'name':_0x24c4dd[_0xad8b('0x35')],'pause':![]})['then'](function(){return db[_0xad8b('0xaf')][_0xad8b('0x5e')]({'paused':0x0},{'where':{'UserId':_0x24c4dd['id']},'individualHooks':!![]});})[_0xad8b('0x27')](function(){return db[_0xad8b('0x103')][_0xad8b('0x34')]({'where':{'channel':_0x4c80e9['body'][_0xad8b('0x9e')],'membername':_0x24c4dd[_0xad8b('0x35')],'type':_0xad8b('0x101'),'exitAt':null}});})[_0xad8b('0x27')](function(_0x1e7eef){if(_0x1e7eef){return _0x1e7eef['update']({'exitAt':moment()[_0xad8b('0xf1')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xad8b('0x112')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x24c4dd['update']({'voicePause':![]});});case'mail':case _0xad8b('0x4e'):case _0xad8b('0x5c'):case _0xad8b('0x50'):case'whatsapp':case'openchannel':return db[_0xad8b('0x103')][_0xad8b('0x34')]({'where':{'channel':_0x4c80e9[_0xad8b('0x5f')][_0xad8b('0x9e')],'membername':_0x24c4dd['name'],'type':_0xad8b('0x101'),'exitAt':null}})[_0xad8b('0x27')](function(_0x3f0404){if(_0x3f0404){return _0x3f0404[_0xad8b('0x5e')]({'exitAt':moment()[_0xad8b('0xf1')](_0xad8b('0xfe')),'data2':_0xad8b('0x112')},{'individualHooks':!![]});}return null;})[_0xad8b('0x27')](function(){var _0x5eb573={};_[_0xad8b('0x24')](_0x5eb573,util[_0xad8b('0xf1')](_0xad8b('0x113'),_0x4c80e9[_0xad8b('0x5f')][_0xad8b('0x9e')],_0xad8b('0x114')),![]);return _0x24c4dd[_0xad8b('0x5e')](_0x5eb573);});default:return respondWithRpcPromise(_0xad8b('0x111'),_0xad8b('0x109'),{'id':_0x24c4dd['id'],'name':_0x24c4dd[_0xad8b('0x35')],'pause':![]})[_0xad8b('0x27')](function(){return db[_0xad8b('0xaf')][_0xad8b('0x5e')]({'paused':0x0},{'where':{'UserId':_0x24c4dd['id']}});})['then'](function(){return db[_0xad8b('0x103')][_0xad8b('0x8c')]({'where':{'membername':_0x24c4dd[_0xad8b('0x35')],'type':'PAUSE','exitAt':null}});})[_0xad8b('0x27')](function(_0x3ca64b){var _0xc05685=[];_0x3ca64b['forEach'](function(_0x25b603){_0xc05685['push'](_0x25b603[_0xad8b('0x5e')]({'exitAt':moment()[_0xad8b('0xf1')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'}));});return BPromise[_0xad8b('0x8a')](_0xc05685);})[_0xad8b('0x27')](function(){return _0x24c4dd[_0xad8b('0x5e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xad8b('0x27')](respondWithResult(_0x499018,null))[_0xad8b('0x1d')](handleError(_0x499018,null));};exports[_0xad8b('0x115')]=function(_0x42a6d6,_0x5aa624){var _0x244fe6={};var _0x4b23d1={};var _0x310ea5;var _0x268fec;return db[_0xad8b('0x3b')][_0xad8b('0x99')]({'where':{'id':_0x42a6d6[_0xad8b('0x53')]['id']}})['then'](handleEntityNotFound(_0x5aa624,null))[_0xad8b('0x27')](function(_0x3804a2){if(_0x3804a2){_0x310ea5=_0x3804a2;_0x4b23d1[_0xad8b('0x54')]=_[_0xad8b('0x57')](db[_0xad8b('0x116')][_0xad8b('0x3c')]);_0x4b23d1[_0xad8b('0x44')]=_[_0xad8b('0x57')](_0x42a6d6['query']);_0x4b23d1[_0xad8b('0xcc')]=_[_0xad8b('0x58')](_0x4b23d1[_0xad8b('0x54')],_0x4b23d1[_0xad8b('0x44')]);_0x244fe6[_0xad8b('0x4a')]=_[_0xad8b('0x58')](_0x4b23d1[_0xad8b('0x54')],qs[_0xad8b('0x59')](_0x42a6d6[_0xad8b('0x44')]['fields']));_0x244fe6['attributes']=_0x244fe6[_0xad8b('0x4a')][_0xad8b('0x4d')]?_0x244fe6[_0xad8b('0x4a')]:_0x4b23d1[_0xad8b('0x54')];_0x244fe6[_0xad8b('0xcd')]=qs['sort'](_0x42a6d6['query'][_0xad8b('0xce')]);_0x244fe6[_0xad8b('0x43')]=qs[_0xad8b('0xcc')](_['pick'](_0x42a6d6[_0xad8b('0x44')],_0x4b23d1[_0xad8b('0xcc')]));if(_0x42a6d6['query']['filter']){_0x244fe6[_0xad8b('0x43')]=_[_0xad8b('0x5a')](_0x244fe6[_0xad8b('0x43')],{'$or':_[_0xad8b('0x3d')](_0x244fe6[_0xad8b('0x4a')],function(_0x407495){var _0x4b6dbd={};_0x4b6dbd[_0x407495]={'$like':'%'+_0x42a6d6[_0xad8b('0x44')][_0xad8b('0x30')]+'%'};return _0x4b6dbd;})});}_0x244fe6=_[_0xad8b('0x5a')]({},_0x244fe6,_0x42a6d6[_0xad8b('0xcf')]);return _0x310ea5['getTeams'](_0x244fe6);}})['then'](function(_0x3267d6){if(_0x3267d6){_0x268fec=_0x3267d6[_0xad8b('0x4d')];if(!_0x42a6d6[_0xad8b('0x44')]['hasOwnProperty'](_0xad8b('0xdb'))){_0x244fe6[_0xad8b('0x22')]=qs['limit'](_0x42a6d6['query'][_0xad8b('0x22')]);_0x244fe6[_0xad8b('0x20')]=qs[_0xad8b('0x20')](_0x42a6d6[_0xad8b('0x44')][_0xad8b('0x20')]);}return _0x310ea5[_0xad8b('0x115')](_0x244fe6);}})[_0xad8b('0x27')](function(_0x523d10){if(_0x523d10){return _0x523d10?{'count':_0x268fec,'rows':_0x523d10}:null;}})[_0xad8b('0x27')](respondWithResult(_0x5aa624,null))[_0xad8b('0x1d')](handleError(_0x5aa624,null));};exports[_0xad8b('0x117')]=function(_0x42738a,_0x51dedd){return db[_0xad8b('0x3b')][_0xad8b('0x34')]({'where':{'id':_0x42738a[_0xad8b('0x53')]['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x51dedd,null))[_0xad8b('0x27')](function(_0x4a84a9){if(_0x4a84a9){var _0x35fd8d=_0x4a84a9['get']({'plain':!![]});return _0x4a84a9['addTeams'](_0x42738a[_0xad8b('0x5f')][_0xad8b('0x62')],_[_0xad8b('0x63')](_0x42738a[_0xad8b('0x5f')],['ids','id'])||{})[_0xad8b('0x27')](function(){for(var _0x5ab324=0x0;_0x5ab324<_0x42738a[_0xad8b('0x5f')][_0xad8b('0x62')][_0xad8b('0x4d')];_0x5ab324++){var _0x49c915=[];var _0x375d44={};db[_0xad8b('0x116')][_0xad8b('0x99')]({'where':{'id':_0x42738a[_0xad8b('0x5f')][_0xad8b('0x62')][_0x5ab324]}})[_0xad8b('0x27')](function(_0x16fcd1){_0x375d44=_0x16fcd1[_0xad8b('0x4f')];_0x49c915[_0xad8b('0x4b')](_0x16fcd1[_0xad8b('0xfb')]()[_0xad8b('0x27')](function(_0x180093){for(var _0x47e913=0x0;_0x47e913<_0x180093['length'];_0x47e913++){_0x180093[_0x47e913][_0xad8b('0x118')](_0xad8b('0x9e'),_0xad8b('0x119'));}return _0x180093;}));_0x49c915[_0xad8b('0x4b')](_0x16fcd1[_0xad8b('0x11a')]()[_0xad8b('0x27')](function(_0x38bde2){for(var _0x3a6f75=0x0;_0x3a6f75<_0x38bde2[_0xad8b('0x4d')];_0x3a6f75++){_0x38bde2[_0x3a6f75]['setDataValue'](_0xad8b('0x9e'),_0xad8b('0x11b'));}return _0x38bde2;}));_0x49c915[_0xad8b('0x4b')](_0x16fcd1['getMailQueues']()[_0xad8b('0x27')](function(_0x14ba54){for(var _0x486f13=0x0;_0x486f13<_0x14ba54[_0xad8b('0x4d')];_0x486f13++){_0x14ba54[_0x486f13][_0xad8b('0x118')](_0xad8b('0x9e'),_0xad8b('0x11c'));}return _0x14ba54;}));_0x49c915[_0xad8b('0x4b')](_0x16fcd1[_0xad8b('0x11d')]()['then'](function(_0x3a896c){for(var _0x586f4c=0x0;_0x586f4c<_0x3a896c[_0xad8b('0x4d')];_0x586f4c++){_0x3a896c[_0x586f4c][_0xad8b('0x118')]('channel',_0xad8b('0x11e'));}return _0x3a896c;}));_0x49c915[_0xad8b('0x4b')](_0x16fcd1['getWhatsappQueues']()[_0xad8b('0x27')](function(_0x363361){for(var _0x1b32a0=0x0;_0x1b32a0<_0x363361[_0xad8b('0x4d')];_0x1b32a0++){_0x363361[_0x1b32a0][_0xad8b('0x118')](_0xad8b('0x9e'),_0xad8b('0x11f'));}return _0x363361;}));_0x49c915['push'](_0x16fcd1['getFaxQueues']()[_0xad8b('0x27')](function(_0xf93ecf){for(var _0xfe50f1=0x0;_0xfe50f1<_0xf93ecf[_0xad8b('0x4d')];_0xfe50f1++){_0xf93ecf[_0xfe50f1]['setDataValue'](_0xad8b('0x9e'),_0xad8b('0x120'));}return _0xf93ecf;}));_0x49c915[_0xad8b('0x4b')](_0x16fcd1['getOpenchannelQueues']()['then'](function(_0x4e56f0){for(var _0x44dd7d=0x0;_0x44dd7d<_0x4e56f0['length'];_0x44dd7d++){_0x4e56f0[_0x44dd7d][_0xad8b('0x118')](_0xad8b('0x9e'),'Openchannel');}return _0x4e56f0;}));return BPromise['all'](_0x49c915);})['then'](function(_0x57733c){var _0x5316e6=_[_0xad8b('0x121')](_0x57733c);_0x49c915=[];return db[_0xad8b('0x6b')][_0xad8b('0x122')](function(_0x2d46ee){for(var _0x462606=0x0;_0x462606<_0x5316e6[_0xad8b('0x4d')];_0x462606++){_0x49c915[_0xad8b('0x4b')](_0x5316e6[_0x462606][_0xad8b('0x123')](_0x35fd8d['id']),{'transaction':_0x2d46ee});}return BPromise[_0xad8b('0x8a')](_0x49c915)[_0xad8b('0x27')](function(){if(_0x35fd8d[_0xad8b('0x9f')]){return BPromise[_0xad8b('0x8b')](_[_0xad8b('0x30')](_0x5316e6,function(_0x4e5a05){return _0x4e5a05[_0xad8b('0x124')](_0xad8b('0x9e'))===_0xad8b('0x119');}),function(_0x4fc97a){return db[_0xad8b('0xaf')][_0xad8b('0xb0')]({'membername':_0x35fd8d[_0xad8b('0x35')],'UserId':_0x35fd8d['id'],'queue_name':_0x4fc97a[_0xad8b('0x35')],'VoiceQueueId':_0x4fc97a['id'],'interface':_[_0xad8b('0x69')](_0x35fd8d[_0xad8b('0xf0')])?util['format'](_0xad8b('0xad'),_0x35fd8d[_0xad8b('0x35')]):_0x35fd8d[_0xad8b('0xf0')],'paused':_0x35fd8d['voicePause']||![],'penalty':_0x35fd8d['penalty']},{'transaction':_0x2d46ee});});}else{return;}})[_0xad8b('0x27')](function(){for(var _0x532187=0x0;_0x532187<_0x5316e6['length'];_0x532187++){var _0x12af7f=_0x5316e6[_0x532187][_0xad8b('0x124')](_0xad8b('0x9e'));var _0x1a46b0=_0x12af7f+'QueueId';socket[_0xad8b('0xaa')]('user'+_0x12af7f+_0xad8b('0xab'),{'UserId':_0x35fd8d['id'],['queueField']:_0x5316e6[_0x532187]['id']});}});});})[_0xad8b('0x27')](function(){db[_0xad8b('0x125')]['findOne']({'where':{'teamId':_0x375d44['id']}})[_0xad8b('0x27')](function(_0x427a2f){if(_0x427a2f){db[_0xad8b('0x126')][_0xad8b('0x7f')]({'UserId':_0x42738a[_0xad8b('0x53')]['id'],'VoicePrefixId':_0x427a2f['VoicePrefixId']});}});});}});}})['then'](respondWithStatusCode(_0x51dedd,null))['catch'](handleError(_0x51dedd,null));};exports['removeTeams']=function(_0x5422ab,_0x44503a){return db[_0xad8b('0x3b')][_0xad8b('0x99')]({'where':{'id':_0x5422ab[_0xad8b('0x53')]['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x44503a,null))[_0xad8b('0x27')](function(_0x5527c0){if(_0x5527c0){var _0x1c3b83=_0x5527c0[_0xad8b('0x29')]({'plain':!![]});var _0x203f7b=_0x5422ab[_0xad8b('0x44')]['ids'];return _0x5527c0['removeTeams'](_0x203f7b)[_0xad8b('0x27')](function(){for(var _0x2573e6=0x0;_0x2573e6<_0x203f7b[_0xad8b('0x4d')];_0x2573e6++){var _0x29f313=[];var _0x4446bd={};db[_0xad8b('0x116')][_0xad8b('0x99')]({'where':{'id':_0x203f7b[_0x2573e6]}})[_0xad8b('0x27')](function(_0x48c629){_0x4446bd=_0x48c629[_0xad8b('0x4f')];_0x29f313[_0xad8b('0x4b')](_0x48c629[_0xad8b('0xfb')]()[_0xad8b('0x27')](function(_0x5602c2){for(var _0x5e3578=0x0;_0x5e3578<_0x5602c2[_0xad8b('0x4d')];_0x5e3578++){_0x5602c2[_0x5e3578]['setDataValue'](_0xad8b('0x9e'),'Voice');}return _0x5602c2;}));_0x29f313['push'](_0x48c629['getChatQueues']()['then'](function(_0x4c8faa){for(var _0x2a9f5a=0x0;_0x2a9f5a<_0x4c8faa[_0xad8b('0x4d')];_0x2a9f5a++){_0x4c8faa[_0x2a9f5a]['setDataValue']('channel',_0xad8b('0x11b'));}return _0x4c8faa;}));_0x29f313[_0xad8b('0x4b')](_0x48c629['getMailQueues']()[_0xad8b('0x27')](function(_0x3351a1){for(var _0x4a39e9=0x0;_0x4a39e9<_0x3351a1[_0xad8b('0x4d')];_0x4a39e9++){_0x3351a1[_0x4a39e9][_0xad8b('0x118')](_0xad8b('0x9e'),_0xad8b('0x11c'));}return _0x3351a1;}));_0x29f313['push'](_0x48c629[_0xad8b('0x11d')]()[_0xad8b('0x27')](function(_0x54883c){for(var _0x512a19=0x0;_0x512a19<_0x54883c[_0xad8b('0x4d')];_0x512a19++){_0x54883c[_0x512a19][_0xad8b('0x118')](_0xad8b('0x9e'),_0xad8b('0x11e'));}return _0x54883c;}));_0x29f313[_0xad8b('0x4b')](_0x48c629[_0xad8b('0x127')]()['then'](function(_0x365a42){for(var _0x29fed5=0x0;_0x29fed5<_0x365a42[_0xad8b('0x4d')];_0x29fed5++){_0x365a42[_0x29fed5][_0xad8b('0x118')](_0xad8b('0x9e'),_0xad8b('0x11f'));}return _0x365a42;}));_0x29f313['push'](_0x48c629['getFaxQueues']()[_0xad8b('0x27')](function(_0x2e28aa){for(var _0x43f182=0x0;_0x43f182<_0x2e28aa[_0xad8b('0x4d')];_0x43f182++){_0x2e28aa[_0x43f182]['setDataValue'](_0xad8b('0x9e'),_0xad8b('0x120'));}return _0x2e28aa;}));_0x29f313[_0xad8b('0x4b')](_0x48c629[_0xad8b('0x128')]()[_0xad8b('0x27')](function(_0x566285){for(var _0x17c976=0x0;_0x17c976<_0x566285[_0xad8b('0x4d')];_0x17c976++){_0x566285[_0x17c976][_0xad8b('0x118')](_0xad8b('0x9e'),'Openchannel');}return _0x566285;}));return BPromise[_0xad8b('0x8a')](_0x29f313);})[_0xad8b('0x27')](function(_0x134f25){var _0x393e67=_[_0xad8b('0x121')](_0x134f25);_0x29f313=[];return db[_0xad8b('0x6b')]['transaction'](function(_0x4297d5){for(var _0x554a16=0x0;_0x554a16<_0x393e67[_0xad8b('0x4d')];_0x554a16++){_0x29f313[_0xad8b('0x4b')](_0x393e67[_0x554a16][_0xad8b('0x129')](_0x1c3b83['id']),{'transaction':_0x4297d5});}return BPromise['all'](_0x29f313)[_0xad8b('0x27')](function(){if(_0x1c3b83['online']){return BPromise[_0xad8b('0x8b')](_['filter'](_0x393e67,function(_0x23876c){return _0x23876c['getDataValue'](_0xad8b('0x9e'))===_0xad8b('0x119');}),function(_0x2fb446){return db[_0xad8b('0xaf')][_0xad8b('0x28')]({'where':{'VoiceQueueId':_0x2fb446['id'],'UserId':_0x1c3b83['id']},'transaction':_0x4297d5});});}else{return;}})[_0xad8b('0x27')](function(){db[_0xad8b('0x125')][_0xad8b('0x99')]({'where':{'teamId':_0x4446bd['id']}})[_0xad8b('0x27')](function(_0x49169b){if(_0x49169b){return db[_0xad8b('0x126')]['destroy']({'where':{'UserId':_0x1c3b83['id'],'VoicePrefixId':_0x49169b[_0xad8b('0x4f')][_0xad8b('0x12a')]}});}});})[_0xad8b('0x27')](function(){for(var _0x44f857=0x0;_0x44f857<_0x393e67[_0xad8b('0x4d')];_0x44f857++){var _0x2e7fea=_0x393e67[_0x44f857][_0xad8b('0x124')](_0xad8b('0x9e'));var _0x433d5d=_0x2e7fea+_0xad8b('0xa9');socket[_0xad8b('0xaa')]('user'+_0x2e7fea+_0xad8b('0x12b'),{'UserId':_0x1c3b83['id'],['queueField']:_0x393e67[_0x44f857]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x44503a,null))['catch'](handleError(_0x44503a,null));};exports[_0xad8b('0x12c')]=function(_0x22a064,_0x1d505e){var _0x3239f8={};var _0x36a8a9={};var _0x3a216c;var _0x94937e;return db[_0xad8b('0x3b')][_0xad8b('0x99')]({'where':{'id':_0x22a064[_0xad8b('0x53')]['id']}})['then'](handleEntityNotFound(_0x1d505e,null))['then'](function(_0x398ff4){if(_0x398ff4){_0x3a216c=_0x398ff4;_0x36a8a9[_0xad8b('0x54')]=_['keys'](db['CmList'][_0xad8b('0x3c')]);_0x36a8a9['query']=_['keys'](_0x22a064['query']);_0x36a8a9[_0xad8b('0xcc')]=_[_0xad8b('0x58')](_0x36a8a9[_0xad8b('0x54')],_0x36a8a9[_0xad8b('0x44')]);_0x3239f8[_0xad8b('0x4a')]=_[_0xad8b('0x58')](_0x36a8a9['model'],qs[_0xad8b('0x59')](_0x22a064[_0xad8b('0x44')][_0xad8b('0x59')]));_0x3239f8[_0xad8b('0x4a')]=_0x3239f8[_0xad8b('0x4a')][_0xad8b('0x4d')]?_0x3239f8['attributes']:_0x36a8a9['model'];_0x3239f8[_0xad8b('0xcd')]=qs[_0xad8b('0xce')](_0x22a064[_0xad8b('0x44')]['sort']);_0x3239f8[_0xad8b('0x43')]=qs[_0xad8b('0xcc')](_[_0xad8b('0xd9')](_0x22a064[_0xad8b('0x44')],_0x36a8a9[_0xad8b('0xcc')]));if(_0x22a064[_0xad8b('0x44')][_0xad8b('0x30')]){_0x3239f8['where']=_[_0xad8b('0x5a')](_0x3239f8[_0xad8b('0x43')],{'$or':_['map'](_0x3239f8[_0xad8b('0x4a')],function(_0x5ec354){var _0x5d1d38={};_0x5d1d38[_0x5ec354]={'$like':'%'+_0x22a064[_0xad8b('0x44')][_0xad8b('0x30')]+'%'};return _0x5d1d38;})});}_0x3239f8=_[_0xad8b('0x5a')]({},_0x3239f8,_0x22a064[_0xad8b('0xcf')]);return _0x3a216c[_0xad8b('0x12c')](_0x3239f8);}})['then'](function(_0x2b4491){if(_0x2b4491){_0x94937e=_0x2b4491['length'];if(!_0x22a064[_0xad8b('0x44')]['hasOwnProperty']('nolimit')){_0x3239f8[_0xad8b('0x22')]=qs['limit'](_0x22a064[_0xad8b('0x44')][_0xad8b('0x22')]);_0x3239f8[_0xad8b('0x20')]=qs['offset'](_0x22a064[_0xad8b('0x44')][_0xad8b('0x20')]);}return _0x3a216c['getLists'](_0x3239f8);}})[_0xad8b('0x27')](function(_0x276e60){if(_0x276e60){return _0x276e60?{'count':_0x94937e,'rows':_0x276e60}:null;}})['then'](respondWithResult(_0x1d505e,null))[_0xad8b('0x1d')](handleError(_0x1d505e,null));};exports[_0xad8b('0x12d')]=function(_0x23aae5,_0x3db45a){var _0x607542={};var _0x4dd38a={};var _0x2227d0;return db[_0xad8b('0x3b')][_0xad8b('0x99')]({'where':{'id':_0x23aae5[_0xad8b('0x53')]['id']}})[_0xad8b('0x27')](handleEntityNotFound(_0x3db45a,null))[_0xad8b('0x27')](function(_0x316c5d){if(_0x316c5d){_0x2227d0=_0x316c5d;_0x4dd38a['model']=_[_0xad8b('0x57')](db[_0xad8b('0x3b')]['rawAttributes']);_0x4dd38a['query']=_['keys'](_0x23aae5[_0xad8b('0x44')]);_0x4dd38a[_0xad8b('0xcc')]=_[_0xad8b('0x58')](_0x4dd38a[_0xad8b('0x54')],_0x4dd38a['query']);_0x607542[_0xad8b('0x4a')]=_[_0xad8b('0x58')](_0x4dd38a[_0xad8b('0x54')],qs[_0xad8b('0x59')](_0x23aae5[_0xad8b('0x44')][_0xad8b('0x59')]));_0x607542[_0xad8b('0x4a')]=_0x607542[_0xad8b('0x4a')]['length']?_0x607542[_0xad8b('0x4a')]:_0x4dd38a[_0xad8b('0x54')];_0x607542['order']=qs[_0xad8b('0xce')](_0x23aae5[_0xad8b('0x44')][_0xad8b('0xce')]);_0x607542[_0xad8b('0x43')]=qs[_0xad8b('0xcc')](_[_0xad8b('0xd9')](_0x23aae5[_0xad8b('0x44')],_0x4dd38a['filters']));if(_0x23aae5['query'][_0xad8b('0x30')]){_0x607542[_0xad8b('0x43')]=_['merge'](_0x607542['where'],{'$or':_[_0xad8b('0x3d')](_0x607542['attributes'],function(_0x90a642){var _0x1f0d2f={};_0x1f0d2f[_0x90a642]={'$like':'%'+_0x23aae5[_0xad8b('0x44')][_0xad8b('0x30')]+'%'};return _0x1f0d2f;})});}_0x607542[_0xad8b('0x54')]=db[_0xad8b('0x3b')];_0x607542['as']='Agents';_0x607542=_[_0xad8b('0x5a')]({},_0x607542,_0x23aae5[_0xad8b('0xcf')]);return _0x2227d0[_0xad8b('0xfb')]({'include':[_0x607542]});}})['then'](function(_0x187da4){if(_0x187da4){var _0x233feb={},_0x1d8754=[];for(var _0x20d271=0x0;_0x20d271<_0x187da4[_0xad8b('0x4d')];_0x20d271+=0x1){for(var _0x2af08=0x0,_0x2eeb3a;_0x2af08<_0x187da4[_0x20d271][_0xad8b('0x2d')][_0xad8b('0x4d')];_0x2af08+=0x1){_0x2eeb3a=_0x187da4[_0x20d271]['Agents'][_0x2af08]['get']({'plain':!![]});_0x233feb[_0x2eeb3a['id']]=_0x2eeb3a;}}_0x233feb=_[_0xad8b('0x12e')](_0x233feb);for(var _0x233a61=qs[_0xad8b('0x20')](_0x23aae5[_0xad8b('0x44')][_0xad8b('0x20')]);_0x233a61<_0x233feb[_0xad8b('0x4d')]&&_0x1d8754['length']=_0x1c142d){_0x69e0b3=_0x1c142d;_0x5b841d=0xc8;}else{_0x5b841d=0xce;}_0x38c84e[_0x074d('0x1e')](_0x5b841d);return _0x38c84e['set'](_0x074d('0x23'),_0x301758+'-'+_0x69e0b3+'/'+_0x1c142d)[_0x074d('0x24')](_0x36ffdc);}return null;};}function saveUpdates(_0x3d81c6){return function(_0x5a7e2f){if(_0x5a7e2f){return _0x5a7e2f['update'](_0x3d81c6)[_0x074d('0x25')](function(_0x6a940a){return _0x6a940a;});}return null;};}function removeEntity(_0x44e690){return function(_0x28d262){if(_0x28d262){return _0x28d262[_0x074d('0x26')]()[_0x074d('0x25')](function(){var _0x37c5d1=_0x28d262[_0x074d('0x27')]({'plain':!![]});if(_0x37c5d1[_0x074d('0x28')]==='admin')return;var _0x7de4f5=[{'name':_0x074d('0x29'),'value':_0x074d('0x2a'),'ignore':!![]},{'name':_0x074d('0x2b'),'value':_0x074d('0x2c'),'ignore':![]},{'name':'Telephones','value':_0x074d('0x2d'),'ignore':![]}];var _0x1b6bd8=_(_0x7de4f5)['filter'](_0x074d('0x2e'))['map'](_0x074d('0x2f'))[_0x074d('0x2f')]();if(_[_0x074d('0x30')](_0x1b6bd8,_0x37c5d1[_0x074d('0x28')])){return;}var _0x12a4bf=_[_0x074d('0x31')](_0x7de4f5,[_0x074d('0x2f'),_0x37c5d1[_0x074d('0x28')]])['name'];return db[_0x074d('0x32')][_0x074d('0x26')]({'where':{'type':_0x12a4bf,'resourceId':_0x37c5d1['id']}})[_0x074d('0x25')](function(){return _0x28d262;});})[_0x074d('0x25')](function(){_0x44e690[_0x074d('0x1e')](0xcc)[_0x074d('0x33')]();});}};}function handleEntityNotFound(_0x10909e){return function(_0xd6af54){if(!_0xd6af54){_0x10909e[_0x074d('0x34')](0x194);}return _0xd6af54;};}function handleError(_0x810fca,_0x23b499){_0x23b499=_0x23b499||0x1f4;return function(_0x34be2e){logger['error'](_0x34be2e[_0x074d('0x35')]);if(_0x34be2e['name']){delete _0x34be2e['name'];}_0x810fca['status'](_0x23b499)[_0x074d('0x36')](_0x34be2e);};}exports[_0x074d('0x37')]=function(_0x44f7a1,_0x538486){var _0x1c8616={},_0x38207c={'count':0x0,'rows':[]};var _0x2ce612=_(db[_0x074d('0x38')][_0x074d('0x39')])['map'](function(_0x3c3d6c){return{'name':_0x3c3d6c['fieldName'],'type':_0x3c3d6c[_0x074d('0x3a')][_0x074d('0x3b')]};})[_0x074d('0x3c')](function(_0x22207a){return!_['includes']([_0x074d('0x3d'),_0x074d('0x3e')],_0x22207a[_0x074d('0x3f')]);})[_0x074d('0x2f')]();_0x1c8616=qs[_0x074d('0x40')](_0x2ce612,_0x44f7a1);var _0x284c12={'where':_0x1c8616[_0x074d('0x41')]};return db[_0x074d('0x38')][_0x074d('0x22')](_0x284c12)['then'](function(_0x2fb365){_0x38207c['count']=_0x2fb365;if(_0x44f7a1[_0x074d('0x42')][_0x074d('0x43')]){_0x1c8616['include']=[{'all':!![]}];}if(_0x44f7a1['query']['userSetting']==='true'){_0x1c8616['include']=[{'model':db[_0x074d('0x44')],'as':_0x074d('0x45')}];}if(!_['includes'](_0x1c8616['attributes'],'id')){_0x1c8616[_0x074d('0x46')][_0x074d('0x47')]('id');}return db['User'][_0x074d('0x48')](_0x1c8616);})[_0x074d('0x25')](function(_0x4a6680){_0x38207c['rows']=_0x4a6680;if(_0x44f7a1[_0x074d('0x42')]['openTabs']==='true'){var _0x31c092=[];for(var _0x112075=0x0;_0x112075<_0x38207c[_0x074d('0x49')][_0x074d('0x4a')];_0x112075++){_0x31c092[_0x074d('0x47')](get_open_tabs('chat',_0x38207c[_0x074d('0x49')][_0x112075][_0x074d('0x4b')]));_0x31c092[_0x074d('0x47')](get_open_tabs(_0x074d('0x4c'),_0x38207c[_0x074d('0x49')][_0x112075]['dataValues']));_0x31c092[_0x074d('0x47')](get_open_tabs(_0x074d('0x4d'),_0x38207c[_0x074d('0x49')][_0x112075][_0x074d('0x4b')]));_0x31c092[_0x074d('0x47')](get_open_tabs(_0x074d('0x4e'),_0x38207c[_0x074d('0x49')][_0x112075][_0x074d('0x4b')]));_0x31c092[_0x074d('0x47')](get_open_tabs(_0x074d('0x4f'),_0x38207c[_0x074d('0x49')][_0x112075][_0x074d('0x4b')]));_0x31c092[_0x074d('0x47')](get_open_tabs(_0x074d('0x50'),_0x38207c[_0x074d('0x49')][_0x112075]['dataValues']));}return BPromise['all'](_0x31c092)[_0x074d('0x25')](function(){return _0x38207c;});}else{return _0x38207c;}})[_0x074d('0x25')](respondWithFilteredResult(_0x538486,_0x1c8616))[_0x074d('0x1d')](handleError(_0x538486,null));};exports[_0x074d('0x51')]=function(_0x13ed38,_0x10c574){var _0x44d44d={'raw':![],'where':{'id':_0x13ed38['params']['id']}},_0x4085db={};_0x4085db['model']=_[_0x074d('0x52')](_[_0x074d('0x53')](db[_0x074d('0x38')]['rawAttributes']),['password',_0x074d('0x3e')]);_0x4085db[_0x074d('0x42')]=_[_0x074d('0x53')](_0x13ed38['query']);_0x4085db[_0x074d('0x54')]=_[_0x074d('0x55')](_0x4085db['model'],_0x4085db[_0x074d('0x42')]);_0x44d44d['attributes']=_['intersection'](_0x4085db[_0x074d('0x56')],qs[_0x074d('0x57')](_0x13ed38[_0x074d('0x42')][_0x074d('0x57')]));_0x44d44d['attributes']=_0x44d44d[_0x074d('0x46')][_0x074d('0x4a')]?_0x44d44d[_0x074d('0x46')]:_0x4085db[_0x074d('0x56')];if(_0x13ed38[_0x074d('0x42')]['includeAll']){_0x44d44d[_0x074d('0x58')]=[{'all':!![]}];}if(_0x13ed38[_0x074d('0x42')][_0x074d('0x45')]===_0x074d('0x59')){_0x44d44d['include']=[{'model':db[_0x074d('0x44')],'as':_0x074d('0x45')}];}_0x44d44d=_[_0x074d('0x5a')]({},_0x44d44d,_0x13ed38[_0x074d('0x5b')]);if(!_[_0x074d('0x30')](_0x44d44d[_0x074d('0x46')],'id')){_0x44d44d[_0x074d('0x46')][_0x074d('0x47')]('id');}return db[_0x074d('0x38')]['find'](_0x44d44d)[_0x074d('0x25')](handleEntityNotFound(_0x10c574,null))['then'](function(_0x5c9cb1){var _0x5a83b9=[];values=_0x5c9cb1;if(_0x13ed38[_0x074d('0x42')][_0x074d('0x5c')]==='true'){_0x5a83b9['push'](get_open_tabs(_0x074d('0x5d'),_0x5c9cb1[_0x074d('0x4b')]));_0x5a83b9['push'](get_open_tabs(_0x074d('0x4c'),_0x5c9cb1['dataValues']));_0x5a83b9['push'](get_open_tabs(_0x074d('0x4f'),_0x5c9cb1['dataValues']));_0x5a83b9[_0x074d('0x47')](get_open_tabs('whatsapp',_0x5c9cb1['dataValues']));_0x5a83b9['push'](get_open_tabs(_0x074d('0x4d'),_0x5c9cb1[_0x074d('0x4b')]));_0x5a83b9['push'](get_open_tabs(_0x074d('0x4e'),_0x5c9cb1[_0x074d('0x4b')]));return BPromise[_0x074d('0x5e')](_0x5a83b9);}else{return values;}})[_0x074d('0x25')](function(){return values;})[_0x074d('0x25')](respondWithResult(_0x10c574,null))['catch'](handleError(_0x10c574,null));};exports[_0x074d('0x5f')]=function(_0x3ddce8,_0x5126ec){if(_0x3ddce8[_0x074d('0x60')]['id']){delete _0x3ddce8['body']['id'];}delete _0x3ddce8[_0x074d('0x60')][_0x074d('0x28')];return db[_0x074d('0x38')][_0x074d('0x31')]({'where':{'id':_0x3ddce8['params']['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x5126ec,null))['then'](saveUpdates(_0x3ddce8[_0x074d('0x60')],null))[_0x074d('0x25')](respondWithResult(_0x5126ec,null))['catch'](handleError(_0x5126ec,null));};exports[_0x074d('0x61')]=function(_0x442553,_0x126c14){return db[_0x074d('0x38')][_0x074d('0x61')]()[_0x074d('0x25')](respondWithResult(_0x126c14,null))[_0x074d('0x1d')](handleError(_0x126c14,null));};exports[_0x074d('0x62')]=function(_0x23677c,_0x33d10f){return db['User'][_0x074d('0x31')]({'where':{'id':_0x23677c[_0x074d('0x63')]['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x33d10f,null))[_0x074d('0x25')](function(_0x2e9444){if(_0x2e9444){return _0x2e9444['addContacts'](_0x23677c[_0x074d('0x60')][_0x074d('0x64')],_[_0x074d('0x65')](_0x23677c[_0x074d('0x60')],[_0x074d('0x64'),'id'])||{});}})[_0x074d('0x25')](respondWithResult(_0x33d10f,null))['catch'](handleError(_0x33d10f,null));};function validateUser(_0x1563fc){return new BPromise(function(_0x574495,_0xe50ee9){if(_0x1563fc[_0x074d('0x66')])return _0x574495(_0x1563fc);return db[_0x074d('0x67')][_0x074d('0x68')](0x1)[_0x074d('0x25')](function(_0x23061c){if(_0x23061c[_0x074d('0x69')])authService['validatePasswordPattern'](_0x1563fc[_0x074d('0x3d')]);db[_0x074d('0x38')][_0x074d('0x6a')](_0x074d('0x66'))[_0x074d('0x25')](function(_0x282b58){if(_[_0x074d('0x6b')](_0x282b58)){_0x1563fc[_0x074d('0x66')]=_0x23061c[_0x074d('0x6c')]||0x1;return;}if(_['isNil'](_0x23061c[_0x074d('0x6c')])||_0x23061c['min_internal']===_0x282b58){_0x1563fc[_0x074d('0x66')]=_0x282b58+0x1;return;}if(_0x23061c[_0x074d('0x6c')]>_0x282b58){_0x1563fc[_0x074d('0x66')]=_0x23061c[_0x074d('0x6c')];return;}return db[_0x074d('0x6d')]['query'](_0x074d('0x6e'),{'type':db[_0x074d('0x6d')][_0x074d('0x6f')][_0x074d('0x70')]})[_0x074d('0x25')](function(_0x569cd2){if(_0x569cd2&&_0x569cd2[_0x074d('0x4a')]){for(var _0x262239=0x0,_0x1fecb8=_0x569cd2[_0x074d('0x4a')];_0x262239<_0x1fecb8&&_[_0x074d('0x6b')](_0x1563fc[_0x074d('0x66')]);_0x262239++){if(_0x23061c[_0x074d('0x6c')]<=_0x569cd2[_0x262239][_0x074d('0x71')]){_0x1563fc[_0x074d('0x66')]=_0x569cd2[_0x262239][_0x074d('0x71')];}else if(_0x23061c[_0x074d('0x6c')]>_0x569cd2[_0x262239][_0x074d('0x71')]&&_0x23061c[_0x074d('0x6c')]<=_0x569cd2[_0x262239]['to']){_0x1563fc[_0x074d('0x66')]=_0x23061c['min_internal'];}}}if(_['isNil'](_0x1563fc[_0x074d('0x66')])){_0x1563fc[_0x074d('0x66')]=_0x282b58+0x1;}return _0x574495(_0x1563fc);});});})[_0x074d('0x1d')](function(_0x33cc40){_0xe50ee9(_0x33cc40);});});}function updateUser(_0x40c471){return new BPromise(function(_0x3e7c2e,_0x4ea025){try{if(_0x40c471[_0x074d('0x72')]){_0x40c471['mailbox']=_0x40c471[_0x074d('0x66')];_0x40c471[_0x074d('0x73')]={'mailbox':_0x40c471[_0x074d('0x66')],'password':_0x40c471[_0x074d('0x3d')],'fullname':_0x40c471[_0x074d('0x74')],'email':_0x40c471['email']};}if(_0x40c471[_0x074d('0x28')]===_0x074d('0x2c')){if(!_0x40c471[_0x074d('0x75')])_0x40c471[_0x074d('0x75')]=[_0x074d('0x76'),_0x074d('0x77'),'103',_0x074d('0x78'),_0x074d('0x79'),_0x074d('0x7a'),_0x074d('0x7b'),'106','107',_0x074d('0x7c'),_0x074d('0x7d'),_0x074d('0x7e'),_0x074d('0x7f'),_0x074d('0x80'),_0x074d('0x81')];}_0x3e7c2e(_0x40c471);}catch(_0x264970){_0x4ea025(_0x264970);}});}exports['create']=function(_0x2fb65e,_0x4e14a6){if(_0x2fb65e[_0x074d('0x2a')][_0x074d('0x28')]==='agent')throw new Error('Unauthorized');if(_0x2fb65e[_0x074d('0x60')][_0x074d('0x28')]==='user'&&_0x2fb65e[_0x074d('0x2a')][_0x074d('0x28')]!==_0x074d('0x82')){throw new Error(_0x074d('0x83'));}if(_0x2fb65e[_0x074d('0x60')]['role']===_0x074d('0x82')&&_0x2fb65e['user'][_0x074d('0x28')]!==_0x074d('0x82')){throw new Error(_0x074d('0x84'));}return licenseUtil['checkUserLimits']([_0x2fb65e[_0x074d('0x60')]])[_0x074d('0x25')](function(){return validateUser(_0x2fb65e['body']);})['then'](function(_0x1198da){return updateUser(_0x1198da)[_0x074d('0x25')](function(_0xaa8dd6){if(_0xaa8dd6[_0x074d('0x28')]===_0x074d('0x82')){_0xaa8dd6[_0x074d('0x85')]=_0x2fb65e['user'][_0x074d('0x85')];delete _0xaa8dd6['userProfileId'];}return _0xaa8dd6;});})[_0x074d('0x25')](function(_0xf47b74){return db['User'][_0x074d('0x86')](_0xf47b74,{'include':[{'model':db[_0x074d('0x73')],'as':'VoiceMail'}]});})[_0x074d('0x25')](function(_0x32d97d){if(_0x2fb65e[_0x074d('0x60')][_0x074d('0x28')]==='user')return _0x32d97d;if(_0x2fb65e[_0x074d('0x2a')][_0x074d('0x28')]!==_0x074d('0x2a'))return _0x32d97d;return db[_0x074d('0x87')][_0x074d('0x31')]({'where':{'name':_0x32d97d['role']===_0x074d('0x2c')?_0x074d('0x2b'):_0x074d('0x88'),'userProfileId':_0x2fb65e[_0x074d('0x2a')][_0x074d('0x89')]},'raw':!![]})[_0x074d('0x25')](function(_0x48057d){if(!_0x48057d||_0x48057d[_0x074d('0x8a')]!=0x0)return _0x32d97d;return db[_0x074d('0x32')][_0x074d('0x86')]({'name':_0x32d97d['name'],'resourceId':_0x32d97d['id'],'type':_0x48057d[_0x074d('0x3f')],'sectionId':_0x48057d['id']},{})['then'](function(){return _0x32d97d;});})[_0x074d('0x1d')](function(_0x219919){logger[_0x074d('0x19')](_0x074d('0x8b'),_0x219919);throw _0x219919;});})[_0x074d('0x25')](respondWithResult(_0x4e14a6,0xc9))[_0x074d('0x1d')](handleError(_0x4e14a6,null));};exports[_0x074d('0x8c')]=function(_0x1a0cd9,_0x129e91){var _0x3ff17f=_0x1a0cd9[_0x074d('0x60')];var _0x50dadb=[];if(_0x1a0cd9[_0x074d('0x2a')][_0x074d('0x28')]===_0x074d('0x2c'))throw new Error(_0x074d('0x8d'));if(_['some'](_0x3ff17f,[_0x074d('0x28'),'user'])&&_0x1a0cd9[_0x074d('0x2a')]['role']!=='admin'){throw new Error(_0x074d('0x83'));}if(_[_0x074d('0x8e')](_0x3ff17f,[_0x074d('0x28'),_0x074d('0x82')])&&_0x1a0cd9[_0x074d('0x2a')][_0x074d('0x28')]!==_0x074d('0x82')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x3ff17f)[_0x074d('0x25')](function(){return validateUser(_0x3ff17f[0x0]);})[_0x074d('0x25')](function(){for(var _0x330487=0x1;_0x330487<_0x3ff17f['length'];_0x330487++){var _0x4b7c36=_0x3ff17f[_0x330487-0x1][_0x074d('0x66')];if(!_0x3ff17f[_0x330487][_0x074d('0x66')])_0x3ff17f[_0x330487][_0x074d('0x66')]=_0x4b7c36+0x1;_0x50dadb['push'](validateUser(_0x3ff17f[_0x330487]));}return BPromise['all'](_0x50dadb);})[_0x074d('0x25')](function(){_0x50dadb=[];for(var _0x590e78=0x0;_0x590e78<_0x3ff17f[_0x074d('0x4a')];_0x590e78++){_0x50dadb['push'](updateUser(_0x3ff17f[_0x590e78]));}return BPromise[_0x074d('0x5e')](_0x50dadb);})[_0x074d('0x25')](function(){return BPromise[_0x074d('0x8f')](_0x3ff17f,function(_0x4a9ee3){return db[_0x074d('0x38')][_0x074d('0x86')](_0x4a9ee3,{'include':[{'model':db[_0x074d('0x73')],'as':'VoiceMail'}]})[_0x074d('0x25')](function(_0x2e2255){_0x4a9ee3['id']=_0x2e2255['id'];return _0x4a9ee3;});});})[_0x074d('0x25')](function(_0x2cf749){if(_0x1a0cd9[_0x074d('0x60')]['role']==='user')return _0x2cf749;if(_0x1a0cd9[_0x074d('0x2a')][_0x074d('0x28')]!==_0x074d('0x2a'))return _0x2cf749;var _0x18be52=_['some'](_0x2cf749,function(_0x42b9fc){return _0x42b9fc[_0x074d('0x28')]==='agent'||_0x42b9fc[_0x074d('0x28')]===_0x074d('0x2d');});if(!_0x18be52)return _0x2cf749;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0x074d('0x2b'),'Telephones']},'userProfileId':_0x1a0cd9[_0x074d('0x2a')]['userProfileId']},'raw':!![]})['then'](function(_0x53cbf1){if(_['isEmpty'](_0x53cbf1)||!_[_0x074d('0x8e')](_0x53cbf1,['autoAssociation',0x0]))return _0x2cf749;_0x50dadb=[];var _0x1b1047=_(_0x53cbf1)['map'](function(_0x40cef9){if(_0x40cef9['autoAssociation']===0x1)return;return _0x40cef9[_0x074d('0x3f')]===_0x074d('0x2b')?'agent':_0x074d('0x2d');})[_0x074d('0x90')]()[_0x074d('0x2f')]();for(var _0x1810e0=0x0;_0x1810e0<_0x2cf749[_0x074d('0x4a')];_0x1810e0++){if(!_[_0x074d('0x30')](_0x1b1047,_0x2cf749[_0x1810e0][_0x074d('0x28')]))return;var _0x565665=_0x2cf749[_0x1810e0][_0x074d('0x28')]==='agent'?_0x074d('0x2b'):'Telephones';_0x50dadb[_0x074d('0x47')](db[_0x074d('0x32')][_0x074d('0x86')]({'name':_0x2cf749[_0x1810e0][_0x074d('0x3f')],'resourceId':_0x2cf749[_0x1810e0]['id'],'type':_0x565665,'sectionId':_['find'](_0x53cbf1,[_0x074d('0x3f'),_0x565665])['id']},{}));}return BPromise[_0x074d('0x5e')](_0x50dadb);});})[_0x074d('0x25')](respondWithResult(_0x129e91,0xc9))[_0x074d('0x1d')](handleError(_0x129e91,null));};exports['changePassword']=function(_0x1b6476,_0x35a8ae){if(_0x1b6476[_0x074d('0x60')]['id']){delete _0x1b6476[_0x074d('0x60')]['id'];}return db[_0x074d('0x38')]['find']({'where':{'id':_0x1b6476['params']['id']}})[_0x074d('0x25')](function(_0x549c47){if(!_0x549c47)return null;if(_0x549c47['id']===_0x1b6476['user']['id']){if(!_0x1b6476[_0x074d('0x60')][_0x074d('0x91')]||!_0x1b6476[_0x074d('0x60')][_0x074d('0x92')]){throw new db['Sequelize'][(_0x074d('0x93'))](_0x074d('0x94'));}if(!_0x549c47[_0x074d('0x95')](_0x1b6476[_0x074d('0x60')][_0x074d('0x91')])){throw new db[(_0x074d('0x96'))][(_0x074d('0x93'))](_0x074d('0x97'));}if(_0x1b6476[_0x074d('0x60')][_0x074d('0x91')]===_0x1b6476[_0x074d('0x60')][_0x074d('0x92')]){throw new db[(_0x074d('0x96'))][(_0x074d('0x93'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x1b6476[_0x074d('0x2a')][_0x074d('0x28')]===_0x074d('0x82')){if(!_0x1b6476[_0x074d('0x60')][_0x074d('0x92')]){throw new db['Sequelize'][(_0x074d('0x93'))](_0x074d('0x98'));}}else if(_0x1b6476[_0x074d('0x2a')][_0x074d('0x28')]==='user'){if(!_0x1b6476[_0x074d('0x60')]['newPassword']){throw new db[(_0x074d('0x96'))][(_0x074d('0x93'))](_0x074d('0x98'));}if(_0x549c47[_0x074d('0x28')]!==_0x074d('0x2c')){throw new db['Sequelize'][(_0x074d('0x93'))]('Unauthorized');}}else{throw new db[(_0x074d('0x96'))][(_0x074d('0x93'))]('Unauthorized');}return _0x549c47;})[_0x074d('0x25')](handleEntityNotFound(_0x35a8ae,null))[_0x074d('0x25')](function(_0xefb383){return db['Setting'][_0x074d('0x99')]({'attributes':['id',_0x074d('0x69'),_0x074d('0x9a'),_0x074d('0x9b')]})[_0x074d('0x25')](function(_0x73322b){if(_0x73322b[_0x074d('0x69')])authService[_0x074d('0x9c')](_0x1b6476[_0x074d('0x60')][_0x074d('0x92')]);if(!_0x73322b[_0x074d('0x9a')]||!_0xefb383['previousPasswords'])return _0xefb383;authService['validatePasswordHistory'](_0x1b6476[_0x074d('0x60')][_0x074d('0x92')],_0xefb383['previousPasswords'],_0x73322b[_0x074d('0x9b')]);return _0xefb383;})[_0x074d('0x25')](saveUpdates({'password':_0x1b6476[_0x074d('0x60')]['newPassword'],'passwordResetAt':_0x1b6476['user']['id']==_0x1b6476[_0x074d('0x63')]['id']?moment():null,'previousPasswords':authService[_0x074d('0x9d')](_0x1b6476['body'][_0x074d('0x92')],_0xefb383[_0x074d('0x9e')])},null));})[_0x074d('0x25')](respondWithResult(_0x35a8ae,null))[_0x074d('0x1d')](handleError(_0x35a8ae,null));};exports['addQueues']=function(_0x1bb222,_0x4c88e0){var _0xb1867d=_0x1bb222[_0x074d('0x60')]['channel'];return db[_0x074d('0x38')][_0x074d('0x31')]({'where':{'id':_0x1bb222[_0x074d('0x63')]['id']},'attributes':['id',_0x074d('0x3f'),'role',_0x074d('0x9f'),_0x074d('0xa0'),_0x074d('0xa1'),_0x074d('0xa2')]})[_0x074d('0x25')](handleEntityNotFound(_0x4c88e0,null))['then'](function(_0x2c53ec){if(_0x2c53ec){if(!utils[_0x074d('0xa3')](_0xb1867d)){throw new db[(_0x074d('0x96'))][(_0x074d('0x93'))](_0x074d('0xa4'));}return _0x2c53ec['add'+_[_0x074d('0xa5')](_0xb1867d[_0x074d('0xa6')]())+'Queues'](_0x1bb222[_0x074d('0x60')][_0x074d('0x64')],{'penalty':_0x1bb222['body']['penalty']||0x0})[_0x074d('0xa7')](function(_0x470b01){for(var _0x2f70c6=0x0;_0x2f70c6<_0x1bb222[_0x074d('0x60')]['ids'][_0x074d('0x4a')];_0x2f70c6+=0x1){var _0x6e123e={'UserId':Number(_0x1bb222[_0x074d('0x63')]['id'])};_0x6e123e[_[_0x074d('0xa5')](_0xb1867d[_0x074d('0xa6')]())+_0x074d('0xa8')]=Number(_0x1bb222[_0x074d('0x60')][_0x074d('0x64')][_0x2f70c6]);socket['emit'](_0x074d('0x2a')+_['capitalize'](_0xb1867d[_0x074d('0xa6')]())+_0x074d('0xa9'),_0x6e123e);}return _0x470b01;})[_0x074d('0x25')](function(){if(_0xb1867d===_0x074d('0xaa')){return db['VoiceQueue'][_0x074d('0x48')]({'where':{'id':_0x1bb222['body'][_0x074d('0x64')]||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x49b247){var _0x11674d=_0x2c53ec['get']({'plain':!![]});var _0x4e85bf=[];if(_0xb1867d==='voice'&&_0x11674d['role']==='agent'&&_0x11674d[_0x074d('0x9f')]){for(var _0x35db89=0x0;_0x35db89<_0x49b247[_0x074d('0x4a')];_0x35db89+=0x1){_0x4e85bf[_0x074d('0x47')]({'membername':_0x11674d[_0x074d('0x3f')],'UserId':_0x11674d['id'],'queue_name':_0x49b247[_0x35db89][_0x074d('0x3f')],'VoiceQueueId':_0x49b247[_0x35db89]['id'],'interface':_[_0x074d('0x6b')](_0x11674d[_0x074d('0xa2')])?util['format']('SIP/%s',_0x11674d[_0x074d('0x3f')]):_0x11674d[_0x074d('0xa2')],'paused':_0x11674d[_0x074d('0xa1')]||![],'penalty':_0x1bb222[_0x074d('0x60')]['penalty']||0x0});}return BPromise[_0x074d('0x8f')](_0x4e85bf,function(_0x1c5eb7){return db[_0x074d('0xab')]['upsert'](_0x1c5eb7);});}return _0x2c53ec;});}})[_0x074d('0x25')](respondWithStatusCode(_0x4c88e0,null))['catch'](handleError(_0x4c88e0,null));};exports['removeQueues']=function(_0x38e226,_0x52e45f){var _0x5b0235,_0x2f23db;return db[_0x074d('0x38')][_0x074d('0x31')]({'where':{'id':_0x38e226[_0x074d('0x63')]['id']},'attributes':['id',_0x074d('0x3f'),_0x074d('0x28')]})[_0x074d('0x25')](handleEntityNotFound(_0x52e45f,null))['then'](function(_0x5cc88a){if(_0x5cc88a){_0x5b0235=_0x5cc88a;if(!_0x38e226[_0x074d('0x42')][_0x074d('0xac')]||!utils[_0x074d('0xa3')](_0x38e226[_0x074d('0x42')]['channel'])){throw new db[(_0x074d('0x96'))]['ValidationError'](_0x074d('0xa4'));}return _0x5cc88a['remove'+_[_0x074d('0xa5')](_0x38e226[_0x074d('0x42')][_0x074d('0xac')][_0x074d('0xa6')]())+'Queues'](_0x38e226[_0x074d('0x42')][_0x074d('0x64')]);}})[_0x074d('0x25')](function(_0x3598cb){if(_['isArray'](_0x38e226[_0x074d('0x42')][_0x074d('0x64')])){for(var _0x42d43d=0x0;_0x42d43d<_0x38e226[_0x074d('0x42')][_0x074d('0x64')][_0x074d('0x4a')];_0x42d43d+=0x1){_0x2f23db={'UserId':Number(_0x38e226[_0x074d('0x63')]['id'])};_0x2f23db[_[_0x074d('0xa5')](_0x38e226['query'][_0x074d('0xac')][_0x074d('0xa6')]())+_0x074d('0xa8')]=Number(_0x38e226['query'][_0x074d('0x64')][_0x42d43d]);socket['emit'](_0x074d('0x2a')+_['capitalize'](_0x38e226[_0x074d('0x42')][_0x074d('0xac')]['toLowerCase']())+_0x074d('0xad'),_0x2f23db);}}else{_0x2f23db={'UserId':Number(_0x38e226[_0x074d('0x63')]['id'])};_0x2f23db[_[_0x074d('0xa5')](_0x38e226[_0x074d('0x42')][_0x074d('0xac')][_0x074d('0xa6')]())+_0x074d('0xa8')]=Number(_0x38e226[_0x074d('0x42')][_0x074d('0x64')]);socket[_0x074d('0xae')]('user'+_['capitalize'](_0x38e226[_0x074d('0x42')][_0x074d('0xac')][_0x074d('0xa6')]())+_0x074d('0xad'),_0x2f23db);}return _0x3598cb;})[_0x074d('0x25')](function(){if(_0x38e226[_0x074d('0x42')][_0x074d('0xac')]===_0x074d('0xaa')){return db[_0x074d('0xab')][_0x074d('0x26')]({'where':{'UserId':_0x38e226[_0x074d('0x63')]['id'],'VoiceQueueId':_0x38e226[_0x074d('0x42')]['ids']},'individualHooks':!![]})[_0x074d('0x25')](function(){return _0x5b0235;});}return _0x5b0235;})[_0x074d('0x25')](respondWithStatusCode(_0x52e45f,null))[_0x074d('0x1d')](handleError(_0x52e45f,null));};exports[_0x074d('0xaf')]=function(_0x16d91f,_0x1ec4b8){_0x16d91f['body'][_0x074d('0xb0')]=_0x16d91f[_0x074d('0xb1')][_0x074d('0xb2')];return db[_0x074d('0x38')][_0x074d('0x31')]({'where':{'id':_0x16d91f[_0x074d('0x63')]['id']}})['then'](handleEntityNotFound(_0x1ec4b8,null))[_0x074d('0x25')](saveUpdates(_0x16d91f[_0x074d('0x60')],null))[_0x074d('0x25')](respondWithResult(_0x1ec4b8,null))[_0x074d('0x1d')](handleError(_0x1ec4b8,null));};exports[_0x074d('0xb3')]=function(_0x79f25b,_0x2cd51c){var _0xb5a1a3=path[_0x074d('0xb4')](config[_0x074d('0xb5')],_0x074d('0xb6'));return db['User'][_0x074d('0x31')]({'where':{'id':_0x79f25b[_0x074d('0x63')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x2cd51c,null))[_0x074d('0x25')](function(_0x20561f){if(_0x20561f){if(_[_0x074d('0x6b')](_0x20561f[_0x074d('0xb0')])){return _0x2cd51c['download'](_0xb5a1a3);}else{if(!fs[_0x074d('0xb7')](path[_0x074d('0xb4')](config[_0x074d('0xb5')],_0x074d('0xb8'),_0x20561f['userpic']))){return _0x2cd51c[_0x074d('0xb9')](_0xb5a1a3);}return _0x2cd51c[_0x074d('0xb9')](path['join'](config[_0x074d('0xb5')],_0x074d('0xb8'),_0x20561f[_0x074d('0xb0')]));}}})[_0x074d('0x1d')](handleError(_0x2cd51c,null));};exports[_0x074d('0xba')]=function(_0x25cd7b,_0x39922f){return db[_0x074d('0x38')]['find']({'where':{'id':_0x25cd7b[_0x074d('0x63')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x39922f,null))[_0x074d('0x25')](function(_0xdd486){var _0x813be7=[];values=_0xdd486[_0x074d('0x4b')];_0x813be7[_0x074d('0x47')](get_open_tabs(_0x074d('0x5d'),_0xdd486[_0x074d('0x4b')]));_0x813be7[_0x074d('0x47')](get_open_tabs(_0x074d('0x4c'),_0xdd486[_0x074d('0x4b')]));_0x813be7[_0x074d('0x47')](get_open_tabs('openchannel',_0xdd486[_0x074d('0x4b')]));_0x813be7['push'](get_open_tabs(_0x074d('0x50'),_0xdd486[_0x074d('0x4b')]));_0x813be7[_0x074d('0x47')](get_open_tabs(_0x074d('0x4d'),_0xdd486['dataValues']));_0x813be7[_0x074d('0x47')](get_open_tabs('mail',_0xdd486[_0x074d('0x4b')]));return BPromise[_0x074d('0x5e')](_0x813be7);})[_0x074d('0x25')](function(_0x3c6292){if(_0x3c6292){var _0xfeb2bb=_['map'](values[_0x074d('0xbb')],function(_0x34d479){return{'channel':'CHAT','id':_0x34d479['id'],'createdAt':_0x34d479[_0x074d('0xbc')]};});var _0xef6ab5=_[_0x074d('0xbd')](values['FaxOpenTabs'],function(_0x5cb377){return{'channel':_0x074d('0xbe'),'id':_0x5cb377['id'],'createdAt':_0x5cb377[_0x074d('0xbc')]};});var _0xabd600=_['map'](values['OpenchannelOpenTabs'],function(_0x54fb3e){return{'channel':_0x074d('0xbf'),'id':_0x54fb3e['id'],'createdAt':_0x54fb3e[_0x074d('0xbc')]};});var _0x159dfe=_[_0x074d('0xbd')](values['MailOpenTabs'],function(_0x1344ac){return{'channel':_0x074d('0xc0'),'id':_0x1344ac['id'],'createdAt':_0x1344ac[_0x074d('0xbc')]};});var _0xc33ce2=_[_0x074d('0xbd')](values[_0x074d('0xc1')],function(_0x306122){return{'channel':_0x074d('0xc2'),'id':_0x306122['id'],'createdAt':_0x306122[_0x074d('0xbc')]};});var _0x4dbabd=_[_0x074d('0xbd')](values[_0x074d('0xc3')],function(_0x1dad04){return{'channel':_0x074d('0xc4'),'id':_0x1dad04['id'],'createdAt':_0x1dad04[_0x074d('0xbc')]};});var _0x219712=_['concat'](_0xfeb2bb,_0xef6ab5,_0xabd600,_0x159dfe,_0xc33ce2,_0x4dbabd);var _0x4f511a={'count':_0x219712['length'],'rows':_0x219712};return _0x4f511a;}else return null;})[_0x074d('0x25')](respondWithResult(_0x39922f,null))[_0x074d('0x1d')](handleError(_0x39922f,null));};exports[_0x074d('0xc5')]=function(_0x5f3e42,_0x25812c){var _0x46879d={};var _0x3896c2={};var _0x33f9ec;var _0xf5040d;return db[_0x074d('0x38')][_0x074d('0x99')]({'where':{'id':_0x5f3e42[_0x074d('0x63')]['id']}})['then'](handleEntityNotFound(_0x25812c,null))[_0x074d('0x25')](function(_0x23b883){if(_0x23b883){_0x33f9ec=_0x23b883;_0x3896c2[_0x074d('0x56')]=_['keys'](db['CmContact'][_0x074d('0x39')]);_0x3896c2['query']=_[_0x074d('0x53')](_0x5f3e42['query']);_0x3896c2[_0x074d('0x54')]=_['intersection'](_0x3896c2[_0x074d('0x56')],_0x3896c2[_0x074d('0x42')]);_0x46879d[_0x074d('0x46')]=_['intersection'](_0x3896c2[_0x074d('0x56')],qs[_0x074d('0x57')](_0x5f3e42[_0x074d('0x42')][_0x074d('0x57')]));_0x46879d[_0x074d('0x46')]=_0x46879d[_0x074d('0x46')][_0x074d('0x4a')]?_0x46879d[_0x074d('0x46')]:_0x3896c2[_0x074d('0x56')];_0x46879d[_0x074d('0xc6')]=qs[_0x074d('0xc7')](_0x5f3e42[_0x074d('0x42')][_0x074d('0xc7')]);_0x46879d[_0x074d('0x41')]=qs[_0x074d('0x54')](_[_0x074d('0xc8')](_0x5f3e42[_0x074d('0x42')],_0x3896c2[_0x074d('0x54')]));if(_0x5f3e42[_0x074d('0x42')]['filter']){_0x46879d[_0x074d('0x41')]=_['merge'](_0x46879d['where'],{'$or':_['map'](_0x46879d[_0x074d('0x46')],function(_0x443a00){var _0x1d7d1e={};_0x1d7d1e[_0x443a00]={'$like':'%'+_0x5f3e42[_0x074d('0x42')][_0x074d('0x3c')]+'%'};return _0x1d7d1e;})});}_0x46879d=_[_0x074d('0x5a')]({},_0x46879d,_0x5f3e42[_0x074d('0x5b')]);return _0x33f9ec[_0x074d('0xc5')](_0x46879d);}})[_0x074d('0x25')](function(_0xa273fd){if(_0xa273fd){_0xf5040d=_0xa273fd[_0x074d('0x4a')];if(_0x5f3e42[_0x074d('0x42')][_0x074d('0xc9')](_0x074d('0x43'))){_0x46879d[_0x074d('0x58')]=[{'model':db[_0x074d('0xca')],'as':_0x074d('0xcb'),'required':![]},{'model':db['Tag'],'as':_0x074d('0xcc'),'attributes':['id',_0x074d('0x3f'),_0x074d('0xcd')],'where':_0x5f3e42['query'][_0x074d('0xce')]?{'id':_0x5f3e42[_0x074d('0x42')][_0x074d('0xce')]}:undefined,'required':_0x5f3e42[_0x074d('0x42')][_0x074d('0xce')]?!![]:![]}];}if(!_0x5f3e42[_0x074d('0x42')][_0x074d('0xc9')](_0x074d('0xcf'))){_0x46879d['limit']=qs[_0x074d('0x20')](_0x5f3e42['query'][_0x074d('0x20')]);_0x46879d[_0x074d('0x1f')]=qs['offset'](_0x5f3e42[_0x074d('0x42')][_0x074d('0x1f')]);}return _0x33f9ec[_0x074d('0xc5')](_0x46879d);}})['then'](function(_0xf27b07){if(_0xf27b07){return _0xf27b07?{'count':_0xf5040d,'rows':_0xf27b07}:null;}})[_0x074d('0x25')](respondWithResult(_0x25812c,null))[_0x074d('0x1d')](handleError(_0x25812c,null));};exports['getQueues']=function(_0x473c07,_0x3d6c74){var _0x4342cf;var _0x510399={};var _0x1a1d3e;return db['User'][_0x074d('0x99')]({'where':{'id':_0x473c07[_0x074d('0x63')]['id']},'attributes':['id',_0x074d('0x3f'),_0x074d('0x28')]})[_0x074d('0x25')](handleEntityNotFound(_0x3d6c74,null))['then'](function(_0x451f2a){if(!utils['isValidChannel'](_0x473c07[_0x074d('0x42')][_0x074d('0xac')])){throw new db['Sequelize'][(_0x074d('0x93'))](_0x074d('0xa4'));}_0x4342cf=_0x451f2a;var _0x241252={};_0x241252[_0x074d('0x56')]=_['keys'](db[_[_0x074d('0xa5')](_0x473c07[_0x074d('0x42')]['channel'])+_0x074d('0xd0')][_0x074d('0x39')]);_0x241252[_0x074d('0x42')]=_[_0x074d('0x53')](_0x473c07[_0x074d('0x42')]);_0x241252['filters']=_[_0x074d('0x55')](_0x241252['model'],_0x241252[_0x074d('0x42')]);_0x510399[_0x074d('0x46')]=_['intersection'](_0x241252[_0x074d('0x56')],qs['fields'](_0x473c07[_0x074d('0x42')]['fields']));_0x510399['attributes']=_0x510399[_0x074d('0x46')][_0x074d('0x4a')]?_0x510399[_0x074d('0x46')]:_0x241252[_0x074d('0x56')];_0x510399[_0x074d('0xc6')]=qs[_0x074d('0xc7')](_0x473c07[_0x074d('0x42')][_0x074d('0xc7')]);_0x510399[_0x074d('0x41')]=qs[_0x074d('0x54')](_[_0x074d('0xc8')](_0x473c07['query'],_0x241252[_0x074d('0x54')]));if(_0x473c07[_0x074d('0x42')][_0x074d('0x3c')]){_0x510399['where']=_['merge'](_0x510399['where'],{'$or':_[_0x074d('0xbd')](_0x510399['attributes'],function(_0x3da355){var _0x56a68d={};_0x56a68d[_0x3da355]={'$like':'%'+_0x473c07[_0x074d('0x42')][_0x074d('0x3c')]+'%'};return _0x56a68d;})});}_0x510399=_[_0x074d('0x5a')]({},_0x510399,_0x473c07['options']);switch(_0x4342cf[_0x074d('0x28')]){case _0x074d('0x82'):return db[_[_0x074d('0xa5')](_0x473c07[_0x074d('0x42')][_0x074d('0xac')])+_0x074d('0xd0')][_0x074d('0x48')](_0x510399);case _0x074d('0x2a'):case _0x074d('0x2c'):return _0x4342cf[_0x074d('0x27')+_[_0x074d('0xa5')](_0x473c07['query'][_0x074d('0xac')])+_0x074d('0xd1')](_0x510399);default:throw new db[(_0x074d('0x96'))][(_0x074d('0x93'))](_0x074d('0xd2'));}})['then'](function(_0x2fd537){_0x1a1d3e=_0x2fd537[_0x074d('0x4a')];if(!_0x473c07[_0x074d('0x42')][_0x074d('0xc9')](_0x074d('0xcf'))){_0x510399[_0x074d('0x20')]=qs[_0x074d('0x20')](_0x473c07[_0x074d('0x42')][_0x074d('0x20')]);_0x510399['offset']=qs[_0x074d('0x1f')](_0x473c07[_0x074d('0x42')][_0x074d('0x1f')]);}switch(_0x4342cf[_0x074d('0x28')]){case'admin':return db[_[_0x074d('0xa5')](_0x473c07[_0x074d('0x42')][_0x074d('0xac')])+_0x074d('0xd0')][_0x074d('0x48')](_0x510399);case _0x074d('0x2a'):case _0x074d('0x2c'):return _0x4342cf[_0x074d('0x27')+_[_0x074d('0xa5')](_0x473c07['query']['channel'])+_0x074d('0xd1')](_0x510399);}})['then'](function(_0x2ee63e){return{'count':_0x1a1d3e,'rows':_0x2ee63e};})[_0x074d('0x25')](respondWithResult(_0x3d6c74,null))[_0x074d('0x1d')](handleError(_0x3d6c74,null));};exports['getVoiceQueuesRt']=function(_0x434a17,_0x28ec72){var _0x29e2a1={};var _0x5aef7c={};var _0x12b6d5;var _0x63c3b2;return db[_0x074d('0x38')]['findOne']({'where':{'id':_0x434a17['params']['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x28ec72,null))[_0x074d('0x25')](function(_0x1a2049){if(_0x1a2049){_0x12b6d5=_0x1a2049;_0x5aef7c[_0x074d('0x56')]=_[_0x074d('0x53')](db['UserVoiceQueueRt'][_0x074d('0x39')]);_0x5aef7c[_0x074d('0x42')]=_[_0x074d('0x53')](_0x434a17[_0x074d('0x42')]);_0x5aef7c[_0x074d('0x54')]=_[_0x074d('0x55')](_0x5aef7c[_0x074d('0x56')],_0x5aef7c[_0x074d('0x42')]);_0x29e2a1[_0x074d('0x46')]=_[_0x074d('0x55')](_0x5aef7c[_0x074d('0x56')],qs[_0x074d('0x57')](_0x434a17[_0x074d('0x42')][_0x074d('0x57')]));_0x29e2a1[_0x074d('0x46')]=_0x29e2a1[_0x074d('0x46')][_0x074d('0x4a')]?_0x29e2a1[_0x074d('0x46')]:_0x5aef7c[_0x074d('0x56')];_0x29e2a1[_0x074d('0xc6')]=qs[_0x074d('0xc7')](_0x434a17[_0x074d('0x42')]['sort']);_0x29e2a1[_0x074d('0x41')]=qs[_0x074d('0x54')](_[_0x074d('0xc8')](_0x434a17[_0x074d('0x42')],_0x5aef7c[_0x074d('0x54')]));if(_0x434a17[_0x074d('0x42')][_0x074d('0x3c')]){_0x29e2a1['where']=_[_0x074d('0x5a')](_0x29e2a1[_0x074d('0x41')],{'$or':_[_0x074d('0xbd')](_0x29e2a1[_0x074d('0x46')],function(_0x5bc2ce){var _0x41ecfc={};_0x41ecfc[_0x5bc2ce]={'$like':'%'+_0x434a17[_0x074d('0x42')]['filter']+'%'};return _0x41ecfc;})});}_0x29e2a1=_['merge']({},_0x29e2a1,_0x434a17[_0x074d('0x5b')]);return _0x12b6d5['getVoiceQueuesRt'](_0x29e2a1);}})[_0x074d('0x25')](function(_0x107b42){if(_0x107b42){_0x63c3b2=_0x107b42[_0x074d('0x4a')];if(!_0x434a17[_0x074d('0x42')][_0x074d('0xc9')](_0x074d('0xcf'))){_0x29e2a1[_0x074d('0x20')]=qs[_0x074d('0x20')](_0x434a17['query'][_0x074d('0x20')]);_0x29e2a1[_0x074d('0x1f')]=qs[_0x074d('0x1f')](_0x434a17[_0x074d('0x42')][_0x074d('0x1f')]);}return _0x12b6d5[_0x074d('0xd3')](_0x29e2a1);}})[_0x074d('0x25')](function(_0x2ddf62){if(_0x2ddf62){return _0x2ddf62?{'count':_0x63c3b2,'rows':_0x2ddf62}:null;}})[_0x074d('0x25')](respondWithResult(_0x28ec72,null))[_0x074d('0x1d')](handleError(_0x28ec72,null));};exports[_0x074d('0xd4')]=function(_0x352390,_0x2bcc7f){var _0x3a1673={};var _0x4ef721={};var _0x16de18;var _0x2a88b8;return db[_0x074d('0x38')]['findOne']({'where':{'id':_0x352390[_0x074d('0x63')]['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x2bcc7f,null))[_0x074d('0x25')](function(_0x4bfb39){if(_0x4bfb39){_0x16de18=_0x4bfb39;_0x4ef721[_0x074d('0x56')]=_['keys'](db['ChatGroup'][_0x074d('0x39')]);_0x4ef721[_0x074d('0x42')]=_[_0x074d('0x53')](_0x352390['query']);_0x4ef721[_0x074d('0x54')]=_[_0x074d('0x55')](_0x4ef721[_0x074d('0x56')],_0x4ef721['query']);_0x3a1673['attributes']=_[_0x074d('0x55')](_0x4ef721[_0x074d('0x56')],qs['fields'](_0x352390[_0x074d('0x42')][_0x074d('0x57')]));_0x3a1673[_0x074d('0x46')]=_0x3a1673[_0x074d('0x46')]['length']?_0x3a1673[_0x074d('0x46')]:_0x4ef721[_0x074d('0x56')];_0x3a1673[_0x074d('0xc6')]=qs[_0x074d('0xc7')](_0x352390[_0x074d('0x42')][_0x074d('0xc7')]);_0x3a1673[_0x074d('0x41')]=qs[_0x074d('0x54')](_[_0x074d('0xc8')](_0x352390[_0x074d('0x42')],_0x4ef721[_0x074d('0x54')]));if(_0x352390['query']['filter']){_0x3a1673[_0x074d('0x41')]=_[_0x074d('0x5a')](_0x3a1673[_0x074d('0x41')],{'$or':_['map'](_0x3a1673[_0x074d('0x46')],function(_0x39b6a3){var _0xba551d={};_0xba551d[_0x39b6a3]={'$like':'%'+_0x352390[_0x074d('0x42')][_0x074d('0x3c')]+'%'};return _0xba551d;})});}_0x3a1673=_['merge']({},_0x3a1673,_0x352390[_0x074d('0x5b')]);return _0x16de18[_0x074d('0xd4')](_0x3a1673);}})[_0x074d('0x25')](function(_0x3711d6){if(_0x3711d6){_0x2a88b8=_0x3711d6[_0x074d('0x4a')];if(!_0x352390[_0x074d('0x42')][_0x074d('0xc9')](_0x074d('0xcf'))){_0x3a1673[_0x074d('0x20')]=qs[_0x074d('0x20')](_0x352390[_0x074d('0x42')][_0x074d('0x20')]);_0x3a1673[_0x074d('0x1f')]=qs[_0x074d('0x1f')](_0x352390['query'][_0x074d('0x1f')]);}return _0x16de18[_0x074d('0xd4')](_0x3a1673);}})[_0x074d('0x25')](function(_0x38496f){if(_0x38496f){return _0x38496f?{'count':_0x2a88b8,'rows':_0x38496f}:null;}})[_0x074d('0x25')](respondWithResult(_0x2bcc7f,null))[_0x074d('0x1d')](handleError(_0x2bcc7f,null));};exports[_0x074d('0xd5')]=function(_0xb0aba0,_0x24b72a){var _0x144709={'raw':!![],'where':{}};var _0x42b9b9={};var _0x5881ba={'count':0x0,'rows':[]};return db[_0x074d('0x38')]['findOne']({'where':{'id':_0xb0aba0[_0x074d('0x63')]['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x24b72a,null))[_0x074d('0x25')](function(_0x1af09e){if(_0x1af09e){_0x42b9b9[_0x074d('0x56')]=_[_0x074d('0x53')](db[_0x074d('0xd6')][_0x074d('0x39')]);_0x42b9b9[_0x074d('0x42')]=_[_0x074d('0x53')](_0xb0aba0[_0x074d('0x42')]);_0x42b9b9['filters']=_[_0x074d('0x55')](_0x42b9b9[_0x074d('0x56')],_0x42b9b9[_0x074d('0x42')]);_0x144709['attributes']=_['intersection'](_0x42b9b9[_0x074d('0x56')],qs[_0x074d('0x57')](_0xb0aba0[_0x074d('0x42')]['fields']));_0x144709[_0x074d('0x46')]=_0x144709['attributes'][_0x074d('0x4a')]?_0x144709['attributes']:_0x42b9b9[_0x074d('0x56')];if(!_0xb0aba0[_0x074d('0x42')]['hasOwnProperty'](_0x074d('0xcf'))){_0x144709[_0x074d('0x20')]=qs[_0x074d('0x20')](_0xb0aba0[_0x074d('0x42')][_0x074d('0x20')]);_0x144709['offset']=qs[_0x074d('0x1f')](_0xb0aba0[_0x074d('0x42')][_0x074d('0x1f')]);}_0x144709[_0x074d('0xc6')]=qs[_0x074d('0xc7')](_0xb0aba0[_0x074d('0x42')]['sort']);_0x144709[_0x074d('0x41')]=qs['filters'](_[_0x074d('0xc8')](_0xb0aba0['query'],_0x42b9b9[_0x074d('0x54')]));_0x144709['where'][_0x074d('0xd7')]=_0x1af09e['id'];if(_0xb0aba0[_0x074d('0x42')][_0x074d('0x3c')]){_0x144709[_0x074d('0x41')]=_['merge'](_0x144709['where'],{'$or':_[_0x074d('0xbd')](_0x144709[_0x074d('0x46')],function(_0x149525){var _0x962205={};_0x962205[_0x149525]={'$like':'%'+_0xb0aba0[_0x074d('0x42')][_0x074d('0x3c')]+'%'};return _0x962205;})});}_0x144709=_[_0x074d('0x5a')]({},_0x144709,_0xb0aba0[_0x074d('0x5b')]);return db[_0x074d('0xd6')][_0x074d('0x22')]({'where':_0x144709[_0x074d('0x41')]})[_0x074d('0x25')](function(_0x6becd0){_0x5881ba[_0x074d('0x22')]=_0x6becd0;if(_0xb0aba0[_0x074d('0x42')][_0x074d('0x43')]){_0x144709[_0x074d('0x58')]=[{'all':!![]}];}return db[_0x074d('0xd6')][_0x074d('0x48')](_0x144709);})['then'](function(_0x50bedc){_0x5881ba[_0x074d('0x49')]=_0x50bedc;return _0x5881ba;});}})[_0x074d('0x25')](respondWithFilteredResult(_0x24b72a,_0x144709))['catch'](handleError(_0x24b72a,null));};exports[_0x074d('0xd8')]=function(_0x168b7a,_0x43477d){var _0x28cc76={'raw':!![],'where':{}};var _0x36befe={};var _0x176a33={'count':0x0,'rows':[]};return db[_0x074d('0x38')]['findOne']({'where':{'id':_0x168b7a[_0x074d('0x63')]['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x43477d,null))[_0x074d('0x25')](function(_0x3b7ce9){if(_0x3b7ce9){_0x36befe[_0x074d('0x56')]=_[_0x074d('0x53')](db[_0x074d('0xd9')]['rawAttributes']);_0x36befe['query']=_[_0x074d('0x53')](_0x168b7a['query']);_0x36befe[_0x074d('0x54')]=_[_0x074d('0x55')](_0x36befe[_0x074d('0x56')],_0x36befe[_0x074d('0x42')]);_0x28cc76[_0x074d('0x46')]=_['intersection'](_0x36befe[_0x074d('0x56')],qs[_0x074d('0x57')](_0x168b7a[_0x074d('0x42')]['fields']));_0x28cc76[_0x074d('0x46')]=_0x28cc76[_0x074d('0x46')][_0x074d('0x4a')]?_0x28cc76['attributes']:_0x36befe[_0x074d('0x56')];if(!_0x168b7a['query'][_0x074d('0xc9')](_0x074d('0xcf'))){_0x28cc76[_0x074d('0x20')]=qs[_0x074d('0x20')](_0x168b7a[_0x074d('0x42')][_0x074d('0x20')]);_0x28cc76[_0x074d('0x1f')]=qs['offset'](_0x168b7a[_0x074d('0x42')][_0x074d('0x1f')]);}_0x28cc76['order']=qs['sort'](_0x168b7a['query'][_0x074d('0xc7')]);_0x28cc76[_0x074d('0x41')]=qs[_0x074d('0x54')](_[_0x074d('0xc8')](_0x168b7a['query'],_0x36befe[_0x074d('0x54')]));_0x28cc76['where']['UserId']=_0x3b7ce9['id'];if(_0x168b7a[_0x074d('0x42')]['filter']){_0x28cc76['where']=_['merge'](_0x28cc76[_0x074d('0x41')],{'$or':_[_0x074d('0xbd')](_0x28cc76['attributes'],function(_0x251694){var _0x48b7ab={};_0x48b7ab[_0x251694]={'$like':'%'+_0x168b7a[_0x074d('0x42')][_0x074d('0x3c')]+'%'};return _0x48b7ab;})});}_0x28cc76=_['merge']({},_0x28cc76,_0x168b7a['options']);return db[_0x074d('0xd9')][_0x074d('0x22')]({'where':_0x28cc76['where']})['then'](function(_0x73acc9){_0x176a33[_0x074d('0x22')]=_0x73acc9;if(_0x168b7a[_0x074d('0x42')][_0x074d('0x43')]){_0x28cc76[_0x074d('0x58')]=[{'all':!![]}];}return db['ScreenRecording'][_0x074d('0x48')](_0x28cc76);})[_0x074d('0x25')](function(_0x3ab0c5){_0x176a33[_0x074d('0x49')]=_0x3ab0c5;return _0x176a33;});}})[_0x074d('0x25')](respondWithFilteredResult(_0x43477d,_0x28cc76))[_0x074d('0x1d')](handleError(_0x43477d,null));};exports['getChatInteractions']=function(_0x110a8d,_0x3addc3){var _0x51a410={};var _0x921e1d={};var _0x42927f;var _0x1923b0;return db[_0x074d('0x38')][_0x074d('0x99')]({'where':{'id':_0x110a8d[_0x074d('0x63')]['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x3addc3,null))['then'](function(_0x61c64c){if(_0x61c64c){_0x42927f=_0x61c64c;_0x921e1d[_0x074d('0x56')]=_[_0x074d('0x53')](db['ChatInteraction'][_0x074d('0x39')]);_0x921e1d[_0x074d('0x42')]=_[_0x074d('0x53')](_0x110a8d[_0x074d('0x42')]);_0x921e1d[_0x074d('0x54')]=_['intersection'](_0x921e1d['model'],_0x921e1d[_0x074d('0x42')]);_0x51a410['attributes']=_['intersection'](_0x921e1d[_0x074d('0x56')],qs[_0x074d('0x57')](_0x110a8d['query'][_0x074d('0x57')]));_0x51a410[_0x074d('0x46')]=_0x51a410[_0x074d('0x46')][_0x074d('0x4a')]?_0x51a410[_0x074d('0x46')]:_0x921e1d['model'];_0x51a410[_0x074d('0xc6')]=qs[_0x074d('0xc7')](_0x110a8d[_0x074d('0x42')][_0x074d('0xc7')]);_0x51a410[_0x074d('0x41')]=qs[_0x074d('0x54')](_[_0x074d('0xc8')](_0x110a8d['query'],_0x921e1d[_0x074d('0x54')]));if(_0x110a8d[_0x074d('0x42')][_0x074d('0x3c')]){_0x51a410['where']=_[_0x074d('0x5a')](_0x51a410['where'],{'$or':_[_0x074d('0xbd')](_0x51a410[_0x074d('0x46')],function(_0x4d7a1e){var _0x5d97a8={};_0x5d97a8[_0x4d7a1e]={'$like':'%'+_0x110a8d['query'][_0x074d('0x3c')]+'%'};return _0x5d97a8;})});}_0x51a410=_[_0x074d('0x5a')]({},_0x51a410,_0x110a8d['options']);return _0x42927f[_0x074d('0xda')](_0x51a410);}})[_0x074d('0x25')](function(_0x372204){if(_0x372204){_0x1923b0=_0x372204[_0x074d('0x4a')];if(!_0x110a8d[_0x074d('0x42')]['hasOwnProperty'](_0x074d('0xcf'))){_0x51a410['limit']=qs[_0x074d('0x20')](_0x110a8d['query'][_0x074d('0x20')]);_0x51a410[_0x074d('0x1f')]=qs[_0x074d('0x1f')](_0x110a8d[_0x074d('0x42')][_0x074d('0x1f')]);}return _0x42927f[_0x074d('0xda')](_0x51a410);}})[_0x074d('0x25')](function(_0xf83906){if(_0xf83906){return _0xf83906?{'count':_0x1923b0,'rows':_0xf83906}:null;}})[_0x074d('0x25')](respondWithResult(_0x3addc3,null))[_0x074d('0x1d')](handleError(_0x3addc3,null));};exports[_0x074d('0xdb')]=function(_0x2ca69b,_0x499073){var _0x44f59e={};var _0x1c3009={};var _0x3a448b;var _0x1b8a3b;return db['User']['findOne']({'where':{'id':_0x2ca69b[_0x074d('0x63')]['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x499073,null))[_0x074d('0x25')](function(_0x4bea71){if(_0x4bea71){_0x3a448b=_0x4bea71;_0x1c3009[_0x074d('0x56')]=_[_0x074d('0x53')](db['OpenchannelInteraction'][_0x074d('0x39')]);_0x1c3009[_0x074d('0x42')]=_[_0x074d('0x53')](_0x2ca69b[_0x074d('0x42')]);_0x1c3009[_0x074d('0x54')]=_[_0x074d('0x55')](_0x1c3009[_0x074d('0x56')],_0x1c3009[_0x074d('0x42')]);_0x44f59e[_0x074d('0x46')]=_[_0x074d('0x55')](_0x1c3009['model'],qs[_0x074d('0x57')](_0x2ca69b[_0x074d('0x42')][_0x074d('0x57')]));_0x44f59e[_0x074d('0x46')]=_0x44f59e[_0x074d('0x46')][_0x074d('0x4a')]?_0x44f59e[_0x074d('0x46')]:_0x1c3009[_0x074d('0x56')];_0x44f59e[_0x074d('0xc6')]=qs[_0x074d('0xc7')](_0x2ca69b['query'][_0x074d('0xc7')]);_0x44f59e[_0x074d('0x41')]=qs[_0x074d('0x54')](_[_0x074d('0xc8')](_0x2ca69b[_0x074d('0x42')],_0x1c3009[_0x074d('0x54')]));if(_0x2ca69b[_0x074d('0x42')][_0x074d('0x3c')]){_0x44f59e[_0x074d('0x41')]=_[_0x074d('0x5a')](_0x44f59e[_0x074d('0x41')],{'$or':_[_0x074d('0xbd')](_0x44f59e['attributes'],function(_0x1fcdbb){var _0x6fe55e={};_0x6fe55e[_0x1fcdbb]={'$like':'%'+_0x2ca69b['query'][_0x074d('0x3c')]+'%'};return _0x6fe55e;})});}_0x44f59e=_['merge']({},_0x44f59e,_0x2ca69b[_0x074d('0x5b')]);return _0x3a448b['getOpenchannelInteractions'](_0x44f59e);}})[_0x074d('0x25')](function(_0x459242){if(_0x459242){_0x1b8a3b=_0x459242['length'];if(!_0x2ca69b[_0x074d('0x42')][_0x074d('0xc9')]('nolimit')){_0x44f59e['limit']=qs[_0x074d('0x20')](_0x2ca69b['query'][_0x074d('0x20')]);_0x44f59e['offset']=qs[_0x074d('0x1f')](_0x2ca69b['query'][_0x074d('0x1f')]);}return _0x3a448b['getOpenchannelInteractions'](_0x44f59e);}})[_0x074d('0x25')](function(_0x1ab88f){if(_0x1ab88f){return _0x1ab88f?{'count':_0x1b8a3b,'rows':_0x1ab88f}:null;}})[_0x074d('0x25')](respondWithResult(_0x499073,null))[_0x074d('0x1d')](handleError(_0x499073,null));};exports[_0x074d('0xdc')]=function(_0xec2063,_0x295ed5){var _0x1d6939={'raw':!![],'where':{}};var _0x3495a3={};var _0x50c411={'count':0x0,'rows':[]};return db[_0x074d('0x38')][_0x074d('0x99')]({'where':{'id':_0xec2063[_0x074d('0x63')]['id']}})['then'](handleEntityNotFound(_0x295ed5,null))[_0x074d('0x25')](function(_0x4771f7){if(_0x4771f7){_0x3495a3[_0x074d('0x56')]=_['keys'](db[_0x074d('0xdd')]['rawAttributes']);_0x3495a3[_0x074d('0x42')]=_[_0x074d('0x53')](_0xec2063[_0x074d('0x42')]);_0x3495a3[_0x074d('0x54')]=_[_0x074d('0x55')](_0x3495a3[_0x074d('0x56')],_0x3495a3['query']);_0x1d6939[_0x074d('0x46')]=_[_0x074d('0x55')](_0x3495a3[_0x074d('0x56')],qs[_0x074d('0x57')](_0xec2063[_0x074d('0x42')][_0x074d('0x57')]));_0x1d6939[_0x074d('0x46')]=_0x1d6939[_0x074d('0x46')][_0x074d('0x4a')]?_0x1d6939[_0x074d('0x46')]:_0x3495a3[_0x074d('0x56')];if(!_0xec2063[_0x074d('0x42')]['hasOwnProperty'](_0x074d('0xcf'))){_0x1d6939['limit']=qs[_0x074d('0x20')](_0xec2063['query'][_0x074d('0x20')]);_0x1d6939[_0x074d('0x1f')]=qs[_0x074d('0x1f')](_0xec2063[_0x074d('0x42')][_0x074d('0x1f')]);}_0x1d6939[_0x074d('0xc6')]=qs[_0x074d('0xc7')](_0xec2063[_0x074d('0x42')][_0x074d('0xc7')]);_0x1d6939[_0x074d('0x41')]=qs[_0x074d('0x54')](_[_0x074d('0xc8')](_0xec2063[_0x074d('0x42')],_0x3495a3[_0x074d('0x54')]));_0x1d6939[_0x074d('0x41')][_0x074d('0xd7')]=_0x4771f7['id'];if(_0xec2063[_0x074d('0x42')]['filter']){_0x1d6939[_0x074d('0x41')]=_[_0x074d('0x5a')](_0x1d6939['where'],{'$or':_[_0x074d('0xbd')](_0x1d6939['attributes'],function(_0x19af51){var _0x1ce5f7={};_0x1ce5f7[_0x19af51]={'$like':'%'+_0xec2063[_0x074d('0x42')][_0x074d('0x3c')]+'%'};return _0x1ce5f7;})});}_0x1d6939=_[_0x074d('0x5a')]({},_0x1d6939,_0xec2063['options']);return db[_0x074d('0xdd')][_0x074d('0x22')]({'where':_0x1d6939[_0x074d('0x41')]})[_0x074d('0x25')](function(_0x5df6de){_0x50c411['count']=_0x5df6de;if(_0xec2063['query']['includeAll']){_0x1d6939[_0x074d('0x58')]=[{'all':!![]}];}return db[_0x074d('0xdd')][_0x074d('0x48')](_0x1d6939);})[_0x074d('0x25')](function(_0x196ed5){_0x50c411[_0x074d('0x49')]=_0x196ed5;return _0x50c411;});}})[_0x074d('0x25')](respondWithFilteredResult(_0x295ed5,_0x1d6939))[_0x074d('0x1d')](handleError(_0x295ed5,null));};exports[_0x074d('0xde')]=function(_0x3ac62a,_0x5c0e74){var _0x12292e={};var _0x4b5a55={};var _0x28ef6b;var _0x4f3426;return db['User'][_0x074d('0x99')]({'where':{'id':_0x3ac62a[_0x074d('0x63')]['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x5c0e74,null))[_0x074d('0x25')](function(_0x5401b7){if(_0x5401b7){_0x28ef6b=_0x5401b7;_0x4b5a55[_0x074d('0x56')]=_['keys'](db[_0x074d('0xdf')][_0x074d('0x39')]);_0x4b5a55[_0x074d('0x42')]=_[_0x074d('0x53')](_0x3ac62a[_0x074d('0x42')]);_0x4b5a55[_0x074d('0x54')]=_[_0x074d('0x55')](_0x4b5a55[_0x074d('0x56')],_0x4b5a55[_0x074d('0x42')]);_0x12292e[_0x074d('0x46')]=_[_0x074d('0x55')](_0x4b5a55[_0x074d('0x56')],qs[_0x074d('0x57')](_0x3ac62a[_0x074d('0x42')][_0x074d('0x57')]));_0x12292e[_0x074d('0x46')]=_0x12292e[_0x074d('0x46')]['length']?_0x12292e['attributes']:_0x4b5a55[_0x074d('0x56')];_0x12292e['order']=qs['sort'](_0x3ac62a[_0x074d('0x42')][_0x074d('0xc7')]);_0x12292e[_0x074d('0x41')]=qs['filters'](_[_0x074d('0xc8')](_0x3ac62a[_0x074d('0x42')],_0x4b5a55['filters']));if(_0x3ac62a[_0x074d('0x42')][_0x074d('0x3c')]){_0x12292e[_0x074d('0x41')]=_[_0x074d('0x5a')](_0x12292e['where'],{'$or':_[_0x074d('0xbd')](_0x12292e[_0x074d('0x46')],function(_0x2d7b82){var _0x5bfd7d={};_0x5bfd7d[_0x2d7b82]={'$like':'%'+_0x3ac62a[_0x074d('0x42')]['filter']+'%'};return _0x5bfd7d;})});}_0x12292e=_[_0x074d('0x5a')]({},_0x12292e,_0x3ac62a[_0x074d('0x5b')]);return _0x28ef6b[_0x074d('0xde')](_0x12292e);}})[_0x074d('0x25')](function(_0x5bc6f4){if(_0x5bc6f4){_0x4f3426=_0x5bc6f4[_0x074d('0x4a')];if(!_0x3ac62a['query'][_0x074d('0xc9')](_0x074d('0xcf'))){_0x12292e[_0x074d('0x20')]=qs['limit'](_0x3ac62a[_0x074d('0x42')]['limit']);_0x12292e['offset']=qs['offset'](_0x3ac62a['query']['offset']);}return _0x28ef6b[_0x074d('0xde')](_0x12292e);}})['then'](function(_0x1f8370){if(_0x1f8370){return _0x1f8370?{'count':_0x4f3426,'rows':_0x1f8370}:null;}})[_0x074d('0x25')](respondWithResult(_0x5c0e74,null))[_0x074d('0x1d')](handleError(_0x5c0e74,null));};exports[_0x074d('0xe0')]=function(_0xe5fcbb,_0x3a48b7){var _0x280553={};var _0x2e2a82={};var _0x4ee155;var _0x4f36c6;return db['User'][_0x074d('0x99')]({'where':{'id':_0xe5fcbb[_0x074d('0x63')]['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x3a48b7,null))[_0x074d('0x25')](function(_0x1867ad){if(_0x1867ad){_0x4ee155=_0x1867ad;_0x2e2a82[_0x074d('0x56')]=_[_0x074d('0x53')](db[_0x074d('0xe1')][_0x074d('0x39')]);_0x2e2a82[_0x074d('0x42')]=_['keys'](_0xe5fcbb['query']);_0x2e2a82[_0x074d('0x54')]=_['intersection'](_0x2e2a82[_0x074d('0x56')],_0x2e2a82['query']);_0x280553[_0x074d('0x46')]=_[_0x074d('0x55')](_0x2e2a82[_0x074d('0x56')],qs[_0x074d('0x57')](_0xe5fcbb[_0x074d('0x42')][_0x074d('0x57')]));_0x280553[_0x074d('0x46')]=_0x280553['attributes']['length']?_0x280553[_0x074d('0x46')]:_0x2e2a82[_0x074d('0x56')];_0x280553[_0x074d('0xc6')]=qs[_0x074d('0xc7')](_0xe5fcbb['query']['sort']);_0x280553[_0x074d('0x41')]=qs[_0x074d('0x54')](_['pick'](_0xe5fcbb[_0x074d('0x42')],_0x2e2a82[_0x074d('0x54')]));if(_0xe5fcbb[_0x074d('0x42')][_0x074d('0x3c')]){_0x280553[_0x074d('0x41')]=_[_0x074d('0x5a')](_0x280553['where'],{'$or':_[_0x074d('0xbd')](_0x280553[_0x074d('0x46')],function(_0x51a2a5){var _0x36be8b={};_0x36be8b[_0x51a2a5]={'$like':'%'+_0xe5fcbb[_0x074d('0x42')]['filter']+'%'};return _0x36be8b;})});}_0x280553=_[_0x074d('0x5a')]({},_0x280553,_0xe5fcbb[_0x074d('0x5b')]);return _0x4ee155[_0x074d('0xe0')](_0x280553);}})[_0x074d('0x25')](function(_0x4a1c6e){if(_0x4a1c6e){_0x4f36c6=_0x4a1c6e['length'];if(!_0xe5fcbb['query'][_0x074d('0xc9')](_0x074d('0xcf'))){_0x280553[_0x074d('0x20')]=qs[_0x074d('0x20')](_0xe5fcbb[_0x074d('0x42')][_0x074d('0x20')]);_0x280553[_0x074d('0x1f')]=qs[_0x074d('0x1f')](_0xe5fcbb['query'][_0x074d('0x1f')]);}return _0x4ee155[_0x074d('0xe0')](_0x280553);}})[_0x074d('0x25')](function(_0x3325a1){if(_0x3325a1){return _0x3325a1?{'count':_0x4f36c6,'rows':_0x3325a1}:null;}})['then'](respondWithResult(_0x3a48b7,null))[_0x074d('0x1d')](handleError(_0x3a48b7,null));};exports[_0x074d('0xe2')]=function(_0x1a2866,_0x1fe36f){var _0x596bcd={};var _0x5df162={};var _0x367827;var _0xbc2b15;return db[_0x074d('0x38')]['findOne']({'where':{'id':_0x1a2866[_0x074d('0x63')]['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x1fe36f,null))['then'](function(_0x1fd659){if(_0x1fd659){_0x367827=_0x1fd659;_0x5df162[_0x074d('0x56')]=_[_0x074d('0x53')](db[_0x074d('0xe3')][_0x074d('0x39')]);_0x5df162[_0x074d('0x42')]=_[_0x074d('0x53')](_0x1a2866[_0x074d('0x42')]);_0x5df162[_0x074d('0x54')]=_['intersection'](_0x5df162[_0x074d('0x56')],_0x5df162[_0x074d('0x42')]);_0x596bcd['attributes']=_[_0x074d('0x55')](_0x5df162[_0x074d('0x56')],qs[_0x074d('0x57')](_0x1a2866[_0x074d('0x42')][_0x074d('0x57')]));_0x596bcd['attributes']=_0x596bcd[_0x074d('0x46')][_0x074d('0x4a')]?_0x596bcd[_0x074d('0x46')]:_0x5df162[_0x074d('0x56')];_0x596bcd[_0x074d('0xc6')]=qs[_0x074d('0xc7')](_0x1a2866[_0x074d('0x42')][_0x074d('0xc7')]);_0x596bcd[_0x074d('0x41')]=qs[_0x074d('0x54')](_[_0x074d('0xc8')](_0x1a2866['query'],_0x5df162[_0x074d('0x54')]));if(_0x1a2866[_0x074d('0x42')]['filter']){_0x596bcd[_0x074d('0x41')]=_[_0x074d('0x5a')](_0x596bcd['where'],{'$or':_[_0x074d('0xbd')](_0x596bcd[_0x074d('0x46')],function(_0x311de6){var _0x22e446={};_0x22e446[_0x311de6]={'$like':'%'+_0x1a2866[_0x074d('0x42')][_0x074d('0x3c')]+'%'};return _0x22e446;})});}_0x596bcd=_[_0x074d('0x5a')]({},_0x596bcd,_0x1a2866[_0x074d('0x5b')]);return _0x367827[_0x074d('0xe2')](_0x596bcd);}})[_0x074d('0x25')](function(_0x26da64){if(_0x26da64){_0xbc2b15=_0x26da64[_0x074d('0x4a')];if(!_0x1a2866[_0x074d('0x42')][_0x074d('0xc9')](_0x074d('0xcf'))){_0x596bcd[_0x074d('0x20')]=qs[_0x074d('0x20')](_0x1a2866[_0x074d('0x42')]['limit']);_0x596bcd[_0x074d('0x1f')]=qs['offset'](_0x1a2866[_0x074d('0x42')][_0x074d('0x1f')]);}return _0x367827['getWhatsappInteractions'](_0x596bcd);}})[_0x074d('0x25')](function(_0x14276d){if(_0x14276d){return _0x14276d?{'count':_0xbc2b15,'rows':_0x14276d}:null;}})['then'](respondWithResult(_0x1fe36f,null))['catch'](handleError(_0x1fe36f,null));};exports[_0x074d('0xe4')]=function(_0xad2c8,_0x364b87,_0x20e5cb){var _0x21492c;var _0x44fc35;var _0xd353af;var _0x16d463=!_['isNil'](_0xad2c8[_0x074d('0x63')]['id'])?_0xad2c8[_0x074d('0x63')]['id']:!_['isNil'](_0xad2c8[_0x074d('0x2a')]['id'])?_0xad2c8[_0x074d('0x2a')]['id']:null;return db['User']['find']({'where':{'id':_0x16d463,'role':{'$or':[_0x074d('0x82'),_0x074d('0x2a'),_0x074d('0x2c')]}},'attributes':['id',_0x074d('0x3f'),_0x074d('0xe5'),'mobile',_0x074d('0x28'),_0x074d('0x66'),_0x074d('0xa0')]})['then'](function(_0x2fba2f){if(_0x2fba2f){if(_0x2fba2f['role']===_0x074d('0x2c')){_0x21492c=_0x2fba2f;if(_0xad2c8[_0x074d('0x60')]['interface']){_0xd353af=util[_0x074d('0xe6')](_0x074d('0xe7'),_0x21492c[_0xad2c8[_0x074d('0x60')][_0x074d('0xa2')]]);}else if(_0xad2c8[_0x074d('0x60')][_0x074d('0xe8')]){_0xd353af=util[_0x074d('0xe6')]('SIP/%s',_0xad2c8[_0x074d('0x60')][_0x074d('0xe8')]);}else{_0xd353af=util[_0x074d('0xe6')](_0x074d('0xe9'),_0x21492c[_0x074d('0x3f')]);}socket['to'](util['format']('user:%s',_0x21492c['name']))['emit'](_0x074d('0xea'),{'user':{'id':_0x21492c['id'],'name':_0x21492c['name']},'ip':_0xad2c8[_0x074d('0xeb')][_0x074d('0xec')]||_0xad2c8[_0x074d('0xed')][_0x074d('0xee')]||_0xad2c8[_0x074d('0xef')][_0x074d('0xee')]||_0xad2c8['connection'][_0x074d('0xef')][_0x074d('0xee')]});return db[_0x074d('0xab')][_0x074d('0x26')]({'where':{'membername':_0x21492c[_0x074d('0x3f')]},'individualHooks':!![]});}}else{throw new db[(_0x074d('0x96'))][(_0x074d('0x93'))](_0x074d('0xf0'));}})[_0x074d('0x25')](function(){if(_0x21492c){return _0x21492c['getVoiceQueues']({'raw':!![]});}})[_0x074d('0x25')](function(_0x193d0f){if(_0x21492c){var _0x1f4854=[];if(_0x193d0f){_0x44fc35=_0x193d0f;if(_0x44fc35[_0x074d('0x4a')]){for(var _0x5c211b=0x0;_0x5c211b<_0x44fc35[_0x074d('0x4a')];_0x5c211b++){_0x1f4854['push']({'membername':_0x21492c[_0x074d('0x3f')],'UserId':_0x21492c['id'],'queue_name':_0x44fc35[_0x5c211b][_0x074d('0x3f')],'VoiceQueueId':_0x44fc35[_0x5c211b]['id'],'interface':_0xd353af,'paused':_0x21492c[_0x074d('0xa0')]||![],'penalty':_0x44fc35[_0x5c211b][_0x074d('0xf1')]||0x0});}return BPromise[_0x074d('0x8f')](_0x1f4854,function(_0x33fb97){return db['UserVoiceQueueRt'][_0x074d('0xf2')](_0x33fb97);});}}}})[_0x074d('0x25')](function(){if(_0x21492c){return db[_0x074d('0xf3')][_0x074d('0x48')]({'where':{'membername':_0x21492c[_0x074d('0x3f')],'exitAt':null}});}})[_0x074d('0x25')](function(_0x51e4f2){if(_0x21492c){var _0x4e5ff1=[];_0x51e4f2[_0x074d('0xf4')](function(_0x24be97){_0x4e5ff1[_0x074d('0x47')](_0x24be97['update']({'exitAt':moment()[_0x074d('0xe6')](_0x074d('0xf5'))}));});return BPromise[_0x074d('0x5e')](_0x4e5ff1);}})['then'](function(){if(_0x21492c){var _0x527cf1=[];var _0xfdb79c=[];var _0xf3678f=utils['getChannels']();var _0x5c3862={'membername':_0x21492c[_0x074d('0x3f')],'interface':_0xd353af,'enterAt':moment()[_0x074d('0xe6')](_0x074d('0xf5')),'role':_0x21492c[_0x074d('0x28')],'internal':_0x21492c[_0x074d('0x66')]};_0xf3678f['forEach'](function(_0x2f0493){_0x527cf1[_0x074d('0x47')](_[_0x074d('0x5a')]({'channel':_0x2f0493,'type':_0x074d('0xf6'),'data1':_0xad2c8[_0x074d('0x60')]['device'],'data2':_0xd353af},_0x5c3862));if(_0x21492c['loginInPause']){_0xfdb79c[_0x074d('0x47')](_[_0x074d('0x5a')]({'channel':_0x2f0493,'type':'PAUSE','data1':'LOGININPAUSE'},_0x5c3862));}});return db['MemberReport']['bulkCreate'](_0x527cf1[_0x074d('0xf7')](_0xfdb79c),{'individualHooks':!![]});}})['then'](function(){if(_0x21492c){return _0x21492c[_0x074d('0x5f')]({'online':!![],'lastLoginAt':moment()[_0x074d('0xe6')](_0x074d('0xf5')),'voicePause':_0x21492c[_0x074d('0xa0')]||![],'mailPause':_0x21492c['loginInPause']||![],'chatPause':_0x21492c[_0x074d('0xa0')]||![],'faxPause':_0x21492c[_0x074d('0xa0')]||![],'smsPause':_0x21492c[_0x074d('0xa0')]||![],'openchannelPause':_0x21492c[_0x074d('0xa0')]||![],'whatsappPause':_0x21492c[_0x074d('0xa0')]||![],'pauseType':_0x21492c[_0x074d('0xa0')]?'LOGININPAUSE':null,'interface':_0xd353af,'lastPauseAt':moment()[_0x074d('0xe6')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x074d('0x25')](function(_0x9dd3aa){if(_0xad2c8[_0x074d('0xf8')]){return _0x20e5cb();}else{return BPromise['resolve'](_0x9dd3aa)[_0x074d('0x25')](respondWithResult(_0x364b87,null));}})[_0x074d('0x1d')](handleError(_0x364b87,null));};exports[_0x074d('0xf9')]=function(_0x2c0354,_0x28cd32){var _0x4df213;return db['User']['find']({'where':{'id':_0x2c0354[_0x074d('0x63')]['id'],'role':_0x074d('0x2c')},'attributes':['id',_0x074d('0x3f'),'role']})[_0x074d('0x25')](handleEntityNotFound(_0x28cd32,null))[_0x074d('0x25')](function(_0x75acb7){if(_0x75acb7){_0x4df213=_0x75acb7;return db[_0x074d('0xab')]['destroy']({'where':{'membername':_0x4df213[_0x074d('0x3f')]},'individualHooks':!![]});}})['then'](function(){return db[_0x074d('0xf3')][_0x074d('0x48')]({'where':{'membername':_0x4df213[_0x074d('0x3f')],'exitAt':null}});})[_0x074d('0x25')](function(_0x2098f){var _0x111a34=[];_0x2098f['forEach'](function(_0x477a4f){_0x111a34[_0x074d('0x47')](_0x477a4f['update']({'exitAt':moment()[_0x074d('0xe6')](_0x074d('0xf5'))}));});return BPromise[_0x074d('0x5e')](_0x111a34);})[_0x074d('0x25')](function(){return _0x4df213[_0x074d('0x5f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x074d('0x25')](respondWithResult(_0x28cd32,null))[_0x074d('0x1d')](handleError(_0x28cd32,null));};exports['pause']=function(_0x20a878,_0x52b0a4){var _0x19e043;return db[_0x074d('0xab')][_0x074d('0x5f')]({'paused':0x1},{'where':{'UserId':_0x20a878[_0x074d('0x63')]['id']},'individualHooks':!![]})[_0x074d('0x25')](function(){return db[_0x074d('0x38')][_0x074d('0x31')]({'where':{'id':_0x20a878[_0x074d('0x63')]['id'],'role':_0x074d('0x2c')},'attributes':['id',_0x074d('0x3f'),_0x074d('0x28'),_0x074d('0x66'),_0x074d('0xa2')]});})[_0x074d('0x25')](handleEntityNotFound(_0x52b0a4,null))[_0x074d('0x25')](function(_0x7a04ee){if(_0x7a04ee){_0x19e043=_0x7a04ee;return respondWithRpcPromise('QueuePause',_0x074d('0xfa'),{'id':_0x19e043['id'],'name':_0x19e043[_0x074d('0x3f')],'pause':!![]});}})[_0x074d('0x25')](function(){if(_0x19e043){return db[_0x074d('0xf3')][_0x074d('0x48')]({'where':{'membername':_0x19e043['name'],'type':_0x074d('0xfb'),'exitAt':null}});}})[_0x074d('0x25')](function(_0x3fafd7){if(_0x3fafd7['length']){var _0x1cf4aa=moment()[_0x074d('0xe6')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x29ac2b=0x0,_0x3e1f79=_0x3fafd7[_0x074d('0x4a')];_0x29ac2b<_0x3e1f79;_0x29ac2b++){_0x3fafd7[_0x29ac2b][_0x074d('0xfc')]({'exitAt':_0x1cf4aa});}}})[_0x074d('0x25')](function(){var _0x59d5ff=[];var _0x4da567=utils[_0x074d('0xfd')]();_0x4da567[_0x074d('0xf4')](function(_0x32fd04){_0x59d5ff[_0x074d('0x47')]({'channel':_0x32fd04,'membername':_0x19e043[_0x074d('0x3f')],'interface':_[_0x074d('0x6b')](_0x19e043[_0x074d('0xa2')])?util[_0x074d('0xe6')](_0x074d('0xe9'),_0x19e043['name']):_0x19e043['interface'],'type':'PAUSE','enterAt':moment()['format'](_0x074d('0xf5')),'data1':_0x20a878[_0x074d('0x60')]['type']||_0x074d('0xfe'),'role':_0x19e043[_0x074d('0x28')],'internal':_0x19e043[_0x074d('0x66')]});});return db[_0x074d('0xf3')][_0x074d('0x8c')](_0x59d5ff,{'individualHooks':!![]});})[_0x074d('0x25')](function(){return _0x19e043['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x20a878[_0x074d('0x60')][_0x074d('0x3a')]||_0x074d('0xfe'),'lastPauseAt':moment()[_0x074d('0xe6')](_0x074d('0xf5'))});})[_0x074d('0x25')](respondWithResult(_0x52b0a4,null))['catch'](handleError(_0x52b0a4,null));};exports[_0x074d('0xff')]=function(_0x26d319,_0x5c3bdd){var _0xb86788;return db[_0x074d('0x38')]['find']({'where':{'id':_0x26d319[_0x074d('0x63')]['id']},'attributes':['id','name','role',_0x074d('0xa1'),'mailPause','chatPause',_0x074d('0x100'),_0x074d('0x101'),_0x074d('0x102'),'whatsapppause','pauseType',_0x074d('0x103')]})[_0x074d('0x25')](handleEntityNotFound(_0x5c3bdd,null))[_0x074d('0x25')](function(_0x43e127){if(_0x43e127){_0xb86788=_0x43e127;if(_0x26d319[_0x074d('0x60')][_0x074d('0xac')]&&!utils[_0x074d('0xa3')](_0x26d319[_0x074d('0x60')][_0x074d('0xac')])){throw new db[(_0x074d('0x96'))][(_0x074d('0x93'))](_0x074d('0xa4'));}switch(_0x26d319[_0x074d('0x60')][_0x074d('0xac')]){case _0x074d('0xaa'):return respondWithRpcPromise(_0x074d('0x104'),_0x074d('0xff'),{'id':_0xb86788['id'],'name':_0xb86788[_0x074d('0x3f')],'pause':![]})[_0x074d('0x25')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0xb86788['id']},'individualHooks':!![]});})['then'](function(){return db[_0x074d('0xf3')]['find']({'where':{'channel':_0x26d319[_0x074d('0x60')][_0x074d('0xac')],'membername':_0xb86788[_0x074d('0x3f')],'type':'PAUSE','exitAt':null}});})[_0x074d('0x25')](function(_0x341621){if(_0x341621){return _0x341621['update']({'exitAt':moment()[_0x074d('0xe6')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x074d('0x105')},{'individualHooks':!![]});}return null;})['then'](function(){return _0xb86788[_0x074d('0x5f')]({'voicePause':![]});});case'mail':case _0x074d('0x5d'):case _0x074d('0x4d'):case _0x074d('0x4c'):case _0x074d('0x50'):case _0x074d('0x4f'):return db[_0x074d('0xf3')][_0x074d('0x31')]({'where':{'channel':_0x26d319[_0x074d('0x60')]['channel'],'membername':_0xb86788[_0x074d('0x3f')],'type':_0x074d('0xfb'),'exitAt':null}})['then'](function(_0x3eb977){if(_0x3eb977){return _0x3eb977[_0x074d('0x5f')]({'exitAt':moment()[_0x074d('0xe6')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x074d('0x105')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x425d74={};_[_0x074d('0x106')](_0x425d74,util[_0x074d('0xe6')]('%s%s',_0x26d319[_0x074d('0x60')][_0x074d('0xac')],_0x074d('0x107')),![]);return _0xb86788[_0x074d('0x5f')](_0x425d74);});default:return respondWithRpcPromise(_0x074d('0x104'),_0x074d('0xff'),{'id':_0xb86788['id'],'name':_0xb86788['name'],'pause':![]})[_0x074d('0x25')](function(){return db[_0x074d('0xab')][_0x074d('0x5f')]({'paused':0x0},{'where':{'UserId':_0xb86788['id']}});})[_0x074d('0x25')](function(){return db[_0x074d('0xf3')][_0x074d('0x48')]({'where':{'membername':_0xb86788[_0x074d('0x3f')],'type':_0x074d('0xfb'),'exitAt':null}});})['then'](function(_0xe9f5cc){var _0x418e0f=[];_0xe9f5cc[_0x074d('0xf4')](function(_0x34e368){_0x418e0f[_0x074d('0x47')](_0x34e368[_0x074d('0x5f')]({'exitAt':moment()[_0x074d('0xe6')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x074d('0x105')}));});return BPromise[_0x074d('0x5e')](_0x418e0f);})[_0x074d('0x25')](function(){return _0xb86788['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x074d('0x25')](respondWithResult(_0x5c3bdd,null))[_0x074d('0x1d')](handleError(_0x5c3bdd,null));};exports[_0x074d('0x108')]=function(_0x1d99a5,_0x2f3b65){var _0x27d10d={};var _0x36cc58={};var _0x983015;var _0x546e7a;return db['User']['findOne']({'where':{'id':_0x1d99a5['params']['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x2f3b65,null))[_0x074d('0x25')](function(_0x1b5f2d){if(_0x1b5f2d){_0x983015=_0x1b5f2d;_0x36cc58[_0x074d('0x56')]=_['keys'](db[_0x074d('0x109')][_0x074d('0x39')]);_0x36cc58[_0x074d('0x42')]=_[_0x074d('0x53')](_0x1d99a5['query']);_0x36cc58[_0x074d('0x54')]=_['intersection'](_0x36cc58[_0x074d('0x56')],_0x36cc58[_0x074d('0x42')]);_0x27d10d[_0x074d('0x46')]=_[_0x074d('0x55')](_0x36cc58['model'],qs[_0x074d('0x57')](_0x1d99a5['query'][_0x074d('0x57')]));_0x27d10d[_0x074d('0x46')]=_0x27d10d['attributes'][_0x074d('0x4a')]?_0x27d10d[_0x074d('0x46')]:_0x36cc58[_0x074d('0x56')];_0x27d10d[_0x074d('0xc6')]=qs[_0x074d('0xc7')](_0x1d99a5['query']['sort']);_0x27d10d[_0x074d('0x41')]=qs[_0x074d('0x54')](_[_0x074d('0xc8')](_0x1d99a5[_0x074d('0x42')],_0x36cc58[_0x074d('0x54')]));if(_0x1d99a5[_0x074d('0x42')][_0x074d('0x3c')]){_0x27d10d['where']=_[_0x074d('0x5a')](_0x27d10d[_0x074d('0x41')],{'$or':_[_0x074d('0xbd')](_0x27d10d[_0x074d('0x46')],function(_0x361b9a){var _0x2f514c={};_0x2f514c[_0x361b9a]={'$like':'%'+_0x1d99a5['query'][_0x074d('0x3c')]+'%'};return _0x2f514c;})});}_0x27d10d=_[_0x074d('0x5a')]({},_0x27d10d,_0x1d99a5[_0x074d('0x5b')]);return _0x983015[_0x074d('0x108')](_0x27d10d);}})[_0x074d('0x25')](function(_0x42a181){if(_0x42a181){_0x546e7a=_0x42a181[_0x074d('0x4a')];if(!_0x1d99a5[_0x074d('0x42')][_0x074d('0xc9')]('nolimit')){_0x27d10d[_0x074d('0x20')]=qs[_0x074d('0x20')](_0x1d99a5[_0x074d('0x42')]['limit']);_0x27d10d[_0x074d('0x1f')]=qs['offset'](_0x1d99a5[_0x074d('0x42')][_0x074d('0x1f')]);}return _0x983015[_0x074d('0x108')](_0x27d10d);}})['then'](function(_0x33f186){if(_0x33f186){return _0x33f186?{'count':_0x546e7a,'rows':_0x33f186}:null;}})[_0x074d('0x25')](respondWithResult(_0x2f3b65,null))[_0x074d('0x1d')](handleError(_0x2f3b65,null));};exports[_0x074d('0x10a')]=function(_0x363e65,_0x31a085){return db[_0x074d('0x38')][_0x074d('0x31')]({'where':{'id':_0x363e65[_0x074d('0x63')]['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x31a085,null))[_0x074d('0x25')](function(_0x46e143){if(_0x46e143){var _0x55447d=_0x46e143[_0x074d('0x27')]({'plain':!![]});return _0x46e143[_0x074d('0x10a')](_0x363e65[_0x074d('0x60')]['ids'],_[_0x074d('0x65')](_0x363e65['body'],[_0x074d('0x64'),'id'])||{})[_0x074d('0x25')](function(){for(var _0x40f995=0x0;_0x40f995<_0x363e65[_0x074d('0x60')][_0x074d('0x64')][_0x074d('0x4a')];_0x40f995++){var _0x2eb9bf=[];var _0x317773={};db[_0x074d('0x109')][_0x074d('0x99')]({'where':{'id':_0x363e65['body'][_0x074d('0x64')][_0x40f995]}})['then'](function(_0x4b668c){_0x317773=_0x4b668c['dataValues'];_0x2eb9bf[_0x074d('0x47')](_0x4b668c[_0x074d('0x10b')]()[_0x074d('0x25')](function(_0x59f38e){for(var _0x2bf9f4=0x0;_0x2bf9f4<_0x59f38e['length'];_0x2bf9f4++){_0x59f38e[_0x2bf9f4][_0x074d('0x10c')](_0x074d('0xac'),'Voice');}return _0x59f38e;}));_0x2eb9bf['push'](_0x4b668c[_0x074d('0x10d')]()[_0x074d('0x25')](function(_0x3bd5db){for(var _0x244043=0x0;_0x244043<_0x3bd5db[_0x074d('0x4a')];_0x244043++){_0x3bd5db[_0x244043][_0x074d('0x10c')](_0x074d('0xac'),_0x074d('0x10e'));}return _0x3bd5db;}));_0x2eb9bf[_0x074d('0x47')](_0x4b668c[_0x074d('0x10f')]()[_0x074d('0x25')](function(_0x1a77a3){for(var _0x4fb140=0x0;_0x4fb140<_0x1a77a3[_0x074d('0x4a')];_0x4fb140++){_0x1a77a3[_0x4fb140][_0x074d('0x10c')](_0x074d('0xac'),_0x074d('0x110'));}return _0x1a77a3;}));_0x2eb9bf['push'](_0x4b668c['getSmsQueues']()[_0x074d('0x25')](function(_0x2dde3c){for(var _0x5a2011=0x0;_0x5a2011<_0x2dde3c[_0x074d('0x4a')];_0x5a2011++){_0x2dde3c[_0x5a2011][_0x074d('0x10c')]('channel',_0x074d('0x111'));}return _0x2dde3c;}));_0x2eb9bf[_0x074d('0x47')](_0x4b668c[_0x074d('0x112')]()[_0x074d('0x25')](function(_0x54e313){for(var _0x5b6e04=0x0;_0x5b6e04<_0x54e313['length'];_0x5b6e04++){_0x54e313[_0x5b6e04][_0x074d('0x10c')](_0x074d('0xac'),_0x074d('0x113'));}return _0x54e313;}));_0x2eb9bf[_0x074d('0x47')](_0x4b668c[_0x074d('0x114')]()[_0x074d('0x25')](function(_0x35945d){for(var _0x27558a=0x0;_0x27558a<_0x35945d['length'];_0x27558a++){_0x35945d[_0x27558a][_0x074d('0x10c')](_0x074d('0xac'),_0x074d('0x115'));}return _0x35945d;}));_0x2eb9bf['push'](_0x4b668c[_0x074d('0x116')]()['then'](function(_0x5ba251){for(var _0x5d2d73=0x0;_0x5d2d73<_0x5ba251[_0x074d('0x4a')];_0x5d2d73++){_0x5ba251[_0x5d2d73][_0x074d('0x10c')]('channel','Openchannel');}return _0x5ba251;}));return BPromise[_0x074d('0x5e')](_0x2eb9bf);})[_0x074d('0x25')](function(_0x56c06f){var _0x427ebe=_[_0x074d('0x117')](_0x56c06f);_0x2eb9bf=[];return db[_0x074d('0x6d')][_0x074d('0x118')](function(_0x2a9e87){for(var _0xe6298e=0x0;_0xe6298e<_0x427ebe[_0x074d('0x4a')];_0xe6298e++){_0x2eb9bf['push'](_0x427ebe[_0xe6298e][_0x074d('0x119')](_0x55447d['id']),{'transaction':_0x2a9e87});}return BPromise['all'](_0x2eb9bf)[_0x074d('0x25')](function(){if(_0x55447d[_0x074d('0x9f')]){return BPromise['each'](_[_0x074d('0x3c')](_0x427ebe,function(_0x547e06){return _0x547e06[_0x074d('0x11a')](_0x074d('0xac'))===_0x074d('0x11b');}),function(_0xb12484){return db['UserVoiceQueueRt'][_0x074d('0xf2')]({'membername':_0x55447d['name'],'UserId':_0x55447d['id'],'queue_name':_0xb12484[_0x074d('0x3f')],'VoiceQueueId':_0xb12484['id'],'interface':_[_0x074d('0x6b')](_0x55447d['interface'])?util[_0x074d('0xe6')](_0x074d('0xe9'),_0x55447d[_0x074d('0x3f')]):_0x55447d[_0x074d('0xa2')],'paused':_0x55447d[_0x074d('0xa1')]||![],'penalty':_0x55447d['penalty']},{'transaction':_0x2a9e87});});}else{return;}})[_0x074d('0x25')](function(){for(var _0x1f7c8b=0x0;_0x1f7c8b<_0x427ebe[_0x074d('0x4a')];_0x1f7c8b++){var _0x9bdb91=_0x427ebe[_0x1f7c8b][_0x074d('0x11a')](_0x074d('0xac'));var _0x56738d=_0x9bdb91+_0x074d('0xa8');socket['emit'](_0x074d('0x2a')+_0x9bdb91+_0x074d('0xa9'),{'UserId':_0x55447d['id'],['queueField']:_0x427ebe[_0x1f7c8b]['id']});}});});})[_0x074d('0x25')](function(){db['TeamVoicePrefix'][_0x074d('0x99')]({'where':{'teamId':_0x317773['id']}})[_0x074d('0x25')](function(_0x120d32){if(_0x120d32){db[_0x074d('0x11c')][_0x074d('0x86')]({'UserId':_0x363e65[_0x074d('0x63')]['id'],'VoicePrefixId':_0x120d32[_0x074d('0x11d')]});}});});}});}})[_0x074d('0x25')](respondWithStatusCode(_0x31a085,null))['catch'](handleError(_0x31a085,null));};exports[_0x074d('0x11e')]=function(_0x18f9ce,_0x383610){return db[_0x074d('0x38')][_0x074d('0x99')]({'where':{'id':_0x18f9ce[_0x074d('0x63')]['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x383610,null))[_0x074d('0x25')](function(_0x5a1cbe){if(_0x5a1cbe){var _0x3d780d=_0x5a1cbe[_0x074d('0x27')]({'plain':!![]});var _0x507eb3=_0x18f9ce[_0x074d('0x42')][_0x074d('0x64')];return _0x5a1cbe['removeTeams'](_0x507eb3)[_0x074d('0x25')](function(){for(var _0x2f2a48=0x0;_0x2f2a48<_0x507eb3[_0x074d('0x4a')];_0x2f2a48++){var _0x2eaf3a=[];var _0x450e44={};db[_0x074d('0x109')]['findOne']({'where':{'id':_0x507eb3[_0x2f2a48]}})[_0x074d('0x25')](function(_0x1db623){_0x450e44=_0x1db623[_0x074d('0x4b')];_0x2eaf3a[_0x074d('0x47')](_0x1db623[_0x074d('0x10b')]()['then'](function(_0x3f12df){for(var _0x1bbf12=0x0;_0x1bbf12<_0x3f12df[_0x074d('0x4a')];_0x1bbf12++){_0x3f12df[_0x1bbf12][_0x074d('0x10c')](_0x074d('0xac'),'Voice');}return _0x3f12df;}));_0x2eaf3a[_0x074d('0x47')](_0x1db623['getChatQueues']()[_0x074d('0x25')](function(_0x54985c){for(var _0x1c8448=0x0;_0x1c8448<_0x54985c['length'];_0x1c8448++){_0x54985c[_0x1c8448][_0x074d('0x10c')](_0x074d('0xac'),_0x074d('0x10e'));}return _0x54985c;}));_0x2eaf3a['push'](_0x1db623[_0x074d('0x10f')]()[_0x074d('0x25')](function(_0x520884){for(var _0x49251c=0x0;_0x49251c<_0x520884[_0x074d('0x4a')];_0x49251c++){_0x520884[_0x49251c][_0x074d('0x10c')](_0x074d('0xac'),_0x074d('0x110'));}return _0x520884;}));_0x2eaf3a[_0x074d('0x47')](_0x1db623[_0x074d('0x11f')]()[_0x074d('0x25')](function(_0x1b26ce){for(var _0x586a82=0x0;_0x586a82<_0x1b26ce[_0x074d('0x4a')];_0x586a82++){_0x1b26ce[_0x586a82][_0x074d('0x10c')](_0x074d('0xac'),_0x074d('0x111'));}return _0x1b26ce;}));_0x2eaf3a['push'](_0x1db623[_0x074d('0x112')]()[_0x074d('0x25')](function(_0x44b8cf){for(var _0x380f7d=0x0;_0x380f7d<_0x44b8cf[_0x074d('0x4a')];_0x380f7d++){_0x44b8cf[_0x380f7d]['setDataValue'](_0x074d('0xac'),_0x074d('0x113'));}return _0x44b8cf;}));_0x2eaf3a[_0x074d('0x47')](_0x1db623[_0x074d('0x114')]()[_0x074d('0x25')](function(_0x5cdbdd){for(var _0x10d129=0x0;_0x10d129<_0x5cdbdd[_0x074d('0x4a')];_0x10d129++){_0x5cdbdd[_0x10d129]['setDataValue'](_0x074d('0xac'),_0x074d('0x115'));}return _0x5cdbdd;}));_0x2eaf3a[_0x074d('0x47')](_0x1db623[_0x074d('0x116')]()[_0x074d('0x25')](function(_0xba3ee8){for(var _0x2379fd=0x0;_0x2379fd<_0xba3ee8['length'];_0x2379fd++){_0xba3ee8[_0x2379fd][_0x074d('0x10c')](_0x074d('0xac'),_0x074d('0x120'));}return _0xba3ee8;}));return BPromise[_0x074d('0x5e')](_0x2eaf3a);})[_0x074d('0x25')](function(_0x2bbc85){var _0x5b70f0=_['flatten'](_0x2bbc85);_0x2eaf3a=[];return db[_0x074d('0x6d')][_0x074d('0x118')](function(_0x5e8e6b){for(var _0x1ed105=0x0;_0x1ed105<_0x5b70f0[_0x074d('0x4a')];_0x1ed105++){_0x2eaf3a[_0x074d('0x47')](_0x5b70f0[_0x1ed105][_0x074d('0x121')](_0x3d780d['id']),{'transaction':_0x5e8e6b});}return BPromise[_0x074d('0x5e')](_0x2eaf3a)['then'](function(){if(_0x3d780d[_0x074d('0x9f')]){return BPromise[_0x074d('0x8f')](_['filter'](_0x5b70f0,function(_0x43c7ce){return _0x43c7ce[_0x074d('0x11a')](_0x074d('0xac'))===_0x074d('0x11b');}),function(_0x27140a){return db[_0x074d('0xab')][_0x074d('0x26')]({'where':{'VoiceQueueId':_0x27140a['id'],'UserId':_0x3d780d['id']},'transaction':_0x5e8e6b});});}else{return;}})[_0x074d('0x25')](function(){db[_0x074d('0x122')][_0x074d('0x99')]({'where':{'teamId':_0x450e44['id']}})['then'](function(_0x5ad87a){if(_0x5ad87a){return db['UserVoicePrefix'][_0x074d('0x26')]({'where':{'UserId':_0x3d780d['id'],'VoicePrefixId':_0x5ad87a[_0x074d('0x4b')][_0x074d('0x11d')]}});}});})[_0x074d('0x25')](function(){for(var _0x44fe62=0x0;_0x44fe62<_0x5b70f0[_0x074d('0x4a')];_0x44fe62++){var _0x2e5c2b=_0x5b70f0[_0x44fe62][_0x074d('0x11a')](_0x074d('0xac'));var _0x49d8d8=_0x2e5c2b+_0x074d('0xa8');socket['emit'](_0x074d('0x2a')+_0x2e5c2b+_0x074d('0xad'),{'UserId':_0x3d780d['id'],['queueField']:_0x5b70f0[_0x44fe62]['id']});}});});});}});}})[_0x074d('0x25')](respondWithStatusCode(_0x383610,null))[_0x074d('0x1d')](handleError(_0x383610,null));};exports[_0x074d('0x123')]=function(_0x194dd3,_0x3ed387){var _0x5c296a={};var _0x398c37={};var _0x3bfa04;var _0x32f17f;return db[_0x074d('0x38')]['findOne']({'where':{'id':_0x194dd3[_0x074d('0x63')]['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x3ed387,null))[_0x074d('0x25')](function(_0x52f14a){if(_0x52f14a){_0x3bfa04=_0x52f14a;_0x398c37[_0x074d('0x56')]=_[_0x074d('0x53')](db[_0x074d('0xca')][_0x074d('0x39')]);_0x398c37[_0x074d('0x42')]=_[_0x074d('0x53')](_0x194dd3[_0x074d('0x42')]);_0x398c37[_0x074d('0x54')]=_[_0x074d('0x55')](_0x398c37[_0x074d('0x56')],_0x398c37[_0x074d('0x42')]);_0x5c296a[_0x074d('0x46')]=_[_0x074d('0x55')](_0x398c37[_0x074d('0x56')],qs['fields'](_0x194dd3['query'][_0x074d('0x57')]));_0x5c296a[_0x074d('0x46')]=_0x5c296a[_0x074d('0x46')][_0x074d('0x4a')]?_0x5c296a[_0x074d('0x46')]:_0x398c37[_0x074d('0x56')];_0x5c296a[_0x074d('0xc6')]=qs[_0x074d('0xc7')](_0x194dd3[_0x074d('0x42')]['sort']);_0x5c296a[_0x074d('0x41')]=qs[_0x074d('0x54')](_[_0x074d('0xc8')](_0x194dd3[_0x074d('0x42')],_0x398c37[_0x074d('0x54')]));if(_0x194dd3['query'][_0x074d('0x3c')]){_0x5c296a[_0x074d('0x41')]=_[_0x074d('0x5a')](_0x5c296a[_0x074d('0x41')],{'$or':_[_0x074d('0xbd')](_0x5c296a[_0x074d('0x46')],function(_0x5cf2f8){var _0x18f1ea={};_0x18f1ea[_0x5cf2f8]={'$like':'%'+_0x194dd3[_0x074d('0x42')]['filter']+'%'};return _0x18f1ea;})});}_0x5c296a=_[_0x074d('0x5a')]({},_0x5c296a,_0x194dd3[_0x074d('0x5b')]);return _0x3bfa04[_0x074d('0x123')](_0x5c296a);}})[_0x074d('0x25')](function(_0x1f56d6){if(_0x1f56d6){_0x32f17f=_0x1f56d6['length'];if(!_0x194dd3[_0x074d('0x42')][_0x074d('0xc9')]('nolimit')){_0x5c296a[_0x074d('0x20')]=qs[_0x074d('0x20')](_0x194dd3['query']['limit']);_0x5c296a[_0x074d('0x1f')]=qs[_0x074d('0x1f')](_0x194dd3[_0x074d('0x42')][_0x074d('0x1f')]);}return _0x3bfa04['getLists'](_0x5c296a);}})[_0x074d('0x25')](function(_0x267c87){if(_0x267c87){return _0x267c87?{'count':_0x32f17f,'rows':_0x267c87}:null;}})['then'](respondWithResult(_0x3ed387,null))[_0x074d('0x1d')](handleError(_0x3ed387,null));};exports[_0x074d('0x124')]=function(_0x5f31f9,_0x2a6ac1){var _0x5d14c2={};var _0x227c2d={};var _0x41444e;return db['User'][_0x074d('0x99')]({'where':{'id':_0x5f31f9[_0x074d('0x63')]['id']}})[_0x074d('0x25')](handleEntityNotFound(_0x2a6ac1,null))[_0x074d('0x25')](function(_0x3111ee){if(_0x3111ee){_0x41444e=_0x3111ee;_0x227c2d[_0x074d('0x56')]=_[_0x074d('0x53')](db['User'][_0x074d('0x39')]);_0x227c2d[_0x074d('0x42')]=_[_0x074d('0x53')](_0x5f31f9['query']);_0x227c2d[_0x074d('0x54')]=_[_0x074d('0x55')](_0x227c2d[_0x074d('0x56')],_0x227c2d[_0x074d('0x42')]);_0x5d14c2['attributes']=_[_0x074d('0x55')](_0x227c2d['model'],qs['fields'](_0x5f31f9['query'][_0x074d('0x57')]));_0x5d14c2[_0x074d('0x46')]=_0x5d14c2[_0x074d('0x46')][_0x074d('0x4a')]?_0x5d14c2[_0x074d('0x46')]:_0x227c2d['model'];_0x5d14c2['order']=qs['sort'](_0x5f31f9[_0x074d('0x42')][_0x074d('0xc7')]);_0x5d14c2[_0x074d('0x41')]=qs[_0x074d('0x54')](_[_0x074d('0xc8')](_0x5f31f9[_0x074d('0x42')],_0x227c2d[_0x074d('0x54')]));if(_0x5f31f9[_0x074d('0x42')]['filter']){_0x5d14c2['where']=_['merge'](_0x5d14c2[_0x074d('0x41')],{'$or':_[_0x074d('0xbd')](_0x5d14c2[_0x074d('0x46')],function(_0xe5761b){var _0x558e1d={};_0x558e1d[_0xe5761b]={'$like':'%'+_0x5f31f9[_0x074d('0x42')][_0x074d('0x3c')]+'%'};return _0x558e1d;})});}_0x5d14c2[_0x074d('0x56')]=db[_0x074d('0x38')];_0x5d14c2['as']=_0x074d('0x2b');_0x5d14c2=_[_0x074d('0x5a')]({},_0x5d14c2,_0x5f31f9[_0x074d('0x5b')]);return _0x41444e[_0x074d('0x10b')]({'include':[_0x5d14c2]});}})[_0x074d('0x25')](function(_0x2eb1da){if(_0x2eb1da){var _0x1d9bf3={},_0x4f7714=[];for(var _0xce7d71=0x0;_0xce7d71<_0x2eb1da[_0x074d('0x4a')];_0xce7d71+=0x1){for(var _0x35d50d=0x0,_0xb8fdc9;_0x35d50d<_0x2eb1da[_0xce7d71][_0x074d('0x2b')]['length'];_0x35d50d+=0x1){_0xb8fdc9=_0x2eb1da[_0xce7d71][_0x074d('0x2b')][_0x35d50d][_0x074d('0x27')]({'plain':!![]});_0x1d9bf3[_0xb8fdc9['id']]=_0xb8fdc9;}}_0x1d9bf3=_[_0x074d('0x125')](_0x1d9bf3);for(var _0x78be1c=qs['offset'](_0x5f31f9[_0x074d('0x42')][_0x074d('0x1f')]);_0x78be1c<_0x1d9bf3[_0x074d('0x4a')]&&_0x4f7714['length']=_0x261aac['agents']){throw new Error(_0x6500('0x4d'));}})[_0x6500('0xe')](function(){if(_0x298387){return db[_0x6500('0x3c')][_0x6500('0x44')]({'where':{'membername':_0x298387[_0x6500('0x26')]},'individualHooks':!![]});}})['then'](function(){if(_0x298387){return _0x298387[_0x6500('0x4e')]({'raw':!![]});}})[_0x6500('0xe')](function(_0x3898d2){if(_0x298387){if(_0x3898d2){var _0x3445ec=[];_0x59da57=_0x3898d2;if(_0x59da57['length']){for(var _0x2abe44=0x0;_0x2abe44<_0x59da57[_0x6500('0x2e')];_0x2abe44++){_0x3445ec[_0x6500('0x31')](db[_0x6500('0x3c')][_0x6500('0x4f')]({'membername':_0x298387[_0x6500('0x26')],'UserId':_0x298387['id'],'queue_name':_0x59da57[_0x2abe44]['name'],'VoiceQueueId':_0x59da57[_0x2abe44]['id'],'interface':_0x210cf3,'paused':_0x298387['loginInPause']||![],'penalty':_0x59da57[_0x2abe44][_0x6500('0x50')]||0x0}));}return BPromise[_0x6500('0x45')](_0x3445ec);}}}})['then'](function(){if(_0x298387){return db[_0x6500('0x2a')]['findAll']({'where':{'membername':_0x298387[_0x6500('0x26')],'exitAt':null}});}})['then'](function(_0x432933){if(_0x298387){if(_0x432933&&_0x432933[_0x6500('0x2e')]){var _0xe66bc8=[];_0x432933['forEach'](function(_0x2dc2e8){_0xe66bc8[_0x6500('0x31')](_0x2dc2e8[_0x6500('0x29')]({'exitAt':moment()[_0x6500('0x2c')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x6500('0x45')](_0xe66bc8);}}})[_0x6500('0xe')](function(_0x4ecc4d){if(_0x298387){var _0x500f79=[];var _0x4c3c56=[];var _0x5c349f=utils[_0x6500('0x51')]();var _0x90b8d2={'membername':_0x298387[_0x6500('0x26')],'interface':_0x210cf3,'enterAt':moment()['format'](_0x6500('0x2d')),'role':_0x298387[_0x6500('0x27')],'internal':_0x298387['internal']};_0x5c349f['forEach'](function(_0x2c5bfc){_0x500f79['push'](_[_0x6500('0x52')]({'channel':_0x2c5bfc,'type':_0x6500('0x53'),'data1':'callysquare','data2':_0x210cf3},_0x90b8d2));if(_0x298387[_0x6500('0x54')]){_0x4c3c56[_0x6500('0x31')](_['merge']({'channel':_0x2c5bfc,'type':_0x6500('0x2b'),'data1':'LOGININPAUSE'},_0x90b8d2));}});return db[_0x6500('0x2a')]['bulkCreate'](_0x500f79[_0x6500('0x55')](_0x4c3c56),{'individualHooks':!![]});}})[_0x6500('0xe')](function(){if(_0x298387){return _0x298387[_0x6500('0x29')]({'online':!![],'lastLoginAt':moment()['format'](_0x6500('0x2d')),'voicePause':_0x298387[_0x6500('0x54')]||![],'mailPause':_0x298387['loginInPause']||![],'chatPause':_0x298387[_0x6500('0x54')]||![],'faxPause':_0x298387[_0x6500('0x54')]||![],'smsPause':_0x298387[_0x6500('0x54')]||![],'openchannelPause':_0x298387['loginInPause']||![],'pauseType':_0x298387[_0x6500('0x54')]?_0x6500('0x56'):null,'lastPauseAt':moment()[_0x6500('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x210cf3});}})['then'](function(_0x454f47){_0x54a291(_0x454f47);})[_0x6500('0x16')](function(_0x44f335){_0x41f59a(_0x3e45b9[_0x6500('0x12')](0x1f4,_0x44f335[_0x6500('0x14')]));});});}; \ No newline at end of file +var _0xf419=['./user.socket','register','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetUser','findAll','options','raw','where','attributes','limit','include','model','map','ShowUser','find','stringify','PauseUser','User','name','role','UserVoiceQueueRt','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','interface','SIP/%s','PAUSE','body','type','uniqueid','MemberReport','update','DEFAULT\x20PAUSE','UnpauseUser','findOne','channel','Unknown\x20channel','voice','system','mail','chat','fax','sms','openchannel','whatsapp','set','Pause','all','LogoutUser','LoginUser','mobile','phone','internal','loginInPause','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','upsert','UserVoiceQueue.penalty','LOGIN','merge','bulkCreate','concat','LOGININPAUSE','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x182592,_0x4e88bb){var _0x4bdc57=function(_0x21472f){while(--_0x21472f){_0x182592['push'](_0x182592['shift']());}};_0x4bdc57(++_0x4e88bb);}(_0xf419,0x16e));var _0x9f41=function(_0x51dad8,_0x33d931){_0x51dad8=_0x51dad8-0x0;var _0x1e283b=_0xf419[_0x51dad8];return _0x1e283b;};'use strict';var _=require(_0x9f41('0x0'));var util=require('util');var moment=require(_0x9f41('0x1'));var BPromise=require(_0x9f41('0x2'));var rs=require(_0x9f41('0x3'));var fs=require('fs');var Redis=require(_0x9f41('0x4'));var db=require(_0x9f41('0x5'))['db'];var utils=require(_0x9f41('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9f41('0x7'));var jayson=require(_0x9f41('0x8'));var client=jayson[_0x9f41('0x9')][_0x9f41('0xa')]({'port':0x232a});config[_0x9f41('0xb')]=_['defaults'](config['redis'],{'host':_0x9f41('0xc'),'port':0x18eb});var socket=require(_0x9f41('0xd'))(new Redis(config[_0x9f41('0xb')]));require(_0x9f41('0xe'))[_0x9f41('0xf')](socket);function respondWithRpcPromise(_0xc82932,_0x1e570e,_0x224c1a){return new BPromise(function(_0x221ed1,_0xc4817b){return client['request'](_0xc82932,_0x224c1a)[_0x9f41('0x10')](function(_0x303c74){logger[_0x9f41('0x11')](_0x9f41('0x12'),_0x1e570e,_0x9f41('0x13'));logger[_0x9f41('0x14')](_0x9f41('0x15'),_0x1e570e,_0x9f41('0x13'),JSON['stringify'](_0x303c74));if(_0x303c74[_0x9f41('0x16')]){if(_0x303c74[_0x9f41('0x16')]['code']===0x1f4){logger[_0x9f41('0x16')]('User,\x20%s,\x20%s',_0x1e570e,_0x303c74[_0x9f41('0x16')][_0x9f41('0x17')]);return _0xc4817b(_0x303c74[_0x9f41('0x16')]['message']);}logger[_0x9f41('0x16')](_0x9f41('0x12'),_0x1e570e,_0x303c74['error'][_0x9f41('0x17')]);return _0x221ed1(_0x303c74[_0x9f41('0x16')][_0x9f41('0x17')]);}else{logger['info'](_0x9f41('0x12'),_0x1e570e,_0x9f41('0x13'));_0x221ed1(_0x303c74[_0x9f41('0x18')][_0x9f41('0x17')]);}})[_0x9f41('0x19')](function(_0x3e2973){logger[_0x9f41('0x16')](_0x9f41('0x12'),_0x1e570e,_0x3e2973);_0xc4817b(_0x3e2973);});});}exports[_0x9f41('0x1a')]=function(_0x7f476c){var _0x4da517=this;return new Promise(function(_0x6eee93,_0x176cd2){return db['User'][_0x9f41('0x1b')]({'raw':_0x7f476c[_0x9f41('0x1c')]?_0x7f476c['options'][_0x9f41('0x1d')]===undefined?!![]:![]:!![],'where':_0x7f476c[_0x9f41('0x1c')]?_0x7f476c[_0x9f41('0x1c')][_0x9f41('0x1e')]||null:null,'attributes':_0x7f476c[_0x9f41('0x1c')]?_0x7f476c[_0x9f41('0x1c')][_0x9f41('0x1f')]||null:null,'limit':_0x7f476c['options']?_0x7f476c[_0x9f41('0x1c')][_0x9f41('0x20')]||null:null,'include':_0x7f476c[_0x9f41('0x1c')]?_0x7f476c[_0x9f41('0x1c')][_0x9f41('0x21')]?_['map'](_0x7f476c['options'][_0x9f41('0x21')],function(_0x38477a){return{'model':db[_0x38477a[_0x9f41('0x22')]],'as':_0x38477a['as'],'attributes':_0x38477a[_0x9f41('0x1f')],'include':_0x38477a['include']?_[_0x9f41('0x23')](_0x38477a['include'],function(_0x60a777){return{'model':db[_0x60a777['model']],'as':_0x60a777['as'],'attributes':_0x60a777['attributes'],'include':_0x60a777[_0x9f41('0x21')]?_['map'](_0x60a777[_0x9f41('0x21')],function(_0xd18ad8){return{'model':db[_0xd18ad8[_0x9f41('0x22')]],'as':_0xd18ad8['as'],'attributes':_0xd18ad8['attributes']};}):[]};}):[]};}):[]:[]})[_0x9f41('0x10')](function(_0x17c3c4){logger[_0x9f41('0x11')](_0x9f41('0x1a'),_0x7f476c);logger[_0x9f41('0x14')]('GetUser',_0x7f476c,JSON['stringify'](_0x17c3c4));_0x6eee93(_0x17c3c4);})[_0x9f41('0x19')](function(_0x41083a){logger[_0x9f41('0x16')](_0x9f41('0x1a'),_0x41083a[_0x9f41('0x17')],_0x7f476c);_0x176cd2(_0x4da517[_0x9f41('0x16')](0x1f4,_0x41083a['message']));});});};exports[_0x9f41('0x24')]=function(_0x16698f){var _0x20e1f0=this;return new Promise(function(_0x27981f,_0x52fbd1){return db['User'][_0x9f41('0x25')]({'raw':_0x16698f[_0x9f41('0x1c')]?_0x16698f[_0x9f41('0x1c')][_0x9f41('0x1d')]===undefined?!![]:![]:!![],'where':_0x16698f['options']?_0x16698f[_0x9f41('0x1c')]['where']||null:null,'attributes':_0x16698f[_0x9f41('0x1c')]?_0x16698f['options'][_0x9f41('0x1f')]||null:null,'include':_0x16698f[_0x9f41('0x1c')]?_0x16698f[_0x9f41('0x1c')]['include']?_['map'](_0x16698f[_0x9f41('0x1c')][_0x9f41('0x21')],function(_0x504e1b){return{'model':db[_0x504e1b[_0x9f41('0x22')]],'as':_0x504e1b['as'],'attributes':_0x504e1b[_0x9f41('0x1f')],'include':_0x504e1b['include']?_['map'](_0x504e1b[_0x9f41('0x21')],function(_0x4ecd85){return{'model':db[_0x4ecd85[_0x9f41('0x22')]],'as':_0x4ecd85['as'],'attributes':_0x4ecd85[_0x9f41('0x1f')],'include':_0x4ecd85[_0x9f41('0x21')]?_[_0x9f41('0x23')](_0x4ecd85[_0x9f41('0x21')],function(_0x2d7d07){return{'model':db[_0x2d7d07['model']],'as':_0x2d7d07['as'],'attributes':_0x2d7d07[_0x9f41('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9f41('0x10')](function(_0x489d4c){logger[_0x9f41('0x11')](_0x9f41('0x24'),_0x16698f);logger['debug'](_0x9f41('0x24'),_0x16698f,JSON[_0x9f41('0x26')](_0x489d4c));_0x27981f(_0x489d4c);})[_0x9f41('0x19')](function(_0x2588c0){logger[_0x9f41('0x16')](_0x9f41('0x24'),_0x2588c0[_0x9f41('0x17')],_0x16698f);_0x52fbd1(_0x20e1f0[_0x9f41('0x16')](0x1f4,_0x2588c0[_0x9f41('0x17')]));});});};exports[_0x9f41('0x27')]=function(_0x3667d0){var _0x7f46fe=this;return new Promise(function(_0x3ba2a2,_0x21349e){var _0x58b929;return db[_0x9f41('0x28')][_0x9f41('0x25')]({'where':_0x3667d0[_0x9f41('0x1c')][_0x9f41('0x1e')]||{},'attributes':['id',_0x9f41('0x29'),_0x9f41('0x2a'),'internal','interface']})[_0x9f41('0x10')](function(_0x569c7c){if(_0x569c7c){_0x58b929=_0x569c7c;return db[_0x9f41('0x2b')]['update']({'paused':0x1},{'where':{'UserId':_0x58b929['id']},'individualHooks':!![]});}})[_0x9f41('0x10')](function(){if(_0x58b929){return db['MemberReport'][_0x9f41('0x1b')]({'where':{'membername':_0x58b929['name'],'type':'PAUSE','exitAt':null}});}})[_0x9f41('0x10')](function(_0x32b060){if(_0x58b929){if(_0x32b060&&_0x32b060[_0x9f41('0x2c')]){var _0x369f51=moment()[_0x9f41('0x2d')](_0x9f41('0x2e'));for(var _0x2d2f35=0x0,_0x492299=_0x32b060[_0x9f41('0x2c')];_0x2d2f35<_0x492299;_0x2d2f35++){_0x32b060[_0x2d2f35][_0x9f41('0x2f')]({'exitAt':_0x369f51});}}}})[_0x9f41('0x10')](function(){if(_0x58b929){var _0x4f1baf=[];var _0x3a4c90=utils[_0x9f41('0x30')]();_0x3a4c90[_0x9f41('0x31')](function(_0x43acff){_0x4f1baf[_0x9f41('0x32')]({'channel':_0x43acff,'membername':_0x58b929['name'],'interface':_[_0x9f41('0x33')](_0x58b929[_0x9f41('0x34')])?util['format'](_0x9f41('0x35'),_0x58b929[_0x9f41('0x29')]):_0x58b929['interface'],'type':_0x9f41('0x36'),'enterAt':moment()[_0x9f41('0x2d')](_0x9f41('0x2e')),'data1':_0x3667d0[_0x9f41('0x37')][_0x9f41('0x38')]||'DEFAULT\x20PAUSE','role':_0x58b929['role'],'internal':_0x58b929['internal'],'uniqueid':_0x3667d0['body'][_0x9f41('0x39')]||null});});return db[_0x9f41('0x3a')]['bulkCreate'](_0x4f1baf,{'individualHooks':!![]});}})['then'](function(){if(_0x58b929){return _0x58b929[_0x9f41('0x3b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3667d0[_0x9f41('0x37')]['type']||_0x9f41('0x3c'),'lastPauseAt':moment()['format'](_0x9f41('0x2e'))});}})[_0x9f41('0x10')](function(_0x10809c){_0x3ba2a2(_0x10809c);})['catch'](function(_0x377c32){_0x21349e(_0x7f46fe[_0x9f41('0x16')](0x1f4,_0x377c32['message']));});});};exports[_0x9f41('0x3d')]=function(_0x5df057){var _0x626671=this;return new Promise(function(_0x32703d,_0x55e6bb){var _0x158f66;return db['User'][_0x9f41('0x3e')]({'where':_0x5df057[_0x9f41('0x1c')][_0x9f41('0x1e')]||{},'attributes':['id',_0x9f41('0x29')]})['then'](function(_0x159b78){if(_0x159b78){_0x158f66=_0x159b78;if(_0x5df057[_0x9f41('0x37')]['channel']&&!utils['isValidChannel'](_0x5df057['body'][_0x9f41('0x3f')])){throw new Error(_0x9f41('0x40'));}switch(_0x5df057['body'][_0x9f41('0x3f')]){case _0x9f41('0x41'):return db[_0x9f41('0x2b')]['update']({'paused':0x0},{'where':{'UserId':_0x158f66['id']}})['then'](function(){return db[_0x9f41('0x3a')]['find']({'where':{'channel':_0x5df057[_0x9f41('0x37')]['channel'],'membername':_0x158f66['name'],'type':_0x9f41('0x36'),'exitAt':null}});})[_0x9f41('0x10')](function(_0x2529ac){if(_0x2529ac){return _0x2529ac[_0x9f41('0x3b')]({'exitAt':moment()[_0x9f41('0x2d')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x9f41('0x42')},{'individualHooks':!![]});}return null;})[_0x9f41('0x10')](function(){return _0x158f66[_0x9f41('0x3b')]({'voicePause':![]});});case _0x9f41('0x43'):case _0x9f41('0x44'):case _0x9f41('0x45'):case _0x9f41('0x46'):case _0x9f41('0x47'):case _0x9f41('0x48'):return db[_0x9f41('0x3a')][_0x9f41('0x25')]({'where':{'channel':_0x5df057[_0x9f41('0x37')][_0x9f41('0x3f')],'membername':_0x158f66[_0x9f41('0x29')],'type':_0x9f41('0x36'),'exitAt':null}})[_0x9f41('0x10')](function(_0x466422){return _0x466422[_0x9f41('0x3b')]({'exitAt':moment()['format'](_0x9f41('0x2e')),'data2':_0x9f41('0x42')},{'individualHooks':!![]});})['then'](function(){var _0x35e142={};_[_0x9f41('0x49')](_0x35e142,util[_0x9f41('0x2d')]('%s%s',_0x5df057['body'][_0x9f41('0x3f')],_0x9f41('0x4a')),![]);return _0x158f66[_0x9f41('0x3b')](_0x35e142);});default:return db[_0x9f41('0x2b')][_0x9f41('0x3b')]({'paused':0x0},{'where':{'UserId':_0x158f66['id']}})[_0x9f41('0x10')](function(){return db[_0x9f41('0x3a')]['findAll']({'where':{'membername':_0x158f66[_0x9f41('0x29')],'type':_0x9f41('0x36'),'exitAt':null}});})[_0x9f41('0x10')](function(_0x4169c5){var _0x401c5e=[];_0x4169c5['forEach'](function(_0x1007a8){_0x401c5e[_0x9f41('0x32')](_0x1007a8[_0x9f41('0x3b')]({'exitAt':moment()[_0x9f41('0x2d')](_0x9f41('0x2e')),'data2':_0x9f41('0x42')}));});return BPromise[_0x9f41('0x4b')](_0x401c5e);})[_0x9f41('0x10')](function(){return _0x158f66['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x9f41('0x10')](function(_0x49cb09){_0x32703d(_0x49cb09);})[_0x9f41('0x19')](function(_0xe33f64){_0x55e6bb(_0x626671[_0x9f41('0x16')](0x1f4,_0xe33f64[_0x9f41('0x17')]));});});};exports[_0x9f41('0x4c')]=function(_0x31e840){var _0x27abe6=this;return new Promise(function(_0x13be88,_0xca31a7){var _0x3456fb;return db[_0x9f41('0x28')]['findOne']({'where':_0x31e840[_0x9f41('0x1c')][_0x9f41('0x1e')]||{},'attributes':['id',_0x9f41('0x29')]})['then'](function(_0x56df55){if(_0x56df55){_0x3456fb=_0x56df55;return db[_0x9f41('0x2b')]['destroy']({'where':{'membername':_0x3456fb['name']},'individualHooks':!![]});}})[_0x9f41('0x10')](function(){if(_0x3456fb){return db['MemberReport'][_0x9f41('0x1b')]({'where':{'membername':_0x3456fb['name'],'exitAt':null}});}})['then'](function(_0x3d7db4){if(_0x3456fb){if(_0x3d7db4&&_0x3d7db4[_0x9f41('0x2c')]){var _0x4f9d24=[];_0x3d7db4[_0x9f41('0x31')](function(_0x26544d){_0x4f9d24[_0x9f41('0x32')](_0x26544d[_0x9f41('0x3b')]({'exitAt':moment()['format'](_0x9f41('0x2e'))}));});return BPromise[_0x9f41('0x4b')](_0x4f9d24);}}})[_0x9f41('0x10')](function(){if(_0x3456fb){return _0x3456fb[_0x9f41('0x3b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x9f41('0x10')](function(_0x5a168e){_0x13be88(_0x5a168e);})[_0x9f41('0x19')](function(_0x43ea91){_0xca31a7(_0x27abe6[_0x9f41('0x16')](0x1f4,_0x43ea91['message']));});});};exports[_0x9f41('0x4d')]=function(_0x26909a){var _0x578b7e=this;return new Promise(function(_0x14bc7f,_0x3203c3){var _0x2ee5b2;var _0x54ea86;var _0x5910e2;var _0x587e9d;return db[_0x9f41('0x28')][_0x9f41('0x3e')]({'where':_0x26909a[_0x9f41('0x1c')][_0x9f41('0x1e')]||{},'attributes':['id',_0x9f41('0x29'),_0x9f41('0x2a'),_0x9f41('0x4e'),_0x9f41('0x4f'),_0x9f41('0x50'),_0x9f41('0x51'),_0x9f41('0x34')]})[_0x9f41('0x10')](function(_0x5e58d6){if(_0x5e58d6){_0x2ee5b2=_0x5e58d6;_0x587e9d=_0x26909a['body'][_0x9f41('0x34')]?_0x26909a[_0x9f41('0x37')][_0x9f41('0x34')]:util[_0x9f41('0x2d')]('SIP/%s',_0x2ee5b2['name']);return db[_0x9f41('0x28')]['count']({'where':{'role':_0x9f41('0x52'),'online':!![],'id':{'$ne':_0x2ee5b2['id']}}});}})['then'](function(_0x14cb3d){if(_0x14cb3d){_0x5910e2=_0x14cb3d;return require(_0x9f41('0x53'))['getLicense']();}})[_0x9f41('0x10')](function(_0x31afae){if(_0x31afae&&_0x31afae['agents']&&_0x5910e2>=_0x31afae[_0x9f41('0x54')]){throw new Error(_0x9f41('0x55'));}})[_0x9f41('0x10')](function(){if(_0x2ee5b2){return db[_0x9f41('0x2b')][_0x9f41('0x56')]({'where':{'membername':_0x2ee5b2['name']},'individualHooks':!![]});}})[_0x9f41('0x10')](function(){if(_0x2ee5b2){return _0x2ee5b2[_0x9f41('0x57')]({'raw':!![]});}})[_0x9f41('0x10')](function(_0x1fe136){if(_0x2ee5b2){if(_0x1fe136){var _0x972e11=[];_0x54ea86=_0x1fe136;if(_0x54ea86[_0x9f41('0x2c')]){for(var _0x55fd84=0x0;_0x55fd84<_0x54ea86[_0x9f41('0x2c')];_0x55fd84++){_0x972e11[_0x9f41('0x32')](db[_0x9f41('0x2b')][_0x9f41('0x58')]({'membername':_0x2ee5b2['name'],'UserId':_0x2ee5b2['id'],'queue_name':_0x54ea86[_0x55fd84]['name'],'VoiceQueueId':_0x54ea86[_0x55fd84]['id'],'interface':_0x587e9d,'paused':_0x2ee5b2[_0x9f41('0x51')]||![],'penalty':_0x54ea86[_0x55fd84][_0x9f41('0x59')]||0x0}));}return BPromise[_0x9f41('0x4b')](_0x972e11);}}}})[_0x9f41('0x10')](function(){if(_0x2ee5b2){return db[_0x9f41('0x3a')][_0x9f41('0x1b')]({'where':{'membername':_0x2ee5b2['name'],'exitAt':null}});}})[_0x9f41('0x10')](function(_0x3a8709){if(_0x2ee5b2){if(_0x3a8709&&_0x3a8709[_0x9f41('0x2c')]){var _0x3f9668=[];_0x3a8709[_0x9f41('0x31')](function(_0x22bd2c){_0x3f9668['push'](_0x22bd2c[_0x9f41('0x3b')]({'exitAt':moment()[_0x9f41('0x2d')](_0x9f41('0x2e'))}));});return BPromise['all'](_0x3f9668);}}})['then'](function(_0x5ac650){if(_0x2ee5b2){var _0x3ad238=[];var _0x5ab3e3=[];var _0x278895=utils[_0x9f41('0x30')]();var _0x4e096f={'membername':_0x2ee5b2[_0x9f41('0x29')],'interface':_0x587e9d,'enterAt':moment()[_0x9f41('0x2d')](_0x9f41('0x2e')),'role':_0x2ee5b2['role'],'internal':_0x2ee5b2[_0x9f41('0x50')]};_0x278895['forEach'](function(_0x2cd442){_0x3ad238[_0x9f41('0x32')](_['merge']({'channel':_0x2cd442,'type':_0x9f41('0x5a'),'data1':'callysquare','data2':_0x587e9d},_0x4e096f));if(_0x2ee5b2['loginInPause']){_0x5ab3e3[_0x9f41('0x32')](_[_0x9f41('0x5b')]({'channel':_0x2cd442,'type':_0x9f41('0x36'),'data1':'LOGININPAUSE'},_0x4e096f));}});return db[_0x9f41('0x3a')][_0x9f41('0x5c')](_0x3ad238[_0x9f41('0x5d')](_0x5ab3e3),{'individualHooks':!![]});}})[_0x9f41('0x10')](function(){if(_0x2ee5b2){return _0x2ee5b2['update']({'online':!![],'lastLoginAt':moment()['format'](_0x9f41('0x2e')),'voicePause':_0x2ee5b2[_0x9f41('0x51')]||![],'mailPause':_0x2ee5b2[_0x9f41('0x51')]||![],'chatPause':_0x2ee5b2[_0x9f41('0x51')]||![],'faxPause':_0x2ee5b2[_0x9f41('0x51')]||![],'smsPause':_0x2ee5b2[_0x9f41('0x51')]||![],'openchannelPause':_0x2ee5b2['loginInPause']||![],'pauseType':_0x2ee5b2[_0x9f41('0x51')]?_0x9f41('0x5e'):null,'lastPauseAt':moment()[_0x9f41('0x2d')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x587e9d});}})[_0x9f41('0x10')](function(_0x452c29){_0x14bc7f(_0x452c29);})[_0x9f41('0x19')](function(_0x446239){_0x3203c3(_0x578b7e[_0x9f41('0x16')](0x1f4,_0x446239[_0x9f41('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index ffab053..6c6bb5c 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 _0xb8a0=['emit','removeListener','register','length','./user.events','save','update'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xb8a0,0x15b));var _0x0b8a=function(_0x27a16c,_0x25b266){_0x27a16c=_0x27a16c-0x0;var _0x5861fc=_0xb8a0[_0x27a16c];return _0x5861fc;};'use strict';var UserEvents=require(_0x0b8a('0x0'));var events=[_0x0b8a('0x1'),'remove',_0x0b8a('0x2')];function createListener(_0x3665f3,_0x5b6a7d){return function(_0x42d44c){_0x5b6a7d[_0x0b8a('0x3')](_0x3665f3,_0x42d44c);};}function removeListener(_0x2ff107,_0x14f885){return function(){UserEvents[_0x0b8a('0x4')](_0x2ff107,_0x14f885);};}exports[_0x0b8a('0x5')]=function(_0x413648){for(var _0x594384=0x0,_0x2089e9=events[_0x0b8a('0x6')];_0x594384<_0x2089e9;_0x594384++){var _0xd1160e=events[_0x594384];var _0x40f4fa=createListener('user:'+_0xd1160e,_0x413648);UserEvents['on'](_0xd1160e,_0x40f4fa);}}; \ No newline at end of file +var _0xb621=['register','length','./user.events','save','remove','emit','removeListener'];(function(_0x50a79e,_0x10ab2e){var _0x1fb465=function(_0x275534){while(--_0x275534){_0x50a79e['push'](_0x50a79e['shift']());}};_0x1fb465(++_0x10ab2e);}(_0xb621,0xe9));var _0x1b62=function(_0x25b42d,_0x47227e){_0x25b42d=_0x25b42d-0x0;var _0x1ee4e4=_0xb621[_0x25b42d];return _0x1ee4e4;};'use strict';var UserEvents=require(_0x1b62('0x0'));var events=[_0x1b62('0x1'),_0x1b62('0x2'),'update'];function createListener(_0x1ba656,_0x188454){return function(_0x2e5b6c){_0x188454[_0x1b62('0x3')](_0x1ba656,_0x2e5b6c);};}function removeListener(_0x521984,_0x330660){return function(){UserEvents[_0x1b62('0x4')](_0x521984,_0x330660);};}exports[_0x1b62('0x5')]=function(_0x55e727){for(var _0x2e1323=0x0,_0x1d0f58=events[_0x1b62('0x6')];_0x2e1323<_0x1d0f58;_0x2e1323++){var _0x1b1200=events[_0x2e1323];var _0x27d2e4=createListener('user:'+_0x1b1200,_0x55e727);UserEvents['on'](_0x1b1200,_0x27d2e4);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 865d621..acb4586 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x20d478,_0x2014a5){var _0x47a1d7=function(_0x57860){while(--_0x57860){_0x20d478['push'](_0x20d478['shift']());}};_0x47a1d7(++_0x2014a5);}(_0x70e0,0x17b));var _0x070e=function(_0x5d05e6,_0x462450){_0x5d05e6=_0x5d05e6-0x0;var _0x206d49=_0x70e0[_0x5d05e6];return _0x206d49;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2e38e0,_0x5841ba){var _0x173804=function(_0x1350cc){while(--_0x1350cc){_0x2e38e0['push'](_0x2e38e0['shift']());}};_0x173804(++_0x5841ba);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 3bec2e5..09dfb0b 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 _0xe58b=['sequelize','exports','INTEGER'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xe58b,0x1e3));var _0xbe58=function(_0x122633,_0x22057b){_0x122633=_0x122633-0x0;var _0x2d02e5=_0xe58b[_0x122633];return _0x2d02e5;};'use strict';var Sequelize=require(_0xbe58('0x0'));module[_0xbe58('0x1')]={'penalty':{'type':Sequelize[_0xbe58('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc12f=['INTEGER','sequelize','exports'];(function(_0x2ff330,_0x592eb2){var _0x1c930e=function(_0x4c2b61){while(--_0x4c2b61){_0x2ff330['push'](_0x2ff330['shift']());}};_0x1c930e(++_0x592eb2);}(_0xc12f,0xe8));var _0xfc12=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0xc12f[_0x3c504b];return _0x2e5354;};'use strict';var Sequelize=require(_0xfc12('0x0'));module[_0xfc12('0x1')]={'penalty':{'type':Sequelize[_0xfc12('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 6e86e60..baba41d 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 _0x2565=['../../config/logger','api','moment','bluebird','request-promise','./userChatQueue.attributes','UserChatQueue','user_has_chat_queues','util'];(function(_0x122120,_0x1b9817){var _0xc7e5d0=function(_0x505139){while(--_0x505139){_0x122120['push'](_0x122120['shift']());}};_0xc7e5d0(++_0x1b9817);}(_0x2565,0xfb));var _0x5256=function(_0x3d7d12,_0x273b25){_0x3d7d12=_0x3d7d12-0x0;var _0x94f66=_0x2565[_0x3d7d12];return _0x94f66;};'use strict';var _=require('lodash');var util=require(_0x5256('0x0'));var logger=require(_0x5256('0x1'))(_0x5256('0x2'));var moment=require(_0x5256('0x3'));var BPromise=require(_0x5256('0x4'));var rp=require(_0x5256('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5256('0x6'));module['exports']=function(_0x3d9695,_0x26a335){return _0x3d9695['define'](_0x5256('0x7'),attributes,{'tableName':_0x5256('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8135=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes','exports','lodash'];(function(_0x4be3e7,_0x3a7f05){var _0x4d44a0=function(_0x3eafee){while(--_0x3eafee){_0x4be3e7['push'](_0x4be3e7['shift']());}};_0x4d44a0(++_0x3a7f05);}(_0x8135,0x1b7));var _0x5813=function(_0x3d73db,_0x23767b){_0x3d73db=_0x3d73db-0x0;var _0xd2113=_0x8135[_0x3d73db];return _0xd2113;};'use strict';var _=require(_0x5813('0x0'));var util=require(_0x5813('0x1'));var logger=require(_0x5813('0x2'))(_0x5813('0x3'));var moment=require('moment');var BPromise=require(_0x5813('0x4'));var rp=require(_0x5813('0x5'));var fs=require('fs');var path=require(_0x5813('0x6'));var rimraf=require('rimraf');var config=require(_0x5813('0x7'));var attributes=require(_0x5813('0x8'));module[_0x5813('0x9')]=function(_0x25f497,_0x493f60){return _0x25f497['define']('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 5a98f18..7401864 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 _0x619e=['UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','client','http','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x48c713,_0x3139bb){var _0x59c6f3=function(_0x3723c3){while(--_0x3723c3){_0x48c713['push'](_0x48c713['shift']());}};_0x59c6f3(++_0x3139bb);}(_0x619e,0x138));var _0xe619=function(_0xb6b285,_0x596e01){_0xb6b285=_0xb6b285-0x0;var _0x11393c=_0x619e[_0xb6b285];return _0x11393c;};'use strict';var _=require('lodash');var util=require(_0xe619('0x0'));var moment=require(_0xe619('0x1'));var BPromise=require('bluebird');var rs=require(_0xe619('0x2'));var fs=require('fs');var Redis=require(_0xe619('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe619('0x4'))('rpc');var config=require(_0xe619('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe619('0x6')][_0xe619('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x459ac6,_0x1f0ad3,_0x18a911){return new BPromise(function(_0x1cceb1,_0x1bda7b){return client['request'](_0x459ac6,_0x18a911)['then'](function(_0x323ade){logger['info'](_0xe619('0x8'),_0x1f0ad3,_0xe619('0x9'));logger[_0xe619('0xa')](_0xe619('0xb'),_0x1f0ad3,_0xe619('0x9'),JSON[_0xe619('0xc')](_0x323ade));if(_0x323ade['error']){if(_0x323ade['error']['code']===0x1f4){logger[_0xe619('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x1f0ad3,_0x323ade[_0xe619('0xd')]['message']);return _0x1bda7b(_0x323ade[_0xe619('0xd')][_0xe619('0xe')]);}logger[_0xe619('0xd')](_0xe619('0x8'),_0x1f0ad3,_0x323ade[_0xe619('0xd')][_0xe619('0xe')]);return _0x1cceb1(_0x323ade[_0xe619('0xd')][_0xe619('0xe')]);}else{logger[_0xe619('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x1f0ad3,'request\x20sent');_0x1cceb1(_0x323ade['result'][_0xe619('0xe')]);}})[_0xe619('0x10')](function(_0x25b0bd){logger[_0xe619('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x1f0ad3,_0x25b0bd);_0x1bda7b(_0x25b0bd);});});} \ No newline at end of file +var _0xeafc=['request\x20sent','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then'];(function(_0x5f1e27,_0x1ebddc){var _0x25bf79=function(_0x57403c){while(--_0x57403c){_0x5f1e27['push'](_0x5f1e27['shift']());}};_0x25bf79(++_0x1ebddc);}(_0xeafc,0x86));var _0xceaf=function(_0x154818,_0x17ae16){_0x154818=_0x154818-0x0;var _0xe7de7e=_0xeafc[_0x154818];return _0xe7de7e;};'use strict';var _=require(_0xceaf('0x0'));var util=require('util');var moment=require(_0xceaf('0x1'));var BPromise=require('bluebird');var rs=require(_0xceaf('0x2'));var fs=require('fs');var Redis=require(_0xceaf('0x3'));var db=require(_0xceaf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xceaf('0x5'));var config=require(_0xceaf('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xceaf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d67f3,_0x1776ae,_0x5264bc){return new BPromise(function(_0x2510cc,_0x46caf4){return client[_0xceaf('0x8')](_0x2d67f3,_0x5264bc)[_0xceaf('0x9')](function(_0x55ff1d){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x1776ae,_0xceaf('0xa'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x1776ae,'request\x20sent',JSON[_0xceaf('0xb')](_0x55ff1d));if(_0x55ff1d[_0xceaf('0xc')]){if(_0x55ff1d[_0xceaf('0xc')][_0xceaf('0xd')]===0x1f4){logger[_0xceaf('0xc')](_0xceaf('0xe'),_0x1776ae,_0x55ff1d['error'][_0xceaf('0xf')]);return _0x46caf4(_0x55ff1d[_0xceaf('0xc')]['message']);}logger[_0xceaf('0xc')](_0xceaf('0xe'),_0x1776ae,_0x55ff1d[_0xceaf('0xc')][_0xceaf('0xf')]);return _0x2510cc(_0x55ff1d[_0xceaf('0xc')][_0xceaf('0xf')]);}else{logger['info'](_0xceaf('0xe'),_0x1776ae,_0xceaf('0xa'));_0x2510cc(_0x55ff1d[_0xceaf('0x10')][_0xceaf('0xf')]);}})[_0xceaf('0x11')](function(_0x305b9f){logger[_0xceaf('0xc')](_0xceaf('0xe'),_0x1776ae,_0x305b9f);_0x46caf4(_0x305b9f);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 3f87594..c44ded0 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1f0aa5,_0x1e6ca8){var _0x465f98=function(_0x43dc58){while(--_0x43dc58){_0x1f0aa5['push'](_0x1f0aa5['shift']());}};_0x465f98(++_0x1e6ca8);}(_0x70e0,0x17b));var _0x070e=function(_0x382c61,_0x4d5930){_0x382c61=_0x382c61-0x0;var _0x134e8c=_0x70e0[_0x382c61];return _0x134e8c;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1f7909,_0x1aefbd){var _0x2cb51f=function(_0x37635b){while(--_0x37635b){_0x1f7909['push'](_0x1f7909['shift']());}};_0x2cb51f(++_0x1aefbd);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 62b79b7..9cb1887 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 _0x0126=['INTEGER','STRING','sequelize','exports'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x0126,0x116));var _0x6012=function(_0x874c10,_0xf8740c){_0x874c10=_0x874c10-0x0;var _0x20b492=_0x0126[_0x874c10];return _0x20b492;};'use strict';var Sequelize=require(_0x6012('0x0'));module[_0x6012('0x1')]={'penalty':{'type':Sequelize[_0x6012('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6012('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x6012('0x3')]}}; \ No newline at end of file +var _0x6914=['INTEGER','STRING','sequelize','exports'];(function(_0xdd9a10,_0x3a3ec5){var _0x1d181c=function(_0x5ebb44){while(--_0x5ebb44){_0xdd9a10['push'](_0xdd9a10['shift']());}};_0x1d181c(++_0x3a3ec5);}(_0x6914,0xce));var _0x4691=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6914[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x4691('0x0'));module[_0x4691('0x1')]={'penalty':{'type':Sequelize[_0x4691('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x4691('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x4691('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 415fa70..cc2e9fd 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 _0x37d5=['api','moment','bluebird','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x37d5,0x177));var _0x537d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x37d5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x537d('0x0'));var util=require(_0x537d('0x1'));var logger=require(_0x537d('0x2'))(_0x537d('0x3'));var moment=require(_0x537d('0x4'));var BPromise=require(_0x537d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x537d('0x6'));var rimraf=require(_0x537d('0x7'));var config=require(_0x537d('0x8'));var attributes=require(_0x537d('0x9'));module[_0x537d('0xa')]=function(_0x199e44,_0x53234d){return _0x199e44[_0x537d('0xb')](_0x537d('0xc'),attributes,{'tableName':_0x537d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcf1=['rimraf','../../config/environment','define','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xadcbb,_0x330400){var _0x47ce63=function(_0x5cf96f){while(--_0x5cf96f){_0xadcbb['push'](_0xadcbb['shift']());}};_0x47ce63(++_0x330400);}(_0xbcf1,0x1a7));var _0x1bcf=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xbcf1[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x1bcf('0x0'));var util=require('util');var logger=require(_0x1bcf('0x1'))(_0x1bcf('0x2'));var moment=require(_0x1bcf('0x3'));var BPromise=require(_0x1bcf('0x4'));var rp=require(_0x1bcf('0x5'));var fs=require('fs');var path=require(_0x1bcf('0x6'));var rimraf=require(_0x1bcf('0x7'));var config=require(_0x1bcf('0x8'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x2e927f,_0x45bb88){return _0x2e927f[_0x1bcf('0x9')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 03c4267..9fc318b 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 _0x1af7=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserFaxQueue,\x20%s,\x20%s','result'];(function(_0x4d9442,_0x1e784a){var _0x5b0d83=function(_0x42a07e){while(--_0x42a07e){_0x4d9442['push'](_0x4d9442['shift']());}};_0x5b0d83(++_0x1e784a);}(_0x1af7,0xfb));var _0x71af=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1af7[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x71af('0x0'));var util=require(_0x71af('0x1'));var moment=require('moment');var BPromise=require(_0x71af('0x2'));var rs=require(_0x71af('0x3'));var fs=require('fs');var Redis=require(_0x71af('0x4'));var db=require(_0x71af('0x5'))['db'];var utils=require(_0x71af('0x6'));var logger=require(_0x71af('0x7'))(_0x71af('0x8'));var config=require(_0x71af('0x9'));var jayson=require(_0x71af('0xa'));var client=jayson[_0x71af('0xb')][_0x71af('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x257284,_0x380a5d,_0x520d0c){return new BPromise(function(_0x52ae5f,_0x2a0eff){return client[_0x71af('0xd')](_0x257284,_0x520d0c)['then'](function(_0x44a031){logger[_0x71af('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x380a5d,'request\x20sent');logger[_0x71af('0xf')](_0x71af('0x10'),_0x380a5d,_0x71af('0x11'),JSON[_0x71af('0x12')](_0x44a031));if(_0x44a031[_0x71af('0x13')]){if(_0x44a031[_0x71af('0x13')][_0x71af('0x14')]===0x1f4){logger[_0x71af('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x380a5d,_0x44a031[_0x71af('0x13')][_0x71af('0x15')]);return _0x2a0eff(_0x44a031[_0x71af('0x13')][_0x71af('0x15')]);}logger['error'](_0x71af('0x16'),_0x380a5d,_0x44a031[_0x71af('0x13')]['message']);return _0x52ae5f(_0x44a031[_0x71af('0x13')][_0x71af('0x15')]);}else{logger[_0x71af('0xe')](_0x71af('0x16'),_0x380a5d,_0x71af('0x11'));_0x52ae5f(_0x44a031[_0x71af('0x17')][_0x71af('0x15')]);}})[_0x71af('0x18')](function(_0x2c78a1){logger[_0x71af('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x380a5d,_0x2c78a1);_0x2a0eff(_0x2c78a1);});});} \ No newline at end of file +var _0xd860=['jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x7d0f83,_0x43b7e3){var _0x7e1b2e=function(_0x130989){while(--_0x130989){_0x7d0f83['push'](_0x7d0f83['shift']());}};_0x7e1b2e(++_0x43b7e3);}(_0xd860,0x1af));var _0x0d86=function(_0x49bdb0,_0x348987){_0x49bdb0=_0x49bdb0-0x0;var _0x514346=_0xd860[_0x49bdb0];return _0x514346;};'use strict';var _=require(_0x0d86('0x0'));var util=require(_0x0d86('0x1'));var moment=require(_0x0d86('0x2'));var BPromise=require(_0x0d86('0x3'));var rs=require(_0x0d86('0x4'));var fs=require('fs');var Redis=require(_0x0d86('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0d86('0x6'))(_0x0d86('0x7'));var config=require(_0x0d86('0x8'));var jayson=require(_0x0d86('0x9'));var client=jayson[_0x0d86('0xa')][_0x0d86('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bd987,_0x1b3971,_0x4ab316){return new BPromise(function(_0x3f11d5,_0x29cae5){return client[_0x0d86('0xc')](_0x2bd987,_0x4ab316)[_0x0d86('0xd')](function(_0x4a4b27){logger[_0x0d86('0xe')](_0x0d86('0xf'),_0x1b3971,_0x0d86('0x10'));logger[_0x0d86('0x11')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x1b3971,_0x0d86('0x10'),JSON[_0x0d86('0x12')](_0x4a4b27));if(_0x4a4b27[_0x0d86('0x13')]){if(_0x4a4b27[_0x0d86('0x13')][_0x0d86('0x14')]===0x1f4){logger[_0x0d86('0x13')](_0x0d86('0xf'),_0x1b3971,_0x4a4b27[_0x0d86('0x13')][_0x0d86('0x15')]);return _0x29cae5(_0x4a4b27[_0x0d86('0x13')][_0x0d86('0x15')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x1b3971,_0x4a4b27['error'][_0x0d86('0x15')]);return _0x3f11d5(_0x4a4b27[_0x0d86('0x13')][_0x0d86('0x15')]);}else{logger[_0x0d86('0xe')](_0x0d86('0xf'),_0x1b3971,'request\x20sent');_0x3f11d5(_0x4a4b27['result']['message']);}})['catch'](function(_0x2325e1){logger[_0x0d86('0x13')](_0x0d86('0xf'),_0x1b3971,_0x2325e1);_0x29cae5(_0x2325e1);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 4aeff5a..ab1b3d2 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x177f58,_0x7eb824){var _0x30c13d=function(_0x24d737){while(--_0x24d737){_0x177f58['push'](_0x177f58['shift']());}};_0x30c13d(++_0x7eb824);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x12fb8a,_0x293574){var _0x503466=function(_0x4b1edb){while(--_0x4b1edb){_0x12fb8a['push'](_0x12fb8a['shift']());}};_0x503466(++_0x293574);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 19b0dc9..f14b4d3 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 _0x98a1=['exports','INTEGER','sequelize'];(function(_0x687549,_0x2a09eb){var _0x44e4a0=function(_0xef9ff1){while(--_0xef9ff1){_0x687549['push'](_0x687549['shift']());}};_0x44e4a0(++_0x2a09eb);}(_0x98a1,0x10d));var _0x198a=function(_0x2ce4ca,_0x22ce83){_0x2ce4ca=_0x2ce4ca-0x0;var _0x1ce957=_0x98a1[_0x2ce4ca];return _0x1ce957;};'use strict';var Sequelize=require(_0x198a('0x0'));module[_0x198a('0x1')]={'penalty':{'type':Sequelize[_0x198a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd07e=['exports','INTEGER','sequelize'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xd07e,0x10a));var _0xed07=function(_0x4b75e7,_0xdb714a){_0x4b75e7=_0x4b75e7-0x0;var _0x1ea0d8=_0xd07e[_0x4b75e7];return _0x1ea0d8;};'use strict';var Sequelize=require(_0xed07('0x0'));module[_0xed07('0x1')]={'penalty':{'type':Sequelize[_0xed07('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 f84aa5b..76ea72e 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 _0x9521=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash'];(function(_0x3e1a6a,_0x3feb78){var _0x2db454=function(_0x1b2cd5){while(--_0x1b2cd5){_0x3e1a6a['push'](_0x3e1a6a['shift']());}};_0x2db454(++_0x3feb78);}(_0x9521,0x16b));var _0x1952=function(_0x3cb3ca,_0x44d697){_0x3cb3ca=_0x3cb3ca-0x0;var _0x214366=_0x9521[_0x3cb3ca];return _0x214366;};'use strict';var _=require(_0x1952('0x0'));var util=require('util');var logger=require(_0x1952('0x1'))(_0x1952('0x2'));var moment=require(_0x1952('0x3'));var BPromise=require(_0x1952('0x4'));var rp=require(_0x1952('0x5'));var fs=require('fs');var path=require(_0x1952('0x6'));var rimraf=require(_0x1952('0x7'));var config=require(_0x1952('0x8'));var attributes=require(_0x1952('0x9'));module[_0x1952('0xa')]=function(_0xb9751b,_0x4eeff2){return _0xb9751b[_0x1952('0xb')]('UserMailQueue',attributes,{'tableName':_0x1952('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e00=['user_has_mail_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue'];(function(_0x23e241,_0x67a0b8){var _0x36d15a=function(_0x377114){while(--_0x377114){_0x23e241['push'](_0x23e241['shift']());}};_0x36d15a(++_0x67a0b8);}(_0x4e00,0x1d5));var _0x04e0=function(_0x2a6360,_0x227ff0){_0x2a6360=_0x2a6360-0x0;var _0xb72d3c=_0x4e00[_0x2a6360];return _0xb72d3c;};'use strict';var _=require('lodash');var util=require(_0x04e0('0x0'));var logger=require(_0x04e0('0x1'))(_0x04e0('0x2'));var moment=require(_0x04e0('0x3'));var BPromise=require('bluebird');var rp=require(_0x04e0('0x4'));var fs=require('fs');var path=require(_0x04e0('0x5'));var rimraf=require(_0x04e0('0x6'));var config=require(_0x04e0('0x7'));var attributes=require(_0x04e0('0x8'));module[_0x04e0('0x9')]=function(_0x54cfb8,_0x9fc516){return _0x54cfb8[_0x04e0('0xa')](_0x04e0('0xb'),attributes,{'tableName':_0x04e0('0xc'),'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 1f6c2c6..221e765 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(_0x19cbcc,_0x44384e){var _0x44d405=function(_0x475354){while(--_0x475354){_0x19cbcc['push'](_0x19cbcc['shift']());}};_0x44d405(++_0x44384e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xeb4c8b,_0x1dc497){_0xeb4c8b=_0xeb4c8b-0x0;var _0x90b0d0=_0xf3cd[_0xeb4c8b];return _0x90b0d0;};'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 _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b1a06,_0x5e3c38){var _0x129229=function(_0x27c2f2){while(--_0x27c2f2){_0x4b1a06['push'](_0x4b1a06['shift']());}};_0x129229(++_0x5e3c38);}(_0x8ef6,0xf2));var _0x68ef=function(_0x53556c,_0x375bc5){_0x53556c=_0x53556c-0x0;var _0x5e5935=_0x8ef6[_0x53556c];return _0x5e5935;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index a16ce4d..bbc4256 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 _0xa425=['isAuthenticated','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','post'];(function(_0x194afd,_0x3018e2){var _0x12d52c=function(_0x28b3b0){while(--_0x28b3b0){_0x194afd['push'](_0x194afd['shift']());}};_0x12d52c(++_0x3018e2);}(_0xa425,0x10a));var _0x5a42=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0xa425[_0x581af1];return _0x54c22e;};'use strict';var multer=require(_0x5a42('0x0'));var util=require('util');var path=require(_0x5a42('0x1'));var timeout=require(_0x5a42('0x2'));var express=require(_0x5a42('0x3'));var router=express[_0x5a42('0x4')]();var fs_extra=require(_0x5a42('0x5'));var auth=require(_0x5a42('0x6'));var interaction=require(_0x5a42('0x7'));var config=require(_0x5a42('0x8'));var controller=require('./userNotification.controller');router[_0x5a42('0x9')]('/',auth[_0x5a42('0xa')](),controller['sendUserNotification']);module[_0x5a42('0xb')]=router; \ No newline at end of file +var _0x0304=['../../components/auth/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x47bdb5,_0x52e476){var _0x1374cf=function(_0x1696a8){while(--_0x1696a8){_0x47bdb5['push'](_0x47bdb5['shift']());}};_0x1374cf(++_0x52e476);}(_0x0304,0x1e6));var _0x4030=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x0304[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x4030('0x0'));var util=require('util');var path=require(_0x4030('0x1'));var timeout=require(_0x4030('0x2'));var express=require(_0x4030('0x3'));var router=express[_0x4030('0x4')]();var fs_extra=require(_0x4030('0x5'));var auth=require(_0x4030('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4030('0x7'));var controller=require(_0x4030('0x8'));router[_0x4030('0x9')]('/',auth[_0x4030('0xa')](),controller[_0x4030('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 45bf42b..78d2213 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 _0x3d08=['BOOLEAN','exports','TEXT','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d08,0xa9));var _0x83d0=function(_0x33850d,_0x2f3f72){_0x33850d=_0x33850d-0x0;var _0xb0c6c=_0x3d08[_0x33850d];return _0xb0c6c;};'use strict';var Sequelize=require('sequelize');module[_0x83d0('0x0')]={'body':{'type':Sequelize[_0x83d0('0x1')]},'senderName':{'type':Sequelize[_0x83d0('0x2')]},'recipientsId':{'type':Sequelize[_0x83d0('0x1')]},'recipientsDescription':{'type':Sequelize[_0x83d0('0x2')]},'beep':{'type':Sequelize[_0x83d0('0x3')]}}; \ No newline at end of file +var _0x8ccd=['sequelize','exports','STRING'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x8ccd,0xff));var _0xd8cc=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x8ccd[_0x424a9a];return _0xa7831c;};'use strict';var Sequelize=require(_0xd8cc('0x0'));module[_0xd8cc('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xd8cc('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xd8cc('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 01f3f88..29b5454 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 _0x677f=['../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','body','hasOwnProperty','text','TemplateId','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Sequelize','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','mailqueue','openchannelqueue','smsqueue','whatsappqueue','some','includes','model','toLowerCase','recipientsDescription','isEmpty','beep','user','recipientsId','sortBy','sequelize','UserNotification','senderName','forEach','recipient','emit','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','queue','replace','Queue','all','flatten','map','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x38481f,_0x2d6100){var _0x84a82=function(_0x57648d){while(--_0x57648d){_0x38481f['push'](_0x38481f['shift']());}};_0x84a82(++_0x2d6100);}(_0x677f,0xf9));var _0xf677=function(_0x20cf1b,_0x3f1740){_0x20cf1b=_0x20cf1b-0x0;var _0x57e0af=_0x677f[_0x20cf1b];return _0x57e0af;};'use strict';var emlformat=require(_0xf677('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf677('0x1'));var jsonpatch=require(_0xf677('0x2'));var rp=require('request-promise');var moment=require(_0xf677('0x3'));var BPromise=require(_0xf677('0x4'));var Mustache=require(_0xf677('0x5'));var util=require('util');var path=require(_0xf677('0x6'));var sox=require('sox');var csv=require(_0xf677('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf677('0x8'));var _=require('lodash');var squel=require(_0xf677('0x9'));var crypto=require(_0xf677('0xa'));var jsforce=require(_0xf677('0xb'));var deskjs=require(_0xf677('0xc'));var toCsv=require(_0xf677('0x7'));var querystring=require(_0xf677('0xd'));var Papa=require(_0xf677('0xe'));var Redis=require(_0xf677('0xf'));var authService=require(_0xf677('0x10'));var qs=require(_0xf677('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf677('0x12'))('api');var utils=require(_0xf677('0x13'));var config=require(_0xf677('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xf677('0x15')](config[_0xf677('0x16')],{'host':_0xf677('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf677('0x16')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x55bd43,_0x5c32a0){_0x5c32a0=_0x5c32a0||0xcc;return function(_0x599b2d){if(_0x599b2d){return _0x55bd43[_0xf677('0x18')](_0x5c32a0);}return _0x55bd43['status'](_0x5c32a0)['end']();};}function respondWithResult(_0x434474,_0x41b769){_0x41b769=_0x41b769||0xc8;return function(_0x4065b7){if(_0x4065b7){return _0x434474[_0xf677('0x19')](_0x41b769)[_0xf677('0x1a')](_0x4065b7);}};}function respondWithFilteredResult(_0x18cf2a,_0x3d51ea){return function(_0x31e72b){if(_0x31e72b){var _0x19180b=typeof _0x3d51ea['offset']===_0xf677('0x1b')&&typeof _0x3d51ea[_0xf677('0x1c')]===_0xf677('0x1b');var _0x531fba=_0x31e72b[_0xf677('0x1d')];var _0x1e32cc=_0x19180b?0x0:_0x3d51ea['offset'];var _0x15c7ef=_0x19180b?_0x31e72b['count']:_0x3d51ea[_0xf677('0x1e')]+_0x3d51ea['limit'];var _0x53603d;if(_0x15c7ef>=_0x531fba){_0x15c7ef=_0x531fba;_0x53603d=0xc8;}else{_0x53603d=0xce;}_0x18cf2a[_0xf677('0x19')](_0x53603d);return _0x18cf2a['set'](_0xf677('0x1f'),_0x1e32cc+'-'+_0x15c7ef+'/'+_0x531fba)[_0xf677('0x1a')](_0x31e72b);}return null;};}function patchUpdates(_0x6d8410){return function(_0x5d7a05){try{jsonpatch[_0xf677('0x20')](_0x5d7a05,_0x6d8410,!![]);}catch(_0x15530b){return BPromise[_0xf677('0x21')](_0x15530b);}return _0x5d7a05['save']();};}function saveUpdates(_0x35294b,_0x4da846){return function(_0x334b53){if(_0x334b53){return _0x334b53[_0xf677('0x22')](_0x35294b)[_0xf677('0x23')](function(_0x5463f5){return _0x5463f5;});}return null;};}function removeEntity(_0x2a634f,_0x100fbc){return function(_0x1ee4e7){if(_0x1ee4e7){return _0x1ee4e7[_0xf677('0x24')]()[_0xf677('0x23')](function(){_0x2a634f[_0xf677('0x19')](0xcc)[_0xf677('0x25')]();});}};}function handleEntityNotFound(_0x76eda8,_0x4ae5ef){return function(_0x5a1456){if(!_0x5a1456){_0x76eda8[_0xf677('0x18')](0x194);}return _0x5a1456;};}function handleError(_0x443aee,_0x22e5e3){_0x22e5e3=_0x22e5e3||0x1f4;return function(_0x5758d4){logger['error'](_0x5758d4[_0xf677('0x26')]);if(_0x5758d4['name']){delete _0x5758d4[_0xf677('0x27')];}_0x443aee['status'](_0x22e5e3)[_0xf677('0x28')](_0x5758d4);};}exports['sendUserNotification']=function(_0x44afaf,_0x5c17dd,_0x3c0695){if(!_0x44afaf[_0xf677('0x29')][_0xf677('0x2a')](_0xf677('0x2b'))&&!_0x44afaf['body']['hasOwnProperty'](_0xf677('0x2c'))){throw new db['Sequelize']['ValidationError'](_0xf677('0x2d'));}else{if(_0x44afaf['body']['hasOwnProperty'](_0xf677('0x2c'))&&!_0x44afaf[_0xf677('0x29')][_0xf677('0x2a')](_0xf677('0x2e'))){throw new db['Sequelize'][(_0xf677('0x2f'))](_0xf677('0x30'));}if(!_0x44afaf[_0xf677('0x29')][_0xf677('0x2a')](_0xf677('0x31'))){throw new db[(_0xf677('0x32'))][(_0xf677('0x2f'))](_0xf677('0x33'));}else{try{var _0x40a1a1=JSON[_0xf677('0x34')](_0x44afaf[_0xf677('0x29')]['recipients']);}catch(_0x5b3213){logger['error'](_0x5b3213);throw new db[(_0xf677('0x32'))][(_0xf677('0x2f'))](_0xf677('0x35'));}var _0x2480d5=['chatqueue','faxqueue',_0xf677('0x36'),_0xf677('0x37'),_0xf677('0x38'),'voicequeue',_0xf677('0x39'),'team','user'];if(_[_0xf677('0x3a')](_0x40a1a1,function(_0x15743e){return!_[_0xf677('0x3b')](_0x2480d5,_0x15743e[_0xf677('0x3c')][_0xf677('0x3d')]());})){throw new db[(_0xf677('0x32'))][(_0xf677('0x2f'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x5d4270={};_0x5d4270['senderName']=_0x44afaf['body'][_0xf677('0x2a')]('senderName')?_0x44afaf['body']['senderName']:_0x44afaf['user']['fullname'];_0x5d4270[_0xf677('0x3e')]=_[_0xf677('0x3f')](_0x44afaf[_0xf677('0x29')]['recipientsDescription'])?null:_0x44afaf['body'][_0xf677('0x3e')];_0x5d4270[_0xf677('0x40')]=_0x44afaf[_0xf677('0x29')][_0xf677('0x40')]||![];_0x5d4270['SenderId']=_0x44afaf[_0xf677('0x41')]['id'];return getContent(_0x44afaf[_0xf677('0x29')])['then'](function(_0x219988){_0x5d4270[_0xf677('0x29')]=_0x219988;return getRecipients(_0x40a1a1);})[_0xf677('0x23')](function(_0x5afef7){_0x5d4270[_0xf677('0x42')]=_[_0xf677('0x43')](_0x5afef7)['join'](',');return db[_0xf677('0x44')]['transaction'](function(_0x124f33){return db[_0xf677('0x45')]['create'](_0x5d4270,{'raw':!![],'transaction':_0x124f33})[_0xf677('0x23')](function(_0xca0bb2){var _0xc381ff={'sender':_0x5d4270[_0xf677('0x46')],'description':_0x5d4270['recipientsDescription'],'content':_0x5d4270[_0xf677('0x29')],'beep':_0x5d4270[_0xf677('0x40')]};_0x5afef7[_0xf677('0x47')](function(_0x47aee0){_0xc381ff[_0xf677('0x48')]=_0x47aee0;socket[_0xf677('0x49')](_0xf677('0x4a'),_0xc381ff);});return _0xca0bb2;});});})[_0xf677('0x23')](respondWithResult(_0x5c17dd,0xc9))[_0xf677('0x4b')](handleError(_0x5c17dd,null));};function getContent(_0x414a72){return new BPromise(function(_0x38e17f,_0x12ab13){if(_0x414a72[_0xf677('0x2b')]){_0x38e17f(_0x414a72[_0xf677('0x2b')]);return;}return db['Template'][_0xf677('0x4c')]({'attributes':[_0xf677('0x4d')],'where':{'id':_0x414a72[_0xf677('0x2c')]},'raw':!![]})[_0xf677('0x23')](function(_0x89965){if(!_0x89965)throw new db[(_0xf677('0x32'))][(_0xf677('0x2f'))](_0xf677('0x4e'));var _0x5d3e9c=Mustache[_0xf677('0x4f')](_0x89965[_0xf677('0x4d')],_0x414a72[_0xf677('0x2e')]);_0x38e17f(_0x5d3e9c);})[_0xf677('0x4b')](function(_0x1ba485){_0x12ab13(_0x1ba485);});});}function getRecipients(_0x201111){return new BPromise(function(_0x4a161e,_0x2295f5){var _0x3d7f78=[];var _0x48e018=[];_0x201111[_0xf677('0x47')](function(_0x154508){var _0x484721=_[_0xf677('0x50')](_0x154508['model']['toLowerCase']());if(_0x484721===_0xf677('0x51')){_0x3d7f78=_[_0xf677('0x52')](_0x3d7f78,_0x154508['ids']);}else{if(_['includes'](_0x484721,_0xf677('0x53')))_0x484721=_0x484721[_0xf677('0x54')]('queue',_0xf677('0x55'));_0x154508['ids'][_0xf677('0x47')](function(_0x2cf780){_0x48e018['push'](getAgents(_0x484721,_0x2cf780));});}});return BPromise[_0xf677('0x56')](_0x48e018)[_0xf677('0x23')](function(_0x23e722){_0x3d7f78=_['union'](_0x3d7f78,_[_0xf677('0x57')](_0x23e722));_0x4a161e(_0x3d7f78);})['catch'](function(_0x3dca9d){_0x2295f5(_0x3dca9d);});});}function getAgents(_0x5660cc,_0x369beb){return new BPromise(function(_0x4820cb,_0x45b47d){return db[_0x5660cc]['findOne']({'where':{'id':_0x369beb}})[_0xf677('0x23')](function(_0x187985){return _0x187985['getAgents']({'attributes':['id'],'raw':!![]})[_0xf677('0x23')](function(_0x1acbce){var _0x2bf60d=_[_0xf677('0x58')](_0x1acbce,'id');_0x4820cb(_0x2bf60d);});})['catch'](function(_0x2be47b){_0x45b47d(_0x2be47b);});});} \ No newline at end of file +var _0xe8ae=['Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Sequelize','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','smsqueue','voicequeue','team','user','some','model','toLowerCase','senderName','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','startCase','union','includes','queue','Queue','ids','push','all','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./userNotification.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','end','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','ValidationError'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xe8ae,0x1f4));var _0xee8a=function(_0x1fcd69,_0xb0333b){_0x1fcd69=_0x1fcd69-0x0;var _0x25f5be=_0xe8ae[_0x1fcd69];return _0x25f5be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee8a('0x0'));var zipdir=require(_0xee8a('0x1'));var jsonpatch=require(_0xee8a('0x2'));var rp=require('request-promise');var moment=require(_0xee8a('0x3'));var BPromise=require(_0xee8a('0x4'));var Mustache=require(_0xee8a('0x5'));var util=require('util');var path=require('path');var sox=require(_0xee8a('0x6'));var csv=require(_0xee8a('0x7'));var ejs=require(_0xee8a('0x8'));var fs=require('fs');var fs_extra=require(_0xee8a('0x9'));var _=require('lodash');var squel=require(_0xee8a('0xa'));var crypto=require(_0xee8a('0xb'));var jsforce=require(_0xee8a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xee8a('0xd'));var Papa=require(_0xee8a('0xe'));var Redis=require(_0xee8a('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee8a('0x10'));var logger=require('../../config/logger')(_0xee8a('0x11'));var utils=require(_0xee8a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xee8a('0x13'));var db=require(_0xee8a('0x14'))['db'];config['redis']=_[_0xee8a('0x15')](config[_0xee8a('0x16')],{'host':_0xee8a('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xee8a('0x16')]));require(_0xee8a('0x18'))[_0xee8a('0x19')](socket);function respondWithStatusCode(_0xd3c1ca,_0x555516){_0x555516=_0x555516||0xcc;return function(_0x2f07e0){if(_0x2f07e0){return _0xd3c1ca[_0xee8a('0x1a')](_0x555516);}return _0xd3c1ca[_0xee8a('0x1b')](_0x555516)['end']();};}function respondWithResult(_0x76f9d4,_0x357367){_0x357367=_0x357367||0xc8;return function(_0x5f3ac8){if(_0x5f3ac8){return _0x76f9d4[_0xee8a('0x1b')](_0x357367)[_0xee8a('0x1c')](_0x5f3ac8);}};}function respondWithFilteredResult(_0x587e56,_0x5a578a){return function(_0xaf31ee){if(_0xaf31ee){var _0x21ce7e=typeof _0x5a578a[_0xee8a('0x1d')]===_0xee8a('0x1e')&&typeof _0x5a578a[_0xee8a('0x1f')]==='undefined';var _0x3a3142=_0xaf31ee[_0xee8a('0x20')];var _0x56fe48=_0x21ce7e?0x0:_0x5a578a[_0xee8a('0x1d')];var _0x58d07c=_0x21ce7e?_0xaf31ee[_0xee8a('0x20')]:_0x5a578a['offset']+_0x5a578a['limit'];var _0x395400;if(_0x58d07c>=_0x3a3142){_0x58d07c=_0x3a3142;_0x395400=0xc8;}else{_0x395400=0xce;}_0x587e56['status'](_0x395400);return _0x587e56['set'](_0xee8a('0x21'),_0x56fe48+'-'+_0x58d07c+'/'+_0x3a3142)['json'](_0xaf31ee);}return null;};}function patchUpdates(_0x28e914){return function(_0x2827cb){try{jsonpatch[_0xee8a('0x22')](_0x2827cb,_0x28e914,!![]);}catch(_0x3addc5){return BPromise['reject'](_0x3addc5);}return _0x2827cb['save']();};}function saveUpdates(_0x24e324,_0x1546a2){return function(_0x55286e){if(_0x55286e){return _0x55286e[_0xee8a('0x23')](_0x24e324)[_0xee8a('0x24')](function(_0x4e7a45){return _0x4e7a45;});}return null;};}function removeEntity(_0x23165a,_0x69ed){return function(_0x1790cd){if(_0x1790cd){return _0x1790cd[_0xee8a('0x25')]()['then'](function(){_0x23165a[_0xee8a('0x1b')](0xcc)[_0xee8a('0x26')]();});}};}function handleEntityNotFound(_0x296995,_0xda3075){return function(_0x14478a){if(!_0x14478a){_0x296995[_0xee8a('0x1a')](0x194);}return _0x14478a;};}function handleError(_0x7216c2,_0x12166b){_0x12166b=_0x12166b||0x1f4;return function(_0x324857){logger['error'](_0x324857['stack']);if(_0x324857['name']){delete _0x324857[_0xee8a('0x27')];}_0x7216c2[_0xee8a('0x1b')](_0x12166b)[_0xee8a('0x28')](_0x324857);};}exports[_0xee8a('0x29')]=function(_0x1fd00b,_0x3ac8ea,_0x457dc2){if(!_0x1fd00b[_0xee8a('0x2a')][_0xee8a('0x2b')]('text')&&!_0x1fd00b[_0xee8a('0x2a')][_0xee8a('0x2b')](_0xee8a('0x2c'))){throw new db['Sequelize'][(_0xee8a('0x2d'))](_0xee8a('0x2e'));}else{if(_0x1fd00b[_0xee8a('0x2a')][_0xee8a('0x2b')]('TemplateId')&&!_0x1fd00b[_0xee8a('0x2a')][_0xee8a('0x2b')]('view')){throw new db[(_0xee8a('0x2f'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x1fd00b['body'][_0xee8a('0x2b')](_0xee8a('0x30'))){throw new db[(_0xee8a('0x2f'))][(_0xee8a('0x2d'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x12fae3=JSON['parse'](_0x1fd00b[_0xee8a('0x2a')][_0xee8a('0x30')]);}catch(_0x149450){logger['error'](_0x149450);throw new db[(_0xee8a('0x2f'))]['ValidationError'](_0xee8a('0x31'));}var _0x4ed468=[_0xee8a('0x32'),'faxqueue',_0xee8a('0x33'),'openchannelqueue',_0xee8a('0x34'),_0xee8a('0x35'),'whatsappqueue',_0xee8a('0x36'),_0xee8a('0x37')];if(_[_0xee8a('0x38')](_0x12fae3,function(_0x349660){return!_['includes'](_0x4ed468,_0x349660[_0xee8a('0x39')][_0xee8a('0x3a')]());})){throw new db[(_0xee8a('0x2f'))][(_0xee8a('0x2d'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x26d278={};_0x26d278[_0xee8a('0x3b')]=_0x1fd00b['body'][_0xee8a('0x2b')]('senderName')?_0x1fd00b[_0xee8a('0x2a')][_0xee8a('0x3b')]:_0x1fd00b[_0xee8a('0x37')]['fullname'];_0x26d278['recipientsDescription']=_[_0xee8a('0x3c')](_0x1fd00b[_0xee8a('0x2a')][_0xee8a('0x3d')])?null:_0x1fd00b[_0xee8a('0x2a')][_0xee8a('0x3d')];_0x26d278[_0xee8a('0x3e')]=_0x1fd00b[_0xee8a('0x2a')][_0xee8a('0x3e')]||![];_0x26d278[_0xee8a('0x3f')]=_0x1fd00b[_0xee8a('0x37')]['id'];return getContent(_0x1fd00b[_0xee8a('0x2a')])[_0xee8a('0x24')](function(_0x5cb0ae){_0x26d278[_0xee8a('0x2a')]=_0x5cb0ae;return getRecipients(_0x12fae3);})[_0xee8a('0x24')](function(_0x3b9875){_0x26d278[_0xee8a('0x40')]=_[_0xee8a('0x41')](_0x3b9875)[_0xee8a('0x42')](',');return db[_0xee8a('0x43')][_0xee8a('0x44')](function(_0x22d5b5){return db[_0xee8a('0x45')][_0xee8a('0x46')](_0x26d278,{'raw':!![],'transaction':_0x22d5b5})[_0xee8a('0x24')](function(_0x225e69){var _0x15bfb8={'sender':_0x26d278[_0xee8a('0x3b')],'description':_0x26d278[_0xee8a('0x3d')],'content':_0x26d278['body'],'beep':_0x26d278[_0xee8a('0x3e')]};_0x3b9875[_0xee8a('0x47')](function(_0x56e21c){_0x15bfb8['recipient']=_0x56e21c;socket[_0xee8a('0x48')](_0xee8a('0x49'),_0x15bfb8);});return _0x225e69;});});})[_0xee8a('0x24')](respondWithResult(_0x3ac8ea,0xc9))[_0xee8a('0x4a')](handleError(_0x3ac8ea,null));};function getContent(_0x301ad2){return new BPromise(function(_0x14da49,_0x4c3d2f){if(_0x301ad2['text']){_0x14da49(_0x301ad2['text']);return;}return db['Template'][_0xee8a('0x4b')]({'attributes':[_0xee8a('0x4c')],'where':{'id':_0x301ad2[_0xee8a('0x2c')]},'raw':!![]})[_0xee8a('0x24')](function(_0x3bf1fb){if(!_0x3bf1fb)throw new db['Sequelize']['ValidationError'](_0xee8a('0x4d'));var _0x35e9e3=Mustache[_0xee8a('0x4e')](_0x3bf1fb[_0xee8a('0x4c')],_0x301ad2[_0xee8a('0x4f')]);_0x14da49(_0x35e9e3);})[_0xee8a('0x4a')](function(_0x13cda8){_0x4c3d2f(_0x13cda8);});});}function getRecipients(_0x499afb){return new BPromise(function(_0x2ebc21,_0x2c4670){var _0x416724=[];var _0x47f300=[];_0x499afb['forEach'](function(_0x257712){var _0x205fe7=_[_0xee8a('0x50')](_0x257712[_0xee8a('0x39')][_0xee8a('0x3a')]());if(_0x205fe7==='User'){_0x416724=_[_0xee8a('0x51')](_0x416724,_0x257712['ids']);}else{if(_[_0xee8a('0x52')](_0x205fe7,_0xee8a('0x53')))_0x205fe7=_0x205fe7['replace'](_0xee8a('0x53'),_0xee8a('0x54'));_0x257712[_0xee8a('0x55')]['forEach'](function(_0x3d8060){_0x47f300[_0xee8a('0x56')](getAgents(_0x205fe7,_0x3d8060));});}});return BPromise[_0xee8a('0x57')](_0x47f300)[_0xee8a('0x24')](function(_0x231278){_0x416724=_[_0xee8a('0x51')](_0x416724,_[_0xee8a('0x58')](_0x231278));_0x2ebc21(_0x416724);})[_0xee8a('0x4a')](function(_0x1237de){_0x2c4670(_0x1237de);});});}function getAgents(_0xeb084f,_0x54c2b2){return new BPromise(function(_0x3dd6cf,_0x2ead57){return db[_0xeb084f][_0xee8a('0x4b')]({'where':{'id':_0x54c2b2}})[_0xee8a('0x24')](function(_0xfc455f){return _0xfc455f[_0xee8a('0x59')]({'attributes':['id'],'raw':!![]})[_0xee8a('0x24')](function(_0x1508fd){var _0x2709a2=_[_0xee8a('0x5a')](_0x1508fd,'id');_0x3dd6cf(_0x2709a2);});})[_0xee8a('0x4a')](function(_0xb9ffc2){_0x2ead57(_0xb9ffc2);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 919fa3b..9a694f4 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 _0xaf1c=['save','update','remove','emit','hasOwnProperty','hook','exports','events','UserNotification','setMaxListeners'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xaf1c,0x1d3));var _0xcaf1=function(_0x56fde8,_0x4abff6){_0x56fde8=_0x56fde8-0x0;var _0x5c7289=_0xaf1c[_0x56fde8];return _0x5c7289;};'use strict';var EventEmitter=require(_0xcaf1('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xcaf1('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xcaf1('0x2')](0x0);var events={'afterCreate':_0xcaf1('0x3'),'afterUpdate':_0xcaf1('0x4'),'afterDestroy':_0xcaf1('0x5')};function emitEvent(_0x42ce0c){return function(_0xdd6922,_0x19a5bd,_0x340051){UserNotificationEvents[_0xcaf1('0x6')](_0x42ce0c+':'+_0xdd6922['id'],_0xdd6922);UserNotificationEvents[_0xcaf1('0x6')](_0x42ce0c,_0xdd6922);_0x340051(null);};}for(var e in events){if(events[_0xcaf1('0x7')](e)){var event=events[e];UserNotification[_0xcaf1('0x8')](e,emitEvent(event));}}module[_0xcaf1('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0xf27e=['update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf27e,0x91));var _0xef27=function(_0xfc0774,_0x15941c){_0xfc0774=_0xfc0774-0x0;var _0x36b968=_0xf27e[_0xfc0774];return _0x36b968;};'use strict';var EventEmitter=require(_0xef27('0x0'));var UserNotification=require(_0xef27('0x1'))['db'][_0xef27('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xef27('0x3')](0x0);var events={'afterCreate':_0xef27('0x4'),'afterUpdate':_0xef27('0x5'),'afterDestroy':_0xef27('0x6')};function emitEvent(_0x3db2ed){return function(_0x13ebf9,_0x2609bb,_0x76aa6){UserNotificationEvents['emit'](_0x3db2ed+':'+_0x13ebf9['id'],_0x13ebf9);UserNotificationEvents['emit'](_0x3db2ed,_0x13ebf9);_0x76aa6(null);};}for(var e in events){if(events[_0xef27('0x7')](e)){var event=events[e];UserNotification[_0xef27('0x8')](e,emitEvent(event));}}module[_0xef27('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index af4ce8e..1d1b5f5 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 _0x5f52=['util','../../config/logger','request-promise','exports','define','userNotifications','utf8mb4_unicode_ci'];(function(_0x257f59,_0x4e0dd5){var _0x4dd3b6=function(_0x31f66b){while(--_0x31f66b){_0x257f59['push'](_0x257f59['shift']());}};_0x4dd3b6(++_0x4e0dd5);}(_0x5f52,0x10a));var _0x25f5=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0x5f52[_0x56b138];return _0x3df878;};'use strict';var _=require('lodash');var util=require(_0x25f5('0x0'));var logger=require(_0x25f5('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25f5('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module[_0x25f5('0x3')]=function(_0x462e71,_0x3ae3c7){return _0x462e71[_0x25f5('0x4')]('UserNotification',attributes,{'tableName':_0x25f5('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x25f5('0x6')});}; \ No newline at end of file +var _0x26ef=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userNotification.attributes','exports','define','UserNotification','utf8mb4'];(function(_0xa9eaa0,_0x4ba2b4){var _0x30897a=function(_0x2caa01){while(--_0x2caa01){_0xa9eaa0['push'](_0xa9eaa0['shift']());}};_0x30897a(++_0x4ba2b4);}(_0x26ef,0xe1));var _0xf26e=function(_0x30a51c,_0x2a0b95){_0x30a51c=_0x30a51c-0x0;var _0x24da92=_0x26ef[_0x30a51c];return _0x24da92;};'use strict';var _=require(_0xf26e('0x0'));var util=require(_0xf26e('0x1'));var logger=require(_0xf26e('0x2'))(_0xf26e('0x3'));var moment=require(_0xf26e('0x4'));var BPromise=require(_0xf26e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf26e('0x6'));var rimraf=require('rimraf');var config=require(_0xf26e('0x7'));var attributes=require(_0xf26e('0x8'));module[_0xf26e('0x9')]=function(_0xa66bfc,_0x416197){return _0xa66bfc[_0xf26e('0xa')](_0xf26e('0xb'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf26e('0xc'),'collate':_0xf26e('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 4b4778f..72a0ecf 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 _0xe170=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe170,0x86));var _0x0e17=function(_0x58284c,_0x52bfa7){_0x58284c=_0x58284c-0x0;var _0x4fc8bb=_0xe170[_0x58284c];return _0x4fc8bb;};'use strict';var _=require(_0x0e17('0x0'));var util=require('util');var moment=require(_0x0e17('0x1'));var BPromise=require(_0x0e17('0x2'));var rs=require(_0x0e17('0x3'));var fs=require('fs');var Redis=require(_0x0e17('0x4'));var db=require(_0x0e17('0x5'))['db'];var utils=require(_0x0e17('0x6'));var logger=require(_0x0e17('0x7'))(_0x0e17('0x8'));var config=require('../../config/environment');var jayson=require(_0x0e17('0x9'));var client=jayson[_0x0e17('0xa')][_0x0e17('0xb')]({'port':0x232a});config[_0x0e17('0xc')]=_[_0x0e17('0xd')](config[_0x0e17('0xc')],{'host':_0x0e17('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e17('0xc')]));require('./userNotification.socket')[_0x0e17('0xf')](socket);function respondWithRpcPromise(_0x35ad70,_0x4385ea,_0x407935){return new BPromise(function(_0xbc3eb,_0x523686){return client[_0x0e17('0x10')](_0x35ad70,_0x407935)[_0x0e17('0x11')](function(_0x28a19f){logger[_0x0e17('0x12')](_0x0e17('0x13'),_0x4385ea,'request\x20sent');logger[_0x0e17('0x14')](_0x0e17('0x15'),_0x4385ea,_0x0e17('0x16'),JSON[_0x0e17('0x17')](_0x28a19f));if(_0x28a19f[_0x0e17('0x18')]){if(_0x28a19f[_0x0e17('0x18')]['code']===0x1f4){logger['error'](_0x0e17('0x13'),_0x4385ea,_0x28a19f[_0x0e17('0x18')][_0x0e17('0x19')]);return _0x523686(_0x28a19f[_0x0e17('0x18')]['message']);}logger[_0x0e17('0x18')]('UserNotification,\x20%s,\x20%s',_0x4385ea,_0x28a19f[_0x0e17('0x18')][_0x0e17('0x19')]);return _0xbc3eb(_0x28a19f[_0x0e17('0x18')][_0x0e17('0x19')]);}else{logger[_0x0e17('0x12')](_0x0e17('0x13'),_0x4385ea,_0x0e17('0x16'));_0xbc3eb(_0x28a19f[_0x0e17('0x1a')][_0x0e17('0x19')]);}})['catch'](function(_0x2a8b15){logger[_0x0e17('0x18')](_0x0e17('0x13'),_0x4385ea,_0x2a8b15);_0x523686(_0x2a8b15);});});} \ No newline at end of file +var _0xa7a4=['client','http','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserNotification,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x21e58a,_0x2e26d9){var _0x5a2bf5=function(_0x17f2e5){while(--_0x17f2e5){_0x21e58a['push'](_0x21e58a['shift']());}};_0x5a2bf5(++_0x2e26d9);}(_0xa7a4,0x7d));var _0x4a7a=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0xa7a4[_0x34e752];return _0x7c6347;};'use strict';var _=require(_0x4a7a('0x0'));var util=require('util');var moment=require(_0x4a7a('0x1'));var BPromise=require(_0x4a7a('0x2'));var rs=require(_0x4a7a('0x3'));var fs=require('fs');var Redis=require(_0x4a7a('0x4'));var db=require(_0x4a7a('0x5'))['db'];var utils=require(_0x4a7a('0x6'));var logger=require(_0x4a7a('0x7'))(_0x4a7a('0x8'));var config=require(_0x4a7a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4a7a('0xa')][_0x4a7a('0xb')]({'port':0x232a});config['redis']=_[_0x4a7a('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4a7a('0xd'))(new Redis(config['redis']));require('./userNotification.socket')[_0x4a7a('0xe')](socket);function respondWithRpcPromise(_0x24e073,_0x3f7f1b,_0x4ca9dd){return new BPromise(function(_0x561fea,_0x1f2533){return client[_0x4a7a('0xf')](_0x24e073,_0x4ca9dd)[_0x4a7a('0x10')](function(_0x550d55){logger[_0x4a7a('0x11')]('UserNotification,\x20%s,\x20%s',_0x3f7f1b,_0x4a7a('0x12'));logger[_0x4a7a('0x13')](_0x4a7a('0x14'),_0x3f7f1b,_0x4a7a('0x12'),JSON[_0x4a7a('0x15')](_0x550d55));if(_0x550d55[_0x4a7a('0x16')]){if(_0x550d55[_0x4a7a('0x16')][_0x4a7a('0x17')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x3f7f1b,_0x550d55['error']['message']);return _0x1f2533(_0x550d55['error'][_0x4a7a('0x18')]);}logger[_0x4a7a('0x16')](_0x4a7a('0x19'),_0x3f7f1b,_0x550d55[_0x4a7a('0x16')][_0x4a7a('0x18')]);return _0x561fea(_0x550d55['error'][_0x4a7a('0x18')]);}else{logger[_0x4a7a('0x11')](_0x4a7a('0x19'),_0x3f7f1b,_0x4a7a('0x12'));_0x561fea(_0x550d55[_0x4a7a('0x1a')][_0x4a7a('0x18')]);}})['catch'](function(_0x1c1ff2){logger[_0x4a7a('0x16')](_0x4a7a('0x19'),_0x3f7f1b,_0x1c1ff2);_0x1f2533(_0x1c1ff2);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 8427a81..a748b53 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 _0x5aaa=['emit','removeListener','length','./userNotification.events','save','remove','update'];(function(_0x6182ff,_0x59d492){var _0x1cec22=function(_0x2e96f8){while(--_0x2e96f8){_0x6182ff['push'](_0x6182ff['shift']());}};_0x1cec22(++_0x59d492);}(_0x5aaa,0x18b));var _0xa5aa=function(_0xe603c1,_0x2e5c99){_0xe603c1=_0xe603c1-0x0;var _0x2fb5e3=_0x5aaa[_0xe603c1];return _0x2fb5e3;};'use strict';var UserNotificationEvents=require(_0xa5aa('0x0'));var events=[_0xa5aa('0x1'),_0xa5aa('0x2'),_0xa5aa('0x3')];function createListener(_0x1e2be7,_0x44b41a){return function(_0x38ff28){_0x44b41a[_0xa5aa('0x4')](_0x1e2be7,_0x38ff28);};}function removeListener(_0xf59fc6,_0x4beda8){return function(){UserNotificationEvents[_0xa5aa('0x5')](_0xf59fc6,_0x4beda8);};}exports['register']=function(_0x59ff2e){for(var _0x44ab7a=0x0,_0xc24a41=events[_0xa5aa('0x6')];_0x44ab7a<_0xc24a41;_0x44ab7a++){var _0x422174=events[_0x44ab7a];var _0x1dc5ee=createListener('userNotification:'+_0x422174,_0x59ff2e);UserNotificationEvents['on'](_0x422174,_0x1dc5ee);}}; \ No newline at end of file +var _0x6a1f=['length','save','remove','update','removeListener','register'];(function(_0x1cc2a2,_0x114b3d){var _0x3507c2=function(_0x131021){while(--_0x131021){_0x1cc2a2['push'](_0x1cc2a2['shift']());}};_0x3507c2(++_0x114b3d);}(_0x6a1f,0x1ed));var _0xf6a1=function(_0x473039,_0x17ab3e){_0x473039=_0x473039-0x0;var _0x309ba6=_0x6a1f[_0x473039];return _0x309ba6;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xf6a1('0x0'),_0xf6a1('0x1'),_0xf6a1('0x2')];function createListener(_0x1739d1,_0x399f98){return function(_0x29eedd){_0x399f98['emit'](_0x1739d1,_0x29eedd);};}function removeListener(_0x45c6b3,_0x19aa1c){return function(){UserNotificationEvents[_0xf6a1('0x3')](_0x45c6b3,_0x19aa1c);};}exports[_0xf6a1('0x4')]=function(_0x24dd71){for(var _0x43c908=0x0,_0x291ca2=events[_0xf6a1('0x5')];_0x43c908<_0x291ca2;_0x43c908++){var _0x15b674=events[_0x43c908];var _0x467062=createListener('userNotification:'+_0x15b674,_0x24dd71);UserNotificationEvents['on'](_0x15b674,_0x467062);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 6c53623..e243773 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xf19f09,_0x1fe7cc){var _0x4e16e6=function(_0x43f1ad){while(--_0x43f1ad){_0xf19f09['push'](_0xf19f09['shift']());}};_0x4e16e6(++_0x1fe7cc);}(_0xe706,0xa3));var _0x6e70=function(_0x447af3,_0x381c44){_0x447af3=_0x447af3-0x0;var _0x202e95=_0xe706[_0x447af3];return _0x202e95;};'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(_0x83ec5,_0x3990c4){var _0x5ab8f0=function(_0x1817a2){while(--_0x1817a2){_0x83ec5['push'](_0x83ec5['shift']());}};_0x5ab8f0(++_0x3990c4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x239dba,_0x309e95){_0x239dba=_0x239dba-0x0;var _0x1ceb11=_0xcb91[_0x239dba];return _0x1ceb11;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 6c92701..0f75e71 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 _0x897c=['INTEGER','sequelize'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x897c,0x197));var _0xc897=function(_0x269d06,_0x371fa5){_0x269d06=_0x269d06-0x0;var _0x49dbc8=_0x897c[_0x269d06];return _0x49dbc8;};'use strict';var Sequelize=require(_0xc897('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc897('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5f4b=['exports','INTEGER','sequelize'];(function(_0x5a47de,_0x57a87c){var _0x400ee6=function(_0x46745b){while(--_0x46745b){_0x5a47de['push'](_0x5a47de['shift']());}};_0x400ee6(++_0x57a87c);}(_0x5f4b,0x19a));var _0xb5f4=function(_0x50dac8,_0x1a6106){_0x50dac8=_0x50dac8-0x0;var _0x323d9a=_0x5f4b[_0x50dac8];return _0x323d9a;};'use strict';var Sequelize=require(_0xb5f4('0x0'));module[_0xb5f4('0x1')]={'penalty':{'type':Sequelize[_0xb5f4('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 ca5fba6..71a0d13 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 _0x05d6=['bluebird','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','api','moment'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0x05d6,0x10c));var _0x605d=function(_0x3452fe,_0x412f2f){_0x3452fe=_0x3452fe-0x0;var _0x39cd3b=_0x05d6[_0x3452fe];return _0x39cd3b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x605d('0x0'));var moment=require(_0x605d('0x1'));var BPromise=require(_0x605d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x605d('0x3'));var rimraf=require(_0x605d('0x4'));var config=require(_0x605d('0x5'));var attributes=require(_0x605d('0x6'));module['exports']=function(_0x2cd23b,_0x523fc5){return _0x2cd23b[_0x605d('0x7')](_0x605d('0x8'),attributes,{'tableName':_0x605d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x364f=['moment','bluebird','path','rimraf','../../config/environment','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api'];(function(_0xc23615,_0x182754){var _0x34c224=function(_0xb77bed){while(--_0xb77bed){_0xc23615['push'](_0xc23615['shift']());}};_0x34c224(++_0x182754);}(_0x364f,0x19f));var _0xf364=function(_0x8935ce,_0x3621c3){_0x8935ce=_0x8935ce-0x0;var _0x1a422f=_0x364f[_0x8935ce];return _0x1a422f;};'use strict';var _=require(_0xf364('0x0'));var util=require(_0xf364('0x1'));var logger=require('../../config/logger')(_0xf364('0x2'));var moment=require(_0xf364('0x3'));var BPromise=require(_0xf364('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf364('0x5'));var rimraf=require(_0xf364('0x6'));var config=require(_0xf364('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x25be8f,_0x20ade2){return _0x25be8f[_0xf364('0x8')](_0xf364('0x9'),attributes,{'tableName':_0xf364('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 67be1f8..81d1dc4 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 _0x8bb2=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8bb2,0x1b6));var _0x28bb=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0x8bb2[_0x3ec333];return _0x15ccb8;};'use strict';var _=require(_0x28bb('0x0'));var util=require(_0x28bb('0x1'));var moment=require(_0x28bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x28bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x28bb('0x4'))['db'];var utils=require(_0x28bb('0x5'));var logger=require(_0x28bb('0x6'))(_0x28bb('0x7'));var config=require(_0x28bb('0x8'));var jayson=require(_0x28bb('0x9'));var client=jayson[_0x28bb('0xa')][_0x28bb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23d66c,_0x5073ab,_0x250dbc){return new BPromise(function(_0x1d1847,_0x530188){return client[_0x28bb('0xc')](_0x23d66c,_0x250dbc)[_0x28bb('0xd')](function(_0x2bcab8){logger[_0x28bb('0xe')](_0x28bb('0xf'),_0x5073ab,_0x28bb('0x10'));logger[_0x28bb('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5073ab,_0x28bb('0x10'),JSON['stringify'](_0x2bcab8));if(_0x2bcab8[_0x28bb('0x12')]){if(_0x2bcab8[_0x28bb('0x12')][_0x28bb('0x13')]===0x1f4){logger['error'](_0x28bb('0xf'),_0x5073ab,_0x2bcab8[_0x28bb('0x12')][_0x28bb('0x14')]);return _0x530188(_0x2bcab8[_0x28bb('0x12')]['message']);}logger['error'](_0x28bb('0xf'),_0x5073ab,_0x2bcab8[_0x28bb('0x12')]['message']);return _0x1d1847(_0x2bcab8[_0x28bb('0x12')][_0x28bb('0x14')]);}else{logger[_0x28bb('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5073ab,_0x28bb('0x10'));_0x1d1847(_0x2bcab8[_0x28bb('0x15')][_0x28bb('0x14')]);}})[_0x28bb('0x16')](function(_0x380b64){logger[_0x28bb('0x12')](_0x28bb('0xf'),_0x5073ab,_0x380b64);_0x530188(_0x380b64);});});} \ No newline at end of file +var _0xce6b=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x265c81,_0x4d539a){var _0x3e63d1=function(_0x5bc90e){while(--_0x5bc90e){_0x265c81['push'](_0x265c81['shift']());}};_0x3e63d1(++_0x4d539a);}(_0xce6b,0xba));var _0xbce6=function(_0x32536d,_0x33720f){_0x32536d=_0x32536d-0x0;var _0x98f70f=_0xce6b[_0x32536d];return _0x98f70f;};'use strict';var _=require(_0xbce6('0x0'));var util=require(_0xbce6('0x1'));var moment=require(_0xbce6('0x2'));var BPromise=require(_0xbce6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbce6('0x4'));var db=require(_0xbce6('0x5'))['db'];var utils=require(_0xbce6('0x6'));var logger=require('../../config/logger')(_0xbce6('0x7'));var config=require(_0xbce6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbce6('0x9')][_0xbce6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e5c29,_0x32bf67,_0x5afe9e){return new BPromise(function(_0x238dd5,_0x22dd85){return client[_0xbce6('0xb')](_0x4e5c29,_0x5afe9e)[_0xbce6('0xc')](function(_0x3e728b){logger[_0xbce6('0xd')](_0xbce6('0xe'),_0x32bf67,_0xbce6('0xf'));logger[_0xbce6('0x10')](_0xbce6('0x11'),_0x32bf67,_0xbce6('0xf'),JSON[_0xbce6('0x12')](_0x3e728b));if(_0x3e728b[_0xbce6('0x13')]){if(_0x3e728b['error'][_0xbce6('0x14')]===0x1f4){logger[_0xbce6('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x32bf67,_0x3e728b[_0xbce6('0x13')][_0xbce6('0x15')]);return _0x22dd85(_0x3e728b['error'][_0xbce6('0x15')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x32bf67,_0x3e728b[_0xbce6('0x13')][_0xbce6('0x15')]);return _0x238dd5(_0x3e728b['error'][_0xbce6('0x15')]);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x32bf67,_0xbce6('0xf'));_0x238dd5(_0x3e728b[_0xbce6('0x16')][_0xbce6('0x15')]);}})[_0xbce6('0x17')](function(_0x143b38){logger[_0xbce6('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x32bf67,_0x143b38);_0x22dd85(_0x143b38);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 85f1667..ec6a3d7 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 _0x5991=['exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe','/:id','/:id/sections','getSections','getResources','create','/:id/clone','post','addSections','/:id/resources','addResources','put','update','delete','destroy','removeSections'];(function(_0x5e63c8,_0x9397cd){var _0x267759=function(_0x333de7){while(--_0x333de7){_0x5e63c8['push'](_0x5e63c8['shift']());}};_0x267759(++_0x9397cd);}(_0x5991,0x1d5));var _0x1599=function(_0x1798f5,_0x4010a4){_0x1798f5=_0x1798f5-0x0;var _0x189541=_0x5991[_0x1798f5];return _0x189541;};'use strict';var multer=require('multer');var util=require(_0x1599('0x0'));var path=require('path');var timeout=require(_0x1599('0x1'));var express=require('express');var router=express[_0x1599('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1599('0x3'));var interaction=require(_0x1599('0x4'));var config=require('../../config/environment');var controller=require(_0x1599('0x5'));router[_0x1599('0x6')]('/',auth[_0x1599('0x7')](),controller[_0x1599('0x8')]);router[_0x1599('0x6')](_0x1599('0x9'),auth[_0x1599('0x7')](),controller['describe']);router['get'](_0x1599('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x1599('0x6')](_0x1599('0xb'),auth['isAuthenticated'](),controller[_0x1599('0xc')]);router[_0x1599('0x6')]('/:id/resources',auth[_0x1599('0x7')](),controller[_0x1599('0xd')]);router['post']('/',auth[_0x1599('0x7')](),controller[_0x1599('0xe')]);router['post'](_0x1599('0xf'),auth[_0x1599('0x7')](),controller['clone']);router[_0x1599('0x10')]('/:id/sections',auth['isAuthenticated'](),controller[_0x1599('0x11')]);router[_0x1599('0x10')](_0x1599('0x12'),auth['isAuthenticated'](),controller[_0x1599('0x13')]);router[_0x1599('0x14')](_0x1599('0xa'),auth[_0x1599('0x7')](),controller[_0x1599('0x15')]);router[_0x1599('0x16')](_0x1599('0xa'),auth['isAuthenticated'](),controller[_0x1599('0x17')]);router[_0x1599('0x16')]('/:id/sections',auth[_0x1599('0x7')](),controller[_0x1599('0x18')]);router['delete']('/:id/resources',auth[_0x1599('0x7')](),controller['removeResources']);module[_0x1599('0x19')]=router; \ No newline at end of file +var _0xe3d4=['../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','show','/:id/sections','getSections','getResources','post','create','/:id/clone','clone','/:id/resources','put','/:id','destroy','delete','removeResources','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x203b90,_0x45ea74){var _0x2e9acb=function(_0x361221){while(--_0x361221){_0x203b90['push'](_0x203b90['shift']());}};_0x2e9acb(++_0x45ea74);}(_0xe3d4,0x1ba));var _0x4e3d=function(_0x134467,_0x40bd2a){_0x134467=_0x134467-0x0;var _0x2ab317=_0xe3d4[_0x134467];return _0x2ab317;};'use strict';var multer=require(_0x4e3d('0x0'));var util=require(_0x4e3d('0x1'));var path=require(_0x4e3d('0x2'));var timeout=require(_0x4e3d('0x3'));var express=require(_0x4e3d('0x4'));var router=express[_0x4e3d('0x5')]();var fs_extra=require(_0x4e3d('0x6'));var auth=require(_0x4e3d('0x7'));var interaction=require(_0x4e3d('0x8'));var config=require(_0x4e3d('0x9'));var controller=require(_0x4e3d('0xa'));router[_0x4e3d('0xb')]('/',auth[_0x4e3d('0xc')](),controller[_0x4e3d('0xd')]);router['get'](_0x4e3d('0xe'),auth[_0x4e3d('0xc')](),controller[_0x4e3d('0xf')]);router[_0x4e3d('0xb')]('/:id',auth[_0x4e3d('0xc')](),controller[_0x4e3d('0x10')]);router[_0x4e3d('0xb')](_0x4e3d('0x11'),auth[_0x4e3d('0xc')](),controller[_0x4e3d('0x12')]);router[_0x4e3d('0xb')]('/:id/resources',auth[_0x4e3d('0xc')](),controller[_0x4e3d('0x13')]);router[_0x4e3d('0x14')]('/',auth[_0x4e3d('0xc')](),controller[_0x4e3d('0x15')]);router[_0x4e3d('0x14')](_0x4e3d('0x16'),auth[_0x4e3d('0xc')](),controller[_0x4e3d('0x17')]);router[_0x4e3d('0x14')]('/:id/sections',auth[_0x4e3d('0xc')](),controller['addSections']);router[_0x4e3d('0x14')](_0x4e3d('0x18'),auth[_0x4e3d('0xc')](),controller['addResources']);router[_0x4e3d('0x19')](_0x4e3d('0x1a'),auth[_0x4e3d('0xc')](),controller['update']);router['delete'](_0x4e3d('0x1a'),auth[_0x4e3d('0xc')](),controller[_0x4e3d('0x1b')]);router['delete'](_0x4e3d('0x11'),auth['isAuthenticated'](),controller['removeSections']);router[_0x4e3d('0x1c')](_0x4e3d('0x18'),auth['isAuthenticated'](),controller[_0x4e3d('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 81e9ecb..3b8580a 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 _0xbb7b=['split','BOOLEAN','exports','STRING','name','crudPermissions','join','getDataValue'];(function(_0x2929ba,_0x506aa6){var _0x365e6e=function(_0x206fd3){while(--_0x206fd3){_0x2929ba['push'](_0x2929ba['shift']());}};_0x365e6e(++_0x506aa6);}(_0xbb7b,0x6a));var _0xbbb7=function(_0x14cbce,_0x28701d){_0x14cbce=_0x14cbce-0x0;var _0x4b2073=_0xbb7b[_0x14cbce];return _0x4b2073;};'use strict';var Sequelize=require('sequelize');module[_0xbbb7('0x0')]={'name':{'type':Sequelize[_0xbbb7('0x1')],'allowNull':![],'unique':_0xbbb7('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4c2bdb){this['setDataValue'](_0xbbb7('0x3'),_0x4c2bdb?_0x4c2bdb[_0xbbb7('0x4')](''):[]);},'get':function(){return this[_0xbbb7('0x5')](_0xbbb7('0x3'))?this[_0xbbb7('0x5')](_0xbbb7('0x3'))[_0xbbb7('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xbbb7('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xbbb7('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xbbb7('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xbbb7('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xbbb7('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xbbb7('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xbbb7('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5ff0=['exports','STRING','name','setDataValue','join','getDataValue','crudPermissions','split','BOOLEAN','sequelize'];(function(_0x335358,_0x1cbfb7){var _0x1ca16e=function(_0x2f8bfb){while(--_0x2f8bfb){_0x335358['push'](_0x335358['shift']());}};_0x1ca16e(++_0x1cbfb7);}(_0x5ff0,0x1cb));var _0x05ff=function(_0x1b53b8,_0x525ffa){_0x1b53b8=_0x1b53b8-0x0;var _0xc85afd=_0x5ff0[_0x1b53b8];return _0xc85afd;};'use strict';var Sequelize=require(_0x05ff('0x0'));module[_0x05ff('0x1')]={'name':{'type':Sequelize[_0x05ff('0x2')],'allowNull':![],'unique':_0x05ff('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x10a5b0){this[_0x05ff('0x4')]('crudPermissions',_0x10a5b0?_0x10a5b0[_0x05ff('0x5')](''):[]);},'get':function(){return this[_0x05ff('0x6')](_0x05ff('0x7'))?this[_0x05ff('0x6')](_0x05ff('0x7'))[_0x05ff('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x05ff('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x05ff('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x05ff('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x05ff('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x05ff('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x05ff('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x05ff('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x05ff('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x05ff('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 4da3bd4..ebbd400 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 _0x2f56=['undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','name','send','index','map','UserProfile','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','nolimit','sort','filters','pick','where','VIRTUAL','filter','options','includeAll','findAll','params','keys','include','merge','catch','create','body','clone','find','omit','createdAt','updatedAt','crudPermissions','get','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','describe','sequelize','transaction','push','ids','getSections','includes','subsections','enabled','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x2f56,0xb5));var _0x62f5=function(_0x5cc808,_0x223b7b){_0x5cc808=_0x5cc808-0x0;var _0xdfa670=_0x2f56[_0x5cc808];return _0xdfa670;};'use strict';var emlformat=require(_0x62f5('0x0'));var rimraf=require(_0x62f5('0x1'));var zipdir=require(_0x62f5('0x2'));var jsonpatch=require(_0x62f5('0x3'));var rp=require('request-promise');var moment=require(_0x62f5('0x4'));var BPromise=require(_0x62f5('0x5'));var Mustache=require(_0x62f5('0x6'));var util=require(_0x62f5('0x7'));var path=require(_0x62f5('0x8'));var sox=require('sox');var csv=require(_0x62f5('0x9'));var ejs=require(_0x62f5('0xa'));var fs=require('fs');var fs_extra=require(_0x62f5('0xb'));var _=require(_0x62f5('0xc'));var squel=require('squel');var crypto=require(_0x62f5('0xd'));var jsforce=require(_0x62f5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x62f5('0x9'));var querystring=require(_0x62f5('0xf'));var Papa=require('papaparse');var Redis=require(_0x62f5('0x10'));var authService=require(_0x62f5('0x11'));var qs=require(_0x62f5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x62f5('0x13'))(_0x62f5('0x14'));var utils=require(_0x62f5('0x15'));var config=require(_0x62f5('0x16'));var licenseUtil=require(_0x62f5('0x17'));var db=require(_0x62f5('0x18'))['db'];config[_0x62f5('0x19')]=_['defaults'](config[_0x62f5('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x62f5('0x1a'))(new Redis(config[_0x62f5('0x19')]));require(_0x62f5('0x1b'))[_0x62f5('0x1c')](socket);function respondWithStatusCode(_0x507eee,_0x1ac04a){_0x1ac04a=_0x1ac04a||0xcc;return function(_0x517467){if(_0x517467){return _0x507eee[_0x62f5('0x1d')](_0x1ac04a);}return _0x507eee[_0x62f5('0x1e')](_0x1ac04a)[_0x62f5('0x1f')]();};}function respondWithResult(_0x256fe2,_0x12ac00){_0x12ac00=_0x12ac00||0xc8;return function(_0xbb421b){if(_0xbb421b){return _0x256fe2[_0x62f5('0x1e')](_0x12ac00)[_0x62f5('0x20')](_0xbb421b);}};}function respondWithFilteredResult(_0x5b49a1,_0x5ed28b){return function(_0x36c77d){if(_0x36c77d){var _0x3cf38b=typeof _0x5ed28b['offset']===_0x62f5('0x21')&&typeof _0x5ed28b[_0x62f5('0x22')]===_0x62f5('0x21');var _0x5952de=_0x36c77d[_0x62f5('0x23')];var _0x160129=_0x3cf38b?0x0:_0x5ed28b[_0x62f5('0x24')];var _0x5de28a=_0x3cf38b?_0x36c77d['count']:_0x5ed28b[_0x62f5('0x24')]+_0x5ed28b[_0x62f5('0x22')];var _0x31d74d;if(_0x5de28a>=_0x5952de){_0x5de28a=_0x5952de;_0x31d74d=0xc8;}else{_0x31d74d=0xce;}_0x5b49a1[_0x62f5('0x1e')](_0x31d74d);return _0x5b49a1[_0x62f5('0x25')](_0x62f5('0x26'),_0x160129+'-'+_0x5de28a+'/'+_0x5952de)[_0x62f5('0x20')](_0x36c77d);}return null;};}function patchUpdates(_0x219ec2){return function(_0x24088d){try{jsonpatch[_0x62f5('0x27')](_0x24088d,_0x219ec2,!![]);}catch(_0x260af5){return BPromise['reject'](_0x260af5);}return _0x24088d['save']();};}function saveUpdates(_0x2e4090,_0x3114a2){return function(_0x104a7a){if(_0x104a7a){return _0x104a7a[_0x62f5('0x28')](_0x2e4090)[_0x62f5('0x29')](function(_0x289b75){return _0x289b75;});}return null;};}function removeEntity(_0x4d8423,_0x28e94a){return function(_0x4ac356){if(_0x4ac356){return _0x4ac356[_0x62f5('0x2a')]()['then'](function(){_0x4d8423[_0x62f5('0x1e')](0xcc)[_0x62f5('0x1f')]();});}};}function handleEntityNotFound(_0x131832,_0x2327da){return function(_0x2068dc){if(!_0x2068dc){_0x131832[_0x62f5('0x1d')](0x194);}return _0x2068dc;};}function handleError(_0x3c597a,_0x486ad2){_0x486ad2=_0x486ad2||0x1f4;return function(_0x21d2c1){logger['error'](_0x21d2c1['stack']);if(_0x21d2c1['name']){delete _0x21d2c1[_0x62f5('0x2b')];}_0x3c597a[_0x62f5('0x1e')](_0x486ad2)[_0x62f5('0x2c')](_0x21d2c1);};}exports[_0x62f5('0x2d')]=function(_0x1ed080,_0x1ea769){var _0x5d4cc9={},_0x12f805={},_0x1862fa={'count':0x0,'rows':[]};var _0x1f2e30=_[_0x62f5('0x2e')](db[_0x62f5('0x2f')][_0x62f5('0x30')],function(_0x49c5a9){return{'name':_0x49c5a9[_0x62f5('0x31')],'type':_0x49c5a9['type'][_0x62f5('0x32')]};});_0x12f805[_0x62f5('0x33')]=_['map'](_0x1f2e30,_0x62f5('0x2b'));_0x12f805['query']=_['keys'](_0x1ed080[_0x62f5('0x34')]);_0x12f805['filters']=_[_0x62f5('0x35')](_0x12f805[_0x62f5('0x33')],_0x12f805[_0x62f5('0x34')]);_0x5d4cc9['attributes']=_['intersection'](_0x12f805[_0x62f5('0x33')],qs['fields'](_0x1ed080['query'][_0x62f5('0x36')]));_0x5d4cc9[_0x62f5('0x37')]=_0x5d4cc9['attributes'][_0x62f5('0x38')]?_0x5d4cc9[_0x62f5('0x37')]:_0x12f805[_0x62f5('0x33')];if(!_0x1ed080[_0x62f5('0x34')]['hasOwnProperty'](_0x62f5('0x39'))){_0x5d4cc9['limit']=qs[_0x62f5('0x22')](_0x1ed080[_0x62f5('0x34')][_0x62f5('0x22')]);_0x5d4cc9['offset']=qs[_0x62f5('0x24')](_0x1ed080[_0x62f5('0x34')]['offset']);}_0x5d4cc9['order']=qs[_0x62f5('0x3a')](_0x1ed080['query']['sort']);_0x5d4cc9['where']=qs[_0x62f5('0x3b')](_[_0x62f5('0x3c')](_0x1ed080[_0x62f5('0x34')],_0x12f805[_0x62f5('0x3b')]),_0x1f2e30);if(_0x1ed080[_0x62f5('0x34')]['filter']){_0x5d4cc9[_0x62f5('0x3d')]=_['merge'](_0x5d4cc9[_0x62f5('0x3d')],{'$or':_[_0x62f5('0x2e')](_0x1f2e30,function(_0x27bd85){if(_0x27bd85['type']!==_0x62f5('0x3e')){var _0x59a661={};_0x59a661[_0x27bd85[_0x62f5('0x2b')]]={'$like':'%'+_0x1ed080[_0x62f5('0x34')][_0x62f5('0x3f')]+'%'};return _0x59a661;}})});}_0x5d4cc9=_['merge']({},_0x5d4cc9,_0x1ed080[_0x62f5('0x40')]);var _0x16162c={'where':_0x5d4cc9[_0x62f5('0x3d')]};return db[_0x62f5('0x2f')]['count'](_0x16162c)[_0x62f5('0x29')](function(_0x4ee947){_0x1862fa['count']=_0x4ee947;if(_0x1ed080[_0x62f5('0x34')][_0x62f5('0x41')]){_0x5d4cc9['include']=[{'all':!![]}];}return db[_0x62f5('0x2f')][_0x62f5('0x42')](_0x5d4cc9);})[_0x62f5('0x29')](function(_0x3b50b8){_0x1862fa['rows']=_0x3b50b8;return _0x1862fa;})[_0x62f5('0x29')](respondWithFilteredResult(_0x1ea769,_0x5d4cc9))['catch'](handleError(_0x1ea769,null));};exports['show']=function(_0x45fae9,_0x441ce6){var _0x443a40={'raw':![],'where':{'id':_0x45fae9[_0x62f5('0x43')]['id']}},_0x2e2fc4={};_0x2e2fc4[_0x62f5('0x33')]=_[_0x62f5('0x44')](db[_0x62f5('0x2f')][_0x62f5('0x30')]);_0x2e2fc4['query']=_[_0x62f5('0x44')](_0x45fae9['query']);_0x2e2fc4['filters']=_[_0x62f5('0x35')](_0x2e2fc4[_0x62f5('0x33')],_0x2e2fc4[_0x62f5('0x34')]);_0x443a40['attributes']=_[_0x62f5('0x35')](_0x2e2fc4[_0x62f5('0x33')],qs['fields'](_0x45fae9[_0x62f5('0x34')][_0x62f5('0x36')]));_0x443a40['attributes']=_0x443a40[_0x62f5('0x37')][_0x62f5('0x38')]?_0x443a40[_0x62f5('0x37')]:_0x2e2fc4[_0x62f5('0x33')];if(_0x45fae9['query']['includeAll']){_0x443a40[_0x62f5('0x45')]=[{'all':!![]}];}_0x443a40=_[_0x62f5('0x46')]({},_0x443a40,_0x45fae9[_0x62f5('0x40')]);return db[_0x62f5('0x2f')]['find'](_0x443a40)[_0x62f5('0x29')](handleEntityNotFound(_0x441ce6,null))[_0x62f5('0x29')](respondWithResult(_0x441ce6,null))[_0x62f5('0x47')](handleError(_0x441ce6,null));};exports[_0x62f5('0x48')]=function(_0x2bcb52,_0x1d8896){return db[_0x62f5('0x2f')][_0x62f5('0x48')](_0x2bcb52[_0x62f5('0x49')],{})[_0x62f5('0x29')](respondWithResult(_0x1d8896,0xc9))[_0x62f5('0x47')](handleError(_0x1d8896,null));};exports[_0x62f5('0x4a')]=function(_0x1617de,_0x206996){var _0x5028fa={'where':{'id':_0x1617de[_0x62f5('0x43')]['id']}},_0x4bfbc6={};_0x4bfbc6[_0x62f5('0x33')]=_[_0x62f5('0x44')](db[_0x62f5('0x2f')][_0x62f5('0x30')]);_0x5028fa[_0x62f5('0x37')]=_['intersection'](_0x4bfbc6[_0x62f5('0x33')],qs['fields'](_0x1617de[_0x62f5('0x34')][_0x62f5('0x36')]));_0x5028fa[_0x62f5('0x37')]=_0x5028fa[_0x62f5('0x37')][_0x62f5('0x38')]?_0x5028fa[_0x62f5('0x37')]:_0x4bfbc6[_0x62f5('0x33')];if(_0x1617de[_0x62f5('0x34')][_0x62f5('0x41')]){_0x5028fa['include']=[{'all':!![]}];}_0x5028fa=_[_0x62f5('0x46')]({},_0x5028fa,_0x1617de['options']);return db['UserProfile'][_0x62f5('0x4b')](_0x5028fa)[_0x62f5('0x29')](handleEntityNotFound(_0x206996,null))['then'](function(_0x1d2481){if(_0x1d2481){var _0x4ea53b=_0x1d2481['get']({'plain':!![]});_0x4ea53b=qs[_0x62f5('0x4c')](_0x4ea53b,['id',_0x62f5('0x4d'),_0x62f5('0x4e'),_0x62f5('0x4f')]);_0x1617de['body']=_[_0x62f5('0x4c')](_0x1617de[_0x62f5('0x49')],['id',_0x62f5('0x4d'),_0x62f5('0x4e')]);return db['sequelize']['transaction'](function(_0x15c627){return db['UserProfile'][_0x62f5('0x48')](_[_0x62f5('0x46')](_0x4ea53b,_0x1617de['body']),{'include':_0x1617de[_0x62f5('0x34')][_0x62f5('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x15c627})[_0x62f5('0x29')](function(_0x1f2617){var _0x844b0f=_0x1f2617[_0x62f5('0x50')]({'plain':!![]});return db['UserProfileSection'][_0x62f5('0x42')]({'where':{'userProfileId':_0x1617de[_0x62f5('0x43')]['id']},'raw':!![]})[_0x62f5('0x29')](function(_0x1410f3){if(_0x1410f3){return BPromise[_0x62f5('0x51')](_0x1410f3,function(_0x4f4c3b){return new BPromise(function(_0x39dee5,_0x41701f){if(_0x4f4c3b[_0x62f5('0x52')]===null||_0x4f4c3b[_0x62f5('0x52')]===0x1)_0x39dee5(null);return db[_0x62f5('0x53')]['findAll']({'where':{'sectionId':_0x4f4c3b['id']},'raw':!![]})[_0x62f5('0x29')](function(_0x2fca48){var _0x43d103=_[_0x62f5('0x2e')](_0x2fca48,function(_0x13e00b){return qs['omit'](_0x13e00b,['id',_0x62f5('0x4d'),_0x62f5('0x4e'),_0x62f5('0x54')]);});_0x39dee5(_0x43d103);})[_0x62f5('0x47')](function(_0x5af425){_0x41701f(_0x5af425);});})[_0x62f5('0x29')](function(_0x4933bd){var _0x33542f=qs[_0x62f5('0x4c')](_0x4f4c3b,['id',_0x62f5('0x4d'),'updatedAt']);_0x33542f[_0x62f5('0x55')]=_0x844b0f['id'];if(_0x4933bd)_0x33542f[_0x62f5('0x56')]=_0x4933bd;return _0x33542f;})[_0x62f5('0x29')](function(_0x175a29){return db[_0x62f5('0x57')][_0x62f5('0x48')](_0x175a29,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x15c627});});})[_0x62f5('0x29')](function(){return _0x844b0f;});}});});});}})['then'](respondWithResult(_0x206996,0xc9))[_0x62f5('0x47')](handleError(_0x206996,null));};exports[_0x62f5('0x28')]=function(_0x1861e9,_0x24a75f){if(_0x1861e9[_0x62f5('0x49')]['id']){delete _0x1861e9[_0x62f5('0x49')]['id'];}return db[_0x62f5('0x2f')]['find']({'where':{'id':_0x1861e9[_0x62f5('0x43')]['id']}})[_0x62f5('0x29')](handleEntityNotFound(_0x24a75f,null))[_0x62f5('0x29')](saveUpdates(_0x1861e9['body'],null))[_0x62f5('0x29')](respondWithResult(_0x24a75f,null))['catch'](handleError(_0x24a75f,null));};exports[_0x62f5('0x2a')]=function(_0x45ddc7,_0x4a1b07){return db[_0x62f5('0x2f')][_0x62f5('0x4b')]({'where':{'id':_0x45ddc7[_0x62f5('0x43')]['id']}})[_0x62f5('0x29')](handleEntityNotFound(_0x4a1b07,null))['then'](removeEntity(_0x4a1b07,null))[_0x62f5('0x47')](handleError(_0x4a1b07,null));};exports[_0x62f5('0x58')]=function(_0x1dbb78,_0x4d187d){return db['UserProfile'][_0x62f5('0x58')]()[_0x62f5('0x29')](respondWithResult(_0x4d187d,null))['catch'](handleError(_0x4d187d,null));};exports['addSections']=function(_0x40b222,_0x10823f){var _0x458871=_0x40b222['body'];return db[_0x62f5('0x2f')]['find']({'where':{'id':_0x40b222[_0x62f5('0x43')]['id']}})[_0x62f5('0x29')](handleEntityNotFound(_0x10823f,null))[_0x62f5('0x29')](function(_0xe03b45){if(_0xe03b45){return db[_0x62f5('0x59')][_0x62f5('0x5a')](function(_0xd9abdf){return db[_0x62f5('0x57')][_0x62f5('0x2a')]({'where':{'userProfileId':_0x40b222[_0x62f5('0x43')]['id'],'sectionId':_[_0x62f5('0x2e')](_0x458871,function(_0x1b794e){return _0x1b794e[_0x62f5('0x54')];})},'transaction':_0xd9abdf})[_0x62f5('0x29')](function(){var _0x223616=_['map'](_0x458871,function(_0x31299c){_0x31299c[_0x62f5('0x55')]=_0x40b222['params']['id'];return _0x31299c;});var _0xe303a6=[];return BPromise[_0x62f5('0x51')](_0x223616,function(_0x240996){return db[_0x62f5('0x57')][_0x62f5('0x48')](_0x240996,{'include':[{'model':db[_0x62f5('0x53')],'as':'Resources'}],'raw':!![],'transaction':_0xd9abdf})[_0x62f5('0x29')](function(_0x2f1dd3){_0xe303a6[_0x62f5('0x5b')](_0x2f1dd3[_0x62f5('0x50')]({'plain':!![]}));});})['then'](function(){return _0xe303a6;});});});}})[_0x62f5('0x29')](function(_0x3e03b4){return _0x3e03b4;})[_0x62f5('0x29')](respondWithResult(_0x10823f,null))[_0x62f5('0x47')](handleError(_0x10823f,null));};exports['removeSections']=function(_0x24539d,_0x1a4409){var _0x5e81c1;return db['UserProfile'][_0x62f5('0x4b')]({'where':{'id':_0x24539d[_0x62f5('0x43')]['id']},'attributes':['id',_0x62f5('0x2b')]})[_0x62f5('0x29')](handleEntityNotFound(_0x1a4409,null))[_0x62f5('0x29')](function(_0xef4fb7){if(_0xef4fb7){_0x5e81c1=_0xef4fb7;return db[_0x62f5('0x57')][_0x62f5('0x2a')]({'where':{'userProfileId':_0x24539d[_0x62f5('0x43')]['id'],'sectionId':_0x24539d[_0x62f5('0x34')][_0x62f5('0x5c')]}});}})[_0x62f5('0x29')](function(){return _0x5e81c1;})['then'](respondWithStatusCode(_0x1a4409,null))[_0x62f5('0x47')](handleError(_0x1a4409,null));};exports[_0x62f5('0x5d')]=function(_0x310760,_0x1dc99b){var _0x1d157c=[];var _0xe4ee27=[];return db[_0x62f5('0x57')][_0x62f5('0x42')]({'where':{'userProfileId':_0x310760[_0x62f5('0x43')]['id']},'raw':!![]})[_0x62f5('0x29')](function(_0x76dd75){_0x1d157c=_['filter'](_0x76dd75,function(_0x57a77e){return _0x57a77e['enabled']===0x1||_['includes']([0x3eb,0x709],_0x57a77e[_0x62f5('0x54')]);});if(!_['isEmpty'](_0x1d157c)){return _['map'](_0x1d157c,function(_0x5e1b3){return _0x5e1b3[_0x62f5('0x54')];});}else{return;}})['then'](function(_0x5dc5e8){if(_0x5dc5e8)_0xe4ee27=_0x5dc5e8;if(_[_0x62f5('0x5e')](_0xe4ee27,0x64)){var _0x420d02=_[_0x62f5('0x4b')](_0x1d157c,{'sectionId':0x64});return hasDefaultDashboard(_0x420d02)[_0x62f5('0x29')](function(_0x1d0674){return _[_0x62f5('0x2e')](_0x1d157c,function(_0x368fbd){if(_0x368fbd['sectionId']===0x64){_0x368fbd[_0x62f5('0x5f')]=_0x1d0674;}return _0x368fbd;});});}else{return;}})[_0x62f5('0x29')](function(_0x28663b){if(_0x28663b)_0x1d157c=_0x28663b;if(_[_0x62f5('0x5e')](_0xe4ee27,0x3eb)){var _0xaa9aa2=_['find'](_0x1d157c,{'sectionId':0x3eb});return getCustomDashboards(_0xaa9aa2)[_0x62f5('0x29')](function(_0x1d5cd1){return _[_0x62f5('0x2e')](_0x1d157c,function(_0x2bcc58){if(_0xaa9aa2[_0x62f5('0x60')]){if(_0x2bcc58[_0x62f5('0x54')]===0x3eb){_0x2bcc58[_0x62f5('0x5f')]=_0x1d5cd1;}}else{if(_0x2bcc58[_0x62f5('0x54')]===0x64){_0x2bcc58[_0x62f5('0x5f')]=_0x1d5cd1;}}return _0x2bcc58;});});}else{return;}})[_0x62f5('0x29')](function(_0x215396){if(_0x215396)_0x1d157c=_0x215396;if(_[_0x62f5('0x5e')](_0xe4ee27,0x709)){var _0x2a39f7=_[_0x62f5('0x4b')](_0x1d157c,{'sectionId':0x709});return getPlugins(_0x2a39f7)['then'](function(_0x2e3216){if(_0x2a39f7[_0x62f5('0x60')]){return _['map'](_0x1d157c,function(_0x49e4f2){if(_0x49e4f2[_0x62f5('0x54')]===0x709){_0x49e4f2[_0x62f5('0x5f')]=_0x2e3216;}return _0x49e4f2;});}else{var _0x4bee11={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2e3216};var _0x1dbb1a=_[_0x62f5('0x2e')](_0x1d157c);_0x1dbb1a[_0x62f5('0x5b')](_0x4bee11);return _0x1dbb1a;}});}else{return;}})['then'](function(_0x511cd0){if(_0x511cd0)_0x1d157c=_0x511cd0;return _[_0x62f5('0x3f')](_0x1d157c,[_0x62f5('0x60'),0x1]);})['then'](respondWithResult(_0x1dc99b,null))['catch'](handleError(_0x1dc99b,null));};function hasDefaultDashboard(_0x3aeee3){var _0x5c9113=[0x65];return new BPromise(function(_0x1b33b3,_0x1c6d1b){try{if(_0x3aeee3[_0x62f5('0x52')]){_0x1b33b3(_0x5c9113);}else{return db[_0x62f5('0x53')]['findOne']({'where':{'sectionId':_0x3aeee3['id']},'raw':!![]})[_0x62f5('0x29')](function(_0x4b230a){_0x4b230a?_0x1b33b3(_0x5c9113):_0x1b33b3();});}}catch(_0x508ed9){_0x1c6d1b(_0x508ed9);}});}function getCustomDashboards(_0x262fad){var _0x1c01dd=[];return new BPromise(function(_0x578217,_0x1f0284){try{if(_0x262fad['autoAssociation']){return db[_0x62f5('0x61')][_0x62f5('0x42')]({'raw':!![]})[_0x62f5('0x29')](function(_0x421886){_0x421886[_0x62f5('0x62')](function(_0x564d69){_0x1c01dd[_0x62f5('0x5b')](_0x564d69['id']+0x1869f);});_0x578217(_0x1c01dd);});}else{return db[_0x62f5('0x53')][_0x62f5('0x42')]({'where':{'sectionId':_0x262fad['id']},'raw':!![]})['then'](function(_0x1b2e68){_0x1b2e68[_0x62f5('0x62')](function(_0x16f5c8){_0x1c01dd['push'](_0x16f5c8['resourceId']+0x1869f);});_0x578217(_0x1c01dd);});}}catch(_0x422d85){_0x1f0284(_0x422d85);}});}function getPlugins(_0x1b816d){var _0x772910=[];return new BPromise(function(_0x5e30a2,_0x479e83){try{if(_0x1b816d[_0x62f5('0x52')]){return db[_0x62f5('0x63')]['findAll']({'raw':!![]})[_0x62f5('0x29')](function(_0x1ca9f4){_0x1ca9f4['forEach'](function(_0xf00282){_0x772910[_0x62f5('0x5b')](_0xf00282['id']+0x15b38);});_0x5e30a2(_0x772910);});}else{return db[_0x62f5('0x53')][_0x62f5('0x42')]({'where':{'sectionId':_0x1b816d['id']},'raw':!![]})[_0x62f5('0x29')](function(_0x3d1cad){_0x3d1cad[_0x62f5('0x62')](function(_0x53531c){_0x772910['push'](_0x53531c[_0x62f5('0x64')]+0x15b38);});_0x5e30a2(_0x772910);});}}catch(_0x1e1a1e){_0x479e83(_0x1e1a1e);}});}exports[_0x62f5('0x65')]=function(_0x5df87b,_0x116d54){return db['UserProfile'][_0x62f5('0x4b')]({'where':{'id':_0x5df87b[_0x62f5('0x43')]['id']}})['then'](handleEntityNotFound(_0x116d54,null))[_0x62f5('0x29')](function(_0x2fb0f4){if(_0x2fb0f4){return db[_0x62f5('0x59')][_0x62f5('0x5a')](function(_0x34a103){return db['UserProfileSection'][_0x62f5('0x42')]({'where':{'userProfileId':_0x5df87b['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0xc0402d){if(_0xc0402d){return db[_0x62f5('0x57')][_0x62f5('0x2a')]({'where':{'userProfileId':_0x5df87b[_0x62f5('0x43')]['id'],'id':_[_0x62f5('0x2e')](_0xc0402d,function(_0x2f7188){return _0x2f7188['id'];})},'transaction':_0x34a103});}})[_0x62f5('0x29')](function(_0x5d623b){var _0x4577e6=_['map'](_0x5df87b['body'],function(_0x2c89a3){_0x2c89a3[_0x62f5('0x55')]=_0x5df87b['params']['id'];return _0x2c89a3;});return db[_0x62f5('0x57')][_0x62f5('0x66')](_0x4577e6,{'raw':!![],'transaction':_0x34a103});})[_0x62f5('0x29')](function(_0x54e4e0){var _0x31e4c1=_['filter'](_[_0x62f5('0x2e')](_0x54e4e0,function(_0x5399fc){return _0x5399fc[_0x62f5('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x31e4c1){return db[_0x62f5('0x57')][_0x62f5('0x42')]({'where':{'userProfileId':_0x5df87b[_0x62f5('0x43')]['id'],'sectionId':_[_0x62f5('0x2e')](_0x31e4c1,function(_0x4052cd){return _0x4052cd[_0x62f5('0x54')];})},'attributes':['id',_0x62f5('0x54')],'raw':!![]})[_0x62f5('0x29')](function(_0x44b095){var _0x16325a=_['map'](_0x5df87b[_0x62f5('0x49')],function(_0x5b3585){_0x5b3585[_0x62f5('0x55')]=_0x5df87b[_0x62f5('0x43')]['id'];return _0x5b3585;});return db[_0x62f5('0x53')]['bulkCreate'](_0x16325a,{'raw':!![],'transaction':_0x34a103});});}})[_0x62f5('0x47')](handleError(_0x116d54,null));});}})[_0x62f5('0x29')](function(_0x260cdb){var _0x25b492=_[_0x62f5('0x2e')](_0x260cdb,function(_0x33c257){return _0x33c257[_0x62f5('0x50')]({'plain':!![]});});})[_0x62f5('0x29')](respondWithResult(_0x116d54,null))['catch'](handleError(_0x116d54,null));};exports['removeResources']=function(_0x21936e,_0x377382,_0x4ed002){return db[_0x62f5('0x2f')][_0x62f5('0x4b')]({'where':{'id':_0x21936e[_0x62f5('0x43')]['id']}})['then'](handleEntityNotFound(_0x377382,null))['then'](function(_0x37e05c){if(_0x37e05c){return _0x37e05c[_0x62f5('0x67')](_0x21936e['query'][_0x62f5('0x5c')]);}})['then'](respondWithStatusCode(_0x377382,null))['catch'](handleError(_0x377382,null));};exports[_0x62f5('0x68')]=function(_0x35ed5a,_0x53732a){var _0x2ebcd3={};if(!_0x35ed5a[_0x62f5('0x34')][_0x62f5('0x69')])throw new Error(_0x62f5('0x6a'));if(!_0x35ed5a[_0x62f5('0x34')]['hasOwnProperty'](_0x62f5('0x39'))){_0x2ebcd3[_0x62f5('0x22')]=qs[_0x62f5('0x22')](_0x35ed5a['query']['limit']);_0x2ebcd3['offset']=qs[_0x62f5('0x24')](_0x35ed5a['query'][_0x62f5('0x24')]);}return db[_0x62f5('0x2f')][_0x62f5('0x4b')]({'where':{'id':_0x35ed5a[_0x62f5('0x43')]['id']}})[_0x62f5('0x29')](function(_0x10a216){if(!_0x10a216)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x35ed5a['params']['id']);return db['UserProfile'][_0x62f5('0x68')](_0x35ed5a);})[_0x62f5('0x29')](respondWithFilteredResult(_0x53732a,_0x2ebcd3))[_0x62f5('0x47')](handleError(_0x53732a,null));}; \ No newline at end of file +var _0xa908=['includes','subsections','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','count','set','apply','save','destroy','error','name','index','map','UserProfile','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','clone','get','omit','createdAt','crudPermissions','updatedAt','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','update','find','describe','sequelize','push','removeSections','ids','enabled','isEmpty'];(function(_0x56eaad,_0x13ec47){var _0x287a5b=function(_0x1902f2){while(--_0x1902f2){_0x56eaad['push'](_0x56eaad['shift']());}};_0x287a5b(++_0x13ec47);}(_0xa908,0x1c3));var _0x8a90=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0xa908[_0x2bddf9];return _0x3f3ae9;};'use strict';var emlformat=require(_0x8a90('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a90('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a90('0x2'));var moment=require(_0x8a90('0x3'));var BPromise=require(_0x8a90('0x4'));var Mustache=require(_0x8a90('0x5'));var util=require(_0x8a90('0x6'));var path=require('path');var sox=require(_0x8a90('0x7'));var csv=require(_0x8a90('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a90('0x9'));var _=require(_0x8a90('0xa'));var squel=require(_0x8a90('0xb'));var crypto=require(_0x8a90('0xc'));var jsforce=require(_0x8a90('0xd'));var deskjs=require(_0x8a90('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8a90('0xf'));var Papa=require('papaparse');var Redis=require(_0x8a90('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8a90('0x11'));var as=require(_0x8a90('0x12'));var hardwareService=require(_0x8a90('0x13'));var logger=require(_0x8a90('0x14'))(_0x8a90('0x15'));var utils=require(_0x8a90('0x16'));var config=require(_0x8a90('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8a90('0x18')]=_[_0x8a90('0x19')](config[_0x8a90('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x8a90('0x1a'))(new Redis(config[_0x8a90('0x18')]));require(_0x8a90('0x1b'))['register'](socket);function respondWithStatusCode(_0x38eef3,_0x14e285){_0x14e285=_0x14e285||0xcc;return function(_0x4b2067){if(_0x4b2067){return _0x38eef3[_0x8a90('0x1c')](_0x14e285);}return _0x38eef3[_0x8a90('0x1d')](_0x14e285)[_0x8a90('0x1e')]();};}function respondWithResult(_0x1bfd6c,_0x519fb6){_0x519fb6=_0x519fb6||0xc8;return function(_0x5be505){if(_0x5be505){return _0x1bfd6c[_0x8a90('0x1d')](_0x519fb6)[_0x8a90('0x1f')](_0x5be505);}};}function respondWithFilteredResult(_0x40e491,_0x12dcfc){return function(_0x17ba83){if(_0x17ba83){var _0x2f8c34=typeof _0x12dcfc[_0x8a90('0x20')]===_0x8a90('0x21')&&typeof _0x12dcfc['limit']===_0x8a90('0x21');var _0x4e78c1=_0x17ba83[_0x8a90('0x22')];var _0x3d0861=_0x2f8c34?0x0:_0x12dcfc[_0x8a90('0x20')];var _0x24c9a1=_0x2f8c34?_0x17ba83[_0x8a90('0x22')]:_0x12dcfc[_0x8a90('0x20')]+_0x12dcfc['limit'];var _0x3b7852;if(_0x24c9a1>=_0x4e78c1){_0x24c9a1=_0x4e78c1;_0x3b7852=0xc8;}else{_0x3b7852=0xce;}_0x40e491[_0x8a90('0x1d')](_0x3b7852);return _0x40e491[_0x8a90('0x23')]('Content-Range',_0x3d0861+'-'+_0x24c9a1+'/'+_0x4e78c1)[_0x8a90('0x1f')](_0x17ba83);}return null;};}function patchUpdates(_0x43b8f6){return function(_0x4ac197){try{jsonpatch[_0x8a90('0x24')](_0x4ac197,_0x43b8f6,!![]);}catch(_0x15f93f){return BPromise['reject'](_0x15f93f);}return _0x4ac197[_0x8a90('0x25')]();};}function saveUpdates(_0x36a334,_0x4acc5e){return function(_0x3bb470){if(_0x3bb470){return _0x3bb470['update'](_0x36a334)['then'](function(_0x22fd3f){return _0x22fd3f;});}return null;};}function removeEntity(_0xf68970,_0x29b50b){return function(_0x2bc216){if(_0x2bc216){return _0x2bc216[_0x8a90('0x26')]()['then'](function(){_0xf68970[_0x8a90('0x1d')](0xcc)[_0x8a90('0x1e')]();});}};}function handleEntityNotFound(_0x128375,_0x256b40){return function(_0x5a8639){if(!_0x5a8639){_0x128375[_0x8a90('0x1c')](0x194);}return _0x5a8639;};}function handleError(_0x55c74b,_0x3ed3aa){_0x3ed3aa=_0x3ed3aa||0x1f4;return function(_0xdefa9a){logger[_0x8a90('0x27')](_0xdefa9a['stack']);if(_0xdefa9a[_0x8a90('0x28')]){delete _0xdefa9a[_0x8a90('0x28')];}_0x55c74b[_0x8a90('0x1d')](_0x3ed3aa)['send'](_0xdefa9a);};}exports[_0x8a90('0x29')]=function(_0x2cee63,_0x3443ba){var _0x153154={},_0x2bfb1c={},_0xd3db18={'count':0x0,'rows':[]};var _0x5c0c05=_[_0x8a90('0x2a')](db[_0x8a90('0x2b')]['rawAttributes'],function(_0x47ef20){return{'name':_0x47ef20['fieldName'],'type':_0x47ef20[_0x8a90('0x2c')][_0x8a90('0x2d')]};});_0x2bfb1c[_0x8a90('0x2e')]=_[_0x8a90('0x2a')](_0x5c0c05,_0x8a90('0x28'));_0x2bfb1c['query']=_[_0x8a90('0x2f')](_0x2cee63[_0x8a90('0x30')]);_0x2bfb1c[_0x8a90('0x31')]=_[_0x8a90('0x32')](_0x2bfb1c['model'],_0x2bfb1c['query']);_0x153154[_0x8a90('0x33')]=_['intersection'](_0x2bfb1c[_0x8a90('0x2e')],qs[_0x8a90('0x34')](_0x2cee63['query'][_0x8a90('0x34')]));_0x153154['attributes']=_0x153154[_0x8a90('0x33')]['length']?_0x153154[_0x8a90('0x33')]:_0x2bfb1c[_0x8a90('0x2e')];if(!_0x2cee63[_0x8a90('0x30')][_0x8a90('0x35')](_0x8a90('0x36'))){_0x153154[_0x8a90('0x37')]=qs[_0x8a90('0x37')](_0x2cee63[_0x8a90('0x30')][_0x8a90('0x37')]);_0x153154[_0x8a90('0x20')]=qs[_0x8a90('0x20')](_0x2cee63['query'][_0x8a90('0x20')]);}_0x153154[_0x8a90('0x38')]=qs[_0x8a90('0x39')](_0x2cee63[_0x8a90('0x30')][_0x8a90('0x39')]);_0x153154['where']=qs[_0x8a90('0x31')](_[_0x8a90('0x3a')](_0x2cee63[_0x8a90('0x30')],_0x2bfb1c['filters']),_0x5c0c05);if(_0x2cee63[_0x8a90('0x30')][_0x8a90('0x3b')]){_0x153154[_0x8a90('0x3c')]=_[_0x8a90('0x3d')](_0x153154[_0x8a90('0x3c')],{'$or':_[_0x8a90('0x2a')](_0x5c0c05,function(_0x294289){if(_0x294289['type']!==_0x8a90('0x3e')){var _0x2ba746={};_0x2ba746[_0x294289['name']]={'$like':'%'+_0x2cee63[_0x8a90('0x30')][_0x8a90('0x3b')]+'%'};return _0x2ba746;}})});}_0x153154=_['merge']({},_0x153154,_0x2cee63[_0x8a90('0x3f')]);var _0x27667a={'where':_0x153154[_0x8a90('0x3c')]};return db[_0x8a90('0x2b')]['count'](_0x27667a)[_0x8a90('0x40')](function(_0x141b39){_0xd3db18[_0x8a90('0x22')]=_0x141b39;if(_0x2cee63[_0x8a90('0x30')][_0x8a90('0x41')]){_0x153154[_0x8a90('0x42')]=[{'all':!![]}];}return db[_0x8a90('0x2b')][_0x8a90('0x43')](_0x153154);})[_0x8a90('0x40')](function(_0x10208d){_0xd3db18[_0x8a90('0x44')]=_0x10208d;return _0xd3db18;})[_0x8a90('0x40')](respondWithFilteredResult(_0x3443ba,_0x153154))[_0x8a90('0x45')](handleError(_0x3443ba,null));};exports[_0x8a90('0x46')]=function(_0x267c0e,_0x5f47ce){var _0x1c639c={'raw':![],'where':{'id':_0x267c0e[_0x8a90('0x47')]['id']}},_0x47c5d9={};_0x47c5d9[_0x8a90('0x2e')]=_['keys'](db[_0x8a90('0x2b')][_0x8a90('0x48')]);_0x47c5d9[_0x8a90('0x30')]=_[_0x8a90('0x2f')](_0x267c0e[_0x8a90('0x30')]);_0x47c5d9['filters']=_[_0x8a90('0x32')](_0x47c5d9[_0x8a90('0x2e')],_0x47c5d9[_0x8a90('0x30')]);_0x1c639c[_0x8a90('0x33')]=_[_0x8a90('0x32')](_0x47c5d9[_0x8a90('0x2e')],qs[_0x8a90('0x34')](_0x267c0e[_0x8a90('0x30')][_0x8a90('0x34')]));_0x1c639c[_0x8a90('0x33')]=_0x1c639c[_0x8a90('0x33')][_0x8a90('0x49')]?_0x1c639c[_0x8a90('0x33')]:_0x47c5d9['model'];if(_0x267c0e[_0x8a90('0x30')][_0x8a90('0x41')]){_0x1c639c[_0x8a90('0x42')]=[{'all':!![]}];}_0x1c639c=_[_0x8a90('0x3d')]({},_0x1c639c,_0x267c0e['options']);return db['UserProfile']['find'](_0x1c639c)[_0x8a90('0x40')](handleEntityNotFound(_0x5f47ce,null))[_0x8a90('0x40')](respondWithResult(_0x5f47ce,null))[_0x8a90('0x45')](handleError(_0x5f47ce,null));};exports[_0x8a90('0x4a')]=function(_0x2dd26d,_0x2a027c){return db['UserProfile']['create'](_0x2dd26d[_0x8a90('0x4b')],{})[_0x8a90('0x40')](respondWithResult(_0x2a027c,0xc9))[_0x8a90('0x45')](handleError(_0x2a027c,null));};exports[_0x8a90('0x4c')]=function(_0x5ae29b,_0x15ab9b){var _0x444cd4={'where':{'id':_0x5ae29b[_0x8a90('0x47')]['id']}},_0x1ee780={};_0x1ee780[_0x8a90('0x2e')]=_[_0x8a90('0x2f')](db[_0x8a90('0x2b')][_0x8a90('0x48')]);_0x444cd4[_0x8a90('0x33')]=_[_0x8a90('0x32')](_0x1ee780[_0x8a90('0x2e')],qs[_0x8a90('0x34')](_0x5ae29b[_0x8a90('0x30')][_0x8a90('0x34')]));_0x444cd4[_0x8a90('0x33')]=_0x444cd4[_0x8a90('0x33')][_0x8a90('0x49')]?_0x444cd4[_0x8a90('0x33')]:_0x1ee780[_0x8a90('0x2e')];if(_0x5ae29b[_0x8a90('0x30')]['includeAll']){_0x444cd4[_0x8a90('0x42')]=[{'all':!![]}];}_0x444cd4=_['merge']({},_0x444cd4,_0x5ae29b[_0x8a90('0x3f')]);return db[_0x8a90('0x2b')]['find'](_0x444cd4)[_0x8a90('0x40')](handleEntityNotFound(_0x15ab9b,null))['then'](function(_0x4ac4ad){if(_0x4ac4ad){var _0x1b1ec8=_0x4ac4ad[_0x8a90('0x4d')]({'plain':!![]});_0x1b1ec8=qs[_0x8a90('0x4e')](_0x1b1ec8,['id',_0x8a90('0x4f'),'updatedAt',_0x8a90('0x50')]);_0x5ae29b[_0x8a90('0x4b')]=_[_0x8a90('0x4e')](_0x5ae29b['body'],['id','createdAt',_0x8a90('0x51')]);return db['sequelize'][_0x8a90('0x52')](function(_0x17ace1){return db[_0x8a90('0x2b')]['create'](_[_0x8a90('0x3d')](_0x1b1ec8,_0x5ae29b['body']),{'include':_0x5ae29b[_0x8a90('0x30')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x17ace1})[_0x8a90('0x40')](function(_0x2665e5){var _0x22f5ad=_0x2665e5[_0x8a90('0x4d')]({'plain':!![]});return db[_0x8a90('0x53')][_0x8a90('0x43')]({'where':{'userProfileId':_0x5ae29b[_0x8a90('0x47')]['id']},'raw':!![]})[_0x8a90('0x40')](function(_0x95b804){if(_0x95b804){return BPromise[_0x8a90('0x54')](_0x95b804,function(_0x347e47){return new BPromise(function(_0xae6ee9,_0x4ba0c0){if(_0x347e47[_0x8a90('0x55')]===null||_0x347e47[_0x8a90('0x55')]===0x1)_0xae6ee9(null);return db[_0x8a90('0x56')][_0x8a90('0x43')]({'where':{'sectionId':_0x347e47['id']},'raw':!![]})['then'](function(_0x1d748e){var _0x32e1cc=_['map'](_0x1d748e,function(_0x5166ff){return qs[_0x8a90('0x4e')](_0x5166ff,['id',_0x8a90('0x4f'),_0x8a90('0x51'),_0x8a90('0x57')]);});_0xae6ee9(_0x32e1cc);})[_0x8a90('0x45')](function(_0x3c41aa){_0x4ba0c0(_0x3c41aa);});})['then'](function(_0x4640bb){var _0x48e098=qs[_0x8a90('0x4e')](_0x347e47,['id',_0x8a90('0x4f'),_0x8a90('0x51')]);_0x48e098[_0x8a90('0x58')]=_0x22f5ad['id'];if(_0x4640bb)_0x48e098[_0x8a90('0x59')]=_0x4640bb;return _0x48e098;})[_0x8a90('0x40')](function(_0x4ed8c3){return db[_0x8a90('0x53')][_0x8a90('0x4a')](_0x4ed8c3,{'include':[{'model':db['UserProfileResource'],'as':_0x8a90('0x59')}],'raw':!![],'transaction':_0x17ace1});});})[_0x8a90('0x40')](function(){return _0x22f5ad;});}});});});}})['then'](respondWithResult(_0x15ab9b,0xc9))[_0x8a90('0x45')](handleError(_0x15ab9b,null));};exports[_0x8a90('0x5a')]=function(_0x937cc4,_0x5e3d7d){if(_0x937cc4[_0x8a90('0x4b')]['id']){delete _0x937cc4[_0x8a90('0x4b')]['id'];}return db[_0x8a90('0x2b')][_0x8a90('0x5b')]({'where':{'id':_0x937cc4[_0x8a90('0x47')]['id']}})[_0x8a90('0x40')](handleEntityNotFound(_0x5e3d7d,null))['then'](saveUpdates(_0x937cc4[_0x8a90('0x4b')],null))[_0x8a90('0x40')](respondWithResult(_0x5e3d7d,null))[_0x8a90('0x45')](handleError(_0x5e3d7d,null));};exports[_0x8a90('0x26')]=function(_0xc99868,_0x14270e){return db['UserProfile'][_0x8a90('0x5b')]({'where':{'id':_0xc99868['params']['id']}})[_0x8a90('0x40')](handleEntityNotFound(_0x14270e,null))[_0x8a90('0x40')](removeEntity(_0x14270e,null))[_0x8a90('0x45')](handleError(_0x14270e,null));};exports[_0x8a90('0x5c')]=function(_0x435998,_0x321601){return db[_0x8a90('0x2b')][_0x8a90('0x5c')]()[_0x8a90('0x40')](respondWithResult(_0x321601,null))[_0x8a90('0x45')](handleError(_0x321601,null));};exports['addSections']=function(_0xef25a8,_0x47bcda){var _0x1b6a15=_0xef25a8[_0x8a90('0x4b')];return db[_0x8a90('0x2b')][_0x8a90('0x5b')]({'where':{'id':_0xef25a8[_0x8a90('0x47')]['id']}})[_0x8a90('0x40')](handleEntityNotFound(_0x47bcda,null))[_0x8a90('0x40')](function(_0x10ac96){if(_0x10ac96){return db[_0x8a90('0x5d')]['transaction'](function(_0x31d01f){return db['UserProfileSection'][_0x8a90('0x26')]({'where':{'userProfileId':_0xef25a8[_0x8a90('0x47')]['id'],'sectionId':_[_0x8a90('0x2a')](_0x1b6a15,function(_0x4da83d){return _0x4da83d['sectionId'];})},'transaction':_0x31d01f})[_0x8a90('0x40')](function(){var _0x296c94=_[_0x8a90('0x2a')](_0x1b6a15,function(_0xb248a9){_0xb248a9[_0x8a90('0x58')]=_0xef25a8['params']['id'];return _0xb248a9;});var _0x2f6509=[];return BPromise['each'](_0x296c94,function(_0x35046c){return db['UserProfileSection']['create'](_0x35046c,{'include':[{'model':db[_0x8a90('0x56')],'as':'Resources'}],'raw':!![],'transaction':_0x31d01f})[_0x8a90('0x40')](function(_0x3a1c8a){_0x2f6509[_0x8a90('0x5e')](_0x3a1c8a[_0x8a90('0x4d')]({'plain':!![]}));});})[_0x8a90('0x40')](function(){return _0x2f6509;});});});}})['then'](function(_0x4ae34e){return _0x4ae34e;})['then'](respondWithResult(_0x47bcda,null))[_0x8a90('0x45')](handleError(_0x47bcda,null));};exports[_0x8a90('0x5f')]=function(_0x520e0a,_0xd75bcb){var _0xbbc12c;return db[_0x8a90('0x2b')][_0x8a90('0x5b')]({'where':{'id':_0x520e0a['params']['id']},'attributes':['id',_0x8a90('0x28')]})[_0x8a90('0x40')](handleEntityNotFound(_0xd75bcb,null))[_0x8a90('0x40')](function(_0x4be88b){if(_0x4be88b){_0xbbc12c=_0x4be88b;return db[_0x8a90('0x53')][_0x8a90('0x26')]({'where':{'userProfileId':_0x520e0a['params']['id'],'sectionId':_0x520e0a[_0x8a90('0x30')][_0x8a90('0x60')]}});}})['then'](function(){return _0xbbc12c;})[_0x8a90('0x40')](respondWithStatusCode(_0xd75bcb,null))['catch'](handleError(_0xd75bcb,null));};exports['getSections']=function(_0x5f097d,_0x36c4d9){var _0x468ac7=[];var _0x31e57d=[];return db['UserProfileSection'][_0x8a90('0x43')]({'where':{'userProfileId':_0x5f097d[_0x8a90('0x47')]['id']},'raw':!![]})['then'](function(_0x1baf53){_0x468ac7=_[_0x8a90('0x3b')](_0x1baf53,function(_0x460b4a){return _0x460b4a[_0x8a90('0x61')]===0x1||_['includes']([0x3eb,0x709],_0x460b4a[_0x8a90('0x57')]);});if(!_[_0x8a90('0x62')](_0x468ac7)){return _[_0x8a90('0x2a')](_0x468ac7,function(_0x45dfa3){return _0x45dfa3[_0x8a90('0x57')];});}else{return;}})['then'](function(_0x120ba1){if(_0x120ba1)_0x31e57d=_0x120ba1;if(_[_0x8a90('0x63')](_0x31e57d,0x64)){var _0x29104b=_[_0x8a90('0x5b')](_0x468ac7,{'sectionId':0x64});return hasDefaultDashboard(_0x29104b)[_0x8a90('0x40')](function(_0x45d2ba){return _[_0x8a90('0x2a')](_0x468ac7,function(_0x5a18d7){if(_0x5a18d7[_0x8a90('0x57')]===0x64){_0x5a18d7['subsections']=_0x45d2ba;}return _0x5a18d7;});});}else{return;}})[_0x8a90('0x40')](function(_0x1f9336){if(_0x1f9336)_0x468ac7=_0x1f9336;if(_[_0x8a90('0x63')](_0x31e57d,0x3eb)){var _0x193007=_['find'](_0x468ac7,{'sectionId':0x3eb});return getCustomDashboards(_0x193007)[_0x8a90('0x40')](function(_0x2be003){return _['map'](_0x468ac7,function(_0x3f0891){if(_0x193007[_0x8a90('0x61')]){if(_0x3f0891[_0x8a90('0x57')]===0x3eb){_0x3f0891[_0x8a90('0x64')]=_0x2be003;}}else{if(_0x3f0891[_0x8a90('0x57')]===0x64){_0x3f0891[_0x8a90('0x64')]=_0x2be003;}}return _0x3f0891;});});}else{return;}})[_0x8a90('0x40')](function(_0x49eb51){if(_0x49eb51)_0x468ac7=_0x49eb51;if(_[_0x8a90('0x63')](_0x31e57d,0x709)){var _0x5c3757=_[_0x8a90('0x5b')](_0x468ac7,{'sectionId':0x709});return getPlugins(_0x5c3757)['then'](function(_0x41e414){if(_0x5c3757[_0x8a90('0x61')]){return _[_0x8a90('0x2a')](_0x468ac7,function(_0x1fd51c){if(_0x1fd51c[_0x8a90('0x57')]===0x709){_0x1fd51c[_0x8a90('0x64')]=_0x41e414;}return _0x1fd51c;});}else{var _0x233481={'sectionId':0x76c,'enabled':0x1,'subsections':_0x41e414};var _0x3fc253=_[_0x8a90('0x2a')](_0x468ac7);_0x3fc253['push'](_0x233481);return _0x3fc253;}});}else{return;}})[_0x8a90('0x40')](function(_0x51e726){if(_0x51e726)_0x468ac7=_0x51e726;return _['filter'](_0x468ac7,[_0x8a90('0x61'),0x1]);})[_0x8a90('0x40')](respondWithResult(_0x36c4d9,null))['catch'](handleError(_0x36c4d9,null));};function hasDefaultDashboard(_0x520fa9){var _0x348e93=[0x65];return new BPromise(function(_0x856d2c,_0x300aa0){try{if(_0x520fa9['autoAssociation']){_0x856d2c(_0x348e93);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x520fa9['id']},'raw':!![]})[_0x8a90('0x40')](function(_0xab8446){_0xab8446?_0x856d2c(_0x348e93):_0x856d2c();});}}catch(_0x3e2744){_0x300aa0(_0x3e2744);}});}function getCustomDashboards(_0x1e251c){var _0x492d3f=[];return new BPromise(function(_0x22e8d0,_0x8487a6){try{if(_0x1e251c[_0x8a90('0x55')]){return db[_0x8a90('0x65')]['findAll']({'raw':!![]})[_0x8a90('0x40')](function(_0x4e3f8a){_0x4e3f8a[_0x8a90('0x66')](function(_0x2133be){_0x492d3f[_0x8a90('0x5e')](_0x2133be['id']+0x1869f);});_0x22e8d0(_0x492d3f);});}else{return db[_0x8a90('0x56')][_0x8a90('0x43')]({'where':{'sectionId':_0x1e251c['id']},'raw':!![]})[_0x8a90('0x40')](function(_0x53f51e){_0x53f51e[_0x8a90('0x66')](function(_0x4449fb){_0x492d3f[_0x8a90('0x5e')](_0x4449fb[_0x8a90('0x67')]+0x1869f);});_0x22e8d0(_0x492d3f);});}}catch(_0x229480){_0x8487a6(_0x229480);}});}function getPlugins(_0x217ac2){var _0xb92d7d=[];return new BPromise(function(_0x26a8b5,_0x463d95){try{if(_0x217ac2[_0x8a90('0x55')]){return db['Plugin'][_0x8a90('0x43')]({'raw':!![]})[_0x8a90('0x40')](function(_0x56f248){_0x56f248[_0x8a90('0x66')](function(_0x133630){_0xb92d7d[_0x8a90('0x5e')](_0x133630['id']+0x15b38);});_0x26a8b5(_0xb92d7d);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x217ac2['id']},'raw':!![]})[_0x8a90('0x40')](function(_0x4263ef){_0x4263ef['forEach'](function(_0x5e57e8){_0xb92d7d[_0x8a90('0x5e')](_0x5e57e8[_0x8a90('0x67')]+0x15b38);});_0x26a8b5(_0xb92d7d);});}}catch(_0x2816de){_0x463d95(_0x2816de);}});}exports[_0x8a90('0x68')]=function(_0x8c55ac,_0x233230){return db[_0x8a90('0x2b')][_0x8a90('0x5b')]({'where':{'id':_0x8c55ac[_0x8a90('0x47')]['id']}})[_0x8a90('0x40')](handleEntityNotFound(_0x233230,null))[_0x8a90('0x40')](function(_0x47c821){if(_0x47c821){return db[_0x8a90('0x5d')]['transaction'](function(_0x43ddc6){return db['UserProfileSection'][_0x8a90('0x43')]({'where':{'userProfileId':_0x8c55ac[_0x8a90('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x8a90('0x40')](function(_0x1d01de){if(_0x1d01de){return db[_0x8a90('0x53')][_0x8a90('0x26')]({'where':{'userProfileId':_0x8c55ac[_0x8a90('0x47')]['id'],'id':_[_0x8a90('0x2a')](_0x1d01de,function(_0x690812){return _0x690812['id'];})},'transaction':_0x43ddc6});}})[_0x8a90('0x40')](function(_0x42e691){var _0x179967=_['map'](_0x8c55ac['body'],function(_0x1c63dc){_0x1c63dc[_0x8a90('0x58')]=_0x8c55ac[_0x8a90('0x47')]['id'];return _0x1c63dc;});return db[_0x8a90('0x53')][_0x8a90('0x69')](_0x179967,{'raw':!![],'transaction':_0x43ddc6});})[_0x8a90('0x40')](function(_0x51a9f4){var _0x20a0f7=_['filter'](_[_0x8a90('0x2a')](_0x51a9f4,function(_0x26871a){return _0x26871a[_0x8a90('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x20a0f7){return db[_0x8a90('0x53')][_0x8a90('0x43')]({'where':{'userProfileId':_0x8c55ac[_0x8a90('0x47')]['id'],'sectionId':_[_0x8a90('0x2a')](_0x20a0f7,function(_0x39e83a){return _0x39e83a['sectionId'];})},'attributes':['id',_0x8a90('0x57')],'raw':!![]})[_0x8a90('0x40')](function(_0xbefbb1){var _0xabef0d=_[_0x8a90('0x2a')](_0x8c55ac[_0x8a90('0x4b')],function(_0x5dffb0){_0x5dffb0[_0x8a90('0x58')]=_0x8c55ac[_0x8a90('0x47')]['id'];return _0x5dffb0;});return db['UserProfileResource']['bulkCreate'](_0xabef0d,{'raw':!![],'transaction':_0x43ddc6});});}})[_0x8a90('0x45')](handleError(_0x233230,null));});}})[_0x8a90('0x40')](function(_0x334d88){var _0x2d3dc2=_[_0x8a90('0x2a')](_0x334d88,function(_0xabeba2){return _0xabeba2[_0x8a90('0x4d')]({'plain':!![]});});})['then'](respondWithResult(_0x233230,null))['catch'](handleError(_0x233230,null));};exports['removeResources']=function(_0x318b6d,_0x4f8ec9,_0x6c6776){return db['UserProfile']['find']({'where':{'id':_0x318b6d[_0x8a90('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f8ec9,null))[_0x8a90('0x40')](function(_0x5e9919){if(_0x5e9919){return _0x5e9919[_0x8a90('0x6a')](_0x318b6d['query']['ids']);}})[_0x8a90('0x40')](respondWithStatusCode(_0x4f8ec9,null))[_0x8a90('0x45')](handleError(_0x4f8ec9,null));};exports[_0x8a90('0x6b')]=function(_0x5cd066,_0x1345c3){var _0x56b475={};if(!_0x5cd066['query'][_0x8a90('0x6c')])throw new Error(_0x8a90('0x6d'));if(!_0x5cd066[_0x8a90('0x30')][_0x8a90('0x35')](_0x8a90('0x36'))){_0x56b475['limit']=qs[_0x8a90('0x37')](_0x5cd066[_0x8a90('0x30')][_0x8a90('0x37')]);_0x56b475['offset']=qs[_0x8a90('0x20')](_0x5cd066[_0x8a90('0x30')][_0x8a90('0x20')]);}return db['UserProfile'][_0x8a90('0x5b')]({'where':{'id':_0x5cd066['params']['id']}})[_0x8a90('0x40')](function(_0xb7d32e){if(!_0xb7d32e)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x5cd066[_0x8a90('0x47')]['id']);return db[_0x8a90('0x2b')][_0x8a90('0x6b')](_0x5cd066);})[_0x8a90('0x40')](respondWithFilteredResult(_0x1345c3,_0x56b475))['catch'](handleError(_0x1345c3,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index cd8664c..986d693 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 _0x1c63=['update','remove','emit','hasOwnProperty','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x2c9ce8,_0x19783d){var _0x539acd=function(_0x23e74c){while(--_0x23e74c){_0x2c9ce8['push'](_0x2c9ce8['shift']());}};_0x539acd(++_0x19783d);}(_0x1c63,0xdc));var _0x31c6=function(_0x32be74,_0x1c6d78){_0x32be74=_0x32be74-0x0;var _0x59407f=_0x1c63[_0x32be74];return _0x59407f;};'use strict';var EventEmitter=require(_0x31c6('0x0'));var UserProfile=require(_0x31c6('0x1'))['db'][_0x31c6('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x31c6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x31c6('0x4'),'afterDestroy':_0x31c6('0x5')};function emitEvent(_0x2501a8){return function(_0x598eed,_0x12da33,_0x3c1288){UserProfileEvents[_0x31c6('0x6')](_0x2501a8+':'+_0x598eed['id'],_0x598eed);UserProfileEvents[_0x31c6('0x6')](_0x2501a8,_0x598eed);_0x3c1288(null);};}for(var e in events){if(events[_0x31c6('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xaf5a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb','UserProfile'];(function(_0x589eb4,_0xaa2019){var _0xf50816=function(_0x572fc5){while(--_0x572fc5){_0x589eb4['push'](_0x589eb4['shift']());}};_0xf50816(++_0xaa2019);}(_0xaf5a,0x116));var _0xaaf5=function(_0x4e9310,_0x5296e4){_0x4e9310=_0x4e9310-0x0;var _0x346b79=_0xaf5a[_0x4e9310];return _0x346b79;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xaaf5('0x0'))['db'][_0xaaf5('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xaaf5('0x2')](0x0);var events={'afterCreate':_0xaaf5('0x3'),'afterUpdate':_0xaaf5('0x4'),'afterDestroy':_0xaaf5('0x5')};function emitEvent(_0x5c55af){return function(_0x1bdf16,_0x4ae9ed,_0x23fbd9){UserProfileEvents[_0xaaf5('0x6')](_0x5c55af+':'+_0x1bdf16['id'],_0x1bdf16);UserProfileEvents[_0xaaf5('0x6')](_0x5c55af,_0x1bdf16);_0x23fbd9(null);};}for(var e in events){if(events[_0xaaf5('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 3361ca0..04a09b9 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 _0xb68b=['WhatsappQueue','WhatsappAccount','voicequeues','queuecampaigns','parentSections','users','agents','telephones','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','Tag','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','Reports','reportId','metrics','charAt','toUpperCase','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','sequelize','query','define','UserProfile','raw','section','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','isEmpty','union','ignore','autoAssociation','model','all','keys','filters','intersection','attributes','fields','nolimit','limit','offset','sort','where','pick','key','foreignKey','forEach','merge','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','rows','count','Tags','tag','true','chat','dataValues','sms','fax','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','findAll','associatedResources','catch','value','then','UserProfileResource','field','map','AnalyticExtractedReport','resourceId','type','toLowerCase','SquareProject','odbc','childModel','SquareOdbc','name','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','role','agent','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','VoiceMusicOnHold','chanspies','voiceprefixes','Campaign','mailaccounts','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsaccounts','SmsAccount'];(function(_0xb9234d,_0x566e12){var _0x55008a=function(_0x2612c1){while(--_0x2612c1){_0xb9234d['push'](_0xb9234d['shift']());}};_0x55008a(++_0x566e12);}(_0xb68b,0x116));var _0xbb68=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xb68b[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xbb68('0x0'));var attributes=require(_0xbb68('0x1'));var qs=require(_0xbb68('0x2'));var squel=require(_0xbb68('0x3'));module['exports']=function(_0x4d023d){var _0x4372d1=_0x4d023d[_0xbb68('0x4')];function _0x307d1d(_0x11f265,_0x4b0a81){return new Promise(function(_0x5c8268,_0x39fc9c){if(!_0x4b0a81)return _0x5c8268(null);var _0x1db7ef=_0x4b0a81[_0xbb68('0x5')]?{[_0x4b0a81[_0xbb68('0x5')]['field']]:_0x4b0a81['filter']['value']}:undefined;return _0x4372d1[_0x11f265][_0xbb68('0x6')]({'where':_0x1db7ef,'raw':!![]})['then'](function(_0x24281e){_0x4b0a81[_0xbb68('0x7')]=_['map'](_0x24281e,'id');_0x5c8268(_0x4b0a81);})[_0xbb68('0x8')](function(_0x54f1ab){_0x39fc9c(_0x54f1ab);});});}function _0x5b7978(_0x3f8620,_0x1aadd8){return new Promise(function(_0x557e86,_0x13ac82){var _0x2b28c6=_0x3f8620[_0xbb68('0x5')]?{[_0x3f8620[_0xbb68('0x5')]['field']]:_0x3f8620[_0xbb68('0x5')][_0xbb68('0x9')]}:undefined;return _0x4372d1[_0x3f8620['model']][_0xbb68('0x6')]({'where':_0x2b28c6,'raw':!![]})[_0xbb68('0xa')](function(_0x33804e){_0x1aadd8[_0xbb68('0x7')]=_['map'](_0x33804e,function(_0x4bc380){return _0x4bc380['name'];});_0x557e86(_0x1aadd8);})['catch'](function(_0x3704bd){_0x13ac82(_0x3704bd);});});}function _0x1b86a0(_0xf6fbcf,_0x3f808d,_0x294381){if(!_0x3f808d)return Promise['resolve'](null);return new Promise(function(_0x3effae,_0xe1b634){return _0x4372d1[_0xbb68('0xb')][_0xbb68('0x6')]({'where':{'sectionId':_0x3f808d['id']},'raw':!![]})[_0xbb68('0xa')](function(_0x3f83be){if(_0xf6fbcf[_0xbb68('0xc')]&&_0xf6fbcf['field']!=='id'){_0x3f808d[_0xbb68('0x7')]=_[_0xbb68('0xd')](_0x3f83be,function(_0x7345cb){return _0x7345cb[_0xf6fbcf[_0xbb68('0xc')]];});}else{if(_0x294381===_0xbb68('0xe')){_0x3f808d[_0xbb68('0x7')]=_[_0xbb68('0xd')](_0x3f83be,function(_0x5ba0b3){return{'id':_0x5ba0b3[_0xbb68('0xf')],'type':_0x5ba0b3[_0xbb68('0x10')]};});}else{_0x3f808d[_0xbb68('0x7')]=_[_0xbb68('0xd')](_0x3f83be,function(_0x10b19b){return _0x10b19b[_0xbb68('0xf')];});}}_0x3effae(_0x3f808d);})[_0xbb68('0x8')](function(_0x345400){_0xe1b634(_0x345400);});});}function _0x4a3c51(_0x403cf9,_0x4f09e4){var _0x5163c={'parentSections':[]};switch(_0x403cf9[_0xbb68('0x11')]()){case'squareprojects':_0x5163c['childModel']=_0xbb68('0x12');break;case _0xbb68('0x13'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x15');break;case'squarerecordings':_0x5163c[_0xbb68('0x14')]='SquareRecording';_0x5163c['parentSections']=[{'name':'SquareProjects','field':_0xbb68('0x16'),'foreignKey':_0xbb68('0x17')}];break;case _0xbb68('0x18'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x19');break;case _0xbb68('0x1a'):_0x5163c['childModel']=_0xbb68('0x1b');_0x5163c['parentSections']=[{'name':_0xbb68('0x1c'),'field':'id','foreignKey':_0xbb68('0x1d')}];break;case _0xbb68('0x1e'):_0x5163c[_0xbb68('0x14')]='CmList';break;case _0xbb68('0x1f'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x20');break;case'globalcustomfields':_0x5163c[_0xbb68('0x14')]=_0xbb68('0x21');break;case _0xbb68('0x22'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x23');break;case _0xbb68('0x24'):_0x5163c['childModel']='ChatWebsite';break;case _0xbb68('0x25'):_0x5163c['childModel']='FaxQueue';break;case _0xbb68('0x26'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x27');break;case'inboundroutes':case _0xbb68('0x28'):case _0xbb68('0x29'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x2a');break;case _0xbb68('0x2b'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x2c');break;case _0xbb68('0x2d'):_0x5163c[_0xbb68('0x14')]='VoiceMail';break;case _0xbb68('0x2e'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x2f');_0x5163c['parentSections']=[{'name':_0xbb68('0x30'),'field':_0xbb68('0x16'),'foreignKey':_0xbb68('0x31'),'model':'User','filter':{'field':_0xbb68('0x32'),'value':[_0xbb68('0x33')]}},{'name':'Telephones','field':'name','foreignKey':'membername','model':_0xbb68('0x34'),'filter':{'field':_0xbb68('0x32'),'value':[_0xbb68('0x35')]}},{'name':_0xbb68('0x36'),'field':_0xbb68('0x16'),'foreignKey':_0xbb68('0x37'),'model':_0xbb68('0x38'),'filter':{'field':_0xbb68('0x10'),'value':[_0xbb68('0x39')]}},{'name':_0xbb68('0x3a'),'field':_0xbb68('0x16'),'foreignKey':_0xbb68('0x37'),'model':'VoiceQueue','filter':{'field':_0xbb68('0x10'),'value':['outbound']}}];break;case'musiconholds':_0x5163c[_0xbb68('0x14')]=_0xbb68('0x3b');break;case _0xbb68('0x3c'):_0x5163c[_0xbb68('0x14')]='VoiceChanSpy';break;case _0xbb68('0x3d'):_0x5163c[_0xbb68('0x14')]='VoicePrefix';break;case'ivrcampaigns':_0x5163c[_0xbb68('0x14')]=_0xbb68('0x3e');break;case'mailqueues':_0x5163c[_0xbb68('0x14')]='MailQueue';break;case _0xbb68('0x3f'):_0x5163c[_0xbb68('0x14')]='MailAccount';break;case'mailsubstatuses':_0x5163c[_0xbb68('0x14')]=_0xbb68('0x40');break;case _0xbb68('0x41'):_0x5163c[_0xbb68('0x14')]='OpenchannelQueue';break;case _0xbb68('0x42'):_0x5163c['childModel']=_0xbb68('0x43');break;case'smsqueues':_0x5163c['childModel']='SmsQueue';break;case _0xbb68('0x44'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x45');break;case'whatsappqueues':_0x5163c[_0xbb68('0x14')]=_0xbb68('0x46');break;case'whatsappaccounts':_0x5163c[_0xbb68('0x14')]=_0xbb68('0x47');break;case'teams':_0x5163c[_0xbb68('0x14')]='Team';break;case _0xbb68('0x48'):case _0xbb68('0x49'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x38');if(_0x4f09e4){_0x5163c[_0xbb68('0x4a')]=[{'name':_0xbb68('0x36')},{'name':'QueueCampaigns'}];}break;case _0xbb68('0x4b'):case _0xbb68('0x4c'):case _0xbb68('0x4d'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x34');if(_0x4f09e4){_0x5163c[_0xbb68('0x4a')]=[{'name':'Users','filter':{'field':'role','value':[_0xbb68('0x4e'),_0xbb68('0x4f')]},'ignore':!![]},{'name':'Agents'},{'name':_0xbb68('0x50')}];}break;case _0xbb68('0x51'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x52');break;case _0xbb68('0x53'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x54');break;case _0xbb68('0x55'):_0x5163c['childModel']=_0xbb68('0x56');break;case _0xbb68('0x57'):_0x5163c[_0xbb68('0x14')]='SugarcrmAccount';break;case'deskaccounts':_0x5163c[_0xbb68('0x14')]=_0xbb68('0x58');break;case _0xbb68('0x59'):_0x5163c['childModel']=_0xbb68('0x5a');break;case _0xbb68('0x5b'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x34');break;case'cannedanswers':_0x5163c[_0xbb68('0x14')]=_0xbb68('0x5c');break;case _0xbb68('0x5d'):_0x5163c[_0xbb68('0x14')]='Disposition';break;case _0xbb68('0x5e'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x5f');break;case _0xbb68('0x60'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x61');break;case _0xbb68('0x62'):_0x5163c['childModel']='Pause';break;case _0xbb68('0x63'):_0x5163c['childModel']=_0xbb68('0x64');break;case _0xbb68('0x65'):_0x5163c['childModel']=_0xbb68('0x66');break;case _0xbb68('0x67'):_0x5163c['childModel']=_0xbb68('0x68');break;case'templates':_0x5163c[_0xbb68('0x14')]='Template';break;case _0xbb68('0x69'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x6a');break;case'trunks':_0x5163c['childModel']=_0xbb68('0x6b');break;case _0xbb68('0x6c'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x6d');break;case _0xbb68('0x6e'):_0x5163c[_0xbb68('0x14')]=_0xbb68('0x6f');break;case'extractedreports':_0x5163c[_0xbb68('0x14')]='AnalyticExtractedReport';_0x5163c[_0xbb68('0x4a')]=[{'name':_0xbb68('0x70'),'field':'id','foreignKey':_0xbb68('0x71')}];break;case _0xbb68('0x72'):_0x5163c[_0xbb68('0x14')]='AnalyticMetric';break;}return _0x5163c;}function _0x27dcac(_0x27771c,_0x5b11e6){var _0x108187=_0x27771c[_0xbb68('0x73')](0x0)[_0xbb68('0x74')]()+_0x27771c['slice'](0x1);var _0x20ddd9={'type':_0x4372d1['Sequelize'][_0xbb68('0x75')][_0xbb68('0x76')],'raw':!![]};return new Promise(function(_0x13f4b1,_0x47534d){var _0x1dfd9d=squel[_0xbb68('0x77')]()['field'](_0xbb68('0x78')+_0x108187+_0xbb68('0x79'),'id')[_0xbb68('0xc')](_0xbb68('0x7a'))['from']('user_has_'+_0x27771c+'_interactions','ui')['where']('ui.UserId\x20=\x20?',_0x5b11e6['id']);return _0x4372d1[_0xbb68('0x7b')][_0xbb68('0x7c')](_0x1dfd9d['toString'](),_0x20ddd9)[_0xbb68('0xa')](function(_0x519cc7){_0x5b11e6[_0x108187+'OpenTabs']=_0x519cc7;_0x13f4b1(_0x519cc7);})[_0xbb68('0x8')](function(_0x5a8a37){_0x47534d(_0x5a8a37);});});}return _0x4d023d[_0xbb68('0x7d')](_0xbb68('0x7e'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xf37c73){var _0x5ccd72={'raw':_0xf37c73[_0xbb68('0x7c')][_0xbb68('0x7f')],'where':{}};var _0x325b6e={};var _0x195495={'count':0x0,'rows':[]};var _0x67f3c5=_0xf37c73[_0xbb68('0x7c')][_0xbb68('0x80')];var _0x5759fd=_0xf37c73[_0xbb68('0x7c')][_0xbb68('0x81')]||![];var _0x315611=_0x4a3c51(_0x67f3c5,_0x5759fd);if(!_0x315611['childModel'])throw new Error(_0xbb68('0x82')+_0x67f3c5+'\x27');var _0x45132c=[{'name':_0x67f3c5}];if(!_['isEmpty'](_0x315611[_0xbb68('0x4a')]))_0x45132c=_0x315611['parentSections'];var _0x73fd3f=[];for(var _0x426ffc=0x0;_0x426ffc<_0x45132c[_0xbb68('0x83')];_0x426ffc++){_0x73fd3f[_0xbb68('0x84')](_0x4372d1[_0xbb68('0x85')][_0xbb68('0x86')]({'where':{'userProfileId':_0xf37c73['params']['id'],'name':_0x45132c[_0x426ffc][_0xbb68('0x16')]},'raw':!![]}));}return Promise['all'](_0x73fd3f)['then'](function(_0x21319d){var _0x3b370f=_[_0xbb68('0x5')](_0x21319d,function(_0x2d41a7){return _0x2d41a7?_0x2d41a7:undefined;});var _0x34995a=_[_0xbb68('0x5')](_0x45132c,['ignore',!![]]);var _0x228687=_[_0xbb68('0x87')](_0x3b370f)&&_['isEmpty'](_0x34995a)?null:_[_0xbb68('0x88')](_0x34995a,_0x3b370f);if(!_0x228687)return null;var _0x1efbab=[];for(var _0x14ddc1=0x0;_0x14ddc1<_0x228687['length'];_0x14ddc1++){var _0x3e66bd=_[_0xbb68('0x86')](_0x45132c,function(_0x29818a){return _0x228687[_0x14ddc1]?_0x29818a[_0xbb68('0x16')]===_0x228687[_0x14ddc1][_0xbb68('0x16')]:null;});if(_0x3e66bd){if(_0x228687[_0x14ddc1][_0xbb68('0x89')]){_0x1efbab[_0xbb68('0x84')](_0x307d1d(_0x315611[_0xbb68('0x14')],_0x228687[_0x14ddc1]));}else{if(!_0x228687[_0x14ddc1][_0xbb68('0x8a')]){_0x1efbab[_0xbb68('0x84')](_0x1b86a0(_0x3e66bd,_0x228687[_0x14ddc1],_0x315611[_0xbb68('0x14')]));}else{if(_0x3e66bd[_0xbb68('0x8b')]){_0x1efbab['push'](_0x5b7978(_0x3e66bd,_0x228687[_0x14ddc1]));}}}}}return Promise[_0xbb68('0x8c')](_0x1efbab);})[_0xbb68('0xa')](function(_0x5881ac){var _0x7618ec=_0x5881ac;var _0x183f31=null;if(_0x7618ec){_0x183f31=_0x7618ec[_0xbb68('0x83')]===0x1?_0x7618ec[0x0]:null;}if(!_0x183f31&&!_0x7618ec)return _0x195495;var _0x48e1b7=_0x4372d1[_0x315611['childModel']]['rawAttributes'];_0x325b6e[_0xbb68('0x8b')]=_[_0xbb68('0x8d')](_0x48e1b7);_0x325b6e[_0xbb68('0x7c')]=_[_0xbb68('0x8d')](_0xf37c73[_0xbb68('0x7c')]);_0x325b6e[_0xbb68('0x8e')]=_[_0xbb68('0x8f')](_0x325b6e[_0xbb68('0x8b')],_0x325b6e[_0xbb68('0x7c')]);_0x5ccd72[_0xbb68('0x90')]=_['intersection'](_0x325b6e['model'],qs[_0xbb68('0x91')](_0xf37c73['query'][_0xbb68('0x91')]));_0x5ccd72[_0xbb68('0x90')]=_0x5ccd72[_0xbb68('0x90')][_0xbb68('0x83')]?_0x5ccd72[_0xbb68('0x90')]:_0x325b6e[_0xbb68('0x8b')];if(!_0xf37c73['query']['hasOwnProperty'](_0xbb68('0x92'))){_0x5ccd72[_0xbb68('0x93')]=qs[_0xbb68('0x93')](_0xf37c73[_0xbb68('0x7c')][_0xbb68('0x93')]);_0x5ccd72[_0xbb68('0x94')]=qs[_0xbb68('0x94')](_0xf37c73[_0xbb68('0x7c')][_0xbb68('0x94')]);}_0x5ccd72['order']=qs[_0xbb68('0x95')](_0xf37c73[_0xbb68('0x7c')][_0xbb68('0x95')]);_0x5ccd72[_0xbb68('0x96')]=qs[_0xbb68('0x8e')](_[_0xbb68('0x97')](_0xf37c73[_0xbb68('0x7c')],_0x325b6e[_0xbb68('0x8e')]));if(_0xf37c73[_0xbb68('0x7c')]['filter']){_0x5ccd72['where']=_['merge'](_0x5ccd72[_0xbb68('0x96')],{'$or':_[_0xbb68('0xd')](_0x48e1b7,function(_0x3e0073){if(_0x3e0073[_0xbb68('0x10')][_0xbb68('0x98')]!=='VIRTUAL'){var _0x1c6539={};_0x1c6539[_0x3e0073[_0xbb68('0xc')]]={'$like':'%'+_0xf37c73[_0xbb68('0x7c')][_0xbb68('0x5')]+'%'};return _0x1c6539;}})});}var _0x5531af=[];var _0xd0ebdb=null;var _0x347dc5={};if(_0x183f31){_0xd0ebdb=_[_0xbb68('0x86')](_0x45132c,['name',_0x183f31[_0xbb68('0x16')]]);if(_0xd0ebdb[_0xbb68('0xc')]){_0x347dc5={};if(_0x315611[_0xbb68('0x14')]===_0xbb68('0xe')){_0x347dc5[_0xd0ebdb[_0xbb68('0x99')]]=_[_0xbb68('0xd')](_0x183f31[_0xbb68('0x7')],'id');}else{_0x347dc5[_0xd0ebdb[_0xbb68('0x99')]]=_0x183f31['associatedResources'];}_0x5531af['push'](_0x347dc5);}else{_0x5ccd72[_0xbb68('0x96')]['id']=_0x183f31['associatedResources'];}}else{for(var _0x3cce16=0x0;_0x3cce16<_0x7618ec['length'];_0x3cce16++){_0xd0ebdb=_[_0xbb68('0x86')](_0x45132c,[_0xbb68('0x16'),_0x7618ec[_0x3cce16][_0xbb68('0x16')]]);if(_0xd0ebdb['field']){_0x347dc5={};_0x347dc5[_0xd0ebdb[_0xbb68('0x99')]]=_0x7618ec[_0x3cce16][_0xbb68('0x7')];_0x5531af[_0xbb68('0x84')](_0x347dc5);}else{if(!_0x5ccd72['where']['id'])_0x5ccd72[_0xbb68('0x96')]['id']=[];_0x7618ec[_0x3cce16][_0xbb68('0x7')][_0xbb68('0x9a')](function(_0x222d41){_0x5ccd72[_0xbb68('0x96')]['id'][_0xbb68('0x84')](_0x222d41);});}}}if(!_['isEmpty'](_0x5531af)){_0x5ccd72[_0xbb68('0x96')]=_[_0xbb68('0x9b')](_0x5ccd72[_0xbb68('0x96')],{'$and':{'$or':_0x5531af}});}_0x5ccd72=_[_0xbb68('0x9b')]({},_0x5ccd72,_0xf37c73[_0xbb68('0x9c')]);if(_0x183f31&&!_0x183f31['autoAssociation']&&_0x315611[_0xbb68('0x14')]===_0xbb68('0xe')){if(_0xf37c73[_0xbb68('0x7c')][_0xbb68('0x9d')]){_0x5ccd72[_0xbb68('0x9e')]=[{'all':!![]}];}return _0x4372d1[_0x315611['childModel']][_0xbb68('0x6')](_0x5ccd72)[_0xbb68('0xa')](function(_0x7bb9d5){var _0x2683ee=[];_0x7bb9d5[_0xbb68('0x9a')](function(_0x37d8c6){var _0x3d6e59;switch(_0x37d8c6[_0xbb68('0x9f')]){case _0xbb68('0xa0'):_0x3d6e59=_['find'](_0x183f31[_0xbb68('0x7')],function(_0x284153){return _0x284153['id']===_0x37d8c6[_0xbb68('0x71')]&&_0x284153[_0xbb68('0x10')]===_0xbb68('0xa1');});break;case _0xbb68('0xa2'):_0x3d6e59=_['find'](_0x183f31['associatedResources'],function(_0x16b1ae){return _0x16b1ae['id']===_0x37d8c6[_0xbb68('0x71')]&&_0x16b1ae[_0xbb68('0x10')]===_0xbb68('0xa3');});break;}if(_0x3d6e59)_0x2683ee['push'](_0x37d8c6);});_0x195495['count']=_0x2683ee['length'];_0x195495[_0xbb68('0xa4')]=_0x2683ee;return _0x195495;});}else{return _0x4372d1[_0x315611['childModel']][_0xbb68('0xa5')]({'where':_0x5ccd72['where']})[_0xbb68('0xa')](function(_0x3ea669){_0x195495['count']=_0x3ea669;if(_0xf37c73[_0xbb68('0x7c')][_0xbb68('0x9d')]){if(_0x315611['childModel']===_0xbb68('0x1b')){_0x5ccd72[_0xbb68('0x9e')]=[{'model':_0x4372d1[_0xbb68('0x68')],'as':_0xbb68('0xa6'),'attributes':['id',_0xbb68('0x16'),'color'],'required':_0xf37c73['query'][_0xbb68('0xa7')]?!![]:![]},{'model':_0x4372d1['Tag'],'as':'ThroughTags','attributes':['id','name','color'],'through':_0xf37c73['query'][_0xbb68('0xa7')]?{'attributes':[],'where':{'TagId':_0xf37c73[_0xbb68('0x7c')][_0xbb68('0xa7')]||undefined}}:{},'required':_0xf37c73[_0xbb68('0x7c')][_0xbb68('0xa7')]?!![]:![]}];}else{_0x5ccd72[_0xbb68('0x9e')]=[{'all':!![]}];}}return _0x4372d1[_0x315611[_0xbb68('0x14')]][_0xbb68('0x6')](_0x5ccd72);})['then'](function(_0x276cf9){_0x195495[_0xbb68('0xa4')]=_0x276cf9;if(_0x67f3c5===_0xbb68('0x30')&&_0xf37c73[_0xbb68('0x7c')]['openTabs']===_0xbb68('0xa8')){var _0x51b761=[];for(var _0x18f0ee=0x0;_0x18f0ee<_0x195495[_0xbb68('0xa4')][_0xbb68('0x83')];_0x18f0ee++){_0x51b761['push'](_0x27dcac(_0xbb68('0xa9'),_0x195495['rows'][_0x18f0ee][_0xbb68('0xaa')]));_0x51b761[_0xbb68('0x84')](_0x27dcac(_0xbb68('0xab'),_0x195495[_0xbb68('0xa4')][_0x18f0ee][_0xbb68('0xaa')]));_0x51b761[_0xbb68('0x84')](_0x27dcac(_0xbb68('0xac'),_0x195495[_0xbb68('0xa4')][_0x18f0ee]['dataValues']));_0x51b761['push'](_0x27dcac('mail',_0x195495[_0xbb68('0xa4')][_0x18f0ee][_0xbb68('0xaa')]));_0x51b761['push'](_0x27dcac('openchannel',_0x195495[_0xbb68('0xa4')][_0x18f0ee]['dataValues']));_0x51b761['push'](_0x27dcac(_0xbb68('0xad'),_0x195495['rows'][_0x18f0ee][_0xbb68('0xaa')]));}return Promise[_0xbb68('0x8c')](_0x51b761)[_0xbb68('0xa')](function(){return _0x195495;});}return _0x195495;});}});}}});}; \ No newline at end of file +var _0xb774=['Pause','Schedule','sounds','tags','Tag','templates','Template','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','charAt','toUpperCase','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','params','all','ignore','union','push','autoAssociation','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','include','default','custom','CustomReports','count','rows','includeAll','Tags','tag','ThroughTags','color','openTabs','chat','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','models','filter','field','value','findAll','then','associatedResources','catch','model','map','name','resolve','UserProfileResource','AnalyticExtractedReport','type','squareprojects','childModel','SquareProject','odbc','SquareRecording','JscriptyProject','contacts','CmContact','parentSections','Lists','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceRecording','membername','User','role','agent','telephone','VoiceQueues','VoiceQueue','QueueCampaigns','queue','outbound','musiconholds','chanspies','voiceprefixes','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','voicequeues','queuecampaigns','agents','telephones','Agents','Telephones','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','pauses'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb774,0x109));var _0x4b77=function(_0x2dd2ed,_0x4e2dde){_0x2dd2ed=_0x2dd2ed-0x0;var _0xb18d6=_0xb774[_0x2dd2ed];return _0xb18d6;};'use strict';var _=require(_0x4b77('0x0'));var attributes=require(_0x4b77('0x1'));var qs=require(_0x4b77('0x2'));var squel=require('squel');module['exports']=function(_0x21f655){var _0x429967=_0x21f655[_0x4b77('0x3')];function _0x148bc2(_0x2cf5d,_0x351449){return new Promise(function(_0x341025,_0x2bdcbf){if(!_0x351449)return _0x341025(null);var _0x1ad97c=_0x351449[_0x4b77('0x4')]?{[_0x351449[_0x4b77('0x4')][_0x4b77('0x5')]]:_0x351449[_0x4b77('0x4')][_0x4b77('0x6')]}:undefined;return _0x429967[_0x2cf5d][_0x4b77('0x7')]({'where':_0x1ad97c,'raw':!![]})[_0x4b77('0x8')](function(_0x2731f7){_0x351449[_0x4b77('0x9')]=_['map'](_0x2731f7,'id');_0x341025(_0x351449);})[_0x4b77('0xa')](function(_0x460e1f){_0x2bdcbf(_0x460e1f);});});}function _0x4474a5(_0x414125,_0x1ab550){return new Promise(function(_0x192aca,_0x484086){var _0x122729=_0x414125[_0x4b77('0x4')]?{[_0x414125[_0x4b77('0x4')]['field']]:_0x414125[_0x4b77('0x4')][_0x4b77('0x6')]}:undefined;return _0x429967[_0x414125[_0x4b77('0xb')]]['findAll']({'where':_0x122729,'raw':!![]})[_0x4b77('0x8')](function(_0x37fe66){_0x1ab550['associatedResources']=_[_0x4b77('0xc')](_0x37fe66,function(_0x3591b4){return _0x3591b4[_0x4b77('0xd')];});_0x192aca(_0x1ab550);})[_0x4b77('0xa')](function(_0x3950c6){_0x484086(_0x3950c6);});});}function _0x11e871(_0x1375ee,_0x136bb4,_0x2623c7){if(!_0x136bb4)return Promise[_0x4b77('0xe')](null);return new Promise(function(_0x1a4bee,_0x588dc3){return _0x429967[_0x4b77('0xf')]['findAll']({'where':{'sectionId':_0x136bb4['id']},'raw':!![]})[_0x4b77('0x8')](function(_0x881cbd){if(_0x1375ee[_0x4b77('0x5')]&&_0x1375ee[_0x4b77('0x5')]!=='id'){_0x136bb4[_0x4b77('0x9')]=_[_0x4b77('0xc')](_0x881cbd,function(_0x48d68c){return _0x48d68c[_0x1375ee[_0x4b77('0x5')]];});}else{if(_0x2623c7===_0x4b77('0x10')){_0x136bb4[_0x4b77('0x9')]=_[_0x4b77('0xc')](_0x881cbd,function(_0x539d1e){return{'id':_0x539d1e['resourceId'],'type':_0x539d1e[_0x4b77('0x11')]};});}else{_0x136bb4[_0x4b77('0x9')]=_[_0x4b77('0xc')](_0x881cbd,function(_0x29aab1){return _0x29aab1['resourceId'];});}}_0x1a4bee(_0x136bb4);})[_0x4b77('0xa')](function(_0x5cdcf1){_0x588dc3(_0x5cdcf1);});});}function _0x486714(_0x1c4b17,_0x2fc858){var _0x5e7d96={'parentSections':[]};switch(_0x1c4b17['toLowerCase']()){case _0x4b77('0x12'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x14');break;case _0x4b77('0x15'):_0x5e7d96[_0x4b77('0x13')]='SquareOdbc';break;case'squarerecordings':_0x5e7d96['childModel']=_0x4b77('0x16');_0x5e7d96['parentSections']=[{'name':'SquareProjects','field':_0x4b77('0xd'),'foreignKey':'projectName'}];break;case'projects':_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x17');break;case _0x4b77('0x18'):_0x5e7d96['childModel']=_0x4b77('0x19');_0x5e7d96[_0x4b77('0x1a')]=[{'name':_0x4b77('0x1b'),'field':'id','foreignKey':'ListId'}];break;case _0x4b77('0x1c'):_0x5e7d96['childModel']=_0x4b77('0x1d');break;case _0x4b77('0x1e'):_0x5e7d96['childModel']='CmCompany';break;case _0x4b77('0x1f'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x20');break;case _0x4b77('0x21'):_0x5e7d96[_0x4b77('0x13')]='ChatQueue';break;case _0x4b77('0x22'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x23');break;case _0x4b77('0x24'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x25');break;case'faxaccounts':_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x26');break;case'inboundroutes':case _0x4b77('0x27'):case _0x4b77('0x28'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x29');break;case _0x4b77('0x2a'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x2b');break;case'voicemails':_0x5e7d96[_0x4b77('0x13')]='VoiceMail';break;case'voicerecordings':_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x2c');_0x5e7d96[_0x4b77('0x1a')]=[{'name':'Agents','field':_0x4b77('0xd'),'foreignKey':_0x4b77('0x2d'),'model':_0x4b77('0x2e'),'filter':{'field':_0x4b77('0x2f'),'value':[_0x4b77('0x30')]}},{'name':'Telephones','field':_0x4b77('0xd'),'foreignKey':'membername','model':_0x4b77('0x2e'),'filter':{'field':_0x4b77('0x2f'),'value':[_0x4b77('0x31')]}},{'name':_0x4b77('0x32'),'field':_0x4b77('0xd'),'foreignKey':'queue','model':_0x4b77('0x33'),'filter':{'field':_0x4b77('0x11'),'value':['inbound']}},{'name':_0x4b77('0x34'),'field':_0x4b77('0xd'),'foreignKey':_0x4b77('0x35'),'model':_0x4b77('0x33'),'filter':{'field':_0x4b77('0x11'),'value':[_0x4b77('0x36')]}}];break;case _0x4b77('0x37'):_0x5e7d96[_0x4b77('0x13')]='VoiceMusicOnHold';break;case _0x4b77('0x38'):_0x5e7d96[_0x4b77('0x13')]='VoiceChanSpy';break;case _0x4b77('0x39'):_0x5e7d96['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x3a');break;case _0x4b77('0x3b'):_0x5e7d96['childModel']='MailQueue';break;case _0x4b77('0x3c'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x3d');break;case _0x4b77('0x3e'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x3f');break;case _0x4b77('0x40'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x41');break;case _0x4b77('0x42'):_0x5e7d96[_0x4b77('0x13')]='OpenchannelAccount';break;case _0x4b77('0x43'):_0x5e7d96['childModel']='SmsQueue';break;case _0x4b77('0x44'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x45');break;case _0x4b77('0x46'):_0x5e7d96['childModel']=_0x4b77('0x47');break;case'whatsappaccounts':_0x5e7d96['childModel']=_0x4b77('0x48');break;case'teams':_0x5e7d96['childModel']=_0x4b77('0x49');break;case _0x4b77('0x4a'):case _0x4b77('0x4b'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x33');if(_0x2fc858){_0x5e7d96[_0x4b77('0x1a')]=[{'name':_0x4b77('0x32')},{'name':_0x4b77('0x34')}];}break;case'users':case _0x4b77('0x4c'):case _0x4b77('0x4d'):_0x5e7d96[_0x4b77('0x13')]='User';if(_0x2fc858){_0x5e7d96[_0x4b77('0x1a')]=[{'name':'Users','filter':{'field':'role','value':['admin','user']},'ignore':!![]},{'name':_0x4b77('0x4e')},{'name':_0x4b77('0x4f')}];}break;case _0x4b77('0x50'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x51');break;case'salesforceaccounts':_0x5e7d96['childModel']=_0x4b77('0x52');break;case _0x4b77('0x53'):_0x5e7d96[_0x4b77('0x13')]='FreshdeskAccount';break;case _0x4b77('0x54'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x55');break;case _0x4b77('0x56'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x57');break;case'zohoaccounts':_0x5e7d96[_0x4b77('0x13')]='ZohoAccount';break;case _0x4b77('0x58'):_0x5e7d96[_0x4b77('0x13')]='User';break;case _0x4b77('0x59'):_0x5e7d96[_0x4b77('0x13')]='CannedAnswer';break;case _0x4b77('0x5a'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x5b');break;case _0x4b77('0x5c'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x5d');break;case'intervals':_0x5e7d96['childModel']='Interval';break;case _0x4b77('0x5e'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x5f');break;case'scheduler':_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x60');break;case _0x4b77('0x61'):_0x5e7d96[_0x4b77('0x13')]='Sound';break;case _0x4b77('0x62'):_0x5e7d96['childModel']=_0x4b77('0x63');break;case _0x4b77('0x64'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x65');break;case'triggers':_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x66');break;case _0x4b77('0x67'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x68');break;case _0x4b77('0x69'):_0x5e7d96['childModel']=_0x4b77('0x6a');break;case _0x4b77('0x6b'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x6c');break;case _0x4b77('0x6d'):_0x5e7d96[_0x4b77('0x13')]=_0x4b77('0x10');_0x5e7d96[_0x4b77('0x1a')]=[{'name':_0x4b77('0x6e'),'field':'id','foreignKey':_0x4b77('0x6f')}];break;case _0x4b77('0x70'):_0x5e7d96['childModel']='AnalyticMetric';break;}return _0x5e7d96;}function _0x4a0924(_0x177842,_0x215b8c){var _0x39c792=_0x177842[_0x4b77('0x71')](0x0)[_0x4b77('0x72')]()+_0x177842['slice'](0x1);var _0x57319f={'type':_0x429967[_0x4b77('0x73')]['QueryTypes'][_0x4b77('0x74')],'raw':!![]};return new Promise(function(_0xd2f428,_0x432e6f){var _0x4e0788=squel[_0x4b77('0x75')]()[_0x4b77('0x5')](_0x4b77('0x76')+_0x39c792+_0x4b77('0x77'),'id')['field'](_0x4b77('0x78'))[_0x4b77('0x79')](_0x4b77('0x7a')+_0x177842+_0x4b77('0x7b'),'ui')[_0x4b77('0x7c')](_0x4b77('0x7d'),_0x215b8c['id']);return _0x429967[_0x4b77('0x7e')][_0x4b77('0x7f')](_0x4e0788[_0x4b77('0x80')](),_0x57319f)['then'](function(_0x31c752){_0x215b8c[_0x39c792+_0x4b77('0x81')]=_0x31c752;_0xd2f428(_0x31c752);})[_0x4b77('0xa')](function(_0xef560e){_0x432e6f(_0xef560e);});});}return _0x21f655[_0x4b77('0x82')](_0x4b77('0x83'),attributes,{'tableName':_0x4b77('0x84'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x30a131){var _0x26fea3={'raw':_0x30a131[_0x4b77('0x7f')][_0x4b77('0x85')],'where':{}};var _0x29dc38={};var _0x54039f={'count':0x0,'rows':[]};var _0x4d253b=_0x30a131[_0x4b77('0x7f')][_0x4b77('0x86')];var _0x3705bd=_0x30a131[_0x4b77('0x7f')][_0x4b77('0x87')]||![];var _0x3821be=_0x486714(_0x4d253b,_0x3705bd);if(!_0x3821be[_0x4b77('0x13')])throw new Error(_0x4b77('0x88')+_0x4d253b+'\x27');var _0x39a641=[{'name':_0x4d253b}];if(!_[_0x4b77('0x89')](_0x3821be[_0x4b77('0x1a')]))_0x39a641=_0x3821be[_0x4b77('0x1a')];var _0xa99702=[];for(var _0x417df4=0x0;_0x417df4<_0x39a641[_0x4b77('0x8a')];_0x417df4++){_0xa99702['push'](_0x429967[_0x4b77('0x8b')][_0x4b77('0x8c')]({'where':{'userProfileId':_0x30a131[_0x4b77('0x8d')]['id'],'name':_0x39a641[_0x417df4][_0x4b77('0xd')]},'raw':!![]}));}return Promise[_0x4b77('0x8e')](_0xa99702)['then'](function(_0x2d9ab6){var _0x1f7204=_[_0x4b77('0x4')](_0x2d9ab6,function(_0x267727){return _0x267727?_0x267727:undefined;});var _0x547e87=_['filter'](_0x39a641,[_0x4b77('0x8f'),!![]]);var _0x1c4ac7=_[_0x4b77('0x89')](_0x1f7204)&&_[_0x4b77('0x89')](_0x547e87)?null:_[_0x4b77('0x90')](_0x547e87,_0x1f7204);if(!_0x1c4ac7)return null;var _0x579c62=[];for(var _0x353f74=0x0;_0x353f74<_0x1c4ac7[_0x4b77('0x8a')];_0x353f74++){var _0x544649=_['find'](_0x39a641,function(_0x5b0f14){return _0x1c4ac7[_0x353f74]?_0x5b0f14[_0x4b77('0xd')]===_0x1c4ac7[_0x353f74]['name']:null;});if(_0x544649){if(_0x1c4ac7[_0x353f74]['ignore']){_0x579c62[_0x4b77('0x91')](_0x148bc2(_0x3821be[_0x4b77('0x13')],_0x1c4ac7[_0x353f74]));}else{if(!_0x1c4ac7[_0x353f74][_0x4b77('0x92')]){_0x579c62[_0x4b77('0x91')](_0x11e871(_0x544649,_0x1c4ac7[_0x353f74],_0x3821be[_0x4b77('0x13')]));}else{if(_0x544649[_0x4b77('0xb')]){_0x579c62[_0x4b77('0x91')](_0x4474a5(_0x544649,_0x1c4ac7[_0x353f74]));}}}}}return Promise[_0x4b77('0x8e')](_0x579c62);})[_0x4b77('0x8')](function(_0x299360){var _0x521d99=_0x299360;var _0x434537=null;if(_0x521d99){_0x434537=_0x521d99[_0x4b77('0x8a')]===0x1?_0x521d99[0x0]:null;}if(!_0x434537&&!_0x521d99)return _0x54039f;var _0x35023a=_0x429967[_0x3821be[_0x4b77('0x13')]]['rawAttributes'];_0x29dc38[_0x4b77('0xb')]=_[_0x4b77('0x93')](_0x35023a);_0x29dc38[_0x4b77('0x7f')]=_[_0x4b77('0x93')](_0x30a131['query']);_0x29dc38[_0x4b77('0x94')]=_[_0x4b77('0x95')](_0x29dc38[_0x4b77('0xb')],_0x29dc38[_0x4b77('0x7f')]);_0x26fea3[_0x4b77('0x96')]=_[_0x4b77('0x95')](_0x29dc38[_0x4b77('0xb')],qs[_0x4b77('0x97')](_0x30a131['query'][_0x4b77('0x97')]));_0x26fea3[_0x4b77('0x96')]=_0x26fea3[_0x4b77('0x96')][_0x4b77('0x8a')]?_0x26fea3[_0x4b77('0x96')]:_0x29dc38[_0x4b77('0xb')];if(!_0x30a131[_0x4b77('0x7f')][_0x4b77('0x98')]('nolimit')){_0x26fea3[_0x4b77('0x99')]=qs[_0x4b77('0x99')](_0x30a131[_0x4b77('0x7f')][_0x4b77('0x99')]);_0x26fea3[_0x4b77('0x9a')]=qs[_0x4b77('0x9a')](_0x30a131[_0x4b77('0x7f')][_0x4b77('0x9a')]);}_0x26fea3[_0x4b77('0x9b')]=qs[_0x4b77('0x9c')](_0x30a131[_0x4b77('0x7f')][_0x4b77('0x9c')]);_0x26fea3[_0x4b77('0x7c')]=qs[_0x4b77('0x94')](_['pick'](_0x30a131[_0x4b77('0x7f')],_0x29dc38[_0x4b77('0x94')]));if(_0x30a131[_0x4b77('0x7f')][_0x4b77('0x4')]){_0x26fea3[_0x4b77('0x7c')]=_[_0x4b77('0x9d')](_0x26fea3['where'],{'$or':_[_0x4b77('0xc')](_0x35023a,function(_0x133e0c){if(_0x133e0c[_0x4b77('0x11')][_0x4b77('0x9e')]!==_0x4b77('0x9f')){var _0x32e3c0={};_0x32e3c0[_0x133e0c['field']]={'$like':'%'+_0x30a131[_0x4b77('0x7f')][_0x4b77('0x4')]+'%'};return _0x32e3c0;}})});}var _0x36d36a=[];var _0xfb31ae=null;var _0x5351ea={};if(_0x434537){_0xfb31ae=_[_0x4b77('0x8c')](_0x39a641,['name',_0x434537[_0x4b77('0xd')]]);if(_0xfb31ae[_0x4b77('0x5')]){_0x5351ea={};if(_0x3821be['childModel']==='AnalyticExtractedReport'){_0x5351ea[_0xfb31ae['foreignKey']]=_[_0x4b77('0xc')](_0x434537[_0x4b77('0x9')],'id');}else{_0x5351ea[_0xfb31ae[_0x4b77('0xa0')]]=_0x434537[_0x4b77('0x9')];}_0x36d36a[_0x4b77('0x91')](_0x5351ea);}else{_0x26fea3[_0x4b77('0x7c')]['id']=_0x434537[_0x4b77('0x9')];}}else{for(var _0x2967ba=0x0;_0x2967ba<_0x521d99[_0x4b77('0x8a')];_0x2967ba++){_0xfb31ae=_[_0x4b77('0x8c')](_0x39a641,[_0x4b77('0xd'),_0x521d99[_0x2967ba]['name']]);if(_0xfb31ae[_0x4b77('0x5')]){_0x5351ea={};_0x5351ea[_0xfb31ae[_0x4b77('0xa0')]]=_0x521d99[_0x2967ba][_0x4b77('0x9')];_0x36d36a[_0x4b77('0x91')](_0x5351ea);}else{if(!_0x26fea3[_0x4b77('0x7c')]['id'])_0x26fea3['where']['id']=[];_0x521d99[_0x2967ba]['associatedResources'][_0x4b77('0xa1')](function(_0x479300){_0x26fea3[_0x4b77('0x7c')]['id'][_0x4b77('0x91')](_0x479300);});}}}if(!_[_0x4b77('0x89')](_0x36d36a)){_0x26fea3['where']=_[_0x4b77('0x9d')](_0x26fea3[_0x4b77('0x7c')],{'$and':{'$or':_0x36d36a}});}_0x26fea3=_[_0x4b77('0x9d')]({},_0x26fea3,_0x30a131['options']);if(_0x434537&&!_0x434537['autoAssociation']&&_0x3821be[_0x4b77('0x13')]===_0x4b77('0x10')){if(_0x30a131[_0x4b77('0x7f')]['includeAll']){_0x26fea3[_0x4b77('0xa2')]=[{'all':!![]}];}return _0x429967[_0x3821be[_0x4b77('0x13')]][_0x4b77('0x7')](_0x26fea3)[_0x4b77('0x8')](function(_0x2987aa){var _0x1b41a0=[];_0x2987aa[_0x4b77('0xa1')](function(_0x415179){var _0x98ab2;switch(_0x415179['reportType']){case _0x4b77('0xa3'):_0x98ab2=_[_0x4b77('0x8c')](_0x434537['associatedResources'],function(_0x123f7b){return _0x123f7b['id']===_0x415179['reportId']&&_0x123f7b[_0x4b77('0x11')]==='DefaultReports';});break;case _0x4b77('0xa4'):_0x98ab2=_[_0x4b77('0x8c')](_0x434537[_0x4b77('0x9')],function(_0x16cce5){return _0x16cce5['id']===_0x415179[_0x4b77('0x6f')]&&_0x16cce5['type']===_0x4b77('0xa5');});break;}if(_0x98ab2)_0x1b41a0[_0x4b77('0x91')](_0x415179);});_0x54039f[_0x4b77('0xa6')]=_0x1b41a0['length'];_0x54039f[_0x4b77('0xa7')]=_0x1b41a0;return _0x54039f;});}else{return _0x429967[_0x3821be[_0x4b77('0x13')]][_0x4b77('0xa6')]({'where':_0x26fea3['where']})[_0x4b77('0x8')](function(_0x2dab6d){_0x54039f['count']=_0x2dab6d;if(_0x30a131['query'][_0x4b77('0xa8')]){if(_0x3821be[_0x4b77('0x13')]===_0x4b77('0x19')){_0x26fea3[_0x4b77('0xa2')]=[{'model':_0x429967[_0x4b77('0x63')],'as':_0x4b77('0xa9'),'attributes':['id','name','color'],'required':_0x30a131[_0x4b77('0x7f')][_0x4b77('0xaa')]?!![]:![]},{'model':_0x429967[_0x4b77('0x63')],'as':_0x4b77('0xab'),'attributes':['id',_0x4b77('0xd'),_0x4b77('0xac')],'through':_0x30a131['query'][_0x4b77('0xaa')]?{'attributes':[],'where':{'TagId':_0x30a131['query'][_0x4b77('0xaa')]||undefined}}:{},'required':_0x30a131[_0x4b77('0x7f')]['tag']?!![]:![]}];}else{_0x26fea3[_0x4b77('0xa2')]=[{'all':!![]}];}}return _0x429967[_0x3821be[_0x4b77('0x13')]][_0x4b77('0x7')](_0x26fea3);})['then'](function(_0x4a1e17){_0x54039f[_0x4b77('0xa7')]=_0x4a1e17;if(_0x4d253b==='Agents'&&_0x30a131[_0x4b77('0x7f')][_0x4b77('0xad')]==='true'){var _0x4cecd0=[];for(var _0x361859=0x0;_0x361859<_0x54039f['rows'][_0x4b77('0x8a')];_0x361859++){_0x4cecd0[_0x4b77('0x91')](_0x4a0924(_0x4b77('0xae'),_0x54039f[_0x4b77('0xa7')][_0x361859]['dataValues']));_0x4cecd0['push'](_0x4a0924('sms',_0x54039f[_0x4b77('0xa7')][_0x361859][_0x4b77('0xaf')]));_0x4cecd0[_0x4b77('0x91')](_0x4a0924(_0x4b77('0xb0'),_0x54039f[_0x4b77('0xa7')][_0x361859][_0x4b77('0xaf')]));_0x4cecd0[_0x4b77('0x91')](_0x4a0924(_0x4b77('0xb1'),_0x54039f['rows'][_0x361859][_0x4b77('0xaf')]));_0x4cecd0[_0x4b77('0x91')](_0x4a0924(_0x4b77('0xb2'),_0x54039f['rows'][_0x361859]['dataValues']));_0x4cecd0[_0x4b77('0x91')](_0x4a0924(_0x4b77('0xb3'),_0x54039f[_0x4b77('0xa7')][_0x361859][_0x4b77('0xaf')]));}return Promise[_0x4b77('0x8e')](_0x4cecd0)[_0x4b77('0x8')](function(){return _0x54039f;});}return _0x54039f;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 5aff131..dcb1efc 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 _0x77d4=['util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./userProfile.socket','register','then','UserProfile,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4605dc,_0x3f7ae5){var _0x5d3e81=function(_0x1d0375){while(--_0x1d0375){_0x4605dc['push'](_0x4605dc['shift']());}};_0x5d3e81(++_0x3f7ae5);}(_0x77d4,0x108));var _0x477d=function(_0x2a416a,_0x2f0660){_0x2a416a=_0x2a416a-0x0;var _0x52bb59=_0x77d4[_0x2a416a];return _0x52bb59;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var moment=require('moment');var BPromise=require(_0x477d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x477d('0x2'));var db=require(_0x477d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x477d('0x4'));var config=require(_0x477d('0x5'));var jayson=require(_0x477d('0x6'));var client=jayson[_0x477d('0x7')][_0x477d('0x8')]({'port':0x232a});config[_0x477d('0x9')]=_['defaults'](config['redis'],{'host':_0x477d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x477d('0xb'))[_0x477d('0xc')](socket);function respondWithRpcPromise(_0x204cb9,_0x2c326c,_0x1cef1c){return new BPromise(function(_0x58ff29,_0x932cc9){return client['request'](_0x204cb9,_0x1cef1c)[_0x477d('0xd')](function(_0x462ac1){logger['info'](_0x477d('0xe'),_0x2c326c,_0x477d('0xf'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x2c326c,_0x477d('0xf'),JSON[_0x477d('0x10')](_0x462ac1));if(_0x462ac1['error']){if(_0x462ac1[_0x477d('0x11')][_0x477d('0x12')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x2c326c,_0x462ac1[_0x477d('0x11')]['message']);return _0x932cc9(_0x462ac1[_0x477d('0x11')][_0x477d('0x13')]);}logger[_0x477d('0x11')]('UserProfile,\x20%s,\x20%s',_0x2c326c,_0x462ac1[_0x477d('0x11')][_0x477d('0x13')]);return _0x58ff29(_0x462ac1[_0x477d('0x11')][_0x477d('0x13')]);}else{logger['info'](_0x477d('0xe'),_0x2c326c,'request\x20sent');_0x58ff29(_0x462ac1[_0x477d('0x14')][_0x477d('0x13')]);}})[_0x477d('0x15')](function(_0x458489){logger[_0x477d('0x11')](_0x477d('0xe'),_0x2c326c,_0x458489);_0x932cc9(_0x458489);});});} \ No newline at end of file +var _0x1b65=['message','info','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','UserProfile,\x20%s,\x20%s','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x54d9fd,_0x3d2f76){var _0x5370e1=function(_0x434561){while(--_0x434561){_0x54d9fd['push'](_0x54d9fd['shift']());}};_0x5370e1(++_0x3d2f76);}(_0x1b65,0x1b4));var _0x51b6=function(_0x753873,_0x2fe366){_0x753873=_0x753873-0x0;var _0x2d8a98=_0x1b65[_0x753873];return _0x2d8a98;};'use strict';var _=require(_0x51b6('0x0'));var util=require(_0x51b6('0x1'));var moment=require(_0x51b6('0x2'));var BPromise=require(_0x51b6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x51b6('0x4'));var db=require(_0x51b6('0x5'))['db'];var utils=require(_0x51b6('0x6'));var logger=require(_0x51b6('0x7'))(_0x51b6('0x8'));var config=require(_0x51b6('0x9'));var jayson=require(_0x51b6('0xa'));var client=jayson['client'][_0x51b6('0xb')]({'port':0x232a});config[_0x51b6('0xc')]=_[_0x51b6('0xd')](config[_0x51b6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x51b6('0xe'))(new Redis(config[_0x51b6('0xc')]));require('./userProfile.socket')[_0x51b6('0xf')](socket);function respondWithRpcPromise(_0x5a84a2,_0x5e688b,_0x1cf35d){return new BPromise(function(_0x2ecf16,_0xd44293){return client[_0x51b6('0x10')](_0x5a84a2,_0x1cf35d)[_0x51b6('0x11')](function(_0x5f0c78){logger['info'](_0x51b6('0x12'),_0x5e688b,'request\x20sent');logger['debug'](_0x51b6('0x13'),_0x5e688b,'request\x20sent',JSON[_0x51b6('0x14')](_0x5f0c78));if(_0x5f0c78['error']){if(_0x5f0c78[_0x51b6('0x15')][_0x51b6('0x16')]===0x1f4){logger[_0x51b6('0x15')](_0x51b6('0x12'),_0x5e688b,_0x5f0c78[_0x51b6('0x15')][_0x51b6('0x17')]);return _0xd44293(_0x5f0c78['error'][_0x51b6('0x17')]);}logger[_0x51b6('0x15')](_0x51b6('0x12'),_0x5e688b,_0x5f0c78['error'][_0x51b6('0x17')]);return _0x2ecf16(_0x5f0c78['error'][_0x51b6('0x17')]);}else{logger[_0x51b6('0x18')](_0x51b6('0x12'),_0x5e688b,_0x51b6('0x19'));_0x2ecf16(_0x5f0c78[_0x51b6('0x1a')][_0x51b6('0x17')]);}})['catch'](function(_0x3d883e){logger['error'](_0x51b6('0x12'),_0x5e688b,_0x3d883e);_0xd44293(_0x3d883e);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 70aa3c4..ab04b6a 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 _0xdbbc=['remove','update','emit','removeListener','register','length','./userProfile.events'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xdbbc,0x102));var _0xcdbb=function(_0x291cd6,_0x9e2da8){_0x291cd6=_0x291cd6-0x0;var _0x5927fe=_0xdbbc[_0x291cd6];return _0x5927fe;};'use strict';var UserProfileEvents=require(_0xcdbb('0x0'));var events=['save',_0xcdbb('0x1'),_0xcdbb('0x2')];function createListener(_0x222819,_0x53c298){return function(_0x105bda){_0x53c298[_0xcdbb('0x3')](_0x222819,_0x105bda);};}function removeListener(_0x22d1e9,_0x4ec080){return function(){UserProfileEvents[_0xcdbb('0x4')](_0x22d1e9,_0x4ec080);};}exports[_0xcdbb('0x5')]=function(_0x4ed2ab){for(var _0x458409=0x0,_0x2f69f1=events[_0xcdbb('0x6')];_0x458409<_0x2f69f1;_0x458409++){var _0xce9ccf=events[_0x458409];var _0x4bb022=createListener('userProfile:'+_0xce9ccf,_0x4ed2ab);UserProfileEvents['on'](_0xce9ccf,_0x4bb022);}}; \ No newline at end of file +var _0x54fd=['update','emit','removeListener','length','userProfile:','./userProfile.events','save','remove'];(function(_0x5d10fa,_0x4ff705){var _0x152375=function(_0x526ce5){while(--_0x526ce5){_0x5d10fa['push'](_0x5d10fa['shift']());}};_0x152375(++_0x4ff705);}(_0x54fd,0x175));var _0xd54f=function(_0x262624,_0x106223){_0x262624=_0x262624-0x0;var _0x1064d9=_0x54fd[_0x262624];return _0x1064d9;};'use strict';var UserProfileEvents=require(_0xd54f('0x0'));var events=[_0xd54f('0x1'),_0xd54f('0x2'),_0xd54f('0x3')];function createListener(_0x5296af,_0x4c921e){return function(_0x481186){_0x4c921e[_0xd54f('0x4')](_0x5296af,_0x481186);};}function removeListener(_0xc40970,_0x2cda92){return function(){UserProfileEvents[_0xd54f('0x5')](_0xc40970,_0x2cda92);};}exports['register']=function(_0x25ba6b){for(var _0x3ab8d1=0x0,_0xb9063b=events[_0xd54f('0x6')];_0x3ab8d1<_0xb9063b;_0x3ab8d1++){var _0x171784=events[_0x3ab8d1];var _0x31b79e=createListener(_0xd54f('0x7')+_0x171784,_0x25ba6b);UserProfileEvents['on'](_0x171784,_0x31b79e);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index ac5ea15..6d5530b 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 _0x20d6=['../../config/environment','get','isAuthenticated','/describe','/:id','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x20d6,0x181));var _0x620d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x20d6[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x620d('0x0'));var path=require(_0x620d('0x1'));var timeout=require(_0x620d('0x2'));var express=require(_0x620d('0x3'));var router=express[_0x620d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x620d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x620d('0x6'));var controller=require('./userProfileResource.controller');router[_0x620d('0x7')]('/',auth[_0x620d('0x8')](),controller['index']);router['get'](_0x620d('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x620d('0xa'),auth[_0x620d('0x8')](),controller['show']);router[_0x620d('0xb')]('/',auth[_0x620d('0x8')](),controller[_0x620d('0xc')]);router[_0x620d('0xd')](_0x620d('0xa'),auth[_0x620d('0x8')](),controller[_0x620d('0xe')]);router[_0x620d('0xf')](_0x620d('0xa'),auth[_0x620d('0x8')](),controller[_0x620d('0x10')]);module['exports']=router; \ No newline at end of file +var _0x316d=['put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x3d11be,_0x1b9a8c){var _0x4b657b=function(_0x4a96f2){while(--_0x4a96f2){_0x3d11be['push'](_0x3d11be['shift']());}};_0x4b657b(++_0x1b9a8c);}(_0x316d,0x83));var _0xd316=function(_0x430228,_0x11206a){_0x430228=_0x430228-0x0;var _0x4e19aa=_0x316d[_0x430228];return _0x4e19aa;};'use strict';var multer=require(_0xd316('0x0'));var util=require(_0xd316('0x1'));var path=require(_0xd316('0x2'));var timeout=require('connect-timeout');var express=require(_0xd316('0x3'));var router=express[_0xd316('0x4')]();var fs_extra=require(_0xd316('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd316('0x6'));var config=require(_0xd316('0x7'));var controller=require('./userProfileResource.controller');router[_0xd316('0x8')]('/',auth[_0xd316('0x9')](),controller['index']);router['get'](_0xd316('0xa'),auth[_0xd316('0x9')](),controller[_0xd316('0xb')]);router[_0xd316('0x8')](_0xd316('0xc'),auth['isAuthenticated'](),controller[_0xd316('0xd')]);router[_0xd316('0xe')]('/',auth['isAuthenticated'](),controller[_0xd316('0xf')]);router[_0xd316('0x10')]('/:id',auth[_0xd316('0x9')](),controller[_0xd316('0x11')]);router[_0xd316('0x12')]('/:id',auth[_0xd316('0x9')](),controller[_0xd316('0x13')]);module[_0xd316('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 6b80a34..8ee15cb 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 _0xd032=['STRING','sequelize','exports'];(function(_0x1cda5c,_0x474778){var _0x544fdf=function(_0x4cb5b6){while(--_0x4cb5b6){_0x1cda5c['push'](_0x1cda5c['shift']());}};_0x544fdf(++_0x474778);}(_0xd032,0x178));var _0x2d03=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xd032[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0x2d03('0x0'));module[_0x2d03('0x1')]={'name':{'type':Sequelize[_0x2d03('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5b33=['sequelize','INTEGER','STRING'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x5b33,0xf0));var _0x35b3=function(_0x59f148,_0x20c351){_0x59f148=_0x59f148-0x0;var _0x33cde9=_0x5b33[_0x59f148];return _0x33cde9;};'use strict';var Sequelize=require(_0x35b3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x35b3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x35b3('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 91f1919..779b573 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 _0x5f2f=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0xb15db6,_0x388d94){var _0x1db34d=function(_0x309006){while(--_0x309006){_0xb15db6['push'](_0xb15db6['shift']());}};_0x1db34d(++_0x388d94);}(_0x5f2f,0x73));var _0xf5f2=function(_0x32f5f2,_0x28fc40){_0x32f5f2=_0x32f5f2-0x0;var _0x242184=_0x5f2f[_0x32f5f2];return _0x242184;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};exports['describe']=function(_0x22b645,_0xe0ce7f){return db[_0xf5f2('0x29')][_0xf5f2('0x46')]()['then'](respondWithResult(_0xe0ce7f,null))['catch'](handleError(_0xe0ce7f,null));}; \ No newline at end of file +var _0x47c5=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model'];(function(_0x4c3415,_0x3e7160){var _0x46a808=function(_0x4ea876){while(--_0x4ea876){_0x4c3415['push'](_0x4c3415['shift']());}};_0x46a808(++_0x3e7160);}(_0x47c5,0x165));var _0x547c=function(_0x3ae812,_0x57767f){_0x3ae812=_0x3ae812-0x0;var _0x3f6639=_0x47c5[_0x3ae812];return _0x3f6639;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['UserProfileResource'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['UserProfileResource']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['UserProfileResource'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['UserProfileResource'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));};exports['describe']=function(_0x152982,_0x5258cf){return db[_0x547c('0x2f')][_0x547c('0x51')]()[_0x547c('0x2a')](respondWithResult(_0x5258cf,null))['catch'](handleError(_0x5258cf,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 7038718..dc9ea48 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 _0x01f1=['rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','compositeIndex','resourceId','util','../../config/logger','api','request-promise','path'];(function(_0xd5f088,_0x31afa4){var _0x1e1f17=function(_0x45d63b){while(--_0x45d63b){_0xd5f088['push'](_0xd5f088['shift']());}};_0x1e1f17(++_0x31afa4);}(_0x01f1,0x7f));var _0x101f=function(_0x1e1b5a,_0x13b534){_0x1e1b5a=_0x1e1b5a-0x0;var _0x3206db=_0x01f1[_0x1e1b5a];return _0x3206db;};'use strict';var _=require('lodash');var util=require(_0x101f('0x0'));var logger=require(_0x101f('0x1'))(_0x101f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x101f('0x3'));var fs=require('fs');var path=require(_0x101f('0x4'));var rimraf=require(_0x101f('0x5'));var config=require(_0x101f('0x6'));var attributes=require(_0x101f('0x7'));module['exports']=function(_0x456f8d,_0x2cff20){return _0x456f8d[_0x101f('0x8')](_0x101f('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x101f('0xa'),'fields':[_0x101f('0xb'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd15a=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex','lodash'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0xd15a,0xfb));var _0xad15=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd15a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xad15('0x0'));var util=require(_0xad15('0x1'));var logger=require(_0xad15('0x2'))(_0xad15('0x3'));var moment=require(_0xad15('0x4'));var BPromise=require(_0xad15('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad15('0x6'));var rimraf=require(_0xad15('0x7'));var config=require(_0xad15('0x8'));var attributes=require(_0xad15('0x9'));module[_0xad15('0xa')]=function(_0x4f9102,_0x3b81eb){return _0x4f9102['define'](_0xad15('0xb'),attributes,{'tableName':_0xad15('0xc'),'paranoid':![],'indexes':[{'name':_0xad15('0xd'),'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 f7f6eec..39b9053 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 _0xbdad=['catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x102977,_0x3a99a6){var _0x15c466=function(_0x1a6a12){while(--_0x1a6a12){_0x102977['push'](_0x102977['shift']());}};_0x15c466(++_0x3a99a6);}(_0xbdad,0xf1));var _0xdbda=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xbdad[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0xdbda('0x0'));var moment=require(_0xdbda('0x1'));var BPromise=require(_0xdbda('0x2'));var rs=require(_0xdbda('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdbda('0x4'));var logger=require(_0xdbda('0x5'))(_0xdbda('0x6'));var config=require(_0xdbda('0x7'));var jayson=require(_0xdbda('0x8'));var client=jayson[_0xdbda('0x9')][_0xdbda('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x416d69,_0x2d62f5,_0x1d1f75){return new BPromise(function(_0x213f9d,_0x113292){return client[_0xdbda('0xb')](_0x416d69,_0x1d1f75)['then'](function(_0x2ef3d2){logger[_0xdbda('0xc')](_0xdbda('0xd'),_0x2d62f5,_0xdbda('0xe'));logger['debug'](_0xdbda('0xf'),_0x2d62f5,_0xdbda('0xe'),JSON['stringify'](_0x2ef3d2));if(_0x2ef3d2[_0xdbda('0x10')]){if(_0x2ef3d2[_0xdbda('0x10')][_0xdbda('0x11')]===0x1f4){logger[_0xdbda('0x10')](_0xdbda('0xd'),_0x2d62f5,_0x2ef3d2['error'][_0xdbda('0x12')]);return _0x113292(_0x2ef3d2[_0xdbda('0x10')]['message']);}logger[_0xdbda('0x10')](_0xdbda('0xd'),_0x2d62f5,_0x2ef3d2[_0xdbda('0x10')][_0xdbda('0x12')]);return _0x213f9d(_0x2ef3d2[_0xdbda('0x10')][_0xdbda('0x12')]);}else{logger[_0xdbda('0xc')](_0xdbda('0xd'),_0x2d62f5,_0xdbda('0xe'));_0x213f9d(_0x2ef3d2['result']['message']);}})[_0xdbda('0x13')](function(_0x5d83d7){logger[_0xdbda('0x10')](_0xdbda('0xd'),_0x2d62f5,_0x5d83d7);_0x113292(_0x5d83d7);});});} \ No newline at end of file +var _0x6dc7=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4c450d,_0x5a6b12){var _0x5550da=function(_0x22efee){while(--_0x22efee){_0x4c450d['push'](_0x4c450d['shift']());}};_0x5550da(++_0x5a6b12);}(_0x6dc7,0x177));var _0x76dc=function(_0xcee193,_0x319b69){_0xcee193=_0xcee193-0x0;var _0x51c4be=_0x6dc7[_0xcee193];return _0x51c4be;};'use strict';var _=require('lodash');var util=require(_0x76dc('0x0'));var moment=require('moment');var BPromise=require(_0x76dc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76dc('0x2'));var db=require(_0x76dc('0x3'))['db'];var utils=require(_0x76dc('0x4'));var logger=require(_0x76dc('0x5'))('rpc');var config=require(_0x76dc('0x6'));var jayson=require(_0x76dc('0x7'));var client=jayson[_0x76dc('0x8')][_0x76dc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36af7d,_0x45546f,_0x59db75){return new BPromise(function(_0x4cb7b8,_0x132edc){return client['request'](_0x36af7d,_0x59db75)[_0x76dc('0xa')](function(_0xfacede){logger[_0x76dc('0xb')](_0x76dc('0xc'),_0x45546f,_0x76dc('0xd'));logger['debug'](_0x76dc('0xe'),_0x45546f,_0x76dc('0xd'),JSON['stringify'](_0xfacede));if(_0xfacede[_0x76dc('0xf')]){if(_0xfacede['error'][_0x76dc('0x10')]===0x1f4){logger[_0x76dc('0xf')](_0x76dc('0xc'),_0x45546f,_0xfacede[_0x76dc('0xf')][_0x76dc('0x11')]);return _0x132edc(_0xfacede['error'][_0x76dc('0x11')]);}logger[_0x76dc('0xf')](_0x76dc('0xc'),_0x45546f,_0xfacede[_0x76dc('0xf')][_0x76dc('0x11')]);return _0x4cb7b8(_0xfacede[_0x76dc('0xf')]['message']);}else{logger[_0x76dc('0xb')](_0x76dc('0xc'),_0x45546f,_0x76dc('0xd'));_0x4cb7b8(_0xfacede[_0x76dc('0x12')][_0x76dc('0x11')]);}})[_0x76dc('0x13')](function(_0x31bd10){logger[_0x76dc('0xf')](_0x76dc('0xc'),_0x45546f,_0x31bd10);_0x132edc(_0x31bd10);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 0ec140f..971e28b 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 _0x4cc5=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','delete','destroy','exports'];(function(_0x186591,_0x41385c){var _0x54d42d=function(_0x50e4f9){while(--_0x50e4f9){_0x186591['push'](_0x186591['shift']());}};_0x54d42d(++_0x41385c);}(_0x4cc5,0x1a4));var _0x54cc=function(_0x30851d,_0x1ede8c){_0x30851d=_0x30851d-0x0;var _0x24de2c=_0x4cc5[_0x30851d];return _0x24de2c;};'use strict';var multer=require(_0x54cc('0x0'));var util=require(_0x54cc('0x1'));var path=require(_0x54cc('0x2'));var timeout=require(_0x54cc('0x3'));var express=require(_0x54cc('0x4'));var router=express['Router']();var fs_extra=require(_0x54cc('0x5'));var auth=require(_0x54cc('0x6'));var interaction=require(_0x54cc('0x7'));var config=require(_0x54cc('0x8'));var controller=require('./userProfileSection.controller');router[_0x54cc('0x9')]('/',auth[_0x54cc('0xa')](),controller['index']);router['get'](_0x54cc('0xb'),auth[_0x54cc('0xa')](),controller[_0x54cc('0xc')]);router[_0x54cc('0x9')](_0x54cc('0xd'),auth[_0x54cc('0xa')](),controller[_0x54cc('0xe')]);router['post']('/',auth[_0x54cc('0xa')](),controller[_0x54cc('0xf')]);router[_0x54cc('0x10')]('/:id',auth[_0x54cc('0xa')](),controller['update']);router[_0x54cc('0x11')](_0x54cc('0xd'),auth[_0x54cc('0xa')](),controller[_0x54cc('0x12')]);module[_0x54cc('0x13')]=router; \ No newline at end of file +var _0x6c7d=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','show','post','create','put','/:id','update','delete','destroy','multer','path'];(function(_0x49c019,_0x596a3f){var _0x65c18e=function(_0x2c8c2e){while(--_0x2c8c2e){_0x49c019['push'](_0x49c019['shift']());}};_0x65c18e(++_0x596a3f);}(_0x6c7d,0x1ec));var _0xd6c7=function(_0x147fd4,_0x32c2db){_0x147fd4=_0x147fd4-0x0;var _0x23c887=_0x6c7d[_0x147fd4];return _0x23c887;};'use strict';var multer=require(_0xd6c7('0x0'));var util=require('util');var path=require(_0xd6c7('0x1'));var timeout=require(_0xd6c7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd6c7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd6c7('0x4'));var config=require(_0xd6c7('0x5'));var controller=require(_0xd6c7('0x6'));router['get']('/',auth[_0xd6c7('0x7')](),controller[_0xd6c7('0x8')]);router[_0xd6c7('0x9')](_0xd6c7('0xa'),auth[_0xd6c7('0x7')](),controller['describe']);router[_0xd6c7('0x9')]('/:id',auth[_0xd6c7('0x7')](),controller[_0xd6c7('0xb')]);router[_0xd6c7('0xc')]('/',auth[_0xd6c7('0x7')](),controller[_0xd6c7('0xd')]);router[_0xd6c7('0xe')](_0xd6c7('0xf'),auth[_0xd6c7('0x7')](),controller[_0xd6c7('0x10')]);router[_0xd6c7('0x11')]('/:id',auth[_0xd6c7('0x7')](),controller[_0xd6c7('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index d300a89..fb8d758 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 _0x8f4c=['setDataValue','join','crudPermissions','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x59ea55,_0x550400){var _0x561e90=function(_0x549efb){while(--_0x549efb){_0x59ea55['push'](_0x59ea55['shift']());}};_0x561e90(++_0x550400);}(_0x8f4c,0x113));var _0xc8f4=function(_0x4c2b96,_0x17ab0d){_0x4c2b96=_0x4c2b96-0x0;var _0x2a62bf=_0x8f4c[_0x4c2b96];return _0x2a62bf;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'name':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xc8f4('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xc8f4('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xc8f4('0x2')],'set':function(_0x47350d){this[_0xc8f4('0x5')]('crudPermissions',_0x47350d?_0x47350d[_0xc8f4('0x6')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this['getDataValue'](_0xc8f4('0x7'))['split'](''):[];}}}; \ No newline at end of file +var _0xbaf0=['split','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x21fe98,_0x429019){var _0x49e2eb=function(_0x2d9de8){while(--_0x2d9de8){_0x21fe98['push'](_0x21fe98['shift']());}};_0x49e2eb(++_0x429019);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x232cc7){this[_0x0baf('0x4')](_0x0baf('0x5'),_0x232cc7?_0x232cc7[_0x0baf('0x6')](''):[]);},'get':function(){return this[_0x0baf('0x7')](_0x0baf('0x5'))?this[_0x0baf('0x7')](_0x0baf('0x5'))[_0x0baf('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index e658de4..163f471 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 _0x8319=['moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2dd0b6,_0x550d01){var _0x3d380d=function(_0x19682c){while(--_0x19682c){_0x2dd0b6['push'](_0x2dd0b6['shift']());}};_0x3d380d(++_0x550d01);}(_0x8319,0x1e1));var _0x9831=function(_0x2e3a61,_0x326750){_0x2e3a61=_0x2e3a61-0x0;var _0xa0a33c=_0x8319[_0x2e3a61];return _0xa0a33c;};'use strict';var emlformat=require(_0x9831('0x0'));var rimraf=require(_0x9831('0x1'));var zipdir=require(_0x9831('0x2'));var jsonpatch=require(_0x9831('0x3'));var rp=require(_0x9831('0x4'));var moment=require(_0x9831('0x5'));var BPromise=require(_0x9831('0x6'));var Mustache=require(_0x9831('0x7'));var util=require(_0x9831('0x8'));var path=require(_0x9831('0x9'));var sox=require('sox');var csv=require(_0x9831('0xa'));var ejs=require(_0x9831('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9831('0xc'));var squel=require(_0x9831('0xd'));var crypto=require('crypto');var jsforce=require(_0x9831('0xe'));var deskjs=require(_0x9831('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9831('0x10'));var Redis=require(_0x9831('0x11'));var authService=require(_0x9831('0x12'));var qs=require(_0x9831('0x13'));var as=require(_0x9831('0x14'));var hardwareService=require(_0x9831('0x15'));var logger=require(_0x9831('0x16'))(_0x9831('0x17'));var utils=require(_0x9831('0x18'));var config=require(_0x9831('0x19'));var licenseUtil=require(_0x9831('0x1a'));var db=require(_0x9831('0x1b'))['db'];function respondWithStatusCode(_0x220e4c,_0x20bdde){_0x20bdde=_0x20bdde||0xcc;return function(_0x1c6d67){if(_0x1c6d67){return _0x220e4c[_0x9831('0x1c')](_0x20bdde);}return _0x220e4c[_0x9831('0x1d')](_0x20bdde)[_0x9831('0x1e')]();};}function respondWithResult(_0x5d0441,_0x34f164){_0x34f164=_0x34f164||0xc8;return function(_0x5b9476){if(_0x5b9476){return _0x5d0441['status'](_0x34f164)[_0x9831('0x1f')](_0x5b9476);}};}function respondWithFilteredResult(_0x505c7d,_0x3a5fc3){return function(_0xae37bf){if(_0xae37bf){var _0x40b26a=typeof _0x3a5fc3[_0x9831('0x20')]===_0x9831('0x21')&&typeof _0x3a5fc3[_0x9831('0x22')]==='undefined';var _0x50ad40=_0xae37bf[_0x9831('0x23')];var _0x260fdb=_0x40b26a?0x0:_0x3a5fc3[_0x9831('0x20')];var _0x49c2d7=_0x40b26a?_0xae37bf[_0x9831('0x23')]:_0x3a5fc3[_0x9831('0x20')]+_0x3a5fc3['limit'];var _0x5e124a;if(_0x49c2d7>=_0x50ad40){_0x49c2d7=_0x50ad40;_0x5e124a=0xc8;}else{_0x5e124a=0xce;}_0x505c7d['status'](_0x5e124a);return _0x505c7d['set'](_0x9831('0x24'),_0x260fdb+'-'+_0x49c2d7+'/'+_0x50ad40)[_0x9831('0x1f')](_0xae37bf);}return null;};}function patchUpdates(_0x2d9b46){return function(_0x56854e){try{jsonpatch[_0x9831('0x25')](_0x56854e,_0x2d9b46,!![]);}catch(_0x3baa8c){return BPromise[_0x9831('0x26')](_0x3baa8c);}return _0x56854e[_0x9831('0x27')]();};}function saveUpdates(_0xfd8f52,_0x1f4f68){return function(_0x58cd03){if(_0x58cd03){return _0x58cd03[_0x9831('0x28')](_0xfd8f52)['then'](function(_0x4a0355){return _0x4a0355;});}return null;};}function removeEntity(_0x578109,_0x3ff939){return function(_0x37a473){if(_0x37a473){return _0x37a473['destroy']()[_0x9831('0x29')](function(){_0x578109[_0x9831('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x233580,_0xcaf70b){return function(_0x22e243){if(!_0x22e243){_0x233580[_0x9831('0x1c')](0x194);}return _0x22e243;};}function handleError(_0x453425,_0xb70db9){_0xb70db9=_0xb70db9||0x1f4;return function(_0x1b9982){logger[_0x9831('0x2a')](_0x1b9982[_0x9831('0x2b')]);if(_0x1b9982['name']){delete _0x1b9982[_0x9831('0x2c')];}_0x453425[_0x9831('0x1d')](_0xb70db9)[_0x9831('0x2d')](_0x1b9982);};}exports[_0x9831('0x2e')]=function(_0x2f4eb0,_0x48dae0){var _0x222c86={},_0x5803fb={},_0x4378dd={'count':0x0,'rows':[]};var _0x5768d1=_[_0x9831('0x2f')](db[_0x9831('0x30')][_0x9831('0x31')],function(_0x54bfdd){return{'name':_0x54bfdd[_0x9831('0x32')],'type':_0x54bfdd[_0x9831('0x33')][_0x9831('0x34')]};});_0x5803fb[_0x9831('0x35')]=_[_0x9831('0x2f')](_0x5768d1,_0x9831('0x2c'));_0x5803fb[_0x9831('0x36')]=_[_0x9831('0x37')](_0x2f4eb0['query']);_0x5803fb['filters']=_[_0x9831('0x38')](_0x5803fb[_0x9831('0x35')],_0x5803fb[_0x9831('0x36')]);_0x222c86['attributes']=_[_0x9831('0x38')](_0x5803fb['model'],qs[_0x9831('0x39')](_0x2f4eb0[_0x9831('0x36')]['fields']));_0x222c86['attributes']=_0x222c86['attributes'][_0x9831('0x3a')]?_0x222c86[_0x9831('0x3b')]:_0x5803fb[_0x9831('0x35')];if(!_0x2f4eb0[_0x9831('0x36')][_0x9831('0x3c')]('nolimit')){_0x222c86['limit']=qs['limit'](_0x2f4eb0[_0x9831('0x36')][_0x9831('0x22')]);_0x222c86[_0x9831('0x20')]=qs[_0x9831('0x20')](_0x2f4eb0[_0x9831('0x36')][_0x9831('0x20')]);}_0x222c86['order']=qs[_0x9831('0x3d')](_0x2f4eb0['query'][_0x9831('0x3d')]);_0x222c86[_0x9831('0x3e')]=qs[_0x9831('0x3f')](_[_0x9831('0x40')](_0x2f4eb0[_0x9831('0x36')],_0x5803fb[_0x9831('0x3f')]),_0x5768d1);if(_0x2f4eb0[_0x9831('0x36')]['filter']){_0x222c86[_0x9831('0x3e')]=_[_0x9831('0x41')](_0x222c86[_0x9831('0x3e')],{'$or':_[_0x9831('0x2f')](_0x5768d1,function(_0x3a612d){if(_0x3a612d['type']!==_0x9831('0x42')){var _0x1efdae={};_0x1efdae[_0x3a612d[_0x9831('0x2c')]]={'$like':'%'+_0x2f4eb0[_0x9831('0x36')][_0x9831('0x43')]+'%'};return _0x1efdae;}})});}_0x222c86=_[_0x9831('0x41')]({},_0x222c86,_0x2f4eb0[_0x9831('0x44')]);var _0x2b628e={'where':_0x222c86[_0x9831('0x3e')]};return db[_0x9831('0x30')]['count'](_0x2b628e)[_0x9831('0x29')](function(_0x1c4b1a){_0x4378dd[_0x9831('0x23')]=_0x1c4b1a;if(_0x2f4eb0[_0x9831('0x36')][_0x9831('0x45')]){_0x222c86[_0x9831('0x46')]=[{'all':!![]}];}return db[_0x9831('0x30')][_0x9831('0x47')](_0x222c86);})[_0x9831('0x29')](function(_0x50d41f){_0x4378dd[_0x9831('0x48')]=_0x50d41f;return _0x4378dd;})[_0x9831('0x29')](respondWithFilteredResult(_0x48dae0,_0x222c86))['catch'](handleError(_0x48dae0,null));};exports[_0x9831('0x49')]=function(_0x2d5be9,_0x24bcb3){var _0x4b5caa={'raw':![],'where':{'id':_0x2d5be9[_0x9831('0x4a')]['id']}},_0x49d265={};_0x49d265[_0x9831('0x35')]=_[_0x9831('0x37')](db[_0x9831('0x30')]['rawAttributes']);_0x49d265[_0x9831('0x36')]=_[_0x9831('0x37')](_0x2d5be9[_0x9831('0x36')]);_0x49d265[_0x9831('0x3f')]=_[_0x9831('0x38')](_0x49d265[_0x9831('0x35')],_0x49d265[_0x9831('0x36')]);_0x4b5caa[_0x9831('0x3b')]=_[_0x9831('0x38')](_0x49d265[_0x9831('0x35')],qs[_0x9831('0x39')](_0x2d5be9[_0x9831('0x36')]['fields']));_0x4b5caa[_0x9831('0x3b')]=_0x4b5caa[_0x9831('0x3b')][_0x9831('0x3a')]?_0x4b5caa[_0x9831('0x3b')]:_0x49d265[_0x9831('0x35')];if(_0x2d5be9['query']['includeAll']){_0x4b5caa[_0x9831('0x46')]=[{'all':!![]}];}_0x4b5caa=_[_0x9831('0x41')]({},_0x4b5caa,_0x2d5be9[_0x9831('0x44')]);return db[_0x9831('0x30')][_0x9831('0x4b')](_0x4b5caa)['then'](handleEntityNotFound(_0x24bcb3,null))['then'](respondWithResult(_0x24bcb3,null))['catch'](handleError(_0x24bcb3,null));};exports[_0x9831('0x4c')]=function(_0x1ad6f3,_0x35844b){return db[_0x9831('0x30')][_0x9831('0x4c')](_0x1ad6f3[_0x9831('0x4d')],{})[_0x9831('0x29')](respondWithResult(_0x35844b,0xc9))[_0x9831('0x4e')](handleError(_0x35844b,null));};exports[_0x9831('0x28')]=function(_0x192782,_0x351e10){if(_0x192782[_0x9831('0x4d')]['id']){delete _0x192782[_0x9831('0x4d')]['id'];}return db[_0x9831('0x30')][_0x9831('0x4b')]({'where':{'id':_0x192782[_0x9831('0x4a')]['id']}})[_0x9831('0x29')](handleEntityNotFound(_0x351e10,null))['then'](saveUpdates(_0x192782['body'],null))[_0x9831('0x29')](respondWithResult(_0x351e10,null))[_0x9831('0x4e')](handleError(_0x351e10,null));};exports[_0x9831('0x4f')]=function(_0x23bea2,_0x29ac20){return db[_0x9831('0x30')][_0x9831('0x4b')]({'where':{'id':_0x23bea2['params']['id']}})[_0x9831('0x29')](handleEntityNotFound(_0x29ac20,null))[_0x9831('0x29')](removeEntity(_0x29ac20,null))[_0x9831('0x4e')](handleError(_0x29ac20,null));};exports[_0x9831('0x50')]=function(_0x59e5f3,_0x4727cc){return db[_0x9831('0x30')][_0x9831('0x50')]()['then'](respondWithResult(_0x4727cc,null))[_0x9831('0x4e')](handleError(_0x4727cc,null));}; \ No newline at end of file +var _0xbd2a=['rawAttributes','length','create','body','find','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','status','error','stack','name','send','index','map','UserProfileSection','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','where','pick','filter','merge','options','include','findAll','catch','show','params'];(function(_0xc18b84,_0x19323f){var _0x5d8951=function(_0x394e49){while(--_0x394e49){_0xc18b84['push'](_0xc18b84['shift']());}};_0x5d8951(++_0x19323f);}(_0xbd2a,0x1cf));var _0xabd2=function(_0x2dc7b3,_0x374b52){_0x2dc7b3=_0x2dc7b3-0x0;var _0x58b84a=_0xbd2a[_0x2dc7b3];return _0x58b84a;};'use strict';var emlformat=require(_0xabd2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabd2('0x1'));var jsonpatch=require(_0xabd2('0x2'));var rp=require('request-promise');var moment=require(_0xabd2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xabd2('0x4'));var path=require(_0xabd2('0x5'));var sox=require(_0xabd2('0x6'));var csv=require(_0xabd2('0x7'));var ejs=require(_0xabd2('0x8'));var fs=require('fs');var fs_extra=require(_0xabd2('0x9'));var _=require(_0xabd2('0xa'));var squel=require(_0xabd2('0xb'));var crypto=require(_0xabd2('0xc'));var jsforce=require(_0xabd2('0xd'));var deskjs=require(_0xabd2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xabd2('0xf'));var Papa=require(_0xabd2('0x10'));var Redis=require('ioredis');var authService=require(_0xabd2('0x11'));var qs=require(_0xabd2('0x12'));var as=require(_0xabd2('0x13'));var hardwareService=require(_0xabd2('0x14'));var logger=require(_0xabd2('0x15'))(_0xabd2('0x16'));var utils=require(_0xabd2('0x17'));var config=require(_0xabd2('0x18'));var licenseUtil=require(_0xabd2('0x19'));var db=require(_0xabd2('0x1a'))['db'];function respondWithStatusCode(_0x4b771f,_0x2c4e9e){_0x2c4e9e=_0x2c4e9e||0xcc;return function(_0x31b880){if(_0x31b880){return _0x4b771f[_0xabd2('0x1b')](_0x2c4e9e);}return _0x4b771f['status'](_0x2c4e9e)[_0xabd2('0x1c')]();};}function respondWithResult(_0x2dc497,_0x144325){_0x144325=_0x144325||0xc8;return function(_0x50fa4b){if(_0x50fa4b){return _0x2dc497['status'](_0x144325)[_0xabd2('0x1d')](_0x50fa4b);}};}function respondWithFilteredResult(_0x2f9029,_0x217c1f){return function(_0x43e265){if(_0x43e265){var _0x804fb=typeof _0x217c1f[_0xabd2('0x1e')]==='undefined'&&typeof _0x217c1f[_0xabd2('0x1f')]===_0xabd2('0x20');var _0x54c12e=_0x43e265[_0xabd2('0x21')];var _0x205e69=_0x804fb?0x0:_0x217c1f[_0xabd2('0x1e')];var _0x5a027e=_0x804fb?_0x43e265[_0xabd2('0x21')]:_0x217c1f[_0xabd2('0x1e')]+_0x217c1f['limit'];var _0x2acfef;if(_0x5a027e>=_0x54c12e){_0x5a027e=_0x54c12e;_0x2acfef=0xc8;}else{_0x2acfef=0xce;}_0x2f9029['status'](_0x2acfef);return _0x2f9029[_0xabd2('0x22')](_0xabd2('0x23'),_0x205e69+'-'+_0x5a027e+'/'+_0x54c12e)[_0xabd2('0x1d')](_0x43e265);}return null;};}function patchUpdates(_0x10a98f){return function(_0x5c0b79){try{jsonpatch[_0xabd2('0x24')](_0x5c0b79,_0x10a98f,!![]);}catch(_0x4b0c2a){return BPromise[_0xabd2('0x25')](_0x4b0c2a);}return _0x5c0b79[_0xabd2('0x26')]();};}function saveUpdates(_0x13b7ed,_0x4113f0){return function(_0x2fe23a){if(_0x2fe23a){return _0x2fe23a['update'](_0x13b7ed)[_0xabd2('0x27')](function(_0x2c4de9){return _0x2c4de9;});}return null;};}function removeEntity(_0x2aef69,_0x450c5f){return function(_0x5afa6b){if(_0x5afa6b){return _0x5afa6b['destroy']()['then'](function(){_0x2aef69[_0xabd2('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39a961,_0x363862){return function(_0xb3b8c3){if(!_0xb3b8c3){_0x39a961[_0xabd2('0x1b')](0x194);}return _0xb3b8c3;};}function handleError(_0x9f45fd,_0x1f638d){_0x1f638d=_0x1f638d||0x1f4;return function(_0x24cc43){logger[_0xabd2('0x29')](_0x24cc43[_0xabd2('0x2a')]);if(_0x24cc43[_0xabd2('0x2b')]){delete _0x24cc43[_0xabd2('0x2b')];}_0x9f45fd['status'](_0x1f638d)[_0xabd2('0x2c')](_0x24cc43);};}exports[_0xabd2('0x2d')]=function(_0x128b2c,_0x30c547){var _0x3ce842={},_0x30b7be={},_0x307025={'count':0x0,'rows':[]};var _0x23c385=_[_0xabd2('0x2e')](db[_0xabd2('0x2f')]['rawAttributes'],function(_0x554769){return{'name':_0x554769[_0xabd2('0x30')],'type':_0x554769['type'][_0xabd2('0x31')]};});_0x30b7be[_0xabd2('0x32')]=_[_0xabd2('0x2e')](_0x23c385,'name');_0x30b7be[_0xabd2('0x33')]=_[_0xabd2('0x34')](_0x128b2c['query']);_0x30b7be[_0xabd2('0x35')]=_[_0xabd2('0x36')](_0x30b7be['model'],_0x30b7be['query']);_0x3ce842[_0xabd2('0x37')]=_[_0xabd2('0x36')](_0x30b7be[_0xabd2('0x32')],qs[_0xabd2('0x38')](_0x128b2c[_0xabd2('0x33')]['fields']));_0x3ce842['attributes']=_0x3ce842[_0xabd2('0x37')]['length']?_0x3ce842[_0xabd2('0x37')]:_0x30b7be[_0xabd2('0x32')];if(!_0x128b2c[_0xabd2('0x33')]['hasOwnProperty'](_0xabd2('0x39'))){_0x3ce842[_0xabd2('0x1f')]=qs[_0xabd2('0x1f')](_0x128b2c[_0xabd2('0x33')][_0xabd2('0x1f')]);_0x3ce842[_0xabd2('0x1e')]=qs[_0xabd2('0x1e')](_0x128b2c['query']['offset']);}_0x3ce842[_0xabd2('0x3a')]=qs['sort'](_0x128b2c['query']['sort']);_0x3ce842[_0xabd2('0x3b')]=qs[_0xabd2('0x35')](_[_0xabd2('0x3c')](_0x128b2c[_0xabd2('0x33')],_0x30b7be[_0xabd2('0x35')]),_0x23c385);if(_0x128b2c['query'][_0xabd2('0x3d')]){_0x3ce842[_0xabd2('0x3b')]=_[_0xabd2('0x3e')](_0x3ce842[_0xabd2('0x3b')],{'$or':_[_0xabd2('0x2e')](_0x23c385,function(_0x358838){if(_0x358838['type']!=='VIRTUAL'){var _0x57f161={};_0x57f161[_0x358838['name']]={'$like':'%'+_0x128b2c[_0xabd2('0x33')][_0xabd2('0x3d')]+'%'};return _0x57f161;}})});}_0x3ce842=_['merge']({},_0x3ce842,_0x128b2c[_0xabd2('0x3f')]);var _0x57621f={'where':_0x3ce842['where']};return db['UserProfileSection'][_0xabd2('0x21')](_0x57621f)[_0xabd2('0x27')](function(_0x216f80){_0x307025[_0xabd2('0x21')]=_0x216f80;if(_0x128b2c['query']['includeAll']){_0x3ce842[_0xabd2('0x40')]=[{'all':!![]}];}return db['UserProfileSection'][_0xabd2('0x41')](_0x3ce842);})[_0xabd2('0x27')](function(_0x196894){_0x307025['rows']=_0x196894;return _0x307025;})[_0xabd2('0x27')](respondWithFilteredResult(_0x30c547,_0x3ce842))[_0xabd2('0x42')](handleError(_0x30c547,null));};exports[_0xabd2('0x43')]=function(_0x25bca2,_0x55964b){var _0x639d72={'raw':![],'where':{'id':_0x25bca2[_0xabd2('0x44')]['id']}},_0x2d08f5={};_0x2d08f5[_0xabd2('0x32')]=_[_0xabd2('0x34')](db['UserProfileSection'][_0xabd2('0x45')]);_0x2d08f5[_0xabd2('0x33')]=_[_0xabd2('0x34')](_0x25bca2[_0xabd2('0x33')]);_0x2d08f5[_0xabd2('0x35')]=_[_0xabd2('0x36')](_0x2d08f5[_0xabd2('0x32')],_0x2d08f5[_0xabd2('0x33')]);_0x639d72[_0xabd2('0x37')]=_[_0xabd2('0x36')](_0x2d08f5['model'],qs[_0xabd2('0x38')](_0x25bca2['query'][_0xabd2('0x38')]));_0x639d72[_0xabd2('0x37')]=_0x639d72[_0xabd2('0x37')][_0xabd2('0x46')]?_0x639d72['attributes']:_0x2d08f5['model'];if(_0x25bca2['query']['includeAll']){_0x639d72[_0xabd2('0x40')]=[{'all':!![]}];}_0x639d72=_[_0xabd2('0x3e')]({},_0x639d72,_0x25bca2[_0xabd2('0x3f')]);return db[_0xabd2('0x2f')]['find'](_0x639d72)[_0xabd2('0x27')](handleEntityNotFound(_0x55964b,null))[_0xabd2('0x27')](respondWithResult(_0x55964b,null))[_0xabd2('0x42')](handleError(_0x55964b,null));};exports[_0xabd2('0x47')]=function(_0x46c836,_0x2bb96a){return db[_0xabd2('0x2f')][_0xabd2('0x47')](_0x46c836['body'],{})[_0xabd2('0x27')](respondWithResult(_0x2bb96a,0xc9))[_0xabd2('0x42')](handleError(_0x2bb96a,null));};exports['update']=function(_0x10dd72,_0x4cf309){if(_0x10dd72[_0xabd2('0x48')]['id']){delete _0x10dd72[_0xabd2('0x48')]['id'];}return db[_0xabd2('0x2f')][_0xabd2('0x49')]({'where':{'id':_0x10dd72[_0xabd2('0x44')]['id']}})['then'](handleEntityNotFound(_0x4cf309,null))['then'](saveUpdates(_0x10dd72['body'],null))[_0xabd2('0x27')](respondWithResult(_0x4cf309,null))[_0xabd2('0x42')](handleError(_0x4cf309,null));};exports[_0xabd2('0x4a')]=function(_0x4f51f2,_0x5c6d95){return db[_0xabd2('0x2f')][_0xabd2('0x49')]({'where':{'id':_0x4f51f2[_0xabd2('0x44')]['id']}})[_0xabd2('0x27')](handleEntityNotFound(_0x5c6d95,null))[_0xabd2('0x27')](removeEntity(_0x5c6d95,null))[_0xabd2('0x42')](handleError(_0x5c6d95,null));};exports[_0xabd2('0x4b')]=function(_0x5283e8,_0x3c6806){return db[_0xabd2('0x2f')][_0xabd2('0x4b')]()[_0xabd2('0x27')](respondWithResult(_0x3c6806,null))[_0xabd2('0x42')](handleError(_0x3c6806,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 5a802c1..917cb56 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 _0x8338=['define','user_profile_has_sections','compositeIndex','userProfileId','lodash','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x47ad2c,_0x545ba4){var _0x484aab=function(_0x493a1a){while(--_0x493a1a){_0x47ad2c['push'](_0x47ad2c['shift']());}};_0x484aab(++_0x545ba4);}(_0x8338,0x88));var _0x8833=function(_0x4080e5,_0x185a1b){_0x4080e5=_0x4080e5-0x0;var _0x4383a0=_0x8338[_0x4080e5];return _0x4383a0;};'use strict';var _=require(_0x8833('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8833('0x1'));var moment=require(_0x8833('0x2'));var BPromise=require(_0x8833('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8833('0x4'));var rimraf=require(_0x8833('0x5'));var config=require(_0x8833('0x6'));var attributes=require('./userProfileSection.attributes');module[_0x8833('0x7')]=function(_0x13dffe,_0x191a9a){return _0x13dffe[_0x8833('0x8')]('UserProfileSection',attributes,{'tableName':_0x8833('0x9'),'paranoid':![],'indexes':[{'name':_0x8833('0xa'),'fields':['sectionId',_0x8833('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfa8f=['../../config/logger','api','bluebird','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util'];(function(_0x469fa8,_0x1a2f2a){var _0x13065b=function(_0x493dea){while(--_0x493dea){_0x469fa8['push'](_0x469fa8['shift']());}};_0x13065b(++_0x1a2f2a);}(_0xfa8f,0x15e));var _0xffa8=function(_0x40e900,_0x4536b7){_0x40e900=_0x40e900-0x0;var _0x5da670=_0xfa8f[_0x40e900];return _0x5da670;};'use strict';var _=require(_0xffa8('0x0'));var util=require(_0xffa8('0x1'));var logger=require(_0xffa8('0x2'))(_0xffa8('0x3'));var moment=require('moment');var BPromise=require(_0xffa8('0x4'));var rp=require(_0xffa8('0x5'));var fs=require('fs');var path=require(_0xffa8('0x6'));var rimraf=require(_0xffa8('0x7'));var config=require('../../config/environment');var attributes=require(_0xffa8('0x8'));module[_0xffa8('0x9')]=function(_0x563797,_0x482725){return _0x563797[_0xffa8('0xa')](_0xffa8('0xb'),attributes,{'tableName':_0xffa8('0xc'),'paranoid':![],'indexes':[{'name':_0xffa8('0xd'),'fields':[_0xffa8('0xe'),_0xffa8('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 0c183f9..813fc20 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 _0xe93b=['request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','UserProfileSection,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0x4a19af,_0x3fa25e){var _0x2e7e5e=function(_0x19831a){while(--_0x19831a){_0x4a19af['push'](_0x4a19af['shift']());}};_0x2e7e5e(++_0x3fa25e);}(_0xe93b,0x16a));var _0xbe93=function(_0x284e85,_0x1bfec9){_0x284e85=_0x284e85-0x0;var _0x59ba3d=_0xe93b[_0x284e85];return _0x59ba3d;};'use strict';var _=require(_0xbe93('0x0'));var util=require(_0xbe93('0x1'));var moment=require(_0xbe93('0x2'));var BPromise=require(_0xbe93('0x3'));var rs=require(_0xbe93('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbe93('0x5'));var logger=require(_0xbe93('0x6'))(_0xbe93('0x7'));var config=require(_0xbe93('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbe93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2dd8aa,_0x2d5f9a,_0x3ab63c){return new BPromise(function(_0x396b8c,_0x1edee5){return client[_0xbe93('0xa')](_0x2dd8aa,_0x3ab63c)[_0xbe93('0xb')](function(_0x35ac7f){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x2d5f9a,_0xbe93('0xc'));logger[_0xbe93('0xd')](_0xbe93('0xe'),_0x2d5f9a,_0xbe93('0xc'),JSON['stringify'](_0x35ac7f));if(_0x35ac7f[_0xbe93('0xf')]){if(_0x35ac7f[_0xbe93('0xf')][_0xbe93('0x10')]===0x1f4){logger[_0xbe93('0xf')](_0xbe93('0x11'),_0x2d5f9a,_0x35ac7f[_0xbe93('0xf')]['message']);return _0x1edee5(_0x35ac7f['error'][_0xbe93('0x12')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x2d5f9a,_0x35ac7f[_0xbe93('0xf')]['message']);return _0x396b8c(_0x35ac7f['error'][_0xbe93('0x12')]);}else{logger[_0xbe93('0x13')](_0xbe93('0x11'),_0x2d5f9a,_0xbe93('0xc'));_0x396b8c(_0x35ac7f[_0xbe93('0x14')][_0xbe93('0x12')]);}})[_0xbe93('0x15')](function(_0x4c159d){logger[_0xbe93('0xf')](_0xbe93('0x11'),_0x2d5f9a,_0x4c159d);_0x1edee5(_0x4c159d);});});} \ No newline at end of file +var _0xb1c1=['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','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x47838f,_0x79131a){var _0x38b8a9=function(_0x4133ed){while(--_0x4133ed){_0x47838f['push'](_0x47838f['shift']());}};_0x38b8a9(++_0x79131a);}(_0xb1c1,0x1c4));var _0x1b1c=function(_0x4a133a,_0x2e4faf){_0x4a133a=_0x4a133a-0x0;var _0x27e85b=_0xb1c1[_0x4a133a];return _0x27e85b;};'use strict';var _=require(_0x1b1c('0x0'));var util=require(_0x1b1c('0x1'));var moment=require(_0x1b1c('0x2'));var BPromise=require(_0x1b1c('0x3'));var rs=require(_0x1b1c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b1c('0x5'))['db'];var utils=require(_0x1b1c('0x6'));var logger=require('../../config/logger')(_0x1b1c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1b1c('0x8')][_0x1b1c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11e077,_0x5bc89b,_0x2bf986){return new BPromise(function(_0x5ae490,_0x58915c){return client[_0x1b1c('0xa')](_0x11e077,_0x2bf986)[_0x1b1c('0xb')](function(_0x1eeeb4){logger[_0x1b1c('0xc')](_0x1b1c('0xd'),_0x5bc89b,_0x1b1c('0xe'));logger[_0x1b1c('0xf')](_0x1b1c('0x10'),_0x5bc89b,'request\x20sent',JSON[_0x1b1c('0x11')](_0x1eeeb4));if(_0x1eeeb4[_0x1b1c('0x12')]){if(_0x1eeeb4[_0x1b1c('0x12')][_0x1b1c('0x13')]===0x1f4){logger[_0x1b1c('0x12')](_0x1b1c('0xd'),_0x5bc89b,_0x1eeeb4[_0x1b1c('0x12')][_0x1b1c('0x14')]);return _0x58915c(_0x1eeeb4[_0x1b1c('0x12')]['message']);}logger[_0x1b1c('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x5bc89b,_0x1eeeb4[_0x1b1c('0x12')][_0x1b1c('0x14')]);return _0x5ae490(_0x1eeeb4[_0x1b1c('0x12')][_0x1b1c('0x14')]);}else{logger[_0x1b1c('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x5bc89b,_0x1b1c('0xe'));_0x5ae490(_0x1eeeb4[_0x1b1c('0x15')][_0x1b1c('0x14')]);}})[_0x1b1c('0x16')](function(_0x3afb84){logger['error'](_0x1b1c('0xd'),_0x5bc89b,_0x3afb84);_0x58915c(_0x3afb84);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c006f62..d94fae9 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x511577,_0x2ec0cf){var _0x1b9201=function(_0x334aac){while(--_0x334aac){_0x511577['push'](_0x511577['shift']());}};_0x1b9201(++_0x2ec0cf);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x378eea,_0x5ed78b){var _0x4ff1e3=function(_0x41f05f){while(--_0x41f05f){_0x378eea['push'](_0x378eea['shift']());}};_0x4ff1e3(++_0x5ed78b);}(_0xe706,0xa3));var _0x6e70=function(_0xc8966a,_0x19753d){_0xc8966a=_0xc8966a-0x0;var _0x2a3be4=_0xe706[_0xc8966a];return _0x2a3be4;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 349fdc5..322b8f6 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 _0x492e=['INTEGER','sequelize','exports'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x492e,0x1d5));var _0xe492=function(_0x312ab2,_0x1b35a9){_0x312ab2=_0x312ab2-0x0;var _0x321d86=_0x492e[_0x312ab2];return _0x321d86;};'use strict';var Sequelize=require(_0xe492('0x0'));module[_0xe492('0x1')]={'penalty':{'type':Sequelize[_0xe492('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x972c=['INTEGER'];(function(_0x53f0db,_0x35c67c){var _0xae0a5c=function(_0x4bd6fb){while(--_0x4bd6fb){_0x53f0db['push'](_0x53f0db['shift']());}};_0xae0a5c(++_0x35c67c);}(_0x972c,0xf2));var _0xc972=function(_0x113e9a,_0x1b705c){_0x113e9a=_0x113e9a-0x0;var _0x1f7eac=_0x972c[_0x113e9a];return _0x1f7eac;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xc972('0x0')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 269ef08..6191c84 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 _0x2d72=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues'];(function(_0xa00760,_0x3d0028){var _0x91e171=function(_0x1e8fb5){while(--_0x1e8fb5){_0xa00760['push'](_0xa00760['shift']());}};_0x91e171(++_0x3d0028);}(_0x2d72,0xa8));var _0x22d7=function(_0x3ab737,_0x177d9c){_0x3ab737=_0x3ab737-0x0;var _0x349e9b=_0x2d72[_0x3ab737];return _0x349e9b;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var logger=require(_0x22d7('0x2'))(_0x22d7('0x3'));var moment=require(_0x22d7('0x4'));var BPromise=require(_0x22d7('0x5'));var rp=require(_0x22d7('0x6'));var fs=require('fs');var path=require(_0x22d7('0x7'));var rimraf=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var attributes=require(_0x22d7('0xa'));module[_0x22d7('0xb')]=function(_0x208b5b,_0x100426){return _0x208b5b['define'](_0x22d7('0xc'),attributes,{'tableName':_0x22d7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6931=['moment','bluebird','request-promise','path','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api'];(function(_0x5a4ca4,_0x394245){var _0x572be8=function(_0x49bfe1){while(--_0x49bfe1){_0x5a4ca4['push'](_0x5a4ca4['shift']());}};_0x572be8(++_0x394245);}(_0x6931,0x1a9));var _0x1693=function(_0x107b1b,_0x1ee796){_0x107b1b=_0x107b1b-0x0;var _0x247622=_0x6931[_0x107b1b];return _0x247622;};'use strict';var _=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var logger=require(_0x1693('0x2'))(_0x1693('0x3'));var moment=require(_0x1693('0x4'));var BPromise=require(_0x1693('0x5'));var rp=require(_0x1693('0x6'));var fs=require('fs');var path=require(_0x1693('0x7'));var rimraf=require('rimraf');var config=require(_0x1693('0x8'));var attributes=require(_0x1693('0x9'));module[_0x1693('0xa')]=function(_0x455646,_0x379d6c){return _0x455646['define'](_0x1693('0xb'),attributes,{'tableName':_0x1693('0xc'),'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 3702c29..83986ae 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 _0x3fde=['client','http','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xcab077,_0x477fd2){var _0x392a29=function(_0x15c2ad){while(--_0x15c2ad){_0xcab077['push'](_0xcab077['shift']());}};_0x392a29(++_0x477fd2);}(_0x3fde,0xdd));var _0xe3fd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3fde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe3fd('0x0'));var util=require(_0xe3fd('0x1'));var moment=require('moment');var BPromise=require(_0xe3fd('0x2'));var rs=require(_0xe3fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe3fd('0x4'))['db'];var utils=require(_0xe3fd('0x5'));var logger=require(_0xe3fd('0x6'))(_0xe3fd('0x7'));var config=require(_0xe3fd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe3fd('0x9')][_0xe3fd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33df5f,_0x5ca9d1,_0x5032e4){return new BPromise(function(_0x5e869d,_0x5cac24){return client['request'](_0x33df5f,_0x5032e4)[_0xe3fd('0xb')](function(_0xd50b89){logger['info'](_0xe3fd('0xc'),_0x5ca9d1,_0xe3fd('0xd'));logger[_0xe3fd('0xe')](_0xe3fd('0xf'),_0x5ca9d1,'request\x20sent',JSON[_0xe3fd('0x10')](_0xd50b89));if(_0xd50b89[_0xe3fd('0x11')]){if(_0xd50b89[_0xe3fd('0x11')][_0xe3fd('0x12')]===0x1f4){logger[_0xe3fd('0x11')](_0xe3fd('0xc'),_0x5ca9d1,_0xd50b89[_0xe3fd('0x11')][_0xe3fd('0x13')]);return _0x5cac24(_0xd50b89[_0xe3fd('0x11')][_0xe3fd('0x13')]);}logger[_0xe3fd('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x5ca9d1,_0xd50b89[_0xe3fd('0x11')]['message']);return _0x5e869d(_0xd50b89['error']['message']);}else{logger[_0xe3fd('0x14')](_0xe3fd('0xc'),_0x5ca9d1,_0xe3fd('0xd'));_0x5e869d(_0xd50b89[_0xe3fd('0x15')][_0xe3fd('0x13')]);}})[_0xe3fd('0x16')](function(_0x310946){logger[_0xe3fd('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x5ca9d1,_0x310946);_0x5cac24(_0x310946);});});} \ No newline at end of file +var _0x4f6b=['http','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client'];(function(_0x32bc4d,_0x3d45d1){var _0x35e6b0=function(_0x25734c){while(--_0x25734c){_0x32bc4d['push'](_0x32bc4d['shift']());}};_0x35e6b0(++_0x3d45d1);}(_0x4f6b,0x65));var _0xb4f6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4f6b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb4f6('0x0'));var util=require(_0xb4f6('0x1'));var moment=require(_0xb4f6('0x2'));var BPromise=require(_0xb4f6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4f6('0x4'));var db=require(_0xb4f6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb4f6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb4f6('0x7'));var client=jayson[_0xb4f6('0x8')][_0xb4f6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4100be,_0x35bc63,_0xf3061c){return new BPromise(function(_0x55fe93,_0x5331fe){return client[_0xb4f6('0xa')](_0x4100be,_0xf3061c)[_0xb4f6('0xb')](function(_0xb5040e){logger['info'](_0xb4f6('0xc'),_0x35bc63,_0xb4f6('0xd'));logger[_0xb4f6('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x35bc63,_0xb4f6('0xd'),JSON[_0xb4f6('0xf')](_0xb5040e));if(_0xb5040e[_0xb4f6('0x10')]){if(_0xb5040e[_0xb4f6('0x10')][_0xb4f6('0x11')]===0x1f4){logger[_0xb4f6('0x10')](_0xb4f6('0xc'),_0x35bc63,_0xb5040e[_0xb4f6('0x10')]['message']);return _0x5331fe(_0xb5040e[_0xb4f6('0x10')][_0xb4f6('0x12')]);}logger[_0xb4f6('0x10')](_0xb4f6('0xc'),_0x35bc63,_0xb5040e[_0xb4f6('0x10')]['message']);return _0x55fe93(_0xb5040e[_0xb4f6('0x10')][_0xb4f6('0x12')]);}else{logger[_0xb4f6('0x13')](_0xb4f6('0xc'),_0x35bc63,_0xb4f6('0xd'));_0x55fe93(_0xb5040e[_0xb4f6('0x14')]['message']);}})[_0xb4f6('0x15')](function(_0x38929b){logger[_0xb4f6('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x35bc63,_0x38929b);_0x5331fe(_0x38929b);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 72bfe0e..6576034 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 _0xa26c=['sequelize','INTEGER'];(function(_0x5f238d,_0x374658){var _0x43abbc=function(_0x5d472f){while(--_0x5d472f){_0x5f238d['push'](_0x5f238d['shift']());}};_0x43abbc(++_0x374658);}(_0xa26c,0x15c));var _0xca26=function(_0x1d42fc,_0x61ebaf){_0x1d42fc=_0x1d42fc-0x0;var _0x5908c0=_0xa26c[_0x1d42fc];return _0x5908c0;};'use strict';var Sequelize=require(_0xca26('0x0'));module['exports']={'UserId':{'type':Sequelize[_0xca26('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xca26('0x1')]}}; \ No newline at end of file +var _0xf6b7=['exports','INTEGER'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0xf6b7,0x8a));var _0x7f6b=function(_0x2353d2,_0x3fd86b){_0x2353d2=_0x2353d2-0x0;var _0x18b4ba=_0xf6b7[_0x2353d2];return _0x18b4ba;};'use strict';var Sequelize=require('sequelize');module[_0x7f6b('0x0')]={'UserId':{'type':Sequelize[_0x7f6b('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index d2c09c8..50b5800 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(_0x149ce6,_0x352151){var _0x1fa4a6=function(_0x37f405){while(--_0x37f405){_0x149ce6['push'](_0x149ce6['shift']());}};_0x1fa4a6(++_0x352151);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x458dd3,_0x19ed3c){var _0x40c9f0=function(_0x2bd3f4){while(--_0x2bd3f4){_0x458dd3['push'](_0x458dd3['shift']());}};_0x40c9f0(++_0x19ed3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 e4c74de..a4d04ea 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1f99e,_0x1dfdfc){var _0x2e547b=function(_0x2a21d5){while(--_0x2a21d5){_0x1f99e['push'](_0x1f99e['shift']());}};_0x2e547b(++_0x1dfdfc);}(_0xe706,0xa3));var _0x6e70=function(_0x214890,_0x2562c0){_0x214890=_0x214890-0x0;var _0x760050=_0xe706[_0x214890];return _0x760050;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4a9dd1,_0xfa8de5){var _0x2e761a=function(_0x546de0){while(--_0x546de0){_0x4a9dd1['push'](_0x4a9dd1['shift']());}};_0x2e761a(++_0xfa8de5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 98839c7..352e6d1 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 _0xdf97=['INTEGER','exports'];(function(_0x4c2114,_0x3a25b5){var _0x4757f6=function(_0x5e7ab2){while(--_0x5e7ab2){_0x4c2114['push'](_0x4c2114['shift']());}};_0x4757f6(++_0x3a25b5);}(_0xdf97,0x11d));var _0x7df9=function(_0x1e9442,_0x18bbd8){_0x1e9442=_0x1e9442-0x0;var _0x403575=_0xdf97[_0x1e9442];return _0x403575;};'use strict';var Sequelize=require('sequelize');module[_0x7df9('0x0')]={'penalty':{'type':Sequelize[_0x7df9('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb0fd=['sequelize','exports','INTEGER'];(function(_0x2c5310,_0x4d96d0){var _0x2c6672=function(_0x745fe7){while(--_0x745fe7){_0x2c5310['push'](_0x2c5310['shift']());}};_0x2c6672(++_0x4d96d0);}(_0xb0fd,0xdb));var _0xdb0f=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0xb0fd[_0x4953da];return _0x2d3780;};'use strict';var Sequelize=require(_0xdb0f('0x0'));module[_0xdb0f('0x1')]={'penalty':{'type':Sequelize[_0xdb0f('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 d24f8b4..c36a80f 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 _0x88c1=['bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','define','user_has_voice_queues','util','../../config/logger'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x88c1,0x116));var _0x188c=function(_0x580e6e,_0x4f822f){_0x580e6e=_0x580e6e-0x0;var _0x5a91af=_0x88c1[_0x580e6e];return _0x5a91af;};'use strict';var _=require('lodash');var util=require(_0x188c('0x0'));var logger=require(_0x188c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x188c('0x2'));var rp=require(_0x188c('0x3'));var fs=require('fs');var path=require(_0x188c('0x4'));var rimraf=require(_0x188c('0x5'));var config=require(_0x188c('0x6'));var attributes=require(_0x188c('0x7'));module['exports']=function(_0x174253,_0x160e6b){return _0x174253[_0x188c('0x8')]('UserVoiceQueue',attributes,{'tableName':_0x188c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3b9=['user_has_voice_queues','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueue.attributes','UserVoiceQueue'];(function(_0x4169cf,_0x403975){var _0x5c6c9e=function(_0x352b6d){while(--_0x352b6d){_0x4169cf['push'](_0x4169cf['shift']());}};_0x5c6c9e(++_0x403975);}(_0xe3b9,0x1b9));var _0x9e3b=function(_0x5d9646,_0x559941){_0x5d9646=_0x5d9646-0x0;var _0x27f0b1=_0xe3b9[_0x5d9646];return _0x27f0b1;};'use strict';var _=require(_0x9e3b('0x0'));var util=require(_0x9e3b('0x1'));var logger=require('../../config/logger')(_0x9e3b('0x2'));var moment=require(_0x9e3b('0x3'));var BPromise=require(_0x9e3b('0x4'));var rp=require(_0x9e3b('0x5'));var fs=require('fs');var path=require(_0x9e3b('0x6'));var rimraf=require('rimraf');var config=require(_0x9e3b('0x7'));var attributes=require(_0x9e3b('0x8'));module['exports']=function(_0x398050,_0x44cc32){return _0x398050['define'](_0x9e3b('0x9'),attributes,{'tableName':_0x9e3b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 299d26a..551f6cb 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 _0x5521=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','message','UserVoiceQueue,\x20%s,\x20%s','result','moment','randomstring','ioredis'];(function(_0x546d03,_0x451d82){var _0xf8a81=function(_0x25d15a){while(--_0x25d15a){_0x546d03['push'](_0x546d03['shift']());}};_0xf8a81(++_0x451d82);}(_0x5521,0x140));var _0x1552=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5521[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1552('0x0'));var BPromise=require('bluebird');var rs=require(_0x1552('0x1'));var fs=require('fs');var Redis=require(_0x1552('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1552('0x3'));var logger=require(_0x1552('0x4'))(_0x1552('0x5'));var config=require(_0x1552('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1552('0x7')][_0x1552('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f227e,_0x21a3c2,_0x12993f){return new BPromise(function(_0xa5cb68,_0x5d82ac){return client[_0x1552('0x9')](_0x5f227e,_0x12993f)[_0x1552('0xa')](function(_0x36ccc6){logger[_0x1552('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x21a3c2,_0x1552('0xc'));logger[_0x1552('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x21a3c2,'request\x20sent',JSON[_0x1552('0xe')](_0x36ccc6));if(_0x36ccc6[_0x1552('0xf')]){if(_0x36ccc6[_0x1552('0xf')]['code']===0x1f4){logger[_0x1552('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x21a3c2,_0x36ccc6[_0x1552('0xf')][_0x1552('0x10')]);return _0x5d82ac(_0x36ccc6[_0x1552('0xf')][_0x1552('0x10')]);}logger['error'](_0x1552('0x11'),_0x21a3c2,_0x36ccc6['error']['message']);return _0xa5cb68(_0x36ccc6[_0x1552('0xf')][_0x1552('0x10')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x21a3c2,_0x1552('0xc'));_0xa5cb68(_0x36ccc6[_0x1552('0x12')][_0x1552('0x10')]);}})['catch'](function(_0x114cf2){logger['error'](_0x1552('0x11'),_0x21a3c2,_0x114cf2);_0x5d82ac(_0x114cf2);});});} \ No newline at end of file +var _0xcdc0=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x24bd37,_0x4831d7){var _0x4995d2=function(_0x340884){while(--_0x340884){_0x24bd37['push'](_0x24bd37['shift']());}};_0x4995d2(++_0x4831d7);}(_0xcdc0,0x126));var _0x0cdc=function(_0x5734a5,_0x114064){_0x5734a5=_0x5734a5-0x0;var _0x282d64=_0xcdc0[_0x5734a5];return _0x282d64;};'use strict';var _=require(_0x0cdc('0x0'));var util=require(_0x0cdc('0x1'));var moment=require(_0x0cdc('0x2'));var BPromise=require(_0x0cdc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0cdc('0x4'));var db=require(_0x0cdc('0x5'))['db'];var utils=require(_0x0cdc('0x6'));var logger=require(_0x0cdc('0x7'))(_0x0cdc('0x8'));var config=require(_0x0cdc('0x9'));var jayson=require(_0x0cdc('0xa'));var client=jayson[_0x0cdc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ec527,_0x258de8,_0x44fde8){return new BPromise(function(_0x17ad9a,_0x2551eb){return client[_0x0cdc('0xc')](_0x3ec527,_0x44fde8)['then'](function(_0x10cdd0){logger[_0x0cdc('0xd')](_0x0cdc('0xe'),_0x258de8,_0x0cdc('0xf'));logger[_0x0cdc('0x10')](_0x0cdc('0x11'),_0x258de8,_0x0cdc('0xf'),JSON[_0x0cdc('0x12')](_0x10cdd0));if(_0x10cdd0[_0x0cdc('0x13')]){if(_0x10cdd0[_0x0cdc('0x13')]['code']===0x1f4){logger['error'](_0x0cdc('0xe'),_0x258de8,_0x10cdd0[_0x0cdc('0x13')]['message']);return _0x2551eb(_0x10cdd0['error'][_0x0cdc('0x14')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x258de8,_0x10cdd0['error'][_0x0cdc('0x14')]);return _0x17ad9a(_0x10cdd0[_0x0cdc('0x13')][_0x0cdc('0x14')]);}else{logger[_0x0cdc('0xd')](_0x0cdc('0xe'),_0x258de8,_0x0cdc('0xf'));_0x17ad9a(_0x10cdd0[_0x0cdc('0x15')]['message']);}})[_0x0cdc('0x16')](function(_0x1f101e){logger[_0x0cdc('0x13')](_0x0cdc('0xe'),_0x258de8,_0x1f101e);_0x2551eb(_0x1f101e);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index ddd20cf..85f4a5d 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x27bca8,_0x191f63){var _0x370163=function(_0x1329f8){while(--_0x1329f8){_0x27bca8['push'](_0x27bca8['shift']());}};_0x370163(++_0x191f63);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x251934,_0x4cef24){var _0x4f12fd=function(_0x2fbf46){while(--_0x2fbf46){_0x251934['push'](_0x251934['shift']());}};_0x4f12fd(++_0x4cef24);}(_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 764aeb0..2f1a6ea 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 _0xc037=['queue_interface','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x42121d,_0x1c31ab){var _0x2d6fde=function(_0x347a95){while(--_0x347a95){_0x42121d['push'](_0x42121d['shift']());}};_0x2d6fde(++_0x1c31ab);}(_0xc037,0x88));var _0x7c03=function(_0x2fe09e,_0x3e0198){_0x2fe09e=_0x2fe09e-0x0;var _0x2094a5=_0xc037[_0x2fe09e];return _0x2094a5;};'use strict';var Sequelize=require('sequelize');module[_0x7c03('0x0')]={'uniqueid':{'type':Sequelize[_0x7c03('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x7c03('0x2')},'membername':{'type':Sequelize[_0x7c03('0x3')],'allowNull':![],'comment':_0x7c03('0x2')},'UserId':{'type':Sequelize[_0x7c03('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x7c03('0x3')],'allowNull':![],'unique':_0x7c03('0x4'),'comment':_0x7c03('0x2')},'VoiceQueueId':{'type':Sequelize[_0x7c03('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x7c03('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x7c03('0x2')},'penalty':{'type':Sequelize[_0x7c03('0x1')](0xb),'defaultValue':0x0,'comment':_0x7c03('0x2')},'paused':{'type':Sequelize[_0x7c03('0x1')](0xb),'defaultValue':0x0,'comment':_0x7c03('0x2')}}; \ No newline at end of file +var _0x88e3=['Required\x20by\x20Asterisk','STRING','queue_interface','exports','INTEGER'];(function(_0xa8369a,_0x3d2319){var _0x4b74b7=function(_0x11d138){while(--_0x11d138){_0xa8369a['push'](_0xa8369a['shift']());}};_0x4b74b7(++_0x3d2319);}(_0x88e3,0xa3));var _0x388e=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0x88e3[_0x440917];return _0x5e906b;};'use strict';var Sequelize=require('sequelize');module[_0x388e('0x0')]={'uniqueid':{'type':Sequelize[_0x388e('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x388e('0x2')},'membername':{'type':Sequelize[_0x388e('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x388e('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x388e('0x3')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x388e('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x388e('0x3')],'allowNull':![],'unique':_0x388e('0x4'),'comment':_0x388e('0x2')},'penalty':{'type':Sequelize[_0x388e('0x1')](0xb),'defaultValue':0x0,'comment':_0x388e('0x2')},'paused':{'type':Sequelize[_0x388e('0x1')](0xb),'defaultValue':0x0,'comment':_0x388e('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 57ba059..fa7bd8c 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 _0x9999=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x9999,0x115));var _0x9999=function(_0x24234f,_0x4fb66b){_0x24234f=_0x24234f-0x0;var _0x5c0f2c=_0x9999[_0x24234f];return _0x5c0f2c;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x9999('0x0'))['db'][_0x9999('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9999('0x2')](0x0);var events={'afterCreate':_0x9999('0x3'),'afterUpdate':_0x9999('0x4'),'afterDestroy':_0x9999('0x5')};function emitEvent(_0x5b5ad1){return function(_0x332ec3,_0x4f7a85,_0x10328c){UserVoiceQueueRtEvents[_0x9999('0x6')](_0x5b5ad1+':'+_0x332ec3['id'],_0x332ec3);UserVoiceQueueRtEvents[_0x9999('0x6')](_0x5b5ad1,_0x332ec3);_0x10328c(null);};}for(var e in events){if(events[_0x9999('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x9999('0x8')](e,emitEvent(event));}}module[_0x9999('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xa734=['UserVoiceQueueRt','save','update','remove','emit','hook','events'];(function(_0x434adb,_0x58959b){var _0x4b7483=function(_0x3e4ce4){while(--_0x3e4ce4){_0x434adb['push'](_0x434adb['shift']());}};_0x4b7483(++_0x58959b);}(_0xa734,0x92));var _0x4a73=function(_0x1a7015,_0x1998e2){_0x1a7015=_0x1a7015-0x0;var _0x5f17e0=_0xa734[_0x1a7015];return _0x5f17e0;};'use strict';var EventEmitter=require(_0x4a73('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x4a73('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4a73('0x2'),'afterUpdate':_0x4a73('0x3'),'afterDestroy':_0x4a73('0x4')};function emitEvent(_0x37b075){return function(_0x3609c0,_0x3972f0,_0xfa308e){UserVoiceQueueRtEvents['emit'](_0x37b075+':'+_0x3609c0['id'],_0x3609c0);UserVoiceQueueRtEvents[_0x4a73('0x5')](_0x37b075,_0x3609c0);_0xfa308e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x4a73('0x6')](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 d45ac26..a01be38 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 _0x7964=['../../config/logger','api','moment','bluebird','path','./userVoiceQueueRt.attributes','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7964,0x166));var _0x4796=function(_0x417c89,_0x5011e1){_0x417c89=_0x417c89-0x0;var _0x1e305b=_0x7964[_0x417c89];return _0x1e305b;};'use strict';var _=require(_0x4796('0x0'));var util=require(_0x4796('0x1'));var logger=require(_0x4796('0x2'))(_0x4796('0x3'));var moment=require(_0x4796('0x4'));var BPromise=require(_0x4796('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4796('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4796('0x7'));module['exports']=function(_0x1075a0,_0x4a541c){return _0x1075a0['define'](_0x4796('0x8'),attributes,{'tableName':_0x4796('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb59d=['path','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1f5873,_0x1497be){var _0x2a75d9=function(_0x16c497){while(--_0x16c497){_0x1f5873['push'](_0x1f5873['shift']());}};_0x2a75d9(++_0x1497be);}(_0xb59d,0x1c3));var _0xdb59=function(_0x15b4b7,_0x30a5bd){_0x15b4b7=_0x15b4b7-0x0;var _0x776268=_0xb59d[_0x15b4b7];return _0x776268;};'use strict';var _=require('lodash');var util=require(_0xdb59('0x0'));var logger=require(_0xdb59('0x1'))('api');var moment=require(_0xdb59('0x2'));var BPromise=require(_0xdb59('0x3'));var rp=require(_0xdb59('0x4'));var fs=require('fs');var path=require(_0xdb59('0x5'));var rimraf=require(_0xdb59('0x6'));var config=require(_0xdb59('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xdb59('0x8')]=function(_0x497275,_0x127bd7){return _0x497275[_0xdb59('0x9')](_0xdb59('0xa'),attributes,{'tableName':_0xdb59('0xb'),'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 664d08f..03aef29 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 _0xe5cc=['stringify','error','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2d74f6,_0x57d703){var _0x5a3b93=function(_0x1c477c){while(--_0x1c477c){_0x2d74f6['push'](_0x2d74f6['shift']());}};_0x5a3b93(++_0x57d703);}(_0xe5cc,0x178));var _0xce5c=function(_0x2ad361,_0xb28126){_0x2ad361=_0x2ad361-0x0;var _0x318693=_0xe5cc[_0x2ad361];return _0x318693;};'use strict';var _=require(_0xce5c('0x0'));var util=require('util');var moment=require(_0xce5c('0x1'));var BPromise=require(_0xce5c('0x2'));var rs=require(_0xce5c('0x3'));var fs=require('fs');var Redis=require(_0xce5c('0x4'));var db=require(_0xce5c('0x5'))['db'];var utils=require(_0xce5c('0x6'));var logger=require(_0xce5c('0x7'))(_0xce5c('0x8'));var config=require(_0xce5c('0x9'));var jayson=require(_0xce5c('0xa'));var client=jayson[_0xce5c('0xb')][_0xce5c('0xc')]({'port':0x232a});config['redis']=_[_0xce5c('0xd')](config[_0xce5c('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xce5c('0xf'))(new Redis(config[_0xce5c('0xe')]));require(_0xce5c('0x10'))[_0xce5c('0x11')](socket);function respondWithRpcPromise(_0x15adc9,_0x4dc345,_0x58f35a){return new BPromise(function(_0x591275,_0x496d3b){return client[_0xce5c('0x12')](_0x15adc9,_0x58f35a)[_0xce5c('0x13')](function(_0x2453ca){logger['info'](_0xce5c('0x14'),_0x4dc345,'request\x20sent');logger[_0xce5c('0x15')](_0xce5c('0x16'),_0x4dc345,_0xce5c('0x17'),JSON[_0xce5c('0x18')](_0x2453ca));if(_0x2453ca[_0xce5c('0x19')]){if(_0x2453ca[_0xce5c('0x19')]['code']===0x1f4){logger[_0xce5c('0x19')](_0xce5c('0x14'),_0x4dc345,_0x2453ca[_0xce5c('0x19')]['message']);return _0x496d3b(_0x2453ca[_0xce5c('0x19')]['message']);}logger[_0xce5c('0x19')](_0xce5c('0x14'),_0x4dc345,_0x2453ca[_0xce5c('0x19')][_0xce5c('0x1a')]);return _0x591275(_0x2453ca['error'][_0xce5c('0x1a')]);}else{logger[_0xce5c('0x1b')](_0xce5c('0x14'),_0x4dc345,'request\x20sent');_0x591275(_0x2453ca[_0xce5c('0x1c')][_0xce5c('0x1a')]);}})[_0xce5c('0x1d')](function(_0x3936e3){logger[_0xce5c('0x19')](_0xce5c('0x14'),_0x4dc345,_0x3936e3);_0x496d3b(_0x3936e3);});});}exports[_0xce5c('0x1e')]=function(_0xd2dfc0){var _0x10eb56=this;return new Promise(function(_0xe17db5,_0x2722e3){return db[_0xce5c('0x1f')][_0xce5c('0x20')]({'raw':_0xd2dfc0[_0xce5c('0x21')]?_0xd2dfc0['options'][_0xce5c('0x22')]===undefined?!![]:![]:!![],'where':_0xd2dfc0[_0xce5c('0x21')]?_0xd2dfc0[_0xce5c('0x21')][_0xce5c('0x23')]||null:null,'attributes':[[db[_0xce5c('0x24')]['fn'](_0xce5c('0x25'),db[_0xce5c('0x24')]['fn']('IF',db[_0xce5c('0x24')][_0xce5c('0x26')]('`paused`\x20=\x201,\x201,\x20null'))),_0xce5c('0x27')]]})[_0xce5c('0x13')](function(_0x25cb24){logger[_0xce5c('0x1b')](_0xce5c('0x1e'),_0xd2dfc0);logger['debug'](_0xce5c('0x1e'),_0xd2dfc0,JSON['stringify'](_0x25cb24));_0xe17db5(_0x25cb24);})[_0xce5c('0x1d')](function(_0x2e4aa6){logger[_0xce5c('0x19')]('GetVoiceQueueRtPauses',_0x2e4aa6[_0xce5c('0x1a')],_0xd2dfc0);_0x2722e3(_0x10eb56[_0xce5c('0x19')](0x1f4,_0x2e4aa6['message']));});});}; \ No newline at end of file +var _0x6179=['findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6179,0x129));var _0x9617=function(_0x4a59d7,_0x33d394){_0x4a59d7=_0x4a59d7-0x0;var _0x3248ef=_0x6179[_0x4a59d7];return _0x3248ef;};'use strict';var _=require(_0x9617('0x0'));var util=require(_0x9617('0x1'));var moment=require(_0x9617('0x2'));var BPromise=require(_0x9617('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9617('0x4'));var db=require(_0x9617('0x5'))['db'];var utils=require(_0x9617('0x6'));var logger=require(_0x9617('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9617('0x8')][_0x9617('0x9')]({'port':0x232a});config[_0x9617('0xa')]=_[_0x9617('0xb')](config[_0x9617('0xa')],{'host':_0x9617('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9617('0xa')]));require('./userVoiceQueueRt.socket')[_0x9617('0xd')](socket);function respondWithRpcPromise(_0x43abc3,_0x1deef2,_0x1b3e8d){return new BPromise(function(_0x26a306,_0x3f8d31){return client['request'](_0x43abc3,_0x1b3e8d)[_0x9617('0xe')](function(_0x17cc02){logger[_0x9617('0xf')](_0x9617('0x10'),_0x1deef2,_0x9617('0x11'));logger[_0x9617('0x12')](_0x9617('0x13'),_0x1deef2,_0x9617('0x11'),JSON[_0x9617('0x14')](_0x17cc02));if(_0x17cc02[_0x9617('0x15')]){if(_0x17cc02[_0x9617('0x15')][_0x9617('0x16')]===0x1f4){logger[_0x9617('0x15')](_0x9617('0x10'),_0x1deef2,_0x17cc02[_0x9617('0x15')][_0x9617('0x17')]);return _0x3f8d31(_0x17cc02[_0x9617('0x15')][_0x9617('0x17')]);}logger[_0x9617('0x15')](_0x9617('0x10'),_0x1deef2,_0x17cc02['error']['message']);return _0x26a306(_0x17cc02['error']['message']);}else{logger['info'](_0x9617('0x10'),_0x1deef2,_0x9617('0x11'));_0x26a306(_0x17cc02[_0x9617('0x18')]['message']);}})['catch'](function(_0x43e154){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x1deef2,_0x43e154);_0x3f8d31(_0x43e154);});});}exports[_0x9617('0x19')]=function(_0x5cc4df){var _0x2911c0=this;return new Promise(function(_0x2711d2,_0x1e7b6b){return db[_0x9617('0x1a')][_0x9617('0x1b')]({'raw':_0x5cc4df[_0x9617('0x1c')]?_0x5cc4df['options'][_0x9617('0x1d')]===undefined?!![]:![]:!![],'where':_0x5cc4df['options']?_0x5cc4df['options'][_0x9617('0x1e')]||null:null,'attributes':[[db[_0x9617('0x1f')]['fn'](_0x9617('0x20'),db[_0x9617('0x1f')]['fn']('IF',db['sequelize'][_0x9617('0x21')](_0x9617('0x22')))),_0x9617('0x23')]]})[_0x9617('0xe')](function(_0x5bf8fd){logger[_0x9617('0xf')](_0x9617('0x19'),_0x5cc4df);logger[_0x9617('0x12')](_0x9617('0x19'),_0x5cc4df,JSON[_0x9617('0x14')](_0x5bf8fd));_0x2711d2(_0x5bf8fd);})['catch'](function(_0xb34054){logger['error'](_0x9617('0x19'),_0xb34054[_0x9617('0x17')],_0x5cc4df);_0x1e7b6b(_0x2911c0[_0x9617('0x15')](0x1f4,_0xb34054['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index f61fb12..4efc896 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 _0x7d10=['save','remove','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x2c0086,_0xbea719){var _0x2e29da=function(_0x25a8d0){while(--_0x25a8d0){_0x2c0086['push'](_0x2c0086['shift']());}};_0x2e29da(++_0xbea719);}(_0x7d10,0x1ce));var _0x07d1=function(_0x6fa2b5,_0x50c251){_0x6fa2b5=_0x6fa2b5-0x0;var _0x43697a=_0x7d10[_0x6fa2b5];return _0x43697a;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x07d1('0x0'),_0x07d1('0x1'),'update'];function createListener(_0xd63e59,_0x4f305c){return function(_0x5d2b90){_0x4f305c[_0x07d1('0x2')](_0xd63e59,_0x5d2b90);};}function removeListener(_0x104724,_0x4f4d64){return function(){UserVoiceQueueRtEvents[_0x07d1('0x3')](_0x104724,_0x4f4d64);};}exports[_0x07d1('0x4')]=function(_0x1c8f3d){for(var _0x36198a=0x0,_0x4ab5c9=events[_0x07d1('0x5')];_0x36198a<_0x4ab5c9;_0x36198a++){var _0xc20041=events[_0x36198a];var _0x65e41c=createListener(_0x07d1('0x6')+_0xc20041,_0x1c8f3d);UserVoiceQueueRtEvents['on'](_0xc20041,_0x65e41c);}}; \ No newline at end of file +var _0x4f0d=['emit','length','userVoiceQueueRt:'];(function(_0x1874f5,_0x2bc282){var _0x10b8d7=function(_0x42ac56){while(--_0x42ac56){_0x1874f5['push'](_0x1874f5['shift']());}};_0x10b8d7(++_0x2bc282);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0x4f0d[_0x4b03c9];return _0x161ba2;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save','remove','update'];function createListener(_0x5cd109,_0xc4d56b){return function(_0x1f97b0){_0xc4d56b[_0xd4f0('0x0')](_0x5cd109,_0x1f97b0);};}function removeListener(_0x577c8f,_0xb1db5){return function(){UserVoiceQueueRtEvents['removeListener'](_0x577c8f,_0xb1db5);};}exports['register']=function(_0x1809dd){for(var _0x4da370=0x0,_0x16da18=events[_0xd4f0('0x1')];_0x4da370<_0x16da18;_0x4da370++){var _0x50e79f=events[_0x4da370];var _0x19a779=createListener(_0xd4f0('0x2')+_0x50e79f,_0x1809dd);UserVoiceQueueRtEvents['on'](_0x50e79f,_0x19a779);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index b30b0ff..160c546 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(_0x4ceb77,_0x156505){var _0x247391=function(_0x19c727){while(--_0x19c727){_0x4ceb77['push'](_0x4ceb77['shift']());}};_0x247391(++_0x156505);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4ee261,_0x283258){var _0x40b7d9=function(_0x24e994){while(--_0x24e994){_0x4ee261['push'](_0x4ee261['shift']());}};_0x40b7d9(++_0x283258);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index ed8f0f5..44dd217 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 _0x2a96=['sequelize','exports'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x2a96,0xd2));var _0x62a9=function(_0x23463d,_0x2606e5){_0x23463d=_0x23463d-0x0;var _0x576a24=_0x2a96[_0x23463d];return _0x576a24;};'use strict';var Sequelize=require(_0x62a9('0x0'));module[_0x62a9('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xfa1b=['INTEGER','exports'];(function(_0x25611d,_0x163c72){var _0x1029d5=function(_0x4451e8){while(--_0x4451e8){_0x25611d['push'](_0x25611d['shift']());}};_0x1029d5(++_0x163c72);}(_0xfa1b,0xaf));var _0xbfa1=function(_0x563061,_0x3a61a4){_0x563061=_0x563061-0x0;var _0x1c8bf5=_0xfa1b[_0x563061];return _0x1c8bf5;};'use strict';var Sequelize=require('sequelize');module[_0xbfa1('0x0')]={'penalty':{'type':Sequelize[_0xbfa1('0x1')],'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 45bad46..d326080 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 _0xeb61=['bluebird','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','util','../../config/logger'];(function(_0x19c318,_0x3722f4){var _0x22d6c0=function(_0x37e3a1){while(--_0x37e3a1){_0x19c318['push'](_0x19c318['shift']());}};_0x22d6c0(++_0x3722f4);}(_0xeb61,0x13e));var _0x1eb6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb61[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1eb6('0x0'));var logger=require(_0x1eb6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1eb6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1eb6('0x3'));var rimraf=require(_0x1eb6('0x4'));var config=require(_0x1eb6('0x5'));var attributes=require(_0x1eb6('0x6'));module[_0x1eb6('0x7')]=function(_0xeff7db,_0x4dc3e4){return _0xeff7db[_0x1eb6('0x8')](_0x1eb6('0x9'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x300e=['path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','util','api','bluebird','request-promise'];(function(_0x2460d9,_0x15da87){var _0x4bc204=function(_0x40bbce){while(--_0x40bbce){_0x2460d9['push'](_0x2460d9['shift']());}};_0x4bc204(++_0x15da87);}(_0x300e,0x193));var _0xe300=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x300e[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require('lodash');var util=require(_0xe300('0x0'));var logger=require('../../config/logger')(_0xe300('0x1'));var moment=require('moment');var BPromise=require(_0xe300('0x2'));var rp=require(_0xe300('0x3'));var fs=require('fs');var path=require(_0xe300('0x4'));var rimraf=require(_0xe300('0x5'));var config=require(_0xe300('0x6'));var attributes=require(_0xe300('0x7'));module[_0xe300('0x8')]=function(_0x4c9b95,_0x55cf27){return _0x4c9b95['define'](_0xe300('0x9'),attributes,{'tableName':_0xe300('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 6b9820a..63e2110 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 _0x356e=['debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent'];(function(_0x5afeb3,_0x5589c6){var _0x1d6f74=function(_0x4d1ea3){while(--_0x4d1ea3){_0x5afeb3['push'](_0x5afeb3['shift']());}};_0x1d6f74(++_0x5589c6);}(_0x356e,0x1ed));var _0xe356=function(_0x4359fa,_0x4d5f23){_0x4359fa=_0x4359fa-0x0;var _0x3df26d=_0x356e[_0x4359fa];return _0x3df26d;};'use strict';var _=require(_0xe356('0x0'));var util=require(_0xe356('0x1'));var moment=require(_0xe356('0x2'));var BPromise=require('bluebird');var rs=require(_0xe356('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe356('0x4'))['db'];var utils=require(_0xe356('0x5'));var logger=require(_0xe356('0x6'))(_0xe356('0x7'));var config=require(_0xe356('0x8'));var jayson=require(_0xe356('0x9'));var client=jayson[_0xe356('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d7139,_0x295c8c,_0x505192){return new BPromise(function(_0x18e592,_0x1bf834){return client[_0xe356('0xb')](_0x4d7139,_0x505192)['then'](function(_0x10e72e){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x295c8c,_0xe356('0xc'));logger[_0xe356('0xd')](_0xe356('0xe'),_0x295c8c,_0xe356('0xc'),JSON[_0xe356('0xf')](_0x10e72e));if(_0x10e72e[_0xe356('0x10')]){if(_0x10e72e[_0xe356('0x10')][_0xe356('0x11')]===0x1f4){logger[_0xe356('0x10')](_0xe356('0x12'),_0x295c8c,_0x10e72e['error'][_0xe356('0x13')]);return _0x1bf834(_0x10e72e['error'][_0xe356('0x13')]);}logger[_0xe356('0x10')](_0xe356('0x12'),_0x295c8c,_0x10e72e[_0xe356('0x10')][_0xe356('0x13')]);return _0x18e592(_0x10e72e[_0xe356('0x10')][_0xe356('0x13')]);}else{logger[_0xe356('0x14')](_0xe356('0x12'),_0x295c8c,'request\x20sent');_0x18e592(_0x10e72e['result'][_0xe356('0x13')]);}})[_0xe356('0x15')](function(_0x38f5a3){logger[_0xe356('0x10')](_0xe356('0x12'),_0x295c8c,_0x38f5a3);_0x1bf834(_0x38f5a3);});});} \ No newline at end of file +var _0xebea=['UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x297039,_0x1dae01){var _0x233472=function(_0x30f377){while(--_0x30f377){_0x297039['push'](_0x297039['shift']());}};_0x233472(++_0x1dae01);}(_0xebea,0x127));var _0xaebe=function(_0x3dfbe4,_0x3e7652){_0x3dfbe4=_0x3dfbe4-0x0;var _0x561731=_0xebea[_0x3dfbe4];return _0x561731;};'use strict';var _=require(_0xaebe('0x0'));var util=require('util');var moment=require(_0xaebe('0x1'));var BPromise=require(_0xaebe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaebe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaebe('0x4'));var logger=require(_0xaebe('0x5'))('rpc');var config=require(_0xaebe('0x6'));var jayson=require(_0xaebe('0x7'));var client=jayson[_0xaebe('0x8')][_0xaebe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a88e8,_0x43b09e,_0x15d88f){return new BPromise(function(_0x3f6c34,_0x2623a4){return client[_0xaebe('0xa')](_0x1a88e8,_0x15d88f)[_0xaebe('0xb')](function(_0x37fcbd){logger[_0xaebe('0xc')](_0xaebe('0xd'),_0x43b09e,_0xaebe('0xe'));logger[_0xaebe('0xf')](_0xaebe('0x10'),_0x43b09e,_0xaebe('0xe'),JSON[_0xaebe('0x11')](_0x37fcbd));if(_0x37fcbd[_0xaebe('0x12')]){if(_0x37fcbd[_0xaebe('0x12')]['code']===0x1f4){logger[_0xaebe('0x12')](_0xaebe('0xd'),_0x43b09e,_0x37fcbd[_0xaebe('0x12')][_0xaebe('0x13')]);return _0x2623a4(_0x37fcbd[_0xaebe('0x12')][_0xaebe('0x13')]);}logger[_0xaebe('0x12')](_0xaebe('0xd'),_0x43b09e,_0x37fcbd[_0xaebe('0x12')]['message']);return _0x3f6c34(_0x37fcbd['error'][_0xaebe('0x13')]);}else{logger[_0xaebe('0xc')](_0xaebe('0xd'),_0x43b09e,_0xaebe('0xe'));_0x3f6c34(_0x37fcbd[_0xaebe('0x14')][_0xaebe('0x13')]);}})[_0xaebe('0x15')](function(_0x1cf7f0){logger[_0xaebe('0x12')](_0xaebe('0xd'),_0x43b09e,_0x1cf7f0);_0x2623a4(_0x1cf7f0);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 967d29f..03ba3ac 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 _0x5395=['index','/:id','post','create','put','destroy','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated'];(function(_0x45071a,_0x406695){var _0x4502ca=function(_0x486222){while(--_0x486222){_0x45071a['push'](_0x45071a['shift']());}};_0x4502ca(++_0x406695);}(_0x5395,0x150));var _0x5539=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x5395[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0x5539('0x0'));var util=require('util');var path=require(_0x5539('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5539('0x2')]();var fs_extra=require(_0x5539('0x3'));var auth=require(_0x5539('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5539('0x5'));var controller=require(_0x5539('0x6'));router[_0x5539('0x7')]('/',auth[_0x5539('0x8')](),controller[_0x5539('0x9')]);router[_0x5539('0x7')](_0x5539('0xa'),auth[_0x5539('0x8')](),controller['show']);router[_0x5539('0xb')]('/',auth[_0x5539('0x8')](),controller[_0x5539('0xc')]);router[_0x5539('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x5539('0xa'),auth['isAuthenticated'](),controller[_0x5539('0xe')]);module['exports']=router; \ No newline at end of file +var _0x7bae=['index','/:id','show','post','create','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated'];(function(_0x5db75a,_0x5ad8e0){var _0x572796=function(_0x3e5623){while(--_0x3e5623){_0x5db75a['push'](_0x5db75a['shift']());}};_0x572796(++_0x5ad8e0);}(_0x7bae,0x13b));var _0xe7ba=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x7bae[_0x56482c];return _0x5aae7a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7ba('0x0'));var timeout=require(_0xe7ba('0x1'));var express=require('express');var router=express[_0xe7ba('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe7ba('0x3'));var interaction=require(_0xe7ba('0x4'));var config=require(_0xe7ba('0x5'));var controller=require(_0xe7ba('0x6'));router[_0xe7ba('0x7')]('/',auth[_0xe7ba('0x8')](),controller[_0xe7ba('0x9')]);router[_0xe7ba('0x7')](_0xe7ba('0xa'),auth[_0xe7ba('0x8')](),controller[_0xe7ba('0xb')]);router[_0xe7ba('0xc')]('/',auth[_0xe7ba('0x8')](),controller[_0xe7ba('0xd')]);router['put'](_0xe7ba('0xa'),auth[_0xe7ba('0x8')](),controller[_0xe7ba('0xe')]);router[_0xe7ba('0xf')](_0xe7ba('0xa'),auth[_0xe7ba('0x8')](),controller[_0xe7ba('0x10')]);module[_0xe7ba('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index b928cf0..bb29f38 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 _0x82d3=['STRING','name','exports'];(function(_0x59c1b9,_0x5c2753){var _0x375dcc=function(_0x2d9c20){while(--_0x2d9c20){_0x59c1b9['push'](_0x59c1b9['shift']());}};_0x375dcc(++_0x5c2753);}(_0x82d3,0xa4));var _0x382d=function(_0x6b83df,_0x5daf1c){_0x6b83df=_0x6b83df-0x0;var _0x11ac08=_0x82d3[_0x6b83df];return _0x11ac08;};'use strict';var Sequelize=require('sequelize');module[_0x382d('0x0')]={'name':{'type':Sequelize[_0x382d('0x1')],'unique':_0x382d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2b18=['STRING','sequelize','exports'];(function(_0x5e48bf,_0x497646){var _0x170eaa=function(_0x260909){while(--_0x260909){_0x5e48bf['push'](_0x5e48bf['shift']());}};_0x170eaa(++_0x497646);}(_0x2b18,0x11e));var _0x82b1=function(_0x23e21f,_0x2b316a){_0x23e21f=_0x23e21f-0x0;var _0xe12247=_0x2b18[_0x23e21f];return _0xe12247;};'use strict';var Sequelize=require(_0x82b1('0x0'));module[_0x82b1('0x1')]={'name':{'type':Sequelize[_0x82b1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index e630e46..be03693 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 _0x35b1=['length','nolimit','order','sort','where','pick','filter','merge','options','Variable','count','includeAll','include','findAll','rows','catch','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','offset','limit','status','set','apply','reject','then','destroy','Variables','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x476702,_0x4c2a22){var _0x2ac5fa=function(_0x5a8fde){while(--_0x5a8fde){_0x476702['push'](_0x476702['shift']());}};_0x2ac5fa(++_0x4c2a22);}(_0x35b1,0x6c));var _0x135b=function(_0x4f3dee,_0x46bb90){_0x4f3dee=_0x4f3dee-0x0;var _0x291aad=_0x35b1[_0x4f3dee];return _0x291aad;};'use strict';var emlformat=require(_0x135b('0x0'));var rimraf=require(_0x135b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x135b('0x2'));var BPromise=require(_0x135b('0x3'));var Mustache=require(_0x135b('0x4'));var util=require('util');var path=require(_0x135b('0x5'));var sox=require('sox');var csv=require(_0x135b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x135b('0x7'));var _=require(_0x135b('0x8'));var squel=require(_0x135b('0x9'));var crypto=require(_0x135b('0xa'));var jsforce=require(_0x135b('0xb'));var deskjs=require(_0x135b('0xc'));var toCsv=require(_0x135b('0x6'));var querystring=require(_0x135b('0xd'));var Papa=require('papaparse');var Redis=require(_0x135b('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x135b('0xf'));var hardwareService=require(_0x135b('0x10'));var logger=require(_0x135b('0x11'))(_0x135b('0x12'));var utils=require(_0x135b('0x13'));var config=require(_0x135b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x135b('0x15'))['db'];function respondWithStatusCode(_0x28a4ad,_0x229c2a){_0x229c2a=_0x229c2a||0xcc;return function(_0x506f2e){if(_0x506f2e){return _0x28a4ad['sendStatus'](_0x229c2a);}return _0x28a4ad['status'](_0x229c2a)[_0x135b('0x16')]();};}function respondWithResult(_0x4f9a41,_0x800f75){_0x800f75=_0x800f75||0xc8;return function(_0x416f8b){if(_0x416f8b){return _0x4f9a41['status'](_0x800f75)[_0x135b('0x17')](_0x416f8b);}};}function respondWithFilteredResult(_0x5857c9,_0x27d22b){return function(_0x4e307d){if(_0x4e307d){var _0xac690e=typeof _0x27d22b['offset']===_0x135b('0x18')&&typeof _0x27d22b['limit']==='undefined';var _0x5f1a38=_0x4e307d['count'];var _0x271166=_0xac690e?0x0:_0x27d22b['offset'];var _0x489628=_0xac690e?_0x4e307d['count']:_0x27d22b[_0x135b('0x19')]+_0x27d22b[_0x135b('0x1a')];var _0x557492;if(_0x489628>=_0x5f1a38){_0x489628=_0x5f1a38;_0x557492=0xc8;}else{_0x557492=0xce;}_0x5857c9[_0x135b('0x1b')](_0x557492);return _0x5857c9[_0x135b('0x1c')]('Content-Range',_0x271166+'-'+_0x489628+'/'+_0x5f1a38)[_0x135b('0x17')](_0x4e307d);}return null;};}function patchUpdates(_0xfed802){return function(_0xe1a226){try{jsonpatch[_0x135b('0x1d')](_0xe1a226,_0xfed802,!![]);}catch(_0x52cba8){return BPromise[_0x135b('0x1e')](_0x52cba8);}return _0xe1a226['save']();};}function saveUpdates(_0xdef88c,_0x4af976){return function(_0x4e449a){if(_0x4e449a){return _0x4e449a['update'](_0xdef88c)[_0x135b('0x1f')](function(_0x4b964c){return _0x4b964c;});}return null;};}function removeEntity(_0x5c3bf3,_0x12d558){return function(_0x21b426){if(_0x21b426){return _0x21b426[_0x135b('0x20')]()[_0x135b('0x1f')](function(){var _0xd9c315=_0x21b426['get']({'plain':!![]});var _0x245b51=_0x135b('0x21');return db[_0x135b('0x22')][_0x135b('0x20')]({'where':{'type':_0x245b51,'resourceId':_0xd9c315['id']}})[_0x135b('0x1f')](function(){return _0x21b426;});})[_0x135b('0x1f')](function(){_0x5c3bf3[_0x135b('0x1b')](0xcc)[_0x135b('0x16')]();});}};}function handleEntityNotFound(_0x5d70c5,_0x3447c8){return function(_0x5ced6d){if(!_0x5ced6d){_0x5d70c5[_0x135b('0x23')](0x194);}return _0x5ced6d;};}function handleError(_0x3cdd9c,_0x2f3ffc){_0x2f3ffc=_0x2f3ffc||0x1f4;return function(_0x597368){logger[_0x135b('0x24')](_0x597368[_0x135b('0x25')]);if(_0x597368[_0x135b('0x26')]){delete _0x597368[_0x135b('0x26')];}_0x3cdd9c[_0x135b('0x1b')](_0x2f3ffc)['send'](_0x597368);};}exports[_0x135b('0x27')]=function(_0x3ccb3d,_0x2f0f98){var _0x3a7a64={},_0x41128c={},_0x716611={'count':0x0,'rows':[]};var _0x4131e8=_[_0x135b('0x28')](db['Variable'][_0x135b('0x29')],function(_0x39d452){return{'name':_0x39d452[_0x135b('0x2a')],'type':_0x39d452[_0x135b('0x2b')][_0x135b('0x2c')]};});_0x41128c[_0x135b('0x2d')]=_['map'](_0x4131e8,_0x135b('0x26'));_0x41128c[_0x135b('0x2e')]=_[_0x135b('0x2f')](_0x3ccb3d[_0x135b('0x2e')]);_0x41128c[_0x135b('0x30')]=_[_0x135b('0x31')](_0x41128c['model'],_0x41128c[_0x135b('0x2e')]);_0x3a7a64[_0x135b('0x32')]=_[_0x135b('0x31')](_0x41128c['model'],qs[_0x135b('0x33')](_0x3ccb3d[_0x135b('0x2e')]['fields']));_0x3a7a64[_0x135b('0x32')]=_0x3a7a64[_0x135b('0x32')][_0x135b('0x34')]?_0x3a7a64['attributes']:_0x41128c['model'];if(!_0x3ccb3d[_0x135b('0x2e')]['hasOwnProperty'](_0x135b('0x35'))){_0x3a7a64['limit']=qs[_0x135b('0x1a')](_0x3ccb3d[_0x135b('0x2e')][_0x135b('0x1a')]);_0x3a7a64[_0x135b('0x19')]=qs[_0x135b('0x19')](_0x3ccb3d[_0x135b('0x2e')][_0x135b('0x19')]);}_0x3a7a64[_0x135b('0x36')]=qs[_0x135b('0x37')](_0x3ccb3d[_0x135b('0x2e')][_0x135b('0x37')]);_0x3a7a64[_0x135b('0x38')]=qs['filters'](_[_0x135b('0x39')](_0x3ccb3d['query'],_0x41128c[_0x135b('0x30')]),_0x4131e8);if(_0x3ccb3d[_0x135b('0x2e')][_0x135b('0x3a')]){_0x3a7a64['where']=_[_0x135b('0x3b')](_0x3a7a64[_0x135b('0x38')],{'$or':_['map'](_0x4131e8,function(_0x3a5428){if(_0x3a5428[_0x135b('0x2b')]!=='VIRTUAL'){var _0x25a660={};_0x25a660[_0x3a5428['name']]={'$like':'%'+_0x3ccb3d[_0x135b('0x2e')][_0x135b('0x3a')]+'%'};return _0x25a660;}})});}_0x3a7a64=_[_0x135b('0x3b')]({},_0x3a7a64,_0x3ccb3d[_0x135b('0x3c')]);var _0x145d83={'where':_0x3a7a64[_0x135b('0x38')]};return db[_0x135b('0x3d')][_0x135b('0x3e')](_0x145d83)[_0x135b('0x1f')](function(_0x1b9870){_0x716611[_0x135b('0x3e')]=_0x1b9870;if(_0x3ccb3d['query'][_0x135b('0x3f')]){_0x3a7a64[_0x135b('0x40')]=[{'all':!![]}];}return db[_0x135b('0x3d')][_0x135b('0x41')](_0x3a7a64);})[_0x135b('0x1f')](function(_0x1f1f9f){_0x716611[_0x135b('0x42')]=_0x1f1f9f;return _0x716611;})[_0x135b('0x1f')](respondWithFilteredResult(_0x2f0f98,_0x3a7a64))[_0x135b('0x43')](handleError(_0x2f0f98,null));};exports['show']=function(_0x4e947b,_0x1625ac){var _0x4c8c23={'raw':!![],'where':{'id':_0x4e947b['params']['id']}},_0x19c7ef={};_0x19c7ef[_0x135b('0x2d')]=_[_0x135b('0x2f')](db[_0x135b('0x3d')][_0x135b('0x29')]);_0x19c7ef['query']=_[_0x135b('0x2f')](_0x4e947b[_0x135b('0x2e')]);_0x19c7ef[_0x135b('0x30')]=_['intersection'](_0x19c7ef[_0x135b('0x2d')],_0x19c7ef[_0x135b('0x2e')]);_0x4c8c23[_0x135b('0x32')]=_['intersection'](_0x19c7ef[_0x135b('0x2d')],qs[_0x135b('0x33')](_0x4e947b[_0x135b('0x2e')][_0x135b('0x33')]));_0x4c8c23[_0x135b('0x32')]=_0x4c8c23['attributes'][_0x135b('0x34')]?_0x4c8c23[_0x135b('0x32')]:_0x19c7ef['model'];if(_0x4e947b[_0x135b('0x2e')][_0x135b('0x3f')]){_0x4c8c23[_0x135b('0x40')]=[{'all':!![]}];}_0x4c8c23=_['merge']({},_0x4c8c23,_0x4e947b[_0x135b('0x3c')]);return db[_0x135b('0x3d')][_0x135b('0x44')](_0x4c8c23)[_0x135b('0x1f')](handleEntityNotFound(_0x1625ac,null))['then'](respondWithResult(_0x1625ac,null))[_0x135b('0x43')](handleError(_0x1625ac,null));};exports[_0x135b('0x45')]=function(_0x141e0f,_0x144cbd){return db['Variable'][_0x135b('0x45')](_0x141e0f['body'],{})['then'](function(_0x17e309){var _0x3694b7=_0x141e0f['user'][_0x135b('0x46')]({'plain':!![]});if(!_0x3694b7)throw new Error(_0x135b('0x47'));if(_0x3694b7['role']===_0x135b('0x48')){var _0x1a6d5b=_0x17e309[_0x135b('0x46')]({'plain':!![]});var _0x5781a5=_0x135b('0x21');return db[_0x135b('0x49')][_0x135b('0x44')]({'where':{'name':_0x5781a5,'userProfileId':_0x3694b7[_0x135b('0x4a')]},'raw':!![]})[_0x135b('0x1f')](function(_0x2d8713){if(_0x2d8713&&_0x2d8713[_0x135b('0x4b')]===0x0){return db['UserProfileResource'][_0x135b('0x45')]({'name':_0x1a6d5b[_0x135b('0x26')],'resourceId':_0x1a6d5b['id'],'type':_0x2d8713[_0x135b('0x26')],'sectionId':_0x2d8713['id']},{})[_0x135b('0x1f')](function(){return _0x17e309;});}else{return _0x17e309;}})['catch'](function(_0x4a5894){logger[_0x135b('0x24')](_0x135b('0x4c'),_0x4a5894);throw _0x4a5894;});}return _0x17e309;})[_0x135b('0x1f')](respondWithResult(_0x144cbd,0xc9))[_0x135b('0x43')](handleError(_0x144cbd,null));};exports[_0x135b('0x4d')]=function(_0x4a3fc8,_0x543e02){if(_0x4a3fc8['body']['id']){delete _0x4a3fc8[_0x135b('0x4e')]['id'];}return db[_0x135b('0x3d')][_0x135b('0x44')]({'where':{'id':_0x4a3fc8[_0x135b('0x4f')]['id']}})[_0x135b('0x1f')](handleEntityNotFound(_0x543e02,null))[_0x135b('0x1f')](saveUpdates(_0x4a3fc8['body'],null))[_0x135b('0x1f')](respondWithResult(_0x543e02,null))[_0x135b('0x43')](handleError(_0x543e02,null));};exports[_0x135b('0x20')]=function(_0x426539,_0x396690){return db[_0x135b('0x3d')][_0x135b('0x44')]({'where':{'id':_0x426539[_0x135b('0x4f')]['id']}})[_0x135b('0x1f')](handleEntityNotFound(_0x396690,null))[_0x135b('0x1f')](removeEntity(_0x396690,null))['catch'](handleError(_0x396690,null));}; \ No newline at end of file +var _0x79b9=['rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Variables','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','moment','bluebird','mustache','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','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','get','error','name','Variable','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x123cee,_0x3403db){var _0x272716=function(_0x3a6c19){while(--_0x3a6c19){_0x123cee['push'](_0x123cee['shift']());}};_0x272716(++_0x3403db);}(_0x79b9,0x193));var _0x979b=function(_0x478927,_0x137268){_0x478927=_0x478927-0x0;var _0x37223f=_0x79b9[_0x478927];return _0x37223f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x979b('0x0'));var zipdir=require(_0x979b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x979b('0x2'));var BPromise=require(_0x979b('0x3'));var Mustache=require(_0x979b('0x4'));var util=require('util');var path=require('path');var sox=require(_0x979b('0x5'));var csv=require(_0x979b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x979b('0x7'));var squel=require(_0x979b('0x8'));var crypto=require(_0x979b('0x9'));var jsforce=require(_0x979b('0xa'));var deskjs=require(_0x979b('0xb'));var toCsv=require(_0x979b('0x6'));var querystring=require(_0x979b('0xc'));var Papa=require(_0x979b('0xd'));var Redis=require(_0x979b('0xe'));var authService=require(_0x979b('0xf'));var qs=require(_0x979b('0x10'));var as=require(_0x979b('0x11'));var hardwareService=require(_0x979b('0x12'));var logger=require(_0x979b('0x13'))('api');var utils=require(_0x979b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x979b('0x15'));var db=require(_0x979b('0x16'))['db'];function respondWithStatusCode(_0x335ce4,_0x9cacfb){_0x9cacfb=_0x9cacfb||0xcc;return function(_0x3bae73){if(_0x3bae73){return _0x335ce4[_0x979b('0x17')](_0x9cacfb);}return _0x335ce4[_0x979b('0x18')](_0x9cacfb)[_0x979b('0x19')]();};}function respondWithResult(_0x32ccb7,_0xa9940e){_0xa9940e=_0xa9940e||0xc8;return function(_0x592039){if(_0x592039){return _0x32ccb7['status'](_0xa9940e)[_0x979b('0x1a')](_0x592039);}};}function respondWithFilteredResult(_0x409989,_0xba0654){return function(_0x51f808){if(_0x51f808){var _0x2c2ab1=typeof _0xba0654[_0x979b('0x1b')]===_0x979b('0x1c')&&typeof _0xba0654[_0x979b('0x1d')]===_0x979b('0x1c');var _0x4319b4=_0x51f808[_0x979b('0x1e')];var _0x218347=_0x2c2ab1?0x0:_0xba0654[_0x979b('0x1b')];var _0x2aed33=_0x2c2ab1?_0x51f808['count']:_0xba0654[_0x979b('0x1b')]+_0xba0654['limit'];var _0x1fe917;if(_0x2aed33>=_0x4319b4){_0x2aed33=_0x4319b4;_0x1fe917=0xc8;}else{_0x1fe917=0xce;}_0x409989['status'](_0x1fe917);return _0x409989['set']('Content-Range',_0x218347+'-'+_0x2aed33+'/'+_0x4319b4)[_0x979b('0x1a')](_0x51f808);}return null;};}function patchUpdates(_0x5a3bd5){return function(_0x12710e){try{jsonpatch[_0x979b('0x1f')](_0x12710e,_0x5a3bd5,!![]);}catch(_0x3cacf9){return BPromise[_0x979b('0x20')](_0x3cacf9);}return _0x12710e[_0x979b('0x21')]();};}function saveUpdates(_0x48ddd4,_0x138718){return function(_0x16dd01){if(_0x16dd01){return _0x16dd01[_0x979b('0x22')](_0x48ddd4)['then'](function(_0x5f589d){return _0x5f589d;});}return null;};}function removeEntity(_0x14dd73,_0x332d49){return function(_0x1400f8){if(_0x1400f8){return _0x1400f8[_0x979b('0x23')]()[_0x979b('0x24')](function(){var _0x211ac8=_0x1400f8[_0x979b('0x25')]({'plain':!![]});var _0x340950='Variables';return db['UserProfileResource'][_0x979b('0x23')]({'where':{'type':_0x340950,'resourceId':_0x211ac8['id']}})[_0x979b('0x24')](function(){return _0x1400f8;});})[_0x979b('0x24')](function(){_0x14dd73['status'](0xcc)[_0x979b('0x19')]();});}};}function handleEntityNotFound(_0x397424,_0x1416b4){return function(_0x1791da){if(!_0x1791da){_0x397424[_0x979b('0x17')](0x194);}return _0x1791da;};}function handleError(_0x1ba50a,_0x502800){_0x502800=_0x502800||0x1f4;return function(_0x5757da){logger[_0x979b('0x26')](_0x5757da['stack']);if(_0x5757da[_0x979b('0x27')]){delete _0x5757da[_0x979b('0x27')];}_0x1ba50a[_0x979b('0x18')](_0x502800)['send'](_0x5757da);};}exports['index']=function(_0x5adad6,_0x2fc484){var _0x851159={},_0xd88bad={},_0xc34a1c={'count':0x0,'rows':[]};var _0x465e9a=_['map'](db[_0x979b('0x28')]['rawAttributes'],function(_0x3989d7){return{'name':_0x3989d7[_0x979b('0x29')],'type':_0x3989d7[_0x979b('0x2a')][_0x979b('0x2b')]};});_0xd88bad['model']=_[_0x979b('0x2c')](_0x465e9a,_0x979b('0x27'));_0xd88bad[_0x979b('0x2d')]=_[_0x979b('0x2e')](_0x5adad6[_0x979b('0x2d')]);_0xd88bad[_0x979b('0x2f')]=_['intersection'](_0xd88bad[_0x979b('0x30')],_0xd88bad[_0x979b('0x2d')]);_0x851159[_0x979b('0x31')]=_[_0x979b('0x32')](_0xd88bad['model'],qs[_0x979b('0x33')](_0x5adad6[_0x979b('0x2d')][_0x979b('0x33')]));_0x851159[_0x979b('0x31')]=_0x851159[_0x979b('0x31')][_0x979b('0x34')]?_0x851159[_0x979b('0x31')]:_0xd88bad[_0x979b('0x30')];if(!_0x5adad6[_0x979b('0x2d')][_0x979b('0x35')]('nolimit')){_0x851159[_0x979b('0x1d')]=qs[_0x979b('0x1d')](_0x5adad6[_0x979b('0x2d')][_0x979b('0x1d')]);_0x851159[_0x979b('0x1b')]=qs[_0x979b('0x1b')](_0x5adad6[_0x979b('0x2d')][_0x979b('0x1b')]);}_0x851159['order']=qs[_0x979b('0x36')](_0x5adad6['query'][_0x979b('0x36')]);_0x851159['where']=qs['filters'](_['pick'](_0x5adad6[_0x979b('0x2d')],_0xd88bad[_0x979b('0x2f')]),_0x465e9a);if(_0x5adad6[_0x979b('0x2d')][_0x979b('0x37')]){_0x851159[_0x979b('0x38')]=_[_0x979b('0x39')](_0x851159[_0x979b('0x38')],{'$or':_[_0x979b('0x2c')](_0x465e9a,function(_0x4c1140){if(_0x4c1140[_0x979b('0x2a')]!==_0x979b('0x3a')){var _0x3ecf64={};_0x3ecf64[_0x4c1140['name']]={'$like':'%'+_0x5adad6['query'][_0x979b('0x37')]+'%'};return _0x3ecf64;}})});}_0x851159=_['merge']({},_0x851159,_0x5adad6[_0x979b('0x3b')]);var _0x438687={'where':_0x851159[_0x979b('0x38')]};return db[_0x979b('0x28')][_0x979b('0x1e')](_0x438687)['then'](function(_0x148e77){_0xc34a1c[_0x979b('0x1e')]=_0x148e77;if(_0x5adad6[_0x979b('0x2d')][_0x979b('0x3c')]){_0x851159[_0x979b('0x3d')]=[{'all':!![]}];}return db[_0x979b('0x28')][_0x979b('0x3e')](_0x851159);})[_0x979b('0x24')](function(_0x194cc1){_0xc34a1c[_0x979b('0x3f')]=_0x194cc1;return _0xc34a1c;})[_0x979b('0x24')](respondWithFilteredResult(_0x2fc484,_0x851159))[_0x979b('0x40')](handleError(_0x2fc484,null));};exports['show']=function(_0xbc433,_0x11d3e6){var _0x8dddef={'raw':!![],'where':{'id':_0xbc433['params']['id']}},_0x3d435a={};_0x3d435a[_0x979b('0x30')]=_[_0x979b('0x2e')](db[_0x979b('0x28')][_0x979b('0x41')]);_0x3d435a[_0x979b('0x2d')]=_[_0x979b('0x2e')](_0xbc433[_0x979b('0x2d')]);_0x3d435a[_0x979b('0x2f')]=_[_0x979b('0x32')](_0x3d435a[_0x979b('0x30')],_0x3d435a[_0x979b('0x2d')]);_0x8dddef[_0x979b('0x31')]=_[_0x979b('0x32')](_0x3d435a[_0x979b('0x30')],qs['fields'](_0xbc433[_0x979b('0x2d')][_0x979b('0x33')]));_0x8dddef[_0x979b('0x31')]=_0x8dddef['attributes'][_0x979b('0x34')]?_0x8dddef[_0x979b('0x31')]:_0x3d435a[_0x979b('0x30')];if(_0xbc433['query'][_0x979b('0x3c')]){_0x8dddef[_0x979b('0x3d')]=[{'all':!![]}];}_0x8dddef=_[_0x979b('0x39')]({},_0x8dddef,_0xbc433[_0x979b('0x3b')]);return db['Variable'][_0x979b('0x42')](_0x8dddef)[_0x979b('0x24')](handleEntityNotFound(_0x11d3e6,null))['then'](respondWithResult(_0x11d3e6,null))[_0x979b('0x40')](handleError(_0x11d3e6,null));};exports[_0x979b('0x43')]=function(_0x20592b,_0x3c8038){return db[_0x979b('0x28')][_0x979b('0x43')](_0x20592b[_0x979b('0x44')],{})['then'](function(_0x3dfc15){var _0x5e386b=_0x20592b['user'][_0x979b('0x25')]({'plain':!![]});if(!_0x5e386b)throw new Error(_0x979b('0x45'));if(_0x5e386b[_0x979b('0x46')]===_0x979b('0x47')){var _0x28b096=_0x3dfc15[_0x979b('0x25')]({'plain':!![]});var _0x2da1a5=_0x979b('0x48');return db[_0x979b('0x49')][_0x979b('0x42')]({'where':{'name':_0x2da1a5,'userProfileId':_0x5e386b[_0x979b('0x4a')]},'raw':!![]})[_0x979b('0x24')](function(_0x5efa44){if(_0x5efa44&&_0x5efa44[_0x979b('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x28b096[_0x979b('0x27')],'resourceId':_0x28b096['id'],'type':_0x5efa44[_0x979b('0x27')],'sectionId':_0x5efa44['id']},{})[_0x979b('0x24')](function(){return _0x3dfc15;});}else{return _0x3dfc15;}})['catch'](function(_0x182e36){logger['error'](_0x979b('0x4c'),_0x182e36);throw _0x182e36;});}return _0x3dfc15;})[_0x979b('0x24')](respondWithResult(_0x3c8038,0xc9))[_0x979b('0x40')](handleError(_0x3c8038,null));};exports[_0x979b('0x22')]=function(_0xc138b,_0x3794e2){if(_0xc138b[_0x979b('0x44')]['id']){delete _0xc138b[_0x979b('0x44')]['id'];}return db['Variable']['find']({'where':{'id':_0xc138b[_0x979b('0x4d')]['id']}})[_0x979b('0x24')](handleEntityNotFound(_0x3794e2,null))[_0x979b('0x24')](saveUpdates(_0xc138b[_0x979b('0x44')],null))[_0x979b('0x24')](respondWithResult(_0x3794e2,null))[_0x979b('0x40')](handleError(_0x3794e2,null));};exports['destroy']=function(_0x3787c9,_0x30404d){return db[_0x979b('0x28')][_0x979b('0x42')]({'where':{'id':_0x3787c9[_0x979b('0x4d')]['id']}})['then'](handleEntityNotFound(_0x30404d,null))[_0x979b('0x24')](removeEntity(_0x30404d,null))['catch'](handleError(_0x30404d,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 48fda5f..c21dca4 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 _0xc979=['./variable.attributes','exports','Variable','tools_variables','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x11a0d5,_0xf8c82e){var _0x18560a=function(_0x284d99){while(--_0x284d99){_0x11a0d5['push'](_0x11a0d5['shift']());}};_0x18560a(++_0xf8c82e);}(_0xc979,0x1be));var _0x9c97=function(_0xaa8771,_0x17a0f0){_0xaa8771=_0xaa8771-0x0;var _0x1dbb73=_0xc979[_0xaa8771];return _0x1dbb73;};'use strict';var _=require(_0x9c97('0x0'));var util=require(_0x9c97('0x1'));var logger=require(_0x9c97('0x2'))(_0x9c97('0x3'));var moment=require(_0x9c97('0x4'));var BPromise=require(_0x9c97('0x5'));var rp=require(_0x9c97('0x6'));var fs=require('fs');var path=require(_0x9c97('0x7'));var rimraf=require('rimraf');var config=require(_0x9c97('0x8'));var attributes=require(_0x9c97('0x9'));module[_0x9c97('0xa')]=function(_0x1ab68e,_0x49b94d){return _0x1ab68e['define'](_0x9c97('0xb'),attributes,{'tableName':_0x9c97('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11a4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','define','Variable','../../config/logger','api'];(function(_0x5bb9b7,_0x4cefc4){var _0x4391f6=function(_0x30acb1){while(--_0x30acb1){_0x5bb9b7['push'](_0x5bb9b7['shift']());}};_0x4391f6(++_0x4cefc4);}(_0x11a4,0x106));var _0x411a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x11a4[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x411a('0x0'))(_0x411a('0x1'));var moment=require(_0x411a('0x2'));var BPromise=require(_0x411a('0x3'));var rp=require(_0x411a('0x4'));var fs=require('fs');var path=require(_0x411a('0x5'));var rimraf=require(_0x411a('0x6'));var config=require(_0x411a('0x7'));var attributes=require(_0x411a('0x8'));module['exports']=function(_0x237bc3,_0x398e15){return _0x237bc3[_0x411a('0x9')](_0x411a('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 87d7544..f4dcac6 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 _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x533ef3,_0x42fc7c){var _0x25ceac=function(_0x462932){while(--_0x462932){_0x533ef3['push'](_0x533ef3['shift']());}};_0x25ceac(++_0x42fc7c);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4e2fc3,_0x186b31){_0x4e2fc3=_0x4e2fc3-0x0;var _0x26f00b=_0x8ef6[_0x4e2fc3];return _0x26f00b;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ No newline at end of file +var _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x1ab81e,_0x51c772){var _0x368707=function(_0x5e2b38){while(--_0x5e2b38){_0x1ab81e['push'](_0x1ab81e['shift']());}};_0x368707(++_0x51c772);}(_0xf494,0x1c6));var _0x4f49=function(_0x2b5b6e,_0x4b8812){_0x2b5b6e=_0x2b5b6e-0x0;var _0x242dcc=_0xf494[_0x2b5b6e];return _0x242dcc;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 2a64608..1e713e4 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 _0x881c=['exports','express','Router','../../components/auth/service','./version.controller','index','get','/fetch','isAuthenticated','fetch','/reset','canUpdate','reset','/pull','/restart','/migrations','migrations'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x881c,0x1aa));var _0xc881=function(_0xd0969d,_0x4fac9d){_0xd0969d=_0xd0969d-0x0;var _0x14561f=_0x881c[_0xd0969d];return _0x14561f;};'use strict';var express=require(_0xc881('0x0'));var router=express[_0xc881('0x1')]();var auth=require(_0xc881('0x2'));var controller=require(_0xc881('0x3'));router['get']('/',controller[_0xc881('0x4')]);router[_0xc881('0x5')](_0xc881('0x6'),auth[_0xc881('0x7')](),auth['canUpdate'](),controller[_0xc881('0x8')]);router[_0xc881('0x5')](_0xc881('0x9'),auth[_0xc881('0x7')](),auth[_0xc881('0xa')](),controller[_0xc881('0xb')]);router[_0xc881('0x5')](_0xc881('0xc'),auth['isAuthenticated'](),auth[_0xc881('0xa')](),controller['pull']);router[_0xc881('0x5')](_0xc881('0xd'),auth[_0xc881('0x7')](),controller['restart']);router[_0xc881('0x5')](_0xc881('0xe'),controller[_0xc881('0xf')]);module[_0xc881('0x10')]=router; \ No newline at end of file +var _0x4830=['canUpdate','reset','pull','/restart','restart','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','fetch','/reset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4830,0x11d));var _0x0483=function(_0x183d5f,_0x5b5051){_0x183d5f=_0x183d5f-0x0;var _0x5cc670=_0x4830[_0x183d5f];return _0x5cc670;};'use strict';var express=require('express');var router=express[_0x0483('0x0')]();var auth=require(_0x0483('0x1'));var controller=require(_0x0483('0x2'));router[_0x0483('0x3')]('/',controller[_0x0483('0x4')]);router[_0x0483('0x3')](_0x0483('0x5'),auth[_0x0483('0x6')](),auth['canUpdate'](),controller[_0x0483('0x7')]);router[_0x0483('0x3')](_0x0483('0x8'),auth[_0x0483('0x6')](),auth[_0x0483('0x9')](),controller[_0x0483('0xa')]);router['get']('/pull',auth[_0x0483('0x6')](),auth[_0x0483('0x9')](),controller[_0x0483('0xb')]);router['get'](_0x0483('0xc'),auth[_0x0483('0x6')](),controller[_0x0483('0xd')]);router[_0x0483('0x3')]('/migrations',controller['migrations']);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 5107441..1bc3a3a 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 _0x74dc=['replace','.js','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','Database\x20already\x20up-to-date','umzug','path','lodash','compare-versions','child_process','../../config/environment','../../config/pm2','../../config/logger','update','root','index','exports','version','query','fetch','tags','latest','2.0.0','status','json','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','catch','readdirSync','join','server','migrations','length'];(function(_0x12f544,_0x310ea9){var _0xeaea38=function(_0x58067d){while(--_0x58067d){_0x12f544['push'](_0x12f544['shift']());}};_0xeaea38(++_0x310ea9);}(_0x74dc,0xdc));var _0xc74d=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x74dc[_0x1ab180];return _0xfb2c2d;};'use strict';var Umzug=require(_0xc74d('0x0'));var path=require(_0xc74d('0x1'));var fs=require('fs');var _=require(_0xc74d('0x2'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0xc74d('0x3'));var exec=require(_0xc74d('0x4'))['exec'];var db=require('../../mysqldb')['db'];var config=require(_0xc74d('0x5'));var pm2=require(_0xc74d('0x6'));var logger=require(_0xc74d('0x7'))(_0xc74d('0x8'));var git=require('simple-git')(config[_0xc74d('0x9')]);exports[_0xc74d('0xa')]=function(_0x2a9a5d,_0x517ee0){var _0xc2adff={'current':module[_0xc74d('0xb')][_0xc74d('0xc')],'phonebar':0x2};if(_0x2a9a5d[_0xc74d('0xd')]&&_0x2a9a5d[_0xc74d('0xd')]['latest']){return git[_0xc74d('0xe')]()[_0xc74d('0xf')](function(_0x234ee6,_0x32be7e){_0xc2adff[_0xc74d('0x10')]=(_0x234ee6?module['exports'][_0xc74d('0xc')]:_0x32be7e['latest'])||_0xc74d('0x11');return _0x517ee0['status'](0xc8)['json'](_0xc2adff);});}else{return _0x517ee0[_0xc74d('0x12')](0xc8)[_0xc74d('0x13')](_0xc2adff);}};exports[_0xc74d('0xe')]=function(_0x4542a0,_0x11845e){return git['fetch']([_0xc74d('0x14'),_0xc74d('0x15')],function(_0xd874f4){if(_0xd874f4){logger[_0xc74d('0x16')](_0xd874f4);return _0x11845e[_0xc74d('0x12')](0x1f4)[_0xc74d('0x13')](_0xd874f4);}logger['info'](_0xc74d('0x17'));return _0x11845e[_0xc74d('0x12')](0xc8)[_0xc74d('0x13')]({'output':_0xc74d('0x18')});});};exports['reset']=function(_0x19a171,_0x53f63b){return git[_0xc74d('0x19')]([_0xc74d('0x1a'),'FETCH_HEAD'],function(_0x37c63c){if(_0x37c63c){logger[_0xc74d('0x16')](_0x37c63c);return _0x53f63b[_0xc74d('0x12')](0x1f4)[_0xc74d('0x13')](_0x37c63c);}logger[_0xc74d('0x1b')](_0xc74d('0x1c'));return _0x53f63b[_0xc74d('0x12')](0xc8)[_0xc74d('0x13')]({'output':_0xc74d('0x1d')});});};exports['pull']=function(_0x229c93,_0x1f68af){exec(_0xc74d('0x1e'),function(_0x439c87,_0x43feaa,_0x555397){logger[_0xc74d('0x1b')](_0x43feaa);logger[_0xc74d('0x1b')](_0x555397);if(_0x439c87){logger[_0xc74d('0x16')](_0x439c87);return _0x1f68af['status'](0x1f4)[_0xc74d('0x13')](_0x439c87);}return _0x1f68af[_0xc74d('0x12')](0xc8)['json']({'output':_0x43feaa});});};exports[_0xc74d('0x1f')]=function(_0x44e487,_0x405ba0){return pm2[_0xc74d('0x1f')](_0xc74d('0x20'))[_0xc74d('0x21')](function(_0x4de370){logger[_0xc74d('0x1b')]('pm2\x20restart\x20motion\x20%s',_0x4de370);return _0x405ba0[_0xc74d('0x12')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xc74d('0x22')](function(_0x2365fb){logger[_0xc74d('0x16')](_0x2365fb);return _0x405ba0[_0xc74d('0x12')](0x1f4)[_0xc74d('0x13')](_0x2365fb);});};exports['migrations']=function(_0x3f8b07,_0x40d42d){var _0x281aea=fs[_0xc74d('0x23')](path[_0xc74d('0x24')](config['root'],_0xc74d('0x25'),_0xc74d('0x26')));var _0x56b1fb=[];for(var _0x217973=0x0;_0x217973<_0x281aea[_0xc74d('0x27')];_0x217973++){var _0x26ecb4=_0x281aea[_0x217973][_0xc74d('0x28')](_0xc74d('0x29'),'');if(compareVersions(module[_0xc74d('0xb')]['version'],_0x26ecb4)===-0x1){_0x56b1fb['push'](_0x26ecb4);}}if(_0x56b1fb[_0xc74d('0x27')]){var _0x2c8e91=_0x56b1fb[_0xc74d('0x2a')](compareVersions);var _0x239e0e=new Umzug({'storage':_0xc74d('0x2b'),'storageOptions':{'model':db[_0xc74d('0x2c')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0xc74d('0x2b')][_0xc74d('0x2d')](),db['sequelize'][_0xc74d('0x2e')],function(){throw new Error(_0xc74d('0x2f'));}],'path':path[_0xc74d('0x24')](config[_0xc74d('0x9')],_0xc74d('0x25'),'migrations'),'pattern':/\.js$/}});_0x239e0e['up']({'migrations':_[_0xc74d('0x30')](_0x2c8e91,function(_0x33d19a){return _0x33d19a+'.js';})})[_0xc74d('0x21')](function(){return _0x40d42d[_0xc74d('0x12')](0xc8)['json']({'output':_0xc74d('0x31')+module[_0xc74d('0xb')][_0xc74d('0xc')]+_0xc74d('0x32')+_['last'](_0x2c8e91),'migrations':_[_0xc74d('0x24')](_0x2c8e91)});})[_0xc74d('0x22')](function(_0x3c8939){if(_0x3c8939 instanceof db[_0xc74d('0x2b')]['UniqueConstraintError']){return _0x40d42d[_0xc74d('0x12')](0xc8)[_0xc74d('0x13')]({'output':_0xc74d('0x33')});}else{return _0x40d42d[_0xc74d('0x12')](0x1f4)[_0xc74d('0x13')](_0x3c8939);}});}else{return _0x40d42d[_0xc74d('0x12')](0xc8)[_0xc74d('0x13')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xe2eb=['version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','query','latest','tags','2.0.0','status','json','fetch','origin','master','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','error','restart','motion2','pm2\x20restart\x20motion\x20%s','catch','readdirSync','join','migrations','length','replace','.js','sequelize','Migration','getQueryInterface','constructor','server','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','exports','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0xe2eb,0x9f));var _0xbe2e=function(_0x53cc22,_0x5c6807){_0x53cc22=_0x53cc22-0x0;var _0x6014f9=_0xe2eb[_0x53cc22];return _0x6014f9;};'use strict';var Umzug=require(_0xbe2e('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xbe2e('0x1'));var pkginfo=require(_0xbe2e('0x2'))(module,_0xbe2e('0x3'));var compareVersions=require(_0xbe2e('0x4'));var exec=require(_0xbe2e('0x5'))[_0xbe2e('0x6')];var db=require(_0xbe2e('0x7'))['db'];var config=require(_0xbe2e('0x8'));var pm2=require(_0xbe2e('0x9'));var logger=require(_0xbe2e('0xa'))(_0xbe2e('0xb'));var git=require(_0xbe2e('0xc'))(config[_0xbe2e('0xd')]);exports['index']=function(_0x1928c4,_0xeea810){var _0x4ff9c4={'current':module['exports']['version'],'phonebar':0x2};if(_0x1928c4[_0xbe2e('0xe')]&&_0x1928c4[_0xbe2e('0xe')][_0xbe2e('0xf')]){return git['fetch']()[_0xbe2e('0x10')](function(_0x5b8830,_0x5c4cd1){_0x4ff9c4['latest']=(_0x5b8830?module['exports'][_0xbe2e('0x3')]:_0x5c4cd1[_0xbe2e('0xf')])||_0xbe2e('0x11');return _0xeea810[_0xbe2e('0x12')](0xc8)[_0xbe2e('0x13')](_0x4ff9c4);});}else{return _0xeea810[_0xbe2e('0x12')](0xc8)[_0xbe2e('0x13')](_0x4ff9c4);}};exports['fetch']=function(_0x57d98d,_0xa96217){return git[_0xbe2e('0x14')]([_0xbe2e('0x15'),_0xbe2e('0x16')],function(_0x2cdce0){if(_0x2cdce0){logger['error'](_0x2cdce0);return _0xa96217[_0xbe2e('0x12')](0x1f4)[_0xbe2e('0x13')](_0x2cdce0);}logger['info'](_0xbe2e('0x17'));return _0xa96217[_0xbe2e('0x12')](0xc8)[_0xbe2e('0x13')]({'output':_0xbe2e('0x18')});});};exports[_0xbe2e('0x19')]=function(_0x79cd5b,_0x283d96){return git[_0xbe2e('0x19')](['--hard',_0xbe2e('0x1a')],function(_0x5da03d){if(_0x5da03d){logger['error'](_0x5da03d);return _0x283d96[_0xbe2e('0x12')](0x1f4)[_0xbe2e('0x13')](_0x5da03d);}logger[_0xbe2e('0x1b')](_0xbe2e('0x1c'));return _0x283d96[_0xbe2e('0x12')](0xc8)[_0xbe2e('0x13')]({'output':_0xbe2e('0x1d')});});};exports['pull']=function(_0x2fc975,_0xecb458){exec(_0xbe2e('0x1e'),function(_0x48bc28,_0x20942a,_0x59a34f){logger[_0xbe2e('0x1b')](_0x20942a);logger['info'](_0x59a34f);if(_0x48bc28){logger[_0xbe2e('0x1f')](_0x48bc28);return _0xecb458[_0xbe2e('0x12')](0x1f4)[_0xbe2e('0x13')](_0x48bc28);}return _0xecb458[_0xbe2e('0x12')](0xc8)[_0xbe2e('0x13')]({'output':_0x20942a});});};exports[_0xbe2e('0x20')]=function(_0x31dc23,_0x5df175){return pm2[_0xbe2e('0x20')](_0xbe2e('0x21'))['then'](function(_0x1d2751){logger[_0xbe2e('0x1b')](_0xbe2e('0x22'),_0x1d2751);return _0x5df175[_0xbe2e('0x12')](0xc8)[_0xbe2e('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xbe2e('0x23')](function(_0x44c4d8){logger['error'](_0x44c4d8);return _0x5df175[_0xbe2e('0x12')](0x1f4)[_0xbe2e('0x13')](_0x44c4d8);});};exports['migrations']=function(_0xf6d564,_0xaf4738){var _0xdad0c8=fs[_0xbe2e('0x24')](path[_0xbe2e('0x25')](config['root'],'server',_0xbe2e('0x26')));var _0xb21487=[];for(var _0x23a0c0=0x0;_0x23a0c0<_0xdad0c8[_0xbe2e('0x27')];_0x23a0c0++){var _0x518657=_0xdad0c8[_0x23a0c0][_0xbe2e('0x28')](_0xbe2e('0x29'),'');if(compareVersions(module['exports'][_0xbe2e('0x3')],_0x518657)===-0x1){_0xb21487['push'](_0x518657);}}if(_0xb21487[_0xbe2e('0x27')]){var _0x2422fa=_0xb21487['sort'](compareVersions);var _0x4d33ac=new Umzug({'storage':_0xbe2e('0x2a'),'storageOptions':{'model':db[_0xbe2e('0x2b')],'modelName':_0xbe2e('0x2b'),'columnName':_0xbe2e('0x3')},'migrations':{'params':[db['sequelize'][_0xbe2e('0x2c')](),db['sequelize'][_0xbe2e('0x2d')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path['join'](config['root'],_0xbe2e('0x2e'),_0xbe2e('0x26')),'pattern':/\.js$/}});_0x4d33ac['up']({'migrations':_[_0xbe2e('0x2f')](_0x2422fa,function(_0x55c488){return _0x55c488+_0xbe2e('0x29');})})[_0xbe2e('0x30')](function(){return _0xaf4738[_0xbe2e('0x12')](0xc8)[_0xbe2e('0x13')]({'output':_0xbe2e('0x31')+module[_0xbe2e('0x32')][_0xbe2e('0x3')]+_0xbe2e('0x33')+_['last'](_0x2422fa),'migrations':_[_0xbe2e('0x25')](_0x2422fa)});})[_0xbe2e('0x23')](function(_0x5cd7b5){if(_0x5cd7b5 instanceof db['sequelize'][_0xbe2e('0x34')]){return _0xaf4738['status'](0xc8)[_0xbe2e('0x13')]({'output':_0xbe2e('0x35')});}else{return _0xaf4738[_0xbe2e('0x12')](0x1f4)[_0xbe2e('0x13')](_0x5cd7b5);}});}else{return _0xaf4738[_0xbe2e('0x12')](0xc8)[_0xbe2e('0x13')]({'output':_0xbe2e('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 5475f0c..ed363b2 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 _0xfa2e=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x1cc3a5,_0x59850b){var _0x4bf8b7=function(_0x3588ff){while(--_0x3588ff){_0x1cc3a5['push'](_0x1cc3a5['shift']());}};_0x4bf8b7(++_0x59850b);}(_0xfa2e,0x1ae));var _0xefa2=function(_0x5900eb,_0x363867){_0x5900eb=_0x5900eb-0x0;var _0x4da136=_0xfa2e[_0x5900eb];return _0x4da136;};'use strict';var multer=require(_0xefa2('0x0'));var util=require(_0xefa2('0x1'));var path=require(_0xefa2('0x2'));var timeout=require(_0xefa2('0x3'));var express=require('express');var router=express[_0xefa2('0x4')]();var fs_extra=require(_0xefa2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xefa2('0x6'));var config=require(_0xefa2('0x7'));var controller=require('./voiceAgentReport.controller');router[_0xefa2('0x8')]('/',auth[_0xefa2('0x9')](),controller[_0xefa2('0xa')]);router[_0xefa2('0x8')](_0xefa2('0xb'),auth['isAuthenticated'](),controller[_0xefa2('0xc')]);router[_0xefa2('0x8')]('/:id',auth[_0xefa2('0x9')](),controller[_0xefa2('0xd')]);router['post']('/',auth[_0xefa2('0x9')](),controller[_0xefa2('0xe')]);router[_0xefa2('0xf')](_0xefa2('0x10'),auth['isAuthenticated'](),controller[_0xefa2('0x11')]);router['delete']('/:id',auth[_0xefa2('0x9')](),controller[_0xefa2('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd059=['describe','/:id','post','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd059,0xb2));var _0x9d05=function(_0x36aad4,_0x542209){_0x36aad4=_0x36aad4-0x0;var _0x241eda=_0xd059[_0x36aad4];return _0x241eda;};'use strict';var multer=require(_0x9d05('0x0'));var util=require(_0x9d05('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9d05('0x2'));var router=express['Router']();var fs_extra=require(_0x9d05('0x3'));var auth=require(_0x9d05('0x4'));var interaction=require(_0x9d05('0x5'));var config=require(_0x9d05('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x9d05('0x7')]('/',auth[_0x9d05('0x8')](),controller['index']);router[_0x9d05('0x7')]('/describe',auth[_0x9d05('0x8')](),controller[_0x9d05('0x9')]);router[_0x9d05('0x7')](_0x9d05('0xa'),auth[_0x9d05('0x8')](),controller['show']);router[_0x9d05('0xb')]('/',auth[_0x9d05('0x8')](),controller['create']);router[_0x9d05('0xc')]('/:id',auth[_0x9d05('0x8')](),controller[_0x9d05('0xd')]);router[_0x9d05('0xe')](_0x9d05('0xa'),auth[_0x9d05('0x8')](),controller[_0x9d05('0xf')]);module[_0x9d05('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index ebd71df..b5cc6df 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 _0xccef=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x2bb498,_0x371a82){var _0x1b2247=function(_0x48d139){while(--_0x48d139){_0x2bb498['push'](_0x2bb498['shift']());}};_0x1b2247(++_0x371a82);}(_0xccef,0x1d4));var _0xfcce=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xccef[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');module[_0xfcce('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfcce('0x1')]},'calleridnum':{'type':Sequelize[_0xfcce('0x1')]},'calleridname':{'type':Sequelize[_0xfcce('0x1')]},'queue':{'type':Sequelize[_0xfcce('0x1')]},'interface':{'type':Sequelize[_0xfcce('0x1')]},'membername':{'type':Sequelize[_0xfcce('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xfcce('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xfcce('0x2')]},'holdtime':{'type':Sequelize[_0xfcce('0x3')]},'agentcomplete':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xfcce('0x3')]},'agentacw':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xfcce('0x1')]},'lastevent':{'type':Sequelize[_0xfcce('0x1')]},'channel':{'type':Sequelize[_0xfcce('0x1')]},'channelstate':{'type':Sequelize[_0xfcce('0x3')]},'channelstatedesc':{'type':Sequelize[_0xfcce('0x1')]},'connectedlinenum':{'type':Sequelize[_0xfcce('0x1')]},'connectedlinename':{'type':Sequelize[_0xfcce('0x1')]},'language':{'type':Sequelize[_0xfcce('0x1')]},'accountcode':{'type':Sequelize[_0xfcce('0x1')]},'context':{'type':Sequelize[_0xfcce('0x1')]},'exten':{'type':Sequelize[_0xfcce('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xfcce('0x1')]},'destchannelstate':{'type':Sequelize[_0xfcce('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xfcce('0x1')]},'destcalleridnum':{'type':Sequelize[_0xfcce('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xfcce('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xfcce('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xfcce('0x1')]},'destexten':{'type':Sequelize[_0xfcce('0x1')]},'destpriority':{'type':Sequelize[_0xfcce('0x1')]},'destuniqueid':{'type':Sequelize[_0xfcce('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xfcce('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xfcce('0x1')]},'transfer':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfcce('0x1')],'comment':_0xfcce('0x5')},'transferexten':{'type':Sequelize[_0xfcce('0x1')]},'transferuniqueid':{'type':Sequelize[_0xfcce('0x1')]},'agententerreason':{'type':Sequelize[_0xfcce('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x88c3=['INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','BOOLEAN'];(function(_0xa1d445,_0x357990){var _0x1fea13=function(_0x524134){while(--_0x524134){_0xa1d445['push'](_0xa1d445['shift']());}};_0x1fea13(++_0x357990);}(_0x88c3,0x1ee));var _0x388c=function(_0x397c05,_0x57605e){_0x397c05=_0x397c05-0x0;var _0x4f0db4=_0x88c3[_0x397c05];return _0x4f0db4;};'use strict';var Sequelize=require(_0x388c('0x0'));module['exports']={'type':{'type':Sequelize[_0x388c('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x388c('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x388c('0x1')]},'agentcalledAt':{'type':Sequelize[_0x388c('0x2')]},'agentconnectAt':{'type':Sequelize[_0x388c('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x388c('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x388c('0x2')]},'agentdumpAt':{'type':Sequelize[_0x388c('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x388c('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x388c('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x388c('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x388c('0x4')]},'agentacw':{'type':Sequelize[_0x388c('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x388c('0x4')]},'reason':{'type':Sequelize[_0x388c('0x1')]},'lastevent':{'type':Sequelize[_0x388c('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x388c('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x388c('0x1')]},'language':{'type':Sequelize[_0x388c('0x1')]},'accountcode':{'type':Sequelize[_0x388c('0x1')]},'context':{'type':Sequelize[_0x388c('0x1')]},'exten':{'type':Sequelize[_0x388c('0x1')]},'priority':{'type':Sequelize[_0x388c('0x1')]},'destchannel':{'type':Sequelize[_0x388c('0x1')]},'destchannelstate':{'type':Sequelize[_0x388c('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x388c('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x388c('0x1')]},'destlanguage':{'type':Sequelize[_0x388c('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x388c('0x1')]},'destexten':{'type':Sequelize[_0x388c('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x388c('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x388c('0x1')]},'transfer':{'type':Sequelize[_0x388c('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x388c('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x388c('0x1')]},'agententerreason':{'type':Sequelize[_0x388c('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 26e3486..2ce745f 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(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 5144557..cef3c40 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 _0xac31=['request-promise','rimraf','../../config/environment','define','VoiceAgentReport','report_agent','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xf3c843,_0x8ff24e){var _0x3191c6=function(_0x2f1ef7){while(--_0x2f1ef7){_0xf3c843['push'](_0xf3c843['shift']());}};_0x3191c6(++_0x8ff24e);}(_0xac31,0xca));var _0x1ac3=function(_0x3114c9,_0x1f90ea){_0x3114c9=_0x3114c9-0x0;var _0x1e8a9b=_0xac31[_0x3114c9];return _0x1e8a9b;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var logger=require(_0x1ac3('0x2'))(_0x1ac3('0x3'));var moment=require(_0x1ac3('0x4'));var BPromise=require(_0x1ac3('0x5'));var rp=require(_0x1ac3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ac3('0x7'));var config=require(_0x1ac3('0x8'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0xbe22b7,_0x20027f){return _0xbe22b7[_0x1ac3('0x9')](_0x1ac3('0xa'),attributes,{'tableName':_0x1ac3('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x1ac3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf69d=['report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport'];(function(_0xae01dd,_0xbd8a3c){var _0x8c26df=function(_0x359827){while(--_0x359827){_0xae01dd['push'](_0xae01dd['shift']());}};_0x8c26df(++_0xbd8a3c);}(_0xf69d,0xd3));var _0xdf69=function(_0x520ad4,_0x230adc){_0x520ad4=_0x520ad4-0x0;var _0x459946=_0xf69d[_0x520ad4];return _0x459946;};'use strict';var _=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var logger=require(_0xdf69('0x2'))(_0xdf69('0x3'));var moment=require(_0xdf69('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf69('0x5'));var fs=require('fs');var path=require(_0xdf69('0x6'));var rimraf=require(_0xdf69('0x7'));var config=require(_0xdf69('0x8'));var attributes=require(_0xdf69('0x9'));module[_0xdf69('0xa')]=function(_0x2d456f,_0x465b1b){return _0x2d456f[_0xdf69('0xb')](_0xdf69('0xc'),attributes,{'tableName':_0xdf69('0xd'),'paranoid':![],'indexes':[{'fields':[_0xdf69('0xe'),_0xdf69('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 9333f1e..deb3683 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 _0x7b15=['info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','VoiceAgentReport','create','options','raw','CreateVoiceAgentReport','catch','UpdateVoiceAgentReport','update','body','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x586439,_0x5d62b5){var _0xa90581=function(_0x41bb0b){while(--_0x41bb0b){_0x586439['push'](_0x586439['shift']());}};_0xa90581(++_0x5d62b5);}(_0x7b15,0x10a));var _0x57b1=function(_0xe260a4,_0x4fda4f){_0xe260a4=_0xe260a4-0x0;var _0x5265a2=_0x7b15[_0xe260a4];return _0x5265a2;};'use strict';var _=require(_0x57b1('0x0'));var util=require(_0x57b1('0x1'));var moment=require('moment');var BPromise=require(_0x57b1('0x2'));var rs=require(_0x57b1('0x3'));var fs=require('fs');var Redis=require(_0x57b1('0x4'));var db=require(_0x57b1('0x5'))['db'];var utils=require(_0x57b1('0x6'));var logger=require(_0x57b1('0x7'))(_0x57b1('0x8'));var config=require('../../config/environment');var jayson=require(_0x57b1('0x9'));var client=jayson[_0x57b1('0xa')][_0x57b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c16ca,_0x3f4d29,_0x53e3f3){return new BPromise(function(_0x39945a,_0x45872c){return client[_0x57b1('0xc')](_0x3c16ca,_0x53e3f3)[_0x57b1('0xd')](function(_0x4d29fc){logger[_0x57b1('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x3f4d29,_0x57b1('0xf'));logger[_0x57b1('0x10')](_0x57b1('0x11'),_0x3f4d29,_0x57b1('0xf'),JSON[_0x57b1('0x12')](_0x4d29fc));if(_0x4d29fc['error']){if(_0x4d29fc[_0x57b1('0x13')][_0x57b1('0x14')]===0x1f4){logger['error'](_0x57b1('0x15'),_0x3f4d29,_0x4d29fc[_0x57b1('0x13')]['message']);return _0x45872c(_0x4d29fc['error'][_0x57b1('0x16')]);}logger['error'](_0x57b1('0x15'),_0x3f4d29,_0x4d29fc['error']['message']);return _0x39945a(_0x4d29fc[_0x57b1('0x13')]['message']);}else{logger[_0x57b1('0xe')](_0x57b1('0x15'),_0x3f4d29,_0x57b1('0xf'));_0x39945a(_0x4d29fc['result'][_0x57b1('0x16')]);}})['catch'](function(_0x19ee25){logger[_0x57b1('0x13')](_0x57b1('0x15'),_0x3f4d29,_0x19ee25);_0x45872c(_0x19ee25);});});}exports['CreateVoiceAgentReport']=function(_0x548258){var _0x712f66=this;return new Promise(function(_0x17b74d,_0x1b234c){return db[_0x57b1('0x17')][_0x57b1('0x18')](_0x548258['body'],{'raw':_0x548258[_0x57b1('0x19')]?_0x548258['options'][_0x57b1('0x1a')]===undefined?!![]:![]:!![]})[_0x57b1('0xd')](function(_0x28d990){logger[_0x57b1('0xe')](_0x57b1('0x1b'),_0x548258);logger[_0x57b1('0x10')]('CreateVoiceAgentReport',_0x548258,JSON[_0x57b1('0x12')](_0x28d990));_0x17b74d(_0x28d990);})[_0x57b1('0x1c')](function(_0x5f13a8){logger[_0x57b1('0x13')](_0x57b1('0x1b'),_0x5f13a8[_0x57b1('0x16')],_0x548258);_0x1b234c(_0x712f66[_0x57b1('0x13')](0x1f4,_0x5f13a8[_0x57b1('0x16')]));});});};exports[_0x57b1('0x1d')]=function(_0x37cbec){var _0x59e66c=this;return new Promise(function(_0xdd8b4,_0x6dd94){return db[_0x57b1('0x17')][_0x57b1('0x1e')](_0x37cbec[_0x57b1('0x1f')],{'raw':_0x37cbec['options']?_0x37cbec[_0x57b1('0x19')][_0x57b1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37cbec[_0x57b1('0x19')]?_0x37cbec[_0x57b1('0x19')][_0x57b1('0x20')]||null:null,'attributes':_0x37cbec[_0x57b1('0x19')]?_0x37cbec['options'][_0x57b1('0x21')]||null:null,'limit':_0x37cbec[_0x57b1('0x19')]?_0x37cbec[_0x57b1('0x19')][_0x57b1('0x22')]||null:null})[_0x57b1('0xd')](function(_0x1cfe8b){logger[_0x57b1('0xe')](_0x57b1('0x1d'),_0x37cbec);logger[_0x57b1('0x10')](_0x57b1('0x1d'),_0x37cbec,JSON[_0x57b1('0x12')](_0x1cfe8b));_0xdd8b4(_0x1cfe8b);})[_0x57b1('0x1c')](function(_0x3ad7a7){logger[_0x57b1('0x13')](_0x57b1('0x1d'),_0x3ad7a7[_0x57b1('0x16')],_0x37cbec);_0x6dd94(_0x59e66c[_0x57b1('0x13')](0x1f4,_0x3ad7a7[_0x57b1('0x16')]));});});}; \ No newline at end of file +var _0x7d5c=['VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','VoiceAgentReport,\x20%s,\x20%s','message','catch','CreateVoiceAgentReport','body','options','raw','then','stringify','UpdateVoiceAgentReport','VoiceAgentReport','update','where','attributes','limit','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','debug'];(function(_0x454cb1,_0xdd6f24){var _0x10a95e=function(_0x26234f){while(--_0x26234f){_0x454cb1['push'](_0x454cb1['shift']());}};_0x10a95e(++_0xdd6f24);}(_0x7d5c,0xc6));var _0xc7d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d5c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc7d5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc7d5('0x1'));var rs=require(_0xc7d5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7d5('0x3'))['db'];var utils=require(_0xc7d5('0x4'));var logger=require(_0xc7d5('0x5'))('rpc');var config=require(_0xc7d5('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc7d5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1948b2,_0x14b503,_0x2a547f){return new BPromise(function(_0x235b9d,_0x5eed62){return client[_0xc7d5('0x8')](_0x1948b2,_0x2a547f)['then'](function(_0x50c55e){logger[_0xc7d5('0x9')]('VoiceAgentReport,\x20%s,\x20%s',_0x14b503,_0xc7d5('0xa'));logger[_0xc7d5('0xb')](_0xc7d5('0xc'),_0x14b503,_0xc7d5('0xa'),JSON['stringify'](_0x50c55e));if(_0x50c55e[_0xc7d5('0xd')]){if(_0x50c55e['error'][_0xc7d5('0xe')]===0x1f4){logger[_0xc7d5('0xd')](_0xc7d5('0xf'),_0x14b503,_0x50c55e['error'][_0xc7d5('0x10')]);return _0x5eed62(_0x50c55e[_0xc7d5('0xd')][_0xc7d5('0x10')]);}logger[_0xc7d5('0xd')](_0xc7d5('0xf'),_0x14b503,_0x50c55e[_0xc7d5('0xd')]['message']);return _0x235b9d(_0x50c55e[_0xc7d5('0xd')][_0xc7d5('0x10')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x14b503,_0xc7d5('0xa'));_0x235b9d(_0x50c55e['result'][_0xc7d5('0x10')]);}})[_0xc7d5('0x11')](function(_0x487111){logger[_0xc7d5('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x14b503,_0x487111);_0x5eed62(_0x487111);});});}exports[_0xc7d5('0x12')]=function(_0x113db2){var _0x54ba24=this;return new Promise(function(_0x5ccd1d,_0x4941f7){return db['VoiceAgentReport']['create'](_0x113db2[_0xc7d5('0x13')],{'raw':_0x113db2['options']?_0x113db2[_0xc7d5('0x14')][_0xc7d5('0x15')]===undefined?!![]:![]:!![]})[_0xc7d5('0x16')](function(_0x221f25){logger[_0xc7d5('0x9')]('CreateVoiceAgentReport',_0x113db2);logger[_0xc7d5('0xb')](_0xc7d5('0x12'),_0x113db2,JSON[_0xc7d5('0x17')](_0x221f25));_0x5ccd1d(_0x221f25);})[_0xc7d5('0x11')](function(_0x4e74ec){logger['error'](_0xc7d5('0x12'),_0x4e74ec['message'],_0x113db2);_0x4941f7(_0x54ba24['error'](0x1f4,_0x4e74ec['message']));});});};exports[_0xc7d5('0x18')]=function(_0x3f678d){var _0x414f46=this;return new Promise(function(_0x4058ad,_0x636f5a){return db[_0xc7d5('0x19')][_0xc7d5('0x1a')](_0x3f678d[_0xc7d5('0x13')],{'raw':_0x3f678d['options']?_0x3f678d[_0xc7d5('0x14')][_0xc7d5('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f678d[_0xc7d5('0x14')]?_0x3f678d[_0xc7d5('0x14')][_0xc7d5('0x1b')]||null:null,'attributes':_0x3f678d[_0xc7d5('0x14')]?_0x3f678d[_0xc7d5('0x14')][_0xc7d5('0x1c')]||null:null,'limit':_0x3f678d['options']?_0x3f678d['options'][_0xc7d5('0x1d')]||null:null})['then'](function(_0x347547){logger[_0xc7d5('0x9')](_0xc7d5('0x18'),_0x3f678d);logger['debug'](_0xc7d5('0x18'),_0x3f678d,JSON[_0xc7d5('0x17')](_0x347547));_0x4058ad(_0x347547);})['catch'](function(_0x125572){logger[_0xc7d5('0xd')]('UpdateVoiceAgentReport',_0x125572['message'],_0x3f678d);_0x636f5a(_0x414f46['error'](0x1f4,_0x125572['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 1ebedbc..9f984dc 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 _0x7da7=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x1d9a5a,_0x53eb60){var _0x58b7bd=function(_0x141fd0){while(--_0x141fd0){_0x1d9a5a['push'](_0x1d9a5a['shift']());}};_0x58b7bd(++_0x53eb60);}(_0x7da7,0x10d));var _0x77da=function(_0x1fc4e2,_0x493c3b){_0x1fc4e2=_0x1fc4e2-0x0;var _0x2ba184=_0x7da7[_0x1fc4e2];return _0x2ba184;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./voiceCallReport.controller');router[_0x77da('0x7')]('/',auth[_0x77da('0x8')](),controller['index']);router[_0x77da('0x7')]('/describe',auth[_0x77da('0x8')](),controller[_0x77da('0x9')]);router[_0x77da('0x7')](_0x77da('0xa'),auth[_0x77da('0x8')](),controller['show']);router[_0x77da('0xb')]('/',auth[_0x77da('0x8')](),controller[_0x77da('0xc')]);router['put'](_0x77da('0xa'),auth[_0x77da('0x8')](),controller[_0x77da('0xd')]);router[_0x77da('0xe')]('/:id',auth[_0x77da('0x8')](),controller[_0x77da('0xf')]);module[_0x77da('0x10')]=router; \ No newline at end of file +var _0x5178=['/describe','isAuthenticated','describe','/:id','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index'];(function(_0x23511e,_0x1721ff){var _0x392df4=function(_0x524661){while(--_0x524661){_0x23511e['push'](_0x23511e['shift']());}};_0x392df4(++_0x1721ff);}(_0x5178,0x171));var _0x8517=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5178[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0x8517('0x0'));var path=require(_0x8517('0x1'));var timeout=require(_0x8517('0x2'));var express=require(_0x8517('0x3'));var router=express[_0x8517('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var controller=require('./voiceCallReport.controller');router[_0x8517('0x7')]('/',auth['isAuthenticated'](),controller[_0x8517('0x8')]);router[_0x8517('0x7')](_0x8517('0x9'),auth[_0x8517('0xa')](),controller[_0x8517('0xb')]);router['get'](_0x8517('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8517('0xd')]('/',auth[_0x8517('0xa')](),controller['create']);router[_0x8517('0xe')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0xf')]);router[_0x8517('0x10')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index f67af84..e421f77 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 _0x1117=['DATE','INTEGER','sequelize','STRING','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1117,0x18e));var _0x7111=function(_0x1dc539,_0x3658b8){_0x1dc539=_0x1dc539-0x0;var _0x1b7ffd=_0x1117[_0x1dc539];return _0x1b7ffd;};'use strict';var Sequelize=require(_0x7111('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7111('0x1')]},'type':{'type':Sequelize['ENUM'](_0x7111('0x2'),_0x7111('0x3'),_0x7111('0x4'),_0x7111('0x5'),_0x7111('0x6'),_0x7111('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7111('0x1')]},'source':{'type':Sequelize[_0x7111('0x1')]},'destination':{'type':Sequelize[_0x7111('0x1')]},'destinationcontext':{'type':Sequelize[_0x7111('0x1')]},'callerid':{'type':Sequelize[_0x7111('0x1')]},'channel':{'type':Sequelize[_0x7111('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x7111('0x1')]},'lastdata':{'type':Sequelize[_0x7111('0x8')]},'starttime':{'type':Sequelize[_0x7111('0x9')]},'systemanswertime':{'type':Sequelize[_0x7111('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x7111('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7111('0x1')]},'userfield':{'type':Sequelize[_0x7111('0x1')]},'userDisposition':{'type':Sequelize[_0x7111('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x7111('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x7111('0x1')]},'note':{'type':Sequelize[_0x7111('0x1')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x7111('0xa')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x228d=['dialer','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','outbound-fax'];(function(_0x1cd9a5,_0xb4e797){var _0x4c1e6a=function(_0x4bf629){while(--_0x4bf629){_0x1cd9a5['push'](_0x1cd9a5['shift']());}};_0x4c1e6a(++_0xb4e797);}(_0x228d,0x87));var _0xd228=function(_0xbb9b40,_0x51b63a){_0xbb9b40=_0xbb9b40-0x0;var _0x4cd1b3=_0x228d[_0xbb9b40];return _0x4cd1b3;};'use strict';var Sequelize=require(_0xd228('0x0'));module[_0xd228('0x1')]={'uniqueid':{'type':Sequelize[_0xd228('0x2')]},'type':{'type':Sequelize[_0xd228('0x3')](_0xd228('0x4'),_0xd228('0x5'),_0xd228('0x6'),'inbound-fax',_0xd228('0x7'),_0xd228('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd228('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xd228('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd228('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xd228('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xd228('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xd228('0xa')]},'billableseconds':{'type':Sequelize[_0xd228('0xa')]},'mohtime':{'type':Sequelize[_0xd228('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xd228('0x2')]},'userDisposition':{'type':Sequelize[_0xd228('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xd228('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xd228('0x2')]},'note':{'type':Sequelize[_0xd228('0x2')]},'prefix':{'type':Sequelize[_0xd228('0x2')]},'routeid':{'type':Sequelize[_0xd228('0xa')]},'sipcallid':{'type':Sequelize[_0xd228('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 354806d..0987dd1 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x263a2f,_0x1e81e3){var _0x8020e8=function(_0x39f91a){while(--_0x39f91a){_0x263a2f['push'](_0x263a2f['shift']());}};_0x8020e8(++_0x1e81e3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x50e36b,_0x3bd1b2){_0x50e36b=_0x50e36b-0x0;var _0x27d367=_0x5f2f[_0x50e36b];return _0x27d367;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0xd7427d,_0x582c82){_0xd7427d=_0xd7427d-0x0;var _0x55a4b9=_0x2032[_0xd7427d];return _0x55a4b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index a466830..77f1d87 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 _0x2526=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid'];(function(_0x395bba,_0x470d8a){var _0x5b5478=function(_0x216a5d){while(--_0x216a5d){_0x395bba['push'](_0x395bba['shift']());}};_0x5b5478(++_0x470d8a);}(_0x2526,0x1dc));var _0x6252=function(_0x204c96,_0x8dbef7){_0x204c96=_0x204c96-0x0;var _0x10e94e=_0x2526[_0x204c96];return _0x10e94e;};'use strict';var _=require('lodash');var util=require(_0x6252('0x0'));var logger=require(_0x6252('0x1'))(_0x6252('0x2'));var moment=require(_0x6252('0x3'));var BPromise=require(_0x6252('0x4'));var rp=require(_0x6252('0x5'));var fs=require('fs');var path=require(_0x6252('0x6'));var rimraf=require(_0x6252('0x7'));var config=require(_0x6252('0x8'));var attributes=require(_0x6252('0x9'));module[_0x6252('0xa')]=function(_0x206c23,_0x2de036){return _0x206c23[_0x6252('0xb')](_0x6252('0xc'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x6252('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5812=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','VoiceCallReport'];(function(_0x59fc33,_0x2e182d){var _0x39066f=function(_0x4d843d){while(--_0x4d843d){_0x59fc33['push'](_0x59fc33['shift']());}};_0x39066f(++_0x2e182d);}(_0x5812,0x1bd));var _0x2581=function(_0xd89835,_0x2913fa){_0xd89835=_0xd89835-0x0;var _0x10a6fb=_0x5812[_0xd89835];return _0x10a6fb;};'use strict';var _=require(_0x2581('0x0'));var util=require(_0x2581('0x1'));var logger=require(_0x2581('0x2'))(_0x2581('0x3'));var moment=require('moment');var BPromise=require(_0x2581('0x4'));var rp=require(_0x2581('0x5'));var fs=require('fs');var path=require(_0x2581('0x6'));var rimraf=require(_0x2581('0x7'));var config=require(_0x2581('0x8'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x388db1,_0x5576d5){return _0x388db1[_0x2581('0x9')](_0x2581('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x2581('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 2a773db..b716aa7 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 _0x7851=['error','message','info','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','include','map','model','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport','update','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x31acd2,_0x3c0a9f){var _0xc8118=function(_0x446952){while(--_0x446952){_0x31acd2['push'](_0x31acd2['shift']());}};_0xc8118(++_0x3c0a9f);}(_0x7851,0x194));var _0x1785=function(_0x4a1077,_0x2106b5){_0x4a1077=_0x4a1077-0x0;var _0x380332=_0x7851[_0x4a1077];return _0x380332;};'use strict';var _=require('lodash');var util=require(_0x1785('0x0'));var moment=require(_0x1785('0x1'));var BPromise=require(_0x1785('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1785('0x3'));var db=require(_0x1785('0x4'))['db'];var utils=require(_0x1785('0x5'));var logger=require('../../config/logger')(_0x1785('0x6'));var config=require('../../config/environment');var jayson=require(_0x1785('0x7'));var client=jayson['client'][_0x1785('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e9987,_0x1476e2,_0x4d9ed3){return new BPromise(function(_0x5f4e02,_0x459c89){return client[_0x1785('0x9')](_0x4e9987,_0x4d9ed3)[_0x1785('0xa')](function(_0x518e89){logger['info'](_0x1785('0xb'),_0x1476e2,_0x1785('0xc'));logger[_0x1785('0xd')](_0x1785('0xe'),_0x1476e2,'request\x20sent',JSON[_0x1785('0xf')](_0x518e89));if(_0x518e89[_0x1785('0x10')]){if(_0x518e89[_0x1785('0x10')]['code']===0x1f4){logger[_0x1785('0x10')](_0x1785('0xb'),_0x1476e2,_0x518e89['error'][_0x1785('0x11')]);return _0x459c89(_0x518e89[_0x1785('0x10')][_0x1785('0x11')]);}logger[_0x1785('0x10')](_0x1785('0xb'),_0x1476e2,_0x518e89[_0x1785('0x10')][_0x1785('0x11')]);return _0x5f4e02(_0x518e89[_0x1785('0x10')][_0x1785('0x11')]);}else{logger[_0x1785('0x12')](_0x1785('0xb'),_0x1476e2,_0x1785('0xc'));_0x5f4e02(_0x518e89['result'][_0x1785('0x11')]);}})[_0x1785('0x13')](function(_0x3015b5){logger[_0x1785('0x10')](_0x1785('0xb'),_0x1476e2,_0x3015b5);_0x459c89(_0x3015b5);});});}exports[_0x1785('0x14')]=function(_0x2462a5){var _0x442be4=this;return new Promise(function(_0x4f0359,_0x1b700f){return db[_0x1785('0x15')][_0x1785('0x16')]({'raw':_0x2462a5[_0x1785('0x17')]?_0x2462a5[_0x1785('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2462a5[_0x1785('0x17')]?_0x2462a5[_0x1785('0x17')][_0x1785('0x18')]||null:null,'attributes':_0x2462a5[_0x1785('0x17')]?_0x2462a5[_0x1785('0x17')][_0x1785('0x19')]||null:null,'limit':_0x2462a5[_0x1785('0x17')]?_0x2462a5['options']['limit']||null:null,'include':_0x2462a5[_0x1785('0x17')]?_0x2462a5[_0x1785('0x17')][_0x1785('0x1a')]?_[_0x1785('0x1b')](_0x2462a5[_0x1785('0x17')][_0x1785('0x1a')],function(_0x4327d0){return{'model':db[_0x4327d0[_0x1785('0x1c')]],'as':_0x4327d0['as'],'attributes':_0x4327d0['attributes'],'include':_0x4327d0[_0x1785('0x1a')]?_[_0x1785('0x1b')](_0x4327d0['include'],function(_0x4f525f){return{'model':db[_0x4f525f['model']],'as':_0x4f525f['as'],'attributes':_0x4f525f[_0x1785('0x19')],'include':_0x4f525f[_0x1785('0x1a')]?_['map'](_0x4f525f[_0x1785('0x1a')],function(_0x56cd54){return{'model':db[_0x56cd54[_0x1785('0x1c')]],'as':_0x56cd54['as'],'attributes':_0x56cd54['attributes']};}):[]};}):[]};}):[]:[]})[_0x1785('0xa')](function(_0x22b6cf){logger[_0x1785('0x12')](_0x1785('0x14'),_0x2462a5);logger['debug']('GetVoiceCallReport',_0x2462a5,JSON[_0x1785('0xf')](_0x22b6cf));_0x4f0359(_0x22b6cf);})['catch'](function(_0x5d1646){logger['error'](_0x1785('0x14'),_0x5d1646[_0x1785('0x11')],_0x2462a5);_0x1b700f(_0x442be4[_0x1785('0x10')](0x1f4,_0x5d1646[_0x1785('0x11')]));});});};exports[_0x1785('0x1d')]=function(_0x121bb6){var _0x2dc499=this;return new Promise(function(_0x1df713,_0x59751e){return db[_0x1785('0x15')][_0x1785('0x1e')](_0x121bb6[_0x1785('0x1f')],{'raw':_0x121bb6['options']?_0x121bb6['options'][_0x1785('0x20')]===undefined?!![]:![]:!![]})[_0x1785('0xa')](function(_0x1f07fd){logger[_0x1785('0x12')](_0x1785('0x1d'),_0x121bb6);logger['debug'](_0x1785('0x1d'),_0x121bb6,JSON[_0x1785('0xf')](_0x1f07fd));_0x1df713(_0x1f07fd);})[_0x1785('0x13')](function(_0x132470){logger[_0x1785('0x10')](_0x1785('0x1d'),_0x132470[_0x1785('0x11')],_0x121bb6);_0x59751e(_0x2dc499[_0x1785('0x10')](0x1f4,_0x132470[_0x1785('0x11')]));});});};exports[_0x1785('0x21')]=function(_0x42627b){var _0x179042=this;return new Promise(function(_0x3f5427,_0x15e95e){return db[_0x1785('0x15')][_0x1785('0x22')](_0x42627b[_0x1785('0x1f')],{'raw':_0x42627b['options']?_0x42627b[_0x1785('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42627b[_0x1785('0x17')]?_0x42627b['options'][_0x1785('0x18')]||null:null,'attributes':_0x42627b[_0x1785('0x17')]?_0x42627b[_0x1785('0x17')][_0x1785('0x19')]||null:null,'limit':_0x42627b[_0x1785('0x17')]?_0x42627b[_0x1785('0x17')]['limit']||null:null})[_0x1785('0xa')](function(_0x423adb){logger[_0x1785('0x12')](_0x1785('0x21'),_0x42627b);logger[_0x1785('0xd')]('UpdateVoiceCallReport',_0x42627b,JSON[_0x1785('0xf')](_0x423adb));_0x3f5427(_0x423adb);})[_0x1785('0x13')](function(_0x496d53){logger[_0x1785('0x10')]('UpdateVoiceCallReport',_0x496d53[_0x1785('0x11')],_0x42627b);_0x15e95e(_0x179042[_0x1785('0x10')](0x1f4,_0x496d53[_0x1785('0x11')]));});});}; \ No newline at end of file +var _0x8031=['catch','VoiceCallReport','findAll','options','where','attributes','limit','include','model','map','GetVoiceCallReport','CreateVoiceCallReport','create','body','raw','update','UpdateVoiceCallReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1d13a8,_0x2582a1){var _0x2ed0a0=function(_0x4571d9){while(--_0x4571d9){_0x1d13a8['push'](_0x1d13a8['shift']());}};_0x2ed0a0(++_0x2582a1);}(_0x8031,0xd4));var _0x1803=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x8031[_0x2db12b];return _0x20990b;};'use strict';var _=require('lodash');var util=require(_0x1803('0x0'));var moment=require(_0x1803('0x1'));var BPromise=require('bluebird');var rs=require(_0x1803('0x2'));var fs=require('fs');var Redis=require(_0x1803('0x3'));var db=require(_0x1803('0x4'))['db'];var utils=require(_0x1803('0x5'));var logger=require(_0x1803('0x6'))('rpc');var config=require(_0x1803('0x7'));var jayson=require(_0x1803('0x8'));var client=jayson[_0x1803('0x9')][_0x1803('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f98b9,_0x2e0c84,_0x2e8bdc){return new BPromise(function(_0x524999,_0x403245){return client[_0x1803('0xb')](_0x3f98b9,_0x2e8bdc)[_0x1803('0xc')](function(_0x365623){logger[_0x1803('0xd')](_0x1803('0xe'),_0x2e0c84,'request\x20sent');logger[_0x1803('0xf')](_0x1803('0x10'),_0x2e0c84,'request\x20sent',JSON[_0x1803('0x11')](_0x365623));if(_0x365623[_0x1803('0x12')]){if(_0x365623[_0x1803('0x12')][_0x1803('0x13')]===0x1f4){logger[_0x1803('0x12')](_0x1803('0xe'),_0x2e0c84,_0x365623[_0x1803('0x12')][_0x1803('0x14')]);return _0x403245(_0x365623[_0x1803('0x12')]['message']);}logger[_0x1803('0x12')](_0x1803('0xe'),_0x2e0c84,_0x365623[_0x1803('0x12')][_0x1803('0x14')]);return _0x524999(_0x365623[_0x1803('0x12')][_0x1803('0x14')]);}else{logger[_0x1803('0xd')](_0x1803('0xe'),_0x2e0c84,'request\x20sent');_0x524999(_0x365623[_0x1803('0x15')][_0x1803('0x14')]);}})[_0x1803('0x16')](function(_0x13da59){logger[_0x1803('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x2e0c84,_0x13da59);_0x403245(_0x13da59);});});}exports['GetVoiceCallReport']=function(_0x2444f8){var _0x4b8cbc=this;return new Promise(function(_0x443ad0,_0x5bf846){return db[_0x1803('0x17')][_0x1803('0x18')]({'raw':_0x2444f8['options']?_0x2444f8['options']['raw']===undefined?!![]:![]:!![],'where':_0x2444f8['options']?_0x2444f8[_0x1803('0x19')][_0x1803('0x1a')]||null:null,'attributes':_0x2444f8[_0x1803('0x19')]?_0x2444f8[_0x1803('0x19')][_0x1803('0x1b')]||null:null,'limit':_0x2444f8[_0x1803('0x19')]?_0x2444f8[_0x1803('0x19')][_0x1803('0x1c')]||null:null,'include':_0x2444f8[_0x1803('0x19')]?_0x2444f8[_0x1803('0x19')][_0x1803('0x1d')]?_['map'](_0x2444f8['options']['include'],function(_0x5a5c77){return{'model':db[_0x5a5c77['model']],'as':_0x5a5c77['as'],'attributes':_0x5a5c77[_0x1803('0x1b')],'include':_0x5a5c77['include']?_['map'](_0x5a5c77[_0x1803('0x1d')],function(_0xd21ab){return{'model':db[_0xd21ab[_0x1803('0x1e')]],'as':_0xd21ab['as'],'attributes':_0xd21ab['attributes'],'include':_0xd21ab['include']?_[_0x1803('0x1f')](_0xd21ab[_0x1803('0x1d')],function(_0x1829aa){return{'model':db[_0x1829aa['model']],'as':_0x1829aa['as'],'attributes':_0x1829aa[_0x1803('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1803('0xc')](function(_0x10ec7c){logger[_0x1803('0xd')](_0x1803('0x20'),_0x2444f8);logger[_0x1803('0xf')]('GetVoiceCallReport',_0x2444f8,JSON['stringify'](_0x10ec7c));_0x443ad0(_0x10ec7c);})[_0x1803('0x16')](function(_0x472a4d){logger[_0x1803('0x12')](_0x1803('0x20'),_0x472a4d[_0x1803('0x14')],_0x2444f8);_0x5bf846(_0x4b8cbc[_0x1803('0x12')](0x1f4,_0x472a4d[_0x1803('0x14')]));});});};exports[_0x1803('0x21')]=function(_0x3e101d){var _0x3c4bda=this;return new Promise(function(_0x3ec494,_0x1eb456){return db[_0x1803('0x17')][_0x1803('0x22')](_0x3e101d[_0x1803('0x23')],{'raw':_0x3e101d[_0x1803('0x19')]?_0x3e101d[_0x1803('0x19')][_0x1803('0x24')]===undefined?!![]:![]:!![]})[_0x1803('0xc')](function(_0x134ba9){logger['info']('CreateVoiceCallReport',_0x3e101d);logger[_0x1803('0xf')](_0x1803('0x21'),_0x3e101d,JSON[_0x1803('0x11')](_0x134ba9));_0x3ec494(_0x134ba9);})[_0x1803('0x16')](function(_0x458b9c){logger[_0x1803('0x12')](_0x1803('0x21'),_0x458b9c[_0x1803('0x14')],_0x3e101d);_0x1eb456(_0x3c4bda[_0x1803('0x12')](0x1f4,_0x458b9c['message']));});});};exports['UpdateVoiceCallReport']=function(_0x41401c){var _0x38bede=this;return new Promise(function(_0x447af6,_0xc96021){return db['VoiceCallReport'][_0x1803('0x25')](_0x41401c[_0x1803('0x23')],{'raw':_0x41401c[_0x1803('0x19')]?_0x41401c[_0x1803('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41401c[_0x1803('0x19')]?_0x41401c['options']['where']||null:null,'attributes':_0x41401c[_0x1803('0x19')]?_0x41401c['options'][_0x1803('0x1b')]||null:null,'limit':_0x41401c[_0x1803('0x19')]?_0x41401c[_0x1803('0x19')]['limit']||null:null})[_0x1803('0xc')](function(_0x29c640){logger[_0x1803('0xd')]('UpdateVoiceCallReport',_0x41401c);logger[_0x1803('0xf')]('UpdateVoiceCallReport',_0x41401c,JSON[_0x1803('0x11')](_0x29c640));_0x447af6(_0x29c640);})[_0x1803('0x16')](function(_0x42f545){logger[_0x1803('0x12')](_0x1803('0x26'),_0x42f545[_0x1803('0x14')],_0x41401c);_0xc96021(_0x38bede['error'](0x1f4,_0x42f545[_0x1803('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 891d903..6f01dab 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 _0x1f10=['express','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','create','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x1f10,0x177));var _0x01f1=function(_0xb7f08,_0x523aa0){_0xb7f08=_0xb7f08-0x0;var _0x3474f5=_0x1f10[_0xb7f08];return _0x3474f5;};'use strict';var multer=require('multer');var util=require(_0x01f1('0x0'));var path=require(_0x01f1('0x1'));var timeout=require(_0x01f1('0x2'));var express=require(_0x01f1('0x3'));var router=express['Router']();var fs_extra=require(_0x01f1('0x4'));var auth=require(_0x01f1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x01f1('0x6'));var controller=require(_0x01f1('0x7'));router[_0x01f1('0x8')]('/',auth['isAuthenticated'](),controller[_0x01f1('0x9')]);router[_0x01f1('0x8')](_0x01f1('0xa'),auth[_0x01f1('0xb')](),controller[_0x01f1('0xc')]);router['post']('/',auth[_0x01f1('0xb')](),controller[_0x01f1('0xd')]);router[_0x01f1('0xe')]('/:id',auth[_0x01f1('0xb')](),controller['update']);router[_0x01f1('0xf')](_0x01f1('0xa'),auth[_0x01f1('0xb')](),controller[_0x01f1('0x10')]);module[_0x01f1('0x11')]=router; \ No newline at end of file +var _0x03e2=['show','put','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x03e2,0x16c));var _0x203e=function(_0x3a06e7,_0x382459){_0x3a06e7=_0x3a06e7-0x0;var _0x54c85a=_0x03e2[_0x3a06e7];return _0x54c85a;};'use strict';var multer=require('multer');var util=require(_0x203e('0x0'));var path=require(_0x203e('0x1'));var timeout=require(_0x203e('0x2'));var express=require(_0x203e('0x3'));var router=express['Router']();var fs_extra=require(_0x203e('0x4'));var auth=require(_0x203e('0x5'));var interaction=require(_0x203e('0x6'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0x203e('0x7')]('/',auth['isAuthenticated'](),controller[_0x203e('0x8')]);router[_0x203e('0x7')](_0x203e('0x9'),auth[_0x203e('0xa')](),controller[_0x203e('0xb')]);router['post']('/',auth[_0x203e('0xa')](),controller['create']);router[_0x203e('0xc')](_0x203e('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x203e('0xd')](_0x203e('0x9'),auth[_0x203e('0xa')](),controller[_0x203e('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 2fcfd60..e24bcbc 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 _0x6321=['setDataValue','getDataValue','options','sequelize','exports','STRING'];(function(_0x131fa2,_0x2e48d2){var _0x28a429=function(_0x30439c){while(--_0x30439c){_0x131fa2['push'](_0x131fa2['shift']());}};_0x28a429(++_0x2e48d2);}(_0x6321,0x195));var _0x1632=function(_0x2a4d91,_0x3aa979){_0x2a4d91=_0x2a4d91-0x0;var _0x464758=_0x6321[_0x2a4d91];return _0x464758;};'use strict';var Sequelize=require(_0x1632('0x0'));module[_0x1632('0x1')]={'name':{'type':Sequelize[_0x1632('0x2')]},'prefix':{'type':Sequelize[_0x1632('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x1632('0x2')],'set':function(_0xe7e0a6){this[_0x1632('0x3')]('options',_0xe7e0a6?_0xe7e0a6['join'](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0x1632('0x4')](_0x1632('0x5'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xff7a=['BOOLEAN','exports','STRING','name','setDataValue','options','join','getDataValue'];(function(_0x9b2bb0,_0x3965b1){var _0x2cdb3b=function(_0x177d75){while(--_0x177d75){_0x9b2bb0['push'](_0x9b2bb0['shift']());}};_0x2cdb3b(++_0x3965b1);}(_0xff7a,0x151));var _0xaff7=function(_0x300de2,_0x587750){_0x300de2=_0x300de2-0x0;var _0x3370f1=_0xff7a[_0x300de2];return _0x3370f1;};'use strict';var Sequelize=require('sequelize');module[_0xaff7('0x0')]={'name':{'type':Sequelize[_0xaff7('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xaff7('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xaff7('0x1')],'set':function(_0x3ee844){this[_0xaff7('0x3')](_0xaff7('0x4'),_0x3ee844?_0x3ee844[_0xaff7('0x5')](''):[]);},'get':function(){return this[_0xaff7('0x6')](_0xaff7('0x4'))?this[_0xaff7('0x6')](_0xaff7('0x4'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xaff7('0x1')]},'record':{'type':Sequelize[_0xaff7('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xaff7('0x1')]},'description':{'type':Sequelize[_0xaff7('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 5bae031..72bb00b 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 _0xb790=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','then','destroy','get','ChanSpies','UserProfileResource','end','error','name','send','map','VoiceChanSpy','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','moment','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb790,0xe5));var _0x0b79=function(_0xfb65aa,_0x1651a6){_0xfb65aa=_0xfb65aa-0x0;var _0x2aee31=_0xb790[_0xfb65aa];return _0x2aee31;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b79('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0b79('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0b79('0x2'));var path=require(_0x0b79('0x3'));var sox=require('sox');var csv=require(_0x0b79('0x4'));var ejs=require(_0x0b79('0x5'));var fs=require('fs');var fs_extra=require(_0x0b79('0x6'));var _=require(_0x0b79('0x7'));var squel=require(_0x0b79('0x8'));var crypto=require(_0x0b79('0x9'));var jsforce=require(_0x0b79('0xa'));var deskjs=require(_0x0b79('0xb'));var toCsv=require(_0x0b79('0x4'));var querystring=require(_0x0b79('0xc'));var Papa=require(_0x0b79('0xd'));var Redis=require(_0x0b79('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0b79('0xf'));var hardwareService=require(_0x0b79('0x10'));var logger=require(_0x0b79('0x11'))(_0x0b79('0x12'));var utils=require(_0x0b79('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0b79('0x14'));var db=require(_0x0b79('0x15'))['db'];function respondWithStatusCode(_0x545d4e,_0x44c94c){_0x44c94c=_0x44c94c||0xcc;return function(_0x1c0a61){if(_0x1c0a61){return _0x545d4e[_0x0b79('0x16')](_0x44c94c);}return _0x545d4e[_0x0b79('0x17')](_0x44c94c)['end']();};}function respondWithResult(_0x1a6251,_0x4681e4){_0x4681e4=_0x4681e4||0xc8;return function(_0x162522){if(_0x162522){return _0x1a6251[_0x0b79('0x17')](_0x4681e4)['json'](_0x162522);}};}function respondWithFilteredResult(_0x464c1a,_0x44f4f7){return function(_0x5bf09b){if(_0x5bf09b){var _0x1820fa=typeof _0x44f4f7[_0x0b79('0x18')]===_0x0b79('0x19')&&typeof _0x44f4f7[_0x0b79('0x1a')]===_0x0b79('0x19');var _0x37177d=_0x5bf09b[_0x0b79('0x1b')];var _0x316ebb=_0x1820fa?0x0:_0x44f4f7['offset'];var _0x49909d=_0x1820fa?_0x5bf09b['count']:_0x44f4f7[_0x0b79('0x18')]+_0x44f4f7[_0x0b79('0x1a')];var _0x23a663;if(_0x49909d>=_0x37177d){_0x49909d=_0x37177d;_0x23a663=0xc8;}else{_0x23a663=0xce;}_0x464c1a['status'](_0x23a663);return _0x464c1a[_0x0b79('0x1c')]('Content-Range',_0x316ebb+'-'+_0x49909d+'/'+_0x37177d)[_0x0b79('0x1d')](_0x5bf09b);}return null;};}function patchUpdates(_0x41d9da){return function(_0x8482ad){try{jsonpatch['apply'](_0x8482ad,_0x41d9da,!![]);}catch(_0x4483db){return BPromise[_0x0b79('0x1e')](_0x4483db);}return _0x8482ad[_0x0b79('0x1f')]();};}function saveUpdates(_0x50084c,_0xa836a8){return function(_0x58901a){if(_0x58901a){return _0x58901a['update'](_0x50084c)[_0x0b79('0x20')](function(_0x59cd0d){return _0x59cd0d;});}return null;};}function removeEntity(_0x80fbe9,_0x235a7f){return function(_0x3a04d3){if(_0x3a04d3){return _0x3a04d3[_0x0b79('0x21')]()['then'](function(){var _0x29166f=_0x3a04d3[_0x0b79('0x22')]({'plain':!![]});var _0x409db2=_0x0b79('0x23');return db[_0x0b79('0x24')][_0x0b79('0x21')]({'where':{'type':_0x409db2,'resourceId':_0x29166f['id']}})[_0x0b79('0x20')](function(){return _0x3a04d3;});})[_0x0b79('0x20')](function(){_0x80fbe9[_0x0b79('0x17')](0xcc)[_0x0b79('0x25')]();});}};}function handleEntityNotFound(_0x376bf3,_0x2961ff){return function(_0x1cf7f7){if(!_0x1cf7f7){_0x376bf3['sendStatus'](0x194);}return _0x1cf7f7;};}function handleError(_0x5c9a6e,_0x18c9d1){_0x18c9d1=_0x18c9d1||0x1f4;return function(_0x43291a){logger[_0x0b79('0x26')](_0x43291a['stack']);if(_0x43291a['name']){delete _0x43291a[_0x0b79('0x27')];}_0x5c9a6e['status'](_0x18c9d1)[_0x0b79('0x28')](_0x43291a);};}exports['index']=function(_0x1b72ec,_0x63c8f2){var _0x19971a={},_0x574513={},_0x45d438={'count':0x0,'rows':[]};var _0x4d74cc=_[_0x0b79('0x29')](db[_0x0b79('0x2a')][_0x0b79('0x2b')],function(_0x59f34f){return{'name':_0x59f34f['fieldName'],'type':_0x59f34f[_0x0b79('0x2c')][_0x0b79('0x2d')]};});_0x574513[_0x0b79('0x2e')]=_[_0x0b79('0x29')](_0x4d74cc,_0x0b79('0x27'));_0x574513[_0x0b79('0x2f')]=_[_0x0b79('0x30')](_0x1b72ec[_0x0b79('0x2f')]);_0x574513[_0x0b79('0x31')]=_[_0x0b79('0x32')](_0x574513[_0x0b79('0x2e')],_0x574513[_0x0b79('0x2f')]);_0x19971a[_0x0b79('0x33')]=_[_0x0b79('0x32')](_0x574513[_0x0b79('0x2e')],qs[_0x0b79('0x34')](_0x1b72ec['query']['fields']));_0x19971a[_0x0b79('0x33')]=_0x19971a[_0x0b79('0x33')][_0x0b79('0x35')]?_0x19971a[_0x0b79('0x33')]:_0x574513[_0x0b79('0x2e')];if(!_0x1b72ec[_0x0b79('0x2f')][_0x0b79('0x36')](_0x0b79('0x37'))){_0x19971a[_0x0b79('0x1a')]=qs['limit'](_0x1b72ec[_0x0b79('0x2f')][_0x0b79('0x1a')]);_0x19971a['offset']=qs[_0x0b79('0x18')](_0x1b72ec[_0x0b79('0x2f')][_0x0b79('0x18')]);}_0x19971a[_0x0b79('0x38')]=qs[_0x0b79('0x39')](_0x1b72ec[_0x0b79('0x2f')]['sort']);_0x19971a[_0x0b79('0x3a')]=qs[_0x0b79('0x31')](_[_0x0b79('0x3b')](_0x1b72ec[_0x0b79('0x2f')],_0x574513[_0x0b79('0x31')]),_0x4d74cc);if(_0x1b72ec['query'][_0x0b79('0x3c')]){_0x19971a['where']=_[_0x0b79('0x3d')](_0x19971a[_0x0b79('0x3a')],{'$or':_[_0x0b79('0x29')](_0x4d74cc,function(_0x59e0a6){if(_0x59e0a6['type']!=='VIRTUAL'){var _0x34db3e={};_0x34db3e[_0x59e0a6['name']]={'$like':'%'+_0x1b72ec[_0x0b79('0x2f')][_0x0b79('0x3c')]+'%'};return _0x34db3e;}})});}_0x19971a=_[_0x0b79('0x3d')]({},_0x19971a,_0x1b72ec[_0x0b79('0x3e')]);var _0x33509e={'where':_0x19971a[_0x0b79('0x3a')]};return db[_0x0b79('0x2a')]['count'](_0x33509e)[_0x0b79('0x20')](function(_0x38a258){_0x45d438[_0x0b79('0x1b')]=_0x38a258;if(_0x1b72ec[_0x0b79('0x2f')][_0x0b79('0x3f')]){_0x19971a['include']=[{'all':!![]}];}return db[_0x0b79('0x2a')][_0x0b79('0x40')](_0x19971a);})['then'](function(_0x1a8e38){_0x45d438[_0x0b79('0x41')]=_0x1a8e38;return _0x45d438;})['then'](respondWithFilteredResult(_0x63c8f2,_0x19971a))['catch'](handleError(_0x63c8f2,null));};exports[_0x0b79('0x42')]=function(_0x47c4ae,_0x3e94e7){var _0x280155={'raw':![],'where':{'id':_0x47c4ae[_0x0b79('0x43')]['id']}},_0x4b2e69={};_0x4b2e69[_0x0b79('0x2e')]=_[_0x0b79('0x30')](db['VoiceChanSpy'][_0x0b79('0x2b')]);_0x4b2e69[_0x0b79('0x2f')]=_[_0x0b79('0x30')](_0x47c4ae[_0x0b79('0x2f')]);_0x4b2e69[_0x0b79('0x31')]=_[_0x0b79('0x32')](_0x4b2e69[_0x0b79('0x2e')],_0x4b2e69[_0x0b79('0x2f')]);_0x280155[_0x0b79('0x33')]=_[_0x0b79('0x32')](_0x4b2e69[_0x0b79('0x2e')],qs['fields'](_0x47c4ae['query'][_0x0b79('0x34')]));_0x280155[_0x0b79('0x33')]=_0x280155[_0x0b79('0x33')][_0x0b79('0x35')]?_0x280155[_0x0b79('0x33')]:_0x4b2e69['model'];if(_0x47c4ae[_0x0b79('0x2f')]['includeAll']){_0x280155[_0x0b79('0x44')]=[{'all':!![]}];}_0x280155=_[_0x0b79('0x3d')]({},_0x280155,_0x47c4ae[_0x0b79('0x3e')]);return db[_0x0b79('0x2a')][_0x0b79('0x45')](_0x280155)[_0x0b79('0x20')](handleEntityNotFound(_0x3e94e7,null))[_0x0b79('0x20')](respondWithResult(_0x3e94e7,null))[_0x0b79('0x46')](handleError(_0x3e94e7,null));};exports[_0x0b79('0x47')]=function(_0x37b5df,_0x362aa4){return db[_0x0b79('0x2a')][_0x0b79('0x47')](_0x37b5df[_0x0b79('0x48')],{})[_0x0b79('0x20')](function(_0x2d585f){var _0x5153b2=_0x37b5df[_0x0b79('0x49')]['get']({'plain':!![]});if(!_0x5153b2)throw new Error(_0x0b79('0x4a'));if(_0x5153b2[_0x0b79('0x4b')]===_0x0b79('0x49')){var _0x5ab832=_0x2d585f[_0x0b79('0x22')]({'plain':!![]});var _0x1862c4=_0x0b79('0x23');return db[_0x0b79('0x4c')][_0x0b79('0x45')]({'where':{'name':_0x1862c4,'userProfileId':_0x5153b2[_0x0b79('0x4d')]},'raw':!![]})[_0x0b79('0x20')](function(_0xb46fd5){if(_0xb46fd5&&_0xb46fd5['autoAssociation']===0x0){return db[_0x0b79('0x24')][_0x0b79('0x47')]({'name':_0x5ab832[_0x0b79('0x27')],'resourceId':_0x5ab832['id'],'type':_0xb46fd5[_0x0b79('0x27')],'sectionId':_0xb46fd5['id']},{})[_0x0b79('0x20')](function(){return _0x2d585f;});}else{return _0x2d585f;}})[_0x0b79('0x46')](function(_0x2309be){logger[_0x0b79('0x26')](_0x0b79('0x4e'),_0x2309be);throw _0x2309be;});}return _0x2d585f;})['then'](respondWithResult(_0x362aa4,0xc9))[_0x0b79('0x46')](handleError(_0x362aa4,null));};exports['update']=function(_0x1616fa,_0xc5c195){if(_0x1616fa['body']['id']){delete _0x1616fa[_0x0b79('0x48')]['id'];}return db[_0x0b79('0x2a')][_0x0b79('0x45')]({'where':{'id':_0x1616fa[_0x0b79('0x43')]['id']}})[_0x0b79('0x20')](handleEntityNotFound(_0xc5c195,null))[_0x0b79('0x20')](saveUpdates(_0x1616fa['body'],null))['then'](respondWithResult(_0xc5c195,null))[_0x0b79('0x46')](handleError(_0xc5c195,null));};exports[_0x0b79('0x21')]=function(_0x264d6c,_0x27455c){return db[_0x0b79('0x2a')][_0x0b79('0x45')]({'where':{'id':_0x264d6c[_0x0b79('0x43')]['id']}})[_0x0b79('0x20')](handleEntityNotFound(_0x27455c,null))[_0x0b79('0x20')](removeEntity(_0x27455c,null))[_0x0b79('0x46')](handleError(_0x27455c,null));}; \ No newline at end of file +var _0x1da6=['sendStatus','error','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','length','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0x1da6,0x7c));var _0x61da=function(_0x7e3bb8,_0x27c048){_0x7e3bb8=_0x7e3bb8-0x0;var _0x44c887=_0x1da6[_0x7e3bb8];return _0x44c887;};'use strict';var emlformat=require(_0x61da('0x0'));var rimraf=require(_0x61da('0x1'));var zipdir=require(_0x61da('0x2'));var jsonpatch=require(_0x61da('0x3'));var rp=require(_0x61da('0x4'));var moment=require(_0x61da('0x5'));var BPromise=require(_0x61da('0x6'));var Mustache=require(_0x61da('0x7'));var util=require(_0x61da('0x8'));var path=require(_0x61da('0x9'));var sox=require(_0x61da('0xa'));var csv=require(_0x61da('0xb'));var ejs=require(_0x61da('0xc'));var fs=require('fs');var fs_extra=require(_0x61da('0xd'));var _=require(_0x61da('0xe'));var squel=require(_0x61da('0xf'));var crypto=require(_0x61da('0x10'));var jsforce=require(_0x61da('0x11'));var deskjs=require(_0x61da('0x12'));var toCsv=require(_0x61da('0xb'));var querystring=require('querystring');var Papa=require(_0x61da('0x13'));var Redis=require(_0x61da('0x14'));var authService=require(_0x61da('0x15'));var qs=require(_0x61da('0x16'));var as=require(_0x61da('0x17'));var hardwareService=require(_0x61da('0x18'));var logger=require(_0x61da('0x19'))(_0x61da('0x1a'));var utils=require(_0x61da('0x1b'));var config=require(_0x61da('0x1c'));var licenseUtil=require(_0x61da('0x1d'));var db=require(_0x61da('0x1e'))['db'];function respondWithStatusCode(_0x1eb368,_0x1036e4){_0x1036e4=_0x1036e4||0xcc;return function(_0x43ec70){if(_0x43ec70){return _0x1eb368['sendStatus'](_0x1036e4);}return _0x1eb368[_0x61da('0x1f')](_0x1036e4)[_0x61da('0x20')]();};}function respondWithResult(_0x191033,_0x472abc){_0x472abc=_0x472abc||0xc8;return function(_0x55eef1){if(_0x55eef1){return _0x191033[_0x61da('0x1f')](_0x472abc)['json'](_0x55eef1);}};}function respondWithFilteredResult(_0x21a5fc,_0x6d24b7){return function(_0x4a0aea){if(_0x4a0aea){var _0x53f3a4=typeof _0x6d24b7[_0x61da('0x21')]===_0x61da('0x22')&&typeof _0x6d24b7[_0x61da('0x23')]===_0x61da('0x22');var _0x2ac3aa=_0x4a0aea[_0x61da('0x24')];var _0x505b1c=_0x53f3a4?0x0:_0x6d24b7[_0x61da('0x21')];var _0x34a678=_0x53f3a4?_0x4a0aea[_0x61da('0x24')]:_0x6d24b7[_0x61da('0x21')]+_0x6d24b7['limit'];var _0x1a0e6e;if(_0x34a678>=_0x2ac3aa){_0x34a678=_0x2ac3aa;_0x1a0e6e=0xc8;}else{_0x1a0e6e=0xce;}_0x21a5fc[_0x61da('0x1f')](_0x1a0e6e);return _0x21a5fc[_0x61da('0x25')](_0x61da('0x26'),_0x505b1c+'-'+_0x34a678+'/'+_0x2ac3aa)['json'](_0x4a0aea);}return null;};}function patchUpdates(_0x22b8bc){return function(_0x5c0363){try{jsonpatch[_0x61da('0x27')](_0x5c0363,_0x22b8bc,!![]);}catch(_0x172066){return BPromise[_0x61da('0x28')](_0x172066);}return _0x5c0363[_0x61da('0x29')]();};}function saveUpdates(_0x1868af,_0x129bb0){return function(_0x30c6f8){if(_0x30c6f8){return _0x30c6f8[_0x61da('0x2a')](_0x1868af)[_0x61da('0x2b')](function(_0x325e28){return _0x325e28;});}return null;};}function removeEntity(_0x56f5d2,_0x2c9e83){return function(_0x35550a){if(_0x35550a){return _0x35550a[_0x61da('0x2c')]()[_0x61da('0x2b')](function(){var _0x254d81=_0x35550a[_0x61da('0x2d')]({'plain':!![]});var _0x4860d4=_0x61da('0x2e');return db[_0x61da('0x2f')][_0x61da('0x2c')]({'where':{'type':_0x4860d4,'resourceId':_0x254d81['id']}})[_0x61da('0x2b')](function(){return _0x35550a;});})[_0x61da('0x2b')](function(){_0x56f5d2[_0x61da('0x1f')](0xcc)[_0x61da('0x20')]();});}};}function handleEntityNotFound(_0x29b642,_0x4c1bf4){return function(_0x2746a6){if(!_0x2746a6){_0x29b642[_0x61da('0x30')](0x194);}return _0x2746a6;};}function handleError(_0x450a97,_0x13339f){_0x13339f=_0x13339f||0x1f4;return function(_0x52f486){logger[_0x61da('0x31')](_0x52f486['stack']);if(_0x52f486[_0x61da('0x32')]){delete _0x52f486[_0x61da('0x32')];}_0x450a97[_0x61da('0x1f')](_0x13339f)[_0x61da('0x33')](_0x52f486);};}exports[_0x61da('0x34')]=function(_0x3166be,_0xb97400){var _0x52d93d={},_0x46b77b={},_0x511ec7={'count':0x0,'rows':[]};var _0x5ba1ad=_[_0x61da('0x35')](db[_0x61da('0x36')][_0x61da('0x37')],function(_0x2338dd){return{'name':_0x2338dd[_0x61da('0x38')],'type':_0x2338dd['type'][_0x61da('0x39')]};});_0x46b77b[_0x61da('0x3a')]=_[_0x61da('0x35')](_0x5ba1ad,_0x61da('0x32'));_0x46b77b['query']=_[_0x61da('0x3b')](_0x3166be[_0x61da('0x3c')]);_0x46b77b['filters']=_[_0x61da('0x3d')](_0x46b77b['model'],_0x46b77b['query']);_0x52d93d['attributes']=_['intersection'](_0x46b77b['model'],qs[_0x61da('0x3e')](_0x3166be[_0x61da('0x3c')][_0x61da('0x3e')]));_0x52d93d[_0x61da('0x3f')]=_0x52d93d[_0x61da('0x3f')]['length']?_0x52d93d[_0x61da('0x3f')]:_0x46b77b[_0x61da('0x3a')];if(!_0x3166be[_0x61da('0x3c')]['hasOwnProperty'](_0x61da('0x40'))){_0x52d93d[_0x61da('0x23')]=qs[_0x61da('0x23')](_0x3166be['query'][_0x61da('0x23')]);_0x52d93d[_0x61da('0x21')]=qs[_0x61da('0x21')](_0x3166be[_0x61da('0x3c')][_0x61da('0x21')]);}_0x52d93d['order']=qs[_0x61da('0x41')](_0x3166be[_0x61da('0x3c')][_0x61da('0x41')]);_0x52d93d[_0x61da('0x42')]=qs[_0x61da('0x43')](_['pick'](_0x3166be['query'],_0x46b77b['filters']),_0x5ba1ad);if(_0x3166be[_0x61da('0x3c')][_0x61da('0x44')]){_0x52d93d[_0x61da('0x42')]=_[_0x61da('0x45')](_0x52d93d[_0x61da('0x42')],{'$or':_[_0x61da('0x35')](_0x5ba1ad,function(_0x349da8){if(_0x349da8['type']!==_0x61da('0x46')){var _0x669497={};_0x669497[_0x349da8['name']]={'$like':'%'+_0x3166be[_0x61da('0x3c')][_0x61da('0x44')]+'%'};return _0x669497;}})});}_0x52d93d=_[_0x61da('0x45')]({},_0x52d93d,_0x3166be['options']);var _0x397fc1={'where':_0x52d93d['where']};return db[_0x61da('0x36')][_0x61da('0x24')](_0x397fc1)[_0x61da('0x2b')](function(_0x40d4a2){_0x511ec7['count']=_0x40d4a2;if(_0x3166be[_0x61da('0x3c')][_0x61da('0x47')]){_0x52d93d[_0x61da('0x48')]=[{'all':!![]}];}return db[_0x61da('0x36')][_0x61da('0x49')](_0x52d93d);})[_0x61da('0x2b')](function(_0x1dd879){_0x511ec7[_0x61da('0x4a')]=_0x1dd879;return _0x511ec7;})[_0x61da('0x2b')](respondWithFilteredResult(_0xb97400,_0x52d93d))[_0x61da('0x4b')](handleError(_0xb97400,null));};exports['show']=function(_0x3032eb,_0x3799a8){var _0x5af6fb={'raw':![],'where':{'id':_0x3032eb[_0x61da('0x4c')]['id']}},_0x46e899={};_0x46e899[_0x61da('0x3a')]=_[_0x61da('0x3b')](db[_0x61da('0x36')]['rawAttributes']);_0x46e899['query']=_[_0x61da('0x3b')](_0x3032eb[_0x61da('0x3c')]);_0x46e899[_0x61da('0x43')]=_[_0x61da('0x3d')](_0x46e899[_0x61da('0x3a')],_0x46e899['query']);_0x5af6fb[_0x61da('0x3f')]=_[_0x61da('0x3d')](_0x46e899[_0x61da('0x3a')],qs[_0x61da('0x3e')](_0x3032eb[_0x61da('0x3c')][_0x61da('0x3e')]));_0x5af6fb[_0x61da('0x3f')]=_0x5af6fb[_0x61da('0x3f')][_0x61da('0x4d')]?_0x5af6fb['attributes']:_0x46e899[_0x61da('0x3a')];if(_0x3032eb[_0x61da('0x3c')][_0x61da('0x47')]){_0x5af6fb[_0x61da('0x48')]=[{'all':!![]}];}_0x5af6fb=_['merge']({},_0x5af6fb,_0x3032eb[_0x61da('0x4e')]);return db[_0x61da('0x36')][_0x61da('0x4f')](_0x5af6fb)[_0x61da('0x2b')](handleEntityNotFound(_0x3799a8,null))[_0x61da('0x2b')](respondWithResult(_0x3799a8,null))['catch'](handleError(_0x3799a8,null));};exports[_0x61da('0x50')]=function(_0x5b3dee,_0x584ddd){return db[_0x61da('0x36')][_0x61da('0x50')](_0x5b3dee['body'],{})[_0x61da('0x2b')](function(_0x1c2ed5){var _0x30f4a3=_0x5b3dee['user'][_0x61da('0x2d')]({'plain':!![]});if(!_0x30f4a3)throw new Error(_0x61da('0x51'));if(_0x30f4a3[_0x61da('0x52')]===_0x61da('0x53')){var _0x4dd6fb=_0x1c2ed5[_0x61da('0x2d')]({'plain':!![]});var _0x537ded=_0x61da('0x2e');return db['UserProfileSection'][_0x61da('0x4f')]({'where':{'name':_0x537ded,'userProfileId':_0x30f4a3[_0x61da('0x54')]},'raw':!![]})[_0x61da('0x2b')](function(_0x14313e){if(_0x14313e&&_0x14313e['autoAssociation']===0x0){return db[_0x61da('0x2f')][_0x61da('0x50')]({'name':_0x4dd6fb[_0x61da('0x32')],'resourceId':_0x4dd6fb['id'],'type':_0x14313e[_0x61da('0x32')],'sectionId':_0x14313e['id']},{})[_0x61da('0x2b')](function(){return _0x1c2ed5;});}else{return _0x1c2ed5;}})[_0x61da('0x4b')](function(_0x184038){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x184038);throw _0x184038;});}return _0x1c2ed5;})['then'](respondWithResult(_0x584ddd,0xc9))[_0x61da('0x4b')](handleError(_0x584ddd,null));};exports[_0x61da('0x2a')]=function(_0x569b93,_0x531562){if(_0x569b93[_0x61da('0x55')]['id']){delete _0x569b93[_0x61da('0x55')]['id'];}return db[_0x61da('0x36')][_0x61da('0x4f')]({'where':{'id':_0x569b93[_0x61da('0x4c')]['id']}})[_0x61da('0x2b')](handleEntityNotFound(_0x531562,null))[_0x61da('0x2b')](saveUpdates(_0x569b93['body'],null))['then'](respondWithResult(_0x531562,null))[_0x61da('0x4b')](handleError(_0x531562,null));};exports[_0x61da('0x2c')]=function(_0x10e125,_0x3a5361){return db[_0x61da('0x36')][_0x61da('0x4f')]({'where':{'id':_0x10e125[_0x61da('0x4c')]['id']}})[_0x61da('0x2b')](handleEntityNotFound(_0x3a5361,null))[_0x61da('0x2b')](removeEntity(_0x3a5361,null))[_0x61da('0x4b')](handleError(_0x3a5361,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index a3a2bf8..e4896f0 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 _0xa36e=['push','Set','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','merge','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','internal','concat','User','agent','then','exports','define','voice_chanspy','VoiceExtension','catch','destroy','bulkCreate','util','bluebird','from-sip','format','prefix','system'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xa36e,0x135));var _0xea36=function(_0x5cebe8,_0x51c31a){_0x5cebe8=_0x5cebe8-0x0;var _0x4214dc=_0xa36e[_0x5cebe8];return _0x4214dc;};'use strict';var _=require('lodash');var util=require(_0xea36('0x0'));var BPromise=require(_0xea36('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x494166,_0x1a1827,_0xcc0483){var _0x490b88=0x1;var _0x442088=[];var _0x1cca95={'context':_0x1a1827['context']||_0xea36('0x2'),'exten':util[_0xea36('0x3')]('%s%s',_0x494166[_0xea36('0x4')],_0xcc0483),'type':_0xea36('0x5'),'isApp':![],'ChanSpyId':_0x494166['id'],'UserId':_0x1a1827['id']};_0x442088[_0xea36('0x6')](_['merge']({'app':_0xea36('0x7'),'appdata':util[_0xea36('0x3')]('CDR(type)=%s',_0xea36('0x8')),'priority':_0x490b88++},_0x1cca95));if(_0x494166[_0xea36('0x9')]){_0x442088[_0xea36('0x6')](_['merge']({'app':_0xea36('0xa'),'appdata':util[_0xea36('0x3')](_0xea36('0xb'),_0x494166[_0xea36('0xc')]),'priority':_0x490b88++},_0x1cca95));}if(_0x494166[_0xea36('0xd')]){_0x442088[_0xea36('0x6')](_[_0xea36('0xe')]({'app':_0xea36('0xf'),'appdata':_0x494166['password'],'priority':_0x490b88++},_0x1cca95));}_0x442088['push'](_['merge']({'app':_0xea36('0x10'),'appdata':util[_0xea36('0x3')](_0xea36('0x11'),_0x1a1827[_0xea36('0x12')],_0x494166[_0xea36('0x13')]?_0x494166['options'][_0xea36('0x14')](''):''),'priority':_0x490b88++},_0x1cca95));if(_0x494166[_0xea36('0x9')]){_0x442088[_0xea36('0x6')](_[_0xea36('0xe')]({'app':_0xea36('0x15'),'priority':_0x490b88++},_0x1cca95));}return _0x442088;};var getChanSpyApplications=function(_0x5d807f,_0x2a0dc6){var _0xf81bac=[];for(var _0x19a993=0x0,_0x21e7b2=0x1;_0x19a993<_0x2a0dc6[_0xea36('0x16')];_0x19a993++,_0x21e7b2=0x1){_0xf81bac=_0xf81bac['concat'](getUserApplications(_0x5d807f,_0x2a0dc6[_0x19a993],_0x2a0dc6[_0x19a993][_0xea36('0x17')]));if(_0x2a0dc6[_0x19a993][_0xea36('0x17')]!=_0x2a0dc6[_0x19a993][_0xea36('0x12')]){_0xf81bac=_0xf81bac[_0xea36('0x18')](getUserApplications(_0x5d807f,_0x2a0dc6[_0x19a993],_0x2a0dc6[_0x19a993][_0xea36('0x12')]));}}return _0xf81bac;};var getChanSpyPromise=function(_0x216df0,_0x3ac728){return new BPromise(function(_0x3519c2,_0x231d18){return _0x216df0[_0xea36('0x19')]['findAll']({'attributes':['id',_0xea36('0x12'),_0xea36('0x17')],'where':{'role':_0xea36('0x1a'),'chanspy':!![]},'raw':!![]})[_0xea36('0x1b')](function(_0x2a4dac){if(_0x2a4dac){return _0x3519c2(getChanSpyApplications(_0x3ac728,_0x2a4dac));}return _0x3519c2([]);})['catch'](function(_0x4a2917){_0x231d18(_0x4a2917);});});};module[_0xea36('0x1c')]=function(_0x3cd586,_0x42eaf){var _0xa062ca=_0x3cd586['models'];return _0x3cd586[_0xea36('0x1d')]('VoiceChanSpy',attributes,{'tableName':_0xea36('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4fe9c5,_0x57df9b,_0x81d015){return getChanSpyPromise(_0xa062ca,_0x4fe9c5)[_0xea36('0x1b')](function(_0x107bb9){if(_0x107bb9&&_0x107bb9[_0xea36('0x16')]){return _0xa062ca[_0xea36('0x1f')]['bulkCreate'](_0x107bb9);}})['then'](function(){_0x81d015();})[_0xea36('0x20')](function(_0xfa3fcb){_0x81d015(_0xfa3fcb);});},'afterUpdate':function(_0x165ed9,_0x5d6cb2,_0x19a40e){return _0xa062ca[_0xea36('0x1f')][_0xea36('0x21')]({'where':{'ChanSpyId':_0x165ed9['id']}})['then'](function(){return getChanSpyPromise(_0xa062ca,_0x165ed9);})[_0xea36('0x1b')](function(_0x588906){if(_0x588906&&_0x588906[_0xea36('0x16')]){return _0xa062ca[_0xea36('0x1f')][_0xea36('0x22')](_0x588906);}})['then'](function(){_0x19a40e();})[_0xea36('0x20')](function(_0x35050e){_0x19a40e(_0x35050e);});},'afterDestroy':function(_0x3fc4db,_0x55f0e6,_0xfb0ae5){return _0xa062ca[_0xea36('0x1f')][_0xea36('0x21')]({'where':{'ChanSpyId':_0x3fc4db['id']}})[_0xea36('0x1b')](function(){_0xfb0ae5();})[_0xea36('0x20')](function(_0xe091b0){_0xfb0ae5(_0xe091b0);});}}});}; \ No newline at end of file +var _0x485a=['password','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','findAll','agent','then','catch','exports','define','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','Authenticate'];(function(_0x45bd52,_0x3fc2f0){var _0x32422f=function(_0x19d9dc){while(--_0x19d9dc){_0x45bd52['push'](_0x45bd52['shift']());}};_0x32422f(++_0x3fc2f0);}(_0x485a,0x125));var _0xa485=function(_0x3af68e,_0x384315){_0x3af68e=_0x3af68e-0x0;var _0x3e6d5b=_0x485a[_0x3af68e];return _0x3e6d5b;};'use strict';var _=require(_0xa485('0x0'));var util=require(_0xa485('0x1'));var BPromise=require(_0xa485('0x2'));var attributes=require(_0xa485('0x3'));var getUserApplications=function(_0x4e36e4,_0x4b0989,_0x31e81b){var _0x28ebfd=0x1;var _0x5c6149=[];var _0x3243df={'context':_0x4b0989[_0xa485('0x4')]||_0xa485('0x5'),'exten':util[_0xa485('0x6')](_0xa485('0x7'),_0x4e36e4[_0xa485('0x8')],_0x31e81b),'type':_0xa485('0x9'),'isApp':![],'ChanSpyId':_0x4e36e4['id'],'UserId':_0x4b0989['id']};_0x5c6149[_0xa485('0xa')](_[_0xa485('0xb')]({'app':_0xa485('0xc'),'appdata':util['format'](_0xa485('0xd'),_0xa485('0xe')),'priority':_0x28ebfd++},_0x3243df));if(_0x4e36e4[_0xa485('0xf')]){_0x5c6149['push'](_[_0xa485('0xb')]({'app':_0xa485('0x10'),'appdata':util[_0xa485('0x6')](_0xa485('0x11'),_0x4e36e4['recordingFormat']),'priority':_0x28ebfd++},_0x3243df));}if(_0x4e36e4['auth']){_0x5c6149[_0xa485('0xa')](_['merge']({'app':_0xa485('0x12'),'appdata':_0x4e36e4[_0xa485('0x13')],'priority':_0x28ebfd++},_0x3243df));}_0x5c6149[_0xa485('0xa')](_[_0xa485('0xb')]({'app':'ChanSpy','appdata':util['format'](_0xa485('0x14'),_0x4b0989[_0xa485('0x15')],_0x4e36e4[_0xa485('0x16')]?_0x4e36e4[_0xa485('0x16')][_0xa485('0x17')](''):''),'priority':_0x28ebfd++},_0x3243df));if(_0x4e36e4[_0xa485('0xf')]){_0x5c6149['push'](_['merge']({'app':_0xa485('0x18'),'priority':_0x28ebfd++},_0x3243df));}return _0x5c6149;};var getChanSpyApplications=function(_0x23d962,_0x4d1060){var _0x35ca5c=[];for(var _0x1d4467=0x0,_0x164b7e=0x1;_0x1d4467<_0x4d1060[_0xa485('0x19')];_0x1d4467++,_0x164b7e=0x1){_0x35ca5c=_0x35ca5c[_0xa485('0x1a')](getUserApplications(_0x23d962,_0x4d1060[_0x1d4467],_0x4d1060[_0x1d4467][_0xa485('0x1b')]));if(_0x4d1060[_0x1d4467][_0xa485('0x1b')]!=_0x4d1060[_0x1d4467][_0xa485('0x15')]){_0x35ca5c=_0x35ca5c['concat'](getUserApplications(_0x23d962,_0x4d1060[_0x1d4467],_0x4d1060[_0x1d4467][_0xa485('0x15')]));}}return _0x35ca5c;};var getChanSpyPromise=function(_0x591a10,_0x3d12bc){return new BPromise(function(_0x1c62d1,_0x4022b4){return _0x591a10['User'][_0xa485('0x1c')]({'attributes':['id',_0xa485('0x15'),_0xa485('0x1b')],'where':{'role':_0xa485('0x1d'),'chanspy':!![]},'raw':!![]})[_0xa485('0x1e')](function(_0x5ad207){if(_0x5ad207){return _0x1c62d1(getChanSpyApplications(_0x3d12bc,_0x5ad207));}return _0x1c62d1([]);})[_0xa485('0x1f')](function(_0x9ed613){_0x4022b4(_0x9ed613);});});};module[_0xa485('0x20')]=function(_0x16dba2,_0x58fc70){var _0xc9d9eb=_0x16dba2['models'];return _0x16dba2[_0xa485('0x21')](_0xa485('0x22'),attributes,{'tableName':_0xa485('0x23'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x46caee,_0x2d0e4e,_0x48776b){return getChanSpyPromise(_0xc9d9eb,_0x46caee)['then'](function(_0x2097a3){if(_0x2097a3&&_0x2097a3[_0xa485('0x19')]){return _0xc9d9eb[_0xa485('0x24')]['bulkCreate'](_0x2097a3);}})[_0xa485('0x1e')](function(){_0x48776b();})[_0xa485('0x1f')](function(_0x2201c7){_0x48776b(_0x2201c7);});},'afterUpdate':function(_0x4accb8,_0x51b18e,_0x32f50f){return _0xc9d9eb[_0xa485('0x24')][_0xa485('0x25')]({'where':{'ChanSpyId':_0x4accb8['id']}})['then'](function(){return getChanSpyPromise(_0xc9d9eb,_0x4accb8);})[_0xa485('0x1e')](function(_0x65eb01){if(_0x65eb01&&_0x65eb01[_0xa485('0x19')]){return _0xc9d9eb[_0xa485('0x24')][_0xa485('0x26')](_0x65eb01);}})[_0xa485('0x1e')](function(){_0x32f50f();})[_0xa485('0x1f')](function(_0x1abb9f){_0x32f50f(_0x1abb9f);});},'afterDestroy':function(_0x59ae8,_0x18dd83,_0xf1ccd3){return _0xc9d9eb['VoiceExtension'][_0xa485('0x25')]({'where':{'ChanSpyId':_0x59ae8['id']}})['then'](function(){_0xf1ccd3();})['catch'](function(_0x39045a){_0xf1ccd3(_0x39045a);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 821de32..b8eb25c 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 _0x668b=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4e57df,_0xf08bd8){var _0x45a376=function(_0x4a0644){while(--_0x4a0644){_0x4e57df['push'](_0x4e57df['shift']());}};_0x45a376(++_0xf08bd8);}(_0x668b,0x140));var _0xb668=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0x668b[_0x2cde0a];return _0x260610;};'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')]('VoiceChanSpy,\x20%s,\x20%s',_0x2778e9,_0x4ab137);_0x517fc5(_0x4ab137);});});} \ No newline at end of file +var _0x2dae=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird'];(function(_0x401a97,_0x2eef4f){var _0x2c86ae=function(_0x83031a){while(--_0x83031a){_0x401a97['push'](_0x401a97['shift']());}};_0x2c86ae(++_0x2eef4f);}(_0x2dae,0xc3));var _0xe2da=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0x2dae[_0x4b4d43];return _0x5706ba;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var moment=require(_0xe2da('0x1'));var BPromise=require(_0xe2da('0x2'));var rs=require(_0xe2da('0x3'));var fs=require('fs');var Redis=require(_0xe2da('0x4'));var db=require(_0xe2da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2da('0x6'))(_0xe2da('0x7'));var config=require(_0xe2da('0x8'));var jayson=require(_0xe2da('0x9'));var client=jayson['client'][_0xe2da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x89c70b,_0x34cc98,_0x2efbd8){return new BPromise(function(_0x238da3,_0x1c71ea){return client[_0xe2da('0xb')](_0x89c70b,_0x2efbd8)[_0xe2da('0xc')](function(_0x68aa40){logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));logger[_0xe2da('0xf')](_0xe2da('0x10'),_0x34cc98,_0xe2da('0xe'),JSON[_0xe2da('0x11')](_0x68aa40));if(_0x68aa40[_0xe2da('0x12')]){if(_0x68aa40[_0xe2da('0x12')]['code']===0x1f4){logger[_0xe2da('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x34cc98,_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);return _0x1c71ea(_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);}logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x68aa40[_0xe2da('0x12')]['message']);return _0x238da3(_0x68aa40[_0xe2da('0x12')]['message']);}else{logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));_0x238da3(_0x68aa40[_0xe2da('0x14')]['message']);}})[_0xe2da('0x15')](function(_0x2c0353){logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x2c0353);_0x1c71ea(_0x2c0353);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 0856b48..16ddb79 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 _0x149b=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','multer','util'];(function(_0x7d7443,_0x1585b9){var _0x1e33e2=function(_0x401bc5){while(--_0x401bc5){_0x7d7443['push'](_0x7d7443['shift']());}};_0x1e33e2(++_0x1585b9);}(_0x149b,0x1d9));var _0xb149=function(_0x29bee5,_0x44545f){_0x29bee5=_0x29bee5-0x0;var _0x4686d4=_0x149b[_0x29bee5];return _0x4686d4;};'use strict';var multer=require(_0xb149('0x0'));var util=require(_0xb149('0x1'));var path=require('path');var timeout=require(_0xb149('0x2'));var express=require(_0xb149('0x3'));var router=express[_0xb149('0x4')]();var fs_extra=require(_0xb149('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb149('0x6'));var config=require(_0xb149('0x7'));var controller=require(_0xb149('0x8'));router[_0xb149('0x9')]('/',auth[_0xb149('0xa')](),controller[_0xb149('0xb')]);router[_0xb149('0x9')](_0xb149('0xc'),auth[_0xb149('0xa')](),controller[_0xb149('0xd')]);router[_0xb149('0xe')]('/',auth['isAuthenticated'](),controller[_0xb149('0xf')]);router[_0xb149('0x10')](_0xb149('0xc'),auth[_0xb149('0xa')](),controller['update']);router[_0xb149('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb149('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8162=['put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x3e5bc8,_0x457d89){var _0xfd84bc=function(_0x1a766c){while(--_0x1a766c){_0x3e5bc8['push'](_0x3e5bc8['shift']());}};_0xfd84bc(++_0x457d89);}(_0x8162,0x11c));var _0x2816=function(_0x3753bb,_0x17629c){_0x3753bb=_0x3753bb-0x0;var _0x33765e=_0x8162[_0x3753bb];return _0x33765e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2816('0x0'));var timeout=require(_0x2816('0x1'));var express=require(_0x2816('0x2'));var router=express[_0x2816('0x3')]();var fs_extra=require(_0x2816('0x4'));var auth=require(_0x2816('0x5'));var interaction=require(_0x2816('0x6'));var config=require(_0x2816('0x7'));var controller=require(_0x2816('0x8'));router['get']('/',auth[_0x2816('0x9')](),controller[_0x2816('0xa')]);router[_0x2816('0xb')](_0x2816('0xc'),auth[_0x2816('0x9')](),controller[_0x2816('0xd')]);router[_0x2816('0xe')]('/',auth[_0x2816('0x9')](),controller[_0x2816('0xf')]);router[_0x2816('0x10')](_0x2816('0xc'),auth[_0x2816('0x9')](),controller[_0x2816('0x11')]);router['delete'](_0x2816('0xc'),auth['isAuthenticated'](),controller[_0x2816('0x12')]);module[_0x2816('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index e090529..744f732 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 _0x41a5=['exports','STRING','name','BOOLEAN'];(function(_0x2dfffc,_0x3411af){var _0xf9d20d=function(_0x137b78){while(--_0x137b78){_0x2dfffc['push'](_0x2dfffc['shift']());}};_0xf9d20d(++_0x3411af);}(_0x41a5,0x1c4));var _0x541a=function(_0x1f9744,_0x54a947){_0x1f9744=_0x1f9744-0x0;var _0x5aba67=_0x41a5[_0x1f9744];return _0x5aba67;};'use strict';var Sequelize=require('sequelize');module[_0x541a('0x0')]={'name':{'type':Sequelize[_0x541a('0x1')],'unique':_0x541a('0x2')},'description':{'type':Sequelize[_0x541a('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x541a('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb8a0=['STRING','BOOLEAN','sequelize','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb8a0,0x6e));var _0x0b8a=function(_0x26c895,_0x4732f1){_0x26c895=_0x26c895-0x0;var _0x45fbea=_0xb8a0[_0x26c895];return _0x45fbea;};'use strict';var Sequelize=require(_0x0b8a('0x0'));module[_0x0b8a('0x1')]={'name':{'type':Sequelize[_0x0b8a('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x0b8a('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x0b8a('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 3377cc7..9b60615 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 _0xe552=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','Contexts','UserProfileResource','end','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','root','/etc/asterisk/extensions_xcally_contexts.conf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe552,0x12e));var _0x2e55=function(_0x5bedfd,_0x422984){_0x5bedfd=_0x5bedfd-0x0;var _0x1a6a95=_0xe552[_0x5bedfd];return _0x1a6a95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e55('0x0'));var zipdir=require(_0x2e55('0x1'));var jsonpatch=require(_0x2e55('0x2'));var rp=require('request-promise');var moment=require(_0x2e55('0x3'));var BPromise=require(_0x2e55('0x4'));var Mustache=require(_0x2e55('0x5'));var util=require(_0x2e55('0x6'));var path=require(_0x2e55('0x7'));var sox=require(_0x2e55('0x8'));var csv=require(_0x2e55('0x9'));var ejs=require(_0x2e55('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e55('0xb'));var squel=require(_0x2e55('0xc'));var crypto=require(_0x2e55('0xd'));var jsforce=require(_0x2e55('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2e55('0x9'));var querystring=require(_0x2e55('0xf'));var Papa=require(_0x2e55('0x10'));var Redis=require(_0x2e55('0x11'));var authService=require(_0x2e55('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e55('0x13'));var logger=require(_0x2e55('0x14'))(_0x2e55('0x15'));var utils=require(_0x2e55('0x16'));var config=require(_0x2e55('0x17'));var licenseUtil=require(_0x2e55('0x18'));var db=require(_0x2e55('0x19'))['db'];var jayson=require(_0x2e55('0x1a'));var client=jayson[_0x2e55('0x1b')][_0x2e55('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1027b9,_0x31325,_0x179302,_0x5e1c04){return new BPromise(function(_0x2b4b08,_0xc0d1aa){var _0x3e0957=_0x5e1c04||client;return _0x3e0957[_0x2e55('0x1d')](_0x1027b9,_0x179302)['then'](function(_0x2d9565){logger['info']('VoiceContext,\x20%s,\x20%s',_0x31325,_0x2e55('0x1e'));logger[_0x2e55('0x1f')](_0x2e55('0x20'),_0x31325,_0x2e55('0x1e'),JSON['stringify'](_0x2d9565));if(_0x2d9565['error']){if(_0x2d9565[_0x2e55('0x21')][_0x2e55('0x22')]===0x1f4){logger[_0x2e55('0x21')](_0x2e55('0x23'),_0x31325,_0x2d9565[_0x2e55('0x21')][_0x2e55('0x24')]);return _0xc0d1aa(_0x2d9565[_0x2e55('0x21')][_0x2e55('0x24')]);}logger[_0x2e55('0x21')]('VoiceContext,\x20%s,\x20%s',_0x31325,_0x2d9565[_0x2e55('0x21')][_0x2e55('0x24')]);return _0x2b4b08(_0x2d9565[_0x2e55('0x21')][_0x2e55('0x24')]);}else{logger[_0x2e55('0x25')](_0x2e55('0x23'),_0x31325,'request\x20sent');_0x2b4b08(_0x2d9565[_0x2e55('0x26')][_0x2e55('0x24')]);}})[_0x2e55('0x27')](function(_0x4e6112){logger[_0x2e55('0x21')](_0x2e55('0x23'),_0x31325,_0x4e6112);_0xc0d1aa(_0x4e6112);});});}function respondWithStatusCode(_0x46d8f7,_0x520f4a){_0x520f4a=_0x520f4a||0xcc;return function(_0x5c2ce5){if(_0x5c2ce5){return _0x46d8f7[_0x2e55('0x28')](_0x520f4a);}return _0x46d8f7[_0x2e55('0x29')](_0x520f4a)['end']();};}function respondWithResult(_0x515440,_0x1ab052){_0x1ab052=_0x1ab052||0xc8;return function(_0x338877){if(_0x338877){return _0x515440[_0x2e55('0x29')](_0x1ab052)[_0x2e55('0x2a')](_0x338877);}};}function respondWithFilteredResult(_0x3b5097,_0x3a5730){return function(_0x1397cd){if(_0x1397cd){var _0x57be75=typeof _0x3a5730[_0x2e55('0x2b')]===_0x2e55('0x2c')&&typeof _0x3a5730[_0x2e55('0x2d')]===_0x2e55('0x2c');var _0x29022e=_0x1397cd['count'];var _0x254c7c=_0x57be75?0x0:_0x3a5730[_0x2e55('0x2b')];var _0x2458c0=_0x57be75?_0x1397cd[_0x2e55('0x2e')]:_0x3a5730[_0x2e55('0x2b')]+_0x3a5730[_0x2e55('0x2d')];var _0x528319;if(_0x2458c0>=_0x29022e){_0x2458c0=_0x29022e;_0x528319=0xc8;}else{_0x528319=0xce;}_0x3b5097['status'](_0x528319);return _0x3b5097[_0x2e55('0x2f')]('Content-Range',_0x254c7c+'-'+_0x2458c0+'/'+_0x29022e)[_0x2e55('0x2a')](_0x1397cd);}return null;};}function patchUpdates(_0x4f0b62){return function(_0x157164){try{jsonpatch[_0x2e55('0x30')](_0x157164,_0x4f0b62,!![]);}catch(_0x59aa41){return BPromise[_0x2e55('0x31')](_0x59aa41);}return _0x157164[_0x2e55('0x32')]();};}function saveUpdates(_0x5c58cc,_0x44286a){return function(_0x422f81){if(_0x422f81){return _0x422f81[_0x2e55('0x33')](_0x5c58cc)['then'](function(_0x3c7bec){return _0x3c7bec;});}return null;};}function removeEntity(_0x48b244,_0x16cdfc){return function(_0x1e1e2e){if(_0x1e1e2e){return _0x1e1e2e[_0x2e55('0x34')]()[_0x2e55('0x35')](function(){var _0x49d2a0=_0x1e1e2e[_0x2e55('0x36')]({'plain':!![]});var _0x37fc71=_0x2e55('0x37');return db[_0x2e55('0x38')][_0x2e55('0x34')]({'where':{'type':_0x37fc71,'resourceId':_0x49d2a0['id']}})[_0x2e55('0x35')](function(){return _0x1e1e2e;});})[_0x2e55('0x35')](function(){_0x48b244['status'](0xcc)[_0x2e55('0x39')]();});}};}function handleEntityNotFound(_0x14ea61,_0x5a8eb2){return function(_0x32a90d){if(!_0x32a90d){_0x14ea61[_0x2e55('0x28')](0x194);}return _0x32a90d;};}function handleError(_0x29dd2d,_0x20fbb8){_0x20fbb8=_0x20fbb8||0x1f4;return function(_0x5b33d0){logger[_0x2e55('0x21')](_0x5b33d0['stack']);if(_0x5b33d0[_0x2e55('0x3a')]){delete _0x5b33d0[_0x2e55('0x3a')];}_0x29dd2d[_0x2e55('0x29')](_0x20fbb8)[_0x2e55('0x3b')](_0x5b33d0);};}exports[_0x2e55('0x3c')]=function(_0x567ba2,_0x3b4102){var _0x266c5d={},_0x42af36={},_0x4b4d75={'count':0x0,'rows':[]};var _0x273c10=_[_0x2e55('0x3d')](db[_0x2e55('0x3e')][_0x2e55('0x3f')],function(_0x21118e){return{'name':_0x21118e[_0x2e55('0x40')],'type':_0x21118e[_0x2e55('0x41')]['key']};});_0x42af36[_0x2e55('0x42')]=_[_0x2e55('0x3d')](_0x273c10,'name');_0x42af36[_0x2e55('0x43')]=_[_0x2e55('0x44')](_0x567ba2[_0x2e55('0x43')]);_0x42af36['filters']=_[_0x2e55('0x45')](_0x42af36['model'],_0x42af36[_0x2e55('0x43')]);_0x266c5d[_0x2e55('0x46')]=_[_0x2e55('0x45')](_0x42af36[_0x2e55('0x42')],qs[_0x2e55('0x47')](_0x567ba2[_0x2e55('0x43')][_0x2e55('0x47')]));_0x266c5d[_0x2e55('0x46')]=_0x266c5d[_0x2e55('0x46')][_0x2e55('0x48')]?_0x266c5d['attributes']:_0x42af36[_0x2e55('0x42')];if(!_0x567ba2['query'][_0x2e55('0x49')](_0x2e55('0x4a'))){_0x266c5d[_0x2e55('0x2d')]=qs[_0x2e55('0x2d')](_0x567ba2[_0x2e55('0x43')]['limit']);_0x266c5d[_0x2e55('0x2b')]=qs[_0x2e55('0x2b')](_0x567ba2[_0x2e55('0x43')]['offset']);}_0x266c5d[_0x2e55('0x4b')]=qs[_0x2e55('0x4c')](_0x567ba2[_0x2e55('0x43')]['sort']);_0x266c5d['where']=qs[_0x2e55('0x4d')](_[_0x2e55('0x4e')](_0x567ba2[_0x2e55('0x43')],_0x42af36['filters']),_0x273c10);if(_0x567ba2[_0x2e55('0x43')][_0x2e55('0x4f')]){_0x266c5d[_0x2e55('0x50')]=_[_0x2e55('0x51')](_0x266c5d[_0x2e55('0x50')],{'$or':_[_0x2e55('0x3d')](_0x273c10,function(_0x2b635d){if(_0x2b635d[_0x2e55('0x41')]!==_0x2e55('0x52')){var _0x338be2={};_0x338be2[_0x2b635d[_0x2e55('0x3a')]]={'$like':'%'+_0x567ba2['query']['filter']+'%'};return _0x338be2;}})});}_0x266c5d=_['merge']({},_0x266c5d,_0x567ba2[_0x2e55('0x53')]);var _0x41cd81={'where':_0x266c5d[_0x2e55('0x50')]};return db[_0x2e55('0x3e')][_0x2e55('0x2e')](_0x41cd81)[_0x2e55('0x35')](function(_0x592718){_0x4b4d75[_0x2e55('0x2e')]=_0x592718;if(_0x567ba2[_0x2e55('0x43')][_0x2e55('0x54')]){_0x266c5d[_0x2e55('0x55')]=[{'all':!![]}];}return db['VoiceContext'][_0x2e55('0x56')](_0x266c5d);})[_0x2e55('0x35')](function(_0x2647fc){_0x4b4d75[_0x2e55('0x57')]=_0x2647fc;return _0x4b4d75;})[_0x2e55('0x35')](respondWithFilteredResult(_0x3b4102,_0x266c5d))[_0x2e55('0x27')](handleError(_0x3b4102,null));};exports[_0x2e55('0x58')]=function(_0x5b5d86,_0x25cf88){var _0x253743={'raw':![],'where':{'id':_0x5b5d86['params']['id']}},_0x1cb2f5={};_0x1cb2f5[_0x2e55('0x42')]=_[_0x2e55('0x44')](db[_0x2e55('0x3e')][_0x2e55('0x3f')]);_0x1cb2f5[_0x2e55('0x43')]=_[_0x2e55('0x44')](_0x5b5d86[_0x2e55('0x43')]);_0x1cb2f5[_0x2e55('0x4d')]=_[_0x2e55('0x45')](_0x1cb2f5[_0x2e55('0x42')],_0x1cb2f5[_0x2e55('0x43')]);_0x253743[_0x2e55('0x46')]=_[_0x2e55('0x45')](_0x1cb2f5[_0x2e55('0x42')],qs['fields'](_0x5b5d86[_0x2e55('0x43')]['fields']));_0x253743[_0x2e55('0x46')]=_0x253743[_0x2e55('0x46')][_0x2e55('0x48')]?_0x253743[_0x2e55('0x46')]:_0x1cb2f5[_0x2e55('0x42')];if(_0x5b5d86[_0x2e55('0x43')][_0x2e55('0x54')]){_0x253743[_0x2e55('0x55')]=[{'all':!![]}];}_0x253743=_[_0x2e55('0x51')]({},_0x253743,_0x5b5d86[_0x2e55('0x53')]);return db[_0x2e55('0x3e')][_0x2e55('0x59')](_0x253743)[_0x2e55('0x35')](handleEntityNotFound(_0x25cf88,null))['then'](respondWithResult(_0x25cf88,null))[_0x2e55('0x27')](handleError(_0x25cf88,null));};exports[_0x2e55('0x5a')]=function(_0x302282,_0x5c6959,_0x5cd216){var _0x45ee75;return db[_0x2e55('0x3e')][_0x2e55('0x5a')](_0x302282['body'],{'raw':!![]})[_0x2e55('0x35')](function(_0x546150){_0x45ee75=_0x546150;return db[_0x2e55('0x3e')]['findAll']({'raw':!![]});})[_0x2e55('0x35')](function(_0x3d0d92){var _0x242354=fs[_0x2e55('0x5b')](path[_0x2e55('0x5c')](config['root'],_0x2e55('0x5d')),_0x2e55('0x5e'));var _0x331de5=ejs[_0x2e55('0x5f')](_0x242354,{'contexts':_0x3d0d92||[]});fs[_0x2e55('0x60')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x331de5);})[_0x2e55('0x35')](function(){return respondWithRpcPromise(_0x2e55('0x61'),_0x2e55('0x5a'),{'module':_0x2e55('0x62')});})[_0x2e55('0x35')](function(){var _0x2de2d4=_0x302282[_0x2e55('0x63')]['get']({'plain':!![]});if(!_0x2de2d4)throw new Error(_0x2e55('0x64'));if(_0x2de2d4[_0x2e55('0x65')]===_0x2e55('0x63')){var _0x17064e=_0x45ee75['get']({'plain':!![]});return db[_0x2e55('0x66')][_0x2e55('0x59')]({'where':{'name':_0x2e55('0x37'),'userProfileId':_0x2de2d4['userProfileId']},'raw':!![]})[_0x2e55('0x35')](function(_0x2f50b2){if(_0x2f50b2&&_0x2f50b2['autoAssociation']===0x0){return db[_0x2e55('0x38')][_0x2e55('0x5a')]({'name':_0x17064e['name'],'resourceId':_0x17064e['id'],'type':_0x2f50b2['name'],'sectionId':_0x2f50b2['id']},{})['then'](function(){return _0x45ee75;});}else{return _0x45ee75;}})[_0x2e55('0x27')](function(_0x3c1ed2){logger['error'](_0x2e55('0x67'),_0x3c1ed2);throw _0x3c1ed2;});}return _0x45ee75;})[_0x2e55('0x35')](respondWithResult(_0x5c6959,0xc9))['catch'](handleError(_0x5c6959,null));};exports['update']=function(_0x9a9843,_0xafd4fa,_0x521383){var _0x37c255;return db['VoiceContext']['find']({'where':{'id':_0x9a9843[_0x2e55('0x68')]['id']}})[_0x2e55('0x35')](handleEntityNotFound(_0xafd4fa,null))[_0x2e55('0x35')](saveUpdates(_0x9a9843[_0x2e55('0x69')],null))[_0x2e55('0x35')](function(_0x2db0a8){if(_0x2db0a8){_0x37c255=_0x2db0a8;return db['VoiceContext'][_0x2e55('0x56')]({'raw':!![]});}})['then'](function(_0x2aa506){var _0x340cf2=fs['readFileSync'](path['join'](config[_0x2e55('0x6a')],_0x2e55('0x5d')),_0x2e55('0x5e'));var _0x5d9d96=ejs['render'](_0x340cf2,{'contexts':_0x2aa506||[]});fs[_0x2e55('0x60')](_0x2e55('0x6b'),_0x5d9d96);})['then'](function(){return respondWithRpcPromise(_0x2e55('0x61'),_0x2e55('0x33'),{'module':_0x2e55('0x62')});})[_0x2e55('0x35')](function(){return _0x37c255;})[_0x2e55('0x35')](respondWithResult(_0xafd4fa,null))[_0x2e55('0x27')](handleError(_0xafd4fa,null));};exports['destroy']=function(_0x47027d,_0xadb52a,_0x4d6e07){var _0x111f28;return db[_0x2e55('0x3e')]['find']({'where':{'id':_0x47027d[_0x2e55('0x68')]['id']}})[_0x2e55('0x35')](handleEntityNotFound(_0xadb52a,null))[_0x2e55('0x35')](removeEntity(_0xadb52a,null))['then'](function(){return db['VoiceContext'][_0x2e55('0x56')]({'raw':!![]});})['then'](function(_0x269822){var _0x1b0eba=fs[_0x2e55('0x5b')](path[_0x2e55('0x5c')](config[_0x2e55('0x6a')],_0x2e55('0x5d')),'utf8');var _0xa2ca34=ejs['render'](_0x1b0eba,{'contexts':_0x269822});fs[_0x2e55('0x60')]('/etc/asterisk/extensions_xcally_contexts.conf',_0xa2ca34);return respondWithRpcPromise(_0x2e55('0x61'),_0x2e55('0x34'),{'module':_0x2e55('0x62')});})['catch'](handleError(_0xadb52a,null));}; \ No newline at end of file +var _0xbca7=['length','nolimit','limit','sort','where','filters','filter','options','VoiceContext','includeAll','findAll','params','include','create','readFileSync','join','root','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','server/files/templates/context.ejs','render','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','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/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Contexts','end','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes'];(function(_0x59fe4b,_0xe20729){var _0x5a2655=function(_0x40d28f){while(--_0x40d28f){_0x59fe4b['push'](_0x59fe4b['shift']());}};_0x5a2655(++_0xe20729);}(_0xbca7,0x86));var _0x7bca=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xbca7[_0xf0bcac];return _0x4e4c65;};'use strict';var emlformat=require(_0x7bca('0x0'));var rimraf=require(_0x7bca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bca('0x2'));var rp=require('request-promise');var moment=require(_0x7bca('0x3'));var BPromise=require(_0x7bca('0x4'));var Mustache=require(_0x7bca('0x5'));var util=require(_0x7bca('0x6'));var path=require('path');var sox=require(_0x7bca('0x7'));var csv=require('to-csv');var ejs=require(_0x7bca('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7bca('0x9'));var squel=require(_0x7bca('0xa'));var crypto=require(_0x7bca('0xb'));var jsforce=require(_0x7bca('0xc'));var deskjs=require(_0x7bca('0xd'));var toCsv=require(_0x7bca('0xe'));var querystring=require(_0x7bca('0xf'));var Papa=require(_0x7bca('0x10'));var Redis=require('ioredis');var authService=require(_0x7bca('0x11'));var qs=require(_0x7bca('0x12'));var as=require(_0x7bca('0x13'));var hardwareService=require(_0x7bca('0x14'));var logger=require(_0x7bca('0x15'))(_0x7bca('0x16'));var utils=require('../../config/utils');var config=require(_0x7bca('0x17'));var licenseUtil=require(_0x7bca('0x18'));var db=require(_0x7bca('0x19'))['db'];var jayson=require(_0x7bca('0x1a'));var client=jayson[_0x7bca('0x1b')][_0x7bca('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5936e1,_0x28ef95,_0x347937,_0x21caca){return new BPromise(function(_0x5944d2,_0x4a1b6c){var _0x1fc612=_0x21caca||client;return _0x1fc612[_0x7bca('0x1d')](_0x5936e1,_0x347937)['then'](function(_0x223645){logger[_0x7bca('0x1e')](_0x7bca('0x1f'),_0x28ef95,_0x7bca('0x20'));logger[_0x7bca('0x21')](_0x7bca('0x22'),_0x28ef95,_0x7bca('0x20'),JSON[_0x7bca('0x23')](_0x223645));if(_0x223645[_0x7bca('0x24')]){if(_0x223645[_0x7bca('0x24')][_0x7bca('0x25')]===0x1f4){logger[_0x7bca('0x24')]('VoiceContext,\x20%s,\x20%s',_0x28ef95,_0x223645[_0x7bca('0x24')][_0x7bca('0x26')]);return _0x4a1b6c(_0x223645['error'][_0x7bca('0x26')]);}logger['error'](_0x7bca('0x1f'),_0x28ef95,_0x223645['error']['message']);return _0x5944d2(_0x223645['error'][_0x7bca('0x26')]);}else{logger['info'](_0x7bca('0x1f'),_0x28ef95,_0x7bca('0x20'));_0x5944d2(_0x223645['result'][_0x7bca('0x26')]);}})[_0x7bca('0x27')](function(_0x8c0163){logger[_0x7bca('0x24')](_0x7bca('0x1f'),_0x28ef95,_0x8c0163);_0x4a1b6c(_0x8c0163);});});}function respondWithStatusCode(_0x1dc53e,_0x24b793){_0x24b793=_0x24b793||0xcc;return function(_0x3e80ac){if(_0x3e80ac){return _0x1dc53e['sendStatus'](_0x24b793);}return _0x1dc53e[_0x7bca('0x28')](_0x24b793)['end']();};}function respondWithResult(_0x179d2a,_0x5c1561){_0x5c1561=_0x5c1561||0xc8;return function(_0x80c689){if(_0x80c689){return _0x179d2a['status'](_0x5c1561)[_0x7bca('0x29')](_0x80c689);}};}function respondWithFilteredResult(_0x873f67,_0x575118){return function(_0xda6d1f){if(_0xda6d1f){var _0x1375aa=typeof _0x575118[_0x7bca('0x2a')]===_0x7bca('0x2b')&&typeof _0x575118['limit']===_0x7bca('0x2b');var _0x51d224=_0xda6d1f[_0x7bca('0x2c')];var _0x24cf6e=_0x1375aa?0x0:_0x575118[_0x7bca('0x2a')];var _0x152aa8=_0x1375aa?_0xda6d1f[_0x7bca('0x2c')]:_0x575118[_0x7bca('0x2a')]+_0x575118['limit'];var _0x1d8f65;if(_0x152aa8>=_0x51d224){_0x152aa8=_0x51d224;_0x1d8f65=0xc8;}else{_0x1d8f65=0xce;}_0x873f67[_0x7bca('0x28')](_0x1d8f65);return _0x873f67[_0x7bca('0x2d')](_0x7bca('0x2e'),_0x24cf6e+'-'+_0x152aa8+'/'+_0x51d224)['json'](_0xda6d1f);}return null;};}function patchUpdates(_0x32a732){return function(_0x1d19a4){try{jsonpatch[_0x7bca('0x2f')](_0x1d19a4,_0x32a732,!![]);}catch(_0x461e45){return BPromise[_0x7bca('0x30')](_0x461e45);}return _0x1d19a4[_0x7bca('0x31')]();};}function saveUpdates(_0x459d97,_0x39cbea){return function(_0x4da08f){if(_0x4da08f){return _0x4da08f[_0x7bca('0x32')](_0x459d97)[_0x7bca('0x33')](function(_0x17ad16){return _0x17ad16;});}return null;};}function removeEntity(_0xa18435,_0x257b2f){return function(_0x5138f3){if(_0x5138f3){return _0x5138f3[_0x7bca('0x34')]()['then'](function(){var _0x526bec=_0x5138f3[_0x7bca('0x35')]({'plain':!![]});var _0x270771=_0x7bca('0x36');return db['UserProfileResource'][_0x7bca('0x34')]({'where':{'type':_0x270771,'resourceId':_0x526bec['id']}})[_0x7bca('0x33')](function(){return _0x5138f3;});})[_0x7bca('0x33')](function(){_0xa18435['status'](0xcc)[_0x7bca('0x37')]();});}};}function handleEntityNotFound(_0x2be736,_0x2cc49c){return function(_0x2eaa77){if(!_0x2eaa77){_0x2be736[_0x7bca('0x38')](0x194);}return _0x2eaa77;};}function handleError(_0x453d11,_0x901229){_0x901229=_0x901229||0x1f4;return function(_0x1382e1){logger[_0x7bca('0x24')](_0x1382e1[_0x7bca('0x39')]);if(_0x1382e1['name']){delete _0x1382e1[_0x7bca('0x3a')];}_0x453d11[_0x7bca('0x28')](_0x901229)['send'](_0x1382e1);};}exports[_0x7bca('0x3b')]=function(_0x2513ec,_0x8b48a4){var _0x595f99={},_0x3ef191={},_0x3a3084={'count':0x0,'rows':[]};var _0x3b4a72=_[_0x7bca('0x3c')](db['VoiceContext'][_0x7bca('0x3d')],function(_0x4e0346){return{'name':_0x4e0346[_0x7bca('0x3e')],'type':_0x4e0346[_0x7bca('0x3f')][_0x7bca('0x40')]};});_0x3ef191[_0x7bca('0x41')]=_['map'](_0x3b4a72,_0x7bca('0x3a'));_0x3ef191['query']=_['keys'](_0x2513ec[_0x7bca('0x42')]);_0x3ef191['filters']=_[_0x7bca('0x43')](_0x3ef191[_0x7bca('0x41')],_0x3ef191[_0x7bca('0x42')]);_0x595f99['attributes']=_[_0x7bca('0x43')](_0x3ef191['model'],qs['fields'](_0x2513ec[_0x7bca('0x42')][_0x7bca('0x44')]));_0x595f99[_0x7bca('0x45')]=_0x595f99['attributes'][_0x7bca('0x46')]?_0x595f99[_0x7bca('0x45')]:_0x3ef191[_0x7bca('0x41')];if(!_0x2513ec[_0x7bca('0x42')]['hasOwnProperty'](_0x7bca('0x47'))){_0x595f99[_0x7bca('0x48')]=qs[_0x7bca('0x48')](_0x2513ec[_0x7bca('0x42')][_0x7bca('0x48')]);_0x595f99[_0x7bca('0x2a')]=qs['offset'](_0x2513ec['query'][_0x7bca('0x2a')]);}_0x595f99['order']=qs[_0x7bca('0x49')](_0x2513ec[_0x7bca('0x42')][_0x7bca('0x49')]);_0x595f99[_0x7bca('0x4a')]=qs[_0x7bca('0x4b')](_['pick'](_0x2513ec[_0x7bca('0x42')],_0x3ef191[_0x7bca('0x4b')]),_0x3b4a72);if(_0x2513ec[_0x7bca('0x42')]['filter']){_0x595f99[_0x7bca('0x4a')]=_['merge'](_0x595f99[_0x7bca('0x4a')],{'$or':_['map'](_0x3b4a72,function(_0x3df2c9){if(_0x3df2c9[_0x7bca('0x3f')]!=='VIRTUAL'){var _0x263b57={};_0x263b57[_0x3df2c9[_0x7bca('0x3a')]]={'$like':'%'+_0x2513ec[_0x7bca('0x42')][_0x7bca('0x4c')]+'%'};return _0x263b57;}})});}_0x595f99=_['merge']({},_0x595f99,_0x2513ec[_0x7bca('0x4d')]);var _0x4ed1dd={'where':_0x595f99[_0x7bca('0x4a')]};return db[_0x7bca('0x4e')][_0x7bca('0x2c')](_0x4ed1dd)[_0x7bca('0x33')](function(_0x7447f6){_0x3a3084[_0x7bca('0x2c')]=_0x7447f6;if(_0x2513ec[_0x7bca('0x42')][_0x7bca('0x4f')]){_0x595f99['include']=[{'all':!![]}];}return db[_0x7bca('0x4e')][_0x7bca('0x50')](_0x595f99);})[_0x7bca('0x33')](function(_0x43fb65){_0x3a3084['rows']=_0x43fb65;return _0x3a3084;})[_0x7bca('0x33')](respondWithFilteredResult(_0x8b48a4,_0x595f99))[_0x7bca('0x27')](handleError(_0x8b48a4,null));};exports['show']=function(_0x5621d5,_0x5a4c67){var _0x340536={'raw':![],'where':{'id':_0x5621d5[_0x7bca('0x51')]['id']}},_0x550edf={};_0x550edf[_0x7bca('0x41')]=_['keys'](db['VoiceContext'][_0x7bca('0x3d')]);_0x550edf[_0x7bca('0x42')]=_['keys'](_0x5621d5[_0x7bca('0x42')]);_0x550edf['filters']=_[_0x7bca('0x43')](_0x550edf[_0x7bca('0x41')],_0x550edf[_0x7bca('0x42')]);_0x340536[_0x7bca('0x45')]=_[_0x7bca('0x43')](_0x550edf[_0x7bca('0x41')],qs[_0x7bca('0x44')](_0x5621d5[_0x7bca('0x42')][_0x7bca('0x44')]));_0x340536['attributes']=_0x340536[_0x7bca('0x45')][_0x7bca('0x46')]?_0x340536[_0x7bca('0x45')]:_0x550edf[_0x7bca('0x41')];if(_0x5621d5[_0x7bca('0x42')][_0x7bca('0x4f')]){_0x340536[_0x7bca('0x52')]=[{'all':!![]}];}_0x340536=_['merge']({},_0x340536,_0x5621d5[_0x7bca('0x4d')]);return db[_0x7bca('0x4e')]['find'](_0x340536)[_0x7bca('0x33')](handleEntityNotFound(_0x5a4c67,null))['then'](respondWithResult(_0x5a4c67,null))[_0x7bca('0x27')](handleError(_0x5a4c67,null));};exports[_0x7bca('0x53')]=function(_0x5bdf48,_0x51602b,_0x36d0c9){var _0x105c47;return db[_0x7bca('0x4e')][_0x7bca('0x53')](_0x5bdf48['body'],{'raw':!![]})[_0x7bca('0x33')](function(_0x25c147){_0x105c47=_0x25c147;return db[_0x7bca('0x4e')][_0x7bca('0x50')]({'raw':!![]});})[_0x7bca('0x33')](function(_0x5097c2){var _0x1e59d7=fs[_0x7bca('0x54')](path[_0x7bca('0x55')](config[_0x7bca('0x56')],'server/files/templates/context.ejs'),_0x7bca('0x57'));var _0x58d43b=ejs['render'](_0x1e59d7,{'contexts':_0x5097c2||[]});fs[_0x7bca('0x58')](_0x7bca('0x59'),_0x58d43b);})['then'](function(){return respondWithRpcPromise(_0x7bca('0x5a'),_0x7bca('0x53'),{'module':_0x7bca('0x5b')});})[_0x7bca('0x33')](function(){var _0xb2c056=_0x5bdf48[_0x7bca('0x5c')]['get']({'plain':!![]});if(!_0xb2c056)throw new Error(_0x7bca('0x5d'));if(_0xb2c056[_0x7bca('0x5e')]===_0x7bca('0x5c')){var _0x57070a=_0x105c47[_0x7bca('0x35')]({'plain':!![]});return db[_0x7bca('0x5f')][_0x7bca('0x60')]({'where':{'name':'Contexts','userProfileId':_0xb2c056[_0x7bca('0x61')]},'raw':!![]})['then'](function(_0x645dd1){if(_0x645dd1&&_0x645dd1[_0x7bca('0x62')]===0x0){return db[_0x7bca('0x63')][_0x7bca('0x53')]({'name':_0x57070a[_0x7bca('0x3a')],'resourceId':_0x57070a['id'],'type':_0x645dd1[_0x7bca('0x3a')],'sectionId':_0x645dd1['id']},{})[_0x7bca('0x33')](function(){return _0x105c47;});}else{return _0x105c47;}})['catch'](function(_0x5135c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5135c0);throw _0x5135c0;});}return _0x105c47;})[_0x7bca('0x33')](respondWithResult(_0x51602b,0xc9))[_0x7bca('0x27')](handleError(_0x51602b,null));};exports[_0x7bca('0x32')]=function(_0xe27831,_0x1c3bd3,_0x2a35d6){var _0x38b1f8;return db['VoiceContext'][_0x7bca('0x60')]({'where':{'id':_0xe27831[_0x7bca('0x51')]['id']}})[_0x7bca('0x33')](handleEntityNotFound(_0x1c3bd3,null))[_0x7bca('0x33')](saveUpdates(_0xe27831['body'],null))[_0x7bca('0x33')](function(_0x329e2e){if(_0x329e2e){_0x38b1f8=_0x329e2e;return db[_0x7bca('0x4e')][_0x7bca('0x50')]({'raw':!![]});}})[_0x7bca('0x33')](function(_0x39609d){var _0xe186db=fs['readFileSync'](path[_0x7bca('0x55')](config[_0x7bca('0x56')],_0x7bca('0x64')),'utf8');var _0x669740=ejs[_0x7bca('0x65')](_0xe186db,{'contexts':_0x39609d||[]});fs[_0x7bca('0x58')](_0x7bca('0x59'),_0x669740);})['then'](function(){return respondWithRpcPromise('Reload',_0x7bca('0x32'),{'module':_0x7bca('0x5b')});})[_0x7bca('0x33')](function(){return _0x38b1f8;})[_0x7bca('0x33')](respondWithResult(_0x1c3bd3,null))['catch'](handleError(_0x1c3bd3,null));};exports[_0x7bca('0x34')]=function(_0x44d347,_0x55c122,_0x2062f5){var _0x43a37c;return db['VoiceContext'][_0x7bca('0x60')]({'where':{'id':_0x44d347['params']['id']}})[_0x7bca('0x33')](handleEntityNotFound(_0x55c122,null))[_0x7bca('0x33')](removeEntity(_0x55c122,null))['then'](function(){return db[_0x7bca('0x4e')][_0x7bca('0x50')]({'raw':!![]});})[_0x7bca('0x33')](function(_0xf25ac3){var _0x4369af=fs[_0x7bca('0x54')](path[_0x7bca('0x55')](config[_0x7bca('0x56')],_0x7bca('0x64')),_0x7bca('0x57'));var _0x357859=ejs[_0x7bca('0x65')](_0x4369af,{'contexts':_0xf25ac3});fs[_0x7bca('0x58')](_0x7bca('0x59'),_0x357859);return respondWithRpcPromise(_0x7bca('0x5a'),_0x7bca('0x34'),{'module':_0x7bca('0x5b')});})[_0x7bca('0x27')](handleError(_0x55c122,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 60b47d4..db5740f 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 _0x386e=['bluebird','request-promise','path','rimraf','./voiceContext.attributes','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment'];(function(_0x3dd23c,_0x18c32f){var _0x520bf8=function(_0x462f87){while(--_0x462f87){_0x3dd23c['push'](_0x3dd23c['shift']());}};_0x520bf8(++_0x18c32f);}(_0x386e,0x1dc));var _0xe386=function(_0x5038e3,_0x29855b){_0x5038e3=_0x5038e3-0x0;var _0x593c8d=_0x386e[_0x5038e3];return _0x593c8d;};'use strict';var _=require(_0xe386('0x0'));var util=require(_0xe386('0x1'));var logger=require(_0xe386('0x2'))(_0xe386('0x3'));var moment=require(_0xe386('0x4'));var BPromise=require(_0xe386('0x5'));var rp=require(_0xe386('0x6'));var fs=require('fs');var path=require(_0xe386('0x7'));var rimraf=require(_0xe386('0x8'));var config=require('../../config/environment');var attributes=require(_0xe386('0x9'));module['exports']=function(_0x16ae6c,_0x4b2d98){return _0x16ae6c[_0xe386('0xa')](_0xe386('0xb'),attributes,{'tableName':_0xe386('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x312d=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceContext','lodash','util','../../config/logger','api','moment'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0x312d,0x14d));var _0xd312=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x312d[_0x2fc012];return _0x2891f9;};'use strict';var _=require(_0xd312('0x0'));var util=require(_0xd312('0x1'));var logger=require(_0xd312('0x2'))(_0xd312('0x3'));var moment=require(_0xd312('0x4'));var BPromise=require(_0xd312('0x5'));var rp=require(_0xd312('0x6'));var fs=require('fs');var path=require(_0xd312('0x7'));var rimraf=require(_0xd312('0x8'));var config=require(_0xd312('0x9'));var attributes=require('./voiceContext.attributes');module[_0xd312('0xa')]=function(_0xd83e03,_0x5d4ebe){return _0xd83e03[_0xd312('0xb')](_0xd312('0xc'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 7c6b7af..be462c8 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 _0x1bd1=['message','catch','lodash','util','moment','randomstring','rpc','../../config/environment','jayson/promise','client','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x248121,_0x257888){var _0x8a7ae=function(_0x81a34f){while(--_0x81a34f){_0x248121['push'](_0x248121['shift']());}};_0x8a7ae(++_0x257888);}(_0x1bd1,0x123));var _0x11bd=function(_0x541352,_0x29e495){_0x541352=_0x541352-0x0;var _0x27c954=_0x1bd1[_0x541352];return _0x27c954;};'use strict';var _=require(_0x11bd('0x0'));var util=require(_0x11bd('0x1'));var moment=require(_0x11bd('0x2'));var BPromise=require('bluebird');var rs=require(_0x11bd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x11bd('0x4'));var config=require(_0x11bd('0x5'));var jayson=require(_0x11bd('0x6'));var client=jayson[_0x11bd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x336255,_0x1f813c,_0x359f21){return new BPromise(function(_0x3940cf,_0x361ecf){return client['request'](_0x336255,_0x359f21)[_0x11bd('0x8')](function(_0x553727){logger['info'](_0x11bd('0x9'),_0x1f813c,_0x11bd('0xa'));logger[_0x11bd('0xb')](_0x11bd('0xc'),_0x1f813c,_0x11bd('0xa'),JSON[_0x11bd('0xd')](_0x553727));if(_0x553727[_0x11bd('0xe')]){if(_0x553727[_0x11bd('0xe')]['code']===0x1f4){logger[_0x11bd('0xe')](_0x11bd('0x9'),_0x1f813c,_0x553727[_0x11bd('0xe')][_0x11bd('0xf')]);return _0x361ecf(_0x553727[_0x11bd('0xe')][_0x11bd('0xf')]);}logger[_0x11bd('0xe')]('VoiceContext,\x20%s,\x20%s',_0x1f813c,_0x553727['error'][_0x11bd('0xf')]);return _0x3940cf(_0x553727[_0x11bd('0xe')][_0x11bd('0xf')]);}else{logger['info'](_0x11bd('0x9'),_0x1f813c,'request\x20sent');_0x3940cf(_0x553727['result'][_0x11bd('0xf')]);}})[_0x11bd('0x10')](function(_0xab4cde){logger[_0x11bd('0xe')](_0x11bd('0x9'),_0x1f813c,_0xab4cde);_0x361ecf(_0xab4cde);});});} \ No newline at end of file +var _0x659c=['request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','VoiceContext,\x20%s,\x20%s'];(function(_0x1df1b3,_0xedaff1){var _0xe65494=function(_0xbc3829){while(--_0xbc3829){_0x1df1b3['push'](_0x1df1b3['shift']());}};_0xe65494(++_0xedaff1);}(_0x659c,0x1aa));var _0xc659=function(_0x34357e,_0x5af72a){_0x34357e=_0x34357e-0x0;var _0x488189=_0x659c[_0x34357e];return _0x488189;};'use strict';var _=require(_0xc659('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc659('0x1'));var rs=require(_0xc659('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc659('0x3'))['db'];var utils=require(_0xc659('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc659('0x5'));var jayson=require(_0xc659('0x6'));var client=jayson[_0xc659('0x7')][_0xc659('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15e20b,_0x33e9d9,_0x536208){return new BPromise(function(_0x51b67f,_0x2cc93d){return client['request'](_0x15e20b,_0x536208)['then'](function(_0x4fadc2){logger[_0xc659('0x9')](_0xc659('0xa'),_0x33e9d9,_0xc659('0xb'));logger[_0xc659('0xc')](_0xc659('0xd'),_0x33e9d9,_0xc659('0xb'),JSON[_0xc659('0xe')](_0x4fadc2));if(_0x4fadc2[_0xc659('0xf')]){if(_0x4fadc2['error'][_0xc659('0x10')]===0x1f4){logger[_0xc659('0xf')](_0xc659('0xa'),_0x33e9d9,_0x4fadc2['error']['message']);return _0x2cc93d(_0x4fadc2[_0xc659('0xf')][_0xc659('0x11')]);}logger['error'](_0xc659('0xa'),_0x33e9d9,_0x4fadc2[_0xc659('0xf')][_0xc659('0x11')]);return _0x51b67f(_0x4fadc2[_0xc659('0xf')][_0xc659('0x11')]);}else{logger[_0xc659('0x9')](_0xc659('0xa'),_0x33e9d9,_0xc659('0xb'));_0x51b67f(_0x4fadc2[_0xc659('0x12')][_0xc659('0x11')]);}})['catch'](function(_0x272210){logger[_0xc659('0xf')](_0xc659('0xa'),_0x33e9d9,_0x272210);_0x2cc93d(_0x272210);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index eded27e..5d96273 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 _0xa063=['describe','/:id','show','post','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','get'];(function(_0xe0c564,_0x2ff569){var _0x32e0f6=function(_0x3fd0fc){while(--_0x3fd0fc){_0xe0c564['push'](_0xe0c564['shift']());}};_0x32e0f6(++_0x2ff569);}(_0xa063,0x1ee));var _0x3a06=function(_0x22f69e,_0x56edb1){_0x22f69e=_0x22f69e-0x0;var _0x11751d=_0xa063[_0x22f69e];return _0x11751d;};'use strict';var multer=require(_0x3a06('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3a06('0x1'));var express=require(_0x3a06('0x2'));var router=express[_0x3a06('0x3')]();var fs_extra=require(_0x3a06('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3a06('0x5'));var config=require('../../config/environment');var controller=require(_0x3a06('0x6'));router['get']('/',auth[_0x3a06('0x7')](),controller[_0x3a06('0x8')]);router[_0x3a06('0x9')]('/describe',auth[_0x3a06('0x7')](),controller[_0x3a06('0xa')]);router['get'](_0x3a06('0xb'),auth[_0x3a06('0x7')](),controller[_0x3a06('0xc')]);router[_0x3a06('0xd')]('/',auth[_0x3a06('0x7')](),controller['create']);router['put'](_0x3a06('0xb'),auth[_0x3a06('0x7')](),controller[_0x3a06('0xe')]);router[_0x3a06('0xf')](_0x3a06('0xb'),auth['isAuthenticated'](),controller[_0x3a06('0x10')]);module[_0x3a06('0x11')]=router; \ No newline at end of file +var _0xf0a4=['../../components/auth/service','../../config/environment','get','isAuthenticated','create','put','delete','destroy','connect-timeout','express','Router','fs-extra'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf0a4,0x1c4));var _0x4f0a=function(_0x4cc9b9,_0x323958){_0x4cc9b9=_0x4cc9b9-0x0;var _0x22ab1b=_0xf0a4[_0x4cc9b9];return _0x22ab1b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4f0a('0x0'));var express=require(_0x4f0a('0x1'));var router=express[_0x4f0a('0x2')]();var fs_extra=require(_0x4f0a('0x3'));var auth=require(_0x4f0a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4f0a('0x5'));var controller=require('./voiceDialReport.controller');router[_0x4f0a('0x6')]('/',auth[_0x4f0a('0x7')](),controller['index']);router[_0x4f0a('0x6')]('/describe',auth[_0x4f0a('0x7')](),controller['describe']);router[_0x4f0a('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x4f0a('0x7')](),controller[_0x4f0a('0x8')]);router[_0x4f0a('0x9')]('/:id',auth[_0x4f0a('0x7')](),controller['update']);router[_0x4f0a('0xa')]('/:id',auth[_0x4f0a('0x7')](),controller[_0x4f0a('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 68ea899..5a7c594 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x9b3084,_0x22e8ad){var _0x17db21=function(_0x5d1f7f){while(--_0x5d1f7f){_0x9b3084['push'](_0x9b3084['shift']());}};_0x17db21(++_0x22e8ad);}(_0xedd9,0xfc));var _0x9edd=function(_0x110832,_0x1bbf87){_0x110832=_0x110832-0x0;var _0x37e939=_0xedd9[_0x110832];return _0x37e939;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'privilege':{'type':Sequelize[_0x9edd('0x1')]},'channel':{'type':Sequelize[_0x9edd('0x1')]},'channelstate':{'type':Sequelize[_0x9edd('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'calleridnum':{'type':Sequelize[_0x9edd('0x1')]},'calleridname':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9edd('0x1')]},'accountcode':{'type':Sequelize[_0x9edd('0x1')]},'context':{'type':Sequelize[_0x9edd('0x1')]},'exten':{'type':Sequelize[_0x9edd('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9edd('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9edd('0x1')]},'destchannelstate':{'type':Sequelize[_0x9edd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9edd('0x1')]},'destaccountcode':{'type':Sequelize[_0x9edd('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9edd('0x1')]},'destpriority':{'type':Sequelize[_0x9edd('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9edd('0x1')]},'dialstring':{'type':Sequelize[_0x9edd('0x1')]},'dialstatus':{'type':Sequelize[_0x9edd('0x1')]},'starttime':{'type':Sequelize[_0x9edd('0x3')]},'answertime':{'type':Sequelize[_0x9edd('0x3')]},'endtime':{'type':Sequelize[_0x9edd('0x3')]},'lastevent':{'type':Sequelize[_0x9edd('0x1')],'comment':_0x9edd('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9edd('0x2')]},'holdtime':{'type':Sequelize[_0x9edd('0x2')]},'billableseconds':{'type':Sequelize[_0x9edd('0x2')]}}; \ No newline at end of file +var _0x8ef6=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x32b8a9,_0x59d62b){var _0x40105c=function(_0x54c048){while(--_0x54c048){_0x32b8a9['push'](_0x32b8a9['shift']());}};_0x40105c(++_0x59d62b);}(_0x8ef6,0xf2));var _0x68ef=function(_0x34f0f1,_0x174ec9){_0x34f0f1=_0x34f0f1-0x0;var _0x2fb4b5=_0x8ef6[_0x34f0f1];return _0x2fb4b5;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'privilege':{'type':Sequelize[_0x68ef('0x2')]},'channel':{'type':Sequelize[_0x68ef('0x2')]},'channelstate':{'type':Sequelize[_0x68ef('0x3')]},'channelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'calleridnum':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'connectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'language':{'type':Sequelize[_0x68ef('0x2')]},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x68ef('0x3')]},'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'linkedid':{'type':Sequelize[_0x68ef('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x68ef('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridnum':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridname':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'destlanguage':{'type':Sequelize[_0x68ef('0x2')]},'destaccountcode':{'type':Sequelize[_0x68ef('0x2')]},'destcontext':{'type':Sequelize[_0x68ef('0x2')]},'destexten':{'type':Sequelize[_0x68ef('0x2')]},'destpriority':{'type':Sequelize[_0x68ef('0x3')]},'destuniqueid':{'type':Sequelize[_0x68ef('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x68ef('0x2')]},'dialstatus':{'type':Sequelize[_0x68ef('0x2')]},'starttime':{'type':Sequelize[_0x68ef('0x4')]},'answertime':{'type':Sequelize[_0x68ef('0x4')]},'endtime':{'type':Sequelize[_0x68ef('0x4')]},'lastevent':{'type':Sequelize[_0x68ef('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x68ef('0x3')]},'duration':{'type':Sequelize[_0x68ef('0x3')]},'holdtime':{'type':Sequelize[_0x68ef('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index db1c09e..83651bc 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 _0x949a=['fs-extra','lodash','squel','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','show','params','includeAll','include','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x949a,0x11f));var _0xa949=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x949a[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xa949('0x0'));var rimraf=require(_0xa949('0x1'));var zipdir=require(_0xa949('0x2'));var jsonpatch=require(_0xa949('0x3'));var rp=require(_0xa949('0x4'));var moment=require(_0xa949('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa949('0x6'));var util=require('util');var path=require(_0xa949('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa949('0x8'));var fs=require('fs');var fs_extra=require(_0xa949('0x9'));var _=require(_0xa949('0xa'));var squel=require(_0xa949('0xb'));var crypto=require('crypto');var jsforce=require(_0xa949('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa949('0xd'));var querystring=require(_0xa949('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa949('0xf'));var qs=require(_0xa949('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa949('0x11'));var logger=require(_0xa949('0x12'))('api');var utils=require(_0xa949('0x13'));var config=require(_0xa949('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa949('0x15'))['db'];function respondWithStatusCode(_0x381da5,_0xabdc30){_0xabdc30=_0xabdc30||0xcc;return function(_0x5dca9d){if(_0x5dca9d){return _0x381da5[_0xa949('0x16')](_0xabdc30);}return _0x381da5[_0xa949('0x17')](_0xabdc30)[_0xa949('0x18')]();};}function respondWithResult(_0x4a8976,_0x25f3e5){_0x25f3e5=_0x25f3e5||0xc8;return function(_0xafc9ea){if(_0xafc9ea){return _0x4a8976[_0xa949('0x17')](_0x25f3e5)['json'](_0xafc9ea);}};}function respondWithFilteredResult(_0x28b457,_0x5e37f9){return function(_0x1ae76f){if(_0x1ae76f){var _0x2b202c=typeof _0x5e37f9[_0xa949('0x19')]==='undefined'&&typeof _0x5e37f9[_0xa949('0x1a')]==='undefined';var _0x31005f=_0x1ae76f['count'];var _0x330708=_0x2b202c?0x0:_0x5e37f9['offset'];var _0x4e2d09=_0x2b202c?_0x1ae76f[_0xa949('0x1b')]:_0x5e37f9[_0xa949('0x19')]+_0x5e37f9[_0xa949('0x1a')];var _0x399cbf;if(_0x4e2d09>=_0x31005f){_0x4e2d09=_0x31005f;_0x399cbf=0xc8;}else{_0x399cbf=0xce;}_0x28b457['status'](_0x399cbf);return _0x28b457[_0xa949('0x1c')](_0xa949('0x1d'),_0x330708+'-'+_0x4e2d09+'/'+_0x31005f)[_0xa949('0x1e')](_0x1ae76f);}return null;};}function patchUpdates(_0x13417d){return function(_0x794acb){try{jsonpatch[_0xa949('0x1f')](_0x794acb,_0x13417d,!![]);}catch(_0x536ba9){return BPromise[_0xa949('0x20')](_0x536ba9);}return _0x794acb[_0xa949('0x21')]();};}function saveUpdates(_0x11e587,_0x24c2b6){return function(_0x50b53b){if(_0x50b53b){return _0x50b53b[_0xa949('0x22')](_0x11e587)[_0xa949('0x23')](function(_0xe48129){return _0xe48129;});}return null;};}function removeEntity(_0x2cdbba,_0x28292a){return function(_0x47ac8e){if(_0x47ac8e){return _0x47ac8e['destroy']()[_0xa949('0x23')](function(){_0x2cdbba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bbb69,_0x44c4c7){return function(_0x4818de){if(!_0x4818de){_0x4bbb69[_0xa949('0x16')](0x194);}return _0x4818de;};}function handleError(_0x4d3a2d,_0x5d58af){_0x5d58af=_0x5d58af||0x1f4;return function(_0x359a47){logger['error'](_0x359a47[_0xa949('0x24')]);if(_0x359a47['name']){delete _0x359a47[_0xa949('0x25')];}_0x4d3a2d[_0xa949('0x17')](_0x5d58af)[_0xa949('0x26')](_0x359a47);};}exports[_0xa949('0x27')]=function(_0x4e4c01,_0x2a1fea){var _0x1a85c3={},_0x45bfd9={},_0x3f0932={'count':0x0,'rows':[]};var _0xe9ebd6=_[_0xa949('0x28')](db[_0xa949('0x29')][_0xa949('0x2a')],function(_0x19a5e0){return{'name':_0x19a5e0[_0xa949('0x2b')],'type':_0x19a5e0[_0xa949('0x2c')]['key']};});_0x45bfd9[_0xa949('0x2d')]=_['map'](_0xe9ebd6,_0xa949('0x25'));_0x45bfd9[_0xa949('0x2e')]=_[_0xa949('0x2f')](_0x4e4c01[_0xa949('0x2e')]);_0x45bfd9[_0xa949('0x30')]=_[_0xa949('0x31')](_0x45bfd9[_0xa949('0x2d')],_0x45bfd9['query']);_0x1a85c3['attributes']=_[_0xa949('0x31')](_0x45bfd9['model'],qs[_0xa949('0x32')](_0x4e4c01[_0xa949('0x2e')]['fields']));_0x1a85c3['attributes']=_0x1a85c3[_0xa949('0x33')][_0xa949('0x34')]?_0x1a85c3[_0xa949('0x33')]:_0x45bfd9['model'];if(!_0x4e4c01[_0xa949('0x2e')][_0xa949('0x35')](_0xa949('0x36'))){_0x1a85c3[_0xa949('0x1a')]=qs[_0xa949('0x1a')](_0x4e4c01['query'][_0xa949('0x1a')]);_0x1a85c3[_0xa949('0x19')]=qs['offset'](_0x4e4c01[_0xa949('0x2e')][_0xa949('0x19')]);}_0x1a85c3[_0xa949('0x37')]=qs['sort'](_0x4e4c01['query'][_0xa949('0x38')]);_0x1a85c3[_0xa949('0x39')]=qs[_0xa949('0x30')](_[_0xa949('0x3a')](_0x4e4c01[_0xa949('0x2e')],_0x45bfd9[_0xa949('0x30')]),_0xe9ebd6);if(_0x4e4c01[_0xa949('0x2e')][_0xa949('0x3b')]){_0x1a85c3[_0xa949('0x39')]=_[_0xa949('0x3c')](_0x1a85c3['where'],{'$or':_[_0xa949('0x28')](_0xe9ebd6,function(_0xe328d2){if(_0xe328d2[_0xa949('0x2c')]!==_0xa949('0x3d')){var _0x3ffe5f={};_0x3ffe5f[_0xe328d2[_0xa949('0x25')]]={'$like':'%'+_0x4e4c01[_0xa949('0x2e')]['filter']+'%'};return _0x3ffe5f;}})});}_0x1a85c3=_[_0xa949('0x3c')]({},_0x1a85c3,_0x4e4c01['options']);var _0xd596f8={'where':_0x1a85c3[_0xa949('0x39')]};return db[_0xa949('0x29')][_0xa949('0x1b')](_0xd596f8)[_0xa949('0x23')](function(_0x2a1bd6){_0x3f0932['count']=_0x2a1bd6;if(_0x4e4c01[_0xa949('0x2e')]['includeAll']){_0x1a85c3['include']=[{'all':!![]}];}return db[_0xa949('0x29')][_0xa949('0x3e')](_0x1a85c3);})[_0xa949('0x23')](function(_0x4277dd){_0x3f0932[_0xa949('0x3f')]=_0x4277dd;return _0x3f0932;})[_0xa949('0x23')](respondWithFilteredResult(_0x2a1fea,_0x1a85c3))['catch'](handleError(_0x2a1fea,null));};exports[_0xa949('0x40')]=function(_0x1716ac,_0x338e0b){var _0x7d0b09={'raw':!![],'where':{'id':_0x1716ac[_0xa949('0x41')]['id']}},_0x530382={};_0x530382['model']=_[_0xa949('0x2f')](db['VoiceDialReport'][_0xa949('0x2a')]);_0x530382[_0xa949('0x2e')]=_['keys'](_0x1716ac['query']);_0x530382[_0xa949('0x30')]=_['intersection'](_0x530382[_0xa949('0x2d')],_0x530382[_0xa949('0x2e')]);_0x7d0b09['attributes']=_['intersection'](_0x530382[_0xa949('0x2d')],qs[_0xa949('0x32')](_0x1716ac[_0xa949('0x2e')][_0xa949('0x32')]));_0x7d0b09['attributes']=_0x7d0b09[_0xa949('0x33')][_0xa949('0x34')]?_0x7d0b09['attributes']:_0x530382[_0xa949('0x2d')];if(_0x1716ac[_0xa949('0x2e')][_0xa949('0x42')]){_0x7d0b09[_0xa949('0x43')]=[{'all':!![]}];}_0x7d0b09=_['merge']({},_0x7d0b09,_0x1716ac['options']);return db[_0xa949('0x29')][_0xa949('0x44')](_0x7d0b09)[_0xa949('0x23')](handleEntityNotFound(_0x338e0b,null))[_0xa949('0x23')](respondWithResult(_0x338e0b,null))[_0xa949('0x45')](handleError(_0x338e0b,null));};exports[_0xa949('0x46')]=function(_0x2b4910,_0x236afb){return db[_0xa949('0x29')][_0xa949('0x46')](_0x2b4910[_0xa949('0x47')],{})[_0xa949('0x23')](respondWithResult(_0x236afb,0xc9))['catch'](handleError(_0x236afb,null));};exports[_0xa949('0x22')]=function(_0x515a28,_0x467b55){if(_0x515a28[_0xa949('0x47')]['id']){delete _0x515a28[_0xa949('0x47')]['id'];}return db[_0xa949('0x29')][_0xa949('0x44')]({'where':{'id':_0x515a28[_0xa949('0x41')]['id']}})[_0xa949('0x23')](handleEntityNotFound(_0x467b55,null))[_0xa949('0x23')](saveUpdates(_0x515a28[_0xa949('0x47')],null))[_0xa949('0x23')](respondWithResult(_0x467b55,null))[_0xa949('0x45')](handleError(_0x467b55,null));};exports[_0xa949('0x48')]=function(_0x217ef3,_0x3981dd){return db['VoiceDialReport'][_0xa949('0x44')]({'where':{'id':_0x217ef3[_0xa949('0x41')]['id']}})[_0xa949('0x23')](handleEntityNotFound(_0x3981dd,null))['then'](removeEntity(_0x3981dd,null))[_0xa949('0x45')](handleError(_0x3981dd,null));};exports[_0xa949('0x49')]=function(_0x518247,_0x607570){return db[_0xa949('0x29')][_0xa949('0x49')]()['then'](respondWithResult(_0x607570,null))[_0xa949('0x45')](handleError(_0x607570,null));}; \ No newline at end of file +var _0xefe0=['attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceDialReport','includeAll','findAll','rows','catch','show','rawAttributes','fields','length','include','find','create','body','params','describe','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','fieldName','key','model','keys','query','filters','intersection'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xefe0,0x67));var _0x0efe=function(_0x392be3,_0xf1d603){_0x392be3=_0x392be3-0x0;var _0x1453b2=_0xefe0[_0x392be3];return _0x1453b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0efe('0x0'));var zipdir=require(_0x0efe('0x1'));var jsonpatch=require(_0x0efe('0x2'));var rp=require(_0x0efe('0x3'));var moment=require(_0x0efe('0x4'));var BPromise=require(_0x0efe('0x5'));var Mustache=require(_0x0efe('0x6'));var util=require(_0x0efe('0x7'));var path=require(_0x0efe('0x8'));var sox=require(_0x0efe('0x9'));var csv=require('to-csv');var ejs=require(_0x0efe('0xa'));var fs=require('fs');var fs_extra=require(_0x0efe('0xb'));var _=require(_0x0efe('0xc'));var squel=require(_0x0efe('0xd'));var crypto=require(_0x0efe('0xe'));var jsforce=require(_0x0efe('0xf'));var deskjs=require(_0x0efe('0x10'));var toCsv=require(_0x0efe('0x11'));var querystring=require('querystring');var Papa=require(_0x0efe('0x12'));var Redis=require(_0x0efe('0x13'));var authService=require(_0x0efe('0x14'));var qs=require(_0x0efe('0x15'));var as=require(_0x0efe('0x16'));var hardwareService=require(_0x0efe('0x17'));var logger=require(_0x0efe('0x18'))('api');var utils=require(_0x0efe('0x19'));var config=require(_0x0efe('0x1a'));var licenseUtil=require(_0x0efe('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbdd1f0,_0x17c904){_0x17c904=_0x17c904||0xcc;return function(_0x4a3aaf){if(_0x4a3aaf){return _0xbdd1f0[_0x0efe('0x1c')](_0x17c904);}return _0xbdd1f0[_0x0efe('0x1d')](_0x17c904)['end']();};}function respondWithResult(_0x56e4b6,_0xaef575){_0xaef575=_0xaef575||0xc8;return function(_0x385bd0){if(_0x385bd0){return _0x56e4b6[_0x0efe('0x1d')](_0xaef575)['json'](_0x385bd0);}};}function respondWithFilteredResult(_0x4629c6,_0xfb5af6){return function(_0x95b185){if(_0x95b185){var _0x54e1cb=typeof _0xfb5af6[_0x0efe('0x1e')]==='undefined'&&typeof _0xfb5af6[_0x0efe('0x1f')]==='undefined';var _0x340f8f=_0x95b185[_0x0efe('0x20')];var _0x32d377=_0x54e1cb?0x0:_0xfb5af6[_0x0efe('0x1e')];var _0x422163=_0x54e1cb?_0x95b185[_0x0efe('0x20')]:_0xfb5af6['offset']+_0xfb5af6[_0x0efe('0x1f')];var _0x34bd6f;if(_0x422163>=_0x340f8f){_0x422163=_0x340f8f;_0x34bd6f=0xc8;}else{_0x34bd6f=0xce;}_0x4629c6['status'](_0x34bd6f);return _0x4629c6[_0x0efe('0x21')](_0x0efe('0x22'),_0x32d377+'-'+_0x422163+'/'+_0x340f8f)['json'](_0x95b185);}return null;};}function patchUpdates(_0x47c31e){return function(_0x48ca70){try{jsonpatch['apply'](_0x48ca70,_0x47c31e,!![]);}catch(_0x650d03){return BPromise[_0x0efe('0x23')](_0x650d03);}return _0x48ca70[_0x0efe('0x24')]();};}function saveUpdates(_0xcb90c3,_0x1bfc73){return function(_0x48fb38){if(_0x48fb38){return _0x48fb38[_0x0efe('0x25')](_0xcb90c3)[_0x0efe('0x26')](function(_0x4733d4){return _0x4733d4;});}return null;};}function removeEntity(_0x4c5082,_0x170414){return function(_0x3dcffa){if(_0x3dcffa){return _0x3dcffa[_0x0efe('0x27')]()[_0x0efe('0x26')](function(){_0x4c5082['status'](0xcc)[_0x0efe('0x28')]();});}};}function handleEntityNotFound(_0x2d27d5,_0x5f21d5){return function(_0x1f1671){if(!_0x1f1671){_0x2d27d5['sendStatus'](0x194);}return _0x1f1671;};}function handleError(_0x4f76c6,_0x4f539a){_0x4f539a=_0x4f539a||0x1f4;return function(_0x23782a){logger[_0x0efe('0x29')](_0x23782a[_0x0efe('0x2a')]);if(_0x23782a[_0x0efe('0x2b')]){delete _0x23782a['name'];}_0x4f76c6[_0x0efe('0x1d')](_0x4f539a)['send'](_0x23782a);};}exports[_0x0efe('0x2c')]=function(_0x427cf8,_0x5a9283){var _0x42f26b={},_0x1dfa43={},_0x3576c1={'count':0x0,'rows':[]};var _0x241fe2=_[_0x0efe('0x2d')](db['VoiceDialReport']['rawAttributes'],function(_0x313edb){return{'name':_0x313edb[_0x0efe('0x2e')],'type':_0x313edb['type'][_0x0efe('0x2f')]};});_0x1dfa43[_0x0efe('0x30')]=_[_0x0efe('0x2d')](_0x241fe2,_0x0efe('0x2b'));_0x1dfa43['query']=_[_0x0efe('0x31')](_0x427cf8[_0x0efe('0x32')]);_0x1dfa43[_0x0efe('0x33')]=_[_0x0efe('0x34')](_0x1dfa43[_0x0efe('0x30')],_0x1dfa43[_0x0efe('0x32')]);_0x42f26b[_0x0efe('0x35')]=_[_0x0efe('0x34')](_0x1dfa43[_0x0efe('0x30')],qs['fields'](_0x427cf8['query']['fields']));_0x42f26b[_0x0efe('0x35')]=_0x42f26b[_0x0efe('0x35')]['length']?_0x42f26b[_0x0efe('0x35')]:_0x1dfa43[_0x0efe('0x30')];if(!_0x427cf8['query'][_0x0efe('0x36')]('nolimit')){_0x42f26b[_0x0efe('0x1f')]=qs[_0x0efe('0x1f')](_0x427cf8['query'][_0x0efe('0x1f')]);_0x42f26b[_0x0efe('0x1e')]=qs[_0x0efe('0x1e')](_0x427cf8['query'][_0x0efe('0x1e')]);}_0x42f26b[_0x0efe('0x37')]=qs[_0x0efe('0x38')](_0x427cf8[_0x0efe('0x32')][_0x0efe('0x38')]);_0x42f26b[_0x0efe('0x39')]=qs[_0x0efe('0x33')](_[_0x0efe('0x3a')](_0x427cf8['query'],_0x1dfa43['filters']),_0x241fe2);if(_0x427cf8[_0x0efe('0x32')][_0x0efe('0x3b')]){_0x42f26b[_0x0efe('0x39')]=_[_0x0efe('0x3c')](_0x42f26b['where'],{'$or':_[_0x0efe('0x2d')](_0x241fe2,function(_0x543498){if(_0x543498['type']!==_0x0efe('0x3d')){var _0x4bda78={};_0x4bda78[_0x543498[_0x0efe('0x2b')]]={'$like':'%'+_0x427cf8['query'][_0x0efe('0x3b')]+'%'};return _0x4bda78;}})});}_0x42f26b=_['merge']({},_0x42f26b,_0x427cf8[_0x0efe('0x3e')]);var _0x37e8bb={'where':_0x42f26b['where']};return db[_0x0efe('0x3f')][_0x0efe('0x20')](_0x37e8bb)[_0x0efe('0x26')](function(_0x4d7af8){_0x3576c1['count']=_0x4d7af8;if(_0x427cf8[_0x0efe('0x32')][_0x0efe('0x40')]){_0x42f26b['include']=[{'all':!![]}];}return db[_0x0efe('0x3f')][_0x0efe('0x41')](_0x42f26b);})['then'](function(_0x3ea1b1){_0x3576c1[_0x0efe('0x42')]=_0x3ea1b1;return _0x3576c1;})[_0x0efe('0x26')](respondWithFilteredResult(_0x5a9283,_0x42f26b))[_0x0efe('0x43')](handleError(_0x5a9283,null));};exports[_0x0efe('0x44')]=function(_0x523d3f,_0x4b443c){var _0x390ab6={'raw':!![],'where':{'id':_0x523d3f['params']['id']}},_0x27bc1b={};_0x27bc1b[_0x0efe('0x30')]=_['keys'](db[_0x0efe('0x3f')][_0x0efe('0x45')]);_0x27bc1b[_0x0efe('0x32')]=_[_0x0efe('0x31')](_0x523d3f['query']);_0x27bc1b[_0x0efe('0x33')]=_[_0x0efe('0x34')](_0x27bc1b['model'],_0x27bc1b['query']);_0x390ab6['attributes']=_[_0x0efe('0x34')](_0x27bc1b['model'],qs['fields'](_0x523d3f[_0x0efe('0x32')][_0x0efe('0x46')]));_0x390ab6[_0x0efe('0x35')]=_0x390ab6['attributes'][_0x0efe('0x47')]?_0x390ab6['attributes']:_0x27bc1b[_0x0efe('0x30')];if(_0x523d3f[_0x0efe('0x32')][_0x0efe('0x40')]){_0x390ab6[_0x0efe('0x48')]=[{'all':!![]}];}_0x390ab6=_[_0x0efe('0x3c')]({},_0x390ab6,_0x523d3f[_0x0efe('0x3e')]);return db['VoiceDialReport'][_0x0efe('0x49')](_0x390ab6)[_0x0efe('0x26')](handleEntityNotFound(_0x4b443c,null))[_0x0efe('0x26')](respondWithResult(_0x4b443c,null))[_0x0efe('0x43')](handleError(_0x4b443c,null));};exports[_0x0efe('0x4a')]=function(_0x58aebb,_0x1165c1){return db[_0x0efe('0x3f')][_0x0efe('0x4a')](_0x58aebb['body'],{})[_0x0efe('0x26')](respondWithResult(_0x1165c1,0xc9))['catch'](handleError(_0x1165c1,null));};exports['update']=function(_0x1d75b2,_0x1889ca){if(_0x1d75b2[_0x0efe('0x4b')]['id']){delete _0x1d75b2[_0x0efe('0x4b')]['id'];}return db[_0x0efe('0x3f')][_0x0efe('0x49')]({'where':{'id':_0x1d75b2['params']['id']}})[_0x0efe('0x26')](handleEntityNotFound(_0x1889ca,null))[_0x0efe('0x26')](saveUpdates(_0x1d75b2[_0x0efe('0x4b')],null))['then'](respondWithResult(_0x1889ca,null))[_0x0efe('0x43')](handleError(_0x1889ca,null));};exports[_0x0efe('0x27')]=function(_0x12a8e4,_0x1c3d6b){return db[_0x0efe('0x3f')][_0x0efe('0x49')]({'where':{'id':_0x12a8e4[_0x0efe('0x4c')]['id']}})[_0x0efe('0x26')](handleEntityNotFound(_0x1c3d6b,null))[_0x0efe('0x26')](removeEntity(_0x1c3d6b,null))[_0x0efe('0x43')](handleError(_0x1c3d6b,null));};exports[_0x0efe('0x4d')]=function(_0x177134,_0x16408b){return db['VoiceDialReport'][_0x0efe('0x4d')]()['then'](respondWithResult(_0x16408b,null))[_0x0efe('0x43')](handleError(_0x16408b,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 587771c..9c5351d 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 _0x24bf=['bluebird','request-promise','path','../../config/environment','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x1ded35,_0x48b9b6){var _0x169b3d=function(_0xb6c8a3){while(--_0xb6c8a3){_0x1ded35['push'](_0x1ded35['shift']());}};_0x169b3d(++_0x48b9b6);}(_0x24bf,0xee));var _0xf24b=function(_0x18443a,_0x1fbf92){_0x18443a=_0x18443a-0x0;var _0x351570=_0x24bf[_0x18443a];return _0x351570;};'use strict';var _=require(_0xf24b('0x0'));var util=require(_0xf24b('0x1'));var logger=require(_0xf24b('0x2'))('api');var moment=require(_0xf24b('0x3'));var BPromise=require(_0xf24b('0x4'));var rp=require(_0xf24b('0x5'));var fs=require('fs');var path=require(_0xf24b('0x6'));var rimraf=require('rimraf');var config=require(_0xf24b('0x7'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x532bbe,_0x52a62e){return _0x532bbe['define'](_0xf24b('0x8'),attributes,{'tableName':_0xf24b('0x9'),'paranoid':![],'indexes':[{'fields':[_0xf24b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x23a6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash'];(function(_0x301778,_0x402ccf){var _0x1f8ea8=function(_0x3f7abc){while(--_0x3f7abc){_0x301778['push'](_0x301778['shift']());}};_0x1f8ea8(++_0x402ccf);}(_0x23a6,0xff));var _0x623a=function(_0x110d68,_0x59071a){_0x110d68=_0x110d68-0x0;var _0x3a70b1=_0x23a6[_0x110d68];return _0x3a70b1;};'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(_0x623a('0x8'));var config=require(_0x623a('0x9'));var attributes=require(_0x623a('0xa'));module[_0x623a('0xb')]=function(_0x2b679f,_0x53d83d){return _0x2b679f[_0x623a('0xc')](_0x623a('0xd'),attributes,{'tableName':_0x623a('0xe'),'paranoid':![],'indexes':[{'fields':[_0x623a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 001bf93..2dc519f 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 _0xec72=['debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','stringify','UpdateVoiceDialReport','update','body','where','attributes','limit','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent'];(function(_0x45c8b6,_0xe439ea){var _0x40e17a=function(_0x3519d4){while(--_0x3519d4){_0x45c8b6['push'](_0x45c8b6['shift']());}};_0x40e17a(++_0xe439ea);}(_0xec72,0xb4));var _0x2ec7=function(_0x5628bd,_0x39597f){_0x5628bd=_0x5628bd-0x0;var _0x1ce47f=_0xec72[_0x5628bd];return _0x1ce47f;};'use strict';var _=require('lodash');var util=require(_0x2ec7('0x0'));var moment=require('moment');var BPromise=require(_0x2ec7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ec7('0x2'))['db'];var utils=require(_0x2ec7('0x3'));var logger=require(_0x2ec7('0x4'))(_0x2ec7('0x5'));var config=require(_0x2ec7('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2ec7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45e720,_0x3976dd,_0xa7fbee){return new BPromise(function(_0x3cfc02,_0x2e1c7b){return client[_0x2ec7('0x8')](_0x45e720,_0xa7fbee)[_0x2ec7('0x9')](function(_0x271700){logger['info'](_0x2ec7('0xa'),_0x3976dd,_0x2ec7('0xb'));logger[_0x2ec7('0xc')](_0x2ec7('0xd'),_0x3976dd,_0x2ec7('0xb'),JSON['stringify'](_0x271700));if(_0x271700[_0x2ec7('0xe')]){if(_0x271700[_0x2ec7('0xe')][_0x2ec7('0xf')]===0x1f4){logger[_0x2ec7('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x3976dd,_0x271700['error'][_0x2ec7('0x10')]);return _0x2e1c7b(_0x271700[_0x2ec7('0xe')][_0x2ec7('0x10')]);}logger['error'](_0x2ec7('0xa'),_0x3976dd,_0x271700['error']['message']);return _0x3cfc02(_0x271700[_0x2ec7('0xe')][_0x2ec7('0x10')]);}else{logger[_0x2ec7('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x3976dd,'request\x20sent');_0x3cfc02(_0x271700[_0x2ec7('0x12')][_0x2ec7('0x10')]);}})[_0x2ec7('0x13')](function(_0x43a57c){logger[_0x2ec7('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x3976dd,_0x43a57c);_0x2e1c7b(_0x43a57c);});});}exports[_0x2ec7('0x14')]=function(_0x3a9b33){var _0x5caef9=this;return new Promise(function(_0x266cd2,_0x36860f){return db[_0x2ec7('0x15')][_0x2ec7('0x16')](_0x3a9b33['body'],{'raw':_0x3a9b33[_0x2ec7('0x17')]?_0x3a9b33[_0x2ec7('0x17')][_0x2ec7('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x408c07){logger['info'](_0x2ec7('0x14'),_0x3a9b33);logger['debug'](_0x2ec7('0x14'),_0x3a9b33,JSON[_0x2ec7('0x19')](_0x408c07));_0x266cd2(_0x408c07);})['catch'](function(_0xbb37ad){logger[_0x2ec7('0xe')](_0x2ec7('0x14'),_0xbb37ad[_0x2ec7('0x10')],_0x3a9b33);_0x36860f(_0x5caef9['error'](0x1f4,_0xbb37ad['message']));});});};exports[_0x2ec7('0x1a')]=function(_0x35321f){var _0x244654=this;return new Promise(function(_0x47a6e3,_0xdbbdef){return db[_0x2ec7('0x15')][_0x2ec7('0x1b')](_0x35321f[_0x2ec7('0x1c')],{'raw':_0x35321f[_0x2ec7('0x17')]?_0x35321f[_0x2ec7('0x17')][_0x2ec7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35321f[_0x2ec7('0x17')]?_0x35321f[_0x2ec7('0x17')][_0x2ec7('0x1d')]||null:null,'attributes':_0x35321f[_0x2ec7('0x17')]?_0x35321f[_0x2ec7('0x17')][_0x2ec7('0x1e')]||null:null,'limit':_0x35321f['options']?_0x35321f[_0x2ec7('0x17')][_0x2ec7('0x1f')]||null:null})[_0x2ec7('0x9')](function(_0x5192cb){logger[_0x2ec7('0x11')](_0x2ec7('0x1a'),_0x35321f);logger[_0x2ec7('0xc')](_0x2ec7('0x1a'),_0x35321f,JSON[_0x2ec7('0x19')](_0x5192cb));_0x47a6e3(_0x5192cb);})[_0x2ec7('0x13')](function(_0x2b6399){logger['error'](_0x2ec7('0x1a'),_0x2b6399[_0x2ec7('0x10')],_0x35321f);_0xdbbdef(_0x244654[_0x2ec7('0xe')](0x1f4,_0x2b6399[_0x2ec7('0x10')]));});});}; \ No newline at end of file +var _0x2ca8=['update','body','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','options','raw','catch','UpdateVoiceDialReport'];(function(_0xdaa456,_0x3dbbe5){var _0x288a4a=function(_0x4e4d5d){while(--_0x4e4d5d){_0xdaa456['push'](_0xdaa456['shift']());}};_0x288a4a(++_0x3dbbe5);}(_0x2ca8,0x184));var _0x82ca=function(_0x24af57,_0x3c14db){_0x24af57=_0x24af57-0x0;var _0x2e52fc=_0x2ca8[_0x24af57];return _0x2e52fc;};'use strict';var _=require(_0x82ca('0x0'));var util=require(_0x82ca('0x1'));var moment=require('moment');var BPromise=require(_0x82ca('0x2'));var rs=require(_0x82ca('0x3'));var fs=require('fs');var Redis=require(_0x82ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x82ca('0x5'));var logger=require(_0x82ca('0x6'))('rpc');var config=require(_0x82ca('0x7'));var jayson=require(_0x82ca('0x8'));var client=jayson[_0x82ca('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58254a,_0x4aec0a,_0x401f30){return new BPromise(function(_0x1a4046,_0x29bf9f){return client[_0x82ca('0xa')](_0x58254a,_0x401f30)[_0x82ca('0xb')](function(_0x5743f4){logger[_0x82ca('0xc')](_0x82ca('0xd'),_0x4aec0a,_0x82ca('0xe'));logger[_0x82ca('0xf')](_0x82ca('0x10'),_0x4aec0a,'request\x20sent',JSON[_0x82ca('0x11')](_0x5743f4));if(_0x5743f4['error']){if(_0x5743f4[_0x82ca('0x12')][_0x82ca('0x13')]===0x1f4){logger[_0x82ca('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x4aec0a,_0x5743f4[_0x82ca('0x12')][_0x82ca('0x14')]);return _0x29bf9f(_0x5743f4[_0x82ca('0x12')]['message']);}logger[_0x82ca('0x12')](_0x82ca('0xd'),_0x4aec0a,_0x5743f4[_0x82ca('0x12')][_0x82ca('0x14')]);return _0x1a4046(_0x5743f4[_0x82ca('0x12')][_0x82ca('0x14')]);}else{logger['info'](_0x82ca('0xd'),_0x4aec0a,_0x82ca('0xe'));_0x1a4046(_0x5743f4[_0x82ca('0x15')][_0x82ca('0x14')]);}})['catch'](function(_0x443616){logger['error'](_0x82ca('0xd'),_0x4aec0a,_0x443616);_0x29bf9f(_0x443616);});});}exports[_0x82ca('0x16')]=function(_0x34fa62){var _0xe0e843=this;return new Promise(function(_0x3c62ca,_0x52ccfd){return db[_0x82ca('0x17')]['create'](_0x34fa62['body'],{'raw':_0x34fa62[_0x82ca('0x18')]?_0x34fa62['options'][_0x82ca('0x19')]===undefined?!![]:![]:!![]})[_0x82ca('0xb')](function(_0x17b8c7){logger[_0x82ca('0xc')]('CreateVoiceDialReport',_0x34fa62);logger[_0x82ca('0xf')](_0x82ca('0x16'),_0x34fa62,JSON['stringify'](_0x17b8c7));_0x3c62ca(_0x17b8c7);})[_0x82ca('0x1a')](function(_0x5b3ddc){logger[_0x82ca('0x12')](_0x82ca('0x16'),_0x5b3ddc[_0x82ca('0x14')],_0x34fa62);_0x52ccfd(_0xe0e843[_0x82ca('0x12')](0x1f4,_0x5b3ddc[_0x82ca('0x14')]));});});};exports[_0x82ca('0x1b')]=function(_0x147eee){var _0x2b8413=this;return new Promise(function(_0x3b9800,_0x2929fe){return db[_0x82ca('0x17')][_0x82ca('0x1c')](_0x147eee[_0x82ca('0x1d')],{'raw':_0x147eee[_0x82ca('0x18')]?_0x147eee[_0x82ca('0x18')][_0x82ca('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x147eee['options']?_0x147eee['options']['where']||null:null,'attributes':_0x147eee[_0x82ca('0x18')]?_0x147eee[_0x82ca('0x18')][_0x82ca('0x1e')]||null:null,'limit':_0x147eee['options']?_0x147eee[_0x82ca('0x18')][_0x82ca('0x1f')]||null:null})['then'](function(_0x47682a){logger['info']('UpdateVoiceDialReport',_0x147eee);logger[_0x82ca('0xf')]('UpdateVoiceDialReport',_0x147eee,JSON[_0x82ca('0x11')](_0x47682a));_0x3b9800(_0x47682a);})['catch'](function(_0x3935e3){logger[_0x82ca('0x12')](_0x82ca('0x1b'),_0x3935e3['message'],_0x147eee);_0x2929fe(_0x2b8413[_0x82ca('0x12')](0x1f4,_0x3935e3[_0x82ca('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index aae63bd..cc407d0 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 _0x95fc=['index','get','/:id','show','post','create','/:id/applications','addApplications','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./voiceExtension.controller','isAuthenticated'];(function(_0x2d5cf4,_0x3eb179){var _0xa76a3b=function(_0xc8681d){while(--_0xc8681d){_0x2d5cf4['push'](_0x2d5cf4['shift']());}};_0xa76a3b(++_0x3eb179);}(_0x95fc,0x8a));var _0xc95f=function(_0x5935ff,_0x3014c3){_0x5935ff=_0x5935ff-0x0;var _0xdb9054=_0x95fc[_0x5935ff];return _0xdb9054;};'use strict';var multer=require(_0xc95f('0x0'));var util=require(_0xc95f('0x1'));var path=require(_0xc95f('0x2'));var timeout=require(_0xc95f('0x3'));var express=require('express');var router=express[_0xc95f('0x4')]();var fs_extra=require(_0xc95f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc95f('0x6'));var controller=require(_0xc95f('0x7'));router['get']('/',auth[_0xc95f('0x8')](),controller[_0xc95f('0x9')]);router[_0xc95f('0xa')](_0xc95f('0xb'),auth[_0xc95f('0x8')](),controller[_0xc95f('0xc')]);router[_0xc95f('0xd')]('/',auth['isAuthenticated'](),controller[_0xc95f('0xe')]);router['post'](_0xc95f('0xf'),auth[_0xc95f('0x8')](),controller[_0xc95f('0x10')]);router[_0xc95f('0x11')](_0xc95f('0xb'),auth['isAuthenticated'](),controller[_0xc95f('0x12')]);router['delete'](_0xc95f('0xb'),auth[_0xc95f('0x8')](),controller[_0xc95f('0x13')]);module[_0xc95f('0x14')]=router; \ No newline at end of file +var _0x7764=['post','create','/:id/applications','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show'];(function(_0x3d1547,_0x205a44){var _0x51a694=function(_0x2f0ec5){while(--_0x2f0ec5){_0x3d1547['push'](_0x3d1547['shift']());}};_0x51a694(++_0x205a44);}(_0x7764,0x198));var _0x4776=function(_0x3a9635,_0x1ab817){_0x3a9635=_0x3a9635-0x0;var _0x10d08c=_0x7764[_0x3a9635];return _0x10d08c;};'use strict';var multer=require('multer');var util=require(_0x4776('0x0'));var path=require(_0x4776('0x1'));var timeout=require('connect-timeout');var express=require(_0x4776('0x2'));var router=express[_0x4776('0x3')]();var fs_extra=require(_0x4776('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4776('0x5'));var config=require(_0x4776('0x6'));var controller=require('./voiceExtension.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4776('0x7')]);router[_0x4776('0x8')](_0x4776('0x9'),auth[_0x4776('0xa')](),controller[_0x4776('0xb')]);router[_0x4776('0xc')]('/',auth[_0x4776('0xa')](),controller[_0x4776('0xd')]);router[_0x4776('0xc')](_0x4776('0xe'),auth[_0x4776('0xa')](),controller['addApplications']);router[_0x4776('0xf')]('/:id',auth[_0x4776('0xa')](),controller[_0x4776('0x10')]);router[_0x4776('0x11')]('/:id',auth[_0x4776('0xa')](),controller[_0x4776('0x12')]);module[_0x4776('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 67fd211..10b6b4e 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 _0xf34b=['outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exports','STRING','compositeIndex','NoOp','ENUM','inbound'];(function(_0x35a5ef,_0x3c11af){var _0x13b595=function(_0x4ca6ae){while(--_0x4ca6ae){_0x35a5ef['push'](_0x35a5ef['shift']());}};_0x13b595(++_0x3c11af);}(_0xf34b,0xc0));var _0xbf34=function(_0x568a25,_0x138e4b){_0x568a25=_0x568a25-0x0;var _0x40646e=_0xf34b[_0x568a25];return _0x40646e;};'use strict';var Sequelize=require('sequelize');module[_0xbf34('0x0')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xbf34('0x1')],'allowNull':![],'unique':_0xbf34('0x2')},'priority':{'type':Sequelize[_0xbf34('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xbf34('0x2')},'tag':{'type':Sequelize[_0xbf34('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xbf34('0x1')],'allowNull':![],'defaultValue':_0xbf34('0x3')},'appdata':{'type':Sequelize[_0xbf34('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xbf34('0x4')](_0xbf34('0x5'),_0xbf34('0x6'),_0xbf34('0x7'),_0xbf34('0x8'),_0xbf34('0x9'),_0xbf34('0xa'),_0xbf34('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xbf34('0x1')]},'interval':{'type':Sequelize[_0xbf34('0x1')],'allowNull':![],'defaultValue':_0xbf34('0xc')},'IntervalId':{'type':Sequelize[_0xbf34('0xd')]},'isApp':{'type':Sequelize[_0xbf34('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xbf34('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xbf34('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xbf34('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xbf34('0x1')],'defaultValue':_0xbf34('0xf')},'answer':{'type':Sequelize[_0xbf34('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0xbf34('0x10')],'get':function(_0xbb63ee){return this[_0xbf34('0x11')]('exten');}},'alias':{'type':Sequelize[_0xbf34('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x19b3=['STRING','NoOp','ENUM','inbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex'];(function(_0xe2a1aa,_0x525d7b){var _0x5a8362=function(_0x39aece){while(--_0x39aece){_0xe2a1aa['push'](_0xe2a1aa['shift']());}};_0x5a8362(++_0x525d7b);}(_0x19b3,0x1d8));var _0x319b=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0x19b3[_0x2a67fe];return _0x57e726;};'use strict';var Sequelize=require(_0x319b('0x0'));module[_0x319b('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x319b('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x319b('0x3')],'allowNull':![],'unique':_0x319b('0x2')},'priority':{'type':Sequelize[_0x319b('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x319b('0x2')},'tag':{'type':Sequelize[_0x319b('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x319b('0x3')],'allowNull':![],'defaultValue':_0x319b('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x319b('0x5')](_0x319b('0x6'),'outbound',_0x319b('0x7'),_0x319b('0x8'),_0x319b('0x9'),_0x319b('0xa'),_0x319b('0xb')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x319b('0x3')],'allowNull':![],'defaultValue':_0x319b('0xc')},'IntervalId':{'type':Sequelize[_0x319b('0xd')]},'isApp':{'type':Sequelize[_0x319b('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x319b('0x3')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x319b('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x319b('0xd')]},'recordingFormat':{'type':Sequelize[_0x319b('0x3')],'defaultValue':_0x319b('0xf')},'answer':{'type':Sequelize[_0x319b('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0x319b('0x10')],'get':function(_0x5902b0){return this[_0x319b('0x11')](_0x319b('0x12'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index e9827c8..dd13ec3 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 _0x58d4=['lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./voiceExtension.socket','register','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','destroy','then','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','type','find','name','UserProfileResource','error','stack','send','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','VoiceExtension','include','findAll','params','includeAll','catch','body','startsWith','exten','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','update','description','mandatoryDisposition','alias','context','Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','isApp','createRouting','findAndCountAll','finally'];(function(_0x2ad4b3,_0x229270){var _0x2d4430=function(_0xfda9ea){while(--_0xfda9ea){_0x2ad4b3['push'](_0x2ad4b3['shift']());}};_0x2d4430(++_0x229270);}(_0x58d4,0x160));var _0x458d=function(_0x53f538,_0x59872b){_0x53f538=_0x53f538-0x0;var _0x75a29a=_0x58d4[_0x53f538];return _0x75a29a;};'use strict';var _=require(_0x458d('0x0'));var Redis=require(_0x458d('0x1'));var qs=require(_0x458d('0x2'));var logger=require(_0x458d('0x3'))(_0x458d('0x4'));var config=require(_0x458d('0x5'));var db=require(_0x458d('0x6'))['db'];config[_0x458d('0x7')]=_['defaults'](config[_0x458d('0x7')],{'host':_0x458d('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x458d('0x7')]));require(_0x458d('0x9'))[_0x458d('0xa')](socket);function respondWithStatusCode(_0xd3755f,_0x5985ff){_0x5985ff=_0x5985ff||0xcc;return function(_0x332439){if(_0x332439){return _0xd3755f[_0x458d('0xb')](_0x5985ff);}return _0xd3755f['status'](_0x5985ff)[_0x458d('0xc')]();};}function respondWithResult(_0x35e3b5,_0x26e3cc){_0x26e3cc=_0x26e3cc||0xc8;return function(_0x3e7588){if(_0x3e7588){return _0x35e3b5[_0x458d('0xd')](_0x26e3cc)['json'](_0x3e7588);}};}function respondWithFilteredResult(_0x389e4b,_0x5af81e){return function(_0x4e2fea){if(_0x4e2fea){var _0x1f7661=typeof _0x5af81e[_0x458d('0xe')]==='undefined'&&typeof _0x5af81e[_0x458d('0xf')]===_0x458d('0x10');var _0x2c791c=_0x4e2fea[_0x458d('0x11')];var _0x3307c6=_0x1f7661?0x0:_0x5af81e['offset'];var _0x443a5f=_0x1f7661?_0x4e2fea[_0x458d('0x11')]:_0x5af81e['offset']+_0x5af81e[_0x458d('0xf')];var _0x5d816e;if(_0x443a5f>=_0x2c791c){_0x443a5f=_0x2c791c;_0x5d816e=0xc8;}else{_0x5d816e=0xce;}_0x389e4b[_0x458d('0xd')](_0x5d816e);return _0x389e4b[_0x458d('0x12')](_0x458d('0x13'),_0x3307c6+'-'+_0x443a5f+'/'+_0x2c791c)[_0x458d('0x14')](_0x4e2fea);}return null;};}function removeEntity(_0x5334f9){return function(_0x1b6003){if(_0x1b6003){return _0x1b6003[_0x458d('0x15')]()[_0x458d('0x16')](function(){var _0x584001=_0x1b6003[_0x458d('0x17')]({'plain':!![]});var _0x2bd1c8=[{'name':'InboundRoutes','value':_0x458d('0x18'),'ignore':![]},{'name':_0x458d('0x19'),'value':_0x458d('0x1a'),'ignore':![]},{'name':_0x458d('0x1b'),'value':_0x458d('0x1c'),'ignore':![]}];var _0x303145=_(_0x2bd1c8)[_0x458d('0x1d')]('ignore')[_0x458d('0x1e')](_0x458d('0x1f'))['value']();if(_['includes'](_0x303145,_0x584001[_0x458d('0x20')])){return;}var _0x125545=_[_0x458d('0x21')](_0x2bd1c8,[_0x458d('0x1f'),_0x584001[_0x458d('0x20')]])[_0x458d('0x22')];return db[_0x458d('0x23')]['destroy']({'where':{'type':_0x125545,'resourceId':_0x584001['id']}})[_0x458d('0x16')](function(){return _0x1b6003;});})[_0x458d('0x16')](function(){_0x5334f9[_0x458d('0xd')](0xcc)[_0x458d('0xc')]();});}};}function handleEntityNotFound(_0x1dba78){return function(_0x20d8f1){if(!_0x20d8f1){_0x1dba78[_0x458d('0xb')](0x194);}return _0x20d8f1;};}function handleError(_0x4cbcc8,_0x165a07){_0x165a07=_0x165a07||0x1f4;return function(_0x4426dd){logger[_0x458d('0x24')](_0x4426dd[_0x458d('0x25')]);if(_0x4426dd[_0x458d('0x22')]){delete _0x4426dd[_0x458d('0x22')];}_0x4cbcc8[_0x458d('0xd')](_0x165a07)[_0x458d('0x26')](_0x4426dd);};}exports['index']=function(_0x17dd6b,_0x4e003a){var _0x1fb381={},_0x166599={},_0x3ca718={'count':0x0,'rows':[]};var _0x4f053f=_[_0x458d('0x1e')](db['VoiceExtension'][_0x458d('0x27')],function(_0x4bfc8f){return{'name':_0x4bfc8f['fieldName'],'type':_0x4bfc8f['type'][_0x458d('0x28')]};});_0x166599[_0x458d('0x29')]=_[_0x458d('0x1e')](_0x4f053f,_0x458d('0x22'));_0x166599[_0x458d('0x2a')]=_[_0x458d('0x2b')](_0x17dd6b['query']);_0x166599['filters']=_[_0x458d('0x2c')](_0x166599[_0x458d('0x29')],_0x166599[_0x458d('0x2a')]);_0x1fb381[_0x458d('0x2d')]=_[_0x458d('0x2c')](_0x166599[_0x458d('0x29')],qs[_0x458d('0x2e')](_0x17dd6b[_0x458d('0x2a')]['fields']));_0x1fb381['attributes']=_0x1fb381[_0x458d('0x2d')][_0x458d('0x2f')]?_0x1fb381['attributes']:_0x166599[_0x458d('0x29')];if(!_0x17dd6b['query'][_0x458d('0x30')](_0x458d('0x31'))){_0x1fb381['limit']=qs[_0x458d('0xf')](_0x17dd6b[_0x458d('0x2a')][_0x458d('0xf')]);_0x1fb381[_0x458d('0xe')]=qs[_0x458d('0xe')](_0x17dd6b[_0x458d('0x2a')]['offset']);}_0x1fb381[_0x458d('0x32')]=qs[_0x458d('0x33')](_0x17dd6b['query']['sort']);_0x1fb381[_0x458d('0x34')]=qs[_0x458d('0x35')](_[_0x458d('0x36')](_0x17dd6b[_0x458d('0x2a')],_0x166599[_0x458d('0x35')]),_0x4f053f);if(_0x17dd6b[_0x458d('0x2a')][_0x458d('0x1d')]){_0x1fb381[_0x458d('0x34')]=_[_0x458d('0x37')](_0x1fb381[_0x458d('0x34')],{'$or':_[_0x458d('0x1e')](_0x4f053f,function(_0x408c5e){if(_0x408c5e[_0x458d('0x20')]!==_0x458d('0x38')){var _0x2d6886={};_0x2d6886[_0x408c5e[_0x458d('0x22')]]={'$like':'%'+_0x17dd6b['query']['filter']+'%'};return _0x2d6886;}})});}_0x1fb381=_[_0x458d('0x37')]({},_0x1fb381,_0x17dd6b[_0x458d('0x39')]);var _0x20c50f={'where':_0x1fb381[_0x458d('0x34')]};return db[_0x458d('0x3a')][_0x458d('0x11')](_0x20c50f)[_0x458d('0x16')](function(_0x23f9a3){_0x3ca718[_0x458d('0x11')]=_0x23f9a3;if(_0x17dd6b[_0x458d('0x2a')]['includeAll']){_0x1fb381[_0x458d('0x3b')]=[{'all':!![]}];}return db[_0x458d('0x3a')][_0x458d('0x3c')](_0x1fb381);})[_0x458d('0x16')](function(_0x1eb2a8){_0x3ca718['rows']=_0x1eb2a8;return _0x3ca718;})[_0x458d('0x16')](respondWithFilteredResult(_0x4e003a,_0x1fb381))['catch'](handleError(_0x4e003a,null));};exports['show']=function(_0x9835b,_0x531b81){var _0x570dd4={'raw':![],'where':{'id':_0x9835b[_0x458d('0x3d')]['id']}},_0x19996a={};_0x19996a[_0x458d('0x29')]=_[_0x458d('0x2b')](db[_0x458d('0x3a')]['rawAttributes']);_0x19996a['query']=_[_0x458d('0x2b')](_0x9835b[_0x458d('0x2a')]);_0x19996a[_0x458d('0x35')]=_[_0x458d('0x2c')](_0x19996a[_0x458d('0x29')],_0x19996a[_0x458d('0x2a')]);_0x570dd4['attributes']=_[_0x458d('0x2c')](_0x19996a[_0x458d('0x29')],qs[_0x458d('0x2e')](_0x9835b['query'][_0x458d('0x2e')]));_0x570dd4[_0x458d('0x2d')]=_0x570dd4['attributes'][_0x458d('0x2f')]?_0x570dd4[_0x458d('0x2d')]:_0x19996a[_0x458d('0x29')];if(_0x9835b[_0x458d('0x2a')][_0x458d('0x3e')]){_0x570dd4[_0x458d('0x3b')]=[{'all':!![]}];}_0x570dd4=_['merge']({},_0x570dd4,_0x9835b['options']);return db[_0x458d('0x3a')]['find'](_0x570dd4)[_0x458d('0x16')](handleEntityNotFound(_0x531b81,null))['then'](respondWithResult(_0x531b81,null))[_0x458d('0x3f')](handleError(_0x531b81,null));};exports[_0x458d('0x15')]=function(_0x37f954,_0x249c64){return db[_0x458d('0x3a')]['find']({'where':{'id':_0x37f954[_0x458d('0x3d')]['id']}})[_0x458d('0x16')](handleEntityNotFound(_0x249c64,null))[_0x458d('0x16')](removeEntity(_0x249c64,null))['catch'](handleError(_0x249c64,null));};exports['create']=function(_0x53ef74,_0x170e4c){if(_0x53ef74[_0x458d('0x40')]['type']===_0x458d('0x1a')&&!_[_0x458d('0x41')](_0x53ef74[_0x458d('0x40')]['exten'],'_')){_0x53ef74[_0x458d('0x40')][_0x458d('0x42')]='_'['concat'](_0x53ef74[_0x458d('0x40')][_0x458d('0x42')]);}return db['VoiceExtension'][_0x458d('0x43')](_0x53ef74['body'],{'raw':![]})[_0x458d('0x16')](function(_0x20bf3c){var _0x10f8f3=_0x53ef74[_0x458d('0x44')][_0x458d('0x17')]({'plain':!![]});if(!_0x10f8f3)throw new Error(_0x458d('0x45'));if(_0x10f8f3[_0x458d('0x46')]==='user'){var _0x963117=_0x20bf3c[_0x458d('0x17')]({'plain':!![]});var _0xbf0776=[{'name':_0x458d('0x47'),'value':'inbound'},{'name':_0x458d('0x19'),'value':_0x458d('0x1a')},{'name':_0x458d('0x1b'),'value':_0x458d('0x1c')}];var _0x56fb17=_[_0x458d('0x21')](_0xbf0776,['value',_0x963117[_0x458d('0x20')]])[_0x458d('0x22')];return db[_0x458d('0x48')][_0x458d('0x21')]({'where':{'name':_0x56fb17,'userProfileId':_0x10f8f3[_0x458d('0x49')]},'raw':!![]})[_0x458d('0x16')](function(_0x39ee79){if(_0x39ee79&&_0x39ee79[_0x458d('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x963117[_0x458d('0x22')],'resourceId':_0x963117['id'],'type':_0x39ee79['name'],'sectionId':_0x39ee79['id']},{})[_0x458d('0x16')](function(){return _0x20bf3c;});}else{return _0x20bf3c;}})['catch'](function(_0xec479){logger[_0x458d('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xec479);throw _0xec479;});}return _0x20bf3c;})[_0x458d('0x16')](respondWithResult(_0x170e4c,0xc9))[_0x458d('0x3f')](handleError(_0x170e4c,null));};exports['update']=function(_0x53cc81,_0x2e283f){if(_0x53cc81['body']['id']){delete _0x53cc81['body']['id'];}return db['VoiceExtension'][_0x458d('0x21')]({'where':{'id':_0x53cc81[_0x458d('0x3d')]['id']}})[_0x458d('0x16')](handleEntityNotFound(_0x2e283f,null))[_0x458d('0x16')](function(_0x3a6a37){if(_0x3a6a37){return db[_0x458d('0x3a')][_0x458d('0x4b')](_[_0x458d('0x36')](_0x53cc81[_0x458d('0x40')],[_0x458d('0x42'),'context',_0x458d('0x4c'),'recordingFormat','cutdigits',_0x458d('0x4d'),_0x458d('0x4e')]),{'where':{'context':_0x3a6a37[_0x458d('0x4f')],'exten':_0x3a6a37[_0x458d('0x42')]},'individualHooks':!![]})[_0x458d('0x16')](function(_0x1745e9){return _0x1745e9;});}return null;})[_0x458d('0x16')](respondWithStatusCode(_0x2e283f,null))[_0x458d('0x3f')](handleError(_0x2e283f,null));};exports['addApplications']=function(_0x1f6013,_0x34e09c){var _0x5b2ac8=_0x1f6013[_0x458d('0x3d')]['id'];var _0x24de93=_0x1f6013[_0x458d('0x40')];var _0x3f4627=0xc8;var _0x506bf2=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0x458d('0x50')][_0x458d('0x51')][_0x458d('0x52')]},function(_0x1911f0){return db['VoiceExtension']['findOne']({'where':{'id':_0x5b2ac8},'transaction':_0x1911f0})[_0x458d('0x16')](function(_0xf37025){if(_0xf37025){return db[_0x458d('0x3a')]['destroy']({'where':{'VoiceExtensionId':_0x5b2ac8},'transaction':_0x1911f0})[_0x458d('0x16')](function(){var _0x205d9c=_[_0x458d('0x1e')](_0x24de93,function(_0x1b968b){_0x1b968b[_0x458d('0x53')]=_0x5b2ac8;_0x1b968b[_0x458d('0x54')]=!![];return _0x1b968b;});return _0xf37025[_0x458d('0x55')](_0x205d9c);})[_0x458d('0x16')](function(_0x520756){return db[_0x458d('0x3a')]['bulkCreate'](_0x520756,{'transaction':_0x1911f0});});}else{_0x3f4627=0x194;_0x506bf2=[];}});})['then'](function(){if(_0x3f4627!==0x194){return db['VoiceExtension'][_0x458d('0x56')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5b2ac8},'order':'cast(priority\x20as\x20unsigned)'})[_0x458d('0x16')](function(_0x1be153){_0x506bf2=_0x1be153;});}})[_0x458d('0x3f')](function(_0x171578){_0x3f4627=0x1f4;logger['error'](_0x171578['stack']);if(_0x171578[_0x458d('0x22')]){delete _0x171578[_0x458d('0x22')];}_0x506bf2=_0x171578;})[_0x458d('0x57')](function(){if(_0x506bf2===null){_0x34e09c[_0x458d('0xb')](_0x3f4627);}else{if(_0x3f4627===0x1f4){_0x34e09c[_0x458d('0xd')](_0x3f4627)[_0x458d('0x26')](_0x506bf2);}else{_0x34e09c[_0x458d('0xd')](_0x3f4627)[_0x458d('0x14')](_0x506bf2);}}});}; \ No newline at end of file +var _0xe37d=['api','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','register','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','destroy','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','name','UserProfileResource','then','stack','index','VoiceExtension','fieldName','keys','filters','intersection','query','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','mandatoryDisposition','alias','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','createRouting','findAndCountAll','finally','send','lodash','../../components/parsers/qs','../../config/logger'];(function(_0x2217f9,_0xfc47aa){var _0x39ccbc=function(_0x313fb1){while(--_0x313fb1){_0x2217f9['push'](_0x2217f9['shift']());}};_0x39ccbc(++_0xfc47aa);}(_0xe37d,0x1b5));var _0xde37=function(_0x571d0a,_0x247e02){_0x571d0a=_0x571d0a-0x0;var _0x444d9a=_0xe37d[_0x571d0a];return _0x444d9a;};'use strict';var _=require(_0xde37('0x0'));var Redis=require('ioredis');var qs=require(_0xde37('0x1'));var logger=require(_0xde37('0x2'))(_0xde37('0x3'));var config=require('../../config/environment');var db=require(_0xde37('0x4'))['db'];config[_0xde37('0x5')]=_[_0xde37('0x6')](config[_0xde37('0x5')],{'host':_0xde37('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xde37('0x8'))[_0xde37('0x9')](socket);function respondWithStatusCode(_0x5be5bc,_0x23f718){_0x23f718=_0x23f718||0xcc;return function(_0x559828){if(_0x559828){return _0x5be5bc[_0xde37('0xa')](_0x23f718);}return _0x5be5bc['status'](_0x23f718)[_0xde37('0xb')]();};}function respondWithResult(_0x2c9b9b,_0x4790ad){_0x4790ad=_0x4790ad||0xc8;return function(_0x1b74c5){if(_0x1b74c5){return _0x2c9b9b[_0xde37('0xc')](_0x4790ad)['json'](_0x1b74c5);}};}function respondWithFilteredResult(_0x2a1bb7,_0x1c16d5){return function(_0x2ab225){if(_0x2ab225){var _0x46c0c9=typeof _0x1c16d5['offset']===_0xde37('0xd')&&typeof _0x1c16d5[_0xde37('0xe')]===_0xde37('0xd');var _0x48620d=_0x2ab225['count'];var _0x31b15d=_0x46c0c9?0x0:_0x1c16d5['offset'];var _0x5e5194=_0x46c0c9?_0x2ab225[_0xde37('0xf')]:_0x1c16d5[_0xde37('0x10')]+_0x1c16d5[_0xde37('0xe')];var _0x19063f;if(_0x5e5194>=_0x48620d){_0x5e5194=_0x48620d;_0x19063f=0xc8;}else{_0x19063f=0xce;}_0x2a1bb7[_0xde37('0xc')](_0x19063f);return _0x2a1bb7[_0xde37('0x11')](_0xde37('0x12'),_0x31b15d+'-'+_0x5e5194+'/'+_0x48620d)['json'](_0x2ab225);}return null;};}function removeEntity(_0x1f3dc5){return function(_0x23d1fe){if(_0x23d1fe){return _0x23d1fe[_0xde37('0x13')]()['then'](function(){var _0x4c182b=_0x23d1fe[_0xde37('0x14')]({'plain':!![]});var _0x1cec81=[{'name':'InboundRoutes','value':_0xde37('0x15'),'ignore':![]},{'name':_0xde37('0x16'),'value':_0xde37('0x17'),'ignore':![]},{'name':_0xde37('0x18'),'value':_0xde37('0x19'),'ignore':![]}];var _0x5734b0=_(_0x1cec81)[_0xde37('0x1a')](_0xde37('0x1b'))[_0xde37('0x1c')]('value')[_0xde37('0x1d')]();if(_[_0xde37('0x1e')](_0x5734b0,_0x4c182b['type'])){return;}var _0x47897c=_['find'](_0x1cec81,[_0xde37('0x1d'),_0x4c182b[_0xde37('0x1f')]])[_0xde37('0x20')];return db[_0xde37('0x21')][_0xde37('0x13')]({'where':{'type':_0x47897c,'resourceId':_0x4c182b['id']}})[_0xde37('0x22')](function(){return _0x23d1fe;});})[_0xde37('0x22')](function(){_0x1f3dc5['status'](0xcc)[_0xde37('0xb')]();});}};}function handleEntityNotFound(_0x4be7b0){return function(_0x4e9ddb){if(!_0x4e9ddb){_0x4be7b0[_0xde37('0xa')](0x194);}return _0x4e9ddb;};}function handleError(_0x58f4eb,_0x3b6fcf){_0x3b6fcf=_0x3b6fcf||0x1f4;return function(_0x1093cb){logger['error'](_0x1093cb[_0xde37('0x23')]);if(_0x1093cb['name']){delete _0x1093cb['name'];}_0x58f4eb[_0xde37('0xc')](_0x3b6fcf)['send'](_0x1093cb);};}exports[_0xde37('0x24')]=function(_0x296924,_0x41aaa3){var _0x38616f={},_0x1c5e4f={},_0x5ab438={'count':0x0,'rows':[]};var _0x32e264=_[_0xde37('0x1c')](db[_0xde37('0x25')]['rawAttributes'],function(_0x48405a){return{'name':_0x48405a[_0xde37('0x26')],'type':_0x48405a[_0xde37('0x1f')]['key']};});_0x1c5e4f['model']=_[_0xde37('0x1c')](_0x32e264,_0xde37('0x20'));_0x1c5e4f['query']=_[_0xde37('0x27')](_0x296924['query']);_0x1c5e4f[_0xde37('0x28')]=_[_0xde37('0x29')](_0x1c5e4f['model'],_0x1c5e4f[_0xde37('0x2a')]);_0x38616f[_0xde37('0x2b')]=_[_0xde37('0x29')](_0x1c5e4f['model'],qs[_0xde37('0x2c')](_0x296924[_0xde37('0x2a')]['fields']));_0x38616f['attributes']=_0x38616f[_0xde37('0x2b')][_0xde37('0x2d')]?_0x38616f[_0xde37('0x2b')]:_0x1c5e4f[_0xde37('0x2e')];if(!_0x296924['query'][_0xde37('0x2f')](_0xde37('0x30'))){_0x38616f[_0xde37('0xe')]=qs[_0xde37('0xe')](_0x296924[_0xde37('0x2a')]['limit']);_0x38616f[_0xde37('0x10')]=qs[_0xde37('0x10')](_0x296924['query']['offset']);}_0x38616f[_0xde37('0x31')]=qs[_0xde37('0x32')](_0x296924[_0xde37('0x2a')][_0xde37('0x32')]);_0x38616f[_0xde37('0x33')]=qs[_0xde37('0x28')](_[_0xde37('0x34')](_0x296924['query'],_0x1c5e4f['filters']),_0x32e264);if(_0x296924[_0xde37('0x2a')][_0xde37('0x1a')]){_0x38616f[_0xde37('0x33')]=_['merge'](_0x38616f[_0xde37('0x33')],{'$or':_[_0xde37('0x1c')](_0x32e264,function(_0x516342){if(_0x516342[_0xde37('0x1f')]!=='VIRTUAL'){var _0x48269a={};_0x48269a[_0x516342[_0xde37('0x20')]]={'$like':'%'+_0x296924[_0xde37('0x2a')]['filter']+'%'};return _0x48269a;}})});}_0x38616f=_[_0xde37('0x35')]({},_0x38616f,_0x296924[_0xde37('0x36')]);var _0x5e5006={'where':_0x38616f[_0xde37('0x33')]};return db[_0xde37('0x25')]['count'](_0x5e5006)['then'](function(_0x1878ac){_0x5ab438[_0xde37('0xf')]=_0x1878ac;if(_0x296924['query'][_0xde37('0x37')]){_0x38616f[_0xde37('0x38')]=[{'all':!![]}];}return db[_0xde37('0x25')][_0xde37('0x39')](_0x38616f);})[_0xde37('0x22')](function(_0x5c5437){_0x5ab438['rows']=_0x5c5437;return _0x5ab438;})[_0xde37('0x22')](respondWithFilteredResult(_0x41aaa3,_0x38616f))[_0xde37('0x3a')](handleError(_0x41aaa3,null));};exports[_0xde37('0x3b')]=function(_0x4320ef,_0x51ffe6){var _0x1c110d={'raw':![],'where':{'id':_0x4320ef[_0xde37('0x3c')]['id']}},_0x4e26a5={};_0x4e26a5[_0xde37('0x2e')]=_[_0xde37('0x27')](db[_0xde37('0x25')]['rawAttributes']);_0x4e26a5[_0xde37('0x2a')]=_[_0xde37('0x27')](_0x4320ef['query']);_0x4e26a5[_0xde37('0x28')]=_['intersection'](_0x4e26a5[_0xde37('0x2e')],_0x4e26a5[_0xde37('0x2a')]);_0x1c110d[_0xde37('0x2b')]=_[_0xde37('0x29')](_0x4e26a5[_0xde37('0x2e')],qs[_0xde37('0x2c')](_0x4320ef[_0xde37('0x2a')][_0xde37('0x2c')]));_0x1c110d[_0xde37('0x2b')]=_0x1c110d[_0xde37('0x2b')][_0xde37('0x2d')]?_0x1c110d['attributes']:_0x4e26a5['model'];if(_0x4320ef['query'][_0xde37('0x37')]){_0x1c110d[_0xde37('0x38')]=[{'all':!![]}];}_0x1c110d=_[_0xde37('0x35')]({},_0x1c110d,_0x4320ef['options']);return db[_0xde37('0x25')]['find'](_0x1c110d)['then'](handleEntityNotFound(_0x51ffe6,null))[_0xde37('0x22')](respondWithResult(_0x51ffe6,null))[_0xde37('0x3a')](handleError(_0x51ffe6,null));};exports[_0xde37('0x13')]=function(_0x4ed1bb,_0xcfbab3){return db['VoiceExtension'][_0xde37('0x3d')]({'where':{'id':_0x4ed1bb[_0xde37('0x3c')]['id']}})[_0xde37('0x22')](handleEntityNotFound(_0xcfbab3,null))[_0xde37('0x22')](removeEntity(_0xcfbab3,null))[_0xde37('0x3a')](handleError(_0xcfbab3,null));};exports[_0xde37('0x3e')]=function(_0x2fc486,_0x3f64bf){if(_0x2fc486[_0xde37('0x3f')]['type']===_0xde37('0x17')&&!_[_0xde37('0x40')](_0x2fc486[_0xde37('0x3f')][_0xde37('0x41')],'_')){_0x2fc486[_0xde37('0x3f')][_0xde37('0x41')]='_'['concat'](_0x2fc486[_0xde37('0x3f')][_0xde37('0x41')]);}return db[_0xde37('0x25')]['create'](_0x2fc486['body'],{'raw':![]})[_0xde37('0x22')](function(_0x1f0a76){var _0x262f44=_0x2fc486[_0xde37('0x42')][_0xde37('0x14')]({'plain':!![]});if(!_0x262f44)throw new Error(_0xde37('0x43'));if(_0x262f44[_0xde37('0x44')]==='user'){var _0x5d5d7c=_0x1f0a76['get']({'plain':!![]});var _0x1f7044=[{'name':_0xde37('0x45'),'value':_0xde37('0x15')},{'name':'OutboundRoutes','value':'outbound'},{'name':_0xde37('0x18'),'value':_0xde37('0x19')}];var _0x57e9d5=_[_0xde37('0x3d')](_0x1f7044,[_0xde37('0x1d'),_0x5d5d7c[_0xde37('0x1f')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x57e9d5,'userProfileId':_0x262f44[_0xde37('0x46')]},'raw':!![]})[_0xde37('0x22')](function(_0x4b1a57){if(_0x4b1a57&&_0x4b1a57[_0xde37('0x47')]===0x0){return db[_0xde37('0x21')][_0xde37('0x3e')]({'name':_0x5d5d7c[_0xde37('0x20')],'resourceId':_0x5d5d7c['id'],'type':_0x4b1a57[_0xde37('0x20')],'sectionId':_0x4b1a57['id']},{})[_0xde37('0x22')](function(){return _0x1f0a76;});}else{return _0x1f0a76;}})[_0xde37('0x3a')](function(_0x221e40){logger[_0xde37('0x48')](_0xde37('0x49'),_0x221e40);throw _0x221e40;});}return _0x1f0a76;})[_0xde37('0x22')](respondWithResult(_0x3f64bf,0xc9))[_0xde37('0x3a')](handleError(_0x3f64bf,null));};exports['update']=function(_0x173d48,_0x514070){if(_0x173d48[_0xde37('0x3f')]['id']){delete _0x173d48[_0xde37('0x3f')]['id'];}return db['VoiceExtension'][_0xde37('0x3d')]({'where':{'id':_0x173d48['params']['id']}})[_0xde37('0x22')](handleEntityNotFound(_0x514070,null))[_0xde37('0x22')](function(_0x2574c2){if(_0x2574c2){return db[_0xde37('0x25')][_0xde37('0x4a')](_[_0xde37('0x34')](_0x173d48[_0xde37('0x3f')],['exten',_0xde37('0x4b'),_0xde37('0x4c'),'recordingFormat','cutdigits',_0xde37('0x4d'),_0xde37('0x4e')]),{'where':{'context':_0x2574c2['context'],'exten':_0x2574c2[_0xde37('0x41')]},'individualHooks':!![]})[_0xde37('0x22')](function(_0x30f2f2){return _0x30f2f2;});}return null;})[_0xde37('0x22')](respondWithStatusCode(_0x514070,null))[_0xde37('0x3a')](handleError(_0x514070,null));};exports['addApplications']=function(_0x5e9939,_0x5c48dc){var _0x3fac0c=_0x5e9939[_0xde37('0x3c')]['id'];var _0x450d63=_0x5e9939[_0xde37('0x3f')];var _0x5ad4e4=0xc8;var _0x59b1dd=null;return db['sequelize'][_0xde37('0x4f')]({'isolationLevel':db['sequelize'][_0xde37('0x50')][_0xde37('0x51')][_0xde37('0x52')]},function(_0x2f9f14){return db[_0xde37('0x25')]['findOne']({'where':{'id':_0x3fac0c},'transaction':_0x2f9f14})['then'](function(_0x34e3a5){if(_0x34e3a5){return db[_0xde37('0x25')][_0xde37('0x13')]({'where':{'VoiceExtensionId':_0x3fac0c},'transaction':_0x2f9f14})['then'](function(){var _0x2a67e4=_[_0xde37('0x1c')](_0x450d63,function(_0x33c6ca){_0x33c6ca[_0xde37('0x53')]=_0x3fac0c;_0x33c6ca['isApp']=!![];return _0x33c6ca;});return _0x34e3a5[_0xde37('0x54')](_0x2a67e4);})['then'](function(_0x2bae56){return db[_0xde37('0x25')]['bulkCreate'](_0x2bae56,{'transaction':_0x2f9f14});});}else{_0x5ad4e4=0x194;_0x59b1dd=[];}});})[_0xde37('0x22')](function(){if(_0x5ad4e4!==0x194){return db['VoiceExtension'][_0xde37('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3fac0c},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x4510a1){_0x59b1dd=_0x4510a1;});}})[_0xde37('0x3a')](function(_0x56fbd7){_0x5ad4e4=0x1f4;logger[_0xde37('0x48')](_0x56fbd7[_0xde37('0x23')]);if(_0x56fbd7['name']){delete _0x56fbd7['name'];}_0x59b1dd=_0x56fbd7;})[_0xde37('0x56')](function(){if(_0x59b1dd===null){_0x5c48dc['sendStatus'](_0x5ad4e4);}else{if(_0x5ad4e4===0x1f4){_0x5c48dc[_0xde37('0xc')](_0x5ad4e4)[_0xde37('0x57')](_0x59b1dd);}else{_0x5c48dc[_0xde37('0xc')](_0x5ad4e4)['json'](_0x59b1dd);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 2be7d60..0f72b05 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 _0x02a3=['exports','events','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x1623cf,_0x438cb7){var _0x187323=function(_0x12a317){while(--_0x12a317){_0x1623cf['push'](_0x1623cf['shift']());}};_0x187323(++_0x438cb7);}(_0x02a3,0x8d));var _0x302a=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x02a3[_0x1deb03];return _0x189fe7;};'use strict';var EventEmitter=require(_0x302a('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x302a('0x1')](0x0);var events={'afterCreate':_0x302a('0x2'),'afterUpdate':_0x302a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4654f1){return function(_0x597a4b,_0x5949fc,_0x3746cf){VoiceExtensionEvents['emit'](_0x4654f1+':'+_0x597a4b['id'],_0x597a4b);VoiceExtensionEvents[_0x302a('0x4')](_0x4654f1,_0x597a4b);_0x3746cf(null);};}for(var e in events){if(events[_0x302a('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x302a('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0x40cc=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40cc,0x1d1));var _0xc40c=function(_0x377b59,_0x1f167d){_0x377b59=_0x377b59-0x0;var _0x2cae54=_0x40cc[_0x377b59];return _0x2cae54;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xc40c('0x0'))['db'][_0xc40c('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc40c('0x2')](0x0);var events={'afterCreate':_0xc40c('0x3'),'afterUpdate':_0xc40c('0x4'),'afterDestroy':_0xc40c('0x5')};function emitEvent(_0x38c360){return function(_0x5723c2,_0x722f0,_0xeac9a7){VoiceExtensionEvents[_0xc40c('0x6')](_0x38c360+':'+_0x5723c2['id'],_0x5723c2);VoiceExtensionEvents['emit'](_0x38c360,_0x5723c2);_0xeac9a7(null);};}for(var e in events){if(events[_0xc40c('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xc40c('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 521e10b..0d59929 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 _0x50df=['_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','phone','prefix','join','param','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','interval','then','*,*,*,*','intervals','filter','IntervalId','toLowerCase','tag','CDR(tag)=','Set(CALLERID(all)=','callerID','answer','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress',',${EXTEN},','outboundDial','appdata','priority','last','catch','VoiceExtension','voice_extensions','get','concat','Hangup','lodash','exports','models','Set','CDR(type)=','type','context','exten','NoOp','CDR(routeAlias)=','alias','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x50df,0x168));var _0xf50d=function(_0x58d91a,_0x1debe4){_0x58d91a=_0x58d91a-0x0;var _0x5a8116=_0x50df[_0x58d91a];return _0x5a8116;};'use strict';var _=require(_0xf50d('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xf50d('0x1')]=function(_0x3741a8){var _0x3e5a05=_0x3741a8[_0xf50d('0x2')];function _0x126b98(_0x2246d8){var _0x237b8b=0x2;var _0x195f4d=[{'type':_0x2246d8['type'],'app':_0xf50d('0x3'),'appdata':_0xf50d('0x4')+_0x2246d8[_0xf50d('0x5')],'context':_0x2246d8[_0xf50d('0x6')],'exten':_0x2246d8[_0xf50d('0x7')],'priority':_0x237b8b++,'VoiceExtensionId':_0x2246d8['id']},{'type':_0x2246d8[_0xf50d('0x5')],'app':_0x2246d8['alias']?_0xf50d('0x3'):_0xf50d('0x8'),'appdata':_0x2246d8['alias']?_0xf50d('0x9')+_0x2246d8[_0xf50d('0xa')]:'No\x20alias\x20set','context':_0x2246d8[_0xf50d('0x6')],'exten':_0x2246d8[_0xf50d('0x7')],'priority':_0x237b8b++,'VoiceExtensionId':_0x2246d8['id']}];if(_0x2246d8[_0xf50d('0x5')]===_0xf50d('0xb')){_0x195f4d[_0xf50d('0xc')]({'type':_0xf50d('0xb'),'app':_0xf50d('0x3'),'appdata':_0xf50d('0xd')+_0x2246d8['id'],'context':_0x2246d8['context'],'exten':_0x2246d8[_0xf50d('0x7')],'priority':_0x237b8b++,'VoiceExtensionId':_0x2246d8['id']});}_0x195f4d['push']({'type':_0x2246d8['type'],'app':_0xf50d('0x3'),'appdata':_0xf50d('0xe'),'context':_0x2246d8['context'],'exten':_0x2246d8[_0xf50d('0x7')],'priority':_0x237b8b++,'VoiceExtensionId':_0x2246d8['id']},{'type':_0x2246d8[_0xf50d('0x5')],'app':_0xf50d('0x3'),'appdata':_0xf50d('0xf'),'context':_0x2246d8[_0xf50d('0x6')],'exten':_0x2246d8[_0xf50d('0x7')],'priority':_0x237b8b++,'VoiceExtensionId':_0x2246d8['id']},{'type':_0x2246d8[_0xf50d('0x5')],'app':_0xf50d('0x3'),'appdata':_0xf50d('0x10'),'context':_0x2246d8['context'],'exten':_0x2246d8[_0xf50d('0x7')],'priority':_0x237b8b++,'VoiceExtensionId':_0x2246d8['id']});return _0x195f4d;}function _0x32d18b(_0x40e362){var _0x244ff7=0x2;var _0x5aac7e=[{'type':_0xf50d('0x11'),'app':_0xf50d('0x3'),'appdata':'CDR(type)=outbound','context':_0x40e362[_0xf50d('0x6')],'exten':_0x40e362[_0xf50d('0x7')],'priority':_0x244ff7++,'VoiceExtensionId':_0x40e362['id']},{'type':'outbound','app':_0x40e362[_0xf50d('0xa')]?'Set':_0xf50d('0x8'),'appdata':_0x40e362['alias']?_0xf50d('0x9')+_0x40e362[_0xf50d('0xa')]:'No\x20alias\x20set','context':_0x40e362[_0xf50d('0x6')],'exten':_0x40e362[_0xf50d('0x7')],'priority':_0x244ff7++,'VoiceExtensionId':_0x40e362['id']},{'type':_0xf50d('0x11'),'app':'Set','appdata':_0xf50d('0x12')+(_0x40e362[_0xf50d('0x13')]?_0xf50d('0x14')+_0x40e362['cutdigits']+'}':_0xf50d('0x15')),'context':_0x40e362['context'],'exten':_0x40e362[_0xf50d('0x7')],'priority':_0x244ff7++,'VoiceExtensionId':_0x40e362['id']},{'type':_0xf50d('0x11'),'app':_0xf50d('0x3'),'appdata':_0xf50d('0xd')+_0x40e362['id'],'context':_0x40e362[_0xf50d('0x6')],'exten':_0x40e362[_0xf50d('0x7')],'priority':_0x244ff7++,'VoiceExtensionId':_0x40e362['id']},{'type':_0xf50d('0x11'),'app':_0xf50d('0x16'),'appdata':_0xf50d('0x17')+(_0x244ff7+0x2)+'):Goto('+(_0x244ff7+0x1)+')','context':_0x40e362[_0xf50d('0x6')],'exten':_0x40e362['exten'],'priority':_0x244ff7++,'VoiceExtensionId':_0x40e362['id']},{'type':_0xf50d('0x11'),'app':_0xf50d('0x3'),'appdata':_0x40e362[_0xf50d('0x13')]?_0xf50d('0x18')+_0x40e362['cutdigits']+'}':_0xf50d('0x19'),'context':_0x40e362[_0xf50d('0x6')],'exten':_0x40e362['exten'],'priority':_0x244ff7++,'VoiceExtensionId':_0x40e362['id']},{'type':_0xf50d('0x11'),'app':_0xf50d('0x3'),'appdata':_0xf50d('0xe'),'context':_0x40e362[_0xf50d('0x6')],'exten':_0x40e362[_0xf50d('0x7')],'priority':_0x244ff7++,'VoiceExtensionId':_0x40e362['id']},{'type':_0xf50d('0x11'),'app':_0xf50d('0x3'),'appdata':_0xf50d('0xf'),'context':_0x40e362['context'],'exten':_0x40e362['exten'],'priority':_0x244ff7++,'VoiceExtensionId':_0x40e362['id']},{'type':_0xf50d('0x11'),'app':_0xf50d('0x3'),'appdata':_0xf50d('0x10'),'context':_0x40e362[_0xf50d('0x6')],'exten':_0x40e362['exten'],'priority':_0x244ff7++,'VoiceExtensionId':_0x40e362['id']},{'type':'outbound','app':_0xf50d('0x3'),'appdata':_0xf50d('0x1a')+_0x40e362['id'],'context':_0x40e362['context'],'exten':_0x40e362[_0xf50d('0x7')],'priority':_0x244ff7++,'VoiceExtensionId':_0x40e362['id']}];if(_0x40e362[_0xf50d('0x1b')](_0xf50d('0x1c'))&&_0x40e362['recordingFormat']!==_0xf50d('0x1d')){_0x5aac7e[_0xf50d('0xc')]({'type':_0xf50d('0x11'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x40e362['context'],'exten':_0x40e362[_0xf50d('0x7')],'priority':_0x244ff7++,'VoiceExtensionId':_0x40e362['id']},{'type':_0xf50d('0x11'),'app':_0xf50d('0x3'),'appdata':_0xf50d('0x1e')+_0x40e362[_0xf50d('0x1c')]||_0xf50d('0x1f'),'context':_0x40e362['context'],'exten':_0x40e362[_0xf50d('0x7')],'priority':_0x244ff7++,'VoiceExtensionId':_0x40e362['id']});}return _0x5aac7e;}function _0x116d3a(_0x20c919,_0x4b3ab0){var _0x34f21c=[{'name':_0xf50d('0x20'),'param':0x0},{'name':_0xf50d('0x21'),'param':0x1},{'name':_0xf50d('0x22'),'param':0x2},{'name':_0xf50d('0x23'),'param':0x3}];var _0x4e7b7f={};var _0x40f2d5=_0x4b3ab0[_0xf50d('0x24')](',');var _0x53161c=[];for(var _0x3ee7da=0x0;_0x3ee7da<_0x34f21c[_0xf50d('0x25')];_0x3ee7da++){switch(_0x34f21c[_0x3ee7da][_0xf50d('0x26')]){case _0xf50d('0x20'):_0x4e7b7f[_0xf50d('0x20')]=_0x40f2d5[_0x34f21c[_0x3ee7da]['param']][_0xf50d('0x24')]('/')[0x1];_0x4e7b7f[_0xf50d('0x27')]=_0x40f2d5[_0x34f21c[_0x3ee7da]['param']][_0xf50d('0x24')]('/')[0x2];_0x4e7b7f[_0xf50d('0x28')]=_0x4e7b7f[_0xf50d('0x27')]?_0x4e7b7f[_0xf50d('0x27')]['split']('$')[0x0]:undefined;_0x4e7b7f[_0xf50d('0x27')]=_0x20c919['cutdigits']?(_0x4e7b7f['prefix']||'')+_0xf50d('0x14')+_0x20c919['cutdigits']+'}':(_0x4e7b7f[_0xf50d('0x28')]||'')+_0xf50d('0x15');_0x53161c[_0x34f21c[_0x3ee7da]['param']]=['SIP',_0x4e7b7f[_0xf50d('0x20')],_0x4e7b7f['phone']][_0xf50d('0x29')]('/');break;case'options':_0x4e7b7f['options']=_0x40f2d5[_0x34f21c[_0x3ee7da][_0xf50d('0x2a')]];if(_0x20c919[_0xf50d('0x1c')]!==_0xf50d('0x1d')){if(_0x4e7b7f[_0xf50d('0x22')][_0xf50d('0x2b')](_0xf50d('0x2c'))<0x0){_0x4e7b7f['options']+='U(xcally-mixmonitor-context)';}}else{_0x4e7b7f[_0xf50d('0x22')]=_0x4e7b7f['options']['replace']('U(xcally-mixmonitor-context)','');}_0x53161c[_0x34f21c[_0x3ee7da][_0xf50d('0x2a')]]=_0x4e7b7f[_0xf50d('0x22')];break;default:_0x53161c[_0x34f21c[_0x3ee7da][_0xf50d('0x2a')]]=_0x40f2d5[_0x34f21c[_0x3ee7da][_0xf50d('0x2a')]];}}return _0x53161c[_0xf50d('0x29')](',');}function _0xbca06b(_0x116749,_0x619efa,_0x43f3a2){return new Promise(function(_0xbc5a5c,_0x4b036a){var _0x4c7dd8=[];if(_[_0xf50d('0x2d')](_0x619efa))return _0xbc5a5c(_0x4c7dd8);_0x3e5a05[_0xf50d('0x2e')]['findAll']({'attributes':['id',_0xf50d('0x2f'),'IntervalId'],'raw':!![]})[_0xf50d('0x30')](function(_0xca06e5){for(var _0x2ca30a=0x0,_0x557e09=0x0;_0x2ca30a<_0x619efa['length'];_0x2ca30a++,_0x557e09=0x0){var _0x54a700=_0x619efa[_0x2ca30a];var _0x32f354=[];var _0x1f4ccb=[];delete _0x54a700['id'];if(_0x54a700[_0xf50d('0x2f')]!==_0xf50d('0x31')){_0x54a700[_0xf50d('0x32')]=[_0x54a700['interval']];}else{_0x54a700[_0xf50d('0x32')]=_0x54a700['IntervalId']?_['map'](_[_0xf50d('0x33')](_0xca06e5,{'IntervalId':_0x54a700[_0xf50d('0x34')]}),_0xf50d('0x2f')):[];}_0x54a700[_0xf50d('0x6')]=_0x116749[_0xf50d('0x6')];_0x54a700[_0xf50d('0x7')]=_0x116749[_0xf50d('0x7')];if(_0x54a700[_0xf50d('0x5')])_0x54a700[_0xf50d('0x5')]=_0x54a700[_0xf50d('0x5')][_0xf50d('0x35')]();if(_0x116749['type']===_0xf50d('0x11')){if(_0x54a700[_0xf50d('0x1b')](_0xf50d('0x36'))&&_0x54a700['tag']&&_0x54a700[_0xf50d('0x36')]!=='--'){_0x32f354['push']({'type':_0x54a700[_0xf50d('0x5')][_0xf50d('0x35')](),'app':_0xf50d('0x3'),'appdata':_0xf50d('0x37')+_0x54a700[_0xf50d('0x36')],'context':_0x116749[_0xf50d('0x6')],'exten':_0x116749[_0xf50d('0x7')],'priority':_0x54a700[_0xf50d('0x32')][_0xf50d('0x25')]+_0x43f3a2+_0x557e09++,'VoiceExtensionId':_0x116749['id']});}_0x32f354[_0xf50d('0xc')]({'type':_0x54a700['type'][_0xf50d('0x35')](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x54a700['callerID']?_0xf50d('0x38')+_0x54a700[_0xf50d('0x39')]+')':'NoOp(No\x20number\x20available)'),'context':_0x116749[_0xf50d('0x6')],'exten':_0x116749[_0xf50d('0x7')],'priority':_0x54a700[_0xf50d('0x32')][_0xf50d('0x25')]+_0x43f3a2+_0x557e09++,'VoiceExtensionId':_0x116749['id']});}else{if(_0x54a700[_0xf50d('0x1b')](_0xf50d('0x3a'))){if(['queue',_0xf50d('0x3b')][_0xf50d('0x3c')](_0x54a700[_0xf50d('0x3d')][_0xf50d('0x35')]())&&_0x54a700[_0xf50d('0x3e')]!==_0xf50d('0x3f')){if(_0x54a700['answer']){_0x32f354[_0xf50d('0xc')]({'type':_0x54a700['type'][_0xf50d('0x35')](),'app':_0xf50d('0x16'),'appdata':_0xf50d('0x40'),'context':_0x116749['context'],'exten':_0x116749['exten'],'priority':_0x54a700['intervals'][_0xf50d('0x25')]+_0x43f3a2+_0x557e09++,'VoiceExtensionId':_0x116749['id']});_0x32f354[_0xf50d('0xc')]({'type':_0x54a700[_0xf50d('0x5')][_0xf50d('0x35')](),'app':_0xf50d('0x3'),'appdata':_0xf50d('0x41'),'context':_0x116749[_0xf50d('0x6')],'exten':_0x116749[_0xf50d('0x7')],'priority':_0x54a700[_0xf50d('0x32')]['length']+_0x43f3a2+_0x557e09++,'VoiceExtensionId':_0x116749['id']});}else{_0x32f354['push']({'type':_0x54a700['type'][_0xf50d('0x35')](),'app':_0xf50d('0x16'),'appdata':_0xf50d('0x42'),'context':_0x116749[_0xf50d('0x6')],'exten':_0x116749['exten'],'priority':_0x54a700[_0xf50d('0x32')]['length']+_0x43f3a2+_0x557e09++,'VoiceExtensionId':_0x116749['id']});_0x32f354[_0xf50d('0xc')]({'type':_0x54a700[_0xf50d('0x5')]['toLowerCase'](),'app':_0xf50d('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x116749[_0xf50d('0x6')],'exten':_0x116749[_0xf50d('0x7')],'priority':_0x54a700[_0xf50d('0x32')][_0xf50d('0x25')]+_0x43f3a2+_0x557e09++,'VoiceExtensionId':_0x116749['id']});}}}}for(var _0x4c30ff=0x0;_0x4c30ff<_0x54a700['intervals'][_0xf50d('0x25')];_0x4c30ff++){var _0x571898=_0x43f3a2+_0x54a700[_0xf50d('0x32')][_0xf50d('0x25')];var _0x4b17b8=_0x4c30ff===_0x54a700[_0xf50d('0x32')][_0xf50d('0x25')]-0x1?_0x43f3a2+_0x32f354[_0xf50d('0x25')]+_0x1f4ccb[_0xf50d('0x25')]+0x2:_0x43f3a2+_0x4c30ff+0x1;_0x32f354['splice'](_0x4c30ff,0x0,{'type':_0x116749['type'],'app':'GotoIfTime','appdata':_0x54a700[_0xf50d('0x32')][_0x4c30ff]+'?'+_0x116749[_0xf50d('0x6')]+_0xf50d('0x43')+_0x571898+':'+_0x116749[_0xf50d('0x6')]+',${EXTEN},'+_0x4b17b8,'exten':_0x116749[_0xf50d('0x7')],'context':_0x116749[_0xf50d('0x6')],'priority':_0x43f3a2+_0x4c30ff,'VoiceExtensionId':_0x116749['id']});}if(_0x54a700['appType']===_0xf50d('0x44'))_0x54a700[_0xf50d('0x45')]=_0x116d3a(_0x116749,_0x54a700[_0xf50d('0x45')]);_0x54a700[_0xf50d('0x46')]=_0x32f354['length']?_[_0xf50d('0x47')](_0x32f354)[_0xf50d('0x46')]+0x1:_0x43f3a2;_0x4c7dd8=_['concat'](_0x4c7dd8,_0x32f354,[_0x54a700],_0x1f4ccb);_0x43f3a2=_[_0xf50d('0x47')](_0x4c7dd8)[_0xf50d('0x46')]+0x1;}return _0xbc5a5c(_0x4c7dd8);})[_0xf50d('0x48')](function(_0x39f06f){_0x4b036a(_0x39f06f);});});}return _0x3741a8['define'](_0xf50d('0x49'),attributes,{'tableName':_0xf50d('0x4a'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1b9bda){var _0x153f79=this[_0xf50d('0x4b')]({'plain':!![]});var _0x3bd102=_0x153f79[_0xf50d('0x5')]==='outbound'?_0x32d18b(_0x153f79):_0x126b98(_0x153f79);return _0xbca06b(_0x153f79,_0x1b9bda,_[_0xf50d('0x47')](_0x3bd102)['priority']+0x1)['then'](function(_0x52ddb4){var _0x35b912=_[_0xf50d('0x4c')](_0x3bd102,_0x52ddb4);_0x35b912[_0xf50d('0xc')]({'type':_0x153f79['type'],'app':_0xf50d('0x4d'),'exten':_0x153f79[_0xf50d('0x7')],'context':_0x153f79[_0xf50d('0x6')],'priority':_[_0xf50d('0x47')](_0x35b912)[_0xf50d('0x46')]+0x1,'VoiceExtensionId':_0x153f79['id']});return _0x35b912;});}}});}; \ No newline at end of file +var _0x7024=['catch','define','VoiceExtension','get','then','concat','Hangup','lodash','exports','models','type','Set','context','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','none','recordingFormat','wav','options','url','split','length','trunk','param','phone','prefix','SIP','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','intervals','IntervalId','map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','app','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appType','appdata','priority','last'];(function(_0x46392c,_0x188c06){var _0x3b2b63=function(_0xb25d6b){while(--_0xb25d6b){_0x46392c['push'](_0x46392c['shift']());}};_0x3b2b63(++_0x188c06);}(_0x7024,0xa1));var _0x4702=function(_0x140546,_0x5c1a32){_0x140546=_0x140546-0x0;var _0x5ac2b0=_0x7024[_0x140546];return _0x5ac2b0;};'use strict';var _=require(_0x4702('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x4702('0x1')]=function(_0x3aa679){var _0x4467b1=_0x3aa679[_0x4702('0x2')];function _0x53217b(_0x514e34){var _0x144426=0x2;var _0x5902f0=[{'type':_0x514e34[_0x4702('0x3')],'app':_0x4702('0x4'),'appdata':'CDR(type)='+_0x514e34[_0x4702('0x3')],'context':_0x514e34[_0x4702('0x5')],'exten':_0x514e34[_0x4702('0x6')],'priority':_0x144426++,'VoiceExtensionId':_0x514e34['id']},{'type':_0x514e34[_0x4702('0x3')],'app':_0x514e34['alias']?'Set':'NoOp','appdata':_0x514e34[_0x4702('0x7')]?_0x4702('0x8')+_0x514e34[_0x4702('0x7')]:_0x4702('0x9'),'context':_0x514e34['context'],'exten':_0x514e34[_0x4702('0x6')],'priority':_0x144426++,'VoiceExtensionId':_0x514e34['id']}];if(_0x514e34['type']===_0x4702('0xa')){_0x5902f0[_0x4702('0xb')]({'type':'inbound','app':_0x4702('0x4'),'appdata':'CDR(routeid)='+_0x514e34['id'],'context':_0x514e34['context'],'exten':_0x514e34[_0x4702('0x6')],'priority':_0x144426++,'VoiceExtensionId':_0x514e34['id']});}_0x5902f0['push']({'type':_0x514e34[_0x4702('0x3')],'app':_0x4702('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x514e34[_0x4702('0x5')],'exten':_0x514e34['exten'],'priority':_0x144426++,'VoiceExtensionId':_0x514e34['id']},{'type':_0x514e34[_0x4702('0x3')],'app':_0x4702('0x4'),'appdata':_0x4702('0xc'),'context':_0x514e34[_0x4702('0x5')],'exten':_0x514e34[_0x4702('0x6')],'priority':_0x144426++,'VoiceExtensionId':_0x514e34['id']},{'type':_0x514e34[_0x4702('0x3')],'app':_0x4702('0x4'),'appdata':_0x4702('0xd'),'context':_0x514e34[_0x4702('0x5')],'exten':_0x514e34[_0x4702('0x6')],'priority':_0x144426++,'VoiceExtensionId':_0x514e34['id']});return _0x5902f0;}function _0x203fa5(_0x4d3f53){var _0x5a94ea=0x2;var _0x462fe1=[{'type':'outbound','app':'Set','appdata':'CDR(type)=outbound','context':_0x4d3f53[_0x4702('0x5')],'exten':_0x4d3f53[_0x4702('0x6')],'priority':_0x5a94ea++,'VoiceExtensionId':_0x4d3f53['id']},{'type':_0x4702('0xe'),'app':_0x4d3f53[_0x4702('0x7')]?_0x4702('0x4'):'NoOp','appdata':_0x4d3f53['alias']?_0x4702('0x8')+_0x4d3f53[_0x4702('0x7')]:_0x4702('0x9'),'context':_0x4d3f53['context'],'exten':_0x4d3f53[_0x4702('0x6')],'priority':_0x5a94ea++,'VoiceExtensionId':_0x4d3f53['id']},{'type':_0x4702('0xe'),'app':_0x4702('0x4'),'appdata':_0x4702('0xf')+(_0x4d3f53[_0x4702('0x10')]?_0x4702('0x11')+_0x4d3f53[_0x4702('0x10')]+'}':_0x4702('0x12')),'context':_0x4d3f53[_0x4702('0x5')],'exten':_0x4d3f53[_0x4702('0x6')],'priority':_0x5a94ea++,'VoiceExtensionId':_0x4d3f53['id']},{'type':_0x4702('0xe'),'app':_0x4702('0x4'),'appdata':_0x4702('0x13')+_0x4d3f53['id'],'context':_0x4d3f53[_0x4702('0x5')],'exten':_0x4d3f53[_0x4702('0x6')],'priority':_0x5a94ea++,'VoiceExtensionId':_0x4d3f53['id']},{'type':'outbound','app':'ExecIf','appdata':_0x4702('0x14')+(_0x5a94ea+0x2)+'):Goto('+(_0x5a94ea+0x1)+')','context':_0x4d3f53[_0x4702('0x5')],'exten':_0x4d3f53[_0x4702('0x6')],'priority':_0x5a94ea++,'VoiceExtensionId':_0x4d3f53['id']},{'type':_0x4702('0xe'),'app':_0x4702('0x4'),'appdata':_0x4d3f53[_0x4702('0x10')]?_0x4702('0x15')+_0x4d3f53[_0x4702('0x10')]+'}':_0x4702('0x16'),'context':_0x4d3f53[_0x4702('0x5')],'exten':_0x4d3f53['exten'],'priority':_0x5a94ea++,'VoiceExtensionId':_0x4d3f53['id']},{'type':_0x4702('0xe'),'app':_0x4702('0x4'),'appdata':_0x4702('0x17'),'context':_0x4d3f53[_0x4702('0x5')],'exten':_0x4d3f53[_0x4702('0x6')],'priority':_0x5a94ea++,'VoiceExtensionId':_0x4d3f53['id']},{'type':_0x4702('0xe'),'app':_0x4702('0x4'),'appdata':_0x4702('0xc'),'context':_0x4d3f53[_0x4702('0x5')],'exten':_0x4d3f53[_0x4702('0x6')],'priority':_0x5a94ea++,'VoiceExtensionId':_0x4d3f53['id']},{'type':_0x4702('0xe'),'app':_0x4702('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4d3f53[_0x4702('0x5')],'exten':_0x4d3f53[_0x4702('0x6')],'priority':_0x5a94ea++,'VoiceExtensionId':_0x4d3f53['id']},{'type':_0x4702('0xe'),'app':_0x4702('0x4'),'appdata':_0x4702('0x18')+_0x4d3f53['id'],'context':_0x4d3f53[_0x4702('0x5')],'exten':_0x4d3f53[_0x4702('0x6')],'priority':_0x5a94ea++,'VoiceExtensionId':_0x4d3f53['id']}];if(_0x4d3f53[_0x4702('0x19')]('recordingFormat')&&_0x4d3f53['recordingFormat']!==_0x4702('0x1a')){_0x462fe1[_0x4702('0xb')]({'type':_0x4702('0xe'),'app':_0x4702('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4d3f53[_0x4702('0x5')],'exten':_0x4d3f53[_0x4702('0x6')],'priority':_0x5a94ea++,'VoiceExtensionId':_0x4d3f53['id']},{'type':_0x4702('0xe'),'app':_0x4702('0x4'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x4d3f53[_0x4702('0x1b')]||_0x4702('0x1c'),'context':_0x4d3f53[_0x4702('0x5')],'exten':_0x4d3f53[_0x4702('0x6')],'priority':_0x5a94ea++,'VoiceExtensionId':_0x4d3f53['id']});}return _0x462fe1;}function _0x182424(_0x4556aa,_0x1c9f18){var _0x2cbe33=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0x4702('0x1d'),'param':0x2},{'name':_0x4702('0x1e'),'param':0x3}];var _0x5f0f2b={};var _0x269081=_0x1c9f18[_0x4702('0x1f')](',');var _0x4c1a58=[];for(var _0x49138c=0x0;_0x49138c<_0x2cbe33[_0x4702('0x20')];_0x49138c++){switch(_0x2cbe33[_0x49138c]['name']){case'trunk':_0x5f0f2b[_0x4702('0x21')]=_0x269081[_0x2cbe33[_0x49138c][_0x4702('0x22')]]['split']('/')[0x1];_0x5f0f2b[_0x4702('0x23')]=_0x269081[_0x2cbe33[_0x49138c][_0x4702('0x22')]][_0x4702('0x1f')]('/')[0x2];_0x5f0f2b[_0x4702('0x24')]=_0x5f0f2b['phone']?_0x5f0f2b['phone'][_0x4702('0x1f')]('$')[0x0]:undefined;_0x5f0f2b['phone']=_0x4556aa['cutdigits']?(_0x5f0f2b['prefix']||'')+_0x4702('0x11')+_0x4556aa[_0x4702('0x10')]+'}':(_0x5f0f2b[_0x4702('0x24')]||'')+_0x4702('0x12');_0x4c1a58[_0x2cbe33[_0x49138c]['param']]=[_0x4702('0x25'),_0x5f0f2b[_0x4702('0x21')],_0x5f0f2b[_0x4702('0x23')]]['join']('/');break;case _0x4702('0x1d'):_0x5f0f2b[_0x4702('0x1d')]=_0x269081[_0x2cbe33[_0x49138c][_0x4702('0x22')]];if(_0x4556aa[_0x4702('0x1b')]!=='none'){if(_0x5f0f2b[_0x4702('0x1d')][_0x4702('0x26')](_0x4702('0x27'))<0x0){_0x5f0f2b['options']+=_0x4702('0x27');}}else{_0x5f0f2b[_0x4702('0x1d')]=_0x5f0f2b[_0x4702('0x1d')][_0x4702('0x28')](_0x4702('0x27'),'');}_0x4c1a58[_0x2cbe33[_0x49138c][_0x4702('0x22')]]=_0x5f0f2b[_0x4702('0x1d')];break;default:_0x4c1a58[_0x2cbe33[_0x49138c]['param']]=_0x269081[_0x2cbe33[_0x49138c][_0x4702('0x22')]];}}return _0x4c1a58['join'](',');}function _0x5e7247(_0x13bdff,_0x1aed8a,_0x43d07e){return new Promise(function(_0x4889c3,_0x2702fb){var _0x126d9a=[];if(_[_0x4702('0x29')](_0x1aed8a))return _0x4889c3(_0x126d9a);_0x4467b1[_0x4702('0x2a')]['findAll']({'attributes':['id',_0x4702('0x2b'),'IntervalId'],'raw':!![]})['then'](function(_0x25c479){for(var _0x45e258=0x0,_0x3f7d0a=0x0;_0x45e258<_0x1aed8a[_0x4702('0x20')];_0x45e258++,_0x3f7d0a=0x0){var _0x2310fa=_0x1aed8a[_0x45e258];var _0x138e0a=[];var _0x2853bb=[];delete _0x2310fa['id'];if(_0x2310fa[_0x4702('0x2b')]!=='*,*,*,*'){_0x2310fa[_0x4702('0x2c')]=[_0x2310fa['interval']];}else{_0x2310fa[_0x4702('0x2c')]=_0x2310fa[_0x4702('0x2d')]?_[_0x4702('0x2e')](_[_0x4702('0x2f')](_0x25c479,{'IntervalId':_0x2310fa[_0x4702('0x2d')]}),_0x4702('0x2b')):[];}_0x2310fa[_0x4702('0x5')]=_0x13bdff[_0x4702('0x5')];_0x2310fa[_0x4702('0x6')]=_0x13bdff[_0x4702('0x6')];if(_0x2310fa[_0x4702('0x3')])_0x2310fa[_0x4702('0x3')]=_0x2310fa['type'][_0x4702('0x30')]();if(_0x13bdff[_0x4702('0x3')]===_0x4702('0xe')){if(_0x2310fa[_0x4702('0x19')](_0x4702('0x31'))&&_0x2310fa[_0x4702('0x31')]&&_0x2310fa['tag']!=='--'){_0x138e0a[_0x4702('0xb')]({'type':_0x2310fa[_0x4702('0x3')]['toLowerCase'](),'app':'Set','appdata':_0x4702('0x32')+_0x2310fa[_0x4702('0x31')],'context':_0x13bdff[_0x4702('0x5')],'exten':_0x13bdff['exten'],'priority':_0x2310fa[_0x4702('0x2c')]['length']+_0x43d07e+_0x3f7d0a++,'VoiceExtensionId':_0x13bdff['id']});}_0x138e0a[_0x4702('0xb')]({'type':_0x2310fa[_0x4702('0x3')]['toLowerCase'](),'app':_0x4702('0x33'),'appdata':_0x4702('0x34')+(_0x2310fa[_0x4702('0x35')]?_0x4702('0x36')+_0x2310fa[_0x4702('0x35')]+')':_0x4702('0x37')),'context':_0x13bdff['context'],'exten':_0x13bdff['exten'],'priority':_0x2310fa[_0x4702('0x2c')][_0x4702('0x20')]+_0x43d07e+_0x3f7d0a++,'VoiceExtensionId':_0x13bdff['id']});}else{if(_0x2310fa[_0x4702('0x19')]('answer')){if([_0x4702('0x38'),_0x4702('0x39')][_0x4702('0x3a')](_0x2310fa[_0x4702('0x3b')][_0x4702('0x30')]())&&_0x2310fa['appType']!=='custom'){if(_0x2310fa['answer']){_0x138e0a['push']({'type':_0x2310fa[_0x4702('0x3')]['toLowerCase'](),'app':_0x4702('0x33'),'appdata':_0x4702('0x3c'),'context':_0x13bdff[_0x4702('0x5')],'exten':_0x13bdff[_0x4702('0x6')],'priority':_0x2310fa['intervals']['length']+_0x43d07e+_0x3f7d0a++,'VoiceExtensionId':_0x13bdff['id']});_0x138e0a[_0x4702('0xb')]({'type':_0x2310fa[_0x4702('0x3')][_0x4702('0x30')](),'app':_0x4702('0x4'),'appdata':_0x4702('0x3d'),'context':_0x13bdff[_0x4702('0x5')],'exten':_0x13bdff['exten'],'priority':_0x2310fa[_0x4702('0x2c')]['length']+_0x43d07e+_0x3f7d0a++,'VoiceExtensionId':_0x13bdff['id']});}else{_0x138e0a['push']({'type':_0x2310fa['type']['toLowerCase'](),'app':_0x4702('0x33'),'appdata':_0x4702('0x3e'),'context':_0x13bdff['context'],'exten':_0x13bdff['exten'],'priority':_0x2310fa[_0x4702('0x2c')]['length']+_0x43d07e+_0x3f7d0a++,'VoiceExtensionId':_0x13bdff['id']});_0x138e0a['push']({'type':_0x2310fa[_0x4702('0x3')]['toLowerCase'](),'app':'Set','appdata':_0x4702('0x3f'),'context':_0x13bdff[_0x4702('0x5')],'exten':_0x13bdff[_0x4702('0x6')],'priority':_0x2310fa[_0x4702('0x2c')]['length']+_0x43d07e+_0x3f7d0a++,'VoiceExtensionId':_0x13bdff['id']});}}}}for(var _0x3c791d=0x0;_0x3c791d<_0x2310fa[_0x4702('0x2c')][_0x4702('0x20')];_0x3c791d++){var _0x1bae59=_0x43d07e+_0x2310fa[_0x4702('0x2c')][_0x4702('0x20')];var _0x186844=_0x3c791d===_0x2310fa[_0x4702('0x2c')]['length']-0x1?_0x43d07e+_0x138e0a[_0x4702('0x20')]+_0x2853bb[_0x4702('0x20')]+0x2:_0x43d07e+_0x3c791d+0x1;_0x138e0a[_0x4702('0x40')](_0x3c791d,0x0,{'type':_0x13bdff[_0x4702('0x3')],'app':'GotoIfTime','appdata':_0x2310fa[_0x4702('0x2c')][_0x3c791d]+'?'+_0x13bdff[_0x4702('0x5')]+_0x4702('0x41')+_0x1bae59+':'+_0x13bdff[_0x4702('0x5')]+_0x4702('0x41')+_0x186844,'exten':_0x13bdff[_0x4702('0x6')],'context':_0x13bdff[_0x4702('0x5')],'priority':_0x43d07e+_0x3c791d,'VoiceExtensionId':_0x13bdff['id']});}if(_0x2310fa[_0x4702('0x42')]==='outboundDial')_0x2310fa[_0x4702('0x43')]=_0x182424(_0x13bdff,_0x2310fa[_0x4702('0x43')]);_0x2310fa[_0x4702('0x44')]=_0x138e0a[_0x4702('0x20')]?_[_0x4702('0x45')](_0x138e0a)[_0x4702('0x44')]+0x1:_0x43d07e;_0x126d9a=_['concat'](_0x126d9a,_0x138e0a,[_0x2310fa],_0x2853bb);_0x43d07e=_['last'](_0x126d9a)[_0x4702('0x44')]+0x1;}return _0x4889c3(_0x126d9a);})[_0x4702('0x46')](function(_0x101b2e){_0x2702fb(_0x101b2e);});});}return _0x3aa679[_0x4702('0x47')](_0x4702('0x48'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x50c647){var _0x2fc6c0=this[_0x4702('0x49')]({'plain':!![]});var _0x159412=_0x2fc6c0['type']===_0x4702('0xe')?_0x203fa5(_0x2fc6c0):_0x53217b(_0x2fc6c0);return _0x5e7247(_0x2fc6c0,_0x50c647,_[_0x4702('0x45')](_0x159412)[_0x4702('0x44')]+0x1)[_0x4702('0x4a')](function(_0x225502){var _0x1733b6=_[_0x4702('0x4b')](_0x159412,_0x225502);_0x1733b6[_0x4702('0xb')]({'type':_0x2fc6c0[_0x4702('0x3')],'app':_0x4702('0x4c'),'exten':_0x2fc6c0['exten'],'context':_0x2fc6c0[_0x4702('0x5')],'priority':_[_0x4702('0x45')](_0x1733b6)[_0x4702('0x44')]+0x1,'VoiceExtensionId':_0x2fc6c0['id']});return _0x1733b6;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 0efe2d0..3c2c65b 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 _0x7ebb=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x339e61,_0x544b19){var _0x36df2e=function(_0x595b31){while(--_0x595b31){_0x339e61['push'](_0x339e61['shift']());}};_0x36df2e(++_0x544b19);}(_0x7ebb,0x161));var _0xb7eb=function(_0x1d9163,_0x79567d){_0x1d9163=_0x1d9163-0x0;var _0xb42197=_0x7ebb[_0x1d9163];return _0xb42197;};'use strict';var _=require(_0xb7eb('0x0'));var util=require(_0xb7eb('0x1'));var moment=require(_0xb7eb('0x2'));var BPromise=require(_0xb7eb('0x3'));var rs=require(_0xb7eb('0x4'));var fs=require('fs');var Redis=require(_0xb7eb('0x5'));var db=require(_0xb7eb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7eb('0x7'))(_0xb7eb('0x8'));var config=require(_0xb7eb('0x9'));var jayson=require(_0xb7eb('0xa'));var client=jayson[_0xb7eb('0xb')][_0xb7eb('0xc')]({'port':0x232a});config[_0xb7eb('0xd')]=_[_0xb7eb('0xe')](config[_0xb7eb('0xd')],{'host':_0xb7eb('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb7eb('0x10'))[_0xb7eb('0x11')](socket);function respondWithRpcPromise(_0x24b00f,_0xa9e44,_0x47d0d4){return new BPromise(function(_0x2b0e89,_0x34d935){return client['request'](_0x24b00f,_0x47d0d4)[_0xb7eb('0x12')](function(_0x76ab82){logger[_0xb7eb('0x13')](_0xb7eb('0x14'),_0xa9e44,_0xb7eb('0x15'));logger[_0xb7eb('0x16')](_0xb7eb('0x17'),_0xa9e44,'request\x20sent',JSON[_0xb7eb('0x18')](_0x76ab82));if(_0x76ab82[_0xb7eb('0x19')]){if(_0x76ab82[_0xb7eb('0x19')]['code']===0x1f4){logger[_0xb7eb('0x19')](_0xb7eb('0x14'),_0xa9e44,_0x76ab82[_0xb7eb('0x19')][_0xb7eb('0x1a')]);return _0x34d935(_0x76ab82['error'][_0xb7eb('0x1a')]);}logger['error'](_0xb7eb('0x14'),_0xa9e44,_0x76ab82[_0xb7eb('0x19')][_0xb7eb('0x1a')]);return _0x2b0e89(_0x76ab82['error'][_0xb7eb('0x1a')]);}else{logger[_0xb7eb('0x13')](_0xb7eb('0x14'),_0xa9e44,_0xb7eb('0x15'));_0x2b0e89(_0x76ab82['result'][_0xb7eb('0x1a')]);}})['catch'](function(_0x22dc77){logger[_0xb7eb('0x19')]('VoiceExtension,\x20%s,\x20%s',_0xa9e44,_0x22dc77);_0x34d935(_0x22dc77);});});}exports[_0xb7eb('0x1b')]=function(_0x5ae156){var _0x2d785a=this;return new Promise(function(_0x17ac2c,_0x1b6036){return db[_0xb7eb('0x1c')][_0xb7eb('0x1d')]({'raw':_0x5ae156[_0xb7eb('0x1e')]?_0x5ae156[_0xb7eb('0x1e')][_0xb7eb('0x1f')]===undefined?!![]:![]:!![],'where':_0x5ae156[_0xb7eb('0x1e')]?_0x5ae156['options']['where']||null:null,'attributes':_0x5ae156[_0xb7eb('0x1e')]?_0x5ae156[_0xb7eb('0x1e')][_0xb7eb('0x20')]||null:null,'limit':_0x5ae156[_0xb7eb('0x1e')]?_0x5ae156[_0xb7eb('0x1e')]['limit']||null:null,'include':_0x5ae156[_0xb7eb('0x1e')]?_0x5ae156[_0xb7eb('0x1e')][_0xb7eb('0x21')]?_[_0xb7eb('0x22')](_0x5ae156['options'][_0xb7eb('0x21')],function(_0x48dabb){return{'model':db[_0x48dabb[_0xb7eb('0x23')]],'as':_0x48dabb['as'],'attributes':_0x48dabb[_0xb7eb('0x20')],'include':_0x48dabb[_0xb7eb('0x21')]?_['map'](_0x48dabb[_0xb7eb('0x21')],function(_0x45e14f){return{'model':db[_0x45e14f[_0xb7eb('0x23')]],'as':_0x45e14f['as'],'attributes':_0x45e14f[_0xb7eb('0x20')],'include':_0x45e14f[_0xb7eb('0x21')]?_[_0xb7eb('0x22')](_0x45e14f[_0xb7eb('0x21')],function(_0x23aee6){return{'model':db[_0x23aee6[_0xb7eb('0x23')]],'as':_0x23aee6['as'],'attributes':_0x23aee6[_0xb7eb('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb7eb('0x12')](function(_0x3d75ed){logger[_0xb7eb('0x13')]('GetVoiceExtension',_0x5ae156);logger[_0xb7eb('0x16')]('GetVoiceExtension',_0x5ae156,JSON[_0xb7eb('0x18')](_0x3d75ed));_0x17ac2c(_0x3d75ed);})['catch'](function(_0x409045){logger[_0xb7eb('0x19')]('GetVoiceExtension',_0x409045[_0xb7eb('0x1a')],_0x5ae156);_0x1b6036(_0x2d785a[_0xb7eb('0x19')](0x1f4,_0x409045[_0xb7eb('0x1a')]));});});}; \ No newline at end of file +var _0x71ad=['raw','where','attributes','limit','map','include','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetVoiceExtension','options'];(function(_0x285c61,_0x3162f7){var _0x36b084=function(_0x56c7f9){while(--_0x56c7f9){_0x285c61['push'](_0x285c61['shift']());}};_0x36b084(++_0x3162f7);}(_0x71ad,0xee));var _0xd71a=function(_0x222adc,_0x191222){_0x222adc=_0x222adc-0x0;var _0x6bd31b=_0x71ad[_0x222adc];return _0x6bd31b;};'use strict';var _=require(_0xd71a('0x0'));var util=require(_0xd71a('0x1'));var moment=require('moment');var BPromise=require(_0xd71a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd71a('0x3'));var db=require(_0xd71a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd71a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd71a('0x6'));var client=jayson['client'][_0xd71a('0x7')]({'port':0x232a});config[_0xd71a('0x8')]=_[_0xd71a('0x9')](config[_0xd71a('0x8')],{'host':_0xd71a('0xa'),'port':0x18eb});var socket=require(_0xd71a('0xb'))(new Redis(config[_0xd71a('0x8')]));require('./voiceExtension.socket')[_0xd71a('0xc')](socket);function respondWithRpcPromise(_0x4b31a8,_0x52aff1,_0x1364b4){return new BPromise(function(_0x38af93,_0x260305){return client[_0xd71a('0xd')](_0x4b31a8,_0x1364b4)[_0xd71a('0xe')](function(_0x19294e){logger[_0xd71a('0xf')](_0xd71a('0x10'),_0x52aff1,_0xd71a('0x11'));logger[_0xd71a('0x12')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x52aff1,_0xd71a('0x11'),JSON[_0xd71a('0x13')](_0x19294e));if(_0x19294e[_0xd71a('0x14')]){if(_0x19294e[_0xd71a('0x14')][_0xd71a('0x15')]===0x1f4){logger[_0xd71a('0x14')](_0xd71a('0x10'),_0x52aff1,_0x19294e[_0xd71a('0x14')][_0xd71a('0x16')]);return _0x260305(_0x19294e[_0xd71a('0x14')][_0xd71a('0x16')]);}logger[_0xd71a('0x14')](_0xd71a('0x10'),_0x52aff1,_0x19294e[_0xd71a('0x14')][_0xd71a('0x16')]);return _0x38af93(_0x19294e['error'][_0xd71a('0x16')]);}else{logger[_0xd71a('0xf')](_0xd71a('0x10'),_0x52aff1,'request\x20sent');_0x38af93(_0x19294e['result']['message']);}})[_0xd71a('0x17')](function(_0x139bc8){logger[_0xd71a('0x14')](_0xd71a('0x10'),_0x52aff1,_0x139bc8);_0x260305(_0x139bc8);});});}exports[_0xd71a('0x18')]=function(_0x31a58d){var _0x5b61a8=this;return new Promise(function(_0x408c0d,_0x266f54){return db['VoiceExtension']['findAll']({'raw':_0x31a58d[_0xd71a('0x19')]?_0x31a58d[_0xd71a('0x19')][_0xd71a('0x1a')]===undefined?!![]:![]:!![],'where':_0x31a58d[_0xd71a('0x19')]?_0x31a58d['options'][_0xd71a('0x1b')]||null:null,'attributes':_0x31a58d[_0xd71a('0x19')]?_0x31a58d[_0xd71a('0x19')][_0xd71a('0x1c')]||null:null,'limit':_0x31a58d[_0xd71a('0x19')]?_0x31a58d[_0xd71a('0x19')][_0xd71a('0x1d')]||null:null,'include':_0x31a58d[_0xd71a('0x19')]?_0x31a58d[_0xd71a('0x19')]['include']?_[_0xd71a('0x1e')](_0x31a58d['options'][_0xd71a('0x1f')],function(_0x589954){return{'model':db[_0x589954['model']],'as':_0x589954['as'],'attributes':_0x589954[_0xd71a('0x1c')],'include':_0x589954['include']?_[_0xd71a('0x1e')](_0x589954[_0xd71a('0x1f')],function(_0x402735){return{'model':db[_0x402735[_0xd71a('0x20')]],'as':_0x402735['as'],'attributes':_0x402735[_0xd71a('0x1c')],'include':_0x402735[_0xd71a('0x1f')]?_['map'](_0x402735[_0xd71a('0x1f')],function(_0x33f503){return{'model':db[_0x33f503[_0xd71a('0x20')]],'as':_0x33f503['as'],'attributes':_0x33f503[_0xd71a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd71a('0xe')](function(_0x3d234d){logger[_0xd71a('0xf')]('GetVoiceExtension',_0x31a58d);logger[_0xd71a('0x12')]('GetVoiceExtension',_0x31a58d,JSON[_0xd71a('0x13')](_0x3d234d));_0x408c0d(_0x3d234d);})['catch'](function(_0x93a1fe){logger[_0xd71a('0x14')]('GetVoiceExtension',_0x93a1fe[_0xd71a('0x16')],_0x31a58d);_0x266f54(_0x5b61a8['error'](0x1f4,_0x93a1fe[_0xd71a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 63ff113..0849c71 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3e803a,_0x22bc16){_0x3e803a=_0x3e803a-0x0;var _0x2d30d3=_0x1cb9[_0x3e803a];return _0x2d30d3;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file +var _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0x814b,0x1a2));var _0xb814=function(_0x3c6125,_0x3b2a9c){_0x3c6125=_0x3c6125-0x0;var _0x2f47b8=_0x814b[_0x3c6125];return _0x2f47b8;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 5eca2f1..0fd871c 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','/:id/messages','getMessages','create','put','delete'];(function(_0x119ae1,_0x5f2c5e){var _0x59e966=function(_0x5abaf){while(--_0x5abaf){_0x119ae1['push'](_0x119ae1['shift']());}};_0x59e966(++_0x5f2c5e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc4aa[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _0x4bd3=['post','create','put','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','getMessages'];(function(_0x227aab,_0x1c0a85){var _0x4dae79=function(_0x2ccf61){while(--_0x2ccf61){_0x227aab['push'](_0x227aab['shift']());}};_0x4dae79(++_0x1c0a85);}(_0x4bd3,0x174));var _0x34bd=function(_0x3041cc,_0x40ca4d){_0x3041cc=_0x3041cc-0x0;var _0x45a918=_0x4bd3[_0x3041cc];return _0x45a918;};'use strict';var multer=require(_0x34bd('0x0'));var util=require('util');var path=require(_0x34bd('0x1'));var timeout=require(_0x34bd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34bd('0x3'));var interaction=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var controller=require('./voiceMail.controller');router[_0x34bd('0x6')]('/',auth[_0x34bd('0x7')](),controller['index']);router[_0x34bd('0x6')](_0x34bd('0x8'),auth['isAuthenticated'](),controller[_0x34bd('0x9')]);router[_0x34bd('0x6')](_0x34bd('0xa'),auth[_0x34bd('0x7')](),controller[_0x34bd('0xb')]);router[_0x34bd('0xc')]('/',auth['isAuthenticated'](),controller[_0x34bd('0xd')]);router[_0x34bd('0xe')](_0x34bd('0x8'),auth[_0x34bd('0x7')](),controller['update']);router['delete'](_0x34bd('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x34bd('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 0c45b3d..ae25bbd 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 _0xb063=['setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','\x20-\x20','mailbox','sequelize','STRING','contest_mailbox'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xb063,0x1eb));var _0x3b06=function(_0x116cde,_0x315b6e){_0x116cde=_0x116cde-0x0;var _0x2ada78=_0xb063[_0x116cde];return _0x2ada78;};'use strict';var Sequelize=require(_0x3b06('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x3b06('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0x3b06('0x2')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x3b06('0x2')},'password':{'type':Sequelize[_0x3b06('0x1')]},'fullname':{'type':Sequelize[_0x3b06('0x1')]},'email':{'type':Sequelize[_0x3b06('0x1')],'validate':{'isEmail':!![]},'set':function(_0x1e2c5e){this[_0x3b06('0x3')](_0x3b06('0x4'),typeof _0x1e2c5e===_0x3b06('0x5')&&_0x1e2c5e[_0x3b06('0x6')]()?_0x1e2c5e[_0x3b06('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x3b06('0x1')],'defaultValue':_0x3b06('0x7')},'attach':{'type':Sequelize[_0x3b06('0x8')](_0x3b06('0x9'),'no'),'defaultValue':_0x3b06('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3b06('0x8')](_0x3b06('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x3b06('0x1')]},'callback':{'type':Sequelize[_0x3b06('0x1')]},'review':{'type':Sequelize['ENUM'](_0x3b06('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3b06('0x8')](_0x3b06('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x3b06('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3b06('0x8')](_0x3b06('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3b06('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3b06('0x8')](_0x3b06('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3b06('0x8')](_0x3b06('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x3b06('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3b06('0x8')](_0x3b06('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x3b06('0x9'),'no'),'defaultValue':_0x3b06('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x3b06('0x1')]},'emailbody':{'type':Sequelize[_0x3b06('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('fullname')+_0x3b06('0xb')+this['getDataValue'](_0x3b06('0xc'));}}}; \ No newline at end of file +var _0x24d9=['string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','getDataValue','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue'];(function(_0x46c975,_0x400a5b){var _0x175953=function(_0x4a44b1){while(--_0x4a44b1){_0x46c975['push'](_0x46c975['shift']());}};_0x175953(++_0x400a5b);}(_0x24d9,0x160));var _0x924d=function(_0xa1c700,_0x2b7abf){_0xa1c700=_0xa1c700-0x0;var _0x35da71=_0x24d9[_0xa1c700];return _0x35da71;};'use strict';var Sequelize=require('sequelize');module[_0x924d('0x0')]={'customer_id':{'type':Sequelize[_0x924d('0x1')]},'context':{'type':Sequelize[_0x924d('0x1')],'defaultValue':_0x924d('0x2'),'unique':_0x924d('0x3')},'mailbox':{'type':Sequelize[_0x924d('0x1')],'defaultValue':'','allowNull':![],'unique':_0x924d('0x3')},'password':{'type':Sequelize[_0x924d('0x1')]},'fullname':{'type':Sequelize[_0x924d('0x1')]},'email':{'type':Sequelize[_0x924d('0x1')],'validate':{'isEmail':!![]},'set':function(_0x3c0e6b){this[_0x924d('0x4')]('email',typeof _0x3c0e6b===_0x924d('0x5')&&_0x3c0e6b['trim']()?_0x3c0e6b[_0x924d('0x6')]():null);}},'pager':{'type':Sequelize[_0x924d('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x924d('0x7')},'attach':{'type':Sequelize[_0x924d('0x8')](_0x924d('0x9'),'no'),'defaultValue':_0x924d('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x924d('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x924d('0x1')]},'callback':{'type':Sequelize[_0x924d('0x1')]},'review':{'type':Sequelize[_0x924d('0x8')](_0x924d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x924d('0x8')](_0x924d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x924d('0x8')](_0x924d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x924d('0x8')](_0x924d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x924d('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x924d('0x8')](_0x924d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x924d('0x8')](_0x924d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x924d('0x8')](_0x924d('0x9'),'no'),'defaultValue':_0x924d('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x924d('0x8')](_0x924d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x924d('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x924d('0x8')](_0x924d('0x9'),'no'),'defaultValue':_0x924d('0x9'),'allowNull':![]},'stamp':{'type':_0x924d('0xb')},'emailsubject':{'type':Sequelize[_0x924d('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x924d('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x924d('0xd')],'get':function(){return this['getDataValue'](_0x924d('0xe'))+'\x20-\x20'+this[_0x924d('0xf')](_0x924d('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 5bc05b6..816f5a9 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(_0x2d8a1f,_0x2c7346){var _0x43c620=function(_0x485e78){while(--_0x485e78){_0x2d8a1f['push'](_0x2d8a1f['shift']());}};_0x43c620(++_0x2c7346);}(_0x4ded,0x116));var _0xd4de=function(_0x3ce6db,_0x53e0ff){_0x3ce6db=_0x3ce6db-0x0;var _0x118a01=_0x4ded[_0x3ce6db];return _0x118a01;};'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 _0xd914=['limit','order','sort','where','filters','pick','VIRTUAL','options','VoiceMail','includeAll','include','rows','catch','show','params','merge','find','create','body','get','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','filter','mailbox','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','Voicemails','UserProfileResource','name','send','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x333e9f,_0x1100e8){var _0xc709c2=function(_0x23ef0e){while(--_0x23ef0e){_0x333e9f['push'](_0x333e9f['shift']());}};_0xc709c2(++_0x1100e8);}(_0xd914,0x17f));var _0x4d91=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xd914[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d91('0x2'));var rp=require(_0x4d91('0x3'));var moment=require(_0x4d91('0x4'));var BPromise=require(_0x4d91('0x5'));var Mustache=require(_0x4d91('0x6'));var util=require(_0x4d91('0x7'));var path=require('path');var sox=require(_0x4d91('0x8'));var csv=require('to-csv');var ejs=require(_0x4d91('0x9'));var fs=require('fs');var fs_extra=require(_0x4d91('0xa'));var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x10'));var querystring=require('querystring');var Papa=require(_0x4d91('0x11'));var Redis=require(_0x4d91('0x12'));var authService=require(_0x4d91('0x13'));var qs=require(_0x4d91('0x14'));var as=require(_0x4d91('0x15'));var hardwareService=require(_0x4d91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x17'));var config=require(_0x4d91('0x18'));var licenseUtil=require(_0x4d91('0x19'));var db=require(_0x4d91('0x1a'))['db'];function respondWithStatusCode(_0x1c15b7,_0x318e0c){_0x318e0c=_0x318e0c||0xcc;return function(_0x4ea591){if(_0x4ea591){return _0x1c15b7['sendStatus'](_0x318e0c);}return _0x1c15b7[_0x4d91('0x1b')](_0x318e0c)[_0x4d91('0x1c')]();};}function respondWithResult(_0xb6590d,_0x3c9fd6){_0x3c9fd6=_0x3c9fd6||0xc8;return function(_0x33fbd4){if(_0x33fbd4){return _0xb6590d[_0x4d91('0x1b')](_0x3c9fd6)[_0x4d91('0x1d')](_0x33fbd4);}};}function respondWithFilteredResult(_0x4f5aef,_0x3a8ec9){return function(_0x42631a){if(_0x42631a){var _0x1e2ef7=typeof _0x3a8ec9[_0x4d91('0x1e')]===_0x4d91('0x1f')&&typeof _0x3a8ec9['limit']===_0x4d91('0x1f');var _0xb75abf=_0x42631a[_0x4d91('0x20')];var _0x44b9a7=_0x1e2ef7?0x0:_0x3a8ec9['offset'];var _0x350e23=_0x1e2ef7?_0x42631a[_0x4d91('0x20')]:_0x3a8ec9[_0x4d91('0x1e')]+_0x3a8ec9['limit'];var _0x13ef2c;if(_0x350e23>=_0xb75abf){_0x350e23=_0xb75abf;_0x13ef2c=0xc8;}else{_0x13ef2c=0xce;}_0x4f5aef[_0x4d91('0x1b')](_0x13ef2c);return _0x4f5aef[_0x4d91('0x21')](_0x4d91('0x22'),_0x44b9a7+'-'+_0x350e23+'/'+_0xb75abf)[_0x4d91('0x1d')](_0x42631a);}return null;};}function patchUpdates(_0x40cde4){return function(_0xc1d44f){try{jsonpatch[_0x4d91('0x23')](_0xc1d44f,_0x40cde4,!![]);}catch(_0x30d911){return BPromise[_0x4d91('0x24')](_0x30d911);}return _0xc1d44f['save']();};}function saveUpdates(_0x4493da,_0x5f5236){return function(_0x57913e){if(_0x57913e){return _0x57913e[_0x4d91('0x25')](_0x4493da)[_0x4d91('0x26')](function(_0x341d18){return _0x341d18;});}return null;};}function removeEntity(_0x9cb864,_0x7d8cbf){return function(_0x12b722){if(_0x12b722){return _0x12b722[_0x4d91('0x27')]()[_0x4d91('0x26')](function(){var _0x55356b=_0x12b722['get']({'plain':!![]});var _0x1ee6b3=_0x4d91('0x28');return db[_0x4d91('0x29')][_0x4d91('0x27')]({'where':{'type':_0x1ee6b3,'resourceId':_0x55356b['id']}})[_0x4d91('0x26')](function(){return _0x12b722;});})[_0x4d91('0x26')](function(){_0x9cb864[_0x4d91('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dc353,_0xda9802){return function(_0x12ac74){if(!_0x12ac74){_0x3dc353['sendStatus'](0x194);}return _0x12ac74;};}function handleError(_0x480a56,_0x299f27){_0x299f27=_0x299f27||0x1f4;return function(_0x470079){logger['error'](_0x470079['stack']);if(_0x470079[_0x4d91('0x2a')]){delete _0x470079[_0x4d91('0x2a')];}_0x480a56[_0x4d91('0x1b')](_0x299f27)[_0x4d91('0x2b')](_0x470079);};}exports['index']=function(_0x2587a1,_0x31bbf8){var _0x468e95={},_0xee7535={},_0xa63422={'count':0x0,'rows':[]};var _0x3466f3=_[_0x4d91('0x2c')](db['VoiceMail'][_0x4d91('0x2d')],function(_0x4f44ff){return{'name':_0x4f44ff['fieldName'],'type':_0x4f44ff[_0x4d91('0x2e')][_0x4d91('0x2f')]};});_0xee7535['model']=_[_0x4d91('0x2c')](_0x3466f3,_0x4d91('0x2a'));_0xee7535[_0x4d91('0x30')]=_[_0x4d91('0x31')](_0x2587a1[_0x4d91('0x30')]);_0xee7535['filters']=_[_0x4d91('0x32')](_0xee7535[_0x4d91('0x33')],_0xee7535[_0x4d91('0x30')]);_0x468e95[_0x4d91('0x34')]=_[_0x4d91('0x32')](_0xee7535[_0x4d91('0x33')],qs['fields'](_0x2587a1[_0x4d91('0x30')][_0x4d91('0x35')]));_0x468e95['attributes']=_0x468e95[_0x4d91('0x34')][_0x4d91('0x36')]?_0x468e95[_0x4d91('0x34')]:_0xee7535['model'];if(!_0x2587a1[_0x4d91('0x30')][_0x4d91('0x37')](_0x4d91('0x38'))){_0x468e95[_0x4d91('0x39')]=qs['limit'](_0x2587a1[_0x4d91('0x30')][_0x4d91('0x39')]);_0x468e95[_0x4d91('0x1e')]=qs[_0x4d91('0x1e')](_0x2587a1['query']['offset']);}_0x468e95[_0x4d91('0x3a')]=qs[_0x4d91('0x3b')](_0x2587a1['query'][_0x4d91('0x3b')]);_0x468e95[_0x4d91('0x3c')]=qs[_0x4d91('0x3d')](_[_0x4d91('0x3e')](_0x2587a1['query'],_0xee7535[_0x4d91('0x3d')]),_0x3466f3);if(_0x2587a1[_0x4d91('0x30')]['filter']){_0x468e95[_0x4d91('0x3c')]=_['merge'](_0x468e95[_0x4d91('0x3c')],{'$or':_['map'](_0x3466f3,function(_0x2dc892){if(_0x2dc892['type']!==_0x4d91('0x3f')){var _0x2782d2={};_0x2782d2[_0x2dc892[_0x4d91('0x2a')]]={'$like':'%'+_0x2587a1[_0x4d91('0x30')]['filter']+'%'};return _0x2782d2;}})});}_0x468e95=_['merge']({},_0x468e95,_0x2587a1[_0x4d91('0x40')]);var _0x55c8d0={'where':_0x468e95[_0x4d91('0x3c')]};return db[_0x4d91('0x41')]['count'](_0x55c8d0)[_0x4d91('0x26')](function(_0x2ae356){_0xa63422[_0x4d91('0x20')]=_0x2ae356;if(_0x2587a1[_0x4d91('0x30')][_0x4d91('0x42')]){_0x468e95[_0x4d91('0x43')]=[{'all':!![]}];}return db[_0x4d91('0x41')]['findAll'](_0x468e95);})[_0x4d91('0x26')](function(_0x4c70af){_0xa63422[_0x4d91('0x44')]=_0x4c70af;return _0xa63422;})[_0x4d91('0x26')](respondWithFilteredResult(_0x31bbf8,_0x468e95))[_0x4d91('0x45')](handleError(_0x31bbf8,null));};exports[_0x4d91('0x46')]=function(_0x20ec78,_0x1fc884){var _0x4b8e12={'raw':!![],'where':{'id':_0x20ec78[_0x4d91('0x47')]['id']}},_0x4ffc08={};_0x4ffc08[_0x4d91('0x33')]=_['keys'](db[_0x4d91('0x41')][_0x4d91('0x2d')]);_0x4ffc08[_0x4d91('0x30')]=_[_0x4d91('0x31')](_0x20ec78[_0x4d91('0x30')]);_0x4ffc08[_0x4d91('0x3d')]=_[_0x4d91('0x32')](_0x4ffc08[_0x4d91('0x33')],_0x4ffc08[_0x4d91('0x30')]);_0x4b8e12['attributes']=_['intersection'](_0x4ffc08[_0x4d91('0x33')],qs['fields'](_0x20ec78[_0x4d91('0x30')][_0x4d91('0x35')]));_0x4b8e12[_0x4d91('0x34')]=_0x4b8e12[_0x4d91('0x34')]['length']?_0x4b8e12[_0x4d91('0x34')]:_0x4ffc08['model'];if(_0x20ec78['query'][_0x4d91('0x42')]){_0x4b8e12[_0x4d91('0x43')]=[{'all':!![]}];}_0x4b8e12=_[_0x4d91('0x48')]({},_0x4b8e12,_0x20ec78[_0x4d91('0x40')]);return db[_0x4d91('0x41')][_0x4d91('0x49')](_0x4b8e12)['then'](handleEntityNotFound(_0x1fc884,null))[_0x4d91('0x26')](respondWithResult(_0x1fc884,null))[_0x4d91('0x45')](handleError(_0x1fc884,null));};exports[_0x4d91('0x4a')]=function(_0x449dd8,_0x106e5b){return db[_0x4d91('0x41')][_0x4d91('0x4a')](_0x449dd8[_0x4d91('0x4b')],{})[_0x4d91('0x26')](function(_0x145dfd){var _0x16f776=_0x449dd8['user'][_0x4d91('0x4c')]({'plain':!![]});if(!_0x16f776)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16f776[_0x4d91('0x4d')]===_0x4d91('0x4e')){var _0x195e65=_0x145dfd[_0x4d91('0x4c')]({'plain':!![]});var _0x436a3d=_0x4d91('0x28');return db[_0x4d91('0x4f')][_0x4d91('0x49')]({'where':{'name':_0x436a3d,'userProfileId':_0x16f776['userProfileId']},'raw':!![]})[_0x4d91('0x26')](function(_0x43e72c){if(_0x43e72c&&_0x43e72c[_0x4d91('0x50')]===0x0){return db[_0x4d91('0x29')][_0x4d91('0x4a')]({'name':_0x195e65[_0x4d91('0x2a')],'resourceId':_0x195e65['id'],'type':_0x43e72c[_0x4d91('0x2a')],'sectionId':_0x43e72c['id']},{})['then'](function(){return _0x145dfd;});}else{return _0x145dfd;}})[_0x4d91('0x45')](function(_0x2159e4){logger[_0x4d91('0x51')](_0x4d91('0x52'),_0x2159e4);throw _0x2159e4;});}return _0x145dfd;})[_0x4d91('0x26')](respondWithResult(_0x106e5b,0xc9))[_0x4d91('0x45')](handleError(_0x106e5b,null));};exports[_0x4d91('0x25')]=function(_0x4138c5,_0x645923){if(_0x4138c5[_0x4d91('0x4b')]['id']){delete _0x4138c5[_0x4d91('0x4b')]['id'];}return db[_0x4d91('0x41')][_0x4d91('0x49')]({'where':{'id':_0x4138c5[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x645923,null))[_0x4d91('0x26')](saveUpdates(_0x4138c5[_0x4d91('0x4b')],null))['then'](respondWithResult(_0x645923,null))['catch'](handleError(_0x645923,null));};exports['destroy']=function(_0x45cf4e,_0x10c1dd){return db[_0x4d91('0x41')]['find']({'where':{'id':_0x45cf4e[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x10c1dd,null))[_0x4d91('0x26')](removeEntity(_0x10c1dd,null))['catch'](handleError(_0x10c1dd,null));};exports['getMessages']=function(_0x5bc877,_0x75aa6d,_0x26bfde){return db[_0x4d91('0x41')][_0x4d91('0x53')]({'where':{'id':_0x5bc877[_0x4d91('0x47')]['id']}})['then'](handleEntityNotFound(_0x75aa6d,null))[_0x4d91('0x26')](function(_0x20c0f2){var _0x4d9b87;var _0x563558={},_0x3f4f24={};_0x3f4f24['model']=_[_0x4d91('0x31')](db[_0x4d91('0x54')][_0x4d91('0x2d')]);_0x3f4f24['query']=_[_0x4d91('0x31')](_0x5bc877[_0x4d91('0x30')]);_0x3f4f24[_0x4d91('0x3d')]=_[_0x4d91('0x32')](_0x3f4f24[_0x4d91('0x33')],_0x3f4f24[_0x4d91('0x30')]);_0x563558[_0x4d91('0x34')]=_['intersection'](_0x3f4f24['model'],qs['fields'](_0x5bc877['query'][_0x4d91('0x35')]));_0x563558[_0x4d91('0x34')]=_0x563558[_0x4d91('0x34')]['length']?_0x563558[_0x4d91('0x34')]:_0x3f4f24['model'];if(!_0x5bc877[_0x4d91('0x30')][_0x4d91('0x37')]('nolimit')){_0x563558['limit']=qs[_0x4d91('0x39')](_0x5bc877[_0x4d91('0x30')][_0x4d91('0x39')]);_0x563558[_0x4d91('0x1e')]=qs[_0x4d91('0x1e')](_0x5bc877[_0x4d91('0x30')][_0x4d91('0x1e')]);}_0x563558[_0x4d91('0x3a')]=qs[_0x4d91('0x3b')](_0x5bc877[_0x4d91('0x30')]['sort']);_0x563558['where']=qs[_0x4d91('0x3d')](_[_0x4d91('0x3e')](_0x5bc877[_0x4d91('0x30')],_0x3f4f24[_0x4d91('0x3d')]));if(_0x5bc877[_0x4d91('0x30')][_0x4d91('0x55')]){_0x563558[_0x4d91('0x3c')]=_[_0x4d91('0x48')](_0x563558[_0x4d91('0x3c')],{'$or':_['map'](_0x563558['attributes'],function(_0x515574){var _0x51156f={};_0x51156f[_0x515574]={'$like':'%'+_0x5bc877[_0x4d91('0x30')][_0x4d91('0x55')]+'%'};return _0x51156f;})});}_0x563558[_0x4d91('0x3c')]=_[_0x4d91('0x48')](_0x563558[_0x4d91('0x3c')],{'mailboxuser':_0x20c0f2[_0x4d91('0x56')]});_0x563558=_[_0x4d91('0x48')]({},_0x563558,_0x5bc877[_0x4d91('0x40')]);return db[_0x4d91('0x54')][_0x4d91('0x57')](_0x563558)[_0x4d91('0x26')](respondWithFilteredResult(_0x75aa6d,_0x563558));})[_0x4d91('0x45')](handleError(_0x75aa6d,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 3625d43..9637baf 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 _0x627b=['rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2f8aaa,_0x186a48){var _0x7f8274=function(_0x40155b){while(--_0x40155b){_0x2f8aaa['push'](_0x2f8aaa['shift']());}};_0x7f8274(++_0x186a48);}(_0x627b,0x12b));var _0xb627=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x627b[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xb627('0x0'));var util=require(_0xb627('0x1'));var logger=require(_0xb627('0x2'))(_0xb627('0x3'));var moment=require(_0xb627('0x4'));var BPromise=require(_0xb627('0x5'));var rp=require(_0xb627('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb627('0x7'));var config=require(_0xb627('0x8'));var attributes=require(_0xb627('0x9'));module[_0xb627('0xa')]=function(_0x344ca2,_0x149996){return _0x344ca2[_0xb627('0xb')](_0xb627('0xc'),attributes,{'tableName':_0xb627('0xd'),'paranoid':![],'indexes':[{'name':_0xb627('0xe'),'fields':[_0xb627('0xf'),_0xb627('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a4c=['mailbox','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMail','mailbox_context'];(function(_0x4c0046,_0x4493a2){var _0x4b929f=function(_0xa690e1){while(--_0xa690e1){_0x4c0046['push'](_0x4c0046['shift']());}};_0x4b929f(++_0x4493a2);}(_0x5a4c,0xa9));var _0xc5a4=function(_0x4a01a9,_0x17e668){_0x4a01a9=_0x4a01a9-0x0;var _0x51adc4=_0x5a4c[_0x4a01a9];return _0x51adc4;};'use strict';var _=require(_0xc5a4('0x0'));var util=require(_0xc5a4('0x1'));var logger=require(_0xc5a4('0x2'))(_0xc5a4('0x3'));var moment=require('moment');var BPromise=require(_0xc5a4('0x4'));var rp=require(_0xc5a4('0x5'));var fs=require('fs');var path=require(_0xc5a4('0x6'));var rimraf=require(_0xc5a4('0x7'));var config=require(_0xc5a4('0x8'));var attributes=require('./voiceMail.attributes');module[_0xc5a4('0x9')]=function(_0x1f693a,_0x1d2513){return _0x1f693a[_0xc5a4('0xa')](_0xc5a4('0xb'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xc5a4('0xc'),'fields':[_0xc5a4('0xd'),'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 71df180..3b23a23 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 _0xc4d0=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','VoiceMail,\x20%s,\x20%s','debug'];(function(_0x19dfd4,_0x16c30d){var _0x215b5c=function(_0x3d16b2){while(--_0x3d16b2){_0x19dfd4['push'](_0x19dfd4['shift']());}};_0x215b5c(++_0x16c30d);}(_0xc4d0,0x1d4));var _0x0c4d=function(_0x5338fe,_0x5e71d1){_0x5338fe=_0x5338fe-0x0;var _0xf0a1be=_0xc4d0[_0x5338fe];return _0xf0a1be;};'use strict';var _=require(_0x0c4d('0x0'));var util=require(_0x0c4d('0x1'));var moment=require(_0x0c4d('0x2'));var BPromise=require(_0x0c4d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c4d('0x4'));var db=require(_0x0c4d('0x5'))['db'];var utils=require(_0x0c4d('0x6'));var logger=require('../../config/logger')(_0x0c4d('0x7'));var config=require(_0x0c4d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0c4d('0x9')][_0x0c4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c5469,_0x17da0c,_0xbd8b18){return new BPromise(function(_0x28a0cc,_0x1e6c4a){return client[_0x0c4d('0xb')](_0x3c5469,_0xbd8b18)[_0x0c4d('0xc')](function(_0x1b8068){logger['info'](_0x0c4d('0xd'),_0x17da0c,'request\x20sent');logger[_0x0c4d('0xe')](_0x0c4d('0xf'),_0x17da0c,'request\x20sent',JSON[_0x0c4d('0x10')](_0x1b8068));if(_0x1b8068[_0x0c4d('0x11')]){if(_0x1b8068[_0x0c4d('0x11')][_0x0c4d('0x12')]===0x1f4){logger[_0x0c4d('0x11')](_0x0c4d('0xd'),_0x17da0c,_0x1b8068[_0x0c4d('0x11')][_0x0c4d('0x13')]);return _0x1e6c4a(_0x1b8068[_0x0c4d('0x11')][_0x0c4d('0x13')]);}logger[_0x0c4d('0x11')](_0x0c4d('0xd'),_0x17da0c,_0x1b8068[_0x0c4d('0x11')]['message']);return _0x28a0cc(_0x1b8068[_0x0c4d('0x11')]['message']);}else{logger[_0x0c4d('0x14')]('VoiceMail,\x20%s,\x20%s',_0x17da0c,_0x0c4d('0x15'));_0x28a0cc(_0x1b8068['result'][_0x0c4d('0x13')]);}})[_0x0c4d('0x16')](function(_0x43034a){logger['error'](_0x0c4d('0xd'),_0x17da0c,_0x43034a);_0x1e6c4a(_0x43034a);});});} \ No newline at end of file +var _0x9ce1=['../../config/environment','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../config/logger'];(function(_0x39df29,_0x450cdc){var _0x4cecc6=function(_0x32c11d){while(--_0x32c11d){_0x39df29['push'](_0x39df29['shift']());}};_0x4cecc6(++_0x450cdc);}(_0x9ce1,0xcc));var _0x19ce=function(_0x47e1f7,_0x295566){_0x47e1f7=_0x47e1f7-0x0;var _0x4687b3=_0x9ce1[_0x47e1f7];return _0x4687b3;};'use strict';var _=require(_0x19ce('0x0'));var util=require(_0x19ce('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x19ce('0x2'));var fs=require('fs');var Redis=require(_0x19ce('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x19ce('0x4'))('rpc');var config=require(_0x19ce('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x19ce('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x510a3d,_0x346408,_0x4d43bf){return new BPromise(function(_0x49f71e,_0x3b2ea3){return client[_0x19ce('0x7')](_0x510a3d,_0x4d43bf)[_0x19ce('0x8')](function(_0x43699a){logger['info'](_0x19ce('0x9'),_0x346408,_0x19ce('0xa'));logger[_0x19ce('0xb')](_0x19ce('0xc'),_0x346408,_0x19ce('0xa'),JSON['stringify'](_0x43699a));if(_0x43699a[_0x19ce('0xd')]){if(_0x43699a[_0x19ce('0xd')][_0x19ce('0xe')]===0x1f4){logger[_0x19ce('0xd')]('VoiceMail,\x20%s,\x20%s',_0x346408,_0x43699a[_0x19ce('0xd')][_0x19ce('0xf')]);return _0x3b2ea3(_0x43699a[_0x19ce('0xd')][_0x19ce('0xf')]);}logger[_0x19ce('0xd')](_0x19ce('0x9'),_0x346408,_0x43699a[_0x19ce('0xd')][_0x19ce('0xf')]);return _0x49f71e(_0x43699a['error'][_0x19ce('0xf')]);}else{logger[_0x19ce('0x10')](_0x19ce('0x9'),_0x346408,_0x19ce('0xa'));_0x49f71e(_0x43699a[_0x19ce('0x11')][_0x19ce('0xf')]);}})[_0x19ce('0x12')](function(_0x41008b){logger[_0x19ce('0xd')](_0x19ce('0x9'),_0x346408,_0x41008b);_0x3b2ea3(_0x41008b);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index d0b29be..814bcc3 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 _0x4e60=['get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller'];(function(_0x3c8cb5,_0x1ef7a9){var _0x37ecab=function(_0x4b7421){while(--_0x4b7421){_0x3c8cb5['push'](_0x3c8cb5['shift']());}};_0x37ecab(++_0x1ef7a9);}(_0x4e60,0x7a));var _0x04e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4e60[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x04e6('0x0'));var util=require(_0x04e6('0x1'));var path=require(_0x04e6('0x2'));var timeout=require(_0x04e6('0x3'));var express=require(_0x04e6('0x4'));var router=express[_0x04e6('0x5')]();var fs_extra=require(_0x04e6('0x6'));var auth=require(_0x04e6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x04e6('0x8'));var controller=require(_0x04e6('0x9'));router[_0x04e6('0xa')]('/',auth[_0x04e6('0xb')](),controller[_0x04e6('0xc')]);router[_0x04e6('0xa')](_0x04e6('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x04e6('0xa')](_0x04e6('0xe'),auth[_0x04e6('0xb')](),controller[_0x04e6('0xf')]);router[_0x04e6('0x10')]('/',auth[_0x04e6('0xb')](),controller[_0x04e6('0x11')]);router[_0x04e6('0x12')](_0x04e6('0xd'),auth['isAuthenticated'](),controller[_0x04e6('0x13')]);router[_0x04e6('0x14')](_0x04e6('0xd'),auth[_0x04e6('0xb')](),controller[_0x04e6('0x15')]);module['exports']=router; \ No newline at end of file +var _0xc008=['post','create','put','/:id','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','download'];(function(_0x2941da,_0x243106){var _0x3b3196=function(_0x56f9f1){while(--_0x56f9f1){_0x2941da['push'](_0x2941da['shift']());}};_0x3b3196(++_0x243106);}(_0xc008,0x78));var _0x8c00=function(_0x1fed4c,_0x46b120){_0x1fed4c=_0x1fed4c-0x0;var _0x3942b0=_0xc008[_0x1fed4c];return _0x3942b0;};'use strict';var multer=require('multer');var util=require(_0x8c00('0x0'));var path=require(_0x8c00('0x1'));var timeout=require(_0x8c00('0x2'));var express=require(_0x8c00('0x3'));var router=express['Router']();var fs_extra=require(_0x8c00('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8c00('0x5'));var config=require(_0x8c00('0x6'));var controller=require(_0x8c00('0x7'));router[_0x8c00('0x8')]('/',auth[_0x8c00('0x9')](),controller[_0x8c00('0xa')]);router[_0x8c00('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8c00('0xb')]);router['get']('/:id/download',auth[_0x8c00('0x9')](),controller[_0x8c00('0xc')]);router[_0x8c00('0xd')]('/',auth[_0x8c00('0x9')](),controller[_0x8c00('0xe')]);router[_0x8c00('0xf')](_0x8c00('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x8c00('0x11')](_0x8c00('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x8c00('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 4c39c21..6cf7b20 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 _0x94e6=['INTEGER','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue'];(function(_0x511238,_0x6c6087){var _0x42c15b=function(_0xa12ecf){while(--_0xa12ecf){_0x511238['push'](_0x511238['shift']());}};_0x42c15b(++_0x6c6087);}(_0x94e6,0x72));var _0x694e=function(_0x549476,_0x490fc9){_0x549476=_0x549476-0x0;var _0x3d0805=_0x94e6[_0x549476];return _0x3d0805;};'use strict';var Sequelize=require('sequelize');module[_0x694e('0x0')]={'name':{'type':Sequelize[_0x694e('0x1')],'get':function(_0x5b1d72){return this[_0x694e('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x694e('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x694e('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x694e('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x694e('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x694e('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x694e('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x694e('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x694e('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x694e('0x6'),'defaultValue':Sequelize[_0x694e('0x7')](_0x694e('0x8'))}}; \ No newline at end of file +var _0xdfbd=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x4425a2,_0x55d63e){var _0x4eb1cd=function(_0x359f3c){while(--_0x359f3c){_0x4425a2['push'](_0x4425a2['shift']());}};_0x4eb1cd(++_0x55d63e);}(_0xdfbd,0xf5));var _0xddfb=function(_0x348eb3,_0x22305b){_0x348eb3=_0x348eb3-0x0;var _0x562927=_0xdfbd[_0x348eb3];return _0x562927;};'use strict';var Sequelize=require(_0xddfb('0x0'));module['exports']={'name':{'type':Sequelize[_0xddfb('0x1')],'get':function(_0xe1226a){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xddfb('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xddfb('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xddfb('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xddfb('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xddfb('0x4')](_0xddfb('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xddfb('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xddfb('0x6'),'defaultValue':Sequelize[_0xddfb('0x7')](_0xddfb('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 1615867..4201dfb 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 _0xf8bf=['where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','find','create','body','catch','destroy','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','sendStatus','error','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x403056,_0x2fd4dd){var _0x107756=function(_0x451025){while(--_0x451025){_0x403056['push'](_0x403056['shift']());}};_0x107756(++_0x2fd4dd);}(_0xf8bf,0x15c));var _0xff8b=function(_0x11474d,_0x433035){_0x11474d=_0x11474d-0x0;var _0x413d23=_0xf8bf[_0x11474d];return _0x413d23;};'use strict';var emlformat=require(_0xff8b('0x0'));var rimraf=require(_0xff8b('0x1'));var zipdir=require(_0xff8b('0x2'));var jsonpatch=require(_0xff8b('0x3'));var rp=require(_0xff8b('0x4'));var moment=require('moment');var BPromise=require(_0xff8b('0x5'));var Mustache=require(_0xff8b('0x6'));var util=require('util');var path=require(_0xff8b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff8b('0x8'));var _=require('lodash');var squel=require(_0xff8b('0x9'));var crypto=require(_0xff8b('0xa'));var jsforce=require(_0xff8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xff8b('0xc'));var querystring=require(_0xff8b('0xd'));var Papa=require(_0xff8b('0xe'));var Redis=require('ioredis');var authService=require(_0xff8b('0xf'));var qs=require(_0xff8b('0x10'));var as=require(_0xff8b('0x11'));var hardwareService=require(_0xff8b('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xff8b('0x13'));var licenseUtil=require(_0xff8b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1624eb,_0x1c8bc9){_0x1c8bc9=_0x1c8bc9||0xcc;return function(_0x1c9e67){if(_0x1c9e67){return _0x1624eb['sendStatus'](_0x1c8bc9);}return _0x1624eb[_0xff8b('0x15')](_0x1c8bc9)['end']();};}function respondWithResult(_0x26181e,_0x1b368f){_0x1b368f=_0x1b368f||0xc8;return function(_0x25d6ed){if(_0x25d6ed){return _0x26181e[_0xff8b('0x15')](_0x1b368f)[_0xff8b('0x16')](_0x25d6ed);}};}function respondWithFilteredResult(_0x360a74,_0xb73002){return function(_0x41094a){if(_0x41094a){var _0x3a2a08=typeof _0xb73002[_0xff8b('0x17')]===_0xff8b('0x18')&&typeof _0xb73002[_0xff8b('0x19')]===_0xff8b('0x18');var _0x3fc71b=_0x41094a[_0xff8b('0x1a')];var _0x2973da=_0x3a2a08?0x0:_0xb73002['offset'];var _0xb4ea0a=_0x3a2a08?_0x41094a[_0xff8b('0x1a')]:_0xb73002['offset']+_0xb73002[_0xff8b('0x19')];var _0x2a3934;if(_0xb4ea0a>=_0x3fc71b){_0xb4ea0a=_0x3fc71b;_0x2a3934=0xc8;}else{_0x2a3934=0xce;}_0x360a74[_0xff8b('0x15')](_0x2a3934);return _0x360a74[_0xff8b('0x1b')](_0xff8b('0x1c'),_0x2973da+'-'+_0xb4ea0a+'/'+_0x3fc71b)[_0xff8b('0x16')](_0x41094a);}return null;};}function patchUpdates(_0x55ee96){return function(_0x4fefed){try{jsonpatch[_0xff8b('0x1d')](_0x4fefed,_0x55ee96,!![]);}catch(_0x28d1e8){return BPromise['reject'](_0x28d1e8);}return _0x4fefed[_0xff8b('0x1e')]();};}function saveUpdates(_0xb7d7b7,_0x3595a2){return function(_0x36c41d){if(_0x36c41d){return _0x36c41d[_0xff8b('0x1f')](_0xb7d7b7)[_0xff8b('0x20')](function(_0x53e781){return _0x53e781;});}return null;};}function removeEntity(_0x321523,_0x2c9a72){return function(_0x3aef54){if(_0x3aef54){return _0x3aef54['destroy']()[_0xff8b('0x20')](function(){_0x321523[_0xff8b('0x15')](0xcc)[_0xff8b('0x21')]();});}};}function handleEntityNotFound(_0x430454,_0x206d02){return function(_0x33a65d){if(!_0x33a65d){_0x430454[_0xff8b('0x22')](0x194);}return _0x33a65d;};}function handleError(_0x44e74e,_0x3cf440){_0x3cf440=_0x3cf440||0x1f4;return function(_0x2b0299){logger[_0xff8b('0x23')](_0x2b0299['stack']);if(_0x2b0299[_0xff8b('0x24')]){delete _0x2b0299[_0xff8b('0x24')];}_0x44e74e[_0xff8b('0x15')](_0x3cf440)[_0xff8b('0x25')](_0x2b0299);};}exports[_0xff8b('0x26')]=function(_0x49d05e,_0x314954){var _0x14259e={},_0x27d13b={},_0x2981af={'count':0x0,'rows':[]};var _0x1ad0d8=_[_0xff8b('0x27')](db[_0xff8b('0x28')][_0xff8b('0x29')],function(_0x21f2a3){return{'name':_0x21f2a3[_0xff8b('0x2a')],'type':_0x21f2a3[_0xff8b('0x2b')][_0xff8b('0x2c')]};});_0x27d13b[_0xff8b('0x2d')]=_[_0xff8b('0x2e')](_[_0xff8b('0x27')](_0x1ad0d8,_0xff8b('0x24')),['name']);_0x27d13b['query']=_[_0xff8b('0x2f')](_0x49d05e['query']);_0x27d13b[_0xff8b('0x30')]=_['intersection'](_0x27d13b['model'],_0x27d13b['query']);_0x14259e['attributes']=_[_0xff8b('0x31')](_0x27d13b[_0xff8b('0x2d')],qs[_0xff8b('0x32')](_0x49d05e[_0xff8b('0x33')][_0xff8b('0x32')]));_0x14259e[_0xff8b('0x34')]=_0x14259e[_0xff8b('0x34')][_0xff8b('0x35')]?_0x14259e[_0xff8b('0x34')]:_0x27d13b['model'];if(!_0x49d05e[_0xff8b('0x33')][_0xff8b('0x36')](_0xff8b('0x37'))){_0x14259e[_0xff8b('0x19')]=qs[_0xff8b('0x19')](_0x49d05e[_0xff8b('0x33')]['limit']);_0x14259e[_0xff8b('0x17')]=qs[_0xff8b('0x17')](_0x49d05e[_0xff8b('0x33')][_0xff8b('0x17')]);}_0x14259e['order']=qs[_0xff8b('0x38')](_0x49d05e[_0xff8b('0x33')][_0xff8b('0x38')]);_0x14259e[_0xff8b('0x39')]=qs[_0xff8b('0x30')](_[_0xff8b('0x3a')](_0x49d05e[_0xff8b('0x33')],_0x27d13b[_0xff8b('0x30')]),_0x1ad0d8);if(_0x49d05e[_0xff8b('0x33')]['filter']){_0x14259e[_0xff8b('0x39')]=_['merge'](_0x14259e[_0xff8b('0x39')],{'$or':_[_0xff8b('0x27')](_0x1ad0d8,function(_0x3dfc60){if(_0x3dfc60['type']!==_0xff8b('0x3b')){var _0x35df76={};_0x35df76[_0x3dfc60[_0xff8b('0x24')]]={'$like':'%'+_0x49d05e[_0xff8b('0x33')][_0xff8b('0x3c')]+'%'};return _0x35df76;}})});}_0x14259e=_[_0xff8b('0x3d')]({},_0x14259e,_0x49d05e[_0xff8b('0x3e')]);var _0x2b76a7={'where':_0x14259e[_0xff8b('0x39')]};return db[_0xff8b('0x28')][_0xff8b('0x1a')](_0x2b76a7)[_0xff8b('0x20')](function(_0x26340d){_0x2981af[_0xff8b('0x1a')]=_0x26340d;if(_0x49d05e[_0xff8b('0x33')][_0xff8b('0x3f')]){_0x14259e['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0xff8b('0x40')](_0x14259e);})[_0xff8b('0x20')](function(_0x211947){_0x2981af[_0xff8b('0x41')]=_0x211947;return _0x2981af;})[_0xff8b('0x20')](respondWithFilteredResult(_0x314954,_0x14259e))['catch'](handleError(_0x314954,null));};exports[_0xff8b('0x42')]=function(_0x2a2c84,_0x1772b8){var _0x244184={'raw':!![],'where':{'id':_0x2a2c84[_0xff8b('0x43')]['id']}},_0x1166cc={};_0x1166cc[_0xff8b('0x2d')]=_[_0xff8b('0x2f')](db['VoiceMailMessage'][_0xff8b('0x29')]);_0x1166cc['query']=_[_0xff8b('0x2f')](_0x2a2c84[_0xff8b('0x33')]);_0x1166cc[_0xff8b('0x30')]=_[_0xff8b('0x31')](_0x1166cc[_0xff8b('0x2d')],_0x1166cc[_0xff8b('0x33')]);_0x244184[_0xff8b('0x34')]=_[_0xff8b('0x31')](_0x1166cc[_0xff8b('0x2d')],qs[_0xff8b('0x32')](_0x2a2c84['query']['fields']));_0x244184[_0xff8b('0x34')]=_0x244184[_0xff8b('0x34')][_0xff8b('0x35')]?_0x244184[_0xff8b('0x34')]:_0x1166cc['model'];if(_0x2a2c84[_0xff8b('0x33')]['includeAll']){_0x244184['include']=[{'all':!![]}];}_0x244184=_[_0xff8b('0x3d')]({},_0x244184,_0x2a2c84[_0xff8b('0x3e')]);return db[_0xff8b('0x28')][_0xff8b('0x44')](_0x244184)[_0xff8b('0x20')](handleEntityNotFound(_0x1772b8,null))[_0xff8b('0x20')](respondWithResult(_0x1772b8,null))['catch'](handleError(_0x1772b8,null));};exports[_0xff8b('0x45')]=function(_0x54386d,_0x34fe3d){return db[_0xff8b('0x28')][_0xff8b('0x45')](_0x54386d[_0xff8b('0x46')],{})[_0xff8b('0x20')](respondWithResult(_0x34fe3d,0xc9))[_0xff8b('0x47')](handleError(_0x34fe3d,null));};exports[_0xff8b('0x1f')]=function(_0x53c421,_0x1650b7){if(_0x53c421['body']['id']){delete _0x53c421[_0xff8b('0x46')]['id'];}return db[_0xff8b('0x28')][_0xff8b('0x44')]({'where':{'id':_0x53c421[_0xff8b('0x43')]['id']}})['then'](handleEntityNotFound(_0x1650b7,null))[_0xff8b('0x20')](saveUpdates(_0x53c421[_0xff8b('0x46')],null))[_0xff8b('0x20')](respondWithResult(_0x1650b7,null))[_0xff8b('0x47')](handleError(_0x1650b7,null));};exports[_0xff8b('0x48')]=function(_0x17f824,_0x576123){return db['VoiceMailMessage'][_0xff8b('0x44')]({'where':{'id':_0x17f824[_0xff8b('0x43')]['id']}})[_0xff8b('0x20')](handleEntityNotFound(_0x576123,null))[_0xff8b('0x20')](removeEntity(_0x576123,null))[_0xff8b('0x47')](handleError(_0x576123,null));};exports['download']=function(_0xca3b80,_0x3e31f5,_0x217750){return db['VoiceMailMessage'][_0xff8b('0x44')]({'where':{'id':_0xca3b80[_0xff8b('0x43')]['id']},'attributes':['id',_0xff8b('0x49'),_0xff8b('0x4a')]})[_0xff8b('0x20')](handleEntityNotFound(_0x3e31f5,null))[_0xff8b('0x20')](function(_0x302b22){if(_0x302b22){if(!_0x302b22[_0xff8b('0x49')]){throw new db[(_0xff8b('0x4b'))][(_0xff8b('0x4c'))](_0xff8b('0x4d'));}var _0x364ce8={'Content-Type':_0xff8b('0x4e'),'Content-Disposition':_0xff8b('0x4f')};if(_0x302b22['msg_id']){_0x364ce8[_0xff8b('0x50')]='attachment;\x20filename=\x22'+_0x302b22[_0xff8b('0x4a')]+'.wav\x22';}_0x3e31f5['set'](_0x364ce8);return _0x3e31f5['send'](new Buffer(_0x302b22[_0xff8b('0x49')]));}})[_0xff8b('0x47')](handleError(_0x3e31f5,null));}; \ No newline at end of file +var _0x0b5f=['count','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','index','map','VoiceMailMessage','fieldName','type','key','differenceBy','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','then','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','find','create','body','update','params','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','attachment;\x20filename=\x22','.wav\x22','eml-format','zip-dir','fast-json-patch','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0b5f,0x8b));var _0xf0b5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0b5f[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xf0b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0b5('0x1'));var jsonpatch=require(_0xf0b5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf0b5('0x3'));var util=require('util');var path=require('path');var sox=require(_0xf0b5('0x4'));var csv=require('to-csv');var ejs=require(_0xf0b5('0x5'));var fs=require('fs');var fs_extra=require(_0xf0b5('0x6'));var _=require(_0xf0b5('0x7'));var squel=require(_0xf0b5('0x8'));var crypto=require(_0xf0b5('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xf0b5('0xa'));var toCsv=require(_0xf0b5('0xb'));var querystring=require(_0xf0b5('0xc'));var Papa=require(_0xf0b5('0xd'));var Redis=require(_0xf0b5('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf0b5('0xf'));var as=require(_0xf0b5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0b5('0x11'))(_0xf0b5('0x12'));var utils=require(_0xf0b5('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf0b5('0x14'));var db=require(_0xf0b5('0x15'))['db'];function respondWithStatusCode(_0x42a15f,_0x504e2c){_0x504e2c=_0x504e2c||0xcc;return function(_0x1535f9){if(_0x1535f9){return _0x42a15f[_0xf0b5('0x16')](_0x504e2c);}return _0x42a15f[_0xf0b5('0x17')](_0x504e2c)[_0xf0b5('0x18')]();};}function respondWithResult(_0x45904f,_0x49421e){_0x49421e=_0x49421e||0xc8;return function(_0x39ad64){if(_0x39ad64){return _0x45904f[_0xf0b5('0x17')](_0x49421e)[_0xf0b5('0x19')](_0x39ad64);}};}function respondWithFilteredResult(_0x2c25a8,_0x1fe531){return function(_0x335718){if(_0x335718){var _0x1c0fda=typeof _0x1fe531[_0xf0b5('0x1a')]===_0xf0b5('0x1b')&&typeof _0x1fe531[_0xf0b5('0x1c')]==='undefined';var _0x3ccd83=_0x335718[_0xf0b5('0x1d')];var _0x1ab20e=_0x1c0fda?0x0:_0x1fe531[_0xf0b5('0x1a')];var _0x38e71e=_0x1c0fda?_0x335718[_0xf0b5('0x1d')]:_0x1fe531[_0xf0b5('0x1a')]+_0x1fe531['limit'];var _0x3cc8fa;if(_0x38e71e>=_0x3ccd83){_0x38e71e=_0x3ccd83;_0x3cc8fa=0xc8;}else{_0x3cc8fa=0xce;}_0x2c25a8[_0xf0b5('0x17')](_0x3cc8fa);return _0x2c25a8[_0xf0b5('0x1e')](_0xf0b5('0x1f'),_0x1ab20e+'-'+_0x38e71e+'/'+_0x3ccd83)[_0xf0b5('0x19')](_0x335718);}return null;};}function patchUpdates(_0x52f198){return function(_0x36138b){try{jsonpatch[_0xf0b5('0x20')](_0x36138b,_0x52f198,!![]);}catch(_0x90059a){return BPromise[_0xf0b5('0x21')](_0x90059a);}return _0x36138b[_0xf0b5('0x22')]();};}function saveUpdates(_0x332e52,_0x57f173){return function(_0x3b909e){if(_0x3b909e){return _0x3b909e['update'](_0x332e52)['then'](function(_0x5d20a5){return _0x5d20a5;});}return null;};}function removeEntity(_0x4f07b3,_0x1770ee){return function(_0x526cfa){if(_0x526cfa){return _0x526cfa[_0xf0b5('0x23')]()['then'](function(){_0x4f07b3[_0xf0b5('0x17')](0xcc)[_0xf0b5('0x18')]();});}};}function handleEntityNotFound(_0x3e3ff9,_0x589641){return function(_0x30402e){if(!_0x30402e){_0x3e3ff9['sendStatus'](0x194);}return _0x30402e;};}function handleError(_0x4c59ef,_0x35fe3d){_0x35fe3d=_0x35fe3d||0x1f4;return function(_0x2f595){logger[_0xf0b5('0x24')](_0x2f595[_0xf0b5('0x25')]);if(_0x2f595[_0xf0b5('0x26')]){delete _0x2f595['name'];}_0x4c59ef['status'](_0x35fe3d)[_0xf0b5('0x27')](_0x2f595);};}exports[_0xf0b5('0x28')]=function(_0x1f2f41,_0x211932){var _0x33c7ed={},_0x1f701c={},_0x430a1c={'count':0x0,'rows':[]};var _0x5667a0=_[_0xf0b5('0x29')](db[_0xf0b5('0x2a')]['rawAttributes'],function(_0x406ab4){return{'name':_0x406ab4[_0xf0b5('0x2b')],'type':_0x406ab4[_0xf0b5('0x2c')][_0xf0b5('0x2d')]};});_0x1f701c['model']=_[_0xf0b5('0x2e')](_[_0xf0b5('0x29')](_0x5667a0,_0xf0b5('0x26')),[_0xf0b5('0x26')]);_0x1f701c[_0xf0b5('0x2f')]=_['keys'](_0x1f2f41[_0xf0b5('0x2f')]);_0x1f701c[_0xf0b5('0x30')]=_[_0xf0b5('0x31')](_0x1f701c[_0xf0b5('0x32')],_0x1f701c[_0xf0b5('0x2f')]);_0x33c7ed[_0xf0b5('0x33')]=_[_0xf0b5('0x31')](_0x1f701c['model'],qs[_0xf0b5('0x34')](_0x1f2f41['query'][_0xf0b5('0x34')]));_0x33c7ed[_0xf0b5('0x33')]=_0x33c7ed[_0xf0b5('0x33')][_0xf0b5('0x35')]?_0x33c7ed['attributes']:_0x1f701c[_0xf0b5('0x32')];if(!_0x1f2f41['query'][_0xf0b5('0x36')](_0xf0b5('0x37'))){_0x33c7ed['limit']=qs[_0xf0b5('0x1c')](_0x1f2f41[_0xf0b5('0x2f')][_0xf0b5('0x1c')]);_0x33c7ed['offset']=qs[_0xf0b5('0x1a')](_0x1f2f41[_0xf0b5('0x2f')][_0xf0b5('0x1a')]);}_0x33c7ed['order']=qs['sort'](_0x1f2f41[_0xf0b5('0x2f')][_0xf0b5('0x38')]);_0x33c7ed[_0xf0b5('0x39')]=qs[_0xf0b5('0x30')](_[_0xf0b5('0x3a')](_0x1f2f41[_0xf0b5('0x2f')],_0x1f701c['filters']),_0x5667a0);if(_0x1f2f41['query']['filter']){_0x33c7ed['where']=_[_0xf0b5('0x3b')](_0x33c7ed[_0xf0b5('0x39')],{'$or':_[_0xf0b5('0x29')](_0x5667a0,function(_0x41838c){if(_0x41838c[_0xf0b5('0x2c')]!=='VIRTUAL'){var _0x39ff91={};_0x39ff91[_0x41838c[_0xf0b5('0x26')]]={'$like':'%'+_0x1f2f41[_0xf0b5('0x2f')][_0xf0b5('0x3c')]+'%'};return _0x39ff91;}})});}_0x33c7ed=_['merge']({},_0x33c7ed,_0x1f2f41['options']);var _0x203c7a={'where':_0x33c7ed['where']};return db[_0xf0b5('0x2a')][_0xf0b5('0x1d')](_0x203c7a)[_0xf0b5('0x3d')](function(_0x36cea0){_0x430a1c['count']=_0x36cea0;if(_0x1f2f41[_0xf0b5('0x2f')]['includeAll']){_0x33c7ed[_0xf0b5('0x3e')]=[{'all':!![]}];}return db[_0xf0b5('0x2a')][_0xf0b5('0x3f')](_0x33c7ed);})['then'](function(_0x7755aa){_0x430a1c[_0xf0b5('0x40')]=_0x7755aa;return _0x430a1c;})[_0xf0b5('0x3d')](respondWithFilteredResult(_0x211932,_0x33c7ed))[_0xf0b5('0x41')](handleError(_0x211932,null));};exports[_0xf0b5('0x42')]=function(_0x3c4c74,_0x157542){var _0x2dd4b8={'raw':!![],'where':{'id':_0x3c4c74['params']['id']}},_0x2c249f={};_0x2c249f[_0xf0b5('0x32')]=_[_0xf0b5('0x43')](db[_0xf0b5('0x2a')][_0xf0b5('0x44')]);_0x2c249f[_0xf0b5('0x2f')]=_[_0xf0b5('0x43')](_0x3c4c74[_0xf0b5('0x2f')]);_0x2c249f[_0xf0b5('0x30')]=_['intersection'](_0x2c249f[_0xf0b5('0x32')],_0x2c249f[_0xf0b5('0x2f')]);_0x2dd4b8[_0xf0b5('0x33')]=_[_0xf0b5('0x31')](_0x2c249f['model'],qs['fields'](_0x3c4c74[_0xf0b5('0x2f')][_0xf0b5('0x34')]));_0x2dd4b8[_0xf0b5('0x33')]=_0x2dd4b8[_0xf0b5('0x33')][_0xf0b5('0x35')]?_0x2dd4b8['attributes']:_0x2c249f[_0xf0b5('0x32')];if(_0x3c4c74[_0xf0b5('0x2f')][_0xf0b5('0x45')]){_0x2dd4b8[_0xf0b5('0x3e')]=[{'all':!![]}];}_0x2dd4b8=_[_0xf0b5('0x3b')]({},_0x2dd4b8,_0x3c4c74['options']);return db[_0xf0b5('0x2a')][_0xf0b5('0x46')](_0x2dd4b8)[_0xf0b5('0x3d')](handleEntityNotFound(_0x157542,null))['then'](respondWithResult(_0x157542,null))[_0xf0b5('0x41')](handleError(_0x157542,null));};exports[_0xf0b5('0x47')]=function(_0x290c5d,_0x3f720f){return db[_0xf0b5('0x2a')][_0xf0b5('0x47')](_0x290c5d[_0xf0b5('0x48')],{})[_0xf0b5('0x3d')](respondWithResult(_0x3f720f,0xc9))[_0xf0b5('0x41')](handleError(_0x3f720f,null));};exports[_0xf0b5('0x49')]=function(_0x1309dd,_0x1040c9){if(_0x1309dd['body']['id']){delete _0x1309dd[_0xf0b5('0x48')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x1309dd[_0xf0b5('0x4a')]['id']}})[_0xf0b5('0x3d')](handleEntityNotFound(_0x1040c9,null))['then'](saveUpdates(_0x1309dd[_0xf0b5('0x48')],null))[_0xf0b5('0x3d')](respondWithResult(_0x1040c9,null))[_0xf0b5('0x41')](handleError(_0x1040c9,null));};exports[_0xf0b5('0x23')]=function(_0x355c97,_0x24de42){return db[_0xf0b5('0x2a')][_0xf0b5('0x46')]({'where':{'id':_0x355c97[_0xf0b5('0x4a')]['id']}})[_0xf0b5('0x3d')](handleEntityNotFound(_0x24de42,null))['then'](removeEntity(_0x24de42,null))[_0xf0b5('0x41')](handleError(_0x24de42,null));};exports['download']=function(_0x35713c,_0x473f77,_0x3ee757){return db[_0xf0b5('0x2a')]['find']({'where':{'id':_0x35713c[_0xf0b5('0x4a')]['id']},'attributes':['id',_0xf0b5('0x4b'),'msg_id']})[_0xf0b5('0x3d')](handleEntityNotFound(_0x473f77,null))[_0xf0b5('0x3d')](function(_0x3896a2){if(_0x3896a2){if(!_0x3896a2[_0xf0b5('0x4b')]){throw new db[(_0xf0b5('0x4c'))][(_0xf0b5('0x4d'))](_0xf0b5('0x4e'));}var _0x1ca354={'Content-Type':_0xf0b5('0x4f'),'Content-Disposition':_0xf0b5('0x50')};if(_0x3896a2[_0xf0b5('0x51')]){_0x1ca354['Content-Disposition']=_0xf0b5('0x52')+_0x3896a2['msg_id']+_0xf0b5('0x53');}_0x473f77['set'](_0x1ca354);return _0x473f77[_0xf0b5('0x27')](new Buffer(_0x3896a2['recording']));}})[_0xf0b5('0x41')](handleError(_0x473f77,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 5c4cbea..48c0395 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 _0x8eb3=['../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x8eb3,0x115));var _0x38eb=function(_0x33f9b7,_0x80c5d6){_0x33f9b7=_0x33f9b7-0x0;var _0x12ff6f=_0x8eb3[_0x33f9b7];return _0x12ff6f;};'use strict';var _=require('lodash');var util=require(_0x38eb('0x0'));var logger=require(_0x38eb('0x1'))(_0x38eb('0x2'));var moment=require(_0x38eb('0x3'));var BPromise=require(_0x38eb('0x4'));var rp=require(_0x38eb('0x5'));var fs=require('fs');var path=require(_0x38eb('0x6'));var rimraf=require(_0x38eb('0x7'));var config=require(_0x38eb('0x8'));var attributes=require(_0x38eb('0x9'));module[_0x38eb('0xa')]=function(_0x10d514,_0x138c12){return _0x10d514[_0x38eb('0xb')](_0x38eb('0xc'),attributes,{'tableName':_0x38eb('0xd'),'paranoid':![],'indexes':[{'name':_0x38eb('0xe'),'fields':[_0x38eb('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x91f1=['moment','bluebird','request-promise','path','rimraf','exports','voice_voicemail_messages','dir','lodash','util','../../config/logger'];(function(_0xb7b722,_0xe95ba7){var _0x217177=function(_0x463ab4){while(--_0x463ab4){_0xb7b722['push'](_0xb7b722['shift']());}};_0x217177(++_0xe95ba7);}(_0x91f1,0x13c));var _0x191f=function(_0x2f7df3,_0x1ef578){_0x2f7df3=_0x2f7df3-0x0;var _0x21a751=_0x91f1[_0x2f7df3];return _0x21a751;};'use strict';var _=require(_0x191f('0x0'));var util=require(_0x191f('0x1'));var logger=require(_0x191f('0x2'))('api');var moment=require(_0x191f('0x3'));var BPromise=require(_0x191f('0x4'));var rp=require(_0x191f('0x5'));var fs=require('fs');var path=require(_0x191f('0x6'));var rimraf=require(_0x191f('0x7'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0x191f('0x8')]=function(_0x4bc375,_0xebe172){return _0x4bc375['define']('VoiceMailMessage',attributes,{'tableName':_0x191f('0x9'),'paranoid':![],'indexes':[{'name':_0x191f('0xa'),'fields':[_0x191f('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 03ca63d..51ecaab 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 _0xb6f5=['request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x28ad6c,_0x599a96){var _0x597de8=function(_0x445ba4){while(--_0x445ba4){_0x28ad6c['push'](_0x28ad6c['shift']());}};_0x597de8(++_0x599a96);}(_0xb6f5,0x170));var _0x5b6f=function(_0x2cd8a4,_0x51fb40){_0x2cd8a4=_0x2cd8a4-0x0;var _0x375630=_0xb6f5[_0x2cd8a4];return _0x375630;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5b6f('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b6f('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b6f('0x2'))(_0x5b6f('0x3'));var config=require('../../config/environment');var jayson=require(_0x5b6f('0x4'));var client=jayson[_0x5b6f('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f7cc9,_0x371863,_0x1f8505){return new BPromise(function(_0x2f79a7,_0x245b01){return client[_0x5b6f('0x6')](_0x3f7cc9,_0x1f8505)['then'](function(_0x34e2f6){logger[_0x5b6f('0x7')](_0x5b6f('0x8'),_0x371863,_0x5b6f('0x9'));logger[_0x5b6f('0xa')](_0x5b6f('0xb'),_0x371863,'request\x20sent',JSON[_0x5b6f('0xc')](_0x34e2f6));if(_0x34e2f6[_0x5b6f('0xd')]){if(_0x34e2f6[_0x5b6f('0xd')][_0x5b6f('0xe')]===0x1f4){logger[_0x5b6f('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x371863,_0x34e2f6['error']['message']);return _0x245b01(_0x34e2f6[_0x5b6f('0xd')]['message']);}logger['error'](_0x5b6f('0x8'),_0x371863,_0x34e2f6['error'][_0x5b6f('0xf')]);return _0x2f79a7(_0x34e2f6[_0x5b6f('0xd')]['message']);}else{logger[_0x5b6f('0x7')](_0x5b6f('0x8'),_0x371863,_0x5b6f('0x9'));_0x2f79a7(_0x34e2f6['result']['message']);}})[_0x5b6f('0x10')](function(_0x383518){logger[_0x5b6f('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x371863,_0x383518);_0x245b01(_0x383518);});});} \ No newline at end of file +var _0xa13c=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xa13c,0x160));var _0xca13=function(_0x29e1f6,_0x459c5e){_0x29e1f6=_0x29e1f6-0x0;var _0x2151bc=_0xa13c[_0x29e1f6];return _0x2151bc;};'use strict';var _=require(_0xca13('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xca13('0x1'));var rs=require(_0xca13('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca13('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xca13('0x4'))(_0xca13('0x5'));var config=require(_0xca13('0x6'));var jayson=require(_0xca13('0x7'));var client=jayson[_0xca13('0x8')][_0xca13('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f53d6,_0x1561a6,_0x2e1601){return new BPromise(function(_0x410a21,_0x1dc04c){return client[_0xca13('0xa')](_0x4f53d6,_0x2e1601)[_0xca13('0xb')](function(_0x541dc1){logger[_0xca13('0xc')](_0xca13('0xd'),_0x1561a6,_0xca13('0xe'));logger[_0xca13('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x1561a6,_0xca13('0xe'),JSON[_0xca13('0x10')](_0x541dc1));if(_0x541dc1[_0xca13('0x11')]){if(_0x541dc1['error'][_0xca13('0x12')]===0x1f4){logger[_0xca13('0x11')](_0xca13('0xd'),_0x1561a6,_0x541dc1[_0xca13('0x11')][_0xca13('0x13')]);return _0x1dc04c(_0x541dc1[_0xca13('0x11')][_0xca13('0x13')]);}logger[_0xca13('0x11')](_0xca13('0xd'),_0x1561a6,_0x541dc1['error'][_0xca13('0x13')]);return _0x410a21(_0x541dc1[_0xca13('0x11')][_0xca13('0x13')]);}else{logger[_0xca13('0xc')](_0xca13('0xd'),_0x1561a6,_0xca13('0xe'));_0x410a21(_0x541dc1[_0xca13('0x14')][_0xca13('0x13')]);}})['catch'](function(_0x1c626d){logger[_0xca13('0x11')](_0xca13('0xd'),_0x1561a6,_0x1c626d);_0x1dc04c(_0x1c626d);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 2121bcf..3f34364 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 _0x6ec6=['express','Router','fs-extra','../../components/interaction/service','./voiceMusicOnHold.controller','get','index','isAuthenticated','show','/:id/sounds','getSounds','create','post','addSound','put','/:id','delete','destroy','/:id/sounds/:id2','util','path','connect-timeout'];(function(_0x42aba3,_0x4ef48f){var _0x33b03c=function(_0x424739){while(--_0x424739){_0x42aba3['push'](_0x42aba3['shift']());}};_0x33b03c(++_0x4ef48f);}(_0x6ec6,0x15d));var _0x66ec=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x6ec6[_0x21549c];return _0x426cbd;};'use strict';var multer=require('multer');var util=require(_0x66ec('0x0'));var path=require(_0x66ec('0x1'));var timeout=require(_0x66ec('0x2'));var express=require(_0x66ec('0x3'));var router=express[_0x66ec('0x4')]();var fs_extra=require(_0x66ec('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x66ec('0x6'));var config=require('../../config/environment');var controller=require(_0x66ec('0x7'));router[_0x66ec('0x8')]('/',auth['isAuthenticated'](),controller[_0x66ec('0x9')]);router['get']('/:id',auth[_0x66ec('0xa')](),controller[_0x66ec('0xb')]);router['get'](_0x66ec('0xc'),auth['isAuthenticated'](),controller[_0x66ec('0xd')]);router['post']('/',auth[_0x66ec('0xa')](),controller[_0x66ec('0xe')]);router[_0x66ec('0xf')](_0x66ec('0xc'),auth[_0x66ec('0xa')](),controller[_0x66ec('0x10')]);router[_0x66ec('0x11')](_0x66ec('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x66ec('0x13')](_0x66ec('0x12'),auth['isAuthenticated'](),controller[_0x66ec('0x14')]);router[_0x66ec('0x13')](_0x66ec('0x15'),auth['isAuthenticated'](),controller['removeSound']);module['exports']=router; \ No newline at end of file +var _0xd218=['destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','Router','fs-extra','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','show','/:id/sounds','getSounds','create','post','put','/:id','update','delete'];(function(_0x3c59fc,_0x10dbd2){var _0x2b78d4=function(_0x5f161a){while(--_0x5f161a){_0x3c59fc['push'](_0x3c59fc['shift']());}};_0x2b78d4(++_0x10dbd2);}(_0xd218,0x14e));var _0x8d21=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xd218[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x8d21('0x0'));var util=require(_0x8d21('0x1'));var path=require(_0x8d21('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d21('0x3')]();var fs_extra=require(_0x8d21('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8d21('0x5'));var controller=require(_0x8d21('0x6'));router[_0x8d21('0x7')]('/',auth[_0x8d21('0x8')](),controller['index']);router['get']('/:id',auth[_0x8d21('0x8')](),controller[_0x8d21('0x9')]);router['get'](_0x8d21('0xa'),auth[_0x8d21('0x8')](),controller[_0x8d21('0xb')]);router['post']('/',auth[_0x8d21('0x8')](),controller[_0x8d21('0xc')]);router[_0x8d21('0xd')](_0x8d21('0xa'),auth[_0x8d21('0x8')](),controller['addSound']);router[_0x8d21('0xe')](_0x8d21('0xf'),auth[_0x8d21('0x8')](),controller[_0x8d21('0x10')]);router[_0x8d21('0x11')]('/:id',auth[_0x8d21('0x8')](),controller[_0x8d21('0x12')]);router['delete'](_0x8d21('0x13'),auth[_0x8d21('0x8')](),controller[_0x8d21('0x14')]);module[_0x8d21('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 9ba2118..ec226b8 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 _0x8fed=['files','mp3nb','quietmp3','mp3','alpha','TIMESTAMP','sequelize','exports','STRING','name','ENUM','custom'];(function(_0x14fc1d,_0x3621a6){var _0x138c45=function(_0x511551){while(--_0x511551){_0x14fc1d['push'](_0x14fc1d['shift']());}};_0x138c45(++_0x3621a6);}(_0x8fed,0x10e));var _0xd8fe=function(_0x267310,_0x1d619c){_0x267310=_0x267310-0x0;var _0x37d16f=_0x8fed[_0x267310];return _0x37d16f;};'use strict';var Sequelize=require(_0xd8fe('0x0'));module[_0xd8fe('0x1')]={'name':{'type':Sequelize[_0xd8fe('0x2')],'allowNull':![],'unique':_0xd8fe('0x3')},'mode':{'type':Sequelize[_0xd8fe('0x4')](_0xd8fe('0x5'),_0xd8fe('0x6'),_0xd8fe('0x7'),'quietmp3nb',_0xd8fe('0x8'),_0xd8fe('0x9')),'allowNull':!![],'defaultValue':_0xd8fe('0x6')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xd8fe('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xd8fe('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xd8fe('0x2')],'allowNull':!![],'defaultValue':_0xd8fe('0xa')},'format':{'type':Sequelize[_0xd8fe('0x2')],'allowNull':!![]},'stamp':{'type':_0xd8fe('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3214=['custom','mp3nb','quietmp3nb','alpha','TIMESTAMP','BOOLEAN','STRING'];(function(_0x11dd76,_0x45fa7c){var _0x43efc2=function(_0x41157f){while(--_0x41157f){_0x11dd76['push'](_0x11dd76['shift']());}};_0x43efc2(++_0x45fa7c);}(_0x3214,0x1e2));var _0x4321=function(_0x1ac5e1,_0x43a483){_0x1ac5e1=_0x1ac5e1-0x0;var _0x3ae80e=_0x3214[_0x1ac5e1];return _0x3ae80e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4321('0x0')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x4321('0x1'),'files',_0x4321('0x2'),_0x4321('0x3'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x4321('0x0')],'allowNull':!![]},'application':{'type':Sequelize[_0x4321('0x0')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4321('0x0')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4321('0x0')],'allowNull':!![],'defaultValue':_0x4321('0x4')},'format':{'type':Sequelize[_0x4321('0x0')],'allowNull':!![]},'stamp':{'type':_0x4321('0x5')},'defaultEntry':{'type':Sequelize[_0x4321('0x6')],'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 fcafd86..bf23bda 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 _0x1080=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','update','body','params','create','sequelize','transaction','files','join','root','mode','mkdirSync','0777','role','user','find','MusicOnHolds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','directory','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','format','removeSound','id2','unlinkSync','length','hasOwnProperty','getSounds','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/qs'];(function(_0x18a6eb,_0x46bff7){var _0x263ec7=function(_0x25a6c9){while(--_0x25a6c9){_0x18a6eb['push'](_0x18a6eb['shift']());}};_0x263ec7(++_0x46bff7);}(_0x1080,0xd4));var _0x0108=function(_0x53c45a,_0x48f57f){_0x53c45a=_0x53c45a-0x0;var _0xd564dd=_0x1080[_0x53c45a];return _0xd564dd;};'use strict';var emlformat=require(_0x0108('0x0'));var rimraf=require(_0x0108('0x1'));var zipdir=require(_0x0108('0x2'));var jsonpatch=require(_0x0108('0x3'));var rp=require(_0x0108('0x4'));var moment=require(_0x0108('0x5'));var BPromise=require(_0x0108('0x6'));var Mustache=require(_0x0108('0x7'));var util=require('util');var path=require(_0x0108('0x8'));var sox=require(_0x0108('0x9'));var csv=require(_0x0108('0xa'));var ejs=require(_0x0108('0xb'));var fs=require('fs');var fs_extra=require(_0x0108('0xc'));var _=require(_0x0108('0xd'));var squel=require(_0x0108('0xe'));var crypto=require(_0x0108('0xf'));var jsforce=require(_0x0108('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x0108('0xa'));var querystring=require(_0x0108('0x11'));var Papa=require(_0x0108('0x12'));var Redis=require(_0x0108('0x13'));var authService=require(_0x0108('0x14'));var qs=require(_0x0108('0x15'));var as=require(_0x0108('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0108('0x17'));var utils=require(_0x0108('0x18'));var config=require(_0x0108('0x19'));var licenseUtil=require(_0x0108('0x1a'));var db=require(_0x0108('0x1b'))['db'];function respondWithStatusCode(_0x29aaa1,_0x3a1b02){_0x3a1b02=_0x3a1b02||0xcc;return function(_0x419bb8){if(_0x419bb8){return _0x29aaa1[_0x0108('0x1c')](_0x3a1b02);}return _0x29aaa1[_0x0108('0x1d')](_0x3a1b02)[_0x0108('0x1e')]();};}function respondWithResult(_0x23d36e,_0x289ced){_0x289ced=_0x289ced||0xc8;return function(_0x375aa5){if(_0x375aa5){return _0x23d36e['status'](_0x289ced)['json'](_0x375aa5);}};}function respondWithFilteredResult(_0xd052f8,_0xee39e9){return function(_0x3ce9eb){if(_0x3ce9eb){var _0x27acde=typeof _0xee39e9[_0x0108('0x1f')]===_0x0108('0x20')&&typeof _0xee39e9[_0x0108('0x21')]===_0x0108('0x20');var _0x795ce6=_0x3ce9eb[_0x0108('0x22')];var _0x4b9a96=_0x27acde?0x0:_0xee39e9[_0x0108('0x1f')];var _0xbd11b3=_0x27acde?_0x3ce9eb[_0x0108('0x22')]:_0xee39e9[_0x0108('0x1f')]+_0xee39e9[_0x0108('0x21')];var _0x22997d;if(_0xbd11b3>=_0x795ce6){_0xbd11b3=_0x795ce6;_0x22997d=0xc8;}else{_0x22997d=0xce;}_0xd052f8[_0x0108('0x1d')](_0x22997d);return _0xd052f8[_0x0108('0x23')]('Content-Range',_0x4b9a96+'-'+_0xbd11b3+'/'+_0x795ce6)[_0x0108('0x24')](_0x3ce9eb);}return null;};}function patchUpdates(_0x2dc6b4){return function(_0x4a9e61){try{jsonpatch[_0x0108('0x25')](_0x4a9e61,_0x2dc6b4,!![]);}catch(_0xd83438){return BPromise[_0x0108('0x26')](_0xd83438);}return _0x4a9e61['save']();};}function saveUpdates(_0x341a61,_0x2d16d7){return function(_0x54cf5b){if(_0x54cf5b){return _0x54cf5b['update'](_0x341a61)[_0x0108('0x27')](function(_0x3c8a37){return _0x3c8a37;});}return null;};}function removeEntity(_0x2dcaad,_0x580f27){return function(_0x3bcd76){if(_0x3bcd76){return _0x3bcd76[_0x0108('0x28')]()['then'](function(){var _0x250a62=_0x3bcd76[_0x0108('0x29')]({'plain':!![]});var _0x1cbe10='MusicOnHolds';return db[_0x0108('0x2a')][_0x0108('0x28')]({'where':{'type':_0x1cbe10,'resourceId':_0x250a62['id']}})[_0x0108('0x27')](function(){return _0x3bcd76;});})[_0x0108('0x27')](function(){_0x2dcaad[_0x0108('0x1d')](0xcc)[_0x0108('0x1e')]();});}};}function handleEntityNotFound(_0x1ff4c6,_0x11ad2c){return function(_0x5dc5ca){if(!_0x5dc5ca){_0x1ff4c6['sendStatus'](0x194);}return _0x5dc5ca;};}function handleError(_0x131ecb,_0x1a06ae){_0x1a06ae=_0x1a06ae||0x1f4;return function(_0x5240c8){logger[_0x0108('0x2b')](_0x5240c8[_0x0108('0x2c')]);if(_0x5240c8[_0x0108('0x2d')]){delete _0x5240c8[_0x0108('0x2d')];}_0x131ecb[_0x0108('0x1d')](_0x1a06ae)[_0x0108('0x2e')](_0x5240c8);};}exports[_0x0108('0x2f')]=function(_0x4c1f43,_0x8daa80){var _0x17871c={},_0x58a115={},_0x106d8a={'count':0x0,'rows':[]};var _0x50c765=_[_0x0108('0x30')](db[_0x0108('0x31')][_0x0108('0x32')],function(_0x201bea){return{'name':_0x201bea[_0x0108('0x33')],'type':_0x201bea[_0x0108('0x34')][_0x0108('0x35')]};});_0x58a115[_0x0108('0x36')]=_[_0x0108('0x30')](_0x50c765,_0x0108('0x2d'));_0x58a115[_0x0108('0x37')]=_[_0x0108('0x38')](_0x4c1f43[_0x0108('0x37')]);_0x58a115[_0x0108('0x39')]=_[_0x0108('0x3a')](_0x58a115[_0x0108('0x36')],_0x58a115[_0x0108('0x37')]);_0x17871c[_0x0108('0x3b')]=_['intersection'](_0x58a115[_0x0108('0x36')],qs[_0x0108('0x3c')](_0x4c1f43[_0x0108('0x37')][_0x0108('0x3c')]));_0x17871c[_0x0108('0x3b')]=_0x17871c[_0x0108('0x3b')]['length']?_0x17871c[_0x0108('0x3b')]:_0x58a115[_0x0108('0x36')];if(!_0x4c1f43[_0x0108('0x37')]['hasOwnProperty'](_0x0108('0x3d'))){_0x17871c[_0x0108('0x21')]=qs['limit'](_0x4c1f43[_0x0108('0x37')]['limit']);_0x17871c[_0x0108('0x1f')]=qs[_0x0108('0x1f')](_0x4c1f43[_0x0108('0x37')][_0x0108('0x1f')]);}_0x17871c[_0x0108('0x3e')]=qs[_0x0108('0x3f')](_0x4c1f43[_0x0108('0x37')][_0x0108('0x3f')]);delete _0x4c1f43[_0x0108('0x37')][_0x0108('0x3f')];_0x17871c[_0x0108('0x40')]=qs['filters'](_[_0x0108('0x41')](_0x4c1f43[_0x0108('0x37')],_0x58a115[_0x0108('0x39')]),_0x50c765);if(_0x4c1f43[_0x0108('0x37')][_0x0108('0x42')]){_0x17871c[_0x0108('0x40')]=_[_0x0108('0x43')](_0x17871c[_0x0108('0x40')],{'$or':_[_0x0108('0x30')](_0x50c765,function(_0x4c5d62){if(_0x4c5d62['type']!==_0x0108('0x44')){var _0x5d1aef={};_0x5d1aef[_0x4c5d62['name']]={'$like':'%'+_0x4c1f43[_0x0108('0x37')][_0x0108('0x42')]+'%'};return _0x5d1aef;}})});}_0x17871c=_[_0x0108('0x43')]({},_0x17871c,_0x4c1f43[_0x0108('0x45')]);var _0x4d9b9b={'where':_0x17871c[_0x0108('0x40')]};return db['VoiceMusicOnHold'][_0x0108('0x22')](_0x4d9b9b)[_0x0108('0x27')](function(_0x2d15fb){_0x106d8a['count']=_0x2d15fb;if(_0x4c1f43['query'][_0x0108('0x46')]){_0x17871c[_0x0108('0x47')]=[{'all':!![]}];}return db[_0x0108('0x31')][_0x0108('0x48')](_0x17871c);})[_0x0108('0x27')](function(_0x1c89f1){_0x106d8a[_0x0108('0x49')]=_0x1c89f1;return _0x106d8a;})[_0x0108('0x27')](respondWithFilteredResult(_0x8daa80,_0x17871c))[_0x0108('0x4a')](handleError(_0x8daa80,null));};exports[_0x0108('0x4b')]=function(_0x2e7292,_0x4dfa47){var _0x3ef2b4={'raw':![],'where':{'id':_0x2e7292['params']['id']}},_0x1ec58b={};_0x1ec58b[_0x0108('0x36')]=_[_0x0108('0x38')](db['VoiceMusicOnHold']['rawAttributes']);_0x1ec58b[_0x0108('0x37')]=_[_0x0108('0x38')](_0x2e7292[_0x0108('0x37')]);_0x1ec58b[_0x0108('0x39')]=_['intersection'](_0x1ec58b[_0x0108('0x36')],_0x1ec58b[_0x0108('0x37')]);_0x3ef2b4[_0x0108('0x3b')]=_['intersection'](_0x1ec58b[_0x0108('0x36')],qs[_0x0108('0x3c')](_0x2e7292['query'][_0x0108('0x3c')]));_0x3ef2b4['attributes']=_0x3ef2b4[_0x0108('0x3b')]['length']?_0x3ef2b4[_0x0108('0x3b')]:_0x1ec58b['model'];if(_0x2e7292['query'][_0x0108('0x46')]){_0x3ef2b4[_0x0108('0x47')]=[{'all':!![]}];}_0x3ef2b4=_[_0x0108('0x43')]({},_0x3ef2b4,_0x2e7292[_0x0108('0x45')]);return db[_0x0108('0x31')]['find'](_0x3ef2b4)[_0x0108('0x27')](handleEntityNotFound(_0x4dfa47,null))[_0x0108('0x27')](respondWithResult(_0x4dfa47,null))[_0x0108('0x4a')](handleError(_0x4dfa47,null));};exports[_0x0108('0x4c')]=function(_0x523426,_0x4143ff){if(_0x523426[_0x0108('0x4d')]['id']){delete _0x523426[_0x0108('0x4d')]['id'];}return db[_0x0108('0x31')]['find']({'where':{'id':_0x523426[_0x0108('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4143ff,null))[_0x0108('0x27')](saveUpdates(_0x523426['body'],null))[_0x0108('0x27')](respondWithResult(_0x4143ff,null))[_0x0108('0x4a')](handleError(_0x4143ff,null));};exports[_0x0108('0x4f')]=function(_0x30d495,_0x55faa6,_0xf679b0){return db[_0x0108('0x50')][_0x0108('0x51')](function(_0x2d5161){if(_0x30d495[_0x0108('0x4d')]['mode']===_0x0108('0x52')){_0x30d495[_0x0108('0x4d')]['directory']=path[_0x0108('0x53')](config[_0x0108('0x54')],'server/files/moh',_0x30d495[_0x0108('0x4d')]['name']);}return db[_0x0108('0x31')][_0x0108('0x4f')](_0x30d495[_0x0108('0x4d')],{'transaction':_0x2d5161})['then'](function(_0x1d72d1){if(_0x30d495[_0x0108('0x4d')][_0x0108('0x55')]===_0x0108('0x52')){fs[_0x0108('0x56')](_0x1d72d1['directory'],parseInt(_0x0108('0x57'),0x8));}var _0x19ebb1=_0x30d495['user'][_0x0108('0x29')]({'plain':!![]});if(!_0x19ebb1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19ebb1[_0x0108('0x58')]===_0x0108('0x59')){var _0x59ccb0=_0x1d72d1[_0x0108('0x29')]({'plain':!![]});return db['UserProfileSection'][_0x0108('0x5a')]({'where':{'name':_0x0108('0x5b'),'userProfileId':_0x19ebb1[_0x0108('0x5c')]},'raw':!![]})[_0x0108('0x27')](function(_0x44ed6b){if(_0x44ed6b&&_0x44ed6b[_0x0108('0x5d')]===0x0){return db['UserProfileResource'][_0x0108('0x4f')]({'name':_0x59ccb0[_0x0108('0x2d')],'resourceId':_0x59ccb0['id'],'type':_0x44ed6b['name'],'sectionId':_0x44ed6b['id']},{})[_0x0108('0x27')](function(){return _0x1d72d1;});}else{return _0x1d72d1;}})[_0x0108('0x4a')](function(_0x111eac){logger['error'](_0x0108('0x5e'),_0x111eac);});}return _0x1d72d1;});})['then'](respondWithResult(_0x55faa6,0xc9))['catch'](handleError(_0x55faa6,null));};exports['destroy']=function(_0x654003,_0x5dded7,_0x181b9d){var _0x5a628d;return db[_0x0108('0x31')][_0x0108('0x5a')]({'where':{'id':_0x654003['params']['id']}})['then'](function(_0x5b5dd7){if(_0x5b5dd7){return db[_0x0108('0x50')][_0x0108('0x51')](function(_0x14a4bd){return _0x5b5dd7['destroy']({'transaction':_0x14a4bd,'raw':!![]})[_0x0108('0x27')](function(_0xc5e1f1){if(_0xc5e1f1[_0x0108('0x5f')]){fs[_0x0108('0x60')](_0xc5e1f1['directory'])[_0x0108('0x61')](function(_0x25cc61){fs['unlinkSync'](path[_0x0108('0x53')](_0xc5e1f1[_0x0108('0x5f')],_0x25cc61));});fs[_0x0108('0x62')](_0xc5e1f1['directory']);}return _0xc5e1f1;});})['catch'](function(_0x27bec9){throw new db[(_0x0108('0x63'))][(_0x0108('0x64'))](_0x27bec9[_0x0108('0x65')]);});}})[_0x0108('0x27')](handleEntityNotFound(_0x5dded7,null))[_0x0108('0x27')](removeEntity(_0x5dded7,null))['catch'](handleError(_0x5dded7,null));};exports[_0x0108('0x66')]=function(_0x3dd526,_0x36703b,_0x475a47){return db['sequelize']['transaction'](function(_0x5a64cc){var _0x3c7b04;return db[_0x0108('0x31')][_0x0108('0x5a')]({'where':{'id':_0x3dd526['params']['id']}})['then'](function(_0x1ba363){if(_0x1ba363){_0x3c7b04=_0x1ba363;return _0x1ba363[_0x0108('0x66')](_0x3dd526[_0x0108('0x4d')]['id'],{'transaction':_0x5a64cc});}})[_0x0108('0x27')](function(_0x59d7d8){if(_0x59d7d8){return db[_0x0108('0x67')][_0x0108('0x68')]({'where':{'id':_0x3dd526[_0x0108('0x4d')]['id']},'attributes':['id','name',_0x0108('0x69'),_0x0108('0x6a'),_0x0108('0x6b')],'raw':!![]});}})[_0x0108('0x27')](function(_0x1140d7){if(_0x1140d7){var _0x303cdc=path[_0x0108('0x53')](config['root'],_0x0108('0x6c'),util['format'](_0x0108('0x6d'),path['basename'](_0x1140d7[_0x0108('0x69')],path['extname'](_0x1140d7['save_name'])),_0x1140d7['converted_format']));var _0x325c58=path[_0x0108('0x53')](config[_0x0108('0x54')],'server/files/moh',_0x3c7b04[_0x0108('0x2d')],util[_0x0108('0x6e')](_0x0108('0x6d'),_0x1140d7[_0x0108('0x2d')],_0x1140d7[_0x0108('0x6a')]));fs['symlinkSync'](_0x303cdc,_0x325c58);return _0x1140d7;}})['catch'](function(_0xa84e1f){throw new db['Sequelize'][(_0x0108('0x64'))](_0xa84e1f[_0x0108('0x65')]);});})['then'](handleEntityNotFound(_0x36703b,null))['then'](respondWithResult(_0x36703b,0xc9))[_0x0108('0x4a')](handleError(_0x36703b,null));};exports[_0x0108('0x6f')]=function(_0x302307,_0x4d99b5,_0x27106e){return db[_0x0108('0x50')][_0x0108('0x51')](function(_0x3bc1f6){var _0x39afc4;return db[_0x0108('0x31')][_0x0108('0x68')]({'where':{'id':_0x302307['params']['id']}})[_0x0108('0x27')](handleEntityNotFound(_0x4d99b5,null))['then'](function(_0x975172){if(_0x975172){_0x39afc4=_0x975172;return _0x975172['removeSound'](_0x302307['params'][_0x0108('0x70')]);}})[_0x0108('0x27')](function(_0x26f231){if(_0x26f231){return db[_0x0108('0x67')][_0x0108('0x68')]({'where':{'id':_0x302307[_0x0108('0x4e')][_0x0108('0x70')]},'attributes':['id',_0x0108('0x2d'),_0x0108('0x69'),'converted_format',_0x0108('0x6b')],'raw':!![]});}})[_0x0108('0x27')](function(_0x306905){if(_0x306905){fs[_0x0108('0x71')](path[_0x0108('0x53')](_0x39afc4[_0x0108('0x5f')],util[_0x0108('0x6e')](_0x0108('0x6d'),_0x306905[_0x0108('0x2d')],_0x306905[_0x0108('0x6a')])));return _0x306905;}})[_0x0108('0x4a')](function(_0x2b5db6){throw new db[(_0x0108('0x63'))][(_0x0108('0x64'))](_0x2b5db6[_0x0108('0x65')]);});})[_0x0108('0x27')](handleEntityNotFound(_0x4d99b5,null))['then'](respondWithStatusCode(_0x4d99b5,0xcc))['catch'](handleError(_0x4d99b5,null));};exports['getSounds']=function(_0x11b118,_0x24ea0e,_0x4fd784){var _0x5cd889={};var _0x365da2={};var _0x235ddc;var _0x318a36;return db['VoiceMusicOnHold'][_0x0108('0x68')]({'where':{'id':_0x11b118[_0x0108('0x4e')]['id']}})[_0x0108('0x27')](handleEntityNotFound(_0x24ea0e,null))[_0x0108('0x27')](function(_0x3b8d46){if(_0x3b8d46){_0x235ddc=_0x3b8d46;_0x365da2[_0x0108('0x36')]=_[_0x0108('0x38')](db[_0x0108('0x67')][_0x0108('0x32')]);_0x365da2[_0x0108('0x37')]=_['keys'](_0x11b118[_0x0108('0x37')]);_0x365da2['filters']=_[_0x0108('0x3a')](_0x365da2[_0x0108('0x36')],_0x365da2[_0x0108('0x37')]);_0x5cd889['attributes']=_[_0x0108('0x3a')](_0x365da2[_0x0108('0x36')],qs[_0x0108('0x3c')](_0x11b118[_0x0108('0x37')][_0x0108('0x3c')]));_0x5cd889['attributes']=_0x5cd889[_0x0108('0x3b')][_0x0108('0x72')]?_0x5cd889[_0x0108('0x3b')]:_0x365da2[_0x0108('0x36')];_0x5cd889[_0x0108('0x3e')]=qs[_0x0108('0x3f')](_0x11b118[_0x0108('0x37')][_0x0108('0x3f')]);_0x5cd889[_0x0108('0x40')]=qs[_0x0108('0x39')](_[_0x0108('0x41')](_0x11b118['query'],_0x365da2['filters']));if(_0x11b118['query']['filter']){_0x5cd889[_0x0108('0x40')]=_[_0x0108('0x43')](_0x5cd889[_0x0108('0x40')],{'$or':_['map'](_0x5cd889[_0x0108('0x3b')],function(_0xa5a5cb){var _0x18deef={};_0x18deef[_0xa5a5cb]={'$like':'%'+_0x11b118[_0x0108('0x37')][_0x0108('0x42')]+'%'};return _0x18deef;})});}_0x5cd889=_[_0x0108('0x43')]({},_0x5cd889,_0x11b118[_0x0108('0x45')]);return _0x235ddc['getSounds'](_0x5cd889);}})[_0x0108('0x27')](function(_0x872a93){if(_0x872a93){_0x318a36=_0x872a93[_0x0108('0x72')];if(!_0x11b118[_0x0108('0x37')][_0x0108('0x73')](_0x0108('0x3d'))){_0x5cd889[_0x0108('0x21')]=qs['limit'](_0x11b118[_0x0108('0x37')][_0x0108('0x21')]);_0x5cd889[_0x0108('0x1f')]=qs[_0x0108('0x1f')](_0x11b118[_0x0108('0x37')][_0x0108('0x1f')]);}return _0x235ddc[_0x0108('0x74')](_0x5cd889);}})['then'](function(_0x65a904){if(_0x65a904){return _0x65a904?{'count':_0x318a36,'rows':_0x65a904}:null;}})[_0x0108('0x27')](respondWithResult(_0x24ea0e,null))[_0x0108('0x4a')](handleError(_0x24ea0e,null));}; \ No newline at end of file +var _0xe8f7=['mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','findOne','save_name','server/files/sounds/converted','format','converted_format','%s.%s','symlinkSync','removeSound','id2','createdAt','getSounds','Sound','sort','pick','nolimit','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','UserProfileResource','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','filter','merge','VIRTUAL','where','includeAll','findAll','show','params','keys','include','options','find','catch','body','create','sequelize'];(function(_0x381274,_0x56c354){var _0x29effa=function(_0x5f443b){while(--_0x5f443b){_0x381274['push'](_0x381274['shift']());}};_0x29effa(++_0x56c354);}(_0xe8f7,0x9b));var _0x7e8f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe8f7[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e8f('0x0'));var zipdir=require(_0x7e8f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e8f('0x2'));var moment=require(_0x7e8f('0x3'));var BPromise=require(_0x7e8f('0x4'));var Mustache=require(_0x7e8f('0x5'));var util=require('util');var path=require(_0x7e8f('0x6'));var sox=require(_0x7e8f('0x7'));var csv=require(_0x7e8f('0x8'));var ejs=require(_0x7e8f('0x9'));var fs=require('fs');var fs_extra=require(_0x7e8f('0xa'));var _=require(_0x7e8f('0xb'));var squel=require(_0x7e8f('0xc'));var crypto=require('crypto');var jsforce=require(_0x7e8f('0xd'));var deskjs=require(_0x7e8f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7e8f('0xf'));var Redis=require(_0x7e8f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7e8f('0x11'));var as=require(_0x7e8f('0x12'));var hardwareService=require(_0x7e8f('0x13'));var logger=require(_0x7e8f('0x14'))(_0x7e8f('0x15'));var utils=require(_0x7e8f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7e8f('0x17'));var db=require(_0x7e8f('0x18'))['db'];function respondWithStatusCode(_0x6de4d7,_0x3b96c2){_0x3b96c2=_0x3b96c2||0xcc;return function(_0x5f0562){if(_0x5f0562){return _0x6de4d7[_0x7e8f('0x19')](_0x3b96c2);}return _0x6de4d7[_0x7e8f('0x1a')](_0x3b96c2)[_0x7e8f('0x1b')]();};}function respondWithResult(_0x5d7f8e,_0x53a492){_0x53a492=_0x53a492||0xc8;return function(_0x5c50b7){if(_0x5c50b7){return _0x5d7f8e[_0x7e8f('0x1a')](_0x53a492)[_0x7e8f('0x1c')](_0x5c50b7);}};}function respondWithFilteredResult(_0x3ee8e9,_0x3f2733){return function(_0x1cb13f){if(_0x1cb13f){var _0x1e7f06=typeof _0x3f2733[_0x7e8f('0x1d')]===_0x7e8f('0x1e')&&typeof _0x3f2733[_0x7e8f('0x1f')]===_0x7e8f('0x1e');var _0x107028=_0x1cb13f[_0x7e8f('0x20')];var _0x2b8873=_0x1e7f06?0x0:_0x3f2733[_0x7e8f('0x1d')];var _0x417b1f=_0x1e7f06?_0x1cb13f['count']:_0x3f2733[_0x7e8f('0x1d')]+_0x3f2733[_0x7e8f('0x1f')];var _0x88e5af;if(_0x417b1f>=_0x107028){_0x417b1f=_0x107028;_0x88e5af=0xc8;}else{_0x88e5af=0xce;}_0x3ee8e9[_0x7e8f('0x1a')](_0x88e5af);return _0x3ee8e9[_0x7e8f('0x21')](_0x7e8f('0x22'),_0x2b8873+'-'+_0x417b1f+'/'+_0x107028)['json'](_0x1cb13f);}return null;};}function patchUpdates(_0x498b00){return function(_0xdb751f){try{jsonpatch['apply'](_0xdb751f,_0x498b00,!![]);}catch(_0x53c3dc){return BPromise[_0x7e8f('0x23')](_0x53c3dc);}return _0xdb751f['save']();};}function saveUpdates(_0x6b274e,_0xc12429){return function(_0x5e15d7){if(_0x5e15d7){return _0x5e15d7[_0x7e8f('0x24')](_0x6b274e)[_0x7e8f('0x25')](function(_0x33f1a3){return _0x33f1a3;});}return null;};}function removeEntity(_0x497735,_0x3932d8){return function(_0x5569f0){if(_0x5569f0){return _0x5569f0[_0x7e8f('0x26')]()['then'](function(){var _0x97ee70=_0x5569f0['get']({'plain':!![]});var _0x1670a3='MusicOnHolds';return db[_0x7e8f('0x27')][_0x7e8f('0x26')]({'where':{'type':_0x1670a3,'resourceId':_0x97ee70['id']}})[_0x7e8f('0x25')](function(){return _0x5569f0;});})[_0x7e8f('0x25')](function(){_0x497735['status'](0xcc)[_0x7e8f('0x1b')]();});}};}function handleEntityNotFound(_0x3af5c3,_0x57e549){return function(_0x2c0eab){if(!_0x2c0eab){_0x3af5c3['sendStatus'](0x194);}return _0x2c0eab;};}function handleError(_0x534080,_0x194ac8){_0x194ac8=_0x194ac8||0x1f4;return function(_0x421cc2){logger['error'](_0x421cc2[_0x7e8f('0x28')]);if(_0x421cc2['name']){delete _0x421cc2[_0x7e8f('0x29')];}_0x534080[_0x7e8f('0x1a')](_0x194ac8)[_0x7e8f('0x2a')](_0x421cc2);};}exports[_0x7e8f('0x2b')]=function(_0x2cdda8,_0x1d2e6e){var _0xecc0ad={},_0x9b5b82={},_0x54f868={'count':0x0,'rows':[]};var _0x13cc08=_[_0x7e8f('0x2c')](db[_0x7e8f('0x2d')][_0x7e8f('0x2e')],function(_0x32db55){return{'name':_0x32db55[_0x7e8f('0x2f')],'type':_0x32db55[_0x7e8f('0x30')][_0x7e8f('0x31')]};});_0x9b5b82[_0x7e8f('0x32')]=_['map'](_0x13cc08,_0x7e8f('0x29'));_0x9b5b82[_0x7e8f('0x33')]=_['keys'](_0x2cdda8[_0x7e8f('0x33')]);_0x9b5b82[_0x7e8f('0x34')]=_[_0x7e8f('0x35')](_0x9b5b82[_0x7e8f('0x32')],_0x9b5b82['query']);_0xecc0ad['attributes']=_[_0x7e8f('0x35')](_0x9b5b82[_0x7e8f('0x32')],qs[_0x7e8f('0x36')](_0x2cdda8['query'][_0x7e8f('0x36')]));_0xecc0ad[_0x7e8f('0x37')]=_0xecc0ad[_0x7e8f('0x37')][_0x7e8f('0x38')]?_0xecc0ad[_0x7e8f('0x37')]:_0x9b5b82[_0x7e8f('0x32')];if(!_0x2cdda8[_0x7e8f('0x33')][_0x7e8f('0x39')]('nolimit')){_0xecc0ad[_0x7e8f('0x1f')]=qs['limit'](_0x2cdda8['query'][_0x7e8f('0x1f')]);_0xecc0ad['offset']=qs[_0x7e8f('0x1d')](_0x2cdda8[_0x7e8f('0x33')][_0x7e8f('0x1d')]);}_0xecc0ad[_0x7e8f('0x3a')]=qs['sort'](_0x2cdda8['query']['sort']);delete _0x2cdda8['query']['sort'];_0xecc0ad['where']=qs[_0x7e8f('0x34')](_['pick'](_0x2cdda8['query'],_0x9b5b82[_0x7e8f('0x34')]),_0x13cc08);if(_0x2cdda8[_0x7e8f('0x33')][_0x7e8f('0x3b')]){_0xecc0ad['where']=_[_0x7e8f('0x3c')](_0xecc0ad['where'],{'$or':_[_0x7e8f('0x2c')](_0x13cc08,function(_0x369f7b){if(_0x369f7b['type']!==_0x7e8f('0x3d')){var _0x510fb0={};_0x510fb0[_0x369f7b[_0x7e8f('0x29')]]={'$like':'%'+_0x2cdda8[_0x7e8f('0x33')][_0x7e8f('0x3b')]+'%'};return _0x510fb0;}})});}_0xecc0ad=_['merge']({},_0xecc0ad,_0x2cdda8['options']);var _0x254161={'where':_0xecc0ad[_0x7e8f('0x3e')]};return db[_0x7e8f('0x2d')][_0x7e8f('0x20')](_0x254161)[_0x7e8f('0x25')](function(_0x3d7675){_0x54f868['count']=_0x3d7675;if(_0x2cdda8[_0x7e8f('0x33')][_0x7e8f('0x3f')]){_0xecc0ad['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x7e8f('0x40')](_0xecc0ad);})['then'](function(_0x8cee43){_0x54f868['rows']=_0x8cee43;return _0x54f868;})[_0x7e8f('0x25')](respondWithFilteredResult(_0x1d2e6e,_0xecc0ad))['catch'](handleError(_0x1d2e6e,null));};exports[_0x7e8f('0x41')]=function(_0x4ac7e5,_0x3f7ba8){var _0x22fe55={'raw':![],'where':{'id':_0x4ac7e5[_0x7e8f('0x42')]['id']}},_0x245cc4={};_0x245cc4['model']=_['keys'](db[_0x7e8f('0x2d')]['rawAttributes']);_0x245cc4[_0x7e8f('0x33')]=_[_0x7e8f('0x43')](_0x4ac7e5[_0x7e8f('0x33')]);_0x245cc4[_0x7e8f('0x34')]=_[_0x7e8f('0x35')](_0x245cc4['model'],_0x245cc4[_0x7e8f('0x33')]);_0x22fe55['attributes']=_[_0x7e8f('0x35')](_0x245cc4[_0x7e8f('0x32')],qs[_0x7e8f('0x36')](_0x4ac7e5[_0x7e8f('0x33')][_0x7e8f('0x36')]));_0x22fe55[_0x7e8f('0x37')]=_0x22fe55['attributes'][_0x7e8f('0x38')]?_0x22fe55[_0x7e8f('0x37')]:_0x245cc4[_0x7e8f('0x32')];if(_0x4ac7e5[_0x7e8f('0x33')]['includeAll']){_0x22fe55[_0x7e8f('0x44')]=[{'all':!![]}];}_0x22fe55=_[_0x7e8f('0x3c')]({},_0x22fe55,_0x4ac7e5[_0x7e8f('0x45')]);return db[_0x7e8f('0x2d')][_0x7e8f('0x46')](_0x22fe55)['then'](handleEntityNotFound(_0x3f7ba8,null))[_0x7e8f('0x25')](respondWithResult(_0x3f7ba8,null))[_0x7e8f('0x47')](handleError(_0x3f7ba8,null));};exports['update']=function(_0x3ece23,_0x1d4bb5){if(_0x3ece23[_0x7e8f('0x48')]['id']){delete _0x3ece23[_0x7e8f('0x48')]['id'];}return db[_0x7e8f('0x2d')]['find']({'where':{'id':_0x3ece23[_0x7e8f('0x42')]['id']}})[_0x7e8f('0x25')](handleEntityNotFound(_0x1d4bb5,null))[_0x7e8f('0x25')](saveUpdates(_0x3ece23[_0x7e8f('0x48')],null))['then'](respondWithResult(_0x1d4bb5,null))[_0x7e8f('0x47')](handleError(_0x1d4bb5,null));};exports[_0x7e8f('0x49')]=function(_0x3d534b,_0x5567c7,_0x3b1ea7){return db[_0x7e8f('0x4a')]['transaction'](function(_0x2c36ee){if(_0x3d534b[_0x7e8f('0x48')][_0x7e8f('0x4b')]===_0x7e8f('0x4c')){_0x3d534b[_0x7e8f('0x48')][_0x7e8f('0x4d')]=path[_0x7e8f('0x4e')](config[_0x7e8f('0x4f')],_0x7e8f('0x50'),_0x3d534b[_0x7e8f('0x48')][_0x7e8f('0x29')]);}return db[_0x7e8f('0x2d')]['create'](_0x3d534b['body'],{'transaction':_0x2c36ee})[_0x7e8f('0x25')](function(_0x3073f6){if(_0x3d534b['body']['mode']===_0x7e8f('0x4c')){fs[_0x7e8f('0x51')](_0x3073f6[_0x7e8f('0x4d')],parseInt(_0x7e8f('0x52'),0x8));}var _0x532c60=_0x3d534b[_0x7e8f('0x53')][_0x7e8f('0x54')]({'plain':!![]});if(!_0x532c60)throw new Error(_0x7e8f('0x55'));if(_0x532c60[_0x7e8f('0x56')]===_0x7e8f('0x53')){var _0x190832=_0x3073f6[_0x7e8f('0x54')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x532c60[_0x7e8f('0x57')]},'raw':!![]})[_0x7e8f('0x25')](function(_0x3c106f){if(_0x3c106f&&_0x3c106f[_0x7e8f('0x58')]===0x0){return db[_0x7e8f('0x27')][_0x7e8f('0x49')]({'name':_0x190832[_0x7e8f('0x29')],'resourceId':_0x190832['id'],'type':_0x3c106f[_0x7e8f('0x29')],'sectionId':_0x3c106f['id']},{})[_0x7e8f('0x25')](function(){return _0x3073f6;});}else{return _0x3073f6;}})[_0x7e8f('0x47')](function(_0x512614){logger[_0x7e8f('0x59')](_0x7e8f('0x5a'),_0x512614);});}return _0x3073f6;});})[_0x7e8f('0x25')](respondWithResult(_0x5567c7,0xc9))['catch'](handleError(_0x5567c7,null));};exports[_0x7e8f('0x26')]=function(_0x2a4165,_0x43b853,_0x27a99b){var _0x4d90b4;return db[_0x7e8f('0x2d')][_0x7e8f('0x46')]({'where':{'id':_0x2a4165[_0x7e8f('0x42')]['id']}})['then'](function(_0x2d18f5){if(_0x2d18f5){return db[_0x7e8f('0x4a')][_0x7e8f('0x5b')](function(_0x14c391){return _0x2d18f5['destroy']({'transaction':_0x14c391,'raw':!![]})[_0x7e8f('0x25')](function(_0x490293){if(_0x490293[_0x7e8f('0x4d')]){fs[_0x7e8f('0x5c')](_0x490293[_0x7e8f('0x4d')])[_0x7e8f('0x5d')](function(_0x5694c5){fs[_0x7e8f('0x5e')](path[_0x7e8f('0x4e')](_0x490293['directory'],_0x5694c5));});fs[_0x7e8f('0x5f')](_0x490293[_0x7e8f('0x4d')]);}return _0x490293;});})[_0x7e8f('0x47')](function(_0x34eee0){throw new db[(_0x7e8f('0x60'))][(_0x7e8f('0x61'))](_0x34eee0[_0x7e8f('0x62')]);});}})[_0x7e8f('0x25')](handleEntityNotFound(_0x43b853,null))[_0x7e8f('0x25')](removeEntity(_0x43b853,null))['catch'](handleError(_0x43b853,null));};exports[_0x7e8f('0x63')]=function(_0x3c2af0,_0x2ed0bc,_0x2ff902){return db['sequelize'][_0x7e8f('0x5b')](function(_0x1cdfe5){var _0x3ad9ad;return db[_0x7e8f('0x2d')][_0x7e8f('0x46')]({'where':{'id':_0x3c2af0['params']['id']}})[_0x7e8f('0x25')](function(_0x50be5f){if(_0x50be5f){_0x3ad9ad=_0x50be5f;return _0x50be5f[_0x7e8f('0x63')](_0x3c2af0[_0x7e8f('0x48')]['id'],{'transaction':_0x1cdfe5});}})[_0x7e8f('0x25')](function(_0x4c0caf){if(_0x4c0caf){return db['Sound'][_0x7e8f('0x64')]({'where':{'id':_0x3c2af0[_0x7e8f('0x48')]['id']},'attributes':['id',_0x7e8f('0x29'),_0x7e8f('0x65'),'converted_format','createdAt'],'raw':!![]});}})[_0x7e8f('0x25')](function(_0x4eabb8){if(_0x4eabb8){var _0x4128a2=path[_0x7e8f('0x4e')](config[_0x7e8f('0x4f')],_0x7e8f('0x66'),util[_0x7e8f('0x67')]('%s.%s',path['basename'](_0x4eabb8['save_name'],path['extname'](_0x4eabb8[_0x7e8f('0x65')])),_0x4eabb8[_0x7e8f('0x68')]));var _0x21c1b8=path[_0x7e8f('0x4e')](config['root'],'server/files/moh',_0x3ad9ad[_0x7e8f('0x29')],util[_0x7e8f('0x67')](_0x7e8f('0x69'),_0x4eabb8['name'],_0x4eabb8[_0x7e8f('0x68')]));fs[_0x7e8f('0x6a')](_0x4128a2,_0x21c1b8);return _0x4eabb8;}})[_0x7e8f('0x47')](function(_0x2313b3){throw new db[(_0x7e8f('0x60'))][(_0x7e8f('0x61'))](_0x2313b3[_0x7e8f('0x62')]);});})[_0x7e8f('0x25')](handleEntityNotFound(_0x2ed0bc,null))[_0x7e8f('0x25')](respondWithResult(_0x2ed0bc,0xc9))['catch'](handleError(_0x2ed0bc,null));};exports[_0x7e8f('0x6b')]=function(_0x596c87,_0x3945f1,_0x5a6c8a){return db['sequelize'][_0x7e8f('0x5b')](function(_0x3ee2b5){var _0xf4d9b6;return db[_0x7e8f('0x2d')]['findOne']({'where':{'id':_0x596c87[_0x7e8f('0x42')]['id']}})['then'](handleEntityNotFound(_0x3945f1,null))[_0x7e8f('0x25')](function(_0x35176b){if(_0x35176b){_0xf4d9b6=_0x35176b;return _0x35176b['removeSound'](_0x596c87['params'][_0x7e8f('0x6c')]);}})[_0x7e8f('0x25')](function(_0x4a53e9){if(_0x4a53e9){return db['Sound'][_0x7e8f('0x64')]({'where':{'id':_0x596c87['params'][_0x7e8f('0x6c')]},'attributes':['id',_0x7e8f('0x29'),_0x7e8f('0x65'),_0x7e8f('0x68'),_0x7e8f('0x6d')],'raw':!![]});}})[_0x7e8f('0x25')](function(_0x1723f6){if(_0x1723f6){fs[_0x7e8f('0x5e')](path[_0x7e8f('0x4e')](_0xf4d9b6[_0x7e8f('0x4d')],util[_0x7e8f('0x67')](_0x7e8f('0x69'),_0x1723f6[_0x7e8f('0x29')],_0x1723f6[_0x7e8f('0x68')])));return _0x1723f6;}})[_0x7e8f('0x47')](function(_0x236b9a){throw new db[(_0x7e8f('0x60'))][(_0x7e8f('0x61'))](_0x236b9a[_0x7e8f('0x62')]);});})['then'](handleEntityNotFound(_0x3945f1,null))['then'](respondWithStatusCode(_0x3945f1,0xcc))[_0x7e8f('0x47')](handleError(_0x3945f1,null));};exports[_0x7e8f('0x6e')]=function(_0x4a17f1,_0xbb29db,_0x108cf7){var _0x313a69={};var _0x5e551f={};var _0x62f252;var _0x149b1e;return db[_0x7e8f('0x2d')][_0x7e8f('0x64')]({'where':{'id':_0x4a17f1['params']['id']}})[_0x7e8f('0x25')](handleEntityNotFound(_0xbb29db,null))[_0x7e8f('0x25')](function(_0x4f002d){if(_0x4f002d){_0x62f252=_0x4f002d;_0x5e551f['model']=_[_0x7e8f('0x43')](db[_0x7e8f('0x6f')][_0x7e8f('0x2e')]);_0x5e551f[_0x7e8f('0x33')]=_[_0x7e8f('0x43')](_0x4a17f1[_0x7e8f('0x33')]);_0x5e551f[_0x7e8f('0x34')]=_[_0x7e8f('0x35')](_0x5e551f[_0x7e8f('0x32')],_0x5e551f[_0x7e8f('0x33')]);_0x313a69[_0x7e8f('0x37')]=_[_0x7e8f('0x35')](_0x5e551f[_0x7e8f('0x32')],qs[_0x7e8f('0x36')](_0x4a17f1['query'][_0x7e8f('0x36')]));_0x313a69[_0x7e8f('0x37')]=_0x313a69[_0x7e8f('0x37')][_0x7e8f('0x38')]?_0x313a69['attributes']:_0x5e551f['model'];_0x313a69[_0x7e8f('0x3a')]=qs[_0x7e8f('0x70')](_0x4a17f1[_0x7e8f('0x33')]['sort']);_0x313a69['where']=qs[_0x7e8f('0x34')](_[_0x7e8f('0x71')](_0x4a17f1['query'],_0x5e551f['filters']));if(_0x4a17f1[_0x7e8f('0x33')][_0x7e8f('0x3b')]){_0x313a69[_0x7e8f('0x3e')]=_[_0x7e8f('0x3c')](_0x313a69[_0x7e8f('0x3e')],{'$or':_['map'](_0x313a69[_0x7e8f('0x37')],function(_0x2e20dc){var _0x556637={};_0x556637[_0x2e20dc]={'$like':'%'+_0x4a17f1[_0x7e8f('0x33')]['filter']+'%'};return _0x556637;})});}_0x313a69=_[_0x7e8f('0x3c')]({},_0x313a69,_0x4a17f1[_0x7e8f('0x45')]);return _0x62f252[_0x7e8f('0x6e')](_0x313a69);}})[_0x7e8f('0x25')](function(_0x2a0a23){if(_0x2a0a23){_0x149b1e=_0x2a0a23['length'];if(!_0x4a17f1['query'][_0x7e8f('0x39')](_0x7e8f('0x72'))){_0x313a69[_0x7e8f('0x1f')]=qs[_0x7e8f('0x1f')](_0x4a17f1[_0x7e8f('0x33')][_0x7e8f('0x1f')]);_0x313a69[_0x7e8f('0x1d')]=qs[_0x7e8f('0x1d')](_0x4a17f1[_0x7e8f('0x33')]['offset']);}return _0x62f252['getSounds'](_0x313a69);}})[_0x7e8f('0x25')](function(_0x29b606){if(_0x29b606){return _0x29b606?{'count':_0x149b1e,'rows':_0x29b606}:null;}})[_0x7e8f('0x25')](respondWithResult(_0xbb29db,null))[_0x7e8f('0x47')](handleError(_0xbb29db,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 891cb55..462cfb1 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 _0x1174=['exports','define','voice_musiconhold','../../config/logger','moment','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x5562a2,_0x36a4cd){var _0x5e7036=function(_0x121fbd){while(--_0x121fbd){_0x5562a2['push'](_0x5562a2['shift']());}};_0x5e7036(++_0x36a4cd);}(_0x1174,0x135));var _0x4117=function(_0x259166,_0x138e75){_0x259166=_0x259166-0x0;var _0x4246ff=_0x1174[_0x259166];return _0x4246ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4117('0x0'))('api');var moment=require(_0x4117('0x1'));var BPromise=require('bluebird');var rp=require(_0x4117('0x2'));var fs=require('fs');var path=require(_0x4117('0x3'));var rimraf=require('rimraf');var config=require(_0x4117('0x4'));var attributes=require(_0x4117('0x5'));module[_0x4117('0x6')]=function(_0x3d0292,_0x5defa7){return _0x3d0292[_0x4117('0x7')]('VoiceMusicOnHold',attributes,{'tableName':_0x4117('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d28=['path','rimraf','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util','../../config/logger','api','request-promise'];(function(_0xe2a097,_0x5c3b7d){var _0x5c6da7=function(_0x18f30e){while(--_0x18f30e){_0xe2a097['push'](_0xe2a097['shift']());}};_0x5c6da7(++_0x5c3b7d);}(_0x5d28,0x17c));var _0x85d2=function(_0x4de7cd,_0xbe27ef){_0x4de7cd=_0x4de7cd-0x0;var _0x4bb10a=_0x5d28[_0x4de7cd];return _0x4bb10a;};'use strict';var _=require(_0x85d2('0x0'));var util=require(_0x85d2('0x1'));var logger=require(_0x85d2('0x2'))(_0x85d2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x85d2('0x4'));var fs=require('fs');var path=require(_0x85d2('0x5'));var rimraf=require(_0x85d2('0x6'));var config=require('../../config/environment');var attributes=require(_0x85d2('0x7'));module[_0x85d2('0x8')]=function(_0x573e12,_0x58bd22){return _0x573e12[_0x85d2('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0x85d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 2ea3c0e..fd80f7a 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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1ef3a2,_0x224f92){var _0x315e74=function(_0x22d086){while(--_0x22d086){_0x1ef3a2['push'](_0x1ef3a2['shift']());}};_0x315e74(++_0x224f92);}(_0x34e8,0x12c));var _0x834e=function(_0x2999b2,_0x2f48d5){_0x2999b2=_0x2999b2-0x0;var _0x416dd7=_0x34e8[_0x2999b2];return _0x416dd7;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x46f273,_0xd1e961){var _0x11c5c0=function(_0xcd371a){while(--_0xcd371a){_0x46f273['push'](_0x46f273['shift']());}};_0x11c5c0(++_0xd1e961);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0xcb91[_0x172ed7];return _0xfa8f61;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 98f783f..8825c6e 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 _0x495e=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','show','/:id/users','/:id/teams','post','addTeams','put','update','delete','/:id','removeAgents','removeTeams','exports','multer','connect-timeout'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x495e,0xfb));var _0xe495=function(_0x473ee7,_0x4dd754){_0x473ee7=_0x473ee7-0x0;var _0x30f0d4=_0x495e[_0x473ee7];return _0x30f0d4;};'use strict';var multer=require(_0xe495('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe495('0x1'));var express=require(_0xe495('0x2'));var router=express[_0xe495('0x3')]();var fs_extra=require(_0xe495('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe495('0x5'));var config=require(_0xe495('0x6'));var controller=require(_0xe495('0x7'));router[_0xe495('0x8')]('/',auth[_0xe495('0x9')](),controller[_0xe495('0xa')]);router[_0xe495('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xe495('0x8')]('/:id',auth[_0xe495('0x9')](),controller[_0xe495('0xb')]);router[_0xe495('0x8')](_0xe495('0xc'),auth[_0xe495('0x9')](),controller['getAgents']);router[_0xe495('0x8')](_0xe495('0xd'),auth[_0xe495('0x9')](),controller['getTeams']);router[_0xe495('0xe')]('/',auth[_0xe495('0x9')](),controller['create']);router['post'](_0xe495('0xc'),auth[_0xe495('0x9')](),controller['addAgents']);router[_0xe495('0xe')](_0xe495('0xd'),auth[_0xe495('0x9')](),controller[_0xe495('0xf')]);router[_0xe495('0x10')]('/:id',auth[_0xe495('0x9')](),controller[_0xe495('0x11')]);router[_0xe495('0x12')](_0xe495('0x13'),auth[_0xe495('0x9')](),controller['destroy']);router['delete']('/:id/users',auth[_0xe495('0x9')](),controller[_0xe495('0x14')]);router[_0xe495('0x12')]('/:id/teams',auth[_0xe495('0x9')](),controller[_0xe495('0x15')]);module[_0xe495('0x16')]=router; \ No newline at end of file +var _0x35c8=['destroy','/:id/users','removeAgents','removeTeams','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','show','getAgents','/:id/teams','create','post','addAgents','addTeams','put','/:id','delete'];(function(_0x53615a,_0x18e365){var _0x3a9bf3=function(_0x48d949){while(--_0x48d949){_0x53615a['push'](_0x53615a['shift']());}};_0x3a9bf3(++_0x18e365);}(_0x35c8,0xa6));var _0x835c=function(_0x3606e0,_0x5bebe5){_0x3606e0=_0x3606e0-0x0;var _0x3e3ae2=_0x35c8[_0x3606e0];return _0x3e3ae2;};'use strict';var multer=require(_0x835c('0x0'));var util=require(_0x835c('0x1'));var path=require(_0x835c('0x2'));var timeout=require(_0x835c('0x3'));var express=require(_0x835c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x835c('0x5'));var interaction=require(_0x835c('0x6'));var config=require(_0x835c('0x7'));var controller=require(_0x835c('0x8'));router[_0x835c('0x9')]('/',auth[_0x835c('0xa')](),controller[_0x835c('0xb')]);router[_0x835c('0x9')]('/describe',auth[_0x835c('0xa')](),controller[_0x835c('0xc')]);router[_0x835c('0x9')]('/:id',auth[_0x835c('0xa')](),controller[_0x835c('0xd')]);router[_0x835c('0x9')]('/:id/users',auth[_0x835c('0xa')](),controller[_0x835c('0xe')]);router[_0x835c('0x9')](_0x835c('0xf'),auth[_0x835c('0xa')](),controller['getTeams']);router['post']('/',auth[_0x835c('0xa')](),controller[_0x835c('0x10')]);router[_0x835c('0x11')]('/:id/users',auth[_0x835c('0xa')](),controller[_0x835c('0x12')]);router['post']('/:id/teams',auth[_0x835c('0xa')](),controller[_0x835c('0x13')]);router[_0x835c('0x14')](_0x835c('0x15'),auth[_0x835c('0xa')](),controller['update']);router[_0x835c('0x16')](_0x835c('0x15'),auth[_0x835c('0xa')](),controller[_0x835c('0x17')]);router[_0x835c('0x16')](_0x835c('0x18'),auth[_0x835c('0xa')](),controller[_0x835c('0x19')]);router[_0x835c('0x16')](_0x835c('0xf'),auth[_0x835c('0xa')](),controller[_0x835c('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index cc627b1..2d81d4a 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 _0x155e=['STRING','VIRTUAL','system-','getDataValue','name','INTEGER','sequelize'];(function(_0xa53e85,_0x41e734){var _0x573073=function(_0x3f0f83){while(--_0x3f0f83){_0xa53e85['push'](_0xa53e85['shift']());}};_0x573073(++_0x41e734);}(_0x155e,0x125));var _0xe155=function(_0x5e8c78,_0x55aace){_0x5e8c78=_0x5e8c78-0x0;var _0x118481=_0x155e[_0x5e8c78];return _0x118481;};'use strict';var Sequelize=require(_0xe155('0x0'));module['exports']={'name':{'type':Sequelize[_0xe155('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xe155('0x2')],'get':function(_0x360239){return _0xe155('0x3')+this[_0xe155('0x4')](_0xe155('0x5'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xe155('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xe155('0x6')]}}; \ No newline at end of file +var _0xd270=['name','getDataValue','INTEGER','exports','STRING'];(function(_0x16e09b,_0x5b7b9b){var _0x2c44de=function(_0x34a1ad){while(--_0x34a1ad){_0x16e09b['push'](_0x16e09b['shift']());}};_0x2c44de(++_0x5b7b9b);}(_0xd270,0xe9));var _0x0d27=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0xd270[_0x3438cf];return _0x278698;};'use strict';var Sequelize=require('sequelize');module[_0x0d27('0x0')]={'name':{'type':Sequelize[_0x0d27('0x1')],'allowNull':![],'unique':_0x0d27('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5bed93){return'system-'+this[_0x0d27('0x3')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x0d27('0x4')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 79b26c0..a882970 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 _0x6a95=['defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','includeAll','find','describe','sequelize','create','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','goto','context','charAt','update','system-','transaction','findById','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','hasOwnProperty','Team','getTeams','Agents','online','voicePause','flatMap','addTeams','each','upsert','UserVoicePrefix','findOrCreate','forEach','User','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','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis'];(function(_0x25ca74,_0x46fd14){var _0xd25c5a=function(_0x1f5fa5){while(--_0x1f5fa5){_0x25ca74['push'](_0x25ca74['shift']());}};_0xd25c5a(++_0x46fd14);}(_0x6a95,0x1db));var _0x56a9=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x6a95[_0x12d033];return _0x3b4e80;};'use strict';var emlformat=require(_0x56a9('0x0'));var rimraf=require(_0x56a9('0x1'));var zipdir=require(_0x56a9('0x2'));var jsonpatch=require(_0x56a9('0x3'));var rp=require(_0x56a9('0x4'));var moment=require(_0x56a9('0x5'));var BPromise=require(_0x56a9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x56a9('0x7'));var sox=require(_0x56a9('0x8'));var csv=require(_0x56a9('0x9'));var ejs=require(_0x56a9('0xa'));var fs=require('fs');var fs_extra=require(_0x56a9('0xb'));var _=require(_0x56a9('0xc'));var squel=require(_0x56a9('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x56a9('0xe'));var toCsv=require(_0x56a9('0x9'));var querystring=require('querystring');var Papa=require(_0x56a9('0xf'));var Redis=require(_0x56a9('0x10'));var authService=require(_0x56a9('0x11'));var qs=require(_0x56a9('0x12'));var as=require(_0x56a9('0x13'));var hardwareService=require(_0x56a9('0x14'));var logger=require(_0x56a9('0x15'))(_0x56a9('0x16'));var utils=require(_0x56a9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x56a9('0x18'));var db=require('../../mysqldb')['db'];config[_0x56a9('0x19')]=_[_0x56a9('0x1a')](config[_0x56a9('0x19')],{'host':_0x56a9('0x1b'),'port':0x18eb});var socket=require(_0x56a9('0x1c'))(new Redis(config[_0x56a9('0x19')]));require(_0x56a9('0x1d'))[_0x56a9('0x1e')](socket);function respondWithStatusCode(_0x40b2cb,_0x561bec){_0x561bec=_0x561bec||0xcc;return function(_0x582a5b){if(_0x582a5b){return _0x40b2cb[_0x56a9('0x1f')](_0x561bec);}return _0x40b2cb[_0x56a9('0x20')](_0x561bec)[_0x56a9('0x21')]();};}function respondWithResult(_0x46f854,_0x5b2637){_0x5b2637=_0x5b2637||0xc8;return function(_0x414cb5){if(_0x414cb5){return _0x46f854['status'](_0x5b2637)['json'](_0x414cb5);}};}function respondWithFilteredResult(_0x4e292f,_0x312e58){return function(_0x576bdf){if(_0x576bdf){var _0x59c0ec=typeof _0x312e58[_0x56a9('0x22')]===_0x56a9('0x23')&&typeof _0x312e58[_0x56a9('0x24')]===_0x56a9('0x23');var _0xbfeb1a=_0x576bdf[_0x56a9('0x25')];var _0x335cc3=_0x59c0ec?0x0:_0x312e58[_0x56a9('0x22')];var _0x62f79f=_0x59c0ec?_0x576bdf['count']:_0x312e58['offset']+_0x312e58[_0x56a9('0x24')];var _0x16f9de;if(_0x62f79f>=_0xbfeb1a){_0x62f79f=_0xbfeb1a;_0x16f9de=0xc8;}else{_0x16f9de=0xce;}_0x4e292f[_0x56a9('0x20')](_0x16f9de);return _0x4e292f[_0x56a9('0x26')]('Content-Range',_0x335cc3+'-'+_0x62f79f+'/'+_0xbfeb1a)[_0x56a9('0x27')](_0x576bdf);}return null;};}function patchUpdates(_0x3355c4){return function(_0x4036e5){try{jsonpatch[_0x56a9('0x28')](_0x4036e5,_0x3355c4,!![]);}catch(_0x5a82e0){return BPromise[_0x56a9('0x29')](_0x5a82e0);}return _0x4036e5[_0x56a9('0x2a')]();};}function saveUpdates(_0x21ab38,_0xd029f7){return function(_0x497d31){if(_0x497d31){return _0x497d31['update'](_0x21ab38)[_0x56a9('0x2b')](function(_0x217bda){return _0x217bda;});}return null;};}function removeEntity(_0x35fe6d,_0x5e3052){return function(_0x1099ba){if(_0x1099ba){return _0x1099ba['destroy']()[_0x56a9('0x2b')](function(){var _0x8d41d6=_0x1099ba[_0x56a9('0x2c')]({'plain':!![]});var _0x20432a=_0x56a9('0x2d');return db[_0x56a9('0x2e')][_0x56a9('0x2f')]({'where':{'type':_0x20432a,'resourceId':_0x8d41d6['id']}})[_0x56a9('0x2b')](function(){return _0x1099ba;});})['then'](function(){_0x35fe6d[_0x56a9('0x20')](0xcc)[_0x56a9('0x21')]();});}};}function handleEntityNotFound(_0x5f23e1,_0x4441ce){return function(_0x4f9be1){if(!_0x4f9be1){_0x5f23e1['sendStatus'](0x194);}return _0x4f9be1;};}function handleError(_0x20d940,_0x4c1e3e){_0x4c1e3e=_0x4c1e3e||0x1f4;return function(_0x2f933a){logger[_0x56a9('0x30')](_0x2f933a[_0x56a9('0x31')]);if(_0x2f933a[_0x56a9('0x32')]){delete _0x2f933a['name'];}_0x20d940[_0x56a9('0x20')](_0x4c1e3e)[_0x56a9('0x33')](_0x2f933a);};}exports[_0x56a9('0x34')]=function(_0xeabd82,_0xbbb47d){var _0x1fa0a6={},_0x3a7a4e={},_0x2b5447={'count':0x0,'rows':[]};var _0x42c2da=_[_0x56a9('0x35')](db[_0x56a9('0x36')][_0x56a9('0x37')],function(_0x5738fe){return{'name':_0x5738fe[_0x56a9('0x38')],'type':_0x5738fe[_0x56a9('0x39')][_0x56a9('0x3a')]};});_0x3a7a4e['model']=_[_0x56a9('0x35')](_0x42c2da,'name');_0x3a7a4e['query']=_['keys'](_0xeabd82[_0x56a9('0x3b')]);_0x3a7a4e[_0x56a9('0x3c')]=_['intersection'](_0x3a7a4e['model'],_0x3a7a4e[_0x56a9('0x3b')]);_0x1fa0a6[_0x56a9('0x3d')]=_[_0x56a9('0x3e')](_0x3a7a4e[_0x56a9('0x3f')],qs[_0x56a9('0x40')](_0xeabd82[_0x56a9('0x3b')][_0x56a9('0x40')]));_0x1fa0a6[_0x56a9('0x3d')]=_0x1fa0a6[_0x56a9('0x3d')][_0x56a9('0x41')]?_0x1fa0a6['attributes']:_0x3a7a4e['model'];if(!_0xeabd82['query']['hasOwnProperty'](_0x56a9('0x42'))){_0x1fa0a6[_0x56a9('0x24')]=qs['limit'](_0xeabd82[_0x56a9('0x3b')][_0x56a9('0x24')]);_0x1fa0a6[_0x56a9('0x22')]=qs[_0x56a9('0x22')](_0xeabd82[_0x56a9('0x3b')][_0x56a9('0x22')]);}_0x1fa0a6[_0x56a9('0x43')]=qs['sort'](_0xeabd82[_0x56a9('0x3b')][_0x56a9('0x44')]);_0x1fa0a6['where']=qs['filters'](_[_0x56a9('0x45')](_0xeabd82[_0x56a9('0x3b')],_0x3a7a4e[_0x56a9('0x3c')]),_0x42c2da);if(_0xeabd82[_0x56a9('0x3b')][_0x56a9('0x46')]){_0x1fa0a6[_0x56a9('0x47')]=_[_0x56a9('0x48')](_0x1fa0a6[_0x56a9('0x47')],{'$or':_[_0x56a9('0x35')](_0x42c2da,function(_0x24a7e3){if(_0x24a7e3[_0x56a9('0x39')]!==_0x56a9('0x49')){var _0xf2347a={};_0xf2347a[_0x24a7e3[_0x56a9('0x32')]]={'$like':'%'+_0xeabd82[_0x56a9('0x3b')][_0x56a9('0x46')]+'%'};return _0xf2347a;}})});}_0x1fa0a6=_[_0x56a9('0x48')]({},_0x1fa0a6,_0xeabd82[_0x56a9('0x4a')]);var _0x5dad3f={'where':_0x1fa0a6[_0x56a9('0x47')]};return db[_0x56a9('0x36')][_0x56a9('0x25')](_0x5dad3f)['then'](function(_0x1f8b30){_0x2b5447['count']=_0x1f8b30;if(_0xeabd82[_0x56a9('0x3b')]['includeAll']){_0x1fa0a6[_0x56a9('0x4b')]=[{'all':!![]}];}return db[_0x56a9('0x36')][_0x56a9('0x4c')](_0x1fa0a6);})[_0x56a9('0x2b')](function(_0x5192d8){_0x2b5447['rows']=_0x5192d8;return _0x2b5447;})['then'](respondWithFilteredResult(_0xbbb47d,_0x1fa0a6))[_0x56a9('0x4d')](handleError(_0xbbb47d,null));};exports[_0x56a9('0x4e')]=function(_0x288eaa,_0x402a64){var _0x16db39={'raw':![],'where':{'id':_0x288eaa[_0x56a9('0x4f')]['id']}},_0x182990={};_0x182990[_0x56a9('0x3f')]=_[_0x56a9('0x50')](db[_0x56a9('0x36')][_0x56a9('0x37')]);_0x182990[_0x56a9('0x3b')]=_[_0x56a9('0x50')](_0x288eaa[_0x56a9('0x3b')]);_0x182990['filters']=_[_0x56a9('0x3e')](_0x182990[_0x56a9('0x3f')],_0x182990[_0x56a9('0x3b')]);_0x16db39['attributes']=_[_0x56a9('0x3e')](_0x182990[_0x56a9('0x3f')],qs['fields'](_0x288eaa[_0x56a9('0x3b')][_0x56a9('0x40')]));_0x16db39[_0x56a9('0x3d')]=_0x16db39[_0x56a9('0x3d')]['length']?_0x16db39[_0x56a9('0x3d')]:_0x182990[_0x56a9('0x3f')];if(_0x288eaa[_0x56a9('0x3b')][_0x56a9('0x51')]){_0x16db39[_0x56a9('0x4b')]=[{'all':!![]}];}_0x16db39=_[_0x56a9('0x48')]({},_0x16db39,_0x288eaa[_0x56a9('0x4a')]);return db[_0x56a9('0x36')][_0x56a9('0x52')](_0x16db39)[_0x56a9('0x2b')](handleEntityNotFound(_0x402a64,null))[_0x56a9('0x2b')](respondWithResult(_0x402a64,null))['catch'](handleError(_0x402a64,null));};exports['destroy']=function(_0x46aa63,_0x35fb7b){return db[_0x56a9('0x36')][_0x56a9('0x52')]({'where':{'id':_0x46aa63['params']['id']}})[_0x56a9('0x2b')](handleEntityNotFound(_0x35fb7b,null))[_0x56a9('0x2b')](removeEntity(_0x35fb7b,null))[_0x56a9('0x4d')](handleError(_0x35fb7b,null));};exports[_0x56a9('0x53')]=function(_0x52ba21,_0x221a01){return db[_0x56a9('0x36')]['describe']()[_0x56a9('0x2b')](respondWithResult(_0x221a01,null))[_0x56a9('0x4d')](handleError(_0x221a01,null));};exports['create']=function(_0x12179d,_0x338140){var _0x230b53;return db[_0x56a9('0x54')]['transaction'](function(_0x4938d6){return db[_0x56a9('0x36')][_0x56a9('0x55')](_0x12179d[_0x56a9('0x56')],{'transaction':_0x4938d6})[_0x56a9('0x2b')](function(_0x40e660){_0x230b53=_0x40e660[_0x56a9('0x2c')]({'plain':!![]});return db[_0x56a9('0x57')][_0x56a9('0x52')]({'where':{'id':_0x230b53[_0x56a9('0x58')]},'raw':!![]})[_0x56a9('0x2b')](function(_0x5f07f5){return createVoicePrefixExtensions(_0x230b53,_0x5f07f5,_0x4938d6);});});})[_0x56a9('0x2b')](function(){var _0x20ce89=_0x12179d[_0x56a9('0x59')][_0x56a9('0x2c')]({'plain':!![]});if(!_0x20ce89)throw new Error(_0x56a9('0x5a'));if(_0x20ce89[_0x56a9('0x5b')]===_0x56a9('0x59')){var _0x488577=_0x230b53;return db[_0x56a9('0x5c')][_0x56a9('0x52')]({'where':{'name':_0x56a9('0x2d'),'userProfileId':_0x20ce89[_0x56a9('0x5d')]},'raw':!![]})[_0x56a9('0x2b')](function(_0x25830d){if(_0x25830d&&_0x25830d[_0x56a9('0x5e')]===0x0){return db['UserProfileResource'][_0x56a9('0x55')]({'name':_0x488577['name'],'resourceId':_0x488577['id'],'type':_0x25830d['name'],'sectionId':_0x25830d['id']},{})[_0x56a9('0x2b')](function(){return _0x230b53;});}else{return _0x230b53;}})['catch'](function(_0x229c12){logger[_0x56a9('0x30')](_0x56a9('0x5f'),_0x229c12);throw _0x229c12;});}return _0x230b53;})[_0x56a9('0x2b')](respondWithResult(_0x338140,null))[_0x56a9('0x4d')](handleError(_0x338140,null));};function Extension(_0x3e6f16,_0x1628a5,_0xa3850f,_0x91bad6){this['context']=_0x56a9('0x60');this[_0x56a9('0x61')]=_0x3e6f16;this[_0x56a9('0x62')]=_0xa3850f;this[_0x56a9('0x39')]=_0x56a9('0x63');this[_0x56a9('0x64')]=_0x56a9('0x65');this[_0x56a9('0x66')]=_0x1628a5;this[_0x56a9('0x67')]=_0x91bad6;}function createVoicePrefixExtensions(_0x25c6d6,_0x5df43d,_0x359c9c){return new BPromise(function(_0x286939,_0x38e497){var _0x47e4f7=new Extension(formatPrefixName(_0x25c6d6[_0x56a9('0x68')]),0x1,_0x56a9('0x69'),_0x56a9('0x6a'));_0x47e4f7['VoicePrefixId']=_0x25c6d6['id'];return db['VoiceExtension'][_0x56a9('0x55')](_0x47e4f7,{'transaction':_0x359c9c})[_0x56a9('0x2b')](function(_0x302aa0){var _0x1d6497=_0x302aa0[_0x56a9('0x2c')]({'plain':!![]});var _0x5d126f=_[_0x56a9('0x35')](addVoicePrefixExtensions(_0x25c6d6,_0x5df43d),function(_0x52bc63){_0x52bc63[_0x56a9('0x58')]=_0x1d6497['id'];_0x52bc63[_0x56a9('0x6b')]=_0x25c6d6['id'];return _0x52bc63;});return db[_0x56a9('0x57')][_0x56a9('0x6c')](_0x5d126f,{'transaction':_0x359c9c})[_0x56a9('0x2b')](function(_0x5edf65){if(!_0x5edf65){return _0x38e497('Extensions\x20creation\x20failed');}else{return _0x286939(_0x5edf65);}})['catch'](function(_0x2de0da){return _0x38e497(_0x2de0da);});});;});};function addVoicePrefixExtensions(_0x2aa634,_0x41ca05){var _0x5bbbf3=[];var _0x2313c4=formatPrefixName(_0x2aa634['prefix']);_0x5bbbf3[_0x56a9('0x6d')](new Extension(_0x2313c4,0x2,_0x56a9('0x6e'),_0x56a9('0x6f')+_0x2aa634['name']));if(_0x2aa634['callerIdAll']){_0x5bbbf3[_0x56a9('0x6d')](new Extension(_0x2313c4,0x3,_0x56a9('0x6e'),_0x56a9('0x70')+_0x2aa634[_0x56a9('0x71')]));}else{_0x5bbbf3[_0x56a9('0x6d')](new Extension(_0x2313c4,0x3,_0x56a9('0x69'),'No\x20callerid\x20available'));}_0x5bbbf3[_0x56a9('0x6d')](new Extension(_0x2313c4,0x4,_0x56a9('0x72'),_0x41ca05[_0x56a9('0x73')]+','+'${EXTEN:'+(0x8+_0x2aa634['name']['length'])+'}'+','+0x1));return _0x5bbbf3;}function formatPrefixName(_0x57001c){var _0x4270ba='_';for(var _0x35b620=0x0;_0x35b620<_0x57001c['length'];_0x35b620++){if(_0x57001c[_0x56a9('0x74')](_0x35b620)=='-'){_0x4270ba+=_0x57001c[_0x56a9('0x74')](_0x35b620);}else{_0x4270ba+='['+_0x57001c[_0x56a9('0x74')](_0x35b620)+']';}}_0x4270ba+='.';return _0x4270ba;}exports[_0x56a9('0x75')]=function(_0x58108a,_0x26315b,_0x398a63){var _0x25b6b6=_0x58108a[_0x56a9('0x56')];_0x25b6b6[_0x56a9('0x68')]=_0x56a9('0x76')+_0x25b6b6[_0x56a9('0x32')]+'-';return db[_0x56a9('0x54')][_0x56a9('0x77')](function(_0x41437e){return db[_0x56a9('0x36')][_0x56a9('0x75')](_0x25b6b6,{'where':{'id':_0x25b6b6['id']},'transaction':_0x41437e})[_0x56a9('0x2b')](function(){return db[_0x56a9('0x57')][_0x56a9('0x2f')]({'where':{'VoicePrefixId':_0x25b6b6['id']},'transaction':_0x41437e})[_0x56a9('0x2b')](function(){return db['VoiceExtension'][_0x56a9('0x52')]({'where':{'id':_0x25b6b6['VoiceExtensionId']},'raw':!![]})[_0x56a9('0x2b')](function(_0x2ef783){return createVoicePrefixExtensions(_0x25b6b6,_0x2ef783,_0x41437e);});});});})[_0x56a9('0x2b')](function(){return db['VoicePrefix'][_0x56a9('0x78')](_0x25b6b6['id']);})['then'](respondWithResult(_0x26315b,null))['catch'](handleError(_0x26315b,null));};exports[_0x56a9('0x79')]=function(_0x1730ac,_0x17ff8e,_0x15b983){return db['VoicePrefix'][_0x56a9('0x52')]({'where':{'id':_0x1730ac[_0x56a9('0x4f')]['id']}})[_0x56a9('0x2b')](handleEntityNotFound(_0x17ff8e,null))[_0x56a9('0x2b')](function(_0x5b144f){if(_0x5b144f){return _0x5b144f['addAgents'](_0x1730ac['body'][_0x56a9('0x7a')],_[_0x56a9('0x7b')](_0x1730ac[_0x56a9('0x56')],[_0x56a9('0x7a'),'id'])||{})[_0x56a9('0x7c')](function(_0x23c0ee){for(var _0x106017=0x0;_0x106017<_0x1730ac[_0x56a9('0x56')]['ids']['length'];_0x106017+=0x1){socket['emit'](_0x56a9('0x7d'),{'UserId':Number(_0x1730ac['body']['ids'][_0x106017]),'VoicePrefixId':Number(_0x1730ac['params']['id'])});}return _0x23c0ee;});}})['then'](respondWithResult(_0x17ff8e,null))[_0x56a9('0x4d')](handleError(_0x17ff8e,null));};exports[_0x56a9('0x7e')]=function(_0x16a293,_0x32ba59,_0x5e35aa){return db[_0x56a9('0x36')][_0x56a9('0x52')]({'where':{'id':_0x16a293[_0x56a9('0x4f')]['id']}})[_0x56a9('0x2b')](handleEntityNotFound(_0x32ba59,null))[_0x56a9('0x2b')](function(_0x469bf6){if(_0x469bf6){return _0x469bf6[_0x56a9('0x7e')](_0x16a293[_0x56a9('0x3b')][_0x56a9('0x7a')])[_0x56a9('0x2b')](function(){if(_[_0x56a9('0x7f')](_0x16a293[_0x56a9('0x3b')][_0x56a9('0x7a')])){for(var _0x4d8ccc=0x0;_0x4d8ccc<_0x16a293['query']['ids']['length'];_0x4d8ccc+=0x1){socket[_0x56a9('0x80')](_0x56a9('0x81'),{'UserId':Number(_0x16a293['query'][_0x56a9('0x7a')][_0x4d8ccc]),'VoicePrefixId':Number(_0x16a293[_0x56a9('0x4f')]['id'])});}}else{socket[_0x56a9('0x80')](_0x56a9('0x81'),{'UserId':Number(_0x16a293[_0x56a9('0x3b')][_0x56a9('0x7a')]),'VoicePrefixId':Number(_0x16a293['params']['id'])});}});}})[_0x56a9('0x2b')](respondWithStatusCode(_0x32ba59,null))['catch'](handleError(_0x32ba59,null));};exports[_0x56a9('0x82')]=function(_0x296203,_0x6dd6e6,_0x598a82){var _0x19cfef={};var _0xe2f84={};var _0x35731a;var _0x256b26;return db[_0x56a9('0x36')][_0x56a9('0x83')]({'where':{'id':_0x296203['params']['id']}})[_0x56a9('0x2b')](handleEntityNotFound(_0x6dd6e6,null))[_0x56a9('0x2b')](function(_0x1f42a3){if(_0x1f42a3){_0x35731a=_0x1f42a3;_0xe2f84[_0x56a9('0x3f')]=_[_0x56a9('0x50')](db['User'][_0x56a9('0x37')]);_0xe2f84[_0x56a9('0x3b')]=_[_0x56a9('0x50')](_0x296203[_0x56a9('0x3b')]);_0xe2f84[_0x56a9('0x3c')]=_['intersection'](_0xe2f84[_0x56a9('0x3f')],_0xe2f84[_0x56a9('0x3b')]);_0x19cfef['attributes']=_[_0x56a9('0x3e')](_0xe2f84[_0x56a9('0x3f')],qs[_0x56a9('0x40')](_0x296203['query'][_0x56a9('0x40')]));_0x19cfef[_0x56a9('0x3d')]=_0x19cfef[_0x56a9('0x3d')][_0x56a9('0x41')]?_0x19cfef[_0x56a9('0x3d')]:_0xe2f84[_0x56a9('0x3f')];_0x19cfef[_0x56a9('0x43')]=qs[_0x56a9('0x44')](_0x296203[_0x56a9('0x3b')][_0x56a9('0x44')]);_0x19cfef['where']=qs[_0x56a9('0x3c')](_[_0x56a9('0x45')](_0x296203[_0x56a9('0x3b')],_0xe2f84[_0x56a9('0x3c')]));if(_0x296203[_0x56a9('0x3b')][_0x56a9('0x46')]){_0x19cfef[_0x56a9('0x47')]=_['merge'](_0x19cfef[_0x56a9('0x47')],{'$or':_['map'](_0x19cfef[_0x56a9('0x3d')],function(_0x324a98){var _0x1324ba={};_0x1324ba[_0x324a98]={'$like':'%'+_0x296203[_0x56a9('0x3b')][_0x56a9('0x46')]+'%'};return _0x1324ba;})});}_0x19cfef=_['merge']({},_0x19cfef,_0x296203[_0x56a9('0x4a')]);return _0x35731a['getAgents'](_0x19cfef);}})[_0x56a9('0x2b')](function(_0x131644){if(_0x131644){_0x256b26=_0x131644[_0x56a9('0x41')];if(!_0x296203[_0x56a9('0x3b')][_0x56a9('0x84')](_0x56a9('0x42'))){_0x19cfef[_0x56a9('0x24')]=qs[_0x56a9('0x24')](_0x296203[_0x56a9('0x3b')][_0x56a9('0x24')]);_0x19cfef['offset']=qs[_0x56a9('0x22')](_0x296203['query']['offset']);}return _0x35731a[_0x56a9('0x82')](_0x19cfef);}})[_0x56a9('0x2b')](function(_0x5a2080){if(_0x5a2080){return _0x5a2080?{'count':_0x256b26,'rows':_0x5a2080}:null;}})[_0x56a9('0x2b')](respondWithResult(_0x6dd6e6,null))[_0x56a9('0x4d')](handleError(_0x6dd6e6,null));};exports['getTeams']=function(_0x3c0b9a,_0x5eb05d,_0x2cf047){var _0x18fd5e={};var _0x5f5db6={};var _0xafa83b;var _0x4c3257;return db[_0x56a9('0x36')]['findOne']({'where':{'id':_0x3c0b9a[_0x56a9('0x4f')]['id']}})[_0x56a9('0x2b')](handleEntityNotFound(_0x5eb05d,null))[_0x56a9('0x2b')](function(_0x269369){if(_0x269369){_0xafa83b=_0x269369;_0x5f5db6[_0x56a9('0x3f')]=_['keys'](db[_0x56a9('0x85')][_0x56a9('0x37')]);_0x5f5db6[_0x56a9('0x3b')]=_[_0x56a9('0x50')](_0x3c0b9a[_0x56a9('0x3b')]);_0x5f5db6['filters']=_[_0x56a9('0x3e')](_0x5f5db6[_0x56a9('0x3f')],_0x5f5db6[_0x56a9('0x3b')]);_0x18fd5e['attributes']=_[_0x56a9('0x3e')](_0x5f5db6[_0x56a9('0x3f')],qs[_0x56a9('0x40')](_0x3c0b9a[_0x56a9('0x3b')]['fields']));_0x18fd5e['attributes']=_0x18fd5e[_0x56a9('0x3d')][_0x56a9('0x41')]?_0x18fd5e[_0x56a9('0x3d')]:_0x5f5db6[_0x56a9('0x3f')];_0x18fd5e[_0x56a9('0x43')]=qs[_0x56a9('0x44')](_0x3c0b9a[_0x56a9('0x3b')][_0x56a9('0x44')]);_0x18fd5e[_0x56a9('0x47')]=qs['filters'](_[_0x56a9('0x45')](_0x3c0b9a['query'],_0x5f5db6[_0x56a9('0x3c')]));if(_0x3c0b9a[_0x56a9('0x3b')][_0x56a9('0x46')]){_0x18fd5e[_0x56a9('0x47')]=_[_0x56a9('0x48')](_0x18fd5e['where'],{'$or':_[_0x56a9('0x35')](_0x18fd5e[_0x56a9('0x3d')],function(_0x21ffcf){var _0x2d02e7={};_0x2d02e7[_0x21ffcf]={'$like':'%'+_0x3c0b9a[_0x56a9('0x3b')][_0x56a9('0x46')]+'%'};return _0x2d02e7;})});}_0x18fd5e=_[_0x56a9('0x48')]({},_0x18fd5e,_0x3c0b9a['options']);return _0xafa83b[_0x56a9('0x86')](_0x18fd5e);}})[_0x56a9('0x2b')](function(_0x45e58d){if(_0x45e58d){_0x4c3257=_0x45e58d[_0x56a9('0x41')];if(!_0x3c0b9a[_0x56a9('0x3b')][_0x56a9('0x84')]('nolimit')){_0x18fd5e[_0x56a9('0x24')]=qs['limit'](_0x3c0b9a[_0x56a9('0x3b')][_0x56a9('0x24')]);_0x18fd5e[_0x56a9('0x22')]=qs['offset'](_0x3c0b9a[_0x56a9('0x3b')][_0x56a9('0x22')]);}return _0xafa83b[_0x56a9('0x86')](_0x18fd5e);}})[_0x56a9('0x2b')](function(_0x12e70a){if(_0x12e70a){return _0x12e70a?{'count':_0x4c3257,'rows':_0x12e70a}:null;}})[_0x56a9('0x2b')](respondWithResult(_0x5eb05d,null))[_0x56a9('0x4d')](handleError(_0x5eb05d,null));};exports['addTeams']=function(_0x4fee66,_0x444b4,_0x1a3459){var _0x5480b6=_0x4fee66[_0x56a9('0x56')][_0x56a9('0x7a')];var _0x14d54d;return db['Team'][_0x56a9('0x4c')]({'where':{'id':_0x5480b6},'attributes':['id'],'include':[{'model':db['User'],'as':_0x56a9('0x87'),'attributes':['id','name',_0x56a9('0x88'),_0x56a9('0x89'),'interface'],'raw':!![]}]})[_0x56a9('0x2b')](function(_0x41c07e){if(_0x41c07e){_0x14d54d=_0x41c07e;var _0x11a6ab=_[_0x56a9('0x8a')](_0x41c07e,function(_0x474ae4){var _0x3fe3e9=_0x474ae4['get']({'plain':!![]});return _0x3fe3e9[_0x56a9('0x87')];});return db[_0x56a9('0x36')][_0x56a9('0x52')]({'where':{'id':_0x4fee66['params']['id']}})[_0x56a9('0x2b')](function(_0x22f222){return db[_0x56a9('0x54')][_0x56a9('0x77')](function(_0x2adb73){return _0x22f222[_0x56a9('0x8b')](_0x5480b6,{'transaction':_0x2adb73})[_0x56a9('0x2b')](function(){return BPromise[_0x56a9('0x8c')](_0x14d54d,function(_0x4252c0){return db['TeamVoicePrefix'][_0x56a9('0x8d')]({'TeamId':_0x4252c0['id'],'VoicePrefixId':_0x4fee66['params']['id']},{'transaction':_0x2adb73});});})[_0x56a9('0x2b')](function(){return BPromise[_0x56a9('0x8c')](_0x11a6ab,function(_0x2ee1ee){return db[_0x56a9('0x8e')][_0x56a9('0x8f')]({'where':{'UserId':_0x2ee1ee['id'],'VoicePrefixId':_0x4fee66['params']['id']},'transaction':_0x2adb73});});})[_0x56a9('0x2b')](function(){_0x11a6ab[_0x56a9('0x90')](function(_0x4959e1){socket[_0x56a9('0x80')](_0x56a9('0x7d'),{'UserId':_0x4959e1['id'],'VoicePrefixId':_0x22f222['id']});});});});});}})[_0x56a9('0x2b')](respondWithStatusCode(_0x444b4,null))[_0x56a9('0x4d')](handleError(_0x444b4,null));};exports['removeTeams']=function(_0xf42b12,_0x487850,_0x3f6373){return db[_0x56a9('0x85')][_0x56a9('0x4c')]({'where':{'id':_0xf42b12[_0x56a9('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x56a9('0x91')],'as':_0x56a9('0x87'),'attributes':['id'],'raw':!![]}]})[_0x56a9('0x2b')](handleEntityNotFound(_0x487850,null))['then'](function(_0x143875){var _0x289604=_[_0x56a9('0x35')](_0x143875,'id');var _0x47ad47=[];var _0x531d93=[];var _0x175da9=squel[_0x56a9('0x92')]();_0x175da9['field'](_0x56a9('0x93'))[_0x56a9('0x94')](_0x56a9('0x95'),'tq')['join'](_0x56a9('0x96'),'ut',_0x56a9('0x97'))[_0x56a9('0x47')](_0x56a9('0x98'),_0xf42b12[_0x56a9('0x4f')]['id']);for(var _0xff2bfb=0x0;_0xff2bfb<_0x143875[_0x56a9('0x41')];_0xff2bfb+=0x1){let _0x11c091=_0x143875[_0xff2bfb];for(var _0xcacd10=0x0;_0xcacd10<_0x11c091[_0x56a9('0x87')][_0x56a9('0x41')];_0xcacd10+=0x1){let _0x142d8d=_0x11c091[_0x56a9('0x87')][_0xcacd10];var _0x35b35a=_0x175da9[_0x56a9('0x99')]();_0x35b35a['where'](_0x56a9('0x9a'),_0x142d8d['id']);_0x531d93[_0x56a9('0x6d')](db['sequelize']['query'](_0x35b35a[_0x56a9('0x9b')](),{'type':db['sequelize'][_0x56a9('0x9c')][_0x56a9('0x9d')]})['then'](function(_0x40526a){if(_0x40526a['length']===0x1){return _0x142d8d['id'];}else{var _0x57e0ca=_[_0x56a9('0x9e')](_[_0x56a9('0x35')](_0x40526a,_0x56a9('0x9f')),function(_0x1ce55c){return _[_0x56a9('0xa0')](_0x289604,_0x1ce55c);});if(_0x57e0ca){return _0x142d8d['id'];}}}));}}return BPromise[_0x56a9('0xa1')](_0x531d93)[_0x56a9('0x2b')](function(_0x1e36c0){_0x47ad47=_(_0x47ad47)[_0x56a9('0xa2')](_0x1e36c0)[_0x56a9('0xa3')]()[_0x56a9('0xa4')]();return db[_0x56a9('0x36')][_0x56a9('0x52')]({'where':{'id':_0xf42b12[_0x56a9('0x4f')]['id']}})[_0x56a9('0x2b')](function(_0x5a2eb4){return db[_0x56a9('0x54')][_0x56a9('0x77')](function(_0x1fe677){return _0x5a2eb4[_0x56a9('0xa5')](_0xf42b12['query'][_0x56a9('0x7a')],{'transaction':_0x1fe677})[_0x56a9('0x2b')](function(){if(!_[_0x56a9('0xa6')](_0x47ad47)){return _0x5a2eb4[_0x56a9('0x7e')](_0x47ad47,{'transaction':_0x1fe677});}})[_0x56a9('0x2b')](function(){_0x47ad47['forEach'](function(_0x33660b){socket[_0x56a9('0x80')](_0x56a9('0x81'),{'UserId':_0x33660b,'VoicePrefixId':_0x5a2eb4['id']});});});});});});})[_0x56a9('0x2b')](respondWithStatusCode(_0x487850,null))[_0x56a9('0x4d')](handleError(_0x487850,null));}; \ No newline at end of file +var _0x4325=['every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','undefined','limit','count','offset','apply','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','describe','sequelize','create','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','map','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','system-','transaction','find','findById','addAgents','ids','omit','spread','userVoicePrefix:save','userVoicePrefix:remove','emit','getAgents','getTeams','Team','addTeams','User','Agents','online','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT'];(function(_0x2b3e75,_0x3adbf8){var _0x27897d=function(_0x7207c2){while(--_0x7207c2){_0x2b3e75['push'](_0x2b3e75['shift']());}};_0x27897d(++_0x3adbf8);}(_0x4325,0x1da));var _0x5432=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4325[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x5432('0x0'));var rimraf=require(_0x5432('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5432('0x2'));var rp=require(_0x5432('0x3'));var moment=require(_0x5432('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5432('0x5'));var path=require(_0x5432('0x6'));var sox=require(_0x5432('0x7'));var csv=require('to-csv');var ejs=require(_0x5432('0x8'));var fs=require('fs');var fs_extra=require(_0x5432('0x9'));var _=require('lodash');var squel=require(_0x5432('0xa'));var crypto=require('crypto');var jsforce=require(_0x5432('0xb'));var deskjs=require(_0x5432('0xc'));var toCsv=require(_0x5432('0xd'));var querystring=require(_0x5432('0xe'));var Papa=require(_0x5432('0xf'));var Redis=require('ioredis');var authService=require(_0x5432('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5432('0x11'));var hardwareService=require(_0x5432('0x12'));var logger=require(_0x5432('0x13'))(_0x5432('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5432('0x15'));var db=require(_0x5432('0x16'))['db'];config['redis']=_[_0x5432('0x17')](config[_0x5432('0x18')],{'host':_0x5432('0x19'),'port':0x18eb});var socket=require(_0x5432('0x1a'))(new Redis(config[_0x5432('0x18')]));require(_0x5432('0x1b'))['register'](socket);function respondWithStatusCode(_0x5617ce,_0x43bb16){_0x43bb16=_0x43bb16||0xcc;return function(_0x44e70c){if(_0x44e70c){return _0x5617ce[_0x5432('0x1c')](_0x43bb16);}return _0x5617ce[_0x5432('0x1d')](_0x43bb16)[_0x5432('0x1e')]();};}function respondWithResult(_0x11db3c,_0x5e18e8){_0x5e18e8=_0x5e18e8||0xc8;return function(_0x2cf409){if(_0x2cf409){return _0x11db3c['status'](_0x5e18e8)[_0x5432('0x1f')](_0x2cf409);}};}function respondWithFilteredResult(_0x3de07a,_0x333152){return function(_0x32fe60){if(_0x32fe60){var _0x4221a8=typeof _0x333152['offset']===_0x5432('0x20')&&typeof _0x333152[_0x5432('0x21')]===_0x5432('0x20');var _0x2bfe04=_0x32fe60[_0x5432('0x22')];var _0x451de4=_0x4221a8?0x0:_0x333152[_0x5432('0x23')];var _0x5da6ea=_0x4221a8?_0x32fe60[_0x5432('0x22')]:_0x333152[_0x5432('0x23')]+_0x333152[_0x5432('0x21')];var _0xa6c864;if(_0x5da6ea>=_0x2bfe04){_0x5da6ea=_0x2bfe04;_0xa6c864=0xc8;}else{_0xa6c864=0xce;}_0x3de07a[_0x5432('0x1d')](_0xa6c864);return _0x3de07a['set']('Content-Range',_0x451de4+'-'+_0x5da6ea+'/'+_0x2bfe04)['json'](_0x32fe60);}return null;};}function patchUpdates(_0x61827e){return function(_0xb900f2){try{jsonpatch[_0x5432('0x24')](_0xb900f2,_0x61827e,!![]);}catch(_0x1f4870){return BPromise['reject'](_0x1f4870);}return _0xb900f2['save']();};}function saveUpdates(_0x3e0b66,_0x8ed74b){return function(_0x4a40fc){if(_0x4a40fc){return _0x4a40fc[_0x5432('0x25')](_0x3e0b66)[_0x5432('0x26')](function(_0x637582){return _0x637582;});}return null;};}function removeEntity(_0x4b6ea5,_0xd9928a){return function(_0xccefeb){if(_0xccefeb){return _0xccefeb[_0x5432('0x27')]()['then'](function(){var _0x4ab09d=_0xccefeb[_0x5432('0x28')]({'plain':!![]});var _0x2114b8='VoicePrefixes';return db[_0x5432('0x29')][_0x5432('0x27')]({'where':{'type':_0x2114b8,'resourceId':_0x4ab09d['id']}})[_0x5432('0x26')](function(){return _0xccefeb;});})['then'](function(){_0x4b6ea5[_0x5432('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4821be,_0x6fc7f5){return function(_0x4a52ba){if(!_0x4a52ba){_0x4821be[_0x5432('0x1c')](0x194);}return _0x4a52ba;};}function handleError(_0x578281,_0x59a866){_0x59a866=_0x59a866||0x1f4;return function(_0x465a09){logger[_0x5432('0x2a')](_0x465a09[_0x5432('0x2b')]);if(_0x465a09['name']){delete _0x465a09[_0x5432('0x2c')];}_0x578281[_0x5432('0x1d')](_0x59a866)[_0x5432('0x2d')](_0x465a09);};}exports[_0x5432('0x2e')]=function(_0x1a5612,_0x308b4c){var _0x431765={},_0x444178={},_0x34a152={'count':0x0,'rows':[]};var _0x5abaf7=_['map'](db[_0x5432('0x2f')][_0x5432('0x30')],function(_0x2ebffa){return{'name':_0x2ebffa[_0x5432('0x31')],'type':_0x2ebffa[_0x5432('0x32')]['key']};});_0x444178[_0x5432('0x33')]=_['map'](_0x5abaf7,_0x5432('0x2c'));_0x444178[_0x5432('0x34')]=_[_0x5432('0x35')](_0x1a5612[_0x5432('0x34')]);_0x444178[_0x5432('0x36')]=_[_0x5432('0x37')](_0x444178['model'],_0x444178[_0x5432('0x34')]);_0x431765[_0x5432('0x38')]=_[_0x5432('0x37')](_0x444178[_0x5432('0x33')],qs['fields'](_0x1a5612[_0x5432('0x34')][_0x5432('0x39')]));_0x431765[_0x5432('0x38')]=_0x431765[_0x5432('0x38')][_0x5432('0x3a')]?_0x431765[_0x5432('0x38')]:_0x444178[_0x5432('0x33')];if(!_0x1a5612[_0x5432('0x34')][_0x5432('0x3b')](_0x5432('0x3c'))){_0x431765[_0x5432('0x21')]=qs[_0x5432('0x21')](_0x1a5612[_0x5432('0x34')][_0x5432('0x21')]);_0x431765['offset']=qs[_0x5432('0x23')](_0x1a5612['query'][_0x5432('0x23')]);}_0x431765[_0x5432('0x3d')]=qs[_0x5432('0x3e')](_0x1a5612[_0x5432('0x34')]['sort']);_0x431765['where']=qs['filters'](_[_0x5432('0x3f')](_0x1a5612[_0x5432('0x34')],_0x444178[_0x5432('0x36')]),_0x5abaf7);if(_0x1a5612[_0x5432('0x34')]['filter']){_0x431765[_0x5432('0x40')]=_[_0x5432('0x41')](_0x431765[_0x5432('0x40')],{'$or':_['map'](_0x5abaf7,function(_0x219ddc){if(_0x219ddc[_0x5432('0x32')]!=='VIRTUAL'){var _0x3eb446={};_0x3eb446[_0x219ddc[_0x5432('0x2c')]]={'$like':'%'+_0x1a5612['query'][_0x5432('0x42')]+'%'};return _0x3eb446;}})});}_0x431765=_['merge']({},_0x431765,_0x1a5612[_0x5432('0x43')]);var _0x2d4cb0={'where':_0x431765[_0x5432('0x40')]};return db[_0x5432('0x2f')]['count'](_0x2d4cb0)[_0x5432('0x26')](function(_0x4b93b4){_0x34a152[_0x5432('0x22')]=_0x4b93b4;if(_0x1a5612[_0x5432('0x34')][_0x5432('0x44')]){_0x431765[_0x5432('0x45')]=[{'all':!![]}];}return db[_0x5432('0x2f')][_0x5432('0x46')](_0x431765);})[_0x5432('0x26')](function(_0x4ab024){_0x34a152[_0x5432('0x47')]=_0x4ab024;return _0x34a152;})[_0x5432('0x26')](respondWithFilteredResult(_0x308b4c,_0x431765))[_0x5432('0x48')](handleError(_0x308b4c,null));};exports[_0x5432('0x49')]=function(_0x24f090,_0x29a39d){var _0x2134c9={'raw':![],'where':{'id':_0x24f090[_0x5432('0x4a')]['id']}},_0x5d183a={};_0x5d183a[_0x5432('0x33')]=_[_0x5432('0x35')](db[_0x5432('0x2f')][_0x5432('0x30')]);_0x5d183a['query']=_[_0x5432('0x35')](_0x24f090['query']);_0x5d183a[_0x5432('0x36')]=_[_0x5432('0x37')](_0x5d183a['model'],_0x5d183a[_0x5432('0x34')]);_0x2134c9['attributes']=_[_0x5432('0x37')](_0x5d183a[_0x5432('0x33')],qs['fields'](_0x24f090['query'][_0x5432('0x39')]));_0x2134c9[_0x5432('0x38')]=_0x2134c9[_0x5432('0x38')][_0x5432('0x3a')]?_0x2134c9[_0x5432('0x38')]:_0x5d183a[_0x5432('0x33')];if(_0x24f090[_0x5432('0x34')]['includeAll']){_0x2134c9[_0x5432('0x45')]=[{'all':!![]}];}_0x2134c9=_[_0x5432('0x41')]({},_0x2134c9,_0x24f090[_0x5432('0x43')]);return db['VoicePrefix']['find'](_0x2134c9)['then'](handleEntityNotFound(_0x29a39d,null))['then'](respondWithResult(_0x29a39d,null))[_0x5432('0x48')](handleError(_0x29a39d,null));};exports[_0x5432('0x27')]=function(_0x21d39b,_0xaeae36){return db[_0x5432('0x2f')]['find']({'where':{'id':_0x21d39b[_0x5432('0x4a')]['id']}})[_0x5432('0x26')](handleEntityNotFound(_0xaeae36,null))[_0x5432('0x26')](removeEntity(_0xaeae36,null))['catch'](handleError(_0xaeae36,null));};exports[_0x5432('0x4b')]=function(_0x9e921,_0x2c2bce){return db[_0x5432('0x2f')][_0x5432('0x4b')]()['then'](respondWithResult(_0x2c2bce,null))[_0x5432('0x48')](handleError(_0x2c2bce,null));};exports['create']=function(_0x2fd527,_0x56090e){var _0x1f4d0c;return db[_0x5432('0x4c')]['transaction'](function(_0x7129e2){return db['VoicePrefix'][_0x5432('0x4d')](_0x2fd527[_0x5432('0x4e')],{'transaction':_0x7129e2})[_0x5432('0x26')](function(_0x7af1aa){_0x1f4d0c=_0x7af1aa['get']({'plain':!![]});return db[_0x5432('0x4f')]['find']({'where':{'id':_0x1f4d0c[_0x5432('0x50')]},'raw':!![]})['then'](function(_0x1c5c5c){return createVoicePrefixExtensions(_0x1f4d0c,_0x1c5c5c,_0x7129e2);});});})[_0x5432('0x26')](function(){var _0x37d69b=_0x2fd527[_0x5432('0x51')][_0x5432('0x28')]({'plain':!![]});if(!_0x37d69b)throw new Error(_0x5432('0x52'));if(_0x37d69b[_0x5432('0x53')]===_0x5432('0x51')){var _0x3e0259=_0x1f4d0c;return db[_0x5432('0x54')]['find']({'where':{'name':_0x5432('0x55'),'userProfileId':_0x37d69b[_0x5432('0x56')]},'raw':!![]})['then'](function(_0x324691){if(_0x324691&&_0x324691[_0x5432('0x57')]===0x0){return db[_0x5432('0x29')][_0x5432('0x4d')]({'name':_0x3e0259[_0x5432('0x2c')],'resourceId':_0x3e0259['id'],'type':_0x324691['name'],'sectionId':_0x324691['id']},{})['then'](function(){return _0x1f4d0c;});}else{return _0x1f4d0c;}})['catch'](function(_0x567f91){logger[_0x5432('0x2a')](_0x5432('0x58'),_0x567f91);throw _0x567f91;});}return _0x1f4d0c;})[_0x5432('0x26')](respondWithResult(_0x56090e,null))['catch'](handleError(_0x56090e,null));};function Extension(_0xb6f66a,_0x12768f,_0x304f4f,_0x3d39f7){this[_0x5432('0x59')]=_0x5432('0x5a');this[_0x5432('0x5b')]=_0xb6f66a;this[_0x5432('0x5c')]=_0x304f4f;this[_0x5432('0x32')]=_0x5432('0x5d');this[_0x5432('0x5e')]='Voice\x20Prefix\x20Extension';this[_0x5432('0x5f')]=_0x12768f;this[_0x5432('0x60')]=_0x3d39f7;}function createVoicePrefixExtensions(_0xa070cb,_0x46c8b4,_0x197df9){return new BPromise(function(_0x4a60e7,_0x24d570){var _0x524e2a=new Extension(formatPrefixName(_0xa070cb[_0x5432('0x61')]),0x1,_0x5432('0x62'),_0x5432('0x63'));_0x524e2a[_0x5432('0x64')]=_0xa070cb['id'];return db[_0x5432('0x4f')][_0x5432('0x4d')](_0x524e2a,{'transaction':_0x197df9})[_0x5432('0x26')](function(_0x119c47){var _0x388600=_0x119c47[_0x5432('0x28')]({'plain':!![]});var _0x131fc1=_[_0x5432('0x65')](addVoicePrefixExtensions(_0xa070cb,_0x46c8b4),function(_0x18d05c){_0x18d05c[_0x5432('0x50')]=_0x388600['id'];_0x18d05c[_0x5432('0x64')]=_0xa070cb['id'];return _0x18d05c;});return db[_0x5432('0x4f')][_0x5432('0x66')](_0x131fc1,{'transaction':_0x197df9})[_0x5432('0x26')](function(_0x521c0c){if(!_0x521c0c){return _0x24d570(_0x5432('0x67'));}else{return _0x4a60e7(_0x521c0c);}})['catch'](function(_0x1d5412){return _0x24d570(_0x1d5412);});});;});};function addVoicePrefixExtensions(_0x281684,_0x5aebe8){var _0x32fdfc=[];var _0x33d39a=formatPrefixName(_0x281684[_0x5432('0x61')]);_0x32fdfc[_0x5432('0x68')](new Extension(_0x33d39a,0x2,'Set',_0x5432('0x69')+_0x281684['name']));if(_0x281684[_0x5432('0x6a')]){_0x32fdfc[_0x5432('0x68')](new Extension(_0x33d39a,0x3,_0x5432('0x6b'),_0x5432('0x6c')+_0x281684[_0x5432('0x6a')]));}else{_0x32fdfc[_0x5432('0x68')](new Extension(_0x33d39a,0x3,'NoOp',_0x5432('0x6d')));}_0x32fdfc[_0x5432('0x68')](new Extension(_0x33d39a,0x4,'goto',_0x5aebe8['context']+','+_0x5432('0x6e')+(0x8+_0x281684['name'][_0x5432('0x3a')])+'}'+','+0x1));return _0x32fdfc;}function formatPrefixName(_0x53318b){var _0x67ff0e='_';for(var _0x5237b1=0x0;_0x5237b1<_0x53318b[_0x5432('0x3a')];_0x5237b1++){if(_0x53318b['charAt'](_0x5237b1)=='-'){_0x67ff0e+=_0x53318b['charAt'](_0x5237b1);}else{_0x67ff0e+='['+_0x53318b[_0x5432('0x6f')](_0x5237b1)+']';}}_0x67ff0e+='.';return _0x67ff0e;}exports[_0x5432('0x25')]=function(_0x22e052,_0x50b478,_0x4c3e6f){var _0x571d27=_0x22e052[_0x5432('0x4e')];_0x571d27[_0x5432('0x61')]=_0x5432('0x70')+_0x571d27['name']+'-';return db['sequelize'][_0x5432('0x71')](function(_0x433a50){return db[_0x5432('0x2f')][_0x5432('0x25')](_0x571d27,{'where':{'id':_0x571d27['id']},'transaction':_0x433a50})[_0x5432('0x26')](function(){return db[_0x5432('0x4f')][_0x5432('0x27')]({'where':{'VoicePrefixId':_0x571d27['id']},'transaction':_0x433a50})[_0x5432('0x26')](function(){return db['VoiceExtension'][_0x5432('0x72')]({'where':{'id':_0x571d27['VoiceExtensionId']},'raw':!![]})[_0x5432('0x26')](function(_0x1d9833){return createVoicePrefixExtensions(_0x571d27,_0x1d9833,_0x433a50);});});});})[_0x5432('0x26')](function(){return db[_0x5432('0x2f')][_0x5432('0x73')](_0x571d27['id']);})[_0x5432('0x26')](respondWithResult(_0x50b478,null))[_0x5432('0x48')](handleError(_0x50b478,null));};exports['addAgents']=function(_0x32a25d,_0x2b199f,_0x585a31){return db[_0x5432('0x2f')]['find']({'where':{'id':_0x32a25d[_0x5432('0x4a')]['id']}})[_0x5432('0x26')](handleEntityNotFound(_0x2b199f,null))[_0x5432('0x26')](function(_0x1da26a){if(_0x1da26a){return _0x1da26a[_0x5432('0x74')](_0x32a25d[_0x5432('0x4e')][_0x5432('0x75')],_[_0x5432('0x76')](_0x32a25d['body'],[_0x5432('0x75'),'id'])||{})[_0x5432('0x77')](function(_0x57f0c5){for(var _0xb2495d=0x0;_0xb2495d<_0x32a25d[_0x5432('0x4e')][_0x5432('0x75')][_0x5432('0x3a')];_0xb2495d+=0x1){socket['emit'](_0x5432('0x78'),{'UserId':Number(_0x32a25d[_0x5432('0x4e')][_0x5432('0x75')][_0xb2495d]),'VoicePrefixId':Number(_0x32a25d[_0x5432('0x4a')]['id'])});}return _0x57f0c5;});}})[_0x5432('0x26')](respondWithResult(_0x2b199f,null))[_0x5432('0x48')](handleError(_0x2b199f,null));};exports['removeAgents']=function(_0x48c72d,_0x5ab0ba,_0x5550ed){return db[_0x5432('0x2f')]['find']({'where':{'id':_0x48c72d[_0x5432('0x4a')]['id']}})[_0x5432('0x26')](handleEntityNotFound(_0x5ab0ba,null))['then'](function(_0x5c0af1){if(_0x5c0af1){return _0x5c0af1['removeAgents'](_0x48c72d['query'][_0x5432('0x75')])[_0x5432('0x26')](function(){if(_['isArray'](_0x48c72d[_0x5432('0x34')][_0x5432('0x75')])){for(var _0x2f7984=0x0;_0x2f7984<_0x48c72d['query'][_0x5432('0x75')][_0x5432('0x3a')];_0x2f7984+=0x1){socket['emit'](_0x5432('0x79'),{'UserId':Number(_0x48c72d['query'][_0x5432('0x75')][_0x2f7984]),'VoicePrefixId':Number(_0x48c72d[_0x5432('0x4a')]['id'])});}}else{socket[_0x5432('0x7a')](_0x5432('0x79'),{'UserId':Number(_0x48c72d[_0x5432('0x34')][_0x5432('0x75')]),'VoicePrefixId':Number(_0x48c72d['params']['id'])});}});}})[_0x5432('0x26')](respondWithStatusCode(_0x5ab0ba,null))[_0x5432('0x48')](handleError(_0x5ab0ba,null));};exports['getAgents']=function(_0x45b0bb,_0x2e4b88,_0x2dd2d8){var _0x247340={};var _0x287302={};var _0x3aad8f;var _0x4ef243;return db[_0x5432('0x2f')]['findOne']({'where':{'id':_0x45b0bb['params']['id']}})['then'](handleEntityNotFound(_0x2e4b88,null))[_0x5432('0x26')](function(_0x4e9aae){if(_0x4e9aae){_0x3aad8f=_0x4e9aae;_0x287302['model']=_[_0x5432('0x35')](db['User'][_0x5432('0x30')]);_0x287302[_0x5432('0x34')]=_[_0x5432('0x35')](_0x45b0bb[_0x5432('0x34')]);_0x287302[_0x5432('0x36')]=_[_0x5432('0x37')](_0x287302[_0x5432('0x33')],_0x287302[_0x5432('0x34')]);_0x247340[_0x5432('0x38')]=_[_0x5432('0x37')](_0x287302[_0x5432('0x33')],qs[_0x5432('0x39')](_0x45b0bb['query'][_0x5432('0x39')]));_0x247340['attributes']=_0x247340[_0x5432('0x38')][_0x5432('0x3a')]?_0x247340[_0x5432('0x38')]:_0x287302['model'];_0x247340[_0x5432('0x3d')]=qs[_0x5432('0x3e')](_0x45b0bb[_0x5432('0x34')][_0x5432('0x3e')]);_0x247340[_0x5432('0x40')]=qs['filters'](_[_0x5432('0x3f')](_0x45b0bb[_0x5432('0x34')],_0x287302[_0x5432('0x36')]));if(_0x45b0bb[_0x5432('0x34')][_0x5432('0x42')]){_0x247340[_0x5432('0x40')]=_[_0x5432('0x41')](_0x247340[_0x5432('0x40')],{'$or':_[_0x5432('0x65')](_0x247340[_0x5432('0x38')],function(_0x70a811){var _0x76baf6={};_0x76baf6[_0x70a811]={'$like':'%'+_0x45b0bb[_0x5432('0x34')][_0x5432('0x42')]+'%'};return _0x76baf6;})});}_0x247340=_['merge']({},_0x247340,_0x45b0bb[_0x5432('0x43')]);return _0x3aad8f['getAgents'](_0x247340);}})[_0x5432('0x26')](function(_0x4a1f88){if(_0x4a1f88){_0x4ef243=_0x4a1f88[_0x5432('0x3a')];if(!_0x45b0bb[_0x5432('0x34')][_0x5432('0x3b')](_0x5432('0x3c'))){_0x247340['limit']=qs[_0x5432('0x21')](_0x45b0bb[_0x5432('0x34')][_0x5432('0x21')]);_0x247340[_0x5432('0x23')]=qs[_0x5432('0x23')](_0x45b0bb[_0x5432('0x34')][_0x5432('0x23')]);}return _0x3aad8f[_0x5432('0x7b')](_0x247340);}})[_0x5432('0x26')](function(_0x57c88d){if(_0x57c88d){return _0x57c88d?{'count':_0x4ef243,'rows':_0x57c88d}:null;}})[_0x5432('0x26')](respondWithResult(_0x2e4b88,null))[_0x5432('0x48')](handleError(_0x2e4b88,null));};exports[_0x5432('0x7c')]=function(_0x123f20,_0x1452e2,_0x7d64ee){var _0x928200={};var _0x5700e0={};var _0x109c7c;var _0x258dbf;return db[_0x5432('0x2f')]['findOne']({'where':{'id':_0x123f20[_0x5432('0x4a')]['id']}})[_0x5432('0x26')](handleEntityNotFound(_0x1452e2,null))[_0x5432('0x26')](function(_0x1e5890){if(_0x1e5890){_0x109c7c=_0x1e5890;_0x5700e0[_0x5432('0x33')]=_[_0x5432('0x35')](db[_0x5432('0x7d')][_0x5432('0x30')]);_0x5700e0[_0x5432('0x34')]=_[_0x5432('0x35')](_0x123f20[_0x5432('0x34')]);_0x5700e0[_0x5432('0x36')]=_[_0x5432('0x37')](_0x5700e0['model'],_0x5700e0[_0x5432('0x34')]);_0x928200[_0x5432('0x38')]=_[_0x5432('0x37')](_0x5700e0['model'],qs[_0x5432('0x39')](_0x123f20['query'][_0x5432('0x39')]));_0x928200[_0x5432('0x38')]=_0x928200[_0x5432('0x38')]['length']?_0x928200[_0x5432('0x38')]:_0x5700e0[_0x5432('0x33')];_0x928200[_0x5432('0x3d')]=qs[_0x5432('0x3e')](_0x123f20[_0x5432('0x34')][_0x5432('0x3e')]);_0x928200['where']=qs['filters'](_[_0x5432('0x3f')](_0x123f20[_0x5432('0x34')],_0x5700e0['filters']));if(_0x123f20['query'][_0x5432('0x42')]){_0x928200['where']=_['merge'](_0x928200[_0x5432('0x40')],{'$or':_[_0x5432('0x65')](_0x928200[_0x5432('0x38')],function(_0x1eeb50){var _0xd8b0ac={};_0xd8b0ac[_0x1eeb50]={'$like':'%'+_0x123f20['query'][_0x5432('0x42')]+'%'};return _0xd8b0ac;})});}_0x928200=_[_0x5432('0x41')]({},_0x928200,_0x123f20[_0x5432('0x43')]);return _0x109c7c[_0x5432('0x7c')](_0x928200);}})[_0x5432('0x26')](function(_0x2c9bc4){if(_0x2c9bc4){_0x258dbf=_0x2c9bc4[_0x5432('0x3a')];if(!_0x123f20[_0x5432('0x34')][_0x5432('0x3b')](_0x5432('0x3c'))){_0x928200[_0x5432('0x21')]=qs[_0x5432('0x21')](_0x123f20[_0x5432('0x34')]['limit']);_0x928200[_0x5432('0x23')]=qs['offset'](_0x123f20[_0x5432('0x34')][_0x5432('0x23')]);}return _0x109c7c[_0x5432('0x7c')](_0x928200);}})[_0x5432('0x26')](function(_0x13705e){if(_0x13705e){return _0x13705e?{'count':_0x258dbf,'rows':_0x13705e}:null;}})[_0x5432('0x26')](respondWithResult(_0x1452e2,null))[_0x5432('0x48')](handleError(_0x1452e2,null));};exports[_0x5432('0x7e')]=function(_0x5705f6,_0x362987,_0x2392e0){var _0x2b788b=_0x5705f6[_0x5432('0x4e')]['ids'];var _0xa5f72b;return db[_0x5432('0x7d')][_0x5432('0x46')]({'where':{'id':_0x2b788b},'attributes':['id'],'include':[{'model':db[_0x5432('0x7f')],'as':_0x5432('0x80'),'attributes':['id',_0x5432('0x2c'),_0x5432('0x81'),'voicePause',_0x5432('0x82')],'raw':!![]}]})[_0x5432('0x26')](function(_0x5da672){if(_0x5da672){_0xa5f72b=_0x5da672;var _0x15596b=_['flatMap'](_0x5da672,function(_0x24aa72){var _0x6f1b4c=_0x24aa72[_0x5432('0x28')]({'plain':!![]});return _0x6f1b4c[_0x5432('0x80')];});return db[_0x5432('0x2f')]['find']({'where':{'id':_0x5705f6[_0x5432('0x4a')]['id']}})['then'](function(_0x57ae36){return db[_0x5432('0x4c')][_0x5432('0x71')](function(_0x4f0aa2){return _0x57ae36[_0x5432('0x7e')](_0x2b788b,{'transaction':_0x4f0aa2})[_0x5432('0x26')](function(){return BPromise[_0x5432('0x83')](_0xa5f72b,function(_0x5c7dc5){return db[_0x5432('0x84')][_0x5432('0x85')]({'TeamId':_0x5c7dc5['id'],'VoicePrefixId':_0x5705f6[_0x5432('0x4a')]['id']},{'transaction':_0x4f0aa2});});})[_0x5432('0x26')](function(){return BPromise[_0x5432('0x83')](_0x15596b,function(_0x121470){return db[_0x5432('0x86')]['findOrCreate']({'where':{'UserId':_0x121470['id'],'VoicePrefixId':_0x5705f6[_0x5432('0x4a')]['id']},'transaction':_0x4f0aa2});});})[_0x5432('0x26')](function(){_0x15596b[_0x5432('0x87')](function(_0x30a9dd){socket['emit']('userVoicePrefix:save',{'UserId':_0x30a9dd['id'],'VoicePrefixId':_0x57ae36['id']});});});});});}})['then'](respondWithStatusCode(_0x362987,null))['catch'](handleError(_0x362987,null));};exports['removeTeams']=function(_0x51c579,_0x4ee5e3,_0x554b3a){return db['Team'][_0x5432('0x46')]({'where':{'id':_0x51c579[_0x5432('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5432('0x7f')],'as':_0x5432('0x80'),'attributes':['id'],'raw':!![]}]})[_0x5432('0x26')](handleEntityNotFound(_0x4ee5e3,null))[_0x5432('0x26')](function(_0x5b3282){var _0x2911cd=_[_0x5432('0x65')](_0x5b3282,'id');var _0x2e6e58=[];var _0x31411e=[];var _0x2f528d=squel['select']();_0x2f528d['field'](_0x5432('0x88'))['from']('team_has_voice_prefixes','tq')[_0x5432('0x89')](_0x5432('0x8a'),'ut',_0x5432('0x8b'))['where'](_0x5432('0x8c'),_0x51c579['params']['id']);for(var _0x7e34f=0x0;_0x7e34f<_0x5b3282[_0x5432('0x3a')];_0x7e34f+=0x1){let _0x55bafc=_0x5b3282[_0x7e34f];for(var _0x159697=0x0;_0x159697<_0x55bafc[_0x5432('0x80')][_0x5432('0x3a')];_0x159697+=0x1){let _0x3806e7=_0x55bafc['Agents'][_0x159697];var _0x1a25ad=_0x2f528d[_0x5432('0x8d')]();_0x1a25ad[_0x5432('0x40')](_0x5432('0x8e'),_0x3806e7['id']);_0x31411e[_0x5432('0x68')](db[_0x5432('0x4c')][_0x5432('0x34')](_0x1a25ad[_0x5432('0x8f')](),{'type':db[_0x5432('0x4c')][_0x5432('0x90')][_0x5432('0x91')]})['then'](function(_0x5c2521){if(_0x5c2521[_0x5432('0x3a')]===0x1){return _0x3806e7['id'];}else{var _0x4a0122=_[_0x5432('0x92')](_[_0x5432('0x65')](_0x5c2521,_0x5432('0x93')),function(_0x1d294d){return _[_0x5432('0x94')](_0x2911cd,_0x1d294d);});if(_0x4a0122){return _0x3806e7['id'];}}}));}}return BPromise['all'](_0x31411e)['then'](function(_0x5c0b87){_0x2e6e58=_(_0x2e6e58)[_0x5432('0x95')](_0x5c0b87)[_0x5432('0x96')]()[_0x5432('0x97')]();return db['VoicePrefix'][_0x5432('0x72')]({'where':{'id':_0x51c579[_0x5432('0x4a')]['id']}})[_0x5432('0x26')](function(_0x54284e){return db[_0x5432('0x4c')][_0x5432('0x71')](function(_0x20a20d){return _0x54284e[_0x5432('0x98')](_0x51c579['query']['ids'],{'transaction':_0x20a20d})[_0x5432('0x26')](function(){if(!_[_0x5432('0x99')](_0x2e6e58)){return _0x54284e[_0x5432('0x9a')](_0x2e6e58,{'transaction':_0x20a20d});}})[_0x5432('0x26')](function(){_0x2e6e58['forEach'](function(_0xbdbc76){socket[_0x5432('0x7a')](_0x5432('0x79'),{'UserId':_0xbdbc76,'VoicePrefixId':_0x54284e['id']});});});});});});})['then'](respondWithStatusCode(_0x4ee5e3,null))[_0x5432('0x48')](handleError(_0x4ee5e3,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 6ff4cec..6f1804a 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 _0x1f38=['save','update','remove','emit','hook','exports','events','VoicePrefix','setMaxListeners'];(function(_0x2e58c7,_0x23d092){var _0x26eb00=function(_0x343124){while(--_0x343124){_0x2e58c7['push'](_0x2e58c7['shift']());}};_0x26eb00(++_0x23d092);}(_0x1f38,0x1da));var _0x81f3=function(_0x24431a,_0x52459a){_0x24431a=_0x24431a-0x0;var _0x454ec7=_0x1f38[_0x24431a];return _0x454ec7;};'use strict';var EventEmitter=require(_0x81f3('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x81f3('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x81f3('0x2')](0x0);var events={'afterCreate':_0x81f3('0x3'),'afterUpdate':_0x81f3('0x4'),'afterDestroy':_0x81f3('0x5')};function emitEvent(_0x307968){return function(_0x172bd0,_0xd2467,_0x1ed534){VoicePrefixEvents[_0x81f3('0x6')](_0x307968+':'+_0x172bd0['id'],_0x172bd0);VoicePrefixEvents[_0x81f3('0x6')](_0x307968,_0x172bd0);_0x1ed534(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x81f3('0x7')](e,emitEvent(event));}}module[_0x81f3('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x9929=['hook','exports','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9929,0x7a));var _0x9992=function(_0x2a045c,_0x1d84a6){_0x2a045c=_0x2a045c-0x0;var _0x287d26=_0x9929[_0x2a045c];return _0x287d26;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x9992('0x0'))['db'][_0x9992('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9992('0x2')](0x0);var events={'afterCreate':_0x9992('0x3'),'afterUpdate':_0x9992('0x4'),'afterDestroy':_0x9992('0x5')};function emitEvent(_0x204ad1){return function(_0x4d64ad,_0x3b856e,_0x5e2b7d){VoicePrefixEvents[_0x9992('0x6')](_0x204ad1+':'+_0x4d64ad['id'],_0x4d64ad);VoicePrefixEvents[_0x9992('0x6')](_0x204ad1,_0x4d64ad);_0x5e2b7d(null);};}for(var e in events){if(events[_0x9992('0x7')](e)){var event=events[e];VoicePrefix[_0x9992('0x8')](e,emitEvent(event));}}module[_0x9992('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index b945589..25407c4 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 _0x5bd5=['./voicePrefix.attributes','exports','define','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x3ae61a,_0x43c852){var _0x3731e0=function(_0x169353){while(--_0x169353){_0x3ae61a['push'](_0x3ae61a['shift']());}};_0x3731e0(++_0x43c852);}(_0x5bd5,0xf3));var _0x55bd=function(_0x5465e6,_0x2a8809){_0x5465e6=_0x5465e6-0x0;var _0x10044e=_0x5bd5[_0x5465e6];return _0x10044e;};'use strict';var _=require('lodash');var util=require(_0x55bd('0x0'));var logger=require(_0x55bd('0x1'))(_0x55bd('0x2'));var moment=require('moment');var BPromise=require(_0x55bd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x55bd('0x4'));var rimraf=require(_0x55bd('0x5'));var config=require(_0x55bd('0x6'));var attributes=require(_0x55bd('0x7'));module[_0x55bd('0x8')]=function(_0x18edff,_0x3646d2){return _0x18edff[_0x55bd('0x9')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x400e=['voice_prefixes','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0x400e,0x1bb));var _0xe400=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0x400e[_0x40dd56];return _0x4f850f;};'use strict';var _=require(_0xe400('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe400('0x1'));var moment=require(_0xe400('0x2'));var BPromise=require(_0xe400('0x3'));var rp=require(_0xe400('0x4'));var fs=require('fs');var path=require(_0xe400('0x5'));var rimraf=require(_0xe400('0x6'));var config=require(_0xe400('0x7'));var attributes=require(_0xe400('0x8'));module[_0xe400('0x9')]=function(_0x388254,_0x37d1eb){return _0x388254[_0xe400('0xa')](_0xe400('0xb'),attributes,{'tableName':_0xe400('0xc'),'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 9e63719..24b38fa 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 _0xf562=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x54d26a,_0x504173){var _0x44d7eb=function(_0x5afcdc){while(--_0x5afcdc){_0x54d26a['push'](_0x54d26a['shift']());}};_0x44d7eb(++_0x504173);}(_0xf562,0x100));var _0x2f56=function(_0xf40864,_0x1b76e3){_0xf40864=_0xf40864-0x0;var _0x33f47e=_0xf562[_0xf40864];return _0x33f47e;};'use strict';var _=require(_0x2f56('0x0'));var util=require(_0x2f56('0x1'));var moment=require(_0x2f56('0x2'));var BPromise=require(_0x2f56('0x3'));var rs=require(_0x2f56('0x4'));var fs=require('fs');var Redis=require(_0x2f56('0x5'));var db=require(_0x2f56('0x6'))['db'];var utils=require(_0x2f56('0x7'));var logger=require(_0x2f56('0x8'))('rpc');var config=require(_0x2f56('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2f56('0xa')]['http']({'port':0x232a});config[_0x2f56('0xb')]=_[_0x2f56('0xc')](config[_0x2f56('0xb')],{'host':_0x2f56('0xd'),'port':0x18eb});var socket=require(_0x2f56('0xe'))(new Redis(config[_0x2f56('0xb')]));require(_0x2f56('0xf'))[_0x2f56('0x10')](socket);function respondWithRpcPromise(_0x926a86,_0x5eeaa7,_0x30a106){return new BPromise(function(_0x39572f,_0x52d3d2){return client[_0x2f56('0x11')](_0x926a86,_0x30a106)[_0x2f56('0x12')](function(_0x575f1e){logger[_0x2f56('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x5eeaa7,_0x2f56('0x14'));logger['debug'](_0x2f56('0x15'),_0x5eeaa7,_0x2f56('0x14'),JSON[_0x2f56('0x16')](_0x575f1e));if(_0x575f1e[_0x2f56('0x17')]){if(_0x575f1e[_0x2f56('0x17')][_0x2f56('0x18')]===0x1f4){logger[_0x2f56('0x17')](_0x2f56('0x19'),_0x5eeaa7,_0x575f1e['error'][_0x2f56('0x1a')]);return _0x52d3d2(_0x575f1e[_0x2f56('0x17')][_0x2f56('0x1a')]);}logger[_0x2f56('0x17')](_0x2f56('0x19'),_0x5eeaa7,_0x575f1e['error'][_0x2f56('0x1a')]);return _0x39572f(_0x575f1e[_0x2f56('0x17')][_0x2f56('0x1a')]);}else{logger[_0x2f56('0x13')](_0x2f56('0x19'),_0x5eeaa7,'request\x20sent');_0x39572f(_0x575f1e[_0x2f56('0x1b')][_0x2f56('0x1a')]);}})[_0x2f56('0x1c')](function(_0x4651d9){logger[_0x2f56('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x5eeaa7,_0x4651d9);_0x52d3d2(_0x4651d9);});});} \ No newline at end of file +var _0x1115=['http','defaults','redis','socket.io-emitter','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x109596,_0x2158c7){var _0x47a67a=function(_0x515767){while(--_0x515767){_0x109596['push'](_0x109596['shift']());}};_0x47a67a(++_0x2158c7);}(_0x1115,0x1b6));var _0x5111=function(_0x2ea966,_0x520f11){_0x2ea966=_0x2ea966-0x0;var _0x2099d2=_0x1115[_0x2ea966];return _0x2099d2;};'use strict';var _=require('lodash');var util=require(_0x5111('0x0'));var moment=require(_0x5111('0x1'));var BPromise=require(_0x5111('0x2'));var rs=require(_0x5111('0x3'));var fs=require('fs');var Redis=require(_0x5111('0x4'));var db=require(_0x5111('0x5'))['db'];var utils=require(_0x5111('0x6'));var logger=require(_0x5111('0x7'))(_0x5111('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5111('0x9')][_0x5111('0xa')]({'port':0x232a});config['redis']=_[_0x5111('0xb')](config[_0x5111('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5111('0xd'))(new Redis(config['redis']));require(_0x5111('0xe'))[_0x5111('0xf')](socket);function respondWithRpcPromise(_0x4ecb50,_0x5e12a7,_0x347d87){return new BPromise(function(_0x5a826a,_0x162624){return client['request'](_0x4ecb50,_0x347d87)[_0x5111('0x10')](function(_0x532984){logger[_0x5111('0x11')](_0x5111('0x12'),_0x5e12a7,_0x5111('0x13'));logger[_0x5111('0x14')](_0x5111('0x15'),_0x5e12a7,_0x5111('0x13'),JSON[_0x5111('0x16')](_0x532984));if(_0x532984[_0x5111('0x17')]){if(_0x532984[_0x5111('0x17')][_0x5111('0x18')]===0x1f4){logger[_0x5111('0x17')](_0x5111('0x12'),_0x5e12a7,_0x532984[_0x5111('0x17')][_0x5111('0x19')]);return _0x162624(_0x532984[_0x5111('0x17')][_0x5111('0x19')]);}logger['error'](_0x5111('0x12'),_0x5e12a7,_0x532984['error']['message']);return _0x5a826a(_0x532984[_0x5111('0x17')][_0x5111('0x19')]);}else{logger[_0x5111('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x5e12a7,_0x5111('0x13'));_0x5a826a(_0x532984[_0x5111('0x1a')]['message']);}})[_0x5111('0x1b')](function(_0x10110b){logger[_0x5111('0x17')](_0x5111('0x12'),_0x5e12a7,_0x10110b);_0x162624(_0x10110b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 9492a6e..a84248e 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 _0xdb76=['remove','update','emit','register','length','voicePrefix:','./voicePrefix.events','save'];(function(_0x20d07e,_0x5010dd){var _0x21bfc5=function(_0x58cb97){while(--_0x58cb97){_0x20d07e['push'](_0x20d07e['shift']());}};_0x21bfc5(++_0x5010dd);}(_0xdb76,0x1be));var _0x6db7=function(_0xa59ca7,_0x584906){_0xa59ca7=_0xa59ca7-0x0;var _0x5029c4=_0xdb76[_0xa59ca7];return _0x5029c4;};'use strict';var VoicePrefixEvents=require(_0x6db7('0x0'));var events=[_0x6db7('0x1'),_0x6db7('0x2'),_0x6db7('0x3')];function createListener(_0x27d5fd,_0x4fee62){return function(_0x448591){_0x4fee62[_0x6db7('0x4')](_0x27d5fd,_0x448591);};}function removeListener(_0x3e17d8,_0x40f6ce){return function(){VoicePrefixEvents['removeListener'](_0x3e17d8,_0x40f6ce);};}exports[_0x6db7('0x5')]=function(_0x7bba2d){for(var _0x8a8fe2=0x0,_0x417e71=events[_0x6db7('0x6')];_0x8a8fe2<_0x417e71;_0x8a8fe2++){var _0x58f6e4=events[_0x8a8fe2];var _0x1c7f92=createListener(_0x6db7('0x7')+_0x58f6e4,_0x7bba2d);VoicePrefixEvents['on'](_0x58f6e4,_0x1c7f92);}}; \ No newline at end of file +var _0x9e5e=['removeListener','voicePrefix:','./voicePrefix.events','save','update','emit'];(function(_0x4c362c,_0x1a3821){var _0xe7c400=function(_0x34f224){while(--_0x34f224){_0x4c362c['push'](_0x4c362c['shift']());}};_0xe7c400(++_0x1a3821);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x9e5e[_0x47fd36];return _0x21a0fc;};'use strict';var VoicePrefixEvents=require(_0xe9e5('0x0'));var events=[_0xe9e5('0x1'),'remove',_0xe9e5('0x2')];function createListener(_0x1d631c,_0x41408c){return function(_0x4c9784){_0x41408c[_0xe9e5('0x3')](_0x1d631c,_0x4c9784);};}function removeListener(_0x5c29f3,_0x396715){return function(){VoicePrefixEvents[_0xe9e5('0x4')](_0x5c29f3,_0x396715);};}exports['register']=function(_0x5c09f0){for(var _0xf4d974=0x0,_0x2333df=events['length'];_0xf4d974<_0x2333df;_0xf4d974++){var _0x3648a5=events[_0xf4d974];var _0x2533d8=createListener(_0xe9e5('0x5')+_0x3648a5,_0x5c09f0);VoicePrefixEvents['on'](_0x3648a5,_0x2533d8);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 4daf6d0..9fa9f28 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x15a6a1,_0x4d795b){var _0x574bee=function(_0x38b7ba){while(--_0x38b7ba){_0x15a6a1['push'](_0x15a6a1['shift']());}};_0x574bee(++_0x4d795b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x12ac45,_0xeb2f08){var _0x72a550=function(_0xe8be35){while(--_0xe8be35){_0x12ac45['push'](_0x12ac45['shift']());}};_0x72a550(++_0xeb2f08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 e29f826..cc02260 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 _0xf161=['name','inbound','outbound','STRING','default','ENUM','leastrecent','random','rrmemory','linear','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\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)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports'];(function(_0x253ceb,_0x2acbb6){var _0x5acfb9=function(_0x46fbc5){while(--_0x46fbc5){_0x253ceb['push'](_0x253ceb['shift']());}};_0x5acfb9(++_0x2acbb6);}(_0xf161,0xa2));var _0x1f16=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xf161[_0x1b4b23];return _0x2a325b;};'use strict';var Sequelize=require(_0x1f16('0x0'));module[_0x1f16('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1f16('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x1f16('0x3'),_0x1f16('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':_0x1f16('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x1f16('0x7')]('rr','ringall',_0x1f16('0x8'),'fewestcalls',_0x1f16('0x9'),_0x1f16('0xa'),_0x1f16('0xb'),'wrandom','rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x4e82f5){this[_0x1f16('0xc')](_0x1f16('0xd'),_0x4e82f5?_0x4e82f5:'rrmemory');},'get':function(){var _0x512ef2=this[_0x1f16('0xe')](_0x1f16('0xf'));var _0x49b284=this[_0x1f16('0xe')](_0x1f16('0x10'));var _0x436620=this[_0x1f16('0xe')]('strategy');if(_0x512ef2===_0x1f16('0x3')){return _0x436620;}if(_0x49b284===_0x1f16('0x11')&&_0x436620===_0x1f16('0xa')||_0x49b284==='booked'&&_0x436620===_0x1f16('0x12')){return _0x436620;}if(_0x49b284===_0x1f16('0x13')||_0x49b284===_0x1f16('0x14')||_0x49b284==='power'){return _0x436620;}return null;}},'servicelevel':{'type':Sequelize[_0x1f16('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1f16('0x15')](0xb)},'timeout':{'type':Sequelize[_0x1f16('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x1f16('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1f16('0x5')]},'weight':{'type':Sequelize[_0x1f16('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x1f16('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1f16('0x7')](_0x1f16('0x16'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0x1f16('0x16'),'no',_0x1f16('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x1f16('0x7')](_0x1f16('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x1f16('0x7')](_0x1f16('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x1f16('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x1f16('0x7')](_0x1f16('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x1f16('0x7')](_0x1f16('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x1f16('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x1f16('0x7')](_0x1f16('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x1f16('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x1f16('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x1f16('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x1f16('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x1f16('0x7')](_0x1f16('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x1f16('0x7')](_0x1f16('0x16'),'no'),'defaultValue':_0x1f16('0x16')},'announce_holdtime':{'type':Sequelize[_0x1f16('0x7')]('yes','no',_0x1f16('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x1f16('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x1f16('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x1f16('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x1f16('0x5')]},'queue_youarenext':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x1f16('0x5')]},'queue_quantity1':{'type':Sequelize[_0x1f16('0x5')]},'queue_quantity2':{'type':Sequelize[_0x1f16('0x5')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x535d0e){this[_0x1f16('0xc')](_0x1f16('0x19'),_0x535d0e?_0x535d0e[_0x1f16('0x1a')](','):[]);},'get':function(){return this[_0x1f16('0xe')](_0x1f16('0x19'))?this[_0x1f16('0xe')]('periodic_announce')[_0x1f16('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':_0x1f16('0x16'),'set':function(_0x3d8c34){this[_0x1f16('0xc')](_0x1f16('0x1c'),_0x3d8c34?_0x3d8c34[_0x1f16('0x1a')](','):undefined);},'get':function(){return this[_0x1f16('0xe')](_0x1f16('0x1c'))?this[_0x1f16('0xe')](_0x1f16('0x1c'))[_0x1f16('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':'no','set':function(_0x3f983f){this[_0x1f16('0xc')](_0x1f16('0x1d'),_0x3f983f?_0x3f983f[_0x1f16('0x1a')](','):undefined);},'get':function(){return this[_0x1f16('0xe')]('leavewhenempty')?this[_0x1f16('0xe')]('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x1f16('0x7')](_0x1f16('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x1f16('0x7')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x1f16('0x7')](_0x1f16('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1f16('0x5')]},'acw':{'type':Sequelize[_0x1f16('0x1e')],'defaultValue':0x0,'set':function(_0xe9e658){this['setDataValue'](_0x1f16('0x1f'),_0xe9e658);if(_0xe9e658){if(this['getDataValue'](_0x1f16('0x20'))<0x2){this[_0x1f16('0xc')](_0x1f16('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x1f16('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x1f16('0x1e')],'defaultValue':0x0,'comment':_0x1f16('0x21')},'dialMethod':{'type':Sequelize[_0x1f16('0x7')]('preview',_0x1f16('0x13'),'power',_0x1f16('0x14'),'booked'),'defaultValue':_0x1f16('0x13'),'comment':_0x1f16('0x22')},'dialLimitChannel':{'type':Sequelize[_0x1f16('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1f16('0x23')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x1f16('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1f16('0x25')},'dialPowerLevel':{'type':Sequelize[_0x1f16('0x26')](0x2)[_0x1f16('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x1f16('0x27')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x1f16('0x28')),'defaultValue':'dropRate','comment':_0x1f16('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x1f16('0x26')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x1f16('0x15')](0x3)[_0x1f16('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x1f16('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1f16('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1f16('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x1f16('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x2b')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x1f16('0x2c'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x1f16('0x15')](0x3)[_0x1f16('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x2d')},'dialQueueProject':{'type':Sequelize[_0x1f16('0x5')],'comment':_0x1f16('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1f16('0x15')](0x3)[_0x1f16('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0x2f')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1f16('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1f16('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1f16('0x24')],'defaultValue':0x3,'comment':_0x1f16('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1f16('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1f16('0x15')](0x3)[_0x1f16('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1f16('0x34')},'dialTimezone':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x1f16('0x35')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x1f16('0x7')]('always',_0x1f16('0x36'),_0x1f16('0x37')),'defaultValue':_0x1f16('0x38')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x1f16('0x15')](0x9)[_0x1f16('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1f16('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x1f16('0x15')](0x9)[_0x1f16('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1f16('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1f16('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1f16('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1f16('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x1f16('0x15')](0x9)[_0x1f16('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1f16('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1f16('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1f16('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1f16('0x15')](0x9)[_0x1f16('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1f16('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1f16('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1f16('0x3f')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x1f16('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x1f16('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x1f16('0x7')]('DESC',_0x1f16('0x41')),'defaultValue':_0x1f16('0x42')},'dialQueueProject2':{'type':Sequelize[_0x1f16('0x5')],'comment':_0x1f16('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x1f16('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x1f16('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1f16('0x15')](0x3)[_0x1f16('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1f16('0x43')},'dialCutDigit':{'type':Sequelize[_0x1f16('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1f16('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1f16('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1f16('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x1f16('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x1f16('0x15')](0x5)[_0x1f16('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1f16('0x15')](0x3)[_0x1f16('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1f16('0x15')](0x5)[_0x1f16('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x1f16('0x15')](0x3)[_0x1f16('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1f16('0x15')](0x5)[_0x1f16('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1f16('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1f16('0x15')](0x5)[_0x1f16('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1f16('0x15')],'allowNull':!![],'comment':_0x1f16('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0x1f16('0x1e')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x57f461){if(!_0x57f461)this[_0x1f16('0xc')](_0x1f16('0x50'),null);this['setDataValue'](_0x1f16('0x51'),_0x57f461);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x1f16('0x15')](0x3)[_0x1f16('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x1f16('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x1f16('0x1e')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x1f16('0x1e')],'defaultValue':![]}}; \ No newline at end of file +var _0x93cc=['getDataValue','dialMethod','booked','progressive','power','INTEGER','yes','all','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','predictive','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','ENUM','inbound','outbound','STRING','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','strategy','type'];(function(_0x35e352,_0x1681b5){var _0xc155c7=function(_0x2a94f5){while(--_0x2a94f5){_0x35e352['push'](_0x35e352['shift']());}};_0xc155c7(++_0x1681b5);}(_0x93cc,0x90));var _0xc93c=function(_0x26a88f,_0x144ea7){_0x26a88f=_0x26a88f-0x0;var _0x7cadce=_0x93cc[_0x26a88f];return _0x7cadce;};'use strict';var Sequelize=require(_0xc93c('0x0'));module[_0xc93c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc93c('0x2')](_0xc93c('0x3'),_0xc93c('0x4')),'allowNull':![],'defaultValue':_0xc93c('0x3')},'musiconhold':{'type':Sequelize[_0xc93c('0x5')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xc93c('0x6'),_0xc93c('0x7'),_0xc93c('0x8'),_0xc93c('0x9'),_0xc93c('0xa'),_0xc93c('0xb'),_0xc93c('0xc'),_0xc93c('0xd')),'allowNull':![],'defaultValue':_0xc93c('0x6'),'set':function(_0x5ba066){this['setDataValue'](_0xc93c('0xe'),_0x5ba066?_0x5ba066:_0xc93c('0xa'));},'get':function(){var _0x50c667=this['getDataValue'](_0xc93c('0xf'));var _0x356465=this[_0xc93c('0x10')](_0xc93c('0x11'));var _0x4cd9bf=this['getDataValue'](_0xc93c('0xe'));if(_0x50c667===_0xc93c('0x3')){return _0x4cd9bf;}if(_0x356465===_0xc93c('0x12')&&_0x4cd9bf==='rrmemory'||_0x356465===_0xc93c('0x12')&&_0x4cd9bf==='roundrobin'){return _0x4cd9bf;}if(_0x356465===_0xc93c('0x13')||_0x356465==='predictive'||_0x356465===_0xc93c('0x14')){return _0x4cd9bf;}return null;}},'servicelevel':{'type':Sequelize[_0xc93c('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xc93c('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xc93c('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xc93c('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xc93c('0x5')]},'weight':{'type':Sequelize[_0xc93c('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xc93c('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xc93c('0x2')](_0xc93c('0x16'),'no'),'defaultValue':_0xc93c('0x16')},'autopause':{'type':Sequelize[_0xc93c('0x2')](_0xc93c('0x16'),'no',_0xc93c('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xc93c('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0xc93c('0x2')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xc93c('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xc93c('0x2')](_0xc93c('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xc93c('0x2')](_0xc93c('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xc93c('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xc93c('0x2')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xc93c('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xc93c('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xc93c('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xc93c('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xc93c('0x2')](_0xc93c('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xc93c('0x2')](_0xc93c('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xc93c('0x2')](_0xc93c('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xc93c('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xc93c('0x16'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xc93c('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xc93c('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xc93c('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xc93c('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xc93c('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xc93c('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xc93c('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xc93c('0x5')]},'queue_quantity1':{'type':Sequelize[_0xc93c('0x5')]},'queue_quantity2':{'type':Sequelize[_0xc93c('0x5')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xc93c('0x5')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x59dc3c){this[_0xc93c('0x18')](_0xc93c('0x19'),_0x59dc3c?_0x59dc3c[_0xc93c('0x1a')](','):[]);},'get':function(){return this[_0xc93c('0x10')](_0xc93c('0x19'))?this['getDataValue']('periodic_announce')[_0xc93c('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xc93c('0x16'),'set':function(_0x1692a0){this['setDataValue'](_0xc93c('0x1c'),_0x1692a0?_0x1692a0[_0xc93c('0x1a')](','):undefined);},'get':function(){return this[_0xc93c('0x10')](_0xc93c('0x1c'))?this[_0xc93c('0x10')](_0xc93c('0x1c'))[_0xc93c('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xc93c('0x5')],'defaultValue':'no','set':function(_0x355226){this[_0xc93c('0x18')]('leavewhenempty',_0x355226?_0x355226[_0xc93c('0x1a')](','):undefined);},'get':function(){return this[_0xc93c('0x10')](_0xc93c('0x1d'))?this[_0xc93c('0x10')](_0xc93c('0x1d'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xc93c('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xc93c('0x2')](_0xc93c('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xc93c('0x2')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xc93c('0x5')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xc93c('0x1e')],'defaultValue':0x0,'set':function(_0x4c37e5){this['setDataValue'](_0xc93c('0x1f'),_0x4c37e5);if(_0x4c37e5){if(this['getDataValue'](_0xc93c('0x20'))<0x2){this[_0xc93c('0x18')](_0xc93c('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xc93c('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xc93c('0x1e')],'defaultValue':0x0,'comment':_0xc93c('0x21')},'dialMethod':{'type':Sequelize['ENUM'](_0xc93c('0x22'),_0xc93c('0x13'),'power',_0xc93c('0x23'),'booked'),'defaultValue':_0xc93c('0x13'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xc93c('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xc93c('0x15')](0x4)[_0xc93c('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xc93c('0x25')},'dialPowerLevel':{'type':Sequelize[_0xc93c('0x26')](0x2)[_0xc93c('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xc93c('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0xc93c('0x2')](_0xc93c('0x28'),_0xc93c('0x29')),'defaultValue':_0xc93c('0x29'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xc93c('0x26')](0x2)[_0xc93c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xc93c('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0xc93c('0x15')](0x3)[_0xc93c('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xc93c('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xc93c('0x15')](0x3)[_0xc93c('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xc93c('0x5')],'defaultValue':_0xc93c('0x2b'),'comment':_0xc93c('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0xc93c('0x15')](0x3)[_0xc93c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc93c('0x2d')},'dialQueueProject':{'type':Sequelize[_0xc93c('0x5')],'comment':_0xc93c('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc93c('0x15')](0x3)[_0xc93c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc93c('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc93c('0x15')](0x5)[_0xc93c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc93c('0x30')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc93c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc93c('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc93c('0x15')](0x5)[_0xc93c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc93c('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc93c('0x15')](0x3)[_0xc93c('0x24')],'defaultValue':0x3,'comment':_0xc93c('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc93c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc93c('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc93c('0x15')](0x3)[_0xc93c('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xc93c('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc93c('0x5')],'defaultValue':_0xc93c('0x35')},'dialPrefix':{'type':Sequelize[_0xc93c('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xc93c('0x2')](_0xc93c('0x36'),_0xc93c('0x37'),_0xc93c('0x38')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xc93c('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xc93c('0x15')](0x9)[_0xc93c('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xc93c('0x15')](0x9)[_0xc93c('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc93c('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc93c('0x15')](0x9)[_0xc93c('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc93c('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc93c('0x15')](0x9)[_0xc93c('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc93c('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0xc93c('0x15')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc93c('0x15')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc93c('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc93c('0x15')](0x9)[_0xc93c('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc93c('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc93c('0x15')](0x5)[_0xc93c('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc93c('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc93c('0x15')](0x9)[_0xc93c('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xc93c('0x15')](0x5)[_0xc93c('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xc93c('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0xc93c('0x1e')],'defaultValue':0x0,'comment':_0xc93c('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc93c('0x2')]('DESC',_0xc93c('0x41')),'defaultValue':_0xc93c('0x42')},'dialQueueProject2':{'type':Sequelize[_0xc93c('0x5')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xc93c('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xc93c('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc93c('0x15')](0x3)[_0xc93c('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc93c('0x43')},'dialCutDigit':{'type':Sequelize[_0xc93c('0x15')](0x3)[_0xc93c('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc93c('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc93c('0x15')](0x3)[_0xc93c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc93c('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc93c('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc93c('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0xc93c('0x15')](0x3)[_0xc93c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xc93c('0x15')](0x5)[_0xc93c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc93c('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc93c('0x15')](0x3)[_0xc93c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc93c('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc93c('0x15')](0x5)[_0xc93c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc93c('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0xc93c('0x15')](0x3)[_0xc93c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc93c('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc93c('0x15')](0x5)[_0xc93c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc93c('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc93c('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc93c('0x15')](0x5)[_0xc93c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc93c('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc93c('0x15')],'allowNull':!![],'comment':_0xc93c('0x4d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc93c('0x4e'),'set':function(_0x3aa1ff){if(!_0x3aa1ff)this[_0xc93c('0x18')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xc93c('0x4f'),_0x3aa1ff);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xc93c('0x15')](0x3)[_0xc93c('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xc93c('0x15')](0x3)[_0xc93c('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xc93c('0x1e')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xc93c('0x1e')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 9d3d997..9c41867 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 _0xd846=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','includes','type','UserProfileResource','then','error','name','index','VoiceQueue','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','show','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','body','update','getHoppers','CmHopper','nolimit','order','VoiceQueueId','findAll','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','Agents','voicePause','interface','flatMap','forEach','penalty','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','emit','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','all','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','online','push','UserVoiceQueueRt','isNil','format','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ListId','updatedAt','NOW()','ContactId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xd846,0xa2));var _0x6d84=function(_0x441113,_0x1dd51d){_0x441113=_0x441113-0x0;var _0x57eb33=_0xd846[_0x441113];return _0x57eb33;};'use strict';var emlformat=require(_0x6d84('0x0'));var rimraf=require(_0x6d84('0x1'));var zipdir=require(_0x6d84('0x2'));var jsonpatch=require(_0x6d84('0x3'));var rp=require(_0x6d84('0x4'));var moment=require(_0x6d84('0x5'));var BPromise=require(_0x6d84('0x6'));var Mustache=require(_0x6d84('0x7'));var util=require(_0x6d84('0x8'));var path=require('path');var sox=require(_0x6d84('0x9'));var csv=require(_0x6d84('0xa'));var ejs=require(_0x6d84('0xb'));var fs=require('fs');var fs_extra=require(_0x6d84('0xc'));var _=require(_0x6d84('0xd'));var squel=require('squel');var crypto=require(_0x6d84('0xe'));var jsforce=require(_0x6d84('0xf'));var deskjs=require(_0x6d84('0x10'));var toCsv=require(_0x6d84('0xa'));var querystring=require('querystring');var Papa=require(_0x6d84('0x11'));var Redis=require(_0x6d84('0x12'));var authService=require(_0x6d84('0x13'));var qs=require(_0x6d84('0x14'));var as=require(_0x6d84('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6d84('0x16'));var utils=require('../../config/utils');var config=require(_0x6d84('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d84('0x18'))['db'];config[_0x6d84('0x19')]=_[_0x6d84('0x1a')](config['redis'],{'host':_0x6d84('0x1b'),'port':0x18eb});var socket=require(_0x6d84('0x1c'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x6d84('0x1d')](socket);function respondWithStatusCode(_0x15fdb6,_0x5aeda4){_0x5aeda4=_0x5aeda4||0xcc;return function(_0x27d237){if(_0x27d237){return _0x15fdb6[_0x6d84('0x1e')](_0x5aeda4);}return _0x15fdb6[_0x6d84('0x1f')](_0x5aeda4)[_0x6d84('0x20')]();};}function respondWithResult(_0x20c44d,_0x1e4b49){_0x1e4b49=_0x1e4b49||0xc8;return function(_0x55c091){if(_0x55c091){return _0x20c44d[_0x6d84('0x1f')](_0x1e4b49)[_0x6d84('0x21')](_0x55c091);}};}function respondWithFilteredResult(_0x1a9668,_0x4e3fa1){return function(_0x312ceb){if(_0x312ceb){var _0x49dfc7=typeof _0x4e3fa1[_0x6d84('0x22')]===_0x6d84('0x23')&&typeof _0x4e3fa1[_0x6d84('0x24')]===_0x6d84('0x23');var _0x13fcbd=_0x312ceb['count'];var _0x5de56e=_0x49dfc7?0x0:_0x4e3fa1[_0x6d84('0x22')];var _0x30f1d0=_0x49dfc7?_0x312ceb[_0x6d84('0x25')]:_0x4e3fa1[_0x6d84('0x22')]+_0x4e3fa1[_0x6d84('0x24')];var _0x18b624;if(_0x30f1d0>=_0x13fcbd){_0x30f1d0=_0x13fcbd;_0x18b624=0xc8;}else{_0x18b624=0xce;}_0x1a9668[_0x6d84('0x1f')](_0x18b624);return _0x1a9668['set'](_0x6d84('0x26'),_0x5de56e+'-'+_0x30f1d0+'/'+_0x13fcbd)[_0x6d84('0x21')](_0x312ceb);}return null;};}function patchUpdates(_0x53d206){return function(_0x5f318f){try{jsonpatch['apply'](_0x5f318f,_0x53d206,!![]);}catch(_0x5deece){return BPromise['reject'](_0x5deece);}return _0x5f318f['save']();};}function saveUpdates(_0x48791c,_0x39a52f){return function(_0x371cc3){if(_0x371cc3){return _0x371cc3['update'](_0x48791c)['then'](function(_0x1b7186){return _0x1b7186;});}return null;};}function removeEntity(_0x41ca04,_0x59b9af){return function(_0xa44684){if(_0xa44684){return _0xa44684[_0x6d84('0x27')]()['then'](function(){var _0x55fa31=_0xa44684[_0x6d84('0x28')]({'plain':!![]});var _0x4134d5=[{'name':_0x6d84('0x29'),'value':_0x6d84('0x2a'),'ignore':![]},{'name':_0x6d84('0x2b'),'value':_0x6d84('0x2c'),'ignore':![]}];var _0x5a2b75=_(_0x4134d5)[_0x6d84('0x2d')]('ignore')[_0x6d84('0x2e')](_0x6d84('0x2f'))[_0x6d84('0x2f')]();if(_[_0x6d84('0x30')](_0x5a2b75,_0x55fa31[_0x6d84('0x31')])){return;}var _0x2f335d=_['find'](_0x4134d5,['value',_0x55fa31[_0x6d84('0x31')]])['name'];return db[_0x6d84('0x32')][_0x6d84('0x27')]({'where':{'type':_0x2f335d,'resourceId':_0x55fa31['id']}})[_0x6d84('0x33')](function(){return _0xa44684;});})['then'](function(){_0x41ca04[_0x6d84('0x1f')](0xcc)[_0x6d84('0x20')]();});}};}function handleEntityNotFound(_0xaa2466,_0x4962dd){return function(_0x54c33e){if(!_0x54c33e){_0xaa2466[_0x6d84('0x1e')](0x194);}return _0x54c33e;};}function handleError(_0x3d4bc1,_0x1d1d2c){_0x1d1d2c=_0x1d1d2c||0x1f4;return function(_0x358443){logger[_0x6d84('0x34')](_0x358443['stack']);if(_0x358443[_0x6d84('0x35')]){delete _0x358443['name'];}_0x3d4bc1[_0x6d84('0x1f')](_0x1d1d2c)['send'](_0x358443);};}exports[_0x6d84('0x36')]=function(_0x420f46,_0x20ca2c){var _0xa33d1a={},_0x3dc206={},_0x11f7b2={'count':0x0,'rows':[]};var _0x2ea5a2=_[_0x6d84('0x2e')](db[_0x6d84('0x37')]['rawAttributes'],function(_0xadabf5){return{'name':_0xadabf5['fieldName'],'type':_0xadabf5[_0x6d84('0x31')][_0x6d84('0x38')]};});_0x3dc206[_0x6d84('0x39')]=_[_0x6d84('0x2e')](_0x2ea5a2,_0x6d84('0x35'));_0x3dc206[_0x6d84('0x3a')]=_[_0x6d84('0x3b')](_0x420f46[_0x6d84('0x3a')]);_0x3dc206[_0x6d84('0x3c')]=_[_0x6d84('0x3d')](_0x3dc206[_0x6d84('0x39')],_0x3dc206['query']);_0xa33d1a[_0x6d84('0x3e')]=_[_0x6d84('0x3d')](_0x3dc206[_0x6d84('0x39')],qs['fields'](_0x420f46[_0x6d84('0x3a')][_0x6d84('0x3f')]));_0xa33d1a[_0x6d84('0x3e')]=_0xa33d1a[_0x6d84('0x3e')][_0x6d84('0x40')]?_0xa33d1a[_0x6d84('0x3e')]:_0x3dc206['model'];if(!_0x420f46[_0x6d84('0x3a')][_0x6d84('0x41')]('nolimit')){_0xa33d1a[_0x6d84('0x24')]=qs[_0x6d84('0x24')](_0x420f46['query'][_0x6d84('0x24')]);_0xa33d1a[_0x6d84('0x22')]=qs[_0x6d84('0x22')](_0x420f46[_0x6d84('0x3a')]['offset']);}_0xa33d1a['order']=qs[_0x6d84('0x42')](_0x420f46['query'][_0x6d84('0x42')]);_0xa33d1a[_0x6d84('0x43')]=qs['filters'](_[_0x6d84('0x44')](_0x420f46[_0x6d84('0x3a')],_0x3dc206[_0x6d84('0x3c')]),_0x2ea5a2);if(_0x420f46[_0x6d84('0x3a')][_0x6d84('0x2d')]){_0xa33d1a[_0x6d84('0x43')]=_[_0x6d84('0x45')](_0xa33d1a['where'],{'$or':_[_0x6d84('0x2e')](_0x2ea5a2,function(_0x2104f3){if(_0x2104f3[_0x6d84('0x31')]!==_0x6d84('0x46')){var _0x50b104={};_0x50b104[_0x2104f3[_0x6d84('0x35')]]={'$like':'%'+_0x420f46[_0x6d84('0x3a')]['filter']+'%'};return _0x50b104;}})});}_0xa33d1a=_[_0x6d84('0x45')]({},_0xa33d1a,_0x420f46[_0x6d84('0x47')]);var _0x56ea98={'where':_0xa33d1a[_0x6d84('0x43')]};return db[_0x6d84('0x37')][_0x6d84('0x25')](_0x56ea98)['then'](function(_0x3faf85){_0x11f7b2['count']=_0x3faf85;if(_0x420f46[_0x6d84('0x3a')][_0x6d84('0x48')]){_0xa33d1a[_0x6d84('0x49')]=[{'all':!![]}];}return db[_0x6d84('0x37')]['findAll'](_0xa33d1a);})['then'](function(_0x17ebeb){_0x11f7b2[_0x6d84('0x4a')]=_0x17ebeb;return _0x11f7b2;})[_0x6d84('0x33')](respondWithFilteredResult(_0x20ca2c,_0xa33d1a))['catch'](handleError(_0x20ca2c,null));};exports[_0x6d84('0x4b')]=function(_0x3283dd,_0x26a57a){var _0x505599={'raw':![],'where':{'id':_0x3283dd['params']['id']}},_0x329faa={};_0x329faa['model']=_[_0x6d84('0x3b')](db['VoiceQueue'][_0x6d84('0x4c')]);_0x329faa[_0x6d84('0x3a')]=_[_0x6d84('0x3b')](_0x3283dd['query']);_0x329faa[_0x6d84('0x3c')]=_[_0x6d84('0x3d')](_0x329faa['model'],_0x329faa[_0x6d84('0x3a')]);_0x505599[_0x6d84('0x3e')]=_[_0x6d84('0x3d')](_0x329faa[_0x6d84('0x39')],qs['fields'](_0x3283dd['query'][_0x6d84('0x3f')]));_0x505599[_0x6d84('0x3e')]=_0x505599[_0x6d84('0x3e')][_0x6d84('0x40')]?_0x505599['attributes']:_0x329faa[_0x6d84('0x39')];if(_0x3283dd[_0x6d84('0x3a')]['includeAll']){_0x505599[_0x6d84('0x49')]=[{'all':!![]}];}_0x505599=_[_0x6d84('0x45')]({},_0x505599,_0x3283dd[_0x6d84('0x47')]);return db['VoiceQueue']['find'](_0x505599)[_0x6d84('0x33')](handleEntityNotFound(_0x26a57a,null))[_0x6d84('0x33')](respondWithResult(_0x26a57a,null))['catch'](handleError(_0x26a57a,null));};exports[_0x6d84('0x4d')]=function(_0x116198,_0xe502d0){return db[_0x6d84('0x37')]['create'](_0x116198['body'],{})[_0x6d84('0x33')](function(_0x233a11){var _0xe6fb04=_0x116198[_0x6d84('0x4e')]['get']({'plain':!![]});if(!_0xe6fb04)throw new Error(_0x6d84('0x4f'));if(_0xe6fb04[_0x6d84('0x50')]===_0x6d84('0x4e')){var _0x1b0d39=_0x233a11[_0x6d84('0x28')]({'plain':!![]});var _0x1690ab=[{'name':_0x6d84('0x29'),'value':'inbound'},{'name':_0x6d84('0x2b'),'value':_0x6d84('0x2c')}];var _0x465c2c=_['find'](_0x1690ab,[_0x6d84('0x2f'),_0x1b0d39[_0x6d84('0x31')]])['name'];return db[_0x6d84('0x51')][_0x6d84('0x52')]({'where':{'name':_0x465c2c,'userProfileId':_0xe6fb04[_0x6d84('0x53')]},'raw':!![]})['then'](function(_0x38e4c3){if(_0x38e4c3&&_0x38e4c3[_0x6d84('0x54')]===0x0){return db[_0x6d84('0x32')]['create']({'name':_0x1b0d39[_0x6d84('0x35')],'resourceId':_0x1b0d39['id'],'type':_0x38e4c3[_0x6d84('0x35')],'sectionId':_0x38e4c3['id']},{})[_0x6d84('0x33')](function(){return _0x233a11;});}else{return _0x233a11;}})[_0x6d84('0x55')](function(_0x22a510){logger[_0x6d84('0x34')](_0x6d84('0x56'),_0x22a510);throw _0x22a510;});}return _0x233a11;})[_0x6d84('0x33')](respondWithResult(_0xe502d0,0xc9))['catch'](handleError(_0xe502d0,null));};exports[_0x6d84('0x57')]=function(_0x457036,_0x185b37){var _0x52c75d={'where':{'id':_0x457036[_0x6d84('0x58')]['id']}},_0x4e1c2e={};_0x4e1c2e['model']=_[_0x6d84('0x3b')](db['VoiceQueue'][_0x6d84('0x4c')]);_0x52c75d[_0x6d84('0x3e')]=_[_0x6d84('0x3d')](_0x4e1c2e[_0x6d84('0x39')],qs[_0x6d84('0x3f')](_0x457036[_0x6d84('0x3a')][_0x6d84('0x3f')]));_0x52c75d[_0x6d84('0x3e')]=_0x52c75d[_0x6d84('0x3e')]['length']?_0x52c75d[_0x6d84('0x3e')]:_0x4e1c2e[_0x6d84('0x39')];if(_0x457036[_0x6d84('0x3a')][_0x6d84('0x48')]){_0x52c75d[_0x6d84('0x49')]=[{'all':!![]}];}_0x52c75d=_['merge']({},_0x52c75d,_0x457036[_0x6d84('0x47')]);return db[_0x6d84('0x37')][_0x6d84('0x52')](_0x52c75d)['then'](handleEntityNotFound(_0x185b37,null))[_0x6d84('0x33')](function(_0x522742){if(_0x522742){var _0x3ea9eb=_0x522742[_0x6d84('0x28')]({'plain':!![]});_0x3ea9eb=qs[_0x6d84('0x59')](_0x3ea9eb,['id',_0x6d84('0x5a'),'updatedAt']);_0x457036[_0x6d84('0x5b')]=_['omit'](_0x457036[_0x6d84('0x5b')],['id','createdAt','updatedAt']);return db[_0x6d84('0x37')][_0x6d84('0x4d')](_[_0x6d84('0x45')](_0x3ea9eb,_0x457036[_0x6d84('0x5b')]),{'include':_0x457036[_0x6d84('0x3a')][_0x6d84('0x48')]?[{'all':!![]}]:undefined})[_0x6d84('0x33')](function(_0x1074b8){var _0x33ddf9=_0x457036[_0x6d84('0x4e')]['get']({'plain':!![]});if(!_0x33ddf9)throw new Error(_0x6d84('0x4f'));if(_0x33ddf9[_0x6d84('0x50')]===_0x6d84('0x4e')){var _0x346a9a=_0x1074b8[_0x6d84('0x28')]({'plain':!![]});var _0x3d4cde=[{'name':_0x6d84('0x29'),'value':_0x6d84('0x2a')},{'name':_0x6d84('0x2b'),'value':_0x6d84('0x2c')}];var _0x3909ec=_[_0x6d84('0x52')](_0x3d4cde,[_0x6d84('0x2f'),_0x346a9a['type']])[_0x6d84('0x35')];return db[_0x6d84('0x51')][_0x6d84('0x52')]({'where':{'name':_0x3909ec,'userProfileId':_0x33ddf9['userProfileId']},'raw':!![]})[_0x6d84('0x33')](function(_0x112c1c){if(_0x112c1c&&_0x112c1c['autoAssociation']===0x0){return db['UserProfileResource'][_0x6d84('0x4d')]({'name':_0x346a9a[_0x6d84('0x35')],'resourceId':_0x346a9a['id'],'type':_0x112c1c[_0x6d84('0x35')],'sectionId':_0x112c1c['id']},{})['then'](function(){return _0x1074b8;});}else{return _0x1074b8;}})[_0x6d84('0x55')](function(_0x1e5ec9){logger['error'](_0x6d84('0x56'),_0x1e5ec9);throw _0x1e5ec9;});}return _0x1074b8;});}})[_0x6d84('0x33')](respondWithResult(_0x185b37,0xc9))[_0x6d84('0x55')](handleError(_0x185b37,null));};exports[_0x6d84('0x5c')]=function(_0x413e90,_0x2f4f14){if(_0x413e90[_0x6d84('0x5b')]['id']){delete _0x413e90[_0x6d84('0x5b')]['id'];}return db[_0x6d84('0x37')][_0x6d84('0x52')]({'where':{'id':_0x413e90[_0x6d84('0x58')]['id']}})['then'](handleEntityNotFound(_0x2f4f14,null))[_0x6d84('0x33')](saveUpdates(_0x413e90[_0x6d84('0x5b')],null))['then'](respondWithResult(_0x2f4f14,null))[_0x6d84('0x55')](handleError(_0x2f4f14,null));};exports[_0x6d84('0x27')]=function(_0x4e23f7,_0x5e6794){return db[_0x6d84('0x37')][_0x6d84('0x52')]({'where':{'id':_0x4e23f7[_0x6d84('0x58')]['id']}})[_0x6d84('0x33')](handleEntityNotFound(_0x5e6794,null))[_0x6d84('0x33')](removeEntity(_0x5e6794,null))[_0x6d84('0x55')](handleError(_0x5e6794,null));};exports[_0x6d84('0x5d')]=function(_0x4abe9a,_0x4ab07c,_0x437033){var _0x3f9b97={'raw':![],'where':{}};var _0x30667d={};var _0x80ba2b={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x4abe9a[_0x6d84('0x58')]['id']}})[_0x6d84('0x33')](handleEntityNotFound(_0x4ab07c,null))['then'](function(_0xa2f2e){if(_0xa2f2e){_0x30667d['model']=_[_0x6d84('0x3b')](db[_0x6d84('0x5e')]['rawAttributes']);_0x30667d[_0x6d84('0x3a')]=_[_0x6d84('0x3b')](_0x4abe9a[_0x6d84('0x3a')]);_0x30667d[_0x6d84('0x3c')]=_[_0x6d84('0x3d')](_0x30667d['model'],_0x30667d['query']);_0x3f9b97[_0x6d84('0x3e')]=_[_0x6d84('0x3d')](_0x30667d[_0x6d84('0x39')],qs['fields'](_0x4abe9a[_0x6d84('0x3a')]['fields']));_0x3f9b97['attributes']=_0x3f9b97[_0x6d84('0x3e')][_0x6d84('0x40')]?_0x3f9b97[_0x6d84('0x3e')]:_0x30667d['model'];if(!_0x4abe9a[_0x6d84('0x3a')][_0x6d84('0x41')](_0x6d84('0x5f'))){_0x3f9b97[_0x6d84('0x24')]=qs['limit'](_0x4abe9a[_0x6d84('0x3a')]['limit']);_0x3f9b97['offset']=qs[_0x6d84('0x22')](_0x4abe9a[_0x6d84('0x3a')][_0x6d84('0x22')]);}_0x3f9b97[_0x6d84('0x60')]=qs[_0x6d84('0x42')](_0x4abe9a[_0x6d84('0x3a')][_0x6d84('0x42')]);_0x3f9b97[_0x6d84('0x43')]=qs[_0x6d84('0x3c')](_[_0x6d84('0x44')](_0x4abe9a[_0x6d84('0x3a')],_0x30667d[_0x6d84('0x3c')]));_0x3f9b97['where'][_0x6d84('0x61')]=_0xa2f2e['id'];if(_0x4abe9a[_0x6d84('0x3a')][_0x6d84('0x2d')]){_0x3f9b97['where']=_['merge'](_0x3f9b97['where'],{'$or':_['map'](_0x3f9b97[_0x6d84('0x3e')],function(_0x3610b2){var _0x278e5d={};_0x278e5d[_0x3610b2]={'$like':'%'+_0x4abe9a[_0x6d84('0x3a')][_0x6d84('0x2d')]+'%'};return _0x278e5d;})});}_0x3f9b97=_[_0x6d84('0x45')]({},_0x3f9b97,_0x4abe9a[_0x6d84('0x47')]);return db[_0x6d84('0x5e')][_0x6d84('0x25')]({'where':_0x3f9b97[_0x6d84('0x43')]})[_0x6d84('0x33')](function(_0x28aaba){_0x80ba2b[_0x6d84('0x25')]=_0x28aaba;if(_0x4abe9a[_0x6d84('0x3a')][_0x6d84('0x48')]){_0x3f9b97[_0x6d84('0x49')]=[{'all':!![]}];}return db['CmHopper'][_0x6d84('0x62')](_0x3f9b97);})[_0x6d84('0x33')](function(_0x2f14a3){_0x80ba2b[_0x6d84('0x4a')]=_0x2f14a3;return _0x80ba2b;});}})[_0x6d84('0x33')](respondWithFilteredResult(_0x4ab07c,_0x3f9b97))[_0x6d84('0x55')](handleError(_0x4ab07c,null));};exports[_0x6d84('0x63')]=function(_0x536bad,_0x38ad95,_0x205d46){var _0x213213={'raw':!![],'where':{}};var _0x1b6c5d={};var _0x592b56={'count':0x0,'rows':[]};return db[_0x6d84('0x37')][_0x6d84('0x64')]({'where':{'id':_0x536bad['params']['id']}})[_0x6d84('0x33')](handleEntityNotFound(_0x38ad95,null))[_0x6d84('0x33')](function(_0x5be788){if(_0x5be788){_0x1b6c5d[_0x6d84('0x39')]=_[_0x6d84('0x3b')](db[_0x6d84('0x65')][_0x6d84('0x4c')]);_0x1b6c5d[_0x6d84('0x3a')]=_[_0x6d84('0x3b')](_0x536bad[_0x6d84('0x3a')]);_0x1b6c5d[_0x6d84('0x3c')]=_[_0x6d84('0x3d')](_0x1b6c5d[_0x6d84('0x39')],_0x1b6c5d[_0x6d84('0x3a')]);_0x213213['attributes']=_[_0x6d84('0x3d')](_0x1b6c5d[_0x6d84('0x39')],qs[_0x6d84('0x3f')](_0x536bad[_0x6d84('0x3a')][_0x6d84('0x3f')]));_0x213213['attributes']=_0x213213[_0x6d84('0x3e')][_0x6d84('0x40')]?_0x213213['attributes']:_0x1b6c5d['model'];if(!_0x536bad[_0x6d84('0x3a')]['hasOwnProperty'](_0x6d84('0x5f'))){_0x213213[_0x6d84('0x24')]=qs[_0x6d84('0x24')](_0x536bad[_0x6d84('0x3a')][_0x6d84('0x24')]);_0x213213[_0x6d84('0x22')]=qs[_0x6d84('0x22')](_0x536bad['query'][_0x6d84('0x22')]);}_0x213213[_0x6d84('0x60')]=qs[_0x6d84('0x42')](_0x536bad[_0x6d84('0x3a')][_0x6d84('0x42')]);_0x213213[_0x6d84('0x43')]=qs[_0x6d84('0x3c')](_[_0x6d84('0x44')](_0x536bad['query'],_0x1b6c5d['filters']));_0x213213[_0x6d84('0x43')][_0x6d84('0x61')]=_0x5be788['id'];if(_0x536bad[_0x6d84('0x3a')][_0x6d84('0x2d')]){_0x213213['where']=_[_0x6d84('0x45')](_0x213213[_0x6d84('0x43')],{'$or':_[_0x6d84('0x2e')](_0x213213[_0x6d84('0x3e')],function(_0x512e4e){var _0x162ab2={};_0x162ab2[_0x512e4e]={'$like':'%'+_0x536bad[_0x6d84('0x3a')][_0x6d84('0x2d')]+'%'};return _0x162ab2;})});}_0x213213=_[_0x6d84('0x45')]({},_0x213213,_0x536bad[_0x6d84('0x47')]);return db[_0x6d84('0x65')]['count']({'where':_0x213213[_0x6d84('0x43')]})[_0x6d84('0x33')](function(_0xf1c703){_0x592b56[_0x6d84('0x25')]=_0xf1c703;if(_0x536bad[_0x6d84('0x3a')][_0x6d84('0x48')]){_0x213213[_0x6d84('0x49')]=[{'all':!![]}];}return db[_0x6d84('0x65')][_0x6d84('0x62')](_0x213213);})[_0x6d84('0x33')](function(_0x55b00a){_0x592b56[_0x6d84('0x4a')]=_0x55b00a;return _0x592b56;});}})['then'](respondWithFilteredResult(_0x38ad95,_0x213213))[_0x6d84('0x55')](handleError(_0x38ad95,null));};exports[_0x6d84('0x66')]=function(_0x210b95,_0x288cc3,_0x4741ba){var _0x236128={'raw':!![],'where':{}};var _0x2387f2={};var _0x3d680f={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x6d84('0x64')]({'where':{'id':_0x210b95[_0x6d84('0x58')]['id']}})[_0x6d84('0x33')](handleEntityNotFound(_0x288cc3,null))[_0x6d84('0x33')](function(_0x35f968){if(_0x35f968){_0x2387f2[_0x6d84('0x39')]=_[_0x6d84('0x3b')](db['CmHopperFinal'][_0x6d84('0x4c')]);_0x2387f2['query']=_['keys'](_0x210b95[_0x6d84('0x3a')]);_0x2387f2['filters']=_[_0x6d84('0x3d')](_0x2387f2[_0x6d84('0x39')],_0x2387f2['query']);_0x236128[_0x6d84('0x3e')]=_[_0x6d84('0x3d')](_0x2387f2['model'],qs[_0x6d84('0x3f')](_0x210b95[_0x6d84('0x3a')]['fields']));_0x236128[_0x6d84('0x3e')]=_0x236128['attributes'][_0x6d84('0x40')]?_0x236128['attributes']:_0x2387f2['model'];if(!_0x210b95[_0x6d84('0x3a')][_0x6d84('0x41')]('nolimit')){_0x236128['limit']=qs[_0x6d84('0x24')](_0x210b95['query'][_0x6d84('0x24')]);_0x236128[_0x6d84('0x22')]=qs[_0x6d84('0x22')](_0x210b95['query'][_0x6d84('0x22')]);}_0x236128[_0x6d84('0x60')]=qs[_0x6d84('0x42')](_0x210b95[_0x6d84('0x3a')][_0x6d84('0x42')]);_0x236128[_0x6d84('0x43')]=qs['filters'](_[_0x6d84('0x44')](_0x210b95[_0x6d84('0x3a')],_0x2387f2['filters']));_0x236128['where']['VoiceQueueId']=_0x35f968['id'];if(_0x210b95[_0x6d84('0x3a')][_0x6d84('0x2d')]){_0x236128[_0x6d84('0x43')]=_['merge'](_0x236128['where'],{'$or':_[_0x6d84('0x2e')](_0x236128[_0x6d84('0x3e')],function(_0x5ac627){var _0x38238a={};_0x38238a[_0x5ac627]={'$like':'%'+_0x210b95[_0x6d84('0x3a')][_0x6d84('0x2d')]+'%'};return _0x38238a;})});}_0x236128=_[_0x6d84('0x45')]({},_0x236128,_0x210b95[_0x6d84('0x47')]);return db[_0x6d84('0x67')][_0x6d84('0x25')]({'where':_0x236128[_0x6d84('0x43')]})['then'](function(_0x34f4d){_0x3d680f[_0x6d84('0x25')]=_0x34f4d;if(_0x210b95[_0x6d84('0x3a')][_0x6d84('0x48')]){_0x236128['include']=[{'all':!![]}];}return db[_0x6d84('0x67')][_0x6d84('0x62')](_0x236128);})['then'](function(_0x2a8547){_0x3d680f[_0x6d84('0x4a')]=_0x2a8547;return _0x3d680f;});}})['then'](respondWithFilteredResult(_0x288cc3,_0x236128))[_0x6d84('0x55')](handleError(_0x288cc3,null));};exports[_0x6d84('0x68')]=function(_0x1ae9f3,_0x2549a5,_0x44ef05){var _0xc61e7b={'raw':!![],'where':{}};var _0x443565={};var _0x2260ba={'count':0x0,'rows':[]};return db[_0x6d84('0x37')][_0x6d84('0x64')]({'where':{'id':_0x1ae9f3[_0x6d84('0x58')]['id']}})[_0x6d84('0x33')](handleEntityNotFound(_0x2549a5,null))[_0x6d84('0x33')](function(_0x2768e1){if(_0x2768e1){_0x443565[_0x6d84('0x39')]=_[_0x6d84('0x3b')](db[_0x6d84('0x69')]['rawAttributes']);_0x443565['query']=_[_0x6d84('0x3b')](_0x1ae9f3[_0x6d84('0x3a')]);_0x443565[_0x6d84('0x3c')]=_[_0x6d84('0x3d')](_0x443565[_0x6d84('0x39')],_0x443565[_0x6d84('0x3a')]);_0xc61e7b[_0x6d84('0x3e')]=_[_0x6d84('0x3d')](_0x443565[_0x6d84('0x39')],qs[_0x6d84('0x3f')](_0x1ae9f3[_0x6d84('0x3a')][_0x6d84('0x3f')]));_0xc61e7b['attributes']=_0xc61e7b['attributes'][_0x6d84('0x40')]?_0xc61e7b[_0x6d84('0x3e')]:_0x443565[_0x6d84('0x39')];if(!_0x1ae9f3[_0x6d84('0x3a')][_0x6d84('0x41')](_0x6d84('0x5f'))){_0xc61e7b[_0x6d84('0x24')]=qs[_0x6d84('0x24')](_0x1ae9f3[_0x6d84('0x3a')]['limit']);_0xc61e7b[_0x6d84('0x22')]=qs['offset'](_0x1ae9f3[_0x6d84('0x3a')][_0x6d84('0x22')]);}_0xc61e7b[_0x6d84('0x60')]=qs[_0x6d84('0x42')](_0x1ae9f3[_0x6d84('0x3a')][_0x6d84('0x42')]);_0xc61e7b[_0x6d84('0x43')]=qs[_0x6d84('0x3c')](_[_0x6d84('0x44')](_0x1ae9f3[_0x6d84('0x3a')],_0x443565[_0x6d84('0x3c')]));_0xc61e7b[_0x6d84('0x43')][_0x6d84('0x61')]=_0x2768e1['id'];if(_0x1ae9f3[_0x6d84('0x3a')][_0x6d84('0x2d')]){_0xc61e7b[_0x6d84('0x43')]=_[_0x6d84('0x45')](_0xc61e7b[_0x6d84('0x43')],{'$or':_['map'](_0xc61e7b[_0x6d84('0x3e')],function(_0x5f2bc9){var _0x24c024={};_0x24c024[_0x5f2bc9]={'$like':'%'+_0x1ae9f3[_0x6d84('0x3a')][_0x6d84('0x2d')]+'%'};return _0x24c024;})});}_0xc61e7b=_[_0x6d84('0x45')]({},_0xc61e7b,_0x1ae9f3['options']);return db['CmHopperBlack']['count']({'where':_0xc61e7b[_0x6d84('0x43')]})[_0x6d84('0x33')](function(_0x197361){_0x2260ba['count']=_0x197361;if(_0x1ae9f3['query'][_0x6d84('0x48')]){_0xc61e7b[_0x6d84('0x49')]=[{'all':!![]}];}return db[_0x6d84('0x69')][_0x6d84('0x62')](_0xc61e7b);})['then'](function(_0x52e3d1){_0x2260ba[_0x6d84('0x4a')]=_0x52e3d1;return _0x2260ba;});}})[_0x6d84('0x33')](respondWithFilteredResult(_0x2549a5,_0xc61e7b))[_0x6d84('0x55')](handleError(_0x2549a5,null));};exports[_0x6d84('0x6a')]=function(_0x387af4,_0x1a1357,_0x5b21f6){var _0x2b19c4={};var _0x28adac={};var _0x2b3969;var _0x4c409d;return db[_0x6d84('0x37')]['findOne']({'where':{'id':_0x387af4['params']['id']}})[_0x6d84('0x33')](handleEntityNotFound(_0x1a1357,null))[_0x6d84('0x33')](function(_0x28a04c){if(_0x28a04c){_0x2b3969=_0x28a04c;_0x28adac[_0x6d84('0x39')]=_['keys'](db[_0x6d84('0x6b')][_0x6d84('0x4c')]);_0x28adac['query']=_[_0x6d84('0x3b')](_0x387af4[_0x6d84('0x3a')]);_0x28adac[_0x6d84('0x3c')]=_['intersection'](_0x28adac[_0x6d84('0x39')],_0x28adac['query']);_0x2b19c4[_0x6d84('0x3e')]=_['intersection'](_0x28adac[_0x6d84('0x39')],qs[_0x6d84('0x3f')](_0x387af4[_0x6d84('0x3a')][_0x6d84('0x3f')]));_0x2b19c4['attributes']=_0x2b19c4[_0x6d84('0x3e')][_0x6d84('0x40')]?_0x2b19c4[_0x6d84('0x3e')]:_0x28adac['model'];_0x2b19c4['order']=qs[_0x6d84('0x42')](_0x387af4['query'][_0x6d84('0x42')]);_0x2b19c4['where']=qs[_0x6d84('0x3c')](_[_0x6d84('0x44')](_0x387af4[_0x6d84('0x3a')],_0x28adac[_0x6d84('0x3c')]));if(_0x387af4[_0x6d84('0x3a')][_0x6d84('0x2d')]){_0x2b19c4[_0x6d84('0x43')]=_['merge'](_0x2b19c4[_0x6d84('0x43')],{'$or':_['map'](_0x2b19c4['attributes'],function(_0x13ee3e){var _0x207fd0={};_0x207fd0[_0x13ee3e]={'$like':'%'+_0x387af4[_0x6d84('0x3a')]['filter']+'%'};return _0x207fd0;})});}_0x2b19c4=_[_0x6d84('0x45')]({},_0x2b19c4,_0x387af4[_0x6d84('0x47')]);return _0x2b3969['getTeams'](_0x2b19c4);}})[_0x6d84('0x33')](function(_0xf4c8cf){if(_0xf4c8cf){_0x4c409d=_0xf4c8cf[_0x6d84('0x40')];if(!_0x387af4[_0x6d84('0x3a')][_0x6d84('0x41')](_0x6d84('0x5f'))){_0x2b19c4['limit']=qs[_0x6d84('0x24')](_0x387af4['query'][_0x6d84('0x24')]);_0x2b19c4[_0x6d84('0x22')]=qs[_0x6d84('0x22')](_0x387af4[_0x6d84('0x3a')][_0x6d84('0x22')]);}return _0x2b3969['getTeams'](_0x2b19c4);}})[_0x6d84('0x33')](function(_0xe6358a){if(_0xe6358a){return _0xe6358a?{'count':_0x4c409d,'rows':_0xe6358a}:null;}})[_0x6d84('0x33')](respondWithResult(_0x1a1357,null))[_0x6d84('0x55')](handleError(_0x1a1357,null));};exports[_0x6d84('0x6c')]=function(_0x2104cd,_0x885935,_0x5ecf39){var _0x3a795d=_0x2104cd[_0x6d84('0x5b')]['teams'];var _0x119f2c=_['map'](_0x3a795d,'id');return db['Team']['findAll']({'where':{'id':_0x119f2c},'attributes':['id'],'include':[{'model':db[_0x6d84('0x6d')],'as':_0x6d84('0x6e'),'attributes':['id',_0x6d84('0x35'),'online',_0x6d84('0x6f'),_0x6d84('0x70')],'raw':!![]}]})[_0x6d84('0x33')](function(_0xf6be15){if(_0xf6be15){var _0x56eff6=_[_0x6d84('0x71')](_0xf6be15,function(_0x4b6b63){var _0x44eb85=_0x4b6b63[_0x6d84('0x28')]({'plain':!![]});_0x44eb85['Agents'][_0x6d84('0x72')](function(_0x2afa0a){_0x2afa0a['penalty']=_[_0x6d84('0x52')](_0x3a795d,{'id':_0x44eb85['id']})[_0x6d84('0x73')];});return _0x44eb85[_0x6d84('0x6e')];});return db['VoiceQueue'][_0x6d84('0x52')]({'where':{'id':_0x2104cd[_0x6d84('0x58')]['id']}})[_0x6d84('0x33')](function(_0x36983e){return db['sequelize'][_0x6d84('0x74')](function(_0x120540){return _0x36983e['addTeams'](_0x119f2c,{'transaction':_0x120540})[_0x6d84('0x33')](function(){return BPromise['each'](_0x3a795d,function(_0x32c782){return db[_0x6d84('0x75')][_0x6d84('0x76')]({'TeamId':_0x32c782['id'],'VoiceQueueId':_0x2104cd['params']['id'],'penalty':_0x32c782[_0x6d84('0x73')]},{'transaction':_0x120540});});})[_0x6d84('0x33')](function(){return BPromise[_0x6d84('0x77')](_0x56eff6,function(_0x242896){return db[_0x6d84('0x78')][_0x6d84('0x79')]({'where':{'UserId':_0x242896['id'],'VoiceQueueId':_0x2104cd[_0x6d84('0x58')]['id']},'defaults':{'penalty':_0x242896[_0x6d84('0x73')]},'transaction':_0x120540});});})[_0x6d84('0x33')](function(){return BPromise[_0x6d84('0x77')](_[_0x6d84('0x2d')](_0x56eff6,{'online':!![]}),function(_0x1262f7){return db['UserVoiceQueueRt'][_0x6d84('0x76')]({'membername':_0x1262f7[_0x6d84('0x35')],'UserId':_0x1262f7['id'],'queue_name':_0x36983e[_0x6d84('0x35')],'VoiceQueueId':_0x36983e['id'],'interface':_['isNil'](_0x1262f7[_0x6d84('0x70')])?util['format']('SIP/%s',_0x1262f7[_0x6d84('0x35')]):_0x1262f7['interface'],'paused':_0x1262f7[_0x6d84('0x6f')]||![],'penalty':_0x1262f7[_0x6d84('0x73')]},{'transaction':_0x120540});});})[_0x6d84('0x33')](function(){_0x56eff6[_0x6d84('0x72')](function(_0xc86feb){socket[_0x6d84('0x7a')]('userVoiceQueue:save',{'UserId':_0xc86feb['id'],'VoiceQueueId':_0x36983e['id']});});});});});}})['then'](respondWithStatusCode(_0x885935,null))[_0x6d84('0x55')](handleError(_0x885935,null));};exports['removeTeams']=function(_0x56a875,_0x5be805,_0x34c262){return db[_0x6d84('0x6b')][_0x6d84('0x62')]({'where':{'id':_0x56a875[_0x6d84('0x3a')][_0x6d84('0x7b')]},'attributes':['id'],'include':[{'model':db[_0x6d84('0x6d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6d84('0x33')](handleEntityNotFound(_0x5be805,null))[_0x6d84('0x33')](function(_0x1a90b6){var _0x561022=_['map'](_0x1a90b6,'id');var _0x5d9410=[];var _0x372c8c=[];var _0x17b267=squel[_0x6d84('0x7c')]();_0x17b267[_0x6d84('0x7d')](_0x6d84('0x7e'))[_0x6d84('0x7f')](_0x6d84('0x80'),'tq')[_0x6d84('0x81')](_0x6d84('0x82'),'ut',_0x6d84('0x83'))[_0x6d84('0x43')](_0x6d84('0x84'),_0x56a875[_0x6d84('0x58')]['id']);for(var _0x158735=0x0;_0x158735<_0x1a90b6[_0x6d84('0x40')];_0x158735+=0x1){let _0x393abe=_0x1a90b6[_0x158735];for(var _0x29fb5a=0x0;_0x29fb5a<_0x393abe['Agents'][_0x6d84('0x40')];_0x29fb5a+=0x1){let _0xd54a2b=_0x393abe[_0x6d84('0x6e')][_0x29fb5a];var _0x350435=_0x17b267['clone']();_0x350435[_0x6d84('0x43')](_0x6d84('0x85'),_0xd54a2b['id']);_0x372c8c['push'](db[_0x6d84('0x86')]['query'](_0x350435[_0x6d84('0x87')](),{'type':db[_0x6d84('0x86')][_0x6d84('0x88')][_0x6d84('0x89')]})[_0x6d84('0x33')](function(_0x29775a){if(_0x29775a['length']===0x1){return _0xd54a2b['id'];}else{var _0x393be5=_['every'](_[_0x6d84('0x2e')](_0x29775a,'TeamId'),function(_0x5e24f5){return _[_0x6d84('0x30')](_0x561022,_0x5e24f5);});if(_0x393be5){return _0xd54a2b['id'];}}}));}}return BPromise[_0x6d84('0x8a')](_0x372c8c)['then'](function(_0x510ee6){_0x5d9410=_(_0x5d9410)['union'](_0x510ee6)[_0x6d84('0x8b')]()[_0x6d84('0x2f')]();return db[_0x6d84('0x37')][_0x6d84('0x52')]({'where':{'id':_0x56a875['params']['id']}})[_0x6d84('0x33')](function(_0x5e5837){return db[_0x6d84('0x86')][_0x6d84('0x74')](function(_0x5c64ec){return _0x5e5837['removeTeams'](_0x56a875[_0x6d84('0x3a')][_0x6d84('0x7b')],{'transaction':_0x5c64ec})[_0x6d84('0x33')](function(){if(!_[_0x6d84('0x8c')](_0x5d9410)){return _0x5e5837[_0x6d84('0x8d')](_0x5d9410,{'transaction':_0x5c64ec})[_0x6d84('0x33')](function(){return db['UserVoiceQueueRt'][_0x6d84('0x27')]({'where':{'VoiceQueueId':_0x56a875[_0x6d84('0x58')]['id'],'UserId':_0x5d9410},'transaction':_0x5c64ec});});}})[_0x6d84('0x33')](function(){_0x5d9410[_0x6d84('0x72')](function(_0x8e78c8){socket[_0x6d84('0x7a')](_0x6d84('0x8e'),{'UserId':_0x8e78c8,'VoiceQueueId':_0x5e5837['id']});});});});});});})[_0x6d84('0x33')](respondWithStatusCode(_0x5be805,null))['catch'](handleError(_0x5be805,null));};exports[_0x6d84('0x8f')]=function(_0x33c608,_0x3956e4,_0x3bdbfe){var _0x3ce9a,_0xbc545a;return db[_0x6d84('0x37')][_0x6d84('0x52')]({'where':{'id':_0x33c608[_0x6d84('0x58')]['id']}})[_0x6d84('0x33')](handleEntityNotFound(_0x3956e4,null))[_0x6d84('0x33')](function(_0x3e88ff){if(_0x3e88ff){_0xbc545a=_0x3e88ff;return _0x3e88ff[_0x6d84('0x8f')](_0x33c608[_0x6d84('0x5b')][_0x6d84('0x7b')],_['omit'](_0x33c608[_0x6d84('0x5b')],[_0x6d84('0x7b'),'id'])||{})[_0x6d84('0x90')](function(_0x542aec){for(var _0x1312a2=0x0;_0x1312a2<_0x33c608[_0x6d84('0x5b')][_0x6d84('0x7b')][_0x6d84('0x40')];_0x1312a2+=0x1){socket[_0x6d84('0x7a')](_0x6d84('0x91'),{'UserId':Number(_0x33c608[_0x6d84('0x5b')][_0x6d84('0x7b')][_0x1312a2]),'VoiceQueueId':Number(_0x33c608[_0x6d84('0x58')]['id'])});}return _0x542aec;});}})[_0x6d84('0x33')](function(_0x796a79){_0x3ce9a=_0x796a79||[];if(_0xbc545a){return db['User'][_0x6d84('0x62')]({'where':{'id':_0x33c608[_0x6d84('0x5b')][_0x6d84('0x7b')]},'attributes':['id',_0x6d84('0x35'),'online',_0x6d84('0x6f'),_0x6d84('0x70')],'raw':!![]});}})[_0x6d84('0x33')](function(_0x54cc13){if(!_['isEmpty'](_0x54cc13)){var _0x504423=[];for(var _0x405b10=0x0;_0x405b10<_0x54cc13[_0x6d84('0x40')];_0x405b10++){if(_0x54cc13[_0x405b10][_0x6d84('0x92')]){_0x504423[_0x6d84('0x93')](db[_0x6d84('0x94')]['upsert']({'membername':_0x54cc13[_0x405b10][_0x6d84('0x35')],'UserId':_0x54cc13[_0x405b10]['id'],'queue_name':_0xbc545a[_0x6d84('0x35')],'VoiceQueueId':_0xbc545a['id'],'interface':_[_0x6d84('0x95')](_0x54cc13[_0x405b10][_0x6d84('0x70')])?util[_0x6d84('0x96')](_0x6d84('0x97'),_0x54cc13[_0x405b10][_0x6d84('0x35')]):_0x54cc13[_0x405b10]['interface'],'paused':_0x54cc13[_0x405b10][_0x6d84('0x6f')]||![],'penalty':_0x33c608[_0x6d84('0x5b')][_0x6d84('0x73')]||0x0}));}}return BPromise[_0x6d84('0x8a')](_0x504423);}})[_0x6d84('0x33')](function(){return _0x3ce9a;})[_0x6d84('0x33')](respondWithResult(_0x3956e4,null))['catch'](handleError(_0x3956e4,null));};exports[_0x6d84('0x8d')]=function(_0x331777,_0x21de24,_0x2fc2a0){return db[_0x6d84('0x37')][_0x6d84('0x52')]({'where':{'id':_0x331777[_0x6d84('0x58')]['id']}})[_0x6d84('0x33')](handleEntityNotFound(_0x21de24,null))[_0x6d84('0x33')](function(_0x315013){if(_0x315013){return _0x315013[_0x6d84('0x8d')](_0x331777[_0x6d84('0x3a')][_0x6d84('0x7b')])[_0x6d84('0x33')](function(){if(_[_0x6d84('0x98')](_0x331777['query'][_0x6d84('0x7b')])){for(var _0x18c92b=0x0;_0x18c92b<_0x331777[_0x6d84('0x3a')]['ids'][_0x6d84('0x40')];_0x18c92b+=0x1){socket[_0x6d84('0x7a')](_0x6d84('0x8e'),{'UserId':Number(_0x331777[_0x6d84('0x3a')]['ids'][_0x18c92b]),'VoiceQueueId':Number(_0x331777[_0x6d84('0x58')]['id'])});}}else{socket[_0x6d84('0x7a')](_0x6d84('0x8e'),{'UserId':Number(_0x331777[_0x6d84('0x3a')][_0x6d84('0x7b')]),'VoiceQueueId':Number(_0x331777[_0x6d84('0x58')]['id'])});}});}})['then'](function(_0x3d0167){return db[_0x6d84('0x94')][_0x6d84('0x27')]({'where':{'VoiceQueueId':_0x331777[_0x6d84('0x58')]['id'],'UserId':_0x331777['query'][_0x6d84('0x7b')]}})[_0x6d84('0x33')](function(){return _0x3d0167;});})[_0x6d84('0x33')](respondWithStatusCode(_0x21de24,null))[_0x6d84('0x55')](handleError(_0x21de24,null));};exports[_0x6d84('0x99')]=function(_0xe0eaf,_0x271497,_0x201cf5){var _0x138e78={};var _0x3ccc27={};var _0x1ddd8b;var _0x1d284e;return db[_0x6d84('0x37')]['findOne']({'where':{'id':_0xe0eaf['params']['id']}})['then'](handleEntityNotFound(_0x271497,null))[_0x6d84('0x33')](function(_0x389d56){if(_0x389d56){_0x1ddd8b=_0x389d56;_0x3ccc27[_0x6d84('0x39')]=_[_0x6d84('0x3b')](db[_0x6d84('0x6d')][_0x6d84('0x4c')]);_0x3ccc27[_0x6d84('0x3a')]=_[_0x6d84('0x3b')](_0xe0eaf['query']);_0x3ccc27[_0x6d84('0x3c')]=_['intersection'](_0x3ccc27[_0x6d84('0x39')],_0x3ccc27[_0x6d84('0x3a')]);_0x138e78[_0x6d84('0x3e')]=_[_0x6d84('0x3d')](_0x3ccc27[_0x6d84('0x39')],qs[_0x6d84('0x3f')](_0xe0eaf[_0x6d84('0x3a')][_0x6d84('0x3f')]));_0x138e78[_0x6d84('0x3e')]=_0x138e78[_0x6d84('0x3e')]['length']?_0x138e78[_0x6d84('0x3e')]:_0x3ccc27[_0x6d84('0x39')];_0x138e78[_0x6d84('0x60')]=qs['sort'](_0xe0eaf['query'][_0x6d84('0x42')]);_0x138e78[_0x6d84('0x43')]=qs[_0x6d84('0x3c')](_[_0x6d84('0x44')](_0xe0eaf['query'],_0x3ccc27[_0x6d84('0x3c')]));if(_0xe0eaf['query']['filter']){_0x138e78[_0x6d84('0x43')]=_[_0x6d84('0x45')](_0x138e78[_0x6d84('0x43')],{'$or':_[_0x6d84('0x2e')](_0x138e78[_0x6d84('0x3e')],function(_0x58cc30){var _0x46f249={};_0x46f249[_0x58cc30]={'$like':'%'+_0xe0eaf[_0x6d84('0x3a')][_0x6d84('0x2d')]+'%'};return _0x46f249;})});}_0x138e78=_[_0x6d84('0x45')]({},_0x138e78,_0xe0eaf['options']);return _0x1ddd8b[_0x6d84('0x99')](_0x138e78);}})[_0x6d84('0x33')](function(_0x37f922){if(_0x37f922){_0x1d284e=_0x37f922[_0x6d84('0x40')];if(!_0xe0eaf[_0x6d84('0x3a')][_0x6d84('0x41')](_0x6d84('0x5f'))){_0x138e78[_0x6d84('0x24')]=qs[_0x6d84('0x24')](_0xe0eaf[_0x6d84('0x3a')][_0x6d84('0x24')]);_0x138e78[_0x6d84('0x22')]=qs['offset'](_0xe0eaf[_0x6d84('0x3a')][_0x6d84('0x22')]);}return _0x1ddd8b[_0x6d84('0x99')](_0x138e78);}})[_0x6d84('0x33')](function(_0x5bc365){if(_0x5bc365){return _0x5bc365?{'count':_0x1d284e,'rows':_0x5bc365}:null;}})[_0x6d84('0x33')](respondWithResult(_0x271497,null))['catch'](handleError(_0x271497,null));};exports['getMembers']=function(_0x45380d,_0x4852d6,_0x279b61){var _0x11c98e={};var _0xcbe1e6={};var _0xc00459;var _0x2ff575;return db[_0x6d84('0x37')][_0x6d84('0x64')]({'where':{'id':_0x45380d[_0x6d84('0x58')]['id']}})[_0x6d84('0x33')](handleEntityNotFound(_0x4852d6,null))[_0x6d84('0x33')](function(_0x5e5f5c){if(_0x5e5f5c){_0xc00459=_0x5e5f5c;_0xcbe1e6[_0x6d84('0x39')]=_[_0x6d84('0x3b')](db['UserVoiceQueueRt'][_0x6d84('0x4c')]);_0xcbe1e6['query']=_[_0x6d84('0x3b')](_0x45380d['query']);_0xcbe1e6[_0x6d84('0x3c')]=_['intersection'](_0xcbe1e6[_0x6d84('0x39')],_0xcbe1e6[_0x6d84('0x3a')]);_0x11c98e[_0x6d84('0x3e')]=_[_0x6d84('0x3d')](_0xcbe1e6[_0x6d84('0x39')],qs[_0x6d84('0x3f')](_0x45380d['query']['fields']));_0x11c98e[_0x6d84('0x3e')]=_0x11c98e['attributes'][_0x6d84('0x40')]?_0x11c98e[_0x6d84('0x3e')]:_0xcbe1e6[_0x6d84('0x39')];_0x11c98e['order']=qs[_0x6d84('0x42')](_0x45380d[_0x6d84('0x3a')][_0x6d84('0x42')]);_0x11c98e[_0x6d84('0x43')]=qs['filters'](_['pick'](_0x45380d[_0x6d84('0x3a')],_0xcbe1e6['filters']));if(_0x45380d['query'][_0x6d84('0x2d')]){_0x11c98e[_0x6d84('0x43')]=_['merge'](_0x11c98e['where'],{'$or':_[_0x6d84('0x2e')](_0x11c98e[_0x6d84('0x3e')],function(_0x1a6c47){var _0x134081={};_0x134081[_0x1a6c47]={'$like':'%'+_0x45380d[_0x6d84('0x3a')][_0x6d84('0x2d')]+'%'};return _0x134081;})});}_0x11c98e=_[_0x6d84('0x45')]({},_0x11c98e,_0x45380d['options']);return _0xc00459[_0x6d84('0x9a')](_0x11c98e);}})[_0x6d84('0x33')](function(_0x25fd18){if(_0x25fd18){_0x2ff575=_0x25fd18[_0x6d84('0x40')];if(!_0x45380d['query']['hasOwnProperty']('nolimit')){_0x11c98e['limit']=qs[_0x6d84('0x24')](_0x45380d[_0x6d84('0x3a')]['limit']);_0x11c98e['offset']=qs[_0x6d84('0x22')](_0x45380d[_0x6d84('0x3a')][_0x6d84('0x22')]);}return _0xc00459[_0x6d84('0x9a')](_0x11c98e);}})[_0x6d84('0x33')](function(_0x858cc1){return _0x858cc1?{'count':_0x2ff575,'rows':_0x858cc1}:null;})['then'](respondWithResult(_0x4852d6,null))[_0x6d84('0x55')](handleError(_0x4852d6,null));};exports[_0x6d84('0x9b')]=function(_0xad92cf,_0xab54ed,_0xf63334){var _0x4f31b3={};var _0x46bc14={};var _0x22ccd4;var _0x188b29;return db['VoiceQueue'][_0x6d84('0x64')]({'where':{'id':_0xad92cf['params']['id']}})[_0x6d84('0x33')](handleEntityNotFound(_0xab54ed,null))['then'](function(_0x1a4e18){if(_0x1a4e18){_0x22ccd4=_0x1a4e18;_0x46bc14[_0x6d84('0x39')]=_[_0x6d84('0x3b')](db[_0x6d84('0x9c')][_0x6d84('0x4c')]);_0x46bc14[_0x6d84('0x3a')]=_[_0x6d84('0x3b')](_0xad92cf[_0x6d84('0x3a')]);_0x46bc14[_0x6d84('0x3c')]=_['intersection'](_0x46bc14[_0x6d84('0x39')],_0x46bc14[_0x6d84('0x3a')]);_0x4f31b3['attributes']=_[_0x6d84('0x3d')](_0x46bc14[_0x6d84('0x39')],qs['fields'](_0xad92cf[_0x6d84('0x3a')][_0x6d84('0x3f')]));_0x4f31b3[_0x6d84('0x3e')]=_0x4f31b3[_0x6d84('0x3e')][_0x6d84('0x40')]?_0x4f31b3[_0x6d84('0x3e')]:_0x46bc14[_0x6d84('0x39')];_0x4f31b3[_0x6d84('0x60')]=qs[_0x6d84('0x42')](_0xad92cf[_0x6d84('0x3a')][_0x6d84('0x42')]);_0x4f31b3[_0x6d84('0x43')]=qs['filters'](_[_0x6d84('0x44')](_0xad92cf[_0x6d84('0x3a')],_0x46bc14[_0x6d84('0x3c')]));if(_0xad92cf[_0x6d84('0x3a')][_0x6d84('0x2d')]){_0x4f31b3[_0x6d84('0x43')]=_['merge'](_0x4f31b3[_0x6d84('0x43')],{'$or':_[_0x6d84('0x2e')](_0x4f31b3[_0x6d84('0x3e')],function(_0x14c6aa){var _0x1141f8={};_0x1141f8[_0x14c6aa]={'$like':'%'+_0xad92cf[_0x6d84('0x3a')][_0x6d84('0x2d')]+'%'};return _0x1141f8;})});}_0x4f31b3=_['merge']({},_0x4f31b3,_0xad92cf[_0x6d84('0x47')]);return _0x22ccd4[_0x6d84('0x9b')](_0x4f31b3);}})[_0x6d84('0x33')](function(_0x3c400d){if(_0x3c400d){_0x188b29=_0x3c400d[_0x6d84('0x40')];if(!_0xad92cf[_0x6d84('0x3a')]['hasOwnProperty'](_0x6d84('0x5f'))){_0x4f31b3[_0x6d84('0x24')]=qs[_0x6d84('0x24')](_0xad92cf[_0x6d84('0x3a')][_0x6d84('0x24')]);_0x4f31b3[_0x6d84('0x22')]=qs['offset'](_0xad92cf[_0x6d84('0x3a')][_0x6d84('0x22')]);}return _0x22ccd4[_0x6d84('0x9b')](_0x4f31b3);}})['then'](function(_0x1857b0){if(_0x1857b0){return _0x1857b0?{'count':_0x188b29,'rows':_0x1857b0}:null;}})[_0x6d84('0x33')](respondWithResult(_0xab54ed,null))['catch'](handleError(_0xab54ed,null));};exports['addLists']=function(_0x47cd4b,_0x4cca36,_0x417ba1){var _0x167f6c,_0x25f6d5;return db['VoiceQueue'][_0x6d84('0x52')]({'where':{'id':_0x47cd4b[_0x6d84('0x58')]['id']}})[_0x6d84('0x33')](handleEntityNotFound(_0x4cca36,null))[_0x6d84('0x33')](function(_0x4f69a2){if(_0x4f69a2){_0x25f6d5=_0x4f69a2;return _0x4f69a2[_0x6d84('0x9d')](_0x47cd4b[_0x6d84('0x5b')][_0x6d84('0x7b')],_['omit'](_0x47cd4b[_0x6d84('0x5b')],[_0x6d84('0x7b'),'id'])||{});}return null;})['spread'](function(_0x296c60){var _0x52e721;_0x167f6c=_0x296c60||[];var _0x660bf3=[];if(_0x296c60){for(var _0x84d592=0x0;_0x84d592<_0x296c60[_0x6d84('0x40')];_0x84d592+=0x1){var _0x2e233c=_0x296c60[_0x84d592][_0x6d84('0x28')]({'plain':!![]});_0x25f6d5[_0x6d84('0x9e')]=_0x47cd4b[_0x6d84('0x5b')]['dialCheckDuplicateType']?_0x47cd4b['body'][_0x6d84('0x9e')]:_0x25f6d5['dialCheckDuplicateType'];switch(_0x25f6d5[_0x6d84('0x9e')]){case _0x6d84('0x9f'):_0x52e721=squel['insert']()[_0x6d84('0xa0')]('cm_hopper')[_0x6d84('0xa1')]([_0x6d84('0xa2'),_0x6d84('0xa3'),'ContactId',_0x6d84('0xa4'),'VoiceQueueId',_0x6d84('0x5a'),_0x6d84('0xa5')],squel[_0x6d84('0x7c')]()[_0x6d84('0x7d')]('phone',_0x6d84('0xa2'))[_0x6d84('0x7d')](_0x6d84('0xa6'),_0x6d84('0xa3'))[_0x6d84('0x7d')]('id',_0x6d84('0xa7'))[_0x6d84('0x7d')](_0x2e233c['CmListId'][_0x6d84('0x87')](),_0x6d84('0xa4'))[_0x6d84('0x7d')](_0x47cd4b[_0x6d84('0x58')]['id'][_0x6d84('0x87')](),_0x6d84('0x61'))['field'](_0x6d84('0xa6'),_0x6d84('0x5a'))[_0x6d84('0x7d')]('NOW()',_0x6d84('0xa5'))[_0x6d84('0x7f')](_0x6d84('0xa8'))[_0x6d84('0x43')](_0x6d84('0xa9'))[_0x6d84('0x43')](_0x6d84('0xaa'),_0x2e233c[_0x6d84('0xab')][_0x6d84('0x87')]())[_0x6d84('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0x6d84('0x43')](_0x6d84('0xac'),squel[_0x6d84('0x7c')]()[_0x6d84('0x7d')](_0x6d84('0xad'))[_0x6d84('0x7f')](_0x6d84('0xae'))[_0x6d84('0x43')](_0x6d84('0x84'),_0x47cd4b['params']['id'][_0x6d84('0x87')]()))['where'](_0x6d84('0xac'),squel['select']()[_0x6d84('0x7d')](_0x6d84('0xaf'))[_0x6d84('0x7f')](_0x6d84('0xb0'))['where'](_0x6d84('0x84'),_0x47cd4b[_0x6d84('0x58')]['id'][_0x6d84('0x87')]())))[_0x6d84('0x87')]();break;case _0x6d84('0xb1'):_0x52e721=squel[_0x6d84('0xb2')]()[_0x6d84('0xa0')]('cm_hopper')[_0x6d84('0xa1')](['phone',_0x6d84('0xa3'),_0x6d84('0xa7'),_0x6d84('0xa4'),_0x6d84('0x61'),'createdAt',_0x6d84('0xa5')],squel[_0x6d84('0x7c')]()[_0x6d84('0x7d')](_0x6d84('0xa2'),'phone')[_0x6d84('0x7d')](_0x6d84('0xa6'),_0x6d84('0xa3'))[_0x6d84('0x7d')]('id',_0x6d84('0xa7'))[_0x6d84('0x7d')](_0x2e233c[_0x6d84('0xab')][_0x6d84('0x87')](),_0x6d84('0xa4'))[_0x6d84('0x7d')](_0x47cd4b['params']['id'][_0x6d84('0x87')](),_0x6d84('0x61'))[_0x6d84('0x7d')](_0x6d84('0xa6'),_0x6d84('0x5a'))[_0x6d84('0x7d')](_0x6d84('0xa6'),_0x6d84('0xa5'))[_0x6d84('0x7f')]('cm_contacts')[_0x6d84('0x43')]('deletedAt\x20IS\x20NULL')[_0x6d84('0x43')](_0x6d84('0xaa'),_0x2e233c[_0x6d84('0xab')][_0x6d84('0x87')]())[_0x6d84('0x43')](_0x6d84('0xb3'))[_0x6d84('0x43')](_0x6d84('0xac'),squel[_0x6d84('0x7c')]()['field'](_0x6d84('0xaf'))[_0x6d84('0x7f')](_0x6d84('0xb0'))[_0x6d84('0x43')](_0x6d84('0x84'),_0x47cd4b['params']['id']['toString']())))[_0x6d84('0x87')]();break;default:_0x52e721=squel[_0x6d84('0xb2')]()[_0x6d84('0xa0')](_0x6d84('0xb0'))[_0x6d84('0xa1')]([_0x6d84('0xa2'),_0x6d84('0xa3'),_0x6d84('0xa7'),_0x6d84('0xa4'),_0x6d84('0x61'),_0x6d84('0x5a'),'updatedAt'],squel[_0x6d84('0x7c')]()[_0x6d84('0x7d')]('phone',_0x6d84('0xa2'))[_0x6d84('0x7d')](_0x6d84('0xa6'),_0x6d84('0xa3'))[_0x6d84('0x7d')]('id',_0x6d84('0xa7'))[_0x6d84('0x7d')](_0x2e233c['CmListId']['toString'](),'ListId')[_0x6d84('0x7d')](_0x47cd4b[_0x6d84('0x58')]['id'][_0x6d84('0x87')](),_0x6d84('0x61'))['field'](_0x6d84('0xa6'),_0x6d84('0x5a'))[_0x6d84('0x7d')](_0x6d84('0xa6'),_0x6d84('0xa5'))[_0x6d84('0x7f')](_0x6d84('0xa8'))['where'](_0x6d84('0xa9'))[_0x6d84('0x43')](_0x6d84('0xaa'),_0x2e233c[_0x6d84('0xab')]['toString']())[_0x6d84('0x43')](_0x6d84('0xb3')))['toString']();}_0x660bf3[_0x6d84('0x93')](db[_0x6d84('0x86')][_0x6d84('0x3a')](_0x52e721));}return BPromise[_0x6d84('0x8a')](_0x660bf3);}})[_0x6d84('0x33')](function(){return _0x167f6c;})[_0x6d84('0x33')](respondWithResult(_0x4cca36,null))[_0x6d84('0x55')](handleError(_0x4cca36,null));};exports[_0x6d84('0xb4')]=function(_0x315779,_0x2ac886,_0x4c0116){return db['VoiceQueue'][_0x6d84('0x52')]({'where':{'id':_0x315779[_0x6d84('0x58')]['id']}})[_0x6d84('0x33')](handleEntityNotFound(_0x2ac886,null))[_0x6d84('0x33')](function(_0x13826f){if(_0x13826f){return _0x13826f[_0x6d84('0xb4')](_0x315779[_0x6d84('0x3a')]['ids']);}})[_0x6d84('0x33')](function(_0x4cb763){if(_0x4cb763){return db[_0x6d84('0x5e')][_0x6d84('0x27')]({'where':{'ListId':_0x315779[_0x6d84('0x3a')][_0x6d84('0x7b')],'VoiceQueueId':_0x315779['params']['id']}})[_0x6d84('0x33')](function(){return _0x4cb763;});}})[_0x6d84('0x33')](respondWithStatusCode(_0x2ac886,null))[_0x6d84('0x55')](handleError(_0x2ac886,null));};exports['getBlackLists']=function(_0x24914a,_0x2b9fe9,_0x11424c){var _0x503ef1={};var _0xd33469={};var _0x204d07;var _0x1db7fe;return db[_0x6d84('0x37')][_0x6d84('0x64')]({'where':{'id':_0x24914a[_0x6d84('0x58')]['id']}})[_0x6d84('0x33')](handleEntityNotFound(_0x2b9fe9,null))[_0x6d84('0x33')](function(_0x5b5304){if(_0x5b5304){_0x204d07=_0x5b5304;_0xd33469[_0x6d84('0x39')]=_[_0x6d84('0x3b')](db[_0x6d84('0x9c')][_0x6d84('0x4c')]);_0xd33469['query']=_[_0x6d84('0x3b')](_0x24914a[_0x6d84('0x3a')]);_0xd33469[_0x6d84('0x3c')]=_[_0x6d84('0x3d')](_0xd33469['model'],_0xd33469[_0x6d84('0x3a')]);_0x503ef1[_0x6d84('0x3e')]=_[_0x6d84('0x3d')](_0xd33469[_0x6d84('0x39')],qs['fields'](_0x24914a['query'][_0x6d84('0x3f')]));_0x503ef1[_0x6d84('0x3e')]=_0x503ef1['attributes'][_0x6d84('0x40')]?_0x503ef1['attributes']:_0xd33469[_0x6d84('0x39')];_0x503ef1['order']=qs[_0x6d84('0x42')](_0x24914a['query']['sort']);_0x503ef1[_0x6d84('0x43')]=qs[_0x6d84('0x3c')](_['pick'](_0x24914a['query'],_0xd33469[_0x6d84('0x3c')]));if(_0x24914a[_0x6d84('0x3a')][_0x6d84('0x2d')]){_0x503ef1['where']=_[_0x6d84('0x45')](_0x503ef1[_0x6d84('0x43')],{'$or':_[_0x6d84('0x2e')](_0x503ef1['attributes'],function(_0x3d2dea){var _0x141e5a={};_0x141e5a[_0x3d2dea]={'$like':'%'+_0x24914a[_0x6d84('0x3a')][_0x6d84('0x2d')]+'%'};return _0x141e5a;})});}_0x503ef1=_['merge']({},_0x503ef1,_0x24914a[_0x6d84('0x47')]);return _0x204d07[_0x6d84('0xb5')](_0x503ef1);}})[_0x6d84('0x33')](function(_0x1c7ec5){if(_0x1c7ec5){_0x1db7fe=_0x1c7ec5[_0x6d84('0x40')];if(!_0x24914a[_0x6d84('0x3a')][_0x6d84('0x41')]('nolimit')){_0x503ef1[_0x6d84('0x24')]=qs[_0x6d84('0x24')](_0x24914a[_0x6d84('0x3a')][_0x6d84('0x24')]);_0x503ef1[_0x6d84('0x22')]=qs[_0x6d84('0x22')](_0x24914a[_0x6d84('0x3a')]['offset']);}return _0x204d07[_0x6d84('0xb5')](_0x503ef1);}})[_0x6d84('0x33')](function(_0x6d8ed0){if(_0x6d8ed0){return _0x6d8ed0?{'count':_0x1db7fe,'rows':_0x6d8ed0}:null;}})[_0x6d84('0x33')](respondWithResult(_0x2b9fe9,null))['catch'](handleError(_0x2b9fe9,null));};exports[_0x6d84('0xb6')]=function(_0x36b5cd,_0x4a56fd,_0x6ec72a){var _0x373e87,_0x2b0629;return db[_0x6d84('0x37')][_0x6d84('0x52')]({'where':{'id':_0x36b5cd[_0x6d84('0x58')]['id']}})['then'](handleEntityNotFound(_0x4a56fd,null))[_0x6d84('0x33')](function(_0x1d1b70){if(_0x1d1b70){_0x2b0629=_0x1d1b70;return _0x1d1b70[_0x6d84('0xb6')](_0x36b5cd['body'][_0x6d84('0x7b')],_[_0x6d84('0x59')](_0x36b5cd[_0x6d84('0x5b')],[_0x6d84('0x7b'),'id'])||{});}return null;})['spread'](function(_0x238116){var _0x5dd42e;_0x373e87=_0x238116||[];var _0x84f8d0=[];if(_0x238116){for(var _0x11cf69=0x0;_0x11cf69<_0x238116[_0x6d84('0x40')];_0x11cf69+=0x1){var _0x1c2598=_0x238116[_0x11cf69]['get']({'plain':!![]});_0x5dd42e=squel[_0x6d84('0xb2')]()[_0x6d84('0xa0')](_0x6d84('0xb7'))[_0x6d84('0xa1')]([_0x6d84('0xa2'),_0x6d84('0xa7'),'ListId','VoiceQueueId',_0x6d84('0x5a'),_0x6d84('0xa5')],squel[_0x6d84('0x7c')]()[_0x6d84('0x7d')](_0x6d84('0xa2'),_0x6d84('0xa2'))[_0x6d84('0x7d')]('id',_0x6d84('0xa7'))['field'](_0x1c2598[_0x6d84('0xab')][_0x6d84('0x87')](),'ListId')[_0x6d84('0x7d')](_0x36b5cd[_0x6d84('0x58')]['id'][_0x6d84('0x87')](),'VoiceQueueId')[_0x6d84('0x7d')](_0x6d84('0xa6'),_0x6d84('0x5a'))[_0x6d84('0x7d')](_0x6d84('0xa6'),_0x6d84('0xa5'))[_0x6d84('0x7f')]('cm_contacts')['where'](_0x6d84('0xa9'))[_0x6d84('0x43')]('ListId\x20=\x20?',_0x1c2598[_0x6d84('0xab')][_0x6d84('0x87')]())[_0x6d84('0x43')](_0x6d84('0xb3')))['toString']();_0x84f8d0[_0x6d84('0x93')](db['sequelize']['query'](_0x5dd42e));}return BPromise[_0x6d84('0x8a')](_0x84f8d0);}})['then'](function(){return _0x373e87;})[_0x6d84('0x33')](respondWithResult(_0x4a56fd,null))[_0x6d84('0x55')](handleError(_0x4a56fd,null));};exports[_0x6d84('0xb8')]=function(_0x4b8358,_0x897928,_0x254448){return db[_0x6d84('0x37')][_0x6d84('0x52')]({'where':{'id':_0x4b8358['params']['id']}})[_0x6d84('0x33')](handleEntityNotFound(_0x897928,null))[_0x6d84('0x33')](function(_0x1e2da9){if(_0x1e2da9){return _0x1e2da9['removeBlackLists'](_0x4b8358['query'][_0x6d84('0x7b')]);}})[_0x6d84('0x33')](function(_0xa4fc4a){if(_0xa4fc4a){return db[_0x6d84('0x69')][_0x6d84('0x27')]({'where':{'ListId':_0x4b8358[_0x6d84('0x3a')][_0x6d84('0x7b')],'VoiceQueueId':_0x4b8358[_0x6d84('0x58')]['id']}})[_0x6d84('0x33')](function(){return _0xa4fc4a;});}})[_0x6d84('0x33')](respondWithStatusCode(_0x897928,null))['catch'](handleError(_0x897928,null));}; \ No newline at end of file +var _0xfc66=['CmHopper','nolimit','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','teams','online','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','VoiceQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','ids','removeAgents','userVoiceQueue:remove','addAgents','spread','User','isEmpty','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','phone','NOW()','scheduledAt','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','cm_hopper','ContactId','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','inbound','outbound','filter','ignore','map','value','type','find','name','UserProfileResource','error','index','VoiceQueue','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','create','user','get','role','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','QueueCampaigns','params','getHoppers','findOne'];(function(_0x2b7627,_0x326fb8){var _0x3a2ba8=function(_0x2d7c0e){while(--_0x2d7c0e){_0x2b7627['push'](_0x2b7627['shift']());}};_0x3a2ba8(++_0x326fb8);}(_0xfc66,0x1c5));var _0x6fc6=function(_0x2faf90,_0x4a4e13){_0x2faf90=_0x2faf90-0x0;var _0x1cd022=_0xfc66[_0x2faf90];return _0x1cd022;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6fc6('0x0'));var zipdir=require(_0x6fc6('0x1'));var jsonpatch=require(_0x6fc6('0x2'));var rp=require(_0x6fc6('0x3'));var moment=require(_0x6fc6('0x4'));var BPromise=require(_0x6fc6('0x5'));var Mustache=require(_0x6fc6('0x6'));var util=require(_0x6fc6('0x7'));var path=require(_0x6fc6('0x8'));var sox=require(_0x6fc6('0x9'));var csv=require(_0x6fc6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6fc6('0xb'));var _=require('lodash');var squel=require(_0x6fc6('0xc'));var crypto=require(_0x6fc6('0xd'));var jsforce=require(_0x6fc6('0xe'));var deskjs=require(_0x6fc6('0xf'));var toCsv=require(_0x6fc6('0xa'));var querystring=require(_0x6fc6('0x10'));var Papa=require('papaparse');var Redis=require(_0x6fc6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6fc6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6fc6('0x13'));var logger=require(_0x6fc6('0x14'))(_0x6fc6('0x15'));var utils=require(_0x6fc6('0x16'));var config=require(_0x6fc6('0x17'));var licenseUtil=require(_0x6fc6('0x18'));var db=require(_0x6fc6('0x19'))['db'];config[_0x6fc6('0x1a')]=_['defaults'](config[_0x6fc6('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x6fc6('0x1b'))(new Redis(config[_0x6fc6('0x1a')]));require(_0x6fc6('0x1c'))[_0x6fc6('0x1d')](socket);function respondWithStatusCode(_0x51ecf3,_0x2f4e54){_0x2f4e54=_0x2f4e54||0xcc;return function(_0xac00ae){if(_0xac00ae){return _0x51ecf3[_0x6fc6('0x1e')](_0x2f4e54);}return _0x51ecf3['status'](_0x2f4e54)[_0x6fc6('0x1f')]();};}function respondWithResult(_0x43a7a4,_0xc2536e){_0xc2536e=_0xc2536e||0xc8;return function(_0x2b1347){if(_0x2b1347){return _0x43a7a4[_0x6fc6('0x20')](_0xc2536e)[_0x6fc6('0x21')](_0x2b1347);}};}function respondWithFilteredResult(_0x3d2329,_0xda82ba){return function(_0x1f7792){if(_0x1f7792){var _0x3acf92=typeof _0xda82ba[_0x6fc6('0x22')]==='undefined'&&typeof _0xda82ba[_0x6fc6('0x23')]===_0x6fc6('0x24');var _0x5ed2c9=_0x1f7792[_0x6fc6('0x25')];var _0x326c66=_0x3acf92?0x0:_0xda82ba[_0x6fc6('0x22')];var _0x50e17a=_0x3acf92?_0x1f7792[_0x6fc6('0x25')]:_0xda82ba[_0x6fc6('0x22')]+_0xda82ba['limit'];var _0x194db2;if(_0x50e17a>=_0x5ed2c9){_0x50e17a=_0x5ed2c9;_0x194db2=0xc8;}else{_0x194db2=0xce;}_0x3d2329[_0x6fc6('0x20')](_0x194db2);return _0x3d2329[_0x6fc6('0x26')](_0x6fc6('0x27'),_0x326c66+'-'+_0x50e17a+'/'+_0x5ed2c9)['json'](_0x1f7792);}return null;};}function patchUpdates(_0x5d66cf){return function(_0x5f5ba1){try{jsonpatch['apply'](_0x5f5ba1,_0x5d66cf,!![]);}catch(_0x5189d3){return BPromise[_0x6fc6('0x28')](_0x5189d3);}return _0x5f5ba1['save']();};}function saveUpdates(_0x152bd8,_0x14177a){return function(_0x36da4c){if(_0x36da4c){return _0x36da4c[_0x6fc6('0x29')](_0x152bd8)[_0x6fc6('0x2a')](function(_0x57e443){return _0x57e443;});}return null;};}function removeEntity(_0xb2b654,_0xa73852){return function(_0x213cbf){if(_0x213cbf){return _0x213cbf[_0x6fc6('0x2b')]()[_0x6fc6('0x2a')](function(){var _0x46e297=_0x213cbf['get']({'plain':!![]});var _0x15ca0a=[{'name':'VoiceQueues','value':_0x6fc6('0x2c'),'ignore':![]},{'name':'QueueCampaigns','value':_0x6fc6('0x2d'),'ignore':![]}];var _0x2dedee=_(_0x15ca0a)[_0x6fc6('0x2e')](_0x6fc6('0x2f'))[_0x6fc6('0x30')](_0x6fc6('0x31'))['value']();if(_['includes'](_0x2dedee,_0x46e297[_0x6fc6('0x32')])){return;}var _0x5b38ee=_[_0x6fc6('0x33')](_0x15ca0a,[_0x6fc6('0x31'),_0x46e297[_0x6fc6('0x32')]])[_0x6fc6('0x34')];return db[_0x6fc6('0x35')][_0x6fc6('0x2b')]({'where':{'type':_0x5b38ee,'resourceId':_0x46e297['id']}})[_0x6fc6('0x2a')](function(){return _0x213cbf;});})[_0x6fc6('0x2a')](function(){_0xb2b654['status'](0xcc)[_0x6fc6('0x1f')]();});}};}function handleEntityNotFound(_0x395ea0,_0x4e8c24){return function(_0x4e001a){if(!_0x4e001a){_0x395ea0[_0x6fc6('0x1e')](0x194);}return _0x4e001a;};}function handleError(_0x490c59,_0x2be92f){_0x2be92f=_0x2be92f||0x1f4;return function(_0x3856fd){logger[_0x6fc6('0x36')](_0x3856fd['stack']);if(_0x3856fd[_0x6fc6('0x34')]){delete _0x3856fd['name'];}_0x490c59['status'](_0x2be92f)['send'](_0x3856fd);};}exports[_0x6fc6('0x37')]=function(_0x2d35e1,_0x5e58bc){var _0x4d90f9={},_0x3745f6={},_0x165a29={'count':0x0,'rows':[]};var _0x5c7b93=_[_0x6fc6('0x30')](db[_0x6fc6('0x38')][_0x6fc6('0x39')],function(_0x693f47){return{'name':_0x693f47[_0x6fc6('0x3a')],'type':_0x693f47['type']['key']};});_0x3745f6[_0x6fc6('0x3b')]=_[_0x6fc6('0x30')](_0x5c7b93,'name');_0x3745f6['query']=_['keys'](_0x2d35e1[_0x6fc6('0x3c')]);_0x3745f6[_0x6fc6('0x3d')]=_[_0x6fc6('0x3e')](_0x3745f6[_0x6fc6('0x3b')],_0x3745f6[_0x6fc6('0x3c')]);_0x4d90f9[_0x6fc6('0x3f')]=_[_0x6fc6('0x3e')](_0x3745f6[_0x6fc6('0x3b')],qs['fields'](_0x2d35e1[_0x6fc6('0x3c')][_0x6fc6('0x40')]));_0x4d90f9['attributes']=_0x4d90f9['attributes'][_0x6fc6('0x41')]?_0x4d90f9[_0x6fc6('0x3f')]:_0x3745f6[_0x6fc6('0x3b')];if(!_0x2d35e1['query'][_0x6fc6('0x42')]('nolimit')){_0x4d90f9['limit']=qs[_0x6fc6('0x23')](_0x2d35e1[_0x6fc6('0x3c')]['limit']);_0x4d90f9[_0x6fc6('0x22')]=qs['offset'](_0x2d35e1[_0x6fc6('0x3c')]['offset']);}_0x4d90f9[_0x6fc6('0x43')]=qs[_0x6fc6('0x44')](_0x2d35e1[_0x6fc6('0x3c')]['sort']);_0x4d90f9[_0x6fc6('0x45')]=qs[_0x6fc6('0x3d')](_[_0x6fc6('0x46')](_0x2d35e1[_0x6fc6('0x3c')],_0x3745f6[_0x6fc6('0x3d')]),_0x5c7b93);if(_0x2d35e1[_0x6fc6('0x3c')]['filter']){_0x4d90f9[_0x6fc6('0x45')]=_[_0x6fc6('0x47')](_0x4d90f9[_0x6fc6('0x45')],{'$or':_[_0x6fc6('0x30')](_0x5c7b93,function(_0x2dc197){if(_0x2dc197[_0x6fc6('0x32')]!==_0x6fc6('0x48')){var _0x58940b={};_0x58940b[_0x2dc197[_0x6fc6('0x34')]]={'$like':'%'+_0x2d35e1[_0x6fc6('0x3c')][_0x6fc6('0x2e')]+'%'};return _0x58940b;}})});}_0x4d90f9=_[_0x6fc6('0x47')]({},_0x4d90f9,_0x2d35e1[_0x6fc6('0x49')]);var _0x52a23c={'where':_0x4d90f9['where']};return db[_0x6fc6('0x38')][_0x6fc6('0x25')](_0x52a23c)[_0x6fc6('0x2a')](function(_0x49ca68){_0x165a29['count']=_0x49ca68;if(_0x2d35e1[_0x6fc6('0x3c')]['includeAll']){_0x4d90f9[_0x6fc6('0x4a')]=[{'all':!![]}];}return db[_0x6fc6('0x38')][_0x6fc6('0x4b')](_0x4d90f9);})[_0x6fc6('0x2a')](function(_0x36bf3d){_0x165a29[_0x6fc6('0x4c')]=_0x36bf3d;return _0x165a29;})[_0x6fc6('0x2a')](respondWithFilteredResult(_0x5e58bc,_0x4d90f9))[_0x6fc6('0x4d')](handleError(_0x5e58bc,null));};exports[_0x6fc6('0x4e')]=function(_0x1448fd,_0x2ca236){var _0xcee1e8={'raw':![],'where':{'id':_0x1448fd['params']['id']}},_0x364a3f={};_0x364a3f['model']=_[_0x6fc6('0x4f')](db[_0x6fc6('0x38')][_0x6fc6('0x39')]);_0x364a3f[_0x6fc6('0x3c')]=_[_0x6fc6('0x4f')](_0x1448fd[_0x6fc6('0x3c')]);_0x364a3f[_0x6fc6('0x3d')]=_[_0x6fc6('0x3e')](_0x364a3f[_0x6fc6('0x3b')],_0x364a3f['query']);_0xcee1e8['attributes']=_[_0x6fc6('0x3e')](_0x364a3f[_0x6fc6('0x3b')],qs['fields'](_0x1448fd[_0x6fc6('0x3c')][_0x6fc6('0x40')]));_0xcee1e8[_0x6fc6('0x3f')]=_0xcee1e8[_0x6fc6('0x3f')][_0x6fc6('0x41')]?_0xcee1e8[_0x6fc6('0x3f')]:_0x364a3f[_0x6fc6('0x3b')];if(_0x1448fd['query'][_0x6fc6('0x50')]){_0xcee1e8[_0x6fc6('0x4a')]=[{'all':!![]}];}_0xcee1e8=_[_0x6fc6('0x47')]({},_0xcee1e8,_0x1448fd[_0x6fc6('0x49')]);return db['VoiceQueue'][_0x6fc6('0x33')](_0xcee1e8)[_0x6fc6('0x2a')](handleEntityNotFound(_0x2ca236,null))[_0x6fc6('0x2a')](respondWithResult(_0x2ca236,null))[_0x6fc6('0x4d')](handleError(_0x2ca236,null));};exports[_0x6fc6('0x51')]=function(_0x1e8524,_0x249cfc){return db[_0x6fc6('0x38')][_0x6fc6('0x51')](_0x1e8524['body'],{})[_0x6fc6('0x2a')](function(_0x2ad10e){var _0x486c60=_0x1e8524[_0x6fc6('0x52')][_0x6fc6('0x53')]({'plain':!![]});if(!_0x486c60)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x486c60[_0x6fc6('0x54')]===_0x6fc6('0x52')){var _0x41be50=_0x2ad10e['get']({'plain':!![]});var _0x173abc=[{'name':_0x6fc6('0x55'),'value':_0x6fc6('0x2c')},{'name':'QueueCampaigns','value':'outbound'}];var _0x50d9be=_[_0x6fc6('0x33')](_0x173abc,[_0x6fc6('0x31'),_0x41be50['type']])[_0x6fc6('0x34')];return db[_0x6fc6('0x56')]['find']({'where':{'name':_0x50d9be,'userProfileId':_0x486c60[_0x6fc6('0x57')]},'raw':!![]})[_0x6fc6('0x2a')](function(_0x471f71){if(_0x471f71&&_0x471f71[_0x6fc6('0x58')]===0x0){return db[_0x6fc6('0x35')][_0x6fc6('0x51')]({'name':_0x41be50[_0x6fc6('0x34')],'resourceId':_0x41be50['id'],'type':_0x471f71[_0x6fc6('0x34')],'sectionId':_0x471f71['id']},{})[_0x6fc6('0x2a')](function(){return _0x2ad10e;});}else{return _0x2ad10e;}})[_0x6fc6('0x4d')](function(_0x396108){logger['error'](_0x6fc6('0x59'),_0x396108);throw _0x396108;});}return _0x2ad10e;})[_0x6fc6('0x2a')](respondWithResult(_0x249cfc,0xc9))[_0x6fc6('0x4d')](handleError(_0x249cfc,null));};exports['clone']=function(_0xc37187,_0x3e6b8d){var _0x5aa096={'where':{'id':_0xc37187['params']['id']}},_0x52211e={};_0x52211e[_0x6fc6('0x3b')]=_['keys'](db[_0x6fc6('0x38')][_0x6fc6('0x39')]);_0x5aa096[_0x6fc6('0x3f')]=_[_0x6fc6('0x3e')](_0x52211e[_0x6fc6('0x3b')],qs[_0x6fc6('0x40')](_0xc37187[_0x6fc6('0x3c')][_0x6fc6('0x40')]));_0x5aa096[_0x6fc6('0x3f')]=_0x5aa096[_0x6fc6('0x3f')][_0x6fc6('0x41')]?_0x5aa096[_0x6fc6('0x3f')]:_0x52211e['model'];if(_0xc37187[_0x6fc6('0x3c')][_0x6fc6('0x50')]){_0x5aa096['include']=[{'all':!![]}];}_0x5aa096=_[_0x6fc6('0x47')]({},_0x5aa096,_0xc37187[_0x6fc6('0x49')]);return db[_0x6fc6('0x38')]['find'](_0x5aa096)['then'](handleEntityNotFound(_0x3e6b8d,null))[_0x6fc6('0x2a')](function(_0x328f70){if(_0x328f70){var _0xea235a=_0x328f70['get']({'plain':!![]});_0xea235a=qs[_0x6fc6('0x5a')](_0xea235a,['id',_0x6fc6('0x5b'),_0x6fc6('0x5c')]);_0xc37187[_0x6fc6('0x5d')]=_[_0x6fc6('0x5a')](_0xc37187['body'],['id',_0x6fc6('0x5b'),_0x6fc6('0x5c')]);return db['VoiceQueue'][_0x6fc6('0x51')](_[_0x6fc6('0x47')](_0xea235a,_0xc37187['body']),{'include':_0xc37187[_0x6fc6('0x3c')][_0x6fc6('0x50')]?[{'all':!![]}]:undefined})[_0x6fc6('0x2a')](function(_0x12d1fc){var _0x232273=_0xc37187[_0x6fc6('0x52')][_0x6fc6('0x53')]({'plain':!![]});if(!_0x232273)throw new Error(_0x6fc6('0x5e'));if(_0x232273[_0x6fc6('0x54')]===_0x6fc6('0x52')){var _0x5741ad=_0x12d1fc[_0x6fc6('0x53')]({'plain':!![]});var _0x4ff2f1=[{'name':_0x6fc6('0x55'),'value':_0x6fc6('0x2c')},{'name':_0x6fc6('0x5f'),'value':_0x6fc6('0x2d')}];var _0x5dc85c=_[_0x6fc6('0x33')](_0x4ff2f1,[_0x6fc6('0x31'),_0x5741ad[_0x6fc6('0x32')]])[_0x6fc6('0x34')];return db[_0x6fc6('0x56')]['find']({'where':{'name':_0x5dc85c,'userProfileId':_0x232273[_0x6fc6('0x57')]},'raw':!![]})[_0x6fc6('0x2a')](function(_0x48cc55){if(_0x48cc55&&_0x48cc55[_0x6fc6('0x58')]===0x0){return db[_0x6fc6('0x35')][_0x6fc6('0x51')]({'name':_0x5741ad[_0x6fc6('0x34')],'resourceId':_0x5741ad['id'],'type':_0x48cc55[_0x6fc6('0x34')],'sectionId':_0x48cc55['id']},{})['then'](function(){return _0x12d1fc;});}else{return _0x12d1fc;}})[_0x6fc6('0x4d')](function(_0xa2ac5f){logger['error'](_0x6fc6('0x59'),_0xa2ac5f);throw _0xa2ac5f;});}return _0x12d1fc;});}})['then'](respondWithResult(_0x3e6b8d,0xc9))[_0x6fc6('0x4d')](handleError(_0x3e6b8d,null));};exports[_0x6fc6('0x29')]=function(_0x1ed798,_0x2a22e1){if(_0x1ed798['body']['id']){delete _0x1ed798[_0x6fc6('0x5d')]['id'];}return db[_0x6fc6('0x38')][_0x6fc6('0x33')]({'where':{'id':_0x1ed798[_0x6fc6('0x60')]['id']}})['then'](handleEntityNotFound(_0x2a22e1,null))[_0x6fc6('0x2a')](saveUpdates(_0x1ed798[_0x6fc6('0x5d')],null))['then'](respondWithResult(_0x2a22e1,null))[_0x6fc6('0x4d')](handleError(_0x2a22e1,null));};exports['destroy']=function(_0x50d0c8,_0x49a9f8){return db[_0x6fc6('0x38')][_0x6fc6('0x33')]({'where':{'id':_0x50d0c8['params']['id']}})[_0x6fc6('0x2a')](handleEntityNotFound(_0x49a9f8,null))['then'](removeEntity(_0x49a9f8,null))['catch'](handleError(_0x49a9f8,null));};exports[_0x6fc6('0x61')]=function(_0x570fc6,_0xd564a9,_0xd6e2e0){var _0x1d253d={'raw':![],'where':{}};var _0x28d1ee={};var _0x2fd89b={'count':0x0,'rows':[]};return db[_0x6fc6('0x38')][_0x6fc6('0x62')]({'where':{'id':_0x570fc6[_0x6fc6('0x60')]['id']}})[_0x6fc6('0x2a')](handleEntityNotFound(_0xd564a9,null))[_0x6fc6('0x2a')](function(_0x5bf521){if(_0x5bf521){_0x28d1ee[_0x6fc6('0x3b')]=_[_0x6fc6('0x4f')](db[_0x6fc6('0x63')][_0x6fc6('0x39')]);_0x28d1ee[_0x6fc6('0x3c')]=_[_0x6fc6('0x4f')](_0x570fc6[_0x6fc6('0x3c')]);_0x28d1ee[_0x6fc6('0x3d')]=_['intersection'](_0x28d1ee[_0x6fc6('0x3b')],_0x28d1ee[_0x6fc6('0x3c')]);_0x1d253d[_0x6fc6('0x3f')]=_[_0x6fc6('0x3e')](_0x28d1ee[_0x6fc6('0x3b')],qs[_0x6fc6('0x40')](_0x570fc6['query']['fields']));_0x1d253d[_0x6fc6('0x3f')]=_0x1d253d[_0x6fc6('0x3f')][_0x6fc6('0x41')]?_0x1d253d[_0x6fc6('0x3f')]:_0x28d1ee[_0x6fc6('0x3b')];if(!_0x570fc6[_0x6fc6('0x3c')]['hasOwnProperty'](_0x6fc6('0x64'))){_0x1d253d[_0x6fc6('0x23')]=qs[_0x6fc6('0x23')](_0x570fc6[_0x6fc6('0x3c')][_0x6fc6('0x23')]);_0x1d253d[_0x6fc6('0x22')]=qs[_0x6fc6('0x22')](_0x570fc6['query']['offset']);}_0x1d253d[_0x6fc6('0x43')]=qs['sort'](_0x570fc6[_0x6fc6('0x3c')][_0x6fc6('0x44')]);_0x1d253d['where']=qs[_0x6fc6('0x3d')](_[_0x6fc6('0x46')](_0x570fc6[_0x6fc6('0x3c')],_0x28d1ee[_0x6fc6('0x3d')]));_0x1d253d[_0x6fc6('0x45')]['VoiceQueueId']=_0x5bf521['id'];if(_0x570fc6[_0x6fc6('0x3c')][_0x6fc6('0x2e')]){_0x1d253d[_0x6fc6('0x45')]=_[_0x6fc6('0x47')](_0x1d253d[_0x6fc6('0x45')],{'$or':_[_0x6fc6('0x30')](_0x1d253d[_0x6fc6('0x3f')],function(_0x2b8fe9){var _0x3f8333={};_0x3f8333[_0x2b8fe9]={'$like':'%'+_0x570fc6[_0x6fc6('0x3c')][_0x6fc6('0x2e')]+'%'};return _0x3f8333;})});}_0x1d253d=_[_0x6fc6('0x47')]({},_0x1d253d,_0x570fc6[_0x6fc6('0x49')]);return db[_0x6fc6('0x63')][_0x6fc6('0x25')]({'where':_0x1d253d[_0x6fc6('0x45')]})['then'](function(_0x818e80){_0x2fd89b[_0x6fc6('0x25')]=_0x818e80;if(_0x570fc6['query']['includeAll']){_0x1d253d[_0x6fc6('0x4a')]=[{'all':!![]}];}return db[_0x6fc6('0x63')][_0x6fc6('0x4b')](_0x1d253d);})[_0x6fc6('0x2a')](function(_0x4f9664){_0x2fd89b[_0x6fc6('0x4c')]=_0x4f9664;return _0x2fd89b;});}})['then'](respondWithFilteredResult(_0xd564a9,_0x1d253d))[_0x6fc6('0x4d')](handleError(_0xd564a9,null));};exports[_0x6fc6('0x65')]=function(_0x4b321e,_0x5b2dca,_0x5e2b38){var _0x3876d9={'raw':!![],'where':{}};var _0x17a966={};var _0x1333fe={'count':0x0,'rows':[]};return db[_0x6fc6('0x38')][_0x6fc6('0x62')]({'where':{'id':_0x4b321e[_0x6fc6('0x60')]['id']}})[_0x6fc6('0x2a')](handleEntityNotFound(_0x5b2dca,null))[_0x6fc6('0x2a')](function(_0x98694a){if(_0x98694a){_0x17a966[_0x6fc6('0x3b')]=_[_0x6fc6('0x4f')](db[_0x6fc6('0x66')][_0x6fc6('0x39')]);_0x17a966[_0x6fc6('0x3c')]=_[_0x6fc6('0x4f')](_0x4b321e[_0x6fc6('0x3c')]);_0x17a966[_0x6fc6('0x3d')]=_[_0x6fc6('0x3e')](_0x17a966[_0x6fc6('0x3b')],_0x17a966[_0x6fc6('0x3c')]);_0x3876d9[_0x6fc6('0x3f')]=_[_0x6fc6('0x3e')](_0x17a966[_0x6fc6('0x3b')],qs[_0x6fc6('0x40')](_0x4b321e['query'][_0x6fc6('0x40')]));_0x3876d9['attributes']=_0x3876d9[_0x6fc6('0x3f')][_0x6fc6('0x41')]?_0x3876d9[_0x6fc6('0x3f')]:_0x17a966['model'];if(!_0x4b321e['query'][_0x6fc6('0x42')](_0x6fc6('0x64'))){_0x3876d9[_0x6fc6('0x23')]=qs['limit'](_0x4b321e[_0x6fc6('0x3c')][_0x6fc6('0x23')]);_0x3876d9[_0x6fc6('0x22')]=qs['offset'](_0x4b321e[_0x6fc6('0x3c')][_0x6fc6('0x22')]);}_0x3876d9['order']=qs[_0x6fc6('0x44')](_0x4b321e['query'][_0x6fc6('0x44')]);_0x3876d9['where']=qs[_0x6fc6('0x3d')](_[_0x6fc6('0x46')](_0x4b321e[_0x6fc6('0x3c')],_0x17a966['filters']));_0x3876d9[_0x6fc6('0x45')][_0x6fc6('0x67')]=_0x98694a['id'];if(_0x4b321e['query']['filter']){_0x3876d9['where']=_[_0x6fc6('0x47')](_0x3876d9[_0x6fc6('0x45')],{'$or':_['map'](_0x3876d9[_0x6fc6('0x3f')],function(_0x3776f0){var _0x3a360d={};_0x3a360d[_0x3776f0]={'$like':'%'+_0x4b321e[_0x6fc6('0x3c')][_0x6fc6('0x2e')]+'%'};return _0x3a360d;})});}_0x3876d9=_[_0x6fc6('0x47')]({},_0x3876d9,_0x4b321e[_0x6fc6('0x49')]);return db[_0x6fc6('0x66')][_0x6fc6('0x25')]({'where':_0x3876d9[_0x6fc6('0x45')]})['then'](function(_0x23881e){_0x1333fe['count']=_0x23881e;if(_0x4b321e[_0x6fc6('0x3c')][_0x6fc6('0x50')]){_0x3876d9['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x6fc6('0x4b')](_0x3876d9);})[_0x6fc6('0x2a')](function(_0x5681d3){_0x1333fe[_0x6fc6('0x4c')]=_0x5681d3;return _0x1333fe;});}})['then'](respondWithFilteredResult(_0x5b2dca,_0x3876d9))[_0x6fc6('0x4d')](handleError(_0x5b2dca,null));};exports[_0x6fc6('0x68')]=function(_0x4ceea1,_0x1536d9,_0x5c89fd){var _0x36cedc={'raw':!![],'where':{}};var _0x59feb0={};var _0x3fc5ef={'count':0x0,'rows':[]};return db[_0x6fc6('0x38')]['findOne']({'where':{'id':_0x4ceea1['params']['id']}})[_0x6fc6('0x2a')](handleEntityNotFound(_0x1536d9,null))[_0x6fc6('0x2a')](function(_0x333d37){if(_0x333d37){_0x59feb0[_0x6fc6('0x3b')]=_[_0x6fc6('0x4f')](db[_0x6fc6('0x69')][_0x6fc6('0x39')]);_0x59feb0[_0x6fc6('0x3c')]=_[_0x6fc6('0x4f')](_0x4ceea1['query']);_0x59feb0[_0x6fc6('0x3d')]=_[_0x6fc6('0x3e')](_0x59feb0[_0x6fc6('0x3b')],_0x59feb0['query']);_0x36cedc[_0x6fc6('0x3f')]=_[_0x6fc6('0x3e')](_0x59feb0['model'],qs['fields'](_0x4ceea1[_0x6fc6('0x3c')][_0x6fc6('0x40')]));_0x36cedc['attributes']=_0x36cedc[_0x6fc6('0x3f')][_0x6fc6('0x41')]?_0x36cedc[_0x6fc6('0x3f')]:_0x59feb0[_0x6fc6('0x3b')];if(!_0x4ceea1[_0x6fc6('0x3c')][_0x6fc6('0x42')](_0x6fc6('0x64'))){_0x36cedc[_0x6fc6('0x23')]=qs[_0x6fc6('0x23')](_0x4ceea1[_0x6fc6('0x3c')]['limit']);_0x36cedc['offset']=qs['offset'](_0x4ceea1[_0x6fc6('0x3c')]['offset']);}_0x36cedc[_0x6fc6('0x43')]=qs[_0x6fc6('0x44')](_0x4ceea1[_0x6fc6('0x3c')][_0x6fc6('0x44')]);_0x36cedc[_0x6fc6('0x45')]=qs[_0x6fc6('0x3d')](_[_0x6fc6('0x46')](_0x4ceea1[_0x6fc6('0x3c')],_0x59feb0['filters']));_0x36cedc['where']['VoiceQueueId']=_0x333d37['id'];if(_0x4ceea1[_0x6fc6('0x3c')][_0x6fc6('0x2e')]){_0x36cedc[_0x6fc6('0x45')]=_[_0x6fc6('0x47')](_0x36cedc['where'],{'$or':_[_0x6fc6('0x30')](_0x36cedc[_0x6fc6('0x3f')],function(_0x58d965){var _0x23065b={};_0x23065b[_0x58d965]={'$like':'%'+_0x4ceea1[_0x6fc6('0x3c')][_0x6fc6('0x2e')]+'%'};return _0x23065b;})});}_0x36cedc=_['merge']({},_0x36cedc,_0x4ceea1['options']);return db[_0x6fc6('0x69')]['count']({'where':_0x36cedc[_0x6fc6('0x45')]})[_0x6fc6('0x2a')](function(_0x731c72){_0x3fc5ef['count']=_0x731c72;if(_0x4ceea1['query'][_0x6fc6('0x50')]){_0x36cedc['include']=[{'all':!![]}];}return db[_0x6fc6('0x69')][_0x6fc6('0x4b')](_0x36cedc);})[_0x6fc6('0x2a')](function(_0x1d21c1){_0x3fc5ef['rows']=_0x1d21c1;return _0x3fc5ef;});}})[_0x6fc6('0x2a')](respondWithFilteredResult(_0x1536d9,_0x36cedc))[_0x6fc6('0x4d')](handleError(_0x1536d9,null));};exports['getHopperBlacks']=function(_0x42ccdc,_0x4dcc4d,_0x4c6921){var _0x5d868c={'raw':!![],'where':{}};var _0x1c0476={};var _0x1876f2={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x42ccdc[_0x6fc6('0x60')]['id']}})[_0x6fc6('0x2a')](handleEntityNotFound(_0x4dcc4d,null))[_0x6fc6('0x2a')](function(_0x3ffc79){if(_0x3ffc79){_0x1c0476[_0x6fc6('0x3b')]=_['keys'](db[_0x6fc6('0x6a')][_0x6fc6('0x39')]);_0x1c0476[_0x6fc6('0x3c')]=_['keys'](_0x42ccdc[_0x6fc6('0x3c')]);_0x1c0476[_0x6fc6('0x3d')]=_['intersection'](_0x1c0476[_0x6fc6('0x3b')],_0x1c0476[_0x6fc6('0x3c')]);_0x5d868c[_0x6fc6('0x3f')]=_['intersection'](_0x1c0476[_0x6fc6('0x3b')],qs['fields'](_0x42ccdc['query'][_0x6fc6('0x40')]));_0x5d868c['attributes']=_0x5d868c[_0x6fc6('0x3f')]['length']?_0x5d868c['attributes']:_0x1c0476[_0x6fc6('0x3b')];if(!_0x42ccdc[_0x6fc6('0x3c')]['hasOwnProperty'](_0x6fc6('0x64'))){_0x5d868c[_0x6fc6('0x23')]=qs[_0x6fc6('0x23')](_0x42ccdc[_0x6fc6('0x3c')]['limit']);_0x5d868c[_0x6fc6('0x22')]=qs['offset'](_0x42ccdc[_0x6fc6('0x3c')][_0x6fc6('0x22')]);}_0x5d868c['order']=qs[_0x6fc6('0x44')](_0x42ccdc[_0x6fc6('0x3c')][_0x6fc6('0x44')]);_0x5d868c[_0x6fc6('0x45')]=qs[_0x6fc6('0x3d')](_[_0x6fc6('0x46')](_0x42ccdc[_0x6fc6('0x3c')],_0x1c0476[_0x6fc6('0x3d')]));_0x5d868c[_0x6fc6('0x45')][_0x6fc6('0x67')]=_0x3ffc79['id'];if(_0x42ccdc[_0x6fc6('0x3c')]['filter']){_0x5d868c[_0x6fc6('0x45')]=_[_0x6fc6('0x47')](_0x5d868c[_0x6fc6('0x45')],{'$or':_[_0x6fc6('0x30')](_0x5d868c['attributes'],function(_0x120302){var _0x62ce33={};_0x62ce33[_0x120302]={'$like':'%'+_0x42ccdc[_0x6fc6('0x3c')]['filter']+'%'};return _0x62ce33;})});}_0x5d868c=_[_0x6fc6('0x47')]({},_0x5d868c,_0x42ccdc['options']);return db['CmHopperBlack'][_0x6fc6('0x25')]({'where':_0x5d868c[_0x6fc6('0x45')]})['then'](function(_0x5ba38e){_0x1876f2['count']=_0x5ba38e;if(_0x42ccdc[_0x6fc6('0x3c')]['includeAll']){_0x5d868c[_0x6fc6('0x4a')]=[{'all':!![]}];}return db[_0x6fc6('0x6a')][_0x6fc6('0x4b')](_0x5d868c);})[_0x6fc6('0x2a')](function(_0x207351){_0x1876f2['rows']=_0x207351;return _0x1876f2;});}})[_0x6fc6('0x2a')](respondWithFilteredResult(_0x4dcc4d,_0x5d868c))[_0x6fc6('0x4d')](handleError(_0x4dcc4d,null));};exports[_0x6fc6('0x6b')]=function(_0x1126d3,_0x47a65c,_0x4beea3){var _0x3d724c={};var _0x34b88c={};var _0x105380;var _0x27077e;return db[_0x6fc6('0x38')][_0x6fc6('0x62')]({'where':{'id':_0x1126d3[_0x6fc6('0x60')]['id']}})[_0x6fc6('0x2a')](handleEntityNotFound(_0x47a65c,null))[_0x6fc6('0x2a')](function(_0x984135){if(_0x984135){_0x105380=_0x984135;_0x34b88c[_0x6fc6('0x3b')]=_[_0x6fc6('0x4f')](db[_0x6fc6('0x6c')][_0x6fc6('0x39')]);_0x34b88c[_0x6fc6('0x3c')]=_[_0x6fc6('0x4f')](_0x1126d3['query']);_0x34b88c[_0x6fc6('0x3d')]=_[_0x6fc6('0x3e')](_0x34b88c[_0x6fc6('0x3b')],_0x34b88c[_0x6fc6('0x3c')]);_0x3d724c[_0x6fc6('0x3f')]=_[_0x6fc6('0x3e')](_0x34b88c['model'],qs['fields'](_0x1126d3[_0x6fc6('0x3c')][_0x6fc6('0x40')]));_0x3d724c[_0x6fc6('0x3f')]=_0x3d724c['attributes']['length']?_0x3d724c[_0x6fc6('0x3f')]:_0x34b88c[_0x6fc6('0x3b')];_0x3d724c[_0x6fc6('0x43')]=qs[_0x6fc6('0x44')](_0x1126d3[_0x6fc6('0x3c')][_0x6fc6('0x44')]);_0x3d724c[_0x6fc6('0x45')]=qs['filters'](_['pick'](_0x1126d3['query'],_0x34b88c['filters']));if(_0x1126d3[_0x6fc6('0x3c')][_0x6fc6('0x2e')]){_0x3d724c[_0x6fc6('0x45')]=_[_0x6fc6('0x47')](_0x3d724c[_0x6fc6('0x45')],{'$or':_[_0x6fc6('0x30')](_0x3d724c['attributes'],function(_0x3a4e30){var _0x36eecd={};_0x36eecd[_0x3a4e30]={'$like':'%'+_0x1126d3[_0x6fc6('0x3c')][_0x6fc6('0x2e')]+'%'};return _0x36eecd;})});}_0x3d724c=_[_0x6fc6('0x47')]({},_0x3d724c,_0x1126d3[_0x6fc6('0x49')]);return _0x105380['getTeams'](_0x3d724c);}})[_0x6fc6('0x2a')](function(_0x3d187b){if(_0x3d187b){_0x27077e=_0x3d187b[_0x6fc6('0x41')];if(!_0x1126d3[_0x6fc6('0x3c')][_0x6fc6('0x42')](_0x6fc6('0x64'))){_0x3d724c['limit']=qs[_0x6fc6('0x23')](_0x1126d3[_0x6fc6('0x3c')][_0x6fc6('0x23')]);_0x3d724c[_0x6fc6('0x22')]=qs['offset'](_0x1126d3[_0x6fc6('0x3c')][_0x6fc6('0x22')]);}return _0x105380[_0x6fc6('0x6b')](_0x3d724c);}})['then'](function(_0xc630f){if(_0xc630f){return _0xc630f?{'count':_0x27077e,'rows':_0xc630f}:null;}})[_0x6fc6('0x2a')](respondWithResult(_0x47a65c,null))['catch'](handleError(_0x47a65c,null));};exports['addTeams']=function(_0x4cd9cd,_0x6e16fb,_0x1ee5c9){var _0x1e4abd=_0x4cd9cd[_0x6fc6('0x5d')][_0x6fc6('0x6d')];var _0x1201a2=_['map'](_0x1e4abd,'id');return db['Team'][_0x6fc6('0x4b')]({'where':{'id':_0x1201a2},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x6fc6('0x34'),_0x6fc6('0x6e'),'voicePause',_0x6fc6('0x6f')],'raw':!![]}]})[_0x6fc6('0x2a')](function(_0x5b8e71){if(_0x5b8e71){var _0x925ef3=_[_0x6fc6('0x70')](_0x5b8e71,function(_0x36e0b2){var _0x413016=_0x36e0b2['get']({'plain':!![]});_0x413016[_0x6fc6('0x71')][_0x6fc6('0x72')](function(_0x539406){_0x539406[_0x6fc6('0x73')]=_[_0x6fc6('0x33')](_0x1e4abd,{'id':_0x413016['id']})[_0x6fc6('0x73')];});return _0x413016[_0x6fc6('0x71')];});return db[_0x6fc6('0x38')][_0x6fc6('0x33')]({'where':{'id':_0x4cd9cd[_0x6fc6('0x60')]['id']}})[_0x6fc6('0x2a')](function(_0x18762d){return db[_0x6fc6('0x74')][_0x6fc6('0x75')](function(_0x32912c){return _0x18762d[_0x6fc6('0x76')](_0x1201a2,{'transaction':_0x32912c})[_0x6fc6('0x2a')](function(){return BPromise[_0x6fc6('0x77')](_0x1e4abd,function(_0x3040a9){return db[_0x6fc6('0x78')][_0x6fc6('0x79')]({'TeamId':_0x3040a9['id'],'VoiceQueueId':_0x4cd9cd[_0x6fc6('0x60')]['id'],'penalty':_0x3040a9[_0x6fc6('0x73')]},{'transaction':_0x32912c});});})[_0x6fc6('0x2a')](function(){return BPromise[_0x6fc6('0x77')](_0x925ef3,function(_0x835f09){return db[_0x6fc6('0x7a')][_0x6fc6('0x7b')]({'where':{'UserId':_0x835f09['id'],'VoiceQueueId':_0x4cd9cd[_0x6fc6('0x60')]['id']},'defaults':{'penalty':_0x835f09[_0x6fc6('0x73')]},'transaction':_0x32912c});});})['then'](function(){return BPromise['each'](_[_0x6fc6('0x2e')](_0x925ef3,{'online':!![]}),function(_0x2b79b7){return db[_0x6fc6('0x7c')]['upsert']({'membername':_0x2b79b7[_0x6fc6('0x34')],'UserId':_0x2b79b7['id'],'queue_name':_0x18762d['name'],'VoiceQueueId':_0x18762d['id'],'interface':_[_0x6fc6('0x7d')](_0x2b79b7['interface'])?util[_0x6fc6('0x7e')](_0x6fc6('0x7f'),_0x2b79b7['name']):_0x2b79b7[_0x6fc6('0x6f')],'paused':_0x2b79b7[_0x6fc6('0x80')]||![],'penalty':_0x2b79b7[_0x6fc6('0x73')]},{'transaction':_0x32912c});});})[_0x6fc6('0x2a')](function(){_0x925ef3[_0x6fc6('0x72')](function(_0x19e932){socket[_0x6fc6('0x81')](_0x6fc6('0x82'),{'UserId':_0x19e932['id'],'VoiceQueueId':_0x18762d['id']});});});});});}})[_0x6fc6('0x2a')](respondWithStatusCode(_0x6e16fb,null))[_0x6fc6('0x4d')](handleError(_0x6e16fb,null));};exports[_0x6fc6('0x83')]=function(_0x563fd7,_0x476083,_0x3c60a3){return db[_0x6fc6('0x6c')][_0x6fc6('0x4b')]({'where':{'id':_0x563fd7[_0x6fc6('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6fc6('0x2a')](handleEntityNotFound(_0x476083,null))[_0x6fc6('0x2a')](function(_0x2069bb){var _0x1f871a=_[_0x6fc6('0x30')](_0x2069bb,'id');var _0x48bb19=[];var _0x314cd7=[];var _0x4a9f5c=squel[_0x6fc6('0x84')]();_0x4a9f5c[_0x6fc6('0x85')](_0x6fc6('0x86'))[_0x6fc6('0x87')]('team_has_voice_queues','tq')['join'](_0x6fc6('0x88'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6fc6('0x45')](_0x6fc6('0x89'),_0x563fd7[_0x6fc6('0x60')]['id']);for(var _0x1e5b4a=0x0;_0x1e5b4a<_0x2069bb[_0x6fc6('0x41')];_0x1e5b4a+=0x1){let _0x4b2bcf=_0x2069bb[_0x1e5b4a];for(var _0x158003=0x0;_0x158003<_0x4b2bcf['Agents'][_0x6fc6('0x41')];_0x158003+=0x1){let _0xbf493f=_0x4b2bcf[_0x6fc6('0x71')][_0x158003];var _0x3944be=_0x4a9f5c[_0x6fc6('0x8a')]();_0x3944be[_0x6fc6('0x45')]('ut.UserId\x20=\x20?',_0xbf493f['id']);_0x314cd7[_0x6fc6('0x8b')](db['sequelize'][_0x6fc6('0x3c')](_0x3944be[_0x6fc6('0x8c')](),{'type':db['sequelize'][_0x6fc6('0x8d')][_0x6fc6('0x8e')]})[_0x6fc6('0x2a')](function(_0x3adfeb){if(_0x3adfeb[_0x6fc6('0x41')]===0x1){return _0xbf493f['id'];}else{var _0x4a012=_['every'](_['map'](_0x3adfeb,_0x6fc6('0x8f')),function(_0x3b009a){return _[_0x6fc6('0x90')](_0x1f871a,_0x3b009a);});if(_0x4a012){return _0xbf493f['id'];}}}));}}return BPromise[_0x6fc6('0x91')](_0x314cd7)[_0x6fc6('0x2a')](function(_0x2972c2){_0x48bb19=_(_0x48bb19)[_0x6fc6('0x92')](_0x2972c2)[_0x6fc6('0x93')]()['value']();return db[_0x6fc6('0x38')][_0x6fc6('0x33')]({'where':{'id':_0x563fd7[_0x6fc6('0x60')]['id']}})[_0x6fc6('0x2a')](function(_0x13b977){return db[_0x6fc6('0x74')][_0x6fc6('0x75')](function(_0x56b4e1){return _0x13b977[_0x6fc6('0x83')](_0x563fd7[_0x6fc6('0x3c')][_0x6fc6('0x94')],{'transaction':_0x56b4e1})['then'](function(){if(!_['isEmpty'](_0x48bb19)){return _0x13b977[_0x6fc6('0x95')](_0x48bb19,{'transaction':_0x56b4e1})[_0x6fc6('0x2a')](function(){return db[_0x6fc6('0x7c')][_0x6fc6('0x2b')]({'where':{'VoiceQueueId':_0x563fd7[_0x6fc6('0x60')]['id'],'UserId':_0x48bb19},'transaction':_0x56b4e1});});}})[_0x6fc6('0x2a')](function(){_0x48bb19[_0x6fc6('0x72')](function(_0x310b7a){socket[_0x6fc6('0x81')](_0x6fc6('0x96'),{'UserId':_0x310b7a,'VoiceQueueId':_0x13b977['id']});});});});});});})['then'](respondWithStatusCode(_0x476083,null))[_0x6fc6('0x4d')](handleError(_0x476083,null));};exports[_0x6fc6('0x97')]=function(_0x2d1ad1,_0x507ea7,_0x110c35){var _0x52a6b5,_0x4a6d9b;return db['VoiceQueue'][_0x6fc6('0x33')]({'where':{'id':_0x2d1ad1[_0x6fc6('0x60')]['id']}})['then'](handleEntityNotFound(_0x507ea7,null))[_0x6fc6('0x2a')](function(_0x4daf43){if(_0x4daf43){_0x4a6d9b=_0x4daf43;return _0x4daf43[_0x6fc6('0x97')](_0x2d1ad1[_0x6fc6('0x5d')][_0x6fc6('0x94')],_[_0x6fc6('0x5a')](_0x2d1ad1[_0x6fc6('0x5d')],[_0x6fc6('0x94'),'id'])||{})[_0x6fc6('0x98')](function(_0x1dbc95){for(var _0x50b9e9=0x0;_0x50b9e9<_0x2d1ad1[_0x6fc6('0x5d')]['ids']['length'];_0x50b9e9+=0x1){socket[_0x6fc6('0x81')](_0x6fc6('0x82'),{'UserId':Number(_0x2d1ad1[_0x6fc6('0x5d')][_0x6fc6('0x94')][_0x50b9e9]),'VoiceQueueId':Number(_0x2d1ad1[_0x6fc6('0x60')]['id'])});}return _0x1dbc95;});}})[_0x6fc6('0x2a')](function(_0x16ab76){_0x52a6b5=_0x16ab76||[];if(_0x4a6d9b){return db[_0x6fc6('0x99')][_0x6fc6('0x4b')]({'where':{'id':_0x2d1ad1[_0x6fc6('0x5d')]['ids']},'attributes':['id',_0x6fc6('0x34'),_0x6fc6('0x6e'),_0x6fc6('0x80'),_0x6fc6('0x6f')],'raw':!![]});}})[_0x6fc6('0x2a')](function(_0x53511a){if(!_[_0x6fc6('0x9a')](_0x53511a)){var _0x305198=[];for(var _0x1d90cf=0x0;_0x1d90cf<_0x53511a['length'];_0x1d90cf++){if(_0x53511a[_0x1d90cf]['online']){_0x305198[_0x6fc6('0x8b')](db[_0x6fc6('0x7c')][_0x6fc6('0x79')]({'membername':_0x53511a[_0x1d90cf][_0x6fc6('0x34')],'UserId':_0x53511a[_0x1d90cf]['id'],'queue_name':_0x4a6d9b[_0x6fc6('0x34')],'VoiceQueueId':_0x4a6d9b['id'],'interface':_['isNil'](_0x53511a[_0x1d90cf][_0x6fc6('0x6f')])?util[_0x6fc6('0x7e')]('SIP/%s',_0x53511a[_0x1d90cf][_0x6fc6('0x34')]):_0x53511a[_0x1d90cf][_0x6fc6('0x6f')],'paused':_0x53511a[_0x1d90cf][_0x6fc6('0x80')]||![],'penalty':_0x2d1ad1[_0x6fc6('0x5d')][_0x6fc6('0x73')]||0x0}));}}return BPromise[_0x6fc6('0x91')](_0x305198);}})[_0x6fc6('0x2a')](function(){return _0x52a6b5;})['then'](respondWithResult(_0x507ea7,null))['catch'](handleError(_0x507ea7,null));};exports[_0x6fc6('0x95')]=function(_0x5a03d9,_0xde99b0,_0xe5d28c){return db['VoiceQueue'][_0x6fc6('0x33')]({'where':{'id':_0x5a03d9['params']['id']}})[_0x6fc6('0x2a')](handleEntityNotFound(_0xde99b0,null))[_0x6fc6('0x2a')](function(_0x275a42){if(_0x275a42){return _0x275a42['removeAgents'](_0x5a03d9[_0x6fc6('0x3c')][_0x6fc6('0x94')])['then'](function(){if(_[_0x6fc6('0x9b')](_0x5a03d9[_0x6fc6('0x3c')][_0x6fc6('0x94')])){for(var _0xaf2765=0x0;_0xaf2765<_0x5a03d9['query']['ids'][_0x6fc6('0x41')];_0xaf2765+=0x1){socket[_0x6fc6('0x81')](_0x6fc6('0x96'),{'UserId':Number(_0x5a03d9[_0x6fc6('0x3c')]['ids'][_0xaf2765]),'VoiceQueueId':Number(_0x5a03d9['params']['id'])});}}else{socket['emit'](_0x6fc6('0x96'),{'UserId':Number(_0x5a03d9[_0x6fc6('0x3c')]['ids']),'VoiceQueueId':Number(_0x5a03d9[_0x6fc6('0x60')]['id'])});}});}})[_0x6fc6('0x2a')](function(_0x2e396f){return db['UserVoiceQueueRt'][_0x6fc6('0x2b')]({'where':{'VoiceQueueId':_0x5a03d9['params']['id'],'UserId':_0x5a03d9[_0x6fc6('0x3c')][_0x6fc6('0x94')]}})[_0x6fc6('0x2a')](function(){return _0x2e396f;});})[_0x6fc6('0x2a')](respondWithStatusCode(_0xde99b0,null))[_0x6fc6('0x4d')](handleError(_0xde99b0,null));};exports['getAgents']=function(_0x189134,_0xfc7a03,_0x4e2bdc){var _0x517f53={};var _0x4276c2={};var _0x4115ec;var _0x38c382;return db[_0x6fc6('0x38')]['findOne']({'where':{'id':_0x189134[_0x6fc6('0x60')]['id']}})[_0x6fc6('0x2a')](handleEntityNotFound(_0xfc7a03,null))[_0x6fc6('0x2a')](function(_0x54a296){if(_0x54a296){_0x4115ec=_0x54a296;_0x4276c2[_0x6fc6('0x3b')]=_[_0x6fc6('0x4f')](db[_0x6fc6('0x99')][_0x6fc6('0x39')]);_0x4276c2[_0x6fc6('0x3c')]=_[_0x6fc6('0x4f')](_0x189134[_0x6fc6('0x3c')]);_0x4276c2[_0x6fc6('0x3d')]=_[_0x6fc6('0x3e')](_0x4276c2[_0x6fc6('0x3b')],_0x4276c2[_0x6fc6('0x3c')]);_0x517f53[_0x6fc6('0x3f')]=_[_0x6fc6('0x3e')](_0x4276c2[_0x6fc6('0x3b')],qs[_0x6fc6('0x40')](_0x189134[_0x6fc6('0x3c')]['fields']));_0x517f53['attributes']=_0x517f53[_0x6fc6('0x3f')]['length']?_0x517f53[_0x6fc6('0x3f')]:_0x4276c2['model'];_0x517f53[_0x6fc6('0x43')]=qs[_0x6fc6('0x44')](_0x189134[_0x6fc6('0x3c')]['sort']);_0x517f53[_0x6fc6('0x45')]=qs[_0x6fc6('0x3d')](_[_0x6fc6('0x46')](_0x189134[_0x6fc6('0x3c')],_0x4276c2['filters']));if(_0x189134[_0x6fc6('0x3c')]['filter']){_0x517f53[_0x6fc6('0x45')]=_[_0x6fc6('0x47')](_0x517f53[_0x6fc6('0x45')],{'$or':_[_0x6fc6('0x30')](_0x517f53['attributes'],function(_0x40fa8f){var _0x331c0e={};_0x331c0e[_0x40fa8f]={'$like':'%'+_0x189134[_0x6fc6('0x3c')][_0x6fc6('0x2e')]+'%'};return _0x331c0e;})});}_0x517f53=_[_0x6fc6('0x47')]({},_0x517f53,_0x189134[_0x6fc6('0x49')]);return _0x4115ec[_0x6fc6('0x9c')](_0x517f53);}})[_0x6fc6('0x2a')](function(_0x397804){if(_0x397804){_0x38c382=_0x397804[_0x6fc6('0x41')];if(!_0x189134[_0x6fc6('0x3c')][_0x6fc6('0x42')](_0x6fc6('0x64'))){_0x517f53[_0x6fc6('0x23')]=qs[_0x6fc6('0x23')](_0x189134[_0x6fc6('0x3c')][_0x6fc6('0x23')]);_0x517f53[_0x6fc6('0x22')]=qs['offset'](_0x189134[_0x6fc6('0x3c')]['offset']);}return _0x4115ec[_0x6fc6('0x9c')](_0x517f53);}})[_0x6fc6('0x2a')](function(_0x488871){if(_0x488871){return _0x488871?{'count':_0x38c382,'rows':_0x488871}:null;}})['then'](respondWithResult(_0xfc7a03,null))['catch'](handleError(_0xfc7a03,null));};exports[_0x6fc6('0x9d')]=function(_0x198844,_0x303985,_0x4f9d1e){var _0x145378={};var _0x5712f9={};var _0x5b7bef;var _0x4fbd7a;return db[_0x6fc6('0x38')]['findOne']({'where':{'id':_0x198844['params']['id']}})[_0x6fc6('0x2a')](handleEntityNotFound(_0x303985,null))['then'](function(_0x1320b7){if(_0x1320b7){_0x5b7bef=_0x1320b7;_0x5712f9[_0x6fc6('0x3b')]=_[_0x6fc6('0x4f')](db['UserVoiceQueueRt'][_0x6fc6('0x39')]);_0x5712f9[_0x6fc6('0x3c')]=_[_0x6fc6('0x4f')](_0x198844[_0x6fc6('0x3c')]);_0x5712f9[_0x6fc6('0x3d')]=_[_0x6fc6('0x3e')](_0x5712f9[_0x6fc6('0x3b')],_0x5712f9[_0x6fc6('0x3c')]);_0x145378[_0x6fc6('0x3f')]=_[_0x6fc6('0x3e')](_0x5712f9['model'],qs[_0x6fc6('0x40')](_0x198844[_0x6fc6('0x3c')][_0x6fc6('0x40')]));_0x145378[_0x6fc6('0x3f')]=_0x145378[_0x6fc6('0x3f')]['length']?_0x145378[_0x6fc6('0x3f')]:_0x5712f9[_0x6fc6('0x3b')];_0x145378[_0x6fc6('0x43')]=qs[_0x6fc6('0x44')](_0x198844[_0x6fc6('0x3c')][_0x6fc6('0x44')]);_0x145378[_0x6fc6('0x45')]=qs[_0x6fc6('0x3d')](_[_0x6fc6('0x46')](_0x198844['query'],_0x5712f9[_0x6fc6('0x3d')]));if(_0x198844[_0x6fc6('0x3c')]['filter']){_0x145378['where']=_[_0x6fc6('0x47')](_0x145378[_0x6fc6('0x45')],{'$or':_[_0x6fc6('0x30')](_0x145378[_0x6fc6('0x3f')],function(_0x8843a3){var _0x2ae4e7={};_0x2ae4e7[_0x8843a3]={'$like':'%'+_0x198844[_0x6fc6('0x3c')]['filter']+'%'};return _0x2ae4e7;})});}_0x145378=_[_0x6fc6('0x47')]({},_0x145378,_0x198844['options']);return _0x5b7bef[_0x6fc6('0x9d')](_0x145378);}})[_0x6fc6('0x2a')](function(_0x5dfb21){if(_0x5dfb21){_0x4fbd7a=_0x5dfb21[_0x6fc6('0x41')];if(!_0x198844[_0x6fc6('0x3c')][_0x6fc6('0x42')](_0x6fc6('0x64'))){_0x145378[_0x6fc6('0x23')]=qs[_0x6fc6('0x23')](_0x198844[_0x6fc6('0x3c')]['limit']);_0x145378[_0x6fc6('0x22')]=qs[_0x6fc6('0x22')](_0x198844['query'][_0x6fc6('0x22')]);}return _0x5b7bef[_0x6fc6('0x9d')](_0x145378);}})[_0x6fc6('0x2a')](function(_0x19b9df){return _0x19b9df?{'count':_0x4fbd7a,'rows':_0x19b9df}:null;})[_0x6fc6('0x2a')](respondWithResult(_0x303985,null))['catch'](handleError(_0x303985,null));};exports[_0x6fc6('0x9e')]=function(_0x24c31c,_0x33562f,_0x7122f3){var _0x2f306d={};var _0x5b1ff8={};var _0x9527ba;var _0x300328;return db[_0x6fc6('0x38')][_0x6fc6('0x62')]({'where':{'id':_0x24c31c[_0x6fc6('0x60')]['id']}})[_0x6fc6('0x2a')](handleEntityNotFound(_0x33562f,null))[_0x6fc6('0x2a')](function(_0x5d29e6){if(_0x5d29e6){_0x9527ba=_0x5d29e6;_0x5b1ff8['model']=_['keys'](db[_0x6fc6('0x9f')]['rawAttributes']);_0x5b1ff8[_0x6fc6('0x3c')]=_['keys'](_0x24c31c['query']);_0x5b1ff8['filters']=_[_0x6fc6('0x3e')](_0x5b1ff8[_0x6fc6('0x3b')],_0x5b1ff8[_0x6fc6('0x3c')]);_0x2f306d[_0x6fc6('0x3f')]=_[_0x6fc6('0x3e')](_0x5b1ff8[_0x6fc6('0x3b')],qs[_0x6fc6('0x40')](_0x24c31c['query'][_0x6fc6('0x40')]));_0x2f306d[_0x6fc6('0x3f')]=_0x2f306d['attributes']['length']?_0x2f306d[_0x6fc6('0x3f')]:_0x5b1ff8[_0x6fc6('0x3b')];_0x2f306d[_0x6fc6('0x43')]=qs['sort'](_0x24c31c[_0x6fc6('0x3c')][_0x6fc6('0x44')]);_0x2f306d[_0x6fc6('0x45')]=qs[_0x6fc6('0x3d')](_[_0x6fc6('0x46')](_0x24c31c['query'],_0x5b1ff8[_0x6fc6('0x3d')]));if(_0x24c31c[_0x6fc6('0x3c')][_0x6fc6('0x2e')]){_0x2f306d[_0x6fc6('0x45')]=_[_0x6fc6('0x47')](_0x2f306d[_0x6fc6('0x45')],{'$or':_[_0x6fc6('0x30')](_0x2f306d[_0x6fc6('0x3f')],function(_0x55f24a){var _0x3db9a6={};_0x3db9a6[_0x55f24a]={'$like':'%'+_0x24c31c['query'][_0x6fc6('0x2e')]+'%'};return _0x3db9a6;})});}_0x2f306d=_[_0x6fc6('0x47')]({},_0x2f306d,_0x24c31c[_0x6fc6('0x49')]);return _0x9527ba['getLists'](_0x2f306d);}})[_0x6fc6('0x2a')](function(_0x562b22){if(_0x562b22){_0x300328=_0x562b22[_0x6fc6('0x41')];if(!_0x24c31c[_0x6fc6('0x3c')][_0x6fc6('0x42')](_0x6fc6('0x64'))){_0x2f306d[_0x6fc6('0x23')]=qs['limit'](_0x24c31c[_0x6fc6('0x3c')][_0x6fc6('0x23')]);_0x2f306d[_0x6fc6('0x22')]=qs[_0x6fc6('0x22')](_0x24c31c[_0x6fc6('0x3c')][_0x6fc6('0x22')]);}return _0x9527ba['getLists'](_0x2f306d);}})[_0x6fc6('0x2a')](function(_0x48ef7f){if(_0x48ef7f){return _0x48ef7f?{'count':_0x300328,'rows':_0x48ef7f}:null;}})[_0x6fc6('0x2a')](respondWithResult(_0x33562f,null))[_0x6fc6('0x4d')](handleError(_0x33562f,null));};exports[_0x6fc6('0xa0')]=function(_0x50ca46,_0xa21ca4,_0x44f43d){var _0x48b5c0,_0x1b634c;return db[_0x6fc6('0x38')][_0x6fc6('0x33')]({'where':{'id':_0x50ca46['params']['id']}})[_0x6fc6('0x2a')](handleEntityNotFound(_0xa21ca4,null))[_0x6fc6('0x2a')](function(_0x61269a){if(_0x61269a){_0x1b634c=_0x61269a;return _0x61269a['addLists'](_0x50ca46[_0x6fc6('0x5d')][_0x6fc6('0x94')],_['omit'](_0x50ca46[_0x6fc6('0x5d')],[_0x6fc6('0x94'),'id'])||{});}return null;})[_0x6fc6('0x98')](function(_0xbaeba0){var _0xeeec76;_0x48b5c0=_0xbaeba0||[];var _0x5ec3d3=[];if(_0xbaeba0){for(var _0x196a5f=0x0;_0x196a5f<_0xbaeba0[_0x6fc6('0x41')];_0x196a5f+=0x1){var _0x5a665c=_0xbaeba0[_0x196a5f][_0x6fc6('0x53')]({'plain':!![]});_0x1b634c[_0x6fc6('0xa1')]=_0x50ca46[_0x6fc6('0x5d')]['dialCheckDuplicateType']?_0x50ca46[_0x6fc6('0x5d')][_0x6fc6('0xa1')]:_0x1b634c[_0x6fc6('0xa1')];switch(_0x1b634c[_0x6fc6('0xa1')]){case _0x6fc6('0xa2'):_0xeeec76=squel[_0x6fc6('0xa3')]()[_0x6fc6('0xa4')]('cm_hopper')[_0x6fc6('0xa5')]([_0x6fc6('0xa6'),'scheduledAt','ContactId','ListId','VoiceQueueId','createdAt',_0x6fc6('0x5c')],squel[_0x6fc6('0x84')]()[_0x6fc6('0x85')](_0x6fc6('0xa6'),_0x6fc6('0xa6'))['field'](_0x6fc6('0xa7'),_0x6fc6('0xa8'))[_0x6fc6('0x85')]('id','ContactId')['field'](_0x5a665c[_0x6fc6('0xa9')][_0x6fc6('0x8c')](),_0x6fc6('0xaa'))[_0x6fc6('0x85')](_0x50ca46[_0x6fc6('0x60')]['id']['toString'](),'VoiceQueueId')[_0x6fc6('0x85')]('NOW()',_0x6fc6('0x5b'))[_0x6fc6('0x85')](_0x6fc6('0xa7'),'updatedAt')[_0x6fc6('0x87')](_0x6fc6('0xab'))[_0x6fc6('0x45')](_0x6fc6('0xac'))[_0x6fc6('0x45')](_0x6fc6('0xad'),_0x5a665c[_0x6fc6('0xa9')]['toString']())[_0x6fc6('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x6fc6('0x45')](_0x6fc6('0xae'),squel[_0x6fc6('0x84')]()[_0x6fc6('0x85')]('COALESCE(calleridnum,\x27\x27)')[_0x6fc6('0x87')](_0x6fc6('0xaf'))[_0x6fc6('0x45')](_0x6fc6('0x89'),_0x50ca46[_0x6fc6('0x60')]['id'][_0x6fc6('0x8c')]()))[_0x6fc6('0x45')](_0x6fc6('0xae'),squel['select']()[_0x6fc6('0x85')]('COALESCE(phone,\x27\x27)')[_0x6fc6('0x87')](_0x6fc6('0xb0'))[_0x6fc6('0x45')](_0x6fc6('0x89'),_0x50ca46[_0x6fc6('0x60')]['id'][_0x6fc6('0x8c')]())))[_0x6fc6('0x8c')]();break;case'onlyIfOpen':_0xeeec76=squel[_0x6fc6('0xa3')]()[_0x6fc6('0xa4')](_0x6fc6('0xb0'))[_0x6fc6('0xa5')]([_0x6fc6('0xa6'),_0x6fc6('0xa8'),'ContactId',_0x6fc6('0xaa'),_0x6fc6('0x67'),_0x6fc6('0x5b'),'updatedAt'],squel[_0x6fc6('0x84')]()[_0x6fc6('0x85')]('phone',_0x6fc6('0xa6'))['field'](_0x6fc6('0xa7'),_0x6fc6('0xa8'))[_0x6fc6('0x85')]('id',_0x6fc6('0xb1'))[_0x6fc6('0x85')](_0x5a665c[_0x6fc6('0xa9')][_0x6fc6('0x8c')](),'ListId')['field'](_0x50ca46['params']['id']['toString'](),'VoiceQueueId')['field']('NOW()',_0x6fc6('0x5b'))[_0x6fc6('0x85')]('NOW()',_0x6fc6('0x5c'))[_0x6fc6('0x87')]('cm_contacts')[_0x6fc6('0x45')](_0x6fc6('0xac'))[_0x6fc6('0x45')]('ListId\x20=\x20?',_0x5a665c[_0x6fc6('0xa9')][_0x6fc6('0x8c')]())[_0x6fc6('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x6fc6('0x45')](_0x6fc6('0xae'),squel['select']()[_0x6fc6('0x85')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x6fc6('0x45')](_0x6fc6('0x89'),_0x50ca46[_0x6fc6('0x60')]['id'][_0x6fc6('0x8c')]())))[_0x6fc6('0x8c')]();break;default:_0xeeec76=squel['insert']()[_0x6fc6('0xa4')](_0x6fc6('0xb0'))['fromQuery']([_0x6fc6('0xa6'),_0x6fc6('0xa8'),_0x6fc6('0xb1'),_0x6fc6('0xaa'),_0x6fc6('0x67'),_0x6fc6('0x5b'),_0x6fc6('0x5c')],squel['select']()['field'](_0x6fc6('0xa6'),_0x6fc6('0xa6'))['field'](_0x6fc6('0xa7'),_0x6fc6('0xa8'))[_0x6fc6('0x85')]('id',_0x6fc6('0xb1'))[_0x6fc6('0x85')](_0x5a665c[_0x6fc6('0xa9')][_0x6fc6('0x8c')](),_0x6fc6('0xaa'))['field'](_0x50ca46[_0x6fc6('0x60')]['id'][_0x6fc6('0x8c')](),_0x6fc6('0x67'))['field'](_0x6fc6('0xa7'),_0x6fc6('0x5b'))[_0x6fc6('0x85')](_0x6fc6('0xa7'),_0x6fc6('0x5c'))[_0x6fc6('0x87')](_0x6fc6('0xab'))[_0x6fc6('0x45')](_0x6fc6('0xac'))[_0x6fc6('0x45')]('ListId\x20=\x20?',_0x5a665c[_0x6fc6('0xa9')][_0x6fc6('0x8c')]())['where'](_0x6fc6('0xb2')))[_0x6fc6('0x8c')]();}_0x5ec3d3[_0x6fc6('0x8b')](db[_0x6fc6('0x74')][_0x6fc6('0x3c')](_0xeeec76));}return BPromise['all'](_0x5ec3d3);}})[_0x6fc6('0x2a')](function(){return _0x48b5c0;})[_0x6fc6('0x2a')](respondWithResult(_0xa21ca4,null))[_0x6fc6('0x4d')](handleError(_0xa21ca4,null));};exports[_0x6fc6('0xb3')]=function(_0x298f65,_0x3f93ef,_0x1f966b){return db[_0x6fc6('0x38')][_0x6fc6('0x33')]({'where':{'id':_0x298f65[_0x6fc6('0x60')]['id']}})['then'](handleEntityNotFound(_0x3f93ef,null))[_0x6fc6('0x2a')](function(_0x484e70){if(_0x484e70){return _0x484e70[_0x6fc6('0xb3')](_0x298f65[_0x6fc6('0x3c')][_0x6fc6('0x94')]);}})[_0x6fc6('0x2a')](function(_0x29be20){if(_0x29be20){return db[_0x6fc6('0x63')]['destroy']({'where':{'ListId':_0x298f65['query']['ids'],'VoiceQueueId':_0x298f65[_0x6fc6('0x60')]['id']}})[_0x6fc6('0x2a')](function(){return _0x29be20;});}})['then'](respondWithStatusCode(_0x3f93ef,null))[_0x6fc6('0x4d')](handleError(_0x3f93ef,null));};exports[_0x6fc6('0xb4')]=function(_0x113ba8,_0x13348a,_0x1c42ff){var _0x36a815={};var _0x208c08={};var _0x450298;var _0x13f857;return db[_0x6fc6('0x38')][_0x6fc6('0x62')]({'where':{'id':_0x113ba8[_0x6fc6('0x60')]['id']}})[_0x6fc6('0x2a')](handleEntityNotFound(_0x13348a,null))[_0x6fc6('0x2a')](function(_0x4124ee){if(_0x4124ee){_0x450298=_0x4124ee;_0x208c08['model']=_[_0x6fc6('0x4f')](db[_0x6fc6('0x9f')][_0x6fc6('0x39')]);_0x208c08['query']=_[_0x6fc6('0x4f')](_0x113ba8[_0x6fc6('0x3c')]);_0x208c08[_0x6fc6('0x3d')]=_[_0x6fc6('0x3e')](_0x208c08['model'],_0x208c08['query']);_0x36a815['attributes']=_[_0x6fc6('0x3e')](_0x208c08[_0x6fc6('0x3b')],qs[_0x6fc6('0x40')](_0x113ba8[_0x6fc6('0x3c')][_0x6fc6('0x40')]));_0x36a815[_0x6fc6('0x3f')]=_0x36a815[_0x6fc6('0x3f')][_0x6fc6('0x41')]?_0x36a815[_0x6fc6('0x3f')]:_0x208c08[_0x6fc6('0x3b')];_0x36a815[_0x6fc6('0x43')]=qs[_0x6fc6('0x44')](_0x113ba8['query'][_0x6fc6('0x44')]);_0x36a815['where']=qs[_0x6fc6('0x3d')](_[_0x6fc6('0x46')](_0x113ba8['query'],_0x208c08[_0x6fc6('0x3d')]));if(_0x113ba8['query'][_0x6fc6('0x2e')]){_0x36a815[_0x6fc6('0x45')]=_[_0x6fc6('0x47')](_0x36a815[_0x6fc6('0x45')],{'$or':_[_0x6fc6('0x30')](_0x36a815[_0x6fc6('0x3f')],function(_0x5d58e2){var _0x4bda59={};_0x4bda59[_0x5d58e2]={'$like':'%'+_0x113ba8[_0x6fc6('0x3c')]['filter']+'%'};return _0x4bda59;})});}_0x36a815=_['merge']({},_0x36a815,_0x113ba8[_0x6fc6('0x49')]);return _0x450298[_0x6fc6('0xb4')](_0x36a815);}})[_0x6fc6('0x2a')](function(_0x11a229){if(_0x11a229){_0x13f857=_0x11a229[_0x6fc6('0x41')];if(!_0x113ba8[_0x6fc6('0x3c')][_0x6fc6('0x42')](_0x6fc6('0x64'))){_0x36a815[_0x6fc6('0x23')]=qs[_0x6fc6('0x23')](_0x113ba8[_0x6fc6('0x3c')][_0x6fc6('0x23')]);_0x36a815[_0x6fc6('0x22')]=qs[_0x6fc6('0x22')](_0x113ba8['query'][_0x6fc6('0x22')]);}return _0x450298['getBlackLists'](_0x36a815);}})[_0x6fc6('0x2a')](function(_0x382c92){if(_0x382c92){return _0x382c92?{'count':_0x13f857,'rows':_0x382c92}:null;}})[_0x6fc6('0x2a')](respondWithResult(_0x13348a,null))[_0x6fc6('0x4d')](handleError(_0x13348a,null));};exports['addBlackLists']=function(_0x348cce,_0x42c17c,_0x4b742f){var _0x58a5b9,_0x29cab3;return db['VoiceQueue'][_0x6fc6('0x33')]({'where':{'id':_0x348cce['params']['id']}})[_0x6fc6('0x2a')](handleEntityNotFound(_0x42c17c,null))[_0x6fc6('0x2a')](function(_0x4423fe){if(_0x4423fe){_0x29cab3=_0x4423fe;return _0x4423fe[_0x6fc6('0xb5')](_0x348cce[_0x6fc6('0x5d')][_0x6fc6('0x94')],_[_0x6fc6('0x5a')](_0x348cce[_0x6fc6('0x5d')],['ids','id'])||{});}return null;})[_0x6fc6('0x98')](function(_0x32074c){var _0xaf7355;_0x58a5b9=_0x32074c||[];var _0x4ba0e5=[];if(_0x32074c){for(var _0x5d9fb6=0x0;_0x5d9fb6<_0x32074c[_0x6fc6('0x41')];_0x5d9fb6+=0x1){var _0x4fe623=_0x32074c[_0x5d9fb6]['get']({'plain':!![]});_0xaf7355=squel[_0x6fc6('0xa3')]()[_0x6fc6('0xa4')](_0x6fc6('0xb6'))[_0x6fc6('0xa5')]([_0x6fc6('0xa6'),_0x6fc6('0xb1'),_0x6fc6('0xaa'),_0x6fc6('0x67'),_0x6fc6('0x5b'),_0x6fc6('0x5c')],squel[_0x6fc6('0x84')]()[_0x6fc6('0x85')](_0x6fc6('0xa6'),_0x6fc6('0xa6'))[_0x6fc6('0x85')]('id',_0x6fc6('0xb1'))[_0x6fc6('0x85')](_0x4fe623[_0x6fc6('0xa9')][_0x6fc6('0x8c')](),'ListId')[_0x6fc6('0x85')](_0x348cce[_0x6fc6('0x60')]['id'][_0x6fc6('0x8c')](),_0x6fc6('0x67'))[_0x6fc6('0x85')](_0x6fc6('0xa7'),_0x6fc6('0x5b'))[_0x6fc6('0x85')](_0x6fc6('0xa7'),_0x6fc6('0x5c'))[_0x6fc6('0x87')](_0x6fc6('0xab'))[_0x6fc6('0x45')]('deletedAt\x20IS\x20NULL')[_0x6fc6('0x45')](_0x6fc6('0xad'),_0x4fe623[_0x6fc6('0xa9')][_0x6fc6('0x8c')]())[_0x6fc6('0x45')](_0x6fc6('0xb2')))[_0x6fc6('0x8c')]();_0x4ba0e5[_0x6fc6('0x8b')](db['sequelize'][_0x6fc6('0x3c')](_0xaf7355));}return BPromise[_0x6fc6('0x91')](_0x4ba0e5);}})[_0x6fc6('0x2a')](function(){return _0x58a5b9;})['then'](respondWithResult(_0x42c17c,null))[_0x6fc6('0x4d')](handleError(_0x42c17c,null));};exports[_0x6fc6('0xb7')]=function(_0x3acb76,_0x353b0f,_0x3fe6b8){return db['VoiceQueue'][_0x6fc6('0x33')]({'where':{'id':_0x3acb76[_0x6fc6('0x60')]['id']}})[_0x6fc6('0x2a')](handleEntityNotFound(_0x353b0f,null))[_0x6fc6('0x2a')](function(_0x5b7707){if(_0x5b7707){return _0x5b7707['removeBlackLists'](_0x3acb76['query'][_0x6fc6('0x94')]);}})[_0x6fc6('0x2a')](function(_0x35d931){if(_0x35d931){return db[_0x6fc6('0x6a')][_0x6fc6('0x2b')]({'where':{'ListId':_0x3acb76[_0x6fc6('0x3c')][_0x6fc6('0x94')],'VoiceQueueId':_0x3acb76[_0x6fc6('0x60')]['id']}})[_0x6fc6('0x2a')](function(){return _0x35d931;});}})['then'](respondWithStatusCode(_0x353b0f,null))[_0x6fc6('0x4d')](handleError(_0x353b0f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 3dd46f3..ab565dc 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 _0x2e18=['remove','hasOwnProperty','hook','exports','VoiceQueue','setMaxListeners'];(function(_0x4fe6f1,_0x386a7a){var _0x338075=function(_0x36fd1d){while(--_0x36fd1d){_0x4fe6f1['push'](_0x4fe6f1['shift']());}};_0x338075(++_0x386a7a);}(_0x2e18,0x166));var _0x82e1=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x2e18[_0x36ed3c];return _0x52a2e0;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0x82e1('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x82e1('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x82e1('0x2')};function emitEvent(_0x502dc0){return function(_0x132422,_0x3652f1,_0x265786){VoiceQueueEvents['emit'](_0x502dc0+':'+_0x132422['id'],_0x132422);VoiceQueueEvents['emit'](_0x502dc0,_0x132422);_0x265786(null);};}for(var e in events){if(events[_0x82e1('0x3')](e)){var event=events[e];VoiceQueue[_0x82e1('0x4')](e,emitEvent(event));}}module[_0x82e1('0x5')]=VoiceQueueEvents; \ No newline at end of file +var _0x7e94=['emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove'];(function(_0x1f34d3,_0x3e2bb7){var _0x42313a=function(_0x582bf8){while(--_0x582bf8){_0x1f34d3['push'](_0x1f34d3['shift']());}};_0x42313a(++_0x3e2bb7);}(_0x7e94,0x1e4));var _0x47e9=function(_0x4469c8,_0x566e20){_0x4469c8=_0x4469c8-0x0;var _0x58be7d=_0x7e94[_0x4469c8];return _0x58be7d;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x47e9('0x0'))['db'][_0x47e9('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x47e9('0x2')](0x0);var events={'afterCreate':_0x47e9('0x3'),'afterUpdate':_0x47e9('0x4'),'afterDestroy':_0x47e9('0x5')};function emitEvent(_0x69be3b){return function(_0x44bb7e,_0x3eb4b0,_0xa7ba34){VoiceQueueEvents[_0x47e9('0x6')](_0x69be3b+':'+_0x44bb7e['id'],_0x44bb7e);VoiceQueueEvents[_0x47e9('0x6')](_0x69be3b,_0x44bb7e);_0xa7ba34(null);};}for(var e in events){if(events[_0x47e9('0x7')](e)){var event=events[e];VoiceQueue[_0x47e9('0x8')](e,emitEvent(event));}}module[_0x47e9('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 37a6a2b..b046ac1 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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x7d4593,_0xd66d60){var _0x440c23=function(_0x2d83a4){while(--_0x2d83a4){_0x7d4593['push'](_0x7d4593['shift']());}};_0x440c23(++_0xd66d60);}(_0x70e0,0x17b));var _0x070e=function(_0x522e24,_0x1bd68b){_0x522e24=_0x522e24-0x0;var _0x18d370=_0x70e0[_0x522e24];return _0x18d370;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x5a99db,_0x1cece5){var _0x3aad62=function(_0x334cb7){while(--_0x334cb7){_0x5a99db['push'](_0x5a99db['shift']());}};_0x3aad62(++_0x1cece5);}(_0x3e74,0x175));var _0x43e7=function(_0x3c7689,_0x5874ab){_0x3c7689=_0x3c7689-0x0;var _0x3dbdab=_0x3e74[_0x3c7689];return _0x3dbdab;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index bae4ad8..73c94ba 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 _0x4372=['catch','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','GetVoiceQueue','find','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x22ecc4,_0x18d57a){var _0x33fc57=function(_0x4090ac){while(--_0x4090ac){_0x22ecc4['push'](_0x22ecc4['shift']());}};_0x33fc57(++_0x18d57a);}(_0x4372,0x1bc));var _0x2437=function(_0xce9195,_0x1963e1){_0xce9195=_0xce9195-0x0;var _0x530fe6=_0x4372[_0xce9195];return _0x530fe6;};'use strict';var _=require(_0x2437('0x0'));var util=require(_0x2437('0x1'));var moment=require(_0x2437('0x2'));var BPromise=require(_0x2437('0x3'));var rs=require(_0x2437('0x4'));var fs=require('fs');var Redis=require(_0x2437('0x5'));var db=require(_0x2437('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2437('0x7'));var jayson=require(_0x2437('0x8'));var client=jayson['client'][_0x2437('0x9')]({'port':0x232a});config[_0x2437('0xa')]=_['defaults'](config[_0x2437('0xa')],{'host':_0x2437('0xb'),'port':0x18eb});var socket=require(_0x2437('0xc'))(new Redis(config[_0x2437('0xa')]));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x508322,_0x33356f,_0x432c1e){return new BPromise(function(_0x3abbb7,_0x4147a1){return client[_0x2437('0xd')](_0x508322,_0x432c1e)['then'](function(_0x283a21){logger[_0x2437('0xe')](_0x2437('0xf'),_0x33356f,_0x2437('0x10'));logger[_0x2437('0x11')](_0x2437('0x12'),_0x33356f,_0x2437('0x10'),JSON[_0x2437('0x13')](_0x283a21));if(_0x283a21[_0x2437('0x14')]){if(_0x283a21[_0x2437('0x14')][_0x2437('0x15')]===0x1f4){logger[_0x2437('0x14')](_0x2437('0xf'),_0x33356f,_0x283a21['error']['message']);return _0x4147a1(_0x283a21[_0x2437('0x14')]['message']);}logger[_0x2437('0x14')](_0x2437('0xf'),_0x33356f,_0x283a21[_0x2437('0x14')][_0x2437('0x16')]);return _0x3abbb7(_0x283a21['error']['message']);}else{logger['info'](_0x2437('0xf'),_0x33356f,_0x2437('0x10'));_0x3abbb7(_0x283a21[_0x2437('0x17')]['message']);}})[_0x2437('0x18')](function(_0x20b808){logger['error'](_0x2437('0xf'),_0x33356f,_0x20b808);_0x4147a1(_0x20b808);});});}exports['GetVoiceQueue']=function(_0x2cfab3){var _0x12bca2=this;return new Promise(function(_0x4df0ba,_0x292acc){return db[_0x2437('0x19')][_0x2437('0x1a')]({'raw':_0x2cfab3[_0x2437('0x1b')]?_0x2cfab3[_0x2437('0x1b')][_0x2437('0x1c')]===undefined?!![]:![]:!![],'where':_0x2cfab3[_0x2437('0x1b')]?_0x2cfab3['options'][_0x2437('0x1d')]||null:null,'attributes':_0x2cfab3[_0x2437('0x1b')]?_0x2cfab3[_0x2437('0x1b')][_0x2437('0x1e')]||null:null,'limit':_0x2cfab3[_0x2437('0x1b')]?_0x2cfab3['options'][_0x2437('0x1f')]||null:null,'include':_0x2cfab3[_0x2437('0x1b')]?_0x2cfab3[_0x2437('0x1b')][_0x2437('0x20')]?_[_0x2437('0x21')](_0x2cfab3[_0x2437('0x1b')][_0x2437('0x20')],function(_0x54cb11){return{'model':db[_0x54cb11[_0x2437('0x22')]],'as':_0x54cb11['as'],'attributes':_0x54cb11['attributes'],'include':_0x54cb11[_0x2437('0x20')]?_['map'](_0x54cb11[_0x2437('0x20')],function(_0x10f081){return{'model':db[_0x10f081[_0x2437('0x22')]],'as':_0x10f081['as'],'attributes':_0x10f081[_0x2437('0x1e')],'include':_0x10f081[_0x2437('0x20')]?_[_0x2437('0x21')](_0x10f081[_0x2437('0x20')],function(_0x4f246d){return{'model':db[_0x4f246d[_0x2437('0x22')]],'as':_0x4f246d['as'],'attributes':_0x4f246d[_0x2437('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2437('0x23')](function(_0xa64c6){logger[_0x2437('0xe')](_0x2437('0x24'),_0x2cfab3);logger[_0x2437('0x11')](_0x2437('0x24'),_0x2cfab3,JSON[_0x2437('0x13')](_0xa64c6));_0x4df0ba(_0xa64c6);})[_0x2437('0x18')](function(_0x51e74b){logger[_0x2437('0x14')](_0x2437('0x24'),_0x51e74b[_0x2437('0x16')],_0x2cfab3);_0x292acc(_0x12bca2[_0x2437('0x14')](0x1f4,_0x51e74b[_0x2437('0x16')]));});});};exports['ShowVoiceQueue']=function(_0x14c394){var _0x45109a=this;return new Promise(function(_0x5b253f,_0x3304af){return db[_0x2437('0x19')][_0x2437('0x25')]({'raw':_0x14c394['options']?_0x14c394['options'][_0x2437('0x1c')]===undefined?!![]:![]:!![],'where':_0x14c394[_0x2437('0x1b')]?_0x14c394[_0x2437('0x1b')][_0x2437('0x1d')]||null:null,'attributes':_0x14c394['options']?_0x14c394[_0x2437('0x1b')][_0x2437('0x1e')]||null:null,'include':_0x14c394[_0x2437('0x1b')]?_0x14c394['options'][_0x2437('0x20')]?_[_0x2437('0x21')](_0x14c394['options'][_0x2437('0x20')],function(_0x506ea4){return{'model':db[_0x506ea4[_0x2437('0x22')]],'as':_0x506ea4['as'],'attributes':_0x506ea4[_0x2437('0x1e')],'include':_0x506ea4[_0x2437('0x20')]?_[_0x2437('0x21')](_0x506ea4[_0x2437('0x20')],function(_0x1f4ac0){return{'model':db[_0x1f4ac0[_0x2437('0x22')]],'as':_0x1f4ac0['as'],'attributes':_0x1f4ac0[_0x2437('0x1e')],'include':_0x1f4ac0['include']?_[_0x2437('0x21')](_0x1f4ac0[_0x2437('0x20')],function(_0x44ca27){return{'model':db[_0x44ca27[_0x2437('0x22')]],'as':_0x44ca27['as'],'attributes':_0x44ca27['attributes']};}):[]};}):[]};}):[]:[]})[_0x2437('0x23')](function(_0x34157b){logger[_0x2437('0xe')](_0x2437('0x26'),_0x14c394);logger[_0x2437('0x11')](_0x2437('0x26'),_0x14c394,JSON[_0x2437('0x13')](_0x34157b));_0x5b253f(_0x34157b);})['catch'](function(_0x3839e1){logger[_0x2437('0x14')](_0x2437('0x26'),_0x3839e1[_0x2437('0x16')],_0x14c394);_0x3304af(_0x45109a[_0x2437('0x14')](0x1f4,_0x3839e1[_0x2437('0x16')]));});});}; \ No newline at end of file +var _0xeb31=['localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowVoiceQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x29b761,_0x5eb618){var _0x1814fb=function(_0x25f7d7){while(--_0x25f7d7){_0x29b761['push'](_0x29b761['shift']());}};_0x1814fb(++_0x5eb618);}(_0xeb31,0xe9));var _0x1eb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb31[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1eb3('0x0'));var util=require(_0x1eb3('0x1'));var moment=require('moment');var BPromise=require(_0x1eb3('0x2'));var rs=require(_0x1eb3('0x3'));var fs=require('fs');var Redis=require(_0x1eb3('0x4'));var db=require(_0x1eb3('0x5'))['db'];var utils=require(_0x1eb3('0x6'));var logger=require(_0x1eb3('0x7'))('rpc');var config=require(_0x1eb3('0x8'));var jayson=require(_0x1eb3('0x9'));var client=jayson[_0x1eb3('0xa')][_0x1eb3('0xb')]({'port':0x232a});config[_0x1eb3('0xc')]=_['defaults'](config[_0x1eb3('0xc')],{'host':_0x1eb3('0xd'),'port':0x18eb});var socket=require(_0x1eb3('0xe'))(new Redis(config['redis']));require(_0x1eb3('0xf'))[_0x1eb3('0x10')](socket);function respondWithRpcPromise(_0x32daa1,_0x5a2c39,_0x2c0532){return new BPromise(function(_0x50eb58,_0x52bb1d){return client['request'](_0x32daa1,_0x2c0532)[_0x1eb3('0x11')](function(_0x479c9f){logger[_0x1eb3('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x5a2c39,_0x1eb3('0x13'));logger[_0x1eb3('0x14')](_0x1eb3('0x15'),_0x5a2c39,_0x1eb3('0x13'),JSON['stringify'](_0x479c9f));if(_0x479c9f['error']){if(_0x479c9f[_0x1eb3('0x16')][_0x1eb3('0x17')]===0x1f4){logger[_0x1eb3('0x16')](_0x1eb3('0x18'),_0x5a2c39,_0x479c9f['error'][_0x1eb3('0x19')]);return _0x52bb1d(_0x479c9f['error'][_0x1eb3('0x19')]);}logger[_0x1eb3('0x16')](_0x1eb3('0x18'),_0x5a2c39,_0x479c9f[_0x1eb3('0x16')][_0x1eb3('0x19')]);return _0x50eb58(_0x479c9f[_0x1eb3('0x16')][_0x1eb3('0x19')]);}else{logger[_0x1eb3('0x12')](_0x1eb3('0x18'),_0x5a2c39,_0x1eb3('0x13'));_0x50eb58(_0x479c9f[_0x1eb3('0x1a')][_0x1eb3('0x19')]);}})[_0x1eb3('0x1b')](function(_0x3c39ca){logger['error'](_0x1eb3('0x18'),_0x5a2c39,_0x3c39ca);_0x52bb1d(_0x3c39ca);});});}exports[_0x1eb3('0x1c')]=function(_0x4553e0){var _0x31d109=this;return new Promise(function(_0x5c5f69,_0x5bcdb0){return db[_0x1eb3('0x1d')][_0x1eb3('0x1e')]({'raw':_0x4553e0['options']?_0x4553e0[_0x1eb3('0x1f')][_0x1eb3('0x20')]===undefined?!![]:![]:!![],'where':_0x4553e0['options']?_0x4553e0[_0x1eb3('0x1f')][_0x1eb3('0x21')]||null:null,'attributes':_0x4553e0['options']?_0x4553e0[_0x1eb3('0x1f')][_0x1eb3('0x22')]||null:null,'limit':_0x4553e0['options']?_0x4553e0[_0x1eb3('0x1f')][_0x1eb3('0x23')]||null:null,'include':_0x4553e0[_0x1eb3('0x1f')]?_0x4553e0[_0x1eb3('0x1f')][_0x1eb3('0x24')]?_[_0x1eb3('0x25')](_0x4553e0[_0x1eb3('0x1f')][_0x1eb3('0x24')],function(_0x57176d){return{'model':db[_0x57176d['model']],'as':_0x57176d['as'],'attributes':_0x57176d[_0x1eb3('0x22')],'include':_0x57176d['include']?_[_0x1eb3('0x25')](_0x57176d[_0x1eb3('0x24')],function(_0xd56c8f){return{'model':db[_0xd56c8f[_0x1eb3('0x26')]],'as':_0xd56c8f['as'],'attributes':_0xd56c8f[_0x1eb3('0x22')],'include':_0xd56c8f[_0x1eb3('0x24')]?_[_0x1eb3('0x25')](_0xd56c8f[_0x1eb3('0x24')],function(_0x1a4802){return{'model':db[_0x1a4802['model']],'as':_0x1a4802['as'],'attributes':_0x1a4802[_0x1eb3('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1eb3('0x11')](function(_0x3f1570){logger['info'](_0x1eb3('0x1c'),_0x4553e0);logger[_0x1eb3('0x14')](_0x1eb3('0x1c'),_0x4553e0,JSON['stringify'](_0x3f1570));_0x5c5f69(_0x3f1570);})[_0x1eb3('0x1b')](function(_0x4a4d9e){logger[_0x1eb3('0x16')]('GetVoiceQueue',_0x4a4d9e[_0x1eb3('0x19')],_0x4553e0);_0x5bcdb0(_0x31d109[_0x1eb3('0x16')](0x1f4,_0x4a4d9e[_0x1eb3('0x19')]));});});};exports['ShowVoiceQueue']=function(_0x2080da){var _0x4da455=this;return new Promise(function(_0x483e61,_0x452c2e){return db[_0x1eb3('0x1d')][_0x1eb3('0x27')]({'raw':_0x2080da[_0x1eb3('0x1f')]?_0x2080da['options']['raw']===undefined?!![]:![]:!![],'where':_0x2080da['options']?_0x2080da['options']['where']||null:null,'attributes':_0x2080da['options']?_0x2080da[_0x1eb3('0x1f')][_0x1eb3('0x22')]||null:null,'include':_0x2080da[_0x1eb3('0x1f')]?_0x2080da[_0x1eb3('0x1f')][_0x1eb3('0x24')]?_[_0x1eb3('0x25')](_0x2080da[_0x1eb3('0x1f')][_0x1eb3('0x24')],function(_0x2143c7){return{'model':db[_0x2143c7[_0x1eb3('0x26')]],'as':_0x2143c7['as'],'attributes':_0x2143c7[_0x1eb3('0x22')],'include':_0x2143c7[_0x1eb3('0x24')]?_[_0x1eb3('0x25')](_0x2143c7[_0x1eb3('0x24')],function(_0x356ed6){return{'model':db[_0x356ed6[_0x1eb3('0x26')]],'as':_0x356ed6['as'],'attributes':_0x356ed6['attributes'],'include':_0x356ed6[_0x1eb3('0x24')]?_[_0x1eb3('0x25')](_0x356ed6[_0x1eb3('0x24')],function(_0x1536ee){return{'model':db[_0x1536ee['model']],'as':_0x1536ee['as'],'attributes':_0x1536ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x1eb3('0x11')](function(_0x3dfdd2){logger[_0x1eb3('0x12')]('ShowVoiceQueue',_0x2080da);logger[_0x1eb3('0x14')](_0x1eb3('0x28'),_0x2080da,JSON['stringify'](_0x3dfdd2));_0x483e61(_0x3dfdd2);})[_0x1eb3('0x1b')](function(_0xfd6174){logger[_0x1eb3('0x16')](_0x1eb3('0x28'),_0xfd6174[_0x1eb3('0x19')],_0x2080da);_0x452c2e(_0x4da455[_0x1eb3('0x16')](0x1f4,_0xfd6174['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 3aef2f0..ab1e1f8 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 _0x288a=['update','emit','removeListener','register','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x288a,0x1e9));var _0xa288=function(_0x2cf50d,_0x12d3c2){_0x2cf50d=_0x2cf50d-0x0;var _0x257c6e=_0x288a[_0x2cf50d];return _0x257c6e;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xa288('0x0'),'remove',_0xa288('0x1')];function createListener(_0x468c4b,_0x4e77e4){return function(_0x5b0bcd){_0x4e77e4[_0xa288('0x2')](_0x468c4b,_0x5b0bcd);};}function removeListener(_0x30cf62,_0x174c59){return function(){VoiceQueueEvents[_0xa288('0x3')](_0x30cf62,_0x174c59);};}exports[_0xa288('0x4')]=function(_0x5dbf1c){for(var _0x27444d=0x0,_0x318064=events['length'];_0x27444d<_0x318064;_0x27444d++){var _0xa8dce9=events[_0x27444d];var _0x3dda86=createListener('voiceQueue:'+_0xa8dce9,_0x5dbf1c);VoiceQueueEvents['on'](_0xa8dce9,_0x3dda86);}}; \ No newline at end of file +var _0xdc73=['register','length','voiceQueue:','./voiceQueue.events','emit','removeListener'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdc73,0x10b));var _0x3dc7=function(_0x544667,_0xa66aa3){_0x544667=_0x544667-0x0;var _0x4558a3=_0xdc73[_0x544667];return _0x4558a3;};'use strict';var VoiceQueueEvents=require(_0x3dc7('0x0'));var events=['save','remove','update'];function createListener(_0xc4013c,_0x27ab49){return function(_0x281b4b){_0x27ab49[_0x3dc7('0x1')](_0xc4013c,_0x281b4b);};}function removeListener(_0x38cb87,_0x5bf0ed){return function(){VoiceQueueEvents[_0x3dc7('0x2')](_0x38cb87,_0x5bf0ed);};}exports[_0x3dc7('0x3')]=function(_0x3b27b2){for(var _0x481d2a=0x0,_0x46e71b=events[_0x3dc7('0x4')];_0x481d2a<_0x46e71b;_0x481d2a++){var _0x56a035=events[_0x481d2a];var _0x527787=createListener(_0x3dc7('0x5')+_0x56a035,_0x3b27b2);VoiceQueueEvents['on'](_0x56a035,_0x527787);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index c404f57..5063b33 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 _0xfbc6=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','get','describe','/index','getVoiceQueuesReport','/:id','show','post','create','delete','destroy','multer','util','Router'];(function(_0x5e3701,_0x596265){var _0x345dcf=function(_0x5eb12a){while(--_0x5eb12a){_0x5e3701['push'](_0x5e3701['shift']());}};_0x345dcf(++_0x596265);}(_0xfbc6,0x1d8));var _0x6fbc=function(_0x429a21,_0x43b4e0){_0x429a21=_0x429a21-0x0;var _0x3a8c04=_0xfbc6[_0x429a21];return _0x3a8c04;};'use strict';var multer=require(_0x6fbc('0x0'));var util=require(_0x6fbc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6fbc('0x2')]();var fs_extra=require(_0x6fbc('0x3'));var auth=require(_0x6fbc('0x4'));var interaction=require(_0x6fbc('0x5'));var config=require(_0x6fbc('0x6'));var controller=require(_0x6fbc('0x7'));router['get']('/',auth[_0x6fbc('0x8')](),controller['index']);router[_0x6fbc('0x9')]('/describe',auth[_0x6fbc('0x8')](),controller[_0x6fbc('0xa')]);router['get'](_0x6fbc('0xb'),auth['isAuthenticated'](),controller[_0x6fbc('0xc')]);router[_0x6fbc('0x9')](_0x6fbc('0xd'),auth['isAuthenticated'](),controller[_0x6fbc('0xe')]);router[_0x6fbc('0xf')]('/',auth[_0x6fbc('0x8')](),controller[_0x6fbc('0x10')]);router['put'](_0x6fbc('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x6fbc('0x11')](_0x6fbc('0xd'),auth[_0x6fbc('0x8')](),controller[_0x6fbc('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9ff7=['getVoiceQueuesReport','/:id','post','create','put','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x386625,_0x477fdb){var _0x3150f7=function(_0xf0d835){while(--_0xf0d835){_0x386625['push'](_0x386625['shift']());}};_0x3150f7(++_0x477fdb);}(_0x9ff7,0x17e));var _0x79ff=function(_0x18ec6e,_0x2636d2){_0x18ec6e=_0x18ec6e-0x0;var _0x3605e5=_0x9ff7[_0x18ec6e];return _0x3605e5;};'use strict';var multer=require(_0x79ff('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x79ff('0x1'));var express=require(_0x79ff('0x2'));var router=express[_0x79ff('0x3')]();var fs_extra=require(_0x79ff('0x4'));var auth=require(_0x79ff('0x5'));var interaction=require(_0x79ff('0x6'));var config=require(_0x79ff('0x7'));var controller=require(_0x79ff('0x8'));router[_0x79ff('0x9')]('/',auth['isAuthenticated'](),controller[_0x79ff('0xa')]);router[_0x79ff('0x9')](_0x79ff('0xb'),auth[_0x79ff('0xc')](),controller[_0x79ff('0xd')]);router[_0x79ff('0x9')]('/index',auth[_0x79ff('0xc')](),controller[_0x79ff('0xe')]);router[_0x79ff('0x9')](_0x79ff('0xf'),auth[_0x79ff('0xc')](),controller['show']);router[_0x79ff('0x10')]('/',auth['isAuthenticated'](),controller[_0x79ff('0x11')]);router[_0x79ff('0x12')](_0x79ff('0xf'),auth['isAuthenticated'](),controller[_0x79ff('0x13')]);router['delete'](_0x79ff('0xf'),auth[_0x79ff('0xc')](),controller[_0x79ff('0x14')]);module[_0x79ff('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 89dd16e..48629b0 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 _0xcc07=['INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0xcc07,0xb3));var _0x7cc0=function(_0x24679e,_0x22d9d7){_0x24679e=_0x24679e-0x0;var _0x291f21=_0xcc07[_0x24679e];return _0x291f21;};'use strict';var Sequelize=require(_0x7cc0('0x0'));var moment=require(_0x7cc0('0x1'));module[_0x7cc0('0x2')]={'type':{'type':Sequelize[_0x7cc0('0x3')]},'uniqueid':{'type':Sequelize[_0x7cc0('0x3')]},'calleridnum':{'type':Sequelize[_0x7cc0('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x7cc0('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x7cc0('0x4')],'set':function(_0x3d5e9a){var _0x4f5de5=moment(_0x3d5e9a);var _0x4ca927=moment(this[_0x7cc0('0x5')](_0x7cc0('0x6')))[_0x7cc0('0x7')](_0x7cc0('0x8'));var _0x4e3398=_0x4f5de5['diff'](_0x4ca927,_0x7cc0('0x9'));this[_0x7cc0('0xa')](_0x7cc0('0xb'),_0x3d5e9a);this['setDataValue'](_0x7cc0('0xc'),_0x4e3398||null);}},'position':{'type':Sequelize[_0x7cc0('0xd')]},'count':{'type':Sequelize[_0x7cc0('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x7cc0('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x7cc0('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x7cc0('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x7cc0('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x7cc0('0xf')},'originalposition':{'type':Sequelize[_0x7cc0('0xd')]},'channel':{'type':Sequelize[_0x7cc0('0x3')]},'connectedlinenum':{'type':Sequelize[_0x7cc0('0x3')]},'connectedlinename':{'type':Sequelize[_0x7cc0('0x3')]},'accountcode':{'type':Sequelize[_0x7cc0('0x3')]},'context':{'type':Sequelize[_0x7cc0('0x3')]},'exten':{'type':Sequelize[_0x7cc0('0x3')]},'priority':{'type':Sequelize[_0x7cc0('0x3')]},'holdtime':{'type':Sequelize[_0x7cc0('0xd')]},'mohtime':{'type':Sequelize[_0x7cc0('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7cc0('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x7cc0('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7cc0('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x7cc0('0x3')]},'transferuniqueid':{'type':Sequelize[_0x7cc0('0x3')]},'disposition':{'type':Sequelize[_0x7cc0('0x3')]},'secondDisposition':{'type':Sequelize[_0x7cc0('0x3')]},'thirdDisposition':{'type':Sequelize[_0x7cc0('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x7cc0('0xd')],'defaultValue':0x0}}; \ No newline at end of file +var _0x83cf=['INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime'];(function(_0x2c3840,_0xc86a1c){var _0x32c03a=function(_0x1820b0){while(--_0x1820b0){_0x2c3840['push'](_0x2c3840['shift']());}};_0x32c03a(++_0xc86a1c);}(_0x83cf,0xb9));var _0xf83c=function(_0x2e866f,_0x32ac48){_0x2e866f=_0x2e866f-0x0;var _0x2b8196=_0x83cf[_0x2e866f];return _0x2b8196;};'use strict';var Sequelize=require(_0xf83c('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0xf83c('0x1')]},'uniqueid':{'type':Sequelize[_0xf83c('0x1')]},'calleridnum':{'type':Sequelize[_0xf83c('0x1')]},'calleridname':{'type':Sequelize[_0xf83c('0x1')]},'queue':{'type':Sequelize[_0xf83c('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0xf83c('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0xf83c('0x2')],'set':function(_0xa05af8){var _0x370d73=moment(_0xa05af8);var _0x1235bf=moment(this[_0xf83c('0x3')](_0xf83c('0x4')))['format'](_0xf83c('0x5'));var _0x26903b=_0x370d73[_0xf83c('0x6')](_0x1235bf,_0xf83c('0x7'));this[_0xf83c('0x8')](_0xf83c('0x9'),_0xa05af8);this[_0xf83c('0x8')](_0xf83c('0xa'),_0x26903b||null);}},'position':{'type':Sequelize[_0xf83c('0xb')]},'count':{'type':Sequelize[_0xf83c('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xf83c('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xf83c('0x2')]},'queuecallerexit':{'type':Sequelize[_0xf83c('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xf83c('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0xf83c('0x1')],'comment':_0xf83c('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xf83c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xf83c('0x1')]},'connectedlinename':{'type':Sequelize[_0xf83c('0x1')]},'accountcode':{'type':Sequelize[_0xf83c('0x1')]},'context':{'type':Sequelize[_0xf83c('0x1')]},'exten':{'type':Sequelize[_0xf83c('0x1')]},'priority':{'type':Sequelize[_0xf83c('0x1')]},'holdtime':{'type':Sequelize[_0xf83c('0xb')]},'mohtime':{'type':Sequelize[_0xf83c('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf83c('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xf83c('0x1')]},'transfer':{'type':Sequelize[_0xf83c('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xf83c('0x1')]},'transferuniqueid':{'type':Sequelize[_0xf83c('0x1')]},'disposition':{'type':Sequelize[_0xf83c('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf83c('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0xf83c('0xb')],'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 0086d06..60df458 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 _0xcb1e=['jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','stack','name','send','index','map','VoiceQueueReport','fieldName','type','key','query','keys','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','update','describe','getVoiceQueuesReport','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto'];(function(_0x14ef49,_0x3aad01){var _0x330a97=function(_0x1018c2){while(--_0x1018c2){_0x14ef49['push'](_0x14ef49['shift']());}};_0x330a97(++_0x3aad01);}(_0xcb1e,0x93));var _0xecb1=function(_0x409deb,_0x2b731){_0x409deb=_0x409deb-0x0;var _0x15a4f7=_0xcb1e[_0x409deb];return _0x15a4f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xecb1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xecb1('0x1'));var rp=require(_0xecb1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xecb1('0x3'));var util=require(_0xecb1('0x4'));var path=require(_0xecb1('0x5'));var sox=require(_0xecb1('0x6'));var csv=require(_0xecb1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xecb1('0x8'));var squel=require(_0xecb1('0x9'));var crypto=require(_0xecb1('0xa'));var jsforce=require(_0xecb1('0xb'));var deskjs=require(_0xecb1('0xc'));var toCsv=require(_0xecb1('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xecb1('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xecb1('0xe'));var as=require(_0xecb1('0xf'));var hardwareService=require(_0xecb1('0x10'));var logger=require(_0xecb1('0x11'))(_0xecb1('0x12'));var utils=require(_0xecb1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xecb1('0x14'));var db=require(_0xecb1('0x15'))['db'];config[_0xecb1('0x16')]=_[_0xecb1('0x17')](config[_0xecb1('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xecb1('0x18'))(new Redis(config['redis']));require(_0xecb1('0x19'))[_0xecb1('0x1a')](socket);function respondWithStatusCode(_0x347d68,_0x3bb3c8){_0x3bb3c8=_0x3bb3c8||0xcc;return function(_0x3567a8){if(_0x3567a8){return _0x347d68[_0xecb1('0x1b')](_0x3bb3c8);}return _0x347d68[_0xecb1('0x1c')](_0x3bb3c8)[_0xecb1('0x1d')]();};}function respondWithResult(_0x1301ad,_0x11ee61){_0x11ee61=_0x11ee61||0xc8;return function(_0x282edb){if(_0x282edb){return _0x1301ad[_0xecb1('0x1c')](_0x11ee61)[_0xecb1('0x1e')](_0x282edb);}};}function respondWithFilteredResult(_0x3246fc,_0xca12a8){return function(_0x362699){if(_0x362699){var _0x4462cc=typeof _0xca12a8[_0xecb1('0x1f')]===_0xecb1('0x20')&&typeof _0xca12a8[_0xecb1('0x21')]==='undefined';var _0x2a2d5a=_0x362699[_0xecb1('0x22')];var _0x33e888=_0x4462cc?0x0:_0xca12a8[_0xecb1('0x1f')];var _0x3b3d1d=_0x4462cc?_0x362699['count']:_0xca12a8[_0xecb1('0x1f')]+_0xca12a8['limit'];var _0x6e4401;if(_0x3b3d1d>=_0x2a2d5a){_0x3b3d1d=_0x2a2d5a;_0x6e4401=0xc8;}else{_0x6e4401=0xce;}_0x3246fc[_0xecb1('0x1c')](_0x6e4401);return _0x3246fc['set']('Content-Range',_0x33e888+'-'+_0x3b3d1d+'/'+_0x2a2d5a)['json'](_0x362699);}return null;};}function patchUpdates(_0x1db29a){return function(_0x3e5d89){try{jsonpatch[_0xecb1('0x23')](_0x3e5d89,_0x1db29a,!![]);}catch(_0x2b0be4){return BPromise[_0xecb1('0x24')](_0x2b0be4);}return _0x3e5d89[_0xecb1('0x25')]();};}function saveUpdates(_0x3d4b12,_0xd93cba){return function(_0xd874fc){if(_0xd874fc){return _0xd874fc['update'](_0x3d4b12)[_0xecb1('0x26')](function(_0x31e064){return _0x31e064;});}return null;};}function removeEntity(_0x10b378,_0x20f494){return function(_0x3eefd5){if(_0x3eefd5){return _0x3eefd5[_0xecb1('0x27')]()[_0xecb1('0x26')](function(){_0x10b378[_0xecb1('0x1c')](0xcc)[_0xecb1('0x1d')]();});}};}function handleEntityNotFound(_0x11cf81,_0x578ecc){return function(_0x399865){if(!_0x399865){_0x11cf81[_0xecb1('0x1b')](0x194);}return _0x399865;};}function handleError(_0x3bd8dc,_0x11db8c){_0x11db8c=_0x11db8c||0x1f4;return function(_0x4a74ee){logger['error'](_0x4a74ee[_0xecb1('0x28')]);if(_0x4a74ee[_0xecb1('0x29')]){delete _0x4a74ee[_0xecb1('0x29')];}_0x3bd8dc[_0xecb1('0x1c')](_0x11db8c)[_0xecb1('0x2a')](_0x4a74ee);};}exports[_0xecb1('0x2b')]=function(_0x5ebd20,_0xe69886){var _0x408ff4={},_0x58e1e6={},_0x1a81ba={'count':0x0,'rows':[]};var _0xe6a6bb=_[_0xecb1('0x2c')](db[_0xecb1('0x2d')]['rawAttributes'],function(_0x341f90){return{'name':_0x341f90[_0xecb1('0x2e')],'type':_0x341f90[_0xecb1('0x2f')][_0xecb1('0x30')]};});_0x58e1e6['model']=_[_0xecb1('0x2c')](_0xe6a6bb,_0xecb1('0x29'));_0x58e1e6[_0xecb1('0x31')]=_[_0xecb1('0x32')](_0x5ebd20[_0xecb1('0x31')]);_0x58e1e6['filters']=_[_0xecb1('0x33')](_0x58e1e6['model'],_0x58e1e6[_0xecb1('0x31')]);_0x408ff4[_0xecb1('0x34')]=_[_0xecb1('0x33')](_0x58e1e6[_0xecb1('0x35')],qs['fields'](_0x5ebd20[_0xecb1('0x31')][_0xecb1('0x36')]));_0x408ff4[_0xecb1('0x34')]=_0x408ff4[_0xecb1('0x34')]['length']?_0x408ff4['attributes']:_0x58e1e6[_0xecb1('0x35')];if(!_0x5ebd20[_0xecb1('0x31')][_0xecb1('0x37')](_0xecb1('0x38'))){_0x408ff4[_0xecb1('0x21')]=qs[_0xecb1('0x21')](_0x5ebd20[_0xecb1('0x31')][_0xecb1('0x21')]);_0x408ff4[_0xecb1('0x1f')]=qs['offset'](_0x5ebd20['query']['offset']);}_0x408ff4[_0xecb1('0x39')]=qs['sort'](_0x5ebd20[_0xecb1('0x31')][_0xecb1('0x3a')]);_0x408ff4[_0xecb1('0x3b')]=qs[_0xecb1('0x3c')](_['pick'](_0x5ebd20[_0xecb1('0x31')],_0x58e1e6[_0xecb1('0x3c')]),_0xe6a6bb);if(_0x5ebd20[_0xecb1('0x31')][_0xecb1('0x3d')]){_0x408ff4[_0xecb1('0x3b')]=_[_0xecb1('0x3e')](_0x408ff4['where'],{'$or':_[_0xecb1('0x2c')](_0xe6a6bb,function(_0xe4ed94){if(_0xe4ed94[_0xecb1('0x2f')]!==_0xecb1('0x3f')){var _0x3e0a84={};_0x3e0a84[_0xe4ed94['name']]={'$like':'%'+_0x5ebd20['query'][_0xecb1('0x3d')]+'%'};return _0x3e0a84;}})});}_0x408ff4=_[_0xecb1('0x3e')]({},_0x408ff4,_0x5ebd20[_0xecb1('0x40')]);var _0x62872d={'where':_0x408ff4[_0xecb1('0x3b')]};return db[_0xecb1('0x2d')][_0xecb1('0x22')](_0x62872d)[_0xecb1('0x26')](function(_0x16cf3e){_0x1a81ba['count']=_0x16cf3e;if(_0x5ebd20['query'][_0xecb1('0x41')]){_0x408ff4[_0xecb1('0x42')]=[{'all':!![]}];}return db[_0xecb1('0x2d')][_0xecb1('0x43')](_0x408ff4);})['then'](function(_0x2624eb){_0x1a81ba['rows']=_0x2624eb;return _0x1a81ba;})['then'](respondWithFilteredResult(_0xe69886,_0x408ff4))[_0xecb1('0x44')](handleError(_0xe69886,null));};exports[_0xecb1('0x45')]=function(_0x2555cb,_0x5892d3){var _0x1c0fa2={'raw':![],'where':{'id':_0x2555cb[_0xecb1('0x46')]['id']}},_0x47528b={};_0x47528b[_0xecb1('0x35')]=_[_0xecb1('0x32')](db[_0xecb1('0x2d')][_0xecb1('0x47')]);_0x47528b[_0xecb1('0x31')]=_['keys'](_0x2555cb[_0xecb1('0x31')]);_0x47528b['filters']=_[_0xecb1('0x33')](_0x47528b['model'],_0x47528b[_0xecb1('0x31')]);_0x1c0fa2[_0xecb1('0x34')]=_[_0xecb1('0x33')](_0x47528b[_0xecb1('0x35')],qs[_0xecb1('0x36')](_0x2555cb[_0xecb1('0x31')][_0xecb1('0x36')]));_0x1c0fa2[_0xecb1('0x34')]=_0x1c0fa2['attributes'][_0xecb1('0x48')]?_0x1c0fa2[_0xecb1('0x34')]:_0x47528b[_0xecb1('0x35')];if(_0x2555cb[_0xecb1('0x31')][_0xecb1('0x41')]){_0x1c0fa2[_0xecb1('0x42')]=[{'all':!![]}];}_0x1c0fa2=_['merge']({},_0x1c0fa2,_0x2555cb['options']);return db[_0xecb1('0x2d')][_0xecb1('0x49')](_0x1c0fa2)['then'](handleEntityNotFound(_0x5892d3,null))[_0xecb1('0x26')](respondWithResult(_0x5892d3,null))[_0xecb1('0x44')](handleError(_0x5892d3,null));};exports[_0xecb1('0x4a')]=function(_0x1fe604,_0x1f5652){return db[_0xecb1('0x2d')][_0xecb1('0x4a')](_0x1fe604[_0xecb1('0x4b')],{})[_0xecb1('0x26')](respondWithResult(_0x1f5652,0xc9))[_0xecb1('0x44')](handleError(_0x1f5652,null));};exports[_0xecb1('0x4c')]=function(_0xda1cbb,_0x1e1c72){if(_0xda1cbb['body']['id']){delete _0xda1cbb[_0xecb1('0x4b')]['id'];}return db[_0xecb1('0x2d')]['find']({'where':{'id':_0xda1cbb['params']['id']}})[_0xecb1('0x26')](handleEntityNotFound(_0x1e1c72,null))[_0xecb1('0x26')](saveUpdates(_0xda1cbb[_0xecb1('0x4b')],null))['then'](respondWithResult(_0x1e1c72,null))[_0xecb1('0x44')](handleError(_0x1e1c72,null));};exports[_0xecb1('0x27')]=function(_0x555dcf,_0x2c7764){return db['VoiceQueueReport'][_0xecb1('0x49')]({'where':{'id':_0x555dcf[_0xecb1('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c7764,null))[_0xecb1('0x26')](removeEntity(_0x2c7764,null))[_0xecb1('0x44')](handleError(_0x2c7764,null));};exports[_0xecb1('0x4d')]=function(_0x526a95,_0x2d303e){return db[_0xecb1('0x2d')][_0xecb1('0x4d')]()[_0xecb1('0x26')](respondWithResult(_0x2d303e,null))['catch'](handleError(_0x2d303e,null));};exports[_0xecb1('0x4e')]=function(_0x11856a,_0x1421c6){var _0x167709={},_0x5dafcc={},_0x42c521={'count':0x0,'rows':[]};_0x5dafcc[_0xecb1('0x35')]=_[_0xecb1('0x32')](db[_0xecb1('0x2d')]['rawAttributes']);_0x5dafcc[_0xecb1('0x31')]=_[_0xecb1('0x32')](_0x11856a[_0xecb1('0x31')]);_0x5dafcc[_0xecb1('0x3c')]=_[_0xecb1('0x33')](_0x5dafcc[_0xecb1('0x35')],_0x5dafcc[_0xecb1('0x31')]);_0x167709[_0xecb1('0x34')]=_[_0xecb1('0x33')](_0x5dafcc[_0xecb1('0x35')],qs[_0xecb1('0x36')](_0x11856a['query']['fields']));_0x167709[_0xecb1('0x34')]=_0x167709[_0xecb1('0x34')][_0xecb1('0x48')]?_0x167709[_0xecb1('0x34')]:_0x5dafcc[_0xecb1('0x35')];if(!_0x11856a[_0xecb1('0x31')]['hasOwnProperty'](_0xecb1('0x38'))){_0x167709[_0xecb1('0x21')]=qs[_0xecb1('0x21')](_0x11856a[_0xecb1('0x31')][_0xecb1('0x21')]);_0x167709[_0xecb1('0x1f')]=qs[_0xecb1('0x1f')](_0x11856a[_0xecb1('0x31')]['offset']);}_0x167709['order']=qs[_0xecb1('0x3a')](_0x11856a[_0xecb1('0x31')]['sort']);_0x167709[_0xecb1('0x3b')]=qs[_0xecb1('0x3c')](_['pick'](_0x11856a['query'],_0x5dafcc[_0xecb1('0x3c')]));if(_0x11856a[_0xecb1('0x31')][_0xecb1('0x3d')]){_0x167709[_0xecb1('0x3b')]=_['merge'](_0x167709['where'],{'$or':_[_0xecb1('0x2c')](_0x167709[_0xecb1('0x34')],function(_0x39ce7a){var _0x3e03b1={};_0x3e03b1[_0x39ce7a]={'$like':'%'+_0x11856a[_0xecb1('0x31')][_0xecb1('0x3d')]+'%'};return _0x3e03b1;})});}_0x167709=_[_0xecb1('0x3e')]({},_0x167709,_0x11856a['options']);var _0x56817a={'where':_0x167709['where']};return db[_0xecb1('0x2d')][_0xecb1('0x22')](_0x56817a)[_0xecb1('0x26')](function(_0x57c64f){_0x42c521[_0xecb1('0x22')]=_0x57c64f;if(_0x11856a[_0xecb1('0x31')][_0xecb1('0x41')]){_0x167709[_0xecb1('0x42')]=[{'all':!![]}];}return db[_0xecb1('0x2d')][_0xecb1('0x43')](_0x167709);})[_0xecb1('0x26')](function(_0x3cef2e){_0x42c521['rows']=_0x3cef2e;return _0x42c521;})['then'](respondWithFilteredResult(_0x1421c6,_0x167709,_0xecb1('0x4e')))[_0xecb1('0x44')](handleError(_0x1421c6,null,_0xecb1('0x4e')));}; \ No newline at end of file +var _0xd0d4=['options','includeAll','include','findAll','show','params','find','catch','create','body','getVoiceQueuesReport','nolimit','rows','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','json','offset','limit','undefined','count','status','Content-Range','apply','reject','update','then','destroy','end','error','name','send','index','map','VoiceQueueReport','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter'];(function(_0xb549f1,_0x186170){var _0x1efbee=function(_0x5daad4){while(--_0x5daad4){_0xb549f1['push'](_0xb549f1['shift']());}};_0x1efbee(++_0x186170);}(_0xd0d4,0x1e1));var _0x4d0d=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xd0d4[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4d0d('0x0'));var rp=require(_0x4d0d('0x1'));var moment=require(_0x4d0d('0x2'));var BPromise=require(_0x4d0d('0x3'));var Mustache=require(_0x4d0d('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4d0d('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d0d('0x6'));var _=require(_0x4d0d('0x7'));var squel=require(_0x4d0d('0x8'));var crypto=require(_0x4d0d('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4d0d('0x5'));var querystring=require(_0x4d0d('0xa'));var Papa=require(_0x4d0d('0xb'));var Redis=require('ioredis');var authService=require(_0x4d0d('0xc'));var qs=require(_0x4d0d('0xd'));var as=require(_0x4d0d('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d0d('0xf'))(_0x4d0d('0x10'));var utils=require(_0x4d0d('0x11'));var config=require(_0x4d0d('0x12'));var licenseUtil=require(_0x4d0d('0x13'));var db=require(_0x4d0d('0x14'))['db'];config['redis']=_[_0x4d0d('0x15')](config[_0x4d0d('0x16')],{'host':_0x4d0d('0x17'),'port':0x18eb});var socket=require(_0x4d0d('0x18'))(new Redis(config[_0x4d0d('0x16')]));require(_0x4d0d('0x19'))[_0x4d0d('0x1a')](socket);function respondWithStatusCode(_0x27a578,_0x497348){_0x497348=_0x497348||0xcc;return function(_0x28ffb8){if(_0x28ffb8){return _0x27a578[_0x4d0d('0x1b')](_0x497348);}return _0x27a578['status'](_0x497348)['end']();};}function respondWithResult(_0x4f4dde,_0x1c5d43){_0x1c5d43=_0x1c5d43||0xc8;return function(_0x1af601){if(_0x1af601){return _0x4f4dde['status'](_0x1c5d43)[_0x4d0d('0x1c')](_0x1af601);}};}function respondWithFilteredResult(_0x4c2537,_0x96d211){return function(_0x11b60f){if(_0x11b60f){var _0x5a800a=typeof _0x96d211[_0x4d0d('0x1d')]==='undefined'&&typeof _0x96d211[_0x4d0d('0x1e')]===_0x4d0d('0x1f');var _0x5bb567=_0x11b60f['count'];var _0x357707=_0x5a800a?0x0:_0x96d211[_0x4d0d('0x1d')];var _0x229022=_0x5a800a?_0x11b60f[_0x4d0d('0x20')]:_0x96d211[_0x4d0d('0x1d')]+_0x96d211['limit'];var _0x374f66;if(_0x229022>=_0x5bb567){_0x229022=_0x5bb567;_0x374f66=0xc8;}else{_0x374f66=0xce;}_0x4c2537[_0x4d0d('0x21')](_0x374f66);return _0x4c2537['set'](_0x4d0d('0x22'),_0x357707+'-'+_0x229022+'/'+_0x5bb567)['json'](_0x11b60f);}return null;};}function patchUpdates(_0x35e4af){return function(_0x311209){try{jsonpatch[_0x4d0d('0x23')](_0x311209,_0x35e4af,!![]);}catch(_0x5d900e){return BPromise[_0x4d0d('0x24')](_0x5d900e);}return _0x311209['save']();};}function saveUpdates(_0x3cb481,_0x22a2d1){return function(_0x2c104b){if(_0x2c104b){return _0x2c104b[_0x4d0d('0x25')](_0x3cb481)[_0x4d0d('0x26')](function(_0xb66253){return _0xb66253;});}return null;};}function removeEntity(_0x266071,_0x24e4ac){return function(_0x3d1a3d){if(_0x3d1a3d){return _0x3d1a3d[_0x4d0d('0x27')]()['then'](function(){_0x266071[_0x4d0d('0x21')](0xcc)[_0x4d0d('0x28')]();});}};}function handleEntityNotFound(_0x5026ee,_0x448537){return function(_0x2da9cf){if(!_0x2da9cf){_0x5026ee['sendStatus'](0x194);}return _0x2da9cf;};}function handleError(_0x3d15f6,_0x5c2360){_0x5c2360=_0x5c2360||0x1f4;return function(_0x37e8e2){logger[_0x4d0d('0x29')](_0x37e8e2['stack']);if(_0x37e8e2[_0x4d0d('0x2a')]){delete _0x37e8e2['name'];}_0x3d15f6['status'](_0x5c2360)[_0x4d0d('0x2b')](_0x37e8e2);};}exports[_0x4d0d('0x2c')]=function(_0x55f5e8,_0x4b68eb){var _0x2129fa={},_0x200f3e={},_0x79e61f={'count':0x0,'rows':[]};var _0x10cabe=_[_0x4d0d('0x2d')](db[_0x4d0d('0x2e')][_0x4d0d('0x2f')],function(_0x537f8f){return{'name':_0x537f8f['fieldName'],'type':_0x537f8f['type'][_0x4d0d('0x30')]};});_0x200f3e[_0x4d0d('0x31')]=_[_0x4d0d('0x2d')](_0x10cabe,_0x4d0d('0x2a'));_0x200f3e[_0x4d0d('0x32')]=_[_0x4d0d('0x33')](_0x55f5e8[_0x4d0d('0x32')]);_0x200f3e[_0x4d0d('0x34')]=_['intersection'](_0x200f3e[_0x4d0d('0x31')],_0x200f3e[_0x4d0d('0x32')]);_0x2129fa[_0x4d0d('0x35')]=_[_0x4d0d('0x36')](_0x200f3e[_0x4d0d('0x31')],qs['fields'](_0x55f5e8[_0x4d0d('0x32')][_0x4d0d('0x37')]));_0x2129fa[_0x4d0d('0x35')]=_0x2129fa[_0x4d0d('0x35')][_0x4d0d('0x38')]?_0x2129fa[_0x4d0d('0x35')]:_0x200f3e[_0x4d0d('0x31')];if(!_0x55f5e8[_0x4d0d('0x32')][_0x4d0d('0x39')]('nolimit')){_0x2129fa[_0x4d0d('0x1e')]=qs[_0x4d0d('0x1e')](_0x55f5e8['query']['limit']);_0x2129fa[_0x4d0d('0x1d')]=qs[_0x4d0d('0x1d')](_0x55f5e8[_0x4d0d('0x32')][_0x4d0d('0x1d')]);}_0x2129fa[_0x4d0d('0x3a')]=qs[_0x4d0d('0x3b')](_0x55f5e8[_0x4d0d('0x32')][_0x4d0d('0x3b')]);_0x2129fa[_0x4d0d('0x3c')]=qs['filters'](_[_0x4d0d('0x3d')](_0x55f5e8[_0x4d0d('0x32')],_0x200f3e[_0x4d0d('0x34')]),_0x10cabe);if(_0x55f5e8['query']['filter']){_0x2129fa[_0x4d0d('0x3c')]=_[_0x4d0d('0x3e')](_0x2129fa[_0x4d0d('0x3c')],{'$or':_[_0x4d0d('0x2d')](_0x10cabe,function(_0x201b96){if(_0x201b96['type']!==_0x4d0d('0x3f')){var _0xd5d9c2={};_0xd5d9c2[_0x201b96[_0x4d0d('0x2a')]]={'$like':'%'+_0x55f5e8[_0x4d0d('0x32')][_0x4d0d('0x40')]+'%'};return _0xd5d9c2;}})});}_0x2129fa=_[_0x4d0d('0x3e')]({},_0x2129fa,_0x55f5e8[_0x4d0d('0x41')]);var _0x1acd0d={'where':_0x2129fa[_0x4d0d('0x3c')]};return db[_0x4d0d('0x2e')][_0x4d0d('0x20')](_0x1acd0d)[_0x4d0d('0x26')](function(_0x506f4b){_0x79e61f[_0x4d0d('0x20')]=_0x506f4b;if(_0x55f5e8[_0x4d0d('0x32')][_0x4d0d('0x42')]){_0x2129fa[_0x4d0d('0x43')]=[{'all':!![]}];}return db[_0x4d0d('0x2e')][_0x4d0d('0x44')](_0x2129fa);})[_0x4d0d('0x26')](function(_0x25059c){_0x79e61f['rows']=_0x25059c;return _0x79e61f;})[_0x4d0d('0x26')](respondWithFilteredResult(_0x4b68eb,_0x2129fa))['catch'](handleError(_0x4b68eb,null));};exports[_0x4d0d('0x45')]=function(_0x254fda,_0x543add){var _0x1335d1={'raw':![],'where':{'id':_0x254fda[_0x4d0d('0x46')]['id']}},_0x52af6d={};_0x52af6d['model']=_[_0x4d0d('0x33')](db['VoiceQueueReport'][_0x4d0d('0x2f')]);_0x52af6d[_0x4d0d('0x32')]=_[_0x4d0d('0x33')](_0x254fda[_0x4d0d('0x32')]);_0x52af6d[_0x4d0d('0x34')]=_['intersection'](_0x52af6d[_0x4d0d('0x31')],_0x52af6d['query']);_0x1335d1['attributes']=_[_0x4d0d('0x36')](_0x52af6d[_0x4d0d('0x31')],qs[_0x4d0d('0x37')](_0x254fda['query'][_0x4d0d('0x37')]));_0x1335d1['attributes']=_0x1335d1[_0x4d0d('0x35')]['length']?_0x1335d1[_0x4d0d('0x35')]:_0x52af6d[_0x4d0d('0x31')];if(_0x254fda[_0x4d0d('0x32')][_0x4d0d('0x42')]){_0x1335d1['include']=[{'all':!![]}];}_0x1335d1=_[_0x4d0d('0x3e')]({},_0x1335d1,_0x254fda[_0x4d0d('0x41')]);return db['VoiceQueueReport'][_0x4d0d('0x47')](_0x1335d1)[_0x4d0d('0x26')](handleEntityNotFound(_0x543add,null))[_0x4d0d('0x26')](respondWithResult(_0x543add,null))[_0x4d0d('0x48')](handleError(_0x543add,null));};exports[_0x4d0d('0x49')]=function(_0x51c634,_0x244b53){return db[_0x4d0d('0x2e')][_0x4d0d('0x49')](_0x51c634['body'],{})[_0x4d0d('0x26')](respondWithResult(_0x244b53,0xc9))[_0x4d0d('0x48')](handleError(_0x244b53,null));};exports[_0x4d0d('0x25')]=function(_0x57ad55,_0x322feb){if(_0x57ad55[_0x4d0d('0x4a')]['id']){delete _0x57ad55[_0x4d0d('0x4a')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x57ad55[_0x4d0d('0x46')]['id']}})['then'](handleEntityNotFound(_0x322feb,null))[_0x4d0d('0x26')](saveUpdates(_0x57ad55[_0x4d0d('0x4a')],null))[_0x4d0d('0x26')](respondWithResult(_0x322feb,null))[_0x4d0d('0x48')](handleError(_0x322feb,null));};exports[_0x4d0d('0x27')]=function(_0x4dc437,_0x441d22){return db[_0x4d0d('0x2e')][_0x4d0d('0x47')]({'where':{'id':_0x4dc437[_0x4d0d('0x46')]['id']}})['then'](handleEntityNotFound(_0x441d22,null))['then'](removeEntity(_0x441d22,null))[_0x4d0d('0x48')](handleError(_0x441d22,null));};exports['describe']=function(_0x5787ea,_0x52632d){return db[_0x4d0d('0x2e')]['describe']()[_0x4d0d('0x26')](respondWithResult(_0x52632d,null))[_0x4d0d('0x48')](handleError(_0x52632d,null));};exports[_0x4d0d('0x4b')]=function(_0x4d85d6,_0x56aac6){var _0x135c14={},_0x1c36a5={},_0x4e112b={'count':0x0,'rows':[]};_0x1c36a5[_0x4d0d('0x31')]=_['keys'](db['VoiceQueueReport'][_0x4d0d('0x2f')]);_0x1c36a5['query']=_[_0x4d0d('0x33')](_0x4d85d6[_0x4d0d('0x32')]);_0x1c36a5[_0x4d0d('0x34')]=_[_0x4d0d('0x36')](_0x1c36a5[_0x4d0d('0x31')],_0x1c36a5['query']);_0x135c14['attributes']=_['intersection'](_0x1c36a5[_0x4d0d('0x31')],qs[_0x4d0d('0x37')](_0x4d85d6[_0x4d0d('0x32')]['fields']));_0x135c14['attributes']=_0x135c14[_0x4d0d('0x35')][_0x4d0d('0x38')]?_0x135c14[_0x4d0d('0x35')]:_0x1c36a5[_0x4d0d('0x31')];if(!_0x4d85d6['query'][_0x4d0d('0x39')](_0x4d0d('0x4c'))){_0x135c14['limit']=qs['limit'](_0x4d85d6[_0x4d0d('0x32')]['limit']);_0x135c14[_0x4d0d('0x1d')]=qs[_0x4d0d('0x1d')](_0x4d85d6[_0x4d0d('0x32')][_0x4d0d('0x1d')]);}_0x135c14[_0x4d0d('0x3a')]=qs['sort'](_0x4d85d6['query'][_0x4d0d('0x3b')]);_0x135c14['where']=qs[_0x4d0d('0x34')](_[_0x4d0d('0x3d')](_0x4d85d6[_0x4d0d('0x32')],_0x1c36a5['filters']));if(_0x4d85d6['query']['filter']){_0x135c14[_0x4d0d('0x3c')]=_[_0x4d0d('0x3e')](_0x135c14['where'],{'$or':_[_0x4d0d('0x2d')](_0x135c14[_0x4d0d('0x35')],function(_0x3c51a0){var _0x3d5769={};_0x3d5769[_0x3c51a0]={'$like':'%'+_0x4d85d6[_0x4d0d('0x32')][_0x4d0d('0x40')]+'%'};return _0x3d5769;})});}_0x135c14=_[_0x4d0d('0x3e')]({},_0x135c14,_0x4d85d6[_0x4d0d('0x41')]);var _0x37f7e5={'where':_0x135c14['where']};return db[_0x4d0d('0x2e')]['count'](_0x37f7e5)['then'](function(_0xb9ded3){_0x4e112b[_0x4d0d('0x20')]=_0xb9ded3;if(_0x4d85d6['query'][_0x4d0d('0x42')]){_0x135c14[_0x4d0d('0x43')]=[{'all':!![]}];}return db[_0x4d0d('0x2e')][_0x4d0d('0x44')](_0x135c14);})[_0x4d0d('0x26')](function(_0x2ef718){_0x4e112b[_0x4d0d('0x4d')]=_0x2ef718;return _0x4e112b;})[_0x4d0d('0x26')](respondWithFilteredResult(_0x56aac6,_0x135c14,'getVoiceQueuesReport'))[_0x4d0d('0x48')](handleError(_0x56aac6,null,_0x4d0d('0x4b')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index b7223f0..57b74ff 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 _0xee5f=['remove','emit','hasOwnProperty','events','VoiceQueueReport','setMaxListeners','update'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xee5f,0x6c));var _0xfee5=function(_0x368b78,_0x359962){_0x368b78=_0x368b78-0x0;var _0x5df921=_0xee5f[_0x368b78];return _0x5df921;};'use strict';var EventEmitter=require(_0xfee5('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xfee5('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xfee5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfee5('0x3'),'afterDestroy':_0xfee5('0x4')};function emitEvent(_0x4ad7c){return function(_0x1072bd,_0x2a00ba,_0x208f0d){VoiceQueueReportEvents[_0xfee5('0x5')](_0x4ad7c+':'+_0x1072bd['id'],_0x1072bd);VoiceQueueReportEvents[_0xfee5('0x5')](_0x4ad7c,_0x1072bd);_0x208f0d(null);};}for(var e in events){if(events[_0xfee5('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xce1a=['emit','hasOwnProperty','hook','exports','setMaxListeners','save','update'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xce1a,0x1e0));var _0xace1=function(_0x6a9aae,_0x344363){_0x6a9aae=_0x6a9aae-0x0;var _0xf39668=_0xce1a[_0x6a9aae];return _0xf39668;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xace1('0x0')](0x0);var events={'afterCreate':_0xace1('0x1'),'afterUpdate':_0xace1('0x2'),'afterDestroy':'remove'};function emitEvent(_0x585a8e){return function(_0x17ef29,_0x4b432e,_0x2b05c4){VoiceQueueReportEvents[_0xace1('0x3')](_0x585a8e+':'+_0x17ef29['id'],_0x17ef29);VoiceQueueReportEvents[_0xace1('0x3')](_0x585a8e,_0x17ef29);_0x2b05c4(null);};}for(var e in events){if(events[_0xace1('0x4')](e)){var event=events[e];VoiceQueueReport[_0xace1('0x5')](e,emitEvent(event));}}module[_0xace1('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 3c3fd15..4aca814 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 _0xbe01=['bluebird','request-promise','path','rimraf','./voiceQueueReport.attributes','exports','define','uniqueid','lodash','util','api','moment'];(function(_0x35d0cf,_0x12207d){var _0x283d71=function(_0x21baaa){while(--_0x21baaa){_0x35d0cf['push'](_0x35d0cf['shift']());}};_0x283d71(++_0x12207d);}(_0xbe01,0x104));var _0x1be0=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xbe01[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x1be0('0x0'));var util=require(_0x1be0('0x1'));var logger=require('../../config/logger')(_0x1be0('0x2'));var moment=require(_0x1be0('0x3'));var BPromise=require(_0x1be0('0x4'));var rp=require(_0x1be0('0x5'));var fs=require('fs');var path=require(_0x1be0('0x6'));var rimraf=require(_0x1be0('0x7'));var config=require('../../config/environment');var attributes=require(_0x1be0('0x8'));module[_0x1be0('0x9')]=function(_0xaebe2f,_0xe2ee04){return _0xaebe2f[_0x1be0('0xa')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x1be0('0xb')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb87e=['calleridnum','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes','define','uniqueid'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0xb87e,0xe5));var _0xeb87=function(_0x27db36,_0x2b7304){_0x27db36=_0x27db36-0x0;var _0x3afe63=_0xb87e[_0x27db36];return _0x3afe63;};'use strict';var _=require(_0xeb87('0x0'));var util=require(_0xeb87('0x1'));var logger=require('../../config/logger')(_0xeb87('0x2'));var moment=require(_0xeb87('0x3'));var BPromise=require(_0xeb87('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb87('0x5'));var rimraf=require(_0xeb87('0x6'));var config=require(_0xeb87('0x7'));var attributes=require(_0xeb87('0x8'));module['exports']=function(_0x20bf8a,_0x27f805){return _0x20bf8a[_0xeb87('0x9')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xeb87('0xa')]},{'fields':[_0xeb87('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 9991f38..c0f1a18 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 _0xdefd=['then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','result','GetVoiceQueueReport','findAll','options','raw','attributes','limit','include','map','model','catch','CreateVoiceQueueReport','VoiceQueueReport','body','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','request'];(function(_0x3eb228,_0xb299e5){var _0x5ba782=function(_0x1be8a8){while(--_0x1be8a8){_0x3eb228['push'](_0x3eb228['shift']());}};_0x5ba782(++_0xb299e5);}(_0xdefd,0x160));var _0xddef=function(_0x4c9a0d,_0x56c2a5){_0x4c9a0d=_0x4c9a0d-0x0;var _0x427225=_0xdefd[_0x4c9a0d];return _0x427225;};'use strict';var _=require(_0xddef('0x0'));var util=require(_0xddef('0x1'));var moment=require(_0xddef('0x2'));var BPromise=require(_0xddef('0x3'));var rs=require(_0xddef('0x4'));var fs=require('fs');var Redis=require(_0xddef('0x5'));var db=require(_0xddef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xddef('0x7'))(_0xddef('0x8'));var config=require(_0xddef('0x9'));var jayson=require(_0xddef('0xa'));var client=jayson[_0xddef('0xb')]['http']({'port':0x232a});config['redis']=_[_0xddef('0xc')](config[_0xddef('0xd')],{'host':_0xddef('0xe'),'port':0x18eb});var socket=require(_0xddef('0xf'))(new Redis(config[_0xddef('0xd')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x1c73b5,_0x5a0282,_0x198c9c){return new BPromise(function(_0x30ae64,_0x420cb8){return client[_0xddef('0x10')](_0x1c73b5,_0x198c9c)[_0xddef('0x11')](function(_0x37a84f){logger[_0xddef('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x5a0282,_0xddef('0x13'));logger[_0xddef('0x14')](_0xddef('0x15'),_0x5a0282,_0xddef('0x13'),JSON[_0xddef('0x16')](_0x37a84f));if(_0x37a84f[_0xddef('0x17')]){if(_0x37a84f[_0xddef('0x17')]['code']===0x1f4){logger[_0xddef('0x17')](_0xddef('0x18'),_0x5a0282,_0x37a84f[_0xddef('0x17')][_0xddef('0x19')]);return _0x420cb8(_0x37a84f[_0xddef('0x17')][_0xddef('0x19')]);}logger[_0xddef('0x17')](_0xddef('0x18'),_0x5a0282,_0x37a84f[_0xddef('0x17')]['message']);return _0x30ae64(_0x37a84f[_0xddef('0x17')]['message']);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x5a0282,_0xddef('0x13'));_0x30ae64(_0x37a84f[_0xddef('0x1a')][_0xddef('0x19')]);}})['catch'](function(_0x5bf7fc){logger[_0xddef('0x17')](_0xddef('0x18'),_0x5a0282,_0x5bf7fc);_0x420cb8(_0x5bf7fc);});});}exports[_0xddef('0x1b')]=function(_0x3c60aa){var _0x59398b=this;return new Promise(function(_0x14121c,_0x5dcdd0){return db['VoiceQueueReport'][_0xddef('0x1c')]({'raw':_0x3c60aa['options']?_0x3c60aa[_0xddef('0x1d')][_0xddef('0x1e')]===undefined?!![]:![]:!![],'where':_0x3c60aa[_0xddef('0x1d')]?_0x3c60aa[_0xddef('0x1d')]['where']||null:null,'attributes':_0x3c60aa[_0xddef('0x1d')]?_0x3c60aa[_0xddef('0x1d')][_0xddef('0x1f')]||null:null,'limit':_0x3c60aa['options']?_0x3c60aa[_0xddef('0x1d')][_0xddef('0x20')]||null:null,'include':_0x3c60aa[_0xddef('0x1d')]?_0x3c60aa[_0xddef('0x1d')][_0xddef('0x21')]?_['map'](_0x3c60aa[_0xddef('0x1d')][_0xddef('0x21')],function(_0x420f04){return{'model':db[_0x420f04['model']],'as':_0x420f04['as'],'attributes':_0x420f04['attributes'],'include':_0x420f04['include']?_[_0xddef('0x22')](_0x420f04['include'],function(_0x120365){return{'model':db[_0x120365[_0xddef('0x23')]],'as':_0x120365['as'],'attributes':_0x120365[_0xddef('0x1f')],'include':_0x120365[_0xddef('0x21')]?_[_0xddef('0x22')](_0x120365['include'],function(_0x15f86e){return{'model':db[_0x15f86e[_0xddef('0x23')]],'as':_0x15f86e['as'],'attributes':_0x15f86e[_0xddef('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xddef('0x11')](function(_0x448857){logger[_0xddef('0x12')](_0xddef('0x1b'),_0x3c60aa);logger[_0xddef('0x14')](_0xddef('0x1b'),_0x3c60aa,JSON[_0xddef('0x16')](_0x448857));_0x14121c(_0x448857);})[_0xddef('0x24')](function(_0x2e495c){logger[_0xddef('0x17')](_0xddef('0x1b'),_0x2e495c[_0xddef('0x19')],_0x3c60aa);_0x5dcdd0(_0x59398b[_0xddef('0x17')](0x1f4,_0x2e495c[_0xddef('0x19')]));});});};exports[_0xddef('0x25')]=function(_0xd021b4){var _0x1b0b32=this;return new Promise(function(_0x36cf56,_0x5bfb8d){return db[_0xddef('0x26')]['create'](_0xd021b4[_0xddef('0x27')],{'raw':_0xd021b4['options']?_0xd021b4['options'][_0xddef('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x5415d1){logger[_0xddef('0x12')](_0xddef('0x25'),_0xd021b4);logger[_0xddef('0x14')](_0xddef('0x25'),_0xd021b4,JSON[_0xddef('0x16')](_0x5415d1));_0x36cf56(_0x5415d1);})['catch'](function(_0x5548a9){logger[_0xddef('0x17')](_0xddef('0x25'),_0x5548a9['message'],_0xd021b4);_0x5bfb8d(_0x1b0b32['error'](0x1f4,_0x5548a9['message']));});});};exports[_0xddef('0x28')]=function(_0x19314e){var _0x3e02c2=this;return new Promise(function(_0x76a9c7,_0x118449){return db[_0xddef('0x26')]['update'](_0x19314e['body'],{'raw':_0x19314e['options']?_0x19314e['options'][_0xddef('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19314e[_0xddef('0x1d')]?_0x19314e[_0xddef('0x1d')]['where']||null:null,'attributes':_0x19314e[_0xddef('0x1d')]?_0x19314e[_0xddef('0x1d')][_0xddef('0x1f')]||null:null,'limit':_0x19314e[_0xddef('0x1d')]?_0x19314e['options'][_0xddef('0x20')]||null:null})[_0xddef('0x11')](function(_0x58fc81){logger[_0xddef('0x12')](_0xddef('0x28'),_0x19314e);logger[_0xddef('0x14')](_0xddef('0x28'),_0x19314e,JSON[_0xddef('0x16')](_0x58fc81));_0x76a9c7(_0x58fc81);})[_0xddef('0x24')](function(_0x35bbed){logger['error'](_0xddef('0x28'),_0x35bbed['message'],_0x19314e);_0x118449(_0x3e02c2['error'](0x1f4,_0x35bbed[_0xddef('0x19')]));});});}; \ No newline at end of file +var _0xd768=['VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','VoiceQueueReport,\x20%s,\x20%s','findAll','options','limit','map','include','model','attributes','GetVoiceQueueReport','stringify','catch','CreateVoiceQueueReport','VoiceQueueReport','create','body','raw','UpdateVoiceQueueReport','update','where','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','debug'];(function(_0x3ad58e,_0x17c31d){var _0x3dbbb4=function(_0x3752e9){while(--_0x3752e9){_0x3ad58e['push'](_0x3ad58e['shift']());}};_0x3dbbb4(++_0x17c31d);}(_0xd768,0x167));var _0x8d76=function(_0x4aac5a,_0x15b04c){_0x4aac5a=_0x4aac5a-0x0;var _0x42e7bc=_0xd768[_0x4aac5a];return _0x42e7bc;};'use strict';var _=require(_0x8d76('0x0'));var util=require('util');var moment=require(_0x8d76('0x1'));var BPromise=require('bluebird');var rs=require(_0x8d76('0x2'));var fs=require('fs');var Redis=require(_0x8d76('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8d76('0x4'));var logger=require(_0x8d76('0x5'))(_0x8d76('0x6'));var config=require('../../config/environment');var jayson=require(_0x8d76('0x7'));var client=jayson[_0x8d76('0x8')]['http']({'port':0x232a});config[_0x8d76('0x9')]=_[_0x8d76('0xa')](config[_0x8d76('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d76('0xb'))(new Redis(config['redis']));require(_0x8d76('0xc'))[_0x8d76('0xd')](socket);function respondWithRpcPromise(_0x25e325,_0x35533e,_0x193188){return new BPromise(function(_0x27b831,_0x138e43){return client[_0x8d76('0xe')](_0x25e325,_0x193188)[_0x8d76('0xf')](function(_0x749ab8){logger[_0x8d76('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x35533e,_0x8d76('0x11'));logger[_0x8d76('0x12')](_0x8d76('0x13'),_0x35533e,_0x8d76('0x11'),JSON['stringify'](_0x749ab8));if(_0x749ab8[_0x8d76('0x14')]){if(_0x749ab8[_0x8d76('0x14')]['code']===0x1f4){logger[_0x8d76('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x35533e,_0x749ab8[_0x8d76('0x14')][_0x8d76('0x15')]);return _0x138e43(_0x749ab8[_0x8d76('0x14')]['message']);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x35533e,_0x749ab8[_0x8d76('0x14')][_0x8d76('0x15')]);return _0x27b831(_0x749ab8[_0x8d76('0x14')]['message']);}else{logger[_0x8d76('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x35533e,_0x8d76('0x11'));_0x27b831(_0x749ab8[_0x8d76('0x16')][_0x8d76('0x15')]);}})['catch'](function(_0x3431e5){logger[_0x8d76('0x14')](_0x8d76('0x17'),_0x35533e,_0x3431e5);_0x138e43(_0x3431e5);});});}exports['GetVoiceQueueReport']=function(_0xd5f279){var _0x5c6358=this;return new Promise(function(_0x5da8ed,_0x26e025){return db['VoiceQueueReport'][_0x8d76('0x18')]({'raw':_0xd5f279[_0x8d76('0x19')]?_0xd5f279[_0x8d76('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xd5f279[_0x8d76('0x19')]?_0xd5f279[_0x8d76('0x19')]['where']||null:null,'attributes':_0xd5f279[_0x8d76('0x19')]?_0xd5f279[_0x8d76('0x19')]['attributes']||null:null,'limit':_0xd5f279[_0x8d76('0x19')]?_0xd5f279[_0x8d76('0x19')][_0x8d76('0x1a')]||null:null,'include':_0xd5f279[_0x8d76('0x19')]?_0xd5f279[_0x8d76('0x19')]['include']?_[_0x8d76('0x1b')](_0xd5f279[_0x8d76('0x19')][_0x8d76('0x1c')],function(_0xf12964){return{'model':db[_0xf12964[_0x8d76('0x1d')]],'as':_0xf12964['as'],'attributes':_0xf12964[_0x8d76('0x1e')],'include':_0xf12964[_0x8d76('0x1c')]?_[_0x8d76('0x1b')](_0xf12964[_0x8d76('0x1c')],function(_0x200778){return{'model':db[_0x200778[_0x8d76('0x1d')]],'as':_0x200778['as'],'attributes':_0x200778[_0x8d76('0x1e')],'include':_0x200778[_0x8d76('0x1c')]?_['map'](_0x200778['include'],function(_0x58d66e){return{'model':db[_0x58d66e[_0x8d76('0x1d')]],'as':_0x58d66e['as'],'attributes':_0x58d66e[_0x8d76('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8d76('0xf')](function(_0x113f36){logger[_0x8d76('0x10')](_0x8d76('0x1f'),_0xd5f279);logger[_0x8d76('0x12')](_0x8d76('0x1f'),_0xd5f279,JSON[_0x8d76('0x20')](_0x113f36));_0x5da8ed(_0x113f36);})[_0x8d76('0x21')](function(_0x4928d4){logger[_0x8d76('0x14')](_0x8d76('0x1f'),_0x4928d4[_0x8d76('0x15')],_0xd5f279);_0x26e025(_0x5c6358[_0x8d76('0x14')](0x1f4,_0x4928d4[_0x8d76('0x15')]));});});};exports[_0x8d76('0x22')]=function(_0x34f6d9){var _0x2fea1f=this;return new Promise(function(_0x7f0d4f,_0x4258d1){return db[_0x8d76('0x23')][_0x8d76('0x24')](_0x34f6d9[_0x8d76('0x25')],{'raw':_0x34f6d9[_0x8d76('0x19')]?_0x34f6d9[_0x8d76('0x19')][_0x8d76('0x26')]===undefined?!![]:![]:!![]})[_0x8d76('0xf')](function(_0x9f2000){logger[_0x8d76('0x10')]('CreateVoiceQueueReport',_0x34f6d9);logger['debug'](_0x8d76('0x22'),_0x34f6d9,JSON['stringify'](_0x9f2000));_0x7f0d4f(_0x9f2000);})[_0x8d76('0x21')](function(_0x3e8425){logger[_0x8d76('0x14')]('CreateVoiceQueueReport',_0x3e8425[_0x8d76('0x15')],_0x34f6d9);_0x4258d1(_0x2fea1f[_0x8d76('0x14')](0x1f4,_0x3e8425[_0x8d76('0x15')]));});});};exports[_0x8d76('0x27')]=function(_0x4c6443){var _0x429aa9=this;return new Promise(function(_0x5f038e,_0x14cda9){return db[_0x8d76('0x23')][_0x8d76('0x28')](_0x4c6443[_0x8d76('0x25')],{'raw':_0x4c6443[_0x8d76('0x19')]?_0x4c6443['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c6443[_0x8d76('0x19')]?_0x4c6443['options'][_0x8d76('0x29')]||null:null,'attributes':_0x4c6443[_0x8d76('0x19')]?_0x4c6443['options'][_0x8d76('0x1e')]||null:null,'limit':_0x4c6443[_0x8d76('0x19')]?_0x4c6443[_0x8d76('0x19')]['limit']||null:null})[_0x8d76('0xf')](function(_0x39ef08){logger[_0x8d76('0x10')]('UpdateVoiceQueueReport',_0x4c6443);logger['debug'](_0x8d76('0x27'),_0x4c6443,JSON[_0x8d76('0x20')](_0x39ef08));_0x5f038e(_0x39ef08);})[_0x8d76('0x21')](function(_0x38244f){logger['error'](_0x8d76('0x27'),_0x38244f[_0x8d76('0x15')],_0x4c6443);_0x14cda9(_0x429aa9[_0x8d76('0x14')](0x1f4,_0x38244f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index d8a7e47..5c7d09a 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 _0x4b47=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','remove','update','emit'];(function(_0x17d8b8,_0x523198){var _0x1281f0=function(_0x2917ab){while(--_0x2917ab){_0x17d8b8['push'](_0x17d8b8['shift']());}};_0x1281f0(++_0x523198);}(_0x4b47,0x1b4));var _0x74b4=function(_0x479344,_0x5f471d){_0x479344=_0x479344-0x0;var _0x6f22a3=_0x4b47[_0x479344];return _0x6f22a3;};'use strict';var VoiceQueueReportEvents=require(_0x74b4('0x0'));var events=['save',_0x74b4('0x1'),_0x74b4('0x2')];function createListener(_0x4469a4,_0x1f5100){return function(_0x1f9dac){_0x1f5100[_0x74b4('0x3')](_0x4469a4,_0x1f9dac);};}function removeListener(_0x565f6b,_0x4ed4fe){return function(){VoiceQueueReportEvents[_0x74b4('0x4')](_0x565f6b,_0x4ed4fe);};}exports[_0x74b4('0x5')]=function(_0x4dc737){for(var _0x4cd397=0x0,_0x482278=events[_0x74b4('0x6')];_0x4cd397<_0x482278;_0x4cd397++){var _0x75ea22=events[_0x4cd397];var _0x1ebbb8=createListener(_0x74b4('0x7')+_0x75ea22,_0x4dc737);VoiceQueueReportEvents['on'](_0x75ea22,_0x1ebbb8);}}; \ No newline at end of file +var _0x649b=['removeListener','remove','update'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0x649b,0x166));var _0xb649=function(_0x561946,_0x222ea1){_0x561946=_0x561946-0x0;var _0x388e5a=_0x649b[_0x561946];return _0x388e5a;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save',_0xb649('0x0'),_0xb649('0x1')];function createListener(_0x4ede93,_0x53c02d){return function(_0xd0360e){_0x53c02d['emit'](_0x4ede93,_0xd0360e);};}function removeListener(_0x9422ae,_0x20a3fd){return function(){VoiceQueueReportEvents[_0xb649('0x2')](_0x9422ae,_0x20a3fd);};}exports['register']=function(_0x2e0402){for(var _0x1d0a04=0x0,_0x407bdb=events['length'];_0x1d0a04<_0x407bdb;_0x1d0a04++){var _0x539d84=events[_0x1d0a04];var _0x4227a6=createListener('voiceQueueReport:'+_0x539d84,_0x2e0402);VoiceQueueReportEvents['on'](_0x539d84,_0x4227a6);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 32918ae..2266a6a 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 _0x158e=['./voiceQueuesLog.controller','isAuthenticated','get','/:id','show','create','put','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x158e,0x1f0));var _0xe158=function(_0x537369,_0x1b113e){_0x537369=_0x537369-0x0;var _0x2be7c2=_0x158e[_0x537369];return _0x2be7c2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe158('0x0'));var timeout=require(_0xe158('0x1'));var express=require(_0xe158('0x2'));var router=express[_0xe158('0x3')]();var fs_extra=require(_0xe158('0x4'));var auth=require(_0xe158('0x5'));var interaction=require(_0xe158('0x6'));var config=require(_0xe158('0x7'));var controller=require(_0xe158('0x8'));router['get']('/',auth[_0xe158('0x9')](),controller['index']);router[_0xe158('0xa')](_0xe158('0xb'),auth[_0xe158('0x9')](),controller[_0xe158('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe158('0xd')]);router[_0xe158('0xe')](_0xe158('0xb'),auth[_0xe158('0x9')](),controller['update']);router[_0xe158('0xf')](_0xe158('0xb'),auth[_0xe158('0x9')](),controller[_0xe158('0x10')]);module[_0xe158('0x11')]=router; \ No newline at end of file +var _0xba6c=['index','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x1aa049,_0x9ae13c){var _0x357f29=function(_0xfd2f83){while(--_0xfd2f83){_0x1aa049['push'](_0x1aa049['shift']());}};_0x357f29(++_0x9ae13c);}(_0xba6c,0x113));var _0xcba6=function(_0xffd8b0,_0x12c51f){_0xffd8b0=_0xffd8b0-0x0;var _0x301ba0=_0xba6c[_0xffd8b0];return _0x301ba0;};'use strict';var multer=require(_0xcba6('0x0'));var util=require('util');var path=require(_0xcba6('0x1'));var timeout=require(_0xcba6('0x2'));var express=require(_0xcba6('0x3'));var router=express[_0xcba6('0x4')]();var fs_extra=require(_0xcba6('0x5'));var auth=require(_0xcba6('0x6'));var interaction=require(_0xcba6('0x7'));var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router[_0xcba6('0x8')]('/',auth[_0xcba6('0x9')](),controller[_0xcba6('0xa')]);router[_0xcba6('0x8')](_0xcba6('0xb'),auth[_0xcba6('0x9')](),controller[_0xcba6('0xc')]);router[_0xcba6('0xd')]('/',auth[_0xcba6('0x9')](),controller[_0xcba6('0xe')]);router[_0xcba6('0xf')]('/:id',auth[_0xcba6('0x9')](),controller[_0xcba6('0x10')]);router[_0xcba6('0x11')](_0xcba6('0xb'),auth['isAuthenticated'](),controller[_0xcba6('0x12')]);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 32c3d3f..26e3c8c 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 _0x6fd9=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6fd9,0x190));var _0x96fd=function(_0x2db7e3,_0x541601){_0x2db7e3=_0x2db7e3-0x0;var _0x33b369=_0x6fd9[_0x2db7e3];return _0x33b369;};'use strict';var Sequelize=require(_0x96fd('0x0'));var moment=require(_0x96fd('0x1'));module[_0x96fd('0x2')]={'time':{'type':Sequelize[_0x96fd('0x3')]},'callid':{'type':Sequelize[_0x96fd('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x96fd('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x96fd('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x96fd('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x96fd('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x96fd('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x96fd('0x4')],'allowNull':![],'defaultValue':moment()[_0x96fd('0x5')](_0x96fd('0x6'))}}; \ No newline at end of file +var _0xd974=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd974,0x8b));var _0x4d97=function(_0x3021f9,_0x843d98){_0x3021f9=_0x3021f9-0x0;var _0x73871=_0xd974[_0x3021f9];return _0x73871;};'use strict';var Sequelize=require(_0x4d97('0x0'));var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0x4d97('0x1')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x4d97('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x4d97('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x4d97('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x4d97('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x4d97('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x4d97('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x4d97('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x4d97('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x4d97('0x2')],'allowNull':![],'defaultValue':moment()[_0x4d97('0x3')](_0x4d97('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 49280a1..e8c0a5b 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 _0xc0b7=['offset','set','Content-Range','json','apply','update','then','error','stack','name','send','index','VoiceQueuesLog','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','count'];(function(_0x59e862,_0x477bf2){var _0x1a25ee=function(_0xc61e64){while(--_0xc61e64){_0x59e862['push'](_0x59e862['shift']());}};_0x1a25ee(++_0x477bf2);}(_0xc0b7,0xc1));var _0x7c0b=function(_0x4782de,_0x5a6820){_0x4782de=_0x4782de-0x0;var _0x25f0c1=_0xc0b7[_0x4782de];return _0x25f0c1;};'use strict';var emlformat=require(_0x7c0b('0x0'));var rimraf=require(_0x7c0b('0x1'));var zipdir=require(_0x7c0b('0x2'));var jsonpatch=require(_0x7c0b('0x3'));var rp=require(_0x7c0b('0x4'));var moment=require(_0x7c0b('0x5'));var BPromise=require(_0x7c0b('0x6'));var Mustache=require('mustache');var util=require(_0x7c0b('0x7'));var path=require(_0x7c0b('0x8'));var sox=require(_0x7c0b('0x9'));var csv=require('to-csv');var ejs=require(_0x7c0b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7c0b('0xb'));var squel=require(_0x7c0b('0xc'));var crypto=require(_0x7c0b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7c0b('0xe'));var toCsv=require(_0x7c0b('0xf'));var querystring=require(_0x7c0b('0x10'));var Papa=require(_0x7c0b('0x11'));var Redis=require('ioredis');var authService=require(_0x7c0b('0x12'));var qs=require(_0x7c0b('0x13'));var as=require(_0x7c0b('0x14'));var hardwareService=require(_0x7c0b('0x15'));var logger=require(_0x7c0b('0x16'))(_0x7c0b('0x17'));var utils=require('../../config/utils');var config=require(_0x7c0b('0x18'));var licenseUtil=require(_0x7c0b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6afb50,_0x1e6851){_0x1e6851=_0x1e6851||0xcc;return function(_0xa76970){if(_0xa76970){return _0x6afb50[_0x7c0b('0x1a')](_0x1e6851);}return _0x6afb50['status'](_0x1e6851)[_0x7c0b('0x1b')]();};}function respondWithResult(_0x1e0f0e,_0x6fc726){_0x6fc726=_0x6fc726||0xc8;return function(_0x3e62e9){if(_0x3e62e9){return _0x1e0f0e[_0x7c0b('0x1c')](_0x6fc726)['json'](_0x3e62e9);}};}function respondWithFilteredResult(_0x3d1dda,_0x403910){return function(_0x370e2d){if(_0x370e2d){var _0x389408=typeof _0x403910['offset']===_0x7c0b('0x1d')&&typeof _0x403910[_0x7c0b('0x1e')]==='undefined';var _0x4b09b9=_0x370e2d[_0x7c0b('0x1f')];var _0x171f5c=_0x389408?0x0:_0x403910[_0x7c0b('0x20')];var _0x5354cb=_0x389408?_0x370e2d['count']:_0x403910[_0x7c0b('0x20')]+_0x403910[_0x7c0b('0x1e')];var _0x43e1d4;if(_0x5354cb>=_0x4b09b9){_0x5354cb=_0x4b09b9;_0x43e1d4=0xc8;}else{_0x43e1d4=0xce;}_0x3d1dda[_0x7c0b('0x1c')](_0x43e1d4);return _0x3d1dda[_0x7c0b('0x21')](_0x7c0b('0x22'),_0x171f5c+'-'+_0x5354cb+'/'+_0x4b09b9)[_0x7c0b('0x23')](_0x370e2d);}return null;};}function patchUpdates(_0x220383){return function(_0x25c03a){try{jsonpatch[_0x7c0b('0x24')](_0x25c03a,_0x220383,!![]);}catch(_0x5455d0){return BPromise['reject'](_0x5455d0);}return _0x25c03a['save']();};}function saveUpdates(_0x24ff7d,_0x5c6408){return function(_0x3d9ce3){if(_0x3d9ce3){return _0x3d9ce3[_0x7c0b('0x25')](_0x24ff7d)[_0x7c0b('0x26')](function(_0x2beb94){return _0x2beb94;});}return null;};}function removeEntity(_0x13bda1,_0x32d129){return function(_0x11ee04){if(_0x11ee04){return _0x11ee04['destroy']()[_0x7c0b('0x26')](function(){_0x13bda1[_0x7c0b('0x1c')](0xcc)[_0x7c0b('0x1b')]();});}};}function handleEntityNotFound(_0x2181dd,_0x394172){return function(_0x2f5ea1){if(!_0x2f5ea1){_0x2181dd[_0x7c0b('0x1a')](0x194);}return _0x2f5ea1;};}function handleError(_0x406f0d,_0x1f3386){_0x1f3386=_0x1f3386||0x1f4;return function(_0x33a829){logger[_0x7c0b('0x27')](_0x33a829[_0x7c0b('0x28')]);if(_0x33a829[_0x7c0b('0x29')]){delete _0x33a829[_0x7c0b('0x29')];}_0x406f0d['status'](_0x1f3386)[_0x7c0b('0x2a')](_0x33a829);};}exports[_0x7c0b('0x2b')]=function(_0x212bda,_0x4f0392){var _0x32eb85={},_0x567def={},_0xe2c618={'count':0x0,'rows':[]};var _0x5af299=_['map'](db[_0x7c0b('0x2c')]['rawAttributes'],function(_0x31b8d2){return{'name':_0x31b8d2[_0x7c0b('0x2d')],'type':_0x31b8d2['type'][_0x7c0b('0x2e')]};});_0x567def[_0x7c0b('0x2f')]=_[_0x7c0b('0x30')](_0x5af299,_0x7c0b('0x29'));_0x567def[_0x7c0b('0x31')]=_[_0x7c0b('0x32')](_0x212bda['query']);_0x567def[_0x7c0b('0x33')]=_[_0x7c0b('0x34')](_0x567def[_0x7c0b('0x2f')],_0x567def[_0x7c0b('0x31')]);_0x32eb85['attributes']=_[_0x7c0b('0x34')](_0x567def[_0x7c0b('0x2f')],qs[_0x7c0b('0x35')](_0x212bda[_0x7c0b('0x31')][_0x7c0b('0x35')]));_0x32eb85['attributes']=_0x32eb85[_0x7c0b('0x36')][_0x7c0b('0x37')]?_0x32eb85[_0x7c0b('0x36')]:_0x567def[_0x7c0b('0x2f')];if(!_0x212bda[_0x7c0b('0x31')]['hasOwnProperty'](_0x7c0b('0x38'))){_0x32eb85[_0x7c0b('0x1e')]=qs[_0x7c0b('0x1e')](_0x212bda[_0x7c0b('0x31')][_0x7c0b('0x1e')]);_0x32eb85[_0x7c0b('0x20')]=qs[_0x7c0b('0x20')](_0x212bda['query']['offset']);}_0x32eb85[_0x7c0b('0x39')]=qs['sort'](_0x212bda['query'][_0x7c0b('0x3a')]);_0x32eb85[_0x7c0b('0x3b')]=qs[_0x7c0b('0x33')](_['pick'](_0x212bda['query'],_0x567def[_0x7c0b('0x33')]),_0x5af299);if(_0x212bda['query']['filter']){_0x32eb85[_0x7c0b('0x3b')]=_['merge'](_0x32eb85[_0x7c0b('0x3b')],{'$or':_[_0x7c0b('0x30')](_0x5af299,function(_0x2fdbf8){if(_0x2fdbf8[_0x7c0b('0x3c')]!==_0x7c0b('0x3d')){var _0x2d2770={};_0x2d2770[_0x2fdbf8['name']]={'$like':'%'+_0x212bda[_0x7c0b('0x31')][_0x7c0b('0x3e')]+'%'};return _0x2d2770;}})});}_0x32eb85=_[_0x7c0b('0x3f')]({},_0x32eb85,_0x212bda[_0x7c0b('0x40')]);var _0x3028f7={'where':_0x32eb85[_0x7c0b('0x3b')]};return db['VoiceQueuesLog'][_0x7c0b('0x1f')](_0x3028f7)[_0x7c0b('0x26')](function(_0xe26838){_0xe2c618[_0x7c0b('0x1f')]=_0xe26838;if(_0x212bda[_0x7c0b('0x31')][_0x7c0b('0x41')]){_0x32eb85[_0x7c0b('0x42')]=[{'all':!![]}];}return db[_0x7c0b('0x2c')][_0x7c0b('0x43')](_0x32eb85);})[_0x7c0b('0x26')](function(_0x584098){_0xe2c618[_0x7c0b('0x44')]=_0x584098;return _0xe2c618;})['then'](respondWithFilteredResult(_0x4f0392,_0x32eb85))[_0x7c0b('0x45')](handleError(_0x4f0392,null));};exports['show']=function(_0x25bc5a,_0x1a6018){var _0x5a162f={'raw':!![],'where':{'id':_0x25bc5a[_0x7c0b('0x46')]['id']}},_0x1a9af4={};_0x1a9af4[_0x7c0b('0x2f')]=_[_0x7c0b('0x32')](db[_0x7c0b('0x2c')]['rawAttributes']);_0x1a9af4['query']=_[_0x7c0b('0x32')](_0x25bc5a['query']);_0x1a9af4[_0x7c0b('0x33')]=_['intersection'](_0x1a9af4['model'],_0x1a9af4[_0x7c0b('0x31')]);_0x5a162f['attributes']=_['intersection'](_0x1a9af4[_0x7c0b('0x2f')],qs[_0x7c0b('0x35')](_0x25bc5a['query'][_0x7c0b('0x35')]));_0x5a162f[_0x7c0b('0x36')]=_0x5a162f[_0x7c0b('0x36')][_0x7c0b('0x37')]?_0x5a162f[_0x7c0b('0x36')]:_0x1a9af4['model'];if(_0x25bc5a[_0x7c0b('0x31')][_0x7c0b('0x41')]){_0x5a162f['include']=[{'all':!![]}];}_0x5a162f=_[_0x7c0b('0x3f')]({},_0x5a162f,_0x25bc5a[_0x7c0b('0x40')]);return db[_0x7c0b('0x2c')][_0x7c0b('0x47')](_0x5a162f)[_0x7c0b('0x26')](handleEntityNotFound(_0x1a6018,null))[_0x7c0b('0x26')](respondWithResult(_0x1a6018,null))[_0x7c0b('0x45')](handleError(_0x1a6018,null));};exports[_0x7c0b('0x48')]=function(_0x337776,_0x3d9d5d){return db[_0x7c0b('0x2c')][_0x7c0b('0x48')](_0x337776['body'],{})[_0x7c0b('0x26')](respondWithResult(_0x3d9d5d,0xc9))[_0x7c0b('0x45')](handleError(_0x3d9d5d,null));};exports[_0x7c0b('0x25')]=function(_0x55c24e,_0x32dbd9){if(_0x55c24e[_0x7c0b('0x49')]['id']){delete _0x55c24e[_0x7c0b('0x49')]['id'];}return db[_0x7c0b('0x2c')][_0x7c0b('0x47')]({'where':{'id':_0x55c24e[_0x7c0b('0x46')]['id']}})[_0x7c0b('0x26')](handleEntityNotFound(_0x32dbd9,null))[_0x7c0b('0x26')](saveUpdates(_0x55c24e[_0x7c0b('0x49')],null))[_0x7c0b('0x26')](respondWithResult(_0x32dbd9,null))[_0x7c0b('0x45')](handleError(_0x32dbd9,null));};exports[_0x7c0b('0x4a')]=function(_0x30bf75,_0x5da625){return db['VoiceQueuesLog'][_0x7c0b('0x47')]({'where':{'id':_0x30bf75[_0x7c0b('0x46')]['id']}})[_0x7c0b('0x26')](handleEntityNotFound(_0x5da625,null))[_0x7c0b('0x26')](removeEntity(_0x5da625,null))['catch'](handleError(_0x5da625,null));}; \ No newline at end of file +var _0x754f=['apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','VoiceQueuesLog','include','rows','catch','show','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x754f,0x148));var _0xf754=function(_0x43cf08,_0x1a2b3d){_0x43cf08=_0x43cf08-0x0;var _0x5d0c29=_0x754f[_0x43cf08];return _0x5d0c29;};'use strict';var emlformat=require(_0xf754('0x0'));var rimraf=require(_0xf754('0x1'));var zipdir=require(_0xf754('0x2'));var jsonpatch=require(_0xf754('0x3'));var rp=require(_0xf754('0x4'));var moment=require(_0xf754('0x5'));var BPromise=require(_0xf754('0x6'));var Mustache=require(_0xf754('0x7'));var util=require('util');var path=require(_0xf754('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf754('0x9'));var fs=require('fs');var fs_extra=require(_0xf754('0xa'));var _=require(_0xf754('0xb'));var squel=require(_0xf754('0xc'));var crypto=require(_0xf754('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf754('0xe'));var toCsv=require(_0xf754('0xf'));var querystring=require('querystring');var Papa=require(_0xf754('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf754('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf754('0x12'));var logger=require(_0xf754('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf754('0x14'));var db=require(_0xf754('0x15'))['db'];function respondWithStatusCode(_0x47622e,_0x37ec32){_0x37ec32=_0x37ec32||0xcc;return function(_0x441e54){if(_0x441e54){return _0x47622e[_0xf754('0x16')](_0x37ec32);}return _0x47622e[_0xf754('0x17')](_0x37ec32)[_0xf754('0x18')]();};}function respondWithResult(_0x17d2e1,_0xb141d4){_0xb141d4=_0xb141d4||0xc8;return function(_0x3fa37b){if(_0x3fa37b){return _0x17d2e1[_0xf754('0x17')](_0xb141d4)[_0xf754('0x19')](_0x3fa37b);}};}function respondWithFilteredResult(_0x4d3b11,_0x51263c){return function(_0xc349b6){if(_0xc349b6){var _0x205a2b=typeof _0x51263c[_0xf754('0x1a')]===_0xf754('0x1b')&&typeof _0x51263c[_0xf754('0x1c')]===_0xf754('0x1b');var _0x3f0089=_0xc349b6['count'];var _0x48b5bc=_0x205a2b?0x0:_0x51263c[_0xf754('0x1a')];var _0xcbbc6a=_0x205a2b?_0xc349b6[_0xf754('0x1d')]:_0x51263c[_0xf754('0x1a')]+_0x51263c[_0xf754('0x1c')];var _0x4c805d;if(_0xcbbc6a>=_0x3f0089){_0xcbbc6a=_0x3f0089;_0x4c805d=0xc8;}else{_0x4c805d=0xce;}_0x4d3b11[_0xf754('0x17')](_0x4c805d);return _0x4d3b11[_0xf754('0x1e')](_0xf754('0x1f'),_0x48b5bc+'-'+_0xcbbc6a+'/'+_0x3f0089)[_0xf754('0x19')](_0xc349b6);}return null;};}function patchUpdates(_0x218aeb){return function(_0x32970d){try{jsonpatch[_0xf754('0x20')](_0x32970d,_0x218aeb,!![]);}catch(_0x2e312b){return BPromise[_0xf754('0x21')](_0x2e312b);}return _0x32970d[_0xf754('0x22')]();};}function saveUpdates(_0x39a3fe,_0x417c8){return function(_0x3e9140){if(_0x3e9140){return _0x3e9140[_0xf754('0x23')](_0x39a3fe)[_0xf754('0x24')](function(_0x1b6541){return _0x1b6541;});}return null;};}function removeEntity(_0x5be432,_0x4b9a12){return function(_0x42fc14){if(_0x42fc14){return _0x42fc14[_0xf754('0x25')]()['then'](function(){_0x5be432['status'](0xcc)[_0xf754('0x18')]();});}};}function handleEntityNotFound(_0x29c137,_0x1100c4){return function(_0x1b11f6){if(!_0x1b11f6){_0x29c137[_0xf754('0x16')](0x194);}return _0x1b11f6;};}function handleError(_0x4c4bfc,_0x3b59d3){_0x3b59d3=_0x3b59d3||0x1f4;return function(_0x568554){logger[_0xf754('0x26')](_0x568554['stack']);if(_0x568554[_0xf754('0x27')]){delete _0x568554[_0xf754('0x27')];}_0x4c4bfc[_0xf754('0x17')](_0x3b59d3)[_0xf754('0x28')](_0x568554);};}exports[_0xf754('0x29')]=function(_0xc37c26,_0x3cd018){var _0x4bddc5={},_0x246622={},_0x49c4ca={'count':0x0,'rows':[]};var _0x11bc34=_[_0xf754('0x2a')](db['VoiceQueuesLog'][_0xf754('0x2b')],function(_0x10a2d8){return{'name':_0x10a2d8[_0xf754('0x2c')],'type':_0x10a2d8[_0xf754('0x2d')][_0xf754('0x2e')]};});_0x246622['model']=_[_0xf754('0x2a')](_0x11bc34,'name');_0x246622[_0xf754('0x2f')]=_[_0xf754('0x30')](_0xc37c26[_0xf754('0x2f')]);_0x246622[_0xf754('0x31')]=_[_0xf754('0x32')](_0x246622['model'],_0x246622[_0xf754('0x2f')]);_0x4bddc5['attributes']=_[_0xf754('0x32')](_0x246622[_0xf754('0x33')],qs['fields'](_0xc37c26['query'][_0xf754('0x34')]));_0x4bddc5[_0xf754('0x35')]=_0x4bddc5['attributes'][_0xf754('0x36')]?_0x4bddc5[_0xf754('0x35')]:_0x246622[_0xf754('0x33')];if(!_0xc37c26[_0xf754('0x2f')]['hasOwnProperty'](_0xf754('0x37'))){_0x4bddc5['limit']=qs['limit'](_0xc37c26[_0xf754('0x2f')][_0xf754('0x1c')]);_0x4bddc5['offset']=qs[_0xf754('0x1a')](_0xc37c26['query']['offset']);}_0x4bddc5[_0xf754('0x38')]=qs[_0xf754('0x39')](_0xc37c26[_0xf754('0x2f')]['sort']);_0x4bddc5[_0xf754('0x3a')]=qs['filters'](_[_0xf754('0x3b')](_0xc37c26[_0xf754('0x2f')],_0x246622[_0xf754('0x31')]),_0x11bc34);if(_0xc37c26[_0xf754('0x2f')][_0xf754('0x3c')]){_0x4bddc5[_0xf754('0x3a')]=_['merge'](_0x4bddc5['where'],{'$or':_['map'](_0x11bc34,function(_0x3138f2){if(_0x3138f2[_0xf754('0x2d')]!=='VIRTUAL'){var _0x36b40c={};_0x36b40c[_0x3138f2[_0xf754('0x27')]]={'$like':'%'+_0xc37c26[_0xf754('0x2f')][_0xf754('0x3c')]+'%'};return _0x36b40c;}})});}_0x4bddc5=_[_0xf754('0x3d')]({},_0x4bddc5,_0xc37c26[_0xf754('0x3e')]);var _0x2a654a={'where':_0x4bddc5[_0xf754('0x3a')]};return db[_0xf754('0x3f')][_0xf754('0x1d')](_0x2a654a)['then'](function(_0x337757){_0x49c4ca[_0xf754('0x1d')]=_0x337757;if(_0xc37c26['query']['includeAll']){_0x4bddc5[_0xf754('0x40')]=[{'all':!![]}];}return db[_0xf754('0x3f')]['findAll'](_0x4bddc5);})['then'](function(_0x5c26e8){_0x49c4ca[_0xf754('0x41')]=_0x5c26e8;return _0x49c4ca;})['then'](respondWithFilteredResult(_0x3cd018,_0x4bddc5))[_0xf754('0x42')](handleError(_0x3cd018,null));};exports[_0xf754('0x43')]=function(_0x1948d6,_0x22cc7c){var _0x3b24cf={'raw':!![],'where':{'id':_0x1948d6['params']['id']}},_0x3bb820={};_0x3bb820[_0xf754('0x33')]=_[_0xf754('0x30')](db[_0xf754('0x3f')][_0xf754('0x2b')]);_0x3bb820[_0xf754('0x2f')]=_[_0xf754('0x30')](_0x1948d6['query']);_0x3bb820['filters']=_[_0xf754('0x32')](_0x3bb820[_0xf754('0x33')],_0x3bb820[_0xf754('0x2f')]);_0x3b24cf[_0xf754('0x35')]=_[_0xf754('0x32')](_0x3bb820[_0xf754('0x33')],qs[_0xf754('0x34')](_0x1948d6['query'][_0xf754('0x34')]));_0x3b24cf[_0xf754('0x35')]=_0x3b24cf[_0xf754('0x35')][_0xf754('0x36')]?_0x3b24cf[_0xf754('0x35')]:_0x3bb820['model'];if(_0x1948d6[_0xf754('0x2f')]['includeAll']){_0x3b24cf[_0xf754('0x40')]=[{'all':!![]}];}_0x3b24cf=_[_0xf754('0x3d')]({},_0x3b24cf,_0x1948d6['options']);return db[_0xf754('0x3f')]['find'](_0x3b24cf)[_0xf754('0x24')](handleEntityNotFound(_0x22cc7c,null))[_0xf754('0x24')](respondWithResult(_0x22cc7c,null))['catch'](handleError(_0x22cc7c,null));};exports['create']=function(_0x146774,_0x488c01){return db['VoiceQueuesLog'][_0xf754('0x44')](_0x146774[_0xf754('0x45')],{})[_0xf754('0x24')](respondWithResult(_0x488c01,0xc9))[_0xf754('0x42')](handleError(_0x488c01,null));};exports['update']=function(_0x50bc7f,_0x354f74){if(_0x50bc7f[_0xf754('0x45')]['id']){delete _0x50bc7f[_0xf754('0x45')]['id'];}return db[_0xf754('0x3f')][_0xf754('0x46')]({'where':{'id':_0x50bc7f[_0xf754('0x47')]['id']}})[_0xf754('0x24')](handleEntityNotFound(_0x354f74,null))[_0xf754('0x24')](saveUpdates(_0x50bc7f['body'],null))[_0xf754('0x24')](respondWithResult(_0x354f74,null))[_0xf754('0x42')](handleError(_0x354f74,null));};exports[_0xf754('0x25')]=function(_0x20f468,_0x179c71){return db[_0xf754('0x3f')][_0xf754('0x46')]({'where':{'id':_0x20f468[_0xf754('0x47')]['id']}})[_0xf754('0x24')](handleEntityNotFound(_0x179c71,null))['then'](removeEntity(_0x179c71,null))['catch'](handleError(_0x179c71,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index eb7233b..7ec0a56 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 _0x9179=['exports','define','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2c2707,_0x4f96a7){var _0x1abc62=function(_0x1b33af){while(--_0x1b33af){_0x2c2707['push'](_0x2c2707['shift']());}};_0x1abc62(++_0x4f96a7);}(_0x9179,0x1d2));var _0x9917=function(_0x26aac3,_0x283931){_0x26aac3=_0x26aac3-0x0;var _0x1f6428=_0x9179[_0x26aac3];return _0x1f6428;};'use strict';var _=require(_0x9917('0x0'));var util=require(_0x9917('0x1'));var logger=require(_0x9917('0x2'))(_0x9917('0x3'));var moment=require('moment');var BPromise=require(_0x9917('0x4'));var rp=require(_0x9917('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0x9917('0x6')]=function(_0x1e908a,_0x4c3e15){return _0x1e908a[_0x9917('0x7')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xd392=['voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','VoiceQueuesLog'];(function(_0x3bc050,_0x300820){var _0x2e9099=function(_0x2c32e2){while(--_0x2c32e2){_0x3bc050['push'](_0x3bc050['shift']());}};_0x2e9099(++_0x300820);}(_0xd392,0x7c));var _0x2d39=function(_0x6e0258,_0x40b843){_0x6e0258=_0x6e0258-0x0;var _0x310b47=_0xd392[_0x6e0258];return _0x310b47;};'use strict';var _=require(_0x2d39('0x0'));var util=require(_0x2d39('0x1'));var logger=require(_0x2d39('0x2'))('api');var moment=require(_0x2d39('0x3'));var BPromise=require(_0x2d39('0x4'));var rp=require(_0x2d39('0x5'));var fs=require('fs');var path=require(_0x2d39('0x6'));var rimraf=require(_0x2d39('0x7'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0x2d39('0x8')]=function(_0x1f3088,_0x33fc40){return _0x1f3088[_0x2d39('0x9')](_0x2d39('0xa'),attributes,{'tableName':_0x2d39('0xb'),'paranoid':![],'indexes':[{'name':_0x2d39('0xc'),'fields':[_0x2d39('0xd'),_0x2d39('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 388b540..b2a186f 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 _0xb544=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment'];(function(_0x20d546,_0x4a99b3){var _0x54aaf1=function(_0x49fe8b){while(--_0x49fe8b){_0x20d546['push'](_0x20d546['shift']());}};_0x54aaf1(++_0x4a99b3);}(_0xb544,0xd0));var _0x4b54=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xb544[_0x4792c8];return _0x35edb1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4b54('0x0'));var BPromise=require(_0x4b54('0x1'));var rs=require(_0x4b54('0x2'));var fs=require('fs');var Redis=require(_0x4b54('0x3'));var db=require(_0x4b54('0x4'))['db'];var utils=require(_0x4b54('0x5'));var logger=require(_0x4b54('0x6'))(_0x4b54('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc9f31c,_0x513b8f,_0x2bf592){return new BPromise(function(_0x512bff,_0x1a5800){return client[_0x4b54('0x8')](_0xc9f31c,_0x2bf592)['then'](function(_0x3c9100){logger[_0x4b54('0x9')](_0x4b54('0xa'),_0x513b8f,_0x4b54('0xb'));logger[_0x4b54('0xc')](_0x4b54('0xd'),_0x513b8f,_0x4b54('0xb'),JSON['stringify'](_0x3c9100));if(_0x3c9100[_0x4b54('0xe')]){if(_0x3c9100[_0x4b54('0xe')][_0x4b54('0xf')]===0x1f4){logger['error'](_0x4b54('0xa'),_0x513b8f,_0x3c9100[_0x4b54('0xe')]['message']);return _0x1a5800(_0x3c9100[_0x4b54('0xe')][_0x4b54('0x10')]);}logger['error'](_0x4b54('0xa'),_0x513b8f,_0x3c9100[_0x4b54('0xe')]['message']);return _0x512bff(_0x3c9100['error'][_0x4b54('0x10')]);}else{logger['info'](_0x4b54('0xa'),_0x513b8f,'request\x20sent');_0x512bff(_0x3c9100[_0x4b54('0x11')]['message']);}})[_0x4b54('0x12')](function(_0x4d8aa7){logger['error'](_0x4b54('0xa'),_0x513b8f,_0x4d8aa7);_0x1a5800(_0x4d8aa7);});});} \ No newline at end of file +var _0xed65=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0xed65,0xd6));var _0x5ed6=function(_0x469665,_0x394876){_0x469665=_0x469665-0x0;var _0x291ab5=_0xed65[_0x469665];return _0x291ab5;};'use strict';var _=require('lodash');var util=require(_0x5ed6('0x0'));var moment=require(_0x5ed6('0x1'));var BPromise=require(_0x5ed6('0x2'));var rs=require(_0x5ed6('0x3'));var fs=require('fs');var Redis=require(_0x5ed6('0x4'));var db=require(_0x5ed6('0x5'))['db'];var utils=require(_0x5ed6('0x6'));var logger=require(_0x5ed6('0x7'))(_0x5ed6('0x8'));var config=require(_0x5ed6('0x9'));var jayson=require(_0x5ed6('0xa'));var client=jayson[_0x5ed6('0xb')][_0x5ed6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x204667,_0x174cba,_0xee556c){return new BPromise(function(_0x5327e1,_0x23ffd6){return client['request'](_0x204667,_0xee556c)[_0x5ed6('0xd')](function(_0x206553){logger[_0x5ed6('0xe')](_0x5ed6('0xf'),_0x174cba,'request\x20sent');logger['debug'](_0x5ed6('0x10'),_0x174cba,_0x5ed6('0x11'),JSON['stringify'](_0x206553));if(_0x206553[_0x5ed6('0x12')]){if(_0x206553[_0x5ed6('0x12')][_0x5ed6('0x13')]===0x1f4){logger[_0x5ed6('0x12')](_0x5ed6('0xf'),_0x174cba,_0x206553[_0x5ed6('0x12')][_0x5ed6('0x14')]);return _0x23ffd6(_0x206553[_0x5ed6('0x12')][_0x5ed6('0x14')]);}logger[_0x5ed6('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x174cba,_0x206553[_0x5ed6('0x12')][_0x5ed6('0x14')]);return _0x5327e1(_0x206553[_0x5ed6('0x12')][_0x5ed6('0x14')]);}else{logger['info'](_0x5ed6('0xf'),_0x174cba,_0x5ed6('0x11'));_0x5327e1(_0x206553[_0x5ed6('0x15')]['message']);}})[_0x5ed6('0x16')](function(_0x540c97){logger[_0x5ed6('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x174cba,_0x540c97);_0x23ffd6(_0x540c97);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 1fef5ff..30d3135 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 _0xdeec=['delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','update'];(function(_0x4a2689,_0x314a16){var _0x463450=function(_0x5388b8){while(--_0x5388b8){_0x4a2689['push'](_0x4a2689['shift']());}};_0x463450(++_0x314a16);}(_0xdeec,0x145));var _0xcdee=function(_0x23a584,_0x5dcda3){_0x23a584=_0x23a584-0x0;var _0x1235bc=_0xdeec[_0x23a584];return _0x1235bc;};'use strict';var multer=require('multer');var util=require(_0xcdee('0x0'));var path=require(_0xcdee('0x1'));var timeout=require('connect-timeout');var express=require(_0xcdee('0x2'));var router=express[_0xcdee('0x3')]();var fs_extra=require(_0xcdee('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcdee('0x5'));var config=require(_0xcdee('0x6'));var controller=require('./voiceRecording.controller');router[_0xcdee('0x7')]('/',auth[_0xcdee('0x8')](),controller[_0xcdee('0x9')]);router[_0xcdee('0x7')](_0xcdee('0xa'),auth['isAuthenticated'](),controller[_0xcdee('0xb')]);router[_0xcdee('0x7')](_0xcdee('0xc'),auth[_0xcdee('0x8')](),controller['show']);router['get']('/:id/download',auth[_0xcdee('0x8')](),controller['download']);router[_0xcdee('0x7')](_0xcdee('0xd'),controller['downloads']);router[_0xcdee('0x7')]('/:id/transcribe',auth[_0xcdee('0x8')](),controller[_0xcdee('0xe')]);router[_0xcdee('0xf')]('/',auth[_0xcdee('0x8')](),controller[_0xcdee('0x10')]);router['post'](_0xcdee('0x11'),auth[_0xcdee('0x8')](),controller[_0xcdee('0x12')]);router['put']('/:id',auth[_0xcdee('0x8')](),controller[_0xcdee('0x13')]);router[_0xcdee('0x14')](_0xcdee('0xc'),auth['isAuthenticated'](),controller[_0xcdee('0x15')]);module[_0xcdee('0x16')]=router; \ No newline at end of file +var _0xe16d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','downloads','/:id/transcribe','downloadTranscribe','create','post','put','exports','multer','path','connect-timeout','express'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xe16d,0xcb));var _0xde16=function(_0x24e9a8,_0x175fb0){_0x24e9a8=_0x24e9a8-0x0;var _0x4f4dbc=_0xe16d[_0x24e9a8];return _0x4f4dbc;};'use strict';var multer=require(_0xde16('0x0'));var util=require('util');var path=require(_0xde16('0x1'));var timeout=require(_0xde16('0x2'));var express=require(_0xde16('0x3'));var router=express[_0xde16('0x4')]();var fs_extra=require(_0xde16('0x5'));var auth=require(_0xde16('0x6'));var interaction=require(_0xde16('0x7'));var config=require('../../config/environment');var controller=require(_0xde16('0x8'));router[_0xde16('0x9')]('/',auth[_0xde16('0xa')](),controller[_0xde16('0xb')]);router[_0xde16('0x9')](_0xde16('0xc'),auth[_0xde16('0xa')](),controller[_0xde16('0xd')]);router[_0xde16('0x9')](_0xde16('0xe'),auth['isAuthenticated'](),controller[_0xde16('0xf')]);router[_0xde16('0x9')]('/:id/download',auth[_0xde16('0xa')](),controller['download']);router['get']('/:id/downloads',controller[_0xde16('0x10')]);router[_0xde16('0x9')](_0xde16('0x11'),auth['isAuthenticated'](),controller[_0xde16('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xde16('0x13')]);router[_0xde16('0x14')]('/:id/transcribe',auth[_0xde16('0xa')](),controller['runTranscribe']);router[_0xde16('0x15')](_0xde16('0xe'),auth[_0xde16('0xa')](),controller['update']);router['delete'](_0xde16('0xe'),auth[_0xde16('0xa')](),controller['destroy']);module[_0xde16('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 2f2aeff..f9dcaa9 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(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 4b3cb63..fb802fc 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 _0x2380=['/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','VoiceRecording','rawAttributes','type','key','model','differenceBy','format','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','describe','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','ValidationError','VoiceRecording\x20not\x20found','extname','unlink','download','Not\x20found','sequelize','MD5','col','$and','push','Sequelize','filename','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','runTranscribe','findOne','Setting','transcribeAccountId','transcribeRegion','bucket','Transcribe\x20not\x20configured','sentiment','language','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','runSentiment','updateAttributes','downloadTranscribe','fileText'];(function(_0x3e9a63,_0x438ae6){var _0x4883e4=function(_0x19183f){while(--_0x19183f){_0x3e9a63['push'](_0x3e9a63['shift']());}};_0x4883e4(++_0x438ae6);}(_0x2380,0x1bc));var _0x0238=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x2380[_0x2f1762];return _0x8ab21;};'use strict';var emlformat=require(_0x0238('0x0'));var rimraf=require(_0x0238('0x1'));var zipdir=require(_0x0238('0x2'));var jsonpatch=require(_0x0238('0x3'));var rp=require(_0x0238('0x4'));var moment=require(_0x0238('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0238('0x6'));var util=require('util');var path=require(_0x0238('0x7'));var sox=require(_0x0238('0x8'));var csv=require(_0x0238('0x9'));var ejs=require(_0x0238('0xa'));var fs=require('fs');var fs_extra=require(_0x0238('0xb'));var _=require('lodash');var squel=require(_0x0238('0xc'));var crypto=require('crypto');var jsforce=require(_0x0238('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0238('0xe'));var Papa=require(_0x0238('0xf'));var AWS=require('aws-sdk');var uuidv4=require(_0x0238('0x10'));var Redis=require(_0x0238('0x11'));var authService=require(_0x0238('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0238('0x13'))(_0x0238('0x14'));var utils=require(_0x0238('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0238('0x16'));var db=require(_0x0238('0x17'))['db'];function respondWithStatusCode(_0x22b70c,_0x197054){_0x197054=_0x197054||0xcc;return function(_0x1de3f0){if(_0x1de3f0){return _0x22b70c[_0x0238('0x18')](_0x197054);}return _0x22b70c['status'](_0x197054)[_0x0238('0x19')]();};}function respondWithResult(_0x3c1b8f,_0x49b711){_0x49b711=_0x49b711||0xc8;return function(_0x15dd6b){if(_0x15dd6b){return _0x3c1b8f[_0x0238('0x1a')](_0x49b711)[_0x0238('0x1b')](_0x15dd6b);}};}function respondWithFilteredResult(_0x13bf81,_0x4e48cb){return function(_0x12dcd3){if(_0x12dcd3){var _0xc11825=typeof _0x4e48cb[_0x0238('0x1c')]===_0x0238('0x1d')&&typeof _0x4e48cb[_0x0238('0x1e')]==='undefined';var _0x4467d5=_0x12dcd3[_0x0238('0x1f')];var _0x2d9fe4=_0xc11825?0x0:_0x4e48cb[_0x0238('0x1c')];var _0x398039=_0xc11825?_0x12dcd3[_0x0238('0x1f')]:_0x4e48cb['offset']+_0x4e48cb[_0x0238('0x1e')];var _0x10a1d9;if(_0x398039>=_0x4467d5){_0x398039=_0x4467d5;_0x10a1d9=0xc8;}else{_0x10a1d9=0xce;}_0x13bf81[_0x0238('0x1a')](_0x10a1d9);return _0x13bf81[_0x0238('0x20')](_0x0238('0x21'),_0x2d9fe4+'-'+_0x398039+'/'+_0x4467d5)[_0x0238('0x1b')](_0x12dcd3);}return null;};}function patchUpdates(_0x2b588d){return function(_0x1dcb08){try{jsonpatch[_0x0238('0x22')](_0x1dcb08,_0x2b588d,!![]);}catch(_0x43f7a4){return BPromise[_0x0238('0x23')](_0x43f7a4);}return _0x1dcb08[_0x0238('0x24')]();};}function saveUpdates(_0x3d27f6,_0x14bf03){return function(_0xf338de){if(_0xf338de){return _0xf338de[_0x0238('0x25')](_0x3d27f6)['then'](function(_0x2713f7){return _0x2713f7;});}return null;};}function removeEntity(_0x2d984a,_0x18704c){return function(_0x34bd74){if(_0x34bd74){return _0x34bd74[_0x0238('0x26')]()['then'](function(){_0x2d984a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56fc9e,_0xd9b9fc){return function(_0x5ca7cb){if(!_0x5ca7cb){_0x56fc9e[_0x0238('0x18')](0x194);}return _0x5ca7cb;};}function handleError(_0x2a277e,_0xc77e89){_0xc77e89=_0xc77e89||0x1f4;return function(_0x535676){logger[_0x0238('0x27')](_0x535676[_0x0238('0x28')]);if(_0x535676['name']){delete _0x535676[_0x0238('0x29')];}_0x2a277e[_0x0238('0x1a')](_0xc77e89)[_0x0238('0x2a')](_0x535676);};}exports[_0x0238('0x2b')]=function(_0xc131f5,_0x2af9b4){var _0x3de828={},_0x45fb54={},_0x3f3d70={'count':0x0,'rows':[]};var _0x40a96f=_[_0x0238('0x2c')](db[_0x0238('0x2d')][_0x0238('0x2e')],function(_0x41db78){return{'name':_0x41db78['fieldName'],'type':_0x41db78[_0x0238('0x2f')][_0x0238('0x30')]};});_0x45fb54[_0x0238('0x31')]=_[_0x0238('0x32')](_[_0x0238('0x2c')](_0x40a96f,'name'),[_0x0238('0x33')]);_0x45fb54['query']=_[_0x0238('0x34')](_0xc131f5[_0x0238('0x35')]);_0x45fb54[_0x0238('0x36')]=_[_0x0238('0x37')](_0x45fb54['model'],_0x45fb54[_0x0238('0x35')]);_0x3de828[_0x0238('0x38')]=_[_0x0238('0x37')](_0x45fb54[_0x0238('0x31')],qs['fields'](_0xc131f5[_0x0238('0x35')]['fields']));_0x3de828[_0x0238('0x38')]=_0x3de828[_0x0238('0x38')][_0x0238('0x39')]?_0x3de828['attributes']:_0x45fb54[_0x0238('0x31')];if(!_0xc131f5[_0x0238('0x35')]['hasOwnProperty'](_0x0238('0x3a'))){_0x3de828[_0x0238('0x1e')]=qs[_0x0238('0x1e')](_0xc131f5[_0x0238('0x35')][_0x0238('0x1e')]);_0x3de828['offset']=qs['offset'](_0xc131f5[_0x0238('0x35')]['offset']);}_0x3de828[_0x0238('0x3b')]=qs[_0x0238('0x3c')](_0xc131f5[_0x0238('0x35')][_0x0238('0x3c')]);_0x3de828[_0x0238('0x3d')]=qs['filters'](_['pick'](_0xc131f5[_0x0238('0x35')],_0x45fb54[_0x0238('0x36')]),_0x40a96f);if(_0xc131f5[_0x0238('0x35')][_0x0238('0x3e')]){_0x3de828[_0x0238('0x3d')]=_[_0x0238('0x3f')](_0x3de828['where'],{'$or':_[_0x0238('0x2c')](_0x40a96f,function(_0x43f83c){if(_0x43f83c['type']!==_0x0238('0x40')){var _0x3ab11b={};_0x3ab11b[_0x43f83c[_0x0238('0x29')]]={'$like':'%'+_0xc131f5[_0x0238('0x35')][_0x0238('0x3e')]+'%'};return _0x3ab11b;}})});}_0x3de828=_['merge']({},_0x3de828,_0xc131f5[_0x0238('0x41')]);var _0x443104={'where':_0x3de828[_0x0238('0x3d')]};return db[_0x0238('0x2d')][_0x0238('0x1f')](_0x443104)[_0x0238('0x42')](function(_0x1e694e){_0x3f3d70[_0x0238('0x1f')]=_0x1e694e;if(_0xc131f5[_0x0238('0x35')][_0x0238('0x43')]){_0x3de828[_0x0238('0x44')]=[{'all':!![]}];}return db[_0x0238('0x2d')][_0x0238('0x45')](_0x3de828);})[_0x0238('0x42')](function(_0x304301){_0x3f3d70[_0x0238('0x46')]=_0x304301;return _0x3f3d70;})[_0x0238('0x42')](respondWithFilteredResult(_0x2af9b4,_0x3de828))[_0x0238('0x47')](handleError(_0x2af9b4,null));};exports[_0x0238('0x48')]=function(_0x454362,_0x154338){var _0x3c6e77={'raw':![],'where':{'id':_0x454362[_0x0238('0x49')]['id']}},_0x231bc2={};_0x231bc2['model']=_['keys'](db['VoiceRecording'][_0x0238('0x2e')]);_0x231bc2[_0x0238('0x35')]=_[_0x0238('0x34')](_0x454362[_0x0238('0x35')]);_0x231bc2['filters']=_[_0x0238('0x37')](_0x231bc2[_0x0238('0x31')],_0x231bc2[_0x0238('0x35')]);_0x3c6e77[_0x0238('0x38')]=_[_0x0238('0x37')](_0x231bc2[_0x0238('0x31')],qs['fields'](_0x454362['query'][_0x0238('0x4a')]));_0x3c6e77[_0x0238('0x38')]=_0x3c6e77[_0x0238('0x38')][_0x0238('0x39')]?_0x3c6e77['attributes']:_0x231bc2[_0x0238('0x31')];if(_0x454362[_0x0238('0x35')]['includeAll']){_0x3c6e77['include']=[{'all':!![]}];}_0x3c6e77=_['merge']({},_0x3c6e77,_0x454362[_0x0238('0x41')]);return db['VoiceRecording']['find'](_0x3c6e77)[_0x0238('0x42')](handleEntityNotFound(_0x154338,null))[_0x0238('0x42')](respondWithResult(_0x154338,null))['catch'](handleError(_0x154338,null));};exports[_0x0238('0x4b')]=function(_0x276c67,_0x1f2238){return db[_0x0238('0x2d')][_0x0238('0x4b')](_0x276c67[_0x0238('0x4c')],{})[_0x0238('0x42')](respondWithResult(_0x1f2238,0xc9))['catch'](handleError(_0x1f2238,null));};exports[_0x0238('0x25')]=function(_0x1612c3,_0x13402e){if(_0x1612c3['body']['id']){delete _0x1612c3[_0x0238('0x4c')]['id'];}return db[_0x0238('0x2d')][_0x0238('0x4d')]({'where':{'id':_0x1612c3[_0x0238('0x49')]['id']}})[_0x0238('0x42')](handleEntityNotFound(_0x13402e,null))[_0x0238('0x42')](saveUpdates(_0x1612c3[_0x0238('0x4c')],null))[_0x0238('0x42')](respondWithResult(_0x13402e,null))[_0x0238('0x47')](handleError(_0x13402e,null));};exports['describe']=function(_0x32621f,_0x6bb7d0){return db['VoiceRecording'][_0x0238('0x4e')]()[_0x0238('0x42')](respondWithResult(_0x6bb7d0,null))[_0x0238('0x47')](handleError(_0x6bb7d0,null));};exports['download']=function(_0x200bb6,_0x1a321c,_0x36607c){var _0x4e678c=require(_0x0238('0x4f'));var _0x28cf3b=![];var _0x53b4ce={};if(_0x200bb6[_0x0238('0x35')]['type']&&_0x200bb6['query'][_0x0238('0x2f')]===_0x0238('0x50')){_0x53b4ce[_0x0238('0x50')]=_0x200bb6[_0x0238('0x49')]['id'];}else{_0x53b4ce['id']=_0x200bb6[_0x0238('0x49')]['id'];}return db['VoiceRecording'][_0x0238('0x4d')]({'where':_0x53b4ce,'attributes':['id',_0x0238('0x51')],'raw':!![]})[_0x0238('0x42')](handleEntityNotFound(_0x1a321c,null))[_0x0238('0x42')](function(_0x555d1d){if(_0x555d1d){var _0x1e69eb=_0x555d1d[_0x0238('0x51')];var _0x415afb=util['format'](_0x0238('0x52'),_0x1e69eb);if(fs['existsSync'](_0x415afb)){_0x28cf3b=!![];return _0x4e678c[_0x0238('0x53')](_0x415afb,_0x1e69eb,config[_0x0238('0x54')][_0x0238('0x55')])['then'](function(){return _0x555d1d;});}return _0x555d1d;}})[_0x0238('0x42')](function(_0x375dc4){if(_0x375dc4){var _0x230574=_0x375dc4[_0x0238('0x51')];if(!fs[_0x0238('0x56')](_0x230574)){throw new db['Sequelize'][(_0x0238('0x57'))](_0x0238('0x58'));}if(_0x375dc4['filename']){return _0x1a321c['download'](_0x230574,_0x375dc4['filename']+path[_0x0238('0x59')](_0x230574),function(){if(_0x28cf3b){fs[_0x0238('0x5a')](_0x230574);}});}else{return _0x1a321c[_0x0238('0x5b')](_0x230574,function(_0x5ee4dd){if(_0x28cf3b){fs[_0x0238('0x5a')](_0x230574);}});}}})[_0x0238('0x47')](function(_0x3c8594){if(_0x3c8594['message']===_0x0238('0x58')){_0x1a321c[_0x0238('0x1a')](0x194)[_0x0238('0x2a')](_0x0238('0x5c'));}else{return handleError(_0x1a321c,null);}});};exports['downloads']=function(_0x482c29,_0xef1d61,_0x425b63){var _0x11b97c=require('../../components/encryptor');var _0x26e9d0=![];var _0x4e11ed={'$and':[db[_0x0238('0x5d')][_0x0238('0x3d')](db[_0x0238('0x5d')]['fn'](_0x0238('0x5e'),db[_0x0238('0x5d')][_0x0238('0x5f')]('uniqueid')),_0x482c29[_0x0238('0x35')]['token'])]};if(_0x482c29['query'][_0x0238('0x2f')]&&_0x482c29['query']['type']===_0x0238('0x50')){_0x4e11ed[_0x0238('0x60')]['push']({'uniqueid':_0x482c29['params']['id']});}else{_0x4e11ed['$and'][_0x0238('0x61')]({'id':_0x482c29[_0x0238('0x49')]['id']});}return db[_0x0238('0x2d')][_0x0238('0x4d')]({'where':_0x4e11ed,'attributes':['id',_0x0238('0x51')],'raw':!![]})[_0x0238('0x42')](handleEntityNotFound(_0xef1d61,null))['then'](function(_0x2a6f50){if(_0x2a6f50){var _0x5028e3=util[_0x0238('0x33')](_0x0238('0x52'),_0x2a6f50[_0x0238('0x51')]);if(fs['existsSync'](_0x5028e3)){_0x26e9d0=!![];return _0x11b97c['decryptFile'](_0x5028e3,_0x2a6f50[_0x0238('0x51')],config[_0x0238('0x54')][_0x0238('0x55')])[_0x0238('0x42')](function(){return _0x2a6f50;});}return _0x2a6f50;}})[_0x0238('0x42')](function(_0xe0aee6){if(_0xe0aee6){if(!fs[_0x0238('0x56')](_0xe0aee6[_0x0238('0x51')])){throw new db[(_0x0238('0x62'))][(_0x0238('0x57'))](_0x0238('0x58'));}if(_0xe0aee6[_0x0238('0x63')]){return _0xef1d61[_0x0238('0x5b')](_0xe0aee6[_0x0238('0x51')],_0xe0aee6['filename']+path[_0x0238('0x59')](_0xe0aee6[_0x0238('0x51')]),function(){if(_0x26e9d0){fs[_0x0238('0x5a')](_0xe0aee6[_0x0238('0x51')]);}});}else{return _0xef1d61[_0x0238('0x5b')](_0xe0aee6[_0x0238('0x51')],function(_0x1f517d){if(_0x26e9d0){fs[_0x0238('0x5a')](_0xe0aee6[_0x0238('0x51')]);}});}}})[_0x0238('0x47')](handleError(_0xef1d61,null));};exports[_0x0238('0x26')]=function(_0x1c0886,_0x1d8d42){return db[_0x0238('0x2d')][_0x0238('0x4d')]({'where':{'id':_0x1c0886[_0x0238('0x49')]['id']}})[_0x0238('0x42')](function(_0x59da2e){if(_[_0x0238('0x64')](_0x59da2e)){throw new ReferenceError(_0x0238('0x65'));}return _0x59da2e;})[_0x0238('0x42')](function(_0x553295){var _0x44fd2d=_0x553295[_0x0238('0x51')];logger['info'](_0x0238('0x66'),_0x44fd2d);if(!_[_0x0238('0x64')](_0x553295['value'])&&fs[_0x0238('0x56')](_0x44fd2d)){logger[_0x0238('0x67')](_0x0238('0x68')+_0x44fd2d+_0x0238('0x69'));fs[_0x0238('0x6a')](_0x44fd2d);}_0x44fd2d=_0x44fd2d+'.cypher';if(!_[_0x0238('0x64')](_0x553295[_0x0238('0x51')])&&fs['existsSync'](_0x44fd2d)){logger[_0x0238('0x67')]('File:\x20\x22'+_0x44fd2d+_0x0238('0x69'));fs[_0x0238('0x6a')](_0x44fd2d);}return _0x553295;})[_0x0238('0x42')](function(_0xb9491f){if(!_0xb9491f)throw new InternalError();return _0xb9491f[_0x0238('0x26')]();})['then'](function(){_0x1d8d42[_0x0238('0x1a')](0xcc)[_0x0238('0x19')]();})[_0x0238('0x47')](handleError(_0x1d8d42,null));};function getBucketslist(_0x50e12a,_0x294142,_0x22eafb){return new Promise(function(_0x447f55,_0x35a206){var _0x33919a=new AWS['S3']({'accessKeyId':_0x294142,'secretAccessKey':_0x50e12a,'region':_0x22eafb});_0x33919a[_0x0238('0x6b')]({},function(_0xab6eea,_0x232ba5){if(_0xab6eea){return _0x35a206(_0xab6eea);}else{return _0x447f55(_0x232ba5);}});});}function createBucket(_0x534b49,_0x6e040e,_0x38869c,_0x113daa){return new Promise(function(_0x520846,_0x23b25e){var _0x45cdb3=new AWS['S3']({'accessKeyId':_0x6e040e,'secretAccessKey':_0x534b49,'region':_0x38869c});_0x45cdb3[_0x0238('0x6c')]({'Bucket':_0x113daa},function(_0x336bb9,_0x51a94b){if(_0x336bb9){return _0x23b25e(_0x336bb9);}else{return _0x520846(_0x51a94b);}});});}function uploadFile(_0x4472cc,_0x392e14,_0x159b9d,_0x403c6e,_0x197ae3,_0x5de82f){return new Promise(function(_0x19f4cf,_0x4af128){var _0x44a16c=new AWS['S3']({'accessKeyId':_0x392e14,'secretAccessKey':_0x4472cc,'region':_0x159b9d});_0x44a16c[_0x0238('0x6d')]({'Bucket':_0x403c6e,'Key':_0x197ae3,'Body':_0x5de82f},function(_0x12f56b,_0x337fe9){if(_0x12f56b){return _0x4af128(_0x12f56b);}else{return _0x19f4cf(_0x337fe9);}});});}function startTranscribe(_0x427bc0,_0x3dcc57,_0x3de322,_0x222c6f,_0x1fb0cc,_0x279904){return new Promise(function(_0xf70fa8,_0x3d1d6d){var _0xc5b61d=new AWS['TranscribeService']({'accessKeyId':_0x3dcc57,'secretAccessKey':_0x427bc0,'region':_0x3de322});_0xc5b61d[_0x0238('0x6e')]({'TranscriptionJobName':_0x222c6f,'LanguageCode':_0x1fb0cc,'Media':{'MediaFileUri':_0x279904}},function(_0x3026f9,_0x6d0f49){if(_0x3026f9){return _0x3d1d6d(_0x3026f9);}else{return _0xf70fa8(_0x6d0f49);}});});}function transcribe(_0x2e5e71,_0x491bb7,_0x30a5a0,_0x5a8034,_0x4f06d6,_0x434227,_0x2350af){return new Promise(function(_0x5e4b77,_0x16ab1b){var _0x3c190b={};logger[_0x0238('0x67')](util[_0x0238('0x33')](_0x0238('0x6f'),_0x2e5e71,_0x4f06d6));return uploadFile(_0x491bb7,_0x30a5a0,_0x5a8034,_0x4f06d6,path[_0x0238('0x70')](_0x434227),fs[_0x0238('0x71')](_0x434227))[_0x0238('0x42')](function(_0x4259e0){logger[_0x0238('0x67')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x2e5e71,_0x4f06d6,_0x4259e0[_0x0238('0x72')]));_0x3c190b['bucket']=_0x4259e0['Bucket'];_0x3c190b[_0x0238('0x73')]=_0x4259e0[_0x0238('0x72')];logger[_0x0238('0x67')](util['format'](_0x0238('0x74'),_0x2e5e71));return startTranscribe(_0x491bb7,_0x30a5a0,_0x5a8034,uuidv4(),_0x2350af,_0x4259e0[_0x0238('0x72')]);})[_0x0238('0x42')](function(_0x3b03ea){logger[_0x0238('0x67')](util['format'](_0x0238('0x75'),_0x2e5e71,_0x3b03ea[_0x0238('0x76')]['TranscriptionJobName']));_0x3c190b[_0x0238('0x77')]=_0x3b03ea[_0x0238('0x76')][_0x0238('0x78')];_0x3c190b['transcribeStatus']=_0x3b03ea[_0x0238('0x76')]['TranscriptionJobStatus'];return _0x5e4b77(_0x3c190b);})['catch'](function(_0x3bada5){return _0x16ab1b(_0x3bada5);});});}exports[_0x0238('0x79')]=function(_0x26caee,_0x401d7b,_0x5779c9){var _0xeae750;var _0x474392;var _0x17079c;var _0x29a6a4=require(_0x0238('0x4f'));return db[_0x0238('0x2d')][_0x0238('0x7a')]({'where':{'id':_0x26caee['params']['id']}})[_0x0238('0x42')](function(_0x570b16){if(_0x570b16){var _0x4efc67=util[_0x0238('0x33')]('%s.cypher',_0x570b16['value']);if(fs['existsSync'](_0x4efc67)){cypher=!![];return _0x29a6a4[_0x0238('0x53')](_0x4efc67,_0x570b16[_0x0238('0x51')],config[_0x0238('0x54')]['recording'])['then'](function(){return _0x570b16;});}return _0x570b16;}})[_0x0238('0x42')](function(_0x4cd892){if(!_0x4cd892){throw new db[(_0x0238('0x62'))][(_0x0238('0x57'))]('Voice\x20Recording\x20not\x20found');}_0x474392=_0x4cd892;return db[_0x0238('0x7b')]['findOne']({'where':{'id':0x1}});})[_0x0238('0x42')](handleEntityNotFound(_0x401d7b,null))[_0x0238('0x42')](function(_0x2ec34c){if(_0x2ec34c){_0xeae750=_0x2ec34c;if(!_0xeae750['transcribe']||!_0xeae750[_0x0238('0x7c')]||!_0xeae750[_0x0238('0x7d')]||!_0xeae750['language']||!_0xeae750[_0x0238('0x7e')]){throw new db[(_0x0238('0x62'))]['ValidationError'](_0x0238('0x7f'));}if(_0x26caee[_0x0238('0x4c')]['runSentiment']&&(!_0xeae750[_0x0238('0x80')]||!_0xeae750['sentimentAccountId']||!_0xeae750['sentimentRegion']||!_0xeae750[_0x0238('0x81')]||!_0xeae750[_0x0238('0x7e')])){throw new db[(_0x0238('0x62'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x0238('0x82')][_0x0238('0x7a')]({'where':{'id':_0xeae750['transcribeAccountId']}});}})[_0x0238('0x42')](function(_0x3e196e){if(!_0x3e196e){throw new db[(_0x0238('0x62'))]['ValidationError'](_0x0238('0x83'));}if(!_0x3e196e[_0x0238('0x84')]||!_0x3e196e[_0x0238('0x85')]){throw new db[(_0x0238('0x62'))][(_0x0238('0x57'))](_0x0238('0x86'));}_0x17079c=_0x3e196e;return getBucketslist(_0x17079c[_0x0238('0x84')],_0x17079c['data2'],_0xeae750['transcribeRegion']);})[_0x0238('0x42')](function(_0x4c25fd){if(_0x4c25fd&&_0x4c25fd[_0x0238('0x87')]){var _0xba26f=_[_0x0238('0x4d')](_0x4c25fd[_0x0238('0x87')],function(_0x44843a){return _0x44843a[_0x0238('0x88')]===_0xeae750[_0x0238('0x7e')];});if(!_0xba26f){logger[_0x0238('0x67')](util[_0x0238('0x33')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x26caee['params']['id'],_0xeae750[_0x0238('0x7e')]));return createBucket(_0x17079c['data1'],_0x17079c[_0x0238('0x85')],_0xeae750[_0x0238('0x7d')],_0xeae750[_0x0238('0x7e')]);}logger['info'](util[_0x0238('0x33')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x26caee['params']['id'],_0xeae750[_0x0238('0x7e')]));return;}})[_0x0238('0x42')](function(_0xbb4a03){if(_0x474392[_0x0238('0x89')]===_0x0238('0x8a')){return transcribe(_0x26caee['params']['id'],_0x17079c[_0x0238('0x84')],_0x17079c[_0x0238('0x85')],_0xeae750[_0x0238('0x7d')],_0xeae750['bucket'],_0x474392[_0x0238('0x51')],_0xeae750['language']);}else{logger[_0x0238('0x67')](util['format'](_0x0238('0x8b'),_0x26caee[_0x0238('0x49')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x0238('0x42')](function(_0xfd26fe){if(_0xfd26fe){_0xfd26fe['tempSentiment']=_0x26caee['body'][_0x0238('0x8c')];return _0x474392[_0x0238('0x8d')](_0xfd26fe);}})[_0x0238('0x42')](respondWithResult(_0x401d7b,null))[_0x0238('0x47')](handleError(_0x401d7b,null));};function writeFile(_0x11afc0,_0x1df35a){return new Promise(function(_0x2546f8,_0x56bc9c){fs['writeFile'](_0x1df35a,_0x11afc0,function(_0x262004,_0x2725f4){if(_0x262004){return _0x56bc9c(_0x262004);}else{return _0x2546f8(_0x2725f4);}});});}exports[_0x0238('0x8e')]=function(_0x23fe23,_0x5d282e,_0x1673ce){return db['VoiceRecording'][_0x0238('0x7a')]({'where':{'id':_0x23fe23[_0x0238('0x49')]['id']}})[_0x0238('0x42')](handleEntityNotFound(_0x5d282e))[_0x0238('0x42')](function(_0x48ab23){if(_0x48ab23&&_0x48ab23['fileText']){var _0x709181=_0x48ab23[_0x0238('0x8f')];var _0x476a60=config['root']+_0x0238('0x90')+_0x48ab23['id']+_0x0238('0x91');if(fs[_0x0238('0x56')](_0x476a60)){return _0x476a60;}return writeFile(_0x709181,_0x476a60)[_0x0238('0x42')](function(){return _0x476a60;});}else{throw new db[(_0x0238('0x62'))][(_0x0238('0x57'))](_0x0238('0x92'));}})[_0x0238('0x42')](function(_0x170fd8){return _0x5d282e['download'](_0x170fd8);})['catch'](handleError(_0x5d282e));}; \ No newline at end of file +var _0x95c4=['sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','VoiceRecording','includeAll','include','rows','catch','show','merge','find','create','body','params','describe','../../components/encryptor','uniqueid','value','existsSync','secrets','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','send','Not\x20found','downloads','sequelize','MD5','token','$and','push','%s.cypher','decryptFile','recording','Sequelize','ValidationError','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','Setting','findOne','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','CloudProvider','data2','Cloud\x20Provider\x20not\x20configured','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x547229,_0x34fc13){var _0x1901d2=function(_0x55d152){while(--_0x55d152){_0x547229['push'](_0x547229['shift']());}};_0x1901d2(++_0x34fc13);}(_0x95c4,0x121));var _0x495c=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x95c4[_0x576170];return _0x397c70;};'use strict';var emlformat=require(_0x495c('0x0'));var rimraf=require(_0x495c('0x1'));var zipdir=require(_0x495c('0x2'));var jsonpatch=require(_0x495c('0x3'));var rp=require(_0x495c('0x4'));var moment=require(_0x495c('0x5'));var BPromise=require(_0x495c('0x6'));var Mustache=require('mustache');var util=require(_0x495c('0x7'));var path=require(_0x495c('0x8'));var sox=require(_0x495c('0x9'));var csv=require(_0x495c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x495c('0xb'));var _=require(_0x495c('0xc'));var squel=require(_0x495c('0xd'));var crypto=require('crypto');var jsforce=require(_0x495c('0xe'));var deskjs=require(_0x495c('0xf'));var toCsv=require(_0x495c('0xa'));var querystring=require('querystring');var Papa=require(_0x495c('0x10'));var AWS=require(_0x495c('0x11'));var uuidv4=require(_0x495c('0x12'));var Redis=require(_0x495c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x495c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x495c('0x15'));var logger=require(_0x495c('0x16'))('api');var utils=require(_0x495c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x495c('0x18'));var db=require(_0x495c('0x19'))['db'];function respondWithStatusCode(_0xafeccd,_0x32d18c){_0x32d18c=_0x32d18c||0xcc;return function(_0x276e2f){if(_0x276e2f){return _0xafeccd[_0x495c('0x1a')](_0x32d18c);}return _0xafeccd[_0x495c('0x1b')](_0x32d18c)[_0x495c('0x1c')]();};}function respondWithResult(_0x45e7de,_0x5d3424){_0x5d3424=_0x5d3424||0xc8;return function(_0x4d0df8){if(_0x4d0df8){return _0x45e7de[_0x495c('0x1b')](_0x5d3424)[_0x495c('0x1d')](_0x4d0df8);}};}function respondWithFilteredResult(_0x51de23,_0x13af3c){return function(_0x4b0134){if(_0x4b0134){var _0x209c3d=typeof _0x13af3c[_0x495c('0x1e')]===_0x495c('0x1f')&&typeof _0x13af3c['limit']===_0x495c('0x1f');var _0x5653c7=_0x4b0134['count'];var _0x154c9f=_0x209c3d?0x0:_0x13af3c[_0x495c('0x1e')];var _0x1304b8=_0x209c3d?_0x4b0134[_0x495c('0x20')]:_0x13af3c['offset']+_0x13af3c[_0x495c('0x21')];var _0x36f5ef;if(_0x1304b8>=_0x5653c7){_0x1304b8=_0x5653c7;_0x36f5ef=0xc8;}else{_0x36f5ef=0xce;}_0x51de23[_0x495c('0x1b')](_0x36f5ef);return _0x51de23['set'](_0x495c('0x22'),_0x154c9f+'-'+_0x1304b8+'/'+_0x5653c7)[_0x495c('0x1d')](_0x4b0134);}return null;};}function patchUpdates(_0x53ce58){return function(_0x511ba0){try{jsonpatch[_0x495c('0x23')](_0x511ba0,_0x53ce58,!![]);}catch(_0x2aef2c){return BPromise['reject'](_0x2aef2c);}return _0x511ba0['save']();};}function saveUpdates(_0x145771,_0x36ce04){return function(_0x476854){if(_0x476854){return _0x476854['update'](_0x145771)[_0x495c('0x24')](function(_0x269d4d){return _0x269d4d;});}return null;};}function removeEntity(_0x4cadba,_0x5d3ea3){return function(_0x1b2026){if(_0x1b2026){return _0x1b2026[_0x495c('0x25')]()[_0x495c('0x24')](function(){_0x4cadba[_0x495c('0x1b')](0xcc)[_0x495c('0x1c')]();});}};}function handleEntityNotFound(_0x5b6bf9,_0x2718ab){return function(_0x2d74b4){if(!_0x2d74b4){_0x5b6bf9[_0x495c('0x1a')](0x194);}return _0x2d74b4;};}function handleError(_0x547236,_0x48d2ff){_0x48d2ff=_0x48d2ff||0x1f4;return function(_0x2ec69f){logger[_0x495c('0x26')](_0x2ec69f[_0x495c('0x27')]);if(_0x2ec69f[_0x495c('0x28')]){delete _0x2ec69f['name'];}_0x547236[_0x495c('0x1b')](_0x48d2ff)['send'](_0x2ec69f);};}exports[_0x495c('0x29')]=function(_0x3a535e,_0x29417d){var _0x54e44d={},_0x41ff5a={},_0x5daaab={'count':0x0,'rows':[]};var _0x568e62=_[_0x495c('0x2a')](db['VoiceRecording'][_0x495c('0x2b')],function(_0x509612){return{'name':_0x509612[_0x495c('0x2c')],'type':_0x509612[_0x495c('0x2d')][_0x495c('0x2e')]};});_0x41ff5a[_0x495c('0x2f')]=_[_0x495c('0x30')](_[_0x495c('0x2a')](_0x568e62,_0x495c('0x28')),[_0x495c('0x31')]);_0x41ff5a[_0x495c('0x32')]=_[_0x495c('0x33')](_0x3a535e[_0x495c('0x32')]);_0x41ff5a[_0x495c('0x34')]=_[_0x495c('0x35')](_0x41ff5a[_0x495c('0x2f')],_0x41ff5a[_0x495c('0x32')]);_0x54e44d[_0x495c('0x36')]=_[_0x495c('0x35')](_0x41ff5a[_0x495c('0x2f')],qs['fields'](_0x3a535e[_0x495c('0x32')][_0x495c('0x37')]));_0x54e44d[_0x495c('0x36')]=_0x54e44d[_0x495c('0x36')][_0x495c('0x38')]?_0x54e44d[_0x495c('0x36')]:_0x41ff5a['model'];if(!_0x3a535e[_0x495c('0x32')][_0x495c('0x39')](_0x495c('0x3a'))){_0x54e44d[_0x495c('0x21')]=qs[_0x495c('0x21')](_0x3a535e[_0x495c('0x32')][_0x495c('0x21')]);_0x54e44d[_0x495c('0x1e')]=qs[_0x495c('0x1e')](_0x3a535e['query'][_0x495c('0x1e')]);}_0x54e44d[_0x495c('0x3b')]=qs[_0x495c('0x3c')](_0x3a535e[_0x495c('0x32')]['sort']);_0x54e44d[_0x495c('0x3d')]=qs[_0x495c('0x34')](_[_0x495c('0x3e')](_0x3a535e[_0x495c('0x32')],_0x41ff5a[_0x495c('0x34')]),_0x568e62);if(_0x3a535e[_0x495c('0x32')][_0x495c('0x3f')]){_0x54e44d['where']=_['merge'](_0x54e44d[_0x495c('0x3d')],{'$or':_['map'](_0x568e62,function(_0x1736e2){if(_0x1736e2[_0x495c('0x2d')]!=='VIRTUAL'){var _0x309bc6={};_0x309bc6[_0x1736e2[_0x495c('0x28')]]={'$like':'%'+_0x3a535e[_0x495c('0x32')][_0x495c('0x3f')]+'%'};return _0x309bc6;}})});}_0x54e44d=_['merge']({},_0x54e44d,_0x3a535e[_0x495c('0x40')]);var _0x87d29e={'where':_0x54e44d[_0x495c('0x3d')]};return db[_0x495c('0x41')][_0x495c('0x20')](_0x87d29e)[_0x495c('0x24')](function(_0x178bef){_0x5daaab[_0x495c('0x20')]=_0x178bef;if(_0x3a535e[_0x495c('0x32')][_0x495c('0x42')]){_0x54e44d[_0x495c('0x43')]=[{'all':!![]}];}return db[_0x495c('0x41')]['findAll'](_0x54e44d);})[_0x495c('0x24')](function(_0x55a5f4){_0x5daaab[_0x495c('0x44')]=_0x55a5f4;return _0x5daaab;})[_0x495c('0x24')](respondWithFilteredResult(_0x29417d,_0x54e44d))[_0x495c('0x45')](handleError(_0x29417d,null));};exports[_0x495c('0x46')]=function(_0x10a694,_0x125af8){var _0x2e6725={'raw':![],'where':{'id':_0x10a694['params']['id']}},_0x25ff07={};_0x25ff07[_0x495c('0x2f')]=_['keys'](db[_0x495c('0x41')][_0x495c('0x2b')]);_0x25ff07['query']=_[_0x495c('0x33')](_0x10a694[_0x495c('0x32')]);_0x25ff07['filters']=_[_0x495c('0x35')](_0x25ff07[_0x495c('0x2f')],_0x25ff07['query']);_0x2e6725[_0x495c('0x36')]=_[_0x495c('0x35')](_0x25ff07['model'],qs[_0x495c('0x37')](_0x10a694[_0x495c('0x32')]['fields']));_0x2e6725['attributes']=_0x2e6725[_0x495c('0x36')][_0x495c('0x38')]?_0x2e6725[_0x495c('0x36')]:_0x25ff07[_0x495c('0x2f')];if(_0x10a694['query'][_0x495c('0x42')]){_0x2e6725[_0x495c('0x43')]=[{'all':!![]}];}_0x2e6725=_[_0x495c('0x47')]({},_0x2e6725,_0x10a694[_0x495c('0x40')]);return db[_0x495c('0x41')][_0x495c('0x48')](_0x2e6725)['then'](handleEntityNotFound(_0x125af8,null))[_0x495c('0x24')](respondWithResult(_0x125af8,null))[_0x495c('0x45')](handleError(_0x125af8,null));};exports['create']=function(_0x505580,_0xff6f3b){return db['VoiceRecording'][_0x495c('0x49')](_0x505580[_0x495c('0x4a')],{})[_0x495c('0x24')](respondWithResult(_0xff6f3b,0xc9))[_0x495c('0x45')](handleError(_0xff6f3b,null));};exports['update']=function(_0x1182c7,_0x2f5888){if(_0x1182c7[_0x495c('0x4a')]['id']){delete _0x1182c7[_0x495c('0x4a')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x1182c7[_0x495c('0x4b')]['id']}})[_0x495c('0x24')](handleEntityNotFound(_0x2f5888,null))[_0x495c('0x24')](saveUpdates(_0x1182c7[_0x495c('0x4a')],null))[_0x495c('0x24')](respondWithResult(_0x2f5888,null))[_0x495c('0x45')](handleError(_0x2f5888,null));};exports[_0x495c('0x4c')]=function(_0x472270,_0x54eff9){return db[_0x495c('0x41')][_0x495c('0x4c')]()[_0x495c('0x24')](respondWithResult(_0x54eff9,null))[_0x495c('0x45')](handleError(_0x54eff9,null));};exports['download']=function(_0x3d0a3a,_0x1af688,_0x3965da){var _0x5e4538=require(_0x495c('0x4d'));var _0x552692=![];var _0x5cf12e={};if(_0x3d0a3a['query'][_0x495c('0x2d')]&&_0x3d0a3a['query'][_0x495c('0x2d')]===_0x495c('0x4e')){_0x5cf12e[_0x495c('0x4e')]=_0x3d0a3a[_0x495c('0x4b')]['id'];}else{_0x5cf12e['id']=_0x3d0a3a[_0x495c('0x4b')]['id'];}return db[_0x495c('0x41')]['find']({'where':_0x5cf12e,'attributes':['id',_0x495c('0x4f')],'raw':!![]})[_0x495c('0x24')](handleEntityNotFound(_0x1af688,null))[_0x495c('0x24')](function(_0x421ee2){if(_0x421ee2){var _0x30e035=_0x421ee2[_0x495c('0x4f')];var _0x1059f0=util[_0x495c('0x31')]('%s.cypher',_0x30e035);if(fs[_0x495c('0x50')](_0x1059f0)){_0x552692=!![];return _0x5e4538['decryptFile'](_0x1059f0,_0x30e035,config[_0x495c('0x51')]['recording'])['then'](function(){return _0x421ee2;});}return _0x421ee2;}})['then'](function(_0x5c2017){if(_0x5c2017){var _0x5ec17d=_0x5c2017['value'];if(!fs[_0x495c('0x50')](_0x5ec17d)){throw new db['Sequelize']['ValidationError'](_0x495c('0x52'));}if(_0x5c2017[_0x495c('0x53')]){return _0x1af688[_0x495c('0x54')](_0x5ec17d,_0x5c2017[_0x495c('0x53')]+path[_0x495c('0x55')](_0x5ec17d),function(){if(_0x552692){fs[_0x495c('0x56')](_0x5ec17d);}});}else{return _0x1af688[_0x495c('0x54')](_0x5ec17d,function(_0x31fada){if(_0x552692){fs[_0x495c('0x56')](_0x5ec17d);}});}}})[_0x495c('0x45')](function(_0x3aaee3){if(_0x3aaee3[_0x495c('0x57')]===_0x495c('0x52')){_0x1af688[_0x495c('0x1b')](0x194)[_0x495c('0x58')](_0x495c('0x59'));}else{return handleError(_0x1af688,null);}});};exports[_0x495c('0x5a')]=function(_0x5789bd,_0x38c602,_0x4e238e){var _0x219972=require(_0x495c('0x4d'));var _0x5de5ab=![];var _0xfcfbf2={'$and':[db[_0x495c('0x5b')][_0x495c('0x3d')](db['sequelize']['fn'](_0x495c('0x5c'),db[_0x495c('0x5b')]['col'](_0x495c('0x4e'))),_0x5789bd['query'][_0x495c('0x5d')])]};if(_0x5789bd[_0x495c('0x32')][_0x495c('0x2d')]&&_0x5789bd[_0x495c('0x32')]['type']===_0x495c('0x4e')){_0xfcfbf2[_0x495c('0x5e')][_0x495c('0x5f')]({'uniqueid':_0x5789bd[_0x495c('0x4b')]['id']});}else{_0xfcfbf2[_0x495c('0x5e')][_0x495c('0x5f')]({'id':_0x5789bd[_0x495c('0x4b')]['id']});}return db[_0x495c('0x41')]['find']({'where':_0xfcfbf2,'attributes':['id','value'],'raw':!![]})[_0x495c('0x24')](handleEntityNotFound(_0x38c602,null))[_0x495c('0x24')](function(_0x4bcf19){if(_0x4bcf19){var _0x55d9dd=util['format'](_0x495c('0x60'),_0x4bcf19[_0x495c('0x4f')]);if(fs[_0x495c('0x50')](_0x55d9dd)){_0x5de5ab=!![];return _0x219972[_0x495c('0x61')](_0x55d9dd,_0x4bcf19[_0x495c('0x4f')],config[_0x495c('0x51')][_0x495c('0x62')])[_0x495c('0x24')](function(){return _0x4bcf19;});}return _0x4bcf19;}})[_0x495c('0x24')](function(_0x4f3fbe){if(_0x4f3fbe){if(!fs[_0x495c('0x50')](_0x4f3fbe[_0x495c('0x4f')])){throw new db[(_0x495c('0x63'))][(_0x495c('0x64'))](_0x495c('0x52'));}if(_0x4f3fbe['filename']){return _0x38c602['download'](_0x4f3fbe[_0x495c('0x4f')],_0x4f3fbe[_0x495c('0x53')]+path['extname'](_0x4f3fbe['value']),function(){if(_0x5de5ab){fs[_0x495c('0x56')](_0x4f3fbe[_0x495c('0x4f')]);}});}else{return _0x38c602[_0x495c('0x54')](_0x4f3fbe[_0x495c('0x4f')],function(_0x5d61f1){if(_0x5de5ab){fs[_0x495c('0x56')](_0x4f3fbe[_0x495c('0x4f')]);}});}}})[_0x495c('0x45')](handleError(_0x38c602,null));};exports['destroy']=function(_0x2ecefa,_0x4fb349){return db[_0x495c('0x41')][_0x495c('0x48')]({'where':{'id':_0x2ecefa['params']['id']}})[_0x495c('0x24')](function(_0x2a0602){if(_['isNil'](_0x2a0602)){throw new ReferenceError(_0x495c('0x65'));}return _0x2a0602;})['then'](function(_0x5136ec){var _0x5db645=_0x5136ec[_0x495c('0x4f')];logger[_0x495c('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0x5db645);if(!_[_0x495c('0x67')](_0x5136ec['value'])&&fs[_0x495c('0x50')](_0x5db645)){logger['info'](_0x495c('0x68')+_0x5db645+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x495c('0x69')](_0x5db645);}_0x5db645=_0x5db645+_0x495c('0x6a');if(!_['isNil'](_0x5136ec[_0x495c('0x4f')])&&fs['existsSync'](_0x5db645)){logger[_0x495c('0x66')]('File:\x20\x22'+_0x5db645+_0x495c('0x6b'));fs['unlinkSync'](_0x5db645);}return _0x5136ec;})[_0x495c('0x24')](function(_0x4f79ae){if(!_0x4f79ae)throw new InternalError();return _0x4f79ae[_0x495c('0x25')]();})[_0x495c('0x24')](function(){_0x4fb349[_0x495c('0x1b')](0xcc)['end']();})[_0x495c('0x45')](handleError(_0x4fb349,null));};function getBucketslist(_0x3a80d2,_0x5993ba,_0x4c4b2b){return new Promise(function(_0x3a1660,_0x3f3243){var _0x21e0a7=new AWS['S3']({'accessKeyId':_0x5993ba,'secretAccessKey':_0x3a80d2,'region':_0x4c4b2b});_0x21e0a7[_0x495c('0x6c')]({},function(_0x283893,_0x39077e){if(_0x283893){return _0x3f3243(_0x283893);}else{return _0x3a1660(_0x39077e);}});});}function createBucket(_0x2f78f6,_0x3a7ec6,_0x16d378,_0x5def49){return new Promise(function(_0xcf044b,_0x25d2dc){var _0x41b677=new AWS['S3']({'accessKeyId':_0x3a7ec6,'secretAccessKey':_0x2f78f6,'region':_0x16d378});_0x41b677[_0x495c('0x6d')]({'Bucket':_0x5def49},function(_0x2136f3,_0x5eb655){if(_0x2136f3){return _0x25d2dc(_0x2136f3);}else{return _0xcf044b(_0x5eb655);}});});}function uploadFile(_0x25bb1a,_0x10e95e,_0x17370c,_0x43e400,_0x542daa,_0x55fd46){return new Promise(function(_0x5c9830,_0x5bcfa8){var _0x3386ee=new AWS['S3']({'accessKeyId':_0x10e95e,'secretAccessKey':_0x25bb1a,'region':_0x17370c});_0x3386ee[_0x495c('0x6e')]({'Bucket':_0x43e400,'Key':_0x542daa,'Body':_0x55fd46},function(_0x666c6b,_0x34161c){if(_0x666c6b){return _0x5bcfa8(_0x666c6b);}else{return _0x5c9830(_0x34161c);}});});}function startTranscribe(_0x4e1d29,_0x194d1f,_0x208221,_0x56c956,_0x1941e5,_0x4e0921){return new Promise(function(_0x1c3b76,_0x12c7c8){var _0x11c24e=new AWS[(_0x495c('0x6f'))]({'accessKeyId':_0x194d1f,'secretAccessKey':_0x4e1d29,'region':_0x208221});_0x11c24e[_0x495c('0x70')]({'TranscriptionJobName':_0x56c956,'LanguageCode':_0x1941e5,'Media':{'MediaFileUri':_0x4e0921}},function(_0x58cfdc,_0x53bbd7){if(_0x58cfdc){return _0x12c7c8(_0x58cfdc);}else{return _0x1c3b76(_0x53bbd7);}});});}function transcribe(_0x4b8146,_0x5c4ca3,_0x18c50d,_0x51b010,_0x5975b5,_0x4dc48a,_0x50c70c){return new Promise(function(_0x24bedf,_0x2711f){var _0x2964ae={};logger['info'](util[_0x495c('0x31')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x4b8146,_0x5975b5));return uploadFile(_0x5c4ca3,_0x18c50d,_0x51b010,_0x5975b5,path[_0x495c('0x71')](_0x4dc48a),fs['readFileSync'](_0x4dc48a))[_0x495c('0x24')](function(_0x438982){logger[_0x495c('0x66')](util['format'](_0x495c('0x72'),_0x4b8146,_0x5975b5,_0x438982[_0x495c('0x73')]));_0x2964ae[_0x495c('0x74')]=_0x438982[_0x495c('0x75')];_0x2964ae[_0x495c('0x76')]=_0x438982['Location'];logger[_0x495c('0x66')](util[_0x495c('0x31')](_0x495c('0x77'),_0x4b8146));return startTranscribe(_0x5c4ca3,_0x18c50d,_0x51b010,uuidv4(),_0x50c70c,_0x438982[_0x495c('0x73')]);})[_0x495c('0x24')](function(_0x2da75e){logger[_0x495c('0x66')](util[_0x495c('0x31')](_0x495c('0x78'),_0x4b8146,_0x2da75e[_0x495c('0x79')][_0x495c('0x7a')]));_0x2964ae[_0x495c('0x7b')]=_0x2da75e[_0x495c('0x79')][_0x495c('0x7a')];_0x2964ae[_0x495c('0x7c')]=_0x2da75e[_0x495c('0x79')][_0x495c('0x7d')];return _0x24bedf(_0x2964ae);})[_0x495c('0x45')](function(_0xd86465){return _0x2711f(_0xd86465);});});}exports[_0x495c('0x7e')]=function(_0x4feddf,_0x2e2cf3,_0x945bf7){var _0x1a70f7;var _0x5b0e6a;var _0x224cb4;var _0x233d9c=require('../../components/encryptor');return db[_0x495c('0x41')]['findOne']({'where':{'id':_0x4feddf['params']['id']}})[_0x495c('0x24')](function(_0x43cea1){if(_0x43cea1){var _0x4a2bc1=util[_0x495c('0x31')](_0x495c('0x60'),_0x43cea1['value']);if(fs[_0x495c('0x50')](_0x4a2bc1)){cypher=!![];return _0x233d9c[_0x495c('0x61')](_0x4a2bc1,_0x43cea1[_0x495c('0x4f')],config[_0x495c('0x51')]['recording'])['then'](function(){return _0x43cea1;});}return _0x43cea1;}})['then'](function(_0x144bff){if(!_0x144bff){throw new db[(_0x495c('0x63'))][(_0x495c('0x64'))]('Voice\x20Recording\x20not\x20found');}_0x5b0e6a=_0x144bff;return db[_0x495c('0x7f')][_0x495c('0x80')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x2e2cf3,null))[_0x495c('0x24')](function(_0x1e7f91){if(_0x1e7f91){_0x1a70f7=_0x1e7f91;if(!_0x1a70f7['transcribe']||!_0x1a70f7['transcribeAccountId']||!_0x1a70f7[_0x495c('0x81')]||!_0x1a70f7[_0x495c('0x82')]||!_0x1a70f7[_0x495c('0x74')]){throw new db[(_0x495c('0x63'))][(_0x495c('0x64'))](_0x495c('0x83'));}if(_0x4feddf['body'][_0x495c('0x84')]&&(!_0x1a70f7['sentiment']||!_0x1a70f7[_0x495c('0x85')]||!_0x1a70f7[_0x495c('0x86')]||!_0x1a70f7[_0x495c('0x82')]||!_0x1a70f7[_0x495c('0x74')])){throw new db[(_0x495c('0x63'))][(_0x495c('0x64'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x495c('0x87')][_0x495c('0x80')]({'where':{'id':_0x1a70f7['transcribeAccountId']}});}})['then'](function(_0x34e2cb){if(!_0x34e2cb){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x34e2cb['data1']||!_0x34e2cb[_0x495c('0x88')]){throw new db[(_0x495c('0x63'))][(_0x495c('0x64'))](_0x495c('0x89'));}_0x224cb4=_0x34e2cb;return getBucketslist(_0x224cb4['data1'],_0x224cb4['data2'],_0x1a70f7['transcribeRegion']);})['then'](function(_0xe4d080){if(_0xe4d080&&_0xe4d080['Buckets']){var _0x4a97b0=_[_0x495c('0x48')](_0xe4d080['Buckets'],function(_0x1a9de4){return _0x1a9de4[_0x495c('0x8a')]===_0x1a70f7[_0x495c('0x74')];});if(!_0x4a97b0){logger[_0x495c('0x66')](util[_0x495c('0x31')](_0x495c('0x8b'),_0x4feddf[_0x495c('0x4b')]['id'],_0x1a70f7[_0x495c('0x74')]));return createBucket(_0x224cb4[_0x495c('0x8c')],_0x224cb4['data2'],_0x1a70f7[_0x495c('0x81')],_0x1a70f7['bucket']);}logger[_0x495c('0x66')](util[_0x495c('0x31')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x4feddf['params']['id'],_0x1a70f7['bucket']));return;}})[_0x495c('0x24')](function(_0x595d88){if(_0x5b0e6a[_0x495c('0x7c')]===_0x495c('0x8d')){return transcribe(_0x4feddf[_0x495c('0x4b')]['id'],_0x224cb4['data1'],_0x224cb4[_0x495c('0x88')],_0x1a70f7['transcribeRegion'],_0x1a70f7[_0x495c('0x74')],_0x5b0e6a['value'],_0x1a70f7[_0x495c('0x82')]);}else{logger['info'](util[_0x495c('0x31')](_0x495c('0x8e'),_0x4feddf['params']['id']));return{'transcribeStatus':_0x495c('0x8f')};}})['then'](function(_0x2fd2fc){if(_0x2fd2fc){_0x2fd2fc[_0x495c('0x90')]=_0x4feddf[_0x495c('0x4a')][_0x495c('0x84')];return _0x5b0e6a['updateAttributes'](_0x2fd2fc);}})['then'](respondWithResult(_0x2e2cf3,null))[_0x495c('0x45')](handleError(_0x2e2cf3,null));};function writeFile(_0x303630,_0x1cc024){return new Promise(function(_0x657fc7,_0x2366a1){fs['writeFile'](_0x1cc024,_0x303630,function(_0x5793d2,_0x5c4998){if(_0x5793d2){return _0x2366a1(_0x5793d2);}else{return _0x657fc7(_0x5c4998);}});});}exports['downloadTranscribe']=function(_0x236672,_0x478670,_0x188562){return db[_0x495c('0x41')][_0x495c('0x80')]({'where':{'id':_0x236672['params']['id']}})[_0x495c('0x24')](handleEntityNotFound(_0x478670))['then'](function(_0x677049){if(_0x677049&&_0x677049[_0x495c('0x91')]){var _0x562a79=_0x677049[_0x495c('0x91')];var _0x22dc18=config[_0x495c('0x92')]+_0x495c('0x93')+_0x677049['id']+'.txt';if(fs['existsSync'](_0x22dc18)){return _0x22dc18;}return writeFile(_0x562a79,_0x22dc18)[_0x495c('0x24')](function(){return _0x22dc18;});}else{throw new db[(_0x495c('0x63'))][(_0x495c('0x64'))](_0x495c('0x94'));}})[_0x495c('0x24')](function(_0x5bec4f){return _0x478670[_0x495c('0x54')](_0x5bec4f);})[_0x495c('0x45')](handleError(_0x478670));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 675ecd0..7d0f29e 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 _0x004d=['request-promise','rimraf','../../config/environment','./voiceRecording.attributes','define','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x004d,0xc1));var _0xd004=function(_0xa95cb0,_0xb20ec4){_0xa95cb0=_0xa95cb0-0x0;var _0x39d4d6=_0x004d[_0xa95cb0];return _0x39d4d6;};'use strict';var _=require(_0xd004('0x0'));var util=require('util');var logger=require(_0xd004('0x1'))(_0xd004('0x2'));var moment=require(_0xd004('0x3'));var BPromise=require(_0xd004('0x4'));var rp=require(_0xd004('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd004('0x6'));var config=require(_0xd004('0x7'));var attributes=require(_0xd004('0x8'));module['exports']=function(_0x118460,_0x4354dc){return _0x118460[_0xd004('0x9')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xd004('0xa'),'fields':[_0xd004('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb1b4=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceRecording','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x4a04de,_0x2e342c){var _0xbbe018=function(_0x39639c){while(--_0x39639c){_0x4a04de['push'](_0x4a04de['shift']());}};_0xbbe018(++_0x2e342c);}(_0xb1b4,0x175));var _0x4b1b=function(_0x33f6a9,_0x5e195c){_0x33f6a9=_0x33f6a9-0x0;var _0x36df01=_0xb1b4[_0x33f6a9];return _0x36df01;};'use strict';var _=require(_0x4b1b('0x0'));var util=require(_0x4b1b('0x1'));var logger=require(_0x4b1b('0x2'))('api');var moment=require(_0x4b1b('0x3'));var BPromise=require(_0x4b1b('0x4'));var rp=require(_0x4b1b('0x5'));var fs=require('fs');var path=require(_0x4b1b('0x6'));var rimraf=require(_0x4b1b('0x7'));var config=require(_0x4b1b('0x8'));var attributes=require('./voiceRecording.attributes');module[_0x4b1b('0x9')]=function(_0x1c61de,_0x41fec8){return _0x1c61de[_0x4b1b('0xa')](_0x4b1b('0xb'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x4b1b('0xc'),'fields':[_0x4b1b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 4a4b2cf..de3ff61 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 _0x0424=['stringify','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','limit','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s'];(function(_0x3fcfb6,_0x515024){var _0x3b99a7=function(_0x10ddfd){while(--_0x10ddfd){_0x3fcfb6['push'](_0x3fcfb6['shift']());}};_0x3b99a7(++_0x515024);}(_0x0424,0x159));var _0x4042=function(_0x38576d,_0x527dc7){_0x38576d=_0x38576d-0x0;var _0x32534a=_0x0424[_0x38576d];return _0x32534a;};'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')]('VoiceRecording,\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')]['update'](_0x466077[_0x4042('0x17')],{'raw':_0x466077[_0x4042('0x18')]?_0x466077[_0x4042('0x18')][_0x4042('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x466077['options']?_0x466077[_0x4042('0x18')][_0x4042('0x1a')]||null:null,'attributes':_0x466077[_0x4042('0x18')]?_0x466077[_0x4042('0x18')]['attributes']||null:null,'limit':_0x466077[_0x4042('0x18')]?_0x466077[_0x4042('0x18')][_0x4042('0x1b')]||null:null})[_0x4042('0xa')](function(_0x352631){logger['info'](_0x4042('0x15'),_0x466077);logger[_0x4042('0xd')]('UpdateVoiceRecording',_0x466077,JSON[_0x4042('0xf')](_0x352631));_0xe5c1ec(_0x352631);})['catch'](function(_0x271b82){logger[_0x4042('0x10')](_0x4042('0x15'),_0x271b82['message'],_0x466077);_0x4fe024(_0x4b02d4[_0x4042('0x10')](0x1f4,_0x271b82[_0x4042('0x11')]));});});};exports[_0x4042('0x1c')]=function(_0xbdadc8){var _0x1c4d9f=this;return new Promise(function(_0x52e575,_0x58c409){var _0x1d8d48=require(_0x4042('0x1d'));var _0x26542c;return db[_0x4042('0x1e')][_0x4042('0x1f')]({'attributes':['id',_0x4042('0x20')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x33733b){_0x26542c=_0x33733b;return db[_0x4042('0x16')]['create'](_0xbdadc8[_0x4042('0x17')]);})[_0x4042('0xa')](function(_0xe924fe){if(_0x26542c['callRecordingEncryption']&&fs['existsSync'](_0xe924fe[_0x4042('0x21')])){var _0x43bd1c=util['format'](_0x4042('0x22'),_0xe924fe[_0x4042('0x21')]);return _0x1d8d48[_0x4042('0x23')](_0xe924fe[_0x4042('0x21')],_0x43bd1c,config[_0x4042('0x24')][_0x4042('0x25')])[_0x4042('0xa')](function(){fs[_0x4042('0x26')](_0xe924fe[_0x4042('0x21')]);logger['info'](_0x4042('0x27'));return _0xe924fe;});}return _0xe924fe;})[_0x4042('0xa')](function(_0x5320f8){logger[_0x4042('0x12')](_0x4042('0x1c'),_0xbdadc8);logger['debug'](_0x4042('0x1c'),_0xbdadc8,JSON[_0x4042('0xf')](_0x5320f8));_0x52e575(_0x5320f8);})[_0x4042('0x14')](function(_0xaa7c99){logger[_0x4042('0x10')](_0x4042('0x1c'),_0xaa7c99[_0x4042('0x11')],_0xbdadc8);_0x58c409(_0x1c4d9f[_0x4042('0x10')](0x1f4,_0xaa7c99[_0x4042('0x11')]));});});}; \ No newline at end of file +var _0xb44a=['client','http','request','then','VoiceRecording,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','../../components/encryptor','Setting','findOne','create','callRecordingEncryption','existsSync','value','%s.cypher','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x50e40b,_0x338d17){var _0x2608b7=function(_0x4ded5e){while(--_0x4ded5e){_0x50e40b['push'](_0x50e40b['shift']());}};_0x2608b7(++_0x338d17);}(_0xb44a,0x1c2));var _0xab44=function(_0x5cbb32,_0x233ace){_0x5cbb32=_0x5cbb32-0x0;var _0x49363c=_0xb44a[_0x5cbb32];return _0x49363c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab44('0x0'));var BPromise=require('bluebird');var rs=require(_0xab44('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab44('0x2'));var logger=require('../../config/logger')(_0xab44('0x3'));var config=require(_0xab44('0x4'));var jayson=require(_0xab44('0x5'));var client=jayson[_0xab44('0x6')][_0xab44('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3303b1,_0x3ead8d,_0x495825){return new BPromise(function(_0x137a8c,_0x133a6d){return client[_0xab44('0x8')](_0x3303b1,_0x495825)[_0xab44('0x9')](function(_0xa14367){logger['info'](_0xab44('0xa'),_0x3ead8d,'request\x20sent');logger[_0xab44('0xb')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x3ead8d,'request\x20sent',JSON[_0xab44('0xc')](_0xa14367));if(_0xa14367[_0xab44('0xd')]){if(_0xa14367[_0xab44('0xd')][_0xab44('0xe')]===0x1f4){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0xa14367['error']['message']);return _0x133a6d(_0xa14367[_0xab44('0xd')]['message']);}logger[_0xab44('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x3ead8d,_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);return _0x137a8c(_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);}else{logger[_0xab44('0x10')](_0xab44('0xa'),_0x3ead8d,'request\x20sent');_0x137a8c(_0xa14367['result'][_0xab44('0xf')]);}})[_0xab44('0x11')](function(_0x14fe36){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0x14fe36);_0x133a6d(_0x14fe36);});});}exports[_0xab44('0x12')]=function(_0x354b09){var _0x44fa43=this;return new Promise(function(_0x310b15,_0xc4b3dc){return db[_0xab44('0x13')]['update'](_0x354b09[_0xab44('0x14')],{'raw':_0x354b09[_0xab44('0x15')]?_0x354b09[_0xab44('0x15')][_0xab44('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x354b09[_0xab44('0x15')]?_0x354b09['options'][_0xab44('0x17')]||null:null,'attributes':_0x354b09['options']?_0x354b09[_0xab44('0x15')][_0xab44('0x18')]||null:null,'limit':_0x354b09[_0xab44('0x15')]?_0x354b09[_0xab44('0x15')]['limit']||null:null})[_0xab44('0x9')](function(_0x26fc03){logger[_0xab44('0x10')](_0xab44('0x12'),_0x354b09);logger[_0xab44('0xb')](_0xab44('0x12'),_0x354b09,JSON[_0xab44('0xc')](_0x26fc03));_0x310b15(_0x26fc03);})['catch'](function(_0x595761){logger[_0xab44('0xd')]('UpdateVoiceRecording',_0x595761[_0xab44('0xf')],_0x354b09);_0xc4b3dc(_0x44fa43['error'](0x1f4,_0x595761[_0xab44('0xf')]));});});};exports['CreateVoiceRecording']=function(_0x531583){var _0x8e60fa=this;return new Promise(function(_0x25287b,_0x259192){var _0x4620ed=require(_0xab44('0x19'));var _0x4e820c;return db[_0xab44('0x1a')][_0xab44('0x1b')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xab44('0x9')](function(_0xebb7d1){_0x4e820c=_0xebb7d1;return db[_0xab44('0x13')][_0xab44('0x1c')](_0x531583[_0xab44('0x14')]);})[_0xab44('0x9')](function(_0x59f844){if(_0x4e820c[_0xab44('0x1d')]&&fs[_0xab44('0x1e')](_0x59f844[_0xab44('0x1f')])){var _0x47e1be=util['format'](_0xab44('0x20'),_0x59f844['value']);return _0x4620ed['encryptFile'](_0x59f844[_0xab44('0x1f')],_0x47e1be,config[_0xab44('0x21')][_0xab44('0x22')])[_0xab44('0x9')](function(){fs[_0xab44('0x23')](_0x59f844[_0xab44('0x1f')]);logger[_0xab44('0x10')](_0xab44('0x24'));return _0x59f844;});}return _0x59f844;})[_0xab44('0x9')](function(_0x1e8e9d){logger[_0xab44('0x10')](_0xab44('0x25'),_0x531583);logger[_0xab44('0xb')](_0xab44('0x25'),_0x531583,JSON['stringify'](_0x1e8e9d));_0x25287b(_0x1e8e9d);})['catch'](function(_0x27e318){logger[_0xab44('0xd')]('CreateVoiceRecording',_0x27e318[_0xab44('0xf')],_0x531583);_0x259192(_0x8e60fa[_0xab44('0xd')](0x1f4,_0x27e318[_0xab44('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 6a53bee..d275206 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 _0x4a10=['Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x1d26f8,_0x40fcc4){var _0x3064ea=function(_0x381d88){while(--_0x381d88){_0x1d26f8['push'](_0x1d26f8['shift']());}};_0x3064ea(++_0x40fcc4);}(_0x4a10,0x178));var _0x04a1=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4a10[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x04a1('0x0'));var util=require('util');var path=require(_0x04a1('0x1'));var timeout=require(_0x04a1('0x2'));var express=require(_0x04a1('0x3'));var router=express[_0x04a1('0x4')]();var fs_extra=require(_0x04a1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x04a1('0x6'));var config=require(_0x04a1('0x7'));var controller=require(_0x04a1('0x8'));router[_0x04a1('0x9')]('/',auth['isAuthenticated'](),controller[_0x04a1('0xa')]);router[_0x04a1('0x9')](_0x04a1('0xb'),auth['isAuthenticated'](),controller[_0x04a1('0xc')]);router['get'](_0x04a1('0xd'),auth[_0x04a1('0xe')](),controller[_0x04a1('0xf')]);router['post']('/',auth[_0x04a1('0xe')](),controller['create']);router['put'](_0x04a1('0xd'),auth['isAuthenticated'](),controller[_0x04a1('0x10')]);router[_0x04a1('0x11')](_0x04a1('0xd'),auth['isAuthenticated'](),controller[_0x04a1('0x12')]);module[_0x04a1('0x13')]=router; \ No newline at end of file +var _0x8b38=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy'];(function(_0x2b4d26,_0x279b45){var _0x1b5a40=function(_0x42837d){while(--_0x42837d){_0x2b4d26['push'](_0x2b4d26['shift']());}};_0x1b5a40(++_0x279b45);}(_0x8b38,0xbd));var _0x88b3=function(_0xf28958,_0x53f0ed){_0xf28958=_0xf28958-0x0;var _0x4a4ce4=_0x8b38[_0xf28958];return _0x4a4ce4;};'use strict';var multer=require(_0x88b3('0x0'));var util=require(_0x88b3('0x1'));var path=require(_0x88b3('0x2'));var timeout=require(_0x88b3('0x3'));var express=require(_0x88b3('0x4'));var router=express[_0x88b3('0x5')]();var fs_extra=require(_0x88b3('0x6'));var auth=require(_0x88b3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x88b3('0x8'));var controller=require('./voiceTransferReport.controller');router[_0x88b3('0x9')]('/',auth['isAuthenticated'](),controller[_0x88b3('0xa')]);router[_0x88b3('0x9')](_0x88b3('0xb'),auth[_0x88b3('0xc')](),controller[_0x88b3('0xd')]);router[_0x88b3('0x9')](_0x88b3('0xe'),auth['isAuthenticated'](),controller[_0x88b3('0xf')]);router[_0x88b3('0x10')]('/',auth[_0x88b3('0xc')](),controller[_0x88b3('0x11')]);router[_0x88b3('0x12')](_0x88b3('0xe'),auth[_0x88b3('0xc')](),controller['update']);router[_0x88b3('0x13')](_0x88b3('0xe'),auth['isAuthenticated'](),controller[_0x88b3('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 1a32aee..e039c83 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 _0x005e=['moment','exports','ENUM','attended','STRING','Yes','sequelize'];(function(_0x54cf6e,_0x4a3e33){var _0x256a34=function(_0x883879){while(--_0x883879){_0x54cf6e['push'](_0x54cf6e['shift']());}};_0x256a34(++_0x4a3e33);}(_0x005e,0x148));var _0xe005=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x005e[_0x3511d3];return _0x5d6321;};'use strict';var Sequelize=require(_0xe005('0x0'));var moment=require(_0xe005('0x1'));module[_0xe005('0x2')]={'type':{'type':Sequelize[_0xe005('0x3')]('blind',_0xe005('0x4'))},'result':{'type':Sequelize[_0xe005('0x5')]},'transfererchannel':{'type':Sequelize[_0xe005('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xe005('0x5')]},'transferercalleridname':{'type':Sequelize[_0xe005('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xe005('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xe005('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xe005('0x5')]},'transferercontext':{'type':Sequelize[_0xe005('0x5')]},'transfererexten':{'type':Sequelize[_0xe005('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xe005('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xe005('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xe005('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xe005('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xe005('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xe005('0x5')]},'transfereeexten':{'type':Sequelize[_0xe005('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xe005('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0xe005('0x6'),'No')},'context':{'type':Sequelize[_0xe005('0x5')]},'extension':{'type':Sequelize[_0xe005('0x5')]}}; \ No newline at end of file +var _0x4008=['STRING','Yes','sequelize','ENUM','attended'];(function(_0x3d518e,_0x33de21){var _0x1b946e=function(_0x420894){while(--_0x420894){_0x3d518e['push'](_0x3d518e['shift']());}};_0x1b946e(++_0x33de21);}(_0x4008,0x1e2));var _0x8400=function(_0x145f03,_0x3f2a46){_0x145f03=_0x145f03-0x0;var _0x460486=_0x4008[_0x145f03];return _0x460486;};'use strict';var Sequelize=require(_0x8400('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x8400('0x1')]('blind',_0x8400('0x2'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x8400('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x8400('0x3')]},'transferercalleridname':{'type':Sequelize[_0x8400('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x8400('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x8400('0x3')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x8400('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x8400('0x3')]},'transfereechannel':{'type':Sequelize[_0x8400('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x8400('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x8400('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x8400('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x8400('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x8400('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x8400('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x8400('0x3')]},'isexternal':{'type':Sequelize[_0x8400('0x1')](_0x8400('0x4'),'No')},'context':{'type':Sequelize[_0x8400('0x3')]},'extension':{'type':Sequelize[_0x8400('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index ca18117..0f8e7ba 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 _0x1160=['fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','rows','show','keys','include','options','find','catch','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes'];(function(_0x1b1436,_0xa24c4b){var _0x1eb98c=function(_0x28a5e0){while(--_0x28a5e0){_0x1b1436['push'](_0x1b1436['shift']());}};_0x1eb98c(++_0xa24c4b);}(_0x1160,0x65));var _0x0116=function(_0x3c487b,_0x44c5e2){_0x3c487b=_0x3c487b-0x0;var _0x1d65f6=_0x1160[_0x3c487b];return _0x1d65f6;};'use strict';var emlformat=require(_0x0116('0x0'));var rimraf=require(_0x0116('0x1'));var zipdir=require(_0x0116('0x2'));var jsonpatch=require(_0x0116('0x3'));var rp=require('request-promise');var moment=require(_0x0116('0x4'));var BPromise=require(_0x0116('0x5'));var Mustache=require(_0x0116('0x6'));var util=require(_0x0116('0x7'));var path=require('path');var sox=require(_0x0116('0x8'));var csv=require('to-csv');var ejs=require(_0x0116('0x9'));var fs=require('fs');var fs_extra=require(_0x0116('0xa'));var _=require(_0x0116('0xb'));var squel=require(_0x0116('0xc'));var crypto=require('crypto');var jsforce=require(_0x0116('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0116('0xe'));var Papa=require(_0x0116('0xf'));var Redis=require(_0x0116('0x10'));var authService=require(_0x0116('0x11'));var qs=require(_0x0116('0x12'));var as=require(_0x0116('0x13'));var hardwareService=require(_0x0116('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0116('0x15'));var licenseUtil=require(_0x0116('0x16'));var db=require(_0x0116('0x17'))['db'];function respondWithStatusCode(_0x2b6fa0,_0x1da299){_0x1da299=_0x1da299||0xcc;return function(_0xb911ae){if(_0xb911ae){return _0x2b6fa0[_0x0116('0x18')](_0x1da299);}return _0x2b6fa0['status'](_0x1da299)[_0x0116('0x19')]();};}function respondWithResult(_0x3ee043,_0x43715e){_0x43715e=_0x43715e||0xc8;return function(_0x3506f0){if(_0x3506f0){return _0x3ee043['status'](_0x43715e)[_0x0116('0x1a')](_0x3506f0);}};}function respondWithFilteredResult(_0x5b1f15,_0x39449d){return function(_0x494a59){if(_0x494a59){var _0x3ae7f1=typeof _0x39449d[_0x0116('0x1b')]===_0x0116('0x1c')&&typeof _0x39449d[_0x0116('0x1d')]===_0x0116('0x1c');var _0x41b9c0=_0x494a59[_0x0116('0x1e')];var _0x50c0e6=_0x3ae7f1?0x0:_0x39449d[_0x0116('0x1b')];var _0xc7dc12=_0x3ae7f1?_0x494a59[_0x0116('0x1e')]:_0x39449d[_0x0116('0x1b')]+_0x39449d['limit'];var _0x142b71;if(_0xc7dc12>=_0x41b9c0){_0xc7dc12=_0x41b9c0;_0x142b71=0xc8;}else{_0x142b71=0xce;}_0x5b1f15[_0x0116('0x1f')](_0x142b71);return _0x5b1f15[_0x0116('0x20')](_0x0116('0x21'),_0x50c0e6+'-'+_0xc7dc12+'/'+_0x41b9c0)[_0x0116('0x1a')](_0x494a59);}return null;};}function patchUpdates(_0x55293c){return function(_0x6aec87){try{jsonpatch[_0x0116('0x22')](_0x6aec87,_0x55293c,!![]);}catch(_0x3d369e){return BPromise[_0x0116('0x23')](_0x3d369e);}return _0x6aec87[_0x0116('0x24')]();};}function saveUpdates(_0x31c104,_0x6d74ed){return function(_0x190d8e){if(_0x190d8e){return _0x190d8e['update'](_0x31c104)[_0x0116('0x25')](function(_0x18d611){return _0x18d611;});}return null;};}function removeEntity(_0x1fb911,_0x29c4fd){return function(_0x155adc){if(_0x155adc){return _0x155adc[_0x0116('0x26')]()[_0x0116('0x25')](function(){_0x1fb911[_0x0116('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x269e3d,_0xf28fd){return function(_0x7c118f){if(!_0x7c118f){_0x269e3d[_0x0116('0x18')](0x194);}return _0x7c118f;};}function handleError(_0x2b87e6,_0x4d92cf){_0x4d92cf=_0x4d92cf||0x1f4;return function(_0x1cb1a4){logger['error'](_0x1cb1a4[_0x0116('0x27')]);if(_0x1cb1a4[_0x0116('0x28')]){delete _0x1cb1a4['name'];}_0x2b87e6[_0x0116('0x1f')](_0x4d92cf)[_0x0116('0x29')](_0x1cb1a4);};}exports[_0x0116('0x2a')]=function(_0x33215e,_0x248dd8){var _0x263c3f={},_0x1afc8a={},_0x396414={'count':0x0,'rows':[]};var _0x1e26f4=_[_0x0116('0x2b')](db[_0x0116('0x2c')][_0x0116('0x2d')],function(_0x2b6a93){return{'name':_0x2b6a93[_0x0116('0x2e')],'type':_0x2b6a93[_0x0116('0x2f')][_0x0116('0x30')]};});_0x1afc8a[_0x0116('0x31')]=_[_0x0116('0x2b')](_0x1e26f4,'name');_0x1afc8a[_0x0116('0x32')]=_['keys'](_0x33215e['query']);_0x1afc8a['filters']=_[_0x0116('0x33')](_0x1afc8a[_0x0116('0x31')],_0x1afc8a['query']);_0x263c3f[_0x0116('0x34')]=_['intersection'](_0x1afc8a['model'],qs['fields'](_0x33215e[_0x0116('0x32')][_0x0116('0x35')]));_0x263c3f[_0x0116('0x34')]=_0x263c3f[_0x0116('0x34')][_0x0116('0x36')]?_0x263c3f[_0x0116('0x34')]:_0x1afc8a[_0x0116('0x31')];if(!_0x33215e[_0x0116('0x32')][_0x0116('0x37')](_0x0116('0x38'))){_0x263c3f[_0x0116('0x1d')]=qs[_0x0116('0x1d')](_0x33215e[_0x0116('0x32')][_0x0116('0x1d')]);_0x263c3f['offset']=qs[_0x0116('0x1b')](_0x33215e['query']['offset']);}_0x263c3f[_0x0116('0x39')]=qs[_0x0116('0x3a')](_0x33215e[_0x0116('0x32')]['sort']);_0x263c3f['where']=qs[_0x0116('0x3b')](_[_0x0116('0x3c')](_0x33215e[_0x0116('0x32')],_0x1afc8a['filters']),_0x1e26f4);if(_0x33215e['query'][_0x0116('0x3d')]){_0x263c3f[_0x0116('0x3e')]=_[_0x0116('0x3f')](_0x263c3f[_0x0116('0x3e')],{'$or':_[_0x0116('0x2b')](_0x1e26f4,function(_0xbcdf1d){if(_0xbcdf1d[_0x0116('0x2f')]!==_0x0116('0x40')){var _0x3cdc90={};_0x3cdc90[_0xbcdf1d[_0x0116('0x28')]]={'$like':'%'+_0x33215e[_0x0116('0x32')][_0x0116('0x3d')]+'%'};return _0x3cdc90;}})});}_0x263c3f=_[_0x0116('0x3f')]({},_0x263c3f,_0x33215e['options']);var _0xba6351={'where':_0x263c3f[_0x0116('0x3e')]};return db['VoiceTransferReport']['count'](_0xba6351)[_0x0116('0x25')](function(_0x13822d){_0x396414[_0x0116('0x1e')]=_0x13822d;if(_0x33215e[_0x0116('0x32')][_0x0116('0x41')]){_0x263c3f['include']=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x263c3f);})[_0x0116('0x25')](function(_0x1449f4){_0x396414[_0x0116('0x42')]=_0x1449f4;return _0x396414;})['then'](respondWithFilteredResult(_0x248dd8,_0x263c3f))['catch'](handleError(_0x248dd8,null));};exports[_0x0116('0x43')]=function(_0x15a1fb,_0x1183d1){var _0x2f7570={'raw':!![],'where':{'id':_0x15a1fb['params']['id']}},_0x2d9055={};_0x2d9055['model']=_[_0x0116('0x44')](db['VoiceTransferReport']['rawAttributes']);_0x2d9055[_0x0116('0x32')]=_[_0x0116('0x44')](_0x15a1fb[_0x0116('0x32')]);_0x2d9055[_0x0116('0x3b')]=_[_0x0116('0x33')](_0x2d9055[_0x0116('0x31')],_0x2d9055[_0x0116('0x32')]);_0x2f7570[_0x0116('0x34')]=_['intersection'](_0x2d9055[_0x0116('0x31')],qs[_0x0116('0x35')](_0x15a1fb[_0x0116('0x32')][_0x0116('0x35')]));_0x2f7570[_0x0116('0x34')]=_0x2f7570[_0x0116('0x34')]['length']?_0x2f7570[_0x0116('0x34')]:_0x2d9055[_0x0116('0x31')];if(_0x15a1fb['query'][_0x0116('0x41')]){_0x2f7570[_0x0116('0x45')]=[{'all':!![]}];}_0x2f7570=_[_0x0116('0x3f')]({},_0x2f7570,_0x15a1fb[_0x0116('0x46')]);return db[_0x0116('0x2c')][_0x0116('0x47')](_0x2f7570)[_0x0116('0x25')](handleEntityNotFound(_0x1183d1,null))[_0x0116('0x25')](respondWithResult(_0x1183d1,null))[_0x0116('0x48')](handleError(_0x1183d1,null));};exports['create']=function(_0x39622b,_0x1d3c13){return db[_0x0116('0x2c')]['create'](_0x39622b[_0x0116('0x49')],{})['then'](respondWithResult(_0x1d3c13,0xc9))[_0x0116('0x48')](handleError(_0x1d3c13,null));};exports[_0x0116('0x4a')]=function(_0x294e7b,_0x2057f0){if(_0x294e7b[_0x0116('0x49')]['id']){delete _0x294e7b[_0x0116('0x49')]['id'];}return db[_0x0116('0x2c')][_0x0116('0x47')]({'where':{'id':_0x294e7b[_0x0116('0x4b')]['id']}})[_0x0116('0x25')](handleEntityNotFound(_0x2057f0,null))['then'](saveUpdates(_0x294e7b[_0x0116('0x49')],null))[_0x0116('0x25')](respondWithResult(_0x2057f0,null))[_0x0116('0x48')](handleError(_0x2057f0,null));};exports[_0x0116('0x26')]=function(_0x35f349,_0x36472d){return db[_0x0116('0x2c')][_0x0116('0x47')]({'where':{'id':_0x35f349[_0x0116('0x4b')]['id']}})['then'](handleEntityNotFound(_0x36472d,null))['then'](removeEntity(_0x36472d,null))['catch'](handleError(_0x36472d,null));};exports['describe']=function(_0x9d2f25,_0x8511b5){return db[_0x0116('0x2c')][_0x0116('0x4c')]()[_0x0116('0x25')](respondWithResult(_0x8511b5,null))['catch'](handleError(_0x8511b5,null));}; \ No newline at end of file +var _0xbd2f=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','update','then','destroy','error','stack','name','index','map','VoiceTransferReport','fieldName','type','key','model','keys','query','filters'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xbd2f,0x156));var _0xfbd2=function(_0x490125,_0x5e7814){_0x490125=_0x490125-0x0;var _0x2868ad=_0xbd2f[_0x490125];return _0x2868ad;};'use strict';var emlformat=require(_0xfbd2('0x0'));var rimraf=require(_0xfbd2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfbd2('0x2'));var rp=require(_0xfbd2('0x3'));var moment=require(_0xfbd2('0x4'));var BPromise=require(_0xfbd2('0x5'));var Mustache=require(_0xfbd2('0x6'));var util=require(_0xfbd2('0x7'));var path=require(_0xfbd2('0x8'));var sox=require(_0xfbd2('0x9'));var csv=require(_0xfbd2('0xa'));var ejs=require(_0xfbd2('0xb'));var fs=require('fs');var fs_extra=require(_0xfbd2('0xc'));var _=require(_0xfbd2('0xd'));var squel=require('squel');var crypto=require(_0xfbd2('0xe'));var jsforce=require(_0xfbd2('0xf'));var deskjs=require(_0xfbd2('0x10'));var toCsv=require(_0xfbd2('0xa'));var querystring=require('querystring');var Papa=require(_0xfbd2('0x11'));var Redis=require(_0xfbd2('0x12'));var authService=require(_0xfbd2('0x13'));var qs=require(_0xfbd2('0x14'));var as=require(_0xfbd2('0x15'));var hardwareService=require(_0xfbd2('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xfbd2('0x17'));var config=require(_0xfbd2('0x18'));var licenseUtil=require(_0xfbd2('0x19'));var db=require(_0xfbd2('0x1a'))['db'];function respondWithStatusCode(_0x5446c4,_0x2e5992){_0x2e5992=_0x2e5992||0xcc;return function(_0x59e56f){if(_0x59e56f){return _0x5446c4[_0xfbd2('0x1b')](_0x2e5992);}return _0x5446c4[_0xfbd2('0x1c')](_0x2e5992)[_0xfbd2('0x1d')]();};}function respondWithResult(_0x49dfdf,_0xcc573d){_0xcc573d=_0xcc573d||0xc8;return function(_0x1b3f16){if(_0x1b3f16){return _0x49dfdf[_0xfbd2('0x1c')](_0xcc573d)['json'](_0x1b3f16);}};}function respondWithFilteredResult(_0x2e205d,_0x45e2d6){return function(_0xccec1d){if(_0xccec1d){var _0x1781c4=typeof _0x45e2d6['offset']===_0xfbd2('0x1e')&&typeof _0x45e2d6[_0xfbd2('0x1f')]==='undefined';var _0x5a32d7=_0xccec1d[_0xfbd2('0x20')];var _0x10678d=_0x1781c4?0x0:_0x45e2d6['offset'];var _0x15b4b3=_0x1781c4?_0xccec1d[_0xfbd2('0x20')]:_0x45e2d6[_0xfbd2('0x21')]+_0x45e2d6[_0xfbd2('0x1f')];var _0x4f9d06;if(_0x15b4b3>=_0x5a32d7){_0x15b4b3=_0x5a32d7;_0x4f9d06=0xc8;}else{_0x4f9d06=0xce;}_0x2e205d[_0xfbd2('0x1c')](_0x4f9d06);return _0x2e205d['set'](_0xfbd2('0x22'),_0x10678d+'-'+_0x15b4b3+'/'+_0x5a32d7)[_0xfbd2('0x23')](_0xccec1d);}return null;};}function patchUpdates(_0x5583dc){return function(_0x1b2701){try{jsonpatch['apply'](_0x1b2701,_0x5583dc,!![]);}catch(_0x57dd1b){return BPromise[_0xfbd2('0x24')](_0x57dd1b);}return _0x1b2701['save']();};}function saveUpdates(_0x22cefb,_0x2feb1a){return function(_0x224ba0){if(_0x224ba0){return _0x224ba0[_0xfbd2('0x25')](_0x22cefb)[_0xfbd2('0x26')](function(_0x244c06){return _0x244c06;});}return null;};}function removeEntity(_0x58d1e2,_0x5723a7){return function(_0x46dcf3){if(_0x46dcf3){return _0x46dcf3[_0xfbd2('0x27')]()[_0xfbd2('0x26')](function(){_0x58d1e2['status'](0xcc)[_0xfbd2('0x1d')]();});}};}function handleEntityNotFound(_0xe4e763,_0x7373ce){return function(_0x532d53){if(!_0x532d53){_0xe4e763['sendStatus'](0x194);}return _0x532d53;};}function handleError(_0x1ef889,_0x27ac3a){_0x27ac3a=_0x27ac3a||0x1f4;return function(_0x3336eb){logger[_0xfbd2('0x28')](_0x3336eb[_0xfbd2('0x29')]);if(_0x3336eb[_0xfbd2('0x2a')]){delete _0x3336eb[_0xfbd2('0x2a')];}_0x1ef889[_0xfbd2('0x1c')](_0x27ac3a)['send'](_0x3336eb);};}exports[_0xfbd2('0x2b')]=function(_0x47030d,_0x545e61){var _0x45a2c9={},_0x1497b4={},_0xf61498={'count':0x0,'rows':[]};var _0x3d49da=_[_0xfbd2('0x2c')](db[_0xfbd2('0x2d')]['rawAttributes'],function(_0x52952a){return{'name':_0x52952a[_0xfbd2('0x2e')],'type':_0x52952a[_0xfbd2('0x2f')][_0xfbd2('0x30')]};});_0x1497b4[_0xfbd2('0x31')]=_[_0xfbd2('0x2c')](_0x3d49da,'name');_0x1497b4['query']=_[_0xfbd2('0x32')](_0x47030d[_0xfbd2('0x33')]);_0x1497b4[_0xfbd2('0x34')]=_[_0xfbd2('0x35')](_0x1497b4[_0xfbd2('0x31')],_0x1497b4[_0xfbd2('0x33')]);_0x45a2c9[_0xfbd2('0x36')]=_[_0xfbd2('0x35')](_0x1497b4[_0xfbd2('0x31')],qs[_0xfbd2('0x37')](_0x47030d[_0xfbd2('0x33')]['fields']));_0x45a2c9[_0xfbd2('0x36')]=_0x45a2c9[_0xfbd2('0x36')][_0xfbd2('0x38')]?_0x45a2c9[_0xfbd2('0x36')]:_0x1497b4[_0xfbd2('0x31')];if(!_0x47030d[_0xfbd2('0x33')][_0xfbd2('0x39')](_0xfbd2('0x3a'))){_0x45a2c9[_0xfbd2('0x1f')]=qs['limit'](_0x47030d[_0xfbd2('0x33')][_0xfbd2('0x1f')]);_0x45a2c9[_0xfbd2('0x21')]=qs[_0xfbd2('0x21')](_0x47030d[_0xfbd2('0x33')]['offset']);}_0x45a2c9[_0xfbd2('0x3b')]=qs[_0xfbd2('0x3c')](_0x47030d[_0xfbd2('0x33')]['sort']);_0x45a2c9[_0xfbd2('0x3d')]=qs['filters'](_[_0xfbd2('0x3e')](_0x47030d['query'],_0x1497b4[_0xfbd2('0x34')]),_0x3d49da);if(_0x47030d[_0xfbd2('0x33')][_0xfbd2('0x3f')]){_0x45a2c9[_0xfbd2('0x3d')]=_[_0xfbd2('0x40')](_0x45a2c9[_0xfbd2('0x3d')],{'$or':_[_0xfbd2('0x2c')](_0x3d49da,function(_0x1dcdfa){if(_0x1dcdfa['type']!==_0xfbd2('0x41')){var _0x14add5={};_0x14add5[_0x1dcdfa[_0xfbd2('0x2a')]]={'$like':'%'+_0x47030d[_0xfbd2('0x33')][_0xfbd2('0x3f')]+'%'};return _0x14add5;}})});}_0x45a2c9=_[_0xfbd2('0x40')]({},_0x45a2c9,_0x47030d[_0xfbd2('0x42')]);var _0x50c0da={'where':_0x45a2c9[_0xfbd2('0x3d')]};return db[_0xfbd2('0x2d')][_0xfbd2('0x20')](_0x50c0da)[_0xfbd2('0x26')](function(_0x86076f){_0xf61498[_0xfbd2('0x20')]=_0x86076f;if(_0x47030d[_0xfbd2('0x33')][_0xfbd2('0x43')]){_0x45a2c9[_0xfbd2('0x44')]=[{'all':!![]}];}return db[_0xfbd2('0x2d')][_0xfbd2('0x45')](_0x45a2c9);})[_0xfbd2('0x26')](function(_0x132f26){_0xf61498[_0xfbd2('0x46')]=_0x132f26;return _0xf61498;})[_0xfbd2('0x26')](respondWithFilteredResult(_0x545e61,_0x45a2c9))[_0xfbd2('0x47')](handleError(_0x545e61,null));};exports[_0xfbd2('0x48')]=function(_0x3554d7,_0x31b5e4){var _0x3856d3={'raw':!![],'where':{'id':_0x3554d7['params']['id']}},_0x3562c3={};_0x3562c3['model']=_['keys'](db[_0xfbd2('0x2d')][_0xfbd2('0x49')]);_0x3562c3[_0xfbd2('0x33')]=_['keys'](_0x3554d7['query']);_0x3562c3[_0xfbd2('0x34')]=_[_0xfbd2('0x35')](_0x3562c3[_0xfbd2('0x31')],_0x3562c3[_0xfbd2('0x33')]);_0x3856d3[_0xfbd2('0x36')]=_[_0xfbd2('0x35')](_0x3562c3[_0xfbd2('0x31')],qs[_0xfbd2('0x37')](_0x3554d7['query']['fields']));_0x3856d3[_0xfbd2('0x36')]=_0x3856d3['attributes'][_0xfbd2('0x38')]?_0x3856d3[_0xfbd2('0x36')]:_0x3562c3[_0xfbd2('0x31')];if(_0x3554d7['query']['includeAll']){_0x3856d3[_0xfbd2('0x44')]=[{'all':!![]}];}_0x3856d3=_[_0xfbd2('0x40')]({},_0x3856d3,_0x3554d7['options']);return db[_0xfbd2('0x2d')][_0xfbd2('0x4a')](_0x3856d3)[_0xfbd2('0x26')](handleEntityNotFound(_0x31b5e4,null))['then'](respondWithResult(_0x31b5e4,null))[_0xfbd2('0x47')](handleError(_0x31b5e4,null));};exports[_0xfbd2('0x4b')]=function(_0x5046f8,_0x21cb90){return db[_0xfbd2('0x2d')][_0xfbd2('0x4b')](_0x5046f8[_0xfbd2('0x4c')],{})[_0xfbd2('0x26')](respondWithResult(_0x21cb90,0xc9))['catch'](handleError(_0x21cb90,null));};exports['update']=function(_0x3ca570,_0xaa25fd){if(_0x3ca570[_0xfbd2('0x4c')]['id']){delete _0x3ca570[_0xfbd2('0x4c')]['id'];}return db[_0xfbd2('0x2d')][_0xfbd2('0x4a')]({'where':{'id':_0x3ca570[_0xfbd2('0x4d')]['id']}})[_0xfbd2('0x26')](handleEntityNotFound(_0xaa25fd,null))[_0xfbd2('0x26')](saveUpdates(_0x3ca570[_0xfbd2('0x4c')],null))[_0xfbd2('0x26')](respondWithResult(_0xaa25fd,null))['catch'](handleError(_0xaa25fd,null));};exports[_0xfbd2('0x27')]=function(_0x1d62b3,_0x20b67f){return db['VoiceTransferReport'][_0xfbd2('0x4a')]({'where':{'id':_0x1d62b3['params']['id']}})[_0xfbd2('0x26')](handleEntityNotFound(_0x20b67f,null))[_0xfbd2('0x26')](removeEntity(_0x20b67f,null))['catch'](handleError(_0x20b67f,null));};exports[_0xfbd2('0x4e')]=function(_0x4c2190,_0x363dbe){return db[_0xfbd2('0x2d')][_0xfbd2('0x4e')]()['then'](respondWithResult(_0x363dbe,null))['catch'](handleError(_0x363dbe,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 135c8ee..989f037 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 _0x3cce=['../../config/logger','api','moment','path','rimraf','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash'];(function(_0x377e11,_0x4bd449){var _0x270348=function(_0x37cb56){while(--_0x37cb56){_0x377e11['push'](_0x377e11['shift']());}};_0x270348(++_0x4bd449);}(_0x3cce,0x117));var _0xe3cc=function(_0x103101,_0x2aa878){_0x103101=_0x103101-0x0;var _0x36371e=_0x3cce[_0x103101];return _0x36371e;};'use strict';var _=require(_0xe3cc('0x0'));var util=require('util');var logger=require(_0xe3cc('0x1'))(_0xe3cc('0x2'));var moment=require(_0xe3cc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3cc('0x4'));var rimraf=require(_0xe3cc('0x5'));var config=require('../../config/environment');var attributes=require(_0xe3cc('0x6'));module[_0xe3cc('0x7')]=function(_0xdb4f53,_0x1055f5){return _0xdb4f53[_0xe3cc('0x8')]('VoiceTransferReport',attributes,{'tableName':_0xe3cc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3f2=['define','VoiceTransferReport','report_call_transfer','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceTransferReport.attributes','exports'];(function(_0x35cb03,_0x578e9d){var _0x696377=function(_0x318fa3){while(--_0x318fa3){_0x35cb03['push'](_0x35cb03['shift']());}};_0x696377(++_0x578e9d);}(_0xd3f2,0x162));var _0x2d3f=function(_0x545dda,_0x577f99){_0x545dda=_0x545dda-0x0;var _0xef8cba=_0xd3f2[_0x545dda];return _0xef8cba;};'use strict';var _=require('lodash');var util=require(_0x2d3f('0x0'));var logger=require(_0x2d3f('0x1'))(_0x2d3f('0x2'));var moment=require(_0x2d3f('0x3'));var BPromise=require(_0x2d3f('0x4'));var rp=require(_0x2d3f('0x5'));var fs=require('fs');var path=require(_0x2d3f('0x6'));var rimraf=require('rimraf');var config=require(_0x2d3f('0x7'));var attributes=require(_0x2d3f('0x8'));module[_0x2d3f('0x9')]=function(_0x1d88c3,_0xa87c0d){return _0x1d88c3[_0x2d3f('0xa')](_0x2d3f('0xb'),attributes,{'tableName':_0x2d3f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index b00fc07..3769e00 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 _0x829b=['message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','debug','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0x829b,0x159));var _0xb829=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x829b[_0x51c819];return _0x15c5d2;};'use strict';var _=require('lodash');var util=require(_0xb829('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb829('0x1'));var db=require(_0xb829('0x2'))['db'];var utils=require(_0xb829('0x3'));var logger=require(_0xb829('0x4'))(_0xb829('0x5'));var config=require('../../config/environment');var jayson=require(_0xb829('0x6'));var client=jayson[_0xb829('0x7')][_0xb829('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x539a19,_0x57e83f,_0x44afb2){return new BPromise(function(_0x4e4da0,_0x4fe5ea){return client['request'](_0x539a19,_0x44afb2)[_0xb829('0x9')](function(_0x793983){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x57e83f,_0xb829('0xa'));logger['debug'](_0xb829('0xb'),_0x57e83f,_0xb829('0xa'),JSON[_0xb829('0xc')](_0x793983));if(_0x793983[_0xb829('0xd')]){if(_0x793983[_0xb829('0xd')]['code']===0x1f4){logger[_0xb829('0xd')](_0xb829('0xe'),_0x57e83f,_0x793983[_0xb829('0xd')][_0xb829('0xf')]);return _0x4fe5ea(_0x793983[_0xb829('0xd')]['message']);}logger[_0xb829('0xd')](_0xb829('0xe'),_0x57e83f,_0x793983['error'][_0xb829('0xf')]);return _0x4e4da0(_0x793983['error']['message']);}else{logger[_0xb829('0x10')](_0xb829('0xe'),_0x57e83f,_0xb829('0xa'));_0x4e4da0(_0x793983[_0xb829('0x11')][_0xb829('0xf')]);}})[_0xb829('0x12')](function(_0x409f61){logger[_0xb829('0xd')](_0xb829('0xe'),_0x57e83f,_0x409f61);_0x4fe5ea(_0x409f61);});});}exports[_0xb829('0x13')]=function(_0x3cc992){var _0x1f38a4=this;return new Promise(function(_0xa419cd,_0x473a47){return db[_0xb829('0x14')][_0xb829('0x15')](_0x3cc992['body'],{'raw':_0x3cc992[_0xb829('0x16')]?_0x3cc992['options']['raw']===undefined?!![]:![]:!![]})[_0xb829('0x9')](function(_0x36095b){logger[_0xb829('0x10')]('CreateVoiceTransferReport',_0x3cc992);logger[_0xb829('0x17')]('CreateVoiceTransferReport',_0x3cc992,JSON['stringify'](_0x36095b));_0xa419cd(_0x36095b);})[_0xb829('0x12')](function(_0x1a9952){logger[_0xb829('0xd')]('CreateVoiceTransferReport',_0x1a9952['message'],_0x3cc992);_0x473a47(_0x1f38a4[_0xb829('0xd')](0x1f4,_0x1a9952[_0xb829('0xf')]));});});}; \ No newline at end of file +var _0x5b56=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','VoiceTransferReport,\x20%s,\x20%s','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options'];(function(_0x5da845,_0x53a975){var _0x16fa36=function(_0xa9546a){while(--_0xa9546a){_0x5da845['push'](_0x5da845['shift']());}};_0x16fa36(++_0x53a975);}(_0x5b56,0xcb));var _0x65b5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5b56[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x65b5('0x0'));var util=require(_0x65b5('0x1'));var moment=require(_0x65b5('0x2'));var BPromise=require(_0x65b5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65b5('0x4'))['db'];var utils=require(_0x65b5('0x5'));var logger=require(_0x65b5('0x6'))('rpc');var config=require(_0x65b5('0x7'));var jayson=require(_0x65b5('0x8'));var client=jayson[_0x65b5('0x9')][_0x65b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3259e7,_0x5c7ad8,_0x128620){return new BPromise(function(_0x2164b1,_0x746319){return client[_0x65b5('0xb')](_0x3259e7,_0x128620)[_0x65b5('0xc')](function(_0xe5425b){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x5c7ad8,'request\x20sent');logger[_0x65b5('0xd')](_0x65b5('0xe'),_0x5c7ad8,_0x65b5('0xf'),JSON[_0x65b5('0x10')](_0xe5425b));if(_0xe5425b['error']){if(_0xe5425b['error'][_0x65b5('0x11')]===0x1f4){logger[_0x65b5('0x12')](_0x65b5('0x13'),_0x5c7ad8,_0xe5425b[_0x65b5('0x12')][_0x65b5('0x14')]);return _0x746319(_0xe5425b[_0x65b5('0x12')][_0x65b5('0x14')]);}logger[_0x65b5('0x12')](_0x65b5('0x13'),_0x5c7ad8,_0xe5425b[_0x65b5('0x12')][_0x65b5('0x14')]);return _0x2164b1(_0xe5425b[_0x65b5('0x12')]['message']);}else{logger[_0x65b5('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x5c7ad8,_0x65b5('0xf'));_0x2164b1(_0xe5425b[_0x65b5('0x16')][_0x65b5('0x14')]);}})[_0x65b5('0x17')](function(_0x4a52d0){logger['error'](_0x65b5('0x13'),_0x5c7ad8,_0x4a52d0);_0x746319(_0x4a52d0);});});}exports[_0x65b5('0x18')]=function(_0x5b852b){var _0x4be7c7=this;return new Promise(function(_0x5562bf,_0x295c19){return db[_0x65b5('0x19')][_0x65b5('0x1a')](_0x5b852b[_0x65b5('0x1b')],{'raw':_0x5b852b[_0x65b5('0x1c')]?_0x5b852b[_0x65b5('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x65b5('0xc')](function(_0x1efef7){logger[_0x65b5('0x15')]('CreateVoiceTransferReport',_0x5b852b);logger[_0x65b5('0xd')](_0x65b5('0x18'),_0x5b852b,JSON[_0x65b5('0x10')](_0x1efef7));_0x5562bf(_0x1efef7);})[_0x65b5('0x17')](function(_0x2011b1){logger[_0x65b5('0x12')](_0x65b5('0x18'),_0x2011b1['message'],_0x5b852b);_0x295c19(_0x4be7c7['error'](0x1f4,_0x2011b1[_0x65b5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 59c4996..0c01ce2 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 _0xf109=['/transfer','transfer','express','Router','../../components/auth/service','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','/unhold','/calls','calls'];(function(_0x4337a2,_0x3f7a9d){var _0x408bf9=function(_0x40c996){while(--_0x40c996){_0x4337a2['push'](_0x4337a2['shift']());}};_0x408bf9(++_0x3f7a9d);}(_0xf109,0xce));var _0x9f10=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xf109[_0x4fbfd9];return _0x31dc94;};'use strict';var express=require(_0x9f10('0x0'));var router=express[_0x9f10('0x1')]();var auth=require(_0x9f10('0x2'));var controller=require('./webbar.controller');router['post']('/originate',auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x5')]);router[_0x9f10('0x6')](_0x9f10('0x7'),auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x8')]);router[_0x9f10('0x6')](_0x9f10('0x9'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller[_0x9f10('0xa')]);router[_0x9f10('0x6')](_0x9f10('0xb'),auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller['hold']);router[_0x9f10('0x6')](_0x9f10('0xc'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller['unhold']);router[_0x9f10('0x6')](_0x9f10('0xd'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller[_0x9f10('0xe')]);router[_0x9f10('0x6')](_0x9f10('0xf'),auth['isAuthenticated'](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x10')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['/unhold','unhold','/calls','calls','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','hold'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x34e8,0x12c));var _0x834e=function(_0x41fca2,_0x3a1f7f){_0x41fca2=_0x41fca2-0x0;var _0x32f7f2=_0x34e8[_0x41fca2];return _0x32f7f2;};'use strict';var express=require(_0x834e('0x0'));var router=express[_0x834e('0x1')]();var auth=require(_0x834e('0x2'));var controller=require(_0x834e('0x3'));router['post'](_0x834e('0x4'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x7')]);router[_0x834e('0x8')](_0x834e('0x9'),auth[_0x834e('0x5')](),auth['isWebrtcLicence'](),controller[_0x834e('0xa')]);router['post'](_0x834e('0xb'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0xc')]);router[_0x834e('0x8')](_0x834e('0xd'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0xe')]);router[_0x834e('0x8')](_0x834e('0xf'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x10')]);router[_0x834e('0x8')](_0x834e('0x11'),auth[_0x834e('0x5')](),auth['isWebrtcLicence'](),controller[_0x834e('0x12')]);router[_0x834e('0x8')]('/transfer',auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x13')]);module[_0x834e('0x14')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index e76c9a1..0d7740e 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 _0xfd28=['all','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','info','originate\x20fired:','body','json','callNumber','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','hangup','user:%s','hangup\x20executed!','answer\x20fired:','userId','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','calls','calls\x20fired:','VoiceChannels','filter','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','util','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','validate','number','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','handleError:','error','stack','name','status','NotFound','then','code','message','result','catch','User','findOne','agent'];(function(_0x1c451c,_0x2bee10){var _0x274f2b=function(_0x4960d8){while(--_0x4960d8){_0x1c451c['push'](_0x1c451c['shift']());}};_0x274f2b(++_0x2bee10);}(_0xfd28,0x148));var _0x8fd2=function(_0x1bfe2b,_0x34856e){_0x1bfe2b=_0x1bfe2b-0x0;var _0x1477d4=_0xfd28[_0x1bfe2b];return _0x1477d4;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x8fd2('0x0'));var db=require(_0x8fd2('0x1'))['db'];var config=require('../../config/environment');var util=require(_0x8fd2('0x2'));var BPromise=require('bluebird');var jayson=require(_0x8fd2('0x3'));var amiClient=jayson[_0x8fd2('0x4')][_0x8fd2('0x5')]({'port':0x232a});var logger=require('../../config/logger')(_0x8fd2('0x6'));var Redis=require(_0x8fd2('0x7'));config[_0x8fd2('0x8')]=_[_0x8fd2('0x9')](config[_0x8fd2('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8fd2('0x8')]));var Schema=require(_0x8fd2('0xa'));var originateValidation=new Schema({'userId':{'type':_0x8fd2('0xb'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x8fd2('0xc'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x8fd2('0xc')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x8fd2('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x8fd2('0xc'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8fd2('0xd')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x8fd2('0xb'),'required':[!![],_0x8fd2('0xd')]},'sessionId':{'type':_0x8fd2('0xc'),'required':[!![],_0x8fd2('0xe')]},'transferNumber':{'type':_0x8fd2('0xc'),'required':[!![],_0x8fd2('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x8fd2('0xb'),'required':[!![],_0x8fd2('0xd')]},'sessionId':{'type':_0x8fd2('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x8fd2('0xb'),'required':[!![],_0x8fd2('0xd')]},'sessionId':{'type':_0x8fd2('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x8fd2('0xb'),'required':[!![],_0x8fd2('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x8fd2('0xb'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x20daca,_0x5ef478,_0x4f0b17){logger['info'](_0x20daca,_0x5ef478,JSON[_0x8fd2('0x10')](_0x4f0b17));io['to'](_0x20daca)[_0x8fd2('0x11')](_0x5ef478,_0x4f0b17);}function handleError(_0x1ced10){return function(_0x12e8a3){console['log'](_0x8fd2('0x12'),_0x12e8a3,_0x12e8a3 instanceof RangeError);logger[_0x8fd2('0x13')](_0x12e8a3[_0x8fd2('0x14')]);if(_0x12e8a3 instanceof RangeError){if(_0x12e8a3[_0x8fd2('0x15')]){delete _0x12e8a3[_0x8fd2('0x15')];}_0x1ced10['status'](0x194)['send'](_0x12e8a3);}else{if(_0x12e8a3[_0x8fd2('0x15')]){delete _0x12e8a3['name'];}_0x1ced10[_0x8fd2('0x16')](0x1f4)['send'](_0x12e8a3);}};}function checkError(){return function(_0x1631c6){if(!_0x1631c6){throw new RangeError(_0x8fd2('0x17'));}return _0x1631c6;};}function respondWithRpcPromise(_0x4f81dc,_0x122b60){return new BPromise(function(_0x4c2be8,_0xd3981f){var _0x44ee7a=amiClient;return _0x44ee7a['request'](_0x4f81dc,_0x122b60)[_0x8fd2('0x18')](function(_0x2a9c3c){if(_0x2a9c3c[_0x8fd2('0x13')]){if(_0x2a9c3c['error'][_0x8fd2('0x19')]===0x1f4){return _0xd3981f(_0x2a9c3c[_0x8fd2('0x13')][_0x8fd2('0x1a')]);}return _0x4c2be8(_0x2a9c3c[_0x8fd2('0x13')][_0x8fd2('0x1a')]);}else{_0x4c2be8(_0x2a9c3c[_0x8fd2('0x1b')]);}})[_0x8fd2('0x1c')](function(_0x398925){_0xd3981f(_0x398925);});});}function getAgent(_0x1456b4){return db[_0x8fd2('0x1d')][_0x8fd2('0x1e')]({'where':{'id':_0x1456b4,'role':_0x8fd2('0x1f')}})[_0x8fd2('0x18')](checkError());}function getAgentCheckSession(_0x512e5a,_0x4c6af7){return new BPromise(function(_0x345bc3,_0x1858a9){var _0x288bcd=respondWithRpcPromise('VoiceChannels');var _0x2f26ae=getAgent(_0x512e5a);Promise[_0x8fd2('0x20')]([_0x288bcd,_0x2f26ae])[_0x8fd2('0x18')](function(_0x960869){var _0x119439=_0x960869[0x0];var _0x4745bf=_0x960869[0x1];var _0x332ab0=_['filter'](_0x119439[_0x8fd2('0x21')],function(_0x13c9b9){return _0x13c9b9[_0x8fd2('0x22')]==_0x4745bf['id']&&_0x13c9b9[_0x8fd2('0x23')]==_0x4c6af7;});if(_0x332ab0[_0x8fd2('0x24')]==0x1){_0x345bc3(_0x4745bf);}else{_0x1858a9(new RangeError(_0x8fd2('0x25')+_0x4c6af7+_0x8fd2('0x26')));}});});}exports['originate']=function(_0x5b992a,_0x5144ba){logger[_0x8fd2('0x27')](_0x8fd2('0x28'),_0x5b992a[_0x8fd2('0x29')]);var _0xe4987b=originateValidation['validate'](_0x5b992a['body']);if(_0xe4987b[_0x8fd2('0x24')]>0x0){return _0x5144ba[_0x8fd2('0x16')](0x190)[_0x8fd2('0x2a')](_0xe4987b);}var _0x18fe4e=_0x5b992a[_0x8fd2('0x29')]['userId'];var _0x328964=_0x5b992a['body'][_0x8fd2('0x2b')];var _0x4ade8c=_0x5b992a[_0x8fd2('0x29')]['callerId'];var _0x134420=_0x5b992a[_0x8fd2('0x29')][_0x8fd2('0x2c')];return getAgent(_0x18fe4e)['then'](function(_0x339291){logger['info'](_0x8fd2('0x2d'),_0x339291[_0x8fd2('0x15')]);emit(util[_0x8fd2('0x2e')]('user:%s',_0x339291[_0x8fd2('0x15')]),_0x8fd2('0x2f'),{'callNumber':_0x328964,'callerId':_0x4ade8c,'callbackUrl':_0x134420});return _0x5144ba[_0x8fd2('0x16')](0xc8)['json']({'error':![],'message':_0x8fd2('0x30')});})[_0x8fd2('0x1c')](handleError(_0x5144ba));};exports[_0x8fd2('0x31')]=function(_0x4adfa2,_0x37a24b){logger[_0x8fd2('0x27')]('hangup\x20fired:',_0x4adfa2[_0x8fd2('0x29')]);var _0x130072=hangupValidation[_0x8fd2('0xa')](_0x4adfa2[_0x8fd2('0x29')]);if(_0x130072[_0x8fd2('0x24')]>0x0){return _0x37a24b[_0x8fd2('0x16')](0x190)[_0x8fd2('0x2a')](_0x130072);}var _0x5e6140=_0x4adfa2[_0x8fd2('0x29')]['userId'];var _0x566c9e=_0x4adfa2[_0x8fd2('0x29')][_0x8fd2('0x23')];return getAgent(_0x5e6140)[_0x8fd2('0x18')](function(_0x2edcfd){logger[_0x8fd2('0x27')](_0x8fd2('0x2d'),_0x2edcfd['name']);emit(util['format'](_0x8fd2('0x32'),_0x2edcfd['name']),'webbar:hangup',{'sessionId':_0x566c9e});return _0x37a24b[_0x8fd2('0x16')](0xc8)[_0x8fd2('0x2a')]({'error':![],'message':_0x8fd2('0x33')});})[_0x8fd2('0x1c')](handleError(_0x37a24b));};exports['answer']=function(_0x39cd8e,_0x1d5458){logger[_0x8fd2('0x27')](_0x8fd2('0x34'),_0x39cd8e[_0x8fd2('0x29')]);var _0x1de9aa=answerValidation[_0x8fd2('0xa')](_0x39cd8e['body']);if(_0x1de9aa[_0x8fd2('0x24')]>0x0){return _0x1d5458[_0x8fd2('0x16')](0x190)[_0x8fd2('0x2a')](_0x1de9aa);}var _0x70404e=_0x39cd8e[_0x8fd2('0x29')][_0x8fd2('0x35')];var _0x40a572=_0x39cd8e['body'][_0x8fd2('0x23')];return getAgent(_0x70404e)[_0x8fd2('0x18')](function(_0x2abd80){logger[_0x8fd2('0x27')](_0x8fd2('0x2d'),_0x2abd80[_0x8fd2('0x15')]);emit(util[_0x8fd2('0x2e')]('user:%s',_0x2abd80[_0x8fd2('0x15')]),'webbar:answer',{'sessionId':_0x40a572});return _0x1d5458[_0x8fd2('0x16')](0xc8)['json']({'error':![],'message':_0x8fd2('0x36')});})[_0x8fd2('0x1c')](handleError(_0x1d5458));};exports[_0x8fd2('0x37')]=function(_0x5c0632,_0x290467){logger[_0x8fd2('0x27')](_0x8fd2('0x38'),_0x5c0632['body']);var _0x3c65c4=holdValidation['validate'](_0x5c0632[_0x8fd2('0x29')]);if(_0x3c65c4[_0x8fd2('0x24')]>0x0){return _0x290467[_0x8fd2('0x16')](0x190)[_0x8fd2('0x2a')](_0x3c65c4);}var _0xc62e9e=_0x5c0632[_0x8fd2('0x29')][_0x8fd2('0x35')];var _0x34ffed=_0x5c0632[_0x8fd2('0x29')][_0x8fd2('0x23')];return getAgent(_0xc62e9e)[_0x8fd2('0x18')](function(_0x34f3a2){logger[_0x8fd2('0x27')](_0x8fd2('0x2d'),_0x34f3a2[_0x8fd2('0x15')]);emit(util[_0x8fd2('0x2e')](_0x8fd2('0x32'),_0x34f3a2[_0x8fd2('0x15')]),_0x8fd2('0x39'),{'sessionId':_0x34ffed});return _0x290467['status'](0xc8)['json']({'error':![],'message':_0x8fd2('0x3a')});})[_0x8fd2('0x1c')](handleError(_0x290467));};exports[_0x8fd2('0x3b')]=function(_0x5d79c3,_0x4d5b81){logger[_0x8fd2('0x27')]('unhold\x20fired:',_0x5d79c3[_0x8fd2('0x29')]);var _0x1295c4=unholdValidation[_0x8fd2('0xa')](_0x5d79c3['body']);if(_0x1295c4[_0x8fd2('0x24')]>0x0){return _0x4d5b81[_0x8fd2('0x16')](0x190)['json'](_0x1295c4);}var _0x331ada=_0x5d79c3[_0x8fd2('0x29')][_0x8fd2('0x35')];var _0x56050f=_0x5d79c3[_0x8fd2('0x29')][_0x8fd2('0x23')];return getAgent(_0x331ada)[_0x8fd2('0x18')](function(_0x2c5766){logger[_0x8fd2('0x27')](_0x8fd2('0x2d'),_0x2c5766['name']);emit(util['format'](_0x8fd2('0x32'),_0x2c5766[_0x8fd2('0x15')]),'webbar:unhold',{'sessionId':_0x56050f});return _0x4d5b81[_0x8fd2('0x16')](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x8fd2('0x1c')](handleError(_0x4d5b81));};exports[_0x8fd2('0x3c')]=function(_0x337354,_0x29a00e){logger[_0x8fd2('0x27')](_0x8fd2('0x3d'),_0x29a00e['body']);var _0x2f4759=callsValidation[_0x8fd2('0xa')](_0x337354[_0x8fd2('0x29')]);if(_0x2f4759[_0x8fd2('0x24')]>0x0){return _0x29a00e[_0x8fd2('0x16')](0x190)['json'](_0x2f4759);}var _0x5cf641=_0x337354['body']['userId'];var _0x57b8f6=respondWithRpcPromise(_0x8fd2('0x3e'));var _0x382154=getAgent(_0x5cf641);return Promise[_0x8fd2('0x20')]([_0x57b8f6,_0x382154])[_0x8fd2('0x18')](function(_0x21696c){var _0x25abdc=_0x21696c[0x0];var _0x460f31=_0x21696c[0x1];var _0x4a81ab=_[_0x8fd2('0x3f')](_0x25abdc['rows'],function(_0x351cfe){return _0x351cfe[_0x8fd2('0x22')]==_0x460f31['id'];});return _0x29a00e['status'](0xc8)['json']({'count':_0x4a81ab[_0x8fd2('0x24')],'rows':_0x4a81ab});})[_0x8fd2('0x1c')](handleError(_0x29a00e));};exports[_0x8fd2('0x40')]=function(_0x30a952,_0x37ddfa){logger['info'](_0x8fd2('0x41'),_0x30a952[_0x8fd2('0x29')]);var _0x1b46d6=conferenceValidation[_0x8fd2('0xa')](_0x30a952['body']);if(_0x1b46d6[_0x8fd2('0x24')]>0x0){return _0x37ddfa[_0x8fd2('0x16')](0x190)[_0x8fd2('0x2a')](_0x1b46d6);}var _0x23c608=_0x30a952['body']['userId'];return getAgent(_0x23c608)['then'](function(_0x2e5693){logger[_0x8fd2('0x27')](_0x8fd2('0x2d'),_0x2e5693[_0x8fd2('0x15')]);emit(util[_0x8fd2('0x2e')]('user:%s',_0x2e5693[_0x8fd2('0x15')]),_0x8fd2('0x42'));return _0x37ddfa['status'](0xc8)[_0x8fd2('0x2a')]({'error':![],'message':_0x8fd2('0x43')});})[_0x8fd2('0x1c')](handleError(_0x37ddfa));};exports[_0x8fd2('0x44')]=function(_0x305d83,_0x5547c7){logger[_0x8fd2('0x27')](_0x8fd2('0x45'),_0x305d83[_0x8fd2('0x29')]);var _0x4606f7=transferValidation[_0x8fd2('0xa')](_0x305d83[_0x8fd2('0x29')]);if(_0x4606f7[_0x8fd2('0x24')]>0x0){return _0x5547c7[_0x8fd2('0x16')](0x190)[_0x8fd2('0x2a')](_0x4606f7);}var _0x4680f0=_0x305d83[_0x8fd2('0x29')][_0x8fd2('0x35')];var _0x40ffd5=_0x305d83['body'][_0x8fd2('0x23')];var _0x237756=_0x305d83['body']['transferNumber'];return getAgent(_0x4680f0)['then'](function(_0x2bd1d0){logger[_0x8fd2('0x27')](_0x8fd2('0x2d'),_0x2bd1d0[_0x8fd2('0x15')]);emit(util[_0x8fd2('0x2e')](_0x8fd2('0x32'),_0x2bd1d0['name']),_0x8fd2('0x46'),{'sessionId':_0x40ffd5,'transferNumber':_0x237756});return _0x5547c7[_0x8fd2('0x16')](0xc8)['json']({'error':![],'message':_0x8fd2('0x47')});})['catch'](handleError(_0x5547c7));}; \ No newline at end of file +var _0x66fa=['userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','sessionId','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','VoiceChannels','filter','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','request','then','code','message','result','catch','findOne','all','rows','UserId','length','\x20not\x20found!','originate','originate\x20fired:','validate','body'];(function(_0x1c22b9,_0x5b950d){var _0x8c986d=function(_0x2ecfc3){while(--_0x2ecfc3){_0x1c22b9['push'](_0x1c22b9['shift']());}};_0x8c986d(++_0x5b950d);}(_0x66fa,0x168));var _0xa66f=function(_0x580766,_0x35f10a){_0x580766=_0x580766-0x0;var _0x11e566=_0x66fa[_0x580766];return _0x11e566;};'use strict';var path=require(_0xa66f('0x0'));var fs=require('fs');var _=require(_0xa66f('0x1'));var db=require(_0xa66f('0x2'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0xa66f('0x3'));var jayson=require(_0xa66f('0x4'));var amiClient=jayson[_0xa66f('0x5')][_0xa66f('0x6')]({'port':0x232a});var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var Redis=require(_0xa66f('0x9'));config[_0xa66f('0xa')]=_[_0xa66f('0xb')](config[_0xa66f('0xa')],{'host':_0xa66f('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa66f('0xa')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xa66f('0xd'),'required':[!![],_0xa66f('0xe')]},'callNumber':{'type':'string','required':[!![],_0xa66f('0xf')]},'callerId':{'type':_0xa66f('0x10')},'callbackUrl':{'type':_0xa66f('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0xa66f('0xd'),'required':[!![],_0xa66f('0xe')]},'sessionId':{'type':_0xa66f('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa66f('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa66f('0xe')]},'sessionId':{'type':_0xa66f('0x10'),'required':[!![],_0xa66f('0x11')]},'transferNumber':{'type':'string','required':[!![],_0xa66f('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0xa66f('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa66f('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa66f('0xd'),'required':[!![],_0xa66f('0xe')]},'sessionId':{'type':_0xa66f('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa66f('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xa66f('0xd'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x2d9ec7,_0x33270b,_0xc68431){logger[_0xa66f('0x13')](_0x2d9ec7,_0x33270b,JSON[_0xa66f('0x14')](_0xc68431));io['to'](_0x2d9ec7)[_0xa66f('0x15')](_0x33270b,_0xc68431);}function handleError(_0x58f239){return function(_0x4d5e31){console[_0xa66f('0x16')](_0xa66f('0x17'),_0x4d5e31,_0x4d5e31 instanceof RangeError);logger[_0xa66f('0x18')](_0x4d5e31[_0xa66f('0x19')]);if(_0x4d5e31 instanceof RangeError){if(_0x4d5e31['name']){delete _0x4d5e31[_0xa66f('0x1a')];}_0x58f239[_0xa66f('0x1b')](0x194)['send'](_0x4d5e31);}else{if(_0x4d5e31[_0xa66f('0x1a')]){delete _0x4d5e31['name'];}_0x58f239[_0xa66f('0x1b')](0x1f4)[_0xa66f('0x1c')](_0x4d5e31);}};}function checkError(){return function(_0x4a92dd){if(!_0x4a92dd){throw new RangeError('NotFound');}return _0x4a92dd;};}function respondWithRpcPromise(_0xc87a54,_0x5e6856){return new BPromise(function(_0x5b2cf0,_0x59f7aa){var _0x535359=amiClient;return _0x535359[_0xa66f('0x1d')](_0xc87a54,_0x5e6856)[_0xa66f('0x1e')](function(_0x1aeaf2){if(_0x1aeaf2['error']){if(_0x1aeaf2[_0xa66f('0x18')][_0xa66f('0x1f')]===0x1f4){return _0x59f7aa(_0x1aeaf2['error'][_0xa66f('0x20')]);}return _0x5b2cf0(_0x1aeaf2[_0xa66f('0x18')][_0xa66f('0x20')]);}else{_0x5b2cf0(_0x1aeaf2[_0xa66f('0x21')]);}})[_0xa66f('0x22')](function(_0x13aec8){_0x59f7aa(_0x13aec8);});});}function getAgent(_0x56b603){return db['User'][_0xa66f('0x23')]({'where':{'id':_0x56b603,'role':'agent'}})[_0xa66f('0x1e')](checkError());}function getAgentCheckSession(_0x278531,_0x2cf4c9){return new BPromise(function(_0x49e1b3,_0x161f53){var _0x4ca0a4=respondWithRpcPromise('VoiceChannels');var _0x4c7b82=getAgent(_0x278531);Promise[_0xa66f('0x24')]([_0x4ca0a4,_0x4c7b82])['then'](function(_0xd9f17e){var _0x7d07a4=_0xd9f17e[0x0];var _0x386c4d=_0xd9f17e[0x1];var _0x5f253f=_['filter'](_0x7d07a4[_0xa66f('0x25')],function(_0x416c25){return _0x416c25[_0xa66f('0x26')]==_0x386c4d['id']&&_0x416c25['sessionId']==_0x2cf4c9;});if(_0x5f253f[_0xa66f('0x27')]==0x1){_0x49e1b3(_0x386c4d);}else{_0x161f53(new RangeError('sessionId\x20'+_0x2cf4c9+_0xa66f('0x28')));}});});}exports[_0xa66f('0x29')]=function(_0x342dde,_0x36525b){logger[_0xa66f('0x13')](_0xa66f('0x2a'),_0x342dde['body']);var _0x3e5b98=originateValidation[_0xa66f('0x2b')](_0x342dde['body']);if(_0x3e5b98[_0xa66f('0x27')]>0x0){return _0x36525b[_0xa66f('0x1b')](0x190)['json'](_0x3e5b98);}var _0x49e47c=_0x342dde[_0xa66f('0x2c')][_0xa66f('0x2d')];var _0x42aa69=_0x342dde[_0xa66f('0x2c')][_0xa66f('0x2e')];var _0x422624=_0x342dde['body'][_0xa66f('0x2f')];var _0x16b375=_0x342dde[_0xa66f('0x2c')][_0xa66f('0x30')];return getAgent(_0x49e47c)['then'](function(_0x4d76bd){logger[_0xa66f('0x13')]('entityFound:',_0x4d76bd[_0xa66f('0x1a')]);emit(util[_0xa66f('0x31')](_0xa66f('0x32'),_0x4d76bd[_0xa66f('0x1a')]),_0xa66f('0x33'),{'callNumber':_0x42aa69,'callerId':_0x422624,'callbackUrl':_0x16b375});return _0x36525b[_0xa66f('0x1b')](0xc8)[_0xa66f('0x34')]({'error':![],'message':_0xa66f('0x35')});})[_0xa66f('0x22')](handleError(_0x36525b));};exports[_0xa66f('0x36')]=function(_0xdc06ac,_0x1c355f){logger['info'](_0xa66f('0x37'),_0xdc06ac[_0xa66f('0x2c')]);var _0x4d3e55=hangupValidation[_0xa66f('0x2b')](_0xdc06ac['body']);if(_0x4d3e55[_0xa66f('0x27')]>0x0){return _0x1c355f[_0xa66f('0x1b')](0x190)[_0xa66f('0x34')](_0x4d3e55);}var _0x2c185b=_0xdc06ac['body'][_0xa66f('0x2d')];var _0x17ad3b=_0xdc06ac[_0xa66f('0x2c')][_0xa66f('0x38')];return getAgent(_0x2c185b)['then'](function(_0x111e80){logger['info'](_0xa66f('0x39'),_0x111e80[_0xa66f('0x1a')]);emit(util[_0xa66f('0x31')](_0xa66f('0x32'),_0x111e80['name']),_0xa66f('0x3a'),{'sessionId':_0x17ad3b});return _0x1c355f['status'](0xc8)[_0xa66f('0x34')]({'error':![],'message':_0xa66f('0x3b')});})[_0xa66f('0x22')](handleError(_0x1c355f));};exports[_0xa66f('0x3c')]=function(_0x331ad8,_0x34b5eb){logger[_0xa66f('0x13')](_0xa66f('0x3d'),_0x331ad8[_0xa66f('0x2c')]);var _0x3ed4a0=answerValidation[_0xa66f('0x2b')](_0x331ad8[_0xa66f('0x2c')]);if(_0x3ed4a0[_0xa66f('0x27')]>0x0){return _0x34b5eb[_0xa66f('0x1b')](0x190)[_0xa66f('0x34')](_0x3ed4a0);}var _0x4f43e1=_0x331ad8[_0xa66f('0x2c')][_0xa66f('0x2d')];var _0x70f6da=_0x331ad8['body'][_0xa66f('0x38')];return getAgent(_0x4f43e1)['then'](function(_0x188f54){logger[_0xa66f('0x13')](_0xa66f('0x39'),_0x188f54['name']);emit(util['format'](_0xa66f('0x32'),_0x188f54[_0xa66f('0x1a')]),_0xa66f('0x3e'),{'sessionId':_0x70f6da});return _0x34b5eb[_0xa66f('0x1b')](0xc8)[_0xa66f('0x34')]({'error':![],'message':_0xa66f('0x3f')});})['catch'](handleError(_0x34b5eb));};exports[_0xa66f('0x40')]=function(_0x3bfe9d,_0x4d8008){logger['info'](_0xa66f('0x41'),_0x3bfe9d[_0xa66f('0x2c')]);var _0x31d7c0=holdValidation[_0xa66f('0x2b')](_0x3bfe9d[_0xa66f('0x2c')]);if(_0x31d7c0['length']>0x0){return _0x4d8008[_0xa66f('0x1b')](0x190)[_0xa66f('0x34')](_0x31d7c0);}var _0x3aa272=_0x3bfe9d[_0xa66f('0x2c')][_0xa66f('0x2d')];var _0x50564b=_0x3bfe9d[_0xa66f('0x2c')][_0xa66f('0x38')];return getAgent(_0x3aa272)[_0xa66f('0x1e')](function(_0x2dc004){logger[_0xa66f('0x13')]('entityFound:',_0x2dc004['name']);emit(util[_0xa66f('0x31')](_0xa66f('0x32'),_0x2dc004[_0xa66f('0x1a')]),_0xa66f('0x42'),{'sessionId':_0x50564b});return _0x4d8008[_0xa66f('0x1b')](0xc8)[_0xa66f('0x34')]({'error':![],'message':_0xa66f('0x43')});})[_0xa66f('0x22')](handleError(_0x4d8008));};exports['unhold']=function(_0x396f4c,_0x313075){logger[_0xa66f('0x13')](_0xa66f('0x44'),_0x396f4c[_0xa66f('0x2c')]);var _0x55e402=unholdValidation[_0xa66f('0x2b')](_0x396f4c[_0xa66f('0x2c')]);if(_0x55e402[_0xa66f('0x27')]>0x0){return _0x313075['status'](0x190)['json'](_0x55e402);}var _0x19018f=_0x396f4c[_0xa66f('0x2c')][_0xa66f('0x2d')];var _0x43efba=_0x396f4c[_0xa66f('0x2c')]['sessionId'];return getAgent(_0x19018f)[_0xa66f('0x1e')](function(_0x5852c5){logger[_0xa66f('0x13')](_0xa66f('0x39'),_0x5852c5[_0xa66f('0x1a')]);emit(util['format'](_0xa66f('0x32'),_0x5852c5['name']),_0xa66f('0x45'),{'sessionId':_0x43efba});return _0x313075[_0xa66f('0x1b')](0xc8)[_0xa66f('0x34')]({'error':![],'message':_0xa66f('0x46')});})[_0xa66f('0x22')](handleError(_0x313075));};exports[_0xa66f('0x47')]=function(_0x1f61bd,_0x5f3bb7){logger['info']('calls\x20fired:',_0x5f3bb7[_0xa66f('0x2c')]);var _0x334eca=callsValidation[_0xa66f('0x2b')](_0x1f61bd[_0xa66f('0x2c')]);if(_0x334eca[_0xa66f('0x27')]>0x0){return _0x5f3bb7[_0xa66f('0x1b')](0x190)[_0xa66f('0x34')](_0x334eca);}var _0x49e3e7=_0x1f61bd[_0xa66f('0x2c')]['userId'];var _0x34130a=respondWithRpcPromise(_0xa66f('0x48'));var _0x4dadc9=getAgent(_0x49e3e7);return Promise[_0xa66f('0x24')]([_0x34130a,_0x4dadc9])[_0xa66f('0x1e')](function(_0x3d04aa){var _0x585bca=_0x3d04aa[0x0];var _0x4dbefc=_0x3d04aa[0x1];var _0x5ac6fc=_[_0xa66f('0x49')](_0x585bca['rows'],function(_0x3cf529){return _0x3cf529['UserId']==_0x4dbefc['id'];});return _0x5f3bb7[_0xa66f('0x1b')](0xc8)[_0xa66f('0x34')]({'count':_0x5ac6fc['length'],'rows':_0x5ac6fc});})['catch'](handleError(_0x5f3bb7));};exports['conference']=function(_0x28e782,_0x10b99d){logger[_0xa66f('0x13')](_0xa66f('0x4a'),_0x28e782[_0xa66f('0x2c')]);var _0x4b8359=conferenceValidation[_0xa66f('0x2b')](_0x28e782[_0xa66f('0x2c')]);if(_0x4b8359['length']>0x0){return _0x10b99d['status'](0x190)[_0xa66f('0x34')](_0x4b8359);}var _0xb90573=_0x28e782[_0xa66f('0x2c')][_0xa66f('0x2d')];return getAgent(_0xb90573)[_0xa66f('0x1e')](function(_0x73f124){logger[_0xa66f('0x13')](_0xa66f('0x39'),_0x73f124[_0xa66f('0x1a')]);emit(util[_0xa66f('0x31')](_0xa66f('0x32'),_0x73f124[_0xa66f('0x1a')]),_0xa66f('0x4b'));return _0x10b99d['status'](0xc8)[_0xa66f('0x34')]({'error':![],'message':'conference\x20executed!'});})[_0xa66f('0x22')](handleError(_0x10b99d));};exports[_0xa66f('0x4c')]=function(_0x3b6ba9,_0xc8f303){logger[_0xa66f('0x13')](_0xa66f('0x4d'),_0x3b6ba9[_0xa66f('0x2c')]);var _0x1372ab=transferValidation[_0xa66f('0x2b')](_0x3b6ba9[_0xa66f('0x2c')]);if(_0x1372ab[_0xa66f('0x27')]>0x0){return _0xc8f303[_0xa66f('0x1b')](0x190)[_0xa66f('0x34')](_0x1372ab);}var _0x1d97bf=_0x3b6ba9['body'][_0xa66f('0x2d')];var _0xca003d=_0x3b6ba9[_0xa66f('0x2c')][_0xa66f('0x38')];var _0x5e5d1c=_0x3b6ba9[_0xa66f('0x2c')][_0xa66f('0x4e')];return getAgent(_0x1d97bf)['then'](function(_0x53d290){logger[_0xa66f('0x13')](_0xa66f('0x39'),_0x53d290[_0xa66f('0x1a')]);emit(util[_0xa66f('0x31')]('user:%s',_0x53d290[_0xa66f('0x1a')]),_0xa66f('0x4f'),{'sessionId':_0xca003d,'transferNumber':_0x5e5d1c});return _0xc8f303[_0xa66f('0x1b')](0xc8)[_0xa66f('0x34')]({'error':![],'message':_0xa66f('0x50')});})[_0xa66f('0x22')](handleError(_0xc8f303));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 788a200..1c6a0eb 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 _0xe2fe=['removeAgents','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','send','put','destroy','delete','removeDispositions','removeAnswers'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./whatsappAccount.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0x7')](_0xee2f('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0xee2f('0x8')](),controller['getAnswers']);router['get']('/:id/users',auth[_0xee2f('0x8')](),controller[_0xee2f('0xd')]);router[_0xee2f('0x7')](_0xee2f('0xe'),auth[_0xee2f('0x8')](),controller[_0xee2f('0xf')]);router['post']('/',auth[_0xee2f('0x8')](),controller['create']);router[_0xee2f('0x10')](_0xee2f('0xc'),auth['isAuthenticated'](),controller[_0xee2f('0x11')]);router[_0xee2f('0x10')](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x13')]);router['post'](_0xee2f('0x14'),auth['isAuthenticated'](),controller[_0xee2f('0x15')]);router[_0xee2f('0x10')]('/:id/applications',auth['isAuthenticated'](),controller[_0xee2f('0x16')]);router['post'](_0xee2f('0x17'),controller[_0xee2f('0x18')]);router[_0xee2f('0x10')]('/:id/send',auth[_0xee2f('0x8')](),controller[_0xee2f('0x19')]);router[_0xee2f('0x1a')](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['update']);router['delete'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1b')]);router[_0xee2f('0x1c')](_0xee2f('0xc'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1d')]);router['delete'](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1e')]);router[_0xee2f('0x1c')](_0xee2f('0x14'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1f')]);module[_0xee2f('0x20')]=router; \ No newline at end of file +var _0x5f2f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','post','create','addDisposition','/:id/canned_answers','addAnswer','addAgents','addApplications','/:id/notify','notify','send','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2fb371,_0x37bc4e){_0x2fb371=_0x2fb371-0x0;var _0x363509=_0x5f2f[_0x2fb371];return _0x363509;};'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/canned_answers',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['get'](_0xf5f2('0x13'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);router[_0xf5f2('0x9')](_0xf5f2('0x15'),auth[_0xf5f2('0xa')](),controller['getApplications']);router[_0xf5f2('0x16')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x17')]);router[_0xf5f2('0x16')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x18')]);router[_0xf5f2('0x16')](_0xf5f2('0x19'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x16')](_0xf5f2('0x13'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1b')]);router[_0xf5f2('0x16')](_0xf5f2('0x15'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x16')](_0xf5f2('0x1d'),controller[_0xf5f2('0x1e')]);router[_0xf5f2('0x16')]('/:id/send',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1f')]);router['put']('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x20')]);router['delete'](_0xf5f2('0xe'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x21')]);router[_0xf5f2('0x22')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x23')]);router[_0xf5f2('0x22')](_0xf5f2('0x19'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x24')]);router['delete']('/:id/users',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x25')]);module[_0xf5f2('0x26')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 887f9d1..0bfb00b 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 _0xd2cc=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x153b58,_0x57b209){var _0x133465=function(_0x185f89){while(--_0x185f89){_0x153b58['push'](_0x153b58['shift']());}};_0x133465(++_0x57b209);}(_0xd2cc,0x6c));var _0xcd2c=function(_0x4fe17c,_0x3de842){_0x4fe17c=_0x4fe17c-0x0;var _0x14f304=_0xd2cc[_0x4fe17c];return _0x14f304;};'use strict';var Sequelize=require(_0xcd2c('0x0'));var rs=require(_0xcd2c('0x1'));module[_0xcd2c('0x2')]={'name':{'type':Sequelize[_0xcd2c('0x3')],'unique':_0xcd2c('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xcd2c('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xcd2c('0x3')],'defaultValue':function(){return rs[_0xcd2c('0x5')]();}},'phone':{'type':Sequelize[_0xcd2c('0x3')]},'type':{'type':Sequelize[_0xcd2c('0x6')](_0xcd2c('0x7'),'sinch')},'accountSid':{'type':Sequelize[_0xcd2c('0x3')]},'baseUrl':{'type':Sequelize[_0xcd2c('0x3')]},'authToken':{'type':Sequelize[_0xcd2c('0x3')]},'notificationTemplate':{'type':Sequelize[_0xcd2c('0x8')],'defaultValue':function(){return _0xcd2c('0x9');}},'notificationSound':{'type':Sequelize[_0xcd2c('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcd2c('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcd2c('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcd2c('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcd2c('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcd2c('0xb')],'comment':_0xcd2c('0xc')},'mandatoryDisposition':{'type':Sequelize[_0xcd2c('0xa')],'defaultValue':![],'comment':_0xcd2c('0xd'),'set':function(_0x4c465f){if(!_0x4c465f){this[_0xcd2c('0xe')]('mandatoryDispositionPauseId',null);}this[_0xcd2c('0xe')]('mandatoryDisposition',_0x4c465f);}},'description':{'type':Sequelize[_0xcd2c('0x3')]}}; \ No newline at end of file +var _0x8c92=['STRING','name','generate','ENUM','sinch','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports'];(function(_0x90c2f3,_0x53ff43){var _0x42604c=function(_0x43e6a6){while(--_0x43e6a6){_0x90c2f3['push'](_0x90c2f3['shift']());}};_0x42604c(++_0x53ff43);}(_0x8c92,0x97));var _0x28c9=function(_0x2f4069,_0x74eb6c){_0x2f4069=_0x2f4069-0x0;var _0x4e5d90=_0x8c92[_0x2f4069];return _0x4e5d90;};'use strict';var Sequelize=require(_0x28c9('0x0'));var rs=require(_0x28c9('0x1'));module[_0x28c9('0x2')]={'name':{'type':Sequelize[_0x28c9('0x3')],'unique':_0x28c9('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x28c9('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x28c9('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x28c9('0x3')],'defaultValue':function(){return rs[_0x28c9('0x5')]();}},'phone':{'type':Sequelize[_0x28c9('0x3')]},'type':{'type':Sequelize[_0x28c9('0x6')]('twilio',_0x28c9('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x28c9('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x28c9('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x28c9('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x28c9('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x28c9('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x28c9('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x28c9('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x28c9('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x28c9('0x9')],'defaultValue':![],'comment':_0x28c9('0xb'),'set':function(_0x1e40d3){if(!_0x1e40d3){this[_0x28c9('0xc')](_0x28c9('0xd'),null);}this[_0x28c9('0xc')]('mandatoryDisposition',_0x1e40d3);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 331c2fb..0228bd4 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 _0xeea0=['debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','include','rows','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','rawAttributes','nolimit','sort','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','length','addAgents','omit','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','stack','finally','getApplications','notify','whatsapp','account','sinch','statuses','state','read','timestamp','orderBy','priority','Applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','message_id','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','Contacts','WhatsappInteraction','interaction','created','autoclose','push','applications','close','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','info','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','CmList','List','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x2302f0,_0x1afef2){var _0x23db84=function(_0x6ad1be){while(--_0x6ad1be){_0x2302f0['push'](_0x2302f0['shift']());}};_0x23db84(++_0x1afef2);}(_0xeea0,0x16f));var _0x0eea=function(_0x53fc64,_0x55e067){_0x53fc64=_0x53fc64-0x0;var _0x21c1e7=_0xeea0[_0x53fc64];return _0x21c1e7;};'use strict';var emlformat=require(_0x0eea('0x0'));var rimraf=require(_0x0eea('0x1'));var zipdir=require(_0x0eea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0eea('0x3'));var moment=require(_0x0eea('0x4'));var BPromise=require(_0x0eea('0x5'));var Mustache=require(_0x0eea('0x6'));var util=require(_0x0eea('0x7'));var path=require(_0x0eea('0x8'));var sox=require(_0x0eea('0x9'));var csv=require(_0x0eea('0xa'));var ejs=require(_0x0eea('0xb'));var fs=require('fs');var fs_extra=require(_0x0eea('0xc'));var _=require(_0x0eea('0xd'));var squel=require(_0x0eea('0xe'));var crypto=require(_0x0eea('0xf'));var jsforce=require(_0x0eea('0x10'));var deskjs=require(_0x0eea('0x11'));var toCsv=require(_0x0eea('0xa'));var querystring=require(_0x0eea('0x12'));var Papa=require('papaparse');var Redis=require(_0x0eea('0x13'));var authService=require(_0x0eea('0x14'));var qs=require(_0x0eea('0x15'));var as=require(_0x0eea('0x16'));var hardwareService=require(_0x0eea('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0eea('0x18'));var licenseUtil=require(_0x0eea('0x19'));var db=require(_0x0eea('0x1a'))['db'];config['redis']=_[_0x0eea('0x1b')](config[_0x0eea('0x1c')],{'host':_0x0eea('0x1d'),'port':0x18eb});var socket=require(_0x0eea('0x1e'))(new Redis(config[_0x0eea('0x1c')]));require(_0x0eea('0x1f'))[_0x0eea('0x20')](socket);var jayson=require(_0x0eea('0x21'));var client=jayson['client'][_0x0eea('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x10dd77,_0x225aeb,_0x4e2f60,_0x439e98){return new BPromise(function(_0x291aa1,_0x901d54){var _0x13e263=_0x439e98||client;return _0x13e263[_0x0eea('0x23')](_0x10dd77,_0x4e2f60)[_0x0eea('0x24')](function(_0x120b42){logger['info'](_0x0eea('0x25'),_0x225aeb,_0x0eea('0x26'));logger[_0x0eea('0x27')](_0x0eea('0x28'),_0x225aeb,'request\x20sent',JSON[_0x0eea('0x29')](_0x120b42));if(_0x120b42[_0x0eea('0x2a')]){if(_0x120b42[_0x0eea('0x2a')][_0x0eea('0x2b')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x225aeb,_0x120b42[_0x0eea('0x2a')]['message']);return _0x901d54(_0x120b42[_0x0eea('0x2a')][_0x0eea('0x2c')]);}logger[_0x0eea('0x2a')](_0x0eea('0x25'),_0x225aeb,_0x120b42['error']['message']);return _0x291aa1(_0x120b42[_0x0eea('0x2a')][_0x0eea('0x2c')]);}else{logger['info'](_0x0eea('0x25'),_0x225aeb,_0x0eea('0x26'));_0x291aa1(_0x120b42[_0x0eea('0x2d')]['message']);}})[_0x0eea('0x2e')](function(_0x55350c){logger[_0x0eea('0x2a')]('WhatsappAccount,\x20%s,\x20%s',_0x225aeb,_0x55350c);_0x901d54(_0x55350c);});});}function respondWithStatusCode(_0x1db7a8,_0x139c39){_0x139c39=_0x139c39||0xcc;return function(_0x5501ff){if(_0x5501ff){return _0x1db7a8[_0x0eea('0x2f')](_0x139c39);}return _0x1db7a8[_0x0eea('0x30')](_0x139c39)[_0x0eea('0x31')]();};}function respondWithResult(_0x47eb95,_0x1c19a7){_0x1c19a7=_0x1c19a7||0xc8;return function(_0x539317){if(_0x539317){return _0x47eb95[_0x0eea('0x30')](_0x1c19a7)[_0x0eea('0x32')](_0x539317);}};}function respondWithFilteredResult(_0x2dc032,_0x5ec7af){return function(_0x3c6df7){if(_0x3c6df7){var _0x4b7083=typeof _0x5ec7af[_0x0eea('0x33')]===_0x0eea('0x34')&&typeof _0x5ec7af[_0x0eea('0x35')]===_0x0eea('0x34');var _0x34beda=_0x3c6df7[_0x0eea('0x36')];var _0x531f32=_0x4b7083?0x0:_0x5ec7af[_0x0eea('0x33')];var _0x34272a=_0x4b7083?_0x3c6df7[_0x0eea('0x36')]:_0x5ec7af[_0x0eea('0x33')]+_0x5ec7af[_0x0eea('0x35')];var _0x12225d;if(_0x34272a>=_0x34beda){_0x34272a=_0x34beda;_0x12225d=0xc8;}else{_0x12225d=0xce;}_0x2dc032[_0x0eea('0x30')](_0x12225d);return _0x2dc032['set'](_0x0eea('0x37'),_0x531f32+'-'+_0x34272a+'/'+_0x34beda)['json'](_0x3c6df7);}return null;};}function patchUpdates(_0xd007b8){return function(_0x11a849){try{jsonpatch[_0x0eea('0x38')](_0x11a849,_0xd007b8,!![]);}catch(_0x35c27f){return BPromise[_0x0eea('0x39')](_0x35c27f);}return _0x11a849[_0x0eea('0x3a')]();};}function saveUpdates(_0x984dd5,_0x3a5353){return function(_0x185504){if(_0x185504){return _0x185504[_0x0eea('0x3b')](_0x984dd5)['then'](function(_0x5cdd1d){return _0x5cdd1d;});}return null;};}function removeEntity(_0x1fbf55,_0x47bc2c){return function(_0x21ca1b){if(_0x21ca1b){return _0x21ca1b[_0x0eea('0x3c')]()[_0x0eea('0x24')](function(){var _0x5a9f68=_0x21ca1b[_0x0eea('0x3d')]({'plain':!![]});var _0x51999e=_0x0eea('0x3e');return db[_0x0eea('0x3f')]['destroy']({'where':{'type':_0x51999e,'resourceId':_0x5a9f68['id']}})['then'](function(){return _0x21ca1b;});})[_0x0eea('0x24')](function(){_0x1fbf55[_0x0eea('0x30')](0xcc)[_0x0eea('0x31')]();});}};}function handleEntityNotFound(_0x4a7b82,_0x17d60a){return function(_0x36b88e){if(!_0x36b88e){_0x4a7b82[_0x0eea('0x2f')](0x194);}return _0x36b88e;};}function handleError(_0x481662,_0x38ffe6){_0x38ffe6=_0x38ffe6||0x1f4;return function(_0x3974a8){logger[_0x0eea('0x2a')](_0x3974a8['stack']);if(_0x3974a8[_0x0eea('0x40')]){delete _0x3974a8[_0x0eea('0x40')];}_0x481662[_0x0eea('0x30')](_0x38ffe6)[_0x0eea('0x41')](_0x3974a8);};}exports[_0x0eea('0x42')]=function(_0x3d89c3,_0x10c99f){var _0xce5784={'include':[{'model':db[_0x0eea('0x43')],'as':_0x0eea('0x44')}]},_0x1a4e59={},_0x5886cc={'count':0x0,'rows':[]};var _0xd5b3bf=_[_0x0eea('0x45')](db[_0x0eea('0x46')]['rawAttributes'],function(_0x2f7492){return{'name':_0x2f7492[_0x0eea('0x47')],'type':_0x2f7492['type'][_0x0eea('0x48')]};});_0x1a4e59['model']=_['map'](_0xd5b3bf,_0x0eea('0x40'));_0x1a4e59[_0x0eea('0x49')]=_[_0x0eea('0x4a')](_0x3d89c3['query']);_0x1a4e59[_0x0eea('0x4b')]=_[_0x0eea('0x4c')](_0x1a4e59[_0x0eea('0x4d')],_0x1a4e59[_0x0eea('0x49')]);_0xce5784['attributes']=_[_0x0eea('0x4c')](_0x1a4e59[_0x0eea('0x4d')],qs[_0x0eea('0x4e')](_0x3d89c3[_0x0eea('0x49')][_0x0eea('0x4e')]));_0xce5784['attributes']=_0xce5784['attributes']['length']?_0xce5784[_0x0eea('0x4f')]:_0x1a4e59[_0x0eea('0x4d')];if(!_0x3d89c3[_0x0eea('0x49')][_0x0eea('0x50')]('nolimit')){_0xce5784['limit']=qs[_0x0eea('0x35')](_0x3d89c3[_0x0eea('0x49')][_0x0eea('0x35')]);_0xce5784[_0x0eea('0x33')]=qs[_0x0eea('0x33')](_0x3d89c3[_0x0eea('0x49')][_0x0eea('0x33')]);}_0xce5784[_0x0eea('0x51')]=qs['sort'](_0x3d89c3[_0x0eea('0x49')]['sort']);_0xce5784[_0x0eea('0x52')]=qs[_0x0eea('0x4b')](_[_0x0eea('0x53')](_0x3d89c3['query'],_0x1a4e59[_0x0eea('0x4b')]),_0xd5b3bf);if(_0x3d89c3['query'][_0x0eea('0x54')]){_0xce5784[_0x0eea('0x52')]=_[_0x0eea('0x55')](_0xce5784[_0x0eea('0x52')],{'$or':_[_0x0eea('0x45')](_0xd5b3bf,function(_0x12fe28){if(_0x12fe28[_0x0eea('0x56')]!==_0x0eea('0x57')){var _0x595134={};_0x595134[_0x12fe28[_0x0eea('0x40')]]={'$like':'%'+_0x3d89c3[_0x0eea('0x49')][_0x0eea('0x54')]+'%'};return _0x595134;}})});}_0xce5784=_['merge']({},_0xce5784,_0x3d89c3[_0x0eea('0x58')]);var _0x2cae99={'where':_0xce5784[_0x0eea('0x52')]};return db[_0x0eea('0x46')]['count'](_0x2cae99)[_0x0eea('0x24')](function(_0x1d3d59){_0x5886cc[_0x0eea('0x36')]=_0x1d3d59;if(_0x3d89c3[_0x0eea('0x49')]['includeAll']){_0xce5784[_0x0eea('0x59')]=[{'all':!![]}];}return db[_0x0eea('0x46')]['findAll'](_0xce5784);})[_0x0eea('0x24')](function(_0x3ef5d4){_0x5886cc[_0x0eea('0x5a')]=_0x3ef5d4;return _0x5886cc;})[_0x0eea('0x24')](respondWithFilteredResult(_0x10c99f,_0xce5784))[_0x0eea('0x2e')](handleError(_0x10c99f,null));};exports['show']=function(_0x3c09cf,_0x135ce2){var _0x2a18c6={'raw':![],'where':{'id':_0x3c09cf[_0x0eea('0x5b')]['id']},'include':[{'model':db[_0x0eea('0x43')],'as':_0x0eea('0x44')}]},_0x49fa81={};_0x49fa81['model']=_[_0x0eea('0x4a')](db[_0x0eea('0x46')]['rawAttributes']);_0x49fa81['query']=_[_0x0eea('0x4a')](_0x3c09cf[_0x0eea('0x49')]);_0x49fa81[_0x0eea('0x4b')]=_[_0x0eea('0x4c')](_0x49fa81[_0x0eea('0x4d')],_0x49fa81[_0x0eea('0x49')]);_0x2a18c6[_0x0eea('0x4f')]=_[_0x0eea('0x4c')](_0x49fa81[_0x0eea('0x4d')],qs['fields'](_0x3c09cf['query'][_0x0eea('0x4e')]));_0x2a18c6[_0x0eea('0x4f')]=_0x2a18c6['attributes']['length']?_0x2a18c6[_0x0eea('0x4f')]:_0x49fa81[_0x0eea('0x4d')];if(_0x3c09cf['query'][_0x0eea('0x5c')]){_0x2a18c6[_0x0eea('0x59')]=[{'all':!![]}];}_0x2a18c6=_['merge']({},_0x2a18c6,_0x3c09cf[_0x0eea('0x58')]);return db[_0x0eea('0x46')][_0x0eea('0x5d')](_0x2a18c6)[_0x0eea('0x24')](handleEntityNotFound(_0x135ce2,null))['then'](respondWithResult(_0x135ce2,null))['catch'](handleError(_0x135ce2,null));};exports[_0x0eea('0x5e')]=function(_0x1966b8,_0x43b489){return db['WhatsappAccount'][_0x0eea('0x5e')](_0x1966b8[_0x0eea('0x5f')],{})['then'](function(_0x4c3323){var _0x334b62=_0x1966b8[_0x0eea('0x60')][_0x0eea('0x3d')]({'plain':!![]});if(!_0x334b62)throw new Error(_0x0eea('0x61'));if(_0x334b62[_0x0eea('0x62')]==='user'){var _0x44bd20=_0x4c3323[_0x0eea('0x3d')]({'plain':!![]});var _0x167fa2='WhatsappAccounts';return db[_0x0eea('0x63')][_0x0eea('0x5d')]({'where':{'name':_0x167fa2,'userProfileId':_0x334b62['userProfileId']},'raw':!![]})['then'](function(_0x521db4){if(_0x521db4&&_0x521db4[_0x0eea('0x64')]===0x0){return db[_0x0eea('0x3f')][_0x0eea('0x5e')]({'name':_0x44bd20[_0x0eea('0x40')],'resourceId':_0x44bd20['id'],'type':_0x521db4[_0x0eea('0x40')],'sectionId':_0x521db4['id']},{})['then'](function(){return _0x4c3323;});}else{return _0x4c3323;}})['catch'](function(_0x5421b7){logger['error'](_0x0eea('0x65'),_0x5421b7);throw _0x5421b7;});}return _0x4c3323;})['then'](respondWithResult(_0x43b489,0xc9))['catch'](handleError(_0x43b489,null));};exports[_0x0eea('0x3b')]=function(_0xf00e48,_0x5e479d){if(_0xf00e48[_0x0eea('0x5f')]['id']){delete _0xf00e48[_0x0eea('0x5f')]['id'];}return db['WhatsappAccount'][_0x0eea('0x5d')]({'where':{'id':_0xf00e48[_0x0eea('0x5b')]['id']},'include':[{'model':db[_0x0eea('0x43')],'as':_0x0eea('0x44')}]})[_0x0eea('0x24')](handleEntityNotFound(_0x5e479d,null))[_0x0eea('0x24')](saveUpdates(_0xf00e48[_0x0eea('0x5f')],null))[_0x0eea('0x24')](respondWithResult(_0x5e479d,null))[_0x0eea('0x2e')](handleError(_0x5e479d,null));};exports[_0x0eea('0x3c')]=function(_0xe2cb76,_0x5a484f){return db[_0x0eea('0x46')]['find']({'where':{'id':_0xe2cb76[_0x0eea('0x5b')]['id']}})[_0x0eea('0x24')](handleEntityNotFound(_0x5a484f,null))[_0x0eea('0x24')](removeEntity(_0x5a484f,null))[_0x0eea('0x2e')](handleError(_0x5a484f,null));};exports[_0x0eea('0x66')]=function(_0x188989,_0x2e8f55){return db[_0x0eea('0x46')][_0x0eea('0x66')]()[_0x0eea('0x24')](respondWithResult(_0x2e8f55,null))[_0x0eea('0x2e')](handleError(_0x2e8f55,null));};exports[_0x0eea('0x67')]=function(_0x1bbc5b,_0x528671,_0x190dc2){if(_0x1bbc5b['body']['id']){delete _0x1bbc5b[_0x0eea('0x5f')]['id'];}return db[_0x0eea('0x46')][_0x0eea('0x5d')]({'where':{'id':_0x1bbc5b['params']['id']}})[_0x0eea('0x24')](handleEntityNotFound(_0x528671,null))['then'](function(_0x5ad759){if(_0x5ad759){_0x1bbc5b[_0x0eea('0x5f')][_0x0eea('0x68')]=_0x5ad759['id'];return db[_0x0eea('0x69')][_0x0eea('0x5e')](_0x1bbc5b[_0x0eea('0x5f')]);}})[_0x0eea('0x24')](respondWithResult(_0x528671,null))[_0x0eea('0x2e')](handleError(_0x528671,null));};exports[_0x0eea('0x6a')]=function(_0x4b7af6,_0xc2dc6b,_0x350620){var _0x5e729f={'raw':![],'where':{}};var _0x49f264={};var _0x5e3111={'count':0x0,'rows':[]};return db[_0x0eea('0x46')][_0x0eea('0x6b')]({'where':{'id':_0x4b7af6['params']['id']}})[_0x0eea('0x24')](handleEntityNotFound(_0xc2dc6b,null))[_0x0eea('0x24')](function(_0x10c6bb){if(_0x10c6bb){_0x49f264[_0x0eea('0x4d')]=_[_0x0eea('0x4a')](db[_0x0eea('0x69')][_0x0eea('0x6c')]);_0x49f264[_0x0eea('0x49')]=_[_0x0eea('0x4a')](_0x4b7af6[_0x0eea('0x49')]);_0x49f264[_0x0eea('0x4b')]=_['intersection'](_0x49f264[_0x0eea('0x4d')],_0x49f264[_0x0eea('0x49')]);_0x5e729f[_0x0eea('0x4f')]=_[_0x0eea('0x4c')](_0x49f264[_0x0eea('0x4d')],qs[_0x0eea('0x4e')](_0x4b7af6[_0x0eea('0x49')][_0x0eea('0x4e')]));_0x5e729f[_0x0eea('0x4f')]=_0x5e729f[_0x0eea('0x4f')]['length']?_0x5e729f[_0x0eea('0x4f')]:_0x49f264[_0x0eea('0x4d')];if(!_0x4b7af6[_0x0eea('0x49')][_0x0eea('0x50')](_0x0eea('0x6d'))){_0x5e729f[_0x0eea('0x35')]=qs[_0x0eea('0x35')](_0x4b7af6[_0x0eea('0x49')][_0x0eea('0x35')]);_0x5e729f['offset']=qs[_0x0eea('0x33')](_0x4b7af6['query'][_0x0eea('0x33')]);}_0x5e729f[_0x0eea('0x51')]=qs[_0x0eea('0x6e')](_0x4b7af6[_0x0eea('0x49')][_0x0eea('0x6e')]);_0x5e729f[_0x0eea('0x52')]=qs[_0x0eea('0x4b')](_[_0x0eea('0x53')](_0x4b7af6[_0x0eea('0x49')],_0x49f264[_0x0eea('0x4b')]));_0x5e729f['where'][_0x0eea('0x68')]=_0x10c6bb['id'];if(_0x4b7af6['query'][_0x0eea('0x54')]){_0x5e729f['where']=_[_0x0eea('0x55')](_0x5e729f[_0x0eea('0x52')],{'$or':_[_0x0eea('0x45')](_0x5e729f['attributes'],function(_0x2b32e9){var _0xf0cd86={};_0xf0cd86[_0x2b32e9]={'$like':'%'+_0x4b7af6['query']['filter']+'%'};return _0xf0cd86;})});}_0x5e729f=_[_0x0eea('0x55')]({},_0x5e729f,_0x4b7af6[_0x0eea('0x58')]);return db[_0x0eea('0x69')][_0x0eea('0x36')]({'where':_0x5e729f['where']})['then'](function(_0xf05881){_0x5e3111[_0x0eea('0x36')]=_0xf05881;if(_0x4b7af6[_0x0eea('0x49')][_0x0eea('0x5c')]){_0x5e729f[_0x0eea('0x59')]=[{'all':!![]}];}return db['Disposition'][_0x0eea('0x6f')](_0x5e729f);})[_0x0eea('0x24')](function(_0x4fe518){_0x5e3111[_0x0eea('0x5a')]=_0x4fe518;return _0x5e3111;});}})[_0x0eea('0x24')](respondWithFilteredResult(_0xc2dc6b,_0x5e729f))[_0x0eea('0x2e')](handleError(_0xc2dc6b,null));};exports['removeDispositions']=function(_0x7a2451,_0x395f4c,_0x4dd524){return db[_0x0eea('0x46')][_0x0eea('0x5d')]({'where':{'id':_0x7a2451[_0x0eea('0x5b')]['id']}})[_0x0eea('0x24')](handleEntityNotFound(_0x395f4c,null))[_0x0eea('0x24')](function(_0x2bc920){if(_0x2bc920){return _0x2bc920[_0x0eea('0x70')](_0x7a2451[_0x0eea('0x49')][_0x0eea('0x71')]);}})[_0x0eea('0x24')](respondWithStatusCode(_0x395f4c,null))[_0x0eea('0x2e')](handleError(_0x395f4c,null));};exports[_0x0eea('0x72')]=function(_0x5db721,_0x588fe9,_0x504cff){if(_0x5db721[_0x0eea('0x5f')]['id']){delete _0x5db721['body']['id'];}return db['WhatsappAccount'][_0x0eea('0x5d')]({'where':{'id':_0x5db721[_0x0eea('0x5b')]['id']}})[_0x0eea('0x24')](handleEntityNotFound(_0x588fe9,null))[_0x0eea('0x24')](function(_0x58b081){if(_0x58b081){_0x5db721[_0x0eea('0x5f')][_0x0eea('0x68')]=_0x58b081['id'];return db[_0x0eea('0x73')][_0x0eea('0x5e')](_0x5db721['body']);}})['then'](respondWithResult(_0x588fe9,null))[_0x0eea('0x2e')](handleError(_0x588fe9,null));};exports[_0x0eea('0x74')]=function(_0x2fed22,_0x223152,_0x3e1dd0){var _0x444e93={'raw':![],'where':{}};var _0x524f22={};var _0x383d11={'count':0x0,'rows':[]};return db[_0x0eea('0x46')]['findOne']({'where':{'id':_0x2fed22[_0x0eea('0x5b')]['id']}})[_0x0eea('0x24')](handleEntityNotFound(_0x223152,null))[_0x0eea('0x24')](function(_0x2d928d){if(_0x2d928d){_0x524f22[_0x0eea('0x4d')]=_[_0x0eea('0x4a')](db['CannedAnswer']['rawAttributes']);_0x524f22[_0x0eea('0x49')]=_['keys'](_0x2fed22[_0x0eea('0x49')]);_0x524f22[_0x0eea('0x4b')]=_[_0x0eea('0x4c')](_0x524f22['model'],_0x524f22[_0x0eea('0x49')]);_0x444e93[_0x0eea('0x4f')]=_[_0x0eea('0x4c')](_0x524f22[_0x0eea('0x4d')],qs[_0x0eea('0x4e')](_0x2fed22[_0x0eea('0x49')]['fields']));_0x444e93['attributes']=_0x444e93[_0x0eea('0x4f')][_0x0eea('0x75')]?_0x444e93[_0x0eea('0x4f')]:_0x524f22[_0x0eea('0x4d')];if(!_0x2fed22['query'][_0x0eea('0x50')](_0x0eea('0x6d'))){_0x444e93[_0x0eea('0x35')]=qs['limit'](_0x2fed22['query']['limit']);_0x444e93[_0x0eea('0x33')]=qs[_0x0eea('0x33')](_0x2fed22[_0x0eea('0x49')][_0x0eea('0x33')]);}_0x444e93[_0x0eea('0x51')]=qs[_0x0eea('0x6e')](_0x2fed22[_0x0eea('0x49')][_0x0eea('0x6e')]);_0x444e93[_0x0eea('0x52')]=qs[_0x0eea('0x4b')](_[_0x0eea('0x53')](_0x2fed22[_0x0eea('0x49')],_0x524f22[_0x0eea('0x4b')]));_0x444e93[_0x0eea('0x52')][_0x0eea('0x68')]=_0x2d928d['id'];if(_0x2fed22[_0x0eea('0x49')][_0x0eea('0x54')]){_0x444e93[_0x0eea('0x52')]=_[_0x0eea('0x55')](_0x444e93[_0x0eea('0x52')],{'$or':_['map'](_0x444e93['attributes'],function(_0x53692d){var _0x243595={};_0x243595[_0x53692d]={'$like':'%'+_0x2fed22[_0x0eea('0x49')][_0x0eea('0x54')]+'%'};return _0x243595;})});}_0x444e93=_[_0x0eea('0x55')]({},_0x444e93,_0x2fed22['options']);return db[_0x0eea('0x73')][_0x0eea('0x36')]({'where':_0x444e93[_0x0eea('0x52')]})[_0x0eea('0x24')](function(_0x2d4826){_0x383d11[_0x0eea('0x36')]=_0x2d4826;if(_0x2fed22[_0x0eea('0x49')][_0x0eea('0x5c')]){_0x444e93['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x444e93);})['then'](function(_0x2f7a0d){_0x383d11[_0x0eea('0x5a')]=_0x2f7a0d;return _0x383d11;});}})['then'](respondWithFilteredResult(_0x223152,_0x444e93))[_0x0eea('0x2e')](handleError(_0x223152,null));};exports['removeAnswers']=function(_0x3a3573,_0x12d6e0,_0x1290c5){return db['WhatsappAccount'][_0x0eea('0x5d')]({'where':{'id':_0x3a3573[_0x0eea('0x5b')]['id']}})[_0x0eea('0x24')](handleEntityNotFound(_0x12d6e0,null))[_0x0eea('0x24')](function(_0x410ccb){if(_0x410ccb){return _0x410ccb['removeAnswers'](_0x3a3573[_0x0eea('0x49')][_0x0eea('0x71')]);}})[_0x0eea('0x24')](respondWithStatusCode(_0x12d6e0,null))[_0x0eea('0x2e')](handleError(_0x12d6e0,null));};exports[_0x0eea('0x76')]=function(_0x5b778e,_0x1eb40d,_0x54e3b4){return db[_0x0eea('0x46')][_0x0eea('0x5d')]({'where':{'id':_0x5b778e['params']['id']}})['then'](handleEntityNotFound(_0x1eb40d,null))[_0x0eea('0x24')](function(_0x71e10c){if(_0x71e10c){return _0x71e10c[_0x0eea('0x76')](_0x5b778e[_0x0eea('0x5f')][_0x0eea('0x71')],_[_0x0eea('0x77')](_0x5b778e[_0x0eea('0x5f')],[_0x0eea('0x71'),'id'])||{})[_0x0eea('0x78')](function(_0x4fc207){for(var _0x437b03=0x0;_0x437b03<_0x5b778e[_0x0eea('0x5f')][_0x0eea('0x71')][_0x0eea('0x75')];_0x437b03+=0x1){socket[_0x0eea('0x79')]('userWhatsappAccount:save',{'UserId':Number(_0x5b778e[_0x0eea('0x5f')][_0x0eea('0x71')][_0x437b03]),'WhatsappAccountId':Number(_0x5b778e[_0x0eea('0x5b')]['id'])});}return _0x4fc207;});}})['then'](respondWithResult(_0x1eb40d,null))[_0x0eea('0x2e')](handleError(_0x1eb40d,null));};exports[_0x0eea('0x7a')]=function(_0x4fc1a0,_0x25c410,_0x3bacee){return db[_0x0eea('0x46')][_0x0eea('0x5d')]({'where':{'id':_0x4fc1a0[_0x0eea('0x5b')]['id']}})['then'](handleEntityNotFound(_0x25c410,null))[_0x0eea('0x24')](function(_0xe66e7){if(_0xe66e7){return _0xe66e7[_0x0eea('0x7a')](_0x4fc1a0[_0x0eea('0x49')][_0x0eea('0x71')])[_0x0eea('0x24')](function(){if(_['isArray'](_0x4fc1a0['query'][_0x0eea('0x71')])){for(var _0x271d86=0x0;_0x271d86<_0x4fc1a0['query'][_0x0eea('0x71')][_0x0eea('0x75')];_0x271d86+=0x1){socket['emit'](_0x0eea('0x7b'),{'UserId':Number(_0x4fc1a0[_0x0eea('0x49')]['ids'][_0x271d86]),'WhatsappAccountId':Number(_0x4fc1a0[_0x0eea('0x5b')]['id'])});}}else{socket[_0x0eea('0x79')]('userWhatsappAccount:remove',{'UserId':Number(_0x4fc1a0['query'][_0x0eea('0x71')]),'WhatsappAccountId':Number(_0x4fc1a0[_0x0eea('0x5b')]['id'])});}});}})[_0x0eea('0x24')](respondWithStatusCode(_0x25c410,null))[_0x0eea('0x2e')](handleError(_0x25c410,null));};exports[_0x0eea('0x7c')]=function(_0x146e72,_0x26bc2d,_0x4a943a){var _0x143b93={};var _0x2e9e05={};var _0x154a6d;var _0x18af18;return db[_0x0eea('0x46')]['findOne']({'where':{'id':_0x146e72[_0x0eea('0x5b')]['id']}})[_0x0eea('0x24')](handleEntityNotFound(_0x26bc2d,null))['then'](function(_0x37d0cb){if(_0x37d0cb){_0x154a6d=_0x37d0cb;_0x2e9e05[_0x0eea('0x4d')]=_[_0x0eea('0x4a')](db['User'][_0x0eea('0x6c')]);_0x2e9e05['query']=_[_0x0eea('0x4a')](_0x146e72[_0x0eea('0x49')]);_0x2e9e05[_0x0eea('0x4b')]=_[_0x0eea('0x4c')](_0x2e9e05[_0x0eea('0x4d')],_0x2e9e05[_0x0eea('0x49')]);_0x143b93['attributes']=_[_0x0eea('0x4c')](_0x2e9e05[_0x0eea('0x4d')],qs[_0x0eea('0x4e')](_0x146e72[_0x0eea('0x49')][_0x0eea('0x4e')]));_0x143b93[_0x0eea('0x4f')]=_0x143b93[_0x0eea('0x4f')]['length']?_0x143b93[_0x0eea('0x4f')]:_0x2e9e05[_0x0eea('0x4d')];_0x143b93[_0x0eea('0x51')]=qs[_0x0eea('0x6e')](_0x146e72[_0x0eea('0x49')][_0x0eea('0x6e')]);_0x143b93[_0x0eea('0x52')]=qs[_0x0eea('0x4b')](_[_0x0eea('0x53')](_0x146e72[_0x0eea('0x49')],_0x2e9e05[_0x0eea('0x4b')]));if(_0x146e72[_0x0eea('0x49')]['filter']){_0x143b93[_0x0eea('0x52')]=_[_0x0eea('0x55')](_0x143b93['where'],{'$or':_[_0x0eea('0x45')](_0x143b93[_0x0eea('0x4f')],function(_0x1bcc5f){var _0xc3d12a={};_0xc3d12a[_0x1bcc5f]={'$like':'%'+_0x146e72['query'][_0x0eea('0x54')]+'%'};return _0xc3d12a;})});}_0x143b93=_[_0x0eea('0x55')]({},_0x143b93,_0x146e72['options']);return _0x154a6d[_0x0eea('0x7c')](_0x143b93);}})[_0x0eea('0x24')](function(_0x1cacb){if(_0x1cacb){_0x18af18=_0x1cacb['length'];if(!_0x146e72['query'][_0x0eea('0x50')]('nolimit')){_0x143b93[_0x0eea('0x35')]=qs[_0x0eea('0x35')](_0x146e72[_0x0eea('0x49')][_0x0eea('0x35')]);_0x143b93[_0x0eea('0x33')]=qs[_0x0eea('0x33')](_0x146e72[_0x0eea('0x49')]['offset']);}return _0x154a6d['getAgents'](_0x143b93);}})[_0x0eea('0x24')](function(_0x4bd431){if(_0x4bd431){return _0x4bd431?{'count':_0x18af18,'rows':_0x4bd431}:null;}})[_0x0eea('0x24')](respondWithResult(_0x26bc2d,null))[_0x0eea('0x2e')](handleError(_0x26bc2d,null));};exports[_0x0eea('0x7d')]=function(_0x1df53a,_0xccd026){var _0x174bef=_0x1df53a['params']['id'];var _0x197279=_0x1df53a[_0x0eea('0x5f')];var _0x3c4832=0xc8;var _0x16cab8=null;return db[_0x0eea('0x7e')]['transaction']({'isolationLevel':db[_0x0eea('0x7e')][_0x0eea('0x7f')][_0x0eea('0x80')][_0x0eea('0x81')]},function(_0x227300){return db[_0x0eea('0x46')][_0x0eea('0x6b')]({'where':{'id':_0x174bef},'transaction':_0x227300})[_0x0eea('0x24')](function(_0x39ed4a){if(_0x39ed4a){return db[_0x0eea('0x82')][_0x0eea('0x3c')]({'where':{'WhatsappAccountId':_0x174bef},'transaction':_0x227300})['then'](function(){var _0x16bbe7=_[_0x0eea('0x45')](_0x197279,function(_0x2bb11c){_0x2bb11c[_0x0eea('0x68')]=_0x174bef;return _0x2bb11c;});return db[_0x0eea('0x82')][_0x0eea('0x83')](_0x16bbe7,{'transaction':_0x227300});});}else{_0x3c4832=0x194;_0x16cab8=[];}});})[_0x0eea('0x24')](function(){if(_0x3c4832!==0x194){return db['WhatsappApplication'][_0x0eea('0x84')]({'where':{'WhatsappAccountId':_0x174bef},'order':'priority'})[_0x0eea('0x24')](function(_0x5a6ed7){_0x16cab8=_0x5a6ed7;});}})[_0x0eea('0x2e')](function(_0xccd27c){_0x3c4832=0x1f4;logger['error'](_0xccd27c[_0x0eea('0x85')]);if(_0xccd27c[_0x0eea('0x40')]){delete _0xccd27c[_0x0eea('0x40')];}_0x16cab8=_0xccd27c;})[_0x0eea('0x86')](function(){if(_0x16cab8===null){_0xccd026[_0x0eea('0x2f')](_0x3c4832);}else{if(_0x3c4832===0x1f4){_0xccd026[_0x0eea('0x30')](_0x3c4832)['send'](_0x16cab8);}else{_0xccd026[_0x0eea('0x30')](_0x3c4832)[_0x0eea('0x32')](_0x16cab8);}}});};exports[_0x0eea('0x87')]=function(_0x24e2fd,_0x2b6216,_0x5df04a){var _0x595922={};var _0xe3768e={};var _0x3f0939;var _0x3d64b3;return db[_0x0eea('0x46')][_0x0eea('0x6b')]({'where':{'id':_0x24e2fd[_0x0eea('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2b6216,null))[_0x0eea('0x24')](function(_0x353741){if(_0x353741){_0x3f0939=_0x353741;_0xe3768e[_0x0eea('0x4d')]=_[_0x0eea('0x4a')](db[_0x0eea('0x82')][_0x0eea('0x6c')]);_0xe3768e[_0x0eea('0x49')]=_[_0x0eea('0x4a')](_0x24e2fd[_0x0eea('0x49')]);_0xe3768e['filters']=_['intersection'](_0xe3768e[_0x0eea('0x4d')],_0xe3768e['query']);_0x595922[_0x0eea('0x4f')]=_['intersection'](_0xe3768e[_0x0eea('0x4d')],qs[_0x0eea('0x4e')](_0x24e2fd[_0x0eea('0x49')][_0x0eea('0x4e')]));_0x595922[_0x0eea('0x4f')]=_0x595922[_0x0eea('0x4f')][_0x0eea('0x75')]?_0x595922[_0x0eea('0x4f')]:_0xe3768e[_0x0eea('0x4d')];_0x595922[_0x0eea('0x51')]=qs[_0x0eea('0x6e')](_0x24e2fd['query'][_0x0eea('0x6e')]);_0x595922[_0x0eea('0x52')]=qs[_0x0eea('0x4b')](_[_0x0eea('0x53')](_0x24e2fd['query'],_0xe3768e['filters']));if(_0x24e2fd[_0x0eea('0x49')][_0x0eea('0x54')]){_0x595922[_0x0eea('0x52')]=_[_0x0eea('0x55')](_0x595922[_0x0eea('0x52')],{'$or':_[_0x0eea('0x45')](_0x595922[_0x0eea('0x4f')],function(_0x2c415d){var _0x450ba3={};_0x450ba3[_0x2c415d]={'$like':'%'+_0x24e2fd[_0x0eea('0x49')]['filter']+'%'};return _0x450ba3;})});}_0x595922=_['merge']({},_0x595922,_0x24e2fd[_0x0eea('0x58')]);return _0x3f0939[_0x0eea('0x87')](_0x595922);}})[_0x0eea('0x24')](function(_0x37ed12){if(_0x37ed12){_0x3d64b3=_0x37ed12['length'];if(!_0x24e2fd[_0x0eea('0x49')][_0x0eea('0x50')](_0x0eea('0x6d'))){_0x595922[_0x0eea('0x35')]=qs[_0x0eea('0x35')](_0x24e2fd[_0x0eea('0x49')][_0x0eea('0x35')]);_0x595922[_0x0eea('0x33')]=qs['offset'](_0x24e2fd['query'][_0x0eea('0x33')]);}return _0x3f0939['getApplications'](_0x595922);}})[_0x0eea('0x24')](function(_0x144d65){if(_0x144d65){return _0x144d65?{'count':_0x3d64b3,'rows':_0x144d65}:null;}})[_0x0eea('0x24')](respondWithResult(_0x2b6216,null))[_0x0eea('0x2e')](handleError(_0x2b6216,null));};exports[_0x0eea('0x88')]=function(_0x4487b2,_0x35019a,_0x342ba6){var _0x456dfa={'channel':_0x0eea('0x89')};var _0x21eceb=[];var _0x4a5269=[];var _0x655a5d={};return db['WhatsappAccount'][_0x0eea('0x5d')]({'where':{'id':_0x4487b2[_0x0eea('0x5b')]['id']},'include':[{'model':db[_0x0eea('0x82')],'as':'Applications'}]})[_0x0eea('0x24')](handleEntityNotFound(_0x35019a,null))['then'](function(_0x3cf08d){_0x456dfa['account']=_0x3cf08d;if(_0x456dfa[_0x0eea('0x8a')]&&_0x456dfa[_0x0eea('0x8a')][_0x0eea('0x56')]===_0x0eea('0x8b')&&_0x4487b2[_0x0eea('0x5f')][_0x0eea('0x8c')]){if(_0x4487b2[_0x0eea('0x5f')][_0x0eea('0x8c')]['length']===0x0)return;if(_0x4487b2[_0x0eea('0x5f')]['statuses'][0x0][_0x0eea('0x8d')]!==_0x0eea('0x8e'))return;return db['WhatsappMessage'][_0x0eea('0x3b')]({'read':!![],'readAt':_0x4487b2[_0x0eea('0x5f')]['statuses'][0x0][_0x0eea('0x8f')]},{'where':{'messageId':_0x4487b2[_0x0eea('0x5f')][_0x0eea('0x8c')][0x0]['message_id']},'individualHooks':!![]})[_0x0eea('0x24')](function(_0x5069ed){return _0x35019a[_0x0eea('0x30')](0xc8)[_0x0eea('0x32')](_0x5069ed);});}_0x456dfa['applications']=_[_0x0eea('0x90')](_0x3cf08d['Applications'],[_0x0eea('0x91')],['asc']);if(_0x456dfa[_0x0eea('0x8a')][_0x0eea('0x92')]){delete _0x456dfa['account']['Applications'];}return db[_0x0eea('0x93')][_0x0eea('0x66')]()[_0x0eea('0x24')](function(_0x422fac){if(!_0x422fac){throw new db[(_0x0eea('0x94'))][(_0x0eea('0x95'))](_0x0eea('0x96'));}_0x21eceb=_[_0x0eea('0x97')](_[_0x0eea('0x4a')](_0x422fac),[_0x0eea('0x98'),_0x0eea('0x99')]);_0x4a5269=_[_0x0eea('0x97')](_[_0x0eea('0x4a')](_0x422fac),['createdAt',_0x0eea('0x99'),'CompanyId','ListId']);_0x456dfa[_0x0eea('0x5f')]={'mapKey':'mobile'};if(_0x456dfa[_0x0eea('0x8a')]&&_0x456dfa['account'][_0x0eea('0x56')]==='twilio'){_0x456dfa['body'][_0x0eea('0x9a')]=_0x4487b2[_0x0eea('0x5f')][_0x0eea('0x9b')][_0x0eea('0x9c')](_0x0eea('0x9d'),'');_0x456dfa['body'][_0x0eea('0x5f')]=_0x4487b2[_0x0eea('0x5f')][_0x0eea('0x9e')];_0x456dfa['body'][_0x0eea('0x9f')]=_0x4487b2[_0x0eea('0x5f')][_0x0eea('0xa0')];}if(_0x456dfa[_0x0eea('0x8a')]&&_0x456dfa[_0x0eea('0x8a')][_0x0eea('0x56')]==='sinch'){_0x456dfa[_0x0eea('0x5f')][_0x0eea('0x9a')]=_0x4487b2['body'][_0x0eea('0xa1')][0x0][_0x0eea('0x9a')];_0x456dfa[_0x0eea('0x5f')][_0x0eea('0x5f')]=_0x4487b2[_0x0eea('0x5f')][_0x0eea('0xa1')][0x0][_0x0eea('0x2c')]['body'];_0x456dfa[_0x0eea('0x5f')][_0x0eea('0x9f')]=_0x4487b2['body'][_0x0eea('0xa1')][0x0][_0x0eea('0xa2')];}if(_0x456dfa['body']['id']){delete _0x456dfa['body']['id'];}if(_[_0x0eea('0xa3')](_0x456dfa['body'][_0x0eea('0x9a')])){throw new db[(_0x0eea('0x94'))][(_0x0eea('0x95'))](_0x0eea('0xa4'));}if(_[_0x0eea('0xa3')](_0x456dfa[_0x0eea('0x5f')][_0x0eea('0x5f')])||_0x456dfa[_0x0eea('0x5f')][_0x0eea('0x5f')]===''){throw new db[(_0x0eea('0x94'))][(_0x0eea('0x95'))](_0x0eea('0xa5'));}if(_[_0x0eea('0xa3')](_0x456dfa[_0x0eea('0x5f')][_0x0eea('0xa6')])){throw new db[(_0x0eea('0x94'))][(_0x0eea('0x95'))](_0x0eea('0xa7')+_0x4a5269);}if(!_[_0x0eea('0xa8')](_0x4a5269,_0x456dfa[_0x0eea('0x5f')]['mapKey'])){throw new db[(_0x0eea('0x94'))][(_0x0eea('0x95'))](_0x0eea('0xa9')+_0x4a5269);}_0x655a5d[_0x456dfa[_0x0eea('0x5f')][_0x0eea('0xa6')]]=_0x456dfa[_0x0eea('0x5f')][_0x0eea('0x9a')];return db['CmList']['find']({'where':{'id':_0x456dfa[_0x0eea('0x8a')][_0x0eea('0xaa')]},'include':[{'model':db[_0x0eea('0x93')],'as':_0x0eea('0xab'),'where':_0x655a5d,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x0eea('0x24')](handleEntityNotFound(_0x35019a,null))[_0x0eea('0x24')](function(_0x5e2214){if(_0x5e2214){_0x456dfa['list']=_[_0x0eea('0x77')](_0x5e2214,['Contacts']);if(_0x5e2214[_0x0eea('0xab')]['length']){return _0x5e2214['Contacts'][0x0];}var _0x591127=_[_0x0eea('0x1b')](_0x456dfa[_0x0eea('0x5f')],{'firstName':_0x456dfa[_0x0eea('0x5f')][_0x0eea('0x9a')],'ListId':_0x5e2214['id']});_0x591127[_0x456dfa[_0x0eea('0x5f')][_0x0eea('0xa6')]]=_0x456dfa[_0x0eea('0x5f')]['from'];return db[_0x0eea('0x93')]['create'](_0x591127,{'fields':_0x21eceb,'raw':!![]});}})[_0x0eea('0x24')](handleEntityNotFound(_0x35019a,null))[_0x0eea('0x24')](function(_0x2c470d){if(_0x2c470d){_0x456dfa['contact']=_0x2c470d;var _0x1978aa={'ContactId':_0x2c470d['id'],'phone':_0x456dfa[_0x0eea('0x5f')][_0x0eea('0x9a')],'WhatsappAccountId':_0x4487b2['params']['id']};var _0x281de9={'ContactId':_0x2c470d['id'],'WhatsappAccountId':_0x4487b2['params']['id'],'closed':![]};return db['WhatsappInteraction'][_0x0eea('0x5d')]({'where':_0x281de9})['then'](function(_0x3fff45){if(_0x3fff45){return[_0x3fff45,![]];}return db[_0x0eea('0xac')][_0x0eea('0x5e')](_0x1978aa)[_0x0eea('0x24')](function(_0xbf7a11){return[_0xbf7a11,!![]];});});}})[_0x0eea('0x78')](function(_0x5203cd,_0x563d20){_0x456dfa[_0x0eea('0xad')]=_0x5203cd['get']({'plain':!![]});_0x456dfa[_0x0eea('0xad')][_0x0eea('0xae')]=![];if(_0x563d20){if(_0x456dfa[_0x0eea('0x8a')][_0x0eea('0xaf')]){_0x456dfa['applications'][_0x0eea('0xb0')]({'id':0x0,'priority':_0x456dfa[_0x0eea('0xb1')][_0x0eea('0x75')]+0x1,'app':_0x0eea('0xb2'),'appdata':'unmanaged','interval':_0x0eea('0xb3')});}_0x456dfa[_0x0eea('0xad')][_0x0eea('0xae')]=!![];}return db[_0x0eea('0xb4')][_0x0eea('0x5e')]({'phone':_0x456dfa[_0x0eea('0x5f')][_0x0eea('0x9a')],'messageId':_0x456dfa[_0x0eea('0x5f')][_0x0eea('0x9f')],'body':_0x456dfa[_0x0eea('0x5f')]['body'],'WhatsappAccountId':_0x4487b2[_0x0eea('0x5b')]['id'],'WhatsappInteractionId':_0x5203cd['id'],'direction':'in','ContactId':_0x5203cd[_0x0eea('0xb5')],'AttachmentId':_0x456dfa[_0x0eea('0x5f')][_0x0eea('0xb6')]});})[_0x0eea('0x24')](function(_0x111844){_0x456dfa[_0x0eea('0x2c')]=_0x111844;if(_0x456dfa['interaction'][_0x0eea('0xb7')]){return db['User'][_0x0eea('0x5d')]({'attributes':['id','name'],'where':{'id':_0x456dfa['interaction'][_0x0eea('0xb7')]}})[_0x0eea('0x24')](function(_0x5f487a){if(_0x5f487a){_0x456dfa[_0x0eea('0xb1')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0eea('0xb8'),'appdata':_0x5f487a[_0x0eea('0x40')]+','+(_0x456dfa[_0x0eea('0x8a')][_0x0eea('0xb9')]||0xa),'interval':_0x0eea('0xb3')});}return respondWithRpcPromise(_0x0eea('0xba'),_0x0eea('0xbb'),_0x456dfa);});}return respondWithRpcPromise(_0x0eea('0xba'),_0x0eea('0xbb'),_0x456dfa);})['then'](function(_0x228b1c){if(_0x228b1c){var _0x597a50=0xc8;var _0x5b9714=_0x0eea('0xbc');logger[_0x0eea('0xbd')](_0x0eea('0x28'),_0x5b9714,_0x597a50,_0x0eea('0xbe'));logger[_0x0eea('0x27')](_0x0eea('0xbf'),_0x5b9714,_0x597a50,_0x0eea('0xbe'),JSON[_0x0eea('0x29')](_0x228b1c));if(_0x456dfa['account'][_0x0eea('0x56')]===_0x0eea('0xc0')){return _0x35019a[_0x0eea('0x30')](_0x597a50)['set'](_0x0eea('0xc1'),_0x0eea('0xc2'))[_0x0eea('0x41')](_0x0eea('0xc3'));}else{return _0x35019a[_0x0eea('0x30')](_0x597a50)[_0x0eea('0x32')](_0x228b1c);}}});})['catch'](handleError(_0x35019a,null));};exports['send']=function(_0x4ad57d,_0x406b89,_0x427cf9){var _0x284b29,_0x171a40,_0x20b354;if(_['isNil'](_0x4ad57d[_0x0eea('0x5f')][_0x0eea('0x5f')])||_0x4ad57d['body']['body']===''){throw new db['Sequelize'][(_0x0eea('0x95'))](_0x0eea('0xa5'));}if(_[_0x0eea('0xa3')](_0x4ad57d['body']['to'])){throw new db[(_0x0eea('0x94'))]['ValidationError'](_0x0eea('0xc4'));}_0x284b29=_0x4ad57d[_0x0eea('0x5f')]['to'];return db[_0x0eea('0x46')][_0x0eea('0x5d')]({'where':{'id':_0x4ad57d[_0x0eea('0x5b')]['id']},'include':[{'model':db[_0x0eea('0xc5')],'as':_0x0eea('0xc6'),'include':[{'model':db['CmContact'],'as':_0x0eea('0xab'),'where':{'mobile':_0x284b29},'limit':0x1,'order':[[_0x0eea('0x99'),_0x0eea('0xc7')]]}]}]})['then'](handleEntityNotFound(_0x406b89,null))[_0x0eea('0x24')](function(_0x42e33c){if(_0x42e33c&&_0x42e33c[_0x0eea('0xc6')]){_0x171a40=_0x42e33c['get']({'plain':!![]});if(_0x171a40[_0x0eea('0xc6')]&&_0x171a40[_0x0eea('0xc6')][_0x0eea('0xab')][_0x0eea('0x75')]){return _0x171a40[_0x0eea('0xc6')][_0x0eea('0xab')][0x0];}return db[_0x0eea('0x93')][_0x0eea('0x5e')](_[_0x0eea('0x1b')](_0x4ad57d[_0x0eea('0x5f')],{'firstName':_0x284b29,'mobile':_0x284b29,'phone':_0x284b29,'ListId':_0x171a40[_0x0eea('0xaa')]}));}})[_0x0eea('0x24')](handleEntityNotFound(_0x406b89,null))[_0x0eea('0x24')](function(_0x471524){if(_0x471524){_0x20b354=_0x471524;return db[_0x0eea('0xac')][_0x0eea('0x5d')]({'where':{'ContactId':_0x20b354['id'],'closed':![],'WhatsappAccountId':_0x171a40['id']}})[_0x0eea('0x24')](function(_0x454fcd){if(_0x454fcd){return[_0x454fcd,![]];}return db['WhatsappInteraction'][_0x0eea('0x5e')]({'UserId':_0x4ad57d[_0x0eea('0x60')]['id'],'ContactId':_0x20b354['id'],'WhatsappAccountId':_0x171a40['id'],'phone':_0x284b29,'firstMsgDirection':_0x0eea('0xc8'),'Messages':[_['merge'](_0x4ad57d[_0x0eea('0x5f')],{'read':![],'body':_0x4ad57d[_0x0eea('0x5f')][_0x0eea('0x5f')],'phone':_0x284b29,'WhatsappAccountId':_0x171a40['id'],'UserId':_0x4ad57d[_0x0eea('0x60')]['id'],'ContactId':_0x20b354['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x0eea('0xc9')}]})[_0x0eea('0x24')](function(_0x3fbd79){return[_0x3fbd79,!![]];});});}})[_0x0eea('0x78')](function(_0x21ece0,_0x7bb50){if(_0x7bb50){return _0x21ece0;}return db[_0x0eea('0xb4')]['create'](_[_0x0eea('0x55')](_0x4ad57d['body'],{'read':![],'body':_0x4ad57d[_0x0eea('0x5f')][_0x0eea('0x5f')],'phone':_0x284b29,'WhatsappAccountId':_0x171a40['id'],'WhatsappInteractionId':_0x21ece0['id'],'UserId':_0x4ad57d[_0x0eea('0x60')]['id'],'ContactId':_0x20b354['id']}))[_0x0eea('0x24')](function(_0x3bcf48){_0x21ece0['dataValues']['Messages']=[];_0x21ece0[_0x0eea('0xca')]['Messages'][_0x0eea('0xb0')](_0x3bcf48[_0x0eea('0xca')]);return _0x21ece0;});})['then'](respondWithResult(_0x406b89,null))[_0x0eea('0x2e')](handleError(_0x406b89,null));}; \ No newline at end of file +var _0xbcf8=['client','http','then','info','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','undefined','limit','count','offset','Content-Range','json','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','findAll','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','pick','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','ids','addAgents','spread','emit','removeAgents','userWhatsappAccount:remove','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','finally','getApplications','notify','Applications','account','statuses','state','read','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','replace','whatsapp:','Body','messageId','MessageSid','sinch','notifications','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','list','defaults','contact','interaction','created','autoclose','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','DESC','WhatsappInteraction','out','Messages','dataValues','push','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','./whatsappAccount.socket'];(function(_0x283495,_0x1bc000){var _0x2776f8=function(_0x3a1f97){while(--_0x3a1f97){_0x283495['push'](_0x283495['shift']());}};_0x2776f8(++_0x1bc000);}(_0xbcf8,0x166));var _0x8bcf=function(_0x4e1814,_0x54b545){_0x4e1814=_0x4e1814-0x0;var _0x26eecd=_0xbcf8[_0x4e1814];return _0x26eecd;};'use strict';var emlformat=require(_0x8bcf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8bcf('0x1'));var jsonpatch=require(_0x8bcf('0x2'));var rp=require(_0x8bcf('0x3'));var moment=require(_0x8bcf('0x4'));var BPromise=require(_0x8bcf('0x5'));var Mustache=require(_0x8bcf('0x6'));var util=require(_0x8bcf('0x7'));var path=require(_0x8bcf('0x8'));var sox=require(_0x8bcf('0x9'));var csv=require('to-csv');var ejs=require(_0x8bcf('0xa'));var fs=require('fs');var fs_extra=require(_0x8bcf('0xb'));var _=require('lodash');var squel=require(_0x8bcf('0xc'));var crypto=require('crypto');var jsforce=require(_0x8bcf('0xd'));var deskjs=require(_0x8bcf('0xe'));var toCsv=require(_0x8bcf('0xf'));var querystring=require(_0x8bcf('0x10'));var Papa=require(_0x8bcf('0x11'));var Redis=require(_0x8bcf('0x12'));var authService=require(_0x8bcf('0x13'));var qs=require(_0x8bcf('0x14'));var as=require(_0x8bcf('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bcf('0x16'))(_0x8bcf('0x17'));var utils=require(_0x8bcf('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8bcf('0x19'))['db'];config[_0x8bcf('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8bcf('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8bcf('0x1c')][_0x8bcf('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x58be48,_0x52eef1,_0x2e16d8,_0xc479a6){return new BPromise(function(_0x4f4db4,_0x47c3d5){var _0xf9804f=_0xc479a6||client;return _0xf9804f['request'](_0x58be48,_0x2e16d8)[_0x8bcf('0x1e')](function(_0x555a7d){logger[_0x8bcf('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x52eef1,'request\x20sent');logger['debug'](_0x8bcf('0x20'),_0x52eef1,_0x8bcf('0x21'),JSON[_0x8bcf('0x22')](_0x555a7d));if(_0x555a7d[_0x8bcf('0x23')]){if(_0x555a7d[_0x8bcf('0x23')][_0x8bcf('0x24')]===0x1f4){logger['error'](_0x8bcf('0x25'),_0x52eef1,_0x555a7d['error'][_0x8bcf('0x26')]);return _0x47c3d5(_0x555a7d['error'][_0x8bcf('0x26')]);}logger[_0x8bcf('0x23')](_0x8bcf('0x25'),_0x52eef1,_0x555a7d['error']['message']);return _0x4f4db4(_0x555a7d['error'][_0x8bcf('0x26')]);}else{logger[_0x8bcf('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x52eef1,_0x8bcf('0x21'));_0x4f4db4(_0x555a7d[_0x8bcf('0x27')][_0x8bcf('0x26')]);}})[_0x8bcf('0x28')](function(_0xd17e59){logger['error'](_0x8bcf('0x25'),_0x52eef1,_0xd17e59);_0x47c3d5(_0xd17e59);});});}function respondWithStatusCode(_0x2409d3,_0x5bc4bc){_0x5bc4bc=_0x5bc4bc||0xcc;return function(_0x28d383){if(_0x28d383){return _0x2409d3[_0x8bcf('0x29')](_0x5bc4bc);}return _0x2409d3['status'](_0x5bc4bc)[_0x8bcf('0x2a')]();};}function respondWithResult(_0x5a3536,_0x1fa0df){_0x1fa0df=_0x1fa0df||0xc8;return function(_0x4c9099){if(_0x4c9099){return _0x5a3536[_0x8bcf('0x2b')](_0x1fa0df)['json'](_0x4c9099);}};}function respondWithFilteredResult(_0x81417f,_0x4a7a69){return function(_0x38b413){if(_0x38b413){var _0x48aa77=typeof _0x4a7a69['offset']===_0x8bcf('0x2c')&&typeof _0x4a7a69[_0x8bcf('0x2d')]===_0x8bcf('0x2c');var _0x35e85a=_0x38b413[_0x8bcf('0x2e')];var _0x5b935c=_0x48aa77?0x0:_0x4a7a69[_0x8bcf('0x2f')];var _0x7e55a=_0x48aa77?_0x38b413[_0x8bcf('0x2e')]:_0x4a7a69['offset']+_0x4a7a69[_0x8bcf('0x2d')];var _0x24708b;if(_0x7e55a>=_0x35e85a){_0x7e55a=_0x35e85a;_0x24708b=0xc8;}else{_0x24708b=0xce;}_0x81417f[_0x8bcf('0x2b')](_0x24708b);return _0x81417f['set'](_0x8bcf('0x30'),_0x5b935c+'-'+_0x7e55a+'/'+_0x35e85a)[_0x8bcf('0x31')](_0x38b413);}return null;};}function patchUpdates(_0x1d36df){return function(_0x264463){try{jsonpatch['apply'](_0x264463,_0x1d36df,!![]);}catch(_0x2b4789){return BPromise['reject'](_0x2b4789);}return _0x264463[_0x8bcf('0x32')]();};}function saveUpdates(_0x354ce9,_0x34e613){return function(_0x1b2462){if(_0x1b2462){return _0x1b2462[_0x8bcf('0x33')](_0x354ce9)[_0x8bcf('0x1e')](function(_0x5df9f0){return _0x5df9f0;});}return null;};}function removeEntity(_0x3908f1,_0xd12db2){return function(_0x172531){if(_0x172531){return _0x172531[_0x8bcf('0x34')]()[_0x8bcf('0x1e')](function(){var _0x4f0094=_0x172531[_0x8bcf('0x35')]({'plain':!![]});var _0x34fda2=_0x8bcf('0x36');return db[_0x8bcf('0x37')][_0x8bcf('0x34')]({'where':{'type':_0x34fda2,'resourceId':_0x4f0094['id']}})[_0x8bcf('0x1e')](function(){return _0x172531;});})[_0x8bcf('0x1e')](function(){_0x3908f1[_0x8bcf('0x2b')](0xcc)[_0x8bcf('0x2a')]();});}};}function handleEntityNotFound(_0x3ce9dc,_0x361036){return function(_0x28886e){if(!_0x28886e){_0x3ce9dc[_0x8bcf('0x29')](0x194);}return _0x28886e;};}function handleError(_0x3ff6b0,_0x3cb7cb){_0x3cb7cb=_0x3cb7cb||0x1f4;return function(_0x2a7cda){logger[_0x8bcf('0x23')](_0x2a7cda[_0x8bcf('0x38')]);if(_0x2a7cda['name']){delete _0x2a7cda[_0x8bcf('0x39')];}_0x3ff6b0[_0x8bcf('0x2b')](_0x3cb7cb)[_0x8bcf('0x3a')](_0x2a7cda);};}exports[_0x8bcf('0x3b')]=function(_0x182fd2,_0xb2ed33){var _0x792e4f={'include':[{'model':db[_0x8bcf('0x3c')],'as':_0x8bcf('0x3d')}]},_0x24a919={},_0x523292={'count':0x0,'rows':[]};var _0x54a109=_['map'](db[_0x8bcf('0x3e')][_0x8bcf('0x3f')],function(_0x501dcc){return{'name':_0x501dcc['fieldName'],'type':_0x501dcc[_0x8bcf('0x40')][_0x8bcf('0x41')]};});_0x24a919[_0x8bcf('0x42')]=_['map'](_0x54a109,'name');_0x24a919[_0x8bcf('0x43')]=_[_0x8bcf('0x44')](_0x182fd2[_0x8bcf('0x43')]);_0x24a919[_0x8bcf('0x45')]=_[_0x8bcf('0x46')](_0x24a919[_0x8bcf('0x42')],_0x24a919['query']);_0x792e4f[_0x8bcf('0x47')]=_[_0x8bcf('0x46')](_0x24a919[_0x8bcf('0x42')],qs[_0x8bcf('0x48')](_0x182fd2[_0x8bcf('0x43')]['fields']));_0x792e4f[_0x8bcf('0x47')]=_0x792e4f['attributes'][_0x8bcf('0x49')]?_0x792e4f[_0x8bcf('0x47')]:_0x24a919[_0x8bcf('0x42')];if(!_0x182fd2['query'][_0x8bcf('0x4a')](_0x8bcf('0x4b'))){_0x792e4f['limit']=qs[_0x8bcf('0x2d')](_0x182fd2[_0x8bcf('0x43')]['limit']);_0x792e4f['offset']=qs[_0x8bcf('0x2f')](_0x182fd2[_0x8bcf('0x43')][_0x8bcf('0x2f')]);}_0x792e4f[_0x8bcf('0x4c')]=qs[_0x8bcf('0x4d')](_0x182fd2[_0x8bcf('0x43')][_0x8bcf('0x4d')]);_0x792e4f[_0x8bcf('0x4e')]=qs[_0x8bcf('0x45')](_['pick'](_0x182fd2['query'],_0x24a919['filters']),_0x54a109);if(_0x182fd2[_0x8bcf('0x43')][_0x8bcf('0x4f')]){_0x792e4f[_0x8bcf('0x4e')]=_[_0x8bcf('0x50')](_0x792e4f[_0x8bcf('0x4e')],{'$or':_[_0x8bcf('0x51')](_0x54a109,function(_0x175d88){if(_0x175d88[_0x8bcf('0x40')]!==_0x8bcf('0x52')){var _0x40a0c5={};_0x40a0c5[_0x175d88[_0x8bcf('0x39')]]={'$like':'%'+_0x182fd2['query']['filter']+'%'};return _0x40a0c5;}})});}_0x792e4f=_[_0x8bcf('0x50')]({},_0x792e4f,_0x182fd2[_0x8bcf('0x53')]);var _0x291d7d={'where':_0x792e4f['where']};return db['WhatsappAccount']['count'](_0x291d7d)['then'](function(_0x521f11){_0x523292[_0x8bcf('0x2e')]=_0x521f11;if(_0x182fd2['query'][_0x8bcf('0x54')]){_0x792e4f['include']=[{'all':!![]}];}return db[_0x8bcf('0x3e')][_0x8bcf('0x55')](_0x792e4f);})[_0x8bcf('0x1e')](function(_0x4d5d97){_0x523292['rows']=_0x4d5d97;return _0x523292;})[_0x8bcf('0x1e')](respondWithFilteredResult(_0xb2ed33,_0x792e4f))[_0x8bcf('0x28')](handleError(_0xb2ed33,null));};exports[_0x8bcf('0x56')]=function(_0x3455e6,_0x3c04c1){var _0x19c17f={'raw':![],'where':{'id':_0x3455e6[_0x8bcf('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3aaa34={};_0x3aaa34[_0x8bcf('0x42')]=_[_0x8bcf('0x44')](db[_0x8bcf('0x3e')][_0x8bcf('0x3f')]);_0x3aaa34[_0x8bcf('0x43')]=_[_0x8bcf('0x44')](_0x3455e6[_0x8bcf('0x43')]);_0x3aaa34['filters']=_['intersection'](_0x3aaa34[_0x8bcf('0x42')],_0x3aaa34['query']);_0x19c17f[_0x8bcf('0x47')]=_['intersection'](_0x3aaa34[_0x8bcf('0x42')],qs['fields'](_0x3455e6[_0x8bcf('0x43')][_0x8bcf('0x48')]));_0x19c17f[_0x8bcf('0x47')]=_0x19c17f[_0x8bcf('0x47')][_0x8bcf('0x49')]?_0x19c17f[_0x8bcf('0x47')]:_0x3aaa34[_0x8bcf('0x42')];if(_0x3455e6[_0x8bcf('0x43')][_0x8bcf('0x54')]){_0x19c17f[_0x8bcf('0x58')]=[{'all':!![]}];}_0x19c17f=_['merge']({},_0x19c17f,_0x3455e6[_0x8bcf('0x53')]);return db[_0x8bcf('0x3e')][_0x8bcf('0x59')](_0x19c17f)[_0x8bcf('0x1e')](handleEntityNotFound(_0x3c04c1,null))[_0x8bcf('0x1e')](respondWithResult(_0x3c04c1,null))[_0x8bcf('0x28')](handleError(_0x3c04c1,null));};exports[_0x8bcf('0x5a')]=function(_0x23a7fd,_0x3706c8){return db[_0x8bcf('0x3e')][_0x8bcf('0x5a')](_0x23a7fd[_0x8bcf('0x5b')],{})[_0x8bcf('0x1e')](function(_0x5a4505){var _0x5786ed=_0x23a7fd['user'][_0x8bcf('0x35')]({'plain':!![]});if(!_0x5786ed)throw new Error(_0x8bcf('0x5c'));if(_0x5786ed['role']===_0x8bcf('0x5d')){var _0x2c2faa=_0x5a4505['get']({'plain':!![]});var _0x281de4=_0x8bcf('0x36');return db[_0x8bcf('0x5e')][_0x8bcf('0x59')]({'where':{'name':_0x281de4,'userProfileId':_0x5786ed[_0x8bcf('0x5f')]},'raw':!![]})['then'](function(_0x3d264e){if(_0x3d264e&&_0x3d264e['autoAssociation']===0x0){return db[_0x8bcf('0x37')][_0x8bcf('0x5a')]({'name':_0x2c2faa[_0x8bcf('0x39')],'resourceId':_0x2c2faa['id'],'type':_0x3d264e['name'],'sectionId':_0x3d264e['id']},{})[_0x8bcf('0x1e')](function(){return _0x5a4505;});}else{return _0x5a4505;}})[_0x8bcf('0x28')](function(_0x31a800){logger[_0x8bcf('0x23')](_0x8bcf('0x60'),_0x31a800);throw _0x31a800;});}return _0x5a4505;})[_0x8bcf('0x1e')](respondWithResult(_0x3706c8,0xc9))[_0x8bcf('0x28')](handleError(_0x3706c8,null));};exports[_0x8bcf('0x33')]=function(_0x19759f,_0x4f4e9c){if(_0x19759f[_0x8bcf('0x5b')]['id']){delete _0x19759f[_0x8bcf('0x5b')]['id'];}return db[_0x8bcf('0x3e')][_0x8bcf('0x59')]({'where':{'id':_0x19759f[_0x8bcf('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x8bcf('0x3d')}]})[_0x8bcf('0x1e')](handleEntityNotFound(_0x4f4e9c,null))[_0x8bcf('0x1e')](saveUpdates(_0x19759f[_0x8bcf('0x5b')],null))[_0x8bcf('0x1e')](respondWithResult(_0x4f4e9c,null))[_0x8bcf('0x28')](handleError(_0x4f4e9c,null));};exports[_0x8bcf('0x34')]=function(_0x23bde2,_0x428792){return db['WhatsappAccount'][_0x8bcf('0x59')]({'where':{'id':_0x23bde2[_0x8bcf('0x57')]['id']}})[_0x8bcf('0x1e')](handleEntityNotFound(_0x428792,null))['then'](removeEntity(_0x428792,null))[_0x8bcf('0x28')](handleError(_0x428792,null));};exports[_0x8bcf('0x61')]=function(_0x40662b,_0x21c50a){return db['WhatsappAccount'][_0x8bcf('0x61')]()[_0x8bcf('0x1e')](respondWithResult(_0x21c50a,null))['catch'](handleError(_0x21c50a,null));};exports[_0x8bcf('0x62')]=function(_0x4ab135,_0x877e19,_0x26c82c){if(_0x4ab135[_0x8bcf('0x5b')]['id']){delete _0x4ab135[_0x8bcf('0x5b')]['id'];}return db[_0x8bcf('0x3e')][_0x8bcf('0x59')]({'where':{'id':_0x4ab135[_0x8bcf('0x57')]['id']}})[_0x8bcf('0x1e')](handleEntityNotFound(_0x877e19,null))['then'](function(_0x292f39){if(_0x292f39){_0x4ab135['body'][_0x8bcf('0x63')]=_0x292f39['id'];return db[_0x8bcf('0x64')][_0x8bcf('0x5a')](_0x4ab135[_0x8bcf('0x5b')]);}})['then'](respondWithResult(_0x877e19,null))['catch'](handleError(_0x877e19,null));};exports[_0x8bcf('0x65')]=function(_0x24ca9c,_0x334c78,_0x56b533){var _0x5985d4={'raw':![],'where':{}};var _0x1cf236={};var _0x21895a={'count':0x0,'rows':[]};return db[_0x8bcf('0x3e')][_0x8bcf('0x66')]({'where':{'id':_0x24ca9c[_0x8bcf('0x57')]['id']}})[_0x8bcf('0x1e')](handleEntityNotFound(_0x334c78,null))[_0x8bcf('0x1e')](function(_0x17dbdf){if(_0x17dbdf){_0x1cf236[_0x8bcf('0x42')]=_[_0x8bcf('0x44')](db['Disposition'][_0x8bcf('0x3f')]);_0x1cf236[_0x8bcf('0x43')]=_['keys'](_0x24ca9c['query']);_0x1cf236['filters']=_[_0x8bcf('0x46')](_0x1cf236[_0x8bcf('0x42')],_0x1cf236[_0x8bcf('0x43')]);_0x5985d4[_0x8bcf('0x47')]=_[_0x8bcf('0x46')](_0x1cf236[_0x8bcf('0x42')],qs[_0x8bcf('0x48')](_0x24ca9c[_0x8bcf('0x43')][_0x8bcf('0x48')]));_0x5985d4[_0x8bcf('0x47')]=_0x5985d4[_0x8bcf('0x47')][_0x8bcf('0x49')]?_0x5985d4[_0x8bcf('0x47')]:_0x1cf236['model'];if(!_0x24ca9c[_0x8bcf('0x43')]['hasOwnProperty'](_0x8bcf('0x4b'))){_0x5985d4['limit']=qs['limit'](_0x24ca9c[_0x8bcf('0x43')][_0x8bcf('0x2d')]);_0x5985d4[_0x8bcf('0x2f')]=qs[_0x8bcf('0x2f')](_0x24ca9c[_0x8bcf('0x43')][_0x8bcf('0x2f')]);}_0x5985d4[_0x8bcf('0x4c')]=qs['sort'](_0x24ca9c[_0x8bcf('0x43')][_0x8bcf('0x4d')]);_0x5985d4['where']=qs[_0x8bcf('0x45')](_[_0x8bcf('0x67')](_0x24ca9c[_0x8bcf('0x43')],_0x1cf236[_0x8bcf('0x45')]));_0x5985d4[_0x8bcf('0x4e')][_0x8bcf('0x63')]=_0x17dbdf['id'];if(_0x24ca9c[_0x8bcf('0x43')][_0x8bcf('0x4f')]){_0x5985d4[_0x8bcf('0x4e')]=_[_0x8bcf('0x50')](_0x5985d4[_0x8bcf('0x4e')],{'$or':_['map'](_0x5985d4['attributes'],function(_0x46e89a){var _0x4fa2c0={};_0x4fa2c0[_0x46e89a]={'$like':'%'+_0x24ca9c['query']['filter']+'%'};return _0x4fa2c0;})});}_0x5985d4=_[_0x8bcf('0x50')]({},_0x5985d4,_0x24ca9c[_0x8bcf('0x53')]);return db[_0x8bcf('0x64')][_0x8bcf('0x2e')]({'where':_0x5985d4[_0x8bcf('0x4e')]})['then'](function(_0x45b95e){_0x21895a[_0x8bcf('0x2e')]=_0x45b95e;if(_0x24ca9c[_0x8bcf('0x43')][_0x8bcf('0x54')]){_0x5985d4[_0x8bcf('0x58')]=[{'all':!![]}];}return db[_0x8bcf('0x64')][_0x8bcf('0x55')](_0x5985d4);})[_0x8bcf('0x1e')](function(_0x13d1f2){_0x21895a[_0x8bcf('0x68')]=_0x13d1f2;return _0x21895a;});}})[_0x8bcf('0x1e')](respondWithFilteredResult(_0x334c78,_0x5985d4))[_0x8bcf('0x28')](handleError(_0x334c78,null));};exports[_0x8bcf('0x69')]=function(_0x24fe98,_0x104d89,_0x19e5e5){return db[_0x8bcf('0x3e')][_0x8bcf('0x59')]({'where':{'id':_0x24fe98[_0x8bcf('0x57')]['id']}})['then'](handleEntityNotFound(_0x104d89,null))['then'](function(_0x3ec328){if(_0x3ec328){return _0x3ec328[_0x8bcf('0x69')](_0x24fe98[_0x8bcf('0x43')]['ids']);}})[_0x8bcf('0x1e')](respondWithStatusCode(_0x104d89,null))[_0x8bcf('0x28')](handleError(_0x104d89,null));};exports[_0x8bcf('0x6a')]=function(_0x453b02,_0x30a2e0,_0x12b314){if(_0x453b02[_0x8bcf('0x5b')]['id']){delete _0x453b02[_0x8bcf('0x5b')]['id'];}return db[_0x8bcf('0x3e')][_0x8bcf('0x59')]({'where':{'id':_0x453b02[_0x8bcf('0x57')]['id']}})[_0x8bcf('0x1e')](handleEntityNotFound(_0x30a2e0,null))['then'](function(_0x2381ba){if(_0x2381ba){_0x453b02[_0x8bcf('0x5b')][_0x8bcf('0x63')]=_0x2381ba['id'];return db[_0x8bcf('0x6b')][_0x8bcf('0x5a')](_0x453b02[_0x8bcf('0x5b')]);}})[_0x8bcf('0x1e')](respondWithResult(_0x30a2e0,null))[_0x8bcf('0x28')](handleError(_0x30a2e0,null));};exports[_0x8bcf('0x6c')]=function(_0x1b34be,_0x2d9092,_0x176012){var _0xf92280={'raw':![],'where':{}};var _0x46aa20={};var _0x49f751={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x1b34be[_0x8bcf('0x57')]['id']}})[_0x8bcf('0x1e')](handleEntityNotFound(_0x2d9092,null))[_0x8bcf('0x1e')](function(_0x134b60){if(_0x134b60){_0x46aa20['model']=_['keys'](db[_0x8bcf('0x6b')][_0x8bcf('0x3f')]);_0x46aa20['query']=_[_0x8bcf('0x44')](_0x1b34be[_0x8bcf('0x43')]);_0x46aa20[_0x8bcf('0x45')]=_[_0x8bcf('0x46')](_0x46aa20[_0x8bcf('0x42')],_0x46aa20[_0x8bcf('0x43')]);_0xf92280['attributes']=_[_0x8bcf('0x46')](_0x46aa20['model'],qs[_0x8bcf('0x48')](_0x1b34be['query']['fields']));_0xf92280[_0x8bcf('0x47')]=_0xf92280[_0x8bcf('0x47')]['length']?_0xf92280[_0x8bcf('0x47')]:_0x46aa20[_0x8bcf('0x42')];if(!_0x1b34be[_0x8bcf('0x43')][_0x8bcf('0x4a')](_0x8bcf('0x4b'))){_0xf92280['limit']=qs['limit'](_0x1b34be['query']['limit']);_0xf92280[_0x8bcf('0x2f')]=qs[_0x8bcf('0x2f')](_0x1b34be['query'][_0x8bcf('0x2f')]);}_0xf92280['order']=qs[_0x8bcf('0x4d')](_0x1b34be[_0x8bcf('0x43')][_0x8bcf('0x4d')]);_0xf92280[_0x8bcf('0x4e')]=qs[_0x8bcf('0x45')](_[_0x8bcf('0x67')](_0x1b34be[_0x8bcf('0x43')],_0x46aa20[_0x8bcf('0x45')]));_0xf92280[_0x8bcf('0x4e')][_0x8bcf('0x63')]=_0x134b60['id'];if(_0x1b34be[_0x8bcf('0x43')][_0x8bcf('0x4f')]){_0xf92280[_0x8bcf('0x4e')]=_[_0x8bcf('0x50')](_0xf92280[_0x8bcf('0x4e')],{'$or':_[_0x8bcf('0x51')](_0xf92280[_0x8bcf('0x47')],function(_0x4e19f4){var _0x200952={};_0x200952[_0x4e19f4]={'$like':'%'+_0x1b34be[_0x8bcf('0x43')][_0x8bcf('0x4f')]+'%'};return _0x200952;})});}_0xf92280=_[_0x8bcf('0x50')]({},_0xf92280,_0x1b34be[_0x8bcf('0x53')]);return db[_0x8bcf('0x6b')][_0x8bcf('0x2e')]({'where':_0xf92280['where']})['then'](function(_0xe6206e){_0x49f751[_0x8bcf('0x2e')]=_0xe6206e;if(_0x1b34be['query'][_0x8bcf('0x54')]){_0xf92280['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x8bcf('0x55')](_0xf92280);})[_0x8bcf('0x1e')](function(_0x189200){_0x49f751[_0x8bcf('0x68')]=_0x189200;return _0x49f751;});}})[_0x8bcf('0x1e')](respondWithFilteredResult(_0x2d9092,_0xf92280))['catch'](handleError(_0x2d9092,null));};exports['removeAnswers']=function(_0x47b670,_0x4a7fdf,_0x19610e){return db[_0x8bcf('0x3e')][_0x8bcf('0x59')]({'where':{'id':_0x47b670[_0x8bcf('0x57')]['id']}})[_0x8bcf('0x1e')](handleEntityNotFound(_0x4a7fdf,null))[_0x8bcf('0x1e')](function(_0x11aa8b){if(_0x11aa8b){return _0x11aa8b['removeAnswers'](_0x47b670[_0x8bcf('0x43')][_0x8bcf('0x6d')]);}})['then'](respondWithStatusCode(_0x4a7fdf,null))['catch'](handleError(_0x4a7fdf,null));};exports[_0x8bcf('0x6e')]=function(_0x5bc504,_0x29b72b,_0x19dac8){return db['WhatsappAccount']['find']({'where':{'id':_0x5bc504['params']['id']}})[_0x8bcf('0x1e')](handleEntityNotFound(_0x29b72b,null))[_0x8bcf('0x1e')](function(_0xf8ed9a){if(_0xf8ed9a){return _0xf8ed9a[_0x8bcf('0x6e')](_0x5bc504[_0x8bcf('0x5b')][_0x8bcf('0x6d')],_['omit'](_0x5bc504[_0x8bcf('0x5b')],[_0x8bcf('0x6d'),'id'])||{})[_0x8bcf('0x6f')](function(_0x80b12){for(var _0x2f1378=0x0;_0x2f1378<_0x5bc504[_0x8bcf('0x5b')][_0x8bcf('0x6d')][_0x8bcf('0x49')];_0x2f1378+=0x1){socket[_0x8bcf('0x70')]('userWhatsappAccount:save',{'UserId':Number(_0x5bc504[_0x8bcf('0x5b')][_0x8bcf('0x6d')][_0x2f1378]),'WhatsappAccountId':Number(_0x5bc504['params']['id'])});}return _0x80b12;});}})['then'](respondWithResult(_0x29b72b,null))[_0x8bcf('0x28')](handleError(_0x29b72b,null));};exports[_0x8bcf('0x71')]=function(_0x58b4cc,_0x47aeff,_0x35c770){return db['WhatsappAccount'][_0x8bcf('0x59')]({'where':{'id':_0x58b4cc['params']['id']}})[_0x8bcf('0x1e')](handleEntityNotFound(_0x47aeff,null))[_0x8bcf('0x1e')](function(_0x256c45){if(_0x256c45){return _0x256c45[_0x8bcf('0x71')](_0x58b4cc[_0x8bcf('0x43')][_0x8bcf('0x6d')])['then'](function(){if(_['isArray'](_0x58b4cc[_0x8bcf('0x43')][_0x8bcf('0x6d')])){for(var _0x6721ee=0x0;_0x6721ee<_0x58b4cc[_0x8bcf('0x43')][_0x8bcf('0x6d')]['length'];_0x6721ee+=0x1){socket[_0x8bcf('0x70')](_0x8bcf('0x72'),{'UserId':Number(_0x58b4cc[_0x8bcf('0x43')][_0x8bcf('0x6d')][_0x6721ee]),'WhatsappAccountId':Number(_0x58b4cc['params']['id'])});}}else{socket[_0x8bcf('0x70')](_0x8bcf('0x72'),{'UserId':Number(_0x58b4cc[_0x8bcf('0x43')]['ids']),'WhatsappAccountId':Number(_0x58b4cc[_0x8bcf('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x47aeff,null))[_0x8bcf('0x28')](handleError(_0x47aeff,null));};exports['getAgents']=function(_0x2b42d2,_0x2a33be,_0x576a37){var _0x6bf992={};var _0x29bc48={};var _0x4269ac;var _0x3b218a;return db[_0x8bcf('0x3e')][_0x8bcf('0x66')]({'where':{'id':_0x2b42d2['params']['id']}})[_0x8bcf('0x1e')](handleEntityNotFound(_0x2a33be,null))[_0x8bcf('0x1e')](function(_0x11cb82){if(_0x11cb82){_0x4269ac=_0x11cb82;_0x29bc48[_0x8bcf('0x42')]=_['keys'](db[_0x8bcf('0x73')]['rawAttributes']);_0x29bc48[_0x8bcf('0x43')]=_[_0x8bcf('0x44')](_0x2b42d2[_0x8bcf('0x43')]);_0x29bc48[_0x8bcf('0x45')]=_['intersection'](_0x29bc48['model'],_0x29bc48[_0x8bcf('0x43')]);_0x6bf992[_0x8bcf('0x47')]=_['intersection'](_0x29bc48[_0x8bcf('0x42')],qs[_0x8bcf('0x48')](_0x2b42d2['query'][_0x8bcf('0x48')]));_0x6bf992['attributes']=_0x6bf992[_0x8bcf('0x47')][_0x8bcf('0x49')]?_0x6bf992[_0x8bcf('0x47')]:_0x29bc48['model'];_0x6bf992[_0x8bcf('0x4c')]=qs[_0x8bcf('0x4d')](_0x2b42d2[_0x8bcf('0x43')][_0x8bcf('0x4d')]);_0x6bf992[_0x8bcf('0x4e')]=qs[_0x8bcf('0x45')](_[_0x8bcf('0x67')](_0x2b42d2[_0x8bcf('0x43')],_0x29bc48[_0x8bcf('0x45')]));if(_0x2b42d2['query'][_0x8bcf('0x4f')]){_0x6bf992[_0x8bcf('0x4e')]=_[_0x8bcf('0x50')](_0x6bf992[_0x8bcf('0x4e')],{'$or':_[_0x8bcf('0x51')](_0x6bf992[_0x8bcf('0x47')],function(_0x4bea9c){var _0x3c488c={};_0x3c488c[_0x4bea9c]={'$like':'%'+_0x2b42d2[_0x8bcf('0x43')][_0x8bcf('0x4f')]+'%'};return _0x3c488c;})});}_0x6bf992=_['merge']({},_0x6bf992,_0x2b42d2[_0x8bcf('0x53')]);return _0x4269ac['getAgents'](_0x6bf992);}})[_0x8bcf('0x1e')](function(_0x51731c){if(_0x51731c){_0x3b218a=_0x51731c['length'];if(!_0x2b42d2['query'][_0x8bcf('0x4a')](_0x8bcf('0x4b'))){_0x6bf992[_0x8bcf('0x2d')]=qs[_0x8bcf('0x2d')](_0x2b42d2[_0x8bcf('0x43')][_0x8bcf('0x2d')]);_0x6bf992[_0x8bcf('0x2f')]=qs['offset'](_0x2b42d2[_0x8bcf('0x43')][_0x8bcf('0x2f')]);}return _0x4269ac['getAgents'](_0x6bf992);}})[_0x8bcf('0x1e')](function(_0x3132de){if(_0x3132de){return _0x3132de?{'count':_0x3b218a,'rows':_0x3132de}:null;}})[_0x8bcf('0x1e')](respondWithResult(_0x2a33be,null))[_0x8bcf('0x28')](handleError(_0x2a33be,null));};exports[_0x8bcf('0x74')]=function(_0x26c201,_0x3f01c0){var _0x474fc5=_0x26c201[_0x8bcf('0x57')]['id'];var _0x41d641=_0x26c201[_0x8bcf('0x5b')];var _0xe8ddf=0xc8;var _0x398434=null;return db[_0x8bcf('0x75')][_0x8bcf('0x76')]({'isolationLevel':db[_0x8bcf('0x75')][_0x8bcf('0x77')][_0x8bcf('0x78')][_0x8bcf('0x79')]},function(_0x1e2a68){return db[_0x8bcf('0x3e')][_0x8bcf('0x66')]({'where':{'id':_0x474fc5},'transaction':_0x1e2a68})[_0x8bcf('0x1e')](function(_0x345817){if(_0x345817){return db[_0x8bcf('0x7a')][_0x8bcf('0x34')]({'where':{'WhatsappAccountId':_0x474fc5},'transaction':_0x1e2a68})[_0x8bcf('0x1e')](function(){var _0x372490=_[_0x8bcf('0x51')](_0x41d641,function(_0x16f3e3){_0x16f3e3['WhatsappAccountId']=_0x474fc5;return _0x16f3e3;});return db['WhatsappApplication']['bulkCreate'](_0x372490,{'transaction':_0x1e2a68});});}else{_0xe8ddf=0x194;_0x398434=[];}});})[_0x8bcf('0x1e')](function(){if(_0xe8ddf!==0x194){return db[_0x8bcf('0x7a')][_0x8bcf('0x7b')]({'where':{'WhatsappAccountId':_0x474fc5},'order':'priority'})['then'](function(_0x19f7c1){_0x398434=_0x19f7c1;});}})[_0x8bcf('0x28')](function(_0x48b65b){_0xe8ddf=0x1f4;logger[_0x8bcf('0x23')](_0x48b65b['stack']);if(_0x48b65b[_0x8bcf('0x39')]){delete _0x48b65b['name'];}_0x398434=_0x48b65b;})[_0x8bcf('0x7c')](function(){if(_0x398434===null){_0x3f01c0[_0x8bcf('0x29')](_0xe8ddf);}else{if(_0xe8ddf===0x1f4){_0x3f01c0['status'](_0xe8ddf)[_0x8bcf('0x3a')](_0x398434);}else{_0x3f01c0[_0x8bcf('0x2b')](_0xe8ddf)['json'](_0x398434);}}});};exports['getApplications']=function(_0x18043c,_0x33b52c,_0x351d5a){var _0x270991={};var _0x4d7044={};var _0x5022f0;var _0x546095;return db[_0x8bcf('0x3e')][_0x8bcf('0x66')]({'where':{'id':_0x18043c['params']['id']}})[_0x8bcf('0x1e')](handleEntityNotFound(_0x33b52c,null))[_0x8bcf('0x1e')](function(_0x427f63){if(_0x427f63){_0x5022f0=_0x427f63;_0x4d7044[_0x8bcf('0x42')]=_['keys'](db[_0x8bcf('0x7a')][_0x8bcf('0x3f')]);_0x4d7044['query']=_[_0x8bcf('0x44')](_0x18043c['query']);_0x4d7044['filters']=_[_0x8bcf('0x46')](_0x4d7044[_0x8bcf('0x42')],_0x4d7044['query']);_0x270991[_0x8bcf('0x47')]=_[_0x8bcf('0x46')](_0x4d7044[_0x8bcf('0x42')],qs[_0x8bcf('0x48')](_0x18043c['query'][_0x8bcf('0x48')]));_0x270991['attributes']=_0x270991[_0x8bcf('0x47')]['length']?_0x270991[_0x8bcf('0x47')]:_0x4d7044[_0x8bcf('0x42')];_0x270991[_0x8bcf('0x4c')]=qs[_0x8bcf('0x4d')](_0x18043c[_0x8bcf('0x43')][_0x8bcf('0x4d')]);_0x270991[_0x8bcf('0x4e')]=qs[_0x8bcf('0x45')](_['pick'](_0x18043c[_0x8bcf('0x43')],_0x4d7044['filters']));if(_0x18043c[_0x8bcf('0x43')][_0x8bcf('0x4f')]){_0x270991[_0x8bcf('0x4e')]=_[_0x8bcf('0x50')](_0x270991[_0x8bcf('0x4e')],{'$or':_[_0x8bcf('0x51')](_0x270991[_0x8bcf('0x47')],function(_0x4088dd){var _0x3c33fa={};_0x3c33fa[_0x4088dd]={'$like':'%'+_0x18043c[_0x8bcf('0x43')][_0x8bcf('0x4f')]+'%'};return _0x3c33fa;})});}_0x270991=_[_0x8bcf('0x50')]({},_0x270991,_0x18043c[_0x8bcf('0x53')]);return _0x5022f0[_0x8bcf('0x7d')](_0x270991);}})[_0x8bcf('0x1e')](function(_0x11d259){if(_0x11d259){_0x546095=_0x11d259['length'];if(!_0x18043c[_0x8bcf('0x43')][_0x8bcf('0x4a')](_0x8bcf('0x4b'))){_0x270991['limit']=qs[_0x8bcf('0x2d')](_0x18043c[_0x8bcf('0x43')][_0x8bcf('0x2d')]);_0x270991['offset']=qs[_0x8bcf('0x2f')](_0x18043c['query'][_0x8bcf('0x2f')]);}return _0x5022f0[_0x8bcf('0x7d')](_0x270991);}})[_0x8bcf('0x1e')](function(_0x5c6890){if(_0x5c6890){return _0x5c6890?{'count':_0x546095,'rows':_0x5c6890}:null;}})['then'](respondWithResult(_0x33b52c,null))['catch'](handleError(_0x33b52c,null));};exports[_0x8bcf('0x7e')]=function(_0x5f1f99,_0x2c3a07,_0x362b48){var _0x55282e={'channel':'whatsapp'};var _0x1ba065=[];var _0x3d5819=[];var _0x5e247a={};return db[_0x8bcf('0x3e')][_0x8bcf('0x59')]({'where':{'id':_0x5f1f99[_0x8bcf('0x57')]['id']},'include':[{'model':db[_0x8bcf('0x7a')],'as':_0x8bcf('0x7f')}]})[_0x8bcf('0x1e')](handleEntityNotFound(_0x2c3a07,null))['then'](function(_0x2d98fa){_0x55282e[_0x8bcf('0x80')]=_0x2d98fa;if(_0x55282e[_0x8bcf('0x80')]&&_0x55282e['account'][_0x8bcf('0x40')]==='sinch'&&_0x5f1f99[_0x8bcf('0x5b')][_0x8bcf('0x81')]){if(_0x5f1f99[_0x8bcf('0x5b')][_0x8bcf('0x81')][_0x8bcf('0x49')]===0x0)return;if(_0x5f1f99[_0x8bcf('0x5b')]['statuses'][0x0][_0x8bcf('0x82')]!==_0x8bcf('0x83'))return;return db['WhatsappMessage'][_0x8bcf('0x33')]({'read':!![],'readAt':_0x5f1f99[_0x8bcf('0x5b')][_0x8bcf('0x81')][0x0]['timestamp']},{'where':{'messageId':_0x5f1f99[_0x8bcf('0x5b')][_0x8bcf('0x81')][0x0][_0x8bcf('0x84')]},'individualHooks':!![]})[_0x8bcf('0x1e')](function(_0x4bdae3){return _0x2c3a07[_0x8bcf('0x2b')](0xc8)[_0x8bcf('0x31')](_0x4bdae3);});}_0x55282e[_0x8bcf('0x85')]=_[_0x8bcf('0x86')](_0x2d98fa['Applications'],['priority'],[_0x8bcf('0x87')]);if(_0x55282e[_0x8bcf('0x80')]['Applications']){delete _0x55282e['account'][_0x8bcf('0x7f')];}return db[_0x8bcf('0x88')]['describe']()['then'](function(_0x12aff4){if(!_0x12aff4){throw new db[(_0x8bcf('0x89'))][(_0x8bcf('0x8a'))](_0x8bcf('0x8b'));}_0x1ba065=_[_0x8bcf('0x8c')](_[_0x8bcf('0x44')](_0x12aff4),[_0x8bcf('0x8d'),_0x8bcf('0x8e')]);_0x3d5819=_[_0x8bcf('0x8c')](_[_0x8bcf('0x44')](_0x12aff4),[_0x8bcf('0x8d'),_0x8bcf('0x8e'),_0x8bcf('0x8f'),_0x8bcf('0x90')]);_0x55282e[_0x8bcf('0x5b')]={'mapKey':_0x8bcf('0x91')};if(_0x55282e['account']&&_0x55282e[_0x8bcf('0x80')][_0x8bcf('0x40')]===_0x8bcf('0x92')){_0x55282e[_0x8bcf('0x5b')]['from']=_0x5f1f99[_0x8bcf('0x5b')][_0x8bcf('0x93')][_0x8bcf('0x94')](_0x8bcf('0x95'),'');_0x55282e[_0x8bcf('0x5b')][_0x8bcf('0x5b')]=_0x5f1f99[_0x8bcf('0x5b')][_0x8bcf('0x96')];_0x55282e['body'][_0x8bcf('0x97')]=_0x5f1f99['body'][_0x8bcf('0x98')];}if(_0x55282e[_0x8bcf('0x80')]&&_0x55282e[_0x8bcf('0x80')][_0x8bcf('0x40')]===_0x8bcf('0x99')){_0x55282e[_0x8bcf('0x5b')]['from']=_0x5f1f99[_0x8bcf('0x5b')][_0x8bcf('0x9a')][0x0]['from'];_0x55282e[_0x8bcf('0x5b')][_0x8bcf('0x5b')]=_0x5f1f99[_0x8bcf('0x5b')][_0x8bcf('0x9a')][0x0]['message'][_0x8bcf('0x5b')];_0x55282e[_0x8bcf('0x5b')][_0x8bcf('0x97')]=_0x5f1f99[_0x8bcf('0x5b')]['notifications'][0x0]['message_id'];}if(_0x55282e[_0x8bcf('0x5b')]['id']){delete _0x55282e[_0x8bcf('0x5b')]['id'];}if(_[_0x8bcf('0x9b')](_0x55282e[_0x8bcf('0x5b')][_0x8bcf('0x9c')])){throw new db[(_0x8bcf('0x89'))][(_0x8bcf('0x8a'))](_0x8bcf('0x9d'));}if(_['isNil'](_0x55282e['body'][_0x8bcf('0x5b')])||_0x55282e[_0x8bcf('0x5b')][_0x8bcf('0x5b')]===''){throw new db['Sequelize'][(_0x8bcf('0x8a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8bcf('0x9b')](_0x55282e[_0x8bcf('0x5b')]['mapKey'])){throw new db['Sequelize'][(_0x8bcf('0x8a'))](_0x8bcf('0x9e')+_0x3d5819);}if(!_['includes'](_0x3d5819,_0x55282e[_0x8bcf('0x5b')][_0x8bcf('0x9f')])){throw new db['Sequelize'][(_0x8bcf('0x8a'))](_0x8bcf('0xa0')+_0x3d5819);}_0x5e247a[_0x55282e['body'][_0x8bcf('0x9f')]]=_0x55282e[_0x8bcf('0x5b')][_0x8bcf('0x9c')];return db['CmList']['find']({'where':{'id':_0x55282e[_0x8bcf('0x80')]['ListId']},'include':[{'model':db[_0x8bcf('0x88')],'as':_0x8bcf('0xa1'),'where':_0x5e247a,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x8bcf('0x1e')](handleEntityNotFound(_0x2c3a07,null))[_0x8bcf('0x1e')](function(_0x54198e){if(_0x54198e){_0x55282e[_0x8bcf('0xa2')]=_['omit'](_0x54198e,[_0x8bcf('0xa1')]);if(_0x54198e[_0x8bcf('0xa1')][_0x8bcf('0x49')]){return _0x54198e['Contacts'][0x0];}var _0x5e7c82=_[_0x8bcf('0xa3')](_0x55282e['body'],{'firstName':_0x55282e[_0x8bcf('0x5b')]['from'],'ListId':_0x54198e['id']});_0x5e7c82[_0x55282e[_0x8bcf('0x5b')][_0x8bcf('0x9f')]]=_0x55282e[_0x8bcf('0x5b')]['from'];return db[_0x8bcf('0x88')][_0x8bcf('0x5a')](_0x5e7c82,{'fields':_0x1ba065,'raw':!![]});}})['then'](handleEntityNotFound(_0x2c3a07,null))['then'](function(_0x125752){if(_0x125752){_0x55282e[_0x8bcf('0xa4')]=_0x125752;var _0x37d9ea={'ContactId':_0x125752['id'],'phone':_0x55282e[_0x8bcf('0x5b')]['from'],'WhatsappAccountId':_0x5f1f99[_0x8bcf('0x57')]['id']};var _0x3c209b={'ContactId':_0x125752['id'],'WhatsappAccountId':_0x5f1f99[_0x8bcf('0x57')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x8bcf('0x59')]({'where':_0x3c209b})[_0x8bcf('0x1e')](function(_0x1605d6){if(_0x1605d6){return[_0x1605d6,![]];}return db['WhatsappInteraction'][_0x8bcf('0x5a')](_0x37d9ea)[_0x8bcf('0x1e')](function(_0x66f87b){return[_0x66f87b,!![]];});});}})['spread'](function(_0x4cc955,_0x1e1015){_0x55282e[_0x8bcf('0xa5')]=_0x4cc955[_0x8bcf('0x35')]({'plain':!![]});_0x55282e['interaction'][_0x8bcf('0xa6')]=![];if(_0x1e1015){if(_0x55282e[_0x8bcf('0x80')][_0x8bcf('0xa7')]){_0x55282e[_0x8bcf('0x85')]['push']({'id':0x0,'priority':_0x55282e[_0x8bcf('0x85')][_0x8bcf('0x49')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x8bcf('0xa8')});}_0x55282e[_0x8bcf('0xa5')]['created']=!![];}return db[_0x8bcf('0xa9')][_0x8bcf('0x5a')]({'phone':_0x55282e[_0x8bcf('0x5b')]['from'],'messageId':_0x55282e[_0x8bcf('0x5b')][_0x8bcf('0x97')],'body':_0x55282e[_0x8bcf('0x5b')][_0x8bcf('0x5b')],'WhatsappAccountId':_0x5f1f99[_0x8bcf('0x57')]['id'],'WhatsappInteractionId':_0x4cc955['id'],'direction':'in','ContactId':_0x4cc955[_0x8bcf('0xaa')],'AttachmentId':_0x55282e[_0x8bcf('0x5b')][_0x8bcf('0xab')]});})[_0x8bcf('0x1e')](function(_0x10eeec){_0x55282e['message']=_0x10eeec;if(_0x55282e['interaction'][_0x8bcf('0xac')]){return db[_0x8bcf('0x73')]['find']({'attributes':['id',_0x8bcf('0x39')],'where':{'id':_0x55282e[_0x8bcf('0xa5')]['UserId']}})[_0x8bcf('0x1e')](function(_0x2dc5d2){if(_0x2dc5d2){_0x55282e[_0x8bcf('0x85')][_0x8bcf('0xad')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2dc5d2[_0x8bcf('0x39')]+','+(_0x55282e['account'][_0x8bcf('0xae')]||0xa),'interval':_0x8bcf('0xa8')});}return respondWithRpcPromise('Start','startRouting',_0x55282e);});}return respondWithRpcPromise(_0x8bcf('0xaf'),'startRouting',_0x55282e);})['then'](function(_0x40c303){if(_0x40c303){var _0x537e57=0xc8;var _0x9e9414='receiveMessage';logger[_0x8bcf('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x9e9414,_0x537e57,_0x8bcf('0xb0'));logger[_0x8bcf('0xb1')](_0x8bcf('0xb2'),_0x9e9414,_0x537e57,_0x8bcf('0xb0'),JSON[_0x8bcf('0x22')](_0x40c303));if(_0x55282e[_0x8bcf('0x80')][_0x8bcf('0x40')]===_0x8bcf('0x92')){return _0x2c3a07['status'](_0x537e57)[_0x8bcf('0xb3')](_0x8bcf('0xb4'),_0x8bcf('0xb5'))[_0x8bcf('0x3a')](_0x8bcf('0xb6'));}else{return _0x2c3a07[_0x8bcf('0x2b')](_0x537e57)['json'](_0x40c303);}}});})[_0x8bcf('0x28')](handleError(_0x2c3a07,null));};exports[_0x8bcf('0x3a')]=function(_0x17a232,_0x5dfd8f,_0xbf69e5){var _0x54fcdb,_0x51bce0,_0x4abc2b;if(_[_0x8bcf('0x9b')](_0x17a232[_0x8bcf('0x5b')]['body'])||_0x17a232[_0x8bcf('0x5b')]['body']===''){throw new db[(_0x8bcf('0x89'))]['ValidationError'](_0x8bcf('0xb7'));}if(_[_0x8bcf('0x9b')](_0x17a232[_0x8bcf('0x5b')]['to'])){throw new db[(_0x8bcf('0x89'))][(_0x8bcf('0x8a'))](_0x8bcf('0xb8'));}_0x54fcdb=_0x17a232['body']['to'];return db[_0x8bcf('0x3e')]['find']({'where':{'id':_0x17a232['params']['id']},'include':[{'model':db[_0x8bcf('0xb9')],'as':_0x8bcf('0xba'),'include':[{'model':db['CmContact'],'as':_0x8bcf('0xa1'),'where':{'mobile':_0x54fcdb},'limit':0x1,'order':[[_0x8bcf('0x8e'),_0x8bcf('0xbb')]]}]}]})['then'](handleEntityNotFound(_0x5dfd8f,null))[_0x8bcf('0x1e')](function(_0x355474){if(_0x355474&&_0x355474[_0x8bcf('0xba')]){_0x51bce0=_0x355474[_0x8bcf('0x35')]({'plain':!![]});if(_0x51bce0[_0x8bcf('0xba')]&&_0x51bce0[_0x8bcf('0xba')]['Contacts']['length']){return _0x51bce0['List']['Contacts'][0x0];}return db[_0x8bcf('0x88')][_0x8bcf('0x5a')](_[_0x8bcf('0xa3')](_0x17a232['body'],{'firstName':_0x54fcdb,'mobile':_0x54fcdb,'phone':_0x54fcdb,'ListId':_0x51bce0['ListId']}));}})[_0x8bcf('0x1e')](handleEntityNotFound(_0x5dfd8f,null))[_0x8bcf('0x1e')](function(_0x2387aa){if(_0x2387aa){_0x4abc2b=_0x2387aa;return db[_0x8bcf('0xbc')]['find']({'where':{'ContactId':_0x4abc2b['id'],'closed':![],'WhatsappAccountId':_0x51bce0['id']}})['then'](function(_0x2ebf24){if(_0x2ebf24){return[_0x2ebf24,![]];}return db[_0x8bcf('0xbc')][_0x8bcf('0x5a')]({'UserId':_0x17a232[_0x8bcf('0x5d')]['id'],'ContactId':_0x4abc2b['id'],'WhatsappAccountId':_0x51bce0['id'],'phone':_0x54fcdb,'firstMsgDirection':_0x8bcf('0xbd'),'Messages':[_[_0x8bcf('0x50')](_0x17a232['body'],{'read':![],'body':_0x17a232[_0x8bcf('0x5b')][_0x8bcf('0x5b')],'phone':_0x54fcdb,'WhatsappAccountId':_0x51bce0['id'],'UserId':_0x17a232[_0x8bcf('0x5d')]['id'],'ContactId':_0x4abc2b['id']})]},{'include':[{'model':db[_0x8bcf('0xa9')],'as':'Messages'}]})[_0x8bcf('0x1e')](function(_0x4238f1){return[_0x4238f1,!![]];});});}})[_0x8bcf('0x6f')](function(_0x4f7d41,_0x2326df){if(_0x2326df){return _0x4f7d41;}return db[_0x8bcf('0xa9')][_0x8bcf('0x5a')](_[_0x8bcf('0x50')](_0x17a232[_0x8bcf('0x5b')],{'read':![],'body':_0x17a232[_0x8bcf('0x5b')]['body'],'phone':_0x54fcdb,'WhatsappAccountId':_0x51bce0['id'],'WhatsappInteractionId':_0x4f7d41['id'],'UserId':_0x17a232[_0x8bcf('0x5d')]['id'],'ContactId':_0x4abc2b['id']}))[_0x8bcf('0x1e')](function(_0x18d4ea){_0x4f7d41['dataValues'][_0x8bcf('0xbe')]=[];_0x4f7d41[_0x8bcf('0xbf')][_0x8bcf('0xbe')][_0x8bcf('0xc0')](_0x18d4ea[_0x8bcf('0xbf')]);return _0x4f7d41;});})[_0x8bcf('0x1e')](respondWithResult(_0x5dfd8f,null))[_0x8bcf('0x28')](handleError(_0x5dfd8f,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 15faf9a..0f51114 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 _0xc028=['../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','exports','events'];(function(_0x3d2f1f,_0x4f51d1){var _0x3638fb=function(_0x33fecd){while(--_0x33fecd){_0x3d2f1f['push'](_0x3d2f1f['shift']());}};_0x3638fb(++_0x4f51d1);}(_0xc028,0xd1));var _0x8c02=function(_0x2bf5c5,_0x33e07e){_0x2bf5c5=_0x2bf5c5-0x0;var _0xa552cc=_0xc028[_0x2bf5c5];return _0xa552cc;};'use strict';var EventEmitter=require(_0x8c02('0x0'));var WhatsappAccount=require(_0x8c02('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x8c02('0x2')](0x0);var events={'afterCreate':_0x8c02('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2cb5b8){return function(_0xd0e287,_0x265a21,_0x2ba5e2){WhatsappAccountEvents[_0x8c02('0x4')](_0x2cb5b8+':'+_0xd0e287['id'],_0xd0e287);WhatsappAccountEvents[_0x8c02('0x4')](_0x2cb5b8,_0xd0e287);_0x2ba5e2(null);};}for(var e in events){if(events[_0x8c02('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x8c02('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0xf601=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x51e026,_0x509ce9){var _0x2fb4bf=function(_0x3dec03){while(--_0x3dec03){_0x51e026['push'](_0x51e026['shift']());}};_0x2fb4bf(++_0x509ce9);}(_0xf601,0xbe));var _0x1f60=function(_0x559d40,_0x41d536){_0x559d40=_0x559d40-0x0;var _0x3edf10=_0xf601[_0x559d40];return _0x3edf10;};'use strict';var EventEmitter=require(_0x1f60('0x0'));var WhatsappAccount=require(_0x1f60('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1f60('0x2')](0x0);var events={'afterCreate':_0x1f60('0x3'),'afterUpdate':_0x1f60('0x4'),'afterDestroy':_0x1f60('0x5')};function emitEvent(_0x4ecea3){return function(_0x7eb91c,_0x10b18e,_0x145e2e){WhatsappAccountEvents[_0x1f60('0x6')](_0x4ecea3+':'+_0x7eb91c['id'],_0x7eb91c);WhatsappAccountEvents[_0x1f60('0x6')](_0x4ecea3,_0x7eb91c);_0x145e2e(null);};}for(var e in events){if(events[_0x1f60('0x7')](e)){var event=events[e];WhatsappAccount[_0x1f60('0x8')](e,emitEvent(event));}}module[_0x1f60('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 227a86c..8bd7732 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 _0xa75c=['rimraf','../../config/environment','./whatsappAccount.attributes','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','request-promise','path'];(function(_0x314c95,_0x1c544e){var _0x36ce33=function(_0x1013d3){while(--_0x1013d3){_0x314c95['push'](_0x314c95['shift']());}};_0x36ce33(++_0x1c544e);}(_0xa75c,0x18b));var _0xca75=function(_0x285c85,_0x132c21){_0x285c85=_0x285c85-0x0;var _0x2f81cd=_0xa75c[_0x285c85];return _0x2f81cd;};'use strict';var _=require(_0xca75('0x0'));var util=require(_0xca75('0x1'));var logger=require(_0xca75('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xca75('0x3'));var fs=require('fs');var path=require(_0xca75('0x4'));var rimraf=require(_0xca75('0x5'));var config=require(_0xca75('0x6'));var attributes=require(_0xca75('0x7'));module['exports']=function(_0x53c111,_0x29a32d){return _0x53c111['define'](_0xca75('0x8'),attributes,{'tableName':_0xca75('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc787=['./whatsappAccount.attributes','exports','define','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4e7551,_0x398ee5){var _0x2c2ae8=function(_0x31f000){while(--_0x31f000){_0x4e7551['push'](_0x4e7551['shift']());}};_0x2c2ae8(++_0x398ee5);}(_0xc787,0xd6));var _0x7c78=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xc787[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x7c78('0x0'));var util=require(_0x7c78('0x1'));var logger=require(_0x7c78('0x2'))(_0x7c78('0x3'));var moment=require(_0x7c78('0x4'));var BPromise=require(_0x7c78('0x5'));var rp=require(_0x7c78('0x6'));var fs=require('fs');var path=require(_0x7c78('0x7'));var rimraf=require(_0x7c78('0x8'));var config=require(_0x7c78('0x9'));var attributes=require(_0x7c78('0xa'));module[_0x7c78('0xb')]=function(_0x349f2d,_0x590f94){return _0x349f2d[_0x7c78('0xc')]('WhatsappAccount',attributes,{'tableName':_0x7c78('0xd'),'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 3c4cc9f..562ae02 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 _0x4f11=['include','map','model','ShowWhatsappAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','find','options','raw','where','attributes'];(function(_0x2171a6,_0x37b2e5){var _0x14140c=function(_0x3d0e0b){while(--_0x3d0e0b){_0x2171a6['push'](_0x2171a6['shift']());}};_0x14140c(++_0x37b2e5);}(_0x4f11,0x107));var _0x14f1=function(_0x3a55cf,_0x9c2159){_0x3a55cf=_0x3a55cf-0x0;var _0x24cd37=_0x4f11[_0x3a55cf];return _0x24cd37;};'use strict';var _=require(_0x14f1('0x0'));var util=require(_0x14f1('0x1'));var moment=require(_0x14f1('0x2'));var BPromise=require(_0x14f1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14f1('0x4'));var db=require(_0x14f1('0x5'))['db'];var utils=require(_0x14f1('0x6'));var logger=require('../../config/logger')(_0x14f1('0x7'));var config=require(_0x14f1('0x8'));var jayson=require(_0x14f1('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x14f1('0xa')]=_[_0x14f1('0xb')](config[_0x14f1('0xa')],{'host':_0x14f1('0xc'),'port':0x18eb});var socket=require(_0x14f1('0xd'))(new Redis(config[_0x14f1('0xa')]));require(_0x14f1('0xe'))[_0x14f1('0xf')](socket);function respondWithRpcPromise(_0x1f1332,_0x2b0481,_0x244be4){return new BPromise(function(_0x4efac9,_0x32bb32){return client[_0x14f1('0x10')](_0x1f1332,_0x244be4)[_0x14f1('0x11')](function(_0x32a9c8){logger[_0x14f1('0x12')](_0x14f1('0x13'),_0x2b0481,_0x14f1('0x14'));logger['debug'](_0x14f1('0x15'),_0x2b0481,'request\x20sent',JSON[_0x14f1('0x16')](_0x32a9c8));if(_0x32a9c8[_0x14f1('0x17')]){if(_0x32a9c8[_0x14f1('0x17')][_0x14f1('0x18')]===0x1f4){logger[_0x14f1('0x17')](_0x14f1('0x13'),_0x2b0481,_0x32a9c8[_0x14f1('0x17')]['message']);return _0x32bb32(_0x32a9c8[_0x14f1('0x17')]['message']);}logger['error'](_0x14f1('0x13'),_0x2b0481,_0x32a9c8['error']['message']);return _0x4efac9(_0x32a9c8['error'][_0x14f1('0x19')]);}else{logger[_0x14f1('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x2b0481,_0x14f1('0x14'));_0x4efac9(_0x32a9c8[_0x14f1('0x1a')]['message']);}})[_0x14f1('0x1b')](function(_0x107441){logger[_0x14f1('0x17')](_0x14f1('0x13'),_0x2b0481,_0x107441);_0x32bb32(_0x107441);});});}exports['ShowWhatsappAccount']=function(_0x216820){var _0x53e902=this;return new Promise(function(_0x1c787f,_0x530a43){return db['WhatsappAccount'][_0x14f1('0x1c')]({'raw':_0x216820[_0x14f1('0x1d')]?_0x216820[_0x14f1('0x1d')][_0x14f1('0x1e')]===undefined?!![]:![]:!![],'where':_0x216820[_0x14f1('0x1d')]?_0x216820['options'][_0x14f1('0x1f')]||null:null,'attributes':_0x216820['options']?_0x216820[_0x14f1('0x1d')][_0x14f1('0x20')]||null:null,'include':_0x216820[_0x14f1('0x1d')]?_0x216820[_0x14f1('0x1d')][_0x14f1('0x21')]?_[_0x14f1('0x22')](_0x216820[_0x14f1('0x1d')][_0x14f1('0x21')],function(_0x5a7538){return{'model':db[_0x5a7538[_0x14f1('0x23')]],'as':_0x5a7538['as'],'attributes':_0x5a7538['attributes'],'include':_0x5a7538[_0x14f1('0x21')]?_[_0x14f1('0x22')](_0x5a7538['include'],function(_0x1ea179){return{'model':db[_0x1ea179[_0x14f1('0x23')]],'as':_0x1ea179['as'],'attributes':_0x1ea179[_0x14f1('0x20')],'include':_0x1ea179[_0x14f1('0x21')]?_['map'](_0x1ea179[_0x14f1('0x21')],function(_0x1f48ce){return{'model':db[_0x1f48ce[_0x14f1('0x23')]],'as':_0x1f48ce['as'],'attributes':_0x1f48ce[_0x14f1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x14f1('0x11')](function(_0x51513c){logger[_0x14f1('0x12')](_0x14f1('0x24'),_0x216820);logger['debug'](_0x14f1('0x24'),_0x216820,JSON[_0x14f1('0x16')](_0x51513c));_0x1c787f(_0x51513c);})[_0x14f1('0x1b')](function(_0x20c3ad){logger[_0x14f1('0x17')](_0x14f1('0x24'),_0x20c3ad['message'],_0x216820);_0x530a43(_0x53e902[_0x14f1('0x17')](0x1f4,_0x20c3ad[_0x14f1('0x19')]));});});}; \ No newline at end of file +var _0xc900=['map','model','include','debug','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes'];(function(_0x4852a4,_0x513a6f){var _0x15e37d=function(_0x1b1cb0){while(--_0x1b1cb0){_0x4852a4['push'](_0x4852a4['shift']());}};_0x15e37d(++_0x513a6f);}(_0xc900,0xb3));var _0x0c90=function(_0x4136d5,_0x573f74){_0x4136d5=_0x4136d5-0x0;var _0x551269=_0xc900[_0x4136d5];return _0x551269;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0c90('0x0'));var BPromise=require(_0x0c90('0x1'));var rs=require(_0x0c90('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c90('0x3'))['db'];var utils=require(_0x0c90('0x4'));var logger=require('../../config/logger')(_0x0c90('0x5'));var config=require(_0x0c90('0x6'));var jayson=require(_0x0c90('0x7'));var client=jayson[_0x0c90('0x8')][_0x0c90('0x9')]({'port':0x232a});config[_0x0c90('0xa')]=_['defaults'](config[_0x0c90('0xa')],{'host':_0x0c90('0xb'),'port':0x18eb});var socket=require(_0x0c90('0xc'))(new Redis(config[_0x0c90('0xa')]));require(_0x0c90('0xd'))[_0x0c90('0xe')](socket);function respondWithRpcPromise(_0x313ce9,_0x18d9fd,_0x3e0df6){return new BPromise(function(_0x34456e,_0x10daeb){return client[_0x0c90('0xf')](_0x313ce9,_0x3e0df6)[_0x0c90('0x10')](function(_0x57917b){logger[_0x0c90('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x18d9fd,_0x0c90('0x12'));logger['debug'](_0x0c90('0x13'),_0x18d9fd,_0x0c90('0x12'),JSON[_0x0c90('0x14')](_0x57917b));if(_0x57917b[_0x0c90('0x15')]){if(_0x57917b[_0x0c90('0x15')]['code']===0x1f4){logger[_0x0c90('0x15')](_0x0c90('0x16'),_0x18d9fd,_0x57917b['error'][_0x0c90('0x17')]);return _0x10daeb(_0x57917b[_0x0c90('0x15')][_0x0c90('0x17')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x18d9fd,_0x57917b[_0x0c90('0x15')][_0x0c90('0x17')]);return _0x34456e(_0x57917b[_0x0c90('0x15')][_0x0c90('0x17')]);}else{logger[_0x0c90('0x11')](_0x0c90('0x16'),_0x18d9fd,_0x0c90('0x12'));_0x34456e(_0x57917b['result'][_0x0c90('0x17')]);}})[_0x0c90('0x18')](function(_0x462d49){logger[_0x0c90('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x18d9fd,_0x462d49);_0x10daeb(_0x462d49);});});}exports[_0x0c90('0x19')]=function(_0xd129ca){var _0x143047=this;return new Promise(function(_0x1241a9,_0x315932){return db[_0x0c90('0x1a')]['find']({'raw':_0xd129ca[_0x0c90('0x1b')]?_0xd129ca['options'][_0x0c90('0x1c')]===undefined?!![]:![]:!![],'where':_0xd129ca[_0x0c90('0x1b')]?_0xd129ca['options'][_0x0c90('0x1d')]||null:null,'attributes':_0xd129ca[_0x0c90('0x1b')]?_0xd129ca[_0x0c90('0x1b')][_0x0c90('0x1e')]||null:null,'include':_0xd129ca[_0x0c90('0x1b')]?_0xd129ca[_0x0c90('0x1b')]['include']?_[_0x0c90('0x1f')](_0xd129ca[_0x0c90('0x1b')]['include'],function(_0x54316b){return{'model':db[_0x54316b[_0x0c90('0x20')]],'as':_0x54316b['as'],'attributes':_0x54316b[_0x0c90('0x1e')],'include':_0x54316b[_0x0c90('0x21')]?_[_0x0c90('0x1f')](_0x54316b['include'],function(_0x2dfa14){return{'model':db[_0x2dfa14[_0x0c90('0x20')]],'as':_0x2dfa14['as'],'attributes':_0x2dfa14[_0x0c90('0x1e')],'include':_0x2dfa14[_0x0c90('0x21')]?_[_0x0c90('0x1f')](_0x2dfa14[_0x0c90('0x21')],function(_0x492028){return{'model':db[_0x492028[_0x0c90('0x20')]],'as':_0x492028['as'],'attributes':_0x492028[_0x0c90('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0c90('0x10')](function(_0x13b377){logger['info']('ShowWhatsappAccount',_0xd129ca);logger[_0x0c90('0x22')](_0x0c90('0x19'),_0xd129ca,JSON[_0x0c90('0x14')](_0x13b377));_0x1241a9(_0x13b377);})[_0x0c90('0x18')](function(_0x119e09){logger['error'](_0x0c90('0x19'),_0x119e09[_0x0c90('0x17')],_0xd129ca);_0x315932(_0x143047[_0x0c90('0x15')](0x1f4,_0x119e09['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index a45fb41..1ccd8e6 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 _0x1209=['update','removeListener','length','./whatsappAccount.events','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1209,0x6c));var _0x9120=function(_0x47b7bb,_0x39bc77){_0x47b7bb=_0x47b7bb-0x0;var _0x1dcae5=_0x1209[_0x47b7bb];return _0x1dcae5;};'use strict';var WhatsappAccountEvents=require(_0x9120('0x0'));var events=[_0x9120('0x1'),'remove',_0x9120('0x2')];function createListener(_0xe516de,_0x2c2ddf){return function(_0x19f991){_0x2c2ddf['emit'](_0xe516de,_0x19f991);};}function removeListener(_0x552ff7,_0x324f25){return function(){WhatsappAccountEvents[_0x9120('0x3')](_0x552ff7,_0x324f25);};}exports['register']=function(_0x58a26b){for(var _0x212cf8=0x0,_0x5db5e2=events[_0x9120('0x4')];_0x212cf8<_0x5db5e2;_0x212cf8++){var _0x4cbef6=events[_0x212cf8];var _0x214060=createListener('whatsappAccount:'+_0x4cbef6,_0x58a26b);WhatsappAccountEvents['on'](_0x4cbef6,_0x214060);}}; \ No newline at end of file +var _0xef12=['./whatsappAccount.events','save','remove','update','emit','register','length','whatsappAccount:'];(function(_0x2b31a8,_0x28b862){var _0x1175a5=function(_0x2cdb5d){while(--_0x2cdb5d){_0x2b31a8['push'](_0x2b31a8['shift']());}};_0x1175a5(++_0x28b862);}(_0xef12,0xe8));var _0x2ef1=function(_0x17a6af,_0x24d7fd){_0x17a6af=_0x17a6af-0x0;var _0x3f129d=_0xef12[_0x17a6af];return _0x3f129d;};'use strict';var WhatsappAccountEvents=require(_0x2ef1('0x0'));var events=[_0x2ef1('0x1'),_0x2ef1('0x2'),_0x2ef1('0x3')];function createListener(_0x4f0d24,_0x243238){return function(_0x39a2d4){_0x243238[_0x2ef1('0x4')](_0x4f0d24,_0x39a2d4);};}function removeListener(_0x51c08b,_0x23f98d){return function(){WhatsappAccountEvents['removeListener'](_0x51c08b,_0x23f98d);};}exports[_0x2ef1('0x5')]=function(_0x40bdc4){for(var _0x356745=0x0,_0x4540f2=events[_0x2ef1('0x6')];_0x356745<_0x4540f2;_0x356745++){var _0x15c8ad=events[_0x356745];var _0x3bf9fc=createListener(_0x2ef1('0x7')+_0x15c8ad,_0x40bdc4);WhatsappAccountEvents['on'](_0x15c8ad,_0x3bf9fc);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 911b387..5cfa537 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 _0x161e=['show','post','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x53e770,_0xa39d94){var _0x2b7fd7=function(_0x178c17){while(--_0x178c17){_0x53e770['push'](_0x53e770['shift']());}};_0x2b7fd7(++_0xa39d94);}(_0x161e,0xcb));var _0xe161=function(_0x51807f,_0x2530ad){_0x51807f=_0x51807f-0x0;var _0x3810f1=_0x161e[_0x51807f];return _0x3810f1;};'use strict';var multer=require(_0xe161('0x0'));var util=require(_0xe161('0x1'));var path=require(_0xe161('0x2'));var timeout=require(_0xe161('0x3'));var express=require(_0xe161('0x4'));var router=express[_0xe161('0x5')]();var fs_extra=require(_0xe161('0x6'));var auth=require(_0xe161('0x7'));var interaction=require(_0xe161('0x8'));var config=require(_0xe161('0x9'));var controller=require('./whatsappApplication.controller');router[_0xe161('0xa')]('/',auth['isAuthenticated'](),controller[_0xe161('0xb')]);router[_0xe161('0xa')]('/:id',auth[_0xe161('0xc')](),controller[_0xe161('0xd')]);router[_0xe161('0xe')]('/',auth[_0xe161('0xc')](),controller['create']);router['put'](_0xe161('0xf'),auth[_0xe161('0xc')](),controller[_0xe161('0x10')]);router['delete'](_0xe161('0xf'),auth['isAuthenticated'](),controller[_0xe161('0x11')]);module['exports']=router; \ No newline at end of file +var _0xcc2f=['../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x21b36c,_0x543483){var _0x236627=function(_0x174f99){while(--_0x174f99){_0x21b36c['push'](_0x21b36c['shift']());}};_0x236627(++_0x543483);}(_0xcc2f,0x199));var _0xfcc2=function(_0x5ba374,_0x4f7925){_0x5ba374=_0x5ba374-0x0;var _0x106cdd=_0xcc2f[_0x5ba374];return _0x106cdd;};'use strict';var multer=require(_0xfcc2('0x0'));var util=require('util');var path=require(_0xfcc2('0x1'));var timeout=require(_0xfcc2('0x2'));var express=require(_0xfcc2('0x3'));var router=express['Router']();var fs_extra=require(_0xfcc2('0x4'));var auth=require(_0xfcc2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfcc2('0x6'));var controller=require(_0xfcc2('0x7'));router[_0xfcc2('0x8')]('/',auth[_0xfcc2('0x9')](),controller[_0xfcc2('0xa')]);router['get'](_0xfcc2('0xb'),auth[_0xfcc2('0x9')](),controller[_0xfcc2('0xc')]);router[_0xfcc2('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfcc2('0xe')](_0xfcc2('0xb'),auth[_0xfcc2('0x9')](),controller[_0xfcc2('0xf')]);router['delete'](_0xfcc2('0xb'),auth[_0xfcc2('0x9')](),controller[_0xfcc2('0x10')]);module[_0xfcc2('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 5db3259..71fd3e8 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 _0x7289=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x2d2e85,_0x22faa9){var _0x3e9f5e=function(_0x101c22){while(--_0x101c22){_0x2d2e85['push'](_0x2d2e85['shift']());}};_0x3e9f5e(++_0x22faa9);}(_0x7289,0x118));var _0x9728=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7289[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x9728('0x0'));module[_0x9728('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9728('0x2')],'allowNull':![],'defaultValue':_0x9728('0x3')},'appdata':{'type':Sequelize[_0x9728('0x4')]()},'description':{'type':Sequelize[_0x9728('0x2')]},'interval':{'type':Sequelize[_0x9728('0x2')],'defaultValue':_0x9728('0x5')}}; \ No newline at end of file +var _0xbe80=['STRING','noop','TEXT','sequelize'];(function(_0x17ee9a,_0x259d82){var _0x179e0b=function(_0x18af59){while(--_0x18af59){_0x17ee9a['push'](_0x17ee9a['shift']());}};_0x179e0b(++_0x259d82);}(_0xbe80,0xaf));var _0x0be8=function(_0x289337,_0x3a86e2){_0x289337=_0x289337-0x0;var _0x51ce64=_0xbe80[_0x289337];return _0x51ce64;};'use strict';var Sequelize=require(_0x0be8('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0be8('0x1')],'allowNull':![],'defaultValue':_0x0be8('0x2')},'appdata':{'type':Sequelize[_0x0be8('0x3')]()},'description':{'type':Sequelize[_0x0be8('0x1')]},'interval':{'type':Sequelize[_0x0be8('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 3ae0f74..d649115 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 _0x6c99=['WhatsappApplication','findAll','rows','show','params','intersection','length','includeAll','find','catch','create','body','update','eml-format','zip-dir','util','path','sox','to-csv','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','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','query','keys','filters','attributes','model','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','include'];(function(_0x5adf94,_0x23557e){var _0x4fdf60=function(_0x53db22){while(--_0x53db22){_0x5adf94['push'](_0x5adf94['shift']());}};_0x4fdf60(++_0x23557e);}(_0x6c99,0x9b));var _0x96c9=function(_0x283127,_0x54d4d5){_0x283127=_0x283127-0x0;var _0x43da5d=_0x6c99[_0x283127];return _0x43da5d;};'use strict';var emlformat=require(_0x96c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x96c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x96c9('0x2'));var path=require(_0x96c9('0x3'));var sox=require(_0x96c9('0x4'));var csv=require(_0x96c9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96c9('0x6'));var _=require(_0x96c9('0x7'));var squel=require(_0x96c9('0x8'));var crypto=require(_0x96c9('0x9'));var jsforce=require(_0x96c9('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x96c9('0xb'));var Papa=require('papaparse');var Redis=require(_0x96c9('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x96c9('0xd'));var as=require(_0x96c9('0xe'));var hardwareService=require(_0x96c9('0xf'));var logger=require(_0x96c9('0x10'))('api');var utils=require(_0x96c9('0x11'));var config=require(_0x96c9('0x12'));var licenseUtil=require(_0x96c9('0x13'));var db=require(_0x96c9('0x14'))['db'];function respondWithStatusCode(_0x3e2e57,_0x5243ca){_0x5243ca=_0x5243ca||0xcc;return function(_0x46f105){if(_0x46f105){return _0x3e2e57[_0x96c9('0x15')](_0x5243ca);}return _0x3e2e57[_0x96c9('0x16')](_0x5243ca)[_0x96c9('0x17')]();};}function respondWithResult(_0x59418c,_0x5d1f4e){_0x5d1f4e=_0x5d1f4e||0xc8;return function(_0x3f1cf9){if(_0x3f1cf9){return _0x59418c[_0x96c9('0x16')](_0x5d1f4e)[_0x96c9('0x18')](_0x3f1cf9);}};}function respondWithFilteredResult(_0x2f6ec5,_0x5c1116){return function(_0x4fa3db){if(_0x4fa3db){var _0x5d18da=typeof _0x5c1116[_0x96c9('0x19')]==='undefined'&&typeof _0x5c1116[_0x96c9('0x1a')]==='undefined';var _0x1ceeb0=_0x4fa3db[_0x96c9('0x1b')];var _0x21a0d0=_0x5d18da?0x0:_0x5c1116[_0x96c9('0x19')];var _0x3bdf8f=_0x5d18da?_0x4fa3db['count']:_0x5c1116[_0x96c9('0x19')]+_0x5c1116['limit'];var _0x3dd3de;if(_0x3bdf8f>=_0x1ceeb0){_0x3bdf8f=_0x1ceeb0;_0x3dd3de=0xc8;}else{_0x3dd3de=0xce;}_0x2f6ec5[_0x96c9('0x16')](_0x3dd3de);return _0x2f6ec5[_0x96c9('0x1c')]('Content-Range',_0x21a0d0+'-'+_0x3bdf8f+'/'+_0x1ceeb0)['json'](_0x4fa3db);}return null;};}function patchUpdates(_0x17aea5){return function(_0x20f974){try{jsonpatch[_0x96c9('0x1d')](_0x20f974,_0x17aea5,!![]);}catch(_0x1bf748){return BPromise[_0x96c9('0x1e')](_0x1bf748);}return _0x20f974[_0x96c9('0x1f')]();};}function saveUpdates(_0x596453,_0x101a25){return function(_0x3a7fc5){if(_0x3a7fc5){return _0x3a7fc5['update'](_0x596453)[_0x96c9('0x20')](function(_0x2a7ae1){return _0x2a7ae1;});}return null;};}function removeEntity(_0x185bb5,_0x575364){return function(_0x13e642){if(_0x13e642){return _0x13e642[_0x96c9('0x21')]()[_0x96c9('0x20')](function(){_0x185bb5[_0x96c9('0x16')](0xcc)[_0x96c9('0x17')]();});}};}function handleEntityNotFound(_0x2b7ad3,_0x62b05e){return function(_0x5c7252){if(!_0x5c7252){_0x2b7ad3[_0x96c9('0x15')](0x194);}return _0x5c7252;};}function handleError(_0x40b1db,_0x316d86){_0x316d86=_0x316d86||0x1f4;return function(_0x3b8b0f){logger[_0x96c9('0x22')](_0x3b8b0f[_0x96c9('0x23')]);if(_0x3b8b0f[_0x96c9('0x24')]){delete _0x3b8b0f[_0x96c9('0x24')];}_0x40b1db[_0x96c9('0x16')](_0x316d86)[_0x96c9('0x25')](_0x3b8b0f);};}exports[_0x96c9('0x26')]=function(_0x7d2858,_0x56b920){var _0x5364e5={},_0x342216={},_0x3a770b={'count':0x0,'rows':[]};var _0x4cae5a=_[_0x96c9('0x27')](db['WhatsappApplication']['rawAttributes'],function(_0x1fa934){return{'name':_0x1fa934[_0x96c9('0x28')],'type':_0x1fa934[_0x96c9('0x29')]['key']};});_0x342216['model']=_[_0x96c9('0x27')](_0x4cae5a,_0x96c9('0x24'));_0x342216[_0x96c9('0x2a')]=_[_0x96c9('0x2b')](_0x7d2858[_0x96c9('0x2a')]);_0x342216[_0x96c9('0x2c')]=_['intersection'](_0x342216['model'],_0x342216[_0x96c9('0x2a')]);_0x5364e5[_0x96c9('0x2d')]=_['intersection'](_0x342216[_0x96c9('0x2e')],qs[_0x96c9('0x2f')](_0x7d2858[_0x96c9('0x2a')][_0x96c9('0x2f')]));_0x5364e5[_0x96c9('0x2d')]=_0x5364e5[_0x96c9('0x2d')]['length']?_0x5364e5[_0x96c9('0x2d')]:_0x342216[_0x96c9('0x2e')];if(!_0x7d2858[_0x96c9('0x2a')][_0x96c9('0x30')]('nolimit')){_0x5364e5[_0x96c9('0x1a')]=qs['limit'](_0x7d2858['query'][_0x96c9('0x1a')]);_0x5364e5['offset']=qs[_0x96c9('0x19')](_0x7d2858['query'][_0x96c9('0x19')]);}_0x5364e5[_0x96c9('0x31')]=qs[_0x96c9('0x32')](_0x7d2858['query']['sort']);_0x5364e5[_0x96c9('0x33')]=qs['filters'](_[_0x96c9('0x34')](_0x7d2858['query'],_0x342216[_0x96c9('0x2c')]),_0x4cae5a);if(_0x7d2858[_0x96c9('0x2a')][_0x96c9('0x35')]){_0x5364e5[_0x96c9('0x33')]=_['merge'](_0x5364e5[_0x96c9('0x33')],{'$or':_[_0x96c9('0x27')](_0x4cae5a,function(_0x338925){if(_0x338925[_0x96c9('0x29')]!==_0x96c9('0x36')){var _0x770669={};_0x770669[_0x338925[_0x96c9('0x24')]]={'$like':'%'+_0x7d2858[_0x96c9('0x2a')][_0x96c9('0x35')]+'%'};return _0x770669;}})});}_0x5364e5=_[_0x96c9('0x37')]({},_0x5364e5,_0x7d2858[_0x96c9('0x38')]);var _0x331735={'where':_0x5364e5['where']};return db['WhatsappApplication'][_0x96c9('0x1b')](_0x331735)[_0x96c9('0x20')](function(_0x59db64){_0x3a770b[_0x96c9('0x1b')]=_0x59db64;if(_0x7d2858[_0x96c9('0x2a')]['includeAll']){_0x5364e5[_0x96c9('0x39')]=[{'all':!![]}];}return db[_0x96c9('0x3a')][_0x96c9('0x3b')](_0x5364e5);})[_0x96c9('0x20')](function(_0x3b64c8){_0x3a770b[_0x96c9('0x3c')]=_0x3b64c8;return _0x3a770b;})[_0x96c9('0x20')](respondWithFilteredResult(_0x56b920,_0x5364e5))['catch'](handleError(_0x56b920,null));};exports[_0x96c9('0x3d')]=function(_0x3d9056,_0x18592b){var _0x3a3399={'raw':!![],'where':{'id':_0x3d9056[_0x96c9('0x3e')]['id']}},_0x49ee79={};_0x49ee79['model']=_[_0x96c9('0x2b')](db[_0x96c9('0x3a')]['rawAttributes']);_0x49ee79[_0x96c9('0x2a')]=_[_0x96c9('0x2b')](_0x3d9056[_0x96c9('0x2a')]);_0x49ee79[_0x96c9('0x2c')]=_[_0x96c9('0x3f')](_0x49ee79[_0x96c9('0x2e')],_0x49ee79[_0x96c9('0x2a')]);_0x3a3399[_0x96c9('0x2d')]=_[_0x96c9('0x3f')](_0x49ee79['model'],qs['fields'](_0x3d9056[_0x96c9('0x2a')][_0x96c9('0x2f')]));_0x3a3399[_0x96c9('0x2d')]=_0x3a3399[_0x96c9('0x2d')][_0x96c9('0x40')]?_0x3a3399['attributes']:_0x49ee79[_0x96c9('0x2e')];if(_0x3d9056[_0x96c9('0x2a')][_0x96c9('0x41')]){_0x3a3399[_0x96c9('0x39')]=[{'all':!![]}];}_0x3a3399=_['merge']({},_0x3a3399,_0x3d9056['options']);return db[_0x96c9('0x3a')][_0x96c9('0x42')](_0x3a3399)[_0x96c9('0x20')](handleEntityNotFound(_0x18592b,null))['then'](respondWithResult(_0x18592b,null))[_0x96c9('0x43')](handleError(_0x18592b,null));};exports['create']=function(_0x3c4bf1,_0x2071d5){return db['WhatsappApplication'][_0x96c9('0x44')](_0x3c4bf1[_0x96c9('0x45')],{})['then'](respondWithResult(_0x2071d5,0xc9))[_0x96c9('0x43')](handleError(_0x2071d5,null));};exports[_0x96c9('0x46')]=function(_0x986731,_0x16156e){if(_0x986731[_0x96c9('0x45')]['id']){delete _0x986731[_0x96c9('0x45')]['id'];}return db[_0x96c9('0x3a')][_0x96c9('0x42')]({'where':{'id':_0x986731[_0x96c9('0x3e')]['id']}})[_0x96c9('0x20')](handleEntityNotFound(_0x16156e,null))['then'](saveUpdates(_0x986731[_0x96c9('0x45')],null))['then'](respondWithResult(_0x16156e,null))[_0x96c9('0x43')](handleError(_0x16156e,null));};exports[_0x96c9('0x21')]=function(_0x25f3df,_0x59dea7){return db[_0x96c9('0x3a')][_0x96c9('0x42')]({'where':{'id':_0x25f3df[_0x96c9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x59dea7,null))[_0x96c9('0x20')](removeEntity(_0x59dea7,null))[_0x96c9('0x43')](handleError(_0x59dea7,null));}; \ No newline at end of file +var _0x7366=['findAll','rows','show','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','WhatsappApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include'];(function(_0xb143e,_0x30d387){var _0x2f76e3=function(_0x5ba00f){while(--_0x5ba00f){_0xb143e['push'](_0xb143e['shift']());}};_0x2f76e3(++_0x30d387);}(_0x7366,0x9d));var _0x6736=function(_0x5abe82,_0x3f4b65){_0x5abe82=_0x5abe82-0x0;var _0x2f8f38=_0x7366[_0x5abe82];return _0x2f8f38;};'use strict';var emlformat=require(_0x6736('0x0'));var rimraf=require(_0x6736('0x1'));var zipdir=require(_0x6736('0x2'));var jsonpatch=require(_0x6736('0x3'));var rp=require(_0x6736('0x4'));var moment=require(_0x6736('0x5'));var BPromise=require(_0x6736('0x6'));var Mustache=require(_0x6736('0x7'));var util=require(_0x6736('0x8'));var path=require('path');var sox=require(_0x6736('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6736('0xa'));var _=require(_0x6736('0xb'));var squel=require(_0x6736('0xc'));var crypto=require('crypto');var jsforce=require(_0x6736('0xd'));var deskjs=require(_0x6736('0xe'));var toCsv=require(_0x6736('0xf'));var querystring=require('querystring');var Papa=require(_0x6736('0x10'));var Redis=require(_0x6736('0x11'));var authService=require(_0x6736('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6736('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6736('0x14'))(_0x6736('0x15'));var utils=require('../../config/utils');var config=require(_0x6736('0x16'));var licenseUtil=require(_0x6736('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54a33b,_0x5327ae){_0x5327ae=_0x5327ae||0xcc;return function(_0x33fa75){if(_0x33fa75){return _0x54a33b[_0x6736('0x18')](_0x5327ae);}return _0x54a33b[_0x6736('0x19')](_0x5327ae)[_0x6736('0x1a')]();};}function respondWithResult(_0x419a6d,_0x200a47){_0x200a47=_0x200a47||0xc8;return function(_0x34457a){if(_0x34457a){return _0x419a6d[_0x6736('0x19')](_0x200a47)[_0x6736('0x1b')](_0x34457a);}};}function respondWithFilteredResult(_0x19a7ed,_0x1cc748){return function(_0x219522){if(_0x219522){var _0x189906=typeof _0x1cc748[_0x6736('0x1c')]===_0x6736('0x1d')&&typeof _0x1cc748[_0x6736('0x1e')]==='undefined';var _0x454771=_0x219522[_0x6736('0x1f')];var _0x22417f=_0x189906?0x0:_0x1cc748['offset'];var _0x450e26=_0x189906?_0x219522['count']:_0x1cc748[_0x6736('0x1c')]+_0x1cc748[_0x6736('0x1e')];var _0x821e27;if(_0x450e26>=_0x454771){_0x450e26=_0x454771;_0x821e27=0xc8;}else{_0x821e27=0xce;}_0x19a7ed[_0x6736('0x19')](_0x821e27);return _0x19a7ed[_0x6736('0x20')](_0x6736('0x21'),_0x22417f+'-'+_0x450e26+'/'+_0x454771)['json'](_0x219522);}return null;};}function patchUpdates(_0x59e2bb){return function(_0x445064){try{jsonpatch[_0x6736('0x22')](_0x445064,_0x59e2bb,!![]);}catch(_0x1454f3){return BPromise[_0x6736('0x23')](_0x1454f3);}return _0x445064[_0x6736('0x24')]();};}function saveUpdates(_0x36b84d,_0x3f59d5){return function(_0x4b2600){if(_0x4b2600){return _0x4b2600[_0x6736('0x25')](_0x36b84d)[_0x6736('0x26')](function(_0x256f03){return _0x256f03;});}return null;};}function removeEntity(_0x2cc815,_0x2e7692){return function(_0xf2957d){if(_0xf2957d){return _0xf2957d[_0x6736('0x27')]()['then'](function(){_0x2cc815[_0x6736('0x19')](0xcc)[_0x6736('0x1a')]();});}};}function handleEntityNotFound(_0x3f3bef,_0x1accc4){return function(_0x5a1dd7){if(!_0x5a1dd7){_0x3f3bef['sendStatus'](0x194);}return _0x5a1dd7;};}function handleError(_0xa84f84,_0x2b9de4){_0x2b9de4=_0x2b9de4||0x1f4;return function(_0x390e3f){logger['error'](_0x390e3f['stack']);if(_0x390e3f[_0x6736('0x28')]){delete _0x390e3f[_0x6736('0x28')];}_0xa84f84[_0x6736('0x19')](_0x2b9de4)[_0x6736('0x29')](_0x390e3f);};}exports['index']=function(_0x4e3264,_0x4ff41a){var _0x3f60b7={},_0x24eb0b={},_0x4f8ab0={'count':0x0,'rows':[]};var _0x25106e=_['map'](db[_0x6736('0x2a')][_0x6736('0x2b')],function(_0x22952c){return{'name':_0x22952c[_0x6736('0x2c')],'type':_0x22952c[_0x6736('0x2d')][_0x6736('0x2e')]};});_0x24eb0b[_0x6736('0x2f')]=_[_0x6736('0x30')](_0x25106e,_0x6736('0x28'));_0x24eb0b[_0x6736('0x31')]=_[_0x6736('0x32')](_0x4e3264['query']);_0x24eb0b[_0x6736('0x33')]=_[_0x6736('0x34')](_0x24eb0b[_0x6736('0x2f')],_0x24eb0b['query']);_0x3f60b7[_0x6736('0x35')]=_[_0x6736('0x34')](_0x24eb0b['model'],qs[_0x6736('0x36')](_0x4e3264[_0x6736('0x31')][_0x6736('0x36')]));_0x3f60b7[_0x6736('0x35')]=_0x3f60b7[_0x6736('0x35')][_0x6736('0x37')]?_0x3f60b7[_0x6736('0x35')]:_0x24eb0b[_0x6736('0x2f')];if(!_0x4e3264['query'][_0x6736('0x38')]('nolimit')){_0x3f60b7['limit']=qs['limit'](_0x4e3264[_0x6736('0x31')]['limit']);_0x3f60b7[_0x6736('0x1c')]=qs[_0x6736('0x1c')](_0x4e3264['query'][_0x6736('0x1c')]);}_0x3f60b7[_0x6736('0x39')]=qs[_0x6736('0x3a')](_0x4e3264['query']['sort']);_0x3f60b7[_0x6736('0x3b')]=qs['filters'](_[_0x6736('0x3c')](_0x4e3264[_0x6736('0x31')],_0x24eb0b[_0x6736('0x33')]),_0x25106e);if(_0x4e3264['query'][_0x6736('0x3d')]){_0x3f60b7['where']=_[_0x6736('0x3e')](_0x3f60b7[_0x6736('0x3b')],{'$or':_[_0x6736('0x30')](_0x25106e,function(_0x2aec7e){if(_0x2aec7e[_0x6736('0x2d')]!=='VIRTUAL'){var _0x571ee5={};_0x571ee5[_0x2aec7e[_0x6736('0x28')]]={'$like':'%'+_0x4e3264['query'][_0x6736('0x3d')]+'%'};return _0x571ee5;}})});}_0x3f60b7=_[_0x6736('0x3e')]({},_0x3f60b7,_0x4e3264[_0x6736('0x3f')]);var _0x14fb32={'where':_0x3f60b7['where']};return db[_0x6736('0x2a')][_0x6736('0x1f')](_0x14fb32)[_0x6736('0x26')](function(_0x5c3182){_0x4f8ab0[_0x6736('0x1f')]=_0x5c3182;if(_0x4e3264['query']['includeAll']){_0x3f60b7[_0x6736('0x40')]=[{'all':!![]}];}return db[_0x6736('0x2a')][_0x6736('0x41')](_0x3f60b7);})[_0x6736('0x26')](function(_0x5e167e){_0x4f8ab0[_0x6736('0x42')]=_0x5e167e;return _0x4f8ab0;})[_0x6736('0x26')](respondWithFilteredResult(_0x4ff41a,_0x3f60b7))['catch'](handleError(_0x4ff41a,null));};exports[_0x6736('0x43')]=function(_0x85a745,_0x54f38a){var _0x56ea75={'raw':!![],'where':{'id':_0x85a745[_0x6736('0x44')]['id']}},_0x210fb6={};_0x210fb6[_0x6736('0x2f')]=_[_0x6736('0x32')](db[_0x6736('0x2a')][_0x6736('0x2b')]);_0x210fb6['query']=_[_0x6736('0x32')](_0x85a745[_0x6736('0x31')]);_0x210fb6['filters']=_[_0x6736('0x34')](_0x210fb6[_0x6736('0x2f')],_0x210fb6['query']);_0x56ea75[_0x6736('0x35')]=_[_0x6736('0x34')](_0x210fb6[_0x6736('0x2f')],qs[_0x6736('0x36')](_0x85a745['query'][_0x6736('0x36')]));_0x56ea75[_0x6736('0x35')]=_0x56ea75[_0x6736('0x35')][_0x6736('0x37')]?_0x56ea75[_0x6736('0x35')]:_0x210fb6[_0x6736('0x2f')];if(_0x85a745[_0x6736('0x31')][_0x6736('0x45')]){_0x56ea75['include']=[{'all':!![]}];}_0x56ea75=_[_0x6736('0x3e')]({},_0x56ea75,_0x85a745['options']);return db[_0x6736('0x2a')][_0x6736('0x46')](_0x56ea75)[_0x6736('0x26')](handleEntityNotFound(_0x54f38a,null))[_0x6736('0x26')](respondWithResult(_0x54f38a,null))[_0x6736('0x47')](handleError(_0x54f38a,null));};exports['create']=function(_0x34c5c5,_0x3c7f5e){return db[_0x6736('0x2a')][_0x6736('0x48')](_0x34c5c5['body'],{})[_0x6736('0x26')](respondWithResult(_0x3c7f5e,0xc9))[_0x6736('0x47')](handleError(_0x3c7f5e,null));};exports[_0x6736('0x25')]=function(_0x35cb1f,_0x4810b7){if(_0x35cb1f[_0x6736('0x49')]['id']){delete _0x35cb1f[_0x6736('0x49')]['id'];}return db[_0x6736('0x2a')][_0x6736('0x46')]({'where':{'id':_0x35cb1f[_0x6736('0x44')]['id']}})[_0x6736('0x26')](handleEntityNotFound(_0x4810b7,null))['then'](saveUpdates(_0x35cb1f[_0x6736('0x49')],null))['then'](respondWithResult(_0x4810b7,null))[_0x6736('0x47')](handleError(_0x4810b7,null));};exports[_0x6736('0x27')]=function(_0x1cb7b4,_0x1cbe3d){return db[_0x6736('0x2a')][_0x6736('0x46')]({'where':{'id':_0x1cb7b4['params']['id']}})['then'](handleEntityNotFound(_0x1cbe3d,null))['then'](removeEntity(_0x1cbe3d,null))[_0x6736('0x47')](handleError(_0x1cbe3d,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 149e6ac..fb7d735 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 _0x9f62=['define','WhatsappApplication','whatsapp_applications','utf8mb4','util','api','moment','bluebird','rimraf','../../config/environment','./whatsappApplication.attributes','exports'];(function(_0x1b4002,_0x5b4094){var _0x1716f3=function(_0x47cfd1){while(--_0x47cfd1){_0x1b4002['push'](_0x1b4002['shift']());}};_0x1716f3(++_0x5b4094);}(_0x9f62,0x154));var _0x29f6=function(_0x19edfd,_0x45265e){_0x19edfd=_0x19edfd-0x0;var _0x277942=_0x9f62[_0x19edfd];return _0x277942;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x29f6('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf452=['request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x19a0a0,_0x20d72b){var _0x583263=function(_0x24ad79){while(--_0x24ad79){_0x19a0a0['push'](_0x19a0a0['shift']());}};_0x583263(++_0x20d72b);}(_0xf452,0x13b));var _0x2f45=function(_0x35f6bd,_0x3381c2){_0x35f6bd=_0x35f6bd-0x0;var _0x172763=_0xf452[_0x35f6bd];return _0x172763;};'use strict';var _=require(_0x2f45('0x0'));var util=require(_0x2f45('0x1'));var logger=require('../../config/logger')(_0x2f45('0x2'));var moment=require(_0x2f45('0x3'));var BPromise=require(_0x2f45('0x4'));var rp=require(_0x2f45('0x5'));var fs=require('fs');var path=require(_0x2f45('0x6'));var rimraf=require(_0x2f45('0x7'));var config=require(_0x2f45('0x8'));var attributes=require(_0x2f45('0x9'));module[_0x2f45('0xa')]=function(_0x416e83,_0x1a53cf){return _0x416e83[_0x2f45('0xb')](_0x2f45('0xc'),attributes,{'tableName':_0x2f45('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2f45('0xe'),'collate':_0x2f45('0xf')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index ac6f075..a455e4b 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 _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0xa3dd1c,_0x487a9a){var _0x2952d7=function(_0x2ec7ad){while(--_0x2ec7ad){_0xa3dd1c['push'](_0xa3dd1c['shift']());}};_0x2952d7(++_0x487a9a);}(_0x54ef,0x112));var _0xf54e=function(_0x232a33,_0x42d8a7){_0x232a33=_0x232a33-0x0;var _0x39dbf4=_0x54ef[_0x232a33];return _0x39dbf4;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s'];(function(_0x4ebbfe,_0x13d8b0){var _0x479873=function(_0x4c91cc){while(--_0x4c91cc){_0x4ebbfe['push'](_0x4ebbfe['shift']());}};_0x479873(++_0x13d8b0);}(_0x00bb,0x1d8));var _0xb00b=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x00bb[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index b5badd3..ff5c1bd 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 _0x8d0a=['whatsappinteraction:addtags','put','tracked','whatsappinteraction:update','delete','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','/:id','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','whatsapp'];(function(_0x5de02c,_0x2bca83){var _0x5bee77=function(_0x447356){while(--_0x447356){_0x5de02c['push'](_0x5de02c['shift']());}};_0x5bee77(++_0x2bca83);}(_0x8d0a,0x65));var _0xa8d0=function(_0x366f2d,_0x582372){_0x366f2d=_0x366f2d-0x0;var _0xd8fd45=_0x8d0a[_0x366f2d];return _0xd8fd45;};'use strict';var multer=require(_0xa8d0('0x0'));var util=require('util');var path=require(_0xa8d0('0x1'));var timeout=require(_0xa8d0('0x2'));var express=require(_0xa8d0('0x3'));var router=express[_0xa8d0('0x4')]();var fs_extra=require(_0xa8d0('0x5'));var auth=require(_0xa8d0('0x6'));var interaction=require(_0xa8d0('0x7'));var config=require(_0xa8d0('0x8'));var controller=require(_0xa8d0('0x9'));router['get']('/',auth[_0xa8d0('0xa')](),controller[_0xa8d0('0xb')]);router[_0xa8d0('0xc')](_0xa8d0('0xd'),auth[_0xa8d0('0xa')](),controller['describe']);router['get'](_0xa8d0('0xe'),auth[_0xa8d0('0xa')](),controller['show']);router['get']('/:id/messages',auth[_0xa8d0('0xa')](),controller['getMessages']);router[_0xa8d0('0xc')](_0xa8d0('0xf'),auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x10')]);router[_0xa8d0('0x11')]('/',auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x12')]);router[_0xa8d0('0x11')](_0xa8d0('0x13'),auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x14')]);router['post'](_0xa8d0('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0xa8d0('0x16'),_0xa8d0('0x17')),controller['addTags']);router[_0xa8d0('0x18')](_0xa8d0('0xe'),auth[_0xa8d0('0xa')](),interaction[_0xa8d0('0x19')](_0xa8d0('0x16'),_0xa8d0('0x1a')),controller['update']);router[_0xa8d0('0x1b')](_0xa8d0('0xe'),auth['isAuthenticated'](),interaction[_0xa8d0('0x19')](_0xa8d0('0x16'),'whatsappinteraction:destroy'),controller[_0xa8d0('0x1c')]);router[_0xa8d0('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa8d0('0x1d')]);module[_0xa8d0('0x1e')]=router; \ No newline at end of file +var _0x7ee1=['whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','isAuthenticated','/:id','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x7ee1,0x8d));var _0x17ee=function(_0x4a5927,_0x3f5721){_0x4a5927=_0x4a5927-0x0;var _0x1c9d3a=_0x7ee1[_0x4a5927];return _0x1c9d3a;};'use strict';var multer=require(_0x17ee('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x17ee('0x1'));var router=express[_0x17ee('0x2')]();var fs_extra=require(_0x17ee('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var controller=require(_0x17ee('0x6'));router[_0x17ee('0x7')]('/',auth['isAuthenticated'](),controller[_0x17ee('0x8')]);router[_0x17ee('0x7')]('/describe',auth[_0x17ee('0x9')](),controller['describe']);router[_0x17ee('0x7')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller['show']);router['get']('/:id/messages',auth[_0x17ee('0x9')](),controller['getMessages']);router[_0x17ee('0x7')](_0x17ee('0xb'),auth[_0x17ee('0x9')](),controller[_0x17ee('0xc')]);router['post']('/',auth[_0x17ee('0x9')](),controller['create']);router[_0x17ee('0xd')](_0x17ee('0xe'),auth[_0x17ee('0x9')](),controller[_0x17ee('0xf')]);router[_0x17ee('0xd')](_0x17ee('0x10'),auth[_0x17ee('0x9')](),interaction[_0x17ee('0x11')](_0x17ee('0x12'),_0x17ee('0x13')),controller[_0x17ee('0x14')]);router['put']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x17ee('0x12'),_0x17ee('0x15')),controller[_0x17ee('0x16')]);router[_0x17ee('0x17')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),interaction[_0x17ee('0x11')]('whatsapp',_0x17ee('0x18')),controller[_0x17ee('0x19')]);router[_0x17ee('0x17')](_0x17ee('0x10'),auth[_0x17ee('0x9')](),controller['removeTags']);module[_0x17ee('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 5989640..240a904 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 _0xc474=['STRING','ENUM','out','BOOLEAN','sequelize','moment','exports','DATE'];(function(_0x543795,_0x12b2e3){var _0xa2761a=function(_0x371a65){while(--_0x371a65){_0x543795['push'](_0x543795['shift']());}};_0xa2761a(++_0x12b2e3);}(_0xc474,0xfc));var _0x4c47=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xc474[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x4c47('0x0'));var moment=require(_0x4c47('0x1'));module[_0x4c47('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4c47('0x3')]},'disposition':{'type':Sequelize[_0x4c47('0x4')]},'secondDisposition':{'type':Sequelize[_0x4c47('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4c47('0x4')]},'note':{'type':Sequelize[_0x4c47('0x4')]},'phone':{'type':Sequelize[_0x4c47('0x4')]},'read1stAt':{'type':Sequelize[_0x4c47('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4c47('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4c47('0x5')]('in',_0x4c47('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4c47('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x98a8=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x13524d,_0x505b49){var _0x9918b4=function(_0xef1f0a){while(--_0xef1f0a){_0x13524d['push'](_0x13524d['shift']());}};_0x9918b4(++_0x505b49);}(_0x98a8,0x12c));var _0x898a=function(_0x14d1f7,_0x34ee1a){_0x14d1f7=_0x14d1f7-0x0;var _0x3989de=_0x98a8[_0x14d1f7];return _0x3989de;};'use strict';var Sequelize=require(_0x898a('0x0'));var moment=require(_0x898a('0x1'));module[_0x898a('0x2')]={'closed':{'type':Sequelize[_0x898a('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x898a('0x4')]},'disposition':{'type':Sequelize[_0x898a('0x5')]},'secondDisposition':{'type':Sequelize[_0x898a('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x898a('0x5')]},'phone':{'type':Sequelize[_0x898a('0x5')]},'read1stAt':{'type':Sequelize[_0x898a('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x898a('0x6')]('in',_0x898a('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x898a('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x898a('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 f2267b8..4a83471 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 _0x20de=['Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','rows','show','includeAll','include','catch','create','params','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','$gte','options','findAll','addTags','setTags','spread','removeTags','server','files','tmp','join','root','attachments','format','transcript-%d-%s.zip','push','CmContact','lastName','Attachment','Messages','WhatsappAccount','mkdirSync','Whatsapp','Owner','YYYY-MM-DD\x20HH:mm:ss','basename','createReadStream','pipe','createWriteStream','direction','out','firstName','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','send','Users','map','fullname','TagIds','split','Tags','waiting','unmanaged','total','UserId','closed','talking','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','select','field','color','from','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','compact','isEmpty','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.phone\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.email'];(function(_0x3b4c6b,_0x50e853){var _0x46466b=function(_0x2f8488){while(--_0x2f8488){_0x3b4c6b['push'](_0x3b4c6b['shift']());}};_0x46466b(++_0x50e853);}(_0x20de,0x134));var _0xe20d=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x20de[_0xaa1b3e];return _0x454d7d;};'use strict';var emlformat=require(_0xe20d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe20d('0x1'));var jsonpatch=require(_0xe20d('0x2'));var rp=require(_0xe20d('0x3'));var moment=require(_0xe20d('0x4'));var BPromise=require(_0xe20d('0x5'));var Mustache=require(_0xe20d('0x6'));var util=require(_0xe20d('0x7'));var path=require(_0xe20d('0x8'));var sox=require(_0xe20d('0x9'));var csv=require(_0xe20d('0xa'));var ejs=require(_0xe20d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe20d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe20d('0xd'));var toCsv=require(_0xe20d('0xa'));var querystring=require(_0xe20d('0xe'));var Papa=require('papaparse');var Redis=require(_0xe20d('0xf'));var authService=require(_0xe20d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe20d('0x11'));var pdf=require(_0xe20d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe20d('0x13'))(_0xe20d('0x14'));var utils=require(_0xe20d('0x15'));var config=require(_0xe20d('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe20d('0x17')]=_[_0xe20d('0x18')](config[_0xe20d('0x17')],{'host':_0xe20d('0x19'),'port':0x18eb});var socket=require(_0xe20d('0x1a'))(new Redis(config[_0xe20d('0x17')]));require(_0xe20d('0x1b'))[_0xe20d('0x1c')](socket);function respondWithStatusCode(_0x211734,_0x56eeea){_0x56eeea=_0x56eeea||0xcc;return function(_0x2367f7){if(_0x2367f7){return _0x211734['sendStatus'](_0x56eeea);}return _0x211734[_0xe20d('0x1d')](_0x56eeea)[_0xe20d('0x1e')]();};}function respondWithResult(_0x29b500,_0x53f8c3){_0x53f8c3=_0x53f8c3||0xc8;return function(_0x1d6179){if(_0x1d6179){return _0x29b500['status'](_0x53f8c3)[_0xe20d('0x1f')](_0x1d6179);}};}function respondWithFilteredResult(_0x1f2058,_0x285916){return function(_0x4e8dd6){if(_0x4e8dd6){var _0x4353cb=typeof _0x285916[_0xe20d('0x20')]===_0xe20d('0x21')&&typeof _0x285916[_0xe20d('0x22')]==='undefined';var _0x10db76=_0x4e8dd6[_0xe20d('0x23')];var _0x25a17d=_0x4353cb?0x0:_0x285916[_0xe20d('0x20')];var _0x48577c=_0x4353cb?_0x4e8dd6[_0xe20d('0x23')]:_0x285916['offset']+_0x285916['limit'];var _0x1fae60;if(_0x48577c>=_0x10db76){_0x48577c=_0x10db76;_0x1fae60=0xc8;}else{_0x1fae60=0xce;}_0x1f2058[_0xe20d('0x1d')](_0x1fae60);return _0x1f2058['set']('Content-Range',_0x25a17d+'-'+_0x48577c+'/'+_0x10db76)[_0xe20d('0x1f')](_0x4e8dd6);}return null;};}function patchUpdates(_0x25734b){return function(_0x5ce547){try{jsonpatch[_0xe20d('0x24')](_0x5ce547,_0x25734b,!![]);}catch(_0x3fc8b0){return BPromise[_0xe20d('0x25')](_0x3fc8b0);}return _0x5ce547[_0xe20d('0x26')]();};}function saveUpdates(_0x382c1d,_0x5de788){return function(_0x1d88fd){if(_0x1d88fd){return _0x1d88fd[_0xe20d('0x27')](_0x382c1d)[_0xe20d('0x28')](function(_0x4504ee){return _0x4504ee;});}return null;};}function removeEntity(_0x21a53a,_0x51f395){return function(_0x5f1626){if(_0x5f1626){return _0x5f1626[_0xe20d('0x29')]()['then'](function(){_0x21a53a[_0xe20d('0x1d')](0xcc)[_0xe20d('0x1e')]();});}};}function handleEntityNotFound(_0x7391e1,_0x46fc0e){return function(_0x42b1b1){if(!_0x42b1b1){_0x7391e1[_0xe20d('0x2a')](0x194);}return _0x42b1b1;};}function handleError(_0x2c2136,_0x59d416){_0x59d416=_0x59d416||0x1f4;return function(_0x8b7386){logger['error'](_0x8b7386['stack']);if(_0x8b7386['name']){delete _0x8b7386['name'];}_0x2c2136['status'](_0x59d416)[_0xe20d('0x2b')](_0x8b7386);};}function getInteractionUsers(_0x1387dd,_0x41e140){return new BPromise(function(_0x4f2d27,_0x4f4369){try{if(_0x41e140[_0x1387dd['id']]){_0x1387dd[_0xe20d('0x2c')]=_[_0xe20d('0x2d')](_0x41e140[_0x1387dd['id']],function(_0xb91aa){return{'id':_0xb91aa['id'],'fullname':_0xb91aa[_0xe20d('0x2e')]};});}}catch(_0x3d80ff){_0x4f4369(_0x3d80ff);}_0x4f2d27(_0x1387dd);});}function getInteractionTags(_0x388957,_0x36b04b){return new BPromise(function(_0x3a1dcb,_0x494df3){try{if(_0x388957[_0xe20d('0x2f')]){_0x388957['Tags']=[];_0x388957['TagIds'][_0xe20d('0x30')](',')['forEach'](function(_0x1da98b){_0x388957[_0xe20d('0x31')]['push'](_0x36b04b[_0x1da98b]);});}delete _0x388957['TagIds'];}catch(_0x4787ad){_0x494df3(_0x4787ad);}_0x3a1dcb(_0x388957);});}function updateWhatsappInteraction(_0x2b1867,_0x163704,_0x378b8a){return new BPromise(function(_0x972553,_0x3448d4){return getInteractionUsers(_0x2b1867,_0x378b8a)[_0xe20d('0x28')](function(_0x4b5a10){return getInteractionTags(_0x4b5a10,_0x163704);})[_0xe20d('0x28')](function(_0x85e074){return getStateInteraction(_0x85e074);})[_0xe20d('0x28')](function(_0x32e22f){_0x972553(_0x32e22f);})['catch'](function(_0x1da5bf){_0x3448d4(_0x1da5bf);});});}function getStateInteraction(_0x19b190){return new BPromise(function(_0x30bfc7){_0x19b190[_0xe20d('0x32')]=0x0;_0x19b190['talking']=0x0;_0x19b190['answered']=0x0;_0x19b190[_0xe20d('0x33')]=0x0;_0x19b190[_0xe20d('0x34')]=0x0;if(!_0x19b190['closed']&&!_0x19b190[_0xe20d('0x35')]){_0x19b190[_0xe20d('0x32')]+=0x1;}if(!_0x19b190[_0xe20d('0x36')]&&_0x19b190[_0xe20d('0x35')]){_0x19b190[_0xe20d('0x37')]+=0x1;if(_0x19b190[_0xe20d('0x32')]){_0x19b190[_0xe20d('0x32')]-=0x1;}}if(_0x19b190[_0xe20d('0x36')]&&_0x19b190['UserId']){_0x19b190['answered']+=0x1;if(_0x19b190['talking']){_0x19b190[_0xe20d('0x37')]-=0x1;}}if(_0x19b190[_0xe20d('0x36')]&&!_0x19b190['UserId']){_0x19b190[_0xe20d('0x33')]+=0x1;if(_0x19b190[_0xe20d('0x32')]){_0x19b190['waiting']-=0x1;}}_0x19b190['total']+=0x1;_0x30bfc7(_0x19b190);});}exports[_0xe20d('0x38')]=function(_0x51415f,_0x2ffa5b){var _0x590f07={},_0x1d5e89={},_0x3b3a80={'count':0x0,'rows':[]};var _0x4d0716=_[_0xe20d('0x2d')](db[_0xe20d('0x39')][_0xe20d('0x3a')],function(_0x595f95){return{'name':_0x595f95[_0xe20d('0x3b')],'type':_0x595f95[_0xe20d('0x3c')][_0xe20d('0x3d')]};});_0x1d5e89[_0xe20d('0x3e')]=_[_0xe20d('0x2d')](_0x4d0716,_0xe20d('0x3f'));_0x1d5e89[_0xe20d('0x40')]=_[_0xe20d('0x41')](_0x51415f[_0xe20d('0x40')]);_0x1d5e89['filters']=_[_0xe20d('0x42')](_0x1d5e89['model'],_0x1d5e89[_0xe20d('0x40')]);_0x590f07[_0xe20d('0x43')]=_[_0xe20d('0x42')](_0x1d5e89[_0xe20d('0x3e')],qs[_0xe20d('0x44')](_0x51415f['query'][_0xe20d('0x44')]));_0x590f07[_0xe20d('0x43')]=_0x590f07[_0xe20d('0x43')][_0xe20d('0x45')]?_0x590f07[_0xe20d('0x43')]:_0x1d5e89[_0xe20d('0x3e')];if(!_0x51415f['query'][_0xe20d('0x46')](_0xe20d('0x47'))){_0x590f07[_0xe20d('0x22')]=qs[_0xe20d('0x22')](_0x51415f[_0xe20d('0x40')]['limit']);_0x590f07[_0xe20d('0x20')]=qs[_0xe20d('0x20')](_0x51415f[_0xe20d('0x40')]['offset']);}_0x590f07['order']=qs[_0xe20d('0x48')](_0x51415f[_0xe20d('0x40')][_0xe20d('0x48')]);_0x590f07[_0xe20d('0x49')]=qs[_0xe20d('0x4a')](_[_0xe20d('0x4b')](_0x51415f[_0xe20d('0x40')],_0x1d5e89[_0xe20d('0x4a')]),_0x4d0716);var _0x1f37c1=[];var _0x5dc2e1=squel[_0xe20d('0x4c')]()[_0xe20d('0x4d')]('id')[_0xe20d('0x4d')](_0xe20d('0x3f'))[_0xe20d('0x4d')](_0xe20d('0x4e'))[_0xe20d('0x4f')]('tools_tags');var _0x255efe=squel[_0xe20d('0x4c')]()[_0xe20d('0x4d')]('u.id')[_0xe20d('0x4d')](_0xe20d('0x50'))['field'](_0xe20d('0x51'))[_0xe20d('0x4f')](_0xe20d('0x52'),'ui')[_0xe20d('0x53')](_0xe20d('0x54'),'u',_0xe20d('0x55'));var _0x453cf1=squel[_0xe20d('0x4c')]()[_0xe20d('0x4f')](_0xe20d('0x56'),'i')['left_join'](_0xe20d('0x57'),'c',_0xe20d('0x58'))[_0xe20d('0x53')]('users','o',_0xe20d('0x59'))[_0xe20d('0x53')](_0xe20d('0x5a'),'a',_0xe20d('0x5b'))[_0xe20d('0x53')](_0xe20d('0x5c'),'me',_0xe20d('0x5d'))[_0xe20d('0x53')](_0xe20d('0x5e'),'it',_0xe20d('0x5f'))['left_join']('tools_tags','t',_0xe20d('0x60'));var _0x312b83=squel[_0xe20d('0x61')]();var _0x3967cd=[];var _0x31c347=squel['expr']();var _0x1b50ea;if(_0x51415f['query'][_0xe20d('0x62')]){_0x1b50ea=as[_0xe20d('0x63')](_0x51415f[_0xe20d('0x40')][_0xe20d('0x62')]);var _0xbce4ba=_0x1b50ea['sqlOperator'];for(var _0x353366=0x0;_0x353366<_0x1b50ea['conditions'][_0xe20d('0x45')];_0x353366++){var _0x27c6f1=_0x1b50ea['conditions'][_0x353366];var _0x232a30='i';var _0x16d55c=_[_0xe20d('0x64')](_0x4d0716,[_0xe20d('0x3f'),_0x27c6f1[_0xe20d('0x4d')]]);if(!_0x16d55c){switch(_0x27c6f1[_0xe20d('0x4d')]){case _0xe20d('0x65'):if(_0x27c6f1[_0xe20d('0x66')]==0x1){_0x453cf1[_0xe20d('0x67')]('`'+_0x27c6f1[_0xe20d('0x4d')]+_0xe20d('0x68'));}else{_0x453cf1[_0xe20d('0x67')]('`'+_0x27c6f1[_0xe20d('0x4d')]+_0xe20d('0x69'));}break;case _0xe20d('0x6a'):if(_0x27c6f1[_0xe20d('0x6b')]===_0xe20d('0x6c')){if(_0x27c6f1['value'][_0xe20d('0x30')]('\x20')['length']>0x1){_0x312b83[_0xbce4ba](_0xe20d('0x6d'),qs[_0xe20d('0x6e')](_0x27c6f1[_0xe20d('0x66')]),null);}else{var _0x34bf87='%'+_0x27c6f1[_0xe20d('0x66')]+'%';_0x312b83[_0xbce4ba](_0xe20d('0x6f'),_0x34bf87,_0x34bf87,_0x34bf87);}}else{_0x16d55c=_['find'](_0x4d0716,[_0xe20d('0x3f'),_0xe20d('0x70')]);_0x27c6f1[_0xe20d('0x4d')]='ContactId';_0x2c5d64=as[_0xe20d('0x71')](_0x232a30,_0x16d55c[_0xe20d('0x3c')],_0x27c6f1);_0x312b83[_0xbce4ba](_0x2c5d64['text'],_0x2c5d64[_0xe20d('0x66')][_0xe20d('0x72')],_0x2c5d64['value']['end']);}break;case _0xe20d('0x73'):var _0x1fbedd=_0x27c6f1[_0xe20d('0x66')]['split'](',')[_0xe20d('0x2d')](function(_0x374d3f){return Number(_0x374d3f);});_0x1fbedd[_0xe20d('0x74')](function(_0x3cb67b){_0x31c347['or'](_0xe20d('0x75'),'%,'+_0x3cb67b+',%');});_0x3967cd=_[_0xe20d('0x76')](_0x3967cd,_0x1fbedd);break;case _0xe20d('0x77'):if(_0x27c6f1[_0xe20d('0x6b')]===_0xe20d('0x6c')){_0x312b83[_0xbce4ba](_0xe20d('0x78'),'%'+_0x27c6f1[_0xe20d('0x66')]+'%',null);}else{_0x16d55c=_[_0xe20d('0x64')](_0x4d0716,[_0xe20d('0x3f'),'UserId']);_0x27c6f1[_0xe20d('0x4d')]=_0xe20d('0x35');_0x2c5d64=as[_0xe20d('0x71')](_0x232a30,_0x16d55c[_0xe20d('0x3c')],_0x27c6f1);_0x312b83[_0xbce4ba](_0x2c5d64[_0xe20d('0x79')],_0x2c5d64[_0xe20d('0x66')][_0xe20d('0x72')],_0x2c5d64['value']['end']);}break;case _0xe20d('0x7a'):_0x2c5d64=as[_0xe20d('0x71')]('me',null,_0x27c6f1);_0x312b83[_0xbce4ba](_0x2c5d64[_0xe20d('0x79')],_0x2c5d64[_0xe20d('0x66')][_0xe20d('0x72')],_0x2c5d64[_0xe20d('0x66')][_0xe20d('0x1e')]);break;}}else{var _0x2c5d64=as[_0xe20d('0x71')](_0x232a30,_0x16d55c['type'],_0x27c6f1);_0x312b83[_0xbce4ba](_0x2c5d64[_0xe20d('0x79')],_0x2c5d64[_0xe20d('0x66')][_0xe20d('0x72')],_0x2c5d64[_0xe20d('0x66')][_0xe20d('0x1e')]);}}}else{var _0x2734e8=_(_0x51415f[_0xe20d('0x40')])['keys']()[_0xe20d('0x2d')](function(_0x1ec44b){return _[_0xe20d('0x7b')](_0x4d0716,[_0xe20d('0x3f'),_0x1ec44b])?_0x1ec44b:undefined;})[_0xe20d('0x7c')]()[_0xe20d('0x66')]();if(!_[_0xe20d('0x7d')](_0x2734e8)){_0x2734e8[_0xe20d('0x74')](function(_0x12b5d0){if(_0x12b5d0==='WhatsappAccountId'){_0x453cf1['where'](_0xe20d('0x7e'),[][_0xe20d('0x7f')](_0x51415f[_0xe20d('0x40')][_0x12b5d0]));}else if(_0x12b5d0===_0xe20d('0x80')){var _0x5a7626=JSON[_0xe20d('0x81')](_0x51415f[_0xe20d('0x40')][_0x12b5d0])['$gte'];var _0x46af20=JSON[_0xe20d('0x81')](_0x51415f[_0xe20d('0x40')][_0x12b5d0])[_0xe20d('0x82')];_0x453cf1['where'](_0xe20d('0x83'),_0x5a7626,_0x46af20);}else{if(_0x51415f['query'][_0x12b5d0]===_0xe20d('0x84')){_0x453cf1[_0xe20d('0x49')]('i.'+_0x12b5d0+_0xe20d('0x85'));}else{_0x453cf1['where']('i.'+_0x12b5d0+_0xe20d('0x86'),_0x51415f[_0xe20d('0x40')][_0x12b5d0]);}}});}if(_0x51415f['query'][_0xe20d('0x87')]){if(_0x51415f[_0xe20d('0x40')][_0xe20d('0x87')]==0x1){_0x453cf1[_0xe20d('0x67')](_0xe20d('0x88'));}else{_0x453cf1['having'](_0xe20d('0x89'));}}if(_0x51415f[_0xe20d('0x40')][_0xe20d('0x8a')]){_0x3967cd=_[_0xe20d('0x8b')](_0x51415f[_0xe20d('0x40')][_0xe20d('0x8a')])?_0x51415f[_0xe20d('0x40')][_0xe20d('0x8a')]:new Array(_0x51415f[_0xe20d('0x40')]['tag']);_0x3967cd[_0xe20d('0x74')](function(_0xf9cd72){_0x31c347['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xf9cd72+',%');});}if(_0x51415f[_0xe20d('0x40')][_0xe20d('0x8c')]){var _0x42cf37=_0x51415f[_0xe20d('0x40')][_0xe20d('0x8c')][_0xe20d('0x8d')]('\x5c','\x5c\x5c')[_0xe20d('0x8d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x42cf37)){_0x312b83['or']('i.id\x20LIKE\x20?',_0x42cf37+'%')['or'](_0xe20d('0x8e'),_0x42cf37+'%');}else{_0x312b83['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe20d('0x6e')](_0x42cf37))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x42cf37+'%');}}}_0x453cf1[_0xe20d('0x49')](_0x312b83);_0x453cf1[_0xe20d('0x8f')]('i.id');var _0x3b892f={'type':db[_0xe20d('0x90')][_0xe20d('0x91')][_0xe20d('0x92')],'raw':!![]};var _0x35c770=_0x453cf1[_0xe20d('0x93')]();_0x35c770[_0xe20d('0x4d')](_0xe20d('0x94'));_0x35c770[_0xe20d('0x4d')](_0xe20d('0x95'),_0xe20d('0x65'));if(_0x590f07[_0xe20d('0x96')]){_0x590f07['order']['forEach'](function(_0xd9437){var _0x17c6e2=_0xd9437[0x0]===_0xe20d('0x97')?_0xd9437[0x0]:'i.'+_0xd9437[0x0];_0x453cf1[_0xe20d('0x96')](_0x17c6e2,_0xd9437[0x1]===_0xe20d('0x98')?![]:!![]);});}if(!_[_0xe20d('0x7d')](_0x3967cd)){_0x453cf1[_0xe20d('0x67')](_0x31c347);_0x35c770[_0xe20d('0x49')](_0xe20d('0x99'),_0x3967cd);}BPromise[_0xe20d('0x9a')]()[_0xe20d('0x28')](function(){if(!_0x1b50ea){if(_0x51415f[_0xe20d('0x40')]['WhatsappAccountId'])return;_0x35c770[_0xe20d('0x49')](_0xe20d('0x9b'));_0x453cf1['where'](_0xe20d('0x9b'));return;}if(_0x51415f[_0xe20d('0x9c')]['role']!==_0xe20d('0x9d'))return;return _0x51415f[_0xe20d('0x9c')][_0xe20d('0x9e')]({'attributes':['id'],'raw':!![]})[_0xe20d('0x28')](function(_0x1d553a){if(_['isEmpty'](_0x1d553a)){_0x35c770[_0xe20d('0x49')](_0xe20d('0x9f'));_0x453cf1[_0xe20d('0x49')](_0xe20d('0x9f'));}else{_0x35c770[_0xe20d('0x49')]('i.WhatsappAccountId\x20IN\x20?',_[_0xe20d('0x2d')](_0x1d553a,'id'));_0x453cf1['where'](_0xe20d('0x7e'),_[_0xe20d('0x2d')](_0x1d553a,'id'));}});})['then'](function(){if(_0x51415f['user'][_0xe20d('0xa0')]===_0xe20d('0x9d')&&!_0x1b50ea&&!_0x51415f[_0xe20d('0x40')]['WhatsappAccountId'])return[];return db[_0xe20d('0xa1')]['query'](_0x35c770['toString'](),_0x3b892f);})[_0xe20d('0x28')](function(_0x1a5f5c){_0x3b3a80[_0xe20d('0x23')]=_0x1a5f5c[_0xe20d('0x45')];if(_0x3b3a80['count']===0x0)return[];return db[_0xe20d('0xa1')]['query'](_0x5dc2e1[_0xe20d('0xa2')](),_0x3b892f)[_0xe20d('0x28')](function(_0x11d033){_0x1f37c1=_[_0xe20d('0xa3')](_0x11d033,'id');_0x3b892f=_[_0xe20d('0xa4')](_0x3b892f,{'model':db[_0xe20d('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x51415f[_0xe20d('0x40')]['fields']){_0x590f07[_0xe20d('0x43')][_0xe20d('0x74')](function(_0x426659){_0x453cf1[_0xe20d('0x4d')]('i.'+_0x426659);});}else{_0x453cf1['field'](_0xe20d('0x95'),_0xe20d('0x65'));_0x453cf1['field'](_0xe20d('0xa5'),'Account.key');_0x453cf1['field'](_0xe20d('0xa6'),_0xe20d('0xa7'));_0x453cf1[_0xe20d('0x4d')](_0xe20d('0xa8'),_0xe20d('0x97'));_0x453cf1[_0xe20d('0x4d')](_0xe20d('0xa9'));_0x453cf1[_0xe20d('0x4d')]('c.firstName',_0xe20d('0xaa'));_0x453cf1[_0xe20d('0x4d')]('c.lastName','Contact.lastName');_0x453cf1[_0xe20d('0x4d')](_0xe20d('0xab'),_0xe20d('0xac'));_0x453cf1[_0xe20d('0x4d')](_0xe20d('0xad'),'Contact.phone');_0x453cf1[_0xe20d('0x4d')](_0xe20d('0xae'),'Contact.mobile');_0x453cf1[_0xe20d('0x4d')](_0xe20d('0xaf'),_0xe20d('0xb0'));_0x453cf1[_0xe20d('0x4d')](_0xe20d('0xb1'),'Owner.fullname');_0x453cf1[_0xe20d('0x4d')]('o.internal',_0xe20d('0xb2'));_0x453cf1[_0xe20d('0x4d')](_0xe20d('0xb3'),_0xe20d('0x2f'));}if(_0x590f07[_0xe20d('0x22')])_0x453cf1[_0xe20d('0x22')](_0x590f07[_0xe20d('0x22')]);if(_0x590f07[_0xe20d('0x20')])_0x453cf1[_0xe20d('0x20')](_0x590f07[_0xe20d('0x20')]);return db['sequelize'][_0xe20d('0x40')](_0x453cf1['toString'](),_0x3b892f);})[_0xe20d('0x28')](function(_0x1c38e3){if(_0x1c38e3[_0xe20d('0x45')]>0x0)_0x255efe[_0xe20d('0x49')](_0xe20d('0xb4'),_[_0xe20d('0x2d')](_0x1c38e3,'id'));return db[_0xe20d('0xa1')][_0xe20d('0x40')](_0x255efe[_0xe20d('0xa2')](),_0x3b892f)[_0xe20d('0x28')](function(_0x2376ce){var _0x455763=_[_0xe20d('0xb5')](_0x2376ce,_0xe20d('0xb6'));var _0x2ca3cb=[];_0x1c38e3[_0xe20d('0x74')](function(_0xdec72f){_0x2ca3cb['push'](updateWhatsappInteraction(_0xdec72f,_0x1f37c1,_0x455763));});return BPromise['all'](_0x2ca3cb);});});})[_0xe20d('0x28')](function(_0x300860){_0x3b3a80[_0xe20d('0xb7')]=_0x300860;return _0x3b3a80;})[_0xe20d('0x28')](respondWithFilteredResult(_0x2ffa5b,_0x590f07))['catch'](handleError(_0x2ffa5b,null));};exports[_0xe20d('0xb8')]=function(_0x3a7bc2,_0x9a3822){var _0x227ffb={'raw':![],'where':{'id':_0x3a7bc2['params']['id']}},_0x5bc3c4={};_0x5bc3c4['model']=_['keys'](db[_0xe20d('0x39')][_0xe20d('0x3a')]);_0x5bc3c4[_0xe20d('0x40')]=_[_0xe20d('0x41')](_0x3a7bc2[_0xe20d('0x40')]);_0x5bc3c4[_0xe20d('0x4a')]=_[_0xe20d('0x42')](_0x5bc3c4[_0xe20d('0x3e')],_0x5bc3c4['query']);_0x227ffb['attributes']=_[_0xe20d('0x42')](_0x5bc3c4['model'],qs['fields'](_0x3a7bc2[_0xe20d('0x40')][_0xe20d('0x44')]));_0x227ffb['attributes']=_0x227ffb['attributes'][_0xe20d('0x45')]?_0x227ffb[_0xe20d('0x43')]:_0x5bc3c4[_0xe20d('0x3e')];if(_0x3a7bc2['query'][_0xe20d('0xb9')]){_0x227ffb[_0xe20d('0xba')]=[{'all':!![]}];}_0x227ffb=_['merge']({},_0x227ffb,_0x3a7bc2['options']);return db[_0xe20d('0x39')][_0xe20d('0x64')](_0x227ffb)[_0xe20d('0x28')](handleEntityNotFound(_0x9a3822,null))[_0xe20d('0x28')](respondWithResult(_0x9a3822,null))[_0xe20d('0xbb')](handleError(_0x9a3822,null));};exports['create']=function(_0x591195,_0x1dcb8b){return db['WhatsappInteraction'][_0xe20d('0xbc')](_0x591195[_0xe20d('0x7a')],{})[_0xe20d('0x28')](respondWithResult(_0x1dcb8b,0xc9))[_0xe20d('0xbb')](handleError(_0x1dcb8b,null));};exports[_0xe20d('0x27')]=function(_0x48e30d,_0x2cbe0d){if(_0x48e30d[_0xe20d('0x7a')]['id']){delete _0x48e30d[_0xe20d('0x7a')]['id'];}return db['WhatsappInteraction'][_0xe20d('0x64')]({'where':{'id':_0x48e30d['params']['id']}})[_0xe20d('0x28')](handleEntityNotFound(_0x2cbe0d,null))[_0xe20d('0x28')](saveUpdates(_0x48e30d[_0xe20d('0x7a')],null))[_0xe20d('0x28')](respondWithResult(_0x2cbe0d,null))['catch'](handleError(_0x2cbe0d,null));};exports[_0xe20d('0x29')]=function(_0x135300,_0x2cc486){return db['WhatsappInteraction'][_0xe20d('0x64')]({'where':{'id':_0x135300[_0xe20d('0xbd')]['id']}})[_0xe20d('0x28')](handleEntityNotFound(_0x2cc486,null))[_0xe20d('0x28')](removeEntity(_0x2cc486,null))[_0xe20d('0xbb')](handleError(_0x2cc486,null));};exports[_0xe20d('0xbe')]=function(_0x1d6510,_0x10ddd1){return db[_0xe20d('0x39')][_0xe20d('0xbe')]()['then'](respondWithResult(_0x10ddd1,null))[_0xe20d('0xbb')](handleError(_0x10ddd1,null));};exports[_0xe20d('0xbf')]=function(_0x117cd6,_0x9d85e1,_0xfb6f04){return db[_0xe20d('0xc0')]['find']({'where':{'id':_0x117cd6[_0xe20d('0xbd')]['id']}})[_0xe20d('0x28')](handleEntityNotFound(_0x9d85e1,null))['then'](function(_0x357795){if(_0x357795){return _0x357795['addMessage'](_0x117cd6[_0xe20d('0x7a')][_0xe20d('0xc1')],_[_0xe20d('0xc2')](_0x117cd6[_0xe20d('0x7a')],[_0xe20d('0xc1'),'id'])||{});}})[_0xe20d('0x28')](respondWithResult(_0x9d85e1,null))[_0xe20d('0xbb')](handleError(_0x9d85e1,null));};exports[_0xe20d('0xc3')]=function(_0x5c06df,_0xc9efa6,_0x3889a7){var _0x2341d2={'raw':![],'where':{}};var _0x4f910e={};var _0x1f3fac={'count':0x0,'rows':[]};return db[_0xe20d('0x39')][_0xe20d('0xc4')]({'where':{'id':_0x5c06df[_0xe20d('0xbd')]['id']}})[_0xe20d('0x28')](handleEntityNotFound(_0xc9efa6,null))['then'](function(_0x3e7322){if(_0x3e7322){_0x4f910e[_0xe20d('0x3e')]=_[_0xe20d('0x41')](db[_0xe20d('0xc0')][_0xe20d('0x3a')]);_0x4f910e[_0xe20d('0x40')]=_[_0xe20d('0x41')](_0x5c06df[_0xe20d('0x40')]);_0x4f910e[_0xe20d('0x4a')]=_[_0xe20d('0x42')](_0x4f910e[_0xe20d('0x3e')],_0x4f910e['query']);_0x2341d2[_0xe20d('0x43')]=_[_0xe20d('0x42')](_0x4f910e[_0xe20d('0x3e')],qs[_0xe20d('0x44')](_0x5c06df[_0xe20d('0x40')][_0xe20d('0x44')]));_0x2341d2['attributes']=_0x2341d2[_0xe20d('0x43')]['length']?_0x2341d2[_0xe20d('0x43')]:_0x4f910e[_0xe20d('0x3e')];if(!_0x5c06df[_0xe20d('0x40')]['hasOwnProperty'](_0xe20d('0x47'))){_0x2341d2[_0xe20d('0x22')]=qs[_0xe20d('0x22')](_0x5c06df[_0xe20d('0x40')]['limit']);_0x2341d2[_0xe20d('0x20')]=qs[_0xe20d('0x20')](_0x5c06df[_0xe20d('0x40')][_0xe20d('0x20')]);}_0x2341d2[_0xe20d('0x96')]=qs[_0xe20d('0x48')](_0x5c06df['query'][_0xe20d('0x48')]);_0x2341d2[_0xe20d('0x49')]=qs['filters'](_['pick'](_0x5c06df[_0xe20d('0x40')],_0x4f910e[_0xe20d('0x4a')]));_0x2341d2[_0xe20d('0x49')][_0xe20d('0xb6')]=_0x3e7322['id'];if(_0x5c06df[_0xe20d('0x40')][_0xe20d('0x8c')]){_0x2341d2[_0xe20d('0x49')]=_[_0xe20d('0xa4')](_0x2341d2[_0xe20d('0x49')],{'$or':_[_0xe20d('0x2d')](_0x2341d2['attributes'],function(_0x50dad7){var _0x11bca3={};_0x11bca3[_0x50dad7]={'$like':'%'+_0x5c06df[_0xe20d('0x40')]['filter']+'%'};return _0x11bca3;})});}if(_0x5c06df['query'][_0xe20d('0xc5')]){var _0x395538=_0x5c06df[_0xe20d('0x40')][_0xe20d('0xc5')]['split'](',');var _0x1dc7c1={};_0x1dc7c1[_0x395538[0x0]]={'$gte':moment(_0x395538[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2341d2[_0xe20d('0x49')]=_['merge'](_0x2341d2['where'],_0x1dc7c1);}_0x2341d2=_['merge']({},_0x2341d2,_0x5c06df[_0xe20d('0xc6')]);return db['WhatsappMessage'][_0xe20d('0x23')]({'where':_0x2341d2[_0xe20d('0x49')]})['then'](function(_0x290183){_0x1f3fac[_0xe20d('0x23')]=_0x290183;if(_0x5c06df[_0xe20d('0x40')][_0xe20d('0xb9')]){_0x2341d2[_0xe20d('0xba')]=[{'all':!![]}];}return db[_0xe20d('0xc0')][_0xe20d('0xc7')](_0x2341d2);})[_0xe20d('0x28')](function(_0x53c6f8){_0x1f3fac['rows']=_0x53c6f8;return _0x1f3fac;});}})['then'](respondWithFilteredResult(_0xc9efa6,_0x2341d2))['catch'](handleError(_0xc9efa6,null));};exports[_0xe20d('0xc8')]=function(_0x2b9948,_0x3b04aa,_0xc18e39){return db[_0xe20d('0x39')][_0xe20d('0x64')]({'where':{'id':_0x2b9948[_0xe20d('0xbd')]['id']}})[_0xe20d('0x28')](handleEntityNotFound(_0x3b04aa,null))['then'](function(_0x1a5536){if(_0x1a5536){return _0x1a5536[_0xe20d('0xc9')](_0x2b9948[_0xe20d('0x7a')][_0xe20d('0xc1')],_[_0xe20d('0xc2')](_0x2b9948[_0xe20d('0x7a')],[_0xe20d('0xc1'),'id'])||{})[_0xe20d('0xca')](function(){return db[_0xe20d('0x73')][_0xe20d('0xc7')]({'attributes':['id','name',_0xe20d('0x4e')],'where':{'id':_0x2b9948['body'][_0xe20d('0xc1')]}});})[_0xe20d('0x28')](function(_0x5c916f){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x2b9948[_0xe20d('0xbd')]['id']),'tags':_0x5c916f||[]});return{'id':Number(_0x2b9948[_0xe20d('0xbd')]['id']),'tags':_0x5c916f||[]};});}})[_0xe20d('0x28')](respondWithResult(_0x3b04aa,null))[_0xe20d('0xbb')](handleError(_0x3b04aa,null));};exports[_0xe20d('0xcb')]=function(_0x3b60da,_0x5b4176,_0x18dab1){return db['WhatsappInteraction']['find']({'where':{'id':_0x3b60da['params']['id']}})['then'](handleEntityNotFound(_0x5b4176,null))['then'](function(_0x3bc4da){if(_0x3bc4da){return _0x3bc4da[_0xe20d('0xcb')](_0x3b60da[_0xe20d('0x40')][_0xe20d('0xc1')]);}})[_0xe20d('0x28')](respondWithStatusCode(_0x5b4176,null))[_0xe20d('0xbb')](handleError(_0x5b4176,null));};exports['download']=function(_0xde5ed,_0x2cce9c){var _0x64ea4a=moment()['unix']()['toString']();var _0x1709ec=path['join'](config['root'],_0xe20d('0xcc'),_0xe20d('0xcd'),_0xe20d('0xce'));var _0x1dc641=path[_0xe20d('0xcf')](config[_0xe20d('0xd0')],'server','files',_0xe20d('0xd1'));var _0x408751=path['join'](_0x1709ec,_0x64ea4a);var _0x1f119e=util[_0xe20d('0xd2')](_0xe20d('0xd3'),_0xde5ed[_0xe20d('0xbd')]['id'],_0x64ea4a);var _0x2321f8=path[_0xe20d('0xcf')](_0x1709ec,_0x1f119e);var _0x29fd62=[];_0x29fd62[_0xe20d('0xd4')]({'model':db[_0xe20d('0x77')],'as':_0xe20d('0x77'),'attributes':['id','fullname'],'raw':!![]});_0x29fd62['push']({'model':db[_0xe20d('0xd5')],'as':'Contact','attributes':['id','firstName',_0xe20d('0xd6')],'raw':!![]});if(_0xde5ed['query']['attachments']){_0x29fd62[_0xe20d('0xd4')]({'model':db[_0xe20d('0xd7')],'as':_0xe20d('0xd7'),'raw':!![]});}var _0x4cabac=[{'model':db[_0xe20d('0xc0')],'as':_0xe20d('0xd8'),'attributes':['id',_0xe20d('0x7a'),'createdAt','direction','secret',_0xe20d('0x87')],'include':_0x29fd62}];_0x4cabac[_0xe20d('0xd4')]({'model':db[_0xe20d('0xd9')],'as':'Account','attributes':['id',_0xe20d('0x3f')]});_0x4cabac[_0xe20d('0xd4')]({'model':db[_0xe20d('0x77')],'as':'Owner','attributes':['id',_0xe20d('0x2e')]});return db[_0xe20d('0x39')][_0xe20d('0x64')]({'where':{'id':_0xde5ed[_0xe20d('0xbd')]['id']},'include':_0x4cabac})[_0xe20d('0x28')](handleEntityNotFound(_0x2cce9c,null))[_0xe20d('0x28')](function(_0x181c3e){if(_0x181c3e){var _0x295dee=_0x181c3e['get']({'plain':!![]});fs[_0xe20d('0xda')](_0x408751);var _0x2c6ca4={'channel':_0xe20d('0xdb'),'account':_0x295dee['Account'][_0xe20d('0x3f')],'agent':_0x295dee[_0xe20d('0xdc')]?_0x295dee[_0xe20d('0xdc')]['fullname']:'N.A.','createdAt':moment(_0x295dee[_0xe20d('0x80')])[_0xe20d('0xd2')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe20d('0xa2')](),'closedAt':_0x295dee[_0xe20d('0x36')]?moment(_0x295dee['closedAt'])[_0xe20d('0xd2')](_0xe20d('0xdd'))[_0xe20d('0xa2')]():'','disposition':_0x295dee['disposition'],'messages':_(_0x295dee['Messages'])[_0xe20d('0x8c')]({'secret':![]})[_0xe20d('0x2d')](function(_0x2a7123){if(_0x2a7123[_0xe20d('0xd7')]){var _0xcdc37a=path[_0xe20d('0xcf')](_0x1dc641,_0x2a7123[_0xe20d('0xd7')][_0xe20d('0xde')]);if(fs['existsSync'](_0xcdc37a)){fs[_0xe20d('0xdf')](_0xcdc37a)[_0xe20d('0xe0')](fs[_0xe20d('0xe1')](path['join'](_0x408751,_0x2a7123[_0xe20d('0xd7')][_0xe20d('0xde')])));}}return{'date':moment(_0x2a7123[_0xe20d('0x80')])[_0xe20d('0xd2')](_0xe20d('0xdd'))[_0xe20d('0xa2')](),'sender':_0x2a7123[_0xe20d('0xe2')]===_0xe20d('0xe3')?_0x2a7123[_0xe20d('0x77')]?_0x2a7123[_0xe20d('0x77')][_0xe20d('0x2e')]:'System':_0x2a7123[_0xe20d('0x6a')][_0xe20d('0xe4')]+(_0x2a7123[_0xe20d('0x6a')][_0xe20d('0xd6')]?'\x20'+_0x2a7123[_0xe20d('0x6a')]['lastName']:''),'body':_0x2a7123[_0xe20d('0xd7')]?_0x2a7123[_0xe20d('0xd7')][_0xe20d('0xde')]:_0x2a7123[_0xe20d('0x7a')],'direction':_0x2a7123[_0xe20d('0xe2')]==='out'?'A':'C','secret':_0x2a7123[_0xe20d('0xe5')],'read':_0x2a7123[_0xe20d('0x87')],'attachment':_0x2a7123[_0xe20d('0xd7')]};})[_0xe20d('0x66')]()};return ejs[_0xe20d('0xe6')](path[_0xe20d('0xcf')](config['root'],_0xe20d('0xcc'),_0xe20d('0xe7'),_0xe20d('0xe8')),{'interaction':_0x2c6ca4})[_0xe20d('0x28')](function(_0x12c60e){var _0x113189=path['join'](_0x408751,_0xe20d('0xe9')+_0x295dee['id']+'-'+_0x64ea4a+_0xe20d('0xea'));var _0x554220={'path':_0x113189,'channel':_0xe20d('0xdb'),'interactionId':_0x295dee['id']};return pdf[_0xe20d('0xeb')](_0x12c60e,_0x554220);})[_0xe20d('0x28')](function(){return new BPromise(function(_0x654bd4,_0x30cf0b){zipdir(_0x408751,{'saveTo':_0x2321f8},function(_0x12ab5e,_0x5bf950){if(_0x12ab5e)return _0x30cf0b(_0x12ab5e);return _0x654bd4(_0x5bf950);});})['then'](function(){return new BPromise(function(_0x17e96f,_0x1a99a7){rimraf(_0x408751,function(_0x2a45fa){if(_0x2a45fa)_0x1a99a7(_0x2a45fa);return _0x17e96f();});});})[_0xe20d('0x28')](function(){return _0x2cce9c[_0xe20d('0xec')](_0x2321f8,_0x1f119e,function(_0x5eb941){if(_0x5eb941){console[_0xe20d('0xed')](_0xe20d('0xee'),_0x5eb941);}else{fs[_0xe20d('0xef')](_0x2321f8);}});});});}else{return _0x2cce9c['sendStatus'](0xc8);}})[_0xe20d('0xbb')](handleError(_0x2cce9c,null));}; \ No newline at end of file +var _0xaac4=['i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\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)','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','sequelize','toString','WhatsappInteraction','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','contactName','c.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','merge','options','create','body','describe','WhatsappMessage','ids','omit','getMessages','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','include','addTags','setTags','findAll','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','CmContact','firstName','Attachment','direction','secret','Account','get','mkdirSync','Whatsapp','Owner','N.A.','closedAt','Messages','basename','existsSync','out','System','lastName','renderFile','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','error','name','send','map','fullname','TagIds','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','field','color','from','tools_tags','select','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','start','compact','isEmpty','where','concat','createdAt','parse','$gte'];(function(_0x9c0fee,_0x6d3d05){var _0x5bde08=function(_0x5c9043){while(--_0x5c9043){_0x9c0fee['push'](_0x9c0fee['shift']());}};_0x5bde08(++_0x6d3d05);}(_0xaac4,0x6c));var _0x4aac=function(_0x2bd8a6,_0x5b9211){_0x2bd8a6=_0x2bd8a6-0x0;var _0x1e037a=_0xaac4[_0x2bd8a6];return _0x1e037a;};'use strict';var emlformat=require(_0x4aac('0x0'));var rimraf=require(_0x4aac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4aac('0x2'));var rp=require(_0x4aac('0x3'));var moment=require(_0x4aac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4aac('0x5'));var util=require(_0x4aac('0x6'));var path=require(_0x4aac('0x7'));var sox=require(_0x4aac('0x8'));var csv=require(_0x4aac('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4aac('0xa'));var _=require(_0x4aac('0xb'));var squel=require(_0x4aac('0xc'));var crypto=require('crypto');var jsforce=require(_0x4aac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4aac('0x9'));var querystring=require(_0x4aac('0xe'));var Papa=require(_0x4aac('0xf'));var Redis=require(_0x4aac('0x10'));var authService=require(_0x4aac('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4aac('0x12'));var pdf=require(_0x4aac('0x13'));var hardwareService=require(_0x4aac('0x14'));var logger=require(_0x4aac('0x15'))('api');var utils=require(_0x4aac('0x16'));var config=require(_0x4aac('0x17'));var licenseUtil=require(_0x4aac('0x18'));var db=require(_0x4aac('0x19'))['db'];config[_0x4aac('0x1a')]=_[_0x4aac('0x1b')](config[_0x4aac('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x4aac('0x1c'))(new Redis(config['redis']));require(_0x4aac('0x1d'))['register'](socket);function respondWithStatusCode(_0x387775,_0x58186f){_0x58186f=_0x58186f||0xcc;return function(_0x2c58d3){if(_0x2c58d3){return _0x387775[_0x4aac('0x1e')](_0x58186f);}return _0x387775[_0x4aac('0x1f')](_0x58186f)['end']();};}function respondWithResult(_0x51b6cb,_0xae9a30){_0xae9a30=_0xae9a30||0xc8;return function(_0x4ff7c6){if(_0x4ff7c6){return _0x51b6cb['status'](_0xae9a30)['json'](_0x4ff7c6);}};}function respondWithFilteredResult(_0x4eb370,_0x1539fb){return function(_0x20353f){if(_0x20353f){var _0x44d2a1=typeof _0x1539fb['offset']===_0x4aac('0x20')&&typeof _0x1539fb[_0x4aac('0x21')]===_0x4aac('0x20');var _0x2b4ab0=_0x20353f[_0x4aac('0x22')];var _0x2da712=_0x44d2a1?0x0:_0x1539fb[_0x4aac('0x23')];var _0x2c26cc=_0x44d2a1?_0x20353f[_0x4aac('0x22')]:_0x1539fb[_0x4aac('0x23')]+_0x1539fb[_0x4aac('0x21')];var _0x5b8d51;if(_0x2c26cc>=_0x2b4ab0){_0x2c26cc=_0x2b4ab0;_0x5b8d51=0xc8;}else{_0x5b8d51=0xce;}_0x4eb370[_0x4aac('0x1f')](_0x5b8d51);return _0x4eb370[_0x4aac('0x24')]('Content-Range',_0x2da712+'-'+_0x2c26cc+'/'+_0x2b4ab0)[_0x4aac('0x25')](_0x20353f);}return null;};}function patchUpdates(_0x59ec0b){return function(_0x1f35f3){try{jsonpatch[_0x4aac('0x26')](_0x1f35f3,_0x59ec0b,!![]);}catch(_0x34a384){return BPromise[_0x4aac('0x27')](_0x34a384);}return _0x1f35f3[_0x4aac('0x28')]();};}function saveUpdates(_0x9b411d,_0x10e391){return function(_0x52ce26){if(_0x52ce26){return _0x52ce26[_0x4aac('0x29')](_0x9b411d)[_0x4aac('0x2a')](function(_0x431cd9){return _0x431cd9;});}return null;};}function removeEntity(_0x516261,_0x9c67ae){return function(_0x1f135a){if(_0x1f135a){return _0x1f135a[_0x4aac('0x2b')]()[_0x4aac('0x2a')](function(){_0x516261[_0x4aac('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35ab4d,_0x576694){return function(_0x517759){if(!_0x517759){_0x35ab4d[_0x4aac('0x1e')](0x194);}return _0x517759;};}function handleError(_0x34af11,_0x459028){_0x459028=_0x459028||0x1f4;return function(_0x3a1bd3){logger[_0x4aac('0x2c')](_0x3a1bd3['stack']);if(_0x3a1bd3[_0x4aac('0x2d')]){delete _0x3a1bd3[_0x4aac('0x2d')];}_0x34af11['status'](_0x459028)[_0x4aac('0x2e')](_0x3a1bd3);};}function getInteractionUsers(_0x350183,_0x59b69f){return new BPromise(function(_0x26c648,_0x4fbca0){try{if(_0x59b69f[_0x350183['id']]){_0x350183['Users']=_[_0x4aac('0x2f')](_0x59b69f[_0x350183['id']],function(_0x1472ec){return{'id':_0x1472ec['id'],'fullname':_0x1472ec[_0x4aac('0x30')]};});}}catch(_0x54718a){_0x4fbca0(_0x54718a);}_0x26c648(_0x350183);});}function getInteractionTags(_0x3e513d,_0x1366dc){return new BPromise(function(_0x43588a,_0x468b97){try{if(_0x3e513d[_0x4aac('0x31')]){_0x3e513d['Tags']=[];_0x3e513d[_0x4aac('0x31')][_0x4aac('0x32')](',')[_0x4aac('0x33')](function(_0x158cd2){_0x3e513d['Tags'][_0x4aac('0x34')](_0x1366dc[_0x158cd2]);});}delete _0x3e513d[_0x4aac('0x31')];}catch(_0x5f3987){_0x468b97(_0x5f3987);}_0x43588a(_0x3e513d);});}function updateWhatsappInteraction(_0x250e1f,_0x172f06,_0x4d491b){return new BPromise(function(_0x1c988e,_0x18d2d9){return getInteractionUsers(_0x250e1f,_0x4d491b)[_0x4aac('0x2a')](function(_0x522e1a){return getInteractionTags(_0x522e1a,_0x172f06);})['then'](function(_0x349524){return getStateInteraction(_0x349524);})[_0x4aac('0x2a')](function(_0x560f84){_0x1c988e(_0x560f84);})[_0x4aac('0x35')](function(_0x40cf49){_0x18d2d9(_0x40cf49);});});}function getStateInteraction(_0x4b4942){return new BPromise(function(_0x1f015c){_0x4b4942[_0x4aac('0x36')]=0x0;_0x4b4942[_0x4aac('0x37')]=0x0;_0x4b4942[_0x4aac('0x38')]=0x0;_0x4b4942[_0x4aac('0x39')]=0x0;_0x4b4942[_0x4aac('0x3a')]=0x0;if(!_0x4b4942[_0x4aac('0x3b')]&&!_0x4b4942[_0x4aac('0x3c')]){_0x4b4942[_0x4aac('0x36')]+=0x1;}if(!_0x4b4942['closed']&&_0x4b4942[_0x4aac('0x3c')]){_0x4b4942[_0x4aac('0x37')]+=0x1;if(_0x4b4942[_0x4aac('0x36')]){_0x4b4942['waiting']-=0x1;}}if(_0x4b4942[_0x4aac('0x3b')]&&_0x4b4942[_0x4aac('0x3c')]){_0x4b4942[_0x4aac('0x38')]+=0x1;if(_0x4b4942[_0x4aac('0x37')]){_0x4b4942[_0x4aac('0x37')]-=0x1;}}if(_0x4b4942[_0x4aac('0x3b')]&&!_0x4b4942[_0x4aac('0x3c')]){_0x4b4942[_0x4aac('0x39')]+=0x1;if(_0x4b4942[_0x4aac('0x36')]){_0x4b4942[_0x4aac('0x36')]-=0x1;}}_0x4b4942[_0x4aac('0x3a')]+=0x1;_0x1f015c(_0x4b4942);});}exports['index']=function(_0x408578,_0x5af68f){var _0x3bd74b={},_0x1d1435={},_0x5e2a59={'count':0x0,'rows':[]};var _0x278e4e=_['map'](db['WhatsappInteraction'][_0x4aac('0x3d')],function(_0x2c884d){return{'name':_0x2c884d[_0x4aac('0x3e')],'type':_0x2c884d[_0x4aac('0x3f')]['key']};});_0x1d1435[_0x4aac('0x40')]=_[_0x4aac('0x2f')](_0x278e4e,_0x4aac('0x2d'));_0x1d1435[_0x4aac('0x41')]=_[_0x4aac('0x42')](_0x408578[_0x4aac('0x41')]);_0x1d1435['filters']=_[_0x4aac('0x43')](_0x1d1435['model'],_0x1d1435[_0x4aac('0x41')]);_0x3bd74b[_0x4aac('0x44')]=_[_0x4aac('0x43')](_0x1d1435['model'],qs[_0x4aac('0x45')](_0x408578[_0x4aac('0x41')][_0x4aac('0x45')]));_0x3bd74b[_0x4aac('0x44')]=_0x3bd74b[_0x4aac('0x44')][_0x4aac('0x46')]?_0x3bd74b['attributes']:_0x1d1435['model'];if(!_0x408578[_0x4aac('0x41')]['hasOwnProperty'](_0x4aac('0x47'))){_0x3bd74b[_0x4aac('0x21')]=qs[_0x4aac('0x21')](_0x408578[_0x4aac('0x41')][_0x4aac('0x21')]);_0x3bd74b[_0x4aac('0x23')]=qs[_0x4aac('0x23')](_0x408578[_0x4aac('0x41')][_0x4aac('0x23')]);}_0x3bd74b['order']=qs[_0x4aac('0x48')](_0x408578[_0x4aac('0x41')]['sort']);_0x3bd74b['where']=qs[_0x4aac('0x49')](_['pick'](_0x408578['query'],_0x1d1435['filters']),_0x278e4e);var _0x5191ba=[];var _0x58c47b=squel['select']()[_0x4aac('0x4a')]('id')[_0x4aac('0x4a')](_0x4aac('0x2d'))[_0x4aac('0x4a')](_0x4aac('0x4b'))[_0x4aac('0x4c')](_0x4aac('0x4d'));var _0x17076f=squel[_0x4aac('0x4e')]()[_0x4aac('0x4a')]('u.id')[_0x4aac('0x4a')](_0x4aac('0x4f'))['field'](_0x4aac('0x50'))[_0x4aac('0x4c')](_0x4aac('0x51'),'ui')[_0x4aac('0x52')](_0x4aac('0x53'),'u',_0x4aac('0x54'));var _0x3eeb90=squel[_0x4aac('0x4e')]()[_0x4aac('0x4c')](_0x4aac('0x55'),'i')[_0x4aac('0x52')](_0x4aac('0x56'),'c',_0x4aac('0x57'))[_0x4aac('0x52')](_0x4aac('0x53'),'o','o.id\x20=\x20i.UserId')[_0x4aac('0x52')]('whatsapp_accounts','a',_0x4aac('0x58'))['left_join'](_0x4aac('0x59'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x4aac('0x52')](_0x4aac('0x5a'),'it',_0x4aac('0x5b'))[_0x4aac('0x52')](_0x4aac('0x4d'),'t','t.id\x20=\x20it.TagId');var _0x57442e=squel[_0x4aac('0x5c')]();var _0x3a89a3=[];var _0x17c9b9=squel[_0x4aac('0x5c')]();var _0x96d502;if(_0x408578[_0x4aac('0x41')]['search']){_0x96d502=as['parseSearch'](_0x408578[_0x4aac('0x41')][_0x4aac('0x5d')]);var _0x5f004a=_0x96d502['sqlOperator'];for(var _0x4d7a6c=0x0;_0x4d7a6c<_0x96d502[_0x4aac('0x5e')]['length'];_0x4d7a6c++){var _0x4ca90a=_0x96d502[_0x4aac('0x5e')][_0x4d7a6c];var _0x2eb11b='i';var _0x302bb2=_[_0x4aac('0x5f')](_0x278e4e,[_0x4aac('0x2d'),_0x4ca90a[_0x4aac('0x4a')]]);if(!_0x302bb2){switch(_0x4ca90a[_0x4aac('0x4a')]){case _0x4aac('0x60'):if(_0x4ca90a[_0x4aac('0x61')]==0x1){_0x3eeb90[_0x4aac('0x62')]('`'+_0x4ca90a[_0x4aac('0x4a')]+_0x4aac('0x63'));}else{_0x3eeb90[_0x4aac('0x62')]('`'+_0x4ca90a[_0x4aac('0x4a')]+_0x4aac('0x64'));}break;case _0x4aac('0x65'):if(_0x4ca90a[_0x4aac('0x66')]==='$substring'){if(_0x4ca90a[_0x4aac('0x61')][_0x4aac('0x32')]('\x20')[_0x4aac('0x46')]>0x1){_0x57442e[_0x5f004a](_0x4aac('0x67'),qs[_0x4aac('0x68')](_0x4ca90a[_0x4aac('0x61')]),null);}else{var _0x35db46='%'+_0x4ca90a[_0x4aac('0x61')]+'%';_0x57442e[_0x5f004a](_0x4aac('0x69'),_0x35db46,_0x35db46,_0x35db46);}}else{_0x302bb2=_[_0x4aac('0x5f')](_0x278e4e,['name',_0x4aac('0x6a')]);_0x4ca90a[_0x4aac('0x4a')]=_0x4aac('0x6a');_0x59fdc5=as[_0x4aac('0x6b')](_0x2eb11b,_0x302bb2[_0x4aac('0x3f')],_0x4ca90a);_0x57442e[_0x5f004a](_0x59fdc5[_0x4aac('0x6c')],_0x59fdc5[_0x4aac('0x61')]['start'],_0x59fdc5['value'][_0x4aac('0x6d')]);}break;case _0x4aac('0x6e'):var _0x55146a=_0x4ca90a[_0x4aac('0x61')][_0x4aac('0x32')](',')['map'](function(_0x548593){return Number(_0x548593);});_0x55146a[_0x4aac('0x33')](function(_0x3627c9){_0x17c9b9['or'](_0x4aac('0x6f'),'%,'+_0x3627c9+',%');});_0x3a89a3=_[_0x4aac('0x70')](_0x3a89a3,_0x55146a);break;case _0x4aac('0x71'):if(_0x4ca90a[_0x4aac('0x66')]===_0x4aac('0x72')){_0x57442e[_0x5f004a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4ca90a[_0x4aac('0x61')]+'%',null);}else{_0x302bb2=_['find'](_0x278e4e,[_0x4aac('0x2d'),_0x4aac('0x3c')]);_0x4ca90a['field']=_0x4aac('0x3c');_0x59fdc5=as['buildExpression'](_0x2eb11b,_0x302bb2['type'],_0x4ca90a);_0x57442e[_0x5f004a](_0x59fdc5['text'],_0x59fdc5[_0x4aac('0x61')][_0x4aac('0x73')],_0x59fdc5[_0x4aac('0x61')][_0x4aac('0x6d')]);}break;case'body':_0x59fdc5=as['buildExpression']('me',null,_0x4ca90a);_0x57442e[_0x5f004a](_0x59fdc5[_0x4aac('0x6c')],_0x59fdc5[_0x4aac('0x61')][_0x4aac('0x73')],_0x59fdc5[_0x4aac('0x61')][_0x4aac('0x6d')]);break;}}else{var _0x59fdc5=as[_0x4aac('0x6b')](_0x2eb11b,_0x302bb2['type'],_0x4ca90a);_0x57442e[_0x5f004a](_0x59fdc5['text'],_0x59fdc5[_0x4aac('0x61')][_0x4aac('0x73')],_0x59fdc5[_0x4aac('0x61')][_0x4aac('0x6d')]);}}}else{var _0x26c2e4=_(_0x408578[_0x4aac('0x41')])[_0x4aac('0x42')]()[_0x4aac('0x2f')](function(_0xf4880c){return _['some'](_0x278e4e,[_0x4aac('0x2d'),_0xf4880c])?_0xf4880c:undefined;})[_0x4aac('0x74')]()[_0x4aac('0x61')]();if(!_[_0x4aac('0x75')](_0x26c2e4)){_0x26c2e4[_0x4aac('0x33')](function(_0x38cc86){if(_0x38cc86==='WhatsappAccountId'){_0x3eeb90[_0x4aac('0x76')]('i.WhatsappAccountId\x20IN\x20?',[][_0x4aac('0x77')](_0x408578[_0x4aac('0x41')][_0x38cc86]));}else if(_0x38cc86===_0x4aac('0x78')){var _0x413a56=JSON[_0x4aac('0x79')](_0x408578[_0x4aac('0x41')][_0x38cc86])[_0x4aac('0x7a')];var _0x112a5e=JSON[_0x4aac('0x79')](_0x408578[_0x4aac('0x41')][_0x38cc86])['$lte'];_0x3eeb90[_0x4aac('0x76')](_0x4aac('0x7b'),_0x413a56,_0x112a5e);}else{if(_0x408578['query'][_0x38cc86]===_0x4aac('0x7c')){_0x3eeb90['where']('i.'+_0x38cc86+'\x20IS\x20NULL');}else{_0x3eeb90[_0x4aac('0x76')]('i.'+_0x38cc86+_0x4aac('0x7d'),_0x408578[_0x4aac('0x41')][_0x38cc86]);}}});}if(_0x408578[_0x4aac('0x41')][_0x4aac('0x7e')]){if(_0x408578[_0x4aac('0x41')][_0x4aac('0x7e')]==0x1){_0x3eeb90[_0x4aac('0x62')](_0x4aac('0x7f'));}else{_0x3eeb90[_0x4aac('0x62')](_0x4aac('0x80'));}}if(_0x408578['query'][_0x4aac('0x81')]){_0x3a89a3=_[_0x4aac('0x82')](_0x408578['query'][_0x4aac('0x81')])?_0x408578['query']['tag']:new Array(_0x408578[_0x4aac('0x41')][_0x4aac('0x81')]);_0x3a89a3[_0x4aac('0x33')](function(_0x37dd60){_0x17c9b9['or'](_0x4aac('0x6f'),'%,'+_0x37dd60+',%');});}if(_0x408578[_0x4aac('0x41')][_0x4aac('0x83')]){var _0xbe1f83=_0x408578['query'][_0x4aac('0x83')]['replace']('\x5c','\x5c\x5c')[_0x4aac('0x84')](/'/g,'\x27\x27');if(qs[_0x4aac('0x85')](_0xbe1f83)){_0x57442e['or'](_0x4aac('0x86'),_0xbe1f83+'%')['or']('i.phone\x20LIKE\x20?',_0xbe1f83+'%');}else{_0x57442e['or'](_0x4aac('0x87'),qs[_0x4aac('0x68')](_0xbe1f83))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0xbe1f83+'%');}}}_0x3eeb90[_0x4aac('0x76')](_0x57442e);_0x3eeb90[_0x4aac('0x88')](_0x4aac('0x89'));var _0x65eda2={'type':db[_0x4aac('0x8a')][_0x4aac('0x8b')][_0x4aac('0x8c')],'raw':!![]};var _0x1361fa=_0x3eeb90['clone']();_0x1361fa[_0x4aac('0x4a')]('i.id');_0x1361fa[_0x4aac('0x4a')](_0x4aac('0x8d'),_0x4aac('0x60'));if(_0x3bd74b[_0x4aac('0x8e')]){_0x3bd74b[_0x4aac('0x8e')][_0x4aac('0x33')](function(_0x2a95e5){var _0x37e8da=_0x2a95e5[0x0]==='contactName'?_0x2a95e5[0x0]:'i.'+_0x2a95e5[0x0];_0x3eeb90[_0x4aac('0x8e')](_0x37e8da,_0x2a95e5[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x3a89a3)){_0x3eeb90[_0x4aac('0x62')](_0x17c9b9);_0x1361fa['where'](_0x4aac('0x8f'),_0x3a89a3);}BPromise[_0x4aac('0x90')]()[_0x4aac('0x2a')](function(){if(!_0x96d502){if(_0x408578[_0x4aac('0x41')][_0x4aac('0x91')])return;_0x1361fa['where'](_0x4aac('0x92'));_0x3eeb90[_0x4aac('0x76')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x408578['user'][_0x4aac('0x93')]!==_0x4aac('0x94'))return;return _0x408578[_0x4aac('0x95')][_0x4aac('0x96')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5af238){if(_['isEmpty'](_0x5af238)){_0x1361fa[_0x4aac('0x76')]('i.WhatsappAccountId\x20IS\x20NULL');_0x3eeb90[_0x4aac('0x76')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x1361fa[_0x4aac('0x76')]('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x5af238,'id'));_0x3eeb90[_0x4aac('0x76')]('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x5af238,'id'));}});})[_0x4aac('0x2a')](function(){if(_0x408578[_0x4aac('0x95')][_0x4aac('0x93')]===_0x4aac('0x94')&&!_0x96d502&&!_0x408578['query'][_0x4aac('0x91')])return[];return db[_0x4aac('0x97')][_0x4aac('0x41')](_0x1361fa[_0x4aac('0x98')](),_0x65eda2);})['then'](function(_0xf64546){_0x5e2a59[_0x4aac('0x22')]=_0xf64546[_0x4aac('0x46')];if(_0x5e2a59['count']===0x0)return[];return db[_0x4aac('0x97')][_0x4aac('0x41')](_0x58c47b[_0x4aac('0x98')](),_0x65eda2)[_0x4aac('0x2a')](function(_0x339010){_0x5191ba=_['keyBy'](_0x339010,'id');_0x65eda2=_['merge'](_0x65eda2,{'model':db[_0x4aac('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x408578[_0x4aac('0x41')][_0x4aac('0x45')]){_0x3bd74b[_0x4aac('0x44')][_0x4aac('0x33')](function(_0x42a82b){_0x3eeb90['field']('i.'+_0x42a82b);});}else{_0x3eeb90[_0x4aac('0x4a')](_0x4aac('0x8d'),'unreadMessages');_0x3eeb90[_0x4aac('0x4a')](_0x4aac('0x9a'),_0x4aac('0x9b'));_0x3eeb90['field'](_0x4aac('0x9c'),_0x4aac('0x9d'));_0x3eeb90['field'](_0x4aac('0x9e'),_0x4aac('0x9f'));_0x3eeb90[_0x4aac('0x4a')]('i.*');_0x3eeb90[_0x4aac('0x4a')](_0x4aac('0xa0'),'Contact.firstName');_0x3eeb90['field']('c.lastName','Contact.lastName');_0x3eeb90['field'](_0x4aac('0xa1'),_0x4aac('0xa2'));_0x3eeb90[_0x4aac('0x4a')](_0x4aac('0xa3'),_0x4aac('0xa4'));_0x3eeb90[_0x4aac('0x4a')](_0x4aac('0xa5'),_0x4aac('0xa6'));_0x3eeb90['field'](_0x4aac('0xa7'),_0x4aac('0xa8'));_0x3eeb90['field'](_0x4aac('0xa9'),_0x4aac('0xaa'));_0x3eeb90[_0x4aac('0x4a')]('o.internal',_0x4aac('0xab'));_0x3eeb90[_0x4aac('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4aac('0x31'));}if(_0x3bd74b[_0x4aac('0x21')])_0x3eeb90[_0x4aac('0x21')](_0x3bd74b[_0x4aac('0x21')]);if(_0x3bd74b[_0x4aac('0x23')])_0x3eeb90[_0x4aac('0x23')](_0x3bd74b['offset']);return db['sequelize']['query'](_0x3eeb90[_0x4aac('0x98')](),_0x65eda2);})[_0x4aac('0x2a')](function(_0x1c6ca3){if(_0x1c6ca3[_0x4aac('0x46')]>0x0)_0x17076f[_0x4aac('0x76')](_0x4aac('0xac'),_[_0x4aac('0x2f')](_0x1c6ca3,'id'));return db['sequelize'][_0x4aac('0x41')](_0x17076f[_0x4aac('0x98')](),_0x65eda2)[_0x4aac('0x2a')](function(_0x400b18){var _0x244f29=_[_0x4aac('0xad')](_0x400b18,'WhatsappInteractionId');var _0x1bf8b7=[];_0x1c6ca3['forEach'](function(_0x4f8c42){_0x1bf8b7[_0x4aac('0x34')](updateWhatsappInteraction(_0x4f8c42,_0x5191ba,_0x244f29));});return BPromise[_0x4aac('0xae')](_0x1bf8b7);});});})[_0x4aac('0x2a')](function(_0x194f29){_0x5e2a59[_0x4aac('0xaf')]=_0x194f29;return _0x5e2a59;})[_0x4aac('0x2a')](respondWithFilteredResult(_0x5af68f,_0x3bd74b))[_0x4aac('0x35')](handleError(_0x5af68f,null));};exports[_0x4aac('0xb0')]=function(_0x211de3,_0x9e81ef){var _0xfa1c34={'raw':![],'where':{'id':_0x211de3[_0x4aac('0xb1')]['id']}},_0x28ae2c={};_0x28ae2c['model']=_[_0x4aac('0x42')](db[_0x4aac('0x99')]['rawAttributes']);_0x28ae2c[_0x4aac('0x41')]=_[_0x4aac('0x42')](_0x211de3[_0x4aac('0x41')]);_0x28ae2c[_0x4aac('0x49')]=_[_0x4aac('0x43')](_0x28ae2c[_0x4aac('0x40')],_0x28ae2c[_0x4aac('0x41')]);_0xfa1c34[_0x4aac('0x44')]=_[_0x4aac('0x43')](_0x28ae2c['model'],qs[_0x4aac('0x45')](_0x211de3['query'][_0x4aac('0x45')]));_0xfa1c34[_0x4aac('0x44')]=_0xfa1c34[_0x4aac('0x44')][_0x4aac('0x46')]?_0xfa1c34[_0x4aac('0x44')]:_0x28ae2c[_0x4aac('0x40')];if(_0x211de3[_0x4aac('0x41')][_0x4aac('0xb2')]){_0xfa1c34['include']=[{'all':!![]}];}_0xfa1c34=_[_0x4aac('0xb3')]({},_0xfa1c34,_0x211de3[_0x4aac('0xb4')]);return db[_0x4aac('0x99')]['find'](_0xfa1c34)[_0x4aac('0x2a')](handleEntityNotFound(_0x9e81ef,null))[_0x4aac('0x2a')](respondWithResult(_0x9e81ef,null))[_0x4aac('0x35')](handleError(_0x9e81ef,null));};exports[_0x4aac('0xb5')]=function(_0x29ca26,_0x16a07f){return db[_0x4aac('0x99')]['create'](_0x29ca26[_0x4aac('0xb6')],{})[_0x4aac('0x2a')](respondWithResult(_0x16a07f,0xc9))[_0x4aac('0x35')](handleError(_0x16a07f,null));};exports[_0x4aac('0x29')]=function(_0x19cf45,_0x4c8c7d){if(_0x19cf45[_0x4aac('0xb6')]['id']){delete _0x19cf45[_0x4aac('0xb6')]['id'];}return db[_0x4aac('0x99')][_0x4aac('0x5f')]({'where':{'id':_0x19cf45['params']['id']}})[_0x4aac('0x2a')](handleEntityNotFound(_0x4c8c7d,null))[_0x4aac('0x2a')](saveUpdates(_0x19cf45[_0x4aac('0xb6')],null))['then'](respondWithResult(_0x4c8c7d,null))[_0x4aac('0x35')](handleError(_0x4c8c7d,null));};exports[_0x4aac('0x2b')]=function(_0x2745bd,_0x42498b){return db[_0x4aac('0x99')][_0x4aac('0x5f')]({'where':{'id':_0x2745bd[_0x4aac('0xb1')]['id']}})[_0x4aac('0x2a')](handleEntityNotFound(_0x42498b,null))[_0x4aac('0x2a')](removeEntity(_0x42498b,null))[_0x4aac('0x35')](handleError(_0x42498b,null));};exports[_0x4aac('0xb7')]=function(_0x4cf752,_0x3df3d0){return db[_0x4aac('0x99')][_0x4aac('0xb7')]()[_0x4aac('0x2a')](respondWithResult(_0x3df3d0,null))[_0x4aac('0x35')](handleError(_0x3df3d0,null));};exports['addMessage']=function(_0x15c584,_0x49484a,_0x22e17){return db[_0x4aac('0xb8')][_0x4aac('0x5f')]({'where':{'id':_0x15c584[_0x4aac('0xb1')]['id']}})[_0x4aac('0x2a')](handleEntityNotFound(_0x49484a,null))[_0x4aac('0x2a')](function(_0x480dc4){if(_0x480dc4){return _0x480dc4['addMessage'](_0x15c584[_0x4aac('0xb6')][_0x4aac('0xb9')],_[_0x4aac('0xba')](_0x15c584['body'],[_0x4aac('0xb9'),'id'])||{});}})[_0x4aac('0x2a')](respondWithResult(_0x49484a,null))[_0x4aac('0x35')](handleError(_0x49484a,null));};exports[_0x4aac('0xbb')]=function(_0x10358b,_0x2fd1c2,_0x3da8ec){var _0x561916={'raw':![],'where':{}};var _0x1eb728={};var _0x4c1842={'count':0x0,'rows':[]};return db[_0x4aac('0x99')][_0x4aac('0xbc')]({'where':{'id':_0x10358b[_0x4aac('0xb1')]['id']}})[_0x4aac('0x2a')](handleEntityNotFound(_0x2fd1c2,null))[_0x4aac('0x2a')](function(_0x121ca0){if(_0x121ca0){_0x1eb728[_0x4aac('0x40')]=_['keys'](db[_0x4aac('0xb8')]['rawAttributes']);_0x1eb728[_0x4aac('0x41')]=_[_0x4aac('0x42')](_0x10358b[_0x4aac('0x41')]);_0x1eb728['filters']=_[_0x4aac('0x43')](_0x1eb728['model'],_0x1eb728[_0x4aac('0x41')]);_0x561916[_0x4aac('0x44')]=_[_0x4aac('0x43')](_0x1eb728[_0x4aac('0x40')],qs['fields'](_0x10358b[_0x4aac('0x41')][_0x4aac('0x45')]));_0x561916[_0x4aac('0x44')]=_0x561916[_0x4aac('0x44')][_0x4aac('0x46')]?_0x561916['attributes']:_0x1eb728['model'];if(!_0x10358b[_0x4aac('0x41')]['hasOwnProperty'](_0x4aac('0x47'))){_0x561916['limit']=qs[_0x4aac('0x21')](_0x10358b['query'][_0x4aac('0x21')]);_0x561916[_0x4aac('0x23')]=qs[_0x4aac('0x23')](_0x10358b[_0x4aac('0x41')]['offset']);}_0x561916[_0x4aac('0x8e')]=qs['sort'](_0x10358b[_0x4aac('0x41')][_0x4aac('0x48')]);_0x561916[_0x4aac('0x76')]=qs['filters'](_[_0x4aac('0xbd')](_0x10358b['query'],_0x1eb728[_0x4aac('0x49')]));_0x561916[_0x4aac('0x76')]['WhatsappInteractionId']=_0x121ca0['id'];if(_0x10358b[_0x4aac('0x41')][_0x4aac('0x83')]){_0x561916['where']=_[_0x4aac('0xb3')](_0x561916[_0x4aac('0x76')],{'$or':_[_0x4aac('0x2f')](_0x561916[_0x4aac('0x44')],function(_0x4ed954){var _0x329a7e={};_0x329a7e[_0x4ed954]={'$like':'%'+_0x10358b[_0x4aac('0x41')][_0x4aac('0x83')]+'%'};return _0x329a7e;})});}if(_0x10358b[_0x4aac('0x41')][_0x4aac('0x7a')]){var _0x2b14a7=_0x10358b['query']['$gte']['split'](',');var _0x33201b={};_0x33201b[_0x2b14a7[0x0]]={'$gte':moment(_0x2b14a7[0x1])[_0x4aac('0xbe')](_0x4aac('0xbf'))};_0x561916['where']=_[_0x4aac('0xb3')](_0x561916['where'],_0x33201b);}_0x561916=_[_0x4aac('0xb3')]({},_0x561916,_0x10358b['options']);return db[_0x4aac('0xb8')][_0x4aac('0x22')]({'where':_0x561916[_0x4aac('0x76')]})[_0x4aac('0x2a')](function(_0x19e11d){_0x4c1842[_0x4aac('0x22')]=_0x19e11d;if(_0x10358b['query']['includeAll']){_0x561916[_0x4aac('0xc0')]=[{'all':!![]}];}return db[_0x4aac('0xb8')]['findAll'](_0x561916);})[_0x4aac('0x2a')](function(_0x537cf9){_0x4c1842['rows']=_0x537cf9;return _0x4c1842;});}})[_0x4aac('0x2a')](respondWithFilteredResult(_0x2fd1c2,_0x561916))[_0x4aac('0x35')](handleError(_0x2fd1c2,null));};exports[_0x4aac('0xc1')]=function(_0x466ef4,_0x510972,_0x39aa54){return db[_0x4aac('0x99')][_0x4aac('0x5f')]({'where':{'id':_0x466ef4[_0x4aac('0xb1')]['id']}})['then'](handleEntityNotFound(_0x510972,null))[_0x4aac('0x2a')](function(_0x420326){if(_0x420326){return _0x420326[_0x4aac('0xc2')](_0x466ef4[_0x4aac('0xb6')][_0x4aac('0xb9')],_[_0x4aac('0xba')](_0x466ef4['body'],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x4aac('0xc3')]({'attributes':['id',_0x4aac('0x2d'),_0x4aac('0x4b')],'where':{'id':_0x466ef4[_0x4aac('0xb6')][_0x4aac('0xb9')]}});})[_0x4aac('0x2a')](function(_0x26456c){socket[_0x4aac('0xc4')](_0x4aac('0xc5'),{'id':Number(_0x466ef4[_0x4aac('0xb1')]['id']),'tags':_0x26456c||[]});return{'id':Number(_0x466ef4['params']['id']),'tags':_0x26456c||[]};});}})[_0x4aac('0x2a')](respondWithResult(_0x510972,null))[_0x4aac('0x35')](handleError(_0x510972,null));};exports[_0x4aac('0xc6')]=function(_0x105cae,_0x38bda5,_0x4c2155){return db[_0x4aac('0x99')][_0x4aac('0x5f')]({'where':{'id':_0x105cae[_0x4aac('0xb1')]['id']}})[_0x4aac('0x2a')](handleEntityNotFound(_0x38bda5,null))[_0x4aac('0x2a')](function(_0x339c59){if(_0x339c59){return _0x339c59[_0x4aac('0xc6')](_0x105cae[_0x4aac('0x41')][_0x4aac('0xb9')]);}})[_0x4aac('0x2a')](respondWithStatusCode(_0x38bda5,null))[_0x4aac('0x35')](handleError(_0x38bda5,null));};exports[_0x4aac('0xc7')]=function(_0x43ee4a,_0x272caa){var _0x52c26a=moment()[_0x4aac('0xc8')]()[_0x4aac('0x98')]();var _0x3d2f8f=path[_0x4aac('0xc9')](config[_0x4aac('0xca')],_0x4aac('0xcb'),_0x4aac('0xcc'),'tmp');var _0x181876=path['join'](config['root'],'server',_0x4aac('0xcc'),_0x4aac('0xcd'));var _0x13a13d=path[_0x4aac('0xc9')](_0x3d2f8f,_0x52c26a);var _0x449817=util[_0x4aac('0xbe')]('transcript-%d-%s.zip',_0x43ee4a[_0x4aac('0xb1')]['id'],_0x52c26a);var _0xe3557=path[_0x4aac('0xc9')](_0x3d2f8f,_0x449817);var _0x7c25c5=[];_0x7c25c5[_0x4aac('0x34')]({'model':db['User'],'as':'User','attributes':['id',_0x4aac('0x30')],'raw':!![]});_0x7c25c5['push']({'model':db[_0x4aac('0xce')],'as':_0x4aac('0x65'),'attributes':['id',_0x4aac('0xcf'),'lastName'],'raw':!![]});if(_0x43ee4a[_0x4aac('0x41')][_0x4aac('0xcd')]){_0x7c25c5[_0x4aac('0x34')]({'model':db[_0x4aac('0xd0')],'as':_0x4aac('0xd0'),'raw':!![]});}var _0x679e1a=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0x4aac('0xb6'),_0x4aac('0x78'),_0x4aac('0xd1'),_0x4aac('0xd2'),_0x4aac('0x7e')],'include':_0x7c25c5}];_0x679e1a['push']({'model':db['WhatsappAccount'],'as':_0x4aac('0xd3'),'attributes':['id','name']});_0x679e1a['push']({'model':db[_0x4aac('0x71')],'as':'Owner','attributes':['id',_0x4aac('0x30')]});return db[_0x4aac('0x99')][_0x4aac('0x5f')]({'where':{'id':_0x43ee4a['params']['id']},'include':_0x679e1a})[_0x4aac('0x2a')](handleEntityNotFound(_0x272caa,null))['then'](function(_0x4e5f61){if(_0x4e5f61){var _0x399f89=_0x4e5f61[_0x4aac('0xd4')]({'plain':!![]});fs[_0x4aac('0xd5')](_0x13a13d);var _0x15cfce={'channel':_0x4aac('0xd6'),'account':_0x399f89[_0x4aac('0xd3')]['name'],'agent':_0x399f89[_0x4aac('0xd7')]?_0x399f89[_0x4aac('0xd7')][_0x4aac('0x30')]:_0x4aac('0xd8'),'createdAt':moment(_0x399f89[_0x4aac('0x78')])['format'](_0x4aac('0xbf'))[_0x4aac('0x98')](),'closedAt':_0x399f89['closed']?moment(_0x399f89[_0x4aac('0xd9')])[_0x4aac('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4aac('0x98')]():'','disposition':_0x399f89['disposition'],'messages':_(_0x399f89[_0x4aac('0xda')])[_0x4aac('0x83')]({'secret':![]})['map'](function(_0x17b3bf){if(_0x17b3bf[_0x4aac('0xd0')]){var _0x209cf5=path[_0x4aac('0xc9')](_0x181876,_0x17b3bf[_0x4aac('0xd0')][_0x4aac('0xdb')]);if(fs[_0x4aac('0xdc')](_0x209cf5)){fs['createReadStream'](_0x209cf5)['pipe'](fs['createWriteStream'](path['join'](_0x13a13d,_0x17b3bf[_0x4aac('0xd0')][_0x4aac('0xdb')])));}}return{'date':moment(_0x17b3bf['createdAt'])[_0x4aac('0xbe')](_0x4aac('0xbf'))[_0x4aac('0x98')](),'sender':_0x17b3bf[_0x4aac('0xd1')]===_0x4aac('0xdd')?_0x17b3bf[_0x4aac('0x71')]?_0x17b3bf[_0x4aac('0x71')][_0x4aac('0x30')]:_0x4aac('0xde'):_0x17b3bf['Contact']['firstName']+(_0x17b3bf[_0x4aac('0x65')][_0x4aac('0xdf')]?'\x20'+_0x17b3bf['Contact'][_0x4aac('0xdf')]:''),'body':_0x17b3bf[_0x4aac('0xd0')]?_0x17b3bf[_0x4aac('0xd0')]['basename']:_0x17b3bf[_0x4aac('0xb6')],'direction':_0x17b3bf[_0x4aac('0xd1')]===_0x4aac('0xdd')?'A':'C','secret':_0x17b3bf[_0x4aac('0xd2')],'read':_0x17b3bf[_0x4aac('0x7e')],'attachment':_0x17b3bf[_0x4aac('0xd0')]};})[_0x4aac('0x61')]()};return ejs[_0x4aac('0xe0')](path['join'](config[_0x4aac('0xca')],_0x4aac('0xcb'),'views','downloadInteraction.ejs'),{'interaction':_0x15cfce})[_0x4aac('0x2a')](function(_0x55be03){var _0xbe84e2=path[_0x4aac('0xc9')](_0x13a13d,_0x4aac('0xe1')+_0x399f89['id']+'-'+_0x52c26a+_0x4aac('0xe2'));var _0x33c210={'path':_0xbe84e2,'channel':'Whatsapp','interactionId':_0x399f89['id']};return pdf[_0x4aac('0xe3')](_0x55be03,_0x33c210);})[_0x4aac('0x2a')](function(){return new BPromise(function(_0x2e30aa,_0x1529cd){zipdir(_0x13a13d,{'saveTo':_0xe3557},function(_0x46211f,_0x36d56f){if(_0x46211f)return _0x1529cd(_0x46211f);return _0x2e30aa(_0x36d56f);});})['then'](function(){return new BPromise(function(_0xd0c7c5,_0x161b68){rimraf(_0x13a13d,function(_0x2a3fce){if(_0x2a3fce)_0x161b68(_0x2a3fce);return _0xd0c7c5();});});})[_0x4aac('0x2a')](function(){return _0x272caa[_0x4aac('0xc7')](_0xe3557,_0x449817,function(_0x32beaf){if(_0x32beaf){console[_0x4aac('0xe4')](_0x4aac('0xe5'),_0x32beaf);}else{fs[_0x4aac('0xe6')](_0xe3557);}});});});}else{return _0x272caa['sendStatus'](0xc8);}})[_0x4aac('0x35')](handleError(_0x272caa,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 3c719a1..8105b2e 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 _0xe3ed=['WhatsappMessage','setMaxListeners','save','update','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappInteraction'];(function(_0x34f991,_0x3db8b9){var _0x184b4b=function(_0x14e5af){while(--_0x14e5af){_0x34f991['push'](_0x34f991['shift']());}};_0x184b4b(++_0x3db8b9);}(_0xe3ed,0x8d));var _0xde3e=function(_0x6afd87,_0x3f7544){_0x6afd87=_0x6afd87-0x0;var _0x3e5ec7=_0xe3ed[_0x6afd87];return _0x3e5ec7;};'use strict';var EventEmitter=require(_0xde3e('0x0'));var WhatsappInteraction=require(_0xde3e('0x1'))['db'][_0xde3e('0x2')];var WhatsappMessage=require(_0xde3e('0x1'))['db'][_0xde3e('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xde3e('0x4')](0x0);var events={'afterCreate':_0xde3e('0x5'),'afterUpdate':_0xde3e('0x6'),'afterDestroy':'remove'};function emitEvent(_0xe768f5){return function(_0x3e214c,_0x5a1abf,_0x3405cc){_0x3e214c['getUsers']({'attributes':['id'],'raw':!![]})[_0xde3e('0x7')](function(_0x4c4ac6){_0x3e214c['setDataValue'](_0xde3e('0x8'),_0x4c4ac6[_0xde3e('0x9')](function(_0xceed52){return{'id':_0xceed52['id']};}));return WhatsappMessage[_0xde3e('0xa')]({'where':{'WhatsappInteractionId':_0x3e214c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xde3e('0x7')](function(_0x4aec4d){_0x3e214c[_0xde3e('0xb')](_0xde3e('0xc'),_0x4aec4d[_0xde3e('0xd')]);WhatsappInteractionEvents[_0xde3e('0xe')](_0xe768f5+':'+_0x3e214c['id'],_0x3e214c);WhatsappInteractionEvents['emit'](_0xe768f5,_0x3e214c);_0x3405cc(null);})[_0xde3e('0xf')](_0x3405cc(null));};}for(var e in events){if(events[_0xde3e('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xde3e('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xc91b=['getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','catch','hasOwnProperty','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update'];(function(_0x21e31e,_0x451faf){var _0x3e5b20=function(_0x19038b){while(--_0x19038b){_0x21e31e['push'](_0x21e31e['shift']());}};_0x3e5b20(++_0x451faf);}(_0xc91b,0x16f));var _0xbc91=function(_0x42c82f,_0x4157a0){_0x42c82f=_0x42c82f-0x0;var _0x224514=_0xc91b[_0x42c82f];return _0x224514;};'use strict';var EventEmitter=require(_0xbc91('0x0'));var WhatsappInteraction=require(_0xbc91('0x1'))['db'][_0xbc91('0x2')];var WhatsappMessage=require(_0xbc91('0x1'))['db'][_0xbc91('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xbc91('0x4')](0x0);var events={'afterCreate':_0xbc91('0x5'),'afterUpdate':_0xbc91('0x6'),'afterDestroy':'remove'};function emitEvent(_0x38fe3a){return function(_0x24a895,_0x4a88e3,_0x222ed7){_0x24a895[_0xbc91('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xf88d45){_0x24a895[_0xbc91('0x8')](_0xbc91('0x9'),_0xf88d45[_0xbc91('0xa')](function(_0x3f9299){return{'id':_0x3f9299['id']};}));return WhatsappMessage[_0xbc91('0xb')]({'where':{'WhatsappInteractionId':_0x24a895['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbc91('0xc')](function(_0x4e1d68){_0x24a895[_0xbc91('0x8')](_0xbc91('0xd'),_0x4e1d68[_0xbc91('0xe')]);WhatsappInteractionEvents['emit'](_0x38fe3a+':'+_0x24a895['id'],_0x24a895);WhatsappInteractionEvents['emit'](_0x38fe3a,_0x24a895);_0x222ed7(null);})[_0xbc91('0xf')](_0x222ed7(null));};}for(var e in events){if(events[_0xbc91('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 4a57397..4dc4494 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 _0x6456=['WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes'];(function(_0x3b22e9,_0x354406){var _0x230314=function(_0x29ae96){while(--_0x29ae96){_0x3b22e9['push'](_0x3b22e9['shift']());}};_0x230314(++_0x354406);}(_0x6456,0xe6));var _0x6645=function(_0x11bbc3,_0x38e184){_0x11bbc3=_0x11bbc3-0x0;var _0x354da4=_0x6456[_0x11bbc3];return _0x354da4;};'use strict';var _=require(_0x6645('0x0'));var util=require(_0x6645('0x1'));var logger=require(_0x6645('0x2'))('api');var moment=require(_0x6645('0x3'));var BPromise=require(_0x6645('0x4'));var rp=require(_0x6645('0x5'));var fs=require('fs');var path=require(_0x6645('0x6'));var rimraf=require(_0x6645('0x7'));var config=require(_0x6645('0x8'));var attributes=require(_0x6645('0x9'));module['exports']=function(_0x442857,_0x49d1ae){return _0x442857['define'](_0x6645('0xa'),attributes,{'tableName':_0x6645('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x50e21e,_0x879f17,_0x43770d){if(_0x50e21e[_0x6645('0xc')](_0x6645('0xd'))){_0x50e21e[_0x6645('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x43770d(null,_0x50e21e);}}});}; \ No newline at end of file +var _0xe3ef=['request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0xe3ef,0x1d7));var _0xfe3e=function(_0x439cab,_0x5dec4c){_0x439cab=_0x439cab-0x0;var _0x53d87d=_0xe3ef[_0x439cab];return _0x53d87d;};'use strict';var _=require(_0xfe3e('0x0'));var util=require('util');var logger=require(_0xfe3e('0x1'))(_0xfe3e('0x2'));var moment=require(_0xfe3e('0x3'));var BPromise=require(_0xfe3e('0x4'));var rp=require(_0xfe3e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe3e('0x6'));var config=require(_0xfe3e('0x7'));var attributes=require(_0xfe3e('0x8'));module[_0xfe3e('0x9')]=function(_0x593ec1,_0x23a158){return _0x593ec1[_0xfe3e('0xa')](_0xfe3e('0xb'),attributes,{'tableName':_0xfe3e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57c444,_0x4208d1,_0xd5ae29){if(_0x57c444['changed'](_0xfe3e('0xd'))){_0x57c444[_0xfe3e('0xe')]=moment()[_0xfe3e('0xf')](_0xfe3e('0x10'));}_0xd5ae29(null,_0x57c444);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 9831124..68547b2 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 _0x6216=['then','info','request\x20sent','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','UpdateWhatsappInteraction','update','body','options','raw','where','limit','debug','catch','WhatsappInteraction','addTags','ids','omit','spread','AddTags','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register'];(function(_0x2e7c1e,_0x4de797){var _0x5881a8=function(_0x2c7c05){while(--_0x2c7c05){_0x2e7c1e['push'](_0x2e7c1e['shift']());}};_0x5881a8(++_0x4de797);}(_0x6216,0x1b2));var _0x6621=function(_0x1829fd,_0x33b470){_0x1829fd=_0x1829fd-0x0;var _0x177d22=_0x6216[_0x1829fd];return _0x177d22;};'use strict';var _=require(_0x6621('0x0'));var util=require(_0x6621('0x1'));var moment=require(_0x6621('0x2'));var BPromise=require('bluebird');var rs=require(_0x6621('0x3'));var fs=require('fs');var Redis=require(_0x6621('0x4'));var db=require(_0x6621('0x5'))['db'];var utils=require(_0x6621('0x6'));var logger=require(_0x6621('0x7'))(_0x6621('0x8'));var config=require('../../config/environment');var jayson=require(_0x6621('0x9'));var client=jayson[_0x6621('0xa')]['http']({'port':0x232a});config['redis']=_[_0x6621('0xb')](config[_0x6621('0xc')],{'host':_0x6621('0xd'),'port':0x18eb});var socket=require(_0x6621('0xe'))(new Redis(config['redis']));require(_0x6621('0xf'))[_0x6621('0x10')](socket);function respondWithRpcPromise(_0x1088f7,_0x3d35f0,_0x454e67){return new BPromise(function(_0x4a674c,_0x1c44e1){return client['request'](_0x1088f7,_0x454e67)[_0x6621('0x11')](function(_0x32d0a4){logger[_0x6621('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x3d35f0,_0x6621('0x13'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x3d35f0,_0x6621('0x13'),JSON['stringify'](_0x32d0a4));if(_0x32d0a4[_0x6621('0x14')]){if(_0x32d0a4[_0x6621('0x14')][_0x6621('0x15')]===0x1f4){logger[_0x6621('0x14')](_0x6621('0x16'),_0x3d35f0,_0x32d0a4['error'][_0x6621('0x17')]);return _0x1c44e1(_0x32d0a4[_0x6621('0x14')][_0x6621('0x17')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x3d35f0,_0x32d0a4[_0x6621('0x14')]['message']);return _0x4a674c(_0x32d0a4[_0x6621('0x14')][_0x6621('0x17')]);}else{logger[_0x6621('0x12')](_0x6621('0x16'),_0x3d35f0,'request\x20sent');_0x4a674c(_0x32d0a4[_0x6621('0x18')][_0x6621('0x17')]);}})['catch'](function(_0x5ddd1f){logger[_0x6621('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x3d35f0,_0x5ddd1f);_0x1c44e1(_0x5ddd1f);});});}exports[_0x6621('0x19')]=function(_0x1444e8){var _0x1008c1=this;return new Promise(function(_0x25a06b,_0x4380e8){return db['WhatsappInteraction'][_0x6621('0x1a')](_0x1444e8[_0x6621('0x1b')],{'raw':_0x1444e8[_0x6621('0x1c')]?_0x1444e8[_0x6621('0x1c')][_0x6621('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1444e8[_0x6621('0x1c')]?_0x1444e8[_0x6621('0x1c')][_0x6621('0x1e')]||null:null,'attributes':_0x1444e8['options']?_0x1444e8['options']['attributes']||null:null,'limit':_0x1444e8[_0x6621('0x1c')]?_0x1444e8[_0x6621('0x1c')][_0x6621('0x1f')]||null:null})[_0x6621('0x11')](function(_0x2b9c2c){logger[_0x6621('0x12')](_0x6621('0x19'),_0x1444e8);logger[_0x6621('0x20')](_0x6621('0x19'),_0x1444e8,JSON['stringify'](_0x2b9c2c));_0x25a06b(_0x2b9c2c);})[_0x6621('0x21')](function(_0x5f23a9){logger[_0x6621('0x14')](_0x6621('0x19'),_0x5f23a9[_0x6621('0x17')],_0x1444e8);_0x4380e8(_0x1008c1[_0x6621('0x14')](0x1f4,_0x5f23a9['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x148717){return new Promise(function(_0x481070,_0x49e65f){return db[_0x6621('0x22')]['find']({'where':_0x148717[_0x6621('0x1c')]?_0x148717[_0x6621('0x1c')][_0x6621('0x1e')]||null:null})[_0x6621('0x11')](function(_0x2be243){if(_0x2be243){return _0x2be243[_0x6621('0x23')](_0x148717[_0x6621('0x1b')][_0x6621('0x24')],_[_0x6621('0x25')](_0x148717[_0x6621('0x1b')],[_0x6621('0x24'),'id'])||{});}})[_0x6621('0x26')](function(_0x2f1c91){logger['info'](_0x6621('0x27'),_0x148717);logger[_0x6621('0x20')]('AddTags',_0x148717,JSON[_0x6621('0x28')](_0x2f1c91));_0x481070(_0x2f1c91);})[_0x6621('0x21')](function(_0x33ce00){logger['error'](_0x6621('0x27'),_0x33ce00['message'],_0x148717);_0x49e65f(_this[_0x6621('0x14')](0x1f4,_0x33ce00[_0x6621('0x17')]));});});}; \ No newline at end of file +var _0xdae4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateWhatsappInteraction','body','options','where','attributes','limit','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0xdae4,0xe3));var _0x4dae=function(_0x388f40,_0x5590a8){_0x388f40=_0x388f40-0x0;var _0x5ca462=_0xdae4[_0x388f40];return _0x5ca462;};'use strict';var _=require(_0x4dae('0x0'));var util=require(_0x4dae('0x1'));var moment=require(_0x4dae('0x2'));var BPromise=require(_0x4dae('0x3'));var rs=require(_0x4dae('0x4'));var fs=require('fs');var Redis=require(_0x4dae('0x5'));var db=require(_0x4dae('0x6'))['db'];var utils=require(_0x4dae('0x7'));var logger=require(_0x4dae('0x8'))(_0x4dae('0x9'));var config=require(_0x4dae('0xa'));var jayson=require(_0x4dae('0xb'));var client=jayson[_0x4dae('0xc')]['http']({'port':0x232a});config[_0x4dae('0xd')]=_[_0x4dae('0xe')](config['redis'],{'host':_0x4dae('0xf'),'port':0x18eb});var socket=require(_0x4dae('0x10'))(new Redis(config['redis']));require(_0x4dae('0x11'))[_0x4dae('0x12')](socket);function respondWithRpcPromise(_0x434383,_0x3226b2,_0x17ac93){return new BPromise(function(_0x52f966,_0xeb6f96){return client[_0x4dae('0x13')](_0x434383,_0x17ac93)[_0x4dae('0x14')](function(_0x5a4bde){logger['info'](_0x4dae('0x15'),_0x3226b2,'request\x20sent');logger[_0x4dae('0x16')](_0x4dae('0x17'),_0x3226b2,_0x4dae('0x18'),JSON[_0x4dae('0x19')](_0x5a4bde));if(_0x5a4bde[_0x4dae('0x1a')]){if(_0x5a4bde[_0x4dae('0x1a')][_0x4dae('0x1b')]===0x1f4){logger[_0x4dae('0x1a')](_0x4dae('0x15'),_0x3226b2,_0x5a4bde[_0x4dae('0x1a')][_0x4dae('0x1c')]);return _0xeb6f96(_0x5a4bde[_0x4dae('0x1a')][_0x4dae('0x1c')]);}logger[_0x4dae('0x1a')](_0x4dae('0x15'),_0x3226b2,_0x5a4bde[_0x4dae('0x1a')][_0x4dae('0x1c')]);return _0x52f966(_0x5a4bde[_0x4dae('0x1a')][_0x4dae('0x1c')]);}else{logger[_0x4dae('0x1d')](_0x4dae('0x15'),_0x3226b2,_0x4dae('0x18'));_0x52f966(_0x5a4bde[_0x4dae('0x1e')][_0x4dae('0x1c')]);}})[_0x4dae('0x1f')](function(_0xe31355){logger[_0x4dae('0x1a')](_0x4dae('0x15'),_0x3226b2,_0xe31355);_0xeb6f96(_0xe31355);});});}exports[_0x4dae('0x20')]=function(_0x392bcb){var _0x2fdea0=this;return new Promise(function(_0x2f30cd,_0x597c70){return db['WhatsappInteraction']['update'](_0x392bcb[_0x4dae('0x21')],{'raw':_0x392bcb[_0x4dae('0x22')]?_0x392bcb['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x392bcb[_0x4dae('0x22')]?_0x392bcb[_0x4dae('0x22')][_0x4dae('0x23')]||null:null,'attributes':_0x392bcb[_0x4dae('0x22')]?_0x392bcb[_0x4dae('0x22')][_0x4dae('0x24')]||null:null,'limit':_0x392bcb[_0x4dae('0x22')]?_0x392bcb['options'][_0x4dae('0x25')]||null:null})['then'](function(_0x5f444a){logger[_0x4dae('0x1d')](_0x4dae('0x20'),_0x392bcb);logger[_0x4dae('0x16')](_0x4dae('0x20'),_0x392bcb,JSON[_0x4dae('0x19')](_0x5f444a));_0x2f30cd(_0x5f444a);})[_0x4dae('0x1f')](function(_0x1ac120){logger[_0x4dae('0x1a')]('UpdateWhatsappInteraction',_0x1ac120[_0x4dae('0x1c')],_0x392bcb);_0x597c70(_0x2fdea0[_0x4dae('0x1a')](0x1f4,_0x1ac120['message']));});});};exports[_0x4dae('0x26')]=function(_0x2506e0){return new Promise(function(_0x4b42ee,_0x4fe7de){return db[_0x4dae('0x27')][_0x4dae('0x28')]({'where':_0x2506e0['options']?_0x2506e0['options'][_0x4dae('0x23')]||null:null})['then'](function(_0xd047f6){if(_0xd047f6){return _0xd047f6[_0x4dae('0x29')](_0x2506e0[_0x4dae('0x21')][_0x4dae('0x2a')],_[_0x4dae('0x2b')](_0x2506e0[_0x4dae('0x21')],['ids','id'])||{});}})[_0x4dae('0x2c')](function(_0x572b00){logger[_0x4dae('0x1d')](_0x4dae('0x2d'),_0x2506e0);logger['debug'](_0x4dae('0x2d'),_0x2506e0,JSON[_0x4dae('0x19')](_0x572b00));_0x4b42ee(_0x572b00);})[_0x4dae('0x1f')](function(_0x39dbdd){logger[_0x4dae('0x1a')](_0x4dae('0x2d'),_0x39dbdd[_0x4dae('0x1c')],_0x2506e0);_0x4fe7de(_this[_0x4dae('0x1a')](0x1f4,_0x39dbdd['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 3d643f1..504ef73 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 _0x2200=['remove','emit','register','length','whatsappInteraction:'];(function(_0x541384,_0x1a50e2){var _0x43811=function(_0x11069b){while(--_0x11069b){_0x541384['push'](_0x541384['shift']());}};_0x43811(++_0x1a50e2);}(_0x2200,0xaa));var _0x0220=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0x2200[_0x5a99db];return _0x3aad62;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save',_0x0220('0x0'),'update'];function createListener(_0x28c9cd,_0xfb3aaf){return function(_0x556cdf){_0xfb3aaf[_0x0220('0x1')](_0x28c9cd,_0x556cdf);};}function removeListener(_0x281939,_0x478526){return function(){WhatsappInteractionEvents['removeListener'](_0x281939,_0x478526);};}exports[_0x0220('0x2')]=function(_0x3cd402){for(var _0x482986=0x0,_0x3404a4=events[_0x0220('0x3')];_0x482986<_0x3404a4;_0x482986++){var _0x47066c=events[_0x482986];var _0x11a1c4=createListener(_0x0220('0x4')+_0x47066c,_0x3cd402);WhatsappInteractionEvents['on'](_0x47066c,_0x11a1c4);}}; \ No newline at end of file +var _0xe12f=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','update','emit','removeListener'];(function(_0x471e45,_0x913fd0){var _0x2534d1=function(_0x59ce61){while(--_0x59ce61){_0x471e45['push'](_0x471e45['shift']());}};_0x2534d1(++_0x913fd0);}(_0xe12f,0xeb));var _0xfe12=function(_0x12b2e0,_0x198ffb){_0x12b2e0=_0x12b2e0-0x0;var _0x21612a=_0xe12f[_0x12b2e0];return _0x21612a;};'use strict';var WhatsappInteractionEvents=require(_0xfe12('0x0'));var events=[_0xfe12('0x1'),'remove',_0xfe12('0x2')];function createListener(_0x23f04a,_0x12bcd3){return function(_0x3e1dff){_0x12bcd3[_0xfe12('0x3')](_0x23f04a,_0x3e1dff);};}function removeListener(_0x3c8702,_0xdee3b4){return function(){WhatsappInteractionEvents[_0xfe12('0x4')](_0x3c8702,_0xdee3b4);};}exports[_0xfe12('0x5')]=function(_0x5b1007){for(var _0x56285f=0x0,_0xf91756=events[_0xfe12('0x6')];_0x56285f<_0xf91756;_0x56285f++){var _0x5215a4=events[_0x56285f];var _0x5c9d69=createListener(_0xfe12('0x7')+_0x5215a4,_0x5b1007);WhatsappInteractionEvents['on'](_0x5215a4,_0x5c9d69);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 9577ed9..9bb047d 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 _0x359c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x3b4463,_0x557e2d){var _0x1029d6=function(_0x272c51){while(--_0x272c51){_0x3b4463['push'](_0x3b4463['shift']());}};_0x1029d6(++_0x557e2d);}(_0x359c,0x14f));var _0xc359=function(_0x57ee76,_0x130268){_0x57ee76=_0x57ee76-0x0;var _0x376e0e=_0x359c[_0x57ee76];return _0x376e0e;};'use strict';var multer=require(_0xc359('0x0'));var util=require(_0xc359('0x1'));var path=require(_0xc359('0x2'));var timeout=require(_0xc359('0x3'));var express=require(_0xc359('0x4'));var router=express[_0xc359('0x5')]();var fs_extra=require(_0xc359('0x6'));var auth=require(_0xc359('0x7'));var interaction=require(_0xc359('0x8'));var config=require(_0xc359('0x9'));var controller=require(_0xc359('0xa'));router[_0xc359('0xb')]('/',auth[_0xc359('0xc')](),controller[_0xc359('0xd')]);router[_0xc359('0xb')](_0xc359('0xe'),auth[_0xc359('0xc')](),controller[_0xc359('0xf')]);router[_0xc359('0xb')](_0xc359('0x10'),auth[_0xc359('0xc')](),controller[_0xc359('0x11')]);router[_0xc359('0x12')]('/',auth[_0xc359('0xc')](),interaction[_0xc359('0x13')](_0xc359('0x14'),_0xc359('0x15')),controller[_0xc359('0x16')]);router['post'](_0xc359('0x17'),controller['status']);router[_0xc359('0x18')]('/:id',auth[_0xc359('0xc')](),controller[_0xc359('0x19')]);router[_0xc359('0x18')](_0xc359('0x1a'),auth['isAuthenticated'](),controller['accept']);router[_0xc359('0x18')](_0xc359('0x1b'),auth[_0xc359('0xc')](),controller[_0xc359('0x1c')]);router[_0xc359('0x1d')](_0xc359('0x10'),auth[_0xc359('0xc')](),controller[_0xc359('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xcfc2=['create','post','/:id/status','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','show','whatsapp','whatsappmessage:create'];(function(_0x457b72,_0x2099ba){var _0x25304d=function(_0x3ab65c){while(--_0x3ab65c){_0x457b72['push'](_0x457b72['shift']());}};_0x25304d(++_0x2099ba);}(_0xcfc2,0x107));var _0x2cfc=function(_0x1c7ea0,_0x232d28){_0x1c7ea0=_0x1c7ea0-0x0;var _0x51c60f=_0xcfc2[_0x1c7ea0];return _0x51c60f;};'use strict';var multer=require(_0x2cfc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2cfc('0x1'));var express=require(_0x2cfc('0x2'));var router=express[_0x2cfc('0x3')]();var fs_extra=require(_0x2cfc('0x4'));var auth=require(_0x2cfc('0x5'));var interaction=require(_0x2cfc('0x6'));var config=require(_0x2cfc('0x7'));var controller=require(_0x2cfc('0x8'));router[_0x2cfc('0x9')]('/',auth[_0x2cfc('0xa')](),controller[_0x2cfc('0xb')]);router['get'](_0x2cfc('0xc'),auth[_0x2cfc('0xa')](),controller[_0x2cfc('0xd')]);router['get']('/:id',auth[_0x2cfc('0xa')](),controller[_0x2cfc('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0x2cfc('0xf'),_0x2cfc('0x10')),controller[_0x2cfc('0x11')]);router[_0x2cfc('0x12')](_0x2cfc('0x13'),controller['status']);router[_0x2cfc('0x14')](_0x2cfc('0x15'),auth[_0x2cfc('0xa')](),controller['update']);router[_0x2cfc('0x14')](_0x2cfc('0x16'),auth[_0x2cfc('0xa')](),controller[_0x2cfc('0x17')]);router[_0x2cfc('0x14')](_0x2cfc('0x18'),auth[_0x2cfc('0xa')](),controller[_0x2cfc('0x19')]);router[_0x2cfc('0x1a')](_0x2cfc('0x15'),auth[_0x2cfc('0xa')](),controller['destroy']);module[_0x2cfc('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 2110031..da829bc 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 _0xf61a=['STRING','DATE','BOOLEAN','exports','TEXT','medium','out'];(function(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0xf61a,0xe3));var _0xaf61=function(_0x21e304,_0xd47568){_0x21e304=_0x21e304-0x0;var _0x1f449e=_0xf61a[_0x21e304];return _0x1f449e;};'use strict';var Sequelize=require('sequelize');module[_0xaf61('0x0')]={'body':{'type':Sequelize[_0xaf61('0x1')](_0xaf61('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xaf61('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xaf61('0x4')](0xbe)},'phone':{'type':Sequelize[_0xaf61('0x4')]},'readAt':{'type':Sequelize[_0xaf61('0x5')]},'secret':{'type':Sequelize[_0xaf61('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xaf61('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xd07b=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x2e25d8,_0xd1f900){var _0x2994a0=function(_0x56f956){while(--_0x56f956){_0x2e25d8['push'](_0x2e25d8['shift']());}};_0x2994a0(++_0xd1f900);}(_0xd07b,0xfc));var _0xbd07=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd07b[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xbd07('0x0'));module[_0xbd07('0x1')]={'body':{'type':Sequelize[_0xbd07('0x2')](_0xbd07('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbd07('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbd07('0x5')]('in','out'),'defaultValue':_0xbd07('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xbd07('0x7')]},'readAt':{'type':Sequelize[_0xbd07('0x8')]},'secret':{'type':Sequelize[_0xbd07('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbd07('0x7')]},'providerResponse':{'type':Sequelize[_0xbd07('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index e97afb2..c5a1d61 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 _0xf1f1=['reject','save','update','destroy','stack','name','send','map','WhatsappMessage','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','rows','catch','show','rawAttributes','find','create','body','params','describe','../../config/logger','whatsapp-interactions','whatsapp','read','UserId','user','get','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','fullname','internal','agent','manual','format','channel','motionChannel','event','accept','EventManager','acceptmessage','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','User','email','interface','SIP/%s','rejectmessage','WhatsappAccount','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply'];(function(_0x5d8b26,_0x17d8e1){var _0x2315ed=function(_0x88bcb2){while(--_0x88bcb2){_0x5d8b26['push'](_0x5d8b26['shift']());}};_0x2315ed(++_0x17d8e1);}(_0xf1f1,0xe7));var _0x1f1f=function(_0x2ae98d,_0xa3ad86){_0x2ae98d=_0x2ae98d-0x0;var _0xa9b7f8=_0xf1f1[_0x2ae98d];return _0xa9b7f8;};'use strict';var emlformat=require(_0x1f1f('0x0'));var rimraf=require(_0x1f1f('0x1'));var zipdir=require(_0x1f1f('0x2'));var jsonpatch=require(_0x1f1f('0x3'));var rp=require('request-promise');var moment=require(_0x1f1f('0x4'));var BPromise=require(_0x1f1f('0x5'));var Mustache=require(_0x1f1f('0x6'));var util=require(_0x1f1f('0x7'));var path=require('path');var sox=require(_0x1f1f('0x8'));var csv=require(_0x1f1f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f1f('0xa'));var _=require(_0x1f1f('0xb'));var squel=require(_0x1f1f('0xc'));var crypto=require(_0x1f1f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1f1f('0xe'));var toCsv=require(_0x1f1f('0x9'));var querystring=require(_0x1f1f('0xf'));var Papa=require(_0x1f1f('0x10'));var Redis=require(_0x1f1f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1f1f('0x12'));var as=require(_0x1f1f('0x13'));var hardwareService=require(_0x1f1f('0x14'));var logger=require('../../config/logger')(_0x1f1f('0x15'));var utils=require(_0x1f1f('0x16'));var config=require(_0x1f1f('0x17'));var licenseUtil=require(_0x1f1f('0x18'));var db=require(_0x1f1f('0x19'))['db'];config[_0x1f1f('0x1a')]=_[_0x1f1f('0x1b')](config[_0x1f1f('0x1a')],{'host':_0x1f1f('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1f1f('0x1d'))['register'](socket);var jayson=require(_0x1f1f('0x1e'));var client=jayson[_0x1f1f('0x1f')][_0x1f1f('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x1f1f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xea484d,_0x57e2fe,_0x1cb8d1,_0x382365){return new BPromise(function(_0x522791,_0x3b995f){var _0x2f8e94=_0x382365||client;return _0x2f8e94[_0x1f1f('0x21')](_0xea484d,_0x1cb8d1)[_0x1f1f('0x22')](function(_0x45c245){logger['info'](_0x1f1f('0x23'),_0x57e2fe,_0x1f1f('0x24'));logger[_0x1f1f('0x25')](_0x1f1f('0x26'),_0x57e2fe,_0x1f1f('0x24'),JSON[_0x1f1f('0x27')](_0x45c245));if(_0x45c245[_0x1f1f('0x28')]){if(_0x45c245[_0x1f1f('0x28')][_0x1f1f('0x29')]===0x1f4){logger[_0x1f1f('0x28')](_0x1f1f('0x23'),_0x57e2fe,_0x45c245['error'][_0x1f1f('0x2a')]);return _0x3b995f(_0x45c245['error'][_0x1f1f('0x2a')]);}logger[_0x1f1f('0x28')](_0x1f1f('0x23'),_0x57e2fe,_0x45c245[_0x1f1f('0x28')][_0x1f1f('0x2a')]);return _0x522791(_0x45c245['error']['message']);}else{logger[_0x1f1f('0x2b')](_0x1f1f('0x23'),_0x57e2fe,_0x1f1f('0x24'));_0x522791(_0x45c245[_0x1f1f('0x2c')]['message']);}})['catch'](function(_0x2fc0e6){logger[_0x1f1f('0x28')](_0x1f1f('0x23'),_0x57e2fe,_0x2fc0e6);_0x3b995f(_0x2fc0e6);});});}function respondWithStatusCode(_0x285741,_0x14eba6){_0x14eba6=_0x14eba6||0xcc;return function(_0x4d06b8){if(_0x4d06b8){return _0x285741[_0x1f1f('0x2d')](_0x14eba6);}return _0x285741[_0x1f1f('0x2e')](_0x14eba6)[_0x1f1f('0x2f')]();};}function respondWithResult(_0x5d6b98,_0x3dcc8f){_0x3dcc8f=_0x3dcc8f||0xc8;return function(_0x594c78){if(_0x594c78){return _0x5d6b98['status'](_0x3dcc8f)[_0x1f1f('0x30')](_0x594c78);}};}function respondWithFilteredResult(_0x394f77,_0x1278da){return function(_0xe83efc){if(_0xe83efc){var _0x26aaa2=typeof _0x1278da[_0x1f1f('0x31')]==='undefined'&&typeof _0x1278da['limit']==='undefined';var _0x5d1346=_0xe83efc[_0x1f1f('0x32')];var _0x57bdc7=_0x26aaa2?0x0:_0x1278da[_0x1f1f('0x31')];var _0xc18bd5=_0x26aaa2?_0xe83efc[_0x1f1f('0x32')]:_0x1278da[_0x1f1f('0x31')]+_0x1278da[_0x1f1f('0x33')];var _0x57924e;if(_0xc18bd5>=_0x5d1346){_0xc18bd5=_0x5d1346;_0x57924e=0xc8;}else{_0x57924e=0xce;}_0x394f77[_0x1f1f('0x2e')](_0x57924e);return _0x394f77[_0x1f1f('0x34')](_0x1f1f('0x35'),_0x57bdc7+'-'+_0xc18bd5+'/'+_0x5d1346)['json'](_0xe83efc);}return null;};}function patchUpdates(_0x48ceb1){return function(_0x25c153){try{jsonpatch[_0x1f1f('0x36')](_0x25c153,_0x48ceb1,!![]);}catch(_0x2b3a03){return BPromise[_0x1f1f('0x37')](_0x2b3a03);}return _0x25c153[_0x1f1f('0x38')]();};}function saveUpdates(_0x2eebb2,_0xe2500e){return function(_0xa768){if(_0xa768){return _0xa768[_0x1f1f('0x39')](_0x2eebb2)[_0x1f1f('0x22')](function(_0x1c3766){return _0x1c3766;});}return null;};}function removeEntity(_0x9695c8,_0x574957){return function(_0x1c78de){if(_0x1c78de){return _0x1c78de[_0x1f1f('0x3a')]()['then'](function(){_0x9695c8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41c017,_0x21f44f){return function(_0x3a067d){if(!_0x3a067d){_0x41c017['sendStatus'](0x194);}return _0x3a067d;};}function handleError(_0x579dd1,_0x42bbf1){_0x42bbf1=_0x42bbf1||0x1f4;return function(_0x71477){logger[_0x1f1f('0x28')](_0x71477[_0x1f1f('0x3b')]);if(_0x71477['name']){delete _0x71477[_0x1f1f('0x3c')];}_0x579dd1[_0x1f1f('0x2e')](_0x42bbf1)[_0x1f1f('0x3d')](_0x71477);};}exports['index']=function(_0xe9277c,_0x9df526){var _0x1ecc0a={},_0x3870ce={},_0x2fc0e3={'count':0x0,'rows':[]};var _0x36b181=_[_0x1f1f('0x3e')](db[_0x1f1f('0x3f')]['rawAttributes'],function(_0x38b58c){return{'name':_0x38b58c[_0x1f1f('0x40')],'type':_0x38b58c[_0x1f1f('0x41')]['key']};});_0x3870ce['model']=_[_0x1f1f('0x3e')](_0x36b181,_0x1f1f('0x3c'));_0x3870ce[_0x1f1f('0x42')]=_[_0x1f1f('0x43')](_0xe9277c[_0x1f1f('0x42')]);_0x3870ce[_0x1f1f('0x44')]=_[_0x1f1f('0x45')](_0x3870ce['model'],_0x3870ce[_0x1f1f('0x42')]);_0x1ecc0a['attributes']=_[_0x1f1f('0x45')](_0x3870ce[_0x1f1f('0x46')],qs['fields'](_0xe9277c[_0x1f1f('0x42')][_0x1f1f('0x47')]));_0x1ecc0a[_0x1f1f('0x48')]=_0x1ecc0a[_0x1f1f('0x48')][_0x1f1f('0x49')]?_0x1ecc0a[_0x1f1f('0x48')]:_0x3870ce[_0x1f1f('0x46')];if(!_0xe9277c[_0x1f1f('0x42')][_0x1f1f('0x4a')](_0x1f1f('0x4b'))){_0x1ecc0a[_0x1f1f('0x33')]=qs['limit'](_0xe9277c[_0x1f1f('0x42')][_0x1f1f('0x33')]);_0x1ecc0a[_0x1f1f('0x31')]=qs[_0x1f1f('0x31')](_0xe9277c[_0x1f1f('0x42')]['offset']);}_0x1ecc0a[_0x1f1f('0x4c')]=qs[_0x1f1f('0x4d')](_0xe9277c[_0x1f1f('0x42')][_0x1f1f('0x4d')]);_0x1ecc0a['where']=qs['filters'](_[_0x1f1f('0x4e')](_0xe9277c[_0x1f1f('0x42')],_0x3870ce[_0x1f1f('0x44')]),_0x36b181);if(_0xe9277c[_0x1f1f('0x42')][_0x1f1f('0x4f')]){_0x1ecc0a['where']=_[_0x1f1f('0x50')](_0x1ecc0a[_0x1f1f('0x51')],{'$or':_[_0x1f1f('0x3e')](_0x36b181,function(_0x3175e8){if(_0x3175e8[_0x1f1f('0x41')]!==_0x1f1f('0x52')){var _0x1b80ad={};_0x1b80ad[_0x3175e8[_0x1f1f('0x3c')]]={'$like':'%'+_0xe9277c['query']['filter']+'%'};return _0x1b80ad;}})});}_0x1ecc0a=_['merge']({},_0x1ecc0a,_0xe9277c[_0x1f1f('0x53')]);var _0x3695b4={'where':_0x1ecc0a[_0x1f1f('0x51')]};return db[_0x1f1f('0x3f')][_0x1f1f('0x32')](_0x3695b4)['then'](function(_0x4b2288){_0x2fc0e3['count']=_0x4b2288;if(_0xe9277c[_0x1f1f('0x42')]['includeAll']){_0x1ecc0a[_0x1f1f('0x54')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x1ecc0a);})['then'](function(_0x467d55){_0x2fc0e3[_0x1f1f('0x55')]=_0x467d55;return _0x2fc0e3;})['then'](respondWithFilteredResult(_0x9df526,_0x1ecc0a))[_0x1f1f('0x56')](handleError(_0x9df526,null));};exports[_0x1f1f('0x57')]=function(_0x503944,_0x3f7b4f){var _0x4d7b45={'raw':!![],'where':{'id':_0x503944['params']['id']}},_0x1f18a9={};_0x1f18a9['model']=_['keys'](db[_0x1f1f('0x3f')][_0x1f1f('0x58')]);_0x1f18a9[_0x1f1f('0x42')]=_[_0x1f1f('0x43')](_0x503944[_0x1f1f('0x42')]);_0x1f18a9[_0x1f1f('0x44')]=_[_0x1f1f('0x45')](_0x1f18a9[_0x1f1f('0x46')],_0x1f18a9[_0x1f1f('0x42')]);_0x4d7b45[_0x1f1f('0x48')]=_['intersection'](_0x1f18a9['model'],qs[_0x1f1f('0x47')](_0x503944['query'][_0x1f1f('0x47')]));_0x4d7b45[_0x1f1f('0x48')]=_0x4d7b45[_0x1f1f('0x48')][_0x1f1f('0x49')]?_0x4d7b45['attributes']:_0x1f18a9['model'];if(_0x503944[_0x1f1f('0x42')]['includeAll']){_0x4d7b45['include']=[{'all':!![]}];}_0x4d7b45=_['merge']({},_0x4d7b45,_0x503944[_0x1f1f('0x53')]);return db[_0x1f1f('0x3f')][_0x1f1f('0x59')](_0x4d7b45)['then'](handleEntityNotFound(_0x3f7b4f,null))[_0x1f1f('0x22')](respondWithResult(_0x3f7b4f,null))[_0x1f1f('0x56')](handleError(_0x3f7b4f,null));};exports[_0x1f1f('0x5a')]=function(_0x41897b,_0x280592){return db[_0x1f1f('0x3f')][_0x1f1f('0x5a')](_0x41897b['body'],{})[_0x1f1f('0x22')](respondWithResult(_0x280592,0xc9))[_0x1f1f('0x56')](handleError(_0x280592,null));};exports[_0x1f1f('0x39')]=function(_0x121548,_0xc490c6){if(_0x121548['body']['id']){delete _0x121548[_0x1f1f('0x5b')]['id'];}return db[_0x1f1f('0x3f')][_0x1f1f('0x59')]({'where':{'id':_0x121548[_0x1f1f('0x5c')]['id']}})['then'](handleEntityNotFound(_0xc490c6,null))['then'](saveUpdates(_0x121548['body'],null))['then'](respondWithResult(_0xc490c6,null))['catch'](handleError(_0xc490c6,null));};exports['destroy']=function(_0x27b921,_0x43aee6){return db[_0x1f1f('0x3f')][_0x1f1f('0x59')]({'where':{'id':_0x27b921['params']['id']}})[_0x1f1f('0x22')](handleEntityNotFound(_0x43aee6,null))[_0x1f1f('0x22')](removeEntity(_0x43aee6,null))[_0x1f1f('0x56')](handleError(_0x43aee6,null));};exports[_0x1f1f('0x5d')]=function(_0x2dcb2b,_0x149563){return db[_0x1f1f('0x3f')][_0x1f1f('0x5d')]()[_0x1f1f('0x22')](respondWithResult(_0x149563,null))[_0x1f1f('0x56')](handleError(_0x149563,null));};var interaction_log=require(_0x1f1f('0x5e'))(_0x1f1f('0x5f'));exports['accept']=function(_0x4112e5,_0x12fe78,_0x18a628){var _0x20edb={'agent':{},'channel':_0x1f1f('0x60')};if(_0x4112e5[_0x1f1f('0x5b')]['id']){delete _0x4112e5[_0x1f1f('0x5b')]['id'];}_0x4112e5[_0x1f1f('0x5b')][_0x1f1f('0x61')]=!![];_0x4112e5['body']['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4112e5[_0x1f1f('0x5b')][_0x1f1f('0x62')]=_0x4112e5[_0x1f1f('0x5b')][_0x1f1f('0x62')]||_0x4112e5[_0x1f1f('0x63')]['id'];_0x20edb['agent']['id']=_0x4112e5[_0x1f1f('0x5b')][_0x1f1f('0x62')];return db[_0x1f1f('0x3f')][_0x1f1f('0x59')]({'where':{'id':_0x4112e5[_0x1f1f('0x5c')]['id'],'UserId':null}})[_0x1f1f('0x22')](handleEntityNotFound(_0x12fe78,null))[_0x1f1f('0x22')](saveUpdates(_0x4112e5[_0x1f1f('0x5b')],null))[_0x1f1f('0x22')](function(_0x14ec3f){if(_0x14ec3f){_0x20edb['message']=_0x14ec3f[_0x1f1f('0x64')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x14ec3f[_0x1f1f('0x65')]}});}return null;})[_0x1f1f('0x22')](handleEntityNotFound(_0x12fe78,null))[_0x1f1f('0x22')](function(_0x28d721){if(_0x28d721){return _0x28d721[_0x1f1f('0x39')]({'UserId':_0x4112e5['body']['UserId'],'read1stAt':_['isNil'](_0x28d721[_0x1f1f('0x66')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x1f1f('0x22')](function(_0x33d52d){if(_0x33d52d){_0x20edb[_0x1f1f('0x67')]=_0x33d52d[_0x1f1f('0x64')]({'plain':!![]});interaction_log[_0x1f1f('0x2b')](_0x1f1f('0x68'),_0x4112e5[_0x1f1f('0x63')]['id'],_0x4112e5[_0x1f1f('0x63')][_0x1f1f('0x3c')],_0x4112e5[_0x1f1f('0x63')][_0x1f1f('0x69')],_0x20edb[_0x1f1f('0x67')]['id'],_0x4112e5[_0x1f1f('0x5b')]?JSON[_0x1f1f('0x27')](_0x4112e5[_0x1f1f('0x5b')]):_0x1f1f('0x6a'));return respondWithRpcPromise(_0x1f1f('0x6b'),_0x1f1f('0x6c'),_0x20edb);}return null;})[_0x1f1f('0x22')](function(_0x277778){var _0x2a8f6c=_0x1f1f('0x6d')+_0x277778['message']['ContactId'];return db[_0x1f1f('0x6e')]['query'](_0x2a8f6c,{'type':db[_0x1f1f('0x6f')][_0x1f1f('0x70')]['SELECT'],'raw':!![]})[_0x1f1f('0x22')](function(_0x226a6c){return _0x226a6c;});})[_0x1f1f('0x22')](function(_0x2dee3e){if(_0x2dee3e){_0x20edb['message'][_0x1f1f('0x71')]=_0x2dee3e[0x0];if(!_0x4112e5[_0x1f1f('0x5b')][_0x1f1f('0x62')])return;return db['User'][_0x1f1f('0x59')]({'where':{'id':_0x4112e5['body'][_0x1f1f('0x62')],'role':'agent'},'attributes':['id',_0x1f1f('0x3c'),_0x1f1f('0x72'),'email',_0x1f1f('0x73')],'raw':!![]});}return null;})[_0x1f1f('0x22')](function(_0x4b9974){if(!_0x4b9974)return null;_0x20edb[_0x1f1f('0x2a')][_0x1f1f('0x74')]=_0x4b9974;return _0x20edb;})['then'](function(_0x2b2271){if(_0x2b2271){if(_0x4112e5[_0x1f1f('0x5b')][_0x1f1f('0x75')]){_0x20edb[_0x1f1f('0x2a')]['interface']=util[_0x1f1f('0x76')]('SIP/%s',_0x4112e5[_0x1f1f('0x63')][_0x1f1f('0x3c')]);_0x20edb[_0x1f1f('0x2a')]['channel']=_0x20edb[_0x1f1f('0x77')];_0x20edb[_0x1f1f('0x2a')][_0x1f1f('0x78')]=_0x20edb[_0x1f1f('0x77')];_0x20edb['message'][_0x1f1f('0x79')]=_0x1f1f('0x7a');return respondWithRpcPromise('EventManager',_0x1f1f('0x7b'),{'event':_0x1f1f('0x7c'),'message':_0x20edb[_0x1f1f('0x2a')]},client9002)[_0x1f1f('0x22')](function(){return _0x20edb;});}return _0x20edb;}return null;})[_0x1f1f('0x22')](respondWithResult(_0x12fe78,null))['catch'](handleError(_0x12fe78,null));};var interaction_log=require(_0x1f1f('0x5e'))(_0x1f1f('0x5f'));exports['reject']=function(_0x4e1c3d,_0x5bad41,_0x34d61a){var _0x5786be={'agent':{},'channel':_0x1f1f('0x60')};if(_0x4e1c3d[_0x1f1f('0x5b')]['id']){delete _0x4e1c3d[_0x1f1f('0x5b')]['id'];}_0x4e1c3d['body'][_0x1f1f('0x62')]=_0x4e1c3d[_0x1f1f('0x5b')][_0x1f1f('0x62')]||_0x4e1c3d['user']['id'];_0x5786be[_0x1f1f('0x74')]['id']=_0x4e1c3d['body'][_0x1f1f('0x62')];return db[_0x1f1f('0x3f')][_0x1f1f('0x59')]({'where':{'id':_0x4e1c3d[_0x1f1f('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5bad41,null))[_0x1f1f('0x22')](function(_0x1253ef){if(_0x1253ef){_0x5786be[_0x1f1f('0x2a')]=_0x1253ef[_0x1f1f('0x64')]({'plain':!![]});return db[_0x1f1f('0x7d')][_0x1f1f('0x59')]({'where':{'id':_0x1253ef[_0x1f1f('0x65')]}});}return null;})[_0x1f1f('0x22')](handleEntityNotFound(_0x5bad41,null))[_0x1f1f('0x22')](function(_0x4281cc){if(_0x4281cc){_0x5786be['interaction']=_0x4281cc[_0x1f1f('0x64')]({'plain':!![]});interaction_log[_0x1f1f('0x2b')](_0x1f1f('0x7e'),_0x4e1c3d[_0x1f1f('0x63')]['id'],_0x4e1c3d[_0x1f1f('0x63')][_0x1f1f('0x3c')],_0x4e1c3d[_0x1f1f('0x63')][_0x1f1f('0x69')],_0x5786be[_0x1f1f('0x67')]['id'],_0x4e1c3d[_0x1f1f('0x5b')]?JSON[_0x1f1f('0x27')](_0x4e1c3d[_0x1f1f('0x5b')]):'null');return respondWithRpcPromise(_0x1f1f('0x7f'),_0x1f1f('0x80'),_0x5786be);}return null;})[_0x1f1f('0x22')](function(_0x515cdd){var _0x1de295='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x515cdd['message'][_0x1f1f('0x81')];return db[_0x1f1f('0x6e')][_0x1f1f('0x42')](_0x1de295,{'type':db[_0x1f1f('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0x1f1f('0x22')](function(_0x595dca){return _0x595dca;});})[_0x1f1f('0x22')](function(_0x19288f){if(_0x19288f){_0x5786be['message'][_0x1f1f('0x71')]=_0x19288f[0x0];if(!_0x4e1c3d[_0x1f1f('0x5b')][_0x1f1f('0x62')])return;return db[_0x1f1f('0x82')][_0x1f1f('0x59')]({'where':{'id':_0x4e1c3d[_0x1f1f('0x5b')][_0x1f1f('0x62')],'role':_0x1f1f('0x74')},'attributes':['id','name',_0x1f1f('0x72'),_0x1f1f('0x83'),_0x1f1f('0x73')],'raw':!![]});}return null;})[_0x1f1f('0x22')](function(_0x1ae1e3){if(!_0x1ae1e3)return null;_0x5786be[_0x1f1f('0x2a')]['agent']=_0x1ae1e3;return _0x5786be;})['then'](function(_0x4888d0){if(_0x4888d0){_0x4888d0[_0x1f1f('0x2a')][_0x1f1f('0x84')]=util[_0x1f1f('0x76')](_0x1f1f('0x85'),_0x4e1c3d[_0x1f1f('0x63')][_0x1f1f('0x3c')]);_0x4888d0[_0x1f1f('0x2a')][_0x1f1f('0x77')]=_0x5786be[_0x1f1f('0x77')];_0x4888d0[_0x1f1f('0x2a')]['motionChannel']=_0x5786be['channel'];_0x4888d0[_0x1f1f('0x2a')]['event']=_0x1f1f('0x37');respondWithRpcPromise(_0x1f1f('0x7b'),_0x1f1f('0x7b'),{'event':_0x1f1f('0x86'),'message':_0x4888d0[_0x1f1f('0x2a')]},client9002);return _0x5786be;}return null;})['then'](respondWithResult(_0x5bad41,null))[_0x1f1f('0x56')](handleError(_0x5bad41,null));};exports[_0x1f1f('0x2e')]=function(_0x3a6b91,_0x32447c,_0x3a53df){if(_0x3a6b91['body']['id']){delete _0x3a6b91[_0x1f1f('0x5b')]['id'];}var _0x227af0;return db[_0x1f1f('0x3f')]['find']({'where':{'id':_0x3a6b91['params']['id']}})[_0x1f1f('0x22')](handleEntityNotFound(_0x32447c,null))[_0x1f1f('0x22')](function(_0x10b7e7){if(_0x10b7e7){_0x227af0=_0x10b7e7;return db[_0x1f1f('0x87')][_0x1f1f('0x59')]({'where':{'id':_0x10b7e7['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x32447c,null))[_0x1f1f('0x22')](function(_0x593507){if(_0x593507){logger[_0x1f1f('0x25')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x1f1f('0x2e'),_0x1f1f('0x88'),_0x593507[_0x1f1f('0x41')],util['inspect'](_0x3a6b91['body'],{'showHidden':![],'depth':null}));switch(_0x593507[_0x1f1f('0x41')]){case _0x1f1f('0x89'):if(_0x3a6b91['body'][_0x1f1f('0x8a')]&&_0x3a6b91[_0x1f1f('0x5b')][_0x1f1f('0x8a')]===_0x227af0[_0x1f1f('0x8b')]&&_0x3a6b91[_0x1f1f('0x5b')][_0x1f1f('0x8c')]&&_0x3a6b91[_0x1f1f('0x5b')][_0x1f1f('0x8c')]===_0x1f1f('0x61')){return _0x227af0['update']({'read':!![]});}else{logger[_0x1f1f('0x28')](_0x1f1f('0x8d'),_0x1f1f('0x2e'),_0x1f1f('0x89'),util[_0x1f1f('0x8e')](_0x3a6b91[_0x1f1f('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x227af0;}})['then'](respondWithResult(_0x32447c,null))[_0x1f1f('0x56')](handleError(_0x32447c,null));}; \ No newline at end of file +var _0x1727=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','whatsapp-interactions','whatsapp','readAt','format','UserId','get','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','agent','fullname','email','internal','SIP/%s','channel','motionChannel','accept','EventManager','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','sequelize','SELECT','User','interface','event','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x51b948,_0x4b7e0c){var _0x1e7ba9=function(_0x28c894){while(--_0x28c894){_0x51b948['push'](_0x51b948['shift']());}};_0x1e7ba9(++_0x4b7e0c);}(_0x1727,0x1a7));var _0x7172=function(_0x473723,_0x23c6fd){_0x473723=_0x473723-0x0;var _0x96008d=_0x1727[_0x473723];return _0x96008d;};'use strict';var emlformat=require(_0x7172('0x0'));var rimraf=require(_0x7172('0x1'));var zipdir=require(_0x7172('0x2'));var jsonpatch=require(_0x7172('0x3'));var rp=require(_0x7172('0x4'));var moment=require('moment');var BPromise=require(_0x7172('0x5'));var Mustache=require(_0x7172('0x6'));var util=require(_0x7172('0x7'));var path=require(_0x7172('0x8'));var sox=require('sox');var csv=require(_0x7172('0x9'));var ejs=require(_0x7172('0xa'));var fs=require('fs');var fs_extra=require(_0x7172('0xb'));var _=require(_0x7172('0xc'));var squel=require(_0x7172('0xd'));var crypto=require(_0x7172('0xe'));var jsforce=require(_0x7172('0xf'));var deskjs=require(_0x7172('0x10'));var toCsv=require(_0x7172('0x9'));var querystring=require(_0x7172('0x11'));var Papa=require(_0x7172('0x12'));var Redis=require('ioredis');var authService=require(_0x7172('0x13'));var qs=require(_0x7172('0x14'));var as=require(_0x7172('0x15'));var hardwareService=require(_0x7172('0x16'));var logger=require(_0x7172('0x17'))('api');var utils=require(_0x7172('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7172('0x19'));var db=require(_0x7172('0x1a'))['db'];config['redis']=_['defaults'](config[_0x7172('0x1b')],{'host':_0x7172('0x1c'),'port':0x18eb});var socket=require(_0x7172('0x1d'))(new Redis(config[_0x7172('0x1b')]));require(_0x7172('0x1e'))['register'](socket);var jayson=require(_0x7172('0x1f'));var client=jayson[_0x7172('0x20')]['http']({'port':0x232c});var client9002=jayson['client'][_0x7172('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x60a0c4,_0x2017b1,_0x483057,_0x5c8b68){return new BPromise(function(_0x664a85,_0x2fd43a){var _0x2c7b8e=_0x5c8b68||client;return _0x2c7b8e['request'](_0x60a0c4,_0x483057)[_0x7172('0x22')](function(_0x2db846){logger[_0x7172('0x23')](_0x7172('0x24'),_0x2017b1,_0x7172('0x25'));logger['debug'](_0x7172('0x26'),_0x2017b1,_0x7172('0x25'),JSON[_0x7172('0x27')](_0x2db846));if(_0x2db846['error']){if(_0x2db846[_0x7172('0x28')][_0x7172('0x29')]===0x1f4){logger['error'](_0x7172('0x24'),_0x2017b1,_0x2db846[_0x7172('0x28')][_0x7172('0x2a')]);return _0x2fd43a(_0x2db846[_0x7172('0x28')][_0x7172('0x2a')]);}logger[_0x7172('0x28')](_0x7172('0x24'),_0x2017b1,_0x2db846[_0x7172('0x28')][_0x7172('0x2a')]);return _0x664a85(_0x2db846[_0x7172('0x28')][_0x7172('0x2a')]);}else{logger[_0x7172('0x23')](_0x7172('0x24'),_0x2017b1,_0x7172('0x25'));_0x664a85(_0x2db846[_0x7172('0x2b')]['message']);}})[_0x7172('0x2c')](function(_0x4e0c40){logger[_0x7172('0x28')](_0x7172('0x24'),_0x2017b1,_0x4e0c40);_0x2fd43a(_0x4e0c40);});});}function respondWithStatusCode(_0x2fafe1,_0x25bf7f){_0x25bf7f=_0x25bf7f||0xcc;return function(_0x5ba08e){if(_0x5ba08e){return _0x2fafe1['sendStatus'](_0x25bf7f);}return _0x2fafe1[_0x7172('0x2d')](_0x25bf7f)['end']();};}function respondWithResult(_0x5edc21,_0x4559a0){_0x4559a0=_0x4559a0||0xc8;return function(_0xa4b50){if(_0xa4b50){return _0x5edc21[_0x7172('0x2d')](_0x4559a0)[_0x7172('0x2e')](_0xa4b50);}};}function respondWithFilteredResult(_0x4b0835,_0x15ad7c){return function(_0x1ba5ea){if(_0x1ba5ea){var _0x3c25a3=typeof _0x15ad7c[_0x7172('0x2f')]===_0x7172('0x30')&&typeof _0x15ad7c[_0x7172('0x31')]===_0x7172('0x30');var _0x5947a2=_0x1ba5ea[_0x7172('0x32')];var _0x51827a=_0x3c25a3?0x0:_0x15ad7c[_0x7172('0x2f')];var _0xe7ce32=_0x3c25a3?_0x1ba5ea[_0x7172('0x32')]:_0x15ad7c['offset']+_0x15ad7c[_0x7172('0x31')];var _0x3b64b3;if(_0xe7ce32>=_0x5947a2){_0xe7ce32=_0x5947a2;_0x3b64b3=0xc8;}else{_0x3b64b3=0xce;}_0x4b0835['status'](_0x3b64b3);return _0x4b0835[_0x7172('0x33')]('Content-Range',_0x51827a+'-'+_0xe7ce32+'/'+_0x5947a2)[_0x7172('0x2e')](_0x1ba5ea);}return null;};}function patchUpdates(_0x6edd20){return function(_0x23a286){try{jsonpatch[_0x7172('0x34')](_0x23a286,_0x6edd20,!![]);}catch(_0x254f27){return BPromise[_0x7172('0x35')](_0x254f27);}return _0x23a286[_0x7172('0x36')]();};}function saveUpdates(_0x5ea9a2,_0x32e043){return function(_0x37c7d9){if(_0x37c7d9){return _0x37c7d9[_0x7172('0x37')](_0x5ea9a2)[_0x7172('0x22')](function(_0xa2b4fa){return _0xa2b4fa;});}return null;};}function removeEntity(_0x217f0f,_0x1ed4d2){return function(_0xda8c85){if(_0xda8c85){return _0xda8c85[_0x7172('0x38')]()[_0x7172('0x22')](function(){_0x217f0f[_0x7172('0x2d')](0xcc)[_0x7172('0x39')]();});}};}function handleEntityNotFound(_0x3e7f72,_0x2bdb17){return function(_0x58c93c){if(!_0x58c93c){_0x3e7f72[_0x7172('0x3a')](0x194);}return _0x58c93c;};}function handleError(_0x59b78a,_0x22fb57){_0x22fb57=_0x22fb57||0x1f4;return function(_0xd2d79f){logger[_0x7172('0x28')](_0xd2d79f[_0x7172('0x3b')]);if(_0xd2d79f[_0x7172('0x3c')]){delete _0xd2d79f[_0x7172('0x3c')];}_0x59b78a['status'](_0x22fb57)[_0x7172('0x3d')](_0xd2d79f);};}exports[_0x7172('0x3e')]=function(_0x4f8c92,_0x4f9e06){var _0x2037b3={},_0x39fe2b={},_0x56ff7e={'count':0x0,'rows':[]};var _0x28b522=_[_0x7172('0x3f')](db[_0x7172('0x40')][_0x7172('0x41')],function(_0x30c94a){return{'name':_0x30c94a[_0x7172('0x42')],'type':_0x30c94a[_0x7172('0x43')]['key']};});_0x39fe2b[_0x7172('0x44')]=_['map'](_0x28b522,_0x7172('0x3c'));_0x39fe2b[_0x7172('0x45')]=_[_0x7172('0x46')](_0x4f8c92[_0x7172('0x45')]);_0x39fe2b['filters']=_[_0x7172('0x47')](_0x39fe2b[_0x7172('0x44')],_0x39fe2b[_0x7172('0x45')]);_0x2037b3['attributes']=_[_0x7172('0x47')](_0x39fe2b[_0x7172('0x44')],qs[_0x7172('0x48')](_0x4f8c92[_0x7172('0x45')]['fields']));_0x2037b3['attributes']=_0x2037b3[_0x7172('0x49')][_0x7172('0x4a')]?_0x2037b3[_0x7172('0x49')]:_0x39fe2b[_0x7172('0x44')];if(!_0x4f8c92['query'][_0x7172('0x4b')](_0x7172('0x4c'))){_0x2037b3[_0x7172('0x31')]=qs[_0x7172('0x31')](_0x4f8c92[_0x7172('0x45')][_0x7172('0x31')]);_0x2037b3[_0x7172('0x2f')]=qs['offset'](_0x4f8c92[_0x7172('0x45')][_0x7172('0x2f')]);}_0x2037b3[_0x7172('0x4d')]=qs[_0x7172('0x4e')](_0x4f8c92[_0x7172('0x45')][_0x7172('0x4e')]);_0x2037b3[_0x7172('0x4f')]=qs[_0x7172('0x50')](_[_0x7172('0x51')](_0x4f8c92[_0x7172('0x45')],_0x39fe2b[_0x7172('0x50')]),_0x28b522);if(_0x4f8c92[_0x7172('0x45')][_0x7172('0x52')]){_0x2037b3['where']=_[_0x7172('0x53')](_0x2037b3[_0x7172('0x4f')],{'$or':_[_0x7172('0x3f')](_0x28b522,function(_0x45045e){if(_0x45045e[_0x7172('0x43')]!==_0x7172('0x54')){var _0x1a658e={};_0x1a658e[_0x45045e[_0x7172('0x3c')]]={'$like':'%'+_0x4f8c92['query'][_0x7172('0x52')]+'%'};return _0x1a658e;}})});}_0x2037b3=_[_0x7172('0x53')]({},_0x2037b3,_0x4f8c92[_0x7172('0x55')]);var _0x35833d={'where':_0x2037b3[_0x7172('0x4f')]};return db[_0x7172('0x40')][_0x7172('0x32')](_0x35833d)[_0x7172('0x22')](function(_0x2a6dae){_0x56ff7e[_0x7172('0x32')]=_0x2a6dae;if(_0x4f8c92['query'][_0x7172('0x56')]){_0x2037b3[_0x7172('0x57')]=[{'all':!![]}];}return db[_0x7172('0x40')][_0x7172('0x58')](_0x2037b3);})[_0x7172('0x22')](function(_0x27a3e0){_0x56ff7e[_0x7172('0x59')]=_0x27a3e0;return _0x56ff7e;})[_0x7172('0x22')](respondWithFilteredResult(_0x4f9e06,_0x2037b3))[_0x7172('0x2c')](handleError(_0x4f9e06,null));};exports[_0x7172('0x5a')]=function(_0x4ce61b,_0xae4349){var _0x27dc31={'raw':!![],'where':{'id':_0x4ce61b[_0x7172('0x5b')]['id']}},_0x536613={};_0x536613['model']=_['keys'](db[_0x7172('0x40')][_0x7172('0x41')]);_0x536613[_0x7172('0x45')]=_['keys'](_0x4ce61b[_0x7172('0x45')]);_0x536613[_0x7172('0x50')]=_['intersection'](_0x536613[_0x7172('0x44')],_0x536613[_0x7172('0x45')]);_0x27dc31[_0x7172('0x49')]=_[_0x7172('0x47')](_0x536613['model'],qs[_0x7172('0x48')](_0x4ce61b[_0x7172('0x45')][_0x7172('0x48')]));_0x27dc31['attributes']=_0x27dc31[_0x7172('0x49')]['length']?_0x27dc31[_0x7172('0x49')]:_0x536613[_0x7172('0x44')];if(_0x4ce61b[_0x7172('0x45')][_0x7172('0x56')]){_0x27dc31[_0x7172('0x57')]=[{'all':!![]}];}_0x27dc31=_['merge']({},_0x27dc31,_0x4ce61b['options']);return db['WhatsappMessage'][_0x7172('0x5c')](_0x27dc31)[_0x7172('0x22')](handleEntityNotFound(_0xae4349,null))[_0x7172('0x22')](respondWithResult(_0xae4349,null))['catch'](handleError(_0xae4349,null));};exports[_0x7172('0x5d')]=function(_0x507cc8,_0x5a53ac){return db['WhatsappMessage']['create'](_0x507cc8[_0x7172('0x5e')],{})['then'](respondWithResult(_0x5a53ac,0xc9))[_0x7172('0x2c')](handleError(_0x5a53ac,null));};exports[_0x7172('0x37')]=function(_0x4b790b,_0x44a5ab){if(_0x4b790b['body']['id']){delete _0x4b790b[_0x7172('0x5e')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x4b790b[_0x7172('0x5b')]['id']}})[_0x7172('0x22')](handleEntityNotFound(_0x44a5ab,null))['then'](saveUpdates(_0x4b790b[_0x7172('0x5e')],null))[_0x7172('0x22')](respondWithResult(_0x44a5ab,null))['catch'](handleError(_0x44a5ab,null));};exports[_0x7172('0x38')]=function(_0x3d4917,_0x28ff5d){return db[_0x7172('0x40')][_0x7172('0x5c')]({'where':{'id':_0x3d4917[_0x7172('0x5b')]['id']}})[_0x7172('0x22')](handleEntityNotFound(_0x28ff5d,null))['then'](removeEntity(_0x28ff5d,null))[_0x7172('0x2c')](handleError(_0x28ff5d,null));};exports[_0x7172('0x5f')]=function(_0x42f415,_0x38c680){return db['WhatsappMessage']['describe']()[_0x7172('0x22')](respondWithResult(_0x38c680,null))['catch'](handleError(_0x38c680,null));};var interaction_log=require(_0x7172('0x17'))(_0x7172('0x60'));exports['accept']=function(_0x58ab6e,_0x14bdef,_0x214223){var _0x107c3f={'agent':{},'channel':_0x7172('0x61')};if(_0x58ab6e['body']['id']){delete _0x58ab6e[_0x7172('0x5e')]['id'];}_0x58ab6e[_0x7172('0x5e')]['read']=!![];_0x58ab6e['body'][_0x7172('0x62')]=moment()[_0x7172('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x58ab6e[_0x7172('0x5e')][_0x7172('0x64')]=_0x58ab6e[_0x7172('0x5e')][_0x7172('0x64')]||_0x58ab6e['user']['id'];_0x107c3f['agent']['id']=_0x58ab6e[_0x7172('0x5e')][_0x7172('0x64')];return db['WhatsappMessage'][_0x7172('0x5c')]({'where':{'id':_0x58ab6e[_0x7172('0x5b')]['id'],'UserId':null}})[_0x7172('0x22')](handleEntityNotFound(_0x14bdef,null))[_0x7172('0x22')](saveUpdates(_0x58ab6e[_0x7172('0x5e')],null))[_0x7172('0x22')](function(_0x38c1b7){if(_0x38c1b7){_0x107c3f[_0x7172('0x2a')]=_0x38c1b7[_0x7172('0x65')]({'plain':!![]});return db['WhatsappInteraction'][_0x7172('0x5c')]({'where':{'id':_0x38c1b7[_0x7172('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x14bdef,null))['then'](function(_0x15d2cf){if(_0x15d2cf){return _0x15d2cf[_0x7172('0x37')]({'UserId':_0x58ab6e[_0x7172('0x5e')][_0x7172('0x64')],'read1stAt':_[_0x7172('0x67')](_0x15d2cf[_0x7172('0x68')])?moment()['format'](_0x7172('0x69')):undefined});}return null;})['then'](function(_0x59bb64){if(_0x59bb64){_0x107c3f[_0x7172('0x6a')]=_0x59bb64['get']({'plain':!![]});interaction_log[_0x7172('0x23')](_0x7172('0x6b'),_0x58ab6e['user']['id'],_0x58ab6e[_0x7172('0x6c')][_0x7172('0x3c')],_0x58ab6e[_0x7172('0x6c')]['role'],_0x107c3f[_0x7172('0x6a')]['id'],_0x58ab6e['body']?JSON[_0x7172('0x27')](_0x58ab6e['body']):_0x7172('0x6d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x107c3f);}return null;})[_0x7172('0x22')](function(_0x364dd7){var _0x4b229a=_0x7172('0x6e')+_0x364dd7[_0x7172('0x2a')][_0x7172('0x6f')];return db['sequelize'][_0x7172('0x45')](_0x4b229a,{'type':db[_0x7172('0x70')][_0x7172('0x71')]['SELECT'],'raw':!![]})[_0x7172('0x22')](function(_0x32750a){return _0x32750a;});})[_0x7172('0x22')](function(_0x5081c9){if(_0x5081c9){_0x107c3f[_0x7172('0x2a')][_0x7172('0x72')]=_0x5081c9[0x0];if(!_0x58ab6e[_0x7172('0x5e')]['UserId'])return;return db['User'][_0x7172('0x5c')]({'where':{'id':_0x58ab6e['body']['UserId'],'role':_0x7172('0x73')},'attributes':['id',_0x7172('0x3c'),_0x7172('0x74'),_0x7172('0x75'),_0x7172('0x76')],'raw':!![]});}return null;})[_0x7172('0x22')](function(_0x17d40f){if(!_0x17d40f)return null;_0x107c3f[_0x7172('0x2a')]['agent']=_0x17d40f;return _0x107c3f;})[_0x7172('0x22')](function(_0x209109){if(_0x209109){if(_0x58ab6e[_0x7172('0x5e')]['manual']){_0x107c3f[_0x7172('0x2a')]['interface']=util[_0x7172('0x63')](_0x7172('0x77'),_0x58ab6e[_0x7172('0x6c')][_0x7172('0x3c')]);_0x107c3f['message']['channel']=_0x107c3f[_0x7172('0x78')];_0x107c3f[_0x7172('0x2a')][_0x7172('0x79')]=_0x107c3f[_0x7172('0x78')];_0x107c3f[_0x7172('0x2a')]['event']=_0x7172('0x7a');return respondWithRpcPromise(_0x7172('0x7b'),_0x7172('0x7b'),{'event':'acceptmessage','message':_0x107c3f['message']},client9002)[_0x7172('0x22')](function(){return _0x107c3f;});}return _0x107c3f;}return null;})[_0x7172('0x22')](respondWithResult(_0x14bdef,null))[_0x7172('0x2c')](handleError(_0x14bdef,null));};var interaction_log=require(_0x7172('0x17'))(_0x7172('0x60'));exports[_0x7172('0x35')]=function(_0x545c4c,_0x47fdb9,_0x570860){var _0xe0caf4={'agent':{},'channel':'whatsapp'};if(_0x545c4c[_0x7172('0x5e')]['id']){delete _0x545c4c['body']['id'];}_0x545c4c[_0x7172('0x5e')][_0x7172('0x64')]=_0x545c4c[_0x7172('0x5e')][_0x7172('0x64')]||_0x545c4c[_0x7172('0x6c')]['id'];_0xe0caf4[_0x7172('0x73')]['id']=_0x545c4c[_0x7172('0x5e')][_0x7172('0x64')];return db[_0x7172('0x40')]['find']({'where':{'id':_0x545c4c['params']['id'],'UserId':null}})[_0x7172('0x22')](handleEntityNotFound(_0x47fdb9,null))['then'](function(_0x473387){if(_0x473387){_0xe0caf4[_0x7172('0x2a')]=_0x473387[_0x7172('0x65')]({'plain':!![]});return db[_0x7172('0x7c')][_0x7172('0x5c')]({'where':{'id':_0x473387['WhatsappInteractionId']}});}return null;})[_0x7172('0x22')](handleEntityNotFound(_0x47fdb9,null))[_0x7172('0x22')](function(_0x1ce51a){if(_0x1ce51a){_0xe0caf4[_0x7172('0x6a')]=_0x1ce51a['get']({'plain':!![]});interaction_log[_0x7172('0x23')](_0x7172('0x7d'),_0x545c4c['user']['id'],_0x545c4c[_0x7172('0x6c')][_0x7172('0x3c')],_0x545c4c[_0x7172('0x6c')][_0x7172('0x7e')],_0xe0caf4[_0x7172('0x6a')]['id'],_0x545c4c[_0x7172('0x5e')]?JSON[_0x7172('0x27')](_0x545c4c[_0x7172('0x5e')]):_0x7172('0x6d'));return respondWithRpcPromise(_0x7172('0x7f'),'rejectMessage',_0xe0caf4);}return null;})[_0x7172('0x22')](function(_0x245f92){var _0x13a1cb=_0x7172('0x6e')+_0x245f92[_0x7172('0x2a')]['ContactId'];return db[_0x7172('0x80')][_0x7172('0x45')](_0x13a1cb,{'type':db[_0x7172('0x70')][_0x7172('0x71')][_0x7172('0x81')],'raw':!![]})['then'](function(_0x4a761f){return _0x4a761f;});})['then'](function(_0x4ba577){if(_0x4ba577){_0xe0caf4[_0x7172('0x2a')][_0x7172('0x72')]=_0x4ba577[0x0];if(!_0x545c4c['body']['UserId'])return;return db[_0x7172('0x82')][_0x7172('0x5c')]({'where':{'id':_0x545c4c[_0x7172('0x5e')][_0x7172('0x64')],'role':'agent'},'attributes':['id',_0x7172('0x3c'),_0x7172('0x74'),_0x7172('0x75'),_0x7172('0x76')],'raw':!![]});}return null;})[_0x7172('0x22')](function(_0x1ba15d){if(!_0x1ba15d)return null;_0xe0caf4[_0x7172('0x2a')][_0x7172('0x73')]=_0x1ba15d;return _0xe0caf4;})['then'](function(_0x59de7d){if(_0x59de7d){_0x59de7d[_0x7172('0x2a')][_0x7172('0x83')]=util[_0x7172('0x63')](_0x7172('0x77'),_0x545c4c['user']['name']);_0x59de7d[_0x7172('0x2a')][_0x7172('0x78')]=_0xe0caf4[_0x7172('0x78')];_0x59de7d[_0x7172('0x2a')][_0x7172('0x79')]=_0xe0caf4['channel'];_0x59de7d[_0x7172('0x2a')][_0x7172('0x84')]=_0x7172('0x35');respondWithRpcPromise(_0x7172('0x7b'),'EventManager',{'event':'rejectmessage','message':_0x59de7d[_0x7172('0x2a')]},client9002);return _0xe0caf4;}return null;})[_0x7172('0x22')](respondWithResult(_0x47fdb9,null))[_0x7172('0x2c')](handleError(_0x47fdb9,null));};exports[_0x7172('0x2d')]=function(_0x32e359,_0x366cce,_0x587f45){if(_0x32e359[_0x7172('0x5e')]['id']){delete _0x32e359[_0x7172('0x5e')]['id'];}var _0x33370e;return db['WhatsappMessage'][_0x7172('0x5c')]({'where':{'id':_0x32e359[_0x7172('0x5b')]['id']}})[_0x7172('0x22')](handleEntityNotFound(_0x366cce,null))[_0x7172('0x22')](function(_0x2b0fa2){if(_0x2b0fa2){_0x33370e=_0x2b0fa2;return db['WhatsappAccount'][_0x7172('0x5c')]({'where':{'id':_0x2b0fa2[_0x7172('0x85')]}});}})[_0x7172('0x22')](handleEntityNotFound(_0x366cce,null))[_0x7172('0x22')](function(_0x453fe0){if(_0x453fe0){logger[_0x7172('0x86')](_0x7172('0x87'),_0x7172('0x2d'),_0x7172('0x88'),_0x453fe0[_0x7172('0x43')],util[_0x7172('0x89')](_0x32e359[_0x7172('0x5e')],{'showHidden':![],'depth':null}));switch(_0x453fe0['type']){case _0x7172('0x8a'):if(_0x32e359[_0x7172('0x5e')][_0x7172('0x8b')]&&_0x32e359[_0x7172('0x5e')]['MessageSid']===_0x33370e[_0x7172('0x8c')]&&_0x32e359[_0x7172('0x5e')]['MessageStatus']&&_0x32e359[_0x7172('0x5e')][_0x7172('0x8d')]===_0x7172('0x8e')){return _0x33370e[_0x7172('0x37')]({'read':!![]});}else{logger[_0x7172('0x28')](_0x7172('0x8f'),_0x7172('0x2d'),_0x7172('0x8a'),util[_0x7172('0x89')](_0x32e359[_0x7172('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x33370e;}})[_0x7172('0x22')](respondWithResult(_0x366cce,null))[_0x7172('0x2c')](handleError(_0x366cce,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 1bbb0d8..cf1eaeb 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 _0x0102=['setMaxListeners','save','emit','hasOwnProperty','exports','../../mysqldb','WhatsappMessage'];(function(_0xe01041,_0x5bd77a){var _0x566132=function(_0x5b148f){while(--_0x5b148f){_0xe01041['push'](_0xe01041['shift']());}};_0x566132(++_0x5bd77a);}(_0x0102,0x186));var _0x2010=function(_0x431000,_0x2c5637){_0x431000=_0x431000-0x0;var _0x62ad5d=_0x0102[_0x431000];return _0x62ad5d;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x2010('0x0'))['db'][_0x2010('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2010('0x2')](0x0);var events={'afterCreate':_0x2010('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x575b0a){return function(_0x4e30b3,_0x59082d,_0x22e49f){WhatsappMessageEvents[_0x2010('0x4')](_0x575b0a+':'+_0x4e30b3['id'],_0x4e30b3);WhatsappMessageEvents[_0x2010('0x4')](_0x575b0a,_0x4e30b3);_0x22e49f(null);};}for(var e in events){if(events[_0x2010('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x2010('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0xb9a7=['emit','hasOwnProperty','hook','exports','../../mysqldb','update'];(function(_0x553549,_0x31394c){var _0x3a5e56=function(_0x5057a5){while(--_0x5057a5){_0x553549['push'](_0x553549['shift']());}};_0x3a5e56(++_0x31394c);}(_0xb9a7,0x112));var _0x7b9a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb9a7[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x7b9a('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7b9a('0x1'),'afterDestroy':'remove'};function emitEvent(_0x1396ec){return function(_0x40ef7d,_0x37b25b,_0x24cae3){WhatsappMessageEvents[_0x7b9a('0x2')](_0x1396ec+':'+_0x40ef7d['id'],_0x40ef7d);WhatsappMessageEvents[_0x7b9a('0x2')](_0x1396ec,_0x40ef7d);_0x24cae3(null);};}for(var e in events){if(events[_0x7b9a('0x3')](e)){var event=events[e];WhatsappMessage[_0x7b9a('0x4')](e,emitEvent(event));}}module[_0x7b9a('0x5')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 3c27772..74a8324 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 _0xfc60=['sinch','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','message_id','statuses','err','finally','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','then','update','createdAt','direction','catch','error','WhatsappAccount','find','type','twilio','phone','accountSid','messages','create','whatsapp:','/status?token=','token','sid','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate'];(function(_0x3e5ad0,_0x330d5f){var _0xc2e1a=function(_0x585434){while(--_0x585434){_0x3e5ad0['push'](_0x3e5ad0['shift']());}};_0xc2e1a(++_0x330d5f);}(_0xfc60,0xb3));var _0x0fc6=function(_0x1599ae,_0x50ac2b){_0x1599ae=_0x1599ae-0x0;var _0x5c97cc=_0xfc60[_0x1599ae];return _0x5c97cc;};'use strict';var _=require(_0x0fc6('0x0'));var util=require(_0x0fc6('0x1'));var logger=require('../../config/logger')(_0x0fc6('0x2'));var moment=require(_0x0fc6('0x3'));var BPromise=require(_0x0fc6('0x4'));var rp=require('request-promise');var fetch=require(_0x0fc6('0x5'));var fs=require('fs');var path=require(_0x0fc6('0x6'));var rimraf=require('rimraf');var config=require(_0x0fc6('0x7'));var attributes=require(_0x0fc6('0x8'));module[_0x0fc6('0x9')]=function(_0x295220,_0x4f3c0d){return _0x295220['define'](_0x0fc6('0xa'),attributes,{'tableName':_0x0fc6('0xb'),'paranoid':![],'indexes':[{'name':_0x0fc6('0xc'),'fields':[_0x0fc6('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0x0fc6('0xd')],'type':_0x0fc6('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2dccf1,_0x53e321,_0x18696c){var _0xf63a99=_0x295220[_0x0fc6('0xf')];var _0x23f8d7=_0x2dccf1[_0x0fc6('0x10')]({'plain':!![]});if(_0x23f8d7['direction'][_0x0fc6('0x11')]()==='in'||_0x23f8d7['direction']['toLowerCase']()===_0x0fc6('0x12')&&!_0x23f8d7[_0x0fc6('0x13')]&&!_[_0x0fc6('0x14')](_0x23f8d7[_0x0fc6('0x15')])){_0xf63a99[_0x0fc6('0x16')][_0x0fc6('0x17')]({'where':{'id':_0x23f8d7['WhatsappInteractionId']}})[_0x0fc6('0x18')](function(_0x234e4e){if(_0x234e4e){_0x234e4e[_0x0fc6('0x19')]({'lastMsgAt':_0x23f8d7[_0x0fc6('0x1a')],'lastMsgDirection':_0x23f8d7[_0x0fc6('0x1b')]['toLowerCase']()});}})[_0x0fc6('0x1c')](function(_0x15e2fb){console[_0x0fc6('0x1d')](_0x15e2fb);});}if(_0x23f8d7['direction']===_0x0fc6('0x12')&&!_0x23f8d7['secret']){var _0x2bb8c6;_0xf63a99[_0x0fc6('0x1e')][_0x0fc6('0x1f')]({'where':{'id':_0x23f8d7['WhatsappAccountId']},'raw':!![]})[_0x0fc6('0x18')](function(_0x36f029){_0x2bb8c6=_0x36f029;if(_0x2bb8c6&&_0x2bb8c6[_0x0fc6('0x20')]){switch(_0x2bb8c6[_0x0fc6('0x20')]){case _0x0fc6('0x21'):var _0x295adf=require(_0x0fc6('0x21'));if(_0x2bb8c6['accountSid']&&_0x2bb8c6['authToken']&&_0x2bb8c6[_0x0fc6('0x22')]){var _0x45a059=new _0x295adf(_0x2bb8c6[_0x0fc6('0x23')],_0x2bb8c6['authToken']);_0x45a059[_0x0fc6('0x24')][_0x0fc6('0x25')]({'body':_0x23f8d7['body'],'to':_0x0fc6('0x26')+_0x23f8d7[_0x0fc6('0x22')],'from':_0x0fc6('0x26')+_0x2bb8c6[_0x0fc6('0x22')],'statusCallback':_0x2bb8c6['remote']+'/api/whatsapp/messages/'+_0x23f8d7['id']+_0x0fc6('0x27')+_0x2bb8c6[_0x0fc6('0x28')]})[_0x0fc6('0x18')](function(_0x591721){if(_0x591721['sid']){return _0x2dccf1[_0x0fc6('0x19')]({'messageId':_0x591721[_0x0fc6('0x29')]});}})[_0x0fc6('0x1c')](function(_0xbb8b47){logger[_0x0fc6('0x1d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0fc6('0x21'),util[_0x0fc6('0x2a')](_0xbb8b47,{'showHidden':![],'depth':null}));});}else{logger[_0x0fc6('0x1d')](_0x0fc6('0x2b'),_0x0fc6('0x2c'),_0x0fc6('0x21'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x0fc6('0x2d'):var _0x432b3d=_0x2bb8c6['accountSid'];var _0x47b698=_0x2bb8c6['authToken'];var _0x5c336f=_0x2bb8c6['baseUrl']+_0x0fc6('0x2e')+_0x432b3d+_0x0fc6('0x2f');var _0x3d2ce8={'to':[_0x23f8d7[_0x0fc6('0x22')]],'message':{'type':_0x0fc6('0x30'),'text':_0x23f8d7['body']}};var _0x1e79d8={'method':_0x0fc6('0x31'),'uri':_0x5c336f,'headers':{'Authorization':_0x0fc6('0x32')+_0x47b698,'Content-Type':'application/json'},'body':_0x3d2ce8,'json':!![]};rp(_0x1e79d8)[_0x0fc6('0x18')](function(_0x40522b){if(_0x40522b['statuses'][0x0][_0x0fc6('0x33')]){return _0x2dccf1['update']({'messageId':_0x40522b[_0x0fc6('0x34')][0x0][_0x0fc6('0x33')]});}})['catch'](function(_0x404c34){logger[_0x0fc6('0x35')]('WhatsappMessage,\x20%s',_0x404c34);});break;}}})[_0x0fc6('0x36')](function(){_0x18696c();});}else{_0x18696c();}}},'charset':'utf8mb4','collate':_0x0fc6('0x37')});}; \ No newline at end of file +var _0xbd3a=['isNil','UserId','WhatsappInteraction','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','body','phone','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','then','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','util','../../config/logger','api','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','messageId','fti_whatsapp_messages','FULLTEXT','get','direction','toLowerCase','out','secret'];(function(_0x2fd37d,_0x267b49){var _0x53ab72=function(_0x48921d){while(--_0x48921d){_0x2fd37d['push'](_0x2fd37d['shift']());}};_0x53ab72(++_0x267b49);}(_0xbd3a,0x1e5));var _0xabd3=function(_0x5a53f1,_0x5f1baf){_0x5a53f1=_0x5a53f1-0x0;var _0x3b53c8=_0xbd3a[_0x5a53f1];return _0x3b53c8;};'use strict';var _=require('lodash');var util=require(_0xabd3('0x0'));var logger=require(_0xabd3('0x1'))(_0xabd3('0x2'));var moment=require('moment');var BPromise=require(_0xabd3('0x3'));var rp=require(_0xabd3('0x4'));var fetch=require(_0xabd3('0x5'));var fs=require('fs');var path=require(_0xabd3('0x6'));var rimraf=require(_0xabd3('0x7'));var config=require(_0xabd3('0x8'));var attributes=require(_0xabd3('0x9'));module[_0xabd3('0xa')]=function(_0xf6590b,_0x4b3520){return _0xf6590b['define']('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xabd3('0xb'),'fields':['messageId']},{'name':_0xabd3('0xc'),'fields':['body'],'type':_0xabd3('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x42ac2c,_0xd53540,_0x1aa002){var _0x20773c=_0xf6590b['models'];var _0x9d1e2d=_0x42ac2c[_0xabd3('0xe')]({'plain':!![]});if(_0x9d1e2d[_0xabd3('0xf')][_0xabd3('0x10')]()==='in'||_0x9d1e2d[_0xabd3('0xf')][_0xabd3('0x10')]()===_0xabd3('0x11')&&!_0x9d1e2d[_0xabd3('0x12')]&&!_[_0xabd3('0x13')](_0x9d1e2d[_0xabd3('0x14')])){_0x20773c[_0xabd3('0x15')]['findOne']({'where':{'id':_0x9d1e2d['WhatsappInteractionId']}})['then'](function(_0x24c021){if(_0x24c021){_0x24c021[_0xabd3('0x16')]({'lastMsgAt':_0x9d1e2d[_0xabd3('0x17')],'lastMsgDirection':_0x9d1e2d[_0xabd3('0xf')][_0xabd3('0x10')]()});}})[_0xabd3('0x18')](function(_0x2ccf3a){console[_0xabd3('0x19')](_0x2ccf3a);});}if(_0x9d1e2d[_0xabd3('0xf')]===_0xabd3('0x11')&&!_0x9d1e2d[_0xabd3('0x12')]){var _0x51f919;_0x20773c[_0xabd3('0x1a')][_0xabd3('0x1b')]({'where':{'id':_0x9d1e2d[_0xabd3('0x1c')]},'raw':!![]})['then'](function(_0x163649){_0x51f919=_0x163649;if(_0x51f919&&_0x51f919[_0xabd3('0x1d')]){switch(_0x51f919['type']){case _0xabd3('0x1e'):var _0x4db320=require(_0xabd3('0x1e'));if(_0x51f919[_0xabd3('0x1f')]&&_0x51f919['authToken']&&_0x51f919['phone']){var _0x28860e=new _0x4db320(_0x51f919[_0xabd3('0x1f')],_0x51f919[_0xabd3('0x20')]);_0x28860e['messages']['create']({'body':_0x9d1e2d[_0xabd3('0x21')],'to':'whatsapp:'+_0x9d1e2d[_0xabd3('0x22')],'from':_0xabd3('0x23')+_0x51f919[_0xabd3('0x22')],'statusCallback':_0x51f919[_0xabd3('0x24')]+_0xabd3('0x25')+_0x9d1e2d['id']+_0xabd3('0x26')+_0x51f919[_0xabd3('0x27')]})[_0xabd3('0x28')](function(_0x3d2dde){if(_0x3d2dde[_0xabd3('0x29')]){return _0x42ac2c[_0xabd3('0x16')]({'messageId':_0x3d2dde[_0xabd3('0x29')]});}})[_0xabd3('0x18')](function(_0x22e82a){logger[_0xabd3('0x19')](_0xabd3('0x2a'),_0xabd3('0x2b'),'twilio',util[_0xabd3('0x2c')](_0x22e82a,{'showHidden':![],'depth':null}));});}else{logger[_0xabd3('0x19')](_0xabd3('0x2a'),_0xabd3('0x2b'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x4cfeb5=_0x51f919['accountSid'];var _0x1e79bb=_0x51f919[_0xabd3('0x20')];var _0x22a7ad=_0x51f919[_0xabd3('0x2d')]+_0xabd3('0x2e')+_0x4cfeb5+_0xabd3('0x2f');var _0xa55777={'to':[_0x9d1e2d[_0xabd3('0x22')]],'message':{'type':'text','text':_0x9d1e2d[_0xabd3('0x21')]}};var _0x513206={'method':_0xabd3('0x30'),'uri':_0x22a7ad,'headers':{'Authorization':_0xabd3('0x31')+_0x1e79bb,'Content-Type':_0xabd3('0x32')},'body':_0xa55777,'json':!![]};rp(_0x513206)[_0xabd3('0x28')](function(_0x191b05){if(_0x191b05[_0xabd3('0x33')][0x0]['message_id']){return _0x42ac2c['update']({'messageId':_0x191b05['statuses'][0x0][_0xabd3('0x34')]});}})[_0xabd3('0x18')](function(_0x7c7db0){logger[_0xabd3('0x35')](_0xabd3('0x36'),_0x7c7db0);});break;}}})[_0xabd3('0x37')](function(){_0x1aa002();});}else{_0x1aa002();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 503dba8..c22f182 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 _0xf0ed=['WhatsappMessage,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info'];(function(_0x50fa1b,_0x5697a3){var _0x62e9cf=function(_0x577e86){while(--_0x577e86){_0x50fa1b['push'](_0x50fa1b['shift']());}};_0x62e9cf(++_0x5697a3);}(_0xf0ed,0xd9));var _0xdf0e=function(_0x16795f,_0x533662){_0x16795f=_0x16795f-0x0;var _0x328f13=_0xf0ed[_0x16795f];return _0x328f13;};'use strict';var _=require(_0xdf0e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdf0e('0x1'))(_0xdf0e('0x2'));var config=require(_0xdf0e('0x3'));var jayson=require(_0xdf0e('0x4'));var client=jayson[_0xdf0e('0x5')][_0xdf0e('0x6')]({'port':0x232a});config[_0xdf0e('0x7')]=_['defaults'](config[_0xdf0e('0x7')],{'host':_0xdf0e('0x8'),'port':0x18eb});var socket=require(_0xdf0e('0x9'))(new Redis(config[_0xdf0e('0x7')]));require(_0xdf0e('0xa'))[_0xdf0e('0xb')](socket);function respondWithRpcPromise(_0x4dc4a2,_0x5df4a0,_0x3785a9){return new BPromise(function(_0x8c250d,_0x5ba14f){return client[_0xdf0e('0xc')](_0x4dc4a2,_0x3785a9)[_0xdf0e('0xd')](function(_0x3a46a6){logger[_0xdf0e('0xe')](_0xdf0e('0xf'),_0x5df4a0,'request\x20sent');logger[_0xdf0e('0x10')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5df4a0,'request\x20sent',JSON[_0xdf0e('0x11')](_0x3a46a6));if(_0x3a46a6[_0xdf0e('0x12')]){if(_0x3a46a6[_0xdf0e('0x12')][_0xdf0e('0x13')]===0x1f4){logger[_0xdf0e('0x12')](_0xdf0e('0xf'),_0x5df4a0,_0x3a46a6['error'][_0xdf0e('0x14')]);return _0x5ba14f(_0x3a46a6[_0xdf0e('0x12')]['message']);}logger[_0xdf0e('0x12')](_0xdf0e('0xf'),_0x5df4a0,_0x3a46a6['error'][_0xdf0e('0x14')]);return _0x8c250d(_0x3a46a6['error'][_0xdf0e('0x14')]);}else{logger[_0xdf0e('0xe')](_0xdf0e('0xf'),_0x5df4a0,'request\x20sent');_0x8c250d(_0x3a46a6[_0xdf0e('0x15')][_0xdf0e('0x14')]);}})[_0xdf0e('0x16')](function(_0x4263d3){logger[_0xdf0e('0x12')](_0xdf0e('0xf'),_0x5df4a0,_0x4263d3);_0x5ba14f(_0x4263d3);});});}exports[_0xdf0e('0x17')]=function(_0x475de4){var _0x3af81f=this;return new Promise(function(_0x3e7229,_0x55b812){return db[_0xdf0e('0x18')][_0xdf0e('0x19')](_0x475de4[_0xdf0e('0x1a')],{'raw':_0x475de4[_0xdf0e('0x1b')]?_0x475de4[_0xdf0e('0x1b')][_0xdf0e('0x1c')]===undefined?!![]:![]:!![]})[_0xdf0e('0xd')](function(_0x14fb7f){logger[_0xdf0e('0xe')](_0xdf0e('0x17'),_0x475de4);logger[_0xdf0e('0x10')](_0xdf0e('0x17'),_0x475de4,JSON['stringify'](_0x14fb7f));_0x3e7229(_0x14fb7f);})['catch'](function(_0x5231a7){logger[_0xdf0e('0x12')]('CreateWhatsappMessage',_0x5231a7[_0xdf0e('0x14')],_0x475de4);_0x55b812(_0x3af81f[_0xdf0e('0x12')](0x1f4,_0x5231a7[_0xdf0e('0x14')]));});});}; \ No newline at end of file +var _0xb849=['request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','then','info'];(function(_0x371cfd,_0x3d0a78){var _0x38ebda=function(_0x13c934){while(--_0x13c934){_0x371cfd['push'](_0x371cfd['shift']());}};_0x38ebda(++_0x3d0a78);}(_0xb849,0x93));var _0x9b84=function(_0x177817,_0x34ab6f){_0x177817=_0x177817-0x0;var _0x59c404=_0xb849[_0x177817];return _0x59c404;};'use strict';var _=require(_0x9b84('0x0'));var util=require(_0x9b84('0x1'));var moment=require(_0x9b84('0x2'));var BPromise=require(_0x9b84('0x3'));var rs=require(_0x9b84('0x4'));var fs=require('fs');var Redis=require(_0x9b84('0x5'));var db=require(_0x9b84('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b84('0x7'))(_0x9b84('0x8'));var config=require(_0x9b84('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9b84('0xa')]['http']({'port':0x232a});config[_0x9b84('0xb')]=_[_0x9b84('0xc')](config[_0x9b84('0xb')],{'host':_0x9b84('0xd'),'port':0x18eb});var socket=require(_0x9b84('0xe'))(new Redis(config[_0x9b84('0xb')]));require('./whatsappMessage.socket')[_0x9b84('0xf')](socket);function respondWithRpcPromise(_0x5e6a5c,_0x440f76,_0x46d5db){return new BPromise(function(_0x18ab01,_0x269acb){return client['request'](_0x5e6a5c,_0x46d5db)[_0x9b84('0x10')](function(_0x4197cc){logger[_0x9b84('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x440f76,_0x9b84('0x12'));logger[_0x9b84('0x13')](_0x9b84('0x14'),_0x440f76,_0x9b84('0x12'),JSON['stringify'](_0x4197cc));if(_0x4197cc[_0x9b84('0x15')]){if(_0x4197cc[_0x9b84('0x15')][_0x9b84('0x16')]===0x1f4){logger['error'](_0x9b84('0x17'),_0x440f76,_0x4197cc[_0x9b84('0x15')][_0x9b84('0x18')]);return _0x269acb(_0x4197cc[_0x9b84('0x15')][_0x9b84('0x18')]);}logger[_0x9b84('0x15')](_0x9b84('0x17'),_0x440f76,_0x4197cc[_0x9b84('0x15')]['message']);return _0x18ab01(_0x4197cc[_0x9b84('0x15')][_0x9b84('0x18')]);}else{logger[_0x9b84('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x440f76,_0x9b84('0x12'));_0x18ab01(_0x4197cc['result'][_0x9b84('0x18')]);}})[_0x9b84('0x19')](function(_0x105a33){logger[_0x9b84('0x15')](_0x9b84('0x17'),_0x440f76,_0x105a33);_0x269acb(_0x105a33);});});}exports[_0x9b84('0x1a')]=function(_0x37b02b){var _0x58044b=this;return new Promise(function(_0x9689c3,_0xef1aeb){return db[_0x9b84('0x1b')][_0x9b84('0x1c')](_0x37b02b[_0x9b84('0x1d')],{'raw':_0x37b02b[_0x9b84('0x1e')]?_0x37b02b[_0x9b84('0x1e')][_0x9b84('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x42980d){logger['info'](_0x9b84('0x1a'),_0x37b02b);logger[_0x9b84('0x13')](_0x9b84('0x1a'),_0x37b02b,JSON[_0x9b84('0x20')](_0x42980d));_0x9689c3(_0x42980d);})['catch'](function(_0x17349e){logger['error'](_0x9b84('0x1a'),_0x17349e[_0x9b84('0x18')],_0x37b02b);_0xef1aeb(_0x58044b[_0x9b84('0x15')](0x1f4,_0x17349e['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index d2e4206..69df917 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 _0x1a00=['whatsappMessage:','./whatsappMessage.events','save','remove','emit','register','length'];(function(_0x165f08,_0x384ec6){var _0x204b1b=function(_0x500d0b){while(--_0x500d0b){_0x165f08['push'](_0x165f08['shift']());}};_0x204b1b(++_0x384ec6);}(_0x1a00,0x127));var _0x01a0=function(_0x9c4a09,_0x1d0849){_0x9c4a09=_0x9c4a09-0x0;var _0x5d0b42=_0x1a00[_0x9c4a09];return _0x5d0b42;};'use strict';var WhatsappMessageEvents=require(_0x01a0('0x0'));var events=[_0x01a0('0x1'),_0x01a0('0x2'),'update'];function createListener(_0x588929,_0x58a3b7){return function(_0x494d82){_0x58a3b7[_0x01a0('0x3')](_0x588929,_0x494d82);};}function removeListener(_0x53bdd8,_0x115c63){return function(){WhatsappMessageEvents['removeListener'](_0x53bdd8,_0x115c63);};}exports[_0x01a0('0x4')]=function(_0x2019fb){for(var _0x473dbd=0x0,_0x46e1b1=events[_0x01a0('0x5')];_0x473dbd<_0x46e1b1;_0x473dbd++){var _0x26311e=events[_0x473dbd];var _0x4b02de=createListener(_0x01a0('0x6')+_0x26311e,_0x2019fb);WhatsappMessageEvents['on'](_0x26311e,_0x4b02de);}}; \ No newline at end of file +var _0x90d4=['emit','removeListener','register','whatsappMessage:','./whatsappMessage.events','save','remove','update'];(function(_0x266425,_0x10125f){var _0x137ae2=function(_0x155b2e){while(--_0x155b2e){_0x266425['push'](_0x266425['shift']());}};_0x137ae2(++_0x10125f);}(_0x90d4,0x15c));var _0x490d=function(_0xa37a05,_0x245c4c){_0xa37a05=_0xa37a05-0x0;var _0x736c72=_0x90d4[_0xa37a05];return _0x736c72;};'use strict';var WhatsappMessageEvents=require(_0x490d('0x0'));var events=[_0x490d('0x1'),_0x490d('0x2'),_0x490d('0x3')];function createListener(_0x4de7ca,_0x1caeb0){return function(_0x50ffd9){_0x1caeb0[_0x490d('0x4')](_0x4de7ca,_0x50ffd9);};}function removeListener(_0x47f5f5,_0x2cf52f){return function(){WhatsappMessageEvents[_0x490d('0x5')](_0x47f5f5,_0x2cf52f);};}exports[_0x490d('0x6')]=function(_0x5ab71d){for(var _0x45b129=0x0,_0xdea99f=events['length'];_0x45b129<_0xdea99f;_0x45b129++){var _0x361f27=events[_0x45b129];var _0x2d7b80=createListener(_0x490d('0x7')+_0x361f27,_0x5ab71d);WhatsappMessageEvents['on'](_0x361f27,_0x2d7b80);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 324ad16..a0935e5 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 _0xa88c=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','/describe','show','/:id/members','getMembers','/:id/teams','getTeams','create','addTeams','post','/:id/users','addAgents','put','/:id','delete','destroy','removeTeams','removeAgents','multer'];(function(_0x1a9fff,_0x113a8c){var _0x26d472=function(_0x41cfdb){while(--_0x41cfdb){_0x1a9fff['push'](_0x1a9fff['shift']());}};_0x26d472(++_0x113a8c);}(_0xa88c,0xc3));var _0xca88=function(_0x35ebd7,_0x369331){_0x35ebd7=_0x35ebd7-0x0;var _0x4b98d7=_0xa88c[_0x35ebd7];return _0x4b98d7;};'use strict';var multer=require(_0xca88('0x0'));var util=require(_0xca88('0x1'));var path=require(_0xca88('0x2'));var timeout=require(_0xca88('0x3'));var express=require('express');var router=express[_0xca88('0x4')]();var fs_extra=require(_0xca88('0x5'));var auth=require(_0xca88('0x6'));var interaction=require(_0xca88('0x7'));var config=require('../../config/environment');var controller=require(_0xca88('0x8'));router[_0xca88('0x9')]('/',auth[_0xca88('0xa')](),controller['index']);router[_0xca88('0x9')](_0xca88('0xb'),auth[_0xca88('0xa')](),controller['describe']);router[_0xca88('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xca88('0xc')]);router[_0xca88('0x9')](_0xca88('0xd'),auth[_0xca88('0xa')](),controller[_0xca88('0xe')]);router[_0xca88('0x9')](_0xca88('0xf'),auth[_0xca88('0xa')](),controller[_0xca88('0x10')]);router[_0xca88('0x9')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xca88('0x11')]);router['post'](_0xca88('0xf'),auth[_0xca88('0xa')](),controller[_0xca88('0x12')]);router[_0xca88('0x13')](_0xca88('0x14'),auth[_0xca88('0xa')](),controller[_0xca88('0x15')]);router[_0xca88('0x16')](_0xca88('0x17'),auth[_0xca88('0xa')](),controller['update']);router[_0xca88('0x18')](_0xca88('0x17'),auth[_0xca88('0xa')](),controller[_0xca88('0x19')]);router['delete'](_0xca88('0xf'),auth[_0xca88('0xa')](),controller[_0xca88('0x1a')]);router[_0xca88('0x18')](_0xca88('0x14'),auth['isAuthenticated'](),controller[_0xca88('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x1977=['delete','destroy','removeTeams','removeAgents','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','/:id','update'];(function(_0x47856a,_0x1ad7a0){var _0x1edd96=function(_0x4da7f3){while(--_0x4da7f3){_0x47856a['push'](_0x47856a['shift']());}};_0x1edd96(++_0x1ad7a0);}(_0x1977,0x163));var _0x7197=function(_0x52a039,_0x3b2f4e){_0x52a039=_0x52a039-0x0;var _0x15b447=_0x1977[_0x52a039];return _0x15b447;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7197('0x0'));var timeout=require(_0x7197('0x1'));var express=require(_0x7197('0x2'));var router=express[_0x7197('0x3')]();var fs_extra=require(_0x7197('0x4'));var auth=require(_0x7197('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7197('0x6'));var controller=require('./whatsappQueue.controller');router[_0x7197('0x7')]('/',auth['isAuthenticated'](),controller[_0x7197('0x8')]);router[_0x7197('0x7')](_0x7197('0x9'),auth[_0x7197('0xa')](),controller[_0x7197('0xb')]);router[_0x7197('0x7')]('/:id',auth[_0x7197('0xa')](),controller['show']);router[_0x7197('0x7')]('/:id/members',auth['isAuthenticated'](),controller[_0x7197('0xc')]);router[_0x7197('0x7')](_0x7197('0xd'),auth[_0x7197('0xa')](),controller[_0x7197('0xe')]);router[_0x7197('0x7')](_0x7197('0xf'),auth[_0x7197('0xa')](),controller[_0x7197('0x10')]);router[_0x7197('0x11')]('/',auth[_0x7197('0xa')](),controller[_0x7197('0x12')]);router[_0x7197('0x11')]('/:id/teams',auth[_0x7197('0xa')](),controller[_0x7197('0x13')]);router[_0x7197('0x11')]('/:id/users',auth[_0x7197('0xa')](),controller['addAgents']);router[_0x7197('0x14')](_0x7197('0x15'),auth[_0x7197('0xa')](),controller[_0x7197('0x16')]);router[_0x7197('0x17')](_0x7197('0x15'),auth[_0x7197('0xa')](),controller[_0x7197('0x18')]);router[_0x7197('0x17')](_0x7197('0xd'),auth[_0x7197('0xa')](),controller[_0x7197('0x19')]);router['delete'](_0x7197('0xf'),auth[_0x7197('0xa')](),controller[_0x7197('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 1f1405a..0209526 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 _0xf69b=['beepall','STRING','exports','name','ENUM','rrmemory'];(function(_0x35c514,_0x22bb8a){var _0x448f20=function(_0x54f93a){while(--_0x54f93a){_0x35c514['push'](_0x35c514['shift']());}};_0x448f20(++_0x22bb8a);}(_0xf69b,0xc8));var _0xbf69=function(_0x327624,_0x5ec10c){_0x327624=_0x327624-0x0;var _0x2cc875=_0xf69b[_0x327624];return _0x2cc875;};'use strict';var Sequelize=require('sequelize');module[_0xbf69('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xbf69('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbf69('0x2')](_0xbf69('0x3'),_0xbf69('0x4'),'roundrobin')},'description':{'type':Sequelize[_0xbf69('0x5')]}}; \ No newline at end of file +var _0x4899=['beepall','roundrobin','sequelize','STRING','INTEGER','rrmemory'];(function(_0x30f5bb,_0x4db4bd){var _0x1cfc00=function(_0x20f833){while(--_0x20f833){_0x30f5bb['push'](_0x30f5bb['shift']());}};_0x1cfc00(++_0x4db4bd);}(_0x4899,0x74));var _0x9489=function(_0x54e3df,_0x523ed0){_0x54e3df=_0x54e3df-0x0;var _0x40fc58=_0x4899[_0x54e3df];return _0x40fc58;};'use strict';var Sequelize=require(_0x9489('0x0'));module['exports']={'name':{'type':Sequelize[_0x9489('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x9489('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9489('0x3'),_0x9489('0x4'),_0x9489('0x5'))},'description':{'type':Sequelize[_0x9489('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 4c86c5c..51a04c4 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 _0x48f5=['socket.io-emitter','./whatsappQueue.socket','status','end','offset','limit','undefined','count','json','reject','save','then','get','WhatsappQueues','UserProfileResource','destroy','error','stack','name','send','WhatsappQueue','fieldName','type','key','model','map','query','keys','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','tq.TeamId','from','team_has_whatsapp_queues','join','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','value','ids','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x48f5,0x18c));var _0x548f=function(_0x28b2bf,_0x1ea2f4){_0x28b2bf=_0x28b2bf-0x0;var _0x4fb103=_0x48f5[_0x28b2bf];return _0x4fb103;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x548f('0x0'));var zipdir=require(_0x548f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x548f('0x2'));var moment=require(_0x548f('0x3'));var BPromise=require(_0x548f('0x4'));var Mustache=require(_0x548f('0x5'));var util=require(_0x548f('0x6'));var path=require(_0x548f('0x7'));var sox=require(_0x548f('0x8'));var csv=require('to-csv');var ejs=require(_0x548f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x548f('0xa'));var squel=require(_0x548f('0xb'));var crypto=require(_0x548f('0xc'));var jsforce=require(_0x548f('0xd'));var deskjs=require(_0x548f('0xe'));var toCsv=require(_0x548f('0xf'));var querystring=require(_0x548f('0x10'));var Papa=require(_0x548f('0x11'));var Redis=require(_0x548f('0x12'));var authService=require(_0x548f('0x13'));var qs=require(_0x548f('0x14'));var as=require(_0x548f('0x15'));var hardwareService=require(_0x548f('0x16'));var logger=require(_0x548f('0x17'))(_0x548f('0x18'));var utils=require(_0x548f('0x19'));var config=require(_0x548f('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x548f('0x1b')]=_[_0x548f('0x1c')](config[_0x548f('0x1b')],{'host':_0x548f('0x1d'),'port':0x18eb});var socket=require(_0x548f('0x1e'))(new Redis(config['redis']));require(_0x548f('0x1f'))['register'](socket);function respondWithStatusCode(_0x5bbc42,_0x3ed5eb){_0x3ed5eb=_0x3ed5eb||0xcc;return function(_0x4dbcd1){if(_0x4dbcd1){return _0x5bbc42['sendStatus'](_0x3ed5eb);}return _0x5bbc42[_0x548f('0x20')](_0x3ed5eb)[_0x548f('0x21')]();};}function respondWithResult(_0x49e203,_0x27b5a9){_0x27b5a9=_0x27b5a9||0xc8;return function(_0x28a50b){if(_0x28a50b){return _0x49e203[_0x548f('0x20')](_0x27b5a9)['json'](_0x28a50b);}};}function respondWithFilteredResult(_0x293d1b,_0x376add){return function(_0x3b04fa){if(_0x3b04fa){var _0x2cb5ad=typeof _0x376add[_0x548f('0x22')]==='undefined'&&typeof _0x376add[_0x548f('0x23')]===_0x548f('0x24');var _0x43c23d=_0x3b04fa['count'];var _0x10c2d0=_0x2cb5ad?0x0:_0x376add['offset'];var _0x4105df=_0x2cb5ad?_0x3b04fa[_0x548f('0x25')]:_0x376add[_0x548f('0x22')]+_0x376add[_0x548f('0x23')];var _0x20e703;if(_0x4105df>=_0x43c23d){_0x4105df=_0x43c23d;_0x20e703=0xc8;}else{_0x20e703=0xce;}_0x293d1b[_0x548f('0x20')](_0x20e703);return _0x293d1b['set']('Content-Range',_0x10c2d0+'-'+_0x4105df+'/'+_0x43c23d)[_0x548f('0x26')](_0x3b04fa);}return null;};}function patchUpdates(_0x1814a4){return function(_0x1af891){try{jsonpatch['apply'](_0x1af891,_0x1814a4,!![]);}catch(_0x51dd2f){return BPromise[_0x548f('0x27')](_0x51dd2f);}return _0x1af891[_0x548f('0x28')]();};}function saveUpdates(_0xa4a55c,_0x4f98a3){return function(_0xf5b29d){if(_0xf5b29d){return _0xf5b29d['update'](_0xa4a55c)[_0x548f('0x29')](function(_0x57e489){return _0x57e489;});}return null;};}function removeEntity(_0x1e8bc8,_0x354aae){return function(_0x253e3e){if(_0x253e3e){return _0x253e3e['destroy']()['then'](function(){var _0x50e4a4=_0x253e3e[_0x548f('0x2a')]({'plain':!![]});var _0xeb89ca=_0x548f('0x2b');return db[_0x548f('0x2c')][_0x548f('0x2d')]({'where':{'type':_0xeb89ca,'resourceId':_0x50e4a4['id']}})[_0x548f('0x29')](function(){return _0x253e3e;});})[_0x548f('0x29')](function(){_0x1e8bc8[_0x548f('0x20')](0xcc)[_0x548f('0x21')]();});}};}function handleEntityNotFound(_0x540a80,_0x2e2945){return function(_0x18ba1c){if(!_0x18ba1c){_0x540a80['sendStatus'](0x194);}return _0x18ba1c;};}function handleError(_0x30f446,_0x5f473e){_0x5f473e=_0x5f473e||0x1f4;return function(_0x3269af){logger[_0x548f('0x2e')](_0x3269af[_0x548f('0x2f')]);if(_0x3269af[_0x548f('0x30')]){delete _0x3269af['name'];}_0x30f446[_0x548f('0x20')](_0x5f473e)[_0x548f('0x31')](_0x3269af);};}exports['index']=function(_0xbbc579,_0x224a4c){var _0x5930eb={},_0x28121b={},_0x13e68a={'count':0x0,'rows':[]};var _0x5aa4e4=_['map'](db[_0x548f('0x32')]['rawAttributes'],function(_0x4ba9ba){return{'name':_0x4ba9ba[_0x548f('0x33')],'type':_0x4ba9ba[_0x548f('0x34')][_0x548f('0x35')]};});_0x28121b[_0x548f('0x36')]=_[_0x548f('0x37')](_0x5aa4e4,_0x548f('0x30'));_0x28121b[_0x548f('0x38')]=_[_0x548f('0x39')](_0xbbc579['query']);_0x28121b['filters']=_['intersection'](_0x28121b[_0x548f('0x36')],_0x28121b['query']);_0x5930eb['attributes']=_['intersection'](_0x28121b[_0x548f('0x36')],qs[_0x548f('0x3a')](_0xbbc579[_0x548f('0x38')][_0x548f('0x3a')]));_0x5930eb[_0x548f('0x3b')]=_0x5930eb['attributes']['length']?_0x5930eb[_0x548f('0x3b')]:_0x28121b[_0x548f('0x36')];if(!_0xbbc579[_0x548f('0x38')][_0x548f('0x3c')]('nolimit')){_0x5930eb[_0x548f('0x23')]=qs[_0x548f('0x23')](_0xbbc579[_0x548f('0x38')][_0x548f('0x23')]);_0x5930eb[_0x548f('0x22')]=qs[_0x548f('0x22')](_0xbbc579[_0x548f('0x38')][_0x548f('0x22')]);}_0x5930eb[_0x548f('0x3d')]=qs['sort'](_0xbbc579[_0x548f('0x38')][_0x548f('0x3e')]);_0x5930eb[_0x548f('0x3f')]=qs[_0x548f('0x40')](_[_0x548f('0x41')](_0xbbc579[_0x548f('0x38')],_0x28121b[_0x548f('0x40')]),_0x5aa4e4);if(_0xbbc579[_0x548f('0x38')][_0x548f('0x42')]){_0x5930eb[_0x548f('0x3f')]=_[_0x548f('0x43')](_0x5930eb[_0x548f('0x3f')],{'$or':_[_0x548f('0x37')](_0x5aa4e4,function(_0x1e46af){if(_0x1e46af[_0x548f('0x34')]!==_0x548f('0x44')){var _0x458818={};_0x458818[_0x1e46af['name']]={'$like':'%'+_0xbbc579['query'][_0x548f('0x42')]+'%'};return _0x458818;}})});}_0x5930eb=_[_0x548f('0x43')]({},_0x5930eb,_0xbbc579[_0x548f('0x45')]);var _0x1e452e={'where':_0x5930eb[_0x548f('0x3f')]};return db[_0x548f('0x32')][_0x548f('0x25')](_0x1e452e)[_0x548f('0x29')](function(_0x1724ba){_0x13e68a[_0x548f('0x25')]=_0x1724ba;if(_0xbbc579[_0x548f('0x38')][_0x548f('0x46')]){_0x5930eb[_0x548f('0x47')]=[{'all':!![]}];}return db[_0x548f('0x32')][_0x548f('0x48')](_0x5930eb);})[_0x548f('0x29')](function(_0x1dad42){_0x13e68a[_0x548f('0x49')]=_0x1dad42;return _0x13e68a;})[_0x548f('0x29')](respondWithFilteredResult(_0x224a4c,_0x5930eb))[_0x548f('0x4a')](handleError(_0x224a4c,null));};exports[_0x548f('0x4b')]=function(_0x13ad3b,_0x327805){var _0x2ef592={'raw':!![],'where':{'id':_0x13ad3b['params']['id']}},_0x5cf992={};_0x5cf992[_0x548f('0x36')]=_['keys'](db[_0x548f('0x32')][_0x548f('0x4c')]);_0x5cf992[_0x548f('0x38')]=_[_0x548f('0x39')](_0x13ad3b[_0x548f('0x38')]);_0x5cf992[_0x548f('0x40')]=_[_0x548f('0x4d')](_0x5cf992['model'],_0x5cf992[_0x548f('0x38')]);_0x2ef592[_0x548f('0x3b')]=_['intersection'](_0x5cf992[_0x548f('0x36')],qs[_0x548f('0x3a')](_0x13ad3b[_0x548f('0x38')][_0x548f('0x3a')]));_0x2ef592['attributes']=_0x2ef592[_0x548f('0x3b')][_0x548f('0x4e')]?_0x2ef592[_0x548f('0x3b')]:_0x5cf992[_0x548f('0x36')];if(_0x13ad3b[_0x548f('0x38')][_0x548f('0x46')]){_0x2ef592[_0x548f('0x47')]=[{'all':!![]}];}_0x2ef592=_[_0x548f('0x43')]({},_0x2ef592,_0x13ad3b['options']);return db['WhatsappQueue'][_0x548f('0x4f')](_0x2ef592)[_0x548f('0x29')](handleEntityNotFound(_0x327805,null))['then'](respondWithResult(_0x327805,null))[_0x548f('0x4a')](handleError(_0x327805,null));};exports[_0x548f('0x50')]=function(_0x27a283,_0x3bc41b){return db[_0x548f('0x32')][_0x548f('0x50')](_0x27a283[_0x548f('0x51')],{})[_0x548f('0x29')](function(_0x47a2e4){var _0x5ea091=_0x27a283[_0x548f('0x52')]['get']({'plain':!![]});if(!_0x5ea091)throw new Error(_0x548f('0x53'));if(_0x5ea091[_0x548f('0x54')]===_0x548f('0x52')){var _0x2a41a4=_0x47a2e4['get']({'plain':!![]});var _0x11b5e5=_0x548f('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x11b5e5,'userProfileId':_0x5ea091['userProfileId']},'raw':!![]})[_0x548f('0x29')](function(_0x1682db){if(_0x1682db&&_0x1682db['autoAssociation']===0x0){return db['UserProfileResource'][_0x548f('0x50')]({'name':_0x2a41a4['name'],'resourceId':_0x2a41a4['id'],'type':_0x1682db[_0x548f('0x30')],'sectionId':_0x1682db['id']},{})[_0x548f('0x29')](function(){return _0x47a2e4;});}else{return _0x47a2e4;}})['catch'](function(_0x4ab98d){logger[_0x548f('0x2e')](_0x548f('0x55'),_0x4ab98d);throw _0x4ab98d;});}return _0x47a2e4;})[_0x548f('0x29')](respondWithResult(_0x3bc41b,0xc9))[_0x548f('0x4a')](handleError(_0x3bc41b,null));};exports[_0x548f('0x56')]=function(_0x1c898a,_0x22e8cb){if(_0x1c898a[_0x548f('0x51')]['id']){delete _0x1c898a[_0x548f('0x51')]['id'];}return db[_0x548f('0x32')][_0x548f('0x4f')]({'where':{'id':_0x1c898a[_0x548f('0x57')]['id']}})['then'](handleEntityNotFound(_0x22e8cb,null))[_0x548f('0x29')](saveUpdates(_0x1c898a['body'],null))[_0x548f('0x29')](respondWithResult(_0x22e8cb,null))['catch'](handleError(_0x22e8cb,null));};exports[_0x548f('0x2d')]=function(_0x3c04a2,_0x494186){return db[_0x548f('0x32')][_0x548f('0x4f')]({'where':{'id':_0x3c04a2[_0x548f('0x57')]['id']}})[_0x548f('0x29')](handleEntityNotFound(_0x494186,null))[_0x548f('0x29')](removeEntity(_0x494186,null))[_0x548f('0x4a')](handleError(_0x494186,null));};exports[_0x548f('0x58')]=function(_0x373f56,_0x3e8b47){return db[_0x548f('0x32')][_0x548f('0x58')]()['then'](respondWithResult(_0x3e8b47,null))[_0x548f('0x4a')](handleError(_0x3e8b47,null));};exports['getMembers']=function(_0x515b49,_0x45c1fe,_0x4bf21f){var _0x12add9={'raw':!![],'where':{}},_0x545547={},_0x7d19b7;return db[_0x548f('0x32')][_0x548f('0x59')]({'where':{'id':_0x515b49[_0x548f('0x57')]['id']}})[_0x548f('0x29')](handleEntityNotFound(_0x45c1fe,null))[_0x548f('0x29')](function(_0x14dea9){if(_0x14dea9){_0x7d19b7=_0x14dea9['get']({'plain':!![]});_0x545547[_0x548f('0x36')]=_[_0x548f('0x39')](db[_0x548f('0x5a')][_0x548f('0x4c')]);_0x545547[_0x548f('0x38')]=_[_0x548f('0x39')](_0x515b49['query']);_0x545547[_0x548f('0x40')]=_[_0x548f('0x4d')](_0x545547[_0x548f('0x36')],_0x545547[_0x548f('0x38')]);_0x12add9[_0x548f('0x3b')]=_[_0x548f('0x4d')](_0x545547['model'],qs['fields'](_0x515b49['query']['fields']));_0x12add9[_0x548f('0x3b')]=_0x12add9['attributes'][_0x548f('0x4e')]?_0x12add9['attributes']:_0x545547[_0x548f('0x36')];if(!_0x515b49[_0x548f('0x38')][_0x548f('0x3c')](_0x548f('0x5b'))){_0x12add9[_0x548f('0x23')]=qs[_0x548f('0x23')](_0x515b49[_0x548f('0x38')]['limit']);_0x12add9[_0x548f('0x22')]=qs['offset'](_0x515b49[_0x548f('0x38')][_0x548f('0x22')]);}_0x12add9[_0x548f('0x3d')]=qs[_0x548f('0x3e')](_0x515b49['query'][_0x548f('0x3e')]);_0x12add9['where']=qs[_0x548f('0x40')](_['pick'](_0x515b49[_0x548f('0x38')],_0x545547[_0x548f('0x40')]));_0x12add9[_0x548f('0x3f')][_0x548f('0x5c')]=_0x14dea9['id'];if(_0x515b49[_0x548f('0x38')][_0x548f('0x42')]){_0x12add9[_0x548f('0x3f')]=_[_0x548f('0x43')](_0x12add9['where'],{'$or':_[_0x548f('0x37')](_0x12add9[_0x548f('0x3b')],function(_0x2f2c5){var _0x29ed72={};_0x29ed72[_0x2f2c5]={'$like':'%'+_0x515b49[_0x548f('0x38')][_0x548f('0x42')]+'%'};return _0x29ed72;})});}_0x12add9=_[_0x548f('0x43')]({},_0x12add9,_0x515b49[_0x548f('0x45')]);return db[_0x548f('0x5a')][_0x548f('0x48')](_0x12add9);}})['then'](function(_0x3d998c){if(_0x3d998c){return db[_0x548f('0x5d')][_0x548f('0x5e')]({'where':{'id':_['map'](_0x3d998c,_0x548f('0x5f')),'role':_0x548f('0x60')},'attributes':['id',_0x548f('0x30'),_0x548f('0x61'),_0x548f('0x62'),_0x548f('0x63')]});}})['then'](function(_0x64167b){if(_0x64167b){return{'count':_0x64167b[_0x548f('0x25')],'rows':_[_0x548f('0x37')](_0x64167b[_0x548f('0x49')],function(_0x2e1e11){return{'membername':_0x2e1e11['name'],'UserId':_0x2e1e11['id'],'queue_name':_0x7d19b7[_0x548f('0x30')],'WhatsappQueueId':_0x7d19b7['id'],'interface':util[_0x548f('0x64')](_0x548f('0x65'),_0x548f('0x66'),_0x2e1e11['name']),'penalty':0x0,'paused':_0x2e1e11[_0x548f('0x61')],'createdAt':_0x2e1e11[_0x548f('0x63')],'updatedAt':_0x2e1e11[_0x548f('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x45c1fe,_0x12add9))[_0x548f('0x4a')](handleError(_0x45c1fe,null));};exports['getTeams']=function(_0x1c7047,_0x495506,_0x278ada){var _0x38a05b={};var _0x51bbe0={};var _0x28d899;var _0x1bf8a1;return db['WhatsappQueue'][_0x548f('0x59')]({'where':{'id':_0x1c7047['params']['id']}})[_0x548f('0x29')](handleEntityNotFound(_0x495506,null))[_0x548f('0x29')](function(_0x5d7f2b){if(_0x5d7f2b){_0x28d899=_0x5d7f2b;_0x51bbe0[_0x548f('0x36')]=_['keys'](db[_0x548f('0x67')]['rawAttributes']);_0x51bbe0[_0x548f('0x38')]=_[_0x548f('0x39')](_0x1c7047[_0x548f('0x38')]);_0x51bbe0[_0x548f('0x40')]=_[_0x548f('0x4d')](_0x51bbe0[_0x548f('0x36')],_0x51bbe0[_0x548f('0x38')]);_0x38a05b['attributes']=_['intersection'](_0x51bbe0[_0x548f('0x36')],qs[_0x548f('0x3a')](_0x1c7047[_0x548f('0x38')]['fields']));_0x38a05b['attributes']=_0x38a05b['attributes'][_0x548f('0x4e')]?_0x38a05b[_0x548f('0x3b')]:_0x51bbe0[_0x548f('0x36')];_0x38a05b['order']=qs['sort'](_0x1c7047[_0x548f('0x38')][_0x548f('0x3e')]);_0x38a05b[_0x548f('0x3f')]=qs[_0x548f('0x40')](_[_0x548f('0x41')](_0x1c7047['query'],_0x51bbe0[_0x548f('0x40')]));if(_0x1c7047[_0x548f('0x38')][_0x548f('0x42')]){_0x38a05b['where']=_[_0x548f('0x43')](_0x38a05b['where'],{'$or':_[_0x548f('0x37')](_0x38a05b[_0x548f('0x3b')],function(_0x45c6ae){var _0x4e10c9={};_0x4e10c9[_0x45c6ae]={'$like':'%'+_0x1c7047[_0x548f('0x38')]['filter']+'%'};return _0x4e10c9;})});}_0x38a05b=_['merge']({},_0x38a05b,_0x1c7047[_0x548f('0x45')]);return _0x28d899[_0x548f('0x68')](_0x38a05b);}})[_0x548f('0x29')](function(_0x2b4445){if(_0x2b4445){_0x1bf8a1=_0x2b4445['length'];if(!_0x1c7047[_0x548f('0x38')][_0x548f('0x3c')](_0x548f('0x5b'))){_0x38a05b['limit']=qs['limit'](_0x1c7047['query'][_0x548f('0x23')]);_0x38a05b[_0x548f('0x22')]=qs[_0x548f('0x22')](_0x1c7047[_0x548f('0x38')][_0x548f('0x22')]);}return _0x28d899[_0x548f('0x68')](_0x38a05b);}})['then'](function(_0x27a25f){if(_0x27a25f){return _0x27a25f?{'count':_0x1bf8a1,'rows':_0x27a25f}:null;}})['then'](respondWithResult(_0x495506,null))[_0x548f('0x4a')](handleError(_0x495506,null));};exports['addTeams']=function(_0x1737f4,_0x4187a3,_0x3e18f3){var _0x44bc6c=_0x1737f4[_0x548f('0x51')]['ids'];return db[_0x548f('0x67')][_0x548f('0x48')]({'where':{'id':_0x44bc6c},'attributes':['id'],'include':[{'model':db[_0x548f('0x5d')],'as':_0x548f('0x69'),'attributes':['id',_0x548f('0x30'),_0x548f('0x6a'),_0x548f('0x6b'),_0x548f('0x6c')],'raw':!![]}]})[_0x548f('0x29')](function(_0x4f119e){if(_0x4f119e){var _0x507751=_[_0x548f('0x6d')](_0x4f119e,function(_0x296a45){var _0xed0fdb=_0x296a45['get']({'plain':!![]});return _0xed0fdb['Agents'];});return db[_0x548f('0x32')][_0x548f('0x4f')]({'where':{'id':_0x1737f4[_0x548f('0x57')]['id']}})['then'](function(_0x3d94ba){return db[_0x548f('0x6e')][_0x548f('0x6f')](function(_0x3cee92){return _0x3d94ba[_0x548f('0x70')](_0x44bc6c,{'transaction':_0x3cee92})['then'](function(){return BPromise[_0x548f('0x71')](_0x507751,function(_0xe77b20){return db['UserWhatsappQueue'][_0x548f('0x72')]({'where':{'UserId':_0xe77b20['id'],'WhatsappQueueId':_0x1737f4[_0x548f('0x57')]['id']},'transaction':_0x3cee92});});})[_0x548f('0x29')](function(){_0x507751[_0x548f('0x73')](function(_0x32fd27){socket[_0x548f('0x74')](_0x548f('0x75'),{'UserId':_0x32fd27['id'],'WhatsappQueueId':_0x3d94ba['id']});});});});});}})[_0x548f('0x29')](respondWithStatusCode(_0x4187a3,null))[_0x548f('0x4a')](handleError(_0x4187a3,null));};exports[_0x548f('0x76')]=function(_0x5a8b3c,_0x2cc3b0,_0x5dbe7d){return db[_0x548f('0x67')][_0x548f('0x48')]({'where':{'id':_0x5a8b3c['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x548f('0x5d')],'as':_0x548f('0x69'),'attributes':['id'],'raw':!![]}]})[_0x548f('0x29')](handleEntityNotFound(_0x2cc3b0,null))['then'](function(_0x146fb6){var _0x573462=_[_0x548f('0x37')](_0x146fb6,'id');var _0x2d3271=[];var _0xf5f340=[];var _0x1e60b9=squel['select']();_0x1e60b9['field'](_0x548f('0x77'))[_0x548f('0x78')](_0x548f('0x79'),'tq')[_0x548f('0x7a')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x548f('0x3f')](_0x548f('0x7b'),_0x5a8b3c[_0x548f('0x57')]['id']);for(var _0x426706=0x0;_0x426706<_0x146fb6['length'];_0x426706+=0x1){let _0x340b9d=_0x146fb6[_0x426706];for(var _0xc1c30e=0x0;_0xc1c30e<_0x340b9d[_0x548f('0x69')]['length'];_0xc1c30e+=0x1){let _0x800161=_0x340b9d[_0x548f('0x69')][_0xc1c30e];var _0x4dc707=_0x1e60b9[_0x548f('0x7c')]();_0x4dc707[_0x548f('0x3f')](_0x548f('0x7d'),_0x800161['id']);_0xf5f340['push'](db[_0x548f('0x6e')][_0x548f('0x38')](_0x4dc707[_0x548f('0x7e')](),{'type':db[_0x548f('0x6e')][_0x548f('0x7f')][_0x548f('0x80')]})[_0x548f('0x29')](function(_0x480c9c){if(_0x480c9c['length']===0x1){return _0x800161['id'];}else{var _0x3c1e82=_[_0x548f('0x81')](_[_0x548f('0x37')](_0x480c9c,'TeamId'),function(_0x4bdac2){return _[_0x548f('0x82')](_0x573462,_0x4bdac2);});if(_0x3c1e82){return _0x800161['id'];}}}));}}return BPromise[_0x548f('0x83')](_0xf5f340)[_0x548f('0x29')](function(_0x2f09df){_0x2d3271=_(_0x2d3271)[_0x548f('0x84')](_0x2f09df)['compact']()[_0x548f('0x85')]();return db['WhatsappQueue'][_0x548f('0x4f')]({'where':{'id':_0x5a8b3c[_0x548f('0x57')]['id']}})[_0x548f('0x29')](function(_0x44935e){return db[_0x548f('0x6e')][_0x548f('0x6f')](function(_0x532a36){return _0x44935e[_0x548f('0x76')](_0x5a8b3c[_0x548f('0x38')][_0x548f('0x86')],{'transaction':_0x532a36})[_0x548f('0x29')](function(){if(!_['isEmpty'](_0x2d3271)){return _0x44935e[_0x548f('0x87')](_0x2d3271,{'transaction':_0x532a36});}})[_0x548f('0x29')](function(){_0x2d3271[_0x548f('0x73')](function(_0x519497){socket[_0x548f('0x74')]('userWhatsappQueue:remove',{'UserId':_0x519497,'WhatsappQueueId':_0x44935e['id']});});});});});});})[_0x548f('0x29')](respondWithStatusCode(_0x2cc3b0,null))[_0x548f('0x4a')](handleError(_0x2cc3b0,null));};exports['addAgents']=function(_0x17c9ce,_0x45debb,_0x1269fc){return db[_0x548f('0x32')][_0x548f('0x4f')]({'where':{'id':_0x17c9ce[_0x548f('0x57')]['id']}})[_0x548f('0x29')](handleEntityNotFound(_0x45debb,null))['then'](function(_0x4bbc2a){if(_0x4bbc2a){return _0x4bbc2a[_0x548f('0x88')](_0x17c9ce[_0x548f('0x51')][_0x548f('0x86')],_[_0x548f('0x89')](_0x17c9ce['body'],['ids','id'])||{})[_0x548f('0x8a')](function(_0x1c1d32){for(var _0x1ca447=0x0;_0x1ca447<_0x17c9ce[_0x548f('0x51')][_0x548f('0x86')][_0x548f('0x4e')];_0x1ca447+=0x1){socket[_0x548f('0x74')]('userWhatsappQueue:save',{'UserId':Number(_0x17c9ce['body'][_0x548f('0x86')][_0x1ca447]),'WhatsappQueueId':Number(_0x17c9ce['params']['id'])});}return _0x1c1d32;});}})[_0x548f('0x29')](respondWithResult(_0x45debb,null))[_0x548f('0x4a')](handleError(_0x45debb,null));};exports[_0x548f('0x87')]=function(_0x2bdefb,_0x3453b0,_0x576035){return db['WhatsappQueue'][_0x548f('0x4f')]({'where':{'id':_0x2bdefb[_0x548f('0x57')]['id']}})[_0x548f('0x29')](handleEntityNotFound(_0x3453b0,null))[_0x548f('0x29')](function(_0xe70472){if(_0xe70472){return _0xe70472[_0x548f('0x87')](_0x2bdefb['query']['ids'])[_0x548f('0x29')](function(){if(_[_0x548f('0x8b')](_0x2bdefb['query'][_0x548f('0x86')])){for(var _0x1e907a=0x0;_0x1e907a<_0x2bdefb['query']['ids'][_0x548f('0x4e')];_0x1e907a+=0x1){socket[_0x548f('0x74')]('userWhatsappQueue:remove',{'UserId':Number(_0x2bdefb[_0x548f('0x38')][_0x548f('0x86')][_0x1e907a]),'WhatsappQueueId':Number(_0x2bdefb[_0x548f('0x57')]['id'])});}}else{socket[_0x548f('0x74')](_0x548f('0x8c'),{'UserId':Number(_0x2bdefb[_0x548f('0x38')][_0x548f('0x86')]),'WhatsappQueueId':Number(_0x2bdefb[_0x548f('0x57')]['id'])});}});}})[_0x548f('0x29')](respondWithStatusCode(_0x3453b0,null))[_0x548f('0x4a')](handleError(_0x3453b0,null));};exports[_0x548f('0x8d')]=function(_0x2aeaab,_0x527d34,_0x3e0044){var _0x3170d9={};var _0x3202c8={};var _0x2c6b8a;var _0x37ecad;return db[_0x548f('0x32')][_0x548f('0x59')]({'where':{'id':_0x2aeaab[_0x548f('0x57')]['id']}})[_0x548f('0x29')](handleEntityNotFound(_0x527d34,null))['then'](function(_0x45b194){if(_0x45b194){_0x2c6b8a=_0x45b194;_0x3202c8['model']=_[_0x548f('0x39')](db[_0x548f('0x5d')][_0x548f('0x4c')]);_0x3202c8[_0x548f('0x38')]=_[_0x548f('0x39')](_0x2aeaab[_0x548f('0x38')]);_0x3202c8[_0x548f('0x40')]=_[_0x548f('0x4d')](_0x3202c8[_0x548f('0x36')],_0x3202c8['query']);_0x3170d9[_0x548f('0x3b')]=_[_0x548f('0x4d')](_0x3202c8['model'],qs[_0x548f('0x3a')](_0x2aeaab[_0x548f('0x38')][_0x548f('0x3a')]));_0x3170d9[_0x548f('0x3b')]=_0x3170d9[_0x548f('0x3b')][_0x548f('0x4e')]?_0x3170d9[_0x548f('0x3b')]:_0x3202c8['model'];_0x3170d9[_0x548f('0x3d')]=qs[_0x548f('0x3e')](_0x2aeaab[_0x548f('0x38')][_0x548f('0x3e')]);_0x3170d9[_0x548f('0x3f')]=qs[_0x548f('0x40')](_[_0x548f('0x41')](_0x2aeaab[_0x548f('0x38')],_0x3202c8[_0x548f('0x40')]));if(_0x2aeaab[_0x548f('0x38')][_0x548f('0x42')]){_0x3170d9[_0x548f('0x3f')]=_[_0x548f('0x43')](_0x3170d9[_0x548f('0x3f')],{'$or':_['map'](_0x3170d9[_0x548f('0x3b')],function(_0x27f8d3){var _0x1b212e={};_0x1b212e[_0x27f8d3]={'$like':'%'+_0x2aeaab['query'][_0x548f('0x42')]+'%'};return _0x1b212e;})});}_0x3170d9=_[_0x548f('0x43')]({},_0x3170d9,_0x2aeaab[_0x548f('0x45')]);return _0x2c6b8a[_0x548f('0x8d')](_0x3170d9);}})['then'](function(_0x1073f7){if(_0x1073f7){_0x37ecad=_0x1073f7[_0x548f('0x4e')];if(!_0x2aeaab[_0x548f('0x38')][_0x548f('0x3c')](_0x548f('0x5b'))){_0x3170d9[_0x548f('0x23')]=qs[_0x548f('0x23')](_0x2aeaab[_0x548f('0x38')][_0x548f('0x23')]);_0x3170d9[_0x548f('0x22')]=qs[_0x548f('0x22')](_0x2aeaab['query'][_0x548f('0x22')]);}return _0x2c6b8a[_0x548f('0x8d')](_0x3170d9);}})[_0x548f('0x29')](function(_0xc9835e){if(_0xc9835e){return _0xc9835e?{'count':_0x37ecad,'rows':_0xc9835e}:null;}})[_0x548f('0x29')](respondWithResult(_0x527d34,null))['catch'](handleError(_0x527d34,null));}; \ No newline at end of file +var _0x1d49=['sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','status','count','limit','Content-Range','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','error','name','send','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','map','VIRTUAL','options','WhatsappQueue','includeAll','include','findAll','catch','show','params','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','UserWhatsappQueue','pick','WhatsappQueueId','User','findAndCountAll','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','whatsappPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap'];(function(_0x5b489b,_0x59bcee){var _0x3022d0=function(_0x1c771b){while(--_0x1c771b){_0x5b489b['push'](_0x5b489b['shift']());}};_0x3022d0(++_0x59bcee);}(_0x1d49,0xae));var _0x91d4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d49[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x91d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91d4('0x1'));var jsonpatch=require(_0x91d4('0x2'));var rp=require(_0x91d4('0x3'));var moment=require('moment');var BPromise=require(_0x91d4('0x4'));var Mustache=require(_0x91d4('0x5'));var util=require('util');var path=require(_0x91d4('0x6'));var sox=require(_0x91d4('0x7'));var csv=require(_0x91d4('0x8'));var ejs=require(_0x91d4('0x9'));var fs=require('fs');var fs_extra=require(_0x91d4('0xa'));var _=require(_0x91d4('0xb'));var squel=require(_0x91d4('0xc'));var crypto=require('crypto');var jsforce=require(_0x91d4('0xd'));var deskjs=require(_0x91d4('0xe'));var toCsv=require(_0x91d4('0x8'));var querystring=require(_0x91d4('0xf'));var Papa=require(_0x91d4('0x10'));var Redis=require(_0x91d4('0x11'));var authService=require(_0x91d4('0x12'));var qs=require(_0x91d4('0x13'));var as=require(_0x91d4('0x14'));var hardwareService=require(_0x91d4('0x15'));var logger=require(_0x91d4('0x16'))(_0x91d4('0x17'));var utils=require(_0x91d4('0x18'));var config=require(_0x91d4('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x91d4('0x1a'))['db'];config[_0x91d4('0x1b')]=_[_0x91d4('0x1c')](config[_0x91d4('0x1b')],{'host':_0x91d4('0x1d'),'port':0x18eb});var socket=require(_0x91d4('0x1e'))(new Redis(config[_0x91d4('0x1b')]));require(_0x91d4('0x1f'))[_0x91d4('0x20')](socket);function respondWithStatusCode(_0x569393,_0x487fff){_0x487fff=_0x487fff||0xcc;return function(_0x1f2f7f){if(_0x1f2f7f){return _0x569393['sendStatus'](_0x487fff);}return _0x569393[_0x91d4('0x21')](_0x487fff)['end']();};}function respondWithResult(_0x230924,_0x42f947){_0x42f947=_0x42f947||0xc8;return function(_0x39c824){if(_0x39c824){return _0x230924['status'](_0x42f947)['json'](_0x39c824);}};}function respondWithFilteredResult(_0x3dacfe,_0x73da8b){return function(_0x487cf1){if(_0x487cf1){var _0xca4150=typeof _0x73da8b['offset']==='undefined'&&typeof _0x73da8b['limit']==='undefined';var _0x32eb5f=_0x487cf1[_0x91d4('0x22')];var _0x294b81=_0xca4150?0x0:_0x73da8b['offset'];var _0x22c4a8=_0xca4150?_0x487cf1[_0x91d4('0x22')]:_0x73da8b['offset']+_0x73da8b[_0x91d4('0x23')];var _0x1fd8c2;if(_0x22c4a8>=_0x32eb5f){_0x22c4a8=_0x32eb5f;_0x1fd8c2=0xc8;}else{_0x1fd8c2=0xce;}_0x3dacfe[_0x91d4('0x21')](_0x1fd8c2);return _0x3dacfe['set'](_0x91d4('0x24'),_0x294b81+'-'+_0x22c4a8+'/'+_0x32eb5f)['json'](_0x487cf1);}return null;};}function patchUpdates(_0x61d20c){return function(_0xf6fd09){try{jsonpatch['apply'](_0xf6fd09,_0x61d20c,!![]);}catch(_0x58028f){return BPromise[_0x91d4('0x25')](_0x58028f);}return _0xf6fd09[_0x91d4('0x26')]();};}function saveUpdates(_0x391fd4,_0x5a860e){return function(_0x1a1991){if(_0x1a1991){return _0x1a1991[_0x91d4('0x27')](_0x391fd4)[_0x91d4('0x28')](function(_0x21f874){return _0x21f874;});}return null;};}function removeEntity(_0x583ae2,_0x5755fc){return function(_0x5a7fc6){if(_0x5a7fc6){return _0x5a7fc6[_0x91d4('0x29')]()[_0x91d4('0x28')](function(){var _0x4d0083=_0x5a7fc6[_0x91d4('0x2a')]({'plain':!![]});var _0x26a3d9=_0x91d4('0x2b');return db[_0x91d4('0x2c')][_0x91d4('0x29')]({'where':{'type':_0x26a3d9,'resourceId':_0x4d0083['id']}})[_0x91d4('0x28')](function(){return _0x5a7fc6;});})[_0x91d4('0x28')](function(){_0x583ae2[_0x91d4('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42e809,_0x15ebcf){return function(_0x38db60){if(!_0x38db60){_0x42e809[_0x91d4('0x2d')](0x194);}return _0x38db60;};}function handleError(_0x59872d,_0x106461){_0x106461=_0x106461||0x1f4;return function(_0x5a7c41){logger[_0x91d4('0x2e')](_0x5a7c41['stack']);if(_0x5a7c41[_0x91d4('0x2f')]){delete _0x5a7c41[_0x91d4('0x2f')];}_0x59872d['status'](_0x106461)[_0x91d4('0x30')](_0x5a7c41);};}exports[_0x91d4('0x31')]=function(_0x44d1dc,_0x106186){var _0x54a213={},_0x4aca0c={},_0x3fc94e={'count':0x0,'rows':[]};var _0x295cc6=_['map'](db['WhatsappQueue'][_0x91d4('0x32')],function(_0x533fc8){return{'name':_0x533fc8[_0x91d4('0x33')],'type':_0x533fc8[_0x91d4('0x34')]['key']};});_0x4aca0c[_0x91d4('0x35')]=_['map'](_0x295cc6,_0x91d4('0x2f'));_0x4aca0c[_0x91d4('0x36')]=_[_0x91d4('0x37')](_0x44d1dc[_0x91d4('0x36')]);_0x4aca0c[_0x91d4('0x38')]=_[_0x91d4('0x39')](_0x4aca0c[_0x91d4('0x35')],_0x4aca0c['query']);_0x54a213[_0x91d4('0x3a')]=_[_0x91d4('0x39')](_0x4aca0c[_0x91d4('0x35')],qs['fields'](_0x44d1dc['query'][_0x91d4('0x3b')]));_0x54a213[_0x91d4('0x3a')]=_0x54a213['attributes'][_0x91d4('0x3c')]?_0x54a213[_0x91d4('0x3a')]:_0x4aca0c[_0x91d4('0x35')];if(!_0x44d1dc[_0x91d4('0x36')][_0x91d4('0x3d')](_0x91d4('0x3e'))){_0x54a213[_0x91d4('0x23')]=qs[_0x91d4('0x23')](_0x44d1dc[_0x91d4('0x36')][_0x91d4('0x23')]);_0x54a213[_0x91d4('0x3f')]=qs[_0x91d4('0x3f')](_0x44d1dc[_0x91d4('0x36')][_0x91d4('0x3f')]);}_0x54a213[_0x91d4('0x40')]=qs['sort'](_0x44d1dc['query'][_0x91d4('0x41')]);_0x54a213[_0x91d4('0x42')]=qs['filters'](_['pick'](_0x44d1dc[_0x91d4('0x36')],_0x4aca0c['filters']),_0x295cc6);if(_0x44d1dc[_0x91d4('0x36')][_0x91d4('0x43')]){_0x54a213[_0x91d4('0x42')]=_[_0x91d4('0x44')](_0x54a213[_0x91d4('0x42')],{'$or':_[_0x91d4('0x45')](_0x295cc6,function(_0x705bd6){if(_0x705bd6[_0x91d4('0x34')]!==_0x91d4('0x46')){var _0x140dc1={};_0x140dc1[_0x705bd6[_0x91d4('0x2f')]]={'$like':'%'+_0x44d1dc[_0x91d4('0x36')][_0x91d4('0x43')]+'%'};return _0x140dc1;}})});}_0x54a213=_['merge']({},_0x54a213,_0x44d1dc[_0x91d4('0x47')]);var _0x23e72e={'where':_0x54a213[_0x91d4('0x42')]};return db[_0x91d4('0x48')][_0x91d4('0x22')](_0x23e72e)[_0x91d4('0x28')](function(_0x5c5b7f){_0x3fc94e[_0x91d4('0x22')]=_0x5c5b7f;if(_0x44d1dc['query'][_0x91d4('0x49')]){_0x54a213[_0x91d4('0x4a')]=[{'all':!![]}];}return db[_0x91d4('0x48')][_0x91d4('0x4b')](_0x54a213);})[_0x91d4('0x28')](function(_0x55e5f5){_0x3fc94e['rows']=_0x55e5f5;return _0x3fc94e;})[_0x91d4('0x28')](respondWithFilteredResult(_0x106186,_0x54a213))[_0x91d4('0x4c')](handleError(_0x106186,null));};exports[_0x91d4('0x4d')]=function(_0x175c1a,_0x2691e4){var _0x139727={'raw':!![],'where':{'id':_0x175c1a[_0x91d4('0x4e')]['id']}},_0x263be4={};_0x263be4[_0x91d4('0x35')]=_[_0x91d4('0x37')](db[_0x91d4('0x48')][_0x91d4('0x32')]);_0x263be4[_0x91d4('0x36')]=_[_0x91d4('0x37')](_0x175c1a[_0x91d4('0x36')]);_0x263be4['filters']=_[_0x91d4('0x39')](_0x263be4[_0x91d4('0x35')],_0x263be4[_0x91d4('0x36')]);_0x139727['attributes']=_[_0x91d4('0x39')](_0x263be4[_0x91d4('0x35')],qs[_0x91d4('0x3b')](_0x175c1a[_0x91d4('0x36')][_0x91d4('0x3b')]));_0x139727[_0x91d4('0x3a')]=_0x139727[_0x91d4('0x3a')][_0x91d4('0x3c')]?_0x139727['attributes']:_0x263be4[_0x91d4('0x35')];if(_0x175c1a[_0x91d4('0x36')][_0x91d4('0x49')]){_0x139727[_0x91d4('0x4a')]=[{'all':!![]}];}_0x139727=_[_0x91d4('0x44')]({},_0x139727,_0x175c1a[_0x91d4('0x47')]);return db[_0x91d4('0x48')]['find'](_0x139727)['then'](handleEntityNotFound(_0x2691e4,null))[_0x91d4('0x28')](respondWithResult(_0x2691e4,null))[_0x91d4('0x4c')](handleError(_0x2691e4,null));};exports['create']=function(_0x3c259f,_0x551697){return db[_0x91d4('0x48')][_0x91d4('0x4f')](_0x3c259f[_0x91d4('0x50')],{})[_0x91d4('0x28')](function(_0x505fdf){var _0x4c2529=_0x3c259f[_0x91d4('0x51')]['get']({'plain':!![]});if(!_0x4c2529)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c2529[_0x91d4('0x52')]===_0x91d4('0x51')){var _0x3ebbe3=_0x505fdf[_0x91d4('0x2a')]({'plain':!![]});var _0x32e9bd=_0x91d4('0x2b');return db[_0x91d4('0x53')]['find']({'where':{'name':_0x32e9bd,'userProfileId':_0x4c2529[_0x91d4('0x54')]},'raw':!![]})[_0x91d4('0x28')](function(_0x29b09e){if(_0x29b09e&&_0x29b09e['autoAssociation']===0x0){return db[_0x91d4('0x2c')][_0x91d4('0x4f')]({'name':_0x3ebbe3[_0x91d4('0x2f')],'resourceId':_0x3ebbe3['id'],'type':_0x29b09e[_0x91d4('0x2f')],'sectionId':_0x29b09e['id']},{})[_0x91d4('0x28')](function(){return _0x505fdf;});}else{return _0x505fdf;}})['catch'](function(_0x5de43a){logger['error'](_0x91d4('0x55'),_0x5de43a);throw _0x5de43a;});}return _0x505fdf;})[_0x91d4('0x28')](respondWithResult(_0x551697,0xc9))[_0x91d4('0x4c')](handleError(_0x551697,null));};exports['update']=function(_0x628aec,_0x1af586){if(_0x628aec[_0x91d4('0x50')]['id']){delete _0x628aec[_0x91d4('0x50')]['id'];}return db[_0x91d4('0x48')][_0x91d4('0x56')]({'where':{'id':_0x628aec[_0x91d4('0x4e')]['id']}})[_0x91d4('0x28')](handleEntityNotFound(_0x1af586,null))[_0x91d4('0x28')](saveUpdates(_0x628aec[_0x91d4('0x50')],null))[_0x91d4('0x28')](respondWithResult(_0x1af586,null))['catch'](handleError(_0x1af586,null));};exports[_0x91d4('0x29')]=function(_0x3a2413,_0x575aa7){return db[_0x91d4('0x48')][_0x91d4('0x56')]({'where':{'id':_0x3a2413[_0x91d4('0x4e')]['id']}})[_0x91d4('0x28')](handleEntityNotFound(_0x575aa7,null))['then'](removeEntity(_0x575aa7,null))[_0x91d4('0x4c')](handleError(_0x575aa7,null));};exports[_0x91d4('0x57')]=function(_0x4748dc,_0x2f1676){return db[_0x91d4('0x48')][_0x91d4('0x57')]()['then'](respondWithResult(_0x2f1676,null))['catch'](handleError(_0x2f1676,null));};exports[_0x91d4('0x58')]=function(_0x138d8c,_0x53b97a,_0x41390e){var _0x5a5b95={'raw':!![],'where':{}},_0xb56d9c={},_0x3f7457;return db[_0x91d4('0x48')][_0x91d4('0x59')]({'where':{'id':_0x138d8c[_0x91d4('0x4e')]['id']}})[_0x91d4('0x28')](handleEntityNotFound(_0x53b97a,null))[_0x91d4('0x28')](function(_0x473fde){if(_0x473fde){_0x3f7457=_0x473fde[_0x91d4('0x2a')]({'plain':!![]});_0xb56d9c['model']=_[_0x91d4('0x37')](db[_0x91d4('0x5a')][_0x91d4('0x32')]);_0xb56d9c['query']=_[_0x91d4('0x37')](_0x138d8c[_0x91d4('0x36')]);_0xb56d9c[_0x91d4('0x38')]=_[_0x91d4('0x39')](_0xb56d9c[_0x91d4('0x35')],_0xb56d9c['query']);_0x5a5b95['attributes']=_[_0x91d4('0x39')](_0xb56d9c[_0x91d4('0x35')],qs['fields'](_0x138d8c[_0x91d4('0x36')]['fields']));_0x5a5b95['attributes']=_0x5a5b95[_0x91d4('0x3a')][_0x91d4('0x3c')]?_0x5a5b95['attributes']:_0xb56d9c[_0x91d4('0x35')];if(!_0x138d8c[_0x91d4('0x36')][_0x91d4('0x3d')](_0x91d4('0x3e'))){_0x5a5b95['limit']=qs[_0x91d4('0x23')](_0x138d8c[_0x91d4('0x36')][_0x91d4('0x23')]);_0x5a5b95['offset']=qs[_0x91d4('0x3f')](_0x138d8c[_0x91d4('0x36')]['offset']);}_0x5a5b95[_0x91d4('0x40')]=qs[_0x91d4('0x41')](_0x138d8c[_0x91d4('0x36')][_0x91d4('0x41')]);_0x5a5b95['where']=qs[_0x91d4('0x38')](_[_0x91d4('0x5b')](_0x138d8c[_0x91d4('0x36')],_0xb56d9c[_0x91d4('0x38')]));_0x5a5b95['where'][_0x91d4('0x5c')]=_0x473fde['id'];if(_0x138d8c[_0x91d4('0x36')][_0x91d4('0x43')]){_0x5a5b95[_0x91d4('0x42')]=_[_0x91d4('0x44')](_0x5a5b95[_0x91d4('0x42')],{'$or':_['map'](_0x5a5b95['attributes'],function(_0x1a8deb){var _0x2232e={};_0x2232e[_0x1a8deb]={'$like':'%'+_0x138d8c['query'][_0x91d4('0x43')]+'%'};return _0x2232e;})});}_0x5a5b95=_[_0x91d4('0x44')]({},_0x5a5b95,_0x138d8c[_0x91d4('0x47')]);return db['UserWhatsappQueue'][_0x91d4('0x4b')](_0x5a5b95);}})[_0x91d4('0x28')](function(_0x2cf147){if(_0x2cf147){return db[_0x91d4('0x5d')][_0x91d4('0x5e')]({'where':{'id':_[_0x91d4('0x45')](_0x2cf147,'UserId'),'role':_0x91d4('0x5f')},'attributes':['id','name','whatsappPause',_0x91d4('0x60'),_0x91d4('0x61')]});}})['then'](function(_0x9e5a3a){if(_0x9e5a3a){return{'count':_0x9e5a3a['count'],'rows':_[_0x91d4('0x45')](_0x9e5a3a[_0x91d4('0x62')],function(_0x3b547c){return{'membername':_0x3b547c[_0x91d4('0x2f')],'UserId':_0x3b547c['id'],'queue_name':_0x3f7457[_0x91d4('0x2f')],'WhatsappQueueId':_0x3f7457['id'],'interface':util[_0x91d4('0x63')](_0x91d4('0x64'),_0x91d4('0x65'),_0x3b547c[_0x91d4('0x2f')]),'penalty':0x0,'paused':_0x3b547c[_0x91d4('0x66')],'createdAt':_0x3b547c['createdAt'],'updatedAt':_0x3b547c[_0x91d4('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x91d4('0x28')](respondWithFilteredResult(_0x53b97a,_0x5a5b95))[_0x91d4('0x4c')](handleError(_0x53b97a,null));};exports[_0x91d4('0x67')]=function(_0x1a05de,_0x4f34b2,_0x302404){var _0x15eb14={};var _0x456411={};var _0x263caf;var _0x252a5b;return db[_0x91d4('0x48')]['findOne']({'where':{'id':_0x1a05de[_0x91d4('0x4e')]['id']}})[_0x91d4('0x28')](handleEntityNotFound(_0x4f34b2,null))[_0x91d4('0x28')](function(_0x631f82){if(_0x631f82){_0x263caf=_0x631f82;_0x456411[_0x91d4('0x35')]=_['keys'](db[_0x91d4('0x68')]['rawAttributes']);_0x456411['query']=_[_0x91d4('0x37')](_0x1a05de[_0x91d4('0x36')]);_0x456411[_0x91d4('0x38')]=_[_0x91d4('0x39')](_0x456411['model'],_0x456411[_0x91d4('0x36')]);_0x15eb14[_0x91d4('0x3a')]=_[_0x91d4('0x39')](_0x456411['model'],qs[_0x91d4('0x3b')](_0x1a05de['query'][_0x91d4('0x3b')]));_0x15eb14[_0x91d4('0x3a')]=_0x15eb14[_0x91d4('0x3a')][_0x91d4('0x3c')]?_0x15eb14[_0x91d4('0x3a')]:_0x456411[_0x91d4('0x35')];_0x15eb14['order']=qs[_0x91d4('0x41')](_0x1a05de['query'][_0x91d4('0x41')]);_0x15eb14[_0x91d4('0x42')]=qs[_0x91d4('0x38')](_['pick'](_0x1a05de['query'],_0x456411[_0x91d4('0x38')]));if(_0x1a05de['query'][_0x91d4('0x43')]){_0x15eb14[_0x91d4('0x42')]=_[_0x91d4('0x44')](_0x15eb14[_0x91d4('0x42')],{'$or':_[_0x91d4('0x45')](_0x15eb14['attributes'],function(_0x369e60){var _0x390d96={};_0x390d96[_0x369e60]={'$like':'%'+_0x1a05de[_0x91d4('0x36')]['filter']+'%'};return _0x390d96;})});}_0x15eb14=_['merge']({},_0x15eb14,_0x1a05de[_0x91d4('0x47')]);return _0x263caf[_0x91d4('0x67')](_0x15eb14);}})[_0x91d4('0x28')](function(_0x54dbb1){if(_0x54dbb1){_0x252a5b=_0x54dbb1[_0x91d4('0x3c')];if(!_0x1a05de[_0x91d4('0x36')][_0x91d4('0x3d')]('nolimit')){_0x15eb14[_0x91d4('0x23')]=qs[_0x91d4('0x23')](_0x1a05de['query'][_0x91d4('0x23')]);_0x15eb14[_0x91d4('0x3f')]=qs[_0x91d4('0x3f')](_0x1a05de[_0x91d4('0x36')][_0x91d4('0x3f')]);}return _0x263caf[_0x91d4('0x67')](_0x15eb14);}})[_0x91d4('0x28')](function(_0x352f61){if(_0x352f61){return _0x352f61?{'count':_0x252a5b,'rows':_0x352f61}:null;}})[_0x91d4('0x28')](respondWithResult(_0x4f34b2,null))[_0x91d4('0x4c')](handleError(_0x4f34b2,null));};exports[_0x91d4('0x69')]=function(_0xb59d53,_0x14e7f9,_0x3752fc){var _0x528485=_0xb59d53[_0x91d4('0x50')][_0x91d4('0x6a')];return db[_0x91d4('0x68')][_0x91d4('0x4b')]({'where':{'id':_0x528485},'attributes':['id'],'include':[{'model':db[_0x91d4('0x5d')],'as':_0x91d4('0x6b'),'attributes':['id',_0x91d4('0x2f'),_0x91d4('0x6c'),_0x91d4('0x6d'),_0x91d4('0x6e')],'raw':!![]}]})[_0x91d4('0x28')](function(_0x58089d){if(_0x58089d){var _0x4a7da0=_[_0x91d4('0x6f')](_0x58089d,function(_0x1ab271){var _0x57d9b9=_0x1ab271[_0x91d4('0x2a')]({'plain':!![]});return _0x57d9b9[_0x91d4('0x6b')];});return db[_0x91d4('0x48')]['find']({'where':{'id':_0xb59d53[_0x91d4('0x4e')]['id']}})[_0x91d4('0x28')](function(_0x5c8924){return db[_0x91d4('0x70')][_0x91d4('0x71')](function(_0x2339c7){return _0x5c8924[_0x91d4('0x69')](_0x528485,{'transaction':_0x2339c7})[_0x91d4('0x28')](function(){return BPromise[_0x91d4('0x72')](_0x4a7da0,function(_0x38f9b4){return db['UserWhatsappQueue'][_0x91d4('0x73')]({'where':{'UserId':_0x38f9b4['id'],'WhatsappQueueId':_0xb59d53[_0x91d4('0x4e')]['id']},'transaction':_0x2339c7});});})[_0x91d4('0x28')](function(){_0x4a7da0[_0x91d4('0x74')](function(_0x52128b){socket[_0x91d4('0x75')]('userWhatsappQueue:save',{'UserId':_0x52128b['id'],'WhatsappQueueId':_0x5c8924['id']});});});});});}})['then'](respondWithStatusCode(_0x14e7f9,null))[_0x91d4('0x4c')](handleError(_0x14e7f9,null));};exports[_0x91d4('0x76')]=function(_0x50c494,_0x2d30fc,_0x347ffd){return db['Team'][_0x91d4('0x4b')]({'where':{'id':_0x50c494[_0x91d4('0x36')][_0x91d4('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x91d4('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x91d4('0x28')](handleEntityNotFound(_0x2d30fc,null))[_0x91d4('0x28')](function(_0x126a96){var _0x251538=_[_0x91d4('0x45')](_0x126a96,'id');var _0x590c17=[];var _0x10d4bf=[];var _0xa4ce76=squel[_0x91d4('0x77')]();_0xa4ce76[_0x91d4('0x78')](_0x91d4('0x79'))[_0x91d4('0x7a')]('team_has_whatsapp_queues','tq')['join']('user_has_teams','ut',_0x91d4('0x7b'))[_0x91d4('0x42')](_0x91d4('0x7c'),_0x50c494[_0x91d4('0x4e')]['id']);for(var _0x3c64d8=0x0;_0x3c64d8<_0x126a96[_0x91d4('0x3c')];_0x3c64d8+=0x1){let _0x1425df=_0x126a96[_0x3c64d8];for(var _0x48c531=0x0;_0x48c531<_0x1425df[_0x91d4('0x6b')][_0x91d4('0x3c')];_0x48c531+=0x1){let _0x3dca00=_0x1425df[_0x91d4('0x6b')][_0x48c531];var _0x41b3e6=_0xa4ce76['clone']();_0x41b3e6[_0x91d4('0x42')]('ut.UserId\x20=\x20?',_0x3dca00['id']);_0x10d4bf[_0x91d4('0x7d')](db[_0x91d4('0x70')][_0x91d4('0x36')](_0x41b3e6['toString'](),{'type':db[_0x91d4('0x70')][_0x91d4('0x7e')][_0x91d4('0x7f')]})[_0x91d4('0x28')](function(_0xba2d16){if(_0xba2d16['length']===0x1){return _0x3dca00['id'];}else{var _0x164eed=_[_0x91d4('0x80')](_['map'](_0xba2d16,_0x91d4('0x81')),function(_0x42c424){return _[_0x91d4('0x82')](_0x251538,_0x42c424);});if(_0x164eed){return _0x3dca00['id'];}}}));}}return BPromise[_0x91d4('0x83')](_0x10d4bf)[_0x91d4('0x28')](function(_0xb4b9d1){_0x590c17=_(_0x590c17)[_0x91d4('0x84')](_0xb4b9d1)['compact']()[_0x91d4('0x85')]();return db[_0x91d4('0x48')][_0x91d4('0x56')]({'where':{'id':_0x50c494[_0x91d4('0x4e')]['id']}})['then'](function(_0x43cd7a){return db[_0x91d4('0x70')][_0x91d4('0x71')](function(_0x2d3f21){return _0x43cd7a[_0x91d4('0x76')](_0x50c494[_0x91d4('0x36')][_0x91d4('0x6a')],{'transaction':_0x2d3f21})['then'](function(){if(!_[_0x91d4('0x86')](_0x590c17)){return _0x43cd7a[_0x91d4('0x87')](_0x590c17,{'transaction':_0x2d3f21});}})[_0x91d4('0x28')](function(){_0x590c17[_0x91d4('0x74')](function(_0x37d4f3){socket[_0x91d4('0x75')](_0x91d4('0x88'),{'UserId':_0x37d4f3,'WhatsappQueueId':_0x43cd7a['id']});});});});});});})[_0x91d4('0x28')](respondWithStatusCode(_0x2d30fc,null))[_0x91d4('0x4c')](handleError(_0x2d30fc,null));};exports[_0x91d4('0x89')]=function(_0x5c55d0,_0x3e38ce,_0xffeb96){return db[_0x91d4('0x48')][_0x91d4('0x56')]({'where':{'id':_0x5c55d0['params']['id']}})[_0x91d4('0x28')](handleEntityNotFound(_0x3e38ce,null))[_0x91d4('0x28')](function(_0x321aee){if(_0x321aee){return _0x321aee[_0x91d4('0x89')](_0x5c55d0[_0x91d4('0x50')]['ids'],_[_0x91d4('0x8a')](_0x5c55d0[_0x91d4('0x50')],[_0x91d4('0x6a'),'id'])||{})[_0x91d4('0x8b')](function(_0x380118){for(var _0x28be66=0x0;_0x28be66<_0x5c55d0['body']['ids'][_0x91d4('0x3c')];_0x28be66+=0x1){socket[_0x91d4('0x75')](_0x91d4('0x8c'),{'UserId':Number(_0x5c55d0['body']['ids'][_0x28be66]),'WhatsappQueueId':Number(_0x5c55d0[_0x91d4('0x4e')]['id'])});}return _0x380118;});}})[_0x91d4('0x28')](respondWithResult(_0x3e38ce,null))[_0x91d4('0x4c')](handleError(_0x3e38ce,null));};exports[_0x91d4('0x87')]=function(_0x9e5397,_0x43224a,_0x8dfeda){return db[_0x91d4('0x48')][_0x91d4('0x56')]({'where':{'id':_0x9e5397[_0x91d4('0x4e')]['id']}})[_0x91d4('0x28')](handleEntityNotFound(_0x43224a,null))['then'](function(_0x361287){if(_0x361287){return _0x361287['removeAgents'](_0x9e5397['query'][_0x91d4('0x6a')])[_0x91d4('0x28')](function(){if(_[_0x91d4('0x8d')](_0x9e5397['query'][_0x91d4('0x6a')])){for(var _0x440923=0x0;_0x440923<_0x9e5397['query'][_0x91d4('0x6a')]['length'];_0x440923+=0x1){socket[_0x91d4('0x75')]('userWhatsappQueue:remove',{'UserId':Number(_0x9e5397['query'][_0x91d4('0x6a')][_0x440923]),'WhatsappQueueId':Number(_0x9e5397[_0x91d4('0x4e')]['id'])});}}else{socket['emit'](_0x91d4('0x88'),{'UserId':Number(_0x9e5397[_0x91d4('0x36')][_0x91d4('0x6a')]),'WhatsappQueueId':Number(_0x9e5397[_0x91d4('0x4e')]['id'])});}});}})[_0x91d4('0x28')](respondWithStatusCode(_0x43224a,null))['catch'](handleError(_0x43224a,null));};exports['getAgents']=function(_0x5d3b0,_0x6e324d,_0x333c05){var _0x33016a={};var _0x31403b={};var _0x4643b8;var _0x1382eb;return db['WhatsappQueue'][_0x91d4('0x59')]({'where':{'id':_0x5d3b0['params']['id']}})[_0x91d4('0x28')](handleEntityNotFound(_0x6e324d,null))[_0x91d4('0x28')](function(_0x3557b9){if(_0x3557b9){_0x4643b8=_0x3557b9;_0x31403b['model']=_['keys'](db['User'][_0x91d4('0x32')]);_0x31403b[_0x91d4('0x36')]=_[_0x91d4('0x37')](_0x5d3b0[_0x91d4('0x36')]);_0x31403b['filters']=_[_0x91d4('0x39')](_0x31403b[_0x91d4('0x35')],_0x31403b[_0x91d4('0x36')]);_0x33016a[_0x91d4('0x3a')]=_[_0x91d4('0x39')](_0x31403b[_0x91d4('0x35')],qs['fields'](_0x5d3b0[_0x91d4('0x36')][_0x91d4('0x3b')]));_0x33016a[_0x91d4('0x3a')]=_0x33016a['attributes'][_0x91d4('0x3c')]?_0x33016a[_0x91d4('0x3a')]:_0x31403b[_0x91d4('0x35')];_0x33016a[_0x91d4('0x40')]=qs[_0x91d4('0x41')](_0x5d3b0['query']['sort']);_0x33016a[_0x91d4('0x42')]=qs['filters'](_[_0x91d4('0x5b')](_0x5d3b0[_0x91d4('0x36')],_0x31403b[_0x91d4('0x38')]));if(_0x5d3b0['query'][_0x91d4('0x43')]){_0x33016a[_0x91d4('0x42')]=_[_0x91d4('0x44')](_0x33016a[_0x91d4('0x42')],{'$or':_[_0x91d4('0x45')](_0x33016a['attributes'],function(_0x36ff5b){var _0x264567={};_0x264567[_0x36ff5b]={'$like':'%'+_0x5d3b0['query'][_0x91d4('0x43')]+'%'};return _0x264567;})});}_0x33016a=_[_0x91d4('0x44')]({},_0x33016a,_0x5d3b0['options']);return _0x4643b8[_0x91d4('0x8e')](_0x33016a);}})[_0x91d4('0x28')](function(_0x4a0dda){if(_0x4a0dda){_0x1382eb=_0x4a0dda[_0x91d4('0x3c')];if(!_0x5d3b0[_0x91d4('0x36')][_0x91d4('0x3d')](_0x91d4('0x3e'))){_0x33016a[_0x91d4('0x23')]=qs[_0x91d4('0x23')](_0x5d3b0[_0x91d4('0x36')][_0x91d4('0x23')]);_0x33016a[_0x91d4('0x3f')]=qs['offset'](_0x5d3b0['query'][_0x91d4('0x3f')]);}return _0x4643b8[_0x91d4('0x8e')](_0x33016a);}})['then'](function(_0x4b3f8f){if(_0x4b3f8f){return _0x4b3f8f?{'count':_0x1382eb,'rows':_0x4b3f8f}:null;}})[_0x91d4('0x28')](respondWithResult(_0x6e324d,null))['catch'](handleError(_0x6e324d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index e446ff7..3deeb5e 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 _0xe024=['emit','hook','exports','events','WhatsappQueue','setMaxListeners','save','update','remove'];(function(_0xea9508,_0x53e844){var _0x5d426e=function(_0x11ef98){while(--_0x11ef98){_0xea9508['push'](_0xea9508['shift']());}};_0x5d426e(++_0x53e844);}(_0xe024,0x78));var _0x4e02=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0xe024[_0x1fcaf1];return _0x55f464;};'use strict';var EventEmitter=require(_0x4e02('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x4e02('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4e02('0x2')](0x0);var events={'afterCreate':_0x4e02('0x3'),'afterUpdate':_0x4e02('0x4'),'afterDestroy':_0x4e02('0x5')};function emitEvent(_0x5992e1){return function(_0x14f694,_0x158f08,_0x3b34cb){WhatsappQueueEvents[_0x4e02('0x6')](_0x5992e1+':'+_0x14f694['id'],_0x14f694);WhatsappQueueEvents['emit'](_0x5992e1,_0x14f694);_0x3b34cb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x4e02('0x7')](e,emitEvent(event));}}module[_0x4e02('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x038c=['../../mysqldb','setMaxListeners','save','update','remove','hook','exports','events'];(function(_0x2906e6,_0x5ccd59){var _0x12517a=function(_0x36d576){while(--_0x36d576){_0x2906e6['push'](_0x2906e6['shift']());}};_0x12517a(++_0x5ccd59);}(_0x038c,0x14f));var _0xc038=function(_0x4c4dc5,_0x896106){_0x4c4dc5=_0x4c4dc5-0x0;var _0xb7805d=_0x038c[_0x4c4dc5];return _0xb7805d;};'use strict';var EventEmitter=require(_0xc038('0x0'));var WhatsappQueue=require(_0xc038('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc038('0x2')](0x0);var events={'afterCreate':_0xc038('0x3'),'afterUpdate':_0xc038('0x4'),'afterDestroy':_0xc038('0x5')};function emitEvent(_0x38c1ea){return function(_0x1b8861,_0x48b603,_0x394e67){WhatsappQueueEvents['emit'](_0x38c1ea+':'+_0x1b8861['id'],_0x1b8861);WhatsappQueueEvents['emit'](_0x38c1ea,_0x1b8861);_0x394e67(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xc038('0x6')](e,emitEvent(event));}}module[_0xc038('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 6c496bc..5e3281c 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 _0xdd30=['../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xdd30,0x1b2));var _0x0dd3=function(_0x1a1dd7,_0x9e586a){_0x1a1dd7=_0x1a1dd7-0x0;var _0x5e5ac6=_0xdd30[_0x1a1dd7];return _0x5e5ac6;};'use strict';var _=require('lodash');var util=require(_0x0dd3('0x0'));var logger=require(_0x0dd3('0x1'))(_0x0dd3('0x2'));var moment=require('moment');var BPromise=require(_0x0dd3('0x3'));var rp=require(_0x0dd3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0dd3('0x5'));var config=require(_0x0dd3('0x6'));var attributes=require(_0x0dd3('0x7'));module[_0x0dd3('0x8')]=function(_0x58b8c4,_0x43a95d){return _0x58b8c4[_0x0dd3('0x9')](_0x0dd3('0xa'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68cc=['lodash','util','moment','request-promise','path','rimraf','../../config/environment','exports','WhatsappQueue','whatsapp_queues'];(function(_0x5d381c,_0x445675){var _0x5d0199=function(_0x3344e3){while(--_0x3344e3){_0x5d381c['push'](_0x5d381c['shift']());}};_0x5d0199(++_0x445675);}(_0x68cc,0xf0));var _0xc68c=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x68cc[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0xc68c('0x0'));var util=require(_0xc68c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc68c('0x2'));var BPromise=require('bluebird');var rp=require(_0xc68c('0x3'));var fs=require('fs');var path=require(_0xc68c('0x4'));var rimraf=require(_0xc68c('0x5'));var config=require(_0xc68c('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0xc68c('0x7')]=function(_0x1fab51,_0x377335){return _0x1fab51['define'](_0xc68c('0x8'),attributes,{'tableName':_0xc68c('0x9'),'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 a5738e8..953249a 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 _0x13a0=['options','raw','where','limit','map','include','model','attributes','debug','catch','ShowWhatsappQueue','find','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetWhatsappQueue','WhatsappQueue','findAll'];(function(_0x31f6a6,_0x5d81cb){var _0x110769=function(_0x19828e){while(--_0x19828e){_0x31f6a6['push'](_0x31f6a6['shift']());}};_0x110769(++_0x5d81cb);}(_0x13a0,0x84));var _0x013a=function(_0x41e793,_0x166684){_0x41e793=_0x41e793-0x0;var _0x2885fa=_0x13a0[_0x41e793];return _0x2885fa;};'use strict';var _=require(_0x013a('0x0'));var util=require(_0x013a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x013a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x013a('0x3'));var logger=require(_0x013a('0x4'))(_0x013a('0x5'));var config=require(_0x013a('0x6'));var jayson=require(_0x013a('0x7'));var client=jayson[_0x013a('0x8')][_0x013a('0x9')]({'port':0x232a});config[_0x013a('0xa')]=_[_0x013a('0xb')](config[_0x013a('0xa')],{'host':_0x013a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x013a('0xa')]));require(_0x013a('0xd'))[_0x013a('0xe')](socket);function respondWithRpcPromise(_0x96e634,_0x6e4406,_0x3c19cf){return new BPromise(function(_0x5ac3ef,_0xcb3022){return client[_0x013a('0xf')](_0x96e634,_0x3c19cf)[_0x013a('0x10')](function(_0x3baedd){logger[_0x013a('0x11')](_0x013a('0x12'),_0x6e4406,_0x013a('0x13'));logger['debug'](_0x013a('0x14'),_0x6e4406,'request\x20sent',JSON[_0x013a('0x15')](_0x3baedd));if(_0x3baedd['error']){if(_0x3baedd['error']['code']===0x1f4){logger[_0x013a('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x6e4406,_0x3baedd[_0x013a('0x16')][_0x013a('0x17')]);return _0xcb3022(_0x3baedd[_0x013a('0x16')][_0x013a('0x17')]);}logger[_0x013a('0x16')](_0x013a('0x12'),_0x6e4406,_0x3baedd[_0x013a('0x16')]['message']);return _0x5ac3ef(_0x3baedd[_0x013a('0x16')][_0x013a('0x17')]);}else{logger[_0x013a('0x11')](_0x013a('0x12'),_0x6e4406,_0x013a('0x13'));_0x5ac3ef(_0x3baedd[_0x013a('0x18')][_0x013a('0x17')]);}})['catch'](function(_0x1fc6eb){logger['error'](_0x013a('0x12'),_0x6e4406,_0x1fc6eb);_0xcb3022(_0x1fc6eb);});});}exports[_0x013a('0x19')]=function(_0x49f80f){var _0x1b4d76=this;return new Promise(function(_0x12f2c2,_0x595b8d){return db[_0x013a('0x1a')][_0x013a('0x1b')]({'raw':_0x49f80f['options']?_0x49f80f[_0x013a('0x1c')][_0x013a('0x1d')]===undefined?!![]:![]:!![],'where':_0x49f80f[_0x013a('0x1c')]?_0x49f80f[_0x013a('0x1c')][_0x013a('0x1e')]||null:null,'attributes':_0x49f80f[_0x013a('0x1c')]?_0x49f80f[_0x013a('0x1c')]['attributes']||null:null,'limit':_0x49f80f[_0x013a('0x1c')]?_0x49f80f[_0x013a('0x1c')][_0x013a('0x1f')]||null:null,'include':_0x49f80f[_0x013a('0x1c')]?_0x49f80f['options']['include']?_[_0x013a('0x20')](_0x49f80f[_0x013a('0x1c')][_0x013a('0x21')],function(_0x496b18){return{'model':db[_0x496b18[_0x013a('0x22')]],'as':_0x496b18['as'],'attributes':_0x496b18[_0x013a('0x23')],'include':_0x496b18[_0x013a('0x21')]?_[_0x013a('0x20')](_0x496b18[_0x013a('0x21')],function(_0x19f47e){return{'model':db[_0x19f47e['model']],'as':_0x19f47e['as'],'attributes':_0x19f47e['attributes'],'include':_0x19f47e['include']?_[_0x013a('0x20')](_0x19f47e[_0x013a('0x21')],function(_0x5cc36c){return{'model':db[_0x5cc36c[_0x013a('0x22')]],'as':_0x5cc36c['as'],'attributes':_0x5cc36c[_0x013a('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f90c8){logger[_0x013a('0x11')]('GetWhatsappQueue',_0x49f80f);logger[_0x013a('0x24')]('GetWhatsappQueue',_0x49f80f,JSON['stringify'](_0x4f90c8));_0x12f2c2(_0x4f90c8);})[_0x013a('0x25')](function(_0x5c3ff1){logger[_0x013a('0x16')](_0x013a('0x19'),_0x5c3ff1['message'],_0x49f80f);_0x595b8d(_0x1b4d76['error'](0x1f4,_0x5c3ff1[_0x013a('0x17')]));});});};exports[_0x013a('0x26')]=function(_0x43480f){var _0x4faf7a=this;return new Promise(function(_0x896602,_0x379539){return db[_0x013a('0x1a')][_0x013a('0x27')]({'raw':_0x43480f['options']?_0x43480f[_0x013a('0x1c')][_0x013a('0x1d')]===undefined?!![]:![]:!![],'where':_0x43480f[_0x013a('0x1c')]?_0x43480f['options'][_0x013a('0x1e')]||null:null,'attributes':_0x43480f[_0x013a('0x1c')]?_0x43480f['options']['attributes']||null:null,'include':_0x43480f[_0x013a('0x1c')]?_0x43480f[_0x013a('0x1c')][_0x013a('0x21')]?_[_0x013a('0x20')](_0x43480f[_0x013a('0x1c')][_0x013a('0x21')],function(_0x22d5f4){return{'model':db[_0x22d5f4[_0x013a('0x22')]],'as':_0x22d5f4['as'],'attributes':_0x22d5f4[_0x013a('0x23')],'include':_0x22d5f4[_0x013a('0x21')]?_[_0x013a('0x20')](_0x22d5f4[_0x013a('0x21')],function(_0x2d1c84){return{'model':db[_0x2d1c84[_0x013a('0x22')]],'as':_0x2d1c84['as'],'attributes':_0x2d1c84[_0x013a('0x23')],'include':_0x2d1c84[_0x013a('0x21')]?_[_0x013a('0x20')](_0x2d1c84[_0x013a('0x21')],function(_0x3bd35b){return{'model':db[_0x3bd35b[_0x013a('0x22')]],'as':_0x3bd35b['as'],'attributes':_0x3bd35b[_0x013a('0x23')]};}):[]};}):[]};}):[]:[]})[_0x013a('0x10')](function(_0x3085e4){logger[_0x013a('0x11')](_0x013a('0x26'),_0x43480f);logger[_0x013a('0x24')](_0x013a('0x26'),_0x43480f,JSON[_0x013a('0x15')](_0x3085e4));_0x896602(_0x3085e4);})[_0x013a('0x25')](function(_0x21ca20){logger['error']('ShowWhatsappQueue',_0x21ca20[_0x013a('0x17')],_0x43480f);_0x379539(_0x4faf7a[_0x013a('0x16')](0x1f4,_0x21ca20[_0x013a('0x17')]));});});}; \ No newline at end of file +var _0x0148=['./whatsappQueue.socket','register','request','then','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','info','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','limit','map','include','attributes','model','ShowWhatsappQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0148,0x12c));var _0x8014=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x0148[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x8014('0x0'));var util=require('util');var moment=require(_0x8014('0x1'));var BPromise=require(_0x8014('0x2'));var rs=require(_0x8014('0x3'));var fs=require('fs');var Redis=require(_0x8014('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8014('0x5'));var logger=require(_0x8014('0x6'))(_0x8014('0x7'));var config=require('../../config/environment');var jayson=require(_0x8014('0x8'));var client=jayson[_0x8014('0x9')]['http']({'port':0x232a});config[_0x8014('0xa')]=_['defaults'](config[_0x8014('0xa')],{'host':_0x8014('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8014('0xa')]));require(_0x8014('0xc'))[_0x8014('0xd')](socket);function respondWithRpcPromise(_0x3a6fd2,_0x1960c9,_0x119d91){return new BPromise(function(_0x56f025,_0x3b779e){return client[_0x8014('0xe')](_0x3a6fd2,_0x119d91)[_0x8014('0xf')](function(_0xdd22b3){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x1960c9,_0x8014('0x10'));logger[_0x8014('0x11')](_0x8014('0x12'),_0x1960c9,'request\x20sent',JSON[_0x8014('0x13')](_0xdd22b3));if(_0xdd22b3[_0x8014('0x14')]){if(_0xdd22b3['error'][_0x8014('0x15')]===0x1f4){logger['error'](_0x8014('0x16'),_0x1960c9,_0xdd22b3[_0x8014('0x14')][_0x8014('0x17')]);return _0x3b779e(_0xdd22b3[_0x8014('0x14')][_0x8014('0x17')]);}logger['error'](_0x8014('0x16'),_0x1960c9,_0xdd22b3[_0x8014('0x14')][_0x8014('0x17')]);return _0x56f025(_0xdd22b3['error']['message']);}else{logger[_0x8014('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x1960c9,'request\x20sent');_0x56f025(_0xdd22b3[_0x8014('0x19')][_0x8014('0x17')]);}})[_0x8014('0x1a')](function(_0x1009aa){logger[_0x8014('0x14')](_0x8014('0x16'),_0x1960c9,_0x1009aa);_0x3b779e(_0x1009aa);});});}exports[_0x8014('0x1b')]=function(_0x43155d){var _0x2bce44=this;return new Promise(function(_0x18ca57,_0x4c2e3d){return db[_0x8014('0x1c')]['findAll']({'raw':_0x43155d['options']?_0x43155d[_0x8014('0x1d')][_0x8014('0x1e')]===undefined?!![]:![]:!![],'where':_0x43155d[_0x8014('0x1d')]?_0x43155d['options'][_0x8014('0x1f')]||null:null,'attributes':_0x43155d[_0x8014('0x1d')]?_0x43155d[_0x8014('0x1d')]['attributes']||null:null,'limit':_0x43155d[_0x8014('0x1d')]?_0x43155d[_0x8014('0x1d')][_0x8014('0x20')]||null:null,'include':_0x43155d[_0x8014('0x1d')]?_0x43155d[_0x8014('0x1d')]['include']?_[_0x8014('0x21')](_0x43155d[_0x8014('0x1d')][_0x8014('0x22')],function(_0x2948b8){return{'model':db[_0x2948b8['model']],'as':_0x2948b8['as'],'attributes':_0x2948b8[_0x8014('0x23')],'include':_0x2948b8[_0x8014('0x22')]?_[_0x8014('0x21')](_0x2948b8[_0x8014('0x22')],function(_0x4fe75a){return{'model':db[_0x4fe75a[_0x8014('0x24')]],'as':_0x4fe75a['as'],'attributes':_0x4fe75a[_0x8014('0x23')],'include':_0x4fe75a[_0x8014('0x22')]?_[_0x8014('0x21')](_0x4fe75a['include'],function(_0xd72f9c){return{'model':db[_0xd72f9c[_0x8014('0x24')]],'as':_0xd72f9c['as'],'attributes':_0xd72f9c['attributes']};}):[]};}):[]};}):[]:[]})[_0x8014('0xf')](function(_0x50226f){logger[_0x8014('0x18')](_0x8014('0x1b'),_0x43155d);logger['debug'](_0x8014('0x1b'),_0x43155d,JSON['stringify'](_0x50226f));_0x18ca57(_0x50226f);})[_0x8014('0x1a')](function(_0x591bf4){logger[_0x8014('0x14')]('GetWhatsappQueue',_0x591bf4[_0x8014('0x17')],_0x43155d);_0x4c2e3d(_0x2bce44[_0x8014('0x14')](0x1f4,_0x591bf4[_0x8014('0x17')]));});});};exports[_0x8014('0x25')]=function(_0x589559){var _0x48ba27=this;return new Promise(function(_0x116dc3,_0x31b9d8){return db[_0x8014('0x1c')][_0x8014('0x26')]({'raw':_0x589559['options']?_0x589559['options'][_0x8014('0x1e')]===undefined?!![]:![]:!![],'where':_0x589559[_0x8014('0x1d')]?_0x589559['options'][_0x8014('0x1f')]||null:null,'attributes':_0x589559['options']?_0x589559[_0x8014('0x1d')]['attributes']||null:null,'include':_0x589559[_0x8014('0x1d')]?_0x589559['options']['include']?_['map'](_0x589559[_0x8014('0x1d')][_0x8014('0x22')],function(_0x572411){return{'model':db[_0x572411[_0x8014('0x24')]],'as':_0x572411['as'],'attributes':_0x572411[_0x8014('0x23')],'include':_0x572411['include']?_[_0x8014('0x21')](_0x572411[_0x8014('0x22')],function(_0x3ea3ea){return{'model':db[_0x3ea3ea[_0x8014('0x24')]],'as':_0x3ea3ea['as'],'attributes':_0x3ea3ea[_0x8014('0x23')],'include':_0x3ea3ea[_0x8014('0x22')]?_['map'](_0x3ea3ea['include'],function(_0x14e7c4){return{'model':db[_0x14e7c4[_0x8014('0x24')]],'as':_0x14e7c4['as'],'attributes':_0x14e7c4[_0x8014('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x526639){logger[_0x8014('0x18')](_0x8014('0x25'),_0x589559);logger[_0x8014('0x11')](_0x8014('0x25'),_0x589559,JSON[_0x8014('0x13')](_0x526639));_0x116dc3(_0x526639);})[_0x8014('0x1a')](function(_0xa6a5a2){logger[_0x8014('0x14')](_0x8014('0x25'),_0xa6a5a2['message'],_0x589559);_0x31b9d8(_0x48ba27[_0x8014('0x14')](0x1f4,_0xa6a5a2[_0x8014('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 08c01f1..c7bce2c 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 _0x27c7=['./whatsappQueue.events','save','remove','emit','removeListener','register','length'];(function(_0x34171e,_0x1250dd){var _0x3285fb=function(_0xb761b8){while(--_0xb761b8){_0x34171e['push'](_0x34171e['shift']());}};_0x3285fb(++_0x1250dd);}(_0x27c7,0x1ea));var _0x727c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x27c7[_0x397e5f];return _0x5302b8;};'use strict';var WhatsappQueueEvents=require(_0x727c('0x0'));var events=[_0x727c('0x1'),_0x727c('0x2'),'update'];function createListener(_0x128bce,_0x4ae20e){return function(_0x22347b){_0x4ae20e[_0x727c('0x3')](_0x128bce,_0x22347b);};}function removeListener(_0x2b7bb3,_0xc50583){return function(){WhatsappQueueEvents[_0x727c('0x4')](_0x2b7bb3,_0xc50583);};}exports[_0x727c('0x5')]=function(_0x17719b){for(var _0x5cedef=0x0,_0x3e8932=events[_0x727c('0x6')];_0x5cedef<_0x3e8932;_0x5cedef++){var _0x3d0703=events[_0x5cedef];var _0x54a732=createListener('whatsappQueue:'+_0x3d0703,_0x17719b);WhatsappQueueEvents['on'](_0x3d0703,_0x54a732);}}; \ No newline at end of file +var _0x0e4e=['removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit'];(function(_0x1bcad7,_0x1bc3f1){var _0x56d087=function(_0x3a3716){while(--_0x3a3716){_0x1bcad7['push'](_0x1bcad7['shift']());}};_0x56d087(++_0x1bc3f1);}(_0x0e4e,0xd3));var _0xe0e4=function(_0x4da462,_0x2aac46){_0x4da462=_0x4da462-0x0;var _0x2a001a=_0x0e4e[_0x4da462];return _0x2a001a;};'use strict';var WhatsappQueueEvents=require(_0xe0e4('0x0'));var events=[_0xe0e4('0x1'),_0xe0e4('0x2'),_0xe0e4('0x3')];function createListener(_0x184463,_0x582a53){return function(_0x30ea77){_0x582a53[_0xe0e4('0x4')](_0x184463,_0x30ea77);};}function removeListener(_0xccd808,_0x131974){return function(){WhatsappQueueEvents[_0xe0e4('0x5')](_0xccd808,_0x131974);};}exports[_0xe0e4('0x6')]=function(_0x5aff23){for(var _0x17ffc3=0x0,_0x5dc308=events[_0xe0e4('0x7')];_0x17ffc3<_0x5dc308;_0x17ffc3++){var _0x573541=events[_0x17ffc3];var _0x17aac5=createListener(_0xe0e4('0x8')+_0x573541,_0x5aff23);WhatsappQueueEvents['on'](_0x573541,_0x17aac5);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index c873b99..19e7dfd 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 _0xcc1b=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','put','delete','destroy'];(function(_0x761b6d,_0x7c7fa8){var _0x3a1639=function(_0x33b90a){while(--_0x33b90a){_0x761b6d['push'](_0x761b6d['shift']());}};_0x3a1639(++_0x7c7fa8);}(_0xcc1b,0xf0));var _0xbcc1=function(_0xbdb08a,_0x3977fa){_0xbdb08a=_0xbdb08a-0x0;var _0x30142e=_0xcc1b[_0xbdb08a];return _0x30142e;};'use strict';var multer=require(_0xbcc1('0x0'));var util=require(_0xbcc1('0x1'));var path=require(_0xbcc1('0x2'));var timeout=require(_0xbcc1('0x3'));var express=require(_0xbcc1('0x4'));var router=express[_0xbcc1('0x5')]();var fs_extra=require(_0xbcc1('0x6'));var auth=require(_0xbcc1('0x7'));var interaction=require(_0xbcc1('0x8'));var config=require(_0xbcc1('0x9'));var controller=require(_0xbcc1('0xa'));router['get']('/',auth[_0xbcc1('0xb')](),controller[_0xbcc1('0xc')]);router[_0xbcc1('0xd')]('/describe',auth[_0xbcc1('0xb')](),controller[_0xbcc1('0xe')]);router[_0xbcc1('0xd')](_0xbcc1('0xf'),auth[_0xbcc1('0xb')](),controller[_0xbcc1('0x10')]);router['post']('/',auth[_0xbcc1('0xb')](),controller['create']);router[_0xbcc1('0x11')](_0xbcc1('0xf'),auth[_0xbcc1('0xb')](),controller['update']);router[_0xbcc1('0x12')](_0xbcc1('0xf'),auth[_0xbcc1('0xb')](),controller[_0xbcc1('0x13')]);module['exports']=router; \ No newline at end of file +var _0xb672=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','update','delete','destroy','exports','multer','util'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xb672,0x1a2));var _0x2b67=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb672[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x2b67('0x0'));var util=require(_0x2b67('0x1'));var path=require(_0x2b67('0x2'));var timeout=require(_0x2b67('0x3'));var express=require(_0x2b67('0x4'));var router=express[_0x2b67('0x5')]();var fs_extra=require(_0x2b67('0x6'));var auth=require(_0x2b67('0x7'));var interaction=require(_0x2b67('0x8'));var config=require(_0x2b67('0x9'));var controller=require('./whatsappQueueReport.controller');router[_0x2b67('0xa')]('/',auth[_0x2b67('0xb')](),controller[_0x2b67('0xc')]);router[_0x2b67('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x2b67('0xd')]);router[_0x2b67('0xa')](_0x2b67('0xe'),auth[_0x2b67('0xb')](),controller[_0x2b67('0xf')]);router[_0x2b67('0x10')]('/',auth[_0x2b67('0xb')](),controller['create']);router['put'](_0x2b67('0xe'),auth[_0x2b67('0xb')](),controller[_0x2b67('0x11')]);router[_0x2b67('0x12')](_0x2b67('0xe'),auth[_0x2b67('0xb')](),controller[_0x2b67('0x13')]);module[_0x2b67('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index bd65af5..20a1472 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x1bf749,_0x34db3d){var _0x362449=function(_0x41a928){while(--_0x41a928){_0x1bf749['push'](_0x1bf749['shift']());}};_0x362449(++_0x34db3d);}(_0x7a54,0x106));var _0x47a5=function(_0x2ba072,_0x2226ab){_0x2ba072=_0x2ba072-0x0;var _0x52c495=_0x7a54[_0x2ba072];return _0x52c495;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x5973f4,_0xf526bb){var _0x228796=function(_0x5740f5){while(--_0x5740f5){_0x5973f4['push'](_0x5973f4['shift']());}};_0x228796(++_0xf526bb);}(_0x7a54,0x106));var _0x47a5=function(_0x89701b,_0x2f7af5){_0x89701b=_0x89701b-0x0;var _0x327869=_0x7a54[_0x89701b];return _0x327869;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 8f04afc..83c30c1 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c9a=['eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe'];(function(_0x386042,_0x1869f1){var _0x5e766c=function(_0x24091e){while(--_0x24091e){_0x386042['push'](_0x386042['shift']());}};_0x5e766c(++_0x1869f1);}(_0x1c9a,0x98));var _0xa1c9=function(_0x177dfe,_0x2ecc6d){_0x177dfe=_0x177dfe-0x0;var _0x85887f=_0x1c9a[_0x177dfe];return _0x85887f;};'use strict';var emlformat=require(_0xa1c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1c9('0x2'));var moment=require(_0xa1c9('0x3'));var BPromise=require(_0xa1c9('0x4'));var Mustache=require('mustache');var util=require(_0xa1c9('0x5'));var path=require(_0xa1c9('0x6'));var sox=require(_0xa1c9('0x7'));var csv=require(_0xa1c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1c9('0x9'));var _=require('lodash');var squel=require(_0xa1c9('0xa'));var crypto=require(_0xa1c9('0xb'));var jsforce=require(_0xa1c9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa1c9('0x8'));var querystring=require(_0xa1c9('0xd'));var Papa=require(_0xa1c9('0xe'));var Redis=require(_0xa1c9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa1c9('0x10'));var as=require(_0xa1c9('0x11'));var hardwareService=require(_0xa1c9('0x12'));var logger=require(_0xa1c9('0x13'))(_0xa1c9('0x14'));var utils=require(_0xa1c9('0x15'));var config=require(_0xa1c9('0x16'));var licenseUtil=require(_0xa1c9('0x17'));var db=require(_0xa1c9('0x18'))['db'];function respondWithStatusCode(_0x17ee28,_0x57e2a8){_0x57e2a8=_0x57e2a8||0xcc;return function(_0x341233){if(_0x341233){return _0x17ee28[_0xa1c9('0x19')](_0x57e2a8);}return _0x17ee28[_0xa1c9('0x1a')](_0x57e2a8)[_0xa1c9('0x1b')]();};}function respondWithResult(_0x13f4e9,_0x4c70dd){_0x4c70dd=_0x4c70dd||0xc8;return function(_0x335dda){if(_0x335dda){return _0x13f4e9[_0xa1c9('0x1a')](_0x4c70dd)[_0xa1c9('0x1c')](_0x335dda);}};}function respondWithFilteredResult(_0xd9bca1,_0x2d825c){return function(_0x1bbc94){if(_0x1bbc94){var _0x44ab5b=typeof _0x2d825c[_0xa1c9('0x1d')]===_0xa1c9('0x1e')&&typeof _0x2d825c[_0xa1c9('0x1f')]==='undefined';var _0x11ca10=_0x1bbc94[_0xa1c9('0x20')];var _0x224ae4=_0x44ab5b?0x0:_0x2d825c['offset'];var _0x2fb81e=_0x44ab5b?_0x1bbc94['count']:_0x2d825c[_0xa1c9('0x1d')]+_0x2d825c[_0xa1c9('0x1f')];var _0x204d54;if(_0x2fb81e>=_0x11ca10){_0x2fb81e=_0x11ca10;_0x204d54=0xc8;}else{_0x204d54=0xce;}_0xd9bca1['status'](_0x204d54);return _0xd9bca1[_0xa1c9('0x21')](_0xa1c9('0x22'),_0x224ae4+'-'+_0x2fb81e+'/'+_0x11ca10)[_0xa1c9('0x1c')](_0x1bbc94);}return null;};}function patchUpdates(_0x4edf37){return function(_0x41e6d2){try{jsonpatch[_0xa1c9('0x23')](_0x41e6d2,_0x4edf37,!![]);}catch(_0x4c6dbb){return BPromise[_0xa1c9('0x24')](_0x4c6dbb);}return _0x41e6d2[_0xa1c9('0x25')]();};}function saveUpdates(_0x9f201f,_0x4d05d0){return function(_0x29f1b1){if(_0x29f1b1){return _0x29f1b1[_0xa1c9('0x26')](_0x9f201f)[_0xa1c9('0x27')](function(_0x23a461){return _0x23a461;});}return null;};}function removeEntity(_0x24a5da,_0x4a0a0c){return function(_0x50b16b){if(_0x50b16b){return _0x50b16b[_0xa1c9('0x28')]()['then'](function(){_0x24a5da[_0xa1c9('0x1a')](0xcc)[_0xa1c9('0x1b')]();});}};}function handleEntityNotFound(_0x1c6f37,_0x3059eb){return function(_0x339ed1){if(!_0x339ed1){_0x1c6f37['sendStatus'](0x194);}return _0x339ed1;};}function handleError(_0x1925e7,_0x3ca2a8){_0x3ca2a8=_0x3ca2a8||0x1f4;return function(_0x20cbe1){logger['error'](_0x20cbe1[_0xa1c9('0x29')]);if(_0x20cbe1[_0xa1c9('0x2a')]){delete _0x20cbe1[_0xa1c9('0x2a')];}_0x1925e7['status'](_0x3ca2a8)[_0xa1c9('0x2b')](_0x20cbe1);};}exports[_0xa1c9('0x2c')]=function(_0x594137,_0x38936f){var _0x48ce34={},_0xdf6d0c={},_0x2404c3={'count':0x0,'rows':[]};var _0x88ba11=_[_0xa1c9('0x2d')](db[_0xa1c9('0x2e')][_0xa1c9('0x2f')],function(_0x42fcb2){return{'name':_0x42fcb2[_0xa1c9('0x30')],'type':_0x42fcb2['type']['key']};});_0xdf6d0c[_0xa1c9('0x31')]=_[_0xa1c9('0x2d')](_0x88ba11,_0xa1c9('0x2a'));_0xdf6d0c[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x594137['query']);_0xdf6d0c['filters']=_['intersection'](_0xdf6d0c[_0xa1c9('0x31')],_0xdf6d0c[_0xa1c9('0x32')]);_0x48ce34[_0xa1c9('0x34')]=_[_0xa1c9('0x35')](_0xdf6d0c[_0xa1c9('0x31')],qs[_0xa1c9('0x36')](_0x594137[_0xa1c9('0x32')]['fields']));_0x48ce34[_0xa1c9('0x34')]=_0x48ce34['attributes'][_0xa1c9('0x37')]?_0x48ce34['attributes']:_0xdf6d0c[_0xa1c9('0x31')];if(!_0x594137[_0xa1c9('0x32')][_0xa1c9('0x38')]('nolimit')){_0x48ce34[_0xa1c9('0x1f')]=qs[_0xa1c9('0x1f')](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x1f')]);_0x48ce34['offset']=qs['offset'](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x1d')]);}_0x48ce34[_0xa1c9('0x39')]=qs[_0xa1c9('0x3a')](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3a')]);_0x48ce34[_0xa1c9('0x3b')]=qs[_0xa1c9('0x3c')](_[_0xa1c9('0x3d')](_0x594137[_0xa1c9('0x32')],_0xdf6d0c['filters']),_0x88ba11);if(_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3e')]){_0x48ce34[_0xa1c9('0x3b')]=_[_0xa1c9('0x3f')](_0x48ce34[_0xa1c9('0x3b')],{'$or':_[_0xa1c9('0x2d')](_0x88ba11,function(_0x5011a3){if(_0x5011a3[_0xa1c9('0x40')]!==_0xa1c9('0x41')){var _0x29d871={};_0x29d871[_0x5011a3['name']]={'$like':'%'+_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3e')]+'%'};return _0x29d871;}})});}_0x48ce34=_['merge']({},_0x48ce34,_0x594137[_0xa1c9('0x42')]);var _0x25502f={'where':_0x48ce34['where']};return db['WhatsappQueueReport'][_0xa1c9('0x20')](_0x25502f)[_0xa1c9('0x27')](function(_0x34a6b8){_0x2404c3[_0xa1c9('0x20')]=_0x34a6b8;if(_0x594137[_0xa1c9('0x32')][_0xa1c9('0x43')]){_0x48ce34[_0xa1c9('0x44')]=[{'all':!![]}];}return db[_0xa1c9('0x2e')][_0xa1c9('0x45')](_0x48ce34);})[_0xa1c9('0x27')](function(_0x5ac71f){_0x2404c3['rows']=_0x5ac71f;return _0x2404c3;})[_0xa1c9('0x27')](respondWithFilteredResult(_0x38936f,_0x48ce34))[_0xa1c9('0x46')](handleError(_0x38936f,null));};exports['show']=function(_0x30ce3b,_0x102a33){var _0x43de42={'raw':!![],'where':{'id':_0x30ce3b[_0xa1c9('0x47')]['id']}},_0x36c846={};_0x36c846[_0xa1c9('0x31')]=_[_0xa1c9('0x33')](db[_0xa1c9('0x2e')][_0xa1c9('0x2f')]);_0x36c846[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x30ce3b['query']);_0x36c846[_0xa1c9('0x3c')]=_['intersection'](_0x36c846[_0xa1c9('0x31')],_0x36c846['query']);_0x43de42[_0xa1c9('0x34')]=_['intersection'](_0x36c846[_0xa1c9('0x31')],qs[_0xa1c9('0x36')](_0x30ce3b['query'][_0xa1c9('0x36')]));_0x43de42[_0xa1c9('0x34')]=_0x43de42['attributes'][_0xa1c9('0x37')]?_0x43de42[_0xa1c9('0x34')]:_0x36c846[_0xa1c9('0x31')];if(_0x30ce3b[_0xa1c9('0x32')][_0xa1c9('0x43')]){_0x43de42[_0xa1c9('0x44')]=[{'all':!![]}];}_0x43de42=_['merge']({},_0x43de42,_0x30ce3b[_0xa1c9('0x42')]);return db[_0xa1c9('0x2e')][_0xa1c9('0x48')](_0x43de42)[_0xa1c9('0x27')](handleEntityNotFound(_0x102a33,null))[_0xa1c9('0x27')](respondWithResult(_0x102a33,null))['catch'](handleError(_0x102a33,null));};exports['create']=function(_0x4cf00a,_0x15329c){return db[_0xa1c9('0x2e')][_0xa1c9('0x49')](_0x4cf00a['body'],{})[_0xa1c9('0x27')](respondWithResult(_0x15329c,0xc9))[_0xa1c9('0x46')](handleError(_0x15329c,null));};exports['update']=function(_0x43ee79,_0x4bdf5d){if(_0x43ee79['body']['id']){delete _0x43ee79[_0xa1c9('0x4a')]['id'];}return db[_0xa1c9('0x2e')][_0xa1c9('0x48')]({'where':{'id':_0x43ee79[_0xa1c9('0x47')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x4bdf5d,null))[_0xa1c9('0x27')](saveUpdates(_0x43ee79[_0xa1c9('0x4a')],null))[_0xa1c9('0x27')](respondWithResult(_0x4bdf5d,null))[_0xa1c9('0x46')](handleError(_0x4bdf5d,null));};exports[_0xa1c9('0x28')]=function(_0x2b2065,_0x1bed85){return db[_0xa1c9('0x2e')][_0xa1c9('0x48')]({'where':{'id':_0x2b2065[_0xa1c9('0x47')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x1bed85,null))[_0xa1c9('0x27')](removeEntity(_0x1bed85,null))[_0xa1c9('0x46')](handleError(_0x1bed85,null));};exports[_0xa1c9('0x4b')]=function(_0x4a968e,_0x55dc05){return db[_0xa1c9('0x2e')][_0xa1c9('0x4b')]()[_0xa1c9('0x27')](respondWithResult(_0x55dc05,null))[_0xa1c9('0x46')](handleError(_0x55dc05,null));}; \ No newline at end of file +var _0x4b17=['save','update','then','destroy','end','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','describe','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','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply'];(function(_0x47fb0b,_0x55474f){var _0x4c265a=function(_0x58c085){while(--_0x58c085){_0x47fb0b['push'](_0x47fb0b['shift']());}};_0x4c265a(++_0x55474f);}(_0x4b17,0x10f));var _0x74b1=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0x4b17[_0x2085f3];return _0x384e3c;};'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'];function respondWithStatusCode(_0x5cfe85,_0x5f2865){_0x5f2865=_0x5f2865||0xcc;return function(_0x239d04){if(_0x239d04){return _0x5cfe85[_0x74b1('0x17')](_0x5f2865);}return _0x5cfe85['status'](_0x5f2865)['end']();};}function respondWithResult(_0x500ce2,_0x86390){_0x86390=_0x86390||0xc8;return function(_0x5c12eb){if(_0x5c12eb){return _0x500ce2['status'](_0x86390)[_0x74b1('0x18')](_0x5c12eb);}};}function respondWithFilteredResult(_0x12a2c0,_0x3779c5){return function(_0x420662){if(_0x420662){var _0x16b147=typeof _0x3779c5[_0x74b1('0x19')]==='undefined'&&typeof _0x3779c5[_0x74b1('0x1a')]===_0x74b1('0x1b');var _0x1a0851=_0x420662[_0x74b1('0x1c')];var _0xde2736=_0x16b147?0x0:_0x3779c5[_0x74b1('0x19')];var _0x1ab838=_0x16b147?_0x420662['count']:_0x3779c5[_0x74b1('0x19')]+_0x3779c5[_0x74b1('0x1a')];var _0x524ece;if(_0x1ab838>=_0x1a0851){_0x1ab838=_0x1a0851;_0x524ece=0xc8;}else{_0x524ece=0xce;}_0x12a2c0[_0x74b1('0x1d')](_0x524ece);return _0x12a2c0[_0x74b1('0x1e')](_0x74b1('0x1f'),_0xde2736+'-'+_0x1ab838+'/'+_0x1a0851)[_0x74b1('0x18')](_0x420662);}return null;};}function patchUpdates(_0x13bb44){return function(_0x33fee9){try{jsonpatch[_0x74b1('0x20')](_0x33fee9,_0x13bb44,!![]);}catch(_0xaac5f7){return BPromise['reject'](_0xaac5f7);}return _0x33fee9[_0x74b1('0x21')]();};}function saveUpdates(_0x4f1ec9,_0x5da0f7){return function(_0x481bf2){if(_0x481bf2){return _0x481bf2[_0x74b1('0x22')](_0x4f1ec9)[_0x74b1('0x23')](function(_0x405a22){return _0x405a22;});}return null;};}function removeEntity(_0x44bf7e,_0x563781){return function(_0x4ee88b){if(_0x4ee88b){return _0x4ee88b[_0x74b1('0x24')]()['then'](function(){_0x44bf7e[_0x74b1('0x1d')](0xcc)[_0x74b1('0x25')]();});}};}function handleEntityNotFound(_0xb5af0,_0x14a651){return function(_0x3239d8){if(!_0x3239d8){_0xb5af0[_0x74b1('0x17')](0x194);}return _0x3239d8;};}function handleError(_0x115918,_0x33fa8e){_0x33fa8e=_0x33fa8e||0x1f4;return function(_0x4c7f05){logger[_0x74b1('0x26')](_0x4c7f05[_0x74b1('0x27')]);if(_0x4c7f05[_0x74b1('0x28')]){delete _0x4c7f05['name'];}_0x115918[_0x74b1('0x1d')](_0x33fa8e)[_0x74b1('0x29')](_0x4c7f05);};}exports[_0x74b1('0x2a')]=function(_0x1b011a,_0x26d9f1){var _0x273ff1={},_0x436eda={},_0x3ce043={'count':0x0,'rows':[]};var _0x4fbe3d=_[_0x74b1('0x2b')](db[_0x74b1('0x2c')]['rawAttributes'],function(_0x543b5){return{'name':_0x543b5[_0x74b1('0x2d')],'type':_0x543b5[_0x74b1('0x2e')]['key']};});_0x436eda[_0x74b1('0x2f')]=_[_0x74b1('0x2b')](_0x4fbe3d,'name');_0x436eda[_0x74b1('0x30')]=_[_0x74b1('0x31')](_0x1b011a[_0x74b1('0x30')]);_0x436eda[_0x74b1('0x32')]=_[_0x74b1('0x33')](_0x436eda[_0x74b1('0x2f')],_0x436eda[_0x74b1('0x30')]);_0x273ff1[_0x74b1('0x34')]=_['intersection'](_0x436eda[_0x74b1('0x2f')],qs['fields'](_0x1b011a['query'][_0x74b1('0x35')]));_0x273ff1['attributes']=_0x273ff1['attributes'][_0x74b1('0x36')]?_0x273ff1[_0x74b1('0x34')]:_0x436eda[_0x74b1('0x2f')];if(!_0x1b011a[_0x74b1('0x30')][_0x74b1('0x37')](_0x74b1('0x38'))){_0x273ff1[_0x74b1('0x1a')]=qs[_0x74b1('0x1a')](_0x1b011a['query']['limit']);_0x273ff1['offset']=qs[_0x74b1('0x19')](_0x1b011a['query']['offset']);}_0x273ff1[_0x74b1('0x39')]=qs[_0x74b1('0x3a')](_0x1b011a[_0x74b1('0x30')]['sort']);_0x273ff1[_0x74b1('0x3b')]=qs['filters'](_[_0x74b1('0x3c')](_0x1b011a[_0x74b1('0x30')],_0x436eda['filters']),_0x4fbe3d);if(_0x1b011a['query'][_0x74b1('0x3d')]){_0x273ff1[_0x74b1('0x3b')]=_['merge'](_0x273ff1['where'],{'$or':_[_0x74b1('0x2b')](_0x4fbe3d,function(_0x5298f6){if(_0x5298f6[_0x74b1('0x2e')]!==_0x74b1('0x3e')){var _0x15e695={};_0x15e695[_0x5298f6[_0x74b1('0x28')]]={'$like':'%'+_0x1b011a[_0x74b1('0x30')]['filter']+'%'};return _0x15e695;}})});}_0x273ff1=_[_0x74b1('0x3f')]({},_0x273ff1,_0x1b011a['options']);var _0x41a78b={'where':_0x273ff1['where']};return db[_0x74b1('0x2c')]['count'](_0x41a78b)['then'](function(_0xcdb873){_0x3ce043[_0x74b1('0x1c')]=_0xcdb873;if(_0x1b011a[_0x74b1('0x30')]['includeAll']){_0x273ff1[_0x74b1('0x40')]=[{'all':!![]}];}return db[_0x74b1('0x2c')][_0x74b1('0x41')](_0x273ff1);})['then'](function(_0xfecdc){_0x3ce043[_0x74b1('0x42')]=_0xfecdc;return _0x3ce043;})['then'](respondWithFilteredResult(_0x26d9f1,_0x273ff1))['catch'](handleError(_0x26d9f1,null));};exports[_0x74b1('0x43')]=function(_0x2dcaf6,_0x416c8d){var _0x444870={'raw':!![],'where':{'id':_0x2dcaf6[_0x74b1('0x44')]['id']}},_0x1d9f5b={};_0x1d9f5b[_0x74b1('0x2f')]=_['keys'](db[_0x74b1('0x2c')][_0x74b1('0x45')]);_0x1d9f5b[_0x74b1('0x30')]=_[_0x74b1('0x31')](_0x2dcaf6[_0x74b1('0x30')]);_0x1d9f5b['filters']=_[_0x74b1('0x33')](_0x1d9f5b[_0x74b1('0x2f')],_0x1d9f5b['query']);_0x444870['attributes']=_[_0x74b1('0x33')](_0x1d9f5b[_0x74b1('0x2f')],qs['fields'](_0x2dcaf6[_0x74b1('0x30')][_0x74b1('0x35')]));_0x444870[_0x74b1('0x34')]=_0x444870[_0x74b1('0x34')][_0x74b1('0x36')]?_0x444870[_0x74b1('0x34')]:_0x1d9f5b[_0x74b1('0x2f')];if(_0x2dcaf6['query']['includeAll']){_0x444870['include']=[{'all':!![]}];}_0x444870=_[_0x74b1('0x3f')]({},_0x444870,_0x2dcaf6[_0x74b1('0x46')]);return db[_0x74b1('0x2c')][_0x74b1('0x47')](_0x444870)[_0x74b1('0x23')](handleEntityNotFound(_0x416c8d,null))['then'](respondWithResult(_0x416c8d,null))[_0x74b1('0x48')](handleError(_0x416c8d,null));};exports[_0x74b1('0x49')]=function(_0x18687c,_0x33c215){return db[_0x74b1('0x2c')][_0x74b1('0x49')](_0x18687c[_0x74b1('0x4a')],{})[_0x74b1('0x23')](respondWithResult(_0x33c215,0xc9))[_0x74b1('0x48')](handleError(_0x33c215,null));};exports[_0x74b1('0x22')]=function(_0x186516,_0x3038f9){if(_0x186516['body']['id']){delete _0x186516[_0x74b1('0x4a')]['id'];}return db[_0x74b1('0x2c')]['find']({'where':{'id':_0x186516[_0x74b1('0x44')]['id']}})['then'](handleEntityNotFound(_0x3038f9,null))[_0x74b1('0x23')](saveUpdates(_0x186516[_0x74b1('0x4a')],null))['then'](respondWithResult(_0x3038f9,null))[_0x74b1('0x48')](handleError(_0x3038f9,null));};exports[_0x74b1('0x24')]=function(_0x326b98,_0x549f03){return db[_0x74b1('0x2c')][_0x74b1('0x47')]({'where':{'id':_0x326b98[_0x74b1('0x44')]['id']}})[_0x74b1('0x23')](handleEntityNotFound(_0x549f03,null))[_0x74b1('0x23')](removeEntity(_0x549f03,null))['catch'](handleError(_0x549f03,null));};exports[_0x74b1('0x4b')]=function(_0x594411,_0x11bfca){return db[_0x74b1('0x2c')]['describe']()[_0x74b1('0x23')](respondWithResult(_0x11bfca,null))[_0x74b1('0x48')](handleError(_0x11bfca,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 4e9719c..ba307cc 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 _0x2194=['util','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2194,0xe4));var _0x4219=function(_0x2f227c,_0x360c3a){_0x2f227c=_0x2f227c-0x0;var _0x5032bc=_0x2194[_0x2f227c];return _0x5032bc;};'use strict';var _=require('lodash');var util=require(_0x4219('0x0'));var logger=require('../../config/logger')(_0x4219('0x1'));var moment=require(_0x4219('0x2'));var BPromise=require('bluebird');var rp=require(_0x4219('0x3'));var fs=require('fs');var path=require(_0x4219('0x4'));var rimraf=require(_0x4219('0x5'));var config=require(_0x4219('0x6'));var attributes=require(_0x4219('0x7'));module[_0x4219('0x8')]=function(_0x2f182f,_0x12d086){return _0x2f182f[_0x4219('0x9')]('WhatsappQueueReport',attributes,{'tableName':_0x4219('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x4219('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbec9=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x4f4d73,_0x30cde2){var _0x1334ca=function(_0x311e48){while(--_0x311e48){_0x4f4d73['push'](_0x4f4d73['shift']());}};_0x1334ca(++_0x30cde2);}(_0xbec9,0xdd));var _0x9bec=function(_0x55701c,_0x34306e){_0x55701c=_0x55701c-0x0;var _0x5a4e9b=_0xbec9[_0x55701c];return _0x5a4e9b;};'use strict';var _=require(_0x9bec('0x0'));var util=require('util');var logger=require(_0x9bec('0x1'))(_0x9bec('0x2'));var moment=require(_0x9bec('0x3'));var BPromise=require(_0x9bec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9bec('0x5'));var rimraf=require(_0x9bec('0x6'));var config=require(_0x9bec('0x7'));var attributes=require(_0x9bec('0x8'));module[_0x9bec('0x9')]=function(_0x5ef69c,_0x3bf6d1){return _0x5ef69c[_0x9bec('0xa')](_0x9bec('0xb'),attributes,{'tableName':_0x9bec('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 8bf8906..c3fd2d7 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 _0xb669=['CreateWhatsappQueueReport','catch','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','WhatsappQueueReport','create','body','options','raw'];(function(_0x4e9eb6,_0xfd09cb){var _0x1e69a0=function(_0x5a5953){while(--_0x5a5953){_0x4e9eb6['push'](_0x4e9eb6['shift']());}};_0x1e69a0(++_0xfd09cb);}(_0xb669,0x171));var _0x9b66=function(_0x30aa48,_0x5cf0c9){_0x30aa48=_0x30aa48-0x0;var _0x35fc1f=_0xb669[_0x30aa48];return _0x35fc1f;};'use strict';var _=require(_0x9b66('0x0'));var util=require(_0x9b66('0x1'));var moment=require(_0x9b66('0x2'));var BPromise=require('bluebird');var rs=require(_0x9b66('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b66('0x4'))['db'];var utils=require(_0x9b66('0x5'));var logger=require(_0x9b66('0x6'))('rpc');var config=require(_0x9b66('0x7'));var jayson=require(_0x9b66('0x8'));var client=jayson[_0x9b66('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1df631,_0x4b5383,_0x211067){return new BPromise(function(_0x4ab1bf,_0x27bc06){return client[_0x9b66('0xa')](_0x1df631,_0x211067)[_0x9b66('0xb')](function(_0x2a2302){logger[_0x9b66('0xc')](_0x9b66('0xd'),_0x4b5383,_0x9b66('0xe'));logger[_0x9b66('0xf')](_0x9b66('0x10'),_0x4b5383,_0x9b66('0xe'),JSON[_0x9b66('0x11')](_0x2a2302));if(_0x2a2302[_0x9b66('0x12')]){if(_0x2a2302[_0x9b66('0x12')][_0x9b66('0x13')]===0x1f4){logger[_0x9b66('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4b5383,_0x2a2302['error'][_0x9b66('0x14')]);return _0x27bc06(_0x2a2302[_0x9b66('0x12')]['message']);}logger[_0x9b66('0x12')](_0x9b66('0xd'),_0x4b5383,_0x2a2302[_0x9b66('0x12')][_0x9b66('0x14')]);return _0x4ab1bf(_0x2a2302[_0x9b66('0x12')][_0x9b66('0x14')]);}else{logger['info'](_0x9b66('0xd'),_0x4b5383,'request\x20sent');_0x4ab1bf(_0x2a2302[_0x9b66('0x15')][_0x9b66('0x14')]);}})['catch'](function(_0xa21e45){logger[_0x9b66('0x12')](_0x9b66('0xd'),_0x4b5383,_0xa21e45);_0x27bc06(_0xa21e45);});});}exports['CreateWhatsappQueueReport']=function(_0x4fddf5){var _0x331cee=this;return new Promise(function(_0x49fe58,_0x46bbc8){return db[_0x9b66('0x16')][_0x9b66('0x17')](_0x4fddf5[_0x9b66('0x18')],{'raw':_0x4fddf5[_0x9b66('0x19')]?_0x4fddf5['options'][_0x9b66('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x2dd51e){logger[_0x9b66('0xc')]('CreateWhatsappQueueReport',_0x4fddf5);logger[_0x9b66('0xf')](_0x9b66('0x1b'),_0x4fddf5,JSON[_0x9b66('0x11')](_0x2dd51e));_0x49fe58(_0x2dd51e);})[_0x9b66('0x1c')](function(_0x3f8bd0){logger['error'](_0x9b66('0x1b'),_0x3f8bd0[_0x9b66('0x14')],_0x4fddf5);_0x46bbc8(_0x331cee[_0x9b66('0x12')](0x1f4,_0x3f8bd0[_0x9b66('0x14')]));});});};exports['UpdateWhatsappQueueReport']=function(_0xb12316){var _0x2654b8=this;return new Promise(function(_0x140070,_0x577699){return db[_0x9b66('0x16')]['update'](_0xb12316[_0x9b66('0x18')],{'raw':_0xb12316[_0x9b66('0x19')]?_0xb12316[_0x9b66('0x19')][_0x9b66('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb12316['options']?_0xb12316['options'][_0x9b66('0x1d')]||null:null,'attributes':_0xb12316[_0x9b66('0x19')]?_0xb12316[_0x9b66('0x19')][_0x9b66('0x1e')]||null:null,'limit':_0xb12316['options']?_0xb12316[_0x9b66('0x19')][_0x9b66('0x1f')]||null:null})['then'](function(_0x33ee63){logger[_0x9b66('0xc')]('UpdateWhatsappQueueReport',_0xb12316);logger[_0x9b66('0xf')](_0x9b66('0x20'),_0xb12316,JSON[_0x9b66('0x11')](_0x33ee63));_0x140070(_0x33ee63);})[_0x9b66('0x1c')](function(_0x38b5fa){logger[_0x9b66('0x12')](_0x9b66('0x20'),_0x38b5fa[_0x9b66('0x14')],_0xb12316);_0x577699(_0x2654b8[_0x9b66('0x12')](0x1f4,_0x38b5fa[_0x9b66('0x14')]));});});}; \ No newline at end of file +var _0xb012=['CreateWhatsappQueueReport','WhatsappQueueReport','create','raw','update','body','options','where','attributes','limit','UpdateWhatsappQueueReport','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x406b09,_0x307386){var _0xbf314=function(_0x2aafaf){while(--_0x2aafaf){_0x406b09['push'](_0x406b09['shift']());}};_0xbf314(++_0x307386);}(_0xb012,0x124));var _0x2b01=function(_0xa40c45,_0x25917f){_0xa40c45=_0xa40c45-0x0;var _0x198278=_0xb012[_0xa40c45];return _0x198278;};'use strict';var _=require(_0x2b01('0x0'));var util=require(_0x2b01('0x1'));var moment=require(_0x2b01('0x2'));var BPromise=require(_0x2b01('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b01('0x4'))['db'];var utils=require(_0x2b01('0x5'));var logger=require(_0x2b01('0x6'))(_0x2b01('0x7'));var config=require(_0x2b01('0x8'));var jayson=require(_0x2b01('0x9'));var client=jayson[_0x2b01('0xa')][_0x2b01('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c046d,_0x2ed607,_0x293491){return new BPromise(function(_0x405c0b,_0x478c77){return client['request'](_0x4c046d,_0x293491)[_0x2b01('0xc')](function(_0x4c6ab8){logger[_0x2b01('0xd')](_0x2b01('0xe'),_0x2ed607,'request\x20sent');logger[_0x2b01('0xf')](_0x2b01('0x10'),_0x2ed607,_0x2b01('0x11'),JSON['stringify'](_0x4c6ab8));if(_0x4c6ab8[_0x2b01('0x12')]){if(_0x4c6ab8['error'][_0x2b01('0x13')]===0x1f4){logger[_0x2b01('0x12')](_0x2b01('0xe'),_0x2ed607,_0x4c6ab8['error']['message']);return _0x478c77(_0x4c6ab8[_0x2b01('0x12')][_0x2b01('0x14')]);}logger[_0x2b01('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2ed607,_0x4c6ab8['error'][_0x2b01('0x14')]);return _0x405c0b(_0x4c6ab8['error'][_0x2b01('0x14')]);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x2ed607,_0x2b01('0x11'));_0x405c0b(_0x4c6ab8[_0x2b01('0x15')][_0x2b01('0x14')]);}})[_0x2b01('0x16')](function(_0x368082){logger[_0x2b01('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2ed607,_0x368082);_0x478c77(_0x368082);});});}exports[_0x2b01('0x17')]=function(_0x466e0d){var _0x4da0e7=this;return new Promise(function(_0x46befd,_0x595934){return db[_0x2b01('0x18')][_0x2b01('0x19')](_0x466e0d['body'],{'raw':_0x466e0d['options']?_0x466e0d['options'][_0x2b01('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x194248){logger[_0x2b01('0xd')](_0x2b01('0x17'),_0x466e0d);logger['debug'](_0x2b01('0x17'),_0x466e0d,JSON['stringify'](_0x194248));_0x46befd(_0x194248);})[_0x2b01('0x16')](function(_0x488514){logger[_0x2b01('0x12')](_0x2b01('0x17'),_0x488514[_0x2b01('0x14')],_0x466e0d);_0x595934(_0x4da0e7[_0x2b01('0x12')](0x1f4,_0x488514[_0x2b01('0x14')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x5c0f84){var _0x4cff38=this;return new Promise(function(_0x531744,_0x468f85){return db[_0x2b01('0x18')][_0x2b01('0x1b')](_0x5c0f84[_0x2b01('0x1c')],{'raw':_0x5c0f84[_0x2b01('0x1d')]?_0x5c0f84[_0x2b01('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c0f84[_0x2b01('0x1d')]?_0x5c0f84[_0x2b01('0x1d')][_0x2b01('0x1e')]||null:null,'attributes':_0x5c0f84[_0x2b01('0x1d')]?_0x5c0f84[_0x2b01('0x1d')][_0x2b01('0x1f')]||null:null,'limit':_0x5c0f84['options']?_0x5c0f84[_0x2b01('0x1d')][_0x2b01('0x20')]||null:null})[_0x2b01('0xc')](function(_0x149d3f){logger['info'](_0x2b01('0x21'),_0x5c0f84);logger[_0x2b01('0xf')](_0x2b01('0x21'),_0x5c0f84,JSON[_0x2b01('0x22')](_0x149d3f));_0x531744(_0x149d3f);})[_0x2b01('0x16')](function(_0x31e249){logger['error'](_0x2b01('0x21'),_0x31e249[_0x2b01('0x14')],_0x5c0f84);_0x468f85(_0x4cff38[_0x2b01('0x12')](0x1f4,_0x31e249[_0x2b01('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 406ba7c..2845290 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 _0x446b=['util','path','express','Router','fs-extra','../../components/auth/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x156e05,_0x5a89da){var _0x545dbe=function(_0x4cbf02){while(--_0x4cbf02){_0x156e05['push'](_0x156e05['shift']());}};_0x545dbe(++_0x5a89da);}(_0x446b,0x1b8));var _0xb446=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x446b[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0xb446('0x0'));var util=require(_0xb446('0x1'));var path=require(_0xb446('0x2'));var timeout=require('connect-timeout');var express=require(_0xb446('0x3'));var router=express[_0xb446('0x4')]();var fs_extra=require(_0xb446('0x5'));var auth=require(_0xb446('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb446('0x7'));router[_0xb446('0x8')]('/',auth[_0xb446('0x9')](),controller[_0xb446('0xa')]);router[_0xb446('0x8')](_0xb446('0xb'),auth[_0xb446('0x9')](),controller[_0xb446('0xc')]);router[_0xb446('0x8')](_0xb446('0xd'),auth[_0xb446('0x9')](),controller[_0xb446('0xe')]);router[_0xb446('0xf')]('/',auth[_0xb446('0x9')](),controller['create']);router[_0xb446('0x10')](_0xb446('0xd'),auth[_0xb446('0x9')](),controller[_0xb446('0x11')]);router[_0xb446('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb446('0x13')]);module[_0xb446('0x14')]=router; \ No newline at end of file +var _0x7c7f=['post','create','put','update','delete','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x5a777a,_0xf3785d){var _0x2fcdb5=function(_0x1b3c2e){while(--_0x1b3c2e){_0x5a777a['push'](_0x5a777a['shift']());}};_0x2fcdb5(++_0xf3785d);}(_0x7c7f,0x123));var _0xf7c7=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x7c7f[_0x1c8c28];return _0x1f59b4;};'use strict';var multer=require('multer');var util=require(_0xf7c7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf7c7('0x1'));var router=express['Router']();var fs_extra=require(_0xf7c7('0x2'));var auth=require(_0xf7c7('0x3'));var interaction=require(_0xf7c7('0x4'));var config=require(_0xf7c7('0x5'));var controller=require(_0xf7c7('0x6'));router[_0xf7c7('0x7')]('/',auth[_0xf7c7('0x8')](),controller['index']);router[_0xf7c7('0x7')](_0xf7c7('0x9'),auth[_0xf7c7('0x8')](),controller[_0xf7c7('0xa')]);router[_0xf7c7('0x7')](_0xf7c7('0xb'),auth[_0xf7c7('0x8')](),controller[_0xf7c7('0xc')]);router[_0xf7c7('0xd')]('/',auth[_0xf7c7('0x8')](),controller[_0xf7c7('0xe')]);router[_0xf7c7('0xf')](_0xf7c7('0xb'),auth[_0xf7c7('0x8')](),controller[_0xf7c7('0x10')]);router[_0xf7c7('0x11')](_0xf7c7('0xb'),auth[_0xf7c7('0x8')](),controller['destroy']);module[_0xf7c7('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 2823cac..77e0b42 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7292=['ENUM','account','agent','queue','sequelize','exports','STRING'];(function(_0x492535,_0x46524a){var _0x256620=function(_0x3015f8){while(--_0x3015f8){_0x492535['push'](_0x492535['shift']());}};_0x256620(++_0x46524a);}(_0x7292,0x107));var _0x2729=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x7292[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0x2729('0x0'));module[_0x2729('0x1')]={'uniqueid':{'type':Sequelize[_0x2729('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2729('0x3')](_0x2729('0x4'),_0x2729('0x5'),_0x2729('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x3276=['DATE','sequelize','ENUM','account','agent','queue'];(function(_0x1d1da3,_0x387863){var _0x4ea3b1=function(_0x4ee207){while(--_0x4ee207){_0x1d1da3['push'](_0x1d1da3['shift']());}};_0x4ea3b1(++_0x387863);}(_0x3276,0xc7));var _0x6327=function(_0x452c6e,_0x4d6d80){_0x452c6e=_0x452c6e-0x0;var _0x4c2364=_0x3276[_0x452c6e];return _0x4c2364;};'use strict';var Sequelize=require(_0x6327('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6327('0x1')](_0x6327('0x2'),_0x6327('0x3'),_0x6327('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x6327('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 19d03e3..200b538 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 _0x9cab=['name','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','WhatsappTransferReport','include','findAll','rows','catch','show','includeAll','create','update','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','key'];(function(_0x431c26,_0x4b8f47){var _0x3092fd=function(_0x4dca59){while(--_0x4dca59){_0x431c26['push'](_0x431c26['shift']());}};_0x3092fd(++_0x4b8f47);}(_0x9cab,0x1e7));var _0xb9ca=function(_0x1f3e1f,_0x41bae1){_0x1f3e1f=_0x1f3e1f-0x0;var _0x5f51e8=_0x9cab[_0x1f3e1f];return _0x5f51e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9ca('0x0'));var zipdir=require(_0xb9ca('0x1'));var jsonpatch=require(_0xb9ca('0x2'));var rp=require(_0xb9ca('0x3'));var moment=require(_0xb9ca('0x4'));var BPromise=require(_0xb9ca('0x5'));var Mustache=require('mustache');var util=require(_0xb9ca('0x6'));var path=require(_0xb9ca('0x7'));var sox=require('sox');var csv=require(_0xb9ca('0x8'));var ejs=require(_0xb9ca('0x9'));var fs=require('fs');var fs_extra=require(_0xb9ca('0xa'));var _=require(_0xb9ca('0xb'));var squel=require(_0xb9ca('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb9ca('0xd'));var toCsv=require(_0xb9ca('0x8'));var querystring=require(_0xb9ca('0xe'));var Papa=require(_0xb9ca('0xf'));var Redis=require('ioredis');var authService=require(_0xb9ca('0x10'));var qs=require(_0xb9ca('0x11'));var as=require(_0xb9ca('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9ca('0x13'))(_0xb9ca('0x14'));var utils=require('../../config/utils');var config=require(_0xb9ca('0x15'));var licenseUtil=require(_0xb9ca('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd11dc9,_0x5125bc){_0x5125bc=_0x5125bc||0xcc;return function(_0x17bb09){if(_0x17bb09){return _0xd11dc9[_0xb9ca('0x17')](_0x5125bc);}return _0xd11dc9['status'](_0x5125bc)[_0xb9ca('0x18')]();};}function respondWithResult(_0x4619af,_0x1e7c82){_0x1e7c82=_0x1e7c82||0xc8;return function(_0x3e0156){if(_0x3e0156){return _0x4619af[_0xb9ca('0x19')](_0x1e7c82)[_0xb9ca('0x1a')](_0x3e0156);}};}function respondWithFilteredResult(_0x3dd1c8,_0x13b178){return function(_0x556f62){if(_0x556f62){var _0x51f7e0=typeof _0x13b178[_0xb9ca('0x1b')]===_0xb9ca('0x1c')&&typeof _0x13b178[_0xb9ca('0x1d')]===_0xb9ca('0x1c');var _0xf4e7ac=_0x556f62[_0xb9ca('0x1e')];var _0x4f45e5=_0x51f7e0?0x0:_0x13b178['offset'];var _0x502ee2=_0x51f7e0?_0x556f62[_0xb9ca('0x1e')]:_0x13b178[_0xb9ca('0x1b')]+_0x13b178[_0xb9ca('0x1d')];var _0x499a73;if(_0x502ee2>=_0xf4e7ac){_0x502ee2=_0xf4e7ac;_0x499a73=0xc8;}else{_0x499a73=0xce;}_0x3dd1c8[_0xb9ca('0x19')](_0x499a73);return _0x3dd1c8[_0xb9ca('0x1f')](_0xb9ca('0x20'),_0x4f45e5+'-'+_0x502ee2+'/'+_0xf4e7ac)[_0xb9ca('0x1a')](_0x556f62);}return null;};}function patchUpdates(_0x209ac5){return function(_0x5135e7){try{jsonpatch['apply'](_0x5135e7,_0x209ac5,!![]);}catch(_0x1c6349){return BPromise[_0xb9ca('0x21')](_0x1c6349);}return _0x5135e7[_0xb9ca('0x22')]();};}function saveUpdates(_0x4ae27a,_0x5156f3){return function(_0x1e9427){if(_0x1e9427){return _0x1e9427['update'](_0x4ae27a)[_0xb9ca('0x23')](function(_0x139d40){return _0x139d40;});}return null;};}function removeEntity(_0x414afe,_0x2f8fce){return function(_0x40779e){if(_0x40779e){return _0x40779e[_0xb9ca('0x24')]()[_0xb9ca('0x23')](function(){_0x414afe[_0xb9ca('0x19')](0xcc)[_0xb9ca('0x18')]();});}};}function handleEntityNotFound(_0xdfc6eb,_0x43db30){return function(_0x5991b4){if(!_0x5991b4){_0xdfc6eb[_0xb9ca('0x17')](0x194);}return _0x5991b4;};}function handleError(_0x26ed4b,_0x42e81a){_0x42e81a=_0x42e81a||0x1f4;return function(_0x3e69b0){logger[_0xb9ca('0x25')](_0x3e69b0[_0xb9ca('0x26')]);if(_0x3e69b0['name']){delete _0x3e69b0['name'];}_0x26ed4b[_0xb9ca('0x19')](_0x42e81a)[_0xb9ca('0x27')](_0x3e69b0);};}exports[_0xb9ca('0x28')]=function(_0x3f2474,_0x5a983e){var _0x2bf5bd={},_0x39c916={},_0x14aeb8={'count':0x0,'rows':[]};var _0x5e1e28=_[_0xb9ca('0x29')](db['WhatsappTransferReport'][_0xb9ca('0x2a')],function(_0x25a5cd){return{'name':_0x25a5cd[_0xb9ca('0x2b')],'type':_0x25a5cd['type'][_0xb9ca('0x2c')]};});_0x39c916['model']=_[_0xb9ca('0x29')](_0x5e1e28,_0xb9ca('0x2d'));_0x39c916[_0xb9ca('0x2e')]=_[_0xb9ca('0x2f')](_0x3f2474[_0xb9ca('0x2e')]);_0x39c916[_0xb9ca('0x30')]=_[_0xb9ca('0x31')](_0x39c916['model'],_0x39c916[_0xb9ca('0x2e')]);_0x2bf5bd[_0xb9ca('0x32')]=_['intersection'](_0x39c916[_0xb9ca('0x33')],qs[_0xb9ca('0x34')](_0x3f2474[_0xb9ca('0x2e')][_0xb9ca('0x34')]));_0x2bf5bd[_0xb9ca('0x32')]=_0x2bf5bd['attributes'][_0xb9ca('0x35')]?_0x2bf5bd[_0xb9ca('0x32')]:_0x39c916['model'];if(!_0x3f2474[_0xb9ca('0x2e')]['hasOwnProperty'](_0xb9ca('0x36'))){_0x2bf5bd['limit']=qs[_0xb9ca('0x1d')](_0x3f2474[_0xb9ca('0x2e')][_0xb9ca('0x1d')]);_0x2bf5bd[_0xb9ca('0x1b')]=qs[_0xb9ca('0x1b')](_0x3f2474[_0xb9ca('0x2e')][_0xb9ca('0x1b')]);}_0x2bf5bd[_0xb9ca('0x37')]=qs['sort'](_0x3f2474[_0xb9ca('0x2e')][_0xb9ca('0x38')]);_0x2bf5bd[_0xb9ca('0x39')]=qs[_0xb9ca('0x30')](_['pick'](_0x3f2474[_0xb9ca('0x2e')],_0x39c916[_0xb9ca('0x30')]),_0x5e1e28);if(_0x3f2474[_0xb9ca('0x2e')][_0xb9ca('0x3a')]){_0x2bf5bd[_0xb9ca('0x39')]=_['merge'](_0x2bf5bd[_0xb9ca('0x39')],{'$or':_[_0xb9ca('0x29')](_0x5e1e28,function(_0xdcde75){if(_0xdcde75[_0xb9ca('0x3b')]!==_0xb9ca('0x3c')){var _0x35c059={};_0x35c059[_0xdcde75[_0xb9ca('0x2d')]]={'$like':'%'+_0x3f2474[_0xb9ca('0x2e')][_0xb9ca('0x3a')]+'%'};return _0x35c059;}})});}_0x2bf5bd=_[_0xb9ca('0x3d')]({},_0x2bf5bd,_0x3f2474[_0xb9ca('0x3e')]);var _0xb3d549={'where':_0x2bf5bd['where']};return db[_0xb9ca('0x3f')][_0xb9ca('0x1e')](_0xb3d549)['then'](function(_0x3e1986){_0x14aeb8['count']=_0x3e1986;if(_0x3f2474[_0xb9ca('0x2e')]['includeAll']){_0x2bf5bd[_0xb9ca('0x40')]=[{'all':!![]}];}return db[_0xb9ca('0x3f')][_0xb9ca('0x41')](_0x2bf5bd);})['then'](function(_0x30acaf){_0x14aeb8[_0xb9ca('0x42')]=_0x30acaf;return _0x14aeb8;})[_0xb9ca('0x23')](respondWithFilteredResult(_0x5a983e,_0x2bf5bd))[_0xb9ca('0x43')](handleError(_0x5a983e,null));};exports[_0xb9ca('0x44')]=function(_0x42281a,_0x174605){var _0x57a85e={'raw':!![],'where':{'id':_0x42281a['params']['id']}},_0x2c9d1f={};_0x2c9d1f[_0xb9ca('0x33')]=_[_0xb9ca('0x2f')](db[_0xb9ca('0x3f')][_0xb9ca('0x2a')]);_0x2c9d1f['query']=_[_0xb9ca('0x2f')](_0x42281a[_0xb9ca('0x2e')]);_0x2c9d1f[_0xb9ca('0x30')]=_['intersection'](_0x2c9d1f[_0xb9ca('0x33')],_0x2c9d1f[_0xb9ca('0x2e')]);_0x57a85e['attributes']=_[_0xb9ca('0x31')](_0x2c9d1f[_0xb9ca('0x33')],qs[_0xb9ca('0x34')](_0x42281a[_0xb9ca('0x2e')]['fields']));_0x57a85e[_0xb9ca('0x32')]=_0x57a85e[_0xb9ca('0x32')][_0xb9ca('0x35')]?_0x57a85e[_0xb9ca('0x32')]:_0x2c9d1f[_0xb9ca('0x33')];if(_0x42281a['query'][_0xb9ca('0x45')]){_0x57a85e[_0xb9ca('0x40')]=[{'all':!![]}];}_0x57a85e=_[_0xb9ca('0x3d')]({},_0x57a85e,_0x42281a[_0xb9ca('0x3e')]);return db[_0xb9ca('0x3f')]['find'](_0x57a85e)[_0xb9ca('0x23')](handleEntityNotFound(_0x174605,null))[_0xb9ca('0x23')](respondWithResult(_0x174605,null))[_0xb9ca('0x43')](handleError(_0x174605,null));};exports[_0xb9ca('0x46')]=function(_0x7607f7,_0x1fba3a){return db[_0xb9ca('0x3f')]['create'](_0x7607f7['body'],{})[_0xb9ca('0x23')](respondWithResult(_0x1fba3a,0xc9))[_0xb9ca('0x43')](handleError(_0x1fba3a,null));};exports[_0xb9ca('0x47')]=function(_0x10de42,_0x3f1283){if(_0x10de42[_0xb9ca('0x48')]['id']){delete _0x10de42[_0xb9ca('0x48')]['id'];}return db[_0xb9ca('0x3f')][_0xb9ca('0x49')]({'where':{'id':_0x10de42[_0xb9ca('0x4a')]['id']}})[_0xb9ca('0x23')](handleEntityNotFound(_0x3f1283,null))[_0xb9ca('0x23')](saveUpdates(_0x10de42[_0xb9ca('0x48')],null))[_0xb9ca('0x23')](respondWithResult(_0x3f1283,null))[_0xb9ca('0x43')](handleError(_0x3f1283,null));};exports[_0xb9ca('0x24')]=function(_0x211fc8,_0x5a7f32){return db['WhatsappTransferReport'][_0xb9ca('0x49')]({'where':{'id':_0x211fc8['params']['id']}})[_0xb9ca('0x23')](handleEntityNotFound(_0x5a7f32,null))[_0xb9ca('0x23')](removeEntity(_0x5a7f32,null))[_0xb9ca('0x43')](handleError(_0x5a7f32,null));};exports['describe']=function(_0x5e44b1,_0x2c76ed){return db[_0xb9ca('0x3f')][_0xb9ca('0x4b')]()[_0xb9ca('0x23')](respondWithResult(_0x2c76ed,null))[_0xb9ca('0x43')](handleError(_0x2c76ed,null));}; \ No newline at end of file +var _0x2a84=['attributes','fields','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','error','name','index','map','WhatsappTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection'];(function(_0x3cf3ac,_0x4d306b){var _0x21c637=function(_0x42e16f){while(--_0x42e16f){_0x3cf3ac['push'](_0x3cf3ac['shift']());}};_0x21c637(++_0x4d306b);}(_0x2a84,0x170));var _0x42a8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2a84[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x42a8('0x0'));var rimraf=require(_0x42a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42a8('0x2'));var rp=require(_0x42a8('0x3'));var moment=require(_0x42a8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x42a8('0x5'));var util=require('util');var path=require(_0x42a8('0x6'));var sox=require(_0x42a8('0x7'));var csv=require(_0x42a8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x42a8('0x9'));var _=require('lodash');var squel=require(_0x42a8('0xa'));var crypto=require(_0x42a8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x42a8('0xc'));var toCsv=require(_0x42a8('0x8'));var querystring=require('querystring');var Papa=require(_0x42a8('0xd'));var Redis=require(_0x42a8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x42a8('0xf'));var as=require(_0x42a8('0x10'));var hardwareService=require(_0x42a8('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x42a8('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x42a8('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5441d7,_0x25dcb8){_0x25dcb8=_0x25dcb8||0xcc;return function(_0x3133c4){if(_0x3133c4){return _0x5441d7[_0x42a8('0x14')](_0x25dcb8);}return _0x5441d7[_0x42a8('0x15')](_0x25dcb8)[_0x42a8('0x16')]();};}function respondWithResult(_0x2c9a31,_0x26344e){_0x26344e=_0x26344e||0xc8;return function(_0x156205){if(_0x156205){return _0x2c9a31['status'](_0x26344e)['json'](_0x156205);}};}function respondWithFilteredResult(_0x1674db,_0x4198d5){return function(_0x1191a9){if(_0x1191a9){var _0x542543=typeof _0x4198d5[_0x42a8('0x17')]===_0x42a8('0x18')&&typeof _0x4198d5[_0x42a8('0x19')]===_0x42a8('0x18');var _0x3a8f0c=_0x1191a9[_0x42a8('0x1a')];var _0x3ed054=_0x542543?0x0:_0x4198d5[_0x42a8('0x17')];var _0x15105d=_0x542543?_0x1191a9['count']:_0x4198d5['offset']+_0x4198d5['limit'];var _0x37c5ea;if(_0x15105d>=_0x3a8f0c){_0x15105d=_0x3a8f0c;_0x37c5ea=0xc8;}else{_0x37c5ea=0xce;}_0x1674db[_0x42a8('0x15')](_0x37c5ea);return _0x1674db[_0x42a8('0x1b')](_0x42a8('0x1c'),_0x3ed054+'-'+_0x15105d+'/'+_0x3a8f0c)[_0x42a8('0x1d')](_0x1191a9);}return null;};}function patchUpdates(_0x43ca95){return function(_0x178019){try{jsonpatch['apply'](_0x178019,_0x43ca95,!![]);}catch(_0x45d47){return BPromise['reject'](_0x45d47);}return _0x178019['save']();};}function saveUpdates(_0x58f83a,_0x4742ac){return function(_0x3b8729){if(_0x3b8729){return _0x3b8729[_0x42a8('0x1e')](_0x58f83a)['then'](function(_0xf6d137){return _0xf6d137;});}return null;};}function removeEntity(_0x5a600d,_0x537e30){return function(_0x3afff5){if(_0x3afff5){return _0x3afff5[_0x42a8('0x1f')]()[_0x42a8('0x20')](function(){_0x5a600d[_0x42a8('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x69df6b,_0x4aa424){return function(_0x44576f){if(!_0x44576f){_0x69df6b[_0x42a8('0x14')](0x194);}return _0x44576f;};}function handleError(_0x386e82,_0x14a815){_0x14a815=_0x14a815||0x1f4;return function(_0x1906e4){logger[_0x42a8('0x21')](_0x1906e4['stack']);if(_0x1906e4[_0x42a8('0x22')]){delete _0x1906e4['name'];}_0x386e82[_0x42a8('0x15')](_0x14a815)['send'](_0x1906e4);};}exports[_0x42a8('0x23')]=function(_0x30e3f2,_0x3fc979){var _0x18bdfb={},_0x25e880={},_0x43a38e={'count':0x0,'rows':[]};var _0x32067d=_[_0x42a8('0x24')](db[_0x42a8('0x25')][_0x42a8('0x26')],function(_0x1f84c1){return{'name':_0x1f84c1[_0x42a8('0x27')],'type':_0x1f84c1['type'][_0x42a8('0x28')]};});_0x25e880[_0x42a8('0x29')]=_[_0x42a8('0x24')](_0x32067d,_0x42a8('0x22'));_0x25e880[_0x42a8('0x2a')]=_[_0x42a8('0x2b')](_0x30e3f2[_0x42a8('0x2a')]);_0x25e880[_0x42a8('0x2c')]=_[_0x42a8('0x2d')](_0x25e880[_0x42a8('0x29')],_0x25e880['query']);_0x18bdfb[_0x42a8('0x2e')]=_['intersection'](_0x25e880[_0x42a8('0x29')],qs[_0x42a8('0x2f')](_0x30e3f2['query'][_0x42a8('0x2f')]));_0x18bdfb[_0x42a8('0x2e')]=_0x18bdfb[_0x42a8('0x2e')][_0x42a8('0x30')]?_0x18bdfb[_0x42a8('0x2e')]:_0x25e880['model'];if(!_0x30e3f2[_0x42a8('0x2a')][_0x42a8('0x31')]('nolimit')){_0x18bdfb[_0x42a8('0x19')]=qs[_0x42a8('0x19')](_0x30e3f2[_0x42a8('0x2a')]['limit']);_0x18bdfb[_0x42a8('0x17')]=qs['offset'](_0x30e3f2[_0x42a8('0x2a')]['offset']);}_0x18bdfb['order']=qs[_0x42a8('0x32')](_0x30e3f2[_0x42a8('0x2a')][_0x42a8('0x32')]);_0x18bdfb[_0x42a8('0x33')]=qs[_0x42a8('0x2c')](_[_0x42a8('0x34')](_0x30e3f2[_0x42a8('0x2a')],_0x25e880[_0x42a8('0x2c')]),_0x32067d);if(_0x30e3f2['query']['filter']){_0x18bdfb[_0x42a8('0x33')]=_[_0x42a8('0x35')](_0x18bdfb[_0x42a8('0x33')],{'$or':_['map'](_0x32067d,function(_0x287b0e){if(_0x287b0e[_0x42a8('0x36')]!==_0x42a8('0x37')){var _0x493773={};_0x493773[_0x287b0e[_0x42a8('0x22')]]={'$like':'%'+_0x30e3f2[_0x42a8('0x2a')][_0x42a8('0x38')]+'%'};return _0x493773;}})});}_0x18bdfb=_[_0x42a8('0x35')]({},_0x18bdfb,_0x30e3f2[_0x42a8('0x39')]);var _0x551c08={'where':_0x18bdfb[_0x42a8('0x33')]};return db[_0x42a8('0x25')][_0x42a8('0x1a')](_0x551c08)[_0x42a8('0x20')](function(_0x185cf0){_0x43a38e['count']=_0x185cf0;if(_0x30e3f2[_0x42a8('0x2a')][_0x42a8('0x3a')]){_0x18bdfb[_0x42a8('0x3b')]=[{'all':!![]}];}return db[_0x42a8('0x25')][_0x42a8('0x3c')](_0x18bdfb);})['then'](function(_0x1ee511){_0x43a38e[_0x42a8('0x3d')]=_0x1ee511;return _0x43a38e;})[_0x42a8('0x20')](respondWithFilteredResult(_0x3fc979,_0x18bdfb))[_0x42a8('0x3e')](handleError(_0x3fc979,null));};exports[_0x42a8('0x3f')]=function(_0x33226e,_0xa1c99c){var _0x32fa38={'raw':!![],'where':{'id':_0x33226e[_0x42a8('0x40')]['id']}},_0x4856f2={};_0x4856f2['model']=_['keys'](db['WhatsappTransferReport']['rawAttributes']);_0x4856f2[_0x42a8('0x2a')]=_[_0x42a8('0x2b')](_0x33226e['query']);_0x4856f2[_0x42a8('0x2c')]=_[_0x42a8('0x2d')](_0x4856f2[_0x42a8('0x29')],_0x4856f2[_0x42a8('0x2a')]);_0x32fa38['attributes']=_[_0x42a8('0x2d')](_0x4856f2[_0x42a8('0x29')],qs[_0x42a8('0x2f')](_0x33226e[_0x42a8('0x2a')][_0x42a8('0x2f')]));_0x32fa38['attributes']=_0x32fa38[_0x42a8('0x2e')][_0x42a8('0x30')]?_0x32fa38[_0x42a8('0x2e')]:_0x4856f2[_0x42a8('0x29')];if(_0x33226e[_0x42a8('0x2a')][_0x42a8('0x3a')]){_0x32fa38['include']=[{'all':!![]}];}_0x32fa38=_[_0x42a8('0x35')]({},_0x32fa38,_0x33226e['options']);return db[_0x42a8('0x25')][_0x42a8('0x41')](_0x32fa38)[_0x42a8('0x20')](handleEntityNotFound(_0xa1c99c,null))['then'](respondWithResult(_0xa1c99c,null))['catch'](handleError(_0xa1c99c,null));};exports[_0x42a8('0x42')]=function(_0x5bee39,_0x918597){return db[_0x42a8('0x25')][_0x42a8('0x42')](_0x5bee39[_0x42a8('0x43')],{})[_0x42a8('0x20')](respondWithResult(_0x918597,0xc9))[_0x42a8('0x3e')](handleError(_0x918597,null));};exports[_0x42a8('0x1e')]=function(_0x17aec8,_0xb9c0bf){if(_0x17aec8[_0x42a8('0x43')]['id']){delete _0x17aec8[_0x42a8('0x43')]['id'];}return db[_0x42a8('0x25')]['find']({'where':{'id':_0x17aec8['params']['id']}})[_0x42a8('0x20')](handleEntityNotFound(_0xb9c0bf,null))['then'](saveUpdates(_0x17aec8['body'],null))['then'](respondWithResult(_0xb9c0bf,null))[_0x42a8('0x3e')](handleError(_0xb9c0bf,null));};exports[_0x42a8('0x1f')]=function(_0x5aae6b,_0x410233){return db[_0x42a8('0x25')]['find']({'where':{'id':_0x5aae6b['params']['id']}})['then'](handleEntityNotFound(_0x410233,null))[_0x42a8('0x20')](removeEntity(_0x410233,null))[_0x42a8('0x3e')](handleError(_0x410233,null));};exports[_0x42a8('0x44')]=function(_0x3b7757,_0x228bc3){return db[_0x42a8('0x25')][_0x42a8('0x44')]()[_0x42a8('0x20')](respondWithResult(_0x228bc3,null))[_0x42a8('0x3e')](handleError(_0x228bc3,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 3e32aad..b43ffa9 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 _0xe566=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','api'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xe566,0xf4));var _0x6e56=function(_0x48f5a6,_0x35da91){_0x48f5a6=_0x48f5a6-0x0;var _0x4924c0=_0xe566[_0x48f5a6];return _0x4924c0;};'use strict';var _=require(_0x6e56('0x0'));var util=require('util');var logger=require(_0x6e56('0x1'))(_0x6e56('0x2'));var moment=require('moment');var BPromise=require(_0x6e56('0x3'));var rp=require(_0x6e56('0x4'));var fs=require('fs');var path=require(_0x6e56('0x5'));var rimraf=require(_0x6e56('0x6'));var config=require(_0x6e56('0x7'));var attributes=require(_0x6e56('0x8'));module['exports']=function(_0x13c2b,_0x48f8d0){return _0x13c2b[_0x6e56('0x9')](_0x6e56('0xa'),attributes,{'tableName':_0x6e56('0xb'),'paranoid':![],'indexes':[{'name':_0x6e56('0xc'),'fields':[_0x6e56('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1795=['WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define'];(function(_0x5d8341,_0x22e02a){var _0xdd9dda=function(_0x28a283){while(--_0x28a283){_0x5d8341['push'](_0x5d8341['shift']());}};_0xdd9dda(++_0x22e02a);}(_0x1795,0x1b5));var _0x5179=function(_0xf40417,_0x2f4305){_0xf40417=_0xf40417-0x0;var _0x52bbed=_0x1795[_0xf40417];return _0x52bbed;};'use strict';var _=require(_0x5179('0x0'));var util=require(_0x5179('0x1'));var logger=require('../../config/logger')(_0x5179('0x2'));var moment=require(_0x5179('0x3'));var BPromise=require('bluebird');var rp=require(_0x5179('0x4'));var fs=require('fs');var path=require(_0x5179('0x5'));var rimraf=require(_0x5179('0x6'));var config=require(_0x5179('0x7'));var attributes=require(_0x5179('0x8'));module[_0x5179('0x9')]=function(_0x6803d5,_0x12525a){return _0x6803d5[_0x5179('0xa')](_0x5179('0xb'),attributes,{'tableName':_0x5179('0xc'),'paranoid':![],'indexes':[{'name':_0x5179('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index fed7146..462cc97 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 _0x84ef=['../../config/logger','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','message','WhatsappTransferReport,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x320acf,_0x35d0d8){var _0x53a9dc=function(_0x5c240a){while(--_0x5c240a){_0x320acf['push'](_0x320acf['shift']());}};_0x53a9dc(++_0x35d0d8);}(_0x84ef,0x1d5));var _0xf84e=function(_0x3b5606,_0x1ad54b){_0x3b5606=_0x3b5606-0x0;var _0x228cc3=_0x84ef[_0x3b5606];return _0x228cc3;};'use strict';var _=require('lodash');var util=require(_0xf84e('0x0'));var moment=require(_0xf84e('0x1'));var BPromise=require(_0xf84e('0x2'));var rs=require(_0xf84e('0x3'));var fs=require('fs');var Redis=require(_0xf84e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf84e('0x5'));var logger=require(_0xf84e('0x6'))(_0xf84e('0x7'));var config=require(_0xf84e('0x8'));var jayson=require(_0xf84e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x12d495,_0x128a7c,_0x21fa60){return new BPromise(function(_0x57819f,_0x21bd01){return client[_0xf84e('0xa')](_0x12d495,_0x21fa60)['then'](function(_0xcb1392){logger[_0xf84e('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x128a7c,_0xf84e('0xc'));logger[_0xf84e('0xd')](_0xf84e('0xe'),_0x128a7c,_0xf84e('0xc'),JSON['stringify'](_0xcb1392));if(_0xcb1392['error']){if(_0xcb1392[_0xf84e('0xf')]['code']===0x1f4){logger[_0xf84e('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x128a7c,_0xcb1392['error'][_0xf84e('0x10')]);return _0x21bd01(_0xcb1392[_0xf84e('0xf')][_0xf84e('0x10')]);}logger[_0xf84e('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x128a7c,_0xcb1392['error']['message']);return _0x57819f(_0xcb1392[_0xf84e('0xf')][_0xf84e('0x10')]);}else{logger[_0xf84e('0xb')](_0xf84e('0x11'),_0x128a7c,_0xf84e('0xc'));_0x57819f(_0xcb1392[_0xf84e('0x12')][_0xf84e('0x10')]);}})['catch'](function(_0x2b9246){logger['error'](_0xf84e('0x11'),_0x128a7c,_0x2b9246);_0x21bd01(_0x2b9246);});});} \ No newline at end of file +var _0x6600=['info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0x6600,0x172));var _0x0660=function(_0x58f448,_0x6c9478){_0x58f448=_0x58f448-0x0;var _0x231e06=_0x6600[_0x58f448];return _0x231e06;};'use strict';var _=require(_0x0660('0x0'));var util=require(_0x0660('0x1'));var moment=require(_0x0660('0x2'));var BPromise=require(_0x0660('0x3'));var rs=require(_0x0660('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0660('0x5'))['db'];var utils=require(_0x0660('0x6'));var logger=require(_0x0660('0x7'))(_0x0660('0x8'));var config=require(_0x0660('0x9'));var jayson=require(_0x0660('0xa'));var client=jayson[_0x0660('0xb')][_0x0660('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x307083,_0x3ba1d9,_0x431b59){return new BPromise(function(_0x706d21,_0x1f4b5d){return client[_0x0660('0xd')](_0x307083,_0x431b59)[_0x0660('0xe')](function(_0x1e6333){logger['info'](_0x0660('0xf'),_0x3ba1d9,'request\x20sent');logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x3ba1d9,_0x0660('0x10'),JSON[_0x0660('0x11')](_0x1e6333));if(_0x1e6333[_0x0660('0x12')]){if(_0x1e6333[_0x0660('0x12')][_0x0660('0x13')]===0x1f4){logger[_0x0660('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3ba1d9,_0x1e6333[_0x0660('0x12')]['message']);return _0x1f4b5d(_0x1e6333['error'][_0x0660('0x14')]);}logger[_0x0660('0x12')](_0x0660('0xf'),_0x3ba1d9,_0x1e6333[_0x0660('0x12')][_0x0660('0x14')]);return _0x706d21(_0x1e6333['error']['message']);}else{logger[_0x0660('0x15')](_0x0660('0xf'),_0x3ba1d9,_0x0660('0x10'));_0x706d21(_0x1e6333[_0x0660('0x16')]['message']);}})['catch'](function(_0x4030bc){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x3ba1d9,_0x4030bc);_0x1f4b5d(_0x4030bc);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index bbe8d12..14356b7 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['then','seedDB','default','start','info','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','Online\x20apps:','map','online','name','join','Offline\x20apps:','filter','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/cloud-provider','sync'];(function(_0x580cf8,_0x26751e){var _0xcc9a9e=function(_0x5a67ad){while(--_0x5a67ad){_0x580cf8['push'](_0x580cf8['shift']());}};_0xcc9a9e(++_0x26751e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x5fc3[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0x35fc('0x0'));var db=require(_0x35fc('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x35fc('0x2'));var rpc=require(_0x35fc('0x3'));var config=require(_0x35fc('0x4'));var logger=require(_0x35fc('0x5'))(_0x35fc('0x6'));var pm2=require('./config/pm2');var pm2Config=require(_0x35fc('0x7'));var schedule=require(_0x35fc('0x8'));var chat=require(_0x35fc('0x9'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');var provider=require(_0x35fc('0xa'));function main(){return db['sequelize'][_0x35fc('0xb')]()[_0x35fc('0xc')](function(){if(config[_0x35fc('0xd')]){return seedDb[_0x35fc('0xe')]();}})[_0x35fc('0xc')](function(){return checkLicense[_0x35fc('0xe')]();})[_0x35fc('0xc')](function(){return rpc['listen']();})[_0x35fc('0xc')](function(_0x2a1084){logger['info'](_0x2a1084);return chat[_0x35fc('0xf')]();})[_0x35fc('0xc')](function(){return whatsapp['start']();})[_0x35fc('0xc')](function(){return schedule[_0x35fc('0xf')]();})['then'](function(){return transcribe['start']();})[_0x35fc('0xc')](function(){return provider['start']();})[_0x35fc('0xc')](function(_0x22055e){logger[_0x35fc('0x10')](_0x22055e);return pm2[_0x35fc('0xf')](pm2Config);})[_0x35fc('0xc')](function(_0x5cfe94){var _0x59507a=_0x5cfe94['filter'](function(_0x558364){return typeof _0x558364[_0x35fc('0x11')]===_0x35fc('0x12')&&_0x558364[_0x35fc('0x11')]>=0x0;});if(_0x59507a[_0x35fc('0x13')]>0x0){throw new Error(_0x59507a[_0x35fc('0x13')]+_0x35fc('0x14')+_['map'](_0x59507a,function(_0x26ba54){return'\x22'+_0x26ba54[_0x35fc('0x15')]['name']+'\x22';}));}logger[_0x35fc('0x10')](_0x35fc('0x16'),_[_0x35fc('0x17')](_['filter'](_0x5cfe94,{'status':_0x35fc('0x18')}),_0x35fc('0x19'))[_0x35fc('0x1a')]());logger['info'](_0x35fc('0x1b'),_[_0x35fc('0x17')](_[_0x35fc('0x1c')](_0x5cfe94,function(_0x251a1f){return _0x251a1f[_0x35fc('0x1d')]!==_0x35fc('0x18');}),_0x35fc('0x19'))[_0x35fc('0x1a')]()||_0x35fc('0x1e'));console[_0x35fc('0x1f')]('App\x20Ready!');})[_0x35fc('0x20')](function(_0xd5399f){console[_0x35fc('0x1f')](_0x35fc('0x21'),_0xd5399f);logger[_0x35fc('0x22')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0xd5399f);process[_0x35fc('0x23')](0x1);});}main(); \ No newline at end of file +var _0x5549=['status','None','App\x20Ready!','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','listen','then','info','start','filter','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','Online\x20apps:','map','online','name','join','Offline\x20apps:'];(function(_0x30646d,_0x2a4220){var _0x30cb8b=function(_0x2f1dd9){while(--_0x2f1dd9){_0x30646d['push'](_0x30646d['shift']());}};_0x30cb8b(++_0x2a4220);}(_0x5549,0x1f4));var _0x9554=function(_0x405dde,_0x21f0a4){_0x405dde=_0x405dde-0x0;var _0x10e938=_0x5549[_0x405dde];return _0x10e938;};'use strict';var _=require(_0x9554('0x0'));var db=require(_0x9554('0x1'))['db'];var seedDb=require(_0x9554('0x2'));var checkLicense=require(_0x9554('0x3'));var rpc=require(_0x9554('0x4'));var config=require('./config/environment');var logger=require(_0x9554('0x5'))(_0x9554('0x6'));var pm2=require(_0x9554('0x7'));var pm2Config=require(_0x9554('0x8'));var schedule=require(_0x9554('0x9'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x9554('0xa'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x9554('0xb'));function main(){return db[_0x9554('0xc')][_0x9554('0xd')]()['then'](function(){if(config[_0x9554('0xe')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0x9554('0xf')]();})['then'](function(){return rpc[_0x9554('0x10')]();})[_0x9554('0x11')](function(_0x3fee11){logger[_0x9554('0x12')](_0x3fee11);return chat[_0x9554('0x13')]();})['then'](function(){return whatsapp['start']();})[_0x9554('0x11')](function(){return schedule[_0x9554('0x13')]();})[_0x9554('0x11')](function(){return transcribe['start']();})[_0x9554('0x11')](function(){return provider[_0x9554('0x13')]();})[_0x9554('0x11')](function(_0x53c45b){logger[_0x9554('0x12')](_0x53c45b);return pm2[_0x9554('0x13')](pm2Config);})['then'](function(_0x2b9f7c){var _0x268338=_0x2b9f7c[_0x9554('0x14')](function(_0x849437){return typeof _0x849437['exitCode']===_0x9554('0x15')&&_0x849437[_0x9554('0x16')]>=0x0;});if(_0x268338[_0x9554('0x17')]>0x0){throw new Error(_0x268338['length']+_0x9554('0x18')+_['map'](_0x268338,function(_0x18811c){return'\x22'+_0x18811c[_0x9554('0x19')]['name']+'\x22';}));}logger[_0x9554('0x12')](_0x9554('0x1a'),_[_0x9554('0x1b')](_[_0x9554('0x14')](_0x2b9f7c,{'status':_0x9554('0x1c')}),_0x9554('0x1d'))[_0x9554('0x1e')]());logger['info'](_0x9554('0x1f'),_[_0x9554('0x1b')](_[_0x9554('0x14')](_0x2b9f7c,function(_0x3909a9){return _0x3909a9[_0x9554('0x20')]!==_0x9554('0x1c');}),_0x9554('0x1d'))[_0x9554('0x1e')]()||_0x9554('0x21'));console['log'](_0x9554('0x22'));})['catch'](function(_0x32cf23){console[_0x9554('0x23')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x32cf23);logger['error'](_0x9554('0x24'),_0x32cf23);process[_0x9554('0x25')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index da108e6..0e6a593 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 _0xda79=['now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/util','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','util','moment','secrets','session','name','email','userpic','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','then','status','unmanaged','headers','authorization','startsWith','User','find','authenticate','json','Wrong\x20credentials.','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','updatePasswordsHistory','length','splice','unshift','promisify','sign','payload','options','verify','randomBytes','floor'];(function(_0x1a2918,_0x57d781){var _0x35b0de=function(_0x304c44){while(--_0x304c44){_0x1a2918['push'](_0x1a2918['shift']());}};_0x35b0de(++_0x57d781);}(_0xda79,0x82));var _0x9da7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xda79[_0x2dafbe];return _0x58a45a;};'use strict';var db=require(_0x9da7('0x0'))['db'];var config=require(_0x9da7('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x9da7('0x2'));var encryptor=require('../encryptor');var _=require(_0x9da7('0x3'));var jwt=require(_0x9da7('0x4'));var expressJwt=require(_0x9da7('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0x9da7('0x6'));var crypto=require(_0x9da7('0x7'));var BPromise=require(_0x9da7('0x8'));var util=require(_0x9da7('0x9'));var moment=require(_0x9da7('0xa'));var validateJwt=expressJwt({'secret':config[_0x9da7('0xb')][_0x9da7('0xc')]});var userAttributes=['id','role','fullname',_0x9da7('0xd'),'internal',_0x9da7('0xe'),_0x9da7('0xf'),_0x9da7('0x10'),_0x9da7('0x11'),_0x9da7('0x12'),_0x9da7('0x13'),'mailPause',_0x9da7('0x14'),_0x9da7('0x15'),_0x9da7('0x16'),'pauseType',_0x9da7('0x17'),_0x9da7('0x18'),_0x9da7('0x19'),_0x9da7('0x1a'),_0x9da7('0x1b'),_0x9da7('0x1c'),_0x9da7('0x1d'),_0x9da7('0x1e'),'phoneBarAutoAnswerDelay',_0x9da7('0x1f'),_0x9da7('0x20'),_0x9da7('0x21'),'phoneBarEnableSettings',_0x9da7('0x22'),_0x9da7('0x23'),_0x9da7('0x24'),_0x9da7('0x25'),_0x9da7('0x26'),_0x9da7('0x27'),_0x9da7('0x28'),'privacyEnabled',_0x9da7('0x29'),_0x9da7('0x2a'),'downloadVoiceRecordings',_0x9da7('0x2b'),_0x9da7('0x2c'),_0x9da7('0x2d'),_0x9da7('0x2e')];exports[_0x9da7('0x2f')]=function(){return this[_0x9da7('0x30')](!![])[_0x9da7('0x31')](function(_0x4a9c9c,_0x5d752a,_0x1839d8){if(_0x4a9c9c[_0x9da7('0x32')]){_0x1839d8();}else{return db['ChatInteraction'][_0x9da7('0x33')]({'where':{'id':_0x4a9c9c[_0x9da7('0x34')]['id']},'attributes':['id',_0x9da7('0x35'),_0x9da7('0x36')],'raw':!![]})[_0x9da7('0x37')](function(_0x49cb0a){if(_0x49cb0a&&_0x49cb0a[_0x9da7('0x35')]){return _0x5d752a[_0x9da7('0x38')](_0x49cb0a[_0x9da7('0x36')]==='unmanaged'?0x195:0x193)['json']({'message':_0x49cb0a['disposition']===_0x9da7('0x39')?'Unmanaged.':'Forbidden.'});}else{_0x1839d8();}})['catch'](function(_0x1110a9){_0x1839d8(_0x1110a9);});}});};exports[_0x9da7('0x30')]=function isAuthenticated(_0x309b1f){return compose()[_0x9da7('0x31')](function(_0x2c77cc,_0x386573,_0x4cea2f){var _0x252373;if(_0x2c77cc[_0x9da7('0x3a')][_0x9da7('0x3b')]){if(_[_0x9da7('0x3c')](_0x2c77cc['headers'][_0x9da7('0x3b')],'Basic')){var _0x33d3f8=basicAuth(_0x2c77cc);db[_0x9da7('0x3d')][_0x9da7('0x3e')]({'where':{'name':_0x33d3f8[_0x9da7('0xd')]}})[_0x9da7('0x37')](function(_0x2c52cc){if(!_0x2c52cc||!_0x2c52cc[_0x9da7('0x3f')](_0x33d3f8['pass'])){return _0x386573[_0x9da7('0x38')](0x191)[_0x9da7('0x40')]({'message':_0x9da7('0x41')});}_0x2c77cc['user']={'id':_0x2c52cc['id']};_0x4cea2f();})[_0x9da7('0x42')](function(_0x10a052){_0x4cea2f(_0x10a052);});}else if(_[_0x9da7('0x3c')](_0x2c77cc[_0x9da7('0x3a')][_0x9da7('0x3b')],_0x9da7('0x43'))){validateJwt(_0x2c77cc,_0x386573,_0x4cea2f);}else{if(_0x309b1f){_0x4cea2f();}else{return _0x386573[_0x9da7('0x38')](0x193)['json']({'message':_0x9da7('0x44')});}}}else if(_0x2c77cc[_0x9da7('0x45')][_0x9da7('0x46')]){try{var _0x2a3020={'audience':hardwareConf[_0x9da7('0x47')](),'issuer':hardwareConf[_0x9da7('0x47')]()};verifyJwt(_0x2c77cc[_0x9da7('0x45')][_0x9da7('0x46')],_0x2a3020)[_0x9da7('0x37')](function(_0x192848){return db[_0x9da7('0x3d')][_0x9da7('0x3e')]({'where':{'id':_0x192848[_0x9da7('0x48')]}})[_0x9da7('0x37')](function(_0x1f2c11){_0x252373=_0x1f2c11;return db[_0x9da7('0x49')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})['then'](function(_0x3bf1a2){if(!_0x252373||!_['isEqual'](_0x252373['apiKeyNonce'],_0x192848['nonce'])){return _0x386573[_0x9da7('0x38')](0x191)[_0x9da7('0x40')]({'message':_0x9da7('0x4a')});}if(_0x252373[_0x9da7('0x4b')]){return _0x386573[_0x9da7('0x38')](0x191)[_0x9da7('0x40')]({'message':_0x9da7('0x4c')});}if(_0x252373[_0x9da7('0x4d')]){if(_0x3bf1a2[_0x9da7('0x4e')]>0x0){if(moment(_0x252373[_0x9da7('0x4f')])[_0x9da7('0x50')](_0x3bf1a2['blockDuration'],_0x9da7('0x51'))>moment()){return _0x386573[_0x9da7('0x38')](0x191)[_0x9da7('0x40')]({'message':_0x9da7('0x4c')});}}else{return _0x386573['status'](0x191)[_0x9da7('0x40')]({'message':_0x9da7('0x4c')});}}_0x2c77cc[_0x9da7('0x32')]={'id':_0x252373['id']};_0x4cea2f();});})[_0x9da7('0x42')](function(){return _0x386573[_0x9da7('0x38')](0x191)['json']({'message':_0x9da7('0x4c')});});}catch(_0x33b491){_0x4cea2f(_0x33b491);}}else if(_0x309b1f){_0x4cea2f();}else{return _0x386573['status'](0x193)[_0x9da7('0x40')]({'message':'Unknown\x20authorization\x20format'});}})[_0x9da7('0x31')](function(_0x39e590,_0x224550,_0x3248b1){if(_0x39e590[_0x9da7('0x32')]){db['User'][_0x9da7('0x3e')]({'where':{'id':_0x39e590[_0x9da7('0x32')]['id']},'attributes':userAttributes})[_0x9da7('0x37')](function(_0x3266ef){if(!_0x3266ef){return _0x224550[_0x9da7('0x38')](0x194)[_0x9da7('0x40')]({'message':_0x9da7('0x52')});}_0x39e590[_0x9da7('0x32')]=_0x3266ef;_0x3248b1();})[_0x9da7('0x42')](function(_0x5176fc){_0x3248b1(_0x5176fc);});}else if(_0x309b1f){_0x3248b1();}else{return _0x224550[_0x9da7('0x38')](0x194)[_0x9da7('0x40')]({'message':_0x9da7('0x53')});}});};exports[_0x9da7('0x54')]=function canUpdate(){return compose()[_0x9da7('0x31')](function(_0x41bed6,_0xadbb03,_0x49e83c){return licenseUtil[_0x9da7('0x55')]()[_0x9da7('0x37')](function(_0x1610d8){if(_0x1610d8[_0x9da7('0x56')]){_0x49e83c();}else{return _0xadbb03[_0x9da7('0x38')](0x193)['json']({'message':_0x9da7('0x57')});}})[_0x9da7('0x42')](function(_0x4b4369){_0x49e83c(_0x4b4369);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x9da7('0x31')](function(_0x4d4aac,_0xc0c8d4,_0xac9f0b){return licenseUtil[_0x9da7('0x55')]()[_0x9da7('0x37')](function(_0xbe441e){if(_0xbe441e[_0x9da7('0x58')]){_0xac9f0b();}else{return _0xc0c8d4[_0x9da7('0x38')](0x193)[_0x9da7('0x40')]({'message':'Forbidden'});}})[_0x9da7('0x42')](function(_0x3d70c5){_0xac9f0b(_0x3d70c5);});});};exports[_0x9da7('0x59')]=function(_0x168c99,_0x2bba56,_0x2e631e){_0x168c99[_0x9da7('0x59')]=!![];return _0x2e631e();};exports[_0x9da7('0x5a')]=function signToken(_0x2868f9){return signJwt(_0x2868f9);};exports[_0x9da7('0x5b')]=function(_0x12cae5,_0x3f82d4){if(!_0x12cae5['user']){return _0x3f82d4[_0x9da7('0x38')](0x194)[_0x9da7('0x40')]({'message':_0x9da7('0x5c')});}var _0x3055a2={'payload':{'id':_0x12cae5[_0x9da7('0x32')]['id'],'role':_0x12cae5[_0x9da7('0x32')][_0x9da7('0x5d')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3055a2)['then'](function(_0x476894){_0x3f82d4['cookie'](_0x9da7('0x5e'),_0x476894);_0x3f82d4[_0x9da7('0x5f')](_0x9da7('0x60'));})[_0x9da7('0x42')](function(_0x2a2749){return _0x3f82d4['status'](0x1f4)['send'](_0x2a2749);});};exports[_0x9da7('0x61')]=function(_0x5e0d20){if(_[_0x9da7('0x62')](_0x5e0d20[_0x9da7('0x63')])||_['isNil'](_0x5e0d20[_0x9da7('0x64')])){return null;}else{return createJwt(_0x5e0d20);}};exports[_0x9da7('0x65')]=function(_0x1fb650){_0x1fb650[_0x9da7('0x63')]=generateNonce();_0x1fb650['apiKeyIat']=generateIssuedAt();return createJwt(_0x1fb650);};exports[_0x9da7('0x66')]=function(_0x2a4b5c,_0x5f403c){var _0x59fb9c=_0x2a4b5c['query'][_0x9da7('0x46')];if(_0x59fb9c){var _0x536c46={'nonce':_0x5f403c[_0x9da7('0x63')],'iat':_0x5f403c[_0x9da7('0x64')],'audience':hardwareConf[_0x9da7('0x47')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x59fb9c,_0x536c46)[_0x9da7('0x37')](function(){return generateApiKey(_0x5f403c);});}else{throw{'message':_0x9da7('0x67')};}};exports[_0x9da7('0x68')]=function(_0x5bd4b8){var _0x4aebbd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4aebbd[_0x9da7('0x69')](_0x5bd4b8))throw new db[(_0x9da7('0x6a'))][(_0x9da7('0x6b'))]('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[_0x9da7('0x6c')]=function(_0x1eb147,_0x376ab0,_0x2301df){var _0x17eb85=encryptor[_0x9da7('0x6d')](_0x376ab0)[_0x9da7('0x6e')](',');for(var _0x1bae47=0x0;_0x1bae47<_0x2301df;_0x1bae47++){if(!_0x17eb85[_0x1bae47])break;if(_0x1eb147[_0x9da7('0x6f')]()===_0x17eb85[_0x1bae47]['toLowerCase']()){var _0x343f5b=util[_0x9da7('0x70')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x2301df);if(_0x2301df===0x1){_0x343f5b='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize'][(_0x9da7('0x6b'))](_0x343f5b);}}return;};exports[_0x9da7('0x71')]=function(_0x50341a,_0x63ddeb){var _0x250332=_0x63ddeb?encryptor['decryptString'](_0x63ddeb)[_0x9da7('0x6e')](','):[];if(_0x250332[_0x9da7('0x72')]===0x5){_0x250332[_0x9da7('0x73')](-0x1,0x1);}_0x250332[_0x9da7('0x74')](_0x50341a);return encryptor['encryptString'](_0x250332['join'](','));};function signJwt(_0x4efdda){var _0x4d1522=BPromise[_0x9da7('0x75')](jwt[_0x9da7('0x76')],{'context':jwt});var _0x53cc03=_0x4efdda['secret']||config['secrets'][_0x9da7('0xc')];return new BPromise(function(_0x1e5688,_0x407427){_0x4d1522(_0x4efdda[_0x9da7('0x77')],_0x53cc03,_0x4efdda[_0x9da7('0x78')])[_0x9da7('0x37')](function(_0x4b6166){_0x1e5688(_0x4b6166);})['catch'](function(_0x5aba67){_0x407427(_0x5aba67);});});}function verifyJwt(_0x301668,_0x1a14f6,_0x4fdbb3){var _0x313dbc=BPromise[_0x9da7('0x75')](jwt[_0x9da7('0x79')],{'context':jwt});var _0x2b606f=_0x4fdbb3||config['secrets'][_0x9da7('0xc')];return new BPromise(function(_0x2d6b45,_0x15f3b3){_0x313dbc(_0x301668,_0x2b606f,_0x1a14f6)[_0x9da7('0x37')](function(_0x5874d2){_0x2d6b45(_0x5874d2);})[_0x9da7('0x42')](function(_0x1f14b9){_0x15f3b3(_0x1f14b9);});});}function generateNonce(){return crypto[_0x9da7('0x7a')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0x9da7('0x7b')](Date[_0x9da7('0x7c')]()/0x3e8)[_0x9da7('0x7d')]();}function createJwt(_0x10a51c){var _0x474605={'payload':{'iat':_0x10a51c[_0x9da7('0x64')],'nonce':_0x10a51c['apiKeyNonce']},'options':{'algorithm':_0x9da7('0x7e'),'subject':_0x10a51c['id'][_0x9da7('0x7d')](),'issuer':hardwareConf[_0x9da7('0x47')](),'audience':hardwareConf[_0x9da7('0x47')]()}};return signJwt(_0x474605)[_0x9da7('0x37')](function(_0x47ef8b){return{'iat':_0x10a51c[_0x9da7('0x64')],'nonce':_0x10a51c[_0x9da7('0x63')],'token':_0x47ef8b};});} \ No newline at end of file +var _0x4c63=['../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','fullname','internal','userpic','md5secret','voicePause','chatPause','pauseType','showWebBar','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarEnableSettings','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','disposition','then','closed','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','find','name','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','status','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','apiKeyNonce','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','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.','splice','encryptString','join','promisify','sign','secret','options','verify','randomBytes','hex','now','toString','../../mysqldb','../../config/license/hardware'];(function(_0x967bc0,_0x3ac78b){var _0x34fd13=function(_0x3a3ef9){while(--_0x3a3ef9){_0x967bc0['push'](_0x967bc0['shift']());}};_0x34fd13(++_0x3ac78b);}(_0x4c63,0xf2));var _0x34c6=function(_0x554664,_0x4d1611){_0x554664=_0x554664-0x0;var _0x464459=_0x4c63[_0x554664];return _0x464459;};'use strict';var db=require(_0x34c6('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x34c6('0x1'));var licenseUtil=require(_0x34c6('0x2'));var encryptor=require(_0x34c6('0x3'));var _=require(_0x34c6('0x4'));var jwt=require(_0x34c6('0x5'));var expressJwt=require(_0x34c6('0x6'));var compose=require(_0x34c6('0x7'));var basicAuth=require(_0x34c6('0x8'));var crypto=require(_0x34c6('0x9'));var BPromise=require(_0x34c6('0xa'));var util=require(_0x34c6('0xb'));var moment=require(_0x34c6('0xc'));var validateJwt=expressJwt({'secret':config[_0x34c6('0xd')][_0x34c6('0xe')]});var userAttributes=['id','role',_0x34c6('0xf'),'name',_0x34c6('0x10'),'email',_0x34c6('0x11'),'permissions',_0x34c6('0x12'),_0x34c6('0x13'),_0x34c6('0x14'),'mailPause','faxPause','smsPause','openchannelPause',_0x34c6('0x15'),_0x34c6('0x16'),'lastLoginAt',_0x34c6('0x17'),_0x34c6('0x18'),'allowmessenger',_0x34c6('0x19'),_0x34c6('0x1a'),'phoneBarAutoAnswer',_0x34c6('0x1b'),'phoneBarDnd','phoneBarEnableRecording',_0x34c6('0x1c'),_0x34c6('0x1d'),'phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort',_0x34c6('0x1e'),_0x34c6('0x1f'),_0x34c6('0x20'),_0x34c6('0x21'),'settingsEnabled',_0x34c6('0x22'),'downloadVoiceRecordings',_0x34c6('0x23'),_0x34c6('0x24'),_0x34c6('0x25'),_0x34c6('0x26')];exports[_0x34c6('0x27')]=function(){return this[_0x34c6('0x28')](!![])[_0x34c6('0x29')](function(_0x3cf5f7,_0x19fb24,_0x5ec172){if(_0x3cf5f7[_0x34c6('0x2a')]){_0x5ec172();}else{return db[_0x34c6('0x2b')][_0x34c6('0x2c')]({'where':{'id':_0x3cf5f7['params']['id']},'attributes':['id','closed',_0x34c6('0x2d')],'raw':!![]})[_0x34c6('0x2e')](function(_0x45501a){if(_0x45501a&&_0x45501a[_0x34c6('0x2f')]){return _0x19fb24['status'](_0x45501a[_0x34c6('0x2d')]===_0x34c6('0x30')?0x195:0x193)[_0x34c6('0x31')]({'message':_0x45501a[_0x34c6('0x2d')]===_0x34c6('0x30')?_0x34c6('0x32'):_0x34c6('0x33')});}else{_0x5ec172();}})[_0x34c6('0x34')](function(_0x2aaba5){_0x5ec172(_0x2aaba5);});}});};exports['isAuthenticated']=function isAuthenticated(_0x1cdece){return compose()[_0x34c6('0x29')](function(_0x34bc9b,_0x5c1efa,_0x4d1480){var _0x109b9f;if(_0x34bc9b[_0x34c6('0x35')][_0x34c6('0x36')]){if(_[_0x34c6('0x37')](_0x34bc9b[_0x34c6('0x35')]['authorization'],_0x34c6('0x38'))){var _0x16603c=basicAuth(_0x34bc9b);db[_0x34c6('0x39')][_0x34c6('0x3a')]({'where':{'name':_0x16603c[_0x34c6('0x3b')]}})['then'](function(_0x5fd795){if(!_0x5fd795||!_0x5fd795['authenticate'](_0x16603c['pass'])){return _0x5c1efa['status'](0x191)['json']({'message':_0x34c6('0x3c')});}_0x34bc9b[_0x34c6('0x2a')]={'id':_0x5fd795['id']};_0x4d1480();})[_0x34c6('0x34')](function(_0x315ad0){_0x4d1480(_0x315ad0);});}else if(_[_0x34c6('0x37')](_0x34bc9b[_0x34c6('0x35')][_0x34c6('0x36')],_0x34c6('0x3d'))){validateJwt(_0x34bc9b,_0x5c1efa,_0x4d1480);}else{if(_0x1cdece){_0x4d1480();}else{return _0x5c1efa['status'](0x193)[_0x34c6('0x31')]({'message':_0x34c6('0x3e')});}}}else if(_0x34bc9b[_0x34c6('0x3f')][_0x34c6('0x40')]){try{var _0x18ec3d={'audience':hardwareConf[_0x34c6('0x41')](),'issuer':hardwareConf[_0x34c6('0x41')]()};verifyJwt(_0x34bc9b['query'][_0x34c6('0x40')],_0x18ec3d)[_0x34c6('0x2e')](function(_0x324c77){return db[_0x34c6('0x39')][_0x34c6('0x3a')]({'where':{'id':_0x324c77[_0x34c6('0x42')]}})[_0x34c6('0x2e')](function(_0x5ecaf0){_0x109b9f=_0x5ecaf0;return db[_0x34c6('0x43')]['findOne']({'where':{'id':0x1},'attributes':[_0x34c6('0x44'),_0x34c6('0x45')],'raw':!![]});})[_0x34c6('0x2e')](function(_0x6bd19c){if(!_0x109b9f||!_[_0x34c6('0x46')](_0x109b9f['apiKeyNonce'],_0x324c77['nonce'])){return _0x5c1efa['status'](0x191)[_0x34c6('0x31')]({'message':_0x34c6('0x47')});}if(_0x109b9f['disabled']){return _0x5c1efa[_0x34c6('0x48')](0x191)[_0x34c6('0x31')]({'message':_0x34c6('0x49')});}if(_0x109b9f[_0x34c6('0x4a')]){if(_0x6bd19c[_0x34c6('0x45')]>0x0){if(moment(_0x109b9f[_0x34c6('0x4b')])[_0x34c6('0x4c')](_0x6bd19c[_0x34c6('0x45')],_0x34c6('0x4d'))>moment()){return _0x5c1efa[_0x34c6('0x48')](0x191)[_0x34c6('0x31')]({'message':_0x34c6('0x49')});}}else{return _0x5c1efa[_0x34c6('0x48')](0x191)['json']({'message':_0x34c6('0x49')});}}_0x34bc9b[_0x34c6('0x2a')]={'id':_0x109b9f['id']};_0x4d1480();});})[_0x34c6('0x34')](function(){return _0x5c1efa['status'](0x191)[_0x34c6('0x31')]({'message':_0x34c6('0x49')});});}catch(_0x562b98){_0x4d1480(_0x562b98);}}else if(_0x1cdece){_0x4d1480();}else{return _0x5c1efa[_0x34c6('0x48')](0x193)[_0x34c6('0x31')]({'message':_0x34c6('0x3e')});}})['use'](function(_0x2ac58c,_0x1d83dc,_0x5cbab1){if(_0x2ac58c[_0x34c6('0x2a')]){db[_0x34c6('0x39')][_0x34c6('0x3a')]({'where':{'id':_0x2ac58c[_0x34c6('0x2a')]['id']},'attributes':userAttributes})[_0x34c6('0x2e')](function(_0x586c15){if(!_0x586c15){return _0x1d83dc[_0x34c6('0x48')](0x194)['json']({'message':_0x34c6('0x4e')});}_0x2ac58c['user']=_0x586c15;_0x5cbab1();})['catch'](function(_0x416a1c){_0x5cbab1(_0x416a1c);});}else if(_0x1cdece){_0x5cbab1();}else{return _0x1d83dc[_0x34c6('0x48')](0x194)['json']({'message':_0x34c6('0x4f')});}});};exports[_0x34c6('0x50')]=function canUpdate(){return compose()[_0x34c6('0x29')](function(_0x1cef70,_0x42e9d2,_0x48f926){return licenseUtil[_0x34c6('0x51')]()[_0x34c6('0x2e')](function(_0x9c117e){if(_0x9c117e['update']){_0x48f926();}else{return _0x42e9d2[_0x34c6('0x48')](0x193)[_0x34c6('0x31')]({'message':_0x34c6('0x52')});}})[_0x34c6('0x34')](function(_0x5544af){_0x48f926(_0x5544af);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x595325,_0xbf8f21,_0x2e0e26){return licenseUtil[_0x34c6('0x51')]()[_0x34c6('0x2e')](function(_0x96a145){if(_0x96a145[_0x34c6('0x53')]){_0x2e0e26();}else{return _0xbf8f21[_0x34c6('0x48')](0x193)[_0x34c6('0x31')]({'message':_0x34c6('0x52')});}})[_0x34c6('0x34')](function(_0x1abd97){_0x2e0e26(_0x1abd97);});});};exports[_0x34c6('0x54')]=function(_0x45795b,_0x5bfb8a,_0x208ea7){_0x45795b[_0x34c6('0x54')]=!![];return _0x208ea7();};exports[_0x34c6('0x55')]=function signToken(_0x22c4fe){return signJwt(_0x22c4fe);};exports[_0x34c6('0x56')]=function(_0x542018,_0x2100a1){if(!_0x542018[_0x34c6('0x2a')]){return _0x2100a1['status'](0x194)[_0x34c6('0x31')]({'message':_0x34c6('0x57')});}var _0x5366cf={'payload':{'id':_0x542018['user']['id'],'role':_0x542018['user'][_0x34c6('0x58')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5366cf)[_0x34c6('0x2e')](function(_0x3d9dbe){_0x2100a1['cookie'](_0x34c6('0x59'),_0x3d9dbe);_0x2100a1[_0x34c6('0x5a')](_0x34c6('0x5b'));})['catch'](function(_0x2fc18c){return _0x2100a1[_0x34c6('0x48')](0x1f4)[_0x34c6('0x5c')](_0x2fc18c);});};exports[_0x34c6('0x5d')]=function(_0x154dc9){if(_[_0x34c6('0x5e')](_0x154dc9['apiKeyNonce'])||_[_0x34c6('0x5e')](_0x154dc9[_0x34c6('0x5f')])){return null;}else{return createJwt(_0x154dc9);}};exports[_0x34c6('0x60')]=function(_0x4b612c){_0x4b612c[_0x34c6('0x61')]=generateNonce();_0x4b612c[_0x34c6('0x5f')]=generateIssuedAt();return createJwt(_0x4b612c);};exports['regenerateApiKey']=function(_0x1b8377,_0x5d3c61){var _0x503ab0=_0x1b8377['query'][_0x34c6('0x40')];if(_0x503ab0){var _0x5272ac={'nonce':_0x5d3c61[_0x34c6('0x61')],'iat':_0x5d3c61[_0x34c6('0x5f')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x34c6('0x41')]()};return verifyJwt(_0x503ab0,_0x5272ac)[_0x34c6('0x2e')](function(){return generateApiKey(_0x5d3c61);});}else{throw{'message':_0x34c6('0x62')};}};exports[_0x34c6('0x63')]=function(_0x5ddc7b){var _0x22c627=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x22c627[_0x34c6('0x64')](_0x5ddc7b))throw new db[(_0x34c6('0x65'))][(_0x34c6('0x66'))](_0x34c6('0x67'));return;};exports[_0x34c6('0x68')]=function(_0x426cb6,_0x4acca4,_0x155874){var _0xe6342c=encryptor[_0x34c6('0x69')](_0x4acca4)[_0x34c6('0x6a')](',');for(var _0x2706db=0x0;_0x2706db<_0x155874;_0x2706db++){if(!_0xe6342c[_0x2706db])break;if(_0x426cb6['toLowerCase']()===_0xe6342c[_0x2706db]['toLowerCase']()){var _0x5f31bb=util[_0x34c6('0x6b')](_0x34c6('0x6c'),_0x155874);if(_0x155874===0x1){_0x5f31bb=_0x34c6('0x6d');}throw new db[(_0x34c6('0x65'))][(_0x34c6('0x66'))](_0x5f31bb);}}return;};exports['updatePasswordsHistory']=function(_0x29b4ab,_0x56c232){var _0x26b201=_0x56c232?encryptor[_0x34c6('0x69')](_0x56c232)[_0x34c6('0x6a')](','):[];if(_0x26b201['length']===0x5){_0x26b201[_0x34c6('0x6e')](-0x1,0x1);}_0x26b201['unshift'](_0x29b4ab);return encryptor[_0x34c6('0x6f')](_0x26b201[_0x34c6('0x70')](','));};function signJwt(_0x232fdf){var _0x3ee2dd=BPromise[_0x34c6('0x71')](jwt[_0x34c6('0x72')],{'context':jwt});var _0x49e3b7=_0x232fdf[_0x34c6('0x73')]||config[_0x34c6('0xd')][_0x34c6('0xe')];return new BPromise(function(_0x2e2e37,_0x4e6e1d){_0x3ee2dd(_0x232fdf['payload'],_0x49e3b7,_0x232fdf[_0x34c6('0x74')])[_0x34c6('0x2e')](function(_0x56c0a6){_0x2e2e37(_0x56c0a6);})[_0x34c6('0x34')](function(_0x4e4678){_0x4e6e1d(_0x4e4678);});});}function verifyJwt(_0x1ebd51,_0x1baa0c,_0xc66178){var _0x422c06=BPromise[_0x34c6('0x71')](jwt[_0x34c6('0x75')],{'context':jwt});var _0x51481c=_0xc66178||config[_0x34c6('0xd')][_0x34c6('0xe')];return new BPromise(function(_0x2d2686,_0x440095){_0x422c06(_0x1ebd51,_0x51481c,_0x1baa0c)[_0x34c6('0x2e')](function(_0xba85f1){_0x2d2686(_0xba85f1);})[_0x34c6('0x34')](function(_0x4c1032){_0x440095(_0x4c1032);});});}function generateNonce(){return crypto[_0x34c6('0x76')](0x10)['toString'](_0x34c6('0x77'));}function generateIssuedAt(){return Math['floor'](Date[_0x34c6('0x78')]()/0x3e8)[_0x34c6('0x79')]();}function createJwt(_0x4ee0fa){var _0x37f9ca={'payload':{'iat':_0x4ee0fa[_0x34c6('0x5f')],'nonce':_0x4ee0fa[_0x34c6('0x61')]},'options':{'algorithm':'HS512','subject':_0x4ee0fa['id'][_0x34c6('0x79')](),'issuer':hardwareConf[_0x34c6('0x41')](),'audience':hardwareConf[_0x34c6('0x41')]()}};return signJwt(_0x37f9ca)[_0x34c6('0x2e')](function(_0x46020e){return{'iat':_0x4ee0fa[_0x34c6('0x5f')],'nonce':_0x4ee0fa[_0x34c6('0x61')],'token':_0x46020e};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index b76446b..8c0f0f8 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 _0xec3b=['algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','createCipher','data','binary','end','write','close','unlink','decryptFile','createReadStream','createWriteStream','createDecipher','update','final','encryptString','utf8','base64','decryptString','secret','crypto','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xec3b,0x10f));var _0xbec3=function(_0x478d2f,_0x5c98a1){_0x478d2f=_0x478d2f-0x0;var _0x44844e=_0xec3b[_0x478d2f];return _0x44844e;};'use strict';var crypto=require(_0xbec3('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xbec3('0x1'));var config=require(_0xbec3('0x2'));var logger=require(_0xbec3('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xbec3('0x4')][_0xbec3('0x5')],'algorithm':_0xbec3('0x6')};const fileOptions={'algorithm':_0xbec3('0x7')};if(config[_0xbec3('0x8')]&&config[_0xbec3('0x8')][_0xbec3('0x9')]){var isSupported=isAlgorithmSupported(config[_0xbec3('0x8')][_0xbec3('0x9')]);if(isSupported){fileOptions[_0xbec3('0x9')]=config[_0xbec3('0x8')][_0xbec3('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xbec3('0xa')](',\x20');logger[_0xbec3('0xb')](config['encrypt'][_0xbec3('0x9')],_0xbec3('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x5221c4){return AES_SUPPORTED_RX[_0xbec3('0xd')](_0x5221c4);}function getSupportedCiphers(){return crypto[_0xbec3('0xe')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0xbd032a){return getSupportedCiphers()[_0xbec3('0xf')](_0xbd032a)>-0x1;}function combineOptions(_0x55560d){var _0x52dbbd={};for(var _0x3e6ff9 in fileOptions){if(fileOptions[_0xbec3('0x10')](_0x3e6ff9)){_0x52dbbd[_0x3e6ff9]=fileOptions[_0x3e6ff9];}}if(_0x55560d){for(var _0x212a08 in _0x55560d){if(_0x55560d[_0xbec3('0x10')](_0x212a08)){_0x52dbbd[_0x212a08]=_0x55560d[_0x212a08];}}}return _0x52dbbd;}exports['encryptFile']=function(_0x33ac52,_0x3120c1,_0x4806b2,_0x531943){return new BPromise(function(_0x2da27d,_0x3faf96){_0x531943=combineOptions(_0x531943);var _0x138290=new Buffer(_0x4806b2);var _0x3b2abe=fs['createReadStream'](_0x33ac52);var _0x187a07=fs['createWriteStream'](_0x3120c1);var _0x336731=crypto[_0xbec3('0x11')](_0x531943[_0xbec3('0x9')],_0x138290);_0x3b2abe['on'](_0xbec3('0x12'),function(_0x38650b){var _0x4de375=new Buffer(_0x336731['update'](_0x38650b),_0xbec3('0x13'));_0x187a07['write'](_0x4de375);});_0x3b2abe['on'](_0xbec3('0x14'),function(){try{var _0xde9517=new Buffer(_0x336731['final'](_0xbec3('0x13')),_0xbec3('0x13'));_0x187a07[_0xbec3('0x15')](_0xde9517);_0x187a07[_0xbec3('0x14')]();_0x187a07['on'](_0xbec3('0x16'),function(){return _0x2da27d(_0x3120c1);});}catch(_0x46c2b8){fs[_0xbec3('0x17')](_0x3120c1);return _0x3faf96(_0x46c2b8);}});});};exports[_0xbec3('0x18')]=function(_0x49909c,_0x1aa71b,_0x43b95b,_0x287184){return new BPromise(function(_0x4aa54e,_0x56b311){_0x287184=combineOptions(_0x287184);var _0x293475=new Buffer(_0x43b95b);var _0x4decf8=fs[_0xbec3('0x19')](_0x49909c);var _0x1352ed=fs[_0xbec3('0x1a')](_0x1aa71b);var _0x3f83c7=crypto[_0xbec3('0x1b')](_0x287184[_0xbec3('0x9')],_0x293475);_0x4decf8['on']('data',function(_0x4e94ba){var _0x317d36=new Buffer(_0x3f83c7[_0xbec3('0x1c')](_0x4e94ba),_0xbec3('0x13'));_0x1352ed['write'](_0x317d36);});_0x4decf8['on'](_0xbec3('0x14'),function(){try{var _0x219895=new Buffer(_0x3f83c7[_0xbec3('0x1d')]('binary'),_0xbec3('0x13'));_0x1352ed['write'](_0x219895);_0x1352ed[_0xbec3('0x14')]();_0x1352ed['on']('close',function(){return _0x4aa54e(_0x1aa71b);});}catch(_0x5e54b0){fs[_0xbec3('0x17')](_0x1aa71b);return _0x56b311(_0x5e54b0);}});});};exports[_0xbec3('0x1e')]=function(_0x503e4b,_0x2aee08,_0x4681b6){var _0x5da653=_0x4681b6||stringOptions[_0xbec3('0x9')];var _0x295d3d=_0x2aee08||stringOptions['secret'];var _0x2f0866=crypto[_0xbec3('0x11')](_0x5da653,_0x295d3d);var _0x1c1101=_0x2f0866[_0xbec3('0x1c')](_0x503e4b,_0xbec3('0x1f'),_0xbec3('0x20'));_0x1c1101+=_0x2f0866[_0xbec3('0x1d')]('base64');return _0x1c1101;};exports[_0xbec3('0x21')]=function(_0x5a3166,_0x500a30,_0x58b15c){var _0x9a169=_0x58b15c||stringOptions[_0xbec3('0x9')];var _0x128b6f=_0x500a30||stringOptions[_0xbec3('0x22')];var _0x1e902a=crypto['createDecipher'](_0x9a169,_0x128b6f);var _0x1cb7bf=_0x1e902a['update'](_0x5a3166,_0xbec3('0x20'),_0xbec3('0x1f'));_0x1cb7bf+=_0x1e902a[_0xbec3('0x1d')](_0xbec3('0x1f'));return _0x1cb7bf;}; \ No newline at end of file +var _0x7b99=['getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createCipher','data','update','binary','write','final','end','close','unlink','createWriteStream','encryptString','utf8','base64','decryptString','secret','createDecipher','crypto','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:'];(function(_0x3b1c15,_0x4419aa){var _0x57ca0f=function(_0x577a61){while(--_0x577a61){_0x3b1c15['push'](_0x3b1c15['shift']());}};_0x57ca0f(++_0x4419aa);}(_0x7b99,0xba));var _0x97b9=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x7b99[_0x3e5086];return _0xfeb102;};'use strict';var crypto=require(_0x97b9('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x97b9('0x1'));var config=require(_0x97b9('0x2'));var logger=require(_0x97b9('0x3'))(_0x97b9('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x97b9('0x5')][_0x97b9('0x6')],'algorithm':_0x97b9('0x7')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0x97b9('0x8')][_0x97b9('0x9')]){var isSupported=isAlgorithmSupported(config[_0x97b9('0x8')][_0x97b9('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0x97b9('0x8')][_0x97b9('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x97b9('0xa')](config['encrypt'][_0x97b9('0x9')],_0x97b9('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x8eb01b){return AES_SUPPORTED_RX['test'](_0x8eb01b);}function getSupportedCiphers(){return crypto[_0x97b9('0xc')]()[_0x97b9('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x54e5e8){return getSupportedCiphers()[_0x97b9('0xe')](_0x54e5e8)>-0x1;}function combineOptions(_0x2ffc59){var _0x3ea0ce={};for(var _0x124e92 in fileOptions){if(fileOptions[_0x97b9('0xf')](_0x124e92)){_0x3ea0ce[_0x124e92]=fileOptions[_0x124e92];}}if(_0x2ffc59){for(var _0x498c2b in _0x2ffc59){if(_0x2ffc59['hasOwnProperty'](_0x498c2b)){_0x3ea0ce[_0x498c2b]=_0x2ffc59[_0x498c2b];}}}return _0x3ea0ce;}exports['encryptFile']=function(_0x23b24c,_0x4ab268,_0x139596,_0x110e8a){return new BPromise(function(_0xa94982,_0x367d73){_0x110e8a=combineOptions(_0x110e8a);var _0x2d69ff=new Buffer(_0x139596);var _0x9673ef=fs[_0x97b9('0x10')](_0x23b24c);var _0x529919=fs['createWriteStream'](_0x4ab268);var _0x284d06=crypto[_0x97b9('0x11')](_0x110e8a[_0x97b9('0x9')],_0x2d69ff);_0x9673ef['on'](_0x97b9('0x12'),function(_0x2c2f0e){var _0x2a6d55=new Buffer(_0x284d06[_0x97b9('0x13')](_0x2c2f0e),_0x97b9('0x14'));_0x529919[_0x97b9('0x15')](_0x2a6d55);});_0x9673ef['on']('end',function(){try{var _0x2bf781=new Buffer(_0x284d06[_0x97b9('0x16')](_0x97b9('0x14')),_0x97b9('0x14'));_0x529919[_0x97b9('0x15')](_0x2bf781);_0x529919[_0x97b9('0x17')]();_0x529919['on'](_0x97b9('0x18'),function(){return _0xa94982(_0x4ab268);});}catch(_0x987a11){fs[_0x97b9('0x19')](_0x4ab268);return _0x367d73(_0x987a11);}});});};exports['decryptFile']=function(_0x9b55b9,_0x2e7930,_0x4a799f,_0x454503){return new BPromise(function(_0x144241,_0x271f90){_0x454503=combineOptions(_0x454503);var _0x2edf13=new Buffer(_0x4a799f);var _0x1ec44b=fs[_0x97b9('0x10')](_0x9b55b9);var _0x35cf49=fs[_0x97b9('0x1a')](_0x2e7930);var _0x398e7c=crypto['createDecipher'](_0x454503[_0x97b9('0x9')],_0x2edf13);_0x1ec44b['on'](_0x97b9('0x12'),function(_0x1445ea){var _0x43308a=new Buffer(_0x398e7c[_0x97b9('0x13')](_0x1445ea),_0x97b9('0x14'));_0x35cf49['write'](_0x43308a);});_0x1ec44b['on'](_0x97b9('0x17'),function(){try{var _0x5ce059=new Buffer(_0x398e7c['final'](_0x97b9('0x14')),'binary');_0x35cf49[_0x97b9('0x15')](_0x5ce059);_0x35cf49[_0x97b9('0x17')]();_0x35cf49['on'](_0x97b9('0x18'),function(){return _0x144241(_0x2e7930);});}catch(_0x620b5){fs['unlink'](_0x2e7930);return _0x271f90(_0x620b5);}});});};exports[_0x97b9('0x1b')]=function(_0x37229f,_0x19c922,_0x4717ce){var _0x131324=_0x4717ce||stringOptions[_0x97b9('0x9')];var _0x64396f=_0x19c922||stringOptions['secret'];var _0x2278b9=crypto['createCipher'](_0x131324,_0x64396f);var _0x56eef1=_0x2278b9[_0x97b9('0x13')](_0x37229f,_0x97b9('0x1c'),'base64');_0x56eef1+=_0x2278b9[_0x97b9('0x16')](_0x97b9('0x1d'));return _0x56eef1;};exports[_0x97b9('0x1e')]=function(_0x3e907e,_0x3de734,_0x311ee7){var _0x21936f=_0x311ee7||stringOptions[_0x97b9('0x9')];var _0x5a4948=_0x3de734||stringOptions[_0x97b9('0x1f')];var _0xca2d85=crypto[_0x97b9('0x20')](_0x21936f,_0x5a4948);var _0x296c55=_0xca2d85[_0x97b9('0x13')](_0x3e907e,_0x97b9('0x1d'),_0x97b9('0x1c'));_0x296c55+=_0xca2d85[_0x97b9('0x16')](_0x97b9('0x1c'));return _0x296c55;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 97ec3d6..8efac80 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 _0xac8f=['format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','then','sequelize','query'];(function(_0x316d7f,_0x275e14){var _0x30c945=function(_0x38043e){while(--_0x38043e){_0x316d7f['push'](_0x316d7f['shift']());}};_0x30c945(++_0x275e14);}(_0xac8f,0xdd));var _0xfac8=function(_0x502953,_0x28de83){_0x502953=_0x502953-0x0;var _0x2fa32d=_0xac8f[_0x502953];return _0x2fa32d;};'use strict';var util=require('util');var path=require(_0xfac8('0x0'));var _=require(_0xfac8('0x1'));var csv=require(_0xfac8('0x2'));var fs=require('fs');var BPromise=require(_0xfac8('0x3'));var zipdir=require(_0xfac8('0x4'));var rimraf=require(_0xfac8('0x5'));var db=require(_0xfac8('0x6'))['db'];var dbH=require(_0xfac8('0x6'))['dbH'];var logger=require(_0xfac8('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xfac8('0x8')][0x2]);var QUERY=process[_0xfac8('0x8')][0x3];var PATH=process[_0xfac8('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x24691f,_0x436c83){var _0xe86a77={'status':_0x24691f};var _0x1d1de0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x436c83){_0xe86a77['savename']=_0x436c83;}return db[_0xfac8('0x9')]['update'](_0xe86a77,_0x1d1de0);}function main(){var _0xc0418c=0x1388;var _0x530386;logger[_0xfac8('0xa')](util['format'](_0xfac8('0xb'),EXTRACTED_REPORT_ID,_0xfac8('0xc')));return db['Setting'][_0xfac8('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xfac8('0xe'),_0xfac8('0xf')]})[_0xfac8('0x10')](function(_0x3dfbe8){if(_0x3dfbe8){_0x530386=_0x3dfbe8;_0xc0418c=_0x530386[_0xfac8('0xf')]||0x1388;}})[_0xfac8('0x10')](function(){return dbH[_0xfac8('0x11')][_0xfac8('0x12')](util[_0xfac8('0x13')](_0xfac8('0x14'),QUERY),{'type':dbH[_0xfac8('0x11')][_0xfac8('0x15')][_0xfac8('0x16')]});})[_0xfac8('0x10')](function(_0x58825b){if(!_0x58825b[0x0][_0xfac8('0x17')]){return analyticExtractedReport(_0xfac8('0x18'));}var _0xf64265=[];var _0x297895=0x0;if(_0x530386[_0xfac8('0xe')]){if(_0x58825b&&_0x58825b[_0xfac8('0x19')]){var _0x278bcd=_['range'](_0x58825b[0x0]['num']/_0xc0418c);var _0xa72616=Number[_0xfac8('0x1a')](_0x58825b[0x0][_0xfac8('0x17')]/_0xc0418c)?_0x58825b[0x0][_0xfac8('0x17')]%_0xc0418c:0x0;_0x278bcd[_0xfac8('0x1b')](function(_0x3bbbb1){if(_0x3bbbb1>0x0){_0x297895+=_0xc0418c;}_0xf64265[_0xfac8('0x1c')](dbH[_0xfac8('0x11')]['query'](util[_0xfac8('0x13')](_0xfac8('0x1d'),QUERY,_0xc0418c,_0x297895),{'type':dbH[_0xfac8('0x11')][_0xfac8('0x15')][_0xfac8('0x16')]}));});if(_0xa72616>0x0){_0x297895+=_0xc0418c;_0xf64265['push'](dbH[_0xfac8('0x11')][_0xfac8('0x12')](util[_0xfac8('0x13')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xa72616,_0x297895),{'type':dbH['sequelize'][_0xfac8('0x15')][_0xfac8('0x16')]}));}}}else{_0xf64265[_0xfac8('0x1c')](dbH[_0xfac8('0x11')][_0xfac8('0x12')](QUERY,{'type':dbH[_0xfac8('0x11')][_0xfac8('0x15')][_0xfac8('0x16')]}));}var _0x1ca738=path['dirname'](PATH);var _0x406fe0=path[_0xfac8('0x1e')](PATH,_0xfac8('0x1f'));var _0x12a000=_0x530386[_0xfac8('0xe')]&&_0xf64265[_0xfac8('0x19')]>0x1;var _0x946546=[];if(!fs[_0xfac8('0x20')](path[_0xfac8('0x21')](_0x1ca738,_0x406fe0))&&_0x12a000){fs[_0xfac8('0x22')](path[_0xfac8('0x21')](_0x1ca738,_0x406fe0));}return BPromise[_0xfac8('0x23')](_0xf64265,function(_0x1127c9){_0x946546[_0xfac8('0x1c')](_0x1127c9);})[_0xfac8('0x10')](function(){for(var _0x10ff6e=0x0;_0x10ff6e<_0x946546['length'];_0x10ff6e+=0x1){var _0xc39186;var _0x2ea56e=_0x946546[_0x10ff6e];if(_0x12a000){_0xc39186=path['join'](_0x1ca738,_0x406fe0,util[_0xfac8('0x13')](_0xfac8('0x24'),_0x406fe0,_0x10ff6e,'csv'));}else{_0xc39186=path[_0xfac8('0x21')](_0x1ca738,util[_0xfac8('0x13')](_0xfac8('0x25'),_0x406fe0,_0xfac8('0x26')));}fs[_0xfac8('0x27')](_0xc39186,csv(_0x2ea56e));}})[_0xfac8('0x10')](function(){if(_0x12a000){return new Promise(function(_0x1531bd){zipdir(path[_0xfac8('0x21')](_0x1ca738,_0x406fe0),{'saveTo':path[_0xfac8('0x21')](_0x1ca738,util[_0xfac8('0x13')](_0xfac8('0x25'),_0x406fe0,_0xfac8('0x28')))},function(_0x258fb3,_0x3cfe16){rimraf(path[_0xfac8('0x21')](_0x1ca738,_0x406fe0),function(){});_0x1531bd(_0xfac8('0x29'));});});}})[_0xfac8('0x10')](function(){logger[_0xfac8('0xa')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xfac8('0xc')));return analyticExtractedReport(_0xfac8('0x2a'),_0x12a000?util[_0xfac8('0x13')](_0xfac8('0x25'),_0x406fe0,_0x12a000?_0xfac8('0x28'):'csv'):null);});})[_0xfac8('0x2b')](function(_0x27ac83){logger[_0xfac8('0xa')](util[_0xfac8('0x13')](_0xfac8('0x2c'),EXTRACTED_REPORT_ID,_0xfac8('0xc')),util[_0xfac8('0x2d')](_0x27ac83,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xfac8('0x2e'));})['finally'](function(){process[_0xfac8('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x3a43=['util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','split','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','existsSync','each','then','join','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit'];(function(_0x327906,_0x14b2cb){var _0x433798=function(_0x527d60){while(--_0x527d60){_0x327906['push'](_0x327906['shift']());}};_0x433798(++_0x14b2cb);}(_0x3a43,0x126));var _0x33a4=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0x3a43[_0x2de0a7];return _0x429437;};'use strict';var util=require(_0x33a4('0x0'));var path=require(_0x33a4('0x1'));var _=require(_0x33a4('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x33a4('0x3'));var zipdir=require(_0x33a4('0x4'));var rimraf=require(_0x33a4('0x5'));var db=require(_0x33a4('0x6'))['db'];var dbH=require(_0x33a4('0x6'))[_0x33a4('0x7')];var logger=require(_0x33a4('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x33a4('0x9')][0x2]);var QUERY=process[_0x33a4('0x9')][0x3];var PATH=process[_0x33a4('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5b97c4,_0x3076f8){var _0x5bb28e={'status':_0x5b97c4};var _0x4ecde3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3076f8){_0x5bb28e['savename']=_0x3076f8;}return db[_0x33a4('0xa')][_0x33a4('0xb')](_0x5bb28e,_0x4ecde3);}function main(){var _0x40c659=0x1388;var _0x3d4c44;logger[_0x33a4('0xc')](util[_0x33a4('0xd')](_0x33a4('0xe'),EXTRACTED_REPORT_ID,_0x33a4('0xf')));return db[_0x33a4('0x10')][_0x33a4('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})['then'](function(_0x36b565){if(_0x36b565){_0x3d4c44=_0x36b565;_0x40c659=_0x3d4c44[_0x33a4('0x12')]||0x1388;}})['then'](function(){return dbH[_0x33a4('0x13')][_0x33a4('0x14')](util['format'](_0x33a4('0x15'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x33a4('0x16')]});})['then'](function(_0x45d922){if(!_0x45d922[0x0]['num']){return analyticExtractedReport(_0x33a4('0x17'));}var _0x47fb63=[];var _0x33f695=0x0;if(_0x3d4c44[_0x33a4('0x18')]){if(_0x45d922&&_0x45d922[_0x33a4('0x19')]){var _0x13a0f1=_['range'](_0x45d922[0x0][_0x33a4('0x1a')]/_0x40c659);var _0x5f30ed=Number['isInteger'](_0x45d922[0x0][_0x33a4('0x1a')]/_0x40c659)?_0x45d922[0x0][_0x33a4('0x1a')]%_0x40c659:0x0;_0x13a0f1['forEach'](function(_0x1fcf44){if(_0x1fcf44>0x0){_0x33f695+=_0x40c659;}_0x47fb63[_0x33a4('0x1b')](dbH[_0x33a4('0x13')]['query'](util[_0x33a4('0xd')](_0x33a4('0x1c'),QUERY,_0x40c659,_0x33f695),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));});if(_0x5f30ed>0x0){_0x33f695+=_0x40c659;_0x47fb63[_0x33a4('0x1b')](dbH['sequelize'][_0x33a4('0x14')](util[_0x33a4('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5f30ed,_0x33f695),{'type':dbH[_0x33a4('0x13')]['QueryTypes'][_0x33a4('0x16')]}));}}}else{_0x47fb63[_0x33a4('0x1b')](dbH[_0x33a4('0x13')][_0x33a4('0x14')](QUERY,{'type':dbH['sequelize'][_0x33a4('0x1d')][_0x33a4('0x16')]}));}var _0x3df1b0=path[_0x33a4('0x1e')](PATH);var _0x12311a=path[_0x33a4('0x1f')](PATH,_0x33a4('0x20'));var _0x3acf20=_0x3d4c44[_0x33a4('0x18')]&&_0x47fb63[_0x33a4('0x19')]>0x1;var _0x337d3e=[];if(!fs[_0x33a4('0x21')](path['join'](_0x3df1b0,_0x12311a))&&_0x3acf20){fs['mkdirSync'](path['join'](_0x3df1b0,_0x12311a));}return BPromise[_0x33a4('0x22')](_0x47fb63,function(_0x4ed1bc){_0x337d3e[_0x33a4('0x1b')](_0x4ed1bc);})[_0x33a4('0x23')](function(){for(var _0x10753a=0x0;_0x10753a<_0x337d3e[_0x33a4('0x19')];_0x10753a+=0x1){var _0x13ed25;var _0x113ea7=_0x337d3e[_0x10753a];if(_0x3acf20){_0x13ed25=path[_0x33a4('0x24')](_0x3df1b0,_0x12311a,util['format']('%s%d.%s',_0x12311a,_0x10753a,_0x33a4('0x25')));}else{_0x13ed25=path[_0x33a4('0x24')](_0x3df1b0,util[_0x33a4('0xd')](_0x33a4('0x26'),_0x12311a,_0x33a4('0x25')));}fs[_0x33a4('0x27')](_0x13ed25,csv(_0x113ea7));}})['then'](function(){if(_0x3acf20){return new Promise(function(_0x548f2a){zipdir(path[_0x33a4('0x24')](_0x3df1b0,_0x12311a),{'saveTo':path['join'](_0x3df1b0,util[_0x33a4('0xd')]('%s.%s',_0x12311a,_0x33a4('0x28')))},function(_0x51769d,_0x427f17){rimraf(path[_0x33a4('0x24')](_0x3df1b0,_0x12311a),function(){});_0x548f2a(_0x33a4('0x29'));});});}})[_0x33a4('0x23')](function(){logger[_0x33a4('0xc')](util[_0x33a4('0xd')](_0x33a4('0x2a'),EXTRACTED_REPORT_ID,_0x33a4('0xf')));return analyticExtractedReport(_0x33a4('0x2b'),_0x3acf20?util[_0x33a4('0xd')](_0x33a4('0x26'),_0x12311a,_0x3acf20?_0x33a4('0x28'):_0x33a4('0x25')):null);});})[_0x33a4('0x2c')](function(_0x41d36e){logger[_0x33a4('0xc')](util[_0x33a4('0xd')](_0x33a4('0x2d'),EXTRACTED_REPORT_ID,_0x33a4('0xf')),util['inspect'](_0x41d36e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x33a4('0x2e'));})[_0x33a4('0x2f')](function(){process[_0x33a4('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 2c22a81..70a230e 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 _0xc84e=['sequelize','SELECT','QueryTypes','dirname','basename','.pdf','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','end','createPdfFromHTML','lodash','path','html-to-pdfmake','pdfmake/src/printer','rimraf','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','toString','value','fill','length','auto','body','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','push','header','pageBreak','before','margin','landscape','\x20/\x20','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','query'];(function(_0x5f60b3,_0x3895e0){var _0x4c7b1a=function(_0x43dd2c){while(--_0x43dd2c){_0x5f60b3['push'](_0x5f60b3['shift']());}};_0x4c7b1a(++_0x3895e0);}(_0xc84e,0xdc));var _0xec84=function(_0xdea6e1,_0x44325d){_0xdea6e1=_0xdea6e1-0x0;var _0x4a4076=_0xc84e[_0xdea6e1];return _0x4a4076;};'use strict';var _=require(_0xec84('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xec84('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0xec84('0x2'));var PdfPrinter=require(_0xec84('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xec84('0x4'));var JSDOM=require('jsdom')[_0xec84('0x5')];var window=new JSDOM('')[_0xec84('0x6')];var BPromise=require(_0xec84('0x7'));var db=require(_0xec84('0x8'))['db'];var dbH=require(_0xec84('0x8'))['dbH'];var logger=require(_0xec84('0x9'))(_0xec84('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xec84('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xec84('0xb')][0x5];var FORMAT=_0xec84('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x18e59c,_0x59c575){var _0x58c05e={'status':_0x18e59c};var _0x164703={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x59c575){_0x58c05e['savename']=_0x59c575;}return db[_0xec84('0xd')][_0xec84('0xe')](_0x58c05e,_0x164703);}function getHeaders(_0x1562fd){return _[_0xec84('0xf')](_0x1562fd,function(_0x364d42){return{'text':_0x364d42,'style':_0xec84('0x10')};});}function getRows(_0x167cda,_0xb2debf){return _[_0xec84('0xf')](_0xb2debf,function(_0x2a6421){return _(_0x2a6421)['pick'](_0x167cda)[_0xec84('0xf')](function(_0x2d3782){return _0x2d3782?_[_0xec84('0x11')](_0x2d3782):'';})[_0xec84('0x12')]();});}function createTable(_0x38c2b1,_0x74ed38){var _0x2bae9b={'widths':_[_0xec84('0x13')](Array(_0x38c2b1[_0xec84('0x14')]),0x91),'heights':function(_0x4a88a1){return _0x4a88a1===0x0?_0xec84('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1c7eca=getHeaders(_0x38c2b1);_0x2bae9b[_0xec84('0x16')]['push'](_0x1c7eca);var _0x4fdc24=getRows(_0x38c2b1,_0x74ed38);_0x2bae9b[_0xec84('0x16')]=_0x2bae9b[_0xec84('0x16')][_0xec84('0x17')](_0x4fdc24);return _0x2bae9b;}function createTables(_0x539c26){var _0xbb8384=[];var _0x15ce77=_[_0xec84('0x18')](Object[_0xec84('0x19')](_0x539c26[0x0]),0x5);_0x15ce77[_0xec84('0x1a')](function(_0x162b70){_0xbb8384['push'](createTable(_0x162b70,_0x539c26));});return _0xbb8384;}function getPDFDocDefinition(_0x10bc41){var _0x339e5e=util[_0xec84('0x1b')](_0xec84('0x1c'),NAME,EXTRACTED_REPORT[_0xec84('0x1d')],moment(EXTRACTED_REPORT[_0xec84('0x1e')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xec84('0x1f')])[_0xec84('0x1b')](FORMAT));var _0x4f1709=[];for(var _0xe1d7ac=0x0;_0xe1d7ac<_0x10bc41[_0xec84('0x14')];_0xe1d7ac++){var _0x1cbef5=[];if(_0xe1d7ac===0x0){_0x1cbef5[_0xec84('0x20')]({'text':_0x339e5e,'style':_0xec84('0x21')});}var _0x4246ef={'table':_0x10bc41[_0xe1d7ac]};if(_0xe1d7ac>0x0){_0x4246ef[_0xec84('0x22')]=_0xec84('0x23');_0x4246ef[_0xec84('0x24')]=[0x0,0x46,0x0,0x0];}_0x1cbef5[_0xec84('0x20')](_0x4246ef);_0x4f1709[_0xec84('0x20')](_0x1cbef5);}return{'pageSize':'A4','pageOrientation':_0xec84('0x25'),'content':_0x4f1709,'footer':function(_0x4c3f87,_0x52741b){return{'text':_0x4c3f87['toString']()+_0xec84('0x26')+_0x52741b,'style':'footer'};},'defaultStyle':{'font':_0xec84('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xec84('0x28')},'footer':{'alignment':_0xec84('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x353fa8){var _0x1b70ba=0x1388;var _0x3d635c;if(!_0x353fa8[0x0][_0xec84('0x2a')]){return analyticExtractedReport(_0xec84('0x2b'));}return db[_0xec84('0x2c')][_0xec84('0x2d')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xec84('0x2e'),_0xec84('0x2f')]})[_0xec84('0x30')](function(_0x5eaab1){if(_0x5eaab1){_0x3d635c=_0x5eaab1;_0x1b70ba=_0x3d635c[_0xec84('0x2f')]||0x3e8;}})[_0xec84('0x30')](function(){var _0x2b881=[];var _0x5f439b=0x0;if(_0x3d635c[_0xec84('0x2e')]){if(_0x353fa8&&_0x353fa8[_0xec84('0x14')]){var _0x184dae=_['range'](_0x353fa8[0x0][_0xec84('0x2a')]/_0x1b70ba);var _0x8f2153=Number['isInteger'](_0x353fa8[0x0]['num']/_0x1b70ba)?_0x353fa8[0x0][_0xec84('0x2a')]%_0x1b70ba:0x0;_0x184dae[_0xec84('0x1a')](function(_0x11a869){if(_0x11a869>0x0){_0x5f439b+=_0x1b70ba;}_0x2b881[_0xec84('0x20')](dbH['sequelize'][_0xec84('0x31')](util[_0xec84('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1b70ba,_0x5f439b),{'type':dbH[_0xec84('0x32')]['QueryTypes'][_0xec84('0x33')]}));});if(_0x8f2153>0x0){_0x5f439b+=_0x1b70ba;_0x2b881[_0xec84('0x20')](dbH[_0xec84('0x32')]['query'](util[_0xec84('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x8f2153,_0x5f439b),{'type':dbH[_0xec84('0x32')][_0xec84('0x34')][_0xec84('0x33')]}));}}}else{_0x2b881[_0xec84('0x20')](dbH[_0xec84('0x32')][_0xec84('0x31')](QUERY,{'type':dbH[_0xec84('0x32')][_0xec84('0x34')][_0xec84('0x33')]}));}var _0x4fed86=path[_0xec84('0x35')](PATH);var _0x314d30=path[_0xec84('0x36')](PATH,_0xec84('0x37'));var _0x40b003=_0x3d635c[_0xec84('0x2e')]&&_0x2b881[_0xec84('0x14')]>0x1;var _0x16bd23=[];if(!fs[_0xec84('0x38')](path[_0xec84('0x39')](_0x4fed86,_0x314d30))&&_0x40b003){fs['mkdirSync'](path[_0xec84('0x39')](_0x4fed86,_0x314d30));}return BPromise[_0xec84('0x3a')](_0x2b881,function(_0x82f827){_0x16bd23[_0xec84('0x20')](_0x82f827);})[_0xec84('0x30')](function(){var _0x4a4cbe=[];for(var _0x50b143=0x0;_0x50b143<_0x16bd23[_0xec84('0x14')];_0x50b143+=0x1){var _0x1f2631=_0x16bd23[_0x50b143];var _0x31d0bb=createTables(_[_0xec84('0x3b')](_0x1f2631));var _0x261305;var _0x13443f=getPDFDocDefinition(_0x31d0bb);var _0x3d2e14=getPDFPrinter();var _0x184943=_0x3d2e14[_0xec84('0x3c')](_0x13443f);if(_0x40b003){_0x261305=path[_0xec84('0x39')](_0x4fed86,_0x314d30,util[_0xec84('0x1b')](_0xec84('0x3d'),_0x314d30,_0x50b143,_0xec84('0x3e')));}else{_0x261305=path['join'](_0x4fed86,util[_0xec84('0x1b')](_0xec84('0x3f'),_0x314d30,_0xec84('0x3e')));}_0x4a4cbe[_0xec84('0x20')](writePDFDocument(_0x184943,_0x261305));}return Promise[_0xec84('0x40')](_0x4a4cbe);})['then'](function(){if(_0x40b003){return new Promise(function(_0x4937c3){zipdir(path[_0xec84('0x39')](_0x4fed86,_0x314d30),{'saveTo':path[_0xec84('0x39')](_0x4fed86,util['format']('%s.%s',_0x314d30,'zip'))},function(){rimraf(path['join'](_0x4fed86,_0x314d30),function(){});_0x4937c3('zip\x20finished');});});}})[_0xec84('0x30')](function(){if(!_0x40b003)return;rimraf(path[_0xec84('0x39')](_0x4fed86,_0x314d30),function(){});})[_0xec84('0x30')](function(){logger[_0xec84('0x41')](util[_0xec84('0x1b')](_0xec84('0x42'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xec84('0x43'),_0x40b003?util[_0xec84('0x1b')](_0xec84('0x3f'),_0x314d30,_0x40b003?_0xec84('0x44'):_0xec84('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xec84('0x41')](util[_0xec84('0x1b')](_0xec84('0x45'),EXTRACTED_REPORT_ID,_0xec84('0x46')));return db[_0xec84('0xd')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xec84('0x30')](function(_0x40cdc0){EXTRACTED_REPORT=_0x40cdc0;return dbH['sequelize']['query'](util['format'](_0xec84('0x47'),QUERY),{'type':dbH[_0xec84('0x32')][_0xec84('0x34')][_0xec84('0x33')]});})[_0xec84('0x30')](extractReport)[_0xec84('0x48')](function(_0x3d28d4){logger[_0xec84('0x41')](util[_0xec84('0x1b')](_0xec84('0x49'),EXTRACTED_REPORT_ID,_0xec84('0x46')),util[_0xec84('0x4a')](_0x3d28d4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xec84('0x4b'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1b986a=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xec84('0x4c'),'bolditalics':__dirname+_0xec84('0x4d')}});return _0x1b986a;}function getPDFDocDefinitionFromHTML(_0x468d6d,_0x555f8c){var _0x5e87c3=util[_0xec84('0x1b')]('%s\x20#%d',_0x555f8c[_0xec84('0x4e')],_0x555f8c[_0xec84('0x4f')]);var _0x1c0d5f=moment()[_0xec84('0x1b')](_0xec84('0x50'))['toString']();var _0x5af11b=htmlToPdfmake(_0x468d6d,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5af11b],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xec84('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xec84('0x51')}},'header':function(){return[{'text':_0xec84('0x52'),'style':_0xec84('0x21')}];},'footer':function(_0x49e7dc,_0x41d54c){return[{'text':util['format'](_0xec84('0x53'),_0x5e87c3,_0x49e7dc,_0x41d54c,_0x1c0d5f),'style':_0xec84('0x54')}];}};}function writePDFDocument(_0x411b42,_0x2bf89d){return new Promise(function(_0x1a313c,_0x3c1d20){var _0x55702a=_0x411b42[_0xec84('0x55')](fs[_0xec84('0x56')](_0x2bf89d));_0x55702a['on'](_0xec84('0x57'),function(){_0x1a313c('finish');});_0x55702a['on']('error',function(_0x3afa51){_0x3c1d20(_0x3afa51);});_0x411b42[_0xec84('0x58')]();});}exports[_0xec84('0x59')]=function(_0x4b1089,_0x52c264){var _0x402e34=getPDFPrinter();var _0x4fe206=getPDFDocDefinitionFromHTML(_0x4b1089,_0x52c264);var _0x455db7=_0x402e34[_0xec84('0x3c')](_0x4fe206);return writePDFDocument(_0x455db7,_0x52c264[_0xec84('0x1')])[_0xec84('0x48')](function(_0x542794){throw _0x542794;});}; \ No newline at end of file +var _0x73fa=['zip-dir','rimraf','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','toString','fill','length','body','push','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','header','landscape','\x20/\x20','footer','black','right','num','Empty','Setting','split','then','range','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','mkdirSync','each','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-bold.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','pipe','createWriteStream','finish','error','end','createPdfFromHTML','path','catch','util','moment','html-to-pdfmake','pdfmake/src/printer'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0x73fa,0x1f4));var _0xa73f=function(_0x5ca82d,_0x7d11a0){_0x5ca82d=_0x5ca82d-0x0;var _0x397661=_0x73fa[_0x5ca82d];return _0x397661;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xa73f('0x0'));var path=require('path');var moment=require(_0xa73f('0x1'));var htmlToPdfmake=require(_0xa73f('0x2'));var PdfPrinter=require(_0xa73f('0x3'));var zipdir=require(_0xa73f('0x4'));var rimraf=require(_0xa73f('0x5'));var JSDOM=require('jsdom')[_0xa73f('0x6')];var window=new JSDOM('')[_0xa73f('0x7')];var BPromise=require(_0xa73f('0x8'));var db=require(_0xa73f('0x9'))['db'];var dbH=require(_0xa73f('0x9'))[_0xa73f('0xa')];var logger=require(_0xa73f('0xb'))(_0xa73f('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xa73f('0xd')][0x2]);var QUERY=process[_0xa73f('0xd')][0x3];var PATH=process[_0xa73f('0xd')][0x4];var NAME=process[_0xa73f('0xd')][0x5];var FORMAT=_0xa73f('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5397d3,_0x322a58){var _0x3dada3={'status':_0x5397d3};var _0x309fe2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x322a58){_0x3dada3[_0xa73f('0xf')]=_0x322a58;}return db[_0xa73f('0x10')][_0xa73f('0x11')](_0x3dada3,_0x309fe2);}function getHeaders(_0x563926){return _[_0xa73f('0x12')](_0x563926,function(_0x92e6bd){return{'text':_0x92e6bd,'style':_0xa73f('0x13')};});}function getRows(_0x5c7a75,_0x43e559){return _[_0xa73f('0x12')](_0x43e559,function(_0x46dbbb){return _(_0x46dbbb)['pick'](_0x5c7a75)[_0xa73f('0x12')](function(_0x228fae){return _0x228fae?_[_0xa73f('0x14')](_0x228fae):'';})['value']();});}function createTable(_0x2712e9,_0x3b8aca){var _0x2f1cbd={'widths':_[_0xa73f('0x15')](Array(_0x2712e9[_0xa73f('0x16')]),0x91),'heights':function(_0x5e204d){return _0x5e204d===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3b99e2=getHeaders(_0x2712e9);_0x2f1cbd[_0xa73f('0x17')][_0xa73f('0x18')](_0x3b99e2);var _0x305d22=getRows(_0x2712e9,_0x3b8aca);_0x2f1cbd[_0xa73f('0x17')]=_0x2f1cbd['body']['concat'](_0x305d22);return _0x2f1cbd;}function createTables(_0x4d22d8){var _0x459dae=[];var _0x3a7eca=_[_0xa73f('0x19')](Object[_0xa73f('0x1a')](_0x4d22d8[0x0]),0x5);_0x3a7eca[_0xa73f('0x1b')](function(_0x1b1bb7){_0x459dae['push'](createTable(_0x1b1bb7,_0x4d22d8));});return _0x459dae;}function getPDFDocDefinition(_0xb9c060){var _0x2bd654=util[_0xa73f('0x1c')](_0xa73f('0x1d'),NAME,EXTRACTED_REPORT[_0xa73f('0x1e')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xa73f('0x1c')](FORMAT));var _0x24c1f1=[];for(var _0xd0f257=0x0;_0xd0f257<_0xb9c060[_0xa73f('0x16')];_0xd0f257++){var _0x2bc08d=[];if(_0xd0f257===0x0){_0x2bc08d[_0xa73f('0x18')]({'text':_0x2bd654,'style':_0xa73f('0x1f')});}var _0x326eaf={'table':_0xb9c060[_0xd0f257]};if(_0xd0f257>0x0){_0x326eaf['pageBreak']='before';_0x326eaf['margin']=[0x0,0x46,0x0,0x0];}_0x2bc08d[_0xa73f('0x18')](_0x326eaf);_0x24c1f1[_0xa73f('0x18')](_0x2bc08d);}return{'pageSize':'A4','pageOrientation':_0xa73f('0x20'),'content':_0x24c1f1,'footer':function(_0x381edd,_0x3d3dca){return{'text':_0x381edd[_0xa73f('0x14')]()+_0xa73f('0x21')+_0x3d3dca,'style':_0xa73f('0x22')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xa73f('0x23')},'footer':{'alignment':_0xa73f('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5171e5){var _0x1e1fe9=0x1388;var _0x391e77;if(!_0x5171e5[0x0][_0xa73f('0x25')]){return analyticExtractedReport(_0xa73f('0x26'));}return db[_0xa73f('0x27')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa73f('0x28'),'splitSizePdf']})[_0xa73f('0x29')](function(_0xb579c7){if(_0xb579c7){_0x391e77=_0xb579c7;_0x1e1fe9=_0x391e77['splitSizePdf']||0x3e8;}})[_0xa73f('0x29')](function(){var _0x5c0bb8=[];var _0x272c89=0x0;if(_0x391e77[_0xa73f('0x28')]){if(_0x5171e5&&_0x5171e5[_0xa73f('0x16')]){var _0x4acea7=_[_0xa73f('0x2a')](_0x5171e5[0x0][_0xa73f('0x25')]/_0x1e1fe9);var _0x565e43=Number['isInteger'](_0x5171e5[0x0]['num']/_0x1e1fe9)?_0x5171e5[0x0][_0xa73f('0x25')]%_0x1e1fe9:0x0;_0x4acea7[_0xa73f('0x1b')](function(_0x26919a){if(_0x26919a>0x0){_0x272c89+=_0x1e1fe9;}_0x5c0bb8[_0xa73f('0x18')](dbH[_0xa73f('0x2b')]['query'](util[_0xa73f('0x1c')](_0xa73f('0x2c'),QUERY,_0x1e1fe9,_0x272c89),{'type':dbH[_0xa73f('0x2b')][_0xa73f('0x2d')][_0xa73f('0x2e')]}));});if(_0x565e43>0x0){_0x272c89+=_0x1e1fe9;_0x5c0bb8[_0xa73f('0x18')](dbH['sequelize'][_0xa73f('0x2f')](util['format'](_0xa73f('0x2c'),QUERY,_0x565e43,_0x272c89),{'type':dbH['sequelize'][_0xa73f('0x2d')][_0xa73f('0x2e')]}));}}}else{_0x5c0bb8[_0xa73f('0x18')](dbH[_0xa73f('0x2b')][_0xa73f('0x2f')](QUERY,{'type':dbH[_0xa73f('0x2b')][_0xa73f('0x2d')][_0xa73f('0x2e')]}));}var _0x361d1a=path[_0xa73f('0x30')](PATH);var _0x4757ba=path[_0xa73f('0x31')](PATH,_0xa73f('0x32'));var _0x3bb60a=_0x391e77['split']&&_0x5c0bb8[_0xa73f('0x16')]>0x1;var _0x2f1fb8=[];if(!fs[_0xa73f('0x33')](path[_0xa73f('0x34')](_0x361d1a,_0x4757ba))&&_0x3bb60a){fs[_0xa73f('0x35')](path[_0xa73f('0x34')](_0x361d1a,_0x4757ba));}return BPromise[_0xa73f('0x36')](_0x5c0bb8,function(_0x4c9700){_0x2f1fb8[_0xa73f('0x18')](_0x4c9700);})[_0xa73f('0x29')](function(){var _0x412dbf=[];for(var _0x1a8dd1=0x0;_0x1a8dd1<_0x2f1fb8['length'];_0x1a8dd1+=0x1){var _0x42c401=_0x2f1fb8[_0x1a8dd1];var _0x2ebedd=createTables(_['flatten'](_0x42c401));var _0x211503;var _0x154d1b=getPDFDocDefinition(_0x2ebedd);var _0x11c981=getPDFPrinter();var _0x276ef6=_0x11c981[_0xa73f('0x37')](_0x154d1b);if(_0x3bb60a){_0x211503=path[_0xa73f('0x34')](_0x361d1a,_0x4757ba,util['format'](_0xa73f('0x38'),_0x4757ba,_0x1a8dd1,_0xa73f('0x39')));}else{_0x211503=path['join'](_0x361d1a,util[_0xa73f('0x1c')](_0xa73f('0x3a'),_0x4757ba,_0xa73f('0x39')));}_0x412dbf[_0xa73f('0x18')](writePDFDocument(_0x276ef6,_0x211503));}return Promise['all'](_0x412dbf);})[_0xa73f('0x29')](function(){if(_0x3bb60a){return new Promise(function(_0x5b66ca){zipdir(path[_0xa73f('0x34')](_0x361d1a,_0x4757ba),{'saveTo':path[_0xa73f('0x34')](_0x361d1a,util['format']('%s.%s',_0x4757ba,_0xa73f('0x3b')))},function(){rimraf(path[_0xa73f('0x34')](_0x361d1a,_0x4757ba),function(){});_0x5b66ca(_0xa73f('0x3c'));});});}})['then'](function(){if(!_0x3bb60a)return;rimraf(path[_0xa73f('0x34')](_0x361d1a,_0x4757ba),function(){});})[_0xa73f('0x29')](function(){logger['info'](util['format'](_0xa73f('0x3d'),EXTRACTED_REPORT_ID,_0xa73f('0x3e')));return analyticExtractedReport('Completed',_0x3bb60a?util[_0xa73f('0x1c')](_0xa73f('0x3a'),_0x4757ba,_0x3bb60a?_0xa73f('0x3b'):_0xa73f('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xa73f('0x1c')](_0xa73f('0x3f'),EXTRACTED_REPORT_ID,_0xa73f('0x3e')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x42a79c){EXTRACTED_REPORT=_0x42a79c;return dbH[_0xa73f('0x2b')][_0xa73f('0x2f')](util[_0xa73f('0x1c')](_0xa73f('0x40'),QUERY),{'type':dbH[_0xa73f('0x2b')][_0xa73f('0x2d')]['SELECT']});})[_0xa73f('0x29')](extractReport)['catch'](function(_0x2c4024){logger[_0xa73f('0x41')](util[_0xa73f('0x1c')](_0xa73f('0x42'),EXTRACTED_REPORT_ID,_0xa73f('0x3e')),util[_0xa73f('0x43')](_0x2c4024,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xa73f('0x44')](function(){process[_0xa73f('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x32358b=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xa73f('0x46'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x32358b;}function getPDFDocDefinitionFromHTML(_0x416c16,_0x13134d){var _0x2a1852=util[_0xa73f('0x1c')](_0xa73f('0x47'),_0x13134d[_0xa73f('0x48')],_0x13134d[_0xa73f('0x49')]);var _0x11c76f=moment()['format'](_0xa73f('0x4a'))[_0xa73f('0x14')]();var _0x15ada2=htmlToPdfmake(_0x416c16,{'window':window,'tableAutoSize':!![]});return{'content':[_0x15ada2],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xa73f('0x4b'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x4c0705,_0x1ea298){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x2a1852,_0x4c0705,_0x1ea298,_0x11c76f),'style':'footer'}];}};}function writePDFDocument(_0x383e3f,_0x39fc23){return new Promise(function(_0xe75d44,_0x4dca54){var _0x520fd0=_0x383e3f[_0xa73f('0x4c')](fs[_0xa73f('0x4d')](_0x39fc23));_0x520fd0['on'](_0xa73f('0x4e'),function(){_0xe75d44(_0xa73f('0x4e'));});_0x520fd0['on'](_0xa73f('0x4f'),function(_0x330bbe){_0x4dca54(_0x330bbe);});_0x383e3f[_0xa73f('0x50')]();});}exports[_0xa73f('0x51')]=function(_0x4436d0,_0xe8d1c7){var _0x1c6faf=getPDFPrinter();var _0x3ebf88=getPDFDocDefinitionFromHTML(_0x4436d0,_0xe8d1c7);var _0x1ddaf5=_0x1c6faf[_0xa73f('0x37')](_0x3ebf88);return writePDFDocument(_0x1ddaf5,_0xe8d1c7[_0xa73f('0x52')])[_0xa73f('0x53')](function(_0x4e2665){throw _0x4e2665;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 5f6e21e..f54875c 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 _0x0924=['finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','range','isInteger','forEach','push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','length','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed'];(function(_0x22e68b,_0xa7a5ed){var _0xf177e4=function(_0x2641ad){while(--_0x2641ad){_0x22e68b['push'](_0x22e68b['shift']());}};_0xf177e4(++_0xa7a5ed);}(_0x0924,0x110));var _0x4092=function(_0x3a115e,_0x3dac39){_0x3a115e=_0x3a115e-0x0;var _0x1b7e61=_0x0924[_0x3a115e];return _0x1b7e61;};'use strict';var util=require(_0x4092('0x0'));var path=require(_0x4092('0x1'));var _=require(_0x4092('0x2'));var fs=require('fs');var json2xls=require(_0x4092('0x3'));var BPromise=require(_0x4092('0x4'));var zipdir=require(_0x4092('0x5'));var rimraf=require('rimraf');var db=require(_0x4092('0x6'))['db'];var dbH=require('../../mysqldb')[_0x4092('0x7')];var logger=require('../../config/logger')(_0x4092('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x4092('0x9')][0x2]);var QUERY=process[_0x4092('0x9')][0x3];var PATH=process[_0x4092('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5b49df,_0x1b8ad5){var _0x5756e2={'status':_0x5b49df};var _0x4497d6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1b8ad5){_0x5756e2[_0x4092('0xa')]=_0x1b8ad5;}return db[_0x4092('0xb')][_0x4092('0xc')](_0x5756e2,_0x4497d6);}function main(){var _0x2b2a4e=0x1388;var _0x36b8ec;logger['info'](util['format'](_0x4092('0xd'),EXTRACTED_REPORT_ID,_0x4092('0xe')));return db[_0x4092('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4092('0x10'),'splitSizeXlsx']})[_0x4092('0x11')](function(_0x305a41){if(_0x305a41){_0x36b8ec=_0x305a41;_0x2b2a4e=_0x36b8ec['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0x4092('0x12')][_0x4092('0x13')](util['format'](_0x4092('0x14'),QUERY),{'type':dbH[_0x4092('0x12')][_0x4092('0x15')]['SELECT']});})[_0x4092('0x11')](function(_0x3ca1ed){if(!_0x3ca1ed[0x0][_0x4092('0x16')]){return analyticExtractedReport(_0x4092('0x17'));}var _0x12b4b1=[];var _0x22d8a6=0x0;if(_0x36b8ec[_0x4092('0x10')]){if(_0x3ca1ed&&_0x3ca1ed['length']){var _0x1a6c4d=_[_0x4092('0x18')](_0x3ca1ed[0x0][_0x4092('0x16')]/_0x2b2a4e);var _0x5531e9=Number[_0x4092('0x19')](_0x3ca1ed[0x0]['num']/_0x2b2a4e)?_0x3ca1ed[0x0][_0x4092('0x16')]%_0x2b2a4e:0x0;_0x1a6c4d[_0x4092('0x1a')](function(_0x52fa30){if(_0x52fa30>0x0){_0x22d8a6+=_0x2b2a4e;}_0x12b4b1[_0x4092('0x1b')](dbH['sequelize']['query'](util[_0x4092('0x1c')](_0x4092('0x1d'),QUERY,_0x2b2a4e,_0x22d8a6),{'type':dbH[_0x4092('0x12')]['QueryTypes'][_0x4092('0x1e')]}));});if(_0x5531e9>0x0){_0x22d8a6+=_0x2b2a4e;_0x12b4b1['push'](dbH[_0x4092('0x12')][_0x4092('0x13')](util[_0x4092('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5531e9,_0x22d8a6),{'type':dbH['sequelize'][_0x4092('0x15')][_0x4092('0x1e')]}));}}}else{_0x12b4b1[_0x4092('0x1b')](dbH['sequelize'][_0x4092('0x13')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x4092('0x1e')]}));}var _0x38e1c6=path[_0x4092('0x1f')](PATH);var _0x557b3f=path[_0x4092('0x20')](PATH,_0x4092('0x21'));var _0x5db8eb=_0x36b8ec['split']&&_0x12b4b1['length']>0x1;var _0x34ebcc=[];if(!fs[_0x4092('0x22')](path[_0x4092('0x23')](_0x38e1c6,_0x557b3f))&&_0x5db8eb){fs[_0x4092('0x24')](path[_0x4092('0x23')](_0x38e1c6,_0x557b3f));}return BPromise[_0x4092('0x25')](_0x12b4b1,function(_0x4efabf){_0x34ebcc[_0x4092('0x1b')](_0x4efabf);})[_0x4092('0x11')](function(){for(var _0xa3d239=0x0;_0xa3d239<_0x34ebcc[_0x4092('0x26')];_0xa3d239+=0x1){var _0x4e7a53;var _0x39fa06=_0x34ebcc[_0xa3d239];if(_0x5db8eb){_0x4e7a53=path[_0x4092('0x23')](_0x38e1c6,_0x557b3f,util['format'](_0x4092('0x27'),_0x557b3f,_0xa3d239,_0x4092('0x28')));}else{_0x4e7a53=path['join'](_0x38e1c6,util[_0x4092('0x1c')](_0x4092('0x29'),_0x557b3f,_0x4092('0x28')));}fs[_0x4092('0x2a')](_0x4e7a53,json2xls(_0x39fa06),_0x4092('0x2b'));}})['then'](function(){if(_0x5db8eb){return new Promise(function(_0x5b01aa){zipdir(path[_0x4092('0x23')](_0x38e1c6,_0x557b3f),{'saveTo':path[_0x4092('0x23')](_0x38e1c6,util[_0x4092('0x1c')](_0x4092('0x29'),_0x557b3f,_0x4092('0x2c')))},function(_0x93be56,_0x40d9f){rimraf(path['join'](_0x38e1c6,_0x557b3f),function(){});_0x5b01aa(_0x4092('0x2d'));});});}})[_0x4092('0x11')](function(){logger['info'](util[_0x4092('0x1c')](_0x4092('0x2e'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x4092('0x2f'),_0x5db8eb?util['format'](_0x4092('0x29'),_0x557b3f,_0x5db8eb?'zip':_0x4092('0x28')):null);});})[_0x4092('0x30')](function(_0x1ae54d){logger['info'](util[_0x4092('0x1c')](_0x4092('0x31'),EXTRACTED_REPORT_ID,_0x4092('0xe')),util[_0x4092('0x32')](_0x1ae54d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4092('0x33'));})[_0x4092('0x34')](function(){process[_0x4092('0x35')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x1049=['catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','util','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT','num','Empty','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname','length','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed'];(function(_0x359d9b,_0x201733){var _0x3238fa=function(_0x3f1436){while(--_0x3f1436){_0x359d9b['push'](_0x359d9b['shift']());}};_0x3238fa(++_0x201733);}(_0x1049,0xe5));var _0x9104=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1049[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x9104('0x0'));var path=require('path');var _=require(_0x9104('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x9104('0x2'));var zipdir=require(_0x9104('0x3'));var rimraf=require(_0x9104('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x9104('0x5'))[_0x9104('0x6')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x9104('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1d9a69,_0x292b28){var _0x3af82c={'status':_0x1d9a69};var _0x303682={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x292b28){_0x3af82c[_0x9104('0x8')]=_0x292b28;}return db[_0x9104('0x9')][_0x9104('0xa')](_0x3af82c,_0x303682);}function main(){var _0x3c57fc=0x1388;var _0x379acb;logger[_0x9104('0xb')](util[_0x9104('0xc')](_0x9104('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x9104('0xe')][_0x9104('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9104('0x10'),_0x9104('0x11')]})[_0x9104('0x12')](function(_0x43328d){if(_0x43328d){_0x379acb=_0x43328d;_0x3c57fc=_0x379acb[_0x9104('0x11')]||0x1388;}})[_0x9104('0x12')](function(){return dbH[_0x9104('0x13')][_0x9104('0x14')](util[_0x9104('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x9104('0x13')]['QueryTypes'][_0x9104('0x15')]});})[_0x9104('0x12')](function(_0x31de50){if(!_0x31de50[0x0][_0x9104('0x16')]){return analyticExtractedReport(_0x9104('0x17'));}var _0x483434=[];var _0x1980d8=0x0;if(_0x379acb['split']){if(_0x31de50&&_0x31de50['length']){var _0x51171d=_['range'](_0x31de50[0x0][_0x9104('0x16')]/_0x3c57fc);var _0x38d768=Number[_0x9104('0x18')](_0x31de50[0x0][_0x9104('0x16')]/_0x3c57fc)?_0x31de50[0x0]['num']%_0x3c57fc:0x0;_0x51171d[_0x9104('0x19')](function(_0x24e042){if(_0x24e042>0x0){_0x1980d8+=_0x3c57fc;}_0x483434['push'](dbH[_0x9104('0x13')][_0x9104('0x14')](util[_0x9104('0xc')](_0x9104('0x1a'),QUERY,_0x3c57fc,_0x1980d8),{'type':dbH['sequelize'][_0x9104('0x1b')]['SELECT']}));});if(_0x38d768>0x0){_0x1980d8+=_0x3c57fc;_0x483434[_0x9104('0x1c')](dbH['sequelize'][_0x9104('0x14')](util['format'](_0x9104('0x1a'),QUERY,_0x38d768,_0x1980d8),{'type':dbH[_0x9104('0x13')][_0x9104('0x1b')][_0x9104('0x15')]}));}}}else{_0x483434[_0x9104('0x1c')](dbH[_0x9104('0x13')][_0x9104('0x14')](QUERY,{'type':dbH[_0x9104('0x13')]['QueryTypes']['SELECT']}));}var _0x21b60e=path[_0x9104('0x1d')](PATH);var _0x501bb9=path['basename'](PATH,'.xlsx');var _0x54a4a5=_0x379acb[_0x9104('0x10')]&&_0x483434[_0x9104('0x1e')]>0x1;var _0x2dc350=[];if(!fs['existsSync'](path[_0x9104('0x1f')](_0x21b60e,_0x501bb9))&&_0x54a4a5){fs['mkdirSync'](path['join'](_0x21b60e,_0x501bb9));}return BPromise[_0x9104('0x20')](_0x483434,function(_0x112cd2){_0x2dc350[_0x9104('0x1c')](_0x112cd2);})[_0x9104('0x12')](function(){for(var _0x1fce15=0x0;_0x1fce15<_0x2dc350['length'];_0x1fce15+=0x1){var _0x36b492;var _0x5219a1=_0x2dc350[_0x1fce15];if(_0x54a4a5){_0x36b492=path[_0x9104('0x1f')](_0x21b60e,_0x501bb9,util[_0x9104('0xc')](_0x9104('0x21'),_0x501bb9,_0x1fce15,_0x9104('0x22')));}else{_0x36b492=path[_0x9104('0x1f')](_0x21b60e,util[_0x9104('0xc')](_0x9104('0x23'),_0x501bb9,_0x9104('0x22')));}fs[_0x9104('0x24')](_0x36b492,json2xls(_0x5219a1),'binary');}})['then'](function(){if(_0x54a4a5){return new Promise(function(_0x36fd18){zipdir(path[_0x9104('0x1f')](_0x21b60e,_0x501bb9),{'saveTo':path[_0x9104('0x1f')](_0x21b60e,util[_0x9104('0xc')]('%s.%s',_0x501bb9,_0x9104('0x25')))},function(_0x387c6d,_0x2e7dd7){rimraf(path['join'](_0x21b60e,_0x501bb9),function(){});_0x36fd18('zip\x20finished');});});}})[_0x9104('0x12')](function(){logger[_0x9104('0xb')](util[_0x9104('0xc')](_0x9104('0x26'),EXTRACTED_REPORT_ID,_0x9104('0x27')));return analyticExtractedReport(_0x9104('0x28'),_0x54a4a5?util[_0x9104('0xc')]('%s.%s',_0x501bb9,_0x54a4a5?_0x9104('0x25'):_0x9104('0x22')):null);});})[_0x9104('0x29')](function(_0x426b59){logger['info'](util[_0x9104('0xc')](_0x9104('0x2a'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x426b59,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x9104('0x2b')](function(){process[_0x9104('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 859344c..f144ff7 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 _0x3859=['MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','error','rewrite','lodash','util','models','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','exten','filter','groupBy','queue','playback','hasOwnProperty','extensions','extension','push','type','Set','format','context','priority','inbound','CDR(routeid)=','VoiceExtensionId','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0'];(function(_0xc05552,_0x48f6e7){var _0x8cb3f3=function(_0x427947){while(--_0x427947){_0xc05552['push'](_0xc05552['shift']());}};_0x8cb3f3(++_0x48f6e7);}(_0x3859,0x1df));var _0x9385=function(_0x1cf987,_0x51a548){_0x1cf987=_0x1cf987-0x0;var _0x87ab90=_0x3859[_0x1cf987];return _0x87ab90;};'use strict';var _=require(_0x9385('0x0'));var util=require(_0x9385('0x1'));function rewrite(_0x2ce2ef,_0x1557bf){var _0x15d565=this;return _0x2ce2ef[_0x9385('0x2')]['Interval'][_0x9385('0x3')]({'raw':!![]})[_0x9385('0x4')](function(_0x1bbee4){_0x15d565[_0x9385('0x5')]=_0x1bbee4;return _0x2ce2ef[_0x9385('0x2')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x1557bf[_0x9385('0x6')]},'raw':!![]});})['then'](function(_0x3906aa){return _0x2ce2ef[_0x9385('0x2')][_0x9385('0x7')][_0x9385('0x3')]({'where':{'exten':{'$in':_[_0x9385('0x8')](_[_0x9385('0x9')](_0x3906aa,_0x9385('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x9385('0x4')](function(_0x22e9f1){var _0x31da48=_[_0x9385('0xb')](_0x22e9f1,{'priority':'1'});var _0xbad44a=_[_0x9385('0xb')](_0x22e9f1,{'isApp':0x1});var _0x2846c9=_[_0x9385('0xc')](_0xbad44a,_0x9385('0xa'));var _0x57b4fa=[_0x9385('0xd'),_0x9385('0xe')];var _0x1fc13f=[];var _0x5df824=[];for(var _0x2b671f in _0x2846c9){if(_0x2846c9[_0x9385('0xf')](_0x2b671f)){_0x15d565['priority']=0x2;_0x15d565[_0x9385('0x10')]=[];_0x15d565[_0x9385('0x11')]=_['find'](_0x31da48,{'exten':_0x2846c9[_0x2b671f][0x0][_0x9385('0xa')]});_0x15d565[_0x9385('0x10')][_0x9385('0x12')]({'type':_0x2846c9[_0x2b671f][0x0][_0x9385('0x13')],'app':_0x9385('0x14'),'appdata':util[_0x9385('0x15')]('CDR(type)=%s',_0x2846c9[_0x2b671f][0x0][_0x9385('0x13')]),'context':_0x2846c9[_0x2b671f][0x0][_0x9385('0x16')],'exten':_0x2846c9[_0x2b671f][0x0][_0x9385('0xa')],'priority':_0x15d565[_0x9385('0x17')]++,'VoiceExtensionId':_0x2846c9[_0x2b671f][0x0]['VoiceExtensionId']});if(_0x2846c9[_0x2b671f][0x0][_0x9385('0x13')]===_0x9385('0x18')){_0x15d565[_0x9385('0x10')][_0x9385('0x12')]({'type':_0x2846c9[_0x2b671f][0x0][_0x9385('0x13')],'app':'Set','appdata':_0x9385('0x19')+_0x2846c9[_0x2b671f][0x0][_0x9385('0x1a')],'context':_0x2846c9[_0x2b671f][0x0][_0x9385('0x16')],'exten':_0x2846c9[_0x2b671f][0x0][_0x9385('0xa')],'priority':_0x15d565[_0x9385('0x17')]++,'VoiceExtensionId':_0x2846c9[_0x2b671f][0x0][_0x9385('0x1a')]});}else if(_0x2846c9[_0x2b671f][0x0]['type']===_0x9385('0x1b')){if(_0x15d565[_0x9385('0x11')]){_0x15d565[_0x9385('0x10')]['push']({'type':_0x2846c9[_0x2b671f][0x0][_0x9385('0x13')],'app':_0x9385('0x14'),'appdata':'CDR(destination)='+(_0x15d565[_0x9385('0x11')][_0x9385('0x1c')]?_0x9385('0x1d')+_0x15d565[_0x9385('0x11')][_0x9385('0x1c')]+'}':_0x9385('0x1e')),'context':_0x2846c9[_0x2b671f][0x0][_0x9385('0x16')],'exten':_0x2846c9[_0x2b671f][0x0]['exten'],'priority':_0x15d565[_0x9385('0x17')]++,'VoiceExtensionId':_0x2846c9[_0x2b671f][0x0][_0x9385('0x1a')]});}_0x15d565[_0x9385('0x10')][_0x9385('0x12')]({'type':_0x2846c9[_0x2b671f][0x0]['type'],'app':_0x9385('0x14'),'appdata':'CDR(routeid)='+_0x2846c9[_0x2b671f][0x0][_0x9385('0x1a')],'context':_0x2846c9[_0x2b671f][0x0][_0x9385('0x16')],'exten':_0x2846c9[_0x2b671f][0x0][_0x9385('0xa')],'priority':_0x15d565[_0x9385('0x17')]++,'VoiceExtensionId':_0x2846c9[_0x2b671f][0x0][_0x9385('0x1a')]});var _0x3e9e78=_0x15d565[_0x9385('0x17')]++;_0x15d565[_0x9385('0x10')][_0x9385('0x12')]({'type':_0x2846c9[_0x2b671f][0x0][_0x9385('0x13')],'app':_0x9385('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3e9e78+0x2)+_0x9385('0x20')+(_0x3e9e78+0x1)+')','context':_0x2846c9[_0x2b671f][0x0][_0x9385('0x16')],'exten':_0x2846c9[_0x2b671f][0x0]['exten'],'priority':_0x3e9e78,'VoiceExtensionId':_0x2846c9[_0x2b671f][0x0][_0x9385('0x1a')]});if(_0x15d565[_0x9385('0x11')]){_0x15d565[_0x9385('0x10')][_0x9385('0x12')]({'type':_0x2846c9[_0x2b671f][0x0]['type'],'app':_0x9385('0x14'),'appdata':_0x15d565[_0x9385('0x11')][_0x9385('0x1c')]?_0x9385('0x21')+_0x15d565[_0x9385('0x11')]['cutdigits']+'}':_0x9385('0x22'),'context':_0x2846c9[_0x2b671f][0x0][_0x9385('0x16')],'exten':_0x2846c9[_0x2b671f][0x0][_0x9385('0xa')],'priority':_0x15d565['priority']++,'VoiceExtensionId':_0x2846c9[_0x2b671f][0x0]['VoiceExtensionId']});}_0x15d565[_0x9385('0x10')]['push']({'type':_0x2846c9[_0x2b671f][0x0]['type'],'app':_0x9385('0x14'),'appdata':'outboundrouteid='+_0x2846c9[_0x2b671f][0x0][_0x9385('0x1a')],'context':_0x2846c9[_0x2b671f][0x0][_0x9385('0x16')],'exten':_0x2846c9[_0x2b671f][0x0][_0x9385('0xa')],'priority':_0x15d565[_0x9385('0x17')]++,'VoiceExtensionId':_0x2846c9[_0x2b671f][0x0][_0x9385('0x1a')]});if(_0x15d565[_0x9385('0x11')]&&_0x15d565[_0x9385('0x11')]['hasOwnProperty'](_0x9385('0x23'))&&_0x15d565[_0x9385('0x11')][_0x9385('0x23')]!==_0x9385('0x24')){_0x15d565[_0x9385('0x10')]['push']({'type':_0x2846c9[_0x2b671f][0x0][_0x9385('0x13')],'app':_0x9385('0x14'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2846c9[_0x2b671f][0x0][_0x9385('0x16')],'exten':_0x2846c9[_0x2b671f][0x0][_0x9385('0xa')],'priority':_0x15d565[_0x9385('0x17')]++,'VoiceExtensionId':_0x2846c9[_0x2b671f][0x0][_0x9385('0x1a')]});_0x15d565[_0x9385('0x10')]['push']({'type':_0x2846c9[_0x2b671f][0x0]['type'],'app':'Set','appdata':_0x9385('0x25')+_0x15d565[_0x9385('0x11')]['recordingFormat']||_0x9385('0x26'),'context':_0x2846c9[_0x2b671f][0x0][_0x9385('0x16')],'exten':_0x2846c9[_0x2b671f][0x0][_0x9385('0xa')],'priority':_0x15d565[_0x9385('0x17')]++,'VoiceExtensionId':_0x2846c9[_0x2b671f][0x0][_0x9385('0x1a')]});}}_0x15d565[_0x9385('0x10')][_0x9385('0x12')]({'type':_0x2846c9[_0x2b671f][0x0]['type'],'app':_0x9385('0x14'),'appdata':_0x9385('0x27'),'context':_0x2846c9[_0x2b671f][0x0][_0x9385('0x16')],'exten':_0x2846c9[_0x2b671f][0x0][_0x9385('0xa')],'priority':_0x15d565[_0x9385('0x17')]++,'VoiceExtensionId':_0x2846c9[_0x2b671f][0x0][_0x9385('0x1a')]});_0x15d565[_0x9385('0x10')][_0x9385('0x12')]({'type':_0x2846c9[_0x2b671f][0x0][_0x9385('0x13')],'app':_0x9385('0x14'),'appdata':_0x9385('0x28'),'context':_0x2846c9[_0x2b671f][0x0][_0x9385('0x16')],'exten':_0x2846c9[_0x2b671f][0x0][_0x9385('0xa')],'priority':_0x15d565['priority']++,'VoiceExtensionId':_0x2846c9[_0x2b671f][0x0][_0x9385('0x1a')]});_0x15d565['extensions'][_0x9385('0x12')]({'type':_0x2846c9[_0x2b671f][0x0][_0x9385('0x13')],'app':_0x9385('0x14'),'appdata':_0x9385('0x29'),'context':_0x2846c9[_0x2b671f][0x0][_0x9385('0x16')],'exten':_0x2846c9[_0x2b671f][0x0][_0x9385('0xa')],'priority':_0x15d565[_0x9385('0x17')]++,'VoiceExtensionId':_0x2846c9[_0x2b671f][0x0]['VoiceExtensionId']});for(var _0x595af4=0x0,_0x5f5b34=0x0;_0x595af4<_0x2846c9[_0x2b671f][_0x9385('0x2a')];_0x595af4+=0x1,_0x5f5b34=0x0){var _0x55c4d1=_0x2846c9[_0x2b671f][_0x595af4];if(_0x55c4d1['type']){_0x55c4d1[_0x9385('0x13')]=_0x55c4d1['type'][_0x9385('0x2b')]();}var _0x57efd7=[];var _0x1112ee=[];delete _0x55c4d1['id'];delete _0x55c4d1[_0x9385('0x2c')];delete _0x55c4d1[_0x9385('0x2d')];var _0x46b821=_0x55c4d1['interval']!==_0x9385('0x2e')?[_0x55c4d1[_0x9385('0x2f')]]:_0x55c4d1[_0x9385('0x6')]?_[_0x9385('0x9')](_['filter'](_0x15d565[_0x9385('0x5')],{'IntervalId':_0x55c4d1[_0x9385('0x6')]}),_0x9385('0x2f')):[];if(_0x55c4d1[_0x9385('0xf')](_0x9385('0x30'))){if(_0x55c4d1[_0x9385('0x30')]&&_0x55c4d1[_0x9385('0x30')]!=='--'){_0x57efd7[_0x9385('0x12')]({'type':_0x55c4d1[_0x9385('0x13')],'app':_0x9385('0x14'),'appdata':_0x9385('0x31')+_0x55c4d1[_0x9385('0x30')],'context':_0x55c4d1['context'],'exten':_0x55c4d1[_0x9385('0xa')],'priority':_0x46b821[_0x9385('0x2a')]+_0x15d565[_0x9385('0x17')]+_0x5f5b34++,'VoiceExtensionId':_0x55c4d1[_0x9385('0x1a')]});}}if(_0x55c4d1['type']===_0x9385('0x1b')&&_0x55c4d1['hasOwnProperty']('callerID')){if(_0x55c4d1['callerID']){_0x57efd7[_0x9385('0x12')]({'type':_0x55c4d1['type'],'app':_0x9385('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x55c4d1[_0x9385('0x32')]+')','context':_0x55c4d1[_0x9385('0x16')],'exten':_0x55c4d1[_0x9385('0xa')],'priority':_0x46b821[_0x9385('0x2a')]+_0x15d565[_0x9385('0x17')]+_0x5f5b34++,'VoiceExtensionId':_0x55c4d1['VoiceExtensionId']});}else{_0x57efd7['push']({'type':_0x55c4d1[_0x9385('0x13')],'app':'ExecIf','appdata':_0x9385('0x33'),'context':_0x55c4d1['context'],'exten':_0x55c4d1[_0x9385('0xa')],'priority':_0x46b821[_0x9385('0x2a')]+_0x15d565['priority']+_0x5f5b34++,'VoiceExtensionId':_0x55c4d1[_0x9385('0x1a')]});}}if(_0x55c4d1[_0x9385('0xf')]('answer')){if(_0x57b4fa['indexOf'](_0x55c4d1['app']['toLowerCase']())>=0x0&&_0x55c4d1[_0x9385('0x34')]!==_0x9385('0x35')){if(_0x55c4d1['answer']){_0x57efd7['push']({'type':_0x55c4d1['type'],'app':'ExecIf','appdata':_0x9385('0x36'),'context':_0x55c4d1[_0x9385('0x16')],'exten':_0x55c4d1['exten'],'priority':_0x46b821[_0x9385('0x2a')]+_0x15d565[_0x9385('0x17')]+_0x5f5b34++,'VoiceExtensionId':_0x55c4d1[_0x9385('0x1a')]});_0x57efd7[_0x9385('0x12')]({'type':_0x55c4d1['type'],'app':_0x9385('0x14'),'appdata':_0x9385('0x37'),'context':_0x55c4d1[_0x9385('0x16')],'exten':_0x55c4d1[_0x9385('0xa')],'priority':_0x46b821['length']+_0x15d565['priority']+_0x5f5b34++,'VoiceExtensionId':_0x55c4d1[_0x9385('0x1a')]});}else{_0x57efd7[_0x9385('0x12')]({'type':_0x55c4d1[_0x9385('0x13')],'app':_0x9385('0x1f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x55c4d1[_0x9385('0x16')],'exten':_0x55c4d1[_0x9385('0xa')],'priority':_0x46b821['length']+_0x15d565['priority']+_0x5f5b34++,'VoiceExtensionId':_0x55c4d1[_0x9385('0x1a')]});_0x57efd7[_0x9385('0x12')]({'type':_0x55c4d1[_0x9385('0x13')],'app':_0x9385('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x55c4d1[_0x9385('0x16')],'exten':_0x55c4d1['exten'],'priority':_0x46b821[_0x9385('0x2a')]+_0x15d565[_0x9385('0x17')]+_0x5f5b34++,'VoiceExtensionId':_0x55c4d1['VoiceExtensionId']});}}}for(var _0x131203=0x0;_0x131203<_0x46b821['length'];_0x131203+=0x1){var _0x36bf9e=_0x15d565[_0x9385('0x17')]+_0x46b821[_0x9385('0x2a')];var _0x3203ec=_0x131203===_0x46b821[_0x9385('0x2a')]-0x1?_0x15d565[_0x9385('0x17')]+_0x57efd7[_0x9385('0x2a')]+_0x1112ee['length']+0x2:_0x15d565[_0x9385('0x17')]+_0x131203+0x1;_0x57efd7[_0x9385('0x38')](_0x131203,0x0,{'type':_0x55c4d1[_0x9385('0x13')],'app':_0x9385('0x39'),'appdata':_0x46b821[_0x131203]+'?'+_0x55c4d1[_0x9385('0x16')]+_0x9385('0x3a')+_0x36bf9e+':'+_0x55c4d1[_0x9385('0x16')]+',${EXTEN},'+_0x3203ec,'exten':_0x55c4d1[_0x9385('0xa')],'context':_0x55c4d1[_0x9385('0x16')],'priority':_0x15d565[_0x9385('0x17')]+_0x131203,'VoiceExtensionId':_0x2846c9[_0x2b671f][0x0][_0x9385('0x1a')]});}_0x55c4d1[_0x9385('0x17')]=_0x57efd7['length']?_[_0x9385('0x3b')](_0x57efd7)[_0x9385('0x17')]+0x1:_0x15d565['priority'];_0x15d565[_0x9385('0x17')]=(_0x1112ee[_0x9385('0x2a')]?_['last'](_0x1112ee)['priority']:_0x55c4d1[_0x9385('0x17')])+0x1;_0x15d565[_0x9385('0x10')]=_[_0x9385('0x3c')](_0x15d565[_0x9385('0x10')],_0x57efd7,[_0x55c4d1],_0x1112ee);}_0x15d565['extensions']['push']({'type':_0x2846c9[_0x2b671f][0x0][_0x9385('0x13')],'app':_0x9385('0x3d'),'exten':_0x2846c9[_0x2b671f][0x0]['exten'],'context':_0x2846c9[_0x2b671f][0x0][_0x9385('0x16')],'priority':_0x15d565[_0x9385('0x17')],'VoiceExtensionId':_0x2846c9[_0x2b671f][0x0]['VoiceExtensionId']});_0x1fc13f[_0x9385('0x12')](_0x2846c9[_0x2b671f][0x0][_0x9385('0x1a')]);_0x5df824=_[_0x9385('0x3c')](_0x5df824,_0x15d565['extensions']);}}return _0x2ce2ef['transaction'](function(_0x11720d){return _0x2ce2ef['models'][_0x9385('0x7')][_0x9385('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x1fc13f}},'transaction':_0x11720d})[_0x9385('0x4')](function(_0x4cc242){return _0x2ce2ef[_0x9385('0x2')]['VoiceExtension']['bulkCreate'](_['sortBy'](_0x5df824,_0x9385('0x17')),{'transaction':_0x11720d});});});})['catch'](function(_0x16519b){console[_0x9385('0x3f')](_0x16519b);});}exports[_0x9385('0x40')]=rewrite; \ No newline at end of file +var _0xcadc=['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','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','destroy','bulkCreate','catch','error','rewrite','lodash','util','models','findAll','intervals','VoiceExtension','IntervalId','then','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','priority','extensions','extension','find','push','Set','format','type','context','VoiceExtensionId','inbound','outbound','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','length','createdAt','interval','*,*,*,*','hasOwnProperty','tag','CDR(tag)='];(function(_0x15d5af,_0x569e9e){var _0x294bcf=function(_0x199927){while(--_0x199927){_0x15d5af['push'](_0x15d5af['shift']());}};_0x294bcf(++_0x569e9e);}(_0xcadc,0x171));var _0xccad=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xcadc[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xccad('0x0'));var util=require(_0xccad('0x1'));function rewrite(_0x39a6a7,_0x12e61c){var _0x1f22a5=this;return _0x39a6a7[_0xccad('0x2')]['Interval'][_0xccad('0x3')]({'raw':!![]})['then'](function(_0x4edfc7){_0x1f22a5[_0xccad('0x4')]=_0x4edfc7;return _0x39a6a7[_0xccad('0x2')][_0xccad('0x5')][_0xccad('0x3')]({'where':{'IntervalId':_0x12e61c[_0xccad('0x6')]},'raw':!![]});})[_0xccad('0x7')](function(_0x117392){return _0x39a6a7[_0xccad('0x2')]['VoiceExtension'][_0xccad('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0xccad('0x8')](_0x117392,_0xccad('0x9')))}},'order':[{'raw':_0xccad('0xa')}],'raw':!![]});})[_0xccad('0x7')](function(_0x5b4f35){var _0x40af8b=_[_0xccad('0xb')](_0x5b4f35,{'priority':'1'});var _0x4639f6=_['filter'](_0x5b4f35,{'isApp':0x1});var _0x24efe5=_['groupBy'](_0x4639f6,_0xccad('0x9'));var _0x341120=[_0xccad('0xc'),'playback'];var _0x291998=[];var _0x54f7e7=[];for(var _0x53fcae in _0x24efe5){if(_0x24efe5['hasOwnProperty'](_0x53fcae)){_0x1f22a5[_0xccad('0xd')]=0x2;_0x1f22a5[_0xccad('0xe')]=[];_0x1f22a5[_0xccad('0xf')]=_[_0xccad('0x10')](_0x40af8b,{'exten':_0x24efe5[_0x53fcae][0x0]['exten']});_0x1f22a5[_0xccad('0xe')][_0xccad('0x11')]({'type':_0x24efe5[_0x53fcae][0x0]['type'],'app':_0xccad('0x12'),'appdata':util[_0xccad('0x13')]('CDR(type)=%s',_0x24efe5[_0x53fcae][0x0][_0xccad('0x14')]),'context':_0x24efe5[_0x53fcae][0x0][_0xccad('0x15')],'exten':_0x24efe5[_0x53fcae][0x0][_0xccad('0x9')],'priority':_0x1f22a5[_0xccad('0xd')]++,'VoiceExtensionId':_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')]});if(_0x24efe5[_0x53fcae][0x0]['type']===_0xccad('0x17')){_0x1f22a5[_0xccad('0xe')][_0xccad('0x11')]({'type':_0x24efe5[_0x53fcae][0x0][_0xccad('0x14')],'app':_0xccad('0x12'),'appdata':'CDR(routeid)='+_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')],'context':_0x24efe5[_0x53fcae][0x0][_0xccad('0x15')],'exten':_0x24efe5[_0x53fcae][0x0][_0xccad('0x9')],'priority':_0x1f22a5[_0xccad('0xd')]++,'VoiceExtensionId':_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')]});}else if(_0x24efe5[_0x53fcae][0x0][_0xccad('0x14')]===_0xccad('0x18')){if(_0x1f22a5[_0xccad('0xf')]){_0x1f22a5['extensions']['push']({'type':_0x24efe5[_0x53fcae][0x0]['type'],'app':_0xccad('0x12'),'appdata':'CDR(destination)='+(_0x1f22a5[_0xccad('0xf')]['cutdigits']?_0xccad('0x19')+_0x1f22a5[_0xccad('0xf')]['cutdigits']+'}':'${EXTEN}'),'context':_0x24efe5[_0x53fcae][0x0][_0xccad('0x15')],'exten':_0x24efe5[_0x53fcae][0x0][_0xccad('0x9')],'priority':_0x1f22a5[_0xccad('0xd')]++,'VoiceExtensionId':_0x24efe5[_0x53fcae][0x0]['VoiceExtensionId']});}_0x1f22a5[_0xccad('0xe')][_0xccad('0x11')]({'type':_0x24efe5[_0x53fcae][0x0]['type'],'app':_0xccad('0x12'),'appdata':'CDR(routeid)='+_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')],'context':_0x24efe5[_0x53fcae][0x0][_0xccad('0x15')],'exten':_0x24efe5[_0x53fcae][0x0][_0xccad('0x9')],'priority':_0x1f22a5[_0xccad('0xd')]++,'VoiceExtensionId':_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')]});var _0x461913=_0x1f22a5['priority']++;_0x1f22a5[_0xccad('0xe')][_0xccad('0x11')]({'type':_0x24efe5[_0x53fcae][0x0]['type'],'app':_0xccad('0x1a'),'appdata':_0xccad('0x1b')+(_0x461913+0x2)+_0xccad('0x1c')+(_0x461913+0x1)+')','context':_0x24efe5[_0x53fcae][0x0]['context'],'exten':_0x24efe5[_0x53fcae][0x0][_0xccad('0x9')],'priority':_0x461913,'VoiceExtensionId':_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')]});if(_0x1f22a5[_0xccad('0xf')]){_0x1f22a5[_0xccad('0xe')][_0xccad('0x11')]({'type':_0x24efe5[_0x53fcae][0x0]['type'],'app':_0xccad('0x12'),'appdata':_0x1f22a5[_0xccad('0xf')][_0xccad('0x1d')]?_0xccad('0x1e')+_0x1f22a5['extension'][_0xccad('0x1d')]+'}':_0xccad('0x1f'),'context':_0x24efe5[_0x53fcae][0x0][_0xccad('0x15')],'exten':_0x24efe5[_0x53fcae][0x0][_0xccad('0x9')],'priority':_0x1f22a5[_0xccad('0xd')]++,'VoiceExtensionId':_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')]});}_0x1f22a5['extensions'][_0xccad('0x11')]({'type':_0x24efe5[_0x53fcae][0x0][_0xccad('0x14')],'app':'Set','appdata':'outboundrouteid='+_0x24efe5[_0x53fcae][0x0]['VoiceExtensionId'],'context':_0x24efe5[_0x53fcae][0x0][_0xccad('0x15')],'exten':_0x24efe5[_0x53fcae][0x0][_0xccad('0x9')],'priority':_0x1f22a5['priority']++,'VoiceExtensionId':_0x24efe5[_0x53fcae][0x0]['VoiceExtensionId']});if(_0x1f22a5[_0xccad('0xf')]&&_0x1f22a5[_0xccad('0xf')]['hasOwnProperty'](_0xccad('0x20'))&&_0x1f22a5[_0xccad('0xf')][_0xccad('0x20')]!==_0xccad('0x21')){_0x1f22a5['extensions']['push']({'type':_0x24efe5[_0x53fcae][0x0][_0xccad('0x14')],'app':_0xccad('0x12'),'appdata':_0xccad('0x22'),'context':_0x24efe5[_0x53fcae][0x0][_0xccad('0x15')],'exten':_0x24efe5[_0x53fcae][0x0][_0xccad('0x9')],'priority':_0x1f22a5['priority']++,'VoiceExtensionId':_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')]});_0x1f22a5[_0xccad('0xe')][_0xccad('0x11')]({'type':_0x24efe5[_0x53fcae][0x0][_0xccad('0x14')],'app':_0xccad('0x12'),'appdata':_0xccad('0x23')+_0x1f22a5[_0xccad('0xf')][_0xccad('0x20')]||_0xccad('0x24'),'context':_0x24efe5[_0x53fcae][0x0]['context'],'exten':_0x24efe5[_0x53fcae][0x0][_0xccad('0x9')],'priority':_0x1f22a5[_0xccad('0xd')]++,'VoiceExtensionId':_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')]});}}_0x1f22a5[_0xccad('0xe')]['push']({'type':_0x24efe5[_0x53fcae][0x0][_0xccad('0x14')],'app':_0xccad('0x12'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x24efe5[_0x53fcae][0x0][_0xccad('0x15')],'exten':_0x24efe5[_0x53fcae][0x0][_0xccad('0x9')],'priority':_0x1f22a5['priority']++,'VoiceExtensionId':_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')]});_0x1f22a5[_0xccad('0xe')][_0xccad('0x11')]({'type':_0x24efe5[_0x53fcae][0x0][_0xccad('0x14')],'app':_0xccad('0x12'),'appdata':_0xccad('0x25'),'context':_0x24efe5[_0x53fcae][0x0]['context'],'exten':_0x24efe5[_0x53fcae][0x0][_0xccad('0x9')],'priority':_0x1f22a5[_0xccad('0xd')]++,'VoiceExtensionId':_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')]});_0x1f22a5[_0xccad('0xe')][_0xccad('0x11')]({'type':_0x24efe5[_0x53fcae][0x0]['type'],'app':_0xccad('0x12'),'appdata':'MONITOR_OPTIONS=ab','context':_0x24efe5[_0x53fcae][0x0][_0xccad('0x15')],'exten':_0x24efe5[_0x53fcae][0x0][_0xccad('0x9')],'priority':_0x1f22a5[_0xccad('0xd')]++,'VoiceExtensionId':_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')]});for(var _0x270657=0x0,_0x4b6599=0x0;_0x270657<_0x24efe5[_0x53fcae][_0xccad('0x26')];_0x270657+=0x1,_0x4b6599=0x0){var _0x2fa29d=_0x24efe5[_0x53fcae][_0x270657];if(_0x2fa29d[_0xccad('0x14')]){_0x2fa29d[_0xccad('0x14')]=_0x2fa29d[_0xccad('0x14')]['toLowerCase']();}var _0x3ec281=[];var _0x201349=[];delete _0x2fa29d['id'];delete _0x2fa29d[_0xccad('0x27')];delete _0x2fa29d['updatedAt'];var _0x260d3b=_0x2fa29d[_0xccad('0x28')]!==_0xccad('0x29')?[_0x2fa29d[_0xccad('0x28')]]:_0x2fa29d['IntervalId']?_['map'](_[_0xccad('0xb')](_0x1f22a5['intervals'],{'IntervalId':_0x2fa29d[_0xccad('0x6')]}),_0xccad('0x28')):[];if(_0x2fa29d[_0xccad('0x2a')](_0xccad('0x2b'))){if(_0x2fa29d[_0xccad('0x2b')]&&_0x2fa29d[_0xccad('0x2b')]!=='--'){_0x3ec281[_0xccad('0x11')]({'type':_0x2fa29d[_0xccad('0x14')],'app':_0xccad('0x12'),'appdata':_0xccad('0x2c')+_0x2fa29d[_0xccad('0x2b')],'context':_0x2fa29d[_0xccad('0x15')],'exten':_0x2fa29d[_0xccad('0x9')],'priority':_0x260d3b[_0xccad('0x26')]+_0x1f22a5['priority']+_0x4b6599++,'VoiceExtensionId':_0x2fa29d[_0xccad('0x16')]});}}if(_0x2fa29d[_0xccad('0x14')]===_0xccad('0x18')&&_0x2fa29d[_0xccad('0x2a')]('callerID')){if(_0x2fa29d[_0xccad('0x2d')]){_0x3ec281[_0xccad('0x11')]({'type':_0x2fa29d[_0xccad('0x14')],'app':_0xccad('0x1a'),'appdata':_0xccad('0x2e')+_0x2fa29d[_0xccad('0x2d')]+')','context':_0x2fa29d[_0xccad('0x15')],'exten':_0x2fa29d[_0xccad('0x9')],'priority':_0x260d3b[_0xccad('0x26')]+_0x1f22a5[_0xccad('0xd')]+_0x4b6599++,'VoiceExtensionId':_0x2fa29d[_0xccad('0x16')]});}else{_0x3ec281[_0xccad('0x11')]({'type':_0x2fa29d[_0xccad('0x14')],'app':_0xccad('0x1a'),'appdata':_0xccad('0x2f'),'context':_0x2fa29d['context'],'exten':_0x2fa29d['exten'],'priority':_0x260d3b[_0xccad('0x26')]+_0x1f22a5['priority']+_0x4b6599++,'VoiceExtensionId':_0x2fa29d['VoiceExtensionId']});}}if(_0x2fa29d['hasOwnProperty'](_0xccad('0x30'))){if(_0x341120[_0xccad('0x31')](_0x2fa29d[_0xccad('0x32')][_0xccad('0x33')]())>=0x0&&_0x2fa29d[_0xccad('0x34')]!==_0xccad('0x35')){if(_0x2fa29d[_0xccad('0x30')]){_0x3ec281[_0xccad('0x11')]({'type':_0x2fa29d[_0xccad('0x14')],'app':_0xccad('0x1a'),'appdata':_0xccad('0x36'),'context':_0x2fa29d[_0xccad('0x15')],'exten':_0x2fa29d[_0xccad('0x9')],'priority':_0x260d3b[_0xccad('0x26')]+_0x1f22a5['priority']+_0x4b6599++,'VoiceExtensionId':_0x2fa29d[_0xccad('0x16')]});_0x3ec281['push']({'type':_0x2fa29d[_0xccad('0x14')],'app':_0xccad('0x12'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2fa29d[_0xccad('0x15')],'exten':_0x2fa29d[_0xccad('0x9')],'priority':_0x260d3b[_0xccad('0x26')]+_0x1f22a5[_0xccad('0xd')]+_0x4b6599++,'VoiceExtensionId':_0x2fa29d['VoiceExtensionId']});}else{_0x3ec281[_0xccad('0x11')]({'type':_0x2fa29d['type'],'app':_0xccad('0x1a'),'appdata':_0xccad('0x37'),'context':_0x2fa29d[_0xccad('0x15')],'exten':_0x2fa29d[_0xccad('0x9')],'priority':_0x260d3b[_0xccad('0x26')]+_0x1f22a5['priority']+_0x4b6599++,'VoiceExtensionId':_0x2fa29d['VoiceExtensionId']});_0x3ec281[_0xccad('0x11')]({'type':_0x2fa29d[_0xccad('0x14')],'app':_0xccad('0x12'),'appdata':_0xccad('0x38'),'context':_0x2fa29d[_0xccad('0x15')],'exten':_0x2fa29d['exten'],'priority':_0x260d3b[_0xccad('0x26')]+_0x1f22a5[_0xccad('0xd')]+_0x4b6599++,'VoiceExtensionId':_0x2fa29d[_0xccad('0x16')]});}}}for(var _0x3a5b68=0x0;_0x3a5b68<_0x260d3b[_0xccad('0x26')];_0x3a5b68+=0x1){var _0x405345=_0x1f22a5[_0xccad('0xd')]+_0x260d3b[_0xccad('0x26')];var _0x308cb7=_0x3a5b68===_0x260d3b[_0xccad('0x26')]-0x1?_0x1f22a5[_0xccad('0xd')]+_0x3ec281[_0xccad('0x26')]+_0x201349[_0xccad('0x26')]+0x2:_0x1f22a5['priority']+_0x3a5b68+0x1;_0x3ec281[_0xccad('0x39')](_0x3a5b68,0x0,{'type':_0x2fa29d[_0xccad('0x14')],'app':_0xccad('0x3a'),'appdata':_0x260d3b[_0x3a5b68]+'?'+_0x2fa29d[_0xccad('0x15')]+_0xccad('0x3b')+_0x405345+':'+_0x2fa29d['context']+_0xccad('0x3b')+_0x308cb7,'exten':_0x2fa29d[_0xccad('0x9')],'context':_0x2fa29d[_0xccad('0x15')],'priority':_0x1f22a5[_0xccad('0xd')]+_0x3a5b68,'VoiceExtensionId':_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')]});}_0x2fa29d[_0xccad('0xd')]=_0x3ec281[_0xccad('0x26')]?_[_0xccad('0x3c')](_0x3ec281)[_0xccad('0xd')]+0x1:_0x1f22a5[_0xccad('0xd')];_0x1f22a5[_0xccad('0xd')]=(_0x201349['length']?_[_0xccad('0x3c')](_0x201349)[_0xccad('0xd')]:_0x2fa29d[_0xccad('0xd')])+0x1;_0x1f22a5['extensions']=_['concat'](_0x1f22a5['extensions'],_0x3ec281,[_0x2fa29d],_0x201349);}_0x1f22a5[_0xccad('0xe')][_0xccad('0x11')]({'type':_0x24efe5[_0x53fcae][0x0][_0xccad('0x14')],'app':_0xccad('0x3d'),'exten':_0x24efe5[_0x53fcae][0x0][_0xccad('0x9')],'context':_0x24efe5[_0x53fcae][0x0][_0xccad('0x15')],'priority':_0x1f22a5[_0xccad('0xd')],'VoiceExtensionId':_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')]});_0x291998[_0xccad('0x11')](_0x24efe5[_0x53fcae][0x0][_0xccad('0x16')]);_0x54f7e7=_[_0xccad('0x3e')](_0x54f7e7,_0x1f22a5[_0xccad('0xe')]);}}return _0x39a6a7[_0xccad('0x3f')](function(_0x16b449){return _0x39a6a7[_0xccad('0x2')][_0xccad('0x5')][_0xccad('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x291998}},'transaction':_0x16b449})['then'](function(_0xd14749){return _0x39a6a7[_0xccad('0x2')][_0xccad('0x5')][_0xccad('0x41')](_['sortBy'](_0x54f7e7,_0xccad('0xd')),{'transaction':_0x16b449});});});})[_0xccad('0x42')](function(_0x1ccfe6){console[_0xccad('0x43')](_0x1ccfe6);});}exports[_0xccad('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index c3e495a..ed11a12 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 _0x27e6=['redis','defaults','localhost','register','argv','null','undefined','Missing\x20binding\x20parameters!','split','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','errors','map','join','data','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','length','find','duplicate','CmContact','create','keys','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','str','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','id\x20IN\x20?','cm_hopper_black','ListId\x20=\x20?','VoiceQueue','findAll','outbound','dialCheckDuplicateType','then','get','always','push','sequelize','query','onlyIfOpen','VoiceQueueId','all','CmList','BlackLists','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','message','Error\x20processing\x20rows\x20block:','contact:csv_','resume','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','lodash','papaparse','ioredis','../../../config/environment','../../../config/logger','api'];(function(_0x204c03,_0x24a4c1){var _0x327802=function(_0x12f77f){while(--_0x12f77f){_0x204c03['push'](_0x204c03['shift']());}};_0x327802(++_0x24a4c1);}(_0x27e6,0x13d));var _0x627e=function(_0x4ae930,_0x3a0ad5){_0x4ae930=_0x4ae930-0x0;var _0x311d08=_0x27e6[_0x4ae930];return _0x311d08;};'use strict';var BPromise=require(_0x627e('0x0'));var util=require('util');var _=require(_0x627e('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x627e('0x2'));var Redis=require(_0x627e('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x627e('0x4'));var logger=require(_0x627e('0x5'))(_0x627e('0x6'));config[_0x627e('0x7')]=_[_0x627e('0x8')](config[_0x627e('0x7')],{'host':_0x627e('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x627e('0x7')]));require('../../../api/cmContact/cmContact.socket')[_0x627e('0xa')](socket);try{if(!process[_0x627e('0xb')][0x2]||process['argv'][0x2]==='undefined'||process[_0x627e('0xb')][0x2]===_0x627e('0xc')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x627e('0xb')][0x2];if(!process[_0x627e('0xb')][0x3]||process[_0x627e('0xb')][0x3]===_0x627e('0xd')||process[_0x627e('0xb')][0x3]===_0x627e('0xc')||!process[_0x627e('0xb')][0x4]||process['argv'][0x4]===_0x627e('0xd')||process['argv'][0x4]===_0x627e('0xc')){throw new Error(_0x627e('0xe'));}var FIELDS=_['zipObject'](process[_0x627e('0xb')][0x3][_0x627e('0xf')](','),process[_0x627e('0xb')][0x4][_0x627e('0xf')](','));if(!process[_0x627e('0xb')][0x5]||process[_0x627e('0xb')][0x5]===_0x627e('0xd')||process['argv'][0x5]===_0x627e('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x627e('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x627e('0xb')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x627e('0xc')?process[_0x627e('0xb')][0x6]:null;var DUPLICATES=process[_0x627e('0xb')][0x7]&&process[_0x627e('0xb')][0x7]!==_0x627e('0xd')&&process[_0x627e('0xb')][0x7]!==_0x627e('0xc')?process['argv'][0x7]:null;if(!process[_0x627e('0xb')][0x8]||process['argv'][0x8]===_0x627e('0xd')||process[_0x627e('0xb')][0x8]==='null'){throw new Error(_0x627e('0x10'));}var SOCKET_TIMESTAMP=process[_0x627e('0xb')][0x8];}catch(_0xba06f0){logger['error'](_0xba06f0);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(_0x3e65e1,_0x1f9d1b,_0x1713d1,_0x479e23){var _0x410ebf={'message':_0x1f9d1b};_0x410ebf[_0x3e65e1]=!![];if(_0x1713d1){_0x410ebf[_0x627e('0x11')]=_0x1713d1;}if(_0x479e23){_0x410ebf[_0x627e('0x12')]=_0x479e23;}return _0x410ebf;}function isEmail(_0x16d7d4){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))*$/[_0x627e('0x13')](_0x16d7d4);}function checkRow(_0x31262d,_0x355642,_0x33d34c){return new BPromise(function(_0xaf2e99,_0xa5e7b0){if(_[_0x627e('0x14')](_0x31262d)){return _0xa5e7b0(handleCheckRowError(_0x627e('0x15'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x33d34c));}if(_0x31262d[_0x627e('0x16')]&&_0x31262d[_0x627e('0x16')]['length']){var _0x217182=_[_0x627e('0x17')](_0x31262d['errors'],'message')[_0x627e('0x18')](';');return _0xa5e7b0(handleCheckRowError(_0x627e('0x15'),_0x217182,null,_0x33d34c));}var _0x3c3f45={};for(var _0xd281e7 in FIELDS){if(FIELDS['hasOwnProperty'](_0xd281e7)&&FIELDS[_0xd281e7]){_0x3c3f45[_0xd281e7]=_0x31262d[_0x627e('0x19')][0x0][FIELDS[_0xd281e7]]||_0x31262d[_0x627e('0x19')][0x0]['\ufeff'+FIELDS[_0xd281e7]];}}if(!_0x3c3f45['firstName']){return _0xa5e7b0(handleCheckRowError(_0x627e('0x15'),'firstName\x20not\x20specified!',null,_0x33d34c));}if(!_0x3c3f45[_0x627e('0x1a')]){return _0xa5e7b0(handleCheckRowError(_0x627e('0x15'),_0x627e('0x1b'),null,_0x33d34c));}if(_0x3c3f45['birthDate']){var _0x114924=moment(_0x3c3f45[_0x627e('0x1c')],_0x627e('0x1d'));if(!_0x114924[_0x627e('0x1e')]()){return _0xa5e7b0(handleCheckRowError('error',_0x627e('0x1f'),null,_0x33d34c));}}if(_0x3c3f45['email']){if(!isEmail(_0x3c3f45[_0x627e('0x20')])){return _0xa5e7b0(handleCheckRowError(_0x627e('0x15'),_0x627e('0x21'),null,_0x33d34c));}}_0x3c3f45['ListId']=LISTID;_0x3c3f45['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x355642){var _0x1a848d={};for(var _0x132f9d=0x0,_0x33314e=DUPLICATES[_0x627e('0x22')];_0x132f9d<_0x33314e;_0x132f9d+=0x1){_0x1a848d[DUPLICATES[_0x132f9d]]=_0x3c3f45[DUPLICATES[_0x132f9d]];}var _0x599cab=_[_0x627e('0x23')](_0x355642,_0x1a848d);if(_0x599cab){return _0xa5e7b0(handleCheckRowError(_0x627e('0x24'),'Duplicate\x20Contact',_0x599cab,_0x33d34c));}}return db[_0x627e('0x25')][_0x627e('0x26')](_0x3c3f45,{'raw':!![],'hooks':![],'fields':_[_0x627e('0x27')](_0x3c3f45)})['then'](function(_0x229a2d){if(DUPLICATES&&DUPLICATES[_0x627e('0x22')]&&_0x355642){_0x355642['push'](_[_0x627e('0x28')](_0x3c3f45,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x229a2d['id'];return _0xaf2e99();})[_0x627e('0x29')](function(_0xe1970b){return _0xa5e7b0(handleCheckRowError(_0x627e('0x15'),_0x627e('0x2a')+(_0xe1970b['message']||JSON[_0x627e('0x2b')](_0xe1970b)),null,_0x33d34c));});});}function checkHopper(){function _0x5ce687(){return function(_0x3ea281){logger[_0x627e('0x15')](_0x627e('0x2c'),_0x627e('0x2d'),util[_0x627e('0x2e')](_0x3ea281,{'showHidden':![],'depth':null}));};}var _0x103314=function(_0x55032e,_0xab92bb){var _0x33e507=squel[_0x627e('0x2f')]()[_0x627e('0x30')](_0x627e('0x31'))[_0x627e('0x32')]([_0x627e('0x1a'),_0x627e('0x33'),_0x627e('0x34'),_0x627e('0x35'),_0xab92bb,'createdAt',_0x627e('0x36')],squel[_0x627e('0x37')]()['field'](_0x627e('0x1a'),'phone')[_0x627e('0x38')](_0x627e('0x39'),_0x627e('0x33'))['field']('id',_0x627e('0x34'))['field'](LISTID[_0x627e('0x3a')](),'ListId')[_0x627e('0x38')](_0x55032e['id']['toString'](),_0xab92bb)[_0x627e('0x38')]('NOW()',_0x627e('0x3b'))[_0x627e('0x38')](_0x627e('0x39'),_0x627e('0x36'))[_0x627e('0x3c')](_0x627e('0x3d'))[_0x627e('0x3e')](_0x627e('0x3f'))[_0x627e('0x3e')]('ListId\x20=\x20?',LISTID['toString']())[_0x627e('0x3e')](_0x627e('0x40'))[_0x627e('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x627e('0x37')]()['field']('phone')[_0x627e('0x3c')]('cm_hopper')[_0x627e('0x3e')](_0xab92bb+_0x627e('0x41'),_0x55032e['id'][_0x627e('0x3a')]())))['toString']();return _0x33e507;};var _0x7f1741=function(_0x9b647e,_0x26cdd6){var _0x407152=squel[_0x627e('0x2f')]()[_0x627e('0x30')](_0x627e('0x31'))[_0x627e('0x32')]([_0x627e('0x1a'),'scheduledAt',_0x627e('0x34'),'ListId',_0x26cdd6,'createdAt',_0x627e('0x36')],squel[_0x627e('0x37')]()[_0x627e('0x38')](_0x627e('0x1a'),_0x627e('0x1a'))[_0x627e('0x38')](_0x627e('0x39'),_0x627e('0x33'))[_0x627e('0x38')]('id','ContactId')[_0x627e('0x38')](LISTID[_0x627e('0x3a')](),_0x627e('0x35'))[_0x627e('0x38')](_0x9b647e['id']['toString'](),_0x26cdd6)[_0x627e('0x38')](_0x627e('0x39'),_0x627e('0x3b'))[_0x627e('0x38')]('NOW()',_0x627e('0x36'))['from'](_0x627e('0x3d'))[_0x627e('0x3e')]('deletedAt\x20IS\x20NULL')[_0x627e('0x3e')]('ListId\x20=\x20?',LISTID[_0x627e('0x3a')]())[_0x627e('0x3e')]('id\x20IN\x20?',squel[_0x627e('0x42')](hopperContacts))[_0x627e('0x3e')](_0x627e('0x40'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x627e('0x37')]()[_0x627e('0x38')](_0x627e('0x43'))['from'](_0x627e('0x44'))[_0x627e('0x3e')](_0x26cdd6+'\x20=\x20?',_0x9b647e['id'][_0x627e('0x3a')]()))['where'](_0x627e('0x45'),squel[_0x627e('0x37')]()[_0x627e('0x38')](_0x627e('0x1a'))[_0x627e('0x3c')]('cm_hopper')['where'](_0x26cdd6+_0x627e('0x41'),_0x9b647e['id']['toString']())))['toString']();return _0x407152;};function _0x5d3ed5(_0x4950a8,_0x335c58){var _0x436acc=squel[_0x627e('0x2f')]()[_0x627e('0x30')](_0x627e('0x31'))[_0x627e('0x32')](['phone',_0x627e('0x33'),_0x627e('0x34'),'ListId',_0x335c58,'createdAt',_0x627e('0x36')],squel[_0x627e('0x37')]()['field'](_0x627e('0x1a'),_0x627e('0x1a'))[_0x627e('0x38')](_0x627e('0x39'),'scheduledAt')[_0x627e('0x38')]('id','ContactId')['field'](LISTID[_0x627e('0x3a')](),_0x627e('0x35'))[_0x627e('0x38')](_0x4950a8['id'][_0x627e('0x3a')](),_0x335c58)[_0x627e('0x38')](_0x627e('0x39'),_0x627e('0x3b'))[_0x627e('0x38')](_0x627e('0x39'),_0x627e('0x36'))[_0x627e('0x3c')](_0x627e('0x3d'))['where'](_0x627e('0x3f'))['where']('ListId\x20=\x20?',LISTID[_0x627e('0x3a')]())[_0x627e('0x3e')](_0x627e('0x46'),squel['str'](hopperContacts))[_0x627e('0x3e')](_0x627e('0x40')))['toString']();return _0x436acc;}function _0x15563f(_0xdea60d,_0x369955){var _0x37ce37=squel[_0x627e('0x2f')]()[_0x627e('0x30')](_0x627e('0x47'))[_0x627e('0x32')]([_0x627e('0x1a'),'ContactId',_0x627e('0x35'),_0x369955,_0x627e('0x3b'),_0x627e('0x36')],squel[_0x627e('0x37')]()[_0x627e('0x38')](_0x627e('0x1a'),_0x627e('0x1a'))[_0x627e('0x38')]('id',_0x627e('0x34'))[_0x627e('0x38')](LISTID[_0x627e('0x3a')](),'ListId')[_0x627e('0x38')](_0xdea60d['id'][_0x627e('0x3a')](),_0x369955)['field'](_0x627e('0x39'),_0x627e('0x3b'))[_0x627e('0x38')](_0x627e('0x39'),_0x627e('0x36'))[_0x627e('0x3c')](_0x627e('0x3d'))[_0x627e('0x3e')](_0x627e('0x3f'))[_0x627e('0x3e')](_0x627e('0x48'),LISTID[_0x627e('0x3a')]())[_0x627e('0x3e')](_0x627e('0x46'),squel[_0x627e('0x42')](hopperContacts))[_0x627e('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0x627e('0x3a')]();return _0x37ce37;}return db[_0x627e('0x49')][_0x627e('0x4a')]({'where':{'type':_0x627e('0x4b')},'attributes':['id',_0x627e('0x4c')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0x627e('0x4d')](function(_0x54bb5c){var _0x42f70c=[];if(_0x54bb5c){var _0x6850de;for(var _0x4d5b15=0x0,_0x971745;_0x4d5b15<_0x54bb5c[_0x627e('0x22')];_0x4d5b15+=0x1){_0x971745=_0x54bb5c[_0x4d5b15][_0x627e('0x4e')]({'plain':!![]});switch(_0x971745[_0x627e('0x4c')]){case _0x627e('0x4f'):_0x42f70c[_0x627e('0x50')](db[_0x627e('0x51')][_0x627e('0x52')](_0x7f1741(_0x971745,'VoiceQueueId'))[_0x627e('0x4d')](function(){})[_0x627e('0x29')](_0x5ce687()));break;case _0x627e('0x53'):_0x42f70c[_0x627e('0x50')](db[_0x627e('0x51')][_0x627e('0x52')](_0x103314(_0x971745,_0x627e('0x54')))[_0x627e('0x4d')](function(){})['catch'](_0x5ce687()));break;default:_0x42f70c[_0x627e('0x50')](db[_0x627e('0x51')][_0x627e('0x52')](_0x5d3ed5(_0x971745,_0x627e('0x54')))[_0x627e('0x4d')](function(){})[_0x627e('0x29')](_0x5ce687()));}}}return _0x42f70c;})[_0x627e('0x55')]()[_0x627e('0x4d')](function(){return db[_0x627e('0x49')][_0x627e('0x4a')]({'where':{'type':_0x627e('0x4b')},'attributes':['id'],'include':[{'model':db[_0x627e('0x56')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x627e('0x4d')](function(_0x564c38){var _0x4cc314=[];if(_0x564c38){var _0x1fb76b;for(var _0x261530=0x0,_0x59d30d;_0x261530<_0x564c38['length'];_0x261530+=0x1){_0x59d30d=_0x564c38[_0x261530][_0x627e('0x4e')]({'plain':!![]});_0x4cc314[_0x627e('0x50')](db['sequelize'][_0x627e('0x52')](_0x15563f(_0x59d30d,_0x627e('0x54')))[_0x627e('0x4d')](function(){})[_0x627e('0x29')](_0x5ce687()));}}return _0x4cc314;})[_0x627e('0x55')]();})[_0x627e('0x4d')](function(){return db['Campaign'][_0x627e('0x4a')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x627e('0x56')],'as':'Lists','where':{'id':LISTID}}]})[_0x627e('0x4d')](function(_0x5db6fe){var _0x24cca7=[];if(_0x5db6fe){for(var _0xe17841=0x0,_0x419dbd;_0xe17841<_0x5db6fe[_0x627e('0x22')];_0xe17841+=0x1){_0x419dbd=_0x5db6fe[_0xe17841][_0x627e('0x4e')]({'plain':!![]});switch(_0x419dbd['dialCheckDuplicateType']){case _0x627e('0x4f'):_0x24cca7['push'](db['sequelize']['query'](_0x7f1741(_0x419dbd,'CampaignId'))[_0x627e('0x4d')](function(){})['catch'](_0x5ce687()));break;case _0x627e('0x53'):_0x24cca7[_0x627e('0x50')](db[_0x627e('0x51')][_0x627e('0x52')](_0x103314(_0x419dbd,'CampaignId'))['then'](function(){})[_0x627e('0x29')](_0x5ce687()));break;default:_0x24cca7[_0x627e('0x50')](db['sequelize'][_0x627e('0x52')](_0x5d3ed5(_0x419dbd,'CampaignId'))['then'](function(){})[_0x627e('0x29')](_0x5ce687()));}}}return _0x24cca7;})['all']();})[_0x627e('0x4d')](function(){return db['Campaign'][_0x627e('0x4a')]({'attributes':['id'],'include':[{'model':db[_0x627e('0x56')],'as':_0x627e('0x57'),'where':{'id':LISTID}}]})[_0x627e('0x4d')](function(_0x57bab){var _0x504116=[];if(_0x57bab){for(var _0x27c287=0x0,_0xc6881b;_0x27c287<_0x57bab[_0x627e('0x22')];_0x27c287+=0x1){_0xc6881b=_0x57bab[_0x27c287][_0x627e('0x4e')]({'plain':!![]});_0x504116['push'](db[_0x627e('0x51')]['query'](_0x15563f(_0xc6881b,_0x627e('0x58')))[_0x627e('0x4d')](function(){})[_0x627e('0x29')](_0x5ce687()));}}return _0x504116;})[_0x627e('0x55')]();})['catch'](function(_0x29cdff){logger[_0x627e('0x15')](_0x627e('0x59'),_0x627e('0x5a'),_0x29cdff[_0x627e('0x5b')]);});}var processPromises=function(_0x30d446){return BPromise['all'](promises)[_0x627e('0x4d')](function(_0x4c2b7a){})[_0x627e('0x29')](function(_0x4948e4){logger[_0x627e('0x15')](_0x627e('0x5c'),JSON[_0x627e('0x2b')](_0x4948e4));})['finally'](function(){socket['emit'](_0x627e('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x30d446){return _0x30d446[_0x627e('0x5e')]();}});};var endCsv=function(){return BPromise[_0x627e('0x5f')]()[_0x627e('0x4d')](function(){if(hopperContacts){return checkHopper();}})[_0x627e('0x4d')](function(){socket[_0x627e('0x60')](_0x627e('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x627e('0x61')](FILEPATH);}catch(_0x2fff67){logger[_0x627e('0x15')](_0x627e('0x62'),JSON[_0x627e('0x2b')](_0x2fff67));}finally{process[_0x627e('0x63')](0x0);}});};process['on'](_0x627e('0x64'),function(){logger[_0x627e('0x65')](_0x627e('0x66'));endCsv();});function main(){return BPromise[_0x627e('0x5f')]()[_0x627e('0x4d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x627e('0xf')](',');return db[_0x627e('0x25')][_0x627e('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x627e('0x4d')](function(_0x122b0){var _0x28ea7d=fs[_0x627e('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x627e('0x68')](_0x28ea7d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x557e25,_0x4579f2){total+=0x1;var _0x4d0d09=total;promises['push'](checkRow(_0x557e25,_0x122b0,_0x4d0d09)[_0x627e('0x4d')](function(){success+=0x1;})['catch'](function(_0x1ff4a3){if(_0x1ff4a3['error']){errors+=0x1;delete _0x1ff4a3['error'];}else if(_0x1ff4a3[_0x627e('0x24')]){duplicates+=0x1;delete _0x1ff4a3[_0x627e('0x24')];}rows['push'](_0x1ff4a3);}));if(total%0xc8===0x0){_0x4579f2[_0x627e('0x69')]();return processPromises(_0x4579f2);}},'complete':function(){return processPromises()[_0x627e('0x4d')](function(){logger[_0x627e('0x65')](_0x627e('0x6a'));endCsv();});},'error':function(_0x4af9cc,_0x4a3ae3){logger[_0x627e('0x65')](_0x627e('0x6b'),JSON[_0x627e('0x2b')](_0x4af9cc));endCsv();}});})[_0x627e('0x29')](function(_0x54b57b){logger[_0x627e('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x627e('0x2b')](_0x54b57b));});}main(); \ No newline at end of file +var _0x8f73=['catch','onlyIfOpen','VoiceQueueId','all','BlackLists','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','hasOwnProperty','data','firstName','error','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','select','id\x20IN\x20?','str','calleridnum','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query'];(function(_0x517af0,_0x41236e){var _0x184839=function(_0xfbf8f5){while(--_0xfbf8f5){_0x517af0['push'](_0x517af0['shift']());}};_0x184839(++_0x41236e);}(_0x8f73,0xfa));var _0x38f7=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x8f73[_0x411add];return _0x238242;};'use strict';var BPromise=require(_0x38f7('0x0'));var util=require(_0x38f7('0x1'));var _=require(_0x38f7('0x2'));var fs=require('fs');var squel=require(_0x38f7('0x3'));var Papa=require(_0x38f7('0x4'));var Redis=require(_0x38f7('0x5'));var db=require(_0x38f7('0x6'))['db'];var config=require(_0x38f7('0x7'));var logger=require(_0x38f7('0x8'))('api');config[_0x38f7('0x9')]=_[_0x38f7('0xa')](config[_0x38f7('0x9')],{'host':_0x38f7('0xb'),'port':0x18eb});var socket=require(_0x38f7('0xc'))(new Redis(config[_0x38f7('0x9')]));require(_0x38f7('0xd'))[_0x38f7('0xe')](socket);try{if(!process[_0x38f7('0xf')][0x2]||process[_0x38f7('0xf')][0x2]===_0x38f7('0x10')||process['argv'][0x2]==='null'){throw new Error(_0x38f7('0x11'));}var FILEPATH=process[_0x38f7('0xf')][0x2];if(!process[_0x38f7('0xf')][0x3]||process[_0x38f7('0xf')][0x3]===_0x38f7('0x10')||process[_0x38f7('0xf')][0x3]===_0x38f7('0x12')||!process['argv'][0x4]||process[_0x38f7('0xf')][0x4]===_0x38f7('0x10')||process[_0x38f7('0xf')][0x4]==='null'){throw new Error(_0x38f7('0x13'));}var FIELDS=_[_0x38f7('0x14')](process[_0x38f7('0xf')][0x3][_0x38f7('0x15')](','),process[_0x38f7('0xf')][0x4][_0x38f7('0x15')](','));if(!process[_0x38f7('0xf')][0x5]||process[_0x38f7('0xf')][0x5]===_0x38f7('0x10')||process['argv'][0x5]===_0x38f7('0x12')){throw new Error(_0x38f7('0x16'));}var LISTID=process[_0x38f7('0xf')][0x5];var COMPANYID=process[_0x38f7('0xf')][0x6]&&process[_0x38f7('0xf')][0x6]!==_0x38f7('0x10')&&process['argv'][0x6]!==_0x38f7('0x12')?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0x38f7('0x10')&&process[_0x38f7('0xf')][0x7]!=='null'?process[_0x38f7('0xf')][0x7]:null;if(!process['argv'][0x8]||process[_0x38f7('0xf')][0x8]===_0x38f7('0x10')||process[_0x38f7('0xf')][0x8]===_0x38f7('0x12')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x38f7('0xf')][0x8];}catch(_0xd5bb6){logger['error'](_0xd5bb6);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(_0x50704e,_0x49f298,_0x3d8b56,_0x4079a9){var _0x4150c1={'message':_0x49f298};_0x4150c1[_0x50704e]=!![];if(_0x3d8b56){_0x4150c1['contact']=_0x3d8b56;}if(_0x4079a9){_0x4150c1['index']=_0x4079a9;}return _0x4150c1;}function isEmail(_0x25fa9c){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))*$/[_0x38f7('0x17')](_0x25fa9c);}function checkRow(_0x456d0d,_0x469f84,_0x2204db){return new BPromise(function(_0x10aa8a,_0x48cd0e){if(_[_0x38f7('0x18')](_0x456d0d)){return _0x48cd0e(handleCheckRowError('error',_0x38f7('0x19'),null,_0x2204db));}if(_0x456d0d[_0x38f7('0x1a')]&&_0x456d0d[_0x38f7('0x1a')]['length']){var _0x814f21=_[_0x38f7('0x1b')](_0x456d0d[_0x38f7('0x1a')],_0x38f7('0x1c'))[_0x38f7('0x1d')](';');return _0x48cd0e(handleCheckRowError('error',_0x814f21,null,_0x2204db));}var _0x285c4d={};for(var _0x2354b5 in FIELDS){if(FIELDS[_0x38f7('0x1e')](_0x2354b5)&&FIELDS[_0x2354b5]){_0x285c4d[_0x2354b5]=_0x456d0d[_0x38f7('0x1f')][0x0][FIELDS[_0x2354b5]]||_0x456d0d[_0x38f7('0x1f')][0x0]['\ufeff'+FIELDS[_0x2354b5]];}}if(!_0x285c4d[_0x38f7('0x20')]){return _0x48cd0e(handleCheckRowError(_0x38f7('0x21'),_0x38f7('0x22'),null,_0x2204db));}if(!_0x285c4d[_0x38f7('0x23')]){return _0x48cd0e(handleCheckRowError(_0x38f7('0x21'),_0x38f7('0x24'),null,_0x2204db));}if(_0x285c4d['birthDate']){var _0x179b37=moment(_0x285c4d[_0x38f7('0x25')],'YYYY-MM-DD');if(!_0x179b37['isValid']()){return _0x48cd0e(handleCheckRowError('error',_0x38f7('0x26'),null,_0x2204db));}}if(_0x285c4d[_0x38f7('0x27')]){if(!isEmail(_0x285c4d[_0x38f7('0x27')])){return _0x48cd0e(handleCheckRowError(_0x38f7('0x21'),_0x38f7('0x28'),null,_0x2204db));}}_0x285c4d[_0x38f7('0x29')]=LISTID;_0x285c4d[_0x38f7('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x38f7('0x2b')]&&_0x469f84){var _0x2b8acb={};for(var _0x5a33e8=0x0,_0x46e352=DUPLICATES['length'];_0x5a33e8<_0x46e352;_0x5a33e8+=0x1){_0x2b8acb[DUPLICATES[_0x5a33e8]]=_0x285c4d[DUPLICATES[_0x5a33e8]];}var _0x5d4dd4=_[_0x38f7('0x2c')](_0x469f84,_0x2b8acb);if(_0x5d4dd4){return _0x48cd0e(handleCheckRowError(_0x38f7('0x2d'),_0x38f7('0x2e'),_0x5d4dd4,_0x2204db));}}return db[_0x38f7('0x2f')][_0x38f7('0x30')](_0x285c4d,{'raw':!![],'hooks':![],'fields':_[_0x38f7('0x31')](_0x285c4d)})[_0x38f7('0x32')](function(_0x9e5f22){if(DUPLICATES&&DUPLICATES[_0x38f7('0x2b')]&&_0x469f84){_0x469f84[_0x38f7('0x33')](_['pick'](_0x285c4d,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x9e5f22['id'];return _0x10aa8a();})['catch'](function(_0x8295e1){return _0x48cd0e(handleCheckRowError(_0x38f7('0x21'),_0x38f7('0x34')+(_0x8295e1[_0x38f7('0x1c')]||JSON[_0x38f7('0x35')](_0x8295e1)),null,_0x2204db));});});}function checkHopper(){function _0x56cb70(){return function(_0x4e5464){logger[_0x38f7('0x21')](_0x38f7('0x36'),'checkHopper',util[_0x38f7('0x37')](_0x4e5464,{'showHidden':![],'depth':null}));};}var _0x52c4ff=function(_0x48e452,_0xd21b5a){var _0x538d53=squel[_0x38f7('0x38')]()[_0x38f7('0x39')](_0x38f7('0x3a'))[_0x38f7('0x3b')]([_0x38f7('0x23'),_0x38f7('0x3c'),_0x38f7('0x3d'),_0x38f7('0x29'),_0xd21b5a,_0x38f7('0x3e'),_0x38f7('0x3f')],squel['select']()[_0x38f7('0x40')](_0x38f7('0x23'),_0x38f7('0x23'))[_0x38f7('0x40')](_0x38f7('0x41'),'scheduledAt')[_0x38f7('0x40')]('id','ContactId')['field'](LISTID['toString'](),_0x38f7('0x29'))['field'](_0x48e452['id'][_0x38f7('0x42')](),_0xd21b5a)[_0x38f7('0x40')](_0x38f7('0x41'),_0x38f7('0x3e'))[_0x38f7('0x40')]('NOW()',_0x38f7('0x3f'))[_0x38f7('0x43')](_0x38f7('0x44'))[_0x38f7('0x45')](_0x38f7('0x46'))[_0x38f7('0x45')](_0x38f7('0x47'),LISTID[_0x38f7('0x42')]())[_0x38f7('0x45')](_0x38f7('0x48'))[_0x38f7('0x45')](_0x38f7('0x49'),squel['select']()[_0x38f7('0x40')](_0x38f7('0x23'))[_0x38f7('0x43')]('cm_hopper')[_0x38f7('0x45')](_0xd21b5a+_0x38f7('0x4a'),_0x48e452['id'][_0x38f7('0x42')]())))['toString']();return _0x538d53;};var _0x49a30e=function(_0xf32a02,_0x54bd24){var _0x5408a3=squel[_0x38f7('0x38')]()[_0x38f7('0x39')](_0x38f7('0x3a'))[_0x38f7('0x3b')](['phone',_0x38f7('0x3c'),_0x38f7('0x3d'),_0x38f7('0x29'),_0x54bd24,_0x38f7('0x3e'),_0x38f7('0x3f')],squel[_0x38f7('0x4b')]()['field'](_0x38f7('0x23'),_0x38f7('0x23'))['field'](_0x38f7('0x41'),_0x38f7('0x3c'))[_0x38f7('0x40')]('id',_0x38f7('0x3d'))[_0x38f7('0x40')](LISTID[_0x38f7('0x42')](),_0x38f7('0x29'))[_0x38f7('0x40')](_0xf32a02['id']['toString'](),_0x54bd24)[_0x38f7('0x40')](_0x38f7('0x41'),'createdAt')[_0x38f7('0x40')]('NOW()','updatedAt')[_0x38f7('0x43')](_0x38f7('0x44'))[_0x38f7('0x45')](_0x38f7('0x46'))['where'](_0x38f7('0x47'),LISTID['toString']())[_0x38f7('0x45')](_0x38f7('0x4c'),squel[_0x38f7('0x4d')](hopperContacts))['where'](_0x38f7('0x48'))['where'](_0x38f7('0x49'),squel[_0x38f7('0x4b')]()[_0x38f7('0x40')](_0x38f7('0x4e'))['from']('cm_hopper_final')[_0x38f7('0x45')](_0x54bd24+_0x38f7('0x4a'),_0xf32a02['id'][_0x38f7('0x42')]()))[_0x38f7('0x45')](_0x38f7('0x49'),squel['select']()[_0x38f7('0x40')]('phone')[_0x38f7('0x43')](_0x38f7('0x3a'))[_0x38f7('0x45')](_0x54bd24+_0x38f7('0x4a'),_0xf32a02['id']['toString']())))[_0x38f7('0x42')]();return _0x5408a3;};function _0x3d465c(_0x45dd18,_0x20db4c){var _0xdf5e9e=squel[_0x38f7('0x38')]()[_0x38f7('0x39')](_0x38f7('0x3a'))[_0x38f7('0x3b')]([_0x38f7('0x23'),'scheduledAt',_0x38f7('0x3d'),_0x38f7('0x29'),_0x20db4c,_0x38f7('0x3e'),_0x38f7('0x3f')],squel[_0x38f7('0x4b')]()[_0x38f7('0x40')](_0x38f7('0x23'),'phone')[_0x38f7('0x40')](_0x38f7('0x41'),_0x38f7('0x3c'))[_0x38f7('0x40')]('id',_0x38f7('0x3d'))['field'](LISTID[_0x38f7('0x42')](),_0x38f7('0x29'))[_0x38f7('0x40')](_0x45dd18['id'][_0x38f7('0x42')](),_0x20db4c)['field'](_0x38f7('0x41'),_0x38f7('0x3e'))[_0x38f7('0x40')](_0x38f7('0x41'),_0x38f7('0x3f'))[_0x38f7('0x43')](_0x38f7('0x44'))['where'](_0x38f7('0x46'))[_0x38f7('0x45')](_0x38f7('0x47'),LISTID['toString']())['where'](_0x38f7('0x4c'),squel['str'](hopperContacts))[_0x38f7('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0x38f7('0x42')]();return _0xdf5e9e;}function _0x590fa5(_0x2e0d55,_0x5c5391){var _0x437b49=squel[_0x38f7('0x38')]()['into']('cm_hopper_black')[_0x38f7('0x3b')]([_0x38f7('0x23'),_0x38f7('0x3d'),_0x38f7('0x29'),_0x5c5391,_0x38f7('0x3e'),_0x38f7('0x3f')],squel[_0x38f7('0x4b')]()['field']('phone',_0x38f7('0x23'))['field']('id','ContactId')[_0x38f7('0x40')](LISTID['toString'](),'ListId')['field'](_0x2e0d55['id']['toString'](),_0x5c5391)[_0x38f7('0x40')](_0x38f7('0x41'),'createdAt')[_0x38f7('0x40')](_0x38f7('0x41'),_0x38f7('0x3f'))[_0x38f7('0x43')](_0x38f7('0x44'))[_0x38f7('0x45')](_0x38f7('0x46'))['where']('ListId\x20=\x20?',LISTID[_0x38f7('0x42')]())['where'](_0x38f7('0x4c'),squel['str'](hopperContacts))['where'](_0x38f7('0x48')))[_0x38f7('0x42')]();return _0x437b49;}return db[_0x38f7('0x4f')][_0x38f7('0x50')]({'where':{'type':_0x38f7('0x51')},'attributes':['id',_0x38f7('0x52')],'include':[{'model':db[_0x38f7('0x53')],'as':_0x38f7('0x54'),'where':{'id':LISTID}}]})[_0x38f7('0x32')](function(_0xd789ec){var _0x3512fa=[];if(_0xd789ec){var _0xca49bd;for(var _0x544c71=0x0,_0x26cce8;_0x544c71<_0xd789ec[_0x38f7('0x2b')];_0x544c71+=0x1){_0x26cce8=_0xd789ec[_0x544c71][_0x38f7('0x55')]({'plain':!![]});switch(_0x26cce8[_0x38f7('0x52')]){case _0x38f7('0x56'):_0x3512fa[_0x38f7('0x33')](db[_0x38f7('0x57')][_0x38f7('0x58')](_0x49a30e(_0x26cce8,'VoiceQueueId'))[_0x38f7('0x32')](function(){})[_0x38f7('0x59')](_0x56cb70()));break;case _0x38f7('0x5a'):_0x3512fa[_0x38f7('0x33')](db[_0x38f7('0x57')][_0x38f7('0x58')](_0x52c4ff(_0x26cce8,_0x38f7('0x5b')))['then'](function(){})[_0x38f7('0x59')](_0x56cb70()));break;default:_0x3512fa[_0x38f7('0x33')](db['sequelize'][_0x38f7('0x58')](_0x3d465c(_0x26cce8,_0x38f7('0x5b')))['then'](function(){})[_0x38f7('0x59')](_0x56cb70()));}}}return _0x3512fa;})[_0x38f7('0x5c')]()[_0x38f7('0x32')](function(){return db[_0x38f7('0x4f')]['findAll']({'where':{'type':_0x38f7('0x51')},'attributes':['id'],'include':[{'model':db[_0x38f7('0x53')],'as':_0x38f7('0x5d'),'where':{'id':LISTID}}]})[_0x38f7('0x32')](function(_0x15677a){var _0x446adc=[];if(_0x15677a){var _0x211b95;for(var _0x14457f=0x0,_0x2a9f6;_0x14457f<_0x15677a[_0x38f7('0x2b')];_0x14457f+=0x1){_0x2a9f6=_0x15677a[_0x14457f]['get']({'plain':!![]});_0x446adc[_0x38f7('0x33')](db['sequelize'][_0x38f7('0x58')](_0x590fa5(_0x2a9f6,_0x38f7('0x5b')))[_0x38f7('0x32')](function(){})['catch'](_0x56cb70()));}}return _0x446adc;})[_0x38f7('0x5c')]();})[_0x38f7('0x32')](function(){return db['Campaign'][_0x38f7('0x50')]({'attributes':['id',_0x38f7('0x52')],'include':[{'model':db[_0x38f7('0x53')],'as':'Lists','where':{'id':LISTID}}]})[_0x38f7('0x32')](function(_0x5466e4){var _0x3baa33=[];if(_0x5466e4){for(var _0x1b9936=0x0,_0xc6a379;_0x1b9936<_0x5466e4['length'];_0x1b9936+=0x1){_0xc6a379=_0x5466e4[_0x1b9936][_0x38f7('0x55')]({'plain':!![]});switch(_0xc6a379[_0x38f7('0x52')]){case _0x38f7('0x56'):_0x3baa33[_0x38f7('0x33')](db[_0x38f7('0x57')][_0x38f7('0x58')](_0x49a30e(_0xc6a379,_0x38f7('0x5e')))[_0x38f7('0x32')](function(){})[_0x38f7('0x59')](_0x56cb70()));break;case _0x38f7('0x5a'):_0x3baa33[_0x38f7('0x33')](db[_0x38f7('0x57')]['query'](_0x52c4ff(_0xc6a379,_0x38f7('0x5e')))[_0x38f7('0x32')](function(){})['catch'](_0x56cb70()));break;default:_0x3baa33['push'](db['sequelize'][_0x38f7('0x58')](_0x3d465c(_0xc6a379,_0x38f7('0x5e')))[_0x38f7('0x32')](function(){})[_0x38f7('0x59')](_0x56cb70()));}}}return _0x3baa33;})[_0x38f7('0x5c')]();})[_0x38f7('0x32')](function(){return db['Campaign'][_0x38f7('0x50')]({'attributes':['id'],'include':[{'model':db[_0x38f7('0x53')],'as':_0x38f7('0x5d'),'where':{'id':LISTID}}]})[_0x38f7('0x32')](function(_0x584ebb){var _0x549443=[];if(_0x584ebb){for(var _0x522210=0x0,_0x3c74b8;_0x522210<_0x584ebb[_0x38f7('0x2b')];_0x522210+=0x1){_0x3c74b8=_0x584ebb[_0x522210]['get']({'plain':!![]});_0x549443['push'](db[_0x38f7('0x57')][_0x38f7('0x58')](_0x590fa5(_0x3c74b8,_0x38f7('0x5e')))[_0x38f7('0x32')](function(){})[_0x38f7('0x59')](_0x56cb70()));}}return _0x549443;})[_0x38f7('0x5c')]();})['catch'](function(_0x5ce622){logger[_0x38f7('0x21')](_0x38f7('0x5f'),_0x38f7('0x60'),_0x5ce622[_0x38f7('0x1c')]);});}var processPromises=function(_0x3860ce){return BPromise[_0x38f7('0x5c')](promises)[_0x38f7('0x32')](function(_0x2c6a7f){})[_0x38f7('0x59')](function(_0x10470b){logger[_0x38f7('0x21')]('Error\x20processing\x20rows\x20block:',JSON[_0x38f7('0x35')](_0x10470b));})[_0x38f7('0x61')](function(){socket[_0x38f7('0x62')](_0x38f7('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3860ce){return _0x3860ce[_0x38f7('0x64')]();}});};var endCsv=function(){return BPromise[_0x38f7('0x65')]()[_0x38f7('0x32')](function(){if(hopperContacts){return checkHopper();}})[_0x38f7('0x32')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x38f7('0x66')](FILEPATH);}catch(_0x474bf3){logger[_0x38f7('0x21')](_0x38f7('0x67'),JSON[_0x38f7('0x35')](_0x474bf3));}finally{process['exit'](0x0);}});};process['on'](_0x38f7('0x68'),function(){logger[_0x38f7('0x69')](_0x38f7('0x6a'));endCsv();});function main(){return BPromise['resolve']()[_0x38f7('0x32')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x38f7('0x15')](',');return db['CmContact'][_0x38f7('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x38f7('0x32')](function(_0x5c5373){var _0x4fec64=fs[_0x38f7('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x38f7('0x6c')](_0x4fec64,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3446fb,_0x1a0f1b){total+=0x1;var _0x2ad7e5=total;promises[_0x38f7('0x33')](checkRow(_0x3446fb,_0x5c5373,_0x2ad7e5)[_0x38f7('0x32')](function(){success+=0x1;})[_0x38f7('0x59')](function(_0x15fe6a){if(_0x15fe6a[_0x38f7('0x21')]){errors+=0x1;delete _0x15fe6a['error'];}else if(_0x15fe6a[_0x38f7('0x2d')]){duplicates+=0x1;delete _0x15fe6a[_0x38f7('0x2d')];}rows[_0x38f7('0x33')](_0x15fe6a);}));if(total%0xc8===0x0){_0x1a0f1b[_0x38f7('0x6d')]();return processPromises(_0x1a0f1b);}},'complete':function(){return processPromises()['then'](function(){logger[_0x38f7('0x69')](_0x38f7('0x6e'));endCsv();});},'error':function(_0x4ee7e8,_0x33b4b0){logger[_0x38f7('0x69')](_0x38f7('0x6f'),JSON['stringify'](_0x4ee7e8));endCsv();}});})[_0x38f7('0x59')](function(_0x1a8968){logger[_0x38f7('0x21')](_0x38f7('0x70'),JSON[_0x38f7('0x35')](_0x1a8968));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index aa7f595..007bdbf 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 _0xc6c2=['import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.ListId','updatedAt','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','error','message','errors','push','code','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','length','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','all','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','binding','root','server/files/tmp','.csv','includes','header',',utcOffset','writeFileSync','parse','createReadStream','data','rows','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','then',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','campaigns_has_cm_lists','DROP\x20TABLE\x20','each','finish','affectedRows','contact:import:','unlink','exit','argv','arguments\x20\x20\x20','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb'];(function(_0x31b10e,_0x268282){var _0x3e53fc=function(_0x4d88d9){while(--_0x4d88d9){_0x31b10e['push'](_0x31b10e['shift']());}};_0x3e53fc(++_0x268282);}(_0xc6c2,0x93));var _0x2c6c=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xc6c2[_0x1147ab];return _0x55cb5a;};'use strict';var fs=require('fs');var path=require(_0x2c6c('0x0'));var _=require(_0x2c6c('0x1'));var Papa=require(_0x2c6c('0x2'));var util=require(_0x2c6c('0x3'));var BPromise=require(_0x2c6c('0x4'));var moment=require(_0x2c6c('0x5'));var squel=require('squel');var Redis=require(_0x2c6c('0x6'));var db=require(_0x2c6c('0x7'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require('../../../config/logger')(_0x2c6c('0x8'));config[_0x2c6c('0x9')]=_[_0x2c6c('0xa')](config['redis'],{'host':_0x2c6c('0xb'),'port':0x18eb});var socket=require(_0x2c6c('0xc'))(new Redis(config[_0x2c6c('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x2c6c('0xd')](_0x2c6c('0xe'));function isEmail(_0x3e24d9){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))*$/[_0x2c6c('0xf')](_0x3e24d9);}function selectNotIn(_0x1bfd97,_0x5875eb,_0x454363,_0x411e5b,_0x1bd7f6){return squel[_0x2c6c('0x10')]()[_0x2c6c('0x11')](_0x2c6c('0x12'))[_0x2c6c('0x13')](_0x411e5b)[_0x2c6c('0x14')](_0x5875eb,null,_0x5875eb+_0x2c6c('0x15')+_0x411e5b+'.'+_0x454363)['where'](_0x411e5b+'.'+_0x454363+_0x2c6c('0x16')+_0x1bfd97+'.'+_0x454363)[_0x2c6c('0x17')](_0x5875eb+_0x2c6c('0x18')+_0x1bd7f6[_0x2c6c('0x14')]()+')');}function insertCmHopper(_0x7dbc8a,_0x1372c6,_0x5705b2,_0x2be0e6,_0x58930c){var _0x4a74fd=[_0x2c6c('0x19'),_0x2c6c('0x1a'),_0x2c6c('0x1b'),'cm_contacts.ListId',_0x1372c6+'.'+_0x2be0e6,_0x2c6c('0x1c'),_0x2c6c('0x1d'),_0x2c6c('0x1e'),_0x2c6c('0x1f'),'\x22'+_0x58930c+'\x22'];return squel[_0x2c6c('0x20')]()[_0x2c6c('0x21')]('cm_hopper')[_0x2c6c('0x22')]([_0x2c6c('0x12'),_0x2c6c('0x23'),_0x2c6c('0x24'),_0x2c6c('0x25'),_0x2be0e6,_0x2c6c('0x26'),'updatedAt',_0x2c6c('0x27'),_0x2c6c('0x28'),_0x2c6c('0x29')],squel['select']()[_0x2c6c('0x2a')](_0x4a74fd)[_0x2c6c('0x13')](_0x1372c6)[_0x2c6c('0x14')](_0x2c6c('0x2b'),null,_0x2c6c('0x2c')+_0x1372c6+_0x2c6c('0x2d'))[_0x2c6c('0x14')](_0x5705b2,null,_0x5705b2+_0x2c6c('0x15')+_0x1372c6+'.'+_0x2be0e6)[_0x2c6c('0x17')](_0x1372c6+_0x2c6c('0x2e'),_0x7dbc8a)['where'](_0x2c6c('0x2f'),NOW)[_0x2c6c('0x17')](_0x2c6c('0x30'),selectNotIn(_0x1372c6,_0x5705b2,_0x2be0e6,_0x2c6c('0x31'),[_0x2c6c('0x32'),_0x2c6c('0x33')]))['where'](_0x2c6c('0x30'),selectNotIn(_0x1372c6,_0x5705b2,_0x2be0e6,_0x2c6c('0x31'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x2aa04a,_0x46206e,_0x1b0b90,_0xd9ffaa){var _0x3fe8a6=[_0x2c6c('0x19'),_0x2c6c('0x1b'),_0x2c6c('0x34'),_0x46206e+'.'+_0xd9ffaa,_0x2c6c('0x1c'),_0x2c6c('0x1d')];return squel['insert']()['into']('cm_hopper_black')[_0x2c6c('0x22')]([_0x2c6c('0x12'),_0x2c6c('0x24'),'ListId',_0xd9ffaa,_0x2c6c('0x26'),_0x2c6c('0x35')],squel[_0x2c6c('0x10')]()['fields'](_0x3fe8a6)[_0x2c6c('0x13')](_0x46206e)[_0x2c6c('0x14')](_0x2c6c('0x2b'),null,_0x2c6c('0x2c')+_0x46206e+_0x2c6c('0x2d'))['join'](_0x1b0b90,null,_0x1b0b90+_0x2c6c('0x15')+_0x46206e+'.'+_0xd9ffaa)[_0x2c6c('0x17')](_0x46206e+_0x2c6c('0x2e'),_0x2aa04a)['where'](_0x2c6c('0x2f'),NOW)[_0x2c6c('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x2c6c('0x10')]()['field'](_0x2c6c('0x12'))[_0x2c6c('0x13')](_0x2c6c('0x36'))[_0x2c6c('0x17')](_0x2c6c('0x37'),_0x2aa04a)['where'](_0xd9ffaa+_0x2c6c('0x38'),_0x46206e+'.'+_0xd9ffaa)))[_0x2c6c('0x39')]();}function insertTzCmHopper(_0x43121f,_0x2fecee,_0x545ac9,_0x4c0d39,_0x13f1e4,_0x546f50){var _0x3b6422=[_0x2c6c('0x19'),_0x2c6c('0x3a')+_0x546f50+_0x2c6c('0x3b'),_0x2c6c('0x1b'),_0x2c6c('0x34'),_0x2fecee+'.'+_0x4c0d39,_0x2c6c('0x1c'),'cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','\x22'+_0x13f1e4+'\x22'];var _0x4f6302=squel[_0x2c6c('0x20')]()[_0x2c6c('0x21')](_0x2c6c('0x31'))[_0x2c6c('0x22')]([_0x2c6c('0x12'),'scheduledat','ContactId',_0x2c6c('0x25'),_0x4c0d39,_0x2c6c('0x26'),_0x2c6c('0x35'),_0x2c6c('0x27'),_0x2c6c('0x28'),_0x2c6c('0x29')],squel[_0x2c6c('0x10')]()[_0x2c6c('0x2a')](_0x3b6422)[_0x2c6c('0x13')](_0x2fecee)['join'](_0x2c6c('0x2b'),null,'cm_contacts.ListId\x20=\x20'+_0x2fecee+_0x2c6c('0x2d'))[_0x2c6c('0x14')](_0x545ac9,null,_0x545ac9+_0x2c6c('0x15')+_0x2fecee+'.'+_0x4c0d39)['join'](_0x546f50,null,_0x546f50+_0x2c6c('0x15')+_0x2fecee+'.'+_0x4c0d39)[_0x2c6c('0x17')](_0x2fecee+_0x2c6c('0x2e'),_0x43121f)[_0x2c6c('0x17')](_0x2c6c('0x2f'),NOW)[_0x2c6c('0x17')](_0x2c6c('0x30'),selectNotIn(_0x2fecee,_0x545ac9,_0x4c0d39,_0x2c6c('0x31'),[_0x2c6c('0x32'),_0x2c6c('0x33')]))[_0x2c6c('0x17')](_0x2c6c('0x30'),selectNotIn(_0x2fecee,_0x545ac9,_0x4c0d39,_0x2c6c('0x31'),[_0x2c6c('0x32')])))['toString']();return _0x4f6302;}function insertTzCmHopperBlack(_0x4b4d28,_0x5bb87a,_0x2cafd5,_0x2b76c9){var _0x5cffd0=[_0x2c6c('0x19'),_0x2c6c('0x1b'),_0x2c6c('0x34'),_0x5bb87a+'.'+_0x2b76c9,_0x2c6c('0x1c'),_0x2c6c('0x1d')];return squel[_0x2c6c('0x20')]()[_0x2c6c('0x21')](_0x2c6c('0x36'))[_0x2c6c('0x22')]([_0x2c6c('0x12'),_0x2c6c('0x24'),_0x2c6c('0x25'),_0x2b76c9,_0x2c6c('0x26'),'updatedAt'],squel[_0x2c6c('0x10')]()['fields'](_0x5cffd0)['from'](_0x5bb87a)['join']('cm_contacts',null,_0x2c6c('0x2c')+_0x5bb87a+'.CmListId')[_0x2c6c('0x14')](_0x2cafd5,null,_0x2cafd5+_0x2c6c('0x15')+_0x5bb87a+'.'+_0x2b76c9)['where'](_0x5bb87a+'.CmListId\x20=\x20?',_0x4b4d28)['where'](_0x2c6c('0x2f'),NOW)['where'](_0x2c6c('0x30'),squel[_0x2c6c('0x10')]()['field']('phone')[_0x2c6c('0x13')](_0x2c6c('0x36'))[_0x2c6c('0x17')](_0x2c6c('0x37'),_0x4b4d28)[_0x2c6c('0x17')](_0x2b76c9+_0x2c6c('0x38'),_0x5bb87a+'.'+_0x2b76c9)))[_0x2c6c('0x39')]();}function insertCmContact(_0x4adbff,_0x3b3da0,_0x44a07b,_0x4c8625){var _0x2efbf1=_[_0x2c6c('0x3c')](_[_0x2c6c('0x3d')](_0x4c8625),[_0x2c6c('0x25'),_0x2c6c('0x3e'),_0x2c6c('0x26'),_0x2c6c('0x35')]);return squel[_0x2c6c('0x20')]()['into'](_0x2c6c('0x2b'))['fromQuery'](_0x2efbf1,squel[_0x2c6c('0x10')]()[_0x2c6c('0x2a')](_0x2efbf1)[_0x2c6c('0x13')](_0x3b3da0)[_0x2c6c('0x17')]('('+_0x44a07b[_0x2c6c('0x14')](',')+_0x2c6c('0x3f'),squel['select']()[_0x2c6c('0x2a')](_0x44a07b)['from']('cm_contacts')[_0x2c6c('0x17')](_0x2c6c('0x37'),_0x4adbff)[_0x2c6c('0x17')](_0x2c6c('0x40')))['where']('id\x20IN\x20?',squel[_0x2c6c('0x10')]()[_0x2c6c('0x11')](_0x2c6c('0x41'),_0x2c6c('0x42'))[_0x2c6c('0x13')](_0x3b3da0)[_0x2c6c('0x43')](_0x44a07b[_0x2c6c('0x14')](','))))[_0x2c6c('0x39')]();}function handleStop(){logger[_0x2c6c('0x44')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x6822d9){logger[_0x2c6c('0x45')](_0x6822d9[_0x2c6c('0x46')]);process['exit'](0x1);}function handleError(_0x28acbc,_0x44da39){stats[_0x2c6c('0x47')][_0x2c6c('0x48')]({'name':_0x44da39[_0x2c6c('0x49')],'message':_0x44da39[_0x2c6c('0x46')],'row':_0x28acbc});}function handleQuery(_0x3e88bd){logger[_0x2c6c('0x44')](_0x3e88bd);return db['sequelize'][_0x2c6c('0x4a')](_0x3e88bd)[_0x2c6c('0x4b')](function(_0x505236){results[_0x2c6c('0x48')](_0x505236);})[_0x2c6c('0x4c')](function(_0x4e4475){logger[_0x2c6c('0x45')](_0x4e4475[_0x2c6c('0x46')]);});}function updateTzCampaigns(_0x48ca89){return new Promise(function(_0x2fc286,_0x256361){var _0x371d61=squel[_0x2c6c('0x10')]()[_0x2c6c('0x2a')]([_0x2c6c('0x4d'),_0x2c6c('0x4e')])[_0x2c6c('0x13')](_0x2c6c('0x4f'))[_0x2c6c('0x14')]('campaigns_has_cm_lists',null,_0x2c6c('0x50'))[_0x2c6c('0x17')](_0x2c6c('0x51')+_0x48ca89);db[_0x2c6c('0x52')][_0x2c6c('0x4a')](_0x371d61[_0x2c6c('0x39')]())['spread'](function(_0x49bf9c){var _0x2f3116=[];for(var _0x5408c2=0x0;_0x5408c2<_0x49bf9c[_0x2c6c('0x53')];_0x5408c2++){_0x2f3116['push'](getTimezoneData(_0x49bf9c[_0x5408c2],tmp_campaigns));}BPromise['all'](_0x2f3116)['then'](function(){_0x2fc286({'val':0x1});});})[_0x2c6c('0x4c')](function(_0x31c577){logger[_0x2c6c('0x45')](_0x31c577['message']);_0x2fc286({'val':0x0});});});}function updateTzVoiceQueues(_0x1375de){return new Promise(function(_0x321f21,_0x5f171f){var _0x5e93d3=squel[_0x2c6c('0x10')]()['fields']([_0x2c6c('0x54'),_0x2c6c('0x55')])['from'](_0x2c6c('0x56'))[_0x2c6c('0x14')]('voice_queues_has_cm_lists',null,_0x2c6c('0x57'))[_0x2c6c('0x17')]('voice_queues_has_cm_lists.CmListId='+_0x1375de);db[_0x2c6c('0x52')][_0x2c6c('0x4a')](_0x5e93d3[_0x2c6c('0x39')]())[_0x2c6c('0x4b')](function(_0x2924b9){var _0x53c08c=[];for(var _0x312bad=0x0;_0x312bad<_0x2924b9['length'];_0x312bad++){_0x53c08c[_0x2c6c('0x48')](getTimezoneData(_0x2924b9[_0x312bad],tmp_voice_queues));}BPromise[_0x2c6c('0x58')](_0x53c08c)['then'](function(){_0x321f21({'val':0x1});});})[_0x2c6c('0x4c')](function(_0x5233d2){logger[_0x2c6c('0x45')](_0x5233d2[_0x2c6c('0x46')]);_0x321f21({'val':0x0});});});}function getTimezoneData(_0x145801,_0x2a356c){return new Promise(function(_0x3b9c26,_0x2c4aea){var _0x46718c=shared[_0x2c6c('0x59')];var _0x1f24b2=_0x46718c[_0x145801[_0x2c6c('0x5a')]];if(_[_0x2c6c('0x5b')](_0x1f24b2)){_0x3b9c26({'ret':0x1});}else{var _0x46b496=_0x1f24b2[_0x2c6c('0x5c')];var _0x27c2d5=squel[_0x2c6c('0x20')]()['into'](_0x2a356c)[_0x2c6c('0x5d')]('id',_0x145801['id'])['set'](_0x2c6c('0x5e'),_0x46b496)[_0x2c6c('0x5d')]('dialTimezone',_0x145801[_0x2c6c('0x5a')])[_0x2c6c('0x39')]();return db[_0x2c6c('0x52')][_0x2c6c('0x4a')](_0x27c2d5)['spread'](function(_0x3983ae){_0x3b9c26({'ret':0x1});})['catch'](function(_0x1e068d){logger[_0x2c6c('0x45')](_0x1e068d[_0x2c6c('0x46')]);_0x2c4aea({'ret':0x1});});}});}function handleTZQuery(_0x1134cc){logger[_0x2c6c('0x44')](_0x1134cc);return db[_0x2c6c('0x52')]['query'](_0x1134cc)[_0x2c6c('0x4b')](function(_0x23aaf0){})[_0x2c6c('0x4c')](function(_0x6ece22){logger[_0x2c6c('0x45')](_0x6ece22['message']);});}function main(_0xb16510,_0x1f26ff,_0x2a2bb4,_0x5aae72){logger[_0x2c6c('0x44')](_0x2c6c('0x5f'),_0xb16510,JSON[_0x2c6c('0x60')](_0x1f26ff));process[_0x2c6c('0x61')]('start');var _0x664758=_0x1f26ff[_0x2c6c('0x62')];var _0x18b07=_0x1f26ff['socket_timestamp'];var _0x3b9db5=path[_0x2c6c('0x14')](config[_0x2c6c('0x63')],_0x2c6c('0x64'),_0x18b07+_0x2c6c('0x65'));hasTZ=_[_0x2c6c('0x3d')](_0x664758)[_0x2c6c('0x66')](_0x2c6c('0x5a'));var _0x5df22c=_[_0x2c6c('0x3d')](_0x664758)[_0x2c6c('0x14')]();logger[_0x2c6c('0x44')](_0x2c6c('0x67'),_0x5df22c);if(hasTZ)_0x5df22c+=_0x2c6c('0x68');fs[_0x2c6c('0x69')](_0x3b9db5,_0x5df22c+'\x0a');Papa[_0x2c6c('0x6a')](fs[_0x2c6c('0x6b')](_0xb16510),{'header':!![],'skipEmptyLines':!![],'step':function(_0xe48218,_0x5a2ca6){try{for(var _0x519104=0x0,_0x34ac3a=[];_0x519104<_0xe48218[_0x2c6c('0x6c')][_0x2c6c('0x53')];_0x519104++){stats[_0x2c6c('0x6d')]+=0x1;if(_0xe48218[_0x2c6c('0x47')][_0x519104]){handleError(_0xe48218[_0x2c6c('0x6c')][_0x519104],_0xe48218[_0x2c6c('0x47')][_0x519104]);}else{var _0x114ca1=[];for(var _0x5ae7b3 in _0x664758){if(_0x664758[_0x2c6c('0x6e')](_0x5ae7b3)){if(_0xe48218[_0x2c6c('0x6c')][_0x519104][_0x664758[_0x5ae7b3]]){var _0x12acd1=_[_0x2c6c('0x6f')](_0xe48218[_0x2c6c('0x6c')][_0x519104][_0x664758[_0x5ae7b3]][_0x2c6c('0x70')](/"/g,'\x27'));switch(_0x5ae7b3){case _0x2c6c('0x23'):var _0x1823b1=moment(_0x12acd1,_0x2c6c('0xe'),!![]);if(_0x1823b1[_0x2c6c('0x71')]()){_0x34ac3a[_0x2c6c('0x48')]('\x22'+_0x12acd1+'\x22');}else{_0x114ca1[_0x2c6c('0x48')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x2c6c('0x27'):var _0x5816af=parseInt(_0x12acd1);_0x12acd1=_[_0x2c6c('0x72')](_0x5816af)||_0x5816af<0x0||_0x5816af>0x4?_0x5aae72?0x3:0x2:_0x5816af;_0x34ac3a[_0x2c6c('0x48')]('\x22'+_0x12acd1+'\x22');break;case _0x2c6c('0x28'):var _0x4badd8=parseInt(_0x12acd1);if(_[_0x2c6c('0x73')](_0x4badd8)&&_['includes'](_0x2a2bb4,_0x4badd8)){_0x34ac3a[_0x2c6c('0x48')]('\x22'+_0x4badd8+'\x22');}else{_0x114ca1[_0x2c6c('0x48')](_0x2c6c('0x74'));}break;case _0x2c6c('0x75'):if(isEmail(_0x12acd1)){_0x34ac3a[_0x2c6c('0x48')]('\x22'+_0x12acd1+'\x22');}else{_0x114ca1[_0x2c6c('0x48')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x55f3d3=moment(_0x12acd1,_0x2c6c('0x76'),!![]);if(_0x55f3d3[_0x2c6c('0x71')]()){_0x34ac3a['push']('\x22'+_0x12acd1+'\x22');}else{_0x114ca1['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x2c6c('0x5a'):var _0x30b6f3=shared[_0x2c6c('0x59')];var _0x1c12ba=_0x30b6f3[_0x12acd1];if(!_[_0x2c6c('0x5b')](_0x1c12ba)){var _0x5e24d0=_0x1c12ba['utcOffset'];_0x34ac3a[_0x2c6c('0x48')]('\x22'+_0x12acd1+'\x22');_0x34ac3a[_0x2c6c('0x48')]('\x22'+_0x5e24d0+'\x22');}break;default:_0x34ac3a[_0x2c6c('0x48')]('\x22'+_0x12acd1+'\x22');}}else{switch(_0x5ae7b3){case _0x2c6c('0x77'):case'phone':_0x114ca1[_0x2c6c('0x48')](_0x5ae7b3+_0x2c6c('0x78'));break;default:_0x34ac3a[_0x2c6c('0x48')]('\x22\x22');}}}}if(_0x114ca1[_0x2c6c('0x53')]){handleError(_0xe48218[_0x2c6c('0x6c')][_0x519104],{'code':_0x2c6c('0x79'),'message':_0x114ca1['join']()});}else{fs[_0x2c6c('0x7a')](_0x3b9db5,_0x34ac3a[_0x2c6c('0x14')]()+'\x0a');}_0x34ac3a=[];}if(!(stats[_0x2c6c('0x6d')]%0xc8)){socket[_0x2c6c('0x7b')]('contact:import:'+_0x18b07,stats);stats[_0x2c6c('0x47')]=[];}}if(stopped){logger['info'](_0x2c6c('0x7c'));_0x5a2ca6['abort']();}}catch(_0xd4a153){handleError(_0xe48218['data'][_0x519104],{'code':_0x2c6c('0x7d'),'message':_0xd4a153[_0x2c6c('0x46')]});logger[_0x2c6c('0x45')](_0x2c6c('0x7e'),_0xd4a153[_0x2c6c('0x46')]);}},'complete':function(){try{var _0x40f150=[];var _0x52f5b8=[];var _0x397fb7='cm_contacts';if(_0x1f26ff[_0x2c6c('0x7f')]&&_0x1f26ff[_0x2c6c('0x7f')]['length']){_0x397fb7=_0x2c6c('0x80')+_0x18b07;_0x40f150[_0x2c6c('0x48')]('CREATE\x20TABLE\x20'+_0x397fb7+_0x2c6c('0x81'));}tmp_campaigns=_0x2c6c('0x82')+_0x18b07;tmp_voice_queues=_0x2c6c('0x83')+_0x18b07;_0x52f5b8[_0x2c6c('0x48')](_0x2c6c('0x84')+tmp_campaigns+_0x2c6c('0x85'));_0x52f5b8[_0x2c6c('0x48')](_0x2c6c('0x84')+tmp_voice_queues+_0x2c6c('0x85'));BPromise['each'](_0x52f5b8,handleTZQuery)[_0x2c6c('0x86')](function(_0x2d250a){updateTzCampaigns(_0x1f26ff[_0x2c6c('0x25')])[_0x2c6c('0x86')](function(_0x2f4deb){updateTzVoiceQueues(_0x1f26ff[_0x2c6c('0x25')])[_0x2c6c('0x86')](function(_0x1269f3){var _0xdb69a6=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x3b9db5,_0x397fb7,_0x5df22c,_0x1f26ff['ListId'],_0x1f26ff['CompanyId']||null,NOW,NOW);if(_[_0x2c6c('0x5b')](_0x664758[_0x2c6c('0x23')])){_0xdb69a6+=_0x2c6c('0x87');}_0x40f150[_0x2c6c('0x48')](_0xdb69a6);if(_0x1f26ff[_0x2c6c('0x7f')]&&_0x1f26ff[_0x2c6c('0x7f')][_0x2c6c('0x53')]){_0x40f150['push'](insertCmContact(_0x1f26ff[_0x2c6c('0x25')],_0x397fb7,_0x1f26ff[_0x2c6c('0x7f')],_0x664758));_0x40f150[_0x2c6c('0x48')]('DROP\x20TABLE\x20'+_0x397fb7+';');}if(hasTZ){_0x40f150[_0x2c6c('0x48')](insertTzCmHopper(_0x1f26ff[_0x2c6c('0x25')],_0x2c6c('0x88'),_0x2c6c('0x56'),_0x2c6c('0x89'),_0x5aae72,tmp_voice_queues));_0x40f150[_0x2c6c('0x48')](insertTzCmHopperBlack(_0x1f26ff['ListId'],_0x2c6c('0x8a'),'voice_queues',_0x2c6c('0x89')));_0x40f150['push'](insertTzCmHopper(_0x1f26ff[_0x2c6c('0x25')],'campaigns_has_cm_lists',_0x2c6c('0x4f'),_0x2c6c('0x8b'),_0x5aae72,tmp_campaigns));_0x40f150[_0x2c6c('0x48')](insertTzCmHopperBlack(_0x1f26ff[_0x2c6c('0x25')],_0x2c6c('0x8c'),_0x2c6c('0x4f'),_0x2c6c('0x8b')));}else{_0x40f150[_0x2c6c('0x48')](insertCmHopper(_0x1f26ff[_0x2c6c('0x25')],_0x2c6c('0x88'),_0x2c6c('0x56'),_0x2c6c('0x89'),_0x5aae72));_0x40f150['push'](insertCmHopperBlack(_0x1f26ff[_0x2c6c('0x25')],_0x2c6c('0x8a'),_0x2c6c('0x56'),_0x2c6c('0x89')));_0x40f150[_0x2c6c('0x48')](insertCmHopper(_0x1f26ff['ListId'],_0x2c6c('0x8d'),_0x2c6c('0x4f'),_0x2c6c('0x8b'),_0x5aae72));_0x40f150[_0x2c6c('0x48')](insertCmHopperBlack(_0x1f26ff[_0x2c6c('0x25')],_0x2c6c('0x8c'),_0x2c6c('0x4f'),'CampaignId'));}_0x40f150[_0x2c6c('0x48')](_0x2c6c('0x8e')+tmp_campaigns+';');_0x40f150['push'](_0x2c6c('0x8e')+tmp_voice_queues+';');BPromise[_0x2c6c('0x8f')](_0x40f150,handleQuery)[_0x2c6c('0x86')](function(_0xaf4999){stats[_0x2c6c('0x90')]=!![];stats[_0x2c6c('0x91')]=_0x1f26ff[_0x2c6c('0x7f')]&&_0x1f26ff[_0x2c6c('0x7f')][_0x2c6c('0x53')]?results[0x2][_0x2c6c('0x91')]:results[0x0]['affectedRows'];socket[_0x2c6c('0x7b')](_0x2c6c('0x92')+_0x18b07,stats);fs[_0x2c6c('0x93')](_0xb16510);fs[_0x2c6c('0x93')](_0x3b9db5);process[_0x2c6c('0x94')](0x0);})['catch'](function(_0x597a60){logger[_0x2c6c('0x45')](_0x597a60['message']);process[_0x2c6c('0x94')](0x1);});});});});}catch(_0x57f4d4){logger[_0x2c6c('0x45')]('complete',_0x57f4d4[_0x2c6c('0x46')]);process['exit'](0x1);}},'error':function(_0x4ff60b,_0x5b3d0b,_0x39aa52,_0x325c89){throw new Error(_0x325c89);}});}function validate(){if(process[_0x2c6c('0x95')]&&process[_0x2c6c('0x95')][_0x2c6c('0x53')]<0x4){throw new Error(_0x2c6c('0x96'));}var _0x1db124=path[_0x2c6c('0x14')](config[_0x2c6c('0x63')],_0x2c6c('0x64'),process[_0x2c6c('0x95')][0x2]);if(!fs['existsSync'](_0x1db124)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x36820b={};try{_0x36820b=JSON['parse'](process['argv'][0x3]);if(!_0x36820b[_0x2c6c('0x62')]){throw new Error(_0x2c6c('0x97'));}if(!_0x36820b['binding'][_0x2c6c('0x12')]){throw new Error(_0x2c6c('0x98'));}if(!_0x36820b[_0x2c6c('0x62')][_0x2c6c('0x77')]){throw new Error('firstName\x20is\x20mandatory');}var _0x134b7e=0x0;if(_0x36820b['binding'][_0x2c6c('0x28')]){_0x134b7e=0x1;}if(!_0x36820b[_0x2c6c('0x25')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x5b6651){throw new Error('body\x20id\x20mandatory');}var _0x15bb12=[];try{_0x15bb12=_['map'](JSON[_0x2c6c('0x6a')](process['argv'][0x4]),'id');}catch(_0x58b606){logger[_0x2c6c('0x44')](_0x2c6c('0x99'));}main(_0x1db124,_0x36820b,_0x15bb12,_0x134b7e);}validate();process['on'](_0x2c6c('0x9a'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xdde2=['cm_contacts.createdAt','cm_contacts.updatedAt','insert','into','ContactId','ListId','createdAt','updatedAt','priority','recallme','select','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','cm_contacts.ListId','cm_hopper_black','fromQuery','fields','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','cm_contacts.UserId','scheduledat','UserId','concat','keys','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','Received\x20SIGINT','exit','push','code','message','info','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','length','all','then','error','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','isNil','utcOffset','set','offset','main','send','binding','root','server/files/tmp','.csv','header',',utcOffset','writeFileSync','parse','createReadStream','data','rows','errors','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','\x20not\x20specified','SystemRow','appendFileSync','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','CampaignId','campaigns','campaigns_has_cm_blacklists','finish','affectedRows','emit','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','lodash','papaparse','util','bluebird','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','defaults','redis','format','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat'];(function(_0x235e5c,_0x8ae60c){var _0x342fe4=function(_0x161732){while(--_0x161732){_0x235e5c['push'](_0x235e5c['shift']());}};_0x342fe4(++_0x8ae60c);}(_0xdde2,0x83));var _0x2dde=function(_0x3bacf7,_0xb874dd){_0x3bacf7=_0x3bacf7-0x0;var _0x3c479b=_0xdde2[_0x3bacf7];return _0x3c479b;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x2dde('0x0'));var Papa=require(_0x2dde('0x1'));var util=require(_0x2dde('0x2'));var BPromise=require(_0x2dde('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x2dde('0x4'));var db=require(_0x2dde('0x5'))['db'];var config=require(_0x2dde('0x6'));var shared=require(_0x2dde('0x7'));var logger=require(_0x2dde('0x8'))(_0x2dde('0x9'));config['redis']=_[_0x2dde('0xa')](config[_0x2dde('0xb')],{'host':'localhost','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 tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x2dde('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x3c0210){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'](_0x3c0210);}function selectNotIn(_0x3144ff,_0x434a29,_0x338220,_0x48ce06,_0x143ebb){return squel['select']()['field'](_0x2dde('0xd'))[_0x2dde('0xe')](_0x48ce06)[_0x2dde('0xf')](_0x434a29,null,_0x434a29+_0x2dde('0x10')+_0x48ce06+'.'+_0x338220)[_0x2dde('0x11')](_0x48ce06+'.'+_0x338220+'\x20=\x20'+_0x3144ff+'.'+_0x338220)[_0x2dde('0x11')](_0x434a29+_0x2dde('0x12')+_0x143ebb['join']()+')');}function insertCmHopper(_0x40f0bd,_0x410777,_0x97f3ef,_0x889597,_0x39ce98){var _0x5e6a08=[_0x2dde('0x13'),_0x2dde('0x14'),'cm_contacts.id','cm_contacts.ListId',_0x410777+'.'+_0x889597,_0x2dde('0x15'),_0x2dde('0x16'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x39ce98+'\x22'];return squel[_0x2dde('0x17')]()[_0x2dde('0x18')]('cm_hopper')['fromQuery']([_0x2dde('0xd'),'scheduledat',_0x2dde('0x19'),_0x2dde('0x1a'),_0x889597,_0x2dde('0x1b'),_0x2dde('0x1c'),_0x2dde('0x1d'),'UserId',_0x2dde('0x1e')],squel[_0x2dde('0x1f')]()['fields'](_0x5e6a08)['from'](_0x410777)[_0x2dde('0xf')](_0x2dde('0x20'),null,_0x2dde('0x21')+_0x410777+_0x2dde('0x22'))[_0x2dde('0xf')](_0x97f3ef,null,_0x97f3ef+_0x2dde('0x10')+_0x410777+'.'+_0x889597)[_0x2dde('0x11')](_0x410777+_0x2dde('0x23'),_0x40f0bd)[_0x2dde('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x2dde('0x11')](_0x2dde('0x24'),selectNotIn(_0x410777,_0x97f3ef,_0x889597,_0x2dde('0x25'),[_0x2dde('0x26'),_0x2dde('0x27')]))[_0x2dde('0x11')](_0x2dde('0x24'),selectNotIn(_0x410777,_0x97f3ef,_0x889597,_0x2dde('0x25'),['\x22always\x22'])))[_0x2dde('0x28')]();}function insertCmHopperBlack(_0x485e3b,_0x33eecb,_0x52880d,_0x471508){var _0x475143=[_0x2dde('0x13'),_0x2dde('0x29'),_0x2dde('0x2a'),_0x33eecb+'.'+_0x471508,_0x2dde('0x15'),_0x2dde('0x16')];return squel[_0x2dde('0x17')]()[_0x2dde('0x18')](_0x2dde('0x2b'))[_0x2dde('0x2c')]([_0x2dde('0xd'),_0x2dde('0x19'),'ListId',_0x471508,_0x2dde('0x1b'),_0x2dde('0x1c')],squel[_0x2dde('0x1f')]()[_0x2dde('0x2d')](_0x475143)[_0x2dde('0xe')](_0x33eecb)[_0x2dde('0xf')](_0x2dde('0x20'),null,_0x2dde('0x21')+_0x33eecb+_0x2dde('0x22'))[_0x2dde('0xf')](_0x52880d,null,_0x52880d+_0x2dde('0x10')+_0x33eecb+'.'+_0x471508)[_0x2dde('0x11')](_0x33eecb+_0x2dde('0x23'),_0x485e3b)[_0x2dde('0x11')](_0x2dde('0x2e'),NOW)[_0x2dde('0x11')](_0x2dde('0x24'),squel['select']()['field']('phone')[_0x2dde('0xe')](_0x2dde('0x2b'))[_0x2dde('0x11')](_0x2dde('0x2f'),_0x485e3b)[_0x2dde('0x11')](_0x471508+_0x2dde('0x30'),_0x33eecb+'.'+_0x471508)))[_0x2dde('0x28')]();}function insertTzCmHopper(_0xb80dcd,_0x12a6ba,_0x259a2b,_0x373060,_0x1bff56,_0x779cc4){var _0x28cc65=[_0x2dde('0x13'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x779cc4+_0x2dde('0x31'),'cm_contacts.id',_0x2dde('0x2a'),_0x12a6ba+'.'+_0x373060,_0x2dde('0x15'),'cm_contacts.updatedAt',_0x2dde('0x32'),_0x2dde('0x33'),'\x22'+_0x1bff56+'\x22'];var _0x1f5d91=squel['insert']()[_0x2dde('0x18')](_0x2dde('0x25'))[_0x2dde('0x2c')]([_0x2dde('0xd'),_0x2dde('0x34'),_0x2dde('0x19'),_0x2dde('0x1a'),_0x373060,'createdAt',_0x2dde('0x1c'),_0x2dde('0x1d'),_0x2dde('0x35'),_0x2dde('0x1e')],squel[_0x2dde('0x1f')]()[_0x2dde('0x2d')](_0x28cc65)[_0x2dde('0xe')](_0x12a6ba)['join'](_0x2dde('0x20'),null,'cm_contacts.ListId\x20=\x20'+_0x12a6ba+_0x2dde('0x22'))['join'](_0x259a2b,null,_0x259a2b+_0x2dde('0x10')+_0x12a6ba+'.'+_0x373060)[_0x2dde('0xf')](_0x779cc4,null,_0x779cc4+_0x2dde('0x10')+_0x12a6ba+'.'+_0x373060)['where'](_0x12a6ba+_0x2dde('0x23'),_0xb80dcd)[_0x2dde('0x11')](_0x2dde('0x2e'),NOW)[_0x2dde('0x11')](_0x2dde('0x24'),selectNotIn(_0x12a6ba,_0x259a2b,_0x373060,_0x2dde('0x25'),['\x22always\x22',_0x2dde('0x27')]))['where'](_0x2dde('0x24'),selectNotIn(_0x12a6ba,_0x259a2b,_0x373060,_0x2dde('0x25'),[_0x2dde('0x26')])))['toString']();return _0x1f5d91;}function insertTzCmHopperBlack(_0x2a70cb,_0x464d51,_0x3f4b26,_0x18d969){var _0x86dc7d=['cm_contacts.phone',_0x2dde('0x29'),_0x2dde('0x2a'),_0x464d51+'.'+_0x18d969,_0x2dde('0x15'),_0x2dde('0x16')];return squel['insert']()['into'](_0x2dde('0x2b'))['fromQuery'](['phone',_0x2dde('0x19'),'ListId',_0x18d969,_0x2dde('0x1b'),'updatedAt'],squel[_0x2dde('0x1f')]()[_0x2dde('0x2d')](_0x86dc7d)[_0x2dde('0xe')](_0x464d51)[_0x2dde('0xf')](_0x2dde('0x20'),null,_0x2dde('0x21')+_0x464d51+_0x2dde('0x22'))['join'](_0x3f4b26,null,_0x3f4b26+_0x2dde('0x10')+_0x464d51+'.'+_0x18d969)['where'](_0x464d51+_0x2dde('0x23'),_0x2a70cb)['where'](_0x2dde('0x2e'),NOW)[_0x2dde('0x11')](_0x2dde('0x24'),squel['select']()['field']('phone')[_0x2dde('0xe')](_0x2dde('0x2b'))[_0x2dde('0x11')](_0x2dde('0x2f'),_0x2a70cb)['where'](_0x18d969+_0x2dde('0x30'),_0x464d51+'.'+_0x18d969)))[_0x2dde('0x28')]();}function insertCmContact(_0x164c34,_0x45d76a,_0x4daf9d,_0x3acde5){var _0x6b32e4=_[_0x2dde('0x36')](_[_0x2dde('0x37')](_0x3acde5),[_0x2dde('0x1a'),_0x2dde('0x38'),_0x2dde('0x1b'),_0x2dde('0x1c')]);return squel[_0x2dde('0x17')]()[_0x2dde('0x18')](_0x2dde('0x20'))['fromQuery'](_0x6b32e4,squel[_0x2dde('0x1f')]()[_0x2dde('0x2d')](_0x6b32e4)[_0x2dde('0xe')](_0x45d76a)[_0x2dde('0x11')]('('+_0x4daf9d[_0x2dde('0xf')](',')+')\x20NOT\x20IN\x20?',squel[_0x2dde('0x1f')]()[_0x2dde('0x2d')](_0x4daf9d)[_0x2dde('0xe')](_0x2dde('0x20'))[_0x2dde('0x11')](_0x2dde('0x2f'),_0x164c34)[_0x2dde('0x11')](_0x2dde('0x39')))[_0x2dde('0x11')](_0x2dde('0x3a'),squel[_0x2dde('0x1f')]()['field']('MIN(id)',_0x2dde('0x3b'))['from'](_0x45d76a)[_0x2dde('0x3c')](_0x4daf9d[_0x2dde('0xf')](','))))[_0x2dde('0x28')]();}function handleStop(){logger['info'](_0x2dde('0x3d'));stopped=!![];}function handleUncaughtException(_0x494a67){logger['error'](_0x494a67['message']);process[_0x2dde('0x3e')](0x1);}function handleError(_0x580a05,_0x4b4a52){stats['errors'][_0x2dde('0x3f')]({'name':_0x4b4a52[_0x2dde('0x40')],'message':_0x4b4a52[_0x2dde('0x41')],'row':_0x580a05});}function handleQuery(_0x1d2c61){logger[_0x2dde('0x42')](_0x1d2c61);return db[_0x2dde('0x43')][_0x2dde('0x44')](_0x1d2c61)[_0x2dde('0x45')](function(_0x52eeb7){results[_0x2dde('0x3f')](_0x52eeb7);})[_0x2dde('0x46')](function(_0x528435){logger['error'](_0x528435[_0x2dde('0x41')]);});}function updateTzCampaigns(_0x524400){return new Promise(function(_0x4ca1bc,_0x3f0827){var _0x462f83=squel[_0x2dde('0x1f')]()[_0x2dde('0x2d')]([_0x2dde('0x47'),_0x2dde('0x48')])[_0x2dde('0xe')]('campaigns')[_0x2dde('0xf')](_0x2dde('0x49'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')['where'](_0x2dde('0x4a')+_0x524400);db[_0x2dde('0x43')][_0x2dde('0x44')](_0x462f83[_0x2dde('0x28')]())[_0x2dde('0x45')](function(_0x6e8658){var _0x118459=[];for(var _0x51b89d=0x0;_0x51b89d<_0x6e8658[_0x2dde('0x4b')];_0x51b89d++){_0x118459['push'](getTimezoneData(_0x6e8658[_0x51b89d],tmp_campaigns));}BPromise[_0x2dde('0x4c')](_0x118459)[_0x2dde('0x4d')](function(){_0x4ca1bc({'val':0x1});});})['catch'](function(_0x2b67f0){logger[_0x2dde('0x4e')](_0x2b67f0['message']);_0x4ca1bc({'val':0x0});});});}function updateTzVoiceQueues(_0x19da8c){return new Promise(function(_0x4e78f9,_0x137597){var _0x4a1c19=squel[_0x2dde('0x1f')]()[_0x2dde('0x2d')]([_0x2dde('0x4f'),_0x2dde('0x50')])[_0x2dde('0xe')]('voice_queues')[_0x2dde('0xf')](_0x2dde('0x51'),null,_0x2dde('0x52'))[_0x2dde('0x11')](_0x2dde('0x53')+_0x19da8c);db[_0x2dde('0x43')][_0x2dde('0x44')](_0x4a1c19[_0x2dde('0x28')]())['spread'](function(_0x1cc1ed){var _0x39df8f=[];for(var _0x34fb80=0x0;_0x34fb80<_0x1cc1ed['length'];_0x34fb80++){_0x39df8f[_0x2dde('0x3f')](getTimezoneData(_0x1cc1ed[_0x34fb80],tmp_voice_queues));}BPromise['all'](_0x39df8f)['then'](function(){_0x4e78f9({'val':0x1});});})['catch'](function(_0xb72feb){logger[_0x2dde('0x4e')](_0xb72feb[_0x2dde('0x41')]);_0x4e78f9({'val':0x0});});});}function getTimezoneData(_0x54bc51,_0x556f0f){return new Promise(function(_0x1387f8,_0x4373aa){var _0x1b834d=shared['timezones'];var _0x38a006=_0x1b834d[_0x54bc51[_0x2dde('0x54')]];if(_[_0x2dde('0x55')](_0x38a006)){_0x1387f8({'ret':0x1});}else{var _0x1822e1=_0x38a006[_0x2dde('0x56')];var _0x14a581=squel['insert']()[_0x2dde('0x18')](_0x556f0f)[_0x2dde('0x57')]('id',_0x54bc51['id'])[_0x2dde('0x57')](_0x2dde('0x58'),_0x1822e1)[_0x2dde('0x57')]('dialTimezone',_0x54bc51[_0x2dde('0x54')])[_0x2dde('0x28')]();return db['sequelize'][_0x2dde('0x44')](_0x14a581)[_0x2dde('0x45')](function(_0x1d447b){_0x1387f8({'ret':0x1});})[_0x2dde('0x46')](function(_0x3c27cd){logger['error'](_0x3c27cd[_0x2dde('0x41')]);_0x4373aa({'ret':0x1});});}});}function handleTZQuery(_0x116a2d){logger[_0x2dde('0x42')](_0x116a2d);return db[_0x2dde('0x43')]['query'](_0x116a2d)[_0x2dde('0x45')](function(_0x2750be){})[_0x2dde('0x46')](function(_0x2599b5){logger['error'](_0x2599b5['message']);});}function main(_0x1f6b3d,_0xc48b76,_0x5810ca,_0x38abf4){logger[_0x2dde('0x42')](_0x2dde('0x59'),_0x1f6b3d,JSON['stringify'](_0xc48b76));process[_0x2dde('0x5a')]('start');var _0x1ca74a=_0xc48b76[_0x2dde('0x5b')];var _0xa43812=_0xc48b76['socket_timestamp'];var _0x3b06f3=path[_0x2dde('0xf')](config[_0x2dde('0x5c')],_0x2dde('0x5d'),_0xa43812+_0x2dde('0x5e'));hasTZ=_['keys'](_0x1ca74a)['includes'](_0x2dde('0x54'));var _0x331c48=_['keys'](_0x1ca74a)['join']();logger[_0x2dde('0x42')](_0x2dde('0x5f'),_0x331c48);if(hasTZ)_0x331c48+=_0x2dde('0x60');fs[_0x2dde('0x61')](_0x3b06f3,_0x331c48+'\x0a');Papa[_0x2dde('0x62')](fs[_0x2dde('0x63')](_0x1f6b3d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x41ae7f,_0x364169){try{for(var _0x225e7d=0x0,_0x31e92d=[];_0x225e7d<_0x41ae7f[_0x2dde('0x64')][_0x2dde('0x4b')];_0x225e7d++){stats[_0x2dde('0x65')]+=0x1;if(_0x41ae7f[_0x2dde('0x66')][_0x225e7d]){handleError(_0x41ae7f[_0x2dde('0x64')][_0x225e7d],_0x41ae7f['errors'][_0x225e7d]);}else{var _0x24815f=[];for(var _0x1d3194 in _0x1ca74a){if(_0x1ca74a[_0x2dde('0x67')](_0x1d3194)){if(_0x41ae7f['data'][_0x225e7d][_0x1ca74a[_0x1d3194]]){var _0x519b37=_[_0x2dde('0x68')](_0x41ae7f[_0x2dde('0x64')][_0x225e7d][_0x1ca74a[_0x1d3194]][_0x2dde('0x69')](/"/g,'\x27'));switch(_0x1d3194){case _0x2dde('0x34'):var _0x4f0941=moment(_0x519b37,_0x2dde('0x6a'),!![]);if(_0x4f0941['isValid']()){_0x31e92d[_0x2dde('0x3f')]('\x22'+_0x519b37+'\x22');}else{_0x24815f['push'](_0x2dde('0x6b'));}break;case'priority':var _0x179239=parseInt(_0x519b37);_0x519b37=_['isNaN'](_0x179239)||_0x179239<0x0||_0x179239>0x4?_0x38abf4?0x3:0x2:_0x179239;_0x31e92d[_0x2dde('0x3f')]('\x22'+_0x519b37+'\x22');break;case _0x2dde('0x35'):var _0x2af92e=parseInt(_0x519b37);if(_['isNumber'](_0x2af92e)&&_['includes'](_0x5810ca,_0x2af92e)){_0x31e92d['push']('\x22'+_0x2af92e+'\x22');}else{_0x24815f['push'](_0x2dde('0x6c'));}break;case _0x2dde('0x6d'):if(isEmail(_0x519b37)){_0x31e92d['push']('\x22'+_0x519b37+'\x22');}else{_0x24815f[_0x2dde('0x3f')](_0x2dde('0x6e'));}break;case _0x2dde('0x6f'):var _0x3fd6a9=moment(_0x519b37,_0x2dde('0x70'),!![]);if(_0x3fd6a9['isValid']()){_0x31e92d[_0x2dde('0x3f')]('\x22'+_0x519b37+'\x22');}else{_0x24815f[_0x2dde('0x3f')](_0x2dde('0x71'));}break;case _0x2dde('0x54'):var _0x442349=shared[_0x2dde('0x72')];var _0x40e49f=_0x442349[_0x519b37];if(!_[_0x2dde('0x55')](_0x40e49f)){var _0x21a065=_0x40e49f[_0x2dde('0x56')];_0x31e92d['push']('\x22'+_0x519b37+'\x22');_0x31e92d['push']('\x22'+_0x21a065+'\x22');}break;default:_0x31e92d['push']('\x22'+_0x519b37+'\x22');}}else{switch(_0x1d3194){case _0x2dde('0x73'):case _0x2dde('0xd'):_0x24815f[_0x2dde('0x3f')](_0x1d3194+_0x2dde('0x74'));break;default:_0x31e92d[_0x2dde('0x3f')]('\x22\x22');}}}}if(_0x24815f['length']){handleError(_0x41ae7f[_0x2dde('0x64')][_0x225e7d],{'code':_0x2dde('0x75'),'message':_0x24815f[_0x2dde('0xf')]()});}else{fs[_0x2dde('0x76')](_0x3b06f3,_0x31e92d[_0x2dde('0xf')]()+'\x0a');}_0x31e92d=[];}if(!(stats[_0x2dde('0x65')]%0xc8)){socket['emit']('contact:import:'+_0xa43812,stats);stats['errors']=[];}}if(stopped){logger[_0x2dde('0x42')]('Abort\x20parser');_0x364169[_0x2dde('0x77')]();}}catch(_0x173331){handleError(_0x41ae7f[_0x2dde('0x64')][_0x225e7d],{'code':_0x2dde('0x78'),'message':_0x173331[_0x2dde('0x41')]});logger[_0x2dde('0x4e')](_0x2dde('0x79'),_0x173331[_0x2dde('0x41')]);}},'complete':function(){try{var _0x20c1fa=[];var _0x34eead=[];var _0x3ab7c8='cm_contacts';if(_0xc48b76[_0x2dde('0x7a')]&&_0xc48b76[_0x2dde('0x7a')]['length']){_0x3ab7c8=_0x2dde('0x7b')+_0xa43812;_0x20c1fa['push'](_0x2dde('0x7c')+_0x3ab7c8+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x2dde('0x7d')+_0xa43812;tmp_voice_queues=_0x2dde('0x7e')+_0xa43812;_0x34eead['push'](_0x2dde('0x7c')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x34eead[_0x2dde('0x3f')](_0x2dde('0x7c')+tmp_voice_queues+_0x2dde('0x7f'));BPromise[_0x2dde('0x80')](_0x34eead,handleTZQuery)[_0x2dde('0x4d')](function(_0x32e526){updateTzCampaigns(_0xc48b76['ListId'])[_0x2dde('0x4d')](function(_0x2cd0c8){updateTzVoiceQueues(_0xc48b76[_0x2dde('0x1a')])['then'](function(_0x34a9bd){var _0x2fff3f=util[_0x2dde('0xc')](_0x2dde('0x81'),_0x3b06f3,_0x3ab7c8,_0x331c48,_0xc48b76[_0x2dde('0x1a')],_0xc48b76[_0x2dde('0x38')]||null,NOW,NOW);if(_[_0x2dde('0x55')](_0x1ca74a[_0x2dde('0x34')])){_0x2fff3f+=_0x2dde('0x82');}_0x20c1fa[_0x2dde('0x3f')](_0x2fff3f);if(_0xc48b76[_0x2dde('0x7a')]&&_0xc48b76[_0x2dde('0x7a')][_0x2dde('0x4b')]){_0x20c1fa[_0x2dde('0x3f')](insertCmContact(_0xc48b76['ListId'],_0x3ab7c8,_0xc48b76[_0x2dde('0x7a')],_0x1ca74a));_0x20c1fa[_0x2dde('0x3f')](_0x2dde('0x83')+_0x3ab7c8+';');}if(hasTZ){_0x20c1fa['push'](insertTzCmHopper(_0xc48b76[_0x2dde('0x1a')],_0x2dde('0x51'),_0x2dde('0x84'),'VoiceQueueId',_0x38abf4,tmp_voice_queues));_0x20c1fa[_0x2dde('0x3f')](insertTzCmHopperBlack(_0xc48b76['ListId'],_0x2dde('0x85'),_0x2dde('0x84'),_0x2dde('0x86')));_0x20c1fa[_0x2dde('0x3f')](insertTzCmHopper(_0xc48b76[_0x2dde('0x1a')],_0x2dde('0x49'),'campaigns',_0x2dde('0x87'),_0x38abf4,tmp_campaigns));_0x20c1fa[_0x2dde('0x3f')](insertTzCmHopperBlack(_0xc48b76[_0x2dde('0x1a')],'campaigns_has_cm_blacklists',_0x2dde('0x88'),'CampaignId'));}else{_0x20c1fa[_0x2dde('0x3f')](insertCmHopper(_0xc48b76['ListId'],_0x2dde('0x51'),_0x2dde('0x84'),'VoiceQueueId',_0x38abf4));_0x20c1fa['push'](insertCmHopperBlack(_0xc48b76[_0x2dde('0x1a')],_0x2dde('0x85'),'voice_queues',_0x2dde('0x86')));_0x20c1fa['push'](insertCmHopper(_0xc48b76[_0x2dde('0x1a')],_0x2dde('0x49'),_0x2dde('0x88'),'CampaignId',_0x38abf4));_0x20c1fa[_0x2dde('0x3f')](insertCmHopperBlack(_0xc48b76['ListId'],_0x2dde('0x89'),_0x2dde('0x88'),_0x2dde('0x87')));}_0x20c1fa[_0x2dde('0x3f')](_0x2dde('0x83')+tmp_campaigns+';');_0x20c1fa[_0x2dde('0x3f')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0x2dde('0x80')](_0x20c1fa,handleQuery)[_0x2dde('0x4d')](function(_0x297d93){stats[_0x2dde('0x8a')]=!![];stats[_0x2dde('0x8b')]=_0xc48b76[_0x2dde('0x7a')]&&_0xc48b76[_0x2dde('0x7a')][_0x2dde('0x4b')]?results[0x2][_0x2dde('0x8b')]:results[0x0][_0x2dde('0x8b')];socket[_0x2dde('0x8c')](_0x2dde('0x8d')+_0xa43812,stats);fs[_0x2dde('0x8e')](_0x1f6b3d);fs[_0x2dde('0x8e')](_0x3b06f3);process['exit'](0x0);})[_0x2dde('0x46')](function(_0x2a3d68){logger[_0x2dde('0x4e')](_0x2a3d68[_0x2dde('0x41')]);process[_0x2dde('0x3e')](0x1);});});});});}catch(_0xd59859){logger['error'](_0x2dde('0x8f'),_0xd59859[_0x2dde('0x41')]);process[_0x2dde('0x3e')](0x1);}},'error':function(_0x2d0725,_0x1a6095,_0xaba672,_0x4f4704){throw new Error(_0x4f4704);}});}function validate(){if(process[_0x2dde('0x90')]&&process[_0x2dde('0x90')]['length']<0x4){throw new Error(_0x2dde('0x91'));}var _0x3f2896=path[_0x2dde('0xf')](config['root'],_0x2dde('0x5d'),process[_0x2dde('0x90')][0x2]);if(!fs[_0x2dde('0x92')](_0x3f2896)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x3c1268={};try{_0x3c1268=JSON[_0x2dde('0x62')](process[_0x2dde('0x90')][0x3]);if(!_0x3c1268['binding']){throw new Error(_0x2dde('0x93'));}if(!_0x3c1268[_0x2dde('0x5b')][_0x2dde('0xd')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x3c1268[_0x2dde('0x5b')][_0x2dde('0x73')]){throw new Error('firstName\x20is\x20mandatory');}var _0x52fb98=0x0;if(_0x3c1268[_0x2dde('0x5b')][_0x2dde('0x35')]){_0x52fb98=0x1;}if(!_0x3c1268[_0x2dde('0x1a')]){throw new Error(_0x2dde('0x94'));}}catch(_0x148045){throw new Error('body\x20id\x20mandatory');}var _0x226e22=[];try{_0x226e22=_[_0x2dde('0x95')](JSON[_0x2dde('0x62')](process['argv'][0x4]),'id');}catch(_0x52d52b){logger['info'](_0x2dde('0x96'));}main(_0x3f2896,_0x3c1268,_0x226e22,_0x52fb98);}validate();process['on'](_0x2dde('0x97'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index f42662b..708ba14 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 _0x4a9f=['answertime','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','voice','inbound','variable','push','outbound','destcalleridnum','toLowerCase','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','calleridname','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime'];(function(_0x198910,_0x1b5e73){var _0x3332f2=function(_0x5685b4){while(--_0x5685b4){_0x198910['push'](_0x198910['shift']());}};_0x3332f2(++_0x1b5e73);}(_0x4a9f,0x9f));var _0xf4a9=function(_0x1f6d51,_0x19033b){_0x1f6d51=_0x1f6d51-0x0;var _0x26bf63=_0x4a9f[_0x1f6d51];return _0x26bf63;};'use strict';exports[_0xf4a9('0x0')]=function(_0x9f775b,_0x158971){var _0x50432a=[{'type':_0xf4a9('0x1'),'content':_0xf4a9('0x2'),'variableName':null}];switch(_0x9f775b['toLowerCase']()){case _0xf4a9('0x3'):switch(_0x158971['toLowerCase']()){case _0xf4a9('0x4'):_0x50432a['push']({'type':_0xf4a9('0x5'),'content':'','variableName':'queue'});_0x50432a[_0xf4a9('0x6')]({'type':_0xf4a9('0x5'),'content':'','variableName':'calleridnum'});break;case _0xf4a9('0x7'):_0x50432a[_0xf4a9('0x6')]({'type':_0xf4a9('0x1'),'content':'Outbound\x20Call','variableName':null});_0x50432a[_0xf4a9('0x6')]({'type':_0xf4a9('0x5'),'content':'','variableName':_0xf4a9('0x8')});break;}}return _0x50432a;};exports['getDescriptions']=function(_0x1dc419,_0x4e0123){var _0x15f8bf=[];switch(_0x1dc419[_0xf4a9('0x9')]()){case _0xf4a9('0x3'):switch(_0x4e0123['toLowerCase']()){case'inbound':_0x15f8bf=[{'type':_0xf4a9('0x1'),'content':_0xf4a9('0xa'),'key':null,'keyType':null,'variableName':null},{'type':_0xf4a9('0xb'),'content':'','key':_0xf4a9('0xc'),'keyType':'variable','variableName':_0xf4a9('0xd')},{'type':_0xf4a9('0xb'),'content':'','key':'Caller\x20Name','keyType':_0xf4a9('0x5'),'variableName':_0xf4a9('0xe')},{'type':_0xf4a9('0xb'),'content':'','key':'Call\x20To','keyType':_0xf4a9('0x5'),'variableName':_0xf4a9('0xf')},{'type':_0xf4a9('0xb'),'content':'','key':_0xf4a9('0x10'),'keyType':_0xf4a9('0x5'),'variableName':_0xf4a9('0x11')},{'type':_0xf4a9('0xb'),'content':'','key':_0xf4a9('0x12'),'keyType':_0xf4a9('0x5'),'variableName':_0xf4a9('0x13')},{'type':_0xf4a9('0xb'),'content':'','key':_0xf4a9('0x14'),'keyType':_0xf4a9('0x5'),'variableName':_0xf4a9('0x15')},{'type':_0xf4a9('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xf4a9('0xb'),'content':'','key':_0xf4a9('0x16'),'keyType':_0xf4a9('0x5'),'variableName':_0xf4a9('0x17')},{'type':_0xf4a9('0xb'),'content':'','key':_0xf4a9('0x18'),'keyType':'variable','variableName':'destcalleridnum'},{'type':'string','content':_0xf4a9('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xf4a9('0xb'),'content':'','key':'Agent\x20Ring','keyType':_0xf4a9('0x5'),'variableName':_0xf4a9('0x15')},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':_0xf4a9('0x5'),'variableName':'agentconnectAt'},{'type':'keyValue','content':'','key':_0xf4a9('0x1a'),'keyType':_0xf4a9('0x5'),'variableName':_0xf4a9('0x1b')},{'type':'keyValue','content':'','key':_0xf4a9('0x1c'),'keyType':_0xf4a9('0x5'),'variableName':_0xf4a9('0x1d')},{'type':_0xf4a9('0xb'),'content':'','key':_0xf4a9('0x1e'),'keyType':_0xf4a9('0x5'),'variableName':_0xf4a9('0x1f')}];break;case _0xf4a9('0x7'):_0x15f8bf=[{'type':_0xf4a9('0x1'),'content':_0xf4a9('0xa'),'variableName':null},{'type':_0xf4a9('0xb'),'content':'','key':_0xf4a9('0x20'),'keyType':_0xf4a9('0x5'),'keyContent':'','variableName':_0xf4a9('0x8')},{'type':_0xf4a9('0xb'),'content':'','key':_0xf4a9('0x21'),'keyType':_0xf4a9('0x5'),'keyContent':'','variableName':_0xf4a9('0x22')},{'type':_0xf4a9('0xb'),'content':'','key':'UniqueId','keyType':_0xf4a9('0x5'),'keyContent':'','variableName':'uniqueid'},{'type':_0xf4a9('0xb'),'content':'','key':_0xf4a9('0x14'),'keyType':_0xf4a9('0x5'),'keyContent':'','variableName':_0xf4a9('0x23')},{'type':_0xf4a9('0x1'),'content':_0xf4a9('0x19')},{'type':_0xf4a9('0xb'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0xf4a9('0x24')},{'type':_0xf4a9('0xb'),'content':'','key':'Complete\x20Time','keyType':'variable','keyContent':'','variableName':'endtime'},{'type':_0xf4a9('0xb'),'content':'','key':'Duration','keyType':_0xf4a9('0x5'),'keyContent':'','variableName':_0xf4a9('0x25')},{'type':_0xf4a9('0xb'),'content':'','key':_0xf4a9('0x26'),'keyType':_0xf4a9('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x15f8bf;}; \ No newline at end of file +var _0x1f7d=['holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','Answer\x20Time','Complete\x20Time','endtime','Duration','billableseconds','string','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','Caller\x20Number','Caller\x20Name','calleridname','keyValue','Call\x20To','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time'];(function(_0x21bfe4,_0x20ffba){var _0x5bef31=function(_0x3683fb){while(--_0x3683fb){_0x21bfe4['push'](_0x21bfe4['shift']());}};_0x5bef31(++_0x20ffba);}(_0x1f7d,0xfb));var _0xd1f7=function(_0x34dc74,_0x287ffe){_0x34dc74=_0x34dc74-0x0;var _0x2d6e47=_0x1f7d[_0x34dc74];return _0x2d6e47;};'use strict';exports['getSubjects']=function(_0x558c32,_0x18cd3d){var _0x411537=[{'type':_0xd1f7('0x0'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x558c32[_0xd1f7('0x1')]()){case _0xd1f7('0x2'):switch(_0x18cd3d[_0xd1f7('0x1')]()){case _0xd1f7('0x3'):_0x411537[_0xd1f7('0x4')]({'type':_0xd1f7('0x5'),'content':'','variableName':_0xd1f7('0x6')});_0x411537['push']({'type':_0xd1f7('0x5'),'content':'','variableName':_0xd1f7('0x7')});break;case _0xd1f7('0x8'):_0x411537[_0xd1f7('0x4')]({'type':'string','content':_0xd1f7('0x9'),'variableName':null});_0x411537[_0xd1f7('0x4')]({'type':_0xd1f7('0x5'),'content':'','variableName':_0xd1f7('0xa')});break;}}return _0x411537;};exports['getDescriptions']=function(_0x1941d7,_0x49d696){var _0x5a8376=[];switch(_0x1941d7[_0xd1f7('0x1')]()){case _0xd1f7('0x2'):switch(_0x49d696[_0xd1f7('0x1')]()){case _0xd1f7('0x3'):_0x5a8376=[{'type':_0xd1f7('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xd1f7('0xb'),'keyType':_0xd1f7('0x5'),'variableName':_0xd1f7('0x7')},{'type':'keyValue','content':'','key':_0xd1f7('0xc'),'keyType':'variable','variableName':_0xd1f7('0xd')},{'type':_0xd1f7('0xe'),'content':'','key':_0xd1f7('0xf'),'keyType':'variable','variableName':'destexten'},{'type':_0xd1f7('0xe'),'content':'','key':'Queue','keyType':'variable','variableName':_0xd1f7('0x6')},{'type':_0xd1f7('0xe'),'content':'','key':_0xd1f7('0x10'),'keyType':_0xd1f7('0x5'),'variableName':_0xd1f7('0x11')},{'type':_0xd1f7('0xe'),'content':'','key':_0xd1f7('0x12'),'keyType':_0xd1f7('0x5'),'variableName':_0xd1f7('0x13')},{'type':_0xd1f7('0x0'),'content':_0xd1f7('0x14'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0xd1f7('0x5'),'variableName':_0xd1f7('0x15')},{'type':'keyValue','content':'','key':_0xd1f7('0x16'),'keyType':_0xd1f7('0x5'),'variableName':_0xd1f7('0xa')},{'type':_0xd1f7('0x0'),'content':_0xd1f7('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xd1f7('0xe'),'content':'','key':_0xd1f7('0x18'),'keyType':_0xd1f7('0x5'),'variableName':'agentcalledAt'},{'type':_0xd1f7('0xe'),'content':'','key':_0xd1f7('0x19'),'keyType':_0xd1f7('0x5'),'variableName':_0xd1f7('0x1a')},{'type':_0xd1f7('0xe'),'content':'','key':'Agent\x20Complete','keyType':_0xd1f7('0x5'),'variableName':_0xd1f7('0x1b')},{'type':_0xd1f7('0xe'),'content':'','key':_0xd1f7('0x1c'),'keyType':_0xd1f7('0x5'),'variableName':_0xd1f7('0x1d')},{'type':'keyValue','content':'','key':_0xd1f7('0x1e'),'keyType':_0xd1f7('0x5'),'variableName':_0xd1f7('0x1f')}];break;case _0xd1f7('0x8'):_0x5a8376=[{'type':'string','content':_0xd1f7('0x20'),'variableName':null},{'type':_0xd1f7('0xe'),'content':'','key':_0xd1f7('0x21'),'keyType':_0xd1f7('0x5'),'keyContent':'','variableName':_0xd1f7('0xa')},{'type':'keyValue','content':'','key':_0xd1f7('0x22'),'keyType':_0xd1f7('0x5'),'keyContent':'','variableName':'membername'},{'type':_0xd1f7('0xe'),'content':'','key':_0xd1f7('0x10'),'keyType':_0xd1f7('0x5'),'keyContent':'','variableName':_0xd1f7('0x11')},{'type':_0xd1f7('0xe'),'content':'','key':_0xd1f7('0x12'),'keyType':_0xd1f7('0x5'),'keyContent':'','variableName':'starttime'},{'type':_0xd1f7('0x0'),'content':_0xd1f7('0x17')},{'type':_0xd1f7('0xe'),'content':'','key':_0xd1f7('0x23'),'keyType':_0xd1f7('0x5'),'keyContent':'','variableName':'answertime'},{'type':_0xd1f7('0xe'),'content':'','key':_0xd1f7('0x24'),'keyType':'variable','keyContent':'','variableName':_0xd1f7('0x25')},{'type':_0xd1f7('0xe'),'content':'','key':_0xd1f7('0x26'),'keyType':_0xd1f7('0x5'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':_0xd1f7('0x5'),'keyContent':'','variableName':_0xd1f7('0x27')}];break;}}return _0x5a8376;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 1df1d00..33cdf8e 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 _0x8a19=['omit','body','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','chat-interactions','InteractionId','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','update','error','tracked','user','clone'];(function(_0x1fddc0,_0x3c2ac6){var _0x40dee0=function(_0x70813){while(--_0x70813){_0x1fddc0['push'](_0x1fddc0['shift']());}};_0x40dee0(++_0x3c2ac6);}(_0x8a19,0x1b6));var _0x98a1=function(_0x3e49f9,_0x38ebb2){_0x3e49f9=_0x3e49f9-0x0;var _0x47c64c=_0x8a19[_0x3e49f9];return _0x47c64c;};'use strict';var _=require(_0x98a1('0x0'));var db=require(_0x98a1('0x1'))['db'];var loggers={'openchannel':require(_0x98a1('0x2'))(_0x98a1('0x3')),'mail':require(_0x98a1('0x2'))('mail-interactions'),'fax':require(_0x98a1('0x2'))('fax-interactions'),'sms':require(_0x98a1('0x2'))('sms-interactions'),'chat':require(_0x98a1('0x2'))(_0x98a1('0x4')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0x188466,_0x444e69,_0x40bd72){if(_0x188466&&_0x188466[_['upperFirst'](_0x40bd72)+_0x98a1('0x5')]){return _0x188466[_[_0x98a1('0x6')](_0x40bd72)+'InteractionId'];}else if(_0x188466&&_0x188466['id']){return _0x188466['id'];}else if(_0x444e69&&_0x444e69['id']){return _0x444e69['id'];}else{return _0x98a1('0x7');}}function log(_0x1b2412,_0x4fd6bb,_0x4f86b6,_0x3cf140,_0x3845b7,_0x537d4a){loggers[_0x3845b7[_0x98a1('0x8')]()][_0x1b2412](_0x98a1('0x9'),_0x537d4a[_0x98a1('0xa')](),_0x4fd6bb?_0x4fd6bb['id']:null,_0x4fd6bb?_0x4fd6bb[_0x98a1('0xb')]:null,_0x4fd6bb?_0x4fd6bb[_0x98a1('0xc')]:null,getInteractionId(_0x4f86b6,_0x3cf140,_0x3845b7),_0x4f86b6?JSON[_0x98a1('0xd')](_0x4f86b6):_0x98a1('0xe'));}function updateUser(_0x5459e3,_0x2c1747,_0x3ea022,_0x54d378,_0x34f973){db[_['upperFirst'](_0x54d378)+_0x98a1('0xf')]['findOne']({'where':{'id':getInteractionId(_0x2c1747,_0x3ea022,_0x54d378)}})['then'](function(_0xa698ec){if(_0xa698ec){return _0xa698ec[_0x98a1('0x10')]({'UserId':_0x5459e3?_0x5459e3['id']:null});}})['then'](function(_0x3def61){if(_0x3def61){log('info',_0x5459e3,_0x2c1747,_0x3ea022,_0x54d378,_0x34f973);}})['catch'](function(){log(_0x98a1('0x11'),_0x5459e3,_0x2c1747,_0x3ea022,_0x54d378,_0x34f973);});}exports[_0x98a1('0x12')]=function(_0xa3cb1c,_0x29e4ce){return function(_0x45fda9,_0x48ffa6,_0x4ff40c){var _0xcec9e7=_0x45fda9[_0x98a1('0x13')];var _0x457a3f={};var _0x236169=_0x45fda9['query'];if(_0x457a3f){_0x457a3f=_[_0x98a1('0x14')](_0x45fda9['body']);_0x457a3f=_[_0x98a1('0x15')](_0x457a3f,[_0x98a1('0x16'),_0x98a1('0x17'),_0x98a1('0x18'),_0x98a1('0x19'),_0x98a1('0x1a')]);}updateUser(_0xcec9e7,_0x457a3f,_0x236169,_0xa3cb1c,_0x29e4ce);_0x4ff40c(null);};}; \ No newline at end of file +var _0x9c83=['null','Interaction','findOne','then','update','catch','error','query','clone','body','omit','html','phone','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-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'];(function(_0x58e318,_0x5427bf){var _0x10e8b7=function(_0x150d59){while(--_0x150d59){_0x58e318['push'](_0x58e318['shift']());}};_0x10e8b7(++_0x5427bf);}(_0x9c83,0x8e));var _0x39c8=function(_0x3d953b,_0x2be7f4){_0x3d953b=_0x3d953b-0x0;var _0x34af9a=_0x9c83[_0x3d953b];return _0x34af9a;};'use strict';var _=require(_0x39c8('0x0'));var db=require(_0x39c8('0x1'))['db'];var loggers={'openchannel':require(_0x39c8('0x2'))(_0x39c8('0x3')),'mail':require(_0x39c8('0x2'))(_0x39c8('0x4')),'fax':require(_0x39c8('0x2'))(_0x39c8('0x5')),'sms':require('../../config/logger')(_0x39c8('0x6')),'chat':require(_0x39c8('0x2'))(_0x39c8('0x7')),'whatsapp':require(_0x39c8('0x2'))(_0x39c8('0x8'))};function getInteractionId(_0x5a5056,_0x5b6b3c,_0xa57b8f){if(_0x5a5056&&_0x5a5056[_[_0x39c8('0x9')](_0xa57b8f)+_0x39c8('0xa')]){return _0x5a5056[_[_0x39c8('0x9')](_0xa57b8f)+_0x39c8('0xa')];}else if(_0x5a5056&&_0x5a5056['id']){return _0x5a5056['id'];}else if(_0x5b6b3c&&_0x5b6b3c['id']){return _0x5b6b3c['id'];}else{return _0x39c8('0xb');}}function log(_0x2499f6,_0x31e1d5,_0x2d94f0,_0x457a6e,_0x16e299,_0x373a92){loggers[_0x16e299[_0x39c8('0xc')]()][_0x2499f6](_0x39c8('0xd'),_0x373a92[_0x39c8('0xe')](),_0x31e1d5?_0x31e1d5['id']:null,_0x31e1d5?_0x31e1d5[_0x39c8('0xf')]:null,_0x31e1d5?_0x31e1d5[_0x39c8('0x10')]:null,getInteractionId(_0x2d94f0,_0x457a6e,_0x16e299),_0x2d94f0?JSON[_0x39c8('0x11')](_0x2d94f0):_0x39c8('0x12'));}function updateUser(_0x502a88,_0x274115,_0x2810d2,_0x4704ec,_0x363b88){db[_[_0x39c8('0x9')](_0x4704ec)+_0x39c8('0x13')][_0x39c8('0x14')]({'where':{'id':getInteractionId(_0x274115,_0x2810d2,_0x4704ec)}})[_0x39c8('0x15')](function(_0x20e46f){if(_0x20e46f){return _0x20e46f[_0x39c8('0x16')]({'UserId':_0x502a88?_0x502a88['id']:null});}})[_0x39c8('0x15')](function(_0x377e5c){if(_0x377e5c){log('info',_0x502a88,_0x274115,_0x2810d2,_0x4704ec,_0x363b88);}})[_0x39c8('0x17')](function(){log(_0x39c8('0x18'),_0x502a88,_0x274115,_0x2810d2,_0x4704ec,_0x363b88);});}exports['tracked']=function(_0x2fe831,_0x5b2fce){return function(_0x48ec7f,_0x585785,_0x376d91){var _0x224154=_0x48ec7f['user'];var _0x49704e={};var _0x507de7=_0x48ec7f[_0x39c8('0x19')];if(_0x49704e){_0x49704e=_[_0x39c8('0x1a')](_0x48ec7f[_0x39c8('0x1b')]);_0x49704e=_[_0x39c8('0x1c')](_0x49704e,[_0x39c8('0x1b'),_0x39c8('0x1d'),_0x39c8('0x1e'),'fax',_0x39c8('0x1f')]);}updateUser(_0x224154,_0x49704e,_0x507de7,_0x2fe831,_0x5b2fce);_0x376d91(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 9c6196a..34e3349 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 _0xffeb=['License','then','count','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','data1','split','%s:%s:%s','update','utf8','final','hasOwnProperty','use'];(function(_0x525ef9,_0x12b1c2){var _0x5561fb=function(_0xa8ed46){while(--_0xa8ed46){_0x525ef9['push'](_0x525ef9['shift']());}};_0x5561fb(++_0x12b1c2);}(_0xffeb,0x12a));var _0xbffe=function(_0x241b5a,_0x5ac06c){_0x241b5a=_0x241b5a-0x0;var _0x49fff8=_0xffeb[_0x241b5a];return _0x49fff8;};'use strict';var crypto=require(_0xbffe('0x0'));var util=require(_0xbffe('0x1'));var compose=require(_0xbffe('0x2'));var db=require(_0xbffe('0x3'))['db'];var config=require(_0xbffe('0x4'));function getValueFromLicense(_0x5ceaa7,_0x4fd979){if(_0x5ceaa7&&_0x4fd979){if(_0x4fd979['data1']&&_0x4fd979[_0xbffe('0x5')]){var _0x35183b=_0x4fd979[_0xbffe('0x6')];var _0x35bbcf=_0x4fd979[_0xbffe('0x5')];var _0x1d227c=_0x35183b[_0xbffe('0x7')]('-')[0x4];var _0x39c2b7=_0x35183b[_0xbffe('0x7')]('-')[0x0];var _0x59951d=crypto['createDecipher']('aes-256-ctr',util['format'](_0xbffe('0x8'),_0x1d227c,_0x35183b,_0x39c2b7));var _0xca7e7b=_0x59951d[_0xbffe('0x9')](_0x35bbcf,'base64',_0xbffe('0xa'));_0xca7e7b+=_0x59951d[_0xbffe('0xb')]('utf8');var _0x1e5cb4=JSON['parse'](_0xca7e7b);return _0x1e5cb4[_0xbffe('0xc')](_0x5ceaa7)?_0x1e5cb4[_0x5ceaa7]:null;}}return null;}function isLimit(_0x3f1bb4,_0x18e97e,_0x3c2b18,_0x22932e){var _0x4a435e=_0x18e97e;return compose()[_0xbffe('0xd')](function(_0x543160,_0x1bb976,_0x4ab063){return db[_0xbffe('0xe')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x58a89f){var _0x574e16=getValueFromLicense(_0x3f1bb4,_0x58a89f);return _0x574e16?_0x574e16:_0x4a435e;})[_0xbffe('0xf')](function(_0x31b030){_0x4a435e=_0x31b030;return _0x3c2b18[_0xbffe('0x10')](_0x22932e);})[_0xbffe('0xf')](function(_0x1f2e33){if(_0x1f2e33>=_0x4a435e){return _0x1bb976['status'](0x193)[_0xbffe('0x11')]({'message':util[_0xbffe('0x12')](_0xbffe('0x13'),_0x3f1bb4)});}_0x4ab063();})[_0xbffe('0x14')](function(_0x401f9f){_0x4ab063(_0x401f9f);});});}function isUserLimit(){return isLimit(_0xbffe('0x15'),0x1,db['User'],{'where':{'$or':[{'role':_0xbffe('0x16')},{'role':'user'}]}});}exports[_0xbffe('0x17')]=isUserLimit; \ No newline at end of file +var _0x3905=['%s:%s:%s','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','user','isUserLimit','crypto','../../config/environment','data1','split','createDecipher','aes-256-ctr','format'];(function(_0x8fa74f,_0x520489){var _0x522ffc=function(_0xb84e93){while(--_0xb84e93){_0x8fa74f['push'](_0x8fa74f['shift']());}};_0x522ffc(++_0x520489);}(_0x3905,0x1a9));var _0x5390=function(_0x5cabac,_0x5ccb08){_0x5cabac=_0x5cabac-0x0;var _0x5f47b8=_0x3905[_0x5cabac];return _0x5f47b8;};'use strict';var crypto=require(_0x5390('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0x5390('0x1'));function getValueFromLicense(_0x3a53c4,_0x555ef0){if(_0x3a53c4&&_0x555ef0){if(_0x555ef0[_0x5390('0x2')]&&_0x555ef0['license']){var _0x5cbf65=_0x555ef0[_0x5390('0x2')];var _0x19bf94=_0x555ef0['license'];var _0x4ba5e0=_0x5cbf65[_0x5390('0x3')]('-')[0x4];var _0x3ad025=_0x5cbf65[_0x5390('0x3')]('-')[0x0];var _0x5d317a=crypto[_0x5390('0x4')](_0x5390('0x5'),util[_0x5390('0x6')](_0x5390('0x7'),_0x4ba5e0,_0x5cbf65,_0x3ad025));var _0x438e28=_0x5d317a['update'](_0x19bf94,'base64',_0x5390('0x8'));_0x438e28+=_0x5d317a[_0x5390('0x9')](_0x5390('0x8'));var _0x4d9678=JSON[_0x5390('0xa')](_0x438e28);return _0x4d9678[_0x5390('0xb')](_0x3a53c4)?_0x4d9678[_0x3a53c4]:null;}}return null;}function isLimit(_0x558d3f,_0x259bdb,_0x261868,_0x5c38a6){var _0x156432=_0x259bdb;return compose()[_0x5390('0xc')](function(_0xb0c3e8,_0x1302b4,_0xcb0dbb){return db[_0x5390('0xd')][_0x5390('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x5390('0xf')](function(_0x41e4d8){var _0x571009=getValueFromLicense(_0x558d3f,_0x41e4d8);return _0x571009?_0x571009:_0x156432;})['then'](function(_0xbbf0b5){_0x156432=_0xbbf0b5;return _0x261868[_0x5390('0x10')](_0x5c38a6);})[_0x5390('0xf')](function(_0x3bb8bf){if(_0x3bb8bf>=_0x156432){return _0x1302b4[_0x5390('0x11')](0x193)[_0x5390('0x12')]({'message':util[_0x5390('0x6')](_0x5390('0x13'),_0x558d3f)});}_0xcb0dbb();})[_0x5390('0x14')](function(_0x38f140){_0xcb0dbb(_0x38f140);});});}function isUserLimit(){return isLimit(_0x5390('0x15'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x5390('0x16')}]}});}exports[_0x5390('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 728fe70..2f8d347 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 _0x882c=['DATE','operator','$between','value','includes','$lte','add','days','format','YYYY-MM-DD','castTo','field','\x20AS\x20','$ne','$notIn','text','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$eq','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','$gt','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','shift','utcOffset','hours','minutes','seconds','lodash','parseSearch','[$or]','and','replace','split','slice','forEach','match','filter','indexOf','map','conditions','buildExpression'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x882c,0x130));var _0xc882=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0x882c[_0x3acee8];return _0x5046cc;};'use strict';var _=require(_0xc882('0x0'));var moment=require('moment');exports[_0xc882('0x1')]=function(_0x1707e1){var _0x25a62f={'conditions':[]};_0x25a62f['sqlOperator']=_['startsWith'](_0x1707e1,_0xc882('0x2'))?'or':_0xc882('0x3');var _0x3dc527=_0x1707e1[_0xc882('0x4')]('[$and]','')[_0xc882('0x4')](_0xc882('0x2'),'')[_0xc882('0x5')]('||');for(var _0x578d77=0x0;_0x578d77<_0x3dc527['length'];_0x578d77++){var _0x564a06=_0x3dc527[_0x578d77][_0xc882('0x5')](':=');var _0x3f9227=_0x564a06[0x0];var _0x2a2bd4=_0x564a06[_0xc882('0x6')](0x1);_0x2a2bd4[_0xc882('0x7')](function(_0x5805e8){var _0x141474=_0x5805e8[_0xc882('0x5')]('[')['shift']();var _0x3e30d0=_0x5805e8[_0xc882('0x8')](/\[(.*?)\]/g);_0x3e30d0['forEach'](function(_0x213427){var _0x51e072=_0x213427['split']('[')[_0xc882('0x9')](function(_0x36b989){return _0x36b989[_0xc882('0xa')](']')>-0x1;})[_0xc882('0xb')](function(_0x3644f1){return _0x3644f1[_0xc882('0x5')](']')[0x0];})[0x0];_0x25a62f[_0xc882('0xc')]['push']({'field':_0x3f9227,'operator':_0x141474,'value':_0x51e072});});});}return _0x25a62f;};exports[_0xc882('0xd')]=function(_0x252bae,_0x10cf67,_0x4263db){var _0x16e41f={};if(_0x10cf67===_0xc882('0xe')){if(_0x4263db[_0xc882('0xf')]==='$eq'){_0x4263db[_0xc882('0xf')]=_0xc882('0x10');_0x4263db['value']+=','+_0x4263db[_0xc882('0x11')];}else if(_[_0xc882('0x12')](['$gt',_0xc882('0x13')],_0x4263db[_0xc882('0xf')])){_0x4263db['value']=moment(_0x4263db[_0xc882('0x11')])[_0xc882('0x14')](0x1,_0xc882('0x15'))[_0xc882('0x16')](_0xc882('0x17'));}}if(_0x4263db[_0xc882('0x18')]){_0x10cf67=_0x4263db[_0xc882('0x18')];_0x16e41f['text']='CAST('+_0x252bae+'.'+_0x4263db[_0xc882('0x19')]+_0xc882('0x1a')+_0x4263db[_0xc882('0x18')]+')\x20'+parseOperator(_0x4263db[_0xc882('0xf')]);}else{_0x16e41f['text']=_0x252bae+'.'+_0x4263db[_0xc882('0x19')]+'\x20'+parseOperator(_0x4263db[_0xc882('0xf')]);}if(_['includes']([_0xc882('0x1b'),_0xc882('0x1c')],_0x4263db[_0xc882('0xf')]))_0x16e41f[_0xc882('0x1d')]='('+_0x16e41f[_0xc882('0x1d')]+_0xc882('0x1e')+_0x252bae+'.'+_0x4263db[_0xc882('0x19')]+_0xc882('0x1f');_0x16e41f[_0xc882('0x11')]=parseValue(_0x10cf67,_0x4263db[_0xc882('0xf')],_0x4263db['value']);return _0x16e41f;};function parseOperator(_0x5e5297){var _0x4d9a31;switch(_0x5e5297){case _0xc882('0x20'):_0x4d9a31=_0xc882('0x21');break;case _0xc882('0x1c'):_0x4d9a31='NOT\x20IN\x20?';break;case _0xc882('0x22'):_0x4d9a31='=\x20?';break;case _0xc882('0x1b'):_0x4d9a31=_0xc882('0x23');break;case _0xc882('0x24'):case _0xc882('0x25'):case _0xc882('0x26'):_0x4d9a31=_0xc882('0x27');break;case _0xc882('0x28'):_0x4d9a31='<\x20?';break;case _0xc882('0x29'):_0x4d9a31=_0xc882('0x2a');break;case _0xc882('0x13'):_0x4d9a31=_0xc882('0x2b');break;case _0xc882('0x2c'):_0x4d9a31=_0xc882('0x2d');break;case'$between':_0x4d9a31=_0xc882('0x2e');break;}return _0x4d9a31;}function parseValue(_0x4e0acb,_0x555d4a,_0x23ccc2){var _0x320ae4={'start':undefined,'end':undefined};switch(_0x555d4a){case _0xc882('0x20'):case _0xc882('0x1c'):_0x320ae4[_0xc882('0x2f')]=_0x23ccc2[_0xc882('0x5')](',');break;case'$substring':_0x320ae4[_0xc882('0x2f')]='%'+_0x23ccc2+'%';break;case _0xc882('0x25'):_0x320ae4['start']=_0x23ccc2+'%';break;case _0xc882('0x26'):_0x320ae4[_0xc882('0x2f')]='%'+_0x23ccc2;break;case'$between':var _0x177275=_0x23ccc2['split'](',');var _0x23ccc2=_0x177275[_0xc882('0x30')]();var _0x59eb14=_0x177275['pop']();if(_0x4e0acb===_0xc882('0xe')){_0x23ccc2=moment(_0x23ccc2)['utcOffset'](0x0,!![])[_0xc882('0x16')]();_0x59eb14=moment(_0x59eb14)[_0xc882('0x31')](0x0,!![])['add'](0x17,_0xc882('0x32'))['add'](0x3b,_0xc882('0x33'))['add'](0x3b,_0xc882('0x34'))[_0xc882('0x16')]();}_0x320ae4={'start':_0x23ccc2,'end':_0x59eb14};break;default:_0x320ae4[_0xc882('0x2f')]=_0x23ccc2;break;}return _0x320ae4;} \ No newline at end of file +var _0xdd27=['\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$eq','=\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','>=\x20?','$between','$notIn','start','$startsWith','pop','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','and','replace','[$and]','length','split','slice','forEach','shift','match','indexOf','buildExpression','DATE','operator','value','includes','$lte','add','days','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','$ne'];(function(_0xadd855,_0x313dd0){var _0x16a09f=function(_0x29693f){while(--_0x29693f){_0xadd855['push'](_0xadd855['shift']());}};_0x16a09f(++_0x313dd0);}(_0xdd27,0x155));var _0x7dd2=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0xdd27[_0x3f88bc];return _0x4df1c4;};'use strict';var _=require(_0x7dd2('0x0'));var moment=require(_0x7dd2('0x1'));exports[_0x7dd2('0x2')]=function(_0x4a02e6){var _0x141807={'conditions':[]};_0x141807[_0x7dd2('0x3')]=_['startsWith'](_0x4a02e6,_0x7dd2('0x4'))?'or':_0x7dd2('0x5');var _0x2fdb99=_0x4a02e6[_0x7dd2('0x6')](_0x7dd2('0x7'),'')[_0x7dd2('0x6')](_0x7dd2('0x4'),'')['split']('||');for(var _0x4d0bf5=0x0;_0x4d0bf5<_0x2fdb99[_0x7dd2('0x8')];_0x4d0bf5++){var _0x5482d3=_0x2fdb99[_0x4d0bf5][_0x7dd2('0x9')](':=');var _0x563982=_0x5482d3[0x0];var _0x48b121=_0x5482d3[_0x7dd2('0xa')](0x1);_0x48b121[_0x7dd2('0xb')](function(_0x5301c0){var _0x3dae14=_0x5301c0[_0x7dd2('0x9')]('[')[_0x7dd2('0xc')]();var _0x2565d1=_0x5301c0[_0x7dd2('0xd')](/\[(.*?)\]/g);_0x2565d1[_0x7dd2('0xb')](function(_0x3dbee0){var _0x3d27ce=_0x3dbee0[_0x7dd2('0x9')]('[')['filter'](function(_0x1a0fda){return _0x1a0fda[_0x7dd2('0xe')](']')>-0x1;})['map'](function(_0x2bb057){return _0x2bb057['split'](']')[0x0];})[0x0];_0x141807['conditions']['push']({'field':_0x563982,'operator':_0x3dae14,'value':_0x3d27ce});});});}return _0x141807;};exports[_0x7dd2('0xf')]=function(_0x23e4b3,_0x124dee,_0x5b96fa){var _0x25c63c={};if(_0x124dee===_0x7dd2('0x10')){if(_0x5b96fa[_0x7dd2('0x11')]==='$eq'){_0x5b96fa[_0x7dd2('0x11')]='$between';_0x5b96fa['value']+=','+_0x5b96fa[_0x7dd2('0x12')];}else if(_[_0x7dd2('0x13')](['$gt',_0x7dd2('0x14')],_0x5b96fa[_0x7dd2('0x11')])){_0x5b96fa[_0x7dd2('0x12')]=moment(_0x5b96fa[_0x7dd2('0x12')])[_0x7dd2('0x15')](0x1,_0x7dd2('0x16'))[_0x7dd2('0x17')](_0x7dd2('0x18'));}}if(_0x5b96fa[_0x7dd2('0x19')]){_0x124dee=_0x5b96fa[_0x7dd2('0x19')];_0x25c63c[_0x7dd2('0x1a')]='CAST('+_0x23e4b3+'.'+_0x5b96fa[_0x7dd2('0x1b')]+_0x7dd2('0x1c')+_0x5b96fa['castTo']+')\x20'+parseOperator(_0x5b96fa[_0x7dd2('0x11')]);}else{_0x25c63c['text']=_0x23e4b3+'.'+_0x5b96fa['field']+'\x20'+parseOperator(_0x5b96fa[_0x7dd2('0x11')]);}if(_[_0x7dd2('0x13')]([_0x7dd2('0x1d'),'$notIn'],_0x5b96fa[_0x7dd2('0x11')]))_0x25c63c['text']='('+_0x25c63c[_0x7dd2('0x1a')]+_0x7dd2('0x1e')+_0x23e4b3+'.'+_0x5b96fa[_0x7dd2('0x1b')]+_0x7dd2('0x1f');_0x25c63c[_0x7dd2('0x12')]=parseValue(_0x124dee,_0x5b96fa[_0x7dd2('0x11')],_0x5b96fa[_0x7dd2('0x12')]);return _0x25c63c;};function parseOperator(_0x2e1203){var _0x5ecbdb;switch(_0x2e1203){case _0x7dd2('0x20'):_0x5ecbdb=_0x7dd2('0x21');break;case'$notIn':_0x5ecbdb='NOT\x20IN\x20?';break;case _0x7dd2('0x22'):_0x5ecbdb=_0x7dd2('0x23');break;case'$ne':_0x5ecbdb='<>\x20?';break;case _0x7dd2('0x24'):case'$startsWith':case _0x7dd2('0x25'):_0x5ecbdb=_0x7dd2('0x26');break;case _0x7dd2('0x27'):_0x5ecbdb=_0x7dd2('0x28');break;case _0x7dd2('0x29'):_0x5ecbdb=_0x7dd2('0x2a');break;case _0x7dd2('0x14'):_0x5ecbdb=_0x7dd2('0x2b');break;case'$gte':_0x5ecbdb=_0x7dd2('0x2c');break;case _0x7dd2('0x2d'):_0x5ecbdb='BETWEEN\x20?\x20AND\x20?';break;}return _0x5ecbdb;}function parseValue(_0x204566,_0x3600bd,_0xee8239){var _0x24846a={'start':undefined,'end':undefined};switch(_0x3600bd){case _0x7dd2('0x20'):case _0x7dd2('0x2e'):_0x24846a[_0x7dd2('0x2f')]=_0xee8239[_0x7dd2('0x9')](',');break;case'$substring':_0x24846a[_0x7dd2('0x2f')]='%'+_0xee8239+'%';break;case _0x7dd2('0x30'):_0x24846a[_0x7dd2('0x2f')]=_0xee8239+'%';break;case _0x7dd2('0x25'):_0x24846a[_0x7dd2('0x2f')]='%'+_0xee8239;break;case _0x7dd2('0x2d'):var _0x269ce5=_0xee8239[_0x7dd2('0x9')](',');var _0xee8239=_0x269ce5[_0x7dd2('0xc')]();var _0x49ebd6=_0x269ce5[_0x7dd2('0x31')]();if(_0x204566==='DATE'){_0xee8239=moment(_0xee8239)['utcOffset'](0x0,!![])[_0x7dd2('0x17')]();_0x49ebd6=moment(_0x49ebd6)['utcOffset'](0x0,!![])[_0x7dd2('0x15')](0x17,_0x7dd2('0x32'))[_0x7dd2('0x15')](0x3b,_0x7dd2('0x33'))[_0x7dd2('0x15')](0x3b,_0x7dd2('0x34'))[_0x7dd2('0x17')]();}_0x24846a={'start':_0xee8239,'end':_0x49ebd6};break;default:_0x24846a[_0x7dd2('0x2f')]=_0xee8239;break;}return _0x24846a;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index d91131a..98154db 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 _0x5334=['value','merge','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','getOptions','query','$id','model','intersection','attributes','nolimit','limit','offset','order','where','pick','filter','object','columns'];(function(_0x2ad8fa,_0x43bbd0){var _0x51e2d5=function(_0x3504fc){while(--_0x3504fc){_0x2ad8fa['push'](_0x2ad8fa['shift']());}};_0x51e2d5(++_0x43bbd0);}(_0x5334,0x84));var _0x4533=function(_0x5944f3,_0x36a7fb){_0x5944f3=_0x5944f3-0x0;var _0x2a3bd4=_0x5334[_0x5944f3];return _0x2a3bd4;};'use strict';var _=require(_0x4533('0x0'));var sequelize=require(_0x4533('0x1'));var moment=require(_0x4533('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x35fb80){var _0x39af56=['ne'];try{var _0x52b768=JSON[_0x4533('0x3')](_0x35fb80);var _0x5176b5=Object[_0x4533('0x4')](_0x52b768)[0x0];return _0x39af56[_0x4533('0x5')](_0x5176b5);}catch(_0x5cbca4){return![];}}function getOperatorValue(_0x4a576a){var _0x51b4ce=JSON[_0x4533('0x3')](_0x4a576a);var _0x4dea06=Object['keys'](_0x51b4ce)[0x0];var _0x487906=_0x51b4ce[_0x4dea06];return{['$'+_0x4dea06]:_0x487906};}exports[_0x4533('0x6')]=function(_0x42f94b){var _0x300877=null;if(_0x42f94b){_0x300877=_0x42f94b[_0x4533('0x7')](',');}return _0x300877;};exports[_0x4533('0x8')]=function(_0x21b22f,_0xd417){var _0x4fdbda={};if(!_[_0x4533('0x9')](_0x21b22f)){_[_0x4533('0xa')](_0x21b22f,function(_0x1b52ee,_0x12131a){try{if(_0xd417){var _0x5465bf=_[_0x4533('0xb')](_0xd417,{'name':_0x12131a})||{};if(hasSequelizeOperator(_0x1b52ee)){_0x4fdbda[_0x12131a]=getOperatorValue(_0x1b52ee);}else if(_0x5465bf['type']===_0x4533('0xc')&&_[_0x4533('0xd')](_0x1b52ee)){var _0x45ba67=JSON[_0x4533('0x3')](_0x1b52ee);var _0x57ff74={'$gte':moment(moment(_0x45ba67[_0x4533('0xe')])[_0x4533('0xf')](_0x4533('0x10')))[_0x4533('0x11')]()['format'](),'$lte':moment(moment(_0x45ba67[_0x4533('0x12')])['format']('YYYY-MM-DD'))[_0x4533('0x11')]()[_0x4533('0x13')](0x1,'s')['format']()};_0x4fdbda[_0x12131a]=_0x57ff74;}else if(_0x5465bf[_0x4533('0x14')]===_0x4533('0x15')){_0x4fdbda[_0x12131a]=_0x1b52ee;}else{_0x4fdbda[_0x12131a]=_[_0x4533('0x16')](_0x1b52ee)?_0x1b52ee:JSON['parse'](_0x1b52ee);}}else{_0x4fdbda[_0x12131a]=_[_0x4533('0x16')](_0x1b52ee)?_0x1b52ee:JSON['parse'](_0x1b52ee);}}catch(_0x3ddb36){_0x4fdbda[_0x12131a]=_0x1b52ee[_0x4533('0x7')](',');}});}return _0x4fdbda;};exports['limit']=function(_0xd10c6a){_0xd10c6a=parseInt(_0xd10c6a,0xa);if(!_0xd10c6a||_0xd10c6a<0x0){_0xd10c6a=LIMIT_VALUE;}return _0xd10c6a;};exports['offset']=function(_0x5c2c9c){_0x5c2c9c=parseInt(_0x5c2c9c,0xa);if(!_0x5c2c9c||_0x5c2c9c<0x0){_0x5c2c9c=0x0;}return _0x5c2c9c;};exports[_0x4533('0x17')]=function(_0x9740a6){var _0x49fb91,_0x53fe43=null;if(_0x9740a6){_0x49fb91=_0x9740a6[_0x4533('0x7')](',');_0x53fe43=_[_0x4533('0x18')](_0x49fb91,function(_0x3467ba){if(_0x3467ba[_0x4533('0x19')]('-')===0x0){return[_0x3467ba===_0x4533('0x1a')?sequelize[_0x4533('0x1b')](sequelize[_0x4533('0x1c')]('priority'),_0x4533('0x1d')):_0x3467ba[_0x4533('0x1e')](0x1),_0x4533('0x1f')];}else{return[_0x3467ba==='priority'?sequelize['cast'](sequelize[_0x4533('0x1c')](_0x4533('0x1a')),'unsigned'):_0x3467ba,'ASC'];}});}return _0x53fe43;};exports[_0x4533('0x20')]=function(_0x1fa8be,_0xfd9409){if(_['isEmpty'](_0x1fa8be)){return _0x1fa8be;}if(_[_0x4533('0x16')](_0x1fa8be)){for(var _0x39b261=0x0;_0x39b261<_0x1fa8be[_0x4533('0x21')];_0x39b261+=0x1){_0x1fa8be[_0x39b261]=this[_0x4533('0x20')](_0x1fa8be[_0x39b261],_0xfd9409);}return _0x1fa8be;}if(!_[_0x4533('0x22')](_0x1fa8be)){return _0x1fa8be;}if(_[_0x4533('0x23')](_0xfd9409)){_0xfd9409=[_0xfd9409];}if(!_[_0x4533('0x16')](_0xfd9409)){return _0x1fa8be;}for(var _0x27b653=0x0;_0x27b653<_0xfd9409[_0x4533('0x21')];_0x27b653+=0x1){_['unset'](_0x1fa8be,_0xfd9409[_0x27b653]);}for(var _0x5c1e24 in _0x1fa8be){if(_0x1fa8be[_0x4533('0x24')](_0x5c1e24)){_0x1fa8be[_0x5c1e24]=this['omit'](_0x1fa8be[_0x5c1e24],_0xfd9409);}}return _0x1fa8be;};exports[_0x4533('0x25')]=function(_0x4e2b80){return _0x4e2b80[_0x4533('0x26')](RegExp(_0x4533('0x27')))?!![]:![];};exports[_0x4533('0x28')]=function(_0x4300c1){return _0x4300c1[_0x4533('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0x4533('0x29')]=function(_0xe584a2){var _0xa58dd1=[];_0xe584a2[_0x4533('0x7')](/[ ,]+/)[_0x4533('0x2a')](function(_0x728791){_0x728791=_0x728791[_0x4533('0x2b')](/([^:]")"+/g,'$1');_0x728791='+'+_0x728791+'*';var _0x7fc887=/[ `!@#$%^&*()_\-?~]/;if(_0x728791['match'](_0x7fc887))_0x728791='\x22'+_0x728791+'\x22';_0xa58dd1[_0x4533('0x2c')](_0x728791);});return _0xa58dd1['join']('\x20');};exports[_0x4533('0x2d')]=function(_0x3f7720,_0xb7f0b1,_0x3b89f0){var _0x24acf5={},_0x6d58aa={};if(_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x2f')]){_0xb7f0b1[_0x4533('0x2e')]['id']=_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x2f')];delete _0xb7f0b1[_0x4533('0x2e')]['$id'];}_0x24acf5[_0x4533('0x30')]=_[_0x4533('0x18')](_0x3f7720,_0x4533('0x14'));_0x24acf5[_0x4533('0x2e')]=_[_0x4533('0x4')](_0xb7f0b1['query']);_0x24acf5[_0x4533('0x8')]=_[_0x4533('0x31')](_0x24acf5[_0x4533('0x30')],_0x24acf5[_0x4533('0x2e')]);_0x6d58aa[_0x4533('0x32')]=_[_0x4533('0x31')](_0x24acf5['model'],this[_0x4533('0x6')](_0xb7f0b1[_0x4533('0x2e')]['fields']));_0x6d58aa[_0x4533('0x32')]=_0x6d58aa[_0x4533('0x32')][_0x4533('0x21')]?_0x6d58aa[_0x4533('0x32')]:_0x24acf5[_0x4533('0x30')];if(!_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x24')](_0x4533('0x33'))){_0x6d58aa[_0x4533('0x34')]=this[_0x4533('0x34')](_0xb7f0b1['query'][_0x4533('0x34')]);_0x6d58aa[_0x4533('0x35')]=this[_0x4533('0x35')](_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x35')]);}_0x6d58aa[_0x4533('0x36')]=this[_0x4533('0x17')](_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x17')]);_0x6d58aa[_0x4533('0x37')]=this[_0x4533('0x8')](_[_0x4533('0x38')](_0xb7f0b1['query'],_0x24acf5['filters']),_0x3f7720);if(_0xb7f0b1[_0x4533('0x2e')]['filter']){var _0x4260e6=_0x3f7720;var _0x97aa9e=_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x39')];if(typeof _0x97aa9e===_0x4533('0x3a')){_0x4260e6=_[_0x4533('0x39')](_0x3f7720,function(_0x2df795){return _[_0x4533('0x5')](_0x97aa9e[_0x4533('0x3b')],_0x2df795[_0x4533('0x14')]);});_0x97aa9e=_0x97aa9e[_0x4533('0x3c')];}_0x6d58aa[_0x4533('0x37')]=_[_0x4533('0x3d')](_0x6d58aa['where'],{'$or':_[_0x4533('0x18')](_0x4260e6,function(_0x556dd9){if(_0x556dd9['type']!=='VIRTUAL'){if(_0x3b89f0){return sequelize['where'](sequelize['fn'](_0x4533('0x3e'),sequelize[_0x4533('0x1c')](_0x556dd9[_0x4533('0x14')])),{'$like':sequelize['fn'](_0x4533('0x3e'),'%'+_0xb7f0b1['query'][_0x4533('0x39')]+'%')});}else{var _0x369284={};_0x369284[_0x556dd9[_0x4533('0x14')]]={'$like':'%'+_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x39')]+'%'};return _0x369284;}}})});}_0x6d58aa=_[_0x4533('0x3d')]({},_0x6d58aa,_0xb7f0b1[_0x4533('0x3f')]);return _0x6d58aa;}; \ No newline at end of file +var _0x5fc3=['YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','col','unsigned','DESC','ASC','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','$id','query','model','keys','intersection','attributes','nolimit','offset','order','where','pick','filter','object','value','merge','lower','options','lodash','sequelize','parse','includes','fields','split','filters','isEmpty','find','type','$gte','format'];(function(_0x1fe51a,_0x3b18bb){var _0x5d6838=function(_0x238c12){while(--_0x238c12){_0x1fe51a['push'](_0x1fe51a['shift']());}};_0x5d6838(++_0x3b18bb);}(_0x5fc3,0xa8));var _0x35fc=function(_0x422be2,_0x1c439e){_0x422be2=_0x422be2-0x0;var _0x1b820e=_0x5fc3[_0x422be2];return _0x1b820e;};'use strict';var _=require(_0x35fc('0x0'));var sequelize=require(_0x35fc('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x253d6e){var _0x2ac6da=['ne'];try{var _0x196bc2=JSON[_0x35fc('0x2')](_0x253d6e);var _0xb4f9ce=Object['keys'](_0x196bc2)[0x0];return _0x2ac6da[_0x35fc('0x3')](_0xb4f9ce);}catch(_0x1d5fec){return![];}}function getOperatorValue(_0x186a06){var _0x5b85ad=JSON['parse'](_0x186a06);var _0x19a0d1=Object['keys'](_0x5b85ad)[0x0];var _0x16e153=_0x5b85ad[_0x19a0d1];return{['$'+_0x19a0d1]:_0x16e153};}exports[_0x35fc('0x4')]=function(_0xc72d93){var _0x1e5f90=null;if(_0xc72d93){_0x1e5f90=_0xc72d93[_0x35fc('0x5')](',');}return _0x1e5f90;};exports[_0x35fc('0x6')]=function(_0x2051ab,_0x565f95){var _0x1083a9={};if(!_[_0x35fc('0x7')](_0x2051ab)){_['forOwn'](_0x2051ab,function(_0x471549,_0x33f491){try{if(_0x565f95){var _0x5021d4=_[_0x35fc('0x8')](_0x565f95,{'name':_0x33f491})||{};if(hasSequelizeOperator(_0x471549)){_0x1083a9[_0x33f491]=getOperatorValue(_0x471549);}else if(_0x5021d4[_0x35fc('0x9')]==='DATE'&&_['isPlainObject'](_0x471549)){var _0x409357=JSON['parse'](_0x471549);var _0x397738={'$gte':moment(moment(_0x409357[_0x35fc('0xa')])[_0x35fc('0xb')](_0x35fc('0xc')))[_0x35fc('0xd')]()['format'](),'$lte':moment(moment(_0x409357['$lte'])['format']('YYYY-MM-DD'))[_0x35fc('0xd')]()[_0x35fc('0xe')](0x1,'s')[_0x35fc('0xb')]()};_0x1083a9[_0x33f491]=_0x397738;}else if(_0x5021d4[_0x35fc('0xf')]===_0x35fc('0x10')){_0x1083a9[_0x33f491]=_0x471549;}else{_0x1083a9[_0x33f491]=_[_0x35fc('0x11')](_0x471549)?_0x471549:JSON['parse'](_0x471549);}}else{_0x1083a9[_0x33f491]=_[_0x35fc('0x11')](_0x471549)?_0x471549:JSON[_0x35fc('0x2')](_0x471549);}}catch(_0x553677){_0x1083a9[_0x33f491]=_0x471549[_0x35fc('0x5')](',');}});}return _0x1083a9;};exports[_0x35fc('0x12')]=function(_0x2e513b){_0x2e513b=parseInt(_0x2e513b,0xa);if(!_0x2e513b||_0x2e513b<0x0){_0x2e513b=LIMIT_VALUE;}return _0x2e513b;};exports['offset']=function(_0x1a86e9){_0x1a86e9=parseInt(_0x1a86e9,0xa);if(!_0x1a86e9||_0x1a86e9<0x0){_0x1a86e9=0x0;}return _0x1a86e9;};exports[_0x35fc('0x13')]=function(_0x465eb3){var _0x488234,_0x402cff=null;if(_0x465eb3){_0x488234=_0x465eb3[_0x35fc('0x5')](',');_0x402cff=_[_0x35fc('0x14')](_0x488234,function(_0x251a1f){if(_0x251a1f[_0x35fc('0x15')]('-')===0x0){return[_0x251a1f===_0x35fc('0x16')?sequelize[_0x35fc('0x17')](sequelize[_0x35fc('0x18')](_0x35fc('0x16')),_0x35fc('0x19')):_0x251a1f['substr'](0x1),_0x35fc('0x1a')];}else{return[_0x251a1f===_0x35fc('0x16')?sequelize[_0x35fc('0x17')](sequelize[_0x35fc('0x18')](_0x35fc('0x16')),'unsigned'):_0x251a1f,_0x35fc('0x1b')];}});}return _0x402cff;};exports[_0x35fc('0x1c')]=function(_0x561bf8,_0x265324){if(_[_0x35fc('0x7')](_0x561bf8)){return _0x561bf8;}if(_[_0x35fc('0x11')](_0x561bf8)){for(var _0x51cfec=0x0;_0x51cfec<_0x561bf8[_0x35fc('0x1d')];_0x51cfec+=0x1){_0x561bf8[_0x51cfec]=this['omit'](_0x561bf8[_0x51cfec],_0x265324);}return _0x561bf8;}if(!_[_0x35fc('0x1e')](_0x561bf8)){return _0x561bf8;}if(_[_0x35fc('0x1f')](_0x265324)){_0x265324=[_0x265324];}if(!_['isArray'](_0x265324)){return _0x561bf8;}for(var _0x519264=0x0;_0x519264<_0x265324[_0x35fc('0x1d')];_0x519264+=0x1){_['unset'](_0x561bf8,_0x265324[_0x519264]);}for(var _0x274208 in _0x561bf8){if(_0x561bf8[_0x35fc('0x20')](_0x274208)){_0x561bf8[_0x274208]=this['omit'](_0x561bf8[_0x274208],_0x265324);}}return _0x561bf8;};exports[_0x35fc('0x21')]=function(_0x645eac){return _0x645eac[_0x35fc('0x22')](RegExp(_0x35fc('0x23')))?!![]:![];};exports[_0x35fc('0x24')]=function(_0x134dfa){return _0x134dfa[_0x35fc('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x35fc('0x25')]=function(_0x54aedc){var _0x1cd1ae=[];_0x54aedc[_0x35fc('0x5')](/[ ,]+/)[_0x35fc('0x26')](function(_0x52acc5){_0x52acc5=_0x52acc5[_0x35fc('0x27')](/([^:]")"+/g,'$1');_0x52acc5='+'+_0x52acc5+'*';var _0x16f067=/[ `!@#$%^&*()_\-?~]/;if(_0x52acc5[_0x35fc('0x22')](_0x16f067))_0x52acc5='\x22'+_0x52acc5+'\x22';_0x1cd1ae[_0x35fc('0x28')](_0x52acc5);});return _0x1cd1ae[_0x35fc('0x29')]('\x20');};exports[_0x35fc('0x2a')]=function(_0x222ddb,_0x37b435,_0xf4dfab){var _0x127bfc={},_0x57072d={};if(_0x37b435['query'][_0x35fc('0x2b')]){_0x37b435['query']['id']=_0x37b435[_0x35fc('0x2c')][_0x35fc('0x2b')];delete _0x37b435[_0x35fc('0x2c')][_0x35fc('0x2b')];}_0x127bfc[_0x35fc('0x2d')]=_[_0x35fc('0x14')](_0x222ddb,'name');_0x127bfc[_0x35fc('0x2c')]=_[_0x35fc('0x2e')](_0x37b435[_0x35fc('0x2c')]);_0x127bfc[_0x35fc('0x6')]=_[_0x35fc('0x2f')](_0x127bfc[_0x35fc('0x2d')],_0x127bfc['query']);_0x57072d[_0x35fc('0x30')]=_[_0x35fc('0x2f')](_0x127bfc[_0x35fc('0x2d')],this['fields'](_0x37b435[_0x35fc('0x2c')]['fields']));_0x57072d[_0x35fc('0x30')]=_0x57072d[_0x35fc('0x30')][_0x35fc('0x1d')]?_0x57072d[_0x35fc('0x30')]:_0x127bfc['model'];if(!_0x37b435['query']['hasOwnProperty'](_0x35fc('0x31'))){_0x57072d['limit']=this[_0x35fc('0x12')](_0x37b435['query'][_0x35fc('0x12')]);_0x57072d[_0x35fc('0x32')]=this[_0x35fc('0x32')](_0x37b435[_0x35fc('0x2c')][_0x35fc('0x32')]);}_0x57072d[_0x35fc('0x33')]=this[_0x35fc('0x13')](_0x37b435['query'][_0x35fc('0x13')]);_0x57072d[_0x35fc('0x34')]=this['filters'](_[_0x35fc('0x35')](_0x37b435[_0x35fc('0x2c')],_0x127bfc[_0x35fc('0x6')]),_0x222ddb);if(_0x37b435[_0x35fc('0x2c')][_0x35fc('0x36')]){var _0x31d926=_0x222ddb;var _0x58f25c=_0x37b435[_0x35fc('0x2c')][_0x35fc('0x36')];if(typeof _0x58f25c===_0x35fc('0x37')){_0x31d926=_['filter'](_0x222ddb,function(_0x17821e){return _[_0x35fc('0x3')](_0x58f25c['columns'],_0x17821e[_0x35fc('0xf')]);});_0x58f25c=_0x58f25c[_0x35fc('0x38')];}_0x57072d[_0x35fc('0x34')]=_[_0x35fc('0x39')](_0x57072d[_0x35fc('0x34')],{'$or':_[_0x35fc('0x14')](_0x31d926,function(_0x211b70){if(_0x211b70[_0x35fc('0x9')]!=='VIRTUAL'){if(_0xf4dfab){return sequelize['where'](sequelize['fn'](_0x35fc('0x3a'),sequelize[_0x35fc('0x18')](_0x211b70['name'])),{'$like':sequelize['fn']('lower','%'+_0x37b435['query'][_0x35fc('0x36')]+'%')});}else{var _0x10f98b={};_0x10f98b[_0x211b70['name']]={'$like':'%'+_0x37b435[_0x35fc('0x2c')][_0x35fc('0x36')]+'%'};return _0x10f98b;}}})});}_0x57072d=_[_0x35fc('0x39')]({},_0x57072d,_0x37b435[_0x35fc('0x3b')]);return _0x57072d;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index afd28d1..6cd52f2 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x39e02f,_0x2f4a3c){var _0x9cf183=function(_0x5bdd82){while(--_0x5bdd82){_0x39e02f['push'](_0x39e02f['shift']());}};_0x9cf183(++_0x2f4a3c);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x24875d,_0x4fb24d){var _0x181471=function(_0x4ecd6d){while(--_0x4ecd6d){_0x24875d['push'](_0x24875d['shift']());}};_0x181471(++_0x4fb24d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 1e92135..ba2cbc8 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 _0x2985=['family','IPv4','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','model','createHash','md5','digest','hex','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','update','substring','lodash','child_process','../environment','networkInterfaces','orderBy','keys','filter'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x2985,0x18f));var _0x5298=function(_0xac4196,_0x3f58aa){_0xac4196=_0xac4196-0x0;var _0x97704a=_0x2985[_0xac4196];return _0x97704a;};'use strict';var _=require(_0x5298('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0x5298('0x1'))['execSync'];var config=require(_0x5298('0x2'));function getInterfaces(){var _0x22190a=[];var _0xffd36f=os[_0x5298('0x3')]();var _0x1310e8=_[_0x5298('0x4')](_[_0x5298('0x5')](_0xffd36f));for(var _0x46e25c=0x0;_0x46e25c<_0x1310e8['length'];_0x46e25c++){var _0x43d39a=_0xffd36f[_0x1310e8[_0x46e25c]][_0x5298('0x6')](function(_0x14eb04){return _0x14eb04[_0x5298('0x7')]===_0x5298('0x8')&&_0x14eb04['internal']===![];});_0x22190a=_0x22190a['concat'](_0x43d39a);}return _0x22190a;}function getFirstInterface(){var _0x2d7226=_['head'](getInterfaces());return{'macAddress':_0x2d7226&&_0x2d7226[_0x5298('0x9')]?_0x2d7226[_0x5298('0x9')]:_0x5298('0xa'),'ipAddress':_0x2d7226&&_0x2d7226['address']?_0x2d7226[_0x5298('0xb')]:'127.0.0.1'};}exports[_0x5298('0xc')]=getFirstInterface;function getCPUhash(){var _0xcdadf2=_[_0x5298('0x4')](os[_0x5298('0xd')]()['map'](function(_0x786985){return _0x786985[_0x5298('0xe')];}))['join'](':');return crypto[_0x5298('0xf')](_0x5298('0x10'))['update'](_0xcdadf2)[_0x5298('0x11')](_0x5298('0x12'));}exports['getUuid']=function(){var _0x1e7603=os[_0x5298('0x13')]();var _0x2feac4=/[0-9a-f-]{36}/;if(config[_0x5298('0x14')]&&_0x2feac4['test'](config[_0x5298('0x14')])){return config[_0x5298('0x14')];}else if(_0x1e7603===_0x5298('0x15')){return exec(_0x5298('0x16'),{'encoding':'utf8'})[_0x5298('0x17')]('\x0d\x0a','');}else{var _0x5d9b54=getFirstInterface();var _0x2b8cee=getCPUhash();var _0x443e6e=_0x2b8cee+'|'+os[_0x5298('0x18')]()+'|'+_0x5d9b54[_0x5298('0x19')]+'|'+_0x5d9b54[_0x5298('0x1a')];var _0x12ccfd=crypto[_0x5298('0xf')](_0x5298('0x10'))[_0x5298('0x1b')](_0x443e6e)['digest'](_0x5298('0x12'));return _0x12ccfd[_0x5298('0x1c')](0x0,0x8)+'-'+_0x12ccfd['substring'](0x8,0xc)+'-'+_0x12ccfd[_0x5298('0x1c')](0xc,0x10)+'-'+_0x12ccfd[_0x5298('0x1c')](0x10,0x14)+'-'+_0x12ccfd[_0x5298('0x1c')](0x14);}}; \ No newline at end of file +var _0x9db5=['orderBy','keys','length','filter','IPv4','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','createHash','md5','digest','hex','getUuid','platform','test','licenseToken','win32','utf8','hostname','ipAddress','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x9db5,0x1c8));var _0x59db=function(_0x258473,_0x4b8096){_0x258473=_0x258473-0x0;var _0x768d4e=_0x9db5[_0x258473];return _0x768d4e;};'use strict';var _=require(_0x59db('0x0'));var os=require('os');var crypto=require(_0x59db('0x1'));var machine=require(_0x59db('0x2'));var exec=require(_0x59db('0x3'))[_0x59db('0x4')];var config=require('../environment');function getInterfaces(){var _0x51ee17=[];var _0x4788f9=os[_0x59db('0x5')]();var _0x508af3=_[_0x59db('0x6')](_[_0x59db('0x7')](_0x4788f9));for(var _0x970ff5=0x0;_0x970ff5<_0x508af3[_0x59db('0x8')];_0x970ff5++){var _0x40acd1=_0x4788f9[_0x508af3[_0x970ff5]][_0x59db('0x9')](function(_0x394440){return _0x394440['family']===_0x59db('0xa')&&_0x394440['internal']===![];});_0x51ee17=_0x51ee17[_0x59db('0xb')](_0x40acd1);}return _0x51ee17;}function getFirstInterface(){var _0x4020a5=_[_0x59db('0xc')](getInterfaces());return{'macAddress':_0x4020a5&&_0x4020a5[_0x59db('0xd')]?_0x4020a5['mac']:_0x59db('0xe'),'ipAddress':_0x4020a5&&_0x4020a5[_0x59db('0xf')]?_0x4020a5[_0x59db('0xf')]:'127.0.0.1'};}exports[_0x59db('0x10')]=getFirstInterface;function getCPUhash(){var _0x9a16ff=_[_0x59db('0x6')](os[_0x59db('0x11')]()[_0x59db('0x12')](function(_0x2ebbd5){return _0x2ebbd5['model'];}))['join'](':');return crypto[_0x59db('0x13')](_0x59db('0x14'))['update'](_0x9a16ff)[_0x59db('0x15')](_0x59db('0x16'));}exports[_0x59db('0x17')]=function(){var _0x1df95=os[_0x59db('0x18')]();var _0x800c55=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x800c55[_0x59db('0x19')](config[_0x59db('0x1a')])){return config[_0x59db('0x1a')];}else if(_0x1df95===_0x59db('0x1b')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x59db('0x1c')})['replace']('\x0d\x0a','');}else{var _0x3bb042=getFirstInterface();var _0x4b870c=getCPUhash();var _0x2ded17=_0x4b870c+'|'+os[_0x59db('0x1d')]()+'|'+_0x3bb042['macAddress']+'|'+_0x3bb042[_0x59db('0x1e')];var _0x9f77db=crypto[_0x59db('0x13')]('md5')[_0x59db('0x1f')](_0x2ded17)[_0x59db('0x15')]('hex');return _0x9f77db[_0x59db('0x20')](0x0,0x8)+'-'+_0x9f77db[_0x59db('0x20')](0x8,0xc)+'-'+_0x9f77db[_0x59db('0x20')](0xc,0x10)+'-'+_0x9f77db['substring'](0x10,0x14)+'-'+_0x9f77db[_0x59db('0x20')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 2eeb62f..6620e01 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 _0xc4a8=['exports','then','get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','bluebird','pkginfo','version','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s&oldtoken=%s'];(function(_0x183b97,_0x2d297c){var _0x629cf7=function(_0x4ffd24){while(--_0x4ffd24){_0x183b97['push'](_0x183b97['shift']());}};_0x629cf7(++_0x2d297c);}(_0xc4a8,0x1ce));var _0x8c4a=function(_0x5432dd,_0x1374f8){_0x5432dd=_0x5432dd-0x0;var _0xf85a2e=_0xc4a8[_0x5432dd];return _0xf85a2e;};'use strict';var util=require(_0x8c4a('0x0'));var moment=require('moment');var rp=require(_0x8c4a('0x1'));var BPromise=require(_0x8c4a('0x2'));var pkginfo=require(_0x8c4a('0x3'))(module,_0x8c4a('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x8c4a('0x5'));var hardware=require(_0x8c4a('0x6'));var logger=require(_0x8c4a('0x7'))('license');var HOST=_0x8c4a('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x24eeff){return new BPromise(function(_0x476a64,_0x5c2860){var _0x559871=util[_0x8c4a('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x24eeff,module['exports'][_0x8c4a('0x4')]);if(oldToken){_0x559871=util[_0x8c4a('0x9')](_0x8c4a('0xa'),HOST,_0x24eeff,module[_0x8c4a('0xb')][_0x8c4a('0x4')],oldToken);}var _0x3f2448={'uri':_0x559871,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x3f2448)[_0x8c4a('0xc')](function(_0x40a0da){_0x476a64(_0x40a0da);})['catch'](function(_0x5432d7){_0x5c2860(_0x5432d7);});});}function manageLicense(_0xdf8dd,_0x4a6723){var _0x4900dc=_0x4a6723[_0x8c4a('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x4900dc[_0x8c4a('0xe')]!==_0xdf8dd&&!_0x4900dc[_0x8c4a('0xf')]){oldToken=_0x4900dc[_0x8c4a('0xe')];}httpRequest(_0xdf8dd)['then'](function(_0x1c20d4){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1c20d4[_0x8c4a('0x10')]){isOldTokenSent=![];if(!_0x4900dc[_0x8c4a('0x11')]&&_0x4900dc[_0x8c4a('0x11')]!=_0x1c20d4[_0x8c4a('0x11')]||_0x4900dc[_0x8c4a('0x11')]&&_0x4900dc[_0x8c4a('0xf')]){logger[_0x8c4a('0x12')](_0x8c4a('0x13'));}if(_0x4900dc[_0x8c4a('0x11')]&&!_0x4900dc[_0x8c4a('0xf')]&&_0x4900dc[_0x8c4a('0x11')]!=_0x1c20d4[_0x8c4a('0x11')]){logger[_0x8c4a('0x12')](_0x8c4a('0x14'));}if(_0x4900dc['license']&&!_0x4900dc[_0x8c4a('0xf')]&&_0x4900dc['license']==_0x1c20d4['license']){return _0x4a6723;}return _0x4a6723[_0x8c4a('0x15')]({'data1':_0xdf8dd,'data2':null,'license':_0x1c20d4[_0x8c4a('0x11')]});}else{if(_0x1c20d4['license']||_0x4900dc[_0x8c4a('0x11')]){if(!_0x4900dc[_0x8c4a('0xf')]){if(_0x4900dc[_0x8c4a('0xe')]==_0xdf8dd){GRAY_PERIOD_REASON=_0x8c4a('0x16');logger['info'](_0x8c4a('0x17'));}else{GRAY_PERIOD_REASON=_0x8c4a('0x18');logger['info'](_0x8c4a('0x19'),_0x4900dc['data1'],_0xdf8dd);}logger[_0x8c4a('0x12')](_0x8c4a('0x1a'),GRAY_PERIOD_REASON[_0x8c4a('0x1b')](),moment()[_0x8c4a('0x9')](_0x8c4a('0x1c')));return _0x4a6723[_0x8c4a('0x15')]({'data2':encryptor[_0x8c4a('0x1d')](moment()['format'](_0x8c4a('0x1c')))});}else{if(moment()[_0x8c4a('0x1e')](encryptor[_0x8c4a('0x1f')](_0x4900dc[_0x8c4a('0xf')]),_0x8c4a('0x20'))>DAYS){logger[_0x8c4a('0x12')](_0x8c4a('0x21'),moment()[_0x8c4a('0x9')](_0x8c4a('0x1c')));isOldTokenSent=![];return _0x4a6723[_0x8c4a('0x15')]({'data1':_0xdf8dd,'data2':null,'license':null});}}}else{if(_0x4900dc[_0x8c4a('0xe')]!=_0xdf8dd){logger[_0x8c4a('0x12')](_0x8c4a('0x19'),_0x4900dc[_0x8c4a('0xe')],_0xdf8dd);return _0x4a6723[_0x8c4a('0x15')]({'data1':_0xdf8dd,'data2':null,'license':null});}}}return _0x4a6723;})[_0x8c4a('0xc')](function(_0xac6202){_0x4a6723=_0xac6202;})['catch'](function(_0x1b3286){logger[_0x8c4a('0x22')](_0x1b3286[_0x8c4a('0x23')]);})[_0x8c4a('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0x8c4a('0x25')](),_0x4a6723);},TIME);});}function defaultLicense(){var _0x2129d6=hardware[_0x8c4a('0x25')]();if(_0x2129d6){return db[_0x8c4a('0x26')][_0x8c4a('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x2129d6}})[_0x8c4a('0x28')](function(_0x2e7e00,_0x558aa2){logger[_0x8c4a('0x12')](_0x8c4a('0x29'),_0x2129d6);manageLicense(_0x2129d6,_0x2e7e00);})['catch'](function(_0x3810f1){logger[_0x8c4a('0x22')](_0x3810f1[_0x8c4a('0x23')]);});}}exports[_0x8c4a('0x2a')]=defaultLicense; \ No newline at end of file +var _0x2ae9=['info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','bluebird','pkginfo','version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1'];(function(_0x33e3bf,_0x510fdb){var _0x321b3a=function(_0x825ada){while(--_0x825ada){_0x33e3bf['push'](_0x33e3bf['shift']());}};_0x321b3a(++_0x510fdb);}(_0x2ae9,0xb1));var _0x92ae=function(_0x11731f,_0x2271b5){_0x11731f=_0x11731f-0x0;var _0x14587c=_0x2ae9[_0x11731f];return _0x14587c;};'use strict';var util=require(_0x92ae('0x0'));var moment=require('moment');var rp=require('request-promise');var BPromise=require(_0x92ae('0x1'));var pkginfo=require(_0x92ae('0x2'))(module,_0x92ae('0x3'));var db=require(_0x92ae('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x92ae('0x5'));var logger=require(_0x92ae('0x6'))(_0x92ae('0x7'));var HOST=_0x92ae('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x7f6d35){return new BPromise(function(_0x1011ac,_0x330b9d){var _0x518687=util[_0x92ae('0x9')](_0x92ae('0xa'),HOST,_0x7f6d35,module[_0x92ae('0xb')][_0x92ae('0x3')]);if(oldToken){_0x518687=util[_0x92ae('0x9')](_0x92ae('0xc'),HOST,_0x7f6d35,module[_0x92ae('0xb')][_0x92ae('0x3')],oldToken);}var _0x31c5c2={'uri':_0x518687,'method':_0x92ae('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x31c5c2)[_0x92ae('0xe')](function(_0x1a54ab){_0x1011ac(_0x1a54ab);})[_0x92ae('0xf')](function(_0x203812){_0x330b9d(_0x203812);});});}function manageLicense(_0x3b7a2e,_0x4d9d80){var _0x4e3fd1=_0x4d9d80[_0x92ae('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x4e3fd1['data1']!==_0x3b7a2e&&!_0x4e3fd1['data2']){oldToken=_0x4e3fd1[_0x92ae('0x11')];}httpRequest(_0x3b7a2e)['then'](function(_0x34a08e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x34a08e['active']){isOldTokenSent=![];if(!_0x4e3fd1['license']&&_0x4e3fd1[_0x92ae('0x7')]!=_0x34a08e[_0x92ae('0x7')]||_0x4e3fd1[_0x92ae('0x7')]&&_0x4e3fd1['data2']){logger[_0x92ae('0x12')](_0x92ae('0x13'));}if(_0x4e3fd1[_0x92ae('0x7')]&&!_0x4e3fd1[_0x92ae('0x14')]&&_0x4e3fd1[_0x92ae('0x7')]!=_0x34a08e[_0x92ae('0x7')]){logger[_0x92ae('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x4e3fd1[_0x92ae('0x7')]&&!_0x4e3fd1[_0x92ae('0x14')]&&_0x4e3fd1[_0x92ae('0x7')]==_0x34a08e[_0x92ae('0x7')]){return _0x4d9d80;}return _0x4d9d80['update']({'data1':_0x3b7a2e,'data2':null,'license':_0x34a08e[_0x92ae('0x7')]});}else{if(_0x34a08e[_0x92ae('0x7')]||_0x4e3fd1[_0x92ae('0x7')]){if(!_0x4e3fd1[_0x92ae('0x14')]){if(_0x4e3fd1[_0x92ae('0x11')]==_0x3b7a2e){GRAY_PERIOD_REASON=_0x92ae('0x15');logger[_0x92ae('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x92ae('0x16');logger[_0x92ae('0x12')](_0x92ae('0x17'),_0x4e3fd1[_0x92ae('0x11')],_0x3b7a2e);}logger[_0x92ae('0x12')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x92ae('0x18')](),moment()['format'](_0x92ae('0x19')));return _0x4d9d80[_0x92ae('0x1a')]({'data2':encryptor['encryptString'](moment()[_0x92ae('0x9')](_0x92ae('0x19')))});}else{if(moment()[_0x92ae('0x1b')](encryptor[_0x92ae('0x1c')](_0x4e3fd1[_0x92ae('0x14')]),_0x92ae('0x1d'))>DAYS){logger[_0x92ae('0x12')](_0x92ae('0x1e'),moment()[_0x92ae('0x9')](_0x92ae('0x19')));isOldTokenSent=![];return _0x4d9d80[_0x92ae('0x1a')]({'data1':_0x3b7a2e,'data2':null,'license':null});}}}else{if(_0x4e3fd1[_0x92ae('0x11')]!=_0x3b7a2e){logger[_0x92ae('0x12')](_0x92ae('0x17'),_0x4e3fd1[_0x92ae('0x11')],_0x3b7a2e);return _0x4d9d80['update']({'data1':_0x3b7a2e,'data2':null,'license':null});}}}return _0x4d9d80;})['then'](function(_0x2139ce){_0x4d9d80=_0x2139ce;})[_0x92ae('0xf')](function(_0x2c3b1e){logger[_0x92ae('0x1f')](_0x2c3b1e[_0x92ae('0x20')]);})[_0x92ae('0x21')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x4d9d80);},TIME);});}function defaultLicense(){var _0x528eec=hardware[_0x92ae('0x22')]();if(_0x528eec){return db[_0x92ae('0x23')][_0x92ae('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x528eec}})['spread'](function(_0x385792,_0x588faf){logger[_0x92ae('0x12')](_0x92ae('0x25'),_0x528eec);manageLicense(_0x528eec,_0x385792);})[_0x92ae('0xf')](function(_0x1731a7){logger[_0x92ae('0x1f')](_0x1731a7['message']);});}}exports[_0x92ae('0x26')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 3d299e9..b3cea63 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 _0xefa7=['getUuid','License','find','then','uuid','isEmpty','split','decryptString','parse','days','format','grayReason','machineUuid','changed','data1','message','findAll','sequelize','COUNT','col','role','count','admin','user','telephones','forEach','catch','telephone','License\x20limit\x20reached\x20for\x20users','exports','lodash','moment','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license'];(function(_0x101d5b,_0x40cfd){var _0x382a50=function(_0x2fd131){while(--_0x2fd131){_0x101d5b['push'](_0x101d5b['shift']());}};_0x382a50(++_0x40cfd);}(_0xefa7,0x190));var _0x7efa=function(_0x5e19b4,_0x1c24d5){_0x5e19b4=_0x5e19b4-0x0;var _0x10c429=_0xefa7[_0x5e19b4];return _0x10c429;};'use strict';var util=require('util');var _=require(_0x7efa('0x0'));var moment=require(_0x7efa('0x1'));var BPromise=require(_0x7efa('0x2'));var hardware=require('./hardware');var encryptor=require(_0x7efa('0x3'));var db=require(_0x7efa('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7efa('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x7efa('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7efa('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x7efa('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x103001){return new BPromise(function(_0x3310ec,_0x508c39){return db[_0x7efa('0x8')][_0x7efa('0x9')](_['defaults'](_0x103001,{'raw':!![],'where':{'id':0x1}}))[_0x7efa('0xa')](function(_0x522874){return checkLicense(_0x522874,null);})['then'](function(_0x3ca5e9){_0x3310ec(_0x3ca5e9);return;})['catch'](function(_0x43cac0){_0x508c39(_0x43cac0);});});}function checkLicense(_0xbb9cb0,_0x137918){if(!_0xbb9cb0){demoLicense[_0x7efa('0xb')]=_0xbb9cb0['data1'];return demoLicense;}try{var _0x40f8c4=_0x137918||_0xbb9cb0['license'];if(_[_0x7efa('0xc')](_0x40f8c4)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x23d8d8=_0xbb9cb0['data1'];var _0x515a1e=_0xbb9cb0['data2'];var _0x24afb=_0x23d8d8['split']('-')[0x4];var _0x32991c=_0x23d8d8[_0x7efa('0xd')]('-')[0x0];var _0x36ff36=encryptor[_0x7efa('0xe')](_0x40f8c4,util['format']('%s:%s:%s',_0x24afb,_0x23d8d8,_0x32991c));var _0x15a26f=JSON[_0x7efa('0xf')](_0x36ff36);_0x15a26f['demo']=![];_0x15a26f['uuid']=_0x23d8d8;_0x15a26f['machineUuid']=hardware[_0x7efa('0x7')]();if(_0x515a1e){var _0x545be0=encryptor[_0x7efa('0xe')](_0x515a1e);_0x15a26f['gray']=_0x545be0;_0x15a26f['deadline']=moment(_0x545be0)['add'](0x7,_0x7efa('0x10'))[_0x7efa('0x11')]();_0x15a26f[_0x7efa('0x12')]=_0x15a26f[_0x7efa('0xb')]!=_0x15a26f[_0x7efa('0x13')]?_0x7efa('0x14'):'disabled';}return _0x15a26f;}catch(_0x2b9c34){breakingLicense[_0x7efa('0xb')]=_0xbb9cb0[_0x7efa('0x15')];breakingLicense[_0x7efa('0x16')]=_0x2b9c34['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5406d,_0x6abd55){getLicense()[_0x7efa('0xa')](function(_0x349f4f){return db['User'][_0x7efa('0x17')]({'attributes':['role',[db[_0x7efa('0x18')]['fn'](_0x7efa('0x19'),db[_0x7efa('0x18')][_0x7efa('0x1a')](_0x7efa('0x1b'))),_0x7efa('0x1c')]],'group':_0x7efa('0x1b'),'where':{'role':{'$or':[_0x7efa('0x1d'),_0x7efa('0x1e'),'telephone']}},'raw':!![]})[_0x7efa('0xa')](function(_0x4119d4){var _0x463a5d={'user':_0x349f4f['users']||0x0,'telephone':_0x349f4f[_0x7efa('0x1f')]||0x0};_0x4119d4[_0x7efa('0x20')](function(_0x3770e0){var _0x115bc9=_0x3770e0[_0x7efa('0x1b')]===_0x7efa('0x1d')?_0x7efa('0x1e'):_0x3770e0[_0x7efa('0x1b')];_0x463a5d[_0x115bc9]-=_0x3770e0[_0x7efa('0x1c')];if(_0x463a5d[_0x115bc9]<0x0)_0x463a5d[_0x115bc9]=0x0;});_0x5406d(_0x463a5d);return;});})[_0x7efa('0x21')](function(_0x475188){_0x6abd55(_0x475188);});});}function checkUserLimits(_0x3c428c){return new BPromise(function(_0x11ebd2,_0x12825c){getLimits()[_0x7efa('0xa')](function(_0x3729c1){var _0x469418=_['pick'](_['countBy'](_0x3c428c,_0x7efa('0x1b')),[_0x7efa('0x1d'),_0x7efa('0x1e'),_0x7efa('0x22')]);var _0xe94f06=(_0x469418[_0x7efa('0x1d')]||0x0)+(_0x469418[_0x7efa('0x1e')]||0x0);var _0x27f916=_0x469418['telephone']||0x0;if(_0xe94f06>_0x3729c1[_0x7efa('0x1e')])return _0x12825c(_0x7efa('0x23'));if(_0x27f916>_0x3729c1['telephone'])return _0x12825c('License\x20limit\x20reached\x20for\x20telephones');return _0x11ebd2();})['catch'](function(_0x3a0ecb){_0x12825c(_0x3a0ecb);});});}module[_0x7efa('0x24')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x3022=['catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','demo','machineUuid','gray','deadline','days','grayReason','disabled','message','User','findAll','role','sequelize','COUNT','count','user','telephone','telephones','forEach','admin','exports','util','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','defaults','then'];(function(_0x12ff13,_0x18398b){var _0xc74ebd=function(_0x4e67c5){while(--_0x4e67c5){_0x12ff13['push'](_0x12ff13['shift']());}};_0xc74ebd(++_0x18398b);}(_0x3022,0x14b));var _0x2302=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x3022[_0xda464c];return _0x19e222;};'use strict';var util=require(_0x2302('0x0'));var _=require(_0x2302('0x1'));var moment=require('moment');var BPromise=require(_0x2302('0x2'));var hardware=require(_0x2302('0x3'));var encryptor=require(_0x2302('0x4'));var db=require(_0x2302('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2302('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x2302('0x7'),'machineUuid':hardware[_0x2302('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2302('0x9'),'machineUuid':hardware[_0x2302('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4913fc){return new BPromise(function(_0x2e3861,_0x423a2a){return db[_0x2302('0xa')]['find'](_[_0x2302('0xb')](_0x4913fc,{'raw':!![],'where':{'id':0x1}}))[_0x2302('0xc')](function(_0x13280f){return checkLicense(_0x13280f,null);})['then'](function(_0x375235){_0x2e3861(_0x375235);return;})[_0x2302('0xd')](function(_0x3bc916){_0x423a2a(_0x3bc916);});});}function checkLicense(_0x3cec04,_0x19999d){if(!_0x3cec04){demoLicense[_0x2302('0xe')]=_0x3cec04[_0x2302('0xf')];return demoLicense;}try{var _0x282b25=_0x19999d||_0x3cec04[_0x2302('0x10')];if(_[_0x2302('0x11')](_0x282b25)){throw new Error(_0x2302('0x12'));}var _0x50bfe0=_0x3cec04[_0x2302('0xf')];var _0x4f86d6=_0x3cec04[_0x2302('0x13')];var _0x5a8214=_0x50bfe0['split']('-')[0x4];var _0x220aa2=_0x50bfe0[_0x2302('0x14')]('-')[0x0];var _0x2ce402=encryptor[_0x2302('0x15')](_0x282b25,util[_0x2302('0x16')]('%s:%s:%s',_0x5a8214,_0x50bfe0,_0x220aa2));var _0x50dc7e=JSON['parse'](_0x2ce402);_0x50dc7e[_0x2302('0x17')]=![];_0x50dc7e[_0x2302('0xe')]=_0x50bfe0;_0x50dc7e[_0x2302('0x18')]=hardware[_0x2302('0x8')]();if(_0x4f86d6){var _0x8f92cf=encryptor[_0x2302('0x15')](_0x4f86d6);_0x50dc7e[_0x2302('0x19')]=_0x8f92cf;_0x50dc7e[_0x2302('0x1a')]=moment(_0x8f92cf)['add'](0x7,_0x2302('0x1b'))[_0x2302('0x16')]();_0x50dc7e[_0x2302('0x1c')]=_0x50dc7e[_0x2302('0xe')]!=_0x50dc7e[_0x2302('0x18')]?'changed':_0x2302('0x1d');}return _0x50dc7e;}catch(_0x517bc4){breakingLicense[_0x2302('0xe')]=_0x3cec04[_0x2302('0xf')];breakingLicense[_0x2302('0x1e')]=_0x517bc4[_0x2302('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2c3660,_0x34e263){getLicense()[_0x2302('0xc')](function(_0x4e155b){return db[_0x2302('0x1f')][_0x2302('0x20')]({'attributes':[_0x2302('0x21'),[db[_0x2302('0x22')]['fn'](_0x2302('0x23'),db[_0x2302('0x22')]['col'](_0x2302('0x21'))),_0x2302('0x24')]],'group':'role','where':{'role':{'$or':['admin',_0x2302('0x25'),_0x2302('0x26')]}},'raw':!![]})['then'](function(_0x571708){var _0x2c935d={'user':_0x4e155b['users']||0x0,'telephone':_0x4e155b[_0x2302('0x27')]||0x0};_0x571708[_0x2302('0x28')](function(_0x2b80e0){var _0x59ffd8=_0x2b80e0[_0x2302('0x21')]===_0x2302('0x29')?_0x2302('0x25'):_0x2b80e0[_0x2302('0x21')];_0x2c935d[_0x59ffd8]-=_0x2b80e0['count'];if(_0x2c935d[_0x59ffd8]<0x0)_0x2c935d[_0x59ffd8]=0x0;});_0x2c3660(_0x2c935d);return;});})['catch'](function(_0x48cf60){_0x34e263(_0x48cf60);});});}function checkUserLimits(_0x31b649){return new BPromise(function(_0x1243c8,_0x23cc28){getLimits()[_0x2302('0xc')](function(_0x2d8e0c){var _0x4d3906=_['pick'](_['countBy'](_0x31b649,'role'),[_0x2302('0x29'),'user',_0x2302('0x26')]);var _0x3f8efd=(_0x4d3906[_0x2302('0x29')]||0x0)+(_0x4d3906[_0x2302('0x25')]||0x0);var _0x15807c=_0x4d3906[_0x2302('0x26')]||0x0;if(_0x3f8efd>_0x2d8e0c[_0x2302('0x25')])return _0x23cc28('License\x20limit\x20reached\x20for\x20users');if(_0x15807c>_0x2d8e0c['telephone'])return _0x23cc28('License\x20limit\x20reached\x20for\x20telephones');return _0x1243c8();})[_0x2302('0xd')](function(_0x500557){_0x23cc28(_0x500557);});});}module[_0x2302('0x2a')]={'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 f9d8612..b8c562f 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 _0xe820=['exports','myappanuglar-secret'];(function(_0xc0a38f,_0x25b848){var _0x37e040=function(_0x40411e){while(--_0x40411e){_0xc0a38f['push'](_0xc0a38f['shift']());}};_0x37e040(++_0x25b848);}(_0xe820,0xd2));var _0x0e82=function(_0x12d345,_0x52091c){_0x12d345=_0x12d345-0x0;var _0x43b1f5=_0xe820[_0x12d345];return _0x43b1f5;};'use strict';module[_0x0e82('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x0e82('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x6d11=['http://localhost:9000','myappanuglar-secret','secret','exports'];(function(_0x12cac7,_0x1a57c7){var _0x4bf007=function(_0x177ef1){while(--_0x177ef1){_0x12cac7['push'](_0x12cac7['shift']());}};_0x4bf007(++_0x1a57c7);}(_0x6d11,0xbf));var _0x16d1=function(_0x28aea6,_0x38cf69){_0x28aea6=_0x28aea6-0x0;var _0xa1a04a=_0x6d11[_0x28aea6];return _0xa1a04a;};'use strict';module[_0x16d1('0x0')]={'DOMAIN':_0x16d1('0x1'),'SESSION_SECRET':_0x16d1('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x16d1('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index c71728a..e489f1f 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc574=['exports','../utils/loggers'];(function(_0x762506,_0xa36cf3){var _0x21c5eb=function(_0xb43dbc){while(--_0xb43dbc){_0x762506['push'](_0x762506['shift']());}};_0x21c5eb(++_0xa36cf3);}(_0xc574,0x1e1));var _0x4c57=function(_0x3e798c,_0x1ed765){_0x3e798c=_0x3e798c-0x0;var _0x4892c1=_0xc574[_0x3e798c];return _0x4892c1;};'use strict';var fileLogger=require(_0x4c57('0x0'))['fileLogger'];module[_0x4c57('0x1')]=fileLogger; \ No newline at end of file +var _0x3616=['../utils/loggers','fileLogger','exports'];(function(_0x364220,_0x34ce6a){var _0x4a6928=function(_0x5ae556){while(--_0x5ae556){_0x364220['push'](_0x364220['shift']());}};_0x4a6928(++_0x34ce6a);}(_0x3616,0xa2));var _0x6361=function(_0x337155,_0xf044fc){_0x337155=_0x337155-0x0;var _0x581701=_0x3616[_0x337155];return _0x581701;};'use strict';var fileLogger=require(_0x6361('0x0'))[_0x6361('0x1')];module[_0x6361('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index b5ab53b..39605b2 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 _0x443c=['xdr','path','express','join','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js'];(function(_0x1d2193,_0x1e8790){var _0x3be200=function(_0x318177){while(--_0x318177){_0x1d2193['push'](_0x1d2193['shift']());}};_0x3be200(++_0x1e8790);}(_0x443c,0xe7));var _0xc443=function(_0x23ca3a,_0xe44c43){_0x23ca3a=_0x23ca3a-0x0;var _0x5c1aab=_0x443c[_0x23ca3a];return _0x5c1aab;};'use strict';var path=require(_0xc443('0x0'));var os=require('os');var config={'apps':[{'name':_0xc443('0x1'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':'ami','script':path[_0xc443('0x2')](__dirname,_0xc443('0x3'))},{'name':_0xc443('0x4'),'script':path[_0xc443('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0xc443('0x5'),'script':path[_0xc443('0x2')](__dirname,_0xc443('0x6'))},{'name':_0xc443('0x7'),'script':path[_0xc443('0x2')](__dirname,_0xc443('0x8'))},{'name':_0xc443('0x9'),'script':path[_0xc443('0x2')](__dirname,'../../services/xdr/index.js')}]};module['exports']=config; \ No newline at end of file +var _0xc7ef=['xdr','exports','path','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','routing'];(function(_0x4c5728,_0x5b0308){var _0x1f7483=function(_0x186f78){while(--_0x186f78){_0x4c5728['push'](_0x4c5728['shift']());}};_0x1f7483(++_0x5b0308);}(_0xc7ef,0x136));var _0xfc7e=function(_0xde37a0,_0x485af8){_0xde37a0=_0xde37a0-0x0;var _0x58edcc=_0xc7ef[_0xde37a0];return _0x58edcc;};'use strict';var path=require(_0xfc7e('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xfc7e('0x1')](__dirname,_0xfc7e('0x2'))},{'name':_0xfc7e('0x3'),'script':path['join'](__dirname,_0xfc7e('0x4'))},{'name':_0xfc7e('0x5'),'script':path[_0xfc7e('0x1')](__dirname,_0xfc7e('0x6'))},{'name':'email','script':path[_0xfc7e('0x1')](__dirname,_0xfc7e('0x7'))},{'name':_0xfc7e('0x8'),'script':path[_0xfc7e('0x1')](__dirname,'../../services/routing/index.js')},{'name':_0xfc7e('0x9'),'script':path[_0xfc7e('0x1')](__dirname,'../../services/xdr/index.js')}]};module[_0xfc7e('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 98e42a9..82c606f 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 _0xa24e=['delete','dump','saved','bluebird','./config','connect','connected','start','disconnect','then','stop','restart','list','describe'];(function(_0x4d6205,_0x22086a){var _0x35693a=function(_0x490624){while(--_0x490624){_0x4d6205['push'](_0x4d6205['shift']());}};_0x35693a(++_0x22086a);}(_0xa24e,0x1c3));var _0xea24=function(_0x57ec62,_0x477fec){_0x57ec62=_0x57ec62-0x0;var _0x2bd069=_0xa24e[_0x57ec62];return _0x2bd069;};'use strict';var pm2=require('pm2');var BPromise=require(_0xea24('0x0'));var config=require(_0xea24('0x1'));function connect(){return new BPromise(function(_0x50214a,_0x4b079f){return pm2[_0xea24('0x2')](function(_0x1a406e){if(_0x1a406e){return _0x4b079f(_0x1a406e);}return _0x50214a(_0xea24('0x3'));});});};exports[_0xea24('0x4')]=function(_0x4e688d){return connect()['then'](function(){return new BPromise(function(_0x4d915d,_0x5a93f9){return pm2[_0xea24('0x4')](_0x4e688d,function(_0x532bb4,_0x1e1e87){if(_0x532bb4){return _0x5a93f9(_0x532bb4);}pm2[_0xea24('0x5')]();return _0x4d915d(_0x1e1e87);});});});};exports['stop']=function(_0x5f34f2){return connect()[_0xea24('0x6')](function(){return new BPromise(function(_0x28cdf6,_0x41faff){return pm2[_0xea24('0x7')](_0x5f34f2,function(_0x3874e3,_0x5db616){if(_0x3874e3){return _0x41faff(_0x3874e3);}pm2[_0xea24('0x5')]();return _0x28cdf6(_0x5db616);});});});};exports[_0xea24('0x8')]=function(_0x36b732){return connect()['then'](function(){return new BPromise(function(_0x5bc8f9,_0x46002f){return pm2[_0xea24('0x8')](_0x36b732,function(_0x165a39,_0x4dd483){if(_0x165a39){return _0x46002f(_0x165a39);}pm2['disconnect']();return _0x5bc8f9(_0x4dd483);});});});};exports['list']=function(){return connect()[_0xea24('0x6')](function(){return new BPromise(function(_0x3acf89,_0x491eb6){return pm2[_0xea24('0x9')](function(_0x353d99,_0x201d68){if(_0x353d99){return _0x491eb6(_0x353d99);}pm2[_0xea24('0x5')]();return _0x3acf89(_0x201d68);});});});};exports['describe']=function(_0xcfac86){return connect()[_0xea24('0x6')](function(){return new BPromise(function(_0x54d289,_0x2018ef){return pm2[_0xea24('0xa')](_0xcfac86,function(_0x1bb408,_0x326b14){if(_0x1bb408){return _0x2018ef(_0x1bb408);}pm2[_0xea24('0x5')]();return _0x54d289(_0x326b14);});});});};exports[_0xea24('0xb')]=function(_0x583969){return connect()['then'](function(){return new BPromise(function(_0x27061b,_0x89549a){return pm2[_0xea24('0xb')](_0x583969,function(_0x13f56f,_0x4cd42d){if(_0x13f56f){return _0x89549a(_0x13f56f);}pm2[_0xea24('0x5')]();return _0x27061b(_0x4cd42d);});});});};exports[_0xea24('0xc')]=function(){return connect()[_0xea24('0x6')](function(){return new BPromise(function(_0x49a33e,_0x52cd17){return pm2[_0xea24('0xc')](function(_0x2c980f){if(_0x2c980f){return _0x52cd17(_0x2c980f);}return _0x49a33e(_0xea24('0xd'));});});});}; \ No newline at end of file +var _0xde3f=['./config','connect','connected','start','then','disconnect','stop','restart','list','delete','dump','saved','bluebird'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xde3f,0x192));var _0xfde3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xde3f[_0x3b380d];return _0x54502b;};'use strict';var pm2=require('pm2');var BPromise=require(_0xfde3('0x0'));var config=require(_0xfde3('0x1'));function connect(){return new BPromise(function(_0x5197e7,_0xcdb72d){return pm2[_0xfde3('0x2')](function(_0x4080cc){if(_0x4080cc){return _0xcdb72d(_0x4080cc);}return _0x5197e7(_0xfde3('0x3'));});});};exports[_0xfde3('0x4')]=function(_0x5e2fe7){return connect()[_0xfde3('0x5')](function(){return new BPromise(function(_0xd8322b,_0x7cddea){return pm2[_0xfde3('0x4')](_0x5e2fe7,function(_0x5af87f,_0x2205f5){if(_0x5af87f){return _0x7cddea(_0x5af87f);}pm2[_0xfde3('0x6')]();return _0xd8322b(_0x2205f5);});});});};exports[_0xfde3('0x7')]=function(_0x59fe7b){return connect()[_0xfde3('0x5')](function(){return new BPromise(function(_0x33005c,_0x12aa7e){return pm2['stop'](_0x59fe7b,function(_0x252635,_0x3fb877){if(_0x252635){return _0x12aa7e(_0x252635);}pm2[_0xfde3('0x6')]();return _0x33005c(_0x3fb877);});});});};exports[_0xfde3('0x8')]=function(_0x4faee3){return connect()['then'](function(){return new BPromise(function(_0x57599a,_0x5c82ea){return pm2[_0xfde3('0x8')](_0x4faee3,function(_0x530236,_0x54393a){if(_0x530236){return _0x5c82ea(_0x530236);}pm2[_0xfde3('0x6')]();return _0x57599a(_0x54393a);});});});};exports[_0xfde3('0x9')]=function(){return connect()[_0xfde3('0x5')](function(){return new BPromise(function(_0x3128e6,_0xf6af8d){return pm2[_0xfde3('0x9')](function(_0xf8373,_0x2ab365){if(_0xf8373){return _0xf6af8d(_0xf8373);}pm2[_0xfde3('0x6')]();return _0x3128e6(_0x2ab365);});});});};exports['describe']=function(_0x475e37){return connect()['then'](function(){return new BPromise(function(_0x2d9f99,_0x380a4e){return pm2['describe'](_0x475e37,function(_0x4e467f,_0x3c530b){if(_0x4e467f){return _0x380a4e(_0x4e467f);}pm2[_0xfde3('0x6')]();return _0x2d9f99(_0x3c530b);});});});};exports[_0xfde3('0xa')]=function(_0x195925){return connect()[_0xfde3('0x5')](function(){return new BPromise(function(_0x3f6083,_0x3bf838){return pm2[_0xfde3('0xa')](_0x195925,function(_0x1b4bdc,_0x46ceaf){if(_0x1b4bdc){return _0x3bf838(_0x1b4bdc);}pm2[_0xfde3('0x6')]();return _0x3f6083(_0x46ceaf);});});});};exports[_0xfde3('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x249c4e,_0x579e3f){return pm2['dump'](function(_0xbcd902){if(_0xbcd902){return _0x579e3f(_0xbcd902);}return _0x249c4e(_0xfde3('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 0110bb6..842a838 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 _0x1b32=['length','map','[CHAT]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','moment','ioredis','util','../../config/environment','../logger','schedule','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','findAll','lastMsgAt','minutes','then'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x1b32,0x90));var _0x21b3=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x1b32[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require('lodash');var moment=require(_0x21b3('0x0'));var Redis=require(_0x21b3('0x1'));var util=require(_0x21b3('0x2'));var config=require(_0x21b3('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x21b3('0x4'))(_0x21b3('0x5'));config[_0x21b3('0x6')]=_['defaults'](config[_0x21b3('0x6')],{'host':_0x21b3('0x7'),'port':0x18eb});var io=require(_0x21b3('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x459bdd=0x0;var _0x3a7843=[];return db[_0x21b3('0x9')][_0x21b3('0xa')]({'raw':!![],'attributes':['id',_0x21b3('0xb')],'where':{'id':0x1}})['then'](function(_0xe0be31){_0x459bdd=_0xe0be31[_0x21b3('0xb')];if(_0x459bdd){return db['ChatInteraction'][_0x21b3('0xc')]({'raw':!![],'attributes':['id',_0x21b3('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0xe0be31[_0x21b3('0xb')],_0x21b3('0xe'))}}});}else{return[];}})[_0x21b3('0xf')](function(_0x3a5f55){if(_0x3a5f55&&_0x3a5f55[_0x21b3('0x10')]){_0x3a7843=_[_0x21b3('0x11')](_0x3a5f55||[],'id');logger['info'](_0x21b3('0x12'),_0x3a7843['join']());return db['ChatInteraction'][_0x21b3('0x13')]({'closeReason':_0x21b3('0x14'),'disposition':_0x21b3('0x15'),'closed':!![],'closedAt':moment()[_0x21b3('0x16')](_0x21b3('0x17'))},{'where':{'id':_0x3a7843}});}})[_0x21b3('0xf')](function(){if(_0x3a7843&&_0x3a7843[_0x21b3('0x10')]){logger[_0x21b3('0x18')](_0x21b3('0x19'),_0x3a7843[_0x21b3('0x1a')]());for(var _0x53f3ee=0x0;_0x53f3ee<_0x3a7843[_0x21b3('0x10')];_0x53f3ee++){io[_0x21b3('0x1b')]('chatInteraction:update',{'id':_0x3a7843[_0x53f3ee],'closed':!![]});}}})[_0x21b3('0x1c')](function(_0x3b0e88){logger[_0x21b3('0x1d')](_0x21b3('0x1e'),_0x3b0e88?util[_0x21b3('0x1f')](_0x3b0e88,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x234a=['then','findAll','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','ioredis','../../mysqldb','../logger','schedule','redis','socket.io-emitter','Setting','find','chatTimeout'];(function(_0x5f2388,_0x298a83){var _0x4893a0=function(_0x19ef41){while(--_0x19ef41){_0x5f2388['push'](_0x5f2388['shift']());}};_0x4893a0(++_0x298a83);}(_0x234a,0x105));var _0xa234=function(_0x102826,_0x35f7b9){_0x102826=_0x102826-0x0;var _0x57556e=_0x234a[_0x102826];return _0x57556e;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0xa234('0x0'));var util=require('util');var config=require('../../config/environment');var db=require(_0xa234('0x1'))['db'];var logger=require(_0xa234('0x2'))(_0xa234('0x3'));config[_0xa234('0x4')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa234('0x5'))(new Redis(config['redis']));function closeInteractions(){var _0x248cef=0x0;var _0x344046=[];return db[_0xa234('0x6')][_0xa234('0x7')]({'raw':!![],'attributes':['id',_0xa234('0x8')],'where':{'id':0x1}})[_0xa234('0x9')](function(_0x283864){_0x248cef=_0x283864['chatTimeout'];if(_0x248cef){return db['ChatInteraction'][_0xa234('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa234('0xb')](_0x283864[_0xa234('0x8')],_0xa234('0xc'))}}});}else{return[];}})[_0xa234('0x9')](function(_0x21d2d){if(_0x21d2d&&_0x21d2d[_0xa234('0xd')]){_0x344046=_[_0xa234('0xe')](_0x21d2d||[],'id');logger[_0xa234('0xf')](_0xa234('0x10'),_0x344046[_0xa234('0x11')]());return db[_0xa234('0x12')][_0xa234('0x13')]({'closeReason':_0xa234('0x14'),'disposition':_0xa234('0x15'),'closed':!![],'closedAt':moment()[_0xa234('0x16')](_0xa234('0x17'))},{'where':{'id':_0x344046}});}})[_0xa234('0x9')](function(){if(_0x344046&&_0x344046[_0xa234('0xd')]){logger['info'](_0xa234('0x18'),_0x344046[_0xa234('0x11')]());for(var _0x597898=0x0;_0x597898<_0x344046['length'];_0x597898++){io[_0xa234('0x19')]('chatInteraction:update',{'id':_0x344046[_0x597898],'closed':!![]});}}})[_0xa234('0x1a')](function(_0x48f02f){logger['error'](_0xa234('0x1b'),_0x48f02f?util[_0xa234('0x1c')](_0x48f02f,{'showHidden':![],'depth':null}):'');});}exports[_0xa234('0x1d')]=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 8925b23..c112013 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 _0x3a8b=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x397c8d,_0xf0a1a4){var _0x1c5b0a=function(_0x4585d8){while(--_0x4585d8){_0x397c8d['push'](_0x397c8d['shift']());}};_0x1c5b0a(++_0xf0a1a4);}(_0x3a8b,0xa2));var _0xb3a8=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x3a8b[_0x2dadb9];return _0x2f0097;};'use strict';function start(){var _0x3e272f=require(_0xb3a8('0x0'));return _0x3e272f[_0xb3a8('0x1')]();}module[_0xb3a8('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x7663=['../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x440a10,_0x387d7e){var _0x267380=function(_0x44c24e){while(--_0x44c24e){_0x440a10['push'](_0x440a10['shift']());}};_0x267380(++_0x387d7e);}(_0x7663,0x66));var _0x3766=function(_0x3eacea,_0x39edee){_0x3eacea=_0x3eacea-0x0;var _0x1bb21f=_0x7663[_0x3eacea];return _0x1bb21f;};'use strict';function start(){var _0x2bea5b=require(_0x3766('0x0'));return _0x2bea5b['startAllRefreshIntervals']();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 43c3d55..4cde627 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 _0x6800=['index','run\x20job','active','startAt','endAt','add','start','add\x20cron','cron','stop','stop\x20cron','isBetween','update','update\x20cron','run','util','path','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','Smtp','user','format','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','zip','join','existsSync','status','Sent','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','SendMail','then','error','error\x20mail','catch','data','email','isNil','subtractNumber\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','deleteJob','delete\x20cron','toRun'];(function(_0x14996e,_0x108636){var _0x2f0151=function(_0x20dd91){while(--_0x20dd91){_0x14996e['push'](_0x14996e['shift']());}};_0x2f0151(++_0x108636);}(_0x6800,0x15f));var _0x0680=function(_0x587b10,_0x3c6c79){_0x587b10=_0x587b10-0x0;var _0x32c539=_0x6800[_0x587b10];return _0x32c539;};'use strict';var fs=require('fs');var util=require(_0x0680('0x0'));var path=require(_0x0680('0x1'));var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0x0680('0x2'));var jayson=require(_0x0680('0x3'));var BPromise=require(_0x0680('0x4'));var logger=require(_0x0680('0x5'))(_0x0680('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x0680('0x7'));var analyticDefaultReportController=require(_0x0680('0x8'));var client=jayson[_0x0680('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4ebb1c,_0x18798a){return function(){logger[_0x0680('0xa')](_0x0680('0xb'),_0x4ebb1c['email']);var _0x45fe91=!![];var _0x5a6049=_0x4ebb1c[_0x0680('0xc')][_0x0680('0xd')]();var _0x5e95d7={'account':_0x5a6049,'message':{'from':util['format'](_0x0680('0xe'),_0x4ebb1c[_0x0680('0xc')][_0x0680('0xf')],_0x4ebb1c['MailAccount']['email']||_0x4ebb1c['MailAccount'][_0x0680('0x10')][_0x0680('0x11')]),'to':_0x4ebb1c['email'],'cc':_0x4ebb1c['cc'],'bcc':_0x4ebb1c['bcc'],'subject':util[_0x0680('0x12')]('Report\x20%s\x20last\x20%s\x20%s',_0x18798a['name'],_0x4ebb1c[_0x0680('0x13')],_0x4ebb1c[_0x0680('0x14')])}};var _0x1baad0=path['join'](__dirname,_0x0680('0x15'));var _0x2d8418=_0x18798a[_0x0680('0x16')];var _0x25acc2=util['format'](_0x0680('0x17'),path['basename'](_0x18798a[_0x0680('0x16')],path['extname'](_0x18798a[_0x0680('0x16')])),_0x0680('0x18'));var _0x2b4953=path[_0x0680('0x19')](_0x1baad0,_0x2d8418);var _0x543361=path[_0x0680('0x19')](_0x1baad0,_0x25acc2);if(fs[_0x0680('0x1a')](_0x2b4953)){_0x18798a[_0x0680('0x1b')]=_0x0680('0x1c');_0x5e95d7['message'][_0x0680('0x1d')]=[{'filename':_0x2d8418,'path':_0x2b4953}];_0x5e95d7[_0x0680('0x1e')][_0x0680('0x1f')]=util[_0x0680('0x12')](_0x0680('0x20'),JSON[_0x0680('0x21')](_0x18798a,null,0x2));}else if(fs[_0x0680('0x1a')](_0x543361)){_0x18798a['status']=_0x0680('0x1c');_0x5e95d7['message'][_0x0680('0x1d')]=[{'filename':_0x25acc2,'path':_0x543361}];}else{_0x5e95d7[_0x0680('0x1e')]['text']=_0x0680('0x22');if(!_0x4ebb1c[_0x0680('0x23')]){_0x45fe91=![];logger['info'](_0x0680('0x24'));}}if(_0x45fe91){return client[_0x0680('0x25')](_0x0680('0x26'),_0x5e95d7)[_0x0680('0x27')](function(_0x1b9541){if(_0x1b9541[_0x0680('0x28')]){return logger[_0x0680('0x28')](_0x0680('0x29'),JSON['stringify'](_0x1b9541));}return logger['info']('email\x20sent');})[_0x0680('0x2a')](function(_0x1dfe60){return logger['error'](_0x0680('0x29'),JSON[_0x0680('0x21')](_0x1dfe60));});}};}function handleError(){return function(_0x5d7fd9){return logger[_0x0680('0x28')](JSON[_0x0680('0x21')](_0x5d7fd9));};}function handleResult(_0x3057e8){return function(_0xfe8313){logger[_0x0680('0xa')](_0x0680('0x2b'),JSON[_0x0680('0x21')](_0xfe8313));if(_0x3057e8[_0x0680('0xc')]&&_0x3057e8['MailAccount'][_0x0680('0x10')]&&!_['isNil'](_0x3057e8[_0x0680('0x2c')])){setTimeout(handleSendEmail(_0x3057e8,_0xfe8313),0x3c*0x3e8);}};}function handleJob(_0x1dbf50){return function(){try{if(_[_0x0680('0x2d')](_0x1dbf50[_0x0680('0x13')])){return logger[_0x0680('0xa')](_0x0680('0x2e'));}if(_[_0x0680('0x2d')](_0x1dbf50[_0x0680('0x14')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x516a6d={'startDate':moment()['subtract'](_0x1dbf50[_0x0680('0x13')],_0x1dbf50['subtractUnit'])[_0x0680('0x12')](_0x0680('0x2f')),'endDate':moment()['format'](_0x0680('0x2f')),'type':_0x0680('0x30'),'output':_0x1dbf50[_0x0680('0x31')],'name':_0x1dbf50[_0x0680('0xf')]};if(!_[_0x0680('0x2d')](_0x1dbf50[_0x0680('0x32')])){logger[_0x0680('0xa')](_0x0680('0x33'),_0x1dbf50[_0x0680('0x32')]);return analyticDefaultReportController[_0x0680('0x34')]({'id':_0x1dbf50[_0x0680('0x32')]},_0x516a6d)[_0x0680('0x27')](handleResult(_0x1dbf50))[_0x0680('0x2a')](handleError());}if(!_[_0x0680('0x2d')](_0x1dbf50['CustomReportId'])){logger[_0x0680('0xa')](_0x0680('0x35'),_0x1dbf50[_0x0680('0x36')]);return analyticCustomReportController[_0x0680('0x34')]({'id':_0x1dbf50['CustomReportId']},_0x516a6d)['then'](handleResult(_0x1dbf50))[_0x0680('0x2a')](handleError());}}catch(_0x4aecd1){logger[_0x0680('0x28')](JSON['stringify'](_0x4aecd1));}return logger[_0x0680('0xa')](_0x0680('0x37'));};}function getJobs(_0xc733c8){var _0x539a71={};if(_0xc733c8){_0x539a71['id']=_0xc733c8;}return db['Schedule']['findAll']({'where':_0x539a71,'include':[{'model':db[_0x0680('0xc')],'attributes':['id',_0x0680('0xf'),_0x0680('0x2c')],'include':[{'model':db['MailServerOut'],'as':_0x0680('0x10'),'include':[{'model':db[_0x0680('0x38')],'as':_0x0680('0x38')}]}]}]})['then'](function(_0x4f7e4d){var _0x3c1091=_[_0x0680('0x39')](manager[_0x0680('0x3a')]);var _0x576146=_[_0x0680('0x3b')](_0x4f7e4d,function(_0x4e3ee4){return _0x4e3ee4['id'][_0x0680('0x3c')]();});var _0x3379bd=_[_0x0680('0x3d')](_0x4f7e4d,function(_0x536b5e){return _0x536b5e['id'][_0x0680('0x3c')]();});var _0x35e34b=_0xc733c8?_0x576146:_[_0x0680('0x3e')](_0x576146,_0x3c1091);var _0x937f9c=_[_0x0680('0x3f')](_0x576146,_0x3c1091);var _0x3695fa=_[_0x0680('0x3e')](_0x3c1091,_0x576146);var _0x5a9d41;var _0x22630b;for(_0x5a9d41=0x0;_0x5a9d41<_0x3695fa[_0x0680('0x40')]&&!_0xc733c8;_0x5a9d41+=0x1){_0x22630b=_0x3695fa[_0x5a9d41][_0x0680('0x3c')]();if(manager[_0x0680('0x41')](_0x22630b)){manager['stop'](_0x22630b);manager[_0x0680('0x42')](_0x22630b);logger[_0x0680('0xa')](_0x0680('0x43'),_0x22630b);}}logger[_0x0680('0xa')](_0x0680('0x44'),JSON[_0x0680('0x21')](_0x35e34b));for(_0x5a9d41=0x0;_0x5a9d41<_0x35e34b['length'];_0x5a9d41+=0x1){_0x22630b=_0x35e34b[_0x5a9d41][_0x0680('0x3c')]();logger[_0x0680('0xa')](_0x0680('0x45'),_0x22630b);if(_0xc733c8){logger[_0x0680('0xa')]('my\x20id',_0xc733c8);logger[_0x0680('0xa')](JSON[_0x0680('0x21')](_0x3379bd[_0x22630b]));BPromise['resolve']()[_0x0680('0x27')](handleJob(_0x3379bd[_0x22630b]));logger[_0x0680('0xa')](_0x0680('0x46'),_0x3379bd[_0x22630b][_0x0680('0xf')],_0x3379bd[_0x22630b]['cron']);}else if(_0x3379bd[_0x22630b]['cron']&&_0x3379bd[_0x22630b][_0x0680('0x47')]&&moment()['isBetween'](_0x3379bd[_0x22630b][_0x0680('0x48')],_0x3379bd[_0x22630b][_0x0680('0x49')])){manager[_0x0680('0x4a')](_0x22630b,_0x3379bd[_0x22630b]['cron'],handleJob(_0x3379bd[_0x22630b]));manager[_0x0680('0x4b')](_0x22630b);logger[_0x0680('0xa')](_0x0680('0x4c'),_0x3379bd[_0x22630b][_0x0680('0xf')],_0x3379bd[_0x22630b][_0x0680('0x4d')]);}else if(manager[_0x0680('0x41')](_0x22630b)){manager[_0x0680('0x4e')](_0x22630b);manager[_0x0680('0x42')](_0x22630b);logger[_0x0680('0xa')](_0x0680('0x4f'),_0x3379bd[_0x22630b][_0x0680('0xf')],_0x3379bd[_0x22630b][_0x0680('0x4d')]);}}for(_0x5a9d41=0x0,_0x22630b;_0x5a9d41<_0x937f9c[_0x0680('0x40')]&&!_0xc733c8;_0x5a9d41+=0x1){_0x22630b=_0x937f9c[_0x5a9d41]['toString']();if(manager[_0x0680('0x41')](_0x22630b)){if(_0x3379bd[_0x22630b]['cron']&&_0x3379bd[_0x22630b][_0x0680('0x47')]&&moment()[_0x0680('0x50')](_0x3379bd[_0x22630b][_0x0680('0x48')],_0x3379bd[_0x22630b][_0x0680('0x49')])){manager[_0x0680('0x51')](_0x22630b,_0x3379bd[_0x22630b][_0x0680('0x4d')],handleJob(_0x3379bd[_0x22630b]));logger['info'](_0x0680('0x52'),_0x3379bd[_0x22630b][_0x0680('0xf')],_0x3379bd[_0x22630b]['cron']);}else{manager[_0x0680('0x4e')](_0x22630b);manager['deleteJob'](_0x22630b);logger[_0x0680('0xa')](_0x0680('0x4f'),_0x3379bd[_0x22630b][_0x0680('0xf')],_0x3379bd[_0x22630b][_0x0680('0x4d')]);}}}})['catch'](function(_0x1b62e5){logger['error'](JSON[_0x0680('0x21')](_0x1b62e5));});}exports[_0x0680('0x53')]=function(_0x1604db){return getJobs(_0x1604db);};exports[_0x0680('0x4b')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x4eac=['Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','name','DefaultReportId','runReport','then','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','toRun','index','my\x20id','resolve','run\x20job','cron','endAt','start','add\x20cron','active','startAt','update','update\x20cron','util','path','moment','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','Smtp','user','subtractNumber','subtractUnit','join','%s.%s','basename','savename','extname','existsSync','status','message','format','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','text'];(function(_0x114ad3,_0x137d22){var _0x103855=function(_0x4b3e5a){while(--_0x4b3e5a){_0x114ad3['push'](_0x114ad3['shift']());}};_0x103855(++_0x137d22);}(_0x4eac,0x167));var _0xc4ea=function(_0xa33eed,_0x563922){_0xa33eed=_0xa33eed-0x0;var _0x505f5d=_0x4eac[_0xa33eed];return _0x505f5d;};'use strict';var fs=require('fs');var util=require(_0xc4ea('0x0'));var path=require(_0xc4ea('0x1'));var _=require('lodash');var moment=require(_0xc4ea('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0xc4ea('0x3'));var logger=require(_0xc4ea('0x4'))(_0xc4ea('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xc4ea('0x6'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xc4ea('0x7')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x57cc60,_0x1ee722){return function(){logger[_0xc4ea('0x8')](_0xc4ea('0x9'),_0x57cc60[_0xc4ea('0xa')]);var _0x4cdaa1=!![];var _0x266d95=_0x57cc60[_0xc4ea('0xb')][_0xc4ea('0xc')]();var _0x4efa34={'account':_0x266d95,'message':{'from':util['format'](_0xc4ea('0xd'),_0x57cc60[_0xc4ea('0xb')]['name'],_0x57cc60[_0xc4ea('0xb')][_0xc4ea('0xa')]||_0x57cc60['MailAccount'][_0xc4ea('0xe')][_0xc4ea('0xf')]),'to':_0x57cc60[_0xc4ea('0xa')],'cc':_0x57cc60['cc'],'bcc':_0x57cc60['bcc'],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x1ee722['name'],_0x57cc60[_0xc4ea('0x10')],_0x57cc60[_0xc4ea('0x11')])}};var _0x56933c=path[_0xc4ea('0x12')](__dirname,'../../files/reports');var _0x5b1a10=_0x1ee722['savename'];var _0x3a7da1=util['format'](_0xc4ea('0x13'),path[_0xc4ea('0x14')](_0x1ee722[_0xc4ea('0x15')],path[_0xc4ea('0x16')](_0x1ee722[_0xc4ea('0x15')])),'zip');var _0x157f5a=path[_0xc4ea('0x12')](_0x56933c,_0x5b1a10);var _0x2dbb1c=path[_0xc4ea('0x12')](_0x56933c,_0x3a7da1);if(fs[_0xc4ea('0x17')](_0x157f5a)){_0x1ee722[_0xc4ea('0x18')]='Sent';_0x4efa34[_0xc4ea('0x19')]['attachments']=[{'filename':_0x5b1a10,'path':_0x157f5a}];_0x4efa34[_0xc4ea('0x19')]['text']=util[_0xc4ea('0x1a')](_0xc4ea('0x1b'),JSON[_0xc4ea('0x1c')](_0x1ee722,null,0x2));}else if(fs[_0xc4ea('0x17')](_0x2dbb1c)){_0x1ee722['status']=_0xc4ea('0x1d');_0x4efa34[_0xc4ea('0x19')]['attachments']=[{'filename':_0x3a7da1,'path':_0x2dbb1c}];}else{_0x4efa34['message'][_0xc4ea('0x1e')]=_0xc4ea('0x1f');if(!_0x57cc60[_0xc4ea('0x20')]){_0x4cdaa1=![];logger[_0xc4ea('0x8')](_0xc4ea('0x21'));}}if(_0x4cdaa1){return client[_0xc4ea('0x22')](_0xc4ea('0x23'),_0x4efa34)['then'](function(_0x37cb37){if(_0x37cb37[_0xc4ea('0x24')]){return logger[_0xc4ea('0x24')](_0xc4ea('0x25'),JSON['stringify'](_0x37cb37));}return logger[_0xc4ea('0x8')](_0xc4ea('0x26'));})['catch'](function(_0x237d38){return logger[_0xc4ea('0x24')](_0xc4ea('0x25'),JSON[_0xc4ea('0x1c')](_0x237d38));});}};}function handleError(){return function(_0xfd5eb0){return logger['error'](JSON[_0xc4ea('0x1c')](_0xfd5eb0));};}function handleResult(_0x5cd34a){return function(_0x394312){logger[_0xc4ea('0x8')](_0xc4ea('0x27'),JSON['stringify'](_0x394312));if(_0x5cd34a['MailAccount']&&_0x5cd34a['MailAccount'][_0xc4ea('0xe')]&&!_[_0xc4ea('0x28')](_0x5cd34a[_0xc4ea('0xa')])){setTimeout(handleSendEmail(_0x5cd34a,_0x394312),0x3c*0x3e8);}};}function handleJob(_0x456ca4){return function(){try{if(_['isNil'](_0x456ca4['subtractNumber'])){return logger[_0xc4ea('0x8')](_0xc4ea('0x29'));}if(_['isNil'](_0x456ca4[_0xc4ea('0x11')])){return logger[_0xc4ea('0x8')](_0xc4ea('0x2a'));}var _0x2d1e90={'startDate':moment()[_0xc4ea('0x2b')](_0x456ca4[_0xc4ea('0x10')],_0x456ca4[_0xc4ea('0x11')])[_0xc4ea('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xc4ea('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x456ca4['output'],'name':_0x456ca4[_0xc4ea('0x2c')]};if(!_['isNil'](_0x456ca4[_0xc4ea('0x2d')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x456ca4[_0xc4ea('0x2d')]);return analyticDefaultReportController[_0xc4ea('0x2e')]({'id':_0x456ca4['DefaultReportId']},_0x2d1e90)[_0xc4ea('0x2f')](handleResult(_0x456ca4))['catch'](handleError());}if(!_[_0xc4ea('0x28')](_0x456ca4['CustomReportId'])){logger[_0xc4ea('0x8')](_0xc4ea('0x30'),_0x456ca4[_0xc4ea('0x31')]);return analyticCustomReportController['runReport']({'id':_0x456ca4[_0xc4ea('0x31')]},_0x2d1e90)['then'](handleResult(_0x456ca4))['catch'](handleError());}}catch(_0x3d69a0){logger[_0xc4ea('0x24')](JSON[_0xc4ea('0x1c')](_0x3d69a0));}return logger[_0xc4ea('0x8')](_0xc4ea('0x32'));};}function getJobs(_0x5543d5){var _0xab2180={};if(_0x5543d5){_0xab2180['id']=_0x5543d5;}return db[_0xc4ea('0x33')][_0xc4ea('0x34')]({'where':_0xab2180,'include':[{'model':db['MailAccount'],'attributes':['id',_0xc4ea('0x2c'),'email'],'include':[{'model':db[_0xc4ea('0x35')],'as':_0xc4ea('0xe'),'include':[{'model':db[_0xc4ea('0x36')],'as':'CloudProvider'}]}]}]})[_0xc4ea('0x2f')](function(_0x1085eb){var _0xd288ba=_[_0xc4ea('0x37')](manager[_0xc4ea('0x38')]);var _0x188bfa=_['map'](_0x1085eb,function(_0x571569){return _0x571569['id'][_0xc4ea('0x39')]();});var _0x4f46f3=_[_0xc4ea('0x3a')](_0x1085eb,function(_0x449afa){return _0x449afa['id']['toString']();});var _0x1b549c=_0x5543d5?_0x188bfa:_[_0xc4ea('0x3b')](_0x188bfa,_0xd288ba);var _0x1cc397=_[_0xc4ea('0x3c')](_0x188bfa,_0xd288ba);var _0x43d62f=_[_0xc4ea('0x3b')](_0xd288ba,_0x188bfa);var _0x27c558;var _0x34e1a7;for(_0x27c558=0x0;_0x27c558<_0x43d62f[_0xc4ea('0x3d')]&&!_0x5543d5;_0x27c558+=0x1){_0x34e1a7=_0x43d62f[_0x27c558][_0xc4ea('0x39')]();if(manager[_0xc4ea('0x3e')](_0x34e1a7)){manager[_0xc4ea('0x3f')](_0x34e1a7);manager[_0xc4ea('0x40')](_0x34e1a7);logger[_0xc4ea('0x8')]('delete\x20cron',_0x34e1a7);}}logger['info'](_0xc4ea('0x41'),JSON['stringify'](_0x1b549c));for(_0x27c558=0x0;_0x27c558<_0x1b549c[_0xc4ea('0x3d')];_0x27c558+=0x1){_0x34e1a7=_0x1b549c[_0x27c558][_0xc4ea('0x39')]();logger[_0xc4ea('0x8')](_0xc4ea('0x42'),_0x34e1a7);if(_0x5543d5){logger[_0xc4ea('0x8')](_0xc4ea('0x43'),_0x5543d5);logger['info'](JSON[_0xc4ea('0x1c')](_0x4f46f3[_0x34e1a7]));BPromise[_0xc4ea('0x44')]()[_0xc4ea('0x2f')](handleJob(_0x4f46f3[_0x34e1a7]));logger['info'](_0xc4ea('0x45'),_0x4f46f3[_0x34e1a7]['name'],_0x4f46f3[_0x34e1a7][_0xc4ea('0x46')]);}else if(_0x4f46f3[_0x34e1a7]['cron']&&_0x4f46f3[_0x34e1a7]['active']&&moment()['isBetween'](_0x4f46f3[_0x34e1a7]['startAt'],_0x4f46f3[_0x34e1a7][_0xc4ea('0x47')])){manager['add'](_0x34e1a7,_0x4f46f3[_0x34e1a7][_0xc4ea('0x46')],handleJob(_0x4f46f3[_0x34e1a7]));manager[_0xc4ea('0x48')](_0x34e1a7);logger[_0xc4ea('0x8')](_0xc4ea('0x49'),_0x4f46f3[_0x34e1a7][_0xc4ea('0x2c')],_0x4f46f3[_0x34e1a7][_0xc4ea('0x46')]);}else if(manager['exists'](_0x34e1a7)){manager[_0xc4ea('0x3f')](_0x34e1a7);manager[_0xc4ea('0x40')](_0x34e1a7);logger[_0xc4ea('0x8')]('stop\x20cron',_0x4f46f3[_0x34e1a7][_0xc4ea('0x2c')],_0x4f46f3[_0x34e1a7]['cron']);}}for(_0x27c558=0x0,_0x34e1a7;_0x27c558<_0x1cc397[_0xc4ea('0x3d')]&&!_0x5543d5;_0x27c558+=0x1){_0x34e1a7=_0x1cc397[_0x27c558][_0xc4ea('0x39')]();if(manager[_0xc4ea('0x3e')](_0x34e1a7)){if(_0x4f46f3[_0x34e1a7]['cron']&&_0x4f46f3[_0x34e1a7][_0xc4ea('0x4a')]&&moment()['isBetween'](_0x4f46f3[_0x34e1a7][_0xc4ea('0x4b')],_0x4f46f3[_0x34e1a7]['endAt'])){manager[_0xc4ea('0x4c')](_0x34e1a7,_0x4f46f3[_0x34e1a7][_0xc4ea('0x46')],handleJob(_0x4f46f3[_0x34e1a7]));logger[_0xc4ea('0x8')](_0xc4ea('0x4d'),_0x4f46f3[_0x34e1a7][_0xc4ea('0x2c')],_0x4f46f3[_0x34e1a7][_0xc4ea('0x46')]);}else{manager['stop'](_0x34e1a7);manager[_0xc4ea('0x40')](_0x34e1a7);logger[_0xc4ea('0x8')]('stop\x20cron',_0x4f46f3[_0x34e1a7][_0xc4ea('0x2c')],_0x4f46f3[_0x34e1a7][_0xc4ea('0x46')]);}}}})['catch'](function(_0x47923b){logger[_0xc4ea('0x24')](JSON[_0xc4ea('0x1c')](_0x47923b));});}exports['run']=function(_0x2528bd){return getJobs(_0x2528bd);};exports[_0xc4ea('0x48')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index b776033..82ecf8f 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 _0x8a5c=['VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','format','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','FAILED','FailureReason','resolve','sentiment','Positive','Mixed','Neutral','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect'];(function(_0xf07b75,_0xe27080){var _0x291ae9=function(_0x363b2a){while(--_0x363b2a){_0xf07b75['push'](_0xf07b75['shift']());}};_0x291ae9(++_0xe27080);}(_0x8a5c,0x136));var _0xc8a5=function(_0x2bfae6,_0x335d23){_0x2bfae6=_0x2bfae6-0x0;var _0x19209a=_0x8a5c[_0x2bfae6];return _0x19209a;};var _=require(_0xc8a5('0x0'));var AWS=require(_0xc8a5('0x1'));var rp=require(_0xc8a5('0x2'));var util=require(_0xc8a5('0x3'));var BPromise=require(_0xc8a5('0x4'));var db=require(_0xc8a5('0x5'))['db'];var logger=require(_0xc8a5('0x6'))(_0xc8a5('0x7'));function getTranscriptionJob(_0x84a3f4,_0x4dd6e0,_0x2b253c,_0x66b54){return new Promise(function(_0x5b6cc2,_0x1b4ed4){var _0xcee97e=new AWS[(_0xc8a5('0x8'))]({'accessKeyId':_0x4dd6e0,'secretAccessKey':_0x84a3f4,'region':_0x2b253c});_0xcee97e[_0xc8a5('0x9')]({'TranscriptionJobName':_0x66b54},function(_0x4d25e4,_0x3ecf08){if(_0x4d25e4){return _0x1b4ed4(_0x4d25e4);}else{return _0x5b6cc2(_0x3ecf08);}});});}function sentiment(_0x28529d,_0xbdcd79,_0x2c1fe9,_0x814714,_0x3b2ba3){return new Promise(function(_0x136146,_0x16fd9a){var _0xea6d98=new AWS['Comprehend']({'accessKeyId':_0xbdcd79,'secretAccessKey':_0x28529d,'region':_0x2c1fe9});_0xea6d98['detectSentiment']({'Text':_0x814714,'LanguageCode':_0x3b2ba3[_0xc8a5('0xa')](0x0,0x2)},function(_0x4a772e,_0xaa6fa2){if(_0x4a772e){return _0x16fd9a(_0x4a772e);}else{return _0x136146(_0xaa6fa2);}});});}function checkTranscribeJob(_0x38a605,_0x1295a9,_0x2c6402){var _0x3e1b4f;return new BPromise(function(_0x5c9d13,_0x16cffa){logger[_0xc8a5('0xb')](util['format'](_0xc8a5('0xc'),_0x38a605['id'],_0x38a605[_0xc8a5('0xd')]));return getTranscriptionJob(_0x2c6402[_0xc8a5('0xe')],_0x2c6402[_0xc8a5('0xf')],_0x1295a9[_0xc8a5('0x10')],_0x38a605[_0xc8a5('0xd')])['then'](function(_0xbc4806){logger[_0xc8a5('0xb')](util['format'](_0xc8a5('0x11'),_0x38a605['id'],_0x38a605[_0xc8a5('0xd')],_0xbc4806['TranscriptionJob'][_0xc8a5('0x12')]));if(!_0x38a605[_0xc8a5('0x13')]){switch(_0xbc4806[_0xc8a5('0x14')][_0xc8a5('0x12')]){case _0xc8a5('0x15'):var _0x4b0aa0={'transcribeStatus':_0xbc4806[_0xc8a5('0x14')]['TranscriptionJobStatus'],'fileUri':_0xbc4806[_0xc8a5('0x14')][_0xc8a5('0x16')]['TranscriptFileUri']};logger['info'](util[_0xc8a5('0x17')](_0xc8a5('0x18'),_0x38a605['id']));return rp({'uri':_0xbc4806[_0xc8a5('0x14')][_0xc8a5('0x16')][_0xc8a5('0x19')],'json':!![]})['then'](function(_0x4fec79){logger[_0xc8a5('0xb')](util[_0xc8a5('0x17')](_0xc8a5('0x1a'),_0x38a605['id']));if(_0x4fec79&&_0x4fec79[_0xc8a5('0x1b')]&&_0x4fec79[_0xc8a5('0x1b')][_0xc8a5('0x1c')]&&_0x4fec79['results'][_0xc8a5('0x1c')][_0xc8a5('0x1d')]){_0x4b0aa0[_0xc8a5('0x13')]='';for(var _0x1e522c=0x0;_0x1e522c<_0x4fec79[_0xc8a5('0x1b')][_0xc8a5('0x1c')][_0xc8a5('0x1d')];_0x1e522c++){_0x4b0aa0[_0xc8a5('0x13')]+=_0x4fec79[_0xc8a5('0x1b')]['transcripts'][_0x1e522c][_0xc8a5('0x1e')]+'';}}return _0x38a605[_0xc8a5('0x1f')](_0x4b0aa0);})[_0xc8a5('0x20')](function(){logger[_0xc8a5('0xb')](util[_0xc8a5('0x17')](_0xc8a5('0x21'),_0x38a605['id']));if(!_0x38a605[_0xc8a5('0x22')]){throw new db['Sequelize']['ValidationError'](_0xc8a5('0x23'));}if(!_0x1295a9['sentiment']||!_0x1295a9['sentimentAccountId']||!_0x1295a9[_0xc8a5('0x24')]||!_0x1295a9[_0xc8a5('0x25')]||!_0x1295a9[_0xc8a5('0x26')]){throw new db[(_0xc8a5('0x27'))][(_0xc8a5('0x28'))](_0xc8a5('0x29'));}if(!_0x4b0aa0['fileText']){throw new Error(_0xc8a5('0x2a'));}if(_0x1295a9[_0xc8a5('0x2b')]===_0x2c6402['id']){return _0x2c6402;}else{return db[_0xc8a5('0x2c')][_0xc8a5('0x2d')]({'where':{'id':_settings[_0xc8a5('0x2b')]}});}})[_0xc8a5('0x20')](function(_0x4b47dc){if(!_0x4b47dc){throw new db[(_0xc8a5('0x27'))][(_0xc8a5('0x28'))](_0xc8a5('0x2e'));}if(!_0x4b47dc[_0xc8a5('0xe')]||!_0x4b47dc['data2']){throw new db['Sequelize'][(_0xc8a5('0x28'))](_0xc8a5('0x2f'));}_0x3e1b4f=_0x4b47dc;logger[_0xc8a5('0xb')](util[_0xc8a5('0x17')](_0xc8a5('0x30'),_0x38a605['id']));return sentiment(_0x3e1b4f['data1'],_0x3e1b4f[_0xc8a5('0xf')],_0x1295a9['sentimentRegion'],_0x4b0aa0[_0xc8a5('0x13')],_0x1295a9[_0xc8a5('0x25')]);})[_0xc8a5('0x20')](function(_0x5a2941){logger[_0xc8a5('0xb')](util[_0xc8a5('0x17')](_0xc8a5('0x31'),_0x38a605['id']));return _0x38a605['update']({'sentiment':_0x5a2941[_0xc8a5('0x32')],'sPositive':_0x5a2941[_0xc8a5('0x33')]['Positive'],'sNegative':_0x5a2941[_0xc8a5('0x33')]['Negative'],'sMixed':_0x5a2941['SentimentScore']['Mixed'],'sNeutral':_0x5a2941['SentimentScore']['Neutral']});})[_0xc8a5('0x20')](function(){logger['info'](util[_0xc8a5('0x17')](_0xc8a5('0x21'),_0x38a605['id']));_0x5c9d13();});case _0xc8a5('0x34'):return _0x38a605[_0xc8a5('0x1f')]({'transcribeStatus':_0xc8a5('0x34'),'failureReason':_0xbc4806[_0xc8a5('0x14')][_0xc8a5('0x35')]})['then'](function(){logger[_0xc8a5('0xb')](util[_0xc8a5('0x17')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x38a605['id']));_0x5c9d13();});default:logger[_0xc8a5('0xb')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x38a605['id']));break;}}else{return BPromise[_0xc8a5('0x36')]()[_0xc8a5('0x20')](function(){if(!_0x38a605[_0xc8a5('0x22')]){throw new db['Sequelize']['ValidationError'](_0xc8a5('0x23'));}if(!_0x1295a9[_0xc8a5('0x37')]||!_0x1295a9[_0xc8a5('0x2b')]||!_0x1295a9[_0xc8a5('0x24')]||!_0x1295a9['language']||!_0x1295a9[_0xc8a5('0x26')]){throw new db[(_0xc8a5('0x27'))][(_0xc8a5('0x28'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x38a605['fileText']){throw new Error(_0xc8a5('0x2a'));}if(_0x1295a9[_0xc8a5('0x2b')]===_0x2c6402['id']){return _0x2c6402;}else{return db[_0xc8a5('0x2c')][_0xc8a5('0x2d')]({'where':{'id':_settings[_0xc8a5('0x2b')]}});}})['then'](function(_0x2f512f){if(!_0x2f512f){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x2f512f[_0xc8a5('0xe')]||!_0x2f512f[_0xc8a5('0xf')]){throw new db[(_0xc8a5('0x27'))][(_0xc8a5('0x28'))](_0xc8a5('0x2f'));}_0x3e1b4f=_0x2f512f;logger[_0xc8a5('0xb')](util[_0xc8a5('0x17')](_0xc8a5('0x30'),_0x38a605['id']));return sentiment(_0x3e1b4f[_0xc8a5('0xe')],_0x3e1b4f[_0xc8a5('0xf')],_0x1295a9[_0xc8a5('0x24')],_0x38a605[_0xc8a5('0x13')],_0x1295a9[_0xc8a5('0x25')]);})[_0xc8a5('0x20')](function(_0x5bc633){logger[_0xc8a5('0xb')](util[_0xc8a5('0x17')](_0xc8a5('0x31'),_0x38a605['id']));return _0x38a605[_0xc8a5('0x1f')]({'sentiment':_0x5bc633[_0xc8a5('0x32')],'sPositive':_0x5bc633[_0xc8a5('0x33')][_0xc8a5('0x38')],'sNegative':_0x5bc633[_0xc8a5('0x33')]['Negative'],'sMixed':_0x5bc633['SentimentScore'][_0xc8a5('0x39')],'sNeutral':_0x5bc633[_0xc8a5('0x33')][_0xc8a5('0x3a')],'transcribeStatus':'COMPLETED'});})[_0xc8a5('0x20')](function(){logger[_0xc8a5('0xb')](util['format'](_0xc8a5('0x21'),_0x38a605['id']));_0x5c9d13();});}})[_0xc8a5('0x3b')](function(_0x3e112f){if(_0x3e112f){if(!_0x3e112f[_0xc8a5('0x3c')]||_0x3e112f['name']!==_0xc8a5('0x3d')){logger[_0xc8a5('0x3e')](util[_0xc8a5('0x17')](_0xc8a5('0x3f'),_0x38a605['id']),util[_0xc8a5('0x40')](_0x3e112f,{'showHidden':![],'depth':null}));}}_0x5c9d13();});});}function checkTranscribe(){var _0x45dddf;var _0x5d2435;var _0x1b44df;return db[_0xc8a5('0x41')][_0xc8a5('0x42')]({'where':{'transcribeStatus':_0xc8a5('0x43')}})[_0xc8a5('0x20')](function(_0x1de54a){if(!_0x1de54a||!_0x1de54a[_0xc8a5('0x1d')]){throw new db[(_0xc8a5('0x27'))][(_0xc8a5('0x28'))](_0xc8a5('0x44'));}_0x45dddf=_0x1de54a;return db[_0xc8a5('0x45')][_0xc8a5('0x2d')]({'where':{'id':0x1}});})[_0xc8a5('0x20')](function(_0x568ce2){if(!_0x568ce2){throw new db[(_0xc8a5('0x27'))]['ValidationError']('Settings\x20not\x20available');}_0x5d2435=_0x568ce2;if(!_0x5d2435['transcribe']||!_0x5d2435[_0xc8a5('0x46')]||!_0x5d2435['transcribeRegion']||!_0x5d2435[_0xc8a5('0x25')]||!_0x5d2435[_0xc8a5('0x26')]){throw new db[(_0xc8a5('0x27'))][(_0xc8a5('0x28'))](_0xc8a5('0x47'));}return db[_0xc8a5('0x2c')][_0xc8a5('0x2d')]({'where':{'id':_0x5d2435[_0xc8a5('0x46')]}});})[_0xc8a5('0x20')](function(_0x4f9b24){if(!_0x4f9b24){throw new db[(_0xc8a5('0x27'))][(_0xc8a5('0x28'))](_0xc8a5('0x2e'));}if(!_0x4f9b24[_0xc8a5('0xe')]||!_0x4f9b24[_0xc8a5('0xf')]){throw new db['Sequelize'][(_0xc8a5('0x28'))](_0xc8a5('0x2f'));}_0x1b44df=_0x4f9b24;var _0x21f299=[];_0x45dddf[_0xc8a5('0x48')](function(_0x50218c){_0x21f299['push'](checkTranscribeJob(_0x50218c,_0x5d2435,_0x1b44df));});return BPromise[_0xc8a5('0x49')](_0x21f299);})['catch'](function(_0x43e530){if(_0x43e530){if(!_0x43e530[_0xc8a5('0x3c')]||_0x43e530['name']!==_0xc8a5('0x3d')){logger['error'](util[_0xc8a5('0x40')](_0x43e530,{'showHidden':![],'depth':null}));}}});}exports[_0xc8a5('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x112a=['detectSentiment','substring','info','format','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','results','transcripts','length','fileText','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','resolve','tempSentiment','Negative','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20available','forEach','all','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend'];(function(_0x38bfd8,_0x4f498b){var _0x262ac5=function(_0x3b6509){while(--_0x3b6509){_0x38bfd8['push'](_0x38bfd8['shift']());}};_0x262ac5(++_0x4f498b);}(_0x112a,0x115));var _0xa112=function(_0x5cffa9,_0xc06c61){_0x5cffa9=_0x5cffa9-0x0;var _0x3d080b=_0x112a[_0x5cffa9];return _0x3d080b;};var _=require(_0xa112('0x0'));var AWS=require(_0xa112('0x1'));var rp=require(_0xa112('0x2'));var util=require(_0xa112('0x3'));var BPromise=require(_0xa112('0x4'));var db=require(_0xa112('0x5'))['db'];var logger=require(_0xa112('0x6'))(_0xa112('0x7'));function getTranscriptionJob(_0x276a61,_0x27b96f,_0x2a0976,_0xf8afbf){return new Promise(function(_0x41ca4c,_0x350cc4){var _0x676aa8=new AWS[(_0xa112('0x8'))]({'accessKeyId':_0x27b96f,'secretAccessKey':_0x276a61,'region':_0x2a0976});_0x676aa8[_0xa112('0x9')]({'TranscriptionJobName':_0xf8afbf},function(_0x7f5ede,_0x377238){if(_0x7f5ede){return _0x350cc4(_0x7f5ede);}else{return _0x41ca4c(_0x377238);}});});}function sentiment(_0x17f33b,_0x14834d,_0xb6dcd,_0x2257f6,_0x478cd3){return new Promise(function(_0x8a1266,_0x5c3e27){var _0x35af69=new AWS[(_0xa112('0xa'))]({'accessKeyId':_0x14834d,'secretAccessKey':_0x17f33b,'region':_0xb6dcd});_0x35af69[_0xa112('0xb')]({'Text':_0x2257f6,'LanguageCode':_0x478cd3[_0xa112('0xc')](0x0,0x2)},function(_0x11801d,_0x301955){if(_0x11801d){return _0x5c3e27(_0x11801d);}else{return _0x8a1266(_0x301955);}});});}function checkTranscribeJob(_0x1c2323,_0x292a3d,_0xe52e4b){var _0xb3af91;return new BPromise(function(_0x24896c,_0x2a137f){logger[_0xa112('0xd')](util[_0xa112('0xe')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x1c2323['id'],_0x1c2323[_0xa112('0xf')]));return getTranscriptionJob(_0xe52e4b[_0xa112('0x10')],_0xe52e4b[_0xa112('0x11')],_0x292a3d[_0xa112('0x12')],_0x1c2323[_0xa112('0xf')])[_0xa112('0x13')](function(_0x37e7c9){logger[_0xa112('0xd')](util[_0xa112('0xe')](_0xa112('0x14'),_0x1c2323['id'],_0x1c2323[_0xa112('0xf')],_0x37e7c9[_0xa112('0x15')][_0xa112('0x16')]));if(!_0x1c2323['fileText']){switch(_0x37e7c9[_0xa112('0x15')][_0xa112('0x16')]){case _0xa112('0x17'):var _0x1417ec={'transcribeStatus':_0x37e7c9[_0xa112('0x15')][_0xa112('0x16')],'fileUri':_0x37e7c9[_0xa112('0x15')][_0xa112('0x18')][_0xa112('0x19')]};logger[_0xa112('0xd')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x1c2323['id']));return rp({'uri':_0x37e7c9[_0xa112('0x15')][_0xa112('0x18')]['TranscriptFileUri'],'json':!![]})[_0xa112('0x13')](function(_0x2003ec){logger[_0xa112('0xd')](util[_0xa112('0xe')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x1c2323['id']));if(_0x2003ec&&_0x2003ec[_0xa112('0x1a')]&&_0x2003ec[_0xa112('0x1a')][_0xa112('0x1b')]&&_0x2003ec[_0xa112('0x1a')]['transcripts']['length']){_0x1417ec['fileText']='';for(var _0x27a849=0x0;_0x27a849<_0x2003ec['results'][_0xa112('0x1b')][_0xa112('0x1c')];_0x27a849++){_0x1417ec[_0xa112('0x1d')]+=_0x2003ec['results'][_0xa112('0x1b')][_0x27a849][_0xa112('0x1e')]+'';}}return _0x1c2323['update'](_0x1417ec);})['then'](function(){logger['info'](util[_0xa112('0xe')](_0xa112('0x1f'),_0x1c2323['id']));if(!_0x1c2323['tempSentiment']){throw new db[(_0xa112('0x20'))][(_0xa112('0x21'))](_0xa112('0x22'));}if(!_0x292a3d[_0xa112('0x23')]||!_0x292a3d[_0xa112('0x24')]||!_0x292a3d['sentimentRegion']||!_0x292a3d[_0xa112('0x25')]||!_0x292a3d[_0xa112('0x26')]){throw new db['Sequelize'][(_0xa112('0x21'))](_0xa112('0x27'));}if(!_0x1417ec[_0xa112('0x1d')]){throw new Error(_0xa112('0x28'));}if(_0x292a3d[_0xa112('0x24')]===_0xe52e4b['id']){return _0xe52e4b;}else{return db[_0xa112('0x29')][_0xa112('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x41c39d){if(!_0x41c39d){throw new db[(_0xa112('0x20'))][(_0xa112('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x41c39d[_0xa112('0x10')]||!_0x41c39d[_0xa112('0x11')]){throw new db[(_0xa112('0x20'))]['ValidationError'](_0xa112('0x2b'));}_0xb3af91=_0x41c39d;logger[_0xa112('0xd')](util[_0xa112('0xe')](_0xa112('0x2c'),_0x1c2323['id']));return sentiment(_0xb3af91[_0xa112('0x10')],_0xb3af91[_0xa112('0x11')],_0x292a3d[_0xa112('0x2d')],_0x1417ec[_0xa112('0x1d')],_0x292a3d[_0xa112('0x25')]);})[_0xa112('0x13')](function(_0x1c2975){logger[_0xa112('0xd')](util[_0xa112('0xe')](_0xa112('0x2e'),_0x1c2323['id']));return _0x1c2323[_0xa112('0x2f')]({'sentiment':_0x1c2975[_0xa112('0x30')],'sPositive':_0x1c2975[_0xa112('0x31')][_0xa112('0x32')],'sNegative':_0x1c2975[_0xa112('0x31')]['Negative'],'sMixed':_0x1c2975[_0xa112('0x31')][_0xa112('0x33')],'sNeutral':_0x1c2975['SentimentScore'][_0xa112('0x34')]});})[_0xa112('0x13')](function(){logger['info'](util['format'](_0xa112('0x1f'),_0x1c2323['id']));_0x24896c();});case _0xa112('0x35'):return _0x1c2323[_0xa112('0x2f')]({'transcribeStatus':_0xa112('0x35'),'failureReason':_0x37e7c9[_0xa112('0x15')]['FailureReason']})[_0xa112('0x13')](function(){logger[_0xa112('0xd')](util[_0xa112('0xe')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1c2323['id']));_0x24896c();});default:logger[_0xa112('0xd')](util[_0xa112('0xe')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1c2323['id']));break;}}else{return BPromise[_0xa112('0x36')]()['then'](function(){if(!_0x1c2323[_0xa112('0x37')]){throw new db['Sequelize'][(_0xa112('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x292a3d['sentiment']||!_0x292a3d[_0xa112('0x24')]||!_0x292a3d[_0xa112('0x2d')]||!_0x292a3d[_0xa112('0x25')]||!_0x292a3d[_0xa112('0x26')]){throw new db[(_0xa112('0x20'))]['ValidationError'](_0xa112('0x27'));}if(!_0x1c2323['fileText']){throw new Error(_0xa112('0x28'));}if(_0x292a3d['sentimentAccountId']===_0xe52e4b['id']){return _0xe52e4b;}else{return db[_0xa112('0x29')][_0xa112('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x515ad6){if(!_0x515ad6){throw new db['Sequelize'][(_0xa112('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x515ad6['data1']||!_0x515ad6['data2']){throw new db[(_0xa112('0x20'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0xb3af91=_0x515ad6;logger[_0xa112('0xd')](util['format'](_0xa112('0x2c'),_0x1c2323['id']));return sentiment(_0xb3af91[_0xa112('0x10')],_0xb3af91[_0xa112('0x11')],_0x292a3d[_0xa112('0x2d')],_0x1c2323[_0xa112('0x1d')],_0x292a3d[_0xa112('0x25')]);})[_0xa112('0x13')](function(_0x3b9953){logger[_0xa112('0xd')](util[_0xa112('0xe')](_0xa112('0x2e'),_0x1c2323['id']));return _0x1c2323[_0xa112('0x2f')]({'sentiment':_0x3b9953['Sentiment'],'sPositive':_0x3b9953['SentimentScore'][_0xa112('0x32')],'sNegative':_0x3b9953[_0xa112('0x31')][_0xa112('0x38')],'sMixed':_0x3b9953[_0xa112('0x31')]['Mixed'],'sNeutral':_0x3b9953[_0xa112('0x31')]['Neutral'],'transcribeStatus':_0xa112('0x17')});})[_0xa112('0x13')](function(){logger[_0xa112('0xd')](util[_0xa112('0xe')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1c2323['id']));_0x24896c();});}})['catch'](function(_0x2d6861){if(_0x2d6861){if(!_0x2d6861[_0xa112('0x39')]||_0x2d6861[_0xa112('0x39')]!==_0xa112('0x3a')){logger[_0xa112('0x3b')](util[_0xa112('0xe')](_0xa112('0x3c'),_0x1c2323['id']),util[_0xa112('0x3d')](_0x2d6861,{'showHidden':![],'depth':null}));}}_0x24896c();});});}function checkTranscribe(){var _0x33d7c0;var _0x31aec8;var _0x20733f;return db[_0xa112('0x3e')][_0xa112('0x3f')]({'where':{'transcribeStatus':_0xa112('0x40')}})[_0xa112('0x13')](function(_0x4bd0e2){if(!_0x4bd0e2||!_0x4bd0e2['length']){throw new db[(_0xa112('0x20'))][(_0xa112('0x21'))]('No\x20transcribe\x20job\x20to\x20check');}_0x33d7c0=_0x4bd0e2;return db[_0xa112('0x41')][_0xa112('0x2a')]({'where':{'id':0x1}});})[_0xa112('0x13')](function(_0x26c7ec){if(!_0x26c7ec){throw new db[(_0xa112('0x20'))][(_0xa112('0x21'))](_0xa112('0x42'));}_0x31aec8=_0x26c7ec;if(!_0x31aec8[_0xa112('0x7')]||!_0x31aec8[_0xa112('0x43')]||!_0x31aec8[_0xa112('0x12')]||!_0x31aec8[_0xa112('0x25')]||!_0x31aec8[_0xa112('0x26')]){throw new db[(_0xa112('0x20'))][(_0xa112('0x21'))](_0xa112('0x44'));}return db[_0xa112('0x29')][_0xa112('0x2a')]({'where':{'id':_0x31aec8[_0xa112('0x43')]}});})[_0xa112('0x13')](function(_0x2a1ad8){if(!_0x2a1ad8){throw new db[(_0xa112('0x20'))]['ValidationError'](_0xa112('0x45'));}if(!_0x2a1ad8[_0xa112('0x10')]||!_0x2a1ad8[_0xa112('0x11')]){throw new db[(_0xa112('0x20'))][(_0xa112('0x21'))](_0xa112('0x2b'));}_0x20733f=_0x2a1ad8;var _0x1ed61e=[];_0x33d7c0[_0xa112('0x46')](function(_0x18d9ca){_0x1ed61e['push'](checkTranscribeJob(_0x18d9ca,_0x31aec8,_0x20733f));});return BPromise[_0xa112('0x47')](_0x1ed61e);})['catch'](function(_0x158415){if(_0x158415){if(!_0x158415['name']||_0x158415[_0xa112('0x39')]!==_0xa112('0x3a')){logger[_0xa112('0x3b')](util[_0xa112('0x3d')](_0x158415,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 0ee71f1..7c9ee39 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 _0x0085=['emit','whatsappInteraction:update','catch','inspect','start','lodash','moment','util','../../config/environment','schedule','redis','localhost','socket.io-emitter','lastMsgAt','subtract','map','info','join','WhatsappInteraction','system','timeout','format','then','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0085,0x185));var _0x5008=function(_0x22d300,_0x396d11){_0x22d300=_0x22d300-0x0;var _0x44ac70=_0x0085[_0x22d300];return _0x44ac70;};'use strict';var _=require(_0x5008('0x0'));var moment=require(_0x5008('0x1'));var Redis=require('ioredis');var util=require(_0x5008('0x2'));var config=require(_0x5008('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x5008('0x4'));config[_0x5008('0x5')]=_['defaults'](config[_0x5008('0x5')],{'host':_0x5008('0x6'),'port':0x18eb});var io=require(_0x5008('0x7'))(new Redis(config[_0x5008('0x5')]));function closeInteractions(){var _0x398eb0=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0x5008('0x8')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x5008('0x9')](0x18,'hours')}}})['then'](function(_0x1a8b4d){if(_0x1a8b4d&&_0x1a8b4d['length']){_0x398eb0=_[_0x5008('0xa')](_0x1a8b4d||[],'id');logger[_0x5008('0xb')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x398eb0[_0x5008('0xc')]());return db[_0x5008('0xd')]['update']({'closeReason':_0x5008('0xe'),'disposition':_0x5008('0xf'),'closed':!![],'closedAt':moment()[_0x5008('0x10')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x398eb0}});}})[_0x5008('0x11')](function(){if(_0x398eb0&&_0x398eb0[_0x5008('0x12')]){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x398eb0['join']());for(var _0x4c77a7=0x0;_0x4c77a7<_0x398eb0[_0x5008('0x12')];_0x4c77a7++){io[_0x5008('0x13')](_0x5008('0x14'),{'id':_0x398eb0[_0x4c77a7],'closed':!![]});}}})[_0x5008('0x15')](function(_0x1f957a){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x1f957a?util[_0x5008('0x16')](_0x1f957a,{'showHidden':![],'depth':null}):'');});}exports[_0x5008('0x17')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x255b=['schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger'];(function(_0x4772d8,_0x51b385){var _0x2353df=function(_0x51ab47){while(--_0x51ab47){_0x4772d8['push'](_0x4772d8['shift']());}};_0x2353df(++_0x51b385);}(_0x255b,0xc4));var _0xb255=function(_0x171dab,_0x1397a8){_0x171dab=_0x171dab-0x0;var _0x49b0a1=_0x255b[_0x171dab];return _0x49b0a1;};'use strict';var _=require(_0xb255('0x0'));var moment=require(_0xb255('0x1'));var Redis=require(_0xb255('0x2'));var util=require(_0xb255('0x3'));var config=require(_0xb255('0x4'));var db=require(_0xb255('0x5'))['db'];var logger=require(_0xb255('0x6'))(_0xb255('0x7'));config[_0xb255('0x8')]=_[_0xb255('0x9')](config[_0xb255('0x8')],{'host':_0xb255('0xa'),'port':0x18eb});var io=require(_0xb255('0xb'))(new Redis(config[_0xb255('0x8')]));function closeInteractions(){var _0x3eb1d1=[];return db[_0xb255('0xc')][_0xb255('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xb255('0xe')](0x18,_0xb255('0xf'))}}})['then'](function(_0x2b5121){if(_0x2b5121&&_0x2b5121['length']){_0x3eb1d1=_[_0xb255('0x10')](_0x2b5121||[],'id');logger[_0xb255('0x11')](_0xb255('0x12'),_0x3eb1d1[_0xb255('0x13')]());return db['WhatsappInteraction']['update']({'closeReason':'system','disposition':_0xb255('0x14'),'closed':!![],'closedAt':moment()[_0xb255('0x15')](_0xb255('0x16'))},{'where':{'id':_0x3eb1d1}});}})[_0xb255('0x17')](function(){if(_0x3eb1d1&&_0x3eb1d1[_0xb255('0x18')]){logger[_0xb255('0x11')](_0xb255('0x19'),_0x3eb1d1[_0xb255('0x13')]());for(var _0x13a073=0x0;_0x13a073<_0x3eb1d1['length'];_0x13a073++){io['emit'](_0xb255('0x1a'),{'id':_0x3eb1d1[_0x13a073],'closed':!![]});}}})['catch'](function(_0x3f2194){logger['error'](_0xb255('0x1b'),_0x3f2194?util['inspect'](_0x3f2194,{'showHidden':![],'depth':null}):'');});}exports[_0xb255('0x1c')]=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 0902c24..a08d655 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7f2=['bulkCreate','log','finished\x20populating','contacts1','CmHopper','destroy','hopper1','contacts2','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','push','now','@xcally.com','CmContact','then'];(function(_0x50ac69,_0x3ad86a){var _0x369a98=function(_0x3e4b77){while(--_0x3e4b77){_0x50ac69['push'](_0x50ac69['shift']());}};_0x369a98(++_0x3ad86a);}(_0xa7f2,0xc3));var _0x2a7f=function(_0x5f0225,_0x52631a){_0x5f0225=_0x5f0225-0x0;var _0x2cef4b=_0xa7f2[_0x5f0225];return _0x2cef4b;};'use strict';var util=require('util');var db=require(_0x2a7f('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x2a7f('0x1')+i,'lastName':_0x2a7f('0x2')+i,'phone':0xf879fb460+i,'email':_0x2a7f('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x2a7f('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x2a7f('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2a7f('0x5')](),'updatedAt':Date[_0x2a7f('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x2a7f('0x4')]({'id':i,'firstName':_0x2a7f('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x2a7f('0x3')+i+_0x2a7f('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x2a7f('0x4')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2a7f('0x5')](),'updatedAt':Date[_0x2a7f('0x5')]()});}db[_0x2a7f('0x7')]['destroy']({'where':{}})[_0x2a7f('0x8')](function(){return db['CmContact'][_0x2a7f('0x9')](contacts);})['then'](function(){console[_0x2a7f('0xa')](_0x2a7f('0xb'),_0x2a7f('0xc'));return db[_0x2a7f('0xd')][_0x2a7f('0xe')]({'where':{}});})[_0x2a7f('0x8')](function(){return db[_0x2a7f('0xd')]['bulkCreate'](hopper);})[_0x2a7f('0x8')](function(){console['log']('finished\x20populating',_0x2a7f('0xf'));return db[_0x2a7f('0x7')][_0x2a7f('0x9')](contacts2);})[_0x2a7f('0x8')](function(){console[_0x2a7f('0xa')](_0x2a7f('0xb'),_0x2a7f('0x10'));return db[_0x2a7f('0xd')][_0x2a7f('0x9')](hopper2);})[_0x2a7f('0x8')](function(){console[_0x2a7f('0xa')](_0x2a7f('0xb'),'hopper2');})['catch'](function(_0x1725f0){console[_0x2a7f('0xa')](_0x1725f0);}); \ No newline at end of file +var _0x810d=['../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','CmHopper','contacts2','catch'];(function(_0x3103f1,_0x1070d0){var _0x58b690=function(_0x12c7ff){while(--_0x12c7ff){_0x3103f1['push'](_0x3103f1['shift']());}};_0x58b690(++_0x1070d0);}(_0x810d,0x1a0));var _0xd810=function(_0x44c63f,_0x48bf09){_0x44c63f=_0x44c63f-0x0;var _0x47c980=_0x810d[_0x44c63f];return _0x47c980;};'use strict';var util=require('util');var db=require(_0xd810('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xd810('0x1')]({'id':i,'firstName':_0xd810('0x2')+i,'lastName':_0xd810('0x3')+i,'phone':0xf879fb460+i,'email':_0xd810('0x4')+i+_0xd810('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xd810('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xd810('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xd810('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xd810('0x1')]({'id':i,'firstName':_0xd810('0x2')+i,'lastName':_0xd810('0x3')+i,'phone':0xf879fb460+i,'email':_0xd810('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xd810('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xd810('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xd810('0x6')]()});}db[_0xd810('0x7')][_0xd810('0x8')]({'where':{}})[_0xd810('0x9')](function(){return db[_0xd810('0x7')][_0xd810('0xa')](contacts);})[_0xd810('0x9')](function(){console[_0xd810('0xb')](_0xd810('0xc'),'contacts1');return db['CmHopper'][_0xd810('0x8')]({'where':{}});})[_0xd810('0x9')](function(){return db[_0xd810('0xd')][_0xd810('0xa')](hopper);})[_0xd810('0x9')](function(){console[_0xd810('0xb')]('finished\x20populating','hopper1');return db[_0xd810('0x7')]['bulkCreate'](contacts2);})[_0xd810('0x9')](function(){console[_0xd810('0xb')](_0xd810('0xc'),_0xd810('0xe'));return db['CmHopper']['bulkCreate'](hopper2);})['then'](function(){console[_0xd810('0xb')]('finished\x20populating','hopper2');})[_0xd810('0xf')](function(_0x44242d){console['log'](_0x44242d);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 12710b6..d3f52fd 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ca7=['log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','then'];(function(_0x118616,_0x476beb){var _0x26302d=function(_0x4b3ae2){while(--_0x4b3ae2){_0x118616['push'](_0x118616['shift']());}};_0x26302d(++_0x476beb);}(_0x5ca7,0x1e6));var _0x75ca=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x5ca7[_0xc6be3a];return _0x56a310;};'use strict';var util=require(_0x75ca('0x0'));var db=require(_0x75ca('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x75ca('0x2')]({'name':util[_0x75ca('0x3')](_0x75ca('0x4'),_0x75ca('0x5'),i),'fullname':util['format'](_0x75ca('0x4'),_0x75ca('0x5'),i),'email':util[_0x75ca('0x3')](_0x75ca('0x6'),_0x75ca('0x5'),i),'role':_0x75ca('0x5'),'password':_0x75ca('0x7'),'internal':0xfa0+i,'type':_0x75ca('0x8'),'transport':[_0x75ca('0x9'),'ws',_0x75ca('0xa')],'disallow':[_0x75ca('0xb')],'allow':[_0x75ca('0xc')],'defaultuser':util[_0x75ca('0x3')](_0x75ca('0x4'),_0x75ca('0x5'),i),'encryption':_0x75ca('0xd'),'avpf':'yes','force_avp':'yes','icesupport':'yes','dtlsenable':_0x75ca('0xd'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x75ca('0xe'),'dtlssetup':'actpass','callerid':util[_0x75ca('0x3')](_0x75ca('0xf'),util[_0x75ca('0x3')]('%s%s','agent',i),0xfa0+i)});}db[_0x75ca('0x10')]['bulkCreate'](users)[_0x75ca('0x11')](function(){console[_0x75ca('0x12')](_0x75ca('0x13'));})[_0x75ca('0x14')](function(_0x331bf9){console['log'](_0x331bf9);}); \ No newline at end of file +var _0x12c9=['friend','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','add\x20user','catch','log','util','../mysqldb','push','format','%s%s','agent','password'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x12c9,0x149));var _0x912c=function(_0x14ac8f,_0x1ca3a7){_0x14ac8f=_0x14ac8f-0x0;var _0x5201a1=_0x12c9[_0x14ac8f];return _0x5201a1;};'use strict';var util=require(_0x912c('0x0'));var db=require(_0x912c('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x912c('0x2')]({'name':util[_0x912c('0x3')](_0x912c('0x4'),_0x912c('0x5'),i),'fullname':util[_0x912c('0x3')]('%s%s',_0x912c('0x5'),i),'email':util[_0x912c('0x3')]('%s%s@xcally.com',_0x912c('0x5'),i),'role':_0x912c('0x5'),'password':_0x912c('0x6'),'internal':0xfa0+i,'type':_0x912c('0x7'),'transport':[_0x912c('0x8'),'ws','wss'],'disallow':[_0x912c('0x9')],'allow':[_0x912c('0xa')],'defaultuser':util[_0x912c('0x3')](_0x912c('0x4'),_0x912c('0x5'),i),'encryption':'yes','avpf':_0x912c('0xb'),'force_avp':_0x912c('0xb'),'icesupport':_0x912c('0xb'),'dtlsenable':_0x912c('0xb'),'dtlsverify':'no','dtlscertfile':_0x912c('0xc'),'dtlsprivatekey':_0x912c('0xd'),'dtlssetup':_0x912c('0xe'),'callerid':util['format'](_0x912c('0xf'),util[_0x912c('0x3')]('%s%s',_0x912c('0x5'),i),0xfa0+i)});}db[_0x912c('0x10')]['bulkCreate'](users)[_0x912c('0x11')](function(){console['log'](_0x912c('0x12'));})[_0x912c('0x13')](function(_0x597134){console[_0x912c('0x14')](_0x597134);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 46773f8..36811c1 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdfb1=['userProfileId','MailQueue','Trunks','Trunk','getVoiceQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','voice','chat','sms','mail','whatsapp','agent','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','WhatsappInteractions','removeWhatsappInteractions','catch','log','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','CONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','User','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','IvrCampaigns','resourceId','then','map','where','role','format','length','user:%s','handshake','query','find','ChatInteraction','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Campaign','user','voice:outbound'];(function(_0x118626,_0x40a41d){var _0x287b1c=function(_0x45d9fd){while(--_0x45d9fd){_0x118626['push'](_0x118626['shift']());}};_0x287b1c(++_0x40a41d);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x40cf01,_0x467ab3){_0x40cf01=_0x40cf01-0x0;var _0x2f4eb1=_0xdfb1[_0x40cf01];return _0x2f4eb1;};'use strict';var _=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var BPromise=require(_0x1dfb('0x2'));var db=require(_0x1dfb('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x1dfb('0x4')],'include':[{'as':_0x1dfb('0x5'),'model':db[_0x1dfb('0x6')],'attributes':['id',_0x1dfb('0x4'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x1dfb('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x1dfb('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x1dfb('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1dfb('0x4'),_0x1dfb('0x8')],'where':{'type':_0x1dfb('0x9')}};function getAssociatedResources(_0x190198,_0x5a14dd,_0x24d8b9){return db[_0x1dfb('0xa')][_0x1dfb('0xb')]({'where':{'name':_0x190198,'userProfileId':_0x5a14dd},'raw':!![]})['then'](function(_0xd747ac){if(_0xd747ac){if(_0xd747ac[_0x1dfb('0xc')]){switch(_0x190198){case _0x1dfb('0xd'):case _0x1dfb('0xe'):case _0x1dfb('0xf'):case _0x1dfb('0x10'):case _0x1dfb('0x11'):case _0x1dfb('0x12'):case _0x1dfb('0x13'):return db[_0x24d8b9]['findAll'](queryQueues);case _0x1dfb('0x14'):return db[_0x24d8b9][_0x1dfb('0x15')](queryTelephones);case'Trunks':return db[_0x24d8b9][_0x1dfb('0x15')](queryTrunks);case _0x1dfb('0x16'):return db[_0x24d8b9][_0x1dfb('0x15')](queryCampaigns);}}else{return db['UserProfileResource'][_0x1dfb('0x15')]({'attributes':[_0x1dfb('0x17')],'where':{'sectionId':_0xd747ac['id']},'raw':!![]})[_0x1dfb('0x18')](function(_0x5ccfcc){if(_0x5ccfcc){var _0xdaf261={'where':{'id':_[_0x1dfb('0x19')](_0x5ccfcc,_0x1dfb('0x17'))},'raw':!![]};switch(_0x24d8b9){case'User':_0xdaf261[_0x1dfb('0x1a')][_0x1dfb('0x1b')]=_0x1dfb('0x7');break;case'Campaign':_0xdaf261['where'][_0x1dfb('0x8')]=_0x1dfb('0x9');break;}return db[_0x24d8b9][_0x1dfb('0x15')](_0xdaf261);}else{return[];}});}}else{return[];}})[_0x1dfb('0x18')](function(_0x50f2ec){return _0x50f2ec;});}function joinOrLeaveQueues(_0x2305e2,_0x33f6e5,_0x2842e7,_0x358465){_0x2305e2[_0x33f6e5](util[_0x1dfb('0x1c')]('%s:queue:%s',_0x2842e7,_0x358465[_0x1dfb('0x4')]));if(_0x358465['Agents']){for(var _0x54cd15=0x0;_0x54cd15<_0x358465['Agents'][_0x1dfb('0x1d')];_0x54cd15+=0x1){_0x2305e2[_0x33f6e5](util[_0x1dfb('0x1c')](_0x1dfb('0x1e'),_0x358465['Agents'][_0x54cd15]['name']));}}}function joinOrLeave(_0x5de3c9,_0x2c9a0c,_0x1ceaab){var _0x1cf4cd;if(_0x5de3c9[_0x1dfb('0x1f')][_0x1dfb('0x20')]['id']){db[_0x1dfb('0x6')][_0x1dfb('0x21')]({'attributes':['id',_0x1dfb('0x4'),_0x1dfb('0x1b'),'userProfileId'],'where':{'id':_0x5de3c9['handshake'][_0x1dfb('0x20')]['id']},'include':[{'model':db[_0x1dfb('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1dfb('0x23')],'as':_0x1dfb('0x24'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x1dfb('0x25'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x1dfb('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x1dfb('0x27')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x1dfb('0x18')](function(_0x417f71){if(_0x417f71){_0x1cf4cd=_0x417f71;_0x5de3c9[_0x2c9a0c](util[_0x1dfb('0x1c')]('user:%s',_0x417f71[_0x1dfb('0x4')]));var _0x82339a=[];switch(_0x417f71[_0x1dfb('0x1b')]){case _0x1dfb('0x28'):_0x5de3c9[_0x2c9a0c](_0x1dfb('0x29'));_0x5de3c9[_0x2c9a0c]('voice:outbound');if(queryQueues[_0x1dfb('0x2a')](_0x1dfb('0x2b'))){delete queryQueues['include'];}_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x2d')]['findAll'](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x2e')][_0x1dfb('0x15')](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x2f')][_0x1dfb('0x15')](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x30')][_0x1dfb('0x15')](queryQueues));_0x82339a[_0x1dfb('0x2c')](db['MailQueue'][_0x1dfb('0x15')](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x31')]['findAll'](queryQueues));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x32')][_0x1dfb('0x15')](queryQueues));_0x82339a['push'](db['User'][_0x1dfb('0x15')](queryTelephones));_0x82339a[_0x1dfb('0x2c')](db['Trunk'][_0x1dfb('0x15')](queryTrunks));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x33')]['findAll'](queryCampaigns));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x6')][_0x1dfb('0x15')](queryAgents));break;case _0x1dfb('0x34'):_0x5de3c9[_0x2c9a0c]('voice:inbound');_0x5de3c9[_0x2c9a0c](_0x1dfb('0x35'));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources('VoiceQueues',_0x417f71['userProfileId'],_0x1dfb('0x2d')));_0x82339a['push'](getAssociatedResources(_0x1dfb('0xe'),_0x417f71['userProfileId'],'ChatQueue'));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources(_0x1dfb('0xf'),_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x2f')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources('SmsQueues',_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x30')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources(_0x1dfb('0x11'),_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x37')));_0x82339a['push'](getAssociatedResources('OpenchannelQueues',_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x31')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources('WhatsappQueues',_0x417f71['userProfileId'],_0x1dfb('0x32')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources('Telephones',_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x6')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources(_0x1dfb('0x38'),_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x39')));_0x82339a[_0x1dfb('0x2c')](getAssociatedResources(_0x1dfb('0x16'),_0x417f71[_0x1dfb('0x36')],_0x1dfb('0x33')));_0x82339a[_0x1dfb('0x2c')](db[_0x1dfb('0x6')]['findAll'](queryAgents));break;case'agent':_0x5de3c9[_0x2c9a0c](_0x1dfb('0x29'));_0x5de3c9[_0x2c9a0c]('voice:outbound');_0x82339a[_0x1dfb('0x2c')](_0x417f71[_0x1dfb('0x3a')]({'attributes':['id','name']}));_0x82339a[_0x1dfb('0x2c')](_0x417f71['getChatQueues']({'attributes':['id','name']}));_0x82339a['push'](_0x417f71[_0x1dfb('0x3b')]({'attributes':['id',_0x1dfb('0x4')]}));_0x82339a[_0x1dfb('0x2c')](_0x417f71['getSmsQueues']({'attributes':['id','name']}));_0x82339a['push'](_0x417f71[_0x1dfb('0x3c')]({'attributes':['id',_0x1dfb('0x4')]}));_0x82339a[_0x1dfb('0x2c')](_0x417f71[_0x1dfb('0x3d')]({'attributes':['id',_0x1dfb('0x4')]}));_0x82339a[_0x1dfb('0x2c')](_0x417f71[_0x1dfb('0x3e')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x82339a);}})[_0x1dfb('0x18')](function(_0x26710a){if(_0x26710a&&_0x26710a[_0x1dfb('0x1d')]){for(var _0x56de99=0x0;_0x56de99<_0x26710a[_0x1dfb('0x1d')];_0x56de99+=0x1){for(var _0x2ff784=0x0;_0x2ff784<_0x26710a[_0x56de99][_0x1dfb('0x1d')];_0x2ff784+=0x1){switch(_0x56de99){case 0x0:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x3f'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x1:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x40'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x2:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,'fax',_0x26710a[_0x56de99][_0x2ff784]);break;case 0x3:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x41'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x4:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x42'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x5:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,'openchannel',_0x26710a[_0x56de99][_0x2ff784]);break;case 0x6:joinOrLeaveQueues(_0x5de3c9,_0x2c9a0c,_0x1dfb('0x43'),_0x26710a[_0x56de99][_0x2ff784]);break;case 0x7:if(_0x1cf4cd[_0x1dfb('0x1b')]!=='agent')_0x5de3c9[_0x2c9a0c](util['format']('telephone:%s',_0x26710a[_0x56de99][_0x2ff784][_0x1dfb('0x4')]));break;case 0x8:if(_0x1cf4cd[_0x1dfb('0x1b')]!==_0x1dfb('0x44'))_0x5de3c9[_0x2c9a0c](util[_0x1dfb('0x1c')](_0x1dfb('0x45'),_0x26710a[_0x56de99][_0x2ff784][_0x1dfb('0x4')]));break;case 0x9:if(_0x1cf4cd[_0x1dfb('0x1b')]!=='agent')_0x5de3c9[_0x2c9a0c](util[_0x1dfb('0x1c')](_0x1dfb('0x46'),_0x26710a[_0x56de99][_0x2ff784][_0x1dfb('0x8')],_0x26710a[_0x56de99][_0x2ff784]['name']));break;case 0xa:_0x5de3c9[_0x2c9a0c](util[_0x1dfb('0x1c')](_0x1dfb('0x1e'),_0x26710a[_0x56de99][_0x2ff784]['name']));break;}}}}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0x3de05f=_[_0x1dfb('0x19')](_0x1cf4cd[_0x1dfb('0x48')],'id');return _0x1cf4cd[_0x1dfb('0x49')](_0x3de05f)[_0x1dfb('0x18')](function(){for(var _0x325ef8=0x0;_0x325ef8<_0x3de05f[_0x1dfb('0x1d')];_0x325ef8+=0x1){_0x1ceaab['emit'](_0x1dfb('0x4a'),{'ChatInteractionId':Number(_0x3de05f[_0x325ef8]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0x556de4=_[_0x1dfb('0x19')](_0x1cf4cd[_0x1dfb('0x4b')],'id');return _0x1cf4cd[_0x1dfb('0x4c')](_0x556de4)[_0x1dfb('0x18')](function(){for(var _0x25e455=0x0;_0x25e455<_0x556de4['length'];_0x25e455+=0x1){_0x1ceaab[_0x1dfb('0x4d')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x556de4[_0x25e455]),'UserId':Number(_0x1cf4cd['id'])});}});}})['then'](function(){if(_0x2c9a0c==='leave'){var _0x51ee9c=_[_0x1dfb('0x19')](_0x1cf4cd[_0x1dfb('0x24')],'id');return _0x1cf4cd[_0x1dfb('0x4e')](_0x51ee9c)[_0x1dfb('0x18')](function(){for(var _0x1ee0cf=0x0;_0x1ee0cf<_0x51ee9c[_0x1dfb('0x1d')];_0x1ee0cf+=0x1){_0x1ceaab[_0x1dfb('0x4d')](_0x1dfb('0x4f'),{'FaxInteractionId':Number(_0x51ee9c[_0x1ee0cf]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0x41cb03=_['map'](_0x1cf4cd[_0x1dfb('0x25')],'id');return _0x1cf4cd[_0x1dfb('0x50')](_0x41cb03)['then'](function(){for(var _0x3c7e8d=0x0;_0x3c7e8d<_0x41cb03[_0x1dfb('0x1d')];_0x3c7e8d+=0x1){_0x1ceaab[_0x1dfb('0x4d')](_0x1dfb('0x51'),{'SmsInteractionId':Number(_0x41cb03[_0x3c7e8d]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0x54d8fe=_['map'](_0x1cf4cd[_0x1dfb('0x26')],'id');return _0x1cf4cd[_0x1dfb('0x52')](_0x54d8fe)['then'](function(){for(var _0x530ba9=0x0;_0x530ba9<_0x54d8fe['length'];_0x530ba9+=0x1){_0x1ceaab[_0x1dfb('0x4d')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x54d8fe[_0x530ba9]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x18')](function(){if(_0x2c9a0c===_0x1dfb('0x47')){var _0xef7a1=_[_0x1dfb('0x19')](_0x1cf4cd[_0x1dfb('0x53')],'id');return _0x1cf4cd[_0x1dfb('0x54')](_0xef7a1)[_0x1dfb('0x18')](function(){for(var _0xfdf97c=0x0;_0xfdf97c<_0xef7a1['length'];_0xfdf97c+=0x1){_0x1ceaab[_0x1dfb('0x4d')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0xef7a1[_0xfdf97c]),'UserId':Number(_0x1cf4cd['id'])});}});}})[_0x1dfb('0x55')](function(_0x123e5e){_0x5de3c9[_0x1dfb('0x56')](_0x123e5e);});}}function onDisconnect(_0x47c899,_0x545f5b){joinOrLeave(_0x47c899,_0x1dfb('0x47'),_0x545f5b);}function onConnect(_0xabb993){joinOrLeave(_0xabb993,'join');}exports[_0x1dfb('0x57')]=function(_0x19795d){_0x19795d['on'](_0x1dfb('0x58'),function(_0x8eaf81){_0x8eaf81[_0x1dfb('0x59')](0x0);_0x8eaf81[_0x1dfb('0x5a')]=_0x8eaf81[_0x1dfb('0x5b')][_0x1dfb('0x58')]['remoteAddress']+':'+_0x8eaf81[_0x1dfb('0x5b')][_0x1dfb('0x58')][_0x1dfb('0x5c')];_0x8eaf81[_0x1dfb('0x5d')]=new Date();_0x8eaf81['log']=function(_0x17c15a){console[_0x1dfb('0x56')](_0x1dfb('0x5e')+_0x8eaf81[_0x1dfb('0x5f')][_0x1dfb('0x4')]+'['+_0x8eaf81[_0x1dfb('0x5a')]+']',_0x17c15a);};_0x8eaf81['on']('disconnect',function(){onDisconnect(_0x8eaf81,_0x19795d);_0x8eaf81[_0x1dfb('0x56')]('DISCONNECTED');});onConnect(_0x8eaf81);_0x8eaf81[_0x1dfb('0x56')](_0x1dfb('0x60'));});}; \ No newline at end of file +var _0x0e56=['WhatsappQueue','Telephones','Trunks','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','telephone:%s','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','catch','log','join','default','setMaxListeners','request','connection','remotePort','connectedAt','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','./environment','Agents','User','name','role','agent','telephone','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','IvrCampaigns','resourceId','map','where','Campaign','format','%s:queue:%s','length','user:%s','query','find','userProfileId','handshake','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','SmsQueue','OpenchannelQueue','Trunk','user','MailQueue'];(function(_0x37cc40,_0x4f7ad5){var _0x22dc07=function(_0x3e5b55){while(--_0x3e5b55){_0x37cc40['push'](_0x37cc40['shift']());}};_0x22dc07(++_0x4f7ad5);}(_0x0e56,0xf5));var _0x60e5=function(_0x1269c6,_0x1c8942){_0x1269c6=_0x1269c6-0x0;var _0x4868c7=_0x0e56[_0x1269c6];return _0x4868c7;};'use strict';var _=require(_0x60e5('0x0'));var util=require(_0x60e5('0x1'));var BPromise=require('bluebird');var db=require(_0x60e5('0x2'))['db'];var config=require(_0x60e5('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x60e5('0x4'),'model':db[_0x60e5('0x5')],'attributes':['id',_0x60e5('0x6'),_0x60e5('0x7')],'raw':!![],'where':{'role':_0x60e5('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x60e5('0x6')],'where':{'role':_0x60e5('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x60e5('0x6')],'where':{'role':_0x60e5('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x60e5('0x6'),_0x60e5('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x194c84,_0x1d0a09,_0x46d531){return db[_0x60e5('0xb')][_0x60e5('0xc')]({'where':{'name':_0x194c84,'userProfileId':_0x1d0a09},'raw':!![]})[_0x60e5('0xd')](function(_0x2336be){if(_0x2336be){if(_0x2336be[_0x60e5('0xe')]){switch(_0x194c84){case _0x60e5('0xf'):case _0x60e5('0x10'):case _0x60e5('0x11'):case _0x60e5('0x12'):case _0x60e5('0x13'):case _0x60e5('0x14'):case _0x60e5('0x15'):return db[_0x46d531][_0x60e5('0x16')](queryQueues);case'Telephones':return db[_0x46d531][_0x60e5('0x16')](queryTelephones);case'Trunks':return db[_0x46d531]['findAll'](queryTrunks);case _0x60e5('0x17'):return db[_0x46d531][_0x60e5('0x16')](queryCampaigns);}}else{return db['UserProfileResource'][_0x60e5('0x16')]({'attributes':[_0x60e5('0x18')],'where':{'sectionId':_0x2336be['id']},'raw':!![]})[_0x60e5('0xd')](function(_0x3ee0b7){if(_0x3ee0b7){var _0x546cfc={'where':{'id':_[_0x60e5('0x19')](_0x3ee0b7,_0x60e5('0x18'))},'raw':!![]};switch(_0x46d531){case _0x60e5('0x5'):_0x546cfc[_0x60e5('0x1a')][_0x60e5('0x7')]=_0x60e5('0x9');break;case _0x60e5('0x1b'):_0x546cfc[_0x60e5('0x1a')][_0x60e5('0xa')]='ivr';break;}return db[_0x46d531]['findAll'](_0x546cfc);}else{return[];}});}}else{return[];}})['then'](function(_0x4e2d93){return _0x4e2d93;});}function joinOrLeaveQueues(_0x38223b,_0x3bea31,_0x378e16,_0x5016da){_0x38223b[_0x3bea31](util[_0x60e5('0x1c')](_0x60e5('0x1d'),_0x378e16,_0x5016da[_0x60e5('0x6')]));if(_0x5016da[_0x60e5('0x4')]){for(var _0x298b28=0x0;_0x298b28<_0x5016da[_0x60e5('0x4')][_0x60e5('0x1e')];_0x298b28+=0x1){_0x38223b[_0x3bea31](util[_0x60e5('0x1c')](_0x60e5('0x1f'),_0x5016da[_0x60e5('0x4')][_0x298b28][_0x60e5('0x6')]));}}}function joinOrLeave(_0x5ecd6a,_0x5b4350,_0x2c29dc){var _0x518741;if(_0x5ecd6a['handshake'][_0x60e5('0x20')]['id']){db['User'][_0x60e5('0x21')]({'attributes':['id',_0x60e5('0x6'),_0x60e5('0x7'),_0x60e5('0x22')],'where':{'id':_0x5ecd6a[_0x60e5('0x23')]['query']['id']},'include':[{'model':db[_0x60e5('0x24')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x60e5('0x25')],'as':_0x60e5('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x60e5('0x27')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x60e5('0x28')],'as':_0x60e5('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x60e5('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x60e5('0x2b')],'as':_0x60e5('0x2c'),'attributes':['id'],'raw':!![]}]})['then'](function(_0xb1d302){if(_0xb1d302){_0x518741=_0xb1d302;_0x5ecd6a[_0x5b4350](util[_0x60e5('0x1c')](_0x60e5('0x1f'),_0xb1d302[_0x60e5('0x6')]));var _0x285932=[];switch(_0xb1d302[_0x60e5('0x7')]){case _0x60e5('0x2d'):_0x5ecd6a[_0x5b4350](_0x60e5('0x2e'));_0x5ecd6a[_0x5b4350](_0x60e5('0x2f'));if(queryQueues[_0x60e5('0x30')](_0x60e5('0x31'))){delete queryQueues[_0x60e5('0x31')];}_0x285932['push'](db[_0x60e5('0x32')][_0x60e5('0x16')](queryQueues));_0x285932[_0x60e5('0x33')](db[_0x60e5('0x34')]['findAll'](queryQueues));_0x285932['push'](db['FaxQueue'][_0x60e5('0x16')](queryQueues));_0x285932[_0x60e5('0x33')](db[_0x60e5('0x35')][_0x60e5('0x16')](queryQueues));_0x285932[_0x60e5('0x33')](db['MailQueue'][_0x60e5('0x16')](queryQueues));_0x285932[_0x60e5('0x33')](db[_0x60e5('0x36')][_0x60e5('0x16')](queryQueues));_0x285932['push'](db['WhatsappQueue'][_0x60e5('0x16')](queryQueues));_0x285932['push'](db[_0x60e5('0x5')][_0x60e5('0x16')](queryTelephones));_0x285932[_0x60e5('0x33')](db[_0x60e5('0x37')]['findAll'](queryTrunks));_0x285932[_0x60e5('0x33')](db[_0x60e5('0x1b')][_0x60e5('0x16')](queryCampaigns));_0x285932[_0x60e5('0x33')](db['User'][_0x60e5('0x16')](queryAgents));break;case _0x60e5('0x38'):_0x5ecd6a[_0x5b4350](_0x60e5('0x2e'));_0x5ecd6a[_0x5b4350]('voice:outbound');_0x285932[_0x60e5('0x33')](getAssociatedResources(_0x60e5('0xf'),_0xb1d302[_0x60e5('0x22')],_0x60e5('0x32')));_0x285932[_0x60e5('0x33')](getAssociatedResources(_0x60e5('0x10'),_0xb1d302['userProfileId'],'ChatQueue'));_0x285932[_0x60e5('0x33')](getAssociatedResources(_0x60e5('0x11'),_0xb1d302[_0x60e5('0x22')],'FaxQueue'));_0x285932['push'](getAssociatedResources(_0x60e5('0x12'),_0xb1d302[_0x60e5('0x22')],_0x60e5('0x35')));_0x285932[_0x60e5('0x33')](getAssociatedResources('MailQueues',_0xb1d302[_0x60e5('0x22')],_0x60e5('0x39')));_0x285932[_0x60e5('0x33')](getAssociatedResources(_0x60e5('0x14'),_0xb1d302[_0x60e5('0x22')],_0x60e5('0x36')));_0x285932[_0x60e5('0x33')](getAssociatedResources('WhatsappQueues',_0xb1d302[_0x60e5('0x22')],_0x60e5('0x3a')));_0x285932[_0x60e5('0x33')](getAssociatedResources(_0x60e5('0x3b'),_0xb1d302[_0x60e5('0x22')],_0x60e5('0x5')));_0x285932[_0x60e5('0x33')](getAssociatedResources(_0x60e5('0x3c'),_0xb1d302[_0x60e5('0x22')],_0x60e5('0x37')));_0x285932['push'](getAssociatedResources(_0x60e5('0x17'),_0xb1d302[_0x60e5('0x22')],'Campaign'));_0x285932[_0x60e5('0x33')](db[_0x60e5('0x5')][_0x60e5('0x16')](queryAgents));break;case _0x60e5('0x8'):_0x5ecd6a[_0x5b4350](_0x60e5('0x2e'));_0x5ecd6a[_0x5b4350](_0x60e5('0x2f'));_0x285932[_0x60e5('0x33')](_0xb1d302[_0x60e5('0x3d')]({'attributes':['id',_0x60e5('0x6')]}));_0x285932['push'](_0xb1d302[_0x60e5('0x3e')]({'attributes':['id',_0x60e5('0x6')]}));_0x285932[_0x60e5('0x33')](_0xb1d302['getFaxQueues']({'attributes':['id','name']}));_0x285932[_0x60e5('0x33')](_0xb1d302[_0x60e5('0x3f')]({'attributes':['id',_0x60e5('0x6')]}));_0x285932[_0x60e5('0x33')](_0xb1d302[_0x60e5('0x40')]({'attributes':['id','name']}));_0x285932[_0x60e5('0x33')](_0xb1d302[_0x60e5('0x41')]({'attributes':['id','name']}));_0x285932['push'](_0xb1d302[_0x60e5('0x42')]({'attributes':['id',_0x60e5('0x6')]}));break;}return BPromise[_0x60e5('0x43')](_0x285932);}})[_0x60e5('0xd')](function(_0x482d13){if(_0x482d13&&_0x482d13['length']){for(var _0x164dde=0x0;_0x164dde<_0x482d13[_0x60e5('0x1e')];_0x164dde+=0x1){for(var _0x256243=0x0;_0x256243<_0x482d13[_0x164dde]['length'];_0x256243+=0x1){switch(_0x164dde){case 0x0:joinOrLeaveQueues(_0x5ecd6a,_0x5b4350,_0x60e5('0x44'),_0x482d13[_0x164dde][_0x256243]);break;case 0x1:joinOrLeaveQueues(_0x5ecd6a,_0x5b4350,_0x60e5('0x45'),_0x482d13[_0x164dde][_0x256243]);break;case 0x2:joinOrLeaveQueues(_0x5ecd6a,_0x5b4350,_0x60e5('0x46'),_0x482d13[_0x164dde][_0x256243]);break;case 0x3:joinOrLeaveQueues(_0x5ecd6a,_0x5b4350,_0x60e5('0x47'),_0x482d13[_0x164dde][_0x256243]);break;case 0x4:joinOrLeaveQueues(_0x5ecd6a,_0x5b4350,_0x60e5('0x48'),_0x482d13[_0x164dde][_0x256243]);break;case 0x5:joinOrLeaveQueues(_0x5ecd6a,_0x5b4350,'openchannel',_0x482d13[_0x164dde][_0x256243]);break;case 0x6:joinOrLeaveQueues(_0x5ecd6a,_0x5b4350,'whatsapp',_0x482d13[_0x164dde][_0x256243]);break;case 0x7:if(_0x518741['role']!==_0x60e5('0x8'))_0x5ecd6a[_0x5b4350](util[_0x60e5('0x1c')](_0x60e5('0x49'),_0x482d13[_0x164dde][_0x256243][_0x60e5('0x6')]));break;case 0x8:if(_0x518741[_0x60e5('0x7')]!==_0x60e5('0x8'))_0x5ecd6a[_0x5b4350](util[_0x60e5('0x1c')](_0x60e5('0x4a'),_0x482d13[_0x164dde][_0x256243]['name']));break;case 0x9:if(_0x518741[_0x60e5('0x7')]!==_0x60e5('0x8'))_0x5ecd6a[_0x5b4350](util[_0x60e5('0x1c')](_0x60e5('0x4b'),_0x482d13[_0x164dde][_0x256243][_0x60e5('0xa')],_0x482d13[_0x164dde][_0x256243][_0x60e5('0x6')]));break;case 0xa:_0x5ecd6a[_0x5b4350](util['format'](_0x60e5('0x1f'),_0x482d13[_0x164dde][_0x256243][_0x60e5('0x6')]));break;}}}}})[_0x60e5('0xd')](function(){if(_0x5b4350===_0x60e5('0x4c')){var _0x5ab5bf=_[_0x60e5('0x19')](_0x518741[_0x60e5('0x4d')],'id');return _0x518741[_0x60e5('0x4e')](_0x5ab5bf)[_0x60e5('0xd')](function(){for(var _0x4b0525=0x0;_0x4b0525<_0x5ab5bf[_0x60e5('0x1e')];_0x4b0525+=0x1){_0x2c29dc[_0x60e5('0x4f')](_0x60e5('0x50'),{'ChatInteractionId':Number(_0x5ab5bf[_0x4b0525]),'UserId':Number(_0x518741['id'])});}});}})[_0x60e5('0xd')](function(){if(_0x5b4350==='leave'){var _0x467c23=_[_0x60e5('0x19')](_0x518741['MailInteractions'],'id');return _0x518741[_0x60e5('0x51')](_0x467c23)[_0x60e5('0xd')](function(){for(var _0x16c64f=0x0;_0x16c64f<_0x467c23[_0x60e5('0x1e')];_0x16c64f+=0x1){_0x2c29dc[_0x60e5('0x4f')](_0x60e5('0x52'),{'MailInteractionId':Number(_0x467c23[_0x16c64f]),'UserId':Number(_0x518741['id'])});}});}})[_0x60e5('0xd')](function(){if(_0x5b4350===_0x60e5('0x4c')){var _0x25e455=_[_0x60e5('0x19')](_0x518741['FaxInteractions'],'id');return _0x518741[_0x60e5('0x53')](_0x25e455)[_0x60e5('0xd')](function(){for(var _0x1a48cf=0x0;_0x1a48cf<_0x25e455['length'];_0x1a48cf+=0x1){_0x2c29dc[_0x60e5('0x4f')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x25e455[_0x1a48cf]),'UserId':Number(_0x518741['id'])});}});}})['then'](function(){if(_0x5b4350==='leave'){var _0x4aaa2e=_['map'](_0x518741[_0x60e5('0x29')],'id');return _0x518741[_0x60e5('0x54')](_0x4aaa2e)['then'](function(){for(var _0x4d9a29=0x0;_0x4d9a29<_0x4aaa2e[_0x60e5('0x1e')];_0x4d9a29+=0x1){_0x2c29dc['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x4aaa2e[_0x4d9a29]),'UserId':Number(_0x518741['id'])});}});}})[_0x60e5('0xd')](function(){if(_0x5b4350===_0x60e5('0x4c')){var _0xf45d76=_['map'](_0x518741[_0x60e5('0x2a')],'id');return _0x518741[_0x60e5('0x55')](_0xf45d76)[_0x60e5('0xd')](function(){for(var _0x23f0eb=0x0;_0x23f0eb<_0xf45d76[_0x60e5('0x1e')];_0x23f0eb+=0x1){_0x2c29dc[_0x60e5('0x4f')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0xf45d76[_0x23f0eb]),'UserId':Number(_0x518741['id'])});}});}})[_0x60e5('0xd')](function(){if(_0x5b4350===_0x60e5('0x4c')){var _0x587cf3=_[_0x60e5('0x19')](_0x518741[_0x60e5('0x2c')],'id');return _0x518741[_0x60e5('0x56')](_0x587cf3)[_0x60e5('0xd')](function(){for(var _0x55c952=0x0;_0x55c952<_0x587cf3[_0x60e5('0x1e')];_0x55c952+=0x1){_0x2c29dc[_0x60e5('0x4f')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x587cf3[_0x55c952]),'UserId':Number(_0x518741['id'])});}});}})[_0x60e5('0x57')](function(_0x436863){_0x5ecd6a[_0x60e5('0x58')](_0x436863);});}}function onDisconnect(_0xe79613,_0x265d00){joinOrLeave(_0xe79613,_0x60e5('0x4c'),_0x265d00);}function onConnect(_0x325008){joinOrLeave(_0x325008,_0x60e5('0x59'));}exports[_0x60e5('0x5a')]=function(_0x4de4a9){_0x4de4a9['on']('connection',function(_0x5acde9){_0x5acde9[_0x60e5('0x5b')](0x0);_0x5acde9['address']=_0x5acde9[_0x60e5('0x5c')][_0x60e5('0x5d')]['remoteAddress']+':'+_0x5acde9[_0x60e5('0x5c')][_0x60e5('0x5d')][_0x60e5('0x5e')];_0x5acde9[_0x60e5('0x5f')]=new Date();_0x5acde9[_0x60e5('0x58')]=function(_0x1fa398){console['log']('SocketIO\x20'+_0x5acde9[_0x60e5('0x60')][_0x60e5('0x6')]+'['+_0x5acde9[_0x60e5('0x61')]+']',_0x1fa398);};_0x5acde9['on'](_0x60e5('0x62'),function(){onDisconnect(_0x5acde9,_0x4de4a9);_0x5acde9[_0x60e5('0x58')](_0x60e5('0x63'));});onConnect(_0x5acde9);_0x5acde9[_0x60e5('0x58')](_0x60e5('0x64'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index fe7e03a..67eae2c 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 _0x81d6=['undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','QueryTypes','SELECT','UserId','interface','format','SIP/%s','name','agent','channel','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','opened','resolve','Sequelize','contact','changed','closed','substatus','User','find','fullname','email','internal','default','length','hasOwnProperty','model','hook','../../mysqldb','jayson/promise','client','http','Chat','afterCreate','newinteraction','ChatInteraction','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','afterUpdate','WhatsappInteraction','Whatsapp','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','info','Trigger,\x20%s','code','error','catch','get','motionChannel','event','direction','then','ContactId'];(function(_0x13977c,_0x21ceac){var _0x184062=function(_0x50554c){while(--_0x50554c){_0x13977c['push'](_0x13977c['shift']());}};_0x184062(++_0x21ceac);}(_0x81d6,0x18f));var _0x681d=function(_0x55e743,_0x64799e){_0x55e743=_0x55e743-0x0;var _0x2b6a7c=_0x81d6[_0x55e743];return _0x2b6a7c;};'use strict';var util=require('util');var db=require(_0x681d('0x0'))['db'];var jayson=require(_0x681d('0x1'));var logger=require('../logger')('triggers');var client=jayson[_0x681d('0x2')][_0x681d('0x3')]({'port':0x232a});var triggers=[{'channel':_0x681d('0x4'),'model':'ChatInteraction','event':_0x681d('0x5'),'condition':_0x681d('0x6'),'callback':afterCreate},{'channel':_0x681d('0x4'),'model':_0x681d('0x7'),'event':'afterUpdate','condition':_0x681d('0x8'),'callback':afterUpdate},{'channel':_0x681d('0x4'),'model':_0x681d('0x9'),'event':_0x681d('0x5'),'condition':_0x681d('0xa'),'callback':afterCreateMessage},{'channel':'Chat','model':_0x681d('0xb'),'event':'afterCreate','condition':_0x681d('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0x681d('0xc'),'model':_0x681d('0xd'),'event':_0x681d('0x5'),'condition':_0x681d('0x6'),'callback':afterCreate},{'channel':_0x681d('0xc'),'model':_0x681d('0xd'),'event':_0x681d('0xe'),'condition':_0x681d('0x8'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':_0x681d('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x681d('0xf'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x681d('0x10'),'model':_0x681d('0xf'),'event':_0x681d('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x681d('0x10'),'model':'WhatsappMessage','event':_0x681d('0x5'),'condition':_0x681d('0xa'),'callback':afterCreateMessage},{'channel':_0x681d('0x11'),'model':'FaxInteraction','event':_0x681d('0x5'),'condition':_0x681d('0x6'),'callback':afterCreate},{'channel':_0x681d('0x11'),'model':_0x681d('0x12'),'event':_0x681d('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x681d('0x11'),'model':_0x681d('0x13'),'event':_0x681d('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x681d('0x14'),'model':'MailInteraction','event':'afterCreate','condition':_0x681d('0x6'),'callback':afterCreate},{'channel':_0x681d('0x14'),'model':_0x681d('0x15'),'event':_0x681d('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x681d('0x14'),'model':_0x681d('0x16'),'event':_0x681d('0x5'),'condition':_0x681d('0xa'),'callback':afterCreateMessage},{'channel':_0x681d('0x17'),'model':_0x681d('0x18'),'event':_0x681d('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x681d('0x17'),'model':_0x681d('0x18'),'event':_0x681d('0xe'),'condition':_0x681d('0x8'),'callback':afterUpdate},{'channel':_0x681d('0x17'),'model':_0x681d('0x19'),'event':_0x681d('0x5'),'condition':_0x681d('0xa'),'callback':afterCreateMessage}];function request(_0x2c999e){return client[_0x681d('0x1a')](_0x681d('0x1b'),_0x2c999e)['then'](function(_0x5100eb){logger[_0x681d('0x1c')](_0x681d('0x1d'),'EventManager',_0x5100eb);if(_0x5100eb['error']){if(_0x5100eb['error'][_0x681d('0x1e')]===0x1f4){logger[_0x681d('0x1f')](_0x681d('0x1d'),_0x681d('0x1b'),_0x5100eb[_0x681d('0x1f')]);}}})[_0x681d('0x20')](function(_0x448f8d){logger[_0x681d('0x1f')](_0x681d('0x1d'),_0x681d('0x1b'),_0x448f8d);});}function afterCreateMessage(_0x4836c5){return function(_0x49ad8e){_0x49ad8e=_0x49ad8e[_0x681d('0x21')]({'plain':!![]});_0x49ad8e['channel']=_0x4836c5;_0x49ad8e[_0x681d('0x22')]=_0x4836c5;_0x49ad8e[_0x681d('0x23')]=_0x49ad8e[_0x681d('0x24')];Promise['resolve']()[_0x681d('0x25')](function(){if(typeof _0x49ad8e[_0x681d('0x26')]===_0x681d('0x27'))return null;var _0x59d05c=_0x681d('0x28')+_0x49ad8e[_0x681d('0x26')];return db[_0x681d('0x29')][_0x681d('0x2a')](_0x59d05c,{'type':db['Sequelize'][_0x681d('0x2b')][_0x681d('0x2c')],'raw':!![]});})['then'](function(_0x277a40){if(_0x277a40){_0x49ad8e['contact']=_0x277a40[0x0];}if(typeof _0x49ad8e['UserId']===_0x681d('0x27'))return;return getAgent(_0x49ad8e[_0x681d('0x2d')]);})[_0x681d('0x25')](function(_0x4c7851){if(_0x4c7851){_0x49ad8e[_0x681d('0x2e')]=util[_0x681d('0x2f')](_0x681d('0x30'),_0x4c7851[_0x681d('0x31')]);_0x49ad8e[_0x681d('0x32')]=_0x4c7851;_0x49ad8e[_0x681d('0x33')]=_0x4836c5;return request({'event':_0x681d('0x34'),'message':_0x49ad8e});}else{return request({'event':_0x681d('0x35'),'message':_0x49ad8e});}})[_0x681d('0x20')](function(_0x3debdd){logger[_0x681d('0x1f')](_0x681d('0x1d'),_0x681d('0x36'),_0x3debdd);});};}function afterCreateOfflineMessage(_0x2b3fbd){return function(_0x2b3d81){_0x2b3d81=_0x2b3d81['get']({'plain':!![]});_0x2b3d81['channel']=_0x2b3fbd;_0x2b3d81[_0x681d('0x22')]=_0x2b3fbd;_0x2b3d81[_0x681d('0x23')]=_0x681d('0x37');return request({'event':_0x2b3d81[_0x681d('0x23')],'message':_0x2b3d81});};}function afterCreate(_0xdcc8a1,_0x37f68f){return function(_0x4a5ba7){_0x4a5ba7=_0x4a5ba7['get']({'plain':!![]});_0x4a5ba7[_0x681d('0x33')]=_0xdcc8a1;_0x4a5ba7[_0x681d('0x22')]=_0xdcc8a1;_0x4a5ba7[_0x681d('0x23')]=_0x681d('0x38');Promise[_0x681d('0x39')]()[_0x681d('0x25')](function(){var _0x291da7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4a5ba7[_0x681d('0x26')];return db['sequelize'][_0x681d('0x2a')](_0x291da7,{'type':db[_0x681d('0x3a')][_0x681d('0x2b')][_0x681d('0x2c')],'raw':!![]});})['then'](function(_0x42bc77){if(_0x42bc77){_0x4a5ba7[_0x681d('0x3b')]=_0x42bc77[0x0];}if(typeof _0x4a5ba7[_0x681d('0x2d')]===_0x681d('0x27'))return;return getAgent(_0x4a5ba7[_0x681d('0x2d')]);})['then'](function(_0x16ce44){if(_0x16ce44){_0x4a5ba7[_0x681d('0x2e')]=util['format'](_0x681d('0x30'),_0x16ce44[_0x681d('0x31')]);_0x4a5ba7[_0x681d('0x32')]=_0x16ce44;}return request({'event':_0x37f68f,'message':_0x4a5ba7});})[_0x681d('0x20')](function(_0x4062bd){logger['error'](_0x681d('0x1d'),'AfterCreate',_0x4062bd);});};}function afterUpdate(_0x505239){return function(_0x47d1ac){var _0x57a7d0=_0x47d1ac[_0x681d('0x3c')]('closed')&&_0x47d1ac[_0x681d('0x3d')];var _0xb54af6=_0x47d1ac[_0x681d('0x3c')](_0x681d('0x3e'));if(_0x57a7d0||_0xb54af6){var _0x5019dc=_0x57a7d0?_0x681d('0x8'):_0x681d('0x3e');var _0x6bcada=_0x47d1ac['get']({'plain':!![]});_0x6bcada['channel']=_0x505239;_0x6bcada[_0x681d('0x22')]=_0x505239;_0x6bcada[_0x681d('0x23')]=_0x57a7d0?'closed':_0x681d('0x3e');var _0x175582='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x6bcada['ContactId'];return db['sequelize'][_0x681d('0x2a')](_0x175582,{'type':db['Sequelize'][_0x681d('0x2b')][_0x681d('0x2c')],'raw':!![]})[_0x681d('0x25')](function(_0x314dca){if(_0x314dca){_0x6bcada[_0x681d('0x3b')]=_0x314dca[0x0];}if(typeof _0x6bcada[_0x681d('0x2d')]==='undefined')return;return getAgent(_0x6bcada[_0x681d('0x2d')]);})[_0x681d('0x25')](function(_0x501dc5){if(_0x501dc5){_0x6bcada[_0x681d('0x2e')]=util[_0x681d('0x2f')](_0x681d('0x30'),_0x501dc5[_0x681d('0x31')]);_0x6bcada[_0x681d('0x32')]=_0x501dc5;}return request({'event':_0x5019dc,'message':_0x6bcada});})[_0x681d('0x20')](function(_0x1b5cd2){logger[_0x681d('0x1f')]('Trigger,\x20%s','AfterUpdate',_0x1b5cd2);});}};}function getAgent(_0x1fff56){return db[_0x681d('0x3f')][_0x681d('0x40')]({'where':{'id':_0x1fff56},'attributes':['id','name',_0x681d('0x41'),_0x681d('0x42'),_0x681d('0x43')],'raw':!![]})['then'](function(_0x52b44f){return _0x52b44f;});}exports[_0x681d('0x44')]=function(){for(var _0x344163=0x0;_0x344163=_0x47faf1[_0xbf1d('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x203147(_0x2cb393);})[_0xbf1d('0x15')](function(_0x32eab4){_0x408681(_0x32eab4);});});}; \ No newline at end of file +var _0xc1a5=['updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','./license/util','voice','mail','fax','sms','whatsapp','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt'];(function(_0x2235c0,_0x58ab92){var _0x1472a3=function(_0x50be3e){while(--_0x50be3e){_0x2235c0['push'](_0x2235c0['shift']());}};_0x1472a3(++_0x58ab92);}(_0xc1a5,0x141));var _0x5c1a=function(_0x924587,_0x4d3f3c){_0x924587=_0x924587-0x0;var _0x264544=_0xc1a5[_0x924587];return _0x264544;};'use strict';var _=require(_0x5c1a('0x0'));var BPromise=require(_0x5c1a('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x5c1a('0x2'));var channels=[_0x5c1a('0x3'),_0x5c1a('0x4'),'chat',_0x5c1a('0x5'),_0x5c1a('0x6'),_0x5c1a('0x7'),_0x5c1a('0x8')];exports['getChannels']=function(){return channels;};exports[_0x5c1a('0x9')]=function(_0x4812b0){_0x4812b0=_0x4812b0[_0x5c1a('0xa')]();return _[_0x5c1a('0xb')](channels,_0x4812b0);};exports[_0x5c1a('0xc')]=function(_0x1cdc68,_0x31b888,_0x302274,_0x3406dd){var _0x5d557e={'loginAttempts':_0x31b888,'blocked':_0x302274};if(!_[_0x5c1a('0xd')](_0x3406dd)){_0x5d557e[_0x5c1a('0xe')]=_0x3406dd;}return _0x1cdc68[_0x5c1a('0xf')](_0x5d557e);};exports[_0x5c1a('0x10')]=function(_0x3a7484){return new BPromise(function(_0x52933f,_0x42fb32){var _0x1180e0=0x0;if(_0x3a7484[_0x5c1a('0x11')]!==_0x5c1a('0x12')){_0x52933f(_0x3a7484);}db[_0x5c1a('0x13')][_0x5c1a('0x14')]({'where':{'role':_0x5c1a('0x12'),'online':!![],'id':{'$ne':_0x3a7484['id']}}})[_0x5c1a('0x15')](function(_0x199353){_0x1180e0=_0x199353;return util['getLicense']();})[_0x5c1a('0x15')](function(_0x4eca77){if(_0x4eca77&&_0x4eca77[_0x5c1a('0x16')]&&_0x1180e0>=_0x4eca77[_0x5c1a('0x16')]){throw Error(_0x5c1a('0x17'));}_0x52933f(_0x3a7484);})['catch'](function(_0x1a4a99){_0x42fb32(_0x1a4a99);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 3f384a2..78bd5ac 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13fd=['send','exports','404','status','render','json'];(function(_0x28d1cd,_0x192371){var _0xdcb892=function(_0x145f6e){while(--_0x145f6e){_0x28d1cd['push'](_0x28d1cd['shift']());}};_0xdcb892(++_0x192371);}(_0x13fd,0x1d5));var _0xd13f=function(_0x13fa48,_0x3e97f3){_0x13fa48=_0x13fa48-0x0;var _0xd380a7=_0x13fd[_0x13fa48];return _0xd380a7;};'use strict';module[_0xd13f('0x0')][0x194]=function pageNotFound(_0x497453,_0x2f7089){var _0x92b9a6=_0xd13f('0x1');var _0x24339a=0x194;var _0xa0c1ca={'status':_0x24339a};_0x2f7089['status'](_0xa0c1ca[_0xd13f('0x2')]);_0x2f7089[_0xd13f('0x3')](_0x92b9a6,{},function(_0x3b549d,_0x160b71){if(_0x3b549d){return _0x2f7089['status'](_0xa0c1ca['status'])[_0xd13f('0x4')](_0xa0c1ca);}_0x2f7089[_0xd13f('0x5')](_0x160b71);});}; \ No newline at end of file +var _0xe0e9=['json','send','exports','404','status','render'];(function(_0x16f77c,_0x5256b1){var _0x78986e=function(_0x10430){while(--_0x10430){_0x16f77c['push'](_0x16f77c['shift']());}};_0x78986e(++_0x5256b1);}(_0xe0e9,0x6e));var _0x9e0e=function(_0x603a96,_0x200327){_0x603a96=_0x603a96-0x0;var _0xcec7e2=_0xe0e9[_0x603a96];return _0xcec7e2;};'use strict';module[_0x9e0e('0x0')][0x194]=function pageNotFound(_0x3df201,_0x3d9e39){var _0x334e8c=_0x9e0e('0x1');var _0x2e6f63=0x194;var _0x2f91a4={'status':_0x2e6f63};_0x3d9e39[_0x9e0e('0x2')](_0x2f91a4[_0x9e0e('0x2')]);_0x3d9e39[_0x9e0e('0x3')](_0x334e8c,{},function(_0xd63667,_0x53149d){if(_0xd63667){return _0x3d9e39['status'](_0x2f91a4[_0x9e0e('0x2')])[_0x9e0e('0x4')](_0x2f91a4);}_0x3d9e39[_0x9e0e('0x5')](_0x53149d);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 6939938..eef5c13 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18ca=['Owner','fax_interaction_has_tags','FaxInteractionId','AttachmentId','FaxQueueReport','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','Answers','ChatProactiveAction','ProactiveActions','ChatMessage','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Tags','ChatOfflineMessageId','ChatGroupId','CmCompany','CompanyId','cm_contact_has_tags','CampaignId','Condition','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Action','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','AllConditions','TriggerAllId','AnyConditions','TriggerAnyId','Fields','MetricId','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','VariableId','SugarcrmAccount','AccountId','int_desk_configuration_has_tags','ZohoAccount','Field','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','ServicenowField','Dynamics365Account','FreshsalesConfiguration','ChatQueueReport','FromId','ToId','JscriptyQuestionReport','SessionId','JscriptyProject','ProjectId','team_has_chat_queues','team_has_fax_queues','team_has_whatsapp_queues','VoicePrefixes','TrunkBackup','SquareProjectId','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAgent','ToMailQueueId','ToAccount','FromAccount','ToUserId','ToAgent','ToChatQueueId','ToQueue','ToChatWebsiteId','FromUserId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','UserProfileSections','UserProfileResource','Resources','WhatsappAccount','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','xcall','utf8_general_ci','username','options','database','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','SmsQueueReport','SquareReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','UserId','cascade','hasMany','UserVoiceQueueRt','VoiceExtension','Extensions','HopperFinals','CmHopperHistory','HopperHistory','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteraction','OpenchannelInteractions','user_has_whatsapp_interactions','MailQueues','ChatQueues','FaxQueue','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','HopperBlacks','JscriptySessionReport','TrunkId','TrunkBackupId','Interval','IntervalId','voice_queues_has_cm_lists','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailServerIn','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Smtp','Disposition','Dispositions','CannedAnswer','Interactions','List','ListId','mandatoryDispositionPauseId','Agents','team_has_mail_queues','Teams','MailInteractionId','mail_interaction_has_tags','Tag','ThroughTags','Users','Attachments','Interaction','Account','ChatWebsiteId','TagId','Items','FaxAccountId','Exntensions','Messages','mandatoryDispositionPause'];(function(_0x41b0a8,_0x1b05cc){var _0x3a83d4=function(_0x3d1011){while(--_0x3d1011){_0x41b0a8['push'](_0x41b0a8['shift']());}};_0x3a83d4(++_0x1b05cc);}(_0x18ca,0x7c));var _0xa18c=function(_0x5500b1,_0x471843){_0x5500b1=_0x5500b1-0x0;var _0x165094=_0x18ca[_0x5500b1];return _0x165094;};'use strict';var config=require(_0xa18c('0x0'));var Sequelize=require(_0xa18c('0x1'));var _=require(_0xa18c('0x2'));var jstz=require(_0xa18c('0x3'));var timezone=jstz[_0xa18c('0x4')]();config[_0xa18c('0x1')]=_[_0xa18c('0x5')](config[_0xa18c('0x1')],{'database':_0xa18c('0x6'),'username':'xcall','password':_0xa18c('0x7'),'options':{'host':_0xa18c('0x8'),'port':0xcea,'dialect':_0xa18c('0x9'),'dialectOptions':{'charset':_0xa18c('0xa')},'logging':![],'timezone':timezone[_0xa18c('0xb')](),'define':{'charset':_0xa18c('0xc'),'collate':'utf8_general_ci'}}});config[_0xa18c('0xd')]=_[_0xa18c('0x5')](config['sequelizeHistory'],{'database':_0xa18c('0x6'),'username':_0xa18c('0xe'),'password':_0xa18c('0x7'),'options':{'host':_0xa18c('0x8'),'port':0xcea,'dialect':_0xa18c('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xa18c('0xc'),'collate':_0xa18c('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa18c('0x1')]['database'],config[_0xa18c('0x1')][_0xa18c('0x10')],config[_0xa18c('0x1')]['password'],config[_0xa18c('0x1')][_0xa18c('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa18c('0xd')][_0xa18c('0x12')],config['sequelizeHistory'][_0xa18c('0x10')],config[_0xa18c('0xd')][_0xa18c('0x13')],config[_0xa18c('0xd')][_0xa18c('0x11')])};db[_0xa18c('0x14')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x16'));db[_0xa18c('0x17')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x18'));db[_0xa18c('0x19')]=db[_0xa18c('0x1')]['import'](_0xa18c('0x1a'));db['VoiceExtension']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x1b'));db[_0xa18c('0x1c')]=db[_0xa18c('0x1')]['import'](_0xa18c('0x1d'));db[_0xa18c('0x1e')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0x1f'));db[_0xa18c('0x20')]=db['sequelize']['import'](_0xa18c('0x21'));db[_0xa18c('0x22')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x23'));db[_0xa18c('0x24')]=db['sequelize'][_0xa18c('0x15')]('../api/voiceMail/voiceMail.model');db[_0xa18c('0x25')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x26'));db[_0xa18c('0x27')]=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/voiceCallReport/voiceCallReport.model');db[_0xa18c('0x28')]=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/voiceDialReport/voiceDialReport.model');db[_0xa18c('0x29')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x2a'));db['VoiceQueueReport']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x2b'));db[_0xa18c('0x2c')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x2d'));db[_0xa18c('0x2e')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x2f'));db['VoiceTransferReport']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x30'));db['UserVoiceQueueRt']=db[_0xa18c('0x1')]['import'](_0xa18c('0x31'));db[_0xa18c('0x32')]=db['sequelize']['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0xa18c('0x33')]=db[_0xa18c('0x1')]['import']('../api/userChatQueue/userChatQueue.model');db[_0xa18c('0x34')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x35'));db[_0xa18c('0x36')]=db['sequelize'][_0xa18c('0x15')]('../api/userFaxQueue/userFaxQueue.model');db[_0xa18c('0x37')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x38'));db[_0xa18c('0x39')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x3a'));db[_0xa18c('0x3b')]=db[_0xa18c('0x1')]['import'](_0xa18c('0x3c'));db['MailServerIn']=db['sequelize'][_0xa18c('0x15')](_0xa18c('0x3d'));db[_0xa18c('0x3e')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x3f'));db[_0xa18c('0x40')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x41'));db[_0xa18c('0x42')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x43'));db['MailSubstatus']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x44'));db[_0xa18c('0x45')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x46'));db[_0xa18c('0x47')]=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/mailMessage/mailMessage.model');db[_0xa18c('0x48')]=db[_0xa18c('0x1')]['import']('../api/mailApplication/mailApplication.model');db[_0xa18c('0x49')]=db['sequelize']['import'](_0xa18c('0x4a'));db[_0xa18c('0x4b')]=db[_0xa18c('0x1')]['import'](_0xa18c('0x4c'));db[_0xa18c('0x4d')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x4e'));db['FaxAccount']=db[_0xa18c('0x1')]['import'](_0xa18c('0x4f'));db[_0xa18c('0x50')]=db[_0xa18c('0x1')]['import'](_0xa18c('0x51'));db[_0xa18c('0x52')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x53'));db[_0xa18c('0x54')]=db[_0xa18c('0x1')]['import']('../api/faxMessage/faxMessage.model');db['FaxQueue']=db['sequelize'][_0xa18c('0x15')]('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x55'));db[_0xa18c('0x56')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x57'));db[_0xa18c('0x58')]=db[_0xa18c('0x1')]['import'](_0xa18c('0x59'));db[_0xa18c('0x5a')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0x5b'));db['SmsMessage']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x5c'));db[_0xa18c('0x5d')]=db[_0xa18c('0x1')]['import'](_0xa18c('0x5e'));db[_0xa18c('0x5f')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x60'));db[_0xa18c('0x61')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x62'));db['OpenchannelInteraction']=db['sequelize'][_0xa18c('0x15')](_0xa18c('0x63'));db[_0xa18c('0x64')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0x65'));db[_0xa18c('0x66')]=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/openchannelQueue/openchannelQueue.model');db[_0xa18c('0x67')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0x68'));db[_0xa18c('0x69')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x6a'));db[_0xa18c('0x6b')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x6c'));db[_0xa18c('0x6d')]=db[_0xa18c('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x6e'));db[_0xa18c('0x6f')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x70'));db[_0xa18c('0x71')]=db['sequelize'][_0xa18c('0x15')]('../api/chatQueue/chatQueue.model');db[_0xa18c('0x72')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x73'));db['ChatProactiveAction']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x74'));db['CmCompany']=db['sequelize'][_0xa18c('0x15')](_0xa18c('0x75'));db[_0xa18c('0x76')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x77'));db['CmHopper']=db[_0xa18c('0x1')]['import'](_0xa18c('0x78'));db[_0xa18c('0x79')]=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xa18c('0x7a')]=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x7b'));db[_0xa18c('0x7c')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x7d'));db['CmCustomField']=db['sequelize'][_0xa18c('0x15')]('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x7e'));db[_0xa18c('0x7f')]=db[_0xa18c('0x1')]['import'](_0xa18c('0x80'));db['CannedAnswer']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x81'));db['Disposition']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x82'));db['Condition']=db[_0xa18c('0x1')]['import'](_0xa18c('0x83'));db['Interval']=db[_0xa18c('0x1')]['import'](_0xa18c('0x84'));db[_0xa18c('0x85')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0x86'));db[_0xa18c('0x87')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0x88'));db[_0xa18c('0x89')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0x8a'));db[_0xa18c('0x8b')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x8c'));db[_0xa18c('0x8d')]=db[_0xa18c('0x1')]['import']('../api/sound/sound.model');db['Tag']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x8e'));db[_0xa18c('0x8f')]=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/template/template.model');db[_0xa18c('0x90')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0x91'));db[_0xa18c('0x92')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x93'));db[_0xa18c('0x94')]=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/integration/integration.model');db[_0xa18c('0x95')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x96'));db[_0xa18c('0x97')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x98'));db[_0xa18c('0x99')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x9a'));db['AnalyticExtractedReport']=db['sequelize']['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xa18c('0x9b')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x9c'));db[_0xa18c('0x9d')]=db['sequelize']['import'](_0xa18c('0x9e'));db['AnalyticTreeReport']=db['sequelize'][_0xa18c('0x15')](_0xa18c('0x9f'));db[_0xa18c('0xa0')]=db['sequelize'][_0xa18c('0x15')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xa18c('0xa1')]=db[_0xa18c('0x1')]['import'](_0xa18c('0xa2'));db[_0xa18c('0xa3')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xa4'));db['SugarcrmAccount']=db[_0xa18c('0x1')]['import'](_0xa18c('0xa5'));db[_0xa18c('0xa6')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xa7'));db[_0xa18c('0xa8')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xa9'));db[_0xa18c('0xaa')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xab'));db[_0xa18c('0xac')]=db[_0xa18c('0x1')]['import'](_0xa18c('0xad'));db[_0xa18c('0xae')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xaf'));db['ZohoAccount']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xb0'));db[_0xa18c('0xb1')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xb2'));db[_0xa18c('0xb3')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xb4'));db[_0xa18c('0xb5')]=db['sequelize']['import'](_0xa18c('0xb6'));db[_0xa18c('0xb7')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xb8'));db[_0xa18c('0xb9')]=db[_0xa18c('0x1')]['import'](_0xa18c('0xba'));db[_0xa18c('0xbb')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xbc'));db[_0xa18c('0xbd')]=db['sequelize']['import'](_0xa18c('0xbe'));db[_0xa18c('0xbf')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xc0'));db['VtigerAccount']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xc1'));db[_0xa18c('0xc2')]=db[_0xa18c('0x1')]['import'](_0xa18c('0xc3'));db['VtigerField']=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xc4'));db[_0xa18c('0xc5')]=db['sequelize'][_0xa18c('0x15')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xa18c('0xc6')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xc7'));db['ServicenowField']=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xc8'));db['Dynamics365Account']=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xc9'));db[_0xa18c('0xca')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xcb'));db[_0xa18c('0xcc')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xcd'));db[_0xa18c('0xce')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xcf'));db['FreshsalesConfiguration']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xd0'));db[_0xa18c('0xd1')]=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0xa18c('0x94')]=db['sequelize']['import']('../api/integration/integration.model');db[_0xa18c('0xd2')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xd3'));db['ChatQueueReport']=db['sequelize'][_0xa18c('0x15')]('../api/chatQueueReport/chatQueueReport.model');db[_0xa18c('0xd4')]=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xa18c('0xd5')]=db['sequelize']['import']('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db['JscriptyQuestionReport']=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xd6'));db['JscriptySessionReport']=db[_0xa18c('0x1')]['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xa18c('0xd7')]=db['sequelize'][_0xa18c('0x15')]('../api/smsQueueReport/smsQueueReport.model');db[_0xa18c('0xd8')]=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xd9'));db['JscriptyProject']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xda'));db['Setting']=db['sequelize']['import'](_0xa18c('0xdb'));db[_0xa18c('0xdc')]=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/squareOdbc/squareOdbc.model');db[_0xa18c('0xdd')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xde'));db['SquareRecording']=db[_0xa18c('0x1')]['import'](_0xa18c('0xdf'));db[_0xa18c('0xe0')]=db['sequelize'][_0xa18c('0x15')]('../api/squareMessage/squareMessage.model');db['Team']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xe1'));db[_0xa18c('0xe2')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xe3'));db[_0xa18c('0xe4')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xe5'));db[_0xa18c('0xe6')]=db['sequelize'][_0xa18c('0x15')]('../api/migration/migration.model');db[_0xa18c('0xe7')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xe8'));db[_0xa18c('0xe9')]=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/plugin/plugin.model');db['MailTransferReport']=db[_0xa18c('0x1')]['import']('../api/mailTransferReport/mailTransferReport.model');db[_0xa18c('0xea')]=db[_0xa18c('0x1')]['import'](_0xa18c('0xeb'));db[_0xa18c('0xec')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xed'));db[_0xa18c('0xee')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xef'));db[_0xa18c('0xf0')]=db['sequelize'][_0xa18c('0x15')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xf1'));db[_0xa18c('0xf2')]=db['sequelize'][_0xa18c('0x15')]('../api/voicePrefix/voicePrefix.model');db[_0xa18c('0xf3')]=db['sequelize']['import']('../api/userProfile/userProfile.model');db[_0xa18c('0xf4')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xf5'));db['UserProfileResource']=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/userProfileResource/userProfileResource.model');db[_0xa18c('0xf6')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0xf7'));db['WhatsappAccount']=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xf8'));db[_0xa18c('0xf9')]=db[_0xa18c('0x1')]['import'](_0xa18c('0xfa'));db[_0xa18c('0xfb')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0xfc'));db[_0xa18c('0xfd')]=db[_0xa18c('0x1')]['import'](_0xa18c('0xfe'));db[_0xa18c('0xff')]=db['sequelize'][_0xa18c('0x15')](_0xa18c('0x100'));db[_0xa18c('0x101')]=db[_0xa18c('0x1')][_0xa18c('0x15')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xa18c('0x102')]=db[_0xa18c('0x1')]['import'](_0xa18c('0x103'));db['CloudProvider']=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x104'));db[_0xa18c('0x105')]=db['sequelize'][_0xa18c('0x15')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xa18c('0x106')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x107'));db[_0xa18c('0x108')]=db[_0xa18c('0x1')][_0xa18c('0x15')](_0xa18c('0x109'));db[_0xa18c('0x10a')]=db[_0xa18c('0x1')]['import']('../api/user-setting/user-setting.model');db[_0xa18c('0x14')][_0xa18c('0x10b')](db[_0xa18c('0x24')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0xa18c('0x10c')});db['User']['hasOne'](db[_0xa18c('0x10a')],{'as':'userSetting','onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x10c')});db[_0xa18c('0x14')][_0xa18c('0x10e')](db['VoiceRecording'],{'as':'Recordings','foreignKey':'UserId'});db['User']['hasMany'](db[_0xa18c('0x10f')],{'as':'VoiceQueuesRt','foreignKey':_0xa18c('0x10c')});db[_0xa18c('0x14')][_0xa18c('0x10e')](db[_0xa18c('0x110')],{'as':_0xa18c('0x111'),'onDelete':'cascade','hooks':!![]});db[_0xa18c('0x14')][_0xa18c('0x10e')](db['CmHopperFinal'],{'as':_0xa18c('0x112'),'foreignKey':_0xa18c('0x10c')});db[_0xa18c('0x14')][_0xa18c('0x10e')](db[_0xa18c('0x113')],{'as':_0xa18c('0x114'),'foreignKey':_0xa18c('0x10c')});db['User'][_0xa18c('0x10e')](db[_0xa18c('0x7c')],{'as':'ReportAgentPreview','foreignKey':_0xa18c('0x10c')});db[_0xa18c('0x14')][_0xa18c('0x10e')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0xa18c('0x10c')});db[_0xa18c('0x14')][_0xa18c('0x10e')](db[_0xa18c('0x6d')],{'as':_0xa18c('0x115'),'foreignKey':'UserId'});db[_0xa18c('0x14')]['hasMany'](db[_0xa18c('0x5a')],{'as':_0xa18c('0x116'),'foreignKey':'UserId'});db[_0xa18c('0x14')][_0xa18c('0x10e')](db[_0xa18c('0x52')],{'as':_0xa18c('0x117'),'foreignKey':_0xa18c('0x10c')});db['User']['hasMany'](db['MailInteraction'],{'as':_0xa18c('0x118'),'foreignKey':_0xa18c('0x10c')});db[_0xa18c('0x14')][_0xa18c('0x10e')](db[_0xa18c('0xfb')],{'as':_0xa18c('0x119'),'foreignKey':'UserId'});db[_0xa18c('0x14')][_0xa18c('0x10e')](db[_0xa18c('0xf6')],{'as':_0xa18c('0x11a'),'foreignKey':'SenderId'});db[_0xa18c('0x14')][_0xa18c('0x11b')](db[_0xa18c('0xf3')],{'as':'UserProfile','foreignKey':_0xa18c('0x11c')});db['User'][_0xa18c('0x11d')](db[_0xa18c('0x72')],{'as':_0xa18c('0x11e'),'through':_0xa18c('0x11f')});db[_0xa18c('0x14')][_0xa18c('0x11d')](db[_0xa18c('0x76')],{'as':_0xa18c('0x120'),'through':_0xa18c('0x121')});db['User'][_0xa18c('0x11d')](db[_0xa18c('0x122')],{'as':_0xa18c('0x123'),'through':_0xa18c('0x124')});db[_0xa18c('0x14')][_0xa18c('0x11d')](db[_0xa18c('0x125')],{'through':_0xa18c('0x126')});db[_0xa18c('0x14')][_0xa18c('0x11d')](db[_0xa18c('0x45')],{'as':_0xa18c('0x118'),'through':_0xa18c('0x127')});db[_0xa18c('0x14')][_0xa18c('0x11d')](db[_0xa18c('0x6d')],{'as':_0xa18c('0x115'),'through':_0xa18c('0x128')});db['User'][_0xa18c('0x11d')](db['FaxInteraction'],{'as':'FaxInteractions','through':_0xa18c('0x129')});db['User'][_0xa18c('0x11d')](db[_0xa18c('0x5a')],{'as':'SmsInteractions','through':_0xa18c('0x12a')});db[_0xa18c('0x14')]['belongsToMany'](db[_0xa18c('0x12b')],{'as':_0xa18c('0x12c'),'through':'user_has_openchannel_interactions'});db[_0xa18c('0x14')]['belongsToMany'](db[_0xa18c('0xfb')],{'as':_0xa18c('0x119'),'through':_0xa18c('0x12d')});db['User'][_0xa18c('0x11d')](db[_0xa18c('0x1e')],{'as':'VoiceQueues','through':_0xa18c('0x32'),'required':![]});db[_0xa18c('0x14')][_0xa18c('0x11d')](db[_0xa18c('0xf2')],{'as':'VoicePrefixes','through':_0xa18c('0x108'),'required':![]});db['User']['belongsToMany'](db[_0xa18c('0x42')],{'as':_0xa18c('0x12e'),'through':_0xa18c('0x34'),'required':![]});db[_0xa18c('0x14')][_0xa18c('0x11d')](db[_0xa18c('0x71')],{'as':_0xa18c('0x12f'),'through':_0xa18c('0x33'),'required':![],'hooks':!![]});db[_0xa18c('0x14')]['belongsToMany'](db[_0xa18c('0x130')],{'as':_0xa18c('0x131'),'through':'UserFaxQueue','required':![]});db[_0xa18c('0x14')][_0xa18c('0x11d')](db[_0xa18c('0x5d')],{'as':_0xa18c('0x132'),'through':'UserSmsQueue','required':![]});db[_0xa18c('0x14')][_0xa18c('0x11d')](db[_0xa18c('0x66')],{'as':_0xa18c('0x133'),'through':_0xa18c('0x39'),'required':![]});db[_0xa18c('0x14')][_0xa18c('0x11d')](db['WhatsappQueue'],{'as':_0xa18c('0x134'),'through':_0xa18c('0x3b'),'required':![]});db[_0xa18c('0x14')][_0xa18c('0x11d')](db[_0xa18c('0x122')],{'through':'cm_user_has_lists'});db[_0xa18c('0x14')][_0xa18c('0x11d')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0xa18c('0x135')});db[_0xa18c('0x14')][_0xa18c('0x11d')](db[_0xa18c('0x136')],{'as':_0xa18c('0x137'),'through':_0xa18c('0x138')});db[_0xa18c('0x14')][_0xa18c('0x11d')](db['MailAccount'],{'as':_0xa18c('0x139'),'through':_0xa18c('0x13a')});db[_0xa18c('0x14')][_0xa18c('0x11d')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0xa18c('0x13b')});db[_0xa18c('0x14')][_0xa18c('0x11d')](db[_0xa18c('0x56')],{'as':_0xa18c('0x13c'),'through':'user_has_sms_accounts'});db[_0xa18c('0x14')]['belongsToMany'](db['WhatsappAccount'],{'as':_0xa18c('0x13d'),'through':_0xa18c('0x13e')});db[_0xa18c('0x14')][_0xa18c('0x11d')](db[_0xa18c('0xdd')],{'as':'SquareProjects','through':_0xa18c('0x13f')});db[_0xa18c('0x17')]['hasMany'](db[_0xa18c('0x110')],{'as':_0xa18c('0x140'),'onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x141')});db[_0xa18c('0x19')][_0xa18c('0x10e')](db[_0xa18c('0x110')],{'onDelete':'cascade'});db[_0xa18c('0x110')][_0xa18c('0x10e')](db[_0xa18c('0x110')],{'as':_0xa18c('0x142'),'onDelete':_0xa18c('0x10d')});db[_0xa18c('0x1c')]['belongsToMany'](db[_0xa18c('0x8d')],{'as':_0xa18c('0x143'),'through':'moh_has_sounds'});db[_0xa18c('0x1e')][_0xa18c('0x10e')](db[_0xa18c('0x10f')],{'as':_0xa18c('0x144'),'foreignKey':_0xa18c('0x145')});db[_0xa18c('0x1e')][_0xa18c('0x10e')](db[_0xa18c('0x146')],{'as':_0xa18c('0x147'),'foreignKey':_0xa18c('0x145')});db[_0xa18c('0x1e')][_0xa18c('0x10e')](db['CmHopperFinal'],{'as':_0xa18c('0x112'),'foreignKey':_0xa18c('0x145')});db[_0xa18c('0x1e')][_0xa18c('0x10e')](db[_0xa18c('0x113')],{'as':_0xa18c('0x148'),'foreignKey':_0xa18c('0x145')});db[_0xa18c('0x1e')]['hasMany'](db[_0xa18c('0x7c')],{'as':_0xa18c('0x7c'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xa18c('0x10e')](db[_0xa18c('0x79')],{'as':_0xa18c('0x149'),'foreignKey':'VoiceQueueId'});db[_0xa18c('0x1e')]['hasMany'](db[_0xa18c('0x14a')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db['VoiceQueue']['belongsTo'](db[_0xa18c('0x2e')],{'as':_0xa18c('0x2e'),'foreignKey':_0xa18c('0x14b')});db['VoiceQueue'][_0xa18c('0x11b')](db[_0xa18c('0x2e')],{'as':'TrunkBackup','foreignKey':_0xa18c('0x14c')});db[_0xa18c('0x1e')][_0xa18c('0x11b')](db['Interval'],{'as':_0xa18c('0x14d'),'foreignKey':_0xa18c('0x14e')});db['VoiceQueue'][_0xa18c('0x11b')](db[_0xa18c('0x85')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xa18c('0x1e')][_0xa18c('0x11d')](db[_0xa18c('0x122')],{'as':_0xa18c('0x123'),'through':_0xa18c('0x14f')});db[_0xa18c('0x1e')][_0xa18c('0x11d')](db[_0xa18c('0x14')],{'as':'Agents','through':_0xa18c('0x32')});db[_0xa18c('0x1e')][_0xa18c('0x11d')](db[_0xa18c('0x125')],{'as':'Teams','through':'TeamVoiceQueue'});db[_0xa18c('0x1e')][_0xa18c('0x11d')](db[_0xa18c('0x122')],{'as':_0xa18c('0x150'),'through':_0xa18c('0x151')});db[_0xa18c('0x20')][_0xa18c('0x11b')](db['User'],{'as':_0xa18c('0x14'),'foreignKey':_0xa18c('0x10c')});db['ScreenRecording'][_0xa18c('0x11b')](db['User'],{'as':_0xa18c('0x14'),'foreignKey':'UserId'});db[_0xa18c('0x24')][_0xa18c('0x10e')](db['VoiceMailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xa18c('0x152'),'sourceKey':'mailbox'});db[_0xa18c('0x25')][_0xa18c('0x11b')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xa18c('0x153')});db[_0xa18c('0x27')][_0xa18c('0x10e')](db[_0xa18c('0x154')],{'as':_0xa18c('0x155'),'foreignKey':_0xa18c('0x156'),'constraints':![]});db[_0xa18c('0x27')][_0xa18c('0x10e')](db['VoiceAgentReport'],{'as':_0xa18c('0x157'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'as':_0xa18c('0x14'),'foreignKey':_0xa18c('0x10c')});db[_0xa18c('0x27')][_0xa18c('0x11b')](db['CmContact'],{'as':_0xa18c('0x158'),'foreignKey':_0xa18c('0x159')});db[_0xa18c('0x15a')][_0xa18c('0x11b')](db[_0xa18c('0x40')],{'as':_0xa18c('0x40'),'foreignKey':_0xa18c('0x15b')});db['MailServerIn'][_0xa18c('0x11b')](db[_0xa18c('0x15c')],{'as':'CloudProvider','foreignKey':_0xa18c('0x15d'),'onDelete':_0xa18c('0x15e')});db[_0xa18c('0x3e')]['belongsTo'](db[_0xa18c('0x40')],{'as':_0xa18c('0x40'),'foreignKey':_0xa18c('0x15b')});db[_0xa18c('0x3e')][_0xa18c('0x11b')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0xa18c('0x15d'),'onDelete':_0xa18c('0x15e')});db[_0xa18c('0x40')]['hasOne'](db[_0xa18c('0x15a')],{'as':_0xa18c('0x15f'),'onDelete':_0xa18c('0x10d')});db[_0xa18c('0x40')][_0xa18c('0x10b')](db[_0xa18c('0x3e')],{'as':_0xa18c('0x160'),'onDelete':'cascade'});db[_0xa18c('0x40')]['hasMany'](db[_0xa18c('0x161')],{'as':_0xa18c('0x162'),'foreignKey':_0xa18c('0x15b'),'onDelete':_0xa18c('0x10d')});db[_0xa18c('0x40')][_0xa18c('0x10e')](db[_0xa18c('0x163')],{'as':'Answers','foreignKey':_0xa18c('0x15b')});db[_0xa18c('0x40')][_0xa18c('0x10e')](db[_0xa18c('0x47')],{'as':'Messages','foreignKey':'MailAccountId'});db[_0xa18c('0x40')]['hasMany'](db[_0xa18c('0x45')],{'as':_0xa18c('0x164')});db[_0xa18c('0x40')][_0xa18c('0x10e')](db['MailApplication'],{'as':_0xa18c('0x142')});db['MailAccount']['belongsTo'](db['CmList'],{'as':_0xa18c('0x165'),'foreignKey':_0xa18c('0x166')});db[_0xa18c('0x40')][_0xa18c('0x11b')](db[_0xa18c('0x8f')],{'as':'Template','foreignKey':'TemplateId'});db[_0xa18c('0x40')][_0xa18c('0x11b')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xa18c('0x167')});db[_0xa18c('0x40')][_0xa18c('0x11d')](db[_0xa18c('0x14')],{'as':'Agents','through':_0xa18c('0x13a')});db[_0xa18c('0x42')]['belongsToMany'](db['User'],{'as':_0xa18c('0x168'),'through':_0xa18c('0x34')});db[_0xa18c('0x42')][_0xa18c('0x11d')](db[_0xa18c('0x125')],{'through':_0xa18c('0x169'),'as':_0xa18c('0x16a')});db[_0xa18c('0x45')]['hasMany'](db[_0xa18c('0x47')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xa18c('0x16b')});db[_0xa18c('0x45')]['belongsTo'](db[_0xa18c('0x40')],{'as':'Account','foreignKey':_0xa18c('0x15b')});db[_0xa18c('0x45')][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'as':'Contact','foreignKey':_0xa18c('0x159')});db['MailInteraction']['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xa18c('0x10c')});db[_0xa18c('0x45')][_0xa18c('0x11d')](db['Tag'],{'through':_0xa18c('0x16c'),'as':'Tags'});db[_0xa18c('0x45')][_0xa18c('0x11d')](db[_0xa18c('0x16d')],{'through':'mail_interaction_has_tags','as':_0xa18c('0x16e')});db[_0xa18c('0x45')][_0xa18c('0x11d')](db[_0xa18c('0x14')],{'as':_0xa18c('0x16f'),'through':_0xa18c('0x127'),'foreignKey':'MailInteractionId'});db[_0xa18c('0x47')][_0xa18c('0x10e')](db[_0xa18c('0xe7')],{'as':_0xa18c('0x170'),'onDelete':_0xa18c('0x10d')});db[_0xa18c('0x47')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'as':_0xa18c('0x14')});db[_0xa18c('0x47')][_0xa18c('0x11b')](db['CmContact'],{'onDelete':_0xa18c('0x10d'),'as':_0xa18c('0x158')});db['MailMessage'][_0xa18c('0x11b')](db[_0xa18c('0x45')],{'as':_0xa18c('0x171'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0xa18c('0x11b')](db[_0xa18c('0x40')],{'as':_0xa18c('0x172'),'foreignKey':_0xa18c('0x15b')});db[_0xa18c('0x47')][_0xa18c('0x11b')](db[_0xa18c('0x67')],{'as':'ChatWebsite','foreignKey':_0xa18c('0x173')});db['MailMessage'][_0xa18c('0x11b')](db[_0xa18c('0x6f')],{'as':_0xa18c('0x6f'),'foreignKey':'ChatOfflineMessageId'});db[_0xa18c('0x48')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'onDelete':_0xa18c('0x15e')});db[_0xa18c('0x48')]['belongsTo'](db[_0xa18c('0x42')],{'onDelete':_0xa18c('0x15e')});db[_0xa18c('0x48')][_0xa18c('0x11b')](db['MailAccount'],{'onDelete':_0xa18c('0x15e')});db['MailApplication'][_0xa18c('0x11b')](db[_0xa18c('0x14d')],{'onDelete':'restrict','foreignKey':_0xa18c('0x14e')});db[_0xa18c('0x48')][_0xa18c('0x11b')](db[_0xa18c('0x16d')],{'onDelete':'restrict','foreignKey':_0xa18c('0x174')});db[_0xa18c('0x49')]['belongsTo'](db[_0xa18c('0x40')],{});db[_0xa18c('0x49')][_0xa18c('0x11b')](db['CmList'],{'as':_0xa18c('0x165'),'foreignKey':_0xa18c('0x166')});db[_0xa18c('0x49')][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'as':_0xa18c('0x158'),'foreignKey':'ContactId'});db[_0xa18c('0x49')][_0xa18c('0x11b')](db[_0xa18c('0x45')],{});db[_0xa18c('0x49')][_0xa18c('0x11b')](db[_0xa18c('0x47')],{});db[_0xa18c('0x49')]['belongsTo'](db['User'],{});db[_0xa18c('0x49')]['belongsTo'](db['MailQueue'],{});db[_0xa18c('0x4b')][_0xa18c('0x10e')](db[_0xa18c('0x4d')],{'as':_0xa18c('0x175'),'onDelete':'cascade'});db['FaxAccount'][_0xa18c('0x10e')](db[_0xa18c('0x161')],{'as':_0xa18c('0x162'),'foreignKey':_0xa18c('0x176'),'onDelete':'cascade'});db[_0xa18c('0x136')][_0xa18c('0x10e')](db[_0xa18c('0x163')],{'as':'Answers','foreignKey':_0xa18c('0x176')});db[_0xa18c('0x136')][_0xa18c('0x10e')](db[_0xa18c('0x52')],{'as':_0xa18c('0x164')});db[_0xa18c('0x136')]['hasMany'](db['FaxApplication'],{'as':_0xa18c('0x142')});db[_0xa18c('0x136')][_0xa18c('0x10e')](db[_0xa18c('0x110')],{'as':_0xa18c('0x177'),'onDelete':'cascade'});db[_0xa18c('0x136')][_0xa18c('0x10e')](db[_0xa18c('0x54')],{'as':_0xa18c('0x178')});db[_0xa18c('0x136')]['belongsTo'](db['Trunk'],{'as':_0xa18c('0x2e')});db[_0xa18c('0x136')][_0xa18c('0x11b')](db[_0xa18c('0x122')],{'as':_0xa18c('0x165'),'foreignKey':_0xa18c('0x166')});db[_0xa18c('0x136')]['belongsTo'](db[_0xa18c('0x85')],{'as':_0xa18c('0x179'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa18c('0x136')][_0xa18c('0x11d')](db['User'],{'as':_0xa18c('0x168'),'through':_0xa18c('0x138')});db[_0xa18c('0x50')][_0xa18c('0x11b')](db['User'],{'onDelete':'restrict'});db[_0xa18c('0x50')][_0xa18c('0x11b')](db['FaxQueue'],{'onDelete':'restrict'});db[_0xa18c('0x50')][_0xa18c('0x11b')](db['FaxAccount'],{'onDelete':_0xa18c('0x15e')});db['FaxApplication'][_0xa18c('0x11b')](db[_0xa18c('0x16d')],{'onDelete':_0xa18c('0x15e'),'foreignKey':'TagId'});db[_0xa18c('0x52')][_0xa18c('0x10e')](db[_0xa18c('0x54')],{'as':_0xa18c('0x178'),'onDelete':_0xa18c('0x10d'),'foreignKey':'FaxInteractionId'});db[_0xa18c('0x52')][_0xa18c('0x11b')](db[_0xa18c('0x136')],{'as':_0xa18c('0x172'),'foreignKey':'FaxAccountId'});db[_0xa18c('0x52')][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'as':'Contact','foreignKey':_0xa18c('0x159')});db[_0xa18c('0x52')][_0xa18c('0x11b')](db['User'],{'as':_0xa18c('0x17a'),'foreignKey':'UserId'});db[_0xa18c('0x52')][_0xa18c('0x11d')](db['Tag'],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0xa18c('0x52')][_0xa18c('0x11d')](db['Tag'],{'through':_0xa18c('0x17b'),'as':_0xa18c('0x16e')});db[_0xa18c('0x52')][_0xa18c('0x11d')](db[_0xa18c('0x14')],{'as':_0xa18c('0x16f'),'through':'user_has_fax_interactions','foreignKey':_0xa18c('0x17c')});db['FaxMessage']['belongsTo'](db[_0xa18c('0x14')],{'onDelete':_0xa18c('0x10d'),'as':_0xa18c('0x14')});db[_0xa18c('0x54')][_0xa18c('0x11b')](db['FaxInteraction'],{'as':_0xa18c('0x171'),'foreignKey':'FaxInteractionId'});db[_0xa18c('0x54')][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'onDelete':_0xa18c('0x10d'),'as':_0xa18c('0x158')});db[_0xa18c('0x54')]['belongsTo'](db[_0xa18c('0xe7')],{'as':_0xa18c('0xe7'),'foreignKey':_0xa18c('0x17d')});db[_0xa18c('0x54')][_0xa18c('0x11b')](db[_0xa18c('0x136')],{'as':_0xa18c('0x172'),'foreignKey':_0xa18c('0x176')});db[_0xa18c('0x130')][_0xa18c('0x11d')](db[_0xa18c('0x14')],{'as':_0xa18c('0x168'),'through':_0xa18c('0x36')});db['FaxQueue'][_0xa18c('0x11d')](db[_0xa18c('0x125')],{'through':'team_has_fax_queues','as':'Teams'});db[_0xa18c('0x17e')][_0xa18c('0x11b')](db[_0xa18c('0x136')],{});db['FaxQueueReport']['belongsTo'](db[_0xa18c('0x122')],{'as':_0xa18c('0x165'),'foreignKey':'ListId'});db[_0xa18c('0x17e')][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'as':_0xa18c('0x158'),'foreignKey':_0xa18c('0x159')});db[_0xa18c('0x17e')][_0xa18c('0x11b')](db['FaxInteraction'],{});db['FaxQueueReport']['belongsTo'](db[_0xa18c('0x54')],{});db[_0xa18c('0x17e')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{});db[_0xa18c('0x17e')]['belongsTo'](db[_0xa18c('0x130')],{});db['SmsAccount']['hasMany'](db['Disposition'],{'as':_0xa18c('0x162'),'foreignKey':_0xa18c('0x17f'),'onDelete':'cascade'});db[_0xa18c('0x56')][_0xa18c('0x10e')](db['CannedAnswer'],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0xa18c('0x56')][_0xa18c('0x10e')](db[_0xa18c('0x180')],{'as':_0xa18c('0x178'),'foreignKey':_0xa18c('0x17f')});db[_0xa18c('0x56')][_0xa18c('0x10e')](db[_0xa18c('0x5a')],{'as':'Interactions'});db[_0xa18c('0x56')][_0xa18c('0x10e')](db[_0xa18c('0x58')],{'as':_0xa18c('0x142')});db[_0xa18c('0x56')][_0xa18c('0x11b')](db[_0xa18c('0x122')],{'as':_0xa18c('0x165'),'foreignKey':_0xa18c('0x166')});db[_0xa18c('0x56')][_0xa18c('0x11b')](db[_0xa18c('0x85')],{'as':_0xa18c('0x179'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa18c('0x56')][_0xa18c('0x11d')](db['User'],{'as':_0xa18c('0x168'),'through':'user_has_sms_accounts'});db[_0xa18c('0x58')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'onDelete':_0xa18c('0x15e')});db[_0xa18c('0x58')][_0xa18c('0x11b')](db[_0xa18c('0x5d')],{'onDelete':_0xa18c('0x15e')});db[_0xa18c('0x58')][_0xa18c('0x11b')](db[_0xa18c('0x56')],{'onDelete':_0xa18c('0x15e')});db[_0xa18c('0x58')][_0xa18c('0x11b')](db[_0xa18c('0x14d')],{'onDelete':'restrict','foreignKey':_0xa18c('0x14e')});db[_0xa18c('0x58')][_0xa18c('0x11b')](db[_0xa18c('0x16d')],{'onDelete':'restrict','foreignKey':'TagId'});db['SmsInteraction'][_0xa18c('0x10e')](db[_0xa18c('0x180')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xa18c('0x181')});db['SmsInteraction'][_0xa18c('0x11b')](db[_0xa18c('0x56')],{'as':_0xa18c('0x172'),'foreignKey':_0xa18c('0x17f')});db[_0xa18c('0x5a')][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'as':_0xa18c('0x158'),'foreignKey':_0xa18c('0x159')});db['SmsInteraction']['belongsTo'](db[_0xa18c('0x14')],{'as':_0xa18c('0x17a'),'foreignKey':_0xa18c('0x10c')});db['SmsInteraction']['belongsToMany'](db[_0xa18c('0x16d')],{'through':_0xa18c('0x182'),'as':'Tags'});db[_0xa18c('0x5a')][_0xa18c('0x11d')](db[_0xa18c('0x16d')],{'through':_0xa18c('0x182'),'as':_0xa18c('0x16e')});db[_0xa18c('0x5a')][_0xa18c('0x11d')](db[_0xa18c('0x14')],{'as':_0xa18c('0x16f'),'through':_0xa18c('0x12a'),'foreignKey':_0xa18c('0x181')});db[_0xa18c('0x180')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'as':_0xa18c('0x14')});db['SmsMessage'][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'onDelete':'cascade','as':_0xa18c('0x158')});db[_0xa18c('0x180')][_0xa18c('0x11b')](db[_0xa18c('0x5a')],{'onDelete':_0xa18c('0x10d'),'as':'Interaction','foreignKey':_0xa18c('0x181')});db['SmsMessage'][_0xa18c('0x11b')](db[_0xa18c('0x56')],{'as':_0xa18c('0x172'),'foreignKey':_0xa18c('0x17f')});db[_0xa18c('0x5d')][_0xa18c('0x11d')](db[_0xa18c('0x14')],{'as':_0xa18c('0x168'),'through':_0xa18c('0x37'),'foreignKey':'SmsQueueId'});db['SmsQueue'][_0xa18c('0x11d')](db[_0xa18c('0x125')],{'through':_0xa18c('0x183'),'as':'Teams'});db[_0xa18c('0x5f')][_0xa18c('0x10e')](db[_0xa18c('0x161')],{'as':_0xa18c('0x162'),'foreignKey':_0xa18c('0x184'),'onDelete':_0xa18c('0x10d')});db[_0xa18c('0x5f')][_0xa18c('0x10e')](db[_0xa18c('0x163')],{'as':'Answers','foreignKey':_0xa18c('0x184')});db[_0xa18c('0x5f')][_0xa18c('0x10e')](db[_0xa18c('0x12b')],{'as':_0xa18c('0x164'),'foreignKey':_0xa18c('0x184')});db[_0xa18c('0x5f')][_0xa18c('0x10e')](db[_0xa18c('0x64')],{'as':_0xa18c('0x178'),'foreignKey':_0xa18c('0x184')});db[_0xa18c('0x5f')][_0xa18c('0x10e')](db[_0xa18c('0x61')],{'as':_0xa18c('0x142'),'foreignKey':_0xa18c('0x184')});db[_0xa18c('0x5f')]['belongsTo'](db[_0xa18c('0x122')],{'as':'List','foreignKey':_0xa18c('0x166')});db[_0xa18c('0x5f')][_0xa18c('0x11b')](db[_0xa18c('0x85')],{'as':_0xa18c('0x179'),'foreignKey':_0xa18c('0x167')});db[_0xa18c('0x5f')][_0xa18c('0x11d')](db[_0xa18c('0x14')],{'as':'Agents','through':_0xa18c('0x13b')});db[_0xa18c('0x61')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'onDelete':_0xa18c('0x15e')});db[_0xa18c('0x61')][_0xa18c('0x11b')](db[_0xa18c('0x66')],{'onDelete':_0xa18c('0x15e'),'foreignKey':_0xa18c('0x185')});db['OpenchannelApplication'][_0xa18c('0x11b')](db[_0xa18c('0x5f')],{'onDelete':_0xa18c('0x15e'),'foreignKey':_0xa18c('0x184')});db['OpenchannelApplication'][_0xa18c('0x11b')](db[_0xa18c('0x14d')],{'onDelete':_0xa18c('0x15e'),'foreignKey':_0xa18c('0x14e')});db[_0xa18c('0x61')][_0xa18c('0x11b')](db[_0xa18c('0x16d')],{'onDelete':'restrict','foreignKey':_0xa18c('0x174')});db[_0xa18c('0x12b')][_0xa18c('0x10e')](db['OpenchannelMessage'],{'as':'Messages','onDelete':_0xa18c('0x10d'),'foreignKey':'OpenchannelInteractionId'});db[_0xa18c('0x12b')][_0xa18c('0x11b')](db['OpenchannelAccount'],{'as':_0xa18c('0x172'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'as':_0xa18c('0x158'),'foreignKey':'ContactId'});db[_0xa18c('0x12b')][_0xa18c('0x11b')](db['User'],{'as':_0xa18c('0x17a'),'foreignKey':_0xa18c('0x10c')});db[_0xa18c('0x12b')][_0xa18c('0x11d')](db[_0xa18c('0x16d')],{'through':_0xa18c('0x186'),'as':'Tags'});db['OpenchannelInteraction']['belongsToMany'](db['Tag'],{'through':_0xa18c('0x186'),'as':_0xa18c('0x16e')});db['OpenchannelInteraction'][_0xa18c('0x11d')](db[_0xa18c('0x14')],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':_0xa18c('0x187')});db[_0xa18c('0x64')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'onDelete':_0xa18c('0x10d'),'as':_0xa18c('0x14')});db[_0xa18c('0x64')][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'onDelete':_0xa18c('0x10d'),'as':_0xa18c('0x158')});db[_0xa18c('0x64')][_0xa18c('0x11b')](db[_0xa18c('0x12b')],{'onDelete':_0xa18c('0x10d'),'as':_0xa18c('0x171'),'foreignKey':_0xa18c('0x187')});db[_0xa18c('0x64')][_0xa18c('0x11b')](db[_0xa18c('0xe7')],{'as':_0xa18c('0xe7'),'foreignKey':_0xa18c('0x17d')});db[_0xa18c('0x64')][_0xa18c('0x11b')](db[_0xa18c('0x5f')],{'as':'Account','foreignKey':_0xa18c('0x184')});db[_0xa18c('0x66')][_0xa18c('0x11d')](db['User'],{'as':'Agents','through':_0xa18c('0x39'),'foreignKey':_0xa18c('0x185')});db[_0xa18c('0x66')][_0xa18c('0x11d')](db[_0xa18c('0x125')],{'through':_0xa18c('0x188'),'as':_0xa18c('0x16a')});db[_0xa18c('0x67')][_0xa18c('0x10e')](db['Disposition'],{'as':_0xa18c('0x162'),'foreignKey':_0xa18c('0x173'),'onDelete':'cascade'});db[_0xa18c('0x67')][_0xa18c('0x10e')](db[_0xa18c('0x163')],{'as':_0xa18c('0x189'),'foreignKey':'ChatWebsiteId'});db[_0xa18c('0x67')][_0xa18c('0x10e')](db[_0xa18c('0x18a')],{'as':_0xa18c('0x18b')});db[_0xa18c('0x67')]['hasMany'](db[_0xa18c('0x6d')],{'as':_0xa18c('0x164')});db[_0xa18c('0x67')]['hasMany'](db[_0xa18c('0x6b')],{'as':_0xa18c('0x142')});db[_0xa18c('0x67')][_0xa18c('0x10e')](db[_0xa18c('0x18c')],{'as':_0xa18c('0x178')});db[_0xa18c('0x67')][_0xa18c('0x11b')](db['CmList'],{'as':_0xa18c('0x165'),'foreignKey':_0xa18c('0x166')});db[_0xa18c('0x67')][_0xa18c('0x11b')](db[_0xa18c('0x14d')],{'as':_0xa18c('0x14d'),'foreignKey':_0xa18c('0x14e')});db[_0xa18c('0x67')][_0xa18c('0x11b')](db['MailAccount'],{'as':_0xa18c('0x40'),'foreignKey':'MailAccountId'});db[_0xa18c('0x67')]['belongsTo'](db[_0xa18c('0x85')],{'as':'mandatoryDispositionPause','foreignKey':_0xa18c('0x167')});db[_0xa18c('0x67')][_0xa18c('0x11d')](db[_0xa18c('0x14')],{'as':_0xa18c('0x168'),'through':_0xa18c('0x135')});db['OpenchannelQueueReport'][_0xa18c('0x11b')](db[_0xa18c('0x5f')],{});db[_0xa18c('0x69')][_0xa18c('0x11b')](db['CmList'],{'as':'List','foreignKey':_0xa18c('0x166')});db[_0xa18c('0x69')][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'as':_0xa18c('0x158'),'foreignKey':_0xa18c('0x159')});db[_0xa18c('0x69')]['belongsTo'](db[_0xa18c('0x12b')],{});db[_0xa18c('0x69')][_0xa18c('0x11b')](db[_0xa18c('0x64')],{});db[_0xa18c('0x69')]['belongsTo'](db['User'],{});db[_0xa18c('0x69')][_0xa18c('0x11b')](db[_0xa18c('0x66')],{});db[_0xa18c('0x6b')][_0xa18c('0x11b')](db['User'],{'as':_0xa18c('0x18d'),'foreignKey':_0xa18c('0x10c'),'onDelete':'restrict'});db[_0xa18c('0x6b')]['belongsTo'](db[_0xa18c('0x71')],{'as':_0xa18c('0x18e'),'foreignKey':_0xa18c('0x18f'),'onDelete':_0xa18c('0x15e')});db[_0xa18c('0x6b')]['belongsTo'](db[_0xa18c('0x67')],{'as':_0xa18c('0x190'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db['ChatApplication'][_0xa18c('0x11b')](db[_0xa18c('0x16d')],{'onDelete':_0xa18c('0x15e'),'foreignKey':_0xa18c('0x174')});db['ChatInteraction'][_0xa18c('0x10e')](db['ChatMessage'],{'as':_0xa18c('0x178'),'onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x191')});db[_0xa18c('0x6d')][_0xa18c('0x11b')](db[_0xa18c('0x67')],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'as':_0xa18c('0x158'),'foreignKey':_0xa18c('0x159')});db['ChatInteraction']['belongsTo'](db[_0xa18c('0x14')],{'as':_0xa18c('0x17a'),'foreignKey':_0xa18c('0x10c')});db['ChatInteraction']['belongsToMany'](db[_0xa18c('0x16d')],{'through':_0xa18c('0x192'),'as':_0xa18c('0x193')});db['ChatInteraction'][_0xa18c('0x11d')](db['Tag'],{'through':_0xa18c('0x192'),'as':_0xa18c('0x16e')});db[_0xa18c('0x6d')][_0xa18c('0x11d')](db['User'],{'as':_0xa18c('0x16f'),'through':_0xa18c('0x128'),'foreignKey':'ChatInteractionId'});db[_0xa18c('0x18c')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'onDelete':_0xa18c('0x10d'),'as':_0xa18c('0x14')});db[_0xa18c('0x18c')]['belongsTo'](db['CmContact'],{'onDelete':_0xa18c('0x10d'),'as':_0xa18c('0x158'),'foreignKey':_0xa18c('0x159')});db[_0xa18c('0x18c')][_0xa18c('0x11b')](db[_0xa18c('0x6d')],{'onDelete':'cascade','as':_0xa18c('0x171'),'foreignKey':'ChatInteractionId'});db[_0xa18c('0x18c')]['belongsTo'](db['Attachment'],{'as':_0xa18c('0xe7'),'foreignKey':_0xa18c('0x17d')});db[_0xa18c('0x18c')][_0xa18c('0x11b')](db[_0xa18c('0x67')],{'as':_0xa18c('0x172'),'foreignKey':_0xa18c('0x173')});db[_0xa18c('0x6f')][_0xa18c('0x10e')](db['Attachment'],{'as':'Attachments','foreignKey':_0xa18c('0x194'),'onDelete':_0xa18c('0x10d'),'hooks':!![]});db[_0xa18c('0x6f')][_0xa18c('0x11b')](db['CmContact'],{'onDelete':_0xa18c('0x10d'),'as':_0xa18c('0x158'),'foreignKey':'ContactId'});db[_0xa18c('0x6f')][_0xa18c('0x11b')](db['ChatWebsite'],{'as':_0xa18c('0x172'),'foreignKey':_0xa18c('0x173')});db[_0xa18c('0x71')]['belongsToMany'](db[_0xa18c('0x14')],{'as':'Agents','through':_0xa18c('0x33'),'hooks':!![]});db['ChatQueue'][_0xa18c('0x11d')](db[_0xa18c('0x125')],{'through':'team_has_chat_queues','as':_0xa18c('0x16a')});db['ChatGroup']['hasMany'](db[_0xa18c('0xd4')],{'as':_0xa18c('0x178'),'foreignKey':_0xa18c('0x195'),'onDelete':_0xa18c('0x10d')});db[_0xa18c('0x72')][_0xa18c('0x11d')](db[_0xa18c('0x14')],{'as':'Members','through':_0xa18c('0x11f')});db[_0xa18c('0x18a')][_0xa18c('0x11b')](db[_0xa18c('0x67')],{'as':_0xa18c('0x190'),'foreignKey':_0xa18c('0x173')});db[_0xa18c('0x196')][_0xa18c('0x10e')](db[_0xa18c('0x76')],{'as':_0xa18c('0x120'),'foreignKey':'CompanyId'});db[_0xa18c('0x76')][_0xa18c('0x10e')](db[_0xa18c('0x146')],{'as':_0xa18c('0x147'),'foreignKey':_0xa18c('0x159')});db[_0xa18c('0x76')][_0xa18c('0x10e')](db[_0xa18c('0x7a')],{'as':_0xa18c('0x112'),'foreignKey':'ContactId'});db[_0xa18c('0x76')][_0xa18c('0x10e')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xa18c('0x159')});db['CmContact']['hasMany'](db['ReportAgentPreview'],{'as':_0xa18c('0x7c'),'foreignKey':'ContactId'});db['CmContact'][_0xa18c('0x10e')](db[_0xa18c('0x14a')],{'as':'JscriptySessions','foreignKey':_0xa18c('0x159')});db[_0xa18c('0x76')][_0xa18c('0x10e')](db[_0xa18c('0x12b')],{'as':_0xa18c('0x12c'),'foreignKey':_0xa18c('0x159'),'onDelete':_0xa18c('0x15e')});db[_0xa18c('0x76')][_0xa18c('0x10e')](db[_0xa18c('0x6d')],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':_0xa18c('0x15e')});db[_0xa18c('0x76')][_0xa18c('0x10e')](db[_0xa18c('0x5a')],{'as':_0xa18c('0x116'),'foreignKey':_0xa18c('0x159'),'onDelete':'restrict'});db['CmContact'][_0xa18c('0x10e')](db[_0xa18c('0x52')],{'as':_0xa18c('0x117'),'foreignKey':'ContactId','onDelete':_0xa18c('0x15e')});db[_0xa18c('0x76')][_0xa18c('0x10e')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0xa18c('0x76')][_0xa18c('0x11b')](db[_0xa18c('0x196')],{'as':'Company','foreignKey':_0xa18c('0x197')});db[_0xa18c('0x76')][_0xa18c('0x11b')](db['CmList'],{'as':_0xa18c('0x165'),'foreignKey':'ListId','onDelete':_0xa18c('0x10d')});db['CmContact']['belongsToMany'](db[_0xa18c('0x14')],{'as':_0xa18c('0x16f'),'through':_0xa18c('0x121')});db[_0xa18c('0x76')][_0xa18c('0x11d')](db[_0xa18c('0x16d')],{'as':'Tags','through':_0xa18c('0x198')});db[_0xa18c('0x76')][_0xa18c('0x11d')](db[_0xa18c('0x16d')],{'through':_0xa18c('0x198'),'as':_0xa18c('0x16e')});db[_0xa18c('0x146')][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'as':_0xa18c('0x158'),'foreignKey':_0xa18c('0x159'),'onDelete':_0xa18c('0x10d')});db[_0xa18c('0x146')][_0xa18c('0x11b')](db[_0xa18c('0x122')],{'as':_0xa18c('0x165'),'foreignKey':_0xa18c('0x166'),'onDelete':_0xa18c('0x10d')});db[_0xa18c('0x146')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'as':'Agent','foreignKey':_0xa18c('0x10c')});db['CmHopper'][_0xa18c('0x11b')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0xa18c('0x145'),'onDelete':_0xa18c('0x10d')});db[_0xa18c('0x146')][_0xa18c('0x11b')](db['Campaign'],{'as':_0xa18c('0xe4'),'foreignKey':'CampaignId','onDelete':_0xa18c('0x10d')});db[_0xa18c('0x146')][_0xa18c('0x11b')](db['User'],{'as':_0xa18c('0x17a'),'foreignKey':'OwnerId'});db[_0xa18c('0x79')][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'as':_0xa18c('0x158'),'foreignKey':_0xa18c('0x159'),'onDelete':_0xa18c('0x10d')});db['CmHopperBlack'][_0xa18c('0x11b')](db[_0xa18c('0x122')],{'as':_0xa18c('0x165'),'foreignKey':_0xa18c('0x166'),'onDelete':_0xa18c('0x10d')});db['CmHopperBlack'][_0xa18c('0x11b')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0xa18c('0x145'),'onDelete':_0xa18c('0x10d')});db[_0xa18c('0x79')][_0xa18c('0x11b')](db[_0xa18c('0xe4')],{'as':_0xa18c('0xe4'),'foreignKey':_0xa18c('0x199'),'onDelete':_0xa18c('0x10d')});db['Automation']['hasMany'](db[_0xa18c('0x19a')],{'as':{'plural':_0xa18c('0x19b'),'singular':_0xa18c('0x19c')},'foreignKey':_0xa18c('0x19d'),'onDelete':_0xa18c('0x10d'),'hooks':!![]});db['Automation'][_0xa18c('0x10e')](db[_0xa18c('0x19a')],{'as':{'plural':'Any','singular':_0xa18c('0x19e')},'foreignKey':_0xa18c('0x19f'),'onDelete':_0xa18c('0x10d'),'hooks':!![]});db[_0xa18c('0x7f')][_0xa18c('0x10e')](db[_0xa18c('0x1a0')],{'as':_0xa18c('0x1a1'),'foreignKey':_0xa18c('0x1a2'),'onDelete':_0xa18c('0x10d'),'hooks':!![]});db[_0xa18c('0x161')]['hasMany'](db[_0xa18c('0x161')],{'as':_0xa18c('0x162'),'foreignKey':_0xa18c('0x1a3'),'onDelete':'cascade'});db[_0xa18c('0x14d')][_0xa18c('0x10e')](db[_0xa18c('0x14d')],{'as':_0xa18c('0x1a4'),'foreignKey':_0xa18c('0x14e'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0xa18c('0x14d')][_0xa18c('0x10e')](db[_0xa18c('0x110')],{'as':_0xa18c('0x111'),'foreignKey':_0xa18c('0x14e'),'onDelete':_0xa18c('0x15e')});db[_0xa18c('0x14d')]['hasMany'](db['MailApplication'],{'as':_0xa18c('0x1a5'),'foreignKey':_0xa18c('0x14e')});db[_0xa18c('0x14d')]['hasMany'](db[_0xa18c('0x6b')],{'as':_0xa18c('0x1a6'),'foreignKey':_0xa18c('0x14e')});db[_0xa18c('0x14d')][_0xa18c('0x10e')](db[_0xa18c('0x50')],{'as':_0xa18c('0x1a7'),'foreignKey':_0xa18c('0x14e')});db[_0xa18c('0x14d')][_0xa18c('0x10e')](db[_0xa18c('0x58')],{'as':_0xa18c('0x1a8'),'foreignKey':_0xa18c('0x14e')});db[_0xa18c('0x8b')][_0xa18c('0x11b')](db[_0xa18c('0x40')],{});db[_0xa18c('0x8b')][_0xa18c('0x11b')](db[_0xa18c('0x99')],{'foreignKey':_0xa18c('0x1a9')});db[_0xa18c('0x8b')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0xa18c('0x1aa')});db[_0xa18c('0x8d')][_0xa18c('0x11d')](db[_0xa18c('0x1c')],{'as':_0xa18c('0x1ab'),'through':_0xa18c('0x1ac'),'onDelete':'restrict'});db[_0xa18c('0x16d')][_0xa18c('0x11d')](db[_0xa18c('0x76')],{'through':_0xa18c('0x198')});db[_0xa18c('0x16d')]['belongsToMany'](db[_0xa18c('0x6d')],{'through':_0xa18c('0x192')});db['Tag'][_0xa18c('0x11d')](db[_0xa18c('0x45')],{'through':'mail_interaction_has_tags'});db[_0xa18c('0x16d')]['belongsToMany'](db[_0xa18c('0x5a')],{'through':_0xa18c('0x182')});db[_0xa18c('0x16d')][_0xa18c('0x11d')](db[_0xa18c('0x52')],{'through':_0xa18c('0x17b')});db['Tag']['belongsToMany'](db['OpenchannelInteraction'],{'through':_0xa18c('0x186')});db[_0xa18c('0x16d')][_0xa18c('0x11d')](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0xa18c('0x90')]['hasMany'](db[_0xa18c('0x19a')],{'as':{'plural':_0xa18c('0x1ad'),'singular':'AllCondition'},'foreignKey':_0xa18c('0x1ae'),'onDelete':_0xa18c('0x10d'),'hooks':!![]});db[_0xa18c('0x90')][_0xa18c('0x10e')](db[_0xa18c('0x19a')],{'as':{'plural':_0xa18c('0x1af'),'singular':'AnyCondition'},'foreignKey':_0xa18c('0x1b0'),'onDelete':_0xa18c('0x10d'),'hooks':!![]});db[_0xa18c('0x90')]['hasMany'](db['Action'],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xa18c('0x10d'),'hooks':!![]});db[_0xa18c('0x97')][_0xa18c('0x10e')](db[_0xa18c('0x9d')],{'as':_0xa18c('0x1b1'),'onDelete':'cascade','foreignKey':_0xa18c('0x1aa'),'hooks':!![]});db['AnalyticDefaultReport'][_0xa18c('0x10e')](db[_0xa18c('0x9d')],{'as':_0xa18c('0x1b1'),'onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1a9')});db[_0xa18c('0x9b')]['hasMany'](db[_0xa18c('0x9d')],{'as':_0xa18c('0x1b1'),'onDelete':'cascade','foreignKey':_0xa18c('0x1b2')});db[_0xa18c('0x9d')][_0xa18c('0x11b')](db[_0xa18c('0x9b')],{'foreignKey':_0xa18c('0x1b2')});db[_0xa18c('0xa0')][_0xa18c('0x10e')](db['SalesforceConfiguration'],{'as':_0xa18c('0x1b3'),'onDelete':_0xa18c('0x10d'),'foreignKey':'AccountId'});db[_0xa18c('0xa1')][_0xa18c('0x10e')](db['SalesforceField'],{'as':_0xa18c('0x1b4'),'onDelete':'cascade','foreignKey':_0xa18c('0x1b5')});db[_0xa18c('0xa1')][_0xa18c('0x10e')](db[_0xa18c('0xa3')],{'as':_0xa18c('0x1b6'),'onDelete':'cascade','foreignKey':_0xa18c('0x1b7')});db[_0xa18c('0xa1')][_0xa18c('0x10e')](db[_0xa18c('0xa3')],{'as':_0xa18c('0x1b1'),'onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xa1')][_0xa18c('0x11b')](db[_0xa18c('0xa0')],{'as':_0xa18c('0x172'),'foreignKey':'AccountId'});db['SalesforceField']['hasMany'](db[_0xa18c('0xa3')],{'as':_0xa18c('0x1b9'),'foreignKey':_0xa18c('0x1b5')});db[_0xa18c('0xa3')][_0xa18c('0x10e')](db[_0xa18c('0xa3')],{'as':_0xa18c('0x1ba'),'foreignKey':_0xa18c('0x1b7')});db[_0xa18c('0xa3')][_0xa18c('0x10e')](db[_0xa18c('0xa3')],{'as':'Field','foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xa3')][_0xa18c('0x11b')](db[_0xa18c('0x92')],{'as':_0xa18c('0x92'),'foreignKey':_0xa18c('0x1bb')});db[_0xa18c('0x1bc')][_0xa18c('0x10e')](db[_0xa18c('0xa6')],{'as':_0xa18c('0x1b3'),'onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1bd')});db['SugarcrmConfiguration'][_0xa18c('0x10e')](db[_0xa18c('0xa8')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xa18c('0x1b5')});db[_0xa18c('0xa6')][_0xa18c('0x10e')](db[_0xa18c('0xa8')],{'as':_0xa18c('0x1b6'),'onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1b7')});db['SugarcrmConfiguration']['hasMany'](db[_0xa18c('0xa8')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xa6')]['belongsTo'](db['SugarcrmAccount'],{'as':_0xa18c('0x172'),'foreignKey':_0xa18c('0x1bd')});db['SugarcrmField'][_0xa18c('0x10e')](db[_0xa18c('0xa8')],{'as':_0xa18c('0x1b9'),'foreignKey':_0xa18c('0x1b5')});db[_0xa18c('0xa8')][_0xa18c('0x10e')](db[_0xa18c('0xa8')],{'as':_0xa18c('0x1ba'),'foreignKey':_0xa18c('0x1b7')});db['SugarcrmField']['hasMany'](db[_0xa18c('0xa8')],{'as':'Field','foreignKey':_0xa18c('0x1b8')});db['SugarcrmField'][_0xa18c('0x11b')](db['Variable'],{'as':'Variable','foreignKey':_0xa18c('0x1bb')});db[_0xa18c('0xaa')][_0xa18c('0x10e')](db[_0xa18c('0xac')],{'as':_0xa18c('0x1b3'),'onDelete':_0xa18c('0x10d'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xa18c('0x10e')](db[_0xa18c('0xae')],{'as':'Subjects','onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1b5')});db[_0xa18c('0xac')][_0xa18c('0x10e')](db[_0xa18c('0xae')],{'as':_0xa18c('0x1b6'),'onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1b7')});db['DeskConfiguration'][_0xa18c('0x10e')](db[_0xa18c('0xae')],{'as':_0xa18c('0x1b1'),'onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xac')]['belongsTo'](db['DeskAccount'],{'as':_0xa18c('0x172'),'foreignKey':_0xa18c('0x1bd')});db[_0xa18c('0xac')][_0xa18c('0x11d')](db[_0xa18c('0x16d')],{'through':_0xa18c('0x1be')});db[_0xa18c('0xae')][_0xa18c('0x10e')](db[_0xa18c('0xae')],{'as':_0xa18c('0x1b9'),'foreignKey':_0xa18c('0x1b5')});db[_0xa18c('0xae')]['hasMany'](db[_0xa18c('0xae')],{'as':_0xa18c('0x1ba'),'foreignKey':_0xa18c('0x1b7')});db[_0xa18c('0xae')][_0xa18c('0x10e')](db['DeskField'],{'as':'Field','foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xae')][_0xa18c('0x11b')](db[_0xa18c('0x92')],{'as':_0xa18c('0x92'),'foreignKey':_0xa18c('0x1bb')});db['ZohoAccount'][_0xa18c('0x10e')](db[_0xa18c('0xb1')],{'as':_0xa18c('0x1b3'),'onDelete':'cascade','foreignKey':'AccountId'});db['ZohoConfiguration']['hasMany'](db[_0xa18c('0xb3')],{'as':_0xa18c('0x1b4'),'onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1b5')});db[_0xa18c('0xb1')][_0xa18c('0x10e')](db[_0xa18c('0xb3')],{'as':_0xa18c('0x1b6'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['ZohoConfiguration'][_0xa18c('0x10e')](db['ZohoField'],{'as':_0xa18c('0x1b1'),'onDelete':'cascade','foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xb1')][_0xa18c('0x11b')](db[_0xa18c('0x1bf')],{'as':'Account','foreignKey':_0xa18c('0x1bd')});db[_0xa18c('0xb3')]['hasMany'](db['ZohoField'],{'as':_0xa18c('0x1b9'),'foreignKey':_0xa18c('0x1b5')});db['ZohoField']['hasMany'](db[_0xa18c('0xb3')],{'as':_0xa18c('0x1ba'),'foreignKey':'DescriptionId'});db[_0xa18c('0xb3')]['hasMany'](db[_0xa18c('0xb3')],{'as':_0xa18c('0x1c0'),'foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xb3')][_0xa18c('0x11b')](db[_0xa18c('0x92')],{'as':_0xa18c('0x92'),'foreignKey':_0xa18c('0x1bb')});db[_0xa18c('0xb5')]['hasMany'](db[_0xa18c('0xb7')],{'as':_0xa18c('0x1b3'),'onDelete':_0xa18c('0x10d'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xa18c('0x10e')](db['ZendeskField'],{'as':_0xa18c('0x1b4'),'foreignKey':_0xa18c('0x1b5')});db['ZendeskConfiguration'][_0xa18c('0x10e')](db[_0xa18c('0xb9')],{'as':_0xa18c('0x1b6'),'foreignKey':_0xa18c('0x1b7')});db[_0xa18c('0xb7')][_0xa18c('0x10e')](db['ZendeskField'],{'as':'Fields','foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xb7')][_0xa18c('0x11b')](db[_0xa18c('0xb5')],{'as':'Account','foreignKey':_0xa18c('0x1bd')});db[_0xa18c('0xb7')]['belongsToMany'](db['Tag'],{'through':_0xa18c('0x1c1')});db['ZendeskField'][_0xa18c('0x10e')](db[_0xa18c('0xb9')],{'as':'Subject','foreignKey':_0xa18c('0x1b5')});db[_0xa18c('0xb9')][_0xa18c('0x10e')](db[_0xa18c('0xb9')],{'as':_0xa18c('0x1ba'),'foreignKey':_0xa18c('0x1b7')});db[_0xa18c('0xb9')]['hasMany'](db[_0xa18c('0xb9')],{'as':_0xa18c('0x1c0'),'foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xb9')][_0xa18c('0x11b')](db[_0xa18c('0x92')],{'as':_0xa18c('0x92'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0xa18c('0x10e')](db[_0xa18c('0xbd')],{'as':_0xa18c('0x1b3'),'onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1bd')});db['FreshdeskConfiguration'][_0xa18c('0x10e')](db[_0xa18c('0xbf')],{'as':_0xa18c('0x1b4'),'onDelete':'cascade','foreignKey':_0xa18c('0x1b5')});db[_0xa18c('0xbd')][_0xa18c('0x10e')](db[_0xa18c('0xbf')],{'as':_0xa18c('0x1b6'),'onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1b7')});db[_0xa18c('0xbd')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xbd')][_0xa18c('0x11b')](db[_0xa18c('0xbb')],{'as':_0xa18c('0x172'),'foreignKey':_0xa18c('0x1bd')});db['FreshdeskConfiguration'][_0xa18c('0x11d')](db[_0xa18c('0x16d')],{'through':_0xa18c('0x1c2')});db[_0xa18c('0xbf')][_0xa18c('0x10e')](db[_0xa18c('0xbf')],{'as':_0xa18c('0x1b9'),'foreignKey':_0xa18c('0x1b5')});db['FreshdeskField'][_0xa18c('0x10e')](db['FreshdeskField'],{'as':_0xa18c('0x1ba'),'foreignKey':_0xa18c('0x1b7')});db['FreshdeskField'][_0xa18c('0x10e')](db['FreshdeskField'],{'as':_0xa18c('0x1c0'),'foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xbf')][_0xa18c('0x11b')](db['Variable'],{'as':_0xa18c('0x92'),'foreignKey':_0xa18c('0x1bb')});db['VtigerAccount']['hasMany'](db[_0xa18c('0xc2')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xa18c('0x1bd')});db[_0xa18c('0xc2')]['hasMany'](db[_0xa18c('0x1c3')],{'as':'Subjects','foreignKey':_0xa18c('0x1b5')});db[_0xa18c('0xc2')][_0xa18c('0x10e')](db['VtigerField'],{'as':_0xa18c('0x1b6'),'foreignKey':_0xa18c('0x1b7')});db[_0xa18c('0xc2')][_0xa18c('0x10e')](db[_0xa18c('0x1c3')],{'as':'Fields','foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xc2')][_0xa18c('0x11b')](db['VtigerAccount'],{'as':_0xa18c('0x172'),'foreignKey':'AccountId'});db[_0xa18c('0x1c3')][_0xa18c('0x10e')](db[_0xa18c('0x1c3')],{'as':_0xa18c('0x1b9'),'foreignKey':_0xa18c('0x1b5')});db[_0xa18c('0x1c3')]['hasMany'](db[_0xa18c('0x1c3')],{'as':_0xa18c('0x1ba'),'foreignKey':_0xa18c('0x1b7')});db[_0xa18c('0x1c3')][_0xa18c('0x10e')](db['VtigerField'],{'as':_0xa18c('0x1c0'),'foreignKey':'FieldId'});db[_0xa18c('0x1c3')][_0xa18c('0x11b')](db[_0xa18c('0x92')],{'as':_0xa18c('0x92'),'foreignKey':'VariableId'});db[_0xa18c('0xc5')]['hasMany'](db[_0xa18c('0xc6')],{'as':'Configurations','onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1bd')});db[_0xa18c('0xc6')][_0xa18c('0x10e')](db[_0xa18c('0x1c4')],{'as':_0xa18c('0x1b4'),'foreignKey':'SubjectId'});db[_0xa18c('0xc6')][_0xa18c('0x10e')](db[_0xa18c('0x1c4')],{'as':_0xa18c('0x1b6'),'foreignKey':_0xa18c('0x1b7')});db[_0xa18c('0xc6')][_0xa18c('0x10e')](db[_0xa18c('0x1c4')],{'as':_0xa18c('0x1b1'),'foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xc6')][_0xa18c('0x11b')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0xa18c('0x1bd')});db[_0xa18c('0x1c4')][_0xa18c('0x10e')](db['ServicenowField'],{'as':_0xa18c('0x1b9'),'foreignKey':'SubjectId'});db[_0xa18c('0x1c4')][_0xa18c('0x10e')](db['ServicenowField'],{'as':_0xa18c('0x1ba'),'foreignKey':'DescriptionId'});db[_0xa18c('0x1c4')][_0xa18c('0x10e')](db['ServicenowField'],{'as':_0xa18c('0x1c0'),'foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0x1c4')][_0xa18c('0x11b')](db[_0xa18c('0x92')],{'as':'Variable','foreignKey':_0xa18c('0x1bb')});db[_0xa18c('0x1c5')][_0xa18c('0x10e')](db[_0xa18c('0xca')],{'as':'Configurations','onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1bd')});db[_0xa18c('0x1c5')][_0xa18c('0x11b')](db[_0xa18c('0x15c')],{'as':_0xa18c('0x15c'),'foreignKey':_0xa18c('0x15d')});db[_0xa18c('0xca')][_0xa18c('0x10e')](db[_0xa18c('0xcc')],{'as':_0xa18c('0x1b4'),'onDelete':'cascade','foreignKey':_0xa18c('0x1b5')});db['Dynamics365Configuration'][_0xa18c('0x10e')](db[_0xa18c('0xcc')],{'as':_0xa18c('0x1b6'),'onDelete':_0xa18c('0x10d'),'foreignKey':'DescriptionId'});db[_0xa18c('0xca')]['hasMany'](db['Dynamics365Field'],{'as':_0xa18c('0x1b1'),'onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xca')][_0xa18c('0x11b')](db[_0xa18c('0x1c5')],{'as':_0xa18c('0x172'),'foreignKey':_0xa18c('0x1bd')});db['Dynamics365Field'][_0xa18c('0x10e')](db[_0xa18c('0xcc')],{'as':_0xa18c('0x1b9'),'foreignKey':'SubjectId'});db[_0xa18c('0xcc')][_0xa18c('0x10e')](db[_0xa18c('0xcc')],{'as':_0xa18c('0x1ba'),'foreignKey':_0xa18c('0x1b7')});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':_0xa18c('0x1c0'),'foreignKey':_0xa18c('0x1b8')});db[_0xa18c('0xcc')][_0xa18c('0x11b')](db[_0xa18c('0x92')],{'as':_0xa18c('0x92'),'foreignKey':_0xa18c('0x1bb')});db['FreshsalesAccount'][_0xa18c('0x10e')](db[_0xa18c('0x1c6')],{'as':_0xa18c('0x1b3'),'onDelete':'cascade','foreignKey':_0xa18c('0x1bd')});db[_0xa18c('0x1c6')][_0xa18c('0x10e')](db[_0xa18c('0xd1')],{'as':_0xa18c('0x1b4'),'foreignKey':_0xa18c('0x1b5')});db[_0xa18c('0x1c6')][_0xa18c('0x10e')](db[_0xa18c('0xd1')],{'as':_0xa18c('0x1b6'),'foreignKey':_0xa18c('0x1b7')});db[_0xa18c('0x1c6')][_0xa18c('0x10e')](db['FreshsalesField'],{'as':_0xa18c('0x1b1'),'foreignKey':'FieldId'});db[_0xa18c('0x1c6')][_0xa18c('0x11b')](db['FreshsalesAccount'],{'as':_0xa18c('0x172'),'foreignKey':'AccountId'});db['FreshsalesField'][_0xa18c('0x10e')](db['FreshsalesField'],{'as':_0xa18c('0x1b9'),'foreignKey':_0xa18c('0x1b5')});db[_0xa18c('0xd1')][_0xa18c('0x10e')](db[_0xa18c('0xd1')],{'as':_0xa18c('0x1ba'),'foreignKey':_0xa18c('0x1b7')});db[_0xa18c('0xd1')][_0xa18c('0x10e')](db[_0xa18c('0xd1')],{'as':_0xa18c('0x1c0'),'foreignKey':_0xa18c('0x1b8')});db['FreshsalesField'][_0xa18c('0x11b')](db[_0xa18c('0x92')],{'as':_0xa18c('0x92'),'foreignKey':'VariableId'});db[_0xa18c('0x1c7')][_0xa18c('0x11b')](db[_0xa18c('0x67')],{});db[_0xa18c('0x1c7')][_0xa18c('0x11b')](db[_0xa18c('0x122')],{'as':'List','foreignKey':_0xa18c('0x166')});db['ChatQueueReport'][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'as':'Contact','foreignKey':_0xa18c('0x159')});db[_0xa18c('0x1c7')][_0xa18c('0x11b')](db[_0xa18c('0x6d')],{});db[_0xa18c('0x1c7')][_0xa18c('0x11b')](db[_0xa18c('0x18c')],{});db[_0xa18c('0x1c7')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{});db['ChatQueueReport'][_0xa18c('0x11b')](db['ChatQueue'],{});db[_0xa18c('0xd4')]['belongsTo'](db[_0xa18c('0x14')],{'onDelete':'cascade','foreignKey':_0xa18c('0x1c8')});db[_0xa18c('0xd4')]['belongsTo'](db[_0xa18c('0x14')],{'onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1c9')});db[_0xa18c('0x14a')][_0xa18c('0x10e')](db[_0xa18c('0x1ca')],{'foreignKey':_0xa18c('0x1cb'),'onDelete':'cascade'});db['JscriptySessionReport']['hasMany'](db[_0xa18c('0xd5')],{'foreignKey':_0xa18c('0x1cb'),'onDelete':'cascade'});db['SmsQueueReport'][_0xa18c('0x11b')](db['SmsAccount'],{});db['SmsQueueReport']['belongsTo'](db['CmList'],{'as':_0xa18c('0x165'),'foreignKey':_0xa18c('0x166')});db[_0xa18c('0xd7')][_0xa18c('0x11b')](db['CmContact'],{'as':'Contact','foreignKey':_0xa18c('0x159')});db[_0xa18c('0xd7')][_0xa18c('0x11b')](db[_0xa18c('0x5a')],{});db[_0xa18c('0xd7')][_0xa18c('0x11b')](db['SmsMessage'],{});db[_0xa18c('0xd7')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{});db[_0xa18c('0xd7')][_0xa18c('0x11b')](db[_0xa18c('0x5d')],{});db[_0xa18c('0x1cc')][_0xa18c('0x10e')](db[_0xa18c('0x14a')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0xa18c('0x10e')](db['JscriptyQuestionReport'],{'foreignKey':_0xa18c('0x1cd')});db[_0xa18c('0x1cc')][_0xa18c('0x10e')](db[_0xa18c('0xd5')],{'foreignKey':_0xa18c('0x1cd')});db[_0xa18c('0xdd')]['belongsToMany'](db['User'],{'as':_0xa18c('0x16f'),'through':_0xa18c('0x13f')});db[_0xa18c('0x125')][_0xa18c('0x11d')](db['User'],{'as':'Agents','through':_0xa18c('0x126')});db[_0xa18c('0x125')][_0xa18c('0x11d')](db['VoiceQueue'],{'through':_0xa18c('0x105'),'as':'VoiceQueues'});db['Team'][_0xa18c('0x11d')](db[_0xa18c('0x42')],{'through':'team_has_mail_queues','as':_0xa18c('0x12e')});db[_0xa18c('0x125')]['belongsToMany'](db[_0xa18c('0x71')],{'through':_0xa18c('0x1ce'),'as':'ChatQueues'});db['Team'][_0xa18c('0x11d')](db[_0xa18c('0x130')],{'through':_0xa18c('0x1cf'),'as':_0xa18c('0x131')});db['Team'][_0xa18c('0x11d')](db[_0xa18c('0x5d')],{'through':_0xa18c('0x183'),'as':_0xa18c('0x132')});db[_0xa18c('0x125')]['belongsToMany'](db[_0xa18c('0x66')],{'through':_0xa18c('0x188'),'as':_0xa18c('0x133')});db[_0xa18c('0x125')][_0xa18c('0x11d')](db[_0xa18c('0x102')],{'through':_0xa18c('0x1d0'),'as':_0xa18c('0x134')});db[_0xa18c('0x125')][_0xa18c('0x11d')](db[_0xa18c('0xf2')],{'through':_0xa18c('0x106'),'as':_0xa18c('0x1d1')});db[_0xa18c('0xe4')][_0xa18c('0x10e')](db[_0xa18c('0x146')],{'as':_0xa18c('0x147'),'foreignKey':_0xa18c('0x199')});db['Campaign'][_0xa18c('0x10e')](db[_0xa18c('0x7a')],{'as':'HopperFinals','foreignKey':_0xa18c('0x199')});db[_0xa18c('0xe4')][_0xa18c('0x10e')](db[_0xa18c('0x113')],{'as':_0xa18c('0x148'),'foreignKey':_0xa18c('0x199')});db[_0xa18c('0xe4')][_0xa18c('0x10e')](db['CmHopperBlack'],{'as':_0xa18c('0x149'),'foreignKey':'CampaignId'});db[_0xa18c('0xe4')][_0xa18c('0x11b')](db[_0xa18c('0x2e')],{'as':'Trunk','foreignKey':_0xa18c('0x14b')});db[_0xa18c('0xe4')][_0xa18c('0x11b')](db[_0xa18c('0x2e')],{'as':_0xa18c('0x1d2'),'foreignKey':_0xa18c('0x14c')});db[_0xa18c('0xe4')]['belongsTo'](db[_0xa18c('0x14d')],{'as':_0xa18c('0x14d'),'foreignKey':'IntervalId'});db[_0xa18c('0xe4')][_0xa18c('0x11b')](db[_0xa18c('0xdd')],{'as':_0xa18c('0xdd'),'foreignKey':_0xa18c('0x1d3')});db[_0xa18c('0xe4')][_0xa18c('0x11d')](db[_0xa18c('0x122')],{'as':_0xa18c('0x123'),'through':'campaigns_has_cm_lists'});db[_0xa18c('0xe4')][_0xa18c('0x11d')](db[_0xa18c('0x122')],{'as':_0xa18c('0x150'),'through':_0xa18c('0x1d4')});db[_0xa18c('0xe7')][_0xa18c('0x11b')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0xa18c('0x194')});db['MailTransferReport'][_0xa18c('0x11b')](db[_0xa18c('0x47')],{});db['MailTransferReport'][_0xa18c('0x11b')](db[_0xa18c('0x45')],{});db[_0xa18c('0x1d5')][_0xa18c('0x11b')](db[_0xa18c('0x40')],{'foreignKey':_0xa18c('0x1d6'),'as':'FromAccount'});db[_0xa18c('0x1d5')][_0xa18c('0x11b')](db['User'],{'foreignKey':'FromUserId','as':_0xa18c('0x1d7')});db[_0xa18c('0x1d5')]['belongsTo'](db[_0xa18c('0x14')],{'foreignKey':'ToUserId','as':'ToAgent'});db['MailTransferReport'][_0xa18c('0x11b')](db[_0xa18c('0x42')],{'foreignKey':_0xa18c('0x1d8'),'as':'ToQueue'});db[_0xa18c('0x1d5')][_0xa18c('0x11b')](db[_0xa18c('0x40')],{'foreignKey':'ToMailAccountId','as':_0xa18c('0x1d9')});db['ChatTransferReport'][_0xa18c('0x11b')](db[_0xa18c('0x18c')],{});db['ChatTransferReport']['belongsTo'](db[_0xa18c('0x6d')],{});db[_0xa18c('0xea')]['belongsTo'](db[_0xa18c('0x67')],{'foreignKey':'FromChatWebsiteId','as':_0xa18c('0x1da')});db[_0xa18c('0xea')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xa18c('0xea')]['belongsTo'](db[_0xa18c('0x14')],{'foreignKey':_0xa18c('0x1db'),'as':_0xa18c('0x1dc')});db[_0xa18c('0xea')][_0xa18c('0x11b')](db[_0xa18c('0x71')],{'foreignKey':_0xa18c('0x1dd'),'as':_0xa18c('0x1de')});db[_0xa18c('0xea')][_0xa18c('0x11b')](db[_0xa18c('0x67')],{'foreignKey':_0xa18c('0x1df'),'as':_0xa18c('0x1d9')});db[_0xa18c('0xec')]['belongsTo'](db[_0xa18c('0x54')],{});db['FaxTransferReport'][_0xa18c('0x11b')](db[_0xa18c('0x52')],{});db[_0xa18c('0xec')][_0xa18c('0x11b')](db[_0xa18c('0x136')],{'foreignKey':'FromFaxAccountId','as':_0xa18c('0x1da')});db[_0xa18c('0xec')][_0xa18c('0x11b')](db['User'],{'foreignKey':_0xa18c('0x1e0'),'as':_0xa18c('0x1d7')});db['FaxTransferReport'][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'foreignKey':'ToUserId','as':_0xa18c('0x1dc')});db[_0xa18c('0xec')][_0xa18c('0x11b')](db[_0xa18c('0x130')],{'foreignKey':_0xa18c('0x1e1'),'as':'ToQueue'});db[_0xa18c('0xec')][_0xa18c('0x11b')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db['OpenchannelTransferReport'][_0xa18c('0x11b')](db[_0xa18c('0x64')],{});db[_0xa18c('0xee')][_0xa18c('0x11b')](db[_0xa18c('0x12b')],{});db[_0xa18c('0xee')][_0xa18c('0x11b')](db[_0xa18c('0x5f')],{'foreignKey':_0xa18c('0x1e2'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'foreignKey':_0xa18c('0x1e0'),'as':_0xa18c('0x1d7')});db[_0xa18c('0xee')][_0xa18c('0x11b')](db['User'],{'foreignKey':_0xa18c('0x1db'),'as':_0xa18c('0x1dc')});db[_0xa18c('0xee')][_0xa18c('0x11b')](db[_0xa18c('0x66')],{'foreignKey':'ToOpenchannelQueueId','as':_0xa18c('0x1de')});db[_0xa18c('0xee')][_0xa18c('0x11b')](db[_0xa18c('0x5f')],{'foreignKey':_0xa18c('0x1e3'),'as':_0xa18c('0x1d9')});db[_0xa18c('0xf0')]['belongsTo'](db['SmsMessage'],{});db[_0xa18c('0xf0')][_0xa18c('0x11b')](db[_0xa18c('0x5a')],{});db[_0xa18c('0xf0')][_0xa18c('0x11b')](db[_0xa18c('0x56')],{'foreignKey':_0xa18c('0x1e4'),'as':_0xa18c('0x1da')});db['SmsTransferReport'][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'foreignKey':_0xa18c('0x1e0'),'as':'FromAgent'});db[_0xa18c('0xf0')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'foreignKey':_0xa18c('0x1db'),'as':_0xa18c('0x1dc')});db[_0xa18c('0xf0')][_0xa18c('0x11b')](db[_0xa18c('0x5d')],{'foreignKey':_0xa18c('0x1e5'),'as':_0xa18c('0x1de')});db[_0xa18c('0xf0')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0xa18c('0x1e6'),'as':_0xa18c('0x1d9')});db['CmList']['hasMany'](db['Disposition'],{'as':_0xa18c('0x162'),'foreignKey':_0xa18c('0x166'),'onDelete':_0xa18c('0x10d')});db[_0xa18c('0x122')][_0xa18c('0x10e')](db[_0xa18c('0x1e7')],{'as':_0xa18c('0x1e8'),'foreignKey':_0xa18c('0x166')});db['CmList']['hasMany'](db[_0xa18c('0x76')],{'as':_0xa18c('0x120'),'onDelete':'cascade','foreignKey':_0xa18c('0x166')});db['CmList'][_0xa18c('0x10e')](db[_0xa18c('0x7a')],{'as':_0xa18c('0x112'),'foreignKey':_0xa18c('0x166')});db['CmList']['hasMany'](db['CmHopperHistory'],{'as':_0xa18c('0x114'),'foreignKey':_0xa18c('0x166')});db[_0xa18c('0x122')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xa18c('0x166')});db[_0xa18c('0x122')]['belongsToMany'](db[_0xa18c('0x1e')],{'as':_0xa18c('0x1e9'),'through':_0xa18c('0x14f')});db[_0xa18c('0x122')]['belongsToMany'](db[_0xa18c('0x14')],{'as':_0xa18c('0x168'),'through':_0xa18c('0x124')});db[_0xa18c('0xf2')][_0xa18c('0x10e')](db['VoiceExtension'],{'as':_0xa18c('0x111'),'onDelete':'cascade'});db[_0xa18c('0xf2')][_0xa18c('0x11d')](db[_0xa18c('0x14')],{'as':_0xa18c('0x168'),'through':'UserVoicePrefix'});db['VoicePrefix'][_0xa18c('0x11d')](db['Team'],{'through':_0xa18c('0x106'),'as':_0xa18c('0x16a')});db[_0xa18c('0xf3')][_0xa18c('0x10e')](db[_0xa18c('0x14')],{'as':'Users','foreignKey':_0xa18c('0x11c')});db[_0xa18c('0xf3')][_0xa18c('0x10e')](db[_0xa18c('0xf4')],{'as':_0xa18c('0x1ea'),'foreignKey':_0xa18c('0x11c'),'onDelete':_0xa18c('0x10d')});db[_0xa18c('0xf4')][_0xa18c('0x10e')](db[_0xa18c('0x1eb')],{'as':_0xa18c('0x1ec'),'foreignKey':'sectionId','onDelete':_0xa18c('0x10d')});db[_0xa18c('0x1ed')]['hasMany'](db[_0xa18c('0x161')],{'as':'Dispositions','foreignKey':'WhatsappAccountId','onDelete':_0xa18c('0x10d')});db[_0xa18c('0x1ed')][_0xa18c('0x10e')](db[_0xa18c('0x163')],{'as':_0xa18c('0x189'),'foreignKey':'WhatsappAccountId'});db[_0xa18c('0x1ed')]['hasMany'](db[_0xa18c('0xfd')],{'as':_0xa18c('0x178'),'foreignKey':_0xa18c('0x1ee')});db[_0xa18c('0x1ed')][_0xa18c('0x10e')](db[_0xa18c('0xfb')],{'as':'Interactions'});db['WhatsappAccount'][_0xa18c('0x10e')](db[_0xa18c('0xf9')],{'as':_0xa18c('0x142')});db['WhatsappAccount']['belongsTo'](db[_0xa18c('0x122')],{'as':_0xa18c('0x165'),'foreignKey':_0xa18c('0x166')});db[_0xa18c('0x1ed')][_0xa18c('0x11b')](db['Pause'],{'as':_0xa18c('0x179'),'foreignKey':_0xa18c('0x167')});db[_0xa18c('0x1ed')][_0xa18c('0x11d')](db[_0xa18c('0x14')],{'as':'Agents','through':'user_has_whatsapp_accounts'});db[_0xa18c('0xf9')][_0xa18c('0x11b')](db['User'],{'onDelete':'restrict'});db[_0xa18c('0xf9')]['belongsTo'](db[_0xa18c('0x102')],{'onDelete':_0xa18c('0x15e')});db[_0xa18c('0xf9')]['belongsTo'](db[_0xa18c('0x1ed')],{'onDelete':_0xa18c('0x15e')});db[_0xa18c('0xf9')]['belongsTo'](db['Interval'],{'onDelete':_0xa18c('0x15e'),'foreignKey':_0xa18c('0x14e')});db[_0xa18c('0xf9')][_0xa18c('0x11b')](db['Tag'],{'onDelete':_0xa18c('0x15e'),'foreignKey':_0xa18c('0x174')});db['WhatsappInteraction'][_0xa18c('0x10e')](db['WhatsappMessage'],{'as':_0xa18c('0x178'),'onDelete':_0xa18c('0x10d'),'foreignKey':_0xa18c('0x1ef')});db['WhatsappInteraction'][_0xa18c('0x11b')](db[_0xa18c('0x1ed')],{'as':_0xa18c('0x172'),'foreignKey':_0xa18c('0x1ee')});db[_0xa18c('0xfb')][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'as':_0xa18c('0x158'),'foreignKey':_0xa18c('0x159')});db[_0xa18c('0xfb')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'as':_0xa18c('0x17a'),'foreignKey':_0xa18c('0x10c')});db[_0xa18c('0xfb')]['belongsToMany'](db['Tag'],{'through':_0xa18c('0x1f0'),'as':'Tags'});db['WhatsappInteraction'][_0xa18c('0x11d')](db['Tag'],{'through':_0xa18c('0x1f0'),'as':_0xa18c('0x16e')});db[_0xa18c('0xfb')][_0xa18c('0x11d')](db[_0xa18c('0x14')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0xa18c('0x1ef')});db[_0xa18c('0xfd')]['belongsTo'](db[_0xa18c('0x14')],{'as':'User'});db[_0xa18c('0xfd')][_0xa18c('0x11b')](db[_0xa18c('0x76')],{'onDelete':_0xa18c('0x10d'),'as':_0xa18c('0x158')});db[_0xa18c('0xfd')][_0xa18c('0x11b')](db[_0xa18c('0xfb')],{'onDelete':'cascade','as':_0xa18c('0x171'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0xa18c('0x11b')](db[_0xa18c('0x1ed')],{'as':_0xa18c('0x172'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0xa18c('0x11b')](db[_0xa18c('0x1ed')],{});db[_0xa18c('0xff')][_0xa18c('0x11b')](db[_0xa18c('0x122')],{'as':_0xa18c('0x165'),'foreignKey':'ListId'});db[_0xa18c('0xff')][_0xa18c('0x11b')](db['CmContact'],{'as':'Contact','foreignKey':_0xa18c('0x159')});db['WhatsappQueueReport'][_0xa18c('0x11b')](db['WhatsappInteraction'],{});db[_0xa18c('0xff')][_0xa18c('0x11b')](db['WhatsappQueue'],{});db['WhatsappQueueReport']['belongsTo'](db[_0xa18c('0xfd')],{});db[_0xa18c('0xff')][_0xa18c('0x11b')](db['User'],{});db['WhatsappTransferReport'][_0xa18c('0x11b')](db['WhatsappMessage'],{});db[_0xa18c('0x101')][_0xa18c('0x11b')](db[_0xa18c('0xfb')],{});db[_0xa18c('0x101')][_0xa18c('0x11b')](db[_0xa18c('0x1ed')],{'foreignKey':_0xa18c('0x1f1'),'as':_0xa18c('0x1da')});db[_0xa18c('0x101')][_0xa18c('0x11b')](db[_0xa18c('0x1ed')],{'foreignKey':_0xa18c('0x1f2'),'as':_0xa18c('0x1d9')});db['WhatsappTransferReport'][_0xa18c('0x11b')](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':'ToQueue'});db[_0xa18c('0x101')][_0xa18c('0x11b')](db['User'],{'foreignKey':_0xa18c('0x1e0'),'as':_0xa18c('0x1d7')});db[_0xa18c('0x101')]['belongsTo'](db[_0xa18c('0x14')],{'foreignKey':_0xa18c('0x1db'),'as':_0xa18c('0x1dc')});db[_0xa18c('0x102')]['belongsToMany'](db[_0xa18c('0x14')],{'as':_0xa18c('0x168'),'through':_0xa18c('0x3b'),'foreignKey':_0xa18c('0x1f3')});db[_0xa18c('0x102')][_0xa18c('0x11d')](db[_0xa18c('0x125')],{'through':_0xa18c('0x1d0'),'as':_0xa18c('0x16a')});db[_0xa18c('0x10a')][_0xa18c('0x11b')](db[_0xa18c('0x14')],{'as':_0xa18c('0x1f4'),'foreignKey':_0xa18c('0x10c'),'onDelete':_0xa18c('0x10d'),'hooks':!![]});db[_0xa18c('0x15c')][_0xa18c('0x10b')](db[_0xa18c('0x1c5')],{'as':_0xa18c('0x1c5'),'onDelete':_0xa18c('0x15e')});db['CloudProvider'][_0xa18c('0x10b')](db['MailServerIn'],{'as':_0xa18c('0x15f'),'onDelete':'restrict'});db[_0xa18c('0x15c')]['hasOne'](db['MailServerOut'],{'as':_0xa18c('0x160'),'onDelete':_0xa18c('0x15e')});module[_0xa18c('0x1f5')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x60c2=['MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','VoiceExtension','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','CmHopper','Hoppers','VoiceQueueId','HopperHistories','JscriptySessions','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','VoiceMailMessage','Messages','mailboxuser','mailbox','uniqueid','VoiceAgentReport','AgentReports','CmContact','Contact','CloudProvider','CloudProviderId','restrict','Imap','Smtp','Dispositions','MailAccountId','CannedAnswer','Answers','MailMessage','Interactions','MailApplication','List','ListId','Agents','team_has_mail_queues','ContactId','Owner','mail_interaction_has_tags','Tags','Users','MailInteractionId','Attachment','Attachments','ChatWebsiteId','ChatOfflineMessageId','TagId','Items','FaxAccountId','FaxApplication','Exntensions','mandatoryDispositionPause','FaxInteractionId','Account','fax_interaction_has_tags','user_has_fax_interactions','Interaction','AttachmentId','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','ThroughTags','SmsQueueId','OpenchannelAccount','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','Agent','Queue','ChatQueueId','ChatMessage','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CmCompany','Contacts','CompanyId','Company','cm_contact_has_tags','OwnerId','CampaignId','OneAll','AutomationAllId','Automation','Any','OneAny','AutomationAnyId','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','Schedule','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','FieldId','Field','SugarcrmConfiguration','Descriptions','DescriptionId','Subject','Description','VariableId','DeskField','int_desk_configuration_has_tags','ZohoField','ZendeskAccount','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','FreshsalesField','ChatQueueReport','FromId','SessionId','ProjectId','JscriptyAnswerReport','VoiceQueues','team_has_sms_queues','TrunkBackup','SquareProjectId','Lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ChatTransferReport','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromAccount','ToFaxQueueId','ToFaxAccountId','ToAccount','FromOpenchannelAccountId','ToOpenchannelQueueId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','UserProfileSection','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','user','exports','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','utf8','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.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','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailInteraction','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsMessage','../api/smsMessage/smsMessage.model','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','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','Action','../api/action/action.model','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','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','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','cascade','UserId','userSetting','VoiceRecording','Recordings','hasMany','VoiceQueuesRt','Extensions','HopperFinals','SmsInteraction','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_whatsapp_interactions','VoicePrefix','VoicePrefixes','MailQueues','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','ChatWebsite','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccount'];(function(_0x570bb5,_0x28dbe4){var _0x428284=function(_0x1c1438){while(--_0x1c1438){_0x570bb5['push'](_0x570bb5['shift']());}};_0x428284(++_0x28dbe4);}(_0x60c2,0xce));var _0x260c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x60c2[_0x502c7d];return _0x30b7ed;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x260c('0x0'));var _=require(_0x260c('0x1'));var jstz=require(_0x260c('0x2'));var timezone=jstz[_0x260c('0x3')]();config[_0x260c('0x0')]=_[_0x260c('0x4')](config['sequelize'],{'database':_0x260c('0x5'),'username':_0x260c('0x6'),'password':_0x260c('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x260c('0x8'),'dialectOptions':{'charset':_0x260c('0x9')},'logging':![],'timezone':timezone[_0x260c('0xa')](),'define':{'charset':'utf8','collate':_0x260c('0xb')}}});config[_0x260c('0xc')]=_['defaultsDeep'](config[_0x260c('0xc')],{'database':_0x260c('0x5'),'username':_0x260c('0x6'),'password':_0x260c('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x260c('0x8'),'dialectOptions':{'charset':_0x260c('0x9')},'logging':![],'timezone':timezone[_0x260c('0xa')](),'define':{'charset':_0x260c('0xd'),'collate':_0x260c('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x260c('0x0')][_0x260c('0xe')],config[_0x260c('0x0')][_0x260c('0xf')],config[_0x260c('0x0')][_0x260c('0x10')],config[_0x260c('0x0')][_0x260c('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x260c('0xc')][_0x260c('0xe')],config[_0x260c('0xc')][_0x260c('0xf')],config['sequelizeHistory'][_0x260c('0x10')],config[_0x260c('0xc')]['options'])};db[_0x260c('0x12')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x14'));db[_0x260c('0x15')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x16'));db['VoiceContext']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x17'));db['VoiceExtension']=db['sequelize'][_0x260c('0x13')](_0x260c('0x18'));db['VoiceMusicOnHold']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x19'));db[_0x260c('0x1a')]=db['sequelize'][_0x260c('0x13')](_0x260c('0x1b'));db['VoiceRecording']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x1c'));db['ScreenRecording']=db[_0x260c('0x0')]['import'](_0x260c('0x1d'));db[_0x260c('0x1e')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x1f'));db['VoiceMailMessage']=db['sequelize'][_0x260c('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x260c('0x20')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x21'));db[_0x260c('0x22')]=db[_0x260c('0x0')]['import'](_0x260c('0x23'));db['VoiceAgentReport']=db[_0x260c('0x0')]['import']('../api/voiceAgentReport/voiceAgentReport.model');db[_0x260c('0x24')]=db['sequelize'][_0x260c('0x13')](_0x260c('0x25'));db[_0x260c('0x26')]=db['sequelize'][_0x260c('0x13')](_0x260c('0x27'));db[_0x260c('0x28')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x29'));db[_0x260c('0x2a')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x2b'));db[_0x260c('0x2c')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x2d'));db[_0x260c('0x2e')]=db['sequelize'][_0x260c('0x13')](_0x260c('0x2f'));db[_0x260c('0x30')]=db['sequelize'][_0x260c('0x13')](_0x260c('0x31'));db[_0x260c('0x32')]=db[_0x260c('0x0')][_0x260c('0x13')]('../api/userMailQueue/userMailQueue.model');db[_0x260c('0x33')]=db['sequelize']['import'](_0x260c('0x34'));db[_0x260c('0x35')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x36'));db[_0x260c('0x37')]=db[_0x260c('0x0')]['import'](_0x260c('0x38'));db[_0x260c('0x39')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x3a'));db[_0x260c('0x3b')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x3c'));db[_0x260c('0x3d')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x3e'));db['MailAccount']=db['sequelize']['import'](_0x260c('0x3f'));db[_0x260c('0x40')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x41'));db['MailSubstatus']=db[_0x260c('0x0')][_0x260c('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0x260c('0x42')]=db[_0x260c('0x0')][_0x260c('0x13')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0x260c('0x0')]['import'](_0x260c('0x43'));db['MailApplication']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x44'));db[_0x260c('0x45')]=db['sequelize']['import'](_0x260c('0x46'));db[_0x260c('0x47')]=db[_0x260c('0x0')]['import'](_0x260c('0x48'));db[_0x260c('0x49')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x4a'));db[_0x260c('0x4b')]=db[_0x260c('0x0')][_0x260c('0x13')]('../api/faxAccount/faxAccount.model');db['FaxApplication']=db[_0x260c('0x0')]['import'](_0x260c('0x4c'));db['FaxInteraction']=db[_0x260c('0x0')]['import'](_0x260c('0x4d'));db[_0x260c('0x4e')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x4f'));db[_0x260c('0x50')]=db['sequelize']['import'](_0x260c('0x51'));db[_0x260c('0x52')]=db[_0x260c('0x0')]['import'](_0x260c('0x53'));db[_0x260c('0x54')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x55'));db[_0x260c('0x56')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x57'));db['SmsInteraction']=db[_0x260c('0x0')]['import']('../api/smsInteraction/smsInteraction.model');db[_0x260c('0x58')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x59'));db[_0x260c('0x5a')]=db[_0x260c('0x0')]['import'](_0x260c('0x5b'));db['OpenchannelAccount']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x5c'));db[_0x260c('0x5d')]=db[_0x260c('0x0')]['import'](_0x260c('0x5e'));db[_0x260c('0x5f')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x60'));db[_0x260c('0x61')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x62'));db[_0x260c('0x63')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x64'));db['ChatWebsite']=db['sequelize'][_0x260c('0x13')](_0x260c('0x65'));db[_0x260c('0x66')]=db[_0x260c('0x0')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x260c('0x67')]=db['sequelize'][_0x260c('0x13')]('../api/chatApplication/chatApplication.model');db[_0x260c('0x68')]=db[_0x260c('0x0')]['import'](_0x260c('0x69'));db['ChatMessage']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x6a'));db[_0x260c('0x6b')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x6c'));db['ChatQueue']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x6d'));db[_0x260c('0x6e')]=db[_0x260c('0x0')]['import']('../api/chatGroup/chatGroup.model');db[_0x260c('0x6f')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x70'));db['CmCompany']=db[_0x260c('0x0')][_0x260c('0x13')]('../api/cmCompany/cmCompany.model');db['CmContact']=db[_0x260c('0x0')][_0x260c('0x13')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x71'));db[_0x260c('0x72')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x73'));db[_0x260c('0x74')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x75'));db[_0x260c('0x76')]=db['sequelize'][_0x260c('0x13')](_0x260c('0x77'));db[_0x260c('0x78')]=db[_0x260c('0x0')]['import']('../api/reportAgentPreview/reportAgentPreview.model');db[_0x260c('0x79')]=db[_0x260c('0x0')][_0x260c('0x13')]('../api/cmCustomField/cmCustomField.model');db[_0x260c('0x7a')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x7b'));db['Automation']=db['sequelize'][_0x260c('0x13')](_0x260c('0x7c'));db['CannedAnswer']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x7d'));db[_0x260c('0x7e')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x7f'));db[_0x260c('0x80')]=db['sequelize'][_0x260c('0x13')](_0x260c('0x81'));db[_0x260c('0x82')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x83'));db[_0x260c('0x84')]=db['sequelize']['import'](_0x260c('0x85'));db[_0x260c('0x86')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x87'));db[_0x260c('0x88')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x89'));db['Schedule']=db[_0x260c('0x0')][_0x260c('0x13')]('../api/schedule/schedule.model');db[_0x260c('0x8a')]=db['sequelize'][_0x260c('0x13')](_0x260c('0x8b'));db[_0x260c('0x8c')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x8d'));db[_0x260c('0x8e')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x8f'));db[_0x260c('0x90')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x91'));db[_0x260c('0x92')]=db[_0x260c('0x0')][_0x260c('0x13')]('../api/variable/variable.model');db[_0x260c('0x93')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x94'));db[_0x260c('0x95')]=db[_0x260c('0x0')]['import']('../api/integrationReport/integrationReport.model');db[_0x260c('0x96')]=db[_0x260c('0x0')]['import'](_0x260c('0x97'));db['AnalyticDefaultReport']=db[_0x260c('0x0')][_0x260c('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x260c('0x98')]=db[_0x260c('0x0')]['import'](_0x260c('0x99'));db[_0x260c('0x9a')]=db[_0x260c('0x0')][_0x260c('0x13')]('../api/analyticMetric/analyticMetric.model');db[_0x260c('0x9b')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x9c'));db[_0x260c('0x9d')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x9e'));db[_0x260c('0x9f')]=db['sequelize'][_0x260c('0x13')](_0x260c('0xa0'));db['SalesforceConfiguration']=db[_0x260c('0x0')][_0x260c('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x260c('0xa1')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xa2'));db[_0x260c('0xa3')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xa4'));db['SugarcrmConfiguration']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xa5'));db[_0x260c('0xa6')]=db[_0x260c('0x0')]['import'](_0x260c('0xa7'));db[_0x260c('0xa8')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xa9'));db[_0x260c('0xaa')]=db['sequelize'][_0x260c('0x13')](_0x260c('0xab'));db['DeskField']=db[_0x260c('0x0')]['import'](_0x260c('0xac'));db[_0x260c('0xad')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xae'));db[_0x260c('0xaf')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xb0'));db['ZohoField']=db[_0x260c('0x0')]['import'](_0x260c('0xb1'));db['ZendeskAccount']=db['sequelize'][_0x260c('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x260c('0xb2')]=db[_0x260c('0x0')]['import'](_0x260c('0xb3'));db['ZendeskField']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xb4'));db[_0x260c('0xb5')]=db[_0x260c('0x0')][_0x260c('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x260c('0xb6')]=db['sequelize'][_0x260c('0x13')](_0x260c('0xb7'));db[_0x260c('0xb8')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xb9'));db[_0x260c('0xba')]=db[_0x260c('0x0')]['import'](_0x260c('0xbb'));db[_0x260c('0xbc')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xbd'));db[_0x260c('0xbe')]=db['sequelize'][_0x260c('0x13')](_0x260c('0xbf'));db[_0x260c('0xc0')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xc1'));db[_0x260c('0xc2')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xc3'));db[_0x260c('0xc4')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xc5'));db[_0x260c('0xc6')]=db[_0x260c('0x0')]['import'](_0x260c('0xc7'));db[_0x260c('0xc8')]=db[_0x260c('0x0')]['import'](_0x260c('0xc9'));db[_0x260c('0xca')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xcb'));db[_0x260c('0xcc')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xcd'));db[_0x260c('0xce')]=db['sequelize'][_0x260c('0x13')](_0x260c('0xcf'));db['FreshsalesField']=db['sequelize'][_0x260c('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x260c('0x93')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x94'));db[_0x260c('0xd0')]=db[_0x260c('0x0')]['import'](_0x260c('0xd1'));db['ChatQueueReport']=db['sequelize'][_0x260c('0x13')](_0x260c('0xd2'));db[_0x260c('0xd3')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xd4'));db['JscriptyAnswerReport']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xd5'));db[_0x260c('0xd6')]=db['sequelize'][_0x260c('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x260c('0xd7')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xd8'));db[_0x260c('0xd9')]=db['sequelize']['import']('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x260c('0x0')]['import'](_0x260c('0xda'));db[_0x260c('0xdb')]=db['sequelize'][_0x260c('0x13')](_0x260c('0xdc'));db[_0x260c('0xdd')]=db[_0x260c('0x0')]['import']('../api/jscriptyProject/jscriptyProject.model');db[_0x260c('0xde')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xdf'));db[_0x260c('0xe0')]=db[_0x260c('0x0')][_0x260c('0x13')]('../api/squareOdbc/squareOdbc.model');db[_0x260c('0xe1')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xe2'));db[_0x260c('0xe3')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xe4'));db[_0x260c('0xe5')]=db[_0x260c('0x0')]['import'](_0x260c('0xe6'));db[_0x260c('0xe7')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xe8'));db['License']=db['sequelize'][_0x260c('0x13')](_0x260c('0xe9'));db[_0x260c('0xea')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xeb'));db[_0x260c('0xec')]=db['sequelize'][_0x260c('0x13')](_0x260c('0xed'));db['Attachment']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xee'));db[_0x260c('0xef')]=db[_0x260c('0x0')][_0x260c('0x13')]('../api/plugin/plugin.model');db[_0x260c('0xf0')]=db[_0x260c('0x0')]['import'](_0x260c('0xf1'));db['ChatTransferReport']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xf2'));db[_0x260c('0xf3')]=db['sequelize'][_0x260c('0x13')](_0x260c('0xf4'));db[_0x260c('0xf5')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xf6'));db['SmsTransferReport']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xf7'));db[_0x260c('0xf8')]=db['sequelize'][_0x260c('0x13')](_0x260c('0xf9'));db['VoicePrefix']=db[_0x260c('0x0')][_0x260c('0x13')]('../api/voicePrefix/voicePrefix.model');db[_0x260c('0xfa')]=db[_0x260c('0x0')]['import'](_0x260c('0xfb'));db['UserProfileSection']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xfc'));db['UserProfileResource']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0xfd'));db[_0x260c('0xfe')]=db['sequelize'][_0x260c('0x13')](_0x260c('0xff'));db[_0x260c('0x100')]=db[_0x260c('0x0')][_0x260c('0x13')]('../api/whatsappAccount/whatsappAccount.model');db[_0x260c('0x101')]=db[_0x260c('0x0')]['import'](_0x260c('0x102'));db[_0x260c('0x103')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x104'));db['WhatsappMessage']=db['sequelize'][_0x260c('0x13')]('../api/whatsappMessage/whatsappMessage.model');db[_0x260c('0x105')]=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x106'));db['WhatsappTransferReport']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x107'));db[_0x260c('0x108')]=db[_0x260c('0x0')]['import']('../api/whatsappQueue/whatsappQueue.model');db['CloudProvider']=db[_0x260c('0x0')][_0x260c('0x13')](_0x260c('0x109'));db[_0x260c('0x10a')]=db[_0x260c('0x0')]['import'](_0x260c('0x10b'));db[_0x260c('0x10c')]=db[_0x260c('0x0')][_0x260c('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x260c('0x10d')]=db[_0x260c('0x0')]['import'](_0x260c('0x10e'));db[_0x260c('0x10f')]=db[_0x260c('0x0')][_0x260c('0x13')]('../api/user-setting/user-setting.model');db['User'][_0x260c('0x110')](db[_0x260c('0x1e')],{'as':_0x260c('0x1e'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x112')});db[_0x260c('0x12')][_0x260c('0x110')](db[_0x260c('0x10f')],{'as':_0x260c('0x113'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x112')});db[_0x260c('0x12')]['hasMany'](db[_0x260c('0x114')],{'as':_0x260c('0x115'),'foreignKey':_0x260c('0x112')});db['User'][_0x260c('0x116')](db[_0x260c('0x2c')],{'as':_0x260c('0x117'),'foreignKey':_0x260c('0x112')});db[_0x260c('0x12')][_0x260c('0x116')](db['VoiceExtension'],{'as':_0x260c('0x118'),'onDelete':_0x260c('0x111'),'hooks':!![]});db['User'][_0x260c('0x116')](db[_0x260c('0x74')],{'as':_0x260c('0x119'),'foreignKey':_0x260c('0x112')});db['User'][_0x260c('0x116')](db[_0x260c('0x76')],{'as':'HopperHistory','foreignKey':_0x260c('0x112')});db[_0x260c('0x12')][_0x260c('0x116')](db[_0x260c('0x78')],{'as':_0x260c('0x78'),'foreignKey':_0x260c('0x112')});db[_0x260c('0x12')][_0x260c('0x116')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db['User'][_0x260c('0x116')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x260c('0x112')});db[_0x260c('0x12')][_0x260c('0x116')](db[_0x260c('0x11a')],{'as':_0x260c('0x11b'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x260c('0x11c')],{'as':_0x260c('0x11d'),'foreignKey':_0x260c('0x112')});db[_0x260c('0x12')][_0x260c('0x116')](db[_0x260c('0x42')],{'as':_0x260c('0x11e'),'foreignKey':_0x260c('0x112')});db[_0x260c('0x12')][_0x260c('0x116')](db[_0x260c('0x103')],{'as':_0x260c('0x11f'),'foreignKey':'UserId'});db['User'][_0x260c('0x116')](db[_0x260c('0xfe')],{'as':'UserNotifications','foreignKey':_0x260c('0x120')});db[_0x260c('0x12')][_0x260c('0x121')](db[_0x260c('0xfa')],{'as':_0x260c('0xfa'),'foreignKey':_0x260c('0x122')});db[_0x260c('0x12')][_0x260c('0x123')](db[_0x260c('0x6e')],{'as':_0x260c('0x124'),'through':_0x260c('0x125')});db[_0x260c('0x12')][_0x260c('0x123')](db['CmContact'],{'as':'Contacts','through':_0x260c('0x126')});db[_0x260c('0x12')]['belongsToMany'](db['CmList'],{'as':'Lists','through':_0x260c('0x127')});db[_0x260c('0x12')][_0x260c('0x123')](db['Team'],{'through':_0x260c('0x128')});db[_0x260c('0x12')]['belongsToMany'](db[_0x260c('0x42')],{'as':_0x260c('0x11e'),'through':_0x260c('0x129')});db[_0x260c('0x12')]['belongsToMany'](db[_0x260c('0x68')],{'as':_0x260c('0x12a'),'through':_0x260c('0x12b')});db[_0x260c('0x12')][_0x260c('0x123')](db[_0x260c('0x11c')],{'as':_0x260c('0x11d'),'through':'user_has_fax_interactions'});db['User'][_0x260c('0x123')](db[_0x260c('0x11a')],{'as':_0x260c('0x11b'),'through':_0x260c('0x12c')});db[_0x260c('0x12')]['belongsToMany'](db[_0x260c('0x5f')],{'as':_0x260c('0x12d'),'through':'user_has_openchannel_interactions'});db[_0x260c('0x12')][_0x260c('0x123')](db['WhatsappInteraction'],{'as':_0x260c('0x11f'),'through':_0x260c('0x12e')});db['User'][_0x260c('0x123')](db[_0x260c('0x1a')],{'as':'VoiceQueues','through':_0x260c('0x2e'),'required':![]});db[_0x260c('0x12')][_0x260c('0x123')](db[_0x260c('0x12f')],{'as':_0x260c('0x130'),'through':_0x260c('0x10d'),'required':![]});db[_0x260c('0x12')]['belongsToMany'](db[_0x260c('0x40')],{'as':_0x260c('0x131'),'through':'UserMailQueue','required':![]});db['User'][_0x260c('0x123')](db[_0x260c('0x132')],{'as':_0x260c('0x133'),'through':_0x260c('0x30'),'required':![],'hooks':!![]});db[_0x260c('0x12')][_0x260c('0x123')](db['FaxQueue'],{'as':_0x260c('0x134'),'through':'UserFaxQueue','required':![]});db[_0x260c('0x12')][_0x260c('0x123')](db[_0x260c('0x5a')],{'as':_0x260c('0x135'),'through':_0x260c('0x35'),'required':![]});db[_0x260c('0x12')][_0x260c('0x123')](db[_0x260c('0x63')],{'as':_0x260c('0x136'),'through':_0x260c('0x37'),'required':![]});db[_0x260c('0x12')][_0x260c('0x123')](db[_0x260c('0x108')],{'as':'WhatsappQueues','through':_0x260c('0x39'),'required':![]});db['User'][_0x260c('0x123')](db[_0x260c('0xf8')],{'through':_0x260c('0x127')});db[_0x260c('0x12')][_0x260c('0x123')](db[_0x260c('0x137')],{'as':_0x260c('0x138'),'through':'user_has_chat_websites'});db[_0x260c('0x12')]['belongsToMany'](db[_0x260c('0x4b')],{'as':_0x260c('0x139'),'through':_0x260c('0x13a')});db['User'][_0x260c('0x123')](db[_0x260c('0x13b')],{'as':_0x260c('0x13c'),'through':_0x260c('0x13d')});db[_0x260c('0x12')][_0x260c('0x123')](db['OpenchannelAccount'],{'as':_0x260c('0x13e'),'through':'user_has_openchannel_accounts'});db[_0x260c('0x12')]['belongsToMany'](db['SmsAccount'],{'as':_0x260c('0x13f'),'through':_0x260c('0x140')});db['User']['belongsToMany'](db[_0x260c('0x100')],{'as':_0x260c('0x141'),'through':_0x260c('0x142')});db[_0x260c('0x12')][_0x260c('0x123')](db[_0x260c('0xe1')],{'as':_0x260c('0x143'),'through':_0x260c('0x144')});db[_0x260c('0x15')][_0x260c('0x116')](db['VoiceExtension'],{'as':_0x260c('0x145'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x146')});db[_0x260c('0x147')][_0x260c('0x116')](db[_0x260c('0x148')],{'onDelete':_0x260c('0x111')});db[_0x260c('0x148')][_0x260c('0x116')](db[_0x260c('0x148')],{'as':_0x260c('0x149'),'onDelete':_0x260c('0x111')});db[_0x260c('0x14a')]['belongsToMany'](db[_0x260c('0x8a')],{'as':_0x260c('0x14b'),'through':_0x260c('0x14c')});db[_0x260c('0x1a')][_0x260c('0x116')](db[_0x260c('0x2c')],{'as':_0x260c('0x14d'),'foreignKey':'VoiceQueueId'});db[_0x260c('0x1a')][_0x260c('0x116')](db[_0x260c('0x14e')],{'as':_0x260c('0x14f'),'foreignKey':_0x260c('0x150')});db['VoiceQueue'][_0x260c('0x116')](db[_0x260c('0x74')],{'as':_0x260c('0x119'),'foreignKey':_0x260c('0x150')});db['VoiceQueue'][_0x260c('0x116')](db[_0x260c('0x76')],{'as':_0x260c('0x151'),'foreignKey':'VoiceQueueId'});db[_0x260c('0x1a')][_0x260c('0x116')](db[_0x260c('0x78')],{'as':_0x260c('0x78'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x260c('0x150')});db[_0x260c('0x1a')][_0x260c('0x116')](db[_0x260c('0xd7')],{'as':_0x260c('0x152'),'foreignKey':'VoiceQueueId'});db[_0x260c('0x1a')][_0x260c('0x121')](db[_0x260c('0x28')],{'as':_0x260c('0x28'),'foreignKey':_0x260c('0x153')});db['VoiceQueue'][_0x260c('0x121')](db[_0x260c('0x28')],{'as':'TrunkBackup','foreignKey':_0x260c('0x154')});db[_0x260c('0x1a')][_0x260c('0x121')](db[_0x260c('0x82')],{'as':_0x260c('0x82'),'foreignKey':_0x260c('0x155')});db[_0x260c('0x1a')][_0x260c('0x121')](db[_0x260c('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0x260c('0x156')});db[_0x260c('0x1a')][_0x260c('0x123')](db[_0x260c('0xf8')],{'as':'Lists','through':_0x260c('0x157')});db[_0x260c('0x1a')][_0x260c('0x123')](db[_0x260c('0x12')],{'as':'Agents','through':_0x260c('0x2e')});db[_0x260c('0x1a')][_0x260c('0x123')](db[_0x260c('0xe7')],{'as':_0x260c('0x158'),'through':_0x260c('0x10a')});db[_0x260c('0x1a')][_0x260c('0x123')](db[_0x260c('0xf8')],{'as':_0x260c('0x159'),'through':_0x260c('0x15a')});db[_0x260c('0x114')][_0x260c('0x121')](db[_0x260c('0x12')],{'as':_0x260c('0x12'),'foreignKey':_0x260c('0x112')});db[_0x260c('0x15b')]['belongsTo'](db[_0x260c('0x12')],{'as':'User','foreignKey':_0x260c('0x112')});db['VoiceMail'][_0x260c('0x116')](db[_0x260c('0x15c')],{'as':_0x260c('0x15d'),'onDelete':'cascade','foreignKey':_0x260c('0x15e'),'sourceKey':_0x260c('0x15f')});db[_0x260c('0x15c')][_0x260c('0x121')](db[_0x260c('0x1e')],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db[_0x260c('0x20')][_0x260c('0x116')](db[_0x260c('0x24')],{'as':'QueueCalls','foreignKey':_0x260c('0x160'),'constraints':![]});db[_0x260c('0x20')][_0x260c('0x116')](db[_0x260c('0x161')],{'as':_0x260c('0x162'),'foreignKey':'uniqueid','constraints':![]});db[_0x260c('0x20')][_0x260c('0x121')](db[_0x260c('0x12')],{'as':_0x260c('0x12'),'foreignKey':_0x260c('0x112')});db[_0x260c('0x20')][_0x260c('0x121')](db[_0x260c('0x163')],{'as':_0x260c('0x164'),'foreignKey':'ContactId'});db[_0x260c('0x3b')][_0x260c('0x121')](db[_0x260c('0x13b')],{'as':_0x260c('0x13b'),'foreignKey':'MailAccountId'});db['MailServerIn'][_0x260c('0x121')](db['CloudProvider'],{'as':_0x260c('0x165'),'foreignKey':_0x260c('0x166'),'onDelete':_0x260c('0x167')});db[_0x260c('0x3d')][_0x260c('0x121')](db[_0x260c('0x13b')],{'as':_0x260c('0x13b'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0x260c('0x121')](db[_0x260c('0x165')],{'as':_0x260c('0x165'),'foreignKey':_0x260c('0x166'),'onDelete':_0x260c('0x167')});db[_0x260c('0x13b')][_0x260c('0x110')](db['MailServerIn'],{'as':_0x260c('0x168'),'onDelete':_0x260c('0x111')});db[_0x260c('0x13b')]['hasOne'](db[_0x260c('0x3d')],{'as':_0x260c('0x169'),'onDelete':_0x260c('0x111')});db['MailAccount']['hasMany'](db['Disposition'],{'as':_0x260c('0x16a'),'foreignKey':_0x260c('0x16b'),'onDelete':'cascade'});db[_0x260c('0x13b')][_0x260c('0x116')](db[_0x260c('0x16c')],{'as':_0x260c('0x16d'),'foreignKey':_0x260c('0x16b')});db[_0x260c('0x13b')][_0x260c('0x116')](db[_0x260c('0x16e')],{'as':_0x260c('0x15d'),'foreignKey':_0x260c('0x16b')});db[_0x260c('0x13b')][_0x260c('0x116')](db[_0x260c('0x42')],{'as':_0x260c('0x16f')});db[_0x260c('0x13b')][_0x260c('0x116')](db[_0x260c('0x170')],{'as':_0x260c('0x149')});db[_0x260c('0x13b')]['belongsTo'](db['CmList'],{'as':_0x260c('0x171'),'foreignKey':_0x260c('0x172')});db[_0x260c('0x13b')]['belongsTo'](db[_0x260c('0x8e')],{'as':'Template','foreignKey':'TemplateId'});db[_0x260c('0x13b')]['belongsTo'](db[_0x260c('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0x260c('0x156')});db['MailAccount'][_0x260c('0x123')](db[_0x260c('0x12')],{'as':_0x260c('0x173'),'through':'user_has_mail_accounts'});db['MailQueue'][_0x260c('0x123')](db[_0x260c('0x12')],{'as':_0x260c('0x173'),'through':'UserMailQueue'});db['MailQueue'][_0x260c('0x123')](db[_0x260c('0xe7')],{'through':_0x260c('0x174'),'as':_0x260c('0x158')});db[_0x260c('0x42')]['hasMany'](db[_0x260c('0x16e')],{'as':_0x260c('0x15d'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db['MailInteraction'][_0x260c('0x121')](db[_0x260c('0x13b')],{'as':'Account','foreignKey':_0x260c('0x16b')});db[_0x260c('0x42')][_0x260c('0x121')](db[_0x260c('0x163')],{'as':_0x260c('0x164'),'foreignKey':_0x260c('0x175')});db[_0x260c('0x42')][_0x260c('0x121')](db[_0x260c('0x12')],{'as':_0x260c('0x176'),'foreignKey':_0x260c('0x112')});db[_0x260c('0x42')][_0x260c('0x123')](db['Tag'],{'through':_0x260c('0x177'),'as':_0x260c('0x178')});db[_0x260c('0x42')]['belongsToMany'](db[_0x260c('0x8c')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0x260c('0x42')]['belongsToMany'](db[_0x260c('0x12')],{'as':_0x260c('0x179'),'through':'user_has_mail_interactions','foreignKey':_0x260c('0x17a')});db['MailMessage']['hasMany'](db[_0x260c('0x17b')],{'as':_0x260c('0x17c'),'onDelete':_0x260c('0x111')});db[_0x260c('0x16e')][_0x260c('0x121')](db['User'],{'as':_0x260c('0x12')});db[_0x260c('0x16e')][_0x260c('0x121')](db[_0x260c('0x163')],{'onDelete':_0x260c('0x111'),'as':_0x260c('0x164')});db[_0x260c('0x16e')][_0x260c('0x121')](db[_0x260c('0x42')],{'as':'Interaction','foreignKey':_0x260c('0x17a')});db[_0x260c('0x16e')]['belongsTo'](db['MailAccount'],{'as':'Account','foreignKey':_0x260c('0x16b')});db[_0x260c('0x16e')][_0x260c('0x121')](db[_0x260c('0x137')],{'as':_0x260c('0x137'),'foreignKey':_0x260c('0x17d')});db[_0x260c('0x16e')][_0x260c('0x121')](db['ChatOfflineMessage'],{'as':_0x260c('0x6b'),'foreignKey':_0x260c('0x17e')});db[_0x260c('0x170')][_0x260c('0x121')](db['User'],{'onDelete':_0x260c('0x167')});db['MailApplication'][_0x260c('0x121')](db['MailQueue'],{'onDelete':'restrict'});db[_0x260c('0x170')][_0x260c('0x121')](db['MailAccount'],{'onDelete':_0x260c('0x167')});db[_0x260c('0x170')][_0x260c('0x121')](db['Interval'],{'onDelete':_0x260c('0x167'),'foreignKey':_0x260c('0x155')});db[_0x260c('0x170')][_0x260c('0x121')](db['Tag'],{'onDelete':_0x260c('0x167'),'foreignKey':_0x260c('0x17f')});db[_0x260c('0x45')][_0x260c('0x121')](db[_0x260c('0x13b')],{});db[_0x260c('0x45')][_0x260c('0x121')](db['CmList'],{'as':_0x260c('0x171'),'foreignKey':'ListId'});db[_0x260c('0x45')][_0x260c('0x121')](db[_0x260c('0x163')],{'as':_0x260c('0x164'),'foreignKey':_0x260c('0x175')});db['MailQueueReport'][_0x260c('0x121')](db[_0x260c('0x42')],{});db[_0x260c('0x45')]['belongsTo'](db[_0x260c('0x16e')],{});db[_0x260c('0x45')][_0x260c('0x121')](db['User'],{});db[_0x260c('0x45')]['belongsTo'](db[_0x260c('0x40')],{});db[_0x260c('0x47')][_0x260c('0x116')](db[_0x260c('0x49')],{'as':_0x260c('0x180'),'onDelete':_0x260c('0x111')});db[_0x260c('0x4b')][_0x260c('0x116')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x260c('0x181'),'onDelete':_0x260c('0x111')});db[_0x260c('0x4b')][_0x260c('0x116')](db['CannedAnswer'],{'as':_0x260c('0x16d'),'foreignKey':_0x260c('0x181')});db[_0x260c('0x4b')][_0x260c('0x116')](db[_0x260c('0x11c')],{'as':'Interactions'});db['FaxAccount'][_0x260c('0x116')](db[_0x260c('0x182')],{'as':_0x260c('0x149')});db['FaxAccount'][_0x260c('0x116')](db[_0x260c('0x148')],{'as':_0x260c('0x183'),'onDelete':_0x260c('0x111')});db[_0x260c('0x4b')]['hasMany'](db[_0x260c('0x4e')],{'as':'Messages'});db['FaxAccount'][_0x260c('0x121')](db['Trunk'],{'as':_0x260c('0x28')});db['FaxAccount'][_0x260c('0x121')](db['CmList'],{'as':_0x260c('0x171'),'foreignKey':'ListId'});db['FaxAccount']['belongsTo'](db['Pause'],{'as':_0x260c('0x184'),'foreignKey':_0x260c('0x156')});db[_0x260c('0x4b')][_0x260c('0x123')](db[_0x260c('0x12')],{'as':'Agents','through':_0x260c('0x13a')});db[_0x260c('0x182')]['belongsTo'](db['User'],{'onDelete':_0x260c('0x167')});db[_0x260c('0x182')][_0x260c('0x121')](db[_0x260c('0x50')],{'onDelete':_0x260c('0x167')});db[_0x260c('0x182')][_0x260c('0x121')](db[_0x260c('0x4b')],{'onDelete':_0x260c('0x167')});db['FaxApplication'][_0x260c('0x121')](db[_0x260c('0x8c')],{'onDelete':_0x260c('0x167'),'foreignKey':_0x260c('0x17f')});db[_0x260c('0x11c')][_0x260c('0x116')](db[_0x260c('0x4e')],{'as':_0x260c('0x15d'),'onDelete':'cascade','foreignKey':_0x260c('0x185')});db[_0x260c('0x11c')][_0x260c('0x121')](db[_0x260c('0x4b')],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x181')});db[_0x260c('0x11c')]['belongsTo'](db[_0x260c('0x163')],{'as':_0x260c('0x164'),'foreignKey':_0x260c('0x175')});db[_0x260c('0x11c')][_0x260c('0x121')](db['User'],{'as':_0x260c('0x176'),'foreignKey':_0x260c('0x112')});db[_0x260c('0x11c')]['belongsToMany'](db['Tag'],{'through':_0x260c('0x187'),'as':_0x260c('0x178')});db[_0x260c('0x11c')][_0x260c('0x123')](db['Tag'],{'through':_0x260c('0x187'),'as':'ThroughTags'});db[_0x260c('0x11c')][_0x260c('0x123')](db[_0x260c('0x12')],{'as':_0x260c('0x179'),'through':_0x260c('0x188'),'foreignKey':'FaxInteractionId'});db[_0x260c('0x4e')][_0x260c('0x121')](db[_0x260c('0x12')],{'onDelete':_0x260c('0x111'),'as':_0x260c('0x12')});db[_0x260c('0x4e')][_0x260c('0x121')](db[_0x260c('0x11c')],{'as':_0x260c('0x189'),'foreignKey':_0x260c('0x185')});db[_0x260c('0x4e')][_0x260c('0x121')](db['CmContact'],{'onDelete':_0x260c('0x111'),'as':_0x260c('0x164')});db['FaxMessage'][_0x260c('0x121')](db[_0x260c('0x17b')],{'as':_0x260c('0x17b'),'foreignKey':_0x260c('0x18a')});db[_0x260c('0x4e')][_0x260c('0x121')](db['FaxAccount'],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x181')});db[_0x260c('0x50')]['belongsToMany'](db[_0x260c('0x12')],{'as':_0x260c('0x173'),'through':_0x260c('0x33')});db[_0x260c('0x50')][_0x260c('0x123')](db[_0x260c('0xe7')],{'through':'team_has_fax_queues','as':'Teams'});db['FaxQueueReport'][_0x260c('0x121')](db[_0x260c('0x4b')],{});db[_0x260c('0x52')][_0x260c('0x121')](db[_0x260c('0xf8')],{'as':_0x260c('0x171'),'foreignKey':_0x260c('0x172')});db[_0x260c('0x52')][_0x260c('0x121')](db[_0x260c('0x163')],{'as':'Contact','foreignKey':'ContactId'});db[_0x260c('0x52')]['belongsTo'](db['FaxInteraction'],{});db[_0x260c('0x52')][_0x260c('0x121')](db[_0x260c('0x4e')],{});db[_0x260c('0x52')][_0x260c('0x121')](db['User'],{});db[_0x260c('0x52')][_0x260c('0x121')](db[_0x260c('0x50')],{});db[_0x260c('0x54')]['hasMany'](db[_0x260c('0x7e')],{'as':'Dispositions','foreignKey':_0x260c('0x18b'),'onDelete':_0x260c('0x111')});db[_0x260c('0x54')][_0x260c('0x116')](db['CannedAnswer'],{'as':_0x260c('0x16d'),'foreignKey':_0x260c('0x18b')});db[_0x260c('0x54')][_0x260c('0x116')](db['SmsMessage'],{'as':'Messages','foreignKey':_0x260c('0x18b')});db[_0x260c('0x54')][_0x260c('0x116')](db[_0x260c('0x11a')],{'as':_0x260c('0x16f')});db[_0x260c('0x54')][_0x260c('0x116')](db['SmsApplication'],{'as':'Applications'});db[_0x260c('0x54')][_0x260c('0x121')](db['CmList'],{'as':'List','foreignKey':_0x260c('0x172')});db['SmsAccount'][_0x260c('0x121')](db[_0x260c('0x84')],{'as':_0x260c('0x184'),'foreignKey':_0x260c('0x156')});db['SmsAccount']['belongsToMany'](db[_0x260c('0x12')],{'as':_0x260c('0x173'),'through':_0x260c('0x140')});db['SmsApplication']['belongsTo'](db['User'],{'onDelete':_0x260c('0x167')});db[_0x260c('0x56')]['belongsTo'](db['SmsQueue'],{'onDelete':_0x260c('0x167')});db[_0x260c('0x56')][_0x260c('0x121')](db['SmsAccount'],{'onDelete':_0x260c('0x167')});db[_0x260c('0x56')]['belongsTo'](db[_0x260c('0x82')],{'onDelete':_0x260c('0x167'),'foreignKey':_0x260c('0x155')});db[_0x260c('0x56')][_0x260c('0x121')](db[_0x260c('0x8c')],{'onDelete':_0x260c('0x167'),'foreignKey':'TagId'});db[_0x260c('0x11a')][_0x260c('0x116')](db[_0x260c('0x58')],{'as':_0x260c('0x15d'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x18c')});db[_0x260c('0x11a')][_0x260c('0x121')](db[_0x260c('0x54')],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x18b')});db[_0x260c('0x11a')][_0x260c('0x121')](db[_0x260c('0x163')],{'as':_0x260c('0x164'),'foreignKey':'ContactId'});db['SmsInteraction'][_0x260c('0x121')](db[_0x260c('0x12')],{'as':_0x260c('0x176'),'foreignKey':'UserId'});db[_0x260c('0x11a')]['belongsToMany'](db[_0x260c('0x8c')],{'through':_0x260c('0x18d'),'as':'Tags'});db[_0x260c('0x11a')][_0x260c('0x123')](db['Tag'],{'through':_0x260c('0x18d'),'as':_0x260c('0x18e')});db[_0x260c('0x11a')][_0x260c('0x123')](db[_0x260c('0x12')],{'as':_0x260c('0x179'),'through':_0x260c('0x12c'),'foreignKey':_0x260c('0x18c')});db[_0x260c('0x58')][_0x260c('0x121')](db['User'],{'as':_0x260c('0x12')});db[_0x260c('0x58')]['belongsTo'](db[_0x260c('0x163')],{'onDelete':_0x260c('0x111'),'as':_0x260c('0x164')});db[_0x260c('0x58')][_0x260c('0x121')](db['SmsInteraction'],{'onDelete':_0x260c('0x111'),'as':_0x260c('0x189'),'foreignKey':_0x260c('0x18c')});db[_0x260c('0x58')][_0x260c('0x121')](db['SmsAccount'],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x18b')});db[_0x260c('0x5a')][_0x260c('0x123')](db['User'],{'as':_0x260c('0x173'),'through':_0x260c('0x35'),'foreignKey':_0x260c('0x18f')});db['SmsQueue'][_0x260c('0x123')](db[_0x260c('0xe7')],{'through':'team_has_sms_queues','as':_0x260c('0x158')});db[_0x260c('0x190')][_0x260c('0x116')](db[_0x260c('0x7e')],{'as':_0x260c('0x16a'),'foreignKey':_0x260c('0x191'),'onDelete':_0x260c('0x111')});db[_0x260c('0x190')][_0x260c('0x116')](db[_0x260c('0x16c')],{'as':_0x260c('0x16d'),'foreignKey':_0x260c('0x191')});db[_0x260c('0x190')]['hasMany'](db[_0x260c('0x5f')],{'as':_0x260c('0x16f'),'foreignKey':_0x260c('0x191')});db[_0x260c('0x190')][_0x260c('0x116')](db[_0x260c('0x61')],{'as':_0x260c('0x15d'),'foreignKey':_0x260c('0x191')});db[_0x260c('0x190')]['hasMany'](db[_0x260c('0x5d')],{'as':'Applications','foreignKey':_0x260c('0x191')});db[_0x260c('0x190')][_0x260c('0x121')](db[_0x260c('0xf8')],{'as':_0x260c('0x171'),'foreignKey':_0x260c('0x172')});db[_0x260c('0x190')][_0x260c('0x121')](db[_0x260c('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0x260c('0x156')});db['OpenchannelAccount'][_0x260c('0x123')](db[_0x260c('0x12')],{'as':'Agents','through':_0x260c('0x192')});db[_0x260c('0x5d')]['belongsTo'](db[_0x260c('0x12')],{'onDelete':_0x260c('0x167')});db[_0x260c('0x5d')][_0x260c('0x121')](db['OpenchannelQueue'],{'onDelete':_0x260c('0x167'),'foreignKey':_0x260c('0x193')});db[_0x260c('0x5d')][_0x260c('0x121')](db[_0x260c('0x190')],{'onDelete':_0x260c('0x167'),'foreignKey':_0x260c('0x191')});db[_0x260c('0x5d')][_0x260c('0x121')](db[_0x260c('0x82')],{'onDelete':_0x260c('0x167'),'foreignKey':'IntervalId'});db[_0x260c('0x5d')][_0x260c('0x121')](db['Tag'],{'onDelete':_0x260c('0x167'),'foreignKey':_0x260c('0x17f')});db[_0x260c('0x5f')][_0x260c('0x116')](db[_0x260c('0x61')],{'as':_0x260c('0x15d'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x194')});db[_0x260c('0x5f')]['belongsTo'](db[_0x260c('0x190')],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x191')});db[_0x260c('0x5f')][_0x260c('0x121')](db[_0x260c('0x163')],{'as':_0x260c('0x164'),'foreignKey':_0x260c('0x175')});db['OpenchannelInteraction'][_0x260c('0x121')](db['User'],{'as':_0x260c('0x176'),'foreignKey':_0x260c('0x112')});db[_0x260c('0x5f')][_0x260c('0x123')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x260c('0x178')});db[_0x260c('0x5f')][_0x260c('0x123')](db['Tag'],{'through':_0x260c('0x195'),'as':_0x260c('0x18e')});db[_0x260c('0x5f')][_0x260c('0x123')](db[_0x260c('0x12')],{'as':_0x260c('0x179'),'through':_0x260c('0x196'),'foreignKey':_0x260c('0x194')});db[_0x260c('0x61')]['belongsTo'](db[_0x260c('0x12')],{'onDelete':'cascade','as':_0x260c('0x12')});db[_0x260c('0x61')]['belongsTo'](db[_0x260c('0x163')],{'onDelete':'cascade','as':_0x260c('0x164')});db[_0x260c('0x61')][_0x260c('0x121')](db[_0x260c('0x5f')],{'onDelete':_0x260c('0x111'),'as':_0x260c('0x189'),'foreignKey':_0x260c('0x194')});db[_0x260c('0x61')][_0x260c('0x121')](db[_0x260c('0x17b')],{'as':_0x260c('0x17b'),'foreignKey':_0x260c('0x18a')});db[_0x260c('0x61')][_0x260c('0x121')](db[_0x260c('0x190')],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x191')});db[_0x260c('0x63')][_0x260c('0x123')](db[_0x260c('0x12')],{'as':_0x260c('0x173'),'through':_0x260c('0x37'),'foreignKey':_0x260c('0x193')});db[_0x260c('0x63')][_0x260c('0x123')](db[_0x260c('0xe7')],{'through':_0x260c('0x197'),'as':_0x260c('0x158')});db[_0x260c('0x137')][_0x260c('0x116')](db[_0x260c('0x7e')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0x260c('0x111')});db[_0x260c('0x137')][_0x260c('0x116')](db[_0x260c('0x16c')],{'as':'Answers','foreignKey':_0x260c('0x17d')});db[_0x260c('0x137')][_0x260c('0x116')](db[_0x260c('0x6f')],{'as':'ProactiveActions'});db[_0x260c('0x137')][_0x260c('0x116')](db['ChatInteraction'],{'as':_0x260c('0x16f')});db['ChatWebsite'][_0x260c('0x116')](db[_0x260c('0x67')],{'as':_0x260c('0x149')});db[_0x260c('0x137')][_0x260c('0x116')](db['ChatMessage'],{'as':_0x260c('0x15d')});db[_0x260c('0x137')][_0x260c('0x121')](db[_0x260c('0xf8')],{'as':_0x260c('0x171'),'foreignKey':_0x260c('0x172')});db[_0x260c('0x137')][_0x260c('0x121')](db['Interval'],{'as':'Interval','foreignKey':_0x260c('0x155')});db[_0x260c('0x137')][_0x260c('0x121')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x260c('0x16b')});db[_0x260c('0x137')][_0x260c('0x121')](db['Pause'],{'as':_0x260c('0x184'),'foreignKey':_0x260c('0x156')});db[_0x260c('0x137')][_0x260c('0x123')](db['User'],{'as':'Agents','through':'user_has_chat_websites'});db[_0x260c('0x66')][_0x260c('0x121')](db['OpenchannelAccount'],{});db[_0x260c('0x66')]['belongsTo'](db[_0x260c('0xf8')],{'as':'List','foreignKey':_0x260c('0x172')});db[_0x260c('0x66')][_0x260c('0x121')](db['CmContact'],{'as':_0x260c('0x164'),'foreignKey':'ContactId'});db[_0x260c('0x66')][_0x260c('0x121')](db[_0x260c('0x5f')],{});db[_0x260c('0x66')][_0x260c('0x121')](db[_0x260c('0x61')],{});db['OpenchannelQueueReport'][_0x260c('0x121')](db[_0x260c('0x12')],{});db[_0x260c('0x66')][_0x260c('0x121')](db[_0x260c('0x63')],{});db[_0x260c('0x67')][_0x260c('0x121')](db[_0x260c('0x12')],{'as':_0x260c('0x198'),'foreignKey':_0x260c('0x112'),'onDelete':'restrict'});db[_0x260c('0x67')][_0x260c('0x121')](db[_0x260c('0x132')],{'as':_0x260c('0x199'),'foreignKey':_0x260c('0x19a'),'onDelete':_0x260c('0x167')});db[_0x260c('0x67')]['belongsTo'](db[_0x260c('0x137')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0x260c('0x167')});db[_0x260c('0x67')][_0x260c('0x121')](db[_0x260c('0x8c')],{'onDelete':_0x260c('0x167'),'foreignKey':_0x260c('0x17f')});db[_0x260c('0x68')][_0x260c('0x116')](db[_0x260c('0x19b')],{'as':_0x260c('0x15d'),'onDelete':'cascade','foreignKey':_0x260c('0x19c')});db[_0x260c('0x68')][_0x260c('0x121')](db[_0x260c('0x137')],{'as':_0x260c('0x186'),'foreignKey':'ChatWebsiteId'});db[_0x260c('0x68')]['belongsTo'](db[_0x260c('0x163')],{'as':_0x260c('0x164'),'foreignKey':_0x260c('0x175')});db[_0x260c('0x68')][_0x260c('0x121')](db['User'],{'as':'Owner','foreignKey':_0x260c('0x112')});db[_0x260c('0x68')][_0x260c('0x123')](db[_0x260c('0x8c')],{'through':'chat_interaction_has_tags','as':_0x260c('0x178')});db[_0x260c('0x68')]['belongsToMany'](db['Tag'],{'through':_0x260c('0x19d'),'as':_0x260c('0x18e')});db['ChatInteraction']['belongsToMany'](db['User'],{'as':_0x260c('0x179'),'through':_0x260c('0x12b'),'foreignKey':_0x260c('0x19c')});db[_0x260c('0x19b')]['belongsTo'](db['User'],{'onDelete':_0x260c('0x111'),'as':_0x260c('0x12')});db[_0x260c('0x19b')][_0x260c('0x121')](db[_0x260c('0x163')],{'onDelete':_0x260c('0x111'),'as':_0x260c('0x164'),'foreignKey':'ContactId'});db['ChatMessage'][_0x260c('0x121')](db[_0x260c('0x68')],{'onDelete':_0x260c('0x111'),'as':'Interaction','foreignKey':'ChatInteractionId'});db[_0x260c('0x19b')][_0x260c('0x121')](db[_0x260c('0x17b')],{'as':_0x260c('0x17b'),'foreignKey':_0x260c('0x18a')});db[_0x260c('0x19b')][_0x260c('0x121')](db['ChatWebsite'],{'as':_0x260c('0x186'),'foreignKey':'ChatWebsiteId'});db[_0x260c('0x6b')][_0x260c('0x116')](db['Attachment'],{'as':_0x260c('0x17c'),'foreignKey':_0x260c('0x17e'),'onDelete':'cascade','hooks':!![]});db[_0x260c('0x6b')][_0x260c('0x121')](db[_0x260c('0x163')],{'onDelete':_0x260c('0x111'),'as':'Contact','foreignKey':'ContactId'});db[_0x260c('0x6b')][_0x260c('0x121')](db[_0x260c('0x137')],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x17d')});db[_0x260c('0x132')][_0x260c('0x123')](db[_0x260c('0x12')],{'as':_0x260c('0x173'),'through':_0x260c('0x30'),'hooks':!![]});db[_0x260c('0x132')]['belongsToMany'](db[_0x260c('0xe7')],{'through':_0x260c('0x19e'),'as':'Teams'});db[_0x260c('0x6e')][_0x260c('0x116')](db[_0x260c('0xd3')],{'as':_0x260c('0x15d'),'foreignKey':_0x260c('0x19f'),'onDelete':_0x260c('0x111')});db['ChatGroup'][_0x260c('0x123')](db['User'],{'as':_0x260c('0x14d'),'through':'chat_group_has_users'});db[_0x260c('0x6f')][_0x260c('0x121')](db[_0x260c('0x137')],{'as':'Website','foreignKey':_0x260c('0x17d')});db[_0x260c('0x1a0')][_0x260c('0x116')](db[_0x260c('0x163')],{'as':_0x260c('0x1a1'),'foreignKey':_0x260c('0x1a2')});db['CmContact'][_0x260c('0x116')](db[_0x260c('0x14e')],{'as':_0x260c('0x14f'),'foreignKey':'ContactId'});db[_0x260c('0x163')][_0x260c('0x116')](db[_0x260c('0x74')],{'as':_0x260c('0x119'),'foreignKey':'ContactId'});db[_0x260c('0x163')][_0x260c('0x116')](db[_0x260c('0x76')],{'as':_0x260c('0x151'),'foreignKey':'ContactId'});db[_0x260c('0x163')][_0x260c('0x116')](db['ReportAgentPreview'],{'as':_0x260c('0x78'),'foreignKey':_0x260c('0x175')});db[_0x260c('0x163')][_0x260c('0x116')](db[_0x260c('0xd7')],{'as':_0x260c('0x152'),'foreignKey':_0x260c('0x175')});db[_0x260c('0x163')][_0x260c('0x116')](db[_0x260c('0x5f')],{'as':'OpenchannelInteractions','foreignKey':_0x260c('0x175'),'onDelete':_0x260c('0x167')});db['CmContact'][_0x260c('0x116')](db['ChatInteraction'],{'as':_0x260c('0x12a'),'foreignKey':_0x260c('0x175'),'onDelete':_0x260c('0x167')});db[_0x260c('0x163')][_0x260c('0x116')](db['SmsInteraction'],{'as':_0x260c('0x11b'),'foreignKey':_0x260c('0x175'),'onDelete':_0x260c('0x167')});db[_0x260c('0x163')][_0x260c('0x116')](db[_0x260c('0x11c')],{'as':_0x260c('0x11d'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x260c('0x163')]['hasMany'](db[_0x260c('0x42')],{'as':_0x260c('0x11e'),'foreignKey':_0x260c('0x175'),'onDelete':'restrict'});db[_0x260c('0x163')]['belongsTo'](db[_0x260c('0x1a0')],{'as':_0x260c('0x1a3'),'foreignKey':'CompanyId'});db[_0x260c('0x163')][_0x260c('0x121')](db[_0x260c('0xf8')],{'as':_0x260c('0x171'),'foreignKey':_0x260c('0x172'),'onDelete':'cascade'});db[_0x260c('0x163')]['belongsToMany'](db[_0x260c('0x12')],{'as':_0x260c('0x179'),'through':_0x260c('0x126')});db[_0x260c('0x163')][_0x260c('0x123')](db[_0x260c('0x8c')],{'as':_0x260c('0x178'),'through':_0x260c('0x1a4')});db[_0x260c('0x163')][_0x260c('0x123')](db[_0x260c('0x8c')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0x260c('0x14e')][_0x260c('0x121')](db[_0x260c('0x163')],{'as':_0x260c('0x164'),'foreignKey':_0x260c('0x175'),'onDelete':_0x260c('0x111')});db['CmHopper'][_0x260c('0x121')](db[_0x260c('0xf8')],{'as':_0x260c('0x171'),'foreignKey':'ListId','onDelete':_0x260c('0x111')});db['CmHopper'][_0x260c('0x121')](db[_0x260c('0x12')],{'as':_0x260c('0x198'),'foreignKey':_0x260c('0x112')});db[_0x260c('0x14e')][_0x260c('0x121')](db[_0x260c('0x1a')],{'as':_0x260c('0x199'),'foreignKey':_0x260c('0x150'),'onDelete':'cascade'});db[_0x260c('0x14e')][_0x260c('0x121')](db[_0x260c('0xea')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x260c('0x111')});db[_0x260c('0x14e')]['belongsTo'](db[_0x260c('0x12')],{'as':'Owner','foreignKey':_0x260c('0x1a5')});db[_0x260c('0x72')]['belongsTo'](db[_0x260c('0x163')],{'as':_0x260c('0x164'),'foreignKey':_0x260c('0x175'),'onDelete':'cascade'});db[_0x260c('0x72')][_0x260c('0x121')](db[_0x260c('0xf8')],{'as':'List','foreignKey':_0x260c('0x172'),'onDelete':'cascade'});db[_0x260c('0x72')][_0x260c('0x121')](db[_0x260c('0x1a')],{'as':_0x260c('0x199'),'foreignKey':_0x260c('0x150'),'onDelete':_0x260c('0x111')});db[_0x260c('0x72')]['belongsTo'](db[_0x260c('0xea')],{'as':_0x260c('0xea'),'foreignKey':_0x260c('0x1a6'),'onDelete':_0x260c('0x111')});db['Automation'][_0x260c('0x116')](db[_0x260c('0x80')],{'as':{'plural':'All','singular':_0x260c('0x1a7')},'foreignKey':_0x260c('0x1a8'),'onDelete':_0x260c('0x111'),'hooks':!![]});db[_0x260c('0x1a9')][_0x260c('0x116')](db[_0x260c('0x80')],{'as':{'plural':_0x260c('0x1aa'),'singular':_0x260c('0x1ab')},'foreignKey':_0x260c('0x1ac'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x260c('0x116')](db[_0x260c('0x7a')],{'as':'Actions','foreignKey':_0x260c('0x1ad'),'onDelete':_0x260c('0x111'),'hooks':!![]});db[_0x260c('0x7e')][_0x260c('0x116')](db[_0x260c('0x7e')],{'as':_0x260c('0x16a'),'foreignKey':_0x260c('0x1ae'),'onDelete':_0x260c('0x111')});db[_0x260c('0x82')][_0x260c('0x116')](db['Interval'],{'as':_0x260c('0x1af'),'foreignKey':'IntervalId','onDelete':_0x260c('0x111'),'hooks':!![],'required':![]});db['Interval'][_0x260c('0x116')](db['VoiceExtension'],{'as':_0x260c('0x118'),'foreignKey':_0x260c('0x155'),'onDelete':'restrict'});db['Interval'][_0x260c('0x116')](db['MailApplication'],{'as':_0x260c('0x1b0'),'foreignKey':'IntervalId'});db[_0x260c('0x82')][_0x260c('0x116')](db[_0x260c('0x67')],{'as':_0x260c('0x1b1'),'foreignKey':'IntervalId'});db[_0x260c('0x82')]['hasMany'](db[_0x260c('0x182')],{'as':_0x260c('0x1b2'),'foreignKey':_0x260c('0x155')});db['Interval'][_0x260c('0x116')](db['SmsApplication'],{'as':_0x260c('0x1b3'),'foreignKey':_0x260c('0x155')});db['Schedule'][_0x260c('0x121')](db[_0x260c('0x13b')],{});db['Schedule']['belongsTo'](db[_0x260c('0x1b4')],{'foreignKey':_0x260c('0x1b5')});db[_0x260c('0x1b6')]['belongsTo'](db[_0x260c('0x96')],{'foreignKey':_0x260c('0x1b7')});db[_0x260c('0x8a')][_0x260c('0x123')](db[_0x260c('0x14a')],{'as':_0x260c('0x1b8'),'through':'moh_has_sounds','onDelete':_0x260c('0x167')});db[_0x260c('0x8c')][_0x260c('0x123')](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0x260c('0x8c')][_0x260c('0x123')](db[_0x260c('0x68')],{'through':_0x260c('0x19d')});db[_0x260c('0x8c')][_0x260c('0x123')](db[_0x260c('0x42')],{'through':'mail_interaction_has_tags'});db['Tag'][_0x260c('0x123')](db[_0x260c('0x11a')],{'through':_0x260c('0x18d')});db[_0x260c('0x8c')][_0x260c('0x123')](db[_0x260c('0x11c')],{'through':_0x260c('0x187')});db[_0x260c('0x8c')]['belongsToMany'](db['OpenchannelInteraction'],{'through':_0x260c('0x195')});db[_0x260c('0x8c')][_0x260c('0x123')](db['WhatsappInteraction'],{'through':_0x260c('0x1b9')});db['Trigger'][_0x260c('0x116')](db['Condition'],{'as':{'plural':'AllConditions','singular':_0x260c('0x1ba')},'foreignKey':_0x260c('0x1bb'),'onDelete':'cascade','hooks':!![]});db[_0x260c('0x90')]['hasMany'](db[_0x260c('0x80')],{'as':{'plural':_0x260c('0x1bc'),'singular':_0x260c('0x1bd')},'foreignKey':_0x260c('0x1be'),'onDelete':'cascade','hooks':!![]});db[_0x260c('0x90')][_0x260c('0x116')](db[_0x260c('0x7a')],{'as':_0x260c('0x1bf'),'foreignKey':_0x260c('0x1c0'),'onDelete':_0x260c('0x111'),'hooks':!![]});db['AnalyticCustomReport'][_0x260c('0x116')](db[_0x260c('0x9b')],{'as':'Fields','onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1b7'),'hooks':!![]});db[_0x260c('0x1b4')][_0x260c('0x116')](db[_0x260c('0x9b')],{'as':_0x260c('0x1c1'),'onDelete':_0x260c('0x111'),'foreignKey':'DefaultReportId'});db[_0x260c('0x9a')][_0x260c('0x116')](db[_0x260c('0x9b')],{'as':_0x260c('0x1c1'),'onDelete':'cascade','foreignKey':_0x260c('0x1c2')});db[_0x260c('0x9b')]['belongsTo'](db[_0x260c('0x9a')],{'foreignKey':'MetricId'});db[_0x260c('0x9f')]['hasMany'](db[_0x260c('0x1c3')],{'as':_0x260c('0x1c4'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1c5')});db[_0x260c('0x1c3')][_0x260c('0x116')](db['SalesforceField'],{'as':_0x260c('0x1c6'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1c7')});db[_0x260c('0x1c3')]['hasMany'](db[_0x260c('0xa1')],{'as':'Descriptions','onDelete':_0x260c('0x111'),'foreignKey':'DescriptionId'});db[_0x260c('0x1c3')][_0x260c('0x116')](db[_0x260c('0xa1')],{'as':_0x260c('0x1c1'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1c8')});db[_0x260c('0x1c3')]['belongsTo'](db[_0x260c('0x9f')],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x1c5')});db[_0x260c('0xa1')][_0x260c('0x116')](db[_0x260c('0xa1')],{'as':'Subject','foreignKey':_0x260c('0x1c7')});db[_0x260c('0xa1')][_0x260c('0x116')](db[_0x260c('0xa1')],{'as':'Description','foreignKey':'DescriptionId'});db['SalesforceField']['hasMany'](db[_0x260c('0xa1')],{'as':_0x260c('0x1c9'),'foreignKey':_0x260c('0x1c8')});db['SalesforceField'][_0x260c('0x121')](db[_0x260c('0x92')],{'as':_0x260c('0x92'),'foreignKey':'VariableId'});db[_0x260c('0xa3')][_0x260c('0x116')](db[_0x260c('0x1ca')],{'as':_0x260c('0x1c4'),'onDelete':'cascade','foreignKey':_0x260c('0x1c5')});db['SugarcrmConfiguration']['hasMany'](db[_0x260c('0xa6')],{'as':_0x260c('0x1c6'),'onDelete':'cascade','foreignKey':_0x260c('0x1c7')});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':_0x260c('0x1cb'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1cc')});db[_0x260c('0x1ca')][_0x260c('0x116')](db[_0x260c('0xa6')],{'as':'Fields','onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1c8')});db[_0x260c('0x1ca')][_0x260c('0x121')](db['SugarcrmAccount'],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x1c5')});db[_0x260c('0xa6')][_0x260c('0x116')](db['SugarcrmField'],{'as':_0x260c('0x1cd'),'foreignKey':_0x260c('0x1c7')});db[_0x260c('0xa6')][_0x260c('0x116')](db[_0x260c('0xa6')],{'as':_0x260c('0x1ce'),'foreignKey':_0x260c('0x1cc')});db[_0x260c('0xa6')]['hasMany'](db['SugarcrmField'],{'as':'Field','foreignKey':_0x260c('0x1c8')});db[_0x260c('0xa6')][_0x260c('0x121')](db['Variable'],{'as':_0x260c('0x92'),'foreignKey':_0x260c('0x1cf')});db[_0x260c('0xa8')][_0x260c('0x116')](db[_0x260c('0xaa')],{'as':_0x260c('0x1c4'),'onDelete':'cascade','foreignKey':'AccountId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':_0x260c('0x1c6'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x260c('0xaa')][_0x260c('0x116')](db[_0x260c('0x1d0')],{'as':_0x260c('0x1cb'),'onDelete':'cascade','foreignKey':_0x260c('0x1cc')});db[_0x260c('0xaa')][_0x260c('0x116')](db[_0x260c('0x1d0')],{'as':_0x260c('0x1c1'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1c8')});db[_0x260c('0xaa')][_0x260c('0x121')](db[_0x260c('0xa8')],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x1c5')});db['DeskConfiguration'][_0x260c('0x123')](db['Tag'],{'through':_0x260c('0x1d1')});db[_0x260c('0x1d0')][_0x260c('0x116')](db[_0x260c('0x1d0')],{'as':_0x260c('0x1cd'),'foreignKey':'SubjectId'});db[_0x260c('0x1d0')][_0x260c('0x116')](db[_0x260c('0x1d0')],{'as':_0x260c('0x1ce'),'foreignKey':_0x260c('0x1cc')});db[_0x260c('0x1d0')]['hasMany'](db[_0x260c('0x1d0')],{'as':_0x260c('0x1c9'),'foreignKey':_0x260c('0x1c8')});db[_0x260c('0x1d0')][_0x260c('0x121')](db[_0x260c('0x92')],{'as':_0x260c('0x92'),'foreignKey':_0x260c('0x1cf')});db[_0x260c('0xad')]['hasMany'](db[_0x260c('0xaf')],{'as':_0x260c('0x1c4'),'onDelete':_0x260c('0x111'),'foreignKey':'AccountId'});db[_0x260c('0xaf')][_0x260c('0x116')](db[_0x260c('0x1d2')],{'as':'Subjects','onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1c7')});db[_0x260c('0xaf')][_0x260c('0x116')](db[_0x260c('0x1d2')],{'as':'Descriptions','onDelete':_0x260c('0x111'),'foreignKey':'DescriptionId'});db[_0x260c('0xaf')][_0x260c('0x116')](db[_0x260c('0x1d2')],{'as':_0x260c('0x1c1'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1c8')});db['ZohoConfiguration']['belongsTo'](db['ZohoAccount'],{'as':'Account','foreignKey':_0x260c('0x1c5')});db[_0x260c('0x1d2')]['hasMany'](db[_0x260c('0x1d2')],{'as':_0x260c('0x1cd'),'foreignKey':_0x260c('0x1c7')});db[_0x260c('0x1d2')][_0x260c('0x116')](db['ZohoField'],{'as':_0x260c('0x1ce'),'foreignKey':'DescriptionId'});db[_0x260c('0x1d2')][_0x260c('0x116')](db[_0x260c('0x1d2')],{'as':_0x260c('0x1c9'),'foreignKey':_0x260c('0x1c8')});db[_0x260c('0x1d2')]['belongsTo'](db[_0x260c('0x92')],{'as':_0x260c('0x92'),'foreignKey':_0x260c('0x1cf')});db[_0x260c('0x1d3')]['hasMany'](db['ZendeskConfiguration'],{'as':_0x260c('0x1c4'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x260c('0xb2')]['hasMany'](db['ZendeskField'],{'as':_0x260c('0x1c6'),'foreignKey':_0x260c('0x1c7')});db[_0x260c('0xb2')]['hasMany'](db[_0x260c('0x1d4')],{'as':_0x260c('0x1cb'),'foreignKey':'DescriptionId'});db[_0x260c('0xb2')][_0x260c('0x116')](db[_0x260c('0x1d4')],{'as':_0x260c('0x1c1'),'foreignKey':_0x260c('0x1c8')});db['ZendeskConfiguration'][_0x260c('0x121')](db['ZendeskAccount'],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x1c5')});db[_0x260c('0xb2')][_0x260c('0x123')](db[_0x260c('0x8c')],{'through':_0x260c('0x1d5')});db[_0x260c('0x1d4')]['hasMany'](db[_0x260c('0x1d4')],{'as':_0x260c('0x1cd'),'foreignKey':_0x260c('0x1c7')});db['ZendeskField'][_0x260c('0x116')](db[_0x260c('0x1d4')],{'as':_0x260c('0x1ce'),'foreignKey':_0x260c('0x1cc')});db[_0x260c('0x1d4')][_0x260c('0x116')](db[_0x260c('0x1d4')],{'as':'Field','foreignKey':_0x260c('0x1c8')});db[_0x260c('0x1d4')][_0x260c('0x121')](db[_0x260c('0x92')],{'as':_0x260c('0x92'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0x260c('0x116')](db[_0x260c('0xb6')],{'as':_0x260c('0x1c4'),'onDelete':_0x260c('0x111'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x260c('0x116')](db[_0x260c('0xb8')],{'as':_0x260c('0x1c6'),'onDelete':_0x260c('0x111'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration']['hasMany'](db[_0x260c('0xb8')],{'as':_0x260c('0x1cb'),'onDelete':'cascade','foreignKey':_0x260c('0x1cc')});db[_0x260c('0xb6')][_0x260c('0x116')](db[_0x260c('0xb8')],{'as':_0x260c('0x1c1'),'onDelete':'cascade','foreignKey':_0x260c('0x1c8')});db[_0x260c('0xb6')][_0x260c('0x121')](db['FreshdeskAccount'],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x1c5')});db[_0x260c('0xb6')]['belongsToMany'](db['Tag'],{'through':_0x260c('0x1d6')});db[_0x260c('0xb8')]['hasMany'](db[_0x260c('0xb8')],{'as':'Subject','foreignKey':_0x260c('0x1c7')});db[_0x260c('0xb8')]['hasMany'](db[_0x260c('0xb8')],{'as':_0x260c('0x1ce'),'foreignKey':'DescriptionId'});db[_0x260c('0xb8')][_0x260c('0x116')](db['FreshdeskField'],{'as':'Field','foreignKey':_0x260c('0x1c8')});db['FreshdeskField'][_0x260c('0x121')](db['Variable'],{'as':_0x260c('0x92'),'foreignKey':'VariableId'});db[_0x260c('0xba')][_0x260c('0x116')](db['VtigerConfiguration'],{'as':_0x260c('0x1c4'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1c5')});db[_0x260c('0xbc')]['hasMany'](db['VtigerField'],{'as':_0x260c('0x1c6'),'foreignKey':_0x260c('0x1c7')});db[_0x260c('0xbc')][_0x260c('0x116')](db[_0x260c('0xbe')],{'as':_0x260c('0x1cb'),'foreignKey':_0x260c('0x1cc')});db[_0x260c('0xbc')][_0x260c('0x116')](db[_0x260c('0xbe')],{'as':_0x260c('0x1c1'),'foreignKey':_0x260c('0x1c8')});db['VtigerConfiguration']['belongsTo'](db['VtigerAccount'],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x1c5')});db[_0x260c('0xbe')]['hasMany'](db[_0x260c('0xbe')],{'as':_0x260c('0x1cd'),'foreignKey':'SubjectId'});db[_0x260c('0xbe')]['hasMany'](db[_0x260c('0xbe')],{'as':_0x260c('0x1ce'),'foreignKey':_0x260c('0x1cc')});db[_0x260c('0xbe')][_0x260c('0x116')](db['VtigerField'],{'as':_0x260c('0x1c9'),'foreignKey':'FieldId'});db['VtigerField'][_0x260c('0x121')](db[_0x260c('0x92')],{'as':_0x260c('0x92'),'foreignKey':_0x260c('0x1cf')});db[_0x260c('0xc0')][_0x260c('0x116')](db[_0x260c('0xc2')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x260c('0x1c5')});db[_0x260c('0xc2')][_0x260c('0x116')](db[_0x260c('0xc4')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x260c('0xc2')][_0x260c('0x116')](db[_0x260c('0xc4')],{'as':_0x260c('0x1cb'),'foreignKey':_0x260c('0x1cc')});db[_0x260c('0xc2')][_0x260c('0x116')](db[_0x260c('0xc4')],{'as':_0x260c('0x1c1'),'foreignKey':_0x260c('0x1c8')});db['ServicenowConfiguration'][_0x260c('0x121')](db[_0x260c('0xc0')],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x1c5')});db[_0x260c('0xc4')][_0x260c('0x116')](db[_0x260c('0xc4')],{'as':_0x260c('0x1cd'),'foreignKey':_0x260c('0x1c7')});db[_0x260c('0xc4')][_0x260c('0x116')](db[_0x260c('0xc4')],{'as':_0x260c('0x1ce'),'foreignKey':'DescriptionId'});db[_0x260c('0xc4')][_0x260c('0x116')](db['ServicenowField'],{'as':'Field','foreignKey':_0x260c('0x1c8')});db['ServicenowField'][_0x260c('0x121')](db[_0x260c('0x92')],{'as':_0x260c('0x92'),'foreignKey':_0x260c('0x1cf')});db[_0x260c('0xc6')][_0x260c('0x116')](db[_0x260c('0xc8')],{'as':'Configurations','onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1c5')});db['Dynamics365Account']['belongsTo'](db[_0x260c('0x165')],{'as':_0x260c('0x165'),'foreignKey':_0x260c('0x166')});db[_0x260c('0xc8')][_0x260c('0x116')](db[_0x260c('0xca')],{'as':_0x260c('0x1c6'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1c7')});db['Dynamics365Configuration'][_0x260c('0x116')](db[_0x260c('0xca')],{'as':_0x260c('0x1cb'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['Dynamics365Configuration'][_0x260c('0x116')](db['Dynamics365Field'],{'as':_0x260c('0x1c1'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1c8')});db[_0x260c('0xc8')][_0x260c('0x121')](db[_0x260c('0xc6')],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x1c5')});db[_0x260c('0xca')]['hasMany'](db[_0x260c('0xca')],{'as':_0x260c('0x1cd'),'foreignKey':'SubjectId'});db['Dynamics365Field'][_0x260c('0x116')](db[_0x260c('0xca')],{'as':_0x260c('0x1ce'),'foreignKey':'DescriptionId'});db[_0x260c('0xca')][_0x260c('0x116')](db[_0x260c('0xca')],{'as':_0x260c('0x1c9'),'foreignKey':_0x260c('0x1c8')});db[_0x260c('0xca')]['belongsTo'](db[_0x260c('0x92')],{'as':_0x260c('0x92'),'foreignKey':_0x260c('0x1cf')});db[_0x260c('0xcc')]['hasMany'](db[_0x260c('0xce')],{'as':_0x260c('0x1c4'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1c5')});db['FreshsalesConfiguration'][_0x260c('0x116')](db[_0x260c('0x1d7')],{'as':_0x260c('0x1c6'),'foreignKey':_0x260c('0x1c7')});db[_0x260c('0xce')][_0x260c('0x116')](db[_0x260c('0x1d7')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x260c('0xce')][_0x260c('0x116')](db[_0x260c('0x1d7')],{'as':_0x260c('0x1c1'),'foreignKey':_0x260c('0x1c8')});db[_0x260c('0xce')][_0x260c('0x121')](db[_0x260c('0xcc')],{'as':_0x260c('0x186'),'foreignKey':'AccountId'});db[_0x260c('0x1d7')][_0x260c('0x116')](db[_0x260c('0x1d7')],{'as':_0x260c('0x1cd'),'foreignKey':_0x260c('0x1c7')});db['FreshsalesField'][_0x260c('0x116')](db[_0x260c('0x1d7')],{'as':_0x260c('0x1ce'),'foreignKey':_0x260c('0x1cc')});db['FreshsalesField']['hasMany'](db['FreshsalesField'],{'as':_0x260c('0x1c9'),'foreignKey':_0x260c('0x1c8')});db[_0x260c('0x1d7')][_0x260c('0x121')](db[_0x260c('0x92')],{'as':_0x260c('0x92'),'foreignKey':'VariableId'});db[_0x260c('0x1d8')][_0x260c('0x121')](db[_0x260c('0x137')],{});db[_0x260c('0x1d8')][_0x260c('0x121')](db[_0x260c('0xf8')],{'as':_0x260c('0x171'),'foreignKey':_0x260c('0x172')});db[_0x260c('0x1d8')][_0x260c('0x121')](db[_0x260c('0x163')],{'as':_0x260c('0x164'),'foreignKey':_0x260c('0x175')});db['ChatQueueReport'][_0x260c('0x121')](db[_0x260c('0x68')],{});db[_0x260c('0x1d8')][_0x260c('0x121')](db[_0x260c('0x19b')],{});db[_0x260c('0x1d8')]['belongsTo'](db['User'],{});db[_0x260c('0x1d8')][_0x260c('0x121')](db[_0x260c('0x132')],{});db['ChatInternalMessage'][_0x260c('0x121')](db[_0x260c('0x12')],{'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x1d9')});db[_0x260c('0xd3')][_0x260c('0x121')](db[_0x260c('0x12')],{'onDelete':_0x260c('0x111'),'foreignKey':'ToId'});db[_0x260c('0xd7')][_0x260c('0x116')](db['JscriptyQuestionReport'],{'foreignKey':_0x260c('0x1da'),'onDelete':'cascade'});db['JscriptySessionReport']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x260c('0x1da'),'onDelete':_0x260c('0x111')});db[_0x260c('0xd9')][_0x260c('0x121')](db['SmsAccount'],{});db[_0x260c('0xd9')]['belongsTo'](db[_0x260c('0xf8')],{'as':_0x260c('0x171'),'foreignKey':_0x260c('0x172')});db[_0x260c('0xd9')][_0x260c('0x121')](db['CmContact'],{'as':_0x260c('0x164'),'foreignKey':'ContactId'});db[_0x260c('0xd9')][_0x260c('0x121')](db[_0x260c('0x11a')],{});db[_0x260c('0xd9')][_0x260c('0x121')](db[_0x260c('0x58')],{});db[_0x260c('0xd9')][_0x260c('0x121')](db['User'],{});db[_0x260c('0xd9')][_0x260c('0x121')](db[_0x260c('0x5a')],{});db[_0x260c('0xdd')]['hasMany'](db[_0x260c('0xd7')],{'foreignKey':_0x260c('0x1db')});db['JscriptyProject'][_0x260c('0x116')](db['JscriptyQuestionReport'],{'foreignKey':_0x260c('0x1db')});db[_0x260c('0xdd')][_0x260c('0x116')](db[_0x260c('0x1dc')],{'foreignKey':_0x260c('0x1db')});db[_0x260c('0xe1')][_0x260c('0x123')](db['User'],{'as':_0x260c('0x179'),'through':'user_has_square_projects'});db['Team']['belongsToMany'](db[_0x260c('0x12')],{'as':'Agents','through':_0x260c('0x128')});db[_0x260c('0xe7')][_0x260c('0x123')](db[_0x260c('0x1a')],{'through':_0x260c('0x10a'),'as':_0x260c('0x1dd')});db['Team'][_0x260c('0x123')](db[_0x260c('0x40')],{'through':_0x260c('0x174'),'as':_0x260c('0x131')});db[_0x260c('0xe7')][_0x260c('0x123')](db[_0x260c('0x132')],{'through':_0x260c('0x19e'),'as':'ChatQueues'});db[_0x260c('0xe7')][_0x260c('0x123')](db[_0x260c('0x50')],{'through':'team_has_fax_queues','as':_0x260c('0x134')});db['Team']['belongsToMany'](db[_0x260c('0x5a')],{'through':_0x260c('0x1de'),'as':'SmsQueues'});db[_0x260c('0xe7')]['belongsToMany'](db[_0x260c('0x63')],{'through':_0x260c('0x197'),'as':_0x260c('0x136')});db[_0x260c('0xe7')][_0x260c('0x123')](db['WhatsappQueue'],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0x260c('0xe7')]['belongsToMany'](db['VoicePrefix'],{'through':_0x260c('0x10c'),'as':_0x260c('0x130')});db['Campaign'][_0x260c('0x116')](db[_0x260c('0x14e')],{'as':_0x260c('0x14f'),'foreignKey':'CampaignId'});db[_0x260c('0xea')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'CampaignId'});db['Campaign']['hasMany'](db[_0x260c('0x76')],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0x260c('0xea')][_0x260c('0x116')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x260c('0x1a6')});db[_0x260c('0xea')][_0x260c('0x121')](db[_0x260c('0x28')],{'as':_0x260c('0x28'),'foreignKey':'TrunkId'});db['Campaign'][_0x260c('0x121')](db[_0x260c('0x28')],{'as':_0x260c('0x1df'),'foreignKey':'TrunkBackupId'});db[_0x260c('0xea')]['belongsTo'](db[_0x260c('0x82')],{'as':_0x260c('0x82'),'foreignKey':_0x260c('0x155')});db['Campaign'][_0x260c('0x121')](db['SquareProject'],{'as':'SquareProject','foreignKey':_0x260c('0x1e0')});db[_0x260c('0xea')][_0x260c('0x123')](db[_0x260c('0xf8')],{'as':_0x260c('0x1e1'),'through':'campaigns_has_cm_lists'});db[_0x260c('0xea')][_0x260c('0x123')](db[_0x260c('0xf8')],{'as':'BlackLists','through':_0x260c('0x1e2')});db['Attachment'][_0x260c('0x121')](db[_0x260c('0x6b')],{'as':_0x260c('0x6b'),'foreignKey':_0x260c('0x17e')});db[_0x260c('0xf0')][_0x260c('0x121')](db[_0x260c('0x16e')],{});db[_0x260c('0xf0')][_0x260c('0x121')](db[_0x260c('0x42')],{});db[_0x260c('0xf0')][_0x260c('0x121')](db['MailAccount'],{'foreignKey':_0x260c('0x1e3'),'as':'FromAccount'});db[_0x260c('0xf0')][_0x260c('0x121')](db['User'],{'foreignKey':_0x260c('0x1e4'),'as':_0x260c('0x1e5')});db[_0x260c('0xf0')]['belongsTo'](db[_0x260c('0x12')],{'foreignKey':_0x260c('0x1e6'),'as':_0x260c('0x1e7')});db['MailTransferReport'][_0x260c('0x121')](db[_0x260c('0x40')],{'foreignKey':'ToMailQueueId','as':_0x260c('0x1e8')});db['MailTransferReport'][_0x260c('0x121')](db['MailAccount'],{'foreignKey':_0x260c('0x1e9'),'as':'ToAccount'});db[_0x260c('0x1ea')][_0x260c('0x121')](db[_0x260c('0x19b')],{});db['ChatTransferReport'][_0x260c('0x121')](db['ChatInteraction'],{});db['ChatTransferReport'][_0x260c('0x121')](db[_0x260c('0x137')],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db['ChatTransferReport'][_0x260c('0x121')](db[_0x260c('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x260c('0x1ea')]['belongsTo'](db[_0x260c('0x12')],{'foreignKey':_0x260c('0x1e6'),'as':_0x260c('0x1e7')});db[_0x260c('0x1ea')][_0x260c('0x121')](db['ChatQueue'],{'foreignKey':_0x260c('0x1eb'),'as':_0x260c('0x1e8')});db[_0x260c('0x1ea')][_0x260c('0x121')](db[_0x260c('0x137')],{'foreignKey':_0x260c('0x1ec'),'as':'ToAccount'});db[_0x260c('0xf3')][_0x260c('0x121')](db[_0x260c('0x4e')],{});db[_0x260c('0xf3')][_0x260c('0x121')](db['FaxInteraction'],{});db[_0x260c('0xf3')][_0x260c('0x121')](db[_0x260c('0x4b')],{'foreignKey':_0x260c('0x1ed'),'as':_0x260c('0x1ee')});db[_0x260c('0xf3')]['belongsTo'](db['User'],{'foreignKey':_0x260c('0x1e4'),'as':'FromAgent'});db[_0x260c('0xf3')][_0x260c('0x121')](db[_0x260c('0x12')],{'foreignKey':_0x260c('0x1e6'),'as':_0x260c('0x1e7')});db['FaxTransferReport'][_0x260c('0x121')](db['FaxQueue'],{'foreignKey':_0x260c('0x1ef'),'as':'ToQueue'});db[_0x260c('0xf3')]['belongsTo'](db[_0x260c('0x4b')],{'foreignKey':_0x260c('0x1f0'),'as':_0x260c('0x1f1')});db[_0x260c('0xf5')]['belongsTo'](db[_0x260c('0x61')],{});db[_0x260c('0xf5')][_0x260c('0x121')](db[_0x260c('0x5f')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x260c('0x190')],{'foreignKey':_0x260c('0x1f2'),'as':_0x260c('0x1ee')});db[_0x260c('0xf5')]['belongsTo'](db['User'],{'foreignKey':_0x260c('0x1e4'),'as':_0x260c('0x1e5')});db[_0x260c('0xf5')][_0x260c('0x121')](db['User'],{'foreignKey':_0x260c('0x1e6'),'as':_0x260c('0x1e7')});db['OpenchannelTransferReport'][_0x260c('0x121')](db[_0x260c('0x63')],{'foreignKey':_0x260c('0x1f3'),'as':'ToQueue'});db[_0x260c('0xf5')][_0x260c('0x121')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0x260c('0x1f1')});db['SmsTransferReport'][_0x260c('0x121')](db[_0x260c('0x58')],{});db[_0x260c('0x1f4')]['belongsTo'](db[_0x260c('0x11a')],{});db[_0x260c('0x1f4')]['belongsTo'](db[_0x260c('0x54')],{'foreignKey':_0x260c('0x1f5'),'as':_0x260c('0x1ee')});db[_0x260c('0x1f4')][_0x260c('0x121')](db[_0x260c('0x12')],{'foreignKey':'FromUserId','as':_0x260c('0x1e5')});db[_0x260c('0x1f4')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0x260c('0x1e7')});db[_0x260c('0x1f4')][_0x260c('0x121')](db['SmsQueue'],{'foreignKey':_0x260c('0x1f6'),'as':_0x260c('0x1e8')});db[_0x260c('0x1f4')][_0x260c('0x121')](db[_0x260c('0x54')],{'foreignKey':_0x260c('0x1f7'),'as':_0x260c('0x1f1')});db[_0x260c('0xf8')][_0x260c('0x116')](db[_0x260c('0x7e')],{'as':'Dispositions','foreignKey':_0x260c('0x172'),'onDelete':_0x260c('0x111')});db[_0x260c('0xf8')][_0x260c('0x116')](db[_0x260c('0x79')],{'as':_0x260c('0x1f8'),'foreignKey':_0x260c('0x172')});db[_0x260c('0xf8')][_0x260c('0x116')](db[_0x260c('0x163')],{'as':_0x260c('0x1a1'),'onDelete':_0x260c('0x111'),'foreignKey':_0x260c('0x172')});db[_0x260c('0xf8')]['hasMany'](db[_0x260c('0x74')],{'as':_0x260c('0x119'),'foreignKey':_0x260c('0x172')});db[_0x260c('0xf8')]['hasMany'](db[_0x260c('0x76')],{'as':_0x260c('0x1f9'),'foreignKey':'ListId'});db[_0x260c('0xf8')][_0x260c('0x116')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x260c('0x172')});db[_0x260c('0xf8')]['belongsToMany'](db['VoiceQueue'],{'as':_0x260c('0x1fa'),'through':_0x260c('0x157')});db[_0x260c('0xf8')][_0x260c('0x123')](db[_0x260c('0x12')],{'as':_0x260c('0x173'),'through':_0x260c('0x127')});db[_0x260c('0x12f')][_0x260c('0x116')](db[_0x260c('0x148')],{'as':_0x260c('0x118'),'onDelete':'cascade'});db[_0x260c('0x12f')]['belongsToMany'](db[_0x260c('0x12')],{'as':_0x260c('0x173'),'through':_0x260c('0x10d')});db[_0x260c('0x12f')]['belongsToMany'](db['Team'],{'through':_0x260c('0x10c'),'as':_0x260c('0x158')});db[_0x260c('0xfa')][_0x260c('0x116')](db[_0x260c('0x12')],{'as':_0x260c('0x179'),'foreignKey':_0x260c('0x122')});db[_0x260c('0xfa')][_0x260c('0x116')](db[_0x260c('0x1fb')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x260c('0x111')});db[_0x260c('0x1fb')][_0x260c('0x116')](db[_0x260c('0x1fc')],{'as':_0x260c('0x1fd'),'foreignKey':_0x260c('0x1fe'),'onDelete':'cascade'});db[_0x260c('0x100')][_0x260c('0x116')](db['Disposition'],{'as':_0x260c('0x16a'),'foreignKey':_0x260c('0x1ff'),'onDelete':_0x260c('0x111')});db[_0x260c('0x100')]['hasMany'](db[_0x260c('0x16c')],{'as':'Answers','foreignKey':_0x260c('0x1ff')});db[_0x260c('0x100')][_0x260c('0x116')](db[_0x260c('0x200')],{'as':_0x260c('0x15d'),'foreignKey':'WhatsappAccountId'});db[_0x260c('0x100')][_0x260c('0x116')](db[_0x260c('0x103')],{'as':_0x260c('0x16f')});db[_0x260c('0x100')][_0x260c('0x116')](db['WhatsappApplication'],{'as':_0x260c('0x149')});db[_0x260c('0x100')][_0x260c('0x121')](db[_0x260c('0xf8')],{'as':_0x260c('0x171'),'foreignKey':_0x260c('0x172')});db['WhatsappAccount']['belongsTo'](db[_0x260c('0x84')],{'as':_0x260c('0x184'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x260c('0x100')][_0x260c('0x123')](db[_0x260c('0x12')],{'as':_0x260c('0x173'),'through':'user_has_whatsapp_accounts'});db[_0x260c('0x101')][_0x260c('0x121')](db['User'],{'onDelete':_0x260c('0x167')});db['WhatsappApplication'][_0x260c('0x121')](db[_0x260c('0x108')],{'onDelete':_0x260c('0x167')});db['WhatsappApplication']['belongsTo'](db['WhatsappAccount'],{'onDelete':_0x260c('0x167')});db[_0x260c('0x101')]['belongsTo'](db['Interval'],{'onDelete':_0x260c('0x167'),'foreignKey':_0x260c('0x155')});db[_0x260c('0x101')][_0x260c('0x121')](db[_0x260c('0x8c')],{'onDelete':_0x260c('0x167'),'foreignKey':_0x260c('0x17f')});db[_0x260c('0x103')][_0x260c('0x116')](db[_0x260c('0x200')],{'as':_0x260c('0x15d'),'onDelete':'cascade','foreignKey':_0x260c('0x201')});db[_0x260c('0x103')][_0x260c('0x121')](db[_0x260c('0x100')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0x260c('0x103')][_0x260c('0x121')](db['CmContact'],{'as':_0x260c('0x164'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0x260c('0x121')](db[_0x260c('0x12')],{'as':_0x260c('0x176'),'foreignKey':_0x260c('0x112')});db[_0x260c('0x103')][_0x260c('0x123')](db[_0x260c('0x8c')],{'through':_0x260c('0x1b9'),'as':'Tags'});db[_0x260c('0x103')][_0x260c('0x123')](db[_0x260c('0x8c')],{'through':_0x260c('0x1b9'),'as':_0x260c('0x18e')});db[_0x260c('0x103')]['belongsToMany'](db[_0x260c('0x12')],{'as':_0x260c('0x179'),'through':_0x260c('0x12e'),'foreignKey':_0x260c('0x201')});db['WhatsappMessage'][_0x260c('0x121')](db[_0x260c('0x12')],{'as':'User'});db['WhatsappMessage'][_0x260c('0x121')](db[_0x260c('0x163')],{'onDelete':_0x260c('0x111'),'as':_0x260c('0x164')});db[_0x260c('0x200')][_0x260c('0x121')](db['WhatsappInteraction'],{'onDelete':_0x260c('0x111'),'as':_0x260c('0x189'),'foreignKey':_0x260c('0x201')});db[_0x260c('0x200')]['belongsTo'](db[_0x260c('0x100')],{'as':_0x260c('0x186'),'foreignKey':_0x260c('0x1ff')});db[_0x260c('0x105')][_0x260c('0x121')](db[_0x260c('0x100')],{});db[_0x260c('0x105')][_0x260c('0x121')](db[_0x260c('0xf8')],{'as':_0x260c('0x171'),'foreignKey':_0x260c('0x172')});db[_0x260c('0x105')][_0x260c('0x121')](db[_0x260c('0x163')],{'as':_0x260c('0x164'),'foreignKey':'ContactId'});db[_0x260c('0x105')]['belongsTo'](db[_0x260c('0x103')],{});db[_0x260c('0x105')][_0x260c('0x121')](db['WhatsappQueue'],{});db[_0x260c('0x105')][_0x260c('0x121')](db[_0x260c('0x200')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x260c('0x12')],{});db['WhatsappTransferReport'][_0x260c('0x121')](db[_0x260c('0x200')],{});db[_0x260c('0x202')][_0x260c('0x121')](db['WhatsappInteraction'],{});db['WhatsappTransferReport'][_0x260c('0x121')](db[_0x260c('0x100')],{'foreignKey':_0x260c('0x203'),'as':'FromAccount'});db[_0x260c('0x202')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x260c('0x204'),'as':'ToAccount'});db[_0x260c('0x202')][_0x260c('0x121')](db[_0x260c('0x108')],{'foreignKey':_0x260c('0x205'),'as':_0x260c('0x1e8')});db[_0x260c('0x202')][_0x260c('0x121')](db[_0x260c('0x12')],{'foreignKey':_0x260c('0x1e4'),'as':_0x260c('0x1e5')});db[_0x260c('0x202')]['belongsTo'](db[_0x260c('0x12')],{'foreignKey':_0x260c('0x1e6'),'as':_0x260c('0x1e7')});db[_0x260c('0x108')][_0x260c('0x123')](db[_0x260c('0x12')],{'as':_0x260c('0x173'),'through':_0x260c('0x39'),'foreignKey':_0x260c('0x206')});db['WhatsappQueue'][_0x260c('0x123')](db[_0x260c('0xe7')],{'through':_0x260c('0x207'),'as':_0x260c('0x158')});db[_0x260c('0x10f')][_0x260c('0x121')](db[_0x260c('0x12')],{'as':_0x260c('0x208'),'foreignKey':_0x260c('0x112'),'onDelete':_0x260c('0x111'),'hooks':!![]});db['CloudProvider'][_0x260c('0x110')](db[_0x260c('0xc6')],{'as':_0x260c('0xc6'),'onDelete':'restrict'});db[_0x260c('0x165')]['hasOne'](db[_0x260c('0x3b')],{'as':_0x260c('0x168'),'onDelete':_0x260c('0x167')});db[_0x260c('0x165')][_0x260c('0x110')](db['MailServerOut'],{'as':_0x260c('0x169'),'onDelete':_0x260c('0x167')});module[_0x260c('0x209')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 8cfd34c..8d17a02 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbf5=['/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareMessage','/api/teams','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','/www','root','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','express','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','/api/trunks','/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/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/tags','/api/templates','/api/triggers','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts'];(function(_0x108be7,_0x4d563c){var _0x3a1836=function(_0x46c61f){while(--_0x46c61f){_0x108be7['push'](_0x108be7['shift']());}};_0x3a1836(++_0x4d563c);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x4b00d7,_0x54eeea){_0x4b00d7=_0x4b00d7-0x0;var _0x326b02=_0xdbf5[_0x4b00d7];return _0x326b02;};'use strict';var path=require('path');var express=require(_0x5dbf('0x0'));var errors=require('./errors');var config=require('./config/environment');var setupLoggers=require(_0x5dbf('0x1'))[_0x5dbf('0x2')];var clientSideLogs=require(_0x5dbf('0x3'));exports[_0x5dbf('0x4')]=function(_0x38b629){return setupLoggers(_0x38b629)[_0x5dbf('0x5')](function(){_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x7'),require(_0x5dbf('0x8')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x9'),require(_0x5dbf('0xa')));_0x38b629[_0x5dbf('0x6')]('/api/voice/contexts',require(_0x5dbf('0xb')));_0x38b629['use'](_0x5dbf('0xc'),require(_0x5dbf('0xd')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xe'),require('./api/voiceMusicOnHold'));_0x38b629[_0x5dbf('0x6')]('/api/voice/queues',require('./api/voiceQueue'));_0x38b629[_0x5dbf('0x6')]('/api/voice/recordings',require('./api/voiceRecording'));_0x38b629[_0x5dbf('0x6')]('/api/screen/recordings',require(_0x5dbf('0xf')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x10'),require(_0x5dbf('0x11')));_0x38b629[_0x5dbf('0x6')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x12'),require('./api/voiceCallReport'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x13'),require(_0x5dbf('0x14')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x15'),require(_0x5dbf('0x16')));_0x38b629[_0x5dbf('0x6')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x17'),require(_0x5dbf('0x18')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x19'),require('./api/trunk'));_0x38b629[_0x5dbf('0x6')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x38b629['use'](_0x5dbf('0x1a'),require(_0x5dbf('0x1b')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x1c'),require(_0x5dbf('0x1d')));_0x38b629['use'](_0x5dbf('0x1e'),require('./api/mailQueue'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x1f'),require(_0x5dbf('0x20')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x21'),require(_0x5dbf('0x22')));_0x38b629['use'](_0x5dbf('0x23'),require(_0x5dbf('0x24')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x25'),require(_0x5dbf('0x26')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x27'),require(_0x5dbf('0x28')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x29'),require(_0x5dbf('0x2a')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x2b'),require(_0x5dbf('0x2c')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x2d'),require(_0x5dbf('0x2e')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x2f'),require(_0x5dbf('0x30')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x31'),require(_0x5dbf('0x32')));_0x38b629['use'](_0x5dbf('0x33'),require(_0x5dbf('0x34')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x35'),require(_0x5dbf('0x36')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x37'),require(_0x5dbf('0x38')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x39'),require(_0x5dbf('0x3a')));_0x38b629['use']('/api/sms/applications',require(_0x5dbf('0x3b')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x3c'),require(_0x5dbf('0x3d')));_0x38b629[_0x5dbf('0x6')]('/api/sms/messages',require('./api/smsMessage'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x3e'),require('./api/smsQueue'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x3f'),require(_0x5dbf('0x40')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x41'),require('./api/openchannelApplication'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x42'),require(_0x5dbf('0x43')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x44'),require('./api/openchannelMessage'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x45'),require(_0x5dbf('0x46')));_0x38b629[_0x5dbf('0x6')]('/api/chat/websites',require(_0x5dbf('0x47')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x48'),require(_0x5dbf('0x49')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x4a'),require(_0x5dbf('0x4b')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x4c'),require(_0x5dbf('0x4d')));_0x38b629[_0x5dbf('0x6')]('/api/chat/messages',require(_0x5dbf('0x4e')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x4f'),require('./api/chatOfflineMessage'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x50'),require(_0x5dbf('0x51')));_0x38b629['use'](_0x5dbf('0x52'),require(_0x5dbf('0x53')));_0x38b629[_0x5dbf('0x6')]('/api/chat/proactive_actions',require(_0x5dbf('0x54')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x55'),require(_0x5dbf('0x56')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x57'),require(_0x5dbf('0x58')));_0x38b629[_0x5dbf('0x6')]('/api/cm/hopper',require('./api/cmHopper'));_0x38b629['use']('/api/cm/hopper_black',require(_0x5dbf('0x59')));_0x38b629[_0x5dbf('0x6')]('/api/cm/hopper_final',require(_0x5dbf('0x5a')));_0x38b629[_0x5dbf('0x6')]('/api/cm/hopper_history',require(_0x5dbf('0x5b')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x5c'),require(_0x5dbf('0x5d')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x5e'),require(_0x5dbf('0x5f')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x60'),require(_0x5dbf('0x61')));_0x38b629['use'](_0x5dbf('0x62'),require(_0x5dbf('0x63')));_0x38b629[_0x5dbf('0x6')]('/api/dispositions',require(_0x5dbf('0x64')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x65'),require(_0x5dbf('0x66')));_0x38b629['use'](_0x5dbf('0x67'),require('./api/interval'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x68'),require(_0x5dbf('0x69')));_0x38b629[_0x5dbf('0x6')]('/api/cdr',require('./api/cdr'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x6a'),require(_0x5dbf('0x6b')));_0x38b629['use'](_0x5dbf('0x6c'),require('./api/schedule'));_0x38b629['use']('/api/sounds',require('./api/sound'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x6d'),require('./api/tag'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x6e'),require('./api/template'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x6f'),require('./api/trigger'));_0x38b629[_0x5dbf('0x6')]('/api/variables',require('./api/variable'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x70'),require(_0x5dbf('0x71')));_0x38b629['use']('/api/integrations/reports',require(_0x5dbf('0x72')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x73'),require(_0x5dbf('0x74')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x75'),require(_0x5dbf('0x76')));_0x38b629[_0x5dbf('0x6')]('/api/analytics/extracted_reports',require(_0x5dbf('0x77')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x78'),require(_0x5dbf('0x79')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x7a'),require(_0x5dbf('0x7b')));_0x38b629['use'](_0x5dbf('0x7c'),require('./api/analyticTreeReport'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x7d'),require(_0x5dbf('0x7e')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x7f'),require(_0x5dbf('0x80')));_0x38b629[_0x5dbf('0x6')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x38b629['use'](_0x5dbf('0x81'),require(_0x5dbf('0x82')));_0x38b629[_0x5dbf('0x6')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x83'),require(_0x5dbf('0x84')));_0x38b629['use'](_0x5dbf('0x85'),require('./api/intDeskAccount'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x86'),require(_0x5dbf('0x87')));_0x38b629['use']('/api/integrations/desk/fields',require(_0x5dbf('0x88')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x89'),require(_0x5dbf('0x8a')));_0x38b629['use'](_0x5dbf('0x8b'),require(_0x5dbf('0x8c')));_0x38b629['use']('/api/integrations/zoho/fields',require(_0x5dbf('0x8d')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x8e'),require(_0x5dbf('0x8f')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x90'),require('./api/intZendeskConfiguration'));_0x38b629[_0x5dbf('0x6')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x38b629['use'](_0x5dbf('0x91'),require('./api/intFreshdeskAccount'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x92'),require(_0x5dbf('0x93')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x94'),require(_0x5dbf('0x95')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x96'),require(_0x5dbf('0x97')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x98'),require(_0x5dbf('0x99')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x9a'),require(_0x5dbf('0x9b')));_0x38b629['use'](_0x5dbf('0x9c'),require('./api/intServicenowAccount'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x9d'),require(_0x5dbf('0x9e')));_0x38b629[_0x5dbf('0x6')]('/api/integrations/servicenow/fields',require(_0x5dbf('0x9f')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xa0'),require(_0x5dbf('0xa1')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xa2'),require('./api/intDynamics365Configuration'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xa3'),require(_0x5dbf('0xa4')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xa5'),require(_0x5dbf('0xa6')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xa7'),require(_0x5dbf('0xa8')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xa9'),require(_0x5dbf('0xaa')));_0x38b629['use']('/api/networks',require(_0x5dbf('0xab')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xac'),require(_0x5dbf('0xad')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xae'),require(_0x5dbf('0xaf')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xb0'),require('./api/jscriptyAnswerReport'));_0x38b629['use']('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xb1'),require(_0x5dbf('0xb2')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xb3'),require(_0x5dbf('0xb4')));_0x38b629['use']('/api/square/reports',require(_0x5dbf('0xb5')));_0x38b629[_0x5dbf('0x6')]('/api/square/details/reports',require(_0x5dbf('0xb6')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xb7'),require(_0x5dbf('0xb8')));_0x38b629['use'](_0x5dbf('0xb9'),require(_0x5dbf('0xba')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xbb'),require(_0x5dbf('0xbc')));_0x38b629['use'](_0x5dbf('0xbd'),require(_0x5dbf('0xbe')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xbf'),require('./api/squareRecording'));_0x38b629[_0x5dbf('0x6')]('/api/square/messages',require(_0x5dbf('0xc0')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xc1'),require('./api/team'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xc2'),require(_0x5dbf('0xc3')));_0x38b629[_0x5dbf('0x6')]('/api/campaigns',require(_0x5dbf('0xc4')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xc5'),require(_0x5dbf('0xc6')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xc7'),require('./api/attachment'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xc8'),require('./api/plugin'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xc9'),require(_0x5dbf('0xca')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xcb'),require(_0x5dbf('0xcc')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xcd'),require(_0x5dbf('0xce')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xcf'),require(_0x5dbf('0xd0')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xd1'),require(_0x5dbf('0xd2')));_0x38b629[_0x5dbf('0x6')]('/api/cm/lists',require(_0x5dbf('0xd3')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xd4'),require(_0x5dbf('0xd5')));_0x38b629['use'](_0x5dbf('0xd6'),require(_0x5dbf('0xd7')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xd8'),require(_0x5dbf('0xd9')));_0x38b629['use'](_0x5dbf('0xda'),require(_0x5dbf('0xdb')));_0x38b629['use']('/api/userNotifications',require(_0x5dbf('0xdc')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xdd'),require(_0x5dbf('0xde')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xdf'),require(_0x5dbf('0xe0')));_0x38b629['use'](_0x5dbf('0xe1'),require(_0x5dbf('0xe2')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xe3'),require(_0x5dbf('0xe4')));_0x38b629[_0x5dbf('0x6')]('/api/whatsapp/reports/queue',require(_0x5dbf('0xe5')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xe6'),require(_0x5dbf('0xe7')));_0x38b629[_0x5dbf('0x6')]('/api/whatsapp/queues',require(_0x5dbf('0xe8')));_0x38b629['use']('/api/cloudProviders',require('./api/cloudProvider'));_0x38b629['use'](_0x5dbf('0xe9'),require(_0x5dbf('0xea')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xeb'),require(_0x5dbf('0xec')));_0x38b629['use']('/api/auth/local',require(_0x5dbf('0xed')));_0x38b629['use'](_0x5dbf('0xee'),require(_0x5dbf('0xef')));_0x38b629['use'](_0x5dbf('0xf0'),require('./api/authActiveDirectory'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xf1'),require(_0x5dbf('0xf2')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xf3'),require('./api/rpc'));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xf4'),require(_0x5dbf('0xf5')));_0x38b629[_0x5dbf('0x6')]('/api/system',require(_0x5dbf('0xf6')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xf7'),require(_0x5dbf('0xf8')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0xf9'),require(_0x5dbf('0xfa')));_0x38b629[_0x5dbf('0x6')]('/api/logs',clientSideLogs);_0x38b629['use'](_0x5dbf('0xfb'),express[_0x5dbf('0xfc')](path[_0x5dbf('0xfd')](config['root'],'/apidoc')));_0x38b629['use'](_0x5dbf('0xfe'),express[_0x5dbf('0xfc')](path[_0x5dbf('0xfd')](config[_0x5dbf('0xff')],_0x5dbf('0xfe'))));_0x38b629[_0x5dbf('0x6')]('/demo',express[_0x5dbf('0xfc')](path[_0x5dbf('0xfd')](config['root'],'/demo')));_0x38b629[_0x5dbf('0x6')]('/snippet',express['static'](path[_0x5dbf('0xfd')](config[_0x5dbf('0xff')],_0x5dbf('0x100'),'3.0.0')));_0x38b629[_0x5dbf('0x6')](_0x5dbf('0x101'),express['static'](path[_0x5dbf('0xfd')](config[_0x5dbf('0xff')],_0x5dbf('0x102'))));_0x38b629[_0x5dbf('0x103')](_0x5dbf('0x104'))[_0x5dbf('0x105')](errors[0x194]);_0x38b629[_0x5dbf('0x103')]('/*')[_0x5dbf('0x105')](function(_0x551b29,_0x50c701){_0x50c701['sendFile'](path[_0x5dbf('0x106')](_0x38b629[_0x5dbf('0x105')](_0x5dbf('0x107'))+_0x5dbf('0x108')));});return _0x38b629;});}; \ No newline at end of file +var _0xed1f=['./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/smsQueueReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','./api/rpc','/api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','./api/voiceQueue','/api/screen/recordings','/api/voice/mails/messages','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/voiceTransferReport','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','./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/tag','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/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/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts'];(function(_0x3d17f5,_0x248c4e){var _0x3a2dbf=function(_0x3d5928){while(--_0x3d5928){_0x3d17f5['push'](_0x3d17f5['shift']());}};_0x3a2dbf(++_0x248c4e);}(_0xed1f,0x6a));var _0xfed1=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xed1f[_0x27af45];return _0x18df21;};'use strict';var path=require(_0xfed1('0x0'));var express=require(_0xfed1('0x1'));var errors=require(_0xfed1('0x2'));var config=require(_0xfed1('0x3'));var setupLoggers=require(_0xfed1('0x4'))[_0xfed1('0x5')];var clientSideLogs=require(_0xfed1('0x6'));exports[_0xfed1('0x7')]=function(_0x2209b3){return setupLoggers(_0x2209b3)[_0xfed1('0x8')](function(){_0x2209b3[_0xfed1('0x9')](_0xfed1('0xa'),require(_0xfed1('0xb')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xc'),require(_0xfed1('0xd')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xe'),require('./api/voiceContext'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xf'),require('./api/voiceExtension'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x10'),require('./api/voiceMusicOnHold'));_0x2209b3[_0xfed1('0x9')]('/api/voice/queues',require(_0xfed1('0x11')));_0x2209b3[_0xfed1('0x9')]('/api/voice/recordings',require('./api/voiceRecording'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x12'),require('./api/screenRecording'));_0x2209b3[_0xfed1('0x9')]('/api/voice/mails',require('./api/voiceMail'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x13'),require('./api/voiceMailMessage'));_0x2209b3[_0xfed1('0x9')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x14'),require(_0xfed1('0x15')));_0x2209b3[_0xfed1('0x9')]('/api/voice/agents/reports',require(_0xfed1('0x16')));_0x2209b3['use'](_0xfed1('0x17'),require(_0xfed1('0x18')));_0x2209b3['use'](_0xfed1('0x19'),require(_0xfed1('0x1a')));_0x2209b3['use']('/api/trunks',require('./api/trunk'));_0x2209b3[_0xfed1('0x9')]('/api/voice/transfers/reports',require(_0xfed1('0x1b')));_0x2209b3[_0xfed1('0x9')]('/api/mail/out_servers',require(_0xfed1('0x1c')));_0x2209b3[_0xfed1('0x9')]('/api/mail/accounts',require(_0xfed1('0x1d')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x1e'),require(_0xfed1('0x1f')));_0x2209b3['use'](_0xfed1('0x20'),require('./api/mailSubstatus'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x21'),require(_0xfed1('0x22')));_0x2209b3['use'](_0xfed1('0x23'),require('./api/mailMessage'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x24'),require(_0xfed1('0x25')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x26'),require(_0xfed1('0x27')));_0x2209b3['use'](_0xfed1('0x28'),require(_0xfed1('0x29')));_0x2209b3['use'](_0xfed1('0x2a'),require(_0xfed1('0x2b')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x2c'),require(_0xfed1('0x2d')));_0x2209b3[_0xfed1('0x9')]('/api/fax/applications',require(_0xfed1('0x2e')));_0x2209b3['use'](_0xfed1('0x2f'),require('./api/faxInteraction'));_0x2209b3['use'](_0xfed1('0x30'),require(_0xfed1('0x31')));_0x2209b3[_0xfed1('0x9')]('/api/fax/queues',require(_0xfed1('0x32')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x33'),require(_0xfed1('0x34')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x35'),require('./api/smsAccount'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x36'),require('./api/smsApplication'));_0x2209b3['use'](_0xfed1('0x37'),require(_0xfed1('0x38')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x39'),require(_0xfed1('0x3a')));_0x2209b3['use'](_0xfed1('0x3b'),require(_0xfed1('0x3c')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x3d'),require(_0xfed1('0x3e')));_0x2209b3['use'](_0xfed1('0x3f'),require('./api/openchannelApplication'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x40'),require(_0xfed1('0x41')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x42'),require(_0xfed1('0x43')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x44'),require('./api/openchannelQueue'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x45'),require(_0xfed1('0x46')));_0x2209b3[_0xfed1('0x9')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x47'),require(_0xfed1('0x48')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x49'),require(_0xfed1('0x4a')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x4b'),require('./api/chatMessage'));_0x2209b3['use'](_0xfed1('0x4c'),require(_0xfed1('0x4d')));_0x2209b3['use'](_0xfed1('0x4e'),require(_0xfed1('0x4f')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x50'),require(_0xfed1('0x51')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x52'),require(_0xfed1('0x53')));_0x2209b3[_0xfed1('0x9')]('/api/cm/companies',require('./api/cmCompany'));_0x2209b3['use'](_0xfed1('0x54'),require(_0xfed1('0x55')));_0x2209b3[_0xfed1('0x9')]('/api/cm/hopper',require(_0xfed1('0x56')));_0x2209b3['use'](_0xfed1('0x57'),require(_0xfed1('0x58')));_0x2209b3[_0xfed1('0x9')]('/api/cm/hopper_final',require(_0xfed1('0x59')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x5a'),require('./api/cmHopperHistory'));_0x2209b3[_0xfed1('0x9')]('/api/cm/custom_fields',require(_0xfed1('0x5b')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x5c'),require(_0xfed1('0x5d')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x5e'),require(_0xfed1('0x5f')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x60'),require('./api/cannedAnswer'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x61'),require(_0xfed1('0x62')));_0x2209b3['use']('/api/conditions',require(_0xfed1('0x63')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x64'),require(_0xfed1('0x65')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x66'),require(_0xfed1('0x67')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x68'),require(_0xfed1('0x69')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x6a'),require('./api/voiceQueuesLog'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x6b'),require(_0xfed1('0x6c')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x6d'),require(_0xfed1('0x6e')));_0x2209b3['use'](_0xfed1('0x6f'),require(_0xfed1('0x70')));_0x2209b3[_0xfed1('0x9')]('/api/templates',require(_0xfed1('0x71')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x72'),require(_0xfed1('0x73')));_0x2209b3['use'](_0xfed1('0x74'),require(_0xfed1('0x75')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x76'),require(_0xfed1('0x77')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x78'),require(_0xfed1('0x79')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x7a'),require(_0xfed1('0x7b')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x7c'),require(_0xfed1('0x7d')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x7e'),require(_0xfed1('0x7f')));_0x2209b3[_0xfed1('0x9')]('/api/analytics/metrics',require('./api/analyticMetric'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x80'),require(_0xfed1('0x81')));_0x2209b3[_0xfed1('0x9')]('/api/analytics/tree_reports',require(_0xfed1('0x82')));_0x2209b3[_0xfed1('0x9')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x2209b3['use'](_0xfed1('0x83'),require(_0xfed1('0x84')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x85'),require(_0xfed1('0x86')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x87'),require(_0xfed1('0x88')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x89'),require('./api/intSugarcrmConfiguration'));_0x2209b3['use'](_0xfed1('0x8a'),require(_0xfed1('0x8b')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x8c'),require(_0xfed1('0x8d')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x8e'),require(_0xfed1('0x8f')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x90'),require(_0xfed1('0x91')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x92'),require(_0xfed1('0x93')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x94'),require(_0xfed1('0x95')));_0x2209b3['use']('/api/integrations/zoho/fields',require(_0xfed1('0x96')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x97'),require(_0xfed1('0x98')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x99'),require(_0xfed1('0x9a')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x9b'),require(_0xfed1('0x9c')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x9d'),require(_0xfed1('0x9e')));_0x2209b3[_0xfed1('0x9')]('/api/integrations/freshdesk/configurations',require(_0xfed1('0x9f')));_0x2209b3['use']('/api/integrations/freshdesk/fields',require(_0xfed1('0xa0')));_0x2209b3['use'](_0xfed1('0xa1'),require('./api/intVtigerAccount'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xa2'),require('./api/intVtigerConfiguration'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xa3'),require('./api/intVtigerField'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xa4'),require(_0xfed1('0xa5')));_0x2209b3[_0xfed1('0x9')]('/api/integrations/servicenow/configurations',require(_0xfed1('0xa6')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xa7'),require(_0xfed1('0xa8')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xa9'),require(_0xfed1('0xaa')));_0x2209b3[_0xfed1('0x9')]('/api/integrations/dynamics365/configurations',require(_0xfed1('0xab')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xac'),require(_0xfed1('0xad')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xae'),require('./api/intFreshsalesAccount'));_0x2209b3['use']('/api/integrations/freshsales/configurations',require(_0xfed1('0xaf')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xb0'),require(_0xfed1('0xb1')));_0x2209b3['use'](_0xfed1('0xb2'),require('./api/network'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xb3'),require(_0xfed1('0xb4')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xb5'),require('./api/chatInternalMessage'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xb6'),require(_0xfed1('0xb7')));_0x2209b3['use'](_0xfed1('0xb8'),require(_0xfed1('0xb9')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xba'),require('./api/jscriptySessionReport'));_0x2209b3[_0xfed1('0x9')]('/api/sms/reports/queue',require(_0xfed1('0xbb')));_0x2209b3[_0xfed1('0x9')]('/api/square/reports',require('./api/squareReport'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xbc'),require(_0xfed1('0xbd')));_0x2209b3[_0xfed1('0x9')]('/api/jscripty/projects',require(_0xfed1('0xbe')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xbf'),require(_0xfed1('0xc0')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xc1'),require('./api/squareOdbc'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xc2'),require('./api/squareProject'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xc3'),require(_0xfed1('0xc4')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xc5'),require(_0xfed1('0xc6')));_0x2209b3['use']('/api/teams',require(_0xfed1('0xc7')));_0x2209b3['use'](_0xfed1('0xc8'),require(_0xfed1('0xc9')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xca'),require(_0xfed1('0xcb')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xcc'),require(_0xfed1('0xcd')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xce'),require('./api/attachment'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xcf'),require('./api/plugin'));_0x2209b3['use'](_0xfed1('0xd0'),require('./api/mailTransferReport'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xd1'),require(_0xfed1('0xd2')));_0x2209b3['use'](_0xfed1('0xd3'),require(_0xfed1('0xd4')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xd5'),require(_0xfed1('0xd6')));_0x2209b3['use'](_0xfed1('0xd7'),require(_0xfed1('0xd8')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xd9'),require(_0xfed1('0xda')));_0x2209b3['use'](_0xfed1('0xdb'),require(_0xfed1('0xdc')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xdd'),require(_0xfed1('0xde')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xdf'),require(_0xfed1('0xe0')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xe1'),require('./api/userProfileResource'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xe2'),require(_0xfed1('0xe3')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xe4'),require('./api/whatsappAccount'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xe5'),require(_0xfed1('0xe6')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xe7'),require(_0xfed1('0xe8')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xe9'),require(_0xfed1('0xea')));_0x2209b3['use']('/api/whatsapp/reports/queue',require(_0xfed1('0xeb')));_0x2209b3['use'](_0xfed1('0xec'),require(_0xfed1('0xed')));_0x2209b3[_0xfed1('0x9')]('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x2209b3[_0xfed1('0x9')]('/api/cloudProviders',require(_0xfed1('0xee')));_0x2209b3['use'](_0xfed1('0xef'),require(_0xfed1('0xf0')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xf1'),require(_0xfed1('0xf2')));_0x2209b3['use'](_0xfed1('0xf3'),require(_0xfed1('0xf4')));_0x2209b3['use'](_0xfed1('0xf5'),require(_0xfed1('0xf6')));_0x2209b3['use'](_0xfed1('0xf7'),require(_0xfed1('0xf8')));_0x2209b3[_0xfed1('0x9')]('/api/jira',require(_0xfed1('0xf9')));_0x2209b3[_0xfed1('0x9')]('/api/rpc',require(_0xfed1('0xfa')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xfb'),require('./api/version'));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xfc'),require('./api/system'));_0x2209b3['use'](_0xfed1('0xfd'),require(_0xfed1('0xfe')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0xff'),require(_0xfed1('0x100')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x101'),clientSideLogs);_0x2209b3[_0xfed1('0x9')](_0xfed1('0x102'),express[_0xfed1('0x103')](path[_0xfed1('0x104')](config[_0xfed1('0x105')],'/apidoc')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x106'),express['static'](path[_0xfed1('0x104')](config[_0xfed1('0x105')],'/www')));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x107'),express[_0xfed1('0x103')](path[_0xfed1('0x104')](config['root'],_0xfed1('0x107'))));_0x2209b3[_0xfed1('0x9')](_0xfed1('0x108'),express[_0xfed1('0x103')](path[_0xfed1('0x104')](config[_0xfed1('0x105')],_0xfed1('0x109'),_0xfed1('0x10a'))));_0x2209b3['use'](_0xfed1('0x10b'),express[_0xfed1('0x103')](path[_0xfed1('0x104')](config['root'],_0xfed1('0x10c'))));_0x2209b3[_0xfed1('0x10d')](_0xfed1('0x10e'))['get'](errors[0x194]);_0x2209b3['route']('/*')[_0xfed1('0x10f')](function(_0x45a0fc,_0x37723b){_0x37723b[_0xfed1('0x110')](path[_0xfed1('0x111')](_0x2209b3[_0xfed1('0x10f')](_0xfed1('0x112'))+_0xfed1('0x113')));});return _0x2209b3;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 686430f..0934d8d 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd33=['../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.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/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc'];(function(_0x22ad4d,_0x373f4e){var _0xe03222=function(_0x42bb9e){while(--_0x42bb9e){_0x22ad4d['push'](_0x22ad4d['shift']());}};_0xe03222(++_0x373f4e);}(_0xfd33,0x185));var _0x3fd3=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xfd33[_0x1b349a];return _0x5d1f7c;};'use strict';var jayson=require(_0x3fd3('0x0'));var _=require(_0x3fd3('0x1'));var config=require('../config/environment');exports['listen']=function(){return new Promise(function(_0x2498f5,_0xfc5ff5){var _0xf957c1={};_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x3')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/voiceExtension/voiceExtension.rpc'));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x4')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x5')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x6')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x7')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x8')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x9')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/trunk/trunk.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0xa')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0xb')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0xc')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/mailInteraction/mailInteraction.rpc'));_0xf957c1=_['merge'](_0xf957c1,require('../api/mailMessage/mailMessage.rpc'));_0xf957c1=_['merge'](_0xf957c1,require('../api/mailApplication/mailApplication.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/mailQueueReport/mailQueueReport.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0xd')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/faxApplication/faxApplication.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0xe')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0xf')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/faxQueue/faxQueue.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/faxQueueReport/faxQueueReport.rpc'));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x10')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/smsInteraction/smsInteraction.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x11')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/smsQueue/smsQueue.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x12')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x13')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x14')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/openchannelQueue/openchannelQueue.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x15')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x16')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x17')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x18')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x19')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x1a')));_0xf957c1=_['merge'](_0xf957c1,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x1b')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x1c')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x1d')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x1e')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x1f')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x20')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x21')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x22')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x23')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x24')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x25')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x26')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x27')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x28')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x29')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x2a')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x2b')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x2c')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x2d')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x2e')));_0xf957c1=_['merge'](_0xf957c1,require('../api/squareReportDetail/squareReportDetail.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x2f')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x30')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x31')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require('../api/squareRecording/squareRecording.rpc'));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x32')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x33')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x34')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x35')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x36')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x37')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x38')));_0xf957c1=_[_0x3fd3('0x2')](_0xf957c1,require(_0x3fd3('0x39')));_0xf957c1=_['merge'](_0xf957c1,require(_0x3fd3('0x3a')));var _0x1e7169=jayson[_0x3fd3('0x3b')](_0xf957c1)['http']();var _0x462ba6=config[_0x3fd3('0x3c')]['port']||config['port']+0x1;var _0x524e29=config['rpc']['ip']||'localhost';_0x1e7169['on'](_0x3fd3('0x3d'),function(_0x4a4e72){return _0xfc5ff5(_0x4a4e72);});_0x1e7169['listen'](_0x462ba6,_0x524e29,function(){console[_0x3fd3('0x3e')](_0x3fd3('0x3f'),_0x524e29,_0x462ba6);require(_0x3fd3('0x40'))['default']();return _0x2498f5(_0x3fd3('0x41')+_0x524e29+':'+_0x462ba6);});});}; \ No newline at end of file +var _0xf997=['../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/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/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.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/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','port','localhost','error','listen','log','../config/triggers','default','jayson/promise','lodash','../config/environment','../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc'];(function(_0x320043,_0x14c0ff){var _0x559fee=function(_0x2a1189){while(--_0x2a1189){_0x320043['push'](_0x320043['shift']());}};_0x559fee(++_0x14c0ff);}(_0xf997,0xc8));var _0x7f99=function(_0x237553,_0x51d8d8){_0x237553=_0x237553-0x0;var _0x2580e2=_0xf997[_0x237553];return _0x2580e2;};'use strict';var jayson=require(_0x7f99('0x0'));var _=require(_0x7f99('0x1'));var config=require(_0x7f99('0x2'));exports['listen']=function(){return new Promise(function(_0x33b07b,_0x366028){var _0x2a06b7={};_0x2a06b7=_['merge'](_0x2a06b7,require(_0x7f99('0x3')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/voiceExtension/voiceExtension.rpc'));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x5')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/voiceRecording/voiceRecording.rpc'));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x6')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x7')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x8')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x9')));_0x2a06b7=_['merge'](_0x2a06b7,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0xa')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0xb')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0xc')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/mailQueue/mailQueue.rpc'));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0xd')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0xe')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/mailApplication/mailApplication.rpc'));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0xf')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x10')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x11')));_0x2a06b7=_['merge'](_0x2a06b7,require(_0x7f99('0x12')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x13')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x14')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x15')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x16')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x17')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x18')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x19')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x1a')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x1b')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x1c')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x1d')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/chatMessage/chatMessage.rpc'));_0x2a06b7=_['merge'](_0x2a06b7,require(_0x7f99('0x1e')));_0x2a06b7=_['merge'](_0x2a06b7,require(_0x7f99('0x1f')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x20')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x21')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x22')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x23')));_0x2a06b7=_['merge'](_0x2a06b7,require(_0x7f99('0x24')));_0x2a06b7=_['merge'](_0x2a06b7,require(_0x7f99('0x25')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x26')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x27')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x28')));_0x2a06b7=_['merge'](_0x2a06b7,require(_0x7f99('0x29')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x2a')));_0x2a06b7=_['merge'](_0x2a06b7,require(_0x7f99('0x2b')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x2c')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x2d')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x2e')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x2f')));_0x2a06b7=_['merge'](_0x2a06b7,require(_0x7f99('0x30')));_0x2a06b7=_['merge'](_0x2a06b7,require(_0x7f99('0x31')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x32')));_0x2a06b7=_['merge'](_0x2a06b7,require(_0x7f99('0x33')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x34')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x35')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x36')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x37')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x38')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x39')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/campaign/campaign.rpc'));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x3a')));_0x2a06b7=_['merge'](_0x2a06b7,require(_0x7f99('0x3b')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x2a06b7=_['merge'](_0x2a06b7,require(_0x7f99('0x3c')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x3d')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require(_0x7f99('0x3e')));_0x2a06b7=_[_0x7f99('0x4')](_0x2a06b7,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x27055d=jayson[_0x7f99('0x3f')](_0x2a06b7)['http']();var _0x524743=config['rpc'][_0x7f99('0x40')]||config['port']+0x1;var _0x352c04=config['rpc']['ip']||_0x7f99('0x41');_0x27055d['on'](_0x7f99('0x42'),function(_0x4f6c3e){return _0x366028(_0x4f6c3e);});_0x27055d[_0x7f99('0x43')](_0x524743,_0x352c04,function(){console[_0x7f99('0x44')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x352c04,_0x524743);require(_0x7f99('0x45'))[_0x7f99('0x46')]();return _0x33b07b('RPC\x20listening\x20on\x20'+_0x352c04+':'+_0x524743);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 6b4c902..e3bfc80 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 _0x49e5=['sync','prototype','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','label','util','lodash','events','EventEmitter','./reply','setEncoding','utf8','headers','ready','line','toLowerCase','hangup','emit','substring','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','startsWith','split','length','match','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sendRequest'];(function(_0x52a8c3,_0x36048e){var _0x2bad08=function(_0x346610){while(--_0x346610){_0x52a8c3['push'](_0x52a8c3['shift']());}};_0x2bad08(++_0x36048e);}(_0x49e5,0x71));var _0x549e=function(_0x34729c,_0x2b2c09){_0x34729c=_0x34729c-0x0;var _0x34814d=_0x49e5[_0x34729c];return _0x34814d;};'use strict';var util=require(_0x549e('0x0'));var _=require(_0x549e('0x1'));var EventEmitter=require(_0x549e('0x2'))[_0x549e('0x3')];var AGIReply=require(_0x549e('0x4'));var AGIError=require('./error');function AGIChannel(_0x34b3fb){var _0x1d067b=this,_0x27468e=new AGIReply(),_0x3fb4a3=![],_0x26f864={};EventEmitter['call'](_0x1d067b);_0x34b3fb[_0x549e('0x5')]('utf8');_0x34b3fb['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x27468e[_0x549e('0x5')](_0x549e('0x6'));_0x27468e['on'](_0x549e('0x7'),function(_0x5e3c38){for(var _0x555864 in _0x5e3c38){_0x1d067b[_0x555864]=_0x5e3c38[_0x555864];}_0x1d067b['emit'](_0x549e('0x8'));});_0x27468e['on'](_0x549e('0x9'),function(_0x254556){if(_0x254556[_0x549e('0xa')]()==_0x549e('0xb')){_0x1d067b[_0x549e('0xc')]('hangup');return;}if(_0x254556[_0x549e('0xd')](0x0,0xb)=='520-Invalid'){_0x3fb4a3=!![];}if(_0x3fb4a3){_0x26f864['rx']+=_0x254556+'\x0a';if(_0x254556[_0x549e('0xe')](_0x549e('0xf'))!=-0x1){_0x3fb4a3=![];}}else{_0x26f864['rx']=_0x254556;}if(_0x3fb4a3){return;}if(typeof _0x26f864['cb']==_0x549e('0x10')){var _0x4c2f34=_0x26f864['rx'][_0x549e('0xd')](0x0,0x3),_0x3168da=null,_0x46e8f9=null;_0x4c2f34=parseInt(_0x4c2f34);if(isNaN(_0x4c2f34)){_0x26f864['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x4c2f34!=0xc8){_0x26f864['cb'](null,{'code':_0x4c2f34,'result':-0x1,'extra':'KO'});return;}_0x3168da=_0x26f864['rx'][_0x549e('0xd')](0x4)[_0x549e('0x11')](_0x549e('0x12'),'');if(_0x3168da[_0x549e('0x13')]('\x20')!=-0x1){_0x3168da=_0x3168da[_0x549e('0x14')](0x0,_0x3168da[_0x549e('0x13')]('\x20'));}if(_[_0x549e('0x15')](_0x3168da,'-1')){_0x3168da=parseInt(_0x3168da);}_0x46e8f9=_0x26f864['rx'][_0x549e('0x16')]('\x20');if(_0x46e8f9[_0x549e('0x17')]==0x3){_0x46e8f9=_0x46e8f9[0x2][_0x549e('0xd')](0x1,_0x46e8f9[0x2][_0x549e('0x17')]-0x1);}else if(_0x46e8f9[_0x549e('0x17')]>0x3){var _0x402c51=/\((.+)\)/;var _0x1c5877=_0x26f864['rx'][_0x549e('0x18')](_0x402c51);if(_0x1c5877){_0x46e8f9=_0x1c5877[0x1];}else{_0x46e8f9=null;}}else{_0x46e8f9=null;}_0x26f864['cb'](null,{'code':_0x4c2f34,'result':_0x3168da,'extra':_0x46e8f9});}});_0x34b3fb['on']('error',function(_0x294cb3){_0x1d067b[_0x549e('0xc')]('error',new AGIError(_0x549e('0x19'),_0x294cb3[_0x549e('0x1a')]));});_0x34b3fb['on'](_0x549e('0x1b'),function(){_0x1d067b[_0x549e('0xc')](_0x549e('0x1b'),new AGIError(_0x549e('0x1c')));});_0x34b3fb['on'](_0x549e('0x1d'),function(){_0x1d067b[_0x549e('0xc')](_0x549e('0x1d'),new AGIError(_0x549e('0x1e')));_0x34b3fb[_0x549e('0x1f')]();});_0x34b3fb[_0x549e('0x20')](_0x27468e);this[_0x549e('0x21')]=function(_0x58106b,_0x4cf942){var _0x58106b=_0x58106b||'',_0x4cf942=typeof _0x4cf942==_0x549e('0x10')?_0x4cf942:new Function();_0x26f864={'tx':_0x58106b,'rx':'','cb':_0x4cf942};_0x34b3fb[_0x549e('0x22')](_0x58106b+'\x0a');},this['close']=function(){_0x34b3fb['destroy']();};}util[_0x549e('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x549e('0x24')]=function(_0x3f06e2){return this[_0x549e('0x21')][_0x549e('0x25')](this,_0x3f06e2);};AGIChannel[_0x549e('0x26')]['answer']=function(){return this['sendRequest'](_0x549e('0x27'));};AGIChannel[_0x549e('0x26')][_0x549e('0x28')]=function(_0x425f53,_0x57f5cd,_0x4d54a3){_0x425f53=_0x425f53===undefined?_0x549e('0x29'):_0x425f53;_0x57f5cd=_0x57f5cd===undefined?'5':_0x57f5cd;_0x4d54a3=_0x4d54a3===undefined?'1':_0x4d54a3;return this[_0x549e('0x24')](util[_0x549e('0x2a')](_0x549e('0x2b'),_0x425f53,_0x57f5cd*0x3e8,_0x4d54a3));};AGIChannel[_0x549e('0x26')]['noop']=function(_0x15cc9f){_0x15cc9f=_0x15cc9f||_0x549e('0x2c');return this[_0x549e('0x24')](util['format']('VERBOSE\x20\x22%s\x22',_0x15cc9f));};AGIChannel[_0x549e('0x26')][_0x549e('0x2d')]=function(_0x187f22,_0x312836){if(_[_0x549e('0x2e')](_0x312836)){return this[_0x549e('0x24')](util[_0x549e('0x2a')](_0x549e('0x2f'),_0x187f22,_0x312836[_0x549e('0x30')](',')));}return this[_0x549e('0x24')](util['format'](_0x549e('0x2f'),_0x187f22,_0x312836));};AGIChannel[_0x549e('0x26')][_0x549e('0x31')]=function(_0x163a6b){return this[_0x549e('0x24')](util[_0x549e('0x2a')]('SET\x20CONTEXT\x20%s',_0x163a6b));};AGIChannel[_0x549e('0x26')]['setExtension']=function(_0x53ee95){return this[_0x549e('0x24')](util[_0x549e('0x2a')](_0x549e('0x32'),_0x53ee95));};AGIChannel['prototype'][_0x549e('0x33')]=function(_0x6435d7){return this[_0x549e('0x24')](util[_0x549e('0x2a')](_0x549e('0x34'),_0x6435d7));};AGIChannel['prototype'][_0x549e('0xb')]=function(){return this[_0x549e('0x24')](_0x549e('0x35'));};AGIChannel[_0x549e('0x26')]['setVariable']=function(_0x26de43,_0x141391){var _0x51b9ff=_[_0x549e('0x36')](_0x141391)||_[_0x549e('0x37')](_0x141391)?_0x141391[_0x549e('0x38')]():_0x141391;return this[_0x549e('0x24')](util[_0x549e('0x2a')](_0x549e('0x39'),_0x26de43,_0x51b9ff?_0x51b9ff[_0x549e('0x38')]()[_0x549e('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x549e('0x3a')]=function(_0x19bfb9,_0x1de081){return this['sendRequest'](util[_0x549e('0x2a')](_0x549e('0x3b'),_0x19bfb9,_0x1de081));};AGIChannel[_0x549e('0x26')]['sayDigits']=function(_0x3b2037,_0x5c20c6){return this[_0x549e('0x24')](util[_0x549e('0x2a')](_0x549e('0x3c'),_0x3b2037,_0x5c20c6));};AGIChannel[_0x549e('0x26')][_0x549e('0x3d')]=function(_0xa4be34,_0x557c95){return this[_0x549e('0x24')](util[_0x549e('0x2a')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0xa4be34,_0x557c95));};AGIChannel[_0x549e('0x26')]['continueAt']=function(_0x137cc1,_0x5ac7a0,_0x3301f8){_0x5ac7a0=_0x5ac7a0||this['extension'];_0x3301f8=_0x3301f8||0x1;this['setContext'](_0x137cc1);this['setExtension'](_0x5ac7a0);this[_0x549e('0x33')](_0x3301f8);return this[_0x549e('0x3e')](util['format'](_0x549e('0x3f'),_0x137cc1,_0x5ac7a0,_0x3301f8));};AGIChannel[_0x549e('0x26')][_0x549e('0x40')]=function(_0x49ddb0){return this['sendRequest'](util[_0x549e('0x2a')](_0x549e('0x41'),_0x49ddb0));};AGIChannel[_0x549e('0x26')][_0x549e('0x42')]=function(_0x229377,_0x55bd5e,_0x3ca28c,_0x56f7e5,_0x24a044,_0x21b5b3){_0x55bd5e=_0x55bd5e||_0x549e('0x43');_0x3ca28c=_0x3ca28c||'';_0x56f7e5=_0x56f7e5===undefined?-0x1:_0x56f7e5==='-1'?-0x1:_0x56f7e5*0x3e8;_0x24a044=_0x24a044===undefined?'':'s='+_0x24a044;_0x21b5b3=_0x21b5b3?_0x549e('0x44'):'';return this['sendRequest'](util[_0x549e('0x2a')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x229377,_0x55bd5e,_0x3ca28c,_0x56f7e5,_0x21b5b3,_0x24a044));};AGIChannel[_0x549e('0x26')][_0x549e('0x45')]=function(_0x26c512,_0x446e14){_0x446e14=_0x446e14||'';return this[_0x549e('0x24')](util[_0x549e('0x2a')](_0x549e('0x46'),_0x26c512,_0x446e14));};AGIChannel[_0x549e('0x26')]['agi']=function(_0x9b64ef){return this[_0x549e('0x2d')](_0x549e('0x47'),_0x9b64ef);};AGIChannel[_0x549e('0x26')][_0x549e('0x48')]=function(_0x330dc0){return this[_0x549e('0x2d')](_0x549e('0x49'),_0x330dc0);};AGIChannel[_0x549e('0x26')]['error']=function(_0x29a873,_0x293ef8){this[_0x549e('0x3e')](util[_0x549e('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x29a873['id'],_0x29a873[_0x549e('0x4a')],_0x293ef8));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x4ca6=['error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sync','answer','ANSWER','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','sendRequest','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','setEncoding','setTimeout','utf8','emit','ready','line','toLowerCase','hangup','520-Invalid','search','function','substring','no\x20code','replace','indexOf','startsWith','split','length','match'];(function(_0x42cc6e,_0x85b033){var _0x4f423c=function(_0xd39e93){while(--_0xd39e93){_0x42cc6e['push'](_0x42cc6e['shift']());}};_0x4f423c(++_0x85b033);}(_0x4ca6,0x1a9));var _0x64ca=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0x4ca6[_0x2eb5bc];return _0x51c7b1;};'use strict';var util=require(_0x64ca('0x0'));var _=require(_0x64ca('0x1'));var EventEmitter=require(_0x64ca('0x2'))[_0x64ca('0x3')];var AGIReply=require(_0x64ca('0x4'));var AGIError=require(_0x64ca('0x5'));function AGIChannel(_0x49e6c6){var _0x15b3f9=this,_0x577afc=new AGIReply(),_0x29d468=![],_0x2714f1={};EventEmitter['call'](_0x15b3f9);_0x49e6c6[_0x64ca('0x6')]('utf8');_0x49e6c6[_0x64ca('0x7')](0x8*0x3c*0x3c*0x3e8);_0x577afc['setEncoding'](_0x64ca('0x8'));_0x577afc['on']('headers',function(_0x596fc0){for(var _0x3ade8f in _0x596fc0){_0x15b3f9[_0x3ade8f]=_0x596fc0[_0x3ade8f];}_0x15b3f9[_0x64ca('0x9')](_0x64ca('0xa'));});_0x577afc['on'](_0x64ca('0xb'),function(_0x432ddf){if(_0x432ddf[_0x64ca('0xc')]()=='hangup'){_0x15b3f9['emit'](_0x64ca('0xd'));return;}if(_0x432ddf['substring'](0x0,0xb)==_0x64ca('0xe')){_0x29d468=!![];}if(_0x29d468){_0x2714f1['rx']+=_0x432ddf+'\x0a';if(_0x432ddf[_0x64ca('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x29d468=![];}}else{_0x2714f1['rx']=_0x432ddf;}if(_0x29d468){return;}if(typeof _0x2714f1['cb']==_0x64ca('0x10')){var _0x1fab09=_0x2714f1['rx'][_0x64ca('0x11')](0x0,0x3),_0x43b31e=null,_0x503ab7=null;_0x1fab09=parseInt(_0x1fab09);if(isNaN(_0x1fab09)){_0x2714f1['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x64ca('0x12')});return;}if(_0x1fab09!=0xc8){_0x2714f1['cb'](null,{'code':_0x1fab09,'result':-0x1,'extra':'KO'});return;}_0x43b31e=_0x2714f1['rx'][_0x64ca('0x11')](0x4)[_0x64ca('0x13')]('result=','');if(_0x43b31e[_0x64ca('0x14')]('\x20')!=-0x1){_0x43b31e=_0x43b31e['substr'](0x0,_0x43b31e[_0x64ca('0x14')]('\x20'));}if(_[_0x64ca('0x15')](_0x43b31e,'-1')){_0x43b31e=parseInt(_0x43b31e);}_0x503ab7=_0x2714f1['rx'][_0x64ca('0x16')]('\x20');if(_0x503ab7[_0x64ca('0x17')]==0x3){_0x503ab7=_0x503ab7[0x2][_0x64ca('0x11')](0x1,_0x503ab7[0x2]['length']-0x1);}else if(_0x503ab7[_0x64ca('0x17')]>0x3){var _0x163bb2=/\((.+)\)/;var _0x1c27e5=_0x2714f1['rx'][_0x64ca('0x18')](_0x163bb2);if(_0x1c27e5){_0x503ab7=_0x1c27e5[0x1];}else{_0x503ab7=null;}}else{_0x503ab7=null;}_0x2714f1['cb'](null,{'code':_0x1fab09,'result':_0x43b31e,'extra':_0x503ab7});}});_0x49e6c6['on'](_0x64ca('0x19'),function(_0x2b5da3){_0x15b3f9['emit'](_0x64ca('0x19'),new AGIError(_0x64ca('0x1a'),_0x2b5da3['code']));});_0x49e6c6['on'](_0x64ca('0x1b'),function(){_0x15b3f9['emit'](_0x64ca('0x1b'),new AGIError(_0x64ca('0x1c')));});_0x49e6c6['on'](_0x64ca('0x1d'),function(){_0x15b3f9[_0x64ca('0x9')](_0x64ca('0x1d'),new AGIError(_0x64ca('0x1e')));_0x49e6c6[_0x64ca('0x1f')]();});_0x49e6c6[_0x64ca('0x20')](_0x577afc);this[_0x64ca('0x21')]=function(_0x4d5d87,_0x1f8c84){var _0x4d5d87=_0x4d5d87||'',_0x1f8c84=typeof _0x1f8c84==_0x64ca('0x10')?_0x1f8c84:new Function();_0x2714f1={'tx':_0x4d5d87,'rx':'','cb':_0x1f8c84};_0x49e6c6[_0x64ca('0x22')](_0x4d5d87+'\x0a');},this[_0x64ca('0x1b')]=function(){_0x49e6c6[_0x64ca('0x1f')]();};}util[_0x64ca('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x64ca('0x24')]['sendRequest']=function(_0x1db1cf){return this[_0x64ca('0x21')][_0x64ca('0x25')](this,_0x1db1cf);};AGIChannel['prototype'][_0x64ca('0x26')]=function(){return this['sendRequest'](_0x64ca('0x27'));};AGIChannel['prototype']['getData']=function(_0x34b82d,_0x4bb4f3,_0xc94f93){_0x34b82d=_0x34b82d===undefined?'beep':_0x34b82d;_0x4bb4f3=_0x4bb4f3===undefined?'5':_0x4bb4f3;_0xc94f93=_0xc94f93===undefined?'1':_0xc94f93;return this['sendRequest'](util[_0x64ca('0x28')](_0x64ca('0x29'),_0x34b82d,_0x4bb4f3*0x3e8,_0xc94f93));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x2a')]=function(_0x360b06){_0x360b06=_0x360b06||_0x64ca('0x2b');return this[_0x64ca('0x2c')](util[_0x64ca('0x28')]('VERBOSE\x20\x22%s\x22',_0x360b06));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x2d')]=function(_0x2af41a,_0x57e82c){if(_[_0x64ca('0x2e')](_0x57e82c)){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x2f'),_0x2af41a,_0x57e82c[_0x64ca('0x30')](',')));}return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x2f'),_0x2af41a,_0x57e82c));};AGIChannel['prototype'][_0x64ca('0x31')]=function(_0x530a53){return this['sendRequest'](util['format'](_0x64ca('0x32'),_0x530a53));};AGIChannel['prototype'][_0x64ca('0x33')]=function(_0x17e31b){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x34'),_0x17e31b));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x35')]=function(_0x20d7e0){return this[_0x64ca('0x2c')](util['format'](_0x64ca('0x36'),_0x20d7e0));};AGIChannel[_0x64ca('0x24')][_0x64ca('0xd')]=function(){return this['sendRequest'](_0x64ca('0x37'));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x38')]=function(_0x37801a,_0x482959){var _0x4ec7b2=_[_0x64ca('0x39')](_0x482959)||_['isNumber'](_0x482959)?_0x482959['toString']():_0x482959;return this['sendRequest'](util[_0x64ca('0x28')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x37801a,_0x4ec7b2?_0x4ec7b2[_0x64ca('0x3a')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x64ca('0x24')]['sayNumber']=function(_0x43ae23,_0x4a6187){return this['sendRequest'](util[_0x64ca('0x28')](_0x64ca('0x3b'),_0x43ae23,_0x4a6187));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x3c')]=function(_0x38b22f,_0x6f8879){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x3d'),_0x38b22f,_0x6f8879));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x3e')]=function(_0x188d4a,_0x31a53b){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x3f'),_0x188d4a,_0x31a53b));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x40')]=function(_0x4c5949,_0x39b251,_0x5c1a43){_0x39b251=_0x39b251||this['extension'];_0x5c1a43=_0x5c1a43||0x1;this[_0x64ca('0x31')](_0x4c5949);this[_0x64ca('0x33')](_0x39b251);this[_0x64ca('0x35')](_0x5c1a43);return this[_0x64ca('0x2a')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x4c5949,_0x39b251,_0x5c1a43));};AGIChannel['prototype'][_0x64ca('0x41')]=function(_0x445334){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x42'),_0x445334));};AGIChannel[_0x64ca('0x24')]['recordFile']=function(_0x2512a5,_0x15937a,_0x32b879,_0xdb99b9,_0x85c515,_0x4b74f2){_0x15937a=_0x15937a||_0x64ca('0x43');_0x32b879=_0x32b879||'';_0xdb99b9=_0xdb99b9===undefined?-0x1:_0xdb99b9==='-1'?-0x1:_0xdb99b9*0x3e8;_0x85c515=_0x85c515===undefined?'':'s='+_0x85c515;_0x4b74f2=_0x4b74f2?_0x64ca('0x44'):'';return this[_0x64ca('0x2c')](util['format'](_0x64ca('0x45'),_0x2512a5,_0x15937a,_0x32b879,_0xdb99b9,_0x4b74f2,_0x85c515));};AGIChannel[_0x64ca('0x24')]['streamFile']=function(_0x46cd81,_0x146fd0){_0x146fd0=_0x146fd0||'';return this[_0x64ca('0x2c')](util[_0x64ca('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x46cd81,_0x146fd0));};AGIChannel[_0x64ca('0x24')]['agi']=function(_0x346455){return this[_0x64ca('0x2d')]('AGI',_0x346455);};AGIChannel[_0x64ca('0x24')][_0x64ca('0x46')]=function(_0x20a9a1){return this['exec'](_0x64ca('0x47'),_0x20a9a1);};AGIChannel[_0x64ca('0x24')][_0x64ca('0x19')]=function(_0x4677e3,_0x578828){this['noop'](util[_0x64ca('0x28')](_0x64ca('0x48'),_0x4677e3['id'],_0x4677e3[_0x64ca('0x49')],_0x578828));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x64ca('0x4a')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 59142b5..172eb2c 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 _0x3da4=['format','apply','message','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.','push'];(function(_0x2341ed,_0x472515){var _0x283cd3=function(_0x1afcec){while(--_0x1afcec){_0x2341ed['push'](_0x2341ed['shift']());}};_0x283cd3(++_0x472515);}(_0x3da4,0x162));var _0x43da=function(_0x35eda6,_0x1c838b){_0x35eda6=_0x35eda6-0x0;var _0x45dde3=_0x3da4[_0x35eda6];return _0x45dde3;};'use strict';var util=require(_0x43da('0x0'));var error={'E_AGI_UNDEFINED':_0x43da('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x43da('0x2'),'E_AGI_SERVER_CLOSE':_0x43da('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x43da('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x43da('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x43da('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x43da('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x43da('0x8')};function AGIError(_0x412847){var _0x412847=_0x412847||null,_0x1a0de0=_0x1a0de0||[],_0xcb715=0x1,_0x130372='';if(!error[_0x412847]){_0x412847='E_AGI_UNDEFINED';}_0x1a0de0[_0x43da('0x9')](error[_0x412847]);while(arguments[_0xcb715]){_0x1a0de0['push'](arguments[_0xcb715]);_0xcb715++;}_0x130372=util[_0x43da('0xa')][_0x43da('0xb')](util,_0x1a0de0);this[_0x43da('0xc')]=_0x130372;this['name']=_0x412847;}module[_0x43da('0xd')]=AGIError; \ No newline at end of file +var _0x68cf=['message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format'];(function(_0x3d2d6f,_0x368872){var _0x5c0022=function(_0x408819){while(--_0x408819){_0x3d2d6f['push'](_0x3d2d6f['shift']());}};_0x5c0022(++_0x368872);}(_0x68cf,0x179));var _0xf68c=function(_0x283771,_0x575d35){_0x283771=_0x283771-0x0;var _0x2e60d3=_0x68cf[_0x283771];return _0x2e60d3;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xf68c('0x0'),'E_AGI_ARGUMENT_PORT':_0xf68c('0x1'),'E_AGI_SERVER_ERROR':_0xf68c('0x2'),'E_AGI_SERVER_CLOSE':_0xf68c('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xf68c('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xf68c('0x5'),'E_AGI_SOCKET_ERROR':_0xf68c('0x6'),'E_AGI_SOCKET_CLOSE':_0xf68c('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xf68c('0x8'),'E_AGI_COMMAND_EMPTY':_0xf68c('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xf68c('0xa')};function AGIError(_0x139063){var _0x139063=_0x139063||null,_0x11196a=_0x11196a||[],_0x5e07ff=0x1,_0x4dbc05='';if(!error[_0x139063]){_0x139063=_0xf68c('0xb');}_0x11196a[_0xf68c('0xc')](error[_0x139063]);while(arguments[_0x5e07ff]){_0x11196a[_0xf68c('0xc')](arguments[_0x5e07ff]);_0x5e07ff++;}_0x4dbc05=util[_0xf68c('0xd')]['apply'](util,_0x11196a);this[_0xf68c('0xe')]=_0x4dbc05;this[_0xf68c('0xf')]=_0x139063;}module[_0xf68c('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index d2a206a..fa07ebd 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 _0x98f5=['split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','prototype','addEdge','push','numberOfEdges','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition'];(function(_0xdb31af,_0x3bba93){var _0x32e7e9=function(_0x5aa270){while(--_0x5aa270){_0xdb31af['push'](_0xdb31af['shift']());}};_0x32e7e9(++_0x3bba93);}(_0x98f5,0x1ad));var _0x598f=function(_0x50ba63,_0x3225bf){_0x50ba63=_0x50ba63-0x0;var _0x93647a=_0x98f5[_0x50ba63];return _0x93647a;};'use strict';var _=require(_0x598f('0x0'));var logger=require(_0x598f('0x1'))(_0x598f('0x2'));var verticesWithRetry=[_0x598f('0x3'),_0x598f('0x4'),_0x598f('0x5')];var Graph=function(){this[_0x598f('0x6')]={};this[_0x598f('0x7')]={};this['numberOfEdges']=0x0;};Graph['prototype']['addVertex']=function(_0x3a47ef){this[_0x598f('0x6')][_0x3a47ef['id']]=_0x3a47ef;this[_0x598f('0x7')][_0x3a47ef['id']]=[];};Graph[_0x598f('0x8')][_0x598f('0x9')]=function(_0x29cf02,_0x1cbdab,_0x4d2fb8){this[_0x598f('0x7')][_0x29cf02][_0x598f('0xa')]({'target':_0x1cbdab,'condition':_0x4d2fb8});this[_0x598f('0xb')]+=0x1;};Graph[_0x598f('0x8')][_0x598f('0xc')]=function(){return _[_0x598f('0xc')](this[_0x598f('0x6')]);};Graph[_0x598f('0x8')][_0x598f('0xd')]=function(){return this['numberOfEdges'];};Graph['prototype'][_0x598f('0xe')]=function(_0x2e687b){return this[_0x598f('0x6')][_0x2e687b];};Graph['prototype'][_0x598f('0xf')]=function(_0x568b38,_0x3319c2){if(!this[_0x598f('0x6')][_0x568b38]){return logger[_0x598f('0x10')](_0x598f('0x11'));}var _0x1b73d0=_0x3319c2(this[_0x598f('0x6')][_0x568b38]);if(!_0x1b73d0){return logger[_0x598f('0x10')]('stop\x20traverse');}if(this[_0x598f('0x7')][_0x568b38][_0x598f('0x12')]===0x0){return logger['info'](_0x598f('0x13'));}for(var _0x2c1cdf=0x0,_0xc7df7f=[],_0x3d07f6=![];_0x2c1cdf\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toString','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','listening','connection','xml2json','syncho','util','../../config/environment','../../config/logger','../../config/license/util','./rpc','./graph','./vertices','defaults','agi','127.0.0.1','nextTick','error','stack','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','length','source','target','addEdge','value','getSquareProject','then','catch','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','callerid','timeout','hangup','sync','production','start','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','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS'];(function(_0x4e1e58,_0x599e1d){var _0x80d3c6=function(_0x485f16){while(--_0x485f16){_0x4e1e58['push'](_0x4e1e58['shift']());}};_0x80d3c6(++_0x599e1d);}(_0x4694,0x183));var _0x4469=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0x4694[_0x35a274];return _0x40d905;};'use strict';var parser=require(_0x4469('0x0'));var _=require('lodash');var syncho=require(_0x4469('0x1'));var util=require(_0x4469('0x2'));var moment=require('moment');var config=require(_0x4469('0x3'));var logger=require(_0x4469('0x4'))('agi');var utilLicense=require(_0x4469('0x5'));var rpc=require(_0x4469('0x6'));var mailRpc=require('./mailRpc');var Graph=require(_0x4469('0x7'));var Vertices=require(_0x4469('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x4469('0x9')](config[_0x4469('0xa')],{'ip':_0x4469('0xb'),'port':0x11dd});function connectionHandler(_0x4b45d3){process[_0x4469('0xc')](function(){syncho(function(){try{setChannelVariables(_0x4b45d3);agiHandler(_0x4b45d3);}catch(_0x38fde3){logger[_0x4469('0xd')](_0x38fde3[_0x4469('0xe')]);}});});}function listeningHandler(){console[_0x4469('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0x4469('0x10')]);logger[_0x4469('0x11')](util[_0x4469('0x12')](_0x4469('0x13'),config[_0x4469('0xa')]['ip'],config[_0x4469('0xa')][_0x4469('0x10')]));}function errorHandler(_0x2cd8a4){if(_0x2cd8a4&&_0x2cd8a4['name']&&_0x2cd8a4[_0x4469('0x14')]){logger['error'](util[_0x4469('0x12')](_0x4469('0x15'),_0x2cd8a4['name'],_0x2cd8a4[_0x4469('0x14')]));}else{logger[_0x4469('0xd')](util[_0x4469('0x12')](_0x4469('0x16'),_0x2cd8a4['stack']));}}function closeHandler(){logger[_0x4469('0x11')](util['format'](_0x4469('0x17'),this['arg_1'],this[_0x4469('0x18')],this['callerid'],this['dnid'],this[_0x4469('0x19')]));try{createSquareReport(this);}catch(_0x2f8d5b){logger['error'](_0x2f8d5b[_0x4469('0xe')]);}}function timeoutHandler(){logger[_0x4469('0x11')](util[_0x4469('0x12')](_0x4469('0x1a'),this[_0x4469('0x1b')],this[_0x4469('0x18')],this['callerid'],this[_0x4469('0x1c')],this['uniqueid']));}function hangupHandler(){logger[_0x4469('0x11')](util[_0x4469('0x12')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x4469('0x1b')],this[_0x4469('0x18')],this['callerid'],this[_0x4469('0x1c')],this[_0x4469('0x19')]));this[_0x4469('0x1d')]=!![];}function getRoot(_0x562d3c){return parser[_0x4469('0x1e')](_0x562d3c,{'object':!![]})[_0x4469('0x1f')][_0x4469('0x20')];}function addVertex(_0x518143,_0x5b6288,_0x476e88){_0x5b6288[_0x4469('0x21')]=_0x476e88;if(_0x5b6288[_0x4469('0x22')]('retry')){_0x5b6288['maxRetry']=parseInt(_0x5b6288[_0x4469('0x23')],0xa);}_0x518143[_0x4469('0x24')](_[_0x4469('0x25')](_0x5b6288,_0x4469('0x26')));}function initGraph(_0x183a61,_0x5d8e3d){var _0x7c08cd=new Graph();for(var _0x48f60b in _0x183a61){if(_0x183a61[_0x4469('0x22')](_0x48f60b)){if(_['isArray'](_0x183a61[_0x48f60b])){for(var _0x91ecbc=0x0;_0x91ecbc<_0x183a61[_0x48f60b][_0x4469('0x27')];_0x91ecbc+=0x1){addVertex(_0x7c08cd,_0x183a61[_0x48f60b][_0x91ecbc],_0x48f60b);}}else{addVertex(_0x7c08cd,_0x183a61[_0x48f60b],_0x48f60b);}}}for(var _0x554e06=0x0;_0x554e06<_0x5d8e3d[_0x4469('0x27')];_0x554e06+=0x1){if(_0x5d8e3d[_0x554e06][_0x4469('0x28')]&&_0x5d8e3d[_0x554e06][_0x4469('0x29')]){_0x7c08cd[_0x4469('0x2a')](_0x5d8e3d[_0x554e06]['source'],_0x5d8e3d[_0x554e06][_0x4469('0x29')],_0x5d8e3d[_0x554e06][_0x4469('0x2b')]);}}return _0x7c08cd;}function getSquareProject(_0x2f6c6c,_0x2ff608){rpc[_0x4469('0x2c')](_0x2f6c6c)[_0x4469('0x2d')](function(_0x209a91){_0x2ff608(null,_0x209a91);})[_0x4469('0x2e')](function(_0x4a7e76){_0x2ff608(null,_0x4a7e76);});}function createSquareReport(_0x381d12,_0x5f2e01){rpc['createSquareReport'](_0x381d12)['then'](function(_0x1e858a){if(_0x5f2e01){_0x5f2e01(null,_0x1e858a);}})[_0x4469('0x2e')](function(_0x3dd1f3){if(_0x5f2e01){_0x5f2e01(null,_0x3dd1f3);}});}function setChannelVariables(_0x28c233){for(var _0x164a1c in _0x28c233){if(_0x28c233[_0x4469('0x22')](_0x164a1c)){if(_0x164a1c[_0x4469('0x2f')](_0x4469('0x30'))===0x0){_0x28c233[_0x164a1c['substring'](0x4)]=_0x28c233[_0x164a1c];delete _0x28c233[_0x164a1c];}}}}function getLogFromObject(_0x3b0f5f){return util[_0x4469('0x31')](_0x3b0f5f,{'showHidden':![],'depth':null});}function agiHandler(_0x2f88d9){var _0x51a856,_0x5dacb8,_0xa480a5,_0xfc6055,_0x502086;logger[_0x4469('0x32')](_0x4469('0x33'),JSON[_0x4469('0x34')](_0x2f88d9,null,0x2));logger['info'](util[_0x4469('0x12')](_0x4469('0x35'),_0x2f88d9[_0x4469('0x1b')],_0x2f88d9[_0x4469('0x18')],_0x2f88d9[_0x4469('0x36')],_0x2f88d9[_0x4469('0x1c')],_0x2f88d9[_0x4469('0x19')]));_0x2f88d9['on'](_0x4469('0xd'),errorHandler);_0x2f88d9['on']('close',closeHandler);_0x2f88d9['on'](_0x4469('0x37'),timeoutHandler);_0x2f88d9[_0x4469('0x1d')]=![];_0x2f88d9['on'](_0x4469('0x38'),hangupHandler);var _0x2f34fd=getSquareProject[_0x4469('0x39')](null,_0x2f88d9[_0x4469('0x1b')]);if(_0x2f34fd){if(_0x2f34fd[_0x4469('0x3a')]){_0x51a856=getRoot(_0x2f34fd[_0x4469('0x3a')]);if(_0x51a856&&_0x51a856[_0x4469('0x3b')]){logger[_0x4469('0x32')](_0x4469('0x20'),JSON['stringify'](_0x51a856,null,0x2));_0x2f88d9[_0x4469('0x3c')]=moment()['format'](_0x4469('0x3d'));_0x5dacb8=initGraph(_[_0x4469('0x25')](_0x51a856,_0x4469('0x26')),_0x51a856[_0x4469('0x26')]);_0xa480a5=new Vertices(_0x2f88d9,rpc,mailRpc);logger[_0x4469('0x11')](util['format'](_0x4469('0x3e'),_0x2f88d9['arg_1'],_0x2f88d9['calleridname'],_0x2f88d9[_0x4469('0x36')],_0x2f88d9[_0x4469('0x1c')],_0x2f88d9[_0x4469('0x19')]));_0x5dacb8[_0x4469('0x3f')](_0x51a856[_0x4469('0x3b')]['id'],function(_0xdee266){try{_0xdee266=_0xa480a5[_0x4469('0x40')](_0xdee266);logger[_0x4469('0x32')](_0x4469('0x41'),JSON['stringify'](_0xdee266,null,0x2));if(_0xdee266[_0x4469('0x21')]===_0x4469('0x42')){logger['info'](_0x4469('0x43'));_0x2f88d9[_0x4469('0x44')]=_0xdee266[_0x4469('0x44')]||_0x2f88d9[_0x4469('0x44')];_0x2f88d9[_0x4469('0x45')]=_0xdee266[_0x4469('0x45')];_0x2f88d9[_0x4469('0x46')]=_0xdee266[_0x4469('0x46')]?_0xdee266['priority']-0x1:0x1;return null;}else if(_0xdee266&&_0xa480a5[_0xdee266['agicommand']]){_0x502086=_0xa480a5[_0xdee266[_0x4469('0x21')]](_0xdee266);logger[_0x4469('0x11')]('response',JSON['stringify'](_0x502086,null,0x2));if(_0x502086&&_0x502086[_0x4469('0x47')]===AGI_CODE_SUCCESS&&_0x502086[_0x4469('0x48')]!==AGI_RESULT_ERROR&&!_0x2f88d9[_0x4469('0x1d')]){logger[_0x4469('0x32')](_0x4469('0x49'),getLogFromObject(_0x502086));return _[_0x4469('0x4a')](_0x502086[_0x4469('0x48')])?null:_0x502086[_0x4469('0x48')]['toString']();}else{logger[_0x4469('0xd')]('response',getLogFromObject(_0x502086));return null;}}else{logger['error'](_0x4469('0x4b'));return null;}}catch(_0x278c9d){logger[_0x4469('0xd')](_0x278c9d[_0x4469('0xe')]);return null;}});if(_0x51a856[_0x4469('0x4c')]){logger[_0x4469('0x11')](util[_0x4469('0x12')](_0x4469('0x4d'),_0x2f88d9[_0x4469('0x1b')],_0x2f88d9[_0x4469('0x18')],_0x2f88d9[_0x4469('0x36')],_0x2f88d9[_0x4469('0x1c')],_0x2f88d9[_0x4469('0x19')]));_0x5dacb8['traverseBFS'](_0x51a856[_0x4469('0x4c')]['id'],function(_0x1dad1d){try{_0x1dad1d=_0xa480a5[_0x4469('0x40')](_0x1dad1d);logger[_0x4469('0x32')]('vertex',JSON['stringify'](_0x1dad1d,null,0x2));if(_0x1dad1d&&_0xa480a5[_0x1dad1d[_0x4469('0x21')]]){_0x502086=_0xa480a5[_0x1dad1d[_0x4469('0x21')]](_0x1dad1d);if(_0x502086){logger['debug'](_0x4469('0x49'),getLogFromObject(_0x502086));return _['isUndefined'](_0x502086[_0x4469('0x48')])?null:_0x502086[_0x4469('0x48')][_0x4469('0x4e')]();}else{logger[_0x4469('0xd')](_0x4469('0x49'),getLogFromObject(_0x502086));return null;}}else{logger[_0x4469('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0xc0affa){logger[_0x4469('0xd')](_0xc0affa['stack']);return null;}});}logger[_0x4469('0x11')](util[_0x4469('0x12')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2f88d9[_0x4469('0x1b')],_0x2f88d9[_0x4469('0x18')],_0x2f88d9[_0x4469('0x36')],_0x2f88d9['dnid'],_0x2f88d9[_0x4469('0x19')]));logger[_0x4469('0x11')](util[_0x4469('0x12')](_0x4469('0x4f'),_0x2f88d9[_0x4469('0x44')],_0x2f88d9[_0x4469('0x45')],parseInt(_0x2f88d9['priority'],0xa)+0x1));_0x2f88d9[_0x4469('0x50')](_0x2f88d9[_0x4469('0x44')],_0x2f88d9['extension'],parseInt(_0x2f88d9[_0x4469('0x46')],0xa)+0x1);_0x2f88d9[_0x4469('0x51')]();}}else{logger['error'](util[_0x4469('0x12')](_0x4469('0x52'),_0x2f88d9[_0x4469('0x1b')]));_0x2f88d9['continueAt'](_0x2f88d9[_0x4469('0x44')],_0x2f88d9['extension'],parseInt(_0x2f88d9[_0x4469('0x46')],0xa)+0x1);_0x2f88d9[_0x4469('0x51')]();}}else{logger[_0x4469('0xd')](util[_0x4469('0x12')](_0x4469('0x53'),_0x2f88d9['arg_1']));_0x2f88d9[_0x4469('0x50')](_0x2f88d9[_0x4469('0x44')],_0x2f88d9[_0x4469('0x45')],parseInt(_0x2f88d9[_0x4469('0x46')],0xa)+0x1);_0x2f88d9[_0x4469('0x51')]();}}function main(){var _0xc50d60;return utilLicense['getLicense']()[_0x4469('0x2d')](function(_0x166c41){if(_0x166c41){if(_0x166c41[_0x4469('0x54')]){if(_0x166c41[_0x4469('0x55')]&&_0x166c41[_0x4469('0x55')]>0x0){logger[_0x4469('0x11')](util[_0x4469('0x12')]('[LICENSE]\x20CHANNELS:\x20%s',_0x166c41[_0x4469('0x55')]));_0xc50d60=_0x166c41['callysquare'];}else{logger[_0x4469('0x11')](_0x4469('0x56'));}}else{logger[_0x4469('0x11')](_0x4469('0x57'));_0xc50d60=-0x1;}}})[_0x4469('0x2e')](function(_0x569617){logger['error'](_0x4469('0x58'),_0x569617[_0x4469('0xe')]);})[_0x4469('0x4c')](function(){var _0x2d79a3=require('./server')(config[_0x4469('0xa')]['port'],config['agi']['ip'],_0xc50d60);_0x2d79a3['on']('error',errorHandler);_0x2d79a3['on'](_0x4469('0x59'),listeningHandler);_0x2d79a3['on'](_0x4469('0x5a'),connectionHandler);_0x2d79a3['on'](_0x4469('0x51'),closeHandler);});}main(); \ No newline at end of file +var _0x8e57=['Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','../../config/environment','agi','../../config/license/util','./rpc','./mailRpc','./graph','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','format','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','maxRetry','retry','omit','mxCell','length','target','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','start','debug','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','isUndefined','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','[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','Project\x20%s\x20not\x20published','continueAt'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x8e57,0x1c6));var _0x78e5=function(_0x2d1f91,_0x67470d){_0x2d1f91=_0x2d1f91-0x0;var _0x564681=_0x8e57[_0x2d1f91];return _0x564681;};'use strict';var parser=require(_0x78e5('0x0'));var _=require(_0x78e5('0x1'));var syncho=require(_0x78e5('0x2'));var util=require('util');var moment=require('moment');var config=require(_0x78e5('0x3'));var logger=require('../../config/logger')(_0x78e5('0x4'));var utilLicense=require(_0x78e5('0x5'));var rpc=require(_0x78e5('0x6'));var mailRpc=require(_0x78e5('0x7'));var Graph=require(_0x78e5('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x78e5('0x4')]=_[_0x78e5('0x9')](config[_0x78e5('0x4')],{'ip':_0x78e5('0xa'),'port':0x11dd});function connectionHandler(_0x3216ac){process[_0x78e5('0xb')](function(){syncho(function(){try{setChannelVariables(_0x3216ac);agiHandler(_0x3216ac);}catch(_0x5ce62e){logger[_0x78e5('0xc')](_0x5ce62e[_0x78e5('0xd')]);}});});}function listeningHandler(){console[_0x78e5('0xe')](_0x78e5('0xf'),config['agi'][_0x78e5('0x10')]);logger[_0x78e5('0x11')](util['format'](_0x78e5('0x12'),config['agi']['ip'],config[_0x78e5('0x4')]['port']));}function errorHandler(_0x3b25c4){if(_0x3b25c4&&_0x3b25c4[_0x78e5('0x13')]&&_0x3b25c4[_0x78e5('0x14')]){logger[_0x78e5('0xc')](util['format'](_0x78e5('0x15'),_0x3b25c4[_0x78e5('0x13')],_0x3b25c4['message']));}else{logger[_0x78e5('0xc')](util[_0x78e5('0x16')]('[ERROR]\x20%s',_0x3b25c4[_0x78e5('0xd')]));}}function closeHandler(){logger[_0x78e5('0x11')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x78e5('0x17')],this[_0x78e5('0x18')],this[_0x78e5('0x19')],this[_0x78e5('0x1a')],this[_0x78e5('0x1b')]));try{createSquareReport(this);}catch(_0x346a7b){logger[_0x78e5('0xc')](_0x346a7b[_0x78e5('0xd')]);}}function timeoutHandler(){logger[_0x78e5('0x11')](util[_0x78e5('0x16')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x78e5('0x17')],this[_0x78e5('0x18')],this[_0x78e5('0x19')],this[_0x78e5('0x1a')],this['uniqueid']));}function hangupHandler(){logger[_0x78e5('0x11')](util[_0x78e5('0x16')](_0x78e5('0x1c'),this['arg_1'],this[_0x78e5('0x18')],this[_0x78e5('0x19')],this[_0x78e5('0x1a')],this[_0x78e5('0x1b')]));this[_0x78e5('0x1d')]=!![];}function getRoot(_0x42585a){return parser[_0x78e5('0x1e')](_0x42585a,{'object':!![]})[_0x78e5('0x1f')][_0x78e5('0x20')];}function addVertex(_0x48264e,_0x66e19f,_0x4a3d08){_0x66e19f[_0x78e5('0x21')]=_0x4a3d08;if(_0x66e19f[_0x78e5('0x22')]('retry')){_0x66e19f[_0x78e5('0x23')]=parseInt(_0x66e19f[_0x78e5('0x24')],0xa);}_0x48264e['addVertex'](_[_0x78e5('0x25')](_0x66e19f,_0x78e5('0x26')));}function initGraph(_0x4ca0e3,_0x6fd4e1){var _0xd72a57=new Graph();for(var _0x3f6df0 in _0x4ca0e3){if(_0x4ca0e3[_0x78e5('0x22')](_0x3f6df0)){if(_['isArray'](_0x4ca0e3[_0x3f6df0])){for(var _0x27e716=0x0;_0x27e716<_0x4ca0e3[_0x3f6df0]['length'];_0x27e716+=0x1){addVertex(_0xd72a57,_0x4ca0e3[_0x3f6df0][_0x27e716],_0x3f6df0);}}else{addVertex(_0xd72a57,_0x4ca0e3[_0x3f6df0],_0x3f6df0);}}}for(var _0x3b6efe=0x0;_0x3b6efe<_0x6fd4e1[_0x78e5('0x27')];_0x3b6efe+=0x1){if(_0x6fd4e1[_0x3b6efe]['source']&&_0x6fd4e1[_0x3b6efe][_0x78e5('0x28')]){_0xd72a57['addEdge'](_0x6fd4e1[_0x3b6efe]['source'],_0x6fd4e1[_0x3b6efe][_0x78e5('0x28')],_0x6fd4e1[_0x3b6efe]['value']);}}return _0xd72a57;}function getSquareProject(_0xba0224,_0x5bcc2a){rpc[_0x78e5('0x29')](_0xba0224)[_0x78e5('0x2a')](function(_0x129ec5){_0x5bcc2a(null,_0x129ec5);})[_0x78e5('0x2b')](function(_0x220362){_0x5bcc2a(null,_0x220362);});}function createSquareReport(_0xd8ab16,_0x2e4565){rpc[_0x78e5('0x2c')](_0xd8ab16)[_0x78e5('0x2a')](function(_0x3b1e4d){if(_0x2e4565){_0x2e4565(null,_0x3b1e4d);}})[_0x78e5('0x2b')](function(_0x3824ea){if(_0x2e4565){_0x2e4565(null,_0x3824ea);}});}function setChannelVariables(_0x44ffdd){for(var _0x115ec8 in _0x44ffdd){if(_0x44ffdd[_0x78e5('0x22')](_0x115ec8)){if(_0x115ec8[_0x78e5('0x2d')](_0x78e5('0x2e'))===0x0){_0x44ffdd[_0x115ec8[_0x78e5('0x2f')](0x4)]=_0x44ffdd[_0x115ec8];delete _0x44ffdd[_0x115ec8];}}}}function getLogFromObject(_0x10c387){return util[_0x78e5('0x30')](_0x10c387,{'showHidden':![],'depth':null});}function agiHandler(_0x2a1d2f){var _0x2572f4,_0x171267,_0x5db71c,_0x50eb28,_0x45bb16;logger['debug'](_0x78e5('0x31'),JSON[_0x78e5('0x32')](_0x2a1d2f,null,0x2));logger[_0x78e5('0x11')](util[_0x78e5('0x16')](_0x78e5('0x33'),_0x2a1d2f[_0x78e5('0x17')],_0x2a1d2f[_0x78e5('0x18')],_0x2a1d2f[_0x78e5('0x19')],_0x2a1d2f[_0x78e5('0x1a')],_0x2a1d2f[_0x78e5('0x1b')]));_0x2a1d2f['on'](_0x78e5('0xc'),errorHandler);_0x2a1d2f['on'](_0x78e5('0x34'),closeHandler);_0x2a1d2f['on'](_0x78e5('0x35'),timeoutHandler);_0x2a1d2f[_0x78e5('0x1d')]=![];_0x2a1d2f['on']('hangup',hangupHandler);var _0x300aec=getSquareProject[_0x78e5('0x36')](null,_0x2a1d2f[_0x78e5('0x17')]);if(_0x300aec){if(_0x300aec[_0x78e5('0x37')]){_0x2572f4=getRoot(_0x300aec['production']);if(_0x2572f4&&_0x2572f4[_0x78e5('0x38')]){logger[_0x78e5('0x39')]('root',JSON[_0x78e5('0x32')](_0x2572f4,null,0x2));_0x2a1d2f[_0x78e5('0x3a')]=moment()[_0x78e5('0x16')]('YYYY-MM-DD\x20HH:mm:ss');_0x171267=initGraph(_[_0x78e5('0x25')](_0x2572f4,_0x78e5('0x26')),_0x2572f4[_0x78e5('0x26')]);_0x5db71c=new Vertices(_0x2a1d2f,rpc,mailRpc);logger['info'](util[_0x78e5('0x16')](_0x78e5('0x3b'),_0x2a1d2f[_0x78e5('0x17')],_0x2a1d2f['calleridname'],_0x2a1d2f['callerid'],_0x2a1d2f['dnid'],_0x2a1d2f['uniqueid']));_0x171267[_0x78e5('0x3c')](_0x2572f4[_0x78e5('0x38')]['id'],function(_0x3a3687){try{_0x3a3687=_0x5db71c['clear'](_0x3a3687);logger['debug'](_0x78e5('0x3d'),JSON['stringify'](_0x3a3687,null,0x2));if(_0x3a3687['agicommand']===_0x78e5('0x3e')){logger[_0x78e5('0x11')](_0x78e5('0x3f'));_0x2a1d2f[_0x78e5('0x40')]=_0x3a3687[_0x78e5('0x40')]||_0x2a1d2f['context'];_0x2a1d2f[_0x78e5('0x41')]=_0x3a3687[_0x78e5('0x41')];_0x2a1d2f['priority']=_0x3a3687['priority']?_0x3a3687[_0x78e5('0x42')]-0x1:0x1;return null;}else if(_0x3a3687&&_0x5db71c[_0x3a3687['agicommand']]){_0x45bb16=_0x5db71c[_0x3a3687['agicommand']](_0x3a3687);logger[_0x78e5('0x11')](_0x78e5('0x43'),JSON[_0x78e5('0x32')](_0x45bb16,null,0x2));if(_0x45bb16&&_0x45bb16[_0x78e5('0x44')]===AGI_CODE_SUCCESS&&_0x45bb16['result']!==AGI_RESULT_ERROR&&!_0x2a1d2f[_0x78e5('0x1d')]){logger['debug'](_0x78e5('0x43'),getLogFromObject(_0x45bb16));return _[_0x78e5('0x45')](_0x45bb16[_0x78e5('0x46')])?null:_0x45bb16[_0x78e5('0x46')][_0x78e5('0x47')]();}else{logger[_0x78e5('0xc')](_0x78e5('0x43'),getLogFromObject(_0x45bb16));return null;}}else{logger[_0x78e5('0xc')](_0x78e5('0x48'));return null;}}catch(_0x509d80){logger['error'](_0x509d80['stack']);return null;}});if(_0x2572f4[_0x78e5('0x49')]){logger[_0x78e5('0x11')](util[_0x78e5('0x16')](_0x78e5('0x4a'),_0x2a1d2f[_0x78e5('0x17')],_0x2a1d2f[_0x78e5('0x18')],_0x2a1d2f[_0x78e5('0x19')],_0x2a1d2f[_0x78e5('0x1a')],_0x2a1d2f['uniqueid']));_0x171267[_0x78e5('0x3c')](_0x2572f4[_0x78e5('0x49')]['id'],function(_0x5cfe97){try{_0x5cfe97=_0x5db71c[_0x78e5('0x4b')](_0x5cfe97);logger[_0x78e5('0x39')](_0x78e5('0x3d'),JSON['stringify'](_0x5cfe97,null,0x2));if(_0x5cfe97&&_0x5db71c[_0x5cfe97['agicommand']]){_0x45bb16=_0x5db71c[_0x5cfe97['agicommand']](_0x5cfe97);if(_0x45bb16){logger[_0x78e5('0x39')](_0x78e5('0x43'),getLogFromObject(_0x45bb16));return _[_0x78e5('0x45')](_0x45bb16['result'])?null:_0x45bb16[_0x78e5('0x46')][_0x78e5('0x47')]();}else{logger[_0x78e5('0xc')](_0x78e5('0x43'),getLogFromObject(_0x45bb16));return null;}}else{logger[_0x78e5('0xc')](_0x78e5('0x48'));return null;}}catch(_0x8299be){logger['error'](_0x8299be[_0x78e5('0xd')]);return null;}});}logger[_0x78e5('0x11')](util[_0x78e5('0x16')](_0x78e5('0x4c'),_0x2a1d2f[_0x78e5('0x17')],_0x2a1d2f[_0x78e5('0x18')],_0x2a1d2f[_0x78e5('0x19')],_0x2a1d2f[_0x78e5('0x1a')],_0x2a1d2f['uniqueid']));logger[_0x78e5('0x11')](util[_0x78e5('0x16')](_0x78e5('0x4d'),_0x2a1d2f['context'],_0x2a1d2f[_0x78e5('0x41')],parseInt(_0x2a1d2f['priority'],0xa)+0x1));_0x2a1d2f['continueAt'](_0x2a1d2f[_0x78e5('0x40')],_0x2a1d2f[_0x78e5('0x41')],parseInt(_0x2a1d2f['priority'],0xa)+0x1);_0x2a1d2f['close']();}}else{logger[_0x78e5('0xc')](util[_0x78e5('0x16')](_0x78e5('0x4e'),_0x2a1d2f[_0x78e5('0x17')]));_0x2a1d2f[_0x78e5('0x4f')](_0x2a1d2f['context'],_0x2a1d2f['extension'],parseInt(_0x2a1d2f['priority'],0xa)+0x1);_0x2a1d2f[_0x78e5('0x34')]();}}else{logger[_0x78e5('0xc')](util[_0x78e5('0x16')](_0x78e5('0x50'),_0x2a1d2f[_0x78e5('0x17')]));_0x2a1d2f['continueAt'](_0x2a1d2f[_0x78e5('0x40')],_0x2a1d2f[_0x78e5('0x41')],parseInt(_0x2a1d2f['priority'],0xa)+0x1);_0x2a1d2f[_0x78e5('0x34')]();}}function main(){var _0x1967d0;return utilLicense[_0x78e5('0x51')]()[_0x78e5('0x2a')](function(_0x1e77fb){if(_0x1e77fb){if(_0x1e77fb['voice']){if(_0x1e77fb[_0x78e5('0x52')]&&_0x1e77fb[_0x78e5('0x52')]>0x0){logger['info'](util[_0x78e5('0x16')]('[LICENSE]\x20CHANNELS:\x20%s',_0x1e77fb[_0x78e5('0x52')]));_0x1967d0=_0x1e77fb[_0x78e5('0x52')];}else{logger[_0x78e5('0x11')](_0x78e5('0x53'));}}else{logger[_0x78e5('0x11')](_0x78e5('0x54'));_0x1967d0=-0x1;}}})['catch'](function(_0x595f89){logger[_0x78e5('0xc')](_0x78e5('0x55'),_0x595f89[_0x78e5('0xd')]);})['finally'](function(){var _0x89e6f1=require(_0x78e5('0x56'))(config[_0x78e5('0x4')]['port'],config['agi']['ip'],_0x1967d0);_0x89e6f1['on'](_0x78e5('0xc'),errorHandler);_0x89e6f1['on'](_0x78e5('0x57'),listeningHandler);_0x89e6f1['on'](_0x78e5('0x58'),connectionHandler);_0x89e6f1['on']('close',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 5ab5305..4b77106 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 _0x6c7e=['error','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c7e,0x16d));var _0xe6c7=function(_0x3167b1,_0x5ad266){_0x3167b1=_0x3167b1-0x0;var _0x362152=_0x6c7e[_0x3167b1];return _0x362152;};'use strict';var BPromise=require(_0xe6c7('0x0'));var jayson=require(_0xe6c7('0x1'));var client=jayson[_0xe6c7('0x2')][_0xe6c7('0x3')]({'port':0x232b});function request(_0x289af9,_0x2651cd){return new BPromise(function(_0x297b1d,_0x3e2abf){return client['request'](_0x289af9,_0x2651cd)[_0xe6c7('0x4')](function(_0x2f4e3c){if(_0x2f4e3c[_0xe6c7('0x5')]){return _0x3e2abf(_0x2f4e3c[_0xe6c7('0x5')][_0xe6c7('0x6')]);}else{return _0x297b1d(_0x2f4e3c['result']);}})[_0xe6c7('0x7')](function(_0x4c4584){return _0x3e2abf(_0x4c4584);});});}exports[_0xe6c7('0x8')]=function(_0x39c8d3,_0x4665aa){return request(_0xe6c7('0x9'),{'account':_0x39c8d3,'message':_0x4665aa});}; \ No newline at end of file +var _0x35b0=['message','catch','SendMail','jayson/promise','client','http','request','then','error'];(function(_0x3a8df1,_0x257285){var _0x16b89d=function(_0x4014fc){while(--_0x4014fc){_0x3a8df1['push'](_0x3a8df1['shift']());}};_0x16b89d(++_0x257285);}(_0x35b0,0x18f));var _0x035b=function(_0x42c8b8,_0x37e05c){_0x42c8b8=_0x42c8b8-0x0;var _0x251516=_0x35b0[_0x42c8b8];return _0x251516;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x035b('0x0'));var client=jayson[_0x035b('0x1')][_0x035b('0x2')]({'port':0x232b});function request(_0x107549,_0x34e0c1){return new BPromise(function(_0xbbc9c4,_0xcff0f5){return client[_0x035b('0x3')](_0x107549,_0x34e0c1)[_0x035b('0x4')](function(_0x7a9c12){if(_0x7a9c12[_0x035b('0x5')]){return _0xcff0f5(_0x7a9c12[_0x035b('0x5')][_0x035b('0x6')]);}else{return _0xbbc9c4(_0x7a9c12['result']);}})[_0x035b('0x7')](function(_0xa774dc){return _0xcff0f5(_0xa774dc);});});}exports['sendMailMessage']=function(_0xccd9e6,_0xd0efc){return request(_0x035b('0x8'),{'account':_0xccd9e6,'message':_0xd0efc});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index fc6f2ae..3821a9d 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 _0xb2d8=['\x0d\x0a\x0d\x0a','toString','substring','length','split','indexOf','slice','trim','emit','headers','line','exports','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xb2d8,0x188));var _0x8b2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2d8[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var Transform=require('stream')[_0x8b2d('0x0')];function AGIReply(_0x3cb097){Transform[_0x8b2d('0x1')](this,_0x3cb097);this[_0x8b2d('0x2')]='';this[_0x8b2d('0x3')]=![];}util[_0x8b2d('0x4')](AGIReply,Transform);AGIReply[_0x8b2d('0x5')][_0x8b2d('0x6')]=function(_0x3c7c67,_0x2dc4a5,_0xa2176f){var _0x3878e1='\x0a',_0x1261fe=['\x0a\x0a',_0x8b2d('0x7')],_0x50ac88=-0x1,_0x3d32bd=-0x1,_0x4002fa='',_0x199a96=0x0,_0x43a1fe='',_0x4d3f2a='';this[_0x8b2d('0x2')]+=_0x3c7c67[_0x8b2d('0x8')]();_0x43a1fe=this[_0x8b2d('0x2')];if(!this[_0x8b2d('0x3')]){_0x199a96=0x0;while(_0x1261fe[_0x199a96]){while((_0x3d32bd=_0x43a1fe['indexOf'](_0x1261fe[_0x199a96]))!=-0x1){_0x4002fa=_0x1261fe[_0x199a96];_0x4d3f2a=_0x43a1fe[_0x8b2d('0x9')](0x0,_0x3d32bd);_0x43a1fe=_0x43a1fe[_0x8b2d('0x9')](_0x3d32bd+_0x4002fa[_0x8b2d('0xa')]);var _0xc1040f=_0x4d3f2a[_0x8b2d('0xb')](_0x3878e1),_0x14371e=0x0,_0x35fedc={},_0x373055='',_0x2eebc2='',_0x35e021=-0x1;while(_0xc1040f[_0x14371e]){_0x35e021=_0xc1040f[_0x14371e][_0x8b2d('0xc')](':');if(_0x35e021!=-0x1){_0x373055=_0xc1040f[_0x14371e][_0x8b2d('0xd')](0x0,_0x35e021)[_0x8b2d('0xe')]();_0x2eebc2=_0xc1040f[_0x14371e][_0x8b2d('0xd')](_0x35e021+0x1)[_0x8b2d('0xe')]();if(_0x373055[_0x8b2d('0xa')]>0x0){_0x35fedc[_0x373055]=_0x2eebc2;}}else{}_0x14371e++;}this[_0x8b2d('0xf')](_0x8b2d('0x10'),_0x35fedc);this['_inBody']=!![];}_0x199a96++;}this[_0x8b2d('0x2')]=_0x43a1fe;}else{while((_0x50ac88=_0x43a1fe[_0x8b2d('0xc')](_0x3878e1))!=-0x1){_0x4d3f2a=_0x43a1fe[_0x8b2d('0x9')](0x0,_0x50ac88);this[_0x8b2d('0xf')](_0x8b2d('0x11'),_0x4d3f2a);_0x43a1fe=_0x43a1fe[_0x8b2d('0x9')](_0x50ac88+_0x3878e1[_0x8b2d('0xa')]);}this[_0x8b2d('0x2')]=_0x43a1fe;}_0xa2176f();};module[_0x8b2d('0x12')]=AGIReply; \ No newline at end of file +var _0x074a=['indexOf','trim','slice','emit','headers','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','substring','length','split'];(function(_0xd328b1,_0x6306fd){var _0x11b7e6=function(_0x35660b){while(--_0x35660b){_0xd328b1['push'](_0xd328b1['shift']());}};_0x11b7e6(++_0x6306fd);}(_0x074a,0xe2));var _0xa074=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x074a[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0xa074('0x0'));var Transform=require(_0xa074('0x1'))[_0xa074('0x2')];function AGIReply(_0x4d282b){Transform[_0xa074('0x3')](this,_0x4d282b);this[_0xa074('0x4')]='';this[_0xa074('0x5')]=![];}util[_0xa074('0x6')](AGIReply,Transform);AGIReply[_0xa074('0x7')][_0xa074('0x8')]=function(_0x5440a7,_0x159a14,_0x2d2704){var _0x39ef1c='\x0a',_0x3e8530=['\x0a\x0a',_0xa074('0x9')],_0x44e6f1=-0x1,_0x35ff3b=-0x1,_0x571cf0='',_0x455ec2=0x0,_0x3d8f67='',_0x25ea4d='';this[_0xa074('0x4')]+=_0x5440a7[_0xa074('0xa')]();_0x3d8f67=this[_0xa074('0x4')];if(!this[_0xa074('0x5')]){_0x455ec2=0x0;while(_0x3e8530[_0x455ec2]){while((_0x35ff3b=_0x3d8f67['indexOf'](_0x3e8530[_0x455ec2]))!=-0x1){_0x571cf0=_0x3e8530[_0x455ec2];_0x25ea4d=_0x3d8f67[_0xa074('0xb')](0x0,_0x35ff3b);_0x3d8f67=_0x3d8f67['substring'](_0x35ff3b+_0x571cf0[_0xa074('0xc')]);var _0xb6eecd=_0x25ea4d[_0xa074('0xd')](_0x39ef1c),_0x4d13ef=0x0,_0x377427={},_0x5bf3c1='',_0x16ebae='',_0x2a2ba4=-0x1;while(_0xb6eecd[_0x4d13ef]){_0x2a2ba4=_0xb6eecd[_0x4d13ef][_0xa074('0xe')](':');if(_0x2a2ba4!=-0x1){_0x5bf3c1=_0xb6eecd[_0x4d13ef]['slice'](0x0,_0x2a2ba4)[_0xa074('0xf')]();_0x16ebae=_0xb6eecd[_0x4d13ef][_0xa074('0x10')](_0x2a2ba4+0x1)[_0xa074('0xf')]();if(_0x5bf3c1['length']>0x0){_0x377427[_0x5bf3c1]=_0x16ebae;}}else{}_0x4d13ef++;}this[_0xa074('0x11')](_0xa074('0x12'),_0x377427);this[_0xa074('0x5')]=!![];}_0x455ec2++;}this['_localBuffer']=_0x3d8f67;}else{while((_0x44e6f1=_0x3d8f67[_0xa074('0xe')](_0x39ef1c))!=-0x1){_0x25ea4d=_0x3d8f67[_0xa074('0xb')](0x0,_0x44e6f1);this[_0xa074('0x11')]('line',_0x25ea4d);_0x3d8f67=_0x3d8f67[_0xa074('0xb')](_0x44e6f1+_0x39ef1c[_0xa074('0xc')]);}this[_0xa074('0x4')]=_0x3d8f67;}_0x2d2704();};module[_0xa074('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index b541181..4570ac7 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 _0x6de2=['getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','ShowPause','agentLogin','LoginUser','PauseUser','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','http','request','error','message','result','catch','getSquareProjects','name','production','getSquareProject','ShowSquareProject','ShowMailAccount','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVariable'];(function(_0x36c356,_0x56c2a1){var _0x9e38dd=function(_0x35527f){while(--_0x35527f){_0x36c356['push'](_0x36c356['shift']());}};_0x9e38dd(++_0x56c2a1);}(_0x6de2,0x64));var _0x26de=function(_0x3c0e49,_0x1b10b6){_0x3c0e49=_0x3c0e49-0x0;var _0x40392d=_0x6de2[_0x3c0e49];return _0x40392d;};'use strict';var BPromise=require(_0x26de('0x0'));var moment=require(_0x26de('0x1'));var _=require(_0x26de('0x2'));var util=require(_0x26de('0x3'));var jayson=require(_0x26de('0x4'));var client=jayson['client'][_0x26de('0x5')]({'port':0x2329});function request(_0x23a500,_0x5191e9){return new BPromise(function(_0x1e441b,_0x25d65e){return client[_0x26de('0x6')](_0x23a500,_0x5191e9)['then'](function(_0x3fe081){if(_0x3fe081[_0x26de('0x7')]){return _0x25d65e(_0x3fe081[_0x26de('0x7')][_0x26de('0x8')]);}else{return _0x1e441b(_0x3fe081[_0x26de('0x9')]);}})[_0x26de('0xa')](function(_0x4bac2b){return _0x25d65e(_0x4bac2b);});});}exports[_0x26de('0xb')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x26de('0xc'),_0x26de('0xd')]}});};exports[_0x26de('0xe')]=function(_0x43a839){return request(_0x26de('0xf'),{'options':{'raw':![],'where':{'name':_0x43a839},'attributes':[_0x26de('0xd')]}});};exports['getMailAccountById']=function(_0x262969){return request(_0x26de('0x10'),{'options':{'raw':![],'where':{'id':_0x262969},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':'CloudProvider','as':_0x26de('0x11')}]}],'attributes':['id',_0x26de('0xc'),_0x26de('0x12')],'smtp':!![]}});};exports[_0x26de('0x13')]=function(_0x558c0c){return request(_0x26de('0xf'),{'options':{'where':{'id':_0x558c0c},'attributes':[_0x26de('0xc')]}});};exports[_0x26de('0x14')]=function(_0x2e0ff2){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x2e0ff2},'attributes':['name']}});};exports['getVariableById']=function(_0x2ef44b){return request(_0x26de('0x15'),{'options':{'where':{'id':_0x2ef44b},'attributes':['name']}});};exports[_0x26de('0x16')]=function(_0x388142){return request(_0x26de('0x17'),{'options':{'where':{'id':_0x388142},'attributes':[_0x26de('0x18')]}});};exports['getUserById']=function(_0x4b699c){return request(_0x26de('0x19'),{'options':{'where':{'id':_0x4b699c},'attributes':['name']}});};exports[_0x26de('0x1a')]=function(_0xa76878){return request(_0x26de('0x1b'),{'options':{'where':{'phone':_0xa76878[_0x26de('0x1c')]},'attributes':['id']}});};exports[_0x26de('0x1d')]=function(_0x419d54){return request(_0x26de('0x1e'),{'options':{'where':{'id':_0x419d54},'attributes':[_0x26de('0xc')]}});};exports[_0x26de('0x1f')]=function(_0x332784){return request('ShowSound',{'options':{'where':{'id':_0x332784},'attributes':[_0x26de('0x20')]}});};exports['getIntervalById']=function(_0x3fd593){return request(_0x26de('0x21'),{'options':{'raw':![],'where':{'id':_0x3fd593},'include':[{'model':_0x26de('0x22'),'as':_0x26de('0x23')}]}});};exports[_0x26de('0x24')]=function(_0x2af0ac){return request('ShowSmsAccount',{'options':{'where':{'id':_0x2af0ac},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x35ad87){return request(_0x26de('0x25'),{'body':_0x35ad87});};exports[_0x26de('0x26')]=function(_0x9b03a8){return request(_0x26de('0x27'),{'body':_0x9b03a8});};exports[_0x26de('0x28')]=function(_0x3578e1){return request(_0x26de('0x29'),{'body':_[_0x26de('0x2a')](_0x3578e1,{'project_name':_0x3578e1['arg_1'],'prev_project_name':_0x3578e1[_0x26de('0x2b')]||'','is_subproject':_0x3578e1[_0x26de('0x2b')]?!![]:![],'leaveAt':moment()[_0x26de('0x2c')](_0x26de('0x2d'))})});};exports[_0x26de('0x2e')]=function(_0x211fad){return request(_0x26de('0x2f'),{'body':_0x211fad});};exports[_0x26de('0x30')]=function(_0x29d38e){return request(_0x26de('0x31'),{'body':_0x29d38e});};exports[_0x26de('0x32')]=function(_0x5adab3){return request(_0x26de('0x33'),{'options':{'raw':![],'where':{'phone':_0x5adab3[_0x26de('0x1c')],'ListId':_0x5adab3[_0x26de('0x34')]}}})[_0x26de('0x35')](function(_0x374653){if(_0x374653){return _0x374653;}return request('CreateCmContact',{'body':_0x5adab3});});};exports['getPauseById']=function(_0x133289){return request(_0x26de('0x36'),{'options':{'where':{'id':_0x133289},'attributes':['name']}});};exports[_0x26de('0x37')]=function(_0x1e717a,_0x106574){return request(_0x26de('0x38'),{'body':{'interface':_0x106574},'options':{'where':_0x1e717a}});};exports['agentPause']=function(_0x14bf11,_0x48739d,_0x13d078){return request(_0x26de('0x39'),{'body':{'type':_0x48739d,'uniqueid':_0x13d078},'options':{'where':_0x14bf11}});};exports['agentUnpause']=function(_0x168361){return request(_0x26de('0x3a'),{'body':{},'options':{'where':_0x168361}});};exports[_0x26de('0x3b')]=function(_0x4d8ce5){return request(_0x26de('0x3c'),{'body':{},'options':{'where':_0x4d8ce5}});}; \ No newline at end of file +var _0xbf4a=['CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','CreateCmContact','getPauseById','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','bluebird','moment','lodash','jayson/promise','http','then','error','message','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','CloudProvider','email','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage'];(function(_0xa4928c,_0x16b89c){var _0x27cc29=function(_0x14b819){while(--_0x14b819){_0xa4928c['push'](_0xa4928c['shift']());}};_0x27cc29(++_0x16b89c);}(_0xbf4a,0x104));var _0xabf4=function(_0x100bc5,_0x34771c){_0x100bc5=_0x100bc5-0x0;var _0xf029ba=_0xbf4a[_0x100bc5];return _0xf029ba;};'use strict';var BPromise=require(_0xabf4('0x0'));var moment=require(_0xabf4('0x1'));var _=require(_0xabf4('0x2'));var util=require('util');var jayson=require(_0xabf4('0x3'));var client=jayson['client'][_0xabf4('0x4')]({'port':0x2329});function request(_0x1a593c,_0x416fc9){return new BPromise(function(_0x126e11,_0x698454){return client['request'](_0x1a593c,_0x416fc9)[_0xabf4('0x5')](function(_0x1825a8){if(_0x1825a8[_0xabf4('0x6')]){return _0x698454(_0x1825a8[_0xabf4('0x6')][_0xabf4('0x7')]);}else{return _0x126e11(_0x1825a8['result']);}})[_0xabf4('0x8')](function(_0x159eb4){return _0x698454(_0x159eb4);});});}exports[_0xabf4('0x9')]=function(){return request(_0xabf4('0xa'),{'options':{'raw':![],'attributes':['id',_0xabf4('0xb'),'production']}});};exports[_0xabf4('0xc')]=function(_0x1b14f6){return request(_0xabf4('0xd'),{'options':{'raw':![],'where':{'name':_0x1b14f6},'attributes':[_0xabf4('0xe')]}});};exports[_0xabf4('0xf')]=function(_0x3c6b8e){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x3c6b8e},'include':[{'model':_0xabf4('0x10'),'as':_0xabf4('0x11'),'include':[{'model':_0xabf4('0x12'),'as':_0xabf4('0x12')}]}],'attributes':['id',_0xabf4('0xb'),_0xabf4('0x13')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x5eb9a9){return request(_0xabf4('0xd'),{'options':{'where':{'id':_0x5eb9a9},'attributes':[_0xabf4('0xb')]}});};exports[_0xabf4('0x14')]=function(_0x243861){return request(_0xabf4('0x15'),{'options':{'where':{'id':_0x243861},'attributes':[_0xabf4('0xb')]}});};exports['getVariableById']=function(_0x424261){return request(_0xabf4('0x16'),{'options':{'where':{'id':_0x424261},'attributes':[_0xabf4('0xb')]}});};exports[_0xabf4('0x17')]=function(_0x4dc60d){return request(_0xabf4('0x18'),{'options':{'where':{'id':_0x4dc60d},'attributes':[_0xabf4('0x19')]}});};exports[_0xabf4('0x1a')]=function(_0x4465a4){return request('ShowUser',{'options':{'where':{'id':_0x4465a4},'attributes':[_0xabf4('0xb')]}});};exports[_0xabf4('0x1b')]=function(_0xc61aa9){return request(_0xabf4('0x1c'),{'options':{'where':{'phone':_0xc61aa9['phone']},'attributes':['id']}});};exports[_0xabf4('0x1d')]=function(_0x1ba4c0){return request(_0xabf4('0x1e'),{'options':{'where':{'id':_0x1ba4c0},'attributes':[_0xabf4('0xb')]}});};exports[_0xabf4('0x1f')]=function(_0x3b87dd){return request(_0xabf4('0x20'),{'options':{'where':{'id':_0x3b87dd},'attributes':[_0xabf4('0x21')]}});};exports[_0xabf4('0x22')]=function(_0x479672){return request(_0xabf4('0x23'),{'options':{'raw':![],'where':{'id':_0x479672},'include':[{'model':'Interval','as':_0xabf4('0x24')}]}});};exports['getSmsAccountById']=function(_0x12657d){return request(_0xabf4('0x25'),{'options':{'where':{'id':_0x12657d},'attributes':['id',_0xabf4('0xb')]}});};exports[_0xabf4('0x26')]=function(_0x4066b5){return request(_0xabf4('0x27'),{'body':_0x4066b5});};exports['createSquareDetailsReport']=function(_0x440b02){return request(_0xabf4('0x28'),{'body':_0x440b02});};exports[_0xabf4('0x29')]=function(_0x3d5709){return request(_0xabf4('0x2a'),{'body':_['merge'](_0x3d5709,{'project_name':_0x3d5709[_0xabf4('0x2b')],'prev_project_name':_0x3d5709[_0xabf4('0x2c')]||'','is_subproject':_0x3d5709[_0xabf4('0x2c')]?!![]:![],'leaveAt':moment()[_0xabf4('0x2d')](_0xabf4('0x2e'))})});};exports[_0xabf4('0x2f')]=function(_0x1c96e2){return request(_0xabf4('0x30'),{'body':_0x1c96e2});};exports[_0xabf4('0x31')]=function(_0x1d0161){return request(_0xabf4('0x32'),{'body':_0x1d0161});};exports['createCmContact']=function(_0xb08e6e){return request(_0xabf4('0x33'),{'options':{'raw':![],'where':{'phone':_0xb08e6e['phone'],'ListId':_0xb08e6e['ListId']}}})[_0xabf4('0x5')](function(_0x207c9c){if(_0x207c9c){return _0x207c9c;}return request(_0xabf4('0x34'),{'body':_0xb08e6e});});};exports[_0xabf4('0x35')]=function(_0x4822cf){return request('ShowPause',{'options':{'where':{'id':_0x4822cf},'attributes':[_0xabf4('0xb')]}});};exports['agentLogin']=function(_0x18301c,_0x281764){return request(_0xabf4('0x36'),{'body':{'interface':_0x281764},'options':{'where':_0x18301c}});};exports[_0xabf4('0x37')]=function(_0x3772c3,_0x5299b9,_0x335520){return request(_0xabf4('0x38'),{'body':{'type':_0x5299b9,'uniqueid':_0x335520},'options':{'where':_0x3772c3}});};exports[_0xabf4('0x39')]=function(_0x4b6903){return request(_0xabf4('0x3a'),{'body':{},'options':{'where':_0x4b6903}});};exports['agentLogout']=function(_0x120107){return request(_0xabf4('0x3b'),{'body':{},'options':{'where':_0x120107}});}; \ 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 9f1c601..f22830b 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 _0x1d7e=['exports','./lex'];(function(_0x5035b2,_0x58531d){var _0x250a07=function(_0x36de88){while(--_0x36de88){_0x5035b2['push'](_0x5035b2['shift']());}};_0x250a07(++_0x58531d);}(_0x1d7e,0x7d));var _0xe1d7=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x1d7e[_0x491a7f];return _0x3d8f44;};var polly=require('./polly');var lex=require(_0xe1d7('0x0'));module[_0xe1d7('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x2e88=['./lex','exports','./polly'];(function(_0x343090,_0x433a80){var _0x3ff3e8=function(_0x16c811){while(--_0x16c811){_0x343090['push'](_0x343090['shift']());}};_0x3ff3e8(++_0x433a80);}(_0x2e88,0x95));var _0x82e8=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0x2e88[_0x3712e2];return _0x1faff4;};var polly=require(_0x82e8('0x0'));var lex=require(_0x82e8('0x1'));module[_0x82e8('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 ab0098c..067b153 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 _0x9354=['exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9354,0x96));var _0x4935=function(_0x2fbd0e,_0x3460a9){_0x2fbd0e=_0x2fbd0e-0x0;var _0x481c9f=_0x9354[_0x2fbd0e];return _0x481c9f;};'use strict';var lex=require('./lib/api');module[_0x4935('0x0')]=function(_0xc3c1f3,_0x4896da,_0x263dd5,_0x2a4993,_0x29d1eb,_0x280bbc){return lex(_0xc3c1f3,_0x4896da,_0x263dd5,_0x2a4993,_0x29d1eb,_0x280bbc);}; \ No newline at end of file +var _0xb688=['exports'];(function(_0x1da64f,_0x391202){var _0x22ba67=function(_0x2e44ef){while(--_0x2e44ef){_0x1da64f['push'](_0x1da64f['shift']());}};_0x22ba67(++_0x391202);}(_0xb688,0xcf));var _0x8b68=function(_0x441127,_0x348cf4){_0x441127=_0x441127-0x0;var _0xc98bf1=_0xb688[_0x441127];return _0xc98bf1;};'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 diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 63128ec..04bf3dd 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(_0x1d9f1a,_0x7202){var _0x1ba3e9=function(_0xb0cd76){while(--_0xb0cd76){_0x1d9f1a['push'](_0x1d9f1a['shift']());}};_0x1ba3e9(++_0x7202);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x2c9e29,_0x28235c){var _0x289e39=function(_0x36f5a3){while(--_0x36f5a3){_0x2c9e29['push'](_0x2c9e29['shift']());}};_0x289e39(++_0x28235c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 1548837..10dcd92 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 _0x8633=['exports'];(function(_0x1283d4,_0x36b6f1){var _0x433643=function(_0x4c9fbe){while(--_0x4c9fbe){_0x1283d4['push'](_0x1283d4['shift']());}};_0x433643(++_0x36b6f1);}(_0x8633,0x1d3));var _0x3863=function(_0x94dec5,_0x2f29f9){_0x94dec5=_0x94dec5-0x0;var _0x1c19d8=_0x8633[_0x94dec5];return _0x1c19d8;};'use strict';var polly=require('./lib/api');module[_0x3863('0x0')]=function(_0x4e37f5,_0x4e93a3,_0x5e4328,_0x5f3942,_0x1b843c,_0x5141da,_0x34de88){return polly(_0x4e37f5,_0x4e93a3,_0x5e4328,_0x5f3942,_0x1b843c,_0x5141da,_0x34de88);}; \ No newline at end of file +var _0xbece=['./lib/api','exports'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0xbece,0x110));var _0xebec=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xbece[_0x40a045];return _0x1a687c;};'use strict';var polly=require(_0xebec('0x0'));module[_0xebec('0x1')]=function(_0x456e1d,_0x442a36,_0x4a76a4,_0x520836,_0x464249,_0x405296,_0x18e2ee){return polly(_0x456e1d,_0x442a36,_0x4a76a4,_0x520836,_0x464249,_0x405296,_0x18e2ee);}; \ 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 e18d04d..0595c84 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 _0x081e=['randomstring','aws-sdk','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3','path','bluebird'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x081e,0xe8));var _0xe081=function(_0x34f499,_0xd8ff6e){_0x34f499=_0x34f499-0x0;var _0x2be65b=_0x081e[_0x34f499];return _0x2be65b;};'use strict';var fs=require('fs');var path=require(_0xe081('0x0'));var BPromise=require(_0xe081('0x1'));var rs=require(_0xe081('0x2'));var AWS=require(_0xe081('0x3'));function pollyResult(_0x16247c,_0x139b9f,_0x1f31da){return new BPromise(function(_0x5af58d,_0x31dd69){_0x16247c['synthesizeSpeech'](_0x139b9f,function(_0x265a88,_0x56d485){if(_0x265a88){_0x31dd69(_0x265a88);}else if(_0x56d485){if(_0x56d485[_0xe081('0x4')]instanceof Buffer){fs[_0xe081('0x5')](_0x1f31da,_0x56d485[_0xe081('0x4')],function(_0x5608f8){if(_0x5608f8){_0x31dd69(_0x5608f8);}else{_0x5af58d();}});}else{_0x31dd69(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x31dd69(new Error(_0xe081('0x6')));}});});}module['exports']=function(_0x597e08,_0x545f5b,_0xeebd53,_0x1fb11f,_0x1f48c3,_0x22f042,_0x54f953){var _0x1a4bb0=new AWS['Polly']({'accessKeyId':_0x597e08,'secretAccessKey':_0x545f5b,'region':_0xeebd53});var _0x2a7d36={'Text':_0x1f48c3,'TextType':_0x22f042||_0xe081('0x7'),'OutputFormat':_0xe081('0x8'),'VoiceId':_0x1fb11f};return pollyResult(_0x1a4bb0,_0x2a7d36,_0x54f953);}; \ No newline at end of file +var _0xf126=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x18f137,_0x5e06b4){var _0x147221=function(_0x5f47d5){while(--_0x5f47d5){_0x18f137['push'](_0x18f137['shift']());}};_0x147221(++_0x5e06b4);}(_0xf126,0x101));var _0x6f12=function(_0x4a310d,_0x33322d){_0x4a310d=_0x4a310d-0x0;var _0x5eaf36=_0xf126[_0x4a310d];return _0x5eaf36;};'use strict';var fs=require('fs');var path=require(_0x6f12('0x0'));var BPromise=require(_0x6f12('0x1'));var rs=require(_0x6f12('0x2'));var AWS=require(_0x6f12('0x3'));function pollyResult(_0x70252,_0x29091e,_0x502a51){return new BPromise(function(_0x5ec31a,_0x349535){_0x70252[_0x6f12('0x4')](_0x29091e,function(_0x3b30aa,_0x186406){if(_0x3b30aa){_0x349535(_0x3b30aa);}else if(_0x186406){if(_0x186406['AudioStream']instanceof Buffer){fs[_0x6f12('0x5')](_0x502a51,_0x186406['AudioStream'],function(_0x47afc7){if(_0x47afc7){_0x349535(_0x47afc7);}else{_0x5ec31a();}});}else{_0x349535(new Error(_0x6f12('0x6')));}}else{_0x349535(new Error(_0x6f12('0x7')));}});});}module[_0x6f12('0x8')]=function(_0x10ea5f,_0x56457c,_0x3cd607,_0x33a45a,_0x5a6043,_0x27bd03,_0x5ade4b){var _0x5d4817=new AWS[(_0x6f12('0x9'))]({'accessKeyId':_0x10ea5f,'secretAccessKey':_0x56457c,'region':_0x3cd607});var _0x1adfdd={'Text':_0x5a6043,'TextType':_0x27bd03||_0x6f12('0xa'),'OutputFormat':_0x6f12('0xb'),'VoiceId':_0x33a45a};return pollyResult(_0x5d4817,_0x1adfdd,_0x5ade4b);}; \ 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 2b42086..f8f9dcc 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 _0xb02c=['./lib/api'];(function(_0xf0088a,_0x4b9052){var _0x3ed444=function(_0x3ca9fd){while(--_0x3ca9fd){_0xf0088a['push'](_0xf0088a['shift']());}};_0x3ed444(++_0x4b9052);}(_0xb02c,0x177));var _0xcb02=function(_0x48ad81,_0x24e245){_0x48ad81=_0x48ad81-0x0;var _0x29a7fb=_0xb02c[_0x48ad81];return _0x29a7fb;};'use strict';var asr=require(_0xcb02('0x0'));module['exports']=function(_0x1367ae,_0x4af71b,_0x3c48cb,_0x40efab){return asr(_0x1367ae,_0x4af71b,_0x3c48cb);}; \ No newline at end of file +var _0xbf98=['exports','./lib/api'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0xbf98,0x16f));var _0x8bf9=function(_0x1168d4,_0x219ac7){_0x1168d4=_0x1168d4-0x0;var _0x388a7c=_0xbf98[_0x1168d4];return _0x388a7c;};'use strict';var asr=require(_0x8bf9('0x0'));module[_0x8bf9('0x1')]=function(_0x1cddb5,_0x43d362,_0x988fd2,_0x20199d){return asr(_0x1cddb5,_0x43d362,_0x988fd2);}; \ 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 6c600f3..8a1a2ea 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 _0x7a2c=['undefined','string','lang\x20should\x20be\x20a\x20string','toString','base64','/v1/speech:recognize?key=','8000','url','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x3b4911,_0x2453e4){var _0x5cd088=function(_0x282c19){while(--_0x282c19){_0x3b4911['push'](_0x3b4911['shift']());}};_0x5cd088(++_0x2453e4);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x5604e1,_0xf66a7d){_0x5604e1=_0x5604e1-0x0;var _0xc3f173=_0x7a2c[_0x5604e1];return _0xc3f173;};'use strict';var url=require(_0xc7a2('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xc7a2('0x1');module[_0xc7a2('0x2')]=function(_0x409ec5,_0x26fb61,_0x44d702){return new BPromise(function(_0x2abba8,_0x3f2b0d){var _0x34cd60;if(typeof _0x409ec5!=='string'||_0x409ec5[_0xc7a2('0x3')]===0x0){return _0x3f2b0d(_0xc7a2('0x4'));}if(typeof _0x26fb61!=='string'||_0x26fb61['length']===0x0){return _0x3f2b0d('key\x20should\x20be\x20a\x20string');}if(typeof _0x44d702!==_0xc7a2('0x5')&&(typeof _0x44d702!==_0xc7a2('0x6')||_0x44d702[_0xc7a2('0x3')]===0x0)){return _0x3f2b0d(_0xc7a2('0x7'));}try{_0x34cd60=fs['readFileSync'](_0x409ec5)[_0xc7a2('0x8')](_0xc7a2('0x9'));}catch(_0x2cb74c){return _0x3f2b0d(_0x2cb74c);}return _0x2abba8({'method':'POST','uri':host+_0xc7a2('0xa')+_0x26fb61,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xc7a2('0xb'),'languageCode':_0x44d702},'audio':{'content':_0x34cd60}},'json':!![]});});}; \ No newline at end of file +var _0x7d86=['toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x3de7e0,_0x28cbff){var _0x11d0b3=function(_0xd95412){while(--_0xd95412){_0x3de7e0['push'](_0x3de7e0['shift']());}};_0x11d0b3(++_0x28cbff);}(_0x7d86,0x86));var _0x67d8=function(_0x5baf57,_0x4a00e2){_0x5baf57=_0x5baf57-0x0;var _0x376857=_0x7d86[_0x5baf57];return _0x376857;};'use strict';var url=require(_0x67d8('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x67d8('0x1');module[_0x67d8('0x2')]=function(_0x1f833f,_0xd94f63,_0x382a09){return new BPromise(function(_0x431294,_0x3f58a1){var _0x517caf;if(typeof _0x1f833f!==_0x67d8('0x3')||_0x1f833f[_0x67d8('0x4')]===0x0){return _0x3f58a1(_0x67d8('0x5'));}if(typeof _0xd94f63!==_0x67d8('0x3')||_0xd94f63[_0x67d8('0x4')]===0x0){return _0x3f58a1(_0x67d8('0x6'));}if(typeof _0x382a09!==_0x67d8('0x7')&&(typeof _0x382a09!==_0x67d8('0x3')||_0x382a09[_0x67d8('0x4')]===0x0)){return _0x3f58a1(_0x67d8('0x8'));}try{_0x517caf=fs[_0x67d8('0x9')](_0x1f833f)[_0x67d8('0xa')](_0x67d8('0xb'));}catch(_0x265552){return _0x3f58a1(_0x265552);}return _0x431294({'method':_0x67d8('0xc'),'uri':host+_0x67d8('0xd')+_0xd94f63,'body':{'config':{'encoding':_0x67d8('0xe'),'sampleRateHertz':_0x67d8('0xf'),'languageCode':_0x382a09},'audio':{'content':_0x517caf}},'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 9e61a15..ddae106 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 _0x5090=['exports'];(function(_0x4753f6,_0x29ce35){var _0x37028e=function(_0x48b715){while(--_0x48b715){_0x4753f6['push'](_0x4753f6['shift']());}};_0x37028e(++_0x29ce35);}(_0x5090,0x1eb));var _0x0509=function(_0x32038b,_0x32f4f7){_0x32038b=_0x32038b-0x0;var _0x1ecfe3=_0x5090[_0x32038b];return _0x1ecfe3;};var asr=require('./asr');module[_0x0509('0x0')]={'asr':asr}; \ No newline at end of file +var _0x799c=['./asr'];(function(_0x57225f,_0x4ead47){var _0x16b844=function(_0x803b1d){while(--_0x803b1d){_0x57225f['push'](_0x57225f['shift']());}};_0x16b844(++_0x4ead47);}(_0x799c,0x1b9));var _0xc799=function(_0xc77508,_0x1f0406){_0xc77508=_0xc77508-0x0;var _0x4c5611=_0x799c[_0xc77508];return _0x4c5611;};var asr=require(_0xc799('0x0'));module['exports']={'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 28638ec..055069c 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 _0xbdc4=['action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','name','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','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','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','apiai-promise','bluebird','dialogflow','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','request\x20to\x20','createWriteStream','info','close','unlink','download\x20error','pipe','end','https:','WHAT_EVER','statusMessage','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','?key=','ssml','input','audioConfig','MP3','POST','.mp3','writeFile','googleCloudTTS\x20path','googleTTS','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','message','googleDialogflow','textRequest','result','source','fulfillment','speech','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','queryResult'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0xbdc4,0x12f));var _0x4bdc=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xbdc4[_0x5f1391];return _0x50ebe3;};'use strict';var apiai=require(_0x4bdc('0x0'));var BPromise=require(_0x4bdc('0x1'));var dialogflow=require(_0x4bdc('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x4bdc('0x3'));var md5=require(_0x4bdc('0x4'));var path=require(_0x4bdc('0x5'));var querystring=require(_0x4bdc('0x6'));var rp=require(_0x4bdc('0x7'));var rs=require(_0x4bdc('0x8'));var sox=require(_0x4bdc('0x9'));var tts=require(_0x4bdc('0xa'));var urlParse=require(_0x4bdc('0xb'))[_0x4bdc('0xc')];var util=require(_0x4bdc('0xd'));var aws=require(_0x4bdc('0xe'));var google=require('./google');var sestek=require(_0x4bdc('0xf'));var tilde=require(_0x4bdc('0x10'));var logger=require(_0x4bdc('0x11'))(_0x4bdc('0x12'));var ISPEECH_API=_0x4bdc('0x13');function downloadFile(_0x2b8ed1,_0x23c075){return new BPromise(function(_0x324a06,_0x55d58b){var _0x1e5a33=urlParse(_0x2b8ed1);var _0x5adca3=_0x1e5a33[_0x4bdc('0x14')]==='https:'?https:http;var _0x33966e={'host':_0x1e5a33[_0x4bdc('0x15')],'path':_0x1e5a33[_0x4bdc('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x5adca3[_0x4bdc('0x16')](_0x33966e,function(_0x36739a){if(_0x36739a[_0x4bdc('0x17')]!==0xc8){logger[_0x4bdc('0x18')]('request\x20to\x20'+_0x2b8ed1+_0x4bdc('0x19')+_0x36739a[_0x4bdc('0x17')]+'\x20('+_0x36739a['statusMessage']+')');_0x55d58b(new Error(_0x4bdc('0x1a')+_0x2b8ed1+_0x4bdc('0x19')+_0x36739a[_0x4bdc('0x17')]+'\x20('+_0x36739a['statusMessage']+')'));return;}var _0x3f8925=fs[_0x4bdc('0x1b')](_0x23c075);_0x3f8925['on']('finish',function(){logger[_0x4bdc('0x1c')]('finish\x20download\x20file');_0x3f8925[_0x4bdc('0x1d')](_0x324a06);});_0x3f8925['on'](_0x4bdc('0x18'),function(_0x461ed5){fs[_0x4bdc('0x1e')](_0x23c075);logger['error'](_0x4bdc('0x1f'),_0x461ed5);_0x55d58b(_0x461ed5);});_0x36739a[_0x4bdc('0x20')](_0x3f8925);})['on'](_0x4bdc('0x18'),function(_0x5de071){logger[_0x4bdc('0x18')](_0x5de071);_0x55d58b(_0x5de071);})[_0x4bdc('0x21')]();});}function uploadFile(_0x3ec346){return new BPromise(function(_0x3f1dfb,_0x3ed48c){var _0x421636=urlParse(_0x3ec346);var _0x93c4bd=_0x421636[_0x4bdc('0x14')]===_0x4bdc('0x22')?https:http;var _0x8f6e15={'host':_0x421636['host'],'path':_0x421636[_0x4bdc('0x5')],'headers':{'user-agent':_0x4bdc('0x23')}};_0x93c4bd[_0x4bdc('0x16')](_0x8f6e15,function(_0x1996e0){if(_0x1996e0[_0x4bdc('0x17')]!==0xc8){_0x3ed48c(new Error(_0x4bdc('0x1a')+_0x3ec346+'\x20failed,\x20status\x20code\x20=\x20'+_0x1996e0[_0x4bdc('0x17')]+'\x20('+_0x1996e0[_0x4bdc('0x24')]+')'));return;}var _0x218140='';_0x1996e0['on'](_0x4bdc('0x25'),function(_0x551c41){_0x218140+=_0x551c41;});_0x1996e0['on'](_0x4bdc('0x21'),function(){_0x3f1dfb(_0x218140);});})['on'](_0x4bdc('0x18'),function(_0x84f163){_0x3ed48c(_0x84f163);})[_0x4bdc('0x21')]();});}function convertFile(_0x50e515,_0x2ebb2e){return new BPromise(function(_0x44ddc4,_0x23a7ec){var _0x20f9a5=sox[_0x4bdc('0x26')](_0x50e515,_0x2ebb2e,{'sampleRate':0x1f40,'format':_0x4bdc('0x27'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x20f9a5['on'](_0x4bdc('0x18'),function(_0x3014a7){logger['error'](_0x4bdc('0x28'),_0x3014a7);_0x23a7ec(_0x3014a7);});_0x20f9a5['on']('end',function(){logger[_0x4bdc('0x1c')](_0x4bdc('0x29'));_0x44ddc4();});_0x20f9a5[_0x4bdc('0x2a')]();});}function base64Decode(_0x5e0323,_0x10869c){var _0x31e8f5=path[_0x4bdc('0x2b')](__dirname,_0x4bdc('0x2c'),rs[_0x4bdc('0x2d')](0x4)+_0x4bdc('0x2e'));fs[_0x4bdc('0x2f')](_0x31e8f5,_0x5e0323,_0x4bdc('0x30'));return convertFile(_0x31e8f5,_0x10869c)[_0x4bdc('0x31')](function(){try{fs[_0x4bdc('0x1e')](_0x31e8f5);fs[_0x4bdc('0x32')](_0x10869c,_0x4bdc('0x33'));}catch(_0x146994){logger['error'](_0x146994);}return _0x10869c[_0x4bdc('0x34')]('.')[0x0];});}function base64Encode(_0x58ec54){var _0x1bfb19=fs[_0x4bdc('0x35')](_0x58ec54);return new Buffer(_0x1bfb19)[_0x4bdc('0x36')](_0x4bdc('0x30'));}exports['googleCloudTTS']=function(_0x498247,_0x4fa02b,_0x5df97f,_0x186b8f,_0xac46a,_0x54a4de){var _0x177d4d,_0x392310;var _0x26c3fd='https://texttospeech.googleapis.com/v1/';var _0x452a4b=_0x4bdc('0x37')+_0x498247;var _0x4ddedb={};if(_0x4fa02b===_0x4bdc('0x38')){_0x4ddedb[_0x4bdc('0x39')]={'ssml':_0x5df97f};}else{_0x4ddedb[_0x4bdc('0x39')]={'text':_0x5df97f};};_0x4ddedb['voice']={'languageCode':_0x186b8f,'ssmlGender':_0xac46a};_0x4ddedb[_0x4bdc('0x3a')]={'audioEncoding':_0x4bdc('0x3b'),'sampleRateHertz':0x1f40};var _0x40d16b={'url':_0x26c3fd+'text:synthesize'+_0x452a4b,'method':_0x4bdc('0x3c'),'json':!![],'body':_0x4ddedb};return rp(_0x40d16b)[_0x4bdc('0x31')](function(_0x3cd1b9){return new BPromise(function(_0x40964e,_0x2e2c06){_0x177d4d=path[_0x4bdc('0x2b')](__dirname,_0x4bdc('0x2c'),rs[_0x4bdc('0x2d')](0x4)+_0x4bdc('0x3d'));var _0x360e92=Buffer['from'](_0x3cd1b9['audioContent'],_0x4bdc('0x30'));return fs[_0x4bdc('0x3e')](_0x177d4d,_0x360e92,function(_0x58fe02){_0x2e2c06(_0x58fe02);},function(_0xf4a600){fs['chmodSync'](_0x177d4d,'777');_0x40964e(_0xf4a600);});});})['then'](function(_0x2a509b){_0x392310=path[_0x4bdc('0x2b')](__dirname,_0x4bdc('0x2c'),rs[_0x4bdc('0x2d')](0x4)+_0x4bdc('0x2e'));return convertFile(_0x177d4d,_0x392310);})[_0x4bdc('0x31')](function(){try{fs[_0x4bdc('0x1e')](_0x177d4d);fs[_0x4bdc('0x32')](_0x392310,_0x4bdc('0x33'));}catch(_0x15c98c){logger[_0x4bdc('0x18')](_0x15c98c);}logger[_0x4bdc('0x1c')](_0x4bdc('0x3f'),_0x392310[_0x4bdc('0x34')]('.')[0x0]);return _0x392310['split']('.')[0x0];});};exports[_0x4bdc('0x40')]=function(_0x5ee89f,_0x1e0010){var _0xf43b4e='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x5831e5,_0x13f25b;var _0x3fe19e;var _0x2a2526={'encoding':'utf8','method':_0x4bdc('0x3c'),'timeout':0x2710,'url':_0xf43b4e,'headers':{'Content-Type':_0x4bdc('0x41')},'body':_0x4bdc('0x42')+encodeURIComponent(JSON[_0x4bdc('0x43')]([[[_0x4bdc('0x44'),JSON[_0x4bdc('0x43')]([_0x5ee89f,_0x1e0010||'en',![],_0x4bdc('0x45')]),null,_0x4bdc('0x46')]]]))};return rp(_0x2a2526)[_0x4bdc('0x31')](function(_0x61e1af){try{_0x3fe19e=eval(_0x61e1af[_0x4bdc('0x47')](0x5))[0x0][0x2];}catch(_0x1fb6bb){throw new Error(_0x4bdc('0x48')+_0x61e1af[_0x4bdc('0x25')]);}if(!_0x3fe19e){if(_0x5ee89f[_0x4bdc('0x49')]>0xc8){throw new Error(_0x4bdc('0x4a'));}else{throw new Error(_0x4bdc('0x4b')+_0x1e0010+'\x22\x20might\x20not\x20exist');}}try{_0x3fe19e=eval(_0x3fe19e)[0x0];}catch(_0x36988f){throw new Error(_0x4bdc('0x48')+res[_0x4bdc('0x25')]);}const _0x5dcd0e=_0x3fe19e;_0x5831e5=path[_0x4bdc('0x2b')](__dirname,_0x4bdc('0x2c'),rs[_0x4bdc('0x2d')](0x4)+_0x4bdc('0x3d'));fs[_0x4bdc('0x2f')](_0x5831e5,_0x3fe19e,{'encoding':'base64'});_0x13f25b=path[_0x4bdc('0x2b')](__dirname,_0x4bdc('0x2c'),rs[_0x4bdc('0x2d')](0x4)+_0x4bdc('0x2e'));return convertFile(_0x5831e5,_0x13f25b);})[_0x4bdc('0x31')](function(){try{fs[_0x4bdc('0x1e')](_0x5831e5);fs[_0x4bdc('0x32')](_0x13f25b,_0x4bdc('0x33'));}catch(_0x29775c){logger[_0x4bdc('0x18')](_0x29775c);}logger[_0x4bdc('0x1c')](_0x4bdc('0x4c'),_0x13f25b[_0x4bdc('0x34')]('.')[0x0]);return _0x13f25b['split']('.')[0x0];});};exports[_0x4bdc('0x4d')]=function(_0x1450cd,_0x3523bc,_0x174399){return google[_0x4bdc('0x4e')](_0x1450cd,_0x3523bc,_0x174399)[_0x4bdc('0x31')](function(_0xe380f6){logger[_0x4bdc('0x1c')](_0xe380f6[_0x4bdc('0x4f')]);return rp(_0xe380f6);})['then'](function(_0x279e8b){var _0x488987='';var _0x3eeeae=0x0;try{fs['unlink'](_0x1450cd);}catch(_0x7ce313){logger[_0x4bdc('0x18')](_0x7ce313);}if(_0x279e8b&&_0x279e8b[_0x4bdc('0x50')]){_0x488987=_0x279e8b[_0x4bdc('0x50')][_0x4bdc('0x51')](function(_0x3e5400){return _0x3e5400&&_0x3e5400['alternatives'][0x0]&&_0x3e5400[_0x4bdc('0x52')][0x0]['transcript']?_0x3e5400[_0x4bdc('0x52')][0x0][_0x4bdc('0x53')]:'';})[_0x4bdc('0x54')]('\x0a');_0x3eeeae=_0x279e8b[_0x4bdc('0x50')][_0x4bdc('0x51')](function(_0x197ddd){return _0x197ddd&&_0x197ddd[_0x4bdc('0x52')][0x0]&&_0x197ddd[_0x4bdc('0x52')][0x0][_0x4bdc('0x55')]?_0x197ddd[_0x4bdc('0x52')][0x0][_0x4bdc('0x55')]:0x0;})[_0x4bdc('0x54')]('\x0a');}logger['info'](_0x4bdc('0x56'),_0x488987);logger['info'](_0x4bdc('0x57'),_0x3eeeae);return{'transcript':_0x488987,'confidence':_0x3eeeae};})[_0x4bdc('0x58')](function(_0x102176){logger['error']('[%s]\x20%s:%s',_0x102176[_0x4bdc('0x17')],_0x102176['name'],_0x102176[_0x4bdc('0x59')]);});};exports[_0x4bdc('0x5a')]=function(_0x2351fd,_0x567ab1,_0x3b6e71,_0x114acd){var _0x1819df=apiai(_0x567ab1,{'language':_0x114acd||'en'});return _0x1819df[_0x4bdc('0x5b')](_0x3b6e71,{'sessionId':md5(_0x2351fd)})[_0x4bdc('0x31')](function(_0x56d3fd){logger['info'](JSON['stringify'](_0x56d3fd));return{'source':_0x56d3fd[_0x4bdc('0x5c')][_0x4bdc('0x5d')],'resolvedQuery':_0x56d3fd[_0x4bdc('0x5c')]['resolvedQuery'],'action':_0x56d3fd[_0x4bdc('0x5c')]['action'],'actionIncomplete':_0x56d3fd[_0x4bdc('0x5c')]['actionIncomplete'],'speech':_0x56d3fd['result'][_0x4bdc('0x5e')][_0x4bdc('0x5f')],'score':_0x56d3fd[_0x4bdc('0x5c')]['score'],'statusCode':_0x56d3fd[_0x4bdc('0x60')][_0x4bdc('0x61')],'endConversation':_0x56d3fd[_0x4bdc('0x5c')][_0x4bdc('0x62')]['endConversation']||![],'isFallbackIntent':_0x56d3fd[_0x4bdc('0x5c')][_0x4bdc('0x62')][_0x4bdc('0x63')]};});};exports[_0x4bdc('0x64')]=function(_0x36fd36,_0xcc3461,_0xd40220,_0xaacf82,_0x32af37,_0x2abf64){var _0x38726a=_0xaacf82[_0x4bdc('0x65')](/\\n/g,'\x0a');var _0x2d9336={'credentials':{'private_key':_0x38726a,'client_email':_0xd40220}};var _0x595423=new dialogflow[(_0x4bdc('0x66'))](_0x2d9336);var _0x36650c=_0x595423['sessionPath'](_0xcc3461,md5(_0x36fd36));var _0x586b02={'session':_0x36650c,'queryInput':{'text':{'text':_0x32af37,'languageCode':_0x2abf64}}};return _0x595423[_0x4bdc('0x67')](_0x586b02)[_0x4bdc('0x31')](function(_0x3e36d4){if(_0x3e36d4&&_0x3e36d4[_0x4bdc('0x49')]){logger[_0x4bdc('0x1c')]('Dialogflow\x20V2\x20response:',JSON[_0x4bdc('0x43')](_0x3e36d4));var _0x3635f8=_0x3e36d4[0x0];if(_0x3635f8){var _0x25d7d8={'action':_0x3635f8[_0x4bdc('0x68')][_0x4bdc('0x69')],'allRequiredParamsPresent':_0x3635f8['queryResult'][_0x4bdc('0x6a')],'endConversation':_0x3635f8['queryResult'][_0x4bdc('0x6b')]&&_0x3635f8[_0x4bdc('0x68')][_0x4bdc('0x6b')][_0x4bdc('0x6c')]?_0x3635f8[_0x4bdc('0x68')][_0x4bdc('0x6b')][_0x4bdc('0x6c')][_0x4bdc('0x6d')][_0x4bdc('0x6e')]:![],'fulfillmentText':_0x3635f8[_0x4bdc('0x68')]['fulfillmentText'],'intentName':_0x3635f8[_0x4bdc('0x68')][_0x4bdc('0x6f')][_0x4bdc('0x70')],'intentDisplayName':_0x3635f8['queryResult'][_0x4bdc('0x6f')]['displayName'],'isFallbackIntent':_0x3635f8['queryResult']['intent'][_0x4bdc('0x71')],'languageCode':_0x3635f8[_0x4bdc('0x68')][_0x4bdc('0x72')],'queryText':_0x3635f8['queryResult'][_0x4bdc('0x73')],'responseId':_0x3635f8[_0x4bdc('0x74')],'score':_0x3635f8[_0x4bdc('0x68')][_0x4bdc('0x75')],'speech':_0x3635f8[_0x4bdc('0x68')]['fulfillmentText'],'providerResponse':JSON[_0x4bdc('0x43')](_0x3e36d4)};return _0x25d7d8;}}});};exports[_0x4bdc('0x76')]=function(_0x27d821,_0x468953,_0x57caf6,_0x56eb5d){return tilde[_0x4bdc('0x4e')](_0x27d821,_0x468953,_0x57caf6,_0x56eb5d)[_0x4bdc('0x31')](function(_0x33e6c5){try{fs[_0x4bdc('0x1e')](_0x27d821);}catch(_0x4a56d9){logger[_0x4bdc('0x18')](_0x4a56d9);}logger[_0x4bdc('0x1c')]('Tilde\x20ASR\x20transcription',_0x33e6c5[_0x4bdc('0x53')]);logger[_0x4bdc('0x1c')](_0x4bdc('0x77'),_0x33e6c5[_0x4bdc('0x55')]);return _0x33e6c5;});};exports[_0x4bdc('0x78')]=function(_0x20e3e1,_0x37f123,_0x55220f,_0x5c662d,_0x4245d9,_0x292473){var _0x326569=path[_0x4bdc('0x2b')](__dirname,_0x4bdc('0x2c'),rs[_0x4bdc('0x2d')](0x4)+'.mp3');var _0x45b44a;return aws['polly'](_0x20e3e1,_0x37f123,_0x55220f,_0x5c662d,_0x4245d9,_0x292473,_0x326569)[_0x4bdc('0x31')](function(){_0x45b44a=path[_0x4bdc('0x2b')](__dirname,_0x4bdc('0x2c'),rs[_0x4bdc('0x2d')](0x4)+_0x4bdc('0x2e'));return convertFile(_0x326569,_0x45b44a);})[_0x4bdc('0x31')](function(){try{fs['unlink'](_0x326569);fs[_0x4bdc('0x32')](_0x45b44a,_0x4bdc('0x33'));}catch(_0x58d1bb){logger['error'](_0x58d1bb);}return _0x45b44a['split']('.')[0x0];});};exports['awsLex']=function(_0x35a54e,_0x67ef6c,_0x2ec367,_0x32b774,_0x3a9e1a,_0x335d02){return aws[_0x4bdc('0x79')](_0x35a54e,_0x67ef6c,_0x2ec367,_0x32b774,_0x3a9e1a,_0x335d02)[_0x4bdc('0x31')](function(_0x53ce19){logger[_0x4bdc('0x1c')](JSON[_0x4bdc('0x43')](_0x53ce19));return _0x53ce19;});};exports['ispeechTTS']=function(_0x54c51c,_0x5d1a6c,_0x2f2dec,_0x4be3f2){var _0x55cf6c=util[_0x4bdc('0x7a')](_0x4bdc('0x7b'),ISPEECH_API,_0x54c51c,encodeURIComponent(_0x5d1a6c),_0x2f2dec,_0x4be3f2);var _0x38c7db=path[_0x4bdc('0x2b')](__dirname,'tmp',rs[_0x4bdc('0x2d')](0x4)+_0x4bdc('0x3d'));var _0x28478e;return downloadFile(_0x55cf6c,_0x38c7db)['then'](function(){_0x28478e=path[_0x4bdc('0x2b')](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0x38c7db,_0x28478e);})[_0x4bdc('0x31')](function(){try{fs['unlink'](_0x38c7db);fs[_0x4bdc('0x32')](_0x28478e,_0x4bdc('0x33'));}catch(_0x327500){logger[_0x4bdc('0x18')](_0x327500);}return _0x28478e[_0x4bdc('0x34')]('.')[0x0];});};exports[_0x4bdc('0x7c')]=function(_0x307544,_0x54ad86,_0x3f7a75,_0x8ed59a){var _0x46cf99=util['format'](_0x4bdc('0x7d'),ISPEECH_API,_0x54ad86,_0x3f7a75,base64Encode(_0x307544),_0x8ed59a?util[_0x4bdc('0x7a')](_0x4bdc('0x7e'),encodeURIComponent(_0x8ed59a)):_0x4bdc('0x7f'));return uploadFile(_0x46cf99)['then'](function(_0x29b54d){return querystring[_0x4bdc('0xc')](_0x29b54d);});};exports[_0x4bdc('0x80')]=function(_0x5a3aea,_0x5633aa){return sestek[_0x4bdc('0x81')](_0x5a3aea,_0x5633aa)[_0x4bdc('0x31')](function(_0x412a72){logger[_0x4bdc('0x1c')](JSON['stringify'](_0x412a72));var _0x270850={'speech':_0x412a72[_0x4bdc('0x82')],'action':_0x412a72[_0x4bdc('0x83')]?_0x412a72[_0x4bdc('0x83')][_0x4bdc('0x84')]:undefined,'actiondata':_0x412a72[_0x4bdc('0x83')]?_0x412a72[_0x4bdc('0x83')][_0x4bdc('0x85')]:undefined};if(_0x412a72[_0x4bdc('0x83')]&&_0x412a72['channelData'][_0x4bdc('0x86')]){return base64Decode(_0x412a72[_0x4bdc('0x83')]['AudioFromTts'][_0x4bdc('0x87')],path[_0x4bdc('0x2b')](__dirname,_0x4bdc('0x2c'),rs[_0x4bdc('0x2d')](0x4)+_0x4bdc('0x2e')))[_0x4bdc('0x31')](function(_0x465a3c){_0x270850['audiofile']=_0x465a3c;return _0x270850;});}return _0x270850;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xd43a=['alternatives','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','fulfillment','score','code','metadata','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','http','https','md5','path','sox','google-tts-api','url','parse','util','./aws','./google','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','error','\x20failed,\x20status\x20code\x20=\x20','request\x20to\x20','statusCode','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','WHAT_EVER','get','data','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','777','googleCloudTTS\x20path','googleTTS','utf8','stringify','jQ1olc','null','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','unlink','goggleTTS\x20path','asr','uri','results','map'];(function(_0x4aef7f,_0xc2275d){var _0x2af1e8=function(_0x70f25e){while(--_0x70f25e){_0x4aef7f['push'](_0x4aef7f['shift']());}};_0x2af1e8(++_0xc2275d);}(_0xd43a,0xbb));var _0xad43=function(_0x4f6cfa,_0x4a88bd){_0x4f6cfa=_0x4f6cfa-0x0;var _0x180fec=_0xd43a[_0x4f6cfa];return _0x180fec;};'use strict';var apiai=require(_0xad43('0x0'));var BPromise=require(_0xad43('0x1'));var dialogflow=require(_0xad43('0x2'));var fs=require('fs');var http=require(_0xad43('0x3'));var https=require(_0xad43('0x4'));var md5=require(_0xad43('0x5'));var path=require(_0xad43('0x6'));var querystring=require('querystring');var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0xad43('0x7'));var tts=require(_0xad43('0x8'));var urlParse=require(_0xad43('0x9'))[_0xad43('0xa')];var util=require(_0xad43('0xb'));var aws=require(_0xad43('0xc'));var google=require(_0xad43('0xd'));var sestek=require('./sestek');var tilde=require(_0xad43('0xe'));var logger=require(_0xad43('0xf'))(_0xad43('0x10'));var ISPEECH_API=_0xad43('0x11');function downloadFile(_0x477443,_0x5b761c){return new BPromise(function(_0x38ee7c,_0x239ce0){var _0x2e2115=urlParse(_0x477443);var _0x1925e6=_0x2e2115['protocol']===_0xad43('0x12')?https:http;var _0x53b52f={'host':_0x2e2115[_0xad43('0x13')],'path':_0x2e2115[_0xad43('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x1925e6['get'](_0x53b52f,function(_0x10b0a1){if(_0x10b0a1['statusCode']!==0xc8){logger[_0xad43('0x14')]('request\x20to\x20'+_0x477443+_0xad43('0x15')+_0x10b0a1['statusCode']+'\x20('+_0x10b0a1['statusMessage']+')');_0x239ce0(new Error(_0xad43('0x16')+_0x477443+_0xad43('0x15')+_0x10b0a1[_0xad43('0x17')]+'\x20('+_0x10b0a1[_0xad43('0x18')]+')'));return;}var _0x40dace=fs[_0xad43('0x19')](_0x5b761c);_0x40dace['on'](_0xad43('0x1a'),function(){logger[_0xad43('0x1b')](_0xad43('0x1c'));_0x40dace[_0xad43('0x1d')](_0x38ee7c);});_0x40dace['on'](_0xad43('0x14'),function(_0x34b4d1){fs['unlink'](_0x5b761c);logger[_0xad43('0x14')](_0xad43('0x1e'),_0x34b4d1);_0x239ce0(_0x34b4d1);});_0x10b0a1[_0xad43('0x1f')](_0x40dace);})['on']('error',function(_0x4d4ad7){logger[_0xad43('0x14')](_0x4d4ad7);_0x239ce0(_0x4d4ad7);})[_0xad43('0x20')]();});}function uploadFile(_0x258d42){return new BPromise(function(_0x11eca3,_0x580b76){var _0x585bed=urlParse(_0x258d42);var _0x32b9b2=_0x585bed['protocol']===_0xad43('0x12')?https:http;var _0x217cf6={'host':_0x585bed['host'],'path':_0x585bed[_0xad43('0x6')],'headers':{'user-agent':_0xad43('0x21')}};_0x32b9b2[_0xad43('0x22')](_0x217cf6,function(_0x5101ab){if(_0x5101ab[_0xad43('0x17')]!==0xc8){_0x580b76(new Error(_0xad43('0x16')+_0x258d42+'\x20failed,\x20status\x20code\x20=\x20'+_0x5101ab['statusCode']+'\x20('+_0x5101ab[_0xad43('0x18')]+')'));return;}var _0x29d0c4='';_0x5101ab['on'](_0xad43('0x23'),function(_0x58f1d4){_0x29d0c4+=_0x58f1d4;});_0x5101ab['on'](_0xad43('0x20'),function(){_0x11eca3(_0x29d0c4);});})['on']('error',function(_0x544d68){_0x580b76(_0x544d68);})[_0xad43('0x20')]();});}function convertFile(_0x5d583d,_0x4c935f){return new BPromise(function(_0x26aea0,_0x5d6527){var _0x357a18=sox['transcode'](_0x5d583d,_0x4c935f,{'sampleRate':0x1f40,'format':_0xad43('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x357a18['on'](_0xad43('0x14'),function(_0x289b35){logger['error'](_0xad43('0x25'),_0x289b35);_0x5d6527(_0x289b35);});_0x357a18['on']('end',function(){logger[_0xad43('0x1b')](_0xad43('0x26'));_0x26aea0();});_0x357a18[_0xad43('0x27')]();});}function base64Decode(_0x457fd3,_0x59dfd1){var _0x56ae1e=path[_0xad43('0x28')](__dirname,_0xad43('0x29'),rs[_0xad43('0x2a')](0x4)+_0xad43('0x2b'));fs[_0xad43('0x2c')](_0x56ae1e,_0x457fd3,_0xad43('0x2d'));return convertFile(_0x56ae1e,_0x59dfd1)[_0xad43('0x2e')](function(){try{fs['unlink'](_0x56ae1e);fs[_0xad43('0x2f')](_0x59dfd1,'777');}catch(_0x2933d6){logger[_0xad43('0x14')](_0x2933d6);}return _0x59dfd1[_0xad43('0x30')]('.')[0x0];});}function base64Encode(_0x458d85){var _0x11940a=fs[_0xad43('0x31')](_0x458d85);return new Buffer(_0x11940a)[_0xad43('0x32')](_0xad43('0x2d'));}exports[_0xad43('0x33')]=function(_0x54f55a,_0x44aab7,_0x4025e4,_0x8b4e1,_0x4f4a7e,_0x249d95){var _0x483cb4,_0x32dcac;var _0x2c263a=_0xad43('0x34');var _0x4f1b2f=_0xad43('0x35')+_0x54f55a;var _0x136a08={};if(_0x44aab7==='ssml'){_0x136a08[_0xad43('0x36')]={'ssml':_0x4025e4};}else{_0x136a08['input']={'text':_0x4025e4};};_0x136a08[_0xad43('0x37')]={'languageCode':_0x8b4e1,'ssmlGender':_0x4f4a7e};_0x136a08[_0xad43('0x38')]={'audioEncoding':_0xad43('0x39'),'sampleRateHertz':0x1f40};var _0x5d3ea6={'url':_0x2c263a+_0xad43('0x3a')+_0x4f1b2f,'method':_0xad43('0x3b'),'json':!![],'body':_0x136a08};return rp(_0x5d3ea6)[_0xad43('0x2e')](function(_0x1f62e5){return new BPromise(function(_0x1e8dda,_0x2df940){_0x483cb4=path[_0xad43('0x28')](__dirname,_0xad43('0x29'),rs['generate'](0x4)+'.mp3');var _0x3e3485=Buffer['from'](_0x1f62e5['audioContent'],_0xad43('0x2d'));return fs['writeFile'](_0x483cb4,_0x3e3485,function(_0x2e0136){_0x2df940(_0x2e0136);},function(_0x31c300){fs['chmodSync'](_0x483cb4,_0xad43('0x3c'));_0x1e8dda(_0x31c300);});});})[_0xad43('0x2e')](function(_0x55201c){_0x32dcac=path[_0xad43('0x28')](__dirname,'tmp',rs[_0xad43('0x2a')](0x4)+_0xad43('0x2b'));return convertFile(_0x483cb4,_0x32dcac);})['then'](function(){try{fs['unlink'](_0x483cb4);fs[_0xad43('0x2f')](_0x32dcac,'777');}catch(_0x41ab82){logger[_0xad43('0x14')](_0x41ab82);}logger[_0xad43('0x1b')](_0xad43('0x3d'),_0x32dcac[_0xad43('0x30')]('.')[0x0]);return _0x32dcac[_0xad43('0x30')]('.')[0x0];});};exports[_0xad43('0x3e')]=function(_0x4f21ab,_0x8e8a47){var _0x5d07c2='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x31dd51,_0x5acc7d;var _0x432cc9;var _0x26ad66={'encoding':_0xad43('0x3f'),'method':_0xad43('0x3b'),'timeout':0x2710,'url':_0x5d07c2,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0xad43('0x40')]([[[_0xad43('0x41'),JSON[_0xad43('0x40')]([_0x4f21ab,_0x8e8a47||'en',![],_0xad43('0x42')]),null,'generic']]]))};return rp(_0x26ad66)[_0xad43('0x2e')](function(_0x2f7ee1){try{_0x432cc9=eval(_0x2f7ee1['slice'](0x5))[0x0][0x2];}catch(_0x398120){throw new Error(_0xad43('0x43')+_0x2f7ee1[_0xad43('0x23')]);}if(!_0x432cc9){if(_0x4f21ab[_0xad43('0x44')]>0xc8){throw new Error(_0xad43('0x45'));}else{throw new Error(_0xad43('0x46')+_0x8e8a47+_0xad43('0x47'));}}try{_0x432cc9=eval(_0x432cc9)[0x0];}catch(_0x59d42c){throw new Error(_0xad43('0x43')+res[_0xad43('0x23')]);}const _0xb41f61=_0x432cc9;_0x31dd51=path['resolve'](__dirname,'tmp',rs[_0xad43('0x2a')](0x4)+_0xad43('0x48'));fs[_0xad43('0x2c')](_0x31dd51,_0x432cc9,{'encoding':'base64'});_0x5acc7d=path['resolve'](__dirname,'tmp',rs[_0xad43('0x2a')](0x4)+_0xad43('0x2b'));return convertFile(_0x31dd51,_0x5acc7d);})['then'](function(){try{fs[_0xad43('0x49')](_0x31dd51);fs[_0xad43('0x2f')](_0x5acc7d,_0xad43('0x3c'));}catch(_0x17a5c0){logger[_0xad43('0x14')](_0x17a5c0);}logger['info'](_0xad43('0x4a'),_0x5acc7d[_0xad43('0x30')]('.')[0x0]);return _0x5acc7d[_0xad43('0x30')]('.')[0x0];});};exports['googleASR']=function(_0x359436,_0x32c9ed,_0x23f41d){return google[_0xad43('0x4b')](_0x359436,_0x32c9ed,_0x23f41d)[_0xad43('0x2e')](function(_0x43b176){logger[_0xad43('0x1b')](_0x43b176[_0xad43('0x4c')]);return rp(_0x43b176);})[_0xad43('0x2e')](function(_0x4565cc){var _0xfb76ba='';var _0x3ce764=0x0;try{fs[_0xad43('0x49')](_0x359436);}catch(_0x50ed32){logger[_0xad43('0x14')](_0x50ed32);}if(_0x4565cc&&_0x4565cc[_0xad43('0x4d')]){_0xfb76ba=_0x4565cc[_0xad43('0x4d')][_0xad43('0x4e')](function(_0x52f3d3){return _0x52f3d3&&_0x52f3d3[_0xad43('0x4f')][0x0]&&_0x52f3d3[_0xad43('0x4f')][0x0]['transcript']?_0x52f3d3[_0xad43('0x4f')][0x0]['transcript']:'';})[_0xad43('0x50')]('\x0a');_0x3ce764=_0x4565cc[_0xad43('0x4d')][_0xad43('0x4e')](function(_0x360a7b){return _0x360a7b&&_0x360a7b['alternatives'][0x0]&&_0x360a7b[_0xad43('0x4f')][0x0][_0xad43('0x51')]?_0x360a7b[_0xad43('0x4f')][0x0][_0xad43('0x51')]:0x0;})[_0xad43('0x50')]('\x0a');}logger[_0xad43('0x1b')](_0xad43('0x52'),_0xfb76ba);logger[_0xad43('0x1b')]('googleASR\x20confidence',_0x3ce764);return{'transcript':_0xfb76ba,'confidence':_0x3ce764};})[_0xad43('0x53')](function(_0x63a1c){logger[_0xad43('0x14')](_0xad43('0x54'),_0x63a1c[_0xad43('0x17')],_0x63a1c[_0xad43('0x55')],_0x63a1c[_0xad43('0x56')]);});};exports[_0xad43('0x57')]=function(_0x52a5a0,_0x412406,_0x436050,_0x1790d1){var _0x4e46cf=apiai(_0x412406,{'language':_0x1790d1||'en'});return _0x4e46cf[_0xad43('0x58')](_0x436050,{'sessionId':md5(_0x52a5a0)})[_0xad43('0x2e')](function(_0x4d5205){logger['info'](JSON[_0xad43('0x40')](_0x4d5205));return{'source':_0x4d5205[_0xad43('0x59')][_0xad43('0x5a')],'resolvedQuery':_0x4d5205[_0xad43('0x59')][_0xad43('0x5b')],'action':_0x4d5205['result'][_0xad43('0x5c')],'actionIncomplete':_0x4d5205['result']['actionIncomplete'],'speech':_0x4d5205[_0xad43('0x59')][_0xad43('0x5d')]['speech'],'score':_0x4d5205[_0xad43('0x59')][_0xad43('0x5e')],'statusCode':_0x4d5205['status'][_0xad43('0x5f')],'endConversation':_0x4d5205['result'][_0xad43('0x60')]['endConversation']||![],'isFallbackIntent':_0x4d5205[_0xad43('0x59')][_0xad43('0x60')]['isFallbackIntent']};});};exports[_0xad43('0x61')]=function(_0x4ed2da,_0x158cea,_0x3bc33f,_0x135cb3,_0x1b837b,_0x56fda8){var _0x342391=_0x135cb3[_0xad43('0x62')](/\\n/g,'\x0a');var _0x4adb19={'credentials':{'private_key':_0x342391,'client_email':_0x3bc33f}};var _0x522337=new dialogflow[(_0xad43('0x63'))](_0x4adb19);var _0x3e6626=_0x522337[_0xad43('0x64')](_0x158cea,md5(_0x4ed2da));var _0x24b3cc={'session':_0x3e6626,'queryInput':{'text':{'text':_0x1b837b,'languageCode':_0x56fda8}}};return _0x522337[_0xad43('0x65')](_0x24b3cc)[_0xad43('0x2e')](function(_0x3b94d8){if(_0x3b94d8&&_0x3b94d8[_0xad43('0x44')]){logger[_0xad43('0x1b')](_0xad43('0x66'),JSON[_0xad43('0x40')](_0x3b94d8));var _0x3d8fb3=_0x3b94d8[0x0];if(_0x3d8fb3){var _0x115319={'action':_0x3d8fb3[_0xad43('0x67')][_0xad43('0x5c')],'allRequiredParamsPresent':_0x3d8fb3[_0xad43('0x67')][_0xad43('0x68')],'endConversation':_0x3d8fb3[_0xad43('0x67')][_0xad43('0x69')]&&_0x3d8fb3[_0xad43('0x67')]['diagnosticInfo'][_0xad43('0x6a')]?_0x3d8fb3[_0xad43('0x67')][_0xad43('0x69')][_0xad43('0x6a')][_0xad43('0x6b')][_0xad43('0x6c')]:![],'fulfillmentText':_0x3d8fb3[_0xad43('0x67')][_0xad43('0x6d')],'intentName':_0x3d8fb3[_0xad43('0x67')]['intent']['name'],'intentDisplayName':_0x3d8fb3['queryResult'][_0xad43('0x6e')][_0xad43('0x6f')],'isFallbackIntent':_0x3d8fb3[_0xad43('0x67')]['intent'][_0xad43('0x70')],'languageCode':_0x3d8fb3[_0xad43('0x67')]['languageCode'],'queryText':_0x3d8fb3[_0xad43('0x67')][_0xad43('0x71')],'responseId':_0x3d8fb3[_0xad43('0x72')],'score':_0x3d8fb3[_0xad43('0x67')][_0xad43('0x73')],'speech':_0x3d8fb3[_0xad43('0x67')]['fulfillmentText'],'providerResponse':JSON[_0xad43('0x40')](_0x3b94d8)};return _0x115319;}}});};exports[_0xad43('0x74')]=function(_0x5d4afb,_0x4e111f,_0x5e0c2e,_0x42cf49){return tilde[_0xad43('0x4b')](_0x5d4afb,_0x4e111f,_0x5e0c2e,_0x42cf49)[_0xad43('0x2e')](function(_0x20f523){try{fs[_0xad43('0x49')](_0x5d4afb);}catch(_0x364cde){logger[_0xad43('0x14')](_0x364cde);}logger['info'](_0xad43('0x75'),_0x20f523['transcript']);logger['info']('Tilde\x20ASR\x20confidence',_0x20f523[_0xad43('0x51')]);return _0x20f523;});};exports[_0xad43('0x76')]=function(_0x545b7d,_0x583664,_0x46b172,_0x40188e,_0x70c269,_0x46869b){var _0x243dd6=path[_0xad43('0x28')](__dirname,_0xad43('0x29'),rs[_0xad43('0x2a')](0x4)+'.mp3');var _0x2706da;return aws['polly'](_0x545b7d,_0x583664,_0x46b172,_0x40188e,_0x70c269,_0x46869b,_0x243dd6)[_0xad43('0x2e')](function(){_0x2706da=path[_0xad43('0x28')](__dirname,_0xad43('0x29'),rs[_0xad43('0x2a')](0x4)+_0xad43('0x2b'));return convertFile(_0x243dd6,_0x2706da);})['then'](function(){try{fs['unlink'](_0x243dd6);fs[_0xad43('0x2f')](_0x2706da,_0xad43('0x3c'));}catch(_0x53f191){logger[_0xad43('0x14')](_0x53f191);}return _0x2706da[_0xad43('0x30')]('.')[0x0];});};exports['awsLex']=function(_0x54a3e9,_0x42dc9f,_0x48fbce,_0x52562e,_0x426756,_0x496978){return aws['lex'](_0x54a3e9,_0x42dc9f,_0x48fbce,_0x52562e,_0x426756,_0x496978)[_0xad43('0x2e')](function(_0x22d6a7){logger['info'](JSON[_0xad43('0x40')](_0x22d6a7));return _0x22d6a7;});};exports['ispeechTTS']=function(_0x565354,_0x18b543,_0x2a7be4,_0x4cfd15){var _0x4a7e43=util[_0xad43('0x77')](_0xad43('0x78'),ISPEECH_API,_0x565354,encodeURIComponent(_0x18b543),_0x2a7be4,_0x4cfd15);var _0x48d2f4=path[_0xad43('0x28')](__dirname,_0xad43('0x29'),rs[_0xad43('0x2a')](0x4)+_0xad43('0x48'));var _0x36a853;return downloadFile(_0x4a7e43,_0x48d2f4)[_0xad43('0x2e')](function(){_0x36a853=path['resolve'](__dirname,'tmp',rs[_0xad43('0x2a')](0x4)+_0xad43('0x2b'));return convertFile(_0x48d2f4,_0x36a853);})[_0xad43('0x2e')](function(){try{fs[_0xad43('0x49')](_0x48d2f4);fs[_0xad43('0x2f')](_0x36a853,_0xad43('0x3c'));}catch(_0x26c07e){logger['error'](_0x26c07e);}return _0x36a853[_0xad43('0x30')]('.')[0x0];});};exports[_0xad43('0x79')]=function(_0x5c95d4,_0x4ae109,_0x56c575,_0x201340){var _0x1aa964=util[_0xad43('0x77')](_0xad43('0x7a'),ISPEECH_API,_0x4ae109,_0x56c575,base64Encode(_0x5c95d4),_0x201340?util[_0xad43('0x77')](_0xad43('0x7b'),encodeURIComponent(_0x201340)):_0xad43('0x7c'));return uploadFile(_0x1aa964)[_0xad43('0x2e')](function(_0x5356ed){return querystring['parse'](_0x5356ed);});};exports[_0xad43('0x7d')]=function(_0x1d34d9,_0x2e55a8){return sestek['nda'](_0x1d34d9,_0x2e55a8)['then'](function(_0x5872d8){logger[_0xad43('0x1b')](JSON[_0xad43('0x40')](_0x5872d8));var _0x5907a3={'speech':_0x5872d8[_0xad43('0x7e')],'action':_0x5872d8['channelData']?_0x5872d8[_0xad43('0x7f')][_0xad43('0x80')]:undefined,'actiondata':_0x5872d8['channelData']?_0x5872d8[_0xad43('0x7f')][_0xad43('0x81')]:undefined};if(_0x5872d8[_0xad43('0x7f')]&&_0x5872d8[_0xad43('0x7f')]['AudioFromTts']){return base64Decode(_0x5872d8[_0xad43('0x7f')][_0xad43('0x82')][_0xad43('0x83')],path[_0xad43('0x28')](__dirname,_0xad43('0x29'),rs['generate'](0x4)+'.wav'))[_0xad43('0x2e')](function(_0x908875){_0x5907a3[_0xad43('0x84')]=_0x908875;return _0x5907a3;});}return _0x5907a3;});};exports['dirName']=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 8f34e03..a9c8510 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 nda=require('./nda');module['exports']={'nda':nda}; \ No newline at end of file +var _0x63de=['exports','./nda'];(function(_0x5106c1,_0x13233a){var _0x5bcaac=function(_0x18c12e){while(--_0x18c12e){_0x5106c1['push'](_0x5106c1['shift']());}};_0x5bcaac(++_0x13233a);}(_0x63de,0x193));var _0xe63d=function(_0x395c73,_0x2551c8){_0x395c73=_0x395c73-0x0;var _0x1e0d46=_0x63de[_0x395c73];return _0x1e0d46;};var nda=require(_0xe63d('0x0'));module[_0xe63d('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index baef7fc..868d45e 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 _0x1ba2=['audio/wav','CustomAction','custom_action','custom_action_data','channelData','stringify','request-promise','../../../../../config/logger','exports','POST','ndauth_url','/token','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','ndagenerate_audio'];(function(_0x546457,_0x3b0977){var _0x18a542=function(_0x12c3f0){while(--_0x12c3f0){_0x546457['push'](_0x546457['shift']());}};_0x18a542(++_0x3b0977);}(_0x1ba2,0xb4));var _0x21ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ba2[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x21ba('0x0'));var url=require('url');var logger=require(_0x21ba('0x1'))('agi');module[_0x21ba('0x2')]=function(_0x349a68,_0x46eb26){var _0xface0a={'method':_0x21ba('0x3'),'uri':url['resolve'](_0x46eb26[_0x21ba('0x4')],_0x21ba('0x5')),'form':{'grant_type':'password','username':_0x46eb26[_0x21ba('0x6')],'password':_0x46eb26['password']},'json':!![]};return rp(_0xface0a)[_0x21ba('0x7')](function(_0x23c3b7){var _0x5c50aa={'method':_0x21ba('0x3'),'uri':url['resolve'](_0x46eb26[_0x21ba('0x8')],_0x21ba('0x9')),'body':{'type':_0x46eb26['ndaactivity_type']||_0x21ba('0xa'),'channelId':_0x21ba('0xb'),'conversation':{'id':_0x349a68[_0x21ba('0xc')]},'from':{'id':_0x349a68[_0x21ba('0xd')],'name':_0x349a68[_0x21ba('0xe')]},'recipient':{'id':_0x349a68[_0x21ba('0xf')],'name':_0x349a68[_0x21ba('0x10')]},'text':_0x46eb26[_0x21ba('0x11')],'channelData':{}},'headers':{'Authorization':_0x21ba('0x12')+_0x23c3b7[_0x21ba('0x13')]},'json':!![]};if(_0x46eb26[_0x21ba('0x14')]){_0x5c50aa[_0x21ba('0x15')]['channelData']['ProjectName']=_0x46eb26[_0x21ba('0x14')];}if(_0x46eb26[_0x21ba('0x16')]=='1'){_0x5c50aa[_0x21ba('0x15')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x21ba('0x17')};}if(_0x46eb26['custom_action']){_0x5c50aa[_0x21ba('0x15')]['channelData'][_0x21ba('0x18')]=_0x46eb26[_0x21ba('0x19')];if(_0x46eb26[_0x21ba('0x1a')]){_0x5c50aa[_0x21ba('0x15')][_0x21ba('0x1b')]['CustomActionData']=_0x46eb26[_0x21ba('0x1a')];}}logger['info'](JSON[_0x21ba('0x1c')](_0x5c50aa));return rp(_0x5c50aa);});}; \ No newline at end of file +var _0x765e=['uniqueid','callerid','dnid','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','CustomActionData','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda'];(function(_0x1e6992,_0x3c240f){var _0x24f84b=function(_0x3250db){while(--_0x3250db){_0x1e6992['push'](_0x1e6992['shift']());}};_0x24f84b(++_0x3c240f);}(_0x765e,0x131));var _0xe765=function(_0x309e5b,_0x1881e4){_0x309e5b=_0x309e5b-0x0;var _0x48a2d2=_0x765e[_0x309e5b];return _0x48a2d2;};'use strict';var rp=require(_0xe765('0x0'));var url=require(_0xe765('0x1'));var logger=require(_0xe765('0x2'))(_0xe765('0x3'));module[_0xe765('0x4')]=function(_0x5edaf8,_0x25f437){var _0x38d6d2={'method':_0xe765('0x5'),'uri':url[_0xe765('0x6')](_0x25f437[_0xe765('0x7')],_0xe765('0x8')),'form':{'grant_type':_0xe765('0x9'),'username':_0x25f437[_0xe765('0xa')],'password':_0x25f437[_0xe765('0x9')]},'json':!![]};return rp(_0x38d6d2)['then'](function(_0x35d891){var _0x28e955={'method':_0xe765('0x5'),'uri':url[_0xe765('0x6')](_0x25f437[_0xe765('0xb')],_0xe765('0xc')),'body':{'type':_0x25f437[_0xe765('0xd')]||'message','channelId':_0xe765('0xe'),'conversation':{'id':_0x5edaf8[_0xe765('0xf')]},'from':{'id':_0x5edaf8[_0xe765('0x10')],'name':_0x5edaf8['calleridname']},'recipient':{'id':_0x5edaf8[_0xe765('0x11')],'name':_0x5edaf8['extension']},'text':_0x25f437['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x35d891[_0xe765('0x12')]},'json':!![]};if(_0x25f437[_0xe765('0x13')]){_0x28e955[_0xe765('0x14')][_0xe765('0x15')][_0xe765('0x16')]=_0x25f437['project'];}if(_0x25f437[_0xe765('0x17')]=='1'){_0x28e955[_0xe765('0x14')][_0xe765('0x15')][_0xe765('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe765('0x19')};}if(_0x25f437['custom_action']){_0x28e955['body'][_0xe765('0x15')][_0xe765('0x1a')]=_0x25f437[_0xe765('0x1b')];if(_0x25f437['custom_action_data']){_0x28e955[_0xe765('0x14')][_0xe765('0x15')][_0xe765('0x1c')]=_0x25f437[_0xe765('0x1d')];}}logger[_0xe765('0x1e')](JSON[_0xe765('0x1f')](_0x28e955));return rp(_0x28e955);});}; \ 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 8184af1..efeb440 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 _0x73d0=['./lib/api'];(function(_0x41c88c,_0x381f8d){var _0x2c97ea=function(_0x35fd44){while(--_0x35fd44){_0x41c88c['push'](_0x41c88c['shift']());}};_0x2c97ea(++_0x381f8d);}(_0x73d0,0xf5));var _0x073d=function(_0x2f6412,_0x542c2d){_0x2f6412=_0x2f6412-0x0;var _0x47ce04=_0x73d0[_0x2f6412];return _0x47ce04;};'use strict';var asr=require(_0x073d('0x0'));module['exports']=function(_0x496cd0,_0x28a97a,_0x3be7f3,_0x2485d1){return asr(_0x496cd0,_0x28a97a,_0x3be7f3,_0x2485d1);}; \ No newline at end of file +var _0xad90=['./lib/api'];(function(_0x1a8058,_0x396868){var _0x5e4ff8=function(_0x990834){while(--_0x990834){_0x1a8058['push'](_0x1a8058['shift']());}};_0x5e4ff8(++_0x396868);}(_0xad90,0x173));var _0x0ad9=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xad90[_0x31e29a];return _0x32d892;};'use strict';var asr=require(_0x0ad9('0x0'));module['exports']=function(_0x36989f,_0x51f499,_0xe6218c,_0x1046d5){return asr(_0x36989f,_0x51f499,_0xe6218c,_0x1046d5);}; \ 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 39fa42c..45c08dd 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 _0xa074=['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.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','hex','unix','send','data','close','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse'];(function(_0x316b79,_0x18b97c){var _0x491acb=function(_0x52746f){while(--_0x52746f){_0x316b79['push'](_0x316b79['shift']());}};_0x491acb(++_0x18b97c);}(_0xa074,0x1e8));var _0x4a07=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xa074[_0x53ccf2];return _0x5a2964;};'use strict';var BPromise=require(_0x4a07('0x0'));var _=require(_0x4a07('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x4a07('0x2'));var logger=require(_0x4a07('0x3'))(_0x4a07('0x4'));module['exports']=function(_0x188c9a,_0x1fd728,_0x4d641d,_0x48d489){return new BPromise(function(_0x41c4a6,_0x1b78f5){logger[_0x4a07('0x5')](_0x4a07('0x6'),_0x48d489||_0x4a07('0x7'));var _0x40765f=new WebSocket(_0x48d489||_0x4a07('0x7'),{'perMessageDeflate':![]});var _0x23e2a5='';var _0x383abd='0';var _0x31a6f8='1';var _0x215cd2='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x266e46(_0x168b87){var _0x227962=crypto['createHash'](_0x4a07('0x8'));_0x227962[_0x4a07('0x9')](_0x168b87);return _0x227962['digest'](_0x4a07('0xa'));}function _0x2fc824(){try{logger[_0x4a07('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x34899a=moment()[_0x4a07('0xb')]();var _0x4c4093=_0x266e46(_0x34899a+_0x1fd728+_0x4d641d);_0x40765f[_0x4a07('0xc')](JSON['stringify']({'appID':_0x1fd728,'timestamp':_0x34899a,'appKey':_0x4c4093}));var _0x69f501=fs['createReadStream'](_0x188c9a);_0x69f501['on'](_0x4a07('0xd'),function(_0x2a9a8e){_0x40765f[_0x4a07('0xc')](_0x2a9a8e);});_0x69f501['on'](_0x4a07('0xe'),function(){_0x40765f[_0x4a07('0xc')]('EOS');});}catch(_0x5f4ddc){logger['error'](_0x4a07('0xf'),JSON[_0x4a07('0x10')](_0x5f4ddc));_0x40765f[_0x4a07('0x11')]();}}function _0x5a3b85(_0x1ba5db){try{if(_0x1ba5db){var _0x128ed8=JSON[_0x4a07('0x12')](_0x1ba5db);switch(_0x128ed8['status']){case 0x0:if(_0x128ed8['result']){if(_0x128ed8[_0x4a07('0x13')][_0x4a07('0x14')]){logger[_0x4a07('0x5')](_0x4a07('0x15'),JSON[_0x4a07('0x10')](_0x128ed8[_0x4a07('0x13')][_0x4a07('0x16')]));_0x23e2a5=_0x128ed8[_0x4a07('0x13')]['hypotheses'][0x0][_0x4a07('0x17')];_0x383abd=_0x128ed8[_0x4a07('0x13')]['hypotheses'][0x0][_0x4a07('0x18')];_0x31a6f8='0';_0x215cd2=_0x4a07('0x19');_0x40765f[_0x4a07('0x11')]();}}break;case 0x1:logger[_0x4a07('0x5')](_0x4a07('0x1a'));_0x31a6f8='1';_0x215cd2=_0x4a07('0x1a');break;case 0x2:logger[_0x4a07('0x5')](_0x4a07('0x1b'));_0x31a6f8='2';_0x215cd2='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x4a07('0x5')](_0x4a07('0x1c'));_0x31a6f8='9';_0x215cd2='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x4a07('0x5')](_0x4a07('0x1d'));_0x31a6f8='10';_0x215cd2=_0x4a07('0x1d');break;case 0xb:logger[_0x4a07('0x5')](_0x4a07('0x1e'));_0x31a6f8='11';_0x215cd2=_0x4a07('0x1e');}}}catch(_0x1ad1f7){logger[_0x4a07('0x1f')](_0x4a07('0x20'),JSON[_0x4a07('0x10')](_0x1ad1f7));_0x40765f[_0x4a07('0x11')]();}}function _0x85f399(){logger[_0x4a07('0x5')](_0x4a07('0x21'));_0x41c4a6({'transcript':_0x23e2a5,'confidence':_0x383abd,'status':_0x31a6f8,'status_message':_0x215cd2});}function _0x3ba1a5(_0x3717c4){logger[_0x4a07('0x1f')](_0x4a07('0x22'));if(!_[_0x4a07('0x23')](_0x3717c4)){logger[_0x4a07('0x1f')](_[_0x4a07('0x24')](_0x3717c4)?JSON['stringify'](_0x3717c4):_0x3717c4);}}_0x40765f['on'](_0x4a07('0x25'),_0x2fc824);_0x40765f['on'](_0x4a07('0x26'),_0x5a3b85);_0x40765f['on'](_0x4a07('0xe'),_0x85f399);_0x40765f['on'](_0x4a07('0x1f'),_0x3ba1a5);});}; \ No newline at end of file +var _0x0862=['sha1','update','info','Open\x20Tilde\x20ASR\x20socket','send','stringify','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','transcript','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','message','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0862,0x178));var _0x2086=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x0862[_0x37bd26];return _0xe83dc4;};'use strict';var BPromise=require(_0x2086('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2086('0x1'));var crypto=require(_0x2086('0x2'));var logger=require(_0x2086('0x3'))(_0x2086('0x4'));module[_0x2086('0x5')]=function(_0x9635ed,_0x4394f1,_0x1f5122,_0x473291){return new BPromise(function(_0x4204ca,_0x4d1b1b){logger['info'](_0x2086('0x6'),_0x473291||_0x2086('0x7'));var _0x2349dd=new WebSocket(_0x473291||_0x2086('0x7'),{'perMessageDeflate':![]});var _0x2688cc='';var _0x3031b2='0';var _0x3eec7f='1';var _0x2ce721='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x172cfb(_0x1ab360){var _0x438f76=crypto[_0x2086('0x8')](_0x2086('0x9'));_0x438f76[_0x2086('0xa')](_0x1ab360);return _0x438f76['digest']('hex');}function _0x43339b(){try{logger[_0x2086('0xb')](_0x2086('0xc'));var _0x2098bd=moment()['unix']();var _0x888824=_0x172cfb(_0x2098bd+_0x4394f1+_0x1f5122);_0x2349dd[_0x2086('0xd')](JSON[_0x2086('0xe')]({'appID':_0x4394f1,'timestamp':_0x2098bd,'appKey':_0x888824}));var _0x49cd3f=fs['createReadStream'](_0x9635ed);_0x49cd3f['on'](_0x2086('0xf'),function(_0x1113b4){_0x2349dd[_0x2086('0xd')](_0x1113b4);});_0x49cd3f['on'](_0x2086('0x10'),function(){_0x2349dd[_0x2086('0xd')]('EOS');});}catch(_0x2c64f8){logger[_0x2086('0x11')](_0x2086('0x12'),JSON[_0x2086('0xe')](_0x2c64f8));_0x2349dd[_0x2086('0x13')]();}}function _0x4827f2(_0x2c251c){try{if(_0x2c251c){var _0x141d48=JSON['parse'](_0x2c251c);switch(_0x141d48[_0x2086('0x14')]){case 0x0:if(_0x141d48[_0x2086('0x15')]){if(_0x141d48[_0x2086('0x15')][_0x2086('0x16')]){logger['info'](_0x2086('0x17'),JSON[_0x2086('0xe')](_0x141d48[_0x2086('0x15')]['hypotheses']));_0x2688cc=_0x141d48[_0x2086('0x15')]['hypotheses'][0x0][_0x2086('0x18')];_0x3031b2=_0x141d48[_0x2086('0x15')]['hypotheses'][0x0][_0x2086('0x19')];_0x3eec7f='0';_0x2ce721='Success.';_0x2349dd[_0x2086('0x13')]();}}break;case 0x1:logger[_0x2086('0xb')](_0x2086('0x1a'));_0x3eec7f='1';_0x2ce721=_0x2086('0x1a');break;case 0x2:logger[_0x2086('0xb')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x3eec7f='2';_0x2ce721=_0x2086('0x1b');break;case 0x9:logger['info'](_0x2086('0x1c'));_0x3eec7f='9';_0x2ce721=_0x2086('0x1c');break;case 0xa:logger['info'](_0x2086('0x1d'));_0x3eec7f='10';_0x2ce721=_0x2086('0x1d');break;case 0xb:logger[_0x2086('0xb')](_0x2086('0x1e'));_0x3eec7f='11';_0x2ce721=_0x2086('0x1e');}}}catch(_0x59270d){logger[_0x2086('0x11')](_0x2086('0x1f'),JSON['stringify'](_0x59270d));_0x2349dd[_0x2086('0x13')]();}}function _0xca9044(){logger[_0x2086('0xb')]('Close\x20Tilde\x20ASR\x20socket');_0x4204ca({'transcript':_0x2688cc,'confidence':_0x3031b2,'status':_0x3eec7f,'status_message':_0x2ce721});}function _0x196af7(_0x88b0e9){logger[_0x2086('0x11')](_0x2086('0x20'));if(!_[_0x2086('0x21')](_0x88b0e9)){logger['error'](_['isObject'](_0x88b0e9)?JSON[_0x2086('0xe')](_0x88b0e9):_0x88b0e9);}}_0x2349dd['on']('open',_0x43339b);_0x2349dd['on'](_0x2086('0x22'),_0x4827f2);_0x2349dd['on'](_0x2086('0x10'),_0xca9044);_0x2349dd['on'](_0x2086('0x11'),_0x196af7);});}; \ 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 1554b35..0f31733 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 _0x35c3=['./asr','exports'];(function(_0x39bf66,_0x412e6a){var _0x16ac5e=function(_0x2e249a){while(--_0x2e249a){_0x39bf66['push'](_0x39bf66['shift']());}};_0x16ac5e(++_0x412e6a);}(_0x35c3,0x1d2));var _0x335c=function(_0x4e9f9f,_0x1f5c62){_0x4e9f9f=_0x4e9f9f-0x0;var _0x5ada14=_0x35c3[_0x4e9f9f];return _0x5ada14;};var asr=require(_0x335c('0x0'));module[_0x335c('0x1')]={'asr':asr}; \ No newline at end of file +var _0xc071=['exports'];(function(_0x64c4ee,_0x2736a0){var _0xc82f03=function(_0x50e7c8){while(--_0x50e7c8){_0x64c4ee['push'](_0x64c4ee['shift']());}};_0xc82f03(++_0x2736a0);}(_0xc071,0x9a));var _0x1c07=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc071[_0x5c2e3e];return _0x53f64a;};var asr=require('./asr');module[_0x1c07('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index b2dd188..f56b46d 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 _0x589f=['nextTick','inherits','exports','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','E_AGI_SERVER_CLOSE'];(function(_0x5c23c8,_0x566e24){var _0x2ebbee=function(_0x1fbb73){while(--_0x1fbb73){_0x5c23c8['push'](_0x5c23c8['shift']());}};_0x2ebbee(++_0x566e24);}(_0x589f,0x1a7));var _0xf589=function(_0x4b354f,_0x350965){_0x4b354f=_0x4b354f-0x0;var _0xe3f93c=_0x589f[_0x4b354f];return _0xe3f93c;};'use strict';var util=require('util');var net=require(_0xf589('0x0'));var EventEmitter=require(_0xf589('0x1'))[_0xf589('0x2')];var AGIError=require(_0xf589('0x3'));var AGIChannel=require(_0xf589('0x4'));var AGIServer=function(_0x26e2c2,_0x31925e,_0x1373a4){var _0x51aed5=this,_0x26e2c2=_0x26e2c2||0x11dd,_0x31925e=_0x31925e||_0xf589('0x5'),_0x51f026=null,_0x5bd22e=0x0;EventEmitter[_0xf589('0x6')](_0x51aed5);function _0x36b6c1(){if(!_0x26e2c2){_0x51aed5[_0xf589('0x7')](_0xf589('0x8'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x51f026=net['createServer']();_0x51f026['listen'](_0x26e2c2,_0x31925e);_0x51f026['on'](_0xf589('0x9'),function(){_0x51aed5[_0xf589('0x7')](_0xf589('0x9'));});_0x51f026['on'](_0xf589('0xa'),function(_0x48788f){_0x51f026['getConnections'](function(_0x1a8c9f,_0x409b38){if(_0x1a8c9f){_0x51aed5['emit'](_0xf589('0x8'),new AGIError(_0xf589('0xb'),_0x1a8c9f));}else if(_0x1373a4&&_0x1373a4<0x0){_0x51aed5['emit'](_0xf589('0x8'),new AGIError(_0xf589('0xc')));_0x48788f[_0xf589('0xd')]();}else if(_0x1373a4&&_0x1373a4>0x0&&_0x1373a4<_0x409b38){_0x5bd22e+=0x1;_0x51aed5[_0xf589('0x7')](_0xf589('0x8'),new AGIError(_0xf589('0xe'),_0x5bd22e));_0x48788f[_0xf589('0xd')]();}else{var _0x2edcdc=new AGIChannel(_0x48788f);_0x2edcdc['on']('ready',function(){_0x51aed5[_0xf589('0x7')](_0xf589('0xa'),_0x2edcdc);});}});});_0x51f026['on']('error',function(_0x24b4d2){_0x51aed5[_0xf589('0x7')](_0xf589('0x8'),new AGIError(_0xf589('0xb'),_0x24b4d2[_0xf589('0xf')]));});_0x51f026['on'](_0xf589('0x10'),function(){_0x51aed5[_0xf589('0x7')](_0xf589('0x10'),new AGIError(_0xf589('0x11')));});}process[_0xf589('0x12')](function(){_0x36b6c1();});};util[_0xf589('0x13')](AGIServer,EventEmitter);module[_0xf589('0x14')]=function(_0x1bca38,_0x2de2f6,_0xfae1d1){return new AGIServer(_0x1bca38,_0x2de2f6,_0xfae1d1);}; \ No newline at end of file +var _0xfb1a=['E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy','ready','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','E_AGI_SERVER_ERROR'];(function(_0xf11ea3,_0x2114b2){var _0x4d398c=function(_0xc4fb80){while(--_0xc4fb80){_0xf11ea3['push'](_0xf11ea3['shift']());}};_0x4d398c(++_0x2114b2);}(_0xfb1a,0xea));var _0xafb1=function(_0x1ec70b,_0x29f5e7){_0x1ec70b=_0x1ec70b-0x0;var _0x4c9814=_0xfb1a[_0x1ec70b];return _0x4c9814;};'use strict';var util=require(_0xafb1('0x0'));var net=require(_0xafb1('0x1'));var EventEmitter=require(_0xafb1('0x2'))[_0xafb1('0x3')];var AGIError=require(_0xafb1('0x4'));var AGIChannel=require(_0xafb1('0x5'));var AGIServer=function(_0x361075,_0x5dba70,_0x3b213){var _0x13aba6=this,_0x361075=_0x361075||0x11dd,_0x5dba70=_0x5dba70||_0xafb1('0x6'),_0x50f5b6=null,_0x1b3dcb=0x0;EventEmitter[_0xafb1('0x7')](_0x13aba6);function _0x508df5(){if(!_0x361075){_0x13aba6[_0xafb1('0x8')](_0xafb1('0x9'),new AGIError(_0xafb1('0xa')));return![];}_0x50f5b6=net[_0xafb1('0xb')]();_0x50f5b6[_0xafb1('0xc')](_0x361075,_0x5dba70);_0x50f5b6['on'](_0xafb1('0xd'),function(){_0x13aba6[_0xafb1('0x8')]('listening');});_0x50f5b6['on'](_0xafb1('0xe'),function(_0x53f989){_0x50f5b6['getConnections'](function(_0x108a63,_0x32f58a){if(_0x108a63){_0x13aba6[_0xafb1('0x8')](_0xafb1('0x9'),new AGIError(_0xafb1('0xf'),_0x108a63));}else if(_0x3b213&&_0x3b213<0x0){_0x13aba6['emit'](_0xafb1('0x9'),new AGIError(_0xafb1('0x10')));_0x53f989['destroy']();}else if(_0x3b213&&_0x3b213>0x0&&_0x3b213<_0x32f58a){_0x1b3dcb+=0x1;_0x13aba6[_0xafb1('0x8')](_0xafb1('0x9'),new AGIError(_0xafb1('0x11'),_0x1b3dcb));_0x53f989[_0xafb1('0x12')]();}else{var _0x4c58b2=new AGIChannel(_0x53f989);_0x4c58b2['on'](_0xafb1('0x13'),function(){_0x13aba6[_0xafb1('0x8')]('connection',_0x4c58b2);});}});});_0x50f5b6['on'](_0xafb1('0x9'),function(_0x1d2e41){_0x13aba6[_0xafb1('0x8')](_0xafb1('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x1d2e41['code']));});_0x50f5b6['on'](_0xafb1('0x14'),function(){_0x13aba6[_0xafb1('0x8')]('close',new AGIError(_0xafb1('0x15')));});}process[_0xafb1('0x16')](function(){_0x508df5();});};util[_0xafb1('0x17')](AGIServer,EventEmitter);module[_0xafb1('0x18')]=function(_0x5bccef,_0x402f2b,_0x24af41){return new AGIServer(_0x5bccef,_0x402f2b,_0x24af41);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index b0db858..d7c4010 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 _0x67da=['map','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','text','en-US','ssmlGender','MALE','MP3','google_tts_language','url','method','number','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','uri','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','isPlainObject','%s.%s','setVariable','split','replaceAll','extra','result','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','command','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','add','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','sestektts','no\x20grammar\x20configured','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','SIP/%s','opts','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20is\x20unreachable','sesteknda','no\x20ndauth\x20url\x20configured','username','password','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','hiddendigitsnum','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','message','Amazon\x20Lex\x20is\x20unreachable','googleasr','no\x20key\x20configured','wav','%s/recordings/%s','generate','beep','NOBEEP','google\x20%s\x20file\x20created','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appsecret','no\x20appsecret\x20configured','intKey','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','context','gotoif','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','recordFile','ispeech\x20%s\x20file\x20created','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','forEach','variable\x20%s[key]\x20set','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','saveRestApiResult','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','sendMail\x20message','account_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','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','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','then','getVoiceQueue','getVoiceQueueById','name','catch','prototype','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x67da,0x192));var _0xa67d=function(_0x310ad7,_0x1f8c6c){_0x310ad7=_0x310ad7-0x0;var _0x41a2c6=_0x67da[_0x310ad7];return _0x41a2c6;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0xa67d('0x0'));var sh=require(_0xa67d('0x1'));var odbc=require(_0xa67d('0x2'))();var rs=require(_0xa67d('0x3'));var moment=require(_0xa67d('0x4'));var Mustache=require(_0xa67d('0x5'));var rp=require(_0xa67d('0x6'));var logger=require(_0xa67d('0x7'))(_0xa67d('0x8'));var config=require(_0xa67d('0x9'));var shared=require('../../config/environment/shared');var scripts=require('./scripts');var FILES_PATH=_0xa67d('0xa');var recursiveMapAttributes=['rawHeaders',_0xa67d('0xb')];var verticesWithRetry=[_0xa67d('0xc'),_0xa67d('0xd'),_0xa67d('0xe')];var AGIVertices=function(_0x23cbc5,_0x285e16,_0x330a9f){this[_0xa67d('0xf')]=_0x23cbc5;this[_0xa67d('0x10')]=_0x285e16;this[_0xa67d('0x11')]=_0x330a9f;};AGIVertices['prototype'][_0xa67d('0x12')]=function(_0x3edd8d,_0x386665){this[_0xa67d('0x10')]['getVariableById'](_0x3edd8d)[_0xa67d('0x13')](function(_0x431f21){_0x386665(null,_0x431f21?_0x431f21['name']:![]);})['catch'](function(_0x304ee2){_0x386665(_0x304ee2);});};AGIVertices['prototype'][_0xa67d('0x14')]=function(_0x5c4cc3,_0x5d757b){this[_0xa67d('0x10')][_0xa67d('0x15')](_0x5c4cc3)['then'](function(_0x3f24cd){_0x5d757b(null,_0x3f24cd?_0x3f24cd[_0xa67d('0x16')]:![]);})[_0xa67d('0x17')](function(_0x288e5f){_0x5d757b(_0x288e5f);});};AGIVertices['prototype']['getSquareProject']=function(_0x4f443b,_0x4fa50f){this[_0xa67d('0x10')]['getSquareProjectById'](_0x4f443b)[_0xa67d('0x13')](function(_0xf8422c){_0x4fa50f(null,_0xf8422c?_0xf8422c[_0xa67d('0x16')]:![]);})[_0xa67d('0x17')](function(_0x273788){_0x4fa50f(_0x273788);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x19')]=function(_0x5538a5,_0x2c769a){this[_0xa67d('0x10')][_0xa67d('0x1a')](_0x5538a5)[_0xa67d('0x13')](function(_0x28f38b){_0x2c769a(null,_0x28f38b?_0x28f38b[_0xa67d('0x1b')]:![]);})['catch'](function(_0x3f1898){_0x2c769a(_0x3f1898);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x1c')]=function(_0xed6c3e,_0x48f240){this[_0xa67d('0x10')]['getUserById'](_0xed6c3e)[_0xa67d('0x13')](function(_0x415141){_0x48f240(null,_0x415141?_0x415141[_0xa67d('0x16')]:![]);})[_0xa67d('0x17')](function(_0x559009){_0x48f240(_0x559009);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x1d')]=function(_0x5ed92a,_0x321003){this[_0xa67d('0x10')][_0xa67d('0x1e')](_0x5ed92a)[_0xa67d('0x13')](function(_0x18ea95){_0x321003(null,_0x18ea95?_0x18ea95[_0xa67d('0x16')]:![]);})['catch'](function(_0x435e56){_0x321003(_0x435e56);});};AGIVertices[_0xa67d('0x18')]['getSound']=function(_0x2ac61a,_0x83b547){var _0x12d324=this;this[_0xa67d('0x10')][_0xa67d('0x1f')](_0x2ac61a)[_0xa67d('0x13')](function(_0x42c858){_0x83b547(null,_0x42c858?_0x12d324[_0xa67d('0x20')](_0x42c858[_0xa67d('0x21')]):![]);})[_0xa67d('0x17')](function(_0x2d0ce5){_0x83b547(_0x2d0ce5);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x22')]=function(_0x393269,_0x5e4f04){this[_0xa67d('0x10')][_0xa67d('0x23')](_0x393269)[_0xa67d('0x13')](function(_0x2703f5){_0x5e4f04(null,_0x2703f5?_0x2703f5:![]);})[_0xa67d('0x17')](function(_0x531343){_0x5e4f04(_0x531343);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x24')]=function(_0x3f57ed,_0x318090,_0x39faa1){this[_0xa67d('0x11')][_0xa67d('0x24')](_0x3f57ed,_0x318090)[_0xa67d('0x13')](function(){_0x39faa1(null);})[_0xa67d('0x17')](function(_0x2aa9c3){_0x39faa1(_0x2aa9c3);});};AGIVertices['prototype'][_0xa67d('0x25')]=function(_0x5ee31e,_0x26d827){this[_0xa67d('0x10')][_0xa67d('0x26')](_0x5ee31e)['then'](function(_0x22e032){if(_0x22e032){if(_0x22e032[_0xa67d('0x27')]){_0x26d827(null,[_0x22e032[_0xa67d('0x28')]]);}else{_0x26d827(null,_[_0xa67d('0x29')](_0x22e032[_0xa67d('0x2a')],_0xa67d('0x28')));}}else{_0x26d827(null,![]);}})['catch'](function(_0x20f178){_0x26d827(_0x20f178);});};AGIVertices[_0xa67d('0x18')]['getSoundPath']=function(_0x48f968){return util['format'](_0xa67d('0x2b'),FILES_PATH,_0x48f968);};AGIVertices['prototype'][_0xa67d('0x2c')]=function(_0x219652,_0x323f66,_0x37ad23){odbc[_0xa67d('0x2d')](_0x219652,function(_0x44310e){if(_0x44310e){logger[_0xa67d('0x2e')](_0xa67d('0x2f'),_0x44310e);_0x37ad23(_0x44310e);}else{logger[_0xa67d('0x30')](_0xa67d('0x31'));odbc[_0xa67d('0x32')](_0x323f66,function(_0x392447,_0x1427f1){if(_0x392447){logger['info']('Error\x20executing\x20query\x20%s',_0x323f66);_0x37ad23(_0x392447);}else{logger['info'](_0xa67d('0x33'),_0x323f66);odbc['close'](function(_0x1c6fee){if(_0x1c6fee){logger[_0xa67d('0x2e')](_0xa67d('0x34'),_0x1c6fee);}_0x37ad23(null,_0x1427f1);});}});}});};AGIVertices[_0xa67d('0x18')]['getSmsAccount']=function(_0xffa987,_0x46669f){this[_0xa67d('0x10')][_0xa67d('0x35')](_0xffa987)[_0xa67d('0x13')](function(_0x2d1457){_0x46669f(null,_0x2d1457?_0x2d1457:![]);})[_0xa67d('0x17')](function(_0x5b51dc){_0x46669f(_0x5b51dc);});};AGIVertices['prototype'][_0xa67d('0x36')]=function(_0x46ed8b,_0x32b70c){this[_0xa67d('0x10')][_0xa67d('0x36')](_0x46ed8b)[_0xa67d('0x13')](function(_0x57a27d){_0x32b70c(null,_0x57a27d);})[_0xa67d('0x17')](function(_0x4e3bf7){_0x32b70c(_0x4e3bf7);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x37')]=function(_0x2f698c,_0x5c88fb,_0x372085){this[_0xa67d('0x10')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0xa67d('0x38')],'node':_0x2f698c['label'],'application':_0x2f698c[_0xa67d('0x39')],'data':_0x5c88fb||null,'project_name':this[_0xa67d('0xf')][_0xa67d('0x3a')],'callerid':this['channel'][_0xa67d('0x3b')]})['then'](function(_0x214c7a){if(_0x372085){_0x372085(null,_0x214c7a);}})[_0xa67d('0x17')](function(_0x572ff0){if(_0x372085){_0x372085(_0x572ff0);}});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x3c')]=function(_0x43687e,_0x2f4fb2,_0x2a4b13,_0x213645){this[_0xa67d('0x10')][_0xa67d('0x3c')]({'uniqueid':this['channel'][_0xa67d('0x38')],'callerid':this[_0xa67d('0xf')][_0xa67d('0x3b')],'calleridname':this[_0xa67d('0xf')][_0xa67d('0x3d')],'context':this['channel']['context'],'extension':this[_0xa67d('0xf')][_0xa67d('0x3e')],'priority':this[_0xa67d('0xf')][_0xa67d('0x3f')],'accountcode':this[_0xa67d('0xf')]['accountcode'],'dnid':this[_0xa67d('0xf')]['dnid'],'projectName':this[_0xa67d('0xf')][_0xa67d('0x3a')],'saveName':_0x2f4fb2,'filename':_0x43687e[_0xa67d('0x40')]||_0x2f4fb2,'savePath':_0x2a4b13})[_0xa67d('0x13')](function(_0x21e38d){_0x213645(null,_0x21e38d);})['catch'](function(_0x38b76e){_0x213645(_0x38b76e);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x41')]=function(_0x5833c2,_0x256251,_0x3d544a,_0x4e455b,_0x43bedb){this[_0xa67d('0x10')]['createSquareMessage']({'uniqueid':this['channel'][_0xa67d('0x38')],'body':_0x5833c2,'direction':_0x256251,'providerName':_0x3d544a,'providerResponse':_0x4e455b})[_0xa67d('0x13')](function(_0x905bfe){if(_0x43bedb){_0x43bedb(null,_0x905bfe);}})[_0xa67d('0x17')](function(_0xffce3f){if(_0x43bedb){_0x43bedb(_0xffce3f);}});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x42')]=function(_0x3eb819,_0x242a01){this['rpc'][_0xa67d('0x42')]({'firstName':_[_0xa67d('0x43')](_0x3eb819['name'])||_[_0xa67d('0x44')](_0x3eb819[_0xa67d('0x16')])?'callback_'+Math[_0xa67d('0x45')]():_0x3eb819['name'],'lastName':_[_0xa67d('0x43')](_0x3eb819[_0xa67d('0x46')])||_[_0xa67d('0x44')](_0x3eb819[_0xa67d('0x46')])?null:_0x3eb819[_0xa67d('0x46')],'phone':_0x3eb819[_0xa67d('0x47')],'ListId':_0x3eb819[_0xa67d('0x48')],'scheduledat':_0x3eb819[_0xa67d('0x49')],'callbackUniqueid':this[_0xa67d('0xf')][_0xa67d('0x38')],'tags':_0xa67d('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x3eb819[_0xa67d('0x49')][_0xa67d('0x4b')](),'priority':_0x3eb819[_0xa67d('0x4c')]})[_0xa67d('0x13')](function(_0x539307){_0x242a01(null,_0x539307);})[_0xa67d('0x17')](function(_0x260e92){_0x242a01(_0x260e92);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x4d')]=function(_0x34e35f,_0x1639fe){this[_0xa67d('0x10')][_0xa67d('0x4e')](_0x34e35f)['then'](function(_0x569521){_0x1639fe(null,_0x569521?_0x569521['name']:![]);})[_0xa67d('0x17')](function(_0x5d4b5c){_0x1639fe(_0x5d4b5c);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x4f')]=function(_0x295a3c,_0x5e9e68,_0x4278f0){var _0x472b28={'role':_0xa67d('0x50')};_0x472b28[_0x295a3c]=this[_0xa67d('0xf')]['callerid'];this['rpc'][_0xa67d('0x4f')](_0x472b28,_0x5e9e68,this[_0xa67d('0xf')][_0xa67d('0x38')])[_0xa67d('0x13')](function(_0x32200d){_0x4278f0(null,_[_0xa67d('0x44')](_0x32200d)?![]:!![]);})[_0xa67d('0x17')](function(_0x5af704){logger[_0xa67d('0x2e')](_0x5af704);_0x4278f0(null,![]);});};AGIVertices[_0xa67d('0x18')]['agentUnpause']=function(_0x1a8574,_0x3d6d59){var _0x467c46={'role':'agent'};_0x467c46[_0x1a8574]=this[_0xa67d('0xf')][_0xa67d('0x3b')];this['rpc'][_0xa67d('0x51')](_0x467c46)[_0xa67d('0x13')](function(_0xb96936){_0x3d6d59(null,_['isNil'](_0xb96936)?![]:!![]);})[_0xa67d('0x17')](function(_0x17a89e){logger[_0xa67d('0x2e')](_0x17a89e);_0x3d6d59(null,![]);});};AGIVertices['prototype'][_0xa67d('0x52')]=function(_0x4ed172,_0x3e368f){var _0x4a2e2f={'role':_0xa67d('0x50')};_0x4a2e2f[_0x4ed172]=this[_0xa67d('0xf')][_0xa67d('0x3b')];this[_0xa67d('0x10')][_0xa67d('0x52')](_0x4a2e2f)['then'](function(_0x175028){_0x3e368f(null,_['isNil'](_0x175028)?![]:!![]);})[_0xa67d('0x17')](function(_0x24fa84){logger[_0xa67d('0x2e')](_0x24fa84);_0x3e368f(null,![]);});};AGIVertices['prototype'][_0xa67d('0x53')]=function(_0xaaf8cf,_0x192e62){var _0x3856ef={'role':_0xa67d('0x50')};_0x3856ef[_0xaaf8cf]=this[_0xa67d('0xf')][_0xa67d('0x3b')];var _0x50dfac=_0xaaf8cf!=_0xa67d('0x54')?util[_0xa67d('0x55')](_0xa67d('0x56'),_0xa67d('0x57'),this[_0xa67d('0xf')][_0xa67d('0x3b')]):undefined;this[_0xa67d('0x10')][_0xa67d('0x53')](_0x3856ef,_0x50dfac)[_0xa67d('0x13')](function(_0x59dd9e){_0x192e62(null,_[_0xa67d('0x44')](_0x59dd9e)?![]:!![]);})[_0xa67d('0x17')](function(_0x2a21c5){logger['error'](_0x2a21c5);_0x192e62(null,![]);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x58')]=function(_0x41ca15,_0x3c44fd){sh[_0xa67d('0x59')](_['trim'](_0x41ca15),function(_0x544929,_0x275bd6){var _0x2f80b4=_0x275bd6[_0xa67d('0x5a')](/(\r\n|\n|\r)/gm,'');_0x3c44fd(null,_0x2f80b4);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x5b')]=function(_0x189dd6,_0x28441d){scripts['googleCloudTTS'](_0x189dd6[_0xa67d('0x5c')],_0x189dd6['google_cloud_tts_text_type']||_0xa67d('0x5d'),_0x189dd6[_0xa67d('0x5d')],_0x189dd6['languageCode']||_0xa67d('0x5e'),_0x189dd6[_0xa67d('0x5f')]||_0xa67d('0x60'),_0x189dd6['audioEncoding']||_0xa67d('0x61'))[_0xa67d('0x13')](function(_0x3a7c2e){_0x28441d(null,_0x3a7c2e);})[_0xa67d('0x17')](function(_0x1032c2){_0x28441d(_0x1032c2);});};AGIVertices[_0xa67d('0x18')]['googleTTS']=function(_0x3cc975,_0x4cb621){scripts['googleTTS'](_0x3cc975[_0xa67d('0x5d')],_0x3cc975[_0xa67d('0x62')]||'en',0x1)['then'](function(_0x2997b4){_0x4cb621(null,_0x2997b4);})['catch'](function(_0x356ae5){_0x4cb621(_0x356ae5);});};AGIVertices[_0xa67d('0x18')]['restAPI']=function(_0xbe51dc,_0x16e9ff){var _0x19d8f7={'uri':_0xbe51dc[_0xa67d('0x63')],'method':_0xbe51dc[_0xa67d('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xbe51dc['timeout'])===_0xa67d('0x65')&&parseInt(_0xbe51dc[_0xa67d('0x66')])>=0x1?parseInt(_0xbe51dc['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xa67d('0x67')]([_0xa67d('0x68'),_0xa67d('0x69')],_0x19d8f7[_0xa67d('0x64')][_0xa67d('0x6a')]())){try{_0x19d8f7[_0xa67d('0x6b')]=_0xbe51dc[_0xa67d('0xb')]?JSON[_0xa67d('0x6c')](_0xbe51dc[_0xa67d('0xb')]):{};}catch(_0x144a49){logger[_0xa67d('0x2e')](_0xa67d('0x6d'),_0x144a49);}}try{_0x19d8f7[_0xa67d('0x6e')]=_0xbe51dc[_0xa67d('0x6f')]?JSON[_0xa67d('0x6c')](_0xbe51dc[_0xa67d('0x6f')]):{};}catch(_0x572877){logger[_0xa67d('0x2e')](_0xa67d('0x70'),_0x572877);}if(_0xbe51dc[_0xa67d('0x71')]){try{var _0x3adf5f=require(_0xbe51dc[_0xa67d('0x71')])[_0xa67d('0x72')](this,_0x19d8f7);_0x19d8f7['uri']=Mustache[_0xa67d('0x73')](_0xbe51dc['url'],_0x3adf5f,{},['$$','$$']);if(_0x19d8f7[_0xa67d('0x6e')]){_0x19d8f7[_0xa67d('0x6e')]=JSON['parse'](Mustache[_0xa67d('0x73')](JSON[_0xa67d('0x74')](_0x19d8f7['headers']),_0x3adf5f,{},['$$','$$']));}if(_0x19d8f7[_0xa67d('0x6b')]){_0x19d8f7[_0xa67d('0x6b')]=JSON[_0xa67d('0x6c')](Mustache[_0xa67d('0x73')](JSON[_0xa67d('0x74')](_0x19d8f7[_0xa67d('0x6b')]),_0x3adf5f,{},['$$','$$']));}}catch(_0x386ec5){logger[_0xa67d('0x2e')](_0xa67d('0x75'),_0x386ec5);}}rp(_0x19d8f7)['then'](function(_0x17e18f){var _0x48b888={'statusCode':_0x17e18f[_0xa67d('0x76')]||0xc8,'statusMessage':_0x17e18f[_0xa67d('0x77')]||'OK','headers':_0x17e18f[_0xa67d('0x6e')]||{},'body':_0x17e18f[_0xa67d('0x6b')]||{}};_0x16e9ff(null,_0x48b888);})[_0xa67d('0x17')](function(_0x1a01b1){var _0x4a6a81={'statusCode':_0x1a01b1[_0xa67d('0x76')]||0x1f4,'statusMessage':_0x1a01b1['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x1a01b1[_0xa67d('0x78')]['headers']||{},'body':_0x1a01b1[_0xa67d('0x78')][_0xa67d('0x6b')]||{}};_0x16e9ff(null,_0x4a6a81);});};AGIVertices[_0xa67d('0x18')]['googleDialogflow']=function(_0x26ecf9,_0x43e41b){scripts[_0xa67d('0x79')](this[_0xa67d('0xf')][_0xa67d('0x38')],_0x26ecf9[_0xa67d('0x7a')],_0x26ecf9[_0xa67d('0x5d')],_0x26ecf9[_0xa67d('0x7b')]||'en')[_0xa67d('0x13')](function(_0x135227){_0x43e41b(null,_0x135227);})[_0xa67d('0x17')](function(_0x41464c){_0x43e41b(_0x41464c);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x7c')]=function(_0x3db95b,_0x3de989){scripts['googleDialogflowV2'](this[_0xa67d('0xf')]['uniqueid'],_0x3db95b[_0xa67d('0x7d')],_0x3db95b[_0xa67d('0x7e')],_0x3db95b[_0xa67d('0x7f')],_0x3db95b[_0xa67d('0x5d')],_0x3db95b[_0xa67d('0x80')]||'en')['then'](function(_0x4ad826){_0x3de989(null,_0x4ad826);})[_0xa67d('0x17')](function(_0x325183){_0x3de989(_0x325183);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x81')]=function(_0x5d16c2,_0x1f79ca){scripts['sestekNDA'](this['channel'],_0x5d16c2)['then'](function(_0x21581a){_0x1f79ca(null,_0x21581a);})[_0xa67d('0x17')](function(_0x20ca67){_0x1f79ca(_0x20ca67);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x82')]=function(_0x26358f,_0x521c89){scripts[_0xa67d('0x82')](_0x26358f[_0xa67d('0x7a')],_0x26358f[_0xa67d('0x5d')],_0x26358f['ispeech_tts_language']||'en-US',_0x26358f[_0xa67d('0x83')])['then'](function(_0x5be0ed){_0x521c89(null,_0x5be0ed);})['catch'](function(_0x174b7a){_0x521c89(_0x174b7a);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x84')]=function(_0x348061,_0x1c5301,_0x2669c0){scripts['ispeechASR'](_0x1c5301,_0x348061[_0xa67d('0x7a')],_0x348061[_0xa67d('0x85')]||_0xa67d('0x5e'),this[_0xa67d('0x86')](_0x348061[_0xa67d('0x87')])?_0x348061['model']:undefined)[_0xa67d('0x13')](function(_0x2a36cd){_0x2669c0(null,_0x2a36cd);})[_0xa67d('0x17')](function(_0x40c9d3){_0x2669c0(_0x40c9d3);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x88')]=function(_0x376a29,_0x32facb){scripts[_0xa67d('0x88')](_0x376a29['aws_access_key_id'],_0x376a29[_0xa67d('0x89')],_0x376a29[_0xa67d('0x8a')],_0x376a29[_0xa67d('0x8b')]||'Amy',_0x376a29[_0xa67d('0x5d')],_0x376a29[_0xa67d('0x8c')]||_0xa67d('0x5d'))[_0xa67d('0x13')](function(_0x190084){_0x32facb(null,_0x190084);})[_0xa67d('0x17')](function(_0x54a775){_0x32facb(_0x54a775);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x8d')]=function(_0x51dbf5,_0x2911dc){scripts[_0xa67d('0x8d')](this[_0xa67d('0xf')][_0xa67d('0x38')],_0x51dbf5[_0xa67d('0x8e')],_0x51dbf5['aws_secret_access_key'],_0x51dbf5[_0xa67d('0x8f')],_0x51dbf5['text'],_0x51dbf5[_0xa67d('0x90')])['then'](function(_0x256e0e){_0x2911dc(null,_0x256e0e);})[_0xa67d('0x17')](function(_0x1d8a39){_0x2911dc(_0x1d8a39);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x91')]=function(_0x9633ba,_0x514e5a,_0x2d0a39){scripts[_0xa67d('0x91')](_0x514e5a,_0x9633ba['key'],_0x9633ba[_0xa67d('0x92')]||_0xa67d('0x5e'))['then'](function(_0x4107fe){_0x2d0a39(null,_0x4107fe);})[_0xa67d('0x17')](function(_0x1f2a42){_0x2d0a39(_0x1f2a42);});};AGIVertices[_0xa67d('0x18')][_0xa67d('0x93')]=function(_0x2ae823,_0xb54c2f,_0x4761c0){scripts['tildeASR'](_0xb54c2f,_0x2ae823[_0xa67d('0x94')],_0x2ae823['appsecret'],_0x2ae823[_0xa67d('0x95')])['then'](function(_0x4cda74){_0x4761c0(null,_0x4cda74);})[_0xa67d('0x17')](function(_0x14d65a){_0x4761c0(_0x14d65a);});};AGIVertices['prototype']['clear']=function(_0x32acda){var _0x5781ae=_[_0xa67d('0x67')](verticesWithRetry,_0x32acda[_0xa67d('0x39')])?_0x32acda:_[_0xa67d('0x96')](_0x32acda);for(var _0x1c9908 in _0x5781ae){if(_0x5781ae[_0xa67d('0x97')](_0x1c9908)){if(_0x5781ae[_0x1c9908]&&_[_0xa67d('0x98')](_0x5781ae[_0x1c9908])){if(_[_0xa67d('0x67')](recursiveMapAttributes,_0x1c9908)){_0x5781ae[_0x1c9908]=this[_0xa67d('0x99')](_0x5781ae[_0x1c9908]);}else{_0x5781ae[_0x1c9908]=this[_0xa67d('0x9a')](_0x5781ae[_0x1c9908]);}}}}return _0x5781ae;};AGIVertices[_0xa67d('0x18')][_0xa67d('0x9b')]=function(_0x128622){for(var _0xdc3296 in _0x128622){if(_0x128622[_0xa67d('0x97')](_0xdc3296)){if(_['isPlainObject'](_0x128622[_0xdc3296])){this[_0xa67d('0x9b')](_0x128622[_0xdc3296]);}else if(_[_0xa67d('0x9c')](_0x128622[_0xdc3296])){for(var _0x4e0c0e=0x0;_0x4e0c0e<_0x128622[_0xdc3296][_0xa67d('0x9d')];_0x4e0c0e++){this[_0xa67d('0x9b')](_0x128622[_0xdc3296][_0x4e0c0e]);}}else if(_[_0xa67d('0x98')](_0x128622[_0xdc3296])){_0x128622[_0xdc3296]=this[_0xa67d('0x9a')](_0x128622[_0xdc3296]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x360fd8,_0x330826){for(var _0x31792b in _0x360fd8){if(_0x360fd8[_0xa67d('0x97')](_0x31792b)){if(_[_0xa67d('0x9e')](_0x360fd8[_0x31792b])){if(!_[_0xa67d('0x43')](_0x360fd8[_0x31792b])){this['saveRestApiResult'](_0x360fd8[_0x31792b],util[_0xa67d('0x55')](_0xa67d('0x9f'),_0x330826,_0x31792b));}}else if(_['isArray'](_0x360fd8[_0x31792b])){for(var _0x148e42=0x0;_0x148e42<_0x360fd8[_0x31792b][_0xa67d('0x9d')];_0x148e42++){this['saveRestApiResult'](_0x360fd8[_0x31792b][_0x148e42],util['format'](_0xa67d('0x9f'),_0x330826,_0x31792b+'['+_0x148e42+']'));}}else{if(!_[_0xa67d('0x44')](_0x360fd8[_0x31792b])){this['channel'][_0xa67d('0xa0')](util[_0xa67d('0x55')](_0xa67d('0x9f'),_0x330826,_0x31792b),_0x360fd8[_0x31792b]);}}}}};AGIVertices[_0xa67d('0x18')][_0xa67d('0x99')]=function(_0x17334d){try{var _0x3c64ec=JSON[_0xa67d('0x6c')](_0x17334d);this[_0xa67d('0x9b')](_0x3c64ec);return JSON['stringify'](_0x3c64ec);}catch(_0x2340d){return this['replaceAllVariables'](_0x17334d);}};AGIVertices[_0xa67d('0x18')]['replaceAllVariables']=function(_0x4f0a06){var _0x5a80c8=_0x4f0a06[_0xa67d('0xa1')]('{');for(var _0x3fcc23=0x1;_0x3fcc23<_0x5a80c8[_0xa67d('0x9d')];_0x3fcc23+=0x1){var _0x4638d9=_0x5a80c8[_0x3fcc23]['split']('}');if(_0x4638d9['length']>0x1){_0x4f0a06=_0x4f0a06[_0xa67d('0xa2')]('{'+_0x4638d9[0x0]+'}',this['channel'][_0xa67d('0x12')](_0x4638d9[0x0])[_0xa67d('0xa3')]||_0x4638d9[0x0]);}}if(_0x5a80c8[_0xa67d('0x9d')]===0x1){return _0x4f0a06['toString']();}return this[_0xa67d('0x9a')](_0x4f0a06);};AGIVertices[_0xa67d('0x18')]['getAndSetVariable']=function(_0x24ada4,_0x452974){var _0x2a25d8=this[_0xa67d('0xf')][_0xa67d('0x12')](_0x24ada4);if(_0x2a25d8[_0xa67d('0xa4')]===-0x1){return _0x2a25d8;}logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x452974,_0x2a25d8[_0xa67d('0xa3')]));return this[_0xa67d('0xf')]['setVariable'](_0x452974,_0x2a25d8['extra']);};AGIVertices[_0xa67d('0x18')]['isConfigured']=function(_0x3c6885){return _0x3c6885&&_0x3c6885!=='0'&&_0x3c6885!=='-1'&&_0x3c6885!=='';};AGIVertices[_0xa67d('0x18')][_0xa67d('0xa5')]=function(_0x21c36a){this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x21c36a,'-');_0x21c36a[_0xa67d('0xa6')]=_0x21c36a['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa67d('0x18')]['mrcpsynth']=function(_0x2aae23){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xa7'),_0x2aae23['label']));if(!this['isConfigured'](_0x2aae23[_0xa67d('0x5d')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xa9'));}var _0x3aeb16='\x22'+_0x2aae23[_0xa67d('0x5d')]+'\x22';if(this[_0xa67d('0x86')](_0x2aae23[_0xa67d('0x78')])){_0x3aeb16+=','+_0x2aae23[_0xa67d('0x78')];}var _0xc2dd13=this['channel'][_0xa67d('0x59')](_0xa67d('0xaa'),_0x3aeb16);if(_0xc2dd13['result']===-0x1){return _0xc2dd13;}return this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xab'),_0x3aeb16));};AGIVertices[_0xa67d('0x18')][_0xa67d('0xac')]=function(_0x41cd5b){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xad'),_0x41cd5b[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x41cd5b[_0xa67d('0xaf')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')]('no\x20grammar\x20configured');}var _0x4d58ec=_0x41cd5b[_0xa67d('0xaf')];if(this[_0xa67d('0x86')](_0x41cd5b[_0xa67d('0x78')])){_0x4d58ec+=','+_0x41cd5b['options'];}var _0x2d297e=this['channel'][_0xa67d('0x59')](_0xa67d('0xb0'),_0x4d58ec);if(_0x2d297e[_0xa67d('0xa4')]===-0x1){return _0x2d297e;}var _0x348b13=this[_0xa67d('0xb1')](_0xa67d('0xb2'),_0xa67d('0xb3'));if(_0x348b13[_0xa67d('0xa4')]===-0x1){return _0x348b13;}var _0x2527c7=this[_0xa67d('0xb1')]('RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT');if(_0x2527c7[_0xa67d('0xa4')]===-0x1){return _0x2527c7;}var _0x18f3f3=this[_0xa67d('0xb1')](_0xa67d('0xb4'),'MRCP_RECOG_INSTANCE');if(_0x18f3f3[_0xa67d('0xa4')]===-0x1){return _0x18f3f3;}return this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')](_0xa67d('0xb5'),_0x4d58ec));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x8')]=function(_0x3cca2a){logger['info'](util[_0xa67d('0x55')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x3cca2a[_0xa67d('0xae')]));return this[_0xa67d('0xf')][_0xa67d('0x8')]([_0x3cca2a[_0xa67d('0xb6')],_0x3cca2a['args']]);};AGIVertices[_0xa67d('0x18')]['answer']=function(_0x392109){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x392109[_0xa67d('0xae')]));if(this[_0xa67d('0x86')](_0x392109[_0xa67d('0x66')])){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x392109['timeout']));var _0xdeccac=this['channel'][_0xa67d('0xb7')](_0x392109[_0xa67d('0x66')]);if(_0xdeccac[_0xa67d('0xa4')]===-0x1){return _0xdeccac;}}return this[_0xa67d('0xf')][_0xa67d('0xb8')]();};AGIVertices[_0xa67d('0x18')][_0xa67d('0x4a')]=function(_0x146e13){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xb9'),_0x146e13[_0xa67d('0xae')]));if(!this['isConfigured'](_0x146e13['list_id'])){return this[_0xa67d('0xf')]['error'](_0x146e13,'no\x20list\x20selected');}_0x146e13[_0xa67d('0x49')]=moment();if(this[_0xa67d('0x86')](_0x146e13['delay'])){_0x146e13['scheduledAt']=moment()[_0xa67d('0xba')](_0x146e13['delay'],'minutes');}if(!this[_0xa67d('0x86')](_0x146e13[_0xa67d('0x4c')])){_0x146e13[_0xa67d('0x4c')]=0x2;}this[_0xa67d('0x42')][_0xa67d('0x72')](this,_0x146e13);return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x146e13[_0xa67d('0x47')],_0x146e13[_0xa67d('0x48')],_0x146e13[_0xa67d('0x49')]));};AGIVertices[_0xa67d('0x18')][_0xa67d('0xbb')]=function(_0x2a970c){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xbc'),_0x2a970c[_0xa67d('0xae')]));var _0x29c181=this['channel'][_0xa67d('0x59')](_0x2a970c[_0xa67d('0xbd')],_0x2a970c[_0xa67d('0x78')]);if(_0x29c181[_0xa67d('0xa4')]===-0x1){return _0x29c181;}return this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xbe'),_0x2a970c[_0xa67d('0xbd')],_0x2a970c[_0xa67d('0x78')]));};AGIVertices['prototype']['lumenvoxtts']=function(_0x2c63f3){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x2c63f3[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x2c63f3[_0xa67d('0x5d')])){return this['channel']['noop'](_0xa67d('0xa9'));}var _0x53d53e='\x22'+_0x2c63f3[_0xa67d('0x5d')]+'\x22';if(this[_0xa67d('0x86')](_0x2c63f3[_0xa67d('0x78')])){_0x53d53e+=','+_0x2c63f3[_0xa67d('0x78')];}var _0x21a8d4=this[_0xa67d('0xf')][_0xa67d('0x59')](_0xa67d('0xaa'),_0x53d53e);if(_0x21a8d4['result']===-0x1){return _0x21a8d4;}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xab'),_0x53d53e));};AGIVertices[_0xa67d('0x18')][_0xa67d('0xbf')]=function(_0x4ad0cd){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x4ad0cd[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x4ad0cd[_0xa67d('0x5d')])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0xa9'));}var _0xe03c01='\x22'+_0x4ad0cd['text']+'\x22';if(this[_0xa67d('0x86')](_0x4ad0cd[_0xa67d('0x78')])){_0xe03c01+=','+_0x4ad0cd[_0xa67d('0x78')];}var _0x274673=this['channel'][_0xa67d('0x59')](_0xa67d('0xaa'),_0xe03c01);if(_0x274673['result']===-0x1){return _0x274673;}return this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')]('Executed\x20command\x20MRCPSynth\x20%s',_0xe03c01));};AGIVertices[_0xa67d('0x18')]['lumenvoxasr']=function(_0x35b06d){logger[_0xa67d('0x30')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x35b06d[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x35b06d['grammar'])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xc0'));}var _0xc4e703=_0x35b06d[_0xa67d('0xaf')];if(this[_0xa67d('0x86')](_0x35b06d[_0xa67d('0x78')])){_0xc4e703+=','+_0x35b06d[_0xa67d('0x78')];}var _0x5e56a5=this[_0xa67d('0xf')][_0xa67d('0x59')](_0xa67d('0xb0'),_0xc4e703);if(_0x5e56a5[_0xa67d('0xa4')]===-0x1){return _0x5e56a5;}var _0x31830c=this[_0xa67d('0xb1')](_0xa67d('0xb2'),'LUMENVOX_ASR_CONFIDENCE');if(_0x31830c[_0xa67d('0xa4')]===-0x1){return _0x31830c;}var _0x48b13e=this[_0xa67d('0xb1')](_0xa67d('0xc1'),_0xa67d('0xc2'));if(_0x48b13e[_0xa67d('0xa4')]===-0x1){return _0x48b13e;}var _0x386b6e=this[_0xa67d('0xb1')](_0xa67d('0xb4'),_0xa67d('0xc3'));if(_0x386b6e[_0xa67d('0xa4')]===-0x1){return _0x386b6e;}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format'](_0xa67d('0xb5'),_0xc4e703));};AGIVertices[_0xa67d('0x18')]['sestekasr']=function(_0x1f4e0f){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xc4'),_0x1f4e0f[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x1f4e0f[_0xa67d('0xaf')])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0xc0'));}var _0x40c3a4=_0x1f4e0f[_0xa67d('0xaf')];if(this[_0xa67d('0x86')](_0x1f4e0f['options'])){_0x40c3a4+=','+_0x1f4e0f[_0xa67d('0x78')];}var _0x7f01e6=this[_0xa67d('0xf')][_0xa67d('0x59')]('MRCPRecog',_0x40c3a4);if(_0x7f01e6[_0xa67d('0xa4')]===-0x1){return _0x7f01e6;}var _0x22c799=this[_0xa67d('0xb1')](_0xa67d('0xb2'),_0xa67d('0xc5'));if(_0x22c799['result']===-0x1){return _0x22c799;}var _0x5c4f2c=this['getAndSetVariable'](_0xa67d('0xc1'),_0xa67d('0xc6'));if(_0x5c4f2c[_0xa67d('0xa4')]===-0x1){return _0x5c4f2c;}var _0x1339df=this['getAndSetVariable'](_0xa67d('0xb4'),_0xa67d('0xc7'));if(_0x1339df[_0xa67d('0xa4')]===-0x1){return _0x1339df;}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format'](_0xa67d('0xb5'),_0x40c3a4));};AGIVertices['prototype'][_0xa67d('0xc8')]=function(_0x2af58b){logger['info'](util[_0xa67d('0x55')](_0xa67d('0xc9'),_0x2af58b[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x2af58b[_0xa67d('0xca')])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x2af58b,_0xa67d('0xcb'));}var _0x1beeac=this[_0xa67d('0x19')][_0xa67d('0x72')](this,_0x2af58b[_0xa67d('0xca')]);if(!_0x1beeac){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x2af58b,'no\x20odbc\x20database\x20found');}if(!this[_0xa67d('0x86')](_0x2af58b[_0xa67d('0x32')])){return this['channel'][_0xa67d('0x2e')](_0x2af58b,_0xa67d('0xcc'));}var _0x5a36b6=_0x2af58b[_0xa67d('0x32')][_0xa67d('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xcd'),_0x5a36b6));var _0x3bfab1=this[_0xa67d('0x2c')][_0xa67d('0x72')](this,_0x1beeac,_0x5a36b6);this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x2af58b,_0x5a36b6);if(!this[_0xa67d('0x86')](_0x2af58b[_0xa67d('0xce')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xcf'));}var _0x57e43c=this[_0xa67d('0x12')][_0xa67d('0x72')](this,_0x2af58b[_0xa67d('0xce')]);if(!_0x57e43c){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x2af58b,_0xa67d('0xd0'));}var _0x3975bd=this;_0x3bfab1['forEach'](function(_0x46ba20,_0x54500a){Object[_0xa67d('0xd1')](_0x46ba20)['forEach'](function(_0x26b304){_0x3975bd[_0xa67d('0xf')][_0xa67d('0xa0')](util['format'](_0xa67d('0xd2'),_0x57e43c,_0x54500a,_0x26b304),_0x46ba20[_0x26b304]);});});this[_0xa67d('0xf')][_0xa67d('0xa0')](util[_0xa67d('0x55')](_0xa67d('0xd3'),_0x57e43c),_0x3bfab1[_0xa67d('0x9d')]);return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xd4'),_0x57e43c));};AGIVertices['prototype'][_0xa67d('0xd5')]=function(_0x147196){logger[_0xa67d('0xd6')](util[_0xa67d('0x55')](_0xa67d('0xd7'),_0x147196[_0xa67d('0xae')]));if(!this['isConfigured'](_0x147196['sip_id'])){return this[_0xa67d('0xf')]['error'](_0x147196,_0xa67d('0xd8'));}var _0x2899cb=this['getUser'][_0xa67d('0x72')](this,_0x147196[_0xa67d('0xd9')]);if(!_0x2899cb){return this['channel'][_0xa67d('0x2e')](_0x147196,'no\x20user\x20found');}var _0xd7958b=this[_0xa67d('0xf')]['exec']('DIAL',[util[_0xa67d('0x55')](_0xa67d('0xda'),_0x2899cb),_0x147196['timeout'],_0x147196[_0xa67d('0xdb')],_0x147196['url']]);if(_0xd7958b[_0xa67d('0xa4')]===-0x1){return _0xd7958b;}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')]('Executed\x20command\x20%s',_0xa67d('0xdc')));};AGIVertices['prototype'][_0xa67d('0xdd')]=function(_0x8ad00e){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xde'),_0x8ad00e[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x8ad00e[_0xa67d('0x7a')])){return this['channel'][_0xa67d('0xa8')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x8ad00e[_0xa67d('0x5d')])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0xa9'));}this[_0xa67d('0xf')]['bot']=!![];this['createSquareDetailsReport'](_0x8ad00e);this[_0xa67d('0x41')](_0x8ad00e[_0xa67d('0x5d')],'in','','');this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')]('Trying\x20Dialogflow:\x20%s',_0x8ad00e[_0xa67d('0x5d')]));var _0x52c266=this['googleDialogflow'][_0xa67d('0x72')](this,_0x8ad00e);if(_0x52c266){for(var _0x55dc94 in _0x52c266){if(_0x52c266[_0xa67d('0x97')](_0x55dc94)){this[_0xa67d('0xf')][_0xa67d('0xa0')](util['format'](_0xa67d('0xdf'),_0x55dc94[_0xa67d('0x6a')]()),_0x52c266[_0x55dc94]);}}this[_0xa67d('0x41')](_0x52c266[_0xa67d('0xe0')],_0xa67d('0xe1'),_0xa67d('0xdd'),'');return this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xe2'),_0x52c266[_0xa67d('0xe0')]));}return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x8ad00e,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xa67d('0x18')]['dialogflowV2']=function(_0x23df5a){logger['info'](util['format'](_0xa67d('0xe3'),_0x23df5a[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x23df5a[_0xa67d('0x7d')])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0xe4'));}if(!this[_0xa67d('0x86')](_0x23df5a['client_email'])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0xe5'));}if(!this[_0xa67d('0x86')](_0x23df5a[_0xa67d('0x7f')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xe6'));}if(!this[_0xa67d('0x86')](_0x23df5a['dialogflowV2_language'])){return this[_0xa67d('0xf')][_0xa67d('0xa8')]('no\x20anguage\x20configured');}if(!this['isConfigured'](_0x23df5a['text'])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0xa9'));}this[_0xa67d('0xf')]['bot']=!![];this[_0xa67d('0x37')](_0x23df5a);this[_0xa67d('0x41')](_0x23df5a['text'],'in','','');this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xe7'),_0x23df5a[_0xa67d('0x5d')]));var _0x501572=this[_0xa67d('0x7c')][_0xa67d('0x72')](this,_0x23df5a);if(_0x501572){for(var _0x362ad8 in _0x501572){if(_0x501572[_0xa67d('0x97')](_0x362ad8)){if(_0x362ad8!==_0xa67d('0xe8')){this[_0xa67d('0xf')][_0xa67d('0xa0')](util['format']('DIALOGFLOW_%s',_0x362ad8['toUpperCase']()),_0x501572[_0x362ad8]);}}}this[_0xa67d('0x41')](_0x501572['speech'],'out',_0xa67d('0xe9'),_0x501572[_0xa67d('0xe8')]);return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')]('DialogflowV2\x20Result\x20%s',_0x501572[_0xa67d('0xe0')]));}return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x23df5a,_0xa67d('0xea'));};AGIVertices[_0xa67d('0x18')][_0xa67d('0xeb')]=function(_0xda8e9d){logger[_0xa67d('0x30')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0xda8e9d[_0xa67d('0xae')]));if(!this['isConfigured'](_0xda8e9d['ndauth_url'])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xec'));}if(!this[_0xa67d('0x86')](_0xda8e9d[_0xa67d('0xed')])){return this['channel'][_0xa67d('0xa8')]('no\x20username\x20configured');}if(!this[_0xa67d('0x86')](_0xda8e9d[_0xa67d('0xee')])){return this[_0xa67d('0xf')]['noop']('no\x20password\x20configured');}if(!this[_0xa67d('0x86')](_0xda8e9d[_0xa67d('0xef')])){return this['channel']['noop'](_0xa67d('0xa9'));}this[_0xa67d('0xf')][_0xa67d('0xf0')]=!![];this[_0xa67d('0x37')](_0xda8e9d);this[_0xa67d('0x41')](_0xda8e9d[_0xa67d('0x5d')],'in','','');this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xf1'),_0xda8e9d[_0xa67d('0x5d')]));var _0x1a240a=this[_0xa67d('0x81')][_0xa67d('0x72')](this,_0xda8e9d);if(_0x1a240a){for(var _0x43ef9d in _0x1a240a){if(_0x1a240a[_0xa67d('0x97')](_0x43ef9d)){this[_0xa67d('0xf')]['setVariable'](util[_0xa67d('0x55')]('SESTEK_NDA_%s',_0x43ef9d[_0xa67d('0x6a')]()),_0x1a240a[_0x43ef9d]);}}this['createSquareMessage'](_0x1a240a[_0xa67d('0xe0')],_0xa67d('0xe1'),'sesteknda','');if(_0x1a240a[_0xa67d('0xf2')]){this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xf3'),_0x1a240a[_0xa67d('0xf2')]));var _0x138d9e=this['channel']['streamFile'](_0x1a240a[_0xa67d('0xf2')]);try{fs['unlink'](_0x1a240a['audiofile']+_0xa67d('0xf4'));}catch(_0x1a4777){logger[_0xa67d('0x2e')](_0x1a4777);}return _0x138d9e;}else{return this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xf5'),_0x1a240a[_0xa67d('0xe0')]));}}return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0xda8e9d,_0xa67d('0xf6'));};AGIVertices[_0xa67d('0x18')]['end']=function(_0x38fa89){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xf7'),_0x38fa89[_0xa67d('0xae')]));return this[_0xa67d('0xf')]['noop']('end');};AGIVertices[_0xa67d('0x18')][_0xa67d('0xf8')]=function(_0x5539dc){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0xf9'),_0x5539dc['label']));var _0x263b33='';if(_0x5539dc[_0xa67d('0xfa')]){if(!this[_0xa67d('0x86')](_0x5539dc[_0xa67d('0xfa')])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x5539dc,'no\x20trunk\x20selected');}else{var _0x2cbc3a=parseInt(_0x5539dc['trunk_id'],0xa);if(isNaN(_0x2cbc3a)){_0x263b33=_0x5539dc['trunk_id'];}else{_0x263b33=this[_0xa67d('0x1d')][_0xa67d('0x72')](this,_0x5539dc['trunk_id']);if(!_0x263b33){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x5539dc,_0xa67d('0xfb'));}}}}else if(_0x5539dc[_0xa67d('0xfc')]){_0x263b33=_0x5539dc['trunk_name'];}else{return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x5539dc,_0xa67d('0xfd'));}var _0x5b416f=this[_0xa67d('0xf')]['exec'](_0xa67d('0xdc'),[util[_0xa67d('0x55')](_0xa67d('0xfe'),_0x263b33,_0x5539dc[_0xa67d('0x47')]),_0x5539dc[_0xa67d('0x66')],_0x5539dc[_0xa67d('0xdb')],_0x5539dc[_0xa67d('0x63')]]);if(_0x5b416f[_0xa67d('0xa4')]===-0x1){return _0x5b416f;}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xff'),_0xa67d('0xdc')));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x100')]=function(_0x1748d4){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x1748d4[_0xa67d('0xae')]));return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0x100'));};AGIVertices[_0xa67d('0x18')]['getdigits']=function(_0x33718c){logger[_0xa67d('0x30')](util['format'](_0xa67d('0x101'),_0x33718c[_0xa67d('0xae')]));if(_0x33718c[_0xa67d('0xa6')]===0x0){return this[_0xa67d('0xa5')](_0x33718c);}_0x33718c[_0xa67d('0xa6')]-=0x1;if(!this[_0xa67d('0x86')](_0x33718c[_0xa67d('0x102')])){return this['channel']['error'](_0x33718c,_0xa67d('0x103'));}var _0x53dcb3=this[_0xa67d('0x104')][_0xa67d('0x72')](this,_0x33718c[_0xa67d('0x102')]);if(!_0x53dcb3){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x33718c,_0xa67d('0x105'));}if(!this[_0xa67d('0x86')](_0x33718c[_0xa67d('0xce')])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0xa67d('0xcf'));}var _0x36ed18=this[_0xa67d('0xf')][_0xa67d('0x106')](_0x53dcb3,_0x33718c['response'],_0x33718c[_0xa67d('0x107')]);var _0x165d8d=_0x36ed18[_0xa67d('0xa4')]?_0x36ed18[_0xa67d('0xa4')][_0xa67d('0x4b')]():'';logger[_0xa67d('0x30')](_0xa67d('0x108'),JSON[_0xa67d('0x74')](_0x36ed18));if(_0x36ed18['result']===-0x1){this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x33718c,_0x165d8d);return _0x36ed18;}else if(_0x36ed18['extra']==='timeout'){_0x36ed18[_0xa67d('0xa4')]=_0x165d8d[_0xa67d('0x9d')]>=parseInt(_0x33718c[_0xa67d('0x109')])?'x':'i';}else{_0x36ed18['result']=_0x165d8d['length']>=parseInt(_0x33718c['mindigit'])&&_0x165d8d[_0xa67d('0x9d')]<=parseInt(_0x33718c[_0xa67d('0x107')])?'x':'i';}var _0x510987=this['getVariable'][_0xa67d('0x72')](this,_0x33718c[_0xa67d('0xce')]);if(!_0x510987){return this['channel'][_0xa67d('0x2e')](_0x33718c,_0xa67d('0xd0'));}this[_0xa67d('0xf')]['setVariable'](_0x510987,_0x165d8d);if(this['isConfigured'](_0x33718c[_0xa67d('0x10a')])){var _0x3be0ea=parseInt(_0x33718c[_0xa67d('0x10a')],0xa);var _0x17e4b=rs['generate']({'charset':'*','length':_0x3be0ea});var _0x1e03d1=_0x165d8d[_0xa67d('0x9d')];if(_0x1e03d1>0x0){if(_0x1e03d1>_0x3be0ea){this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x33718c,_0x33718c['hiddendigitspos']===_0xa67d('0x10b')?_0x17e4b+_0x165d8d[_0xa67d('0x10c')](_0x3be0ea):_0x165d8d[_0xa67d('0x10c')](0x0,_0x1e03d1-_0x3be0ea)+_0x17e4b);}else{this['createSquareDetailsReport'][_0xa67d('0x72')](this,_0x33718c,rs['generate']({'charset':'*','length':_0x1e03d1}));}}else{this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x33718c,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x33718c,_0x165d8d);}return _0x36ed18;};AGIVertices['prototype'][_0xa67d('0xe')]=function(_0x5d0372){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x5d0372[_0xa67d('0xae')]));return this[_0xa67d('0xd')](_0x5d0372);};AGIVertices[_0xa67d('0x18')][_0xa67d('0x10d')]=function(_0x225215){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x10e'),_0x225215[_0xa67d('0xae')]));this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x225215,_0x225215[_0xa67d('0x10f')]);return this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x110'),_0x225215[_0xa67d('0x10f')]));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x111')]=function(_0x42c7c0){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x112'),_0x42c7c0['label']));if(!this[_0xa67d('0x86')](_0x42c7c0['aws_access_key_id'])||!this['isConfigured'](_0x42c7c0[_0xa67d('0x89')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0x113'));}if(!this[_0xa67d('0x86')](_0x42c7c0[_0xa67d('0x5d')])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0xa9'));}this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format']('Trying\x20aws\x20Polly\x20%s',_0x42c7c0[_0xa67d('0x5d')]));var _0x2c7142=this[_0xa67d('0x88')]['sync'](this,_0x42c7c0);if(_0x2c7142){this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')]('aws\x20Polly\x20%s\x20file\x20created',_0x2c7142));var _0x337cf7=this[_0xa67d('0xf')]['streamFile'](_0x2c7142);try{fs[_0xa67d('0x114')](_0x2c7142+'.wav');}catch(_0x13988c){logger[_0xa67d('0x2e')](_0x13988c);}return _0x337cf7;}return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x42c7c0,_0xa67d('0x115'));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x116')]=function(_0x500f0b){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x117'),_0x500f0b[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x500f0b[_0xa67d('0x8e')])||!this[_0xa67d('0x86')](_0x500f0b[_0xa67d('0x89')])){return this['channel'][_0xa67d('0xa8')](_0xa67d('0x113'));}if(!this['isConfigured'](_0x500f0b[_0xa67d('0x90')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x500f0b[_0xa67d('0x5d')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xa9'));}this[_0xa67d('0xf')]['bot']=!![];this[_0xa67d('0x37')](_0x500f0b);this[_0xa67d('0x41')](_0x500f0b['text'],'in','','');this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x118'),_0x500f0b[_0xa67d('0x5d')]));var _0x16812e=this['awsLex'][_0xa67d('0x72')](this,_0x500f0b);if(_0x16812e){for(var _0x29c37d in _0x16812e){if(_0x16812e['hasOwnProperty'](_0x29c37d)&&_[_0xa67d('0x98')](_0x16812e[_0x29c37d])){this[_0xa67d('0xf')][_0xa67d('0xa0')](util[_0xa67d('0x55')]('AWS_LEX_%s',_0x29c37d[_0xa67d('0x6a')]()),_0x16812e[_0x29c37d]);}}if(_['isNil'](_0x16812e['message'])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0x119'));}else{this[_0xa67d('0x41')](_0x16812e['message'],'out',_0xa67d('0x11a'),'');return this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format'](_0xa67d('0x11b'),_0x16812e[_0xa67d('0x11c')]));}}return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x500f0b,_0xa67d('0x11d'));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x11e')]=function(_0x41172c){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x41172c[_0xa67d('0xae')],_0x41172c[_0xa67d('0x66')]));if(!this[_0xa67d('0x86')](_0x41172c[_0xa67d('0x7a')])){return this['channel'][_0xa67d('0xa8')](_0xa67d('0x11f'));}var _0x6820=_0xa67d('0x120');var _0x1d2d55=util['format'](_0xa67d('0x121'),FILES_PATH,rs[_0xa67d('0x122')](0x4));var _0x4b8e2a=util[_0xa67d('0x55')](_0xa67d('0x9f'),_0x1d2d55,_0x6820);var _0x40575c=!![];if(_0x41172c[_0xa67d('0x123')]===_0xa67d('0x124')){_0x40575c=![];}var _0x2cf23a=this[_0xa67d('0xf')]['recordFile'](_0x1d2d55,_0x6820,_0x41172c['intKey'],_0x41172c[_0xa67d('0x66')],undefined,_0x40575c);if(_0x2cf23a[_0xa67d('0xa4')]!==-0x1){this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x125'),_0x4b8e2a));var _0x3dbfda=this[_0xa67d('0x91')][_0xa67d('0x72')](this,_0x41172c,_0x4b8e2a);if(_0x3dbfda){for(var _0x3ce8a1 in _0x3dbfda){if(_0x3dbfda[_0xa67d('0x97')](_0x3ce8a1)){this[_0xa67d('0xf')][_0xa67d('0xa0')](util[_0xa67d('0x55')]('GOOGLE_ASR_%s',_0x3ce8a1[_0xa67d('0x6a')]()),_0x3dbfda[_0x3ce8a1]);}}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x3dbfda)));}}return _0x2cf23a;};AGIVertices[_0xa67d('0x18')][_0xa67d('0x126')]=function(_0x19da4b){logger['info'](util['format'](_0xa67d('0x127'),_0x19da4b['label']));if(!this[_0xa67d('0x86')](_0x19da4b['appid'])){return this[_0xa67d('0xf')][_0xa67d('0xa8')]('no\x20appid\x20configured');}if(!this[_0xa67d('0x86')](_0x19da4b[_0xa67d('0x128')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0x129'));}var _0x1b631c=_0xa67d('0x120');var _0x2f1a1a=util[_0xa67d('0x55')]('%s/recordings/%s',FILES_PATH,rs[_0xa67d('0x122')](0x4));var _0x3d0300=util[_0xa67d('0x55')](_0xa67d('0x9f'),_0x2f1a1a,_0x1b631c);var _0x443c35=!![];if(_0x19da4b[_0xa67d('0x123')]===_0xa67d('0x124')){_0x443c35=![];}var _0x5076f0=this[_0xa67d('0xf')]['recordFile'](_0x2f1a1a,_0x1b631c,_0x19da4b[_0xa67d('0x12a')],_0x19da4b[_0xa67d('0x66')],undefined,_0x443c35);if(_0x5076f0['result']!==-0x1){this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')]('tilde\x20%s\x20file\x20created',_0x3d0300));var _0x403e32=this['tildeASR']['sync'](this,_0x19da4b,_0x3d0300);if(_0x403e32){for(var _0x4e4a3a in _0x403e32){if(_0x403e32[_0xa67d('0x97')](_0x4e4a3a)){this[_0xa67d('0xf')][_0xa67d('0xa0')](util['format'](_0xa67d('0x12b'),_0x4e4a3a[_0xa67d('0x6a')]()),_0x403e32[_0x4e4a3a]);}}return this['channel'][_0xa67d('0xa8')](util['format']('TildeASR\x20Result\x20%s',JSON[_0xa67d('0x74')](_0x403e32)));}}return _0x5076f0;};AGIVertices[_0xa67d('0x18')][_0xa67d('0x12c')]=function(_0x4e3e46){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x12d'),_0x4e3e46[_0xa67d('0xae')]));return this[_0xa67d('0xf')]['continueAt'](_0x4e3e46[_0xa67d('0x12e')],_0x4e3e46['extension'],_0x4e3e46['priority']);};AGIVertices[_0xa67d('0x18')][_0xa67d('0x12f')]=function(_0x3ae555){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x3ae555[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x3ae555['condition'])){return this['channel']['error'](_0x3ae555,_0xa67d('0x130'));}try{var _0x3011d1=eval(_0x3ae555[_0xa67d('0x131')])?_0xa67d('0x132'):_0xa67d('0x133');this['channel']['noop'](util['format'](_0xa67d('0x134'),_0x3ae555[_0xa67d('0x131')],_0x3011d1));return{'code':0xc8,'result':_0x3011d1};}catch(_0x44ebea){return{'code':0xc8,'result':_0xa67d('0x133')};}};AGIVertices[_0xa67d('0x18')]['gotoiftime']=function(_0x4f26cd){logger[_0xa67d('0x30')](util['format'](_0xa67d('0x135'),_0x4f26cd[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x4f26cd[_0xa67d('0x136')])){return this[_0xa67d('0xf')]['error'](_0x4f26cd,_0xa67d('0x137'));}var _0x46c467=this[_0xa67d('0x25')]['sync'](this,_0x4f26cd[_0xa67d('0x136')]);if(!_0x46c467){return this[_0xa67d('0xf')]['error'](_0x4f26cd,_0xa67d('0x138'));}for(var _0x204e15=0x0;_0x204e15<_0x46c467[_0xa67d('0x9d')];_0x204e15+=0x1){var _0x50d5f8=this[_0xa67d('0xf')][_0xa67d('0x12')](util[_0xa67d('0x55')]('IFTIME(%s?true:false)',_0x46c467[_0x204e15]));if(_0x50d5f8[_0xa67d('0xa4')]===-0x1){return _0x50d5f8;}logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x139'),_0x46c467[_0x204e15],_0x50d5f8[_0xa67d('0xa3')]));if(_0x50d5f8[_0xa67d('0xa3')]===_0xa67d('0x132')){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x139'),_0x46c467[_0x204e15],_0xa67d('0x132')));this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format'](_0xa67d('0x139'),_0x46c467[_0x204e15],_0xa67d('0x132')));return{'code':0xc8,'result':'true'};}else{logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('IFTIME\x20%s\x20%s',_0x46c467[_0x204e15],_0xa67d('0x133')));this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')]('IFTIME\x20%s\x20%s',_0x46c467[_0x204e15],_0xa67d('0x133')));}}return{'code':0xc8,'result':_0xa67d('0x133')};};AGIVertices['prototype']['hangup']=function(_0x43e92b){logger['info'](util['format'](_0xa67d('0x13a'),_0x43e92b[_0xa67d('0xae')]));return this['channel']['hangup']();};AGIVertices['prototype'][_0xa67d('0x13b')]=function(_0x62b5c1){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x13c'),_0x62b5c1[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x62b5c1[_0xa67d('0x7a')])){return this[_0xa67d('0xf')]['noop'](_0xa67d('0x11f'));}var _0x5bf004=_0xa67d('0x120');var _0x5ea2fd=util[_0xa67d('0x55')](_0xa67d('0x121'),FILES_PATH,rs[_0xa67d('0x122')](0x4));var _0x4ee367=util['format'](_0xa67d('0x9f'),_0x5ea2fd,_0x5bf004);var _0x2e3b51=!![];if(_0x62b5c1['beep']===_0xa67d('0x124')){_0x2e3b51=![];}var _0xde8c6e=this[_0xa67d('0xf')][_0xa67d('0x13d')](_0x5ea2fd,_0x5bf004,_0x62b5c1[_0xa67d('0x12a')],_0x62b5c1[_0xa67d('0x66')],undefined,_0x2e3b51);if(_0xde8c6e['result']!==-0x1){this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')](_0xa67d('0x13e'),_0x4ee367));var _0x1da847=this[_0xa67d('0x84')][_0xa67d('0x72')](this,_0x62b5c1,_0x4ee367);if(_0x1da847){for(var _0x4c33a6 in _0x1da847){if(_0x1da847[_0xa67d('0x97')](_0x4c33a6)){this[_0xa67d('0xf')][_0xa67d('0xa0')](util[_0xa67d('0x55')]('ISPEECH_ASR_%s',_0x4c33a6['toUpperCase']()),_0x1da847[_0x4c33a6]);}}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format']('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x1da847)));}}return _0xde8c6e;};AGIVertices['prototype'][_0xa67d('0x13f')]=function(_0x587a6a){logger['info'](util['format'](_0xa67d('0x140'),_0x587a6a['label']));if(!this[_0xa67d('0x86')](_0x587a6a[_0xa67d('0x7a')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')]('no\x20key\x20configured');}if(!this[_0xa67d('0x86')](_0x587a6a[_0xa67d('0x5d')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xa9'));}this[_0xa67d('0xf')]['noop'](util['format'](_0xa67d('0x141'),_0x587a6a[_0xa67d('0x5d')]));var _0x4439cb=this[_0xa67d('0x82')][_0xa67d('0x72')](this,_0x587a6a);if(_0x4439cb){this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x13e'),_0x4439cb));var _0x2eedf8=this[_0xa67d('0xf')][_0xa67d('0x142')](_0x4439cb,_0x587a6a[_0xa67d('0x12a')]);try{fs[_0xa67d('0x114')](_0x4439cb+_0xa67d('0xf4'));}catch(_0x3db40f){logger[_0xa67d('0x2e')](_0x3db40f);}return _0x2eedf8;}return this[_0xa67d('0xf')]['error'](_0x587a6a,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xa67d('0x18')][_0xa67d('0x143')]=function(_0x5b9ba4){logger[_0xa67d('0x30')](util['format'](_0xa67d('0x144'),_0x5b9ba4[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x5b9ba4[_0xa67d('0x145')])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x5b9ba4,'no\x20find\x20by\x20configured');}logger['info'](util[_0xa67d('0x55')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x5b9ba4[_0xa67d('0x145')]));var _0x1013e8=this[_0xa67d('0x53')][_0xa67d('0x72')](this,_0x5b9ba4['findBy']);if(_0x1013e8){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x146'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x5b9ba4[_0xa67d('0x145')]));this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x146'),this[_0xa67d('0xf')]['callerid'],_0x5b9ba4[_0xa67d('0x145')]));return{'code':0xc8,'result':_0xa67d('0x147')};}else{logger['info'](util[_0xa67d('0x55')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x5b9ba4[_0xa67d('0x145')]));this['channel']['noop'](util['format'](_0xa67d('0x148'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x5b9ba4['findBy']));return{'code':0xc8,'result':_0xa67d('0x149')};}};AGIVertices['prototype']['logout']=function(_0x561aaa){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x561aaa[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x561aaa[_0xa67d('0x145')])){return this['channel'][_0xa67d('0x2e')](_0x561aaa,'no\x20find\x20by\x20configured');}logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x14a'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x561aaa[_0xa67d('0x145')]));var _0xfcdffc=this[_0xa67d('0x52')]['sync'](this,_0x561aaa[_0xa67d('0x145')]);if(_0xfcdffc){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x146'),this['channel']['callerid'],_0x561aaa[_0xa67d('0x145')]));this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x146'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x561aaa[_0xa67d('0x145')]));return{'code':0xc8,'result':_0xa67d('0x147')};}else{logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x148'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x561aaa[_0xa67d('0x145')]));this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')](_0xa67d('0x148'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x561aaa[_0xa67d('0x145')]));return{'code':0xc8,'result':_0xa67d('0x149')};}};AGIVertices[_0xa67d('0x18')][_0xa67d('0x14b')]=function(_0x147974){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x14c'),_0x147974[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x147974[_0xa67d('0x14d')])){return this[_0xa67d('0xf')]['error'](_0x147974,_0xa67d('0x14e'));}this['channel']['noop'](util[_0xa67d('0x55')]('math\x20%s',_0x147974[_0xa67d('0x14d')]));var _0x5e7e10=eval(_0x147974[_0xa67d('0x14d')]);if(!this[_0xa67d('0x86')](_0x147974[_0xa67d('0xce')])){return this['channel'][_0xa67d('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4c67a0=this[_0xa67d('0x12')][_0xa67d('0x72')](this,_0x147974[_0xa67d('0xce')]);if(!_0x4c67a0){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x147974,_0xa67d('0xd0'));}if(_[_0xa67d('0x9c')](_0x5e7e10)){var _0x3a9bd2=this;_0x5e7e10[_0xa67d('0x14f')](function(_0x40456e,_0x4e9b27){_0x3a9bd2['channel'][_0xa67d('0xa0')](util['format']('%s[%s]',_0x4c67a0,_0x4e9b27),_0x40456e);});return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x150'),_0x4c67a0));}else{return this[_0xa67d('0xf')][_0xa67d('0xa0')](_0x4c67a0,_0x5e7e10);}};AGIVertices[_0xa67d('0x18')][_0xa67d('0xc')]=function(_0x5d64a8){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x5d64a8[_0xa67d('0xae')]));if(_0x5d64a8['retry']===0x0){return this['maxRetry'](_0x5d64a8);}_0x5d64a8[_0xa67d('0xa6')]-=0x1;if(!this[_0xa67d('0x86')](_0x5d64a8[_0xa67d('0x102')])){return this[_0xa67d('0xf')]['error'](_0x5d64a8,_0xa67d('0x103'));}var _0x22074b=this['getSound'][_0xa67d('0x72')](this,_0x5d64a8['file_id']);if(!_0x22074b){return this['channel']['error'](_0x5d64a8,_0xa67d('0x105'));}var _0x166c01=this[_0xa67d('0xf')]['getData'](_0x22074b,_0x5d64a8[_0xa67d('0x151')],_0x5d64a8['digit']);var _0x3ae2af=_0x166c01[_0xa67d('0xa4')];if(_0x166c01[_0xa67d('0xa4')]===-0x1){this[_0xa67d('0x37')]['sync'](this,_0x5d64a8,'-1');return _0x166c01;}else if(_0x166c01[_0xa67d('0xa3')]===_0xa67d('0x66')){_0x166c01[_0xa67d('0xa4')]=_0x166c01[_0xa67d('0xa4')][_0xa67d('0x9d')]>0x0?_0x166c01[_0xa67d('0xa4')]:'t';}else if(_[_0xa67d('0x43')](_0x166c01[_0xa67d('0xa4')])){_0x166c01[_0xa67d('0xa4')]='#';_0x3ae2af='#';}if(!this[_0xa67d('0x86')](_0x5d64a8[_0xa67d('0xce')])){this[_0xa67d('0xf')][_0xa67d('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x130f9a=this[_0xa67d('0x12')][_0xa67d('0x72')](this,_0x5d64a8[_0xa67d('0xce')]);if(!_0x130f9a){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x5d64a8,_0xa67d('0xd0'));}this[_0xa67d('0xf')]['setVariable'](_0x130f9a,_0x3ae2af);}this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x5d64a8,_0x3ae2af);return _0x166c01;};AGIVertices[_0xa67d('0x18')][_0xa67d('0xa8')]=function(_0x48e85e){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x152'),_0x48e85e[_0xa67d('0xae')]));return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0x48e85e[_0xa67d('0x153')]||_0x48e85e[_0xa67d('0xae')]);};AGIVertices['prototype'][_0xa67d('0x154')]=function(_0x186de5){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x155'),_0x186de5[_0xa67d('0xae')]));if(!this['isConfigured'](_0x186de5['findBy'])){return this[_0xa67d('0xf')]['error'](_0x186de5,'no\x20find\x20by\x20configured');}logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x14a'),this[_0xa67d('0xf')]['callerid'],_0x186de5[_0xa67d('0x145')]));var _0x48ad65=this[_0xa67d('0x4d')][_0xa67d('0x72')](this,_0x186de5[_0xa67d('0x156')]);var _0x1435c7=this[_0xa67d('0x4f')][_0xa67d('0x72')](this,_0x186de5[_0xa67d('0x145')],_0x48ad65);if(_0x1435c7){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x186de5[_0xa67d('0x145')]));this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x146'),this[_0xa67d('0xf')]['callerid'],_0x186de5[_0xa67d('0x145')]));return{'code':0xc8,'result':'success'};}else{logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x148'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x186de5[_0xa67d('0x145')]));this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x146'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x186de5[_0xa67d('0x145')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xa67d('0x18')][_0xa67d('0x157')]=function(_0x30316b){logger['info'](util[_0xa67d('0x55')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x30316b[_0xa67d('0xae')]));if(!this['isConfigured'](_0x30316b[_0xa67d('0x102')])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x30316b,_0xa67d('0x103'));}var _0x310d58=this[_0xa67d('0x104')][_0xa67d('0x72')](this,_0x30316b[_0xa67d('0x102')]);if(!_0x310d58){return this['channel'][_0xa67d('0x2e')](_0x30316b,_0xa67d('0x105'));}var _0x113879=this[_0xa67d('0xf')][_0xa67d('0x59')](_0xa67d('0x158'),[_0x310d58,_0x30316b[_0xa67d('0xdb')]]);if(_0x113879[_0xa67d('0xa4')]===-0x1){return _0x113879;}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xbe'),_0xa67d('0x158'),_0x310d58));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x159')]=function(_0x41216a){logger[_0xa67d('0x30')](util['format'](_0xa67d('0x15a'),_0x41216a[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x41216a['queue_id'])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x41216a,'no\x20queue\x20selected');}var _0x231423='';var _0x1e7e14=parseInt(_0x41216a['queue_id'],0xa);if(isNaN(_0x1e7e14)){_0x231423=_0x41216a[_0xa67d('0x15b')];}else{_0x231423=this[_0xa67d('0x14')][_0xa67d('0x72')](this,_0x41216a[_0xa67d('0x15b')]);if(!_0x231423){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x41216a,_0xa67d('0x15c'));}}var _0x40a0f7='';if(this['isConfigured'](_0x41216a[_0xa67d('0x102')])){var _0x4cc7a6=this[_0xa67d('0x104')][_0xa67d('0x72')](this,_0x41216a[_0xa67d('0x102')]);if(_0x4cc7a6){_0x40a0f7=_0x4cc7a6;}}this[_0xa67d('0x37')]['sync'](this,_0x41216a,_0x231423);if(_0x41216a['opts'][_0xa67d('0x15d')]('x')<0x0){_0x41216a[_0xa67d('0xdb')]+='x';}if(_0x41216a['opts']['indexOf']('X')<0x0){_0x41216a[_0xa67d('0xdb')]+='X';}this['channel'][_0xa67d('0xa0')](_0xa67d('0x15e'),_0x231423?_0x231423[_0xa67d('0x15f')]():'');var _0x34bef5=this['channel'][_0xa67d('0x59')](_0xa67d('0x160'),[_0x231423,_0x41216a[_0xa67d('0xdb')],_0x41216a[_0xa67d('0x63')],_0x40a0f7,_0x41216a[_0xa67d('0x66')],_0x41216a[_0xa67d('0x8')],_0x41216a[_0xa67d('0x161')],_0x41216a[_0xa67d('0x162')],'',_0x41216a[_0xa67d('0x163')]]);if(_0x34bef5['result']===-0x1){return _0x34bef5;}return this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')](_0xa67d('0xbe'),_0xa67d('0x160'),_0x231423));};AGIVertices['prototype']['record']=function(_0xdec7b9){logger[_0xa67d('0x30')](util['format'](_0xa67d('0x164'),_0xdec7b9[_0xa67d('0xae')]));var _0xe8cc85=_0xdec7b9['recordingFormat']||_0xa67d('0x120');var _0x163849=util[_0xa67d('0x55')](_0xa67d('0x165'),this[_0xa67d('0xf')][_0xa67d('0x38')],rs[_0xa67d('0x122')](0x5));var _0x1902bf=util['format'](_0xa67d('0x166'),FILES_PATH,_0x163849,_0xe8cc85);var _0x550a25=util[_0xa67d('0x55')](_0xa67d('0x121'),FILES_PATH,_0x163849);this['createSquareRecording'][_0xa67d('0x72')](this,_0xdec7b9,_0x163849,_0x1902bf);this[_0xa67d('0xf')][_0xa67d('0xa0')](_0xa67d('0x167'),_0x163849);logger[_0xa67d('0x30')](_0xa67d('0x168'),_0x550a25,_0xe8cc85,_0xdec7b9[_0xa67d('0x169')],_0xdec7b9[_0xa67d('0x66')]);return this['channel'][_0xa67d('0x13d')](_0x550a25,_0xe8cc85,_0xdec7b9[_0xa67d('0x169')],_0xdec7b9[_0xa67d('0x66')],undefined,!![]);};AGIVertices[_0xa67d('0x18')][_0xa67d('0x16a')]=function(_0x38ac8c){logger['info'](util[_0xa67d('0x55')](_0xa67d('0x16b'),_0x38ac8c[_0xa67d('0xae')]));if(!this['isConfigured'](_0x38ac8c[_0xa67d('0x63')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0x16c'));}var _0x551ffb=this[_0xa67d('0x16d')][_0xa67d('0x72')](this,_0x38ac8c);logger[_0xa67d('0x30')](util['format'](_0xa67d('0x16e'),util[_0xa67d('0x16f')](_0x551ffb,{'showHidden':![],'depth':null})));if(!this[_0xa67d('0x86')](_0x38ac8c[_0xa67d('0xce')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0x170'));}var _0x208aa2=this['getVariable'][_0xa67d('0x72')](this,_0x38ac8c['variable_id']);if(!_0x208aa2){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x38ac8c,'no\x20variable\x20found');}this[_0xa67d('0xf')]['setVariable'](util[_0xa67d('0x55')](_0xa67d('0x171'),_0x208aa2),_0x551ffb[_0xa67d('0x76')]?_0x551ffb[_0xa67d('0x76')]:'200');this[_0xa67d('0xf')][_0xa67d('0xa0')](util[_0xa67d('0x55')]('%s_STATUS_MESSAGE',_0x208aa2),_0x551ffb['statusMessage']?_0x551ffb[_0xa67d('0x77')]:'OK');if(_0x551ffb[_0xa67d('0x6b')]){try{this[_0xa67d('0x172')](_0x551ffb['body'],_0x208aa2);}catch(_0x3a99db){logger['error'](util[_0xa67d('0x55')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x208aa2));}}return this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0xd4'),_0x208aa2));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x173')]=function(_0x56ad54){logger['info'](util[_0xa67d('0x55')](_0xa67d('0x174'),_0x56ad54[_0xa67d('0xae')]));return this[_0xa67d('0xf')]['sayDigits'](_0x56ad54['digits'][_0xa67d('0x5a')](/\s+/g,''),_0x56ad54[_0xa67d('0x169')]);};AGIVertices[_0xa67d('0x18')][_0xa67d('0x175')]=function(_0x4aa48f){logger['info'](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x4aa48f[_0xa67d('0xae')]));return this['channel'][_0xa67d('0x176')](_0x4aa48f[_0xa67d('0x65')][_0xa67d('0x5a')](/\s+/g,''),_0x4aa48f[_0xa67d('0x169')]);};AGIVertices[_0xa67d('0x18')][_0xa67d('0x177')]=function(_0x2d6bb5){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x178'),_0x2d6bb5[_0xa67d('0xae')]));return this[_0xa67d('0xf')][_0xa67d('0x179')](_0x2d6bb5[_0xa67d('0x5d')],_0x2d6bb5[_0xa67d('0x169')]);};AGIVertices[_0xa67d('0x18')][_0xa67d('0x17a')]=function(_0x152115){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x17b'),_0x152115['label']));if(!this['isConfigured'](_0x152115['account_id'])){return this['channel'][_0xa67d('0xa8')](_0xa67d('0x17c'));}var _0x8909b5=this[_0xa67d('0x22')][_0xa67d('0x72')](this,_0x152115['account_id']);if(!_0x8909b5||!_0x8909b5[_0xa67d('0x17d')]){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x152115,_0xa67d('0x17e'));}var _0x3038e1={'from':util['format'](_0xa67d('0x17f'),_0x8909b5['name'],_0x8909b5[_0xa67d('0x180')]||_0x8909b5[_0xa67d('0x17d')][_0xa67d('0x181')]),'to':_0x152115['to']||'','cc':_0x152115['cc']||'','bcc':_0x152115[_0xa67d('0x182')]||'','subject':_0x152115[_0xa67d('0x183')],'html':_0x152115[_0xa67d('0x5d')],'text':_0x152115[_0xa67d('0x5d')]};if(this[_0xa67d('0x86')](_0x152115[_0xa67d('0x184')])){}logger['debug'](_0xa67d('0x185'),JSON[_0xa67d('0x74')](_0x3038e1));this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x152115,_0x152115[_0xa67d('0x186')]);this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x187'),_0x8909b5[_0xa67d('0x16')]));this[_0xa67d('0x24')][_0xa67d('0x72')](this,_0x8909b5[_0xa67d('0x188')],_0x3038e1);return this[_0xa67d('0xf')][_0xa67d('0xa8')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xa67d('0x18')]['sendFax']=function(_0x23fc96){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x189'),_0x23fc96[_0xa67d('0xae')]));return this[_0xa67d('0xf')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xa67d('0x18')][_0xa67d('0x18a')]=function(_0x10e651){logger['info'](util[_0xa67d('0x55')](_0xa67d('0x18b'),_0x10e651[_0xa67d('0xae')]));if(!this['isConfigured'](_0x10e651[_0xa67d('0x18c')])){return this['channel'][_0xa67d('0xa8')](_0xa67d('0x18d'));}var _0x21ba72=this[_0xa67d('0x18e')][_0xa67d('0x72')](this,_0x10e651[_0xa67d('0x18c')]);if(!_0x21ba72){return this['channel'][_0xa67d('0x2e')](_0x10e651,_0xa67d('0x18f'));}var _0x5c8789={'body':_0x10e651[_0xa67d('0x190')],'phone':_0x10e651['to']||'','SmsAccountId':_0x21ba72['id']};logger['debug'](_0xa67d('0x191'),JSON['stringify'](_0x5c8789));this[_0xa67d('0x37')][_0xa67d('0x72')](this,_0x10e651,_0x10e651['sms_account_id']);this['channel'][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x192'),_0x21ba72['name']));this['createSmsMessage'][_0xa67d('0x72')](this,_0x5c8789);return this[_0xa67d('0xf')]['noop'](_0xa67d('0x193'));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x194')]=function(_0xb9b514){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x195'),_0xb9b514['label']));if(!this['isConfigured'](_0xb9b514[_0xa67d('0xce')])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0xb9b514,_0xa67d('0x196'));}var _0x4f03d9=this[_0xa67d('0x12')][_0xa67d('0x72')](this,_0xb9b514[_0xa67d('0xce')]);if(!_0x4f03d9){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0xb9b514,_0xa67d('0xd0'));}return this['channel'][_0xa67d('0xa0')](_0x4f03d9,_0xb9b514[_0xa67d('0x197')]);};AGIVertices[_0xa67d('0x18')][_0xa67d('0x198')]=function(_0x235cb1){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('Enter\x20in\x20START\x20(%s)\x20block',_0x235cb1['label']));this['channel']['noop'](_0xa67d('0x199'));if(_0x235cb1[_0xa67d('0xb8')]===_0xa67d('0x19a')){this[_0xa67d('0xf')][_0xa67d('0xa8')]('Answer');return this[_0xa67d('0xf')][_0xa67d('0xb8')]();}return this['channel']['noop'](_0xa67d('0x19b'));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x19c')]=function(_0x5d4e94){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x19d'),_0x5d4e94[_0xa67d('0xae')]));if(!this[_0xa67d('0x86')](_0x5d4e94[_0xa67d('0x19e')])){return this['channel'][_0xa67d('0x2e')](_0x5d4e94,'no\x20subproject\x20selected');}var _0x31a9c0=this[_0xa67d('0x19f')][_0xa67d('0x72')](this,_0x5d4e94['project_id']);if(!this[_0xa67d('0x86')](_0x31a9c0)){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x5d4e94,util['format'](_0xa67d('0x1a0'),_0x5d4e94['project_id']));}if(_0x31a9c0===this[_0xa67d('0xf')][_0xa67d('0x3a')]){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x5d4e94,_0xa67d('0x1a1'));}this[_0xa67d('0x37')]['sync'](this,_0x5d4e94,_0x31a9c0);var _0x2bbbd2=this[_0xa67d('0xf')][_0xa67d('0x59')](_0xa67d('0x1a2'),util['format'](_0xa67d('0x1a3'),config[_0xa67d('0x8')][_0xa67d('0x1a4')]||_0xa67d('0x1a5'),_0x31a9c0,this[_0xa67d('0xf')]['arg_1']));if(_0x2bbbd2[_0xa67d('0xa4')]===-0x1){return _0x2bbbd2;}return this['channel']['noop'](util[_0xa67d('0x55')]('Executed\x20command\x20%s\x20%s','AGI',_0x31a9c0));};AGIVertices['prototype'][_0xa67d('0x1a6')]=function(_0x5d6984){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x1a7'),_0x5d6984['label']));var _0x5698a8=this[_0xa67d('0x58')][_0xa67d('0x72')](this,_0x5d6984[_0xa67d('0xb6')]);this[_0xa67d('0x37')]['sync'](this,_0x5d6984,_0x5d6984[_0xa67d('0xb6')]);if(this[_0xa67d('0x86')](_0x5d6984[_0xa67d('0xce')])){var _0x45dd11=this[_0xa67d('0x12')][_0xa67d('0x72')](this,_0x5d6984[_0xa67d('0xce')]);if(_0x45dd11){this[_0xa67d('0xf')][_0xa67d('0xa0')](_0x45dd11,_0x5698a8);return this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format'](_0xa67d('0x1a8'),_0x5d6984[_0xa67d('0xb6')],_0x45dd11));}}return this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')](_0xa67d('0x1a9'),_0x5d6984['command']));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x1aa')]=function(_0x4fb85f){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x1ab'),_0x4fb85f[_0xa67d('0xae')]));_0x4fb85f[_0xa67d('0x5d')]=_0x4fb85f[_0xa67d('0x5d')][_0xa67d('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa67d('0x86')](_0x4fb85f[_0xa67d('0x5c')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0x1ac'));}if(!this[_0xa67d('0x86')](_0x4fb85f[_0xa67d('0x5d')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xa9'));}this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x4fb85f[_0xa67d('0x5d')]));var _0x2b0c3c=this['googleCloudTTS'][_0xa67d('0x72')](this,_0x4fb85f);if(_0x2b0c3c){this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2b0c3c));var _0x38c919=this['channel']['streamFile'](_0x2b0c3c);try{fs['unlink'](_0x2b0c3c+_0xa67d('0xf4'));}catch(_0x1fc06a){logger[_0xa67d('0x2e')](_0x1fc06a);}return _0x38c919;}return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x4fb85f,_0xa67d('0x1ad'));};AGIVertices['prototype']['tts']=function(_0x55a82e){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x1ae'),_0x55a82e[_0xa67d('0xae')]));_0x55a82e['text']=_0x55a82e[_0xa67d('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa67d('0x86')](_0x55a82e[_0xa67d('0x5d')])){return this[_0xa67d('0xf')][_0xa67d('0xa8')](_0xa67d('0xa9'));}this[_0xa67d('0xf')]['noop'](util['format'](_0xa67d('0x1af'),_0x55a82e[_0xa67d('0x5d')]));var _0x52374b=this[_0xa67d('0x1b0')]['sync'](this,_0x55a82e);if(_0x52374b){this[_0xa67d('0xf')][_0xa67d('0xa8')](util['format'](_0xa67d('0x1b1'),_0x52374b));var _0x22a1ab=this[_0xa67d('0xf')][_0xa67d('0x142')](_0x52374b);try{fs[_0xa67d('0x114')](_0x52374b+'.wav');}catch(_0x4bdc33){logger['error'](_0x4bdc33);}return _0x22a1ab;}return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x55a82e,_0xa67d('0x1b2'));};AGIVertices['prototype'][_0xa67d('0x1b3')]=function(_0x35ee19){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x1b4'),_0x35ee19['label']));if(!this['isConfigured'](_0x35ee19[_0xa67d('0x145')])){return this['channel'][_0xa67d('0x2e')](_0x35ee19,'no\x20find\x20by\x20configured');}logger['info'](util[_0xa67d('0x55')](_0xa67d('0x14a'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x35ee19['findBy']));var _0x26daad=this[_0xa67d('0x51')]['sync'](this,_0x35ee19['findBy']);if(_0x26daad){logger[_0xa67d('0x30')](util[_0xa67d('0x55')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x35ee19[_0xa67d('0x145')]));this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')](_0xa67d('0x146'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x35ee19[_0xa67d('0x145')]));return{'code':0xc8,'result':'success'};}else{logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x148'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x35ee19[_0xa67d('0x145')]));this[_0xa67d('0xf')][_0xa67d('0xa8')](util[_0xa67d('0x55')](_0xa67d('0x148'),this[_0xa67d('0xf')][_0xa67d('0x3b')],_0x35ee19[_0xa67d('0x145')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xa67d('0x18')][_0xa67d('0x1b5')]=function(_0x465026){logger['info'](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x465026['label']));var _0x3df284=this['channel'][_0xa67d('0x59')](_0xa67d('0x1b6'),[_0x465026['mailbox'],_0x465026[_0xa67d('0x78')]]);if(_0x3df284['result']===-0x1){return _0x3df284;}return this[_0xa67d('0xf')]['noop'](util[_0xa67d('0x55')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x465026['mailbox']));};AGIVertices[_0xa67d('0x18')][_0xa67d('0x1b7')]=function(_0x13e2d6){logger[_0xa67d('0x30')](util[_0xa67d('0x55')](_0xa67d('0x1b8'),_0x13e2d6['label']));if(!this[_0xa67d('0x86')](_0x13e2d6[_0xa67d('0xce')])){return this[_0xa67d('0xf')][_0xa67d('0x2e')](_0x13e2d6,_0xa67d('0x196'));}var _0x4c8241=this[_0xa67d('0x12')][_0xa67d('0x72')](this,_0x13e2d6[_0xa67d('0xce')]);if(!_0x4c8241){return this['channel'][_0xa67d('0x2e')](_0x13e2d6,_0xa67d('0xd0'));}var _0xec49ad=this[_0xa67d('0xf')][_0xa67d('0x12')](_0x4c8241);return{'code':0xc8,'result':_0xec49ad[_0xa67d('0xa3')]?_0xec49ad['extra']:'-'};};String['prototype'][_0xa67d('0xa2')]=function(_0x34e25d,_0x54352c){return this[_0xa67d('0xa1')](_0x34e25d)[_0xa67d('0x1b9')](_0x54352c);};module[_0xa67d('0x1ba')]=AGIVertices; \ No newline at end of file +var _0x515d=['delay','add','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','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','grammar','LUMENVOX_ASR_TRANSCRIPT','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','query:\x20%s','variable_id','forEach','%s[%s][%s]','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','providerResponse','toUpperCase','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','out','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','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','opts','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','bot','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','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','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','operation','no\x20operation\x20configured','no\x20variable\x20selected\x20for\x20the\x20result','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','digit','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','email','user','bcc','subject','debug','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','createSmsMessage','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','START\x20CALLY\x20SQUARE','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','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','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','getVariable','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Query\x20executed\x20correctly\x20%s','getSmsAccountById','createSquareDetailsReport','arg_1','createSquareRecording','uniqueid','callerid','calleridname','context','priority','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','scheduledAt','callback_priority','getPauseById','agentPause','agent','isNil','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','restAPI','url','method','timeout','number','includes','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','length','replaceAllVariables','saveRestApiResult','isPlainObject','%s.%s','isArray','split','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','retry','label','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x515d,0x104));var _0xd515=function(_0x2c643e,_0x1df76e){_0x2c643e=_0x2c643e-0x0;var _0x5107db=_0x515d[_0x2c643e];return _0x5107db;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0xd515('0x0'));var sh=require(_0xd515('0x1'));var odbc=require(_0xd515('0x2'))();var rs=require(_0xd515('0x3'));var moment=require(_0xd515('0x4'));var Mustache=require(_0xd515('0x5'));var rp=require(_0xd515('0x6'));var logger=require(_0xd515('0x7'))('agi');var config=require(_0xd515('0x8'));var shared=require('../../config/environment/shared');var scripts=require('./scripts');var FILES_PATH=_0xd515('0x9');var recursiveMapAttributes=[_0xd515('0xa'),_0xd515('0xb')];var verticesWithRetry=[_0xd515('0xc'),_0xd515('0xd'),'getsecretdigits'];var AGIVertices=function(_0x31d6b6,_0x20e3b4,_0x138086){this[_0xd515('0xe')]=_0x31d6b6;this[_0xd515('0xf')]=_0x20e3b4;this[_0xd515('0x10')]=_0x138086;};AGIVertices['prototype'][_0xd515('0x11')]=function(_0x393738,_0x95172c){this[_0xd515('0xf')]['getVariableById'](_0x393738)[_0xd515('0x12')](function(_0xd2441e){_0x95172c(null,_0xd2441e?_0xd2441e[_0xd515('0x13')]:![]);})[_0xd515('0x14')](function(_0x1d6bda){_0x95172c(_0x1d6bda);});};AGIVertices[_0xd515('0x15')][_0xd515('0x16')]=function(_0x467231,_0x1f23b7){this[_0xd515('0xf')][_0xd515('0x17')](_0x467231)[_0xd515('0x12')](function(_0x335a97){_0x1f23b7(null,_0x335a97?_0x335a97['name']:![]);})[_0xd515('0x14')](function(_0xc41eca){_0x1f23b7(_0xc41eca);});};AGIVertices[_0xd515('0x15')][_0xd515('0x18')]=function(_0x41333e,_0x33dbb6){this[_0xd515('0xf')][_0xd515('0x19')](_0x41333e)[_0xd515('0x12')](function(_0x564c4e){_0x33dbb6(null,_0x564c4e?_0x564c4e['name']:![]);})[_0xd515('0x14')](function(_0x2b0173){_0x33dbb6(_0x2b0173);});};AGIVertices[_0xd515('0x15')][_0xd515('0x1a')]=function(_0x1ef858,_0x2dc458){this[_0xd515('0xf')][_0xd515('0x1b')](_0x1ef858)[_0xd515('0x12')](function(_0x5c7fef){_0x2dc458(null,_0x5c7fef?_0x5c7fef[_0xd515('0x1c')]:![]);})[_0xd515('0x14')](function(_0x5b1649){_0x2dc458(_0x5b1649);});};AGIVertices[_0xd515('0x15')][_0xd515('0x1d')]=function(_0x2b2ed5,_0x4e9d06){this[_0xd515('0xf')][_0xd515('0x1e')](_0x2b2ed5)[_0xd515('0x12')](function(_0x299b46){_0x4e9d06(null,_0x299b46?_0x299b46['name']:![]);})[_0xd515('0x14')](function(_0x11cc9f){_0x4e9d06(_0x11cc9f);});};AGIVertices[_0xd515('0x15')][_0xd515('0x1f')]=function(_0x1a5f58,_0x1d8919){this[_0xd515('0xf')][_0xd515('0x20')](_0x1a5f58)[_0xd515('0x12')](function(_0x5cf549){_0x1d8919(null,_0x5cf549?_0x5cf549['name']:![]);})[_0xd515('0x14')](function(_0x2b803a){_0x1d8919(_0x2b803a);});};AGIVertices[_0xd515('0x15')][_0xd515('0x21')]=function(_0x1d70a8,_0x2171bc){var _0x134b87=this;this[_0xd515('0xf')]['getSoundById'](_0x1d70a8)[_0xd515('0x12')](function(_0x290489){_0x2171bc(null,_0x290489?_0x134b87[_0xd515('0x22')](_0x290489[_0xd515('0x23')]):![]);})[_0xd515('0x14')](function(_0x2541da){_0x2171bc(_0x2541da);});};AGIVertices[_0xd515('0x15')]['getMailAccount']=function(_0x587bdc,_0x5d4f45){this[_0xd515('0xf')][_0xd515('0x24')](_0x587bdc)[_0xd515('0x12')](function(_0x50f61f){_0x5d4f45(null,_0x50f61f?_0x50f61f:![]);})['catch'](function(_0x483846){_0x5d4f45(_0x483846);});};AGIVertices[_0xd515('0x15')][_0xd515('0x25')]=function(_0x446743,_0x3d4e10,_0xc4fdff){this['mailRpc'][_0xd515('0x25')](_0x446743,_0x3d4e10)['then'](function(){_0xc4fdff(null);})[_0xd515('0x14')](function(_0xbf096f){_0xc4fdff(_0xbf096f);});};AGIVertices[_0xd515('0x15')][_0xd515('0x26')]=function(_0x3256fa,_0x129156){this[_0xd515('0xf')]['getIntervalById'](_0x3256fa)[_0xd515('0x12')](function(_0x22f532){if(_0x22f532){if(_0x22f532[_0xd515('0x27')]){_0x129156(null,[_0x22f532[_0xd515('0x28')]]);}else{_0x129156(null,_[_0xd515('0x29')](_0x22f532['Intervals'],_0xd515('0x28')));}}else{_0x129156(null,![]);}})['catch'](function(_0x4489b5){_0x129156(_0x4489b5);});};AGIVertices[_0xd515('0x15')][_0xd515('0x22')]=function(_0x299b6f){return util[_0xd515('0x2a')](_0xd515('0x2b'),FILES_PATH,_0x299b6f);};AGIVertices[_0xd515('0x15')][_0xd515('0x2c')]=function(_0x18abb3,_0x423f67,_0x3e523c){odbc[_0xd515('0x2d')](_0x18abb3,function(_0x59a029){if(_0x59a029){logger[_0xd515('0x2e')](_0xd515('0x2f'),_0x59a029);_0x3e523c(_0x59a029);}else{logger[_0xd515('0x30')]('ODBC\x20connection\x20successfully');odbc[_0xd515('0x31')](_0x423f67,function(_0x5072f5,_0x5cd658){if(_0x5072f5){logger['info']('Error\x20executing\x20query\x20%s',_0x423f67);_0x3e523c(_0x5072f5);}else{logger[_0xd515('0x30')](_0xd515('0x32'),_0x423f67);odbc['close'](function(_0x2af989){if(_0x2af989){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x2af989);}_0x3e523c(null,_0x5cd658);});}});}});};AGIVertices[_0xd515('0x15')]['getSmsAccount']=function(_0x4bf6e4,_0x2c2def){this[_0xd515('0xf')][_0xd515('0x33')](_0x4bf6e4)[_0xd515('0x12')](function(_0x32abc5){_0x2c2def(null,_0x32abc5?_0x32abc5:![]);})[_0xd515('0x14')](function(_0x15ef1a){_0x2c2def(_0x15ef1a);});};AGIVertices[_0xd515('0x15')]['createSmsMessage']=function(_0x1c59c4,_0x324ecf){this[_0xd515('0xf')]['createSmsMessage'](_0x1c59c4)[_0xd515('0x12')](function(_0x11928c){_0x324ecf(null,_0x11928c);})[_0xd515('0x14')](function(_0x56f186){_0x324ecf(_0x56f186);});};AGIVertices['prototype'][_0xd515('0x34')]=function(_0x3d752,_0x2e55b3,_0x2c57dc){this[_0xd515('0xf')][_0xd515('0x34')]({'uniqueid':this[_0xd515('0xe')]['uniqueid'],'node':_0x3d752['label'],'application':_0x3d752['agicommand'],'data':_0x2e55b3||null,'project_name':this[_0xd515('0xe')][_0xd515('0x35')],'callerid':this[_0xd515('0xe')]['callerid']})[_0xd515('0x12')](function(_0x3d7248){if(_0x2c57dc){_0x2c57dc(null,_0x3d7248);}})[_0xd515('0x14')](function(_0xea6927){if(_0x2c57dc){_0x2c57dc(_0xea6927);}});};AGIVertices[_0xd515('0x15')]['createSquareRecording']=function(_0x2f365c,_0x201a9b,_0x282ad4,_0xa36372){this[_0xd515('0xf')][_0xd515('0x36')]({'uniqueid':this['channel'][_0xd515('0x37')],'callerid':this['channel'][_0xd515('0x38')],'calleridname':this[_0xd515('0xe')][_0xd515('0x39')],'context':this['channel'][_0xd515('0x3a')],'extension':this[_0xd515('0xe')]['extension'],'priority':this[_0xd515('0xe')][_0xd515('0x3b')],'accountcode':this[_0xd515('0xe')]['accountcode'],'dnid':this[_0xd515('0xe')]['dnid'],'projectName':this[_0xd515('0xe')][_0xd515('0x35')],'saveName':_0x201a9b,'filename':_0x2f365c[_0xd515('0x3c')]||_0x201a9b,'savePath':_0x282ad4})['then'](function(_0x111ab9){_0xa36372(null,_0x111ab9);})['catch'](function(_0x6cdd83){_0xa36372(_0x6cdd83);});};AGIVertices[_0xd515('0x15')][_0xd515('0x3d')]=function(_0xe84589,_0x4e2ec2,_0x50a25a,_0xc24757,_0x409f2c){this[_0xd515('0xf')][_0xd515('0x3d')]({'uniqueid':this['channel']['uniqueid'],'body':_0xe84589,'direction':_0x4e2ec2,'providerName':_0x50a25a,'providerResponse':_0xc24757})[_0xd515('0x12')](function(_0x5a095e){if(_0x409f2c){_0x409f2c(null,_0x5a095e);}})[_0xd515('0x14')](function(_0x5eded4){if(_0x409f2c){_0x409f2c(_0x5eded4);}});};AGIVertices[_0xd515('0x15')][_0xd515('0x3e')]=function(_0x1eb3f7,_0x197c7b){this['rpc']['createCmContact']({'firstName':_[_0xd515('0x3f')](_0x1eb3f7[_0xd515('0x13')])||_['isNil'](_0x1eb3f7[_0xd515('0x13')])?_0xd515('0x40')+Math[_0xd515('0x41')]():_0x1eb3f7[_0xd515('0x13')],'lastName':_[_0xd515('0x3f')](_0x1eb3f7[_0xd515('0x42')])||_['isNil'](_0x1eb3f7['lastName'])?null:_0x1eb3f7[_0xd515('0x42')],'phone':_0x1eb3f7[_0xd515('0x43')],'ListId':_0x1eb3f7[_0xd515('0x44')],'scheduledat':_0x1eb3f7['scheduledAt'],'callbackUniqueid':this[_0xd515('0xe')][_0xd515('0x37')],'tags':'callback','description':_0xd515('0x45')+_0x1eb3f7[_0xd515('0x46')]['toString'](),'priority':_0x1eb3f7[_0xd515('0x47')]})[_0xd515('0x12')](function(_0x3c3958){_0x197c7b(null,_0x3c3958);})[_0xd515('0x14')](function(_0x2c9d0a){_0x197c7b(_0x2c9d0a);});};AGIVertices[_0xd515('0x15')]['getPause']=function(_0x1a485b,_0x53ae07){this[_0xd515('0xf')][_0xd515('0x48')](_0x1a485b)[_0xd515('0x12')](function(_0x538fa6){_0x53ae07(null,_0x538fa6?_0x538fa6[_0xd515('0x13')]:![]);})[_0xd515('0x14')](function(_0xeee862){_0x53ae07(_0xeee862);});};AGIVertices[_0xd515('0x15')][_0xd515('0x49')]=function(_0x21ffed,_0x1ec36d,_0x2d9c6a){var _0x48833e={'role':_0xd515('0x4a')};_0x48833e[_0x21ffed]=this[_0xd515('0xe')][_0xd515('0x38')];this[_0xd515('0xf')][_0xd515('0x49')](_0x48833e,_0x1ec36d,this[_0xd515('0xe')][_0xd515('0x37')])[_0xd515('0x12')](function(_0x1e9f75){_0x2d9c6a(null,_[_0xd515('0x4b')](_0x1e9f75)?![]:!![]);})[_0xd515('0x14')](function(_0x13cbbe){logger[_0xd515('0x2e')](_0x13cbbe);_0x2d9c6a(null,![]);});};AGIVertices[_0xd515('0x15')][_0xd515('0x4c')]=function(_0x366ebe,_0x31967c){var _0x66372e={'role':'agent'};_0x66372e[_0x366ebe]=this[_0xd515('0xe')][_0xd515('0x38')];this['rpc'][_0xd515('0x4c')](_0x66372e)[_0xd515('0x12')](function(_0x2415cb){_0x31967c(null,_[_0xd515('0x4b')](_0x2415cb)?![]:!![]);})['catch'](function(_0x563d05){logger[_0xd515('0x2e')](_0x563d05);_0x31967c(null,![]);});};AGIVertices[_0xd515('0x15')][_0xd515('0x4d')]=function(_0x5296e1,_0x35eda8){var _0x80ac4a={'role':_0xd515('0x4a')};_0x80ac4a[_0x5296e1]=this[_0xd515('0xe')][_0xd515('0x38')];this[_0xd515('0xf')][_0xd515('0x4d')](_0x80ac4a)['then'](function(_0x154f54){_0x35eda8(null,_[_0xd515('0x4b')](_0x154f54)?![]:!![]);})[_0xd515('0x14')](function(_0x2dc0a5){logger['error'](_0x2dc0a5);_0x35eda8(null,![]);});};AGIVertices[_0xd515('0x15')][_0xd515('0x4e')]=function(_0x23d5e6,_0x2d3523){var _0x2420a6={'role':_0xd515('0x4a')};_0x2420a6[_0x23d5e6]=this['channel'][_0xd515('0x38')];var _0x40e6e4=_0x23d5e6!=_0xd515('0x4f')?util[_0xd515('0x2a')](_0xd515('0x50'),_0xd515('0x51'),this[_0xd515('0xe')]['callerid']):undefined;this['rpc'][_0xd515('0x4e')](_0x2420a6,_0x40e6e4)[_0xd515('0x12')](function(_0x5a3d13){_0x2d3523(null,_[_0xd515('0x4b')](_0x5a3d13)?![]:!![]);})[_0xd515('0x14')](function(_0x601d2d){logger[_0xd515('0x2e')](_0x601d2d);_0x2d3523(null,![]);});};AGIVertices[_0xd515('0x15')][_0xd515('0x52')]=function(_0x14576c,_0x545778){sh[_0xd515('0x53')](_[_0xd515('0x54')](_0x14576c),function(_0x55afde,_0x131438){var _0x2d4f14=_0x131438[_0xd515('0x55')](/(\r\n|\n|\r)/gm,'');_0x545778(null,_0x2d4f14);});};AGIVertices['prototype'][_0xd515('0x56')]=function(_0xb6bda5,_0x37c75e){scripts['googleCloudTTS'](_0xb6bda5[_0xd515('0x57')],_0xb6bda5[_0xd515('0x58')]||_0xd515('0x59'),_0xb6bda5[_0xd515('0x59')],_0xb6bda5[_0xd515('0x5a')]||_0xd515('0x5b'),_0xb6bda5[_0xd515('0x5c')]||'MALE',_0xb6bda5[_0xd515('0x5d')]||_0xd515('0x5e'))['then'](function(_0x304fa0){_0x37c75e(null,_0x304fa0);})['catch'](function(_0x1136c9){_0x37c75e(_0x1136c9);});};AGIVertices[_0xd515('0x15')][_0xd515('0x5f')]=function(_0x11066b,_0x1649ea){scripts[_0xd515('0x5f')](_0x11066b['text'],_0x11066b['google_tts_language']||'en',0x1)['then'](function(_0x152dd4){_0x1649ea(null,_0x152dd4);})['catch'](function(_0x558f86){_0x1649ea(_0x558f86);});};AGIVertices[_0xd515('0x15')][_0xd515('0x60')]=function(_0x35467d,_0x30fbd9){var _0x23da79={'uri':_0x35467d[_0xd515('0x61')],'method':_0x35467d[_0xd515('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x35467d[_0xd515('0x63')])===_0xd515('0x64')&&parseInt(_0x35467d['timeout'])>=0x1?parseInt(_0x35467d[_0xd515('0x63')])*0x3e8:0x5*0x3e8};if(_[_0xd515('0x65')](['POST',_0xd515('0x66')],_0x23da79[_0xd515('0x62')]['toUpperCase']())){try{_0x23da79[_0xd515('0x67')]=_0x35467d[_0xd515('0xb')]?JSON[_0xd515('0x68')](_0x35467d[_0xd515('0xb')]):{};}catch(_0x1950b6){logger[_0xd515('0x2e')](_0xd515('0x69'),_0x1950b6);}}try{_0x23da79[_0xd515('0x6a')]=_0x35467d[_0xd515('0xa')]?JSON['parse'](_0x35467d[_0xd515('0xa')]):{};}catch(_0x5eb8b6){logger[_0xd515('0x2e')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5eb8b6);}if(_0x35467d['computedVariables']){try{var _0x5d1c82=require(_0x35467d[_0xd515('0x6b')])[_0xd515('0x6c')](this,_0x23da79);_0x23da79[_0xd515('0x6d')]=Mustache[_0xd515('0x6e')](_0x35467d['url'],_0x5d1c82,{},['$$','$$']);if(_0x23da79[_0xd515('0x6a')]){_0x23da79[_0xd515('0x6a')]=JSON[_0xd515('0x68')](Mustache[_0xd515('0x6e')](JSON[_0xd515('0x6f')](_0x23da79[_0xd515('0x6a')]),_0x5d1c82,{},['$$','$$']));}if(_0x23da79[_0xd515('0x67')]){_0x23da79[_0xd515('0x67')]=JSON[_0xd515('0x68')](Mustache[_0xd515('0x6e')](JSON['stringify'](_0x23da79[_0xd515('0x67')]),_0x5d1c82,{},['$$','$$']));}}catch(_0x15f890){logger['error'](_0xd515('0x70'),_0x15f890);}}rp(_0x23da79)['then'](function(_0x16b810){var _0x48a0ba={'statusCode':_0x16b810[_0xd515('0x71')]||0xc8,'statusMessage':_0x16b810[_0xd515('0x72')]||'OK','headers':_0x16b810[_0xd515('0x6a')]||{},'body':_0x16b810[_0xd515('0x67')]||{}};_0x30fbd9(null,_0x48a0ba);})[_0xd515('0x14')](function(_0x4f0c0d){var _0x33a573={'statusCode':_0x4f0c0d[_0xd515('0x71')]||0x1f4,'statusMessage':_0x4f0c0d[_0xd515('0x73')]||_0xd515('0x74'),'headers':_0x4f0c0d[_0xd515('0x75')][_0xd515('0x6a')]||{},'body':_0x4f0c0d[_0xd515('0x75')]['body']||{}};_0x30fbd9(null,_0x33a573);});};AGIVertices[_0xd515('0x15')][_0xd515('0x76')]=function(_0x5e2637,_0x1cec78){scripts[_0xd515('0x76')](this[_0xd515('0xe')][_0xd515('0x37')],_0x5e2637[_0xd515('0x77')],_0x5e2637[_0xd515('0x59')],_0x5e2637[_0xd515('0x78')]||'en')[_0xd515('0x12')](function(_0x2f203f){_0x1cec78(null,_0x2f203f);})[_0xd515('0x14')](function(_0x5412a7){_0x1cec78(_0x5412a7);});};AGIVertices[_0xd515('0x15')][_0xd515('0x79')]=function(_0x19dbb9,_0x350160){scripts['googleDialogflowV2'](this[_0xd515('0xe')][_0xd515('0x37')],_0x19dbb9[_0xd515('0x7a')],_0x19dbb9[_0xd515('0x7b')],_0x19dbb9[_0xd515('0x7c')],_0x19dbb9[_0xd515('0x59')],_0x19dbb9['dialogflowV2_language']||'en')[_0xd515('0x12')](function(_0x311a51){_0x350160(null,_0x311a51);})[_0xd515('0x14')](function(_0x495bf4){_0x350160(_0x495bf4);});};AGIVertices[_0xd515('0x15')]['sestekNDA']=function(_0x928058,_0x52a0c){scripts[_0xd515('0x7d')](this[_0xd515('0xe')],_0x928058)['then'](function(_0x36bcfa){_0x52a0c(null,_0x36bcfa);})[_0xd515('0x14')](function(_0x2ef300){_0x52a0c(_0x2ef300);});};AGIVertices['prototype'][_0xd515('0x7e')]=function(_0x1ee6ec,_0x19ecce){scripts[_0xd515('0x7e')](_0x1ee6ec[_0xd515('0x77')],_0x1ee6ec['text'],_0x1ee6ec[_0xd515('0x7f')]||_0xd515('0x5b'),_0x1ee6ec[_0xd515('0x80')])['then'](function(_0x5eff2c){_0x19ecce(null,_0x5eff2c);})[_0xd515('0x14')](function(_0x24ea42){_0x19ecce(_0x24ea42);});};AGIVertices[_0xd515('0x15')][_0xd515('0x81')]=function(_0x182adf,_0x5764f3,_0x1fa62e){scripts['ispeechASR'](_0x5764f3,_0x182adf[_0xd515('0x77')],_0x182adf['ispeech_asr_language']||'en-US',this['isConfigured'](_0x182adf[_0xd515('0x82')])?_0x182adf[_0xd515('0x82')]:undefined)[_0xd515('0x12')](function(_0x53b0d6){_0x1fa62e(null,_0x53b0d6);})['catch'](function(_0x3c39e9){_0x1fa62e(_0x3c39e9);});};AGIVertices[_0xd515('0x15')][_0xd515('0x83')]=function(_0x517087,_0x2307e4){scripts['awsPolly'](_0x517087[_0xd515('0x84')],_0x517087[_0xd515('0x85')],_0x517087['aws_polly_region'],_0x517087[_0xd515('0x86')]||_0xd515('0x87'),_0x517087[_0xd515('0x59')],_0x517087[_0xd515('0x88')]||'text')[_0xd515('0x12')](function(_0x3efb79){_0x2307e4(null,_0x3efb79);})[_0xd515('0x14')](function(_0x1bfbcc){_0x2307e4(_0x1bfbcc);});};AGIVertices[_0xd515('0x15')]['awsLex']=function(_0x532a97,_0x5b1b79){scripts[_0xd515('0x89')](this[_0xd515('0xe')]['uniqueid'],_0x532a97[_0xd515('0x84')],_0x532a97['aws_secret_access_key'],_0x532a97[_0xd515('0x8a')],_0x532a97[_0xd515('0x59')],_0x532a97[_0xd515('0x8b')])[_0xd515('0x12')](function(_0x1cbc88){_0x5b1b79(null,_0x1cbc88);})[_0xd515('0x14')](function(_0x41a8b1){_0x5b1b79(_0x41a8b1);});};AGIVertices['prototype'][_0xd515('0x8c')]=function(_0x49a957,_0x48aa34,_0x56e144){scripts[_0xd515('0x8c')](_0x48aa34,_0x49a957['key'],_0x49a957['google_asr_language']||_0xd515('0x5b'))[_0xd515('0x12')](function(_0x2760d7){_0x56e144(null,_0x2760d7);})['catch'](function(_0x57079b){_0x56e144(_0x57079b);});};AGIVertices['prototype']['tildeASR']=function(_0x53cb6e,_0xb44275,_0x26ad50){scripts[_0xd515('0x8d')](_0xb44275,_0x53cb6e[_0xd515('0x8e')],_0x53cb6e[_0xd515('0x8f')],_0x53cb6e[_0xd515('0x6d')])[_0xd515('0x12')](function(_0x1ce779){_0x26ad50(null,_0x1ce779);})[_0xd515('0x14')](function(_0x1a255b){_0x26ad50(_0x1a255b);});};AGIVertices['prototype'][_0xd515('0x90')]=function(_0x57cdd1){var _0x5f29be=_[_0xd515('0x65')](verticesWithRetry,_0x57cdd1[_0xd515('0x91')])?_0x57cdd1:_[_0xd515('0x92')](_0x57cdd1);for(var _0x3cdafe in _0x5f29be){if(_0x5f29be[_0xd515('0x93')](_0x3cdafe)){if(_0x5f29be[_0x3cdafe]&&_[_0xd515('0x94')](_0x5f29be[_0x3cdafe])){if(_[_0xd515('0x65')](recursiveMapAttributes,_0x3cdafe)){_0x5f29be[_0x3cdafe]=this[_0xd515('0x95')](_0x5f29be[_0x3cdafe]);}else{_0x5f29be[_0x3cdafe]=this['replaceAllVariables'](_0x5f29be[_0x3cdafe]);}}}}return _0x5f29be;};AGIVertices[_0xd515('0x15')][_0xd515('0x96')]=function(_0x54076f){for(var _0x11def2 in _0x54076f){if(_0x54076f['hasOwnProperty'](_0x11def2)){if(_['isPlainObject'](_0x54076f[_0x11def2])){this[_0xd515('0x96')](_0x54076f[_0x11def2]);}else if(_['isArray'](_0x54076f[_0x11def2])){for(var _0x28716d=0x0;_0x28716d<_0x54076f[_0x11def2][_0xd515('0x97')];_0x28716d++){this[_0xd515('0x96')](_0x54076f[_0x11def2][_0x28716d]);}}else if(_[_0xd515('0x94')](_0x54076f[_0x11def2])){_0x54076f[_0x11def2]=this[_0xd515('0x98')](_0x54076f[_0x11def2]);}}}};AGIVertices[_0xd515('0x15')][_0xd515('0x99')]=function(_0x3fd843,_0x2087e9){for(var _0x50fb62 in _0x3fd843){if(_0x3fd843[_0xd515('0x93')](_0x50fb62)){if(_[_0xd515('0x9a')](_0x3fd843[_0x50fb62])){if(!_[_0xd515('0x3f')](_0x3fd843[_0x50fb62])){this['saveRestApiResult'](_0x3fd843[_0x50fb62],util['format'](_0xd515('0x9b'),_0x2087e9,_0x50fb62));}}else if(_[_0xd515('0x9c')](_0x3fd843[_0x50fb62])){for(var _0x48e241=0x0;_0x48e241<_0x3fd843[_0x50fb62]['length'];_0x48e241++){this['saveRestApiResult'](_0x3fd843[_0x50fb62][_0x48e241],util[_0xd515('0x2a')](_0xd515('0x9b'),_0x2087e9,_0x50fb62+'['+_0x48e241+']'));}}else{if(!_['isNil'](_0x3fd843[_0x50fb62])){this[_0xd515('0xe')]['setVariable'](util[_0xd515('0x2a')](_0xd515('0x9b'),_0x2087e9,_0x50fb62),_0x3fd843[_0x50fb62]);}}}}};AGIVertices[_0xd515('0x15')][_0xd515('0x95')]=function(_0x1d28f4){try{var _0x444481=JSON[_0xd515('0x68')](_0x1d28f4);this[_0xd515('0x96')](_0x444481);return JSON['stringify'](_0x444481);}catch(_0xfa9278){return this[_0xd515('0x98')](_0x1d28f4);}};AGIVertices[_0xd515('0x15')][_0xd515('0x98')]=function(_0x4d9f05){var _0x3bc29e=_0x4d9f05[_0xd515('0x9d')]('{');for(var _0x492557=0x1;_0x492557<_0x3bc29e[_0xd515('0x97')];_0x492557+=0x1){var _0x3ddcbd=_0x3bc29e[_0x492557]['split']('}');if(_0x3ddcbd[_0xd515('0x97')]>0x1){_0x4d9f05=_0x4d9f05[_0xd515('0x9e')]('{'+_0x3ddcbd[0x0]+'}',this[_0xd515('0xe')]['getVariable'](_0x3ddcbd[0x0])[_0xd515('0x9f')]||_0x3ddcbd[0x0]);}}if(_0x3bc29e[_0xd515('0x97')]===0x1){return _0x4d9f05['toString']();}return this[_0xd515('0x98')](_0x4d9f05);};AGIVertices[_0xd515('0x15')]['getAndSetVariable']=function(_0x23e251,_0x4737dc){var _0x5b11fa=this[_0xd515('0xe')][_0xd515('0x11')](_0x23e251);if(_0x5b11fa[_0xd515('0xa0')]===-0x1){return _0x5b11fa;}logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0xa1'),_0x4737dc,_0x5b11fa[_0xd515('0x9f')]));return this['channel'][_0xd515('0xa2')](_0x4737dc,_0x5b11fa[_0xd515('0x9f')]);};AGIVertices[_0xd515('0x15')][_0xd515('0xa3')]=function(_0x134f6e){return _0x134f6e&&_0x134f6e!=='0'&&_0x134f6e!=='-1'&&_0x134f6e!=='';};AGIVertices[_0xd515('0x15')][_0xd515('0xa4')]=function(_0x1f72ec){this[_0xd515('0x34')][_0xd515('0x6c')](this,_0x1f72ec,'-');_0x1f72ec[_0xd515('0xa5')]=_0x1f72ec[_0xd515('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xd515('0x15')]['mrcpsynth']=function(_0xfd660){logger[_0xd515('0x30')](util[_0xd515('0x2a')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0xfd660[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0xfd660['text'])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0xa8'));}var _0x249fe2='\x22'+_0xfd660[_0xd515('0x59')]+'\x22';if(this[_0xd515('0xa3')](_0xfd660[_0xd515('0x75')])){_0x249fe2+=','+_0xfd660['options'];}var _0x19d0a8=this[_0xd515('0xe')][_0xd515('0x53')]('MRCPSynth',_0x249fe2);if(_0x19d0a8[_0xd515('0xa0')]===-0x1){return _0x19d0a8;}return this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0xa9'),_0x249fe2));};AGIVertices[_0xd515('0x15')][_0xd515('0xaa')]=function(_0x384d87){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0xab'),_0x384d87[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x384d87['grammar'])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0xac'));}var _0x18c44c=_0x384d87['grammar'];if(this[_0xd515('0xa3')](_0x384d87[_0xd515('0x75')])){_0x18c44c+=','+_0x384d87[_0xd515('0x75')];}var _0x17f1a4=this['channel'][_0xd515('0x53')](_0xd515('0xad'),_0x18c44c);if(_0x17f1a4[_0xd515('0xa0')]===-0x1){return _0x17f1a4;}var _0xd9ffc3=this[_0xd515('0xae')](_0xd515('0xaf'),_0xd515('0xb0'));if(_0xd9ffc3['result']===-0x1){return _0xd9ffc3;}var _0xfa939c=this['getAndSetVariable'](_0xd515('0xb1'),_0xd515('0xb2'));if(_0xfa939c[_0xd515('0xa0')]===-0x1){return _0xfa939c;}var _0x60be4e=this['getAndSetVariable'](_0xd515('0xb3'),_0xd515('0xb4'));if(_0x60be4e[_0xd515('0xa0')]===-0x1){return _0x60be4e;}return this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x18c44c));};AGIVertices[_0xd515('0x15')][_0xd515('0xb5')]=function(_0x5e6fe8){logger['info'](util['format'](_0xd515('0xb6'),_0x5e6fe8[_0xd515('0xa6')]));return this['channel'][_0xd515('0xb5')]([_0x5e6fe8[_0xd515('0xb7')],_0x5e6fe8['args']]);};AGIVertices['prototype']['answer']=function(_0x1a41b0){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0xb8'),_0x1a41b0[_0xd515('0xa6')]));if(this[_0xd515('0xa3')](_0x1a41b0[_0xd515('0x63')])){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0xb9'),_0x1a41b0[_0xd515('0x63')]));var _0x408ec0=this[_0xd515('0xe')]['wait'](_0x1a41b0[_0xd515('0x63')]);if(_0x408ec0['result']===-0x1){return _0x408ec0;}}return this[_0xd515('0xe')][_0xd515('0xba')]();};AGIVertices[_0xd515('0x15')][_0xd515('0xbb')]=function(_0x74b5e0){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0xbc'),_0x74b5e0['label']));if(!this[_0xd515('0xa3')](_0x74b5e0[_0xd515('0x44')])){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x74b5e0,_0xd515('0xbd'));}_0x74b5e0[_0xd515('0x46')]=moment();if(this[_0xd515('0xa3')](_0x74b5e0[_0xd515('0xbe')])){_0x74b5e0['scheduledAt']=moment()[_0xd515('0xbf')](_0x74b5e0['delay'],'minutes');}if(!this[_0xd515('0xa3')](_0x74b5e0[_0xd515('0x47')])){_0x74b5e0['callback_priority']=0x2;}this[_0xd515('0x3e')][_0xd515('0x6c')](this,_0x74b5e0);return this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0xc0'),_0x74b5e0['phone'],_0x74b5e0['list_id'],_0x74b5e0[_0xd515('0x46')]));};AGIVertices[_0xd515('0x15')][_0xd515('0xc1')]=function(_0x33ff74){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0xc2'),_0x33ff74[_0xd515('0xa6')]));var _0x6ed814=this[_0xd515('0xe')][_0xd515('0x53')](_0x33ff74[_0xd515('0xc3')],_0x33ff74[_0xd515('0x75')]);if(_0x6ed814[_0xd515('0xa0')]===-0x1){return _0x6ed814;}return this[_0xd515('0xe')]['noop'](util[_0xd515('0x2a')]('Executed\x20command\x20%s\x20%s',_0x33ff74[_0xd515('0xc3')],_0x33ff74[_0xd515('0x75')]));};AGIVertices[_0xd515('0x15')][_0xd515('0xc4')]=function(_0x249644){logger[_0xd515('0x30')](util['format'](_0xd515('0xc5'),_0x249644[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x249644[_0xd515('0x59')])){return this['channel'][_0xd515('0xa7')](_0xd515('0xa8'));}var _0x26be24='\x22'+_0x249644[_0xd515('0x59')]+'\x22';if(this[_0xd515('0xa3')](_0x249644[_0xd515('0x75')])){_0x26be24+=','+_0x249644['options'];}var _0xce1755=this[_0xd515('0xe')][_0xd515('0x53')]('MRCPSynth',_0x26be24);if(_0xce1755[_0xd515('0xa0')]===-0x1){return _0xce1755;}return this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x26be24));};AGIVertices[_0xd515('0x15')]['sestektts']=function(_0x53faba){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0xc6'),_0x53faba[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x53faba[_0xd515('0x59')])){return this[_0xd515('0xe')][_0xd515('0xa7')]('no\x20text\x20configured');}var _0x5e795e='\x22'+_0x53faba['text']+'\x22';if(this[_0xd515('0xa3')](_0x53faba[_0xd515('0x75')])){_0x5e795e+=','+_0x53faba[_0xd515('0x75')];}var _0xdbed70=this[_0xd515('0xe')][_0xd515('0x53')](_0xd515('0xc7'),_0x5e795e);if(_0xdbed70['result']===-0x1){return _0xdbed70;}return this[_0xd515('0xe')]['noop'](util[_0xd515('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5e795e));};AGIVertices[_0xd515('0x15')][_0xd515('0xc8')]=function(_0x2a6391){logger[_0xd515('0x30')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x2a6391[_0xd515('0xa6')]));if(!this['isConfigured'](_0x2a6391[_0xd515('0xc9')])){return this['channel']['noop'](_0xd515('0xac'));}var _0x12cb97=_0x2a6391[_0xd515('0xc9')];if(this[_0xd515('0xa3')](_0x2a6391['options'])){_0x12cb97+=','+_0x2a6391[_0xd515('0x75')];}var _0x3ed72b=this[_0xd515('0xe')][_0xd515('0x53')]('MRCPRecog',_0x12cb97);if(_0x3ed72b[_0xd515('0xa0')]===-0x1){return _0x3ed72b;}var _0x318e0f=this[_0xd515('0xae')](_0xd515('0xaf'),'LUMENVOX_ASR_CONFIDENCE');if(_0x318e0f[_0xd515('0xa0')]===-0x1){return _0x318e0f;}var _0xf5be44=this['getAndSetVariable'](_0xd515('0xb1'),_0xd515('0xca'));if(_0xf5be44[_0xd515('0xa0')]===-0x1){return _0xf5be44;}var _0x11cfc9=this[_0xd515('0xae')](_0xd515('0xb3'),'LUMENVOX_ASR_INSTANCE');if(_0x11cfc9['result']===-0x1){return _0x11cfc9;}return this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x12cb97));};AGIVertices['prototype']['sestekasr']=function(_0x15d186){logger[_0xd515('0x30')](util[_0xd515('0x2a')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x15d186['label']));if(!this[_0xd515('0xa3')](_0x15d186['grammar'])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0xac'));}var _0x35ea6d=_0x15d186[_0xd515('0xc9')];if(this[_0xd515('0xa3')](_0x15d186[_0xd515('0x75')])){_0x35ea6d+=','+_0x15d186[_0xd515('0x75')];}var _0x164755=this[_0xd515('0xe')][_0xd515('0x53')](_0xd515('0xad'),_0x35ea6d);if(_0x164755[_0xd515('0xa0')]===-0x1){return _0x164755;}var _0x455b80=this[_0xd515('0xae')](_0xd515('0xaf'),_0xd515('0xcb'));if(_0x455b80[_0xd515('0xa0')]===-0x1){return _0x455b80;}var _0x38dfc3=this['getAndSetVariable'](_0xd515('0xb1'),_0xd515('0xcc'));if(_0x38dfc3['result']===-0x1){return _0x38dfc3;}var _0x42b3e6=this[_0xd515('0xae')](_0xd515('0xb3'),_0xd515('0xcd'));if(_0x42b3e6[_0xd515('0xa0')]===-0x1){return _0x42b3e6;}return this[_0xd515('0xe')]['noop'](util[_0xd515('0x2a')](_0xd515('0xce'),_0x35ea6d));};AGIVertices[_0xd515('0x15')][_0xd515('0xcf')]=function(_0x45fb35){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0xd0'),_0x45fb35[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x45fb35[_0xd515('0xd1')])){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x45fb35,_0xd515('0xd2'));}var _0x3831a8=this[_0xd515('0x1a')][_0xd515('0x6c')](this,_0x45fb35[_0xd515('0xd1')]);if(!_0x3831a8){return this['channel']['error'](_0x45fb35,'no\x20odbc\x20database\x20found');}if(!this[_0xd515('0xa3')](_0x45fb35[_0xd515('0x31')])){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x45fb35,'no\x20query\x20configured');}var _0x56113d=_0x45fb35['query'][_0xd515('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0xd3'),_0x56113d));var _0x2f2a4a=this[_0xd515('0x2c')]['sync'](this,_0x3831a8,_0x56113d);this['createSquareDetailsReport'][_0xd515('0x6c')](this,_0x45fb35,_0x56113d);if(!this[_0xd515('0xa3')](_0x45fb35[_0xd515('0xd4')])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x28cd70=this[_0xd515('0x11')][_0xd515('0x6c')](this,_0x45fb35['variable_id']);if(!_0x28cd70){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x45fb35,'no\x20variable\x20found');}var _0x477d46=this;_0x2f2a4a[_0xd515('0xd5')](function(_0x48c013,_0x3da6d6){Object['keys'](_0x48c013)[_0xd515('0xd5')](function(_0x1db6db){_0x477d46[_0xd515('0xe')][_0xd515('0xa2')](util['format'](_0xd515('0xd6'),_0x28cd70,_0x3da6d6,_0x1db6db),_0x48c013[_0x1db6db]);});});this[_0xd515('0xe')][_0xd515('0xa2')](util[_0xd515('0x2a')]('%s_ROWS_COUNT',_0x28cd70),_0x2f2a4a[_0xd515('0x97')]);return this['channel'][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0xd7'),_0x28cd70));};AGIVertices[_0xd515('0x15')][_0xd515('0xd8')]=function(_0x50b2e8){logger['debug'](util['format'](_0xd515('0xd9'),_0x50b2e8[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x50b2e8[_0xd515('0xda')])){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x50b2e8,_0xd515('0xdb'));}var _0x52b769=this[_0xd515('0x1d')][_0xd515('0x6c')](this,_0x50b2e8['sip_id']);if(!_0x52b769){return this['channel'][_0xd515('0x2e')](_0x50b2e8,'no\x20user\x20found');}var _0x11806d=this[_0xd515('0xe')]['exec'](_0xd515('0xdc'),[util[_0xd515('0x2a')](_0xd515('0xdd'),_0x52b769),_0x50b2e8['timeout'],_0x50b2e8['opts'],_0x50b2e8[_0xd515('0x61')]]);if(_0x11806d[_0xd515('0xa0')]===-0x1){return _0x11806d;}return this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0xde'),'DIAL'));};AGIVertices[_0xd515('0x15')][_0xd515('0xdf')]=function(_0x19419f){logger['info'](util[_0xd515('0x2a')](_0xd515('0xe0'),_0x19419f[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x19419f['key'])){return this['channel'][_0xd515('0xa7')](_0xd515('0xe1'));}if(!this[_0xd515('0xa3')](_0x19419f[_0xd515('0x59')])){return this[_0xd515('0xe')][_0xd515('0xa7')]('no\x20text\x20configured');}this[_0xd515('0xe')]['bot']=!![];this[_0xd515('0x34')](_0x19419f);this[_0xd515('0x3d')](_0x19419f[_0xd515('0x59')],'in','','');this['channel'][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0xe2'),_0x19419f[_0xd515('0x59')]));var _0x129fa5=this['googleDialogflow'][_0xd515('0x6c')](this,_0x19419f);if(_0x129fa5){for(var _0x590ce8 in _0x129fa5){if(_0x129fa5[_0xd515('0x93')](_0x590ce8)){this['channel'][_0xd515('0xa2')](util['format'](_0xd515('0xe3'),_0x590ce8['toUpperCase']()),_0x129fa5[_0x590ce8]);}}this[_0xd515('0x3d')](_0x129fa5['speech'],'out',_0xd515('0xdf'),'');return this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0xe4'),_0x129fa5[_0xd515('0xe5')]));}return this['channel'][_0xd515('0x2e')](_0x19419f,_0xd515('0xe6'));};AGIVertices[_0xd515('0x15')][_0xd515('0xe7')]=function(_0x38c10e){logger['info'](util[_0xd515('0x2a')](_0xd515('0xe8'),_0x38c10e[_0xd515('0xa6')]));if(!this['isConfigured'](_0x38c10e[_0xd515('0x7a')])){return this[_0xd515('0xe')][_0xd515('0xa7')]('no\x20project_id\x20configured');}if(!this[_0xd515('0xa3')](_0x38c10e[_0xd515('0x7b')])){return this['channel'][_0xd515('0xa7')](_0xd515('0xe9'));}if(!this['isConfigured'](_0x38c10e[_0xd515('0x7c')])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0xea'));}if(!this[_0xd515('0xa3')](_0x38c10e[_0xd515('0xeb')])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0xec'));}if(!this[_0xd515('0xa3')](_0x38c10e[_0xd515('0x59')])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0xa8'));}this[_0xd515('0xe')]['bot']=!![];this[_0xd515('0x34')](_0x38c10e);this[_0xd515('0x3d')](_0x38c10e[_0xd515('0x59')],'in','','');this['channel'][_0xd515('0xa7')](util[_0xd515('0x2a')]('Trying\x20DialogflowV2:\x20%s',_0x38c10e[_0xd515('0x59')]));var _0x5a4f56=this[_0xd515('0x79')]['sync'](this,_0x38c10e);if(_0x5a4f56){for(var _0xfa448c in _0x5a4f56){if(_0x5a4f56[_0xd515('0x93')](_0xfa448c)){if(_0xfa448c!==_0xd515('0xed')){this[_0xd515('0xe')][_0xd515('0xa2')](util['format'](_0xd515('0xe3'),_0xfa448c[_0xd515('0xee')]()),_0x5a4f56[_0xfa448c]);}}}this[_0xd515('0x3d')](_0x5a4f56['speech'],'out','dialogflowV2',_0x5a4f56[_0xd515('0xed')]);return this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')]('DialogflowV2\x20Result\x20%s',_0x5a4f56['speech']));}return this['channel'][_0xd515('0x2e')](_0x38c10e,_0xd515('0xef'));};AGIVertices['prototype'][_0xd515('0xf0')]=function(_0xb967e4){logger[_0xd515('0x30')](util['format'](_0xd515('0xf1'),_0xb967e4[_0xd515('0xa6')]));if(!this['isConfigured'](_0xb967e4[_0xd515('0xf2')])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0xf3'));}if(!this[_0xd515('0xa3')](_0xb967e4['username'])){return this['channel'][_0xd515('0xa7')]('no\x20username\x20configured');}if(!this[_0xd515('0xa3')](_0xb967e4[_0xd515('0xf4')])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0xf5'));}if(!this[_0xd515('0xa3')](_0xb967e4[_0xd515('0xf6')])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0xa8'));}this[_0xd515('0xe')]['bot']=!![];this[_0xd515('0x34')](_0xb967e4);this['createSquareMessage'](_0xb967e4['text'],'in','','');this[_0xd515('0xe')]['noop'](util['format']('Trying\x20SestekNDA:\x20%s',_0xb967e4[_0xd515('0x59')]));var _0x54615a=this[_0xd515('0x7d')]['sync'](this,_0xb967e4);if(_0x54615a){for(var _0x4de52a in _0x54615a){if(_0x54615a['hasOwnProperty'](_0x4de52a)){this[_0xd515('0xe')][_0xd515('0xa2')](util[_0xd515('0x2a')](_0xd515('0xf7'),_0x4de52a[_0xd515('0xee')]()),_0x54615a[_0x4de52a]);}}this['createSquareMessage'](_0x54615a[_0xd515('0xe5')],_0xd515('0xf8'),'sesteknda','');if(_0x54615a['audiofile']){this['channel'][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0xf9'),_0x54615a[_0xd515('0xfa')]));var _0x2bdf6f=this['channel'][_0xd515('0xfb')](_0x54615a['audiofile']);try{fs[_0xd515('0xfc')](_0x54615a[_0xd515('0xfa')]+_0xd515('0xfd'));}catch(_0x1f25f2){logger[_0xd515('0x2e')](_0x1f25f2);}return _0x2bdf6f;}else{return this[_0xd515('0xe')]['noop'](util['format']('SestekNDA\x20Result\x20%s',_0x54615a[_0xd515('0xe5')]));}}return this[_0xd515('0xe')][_0xd515('0x2e')](_0xb967e4,_0xd515('0xfe'));};AGIVertices['prototype'][_0xd515('0xff')]=function(_0x919039){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x100'),_0x919039['label']));return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0xff'));};AGIVertices['prototype'][_0xd515('0x101')]=function(_0x5ccfbc){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x102'),_0x5ccfbc['label']));var _0xa049c5='';if(_0x5ccfbc['trunk_id']){if(!this[_0xd515('0xa3')](_0x5ccfbc[_0xd515('0x103')])){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x5ccfbc,_0xd515('0x104'));}else{var _0x3a0154=parseInt(_0x5ccfbc['trunk_id'],0xa);if(isNaN(_0x3a0154)){_0xa049c5=_0x5ccfbc['trunk_id'];}else{_0xa049c5=this[_0xd515('0x1f')][_0xd515('0x6c')](this,_0x5ccfbc['trunk_id']);if(!_0xa049c5){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x5ccfbc,_0xd515('0x105'));}}}}else if(_0x5ccfbc[_0xd515('0x106')]){_0xa049c5=_0x5ccfbc[_0xd515('0x106')];}else{return this[_0xd515('0xe')][_0xd515('0x2e')](_0x5ccfbc,_0xd515('0x104'));}var _0x28c01e=this['channel']['exec'](_0xd515('0xdc'),[util[_0xd515('0x2a')](_0xd515('0x107'),_0xa049c5,_0x5ccfbc[_0xd515('0x43')]),_0x5ccfbc[_0xd515('0x63')],_0x5ccfbc[_0xd515('0x108')],_0x5ccfbc['url']]);if(_0x28c01e[_0xd515('0xa0')]===-0x1){return _0x28c01e;}return this['channel'][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0xde'),'DIAL'));};AGIVertices[_0xd515('0x15')]['finally']=function(_0xd7e14){logger['info'](util['format'](_0xd515('0x109'),_0xd7e14['label']));return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0x10a'));};AGIVertices[_0xd515('0x15')][_0xd515('0xd')]=function(_0x2cad66){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x10b'),_0x2cad66[_0xd515('0xa6')]));if(_0x2cad66['retry']===0x0){return this[_0xd515('0xa4')](_0x2cad66);}_0x2cad66[_0xd515('0xa5')]-=0x1;if(!this[_0xd515('0xa3')](_0x2cad66['file_id'])){return this[_0xd515('0xe')]['error'](_0x2cad66,'no\x20file\x20audio\x20selected');}var _0x290a3d=this[_0xd515('0x21')][_0xd515('0x6c')](this,_0x2cad66[_0xd515('0x10c')]);if(!_0x290a3d){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x2cad66,'no\x20file\x20audio\x20found');}if(!this[_0xd515('0xa3')](_0x2cad66[_0xd515('0xd4')])){return this[_0xd515('0xe')][_0xd515('0x2e')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x15cd66=this[_0xd515('0xe')][_0xd515('0x10d')](_0x290a3d,_0x2cad66[_0xd515('0x10e')],_0x2cad66[_0xd515('0x10f')]);var _0x3416d4=_0x15cd66[_0xd515('0xa0')]?_0x15cd66[_0xd515('0xa0')]['toString']():'';logger[_0xd515('0x30')](_0xd515('0x110'),JSON[_0xd515('0x6f')](_0x15cd66));if(_0x15cd66[_0xd515('0xa0')]===-0x1){this[_0xd515('0x34')]['sync'](this,_0x2cad66,_0x3416d4);return _0x15cd66;}else if(_0x15cd66[_0xd515('0x9f')]===_0xd515('0x63')){_0x15cd66[_0xd515('0xa0')]=_0x3416d4['length']>=parseInt(_0x2cad66[_0xd515('0x111')])?'x':'i';}else{_0x15cd66[_0xd515('0xa0')]=_0x3416d4['length']>=parseInt(_0x2cad66[_0xd515('0x111')])&&_0x3416d4['length']<=parseInt(_0x2cad66[_0xd515('0x10f')])?'x':'i';}var _0x256645=this[_0xd515('0x11')]['sync'](this,_0x2cad66[_0xd515('0xd4')]);if(!_0x256645){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x2cad66,_0xd515('0x112'));}this[_0xd515('0xe')]['setVariable'](_0x256645,_0x3416d4);if(this[_0xd515('0xa3')](_0x2cad66[_0xd515('0x113')])){var _0x164995=parseInt(_0x2cad66[_0xd515('0x113')],0xa);var _0x3324bc=rs[_0xd515('0x114')]({'charset':'*','length':_0x164995});var _0x117722=_0x3416d4[_0xd515('0x97')];if(_0x117722>0x0){if(_0x117722>_0x164995){this[_0xd515('0x34')][_0xd515('0x6c')](this,_0x2cad66,_0x2cad66['hiddendigitspos']===_0xd515('0x115')?_0x3324bc+_0x3416d4[_0xd515('0x116')](_0x164995):_0x3416d4[_0xd515('0x116')](0x0,_0x117722-_0x164995)+_0x3324bc);}else{this[_0xd515('0x34')]['sync'](this,_0x2cad66,rs[_0xd515('0x114')]({'charset':'*','length':_0x117722}));}}else{this[_0xd515('0x34')][_0xd515('0x6c')](this,_0x2cad66,'');}}else{this[_0xd515('0x34')][_0xd515('0x6c')](this,_0x2cad66,_0x3416d4);}return _0x15cd66;};AGIVertices[_0xd515('0x15')][_0xd515('0x117')]=function(_0x1f9bce){logger['info'](util[_0xd515('0x2a')](_0xd515('0x118'),_0x1f9bce['label']));return this[_0xd515('0xd')](_0x1f9bce);};AGIVertices[_0xd515('0x15')][_0xd515('0x119')]=function(_0x2e1760){logger[_0xd515('0x30')](util['format'](_0xd515('0x11a'),_0x2e1760[_0xd515('0xa6')]));this[_0xd515('0x34')]['sync'](this,_0x2e1760,_0x2e1760[_0xd515('0x11b')]);return this['channel'][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0x11c'),_0x2e1760[_0xd515('0x11b')]));};AGIVertices[_0xd515('0x15')][_0xd515('0x11d')]=function(_0x51eb6c){logger[_0xd515('0x30')](util['format'](_0xd515('0x11e'),_0x51eb6c['label']));if(!this[_0xd515('0xa3')](_0x51eb6c[_0xd515('0x84')])||!this[_0xd515('0xa3')](_0x51eb6c[_0xd515('0x85')])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0x11f'));}if(!this['isConfigured'](_0x51eb6c[_0xd515('0x59')])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0xa8'));}this['channel']['noop'](util[_0xd515('0x2a')](_0xd515('0x120'),_0x51eb6c[_0xd515('0x59')]));var _0x3b39f0=this[_0xd515('0x83')][_0xd515('0x6c')](this,_0x51eb6c);if(_0x3b39f0){this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0x121'),_0x3b39f0));var _0x297b7a=this[_0xd515('0xe')]['streamFile'](_0x3b39f0);try{fs[_0xd515('0xfc')](_0x3b39f0+'.wav');}catch(_0x13ff36){logger[_0xd515('0x2e')](_0x13ff36);}return _0x297b7a;}return this[_0xd515('0xe')][_0xd515('0x2e')](_0x51eb6c,_0xd515('0x122'));};AGIVertices[_0xd515('0x15')][_0xd515('0x123')]=function(_0x18c331){logger[_0xd515('0x30')](util['format'](_0xd515('0x124'),_0x18c331[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x18c331[_0xd515('0x84')])||!this['isConfigured'](_0x18c331[_0xd515('0x85')])){return this[_0xd515('0xe')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0xd515('0xa3')](_0x18c331['aws_bot_name'])){return this['channel'][_0xd515('0xa7')](_0xd515('0x125'));}if(!this[_0xd515('0xa3')](_0x18c331[_0xd515('0x59')])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0xa8'));}this[_0xd515('0xe')][_0xd515('0x126')]=!![];this[_0xd515('0x34')](_0x18c331);this[_0xd515('0x3d')](_0x18c331[_0xd515('0x59')],'in','','');this['channel'][_0xd515('0xa7')](util[_0xd515('0x2a')]('Trying\x20Amazon\x20Lex:\x20%s',_0x18c331[_0xd515('0x59')]));var _0x6b7f20=this[_0xd515('0x89')][_0xd515('0x6c')](this,_0x18c331);if(_0x6b7f20){for(var _0x36eef5 in _0x6b7f20){if(_0x6b7f20[_0xd515('0x93')](_0x36eef5)&&_[_0xd515('0x94')](_0x6b7f20[_0x36eef5])){this[_0xd515('0xe')][_0xd515('0xa2')](util[_0xd515('0x2a')](_0xd515('0x127'),_0x36eef5['toUpperCase']()),_0x6b7f20[_0x36eef5]);}}if(_['isNil'](_0x6b7f20[_0xd515('0x73')])){return this['channel']['noop'](_0xd515('0x128'));}else{this[_0xd515('0x3d')](_0x6b7f20[_0xd515('0x73')],_0xd515('0xf8'),_0xd515('0x129'),'');return this[_0xd515('0xe')]['noop'](util[_0xd515('0x2a')](_0xd515('0x12a'),_0x6b7f20['message']));}}return this[_0xd515('0xe')][_0xd515('0x2e')](_0x18c331,_0xd515('0x12b'));};AGIVertices['prototype'][_0xd515('0x12c')]=function(_0x737864){logger[_0xd515('0x30')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x737864[_0xd515('0xa6')],_0x737864['timeout']));if(!this[_0xd515('0xa3')](_0x737864[_0xd515('0x77')])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0xe1'));}var _0x12321d='wav';var _0x234ca6=util[_0xd515('0x2a')](_0xd515('0x12d'),FILES_PATH,rs['generate'](0x4));var _0x59b88e=util[_0xd515('0x2a')]('%s.%s',_0x234ca6,_0x12321d);var _0x15bf25=!![];if(_0x737864[_0xd515('0x12e')]===_0xd515('0x12f')){_0x15bf25=![];}var _0x4b6391=this[_0xd515('0xe')][_0xd515('0x130')](_0x234ca6,_0x12321d,_0x737864[_0xd515('0x131')],_0x737864['timeout'],undefined,_0x15bf25);if(_0x4b6391[_0xd515('0xa0')]!==-0x1){this[_0xd515('0xe')][_0xd515('0xa7')](util['format']('google\x20%s\x20file\x20created',_0x59b88e));var _0x422e73=this['googleASR']['sync'](this,_0x737864,_0x59b88e);if(_0x422e73){for(var _0x107ff9 in _0x422e73){if(_0x422e73[_0xd515('0x93')](_0x107ff9)){this['channel'][_0xd515('0xa2')](util[_0xd515('0x2a')](_0xd515('0x132'),_0x107ff9[_0xd515('0xee')]()),_0x422e73[_0x107ff9]);}}return this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')]('GoogleASR\x20Result\x20%s',JSON[_0xd515('0x6f')](_0x422e73)));}}return _0x4b6391;};AGIVertices[_0xd515('0x15')][_0xd515('0x133')]=function(_0x2bb8ca){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x134'),_0x2bb8ca[_0xd515('0xa6')]));if(!this['isConfigured'](_0x2bb8ca[_0xd515('0x8e')])){return this[_0xd515('0xe')]['noop'](_0xd515('0x135'));}if(!this[_0xd515('0xa3')](_0x2bb8ca[_0xd515('0x8f')])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0x136'));}var _0x46ab00=_0xd515('0x137');var _0x307a9e=util[_0xd515('0x2a')](_0xd515('0x12d'),FILES_PATH,rs[_0xd515('0x114')](0x4));var _0x55fd9e=util[_0xd515('0x2a')]('%s.%s',_0x307a9e,_0x46ab00);var _0x2dd6b1=!![];if(_0x2bb8ca[_0xd515('0x12e')]==='NOBEEP'){_0x2dd6b1=![];}var _0x596ea9=this['channel'][_0xd515('0x130')](_0x307a9e,_0x46ab00,_0x2bb8ca[_0xd515('0x131')],_0x2bb8ca[_0xd515('0x63')],undefined,_0x2dd6b1);if(_0x596ea9['result']!==-0x1){this[_0xd515('0xe')]['noop'](util[_0xd515('0x2a')](_0xd515('0x138'),_0x55fd9e));var _0x128c62=this[_0xd515('0x8d')][_0xd515('0x6c')](this,_0x2bb8ca,_0x55fd9e);if(_0x128c62){for(var _0x2300a9 in _0x128c62){if(_0x128c62[_0xd515('0x93')](_0x2300a9)){this['channel']['setVariable'](util['format'](_0xd515('0x139'),_0x2300a9[_0xd515('0xee')]()),_0x128c62[_0x2300a9]);}}return this[_0xd515('0xe')][_0xd515('0xa7')](util['format'](_0xd515('0x13a'),JSON[_0xd515('0x6f')](_0x128c62)));}}return _0x596ea9;};AGIVertices['prototype'][_0xd515('0x13b')]=function(_0x292e30){logger[_0xd515('0x30')](util['format'](_0xd515('0x13c'),_0x292e30[_0xd515('0xa6')]));return this['channel'][_0xd515('0x13d')](_0x292e30[_0xd515('0x3a')],_0x292e30[_0xd515('0x13e')],_0x292e30[_0xd515('0x3b')]);};AGIVertices[_0xd515('0x15')][_0xd515('0x13f')]=function(_0x165509){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x140'),_0x165509[_0xd515('0xa6')]));if(!this['isConfigured'](_0x165509['condition'])){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x165509,_0xd515('0x141'));}try{var _0x5a9957=eval(_0x165509['condition'])?_0xd515('0x142'):_0xd515('0x143');this['channel']['noop'](util[_0xd515('0x2a')](_0xd515('0x144'),_0x165509['condition'],_0x5a9957));return{'code':0xc8,'result':_0x5a9957};}catch(_0x1dd7ca){return{'code':0xc8,'result':_0xd515('0x143')};}};AGIVertices[_0xd515('0x15')][_0xd515('0x145')]=function(_0x27b71f){logger['info'](util[_0xd515('0x2a')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x27b71f['label']));if(!this[_0xd515('0xa3')](_0x27b71f[_0xd515('0x146')])){return this['channel'][_0xd515('0x2e')](_0x27b71f,_0xd515('0x147'));}var _0x487ba1=this[_0xd515('0x26')][_0xd515('0x6c')](this,_0x27b71f[_0xd515('0x146')]);if(!_0x487ba1){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x27b71f,_0xd515('0x148'));}for(var _0x775520=0x0;_0x775520<_0x487ba1[_0xd515('0x97')];_0x775520+=0x1){var _0x18a277=this[_0xd515('0xe')][_0xd515('0x11')](util['format'](_0xd515('0x149'),_0x487ba1[_0x775520]));if(_0x18a277[_0xd515('0xa0')]===-0x1){return _0x18a277;}logger['info'](util[_0xd515('0x2a')]('IFTIME\x20%s\x20%s',_0x487ba1[_0x775520],_0x18a277[_0xd515('0x9f')]));if(_0x18a277['extra']===_0xd515('0x142')){logger['info'](util[_0xd515('0x2a')](_0xd515('0x14a'),_0x487ba1[_0x775520],_0xd515('0x142')));this['channel'][_0xd515('0xa7')](util[_0xd515('0x2a')]('IFTIME\x20%s\x20%s',_0x487ba1[_0x775520],_0xd515('0x142')));return{'code':0xc8,'result':_0xd515('0x142')};}else{logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x14a'),_0x487ba1[_0x775520],'false'));this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0x14a'),_0x487ba1[_0x775520],_0xd515('0x143')));}}return{'code':0xc8,'result':_0xd515('0x143')};};AGIVertices[_0xd515('0x15')][_0xd515('0x14b')]=function(_0x1fb501){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x14c'),_0x1fb501[_0xd515('0xa6')]));return this[_0xd515('0xe')][_0xd515('0x14b')]();};AGIVertices[_0xd515('0x15')]['ispeechasr']=function(_0x5467a2){logger[_0xd515('0x30')](util[_0xd515('0x2a')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x5467a2[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x5467a2['key'])){return this[_0xd515('0xe')][_0xd515('0xa7')]('no\x20key\x20configured');}var _0xad77e6=_0xd515('0x137');var _0x277f39=util[_0xd515('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0xd515('0x114')](0x4));var _0xb379bb=util[_0xd515('0x2a')](_0xd515('0x9b'),_0x277f39,_0xad77e6);var _0x394927=!![];if(_0x5467a2[_0xd515('0x12e')]===_0xd515('0x12f')){_0x394927=![];}var _0x366455=this['channel'][_0xd515('0x130')](_0x277f39,_0xad77e6,_0x5467a2['intKey'],_0x5467a2[_0xd515('0x63')],undefined,_0x394927);if(_0x366455[_0xd515('0xa0')]!==-0x1){this['channel'][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0x14d'),_0xb379bb));var _0x1742b2=this[_0xd515('0x81')]['sync'](this,_0x5467a2,_0xb379bb);if(_0x1742b2){for(var _0x49867e in _0x1742b2){if(_0x1742b2[_0xd515('0x93')](_0x49867e)){this[_0xd515('0xe')][_0xd515('0xa2')](util[_0xd515('0x2a')](_0xd515('0x14e'),_0x49867e[_0xd515('0xee')]()),_0x1742b2[_0x49867e]);}}return this['channel'][_0xd515('0xa7')](util[_0xd515('0x2a')]('IspeechASR\x20Result\x20%s',JSON[_0xd515('0x6f')](_0x1742b2)));}}return _0x366455;};AGIVertices['prototype'][_0xd515('0x14f')]=function(_0x1374ff){logger['info'](util['format'](_0xd515('0x150'),_0x1374ff[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x1374ff[_0xd515('0x77')])){return this[_0xd515('0xe')][_0xd515('0xa7')]('no\x20key\x20configured');}if(!this[_0xd515('0xa3')](_0x1374ff['text'])){return this['channel'][_0xd515('0xa7')](_0xd515('0xa8'));}this['channel']['noop'](util[_0xd515('0x2a')](_0xd515('0x151'),_0x1374ff[_0xd515('0x59')]));var _0x352037=this[_0xd515('0x7e')]['sync'](this,_0x1374ff);if(_0x352037){this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0x14d'),_0x352037));var _0x14e705=this[_0xd515('0xe')][_0xd515('0xfb')](_0x352037,_0x1374ff[_0xd515('0x131')]);try{fs['unlink'](_0x352037+_0xd515('0xfd'));}catch(_0x13c05e){logger[_0xd515('0x2e')](_0x13c05e);}return _0x14e705;}return this[_0xd515('0xe')]['error'](_0x1374ff,_0xd515('0x152'));};AGIVertices[_0xd515('0x15')]['login']=function(_0x11b332){logger[_0xd515('0x30')](util[_0xd515('0x2a')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x11b332[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x11b332[_0xd515('0x153')])){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x11b332,'no\x20find\x20by\x20configured');}logger[_0xd515('0x30')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xd515('0xe')]['callerid'],_0x11b332[_0xd515('0x153')]));var _0x1a3a67=this[_0xd515('0x4e')]['sync'](this,_0x11b332[_0xd515('0x153')]);if(_0x1a3a67){logger['info'](util[_0xd515('0x2a')](_0xd515('0x154'),this['channel'][_0xd515('0x38')],_0x11b332[_0xd515('0x153')]));this['channel'][_0xd515('0xa7')](util[_0xd515('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xd515('0x38')],_0x11b332[_0xd515('0x153')]));return{'code':0xc8,'result':_0xd515('0x155')};}else{logger[_0xd515('0x30')](util[_0xd515('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xd515('0x38')],_0x11b332[_0xd515('0x153')]));this[_0xd515('0xe')][_0xd515('0xa7')](util['format'](_0xd515('0x156'),this[_0xd515('0xe')][_0xd515('0x38')],_0x11b332['findBy']));return{'code':0xc8,'result':_0xd515('0x157')};}};AGIVertices[_0xd515('0x15')][_0xd515('0x158')]=function(_0x24b49d){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x159'),_0x24b49d['label']));if(!this[_0xd515('0xa3')](_0x24b49d[_0xd515('0x153')])){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x24b49d,_0xd515('0x15a'));}logger[_0xd515('0x30')](util[_0xd515('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x24b49d['findBy']));var _0x26a2ce=this['agentLogout']['sync'](this,_0x24b49d[_0xd515('0x153')]);if(_0x26a2ce){logger['info'](util[_0xd515('0x2a')](_0xd515('0x154'),this[_0xd515('0xe')]['callerid'],_0x24b49d[_0xd515('0x153')]));this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0x154'),this[_0xd515('0xe')][_0xd515('0x38')],_0x24b49d[_0xd515('0x153')]));return{'code':0xc8,'result':_0xd515('0x155')};}else{logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x156'),this['channel'][_0xd515('0x38')],_0x24b49d[_0xd515('0x153')]));this[_0xd515('0xe')]['noop'](util[_0xd515('0x2a')](_0xd515('0x156'),this[_0xd515('0xe')][_0xd515('0x38')],_0x24b49d[_0xd515('0x153')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xd515('0x15')]['math']=function(_0x4559ed){logger['info'](util[_0xd515('0x2a')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x4559ed[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x4559ed[_0xd515('0x15b')])){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x4559ed,_0xd515('0x15c'));}this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')]('math\x20%s',_0x4559ed[_0xd515('0x15b')]));var _0xb6d4f0=eval(_0x4559ed[_0xd515('0x15b')]);if(!this['isConfigured'](_0x4559ed[_0xd515('0xd4')])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0x15d'));}var _0x24f2b1=this[_0xd515('0x11')][_0xd515('0x6c')](this,_0x4559ed[_0xd515('0xd4')]);if(!_0x24f2b1){return this['channel'][_0xd515('0x2e')](_0x4559ed,_0xd515('0x112'));}if(_[_0xd515('0x9c')](_0xb6d4f0)){var _0x1e39a0=this;_0xb6d4f0['forEach'](function(_0x15926b,_0x563ac8){_0x1e39a0[_0xd515('0xe')][_0xd515('0xa2')](util[_0xd515('0x2a')](_0xd515('0x15e'),_0x24f2b1,_0x563ac8),_0x15926b);});return this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0x15f'),_0x24f2b1));}else{return this[_0xd515('0xe')][_0xd515('0xa2')](_0x24f2b1,_0xb6d4f0);}};AGIVertices[_0xd515('0x15')][_0xd515('0xc')]=function(_0x4d40e3){logger[_0xd515('0x30')](util[_0xd515('0x2a')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x4d40e3[_0xd515('0xa6')]));if(_0x4d40e3['retry']===0x0){return this[_0xd515('0xa4')](_0x4d40e3);}_0x4d40e3[_0xd515('0xa5')]-=0x1;if(!this[_0xd515('0xa3')](_0x4d40e3[_0xd515('0x10c')])){return this['channel'][_0xd515('0x2e')](_0x4d40e3,_0xd515('0x160'));}var _0x4a762d=this['getSound'][_0xd515('0x6c')](this,_0x4d40e3[_0xd515('0x10c')]);if(!_0x4a762d){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x4d40e3,_0xd515('0x161'));}var _0x114861=this[_0xd515('0xe')][_0xd515('0x10d')](_0x4a762d,_0x4d40e3[_0xd515('0x10e')],_0x4d40e3[_0xd515('0x162')]);var _0x118c7a=_0x114861[_0xd515('0xa0')];if(_0x114861[_0xd515('0xa0')]===-0x1){this[_0xd515('0x34')]['sync'](this,_0x4d40e3,'-1');return _0x114861;}else if(_0x114861[_0xd515('0x9f')]==='timeout'){_0x114861[_0xd515('0xa0')]=_0x114861[_0xd515('0xa0')][_0xd515('0x97')]>0x0?_0x114861[_0xd515('0xa0')]:'t';}else if(_['isEmpty'](_0x114861['result'])){_0x114861[_0xd515('0xa0')]='#';_0x118c7a='#';}if(!this['isConfigured'](_0x4d40e3[_0xd515('0xd4')])){this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0x15d'));}else{var _0x58d18a=this[_0xd515('0x11')][_0xd515('0x6c')](this,_0x4d40e3[_0xd515('0xd4')]);if(!_0x58d18a){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x4d40e3,_0xd515('0x112'));}this[_0xd515('0xe')]['setVariable'](_0x58d18a,_0x118c7a);}this[_0xd515('0x34')][_0xd515('0x6c')](this,_0x4d40e3,_0x118c7a);return _0x114861;};AGIVertices[_0xd515('0x15')][_0xd515('0xa7')]=function(_0x5a75aa){logger[_0xd515('0x30')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x5a75aa[_0xd515('0xa6')]));return this[_0xd515('0xe')][_0xd515('0xa7')](_0x5a75aa['output']||_0x5a75aa[_0xd515('0xa6')]);};AGIVertices['prototype']['pause']=function(_0x2d6d8f){logger['info'](util[_0xd515('0x2a')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x2d6d8f[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x2d6d8f[_0xd515('0x153')])){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x2d6d8f,_0xd515('0x15a'));}logger['info'](util['format'](_0xd515('0x163'),this['channel'][_0xd515('0x38')],_0x2d6d8f[_0xd515('0x153')]));var _0x5c2635=this['getPause']['sync'](this,_0x2d6d8f[_0xd515('0x164')]);var _0x82cca9=this['agentPause'][_0xd515('0x6c')](this,_0x2d6d8f[_0xd515('0x153')],_0x5c2635);if(_0x82cca9){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x154'),this['channel'][_0xd515('0x38')],_0x2d6d8f[_0xd515('0x153')]));this[_0xd515('0xe')][_0xd515('0xa7')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xd515('0x38')],_0x2d6d8f[_0xd515('0x153')]));return{'code':0xc8,'result':_0xd515('0x155')};}else{logger[_0xd515('0x30')](util['format'](_0xd515('0x156'),this[_0xd515('0xe')][_0xd515('0x38')],_0x2d6d8f[_0xd515('0x153')]));this[_0xd515('0xe')]['noop'](util[_0xd515('0x2a')](_0xd515('0x154'),this[_0xd515('0xe')][_0xd515('0x38')],_0x2d6d8f[_0xd515('0x153')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xd515('0x15')][_0xd515('0x165')]=function(_0x2c0cbf){logger[_0xd515('0x30')](util['format'](_0xd515('0x166'),_0x2c0cbf[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x2c0cbf[_0xd515('0x10c')])){return this[_0xd515('0xe')]['error'](_0x2c0cbf,_0xd515('0x160'));}var _0x47b516=this[_0xd515('0x21')]['sync'](this,_0x2c0cbf[_0xd515('0x10c')]);if(!_0x47b516){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x2c0cbf,'no\x20file\x20audio\x20found');}var _0x2d63d9=this[_0xd515('0xe')][_0xd515('0x53')](_0xd515('0x167'),[_0x47b516,_0x2c0cbf[_0xd515('0x108')]]);if(_0x2d63d9[_0xd515('0xa0')]===-0x1){return _0x2d63d9;}return this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0x168'),_0xd515('0x167'),_0x47b516));};AGIVertices[_0xd515('0x15')][_0xd515('0x169')]=function(_0x28a20c){logger[_0xd515('0x30')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x28a20c[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x28a20c['queue_id'])){return this[_0xd515('0xe')]['error'](_0x28a20c,_0xd515('0x16a'));}var _0x56f13d='';var _0x223685=parseInt(_0x28a20c[_0xd515('0x16b')],0xa);if(isNaN(_0x223685)){_0x56f13d=_0x28a20c['queue_id'];}else{_0x56f13d=this['getVoiceQueue'][_0xd515('0x6c')](this,_0x28a20c['queue_id']);if(!_0x56f13d){return this['channel'][_0xd515('0x2e')](_0x28a20c,'no\x20queue\x20found');}}var _0x646578='';if(this[_0xd515('0xa3')](_0x28a20c[_0xd515('0x10c')])){var _0x2b0865=this['getSound'][_0xd515('0x6c')](this,_0x28a20c[_0xd515('0x10c')]);if(_0x2b0865){_0x646578=_0x2b0865;}}this[_0xd515('0x34')][_0xd515('0x6c')](this,_0x28a20c,_0x56f13d);if(_0x28a20c['opts'][_0xd515('0x16c')]('x')<0x0){_0x28a20c[_0xd515('0x108')]+='x';}if(_0x28a20c[_0xd515('0x108')][_0xd515('0x16c')]('X')<0x0){_0x28a20c[_0xd515('0x108')]+='X';}this[_0xd515('0xe')][_0xd515('0xa2')](_0xd515('0x16d'),_0x56f13d?_0x56f13d[_0xd515('0x16e')]():'');var _0x34148a=this[_0xd515('0xe')][_0xd515('0x53')]('QUEUE',[_0x56f13d,_0x28a20c[_0xd515('0x108')],_0x28a20c[_0xd515('0x61')],_0x646578,_0x28a20c[_0xd515('0x63')],_0x28a20c[_0xd515('0xb5')],_0x28a20c[_0xd515('0x16f')],_0x28a20c[_0xd515('0x170')],'',_0x28a20c['position']]);if(_0x34148a[_0xd515('0xa0')]===-0x1){return _0x34148a;}return this[_0xd515('0xe')][_0xd515('0xa7')](util['format']('Executed\x20command\x20%s\x20%s','QUEUE',_0x56f13d));};AGIVertices[_0xd515('0x15')][_0xd515('0x171')]=function(_0x1b3eb2){logger['info'](util[_0xd515('0x2a')](_0xd515('0x172'),_0x1b3eb2[_0xd515('0xa6')]));var _0x19821f=_0x1b3eb2[_0xd515('0x173')]||'wav';var _0x24239d=util[_0xd515('0x2a')](_0xd515('0x174'),this[_0xd515('0xe')][_0xd515('0x37')],rs[_0xd515('0x114')](0x5));var _0xb79d58=util['format'](_0xd515('0x175'),FILES_PATH,_0x24239d,_0x19821f);var _0x1df4ce=util[_0xd515('0x2a')](_0xd515('0x12d'),FILES_PATH,_0x24239d);this['createSquareRecording'][_0xd515('0x6c')](this,_0x1b3eb2,_0x24239d,_0xb79d58);this[_0xd515('0xe')][_0xd515('0xa2')]('RECORDING_SAVENAME',_0x24239d);logger[_0xd515('0x30')](_0xd515('0x176'),_0x1df4ce,_0x19821f,_0x1b3eb2[_0xd515('0x177')],_0x1b3eb2['timeout']);return this[_0xd515('0xe')]['recordFile'](_0x1df4ce,_0x19821f,_0x1b3eb2[_0xd515('0x177')],_0x1b3eb2[_0xd515('0x63')],undefined,!![]);};AGIVertices[_0xd515('0x15')]['restapi']=function(_0x5db1d5){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x178'),_0x5db1d5[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x5db1d5[_0xd515('0x61')])){return this['channel'][_0xd515('0xa7')](_0xd515('0x179'));}var _0x25a7a2=this[_0xd515('0x60')][_0xd515('0x6c')](this,_0x5db1d5);logger['info'](util[_0xd515('0x2a')](_0xd515('0x17a'),util[_0xd515('0x17b')](_0x25a7a2,{'showHidden':![],'depth':null})));if(!this[_0xd515('0xa3')](_0x5db1d5[_0xd515('0xd4')])){return this['channel'][_0xd515('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x228e77=this[_0xd515('0x11')][_0xd515('0x6c')](this,_0x5db1d5[_0xd515('0xd4')]);if(!_0x228e77){return this['channel'][_0xd515('0x2e')](_0x5db1d5,_0xd515('0x112'));}this['channel'][_0xd515('0xa2')](util[_0xd515('0x2a')](_0xd515('0x17c'),_0x228e77),_0x25a7a2[_0xd515('0x71')]?_0x25a7a2['statusCode']:_0xd515('0x17d'));this[_0xd515('0xe')][_0xd515('0xa2')](util[_0xd515('0x2a')](_0xd515('0x17e'),_0x228e77),_0x25a7a2['statusMessage']?_0x25a7a2[_0xd515('0x72')]:'OK');if(_0x25a7a2[_0xd515('0x67')]){try{this[_0xd515('0x99')](_0x25a7a2['body'],_0x228e77);}catch(_0x270fc9){logger[_0xd515('0x2e')](util[_0xd515('0x2a')](_0xd515('0x17f'),_0x228e77));}}return this[_0xd515('0xe')]['noop'](util[_0xd515('0x2a')](_0xd515('0xd7'),_0x228e77));};AGIVertices[_0xd515('0x15')][_0xd515('0x180')]=function(_0x1ee441){logger['info'](util[_0xd515('0x2a')](_0xd515('0x181'),_0x1ee441[_0xd515('0xa6')]));return this[_0xd515('0xe')]['sayDigits'](_0x1ee441[_0xd515('0x182')]['replace'](/\s+/g,''),_0x1ee441[_0xd515('0x177')]);};AGIVertices[_0xd515('0x15')][_0xd515('0x183')]=function(_0x2dcb3e){logger[_0xd515('0x30')](util[_0xd515('0x2a')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x2dcb3e[_0xd515('0xa6')]));return this[_0xd515('0xe')][_0xd515('0x184')](_0x2dcb3e[_0xd515('0x64')]['replace'](/\s+/g,''),_0x2dcb3e[_0xd515('0x177')]);};AGIVertices[_0xd515('0x15')][_0xd515('0x185')]=function(_0xd7fe34){logger[_0xd515('0x30')](util['format'](_0xd515('0x186'),_0xd7fe34[_0xd515('0xa6')]));return this['channel'][_0xd515('0x187')](_0xd7fe34[_0xd515('0x59')],_0xd7fe34[_0xd515('0x177')]);};AGIVertices['prototype']['sendMail']=function(_0x5cc127){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x188'),_0x5cc127['label']));if(!this[_0xd515('0xa3')](_0x5cc127[_0xd515('0x189')])){return this['channel'][_0xd515('0xa7')](_0xd515('0x18a'));}var _0xf349ac=this['getMailAccount'][_0xd515('0x6c')](this,_0x5cc127[_0xd515('0x189')]);if(!_0xf349ac||!_0xf349ac['Smtp']){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x5cc127,'no\x20mail\x20account\x20found');}var _0x1e004b={'from':util['format'](_0xd515('0x18b'),_0xf349ac[_0xd515('0x13')],_0xf349ac[_0xd515('0x18c')]||_0xf349ac['Smtp'][_0xd515('0x18d')]),'to':_0x5cc127['to']||'','cc':_0x5cc127['cc']||'','bcc':_0x5cc127[_0xd515('0x18e')]||'','subject':_0x5cc127[_0xd515('0x18f')],'html':_0x5cc127[_0xd515('0x59')],'text':_0x5cc127[_0xd515('0x59')]};if(this[_0xd515('0xa3')](_0x5cc127['template_id'])){}logger[_0xd515('0x190')]('sendMail\x20message',JSON[_0xd515('0x6f')](_0x1e004b));this['createSquareDetailsReport'][_0xd515('0x6c')](this,_0x5cc127,_0x5cc127[_0xd515('0x189')]);this[_0xd515('0xe')][_0xd515('0xa7')](util['format'](_0xd515('0x191'),_0xf349ac[_0xd515('0x13')]));this[_0xd515('0x25')]['sync'](this,_0xf349ac['smtpOptions'],_0x1e004b);return this['channel']['noop'](_0xd515('0x192'));};AGIVertices[_0xd515('0x15')][_0xd515('0x193')]=function(_0x5b7010){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x194'),_0x5b7010[_0xd515('0xa6')]));return this['channel'][_0xd515('0xa7')](_0xd515('0x195'));};AGIVertices[_0xd515('0x15')]['sendSMS']=function(_0x4168fb){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x196'),_0x4168fb['label']));if(!this[_0xd515('0xa3')](_0x4168fb[_0xd515('0x197')])){return this['channel']['noop']('no\x20sms\x20account\x20configured');}var _0x4a48e7=this[_0xd515('0x198')][_0xd515('0x6c')](this,_0x4168fb[_0xd515('0x197')]);if(!_0x4a48e7){return this['channel']['error'](_0x4168fb,_0xd515('0x199'));}var _0x1407a1={'body':_0x4168fb['sms_text'],'phone':_0x4168fb['to']||'','SmsAccountId':_0x4a48e7['id']};logger[_0xd515('0x190')](_0xd515('0x19a'),JSON[_0xd515('0x6f')](_0x1407a1));this['createSquareDetailsReport']['sync'](this,_0x4168fb,_0x4168fb[_0xd515('0x197')]);this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0x19b'),_0x4a48e7[_0xd515('0x13')]));this[_0xd515('0x19c')][_0xd515('0x6c')](this,_0x1407a1);return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0x19d'));};AGIVertices[_0xd515('0x15')][_0xd515('0x19e')]=function(_0x3676a1){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x19f'),_0x3676a1[_0xd515('0xa6')]));if(!this['isConfigured'](_0x3676a1[_0xd515('0xd4')])){return this['channel'][_0xd515('0x2e')](_0x3676a1,_0xd515('0x1a0'));}var _0x3bfb7a=this[_0xd515('0x11')][_0xd515('0x6c')](this,_0x3676a1[_0xd515('0xd4')]);if(!_0x3bfb7a){return this[_0xd515('0xe')]['error'](_0x3676a1,_0xd515('0x112'));}return this[_0xd515('0xe')][_0xd515('0xa2')](_0x3bfb7a,_0x3676a1[_0xd515('0x1a1')]);};AGIVertices[_0xd515('0x15')]['start']=function(_0x3f4287){logger[_0xd515('0x30')](util[_0xd515('0x2a')]('Enter\x20in\x20START\x20(%s)\x20block',_0x3f4287[_0xd515('0xa6')]));this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0x1a2'));if(_0x3f4287['answer']==='yes'){this['channel'][_0xd515('0xa7')](_0xd515('0x1a3'));return this[_0xd515('0xe')][_0xd515('0xba')]();}return this[_0xd515('0xe')][_0xd515('0xa7')]('Skipped\x20Answer');};AGIVertices[_0xd515('0x15')][_0xd515('0x1a4')]=function(_0x525276){logger[_0xd515('0x30')](util['format'](_0xd515('0x1a5'),_0x525276[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x525276[_0xd515('0x1a6')])){return this['channel'][_0xd515('0x2e')](_0x525276,_0xd515('0x1a7'));}var _0x36b65b=this['getSquareProject'][_0xd515('0x6c')](this,_0x525276[_0xd515('0x1a6')]);if(!this[_0xd515('0xa3')](_0x36b65b)){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x525276,util[_0xd515('0x2a')](_0xd515('0x1a8'),_0x525276[_0xd515('0x1a6')]));}if(_0x36b65b===this[_0xd515('0xe')][_0xd515('0x35')]){return this[_0xd515('0xe')]['error'](_0x525276,_0xd515('0x1a9'));}this[_0xd515('0x34')][_0xd515('0x6c')](this,_0x525276,_0x36b65b);var _0x595566=this[_0xd515('0xe')][_0xd515('0x53')](_0xd515('0x1aa'),util[_0xd515('0x2a')](_0xd515('0x1ab'),config[_0xd515('0xb5')][_0xd515('0x1ac')]||_0xd515('0x1ad'),_0x36b65b,this[_0xd515('0xe')][_0xd515('0x35')]));if(_0x595566[_0xd515('0xa0')]===-0x1){return _0x595566;}return this['channel'][_0xd515('0xa7')](util['format'](_0xd515('0x168'),_0xd515('0x1aa'),_0x36b65b));};AGIVertices[_0xd515('0x15')][_0xd515('0x1ae')]=function(_0x4f95e9){logger['info'](util[_0xd515('0x2a')](_0xd515('0x1af'),_0x4f95e9[_0xd515('0xa6')]));var _0x10e3fa=this[_0xd515('0x52')][_0xd515('0x6c')](this,_0x4f95e9[_0xd515('0xb7')]);this['createSquareDetailsReport'][_0xd515('0x6c')](this,_0x4f95e9,_0x4f95e9[_0xd515('0xb7')]);if(this[_0xd515('0xa3')](_0x4f95e9['variable_id'])){var _0x3a5dbc=this[_0xd515('0x11')][_0xd515('0x6c')](this,_0x4f95e9[_0xd515('0xd4')]);if(_0x3a5dbc){this[_0xd515('0xe')]['setVariable'](_0x3a5dbc,_0x10e3fa);return this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0x1b0'),_0x4f95e9['command'],_0x3a5dbc));}}return this['channel'][_0xd515('0xa7')](util[_0xd515('0x2a')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x4f95e9['command']));};AGIVertices[_0xd515('0x15')][_0xd515('0x1b1')]=function(_0x1946e2){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x1b2'),_0x1946e2[_0xd515('0xa6')]));_0x1946e2[_0xd515('0x59')]=_0x1946e2['text'][_0xd515('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd515('0xa3')](_0x1946e2[_0xd515('0x57')])){return this[_0xd515('0xe')][_0xd515('0xa7')](_0xd515('0x1b3'));}if(!this[_0xd515('0xa3')](_0x1946e2[_0xd515('0x59')])){return this['channel'][_0xd515('0xa7')]('no\x20text\x20configured');}this[_0xd515('0xe')]['noop'](util[_0xd515('0x2a')](_0xd515('0x1b4'),_0x1946e2[_0xd515('0x59')]));var _0x4be849=this[_0xd515('0x56')][_0xd515('0x6c')](this,_0x1946e2);if(_0x4be849){this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x4be849));var _0x45d926=this['channel'][_0xd515('0xfb')](_0x4be849);try{fs['unlink'](_0x4be849+_0xd515('0xfd'));}catch(_0x5a3198){logger[_0xd515('0x2e')](_0x5a3198);}return _0x45d926;}return this[_0xd515('0xe')][_0xd515('0x2e')](_0x1946e2,_0xd515('0x1b5'));};AGIVertices['prototype'][_0xd515('0x1b6')]=function(_0xb9b74f){logger['info'](util[_0xd515('0x2a')](_0xd515('0x1b7'),_0xb9b74f['label']));_0xb9b74f[_0xd515('0x59')]=_0xb9b74f[_0xd515('0x59')][_0xd515('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd515('0xa3')](_0xb9b74f[_0xd515('0x59')])){return this['channel'][_0xd515('0xa7')]('no\x20text\x20configured');}this[_0xd515('0xe')]['noop'](util['format'](_0xd515('0x1b8'),_0xb9b74f[_0xd515('0x59')]));var _0x59513d=this[_0xd515('0x5f')][_0xd515('0x6c')](this,_0xb9b74f);if(_0x59513d){this[_0xd515('0xe')][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0x1b9'),_0x59513d));var _0x2f752d=this[_0xd515('0xe')][_0xd515('0xfb')](_0x59513d);try{fs[_0xd515('0xfc')](_0x59513d+_0xd515('0xfd'));}catch(_0x68cdd){logger[_0xd515('0x2e')](_0x68cdd);}return _0x2f752d;}return this[_0xd515('0xe')][_0xd515('0x2e')](_0xb9b74f,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xd515('0x15')][_0xd515('0x1ba')]=function(_0x405b51){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x1bb'),_0x405b51[_0xd515('0xa6')]));if(!this['isConfigured'](_0x405b51['findBy'])){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x405b51,'no\x20find\x20by\x20configured');}logger['info'](util[_0xd515('0x2a')](_0xd515('0x163'),this[_0xd515('0xe')][_0xd515('0x38')],_0x405b51[_0xd515('0x153')]));var _0x541092=this[_0xd515('0x4c')][_0xd515('0x6c')](this,_0x405b51['findBy']);if(_0x541092){logger['info'](util[_0xd515('0x2a')](_0xd515('0x154'),this[_0xd515('0xe')][_0xd515('0x38')],_0x405b51[_0xd515('0x153')]));this['channel'][_0xd515('0xa7')](util[_0xd515('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd515('0xe')]['callerid'],_0x405b51['findBy']));return{'code':0xc8,'result':_0xd515('0x155')};}else{logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x156'),this[_0xd515('0xe')]['callerid'],_0x405b51[_0xd515('0x153')]));this[_0xd515('0xe')]['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xd515('0x38')],_0x405b51[_0xd515('0x153')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xd515('0x15')]['voicemail']=function(_0x5ac9b6){logger['info'](util[_0xd515('0x2a')](_0xd515('0x1bc'),_0x5ac9b6[_0xd515('0xa6')]));var _0x21195a=this[_0xd515('0xe')][_0xd515('0x53')](_0xd515('0x1bd'),[_0x5ac9b6[_0xd515('0x1be')],_0x5ac9b6[_0xd515('0x75')]]);if(_0x21195a[_0xd515('0xa0')]===-0x1){return _0x21195a;}return this['channel'][_0xd515('0xa7')](util[_0xd515('0x2a')](_0xd515('0x168'),_0xd515('0x1bd'),_0x5ac9b6[_0xd515('0x1be')]));};AGIVertices['prototype']['vswitch']=function(_0x365c9f){logger[_0xd515('0x30')](util[_0xd515('0x2a')](_0xd515('0x1bf'),_0x365c9f[_0xd515('0xa6')]));if(!this[_0xd515('0xa3')](_0x365c9f[_0xd515('0xd4')])){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x365c9f,_0xd515('0x1a0'));}var _0x534c86=this[_0xd515('0x11')][_0xd515('0x6c')](this,_0x365c9f[_0xd515('0xd4')]);if(!_0x534c86){return this[_0xd515('0xe')][_0xd515('0x2e')](_0x365c9f,_0xd515('0x112'));}var _0x29941e=this['channel']['getVariable'](_0x534c86);return{'code':0xc8,'result':_0x29941e['extra']?_0x29941e[_0xd515('0x9f')]:'-'};};String['prototype'][_0xd515('0x9e')]=function(_0x4ae5e5,_0x534991){return this[_0xd515('0x9d')](_0x4ae5e5)[_0xd515('0x1c0')](_0x534991);};module[_0xd515('0x1c1')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index b70ef64..200fc80 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 _0x34d7=['seconds','prototype','interface','queue','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','info','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','message','acw','[ACW][syncAgentConnect]\x20%s','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff'];(function(_0x3a355d,_0x26de2a){var _0x37aa3b=function(_0x42c21a){while(--_0x42c21a){_0x3a355d['push'](_0x3a355d['shift']());}};_0x37aa3b(++_0x26de2a);}(_0x34d7,0xf5));var _0x734d=function(_0x3a6ecf,_0x28a2aa){_0x3a6ecf=_0x3a6ecf-0x0;var _0x5e4b25=_0x34d7[_0x3a6ecf];return _0x5e4b25;};'use strict';var util=require(_0x734d('0x0'));var _=require(_0x734d('0x1'));var moment=require(_0x734d('0x2'));var ami=require(_0x734d('0x3'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0x734d('0x4'));var RpcVoiceAgentReport=require(_0x734d('0x5'));function Acw(_0x49145b){this[_0x734d('0x6')]=_0x49145b[_0x734d('0x6')];this[_0x734d('0x7')]=_0x49145b[_0x734d('0x7')];this[_0x734d('0x8')]=_0x49145b['timers'];this[_0x734d('0x9')]={};ami['on'](_0x734d('0xa'),this[_0x734d('0xb')][_0x734d('0xc')](this));ami['on'](_0x734d('0xd'),this[_0x734d('0xe')]['bind'](this));ami['on'](_0x734d('0xf'),this[_0x734d('0x10')][_0x734d('0xc')](this));ami['on'](_0x734d('0x11'),this['syncAgentRingNoAnswer'][_0x734d('0xc')](this));ami['on'](_0x734d('0x12'),this['syncAttendedTransfer'][_0x734d('0xc')](this));ami['on'](_0x734d('0x13'),this[_0x734d('0x14')]['bind'](this));ami['on'](_0x734d('0x15'),this[_0x734d('0x16')][_0x734d('0xc')](this));}function getDiff(_0x5cce5c){var _0x29fa49=moment()['milliseconds'](0x0);var _0x4c4160=moment(_0x5cce5c)[_0x734d('0x17')](0x0);return _0x29fa49[_0x734d('0x18')](_0x4c4160,_0x734d('0x19'));}Acw[_0x734d('0x1a')]['startAcw']=function(_0x1d71a0){try{var _0x413767=this;var _0xa62df0=this['channels'][_0x1d71a0][_0x734d('0x1b')];var _0x38024e=this['channels'][_0x1d71a0][_0x734d('0x1c')];var _0x2d4005=this[_0x734d('0x6')][_0x38024e];var _0x39a350=![];var _0x5a0111='ACW';if(_0x2d4005['mandatoryDisposition']){if(_0x2d4005[_0x734d('0x1d')][_0x734d('0x1e')]){_0x39a350=!![];_0x5a0111=_0x2d4005[_0x734d('0x1d')][_0x734d('0x1e')];}}ami[_0x734d('0x1f')]({'action':_0x734d('0x20'),'interface':_0xa62df0,'paused':!![],'reason':_0x5a0111})['then'](function(_0x5bd611){if(_0x413767['agents'][_0xa62df0]){return RpcUser[_0x734d('0x21')](_0x413767[_0x734d('0x7')][_0xa62df0]['id'])[_0x734d('0x22')](function(_0x3039c7){if(_0x3039c7&&!_0x3039c7[_0x734d('0x23')]){logger['info'](_0x734d('0x24'),_0x1d71a0,_0xa62df0,_0x38024e);var _0x1923a9=_0x413767[_0x734d('0x9')][_0x1d71a0]['attended']&&_0x413767['channels'][_0x1d71a0][_0x734d('0x25')]?_0x413767['channels'][_0x1d71a0]['destlinkedid']:_0x1d71a0;return RpcUser[_0x734d('0x26')](_0x413767[_0x734d('0x7')][_0xa62df0],_0x5a0111,_0x1923a9)['then'](function(_0x2bf4f1){if(!_0x39a350){_0x413767[_0x734d('0x8')][_0xa62df0]={};logger[_0x734d('0x27')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x1d71a0,_0x413767[_0x734d('0x6')][_0x38024e][_0x734d('0x28')],_0xa62df0,_0x38024e);_0x413767['timers'][_0xa62df0][_0x734d('0x29')]=setTimeout(_0x413767[_0x734d('0x2a')][_0x734d('0xc')](_0x413767,_0xa62df0),_0x413767[_0x734d('0x6')][_0x38024e][_0x734d('0x28')]*0x3e8);_0x413767['timers'][_0xa62df0][_0x734d('0x2b')]=moment()[_0x734d('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');_0x413767['timers'][_0xa62df0][_0x734d('0x2d')]=_0x1d71a0;_0x413767[_0x734d('0x8')][_0xa62df0][_0x734d('0x1c')]=_0x38024e;_0x413767['timers'][_0xa62df0][_0x734d('0x2e')]=function(){var _0x1bd293=getDiff(_0x413767['timers'][_0xa62df0][_0x734d('0x2b')]);clearTimeout(_0x413767[_0x734d('0x8')][_0xa62df0][_0x734d('0x29')]);_0x413767[_0x734d('0x8')][_0xa62df0][_0x734d('0x29')]=![];RpcVoiceAgentReport[_0x734d('0x2f')]({'acwtime':_0x1bd293},_0x413767['timers'][_0xa62df0]['uniqueid'],_0xa62df0)[_0x734d('0x22')](function(_0x3de806){logger[_0x734d('0x27')](_0x734d('0x30'),_0x1d71a0,_0x1bd293,_0x3de806);})[_0x734d('0x31')](function(_0x329784){logger[_0x734d('0x32')](_0x734d('0x33'),_0x1d71a0,_0x329784);});delete _0x413767[_0x734d('0x8')][_0xa62df0];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x1d71a0,_0xa62df0,_0x38024e);}});}})[_0x734d('0x31')](function(_0x38625e){logger['error'](_0x734d('0x34'),_0x1d71a0,_0x413767['voiceQueues'][_0x38024e][_0x734d('0x28')],_0xa62df0,_0x38024e);})[_0x734d('0x35')](function(){delete _0x413767['channels'][_0x1d71a0];});}catch(_0x5d175b){logger['error'](_0x734d('0x36'),_0x5d175b['message']);}};Acw[_0x734d('0x1a')][_0x734d('0x2a')]=function(_0x4e0509){try{var _0xdf270e=this;if(_0xdf270e[_0x734d('0x8')][_0x4e0509]){_0xdf270e[_0x734d('0x8')][_0x4e0509]['timer']=![];var _0x47fa6a=_0xdf270e[_0x734d('0x8')][_0x4e0509][_0x734d('0x2d')];var _0x5dff02=_0xdf270e['timers'][_0x4e0509][_0x734d('0x1c')];var _0x2f843b=_0xdf270e[_0x734d('0x6')][_0x5dff02][_0x734d('0x28')];logger[_0x734d('0x27')](_0x734d('0x37'),_0x47fa6a,_0x4e0509);RpcUser[_0x734d('0x38')](this[_0x734d('0x7')][_0x4e0509]);RpcVoiceAgentReport['update']({'acwtime':_0x2f843b,'agentacw':!![]},_0x47fa6a,_0x4e0509)['then'](function(_0x19d43b){logger[_0x734d('0x27')]('[%s][UPDATE][ACWTIME:%s]',_0x47fa6a,_0x2f843b,_0x19d43b);})[_0x734d('0x31')](function(_0x2baebc){logger[_0x734d('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x47fa6a,_0x2baebc);});}else{logger[_0x734d('0x32')](_0x734d('0x39'),_0x4e0509);if(_0xdf270e['timers']){logger[_0x734d('0x27')](_0x734d('0x3a'),JSON[_0x734d('0x3b')](_0xdf270e[_0x734d('0x8')]));}}}catch(_0x24e8ce){logger[_0x734d('0x32')]('[ACW][STOP]\x20%s',_0x24e8ce[_0x734d('0x3c')]);}};Acw[_0x734d('0x1a')][_0x734d('0xb')]=function(_0x500c58){try{if(this['voiceQueues'][_0x500c58[_0x734d('0x1c')]]&&(this[_0x734d('0x6')][_0x500c58[_0x734d('0x1c')]][_0x734d('0x3d')]||this[_0x734d('0x6')][_0x500c58['queue']]['mandatoryDisposition'])){if(this['agents'][_0x500c58['interface']]){this[_0x734d('0x9')][_0x500c58['uniqueid']]={'queue':_0x500c58[_0x734d('0x1c')],'interface':_0x500c58[_0x734d('0x1b')],'destlinkedid':_0x500c58['destlinkedid']};}}}catch(_0x42f098){logger[_0x734d('0x32')](_0x734d('0x3e'),_0x42f098['message']);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x2f87b6){try{if(this['voiceQueues'][_0x2f87b6[_0x734d('0x1c')]]&&(this[_0x734d('0x6')][_0x2f87b6[_0x734d('0x1c')]][_0x734d('0x3d')]||this['voiceQueues'][_0x2f87b6['queue']][_0x734d('0x3f')])){if(this[_0x734d('0x7')][_0x2f87b6[_0x734d('0x1b')]]){this[_0x734d('0x9')][_0x2f87b6[_0x734d('0x2d')]]={'queue':_0x2f87b6[_0x734d('0x1c')],'interface':_0x2f87b6[_0x734d('0x1b')]};}}}catch(_0x194765){logger[_0x734d('0x32')](_0x734d('0x40'),_0x194765[_0x734d('0x3c')]);}};Acw[_0x734d('0x1a')][_0x734d('0xe')]=function(_0x576be5){try{if(this[_0x734d('0x9')][_0x576be5[_0x734d('0x2d')]]&&_[_0x734d('0x41')](this[_0x734d('0x9')][_0x576be5[_0x734d('0x2d')]][_0x734d('0x42')])){logger[_0x734d('0x27')](_0x734d('0x43'),_0x576be5[_0x734d('0x2d')]);this[_0x734d('0x44')](_0x576be5[_0x734d('0x2d')]);}else if(this[_0x734d('0x9')][_0x576be5[_0x734d('0x45')]]&&_[_0x734d('0x41')](this['channels'][_0x576be5['linkedid']]['attended'])){logger[_0x734d('0x27')]('[%s][HANGUP:LINKEDID]',_0x576be5['linkedid']);this[_0x734d('0x44')](_0x576be5[_0x734d('0x45')]);}}catch(_0x3dc2ed){logger[_0x734d('0x32')](_0x734d('0x46'),_0x3dc2ed['message']);}};Acw['prototype']['syncHangup']=function(_0x3cfee4){try{if(this[_0x734d('0x9')][_0x3cfee4[_0x734d('0x2d')]]&&this[_0x734d('0x9')][_0x3cfee4[_0x734d('0x2d')]][_0x734d('0x42')]){logger[_0x734d('0x27')](_0x734d('0x47'),_0x3cfee4['uniqueid']);this['startAcw'](_0x3cfee4[_0x734d('0x2d')]);}else if(this['channels'][_0x3cfee4[_0x734d('0x45')]]&&this['channels'][_0x3cfee4[_0x734d('0x45')]]['attended']){logger[_0x734d('0x27')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x3cfee4[_0x734d('0x45')]);this[_0x734d('0x44')](_0x3cfee4[_0x734d('0x45')]);}}catch(_0x47cc35){logger[_0x734d('0x32')](_0x734d('0x48'),_0x47cc35[_0x734d('0x3c')]);}};Acw[_0x734d('0x1a')][_0x734d('0x49')]=function(_0x12965c){try{if(!_[_0x734d('0x4a')](this['channels'][_0x12965c[_0x734d('0x4b')]])){this[_0x734d('0x44')](_0x12965c['transfereeuniqueid']);if(this['channels'][_0x12965c['secondtransfereruniqueid']]){this[_0x734d('0x9')][_0x12965c[_0x734d('0x4c')]][_0x734d('0x42')]=!![];this[_0x734d('0x9')][_0x12965c[_0x734d('0x4d')]]=this[_0x734d('0x9')][_0x12965c[_0x734d('0x4c')]];delete this['channels'][_0x12965c[_0x734d('0x4c')]];}}else if(!_[_0x734d('0x4a')](this['channels'][_0x12965c['transfertargetuniqueid']])){this[_0x734d('0x44')](_0x12965c[_0x734d('0x4d')]);if(this[_0x734d('0x9')][_0x12965c[_0x734d('0x4e')]]){this['channels'][_0x12965c[_0x734d('0x4e')]][_0x734d('0x42')]=!![];this[_0x734d('0x9')][_0x12965c[_0x734d('0x4b')]]=this[_0x734d('0x9')][_0x12965c[_0x734d('0x4e')]];delete this['channels'][_0x12965c[_0x734d('0x4e')]];}}}catch(_0xba8f49){logger['error'](_0x734d('0x4f'),_0xba8f49[_0x734d('0x3c')]);}};Acw[_0x734d('0x1a')][_0x734d('0x14')]=function(_0x8885b7){try{if(this[_0x734d('0x9')][_0x8885b7[_0x734d('0x50')]]){logger[_0x734d('0x27')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x8885b7[_0x734d('0x50')]));this[_0x734d('0x44')](_0x8885b7[_0x734d('0x50')]);}else if(this['channels'][_0x8885b7[_0x734d('0x51')]]){logger[_0x734d('0x27')](_0x734d('0x52'),JSON[_0x734d('0x3b')](_0x8885b7[_0x734d('0x51')]));this[_0x734d('0x44')](_0x8885b7['transfererlinkedid']);}}catch(_0x2644a1){logger[_0x734d('0x32')]('[ACW][syncBlindTransfer]\x20%s',_0x2644a1['message']);}};Acw[_0x734d('0x1a')][_0x734d('0x53')]=function(_0x342d2b){try{if(this['voiceQueues'][_0x342d2b[_0x734d('0x1c')]]&&this[_0x734d('0x6')][_0x342d2b[_0x734d('0x1c')]][_0x734d('0x54')]===_0x734d('0x55')){if(this[_0x734d('0x7')][_0x342d2b[_0x734d('0x1b')]]){logger[_0x734d('0x27')](_0x734d('0x56'),_0x342d2b[_0x734d('0x2d')],_0x342d2b[_0x734d('0x1b')],_0x342d2b[_0x734d('0x1c')]);return RpcUser['savePause'](this[_0x734d('0x7')][_0x342d2b[_0x734d('0x1b')]],_0x734d('0x57'),_0x342d2b[_0x734d('0x2d')]);}}}catch(_0x4b8e18){logger[_0x734d('0x32')](_0x734d('0x58'),_0x4b8e18[_0x734d('0x3c')]);}};module[_0x734d('0x59')]=Acw; \ No newline at end of file +var _0x72b9=['queue','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','attended','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','startAcw','channels','interface','voiceQueues','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','timer','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','update','info','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s'];(function(_0x23caef,_0x4acb07){var _0x198e60=function(_0x3b3da7){while(--_0x3b3da7){_0x23caef['push'](_0x23caef['shift']());}};_0x198e60(++_0x4acb07);}(_0x72b9,0xcd));var _0x972b=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x72b9[_0x3b150c];return _0x5cd414;};'use strict';var util=require(_0x972b('0x0'));var _=require(_0x972b('0x1'));var moment=require(_0x972b('0x2'));var ami=require('../ami');var logger=require(_0x972b('0x3'))(_0x972b('0x4'));var RpcUser=require(_0x972b('0x5'));var RpcVoiceAgentReport=require(_0x972b('0x6'));function Acw(_0x554266){this['voiceQueues']=_0x554266['voiceQueues'];this[_0x972b('0x7')]=_0x554266[_0x972b('0x7')];this[_0x972b('0x8')]=_0x554266[_0x972b('0x8')];this['channels']={};ami['on'](_0x972b('0x9'),this[_0x972b('0xa')][_0x972b('0xb')](this));ami['on'](_0x972b('0xc'),this[_0x972b('0xd')][_0x972b('0xb')](this));ami['on'](_0x972b('0xe'),this['syncHangup'][_0x972b('0xb')](this));ami['on'](_0x972b('0xf'),this[_0x972b('0x10')][_0x972b('0xb')](this));ami['on'](_0x972b('0x11'),this['syncAttendedTransfer'][_0x972b('0xb')](this));ami['on'](_0x972b('0x12'),this['syncBlindTransfer'][_0x972b('0xb')](this));ami['on'](_0x972b('0x13'),this[_0x972b('0x14')][_0x972b('0xb')](this));}function getDiff(_0x3908b3){var _0x5f4169=moment()[_0x972b('0x15')](0x0);var _0x2e55db=moment(_0x3908b3)[_0x972b('0x15')](0x0);return _0x5f4169[_0x972b('0x16')](_0x2e55db,'seconds');}Acw[_0x972b('0x17')][_0x972b('0x18')]=function(_0x3daa1e){try{var _0x2da170=this;var _0x37f26a=this[_0x972b('0x19')][_0x3daa1e][_0x972b('0x1a')];var _0x2b8f49=this[_0x972b('0x19')][_0x3daa1e]['queue'];var _0x99ac8b=this[_0x972b('0x1b')][_0x2b8f49];var _0x315719=![];var _0x4fc76b='ACW';if(_0x99ac8b['mandatoryDisposition']){if(_0x99ac8b[_0x972b('0x1c')][_0x972b('0x1d')]){_0x315719=!![];_0x4fc76b=_0x99ac8b[_0x972b('0x1c')][_0x972b('0x1d')];}}ami[_0x972b('0x1e')]({'action':_0x972b('0x1f'),'interface':_0x37f26a,'paused':!![],'reason':_0x4fc76b})[_0x972b('0x20')](function(_0x76908f){if(_0x2da170[_0x972b('0x7')][_0x37f26a]){return RpcUser[_0x972b('0x21')](_0x2da170[_0x972b('0x7')][_0x37f26a]['id'])[_0x972b('0x20')](function(_0x3c608c){if(_0x3c608c&&!_0x3c608c[_0x972b('0x22')]){logger['info'](_0x972b('0x23'),_0x3daa1e,_0x37f26a,_0x2b8f49);var _0x588a43=_0x2da170[_0x972b('0x19')][_0x3daa1e]['attended']&&_0x2da170['channels'][_0x3daa1e][_0x972b('0x24')]?_0x2da170['channels'][_0x3daa1e]['destlinkedid']:_0x3daa1e;return RpcUser[_0x972b('0x25')](_0x2da170['agents'][_0x37f26a],_0x4fc76b,_0x588a43)[_0x972b('0x20')](function(_0x5b7ffd){if(!_0x315719){_0x2da170[_0x972b('0x8')][_0x37f26a]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x3daa1e,_0x2da170[_0x972b('0x1b')][_0x2b8f49]['acwTimeout'],_0x37f26a,_0x2b8f49);_0x2da170[_0x972b('0x8')][_0x37f26a][_0x972b('0x26')]=setTimeout(_0x2da170[_0x972b('0x27')][_0x972b('0xb')](_0x2da170,_0x37f26a),_0x2da170[_0x972b('0x1b')][_0x2b8f49][_0x972b('0x28')]*0x3e8);_0x2da170[_0x972b('0x8')][_0x37f26a][_0x972b('0x29')]=moment()[_0x972b('0x2a')](_0x972b('0x2b'));_0x2da170[_0x972b('0x8')][_0x37f26a][_0x972b('0x2c')]=_0x3daa1e;_0x2da170[_0x972b('0x8')][_0x37f26a]['queue']=_0x2b8f49;_0x2da170[_0x972b('0x8')][_0x37f26a]['updateAcw']=function(){var _0x471406=getDiff(_0x2da170['timers'][_0x37f26a][_0x972b('0x29')]);clearTimeout(_0x2da170[_0x972b('0x8')][_0x37f26a][_0x972b('0x26')]);_0x2da170['timers'][_0x37f26a][_0x972b('0x26')]=![];RpcVoiceAgentReport[_0x972b('0x2d')]({'acwtime':_0x471406},_0x2da170['timers'][_0x37f26a][_0x972b('0x2c')],_0x37f26a)[_0x972b('0x20')](function(_0x2d4a96){logger[_0x972b('0x2e')]('[%s][UPDATE][ACWTIME:%s]',_0x3daa1e,_0x471406,_0x2d4a96);})[_0x972b('0x2f')](function(_0x2712e7){logger[_0x972b('0x30')](_0x972b('0x31'),_0x3daa1e,_0x2712e7);});delete _0x2da170[_0x972b('0x8')][_0x37f26a];};}});}else{logger[_0x972b('0x2e')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x3daa1e,_0x37f26a,_0x2b8f49);}});}})[_0x972b('0x2f')](function(_0x28ad99){logger[_0x972b('0x30')](_0x972b('0x32'),_0x3daa1e,_0x2da170[_0x972b('0x1b')][_0x2b8f49]['acwTimeout'],_0x37f26a,_0x2b8f49);})[_0x972b('0x33')](function(){delete _0x2da170[_0x972b('0x19')][_0x3daa1e];});}catch(_0x21863e){logger[_0x972b('0x30')](_0x972b('0x34'),_0x21863e[_0x972b('0x35')]);}};Acw[_0x972b('0x17')][_0x972b('0x27')]=function(_0x1cd478){try{var _0x44a13a=this;if(_0x44a13a[_0x972b('0x8')][_0x1cd478]){_0x44a13a[_0x972b('0x8')][_0x1cd478]['timer']=![];var _0x3f969e=_0x44a13a[_0x972b('0x8')][_0x1cd478]['uniqueid'];var _0x1be59b=_0x44a13a[_0x972b('0x8')][_0x1cd478]['queue'];var _0x2b931b=_0x44a13a['voiceQueues'][_0x1be59b]['acwTimeout'];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x3f969e,_0x1cd478);RpcUser[_0x972b('0x36')](this[_0x972b('0x7')][_0x1cd478]);RpcVoiceAgentReport[_0x972b('0x2d')]({'acwtime':_0x2b931b,'agentacw':!![]},_0x3f969e,_0x1cd478)[_0x972b('0x20')](function(_0x25b91d){logger['info'](_0x972b('0x37'),_0x3f969e,_0x2b931b,_0x25b91d);})['catch'](function(_0x194340){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x3f969e,_0x194340);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x1cd478);if(_0x44a13a[_0x972b('0x8')]){logger[_0x972b('0x2e')](_0x972b('0x38'),JSON[_0x972b('0x39')](_0x44a13a[_0x972b('0x8')]));}}}catch(_0x584df4){logger[_0x972b('0x30')](_0x972b('0x3a'),_0x584df4['message']);}};Acw['prototype'][_0x972b('0xa')]=function(_0x15e2b){try{if(this['voiceQueues'][_0x15e2b[_0x972b('0x3b')]]&&(this[_0x972b('0x1b')][_0x15e2b[_0x972b('0x3b')]][_0x972b('0x4')]||this['voiceQueues'][_0x15e2b['queue']][_0x972b('0x3c')])){if(this['agents'][_0x15e2b[_0x972b('0x1a')]]){this[_0x972b('0x19')][_0x15e2b['uniqueid']]={'queue':_0x15e2b[_0x972b('0x3b')],'interface':_0x15e2b[_0x972b('0x1a')],'destlinkedid':_0x15e2b[_0x972b('0x24')]};}}}catch(_0x276424){logger[_0x972b('0x30')]('[ACW][syncAgentConnect]\x20%s',_0x276424[_0x972b('0x35')]);}};Acw[_0x972b('0x17')][_0x972b('0x14')]=function(_0x437bbc){try{if(this[_0x972b('0x1b')][_0x437bbc[_0x972b('0x3b')]]&&(this[_0x972b('0x1b')][_0x437bbc[_0x972b('0x3b')]][_0x972b('0x4')]||this[_0x972b('0x1b')][_0x437bbc[_0x972b('0x3b')]][_0x972b('0x3c')])){if(this[_0x972b('0x7')][_0x437bbc[_0x972b('0x1a')]]){this[_0x972b('0x19')][_0x437bbc[_0x972b('0x2c')]]={'queue':_0x437bbc[_0x972b('0x3b')],'interface':_0x437bbc[_0x972b('0x1a')]};}}}catch(_0x12b1e0){logger[_0x972b('0x30')](_0x972b('0x3d'),_0x12b1e0[_0x972b('0x35')]);}};Acw['prototype'][_0x972b('0xd')]=function(_0x41710b){try{if(this[_0x972b('0x19')][_0x41710b[_0x972b('0x2c')]]&&_[_0x972b('0x3e')](this[_0x972b('0x19')][_0x41710b[_0x972b('0x2c')]]['attended'])){logger[_0x972b('0x2e')](_0x972b('0x3f'),_0x41710b['uniqueid']);this[_0x972b('0x18')](_0x41710b['uniqueid']);}else if(this[_0x972b('0x19')][_0x41710b[_0x972b('0x40')]]&&_[_0x972b('0x3e')](this['channels'][_0x41710b['linkedid']][_0x972b('0x41')])){logger[_0x972b('0x2e')]('[%s][HANGUP:LINKEDID]',_0x41710b[_0x972b('0x40')]);this[_0x972b('0x18')](_0x41710b[_0x972b('0x40')]);}}catch(_0x5afe6b){logger[_0x972b('0x30')]('[ACW][syncHangupRequest]\x20%s',_0x5afe6b['message']);}};Acw['prototype'][_0x972b('0x42')]=function(_0x2ab390){try{if(this[_0x972b('0x19')][_0x2ab390['uniqueid']]&&this['channels'][_0x2ab390[_0x972b('0x2c')]][_0x972b('0x41')]){logger['info'](_0x972b('0x43'),_0x2ab390[_0x972b('0x2c')]);this[_0x972b('0x18')](_0x2ab390[_0x972b('0x2c')]);}else if(this[_0x972b('0x19')][_0x2ab390[_0x972b('0x40')]]&&this[_0x972b('0x19')][_0x2ab390[_0x972b('0x40')]]['attended']){logger[_0x972b('0x2e')](_0x972b('0x44'),_0x2ab390['linkedid']);this[_0x972b('0x18')](_0x2ab390[_0x972b('0x40')]);}}catch(_0x1a1119){logger[_0x972b('0x30')](_0x972b('0x45'),_0x1a1119[_0x972b('0x35')]);}};Acw[_0x972b('0x17')][_0x972b('0x46')]=function(_0x1b46a6){try{if(!_[_0x972b('0x47')](this[_0x972b('0x19')][_0x1b46a6[_0x972b('0x48')]])){this[_0x972b('0x18')](_0x1b46a6[_0x972b('0x48')]);if(this[_0x972b('0x19')][_0x1b46a6['secondtransfereruniqueid']]){this['channels'][_0x1b46a6[_0x972b('0x49')]]['attended']=!![];this[_0x972b('0x19')][_0x1b46a6[_0x972b('0x4a')]]=this[_0x972b('0x19')][_0x1b46a6['secondtransfereruniqueid']];delete this[_0x972b('0x19')][_0x1b46a6['secondtransfereruniqueid']];}}else if(!_[_0x972b('0x47')](this[_0x972b('0x19')][_0x1b46a6[_0x972b('0x4a')]])){this['startAcw'](_0x1b46a6[_0x972b('0x4a')]);if(this[_0x972b('0x19')][_0x1b46a6[_0x972b('0x4b')]]){this[_0x972b('0x19')][_0x1b46a6[_0x972b('0x4b')]][_0x972b('0x41')]=!![];this['channels'][_0x1b46a6[_0x972b('0x48')]]=this[_0x972b('0x19')][_0x1b46a6[_0x972b('0x4b')]];delete this['channels'][_0x1b46a6[_0x972b('0x4b')]];}}}catch(_0x3a8b46){logger[_0x972b('0x30')](_0x972b('0x4c'),_0x3a8b46[_0x972b('0x35')]);}};Acw[_0x972b('0x17')][_0x972b('0x4d')]=function(_0x2aef09){try{if(this[_0x972b('0x19')][_0x2aef09['transfereruniqueid']]){logger['info'](_0x972b('0x4e'),JSON[_0x972b('0x39')](_0x2aef09[_0x972b('0x4f')]));this[_0x972b('0x18')](_0x2aef09[_0x972b('0x4f')]);}else if(this[_0x972b('0x19')][_0x2aef09[_0x972b('0x50')]]){logger['info'](_0x972b('0x51'),JSON[_0x972b('0x39')](_0x2aef09[_0x972b('0x50')]));this[_0x972b('0x18')](_0x2aef09['transfererlinkedid']);}}catch(_0xd40192){logger[_0x972b('0x30')](_0x972b('0x52'),_0xd40192[_0x972b('0x35')]);}};Acw[_0x972b('0x17')][_0x972b('0x10')]=function(_0x3a62e2){try{if(this[_0x972b('0x1b')][_0x3a62e2[_0x972b('0x3b')]]&&this[_0x972b('0x1b')][_0x3a62e2[_0x972b('0x3b')]][_0x972b('0x53')]===_0x972b('0x54')){if(this[_0x972b('0x7')][_0x3a62e2[_0x972b('0x1a')]]){logger[_0x972b('0x2e')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x3a62e2[_0x972b('0x2c')],_0x3a62e2['interface'],_0x3a62e2[_0x972b('0x3b')]);return RpcUser[_0x972b('0x25')](this[_0x972b('0x7')][_0x3a62e2[_0x972b('0x1a')]],_0x972b('0x55'),_0x3a62e2[_0x972b('0x2c')]);}}}catch(_0x355810){logger[_0x972b('0x30')](_0x972b('0x56'),_0x355810[_0x972b('0x35')]);}};module[_0x972b('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 28051bf..45c9198 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 _0x0713=['Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','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\x20\x22%s\x22\x20to\x20%s:%s','then','catch','[ami.js][fullybooted]','exports','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','error'];(function(_0x16ab58,_0x591ef3){var _0x33f05f=function(_0x42f89e){while(--_0x42f89e){_0x16ab58['push'](_0x16ab58['shift']());}};_0x33f05f(++_0x591ef3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var moment=require(_0x3071('0x0'));var util=require(_0x3071('0x1'));var _=require(_0x3071('0x2'));var logger=require(_0x3071('0x3'))(_0x3071('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x3071('0x5')][_0x3071('0x6')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')][_0x3071('0x8')],!![]);ami[_0x3071('0x9')]();ami[_0x3071('0xa')]=BPromise[_0x3071('0xb')](ami[_0x3071('0xc')]);function error(_0x2fce7a){logger[_0x3071('0xd')](util['format'](_0x3071('0xe'),config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')]['port'],util[_0x3071('0xf')](_0x2fce7a,![],null)));}function close(){logger[_0x3071('0xd')](util[_0x3071('0x10')](_0x3071('0x11'),config[_0x3071('0x5')]['username'],config['asterisk']['ip'],config[_0x3071('0x5')]['port']));}ami[_0x3071('0x12')]=function(){return function(){return ami[_0x3071('0xa')]({'action':'sipshowregistry'});};};ami[_0x3071('0x13')]=function(){return function(){return ami['Action']({'action':_0x3071('0x14')});};};ami[_0x3071('0x15')]=function(){return function(){return ami[_0x3071('0xa')]({'action':_0x3071('0x16')});};};ami[_0x3071('0x17')]=function(){return function(){return ami[_0x3071('0xa')]({'action':_0x3071('0x18')});};};ami[_0x3071('0x19')]=function(){return function(){return ami[_0x3071('0xa')]({'action':_0x3071('0x1a')});};};function connect(_0x5f3c22){logger[_0x3071('0x1b')](util[_0x3071('0x10')](_0x3071('0x1c'),config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')][_0x3071('0x6')]));ami['once'](_0x3071('0xd'),error);ami[_0x3071('0x1d')](_0x3071('0x1e'),close);}ami['on']('connect',connect);ami['on'](_0x3071('0x1f'),function(_0x5cd80d){logger[_0x3071('0x1b')](util[_0x3071('0x10')](_0x3071('0x20'),config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')][_0x3071('0x6')],util['inspect'](_0x5cd80d,![],null)));});ami['on']('fullybooted',function(_0x2ce48a){logger[_0x3071('0x1b')](util[_0x3071('0x10')](_0x3071('0x21'),config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')][_0x3071('0x6')]));return BPromise['resolve']()[_0x3071('0x22')](ami[_0x3071('0x12')]())[_0x3071('0x22')](ami['actionDeviceStateList']())[_0x3071('0x22')](ami[_0x3071('0x15')]())[_0x3071('0x22')](ami[_0x3071('0x17')]())[_0x3071('0x22')](ami[_0x3071('0x19')]())[_0x3071('0x23')](function(_0x3921a1){logger[_0x3071('0xd')](_0x3071('0x24'),util[_0x3071('0xf')](_0x3921a1,{'showHidden':![],'depth':null}));});});ami['once']('error',error);ami[_0x3071('0x1d')](_0x3071('0x1e'),close);module[_0x3071('0x25')]=ami; \ No newline at end of file +var _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x262f47,_0x3ccc28){var _0x70119f=function(_0x7965ac){while(--_0x7965ac){_0x262f47['push'](_0x262f47['shift']());}};_0x70119f(++_0x3ccc28);}(_0x757a,0xde));var _0xa757=function(_0x768326,_0x337ede){_0x768326=_0x768326-0x0;var _0x4c620b=_0x757a[_0x768326];return _0x4c620b;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 8b4e140..05375c1 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(_0x217a6f,_0x3ecd8b){var _0x5553f3=function(_0x24b9c0){while(--_0x24b9c0){_0x217a6f['push'](_0x217a6f['shift']());}};_0x5553f3(++_0x3ecd8b);}(_0x9bde,0xe1));var _0xe9bd=function(_0x54e8af,_0xae90bf){_0x54e8af=_0x54e8af-0x0;var _0x50255e=_0x9bde[_0x54e8af];return _0x50255e;};'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 _0xf4eb=['rpc','error','message','result','exports','jayson/promise','http','request','then','debug','memberReport'];(function(_0x532d78,_0x25b6a8){var _0x5990c4=function(_0x3f23fe){while(--_0x3f23fe){_0x532d78['push'](_0x532d78['shift']());}};_0x5990c4(++_0x25b6a8);}(_0xf4eb,0xec));var _0xbf4e=function(_0x127187,_0x82f7c5){_0x127187=_0x127187-0x0;var _0x457726=_0xf4eb[_0x127187];return _0x457726;};'use strict';var jayson=require(_0xbf4e('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('ami');var client=jayson['client'][_0xbf4e('0x1')]({'port':0x2329});client['Request']=function(_0x4e7fa7,_0x2e3070){return new BPromise(function(_0x1c7606,_0x32d1d7){return client[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070)[_0xbf4e('0x3')](function(_0x2fcfed){logger[_0xbf4e('0x4')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x2e3070,_0x2fcfed);if(_0x2fcfed['error']){logger['error'](_0xbf4e('0x6'),_0xbf4e('0x5'),_0x4e7fa7,_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')],_0x2e3070);return _0x32d1d7(_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')]);}else{return _0x1c7606(_0x2fcfed[_0xbf4e('0x9')]);}})['catch'](function(_0x4d9a07){logger[_0xbf4e('0x7')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x4d9a07,_0x2e3070);return _0x32d1d7(_0x4d9a07);});});};module[_0xbf4e('0xa')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 023162a..5f46c03 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 _0xbc07=['countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','exports','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','firstName','Contact','number','queue','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x27766b,_0x155221){var _0x3de10e=function(_0xebc741){while(--_0xebc741){_0x27766b['push'](_0x27766b['shift']());}};_0x3de10e(++_0x155221);}(_0xbc07,0x66));var _0x7bc0=function(_0x238e5c,_0x3755d){_0x238e5c=_0x238e5c-0x0;var _0x20ba1b=_0xbc07[_0x238e5c];return _0x20ba1b;};'use strict';var util=require('util');var _=require(_0x7bc0('0x0'));var moment=require(_0x7bc0('0x1'));function checkNameSurname(_0x3cdbce,_0x469dc9,_0x1bbae6){var _0x693460='';if(!_[_0x7bc0('0x2')](_0x469dc9)&&_0x7bc0('0x3')===typeof _0x469dc9){_0x693460+=_0x469dc9;}if(!_[_0x7bc0('0x2')](_0x1bbae6)&&_0x7bc0('0x3')===typeof _0x1bbae6){_0x693460+='\x20'+_0x1bbae6;}if(_0x693460!==''){return _0x693460;}return _0x3cdbce;}function Action(_0x3f0b95,_0x3402fb,_0x56675f){this[_0x7bc0('0x4')]=_0x3f0b95;this[_0x7bc0('0x5')]=_0x56675f||undefined;this[_0x7bc0('0x6')]=checkNameSurname(_0x3402fb['Contact'][_0x7bc0('0x7')],_0x3402fb['Contact'][_0x7bc0('0x8')],_0x3402fb[_0x7bc0('0x9')]['lastName']);this[_0x7bc0('0xa')]=_0x3402fb[_0x7bc0('0x9')][_0x7bc0('0x7')];this[_0x7bc0('0xb')]=_0x3f0b95[_0x7bc0('0x6')];this[_0x7bc0('0xc')]=_0x3402fb[_0x7bc0('0xc')]||![];this[_0x7bc0('0xd')]=_0x3f0b95[_0x7bc0('0xd')];this['dialQueueTimeout']=_0x3f0b95['dialQueueTimeout']||0x3;this[_0x7bc0('0xe')]=_0x3402fb[_0x7bc0('0xe')];this[_0x7bc0('0xf')]=_0x3402fb[_0x7bc0('0xf')];this[_0x7bc0('0x10')]=_0x3402fb[_0x7bc0('0x10')];this['countnoanswerretry']=_0x3402fb[_0x7bc0('0x11')];this[_0x7bc0('0x12')]=_0x3402fb[_0x7bc0('0x12')];this[_0x7bc0('0x13')]=_0x3402fb['countdropretry'];this['countabandonedretry']=_0x3402fb[_0x7bc0('0x14')];this[_0x7bc0('0x15')]=_0x3402fb[_0x7bc0('0x15')];this[_0x7bc0('0x16')]=_0x3402fb[_0x7bc0('0x16')];this['ContactId']=_0x3402fb[_0x7bc0('0x17')];this[_0x7bc0('0x18')]=_0x3402fb[_0x7bc0('0x18')];this[_0x7bc0('0x19')]=_0x3402fb[_0x7bc0('0x19')];this[_0x7bc0('0x1a')]=_0x3402fb[_0x7bc0('0x1a')];this[_0x7bc0('0x1b')]=_0x3402fb['CampaignId'];this['idHopper']=_0x3402fb['id'];this['ContactFirstName']=_0x3402fb['Contact'][_0x7bc0('0x8')]||'';this[_0x7bc0('0x1c')]=moment()[_0x7bc0('0x1d')](_0x7bc0('0x1e'));this['callback']=_0x3402fb['callback'];this[_0x7bc0('0x1f')]=_0x3402fb[_0x7bc0('0x1f')];this[_0x7bc0('0x20')]=_0x3402fb[_0x7bc0('0x20')];this[_0x7bc0('0x21')]=_0x3402fb['recallme'];this[_0x7bc0('0x22')]='';this[_0x7bc0('0x23')]='';}Action['prototype'][_0x7bc0('0x24')]=function(){return util[_0x7bc0('0x1d')](_0x7bc0('0x25'),this[_0x7bc0('0x6')],this[_0x7bc0('0x4')][_0x7bc0('0x26')]>0x0?this['number'][_0x7bc0('0x27')](this[_0x7bc0('0x4')][_0x7bc0('0x26')]):this['number']);};Action['prototype']['getQueue']=function(){return this[_0x7bc0('0xb')];};module[_0x7bc0('0x28')]=Action; \ No newline at end of file +var _0x819d=['idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','queue','exports','lodash','isNil','string','voiceQueue','name','Contact','phone','firstName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x13a6f1,_0x5e98b8){var _0x50ad0a=function(_0x140672){while(--_0x140672){_0x13a6f1['push'](_0x13a6f1['shift']());}};_0x50ad0a(++_0x5e98b8);}(_0x819d,0x1b4));var _0xd819=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x819d[_0x334841];return _0x5beb4b;};'use strict';var util=require('util');var _=require(_0xd819('0x0'));var moment=require('moment');function checkNameSurname(_0xf5468b,_0x4ae93d,_0x168d42){var _0x3c71d3='';if(!_[_0xd819('0x1')](_0x4ae93d)&&_0xd819('0x2')===typeof _0x4ae93d){_0x3c71d3+=_0x4ae93d;}if(!_[_0xd819('0x1')](_0x168d42)&&_0xd819('0x2')===typeof _0x168d42){_0x3c71d3+='\x20'+_0x168d42;}if(_0x3c71d3!==''){return _0x3c71d3;}return _0xf5468b;}function Action(_0x4b29e7,_0x17cc7b,_0x308b8f){this[_0xd819('0x3')]=_0x4b29e7;this['uniqueid']=_0x308b8f||undefined;this[_0xd819('0x4')]=checkNameSurname(_0x17cc7b[_0xd819('0x5')][_0xd819('0x6')],_0x17cc7b[_0xd819('0x5')][_0xd819('0x7')],_0x17cc7b['Contact']['lastName']);this[_0xd819('0x8')]=_0x17cc7b['Contact']['phone'];this['queue']=_0x4b29e7[_0xd819('0x4')];this[_0xd819('0x9')]=_0x17cc7b['active']||![];this[_0xd819('0xa')]=_0x4b29e7[_0xd819('0xa')];this[_0xd819('0xb')]=_0x4b29e7[_0xd819('0xb')]||0x3;this[_0xd819('0xc')]=_0x17cc7b['scheduledat'];this[_0xd819('0xd')]=_0x17cc7b[_0xd819('0xd')];this['countcongestionretry']=_0x17cc7b[_0xd819('0xe')];this[_0xd819('0xf')]=_0x17cc7b[_0xd819('0xf')];this[_0xd819('0x10')]=_0x17cc7b[_0xd819('0x10')];this[_0xd819('0x11')]=_0x17cc7b['countdropretry'];this[_0xd819('0x12')]=_0x17cc7b[_0xd819('0x12')];this[_0xd819('0x13')]=_0x17cc7b[_0xd819('0x13')];this[_0xd819('0x14')]=_0x17cc7b[_0xd819('0x14')];this[_0xd819('0x15')]=_0x17cc7b[_0xd819('0x15')];this[_0xd819('0x16')]=_0x17cc7b[_0xd819('0x16')];this[_0xd819('0x17')]=_0x17cc7b[_0xd819('0x17')];this[_0xd819('0x18')]=_0x17cc7b[_0xd819('0x18')];this[_0xd819('0x19')]=_0x17cc7b[_0xd819('0x19')];this[_0xd819('0x1a')]=_0x17cc7b['id'];this[_0xd819('0x1b')]=_0x17cc7b['Contact'][_0xd819('0x7')]||'';this[_0xd819('0x1c')]=moment()[_0xd819('0x1d')](_0xd819('0x1e'));this['callback']=_0x17cc7b['callback'];this[_0xd819('0x1f')]=_0x17cc7b[_0xd819('0x1f')];this[_0xd819('0x20')]=_0x17cc7b[_0xd819('0x20')];this['recallme']=_0x17cc7b[_0xd819('0x21')];this[_0xd819('0x22')]='';this[_0xd819('0x23')]='';}Action[_0xd819('0x24')][_0xd819('0x25')]=function(){return util[_0xd819('0x1d')](_0xd819('0x26'),this[_0xd819('0x4')],this[_0xd819('0x3')][_0xd819('0x27')]>0x0?this[_0xd819('0x8')]['substring'](this[_0xd819('0x3')][_0xd819('0x27')]):this[_0xd819('0x8')]);};Action['prototype']['getQueue']=function(){return this[_0xd819('0x28')];};module[_0xd819('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index a5d966f..d32e1d5 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 _0xcc6f=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','state','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x2ee186,_0x50c353){var _0x4bd832=function(_0x4130e6){while(--_0x4130e6){_0x2ee186['push'](_0x2ee186['shift']());}};_0x4bd832(++_0x50c353);}(_0xcc6f,0x1ad));var _0xfcc6=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xcc6f[_0x82129b];return _0x2ae5dc;};'use strict';var util=require(_0xfcc6('0x0'));var _=require('lodash');var moment=require(_0xfcc6('0x1'));function getSeconds(_0x2a7428,_0x4cf17f){var _0x1b1495=moment(_0x2a7428)['milliseconds'](0x0);var _0x3ccadd=moment(_0x4cf17f)[_0xfcc6('0x2')](0x0);return _0x1b1495['diff'](_0x3ccadd,_0xfcc6('0x3'));}function AgentComplete(_0x48cc7f,_0x34da2a){this[_0xfcc6('0x4')]=0x4;this['statedesc']=_0xfcc6('0x5');this['scheduledat']=_0x48cc7f[_0xfcc6('0x6')];this[_0xfcc6('0x7')]=_0x48cc7f[_0xfcc6('0x7')];this[_0xfcc6('0x8')]=_0x48cc7f[_0xfcc6('0x7')]==='outbound'?_0xfcc6('0x9'):_0x48cc7f['type'];this[_0xfcc6('0xa')]=_0x48cc7f['countbusyretry'];this[_0xfcc6('0xb')]=_0x48cc7f[_0xfcc6('0xb')];this['countnoanswerretry']=_0x48cc7f[_0xfcc6('0xc')];this[_0xfcc6('0xd')]=_0x48cc7f[_0xfcc6('0xa')]+_0x48cc7f['countcongestionretry']+_0x48cc7f[_0xfcc6('0xc')]+_0x48cc7f[_0xfcc6('0xe')]+_0x48cc7f[_0xfcc6('0xf')]+_0x48cc7f[_0xfcc6('0x10')]+_0x48cc7f[_0xfcc6('0x11')]+_0x48cc7f[_0xfcc6('0x12')];this[_0xfcc6('0xe')]=_0x48cc7f['countnosuchnumberretry'];this[_0xfcc6('0xf')]=_0x48cc7f[_0xfcc6('0xf')];this[_0xfcc6('0x10')]=_0x48cc7f[_0xfcc6('0x10')];this[_0xfcc6('0x11')]=_0x48cc7f[_0xfcc6('0x11')];this[_0xfcc6('0x12')]=_0x48cc7f[_0xfcc6('0x12')];this['uniqueid']=_0x34da2a[_0xfcc6('0x13')];this[_0xfcc6('0x14')]=_0x48cc7f[_0xfcc6('0x15')];this[_0xfcc6('0x16')]=_0x48cc7f[_0xfcc6('0x17')];this['starttime']=_0x48cc7f['starttime'];this[_0xfcc6('0x18')]=_0x48cc7f[_0xfcc6('0x18')];this[_0xfcc6('0x19')]=_0x48cc7f[_0xfcc6('0x19')];this[_0xfcc6('0x1a')]=moment()[_0xfcc6('0x1b')](_0xfcc6('0x1c'));this[_0xfcc6('0x1d')]=getSeconds(_0x48cc7f['responsetime'],_0x48cc7f[_0xfcc6('0x1e')]);this[_0xfcc6('0x1f')]=getSeconds(_0x48cc7f[_0xfcc6('0x19')],_0x48cc7f[_0xfcc6('0x18')]);this[_0xfcc6('0x20')]=getSeconds(this[_0xfcc6('0x1a')],_0x48cc7f['answertime']);this['queue']=_0x34da2a[_0xfcc6('0x9')];this[_0xfcc6('0x21')]=_0x34da2a[_0xfcc6('0x21')];this[_0xfcc6('0x22')]=_0x34da2a['reason'];this[_0xfcc6('0x23')]=_0x48cc7f['callback'];this['callbackuniqueid']=_0x48cc7f[_0xfcc6('0x24')];this[_0xfcc6('0x25')]=_0x48cc7f[_0xfcc6('0x25')];this['recallme']=_0x48cc7f[_0xfcc6('0x26')];this['ContactId']=_0x48cc7f[_0xfcc6('0x27')];this[_0xfcc6('0x28')]=_0x48cc7f[_0xfcc6('0x28')];this[_0xfcc6('0x29')]=_0x48cc7f[_0xfcc6('0x29')];this[_0xfcc6('0x2a')]=_0x48cc7f['VoiceQueueId'];this[_0xfcc6('0x2b')]=_0x48cc7f[_0xfcc6('0x2b')];this[_0xfcc6('0x2c')]=_0x48cc7f[_0xfcc6('0x2c')]||'';this[_0xfcc6('0x2d')]=_0x48cc7f[_0xfcc6('0x2d')]||'';}module[_0xfcc6('0x2e')]=AgentComplete; \ No newline at end of file +var _0xb45e=['reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','endtime','membername'];(function(_0x5cc77c,_0x28718f){var _0x1f0e86=function(_0x4430f4){while(--_0x4430f4){_0x5cc77c['push'](_0x5cc77c['shift']());}};_0x1f0e86(++_0x28718f);}(_0xb45e,0xb7));var _0xeb45=function(_0x51c39f,_0x5bfb0b){_0x51c39f=_0x51c39f-0x0;var _0x274221=_0xb45e[_0x51c39f];return _0x274221;};'use strict';var util=require(_0xeb45('0x0'));var _=require(_0xeb45('0x1'));var moment=require(_0xeb45('0x2'));function getSeconds(_0x19101d,_0x1d9f88){var _0x58f1c8=moment(_0x19101d)[_0xeb45('0x3')](0x0);var _0x1ce23e=moment(_0x1d9f88)[_0xeb45('0x3')](0x0);return _0x58f1c8[_0xeb45('0x4')](_0x1ce23e,_0xeb45('0x5'));}function AgentComplete(_0x5b61eb,_0x36d725){this[_0xeb45('0x6')]=0x4;this['statedesc']=_0xeb45('0x7');this[_0xeb45('0x8')]=_0x5b61eb[_0xeb45('0x8')];this['type']=_0x5b61eb[_0xeb45('0x9')];this[_0xeb45('0xa')]=_0x5b61eb[_0xeb45('0x9')]===_0xeb45('0xb')?_0xeb45('0xc'):_0x5b61eb[_0xeb45('0x9')];this[_0xeb45('0xd')]=_0x5b61eb[_0xeb45('0xd')];this[_0xeb45('0xe')]=_0x5b61eb[_0xeb45('0xe')];this[_0xeb45('0xf')]=_0x5b61eb[_0xeb45('0xf')];this['countglobal']=_0x5b61eb[_0xeb45('0xd')]+_0x5b61eb[_0xeb45('0xe')]+_0x5b61eb[_0xeb45('0xf')]+_0x5b61eb[_0xeb45('0x10')]+_0x5b61eb[_0xeb45('0x11')]+_0x5b61eb['countabandonedretry']+_0x5b61eb[_0xeb45('0x12')]+_0x5b61eb[_0xeb45('0x13')];this[_0xeb45('0x10')]=_0x5b61eb[_0xeb45('0x10')];this[_0xeb45('0x11')]=_0x5b61eb['countdropretry'];this[_0xeb45('0x14')]=_0x5b61eb[_0xeb45('0x14')];this[_0xeb45('0x12')]=_0x5b61eb['countmachineretry'];this['countagentrejectretry']=_0x5b61eb['countagentrejectretry'];this[_0xeb45('0x15')]=_0x36d725[_0xeb45('0x15')];this[_0xeb45('0x16')]=_0x5b61eb['name'];this[_0xeb45('0x17')]=_0x5b61eb[_0xeb45('0x18')];this[_0xeb45('0x19')]=_0x5b61eb[_0xeb45('0x19')];this[_0xeb45('0x1a')]=_0x5b61eb[_0xeb45('0x1a')];this[_0xeb45('0x1b')]=_0x5b61eb[_0xeb45('0x1b')];this['endtime']=moment()['format'](_0xeb45('0x1c'));this[_0xeb45('0x1d')]=getSeconds(_0x5b61eb[_0xeb45('0x1a')],_0x5b61eb[_0xeb45('0x19')]);this['holdtime']=getSeconds(_0x5b61eb['answertime'],_0x5b61eb[_0xeb45('0x1a')]);this['talktime']=getSeconds(this[_0xeb45('0x1e')],_0x5b61eb['answertime']);this[_0xeb45('0xc')]=_0x36d725[_0xeb45('0xc')];this[_0xeb45('0x1f')]=_0x36d725['membername'];this[_0xeb45('0x20')]=_0x36d725[_0xeb45('0x20')];this['callback']=_0x5b61eb[_0xeb45('0x21')];this[_0xeb45('0x22')]=_0x5b61eb[_0xeb45('0x22')];this[_0xeb45('0x23')]=_0x5b61eb[_0xeb45('0x23')];this['recallme']=_0x5b61eb[_0xeb45('0x24')];this[_0xeb45('0x25')]=_0x5b61eb[_0xeb45('0x25')];this['ListId']=_0x5b61eb['ListId'];this[_0xeb45('0x26')]=_0x5b61eb[_0xeb45('0x26')];this[_0xeb45('0x27')]=_0x5b61eb[_0xeb45('0x27')];this['CampaignId']=_0x5b61eb['CampaignId'];this['originatecalleridnum']=_0x5b61eb[_0xeb45('0x28')]||'';this[_0xeb45('0x29')]=_0x5b61eb[_0xeb45('0x29')]||'';}module[_0xeb45('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 1b1c43d..af283c7 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 _0xe015=['countnosuchnumberretry','calleridname','calleridnum','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x7c599a,_0x3c106e){var _0x1b0c6e=function(_0x2123be){while(--_0x2123be){_0x7c599a['push'](_0x7c599a['shift']());}};_0x1b0c6e(++_0x3c106e);}(_0xe015,0x13b));var _0x5e01=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xe015[_0x502c7d];return _0x30b7ed;};'use strict';var util=require(_0x5e01('0x0'));var _=require(_0x5e01('0x1'));var moment=require(_0x5e01('0x2'));function getSeconds(_0x5811ae,_0x51f689){var _0x46ed0d=moment(_0x5811ae)['milliseconds'](0x0);var _0x2136cf=moment(_0x51f689)[_0x5e01('0x3')](0x0);return _0x46ed0d[_0x5e01('0x4')](_0x2136cf,_0x5e01('0x5'));}function Final(_0x4ac3f1){this[_0x5e01('0x6')]=_0x4ac3f1[_0x5e01('0x6')];this['scheduledat']=_0x4ac3f1['scheduledat'];this[_0x5e01('0x7')]=_0x4ac3f1[_0x5e01('0x7')];this[_0x5e01('0x8')]=_0x4ac3f1[_0x5e01('0x7')]===_0x5e01('0x9')?_0x5e01('0xa'):_0x4ac3f1['type'];this[_0x5e01('0xb')]=_0x4ac3f1['countbusyretry'];this[_0x5e01('0xc')]=_0x4ac3f1['countcongestionretry'];this[_0x5e01('0xd')]=_0x4ac3f1[_0x5e01('0xd')];this['countglobal']=_0x4ac3f1[_0x5e01('0xb')]+_0x4ac3f1[_0x5e01('0xc')]+_0x4ac3f1['countnoanswerretry']+_0x4ac3f1['countnosuchnumberretry']+_0x4ac3f1[_0x5e01('0xe')]+_0x4ac3f1[_0x5e01('0xf')]+_0x4ac3f1[_0x5e01('0x10')]+_0x4ac3f1[_0x5e01('0x11')];this[_0x5e01('0x12')]=_0x4ac3f1[_0x5e01('0x12')];this['countdropretry']=_0x4ac3f1[_0x5e01('0xe')];this['countabandonedretry']=_0x4ac3f1['countabandonedretry'];this[_0x5e01('0x10')]=_0x4ac3f1[_0x5e01('0x10')];this['countagentrejectretry']=_0x4ac3f1[_0x5e01('0x11')];this['queue']=_0x4ac3f1[_0x5e01('0xa')];this['calleridname']=_0x4ac3f1[_0x5e01('0x13')];this['calleridnum']=_0x4ac3f1[_0x5e01('0x14')];this['starttime']=_0x4ac3f1['starttime'];this[_0x5e01('0x15')]=_0x4ac3f1[_0x5e01('0x15')];this['endtime']=_0x4ac3f1[_0x5e01('0x15')];this[_0x5e01('0x16')]=_0x4ac3f1[_0x5e01('0x16')]||0x0;this[_0x5e01('0x17')]=_0x4ac3f1[_0x5e01('0x17')]||0x0;this[_0x5e01('0x18')]=_0x4ac3f1[_0x5e01('0x18')]||0x0;this[_0x5e01('0x19')]=_0x4ac3f1['callback'];this[_0x5e01('0x1a')]=_0x4ac3f1[_0x5e01('0x1a')];this['callbackat']=_0x4ac3f1[_0x5e01('0x1b')];this[_0x5e01('0x1c')]=_0x4ac3f1[_0x5e01('0x1c')];this[_0x5e01('0x1d')]=_0x4ac3f1[_0x5e01('0x1d')];this[_0x5e01('0x1e')]=_0x4ac3f1['ListId'];this[_0x5e01('0x1f')]=_0x4ac3f1[_0x5e01('0x1f')];this[_0x5e01('0x20')]=_0x4ac3f1[_0x5e01('0x20')];this['CampaignId']=_0x4ac3f1[_0x5e01('0x21')];this[_0x5e01('0x22')]=_0x4ac3f1[_0x5e01('0x22')]||'';this['originatecalleridname']=_0x4ac3f1[_0x5e01('0x23')]||'';}module[_0x5e01('0x24')]=Final; \ No newline at end of file +var _0x2caf=['campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','milliseconds','diff','seconds','uniqueid','scheduledat'];(function(_0x45af7a,_0x4286bb){var _0xb53867=function(_0x36dd2f){while(--_0x36dd2f){_0x45af7a['push'](_0x45af7a['shift']());}};_0xb53867(++_0x4286bb);}(_0x2caf,0x6a));var _0xf2ca=function(_0xbbf11e,_0x43dc0f){_0xbbf11e=_0xbbf11e-0x0;var _0x451ad6=_0x2caf[_0xbbf11e];return _0x451ad6;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x22932c,_0x53a64f){var _0x3b2612=moment(_0x22932c)[_0xf2ca('0x0')](0x0);var _0x43b96c=moment(_0x53a64f)[_0xf2ca('0x0')](0x0);return _0x3b2612[_0xf2ca('0x1')](_0x43b96c,_0xf2ca('0x2'));}function Final(_0x1a56cd){this['uniqueid']=_0x1a56cd[_0xf2ca('0x3')];this[_0xf2ca('0x4')]=_0x1a56cd[_0xf2ca('0x4')];this['type']=_0x1a56cd['type'];this[_0xf2ca('0x5')]=_0x1a56cd[_0xf2ca('0x6')]===_0xf2ca('0x7')?_0xf2ca('0x8'):_0x1a56cd[_0xf2ca('0x6')];this['countbusyretry']=_0x1a56cd[_0xf2ca('0x9')];this[_0xf2ca('0xa')]=_0x1a56cd[_0xf2ca('0xa')];this[_0xf2ca('0xb')]=_0x1a56cd[_0xf2ca('0xb')];this[_0xf2ca('0xc')]=_0x1a56cd['countbusyretry']+_0x1a56cd[_0xf2ca('0xa')]+_0x1a56cd[_0xf2ca('0xb')]+_0x1a56cd['countnosuchnumberretry']+_0x1a56cd[_0xf2ca('0xd')]+_0x1a56cd[_0xf2ca('0xe')]+_0x1a56cd['countmachineretry']+_0x1a56cd['countagentrejectretry'];this[_0xf2ca('0xf')]=_0x1a56cd['countnosuchnumberretry'];this[_0xf2ca('0xd')]=_0x1a56cd[_0xf2ca('0xd')];this[_0xf2ca('0xe')]=_0x1a56cd[_0xf2ca('0xe')];this[_0xf2ca('0x10')]=_0x1a56cd[_0xf2ca('0x10')];this[_0xf2ca('0x11')]=_0x1a56cd['countagentrejectretry'];this[_0xf2ca('0x8')]=_0x1a56cd['queue'];this[_0xf2ca('0x12')]=_0x1a56cd['calleridname'];this[_0xf2ca('0x13')]=_0x1a56cd[_0xf2ca('0x13')];this['starttime']=_0x1a56cd[_0xf2ca('0x14')];this[_0xf2ca('0x15')]=_0x1a56cd[_0xf2ca('0x15')];this[_0xf2ca('0x16')]=_0x1a56cd[_0xf2ca('0x15')];this[_0xf2ca('0x17')]=_0x1a56cd[_0xf2ca('0x17')]||0x0;this[_0xf2ca('0x18')]=_0x1a56cd[_0xf2ca('0x18')]||0x0;this[_0xf2ca('0x19')]=_0x1a56cd[_0xf2ca('0x19')]||0x0;this['callback']=_0x1a56cd[_0xf2ca('0x1a')];this[_0xf2ca('0x1b')]=_0x1a56cd[_0xf2ca('0x1b')];this[_0xf2ca('0x1c')]=_0x1a56cd[_0xf2ca('0x1c')];this[_0xf2ca('0x1d')]=_0x1a56cd[_0xf2ca('0x1d')];this[_0xf2ca('0x1e')]=_0x1a56cd['ContactId'];this[_0xf2ca('0x1f')]=_0x1a56cd[_0xf2ca('0x1f')];this['UserId']=_0x1a56cd[_0xf2ca('0x20')];this[_0xf2ca('0x21')]=_0x1a56cd[_0xf2ca('0x21')];this['CampaignId']=_0x1a56cd['CampaignId'];this[_0xf2ca('0x22')]=_0x1a56cd[_0xf2ca('0x22')]||'';this[_0xf2ca('0x23')]=_0x1a56cd[_0xf2ca('0x23')]||'';}module[_0xf2ca('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index b7baed6..dc73684 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 _0xb11f=['util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xb11f,0x195));var _0xfb11=function(_0x3af22d,_0x5ac369){_0x3af22d=_0x3af22d-0x0;var _0x4a595b=_0xb11f[_0x3af22d];return _0x4a595b;};'use strict';var util=require(_0xfb11('0x0'));var _=require(_0xfb11('0x1'));var moment=require('moment');function getSeconds(_0x2e48a1,_0x58a93a){var _0x4a66a8=moment(_0x2e48a1)['milliseconds'](0x0);var _0x5233ab=moment(_0x58a93a)[_0xfb11('0x2')](0x0);return _0x4a66a8[_0xfb11('0x3')](_0x5233ab,_0xfb11('0x4'));}function Hangup(_0x9aa2ee,_0x53ac6b){this[_0xfb11('0x5')]=0x4;this[_0xfb11('0x6')]=_0xfb11('0x7');this[_0xfb11('0x8')]=_0x9aa2ee['scheduledat'];this[_0xfb11('0x9')]=_0x9aa2ee[_0xfb11('0x9')];this['campaigntype']=_0x9aa2ee[_0xfb11('0x9')]==='outbound'?'queue':_0x9aa2ee[_0xfb11('0x9')];this[_0xfb11('0xa')]=_0x9aa2ee['countbusyretry'];this[_0xfb11('0xb')]=_0x9aa2ee['countcongestionretry'];this[_0xfb11('0xc')]=_0x9aa2ee[_0xfb11('0xc')];this[_0xfb11('0xd')]=_0x9aa2ee['countbusyretry']+_0x9aa2ee[_0xfb11('0xb')]+_0x9aa2ee[_0xfb11('0xc')]+_0x9aa2ee[_0xfb11('0xe')]+_0x9aa2ee[_0xfb11('0xf')]+_0x9aa2ee[_0xfb11('0x10')]+_0x9aa2ee[_0xfb11('0x11')]+_0x9aa2ee[_0xfb11('0x12')];this['countnosuchnumberretry']=_0x9aa2ee['countnosuchnumberretry'];this[_0xfb11('0xf')]=_0x9aa2ee[_0xfb11('0xf')];this[_0xfb11('0x10')]=_0x9aa2ee[_0xfb11('0x10')];this[_0xfb11('0x11')]=_0x9aa2ee['countmachineretry'];this[_0xfb11('0x12')]=_0x9aa2ee[_0xfb11('0x12')];this['uniqueid']=_0x53ac6b[_0xfb11('0x13')];this[_0xfb11('0x14')]=_0x9aa2ee[_0xfb11('0x15')];this[_0xfb11('0x16')]=_0x9aa2ee[_0xfb11('0x17')];this[_0xfb11('0x18')]=_0x9aa2ee[_0xfb11('0x18')];this[_0xfb11('0x19')]=_0x9aa2ee[_0xfb11('0x19')];this[_0xfb11('0x1a')]=moment()[_0xfb11('0x1b')](_0xfb11('0x1c'));this[_0xfb11('0x1d')]=getSeconds(_0x9aa2ee['responsetime'],_0x9aa2ee[_0xfb11('0x18')]);this[_0xfb11('0x1e')]=0x0;this[_0xfb11('0x1f')]=getSeconds(this[_0xfb11('0x1a')],_0x9aa2ee['responsetime']);this[_0xfb11('0x20')]=_0x9aa2ee[_0xfb11('0x20')];this[_0xfb11('0x21')]=_0xfb11('0x22');this['reason']=_0x53ac6b[_0xfb11('0x23')];this[_0xfb11('0x24')]=_0x9aa2ee['callback'];this[_0xfb11('0x25')]=_0x9aa2ee['callbackuniqueid'];this[_0xfb11('0x26')]=_0x9aa2ee[_0xfb11('0x26')];this['recallme']=_0x9aa2ee[_0xfb11('0x27')];this[_0xfb11('0x28')]=_0x9aa2ee['ContactId'];this['ListId']=_0x9aa2ee[_0xfb11('0x29')];this[_0xfb11('0x2a')]=_0x9aa2ee[_0xfb11('0x2a')];this['VoiceQueueId']=_0x9aa2ee['VoiceQueueId'];this[_0xfb11('0x2b')]=_0x9aa2ee[_0xfb11('0x2b')];}module[_0xfb11('0x2c')]=Hangup; \ No newline at end of file +var _0xeda0=['lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','number','starttime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','responsetime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','util'];(function(_0x45977c,_0x7eaed0){var _0x399413=function(_0x41cc76){while(--_0x41cc76){_0x45977c['push'](_0x45977c['shift']());}};_0x399413(++_0x7eaed0);}(_0xeda0,0x1b7));var _0x0eda=function(_0x2cb98a,_0x44a386){_0x2cb98a=_0x2cb98a-0x0;var _0x55b013=_0xeda0[_0x2cb98a];return _0x55b013;};'use strict';var util=require(_0x0eda('0x0'));var _=require(_0x0eda('0x1'));var moment=require(_0x0eda('0x2'));function getSeconds(_0xb305ae,_0x3943e1){var _0x3f211a=moment(_0xb305ae)[_0x0eda('0x3')](0x0);var _0x32aba9=moment(_0x3943e1)[_0x0eda('0x3')](0x0);return _0x3f211a[_0x0eda('0x4')](_0x32aba9,_0x0eda('0x5'));}function Hangup(_0x34fe17,_0x1935af){this[_0x0eda('0x6')]=0x4;this[_0x0eda('0x7')]=_0x0eda('0x8');this[_0x0eda('0x9')]=_0x34fe17[_0x0eda('0x9')];this[_0x0eda('0xa')]=_0x34fe17['type'];this[_0x0eda('0xb')]=_0x34fe17[_0x0eda('0xa')]===_0x0eda('0xc')?_0x0eda('0xd'):_0x34fe17[_0x0eda('0xa')];this['countbusyretry']=_0x34fe17[_0x0eda('0xe')];this[_0x0eda('0xf')]=_0x34fe17[_0x0eda('0xf')];this[_0x0eda('0x10')]=_0x34fe17['countnoanswerretry'];this[_0x0eda('0x11')]=_0x34fe17[_0x0eda('0xe')]+_0x34fe17['countcongestionretry']+_0x34fe17['countnoanswerretry']+_0x34fe17[_0x0eda('0x12')]+_0x34fe17[_0x0eda('0x13')]+_0x34fe17[_0x0eda('0x14')]+_0x34fe17[_0x0eda('0x15')]+_0x34fe17[_0x0eda('0x16')];this[_0x0eda('0x12')]=_0x34fe17[_0x0eda('0x12')];this[_0x0eda('0x13')]=_0x34fe17[_0x0eda('0x13')];this[_0x0eda('0x14')]=_0x34fe17[_0x0eda('0x14')];this['countmachineretry']=_0x34fe17['countmachineretry'];this['countagentrejectretry']=_0x34fe17[_0x0eda('0x16')];this[_0x0eda('0x17')]=_0x1935af['uniqueid'];this['calleridname']=_0x34fe17[_0x0eda('0x18')];this['calleridnum']=_0x34fe17[_0x0eda('0x19')];this[_0x0eda('0x1a')]=_0x34fe17[_0x0eda('0x1a')];this['responsetime']=_0x34fe17['responsetime'];this['endtime']=moment()[_0x0eda('0x1b')](_0x0eda('0x1c'));this[_0x0eda('0x1d')]=getSeconds(_0x34fe17['responsetime'],_0x34fe17[_0x0eda('0x1a')]);this['holdtime']=0x0;this[_0x0eda('0x1e')]=getSeconds(this['endtime'],_0x34fe17[_0x0eda('0x1f')]);this[_0x0eda('0xd')]=_0x34fe17[_0x0eda('0xd')];this['membername']=_0x0eda('0x20');this[_0x0eda('0x21')]=_0x1935af[_0x0eda('0x22')];this[_0x0eda('0x23')]=_0x34fe17['callback'];this[_0x0eda('0x24')]=_0x34fe17[_0x0eda('0x24')];this[_0x0eda('0x25')]=_0x34fe17[_0x0eda('0x25')];this[_0x0eda('0x26')]=_0x34fe17[_0x0eda('0x26')];this[_0x0eda('0x27')]=_0x34fe17['ContactId'];this[_0x0eda('0x28')]=_0x34fe17[_0x0eda('0x28')];this[_0x0eda('0x29')]=_0x34fe17[_0x0eda('0x29')];this['VoiceQueueId']=_0x34fe17['VoiceQueueId'];this[_0x0eda('0x2a')]=_0x34fe17[_0x0eda('0x2a')];}module[_0x0eda('0x2b')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index a206bd2..5c62902 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 _0x361e=['countmachineretry','countdropretry','countagentrejectretry','queue','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry'];(function(_0x2d7c3d,_0x4804a1){var _0xd0cb72=function(_0x102225){while(--_0x102225){_0x2d7c3d['push'](_0x2d7c3d['shift']());}};_0xd0cb72(++_0x4804a1);}(_0x361e,0x6b));var _0xe361=function(_0x33566a,_0x1e741d){_0x33566a=_0x33566a-0x0;var _0x347a51=_0x361e[_0x33566a];return _0x347a51;};'use strict';var util=require(_0xe361('0x0'));var _=require(_0xe361('0x1'));var moment=require(_0xe361('0x2'));function getSeconds(_0x282ced,_0x43fad6){var _0x5f575d=moment(_0x282ced)[_0xe361('0x3')](0x0);var _0x4f5bc8=moment(_0x43fad6)[_0xe361('0x3')](0x0);return _0x5f575d[_0xe361('0x4')](_0x4f5bc8,_0xe361('0x5'));}function History(_0x503f3e){this[_0xe361('0x6')]=_0x503f3e[_0xe361('0x6')];this[_0xe361('0x7')]=_0x503f3e[_0xe361('0x7')]||undefined;this[_0xe361('0x8')]=_0x503f3e[_0xe361('0x8')];this[_0xe361('0x9')]=_0x503f3e['type']===_0xe361('0xa')?'queue':_0x503f3e[_0xe361('0x8')];this[_0xe361('0xb')]=_0x503f3e['countbusyretry'];this[_0xe361('0xc')]=_0x503f3e[_0xe361('0xc')];this[_0xe361('0xd')]=_0x503f3e[_0xe361('0xd')];this['countglobal']=_0x503f3e['countbusyretry']+_0x503f3e[_0xe361('0xc')]+_0x503f3e[_0xe361('0xd')]+_0x503f3e[_0xe361('0xe')]+_0x503f3e['countdropretry']+_0x503f3e[_0xe361('0xf')]+_0x503f3e[_0xe361('0x10')]+_0x503f3e['countagentrejectretry'];this['countnosuchnumberretry']=_0x503f3e[_0xe361('0xe')];this['countdropretry']=_0x503f3e[_0xe361('0x11')];this[_0xe361('0xf')]=_0x503f3e[_0xe361('0xf')];this[_0xe361('0x10')]=_0x503f3e[_0xe361('0x10')];this[_0xe361('0x12')]=_0x503f3e[_0xe361('0x12')];this[_0xe361('0x13')]=_0x503f3e[_0xe361('0x13')];this[_0xe361('0x14')]=_0x503f3e['name'];this[_0xe361('0x15')]=_0x503f3e[_0xe361('0x16')];this['starttime']=_0x503f3e[_0xe361('0x17')];this['responsetime']=_0x503f3e[_0xe361('0x18')];this[_0xe361('0x19')]=_0x503f3e['responsetime'];this[_0xe361('0x1a')]=getSeconds(_0x503f3e[_0xe361('0x18')],_0x503f3e[_0xe361('0x17')]);this[_0xe361('0x1b')]=0x0;this[_0xe361('0x1c')]=0x0;this[_0xe361('0x1d')]=_0x503f3e[_0xe361('0x1d')];this[_0xe361('0x1e')]=_0x503f3e[_0xe361('0x1e')];this['callbackat']=_0x503f3e[_0xe361('0x1f')];this[_0xe361('0x20')]=_0x503f3e[_0xe361('0x20')];this[_0xe361('0x21')]=_0x503f3e[_0xe361('0x21')];this[_0xe361('0x22')]=_0x503f3e[_0xe361('0x22')];this[_0xe361('0x23')]=_0x503f3e[_0xe361('0x23')];this['VoiceQueueId']=_0x503f3e[_0xe361('0x24')];this[_0xe361('0x25')]=_0x503f3e['CampaignId'];this[_0xe361('0x26')]=_0x503f3e[_0xe361('0x26')]||'';this[_0xe361('0x27')]=_0x503f3e[_0xe361('0x27')]||'';}module[_0xe361('0x28')]=History; \ No newline at end of file +var _0x9306=['countagentrejectretry','countmachineretry','calleridname','name','calleridnum','starttime','responsetime','endtime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x22846d,_0x1d41a9){var _0x5f1208=function(_0x333782){while(--_0x333782){_0x22846d['push'](_0x22846d['shift']());}};_0x5f1208(++_0x1d41a9);}(_0x9306,0xf1));var _0x6930=function(_0x1a2254,_0x5bdce3){_0x1a2254=_0x1a2254-0x0;var _0xe0d640=_0x9306[_0x1a2254];return _0xe0d640;};'use strict';var util=require(_0x6930('0x0'));var _=require(_0x6930('0x1'));var moment=require('moment');function getSeconds(_0x23f3bc,_0x22a33b){var _0xd09d53=moment(_0x23f3bc)[_0x6930('0x2')](0x0);var _0x19e04d=moment(_0x22a33b)[_0x6930('0x2')](0x0);return _0xd09d53[_0x6930('0x3')](_0x19e04d,_0x6930('0x4'));}function History(_0x4498a1){this[_0x6930('0x5')]=_0x4498a1[_0x6930('0x5')];this[_0x6930('0x6')]=_0x4498a1['scheduledat']||undefined;this[_0x6930('0x7')]=_0x4498a1[_0x6930('0x7')];this[_0x6930('0x8')]=_0x4498a1[_0x6930('0x7')]===_0x6930('0x9')?_0x6930('0xa'):_0x4498a1[_0x6930('0x7')];this[_0x6930('0xb')]=_0x4498a1[_0x6930('0xb')];this[_0x6930('0xc')]=_0x4498a1[_0x6930('0xc')];this[_0x6930('0xd')]=_0x4498a1[_0x6930('0xd')];this[_0x6930('0xe')]=_0x4498a1[_0x6930('0xb')]+_0x4498a1['countcongestionretry']+_0x4498a1[_0x6930('0xd')]+_0x4498a1[_0x6930('0xf')]+_0x4498a1[_0x6930('0x10')]+_0x4498a1[_0x6930('0x11')]+_0x4498a1['countmachineretry']+_0x4498a1[_0x6930('0x12')];this['countnosuchnumberretry']=_0x4498a1[_0x6930('0xf')];this[_0x6930('0x10')]=_0x4498a1[_0x6930('0x10')];this[_0x6930('0x11')]=_0x4498a1[_0x6930('0x11')];this[_0x6930('0x13')]=_0x4498a1['countmachineretry'];this['countagentrejectretry']=_0x4498a1[_0x6930('0x12')];this[_0x6930('0xa')]=_0x4498a1[_0x6930('0xa')];this[_0x6930('0x14')]=_0x4498a1[_0x6930('0x15')];this[_0x6930('0x16')]=_0x4498a1['number'];this[_0x6930('0x17')]=_0x4498a1['starttime'];this[_0x6930('0x18')]=_0x4498a1['responsetime'];this[_0x6930('0x19')]=_0x4498a1[_0x6930('0x18')];this['ringtime']=getSeconds(_0x4498a1[_0x6930('0x18')],_0x4498a1[_0x6930('0x17')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0x6930('0x1a')]=_0x4498a1['callback'];this[_0x6930('0x1b')]=_0x4498a1[_0x6930('0x1b')];this['callbackat']=_0x4498a1['callbackat'];this[_0x6930('0x1c')]=_0x4498a1[_0x6930('0x1c')];this[_0x6930('0x1d')]=_0x4498a1[_0x6930('0x1d')];this['ListId']=_0x4498a1[_0x6930('0x1e')];this[_0x6930('0x1f')]=_0x4498a1[_0x6930('0x1f')];this[_0x6930('0x20')]=_0x4498a1[_0x6930('0x20')];this[_0x6930('0x21')]=_0x4498a1['CampaignId'];this['originatecalleridnum']=_0x4498a1[_0x6930('0x22')]||'';this[_0x6930('0x23')]=_0x4498a1['originatecalleridname']||'';}module[_0x6930('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 d6cb1a9..6aea03f 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 _0x8f42=['strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','Trunk','active','stringify','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\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','erlangCallToSecond','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','startProgressive','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','error','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','inspect','contactsRescheduled','RESCHEDULED_CONTACTS','sendMessageOneNotActive','pTalking','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','prototype','clearZombieChannels','[uniqueid]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','countReScheduled','resolve','checkIsBlackList','[checkIsBlackList]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','reachable','SIP/%s','unmonitored','variable','dialAMDActive','value','HANGUP','uniqueid','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD]','Machine','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countglobal','countbusyretry','countdropretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','cause-txt','Unknow','reason','agent','agiafterat','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','syncNewExten','actions','actionid','roundrobin','paused','locked','stateinterface','rrmemory','push','pick','queueStatusComplete','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','run','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','user:%s','user:dialPreviewRecallReminder','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','checkDialMethod','dialPreviewRecallmeReminder','launchHandleIvr','\x5cw{0,','pow','replace','random','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','dialer','ACTIVE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','createdAt','updatedAt','%s%s','toUpper','callerid','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','substring','dialCutDigit','xcally-motion-dialer','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','Abandoned','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','getDataPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','getContactDialer','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','exports','util','lodash','uuid','moment','ioredis','../preview/util/util','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','startPredictive','queueBooked','queueBookedRR','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','bind','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','milliseconds','diff','seconds','emit'];(function(_0x38a660,_0x3a6593){var _0x5a601c=function(_0x2190a8){while(--_0x2190a8){_0x38a660['push'](_0x38a660['shift']());}};_0x5a601c(++_0x3a6593);}(_0x8f42,0x1da));var _0x28f4=function(_0x16de66,_0x390ee8){_0x16de66=_0x16de66-0x0;var _0x23f33f=_0x8f42[_0x16de66];return _0x23f33f;};'use strict';var util=require(_0x28f4('0x0'));var _=require(_0x28f4('0x1'));var BPromise=require('bluebird');var uuid=require(_0x28f4('0x2'));var moment=require(_0x28f4('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x28f4('0x4'));var ut=require(_0x28f4('0x5'));var config=require('../../../config/environment/');var logger=require(_0x28f4('0x6'))('dialer');var loggerBooked=require('../../../config/logger')(_0x28f4('0x7'));var loggerPredictive=require('../../../config/logger')(_0x28f4('0x8'));var loggerPredictiveCalls=require(_0x28f4('0x6'))(_0x28f4('0x9'));var loggerSyncQueueSummary=require(_0x28f4('0x6'))(_0x28f4('0xa'));var ami=require('../ami');config['redis']=_[_0x28f4('0xb')](config[_0x28f4('0xc')],{'host':_0x28f4('0xd'),'port':0x18eb});var io=require(_0x28f4('0xe'))(new Redis(config['redis']));var cmHopper=require(_0x28f4('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x28f4('0x10'));var RpcSetting=require(_0x28f4('0x11'));var Action=require(_0x28f4('0x12'));var History=require(_0x28f4('0x13'));var Final=require('./final');var AgentComplete=require(_0x28f4('0x14'));var QueueCallerAbandon=require(_0x28f4('0x15'));var Hangup=require(_0x28f4('0x16'));var ipAgi=process[_0x28f4('0x17')][_0x28f4('0x18')]||_0x28f4('0x19');var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0x28f4('0x1a')]=function(_0x465e9e){this[_0x28f4('0x1b')]=this[_0x28f4('0x1b')]?this[_0x28f4('0x1b')]['finally'](_0x465e9e):_0x465e9e();};function Dialer(_0x4434cb,_0xc5d182){this[_0x28f4('0x1c')]=new Sequence();this[_0x28f4('0x1d')]=_0xc5d182;this['voiceQueues']=_0x4434cb[_0x28f4('0x1e')];this[_0x28f4('0x1f')]=_0x4434cb[_0x28f4('0x1f')];this[_0x28f4('0x20')]=_0x4434cb[_0x28f4('0x20')];this[_0x28f4('0x21')]=_0x4434cb[_0x28f4('0x21')];this[_0x28f4('0x22')]=config[_0x28f4('0x22')]||0x2;this[_0x28f4('0x23')]={};this['actions']={};this[_0x28f4('0x24')]={};this[_0x28f4('0x25')]={};this['optionPredictive']={};this[_0x28f4('0x26')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0x28f4('0x27')]={};this[_0x28f4('0x28')]={};ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0x28f4('0x29'),this[_0x28f4('0x2a')]['bind'](this));ami['on'](_0x28f4('0x2b'),this[_0x28f4('0x2c')][_0x28f4('0x2d')](this));ami['on'](_0x28f4('0x2e'),this[_0x28f4('0x2f')][_0x28f4('0x2d')](this));ami['on'](_0x28f4('0x30'),this[_0x28f4('0xa')][_0x28f4('0x2d')](this));ami['on']('hangup',this[_0x28f4('0x31')]['bind'](this));ami['on'](_0x28f4('0x32'),this['syncNewExten'][_0x28f4('0x2d')](this));ami['on'](_0x28f4('0x33'),this[_0x28f4('0x34')][_0x28f4('0x2d')](this));ami['on'](_0x28f4('0x35'),this[_0x28f4('0x36')][_0x28f4('0x2d')](this));ami['on']('queuestatuscomplete',this[_0x28f4('0x37')][_0x28f4('0x2d')](this));this[_0x28f4('0x38')]();this[_0x28f4('0x39')]();RpcSetting[_0x28f4('0x3a')]()[_0x28f4('0x3b')](function(_0x1bfd15){previewRecallmeReminderInterval=_0x1bfd15[_0x28f4('0x3c')];});}function isNotNull(_0x4062e7){return _0x4062e7!==null&&!_['isUndefined'](_0x4062e7);}function checkIsLoggedIn(_0x3714f4,_0x231869){return function(){if(_0x231869<=0x0){_0x3714f4[_0x28f4('0x3d')]=_0x28f4('0x3e');throw _0x3714f4[_0x28f4('0x3f')]+_0x28f4('0x40');}};}function isActive(_0x2b9c2c){return _0x2b9c2c;}function checkIsActive(_0x38c30e,_0x313c07){return function(){if(!isActive(_0x313c07)){_0x38c30e[_0x28f4('0x3d')]=_0x28f4('0x41');throw _0x38c30e['name']+_0x28f4('0x42');}};}function checkInterval(_0x3a7bd1){return function(){if(!isNotNull(_0x3a7bd1[_0x28f4('0x43')])){_0x3a7bd1[_0x28f4('0x3d')]='INTERVAL_IS_NULL';throw _0x3a7bd1['name']+_0x28f4('0x44');}if(!isNotNull(_0x3a7bd1[_0x28f4('0x43')][_0x28f4('0x45')])){_0x3a7bd1['message']=_0x28f4('0x46');throw _0x3a7bd1[_0x28f4('0x3f')]+_0x28f4('0x44');}if(!isNotNull(_[_0x28f4('0x47')](_0x3a7bd1[_0x28f4('0x43')]['Intervals']))){_0x3a7bd1['message']=_0x28f4('0x46');throw _0x3a7bd1[_0x28f4('0x3f')]+_0x28f4('0x44');}};}function msgResponse(_0x4ea14f,_0x59b613,_0x2b725e){return{'action':_0x4ea14f,'response':_0x59b613,'message':_0x2b725e,'stack':_0x2b725e};}function myreject(_0x3cd869){return function(_0x2c8027){return _0x3cd869(msgResponse(_0x28f4('0x48'),_0x28f4('0x49'),JSON['stringify'](_0x2c8027)));};}function getSeconds(_0x3b048b,_0x23e33e){var _0x5d56a7=moment(_0x3b048b)[_0x28f4('0x4a')](0x0);var _0x5699a0=moment(_0x23e33e)[_0x28f4('0x4a')](0x0);return _0x5d56a7[_0x28f4('0x4b')](_0x5699a0,_0x28f4('0x4c'));}function emit(_0x5052e9,_0x3f6bbe,_0x11cced){io['to'](_0x5052e9)[_0x28f4('0x4d')](_0x3f6bbe,_0x11cced);}function emitVoiceQueueSummary(_0x3bf645){if(_0x3bf645['type']==='outbound'){var _0x1f23e4={'id':_0x3bf645['id'],'name':_0x3bf645[_0x28f4('0x3f')],'strategy':_0x3bf645[_0x28f4('0x4e')],'answered':_0x3bf645[_0x28f4('0x4f')],'available':_0x3bf645[_0x28f4('0x50')],'loggedIn':_0x3bf645[_0x28f4('0x51')],'pTalking':_0x3bf645['pTalking'],'sumBillable':_0x3bf645[_0x28f4('0x52')],'sumDuration':_0x3bf645[_0x28f4('0x53')],'sumHoldTime':_0x3bf645[_0x28f4('0x54')]||0x0,'talking':_0x3bf645[_0x28f4('0x55')],'total':_0x3bf645[_0x28f4('0x56')],'type':_0x3bf645[_0x28f4('0x57')],'unmanaged':_0x3bf645[_0x28f4('0x58')],'abandoned':_0x3bf645[_0x28f4('0x59')],'waiting':_0x3bf645[_0x28f4('0x5a')],'loggedInDb':_0x3bf645[_0x28f4('0x5b')],'dialActive':_0x3bf645[_0x28f4('0x5c')],'dialMethod':_0x3bf645[_0x28f4('0x5d')],'dialOriginateCallerIdName':_0x3bf645['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3bf645['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3bf645['dialOriginateTimeout'],'dialPrefix':_0x3bf645[_0x28f4('0x5e')],'outboundAnswerAgiCallsDay':_0x3bf645[_0x28f4('0x5f')],'outboundAnswerCallsDay':_0x3bf645[_0x28f4('0x60')],'outboundBlacklistCallsDay':_0x3bf645['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3bf645[_0x28f4('0x61')],'outboundCongestionCallsDay':_0x3bf645[_0x28f4('0x62')],'outboundDropCallsDayACS':_0x3bf645[_0x28f4('0x63')],'outboundDropCallsDayCallersExit':_0x3bf645[_0x28f4('0x64')],'outboundDropCallsDayTimeout':_0x3bf645['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x3bf645['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3bf645[_0x28f4('0x65')],'outboundOriginateFailureCallsDay':_0x3bf645[_0x28f4('0x66')],'outboundReCallsDay':_0x3bf645[_0x28f4('0x67')],'outboundRejectCallsDay':_0x3bf645[_0x28f4('0x68')],'outboundUnknownCallsDay':_0x3bf645['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x3bf645[_0x28f4('0x69')],'predictiveIntervalAvgHoldtime':_0x3bf645[_0x28f4('0x6a')],'predictiveIntervalAvgTalktime':_0x3bf645[_0x28f4('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x3bf645[_0x28f4('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x3bf645[_0x28f4('0x6d')],'predictiveIntervalErlangCalls':_0x3bf645[_0x28f4('0x6e')],'predictiveIntervalErlangCallsDroppedCalls':_0x3bf645[_0x28f4('0x6f')],'predictiveIntervalHitRate':_0x3bf645[_0x28f4('0x70')],'predictiveIntervalMultiplicativeFactor':_0x3bf645[_0x28f4('0x71')],'predictiveIntervalPauses':_0x3bf645[_0x28f4('0x72')],'predictiveIntervalAvailable':_0x3bf645[_0x28f4('0x73')],'predictiveIntervalTotalCalls':_0x3bf645[_0x28f4('0x74')],'message':_0x3bf645[_0x28f4('0x3d')],'originated':_0x3bf645[_0x28f4('0x75')],'erlangCalls':_0x3bf645[_0x28f4('0x76')],'erlangCallToSecond':_0x3bf645['erlangCallToSecond'],'erlangAbandonmentRate':_0x3bf645[_0x28f4('0x77')],'erlangBusyFactor':_0x3bf645['erlangBusyFactor'],'startPredictive':_0x3bf645[_0x28f4('0x26')],'startProgressive':_0x3bf645['startProgressive']};if(_0x3bf645['Trunk']){_0x1f23e4[_0x28f4('0x78')]={'id':_0x3bf645[_0x28f4('0x78')]['id'],'name':_0x3bf645[_0x28f4('0x78')][_0x28f4('0x3f')],'active':_0x3bf645['Trunk'][_0x28f4('0x79')],'callerid':_0x3bf645[_0x28f4('0x78')]['callerid']};}if(_0x3bf645[_0x28f4('0x43')]){_0x1f23e4[_0x28f4('0x43')]={'id':_0x3bf645[_0x28f4('0x43')]['id'],'name':_0x3bf645[_0x28f4('0x43')][_0x28f4('0x3f')]};}var _0x3681c0=md5(JSON[_0x28f4('0x7a')](_0x1f23e4));if(_0x3bf645[_0x28f4('0x7b')]!==_0x3681c0){_0x3bf645['md5']=_0x3681c0;emit(util[_0x28f4('0x7c')](_0x28f4('0x7d'),_0x1f23e4['name']),_0x28f4('0x7e'),_0x1f23e4);}}}function emitCampaignSummary(_0x29bd71){if(_0x29bd71[_0x28f4('0x57')]===_0x28f4('0x7f')){emit(util[_0x28f4('0x7c')](_0x28f4('0x80'),_0x29bd71['name']),'campaign:save',_0x29bd71);}}function checkGetDataPredictive(_0xfb0a27){if(isNotNull(_0xfb0a27)&&!_[_0x28f4('0x47')](_0xfb0a27)){loggerPredictive[_0x28f4('0x81')](_0x28f4('0x82'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xfb0a27[_0x28f4('0x74')]);loggerPredictive['info'](_0x28f4('0x83'),_0xfb0a27[_0x28f4('0x69')]);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x84'),_0xfb0a27[_0x28f4('0x6d')]);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x85'),_0xfb0a27['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x28f4('0x81')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xfb0a27[_0x28f4('0x6a')]);loggerPredictive[_0x28f4('0x81')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xfb0a27[_0x28f4('0x6b')]);loggerPredictive['info']('---------------------------');if(_0xfb0a27['predictiveIntervalTotalCalls']>0x0){if(!_[_0x28f4('0x86')](_0xfb0a27[_0x28f4('0x6b')])&&_0xfb0a27[_0x28f4('0x6b')]>0x0){return!![];}loggerPredictive['info'](_0x28f4('0x87'));if(!_[_0x28f4('0x86')](_0xfb0a27[_0x28f4('0x6a')])&&_0xfb0a27[_0x28f4('0x6a')]>0x0){return!![];}loggerPredictive[_0x28f4('0x81')](_0x28f4('0x88'));}else{loggerPredictive[_0x28f4('0x81')](_0x28f4('0x89'));}}else{loggerPredictive['info'](_0x28f4('0x8a'));}return![];}function mergeDataErlangB(_0x3c05a1){return function(_0x3e6b5f){loggerPredictive['info'](_0x28f4('0x8b'));loggerPredictive[_0x28f4('0x81')](_0x28f4('0x8c'),_0x3e6b5f['erlangCalls']);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x8d'),_0x3e6b5f[_0x28f4('0x8e')]);loggerPredictive[_0x28f4('0x81')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e6b5f[_0x28f4('0x77')]);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x8f'),_0x3e6b5f[_0x28f4('0x90')]);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x91'),_0x3e6b5f[_0x28f4('0x77')]);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x92'));_[_0x28f4('0x93')](_0x3c05a1,_0x3e6b5f);};}function getDiff(_0xf1bda1){var _0x4f11a8=moment()[_0x28f4('0x4a')](0x0);var _0x1a27b5=moment(_0xf1bda1)[_0x28f4('0x4a')](0x0);return _0x4f11a8[_0x28f4('0x4b')](_0x1a27b5,_0x28f4('0x4c'));}function ifInterval(_0x452585,_0x30b9b0){if(_[_0x28f4('0x86')](_0x30b9b0)){return![];}return getDiff(_0x30b9b0)<_0x452585*0x3c;}function freeVariablesPredictive(_0x329bcf){if(isNotNull(_0x329bcf)){if(!_[_0x28f4('0x86')](_0x329bcf[_0x28f4('0x94')])){_0x329bcf[_0x28f4('0x94')]=undefined;loggerPredictive[_0x28f4('0x81')](_0x329bcf[_0x28f4('0x3f')],_0x28f4('0x95'));}if(!_[_0x28f4('0x86')](_0x329bcf[_0x28f4('0x26')])){_0x329bcf[_0x28f4('0x26')]=undefined;loggerPredictive['info'](_0x329bcf['name'],_0x28f4('0x96'));}if(!_[_0x28f4('0x86')](_0x329bcf[_0x28f4('0x97')])){clearInterval(_0x329bcf['handlePredictive']);_0x329bcf[_0x28f4('0x97')]=undefined;loggerPredictive[_0x28f4('0x81')](_0x329bcf[_0x28f4('0x3f')],_0x28f4('0x98'));}}}function erlangb(_0x4e3dd3,_0x1e4385){if(_0x1e4385===0x0){return 0x0;}var _0x7f759e=0x1;for(var _0x550b61=0x1;_0x550b61<=_0x1e4385;_0x550b61+=0x1){_0x7f759e=0x1+_0x7f759e*_0x550b61/_0x4e3dd3;}return 0x1/_0x7f759e;}function isVoiceQueueOutbound(_0x3a110d){return _0x3a110d==='outbound';}function isNotPreview(_0x4e48f5){return _0x4e48f5!==_0x28f4('0x1d');}function isCampaignIvr(_0x3ece44){return _0x3ece44===_0x28f4('0x7f');}function getCallerId(_0x42fabe,_0x349900,_0x42761a){if(!_[_0x28f4('0x86')](_0x42761a)&&typeof _0x42761a===_0x28f4('0x99')&&!_[_0x28f4('0x47')](_0x42761a)){if(!_[_0x28f4('0x86')](_0x349900)&&typeof _0x349900===_0x28f4('0x99')&&!_[_0x28f4('0x47')](_0x349900)){return util[_0x28f4('0x7c')](_0x28f4('0x9a'),_0x349900,_0x42761a);}return util['format']('\x22%s\x22\x20<%s>',_0x42761a,_0x42761a);}if(!_[_0x28f4('0x86')](_0x42fabe)&&typeof _0x42fabe===_0x28f4('0x99')&&!_[_0x28f4('0x47')](_0x42fabe)){return _0x42fabe;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x2211e6,_0x4a98a9){return function(_0x3fbab4){freeVariablesPredictive(_0x4a98a9);emitVoiceQueueSummary(_0x4a98a9);emitCampaignSummary(_0x4a98a9);loggerSyncQueueSummary['error'](_0x2211e6,util['inspect'](_0x3fbab4,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x59662e,_0x4cfd38){return function(_0x1b5530){loggerPredictive[_0x28f4('0x9b')](_0x4cfd38[_0x28f4('0x3f')],_0x59662e);loggerPredictive[_0x28f4('0x9b')](_0x1b5530[_0x28f4('0x9c')]);freeVariablesPredictive(_0x4cfd38);};}function loggerCatch(_0x1ed3c2){return function(_0x4f2dd3){logger[_0x28f4('0x9b')](_0x1ed3c2,util['inspect'](_0x4f2dd3,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x112793){return _0x112793&&!_[_0x28f4('0x86')](_0x112793)&&_0x112793[_0x28f4('0x9d')]>0x0;}function decremetOriginate(_0x154fad){if(!_[_0x28f4('0x86')](_0x154fad)&&_0x154fad!==null){if(typeof _0x154fad['originated']!==_0x28f4('0x9e')){if(_0x154fad[_0x28f4('0x75')]>0x0){_0x154fad[_0x28f4('0x75')]-=0x1;}else{logger['error'](_0x28f4('0x9f'));}}}else{logger[_0x28f4('0x9b')](_0x28f4('0xa0'));}}function checkContactLowerLimitOriginate(_0x2381dc,_0x4f83c2,_0x213bf1){if(_0x4f83c2>_0x213bf1){for(var _0x3b339c=0x0;_0x3b339c<_0x4f83c2-_0x213bf1;_0x3b339c+=0x1){decremetOriginate(_0x2381dc);}}}function loggerGetContactDialer(_0x1262f0,_0x52ce73,_0xd4908a){return function(_0x1aad69){checkContactLowerLimitOriginate(_0x52ce73,_0xd4908a,0x0);logger[_0x28f4('0x9b')](_0x1262f0,util[_0x28f4('0xa1')](_0x1aad69,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x37a36a){return function(_0x2aed43){if(isNotNull(_0x2aed43)&&isNotNull(_0x2aed43[0x0])){if(_0x2aed43[0x0][_0x28f4('0xa2')]>0x0){_0x37a36a['message']=_0x28f4('0xa3');logger[_0x28f4('0x81')]('[getContactDialer2][ReScheduled]'+_0x37a36a[_0x28f4('0x3f')],_0x2aed43[0x0][_0x28f4('0xa2')],'contacts');}else{_0x37a36a[_0x28f4('0x3d')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x28f4('0x81')]('[getContactDialer2][Empty]'+_0x37a36a['name']);}}};}function notSendMessagesQueue(_0x5c191c){if(_0x5c191c[_0x28f4('0xa4')]){freeVariablesPredictive(_0x5c191c);if(_0x5c191c[_0x28f4('0x75')]===0x0&&_0x5c191c[_0x28f4('0x55')]===0x0&&_0x5c191c['waiting']===0x0&&(_0x5c191c[_0x28f4('0xa5')]||0x0)===0x0){_0x5c191c[_0x28f4('0xa4')]=![];_0x5c191c['available']=0x0;_0x5c191c[_0x28f4('0x3d')]=_0x28f4('0x41');loggerSyncQueueSummary[_0x28f4('0x9b')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x5c191c[_0x28f4('0x3f')],_0x28f4('0xa6'));}else{_0x5c191c[_0x28f4('0x3d')]=_0x28f4('0xa7');loggerSyncQueueSummary[_0x28f4('0x9b')](_0x28f4('0xa8'),_0x5c191c[_0x28f4('0x3f')],_0x28f4('0xa9'));}emitVoiceQueueSummary(_0x5c191c);}}function notSendMessagesCampaign(_0xf8c58f){if(_0xf8c58f['sendMessageOneNotActive']){if(_0xf8c58f[_0x28f4('0x75')]===0x0){_0xf8c58f[_0x28f4('0xa4')]=![];_0xf8c58f['message']=_0x28f4('0x41');loggerSyncQueueSummary[_0x28f4('0x9b')](_0x28f4('0xaa'),_0xf8c58f[_0x28f4('0x3f')],'is\x20not\x20active');}else{_0xf8c58f['message']=_0x28f4('0xa7');loggerSyncQueueSummary[_0x28f4('0x9b')](_0x28f4('0xaa'),_0xf8c58f['name'],'is\x20disactive');}emitCampaignSummary(_0xf8c58f);}}function createObjHistory(_0x4c5616,_0x581a0f,_0x57d1c8,_0x2beeb5,_0xd07b){_0x4c5616['message']=_0x57d1c8;var _0x59bd8a=new Action(_0x4c5616,_0x581a0f);var _0x2706a0=new History(_0x59bd8a);_0x2706a0[_0x28f4('0xab')]=_0x2beeb5;_0x2706a0[_0x28f4('0xac')]=_0xd07b;_0x2706a0['endtime']=_0x59bd8a['starttime'];return _0x2706a0;}Dialer[_0x28f4('0xad')][_0x28f4('0x39')]=function(){var _0x32e73d=this;setInterval(function(){_0x32e73d[_0x28f4('0xae')](_0x32e73d[_0x28f4('0x25')],_0x28f4('0xaf'));_0x32e73d[_0x28f4('0xae')](_0x32e73d['actions'],'[actions]');},0x32c8);};Dialer[_0x28f4('0xad')][_0x28f4('0xae')]=function(_0x41532a,_0xef8bd7){var _0x3289c9=this;for(var _0x256e89 in _0x41532a){if(typeof _0x41532a[_0x256e89]!==_0x28f4('0x9e')){this['sequence']['enqueue'](function(){if(!_[_0x28f4('0xb0')](_0x41532a[_0x256e89])){return ami[_0x28f4('0xb1')]({'action':_0x28f4('0xb2'),'channel':_0x41532a[_0x256e89][_0x28f4('0xb3')]})[_0x28f4('0xb4')](function(_0x16c3b0){if(_0x16c3b0[_0x28f4('0x3d')]===_0x28f4('0xb5')){setTimeout(function(){if(_0x41532a[_0x256e89]&&_0x41532a[_0x256e89][_0x28f4('0x57')]!==_0x28f4('0x7f')){_0x3289c9[_0x28f4('0xb6')](_0x3289c9[_0x28f4('0x1e')][_0x41532a[_0x256e89]['queue']]);logger[_0x28f4('0x9b')](_0x28f4('0xb7'),_0xef8bd7,_0x256e89,_0x41532a[_0x256e89][_0x28f4('0xb8')]);delete _0x41532a[_0x256e89];}if(_0x41532a[_0x256e89]&&_0x41532a[_0x256e89]['type']===_0x28f4('0x7f')){_0x3289c9[_0x28f4('0xb6')](_0x3289c9[_0x28f4('0x1f')][_0x41532a[_0x256e89]['queue']]);logger[_0x28f4('0x9b')]('[Dialer][checkChannel][ivr]',_0xef8bd7,_0x256e89,_0x41532a[_0x256e89][_0x28f4('0xb8')]);delete _0x41532a[_0x256e89];}},0x2328);}});}});}}};Dialer[_0x28f4('0xad')][_0x28f4('0xb9')]=function(_0x474a77){return BPromise[_0x28f4('0xba')]()[_0x28f4('0x3b')](cmHopper[_0x28f4('0xb9')](_0x474a77))[_0x28f4('0xb4')](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0x28f4('0xbb')]=function(_0x51919b){return BPromise[_0x28f4('0xba')]()[_0x28f4('0x3b')](cmHopperBlack[_0x28f4('0xbb')](_0x51919b))[_0x28f4('0xb4')](loggerCatch(_0x28f4('0xbc')));};Dialer[_0x28f4('0xad')]['checkIsBlackListIvr']=function(_0x1903ac){return BPromise['resolve']()[_0x28f4('0x3b')](cmHopperBlack['checkIsBlackListIvr'](_0x1903ac))[_0x28f4('0xb4')](loggerCatch(_0x28f4('0xbd')));};Dialer[_0x28f4('0xad')][_0x28f4('0xbe')]=function(_0x594a79){return BPromise[_0x28f4('0xba')]()[_0x28f4('0x3b')](cmHopperHistory[_0x28f4('0xbf')](_0x594a79))[_0x28f4('0xb4')](loggerCatch(_0x28f4('0xc0')));};Dialer['prototype'][_0x28f4('0xc1')]=function(_0x36f932){return BPromise[_0x28f4('0xba')]()['then'](cmHopper[_0x28f4('0xc1')](_0x36f932))[_0x28f4('0xb4')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x28f4('0xad')][_0x28f4('0xc2')]=function(_0x31dc9b,_0x5c61a1,_0x2e965d){return BPromise[_0x28f4('0xba')]()['then'](cmHopper[_0x28f4('0xc2')](_0x31dc9b,_0x5c61a1,_0x2e965d))[_0x28f4('0xb4')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x28f4('0xad')]['getContactDialer']=function(_0x5a8f4f,_0x4b2a00,_0x1f4656,_0x28ea87,_0x3dfa8c){return BPromise[_0x28f4('0xba')]()['then'](cmHopper['getContactDialer'](_0x5a8f4f,_0x4b2a00,_0x1f4656,_0x28ea87))['catch'](function(_0x36aedc){_0x3dfa8c['temp']-=_0x1f4656;_0x3dfa8c[_0x28f4('0xc3')]=_0x3dfa8c[_0x28f4('0xc3')]>0x0?_0x3dfa8c['temp']:0x0;loggerCatch(_0x28f4('0xc4'))(_0x36aedc);});};Dialer[_0x28f4('0xad')][_0x28f4('0xc5')]=function(_0x1e06bc,_0x341749,_0x5ee27a,_0x390a71){return BPromise[_0x28f4('0xba')]()[_0x28f4('0x3b')](cmHopper[_0x28f4('0xc5')](_0x1e06bc,_0x341749,_0x5ee27a))[_0x28f4('0xb4')](function(_0x28c961){_0x390a71['temp']-=_0x341749;_0x390a71['temp']=_0x390a71[_0x28f4('0xc3')]>0x0?_0x390a71['temp']:0x0;loggerCatch(_0x28f4('0xc6'))(_0x28c961);});};Dialer[_0x28f4('0xad')][_0x28f4('0xc7')]=function(_0x56e0a9){return BPromise[_0x28f4('0xba')]()[_0x28f4('0x3b')](voiceQueueRt[_0x28f4('0xc7')](_0x56e0a9))[_0x28f4('0xb4')](loggerCatch(_0x28f4('0xc8')));};Dialer['prototype'][_0x28f4('0xc9')]=function(_0x326826){return BPromise[_0x28f4('0xba')]()[_0x28f4('0x3b')](cmHopper[_0x28f4('0xc9')](_0x326826))[_0x28f4('0xb4')](loggerCatch(_0x28f4('0xca')));};Dialer['prototype'][_0x28f4('0xcb')]=function(_0x72a7bf){return BPromise['resolve']()['then'](cmHopperHistory[_0x28f4('0xcb')](_0x72a7bf))['catch'](loggerCatch(_0x28f4('0xcc')));};Dialer[_0x28f4('0xad')]['updateOriginated']=function(_0x89452f){if(!_[_0x28f4('0x86')](_0x89452f)&&_0x89452f!==null){if(typeof _0x89452f[_0x28f4('0x75')]!==_0x28f4('0x9e')){if(_0x89452f[_0x28f4('0x75')]>0x0){_0x89452f[_0x28f4('0x75')]-=0x1;}else{logger[_0x28f4('0x9b')](_0x28f4('0xcd'));}}}else{logger[_0x28f4('0x9b')](_0x28f4('0xce'));}};Dialer[_0x28f4('0xad')][_0x28f4('0xcf')]=function(_0x33c74c,_0x1e5563){var _0x16707d=this;return function(_0x5cffcf){_0x16707d['updateOriginated'](_0x1e5563);logger[_0x28f4('0x9b')](_0x33c74c,util[_0x28f4('0xa1')](_0x5cffcf,{'showHidden':![],'depth':null}));};};Dialer[_0x28f4('0xad')][_0x28f4('0xd0')]=function(_0x3cf6f4,_0x4916f7,_0x43c0b3){var _0x1466fd={'state':0x19,'statedesc':'notFound'};this[_0x28f4('0xb6')](_0x4916f7);this[_0x28f4('0xd1')](_[_0x28f4('0x93')](_0x1466fd,_['pick'](_0x43c0b3,[_0x28f4('0xd2'),_0x28f4('0xd3'),_0x28f4('0xd4'),_0x28f4('0xd5'),_0x28f4('0xd6')])),_0x28f4('0xd7'),_0x28f4('0xd8'));logger[_0x28f4('0x9b')](_0x3cf6f4);};Dialer[_0x28f4('0xad')][_0x28f4('0xd9')]=function(_0x5e1db6){return _0x5e1db6===_0x28f4('0xda');};Dialer[_0x28f4('0xad')]['isTrunkReachable']=function(_0x3c9e57){return!_['isUndefined'](_0x3c9e57)&&_0x3c9e57&&!_[_0x28f4('0x86')](_0x3c9e57['name'])&&!_[_0x28f4('0x86')](_0x3c9e57[_0x28f4('0x79')])&&_0x3c9e57[_0x28f4('0x79')]&&(this[_0x28f4('0x21')][util['format']('SIP/%s',_0x3c9e57[_0x28f4('0x3f')])][_0x28f4('0xb2')]===_0x28f4('0xdb')||this[_0x28f4('0x21')][util[_0x28f4('0x7c')](_0x28f4('0xdc'),_0x3c9e57[_0x28f4('0x3f')])][_0x28f4('0xb2')]===_0x28f4('0xdd'));};Dialer[_0x28f4('0xad')]['saveInDb']=function(_0x4306ef,_0x23d8b1,_0x18bc58){this[_0x28f4('0xcb')](_0x4306ef)[_0x28f4('0xb4')](loggerCatch(_0x23d8b1));this[_0x28f4('0xc9')](_0x4306ef)[_0x28f4('0xb4')](loggerCatch(_0x18bc58));};Dialer[_0x28f4('0xad')][_0x28f4('0x34')]=function(_0x3490d1){var _0x30060e=this[_0x28f4('0x25')][_0x3490d1['uniqueid']];var _0x8fdfd5;if(!_['isNil'](_0x3490d1)&&!_[_0x28f4('0xb0')](_0x3490d1[_0x28f4('0xde')])&&!_[_0x28f4('0xb0')](_0x3490d1[_0x28f4('0xde')]['amdstatus'])&&_0x3490d1['exten']==='xcally-motion-dialer'&&_0x30060e){if(_0x30060e[_0x28f4('0x57')]!==_0x28f4('0x7f')&&this[_0x28f4('0x1e')][_0x30060e[_0x28f4('0xb8')]][_0x28f4('0xdf')]&&_0x3490d1[_0x28f4('0xe0')]===_0x28f4('0xe1')){delete this[_0x28f4('0x25')][_0x3490d1[_0x28f4('0xe2')]];this[_0x28f4('0xb6')](this[_0x28f4('0x1e')][_0x30060e[_0x28f4('0xb8')]]);this[_0x28f4('0x1e')][_0x30060e[_0x28f4('0xb8')]][_0x28f4('0x60')]+=0x1;this['voiceQueues'][_0x30060e['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x8fdfd5=new Hangup(_0x30060e,_0x3490d1);_0x8fdfd5[_0x28f4('0xab')]=0x12;_0x8fdfd5[_0x28f4('0xac')]=_0x28f4('0xe3');_0x8fdfd5[_0x28f4('0xe4')]=_0x28f4('0xe5');ami[_0x28f4('0x4d')](_0x28f4('0xe6'),ut[_0x28f4('0xe7')](_0x8fdfd5,_0x28f4('0xe8')));this['saveInDb'](_0x8fdfd5,'[syncHangupInAMD][createHistory]',_0x28f4('0xe9'));}if(_0x30060e['type']!==_0x28f4('0x7f')&&this[_0x28f4('0x1e')][_0x30060e[_0x28f4('0xb8')]][_0x28f4('0xdf')]&&_0x3490d1[_0x28f4('0xe0')]==='MACHINE'){var _0x9bdc9c=this;return new BPromise(function(_0x39e92d,_0x4f9011){delete _0x9bdc9c['uniqueId'][_0x3490d1[_0x28f4('0xe2')]];_0x9bdc9c[_0x28f4('0xb6')](_0x9bdc9c[_0x28f4('0x1e')][_0x30060e[_0x28f4('0xb8')]]);_0x9bdc9c[_0x28f4('0x1e')][_0x30060e[_0x28f4('0xb8')]]['outboundAnswerCallsDay']+=0x1;_0x9bdc9c[_0x28f4('0x1e')][_0x30060e[_0x28f4('0xb8')]][_0x28f4('0x5f')]+=0x1;var _0x281606=_0x9bdc9c[_0x28f4('0x1e')][_0x30060e[_0x28f4('0xb8')]];var _0x42b609=new Hangup(_0x30060e,_0x3490d1);_0x42b609[_0x28f4('0xab')]=0x13;_0x42b609['statedesc']=_0x28f4('0xea');_0x42b609[_0x28f4('0xe4')]=_0x28f4('0xe5');_0x42b609['countmachineretry']+=0x1;_0x42b609['countglobal']+=0x1;_0x42b609[_0x28f4('0xe8')]=!![];ami[_0x28f4('0x4d')](_0x28f4('0xe6'),ut[_0x28f4('0xe7')](_0x42b609,_0x28f4('0xe8')));_0x9bdc9c[_0x28f4('0xcb')](_0x42b609)[_0x28f4('0xb4')](loggerCatch(_0x28f4('0xeb')));if(_0x42b609['countbusyretry']+_0x42b609[_0x28f4('0xec')]+_0x42b609[_0x28f4('0xed')]+_0x42b609[_0x28f4('0xee')]+_0x42b609['countdropretry']+_0x42b609[_0x28f4('0xef')]+_0x42b609[_0x28f4('0xf0')]+_0x42b609[_0x28f4('0xf1')]>=_0x281606[_0x28f4('0xf2')]){_0x9bdc9c[_0x28f4('0xf3')](_0x42b609,_0x39e92d,_0x4f9011,_0x28f4('0xf4'));}else{if(_0x42b609[_0x28f4('0xf0')]>=_0x281606[_0x28f4('0xf5')]){_0x9bdc9c[_0x28f4('0xf6')](_0x42b609,_0x39e92d,_0x4f9011,_0x28f4('0xf7'));}else{_0x9bdc9c[_0x28f4('0xc1')]({'active':![],'countmachineretry':_0x42b609[_0x28f4('0xf0')],'scheduledat':moment()[_0x28f4('0xf8')](_0x281606[_0x28f4('0xf9')],_0x28f4('0xfa'))['format'](_0x28f4('0xfb')),'ContactId':_0x42b609['ContactId'],'ListId':_0x42b609[_0x28f4('0xd3')],'VoiceQueueId':_0x42b609['VoiceQueueId']||undefined,'CampaignId':_0x42b609[_0x28f4('0xd6')]||undefined})['catch'](loggerCatch(_0x28f4('0xfc')));_0x39e92d({'reschedule':0x1});}}});}if(_0x30060e[_0x28f4('0x57')]===_0x28f4('0x7f')&&this[_0x28f4('0x1f')][_0x30060e['queue']][_0x28f4('0xdf')]&&_0x3490d1[_0x28f4('0xe0')]===_0x28f4('0xe1')){delete this[_0x28f4('0x25')][_0x3490d1[_0x28f4('0xe2')]];this[_0x28f4('0xb6')](this[_0x28f4('0x1f')][_0x30060e[_0x28f4('0xb8')]]);_0x8fdfd5=new Hangup(_0x30060e,_0x3490d1);_0x8fdfd5[_0x28f4('0xab')]=0x12;_0x8fdfd5[_0x28f4('0xac')]='HangupInAMD';_0x8fdfd5[_0x28f4('0xe4')]=_0x28f4('0xe5');ami['emit'](_0x28f4('0xe6'),ut[_0x28f4('0xe7')](_0x8fdfd5,_0x28f4('0xe8')));this['saveInDb'](_0x8fdfd5,_0x28f4('0xfd'),_0x28f4('0xfe'));}if(_0x30060e[_0x28f4('0x57')]===_0x28f4('0x7f')&&this[_0x28f4('0x1f')][_0x30060e[_0x28f4('0xb8')]][_0x28f4('0xdf')]&&_0x3490d1['value']===_0x28f4('0xff')){var _0x9bdc9c=this;return new BPromise(function(_0x34a42e,_0x6cc0fa){delete _0x9bdc9c[_0x28f4('0x25')][_0x3490d1[_0x28f4('0xe2')]];_0x9bdc9c[_0x28f4('0xb6')](_0x9bdc9c[_0x28f4('0x1f')][_0x30060e['queue']]);_0x9bdc9c['campaigns'][_0x30060e[_0x28f4('0xb8')]][_0x28f4('0x60')]+=0x1;_0x9bdc9c[_0x28f4('0x1f')][_0x30060e['queue']][_0x28f4('0x5f')]+=0x1;var _0x35b23a=_0x9bdc9c['campaigns'][_0x30060e[_0x28f4('0xb8')]];var _0x14994d=new Hangup(_0x30060e,_0x3490d1);_0x14994d[_0x28f4('0xab')]=0x13;_0x14994d['statedesc']=_0x28f4('0xea');_0x14994d['membername']=_0x28f4('0xe5');_0x14994d[_0x28f4('0xf0')]+=0x1;_0x14994d[_0x28f4('0x100')]+=0x1;_0x14994d[_0x28f4('0xe8')]=!![];ami['emit'](_0x28f4('0xe6'),ut[_0x28f4('0xe7')](_0x14994d,_0x28f4('0xe8')));_0x9bdc9c[_0x28f4('0xcb')](_0x14994d)[_0x28f4('0xb4')](loggerCatch(_0x28f4('0xeb')));if(_0x14994d[_0x28f4('0x101')]+_0x14994d[_0x28f4('0xec')]+_0x14994d['countnoanswerretry']+_0x14994d[_0x28f4('0xee')]+_0x14994d[_0x28f4('0x102')]+_0x14994d['countabandonedretry']+_0x14994d['countmachineretry']+_0x14994d[_0x28f4('0xf1')]>=_0x35b23a[_0x28f4('0xf2')]){_0x9bdc9c['stateGlobal'](_0x14994d,_0x34a42e,_0x6cc0fa,_0x28f4('0xf4'));}else{if(_0x14994d[_0x28f4('0xf0')]>=_0x35b23a[_0x28f4('0xf5')]){_0x9bdc9c[_0x28f4('0xf6')](_0x14994d,_0x34a42e,_0x6cc0fa,_0x28f4('0xf7'));}else{_0x9bdc9c[_0x28f4('0xc1')]({'active':![],'countmachineretry':_0x14994d['countmachineretry'],'scheduledat':moment()['add'](_0x35b23a[_0x28f4('0xf9')],_0x28f4('0xfa'))['format'](_0x28f4('0xfb')),'ContactId':_0x14994d[_0x28f4('0xd2')],'ListId':_0x14994d[_0x28f4('0xd3')],'VoiceQueueId':_0x14994d[_0x28f4('0xd5')]||undefined,'CampaignId':_0x14994d[_0x28f4('0xd6')]||undefined})[_0x28f4('0xb4')](loggerCatch(_0x28f4('0xfc')));_0x34a42e({'reschedule':0x1});}}});}}};Dialer[_0x28f4('0xad')][_0x28f4('0x31')]=function(_0x1165fe){var _0x1dc385=this['uniqueId'][_0x1165fe['uniqueid']];var _0x16281f=this;var _0x2e87f2;if(_0x1dc385&&_0x1dc385[_0x28f4('0x57')]===_0x28f4('0x7f')){delete this[_0x28f4('0x25')][_0x1165fe[_0x28f4('0xe2')]];this['updateOriginated'](this['campaigns'][_0x1dc385['queue']]);this[_0x28f4('0x1f')][_0x1dc385[_0x28f4('0xb8')]][_0x28f4('0x103')]+=0x1;_0x2e87f2=new Hangup(_0x1dc385,_0x1165fe);this[_0x28f4('0xcb')](_0x2e87f2)['catch'](loggerCatch(_0x28f4('0x104')));this[_0x28f4('0xc9')](_0x2e87f2)['catch'](loggerCatch(_0x28f4('0x105')));}if(_0x1dc385&&_0x1dc385['type']!=='ivr'&&isNotNull(this['voiceQueues'][_0x1dc385[_0x28f4('0xb8')]]['dialQueueProject'])){delete this[_0x28f4('0x25')][_0x1165fe[_0x28f4('0xe2')]];this['updateOriginated'](this[_0x28f4('0x1e')][_0x1dc385[_0x28f4('0xb8')]]);this[_0x28f4('0x1e')][_0x1dc385['queue']][_0x28f4('0x60')]+=0x1;this['voiceQueues'][_0x1dc385[_0x28f4('0xb8')]][_0x28f4('0x5f')]+=0x1;_0x2e87f2=new Hangup(_0x1dc385,_0x1165fe);_0x2e87f2[_0x28f4('0xab')]=0x10;_0x2e87f2['statedesc']=_0x28f4('0x106');_0x2e87f2[_0x28f4('0xe4')]='AGI';this['createHistory'](_0x2e87f2)[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x104')));this[_0x28f4('0xc9')](_0x2e87f2)['catch'](loggerCatch(_0x28f4('0x105')));}if(_0x1dc385&&_0x1dc385[_0x28f4('0x57')]!==_0x28f4('0x7f')&&!isNotNull(this[_0x28f4('0x1e')][_0x1dc385[_0x28f4('0xb8')]]['dialQueueProject'])){delete this[_0x28f4('0x25')][_0x1165fe[_0x28f4('0xe2')]];this[_0x28f4('0xb6')](this[_0x28f4('0x1e')][_0x1dc385[_0x28f4('0xb8')]]);this[_0x28f4('0x1e')][_0x1dc385[_0x28f4('0xb8')]]['outboundUnknownCallsDay']+=0x1;_0x2e87f2=new Hangup(_0x1dc385,_0x1165fe);_0x2e87f2[_0x28f4('0xab')]=0xc;_0x2e87f2[_0x28f4('0xac')]=_0x1165fe[_0x28f4('0x107')];_0x2e87f2[_0x28f4('0xe4')]=_0x28f4('0x108');this['createHistory'](_0x2e87f2)[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x104')));this['moveContactManagedDialer'](_0x2e87f2)[_0x28f4('0xb4')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x28f4('0xad')]['syncAgentComplete']=function(_0x32a84c){var _0x3a251c=this[_0x28f4('0x25')][_0x32a84c[_0x28f4('0xe2')]];var _0x263be9=this;if(this[_0x28f4('0x1e')][_0x32a84c['queue']]){if(_0x3a251c&&_0x3a251c[_0x28f4('0x57')]!=='ivr'){delete this[_0x28f4('0x25')][_0x32a84c[_0x28f4('0xe2')]];this[_0x28f4('0x1e')][_0x32a84c[_0x28f4('0xb8')]]['outboundAnswerCallsDay']+=0x1;var _0x2b8e0e=new AgentComplete(_0x3a251c,_0x32a84c);if(_0x32a84c[_0x28f4('0x109')]===_0x28f4('0x10a')){_0x2b8e0e[_0x28f4('0x10b')]=this['voiceQueues'][_0x32a84c[_0x28f4('0xb8')]]['dialQueueProject2']&&this[_0x28f4('0x1e')][_0x32a84c[_0x28f4('0xb8')]]['dialAgiAfterHangupAgent']?moment()[_0x28f4('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x2b8e0e)[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x10c')));this[_0x28f4('0xc9')](_0x2b8e0e)[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x10d')));}}};Dialer[_0x28f4('0xad')][_0x28f4('0x10e')]=function(_0x175bd7){if(this[_0x28f4('0x1e')][_0x175bd7[_0x28f4('0xb8')]]){if(this[_0x28f4('0x25')][_0x175bd7[_0x28f4('0xe2')]]&&this['uniqueId'][_0x175bd7[_0x28f4('0xe2')]][_0x28f4('0x57')]!==_0x28f4('0x7f')){this[_0x28f4('0xb6')](this[_0x28f4('0x1e')][_0x175bd7[_0x28f4('0xb8')]]);this[_0x28f4('0x25')][_0x175bd7[_0x28f4('0xe2')]][_0x28f4('0x10f')]=moment()[_0x28f4('0x7c')](_0x28f4('0xfb'));}}};Dialer[_0x28f4('0xad')][_0x28f4('0x110')]=function(_0x28e88b){this['createHistory'](_0x28e88b)['catch'](loggerCatch(_0x28f4('0x10c')));this['moveContactManagedDialer'](_0x28e88b)[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x111')));};Dialer[_0x28f4('0xad')][_0x28f4('0x2a')]=function(_0x525508){var _0x48c583=this['uniqueId'][_0x525508[_0x28f4('0xe2')]];var _0x5e6bf8=this;if(this[_0x28f4('0x1e')][_0x525508[_0x28f4('0xb8')]]){if(_0x48c583&&_0x48c583['type']!==_0x28f4('0x7f')){delete this[_0x28f4('0x25')][_0x525508['uniqueid']];this[_0x28f4('0xb6')](this[_0x28f4('0x1e')][_0x525508[_0x28f4('0xb8')]]);_0x48c583['droptime']=moment()[_0x28f4('0x7c')](_0x28f4('0xfb'));var _0x2fbf5a=new QueueCallerAbandon(_0x48c583,_0x525508);if(getSeconds(_0x48c583[_0x28f4('0x112')],_0x48c583[_0x28f4('0x113')])>=_0x48c583[_0x28f4('0x114')]){this[_0x28f4('0x1e')][_0x525508[_0x28f4('0xb8')]][_0x28f4('0x6d')]+=0x1;this[_0x28f4('0x1e')][_0x525508['queue']][_0x28f4('0x115')]+=0x1;this[_0x28f4('0x1e')][_0x525508['queue']][_0x28f4('0x6f')]+=0x1;_0x2fbf5a['state']=0xa;_0x2fbf5a[_0x28f4('0xac')]=_0x28f4('0x116');_0x2fbf5a[_0x28f4('0x117')]=_0x28f4('0x118');_0x2fbf5a[_0x28f4('0x10b')]=this['voiceQueues'][_0x525508['queue']][_0x28f4('0x119')]?moment()[_0x28f4('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x2fbf5a['countdropretry']+=0x1;_0x2fbf5a['countglobal']+=0x1;if(_0x2fbf5a[_0x28f4('0x102')]>=this[_0x28f4('0x1e')][_0x525508['queue']][_0x28f4('0x11a')]){this[_0x28f4('0x110')](_0x2fbf5a);}else{this[_0x28f4('0xc1')]({'active':![],'countdropretry':_0x2fbf5a['countdropretry'],'scheduledat':moment()[_0x28f4('0xf8')](this['voiceQueues'][_0x525508['queue']][_0x28f4('0x11b')],'minutes')[_0x28f4('0x7c')](_0x28f4('0xfb')),'ContactId':_0x48c583['ContactId'],'ListId':_0x48c583[_0x28f4('0xd3')],'VoiceQueueId':_0x48c583[_0x28f4('0xd5')]||undefined,'CampaignId':_0x48c583[_0x28f4('0xd6')]||undefined})[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x11c')));var _0x40cf5a=new History(_0x2fbf5a);_0x40cf5a[_0x28f4('0xab')]=0xa;_0x40cf5a[_0x28f4('0xac')]='Drop';_0x40cf5a[_0x28f4('0x11d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x40cf5a['endtime']=_0x40cf5a['starttime'];_0x40cf5a[_0x28f4('0x11e')]=_0x2fbf5a[_0x28f4('0x11e')];_0x40cf5a[_0x28f4('0x11f')]=_0x2fbf5a[_0x28f4('0x11f')];this[_0x28f4('0xcb')](_0x40cf5a)[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x120')));}}else{this['voiceQueues'][_0x525508[_0x28f4('0xb8')]][_0x28f4('0x6c')]+=0x1;this[_0x28f4('0x1e')][_0x525508[_0x28f4('0xb8')]][_0x28f4('0x64')]+=0x1;_0x2fbf5a['state']=0xb;_0x2fbf5a['statedesc']='Abandoned';_0x2fbf5a['dropreason']=_0x28f4('0x121');_0x2fbf5a[_0x28f4('0xef')]+=0x1;_0x2fbf5a['countglobal']+=0x1;if(_0x2fbf5a[_0x28f4('0xef')]>=this[_0x28f4('0x1e')][_0x525508[_0x28f4('0xb8')]][_0x28f4('0x122')]){this[_0x28f4('0x110')](_0x2fbf5a);}else{this[_0x28f4('0xc1')]({'active':![],'countabandonedretry':_0x2fbf5a['countabandonedretry'],'scheduledat':moment()['add'](this[_0x28f4('0x1e')][_0x525508[_0x28f4('0xb8')]][_0x28f4('0x123')],'minutes')['format'](_0x28f4('0xfb')),'ContactId':_0x48c583[_0x28f4('0xd2')],'ListId':_0x48c583['ListId'],'VoiceQueueId':_0x48c583[_0x28f4('0xd5')]||undefined,'CampaignId':_0x48c583[_0x28f4('0xd6')]||undefined})[_0x28f4('0xb4')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x40cf5a=new History(_0x2fbf5a);_0x40cf5a[_0x28f4('0xab')]=0xb;_0x40cf5a[_0x28f4('0xac')]='Abandoned';_0x40cf5a['starttime']=moment()[_0x28f4('0x7c')](_0x28f4('0xfb'));_0x40cf5a['endtime']=_0x40cf5a[_0x28f4('0x11d')];_0x40cf5a['calleridname']=_0x2fbf5a[_0x28f4('0x11e')];_0x40cf5a[_0x28f4('0x11f')]=_0x2fbf5a[_0x28f4('0x11f')];this['createHistory'](_0x40cf5a)['catch'](loggerCatch(_0x28f4('0x124')));}}}}};Dialer[_0x28f4('0xad')][_0x28f4('0x125')]=function(_0x36522a){if(this['actions'][_0x36522a[_0x28f4('0xe2')]]){this[_0x28f4('0x126')][_0x36522a[_0x28f4('0xe2')]][_0x28f4('0xb3')]=_0x36522a['channel'];}if(this[_0x28f4('0x25')][_0x36522a[_0x28f4('0xe2')]]){this['uniqueId'][_0x36522a[_0x28f4('0xe2')]]['channel']=_0x36522a[_0x28f4('0xb3')];}};Dialer[_0x28f4('0xad')][_0x28f4('0x36')]=function(_0x51e0dd){if(strategy[this[_0x28f4('0x1e')][this[_0x28f4('0x126')][_0x51e0dd[_0x28f4('0x127')]]['queue']][_0x28f4('0x4e')]]===_0x28f4('0x128')){if(this[_0x28f4('0x126')][_0x51e0dd[_0x28f4('0x127')]]&&_[_0x28f4('0xb0')](this['actions'][_0x51e0dd[_0x28f4('0x127')]]['locked'])&&_0x51e0dd[_0x28f4('0xb2')]==='1'&&_0x51e0dd[_0x28f4('0x129')]==='0'){if(this['agents'][_0x51e0dd['stateinterface']]){if(!this[_0x28f4('0x20')][_0x51e0dd['stateinterface']][_0x28f4('0x12a')]){this[_0x28f4('0x20')][_0x51e0dd[_0x28f4('0x12b')]]['locked']=!![];this['actions'][_0x51e0dd[_0x28f4('0x127')]][_0x28f4('0x12a')]=!![];this[_0x28f4('0x126')][_0x51e0dd[_0x28f4('0x127')]][_0x28f4('0x12b')]=_0x51e0dd[_0x28f4('0x12b')];}}}}else if((strategy[this['voiceQueues'][this[_0x28f4('0x126')][_0x51e0dd[_0x28f4('0x127')]][_0x28f4('0xb8')]][_0x28f4('0x4e')]]||_0x28f4('0x12c'))===_0x28f4('0x12c')){if(this['actions'][_0x51e0dd[_0x28f4('0x127')]]){if(this['agents'][_0x51e0dd[_0x28f4('0x12b')]]){this[_0x28f4('0x126')][_0x51e0dd['actionid']][_0x28f4('0x12b')]=_0x51e0dd[_0x28f4('0x12b')];if(_[_0x28f4('0xb0')](this[_0x28f4('0x27')][this[_0x28f4('0x126')][_0x51e0dd[_0x28f4('0x127')]][_0x28f4('0xb8')]])){this[_0x28f4('0x27')][this[_0x28f4('0x126')][_0x51e0dd[_0x28f4('0x127')]][_0x28f4('0xb8')]]=[];}this[_0x28f4('0x27')][this['actions'][_0x51e0dd[_0x28f4('0x127')]]['queue']][_0x28f4('0x12d')](_[_0x28f4('0x93')](_[_0x28f4('0x12e')](this[_0x28f4('0x126')][_0x51e0dd[_0x28f4('0x127')]],['idHopper',_0x28f4('0x12b')]),{'status':_0x51e0dd['status'],'paused':_0x51e0dd[_0x28f4('0x129')]}));}}}};function unlockQueueStatus(_0x13acc3,_0x12c922){setTimeout(function(){if(_[_0x28f4('0x86')](_0x13acc3[_0x28f4('0x12f')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x12c922);}_0x13acc3[_0x28f4('0x12f')]=!![];loggerBooked[_0x28f4('0x81')](_0x28f4('0x130'),_0x12c922,JSON[_0x28f4('0x7a')](_['pick'](_0x13acc3,[_0x28f4('0x3f'),_0x28f4('0x12f')])));},0x1f3);}Dialer['prototype'][_0x28f4('0x37')]=function(_0x28b9d6){var _0x36838c=this;var _0x9abe31=_0x36838c[_0x28f4('0x1e')][_0x36838c[_0x28f4('0x126')][_0x28b9d6[_0x28f4('0x127')]]['queue']];if(strategy[this[_0x28f4('0x1e')][this[_0x28f4('0x126')][_0x28b9d6[_0x28f4('0x127')]][_0x28f4('0xb8')]][_0x28f4('0x4e')]]===_0x28f4('0x128')){if(this[_0x28f4('0x126')][_0x28b9d6[_0x28f4('0x127')]]&&this[_0x28f4('0x126')][_0x28b9d6[_0x28f4('0x127')]][_0x28f4('0x12b')]){this['preview']['run'](this[_0x28f4('0x126')][_0x28b9d6[_0x28f4('0x127')]]['idHopper'],this[_0x28f4('0x126')][_0x28b9d6[_0x28f4('0x127')]]['stateinterface'])[_0x28f4('0xb4')](function(_0x2217ac){logger['error'](_0x28f4('0x131'),util[_0x28f4('0xa1')](_0x2217ac,{'showHidden':![],'depth':null}));})['finally'](function(){_0x36838c[_0x28f4('0xb6')](_0x36838c[_0x28f4('0x1e')][_0x36838c['actions'][_0x28b9d6[_0x28f4('0x127')]]['queue']]);_0x36838c[_0x28f4('0x20')][_0x36838c['actions'][_0x28b9d6['actionid']][_0x28f4('0x12b')]][_0x28f4('0x12a')]=![];delete _0x36838c['actions'][_0x28b9d6[_0x28f4('0x127')]];unlockQueueStatus(_0x9abe31);});}else{this[_0x28f4('0xb6')](this[_0x28f4('0x1e')][this[_0x28f4('0x126')][_0x28b9d6[_0x28f4('0x127')]]['queue']]);this[_0x28f4('0xc1')]({'active':![],'ContactId':this[_0x28f4('0x126')][_0x28b9d6[_0x28f4('0x127')]]['ContactId'],'ListId':this[_0x28f4('0x126')][_0x28b9d6[_0x28f4('0x127')]]['ListId'],'VoiceQueueId':this[_0x28f4('0x126')][_0x28b9d6[_0x28f4('0x127')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x28b9d6[_0x28f4('0x127')]][_0x28f4('0xd6')]||undefined})['catch'](loggerCatch(_0x28f4('0x132')));delete this['actions'][_0x28b9d6[_0x28f4('0x127')]];unlockQueueStatus(_0x9abe31);}}else if((strategy[this[_0x28f4('0x1e')][this[_0x28f4('0x126')][_0x28b9d6[_0x28f4('0x127')]][_0x28f4('0xb8')]]['strategy']]||_0x28f4('0x12c'))===_0x28f4('0x12c')){var _0x57ed12;if(this[_0x28f4('0x126')][_0x28b9d6['actionid']]&&!_[_0x28f4('0x47')](this[_0x28f4('0x27')][this[_0x28f4('0x126')][_0x28b9d6[_0x28f4('0x127')]]['queue']])){if(this[_0x28f4('0x28')][_0x36838c[_0x28f4('0x126')][_0x28b9d6['actionid']][_0x28f4('0xb8')]]){this[_0x28f4('0x28')][_0x36838c[_0x28f4('0x126')][_0x28b9d6[_0x28f4('0x127')]][_0x28f4('0xb8')]]=this['queueBookedRR'][this[_0x28f4('0x126')][_0x28b9d6[_0x28f4('0x127')]]['queue']]?this[_0x28f4('0x28')][this['actions'][_0x28b9d6['actionid']]['queue']]:this[_0x28f4('0x27')][this['actions'][_0x28b9d6['actionid']]['queue']]?this[_0x28f4('0x27')][this['actions'][_0x28b9d6['actionid']][_0x28f4('0xb8')]][_0x28f4('0x133')]||0x0:0x0;}this[_0x28f4('0x27')][this['actions'][_0x28b9d6[_0x28f4('0x127')]][_0x28f4('0xb8')]][_0x28f4('0x133')]=this[_0x28f4('0x28')][this['actions'][_0x28b9d6[_0x28f4('0x127')]][_0x28f4('0xb8')]];for(var _0x93ede4=0x0;_0x93ede4=0x0;})['catch'](myreject(_0x44f8f6)));}}else{_0x4546fd[_0x28f4('0x12d')](ami['Action']({'action':'command','command':util['format'](_0x28f4('0x14c'),_0x37462b,!_[_0x28f4('0x86')](config[_0x28f4('0x14e')][_0x4ba8db])?_0x4ba8db:'')})['then'](function(_0x2047d6){return _0x2047d6[_0x28f4('0x14f')][_0x28f4('0x150')](_0x28f4('0x151'))>=0x0;})['catch'](myreject(_0x44f8f6)));}BPromise[_0x28f4('0x152')](_0x4546fd)[_0x28f4('0x3b')](function(_0x4a0af4){var _0x55bb05=_[_0x28f4('0x153')](_0x4a0af4);if(_0x55bb05){return _0x2c3900(_0x55bb05);}else{_0xd940f5[_0x28f4('0x3d')]=_0x244909?_0x28f4('0x154'):_0x28f4('0x155');return _0x44f8f6(msgResponse(_0x28f4('0x156'),_0x28f4('0x146'),_0x28f4('0x157')+_0x244909+'\x20'+_0x786eb4+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x37462b,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4ba8db));}})[_0x28f4('0xb4')](function(_0x24ea7e){return _0x44f8f6(msgResponse('ifTime',_0x28f4('0x146'),JSON[_0x28f4('0x7a')](_0x24ea7e)));});});};Dialer[_0x28f4('0xad')]['checkDialMethod']=function(_0x15ae21){var _0x4ac844=this;return function(){switch(_0x15ae21['dialMethod']){case'progressive':freeVariablesPredictive(_0x15ae21);_0x4ac844[_0x28f4('0x158')](_0x15ae21,0x1);break;case'power':freeVariablesPredictive(_0x15ae21);_0x4ac844[_0x28f4('0x158')](_0x15ae21,_0x15ae21[_0x28f4('0x159')]);break;case'predictive':_0x4ac844['predictive'](_0x15ae21);break;case _0x28f4('0x7'):freeVariablesPredictive(_0x15ae21);_0x4ac844['handlePower'](_0x15ae21,0x1);break;default:freeVariablesPredictive(_0x15ae21);logger[_0x28f4('0x9b')](_0x28f4('0x15a'),_0x15ae21[_0x28f4('0x3f')],_0x28f4('0x15b'));}};};Dialer[_0x28f4('0xad')][_0x28f4('0x15c')]=function(_0x24ca36){return BPromise[_0x28f4('0xba')]()[_0x28f4('0x3b')](cmHopper[_0x28f4('0x15d')](_0x24ca36['id'],previewRecallmeReminderInterval))[_0x28f4('0x3b')](function(_0x36067c){for(var _0x1d9e83=0x0;_0x1d9e83<_0x36067c[_0x28f4('0x9d')];_0x1d9e83++){var _0x4b8c6f=_0x36067c[_0x1d9e83]['Agent'][_0x28f4('0x3f')];if(_0x4b8c6f)io['to'](util[_0x28f4('0x7c')](_0x28f4('0x15e'),_0x4b8c6f))[_0x28f4('0x4d')](_0x28f4('0x15f'),{'hopper':_0x36067c[_0x1d9e83]});}})[_0x28f4('0xb4')](function(_0x82e4ba){});};Dialer[_0x28f4('0xad')]['launchHandleIvr']=function(_0x241523){var _0x17fb68=this;return function(){_0x17fb68[_0x28f4('0x160')](_0x241523);};};Dialer[_0x28f4('0xad')][_0x28f4('0xa')]=function(_0x3a8a46){var _0x4b6acb=this;if(isNotPreview(_0x3a8a46['dialMethod'])){if(isVoiceQueueOutbound(_0x3a8a46[_0x28f4('0x57')])&&isActive(_0x3a8a46[_0x28f4('0x5c')])){_0x3a8a46[_0x28f4('0xa4')]=!![];BPromise[_0x28f4('0xba')]()['then'](checkIsLoggedIn(_0x3a8a46,_0x3a8a46[_0x28f4('0x51')]))['then'](checkIsActive(_0x3a8a46,_0x3a8a46[_0x28f4('0x5c')]))[_0x28f4('0x3b')](checkInterval(_0x3a8a46))[_0x28f4('0x3b')](_0x4b6acb[_0x28f4('0x161')](_0x3a8a46))[_0x28f4('0x3b')](_0x4b6acb[_0x28f4('0x144')](_0x3a8a46[_0x28f4('0x162')],_0x3a8a46[_0x28f4('0x163')],_0x3a8a46[_0x28f4('0x3f')],_0x3a8a46))['then'](_0x4b6acb[_0x28f4('0x164')](_0x3a8a46['Interval'],_0x3a8a46[_0x28f4('0x163')],_0x3a8a46[_0x28f4('0x3f')],_0x3a8a46))[_0x28f4('0x3b')](_0x4b6acb[_0x28f4('0x165')](_0x3a8a46))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x3a8a46));}else{notSendMessagesQueue(_0x3a8a46);}}else{freeVariablesPredictive(_0x3a8a46);if(_0x3a8a46[_0x28f4('0x166')]){_0x4b6acb[_0x28f4('0x15c')](_0x3a8a46);}}};Dialer[_0x28f4('0xad')]['syncCampaigns']=function(){var _0x4cc2b1=this;var _0x2494ac;for(var _0x3508aa in this[_0x28f4('0x1f')]){if(typeof this['campaigns'][_0x3508aa]!==_0x28f4('0x9e')){_0x2494ac=this[_0x28f4('0x1f')][_0x3508aa];if(isCampaignIvr(_0x2494ac[_0x28f4('0x57')])&&isActive(_0x2494ac['active'])){_0x2494ac[_0x28f4('0xa4')]=!![];BPromise[_0x28f4('0xba')]()['then'](checkIsActive(_0x2494ac,_0x2494ac[_0x28f4('0x79')]))['then'](checkInterval(_0x2494ac))[_0x28f4('0x3b')](_0x4cc2b1[_0x28f4('0x161')](_0x2494ac))['then'](_0x4cc2b1[_0x28f4('0x144')](_0x2494ac[_0x28f4('0x162')],_0x2494ac[_0x28f4('0x163')],_0x2494ac[_0x28f4('0x3f')],_0x2494ac))['then'](_0x4cc2b1[_0x28f4('0x164')](_0x2494ac[_0x28f4('0x43')],_0x2494ac[_0x28f4('0x163')],_0x2494ac['name'],_0x2494ac))[_0x28f4('0x3b')](_0x4cc2b1[_0x28f4('0x167')](_0x2494ac))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x2494ac));}else{notSendMessagesCampaign(_0x2494ac);}}}};function getCallerIdRandom(_0x468e8c,_0x29650a){var _0x547cbd;var _0x1ed374;var _0x35542e;if(_0x29650a<=0x0){_0x29650a=0x1;}_0x547cbd=new RegExp(_0x28f4('0x168')+_0x29650a+'}$');_0x1ed374=Math['pow'](0xa,_0x29650a-0x1);_0x35542e=Math[_0x28f4('0x169')](0xa,_0x29650a)-0x1;return util[_0x28f4('0x7c')]('%s',_[_0x28f4('0x16a')](_0x468e8c,_0x547cbd,_[_0x28f4('0x16b')](_0x1ed374,_0x35542e)));}function extractCalleridName(_0x1cbfe4){var _0x53f31e=_0x1cbfe4['match'](/"(.*?)"/);return _0x53f31e?_0x53f31e[0x1]:_0x1cbfe4;}function extractCalleridNumber(_0x4f1a31){var _0x26c2ca=_0x4f1a31['match'](/<(.*?)>/);return _0x26c2ca?_0x26c2ca[0x1]:_0x4f1a31;}Dialer[_0x28f4('0xad')][_0x28f4('0x16c')]=function(_0x417271,_0x18a3ed){var _0x3aff74=this;var _0x15ab52=uuid['v4']();this[_0x28f4('0x126')][_0x15ab52]=new Action(_0x417271,_0x18a3ed,_0x15ab52);return new BPromise(function(_0x26d841,_0x363b02){if(_[_0x28f4('0x86')](_0x417271)&&typeof _0x417271!==_0x28f4('0x16d')){return _0x363b02(msgResponse('originate','Failure',_0x28f4('0x16e')));}if(_[_0x28f4('0x86')](_0x18a3ed[_0x28f4('0x16f')][_0x28f4('0x170')])||_0x18a3ed[_0x28f4('0x16f')][_0x28f4('0x170')]===null){return _0x363b02(msgResponse(_0x28f4('0x171'),'Failure',_0x28f4('0x172')));}var _0x5ceaf2={'XMD-CALLERID':_0x3aff74['actions'][_0x15ab52]['getCaller'](),'XMD-AGI':_0x417271['dialQueueProject']?util[_0x28f4('0x7c')](_0x28f4('0x173'),ipAgi,_0x417271[_0x28f4('0x174')]):_0x28f4('0x175'),'XMD-AGIAFTER':_0x417271[_0x28f4('0x119')]?util['format'](_0x28f4('0x173'),ipAgi,_0x417271[_0x28f4('0x119')]):_0x28f4('0x175'),'XMD-QUEUE':_0x417271[_0x28f4('0x57')]==='outbound'?util['format'](_0x28f4('0x176'),_0x417271[_0x28f4('0x3f')],_0x417271[_0x28f4('0x177')]||'',_0x417271[_0x28f4('0x178')]?'c':'',_0x417271[_0x28f4('0x114')]||0x3):_0x28f4('0x175'),'XMD-CONTACTID':_0x18a3ed['ContactId'],'XMD-CDRTYPE':_0x28f4('0x179'),'CALLERID(all)':_0x3aff74[_0x28f4('0x126')][_0x15ab52]['getCaller'](),'XMD-AMD':_0x417271[_0x28f4('0xdf')]?_0x28f4('0x17a'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x417271['dialAMDActive']){_0x5ceaf2['XMD-AMDINITIALSILENCE']=_0x417271['dialAMDInitialSilence']||0x9c4;_0x5ceaf2['XMD-AMDGREETING']=_0x417271[_0x28f4('0x17b')]||0x5dc;_0x5ceaf2[_0x28f4('0x17c')]=_0x417271[_0x28f4('0x17d')]||0x320;_0x5ceaf2[_0x28f4('0x17e')]=_0x417271[_0x28f4('0x17f')]||0x1388;_0x5ceaf2['XMD-AMDMINWORDLENGTH']=_0x417271[_0x28f4('0x180')]||0x64;_0x5ceaf2[_0x28f4('0x181')]=_0x417271['dialAMDBetweenWordsSilence']||0x32;_0x5ceaf2[_0x28f4('0x182')]=_0x417271[_0x28f4('0x183')]||0x3;_0x5ceaf2[_0x28f4('0x184')]=_0x417271[_0x28f4('0x185')]||0x100;_0x5ceaf2[_0x28f4('0x186')]=_0x417271[_0x28f4('0x187')]||0x1388;}if(_0x417271[_0x28f4('0x57')]==='outbound'){_0x5ceaf2['XMD-VOICEQUEUEID']=_0x18a3ed[_0x28f4('0xd5')];}else{_0x5ceaf2['XMD-CAMPAIGNID']=_0x18a3ed[_0x28f4('0xd6')];}for(var _0x58d386 in _0x18a3ed[_0x28f4('0x16f')]){if(typeof _0x18a3ed[_0x28f4('0x16f')][_0x58d386]!==_0x28f4('0x9e')){if(isNotNull(_0x18a3ed[_0x28f4('0x16f')][_0x58d386])&&_0x58d386!=='id'&&_0x58d386!=='tags'&&_0x58d386!==_0x28f4('0x188')&&_0x58d386!==_0x28f4('0x189')){_0x5ceaf2[util[_0x28f4('0x7c')](_0x28f4('0x18a'),'XMD-',_[_0x28f4('0x18b')](_0x58d386))]=_0x18a3ed[_0x28f4('0x16f')][_0x58d386];}}}var _0x4d7fa1=_0x3aff74['isTrunkReachable'](_0x417271['Trunk'])?getCallerId(_0x417271[_0x28f4('0x78')][_0x28f4('0x18c')],_0x417271[_0x28f4('0x18d')],_0x417271['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x417271[_0x28f4('0x18e')],_0x417271['dialRandomLastDigitCallerIdNumber']):_0x417271[_0x28f4('0x18e')]):getCallerId(_['isNil'](_0x417271[_0x28f4('0x141')])?_0x417271[_0x28f4('0x78')]['callerid']:_0x417271[_0x28f4('0x141')][_0x28f4('0x18c')],_0x417271[_0x28f4('0x18d')],_0x417271[_0x28f4('0x18f')]>0x0?getCallerIdRandom(_0x417271['dialOriginateCallerIdNumber'],_0x417271['dialRandomLastDigitCallerIdNumber']):_0x417271[_0x28f4('0x18e')]);if(_0x4d7fa1){_0x5ceaf2[_0x28f4('0x190')]=_0x3aff74[_0x28f4('0x126')][_0x15ab52][_0x28f4('0x191')]=extractCalleridName(_0x4d7fa1);_0x5ceaf2[_0x28f4('0x192')]=_0x3aff74[_0x28f4('0x126')][_0x15ab52]['originatecalleridnum']=extractCalleridNumber(_0x4d7fa1);}return ami[_0x28f4('0xb1')]({'actionid':_0x15ab52,'action':_0x28f4('0x171'),'channel':_0x3aff74[_0x28f4('0x140')](_0x417271[_0x28f4('0x78')])?util[_0x28f4('0x7c')](_0x28f4('0x193'),_0x417271['Trunk'][_0x28f4('0x3f')],isNotNull(_0x417271[_0x28f4('0x5e')])?_0x417271['dialPrefix'][_0x28f4('0x194')]()||'':'',_0x417271['dialCutDigit']>0x0?_0x18a3ed[_0x28f4('0x16f')][_0x28f4('0x170')][_0x28f4('0x195')](_0x417271['dialCutDigit']):_0x18a3ed[_0x28f4('0x16f')][_0x28f4('0x170')]):util[_0x28f4('0x7c')](_0x28f4('0x193'),_[_0x28f4('0xb0')](_0x417271[_0x28f4('0x141')])?_0x417271[_0x28f4('0x78')]['name']:_0x417271['TrunkBackup'][_0x28f4('0x3f')],isNotNull(_0x417271[_0x28f4('0x5e')])?_0x417271[_0x28f4('0x5e')][_0x28f4('0x194')]()||'':'',_0x417271[_0x28f4('0x196')]>0x0?_0x18a3ed[_0x28f4('0x16f')][_0x28f4('0x170')][_0x28f4('0x195')](_0x417271[_0x28f4('0x196')]):_0x18a3ed[_0x28f4('0x16f')]['phone']),'callerid':_0x4d7fa1,'Exten':_0x28f4('0x197'),'Context':'from-sip','Priority':'1','variable':_0x5ceaf2,'timeout':(_0x417271[_0x28f4('0x198')]||0x1e)*0x3e8,'async':!![],'channelid':_0x15ab52})['then'](function(_0x44aa6e){return _0x26d841(_0x44aa6e);})[_0x28f4('0xb4')](function(_0x5baeb1){_0x417271[_0x28f4('0x66')]+=0x1;var _0xa9a056=new History(_0x3aff74['actions'][_0x15ab52]);logger[_0x28f4('0x9b')](util[_0x28f4('0x7c')](_0x28f4('0x199'),JSON[_0x28f4('0x7a')](_0x5baeb1)));_0xa9a056[_0x28f4('0xab')]=0xe;_0xa9a056[_0x28f4('0xac')]=_0x28f4('0x19a');_0xa9a056[_0x28f4('0x11d')]=moment()[_0x28f4('0x7c')](_0x28f4('0xfb'));_0xa9a056['endtime']=_0xa9a056[_0x28f4('0x11d')];_0x3aff74[_0x28f4('0xcb')](_0xa9a056)[_0x28f4('0xb4')](loggerCatch('[originate][error]'));_0x3aff74[_0x28f4('0xc9')](_0xa9a056)[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x19b')))['finally'](function(){delete _0x3aff74[_0x28f4('0x126')][_0x15ab52];return _0x363b02(msgResponse(_0x28f4('0x171'),_0x28f4('0x49'),'originate\x20action\x20Error'));});});});};Dialer[_0x28f4('0xad')][_0x28f4('0x2c')]=function(_0x50586e){var _0x466863=this[_0x28f4('0x126')][_0x50586e[_0x28f4('0x127')]];if(_0x466863){delete this[_0x28f4('0x126')][_0x50586e[_0x28f4('0x127')]];_0x466863[_0x28f4('0x113')]=moment()[_0x28f4('0x7c')](_0x28f4('0xfb'));var _0x42b787=_0x466863[_0x28f4('0x57')]===_0x28f4('0x7f')?this[_0x28f4('0x1f')][_0x466863[_0x28f4('0xb8')]]:this[_0x28f4('0x1e')][_0x466863[_0x28f4('0x19c')]()];if(!this[_0x28f4('0xd9')](_0x50586e[_0x28f4('0x19d')])){this['updateOriginated'](_0x42b787);return this[_0x28f4('0x19e')](_0x466863,_0x42b787,_0x50586e)[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x19f')));}this[_0x28f4('0x25')][_0x50586e[_0x28f4('0xe2')]]=_0x466863;}};Dialer[_0x28f4('0xad')][_0x28f4('0x1a0')]=function(_0x416ad9,_0x81891c,_0x5a0175){var _0x4e01d6=new History(_0x81891c);if(_0x4e01d6[_0x28f4('0x101')]+_0x4e01d6[_0x28f4('0xec')]+_0x4e01d6[_0x28f4('0xed')]+_0x4e01d6[_0x28f4('0xee')]+_0x4e01d6[_0x28f4('0x102')]+_0x4e01d6[_0x28f4('0xef')]+_0x4e01d6[_0x28f4('0xf0')]+_0x4e01d6['countagentrejectretry']>=_0x5a0175[_0x28f4('0xf2')]-0x1){return!![];}switch(_0x416ad9){case 0x3:if(_0x4e01d6[_0x28f4('0xed')]>=_0x5a0175[_0x28f4('0x1a1')]-0x1){return!![];}this[_0x28f4('0xc1')]({'active':![],'countnoanswerretry':_0x4e01d6[_0x28f4('0xed')]+=0x1,'scheduledat':moment()['add'](_0x5a0175[_0x28f4('0x1a2')],_0x28f4('0xfa'))['format'](_0x28f4('0xfb')),'ContactId':_0x4e01d6['ContactId'],'ListId':_0x4e01d6[_0x28f4('0xd3')],'VoiceQueueId':_0x4e01d6[_0x28f4('0xd5')]||undefined,'CampaignId':_0x4e01d6['CampaignId']||undefined})[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x1a3')));break;case 0x5:if(_0x4e01d6['countbusyretry']>=_0x5a0175[_0x28f4('0x1a4')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x4e01d6[_0x28f4('0x101')]+=0x1,'scheduledat':moment()[_0x28f4('0xf8')](_0x5a0175[_0x28f4('0x1a5')],'minutes')[_0x28f4('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e01d6[_0x28f4('0xd2')],'ListId':_0x4e01d6[_0x28f4('0xd3')],'VoiceQueueId':_0x4e01d6[_0x28f4('0xd5')]||undefined,'CampaignId':_0x4e01d6[_0x28f4('0xd6')]||undefined})[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x1a6')));break;case 0x8:if(_0x4e01d6[_0x28f4('0xec')]>=_0x5a0175[_0x28f4('0x1a7')]-0x1){return!![];}this[_0x28f4('0xc1')]({'active':![],'countcongestionretry':_0x4e01d6['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x5a0175[_0x28f4('0x1a8')],_0x28f4('0xfa'))[_0x28f4('0x7c')](_0x28f4('0xfb')),'ContactId':_0x4e01d6[_0x28f4('0xd2')],'ListId':_0x4e01d6[_0x28f4('0xd3')],'VoiceQueueId':_0x4e01d6[_0x28f4('0xd5')]||undefined,'CampaignId':_0x4e01d6[_0x28f4('0xd6')]||undefined})[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x1a9')));break;case 0x0:if(_0x4e01d6['countnosuchnumberretry']>=_0x5a0175[_0x28f4('0x1aa')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x4e01d6[_0x28f4('0xee')]+=0x1,'scheduledat':moment()[_0x28f4('0xf8')](_0x5a0175['dialNoSuchNumberRetryFrequency'],'minutes')['format'](_0x28f4('0xfb')),'ContactId':_0x4e01d6[_0x28f4('0xd2')],'ListId':_0x4e01d6[_0x28f4('0xd3')],'VoiceQueueId':_0x4e01d6['VoiceQueueId']||undefined,'CampaignId':_0x4e01d6[_0x28f4('0xd6')]||undefined})[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x1ab')));}break;case 0xa:if(_0x4e01d6[_0x28f4('0x102')]>=_0x5a0175[_0x28f4('0x11a')]-0x1){return!![];}this[_0x28f4('0xc1')]({'active':![],'countdropretry':_0x4e01d6[_0x28f4('0x102')]+=0x1,'scheduledat':moment()[_0x28f4('0xf8')](_0x5a0175[_0x28f4('0x11b')],_0x28f4('0xfa'))[_0x28f4('0x7c')](_0x28f4('0xfb')),'ContactId':_0x4e01d6['ContactId'],'ListId':_0x4e01d6[_0x28f4('0xd3')],'VoiceQueueId':_0x4e01d6[_0x28f4('0xd5')]||undefined,'CampaignId':_0x4e01d6['CampaignId']||undefined})[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x11c')));break;case 0xb:if(_0x4e01d6[_0x28f4('0xef')]>=_0x5a0175['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x28f4('0xc1')]({'active':![],'countabandonedretry':_0x4e01d6[_0x28f4('0xef')]+=0x1,'scheduledat':moment()[_0x28f4('0xf8')](_0x5a0175[_0x28f4('0x123')],_0x28f4('0xfa'))[_0x28f4('0x7c')](_0x28f4('0xfb')),'ContactId':_0x4e01d6['ContactId'],'ListId':_0x4e01d6[_0x28f4('0xd3')],'VoiceQueueId':_0x4e01d6[_0x28f4('0xd5')]||undefined,'CampaignId':_0x4e01d6[_0x28f4('0xd6')]||undefined})[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x1ac')));break;case 0x13:if(_0x4e01d6[_0x28f4('0xf0')]>=_0x5a0175[_0x28f4('0xf5')]-0x1){return!![];}this[_0x28f4('0xc1')]({'active':![],'countmachineretry':_0x4e01d6[_0x28f4('0xf0')]+=0x1,'scheduledat':moment()[_0x28f4('0xf8')](_0x5a0175[_0x28f4('0xf9')],_0x28f4('0xfa'))[_0x28f4('0x7c')](_0x28f4('0xfb')),'ContactId':_0x4e01d6[_0x28f4('0xd2')],'ListId':_0x4e01d6['ListId'],'VoiceQueueId':_0x4e01d6[_0x28f4('0xd5')]||undefined,'CampaignId':_0x4e01d6[_0x28f4('0xd6')]||undefined})[_0x28f4('0xb4')](loggerCatch(_0x28f4('0xfc')));break;case 0x14:if(_0x4e01d6[_0x28f4('0xf1')]>=_0x5a0175['dialAgentRejectMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x4e01d6['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x28f4('0xf8')](_0x5a0175[_0x28f4('0x1ad')],'minutes')[_0x28f4('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e01d6[_0x28f4('0xd2')],'ListId':_0x4e01d6[_0x28f4('0xd3')],'VoiceQueueId':_0x4e01d6[_0x28f4('0xd5')]||undefined,'CampaignId':_0x4e01d6['CampaignId']||undefined})[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x1ae')));break;default:return!![];}};Dialer[_0x28f4('0xad')]['callProgressDetecting']=function(_0xb8894a,_0x5cc814,_0x428b0c){var _0x48bf50=this;var _0x57d106=new History(_0xb8894a);return new BPromise(function(_0xe6699e,_0x193357){if(_[_0x28f4('0x86')](_0x5cc814)&&typeof _0x5cc814!==_0x28f4('0x16d')){return _0x193357(msgResponse('[callProgressDetecting]','Failure',_0x28f4('0x1af')));}if(_['isUndefined'](_0x428b0c)&&typeof _0x428b0c!==_0x28f4('0x16d')){return _0x193357(msgResponse(_0x28f4('0x1b0'),_0x28f4('0x146'),_0x28f4('0x1b1')));}switch(_0x428b0c[_0x28f4('0x109')]){case'0':_0x5cc814[_0x28f4('0x65')]+=0x1;_0x57d106[_0x28f4('0xab')]=0x0;_0x57d106[_0x28f4('0xac')]=_0x28f4('0x1b2');_0x57d106[_0x28f4('0xee')]+=0x1;_0x57d106[_0x28f4('0x100')]+=0x1;ami['emit'](_0x28f4('0x1b3'),ut['buildObj'](_0xb8894a,_0x28f4('0x1b4')));_0x48bf50['createHistory'](_0x57d106)[_0x28f4('0xb4')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x48bf50[_0x28f4('0x1a0')](0x0,_0xb8894a,_0x5cc814)){if(_0x57d106[_0x28f4('0xee')]>=_0x5cc814['dialNoSuchNumberMaxRetry']){_0x48bf50[_0x28f4('0xf6')](_0x57d106,_0xe6699e,_0x193357,_0x28f4('0x1b5'));}else{_0x48bf50[_0x28f4('0xf3')](_0x57d106,_0xe6699e,_0x193357,_0x28f4('0x1b5'));}}break;case'3':_0x5cc814[_0x28f4('0x1b6')]+=0x1;_0x57d106[_0x28f4('0xab')]=0x3;_0x57d106[_0x28f4('0xac')]=_0x28f4('0x1b7');_0x57d106[_0x28f4('0xed')]+=0x1;_0x57d106[_0x28f4('0x100')]+=0x1;ami[_0x28f4('0x4d')](_0x28f4('0x1b8'),ut[_0x28f4('0xe7')](_0xb8894a,_0x28f4('0x1b9')));_0x48bf50[_0x28f4('0xcb')](_0x57d106)['catch'](loggerCatch(_0x28f4('0x1ba')));if(_0x48bf50[_0x28f4('0x1a0')](0x3,_0xb8894a,_0x5cc814)){if(_0x57d106[_0x28f4('0xed')]>=_0x5cc814[_0x28f4('0x1a1')]){_0x48bf50[_0x28f4('0xf6')](_0x57d106,_0xe6699e,_0x193357,_0x28f4('0x1bb'));}else{_0x48bf50['stateGlobal'](_0x57d106,_0xe6699e,_0x193357,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x5cc814[_0x28f4('0x61')]+=0x1;_0x57d106[_0x28f4('0xab')]=0x5;_0x57d106[_0x28f4('0xac')]=_0x28f4('0x1bc');_0x57d106[_0x28f4('0x101')]+=0x1;_0x57d106['countglobal']+=0x1;ami[_0x28f4('0x4d')](_0x28f4('0x1bd'),ut[_0x28f4('0xe7')](_0xb8894a,'busy'));_0x48bf50[_0x28f4('0xcb')](_0x57d106)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x48bf50[_0x28f4('0x1a0')](0x5,_0xb8894a,_0x5cc814)){if(_0x57d106[_0x28f4('0x101')]>=_0x5cc814[_0x28f4('0x1a4')]){_0x48bf50['createStateFinal'](_0x57d106,_0xe6699e,_0x193357,_0x28f4('0x1be'));}else{_0x48bf50[_0x28f4('0xf3')](_0x57d106,_0xe6699e,_0x193357,_0x28f4('0x1be'));}}break;case'8':_0x5cc814[_0x28f4('0x62')]+=0x1;_0x57d106[_0x28f4('0xab')]=0x8;_0x57d106['statedesc']=_0x28f4('0x1bf');_0x57d106[_0x28f4('0xec')]+=0x1;_0x57d106[_0x28f4('0x100')]+=0x1;ami[_0x28f4('0x4d')](_0x28f4('0x1c0'),ut['buildObj'](_0xb8894a,_0x28f4('0x1c1')));_0x48bf50[_0x28f4('0xcb')](_0x57d106)['catch'](loggerCatch(_0x28f4('0x1c2')));if(_0x48bf50[_0x28f4('0x1a0')](0x8,_0xb8894a,_0x5cc814)){if(_0x57d106[_0x28f4('0xec')]>=_0x5cc814[_0x28f4('0x1a7')]){_0x48bf50[_0x28f4('0xf6')](_0x57d106,_0xe6699e,_0x193357,'reason\x208\x20congestion');}else{_0x48bf50['stateGlobal'](_0x57d106,_0xe6699e,_0x193357,_0x28f4('0x1c3'));}}break;case'11':_0x5cc814[_0x28f4('0x1c4')]+=0x1;_0x57d106[_0x28f4('0xab')]=0xb;_0x57d106[_0x28f4('0xac')]=_0x28f4('0x1c5');_0x57d106['countabandonedretry']+=0x1;_0x57d106[_0x28f4('0x100')]+=0x1;_0x48bf50['createHistory'](_0x57d106)[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x124')));if(_0x48bf50[_0x28f4('0x1a0')](0xb,_0xb8894a,_0x5cc814)){if(_0x57d106[_0x28f4('0xef')]>=_0x5cc814[_0x28f4('0x122')]){_0x48bf50['createStateFinal'](_0x57d106,_0xe6699e,_0x193357,_0x28f4('0x1c6'));}else{_0x48bf50[_0x28f4('0xf3')](_0x57d106,_0xe6699e,_0x193357,'reason\x2011\x20abandoned');}}break;case'20':_0x5cc814[_0x28f4('0x68')]+=0x1;_0x57d106[_0x28f4('0xab')]=0x14;_0x57d106[_0x28f4('0xac')]=_0x28f4('0x1c7');_0x57d106[_0x28f4('0xf1')]+=0x1;_0x57d106['countglobal']+=0x1;ami['emit'](_0x28f4('0x1c8'),ut[_0x28f4('0xe7')](_0xb8894a,'agentreject'));_0x48bf50[_0x28f4('0xcb')](_0x57d106)[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x1c9')));if(_0x48bf50['checkRetriveMax'](0x14,_0xb8894a,_0x5cc814)){if(_0x57d106['countagentrejectretry']>=_0x5cc814[_0x28f4('0x1ca')]){_0x48bf50[_0x28f4('0xf6')](_0x57d106,_0xe6699e,_0x193357,_0x28f4('0x1cb'));}else{_0x48bf50[_0x28f4('0xf3')](_0x57d106,_0xe6699e,_0x193357,_0x28f4('0x1cb'));}}break;default:_0x5cc814['outboundUnknownCallsDay']+=0x1;_0x57d106['state']=0xc;_0x57d106[_0x28f4('0xac')]=_0x428b0c[_0x28f4('0x109')];_0x48bf50[_0x28f4('0xcb')](_0x57d106)[_0x28f4('0xb4')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x48bf50[_0x28f4('0x1a0')](_0x428b0c[_0x28f4('0x109')],_0xb8894a,_0x5cc814)){if(_0x57d106[_0x28f4('0x101')]+_0x57d106['countcongestionretry']+_0x57d106[_0x28f4('0xed')]+_0x57d106[_0x28f4('0xee')]+_0x57d106[_0x28f4('0x102')]+_0x57d106[_0x28f4('0xef')]+_0x57d106['countmachineretry']+_0x57d106[_0x28f4('0xf1')]>=_0x5cc814[_0x28f4('0xf2')]){_0x48bf50[_0x28f4('0xf3')](_0x57d106,_0xe6699e,_0x193357,_0x428b0c[_0x28f4('0x109')]);}else{_0x48bf50[_0x28f4('0xf6')](_0x57d106,_0xe6699e,_0x193357,_0x428b0c[_0x28f4('0x109')]);}}}});};Dialer[_0x28f4('0xad')][_0x28f4('0xf3')]=function(_0x297a6a,_0x5c7d9f,_0x30914c,_0x45e305){var _0x390830=new Final(_0x297a6a);_0x390830[_0x28f4('0xab')]=0xf;_0x390830[_0x28f4('0xac')]=_0x28f4('0x1cc');this[_0x28f4('0xf6')](_0x390830,_0x5c7d9f,_0x30914c,_0x45e305);};Dialer[_0x28f4('0xad')][_0x28f4('0xf6')]=function(_0x4a2bfb,_0x117c7f,_0x19741f,_0x28b67d){this[_0x28f4('0xc9')](_0x4a2bfb)[_0x28f4('0x3b')](function(){return _0x117c7f(msgResponse('[callProgressDetecting]',_0x28f4('0xda'),_0x28b67d));})['catch'](function(){return _0x19741f(msgResponse(_0x28f4('0x1cd'),_0x28f4('0x146'),_0x28f4('0x1ce')));});};Dialer[_0x28f4('0xad')][_0x28f4('0x8')]=function(_0x374a1e){var _0x141a37=_0x374a1e[_0x28f4('0x1cf')]/0x64;var _0x2a1369=_0x374a1e[_0x28f4('0x115')]/(_0x374a1e['outboundDropCallsDayTimeout']+_0x374a1e['outboundAnswerCallsDay']);var _0x512d46=Math[_0x28f4('0x1d0')](_0x374a1e[_0x28f4('0x73')]*(_0x374a1e[_0x28f4('0x1d1')]/0x64));var _0x145672=Math[_0x28f4('0x1d0')](_0x374a1e[_0x28f4('0x73')]*(_0x374a1e[_0x28f4('0x1d2')]/0x64));var _0x1216c4=_0x374a1e[_0x28f4('0x50')]+_0x374a1e[_0x28f4('0x55')];var _0x84bfa7=Math['floor'](_0x374a1e['erlangCalls']*_0x374a1e[_0x28f4('0x77')]*_0x374a1e[_0x28f4('0x70')]*_0x374a1e[_0x28f4('0x71')]);if(_[_0x28f4('0x86')](_0x374a1e['startProgressive'])){if(!_['isUndefined'](_0x374a1e['startPredictive'])){_0x374a1e[_0x28f4('0x26')]=undefined;loggerPredictive[_0x28f4('0x9b')](_0x28f4('0x1d3'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x28f4('0x86')](_0x374a1e['handlePredictive'])){loggerPredictive[_0x28f4('0x9b')](_0x28f4('0x1d3'),_0x28f4('0x1d4'));clearInterval(_0x374a1e[_0x28f4('0x97')]);_0x374a1e[_0x28f4('0x97')]=undefined;}_0x374a1e[_0x28f4('0x94')]=moment()[_0x28f4('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x374a1e[_0x28f4('0x3f')],_0x28f4('0x1d5'),_0x374a1e[_0x28f4('0x94')]);this[_0x28f4('0x158')](_0x374a1e,0x1);}else if(ifInterval(_0x374a1e[_0x28f4('0x1d6')],_0x374a1e['startProgressive'])){this['handlePower'](_0x374a1e,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x374a1e[_0x28f4('0x94')],_0x374a1e[_0x28f4('0x3f')]);_0x374a1e[_0x28f4('0x76')]=0x0;_0x374a1e[_0x28f4('0x6f')]=0x0;}else if(_0x141a37<_0x2a1369&&_0x374a1e[_0x28f4('0x1d7')]==='dropRate'){freeVariablesPredictive(_0x374a1e);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x1d8'),_0x28f4('0x1d9'),_0x2a1369,'startProgressive',_0x374a1e['name']);}else if(_0x84bfa7<_0x374a1e[_0x28f4('0x6f')]&&_0x374a1e[_0x28f4('0x1d7')]===_0x28f4('0x1da')){freeVariablesPredictive(_0x374a1e);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x1db'),_0x28f4('0x1dc'),_0x84bfa7,_0x28f4('0x1dd'),_0x374a1e[_0x28f4('0x6f')],_0x28f4('0x94'),_0x374a1e['name']);}else if(!ifInterval(_0x374a1e[_0x28f4('0x1d6')],_0x374a1e['startProgressive'])&&_[_0x28f4('0x86')](_0x374a1e[_0x28f4('0x26')])&&!_[_0x28f4('0x86')](_0x374a1e['startProgressive'])){_0x374a1e[_0x28f4('0x26')]=moment()[_0x28f4('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x28f4('0x81')](_0x374a1e[_0x28f4('0x3f')],_0x28f4('0x1de'),_0x374a1e[_0x28f4('0x26')]);this[_0x28f4('0xbe')](_0x374a1e[_0x28f4('0x1d6')])[_0x28f4('0x3b')](this['getDataPredictive'](_0x374a1e))['then'](mergeDataErlangB(_0x374a1e))[_0x28f4('0x3b')](this[_0x28f4('0x1df')](_0x374a1e))[_0x28f4('0xb4')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x374a1e));}else if(!ifInterval(_0x374a1e[_0x28f4('0x1d6')],_0x374a1e[_0x28f4('0x26')])){_0x374a1e['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x374a1e[_0x28f4('0x26')]=moment()[_0x28f4('0x7c')](_0x28f4('0xfb'));loggerPredictive[_0x28f4('0x81')](_0x374a1e[_0x28f4('0x3f')],'recalculate\x20predictive\x20at',_0x374a1e[_0x28f4('0x26')]);clearInterval(_0x374a1e[_0x28f4('0x97')]);_0x374a1e['handlePredictive']=undefined;this[_0x28f4('0xbe')](_0x374a1e['dialPredictiveInterval'])['then'](this[_0x28f4('0x1e0')](_0x374a1e))[_0x28f4('0x3b')](mergeDataErlangB(_0x374a1e))[_0x28f4('0x3b')](this['startMethodPredictive'](_0x374a1e))[_0x28f4('0xb4')](loggerCatchPredictive(_0x28f4('0x1e1'),_0x374a1e));}else if(_0x374a1e['predictiveIntervalAvailable']&&_0x1216c4<_0x374a1e[_0x28f4('0x73')]-_0x145672){freeVariablesPredictive(_0x374a1e);loggerPredictive[_0x28f4('0x81')](_0x374a1e[_0x28f4('0x3f')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1216c4,_0x28f4('0x1e2'),_0x374a1e[_0x28f4('0x73')],'-',_0x145672,'=',_0x374a1e[_0x28f4('0x73')]-_0x145672,')');}else if(_0x374a1e[_0x28f4('0x73')]&&_0x1216c4>_0x374a1e['predictiveIntervalAvailable']+_0x512d46){freeVariablesPredictive(_0x374a1e);loggerPredictive[_0x28f4('0x81')](_0x374a1e[_0x28f4('0x3f')],_0x28f4('0x1e3'),_0x1216c4,')\x20are\x20more\x20than\x20threshold\x20(',_0x374a1e[_0x28f4('0x73')],'+',_0x512d46,'=',_0x374a1e[_0x28f4('0x73')]+_0x512d46,')');}};Dialer[_0x28f4('0xad')][_0x28f4('0x1e0')]=function(_0x4b2a3e){var _0x261d3d=this;return function(_0x37b36e){return new BPromise(function(_0x3cfcc1,_0x550c47){_['merge'](_0x4b2a3e,_0x37b36e[0x0]);if(checkGetDataPredictive(_0x37b36e[0x0])){var _0xd8517d=_0x4b2a3e[_0x28f4('0x73')]=_0x4b2a3e['talking']+_0x4b2a3e[_0x28f4('0x50')];var _0x3eae9f=_0x4b2a3e[_0x28f4('0x1d6')]*0x3c;var _0x8aace2=_0x37b36e[0x0][_0x28f4('0x6b')]+_0x37b36e[0x0][_0x28f4('0x6a')];var _0x53ef5b=(_0x37b36e[0x0][_0x28f4('0x69')]+_0x37b36e[0x0][_0x28f4('0x6d')]+_0x37b36e[0x0][_0x28f4('0x6c')])/_0x37b36e[0x0][_0x28f4('0x74')];_0x4b2a3e['predictiveIntervalHitRate']=_0x53ef5b>0x0?_0x53ef5b:0x1;switch(_0x4b2a3e[_0x28f4('0x1d7')]){case _0x28f4('0x1da'):var _0x1612c4=_0x4b2a3e['dialPredictiveOptimizationPercentage']/0x64;return _0x261d3d['abandonmentRate'](_0xd8517d,_0x3eae9f,_0x8aace2,_0x53ef5b,_0x1612c4)['then'](function(_0x5dd57b){return _0x3cfcc1(_0x5dd57b);});case _0x28f4('0x1e4'):var _0x5f4213=_0x4b2a3e[_0x28f4('0x1cf')]/0x64;return _0x261d3d[_0x28f4('0x1e5')](_0xd8517d,_0x3eae9f,_0x8aace2,_0x53ef5b,_0x5f4213)[_0x28f4('0x3b')](function(_0x55830e){return _0x3cfcc1(_0x55830e);});default:return _0x550c47(msgResponse(_0x28f4('0x1e6'),'Failure',_0x28f4('0x1e7')));}}else{return _0x550c47(msgResponse(_0x28f4('0x1e6'),'Failure',_0x28f4('0x1e8')));}});};};Dialer['prototype'][_0x28f4('0x1e9')]=function(_0x5b5e49){var _0x23784a=this;return function(_0x16103a){return new BPromise(function(_0xe236b4,_0x571924){_[_0x28f4('0x93')](_0x5b5e49,_0x16103a[0x0]);if(checkGetDataPredictive(_0x16103a[0x0])){loggerPredictive[_0x28f4('0x81')](JSON[_0x28f4('0x7a')](_0x16103a[0x0]));if(_0x5b5e49[_0x28f4('0x1d7')]===_0x28f4('0x1da')){return _0x23784a[_0x28f4('0xc7')](_0x5b5e49['id'])[_0x28f4('0x3b')](function(_0x362a8f){var _0x36d541=_0x5b5e49[_0x28f4('0x51')]-_0x362a8f[0x0]['outboundQueuePauses'];var _0x3241cf=_0x5b5e49['dialPredictiveInterval']*0x3c;var _0x5238f2=_0x16103a[0x0]['predictiveIntervalAvgTalktime']+_0x16103a[0x0][_0x28f4('0x6a')];var _0x55e051=(_0x16103a[0x0][_0x28f4('0x69')]+_0x16103a[0x0][_0x28f4('0x6d')]+_0x16103a[0x0][_0x28f4('0x6c')])/_0x16103a[0x0][_0x28f4('0x74')];var _0x567eb3=_0x5b5e49['dialPredictiveOptimizationPercentage']/0x64;_0x5b5e49[_0x28f4('0x72')]=_0x362a8f[0x0]['outboundQueuePauses']||0x0;_0x5b5e49[_0x28f4('0x70')]=_0x55e051>0x0?_0x55e051:0x1;return _0x23784a['abandonmentRate'](_0x36d541,_0x3241cf,_0x5238f2,_0x55e051,_0x567eb3);})[_0x28f4('0x3b')](function(_0x1cf071){return _0xe236b4(_0x1cf071);})[_0x28f4('0xb4')](function(_0x1f477a){return _0x571924(msgResponse('[CatchErlangB]','Failure',JSON[_0x28f4('0x7a')](_0x1f477a)));});}if(_0x5b5e49[_0x28f4('0x1d7')]===_0x28f4('0x1e4')){return _0x23784a['getVoiceQueueRtPauses'](_0x5b5e49['id'])[_0x28f4('0x3b')](function(_0x24f109){var _0x29cc61=_0x5b5e49[_0x28f4('0x51')]-_0x24f109[0x0][_0x28f4('0x1ea')];var _0x2f5df2=_0x5b5e49[_0x28f4('0x1d6')]*0x3c;var _0x40d052=_0x16103a[0x0][_0x28f4('0x6b')]+_0x16103a[0x0][_0x28f4('0x6a')];var _0xd72c5a=(_0x16103a[0x0]['predictiveIntervalAnsweredCalls']+_0x16103a[0x0][_0x28f4('0x6d')]+_0x16103a[0x0][_0x28f4('0x6c')])/_0x16103a[0x0][_0x28f4('0x74')];var _0x3493fc=_0x5b5e49[_0x28f4('0x1cf')]/0x64;_0x5b5e49[_0x28f4('0x72')]=_0x24f109[0x0]['outboundQueuePauses']||0x0;_0x5b5e49['predictiveIntervalHitRate']=_0xd72c5a>0x0?_0xd72c5a:0x1;return _0x23784a['busyFactor'](_0x29cc61,_0x2f5df2,_0x40d052,_0xd72c5a,_0x3493fc);})[_0x28f4('0x3b')](function(_0x55d8ca){return _0xe236b4(_0x55d8ca);})['catch'](function(_0x160874){return _0x571924(msgResponse(_0x28f4('0x1eb'),'Failure',JSON[_0x28f4('0x7a')](_0x160874)));});}}else{return _0x571924(msgResponse(_0x28f4('0x1e6'),_0x28f4('0x146'),_0x28f4('0x1e8')));}});};};Dialer[_0x28f4('0xad')]['startMethodPredictive']=function(_0x3b5ef3){var _0x1adf97=this;return function(){var _0x537f28=0x0;var _0x33623f=Math[_0x28f4('0x1ec')](_0x3b5ef3[_0x28f4('0x8e')]*0x3e8);if(_0x33623f>0x0){_0x33623f=_0x33623f<0x64?0x64:_0x33623f;loggerPredictive[_0x28f4('0x81')](_0x3b5ef3[_0x28f4('0x3f')],_0x28f4('0x1ed'),_0x33623f,_0x28f4('0x4a'));_0x3b5ef3[_0x28f4('0x97')]=setInterval(function(){_0x1adf97[_0x28f4('0x97')](_0x3b5ef3);loggerPredictiveCalls[_0x28f4('0x81')](_0x28f4('0x1ee'),_0x537f28+=0x1);},_0x33623f);}else{loggerPredictive['info'](_0x3b5ef3[_0x28f4('0x3f')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x28f4('0xad')][_0x28f4('0x1ef')]=function(_0x21c834,_0x593ed0){var _0x3260a0=this;return function(_0x55f705){if(_['isEmpty'](_0x55f705)){if(_[_0x28f4('0xb0')](_0x593ed0[_0x28f4('0xd4')])||!_0x593ed0[_0x28f4('0x1f0')]){if(_0x21c834[_0x28f4('0x5d')]===_0x28f4('0x7')){_0x21c834['queueStatusComplete']=_[_0x28f4('0x86')](_0x21c834['queueStatusComplete'])?!![]:_0x21c834[_0x28f4('0x12f')];var _0x558ea7=uuid['v4']();_0x3260a0[_0x28f4('0x126')][_0x558ea7]=new Action(_0x21c834,_0x593ed0,_0x558ea7);loggerBooked[_0x28f4('0x81')]('[booked][checkContactBlack]',_0x558ea7,'queueStatusComplete:\x20',JSON[_0x28f4('0x7a')](_0x21c834[_0x28f4('0x12f')]),_0x28f4('0x1f1'),_0x21c834[_0x28f4('0x3f')]);if(_0x21c834[_0x28f4('0x12f')]){_0x21c834[_0x28f4('0x12f')]=![];_0x3260a0[_0x28f4('0x27')][_0x3260a0['actions'][_0x558ea7][_0x28f4('0xb8')]]=[];ami[_0x28f4('0xb1')]({'actionid':_0x558ea7,'action':_0x28f4('0x1f2'),'queue':_0x21c834[_0x28f4('0x3f')]})['catch'](function(){_0x3260a0[_0x28f4('0xb6')](_0x21c834);_0x3260a0[_0x28f4('0xc1')]({'active':![],'ContactId':_0x3260a0[_0x28f4('0x126')][_0x558ea7]['ContactId'],'ListId':_0x3260a0[_0x28f4('0x126')][_0x558ea7]['ListId'],'VoiceQueueId':_0x3260a0[_0x28f4('0x126')][_0x558ea7][_0x28f4('0xd5')]||undefined,'CampaignId':_0x3260a0['actions'][_0x558ea7]['CampaignId']||undefined})[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x1f3')));delete _0x3260a0[_0x28f4('0x126')][_0x558ea7];});}else{loggerBooked['info'](_0x28f4('0x1f4'),JSON[_0x28f4('0x7a')](_0x21c834[_0x28f4('0x12f')]),_0x28f4('0x1f1'),_0x21c834['name']);_0x3260a0[_0x28f4('0xb6')](_0x21c834);_0x3260a0['rescheduleContact']({'active':![],'ContactId':_0x3260a0[_0x28f4('0x126')][_0x558ea7][_0x28f4('0xd2')],'ListId':_0x3260a0[_0x28f4('0x126')][_0x558ea7][_0x28f4('0xd3')],'VoiceQueueId':_0x3260a0['actions'][_0x558ea7][_0x28f4('0xd5')]||undefined,'CampaignId':_0x3260a0[_0x28f4('0x126')][_0x558ea7]['CampaignId']||undefined})['catch'](loggerCatch(_0x28f4('0x1f3')));delete _0x3260a0[_0x28f4('0x126')][_0x558ea7];}}else{return _0x3260a0[_0x28f4('0x16c')](_0x21c834,_0x593ed0);}}else{if(getDiff(_0x593ed0[_0x28f4('0x1f5')])<_0x21c834[_0x28f4('0x1f6')]*0x3c){if(_0x593ed0[_0x28f4('0x1f7')]&&!_0x593ed0[_0x28f4('0x1f7')][_0x28f4('0x1f8')]){_0x3260a0[_0x28f4('0x1d')][_0x28f4('0x139')](_0x593ed0['id'])['finally'](function(){_0x3260a0[_0x28f4('0xb6')](_0x21c834);});}else{_0x3260a0[_0x28f4('0xc2')]({'active':![]},_0x593ed0['id'],0x1)['finally'](function(){_0x3260a0[_0x28f4('0xb6')](_0x21c834);});}}else{_0x21c834[_0x28f4('0x67')]+=0x1;_0x3260a0[_0x28f4('0xb6')](_0x21c834);if(_0x21c834['dialRecallInQueue']){_0x3260a0['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x593ed0['ContactId'],'ListId':_0x593ed0['ListId'],'VoiceQueueId':_0x593ed0[_0x28f4('0xd5')]||undefined,'CampaignId':_0x593ed0[_0x28f4('0xd6')]||undefined})[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x1f9')));_0x3260a0[_0x28f4('0xcb')](createObjHistory(_0x21c834,_0x593ed0,_0x28f4('0x1fa'),0x17,_0x28f4('0x1fb')))[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x1fc')));}else{_0x3260a0['saveInDb'](createObjHistory(_0x21c834,_0x593ed0,_0x28f4('0x1fd'),0x16,_0x28f4('0x1fe')),_0x28f4('0x1ff'),_0x28f4('0x200'));}}}}else{_0x21c834['outboundBlacklistCallsDay']+=0x1;_0x3260a0['saveInDb'](createObjHistory(_0x21c834,_0x593ed0,'BLACKLIST',0xd,_0x28f4('0x201')),_0x28f4('0x202'),_0x28f4('0x203'));throw _0x28f4('0x204');}};};Dialer['prototype'][_0x28f4('0x160')]=function(_0x51eccb){var _0x525e0f=this;var _0x5404c6=_0x51eccb[_0x28f4('0x205')]-_0x51eccb['originated']-_0x51eccb[_0x28f4('0xc3')];emitCampaignSummary(_0x51eccb);if(_0x5404c6>0x0){if(_0x5404c6>this['maxNumberOriginate']){_0x5404c6=this[_0x28f4('0x22')];}_0x51eccb['temp']+=_0x5404c6;this['getContactDialerIvr'](_0x51eccb['id'],_0x5404c6,_0x51eccb[_0x28f4('0x206')],_0x51eccb)['then'](function(_0x39b403){_0x51eccb[_0x28f4('0xc3')]-=_0x5404c6;_0x51eccb[_0x28f4('0xc3')]=_0x51eccb['temp']>0x0?_0x51eccb[_0x28f4('0xc3')]:0x0;if(!checkContactEmpty(_0x39b403)){_0x51eccb['message']=_0x28f4('0x207');logger[_0x28f4('0x81')](_0x28f4('0x208')+_0x51eccb[_0x28f4('0x3f')]);}else{_0x51eccb[_0x28f4('0x75')]+=_0x39b403[_0x28f4('0x9d')];_0x51eccb['message']=_0x28f4('0x209');for(var _0x23437d=0x0;_0x23437d<_0x39b403[_0x28f4('0x9d')];_0x23437d+=0x1){_0x51eccb['ivrTotalCallsDays']+=0x1;if(_[_0x28f4('0xb0')](_0x39b403[_0x23437d])||_[_0x28f4('0xb0')](_0x39b403[_0x23437d][_0x28f4('0x16f')])||_[_0x28f4('0xb0')](_0x39b403[_0x23437d][_0x28f4('0x16f')]['phone'])){_0x525e0f[_0x28f4('0xd0')](_0x28f4('0x20a'),_0x51eccb,_0x39b403[_0x23437d]);}else{_0x525e0f['checkIsBlackListIvr'](_[_0x28f4('0x12e')](_0x39b403[_0x23437d],['CampaignId',_0x28f4('0x20b')]))[_0x28f4('0x3b')](_0x525e0f['checkContactBlack'](_0x51eccb,_0x39b403[_0x23437d]))[_0x28f4('0xb4')](_0x525e0f[_0x28f4('0xcf')](_0x28f4('0x20c'),_0x51eccb));}}}})['catch'](loggerGetContactDialer(_0x28f4('0x20d'),_0x51eccb,_0x5404c6));}};Dialer[_0x28f4('0xad')][_0x28f4('0x158')]=function(_0x2dd682,_0x4984d1){var _0x66be22=this;var _0x3e80ba=[];var _0x46ef1b=_0x4984d1>=0x1?_0x4984d1:0x1;if(_0x2dd682['dialMethod']===_0x28f4('0x7')){_0x46ef1b=0x1;}var _0x4d1cc3=Math[_0x28f4('0x1ec')](_0x2dd682[_0x28f4('0x50')]*_0x46ef1b)-_0x2dd682['originated']-_0x2dd682[_0x28f4('0xc3')];emitVoiceQueueSummary(_0x2dd682);if(_0x2dd682[_0x28f4('0x20e')]>0x0){var _0x1b9a2e=_0x2dd682[_0x28f4('0x20e')]-_0x2dd682['originated']-_0x2dd682['talking']-_0x2dd682['temp']-_0x2dd682['pTalking'];if(_0x4d1cc3>_0x1b9a2e){_0x4d1cc3=_0x1b9a2e;}}if(_0x4d1cc3>0x0){if(_0x2dd682[_0x28f4('0x5d')]==='booked'){_0x4d1cc3=0x1;}if(_0x4d1cc3>this[_0x28f4('0x22')]){_0x4d1cc3=this[_0x28f4('0x22')];}_0x2dd682['temp']+=_0x4d1cc3;for(var _0x2ea1d9 in this['agents']){if(typeof this['agents'][_0x2ea1d9]!=='undefined'){if(this[_0x28f4('0x20')][_0x2ea1d9][_0x28f4('0xab')]==='not_inuse'&&this[_0x28f4('0x20')][_0x2ea1d9][_0x28f4('0xb2')]===_0x28f4('0xdb')){_0x3e80ba[_0x28f4('0x12d')](this[_0x28f4('0x20')][_0x2ea1d9]['id']);}}}this[_0x28f4('0x20f')](_0x2dd682['id'],_0x3e80ba,_0x4d1cc3,_0x2dd682[_0x28f4('0x206')],_0x2dd682)[_0x28f4('0x3b')](function(_0x69e2e1){_0x2dd682[_0x28f4('0xc3')]-=_0x4d1cc3;_0x2dd682['temp']=_0x2dd682[_0x28f4('0xc3')]>0x0?_0x2dd682[_0x28f4('0xc3')]:0x0;if(!checkContactEmpty(_0x69e2e1)){_0x66be22[_0x28f4('0xb9')](_0x2dd682)['then'](sendMessageReschedule(_0x2dd682))[_0x28f4('0xb4')](loggerCatch(_0x28f4('0x210')));}else{_0x2dd682[_0x28f4('0x75')]+=_0x69e2e1[_0x28f4('0x9d')];_0x2dd682['message']=_0x2dd682[_0x28f4('0x5d')]===_0x28f4('0x7')?_0x28f4('0x17a'):_0x28f4('0x209');for(var _0x22d3f1=0x0;_0x22d3f1<_0x69e2e1[_0x28f4('0x9d')];_0x22d3f1+=0x1){if(_[_0x28f4('0xb0')](_0x69e2e1[_0x22d3f1])||_['isNil'](_0x69e2e1[_0x22d3f1][_0x28f4('0x16f')])||_[_0x28f4('0xb0')](_0x69e2e1[_0x22d3f1][_0x28f4('0x16f')][_0x28f4('0x170')])){_0x66be22[_0x28f4('0xd0')](_0x28f4('0x20a'),_0x2dd682,_0x69e2e1[_0x22d3f1]);}else{_0x66be22[_0x28f4('0xbb')](_[_0x28f4('0x12e')](_0x69e2e1[_0x22d3f1],[_0x28f4('0xd5'),'Contact.phone']))[_0x28f4('0x3b')](_0x66be22['checkContactBlack'](_0x2dd682,_0x69e2e1[_0x22d3f1]))[_0x28f4('0xb4')](_0x66be22[_0x28f4('0xcf')](_0x28f4('0x20a'),_0x2dd682));}}}})[_0x28f4('0xb4')](loggerGetContactDialer(_0x28f4('0x211'),_0x2dd682,_0x4d1cc3));}};Dialer['prototype']['handlePredictive']=function(_0x436dca){if(_0x436dca[_0x28f4('0x20e')]>0x0){var _0x5c5fe8=_0x436dca[_0x28f4('0x20e')]-_0x436dca['originated']-_0x436dca['talking'];if(_0x5c5fe8>0x0){this[_0x28f4('0x212')](_0x436dca);}else{loggerPredictiveCalls[_0x28f4('0x81')](_0x28f4('0x213'));}}else{this[_0x28f4('0x212')](_0x436dca);}};Dialer[_0x28f4('0xad')][_0x28f4('0x212')]=function(_0xa68efd){var _0x13ed40=this;var _0x1ffe32=[];_0xa68efd[_0x28f4('0x75')]+=0x1;for(var _0x24642a in this[_0x28f4('0x20')]){if(typeof this[_0x28f4('0x20')][_0x24642a]!==_0x28f4('0x9e')){if(this[_0x28f4('0x20')][_0x24642a][_0x28f4('0xab')]===_0x28f4('0x214')&&this[_0x28f4('0x20')][_0x24642a][_0x28f4('0xb2')]===_0x28f4('0xdb')){_0x1ffe32['push'](this[_0x28f4('0x20')][_0x24642a]['id']);}}}this[_0x28f4('0x20f')](_0xa68efd['id'],_0x1ffe32,0x1,_0xa68efd[_0x28f4('0x206')],_0xa68efd)[_0x28f4('0x3b')](function(_0x1191f8){if(!checkContactEmpty(_0x1191f8)){checkContactLowerLimitOriginate(_0xa68efd,0x1,0x0);_0x13ed40[_0x28f4('0xb9')](_0xa68efd)[_0x28f4('0x3b')](sendMessageReschedule(_0xa68efd))['catch'](loggerCatch(_0x28f4('0x210')));}else{_0xa68efd[_0x28f4('0x3d')]='RUNNING';if(_['isNil'](_0x1191f8[0x0])||_[_0x28f4('0xb0')](_0x1191f8[0x0][_0x28f4('0x16f')])||_[_0x28f4('0xb0')](_0x1191f8[0x0][_0x28f4('0x16f')][_0x28f4('0x170')])){_0x13ed40['emptyContact'](_0x28f4('0x20a'),_0xa68efd,_0x1191f8[0x0]);}else{_0x13ed40[_0x28f4('0xbb')](_[_0x28f4('0x12e')](_0x1191f8[0x0],[_0x28f4('0xd5'),_0x28f4('0x20b')]))[_0x28f4('0x3b')](_0x13ed40[_0x28f4('0x1ef')](_0xa68efd,_0x1191f8[0x0]))['catch'](_0x13ed40[_0x28f4('0xcf')](_0x28f4('0x215'),_0xa68efd));}}})[_0x28f4('0xb4')](loggerGetContactDialer(_0x28f4('0x216'),_0xa68efd,0x1));emitVoiceQueueSummary(_0xa68efd);};Dialer['prototype'][_0x28f4('0x217')]=function(_0x176cec,_0x3fd9db,_0x473b4f,_0x499a66,_0x5d4463,_0x464886){loggerPredictive[_0x28f4('0x81')](_0x28f4('0x218'));loggerPredictive[_0x28f4('0x81')](_0x28f4('0x219'),_0x176cec);loggerPredictive[_0x28f4('0x81')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3fd9db);loggerPredictive[_0x28f4('0x81')]('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',_0x473b4f);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x21a'),_0x499a66);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x21b'),_0x5d4463);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x92'));return new BPromise(function(_0x26ff7a,_0x231fda){if(_0x176cec<=0x0||isNaN(_0x176cec)){return _0x231fda(msgResponse(_0x28f4('0x21c'),_0x28f4('0x49'),'m\x20=\x20'+_0x176cec));}if(_0x473b4f<=0x0||isNaN(_0x473b4f)){return _0x231fda(msgResponse('[abandonmentRate]',_0x28f4('0x49'),_0x28f4('0x21d')+_0x473b4f));}if(_0x499a66<=0x0||isNaN(_0x499a66)){return _0x231fda(msgResponse('[abandonmentRate]',_0x28f4('0x49'),_0x28f4('0x21e')+_0x499a66));}if(_0x3fd9db<=0x0||isNaN(_0x3fd9db)){return _0x231fda(msgResponse(_0x28f4('0x21c'),'Error',_0x28f4('0x21f')+_0x3fd9db));}if(_0x5d4463<=0x0||isNaN(_0x5d4463)){return _0x231fda(msgResponse('[abandonmentRate]',_0x28f4('0x49'),_0x28f4('0x220')+_0x5d4463));}_0x464886=_0x464886||0x0;var _0x3583de=0x1/_0x473b4f;var _0x9cb638=0x0;var _0x43295d=0x0;var _0x3ff5f5=0x0;var _0x3f4a60=0x0;for(var _0x3f93e8=0x0;_0x3ff5f5<_0x5d4463;_0x3f93e8+=0x1){_0x43295d=_0x3f93e8/_0x3fd9db;_0x9cb638=(_0x499a66*_0x43295d+_0x464886)/_0x3583de;_0x3ff5f5=erlangb(_0x9cb638,_0x176cec);_0x3f4a60=_0x9cb638/_0x176cec*(0x1-erlangb(_0x9cb638,_0x176cec));}return _0x26ff7a({'erlangCalls':_0x3f93e8,'erlangCallToSecond':_0x3fd9db/_0x3f93e8,'erlangAbandonmentRate':_0x3ff5f5,'erlangBusyFactor':_0x3f4a60});});};Dialer[_0x28f4('0xad')][_0x28f4('0x1e5')]=function(_0x19f97b,_0x57c496,_0x6e0bba,_0x46319b,_0x38665e,_0x18244a){loggerPredictive[_0x28f4('0x81')](_0x28f4('0x221'));loggerPredictive[_0x28f4('0x81')](_0x28f4('0x219'),_0x19f97b);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x222'),_0x57c496);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x223'),_0x6e0bba);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x21a'),_0x46319b);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x224'),_0x38665e);loggerPredictive[_0x28f4('0x81')](_0x28f4('0x92'));return new BPromise(function(_0x4d5c56,_0x4822ae){if(_0x19f97b<=0x0||isNaN(_0x19f97b)){return _0x4822ae(msgResponse(_0x28f4('0x225'),_0x28f4('0x49'),_0x28f4('0x226')+_0x19f97b));}if(_0x6e0bba<=0x0||isNaN(_0x6e0bba)){return _0x4822ae(msgResponse('[busyFactor]',_0x28f4('0x49'),'Ts\x20=\x20'+_0x6e0bba));}if(_0x46319b<=0x0||isNaN(_0x46319b)){return _0x4822ae(msgResponse(_0x28f4('0x225'),'Error',_0x28f4('0x21e')+_0x46319b));}if(_0x57c496<=0x0||isNaN(_0x57c496)){return _0x4822ae(msgResponse(_0x28f4('0x225'),'Error',_0x28f4('0x21f')+_0x57c496));}if(_0x38665e<=0x0||isNaN(_0x38665e)){return _0x4822ae(msgResponse(_0x28f4('0x225'),_0x28f4('0x49'),'Umin\x20=\x20'+_0x38665e));}_0x18244a=_0x18244a||0x0;var _0x2077c6=0x1/_0x6e0bba;var _0x20b5aa=0x0;var _0x132786=0x0;var _0x526294=0x0;var _0x54c0f4=0x0;for(var _0x47fc1e=0x0;_0x54c0f4<_0x38665e;_0x47fc1e+=0x1){_0x132786=_0x47fc1e/_0x57c496;_0x20b5aa=(_0x46319b*_0x132786+_0x18244a)/_0x2077c6;_0x526294=erlangb(_0x20b5aa,_0x19f97b);_0x54c0f4=_0x20b5aa/_0x19f97b*(0x1-erlangb(_0x20b5aa,_0x19f97b));}return _0x4d5c56({'erlangCalls':_0x47fc1e,'erlangCallToSecond':_0x57c496/_0x47fc1e,'erlangAbandonmentRate':_0x526294,'erlangBusyFactor':_0x54c0f4});});};module[_0x28f4('0x227')]=Dialer; \ No newline at end of file +var _0xc2ed=['TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','handlePreviewRecallNotifications','user:%s','user:dialPreviewRecallReminder','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','checkPreviewRecallReminder','launchHandleIvr','\x5cw{0,','pow','replace','random','match','object','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','substring','from-sip','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','reason','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','[getDataPredictive]','check\x20failure','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','floor','one\x20call\x20every:','[handlePredictive]','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','RUNNING','tryOriginatePredictive','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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]','Error','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\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]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','startPredictive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','name','Intervals','isEmpty','[ifTime][Action]','milliseconds','diff','seconds','outbound','answered','available','loggedIn','sumBillable','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startProgressive','Trunk','active','stringify','md5','voice:queue:%s','voice_queue:save','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','\x22%s\x22\x20<%s>','string','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','talking','pTalking','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','starttime','prototype','uniqueId','[uniqueid]','clearZombieChannels','actions','[actions]','enqueue','Action','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','resolve','countReScheduled','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','emptyContact','notFound','saveInDb','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','outboundAnswerAgiCallsDay','statedesc','HangupInAMD','membername','AMD','emit','amd','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','custom:amd','buildObj','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','[syncAgentComplete][createHistory][0]','dialMachineMaxRetry','YYYY-MM-DD\x20HH:mm:ss','dialQueueProject','AnswerAGI','[syncHangupIvr][createHistory]','[syncHangupIvr]','cause-txt','syncAgentComplete','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','strategy','locked','status','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable'];(function(_0x5d2828,_0x109d0b){var _0x113a65=function(_0x5199a5){while(--_0x5199a5){_0x5d2828['push'](_0x5d2828['shift']());}};_0x113a65(++_0x109d0b);}(_0xc2ed,0xdd));var _0xdc2e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xc2ed[_0x2576d7];return _0x16a08c;};'use strict';var util=require(_0xdc2e('0x0'));var _=require(_0xdc2e('0x1'));var BPromise=require(_0xdc2e('0x2'));var uuid=require(_0xdc2e('0x3'));var moment=require(_0xdc2e('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xdc2e('0x5'));var ut=require(_0xdc2e('0x6'));var config=require(_0xdc2e('0x7'));var logger=require(_0xdc2e('0x8'))(_0xdc2e('0x9'));var loggerBooked=require(_0xdc2e('0x8'))(_0xdc2e('0xa'));var loggerPredictive=require(_0xdc2e('0x8'))(_0xdc2e('0xb'));var loggerPredictiveCalls=require(_0xdc2e('0x8'))(_0xdc2e('0xc'));var loggerSyncQueueSummary=require(_0xdc2e('0x8'))(_0xdc2e('0xd'));var ami=require(_0xdc2e('0xe'));config[_0xdc2e('0xf')]=_['defaults'](config['redis'],{'host':_0xdc2e('0x10'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xdc2e('0x11'));var cmHopperBlack=require(_0xdc2e('0x12'));var voiceQueueRt=require(_0xdc2e('0x13'));var RpcSetting=require(_0xdc2e('0x14'));var Action=require(_0xdc2e('0x15'));var History=require(_0xdc2e('0x16'));var Final=require(_0xdc2e('0x17'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xdc2e('0x18'));var ipAgi=process[_0xdc2e('0x19')][_0xdc2e('0x1a')]||_0xdc2e('0x1b');var strategy={'rrmemory':_0xdc2e('0x1c'),'roundrobin':_0xdc2e('0x1d')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x31a4f9){this['tail']=this[_0xdc2e('0x1e')]?this[_0xdc2e('0x1e')][_0xdc2e('0x1f')](_0x31a4f9):_0x31a4f9();};function Dialer(_0x46d985,_0x4f512c){this[_0xdc2e('0x20')]=new Sequence();this[_0xdc2e('0x21')]=_0x4f512c;this[_0xdc2e('0x22')]=_0x46d985[_0xdc2e('0x22')];this['campaigns']=_0x46d985[_0xdc2e('0x23')];this[_0xdc2e('0x24')]=_0x46d985['agents'];this['trunks']=_0x46d985[_0xdc2e('0x25')];this[_0xdc2e('0x26')]=config[_0xdc2e('0x26')]||0x2;this[_0xdc2e('0x27')]={};this['actions']={};this['contactsId']={};this['uniqueId']={};this['optionPredictive']={};this[_0xdc2e('0x28')]={};this['startProgressive']={};this[_0xdc2e('0x29')]={};this[_0xdc2e('0x2a')]={};this[_0xdc2e('0x2b')]={};ami['on']('agentconnect',this[_0xdc2e('0x2c')][_0xdc2e('0x2d')](this));ami['on'](_0xdc2e('0x2e'),this[_0xdc2e('0x2f')][_0xdc2e('0x2d')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0xdc2e('0x2d')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0xdc2e('0x2d')](this));ami['on']('custom:queuesummary',this[_0xdc2e('0xd')]['bind'](this));ami['on'](_0xdc2e('0x30'),this[_0xdc2e('0x31')][_0xdc2e('0x2d')](this));ami['on'](_0xdc2e('0x32'),this[_0xdc2e('0x33')][_0xdc2e('0x2d')](this));ami['on'](_0xdc2e('0x34'),this[_0xdc2e('0x35')][_0xdc2e('0x2d')](this));ami['on']('queuemember',this[_0xdc2e('0x36')][_0xdc2e('0x2d')](this));ami['on']('queuestatuscomplete',this[_0xdc2e('0x37')]['bind'](this));this[_0xdc2e('0x38')]();this[_0xdc2e('0x39')]();RpcSetting[_0xdc2e('0x3a')]()[_0xdc2e('0x3b')](function(_0x551def){previewRecallmeReminderInterval=_0x551def[_0xdc2e('0x3c')];});}function isNotNull(_0x30435a){return _0x30435a!==null&&!_[_0xdc2e('0x3d')](_0x30435a);}function checkIsLoggedIn(_0x1ef0ea,_0x196c2f){return function(){if(_0x196c2f<=0x0){_0x1ef0ea[_0xdc2e('0x3e')]=_0xdc2e('0x3f');throw _0x1ef0ea['name']+_0xdc2e('0x40');}};}function isActive(_0x35a113){return _0x35a113;}function checkIsActive(_0x1448f4,_0x5711b1){return function(){if(!isActive(_0x5711b1)){_0x1448f4[_0xdc2e('0x3e')]=_0xdc2e('0x41');throw _0x1448f4['name']+_0xdc2e('0x42');}};}function checkInterval(_0x2f6ce8){return function(){if(!isNotNull(_0x2f6ce8[_0xdc2e('0x43')])){_0x2f6ce8[_0xdc2e('0x3e')]=_0xdc2e('0x44');throw _0x2f6ce8[_0xdc2e('0x45')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x2f6ce8['Interval'][_0xdc2e('0x46')])){_0x2f6ce8['message']=_0xdc2e('0x44');throw _0x2f6ce8[_0xdc2e('0x45')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xdc2e('0x47')](_0x2f6ce8['Interval']['Intervals']))){_0x2f6ce8[_0xdc2e('0x3e')]=_0xdc2e('0x44');throw _0x2f6ce8[_0xdc2e('0x45')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x4dff1a,_0x438bb7,_0x3cfcce){return{'action':_0x4dff1a,'response':_0x438bb7,'message':_0x3cfcce,'stack':_0x3cfcce};}function myreject(_0x5c2831){return function(_0x37294b){return _0x5c2831(msgResponse(_0xdc2e('0x48'),'Error',JSON['stringify'](_0x37294b)));};}function getSeconds(_0xe5c725,_0x85154e){var _0x549431=moment(_0xe5c725)[_0xdc2e('0x49')](0x0);var _0x134056=moment(_0x85154e)['milliseconds'](0x0);return _0x549431[_0xdc2e('0x4a')](_0x134056,_0xdc2e('0x4b'));}function emit(_0x5e435e,_0xf64e0f,_0x3410f6){io['to'](_0x5e435e)['emit'](_0xf64e0f,_0x3410f6);}function emitVoiceQueueSummary(_0x46b50d){if(_0x46b50d['type']===_0xdc2e('0x4c')){var _0x1f95cd={'id':_0x46b50d['id'],'name':_0x46b50d[_0xdc2e('0x45')],'strategy':_0x46b50d['strategy'],'answered':_0x46b50d[_0xdc2e('0x4d')],'available':_0x46b50d[_0xdc2e('0x4e')],'loggedIn':_0x46b50d[_0xdc2e('0x4f')],'pTalking':_0x46b50d['pTalking'],'sumBillable':_0x46b50d[_0xdc2e('0x50')],'sumDuration':_0x46b50d['sumDuration'],'sumHoldTime':_0x46b50d[_0xdc2e('0x51')]||0x0,'talking':_0x46b50d['talking'],'total':_0x46b50d[_0xdc2e('0x52')],'type':_0x46b50d[_0xdc2e('0x53')],'unmanaged':_0x46b50d[_0xdc2e('0x54')],'abandoned':_0x46b50d[_0xdc2e('0x55')],'waiting':_0x46b50d[_0xdc2e('0x56')],'loggedInDb':_0x46b50d[_0xdc2e('0x57')],'dialActive':_0x46b50d[_0xdc2e('0x58')],'dialMethod':_0x46b50d[_0xdc2e('0x59')],'dialOriginateCallerIdName':_0x46b50d['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x46b50d[_0xdc2e('0x5a')],'dialOriginateTimeout':_0x46b50d[_0xdc2e('0x5b')],'dialPrefix':_0x46b50d[_0xdc2e('0x5c')],'outboundAnswerAgiCallsDay':_0x46b50d['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x46b50d[_0xdc2e('0x5d')],'outboundBlacklistCallsDay':_0x46b50d[_0xdc2e('0x5e')],'outboundBusyCallsDay':_0x46b50d[_0xdc2e('0x5f')],'outboundCongestionCallsDay':_0x46b50d[_0xdc2e('0x60')],'outboundDropCallsDayACS':_0x46b50d['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x46b50d[_0xdc2e('0x61')],'outboundDropCallsDayTimeout':_0x46b50d[_0xdc2e('0x62')],'outboundNoAnswerCallsDay':_0x46b50d[_0xdc2e('0x63')],'outboundNoSuchCallsDay':_0x46b50d[_0xdc2e('0x64')],'outboundOriginateFailureCallsDay':_0x46b50d[_0xdc2e('0x65')],'outboundReCallsDay':_0x46b50d[_0xdc2e('0x66')],'outboundRejectCallsDay':_0x46b50d[_0xdc2e('0x67')],'outboundUnknownCallsDay':_0x46b50d[_0xdc2e('0x68')],'predictiveIntervalAnsweredCalls':_0x46b50d[_0xdc2e('0x69')],'predictiveIntervalAvgHoldtime':_0x46b50d[_0xdc2e('0x6a')],'predictiveIntervalAvgTalktime':_0x46b50d[_0xdc2e('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x46b50d['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x46b50d[_0xdc2e('0x6c')],'predictiveIntervalErlangCalls':_0x46b50d[_0xdc2e('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x46b50d[_0xdc2e('0x6e')],'predictiveIntervalHitRate':_0x46b50d[_0xdc2e('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x46b50d['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x46b50d[_0xdc2e('0x70')],'predictiveIntervalAvailable':_0x46b50d[_0xdc2e('0x71')],'predictiveIntervalTotalCalls':_0x46b50d[_0xdc2e('0x72')],'message':_0x46b50d[_0xdc2e('0x3e')],'originated':_0x46b50d[_0xdc2e('0x73')],'erlangCalls':_0x46b50d[_0xdc2e('0x74')],'erlangCallToSecond':_0x46b50d[_0xdc2e('0x75')],'erlangAbandonmentRate':_0x46b50d['erlangAbandonmentRate'],'erlangBusyFactor':_0x46b50d[_0xdc2e('0x76')],'startPredictive':_0x46b50d[_0xdc2e('0x28')],'startProgressive':_0x46b50d[_0xdc2e('0x77')]};if(_0x46b50d['Trunk']){_0x1f95cd['Trunk']={'id':_0x46b50d[_0xdc2e('0x78')]['id'],'name':_0x46b50d['Trunk']['name'],'active':_0x46b50d[_0xdc2e('0x78')][_0xdc2e('0x79')],'callerid':_0x46b50d[_0xdc2e('0x78')]['callerid']};}if(_0x46b50d[_0xdc2e('0x43')]){_0x1f95cd[_0xdc2e('0x43')]={'id':_0x46b50d[_0xdc2e('0x43')]['id'],'name':_0x46b50d[_0xdc2e('0x43')][_0xdc2e('0x45')]};}var _0x1e2492=md5(JSON[_0xdc2e('0x7a')](_0x1f95cd));if(_0x46b50d[_0xdc2e('0x7b')]!==_0x1e2492){_0x46b50d['md5']=_0x1e2492;emit(util['format'](_0xdc2e('0x7c'),_0x1f95cd[_0xdc2e('0x45')]),_0xdc2e('0x7d'),_0x1f95cd);}}}function emitCampaignSummary(_0x1f0165){if(_0x1f0165[_0xdc2e('0x53')]==='ivr'){emit(util[_0xdc2e('0x7e')](_0xdc2e('0x7f'),_0x1f0165[_0xdc2e('0x45')]),_0xdc2e('0x80'),_0x1f0165);}}function checkGetDataPredictive(_0x3517b0){if(isNotNull(_0x3517b0)&&!_[_0xdc2e('0x47')](_0x3517b0)){loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x82'));loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x83'),_0x3517b0['predictiveIntervalTotalCalls']);loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x84'),_0x3517b0[_0xdc2e('0x69')]);loggerPredictive['info'](_0xdc2e('0x85'),_0x3517b0[_0xdc2e('0x6c')]);loggerPredictive[_0xdc2e('0x81')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3517b0[_0xdc2e('0x86')]);loggerPredictive[_0xdc2e('0x81')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3517b0[_0xdc2e('0x6a')]);loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x87'),_0x3517b0[_0xdc2e('0x6b')]);loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x88'));if(_0x3517b0[_0xdc2e('0x72')]>0x0){if(!_[_0xdc2e('0x3d')](_0x3517b0[_0xdc2e('0x6b')])&&_0x3517b0['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x89'));if(!_[_0xdc2e('0x3d')](_0x3517b0[_0xdc2e('0x6a')])&&_0x3517b0[_0xdc2e('0x6a')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0xdc2e('0x8a'));}}else{loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x8b'));}return![];}function mergeDataErlangB(_0x8e2da4){return function(_0x530ab8){loggerPredictive[_0xdc2e('0x81')]('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0xdc2e('0x8c'),_0x530ab8['erlangCalls']);loggerPredictive[_0xdc2e('0x81')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x530ab8['erlangCallToSecond']);loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x8d'),_0x530ab8[_0xdc2e('0x8e')]);loggerPredictive['info'](_0xdc2e('0x8f'),_0x530ab8[_0xdc2e('0x76')]);loggerPredictive[_0xdc2e('0x81')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x530ab8[_0xdc2e('0x8e')]);loggerPredictive[_0xdc2e('0x81')]('---------------------------');_[_0xdc2e('0x90')](_0x8e2da4,_0x530ab8);};}function getDiff(_0x5bf61d){var _0x5518cf=moment()[_0xdc2e('0x49')](0x0);var _0x2575c3=moment(_0x5bf61d)['milliseconds'](0x0);return _0x5518cf[_0xdc2e('0x4a')](_0x2575c3,_0xdc2e('0x4b'));}function ifInterval(_0x1198ea,_0x451716){if(_[_0xdc2e('0x3d')](_0x451716)){return![];}return getDiff(_0x451716)<_0x1198ea*0x3c;}function freeVariablesPredictive(_0x3d17c1){if(isNotNull(_0x3d17c1)){if(!_['isUndefined'](_0x3d17c1[_0xdc2e('0x77')])){_0x3d17c1[_0xdc2e('0x77')]=undefined;loggerPredictive[_0xdc2e('0x81')](_0x3d17c1['name'],_0xdc2e('0x91'));}if(!_[_0xdc2e('0x3d')](_0x3d17c1[_0xdc2e('0x28')])){_0x3d17c1[_0xdc2e('0x28')]=undefined;loggerPredictive[_0xdc2e('0x81')](_0x3d17c1[_0xdc2e('0x45')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xdc2e('0x3d')](_0x3d17c1['handlePredictive'])){clearInterval(_0x3d17c1['handlePredictive']);_0x3d17c1[_0xdc2e('0x92')]=undefined;loggerPredictive[_0xdc2e('0x81')](_0x3d17c1['name'],_0xdc2e('0x93'));}}}function erlangb(_0x2a6fd9,_0x4d1afc){if(_0x4d1afc===0x0){return 0x0;}var _0x1719d2=0x1;for(var _0x4705c4=0x1;_0x4705c4<=_0x4d1afc;_0x4705c4+=0x1){_0x1719d2=0x1+_0x1719d2*_0x4705c4/_0x2a6fd9;}return 0x1/_0x1719d2;}function isVoiceQueueOutbound(_0x3aa75f){return _0x3aa75f===_0xdc2e('0x4c');}function isNotPreview(_0x4c6325){return _0x4c6325!==_0xdc2e('0x21');}function isCampaignIvr(_0x4e29d0){return _0x4e29d0===_0xdc2e('0x94');}function getCallerId(_0x158f57,_0x2f8059,_0x4e85f5){if(!_['isUndefined'](_0x4e85f5)&&typeof _0x4e85f5==='string'&&!_[_0xdc2e('0x47')](_0x4e85f5)){if(!_[_0xdc2e('0x3d')](_0x2f8059)&&typeof _0x2f8059==='string'&&!_['isEmpty'](_0x2f8059)){return util['format'](_0xdc2e('0x95'),_0x2f8059,_0x4e85f5);}return util[_0xdc2e('0x7e')]('\x22%s\x22\x20<%s>',_0x4e85f5,_0x4e85f5);}if(!_[_0xdc2e('0x3d')](_0x158f57)&&typeof _0x158f57===_0xdc2e('0x96')&&!_[_0xdc2e('0x47')](_0x158f57)){return _0x158f57;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x841a3,_0x1dc8a6){return function(_0x416198){freeVariablesPredictive(_0x1dc8a6);emitVoiceQueueSummary(_0x1dc8a6);emitCampaignSummary(_0x1dc8a6);loggerSyncQueueSummary[_0xdc2e('0x97')](_0x841a3,util[_0xdc2e('0x98')](_0x416198,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x431ff3,_0x4395b4){return function(_0x4b40b3){loggerPredictive[_0xdc2e('0x97')](_0x4395b4[_0xdc2e('0x45')],_0x431ff3);loggerPredictive[_0xdc2e('0x97')](_0x4b40b3[_0xdc2e('0x99')]);freeVariablesPredictive(_0x4395b4);};}function loggerCatch(_0x362148){return function(_0x8206ba){logger[_0xdc2e('0x97')](_0x362148,util[_0xdc2e('0x98')](_0x8206ba,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x39ec19){return _0x39ec19&&!_[_0xdc2e('0x3d')](_0x39ec19)&&_0x39ec19[_0xdc2e('0x9a')]>0x0;}function decremetOriginate(_0x32b7cc){if(!_[_0xdc2e('0x3d')](_0x32b7cc)&&_0x32b7cc!==null){if(typeof _0x32b7cc[_0xdc2e('0x73')]!==_0xdc2e('0x9b')){if(_0x32b7cc[_0xdc2e('0x73')]>0x0){_0x32b7cc[_0xdc2e('0x73')]-=0x1;}else{logger[_0xdc2e('0x97')](_0xdc2e('0x9c'));}}}else{logger[_0xdc2e('0x97')](_0xdc2e('0x9d'));}}function checkContactLowerLimitOriginate(_0x5b3d3b,_0x125759,_0x489276){if(_0x125759>_0x489276){for(var _0x54878d=0x0;_0x54878d<_0x125759-_0x489276;_0x54878d+=0x1){decremetOriginate(_0x5b3d3b);}}}function loggerGetContactDialer(_0x1d6b3b,_0x10b4b0,_0x251633){return function(_0xb9bc8b){checkContactLowerLimitOriginate(_0x10b4b0,_0x251633,0x0);logger[_0xdc2e('0x97')](_0x1d6b3b,util[_0xdc2e('0x98')](_0xb9bc8b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xa76f9e){return function(_0x438087){if(isNotNull(_0x438087)&&isNotNull(_0x438087[0x0])){if(_0x438087[0x0]['contactsRescheduled']>0x0){_0xa76f9e['message']='RESCHEDULED_CONTACTS';logger[_0xdc2e('0x81')](_0xdc2e('0x9e')+_0xa76f9e[_0xdc2e('0x45')],_0x438087[0x0][_0xdc2e('0x9f')],_0xdc2e('0xa0'));}else{_0xa76f9e[_0xdc2e('0x3e')]=_0xdc2e('0xa1');logger[_0xdc2e('0x81')]('[getContactDialer2][Empty]'+_0xa76f9e['name']);}}};}function notSendMessagesQueue(_0x2c065a){if(_0x2c065a[_0xdc2e('0xa2')]){freeVariablesPredictive(_0x2c065a);if(_0x2c065a[_0xdc2e('0x73')]===0x0&&_0x2c065a[_0xdc2e('0xa3')]===0x0&&_0x2c065a[_0xdc2e('0x56')]===0x0&&(_0x2c065a[_0xdc2e('0xa4')]||0x0)===0x0){_0x2c065a[_0xdc2e('0xa2')]=![];_0x2c065a[_0xdc2e('0x4e')]=0x0;_0x2c065a['message']=_0xdc2e('0x41');loggerSyncQueueSummary[_0xdc2e('0x97')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2c065a[_0xdc2e('0x45')],_0xdc2e('0xa5'));}else{_0x2c065a[_0xdc2e('0x3e')]=_0xdc2e('0xa6');loggerSyncQueueSummary['error'](_0xdc2e('0xa7'),_0x2c065a[_0xdc2e('0x45')],_0xdc2e('0xa8'));}emitVoiceQueueSummary(_0x2c065a);}}function notSendMessagesCampaign(_0x10727d){if(_0x10727d[_0xdc2e('0xa2')]){if(_0x10727d['originated']===0x0){_0x10727d[_0xdc2e('0xa2')]=![];_0x10727d['message']=_0xdc2e('0x41');loggerSyncQueueSummary[_0xdc2e('0x97')](_0xdc2e('0xa9'),_0x10727d[_0xdc2e('0x45')],_0xdc2e('0xa5'));}else{_0x10727d[_0xdc2e('0x3e')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xdc2e('0xa9'),_0x10727d['name'],'is\x20disactive');}emitCampaignSummary(_0x10727d);}}function createObjHistory(_0x2676df,_0xbb7c5d,_0x9b36de,_0x20965c,_0x38ea1e){_0x2676df[_0xdc2e('0x3e')]=_0x9b36de;var _0x1ba83b=new Action(_0x2676df,_0xbb7c5d);var _0xa3e7f1=new History(_0x1ba83b);_0xa3e7f1[_0xdc2e('0xaa')]=_0x20965c;_0xa3e7f1['statedesc']=_0x38ea1e;_0xa3e7f1[_0xdc2e('0xab')]=_0x1ba83b[_0xdc2e('0xac')];return _0xa3e7f1;}Dialer[_0xdc2e('0xad')][_0xdc2e('0x39')]=function(){var _0x52cca7=this;setInterval(function(){_0x52cca7['clearZombieChannels'](_0x52cca7[_0xdc2e('0xae')],_0xdc2e('0xaf'));_0x52cca7[_0xdc2e('0xb0')](_0x52cca7[_0xdc2e('0xb1')],_0xdc2e('0xb2'));},0x32c8);};Dialer[_0xdc2e('0xad')][_0xdc2e('0xb0')]=function(_0x5bf7e0,_0x227a87){var _0x2b07af=this;for(var _0x4a79e2 in _0x5bf7e0){if(typeof _0x5bf7e0[_0x4a79e2]!==_0xdc2e('0x9b')){this[_0xdc2e('0x20')][_0xdc2e('0xb3')](function(){if(!_['isNil'](_0x5bf7e0[_0x4a79e2])){return ami[_0xdc2e('0xb4')]({'action':'status','channel':_0x5bf7e0[_0x4a79e2][_0xdc2e('0xb5')]})[_0xdc2e('0xb6')](function(_0x23e4d2){if(_0x23e4d2[_0xdc2e('0x3e')]===_0xdc2e('0xb7')){setTimeout(function(){if(_0x5bf7e0[_0x4a79e2]&&_0x5bf7e0[_0x4a79e2][_0xdc2e('0x53')]!==_0xdc2e('0x94')){_0x2b07af[_0xdc2e('0xb8')](_0x2b07af[_0xdc2e('0x22')][_0x5bf7e0[_0x4a79e2][_0xdc2e('0xb9')]]);logger['error'](_0xdc2e('0xba'),_0x227a87,_0x4a79e2,_0x5bf7e0[_0x4a79e2][_0xdc2e('0xb9')]);delete _0x5bf7e0[_0x4a79e2];}if(_0x5bf7e0[_0x4a79e2]&&_0x5bf7e0[_0x4a79e2]['type']===_0xdc2e('0x94')){_0x2b07af[_0xdc2e('0xb8')](_0x2b07af[_0xdc2e('0x23')][_0x5bf7e0[_0x4a79e2][_0xdc2e('0xb9')]]);logger[_0xdc2e('0x97')]('[Dialer][checkChannel][ivr]',_0x227a87,_0x4a79e2,_0x5bf7e0[_0x4a79e2][_0xdc2e('0xb9')]);delete _0x5bf7e0[_0x4a79e2];}},0x2328);}});}});}}};Dialer[_0xdc2e('0xad')]['countReScheduled']=function(_0x2d7378){return BPromise[_0xdc2e('0xbb')]()[_0xdc2e('0x3b')](cmHopper[_0xdc2e('0xbc')](_0x2d7378))[_0xdc2e('0xb6')](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0xdc2e('0xbd')]=function(_0x219a89){return BPromise['resolve']()[_0xdc2e('0x3b')](cmHopperBlack[_0xdc2e('0xbd')](_0x219a89))['catch'](loggerCatch(_0xdc2e('0xbe')));};Dialer['prototype'][_0xdc2e('0xbf')]=function(_0x7938a5){return BPromise[_0xdc2e('0xbb')]()[_0xdc2e('0x3b')](cmHopperBlack['checkIsBlackListIvr'](_0x7938a5))[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0xc0')));};Dialer[_0xdc2e('0xad')][_0xdc2e('0xc1')]=function(_0x2d949a){return BPromise[_0xdc2e('0xbb')]()['then'](cmHopperHistory['avgHandleTime'](_0x2d949a))[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0xc2')));};Dialer[_0xdc2e('0xad')]['rescheduleContact']=function(_0x58252b){return BPromise[_0xdc2e('0xbb')]()[_0xdc2e('0x3b')](cmHopper[_0xdc2e('0xc3')](_0x58252b))['catch'](loggerCatch(_0xdc2e('0xc4')));};Dialer['prototype']['unlockContact']=function(_0x3b268f,_0x397110,_0x186b2e){return BPromise[_0xdc2e('0xbb')]()['then'](cmHopper[_0xdc2e('0xc5')](_0x3b268f,_0x397110,_0x186b2e))['catch'](loggerCatch(_0xdc2e('0xc6')));};Dialer[_0xdc2e('0xad')][_0xdc2e('0xc7')]=function(_0x2f979c,_0x33671c,_0x279186,_0x5e00bd,_0x2423c9){return BPromise[_0xdc2e('0xbb')]()[_0xdc2e('0x3b')](cmHopper[_0xdc2e('0xc7')](_0x2f979c,_0x33671c,_0x279186,_0x5e00bd))[_0xdc2e('0xb6')](function(_0x596d95){_0x2423c9[_0xdc2e('0xc8')]-=_0x279186;_0x2423c9['temp']=_0x2423c9[_0xdc2e('0xc8')]>0x0?_0x2423c9[_0xdc2e('0xc8')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x596d95);});};Dialer[_0xdc2e('0xad')][_0xdc2e('0xc9')]=function(_0x5a4bde,_0x329fd6,_0x4b5588,_0x4a243a){return BPromise[_0xdc2e('0xbb')]()[_0xdc2e('0x3b')](cmHopper[_0xdc2e('0xc9')](_0x5a4bde,_0x329fd6,_0x4b5588))[_0xdc2e('0xb6')](function(_0x26e1d1){_0x4a243a[_0xdc2e('0xc8')]-=_0x329fd6;_0x4a243a['temp']=_0x4a243a[_0xdc2e('0xc8')]>0x0?_0x4a243a['temp']:0x0;loggerCatch(_0xdc2e('0xca'))(_0x26e1d1);});};Dialer['prototype'][_0xdc2e('0xcb')]=function(_0xb3d63b){return BPromise[_0xdc2e('0xbb')]()[_0xdc2e('0x3b')](voiceQueueRt[_0xdc2e('0xcb')](_0xb3d63b))[_0xdc2e('0xb6')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xdc2e('0xad')]['moveContactManagedDialer']=function(_0x12bcf9){return BPromise[_0xdc2e('0xbb')]()['then'](cmHopper[_0xdc2e('0xcc')](_0x12bcf9))[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0xcd')));};Dialer[_0xdc2e('0xad')][_0xdc2e('0xce')]=function(_0x5d69f4){return BPromise['resolve']()[_0xdc2e('0x3b')](cmHopperHistory[_0xdc2e('0xce')](_0x5d69f4))[_0xdc2e('0xb6')](loggerCatch('[createHistory]\x20'));};Dialer['prototype']['updateOriginated']=function(_0x2a01ba){if(!_[_0xdc2e('0x3d')](_0x2a01ba)&&_0x2a01ba!==null){if(typeof _0x2a01ba['originated']!==_0xdc2e('0x9b')){if(_0x2a01ba[_0xdc2e('0x73')]>0x0){_0x2a01ba[_0xdc2e('0x73')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xdc2e('0xad')]['loggerHandler']=function(_0x21bf80,_0x5ce064){var _0x20e3cc=this;return function(_0x2cf5a2){_0x20e3cc['updateOriginated'](_0x5ce064);logger['error'](_0x21bf80,util[_0xdc2e('0x98')](_0x2cf5a2,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xdc2e('0xcf')]=function(_0x4cc9ca,_0x3c4e2e,_0x2c966f){var _0x5db0b8={'state':0x19,'statedesc':_0xdc2e('0xd0')};this[_0xdc2e('0xb8')](_0x3c4e2e);this[_0xdc2e('0xd1')](_[_0xdc2e('0x90')](_0x5db0b8,_[_0xdc2e('0xd2')](_0x2c966f,[_0xdc2e('0xd3'),_0xdc2e('0xd4'),'UserId',_0xdc2e('0xd5'),_0xdc2e('0xd6')])),_0xdc2e('0xd7'),_0xdc2e('0xd8'));logger[_0xdc2e('0x97')](_0x4cc9ca);};Dialer[_0xdc2e('0xad')][_0xdc2e('0xd9')]=function(_0xc66381){return _0xc66381===_0xdc2e('0xda');};Dialer[_0xdc2e('0xad')][_0xdc2e('0xdb')]=function(_0x417118){return!_[_0xdc2e('0x3d')](_0x417118)&&_0x417118&&!_[_0xdc2e('0x3d')](_0x417118[_0xdc2e('0x45')])&&!_[_0xdc2e('0x3d')](_0x417118[_0xdc2e('0x79')])&&_0x417118[_0xdc2e('0x79')]&&(this[_0xdc2e('0x25')][util[_0xdc2e('0x7e')](_0xdc2e('0xdc'),_0x417118['name'])]['status']===_0xdc2e('0xdd')||this['trunks'][util[_0xdc2e('0x7e')](_0xdc2e('0xdc'),_0x417118[_0xdc2e('0x45')])]['status']==='unmonitored');};Dialer['prototype'][_0xdc2e('0xd1')]=function(_0x2390f5,_0x3c117b,_0x3c7a2e){this[_0xdc2e('0xce')](_0x2390f5)['catch'](loggerCatch(_0x3c117b));this[_0xdc2e('0xcc')](_0x2390f5)[_0xdc2e('0xb6')](loggerCatch(_0x3c7a2e));};Dialer['prototype'][_0xdc2e('0x35')]=function(_0x519e9a){var _0x37b3d5=this['uniqueId'][_0x519e9a[_0xdc2e('0xde')]];var _0x2e85ac;if(!_['isNil'](_0x519e9a)&&!_[_0xdc2e('0xdf')](_0x519e9a[_0xdc2e('0xe0')])&&!_['isNil'](_0x519e9a['variable'][_0xdc2e('0xe1')])&&_0x519e9a[_0xdc2e('0xe2')]===_0xdc2e('0xe3')&&_0x37b3d5){if(_0x37b3d5[_0xdc2e('0x53')]!==_0xdc2e('0x94')&&this['voiceQueues'][_0x37b3d5[_0xdc2e('0xb9')]][_0xdc2e('0xe4')]&&_0x519e9a[_0xdc2e('0xe5')]==='HANGUP'){delete this[_0xdc2e('0xae')][_0x519e9a[_0xdc2e('0xde')]];this['updateOriginated'](this[_0xdc2e('0x22')][_0x37b3d5[_0xdc2e('0xb9')]]);this['voiceQueues'][_0x37b3d5['queue']][_0xdc2e('0x5d')]+=0x1;this[_0xdc2e('0x22')][_0x37b3d5[_0xdc2e('0xb9')]][_0xdc2e('0xe6')]+=0x1;_0x2e85ac=new Hangup(_0x37b3d5,_0x519e9a);_0x2e85ac[_0xdc2e('0xaa')]=0x12;_0x2e85ac[_0xdc2e('0xe7')]=_0xdc2e('0xe8');_0x2e85ac[_0xdc2e('0xe9')]=_0xdc2e('0xea');ami[_0xdc2e('0xeb')]('custom:amd',ut['buildObj'](_0x2e85ac,_0xdc2e('0xec')));this[_0xdc2e('0xd1')](_0x2e85ac,'[syncHangupInAMD][createHistory]',_0xdc2e('0xed'));}if(_0x37b3d5['type']!==_0xdc2e('0x94')&&this['voiceQueues'][_0x37b3d5[_0xdc2e('0xb9')]][_0xdc2e('0xe4')]&&_0x519e9a[_0xdc2e('0xe5')]===_0xdc2e('0xee')){var _0x29762e=this;return new BPromise(function(_0x5a8393,_0x2f20a9){delete _0x29762e[_0xdc2e('0xae')][_0x519e9a[_0xdc2e('0xde')]];_0x29762e[_0xdc2e('0xb8')](_0x29762e[_0xdc2e('0x22')][_0x37b3d5[_0xdc2e('0xb9')]]);_0x29762e[_0xdc2e('0x22')][_0x37b3d5[_0xdc2e('0xb9')]][_0xdc2e('0x5d')]+=0x1;_0x29762e[_0xdc2e('0x22')][_0x37b3d5[_0xdc2e('0xb9')]][_0xdc2e('0xe6')]+=0x1;var _0x29f9e2=_0x29762e[_0xdc2e('0x22')][_0x37b3d5['queue']];var _0x39a97c=new Hangup(_0x37b3d5,_0x519e9a);_0x39a97c[_0xdc2e('0xaa')]=0x13;_0x39a97c[_0xdc2e('0xe7')]=_0xdc2e('0xef');_0x39a97c[_0xdc2e('0xe9')]='AMD';_0x39a97c[_0xdc2e('0xf0')]+=0x1;_0x39a97c['countglobal']+=0x1;_0x39a97c[_0xdc2e('0xec')]=!![];ami[_0xdc2e('0xeb')](_0xdc2e('0xf1'),ut[_0xdc2e('0xf2')](_0x39a97c,_0xdc2e('0xec')));_0x29762e['createHistory'](_0x39a97c)[_0xdc2e('0xb6')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x39a97c['countbusyretry']+_0x39a97c[_0xdc2e('0xf3')]+_0x39a97c[_0xdc2e('0xf4')]+_0x39a97c[_0xdc2e('0xf5')]+_0x39a97c[_0xdc2e('0xf6')]+_0x39a97c[_0xdc2e('0xf7')]+_0x39a97c[_0xdc2e('0xf0')]+_0x39a97c[_0xdc2e('0xf8')]>=_0x29f9e2[_0xdc2e('0xf9')]){_0x29762e[_0xdc2e('0xfa')](_0x39a97c,_0x5a8393,_0x2f20a9,_0xdc2e('0xfb'));}else{if(_0x39a97c[_0xdc2e('0xf0')]>=_0x29f9e2['dialMachineMaxRetry']){_0x29762e[_0xdc2e('0xfc')](_0x39a97c,_0x5a8393,_0x2f20a9,_0xdc2e('0xfd'));}else{_0x29762e[_0xdc2e('0xc3')]({'active':![],'countmachineretry':_0x39a97c[_0xdc2e('0xf0')],'scheduledat':moment()[_0xdc2e('0xfe')](_0x29f9e2[_0xdc2e('0xff')],_0xdc2e('0x100'))[_0xdc2e('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x39a97c[_0xdc2e('0xd3')],'ListId':_0x39a97c[_0xdc2e('0xd4')],'VoiceQueueId':_0x39a97c[_0xdc2e('0xd5')]||undefined,'CampaignId':_0x39a97c[_0xdc2e('0xd6')]||undefined})[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x101')));_0x5a8393({'reschedule':0x1});}}});}if(_0x37b3d5[_0xdc2e('0x53')]===_0xdc2e('0x94')&&this[_0xdc2e('0x23')][_0x37b3d5[_0xdc2e('0xb9')]]['dialAMDActive']&&_0x519e9a[_0xdc2e('0xe5')]===_0xdc2e('0x102')){delete this[_0xdc2e('0xae')][_0x519e9a[_0xdc2e('0xde')]];this[_0xdc2e('0xb8')](this['campaigns'][_0x37b3d5['queue']]);_0x2e85ac=new Hangup(_0x37b3d5,_0x519e9a);_0x2e85ac[_0xdc2e('0xaa')]=0x12;_0x2e85ac[_0xdc2e('0xe7')]=_0xdc2e('0xe8');_0x2e85ac[_0xdc2e('0xe9')]=_0xdc2e('0xea');ami[_0xdc2e('0xeb')](_0xdc2e('0xf1'),ut[_0xdc2e('0xf2')](_0x2e85ac,'amd'));this['saveInDb'](_0x2e85ac,_0xdc2e('0x103'),_0xdc2e('0x104'));}if(_0x37b3d5[_0xdc2e('0x53')]===_0xdc2e('0x94')&&this[_0xdc2e('0x23')][_0x37b3d5[_0xdc2e('0xb9')]]['dialAMDActive']&&_0x519e9a['value']===_0xdc2e('0xee')){var _0x29762e=this;return new BPromise(function(_0x2315bf,_0x51c537){delete _0x29762e[_0xdc2e('0xae')][_0x519e9a[_0xdc2e('0xde')]];_0x29762e[_0xdc2e('0xb8')](_0x29762e[_0xdc2e('0x23')][_0x37b3d5[_0xdc2e('0xb9')]]);_0x29762e[_0xdc2e('0x23')][_0x37b3d5['queue']][_0xdc2e('0x5d')]+=0x1;_0x29762e['campaigns'][_0x37b3d5[_0xdc2e('0xb9')]][_0xdc2e('0xe6')]+=0x1;var _0x2d906f=_0x29762e[_0xdc2e('0x23')][_0x37b3d5['queue']];var _0x294203=new Hangup(_0x37b3d5,_0x519e9a);_0x294203[_0xdc2e('0xaa')]=0x13;_0x294203[_0xdc2e('0xe7')]='Machine';_0x294203[_0xdc2e('0xe9')]=_0xdc2e('0xea');_0x294203['countmachineretry']+=0x1;_0x294203[_0xdc2e('0x105')]+=0x1;_0x294203[_0xdc2e('0xec')]=!![];ami[_0xdc2e('0xeb')](_0xdc2e('0xf1'),ut[_0xdc2e('0xf2')](_0x294203,'amd'));_0x29762e[_0xdc2e('0xce')](_0x294203)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x106')));if(_0x294203['countbusyretry']+_0x294203[_0xdc2e('0xf3')]+_0x294203[_0xdc2e('0xf4')]+_0x294203[_0xdc2e('0xf5')]+_0x294203['countdropretry']+_0x294203[_0xdc2e('0xf7')]+_0x294203[_0xdc2e('0xf0')]+_0x294203[_0xdc2e('0xf8')]>=_0x2d906f[_0xdc2e('0xf9')]){_0x29762e[_0xdc2e('0xfa')](_0x294203,_0x2315bf,_0x51c537,'reason19\x20machine....');}else{if(_0x294203[_0xdc2e('0xf0')]>=_0x2d906f[_0xdc2e('0x107')]){_0x29762e[_0xdc2e('0xfc')](_0x294203,_0x2315bf,_0x51c537,_0xdc2e('0xfd'));}else{_0x29762e['rescheduleContact']({'active':![],'countmachineretry':_0x294203[_0xdc2e('0xf0')],'scheduledat':moment()[_0xdc2e('0xfe')](_0x2d906f[_0xdc2e('0xff')],'minutes')[_0xdc2e('0x7e')](_0xdc2e('0x108')),'ContactId':_0x294203[_0xdc2e('0xd3')],'ListId':_0x294203[_0xdc2e('0xd4')],'VoiceQueueId':_0x294203[_0xdc2e('0xd5')]||undefined,'CampaignId':_0x294203['CampaignId']||undefined})['catch'](loggerCatch(_0xdc2e('0x101')));_0x2315bf({'reschedule':0x1});}}});}}};Dialer[_0xdc2e('0xad')]['syncHangup']=function(_0x19d6a2){var _0x3242fa=this[_0xdc2e('0xae')][_0x19d6a2['uniqueid']];var _0x13de98=this;var _0xfbe528;if(_0x3242fa&&_0x3242fa[_0xdc2e('0x53')]==='ivr'){delete this[_0xdc2e('0xae')][_0x19d6a2[_0xdc2e('0xde')]];this['updateOriginated'](this['campaigns'][_0x3242fa[_0xdc2e('0xb9')]]);this['campaigns'][_0x3242fa['queue']]['ivrAnswerCallsDay']+=0x1;_0xfbe528=new Hangup(_0x3242fa,_0x19d6a2);this[_0xdc2e('0xce')](_0xfbe528)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xdc2e('0xcc')](_0xfbe528)[_0xdc2e('0xb6')](loggerCatch('[syncHangupIvr]'));}if(_0x3242fa&&_0x3242fa[_0xdc2e('0x53')]!==_0xdc2e('0x94')&&isNotNull(this[_0xdc2e('0x22')][_0x3242fa[_0xdc2e('0xb9')]][_0xdc2e('0x109')])){delete this[_0xdc2e('0xae')][_0x19d6a2[_0xdc2e('0xde')]];this['updateOriginated'](this[_0xdc2e('0x22')][_0x3242fa[_0xdc2e('0xb9')]]);this[_0xdc2e('0x22')][_0x3242fa[_0xdc2e('0xb9')]][_0xdc2e('0x5d')]+=0x1;this[_0xdc2e('0x22')][_0x3242fa[_0xdc2e('0xb9')]][_0xdc2e('0xe6')]+=0x1;_0xfbe528=new Hangup(_0x3242fa,_0x19d6a2);_0xfbe528['state']=0x10;_0xfbe528[_0xdc2e('0xe7')]=_0xdc2e('0x10a');_0xfbe528[_0xdc2e('0xe9')]='AGI';this[_0xdc2e('0xce')](_0xfbe528)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x10b')));this[_0xdc2e('0xcc')](_0xfbe528)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x10c')));}if(_0x3242fa&&_0x3242fa['type']!=='ivr'&&!isNotNull(this[_0xdc2e('0x22')][_0x3242fa[_0xdc2e('0xb9')]]['dialQueueProject'])){delete this[_0xdc2e('0xae')][_0x19d6a2['uniqueid']];this['updateOriginated'](this[_0xdc2e('0x22')][_0x3242fa['queue']]);this[_0xdc2e('0x22')][_0x3242fa[_0xdc2e('0xb9')]][_0xdc2e('0x68')]+=0x1;_0xfbe528=new Hangup(_0x3242fa,_0x19d6a2);_0xfbe528['state']=0xc;_0xfbe528[_0xdc2e('0xe7')]=_0x19d6a2[_0xdc2e('0x10d')];_0xfbe528['membername']='Unknow';this[_0xdc2e('0xce')](_0xfbe528)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x10b')));this[_0xdc2e('0xcc')](_0xfbe528)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x10c')));}};Dialer[_0xdc2e('0xad')][_0xdc2e('0x10e')]=function(_0x41dbfb){var _0x4d06fd=this[_0xdc2e('0xae')][_0x41dbfb[_0xdc2e('0xde')]];var _0x3148c3=this;if(this['voiceQueues'][_0x41dbfb[_0xdc2e('0xb9')]]){if(_0x4d06fd&&_0x4d06fd[_0xdc2e('0x53')]!==_0xdc2e('0x94')){delete this[_0xdc2e('0xae')][_0x41dbfb[_0xdc2e('0xde')]];this[_0xdc2e('0x22')][_0x41dbfb['queue']]['outboundAnswerCallsDay']+=0x1;var _0x122727=new AgentComplete(_0x4d06fd,_0x41dbfb);if(_0x41dbfb['reason']===_0xdc2e('0x10f')){_0x122727[_0xdc2e('0x110')]=this[_0xdc2e('0x22')][_0x41dbfb[_0xdc2e('0xb9')]][_0xdc2e('0x111')]&&this[_0xdc2e('0x22')][_0x41dbfb[_0xdc2e('0xb9')]][_0xdc2e('0x112')]?moment()[_0xdc2e('0x7e')](_0xdc2e('0x108')):undefined;}this[_0xdc2e('0xce')](_0x122727)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x113')));this[_0xdc2e('0xcc')](_0x122727)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x114')));}}};Dialer[_0xdc2e('0xad')][_0xdc2e('0x2c')]=function(_0x165421){if(this[_0xdc2e('0x22')][_0x165421[_0xdc2e('0xb9')]]){if(this[_0xdc2e('0xae')][_0x165421[_0xdc2e('0xde')]]&&this[_0xdc2e('0xae')][_0x165421['uniqueid']][_0xdc2e('0x53')]!==_0xdc2e('0x94')){this['updateOriginated'](this[_0xdc2e('0x22')][_0x165421[_0xdc2e('0xb9')]]);this[_0xdc2e('0xae')][_0x165421[_0xdc2e('0xde')]][_0xdc2e('0x115')]=moment()[_0xdc2e('0x7e')](_0xdc2e('0x108'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x3bd5eb){this['createHistory'](_0x3bd5eb)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x113')));this['moveContactManagedDialer'](_0x3bd5eb)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x116')));};Dialer[_0xdc2e('0xad')][_0xdc2e('0x2f')]=function(_0x98178){var _0x5d7683=this[_0xdc2e('0xae')][_0x98178[_0xdc2e('0xde')]];var _0x3486d8=this;if(this[_0xdc2e('0x22')][_0x98178[_0xdc2e('0xb9')]]){if(_0x5d7683&&_0x5d7683[_0xdc2e('0x53')]!==_0xdc2e('0x94')){delete this[_0xdc2e('0xae')][_0x98178[_0xdc2e('0xde')]];this['updateOriginated'](this[_0xdc2e('0x22')][_0x98178[_0xdc2e('0xb9')]]);_0x5d7683['droptime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x360c15=new QueueCallerAbandon(_0x5d7683,_0x98178);if(getSeconds(_0x5d7683[_0xdc2e('0x117')],_0x5d7683[_0xdc2e('0x118')])>=_0x5d7683[_0xdc2e('0x119')]){this['voiceQueues'][_0x98178['queue']][_0xdc2e('0x6c')]+=0x1;this[_0xdc2e('0x22')][_0x98178[_0xdc2e('0xb9')]][_0xdc2e('0x62')]+=0x1;this[_0xdc2e('0x22')][_0x98178[_0xdc2e('0xb9')]][_0xdc2e('0x6e')]+=0x1;_0x360c15[_0xdc2e('0xaa')]=0xa;_0x360c15['statedesc']=_0xdc2e('0x11a');_0x360c15[_0xdc2e('0x11b')]=_0xdc2e('0x11c');_0x360c15['agiafterat']=this[_0xdc2e('0x22')][_0x98178['queue']][_0xdc2e('0x111')]?moment()[_0xdc2e('0x7e')](_0xdc2e('0x108')):undefined;_0x360c15[_0xdc2e('0xf6')]+=0x1;_0x360c15['countglobal']+=0x1;if(_0x360c15[_0xdc2e('0xf6')]>=this[_0xdc2e('0x22')][_0x98178[_0xdc2e('0xb9')]][_0xdc2e('0x11d')]){this[_0xdc2e('0x11e')](_0x360c15);}else{this[_0xdc2e('0xc3')]({'active':![],'countdropretry':_0x360c15[_0xdc2e('0xf6')],'scheduledat':moment()['add'](this[_0xdc2e('0x22')][_0x98178[_0xdc2e('0xb9')]][_0xdc2e('0x11f')],_0xdc2e('0x100'))[_0xdc2e('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5d7683['ContactId'],'ListId':_0x5d7683[_0xdc2e('0xd4')],'VoiceQueueId':_0x5d7683[_0xdc2e('0xd5')]||undefined,'CampaignId':_0x5d7683[_0xdc2e('0xd6')]||undefined})['catch'](loggerCatch(_0xdc2e('0x120')));var _0x412cfb=new History(_0x360c15);_0x412cfb['state']=0xa;_0x412cfb[_0xdc2e('0xe7')]='Drop';_0x412cfb[_0xdc2e('0xac')]=moment()[_0xdc2e('0x7e')](_0xdc2e('0x108'));_0x412cfb[_0xdc2e('0xab')]=_0x412cfb[_0xdc2e('0xac')];_0x412cfb['calleridname']=_0x360c15[_0xdc2e('0x121')];_0x412cfb[_0xdc2e('0x122')]=_0x360c15['calleridnum'];this[_0xdc2e('0xce')](_0x412cfb)[_0xdc2e('0xb6')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this['voiceQueues'][_0x98178[_0xdc2e('0xb9')]][_0xdc2e('0x86')]+=0x1;this[_0xdc2e('0x22')][_0x98178[_0xdc2e('0xb9')]][_0xdc2e('0x61')]+=0x1;_0x360c15[_0xdc2e('0xaa')]=0xb;_0x360c15[_0xdc2e('0xe7')]=_0xdc2e('0x123');_0x360c15[_0xdc2e('0x11b')]=_0xdc2e('0x124');_0x360c15[_0xdc2e('0xf7')]+=0x1;_0x360c15[_0xdc2e('0x105')]+=0x1;if(_0x360c15[_0xdc2e('0xf7')]>=this[_0xdc2e('0x22')][_0x98178['queue']][_0xdc2e('0x125')]){this['queueCallerAbandonCreateState'](_0x360c15);}else{this[_0xdc2e('0xc3')]({'active':![],'countabandonedretry':_0x360c15['countabandonedretry'],'scheduledat':moment()[_0xdc2e('0xfe')](this[_0xdc2e('0x22')][_0x98178[_0xdc2e('0xb9')]][_0xdc2e('0x126')],_0xdc2e('0x100'))[_0xdc2e('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5d7683[_0xdc2e('0xd3')],'ListId':_0x5d7683['ListId'],'VoiceQueueId':_0x5d7683[_0xdc2e('0xd5')]||undefined,'CampaignId':_0x5d7683['CampaignId']||undefined})[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x127')));var _0x412cfb=new History(_0x360c15);_0x412cfb[_0xdc2e('0xaa')]=0xb;_0x412cfb[_0xdc2e('0xe7')]=_0xdc2e('0x123');_0x412cfb[_0xdc2e('0xac')]=moment()['format'](_0xdc2e('0x108'));_0x412cfb['endtime']=_0x412cfb[_0xdc2e('0xac')];_0x412cfb['calleridname']=_0x360c15['calleridname'];_0x412cfb[_0xdc2e('0x122')]=_0x360c15[_0xdc2e('0x122')];this['createHistory'](_0x412cfb)['catch'](loggerCatch(_0xdc2e('0x128')));}}}}};Dialer[_0xdc2e('0xad')][_0xdc2e('0x33')]=function(_0x23f5c2){if(this[_0xdc2e('0xb1')][_0x23f5c2[_0xdc2e('0xde')]]){this[_0xdc2e('0xb1')][_0x23f5c2['uniqueid']]['channel']=_0x23f5c2['channel'];}if(this[_0xdc2e('0xae')][_0x23f5c2['uniqueid']]){this['uniqueId'][_0x23f5c2['uniqueid']][_0xdc2e('0xb5')]=_0x23f5c2[_0xdc2e('0xb5')];}};Dialer[_0xdc2e('0xad')][_0xdc2e('0x36')]=function(_0x46aac6){if(strategy[this[_0xdc2e('0x22')][this[_0xdc2e('0xb1')][_0x46aac6[_0xdc2e('0x129')]][_0xdc2e('0xb9')]][_0xdc2e('0x12a')]]===_0xdc2e('0x1d')){if(this[_0xdc2e('0xb1')][_0x46aac6[_0xdc2e('0x129')]]&&_['isNil'](this[_0xdc2e('0xb1')][_0x46aac6[_0xdc2e('0x129')]][_0xdc2e('0x12b')])&&_0x46aac6[_0xdc2e('0x12c')]==='1'&&_0x46aac6[_0xdc2e('0x12d')]==='0'){if(this[_0xdc2e('0x24')][_0x46aac6[_0xdc2e('0x12e')]]){if(!this[_0xdc2e('0x24')][_0x46aac6['stateinterface']][_0xdc2e('0x12b')]){this['agents'][_0x46aac6['stateinterface']]['locked']=!![];this['actions'][_0x46aac6['actionid']][_0xdc2e('0x12b')]=!![];this[_0xdc2e('0xb1')][_0x46aac6['actionid']][_0xdc2e('0x12e')]=_0x46aac6[_0xdc2e('0x12e')];}}}}else if((strategy[this['voiceQueues'][this[_0xdc2e('0xb1')][_0x46aac6['actionid']][_0xdc2e('0xb9')]][_0xdc2e('0x12a')]]||_0xdc2e('0x1c'))===_0xdc2e('0x1c')){if(this[_0xdc2e('0xb1')][_0x46aac6['actionid']]){if(this['agents'][_0x46aac6[_0xdc2e('0x12e')]]){this[_0xdc2e('0xb1')][_0x46aac6['actionid']][_0xdc2e('0x12e')]=_0x46aac6[_0xdc2e('0x12e')];if(_[_0xdc2e('0xdf')](this['queueBooked'][this[_0xdc2e('0xb1')][_0x46aac6[_0xdc2e('0x129')]]['queue']])){this[_0xdc2e('0x2a')][this[_0xdc2e('0xb1')][_0x46aac6[_0xdc2e('0x129')]][_0xdc2e('0xb9')]]=[];}this[_0xdc2e('0x2a')][this[_0xdc2e('0xb1')][_0x46aac6[_0xdc2e('0x129')]][_0xdc2e('0xb9')]][_0xdc2e('0x12f')](_[_0xdc2e('0x90')](_[_0xdc2e('0xd2')](this[_0xdc2e('0xb1')][_0x46aac6[_0xdc2e('0x129')]],[_0xdc2e('0x130'),'stateinterface']),{'status':_0x46aac6[_0xdc2e('0x12c')],'paused':_0x46aac6[_0xdc2e('0x12d')]}));}}}};function unlockQueueStatus(_0x25e29b,_0x1184e1){setTimeout(function(){if(_[_0xdc2e('0x3d')](_0x25e29b[_0xdc2e('0x131')])){loggerBooked['error'](_0xdc2e('0x132'),_0x1184e1);}_0x25e29b[_0xdc2e('0x131')]=!![];loggerBooked[_0xdc2e('0x81')](_0xdc2e('0x133'),_0x1184e1,JSON['stringify'](_[_0xdc2e('0xd2')](_0x25e29b,[_0xdc2e('0x45'),_0xdc2e('0x131')])));},0x1f3);}Dialer['prototype'][_0xdc2e('0x37')]=function(_0x184211){var _0x1623a0=this;var _0x10ac88=_0x1623a0['voiceQueues'][_0x1623a0['actions'][_0x184211[_0xdc2e('0x129')]][_0xdc2e('0xb9')]];if(strategy[this[_0xdc2e('0x22')][this[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]][_0xdc2e('0xb9')]][_0xdc2e('0x12a')]]===_0xdc2e('0x1d')){if(this[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]]&&this[_0xdc2e('0xb1')][_0x184211['actionid']][_0xdc2e('0x12e')]){this[_0xdc2e('0x21')][_0xdc2e('0x134')](this[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]][_0xdc2e('0x130')],this['actions'][_0x184211['actionid']][_0xdc2e('0x12e')])[_0xdc2e('0xb6')](function(_0x1de86a){logger[_0xdc2e('0x97')](_0xdc2e('0x135'),util[_0xdc2e('0x98')](_0x1de86a,{'showHidden':![],'depth':null}));})['finally'](function(){_0x1623a0[_0xdc2e('0xb8')](_0x1623a0[_0xdc2e('0x22')][_0x1623a0[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]][_0xdc2e('0xb9')]]);_0x1623a0['agents'][_0x1623a0[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]][_0xdc2e('0x12e')]][_0xdc2e('0x12b')]=![];delete _0x1623a0[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]];unlockQueueStatus(_0x10ac88);});}else{this['updateOriginated'](this[_0xdc2e('0x22')][this[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]][_0xdc2e('0xd3')],'ListId':this[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]][_0xdc2e('0xd4')],'VoiceQueueId':this['actions'][_0x184211[_0xdc2e('0x129')]][_0xdc2e('0xd5')]||undefined,'CampaignId':this['actions'][_0x184211['actionid']]['CampaignId']||undefined})['catch'](loggerCatch(_0xdc2e('0x136')));delete this[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]];unlockQueueStatus(_0x10ac88);}}else if((strategy[this[_0xdc2e('0x22')][this[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]][_0xdc2e('0xb9')]][_0xdc2e('0x12a')]]||'rrmemory')===_0xdc2e('0x1c')){var _0x3ae1aa;if(this['actions'][_0x184211[_0xdc2e('0x129')]]&&!_['isEmpty'](this[_0xdc2e('0x2a')][this['actions'][_0x184211[_0xdc2e('0x129')]][_0xdc2e('0xb9')]])){if(this['queueBookedRR'][_0x1623a0[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]][_0xdc2e('0xb9')]]){this[_0xdc2e('0x2b')][_0x1623a0[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]]['queue']]=this['queueBookedRR'][this[_0xdc2e('0xb1')][_0x184211['actionid']]['queue']]?this['queueBookedRR'][this[_0xdc2e('0xb1')][_0x184211['actionid']][_0xdc2e('0xb9')]]:this[_0xdc2e('0x2a')][this['actions'][_0x184211['actionid']][_0xdc2e('0xb9')]]?this[_0xdc2e('0x2a')][this[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]]['queue']][_0xdc2e('0x137')]||0x0:0x0;}this[_0xdc2e('0x2a')][this[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]][_0xdc2e('0xb9')]]['_rr']=this[_0xdc2e('0x2b')][this[_0xdc2e('0xb1')][_0x184211[_0xdc2e('0x129')]][_0xdc2e('0xb9')]];for(var _0x58f618=0x0;_0x58f618=0x0;})[_0xdc2e('0xb6')](myreject(_0x5e0aed)));}}else{_0x3a93d1[_0xdc2e('0x12f')](ami[_0xdc2e('0xb4')]({'action':_0xdc2e('0x150'),'command':util['format'](_0xdc2e('0x151'),_0x245962,!_[_0xdc2e('0x3d')](config['timezones'][_0x5078be])?_0x5078be:'')})[_0xdc2e('0x3b')](function(_0x53829c){return _0x53829c[_0xdc2e('0x153')][_0xdc2e('0x154')](_0xdc2e('0x155'))>=0x0;})['catch'](myreject(_0x5e0aed)));}BPromise[_0xdc2e('0x156')](_0x3a93d1)[_0xdc2e('0x3b')](function(_0x55354a){var _0x19af63=_[_0xdc2e('0x157')](_0x55354a);if(_0x19af63){return _0x1c2dec(_0x19af63);}else{_0x373625[_0xdc2e('0x3e')]=_0x536796?'GLOBAL_INTERVAL_IS_OVERTIME':_0xdc2e('0x158');return _0x5e0aed(msgResponse(_0xdc2e('0x159'),_0xdc2e('0x14a'),'Global:\x20'+_0x536796+'\x20'+_0x7d48cd+_0xdc2e('0x15a')+util[_0xdc2e('0x98')](_0x245962,{'showHidden':![],'depth':null})+_0xdc2e('0x15b')+_0x5078be));}})[_0xdc2e('0xb6')](function(_0x4611f3){return _0x5e0aed(msgResponse(_0xdc2e('0x148'),_0xdc2e('0x14a'),JSON[_0xdc2e('0x7a')](_0x4611f3)));});});};Dialer[_0xdc2e('0xad')][_0xdc2e('0x15c')]=function(_0x34ee90){var _0x1e0cc9=this;return function(){switch(_0x34ee90[_0xdc2e('0x59')]){case _0xdc2e('0x15d'):freeVariablesPredictive(_0x34ee90);_0x1e0cc9['handlePower'](_0x34ee90,0x1);break;case _0xdc2e('0x15e'):freeVariablesPredictive(_0x34ee90);_0x1e0cc9[_0xdc2e('0x15f')](_0x34ee90,_0x34ee90['dialPowerLevel']);break;case _0xdc2e('0xb'):_0x1e0cc9[_0xdc2e('0xb')](_0x34ee90);break;case _0xdc2e('0xa'):freeVariablesPredictive(_0x34ee90);_0x1e0cc9[_0xdc2e('0x15f')](_0x34ee90,0x1);break;default:freeVariablesPredictive(_0x34ee90);logger['error']('Queue',_0x34ee90[_0xdc2e('0x45')],'method\x20not\x20recognized');}};};Dialer['prototype']['checkPreviewRecallReminder']=function(_0x2da73a){return BPromise[_0xdc2e('0xbb')]()[_0xdc2e('0x3b')](cmHopper[_0xdc2e('0x160')](_0x2da73a['id'],previewRecallmeReminderInterval))[_0xdc2e('0x3b')](function(_0x205ecd){for(var _0x157843=0x0;_0x157843<_0x205ecd['length'];_0x157843++){var _0x10154b=_0x205ecd[_0x157843]['Agent'][_0xdc2e('0x45')];if(_0x10154b)io['to'](util['format'](_0xdc2e('0x161'),_0x10154b))['emit'](_0xdc2e('0x162'),{'hopper':_0x205ecd[_0x157843]});}})[_0xdc2e('0xb6')](function(_0x4c2c81){});};Dialer[_0xdc2e('0xad')]['launchHandleIvr']=function(_0x28ef27){var _0x56bf63=this;return function(){_0x56bf63[_0xdc2e('0x163')](_0x28ef27);};};Dialer[_0xdc2e('0xad')][_0xdc2e('0xd')]=function(_0x35674c){var _0x4ad276=this;if(isNotPreview(_0x35674c[_0xdc2e('0x59')])){if(isVoiceQueueOutbound(_0x35674c[_0xdc2e('0x53')])&&isActive(_0x35674c[_0xdc2e('0x58')])){_0x35674c[_0xdc2e('0xa2')]=!![];BPromise[_0xdc2e('0xbb')]()[_0xdc2e('0x3b')](checkIsLoggedIn(_0x35674c,_0x35674c[_0xdc2e('0x4f')]))[_0xdc2e('0x3b')](checkIsActive(_0x35674c,_0x35674c['dialActive']))[_0xdc2e('0x3b')](checkInterval(_0x35674c))[_0xdc2e('0x3b')](_0x4ad276[_0xdc2e('0x144')](_0x35674c))[_0xdc2e('0x3b')](_0x4ad276['checkIfTime'](_0x35674c[_0xdc2e('0x164')],_0x35674c[_0xdc2e('0x165')],_0x35674c[_0xdc2e('0x45')],_0x35674c))[_0xdc2e('0x3b')](_0x4ad276[_0xdc2e('0x149')](_0x35674c[_0xdc2e('0x43')],_0x35674c[_0xdc2e('0x165')],_0x35674c['name'],_0x35674c))[_0xdc2e('0x3b')](_0x4ad276[_0xdc2e('0x15c')](_0x35674c))[_0xdc2e('0xb6')](loggerCatchQueueSummary(_0xdc2e('0x166'),_0x35674c));}else{notSendMessagesQueue(_0x35674c);}}else{freeVariablesPredictive(_0x35674c);if(_0x35674c[_0xdc2e('0x167')]){_0x4ad276[_0xdc2e('0x168')](_0x35674c);}}};Dialer['prototype'][_0xdc2e('0x143')]=function(){var _0x3d2808=this;var _0x3d387a;for(var _0x207327 in this[_0xdc2e('0x23')]){if(typeof this[_0xdc2e('0x23')][_0x207327]!==_0xdc2e('0x9b')){_0x3d387a=this[_0xdc2e('0x23')][_0x207327];if(isCampaignIvr(_0x3d387a[_0xdc2e('0x53')])&&isActive(_0x3d387a[_0xdc2e('0x79')])){_0x3d387a['sendMessageOneNotActive']=!![];BPromise[_0xdc2e('0xbb')]()['then'](checkIsActive(_0x3d387a,_0x3d387a['active']))[_0xdc2e('0x3b')](checkInterval(_0x3d387a))[_0xdc2e('0x3b')](_0x3d2808[_0xdc2e('0x144')](_0x3d387a))[_0xdc2e('0x3b')](_0x3d2808['checkIfTime'](_0x3d387a[_0xdc2e('0x164')],_0x3d387a[_0xdc2e('0x165')],_0x3d387a[_0xdc2e('0x45')],_0x3d387a))['then'](_0x3d2808[_0xdc2e('0x149')](_0x3d387a[_0xdc2e('0x43')],_0x3d387a['dialTimezone'],_0x3d387a[_0xdc2e('0x45')],_0x3d387a))['then'](_0x3d2808[_0xdc2e('0x169')](_0x3d387a))[_0xdc2e('0xb6')](loggerCatchQueueSummary('[syncCampaigns]',_0x3d387a));}else{notSendMessagesCampaign(_0x3d387a);}}}};function getCallerIdRandom(_0xdd8023,_0x47bf62){var _0x1a8e3a;var _0x32ae8e;var _0x57e212;if(_0x47bf62<=0x0){_0x47bf62=0x1;}_0x1a8e3a=new RegExp(_0xdc2e('0x16a')+_0x47bf62+'}$');_0x32ae8e=Math[_0xdc2e('0x16b')](0xa,_0x47bf62-0x1);_0x57e212=Math[_0xdc2e('0x16b')](0xa,_0x47bf62)-0x1;return util[_0xdc2e('0x7e')]('%s',_[_0xdc2e('0x16c')](_0xdd8023,_0x1a8e3a,_[_0xdc2e('0x16d')](_0x32ae8e,_0x57e212)));}function extractCalleridName(_0x1cd3b3){var _0x5e351d=_0x1cd3b3[_0xdc2e('0x16e')](/"(.*?)"/);return _0x5e351d?_0x5e351d[0x1]:_0x1cd3b3;}function extractCalleridNumber(_0x5f307d){var _0xca07bd=_0x5f307d[_0xdc2e('0x16e')](/<(.*?)>/);return _0xca07bd?_0xca07bd[0x1]:_0x5f307d;}Dialer[_0xdc2e('0xad')]['actionOriginate']=function(_0x43b2a0,_0x283e82){var _0x234379=this;var _0x9685b8=uuid['v4']();this[_0xdc2e('0xb1')][_0x9685b8]=new Action(_0x43b2a0,_0x283e82,_0x9685b8);return new BPromise(function(_0x2246ad,_0x81b165){if(_[_0xdc2e('0x3d')](_0x43b2a0)&&typeof _0x43b2a0!==_0xdc2e('0x16f')){return _0x81b165(msgResponse(_0xdc2e('0x170'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0xdc2e('0x3d')](_0x283e82['Contact']['phone'])||_0x283e82[_0xdc2e('0x171')][_0xdc2e('0x172')]===null){return _0x81b165(msgResponse(_0xdc2e('0x170'),_0xdc2e('0x14a'),_0xdc2e('0x173')));}var _0x60a834={'XMD-CALLERID':_0x234379[_0xdc2e('0xb1')][_0x9685b8][_0xdc2e('0x174')](),'XMD-AGI':_0x43b2a0['dialQueueProject']?util[_0xdc2e('0x7e')](_0xdc2e('0x175'),ipAgi,_0x43b2a0[_0xdc2e('0x109')]):_0xdc2e('0x176'),'XMD-AGIAFTER':_0x43b2a0[_0xdc2e('0x111')]?util[_0xdc2e('0x7e')]('\x22agi://%s/square,%s\x22',ipAgi,_0x43b2a0[_0xdc2e('0x111')]):_0xdc2e('0x176'),'XMD-QUEUE':_0x43b2a0[_0xdc2e('0x53')]===_0xdc2e('0x4c')?util[_0xdc2e('0x7e')]('\x22%s,%s%s,,,%s\x22',_0x43b2a0['name'],_0x43b2a0['dialQueueOptions']||'',_0x43b2a0[_0xdc2e('0x112')]?'c':'',_0x43b2a0['dialQueueTimeout']||0x3):_0xdc2e('0x176'),'XMD-CONTACTID':_0x283e82[_0xdc2e('0xd3')],'XMD-CDRTYPE':_0xdc2e('0x9'),'CALLERID(all)':_0x234379[_0xdc2e('0xb1')][_0x9685b8][_0xdc2e('0x174')](),'XMD-AMD':_0x43b2a0[_0xdc2e('0xe4')]?_0xdc2e('0x177'):_0xdc2e('0x176'),'XMD-DESTINATION':_0xdc2e('0xe3')};if(_0x43b2a0[_0xdc2e('0xe4')]){_0x60a834[_0xdc2e('0x178')]=_0x43b2a0['dialAMDInitialSilence']||0x9c4;_0x60a834['XMD-AMDGREETING']=_0x43b2a0[_0xdc2e('0x179')]||0x5dc;_0x60a834[_0xdc2e('0x17a')]=_0x43b2a0[_0xdc2e('0x17b')]||0x320;_0x60a834[_0xdc2e('0x17c')]=_0x43b2a0[_0xdc2e('0x17d')]||0x1388;_0x60a834['XMD-AMDMINWORDLENGTH']=_0x43b2a0['dialAMDMinWordLength']||0x64;_0x60a834[_0xdc2e('0x17e')]=_0x43b2a0[_0xdc2e('0x17f')]||0x32;_0x60a834[_0xdc2e('0x180')]=_0x43b2a0[_0xdc2e('0x181')]||0x3;_0x60a834[_0xdc2e('0x182')]=_0x43b2a0[_0xdc2e('0x183')]||0x100;_0x60a834[_0xdc2e('0x184')]=_0x43b2a0[_0xdc2e('0x185')]||0x1388;}if(_0x43b2a0[_0xdc2e('0x53')]==='outbound'){_0x60a834[_0xdc2e('0x186')]=_0x283e82[_0xdc2e('0xd5')];}else{_0x60a834['XMD-CAMPAIGNID']=_0x283e82['CampaignId'];}for(var _0x2bfa72 in _0x283e82[_0xdc2e('0x171')]){if(typeof _0x283e82[_0xdc2e('0x171')][_0x2bfa72]!==_0xdc2e('0x9b')){if(isNotNull(_0x283e82['Contact'][_0x2bfa72])&&_0x2bfa72!=='id'&&_0x2bfa72!==_0xdc2e('0x187')&&_0x2bfa72!==_0xdc2e('0x188')&&_0x2bfa72!==_0xdc2e('0x189')){_0x60a834[util['format'](_0xdc2e('0x18a'),_0xdc2e('0x18b'),_[_0xdc2e('0x18c')](_0x2bfa72))]=_0x283e82[_0xdc2e('0x171')][_0x2bfa72];}}}var _0x46506e=_0x234379[_0xdc2e('0xdb')](_0x43b2a0['Trunk'])?getCallerId(_0x43b2a0[_0xdc2e('0x78')][_0xdc2e('0x18d')],_0x43b2a0['dialOriginateCallerIdName'],_0x43b2a0[_0xdc2e('0x18e')]>0x0?getCallerIdRandom(_0x43b2a0[_0xdc2e('0x5a')],_0x43b2a0['dialRandomLastDigitCallerIdNumber']):_0x43b2a0['dialOriginateCallerIdNumber']):getCallerId(_[_0xdc2e('0xdf')](_0x43b2a0['TrunkBackup'])?_0x43b2a0[_0xdc2e('0x78')][_0xdc2e('0x18d')]:_0x43b2a0[_0xdc2e('0x145')][_0xdc2e('0x18d')],_0x43b2a0[_0xdc2e('0x18f')],_0x43b2a0[_0xdc2e('0x18e')]>0x0?getCallerIdRandom(_0x43b2a0[_0xdc2e('0x5a')],_0x43b2a0[_0xdc2e('0x18e')]):_0x43b2a0[_0xdc2e('0x5a')]);if(_0x46506e){_0x60a834[_0xdc2e('0x190')]=_0x234379[_0xdc2e('0xb1')][_0x9685b8][_0xdc2e('0x191')]=extractCalleridName(_0x46506e);_0x60a834[_0xdc2e('0x192')]=_0x234379['actions'][_0x9685b8][_0xdc2e('0x193')]=extractCalleridNumber(_0x46506e);}return ami[_0xdc2e('0xb4')]({'actionid':_0x9685b8,'action':_0xdc2e('0x170'),'channel':_0x234379['isTrunkReachable'](_0x43b2a0[_0xdc2e('0x78')])?util[_0xdc2e('0x7e')]('SIP/%s/%s%s',_0x43b2a0[_0xdc2e('0x78')][_0xdc2e('0x45')],isNotNull(_0x43b2a0[_0xdc2e('0x5c')])?_0x43b2a0[_0xdc2e('0x5c')][_0xdc2e('0x194')]()||'':'',_0x43b2a0[_0xdc2e('0x195')]>0x0?_0x283e82[_0xdc2e('0x171')]['phone'][_0xdc2e('0x196')](_0x43b2a0[_0xdc2e('0x195')]):_0x283e82['Contact'][_0xdc2e('0x172')]):util[_0xdc2e('0x7e')]('SIP/%s/%s%s',_[_0xdc2e('0xdf')](_0x43b2a0[_0xdc2e('0x145')])?_0x43b2a0[_0xdc2e('0x78')][_0xdc2e('0x45')]:_0x43b2a0[_0xdc2e('0x145')][_0xdc2e('0x45')],isNotNull(_0x43b2a0[_0xdc2e('0x5c')])?_0x43b2a0[_0xdc2e('0x5c')]['trim']()||'':'',_0x43b2a0[_0xdc2e('0x195')]>0x0?_0x283e82[_0xdc2e('0x171')]['phone'][_0xdc2e('0x196')](_0x43b2a0[_0xdc2e('0x195')]):_0x283e82[_0xdc2e('0x171')]['phone']),'callerid':_0x46506e,'Exten':_0xdc2e('0xe3'),'Context':_0xdc2e('0x197'),'Priority':'1','variable':_0x60a834,'timeout':(_0x43b2a0[_0xdc2e('0x5b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x9685b8})[_0xdc2e('0x3b')](function(_0x868f5b){return _0x2246ad(_0x868f5b);})[_0xdc2e('0xb6')](function(_0x1aff2b){_0x43b2a0[_0xdc2e('0x65')]+=0x1;var _0x4acc9a=new History(_0x234379[_0xdc2e('0xb1')][_0x9685b8]);logger[_0xdc2e('0x97')](util[_0xdc2e('0x7e')]('[originateError]:\x20%s',JSON[_0xdc2e('0x7a')](_0x1aff2b)));_0x4acc9a[_0xdc2e('0xaa')]=0xe;_0x4acc9a[_0xdc2e('0xe7')]=_0xdc2e('0x198');_0x4acc9a[_0xdc2e('0xac')]=moment()[_0xdc2e('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x4acc9a['endtime']=_0x4acc9a[_0xdc2e('0xac')];_0x234379['createHistory'](_0x4acc9a)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x199')));_0x234379[_0xdc2e('0xcc')](_0x4acc9a)[_0xdc2e('0xb6')](loggerCatch('[originate][error]'))['finally'](function(){delete _0x234379[_0xdc2e('0xb1')][_0x9685b8];return _0x81b165(msgResponse(_0xdc2e('0x170'),'Error',_0xdc2e('0x19a')));});});});};Dialer[_0xdc2e('0xad')][_0xdc2e('0x19b')]=function(_0x4c9daa){var _0x290dcb=this[_0xdc2e('0xb1')][_0x4c9daa[_0xdc2e('0x129')]];if(_0x290dcb){delete this['actions'][_0x4c9daa[_0xdc2e('0x129')]];_0x290dcb['responsetime']=moment()[_0xdc2e('0x7e')](_0xdc2e('0x108'));var _0x5a43bf=_0x290dcb['type']===_0xdc2e('0x94')?this['campaigns'][_0x290dcb[_0xdc2e('0xb9')]]:this['voiceQueues'][_0x290dcb[_0xdc2e('0x19c')]()];if(!this[_0xdc2e('0xd9')](_0x4c9daa[_0xdc2e('0x19d')])){this[_0xdc2e('0xb8')](_0x5a43bf);return this[_0xdc2e('0x19e')](_0x290dcb,_0x5a43bf,_0x4c9daa)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x19f')));}this[_0xdc2e('0xae')][_0x4c9daa[_0xdc2e('0xde')]]=_0x290dcb;}};Dialer[_0xdc2e('0xad')][_0xdc2e('0x1a0')]=function(_0x731169,_0x219a36,_0xc7bc23){var _0x1259dd=new History(_0x219a36);if(_0x1259dd[_0xdc2e('0x1a1')]+_0x1259dd['countcongestionretry']+_0x1259dd[_0xdc2e('0xf4')]+_0x1259dd[_0xdc2e('0xf5')]+_0x1259dd[_0xdc2e('0xf6')]+_0x1259dd[_0xdc2e('0xf7')]+_0x1259dd[_0xdc2e('0xf0')]+_0x1259dd[_0xdc2e('0xf8')]>=_0xc7bc23[_0xdc2e('0xf9')]-0x1){return!![];}switch(_0x731169){case 0x3:if(_0x1259dd['countnoanswerretry']>=_0xc7bc23[_0xdc2e('0x1a2')]-0x1){return!![];}this[_0xdc2e('0xc3')]({'active':![],'countnoanswerretry':_0x1259dd[_0xdc2e('0xf4')]+=0x1,'scheduledat':moment()[_0xdc2e('0xfe')](_0xc7bc23['dialNoAnswerRetryFrequency'],'minutes')['format'](_0xdc2e('0x108')),'ContactId':_0x1259dd[_0xdc2e('0xd3')],'ListId':_0x1259dd[_0xdc2e('0xd4')],'VoiceQueueId':_0x1259dd[_0xdc2e('0xd5')]||undefined,'CampaignId':_0x1259dd[_0xdc2e('0xd6')]||undefined})[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x1a3')));break;case 0x5:if(_0x1259dd[_0xdc2e('0x1a1')]>=_0xc7bc23[_0xdc2e('0x1a4')]-0x1){return!![];}this[_0xdc2e('0xc3')]({'active':![],'countbusyretry':_0x1259dd['countbusyretry']+=0x1,'scheduledat':moment()[_0xdc2e('0xfe')](_0xc7bc23[_0xdc2e('0x1a5')],_0xdc2e('0x100'))['format'](_0xdc2e('0x108')),'ContactId':_0x1259dd['ContactId'],'ListId':_0x1259dd[_0xdc2e('0xd4')],'VoiceQueueId':_0x1259dd[_0xdc2e('0xd5')]||undefined,'CampaignId':_0x1259dd[_0xdc2e('0xd6')]||undefined})['catch'](loggerCatch(_0xdc2e('0x1a6')));break;case 0x8:if(_0x1259dd[_0xdc2e('0xf3')]>=_0xc7bc23[_0xdc2e('0x1a7')]-0x1){return!![];}this[_0xdc2e('0xc3')]({'active':![],'countcongestionretry':_0x1259dd[_0xdc2e('0xf3')]+=0x1,'scheduledat':moment()[_0xdc2e('0xfe')](_0xc7bc23[_0xdc2e('0x1a8')],_0xdc2e('0x100'))[_0xdc2e('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1259dd[_0xdc2e('0xd3')],'ListId':_0x1259dd[_0xdc2e('0xd4')],'VoiceQueueId':_0x1259dd[_0xdc2e('0xd5')]||undefined,'CampaignId':_0x1259dd[_0xdc2e('0xd6')]||undefined})[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x1a9')));break;case 0x0:if(_0x1259dd[_0xdc2e('0xf5')]>=_0xc7bc23['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xdc2e('0xc3')]({'active':![],'countnosuchnumberretry':_0x1259dd['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xdc2e('0xfe')](_0xc7bc23[_0xdc2e('0x1aa')],'minutes')[_0xdc2e('0x7e')](_0xdc2e('0x108')),'ContactId':_0x1259dd[_0xdc2e('0xd3')],'ListId':_0x1259dd[_0xdc2e('0xd4')],'VoiceQueueId':_0x1259dd[_0xdc2e('0xd5')]||undefined,'CampaignId':_0x1259dd[_0xdc2e('0xd6')]||undefined})[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x1ab')));}break;case 0xa:if(_0x1259dd[_0xdc2e('0xf6')]>=_0xc7bc23[_0xdc2e('0x11d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x1259dd[_0xdc2e('0xf6')]+=0x1,'scheduledat':moment()[_0xdc2e('0xfe')](_0xc7bc23[_0xdc2e('0x11f')],_0xdc2e('0x100'))[_0xdc2e('0x7e')](_0xdc2e('0x108')),'ContactId':_0x1259dd[_0xdc2e('0xd3')],'ListId':_0x1259dd[_0xdc2e('0xd4')],'VoiceQueueId':_0x1259dd[_0xdc2e('0xd5')]||undefined,'CampaignId':_0x1259dd[_0xdc2e('0xd6')]||undefined})[_0xdc2e('0xb6')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x1259dd[_0xdc2e('0xf7')]>=_0xc7bc23[_0xdc2e('0x125')]-0x1){return!![];}this[_0xdc2e('0xc3')]({'active':![],'countabandonedretry':_0x1259dd[_0xdc2e('0xf7')]+=0x1,'scheduledat':moment()['add'](_0xc7bc23[_0xdc2e('0x126')],_0xdc2e('0x100'))[_0xdc2e('0x7e')](_0xdc2e('0x108')),'ContactId':_0x1259dd['ContactId'],'ListId':_0x1259dd[_0xdc2e('0xd4')],'VoiceQueueId':_0x1259dd[_0xdc2e('0xd5')]||undefined,'CampaignId':_0x1259dd[_0xdc2e('0xd6')]||undefined})['catch'](loggerCatch(_0xdc2e('0x127')));break;case 0x13:if(_0x1259dd[_0xdc2e('0xf0')]>=_0xc7bc23[_0xdc2e('0x107')]-0x1){return!![];}this[_0xdc2e('0xc3')]({'active':![],'countmachineretry':_0x1259dd[_0xdc2e('0xf0')]+=0x1,'scheduledat':moment()[_0xdc2e('0xfe')](_0xc7bc23[_0xdc2e('0xff')],_0xdc2e('0x100'))['format'](_0xdc2e('0x108')),'ContactId':_0x1259dd[_0xdc2e('0xd3')],'ListId':_0x1259dd[_0xdc2e('0xd4')],'VoiceQueueId':_0x1259dd[_0xdc2e('0xd5')]||undefined,'CampaignId':_0x1259dd[_0xdc2e('0xd6')]||undefined})[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x101')));break;case 0x14:if(_0x1259dd[_0xdc2e('0xf8')]>=_0xc7bc23[_0xdc2e('0x1ac')]-0x1){return!![];}this[_0xdc2e('0xc3')]({'active':![],'countagentrejectretry':_0x1259dd[_0xdc2e('0xf8')]+=0x1,'scheduledat':moment()[_0xdc2e('0xfe')](_0xc7bc23[_0xdc2e('0x1ad')],_0xdc2e('0x100'))[_0xdc2e('0x7e')](_0xdc2e('0x108')),'ContactId':_0x1259dd[_0xdc2e('0xd3')],'ListId':_0x1259dd[_0xdc2e('0xd4')],'VoiceQueueId':_0x1259dd[_0xdc2e('0xd5')]||undefined,'CampaignId':_0x1259dd[_0xdc2e('0xd6')]||undefined})[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x1ae')));break;default:return!![];}};Dialer[_0xdc2e('0xad')][_0xdc2e('0x19e')]=function(_0x31bfe7,_0x2d2a1c,_0x14fabe){var _0x3e3383=this;var _0x54242d=new History(_0x31bfe7);return new BPromise(function(_0xbbe4c,_0x1474c2){if(_[_0xdc2e('0x3d')](_0x2d2a1c)&&typeof _0x2d2a1c!==_0xdc2e('0x16f')){return _0x1474c2(msgResponse(_0xdc2e('0x1af'),'Failure',_0xdc2e('0x1b0')));}if(_[_0xdc2e('0x3d')](_0x14fabe)&&typeof _0x14fabe!==_0xdc2e('0x16f')){return _0x1474c2(msgResponse(_0xdc2e('0x1af'),'Failure',_0xdc2e('0x1b1')));}switch(_0x14fabe['reason']){case'0':_0x2d2a1c['outboundNoSuchCallsDay']+=0x1;_0x54242d[_0xdc2e('0xaa')]=0x0;_0x54242d[_0xdc2e('0xe7')]=_0xdc2e('0x1b2');_0x54242d[_0xdc2e('0xf5')]+=0x1;_0x54242d[_0xdc2e('0x105')]+=0x1;ami['emit'](_0xdc2e('0x1b3'),ut[_0xdc2e('0xf2')](_0x31bfe7,_0xdc2e('0x1b4')));_0x3e3383[_0xdc2e('0xce')](_0x54242d)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x106')));if(_0x3e3383['checkRetriveMax'](0x0,_0x31bfe7,_0x2d2a1c)){if(_0x54242d[_0xdc2e('0xf5')]>=_0x2d2a1c['dialNoSuchNumberMaxRetry']){_0x3e3383['createStateFinal'](_0x54242d,_0xbbe4c,_0x1474c2,_0xdc2e('0x1b5'));}else{_0x3e3383[_0xdc2e('0xfa')](_0x54242d,_0xbbe4c,_0x1474c2,_0xdc2e('0x1b5'));}}break;case'3':_0x2d2a1c[_0xdc2e('0x63')]+=0x1;_0x54242d[_0xdc2e('0xaa')]=0x3;_0x54242d[_0xdc2e('0xe7')]=_0xdc2e('0x1b6');_0x54242d[_0xdc2e('0xf4')]+=0x1;_0x54242d['countglobal']+=0x1;ami['emit'](_0xdc2e('0x1b7'),ut[_0xdc2e('0xf2')](_0x31bfe7,_0xdc2e('0x1b8')));_0x3e3383[_0xdc2e('0xce')](_0x54242d)['catch'](loggerCatch(_0xdc2e('0x1b9')));if(_0x3e3383[_0xdc2e('0x1a0')](0x3,_0x31bfe7,_0x2d2a1c)){if(_0x54242d[_0xdc2e('0xf4')]>=_0x2d2a1c[_0xdc2e('0x1a2')]){_0x3e3383[_0xdc2e('0xfc')](_0x54242d,_0xbbe4c,_0x1474c2,'reason\x203\x20ringing\x20no\x20answer');}else{_0x3e3383[_0xdc2e('0xfa')](_0x54242d,_0xbbe4c,_0x1474c2,_0xdc2e('0x1ba'));}}break;case'5':_0x2d2a1c[_0xdc2e('0x5f')]+=0x1;_0x54242d[_0xdc2e('0xaa')]=0x5;_0x54242d[_0xdc2e('0xe7')]=_0xdc2e('0x1bb');_0x54242d[_0xdc2e('0x1a1')]+=0x1;_0x54242d[_0xdc2e('0x105')]+=0x1;ami[_0xdc2e('0xeb')](_0xdc2e('0x1bc'),ut['buildObj'](_0x31bfe7,'busy'));_0x3e3383['createHistory'](_0x54242d)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x1bd')));if(_0x3e3383[_0xdc2e('0x1a0')](0x5,_0x31bfe7,_0x2d2a1c)){if(_0x54242d[_0xdc2e('0x1a1')]>=_0x2d2a1c[_0xdc2e('0x1a4')]){_0x3e3383[_0xdc2e('0xfc')](_0x54242d,_0xbbe4c,_0x1474c2,'reason\x205\x20busy');}else{_0x3e3383['stateGlobal'](_0x54242d,_0xbbe4c,_0x1474c2,'reason\x205\x20busy');}}break;case'8':_0x2d2a1c[_0xdc2e('0x60')]+=0x1;_0x54242d[_0xdc2e('0xaa')]=0x8;_0x54242d[_0xdc2e('0xe7')]=_0xdc2e('0x1be');_0x54242d[_0xdc2e('0xf3')]+=0x1;_0x54242d['countglobal']+=0x1;ami[_0xdc2e('0xeb')]('custom:agentcongestion',ut['buildObj'](_0x31bfe7,'congestion'));_0x3e3383[_0xdc2e('0xce')](_0x54242d)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x1bf')));if(_0x3e3383[_0xdc2e('0x1a0')](0x8,_0x31bfe7,_0x2d2a1c)){if(_0x54242d[_0xdc2e('0xf3')]>=_0x2d2a1c[_0xdc2e('0x1a7')]){_0x3e3383['createStateFinal'](_0x54242d,_0xbbe4c,_0x1474c2,_0xdc2e('0x1c0'));}else{_0x3e3383[_0xdc2e('0xfa')](_0x54242d,_0xbbe4c,_0x1474c2,_0xdc2e('0x1c0'));}}break;case'11':_0x2d2a1c['outboundAbandonedCallsDay']+=0x1;_0x54242d[_0xdc2e('0xaa')]=0xb;_0x54242d[_0xdc2e('0xe7')]=_0xdc2e('0x123');_0x54242d[_0xdc2e('0xf7')]+=0x1;_0x54242d[_0xdc2e('0x105')]+=0x1;_0x3e3383[_0xdc2e('0xce')](_0x54242d)['catch'](loggerCatch(_0xdc2e('0x128')));if(_0x3e3383['checkRetriveMax'](0xb,_0x31bfe7,_0x2d2a1c)){if(_0x54242d['countabandonedretry']>=_0x2d2a1c['dialAbandonedMaxRetry']){_0x3e3383['createStateFinal'](_0x54242d,_0xbbe4c,_0x1474c2,'reason\x2011\x20abandoned');}else{_0x3e3383[_0xdc2e('0xfa')](_0x54242d,_0xbbe4c,_0x1474c2,_0xdc2e('0x1c1'));}}break;case'20':_0x2d2a1c[_0xdc2e('0x67')]+=0x1;_0x54242d[_0xdc2e('0xaa')]=0x14;_0x54242d[_0xdc2e('0xe7')]=_0xdc2e('0x1c2');_0x54242d['countagentrejectretry']+=0x1;_0x54242d[_0xdc2e('0x105')]+=0x1;ami['emit']('custom:agentreject',ut[_0xdc2e('0xf2')](_0x31bfe7,_0xdc2e('0x1c3')));_0x3e3383[_0xdc2e('0xce')](_0x54242d)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x1c4')));if(_0x3e3383['checkRetriveMax'](0x14,_0x31bfe7,_0x2d2a1c)){if(_0x54242d['countagentrejectretry']>=_0x2d2a1c[_0xdc2e('0x1ac')]){_0x3e3383[_0xdc2e('0xfc')](_0x54242d,_0xbbe4c,_0x1474c2,_0xdc2e('0x1c5'));}else{_0x3e3383[_0xdc2e('0xfa')](_0x54242d,_0xbbe4c,_0x1474c2,'reason\x2020\x20agentreject');}}break;default:_0x2d2a1c[_0xdc2e('0x68')]+=0x1;_0x54242d[_0xdc2e('0xaa')]=0xc;_0x54242d[_0xdc2e('0xe7')]=_0x14fabe[_0xdc2e('0x1c6')];_0x3e3383[_0xdc2e('0xce')](_0x54242d)[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x1c7')));if(_0x3e3383[_0xdc2e('0x1a0')](_0x14fabe['reason'],_0x31bfe7,_0x2d2a1c)){if(_0x54242d['countbusyretry']+_0x54242d[_0xdc2e('0xf3')]+_0x54242d['countnoanswerretry']+_0x54242d['countnosuchnumberretry']+_0x54242d['countdropretry']+_0x54242d['countabandonedretry']+_0x54242d['countmachineretry']+_0x54242d[_0xdc2e('0xf8')]>=_0x2d2a1c[_0xdc2e('0xf9')]){_0x3e3383['stateGlobal'](_0x54242d,_0xbbe4c,_0x1474c2,_0x14fabe[_0xdc2e('0x1c6')]);}else{_0x3e3383[_0xdc2e('0xfc')](_0x54242d,_0xbbe4c,_0x1474c2,_0x14fabe[_0xdc2e('0x1c6')]);}}}});};Dialer['prototype'][_0xdc2e('0xfa')]=function(_0x5778c4,_0x221ca0,_0x4da930,_0x10af09){var _0x148305=new Final(_0x5778c4);_0x148305[_0xdc2e('0xaa')]=0xf;_0x148305[_0xdc2e('0xe7')]='Global';this['createStateFinal'](_0x148305,_0x221ca0,_0x4da930,_0x10af09);};Dialer['prototype'][_0xdc2e('0xfc')]=function(_0x100442,_0x1afb6a,_0x47124d,_0x3cbe73){this[_0xdc2e('0xcc')](_0x100442)[_0xdc2e('0x3b')](function(){return _0x1afb6a(msgResponse(_0xdc2e('0x1af'),_0xdc2e('0xda'),_0x3cbe73));})[_0xdc2e('0xb6')](function(){return _0x47124d(msgResponse(_0xdc2e('0x1c8'),_0xdc2e('0x14a'),_0xdc2e('0x1c9')));});};Dialer[_0xdc2e('0xad')][_0xdc2e('0xb')]=function(_0x27f34d){var _0x3f60b1=_0x27f34d[_0xdc2e('0x1ca')]/0x64;var _0x15f5a4=_0x27f34d[_0xdc2e('0x62')]/(_0x27f34d[_0xdc2e('0x62')]+_0x27f34d['outboundAnswerCallsDay']);var _0x50acf9=Math[_0xdc2e('0x1cb')](_0x27f34d['predictiveIntervalAvailable']*(_0x27f34d[_0xdc2e('0x1cc')]/0x64));var _0x4051b5=Math[_0xdc2e('0x1cb')](_0x27f34d[_0xdc2e('0x71')]*(_0x27f34d[_0xdc2e('0x1cd')]/0x64));var _0x2e7ea6=_0x27f34d['available']+_0x27f34d[_0xdc2e('0xa3')];var _0x138076=Math['floor'](_0x27f34d[_0xdc2e('0x74')]*_0x27f34d[_0xdc2e('0x8e')]*_0x27f34d[_0xdc2e('0x6f')]*_0x27f34d[_0xdc2e('0x1ce')]);if(_[_0xdc2e('0x3d')](_0x27f34d[_0xdc2e('0x77')])){if(!_[_0xdc2e('0x3d')](_0x27f34d[_0xdc2e('0x28')])){_0x27f34d[_0xdc2e('0x28')]=undefined;loggerPredictive['error'](_0xdc2e('0x1cf'),_0xdc2e('0x1d0'));}if(!_[_0xdc2e('0x3d')](_0x27f34d['handlePredictive'])){loggerPredictive[_0xdc2e('0x97')](_0xdc2e('0x1cf'),_0xdc2e('0x1d1'));clearInterval(_0x27f34d[_0xdc2e('0x92')]);_0x27f34d[_0xdc2e('0x92')]=undefined;}_0x27f34d[_0xdc2e('0x77')]=moment()[_0xdc2e('0x7e')](_0xdc2e('0x108'));loggerPredictive[_0xdc2e('0x81')](_0x27f34d[_0xdc2e('0x45')],_0xdc2e('0x1d2'),_0x27f34d[_0xdc2e('0x77')]);this[_0xdc2e('0x15f')](_0x27f34d,0x1);}else if(ifInterval(_0x27f34d['dialPredictiveInterval'],_0x27f34d['startProgressive'])){this['handlePower'](_0x27f34d,0x1);loggerPredictiveCalls['info'](_0xdc2e('0x1d3'),_0x27f34d[_0xdc2e('0x77')],_0x27f34d[_0xdc2e('0x45')]);_0x27f34d[_0xdc2e('0x74')]=0x0;_0x27f34d[_0xdc2e('0x6e')]=0x0;}else if(_0x3f60b1<_0x15f5a4&&_0x27f34d[_0xdc2e('0x1d4')]===_0xdc2e('0x1d5')){freeVariablesPredictive(_0x27f34d);loggerPredictive[_0xdc2e('0x81')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xdc2e('0x1d6'),_0x15f5a4,_0xdc2e('0x77'),_0x27f34d[_0xdc2e('0x45')]);}else if(_0x138076<_0x27f34d['predictiveIntervalErlangCallsDroppedCalls']&&_0x27f34d[_0xdc2e('0x1d4')]===_0xdc2e('0x1d5')){freeVariablesPredictive(_0x27f34d);loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x1d7'),_0xdc2e('0x1d8'),_0x138076,_0xdc2e('0x1d9'),_0x27f34d[_0xdc2e('0x6e')],_0xdc2e('0x77'),_0x27f34d[_0xdc2e('0x45')]);}else if(!ifInterval(_0x27f34d['dialPredictiveInterval'],_0x27f34d[_0xdc2e('0x77')])&&_[_0xdc2e('0x3d')](_0x27f34d[_0xdc2e('0x28')])&&!_[_0xdc2e('0x3d')](_0x27f34d[_0xdc2e('0x77')])){_0x27f34d[_0xdc2e('0x28')]=moment()[_0xdc2e('0x7e')](_0xdc2e('0x108'));loggerPredictive[_0xdc2e('0x81')](_0x27f34d[_0xdc2e('0x45')],_0xdc2e('0x1da'),_0x27f34d[_0xdc2e('0x28')]);this[_0xdc2e('0xc1')](_0x27f34d[_0xdc2e('0x1db')])[_0xdc2e('0x3b')](this[_0xdc2e('0x1dc')](_0x27f34d))['then'](mergeDataErlangB(_0x27f34d))[_0xdc2e('0x3b')](this[_0xdc2e('0x1dd')](_0x27f34d))[_0xdc2e('0xb6')](loggerCatchPredictive(_0xdc2e('0x1de'),_0x27f34d));}else if(!ifInterval(_0x27f34d['dialPredictiveInterval'],_0x27f34d[_0xdc2e('0x28')])){_0x27f34d[_0xdc2e('0x6e')]=0x0;_0x27f34d['startPredictive']=moment()[_0xdc2e('0x7e')](_0xdc2e('0x108'));loggerPredictive['info'](_0x27f34d[_0xdc2e('0x45')],_0xdc2e('0x1df'),_0x27f34d[_0xdc2e('0x28')]);clearInterval(_0x27f34d[_0xdc2e('0x92')]);_0x27f34d[_0xdc2e('0x92')]=undefined;this['averageHandleTime'](_0x27f34d[_0xdc2e('0x1db')])[_0xdc2e('0x3b')](this[_0xdc2e('0x1dc')](_0x27f34d))['then'](mergeDataErlangB(_0x27f34d))[_0xdc2e('0x3b')](this['startMethodPredictive'](_0x27f34d))[_0xdc2e('0xb6')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x27f34d));}else if(_0x27f34d[_0xdc2e('0x71')]&&_0x2e7ea6<_0x27f34d[_0xdc2e('0x71')]-_0x4051b5){freeVariablesPredictive(_0x27f34d);loggerPredictive[_0xdc2e('0x81')](_0x27f34d[_0xdc2e('0x45')],_0xdc2e('0x1e0'),_0x2e7ea6,_0xdc2e('0x1e1'),_0x27f34d[_0xdc2e('0x71')],'-',_0x4051b5,'=',_0x27f34d['predictiveIntervalAvailable']-_0x4051b5,')');}else if(_0x27f34d[_0xdc2e('0x71')]&&_0x2e7ea6>_0x27f34d['predictiveIntervalAvailable']+_0x50acf9){freeVariablesPredictive(_0x27f34d);loggerPredictive[_0xdc2e('0x81')](_0x27f34d[_0xdc2e('0x45')],_0xdc2e('0x1e0'),_0x2e7ea6,_0xdc2e('0x1e2'),_0x27f34d[_0xdc2e('0x71')],'+',_0x50acf9,'=',_0x27f34d[_0xdc2e('0x71')]+_0x50acf9,')');}};Dialer[_0xdc2e('0xad')]['getDataPredictive']=function(_0x1880b9){var _0x1eb007=this;return function(_0x5d0c75){return new BPromise(function(_0x3e1467,_0x2fd91e){_[_0xdc2e('0x90')](_0x1880b9,_0x5d0c75[0x0]);if(checkGetDataPredictive(_0x5d0c75[0x0])){var _0x55cb91=_0x1880b9['predictiveIntervalAvailable']=_0x1880b9[_0xdc2e('0xa3')]+_0x1880b9['available'];var _0x183992=_0x1880b9[_0xdc2e('0x1db')]*0x3c;var _0x494b50=_0x5d0c75[0x0][_0xdc2e('0x6b')]+_0x5d0c75[0x0]['predictiveIntervalAvgHoldtime'];var _0x1a466f=(_0x5d0c75[0x0][_0xdc2e('0x69')]+_0x5d0c75[0x0][_0xdc2e('0x6c')]+_0x5d0c75[0x0][_0xdc2e('0x86')])/_0x5d0c75[0x0][_0xdc2e('0x72')];_0x1880b9['predictiveIntervalHitRate']=_0x1a466f>0x0?_0x1a466f:0x1;switch(_0x1880b9[_0xdc2e('0x1d4')]){case _0xdc2e('0x1d5'):var _0x4a03c8=_0x1880b9[_0xdc2e('0x1ca')]/0x64;return _0x1eb007[_0xdc2e('0x1e3')](_0x55cb91,_0x183992,_0x494b50,_0x1a466f,_0x4a03c8)[_0xdc2e('0x3b')](function(_0x33c49c){return _0x3e1467(_0x33c49c);});case'agentBusyFactor':var _0x56b558=_0x1880b9['dialPredictiveOptimizationPercentage']/0x64;return _0x1eb007[_0xdc2e('0x1e4')](_0x55cb91,_0x183992,_0x494b50,_0x1a466f,_0x56b558)[_0xdc2e('0x3b')](function(_0x5eac98){return _0x3e1467(_0x5eac98);});default:return _0x2fd91e(msgResponse(_0xdc2e('0x1e5'),_0xdc2e('0x14a'),'Unknown\x20Predictive'));}}else{return _0x2fd91e(msgResponse(_0xdc2e('0x1e5'),_0xdc2e('0x14a'),_0xdc2e('0x1e6')));}});};};Dialer[_0xdc2e('0xad')]['getDataPredictiveOld']=function(_0x197e5a){var _0x50a59a=this;return function(_0x200d78){return new BPromise(function(_0x5cdfbf,_0x300152){_['merge'](_0x197e5a,_0x200d78[0x0]);if(checkGetDataPredictive(_0x200d78[0x0])){loggerPredictive[_0xdc2e('0x81')](JSON[_0xdc2e('0x7a')](_0x200d78[0x0]));if(_0x197e5a['dialPredictiveOptimization']==='dropRate'){return _0x50a59a['getVoiceQueueRtPauses'](_0x197e5a['id'])[_0xdc2e('0x3b')](function(_0x181776){var _0x483004=_0x197e5a['loggedIn']-_0x181776[0x0][_0xdc2e('0x1e7')];var _0x59242c=_0x197e5a['dialPredictiveInterval']*0x3c;var _0x71809b=_0x200d78[0x0][_0xdc2e('0x6b')]+_0x200d78[0x0]['predictiveIntervalAvgHoldtime'];var _0x4294f1=(_0x200d78[0x0][_0xdc2e('0x69')]+_0x200d78[0x0][_0xdc2e('0x6c')]+_0x200d78[0x0][_0xdc2e('0x86')])/_0x200d78[0x0]['predictiveIntervalTotalCalls'];var _0x27f76e=_0x197e5a[_0xdc2e('0x1ca')]/0x64;_0x197e5a['predictiveIntervalPauses']=_0x181776[0x0][_0xdc2e('0x1e7')]||0x0;_0x197e5a[_0xdc2e('0x6f')]=_0x4294f1>0x0?_0x4294f1:0x1;return _0x50a59a[_0xdc2e('0x1e3')](_0x483004,_0x59242c,_0x71809b,_0x4294f1,_0x27f76e);})[_0xdc2e('0x3b')](function(_0x2fca1f){return _0x5cdfbf(_0x2fca1f);})[_0xdc2e('0xb6')](function(_0x2b7a60){return _0x300152(msgResponse(_0xdc2e('0x1e8'),_0xdc2e('0x14a'),JSON[_0xdc2e('0x7a')](_0x2b7a60)));});}if(_0x197e5a[_0xdc2e('0x1d4')]===_0xdc2e('0x1e9')){return _0x50a59a[_0xdc2e('0xcb')](_0x197e5a['id'])[_0xdc2e('0x3b')](function(_0x19e005){var _0x4962bc=_0x197e5a[_0xdc2e('0x4f')]-_0x19e005[0x0][_0xdc2e('0x1e7')];var _0x1a10e5=_0x197e5a['dialPredictiveInterval']*0x3c;var _0x174fc5=_0x200d78[0x0][_0xdc2e('0x6b')]+_0x200d78[0x0]['predictiveIntervalAvgHoldtime'];var _0x1a2fa2=(_0x200d78[0x0][_0xdc2e('0x69')]+_0x200d78[0x0][_0xdc2e('0x6c')]+_0x200d78[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x200d78[0x0][_0xdc2e('0x72')];var _0x357261=_0x197e5a[_0xdc2e('0x1ca')]/0x64;_0x197e5a[_0xdc2e('0x70')]=_0x19e005[0x0][_0xdc2e('0x1e7')]||0x0;_0x197e5a['predictiveIntervalHitRate']=_0x1a2fa2>0x0?_0x1a2fa2:0x1;return _0x50a59a[_0xdc2e('0x1e4')](_0x4962bc,_0x1a10e5,_0x174fc5,_0x1a2fa2,_0x357261);})['then'](function(_0x2f18ba){return _0x5cdfbf(_0x2f18ba);})[_0xdc2e('0xb6')](function(_0x2123da){return _0x300152(msgResponse('[CatchErlangB]',_0xdc2e('0x14a'),JSON[_0xdc2e('0x7a')](_0x2123da)));});}}else{return _0x300152(msgResponse(_0xdc2e('0x1e5'),'Failure',_0xdc2e('0x1e6')));}});};};Dialer['prototype'][_0xdc2e('0x1dd')]=function(_0x28a9c5){var _0x582640=this;return function(){var _0xc4a722=0x0;var _0x2dbbeb=Math[_0xdc2e('0x1ea')](_0x28a9c5[_0xdc2e('0x75')]*0x3e8);if(_0x2dbbeb>0x0){_0x2dbbeb=_0x2dbbeb<0x64?0x64:_0x2dbbeb;loggerPredictive[_0xdc2e('0x81')](_0x28a9c5[_0xdc2e('0x45')],_0xdc2e('0x1eb'),_0x2dbbeb,_0xdc2e('0x49'));_0x28a9c5[_0xdc2e('0x92')]=setInterval(function(){_0x582640['handlePredictive'](_0x28a9c5);loggerPredictiveCalls[_0xdc2e('0x81')](_0xdc2e('0x1ec'),_0xc4a722+=0x1);},_0x2dbbeb);}else{loggerPredictive[_0xdc2e('0x81')](_0x28a9c5[_0xdc2e('0x45')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xdc2e('0xad')][_0xdc2e('0x1ed')]=function(_0x64fbbc,_0x475735){var _0xe3b0f5=this;return function(_0x420a52){if(_['isEmpty'](_0x420a52)){if(_[_0xdc2e('0xdf')](_0x475735[_0xdc2e('0x1ee')])||!_0x475735[_0xdc2e('0x1ef')]){if(_0x64fbbc['dialMethod']===_0xdc2e('0xa')){_0x64fbbc[_0xdc2e('0x131')]=_[_0xdc2e('0x3d')](_0x64fbbc[_0xdc2e('0x131')])?!![]:_0x64fbbc[_0xdc2e('0x131')];var _0x56b4d5=uuid['v4']();_0xe3b0f5[_0xdc2e('0xb1')][_0x56b4d5]=new Action(_0x64fbbc,_0x475735,_0x56b4d5);loggerBooked[_0xdc2e('0x81')](_0xdc2e('0x1f0'),_0x56b4d5,_0xdc2e('0x1f1'),JSON[_0xdc2e('0x7a')](_0x64fbbc[_0xdc2e('0x131')]),_0xdc2e('0x1f2'),_0x64fbbc[_0xdc2e('0x45')]);if(_0x64fbbc[_0xdc2e('0x131')]){_0x64fbbc['queueStatusComplete']=![];_0xe3b0f5['queueBooked'][_0xe3b0f5['actions'][_0x56b4d5][_0xdc2e('0xb9')]]=[];ami[_0xdc2e('0xb4')]({'actionid':_0x56b4d5,'action':_0xdc2e('0x1f3'),'queue':_0x64fbbc[_0xdc2e('0x45')]})[_0xdc2e('0xb6')](function(){_0xe3b0f5[_0xdc2e('0xb8')](_0x64fbbc);_0xe3b0f5[_0xdc2e('0xc3')]({'active':![],'ContactId':_0xe3b0f5[_0xdc2e('0xb1')][_0x56b4d5][_0xdc2e('0xd3')],'ListId':_0xe3b0f5['actions'][_0x56b4d5][_0xdc2e('0xd4')],'VoiceQueueId':_0xe3b0f5[_0xdc2e('0xb1')][_0x56b4d5]['VoiceQueueId']||undefined,'CampaignId':_0xe3b0f5[_0xdc2e('0xb1')][_0x56b4d5][_0xdc2e('0xd6')]||undefined})[_0xdc2e('0xb6')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0xe3b0f5[_0xdc2e('0xb1')][_0x56b4d5];});}else{loggerBooked[_0xdc2e('0x81')](_0xdc2e('0x1f4'),JSON[_0xdc2e('0x7a')](_0x64fbbc[_0xdc2e('0x131')]),'Queue:\x20',_0x64fbbc[_0xdc2e('0x45')]);_0xe3b0f5[_0xdc2e('0xb8')](_0x64fbbc);_0xe3b0f5['rescheduleContact']({'active':![],'ContactId':_0xe3b0f5[_0xdc2e('0xb1')][_0x56b4d5][_0xdc2e('0xd3')],'ListId':_0xe3b0f5[_0xdc2e('0xb1')][_0x56b4d5][_0xdc2e('0xd4')],'VoiceQueueId':_0xe3b0f5[_0xdc2e('0xb1')][_0x56b4d5][_0xdc2e('0xd5')]||undefined,'CampaignId':_0xe3b0f5[_0xdc2e('0xb1')][_0x56b4d5][_0xdc2e('0xd6')]||undefined})[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x1f5')));delete _0xe3b0f5[_0xdc2e('0xb1')][_0x56b4d5];}}else{return _0xe3b0f5[_0xdc2e('0x1f6')](_0x64fbbc,_0x475735);}}else{if(getDiff(_0x475735[_0xdc2e('0x1f7')])<_0x64fbbc[_0xdc2e('0x1f8')]*0x3c){if(_0x475735[_0xdc2e('0x1f9')]&&!_0x475735[_0xdc2e('0x1f9')]['voicePause']){_0xe3b0f5['preview'][_0xdc2e('0x134')](_0x475735['id'])[_0xdc2e('0x1f')](function(){_0xe3b0f5[_0xdc2e('0xb8')](_0x64fbbc);});}else{_0xe3b0f5[_0xdc2e('0xc5')]({'active':![]},_0x475735['id'],0x1)[_0xdc2e('0x1f')](function(){_0xe3b0f5[_0xdc2e('0xb8')](_0x64fbbc);});}}else{_0x64fbbc[_0xdc2e('0x66')]+=0x1;_0xe3b0f5['updateOriginated'](_0x64fbbc);if(_0x64fbbc['dialRecallInQueue']){_0xe3b0f5['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x475735[_0xdc2e('0xd3')],'ListId':_0x475735['ListId'],'VoiceQueueId':_0x475735[_0xdc2e('0xd5')]||undefined,'CampaignId':_0x475735[_0xdc2e('0xd6')]||undefined})[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x1fa')));_0xe3b0f5['createHistory'](createObjHistory(_0x64fbbc,_0x475735,_0xdc2e('0x1fb'),0x17,'RecallInQueue'))[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x1fc')));}else{_0xe3b0f5[_0xdc2e('0xd1')](createObjHistory(_0x64fbbc,_0x475735,'RECALLFAILEDTIMEOUT',0x16,_0xdc2e('0x1fd')),'[Originate][HistoryRecallClose][historyCatch]',_0xdc2e('0x1fe'));}}}}else{_0x64fbbc['outboundBlacklistCallsDay']+=0x1;_0xe3b0f5[_0xdc2e('0xd1')](createObjHistory(_0x64fbbc,_0x475735,_0xdc2e('0x1ff'),0xd,_0xdc2e('0x200')),_0xdc2e('0x201'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0xdc2e('0xad')][_0xdc2e('0x163')]=function(_0x42e86f){var _0x42fafa=this;var _0x3085e9=_0x42e86f[_0xdc2e('0x202')]-_0x42e86f[_0xdc2e('0x73')]-_0x42e86f['temp'];emitCampaignSummary(_0x42e86f);if(_0x3085e9>0x0){if(_0x3085e9>this[_0xdc2e('0x26')]){_0x3085e9=this[_0xdc2e('0x26')];}_0x42e86f[_0xdc2e('0xc8')]+=_0x3085e9;this['getContactDialerIvr'](_0x42e86f['id'],_0x3085e9,_0x42e86f[_0xdc2e('0x203')],_0x42e86f)[_0xdc2e('0x3b')](function(_0x33c650){_0x42e86f[_0xdc2e('0xc8')]-=_0x3085e9;_0x42e86f[_0xdc2e('0xc8')]=_0x42e86f['temp']>0x0?_0x42e86f[_0xdc2e('0xc8')]:0x0;if(!checkContactEmpty(_0x33c650)){_0x42e86f[_0xdc2e('0x3e')]=_0xdc2e('0xa1');logger[_0xdc2e('0x81')](_0xdc2e('0x204')+_0x42e86f[_0xdc2e('0x45')]);}else{_0x42e86f[_0xdc2e('0x73')]+=_0x33c650[_0xdc2e('0x9a')];_0x42e86f[_0xdc2e('0x3e')]='RUNNING';for(var _0x3f6dde=0x0;_0x3f6dde<_0x33c650[_0xdc2e('0x9a')];_0x3f6dde+=0x1){_0x42e86f[_0xdc2e('0x205')]+=0x1;if(_[_0xdc2e('0xdf')](_0x33c650[_0x3f6dde])||_[_0xdc2e('0xdf')](_0x33c650[_0x3f6dde]['Contact'])||_['isNil'](_0x33c650[_0x3f6dde]['Contact'][_0xdc2e('0x172')])){_0x42fafa[_0xdc2e('0xcf')](_0xdc2e('0x206'),_0x42e86f,_0x33c650[_0x3f6dde]);}else{_0x42fafa[_0xdc2e('0xbf')](_[_0xdc2e('0xd2')](_0x33c650[_0x3f6dde],[_0xdc2e('0xd6'),_0xdc2e('0x207')]))[_0xdc2e('0x3b')](_0x42fafa[_0xdc2e('0x1ed')](_0x42e86f,_0x33c650[_0x3f6dde]))[_0xdc2e('0xb6')](_0x42fafa[_0xdc2e('0x208')](_0xdc2e('0x209'),_0x42e86f));}}}})['catch'](loggerGetContactDialer(_0xdc2e('0x20a'),_0x42e86f,_0x3085e9));}};Dialer['prototype']['handlePower']=function(_0x3ef6ff,_0xc5e134){var _0x315bac=this;var _0x34c773=[];var _0x38ee62=_0xc5e134>=0x1?_0xc5e134:0x1;if(_0x3ef6ff['dialMethod']===_0xdc2e('0xa')){_0x38ee62=0x1;}var _0x3324ed=Math['floor'](_0x3ef6ff[_0xdc2e('0x4e')]*_0x38ee62)-_0x3ef6ff[_0xdc2e('0x73')]-_0x3ef6ff[_0xdc2e('0xc8')];emitVoiceQueueSummary(_0x3ef6ff);if(_0x3ef6ff[_0xdc2e('0x20b')]>0x0){var _0x1a7ce0=_0x3ef6ff[_0xdc2e('0x20b')]-_0x3ef6ff[_0xdc2e('0x73')]-_0x3ef6ff[_0xdc2e('0xa3')]-_0x3ef6ff[_0xdc2e('0xc8')]-_0x3ef6ff['pTalking'];if(_0x3324ed>_0x1a7ce0){_0x3324ed=_0x1a7ce0;}}if(_0x3324ed>0x0){if(_0x3ef6ff['dialMethod']===_0xdc2e('0xa')){_0x3324ed=0x1;}if(_0x3324ed>this['maxNumberOriginate']){_0x3324ed=this[_0xdc2e('0x26')];}_0x3ef6ff[_0xdc2e('0xc8')]+=_0x3324ed;for(var _0x5691e4 in this[_0xdc2e('0x24')]){if(typeof this[_0xdc2e('0x24')][_0x5691e4]!==_0xdc2e('0x9b')){if(this['agents'][_0x5691e4][_0xdc2e('0xaa')]===_0xdc2e('0x20c')&&this[_0xdc2e('0x24')][_0x5691e4][_0xdc2e('0x12c')]===_0xdc2e('0xdd')){_0x34c773['push'](this[_0xdc2e('0x24')][_0x5691e4]['id']);}}}this[_0xdc2e('0xc7')](_0x3ef6ff['id'],_0x34c773,_0x3324ed,_0x3ef6ff['dialOrderByScheduledAt'],_0x3ef6ff)[_0xdc2e('0x3b')](function(_0x1b7df9){_0x3ef6ff['temp']-=_0x3324ed;_0x3ef6ff['temp']=_0x3ef6ff[_0xdc2e('0xc8')]>0x0?_0x3ef6ff[_0xdc2e('0xc8')]:0x0;if(!checkContactEmpty(_0x1b7df9)){_0x315bac['countReScheduled'](_0x3ef6ff)[_0xdc2e('0x3b')](sendMessageReschedule(_0x3ef6ff))['catch'](loggerCatch(_0xdc2e('0x20d')));}else{_0x3ef6ff[_0xdc2e('0x73')]+=_0x1b7df9[_0xdc2e('0x9a')];_0x3ef6ff['message']=_0x3ef6ff[_0xdc2e('0x59')]===_0xdc2e('0xa')?'ACTIVE':_0xdc2e('0x20e');for(var _0x550d59=0x0;_0x550d59<_0x1b7df9[_0xdc2e('0x9a')];_0x550d59+=0x1){if(_[_0xdc2e('0xdf')](_0x1b7df9[_0x550d59])||_[_0xdc2e('0xdf')](_0x1b7df9[_0x550d59][_0xdc2e('0x171')])||_[_0xdc2e('0xdf')](_0x1b7df9[_0x550d59][_0xdc2e('0x171')][_0xdc2e('0x172')])){_0x315bac['emptyContact'](_0xdc2e('0x206'),_0x3ef6ff,_0x1b7df9[_0x550d59]);}else{_0x315bac[_0xdc2e('0xbd')](_[_0xdc2e('0xd2')](_0x1b7df9[_0x550d59],[_0xdc2e('0xd5'),_0xdc2e('0x207')]))[_0xdc2e('0x3b')](_0x315bac[_0xdc2e('0x1ed')](_0x3ef6ff,_0x1b7df9[_0x550d59]))[_0xdc2e('0xb6')](_0x315bac[_0xdc2e('0x208')](_0xdc2e('0x206'),_0x3ef6ff));}}}})[_0xdc2e('0xb6')](loggerGetContactDialer('[getContactDialer2]',_0x3ef6ff,_0x3324ed));}};Dialer['prototype'][_0xdc2e('0x92')]=function(_0x3287c4){if(_0x3287c4['dialLimitQueue']>0x0){var _0x2e0ad9=_0x3287c4[_0xdc2e('0x20b')]-_0x3287c4['originated']-_0x3287c4['talking'];if(_0x2e0ad9>0x0){this[_0xdc2e('0x20f')](_0x3287c4);}else{loggerPredictiveCalls[_0xdc2e('0x81')]('[handlePredictive][limitChannel]');}}else{this[_0xdc2e('0x20f')](_0x3287c4);}};Dialer[_0xdc2e('0xad')][_0xdc2e('0x20f')]=function(_0x288b84){var _0x497503=this;var _0x2a65d3=[];_0x288b84[_0xdc2e('0x73')]+=0x1;for(var _0x4eedf3 in this[_0xdc2e('0x24')]){if(typeof this[_0xdc2e('0x24')][_0x4eedf3]!==_0xdc2e('0x9b')){if(this['agents'][_0x4eedf3][_0xdc2e('0xaa')]===_0xdc2e('0x20c')&&this['agents'][_0x4eedf3][_0xdc2e('0x12c')]===_0xdc2e('0xdd')){_0x2a65d3[_0xdc2e('0x12f')](this['agents'][_0x4eedf3]['id']);}}}this[_0xdc2e('0xc7')](_0x288b84['id'],_0x2a65d3,0x1,_0x288b84[_0xdc2e('0x203')],_0x288b84)[_0xdc2e('0x3b')](function(_0x290603){if(!checkContactEmpty(_0x290603)){checkContactLowerLimitOriginate(_0x288b84,0x1,0x0);_0x497503[_0xdc2e('0xbc')](_0x288b84)[_0xdc2e('0x3b')](sendMessageReschedule(_0x288b84))[_0xdc2e('0xb6')](loggerCatch(_0xdc2e('0x20d')));}else{_0x288b84[_0xdc2e('0x3e')]=_0xdc2e('0x20e');if(_['isNil'](_0x290603[0x0])||_['isNil'](_0x290603[0x0][_0xdc2e('0x171')])||_[_0xdc2e('0xdf')](_0x290603[0x0][_0xdc2e('0x171')][_0xdc2e('0x172')])){_0x497503[_0xdc2e('0xcf')](_0xdc2e('0x206'),_0x288b84,_0x290603[0x0]);}else{_0x497503[_0xdc2e('0xbd')](_[_0xdc2e('0xd2')](_0x290603[0x0],[_0xdc2e('0xd5'),_0xdc2e('0x207')]))['then'](_0x497503[_0xdc2e('0x1ed')](_0x288b84,_0x290603[0x0]))[_0xdc2e('0xb6')](_0x497503['loggerHandler']('[actionOriginatePredictive]\x20',_0x288b84));}}})[_0xdc2e('0xb6')](loggerGetContactDialer(_0xdc2e('0x210'),_0x288b84,0x1));emitVoiceQueueSummary(_0x288b84);};Dialer['prototype'][_0xdc2e('0x1e3')]=function(_0x13cf6d,_0x1d3b64,_0x345969,_0x3f6cc2,_0x127ce2,_0x27cc5b){loggerPredictive['info'](_0xdc2e('0x211'));loggerPredictive['info'](_0xdc2e('0x212'),_0x13cf6d);loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x213'),_0x1d3b64);loggerPredictive[_0xdc2e('0x81')]('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',_0x345969);loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x214'),_0x3f6cc2);loggerPredictive['info'](_0xdc2e('0x215'),_0x127ce2);loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x88'));return new BPromise(function(_0x345a16,_0x3e2601){if(_0x13cf6d<=0x0||isNaN(_0x13cf6d)){return _0x3e2601(msgResponse(_0xdc2e('0x216'),_0xdc2e('0x217'),_0xdc2e('0x218')+_0x13cf6d));}if(_0x345969<=0x0||isNaN(_0x345969)){return _0x3e2601(msgResponse('[abandonmentRate]',_0xdc2e('0x217'),_0xdc2e('0x219')+_0x345969));}if(_0x3f6cc2<=0x0||isNaN(_0x3f6cc2)){return _0x3e2601(msgResponse('[abandonmentRate]',_0xdc2e('0x217'),_0xdc2e('0x21a')+_0x3f6cc2));}if(_0x1d3b64<=0x0||isNaN(_0x1d3b64)){return _0x3e2601(msgResponse(_0xdc2e('0x216'),_0xdc2e('0x217'),_0xdc2e('0x21b')+_0x1d3b64));}if(_0x127ce2<=0x0||isNaN(_0x127ce2)){return _0x3e2601(msgResponse(_0xdc2e('0x216'),'Error','Amax\x20=\x20'+_0x127ce2));}_0x27cc5b=_0x27cc5b||0x0;var _0x3cc5fc=0x1/_0x345969;var _0x472350=0x0;var _0x3ac2d3=0x0;var _0x283aab=0x0;var _0x58194c=0x0;for(var _0x1fd959=0x0;_0x283aab<_0x127ce2;_0x1fd959+=0x1){_0x3ac2d3=_0x1fd959/_0x1d3b64;_0x472350=(_0x3f6cc2*_0x3ac2d3+_0x27cc5b)/_0x3cc5fc;_0x283aab=erlangb(_0x472350,_0x13cf6d);_0x58194c=_0x472350/_0x13cf6d*(0x1-erlangb(_0x472350,_0x13cf6d));}return _0x345a16({'erlangCalls':_0x1fd959,'erlangCallToSecond':_0x1d3b64/_0x1fd959,'erlangAbandonmentRate':_0x283aab,'erlangBusyFactor':_0x58194c});});};Dialer[_0xdc2e('0xad')]['busyFactor']=function(_0xc57317,_0x5697c6,_0x20b9e1,_0x49be03,_0x2234d5,_0x443449){loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x21c'));loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x212'),_0xc57317);loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x213'),_0x5697c6);loggerPredictive['info'](_0xdc2e('0x21d'),_0x20b9e1);loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x214'),_0x49be03);loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x21e'),_0x2234d5);loggerPredictive[_0xdc2e('0x81')](_0xdc2e('0x88'));return new BPromise(function(_0x501d83,_0x4c607b){if(_0xc57317<=0x0||isNaN(_0xc57317)){return _0x4c607b(msgResponse(_0xdc2e('0x21f'),_0xdc2e('0x217'),_0xdc2e('0x218')+_0xc57317));}if(_0x20b9e1<=0x0||isNaN(_0x20b9e1)){return _0x4c607b(msgResponse(_0xdc2e('0x21f'),_0xdc2e('0x217'),'Ts\x20=\x20'+_0x20b9e1));}if(_0x49be03<=0x0||isNaN(_0x49be03)){return _0x4c607b(msgResponse(_0xdc2e('0x21f'),_0xdc2e('0x217'),'p\x20=\x20'+_0x49be03));}if(_0x5697c6<=0x0||isNaN(_0x5697c6)){return _0x4c607b(msgResponse(_0xdc2e('0x21f'),_0xdc2e('0x217'),_0xdc2e('0x21b')+_0x5697c6));}if(_0x2234d5<=0x0||isNaN(_0x2234d5)){return _0x4c607b(msgResponse('[busyFactor]',_0xdc2e('0x217'),_0xdc2e('0x220')+_0x2234d5));}_0x443449=_0x443449||0x0;var _0x45f5ef=0x1/_0x20b9e1;var _0x2e0abb=0x0;var _0x1179e6=0x0;var _0x567a12=0x0;var _0x7eedac=0x0;for(var _0x579de0=0x0;_0x7eedac<_0x2234d5;_0x579de0+=0x1){_0x1179e6=_0x579de0/_0x5697c6;_0x2e0abb=(_0x49be03*_0x1179e6+_0x443449)/_0x45f5ef;_0x567a12=erlangb(_0x2e0abb,_0xc57317);_0x7eedac=_0x2e0abb/_0xc57317*(0x1-erlangb(_0x2e0abb,_0xc57317));}return _0x501d83({'erlangCalls':_0x579de0,'erlangCallToSecond':_0x5697c6/_0x579de0,'erlangAbandonmentRate':_0x567a12,'erlangBusyFactor':_0x7eedac});});};module[_0xdc2e('0x221')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index e4d921d..d09265d 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 _0xae0f=['recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','scheduledat','campaigntype','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','number','starttime','droptime','ringtime','responsetime','holdtime','talktime','membername','reason','callbackuniqueid','callbackat'];(function(_0x443449,_0x41247c){var _0xe93337=function(_0x299891){while(--_0x299891){_0x443449['push'](_0x443449['shift']());}};_0xe93337(++_0x41247c);}(_0xae0f,0x1d0));var _0xfae0=function(_0x5a83d,_0x2d22fc){_0x5a83d=_0x5a83d-0x0;var _0x1858d6=_0xae0f[_0x5a83d];return _0x1858d6;};'use strict';var util=require('util');var _=require(_0xfae0('0x0'));var moment=require(_0xfae0('0x1'));function getSeconds(_0x33757e,_0x463cf1){var _0x52c68d=moment(_0x33757e)[_0xfae0('0x2')](0x0);var _0x24110c=moment(_0x463cf1)[_0xfae0('0x2')](0x0);return _0x52c68d[_0xfae0('0x3')](_0x24110c,'seconds');}function QueueCallerAbandon(_0x391362,_0x576ffc){this['scheduledat']=_0x391362[_0xfae0('0x4')];this['type']=_0x391362['type'];this[_0xfae0('0x5')]=_0x391362[_0xfae0('0x6')]==='outbound'?_0xfae0('0x7'):_0x391362[_0xfae0('0x6')];this['countbusyretry']=_0x391362[_0xfae0('0x8')];this[_0xfae0('0x9')]=_0x391362[_0xfae0('0x9')];this[_0xfae0('0xa')]=_0x391362['countnoanswerretry'];this[_0xfae0('0xb')]=_0x391362[_0xfae0('0x8')]+_0x391362[_0xfae0('0x9')]+_0x391362[_0xfae0('0xa')]+_0x391362[_0xfae0('0xc')]+_0x391362[_0xfae0('0xd')]+_0x391362[_0xfae0('0xe')]+_0x391362[_0xfae0('0xf')]+_0x391362[_0xfae0('0x10')];this[_0xfae0('0xc')]=_0x391362[_0xfae0('0xc')];this['countdropretry']=_0x391362[_0xfae0('0xd')];this['countabandonedretry']=_0x391362[_0xfae0('0xe')];this[_0xfae0('0xf')]=_0x391362['countmachineretry'];this[_0xfae0('0x10')]=_0x391362[_0xfae0('0x10')];this['uniqueid']=_0x576ffc['uniqueid'];this['calleridname']=_0x391362[_0xfae0('0x11')];this[_0xfae0('0x12')]=_0x391362[_0xfae0('0x13')];this['starttime']=_0x391362[_0xfae0('0x14')];this['responsetime']=_0x391362['responsetime'];this['droptime']=_0x391362['droptime'];this['endtime']=this[_0xfae0('0x15')];this[_0xfae0('0x16')]=getSeconds(_0x391362[_0xfae0('0x17')],_0x391362[_0xfae0('0x14')]);this[_0xfae0('0x18')]=getSeconds(this[_0xfae0('0x15')],_0x391362['responsetime']);this[_0xfae0('0x19')]=0x0;this['queue']=_0x576ffc[_0xfae0('0x7')];this[_0xfae0('0x1a')]=_0x576ffc['connectedlinename'];this[_0xfae0('0x1b')]=_0x576ffc[_0xfae0('0x1b')];this['callback']=_0x391362['callback'];this[_0xfae0('0x1c')]=_0x391362[_0xfae0('0x1c')];this[_0xfae0('0x1d')]=_0x391362[_0xfae0('0x1d')];this[_0xfae0('0x1e')]=_0x391362[_0xfae0('0x1e')];this[_0xfae0('0x1f')]=_0x391362[_0xfae0('0x1f')];this['ListId']=_0x391362['ListId'];this[_0xfae0('0x20')]=_0x391362[_0xfae0('0x20')];this['VoiceQueueId']=_0x391362[_0xfae0('0x21')];this['CampaignId']=_0x391362[_0xfae0('0x22')];this[_0xfae0('0x23')]=_0x391362[_0xfae0('0x23')]||'';this[_0xfae0('0x24')]=_0x391362[_0xfae0('0x24')]||'';}module[_0xfae0('0x25')]=QueueCallerAbandon; \ No newline at end of file +var _0x357c=['moment','milliseconds','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x357c,0x68));var _0xc357=function(_0x37ded3,_0x371ebb){_0x37ded3=_0x37ded3-0x0;var _0x51e49e=_0x357c[_0x37ded3];return _0x51e49e;};'use strict';var util=require(_0xc357('0x0'));var _=require('lodash');var moment=require(_0xc357('0x1'));function getSeconds(_0x34a96e,_0x3827f1){var _0x48ae8b=moment(_0x34a96e)[_0xc357('0x2')](0x0);var _0x59cc46=moment(_0x3827f1)[_0xc357('0x2')](0x0);return _0x48ae8b['diff'](_0x59cc46,_0xc357('0x3'));}function QueueCallerAbandon(_0x3c95f1,_0x3bc380){this['scheduledat']=_0x3c95f1[_0xc357('0x4')];this['type']=_0x3c95f1[_0xc357('0x5')];this[_0xc357('0x6')]=_0x3c95f1[_0xc357('0x5')]==='outbound'?_0xc357('0x7'):_0x3c95f1[_0xc357('0x5')];this[_0xc357('0x8')]=_0x3c95f1[_0xc357('0x8')];this['countcongestionretry']=_0x3c95f1[_0xc357('0x9')];this[_0xc357('0xa')]=_0x3c95f1[_0xc357('0xa')];this['countglobal']=_0x3c95f1['countbusyretry']+_0x3c95f1[_0xc357('0x9')]+_0x3c95f1['countnoanswerretry']+_0x3c95f1[_0xc357('0xb')]+_0x3c95f1['countdropretry']+_0x3c95f1[_0xc357('0xc')]+_0x3c95f1[_0xc357('0xd')]+_0x3c95f1[_0xc357('0xe')];this[_0xc357('0xb')]=_0x3c95f1[_0xc357('0xb')];this['countdropretry']=_0x3c95f1['countdropretry'];this[_0xc357('0xc')]=_0x3c95f1['countabandonedretry'];this[_0xc357('0xd')]=_0x3c95f1[_0xc357('0xd')];this['countagentrejectretry']=_0x3c95f1[_0xc357('0xe')];this[_0xc357('0xf')]=_0x3bc380[_0xc357('0xf')];this[_0xc357('0x10')]=_0x3c95f1['name'];this['calleridnum']=_0x3c95f1['number'];this[_0xc357('0x11')]=_0x3c95f1[_0xc357('0x11')];this[_0xc357('0x12')]=_0x3c95f1[_0xc357('0x12')];this[_0xc357('0x13')]=_0x3c95f1[_0xc357('0x13')];this[_0xc357('0x14')]=this[_0xc357('0x13')];this[_0xc357('0x15')]=getSeconds(_0x3c95f1[_0xc357('0x12')],_0x3c95f1[_0xc357('0x11')]);this[_0xc357('0x16')]=getSeconds(this['droptime'],_0x3c95f1[_0xc357('0x12')]);this[_0xc357('0x17')]=0x0;this[_0xc357('0x7')]=_0x3bc380[_0xc357('0x7')];this['membername']=_0x3bc380['connectedlinename'];this[_0xc357('0x18')]=_0x3bc380[_0xc357('0x18')];this[_0xc357('0x19')]=_0x3c95f1[_0xc357('0x19')];this[_0xc357('0x1a')]=_0x3c95f1['callbackuniqueid'];this[_0xc357('0x1b')]=_0x3c95f1['callbackat'];this[_0xc357('0x1c')]=_0x3c95f1[_0xc357('0x1c')];this['ContactId']=_0x3c95f1['ContactId'];this[_0xc357('0x1d')]=_0x3c95f1[_0xc357('0x1d')];this['UserId']=_0x3c95f1[_0xc357('0x1e')];this[_0xc357('0x1f')]=_0x3c95f1[_0xc357('0x1f')];this['CampaignId']=_0x3c95f1[_0xc357('0x20')];this['originatecalleridnum']=_0x3c95f1['originatecalleridnum']||'';this[_0xc357('0x21')]=_0x3c95f1['originatecalleridname']||'';}module[_0xc357('0x22')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index af8fa4c..53a2d9c 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(_0x567b1f,_0x55f5a6){var _0x4a904f=function(_0x4a54fb){while(--_0x4a54fb){_0x567b1f['push'](_0x567b1f['shift']());}};_0x4a904f(++_0x55f5a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x619b2b,_0x1d9197){var _0x127b24=function(_0x56e052){while(--_0x56e052){_0x619b2b['push'](_0x619b2b['shift']());}};_0x127b24(++_0x1d9197);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 3f9c725..6627932 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 _0xd8b0=['\x20result\x20conversion\x20file\x20','message','create','application/pdf','notify','calleridnum','.pdf','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','pick','AttachmentId','update','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk\x20Reachable','format','parse','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','util','lodash','path','tiff2pdf','./util/gs','../../../config/logger','fax','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','channelstate','channelstatedesc','value','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/'];(function(_0x4ad997,_0x64b4d3){var _0x1fb10c=function(_0x16922d){while(--_0x16922d){_0x4ad997['push'](_0x4ad997['shift']());}};_0x1fb10c(++_0x64b4d3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var path=require(_0x0d8b('0x2'));var tiff2pdf=require(_0x0d8b('0x3'));var gs=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0x0d8b('0x7'));var ut=require(_0x0d8b('0x8'));var Action=require(_0x0d8b('0x9'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x0d8b('0xa'));var faxMessage=require(_0x0d8b('0xb'));function Fax(_0x58e4e2){this[_0x0d8b('0xc')]={};this[_0x0d8b('0xd')]=_0x58e4e2[_0x0d8b('0xd')];this[_0x0d8b('0xe')]=_0x58e4e2[_0x0d8b('0xe')];this[_0x0d8b('0xf')]={};ami['on'](_0x0d8b('0x10'),this[_0x0d8b('0x11')]['bind'](this));ami['on'](_0x0d8b('0x12'),this['syncVarSet'][_0x0d8b('0x13')](this));ami['on'](_0x0d8b('0x14'),this[_0x0d8b('0x15')][_0x0d8b('0x13')](this));ami['on'](_0x0d8b('0x16'),this[_0x0d8b('0x17')][_0x0d8b('0x13')](this));ami['on'](_0x0d8b('0x18'),this[_0x0d8b('0x19')][_0x0d8b('0x13')](this));ami['on'](_0x0d8b('0x1a'),this[_0x0d8b('0x1b')][_0x0d8b('0x13')](this));ami['on'](_0x0d8b('0x1c'),this['syncHangup'][_0x0d8b('0x13')](this));ami['on'](_0x0d8b('0x1d'),this[_0x0d8b('0x1e')][_0x0d8b('0x13')](this));}Fax[_0x0d8b('0x1f')]['syncNewchannel']=function(_0x106a01){if(_0x106a01[_0x0d8b('0x20')]===_0x0d8b('0x21')){for(var _0x5fecbd in this[_0x0d8b('0xd')]){if(this[_0x0d8b('0xd')][_0x0d8b('0x22')](_0x5fecbd)){if(_0x106a01[_0x0d8b('0x23')]===this['faxAccounts'][_0x5fecbd][_0x0d8b('0x24')]){this[_0x0d8b('0xc')][_0x106a01[_0x0d8b('0x25')]]={};this[_0x0d8b('0xc')][_0x106a01[_0x0d8b('0x25')]][_0x0d8b('0x26')]=_0x106a01[_0x0d8b('0x26')];this[_0x0d8b('0xc')][_0x106a01['uniqueid']]['id']=this['faxAccounts'][_0x5fecbd]['id'];this[_0x0d8b('0xc')][_0x106a01['uniqueid']]['name']=this['faxAccounts'][_0x5fecbd][_0x0d8b('0x27')];logger[_0x0d8b('0x28')](_0x106a01[_0x0d8b('0x25')],_0x0d8b('0x29'));}}}}if(this[_0x0d8b('0xf')][_0x106a01[_0x0d8b('0x25')]]){this[_0x0d8b('0xc')][_0x106a01[_0x0d8b('0x25')]]={};this[_0x0d8b('0xc')][_0x106a01['uniqueid']][_0x0d8b('0x26')]=_0x106a01[_0x0d8b('0x26')];logger['info'](_0x106a01[_0x0d8b('0x25')],'\x20syncNewchannel\x20');}};Fax[_0x0d8b('0x1f')][_0x0d8b('0x2a')]=function(_0xa2af02){if(this['channels'][_0xa2af02['uniqueid']]){for(var _0x28f639 in _0xa2af02[_0x0d8b('0x2b')]){if(_0xa2af02['variable'][_0x0d8b('0x22')](_0x28f639)){this['channels'][_0xa2af02[_0x0d8b('0x25')]][_0x28f639]=_0xa2af02['value'];}}}};Fax[_0x0d8b('0x1f')]['syncNewState']=function(_0x2ab00d){if(this['channels'][_0x2ab00d[_0x0d8b('0x25')]]){this['channels'][_0x2ab00d[_0x0d8b('0x25')]][_0x0d8b('0x2c')]=_0x2ab00d[_0x0d8b('0x2c')];this['channels'][_0x2ab00d['uniqueid']]['channelstatedesc']=_0x2ab00d[_0x0d8b('0x2d')];}};Fax['prototype'][_0x0d8b('0x17')]=function(_0x54f6f3){if(this['channels'][_0x54f6f3[_0x0d8b('0x25')]]){for(var _0x1b6920 in _0x54f6f3[_0x0d8b('0x2b')]){if(_0x54f6f3[_0x0d8b('0x2b')][_0x0d8b('0x22')](_0x1b6920)){this[_0x0d8b('0xc')][_0x54f6f3[_0x0d8b('0x25')]][_0x1b6920]=_0x54f6f3[_0x0d8b('0x2e')];}}}};Fax['prototype'][_0x0d8b('0x19')]=function(_0x3ef48d){if(this['channels'][_0x3ef48d[_0x0d8b('0x25')]]){this[_0x0d8b('0xc')][_0x3ef48d[_0x0d8b('0x25')]]['operation']=_0x3ef48d[_0x0d8b('0x2f')];this[_0x0d8b('0xc')][_0x3ef48d[_0x0d8b('0x25')]][_0x0d8b('0x30')]=_0x3ef48d[_0x0d8b('0x30')];this['channels'][_0x3ef48d[_0x0d8b('0x25')]][_0x0d8b('0x24')]=_0x3ef48d['localstationid'];this[_0x0d8b('0xc')][_0x3ef48d[_0x0d8b('0x25')]][_0x0d8b('0x31')]=_0x3ef48d[_0x0d8b('0x31')];logger[_0x0d8b('0x28')](_0x3ef48d['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0x0d8b('0x1f')]['syncReceiveFax']=function(_0x531c55){var _0xc179bd=this;if(this[_0x0d8b('0xc')][_0x531c55[_0x0d8b('0x25')]]){var _0x1388b1=this[_0x0d8b('0xc')][_0x531c55[_0x0d8b('0x25')]]['id'];this['channels'][_0x531c55[_0x0d8b('0x25')]][_0x0d8b('0x32')]=_0x531c55[_0x0d8b('0x32')];this[_0x0d8b('0xc')][_0x531c55[_0x0d8b('0x25')]][_0x0d8b('0x33')]=_0x531c55[_0x0d8b('0x33')];this['channels'][_0x531c55[_0x0d8b('0x25')]][_0x0d8b('0x24')]=_0x531c55[_0x0d8b('0x24')];this[_0x0d8b('0xc')][_0x531c55['uniqueid']][_0x0d8b('0x34')]=_0x531c55['resolution'];this[_0x0d8b('0xc')][_0x531c55[_0x0d8b('0x25')]][_0x0d8b('0x35')]=_0x531c55[_0x0d8b('0x35')];this[_0x0d8b('0xc')][_0x531c55[_0x0d8b('0x25')]][_0x0d8b('0x31')]=_0x531c55[_0x0d8b('0x31')];this[_0x0d8b('0xc')][_0x531c55[_0x0d8b('0x25')]]['calleridnum']=_0x531c55['calleridnum'];if(this['channels'][_0x531c55['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x531c55[_0x0d8b('0x31')],_0x0d8b('0x36'),function(_0x1e2433){logger['info'](_0x531c55['uniqueid'],_0x0d8b('0x37'),_0x1e2433[_0x0d8b('0x38')]);attachment[_0x0d8b('0x39')]({'name':path['parse'](_0x531c55[_0x0d8b('0x31')])[_0x0d8b('0x27')],'basename':path['parse'](_0x531c55['filename'])[_0x0d8b('0x27')]+'.pdf','type':_0x0d8b('0x3a')})['then'](function(_0x53f643){faxAccount[_0x0d8b('0x3b')](_0x1388b1,{'from':_0x531c55[_0x0d8b('0x3c')],'mapKey':'fax','body':path['parse'](_0x531c55['filename'])['name']+_0x0d8b('0x3d'),'AttachmentId':_0x53f643['id']})[_0x0d8b('0x3e')](function(_0xd9d4c3){logger['error'](_0x531c55[_0x0d8b('0x25')],_0x0d8b('0x3f'),JSON[_0x0d8b('0x40')](_0xd9d4c3));});})[_0x0d8b('0x3e')](function(_0x423ecd){logger[_0x0d8b('0x41')](_0x531c55[_0x0d8b('0x25')],_0x0d8b('0x42'),JSON[_0x0d8b('0x40')](_0x423ecd));});});}logger[_0x0d8b('0x28')](_0x531c55[_0x0d8b('0x25')],_0x0d8b('0x42'));}};Fax[_0x0d8b('0x1f')][_0x0d8b('0x1e')]=function(_0x570af8){if(this[_0x0d8b('0xf')][_0x570af8[_0x0d8b('0x25')]]){_[_0x0d8b('0x43')](this[_0x0d8b('0xc')][_0x570af8['uniqueid']],_[_0x0d8b('0x44')](_0x570af8,['response','reason']));}};function updateStatus(_0x39a31d){if(_0x39a31d[_0x0d8b('0x45')]){faxMessage[_0x0d8b('0x46')](_0x39a31d[_0x0d8b('0x45')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x0d8b('0x47')](function(_0x1106d6){ut[_0x0d8b('0x48')](_0x0d8b('0x49'),_0x1106d6);})[_0x0d8b('0x3e')](function(_0x4cd85a){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x4cd85a);});}else{ut['logger'](_0x0d8b('0x4a'));}}Fax[_0x0d8b('0x1f')]['updateStatus']=function(_0x4950a8,_0x44c5c1,_0x3d3cb6){var _0x5c5bd7=this;var _0x5ef6c3={};if(_0x44c5c1){_0x5ef6c3={'read':_0x44c5c1};}else{_0x5ef6c3={'failMessage':_0x3d3cb6};}if(this[_0x0d8b('0xf')][_0x4950a8][_0x0d8b('0x45')]){faxMessage[_0x0d8b('0x46')](this[_0x0d8b('0xf')][_0x4950a8][_0x0d8b('0x45')],_0x5ef6c3)['then'](function(_0x2de903){ut[_0x0d8b('0x48')]('[Fax][Message][Updated]',_0x2de903);})['catch'](function(_0xf6a773){ut[_0x0d8b('0x48')]('[Fax][Message][NoUpdate1]',_0xf6a773);})['finally'](function(){delete _0x5c5bd7[_0x0d8b('0xc')][_0x4950a8];delete _0x5c5bd7[_0x0d8b('0xf')][_0x4950a8];});}else{ut[_0x0d8b('0x48')](_0x0d8b('0x4b'));delete this['channels'][_0x4950a8];delete this[_0x0d8b('0xf')][_0x4950a8];}};Fax['prototype']['syncHangup']=function(_0x38c24e){var _0x44043b=this;if(this['channels'][_0x38c24e['uniqueid']]){if(this[_0x0d8b('0xf')][_0x38c24e[_0x0d8b('0x25')]]){this[_0x0d8b('0xc')][_0x38c24e[_0x0d8b('0x25')]]['id']=this[_0x0d8b('0xf')][_0x38c24e[_0x0d8b('0x25')]]['id'];this[_0x0d8b('0xc')][_0x38c24e[_0x0d8b('0x25')]]['name']=this[_0x0d8b('0xf')][_0x38c24e[_0x0d8b('0x25')]][_0x0d8b('0x27')];}logger[_0x0d8b('0x28')](_0x38c24e[_0x0d8b('0x25')],this[_0x0d8b('0xf')][_0x38c24e[_0x0d8b('0x25')]]?_0x0d8b('0x4c'):_0x0d8b('0x4d'),JSON['stringify'](this[_0x0d8b('0xc')][_0x38c24e[_0x0d8b('0x25')]]));if(this[_0x0d8b('0xf')][_0x38c24e[_0x0d8b('0x25')]]){if(this[_0x0d8b('0xc')][_0x38c24e['uniqueid']][_0x0d8b('0x4e')]>0x0&&this[_0x0d8b('0xc')][_0x38c24e[_0x0d8b('0x25')]][_0x0d8b('0x18')]===_0x0d8b('0x4f')){this['updateStatus'](_0x38c24e['uniqueid'],!![]);}else{this[_0x0d8b('0x50')](_0x38c24e[_0x0d8b('0x25')],![],this[_0x0d8b('0xc')][_0x38c24e[_0x0d8b('0x25')]]['faxstatusstring']?_0x0d8b('0x51')+this[_0x0d8b('0xc')][_0x38c24e[_0x0d8b('0x25')]]['faxstatusstring']:_0x0d8b('0x52'));}}}};Fax['prototype'][_0x0d8b('0x53')]=function(_0x3ed63e){var _0x1efce6=this;return new BPromise(function(_0x26ccf0,_0x2b6eb6){_0x1efce6[_0x0d8b('0x54')](_0x3ed63e,_0x1efce6['faxAccounts'][_0x3ed63e[_0x0d8b('0x55')]])['then'](function(_0x71e8d8){ut[_0x0d8b('0x48')](_0x0d8b('0x56'),_0x71e8d8);_0x26ccf0(ut[_0x0d8b('0x38')]('Fax\x20received'));})[_0x0d8b('0x3e')](function(_0x34d01f){ut[_0x0d8b('0x48')](_0x0d8b('0x57'),_0x34d01f);updateStatus(_0x3ed63e);_0x2b6eb6(ut[_0x0d8b('0x38')](_0x0d8b('0x58')));});});};Fax[_0x0d8b('0x1f')][_0x0d8b('0x59')]=function(_0x2ce282){var _0x34affb=this;return new BPromise(function(_0x57e39a,_0x4ee1e8){var _0x6388ae=_0x34affb[_0x0d8b('0x5a')](_0x34affb['faxAccounts'][_0x2ce282[_0x0d8b('0x55')]]['Trunk'],_0x2ce282);if(_0x6388ae['isValid']){_0x57e39a(ut[_0x0d8b('0x38')](_0x0d8b('0x5b')));}else{_0x4ee1e8(ut['message'](_0x6388ae['message']));}});};function originate(_0x1900e3,_0x1c007b,_0x70e4b2){return new BPromise(function(_0x435090,_0x2ab72b){if(_0x70e4b2){var _0x156859=util[_0x0d8b('0x5c')]('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[_0x0d8b('0x5d')](_0x1900e3['path'])[_0x0d8b('0x27')],_0x1900e3[_0x0d8b('0x2')]);gs[_0x0d8b('0x5e')](_0x156859)[_0x0d8b('0x47')](function(){_0x1900e3['path']=util[_0x0d8b('0x5c')]('%s/%s.tif',path[_0x0d8b('0x5d')](_0x1900e3[_0x0d8b('0x2')])[_0x0d8b('0x5f')],path[_0x0d8b('0x5d')](_0x1900e3[_0x0d8b('0x2')])[_0x0d8b('0x27')]);_0x1c007b[_0x0d8b('0x60')]=_0x1900e3[_0x0d8b('0x2')];ut[_0x0d8b('0x48')](_0x0d8b('0x61'),'');ami['Action'](ut[_0x0d8b('0x62')](_0x1900e3,_0x1c007b))['then'](function(_0x3e4121){_0x435090(_0x3e4121);})[_0x0d8b('0x3e')](function(_0x52c458){_0x2ab72b(_0x52c458);});})[_0x0d8b('0x3e')](function(_0x56e03c){_0x2ab72b(_0x56e03c);});}else{ami[_0x0d8b('0x63')](ut[_0x0d8b('0x62')](_0x1900e3,_0x1c007b))[_0x0d8b('0x47')](function(_0x259ac9){_0x435090(_0x259ac9);})[_0x0d8b('0x3e')](function(_0x299f98){_0x2ab72b(_0x299f98);});}});}Fax[_0x0d8b('0x1f')][_0x0d8b('0x54')]=function(_0x4bde46,_0x10eca6){var _0x8ca59e=this;return new BPromise(function(_0x5b2916,_0x191a5a){var _0x105df9=uuid['v4']();var _0x303d6=ut[_0x0d8b('0x64')](_0x4bde46,_0x10eca6);_0x8ca59e[_0x0d8b('0xf')][_0x105df9]=new Action(_0x105df9,_0x10eca6,_0x4bde46);var _0x9e44b4=_0x8ca59e[_0x0d8b('0xf')][_0x105df9];if(path[_0x0d8b('0x5d')](_0x4bde46[_0x0d8b('0x2')])[_0x0d8b('0x65')]===_0x0d8b('0x3d')){originate(_0x9e44b4,_0x303d6,!![])[_0x0d8b('0x47')](function(_0x50c0ff){_0x5b2916(_0x50c0ff);})[_0x0d8b('0x3e')](function(_0x93fc55){_0x191a5a(_0x93fc55);});}else{originate(_0x9e44b4,_0x303d6,![])[_0x0d8b('0x47')](function(_0x58525c){_0x5b2916(_0x58525c);})['catch'](function(_0xebca83){_0x191a5a(_0xebca83);});}});};Fax[_0x0d8b('0x1f')][_0x0d8b('0x66')]=function(_0x5b76af){return!_['isNil'](_0x5b76af)&&!_[_0x0d8b('0x67')](_0x5b76af[_0x0d8b('0x27')])&&!_[_0x0d8b('0x67')](_0x5b76af[_0x0d8b('0x68')])&&_0x5b76af[_0x0d8b('0x68')]&&!_[_0x0d8b('0x67')](this[_0x0d8b('0xe')][util[_0x0d8b('0x5c')](_0x0d8b('0x69'),_0x5b76af[_0x0d8b('0x27')])])&&!_[_0x0d8b('0x67')](this[_0x0d8b('0xe')][util[_0x0d8b('0x5c')]('SIP/%s',_0x5b76af[_0x0d8b('0x27')])][_0x0d8b('0x30')])&&(this['trunks'][util['format'](_0x0d8b('0x69'),_0x5b76af[_0x0d8b('0x27')])][_0x0d8b('0x30')]===_0x0d8b('0x6a')||this[_0x0d8b('0xe')][util[_0x0d8b('0x5c')]('SIP/%s',_0x5b76af['name'])]['status']===_0x0d8b('0x6b'));};Fax[_0x0d8b('0x1f')][_0x0d8b('0x5a')]=function(_0x28f9b7,_0x3f1eee){if(!this[_0x0d8b('0x66')](_0x28f9b7)){ut['logger'](_0x0d8b('0x6c'),_[_0x0d8b('0x67')](_0x28f9b7)?'':_0x28f9b7['name']+_0x0d8b('0x6d'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x0d8b('0x67')](_0x3f1eee[_0x0d8b('0x6')])){ut[_0x0d8b('0x48')](_0x0d8b('0x6e'),JSON[_0x0d8b('0x40')](_0x3f1eee));return{'isValid':![],'message':_0x0d8b('0x6f')};}if(_[_0x0d8b('0x67')](_0x3f1eee[_0x0d8b('0x2')])){ut[_0x0d8b('0x48')](_0x0d8b('0x70'),JSON[_0x0d8b('0x40')](_0x3f1eee));return{'isValid':![],'message':_0x0d8b('0x71')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file +var _0xe605=['XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','format','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','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','faxAccounts','trunks','actions','newchannel','bind','syncVarSet','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncOriginateResponse','syncNewchannel','context','from-voip-provider','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','hasOwnProperty','syncNewState','channelstate','value','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','AttachmentId','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','execute','%s/%s.tif'];(function(_0x58d990,_0x4f416f){var _0x582505=function(_0xb95e77){while(--_0xb95e77){_0x58d990['push'](_0x58d990['shift']());}};_0x582505(++_0x4f416f);}(_0xe605,0x92));var _0x5e60=function(_0x302268,_0x435912){_0x302268=_0x302268-0x0;var _0x9b69b9=_0xe605[_0x302268];return _0x9b69b9;};'use strict';var util=require(_0x5e60('0x0'));var _=require(_0x5e60('0x1'));var BPromise=require('bluebird');var uuid=require(_0x5e60('0x2'));var moment=require(_0x5e60('0x3'));var path=require(_0x5e60('0x4'));var tiff2pdf=require(_0x5e60('0x5'));var gs=require(_0x5e60('0x6'));var logger=require(_0x5e60('0x7'))(_0x5e60('0x8'));var ami=require(_0x5e60('0x9'));var rpcDb=require(_0x5e60('0xa'));var Channel=require(_0x5e60('0xb'));var ut=require(_0x5e60('0xc'));var Action=require(_0x5e60('0xd'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x5e60('0xe'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x593118){this['channels']={};this[_0x5e60('0xf')]=_0x593118[_0x5e60('0xf')];this[_0x5e60('0x10')]=_0x593118[_0x5e60('0x10')];this[_0x5e60('0x11')]={};ami['on'](_0x5e60('0x12'),this['syncNewchannel'][_0x5e60('0x13')](this));ami['on']('varset',this[_0x5e60('0x14')][_0x5e60('0x13')](this));ami['on'](_0x5e60('0x15'),this['syncNewState'][_0x5e60('0x13')](this));ami['on'](_0x5e60('0x16'),this[_0x5e60('0x17')][_0x5e60('0x13')](this));ami['on'](_0x5e60('0x18'),this[_0x5e60('0x19')]['bind'](this));ami['on'](_0x5e60('0x1a'),this[_0x5e60('0x1b')][_0x5e60('0x13')](this));ami['on'](_0x5e60('0x1c'),this['syncHangup'][_0x5e60('0x13')](this));ami['on']('originateresponse',this[_0x5e60('0x1d')][_0x5e60('0x13')](this));}Fax['prototype'][_0x5e60('0x1e')]=function(_0x3e1a44){if(_0x3e1a44[_0x5e60('0x1f')]===_0x5e60('0x20')){for(var _0x5c485d in this[_0x5e60('0xf')]){if(this[_0x5e60('0xf')]['hasOwnProperty'](_0x5c485d)){if(_0x3e1a44[_0x5e60('0x21')]===this[_0x5e60('0xf')][_0x5c485d][_0x5e60('0x22')]){this[_0x5e60('0x23')][_0x3e1a44[_0x5e60('0x24')]]={};this[_0x5e60('0x23')][_0x3e1a44[_0x5e60('0x24')]][_0x5e60('0x25')]=_0x3e1a44[_0x5e60('0x25')];this[_0x5e60('0x23')][_0x3e1a44[_0x5e60('0x24')]]['id']=this['faxAccounts'][_0x5c485d]['id'];this[_0x5e60('0x23')][_0x3e1a44['uniqueid']][_0x5e60('0x26')]=this[_0x5e60('0xf')][_0x5c485d][_0x5e60('0x26')];logger[_0x5e60('0x27')](_0x3e1a44[_0x5e60('0x24')],_0x5e60('0x28'));}}}}if(this[_0x5e60('0x11')][_0x3e1a44['uniqueid']]){this[_0x5e60('0x23')][_0x3e1a44[_0x5e60('0x24')]]={};this[_0x5e60('0x23')][_0x3e1a44['uniqueid']][_0x5e60('0x25')]=_0x3e1a44[_0x5e60('0x25')];logger[_0x5e60('0x27')](_0x3e1a44[_0x5e60('0x24')],'\x20syncNewchannel\x20');}};Fax[_0x5e60('0x29')]['syncVarSet']=function(_0x23d187){if(this[_0x5e60('0x23')][_0x23d187['uniqueid']]){for(var _0x46691f in _0x23d187[_0x5e60('0x2a')]){if(_0x23d187['variable'][_0x5e60('0x2b')](_0x46691f)){this[_0x5e60('0x23')][_0x23d187['uniqueid']][_0x46691f]=_0x23d187['value'];}}}};Fax['prototype'][_0x5e60('0x2c')]=function(_0x235cc7){if(this[_0x5e60('0x23')][_0x235cc7[_0x5e60('0x24')]]){this[_0x5e60('0x23')][_0x235cc7['uniqueid']][_0x5e60('0x2d')]=_0x235cc7[_0x5e60('0x2d')];this['channels'][_0x235cc7[_0x5e60('0x24')]]['channelstatedesc']=_0x235cc7['channelstatedesc'];}};Fax[_0x5e60('0x29')][_0x5e60('0x17')]=function(_0x1f474b){if(this[_0x5e60('0x23')][_0x1f474b[_0x5e60('0x24')]]){for(var _0xbf5b7a in _0x1f474b[_0x5e60('0x2a')]){if(_0x1f474b[_0x5e60('0x2a')][_0x5e60('0x2b')](_0xbf5b7a)){this[_0x5e60('0x23')][_0x1f474b['uniqueid']][_0xbf5b7a]=_0x1f474b[_0x5e60('0x2e')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x478415){if(this[_0x5e60('0x23')][_0x478415['uniqueid']]){this[_0x5e60('0x23')][_0x478415['uniqueid']][_0x5e60('0x2f')]=_0x478415[_0x5e60('0x2f')];this[_0x5e60('0x23')][_0x478415[_0x5e60('0x24')]][_0x5e60('0x30')]=_0x478415[_0x5e60('0x30')];this[_0x5e60('0x23')][_0x478415[_0x5e60('0x24')]]['localstationid']=_0x478415[_0x5e60('0x22')];this[_0x5e60('0x23')][_0x478415[_0x5e60('0x24')]][_0x5e60('0x31')]=_0x478415[_0x5e60('0x31')];logger[_0x5e60('0x27')](_0x478415[_0x5e60('0x24')],'\x20syncFaxStatus\x20');}};Fax[_0x5e60('0x29')][_0x5e60('0x1b')]=function(_0x4cba18){var _0x532ab2=this;if(this[_0x5e60('0x23')][_0x4cba18[_0x5e60('0x24')]]){var _0x1ae294=this[_0x5e60('0x23')][_0x4cba18[_0x5e60('0x24')]]['id'];this['channels'][_0x4cba18[_0x5e60('0x24')]][_0x5e60('0x32')]=_0x4cba18[_0x5e60('0x32')];this[_0x5e60('0x23')][_0x4cba18[_0x5e60('0x24')]][_0x5e60('0x33')]=_0x4cba18[_0x5e60('0x33')];this['channels'][_0x4cba18[_0x5e60('0x24')]][_0x5e60('0x22')]=_0x4cba18['localstationid'];this['channels'][_0x4cba18['uniqueid']][_0x5e60('0x34')]=_0x4cba18[_0x5e60('0x34')];this[_0x5e60('0x23')][_0x4cba18[_0x5e60('0x24')]]['transferrate']=_0x4cba18[_0x5e60('0x35')];this[_0x5e60('0x23')][_0x4cba18['uniqueid']]['filename']=_0x4cba18[_0x5e60('0x31')];this[_0x5e60('0x23')][_0x4cba18[_0x5e60('0x24')]][_0x5e60('0x36')]=_0x4cba18[_0x5e60('0x36')];if(this[_0x5e60('0x23')][_0x4cba18[_0x5e60('0x24')]][_0x5e60('0x33')]>0x0){tiff2pdf(_0x4cba18[_0x5e60('0x31')],'/var/opt/motion2/server/files/attachments/',function(_0x284e66){logger[_0x5e60('0x27')](_0x4cba18['uniqueid'],_0x5e60('0x37'),_0x284e66[_0x5e60('0x38')]);attachment[_0x5e60('0x39')]({'name':path[_0x5e60('0x3a')](_0x4cba18[_0x5e60('0x31')])['name'],'basename':path[_0x5e60('0x3a')](_0x4cba18[_0x5e60('0x31')])[_0x5e60('0x26')]+_0x5e60('0x3b'),'type':'application/pdf'})['then'](function(_0x5b9f5a){faxAccount[_0x5e60('0x3c')](_0x1ae294,{'from':_0x4cba18[_0x5e60('0x36')],'mapKey':_0x5e60('0x8'),'body':path[_0x5e60('0x3a')](_0x4cba18[_0x5e60('0x31')])[_0x5e60('0x26')]+'.pdf','AttachmentId':_0x5b9f5a['id']})[_0x5e60('0x3d')](function(_0x1c48d0){logger[_0x5e60('0x3e')](_0x4cba18[_0x5e60('0x24')],_0x5e60('0x3f'),JSON[_0x5e60('0x40')](_0x1c48d0));});})[_0x5e60('0x3d')](function(_0x4acd96){logger[_0x5e60('0x3e')](_0x4cba18[_0x5e60('0x24')],_0x5e60('0x41'),JSON[_0x5e60('0x40')](_0x4acd96));});});}logger[_0x5e60('0x27')](_0x4cba18[_0x5e60('0x24')],_0x5e60('0x41'));}};Fax[_0x5e60('0x29')][_0x5e60('0x1d')]=function(_0x350d6d){if(this[_0x5e60('0x11')][_0x350d6d[_0x5e60('0x24')]]){_[_0x5e60('0x42')](this[_0x5e60('0x23')][_0x350d6d[_0x5e60('0x24')]],_[_0x5e60('0x43')](_0x350d6d,[_0x5e60('0x44'),_0x5e60('0x45')]));}};function updateStatus(_0x54479d){if(_0x54479d['AttachmentId']){faxMessage[_0x5e60('0x46')](_0x54479d['AttachmentId'],{'failMessage':_0x5e60('0x47')})[_0x5e60('0x48')](function(_0x20d6e6){ut[_0x5e60('0x49')](_0x5e60('0x4a'),_0x20d6e6);})[_0x5e60('0x3d')](function(_0x4b72a4){ut['logger'](_0x5e60('0x4b'),_0x4b72a4);});}else{ut[_0x5e60('0x49')](_0x5e60('0x4c'));}}Fax['prototype']['updateStatus']=function(_0x31ced8,_0x46f3ba,_0x179cc6){var _0x501b87=this;var _0x1a3ed9={};if(_0x46f3ba){_0x1a3ed9={'read':_0x46f3ba};}else{_0x1a3ed9={'failMessage':_0x179cc6};}if(this[_0x5e60('0x11')][_0x31ced8][_0x5e60('0x4d')]){faxMessage[_0x5e60('0x46')](this[_0x5e60('0x11')][_0x31ced8][_0x5e60('0x4d')],_0x1a3ed9)['then'](function(_0x412be1){ut[_0x5e60('0x49')]('[Fax][Message][Updated]',_0x412be1);})[_0x5e60('0x3d')](function(_0x3f6a1e){ut[_0x5e60('0x49')]('[Fax][Message][NoUpdate1]',_0x3f6a1e);})[_0x5e60('0x4e')](function(){delete _0x501b87[_0x5e60('0x23')][_0x31ced8];delete _0x501b87['actions'][_0x31ced8];});}else{ut[_0x5e60('0x49')](_0x5e60('0x4f'));delete this[_0x5e60('0x23')][_0x31ced8];delete this[_0x5e60('0x11')][_0x31ced8];}};Fax['prototype'][_0x5e60('0x50')]=function(_0x1abc43){var _0x4ded96=this;if(this[_0x5e60('0x23')][_0x1abc43['uniqueid']]){if(this[_0x5e60('0x11')][_0x1abc43['uniqueid']]){this[_0x5e60('0x23')][_0x1abc43[_0x5e60('0x24')]]['id']=this['actions'][_0x1abc43[_0x5e60('0x24')]]['id'];this['channels'][_0x1abc43[_0x5e60('0x24')]]['name']=this[_0x5e60('0x11')][_0x1abc43['uniqueid']][_0x5e60('0x26')];}logger[_0x5e60('0x27')](_0x1abc43[_0x5e60('0x24')],this[_0x5e60('0x11')][_0x1abc43[_0x5e60('0x24')]]?_0x5e60('0x51'):_0x5e60('0x52'),JSON['stringify'](this[_0x5e60('0x23')][_0x1abc43[_0x5e60('0x24')]]));if(this[_0x5e60('0x11')][_0x1abc43[_0x5e60('0x24')]]){if(this[_0x5e60('0x23')][_0x1abc43[_0x5e60('0x24')]]['faxpages']>0x0&&this['channels'][_0x1abc43['uniqueid']][_0x5e60('0x18')]===_0x5e60('0x53')){this['updateStatus'](_0x1abc43[_0x5e60('0x24')],!![]);}else{this[_0x5e60('0x54')](_0x1abc43['uniqueid'],![],this[_0x5e60('0x23')][_0x1abc43[_0x5e60('0x24')]][_0x5e60('0x55')]?_0x5e60('0x56')+this[_0x5e60('0x23')][_0x1abc43[_0x5e60('0x24')]][_0x5e60('0x55')]:_0x5e60('0x57'));}}}};Fax[_0x5e60('0x29')][_0x5e60('0x58')]=function(_0x157aad){var _0x15921d=this;return new BPromise(function(_0xc5f45,_0x2826f7){_0x15921d[_0x5e60('0x59')](_0x157aad,_0x15921d[_0x5e60('0xf')][_0x157aad[_0x5e60('0x5a')]])['then'](function(_0x922817){ut[_0x5e60('0x49')](_0x5e60('0x5b'),_0x922817);_0xc5f45(ut['message'](_0x5e60('0x5c')));})[_0x5e60('0x3d')](function(_0x58376d){ut[_0x5e60('0x49')](_0x5e60('0x5d'),_0x58376d);updateStatus(_0x157aad);_0x2826f7(ut['message'](_0x5e60('0x5e')));});});};Fax[_0x5e60('0x29')][_0x5e60('0x5f')]=function(_0xd9a0db){var _0x1db659=this;return new BPromise(function(_0x711888,_0x221f35){var _0x3b5493=_0x1db659[_0x5e60('0x60')](_0x1db659['faxAccounts'][_0xd9a0db[_0x5e60('0x5a')]][_0x5e60('0x61')],_0xd9a0db);if(_0x3b5493[_0x5e60('0x62')]){_0x711888(ut['message'](_0x5e60('0x63')));}else{_0x221f35(ut[_0x5e60('0x38')](_0x3b5493[_0x5e60('0x38')]));}});};function originate(_0x15d975,_0x3e85fe,_0x559f8c){return new BPromise(function(_0x4560e1,_0x213c7e){if(_0x559f8c){var _0x3463a7=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[_0x5e60('0x3a')](_0x15d975[_0x5e60('0x4')])[_0x5e60('0x26')],_0x15d975[_0x5e60('0x4')]);gs[_0x5e60('0x64')](_0x3463a7)[_0x5e60('0x48')](function(){_0x15d975[_0x5e60('0x4')]=util['format'](_0x5e60('0x65'),path[_0x5e60('0x3a')](_0x15d975[_0x5e60('0x4')])['dir'],path['parse'](_0x15d975[_0x5e60('0x4')])[_0x5e60('0x26')]);_0x3e85fe[_0x5e60('0x66')]=_0x15d975['path'];ut['logger'](_0x5e60('0x67'),'');ami[_0x5e60('0x68')](ut[_0x5e60('0x69')](_0x15d975,_0x3e85fe))[_0x5e60('0x48')](function(_0x42c62d){_0x4560e1(_0x42c62d);})[_0x5e60('0x3d')](function(_0x4a1e15){_0x213c7e(_0x4a1e15);});})[_0x5e60('0x3d')](function(_0x406a74){_0x213c7e(_0x406a74);});}else{ami[_0x5e60('0x68')](ut[_0x5e60('0x69')](_0x15d975,_0x3e85fe))[_0x5e60('0x48')](function(_0x1750b5){_0x4560e1(_0x1750b5);})[_0x5e60('0x3d')](function(_0x92d9c5){_0x213c7e(_0x92d9c5);});}});}Fax[_0x5e60('0x29')]['execOriginate']=function(_0x34cfa7,_0x136464){var _0x48570a=this;return new BPromise(function(_0x306e7c,_0x26508b){var _0x530a21=uuid['v4']();var _0x312ae3=ut[_0x5e60('0x6a')](_0x34cfa7,_0x136464);_0x48570a[_0x5e60('0x11')][_0x530a21]=new Action(_0x530a21,_0x136464,_0x34cfa7);var _0x1b4aee=_0x48570a[_0x5e60('0x11')][_0x530a21];if(path[_0x5e60('0x3a')](_0x34cfa7['path'])[_0x5e60('0x6b')]===_0x5e60('0x3b')){originate(_0x1b4aee,_0x312ae3,!![])[_0x5e60('0x48')](function(_0x222d94){_0x306e7c(_0x222d94);})[_0x5e60('0x3d')](function(_0xd70e8f){_0x26508b(_0xd70e8f);});}else{originate(_0x1b4aee,_0x312ae3,![])[_0x5e60('0x48')](function(_0x3f6bb2){_0x306e7c(_0x3f6bb2);})[_0x5e60('0x3d')](function(_0x58e900){_0x26508b(_0x58e900);});}});};Fax[_0x5e60('0x29')][_0x5e60('0x6c')]=function(_0x71d909){return!_[_0x5e60('0x6d')](_0x71d909)&&!_[_0x5e60('0x6d')](_0x71d909[_0x5e60('0x26')])&&!_[_0x5e60('0x6d')](_0x71d909[_0x5e60('0x6e')])&&_0x71d909[_0x5e60('0x6e')]&&!_[_0x5e60('0x6d')](this['trunks'][util['format']('SIP/%s',_0x71d909[_0x5e60('0x26')])])&&!_[_0x5e60('0x6d')](this[_0x5e60('0x10')][util[_0x5e60('0x6f')](_0x5e60('0x70'),_0x71d909[_0x5e60('0x26')])][_0x5e60('0x30')])&&(this[_0x5e60('0x10')][util[_0x5e60('0x6f')]('SIP/%s',_0x71d909[_0x5e60('0x26')])][_0x5e60('0x30')]===_0x5e60('0x71')||this['trunks'][util[_0x5e60('0x6f')]('SIP/%s',_0x71d909['name'])]['status']===_0x5e60('0x72'));};Fax[_0x5e60('0x29')][_0x5e60('0x60')]=function(_0x148c53,_0x445e6a){if(!this[_0x5e60('0x6c')](_0x148c53)){ut[_0x5e60('0x49')](_0x5e60('0x73'),_[_0x5e60('0x6d')](_0x148c53)?'':_0x148c53['name']+_0x5e60('0x74'));return{'isValid':![],'message':_0x5e60('0x75')};}if(_[_0x5e60('0x6d')](_0x445e6a[_0x5e60('0x8')])){ut[_0x5e60('0x49')](_0x5e60('0x76'),JSON[_0x5e60('0x40')](_0x445e6a));return{'isValid':![],'message':_0x5e60('0x77')};}if(_[_0x5e60('0x6d')](_0x445e6a[_0x5e60('0x4')])){ut[_0x5e60('0x49')](_0x5e60('0x78'),JSON['stringify'](_0x445e6a));return{'isValid':![],'message':_0x5e60('0x79')};}return{'isValid':!![],'message':_0x5e60('0x7a')};};module[_0x5e60('0x7b')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 3f218bb..fed983b 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 _0x556c=['inspect','notify','resolve','then','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error'];(function(_0x3367b7,_0x1e0234){var _0x52bb97=function(_0x2155f2){while(--_0x2155f2){_0x3367b7['push'](_0x3367b7['shift']());}};_0x52bb97(++_0x1e0234);}(_0x556c,0xa1));var _0xc556=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x556c[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xc556('0x0'));var BPromise=require(_0xc556('0x1'));var logger=require(_0xc556('0x2'))(_0xc556('0x3'));var _=require(_0xc556('0x4'));var faxAccount=require(_0xc556('0x5'));function loggerCatch(_0x9d4950){return function(_0x3d0d11){logger[_0xc556('0x6')](_0x9d4950,util[_0xc556('0x7')](_0x3d0d11,{'showHidden':![],'depth':null}));};}exports[_0xc556('0x8')]=function(_0x384e6f,_0x10061b){return BPromise[_0xc556('0x9')]()[_0xc556('0xa')](faxAccount[_0xc556('0x8')](_0x384e6f,_0x10061b))['catch'](loggerCatch(_0xc556('0xb')));}; \ No newline at end of file +var _0x4180=['notify','resolve','[Notify]\x20','util','bluebird','../rpc/faxAccount','error','inspect'];(function(_0x52d07f,_0x5097d0){var _0x3c5bb7=function(_0x3b8660){while(--_0x3b8660){_0x52d07f['push'](_0x52d07f['shift']());}};_0x3c5bb7(++_0x5097d0);}(_0x4180,0x7b));var _0x0418=function(_0x4440ca,_0x249301){_0x4440ca=_0x4440ca-0x0;var _0x1881ff=_0x4180[_0x4440ca];return _0x1881ff;};'use strict';var util=require(_0x0418('0x0'));var BPromise=require(_0x0418('0x1'));var logger=require('../../../config/logger')('preview');var _=require('lodash');var faxAccount=require(_0x0418('0x2'));function loggerCatch(_0x1df631){return function(_0x32393a){logger[_0x0418('0x3')](_0x1df631,util[_0x0418('0x4')](_0x32393a,{'showHidden':![],'depth':null}));};}exports[_0x0418('0x5')]=function(_0x40acc8,_0x28d2b3){return BPromise[_0x0418('0x6')]()['then'](faxAccount[_0x0418('0x5')](_0x40acc8,_0x28d2b3))['catch'](loggerCatch(_0x0418('0x7')));}; \ 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 dd0a4f2..d6b1b75 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 _0xcf01=['bluebird','child_process','exec','execute','Exec\x20gs','info','\x20Error\x20:','inspect','util','fax'];(function(_0x1db863,_0x14dd91){var _0x4910ce=function(_0xe7ff99){while(--_0xe7ff99){_0x1db863['push'](_0x1db863['shift']());}};_0x4910ce(++_0x14dd91);}(_0xcf01,0x15c));var _0x1cf0=function(_0x51bb38,_0x4e57a0){_0x51bb38=_0x51bb38-0x0;var _0x51c09b=_0xcf01[_0x51bb38];return _0x51c09b;};'use strict';var util=require(_0x1cf0('0x0'));var logger=require('../../../../config/logger')(_0x1cf0('0x1'));var BPromise=require(_0x1cf0('0x2'));var exec=require(_0x1cf0('0x3'))[_0x1cf0('0x4')];exports[_0x1cf0('0x5')]=function(_0x7173bb){return new BPromise(function(_0xb7b773,_0x75d5ab){exec(_0x7173bb,function(_0x1e447f,_0x322154,_0x1781ea){logger['info'](_0x1cf0('0x6'),_0x322154);if(_0x1e447f){logger[_0x1cf0('0x7')]('Exec\x20gs',_0x1cf0('0x8'),util[_0x1cf0('0x9')](_0x1e447f,{'showHidden':![],'depth':null}),_0x322154,_0x1781ea);_0x75d5ab(_0x1e447f);}_0xb7b773(_0x322154);});});}; \ No newline at end of file +var _0x22db=['inspect','util','../../../../config/logger','fax','bluebird','child_process','Exec\x20gs'];(function(_0x27b526,_0x3cb233){var _0xe67a38=function(_0x686f93){while(--_0x686f93){_0x27b526['push'](_0x27b526['shift']());}};_0xe67a38(++_0x3cb233);}(_0x22db,0x1c1));var _0xb22d=function(_0x2f8db7,_0x5a7566){_0x2f8db7=_0x2f8db7-0x0;var _0x5c1d7e=_0x22db[_0x2f8db7];return _0x5c1d7e;};'use strict';var util=require(_0xb22d('0x0'));var logger=require(_0xb22d('0x1'))(_0xb22d('0x2'));var BPromise=require(_0xb22d('0x3'));var exec=require(_0xb22d('0x4'))['exec'];exports['execute']=function(_0x12f43b){return new BPromise(function(_0x29869d,_0x10ecf2){exec(_0x12f43b,function(_0x1b6343,_0x5d23c3,_0x580804){logger['info'](_0xb22d('0x5'),_0x5d23c3);if(_0x1b6343){logger['info'](_0xb22d('0x5'),'\x20Error\x20:',util[_0xb22d('0x6')](_0x1b6343,{'showHidden':![],'depth':null}),_0x5d23c3,_0x580804);_0x10ecf2(_0x1b6343);}_0x29869d(_0x5d23c3);});});}; \ 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 0a6eca5..d5f1494 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 _0xf4f3=['headerinfo','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','minrate','format','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>'];(function(_0x1634fd,_0x53b8d3){var _0x304512=function(_0xa0c4e0){while(--_0xa0c4e0){_0x1634fd['push'](_0x1634fd['shift']());}};_0x304512(++_0x53b8d3);}(_0xf4f3,0x171));var _0x3f4f=function(_0x520bcc,_0x58fece){_0x520bcc=_0x520bcc-0x0;var _0x4ac8e0=_0xf4f3[_0x520bcc];return _0x4ac8e0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3f4f('0x0'));var logger=require(_0x3f4f('0x1'))(_0x3f4f('0x2'));exports[_0x3f4f('0x3')]=function(_0x38df68){return{'message':_0x38df68};};exports[_0x3f4f('0x4')]=function(_0x162a6f,_0x1a5e8f){logger[_0x3f4f('0x5')](_0x162a6f,util[_0x3f4f('0x6')](_0x1a5e8f,{'showHidden':![],'depth':null}));};exports[_0x3f4f('0x7')]=function(_0x33fafe,_0x75918){var _0x24146a={'XMF-ECM':_0x75918[_0x3f4f('0x8')],'XMF-HEADERINFO':_0x75918['headerinfo'],'XMF-MINRATE':_0x75918[_0x3f4f('0x9')],'XMF-MAXRATE':_0x75918['maxrate'],'XMF-MODEM':util[_0x3f4f('0xa')](_0x3f4f('0xb'),_0x75918['modem']),'XMF-GATEWAY':_0x75918[_0x3f4f('0xc')],'XMF-FAXDETECT':_0x75918[_0x3f4f('0xd')],'XMF-T38TIMEOUT':_0x75918[_0x3f4f('0xe')],'XMF-LOCALSTATIONID':_0x75918[_0x3f4f('0xf')],'XMF-PATH':_0x33fafe[_0x3f4f('0x10')]};return _0x24146a;};exports[_0x3f4f('0x11')]=function(_0x3133b0,_0x5cd28a){return{'actionid':_0x3133b0[_0x3f4f('0x12')],'action':'originate','channel':_0x3133b0['channel'],'Exten':_0x3f4f('0x13'),'Context':_0x3f4f('0x14'),'Priority':'1','callerid':util[_0x3f4f('0xa')](_0x3f4f('0x15'),_0x3133b0[_0x3f4f('0x16')]?_0x3133b0[_0x3f4f('0x16')]:'',_0x3133b0[_0x3f4f('0xf')]),'variable':_0x5cd28a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3133b0[_0x3f4f('0x12')]};}; \ No newline at end of file +var _0x89a1=['info','ecm','headerinfo','minrate','maxrate','modem','t38timeout','localstationid','path','originate','channel','xcally-motion-fax','format','\x22%s\x22\x20<%s>','util','moment','../../../../config/logger','fax','message'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x89a1,0x1d6));var _0x189a=function(_0x40a43e,_0x34cb70){_0x40a43e=_0x40a43e-0x0;var _0x272fc2=_0x89a1[_0x40a43e];return _0x272fc2;};'use strict';var util=require(_0x189a('0x0'));var _=require('lodash');var moment=require(_0x189a('0x1'));var logger=require(_0x189a('0x2'))(_0x189a('0x3'));exports[_0x189a('0x4')]=function(_0x4bc4d6){return{'message':_0x4bc4d6};};exports['logger']=function(_0x556adb,_0x5abcd1){logger[_0x189a('0x5')](_0x556adb,util['inspect'](_0x5abcd1,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x224238,_0x3276ae){var _0x40a1e8={'XMF-ECM':_0x3276ae[_0x189a('0x6')],'XMF-HEADERINFO':_0x3276ae[_0x189a('0x7')],'XMF-MINRATE':_0x3276ae[_0x189a('0x8')],'XMF-MAXRATE':_0x3276ae[_0x189a('0x9')],'XMF-MODEM':util['format']('\x22%s\x22',_0x3276ae[_0x189a('0xa')]),'XMF-GATEWAY':_0x3276ae['gateway'],'XMF-FAXDETECT':_0x3276ae['faxdetect'],'XMF-T38TIMEOUT':_0x3276ae[_0x189a('0xb')],'XMF-LOCALSTATIONID':_0x3276ae[_0x189a('0xc')],'XMF-PATH':_0x224238[_0x189a('0xd')]};return _0x40a1e8;};exports['variablesAction']=function(_0x1aef7e,_0x6f48e8){return{'actionid':_0x1aef7e['uniqueid'],'action':_0x189a('0xe'),'channel':_0x1aef7e[_0x189a('0xf')],'Exten':_0x189a('0x10'),'Context':'from-sip','Priority':'1','callerid':util[_0x189a('0x11')](_0x189a('0x12'),_0x1aef7e[_0x189a('0x7')]?_0x1aef7e[_0x189a('0x7')]:'',_0x1aef7e[_0x189a('0xc')]),'variable':_0x6f48e8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1aef7e['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index fe4ee5c..a4eb959 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 _0x8422=['initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','util','moment','./server','./realtime','./report','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','getAgents','then','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','initDeskAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts'];(function(_0x413f05,_0x17d257){var _0xf54f79=function(_0x1ce14d){while(--_0x1ce14d){_0x413f05['push'](_0x413f05['shift']());}};_0xf54f79(++_0x17d257);}(_0x8422,0x1b7));var _0x2842=function(_0x42c6f1,_0x338d7b){_0x42c6f1=_0x42c6f1-0x0;var _0x3c7398=_0x8422[_0x42c6f1];return _0x3c7398;};'use strict';var BPromise=require(_0x2842('0x0'));var util=require(_0x2842('0x1'));var moment=require(_0x2842('0x2'));var server=require(_0x2842('0x3'));var Realtime=require(_0x2842('0x4'));var Report=require(_0x2842('0x5'));var Acw=require('./acw');var Trigger=require(_0x2842('0x6'));var Dialer=require(_0x2842('0x7'));var Preview=require('./preview');var Fax=require(_0x2842('0x8'));var user=require(_0x2842('0x9'));var voiceQueue=require(_0x2842('0xa'));var voiceQueueReport=require(_0x2842('0xb'));var voiceCallReport=require(_0x2842('0xc'));var trunk=require(_0x2842('0xd'));var trigger=require(_0x2842('0xe'));var template=require('./rpc/template');var cmHopperHistory=require(_0x2842('0xf'));var campaign=require(_0x2842('0x10'));var voiceExtension=require(_0x2842('0x11'));var faxAccount=require(_0x2842('0x12'));var zendesk=require(_0x2842('0x13'));var salesforce=require(_0x2842('0x14'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x2842('0x15'));var desk=require(_0x2842('0x16'));var zoho=require(_0x2842('0x17'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x2842('0x18'));var dynamics365=require(_0x2842('0x19'));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(_0x2842('0x1a'))(_0x2842('0x1b'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x2842('0x1c')](_0x2842('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x2842('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user[_0x2842('0x1e')]())[_0x2842('0x1f')](realtime['initAgents']())['then'](user[_0x2842('0x20')]())[_0x2842('0x1f')](realtime[_0x2842('0x21')]())[_0x2842('0x1f')](trunk[_0x2842('0x22')]())[_0x2842('0x1f')](realtime[_0x2842('0x23')]())['then'](voiceQueue[_0x2842('0x24')]())[_0x2842('0x1f')](realtime['initVoiceQueues']())[_0x2842('0x1f')](trigger['getTriggers']())['then'](realtime[_0x2842('0x25')]())['then'](template[_0x2842('0x26')]())['then'](realtime[_0x2842('0x27')]())['then'](zendesk[_0x2842('0x28')]())[_0x2842('0x1f')](realtime[_0x2842('0x29')]())[_0x2842('0x1f')](salesforce['getSalesforceAccounts']())[_0x2842('0x1f')](realtime['initSalesforceAccounts']())[_0x2842('0x1f')](sugarcrm[_0x2842('0x2a')]())[_0x2842('0x1f')](realtime[_0x2842('0x2b')]())[_0x2842('0x1f')](freshdesk['getFreshdeskAccounts']())[_0x2842('0x1f')](realtime[_0x2842('0x2c')]())['then'](desk['getDeskAccounts']())[_0x2842('0x1f')](realtime[_0x2842('0x2d')]())[_0x2842('0x1f')](zoho['getZohoAccounts']())['then'](realtime['initZohoAccounts']())[_0x2842('0x1f')](vtiger[_0x2842('0x2e')]())['then'](realtime[_0x2842('0x2f')]())['then'](freshsales[_0x2842('0x30')]())[_0x2842('0x1f')](realtime[_0x2842('0x31')]())['then'](servicenow[_0x2842('0x32')]())[_0x2842('0x1f')](realtime[_0x2842('0x33')]())[_0x2842('0x1f')](dynamics365[_0x2842('0x34')]())[_0x2842('0x1f')](realtime[_0x2842('0x35')]())['then'](campaign['getCampaigns']())['then'](realtime[_0x2842('0x36')]())[_0x2842('0x1f')](voiceExtension['getVoiceExtensions']())[_0x2842('0x1f')](realtime[_0x2842('0x37')]())[_0x2842('0x1f')](faxAccount[_0x2842('0x38')]())[_0x2842('0x1f')](realtime[_0x2842('0x39')]())[_0x2842('0x1f')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x2842('0x1f')](voiceQueueReport[_0x2842('0x3a')]())['then'](realtime[_0x2842('0x3b')]())[_0x2842('0x1f')](cmHopperHistory[_0x2842('0x3c')]())[_0x2842('0x1f')](realtime[_0x2842('0x3d')]())[_0x2842('0x1f')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0x2842('0x3e')]())[_0x2842('0x1f')](voiceCallReport[_0x2842('0x3f')]())['then'](realtime['initVoiceCallReports']())['catch'](function(_0x2c2ba1){logger[_0x2842('0x40')](_0x2842('0x41'),util[_0x2842('0x42')](_0x2c2ba1,{'showHidden':![],'depth':null}));});}function main(){return server[_0x2842('0x43')](realtime,preview,fax)[_0x2842('0x1f')](function(_0x3f6ca0){return initRealtime();})['then'](function(){return initParams();})[_0x2842('0x1f')](function(){report[_0x2842('0x44')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x15238f){logger[_0x2842('0x40')](_0x2842('0x45'),util['inspect'](_0x15238f,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x19b6=['./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getSalesforceAccounts','getSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','catch','error','[index.js][initParams]','inspect','listen','sync','bluebird','moment','./server','./realtime','./acw','./trigger','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/campaign'];(function(_0x333330,_0x5787c2){var _0x5e4ceb=function(_0x4f3cbb){while(--_0x4f3cbb){_0x333330['push'](_0x333330['shift']());}};_0x5e4ceb(++_0x5787c2);}(_0x19b6,0x167));var _0x619b=function(_0x5eca50,_0xc1e3f8){_0x5eca50=_0x5eca50-0x0;var _0x41fb84=_0x19b6[_0x5eca50];return _0x41fb84;};'use strict';var BPromise=require(_0x619b('0x0'));var util=require('util');var moment=require(_0x619b('0x1'));var server=require(_0x619b('0x2'));var Realtime=require(_0x619b('0x3'));var Report=require('./report');var Acw=require(_0x619b('0x4'));var Trigger=require(_0x619b('0x5'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x619b('0x6'));var user=require('./rpc/user');var voiceQueue=require(_0x619b('0x7'));var voiceQueueReport=require(_0x619b('0x8'));var voiceCallReport=require(_0x619b('0x9'));var trunk=require(_0x619b('0xa'));var trigger=require(_0x619b('0xb'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x619b('0xc'));var voiceExtension=require(_0x619b('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x619b('0xe'));var salesforce=require(_0x619b('0xf'));var sugarcrm=require(_0x619b('0x10'));var freshdesk=require(_0x619b('0x11'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x619b('0x12'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x619b('0x13'));var dynamics365=require(_0x619b('0x14'));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(_0x619b('0x15'))(_0x619b('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x619b('0x17')](_0x619b('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x619b('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x619b('0x19')]()[_0x619b('0x1a')](user['getAgents']())[_0x619b('0x1a')](realtime[_0x619b('0x1b')]())[_0x619b('0x1a')](user['getTelephones']())[_0x619b('0x1a')](realtime[_0x619b('0x1c')]())[_0x619b('0x1a')](trunk[_0x619b('0x1d')]())['then'](realtime['initTrunks']())[_0x619b('0x1a')](voiceQueue[_0x619b('0x1e')]())[_0x619b('0x1a')](realtime[_0x619b('0x1f')]())[_0x619b('0x1a')](trigger[_0x619b('0x20')]())[_0x619b('0x1a')](realtime['initTriggers']())[_0x619b('0x1a')](template[_0x619b('0x21')]())[_0x619b('0x1a')](realtime[_0x619b('0x22')]())[_0x619b('0x1a')](zendesk['getZendeskAccounts']())['then'](realtime['initZendeskAccounts']())[_0x619b('0x1a')](salesforce[_0x619b('0x23')]())['then'](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x619b('0x24')]())['then'](realtime['initSugarcrmAccounts']())[_0x619b('0x1a')](freshdesk['getFreshdeskAccounts']())[_0x619b('0x1a')](realtime[_0x619b('0x25')]())[_0x619b('0x1a')](desk[_0x619b('0x26')]())['then'](realtime[_0x619b('0x27')]())[_0x619b('0x1a')](zoho[_0x619b('0x28')]())['then'](realtime[_0x619b('0x29')]())['then'](vtiger['getVtigerAccounts']())[_0x619b('0x1a')](realtime['initVtigerAccounts']())[_0x619b('0x1a')](freshsales[_0x619b('0x2a')]())[_0x619b('0x1a')](realtime[_0x619b('0x2b')]())[_0x619b('0x1a')](servicenow['getServicenowAccounts']())['then'](realtime[_0x619b('0x2c')]())[_0x619b('0x1a')](dynamics365[_0x619b('0x2d')]())[_0x619b('0x1a')](realtime[_0x619b('0x2e')]())[_0x619b('0x1a')](campaign[_0x619b('0x2f')]())[_0x619b('0x1a')](realtime[_0x619b('0x30')]())[_0x619b('0x1a')](voiceExtension[_0x619b('0x31')]())[_0x619b('0x1a')](realtime[_0x619b('0x32')]())['then'](faxAccount['getFaxAccounts']())[_0x619b('0x1a')](realtime[_0x619b('0x33')]())[_0x619b('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x619b('0x19')]()[_0x619b('0x1a')](voiceQueueReport['getVoiceQueueReports']())[_0x619b('0x1a')](realtime[_0x619b('0x34')]())[_0x619b('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x619b('0x1a')](realtime[_0x619b('0x35')]())[_0x619b('0x1a')](cmHopperHistory[_0x619b('0x36')]())[_0x619b('0x1a')](realtime[_0x619b('0x37')]())[_0x619b('0x1a')](voiceCallReport['getVoiceCallReports']())[_0x619b('0x1a')](realtime['initVoiceCallReports']())[_0x619b('0x38')](function(_0x4ca92f){logger[_0x619b('0x39')](_0x619b('0x3a'),util[_0x619b('0x3b')](_0x4ca92f,{'showHidden':![],'depth':null}));});}function main(){return server[_0x619b('0x3c')](realtime,preview,fax)[_0x619b('0x1a')](function(_0x4a0ef5){return initRealtime();})[_0x619b('0x1a')](function(){return initParams();})[_0x619b('0x1a')](function(){report[_0x619b('0x3d')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x5b42fd){logger['error']('[index.js][main]',util[_0x619b('0x3b')](_0x5b42fd,{'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 c59fa70..a00a4aa 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 _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x43171f,_0x43b445){var _0x1dcd07=function(_0x71e817){while(--_0x71e817){_0x43171f['push'](_0x43171f['shift']());}};_0x1dcd07(++_0x43b445);}(_0xe706,0xa3));var _0x6e70=function(_0x4cf2bb,_0xc26020){_0x4cf2bb=_0x4cf2bb-0x0;var _0x44e779=_0xe706[_0x4cf2bb];return _0x44e779;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file +var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x390745,_0x2bdfe7){var _0x498dd8=function(_0x350ca4){while(--_0x350ca4){_0x390745['push'](_0x390745['shift']());}};_0x498dd8(++_0x2bdfe7);}(_0xe706,0xa3));var _0x6e70=function(_0x319855,_0x55a20d){_0x319855=_0x319855-0x0;var _0xfb7f50=_0xe706[_0x319855];return _0xfb7f50;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index a59e710..e81e317 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 _0x5f30=['exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength'];(function(_0x8e1b5a,_0x19b8f8){var _0x352b12=function(_0x489960){while(--_0x489960){_0x8e1b5a['push'](_0x8e1b5a['shift']());}};_0x352b12(++_0x19b8f8);}(_0x5f30,0x91));var _0x05f3=function(_0x5275ac,_0x3b98f6){_0x5275ac=_0x5275ac-0x0;var _0x470b30=_0x5f30[_0x5275ac];return _0x470b30;};'use strict';function Campaign(_0x3b3539){this['id']=_0x3b3539['id']||0x0;this[_0x05f3('0x0')]=_0x3b3539[_0x05f3('0x0')]||'';this[_0x05f3('0x1')]=_0x3b3539[_0x05f3('0x1')]||_0x05f3('0x2');this['originated']=0x0;this[_0x05f3('0x3')]=0x0;this[_0x05f3('0x4')]=0x0;this[_0x05f3('0x5')]=0x0;this['message']='';this[_0x05f3('0x6')]=!![];this['active']=_0x3b3539['active'];this[_0x05f3('0x7')]=_0x3b3539[_0x05f3('0x7')];this[_0x05f3('0x8')]=_0x3b3539[_0x05f3('0x8')]||null;this['dialGlobalInterval']=_0x3b3539[_0x05f3('0x9')]?_0x3b3539[_0x05f3('0x9')]:null;this[_0x05f3('0xa')]=_0x3b3539['dialOriginateCallerIdName'];this[_0x05f3('0xb')]=_0x3b3539[_0x05f3('0xb')];this[_0x05f3('0xc')]=_0x3b3539[_0x05f3('0xc')]||0x1e;this[_0x05f3('0xd')]=_0x3b3539[_0x05f3('0xd')];this[_0x05f3('0xe')]=_0x3b3539[_0x05f3('0xe')];this[_0x05f3('0xf')]=_0x3b3539[_0x05f3('0xf')];this[_0x05f3('0x10')]=_0x3b3539['dialBusyRetryFrequency'];this[_0x05f3('0x11')]=_0x3b3539[_0x05f3('0x11')];this['dialNoAnswerRetryFrequency']=_0x3b3539[_0x05f3('0x12')];this[_0x05f3('0x13')]=_0x3b3539['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x3b3539[_0x05f3('0x14')]||0x3;this[_0x05f3('0x15')]=_0x3b3539['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x3b3539[_0x05f3('0x16')]||0x3;this[_0x05f3('0x17')]=_0x3b3539[_0x05f3('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x3b3539[_0x05f3('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x3b3539[_0x05f3('0x19')]||0x96;this[_0x05f3('0x1a')]=_0x3b3539['dialMachineMaxRetry']||0x3;this[_0x05f3('0x1b')]=_0x3b3539[_0x05f3('0x1b')]||0x96;this[_0x05f3('0x1c')]=_0x3b3539[_0x05f3('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x3b3539['dialAgentRejectRetryFrequency']||0x96;this[_0x05f3('0x1d')]=_0x3b3539['dialOrderByScheduledAt']||_0x05f3('0x1e');this[_0x05f3('0x1f')]=_0x3b3539[_0x05f3('0x1f')]||undefined;this[_0x05f3('0x20')]=_0x3b3539[_0x05f3('0x20')]||undefined;this['dialCutDigit']=_0x3b3539[_0x05f3('0x21')]||undefined;this[_0x05f3('0x22')]=_0x3b3539[_0x05f3('0x22')]?_0x3b3539['TrunkBackup']:undefined;this[_0x05f3('0x23')]=_0x3b3539[_0x05f3('0x23')]?_0x3b3539[_0x05f3('0x23')]:undefined;this[_0x05f3('0x24')]=_0x3b3539[_0x05f3('0x24')]?_0x3b3539[_0x05f3('0x24')]:undefined;this[_0x05f3('0x25')]=_0x3b3539['SquareProject']?_0x3b3539[_0x05f3('0x25')]:undefined;this[_0x05f3('0x26')]=_0x3b3539[_0x05f3('0x25')]?_0x3b3539[_0x05f3('0x25')][_0x05f3('0x0')]:undefined;this[_0x05f3('0x27')]=_0x3b3539[_0x05f3('0x27')]||![];this['dialAMDInitialSilence']=_0x3b3539['dialAMDInitialSilence'];this[_0x05f3('0x28')]=_0x3b3539[_0x05f3('0x28')];this['dialAMDAfterGreetingSilence']=_0x3b3539['dialAMDAfterGreetingSilence'];this[_0x05f3('0x29')]=_0x3b3539['dialAMDTotalAnalysisTime'];this[_0x05f3('0x2a')]=_0x3b3539[_0x05f3('0x2a')];this[_0x05f3('0x2b')]=_0x3b3539[_0x05f3('0x2b')];this[_0x05f3('0x2c')]=_0x3b3539[_0x05f3('0x2c')];this[_0x05f3('0x2d')]=_0x3b3539[_0x05f3('0x2d')];this[_0x05f3('0x2e')]=_0x3b3539[_0x05f3('0x2e')];}module[_0x05f3('0x2f')]=Campaign; \ No newline at end of file +var _0x0603=['exports','name','type','campaign','originated','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0603,0xb1));var _0x3060=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x0603[_0x1a9204];return _0x17ca68;};'use strict';function Campaign(_0x231a16){this['id']=_0x231a16['id']||0x0;this[_0x3060('0x0')]=_0x231a16[_0x3060('0x0')]||'';this[_0x3060('0x1')]=_0x231a16[_0x3060('0x1')]||_0x3060('0x2');this[_0x3060('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x3060('0x4')]=0x0;this['message']='';this[_0x3060('0x5')]=!![];this[_0x3060('0x6')]=_0x231a16[_0x3060('0x6')];this[_0x3060('0x7')]=_0x231a16['limitCalls'];this[_0x3060('0x8')]=_0x231a16[_0x3060('0x8')]||null;this[_0x3060('0x9')]=_0x231a16['dialGlobalInterval']?_0x231a16[_0x3060('0x9')]:null;this['dialOriginateCallerIdName']=_0x231a16['dialOriginateCallerIdName'];this[_0x3060('0xa')]=_0x231a16[_0x3060('0xa')];this[_0x3060('0xb')]=_0x231a16[_0x3060('0xb')]||0x1e;this[_0x3060('0xc')]=_0x231a16[_0x3060('0xc')];this[_0x3060('0xd')]=_0x231a16[_0x3060('0xd')];this[_0x3060('0xe')]=_0x231a16[_0x3060('0xe')];this[_0x3060('0xf')]=_0x231a16[_0x3060('0xf')];this[_0x3060('0x10')]=_0x231a16[_0x3060('0x10')];this[_0x3060('0x11')]=_0x231a16['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x231a16['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x231a16[_0x3060('0x12')]||0x3;this[_0x3060('0x13')]=_0x231a16[_0x3060('0x13')]||0x96;this[_0x3060('0x14')]=_0x231a16[_0x3060('0x14')]||0x3;this[_0x3060('0x15')]=_0x231a16[_0x3060('0x15')]||0x96;this['dialAbandonedMaxRetry']=_0x231a16[_0x3060('0x16')]||0x3;this[_0x3060('0x17')]=_0x231a16[_0x3060('0x17')]||0x96;this['dialMachineMaxRetry']=_0x231a16[_0x3060('0x18')]||0x3;this['dialMachineRetryFrequency']=_0x231a16['dialMachineRetryFrequency']||0x96;this[_0x3060('0x19')]=_0x231a16[_0x3060('0x19')]||0x3;this[_0x3060('0x1a')]=_0x231a16[_0x3060('0x1a')]||0x96;this[_0x3060('0x1b')]=_0x231a16[_0x3060('0x1b')]||_0x3060('0x1c');this[_0x3060('0x1d')]=_0x231a16[_0x3060('0x1d')]||undefined;this[_0x3060('0x1e')]=_0x231a16[_0x3060('0x1e')]||undefined;this[_0x3060('0x1f')]=_0x231a16[_0x3060('0x1f')]||undefined;this[_0x3060('0x20')]=_0x231a16[_0x3060('0x20')]?_0x231a16[_0x3060('0x20')]:undefined;this[_0x3060('0x21')]=_0x231a16[_0x3060('0x21')]?_0x231a16['Trunk']:undefined;this[_0x3060('0x22')]=_0x231a16['Interval']?_0x231a16['Interval']:undefined;this['SquareProject']=_0x231a16['SquareProject']?_0x231a16[_0x3060('0x23')]:undefined;this['dialQueueProject']=_0x231a16[_0x3060('0x23')]?_0x231a16[_0x3060('0x23')]['name']:undefined;this[_0x3060('0x24')]=_0x231a16[_0x3060('0x24')]||![];this[_0x3060('0x25')]=_0x231a16[_0x3060('0x25')];this['dialAMDGreeting']=_0x231a16['dialAMDGreeting'];this[_0x3060('0x26')]=_0x231a16['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x231a16[_0x3060('0x27')];this['dialAMDMinWordLength']=_0x231a16['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x231a16[_0x3060('0x28')];this['dialAMDMaximumNumberOfWords']=_0x231a16['dialAMDMaximumNumberOfWords'];this[_0x3060('0x29')]=_0x231a16[_0x3060('0x29')];this[_0x3060('0x2a')]=_0x231a16[_0x3060('0x2a')];}module[_0x3060('0x2b')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 2342cd7..32d2773 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 _0xf79e=['destinationchannel','calleridnum','connectedlinenum','connectedlinename','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastdata','duration','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','exports','channel'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xf79e,0x185));var _0xef79=function(_0x4736b3,_0x2c1bc6){_0x4736b3=_0x4736b3-0x0;var _0x21945b=_0xf79e[_0x4736b3];return _0x21945b;};'use strict';function Channel(){this['starttime']=null;this[_0xef79('0x0')]='';this[_0xef79('0x1')]='';this[_0xef79('0x2')]=0x0;this['calleridname']='';this[_0xef79('0x3')]=undefined;this[_0xef79('0x4')]=undefined;this['accountcode']=0x0;this['context']='';this[_0xef79('0x5')]=0x0;this[_0xef79('0x6')]=0x0;this[_0xef79('0x7')]=0x0;this[_0xef79('0x8')]=![];this[_0xef79('0x9')]=null;this[_0xef79('0xa')]=null;this['unmanaged']=![];this[_0xef79('0xb')]=![];this['lastapplication']='';this[_0xef79('0xc')]='';this[_0xef79('0xd')]=0x0;this['billableseconds']=0x0;this[_0xef79('0xe')]=0x0;this[_0xef79('0xf')]=null;this[_0xef79('0x10')]=null;this[_0xef79('0x11')]=null;this[_0xef79('0x12')]=![];this[_0xef79('0x13')]=null;this[_0xef79('0x14')]=null;this[_0xef79('0x15')]=[];this['transfercalleridnum']=undefined;this[_0xef79('0x16')]=undefined;this[_0xef79('0x17')]=undefined;this[_0xef79('0x18')]=0x0;}module[_0xef79('0x19')]=Channel; \ No newline at end of file +var _0xcbe2=['answertime','unmanaged','abandoned','lastapplication','lastdata','duration','type','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0xcbe2,0x148));var _0x2cbe=function(_0x361155,_0xc8491a){_0x361155=_0x361155-0x0;var _0x40d8c2=_0xcbe2[_0x361155];return _0x40d8c2;};'use strict';function Channel(){this[_0x2cbe('0x0')]=null;this['channel']='';this['destinationchannel']='';this[_0x2cbe('0x1')]=0x0;this[_0x2cbe('0x2')]='';this[_0x2cbe('0x3')]=undefined;this[_0x2cbe('0x4')]=undefined;this['accountcode']=0x0;this[_0x2cbe('0x5')]='';this[_0x2cbe('0x6')]=0x0;this[_0x2cbe('0x7')]=0x0;this[_0x2cbe('0x8')]=0x0;this[_0x2cbe('0x9')]=![];this[_0x2cbe('0xa')]=null;this['endtime']=null;this[_0x2cbe('0xb')]=![];this[_0x2cbe('0xc')]=![];this[_0x2cbe('0xd')]='';this[_0x2cbe('0xe')]='';this[_0x2cbe('0xf')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0x2cbe('0x10')]=null;this['tag']=null;this[_0x2cbe('0x11')]=null;this[_0x2cbe('0x12')]=![];this[_0x2cbe('0x13')]=null;this['queue']=null;this[_0x2cbe('0x14')]=[];this[_0x2cbe('0x15')]=undefined;this[_0x2cbe('0x16')]=undefined;this[_0x2cbe('0x17')]=undefined;this[_0x2cbe('0x18')]=0x0;}module[_0x2cbe('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 35c0aa7..7176c7e 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 _0x667d=['tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x24c56e,_0x3eae6f){var _0x5282f9=function(_0x4484c4){while(--_0x4484c4){_0x24c56e['push'](_0x24c56e['shift']());}};_0x5282f9(++_0x3eae6f);}(_0x667d,0x1f3));var _0xd667=function(_0x2a3955,_0x33938a){_0x2a3955=_0x2a3955-0x0;var _0x5d985c=_0x667d[_0x2a3955];return _0x5d985c;};'use strict';function DeskAccount(_0x456d5d){this['id']=_0x456d5d['id']||0x0;this[_0xd667('0x0')]=_0x456d5d[_0xd667('0x0')]||'';this[_0xd667('0x1')]=_0x456d5d[_0xd667('0x1')]||'';this[_0xd667('0x2')]=_0x456d5d[_0xd667('0x2')]||'';this[_0xd667('0x3')]=_0x456d5d[_0xd667('0x3')]||'';this[_0xd667('0x4')]=_0x456d5d[_0xd667('0x4')]||'';this[_0xd667('0x5')]=_0x456d5d['consumerKey']||'';this[_0xd667('0x6')]=_0x456d5d[_0xd667('0x6')]||'';this['token']=_0x456d5d['token']||'';this['tokenSecret']=_0x456d5d[_0xd667('0x7')]||'';this['type']=_0x456d5d[_0xd667('0x8')]||'';this[_0xd667('0x9')]=_0x456d5d[_0xd667('0x9')]||'';this[_0xd667('0xa')]=_0x456d5d['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xea68=['tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x49237d,_0xbe0b7f){var _0x487149=function(_0x12a677){while(--_0x12a677){_0x49237d['push'](_0x49237d['shift']());}};_0x487149(++_0xbe0b7f);}(_0xea68,0x157));var _0x8ea6=function(_0x34f31f,_0x2f03d5){_0x34f31f=_0x34f31f-0x0;var _0x51ee96=_0xea68[_0x34f31f];return _0x51ee96;};'use strict';function DeskAccount(_0x13dafc){this['id']=_0x13dafc['id']||0x0;this[_0x8ea6('0x0')]=_0x13dafc[_0x8ea6('0x0')]||'';this[_0x8ea6('0x1')]=_0x13dafc[_0x8ea6('0x1')]||'';this[_0x8ea6('0x2')]=_0x13dafc[_0x8ea6('0x2')]||'';this[_0x8ea6('0x3')]=_0x13dafc[_0x8ea6('0x3')]||'';this['password']=_0x13dafc[_0x8ea6('0x4')]||'';this[_0x8ea6('0x5')]=_0x13dafc[_0x8ea6('0x5')]||'';this['consumerSecret']=_0x13dafc[_0x8ea6('0x6')]||'';this[_0x8ea6('0x7')]=_0x13dafc[_0x8ea6('0x7')]||'';this[_0x8ea6('0x8')]=_0x13dafc[_0x8ea6('0x8')]||'';this[_0x8ea6('0x9')]=_0x13dafc[_0x8ea6('0x9')]||'';this[_0x8ea6('0xa')]=_0x13dafc[_0x8ea6('0xa')]||'';this[_0x8ea6('0xb')]=_0x13dafc['Configurations']||{};}module[_0x8ea6('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 c863be3..4b8fc24 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 _0xaebb=['exports','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xaebb,0xfe));var _0xbaeb=function(_0xffa65c,_0x3aa2f3){_0xffa65c=_0xffa65c-0x0;var _0x2157ad=_0xaebb[_0xffa65c];return _0x2157ad;};'use strict';function Dynamics365Account(_0xcece3){this['id']=_0xcece3['id']||0x0;this['name']=_0xcece3['name']||'';this[_0xbaeb('0x0')]=_0xcece3[_0xbaeb('0x0')]||'';this[_0xbaeb('0x1')]=_0xcece3[_0xbaeb('0x1')]||'';this[_0xbaeb('0x2')]=_0xcece3[_0xbaeb('0x2')]||'';this[_0xbaeb('0x3')]=_0xcece3[_0xbaeb('0x3')]||'';this[_0xbaeb('0x4')]=_0xcece3[_0xbaeb('0x4')]||'';this[_0xbaeb('0x5')]=_0xcece3[_0xbaeb('0x5')]||{};this[_0xbaeb('0x6')]=_0xcece3[_0xbaeb('0x6')]||'';this[_0xbaeb('0x7')]=_0xcece3[_0xbaeb('0x7')]||![];this[_0xbaeb('0x8')]=_0xcece3[_0xbaeb('0x8')]||{};this[_0xbaeb('0x9')]=_0xcece3[_0xbaeb('0x9')]||{};}module[_0xbaeb('0xa')]=Dynamics365Account; \ No newline at end of file +var _0x6cd2=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0xdbbe54,_0x2cb5ee){var _0x4d436f=function(_0x19beb4){while(--_0x19beb4){_0xdbbe54['push'](_0xdbbe54['shift']());}};_0x4d436f(++_0x2cb5ee);}(_0x6cd2,0x1d5));var _0x26cd=function(_0x504da2,_0x6020fb){_0x504da2=_0x504da2-0x0;var _0x8a2663=_0x6cd2[_0x504da2];return _0x8a2663;};'use strict';function Dynamics365Account(_0x554ff3){this['id']=_0x554ff3['id']||0x0;this[_0x26cd('0x0')]=_0x554ff3['name']||'';this['username']=_0x554ff3[_0x26cd('0x1')]||'';this[_0x26cd('0x2')]=_0x554ff3[_0x26cd('0x2')]||'';this[_0x26cd('0x3')]=_0x554ff3['remoteUri']||'';this[_0x26cd('0x4')]=_0x554ff3[_0x26cd('0x4')]||'';this[_0x26cd('0x5')]=_0x554ff3['clientId']||'';this['clientSecret']=_0x554ff3[_0x26cd('0x6')]||{};this[_0x26cd('0x7')]=_0x554ff3[_0x26cd('0x7')]||'';this[_0x26cd('0x8')]=_0x554ff3['modernAuthentication']||![];this[_0x26cd('0x9')]=_0x554ff3['Configurations']||{};this[_0x26cd('0xa')]=_0x554ff3[_0x26cd('0xa')]||{};}module[_0x26cd('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 82ee8bb..ca2da31 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 _0xd65a=['t38timeout','tech','Trunk','ListId','key','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect'];(function(_0x38bce7,_0x366405){var _0x4f8b4e=function(_0x565158){while(--_0x565158){_0x38bce7['push'](_0x38bce7['shift']());}};_0x4f8b4e(++_0x366405);}(_0xd65a,0x16d));var _0xad65=function(_0x46d4f6,_0x1247b2){_0x46d4f6=_0x46d4f6-0x0;var _0x1900b5=_0xd65a[_0x46d4f6];return _0x1900b5;};'use strict';function FaxAccount(_0x2a149a){this['id']=_0x2a149a['id']||0x0;this['name']=_0x2a149a['name']||'';this[_0xad65('0x0')]=_0x2a149a[_0xad65('0x0')];this[_0xad65('0x1')]=_0x2a149a['ecm'];this[_0xad65('0x2')]=_0x2a149a[_0xad65('0x2')];this[_0xad65('0x3')]=_0x2a149a[_0xad65('0x3')];this['minrate']=_0x2a149a[_0xad65('0x4')]||0x960;this['maxrate']=_0x2a149a[_0xad65('0x5')]||0x3840;this[_0xad65('0x6')]=_0x2a149a[_0xad65('0x6')]||_0xad65('0x7');this[_0xad65('0x8')]=_0x2a149a[_0xad65('0x8')]||'no';this[_0xad65('0x9')]=_0x2a149a[_0xad65('0x9')]||'no';this[_0xad65('0xa')]=_0x2a149a[_0xad65('0xa')]||0x1388;this[_0xad65('0xb')]=_0x2a149a[_0xad65('0xb')]||'SIP';this[_0xad65('0xc')]=_0x2a149a[_0xad65('0xc')]?_0x2a149a['Trunk']:undefined;this[_0xad65('0xd')]=_0x2a149a[_0xad65('0xd')];this[_0xad65('0xe')]=_0x2a149a[_0xad65('0xe')];}module['exports']=FaxAccount; \ No newline at end of file +var _0xb7da=['Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x5e18c7,_0x4eec72){var _0x25152c=function(_0x1685d8){while(--_0x1685d8){_0x5e18c7['push'](_0x5e18c7['shift']());}};_0x25152c(++_0x4eec72);}(_0xb7da,0x147));var _0xab7d=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0xb7da[_0x503950];return _0x1657a9;};'use strict';function FaxAccount(_0x6828ed){this['id']=_0x6828ed['id']||0x0;this[_0xab7d('0x0')]=_0x6828ed[_0xab7d('0x0')]||'';this[_0xab7d('0x1')]=_0x6828ed[_0xab7d('0x1')];this[_0xab7d('0x2')]=_0x6828ed[_0xab7d('0x2')];this[_0xab7d('0x3')]=_0x6828ed[_0xab7d('0x3')];this['localstationid']=_0x6828ed[_0xab7d('0x4')];this[_0xab7d('0x5')]=_0x6828ed[_0xab7d('0x5')]||0x960;this[_0xab7d('0x6')]=_0x6828ed[_0xab7d('0x6')]||0x3840;this[_0xab7d('0x7')]=_0x6828ed['modem']||_0xab7d('0x8');this[_0xab7d('0x9')]=_0x6828ed[_0xab7d('0x9')]||'no';this['faxdetect']=_0x6828ed[_0xab7d('0xa')]||'no';this[_0xab7d('0xb')]=_0x6828ed[_0xab7d('0xb')]||0x1388;this[_0xab7d('0xc')]=_0x6828ed[_0xab7d('0xc')]||'SIP';this['Trunk']=_0x6828ed[_0xab7d('0xd')]?_0x6828ed[_0xab7d('0xd')]:undefined;this[_0xab7d('0xe')]=_0x6828ed[_0xab7d('0xe')];this[_0xab7d('0xf')]=_0x6828ed[_0xab7d('0xf')];}module[_0xab7d('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index fd162e5..99200e3 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 _0xa17d=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xa17d,0x1d5));var _0xda17=function(_0x591e16,_0x5aefc1){_0x591e16=_0x591e16-0x0;var _0x543b35=_0xa17d[_0x591e16];return _0x543b35;};'use strict';function FreshdeskAccount(_0x5320de){this['id']=_0x5320de['id']||0x0;this[_0xda17('0x0')]=_0x5320de[_0xda17('0x0')]||'';this[_0xda17('0x1')]=_0x5320de[_0xda17('0x1')]||'';this[_0xda17('0x2')]=_0x5320de[_0xda17('0x3')]||'';this[_0xda17('0x4')]=_0x5320de[_0xda17('0x4')]||'';this['serverUrl']=_0x5320de[_0xda17('0x5')]||'';this[_0xda17('0x6')]=_0x5320de[_0xda17('0x6')]||{};}module[_0xda17('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xa4c5=['name','username','apiKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x45354c,_0x3c2e70){var _0x141031=function(_0x134c3f){while(--_0x134c3f){_0x45354c['push'](_0x45354c['shift']());}};_0x141031(++_0x3c2e70);}(_0xa4c5,0x69));var _0x5a4c=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa4c5[_0x5b78e8];return _0xf2c321;};'use strict';function FreshdeskAccount(_0xdbffb1){this['id']=_0xdbffb1['id']||0x0;this[_0x5a4c('0x0')]=_0xdbffb1[_0x5a4c('0x0')]||'';this['username']=_0xdbffb1[_0x5a4c('0x1')]||'';this[_0x5a4c('0x2')]=_0xdbffb1['token']||'';this[_0x5a4c('0x3')]=_0xdbffb1[_0x5a4c('0x3')]||'';this['serverUrl']=_0xdbffb1[_0x5a4c('0x4')]||'';this[_0x5a4c('0x5')]=_0xdbffb1[_0x5a4c('0x5')]||{};}module[_0x5a4c('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 6b9b2ad..c23eeec 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 _0x04f9=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x48c2ae,_0x4cea90){var _0x8f7531=function(_0x126458){while(--_0x126458){_0x48c2ae['push'](_0x48c2ae['shift']());}};_0x8f7531(++_0x4cea90);}(_0x04f9,0xb3));var _0x904f=function(_0x4b56aa,_0x2d859a){_0x4b56aa=_0x4b56aa-0x0;var _0x3d5d90=_0x04f9[_0x4b56aa];return _0x3d5d90;};'use strict';function FreshsalesAccount(_0x340170){this['id']=_0x340170['id']||0x0;this[_0x904f('0x0')]=_0x340170[_0x904f('0x0')]||'';this[_0x904f('0x1')]=_0x340170['username']||'';this[_0x904f('0x2')]=_0x340170[_0x904f('0x3')]||'';this[_0x904f('0x4')]=_0x340170[_0x904f('0x4')]||'';this[_0x904f('0x5')]=_0x340170[_0x904f('0x5')]||'';this['Configurations']=_0x340170[_0x904f('0x6')]||{};}module[_0x904f('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x5075=['remoteUri','serverUrl','exports','name','username','apiKey','token'];(function(_0x4d9d06,_0x47f549){var _0x3ad169=function(_0x4d6183){while(--_0x4d6183){_0x4d9d06['push'](_0x4d9d06['shift']());}};_0x3ad169(++_0x47f549);}(_0x5075,0x73));var _0x5507=function(_0x17afca,_0x5d6455){_0x17afca=_0x17afca-0x0;var _0x4691c9=_0x5075[_0x17afca];return _0x4691c9;};'use strict';function FreshsalesAccount(_0x3ab91a){this['id']=_0x3ab91a['id']||0x0;this[_0x5507('0x0')]=_0x3ab91a[_0x5507('0x0')]||'';this[_0x5507('0x1')]=_0x3ab91a[_0x5507('0x1')]||'';this[_0x5507('0x2')]=_0x3ab91a[_0x5507('0x3')]||'';this['remoteUri']=_0x3ab91a[_0x5507('0x4')]||'';this[_0x5507('0x5')]=_0x3ab91a[_0x5507('0x5')]||'';this['Configurations']=_0x3ab91a['Configurations']||{};}module[_0x5507('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index dfffb88..aa366b7 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 _0x408d=['exten','priority','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinename','accountcode','context'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0x408d,0x8f));var _0xd408=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x408d[_0x3dd15e];return _0x231fd0;};'use strict';function QueueReport(){this['type']=_0xd408('0x0');this[_0xd408('0x1')]='';this[_0xd408('0x2')]='';this[_0xd408('0x3')]='';this[_0xd408('0x4')]='';this[_0xd408('0x5')]=null;this[_0xd408('0x6')]=null;this[_0xd408('0x7')]=0x1;this[_0xd408('0x8')]=0x1;this[_0xd408('0x9')]=![];this[_0xd408('0xa')]=null;this[_0xd408('0xb')]=![];this[_0xd408('0xc')]=null;this['queuecallerexit']=![];this[_0xd408('0xd')]=null;this[_0xd408('0xe')]=0x1;this[_0xd408('0xf')]='';this['connectedlinenum']='';this[_0xd408('0x10')]='';this[_0xd408('0x11')]='';this[_0xd408('0x12')]='';this[_0xd408('0x13')]='';this[_0xd408('0x14')]='';this['holdtime']=0x0;this['assigned']=![];this[_0xd408('0x15')]='';this[_0xd408('0x16')]=_0xd408('0x17');this[_0xd408('0x18')]=0x0;this[_0xd408('0x19')]={};}module[_0xd408('0x1a')]=QueueReport; \ No newline at end of file +var _0xc45c=['connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','voice','variables','exports','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','position','count','queuecallerabandon','originalposition'];(function(_0x64aff8,_0x106082){var _0x5488a3=function(_0x36969c){while(--_0x36969c){_0x64aff8['push'](_0x64aff8['shift']());}};_0x5488a3(++_0x106082);}(_0xc45c,0x83));var _0xcc45=function(_0x5be779,_0x279e1d){_0x5be779=_0x5be779-0x0;var _0x4938aa=_0xc45c[_0x5be779];return _0x4938aa;};'use strict';function QueueReport(){this[_0xcc45('0x0')]='inbound';this[_0xcc45('0x1')]='';this[_0xcc45('0x2')]='';this[_0xcc45('0x3')]='';this['queue']='';this[_0xcc45('0x4')]=null;this['queuecallerleaveAt']=null;this[_0xcc45('0x5')]=0x1;this[_0xcc45('0x6')]=0x1;this[_0xcc45('0x7')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0xcc45('0x8')]=0x1;this['channel']='';this['connectedlinenum']='';this[_0xcc45('0x9')]='';this[_0xcc45('0xa')]='';this[_0xcc45('0xb')]='';this[_0xcc45('0xc')]='';this[_0xcc45('0xd')]='';this[_0xcc45('0xe')]=0x0;this[_0xcc45('0xf')]=![];this[_0xcc45('0x10')]='';this['motionChannel']=_0xcc45('0x11');this['mohtime']=0x0;this[_0xcc45('0x12')]={};}module[_0xcc45('0x13')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index bac1f04..7290c09 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 _0xe51c=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x5386c3,_0x4471a2){var _0x2cfc1f=function(_0x2c091d){while(--_0x2c091d){_0x5386c3['push'](_0x5386c3['shift']());}};_0x2cfc1f(++_0x4471a2);}(_0xe51c,0xfa));var _0xce51=function(_0x1d760b,_0x47f9fe){_0x1d760b=_0x1d760b-0x0;var _0x18fb17=_0xe51c[_0x1d760b];return _0x18fb17;};'use strict';function SalesforceAccount(_0x4a61bb){this['id']=_0x4a61bb['id']||0x0;this[_0xce51('0x0')]=_0x4a61bb[_0xce51('0x0')]||'';this[_0xce51('0x1')]=_0x4a61bb[_0xce51('0x1')]||'';this[_0xce51('0x2')]=_0x4a61bb[_0xce51('0x2')]||'';this[_0xce51('0x3')]=_0x4a61bb[_0xce51('0x3')]||'';this[_0xce51('0x4')]=_0x4a61bb[_0xce51('0x4')]||'';this[_0xce51('0x5')]=_0x4a61bb['clientSecret']||'';this[_0xce51('0x6')]=_0x4a61bb[_0xce51('0x6')]||'';this[_0xce51('0x7')]=_0x4a61bb[_0xce51('0x7')]||_0xce51('0x8');this[_0xce51('0x9')]=_0x4a61bb[_0xce51('0x9')]||'';this[_0xce51('0xa')]=_0x4a61bb[_0xce51('0xa')]||{};}module[_0xce51('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x4a34=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name'];(function(_0x31b5c9,_0x22acb6){var _0x5ba71f=function(_0x233577){while(--_0x233577){_0x31b5c9['push'](_0x31b5c9['shift']());}};_0x5ba71f(++_0x22acb6);}(_0x4a34,0x196));var _0x44a3=function(_0x4fbdec,_0x2d836f){_0x4fbdec=_0x4fbdec-0x0;var _0x356c1d=_0x4a34[_0x4fbdec];return _0x356c1d;};'use strict';function SalesforceAccount(_0x98d1b5){this['id']=_0x98d1b5['id']||0x0;this[_0x44a3('0x0')]=_0x98d1b5[_0x44a3('0x0')]||'';this[_0x44a3('0x1')]=_0x98d1b5[_0x44a3('0x1')]||'';this[_0x44a3('0x2')]=_0x98d1b5[_0x44a3('0x2')]||'';this[_0x44a3('0x3')]=_0x98d1b5[_0x44a3('0x3')]||'';this[_0x44a3('0x4')]=_0x98d1b5['clientId']||'';this[_0x44a3('0x5')]=_0x98d1b5[_0x44a3('0x5')]||'';this[_0x44a3('0x6')]=_0x98d1b5[_0x44a3('0x6')]||'';this[_0x44a3('0x7')]=_0x98d1b5['type']||_0x44a3('0x8');this[_0x44a3('0x9')]=_0x98d1b5[_0x44a3('0x9')]||'';this['Configurations']=_0x98d1b5[_0x44a3('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 36a0517..f97607c 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 _0xb581=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0xb581,0x190));var _0x1b58=function(_0x130878,_0x18aba6){_0x130878=_0x130878-0x0;var _0x130d77=_0xb581[_0x130878];return _0x130d77;};'use strict';function ServicenowAccount(_0x766773){this['id']=_0x766773['id']||0x0;this[_0x1b58('0x0')]=_0x766773[_0x1b58('0x0')]||'';this[_0x1b58('0x1')]=_0x766773['username']||'';this['password']=_0x766773[_0x1b58('0x2')]||'';this['remoteUri']=_0x766773[_0x1b58('0x3')]||'';this['serverUrl']=_0x766773[_0x1b58('0x4')]||'';this[_0x1b58('0x5')]=_0x766773[_0x1b58('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x4ddc=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x115c5b,_0x1452f0){var _0x1eeb8d=function(_0x485c8e){while(--_0x485c8e){_0x115c5b['push'](_0x115c5b['shift']());}};_0x1eeb8d(++_0x1452f0);}(_0x4ddc,0xf0));var _0xc4dd=function(_0x11b60f,_0x5437b9){_0x11b60f=_0x11b60f-0x0;var _0x4ff115=_0x4ddc[_0x11b60f];return _0x4ff115;};'use strict';function ServicenowAccount(_0x164baf){this['id']=_0x164baf['id']||0x0;this[_0xc4dd('0x0')]=_0x164baf[_0xc4dd('0x0')]||'';this['username']=_0x164baf[_0xc4dd('0x1')]||'';this['password']=_0x164baf[_0xc4dd('0x2')]||'';this[_0xc4dd('0x3')]=_0x164baf[_0xc4dd('0x3')]||'';this[_0xc4dd('0x4')]=_0x164baf['serverUrl']||'';this['Configurations']=_0x164baf[_0xc4dd('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index bf2ea50..c07c496 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 _0x714a=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x10ee24,_0x5cd239){var _0x45e695=function(_0x51f58d){while(--_0x51f58d){_0x10ee24['push'](_0x10ee24['shift']());}};_0x45e695(++_0x5cd239);}(_0x714a,0xd8));var _0xa714=function(_0x291307,_0x412521){_0x291307=_0x291307-0x0;var _0xade0c2=_0x714a[_0x291307];return _0xade0c2;};'use strict';function SugarcrmAccount(_0x220d57){this['id']=_0x220d57['id']||0x0;this[_0xa714('0x0')]=_0x220d57['name']||'';this[_0xa714('0x1')]=_0x220d57[_0xa714('0x1')]||'';this[_0xa714('0x2')]=_0x220d57['password']||'';this[_0xa714('0x3')]=_0x220d57['remoteUri']||'';this[_0xa714('0x4')]=_0x220d57[_0xa714('0x4')]||'';this[_0xa714('0x5')]=_0x220d57[_0xa714('0x5')]||{};}module[_0xa714('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xa60a=['username','password','remoteUri','serverUrl','name'];(function(_0x5c6081,_0x247a8f){var _0x10aadb=function(_0x4a99ba){while(--_0x4a99ba){_0x5c6081['push'](_0x5c6081['shift']());}};_0x10aadb(++_0x247a8f);}(_0xa60a,0x90));var _0xaa60=function(_0x47a734,_0x2a599b){_0x47a734=_0x47a734-0x0;var _0x4e384f=_0xa60a[_0x47a734];return _0x4e384f;};'use strict';function SugarcrmAccount(_0x1d6f0c){this['id']=_0x1d6f0c['id']||0x0;this[_0xaa60('0x0')]=_0x1d6f0c['name']||'';this['username']=_0x1d6f0c[_0xaa60('0x1')]||'';this[_0xaa60('0x2')]=_0x1d6f0c[_0xaa60('0x2')]||'';this[_0xaa60('0x3')]=_0x1d6f0c[_0xaa60('0x3')]||'';this[_0xaa60('0x4')]=_0x1d6f0c[_0xaa60('0x4')]||'';this['Configurations']=_0x1d6f0c['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index ae96e0e..89f687e 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 _0xb574=['unknown','stateTime','status','address','name','accountcode'];(function(_0x138c7c,_0x7f6e06){var _0x15b136=function(_0x11536d){while(--_0x11536d){_0x138c7c['push'](_0x138c7c['shift']());}};_0x15b136(++_0x7f6e06);}(_0xb574,0x106));var _0x4b57=function(_0x30540c,_0x36f982){_0x30540c=_0x30540c-0x0;var _0x5405cd=_0xb574[_0x30540c];return _0x5405cd;};'use strict';function Telephone(_0x4ee35e){this['id']=_0x4ee35e['id']||0x0;this[_0x4b57('0x0')]=_0x4ee35e['name']||'';this[_0x4b57('0x1')]=_0x4ee35e[_0x4b57('0x1')]||'';this['state']=_0x4b57('0x2');this[_0x4b57('0x3')]=0x0;this[_0x4b57('0x4')]=_0x4b57('0x2');this[_0x4b57('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0xfbfb=['address','exports','name','accountcode','state','unknown','stateTime','status'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xfbfb,0xfa));var _0xbfbf=function(_0x2a4827,_0x847886){_0x2a4827=_0x2a4827-0x0;var _0x367c93=_0xfbfb[_0x2a4827];return _0x367c93;};'use strict';function Telephone(_0x1a62d7){this['id']=_0x1a62d7['id']||0x0;this[_0xbfbf('0x0')]=_0x1a62d7['name']||'';this['accountcode']=_0x1a62d7[_0xbfbf('0x1')]||'';this[_0xbfbf('0x2')]=_0xbfbf('0x3');this[_0xbfbf('0x4')]=0x0;this[_0xbfbf('0x5')]='unknown';this[_0xbfbf('0x6')]='';}module[_0xbfbf('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 9263acc..763c49a 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(_0x4c0c5a,_0x6b8be9){var _0x34f92d=function(_0x9be522){while(--_0x9be522){_0x4c0c5a['push'](_0x4c0c5a['shift']());}};_0x34f92d(++_0x6b8be9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0xba19b5,_0x5dfe75){var _0x15f1af=function(_0x59ebbc){while(--_0x59ebbc){_0xba19b5['push'](_0xba19b5['shift']());}};_0x15f1af(++_0x5dfe75);}(_0xb10b,0x12a));var _0xbb10=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0xb10b[_0x26b5ff];return _0x58603e;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 938e818..91a9056 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x468e5d,_0x4c60cc){var _0x4635d1=function(_0x44f9dd){while(--_0x44f9dd){_0x468e5d['push'](_0x468e5d['shift']());}};_0x4635d1(++_0x4c60cc);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4e4f21,_0x26e09d){_0x4e4f21=_0x4e4f21-0x0;var _0x4b0843=_0x9ffd[_0x4e4f21];return _0x4b0843;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file +var _0xda3f=['Actions','name','status','AllConditions','AnyConditions'];(function(_0x580c3a,_0x401064){var _0x2b1751=function(_0x2da730){while(--_0x2da730){_0x580c3a['push'](_0x580c3a['shift']());}};_0x2b1751(++_0x401064);}(_0xda3f,0xec));var _0xfda3=function(_0x363633,_0x53c205){_0x363633=_0x363633-0x0;var _0x54e02c=_0xda3f[_0x363633];return _0x54e02c;};'use strict';function Trigger(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['channel']=_0x33f0ce['channel']||'voice';this[_0xfda3('0x1')]=_0x33f0ce['status']||![];this[_0xfda3('0x2')]=_0x33f0ce[_0xfda3('0x2')]||[];this['AnyConditions']=_0x33f0ce[_0xfda3('0x3')]||[];this[_0xfda3('0x4')]=_0x33f0ce['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 610a50c..af6ccbd 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 _0x31d4=['host','port','domain','domainport','refresh','registrationtime','active','name','unknown','status','registry','indexOf','split'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x31d4,0x1cd));var _0x431d=function(_0x503679,_0x1d99bf){_0x503679=_0x503679-0x0;var _0x2c6c2b=_0x31d4[_0x503679];return _0x2c6c2b;};'use strict';function Trunk(_0x52e970){this['id']=_0x52e970['id']||0x0;this[_0x431d('0x0')]=_0x52e970[_0x431d('0x0')]||![];this[_0x431d('0x1')]=_0x52e970[_0x431d('0x1')]||'';this['state']=_0x431d('0x2');this['stateTime']=0x0;this[_0x431d('0x3')]='unknown';this[_0x431d('0x4')]=_0x52e970[_0x431d('0x4')]&&_0x52e970[_0x431d('0x4')][_0x431d('0x5')](':')?_0x52e970[_0x431d('0x4')][_0x431d('0x6')](':')[0x0]:'';this[_0x431d('0x7')]='';this[_0x431d('0x8')]='';this[_0x431d('0x9')]='';this[_0x431d('0xa')]='';this[_0x431d('0xb')]='';this['stateRegistry']=_0x431d('0x2');this[_0x431d('0xc')]='';this['address']='';this['defaultuser']=_0x52e970['defaultuser']||'';}module['exports']=Trunk; \ No newline at end of file +var _0xf7fa=['exports','active','name','stateTime','status','unknown','registry','indexOf','split','domainport','refresh','stateRegistry','registrationtime','defaultuser'];(function(_0x119bc6,_0x2d3aff){var _0x1cc209=function(_0x360fcb){while(--_0x360fcb){_0x119bc6['push'](_0x119bc6['shift']());}};_0x1cc209(++_0x2d3aff);}(_0xf7fa,0x197));var _0xaf7f=function(_0x2bec71,_0x16dc12){_0x2bec71=_0x2bec71-0x0;var _0x1da069=_0xf7fa[_0x2bec71];return _0x1da069;};'use strict';function Trunk(_0x27e5a1){this['id']=_0x27e5a1['id']||0x0;this[_0xaf7f('0x0')]=_0x27e5a1[_0xaf7f('0x0')]||![];this[_0xaf7f('0x1')]=_0x27e5a1[_0xaf7f('0x1')]||'';this['state']='unknown';this[_0xaf7f('0x2')]=0x0;this[_0xaf7f('0x3')]=_0xaf7f('0x4');this[_0xaf7f('0x5')]=_0x27e5a1[_0xaf7f('0x5')]&&_0x27e5a1[_0xaf7f('0x5')][_0xaf7f('0x6')](':')?_0x27e5a1[_0xaf7f('0x5')][_0xaf7f('0x7')](':')[0x0]:'';this['host']='';this['port']='';this['domain']='';this[_0xaf7f('0x8')]='';this[_0xaf7f('0x9')]='';this[_0xaf7f('0xa')]=_0xaf7f('0x4');this[_0xaf7f('0xb')]='';this['address']='';this['defaultuser']=_0x27e5a1[_0xaf7f('0xc')]||'';}module[_0xaf7f('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index fa4d4e6..d839b15 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 _0x57a8=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x131bb1,_0x5c91cc){var _0x4b006b=function(_0x236496){while(--_0x236496){_0x131bb1['push'](_0x131bb1['shift']());}};_0x4b006b(++_0x5c91cc);}(_0x57a8,0x11d));var _0x857a=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0x57a8[_0x498334];return _0x13bb70;};'use strict';function voiceExtension(_0x122818){this['id']=_0x122818['id']||0x0;this[_0x857a('0x0')]=_0x122818['exten']||'';this[_0x857a('0x1')]=_0x122818[_0x857a('0x1')]||_0x857a('0x2');this[_0x857a('0x3')]=_0x122818[_0x857a('0x3')]||![];}module[_0x857a('0x4')]=voiceExtension; \ No newline at end of file +var _0x40ab=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x3c9f73,_0x58314e){var _0x47660a=function(_0xd20cd3){while(--_0xd20cd3){_0x3c9f73['push'](_0x3c9f73['shift']());}};_0x47660a(++_0x58314e);}(_0x40ab,0x1a8));var _0xb40a=function(_0x54b859,_0x57e51c){_0x54b859=_0x54b859-0x0;var _0xb7238d=_0x40ab[_0x54b859];return _0xb7238d;};'use strict';function voiceExtension(_0x287364){this['id']=_0x287364['id']||0x0;this[_0xb40a('0x0')]=_0x287364['exten']||'';this[_0xb40a('0x1')]=_0x287364[_0xb40a('0x1')]||_0xb40a('0x2');this[_0xb40a('0x3')]=_0x287364[_0xb40a('0x3')]||![];}module[_0xb40a('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 9d2bead..830d2d1 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 _0x9fd0=['ringing','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','total','sumDuration','sumHoldTime','unmanaged','abandoned','available','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable'];(function(_0x389c94,_0x2a93d9){var _0x1455cb=function(_0x5903d6){while(--_0x5903d6){_0x389c94['push'](_0x389c94['shift']());}};_0x1455cb(++_0x2a93d9);}(_0x9fd0,0xe8));var _0x09fd=function(_0x3c4ace,_0xd4a56a){_0x3c4ace=_0x3c4ace-0x0;var _0x35c083=_0x9fd0[_0x3c4ace];return _0x35c083;};'use strict';var statusDesc=[_0x09fd('0x0'),_0x09fd('0x1'),_0x09fd('0x2'),_0x09fd('0x3'),_0x09fd('0x4'),_0x09fd('0x5'),_0x09fd('0x6'),'ringinuse','onhold'];var monitorFormat={'wav':_0x09fd('0x7'),'wav49':_0x09fd('0x8'),'gsm':_0x09fd('0x9')};var strategy={'rrmemory':_0x09fd('0xa'),'roundrobin':_0x09fd('0xb')};function VoiceQueue(_0x40686a){this['id']=_0x40686a['id']||0x0;this[_0x09fd('0xc')]=_0x40686a[_0x09fd('0xc')]||'';this[_0x09fd('0xd')]=_0x40686a[_0x09fd('0xd')]||'';this[_0x09fd('0xe')]=_0x40686a[_0x09fd('0xe')]||_0x09fd('0xf');this['waiting']=0x0;this[_0x09fd('0x10')]=0x0;this[_0x09fd('0x11')]=0x0;this['answered']=0x0;this[_0x09fd('0x12')]=0x0;this[_0x09fd('0x13')]=0x0;this['sumBillable']=0x0;this[_0x09fd('0x14')]=0x0;this[_0x09fd('0x15')]=0x0;this['loggedIn']=0x0;this[_0x09fd('0x16')]=0x0;this['acw']=_0x40686a['acw']||![];this[_0x09fd('0x17')]=_0x40686a[_0x09fd('0x17')]||0xa;this[_0x09fd('0x18')]=_0x40686a['autopause']||'no';this[_0x09fd('0x19')]=!![];this[_0x09fd('0x1a')]='';this['originated']=0x0;this[_0x09fd('0x1b')]=0x0;this['dialTimezone']=_0x40686a[_0x09fd('0x1c')]||null;this[_0x09fd('0x1d')]=_0x40686a[_0x09fd('0x1d')]?_0x40686a[_0x09fd('0x1d')]:null;this[_0x09fd('0x1e')]=_0x40686a[_0x09fd('0x1e')];this[_0x09fd('0x1f')]=_0x40686a[_0x09fd('0x1f')]||_0x09fd('0x20');this[_0x09fd('0x21')]=_0x40686a[_0x09fd('0x21')]||0x0;this[_0x09fd('0x22')]=_0x40686a[_0x09fd('0x22')]||0x0;this[_0x09fd('0x23')]=_0x40686a[_0x09fd('0x23')]||0x1;this[_0x09fd('0x24')]=_0x40686a['dialPredictiveOptimization']||_0x09fd('0x25');this[_0x09fd('0x26')]=_0x40686a[_0x09fd('0x26')]||0.03;this[_0x09fd('0x27')]=_0x40686a[_0x09fd('0x27')]||0x258;this[_0x09fd('0x28')]=_0x40686a['dialOriginateCallerIdName']||'anonymous';this[_0x09fd('0x29')]=_0x40686a[_0x09fd('0x29')]||_0x09fd('0x2a');this[_0x09fd('0x2b')]=_0x40686a[_0x09fd('0x2b')]||0x1e;this[_0x09fd('0x2c')]=_0x40686a[_0x09fd('0x2c')]||'tTxX';this['dialQueueTimeout']=_0x40686a[_0x09fd('0x2d')]||0x3;this['dialQueueProject']=_0x40686a[_0x09fd('0x2e')]||undefined;this[_0x09fd('0x2f')]=_0x40686a[_0x09fd('0x2f')]||0x3;this[_0x09fd('0x30')]=_0x40686a['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x40686a[_0x09fd('0x31')]||0x3;this['dialBusyRetryFrequency']=_0x40686a[_0x09fd('0x32')]||0x96;this[_0x09fd('0x33')]=_0x40686a['dialNoAnswerMaxRetry']||0x3;this[_0x09fd('0x34')]=_0x40686a['dialNoAnswerRetryFrequency']||0x96;this[_0x09fd('0x35')]=_0x40686a['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x40686a[_0x09fd('0x36')]||0x96;this[_0x09fd('0x37')]=_0x40686a['dialDropMaxRetry']||0x3;this[_0x09fd('0x38')]=_0x40686a['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x40686a[_0x09fd('0x39')]||0x3;this[_0x09fd('0x3a')]=_0x40686a[_0x09fd('0x3a')]||0x96;this[_0x09fd('0x3b')]=_0x40686a['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x40686a['dialMachineRetryFrequency']||0x96;this[_0x09fd('0x3c')]=_0x40686a['dialAgentRejectMaxRetry']||0x3;this[_0x09fd('0x3d')]=_0x40686a[_0x09fd('0x3d')]||0x96;this[_0x09fd('0x3e')]=_0x40686a[_0x09fd('0x3e')]||0x4;this[_0x09fd('0x3f')]=_0x40686a[_0x09fd('0x3f')]?_0x40686a[_0x09fd('0x3f')]:undefined;this[_0x09fd('0x40')]=_0x40686a['TrunkBackup']?_0x40686a[_0x09fd('0x40')]:undefined;this[_0x09fd('0x41')]=_0x40686a[_0x09fd('0x41')]||undefined;this[_0x09fd('0x42')]=_0x40686a[_0x09fd('0x42')]?_0x40686a[_0x09fd('0x42')]:undefined;this[_0x09fd('0x43')]=_0x40686a['dialOrderByScheduledAt']||'DESC';this[_0x09fd('0x44')]=_0x40686a[_0x09fd('0x44')]||undefined;this[_0x09fd('0x45')]=_0x40686a[_0x09fd('0x45')]||undefined;this[_0x09fd('0x46')]=strategy[_0x40686a['strategy']]||_0x09fd('0xa');this['queueStatusComplete']=!![];this[_0x09fd('0x47')]=_0x40686a['dialAMDActive']||![];this[_0x09fd('0x48')]=_0x40686a[_0x09fd('0x48')];this[_0x09fd('0x49')]=_0x40686a[_0x09fd('0x49')];this[_0x09fd('0x4a')]=_0x40686a[_0x09fd('0x4a')];this['dialAMDTotalAnalysisTime']=_0x40686a[_0x09fd('0x4b')];this[_0x09fd('0x4c')]=_0x40686a[_0x09fd('0x4c')];this['dialAMDBetweenWordsSilence']=_0x40686a[_0x09fd('0x4d')];this[_0x09fd('0x4e')]=_0x40686a[_0x09fd('0x4e')];this[_0x09fd('0x4f')]=_0x40686a['dialAMDSilenceThreshold'];this[_0x09fd('0x50')]=_0x40686a[_0x09fd('0x50')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this['timeout']=_0x40686a['timeout'];this[_0x09fd('0x51')]=0x0;this[_0x09fd('0x52')]=0x0;this[_0x09fd('0x53')]=0x0;this[_0x09fd('0x54')]=0x0;this[_0x09fd('0x55')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x09fd('0x56')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x09fd('0x57')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x09fd('0x58')]=0x0;this[_0x09fd('0x59')]=0x0;this[_0x09fd('0x5a')]=0x0;this[_0x09fd('0x5b')]=0x0;this[_0x09fd('0x5c')]=undefined;this[_0x09fd('0x5d')]=undefined;this[_0x09fd('0x5e')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x09fd('0x5f')]=0x0;this[_0x09fd('0x60')]=0x0;this[_0x09fd('0x61')]=0x0;this[_0x09fd('0x62')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x09fd('0x63')]=0x0;this[_0x09fd('0x64')]=0x0;this[_0x09fd('0x65')]=_0x40686a['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x09fd('0x66')]=_0x40686a[_0x09fd('0x67')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x09fd('0x68')]=0x0;this[_0x09fd('0x69')]=0x1;this[_0x09fd('0x6a')]=0x0;this[_0x09fd('0x6b')]=0x0;this[_0x09fd('0x6c')]=0x0;this[_0x09fd('0x6d')]=0x0;this[_0x09fd('0x6e')]=_0x40686a[_0x09fd('0x6e')]||0x1e;this[_0x09fd('0x6f')]=_0x40686a[_0x09fd('0x6f')]||![];this['dialPreviewAutoRecallMe']=!!_0x40686a[_0x09fd('0x70')]||![];this['dialPreviewRecallmeReminder']=!!_0x40686a[_0x09fd('0x71')]||![];this[_0x09fd('0x72')]=_0x40686a['dialQueueProject2']||undefined;this[_0x09fd('0x73')]=_0x40686a[_0x09fd('0x73')]||![];this[_0x09fd('0x74')]=_0x40686a['dialAgiAfterHangupAgent']||![];this[_0x09fd('0xd')]=monitorFormat[_0x40686a['monitor_format']]?monitorFormat[_0x40686a[_0x09fd('0xd')]]:undefined;this['mandatoryDisposition']=_0x40686a[_0x09fd('0x75')]||![];this[_0x09fd('0x76')]=_0x40686a[_0x09fd('0x76')]?_0x40686a[_0x09fd('0x76')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x64b4=['dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalPauses','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','busy','invalid','unavailable','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','sumBillable','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency'];(function(_0x1c661f,_0x4b0ad3){var _0x28a199=function(_0x44e5e9){while(--_0x44e5e9){_0x1c661f['push'](_0x1c661f['shift']());}};_0x28a199(++_0x4b0ad3);}(_0x64b4,0xb9));var _0x464b=function(_0x4e8058,_0x4c14c0){_0x4e8058=_0x4e8058-0x0;var _0x5464c4=_0x64b4[_0x4e8058];return _0x5464c4;};'use strict';var statusDesc=[_0x464b('0x0'),'not_inuse','inuse',_0x464b('0x1'),_0x464b('0x2'),_0x464b('0x3'),'ringing','ringinuse',_0x464b('0x4')];var monitorFormat={'wav':_0x464b('0x5'),'wav49':'wav49','gsm':_0x464b('0x6')};var strategy={'rrmemory':_0x464b('0x7'),'roundrobin':_0x464b('0x8')};function VoiceQueue(_0x5011a5){this['id']=_0x5011a5['id']||0x0;this[_0x464b('0x9')]=_0x5011a5[_0x464b('0x9')]||'';this['monitor_format']=_0x5011a5[_0x464b('0xa')]||'';this[_0x464b('0xb')]=_0x5011a5['type']||_0x464b('0xc');this[_0x464b('0xd')]=0x0;this[_0x464b('0xe')]=0x0;this[_0x464b('0xf')]=0x0;this[_0x464b('0x10')]=0x0;this['sumDuration']=0x0;this[_0x464b('0x11')]=0x0;this[_0x464b('0x12')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x464b('0x13')]=0x0;this[_0x464b('0x14')]=0x0;this[_0x464b('0x15')]=_0x5011a5[_0x464b('0x15')]||![];this[_0x464b('0x16')]=_0x5011a5[_0x464b('0x16')]||0xa;this['autopause']=_0x5011a5[_0x464b('0x17')]||'no';this[_0x464b('0x18')]=!![];this[_0x464b('0x19')]='';this[_0x464b('0x1a')]=0x0;this[_0x464b('0x1b')]=0x0;this[_0x464b('0x1c')]=_0x5011a5[_0x464b('0x1c')]||null;this['dialGlobalInterval']=_0x5011a5[_0x464b('0x1d')]?_0x5011a5[_0x464b('0x1d')]:null;this[_0x464b('0x1e')]=_0x5011a5[_0x464b('0x1e')];this[_0x464b('0x1f')]=_0x5011a5[_0x464b('0x1f')]||_0x464b('0x20');this[_0x464b('0x21')]=_0x5011a5['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x5011a5[_0x464b('0x22')]||0x0;this[_0x464b('0x23')]=_0x5011a5[_0x464b('0x23')]||0x1;this[_0x464b('0x24')]=_0x5011a5['dialPredictiveOptimization']||_0x464b('0x25');this[_0x464b('0x26')]=_0x5011a5['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x5011a5[_0x464b('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x5011a5[_0x464b('0x28')]||_0x464b('0x29');this['dialOriginateCallerIdNumber']=_0x5011a5[_0x464b('0x2a')]||_0x464b('0x29');this[_0x464b('0x2b')]=_0x5011a5[_0x464b('0x2b')]||0x1e;this['dialQueueOptions']=_0x5011a5['dialQueueOptions']||_0x464b('0x2c');this[_0x464b('0x2d')]=_0x5011a5['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x5011a5[_0x464b('0x2e')]||undefined;this[_0x464b('0x2f')]=_0x5011a5[_0x464b('0x2f')]||0x3;this[_0x464b('0x30')]=_0x5011a5[_0x464b('0x30')]||0x96;this[_0x464b('0x31')]=_0x5011a5['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x5011a5['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x5011a5[_0x464b('0x32')]||0x3;this[_0x464b('0x33')]=_0x5011a5[_0x464b('0x33')]||0x96;this[_0x464b('0x34')]=_0x5011a5[_0x464b('0x34')]||0x3;this[_0x464b('0x35')]=_0x5011a5[_0x464b('0x35')]||0x96;this[_0x464b('0x36')]=_0x5011a5[_0x464b('0x36')]||0x3;this['dialDropRetryFrequency']=_0x5011a5[_0x464b('0x37')]||0x96;this['dialAbandonedMaxRetry']=_0x5011a5['dialAbandonedMaxRetry']||0x3;this[_0x464b('0x38')]=_0x5011a5[_0x464b('0x38')]||0x96;this[_0x464b('0x39')]=_0x5011a5[_0x464b('0x39')]||0x3;this[_0x464b('0x3a')]=_0x5011a5[_0x464b('0x3a')]||0x96;this['dialAgentRejectMaxRetry']=_0x5011a5[_0x464b('0x3b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x5011a5['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x5011a5[_0x464b('0x3c')]||0x4;this['Trunk']=_0x5011a5['Trunk']?_0x5011a5[_0x464b('0x3d')]:undefined;this[_0x464b('0x3e')]=_0x5011a5['TrunkBackup']?_0x5011a5['TrunkBackup']:undefined;this[_0x464b('0x3f')]=_0x5011a5[_0x464b('0x3f')]||undefined;this[_0x464b('0x40')]=_0x5011a5[_0x464b('0x40')]?_0x5011a5[_0x464b('0x40')]:undefined;this[_0x464b('0x41')]=_0x5011a5[_0x464b('0x41')]||_0x464b('0x42');this[_0x464b('0x43')]=_0x5011a5[_0x464b('0x43')]||undefined;this[_0x464b('0x44')]=_0x5011a5['dialCutDigit']||undefined;this['strategy']=strategy[_0x5011a5[_0x464b('0x45')]]||_0x464b('0x7');this[_0x464b('0x46')]=!![];this[_0x464b('0x47')]=_0x5011a5[_0x464b('0x47')]||![];this[_0x464b('0x48')]=_0x5011a5[_0x464b('0x48')];this[_0x464b('0x49')]=_0x5011a5[_0x464b('0x49')];this[_0x464b('0x4a')]=_0x5011a5[_0x464b('0x4a')];this[_0x464b('0x4b')]=_0x5011a5[_0x464b('0x4b')];this[_0x464b('0x4c')]=_0x5011a5['dialAMDMinWordLength'];this[_0x464b('0x4d')]=_0x5011a5['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x5011a5['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x5011a5[_0x464b('0x4e')];this[_0x464b('0x4f')]=_0x5011a5[_0x464b('0x4f')];this[_0x464b('0x50')]=0x0;this[_0x464b('0x51')]=0x0;this[_0x464b('0x52')]=_0x5011a5['timeout'];this[_0x464b('0x53')]=0x0;this[_0x464b('0x54')]=0x0;this[_0x464b('0x55')]=0x0;this[_0x464b('0x56')]=0x0;this[_0x464b('0x57')]=0x0;this[_0x464b('0x58')]=0x0;this[_0x464b('0x59')]=0x0;this[_0x464b('0x5a')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x464b('0x5b')]=0x0;this[_0x464b('0x5c')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x464b('0x5d')]=0x0;this[_0x464b('0x5e')]=0x0;this[_0x464b('0x5f')]=undefined;this[_0x464b('0x60')]=undefined;this['handlePredictive']=undefined;this[_0x464b('0x61')]=1.05;this[_0x464b('0x62')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x464b('0x63')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x464b('0x64')]=0x0;this[_0x464b('0x65')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x5011a5[_0x464b('0x66')]||0x14;this[_0x464b('0x67')]=_0x5011a5['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x464b('0x68')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x464b('0x69')]=0x0;this[_0x464b('0x6a')]=0x0;this[_0x464b('0x6b')]=0x0;this[_0x464b('0x6c')]=0x0;this[_0x464b('0x6d')]=_0x5011a5[_0x464b('0x6d')]||0x1e;this['dialRecallInQueue']=_0x5011a5['dialRecallInQueue']||![];this[_0x464b('0x6e')]=!!_0x5011a5['dialPreviewAutoRecallMe']||![];this[_0x464b('0x6f')]=!!_0x5011a5['dialPreviewRecallmeReminder']||![];this[_0x464b('0x70')]=_0x5011a5[_0x464b('0x70')]||undefined;this[_0x464b('0x71')]=_0x5011a5['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x5011a5['dialAgiAfterHangupAgent']||![];this[_0x464b('0xa')]=monitorFormat[_0x5011a5['monitor_format']]?monitorFormat[_0x5011a5[_0x464b('0xa')]]:undefined;this['mandatoryDisposition']=_0x5011a5[_0x464b('0x72')]||![];this[_0x464b('0x73')]=_0x5011a5[_0x464b('0x73')]?_0x5011a5[_0x464b('0x73')]:undefined;}module[_0x464b('0x74')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index cbba983..bf759a4 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 _0xa94f=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x579cc2,_0x1bf82f){var _0x2b1b2e=function(_0x47d8e6){while(--_0x47d8e6){_0x579cc2['push'](_0x579cc2['shift']());}};_0x2b1b2e(++_0x1bf82f);}(_0xa94f,0xad));var _0xfa94=function(_0x3bdcbb,_0x420a2c){_0x3bdcbb=_0x3bdcbb-0x0;var _0x2c90fc=_0xa94f[_0x3bdcbb];return _0x2c90fc;};'use strict';function VtigerAccount(_0x491250){this['id']=_0x491250['id']||0x0;this['name']=_0x491250[_0xfa94('0x0')]||'';this[_0xfa94('0x1')]=_0x491250[_0xfa94('0x1')]||'';this[_0xfa94('0x2')]=_0x491250[_0xfa94('0x2')]||'';this[_0xfa94('0x3')]=_0x491250[_0xfa94('0x3')]||'';this[_0xfa94('0x4')]=_0x491250['serverUrl']||'';this[_0xfa94('0x5')]=_0x491250['Configurations']||{};}module[_0xfa94('0x6')]=VtigerAccount; \ No newline at end of file +var _0xfbc5=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x20752b,_0x530fb7){var _0x124b49=function(_0x1df680){while(--_0x1df680){_0x20752b['push'](_0x20752b['shift']());}};_0x124b49(++_0x530fb7);}(_0xfbc5,0x98));var _0x5fbc=function(_0x41e189,_0x53c0cd){_0x41e189=_0x41e189-0x0;var _0x2399d2=_0xfbc5[_0x41e189];return _0x2399d2;};'use strict';function VtigerAccount(_0x48906d){this['id']=_0x48906d['id']||0x0;this['name']=_0x48906d[_0x5fbc('0x0')]||'';this['username']=_0x48906d[_0x5fbc('0x1')]||'';this[_0x5fbc('0x2')]=_0x48906d[_0x5fbc('0x2')]||'';this[_0x5fbc('0x3')]=_0x48906d['remoteUri']||'';this[_0x5fbc('0x4')]=_0x48906d[_0x5fbc('0x4')]||'';this[_0x5fbc('0x5')]=_0x48906d[_0x5fbc('0x5')]||{};}module[_0x5fbc('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 42506ef..57713b5 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 _0xb9bf=['name','username','password','token','remoteUri','type','serverUrl','Configurations','exports'];(function(_0x45b933,_0x3c67a9){var _0x417f9a=function(_0x524c08){while(--_0x524c08){_0x45b933['push'](_0x45b933['shift']());}};_0x417f9a(++_0x3c67a9);}(_0xb9bf,0x15f));var _0xfb9b=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xb9bf[_0xef8146];return _0x5a6cb0;};'use strict';function ZendeskAccount(_0x55e4b8){this['id']=_0x55e4b8['id']||0x0;this[_0xfb9b('0x0')]=_0x55e4b8[_0xfb9b('0x0')]||'';this[_0xfb9b('0x1')]=_0x55e4b8[_0xfb9b('0x1')]||'';this['password']=_0x55e4b8[_0xfb9b('0x2')]||'';this['token']=_0x55e4b8[_0xfb9b('0x3')]||'';this[_0xfb9b('0x4')]=_0x55e4b8[_0xfb9b('0x4')]||'';this['authType']=_0x55e4b8['authType']||'';this[_0xfb9b('0x5')]=_0x55e4b8['type']||'integrationTab';this[_0xfb9b('0x6')]=_0x55e4b8[_0xfb9b('0x6')]||'';this['Configurations']=_0x55e4b8[_0xfb9b('0x7')]||{};}module[_0xfb9b('0x8')]=ZendeskAccount; \ No newline at end of file +var _0x4784=['password','token','remoteUri','authType','type','integrationTab','serverUrl','exports','name','username'];(function(_0x1489eb,_0x4aedfe){var _0x45d37f=function(_0x595c9d){while(--_0x595c9d){_0x1489eb['push'](_0x1489eb['shift']());}};_0x45d37f(++_0x4aedfe);}(_0x4784,0x1c0));var _0x4478=function(_0x4ed349,_0x1e07ed){_0x4ed349=_0x4ed349-0x0;var _0xc4309a=_0x4784[_0x4ed349];return _0xc4309a;};'use strict';function ZendeskAccount(_0x5709f6){this['id']=_0x5709f6['id']||0x0;this[_0x4478('0x0')]=_0x5709f6['name']||'';this[_0x4478('0x1')]=_0x5709f6['username']||'';this[_0x4478('0x2')]=_0x5709f6[_0x4478('0x2')]||'';this[_0x4478('0x3')]=_0x5709f6['token']||'';this[_0x4478('0x4')]=_0x5709f6[_0x4478('0x4')]||'';this['authType']=_0x5709f6[_0x4478('0x5')]||'';this[_0x4478('0x6')]=_0x5709f6[_0x4478('0x6')]||_0x4478('0x7');this['serverUrl']=_0x5709f6[_0x4478('0x8')]||'';this['Configurations']=_0x5709f6['Configurations']||{};}module[_0x4478('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index bed2b35..364c22d 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 _0xc6df=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x1a2ee2,_0x47ee6b){var _0x1a9355=function(_0x5809ed){while(--_0x5809ed){_0x1a2ee2['push'](_0x1a2ee2['shift']());}};_0x1a9355(++_0x47ee6b);}(_0xc6df,0xa5));var _0xfc6d=function(_0x4c53b8,_0x442f32){_0x4c53b8=_0x4c53b8-0x0;var _0x4cb8f4=_0xc6df[_0x4c53b8];return _0x4cb8f4;};'use strict';function ZohoAccount(_0x2e2bb6){this['id']=_0x2e2bb6['id']||0x0;this[_0xfc6d('0x0')]=_0x2e2bb6['name']||'';this[_0xfc6d('0x1')]=_0x2e2bb6[_0xfc6d('0x1')]||'';this['host']=_0x2e2bb6[_0xfc6d('0x2')]||'';this[_0xfc6d('0x3')]=_0x2e2bb6['zone']||'';this[_0xfc6d('0x4')]=_0x2e2bb6[_0xfc6d('0x4')]||'';this[_0xfc6d('0x5')]=_0x2e2bb6[_0xfc6d('0x5')]||'';this[_0xfc6d('0x6')]=_0x2e2bb6[_0xfc6d('0x6')]||'';this[_0xfc6d('0x7')]=_0x2e2bb6[_0xfc6d('0x7')]||'';this[_0xfc6d('0x8')]=_0x2e2bb6['refreshToken']||'';this['Configurations']=_0x2e2bb6[_0xfc6d('0x9')]||{};}module[_0xfc6d('0xa')]=ZohoAccount; \ No newline at end of file +var _0xd306=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x38cb85,_0x47b32c){var _0x321665=function(_0x5763ac){while(--_0x5763ac){_0x38cb85['push'](_0x38cb85['shift']());}};_0x321665(++_0x47b32c);}(_0xd306,0x17c));var _0x6d30=function(_0xefd5ab,_0x45dfc3){_0xefd5ab=_0xefd5ab-0x0;var _0x51322f=_0xd306[_0xefd5ab];return _0x51322f;};'use strict';function ZohoAccount(_0xf22b5f){this['id']=_0xf22b5f['id']||0x0;this[_0x6d30('0x0')]=_0xf22b5f['name']||'';this[_0x6d30('0x1')]=_0xf22b5f[_0x6d30('0x1')]||'';this['host']=_0xf22b5f[_0x6d30('0x2')]||'';this[_0x6d30('0x3')]=_0xf22b5f[_0x6d30('0x3')]||'';this[_0x6d30('0x4')]=_0xf22b5f['clientId']||'';this[_0x6d30('0x5')]=_0xf22b5f['clientSecret']||'';this[_0x6d30('0x6')]=_0xf22b5f['serverUrl']||'';this['code']=_0xf22b5f[_0x6d30('0x7')]||'';this[_0x6d30('0x8')]=_0xf22b5f['refreshToken']||'';this['Configurations']=_0xf22b5f[_0x6d30('0x9')]||{};}module[_0x6d30('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 51ad10d..85f6f65 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 _0x0dfc=['calleridnum','countbusyretry','countnoanswerretry','countcongestionretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','prototype','\x22%s\x22\x20<%s>','number','util','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active'];(function(_0x3d7de8,_0x2a2ec4){var _0x5e9a0c=function(_0x5b0499){while(--_0x5b0499){_0x3d7de8['push'](_0x3d7de8['shift']());}};_0x5e9a0c(++_0x2a2ec4);}(_0x0dfc,0xe0));var _0xc0df=function(_0xb089c8,_0x19bb4a){_0xb089c8=_0xb089c8-0x0;var _0x481ac2=_0x0dfc[_0xb089c8];return _0x481ac2;};'use strict';var util=require(_0xc0df('0x0'));var _=require(_0xc0df('0x1'));var moment=require(_0xc0df('0x2'));function checkNameSurname(_0x17f0c3,_0x33417f,_0x59d2b0){var _0x5445a0='';if(!_[_0xc0df('0x3')](_0x33417f)&&_0xc0df('0x4')===typeof _0x33417f){_0x5445a0+=_0x33417f;}if(!_[_0xc0df('0x3')](_0x59d2b0)&&_0xc0df('0x4')===typeof _0x59d2b0){_0x5445a0+='\x20'+_0x59d2b0;}if(_0x5445a0!==''){return _0x5445a0;}return _0x17f0c3;}function Action(_0x5cca77,_0x57b697,_0x278fff,_0x4d7016,_0x115b22){this['uniqueid']=_0x278fff||undefined;this[_0xc0df('0x5')]=_0x5cca77['id'];this[_0xc0df('0x6')]=_0x57b697[_0xc0df('0x7')];this['type']=_0x57b697[_0xc0df('0x8')];this[_0xc0df('0x9')]='queue';this[_0xc0df('0xa')]=![];this[_0xc0df('0xb')]=_['isNil'](_0x5cca77[_0xc0df('0xc')])?undefined:_0x5cca77['Agent'][_0xc0df('0x7')];this[_0xc0df('0xd')]=this['membername']?util[_0xc0df('0xe')](_0xc0df('0xf'),this[_0xc0df('0xb')]):_0x4d7016||undefined;this[_0xc0df('0x10')]=checkNameSurname(_0x5cca77[_0xc0df('0x11')][_0xc0df('0x12')],_0x5cca77['Contact'][_0xc0df('0x13')],_0x5cca77['Contact'][_0xc0df('0x14')]);this[_0xc0df('0x15')]=_0x5cca77[_0xc0df('0x15')]||![];this[_0xc0df('0x16')]=_0x5cca77[_0xc0df('0x11')][_0xc0df('0x12')];this['scheduledat']=_0x5cca77['scheduledat'];this['countbusyretry']=_0x5cca77[_0xc0df('0x17')]||0x0;this['countcongestionretry']=_0x5cca77['countcongestionretry']||0x0;this[_0xc0df('0x18')]=_0x5cca77[_0xc0df('0x18')]||0x0;this['countglobal']=(_0x5cca77[_0xc0df('0x17')]||0x0)+(_0x5cca77[_0xc0df('0x19')]||0x0)+(_0x5cca77['countnoanswerretry']||0x0)+(_0x5cca77['countnosuchnumberretry']||0x0)+(_0x5cca77[_0xc0df('0x1a')]||0x0)+(_0x5cca77['countabandonedretry']||0x0)+(_0x5cca77[_0xc0df('0x1b')]||0x0)+(_0x5cca77['countagentrejectretry']||0x0);this['countnosuchnumberretry']=_0x5cca77['countnosuchnumberretry']||0x0;this[_0xc0df('0x1a')]=_0x5cca77['countdropretry']||0x0;this[_0xc0df('0x1c')]=_0x5cca77['countabandonedretry']||0x0;this[_0xc0df('0x1b')]=_0x5cca77[_0xc0df('0x1b')]||0x0;this[_0xc0df('0x1d')]=_0x5cca77[_0xc0df('0x1d')]||0x0;this[_0xc0df('0x1e')]=_0x5cca77[_0xc0df('0x1e')];this['callbackuniqueid']=_0x5cca77[_0xc0df('0x1f')];this[_0xc0df('0x20')]=_0x5cca77[_0xc0df('0x20')];this['recallme']=_0x5cca77[_0xc0df('0x21')];this['ContactId']=_0x5cca77[_0xc0df('0x22')];this[_0xc0df('0x23')]=_0x5cca77[_0xc0df('0x23')];this['UserId']=_[_0xc0df('0x3')](_0x5cca77[_0xc0df('0xc')])?_0x5cca77[_0xc0df('0x24')]:_0x5cca77[_0xc0df('0xc')]['id'];this['VoiceQueueId']=_0x5cca77[_0xc0df('0x25')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xc0df('0x26')]['getCaller']=function(){return util['format'](_0xc0df('0x27'),this['calleridname'],this[_0xc0df('0x28')]);};module['exports']=Action; \ No newline at end of file +var _0xb7f3=['name','type','campaigntype','dialAnswer','membername','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','Agent','UserId','VoiceQueueId','originatecalleridnum','getCaller','format','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','uniqueid','idContact','queue'];(function(_0x183b99,_0x25a933){var _0x27c0a6=function(_0x1bb406){while(--_0x1bb406){_0x183b99['push'](_0x183b99['shift']());}};_0x27c0a6(++_0x25a933);}(_0xb7f3,0x10d));var _0x3b7f=function(_0x24a9a3,_0x64cb35){_0x24a9a3=_0x24a9a3-0x0;var _0x241f63=_0xb7f3[_0x24a9a3];return _0x241f63;};'use strict';var util=require(_0x3b7f('0x0'));var _=require(_0x3b7f('0x1'));var moment=require(_0x3b7f('0x2'));function checkNameSurname(_0xcf4b07,_0x14fadb,_0x54f2bd){var _0x1ca10a='';if(!_[_0x3b7f('0x3')](_0x14fadb)&&'string'===typeof _0x14fadb){_0x1ca10a+=_0x14fadb;}if(!_[_0x3b7f('0x3')](_0x54f2bd)&&'string'===typeof _0x54f2bd){_0x1ca10a+='\x20'+_0x54f2bd;}if(_0x1ca10a!==''){return _0x1ca10a;}return _0xcf4b07;}function Action(_0x8740d7,_0x1b7d7d,_0x428afd,_0x302ab3,_0x33480b){this[_0x3b7f('0x4')]=_0x428afd||undefined;this[_0x3b7f('0x5')]=_0x8740d7['id'];this[_0x3b7f('0x6')]=_0x1b7d7d[_0x3b7f('0x7')];this[_0x3b7f('0x8')]=_0x1b7d7d[_0x3b7f('0x8')];this[_0x3b7f('0x9')]=_0x3b7f('0x6');this[_0x3b7f('0xa')]=![];this[_0x3b7f('0xb')]=_[_0x3b7f('0x3')](_0x8740d7['Agent'])?undefined:_0x8740d7['Agent'][_0x3b7f('0x7')];this[_0x3b7f('0xc')]=this[_0x3b7f('0xb')]?util['format'](_0x3b7f('0xd'),this['membername']):_0x302ab3||undefined;this[_0x3b7f('0xe')]=checkNameSurname(_0x8740d7[_0x3b7f('0xf')][_0x3b7f('0x10')],_0x8740d7['Contact'][_0x3b7f('0x11')],_0x8740d7[_0x3b7f('0xf')][_0x3b7f('0x12')]);this[_0x3b7f('0x13')]=_0x8740d7[_0x3b7f('0x13')]||![];this[_0x3b7f('0x14')]=_0x8740d7[_0x3b7f('0xf')]['phone'];this[_0x3b7f('0x15')]=_0x8740d7[_0x3b7f('0x15')];this[_0x3b7f('0x16')]=_0x8740d7[_0x3b7f('0x16')]||0x0;this[_0x3b7f('0x17')]=_0x8740d7[_0x3b7f('0x17')]||0x0;this[_0x3b7f('0x18')]=_0x8740d7[_0x3b7f('0x18')]||0x0;this[_0x3b7f('0x19')]=(_0x8740d7[_0x3b7f('0x16')]||0x0)+(_0x8740d7['countcongestionretry']||0x0)+(_0x8740d7['countnoanswerretry']||0x0)+(_0x8740d7[_0x3b7f('0x1a')]||0x0)+(_0x8740d7['countdropretry']||0x0)+(_0x8740d7[_0x3b7f('0x1b')]||0x0)+(_0x8740d7['countmachineretry']||0x0)+(_0x8740d7['countagentrejectretry']||0x0);this['countnosuchnumberretry']=_0x8740d7[_0x3b7f('0x1a')]||0x0;this[_0x3b7f('0x1c')]=_0x8740d7['countdropretry']||0x0;this[_0x3b7f('0x1b')]=_0x8740d7[_0x3b7f('0x1b')]||0x0;this[_0x3b7f('0x1d')]=_0x8740d7['countmachineretry']||0x0;this[_0x3b7f('0x1e')]=_0x8740d7[_0x3b7f('0x1e')]||0x0;this['callback']=_0x8740d7[_0x3b7f('0x1f')];this[_0x3b7f('0x20')]=_0x8740d7[_0x3b7f('0x20')];this[_0x3b7f('0x21')]=_0x8740d7[_0x3b7f('0x21')];this[_0x3b7f('0x22')]=_0x8740d7[_0x3b7f('0x22')];this[_0x3b7f('0x23')]=_0x8740d7[_0x3b7f('0x23')];this[_0x3b7f('0x24')]=_0x8740d7[_0x3b7f('0x24')];this['UserId']=_[_0x3b7f('0x3')](_0x8740d7[_0x3b7f('0x25')])?_0x8740d7[_0x3b7f('0x26')]:_0x8740d7[_0x3b7f('0x25')]['id'];this[_0x3b7f('0x27')]=_0x8740d7[_0x3b7f('0x27')];this[_0x3b7f('0x28')]='';this['originatecalleridname']='';}Action['prototype'][_0x3b7f('0x29')]=function(){return util[_0x3b7f('0x2a')](_0x3b7f('0x2b'),this[_0x3b7f('0xe')],this[_0x3b7f('0x2c')]);};module[_0x3b7f('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index ee85569..f5958b4 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 _0x885a=['Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','callerid','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','getCallerId','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','response','idContact','custom:agentringnoanswer','callProgressDetectingAgent','[syncHangup][talking]','[syncHangup][talking][cause]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','defaults','redis','localhost','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','syncHangupRequest','syncDialEnd','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','strategy','answered','loggedIn','pTalking','sumBillable','sumHoldTime','talking','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','name','active','Interval','stringify','md5','format','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','outbound','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','info','Queue','queue','pTalking:\x20','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','custom:agentConnectPreview','buildAcw','complete','outboundAnswerCallsDay','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','createCustomerFinal','sumDuration','talktime','outboundBusyCallsDay','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','NOANSWER','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countnoanswerretry','CONGESTION','countcongestionretry','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','Global','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','pick','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x885a,0x180));var _0xa885=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x885a[_0x21a9d9];return _0x46adce;};'use strict';var util=require('util');var _=require(_0xa885('0x0'));var BPromise=require(_0xa885('0x1'));var uuid=require(_0xa885('0x2'));var moment=require(_0xa885('0x3'));var md5=require('md5');var Redis=require(_0xa885('0x4'));var config=require(_0xa885('0x5'));var logger=require(_0xa885('0x6'))(_0xa885('0x7'));var loggerAction=require(_0xa885('0x6'))(_0xa885('0x8'));var ami=require('../ami');var rpcDb=require(_0xa885('0x9'));var Action=require(_0xa885('0xa'));var ut=require(_0xa885('0xb'));config['redis']=_[_0xa885('0xc')](config[_0xa885('0xd')],{'host':_0xa885('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa885('0xd')]));var Sequence=function(){};Sequence[_0xa885('0xf')][_0xa885('0x10')]=function(_0x745710){this[_0xa885('0x11')]=this[_0xa885('0x11')]?this[_0xa885('0x11')]['finally'](_0x745710):_0x745710();};function Preview(_0x8a82f5){this[_0xa885('0x12')]=new Sequence();this[_0xa885('0x13')]=_0x8a82f5[_0xa885('0x14')];this[_0xa885('0x15')]=_0x8a82f5[_0xa885('0x15')];this[_0xa885('0x16')]={};this['agents']=_0x8a82f5[_0xa885('0x17')];this[_0xa885('0x18')]=0x0;ami['on'](_0xa885('0x19'),this[_0xa885('0x1a')][_0xa885('0x1b')](this));ami['on']('hangup',this[_0xa885('0x1c')][_0xa885('0x1b')](this));ami['on']('hanguprequest',this[_0xa885('0x1d')][_0xa885('0x1b')](this));ami['on']('dialend',this[_0xa885('0x1e')][_0xa885('0x1b')](this));ami['on']('newexten',this[_0xa885('0x1f')]['bind'](this));ami['on'](_0xa885('0x20'),this[_0xa885('0x21')][_0xa885('0x1b')](this));ami['on']('attendedtransfer',this[_0xa885('0x22')]['bind'](this));ami['on'](_0xa885('0x23'),this[_0xa885('0x24')][_0xa885('0x1b')](this));this['loopCampaigns'](this[_0xa885('0x13')]);}function emit(_0x32b8df,_0x1530b6,_0x4de770){io['to'](_0x32b8df)[_0xa885('0x25')](_0x1530b6,_0x4de770);}function emitCampaignPreview(_0x465611){if(_0x465611[_0xa885('0x26')]==='outbound'){var _0x303830={'id':_0x465611['id'],'name':_0x465611['name'],'strategy':_0x465611[_0xa885('0x27')],'answered':_0x465611[_0xa885('0x28')],'available':_0x465611['available'],'loggedIn':_0x465611[_0xa885('0x29')],'pTalking':_0x465611[_0xa885('0x2a')],'sumBillable':_0x465611[_0xa885('0x2b')],'sumDuration':_0x465611['sumDuration'],'sumHoldTime':_0x465611[_0xa885('0x2c')]||0x0,'talking':_0x465611[_0xa885('0x2d')],'total':_0x465611['total'],'type':_0x465611[_0xa885('0x26')],'unmanaged':_0x465611['unmanaged'],'abandoned':_0x465611[_0xa885('0x2e')],'waiting':_0x465611['waiting'],'loggedInDb':_0x465611[_0xa885('0x2f')],'dialActive':_0x465611[_0xa885('0x30')],'dialMethod':_0x465611[_0xa885('0x31')],'dialOriginateCallerIdName':_0x465611[_0xa885('0x32')],'dialOriginateCallerIdNumber':_0x465611[_0xa885('0x33')],'dialOriginateTimeout':_0x465611[_0xa885('0x34')],'dialPrefix':_0x465611[_0xa885('0x35')],'outboundAnswerAgiCallsDay':_0x465611[_0xa885('0x36')],'outboundAnswerCallsDay':_0x465611['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x465611['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x465611['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x465611['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x465611[_0xa885('0x37')],'outboundDropCallsDayCallersExit':_0x465611[_0xa885('0x38')],'outboundDropCallsDayTimeout':_0x465611[_0xa885('0x39')],'outboundNoAnswerCallsDay':_0x465611[_0xa885('0x3a')],'outboundNoSuchCallsDay':_0x465611[_0xa885('0x3b')],'outboundOriginateFailureCallsDay':_0x465611[_0xa885('0x3c')],'outboundReCallsDay':_0x465611['outboundReCallsDay'],'outboundRejectCallsDay':_0x465611[_0xa885('0x3d')],'outboundUnknownCallsDay':_0x465611['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x465611[_0xa885('0x3e')],'predictiveIntervalAnsweredCalls':_0x465611['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x465611[_0xa885('0x3f')],'predictiveIntervalAvgTalktime':_0x465611['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x465611[_0xa885('0x40')],'predictiveIntervalDroppedCallsTimeout':_0x465611[_0xa885('0x41')],'predictiveIntervalErlangCalls':_0x465611[_0xa885('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x465611['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x465611[_0xa885('0x43')],'predictiveIntervalMultiplicativeFactor':_0x465611[_0xa885('0x44')],'predictiveIntervalPauses':_0x465611['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x465611[_0xa885('0x45')],'predictiveIntervalTotalCalls':_0x465611['predictiveIntervalTotalCalls'],'message':_0x465611[_0xa885('0x46')],'originated':_0x465611[_0xa885('0x47')],'erlangCalls':_0x465611[_0xa885('0x48')],'erlangCallToSecond':_0x465611['erlangCallToSecond'],'erlangAbandonmentRate':_0x465611[_0xa885('0x49')],'erlangBusyFactor':_0x465611[_0xa885('0x4a')],'startPredictive':_0x465611[_0xa885('0x4b')],'startProgressive':_0x465611['startProgressive']};if(_0x465611[_0xa885('0x4c')]){_0x303830[_0xa885('0x4c')]={'id':_0x465611[_0xa885('0x4c')]['id'],'name':_0x465611[_0xa885('0x4c')][_0xa885('0x4d')],'active':_0x465611[_0xa885('0x4c')][_0xa885('0x4e')],'callerid':_0x465611[_0xa885('0x4c')]['callerid']};}if(_0x465611['Interval']){_0x303830[_0xa885('0x4f')]={'id':_0x465611[_0xa885('0x4f')]['id'],'name':_0x465611[_0xa885('0x4f')][_0xa885('0x4d')]};}var _0x405bac=md5(JSON[_0xa885('0x50')](_0x303830));if(_0x465611[_0xa885('0x51')]!==_0x405bac){_0x465611[_0xa885('0x51')]=_0x405bac;emit(util[_0xa885('0x52')]('voice:queue:%s',_0x303830['name']),_0xa885('0x53'),_0x303830);}}}function emitVoiceQueueChannelRemove(_0x576c78){logger['info'](_0xa885('0x54'),JSON['stringify'](_0x576c78));emit(util[_0xa885('0x52')](_0xa885('0x55'),_0x576c78[_0xa885('0x4d')]),_0xa885('0x56'),_0x576c78);io[_0xa885('0x25')](_0xa885('0x57'),_0x576c78);}function notSendMessagesQueue(_0x113298){if(_0x113298[_0xa885('0x58')]){if(_0x113298[_0xa885('0x47')]===0x0&&_0x113298[_0xa885('0x2a')]===0x0){_0x113298['sendMessageOneNotActive']=![];_0x113298[_0xa885('0x59')]=0x0;_0x113298[_0xa885('0x5a')]=0x0;_0x113298[_0xa885('0x46')]=_0xa885('0x5b');ut[_0xa885('0x5c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x113298['name']+_0xa885('0x5d'));}else{_0x113298[_0xa885('0x46')]=_0xa885('0x5e');ut[_0xa885('0x5c')](_0xa885('0x5f'),_0x113298['name']+_0xa885('0x60'));}emitCampaignPreview(_0x113298);}}Preview[_0xa885('0xf')]['loopCampaigns']=function(){var _0x491478=this;setInterval(function(){_0x491478[_0xa885('0x61')]();},0x7cf);};Preview[_0xa885('0xf')]['syncCampaigns']=function(){var _0x561bf0=this[_0xa885('0x13')];this[_0xa885('0x18')]+=0x1;for(var _0x2a3a3f in _0x561bf0){if(_0x561bf0[_0xa885('0x62')](_0x2a3a3f)&&(_0x561bf0[_0x2a3a3f][_0xa885('0x31')]===_0xa885('0x7')||_0x561bf0[_0x2a3a3f][_0xa885('0x31')]===_0xa885('0x63'))&&_0x561bf0[_0x2a3a3f][_0xa885('0x26')]===_0xa885('0x64')){if(this[_0xa885('0x18')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xa885('0x65')]();}}if(_0x561bf0[_0xa885('0x62')](_0x2a3a3f)&&_0x561bf0[_0x2a3a3f][_0xa885('0x31')]==='preview'&&_0x561bf0[_0x2a3a3f][_0xa885('0x26')]===_0xa885('0x64')){if(_0x561bf0[_0x2a3a3f][_0xa885('0x30')]){this[_0xa885('0x66')](_0x561bf0[_0x2a3a3f]);if(_0x561bf0[_0x2a3a3f]['dialPreviewAutoRecallMe'])this[_0xa885('0x67')](_0x561bf0[_0x2a3a3f]);}else{notSendMessagesQueue(_0x561bf0[_0x2a3a3f]);}}}};Preview['prototype'][_0xa885('0x68')]=function(_0x245fe9){var _0x4aa113=this;this[_0xa885('0x12')][_0xa885('0x10')](function(){if(!_[_0xa885('0x69')](_0x4aa113[_0xa885('0x16')][_0x245fe9])){loggerAction[_0xa885('0x6a')]('[clearZombieChannels][talking]',_0x245fe9,_0xa885('0x6b'),_0x4aa113[_0xa885('0x16')][_0x245fe9][_0xa885('0x6c')],'originated:\x20',JSON['stringify'](_0x4aa113['campaignsPreview'][_0x4aa113[_0xa885('0x16')][_0x245fe9][_0xa885('0x6c')]][_0xa885('0x47')]),_0xa885('0x6d'),JSON[_0xa885('0x50')](_0x4aa113[_0xa885('0x13')][_0x4aa113[_0xa885('0x16')][_0x245fe9][_0xa885('0x6c')]][_0xa885('0x2a')]),JSON[_0xa885('0x50')](_0x4aa113[_0xa885('0x16')][_0x245fe9]['dialAnswer']),JSON['stringify'](_['pick'](_0x4aa113[_0xa885('0x16')][_0x245fe9],[_0xa885('0x6e'),_0xa885('0x6f'),_0xa885('0x70'),_0xa885('0x71')])));return ami[_0xa885('0x72')]({'action':_0xa885('0x73'),'channel':_0x4aa113['actions'][_0x245fe9][_0xa885('0x74')]})[_0xa885('0x75')](function(_0x45806c){if(_0x45806c[_0xa885('0x46')]===_0xa885('0x76')){setTimeout(function(){if(_0x4aa113[_0xa885('0x16')][_0x245fe9]){ut[_0xa885('0x77')](_0x4aa113['campaignsPreview'][_0x4aa113[_0xa885('0x16')][_0x245fe9][_0xa885('0x6c')]],_0xa885('0x78'));if(_0x4aa113['actions'][_0x245fe9][_0xa885('0x79')]===!![]){ut[_0xa885('0x7a')](_0x4aa113[_0xa885('0x13')][_0x4aa113[_0xa885('0x16')][_0x245fe9][_0xa885('0x6c')]],_0xa885('0x78'));ut[_0xa885('0x7b')](_0xa885('0x7c')+_0x245fe9,_0x4aa113['actions'][_0x245fe9][_0xa885('0x6c')]);}ut[_0xa885('0x7b')](_0xa885('0x7d')+_0x245fe9,_0x4aa113['actions'][_0x245fe9][_0xa885('0x6c')]);delete _0x4aa113[_0xa885('0x16')][_0x245fe9];}},0x2328);}});}});};Preview[_0xa885('0xf')][_0xa885('0x65')]=function(){var _0x2eb4d6=this;loggerAction[_0xa885('0x6a')]('[action]',_[_0xa885('0x7e')](this[_0xa885('0x16')]));for(var _0x27d0b3 in this['actions']){if(_0x2eb4d6[_0xa885('0x16')][_0xa885('0x62')](_0x27d0b3)){_0x2eb4d6[_0xa885('0x68')](_0x27d0b3);}}};Preview[_0xa885('0xf')][_0xa885('0x67')]=function(_0x2ee5eb){var _0x16f162=this;rpcDb[_0xa885('0x7f')](_0x2ee5eb['id'],ut[_0xa885('0x80')](this['agents']))[_0xa885('0x81')](function(_0x333502){if(!_['isNil'](_0x333502)){for(var _0x4dc788=0x0;_0x4dc788<_0x333502[_0xa885('0x82')];_0x4dc788+=0x1){if(ut[_0xa885('0x83')](_0x333502[_0x4dc788]['scheduledat'])<_0x2ee5eb[_0xa885('0x84')]*0x3c){if(_0x333502[_0x4dc788][_0xa885('0x85')]&&!_0x333502[_0x4dc788][_0xa885('0x85')][_0xa885('0x86')]){_0x16f162[_0xa885('0x87')](_0x333502[_0x4dc788]['id'])[_0xa885('0x81')](ut[_0xa885('0x88')]('[RecallMe]'))[_0xa885('0x75')](ut[_0xa885('0x88')]('[RecallMe]'));}else{rpcDb[_0xa885('0x89')](_0x333502[_0x4dc788]['id']);}}else{var _0x48ded4=new Action(_0x333502[_0x4dc788],_0x2ee5eb);_0x48ded4[_0xa885('0x8a')]=moment()['format'](_0xa885('0x8b'));_0x2ee5eb[_0xa885('0x8c')]+=0x1;ut[_0xa885('0x8d')](_0x48ded4,0x17,_0xa885('0x8e'));if(_0x2ee5eb['dialRecallInQueue']){rpcDb[_0xa885('0x8f')](ut[_0xa885('0x90')](_0x333502[_0x4dc788]));rpcDb[_0xa885('0x91')](_0x48ded4,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xa885('0x8d')](_0x48ded4,0x16,'RecallFailedTimeout');rpcDb[_0xa885('0x91')](_0x48ded4,_0xa885('0x92'));rpcDb['createCustomerFinal'](_0x48ded4,_0xa885('0x92'));}}}}})['catch'](ut[_0xa885('0x88')](_0xa885('0x93')));};Preview['prototype'][_0xa885('0x66')]=function(_0x569d63){_0x569d63[_0xa885('0x58')]=!![];if(ut[_0xa885('0x94')](_0x569d63['loggedIn'])){_0x569d63['message']=_0xa885('0x95');}else if(!ut[_0xa885('0x96')](_0x569d63['dialActive'])){_0x569d63['message']=_0xa885('0x5b');}else if(!this[_0xa885('0x97')](_0x569d63[_0xa885('0x4c')])){if(!this[_0xa885('0x97')](_0x569d63[_0xa885('0x98')])){_0x569d63[_0xa885('0x46')]=_0xa885('0x99');}else{_0x569d63[_0xa885('0x46')]=_0xa885('0x9a');}}else{_0x569d63[_0xa885('0x46')]=_0xa885('0x9a');}emitCampaignPreview(_0x569d63);};Preview['prototype'][_0xa885('0x9b')]=function(_0x32e7ff,_0x3babfe,_0x3a0794){var _0x1da286=this;var _0x5cc2cf=this[_0xa885('0x16')][_0x3babfe];var _0x59ae23=this['campaignsPreview'][_0x5cc2cf[_0xa885('0x6c')]];var _0x3ce170;if(_0x59ae23){switch(_0x3a0794){case'1':_0x59ae23['outboundNoSuchCallsDay']+=0x1;_0x5cc2cf['countnosuchnumberretry']+=0x1;_0x5cc2cf[_0xa885('0x9c')]=ut[_0xa885('0x9d')](_0x5cc2cf);ut[_0xa885('0x8d')](_0x5cc2cf,0x0,'NoSuchNumber');ami['emit'](_0xa885('0x9e'),ut[_0xa885('0x9f')](_0x5cc2cf,_0xa885('0xa0')));rpcDb[_0xa885('0x91')](_0x5cc2cf,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xa885('0x9d')](_0x5cc2cf)>=_0x59ae23[_0xa885('0xa1')]){_0x3ce170=ut[_0xa885('0xa2')](_0x5cc2cf,0xf,'Global');rpcDb['createCustomerFinal'](_0x3ce170,_0xa885('0xa3'));}else{if(_0x5cc2cf[_0xa885('0xa4')]>=_0x59ae23[_0xa885('0xa5')]){rpcDb['createCustomerFinal'](_0x5cc2cf,_0xa885('0xa3'));}else{rpcDb[_0xa885('0xa6')](ut[_0xa885('0xa7')](_0x5cc2cf,_0xa885('0xa4'),_0x59ae23['dialNoSuchNumberRetryFrequency']),_0x5cc2cf[_0xa885('0xa8')],_0x5cc2cf[_0xa885('0xa9')]);}}delete this['actions'][_0x32e7ff[_0xa885('0xaa')]];break;case _0xa885('0xab'):var _0x5a7bde=moment()[_0xa885('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x5cc2cf[_0xa885('0xac')]=_0x5a7bde;_0x5cc2cf[_0xa885('0xad')]=_0x5a7bde;_0x5cc2cf[_0xa885('0x79')]=!![];_0x59ae23[_0xa885('0x2a')]+=0x1;logger[_0xa885('0x6a')](_0xa885('0xae'),_0x5cc2cf[_0xa885('0xaf')],_0xa885('0xb0'),_0x59ae23['name'],'pTalking:\x20',_0x59ae23[_0xa885('0x2a')]);ami[_0xa885('0x25')]('custom:agentconnect',ut[_0xa885('0x9f')](_0x5cc2cf,_0xa885('0xb1'),this['campaignsPreview'][_0x5cc2cf[_0xa885('0x6c')]]));if(_0x59ae23['acw']){ami[_0xa885('0x25')](_0xa885('0xb2'),ut[_0xa885('0xb3')](_0x5cc2cf));}break;case'16':ami[_0xa885('0x25')]('custom:agentcomplete',ut['buildObj'](_0x5cc2cf,_0xa885('0xb4'),this[_0xa885('0x13')][_0x5cc2cf[_0xa885('0x6c')]]));emitVoiceQueueChannelRemove(ut[_0xa885('0x9f')](_0x5cc2cf,_0xa885('0xb4')));_0x59ae23[_0xa885('0xb5')]+=0x1;_0x59ae23[_0xa885('0xb6')]+=0x1;_0x59ae23[_0xa885('0x28')]+=0x1;ut['decrementTalkink'](_0x59ae23,_0xa885('0xb7'));_0x5cc2cf['countglobal']=ut[_0xa885('0x9d')](_0x5cc2cf);ut[_0xa885('0x8d')](_0x5cc2cf,0x4,_0xa885('0xb8'));rpcDb['createCustomerHistory'](_0x5cc2cf,_0xa885('0xb9'));rpcDb[_0xa885('0xba')](_0x5cc2cf,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x5cc2cf);_0x59ae23[_0xa885('0xbb')]+=_0x5cc2cf[_0xa885('0xbc')];_0x59ae23[_0xa885('0x2b')]+=_0x5cc2cf[_0xa885('0xbc')];logger[_0xa885('0x6a')]('[syncHangup][talking][decrement]',_0x5cc2cf['uniqueid'],_0xa885('0xb0'),_0x59ae23[_0xa885('0x4d')],_0xa885('0x6d'),_0x59ae23[_0xa885('0x2a')]);delete this['actions'][_0x32e7ff['linkedid']];break;case'BUSY':_0x59ae23[_0xa885('0xbd')]+=0x1;_0x5cc2cf[_0xa885('0xbe')]+=0x1;_0x5cc2cf[_0xa885('0x9c')]=ut[_0xa885('0x9d')](_0x5cc2cf);ut[_0xa885('0x8d')](_0x5cc2cf,0x5,_0xa885('0xbf'));ami[_0xa885('0x25')]('custom:agentbusy',ut['buildObj'](_0x5cc2cf,_0xa885('0xc0')));rpcDb['createCustomerHistory'](_0x5cc2cf,_0xa885('0xc1'));if(ut[_0xa885('0x9d')](_0x5cc2cf)>=_0x59ae23[_0xa885('0xa1')]){_0x3ce170=ut[_0xa885('0xa2')](_0x5cc2cf,0xf,'Global');rpcDb[_0xa885('0xba')](_0x3ce170,_0xa885('0xc2'));}else{if(_0x5cc2cf[_0xa885('0xbe')]>=_0x59ae23['dialBusyMaxRetry']){rpcDb[_0xa885('0xba')](_0x5cc2cf,_0xa885('0xc1'));}else{rpcDb[_0xa885('0xa6')](ut['scheduledAt'](_0x5cc2cf,_0xa885('0xbe'),_0x59ae23[_0xa885('0xc3')]),_0x5cc2cf[_0xa885('0xa8')],_0x5cc2cf[_0xa885('0xa9')]);}}break;case _0xa885('0xc4'):_0x59ae23[_0xa885('0x3a')]+=0x1;_0x5cc2cf['countnoanswerretry']+=0x1;_0x5cc2cf[_0xa885('0x9c')]=ut[_0xa885('0x9d')](_0x5cc2cf);ut[_0xa885('0x8d')](_0x5cc2cf,0x3,_0xa885('0xc5'));ami['emit'](_0xa885('0xc6'),ut[_0xa885('0x9f')](_0x5cc2cf,_0xa885('0xc7')));rpcDb[_0xa885('0x91')](_0x5cc2cf,_0xa885('0xc8'));if(ut[_0xa885('0x9d')](_0x5cc2cf)>=_0x59ae23[_0xa885('0xa1')]){_0x3ce170=ut[_0xa885('0xa2')](_0x5cc2cf,0xf,'Global');rpcDb[_0xa885('0xba')](_0x3ce170,_0xa885('0xc9'));}else{if(_0x5cc2cf['countnoanswerretry']>=_0x59ae23[_0xa885('0xca')]){rpcDb['createCustomerFinal'](_0x5cc2cf,_0xa885('0xc8'));}else{rpcDb[_0xa885('0xa6')](ut['scheduledAt'](_0x5cc2cf,_0xa885('0xcb'),_0x59ae23['dialNoAnswerRetryFrequency']),_0x5cc2cf[_0xa885('0xa8')],_0x5cc2cf['activeContact']);}}break;case _0xa885('0xcc'):_0x59ae23['outboundCongestionCallsDay']+=0x1;_0x5cc2cf[_0xa885('0xcd')]+=0x1;_0x5cc2cf[_0xa885('0x9c')]=ut[_0xa885('0x9d')](_0x5cc2cf);ut[_0xa885('0x8d')](_0x5cc2cf,0x8,'Congestion');ami[_0xa885('0x25')](_0xa885('0xce'),ut[_0xa885('0x9f')](_0x5cc2cf,'congestion'));rpcDb[_0xa885('0x91')](_0x5cc2cf,_0xa885('0xcf'));if(ut[_0xa885('0x9d')](_0x5cc2cf)>=_0x59ae23['dialGlobalMaxRetry']){_0x3ce170=ut[_0xa885('0xa2')](_0x5cc2cf,0xf,_0xa885('0xd0'));rpcDb['createCustomerFinal'](_0x3ce170,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x5cc2cf[_0xa885('0xcd')]>=_0x59ae23[_0xa885('0xd1')]){rpcDb[_0xa885('0xba')](_0x5cc2cf,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xa885('0xa6')](ut[_0xa885('0xa7')](_0x5cc2cf,_0xa885('0xcd'),_0x59ae23[_0xa885('0xc3')]),_0x5cc2cf[_0xa885('0xa8')],_0x5cc2cf[_0xa885('0xa9')]);}}break;case _0xa885('0xd2'):_0x59ae23[_0xa885('0x3d')]+=0x1;_0x5cc2cf[_0xa885('0xd3')]+=0x1;_0x5cc2cf[_0xa885('0x9c')]=ut['totalGlobal'](_0x5cc2cf);ut['logCustomer'](_0x5cc2cf,0x14,_0xa885('0xd4'));ami['emit'](_0xa885('0xd5'),ut[_0xa885('0x9f')](_0x5cc2cf,_0xa885('0xd6')));rpcDb['createCustomerHistory'](_0x5cc2cf,_0xa885('0xd7'));if(ut[_0xa885('0x9d')](_0x5cc2cf)>=_0x59ae23[_0xa885('0xa1')]){_0x3ce170=ut[_0xa885('0xa2')](_0x5cc2cf,0x14,_0xa885('0xd4'));rpcDb[_0xa885('0xba')](_0x3ce170,_0xa885('0xd8'));}else{if(_0x5cc2cf['countagentrejectretry']>=_0x59ae23[_0xa885('0xd9')]){rpcDb[_0xa885('0xba')](_0x5cc2cf,_0xa885('0xd8'));}else{rpcDb[_0xa885('0xa6')](ut['scheduledAt'](_0x5cc2cf,_0xa885('0xd3'),_0x59ae23[_0xa885('0xda')]),_0x5cc2cf['unlockAgent'],_0x5cc2cf['activeContact']);}}break;case _0xa885('0xdb'):_0x59ae23[_0xa885('0x3e')]+=0x1;_0x5cc2cf[_0xa885('0xdc')]+=0x1;_0x5cc2cf[_0xa885('0x9c')]=ut[_0xa885('0x9d')](_0x5cc2cf);ut[_0xa885('0x8d')](_0x5cc2cf,0xb,_0xa885('0xdd'));rpcDb[_0xa885('0x91')](_0x5cc2cf,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0xa885('0x9d')](_0x5cc2cf)>=_0x59ae23['dialGlobalMaxRetry']){_0x3ce170=ut[_0xa885('0xa2')](_0x5cc2cf,0xf,_0xa885('0xd0'));rpcDb[_0xa885('0xba')](_0x3ce170,_0xa885('0xde'));}else{if(_0x5cc2cf['countabandonedetry']>=_0x59ae23[_0xa885('0xdf')]){rpcDb[_0xa885('0xba')](_0x5cc2cf,_0xa885('0xde'));}else{rpcDb[_0xa885('0xa6')](ut['scheduledAt'](_0x5cc2cf,_0xa885('0xdc'),_0x59ae23['dialAbandonedRetryFrequency']),_0x5cc2cf[_0xa885('0xa8')],_0x5cc2cf['activeContact']);}}break;case'18':_0x59ae23[_0xa885('0xe0')]+=0x1;_0x5cc2cf[_0xa885('0xe1')]+=0x1;_0x5cc2cf[_0xa885('0x9c')]=ut['totalGlobal'](_0x5cc2cf);ut[_0xa885('0x8d')](_0x5cc2cf,0x12,_0x32e7ff[_0xa885('0xe2')]||_0x32e7ff[_0xa885('0xe3')]);ami[_0xa885('0x25')](_0xa885('0xe4'),ut[_0xa885('0x9f')](_0x5cc2cf,_0xa885('0xe5')));rpcDb[_0xa885('0x91')](_0x5cc2cf,_0xa885('0xe6'));if(ut[_0xa885('0x9d')](_0x5cc2cf)>=_0x59ae23[_0xa885('0xa1')]){_0x3ce170=ut[_0xa885('0xa2')](_0x5cc2cf,0xf,_0xa885('0xd0'));rpcDb[_0xa885('0xba')](_0x3ce170,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xa885('0xba')](_0x5cc2cf,_0xa885('0xe6'));}delete this[_0xa885('0x16')][_0x32e7ff[_0xa885('0xaa')]];break;case'19':_0x59ae23['outboundUnknownCallsDay']+=0x1;_0x5cc2cf[_0xa885('0x9c')]=ut[_0xa885('0x9d')](_0x5cc2cf);ut[_0xa885('0x8d')](_0x5cc2cf,0x13,_0x32e7ff[_0xa885('0xe2')]||_0x32e7ff[_0xa885('0xe3')]);ami[_0xa885('0x25')](_0xa885('0xe4'),ut[_0xa885('0x9f')](_0x5cc2cf,_0xa885('0xe5')));rpcDb['createCustomerHistory'](_0x5cc2cf,'[callProgressDetectingCustomer][machine]');if(ut[_0xa885('0x9d')](_0x5cc2cf)>=_0x59ae23[_0xa885('0xa1')]){_0x3ce170=ut[_0xa885('0xa2')](_0x5cc2cf,0xf,_0xa885('0xd0'));rpcDb[_0xa885('0xba')](_0x3ce170,_0xa885('0xe7'));}else{rpcDb[_0xa885('0xba')](_0x5cc2cf,_0xa885('0xe7'));}delete this[_0xa885('0x16')][_0x32e7ff[_0xa885('0xaa')]];break;default:if(_0x5cc2cf[_0xa885('0x79')]){ut['decrementTalkink'](_0x59ae23,_0xa885('0xe8'));ut[_0xa885('0x7b')](_0xa885('0xe9')+_0x59ae23[_0xa885('0x4d')],_0x32e7ff);}_0x59ae23[_0xa885('0xe0')]+=0x1;_0x5cc2cf['countglobal']=ut[_0xa885('0x9d')](_0x5cc2cf);ut[_0xa885('0x8d')](_0x5cc2cf,0xc,_0x32e7ff[_0xa885('0xe2')]||_0x32e7ff['dialstatus']);rpcDb[_0xa885('0x91')](_0x5cc2cf,_0xa885('0xea'));if(ut[_0xa885('0x9d')](_0x5cc2cf)>=_0x59ae23[_0xa885('0xa1')]){_0x3ce170=ut[_0xa885('0xa2')](_0x5cc2cf,0xf,_0xa885('0xd0'));rpcDb[_0xa885('0xba')](_0x3ce170,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xa885('0xba')](_0x5cc2cf,_0xa885('0xeb'));}delete this[_0xa885('0x16')][_0x32e7ff[_0xa885('0xaa')]];}if(!(_0x5cc2cf['dialAnswer']&&_0x3a0794==='16')){ut['updateOriginated'](_0x59ae23,_0xa885('0xec'));logger[_0xa885('0x6a')](_0xa885('0xed'),_0x5cc2cf[_0xa885('0xaf')],_0xa885('0xb0'),_0x59ae23['name'],_0xa885('0xee'),_0x59ae23[_0xa885('0x47')]);}if(_0x3a0794!==_0xa885('0xab')){delete this[_0xa885('0x16')][_0x32e7ff[_0xa885('0xaa')]];delete this[_0xa885('0x16')][_0x32e7ff['destlinkedid']];}}};Preview[_0xa885('0xf')]['callProgressDetectingAgent']=function(_0x5102f8,_0x20b6bd,_0x557f12){if(_[_0xa885('0xef')](_0x20b6bd)&&'object'!==typeof _0x20b6bd){return;}if(_[_0xa885('0xef')](_0x557f12)&&_0xa885('0xf0')!==typeof _0x557f12){return;}switch(_0x557f12[_0xa885('0xf1')]){case'0':ut[_0xa885('0xf2')](_0x5102f8,0x0,_0xa885('0xf3'));rpcDb[_0xa885('0xf4')](_0x5102f8,_0xa885('0xf5'));break;case'3':ut[_0xa885('0xf2')](_0x5102f8,0x3,_0xa885('0xc5'));rpcDb[_0xa885('0xf4')](_0x5102f8,_0xa885('0xf6'));break;case'5':ut['logAgent'](_0x5102f8,0x5,_0xa885('0xbf'));rpcDb[_0xa885('0xf4')](_0x5102f8,_0xa885('0xf7'));break;case'8':ut['logAgent'](_0x5102f8,0x8,_0xa885('0xf8'));rpcDb[_0xa885('0xf4')](_0x5102f8,_0xa885('0xf9'));break;case'22':ut[_0xa885('0xf2')](_0x5102f8,0x16,_0xa885('0xfa'));rpcDb[_0xa885('0xf4')](_0x5102f8,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xa885('0xf2')](_0x5102f8,0xc,_0x557f12[_0xa885('0xf1')]);rpcDb[_0xa885('0xf4')](_0x5102f8,_0xa885('0xf9'));}ut['updateOriginated'](_0x20b6bd,'[callProgressDetectingAgent]');logger[_0xa885('0x6a')](_0xa885('0xfb'),_0x5102f8[_0xa885('0xaf')],'\x20Queue',_0x20b6bd['name'],_0xa885('0xee'),_0x20b6bd[_0xa885('0x47')]);delete this[_0xa885('0x16')][_0x5102f8[_0xa885('0xaf')]];};Preview['prototype'][_0xa885('0xfc')]=function(_0x2f2a64,_0x5c68f7,_0x5cf609,_0x1fe18b,_0x41c077){var _0x4ae384=this;return new BPromise(function(_0xc9b253,_0x3e9888){if(_[_0xa885('0x69')](_0x5c68f7)||_[_0xa885('0x69')](_0x5c68f7[_0xa885('0xfd')])||_['isNil'](_0x5c68f7['Contact'][_0xa885('0xfe')])||_[_0xa885('0x69')](_0x5c68f7['VoiceQueueId'])){_0x3e9888(ut[_0xa885('0x46')](_0xa885('0xff'),_0x1fe18b,_0x41c077));return;}var _0x49f02a=uuid['v4']();var _0x453494=_0x4ae384[_0xa885('0x13')][_0x5c68f7[_0xa885('0x6b')]['name']];var _0x2dcf1a=_0x5cf609?_0x4ae384[_0xa885('0x17')][_0x5cf609]['id']:undefined;_0x4ae384[_0xa885('0x16')][_0x49f02a]=new Action(_0x5c68f7,_0x453494,_0x49f02a,_0x5cf609,_0x2dcf1a);var _0x4dd4ac=_0x4ae384[_0xa885('0x16')][_0x49f02a];_0x4dd4ac[_0xa885('0xa8')]=_0x1fe18b;_0x4dd4ac[_0xa885('0xa9')]=_0x41c077;_0x4dd4ac['lookAgent']=_0x5cf609;if(_[_0xa885('0x100')](_0x2f2a64)){_0x4ae384[_0xa885('0x101')](_0x4dd4ac,_0x453494,_0x5c68f7,_0x5cf609)[_0xa885('0x81')](function(_0x3e36c4){logger['info']('[Preview][execCall][success]',_0xa885('0x102')+_0x4dd4ac[_0xa885('0x6c')]+_0xa885('0x103')+_0x4dd4ac['idContact'],JSON[_0xa885('0x50')](_0x3e36c4));ami[_0xa885('0x25')]('custom:agentcalled',ut[_0xa885('0x9f')](_0x4dd4ac,_0xa885('0x104'),_0x4ae384[_0xa885('0x13')][_0x4dd4ac[_0xa885('0x6c')]]));_0xc9b253(ut[_0xa885('0x46')](_0xa885('0x105')));})[_0xa885('0x75')](function(_0x33bd83){ut[_0xa885('0x5c')](_0xa885('0x106'),_0x33bd83);_0x3e9888(ut['message'](_0xa885('0x107'),_0x1fe18b,_0x41c077));});}else{_0x453494[_0xa885('0x108')]+=0x1;ut['logBlacklist'](_0x4dd4ac);rpcDb['createHistory'](_0x4dd4ac,'[Blacklist][error]');delete _0x4ae384[_0xa885('0x16')][_0x49f02a];_0x3e9888(ut[_0xa885('0x46')](_0xa885('0x109'),_0x1fe18b,_0x41c077));}});};Preview[_0xa885('0xf')][_0xa885('0x97')]=function(_0x5b4ae6){return!_[_0xa885('0x69')](_0x5b4ae6)&&!_[_0xa885('0x69')](_0x5b4ae6[_0xa885('0x4d')])&&!_[_0xa885('0x69')](_0x5b4ae6[_0xa885('0x4e')])&&_0x5b4ae6[_0xa885('0x4e')]&&!_['isNil'](this[_0xa885('0x15')][util[_0xa885('0x52')](_0xa885('0x10a'),_0x5b4ae6[_0xa885('0x4d')])])&&!_['isNil'](this[_0xa885('0x15')][util[_0xa885('0x52')](_0xa885('0x10a'),_0x5b4ae6[_0xa885('0x4d')])][_0xa885('0x73')])&&(this['trunks'][util['format'](_0xa885('0x10a'),_0x5b4ae6[_0xa885('0x4d')])][_0xa885('0x73')]==='reachable'||this[_0xa885('0x15')][util[_0xa885('0x52')]('SIP/%s',_0x5b4ae6[_0xa885('0x4d')])]['status']===_0xa885('0x10b'));};Preview[_0xa885('0xf')][_0xa885('0x87')]=function(_0x4bf9f5,_0x5906f1){var _0x5556c9=this;return new BPromise(function(_0x3037ad,_0x10034f){_0x5556c9[_0xa885('0x10c')](_0x4bf9f5,_0x5906f1)['then'](function(_0x583b70){_0x3037ad(_[_0xa885('0x10d')](_0x583b70,[_0xa885('0x46')]));})['catch'](function(_0x57df36){if(_0x57df36[_0xa885('0x10e')]){rpcDb[_0xa885('0x10f')](_0x4bf9f5);}if(_0x57df36[_0xa885('0x4e')]){rpcDb[_0xa885('0x89')](_0x4bf9f5);}_0x10034f(_[_0xa885('0x10d')](_0x57df36,['message']));});});};Preview[_0xa885('0xf')]['execRun']=function(_0x35c9d2,_0x2141aa){var _0xe5797=this;return new BPromise(function(_0x64da56,_0x3d0e0a){var _0x363329,_0xc9665e;rpcDb[_0xa885('0x110')](_0x35c9d2)[_0xa885('0x81')](function(_0x3347a3){if(!_['isNil'](_0x3347a3[0x0])){_0xc9665e=_0x3347a3[0x0][_0xa885('0x111')]?![]:!![];_0x363329=_0x3347a3[0x0][_0xa885('0x111')]?!![]:![];_0x363329=_0x2141aa?!![]:_0x363329;}var _0x469497=_0xe5797[_0xa885('0x112')](_0x3347a3);if(_0x469497[_0xa885('0x113')]){rpcDb['checkIsBlackList'](_[_0xa885('0x10d')](_0x3347a3[0x0],[_0xa885('0x70'),'Contact.phone']))['then'](function(_0x17019f){_0xe5797['checkInBlack'](_0x17019f,_0x3347a3[0x0],_0x2141aa,_0xc9665e,_0x363329)[_0xa885('0x81')](function(_0x2d55f4){_0x64da56(_0x2d55f4);})[_0xa885('0x75')](function(_0x4ba8a7){_0x3d0e0a(_0x4ba8a7);});})[_0xa885('0x75')](function(_0x288795){ut[_0xa885('0x5c')]('[Preview][checkIsBlackList]',_0x288795);_0x3d0e0a(ut[_0xa885('0x46')](_0xa885('0x114'),_0xc9665e,_0x363329));});}else{_0x3d0e0a(ut['message'](_0x469497['message'],_0xc9665e,_0x363329));}})[_0xa885('0x75')](function(_0x1d32c8){ut[_0xa885('0x5c')]('[Preview][getContactPreview]',_0x1d32c8);_0x3d0e0a(ut[_0xa885('0x46')]('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0xa885('0x112')]=function(_0x1d5f01){if(_[_0xa885('0x69')](_0x1d5f01)||_[_0xa885('0x100')](_0x1d5f01)||!_[_0xa885('0x69')](_0x1d5f01[0x0]['Agent'])&&_['isNil'](_0x1d5f01[0x0][_0xa885('0x85')]['name'])){ut[_0xa885('0x5c')](_0xa885('0x115'),_0x1d5f01);return{'isValid':![],'message':_0xa885('0x116')};}var _0xf9497c=this[_0xa885('0x13')][_0x1d5f01[0x0]['Queue'][_0xa885('0x4d')]];_0xf9497c[_0xa885('0x46')]='ACTIVE';if(_[_0xa885('0x69')](_0xf9497c)){ut[_0xa885('0x5c')](_0xa885('0x117'),_0xf9497c);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xa885('0x97')](_0xf9497c[_0xa885('0x4c')])){ut[_0xa885('0x5c')](_0xa885('0x118'),_0xa885('0x119')+_0xf9497c[_0xa885('0x4d')]+_0xa885('0x11a'));if(!this['isTrunkReachable'](_0xf9497c[_0xa885('0x98')])){ut[_0xa885('0x5c')](_0xa885('0x118'),_0xf9497c[_0xa885('0x4d')]+_0xa885('0x11b'));return{'isValid':![],'message':_0xa885('0x11c')};}}if(!ut[_0xa885('0x96')](_0xf9497c['dialActive'])){ut[_0xa885('0x5c')](_0xa885('0x11d'),_0xf9497c[_0xa885('0x4d')]+_0xa885('0x11e'));return{'isValid':![],'message':_0xa885('0x119')+_0xf9497c[_0xa885('0x4d')]+_0xa885('0x11e')};}return{'isValid':!![],'message':_0xa885('0x11f')};};Preview[_0xa885('0xf')][_0xa885('0x101')]=function(_0x4adab9,_0x2a0788,_0x571953,_0x4716ef){var _0xebf906=this;return new BPromise(function(_0x177803,_0x5a9bf0){var _0x595cb4=_0x4adab9[_0xa885('0xaf')];var _0x29d231=_0xebf906[_0xa885('0x97')](_0x2a0788['Trunk'])?util[_0xa885('0x52')](_0xa885('0x120'),_0x2a0788['Trunk'][_0xa885('0x4d')],_[_0xa885('0x69')](_0x2a0788[_0xa885('0x35')])?'':_0x2a0788[_0xa885('0x35')][_0xa885('0x121')]()||'',_0x2a0788[_0xa885('0x122')]>0x0?_0x571953[_0xa885('0xfd')][_0xa885('0xfe')][_0xa885('0x123')](_0x2a0788[_0xa885('0x122')]):_0x571953[_0xa885('0xfd')]['phone']):util[_0xa885('0x52')](_0xa885('0x120'),_['isNil'](_0x2a0788[_0xa885('0x98')])?_0x2a0788[_0xa885('0x4c')][_0xa885('0x4d')]:_0x2a0788['TrunkBackup']['name'],_[_0xa885('0x69')](_0x2a0788[_0xa885('0x35')])?'':_0x2a0788[_0xa885('0x35')][_0xa885('0x121')]()||'',_0x2a0788[_0xa885('0x122')]>0x0?_0x571953['Contact']['phone'][_0xa885('0x123')](_0x2a0788[_0xa885('0x122')]):_0x571953[_0xa885('0xfd')]['phone']);var _0x273488=_0xebf906[_0xa885('0x97')](_0x2a0788[_0xa885('0x4c')])?ut['getCallerId'](_0x2a0788[_0xa885('0x4c')][_0xa885('0x124')],_0x2a0788[_0xa885('0x32')],_0x2a0788['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xa885('0x125')](_0x2a0788[_0xa885('0x33')],_0x2a0788[_0xa885('0x126')]):_0x2a0788['dialOriginateCallerIdNumber']):ut[_0xa885('0x127')](_[_0xa885('0x69')](_0x2a0788[_0xa885('0x98')])?_0x2a0788[_0xa885('0x4c')][_0xa885('0x124')]:_0x2a0788[_0xa885('0x98')][_0xa885('0x124')],_0x2a0788[_0xa885('0x32')],_0x2a0788['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xa885('0x125')](_0x2a0788[_0xa885('0x33')],_0x2a0788[_0xa885('0x126')]):_0x2a0788[_0xa885('0x33')]);if(_0x273488){_0x4adab9['originatecalleridname']=ut[_0xa885('0x128')](_0x273488);_0x4adab9[_0xa885('0x129')]=ut[_0xa885('0x12a')](_0x273488);}var _0x2494c5=ut['addVariables'](_0x2a0788,_0x571953,_0x29d231,_0x273488,_0x595cb4,_0x4adab9);_[_0xa885('0x12b')](_0x4adab9,ut[_0xa885('0x12c')](_0x2494c5));_0x4adab9[_0xa885('0x8a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami[_0xa885('0x72')](ut[_0xa885('0x12d')](_0x4adab9,_0x2a0788,_0x2494c5,_0x4adab9['activeContact'],_0x4716ef))['then'](function(_0x13f115){_0x2a0788[_0xa885('0x47')]+=0x1;logger[_0xa885('0x6a')](_0xa885('0x12e'),_0x595cb4,_0xa885('0xb0'),_0x2a0788[_0xa885('0x4d')],_0xa885('0xee'),_0x2a0788['originated']);_0x177803(_0x13f115);})[_0xa885('0x75')](function(_0x2025e2){ut[_0xa885('0xf2')](_0x4adab9,0xe,_0xa885('0x12f'));rpcDb[_0xa885('0xf4')](_0x4adab9,_0xa885('0x130'));_0x5a9bf0(_0x2025e2);});});};Preview[_0xa885('0xf')][_0xa885('0x1f')]=function(_0x23742d){if(this[_0xa885('0x16')][_0x23742d['linkedid']]){this[_0xa885('0x16')][_0x23742d[_0xa885('0xaa')]][_0xa885('0x74')]=_0x23742d['channel'];}};Preview[_0xa885('0xf')]['syncOriginateResponse']=function(_0x2f88e6){var _0x4f14db=this;var _0x1585ba=this['actions'][_0x2f88e6[_0xa885('0x131')]];if(_0x1585ba){if(_0x1585ba[_0xa885('0x132')]&&this[_0xa885('0x17')][_0x1585ba[_0xa885('0x132')]]){ut[_0xa885('0x133')](_0x1585ba,this[_0xa885('0x17')][_0x1585ba[_0xa885('0x132')]]['name'],this[_0xa885('0x17')][_0x1585ba[_0xa885('0x132')]]['id']);}var _0x5b9dfe=_['clone'](_0x1585ba);_0x5b9dfe[_0xa885('0xac')]=moment()[_0xa885('0x52')]('YYYY-MM-DD\x20HH:mm:ss');var _0x56c5c9=_0x4f14db[_0xa885('0x13')][_0x1585ba[_0xa885('0x6c')]];if(ut['isFailure'](_0x2f88e6[_0xa885('0x134')])){if(_0x1585ba[_0xa885('0xa8')]){rpcDb[_0xa885('0x10f')](_0x1585ba['idContact']);}if(_0x1585ba['activeContact']){rpcDb['disableContact'](_0x1585ba[_0xa885('0x135')]);}ami[_0xa885('0x25')](_0xa885('0x136'),ut[_0xa885('0x9f')](_0x1585ba,'rejected',this[_0xa885('0x13')][_0x1585ba[_0xa885('0x6c')]]));this[_0xa885('0x137')](_0x5b9dfe,_0x56c5c9,_0x2f88e6);}else{_0x1585ba[_0xa885('0x8a')]=moment()[_0xa885('0x52')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xa885('0xf2')](_0x5b9dfe,0x4,_0xa885('0xb8'));rpcDb[_0xa885('0xf4')](_0x5b9dfe,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xa885('0xf')][_0xa885('0x1c')]=function(_0x97042f){var _0x33f7d3=this;var _0x4830aa=this['actions'][_0x97042f[_0xa885('0xaa')]];var _0x6a66bc;if(_0x4830aa){_0x6a66bc=this[_0xa885('0x13')][_0x4830aa[_0xa885('0x6c')]];logger[_0xa885('0x6a')](_0xa885('0x138'),_0x97042f[_0xa885('0xaa')],_0xa885('0xb0'),_0x6a66bc['name'],_0xa885('0x6d'),_0x6a66bc[_0xa885('0x2a')]);}if(this['actions'][_0x97042f[_0xa885('0xaa')]]&&_0x97042f[_0xa885('0xaa')]!==_0x97042f[_0xa885('0xaf')]){if(_0x97042f['cause']==='16'&&this[_0xa885('0x16')][_0x97042f[_0xa885('0xaa')]][_0xa885('0x79')]){this['callProgressDetectingCustomer'](_0x97042f,_0x97042f[_0xa885('0xaa')],_0x97042f['cause']);}else if(this['actions'][_0x97042f[_0xa885('0xaa')]][_0xa885('0x79')]){logger[_0xa885('0x6a')](_0xa885('0x139'),_0x97042f[_0xa885('0xaa')],_0x97042f[_0xa885('0x13a')],_0xa885('0xb0'),_0x6a66bc[_0xa885('0x4d')],_0xa885('0x6d'),_0x6a66bc['pTalking']);this[_0xa885('0x9b')](_0x97042f,_0x97042f[_0xa885('0xaa')],_0x97042f['cause']);}}else if(_0x4830aa&&_[_0xa885('0x69')](_0x4830aa[_0xa885('0x13b')])&&_0x6a66bc[_0xa885('0x13c')]&&_0x97042f[_0xa885('0xaa')]===_0x97042f[_0xa885('0xaf')]&&_[_0xa885('0x69')](_0x97042f['reason'])&&_0x97042f[_0xa885('0x13a')]==='16'&&_0x97042f[_0xa885('0x13d')]==='6'&&_['isUndefined'](_0x4830aa['transfer'])){if(_0x4830aa[_0xa885('0xa8')]){rpcDb[_0xa885('0x10f')](_0x4830aa['idContact']);}if(_0x4830aa['activeContact']){rpcDb[_0xa885('0x89')](_0x4830aa['idContact']);}_0x97042f[_0xa885('0xf1')]='22';this[_0xa885('0x137')](_0x4830aa,_0x6a66bc,_0x97042f);}else if(_0x4830aa&&_0x4830aa[_0xa885('0x13e')]){if(_0x97042f[_0xa885('0x13a')]==='16'&&this[_0xa885('0x16')][_0x97042f[_0xa885('0xaa')]][_0xa885('0x79')]){logger[_0xa885('0x6a')](_0xa885('0x13f'),_0x97042f[_0xa885('0xaa')],_0x97042f[_0xa885('0x13a')],_0xa885('0xb0'),_0x6a66bc[_0xa885('0x4d')],_0xa885('0x6d'),_0x6a66bc[_0xa885('0x2a')]);this[_0xa885('0x9b')](_0x97042f,_0x97042f[_0xa885('0xaa')],_0x97042f[_0xa885('0x13a')]);}else if(this[_0xa885('0x16')][_0x97042f[_0xa885('0xaa')]][_0xa885('0x79')]){logger['info'](_0xa885('0x139'),_0x97042f['linkedid'],_0x97042f[_0xa885('0x13a')],_0xa885('0xb0'),_0x6a66bc[_0xa885('0x4d')],'pTalking:\x20',_0x6a66bc[_0xa885('0x2a')]);this[_0xa885('0x9b')](_0x97042f,_0x97042f[_0xa885('0xaa')],_0x97042f[_0xa885('0x13a')]);}}};Preview[_0xa885('0xf')][_0xa885('0x1e')]=function(_0x157513){if(this['actions'][_0x157513[_0xa885('0x140')]]&&_0x157513[_0xa885('0x140')]!==_0x157513[_0xa885('0x141')]){this['callProgressDetectingCustomer'](_0x157513,_0x157513[_0xa885('0x140')],_0x157513[_0xa885('0xe3')]);}};Preview['prototype'][_0xa885('0x1d')]=function(_0x5ecf53){if(this[_0xa885('0x16')][_0x5ecf53[_0xa885('0xaa')]]&&_0x5ecf53[_0xa885('0xaa')]!==_0x5ecf53[_0xa885('0xaf')]&&!this[_0xa885('0x16')][_0x5ecf53[_0xa885('0xaa')]][_0xa885('0x79')]){if(_0x5ecf53[_0xa885('0x13a')]==='1'){this['callProgressDetectingCustomer'](_0x5ecf53,_0x5ecf53[_0xa885('0xaa')],_0x5ecf53[_0xa885('0x13a')]);}}};Preview['prototype'][_0xa885('0x142')]=function(_0x324b77,_0x52a3c7,_0xcad242){if(this[_0xa885('0x16')][_0x324b77]){if(_['isNil'](this[_0xa885('0x16')][_0x324b77][_0xa885('0x143')])){this[_0xa885('0x16')][_0x324b77][_0xa885('0x143')]={};}this[_0xa885('0x16')][_0x324b77]['variables'][_0x52a3c7]=_0xcad242;}};Preview[_0xa885('0xf')]['syncVarSet']=function(_0x2a2aac){try{if(!_[_0xa885('0x69')](_0x2a2aac)){if(ut[_0xa885('0x144')](_[_0xa885('0x145')](_0x2a2aac[_0xa885('0x146')])[0x0])){this['addVariable'](_0x2a2aac[_0xa885('0xaf')],_[_0xa885('0x145')](_0x2a2aac[_0xa885('0x146')])[0x0],_0x2a2aac[_0xa885('0x147')]);}}}catch(_0x3efa79){logger[_0xa885('0x148')](_0xa885('0x149'),util[_0xa885('0x14a')](_0x3efa79,{'showHidden':![],'depth':null}));}};Preview[_0xa885('0xf')]['syncAttendedTransfer']=function(_0x211e42){if(_0x211e42){if(this['actions'][_0x211e42[_0xa885('0x14b')]]){this[_0xa885('0x16')][_0x211e42[_0xa885('0x14b')]][_0xa885('0x13e')]=!![];}}};Preview[_0xa885('0xf')][_0xa885('0x24')]=function(_0x55d509){if(_0x55d509){if(this['actions'][_0x55d509[_0xa885('0x14c')]]){this[_0xa885('0x16')][_0x55d509[_0xa885('0x14c')]][_0xa885('0x13e')]=!![];}}};module[_0xa885('0x14d')]=Preview; \ No newline at end of file +var _0xd67b=['dialend','newexten','syncNewExten','syncVarSet','attendedtransfer','syncBlindTransfer','loopCampaigns','emit','type','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','erlangCalls','erlangCallToSecond','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','logger','message','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','outbound','clockClearZombieChannels','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','size','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','voicePause','run','logger2','[RecallMe]','catch','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','isActive','dialActive','NOT_ACTIVE','isTrunkReachable','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','linkedid','ANSWER','responsetime','uniqueid','\x20Queue','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusyGlobal]','[callProgressDetectingCustomer][logBusy]','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerRetryFrequency','activeContact','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','countagentrejectretry','AgentReject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','Contact\x20in\x20black\x20List','SIP/%s','reachable','unlock','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','trim','dialCutDigit','substring','SIP/%s/%s%s','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','logLookAgent','isFailure','response','idContact','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destlinkedid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','uuid','moment','md5','../../../config/environment','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest'];(function(_0x145ce8,_0x260b8a){var _0x1a2fa7=function(_0x25129c){while(--_0x25129c){_0x145ce8['push'](_0x145ce8['shift']());}};_0x1a2fa7(++_0x260b8a);}(_0xd67b,0x133));var _0xbd67=function(_0x4e7489,_0x20c04f){_0x4e7489=_0x4e7489-0x0;var _0x1e18c5=_0xd67b[_0x4e7489];return _0x1e18c5;};'use strict';var util=require('util');var _=require(_0xbd67('0x0'));var BPromise=require('bluebird');var uuid=require(_0xbd67('0x1'));var moment=require(_0xbd67('0x2'));var md5=require(_0xbd67('0x3'));var Redis=require('ioredis');var config=require(_0xbd67('0x4'));var logger=require('../../../config/logger')(_0xbd67('0x5'));var loggerAction=require('../../../config/logger')(_0xbd67('0x6'));var ami=require(_0xbd67('0x7'));var rpcDb=require(_0xbd67('0x8'));var Action=require(_0xbd67('0x9'));var ut=require(_0xbd67('0xa'));config[_0xbd67('0xb')]=_[_0xbd67('0xc')](config[_0xbd67('0xb')],{'host':_0xbd67('0xd'),'port':0x18eb});var io=require(_0xbd67('0xe'))(new Redis(config[_0xbd67('0xb')]));var Sequence=function(){};Sequence[_0xbd67('0xf')][_0xbd67('0x10')]=function(_0x52b981){this['tail']=this[_0xbd67('0x11')]?this['tail'][_0xbd67('0x12')](_0x52b981):_0x52b981();};function Preview(_0xb6b4b5){this[_0xbd67('0x13')]=new Sequence();this[_0xbd67('0x14')]=_0xb6b4b5[_0xbd67('0x15')];this[_0xbd67('0x16')]=_0xb6b4b5[_0xbd67('0x16')];this[_0xbd67('0x17')]={};this[_0xbd67('0x18')]=_0xb6b4b5[_0xbd67('0x18')];this['clockClearZombieChannels']=0x0;ami['on'](_0xbd67('0x19'),this[_0xbd67('0x1a')][_0xbd67('0x1b')](this));ami['on'](_0xbd67('0x1c'),this[_0xbd67('0x1d')][_0xbd67('0x1b')](this));ami['on'](_0xbd67('0x1e'),this[_0xbd67('0x1f')][_0xbd67('0x1b')](this));ami['on'](_0xbd67('0x20'),this['syncDialEnd']['bind'](this));ami['on'](_0xbd67('0x21'),this[_0xbd67('0x22')][_0xbd67('0x1b')](this));ami['on']('varset',this[_0xbd67('0x23')][_0xbd67('0x1b')](this));ami['on'](_0xbd67('0x24'),this['syncAttendedTransfer'][_0xbd67('0x1b')](this));ami['on']('blindtransfer',this[_0xbd67('0x25')][_0xbd67('0x1b')](this));this[_0xbd67('0x26')](this['campaignsPreview']);}function emit(_0x3c4102,_0x40ec96,_0x37836c){io['to'](_0x3c4102)[_0xbd67('0x27')](_0x40ec96,_0x37836c);}function emitCampaignPreview(_0x419a6a){if(_0x419a6a[_0xbd67('0x28')]==='outbound'){var _0x3ee2f1={'id':_0x419a6a['id'],'name':_0x419a6a[_0xbd67('0x29')],'strategy':_0x419a6a[_0xbd67('0x2a')],'answered':_0x419a6a[_0xbd67('0x2b')],'available':_0x419a6a[_0xbd67('0x2c')],'loggedIn':_0x419a6a[_0xbd67('0x2d')],'pTalking':_0x419a6a[_0xbd67('0x2e')],'sumBillable':_0x419a6a[_0xbd67('0x2f')],'sumDuration':_0x419a6a[_0xbd67('0x30')],'sumHoldTime':_0x419a6a[_0xbd67('0x31')]||0x0,'talking':_0x419a6a[_0xbd67('0x32')],'total':_0x419a6a['total'],'type':_0x419a6a[_0xbd67('0x28')],'unmanaged':_0x419a6a['unmanaged'],'abandoned':_0x419a6a[_0xbd67('0x33')],'waiting':_0x419a6a[_0xbd67('0x34')],'loggedInDb':_0x419a6a[_0xbd67('0x35')],'dialActive':_0x419a6a['dialActive'],'dialMethod':_0x419a6a[_0xbd67('0x36')],'dialOriginateCallerIdName':_0x419a6a[_0xbd67('0x37')],'dialOriginateCallerIdNumber':_0x419a6a['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x419a6a[_0xbd67('0x38')],'dialPrefix':_0x419a6a[_0xbd67('0x39')],'outboundAnswerAgiCallsDay':_0x419a6a[_0xbd67('0x3a')],'outboundAnswerCallsDay':_0x419a6a[_0xbd67('0x3b')],'outboundBlacklistCallsDay':_0x419a6a[_0xbd67('0x3c')],'outboundBusyCallsDay':_0x419a6a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x419a6a['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x419a6a[_0xbd67('0x3d')],'outboundDropCallsDayCallersExit':_0x419a6a[_0xbd67('0x3e')],'outboundDropCallsDayTimeout':_0x419a6a[_0xbd67('0x3f')],'outboundNoAnswerCallsDay':_0x419a6a[_0xbd67('0x40')],'outboundNoSuchCallsDay':_0x419a6a[_0xbd67('0x41')],'outboundOriginateFailureCallsDay':_0x419a6a[_0xbd67('0x42')],'outboundReCallsDay':_0x419a6a[_0xbd67('0x43')],'outboundRejectCallsDay':_0x419a6a[_0xbd67('0x44')],'outboundUnknownCallsDay':_0x419a6a[_0xbd67('0x45')],'outboundAbandonedCallsDay':_0x419a6a[_0xbd67('0x46')],'predictiveIntervalAnsweredCalls':_0x419a6a['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x419a6a['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x419a6a[_0xbd67('0x47')],'predictiveIntervalDroppedCallsCallersExit':_0x419a6a[_0xbd67('0x48')],'predictiveIntervalDroppedCallsTimeout':_0x419a6a[_0xbd67('0x49')],'predictiveIntervalErlangCalls':_0x419a6a['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x419a6a[_0xbd67('0x4a')],'predictiveIntervalHitRate':_0x419a6a[_0xbd67('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x419a6a[_0xbd67('0x4c')],'predictiveIntervalPauses':_0x419a6a[_0xbd67('0x4d')],'predictiveIntervalAvailable':_0x419a6a['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x419a6a['predictiveIntervalTotalCalls'],'message':_0x419a6a['message'],'originated':_0x419a6a[_0xbd67('0x4e')],'erlangCalls':_0x419a6a[_0xbd67('0x4f')],'erlangCallToSecond':_0x419a6a[_0xbd67('0x50')],'erlangAbandonmentRate':_0x419a6a['erlangAbandonmentRate'],'erlangBusyFactor':_0x419a6a['erlangBusyFactor'],'startPredictive':_0x419a6a[_0xbd67('0x51')],'startProgressive':_0x419a6a[_0xbd67('0x52')]};if(_0x419a6a[_0xbd67('0x53')]){_0x3ee2f1[_0xbd67('0x53')]={'id':_0x419a6a[_0xbd67('0x53')]['id'],'name':_0x419a6a[_0xbd67('0x53')]['name'],'active':_0x419a6a[_0xbd67('0x53')][_0xbd67('0x54')],'callerid':_0x419a6a[_0xbd67('0x53')]['callerid']};}if(_0x419a6a[_0xbd67('0x55')]){_0x3ee2f1['Interval']={'id':_0x419a6a[_0xbd67('0x55')]['id'],'name':_0x419a6a[_0xbd67('0x55')]['name']};}var _0x3b7775=md5(JSON[_0xbd67('0x56')](_0x3ee2f1));if(_0x419a6a[_0xbd67('0x3')]!==_0x3b7775){_0x419a6a[_0xbd67('0x3')]=_0x3b7775;emit(util[_0xbd67('0x57')](_0xbd67('0x58'),_0x3ee2f1['name']),_0xbd67('0x59'),_0x3ee2f1);}}}function emitVoiceQueueChannelRemove(_0x151848){logger[_0xbd67('0x5a')](_0xbd67('0x5b'),JSON[_0xbd67('0x56')](_0x151848));emit(util['format']('voice:queue:%s',_0x151848[_0xbd67('0x29')]),_0xbd67('0x5c'),_0x151848);io[_0xbd67('0x27')]('voice_queue_presence:remove',_0x151848);}function notSendMessagesQueue(_0x378cb3){if(_0x378cb3[_0xbd67('0x5d')]){if(_0x378cb3[_0xbd67('0x4e')]===0x0&&_0x378cb3[_0xbd67('0x2e')]===0x0){_0x378cb3['sendMessageOneNotActive']=![];_0x378cb3['available']=0x0;_0x378cb3['paused']=0x0;_0x378cb3['message']='NOT_ACTIVE';ut[_0xbd67('0x5e')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x378cb3['name']+'\x20is\x20not\x20active');}else{_0x378cb3[_0xbd67('0x5f')]=_0xbd67('0x60');ut[_0xbd67('0x5e')](_0xbd67('0x61'),_0x378cb3['name']+_0xbd67('0x62'));}emitCampaignPreview(_0x378cb3);}}Preview[_0xbd67('0xf')][_0xbd67('0x26')]=function(){var _0x79684a=this;setInterval(function(){_0x79684a[_0xbd67('0x63')]();},0x7cf);};Preview[_0xbd67('0xf')][_0xbd67('0x63')]=function(){var _0x532c9b=this[_0xbd67('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x20fd56 in _0x532c9b){if(_0x532c9b[_0xbd67('0x64')](_0x20fd56)&&(_0x532c9b[_0x20fd56][_0xbd67('0x36')]===_0xbd67('0x5')||_0x532c9b[_0x20fd56][_0xbd67('0x36')]===_0xbd67('0x65'))&&_0x532c9b[_0x20fd56][_0xbd67('0x28')]===_0xbd67('0x66')){if(this['clockClearZombieChannels']>0x7){this[_0xbd67('0x67')]=0x0;this[_0xbd67('0x68')]();}}if(_0x532c9b['hasOwnProperty'](_0x20fd56)&&_0x532c9b[_0x20fd56][_0xbd67('0x36')]===_0xbd67('0x5')&&_0x532c9b[_0x20fd56][_0xbd67('0x28')]==='outbound'){if(_0x532c9b[_0x20fd56]['dialActive']){this[_0xbd67('0x69')](_0x532c9b[_0x20fd56]);if(_0x532c9b[_0x20fd56][_0xbd67('0x6a')])this[_0xbd67('0x6b')](_0x532c9b[_0x20fd56]);}else{notSendMessagesQueue(_0x532c9b[_0x20fd56]);}}}};Preview['prototype'][_0xbd67('0x6c')]=function(_0x345508){var _0x56ba76=this;this['sequence']['enqueue'](function(){if(!_['isNil'](_0x56ba76[_0xbd67('0x17')][_0x345508])){loggerAction[_0xbd67('0x5a')](_0xbd67('0x6d'),_0x345508,_0xbd67('0x6e'),_0x56ba76[_0xbd67('0x17')][_0x345508]['queue'],_0xbd67('0x6f'),JSON[_0xbd67('0x56')](_0x56ba76['campaignsPreview'][_0x56ba76[_0xbd67('0x17')][_0x345508][_0xbd67('0x70')]][_0xbd67('0x4e')]),_0xbd67('0x71'),JSON[_0xbd67('0x56')](_0x56ba76['campaignsPreview'][_0x56ba76[_0xbd67('0x17')][_0x345508]['queue']][_0xbd67('0x2e')]),JSON[_0xbd67('0x56')](_0x56ba76['actions'][_0x345508][_0xbd67('0x72')]),JSON[_0xbd67('0x56')](_[_0xbd67('0x73')](_0x56ba76['actions'][_0x345508],[_0xbd67('0x74'),_0xbd67('0x75'),_0xbd67('0x76'),_0xbd67('0x77')])));return ami[_0xbd67('0x78')]({'action':_0xbd67('0x79'),'channel':_0x56ba76[_0xbd67('0x17')][_0x345508]['channel']})['catch'](function(_0x12943f){if(_0x12943f[_0xbd67('0x5f')]===_0xbd67('0x7a')){setTimeout(function(){if(_0x56ba76[_0xbd67('0x17')][_0x345508]){ut[_0xbd67('0x7b')](_0x56ba76['campaignsPreview'][_0x56ba76['actions'][_0x345508][_0xbd67('0x70')]],_0xbd67('0x7c'));if(_0x56ba76[_0xbd67('0x17')][_0x345508][_0xbd67('0x72')]===!![]){ut[_0xbd67('0x7d')](_0x56ba76[_0xbd67('0x14')][_0x56ba76[_0xbd67('0x17')][_0x345508][_0xbd67('0x70')]],_0xbd67('0x7c'));ut[_0xbd67('0x7e')]('[Dialer][checkChannel][pTalking][Preview]'+_0x345508,_0x56ba76['actions'][_0x345508][_0xbd67('0x70')]);}ut['loggerError'](_0xbd67('0x7f')+_0x345508,_0x56ba76[_0xbd67('0x17')][_0x345508][_0xbd67('0x70')]);delete _0x56ba76[_0xbd67('0x17')][_0x345508];}},0x2328);}});}});};Preview['prototype'][_0xbd67('0x68')]=function(){var _0x154f67=this;loggerAction[_0xbd67('0x5a')]('[action]',_[_0xbd67('0x80')](this['actions']));for(var _0x166dfe in this[_0xbd67('0x17')]){if(_0x154f67['actions'][_0xbd67('0x64')](_0x166dfe)){_0x154f67[_0xbd67('0x6c')](_0x166dfe);}}};Preview[_0xbd67('0xf')][_0xbd67('0x6b')]=function(_0x17c259){var _0x2843ac=this;rpcDb[_0xbd67('0x81')](_0x17c259['id'],ut[_0xbd67('0x82')](this[_0xbd67('0x18')]))[_0xbd67('0x83')](function(_0x93a3cb){if(!_[_0xbd67('0x84')](_0x93a3cb)){for(var _0x2ee62e=0x0;_0x2ee62e<_0x93a3cb[_0xbd67('0x85')];_0x2ee62e+=0x1){if(ut[_0xbd67('0x86')](_0x93a3cb[_0x2ee62e][_0xbd67('0x87')])<_0x17c259[_0xbd67('0x88')]*0x3c){if(_0x93a3cb[_0x2ee62e]['Agent']&&!_0x93a3cb[_0x2ee62e]['Agent'][_0xbd67('0x89')]){_0x2843ac[_0xbd67('0x8a')](_0x93a3cb[_0x2ee62e]['id'])['then'](ut[_0xbd67('0x8b')](_0xbd67('0x8c')))[_0xbd67('0x8d')](ut['logger2'](_0xbd67('0x8c')));}else{rpcDb[_0xbd67('0x8e')](_0x93a3cb[_0x2ee62e]['id']);}}else{var _0xf3dec5=new Action(_0x93a3cb[_0x2ee62e],_0x17c259);_0xf3dec5[_0xbd67('0x8f')]=moment()[_0xbd67('0x57')](_0xbd67('0x90'));_0x17c259['outboundReCallsDay']+=0x1;ut[_0xbd67('0x91')](_0xf3dec5,0x17,'RecallInQueue');if(_0x17c259[_0xbd67('0x92')]){rpcDb[_0xbd67('0x93')](ut['createBody'](_0x93a3cb[_0x2ee62e]));rpcDb['createCustomerHistory'](_0xf3dec5,_0xbd67('0x94'));}else{ut[_0xbd67('0x91')](_0xf3dec5,0x16,_0xbd67('0x95'));rpcDb[_0xbd67('0x96')](_0xf3dec5,_0xbd67('0x97'));rpcDb['createCustomerFinal'](_0xf3dec5,_0xbd67('0x97'));}}}}})[_0xbd67('0x8d')](ut[_0xbd67('0x8b')](_0xbd67('0x98')));};Preview[_0xbd67('0xf')][_0xbd67('0x69')]=function(_0x39e9d2){_0x39e9d2[_0xbd67('0x5d')]=!![];if(ut[_0xbd67('0x99')](_0x39e9d2[_0xbd67('0x2d')])){_0x39e9d2[_0xbd67('0x5f')]='AGENTS_NOT_LOGGED';}else if(!ut[_0xbd67('0x9a')](_0x39e9d2[_0xbd67('0x9b')])){_0x39e9d2['message']=_0xbd67('0x9c');}else if(!this[_0xbd67('0x9d')](_0x39e9d2[_0xbd67('0x53')])){if(!this['isTrunkReachable'](_0x39e9d2['TrunkBackup'])){_0x39e9d2[_0xbd67('0x5f')]='TRUNK_IS_NOT_REACHABLE';}else{_0x39e9d2[_0xbd67('0x5f')]=_0xbd67('0x9e');}}else{_0x39e9d2['message']=_0xbd67('0x9e');}emitCampaignPreview(_0x39e9d2);};Preview[_0xbd67('0xf')][_0xbd67('0x9f')]=function(_0x4604f4,_0x4e964d,_0x182666){var _0x204091=this;var _0x55c71f=this[_0xbd67('0x17')][_0x4e964d];var _0xe1a90c=this[_0xbd67('0x14')][_0x55c71f['queue']];var _0x1b3128;if(_0xe1a90c){switch(_0x182666){case'1':_0xe1a90c[_0xbd67('0x41')]+=0x1;_0x55c71f[_0xbd67('0xa0')]+=0x1;_0x55c71f[_0xbd67('0xa1')]=ut['totalGlobal'](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0x0,_0xbd67('0xa2'));ami[_0xbd67('0x27')]('custom:agentnosuchnumber',ut[_0xbd67('0xa3')](_0x55c71f,'nosuchnumber'));rpcDb['createCustomerHistory'](_0x55c71f,_0xbd67('0xa4'));if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c[_0xbd67('0xa6')]){_0x1b3128=ut[_0xbd67('0xa7')](_0x55c71f,0xf,_0xbd67('0xa8'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xaa'));}else{if(_0x55c71f[_0xbd67('0xa0')]>=_0xe1a90c[_0xbd67('0xab')]){rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xaa'));}else{rpcDb[_0xbd67('0xac')](ut[_0xbd67('0xad')](_0x55c71f,_0xbd67('0xa0'),_0xe1a90c['dialNoSuchNumberRetryFrequency']),_0x55c71f[_0xbd67('0xae')],_0x55c71f['activeContact']);}}delete this['actions'][_0x4604f4[_0xbd67('0xaf')]];break;case _0xbd67('0xb0'):var _0x11487e=moment()[_0xbd67('0x57')](_0xbd67('0x90'));_0x55c71f[_0xbd67('0xb1')]=_0x11487e;_0x55c71f['answertime']=_0x11487e;_0x55c71f[_0xbd67('0x72')]=!![];_0xe1a90c['pTalking']+=0x1;logger['info']('[syncHangup][talking][increment]',_0x55c71f[_0xbd67('0xb2')],_0xbd67('0xb3'),_0xe1a90c[_0xbd67('0x29')],_0xbd67('0x71'),_0xe1a90c[_0xbd67('0x2e')]);ami[_0xbd67('0x27')]('custom:agentconnect',ut[_0xbd67('0xa3')](_0x55c71f,_0xbd67('0xb4'),this[_0xbd67('0x14')][_0x55c71f['queue']]));if(_0xe1a90c['acw']){ami[_0xbd67('0x27')](_0xbd67('0xb5'),ut[_0xbd67('0xb6')](_0x55c71f));}break;case'16':ami['emit'](_0xbd67('0xb7'),ut[_0xbd67('0xa3')](_0x55c71f,'complete',this[_0xbd67('0x14')][_0x55c71f[_0xbd67('0x70')]]));emitVoiceQueueChannelRemove(ut[_0xbd67('0xa3')](_0x55c71f,_0xbd67('0xb8')));_0xe1a90c[_0xbd67('0x3b')]+=0x1;_0xe1a90c[_0xbd67('0xb9')]+=0x1;_0xe1a90c[_0xbd67('0x2b')]+=0x1;ut[_0xbd67('0x7d')](_0xe1a90c,'[16]');_0x55c71f['countglobal']=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0x4,_0xbd67('0xba'));rpcDb[_0xbd67('0x96')](_0x55c71f,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xbb'));rpcDb[_0xbd67('0xbc')](_0x55c71f);_0xe1a90c['sumDuration']+=_0x55c71f['talktime'];_0xe1a90c[_0xbd67('0x2f')]+=_0x55c71f['talktime'];logger['info'](_0xbd67('0xbd'),_0x55c71f[_0xbd67('0xb2')],_0xbd67('0xb3'),_0xe1a90c[_0xbd67('0x29')],'pTalking:\x20',_0xe1a90c[_0xbd67('0x2e')]);delete this[_0xbd67('0x17')][_0x4604f4[_0xbd67('0xaf')]];break;case _0xbd67('0xbe'):_0xe1a90c[_0xbd67('0xbf')]+=0x1;_0x55c71f[_0xbd67('0xc0')]+=0x1;_0x55c71f[_0xbd67('0xa1')]=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0x5,_0xbd67('0xc1'));ami[_0xbd67('0x27')](_0xbd67('0xc2'),ut[_0xbd67('0xa3')](_0x55c71f,'busy'));rpcDb[_0xbd67('0x96')](_0x55c71f,'[callProgressDetectingCustomer][logBusy]');if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c[_0xbd67('0xa6')]){_0x1b3128=ut[_0xbd67('0xa7')](_0x55c71f,0xf,_0xbd67('0xa8'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xc3'));}else{if(_0x55c71f['countbusyretry']>=_0xe1a90c['dialBusyMaxRetry']){rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xc4'));}else{rpcDb[_0xbd67('0xac')](ut['scheduledAt'](_0x55c71f,_0xbd67('0xc0'),_0xe1a90c['dialBusyRetryFrequency']),_0x55c71f['unlockAgent'],_0x55c71f['activeContact']);}}break;case'NOANSWER':_0xe1a90c[_0xbd67('0x40')]+=0x1;_0x55c71f['countnoanswerretry']+=0x1;_0x55c71f['countglobal']=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0x3,_0xbd67('0xc5'));ami[_0xbd67('0x27')](_0xbd67('0xc6'),ut[_0xbd67('0xa3')](_0x55c71f,_0xbd67('0xc7')));rpcDb[_0xbd67('0x96')](_0x55c71f,_0xbd67('0xc8'));if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c['dialGlobalMaxRetry']){_0x1b3128=ut['cloneAction'](_0x55c71f,0xf,_0xbd67('0xa8'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xc9'));}else{if(_0x55c71f[_0xbd67('0xca')]>=_0xe1a90c['dialNoAnswerMaxRetry']){rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xc8'));}else{rpcDb[_0xbd67('0xac')](ut[_0xbd67('0xad')](_0x55c71f,'countnoanswerretry',_0xe1a90c[_0xbd67('0xcb')]),_0x55c71f[_0xbd67('0xae')],_0x55c71f[_0xbd67('0xcc')]);}}break;case _0xbd67('0xcd'):_0xe1a90c[_0xbd67('0xce')]+=0x1;_0x55c71f[_0xbd67('0xcf')]+=0x1;_0x55c71f[_0xbd67('0xa1')]=ut[_0xbd67('0xa5')](_0x55c71f);ut['logCustomer'](_0x55c71f,0x8,_0xbd67('0xd0'));ami['emit'](_0xbd67('0xd1'),ut[_0xbd67('0xa3')](_0x55c71f,_0xbd67('0xd2')));rpcDb[_0xbd67('0x96')](_0x55c71f,_0xbd67('0xd3'));if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c[_0xbd67('0xa6')]){_0x1b3128=ut[_0xbd67('0xa7')](_0x55c71f,0xf,_0xbd67('0xa8'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xd4'));}else{if(_0x55c71f['countcongestionretry']>=_0xe1a90c[_0xbd67('0xd5')]){rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xd3'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x55c71f,_0xbd67('0xcf'),_0xe1a90c[_0xbd67('0xd6')]),_0x55c71f[_0xbd67('0xae')],_0x55c71f[_0xbd67('0xcc')]);}}break;case _0xbd67('0xd7'):_0xe1a90c[_0xbd67('0x44')]+=0x1;_0x55c71f[_0xbd67('0xd8')]+=0x1;_0x55c71f[_0xbd67('0xa1')]=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0x14,_0xbd67('0xd9'));ami[_0xbd67('0x27')]('custom:agentreject',ut['buildObj'](_0x55c71f,_0xbd67('0xda')));rpcDb[_0xbd67('0x96')](_0x55c71f,_0xbd67('0xdb'));if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c[_0xbd67('0xa6')]){_0x1b3128=ut['cloneAction'](_0x55c71f,0x14,_0xbd67('0xd9'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xdc'));}else{if(_0x55c71f['countagentrejectretry']>=_0xe1a90c['dialAgentRejectMaxRetry']){rpcDb[_0xbd67('0xa9')](_0x55c71f,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xbd67('0xac')](ut[_0xbd67('0xad')](_0x55c71f,_0xbd67('0xd8'),_0xe1a90c[_0xbd67('0xdd')]),_0x55c71f['unlockAgent'],_0x55c71f['activeContact']);}}break;case _0xbd67('0xde'):_0xe1a90c[_0xbd67('0x46')]+=0x1;_0x55c71f[_0xbd67('0xdf')]+=0x1;_0x55c71f[_0xbd67('0xa1')]=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0xb,_0xbd67('0xe0'));rpcDb[_0xbd67('0x96')](_0x55c71f,_0xbd67('0xe1'));if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c[_0xbd67('0xa6')]){_0x1b3128=ut[_0xbd67('0xa7')](_0x55c71f,0xf,'Global');rpcDb[_0xbd67('0xa9')](_0x1b3128,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x55c71f[_0xbd67('0xe2')]>=_0xe1a90c[_0xbd67('0xe3')]){rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xe1'));}else{rpcDb[_0xbd67('0xac')](ut['scheduledAt'](_0x55c71f,_0xbd67('0xdf'),_0xe1a90c['dialAbandonedRetryFrequency']),_0x55c71f[_0xbd67('0xae')],_0x55c71f['activeContact']);}}break;case'18':_0xe1a90c['outboundUnknownCallsDay']+=0x1;_0x55c71f[_0xbd67('0xe4')]+=0x1;_0x55c71f[_0xbd67('0xa1')]=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0x12,_0x4604f4[_0xbd67('0xe5')]||_0x4604f4[_0xbd67('0xe6')]);ami[_0xbd67('0x27')](_0xbd67('0xe7'),ut[_0xbd67('0xa3')](_0x55c71f,_0xbd67('0xe8')));rpcDb[_0xbd67('0x96')](_0x55c71f,_0xbd67('0xe9'));if(ut['totalGlobal'](_0x55c71f)>=_0xe1a90c[_0xbd67('0xa6')]){_0x1b3128=ut[_0xbd67('0xa7')](_0x55c71f,0xf,_0xbd67('0xa8'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xe9'));}else{rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xe9'));}delete this[_0xbd67('0x17')][_0x4604f4[_0xbd67('0xaf')]];break;case'19':_0xe1a90c[_0xbd67('0x45')]+=0x1;_0x55c71f[_0xbd67('0xa1')]=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0x13,_0x4604f4['cause-txt']||_0x4604f4[_0xbd67('0xe6')]);ami['emit'](_0xbd67('0xe7'),ut['buildObj'](_0x55c71f,_0xbd67('0xe8')));rpcDb['createCustomerHistory'](_0x55c71f,_0xbd67('0xea'));if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c[_0xbd67('0xa6')]){_0x1b3128=ut[_0xbd67('0xa7')](_0x55c71f,0xf,_0xbd67('0xa8'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xea'));}else{rpcDb[_0xbd67('0xa9')](_0x55c71f,_0xbd67('0xea'));}delete this[_0xbd67('0x17')][_0x4604f4[_0xbd67('0xaf')]];break;default:if(_0x55c71f[_0xbd67('0x72')]){ut[_0xbd67('0x7d')](_0xe1a90c,_0xbd67('0xeb'));ut[_0xbd67('0x7e')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0xe1a90c[_0xbd67('0x29')],_0x4604f4);}_0xe1a90c['outboundUnknownCallsDay']+=0x1;_0x55c71f['countglobal']=ut[_0xbd67('0xa5')](_0x55c71f);ut[_0xbd67('0x91')](_0x55c71f,0xc,_0x4604f4[_0xbd67('0xe5')]||_0x4604f4[_0xbd67('0xe6')]);rpcDb[_0xbd67('0x96')](_0x55c71f,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0xbd67('0xa5')](_0x55c71f)>=_0xe1a90c['dialGlobalMaxRetry']){_0x1b3128=ut[_0xbd67('0xa7')](_0x55c71f,0xf,_0xbd67('0xa8'));rpcDb[_0xbd67('0xa9')](_0x1b3128,_0xbd67('0xec'));}else{rpcDb[_0xbd67('0xa9')](_0x55c71f,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xbd67('0x17')][_0x4604f4[_0xbd67('0xaf')]];}if(!(_0x55c71f[_0xbd67('0x72')]&&_0x182666==='16')){ut[_0xbd67('0x7b')](_0xe1a90c,'[callProgressDetectingCustomer]');logger[_0xbd67('0x5a')](_0xbd67('0xed'),_0x55c71f['uniqueid'],_0xbd67('0xb3'),_0xe1a90c[_0xbd67('0x29')],_0xbd67('0x6f'),_0xe1a90c[_0xbd67('0x4e')]);}if(_0x182666!==_0xbd67('0xb0')){delete this[_0xbd67('0x17')][_0x4604f4['linkedid']];delete this['actions'][_0x4604f4['destlinkedid']];}}};Preview['prototype'][_0xbd67('0xee')]=function(_0x7b2087,_0x161552,_0x488de8){if(_['isUndefined'](_0x161552)&&'object'!==typeof _0x161552){return;}if(_[_0xbd67('0xef')](_0x488de8)&&_0xbd67('0xf0')!==typeof _0x488de8){return;}switch(_0x488de8[_0xbd67('0xf1')]){case'0':ut[_0xbd67('0xf2')](_0x7b2087,0x0,'NoSuchNumber');rpcDb[_0xbd67('0xf3')](_0x7b2087,_0xbd67('0xf4'));break;case'3':ut[_0xbd67('0xf2')](_0x7b2087,0x3,_0xbd67('0xc5'));rpcDb[_0xbd67('0xf3')](_0x7b2087,_0xbd67('0xf5'));break;case'5':ut['logAgent'](_0x7b2087,0x5,_0xbd67('0xc1'));rpcDb[_0xbd67('0xf3')](_0x7b2087,_0xbd67('0xf6'));break;case'8':ut[_0xbd67('0xf2')](_0x7b2087,0x8,_0xbd67('0xd0'));rpcDb[_0xbd67('0xf3')](_0x7b2087,_0xbd67('0xf7'));break;case'22':ut['logAgent'](_0x7b2087,0x16,_0xbd67('0xf8'));rpcDb[_0xbd67('0xf3')](_0x7b2087,_0xbd67('0xf9'));break;default:ut[_0xbd67('0xf2')](_0x7b2087,0xc,_0x488de8[_0xbd67('0xf1')]);rpcDb[_0xbd67('0xf3')](_0x7b2087,_0xbd67('0xf7'));}ut[_0xbd67('0x7b')](_0x161552,'[callProgressDetectingAgent]');logger[_0xbd67('0x5a')](_0xbd67('0xfa'),_0x7b2087['uniqueid'],_0xbd67('0xb3'),_0x161552[_0xbd67('0x29')],'originated:\x20',_0x161552[_0xbd67('0x4e')]);delete this[_0xbd67('0x17')][_0x7b2087['uniqueid']];};Preview[_0xbd67('0xf')][_0xbd67('0xfb')]=function(_0x254199,_0x10b02a,_0x3435c6,_0x42a7ee,_0x4df2e3){var _0x353a5f=this;return new BPromise(function(_0x5228b0,_0x5d4d7a){if(_[_0xbd67('0x84')](_0x10b02a)||_[_0xbd67('0x84')](_0x10b02a['Contact'])||_[_0xbd67('0x84')](_0x10b02a[_0xbd67('0xfc')][_0xbd67('0xfd')])||_[_0xbd67('0x84')](_0x10b02a[_0xbd67('0x76')])){_0x5d4d7a(ut[_0xbd67('0x5f')](_0xbd67('0xfe'),_0x42a7ee,_0x4df2e3));return;}var _0x4afce2=uuid['v4']();var _0x22729d=_0x353a5f['campaignsPreview'][_0x10b02a[_0xbd67('0x6e')]['name']];var _0x45f668=_0x3435c6?_0x353a5f[_0xbd67('0x18')][_0x3435c6]['id']:undefined;_0x353a5f[_0xbd67('0x17')][_0x4afce2]=new Action(_0x10b02a,_0x22729d,_0x4afce2,_0x3435c6,_0x45f668);var _0x507069=_0x353a5f[_0xbd67('0x17')][_0x4afce2];_0x507069[_0xbd67('0xae')]=_0x42a7ee;_0x507069[_0xbd67('0xcc')]=_0x4df2e3;_0x507069[_0xbd67('0xff')]=_0x3435c6;if(_[_0xbd67('0x100')](_0x254199)){_0x353a5f['execCall'](_0x507069,_0x22729d,_0x10b02a,_0x3435c6)[_0xbd67('0x83')](function(_0x1fbd07){logger[_0xbd67('0x5a')](_0xbd67('0x101'),_0xbd67('0x102')+_0x507069['queue']+_0xbd67('0x103')+_0x507069['idContact'],JSON['stringify'](_0x1fbd07));ami[_0xbd67('0x27')](_0xbd67('0x104'),ut[_0xbd67('0xa3')](_0x507069,_0xbd67('0x105'),_0x353a5f[_0xbd67('0x14')][_0x507069[_0xbd67('0x70')]]));_0x5228b0(ut[_0xbd67('0x5f')]('Calling'));})[_0xbd67('0x8d')](function(_0x512d00){ut[_0xbd67('0x5e')](_0xbd67('0x106'),_0x512d00);_0x5d4d7a(ut['message'](_0xbd67('0x107'),_0x42a7ee,_0x4df2e3));});}else{_0x22729d[_0xbd67('0x3c')]+=0x1;ut['logBlacklist'](_0x507069);rpcDb['createHistory'](_0x507069,'[Blacklist][error]');delete _0x353a5f['actions'][_0x4afce2];_0x5d4d7a(ut['message'](_0xbd67('0x108'),_0x42a7ee,_0x4df2e3));}});};Preview[_0xbd67('0xf')][_0xbd67('0x9d')]=function(_0x52baa5){return!_[_0xbd67('0x84')](_0x52baa5)&&!_[_0xbd67('0x84')](_0x52baa5[_0xbd67('0x29')])&&!_[_0xbd67('0x84')](_0x52baa5['active'])&&_0x52baa5[_0xbd67('0x54')]&&!_[_0xbd67('0x84')](this[_0xbd67('0x16')][util['format'](_0xbd67('0x109'),_0x52baa5[_0xbd67('0x29')])])&&!_[_0xbd67('0x84')](this[_0xbd67('0x16')][util[_0xbd67('0x57')]('SIP/%s',_0x52baa5['name'])][_0xbd67('0x79')])&&(this[_0xbd67('0x16')][util['format']('SIP/%s',_0x52baa5[_0xbd67('0x29')])][_0xbd67('0x79')]===_0xbd67('0x10a')||this[_0xbd67('0x16')][util[_0xbd67('0x57')](_0xbd67('0x109'),_0x52baa5[_0xbd67('0x29')])][_0xbd67('0x79')]==='unmonitored');};Preview[_0xbd67('0xf')][_0xbd67('0x8a')]=function(_0x96c7c7,_0x2e53ab){var _0x3daf82=this;return new BPromise(function(_0x25c651,_0x36ccc5){_0x3daf82['execRun'](_0x96c7c7,_0x2e53ab)[_0xbd67('0x83')](function(_0x2427b4){_0x25c651(_[_0xbd67('0x73')](_0x2427b4,[_0xbd67('0x5f')]));})['catch'](function(_0x583b27){if(_0x583b27[_0xbd67('0x10b')]){rpcDb[_0xbd67('0x10c')](_0x96c7c7);}if(_0x583b27[_0xbd67('0x54')]){rpcDb[_0xbd67('0x8e')](_0x96c7c7);}_0x36ccc5(_['pick'](_0x583b27,[_0xbd67('0x5f')]));});});};Preview['prototype'][_0xbd67('0x10d')]=function(_0x540b79,_0x39416a){var _0x417f56=this;return new BPromise(function(_0x467097,_0x16e253){var _0x4f81e3,_0x4b7384;rpcDb[_0xbd67('0x10e')](_0x540b79)[_0xbd67('0x83')](function(_0x3b306a){if(!_[_0xbd67('0x84')](_0x3b306a[0x0])){_0x4b7384=_0x3b306a[0x0][_0xbd67('0x10f')]?![]:!![];_0x4f81e3=_0x3b306a[0x0][_0xbd67('0x10f')]?!![]:![];_0x4f81e3=_0x39416a?!![]:_0x4f81e3;}var _0x117d30=_0x417f56[_0xbd67('0x110')](_0x3b306a);if(_0x117d30[_0xbd67('0x111')]){rpcDb[_0xbd67('0x112')](_['pick'](_0x3b306a[0x0],[_0xbd67('0x76'),_0xbd67('0x113')]))[_0xbd67('0x83')](function(_0x5489db){_0x417f56[_0xbd67('0xfb')](_0x5489db,_0x3b306a[0x0],_0x39416a,_0x4b7384,_0x4f81e3)[_0xbd67('0x83')](function(_0xc3820){_0x467097(_0xc3820);})[_0xbd67('0x8d')](function(_0x3b6778){_0x16e253(_0x3b6778);});})[_0xbd67('0x8d')](function(_0x34bf1d){ut['logger'](_0xbd67('0x114'),_0x34bf1d);_0x16e253(ut[_0xbd67('0x5f')](_0xbd67('0x115'),_0x4b7384,_0x4f81e3));});}else{_0x16e253(ut['message'](_0x117d30[_0xbd67('0x5f')],_0x4b7384,_0x4f81e3));}})[_0xbd67('0x8d')](function(_0x1d0817){ut[_0xbd67('0x5e')](_0xbd67('0x116'),_0x1d0817);_0x16e253(ut['message'](_0xbd67('0x115'),![],!![]));});});};Preview['prototype'][_0xbd67('0x110')]=function(_0x1c1cfe){if(_[_0xbd67('0x84')](_0x1c1cfe)||_[_0xbd67('0x100')](_0x1c1cfe)||!_['isNil'](_0x1c1cfe[0x0][_0xbd67('0x117')])&&_[_0xbd67('0x84')](_0x1c1cfe[0x0][_0xbd67('0x117')][_0xbd67('0x29')])){ut[_0xbd67('0x5e')](_0xbd67('0x118'),_0x1c1cfe);return{'isValid':![],'message':_0xbd67('0x119')};}var _0x2cf1e4=this[_0xbd67('0x14')][_0x1c1cfe[0x0]['Queue'][_0xbd67('0x29')]];_0x2cf1e4[_0xbd67('0x5f')]=_0xbd67('0x9e');if(_[_0xbd67('0x84')](_0x2cf1e4)){ut['logger'](_0xbd67('0x11a'),_0x2cf1e4);return{'isValid':![],'message':_0xbd67('0x11b')};}if(!this[_0xbd67('0x9d')](_0x2cf1e4[_0xbd67('0x53')])){ut['logger'](_0xbd67('0x11c'),_0xbd67('0x11d')+_0x2cf1e4[_0xbd67('0x29')]+_0xbd67('0x11e'));if(!this['isTrunkReachable'](_0x2cf1e4[_0xbd67('0x11f')])){ut[_0xbd67('0x5e')](_0xbd67('0x11c'),_0x2cf1e4[_0xbd67('0x29')]+_0xbd67('0x120'));return{'isValid':![],'message':_0xbd67('0x121')};}}if(!ut[_0xbd67('0x9a')](_0x2cf1e4[_0xbd67('0x9b')])){ut['logger'](_0xbd67('0x122'),_0x2cf1e4[_0xbd67('0x29')]+_0xbd67('0x123'));return{'isValid':![],'message':_0xbd67('0x11d')+_0x2cf1e4['name']+_0xbd67('0x123')};}return{'isValid':!![],'message':_0xbd67('0x124')};};Preview['prototype'][_0xbd67('0x125')]=function(_0x21c0ce,_0x39adb4,_0x2e7836,_0x90a25c){var _0x41bb22=this;return new BPromise(function(_0x566eb4,_0xa545b){var _0x3758ee=_0x21c0ce['uniqueid'];var _0x22edee=_0x41bb22[_0xbd67('0x9d')](_0x39adb4[_0xbd67('0x53')])?util[_0xbd67('0x57')]('SIP/%s/%s%s',_0x39adb4[_0xbd67('0x53')][_0xbd67('0x29')],_[_0xbd67('0x84')](_0x39adb4[_0xbd67('0x39')])?'':_0x39adb4[_0xbd67('0x39')][_0xbd67('0x126')]()||'',_0x39adb4[_0xbd67('0x127')]>0x0?_0x2e7836[_0xbd67('0xfc')][_0xbd67('0xfd')][_0xbd67('0x128')](_0x39adb4['dialCutDigit']):_0x2e7836[_0xbd67('0xfc')]['phone']):util[_0xbd67('0x57')](_0xbd67('0x129'),_[_0xbd67('0x84')](_0x39adb4[_0xbd67('0x11f')])?_0x39adb4[_0xbd67('0x53')][_0xbd67('0x29')]:_0x39adb4[_0xbd67('0x11f')][_0xbd67('0x29')],_['isNil'](_0x39adb4[_0xbd67('0x39')])?'':_0x39adb4[_0xbd67('0x39')]['trim']()||'',_0x39adb4[_0xbd67('0x127')]>0x0?_0x2e7836['Contact'][_0xbd67('0xfd')][_0xbd67('0x128')](_0x39adb4['dialCutDigit']):_0x2e7836['Contact'][_0xbd67('0xfd')]);var _0x5da307=_0x41bb22['isTrunkReachable'](_0x39adb4[_0xbd67('0x53')])?ut['getCallerId'](_0x39adb4['Trunk'][_0xbd67('0x12a')],_0x39adb4[_0xbd67('0x37')],_0x39adb4[_0xbd67('0x12b')]>0x0?ut[_0xbd67('0x12c')](_0x39adb4[_0xbd67('0x12d')],_0x39adb4[_0xbd67('0x12b')]):_0x39adb4[_0xbd67('0x12d')]):ut['getCallerId'](_[_0xbd67('0x84')](_0x39adb4[_0xbd67('0x11f')])?_0x39adb4['Trunk']['callerid']:_0x39adb4[_0xbd67('0x11f')][_0xbd67('0x12a')],_0x39adb4[_0xbd67('0x37')],_0x39adb4[_0xbd67('0x12b')]>0x0?ut['getCallerIdRandom'](_0x39adb4['dialOriginateCallerIdNumber'],_0x39adb4[_0xbd67('0x12b')]):_0x39adb4['dialOriginateCallerIdNumber']);if(_0x5da307){_0x21c0ce[_0xbd67('0x12e')]=ut[_0xbd67('0x12f')](_0x5da307);_0x21c0ce[_0xbd67('0x130')]=ut['extractCalleridNumber'](_0x5da307);}var _0x4b7be0=ut[_0xbd67('0x131')](_0x39adb4,_0x2e7836,_0x22edee,_0x5da307,_0x3758ee,_0x21c0ce);_[_0xbd67('0x132')](_0x21c0ce,ut['toLowerVariables'](_0x4b7be0));_0x21c0ce[_0xbd67('0x8f')]=moment()[_0xbd67('0x57')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xbd67('0x78')](ut[_0xbd67('0x133')](_0x21c0ce,_0x39adb4,_0x4b7be0,_0x21c0ce[_0xbd67('0xcc')],_0x90a25c))[_0xbd67('0x83')](function(_0x51047b){_0x39adb4[_0xbd67('0x4e')]+=0x1;logger['info'](_0xbd67('0x134'),_0x3758ee,'\x20Queue',_0x39adb4['name'],_0xbd67('0x6f'),_0x39adb4[_0xbd67('0x4e')]);_0x566eb4(_0x51047b);})[_0xbd67('0x8d')](function(_0x184fb2){ut['logAgent'](_0x21c0ce,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x21c0ce,_0xbd67('0x135'));_0xa545b(_0x184fb2);});});};Preview[_0xbd67('0xf')][_0xbd67('0x22')]=function(_0x290f6f){if(this[_0xbd67('0x17')][_0x290f6f[_0xbd67('0xaf')]]){this[_0xbd67('0x17')][_0x290f6f['linkedid']]['channel']=_0x290f6f['channel'];}};Preview[_0xbd67('0xf')]['syncOriginateResponse']=function(_0x59dcd4){var _0x2ddf55=this;var _0x51b04e=this[_0xbd67('0x17')][_0x59dcd4[_0xbd67('0x136')]];if(_0x51b04e){if(_0x51b04e[_0xbd67('0xff')]&&this['agents'][_0x51b04e[_0xbd67('0xff')]]){ut[_0xbd67('0x137')](_0x51b04e,this[_0xbd67('0x18')][_0x51b04e[_0xbd67('0xff')]][_0xbd67('0x29')],this['agents'][_0x51b04e[_0xbd67('0xff')]]['id']);}var _0x2bd260=_['clone'](_0x51b04e);_0x2bd260[_0xbd67('0xb1')]=moment()[_0xbd67('0x57')](_0xbd67('0x90'));var _0x14a2e0=_0x2ddf55[_0xbd67('0x14')][_0x51b04e[_0xbd67('0x70')]];if(ut[_0xbd67('0x138')](_0x59dcd4[_0xbd67('0x139')])){if(_0x51b04e['unlockAgent']){rpcDb['unlockContact'](_0x51b04e['idContact']);}if(_0x51b04e[_0xbd67('0xcc')]){rpcDb[_0xbd67('0x8e')](_0x51b04e[_0xbd67('0x13a')]);}ami[_0xbd67('0x27')]('custom:agentringnoanswer',ut[_0xbd67('0xa3')](_0x51b04e,_0xbd67('0x13b'),this[_0xbd67('0x14')][_0x51b04e[_0xbd67('0x70')]]));this[_0xbd67('0xee')](_0x2bd260,_0x14a2e0,_0x59dcd4);}else{_0x51b04e['starttime']=moment()[_0xbd67('0x57')](_0xbd67('0x90'));ut['logAgent'](_0x2bd260,0x4,_0xbd67('0xba'));rpcDb['createAgentHistory'](_0x2bd260,_0xbd67('0x13c'));}}};Preview[_0xbd67('0xf')]['syncHangup']=function(_0x14e960){var _0x493c94=this;var _0x351cbe=this[_0xbd67('0x17')][_0x14e960[_0xbd67('0xaf')]];var _0x2b3212;if(_0x351cbe){_0x2b3212=this[_0xbd67('0x14')][_0x351cbe[_0xbd67('0x70')]];logger[_0xbd67('0x5a')](_0xbd67('0x13d'),_0x14e960[_0xbd67('0xaf')],_0xbd67('0xb3'),_0x2b3212['name'],_0xbd67('0x71'),_0x2b3212[_0xbd67('0x2e')]);}if(this['actions'][_0x14e960['linkedid']]&&_0x14e960[_0xbd67('0xaf')]!==_0x14e960[_0xbd67('0xb2')]){if(_0x14e960['cause']==='16'&&this[_0xbd67('0x17')][_0x14e960[_0xbd67('0xaf')]]['dialAnswer']){this[_0xbd67('0x9f')](_0x14e960,_0x14e960['linkedid'],_0x14e960[_0xbd67('0x13e')]);}else if(this[_0xbd67('0x17')][_0x14e960[_0xbd67('0xaf')]][_0xbd67('0x72')]){logger['info'](_0xbd67('0x13f'),_0x14e960[_0xbd67('0xaf')],_0x14e960[_0xbd67('0x13e')],_0xbd67('0xb3'),_0x2b3212[_0xbd67('0x29')],_0xbd67('0x71'),_0x2b3212[_0xbd67('0x2e')]);this[_0xbd67('0x9f')](_0x14e960,_0x14e960['linkedid'],_0x14e960[_0xbd67('0x13e')]);}}else if(_0x351cbe&&_['isNil'](_0x351cbe[_0xbd67('0x140')])&&_0x2b3212[_0xbd67('0x141')]&&_0x14e960[_0xbd67('0xaf')]===_0x14e960[_0xbd67('0xb2')]&&_[_0xbd67('0x84')](_0x14e960[_0xbd67('0xf1')])&&_0x14e960[_0xbd67('0x13e')]==='16'&&_0x14e960[_0xbd67('0x142')]==='6'&&_[_0xbd67('0xef')](_0x351cbe[_0xbd67('0x143')])){if(_0x351cbe[_0xbd67('0xae')]){rpcDb[_0xbd67('0x10c')](_0x351cbe[_0xbd67('0x13a')]);}if(_0x351cbe[_0xbd67('0xcc')]){rpcDb['disableContact'](_0x351cbe['idContact']);}_0x14e960['reason']='22';this['callProgressDetectingAgent'](_0x351cbe,_0x2b3212,_0x14e960);}else if(_0x351cbe&&_0x351cbe[_0xbd67('0x143')]){if(_0x14e960[_0xbd67('0x13e')]==='16'&&this[_0xbd67('0x17')][_0x14e960[_0xbd67('0xaf')]]['dialAnswer']){logger[_0xbd67('0x5a')](_0xbd67('0x144'),_0x14e960[_0xbd67('0xaf')],_0x14e960[_0xbd67('0x13e')],'\x20Queue',_0x2b3212[_0xbd67('0x29')],'pTalking:\x20',_0x2b3212['pTalking']);this[_0xbd67('0x9f')](_0x14e960,_0x14e960[_0xbd67('0xaf')],_0x14e960[_0xbd67('0x13e')]);}else if(this[_0xbd67('0x17')][_0x14e960['linkedid']][_0xbd67('0x72')]){logger['info'](_0xbd67('0x13f'),_0x14e960[_0xbd67('0xaf')],_0x14e960[_0xbd67('0x13e')],_0xbd67('0xb3'),_0x2b3212[_0xbd67('0x29')],'pTalking:\x20',_0x2b3212[_0xbd67('0x2e')]);this[_0xbd67('0x9f')](_0x14e960,_0x14e960['linkedid'],_0x14e960['cause']);}}};Preview['prototype'][_0xbd67('0x145')]=function(_0x33c787){if(this[_0xbd67('0x17')][_0x33c787['destlinkedid']]&&_0x33c787[_0xbd67('0x146')]!==_0x33c787['destuniqueid']){this[_0xbd67('0x9f')](_0x33c787,_0x33c787['destlinkedid'],_0x33c787['dialstatus']);}};Preview[_0xbd67('0xf')]['syncHangupRequest']=function(_0x51fa0c){if(this['actions'][_0x51fa0c[_0xbd67('0xaf')]]&&_0x51fa0c[_0xbd67('0xaf')]!==_0x51fa0c[_0xbd67('0xb2')]&&!this['actions'][_0x51fa0c[_0xbd67('0xaf')]][_0xbd67('0x72')]){if(_0x51fa0c[_0xbd67('0x13e')]==='1'){this[_0xbd67('0x9f')](_0x51fa0c,_0x51fa0c['linkedid'],_0x51fa0c[_0xbd67('0x13e')]);}}};Preview['prototype'][_0xbd67('0x147')]=function(_0xf4ad5e,_0x1ddeab,_0x4913b7){if(this[_0xbd67('0x17')][_0xf4ad5e]){if(_[_0xbd67('0x84')](this[_0xbd67('0x17')][_0xf4ad5e][_0xbd67('0x148')])){this[_0xbd67('0x17')][_0xf4ad5e][_0xbd67('0x148')]={};}this[_0xbd67('0x17')][_0xf4ad5e][_0xbd67('0x148')][_0x1ddeab]=_0x4913b7;}};Preview['prototype']['syncVarSet']=function(_0xa693c5){try{if(!_[_0xbd67('0x84')](_0xa693c5)){if(ut[_0xbd67('0x149')](_[_0xbd67('0x14a')](_0xa693c5[_0xbd67('0x14b')])[0x0])){this[_0xbd67('0x147')](_0xa693c5[_0xbd67('0xb2')],_[_0xbd67('0x14a')](_0xa693c5[_0xbd67('0x14b')])[0x0],_0xa693c5[_0xbd67('0x14c')]);}}}catch(_0x5e97db){logger[_0xbd67('0x14d')](_0xbd67('0x14e'),util[_0xbd67('0x14f')](_0x5e97db,{'showHidden':![],'depth':null}));}};Preview[_0xbd67('0xf')]['syncAttendedTransfer']=function(_0x5932eb){if(_0x5932eb){if(this[_0xbd67('0x17')][_0x5932eb[_0xbd67('0x150')]]){this[_0xbd67('0x17')][_0x5932eb['transfertargetlinkedid']][_0xbd67('0x143')]=!![];}}};Preview[_0xbd67('0xf')][_0xbd67('0x25')]=function(_0x50c87c){if(_0x50c87c){if(this['actions'][_0x50c87c[_0xbd67('0x151')]]){this[_0xbd67('0x17')][_0x50c87c[_0xbd67('0x151')]][_0xbd67('0x143')]=!![];}}};module[_0xbd67('0x152')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 39338e9..d707022 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 _0xb092=['../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','connectedlinename','context','from-sip','xcally-motion-preview','holdtime','lastAssignedTo','membername','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash'];(function(_0x39e153,_0x9e8365){var _0x342760=function(_0x51bbaa){while(--_0x51bbaa){_0x39e153['push'](_0x39e153['shift']());}};_0x342760(++_0x9e8365);}(_0xb092,0x10f));var _0x2b09=function(_0x480d55,_0x5ca468){_0x480d55=_0x480d55-0x0;var _0x496d5e=_0xb092[_0x480d55];return _0x496d5e;};'use strict';var util=require(_0x2b09('0x0'));var BPromise=require(_0x2b09('0x1'));var logger=require('../../../config/logger')(_0x2b09('0x2'));var _=require(_0x2b09('0x3'));var cmHopper=require(_0x2b09('0x4'));var cmHopperFinal=require(_0x2b09('0x5'));var cmHopperHistory=require(_0x2b09('0x6'));var cmHopperBlack=require(_0x2b09('0x7'));var voiceQueueRt=require(_0x2b09('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x2b09('0x9'));function loggerCatch(_0x4f9836){return function(_0xcbcd83){logger[_0x2b09('0xa')](_0x4f9836,util[_0x2b09('0xb')](_0xcbcd83,{'showHidden':![],'depth':null}));};}function create(_0x478a12){return BPromise[_0x2b09('0xc')]()[_0x2b09('0xd')](cmHopperHistory[_0x2b09('0xe')](_0x478a12))[_0x2b09('0xf')](loggerCatch(_0x2b09('0x10')));}function createAgent(_0x3dd9ce){return BPromise[_0x2b09('0xc')]()['then'](agentReportPreview[_0x2b09('0xe')](_0x3dd9ce))[_0x2b09('0xf')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x233ffc){return BPromise[_0x2b09('0xc')]()[_0x2b09('0xd')](cmHopper[_0x2b09('0x11')](_0x233ffc,!![]))[_0x2b09('0xf')](loggerCatch(_0x2b09('0x12')));}exports['checkIsBlackList']=function(_0xcee1e6){return BPromise[_0x2b09('0xc')]()[_0x2b09('0xd')](cmHopperBlack[_0x2b09('0x13')](_0xcee1e6))['catch'](loggerCatch(_0x2b09('0x14')));};exports[_0x2b09('0x15')]=function(_0xba2299){return BPromise[_0x2b09('0xc')]()[_0x2b09('0xd')](cmHopper[_0x2b09('0x15')](_0xba2299))[_0x2b09('0xf')](loggerCatch(_0x2b09('0x16')));};exports['createHistory']=function(_0x4edcf4,_0xdebf24){create(_0x4edcf4)['catch'](loggerCatch(_0xdebf24));moveContact(_0x4edcf4)['catch'](loggerCatch(_0xdebf24));};exports[_0x2b09('0x17')]=function(_0x4ec731,_0x4dfb4e){createAgent(_0x4ec731)[_0x2b09('0xf')](loggerCatch(_0x4dfb4e));};exports[_0x2b09('0x18')]=function(_0x47adbd,_0x2d8e5b){create(_0x47adbd)[_0x2b09('0xf')](loggerCatch(_0x2d8e5b));};exports[_0x2b09('0x19')]=function(_0x174f8a,_0x5b0943){moveContact(_0x174f8a)[_0x2b09('0xf')](loggerCatch(_0x5b0943));};exports[_0x2b09('0x1a')]=function(_0x68cac9,_0x9ca8e1,_0x3e4863){if(_0x9ca8e1){_0x68cac9[_0x2b09('0x1b')]=null;}if(_0x3e4863){_0x68cac9[_0x2b09('0x1c')]=![];}return BPromise[_0x2b09('0xc')]()[_0x2b09('0xd')](cmHopper[_0x2b09('0x1a')](_0x68cac9))[_0x2b09('0xf')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x2b09('0x1d')]=function(_0x8dc32c){return BPromise[_0x2b09('0xc')]()[_0x2b09('0xd')](cmHopper[_0x2b09('0x1d')](_0x8dc32c))[_0x2b09('0xf')](loggerCatch(_0x2b09('0x1e')));};exports[_0x2b09('0x1f')]=function(_0x3bcb10){return BPromise[_0x2b09('0xc')]()[_0x2b09('0xd')](cmHopper['unlockContact']({'UserId':null},_0x3bcb10,0x1))[_0x2b09('0xf')](loggerCatch(_0x2b09('0x20')));};exports[_0x2b09('0x21')]=function(_0x1ac94b){return BPromise[_0x2b09('0xc')]()[_0x2b09('0xd')](cmHopper[_0x2b09('0x1f')]({'active':![]},_0x1ac94b,0x1))[_0x2b09('0xf')](loggerCatch(_0x2b09('0x22')));};exports[_0x2b09('0x23')]=function(_0x42a801){var _0x2c9604={};_0x2c9604[_0x2b09('0x24')]=_0x42a801[_0x2b09('0x24')];_0x2c9604[_0x2b09('0x25')]=_0x42a801[_0x2b09('0x25')];_0x2c9604[_0x2b09('0x26')]=_0x42a801[_0x2b09('0x26')];_0x2c9604['calleridname']=_0x42a801[_0x2b09('0x27')];_0x2c9604[_0x2b09('0x28')]=_0x42a801[_0x2b09('0x28')];_0x2c9604['queuecallerjoinAt']=_0x42a801['answertime'];_0x2c9604[_0x2b09('0x29')]=_0x42a801[_0x2b09('0x2a')];_0x2c9604['queuecallercomplete']=0x1;_0x2c9604['queuecallercompleteAt']=_0x42a801['endtime'];_0x2c9604[_0x2b09('0x2b')]=_0x42a801['membername'];_0x2c9604[_0x2b09('0x2c')]=_0x2b09('0x2d');_0x2c9604['exten']=_0x2b09('0x2e');_0x2c9604[_0x2b09('0x2f')]=0x0;_0x2c9604['assigned']=0x1;_0x2c9604[_0x2b09('0x30')]=_0x42a801[_0x2b09('0x31')];_0x2c9604['queuecallerexitreason']=_0x2b09('0x32');return BPromise[_0x2b09('0xc')]()['then'](voiceQueueReport[_0x2b09('0x33')](_0x2c9604))[_0x2b09('0xf')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x2b09('0x34')]=function(_0x2a3125,_0x1950f2){return BPromise[_0x2b09('0xc')]()[_0x2b09('0xd')](cmHopper[_0x2b09('0x34')](_0x2a3125,_0x1950f2))[_0x2b09('0xf')](loggerCatch(_0x2b09('0x35')));};exports['rescheduleContactInQueue']=function(_0x4c5b73){return BPromise[_0x2b09('0xc')]()['then'](cmHopper[_0x2b09('0x1a')](_0x4c5b73,!![],!![]))[_0x2b09('0xf')](loggerCatch(_0x2b09('0x36')));}; \ No newline at end of file +var _0xa341=['uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContact','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','catch','[createHistory]\x20','then','createHistory','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type'];(function(_0x1ca2b1,_0x15df02){var _0x3f83ce=function(_0x5794d9){while(--_0x5794d9){_0x1ca2b1['push'](_0x1ca2b1['shift']());}};_0x3f83ce(++_0x15df02);}(_0xa341,0x1bd));var _0x1a34=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa341[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x1a34('0x0'));var BPromise=require(_0x1a34('0x1'));var logger=require('../../../config/logger')(_0x1a34('0x2'));var _=require(_0x1a34('0x3'));var cmHopper=require(_0x1a34('0x4'));var cmHopperFinal=require(_0x1a34('0x5'));var cmHopperHistory=require(_0x1a34('0x6'));var cmHopperBlack=require(_0x1a34('0x7'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x1a34('0x8'));var voiceQueueReport=require(_0x1a34('0x9'));function loggerCatch(_0x239726){return function(_0x410c77){logger['error'](_0x239726,util[_0x1a34('0xa')](_0x410c77,{'showHidden':![],'depth':null}));};}function create(_0x341495){return BPromise[_0x1a34('0xb')]()['then'](cmHopperHistory['createHistory'](_0x341495))[_0x1a34('0xc')](loggerCatch(_0x1a34('0xd')));}function createAgent(_0xec0da6){return BPromise[_0x1a34('0xb')]()[_0x1a34('0xe')](agentReportPreview[_0x1a34('0xf')](_0xec0da6))[_0x1a34('0xc')](loggerCatch(_0x1a34('0xd')));}function moveContact(_0x13524b){return BPromise[_0x1a34('0xb')]()[_0x1a34('0xe')](cmHopper[_0x1a34('0x10')](_0x13524b,!![]))[_0x1a34('0xc')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x1a34('0x11')]=function(_0x41f58b){return BPromise[_0x1a34('0xb')]()[_0x1a34('0xe')](cmHopperBlack['checkIsBlackList'](_0x41f58b))['catch'](loggerCatch(_0x1a34('0x12')));};exports[_0x1a34('0x13')]=function(_0x49d76e){return BPromise[_0x1a34('0xb')]()[_0x1a34('0xe')](cmHopper['getContactPreview'](_0x49d76e))['catch'](loggerCatch(_0x1a34('0x14')));};exports[_0x1a34('0xf')]=function(_0x392662,_0x4198fe){create(_0x392662)[_0x1a34('0xc')](loggerCatch(_0x4198fe));moveContact(_0x392662)[_0x1a34('0xc')](loggerCatch(_0x4198fe));};exports['createAgentHistory']=function(_0x244511,_0x28ad25){createAgent(_0x244511)[_0x1a34('0xc')](loggerCatch(_0x28ad25));};exports[_0x1a34('0x15')]=function(_0x415dda,_0x12ca77){create(_0x415dda)[_0x1a34('0xc')](loggerCatch(_0x12ca77));};exports[_0x1a34('0x16')]=function(_0x5c5a35,_0x3607f4){moveContact(_0x5c5a35)[_0x1a34('0xc')](loggerCatch(_0x3607f4));};exports['rescheduleContact']=function(_0x55c6ec,_0x22773a,_0x49e757){if(_0x22773a){_0x55c6ec['UserId']=null;}if(_0x49e757){_0x55c6ec[_0x1a34('0x17')]=![];}return BPromise['resolve']()['then'](cmHopper['rescheduleContact'](_0x55c6ec))[_0x1a34('0xc')](loggerCatch(_0x1a34('0x18')));};exports[_0x1a34('0x19')]=function(_0xc95ceb){return BPromise[_0x1a34('0xb')]()[_0x1a34('0xe')](cmHopper[_0x1a34('0x19')](_0xc95ceb))['catch'](loggerCatch(_0x1a34('0x1a')));};exports[_0x1a34('0x1b')]=function(_0x3aaa1e){return BPromise['resolve']()[_0x1a34('0xe')](cmHopper[_0x1a34('0x1b')]({'UserId':null},_0x3aaa1e,0x1))[_0x1a34('0xc')](loggerCatch(_0x1a34('0x1c')));};exports['disableContact']=function(_0x172a79){return BPromise[_0x1a34('0xb')]()[_0x1a34('0xe')](cmHopper[_0x1a34('0x1b')]({'active':![]},_0x172a79,0x1))[_0x1a34('0xc')](loggerCatch(_0x1a34('0x1d')));};exports[_0x1a34('0x1e')]=function(_0xafcd1b){var _0x5f181b={};_0x5f181b[_0x1a34('0x1f')]=_0xafcd1b[_0x1a34('0x1f')];_0x5f181b[_0x1a34('0x20')]=_0xafcd1b[_0x1a34('0x20')];_0x5f181b['calleridnum']=_0xafcd1b[_0x1a34('0x21')];_0x5f181b[_0x1a34('0x22')]=_0xafcd1b[_0x1a34('0x22')];_0x5f181b[_0x1a34('0x23')]=_0xafcd1b[_0x1a34('0x23')];_0x5f181b['queuecallerjoinAt']=_0xafcd1b[_0x1a34('0x24')];_0x5f181b[_0x1a34('0x25')]=_0xafcd1b[_0x1a34('0x24')];_0x5f181b[_0x1a34('0x26')]=0x1;_0x5f181b['queuecallercompleteAt']=_0xafcd1b[_0x1a34('0x27')];_0x5f181b[_0x1a34('0x28')]=_0xafcd1b['membername'];_0x5f181b['context']=_0x1a34('0x29');_0x5f181b['exten']=_0x1a34('0x2a');_0x5f181b[_0x1a34('0x2b')]=0x0;_0x5f181b[_0x1a34('0x2c')]=0x1;_0x5f181b[_0x1a34('0x2d')]=_0xafcd1b[_0x1a34('0x2e')];_0x5f181b[_0x1a34('0x2f')]='COMPLETED';return BPromise[_0x1a34('0xb')]()[_0x1a34('0xe')](voiceQueueReport[_0x1a34('0x30')](_0x5f181b))[_0x1a34('0xc')](loggerCatch(_0x1a34('0x31')));};exports[_0x1a34('0x32')]=function(_0x510d82,_0x34aad4){return BPromise[_0x1a34('0xb')]()[_0x1a34('0xe')](cmHopper['getContactRecallMe'](_0x510d82,_0x34aad4))[_0x1a34('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x559449){return BPromise[_0x1a34('0xb')]()['then'](cmHopper[_0x1a34('0x33')](_0x559449,!![],!![]))[_0x1a34('0xc')](loggerCatch(_0x1a34('0x34')));}; \ 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 e96e2b9..3c38832 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 _0xb39b=['util','lodash','moment','preview','127.0.0.1','milliseconds','loggerCatch','error','inspect','logger','info','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logCustomer','talktime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','timeout','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','interface','motionChannel','voice','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','status','push','getDiff','diff','seconds','createBody','CampaignId','idContact','type','membername','countnoanswerretry','countglobal','callback','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','replace','match','extractCalleridNumber'];(function(_0x4226d6,_0x3864ca){var _0x19655b=function(_0x1d43a1){while(--_0x1d43a1){_0x4226d6['push'](_0x4226d6['shift']());}};_0x19655b(++_0x3864ca);}(_0xb39b,0x95));var _0xbb39=function(_0x4acb13,_0x237923){_0x4acb13=_0x4acb13-0x0;var _0x4f4025=_0xb39b[_0x4acb13];return _0x4f4025;};'use strict';var util=require(_0xbb39('0x0'));var _=require(_0xbb39('0x1'));var moment=require(_0xbb39('0x2'));var logger=require('../../../../config/logger')(_0xbb39('0x3'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0xbb39('0x4');function getSeconds(_0x18f615,_0x3bc983){var _0x218d7c=moment(_0x18f615)[_0xbb39('0x5')](0x0);var _0x428883=moment(_0x3bc983)[_0xbb39('0x5')](0x0);return _0x218d7c['diff'](_0x428883,'seconds');}exports[_0xbb39('0x6')]=function(_0x57da5a){return function(_0x3c6491){logger[_0xbb39('0x7')](_0x57da5a,util[_0xbb39('0x8')](_0x3c6491,{'showHidden':![],'depth':null}));};};exports[_0xbb39('0x9')]=function(_0x4f009e,_0x50f8d4){logger[_0xbb39('0xa')](_0x4f009e,util[_0xbb39('0x8')](_0x50f8d4,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3f324e,_0x1dfb24){logger['error'](_0x3f324e,util[_0xbb39('0x8')](_0x1dfb24,{'showHidden':![],'depth':null}));};exports[_0xbb39('0xb')]=function(_0x2f432e){return function(_0x1a56da){logger[_0xbb39('0xa')](_0x2f432e,util[_0xbb39('0x8')](_0x1a56da,{'showHidden':![],'depth':null}));};};exports[_0xbb39('0xc')]=function(_0x3b39cf,_0x73c127,_0x301b9f){return{'message':_0x3b39cf,'unlock':_0x73c127,'active':_0x301b9f};};exports[_0xbb39('0xd')]=function(_0x34e08e,_0x450533,_0x1f06f4){if(!_[_0xbb39('0xe')](_0x1f06f4)&&_0xbb39('0xf')===typeof _0x1f06f4&&!_[_0xbb39('0x10')](_0x1f06f4)){if(!_[_0xbb39('0xe')](_0x450533)&&_0xbb39('0xf')===typeof _0x450533&&!_[_0xbb39('0x10')](_0x450533)){return util[_0xbb39('0x11')]('\x22%s\x22\x20<%s>',_0x450533,_0x1f06f4);}return util['format'](_0xbb39('0x12'),_0x1f06f4,_0x1f06f4);}if(!_['isUndefined'](_0x34e08e)&&_0xbb39('0xf')===typeof _0x34e08e&&!_[_0xbb39('0x10')](_0x34e08e)){return _0x34e08e;}return _0xbb39('0x13');};exports[_0xbb39('0x14')]=function(_0x40e1fc){if(_['isNil'](_0x40e1fc)){return![];}return _0x40e1fc;};exports[_0xbb39('0x15')]=function(_0x52aa43,_0x5511f8,_0x2f7adf,_0x4da8a8,_0x39b999,_0x3e81f2){var _0x3ccb92={'XMD-QUEUE':_0x5511f8[_0xbb39('0x16')]?_0x5511f8[_0xbb39('0x16')][_0xbb39('0x17')]:'','XMD-CALLERID':_0x4da8a8,'XMD-CALLERID-PREVIEW':_0x3e81f2?util[_0xbb39('0x11')]('\x22%s\x22\x20<%s>',_0x3e81f2[_0xbb39('0x18')],_0x3e81f2[_0xbb39('0x19')]):_0x4da8a8,'XMD-DIALID':_0x39b999,'XMD-CONTACTID':_0x5511f8['ContactId'],'XMD-CDRTYPE':_0xbb39('0x1a'),'CALLERID(all)':_0x4da8a8,'XMD-VOICEQUEUEID':_0x5511f8[_0xbb39('0x1b')],'XMD-DIALCHANNEL':_0x2f7adf,'XMD-DIALTIMEOUT':_0x52aa43[_0xbb39('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xbb39('0x11')](_0xbb39('0x1d'),_0x52aa43[_0xbb39('0x1e')]?'g':'',_[_0xbb39('0x10')](_0x52aa43[_0xbb39('0x1f')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x52aa43[_0xbb39('0x20')]||'','XMD-AGI':_0x52aa43[_0xbb39('0x21')]?util['format'](_0xbb39('0x22'),ipAgi,_0x52aa43['dialQueueProject']):_0xbb39('0x23'),'XMD-AGIAFTER':_0x52aa43[_0xbb39('0x1e')]?util[_0xbb39('0x11')](_0xbb39('0x22'),ipAgi,_0x52aa43[_0xbb39('0x1e')]):_0xbb39('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x3e81f2?_0x3e81f2[_0xbb39('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x3e81f2?_0x3e81f2[_0xbb39('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xbb39('0x10')](_0x52aa43['monitor_format'])){_0x3ccb92[util[_0xbb39('0x11')]('%s',_0xbb39('0x26'))]=_0x52aa43[_0xbb39('0x1f')];_0x3ccb92[util['format']('%s',_0xbb39('0x27'))]=_0x39b999;}if(_0x5511f8&&_0x5511f8[_0xbb39('0x28')]){for(var _0x497c10 in _0x5511f8[_0xbb39('0x28')]){if(_0x5511f8[_0xbb39('0x28')][_0xbb39('0x29')](_0x497c10)){if(!_[_0xbb39('0x2a')](_0x5511f8[_0xbb39('0x28')][_0x497c10])&&_0x497c10!=='id'&&_0x497c10!==_0xbb39('0x2b')&&_0x497c10!==_0xbb39('0x2c')&&_0x497c10!==_0xbb39('0x2d')){_0x3ccb92[util[_0xbb39('0x11')](_0xbb39('0x2e'),_0xbb39('0x2f'),_[_0xbb39('0x30')](_0x497c10))]=_0x5511f8[_0xbb39('0x28')][_0x497c10];}}}}return _0x3ccb92;};exports[_0xbb39('0x31')]=function(_0x15e200){var _0x48a41d={};for(var _0x401d9f in _0x15e200){if(_0x15e200[_0xbb39('0x29')](_0x401d9f)){_0x48a41d[util[_0xbb39('0x11')]('%s',_[_0xbb39('0x32')](_0x401d9f))]=_0x15e200[_0x401d9f];}}return{'variables':_0x48a41d};};exports[_0xbb39('0x33')]=function(_0x52d020,_0x50afa5){if(!_[_0xbb39('0x2a')](_0x52d020)){if(_0x52d020[_0xbb39('0x29')](_0xbb39('0x34'))){if(_0x52d020[_0xbb39('0x34')]>0x0){_0x52d020[_0xbb39('0x34')]-=0x1;}else{logger[_0xbb39('0x7')](_0xbb39('0x35'),_0x50afa5);}}}else{logger['error'](_0xbb39('0x36'),_0x50afa5);}};exports[_0xbb39('0x37')]=function(_0x46bd94){var _0x279215=moment()[_0xbb39('0x11')](_0xbb39('0x38'));_0x46bd94[_0xbb39('0x39')]=0xd;_0x46bd94[_0xbb39('0x3a')]=_0xbb39('0x3b');_0x46bd94[_0xbb39('0x3c')]=_0x279215;_0x46bd94[_0xbb39('0x3d')]=_0x279215;_0x46bd94[_0xbb39('0x3e')]=_0x279215;};exports[_0xbb39('0x3f')]=function(_0x2f2d81,_0x394c6d,_0x10d4cf){var _0x2709e2=moment()[_0xbb39('0x11')](_0xbb39('0x38'));_0x2f2d81[_0xbb39('0x39')]=_0x394c6d;_0x2f2d81[_0xbb39('0x3a')]=_0x10d4cf;_0x2f2d81[_0xbb39('0x3d')]=_0x2709e2;_0x2f2d81[_0xbb39('0x40')]=getSeconds(_0x2f2d81['responsetime'],_0x2f2d81[_0xbb39('0x3c')]);};exports['logLookAgent']=function(_0x104ce8,_0x45afdd,_0x5e8066){_0x104ce8['membername']=_0x45afdd;_0x104ce8['UserId']=_0x5e8066;};exports[_0xbb39('0x41')]=function(_0x566981,_0x4331b7,_0x29cd37){var _0x2f5f56=moment()[_0xbb39('0x11')](_0xbb39('0x38'));_0x566981[_0xbb39('0x39')]=_0x4331b7;_0x566981['statedesc']=_0x29cd37;_0x566981['responsetime']=_0x566981[_0xbb39('0x3d')]?_0x566981['responsetime']:_0x2f5f56;_0x566981[_0xbb39('0x3e')]=_0x566981[_0xbb39('0x3e')]?_0x566981[_0xbb39('0x3e')]:_0x2f5f56;_0x566981[_0xbb39('0x40')]=getSeconds(_0x566981[_0xbb39('0x3d')]||0x0,_0x566981[_0xbb39('0x3c')]||0x0);_0x566981[_0xbb39('0x42')]=_0x566981['answertime']?getSeconds(_0x566981[_0xbb39('0x3e')],_0x566981[_0xbb39('0x43')]):0x0;};exports[_0xbb39('0x44')]=function(_0x52cbf5){return _0x52cbf5===_0xbb39('0x45');};exports['variablesAction']=function(_0xc271ae,_0x36e1f5,_0x1bf136,_0x3e9abd,_0x1695dc){var _0x193689=_0x3e9abd?_0xbb39('0x46'):_0xc271ae[_0xbb39('0x18')];_0x193689=_0x1695dc?_0xbb39('0x47'):_0x193689;return{'actionid':_0xc271ae[_0xbb39('0x48')],'action':_0xbb39('0x49'),'channel':_0xc271ae[_0xbb39('0x4a')],'callerid':util[_0xbb39('0x11')](_0xbb39('0x12'),_0x193689,_0xc271ae['calleridnum']),'Exten':_0xbb39('0x4b'),'Context':_0xbb39('0x4c'),'Priority':'1','variable':_0x1bf136,'timeout':(_0x36e1f5[_0xbb39('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0xc271ae['uniqueid']};};exports['totalGlobal']=function(_0x426ac4){return _0x426ac4[_0xbb39('0x4e')]+_0x426ac4[_0xbb39('0x4f')]+_0x426ac4['countnoanswerretry']+_0x426ac4[_0xbb39('0x50')]+_0x426ac4[_0xbb39('0x51')];};exports[_0xbb39('0x52')]=function(_0x36140e){var _0x31761a=_[_0xbb39('0x53')](_0x36140e);_0x31761a[_0xbb39('0x39')]=0xf;_0x31761a[_0xbb39('0x3a')]='Global';return _0x31761a;};exports[_0xbb39('0x54')]=function(_0x138297,_0x448fe7,_0x58dbfd){var _0x19bcdb={};_0x19bcdb[_0x448fe7]=_0x138297[_0x448fe7];_0x19bcdb[_0xbb39('0x55')]=![];_0x19bcdb[_0xbb39('0x56')]=moment()[_0xbb39('0x57')](_0x58dbfd,_0xbb39('0x58'))[_0xbb39('0x11')](_0xbb39('0x38'));_0x19bcdb[_0xbb39('0x59')]=_0x138297[_0xbb39('0x59')];_0x19bcdb[_0xbb39('0x5a')]=_0x138297[_0xbb39('0x5a')];_0x19bcdb['VoiceQueueId']=_0x138297['VoiceQueueId']||undefined;return _0x19bcdb;};exports[_0xbb39('0x5b')]=function(_0x1bca4e,_0x582653){if(!_[_0xbb39('0x2a')](_0x1bca4e)){if(_0x1bca4e[_0xbb39('0x5c')]>0x0){_0x1bca4e['pTalking']-=0x1;}else{logger['error'](_0x582653,_0xbb39('0x5d'));}}else{logger['error'](_0x582653,_0xbb39('0x5e'));}};exports[_0xbb39('0x5f')]=function(_0x339789){if(_0x339789<=0x0){return!![];}return![];};exports['buildObj']=function(_0xfa2e9b,_0x304089,_0x43e600){_0xfa2e9b[_0xbb39('0x60')]=_0x304089;_0xfa2e9b[_0xbb39('0x17')]=_0xfa2e9b['queue'];_0xfa2e9b[_0xbb39('0x61')]=_0xfa2e9b['channelAgent'];_0xfa2e9b[_0xbb39('0x62')]=_0xbb39('0x63');if(_0x43e600){_0xfa2e9b[_0xbb39('0x64')]=_0x43e600['mandatoryDisposition'];}return _0xfa2e9b;};exports[_0xbb39('0x65')]=function(_0x4b82b0){var _0x4fdf18={};_0x4fdf18[_0xbb39('0x66')]=_0x4b82b0['queue'];_0x4fdf18[_0xbb39('0x61')]=_0x4b82b0[_0xbb39('0x4a')];_0x4fdf18[_0xbb39('0x48')]=_0x4b82b0[_0xbb39('0x48')];return _0x4fdf18;};exports[_0xbb39('0x67')]=function(_0x110429){var _0x40e71f=[];for(var _0x5c5aa0 in _0x110429){if(_0x110429[_0xbb39('0x29')](_0x5c5aa0)){if(!_[_0xbb39('0x2a')](_0x110429[_0x5c5aa0])&&_0x110429[_0x5c5aa0]['state']===_0xbb39('0x68')&&_0x110429[_0x5c5aa0][_0xbb39('0x69')]==='reachable'){_0x40e71f[_0xbb39('0x6a')](_0x110429[_0x5c5aa0]['id']);}}}return _0x40e71f;};exports[_0xbb39('0x6b')]=function(_0x47d8c0){var _0x402b19=moment()[_0xbb39('0x5')](0x0);var _0x5b8f6a=moment(_0x47d8c0)[_0xbb39('0x5')](0x0);return _0x402b19[_0xbb39('0x6c')](_0x5b8f6a,_0xbb39('0x6d'));};exports[_0xbb39('0x6e')]=function(_0x34113d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x34113d[_0xbb39('0x59')],'ListId':_0x34113d[_0xbb39('0x5a')],'VoiceQueueId':_0x34113d[_0xbb39('0x1b')]||undefined,'CampaignId':_0x34113d[_0xbb39('0x6f')]||undefined};};exports['filterKey']=function(_0x267517){if(_0x267517===_0xbb39('0x48')||_0x267517===_0xbb39('0x70')||_0x267517===_0xbb39('0x66')||_0x267517===_0xbb39('0x71')||_0x267517==='campaigntype'||_0x267517==='dialAnswer'||_0x267517===_0xbb39('0x72')||_0x267517===_0xbb39('0x4a')||_0x267517===_0xbb39('0x18')||_0x267517===_0xbb39('0x55')||_0x267517===_0xbb39('0x19')||_0x267517==='scheduledat'||_0x267517===_0xbb39('0x4e')||_0x267517===_0xbb39('0x4f')||_0x267517===_0xbb39('0x73')||_0x267517===_0xbb39('0x74')||_0x267517===_0xbb39('0x75')||_0x267517==='callbackuniqueid'||_0x267517===_0xbb39('0x76')||_0x267517===_0xbb39('0x77')||_0x267517===_0xbb39('0x59')||_0x267517===_0xbb39('0x5a')||_0x267517===_0xbb39('0x78')||_0x267517===_0xbb39('0x1b')||_0x267517===_0xbb39('0x79')||_0x267517===_0xbb39('0x7a')||_0x267517===_0xbb39('0x7b')||_0x267517===_0xbb39('0x7c')||_0x267517===_0xbb39('0x7d')||_0x267517==='xmd-dialurl'||_0x267517===_0xbb39('0x7e')||_0x267517===_0xbb39('0x7f')||_0x267517===_0xbb39('0x80')||_0x267517===_0xbb39('0x81')||_0x267517===_0xbb39('0x82')||_0x267517===_0xbb39('0x83')||_0x267517===_0xbb39('0x84')||_0x267517===_0xbb39('0x85')||_0x267517===_0xbb39('0x86')||_0x267517===_0xbb39('0x87')||_0x267517===_0xbb39('0x88')||_0x267517===_0xbb39('0x89')||_0x267517===_0xbb39('0x8a')||_0x267517===_0xbb39('0x8b')||_0x267517===_0xbb39('0x8c')||_0x267517===_0xbb39('0x8d')||_0x267517===_0xbb39('0x8e')||_0x267517===_0xbb39('0x87')||_0x267517==='rtpaudioqosbridged'||_0x267517===_0xbb39('0x89')||_0x267517==='rtpaudioqosjitterbridged'||_0x267517==='rtpaudioqosloss'||_0x267517===_0xbb39('0x8c')||_0x267517===_0xbb39('0x8d')||_0x267517===_0xbb39('0x8e')||_0x267517==='bridgepeer'||_0x267517===_0xbb39('0x8f')||_0x267517===_0xbb39('0x39')||_0x267517==='statedesc'){return![];}return!![];};exports[_0xbb39('0x90')]=function(_0x9bf35d,_0x33f270){var _0x1f6cd7,_0x422049,_0x5d1060;if(_0x33f270<=0x0){_0x33f270=0x1;}_0x1f6cd7=new RegExp(_0xbb39('0x91')+_0x33f270+'}$');_0x422049=Math['pow'](0xa,_0x33f270-0x1);_0x5d1060=Math['pow'](0xa,_0x33f270)-0x1;return util[_0xbb39('0x11')]('%s',_[_0xbb39('0x92')](_0x9bf35d,_0x1f6cd7,_['random'](_0x422049,_0x5d1060)));};exports['extractCalleridName']=function(_0x28c789){var _0x437e77=_0x28c789[_0xbb39('0x93')](/"(.*?)"/);return _0x437e77?_0x437e77[0x1]:_0x28c789;};exports[_0xbb39('0x94')]=function(_0x49f4b3){var _0x516c0d=_0x49f4b3[_0xbb39('0x93')](/<(.*?)>/);return _0x516c0d?_0x516c0d[0x1]:_0x49f4b3;}; \ No newline at end of file +var _0xa39f=['state','statedesc','starttime','responsetime','logAgent','ringtime','logLookAgent','membername','UserId','endtime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','buildObj','lastevent','queue','interface','mandatoryDisposition','buildAcw','not_inuse','status','reachable','push','getDiff','seconds','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','countnoanswerretry','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','pow','replace','random','extractCalleridName','match','util','lodash','../../../../config/logger','preview','127.0.0.1','milliseconds','diff','loggerCatch','error','inspect','logger2','info','message','getCallerId','isUndefined','string','format','\x22%s\x22\x20<%s>','isEmpty','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Contact','hasOwnProperty','tags','createdAt','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x455030,_0x3c8232){var _0x400cbb=function(_0x1ee945){while(--_0x1ee945){_0x455030['push'](_0x455030['shift']());}};_0x400cbb(++_0x3c8232);}(_0xa39f,0xdb));var _0xfa39=function(_0xe80e5c,_0x38e90a){_0xe80e5c=_0xe80e5c-0x0;var _0x2bff61=_0xa39f[_0xe80e5c];return _0x2bff61;};'use strict';var util=require(_0xfa39('0x0'));var _=require(_0xfa39('0x1'));var moment=require('moment');var logger=require(_0xfa39('0x2'))(_0xfa39('0x3'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0xfa39('0x4');function getSeconds(_0x18f828,_0x588058){var _0x57c6d4=moment(_0x18f828)[_0xfa39('0x5')](0x0);var _0x1e82b5=moment(_0x588058)[_0xfa39('0x5')](0x0);return _0x57c6d4[_0xfa39('0x6')](_0x1e82b5,'seconds');}exports[_0xfa39('0x7')]=function(_0x321bb1){return function(_0x140b41){logger[_0xfa39('0x8')](_0x321bb1,util[_0xfa39('0x9')](_0x140b41,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x2944f0,_0x717153){logger['info'](_0x2944f0,util[_0xfa39('0x9')](_0x717153,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3dd8b6,_0x1c8026){logger[_0xfa39('0x8')](_0x3dd8b6,util[_0xfa39('0x9')](_0x1c8026,{'showHidden':![],'depth':null}));};exports[_0xfa39('0xa')]=function(_0x329a77){return function(_0x3c5283){logger[_0xfa39('0xb')](_0x329a77,util[_0xfa39('0x9')](_0x3c5283,{'showHidden':![],'depth':null}));};};exports[_0xfa39('0xc')]=function(_0x10f543,_0x5dc0e9,_0x384d4d){return{'message':_0x10f543,'unlock':_0x5dc0e9,'active':_0x384d4d};};exports[_0xfa39('0xd')]=function(_0xdfc70c,_0x3c7589,_0x1af9e0){if(!_[_0xfa39('0xe')](_0x1af9e0)&&_0xfa39('0xf')===typeof _0x1af9e0&&!_['isEmpty'](_0x1af9e0)){if(!_[_0xfa39('0xe')](_0x3c7589)&&'string'===typeof _0x3c7589&&!_['isEmpty'](_0x3c7589)){return util['format']('\x22%s\x22\x20<%s>',_0x3c7589,_0x1af9e0);}return util[_0xfa39('0x10')](_0xfa39('0x11'),_0x1af9e0,_0x1af9e0);}if(!_[_0xfa39('0xe')](_0xdfc70c)&&'string'===typeof _0xdfc70c&&!_[_0xfa39('0x12')](_0xdfc70c)){return _0xdfc70c;}return _0xfa39('0x13');};exports[_0xfa39('0x14')]=function(_0x5bb720){if(_[_0xfa39('0x15')](_0x5bb720)){return![];}return _0x5bb720;};exports[_0xfa39('0x16')]=function(_0x335c34,_0x10b623,_0x35b199,_0x5bcf55,_0x4cdfb0,_0x5863d7){var _0x3ea429={'XMD-QUEUE':_0x10b623[_0xfa39('0x17')]?_0x10b623['Queue'][_0xfa39('0x18')]:'','XMD-CALLERID':_0x5bcf55,'XMD-CALLERID-PREVIEW':_0x5863d7?util[_0xfa39('0x10')](_0xfa39('0x11'),_0x5863d7[_0xfa39('0x19')],_0x5863d7[_0xfa39('0x1a')]):_0x5bcf55,'XMD-DIALID':_0x4cdfb0,'XMD-CONTACTID':_0x10b623[_0xfa39('0x1b')],'XMD-CDRTYPE':_0xfa39('0x1c'),'CALLERID(all)':_0x5bcf55,'XMD-VOICEQUEUEID':_0x10b623[_0xfa39('0x1d')],'XMD-DIALCHANNEL':_0x35b199,'XMD-DIALTIMEOUT':_0x335c34[_0xfa39('0x1e')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xfa39('0x1f'),_0x335c34[_0xfa39('0x20')]?'g':'',_[_0xfa39('0x12')](_0x335c34[_0xfa39('0x21')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x335c34[_0xfa39('0x22')]||'','XMD-AGI':_0x335c34[_0xfa39('0x23')]?util[_0xfa39('0x10')](_0xfa39('0x24'),ipAgi,_0x335c34[_0xfa39('0x23')]):_0xfa39('0x25'),'XMD-AGIAFTER':_0x335c34['dialQueueProject2']?util[_0xfa39('0x10')](_0xfa39('0x24'),ipAgi,_0x335c34['dialQueueProject2']):_0xfa39('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x5863d7?_0x5863d7[_0xfa39('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x5863d7?_0x5863d7[_0xfa39('0x27')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xfa39('0x12')](_0x335c34['monitor_format'])){_0x3ea429[util[_0xfa39('0x10')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x335c34[_0xfa39('0x21')];_0x3ea429[util[_0xfa39('0x10')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x4cdfb0;}if(_0x10b623&&_0x10b623[_0xfa39('0x28')]){for(var _0x135813 in _0x10b623[_0xfa39('0x28')]){if(_0x10b623[_0xfa39('0x28')][_0xfa39('0x29')](_0x135813)){if(!_[_0xfa39('0x15')](_0x10b623[_0xfa39('0x28')][_0x135813])&&_0x135813!=='id'&&_0x135813!==_0xfa39('0x2a')&&_0x135813!==_0xfa39('0x2b')&&_0x135813!=='updatedAt'){_0x3ea429[util[_0xfa39('0x10')]('%s%s','XMD-',_[_0xfa39('0x2c')](_0x135813))]=_0x10b623[_0xfa39('0x28')][_0x135813];}}}}return _0x3ea429;};exports[_0xfa39('0x2d')]=function(_0x4f37b3){var _0x31608f={};for(var _0x433b7e in _0x4f37b3){if(_0x4f37b3[_0xfa39('0x29')](_0x433b7e)){_0x31608f[util['format']('%s',_[_0xfa39('0x2e')](_0x433b7e))]=_0x4f37b3[_0x433b7e];}}return{'variables':_0x31608f};};exports[_0xfa39('0x2f')]=function(_0x3807fb,_0x51acb6){if(!_[_0xfa39('0x15')](_0x3807fb)){if(_0x3807fb[_0xfa39('0x29')](_0xfa39('0x30'))){if(_0x3807fb[_0xfa39('0x30')]>0x0){_0x3807fb[_0xfa39('0x30')]-=0x1;}else{logger[_0xfa39('0x8')](_0xfa39('0x31'),_0x51acb6);}}}else{logger[_0xfa39('0x8')](_0xfa39('0x32'),_0x51acb6);}};exports[_0xfa39('0x33')]=function(_0x1cf1a8){var _0x55236f=moment()[_0xfa39('0x10')](_0xfa39('0x34'));_0x1cf1a8[_0xfa39('0x35')]=0xd;_0x1cf1a8[_0xfa39('0x36')]='Blacklist';_0x1cf1a8[_0xfa39('0x37')]=_0x55236f;_0x1cf1a8[_0xfa39('0x38')]=_0x55236f;_0x1cf1a8['endtime']=_0x55236f;};exports[_0xfa39('0x39')]=function(_0x981dce,_0x17b760,_0x48615f){var _0x54aed5=moment()['format'](_0xfa39('0x34'));_0x981dce['state']=_0x17b760;_0x981dce[_0xfa39('0x36')]=_0x48615f;_0x981dce[_0xfa39('0x38')]=_0x54aed5;_0x981dce[_0xfa39('0x3a')]=getSeconds(_0x981dce['responsetime'],_0x981dce[_0xfa39('0x37')]);};exports[_0xfa39('0x3b')]=function(_0x308074,_0x133423,_0x169418){_0x308074[_0xfa39('0x3c')]=_0x133423;_0x308074[_0xfa39('0x3d')]=_0x169418;};exports['logCustomer']=function(_0x13e0da,_0x280842,_0x42db38){var _0x2e3805=moment()[_0xfa39('0x10')](_0xfa39('0x34'));_0x13e0da['state']=_0x280842;_0x13e0da[_0xfa39('0x36')]=_0x42db38;_0x13e0da['responsetime']=_0x13e0da[_0xfa39('0x38')]?_0x13e0da[_0xfa39('0x38')]:_0x2e3805;_0x13e0da[_0xfa39('0x3e')]=_0x13e0da[_0xfa39('0x3e')]?_0x13e0da['endtime']:_0x2e3805;_0x13e0da['ringtime']=getSeconds(_0x13e0da['responsetime']||0x0,_0x13e0da[_0xfa39('0x37')]||0x0);_0x13e0da['talktime']=_0x13e0da[_0xfa39('0x3f')]?getSeconds(_0x13e0da[_0xfa39('0x3e')],_0x13e0da[_0xfa39('0x3f')]):0x0;};exports[_0xfa39('0x40')]=function(_0x376d76){return _0x376d76===_0xfa39('0x41');};exports[_0xfa39('0x42')]=function(_0x13d5ff,_0x5cea81,_0x544d6c,_0xeb4876,_0x5a24f0){var _0x117e20=_0xeb4876?_0xfa39('0x43'):_0x13d5ff[_0xfa39('0x19')];_0x117e20=_0x5a24f0?_0xfa39('0x44'):_0x117e20;return{'actionid':_0x13d5ff[_0xfa39('0x45')],'action':_0xfa39('0x46'),'channel':_0x13d5ff[_0xfa39('0x47')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x117e20,_0x13d5ff[_0xfa39('0x1a')]),'Exten':_0xfa39('0x48'),'Context':_0xfa39('0x49'),'Priority':'1','variable':_0x544d6c,'timeout':(_0x5cea81[_0xfa39('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x13d5ff['uniqueid']};};exports[_0xfa39('0x4b')]=function(_0x481368){return _0x481368[_0xfa39('0x4c')]+_0x481368[_0xfa39('0x4d')]+_0x481368['countnoanswerretry']+_0x481368['countagentrejectretry']+_0x481368['countnosuchnumberretry'];};exports[_0xfa39('0x4e')]=function(_0x5c1f21){var _0x321435=_[_0xfa39('0x4f')](_0x5c1f21);_0x321435[_0xfa39('0x35')]=0xf;_0x321435[_0xfa39('0x36')]=_0xfa39('0x50');return _0x321435;};exports[_0xfa39('0x51')]=function(_0x45f545,_0x3ce019,_0x68a5a1){var _0xb77064={};_0xb77064[_0x3ce019]=_0x45f545[_0x3ce019];_0xb77064[_0xfa39('0x52')]=![];_0xb77064[_0xfa39('0x53')]=moment()['add'](_0x68a5a1,_0xfa39('0x54'))[_0xfa39('0x10')](_0xfa39('0x34'));_0xb77064[_0xfa39('0x1b')]=_0x45f545[_0xfa39('0x1b')];_0xb77064[_0xfa39('0x55')]=_0x45f545[_0xfa39('0x55')];_0xb77064[_0xfa39('0x1d')]=_0x45f545['VoiceQueueId']||undefined;return _0xb77064;};exports[_0xfa39('0x56')]=function(_0x53b8de,_0x3b586b){if(!_['isNil'](_0x53b8de)){if(_0x53b8de['pTalking']>0x0){_0x53b8de[_0xfa39('0x57')]-=0x1;}else{logger[_0xfa39('0x8')](_0x3b586b,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xfa39('0x8')](_0x3b586b,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x367825){if(_0x367825<=0x0){return!![];}return![];};exports[_0xfa39('0x58')]=function(_0x401e92,_0x4ea5a0,_0x213838){_0x401e92[_0xfa39('0x59')]=_0x4ea5a0;_0x401e92[_0xfa39('0x18')]=_0x401e92[_0xfa39('0x5a')];_0x401e92[_0xfa39('0x5b')]=_0x401e92[_0xfa39('0x47')];_0x401e92['motionChannel']='voice';if(_0x213838){_0x401e92[_0xfa39('0x5c')]=_0x213838[_0xfa39('0x5c')];}return _0x401e92;};exports[_0xfa39('0x5d')]=function(_0x550116){var _0x19d614={};_0x19d614[_0xfa39('0x5a')]=_0x550116[_0xfa39('0x5a')];_0x19d614[_0xfa39('0x5b')]=_0x550116['channelAgent'];_0x19d614[_0xfa39('0x45')]=_0x550116[_0xfa39('0x45')];return _0x19d614;};exports['agentReadyId']=function(_0x8ddefa){var _0x1fce3f=[];for(var _0x49e4a7 in _0x8ddefa){if(_0x8ddefa['hasOwnProperty'](_0x49e4a7)){if(!_[_0xfa39('0x15')](_0x8ddefa[_0x49e4a7])&&_0x8ddefa[_0x49e4a7][_0xfa39('0x35')]===_0xfa39('0x5e')&&_0x8ddefa[_0x49e4a7][_0xfa39('0x5f')]===_0xfa39('0x60')){_0x1fce3f[_0xfa39('0x61')](_0x8ddefa[_0x49e4a7]['id']);}}}return _0x1fce3f;};exports[_0xfa39('0x62')]=function(_0x57ef8c){var _0x1c0e19=moment()[_0xfa39('0x5')](0x0);var _0x12e5d4=moment(_0x57ef8c)[_0xfa39('0x5')](0x0);return _0x1c0e19[_0xfa39('0x6')](_0x12e5d4,_0xfa39('0x63'));};exports[_0xfa39('0x64')]=function(_0x478b18){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x478b18[_0xfa39('0x1b')],'ListId':_0x478b18[_0xfa39('0x55')],'VoiceQueueId':_0x478b18['VoiceQueueId']||undefined,'CampaignId':_0x478b18[_0xfa39('0x65')]||undefined};};exports[_0xfa39('0x66')]=function(_0x45a963){if(_0x45a963===_0xfa39('0x45')||_0x45a963===_0xfa39('0x67')||_0x45a963===_0xfa39('0x5a')||_0x45a963==='type'||_0x45a963===_0xfa39('0x68')||_0x45a963===_0xfa39('0x69')||_0x45a963===_0xfa39('0x3c')||_0x45a963==='channelAgent'||_0x45a963===_0xfa39('0x19')||_0x45a963===_0xfa39('0x52')||_0x45a963==='calleridnum'||_0x45a963===_0xfa39('0x53')||_0x45a963==='countbusyretry'||_0x45a963===_0xfa39('0x4d')||_0x45a963===_0xfa39('0x6a')||_0x45a963===_0xfa39('0x6b')||_0x45a963===_0xfa39('0x6c')||_0x45a963===_0xfa39('0x6d')||_0x45a963==='callbackat'||_0x45a963===_0xfa39('0x6e')||_0x45a963===_0xfa39('0x1b')||_0x45a963===_0xfa39('0x55')||_0x45a963===_0xfa39('0x3d')||_0x45a963===_0xfa39('0x1d')||_0x45a963===_0xfa39('0x6f')||_0x45a963==='xmd-voicequeueid'||_0x45a963==='xmd-queue'||_0x45a963===_0xfa39('0x70')||_0x45a963===_0xfa39('0x71')||_0x45a963===_0xfa39('0x72')||_0x45a963===_0xfa39('0x73')||_0x45a963===_0xfa39('0x74')||_0x45a963===_0xfa39('0x75')||_0x45a963===_0xfa39('0x76')||_0x45a963==='xmd-contactid'||_0x45a963===_0xfa39('0x77')||_0x45a963===_0xfa39('0x78')||_0x45a963===_0xfa39('0x79')||_0x45a963==='xmd-agi'||_0x45a963===_0xfa39('0x7a')||_0x45a963===_0xfa39('0x7b')||_0x45a963===_0xfa39('0x7c')||_0x45a963===_0xfa39('0x7d')||_0x45a963===_0xfa39('0x7e')||_0x45a963==='rtpaudioqoslossbridged'||_0x45a963===_0xfa39('0x7f')||_0x45a963==='rtpaudioqosrttbridged'||_0x45a963===_0xfa39('0x7a')||_0x45a963===_0xfa39('0x7b')||_0x45a963===_0xfa39('0x7c')||_0x45a963===_0xfa39('0x7d')||_0x45a963===_0xfa39('0x7e')||_0x45a963===_0xfa39('0x80')||_0x45a963===_0xfa39('0x7f')||_0x45a963==='rtpaudioqosrttbridged'||_0x45a963===_0xfa39('0x81')||_0x45a963===_0xfa39('0x82')||_0x45a963==='state'||_0x45a963==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x90c689,_0x377865){var _0x83f5ef,_0x340436,_0x20554a;if(_0x377865<=0x0){_0x377865=0x1;}_0x83f5ef=new RegExp('\x5cw{0,'+_0x377865+'}$');_0x340436=Math['pow'](0xa,_0x377865-0x1);_0x20554a=Math[_0xfa39('0x83')](0xa,_0x377865)-0x1;return util[_0xfa39('0x10')]('%s',_[_0xfa39('0x84')](_0x90c689,_0x83f5ef,_[_0xfa39('0x85')](_0x340436,_0x20554a)));};exports[_0xfa39('0x86')]=function(_0x91b195){var _0xe13b5d=_0x91b195[_0xfa39('0x87')](/"(.*?)"/);return _0xe13b5d?_0xe13b5d[0x1]:_0x91b195;};exports['extractCalleridNumber']=function(_0x16d433){var _0x4ef048=_0x16d433['match'](/<(.*?)>/);return _0x4ef048?_0x4ef048[0x1]:_0x16d433;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index dd23ba0..c0190dd 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 _0x7b3d=['boolean','queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','number'];(function(_0x493720,_0x2e7724){var _0x3cfc8e=function(_0x1ceb74){while(--_0x1ceb74){_0x493720['push'](_0x493720['shift']());}};_0x3cfc8e(++_0x2e7724);}(_0x7b3d,0x135));var _0xd7b3=function(_0x1e0b32,_0x33bf0e){_0x1e0b32=_0x1e0b32-0x0;var _0x880682=_0x7b3d[_0x1e0b32];return _0x880682;};'use strict';exports[_0xd7b3('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xd7b3('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xd7b3('0x2'),'required':![]},'paused':{'type':_0xd7b3('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0xd7b3('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xd7b3('0x4')]={'interface':{'type':_0xd7b3('0x1'),'required':!![]},'paused':{'type':_0xd7b3('0x3')},'reason':{'type':_0xd7b3('0x1'),'required':![]}};exports['reload']={'module':{'type':_0xd7b3('0x1'),'required':![]}};exports[_0xd7b3('0x5')]={'uniqueid':{'type':_0xd7b3('0x1'),'required':!![]}};exports[_0xd7b3('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0xd7b3('0x1')},'mixmonitorid':{'type':_0xd7b3('0x1')}};exports[_0xd7b3('0x7')]={'uniqueid':{'type':_0xd7b3('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xd7b3('0x1'),'required':!![]},'exten':{'type':_0xd7b3('0x1'),'required':!![]},'context':{'type':_0xd7b3('0x1')}}; \ No newline at end of file +var _0x5b9e=['queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean'];(function(_0x5928fb,_0x283806){var _0x4d2415=function(_0x4a5af9){while(--_0x4a5af9){_0x5928fb['push'](_0x5928fb['shift']());}};_0x4d2415(++_0x283806);}(_0x5b9e,0x1aa));var _0xe5b9=function(_0x4507e4,_0x190c4b){_0x4507e4=_0x4507e4-0x0;var _0x3faa47=_0x5b9e[_0x4507e4];return _0x3faa47;};'use strict';exports[_0xe5b9('0x0')]={'queue':{'type':_0xe5b9('0x1'),'required':!![]},'interface':{'type':_0xe5b9('0x1'),'required':!![]},'membername':{'type':_0xe5b9('0x1'),'required':!![]},'penalty':{'type':_0xe5b9('0x2'),'required':![]},'paused':{'type':_0xe5b9('0x3'),'required':![]}};exports[_0xe5b9('0x4')]={'queue':{'type':_0xe5b9('0x1'),'required':!![]},'interface':{'type':_0xe5b9('0x1'),'required':!![]}};exports[_0xe5b9('0x5')]={'interface':{'type':_0xe5b9('0x1'),'required':!![]},'paused':{'type':_0xe5b9('0x3')},'reason':{'type':_0xe5b9('0x1'),'required':![]}};exports[_0xe5b9('0x6')]={'module':{'type':'string','required':![]}};exports[_0xe5b9('0x7')]={'uniqueid':{'type':_0xe5b9('0x1'),'required':!![]}};exports[_0xe5b9('0x8')]={'uniqueid':{'type':_0xe5b9('0x1'),'required':!![]},'filename':{'type':_0xe5b9('0x1')},'format':{'type':_0xe5b9('0x1')},'mixmonitorid':{'type':_0xe5b9('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xe5b9('0x1'),'required':!![]}};exports[_0xe5b9('0x9')]={'uniqueid':{'type':_0xe5b9('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xe5b9('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 2dce7b0..d9836e3 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 _0x34ab=['agents','mergeFromDatabase','initTelephones','initTrunks','initVoiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','freshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','outbound','disposition','ANSWERED','duration','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','format','SIP/%s','hasOwnProperty','isNil','interface','total','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','length','name','isUndefined'];(function(_0x2f4b36,_0x4d6d72){var _0x39cd5f=function(_0x47a1d7){while(--_0x47a1d7){_0x2f4b36['push'](_0x2f4b36['shift']());}};_0x39cd5f(++_0x4d6d72);}(_0x34ab,0x10d));var _0xb34a=function(_0x1b92a6,_0x14444b){_0x1b92a6=_0x1b92a6-0x0;var _0x24be5b=_0x34ab[_0x1b92a6];return _0x24be5b;};'use strict';var BPromise=require(_0xb34a('0x0'));var util=require(_0xb34a('0x1'));var _=require('lodash');var moment=require(_0xb34a('0x2'));var Agent=require(_0xb34a('0x3'));var Telephone=require(_0xb34a('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xb34a('0x5'));var Trigger=require(_0xb34a('0x6'));var Template=require('../model/template');var Campaign=require(_0xb34a('0x7'));var VoiceExtension=require(_0xb34a('0x8'));var ZendeskAccount=require(_0xb34a('0x9'));var SalesforceAccount=require(_0xb34a('0xa'));var FreshdeskAccount=require(_0xb34a('0xb'));var SugarcrmAccount=require(_0xb34a('0xc'));var ZohoAccount=require(_0xb34a('0xd'));var DeskAccount=require(_0xb34a('0xe'));var VtigerAccount=require(_0xb34a('0xf'));var ServicenowAccount=require(_0xb34a('0x10'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xb34a('0x11'));var Realtime=function(){this['agents']={};this[_0xb34a('0x12')]={};this[_0xb34a('0x13')]={};this[_0xb34a('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xb34a('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xb34a('0x16')]={};this[_0xb34a('0x17')]={};this[_0xb34a('0x18')]={};this[_0xb34a('0x19')]={};this[_0xb34a('0x1a')]={};this[_0xb34a('0x1b')]={};this[_0xb34a('0x1c')]={};this[_0xb34a('0x1d')]={};this['sugarcrmAccounts']={};this[_0xb34a('0x1e')]={};this[_0xb34a('0x1f')]={};this['deskAccounts']={};this[_0xb34a('0x20')]={};this['servicenowAccounts']={};this[_0xb34a('0x21')]={};this['freshsalesAccounts']={};this[_0xb34a('0x22')]={};};function freeIsNotKey(_0x383a28,_0x610a35,_0x465533){var _0x4187d4=_[_0xb34a('0x23')](_0x383a28,function(_0x460187,_0x36b271){return _0x460187[_0x465533];});for(var _0x290a8f in _0x610a35){if(_0x610a35['hasOwnProperty'](_0x290a8f)){if(!_0x4187d4[_0x290a8f]){delete _0x610a35[_0x290a8f];}}}}function freeIsNotKeySip(_0x38db8a,_0x247f27){var _0xbc1317=_[_0xb34a('0x23')](_0x38db8a,function(_0x3fb674,_0x6ca6da){return util[_0xb34a('0x24')](_0xb34a('0x25'),_0x3fb674['name']);});for(var _0x5632ed in _0x247f27){if(_0x247f27[_0xb34a('0x26')](_0x5632ed)){if(!_0xbc1317[_0x5632ed]){delete _0x247f27[_0x5632ed];}}}}function freeIsNotKeyAgent(_0x116da7,_0x1e760e){var _0x4bdfa7=_[_0xb34a('0x23')](_0x116da7,function(_0x3172d3,_0x1723c3){var _0x3d2f57=_[_0xb34a('0x27')](_0x3172d3[_0xb34a('0x28')])?util[_0xb34a('0x24')]('SIP/%s',_0x3172d3['name']):_0x3172d3['interface'];return _0x3d2f57;});for(var _0x3b7839 in _0x1e760e){if(_0x1e760e[_0xb34a('0x26')](_0x3b7839)){if(!_0x4bdfa7[_0x3b7839]){delete _0x1e760e[_0x3b7839];}}}}function clearVoiceCallReports(_0x47adb2){_0x47adb2[_0xb34a('0x29')]=0x0;_0x47adb2[_0xb34a('0x2a')]=0x0;_0x47adb2['sumHoldTime']=0x0;_0x47adb2[_0xb34a('0x2b')]=0x0;_0x47adb2[_0xb34a('0x2c')]=0x0;}function clearCampaigns(_0x244848){if(!_[_0xb34a('0x2d')](_0x244848)){for(var _0x171a71 in _0x244848){if(_0x244848[_0xb34a('0x26')](_0x171a71)){_0x244848[_0x171a71][_0xb34a('0x2e')]=0x0;_0x244848[_0x171a71][_0xb34a('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x128c5c){if(!_[_0xb34a('0x2d')](_0x128c5c)){for(var _0x28dcb7 in _0x128c5c){if(_0x128c5c[_0xb34a('0x26')](_0x28dcb7)){_0x128c5c[_0x28dcb7][_0xb34a('0x29')]=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x2a')]=0x0;_0x128c5c[_0x28dcb7]['unmanaged']=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x30')]=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x31')]=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x2b')]=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x2c')]=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x32')]=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x33')]=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x34')]=0x0;_0x128c5c[_0x28dcb7]['outboundCongestionCallsDay']=0x0;_0x128c5c[_0x28dcb7]['outboundNoSuchCallsDay']=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x35')]=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x36')]=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x37')]=0x0;_0x128c5c[_0x28dcb7]['outboundBlacklistCallsDay']=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x38')]=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x39')]=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x3a')]=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x32')]=0x0;_0x128c5c[_0x28dcb7][_0xb34a('0x3b')]=0x0;_0x128c5c[_0x28dcb7]['queueStatusComplete']=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x1c0dfe,_0x3fdba8){for(var _0x5e89df in _0x3fdba8){if(_0x1c0dfe[_0xb34a('0x26')](_0x5e89df)){_0x1c0dfe[_0x5e89df]=_0x3fdba8[_0x5e89df];}}};Realtime[_0xb34a('0x3c')]['initAgents']=function(){var _0x5ccb1a=this;return function(_0x391358){if(_0x391358){freeIsNotKeyAgent(_0x391358,_0x5ccb1a['agents']);for(var _0x5de64f=0x0,_0x369f7d={},_0x22b597={};_0x5de64f<_0x391358[_0xb34a('0x3d')];_0x5de64f+=0x1){_0x369f7d=_0x391358[_0x5de64f];var _0x215122=_['isNil'](_0x369f7d['interface'])?util[_0xb34a('0x24')](_0xb34a('0x25'),_0x369f7d[_0xb34a('0x3e')]):_0x369f7d[_0xb34a('0x28')];if(_[_0xb34a('0x3f')](_0x5ccb1a[_0xb34a('0x40')][_0x215122])){_0x5ccb1a[_0xb34a('0x40')][_0x215122]=new Agent(_0x369f7d);}else{_0x5ccb1a[_0xb34a('0x41')](_0x5ccb1a[_0xb34a('0x40')][_0x215122],_0x369f7d);}}}return _0x5ccb1a[_0xb34a('0x40')];};};Realtime[_0xb34a('0x3c')][_0xb34a('0x42')]=function(){var _0x489730=this;return function(_0x9c76f){if(_0x9c76f){freeIsNotKeySip(_0x9c76f,_0x489730[_0xb34a('0x12')]);for(var _0x232058=0x0,_0x378f30={},_0x17c194={};_0x232058<_0x9c76f[_0xb34a('0x3d')];_0x232058+=0x1){_0x378f30=_0x9c76f[_0x232058];if(_[_0xb34a('0x3f')](_0x489730[_0xb34a('0x12')][util[_0xb34a('0x24')](_0xb34a('0x25'),_0x378f30[_0xb34a('0x3e')])])){_0x489730[_0xb34a('0x12')][util[_0xb34a('0x24')]('SIP/%s',_0x378f30['name'])]=new Telephone(_0x378f30);}else{_0x489730['mergeFromDatabase'](_0x489730['telephones'][util[_0xb34a('0x24')](_0xb34a('0x25'),_0x378f30['name'])],_0x378f30);}}}return _0x489730[_0xb34a('0x12')];};};Realtime['prototype'][_0xb34a('0x43')]=function(){var _0x38db85=this;return function(_0x1800ba){if(_0x1800ba){freeIsNotKeySip(_0x1800ba,_0x38db85['trunks']);for(var _0x48554b=0x0,_0x26c65c={},_0x551459={};_0x48554b<_0x1800ba['length'];_0x48554b+=0x1){_0x26c65c=_0x1800ba[_0x48554b];if(_[_0xb34a('0x3f')](_0x38db85[_0xb34a('0x13')][util[_0xb34a('0x24')]('SIP/%s',_0x26c65c['name'])])){_0x38db85[_0xb34a('0x13')][util[_0xb34a('0x24')](_0xb34a('0x25'),_0x26c65c[_0xb34a('0x3e')])]=new Trunk(_0x26c65c);}else{_0x38db85[_0xb34a('0x41')](_0x38db85[_0xb34a('0x13')][util[_0xb34a('0x24')](_0xb34a('0x25'),_0x26c65c[_0xb34a('0x3e')])],_0x26c65c);}}}return _0x38db85[_0xb34a('0x13')];};};Realtime[_0xb34a('0x3c')][_0xb34a('0x44')]=function(){var _0x3c5d90=this;return function(_0x1ee2af){if(_0x1ee2af){freeIsNotKey(_0x1ee2af,_0x3c5d90['voiceQueues'],_0xb34a('0x3e'));for(var _0x481438=0x0,_0x2f5e61={},_0x50b184={};_0x481438<_0x1ee2af[_0xb34a('0x3d')];_0x481438+=0x1){_0x2f5e61=_0x1ee2af[_0x481438];if(_['isUndefined'](_0x3c5d90['voiceQueues'][_0x2f5e61[_0xb34a('0x3e')]])){_0x3c5d90['voiceQueues'][_0x2f5e61[_0xb34a('0x3e')]]=new VoiceQueue(_0x2f5e61);}else{_0x3c5d90[_0xb34a('0x41')](_0x3c5d90[_0xb34a('0x14')][_0x2f5e61[_0xb34a('0x3e')]],_0x2f5e61);}}}return _0x3c5d90[_0xb34a('0x14')];};};Realtime[_0xb34a('0x3c')][_0xb34a('0x45')]=function(){var _0x56c563=this;return function(_0x50f110){if(_0x50f110){freeIsNotKey(_0x50f110,_0x56c563[_0xb34a('0x46')],'id');for(var _0x5d4b63=0x0,_0x918230={},_0xa5e847={};_0x5d4b63<_0x50f110[_0xb34a('0x3d')];_0x5d4b63+=0x1){_0x918230=_0x50f110[_0x5d4b63];if(_[_0xb34a('0x3f')](_0x56c563['triggers'][_0x918230['id']])){_0x56c563[_0xb34a('0x46')][_0x918230['id']]=new Trigger(_0x918230);}else{_0x56c563[_0xb34a('0x41')](_0x56c563['triggers'][_0x918230['id']],_0x918230);}}}return _0x56c563[_0xb34a('0x46')];};};Realtime[_0xb34a('0x3c')][_0xb34a('0x47')]=function(){var _0x407ad9=this;return function(_0x27e467){if(_0x27e467){freeIsNotKey(_0x27e467,_0x407ad9[_0xb34a('0x15')],'id');for(var _0x1a38f9=0x0,_0x5a0d2c={},_0x5d84cb={};_0x1a38f9<_0x27e467[_0xb34a('0x3d')];_0x1a38f9+=0x1){_0x5a0d2c=_0x27e467[_0x1a38f9];if(_[_0xb34a('0x3f')](_0x407ad9['templates'][_0x5a0d2c['id']])){_0x407ad9[_0xb34a('0x15')][_0x5a0d2c['id']]=new Template(_0x5a0d2c);}else{_0x407ad9[_0xb34a('0x41')](_0x407ad9[_0xb34a('0x15')][_0x5a0d2c['id']],_0x5a0d2c);}}}return _0x407ad9[_0xb34a('0x15')];};};Realtime['prototype'][_0xb34a('0x48')]=function(){var _0x81ba42=this;return function(_0x52bbcd){if(_0x52bbcd){freeIsNotKey(_0x52bbcd,_0x81ba42[_0xb34a('0x1c')],'id');for(var _0x1300ca=0x0,_0x445641={},_0x3e6bdf={};_0x1300ca<_0x52bbcd[_0xb34a('0x3d')];_0x1300ca+=0x1){_0x445641=_0x52bbcd[_0x1300ca];if(_['isUndefined'](_0x81ba42[_0xb34a('0x1c')][_0x445641['id']])){_0x81ba42[_0xb34a('0x1c')][_0x445641['id']]=new ZendeskAccount(_0x445641);}else{_0x81ba42[_0xb34a('0x41')](_0x81ba42[_0xb34a('0x1c')][_0x445641['id']],_0x445641);}}}return _0x81ba42['zendeskAccounts'];};};Realtime[_0xb34a('0x3c')][_0xb34a('0x49')]=function(){var _0x300792=this;return function(_0xa35914){if(_0xa35914){freeIsNotKey(_0xa35914,_0x300792['salesforceAccounts'],'id');for(var _0x5486b4=0x0,_0x5cc0e8={},_0x584624={};_0x5486b4<_0xa35914[_0xb34a('0x3d')];_0x5486b4+=0x1){_0x5cc0e8=_0xa35914[_0x5486b4];if(_[_0xb34a('0x3f')](_0x300792[_0xb34a('0x1d')][_0x5cc0e8['id']])){_0x300792[_0xb34a('0x1d')][_0x5cc0e8['id']]=new SalesforceAccount(_0x5cc0e8);}else{_0x300792[_0xb34a('0x41')](_0x300792['salesforceAccounts'][_0x5cc0e8['id']],_0x5cc0e8);}}}return _0x300792[_0xb34a('0x1d')];};};Realtime[_0xb34a('0x3c')][_0xb34a('0x4a')]=function(){var _0x399ea7=this;return function(_0x39df3b){if(_0x39df3b){freeIsNotKey(_0x39df3b,_0x399ea7[_0xb34a('0x1e')],'id');for(var _0x1561c1=0x0,_0x227022={},_0x42d34b={};_0x1561c1<_0x39df3b[_0xb34a('0x3d')];_0x1561c1+=0x1){_0x227022=_0x39df3b[_0x1561c1];if(_['isUndefined'](_0x399ea7[_0xb34a('0x1e')][_0x227022['id']])){_0x399ea7[_0xb34a('0x1e')][_0x227022['id']]=new FreshdeskAccount(_0x227022);}else{_0x399ea7[_0xb34a('0x41')](_0x399ea7['freshdeskAccounts'][_0x227022['id']],_0x227022);}}}return _0x399ea7[_0xb34a('0x1e')];};};Realtime[_0xb34a('0x3c')][_0xb34a('0x4b')]=function(){var _0x42ac46=this;return function(_0x471fdc){if(_0x471fdc){freeIsNotKey(_0x471fdc,_0x42ac46[_0xb34a('0x1f')],'id');for(var _0x109ea1=0x0,_0x3aeeba={},_0x16b6de={};_0x109ea1<_0x471fdc[_0xb34a('0x3d')];_0x109ea1+=0x1){_0x3aeeba=_0x471fdc[_0x109ea1];if(_['isUndefined'](_0x42ac46[_0xb34a('0x1f')][_0x3aeeba['id']])){_0x42ac46[_0xb34a('0x1f')][_0x3aeeba['id']]=new ZohoAccount(_0x3aeeba);}else{_0x42ac46[_0xb34a('0x41')](_0x42ac46['zohoAccounts'][_0x3aeeba['id']],_0x3aeeba);}}}return _0x42ac46[_0xb34a('0x1f')];};};Realtime[_0xb34a('0x3c')][_0xb34a('0x4c')]=function(){var _0x5744f8=this;return function(_0x34264e){if(_0x34264e){freeIsNotKey(_0x34264e,_0x5744f8[_0xb34a('0x4d')],'id');for(var _0x55f0ae=0x0,_0x1e373f={},_0x45f7d0={};_0x55f0ae<_0x34264e[_0xb34a('0x3d')];_0x55f0ae+=0x1){_0x1e373f=_0x34264e[_0x55f0ae];if(_[_0xb34a('0x3f')](_0x5744f8[_0xb34a('0x4d')][_0x1e373f['id']])){_0x5744f8['deskAccounts'][_0x1e373f['id']]=new DeskAccount(_0x1e373f);}else{_0x5744f8[_0xb34a('0x41')](_0x5744f8[_0xb34a('0x4d')][_0x1e373f['id']],_0x1e373f);}}}return _0x5744f8[_0xb34a('0x4d')];};};Realtime[_0xb34a('0x3c')]['initSugarcrmAccounts']=function(){var _0x1a59ff=this;return function(_0x339acf){if(_0x339acf){freeIsNotKey(_0x339acf,_0x1a59ff[_0xb34a('0x4e')],'id');for(var _0x5d3244=0x0,_0x196727={},_0x15500e={};_0x5d3244<_0x339acf[_0xb34a('0x3d')];_0x5d3244+=0x1){_0x196727=_0x339acf[_0x5d3244];if(_[_0xb34a('0x3f')](_0x1a59ff[_0xb34a('0x4e')][_0x196727['id']])){_0x1a59ff[_0xb34a('0x4e')][_0x196727['id']]=new SugarcrmAccount(_0x196727);}else{_0x1a59ff[_0xb34a('0x41')](_0x1a59ff['sugarcrmAccounts'][_0x196727['id']],_0x196727);}}}return _0x1a59ff['sugarcrmAccounts'];};};Realtime[_0xb34a('0x3c')][_0xb34a('0x4f')]=function(){var _0x3bfbcd=this;return function(_0x1146e9){if(_0x1146e9){freeIsNotKey(_0x1146e9,_0x3bfbcd[_0xb34a('0x20')],'id');for(var _0x41e722=0x0,_0x2272d8={},_0x38a701={};_0x41e722<_0x1146e9[_0xb34a('0x3d')];_0x41e722+=0x1){_0x2272d8=_0x1146e9[_0x41e722];if(_[_0xb34a('0x3f')](_0x3bfbcd[_0xb34a('0x20')][_0x2272d8['id']])){_0x3bfbcd['vtigerAccounts'][_0x2272d8['id']]=new VtigerAccount(_0x2272d8);}else{_0x3bfbcd[_0xb34a('0x41')](_0x3bfbcd[_0xb34a('0x20')][_0x2272d8['id']],_0x2272d8);}}}return _0x3bfbcd[_0xb34a('0x20')];};};Realtime[_0xb34a('0x3c')][_0xb34a('0x50')]=function(){var _0x5df5fb=this;return function(_0x46b235){if(_0x46b235){freeIsNotKey(_0x46b235,_0x5df5fb['servicenowAccounts'],'id');for(var _0x38f5cb=0x0,_0x1081c2={},_0x5c4b0c={};_0x38f5cb<_0x46b235[_0xb34a('0x3d')];_0x38f5cb+=0x1){_0x1081c2=_0x46b235[_0x38f5cb];if(_[_0xb34a('0x3f')](_0x5df5fb['servicenowAccounts'][_0x1081c2['id']])){_0x5df5fb[_0xb34a('0x51')][_0x1081c2['id']]=new ServicenowAccount(_0x1081c2);}else{_0x5df5fb[_0xb34a('0x41')](_0x5df5fb['servicenowAccounts'][_0x1081c2['id']],_0x1081c2);}}}return _0x5df5fb[_0xb34a('0x51')];};};Realtime[_0xb34a('0x3c')][_0xb34a('0x52')]=function(){var _0x15af33=this;return function(_0x10422f){if(_0x10422f){freeIsNotKey(_0x10422f,_0x15af33[_0xb34a('0x21')],'id');for(var _0xc1a735=0x0,_0x2867d={},_0x484032={};_0xc1a735<_0x10422f['length'];_0xc1a735+=0x1){_0x2867d=_0x10422f[_0xc1a735];if(_[_0xb34a('0x3f')](_0x15af33[_0xb34a('0x21')][_0x2867d['id']])){_0x15af33['dynamics365Accounts'][_0x2867d['id']]=new Dynamics365Account(_0x2867d);}else{_0x15af33[_0xb34a('0x41')](_0x15af33['dynamics365Accounts'][_0x2867d['id']],_0x2867d);}}}return _0x15af33[_0xb34a('0x21')];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x12ec01=this;return function(_0x1c8581){if(_0x1c8581){freeIsNotKey(_0x1c8581,_0x12ec01[_0xb34a('0x53')],'id');for(var _0x2cfeba=0x0,_0x2abc45={},_0xe2393e={};_0x2cfeba<_0x1c8581[_0xb34a('0x3d')];_0x2cfeba+=0x1){_0x2abc45=_0x1c8581[_0x2cfeba];if(_[_0xb34a('0x3f')](_0x12ec01[_0xb34a('0x53')][_0x2abc45['id']])){_0x12ec01['freshsalesAccounts'][_0x2abc45['id']]=new FreshsalesAccount(_0x2abc45);}else{_0x12ec01[_0xb34a('0x41')](_0x12ec01['freshsalesAccounts'][_0x2abc45['id']],_0x2abc45);}}}return _0x12ec01[_0xb34a('0x53')];};};Realtime['prototype'][_0xb34a('0x54')]=function(){var _0x18da84=this;return function(_0x56b1ef){for(var _0x17e25c=0x0;_0x17e25c<_0x56b1ef[_0xb34a('0x3d')];_0x17e25c+=0x1){_['merge'](_0x18da84['voiceQueues'][_0x56b1ef[_0x17e25c]['name']],_0x56b1ef[_0x17e25c]);}return _0x18da84['voiceQueues'];};};Realtime[_0xb34a('0x3c')][_0xb34a('0x55')]=function(){var _0x5193c6=this;return function(_0x39cc17){clearVoiceQueues(_0x5193c6[_0xb34a('0x14')]);if(_0x39cc17){_0x39cc17=_[_0xb34a('0x56')](_0x39cc17,_0xb34a('0x57'));for(var _0x1c4f88 in _0x39cc17){if(_0x39cc17[_0xb34a('0x26')](_0x1c4f88)){var _0x30c03d={};for(var _0x19151c=0x0;_0x19151c<_0x39cc17[_0x1c4f88][_0xb34a('0x3d')];_0x19151c+=0x1){var _0x3a99a0=_0x39cc17[_0x1c4f88][_0x19151c][_0xb34a('0x58')];if(_0x5193c6['voiceQueues'][_0x3a99a0]){if(_0x39cc17[_0x1c4f88][_0x19151c][_0xb34a('0x59')]){_0x5193c6[_0xb34a('0x14')][_0x3a99a0][_0xb34a('0x5a')]+=0x1;}if(_0x39cc17[_0x1c4f88][_0x19151c][_0xb34a('0x5b')]){_0x5193c6[_0xb34a('0x14')][_0x3a99a0][_0xb34a('0x30')]+=0x1;}_0x5193c6['voiceQueues'][_0x3a99a0][_0xb34a('0x31')]+=moment(_0x39cc17[_0x1c4f88][_0x19151c][_0xb34a('0x5c')])[_0xb34a('0x5d')](moment(_0x39cc17[_0x1c4f88][_0x19151c][_0xb34a('0x5e')]),_0xb34a('0x5f'))||0x0;if(_0x19151c===_0x39cc17[_0x1c4f88][_0xb34a('0x3d')]-0x1){_0x5193c6[_0xb34a('0x14')][_0x3a99a0][_0xb34a('0x2b')]+=moment(_0x39cc17[_0x1c4f88][_0x19151c]['queuecallercompleteAt']||_0x39cc17[_0x1c4f88][_0x19151c][_0xb34a('0x60')]||_0x39cc17[_0x1c4f88][_0x19151c][_0xb34a('0x61')])[_0xb34a('0x5d')](moment(_0x39cc17[_0x1c4f88][_0x19151c][_0xb34a('0x5e')]),_0xb34a('0x5f'))||0x0;_0x5193c6[_0xb34a('0x14')][_0x3a99a0][_0xb34a('0x29')]+=0x1;if(_0x39cc17[_0x1c4f88][_0x19151c][_0xb34a('0x62')]){_0x5193c6['voiceQueues'][_0x3a99a0][_0xb34a('0x2a')]+=0x1;_0x5193c6[_0xb34a('0x14')][_0x3a99a0][_0xb34a('0x2c')]+=moment(_0x39cc17[_0x1c4f88][_0x19151c]['queuecallercompleteAt'])[_0xb34a('0x5d')](moment(_0x39cc17[_0x1c4f88][_0x19151c][_0xb34a('0x5c')]),_0xb34a('0x5f'))||0x0;}}else{_0x5193c6[_0xb34a('0x14')][_0x3a99a0][_0xb34a('0x2b')]+=_0x5193c6[_0xb34a('0x14')][_0x3a99a0]['sumHoldTime']||0x0;}}}}}}return _0x5193c6[_0xb34a('0x14')];};};Realtime[_0xb34a('0x3c')]['initVoiceCallReports']=function(){var _0x5521e1=this;return function(_0x15d7e5){clearVoiceCallReports(_0x5521e1['outbound']);if(_0x15d7e5){for(var _0x1b23ba=0x0;_0x1b23ba<_0x15d7e5[_0xb34a('0x3d')];_0x1b23ba+=0x1){_0x5521e1[_0xb34a('0x63')][_0xb34a('0x29')]+=0x1;_0x5521e1[_0xb34a('0x63')][_0xb34a('0x2b')]+=_0x15d7e5[_0x1b23ba]['duration'];if(_0x15d7e5[_0x1b23ba][_0xb34a('0x64')]===_0xb34a('0x65')){_0x5521e1[_0xb34a('0x63')][_0xb34a('0x2a')]+=0x1;_0x5521e1[_0xb34a('0x63')]['sumHoldTime']+=_0x15d7e5[_0x1b23ba][_0xb34a('0x66')]-_0x15d7e5[_0x1b23ba][_0xb34a('0x67')]||0x0;_0x5521e1['outbound'][_0xb34a('0x2c')]+=_0x15d7e5[_0x1b23ba][_0xb34a('0x67')];}}}return _0x5521e1[_0xb34a('0x63')];};};Realtime[_0xb34a('0x3c')]['initCampaigns']=function(){var _0x80b5b3=this;return function(_0x30b02e){if(_0x30b02e){freeIsNotKey(_0x30b02e,_0x80b5b3[_0xb34a('0x68')],_0xb34a('0x3e'));for(var _0x28c079=0x0,_0x34eefa={};_0x28c079<_0x30b02e[_0xb34a('0x3d')];_0x28c079+=0x1){_0x34eefa=_0x30b02e[_0x28c079];if(_['isUndefined'](_0x80b5b3['campaigns'][_0x34eefa['name']])){_0x80b5b3[_0xb34a('0x68')][_0x34eefa[_0xb34a('0x3e')]]=new Campaign(_0x34eefa);}else{_0x80b5b3[_0xb34a('0x41')](_0x80b5b3[_0xb34a('0x68')][_0x34eefa[_0xb34a('0x3e')]],_0x34eefa);_0x80b5b3[_0xb34a('0x68')][_0x34eefa[_0xb34a('0x3e')]][_0xb34a('0x69')]=_0x34eefa[_0xb34a('0x6a')]?_0x34eefa[_0xb34a('0x6a')][_0xb34a('0x3e')]:undefined;}}}return _0x80b5b3[_0xb34a('0x68')];};};Realtime[_0xb34a('0x3c')][_0xb34a('0x6b')]=function(){var _0x35837b=this;return function(_0x565dc2){if(_0x565dc2){freeIsNotKey(_0x565dc2,_0x35837b[_0xb34a('0x16')],'id');for(var _0x5acd61=0x0,_0x24f81b={};_0x5acd61<_0x565dc2[_0xb34a('0x3d')];_0x5acd61+=0x1){_0x24f81b=_0x565dc2[_0x5acd61];if(_[_0xb34a('0x3f')](_0x35837b[_0xb34a('0x16')][_0x24f81b['id']])){_0x35837b['voiceExtensions'][_0x24f81b['id']]=new VoiceExtension(_0x24f81b);}else{_0x35837b[_0xb34a('0x41')](_0x35837b[_0xb34a('0x16')][_0x24f81b['id']],_0x24f81b);}}}return _0x35837b['voiceExtensions'];};};Realtime['prototype'][_0xb34a('0x6c')]=function(){var _0x8e6bf0=this;return function(_0x478a09){clearCampaigns(_0x8e6bf0[_0xb34a('0x68')]);for(var _0x2ca2cf=0x0;_0x2ca2cf<_0x478a09['length'];_0x2ca2cf+=0x1){_['merge'](_0x8e6bf0['campaigns'][_0x478a09[_0x2ca2cf][_0xb34a('0x3e')]],_0x478a09[_0x2ca2cf]);}return _0x8e6bf0[_0xb34a('0x68')];};};Realtime[_0xb34a('0x3c')][_0xb34a('0x6d')]=function(){var _0xa9640c=this;return function(_0xc16eed){if(_0xc16eed){freeIsNotKey(_0xc16eed,_0xa9640c[_0xb34a('0x22')],'id');for(var _0x126d77=0x0,_0x4d35ca={},_0x550450={};_0x126d77<_0xc16eed[_0xb34a('0x3d')];_0x126d77+=0x1){_0x4d35ca=_0xc16eed[_0x126d77];if(_[_0xb34a('0x3f')](_0xa9640c[_0xb34a('0x22')][_0x4d35ca['id']])){_0xa9640c[_0xb34a('0x22')][_0x4d35ca['id']]=new FaxAccount(_0x4d35ca);}else{_0xa9640c[_0xb34a('0x41')](_0xa9640c[_0xb34a('0x22')][_0x4d35ca['id']],_0x4d35ca);}}}return _0xa9640c[_0xb34a('0x22')];};};module[_0xb34a('0x6e')]=Realtime; \ No newline at end of file +var _0xdcff=['moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','templates','outbound','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','length','isUndefined','initTelephones','initVoiceQueues','voiceQueues','triggers','initTemplates','initZendeskAccounts','salesforceAccounts','freshdeskAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','bluebird','util','lodash'];(function(_0xf86a96,_0x23ae39){var _0x4803d5=function(_0x29f389){while(--_0x29f389){_0xf86a96['push'](_0xf86a96['shift']());}};_0x4803d5(++_0x23ae39);}(_0xdcff,0x67));var _0xfdcf=function(_0x38002b,_0x505a34){_0x38002b=_0x38002b-0x0;var _0x1b5f05=_0xdcff[_0x38002b];return _0x1b5f05;};'use strict';var BPromise=require(_0xfdcf('0x0'));var util=require(_0xfdcf('0x1'));var _=require(_0xfdcf('0x2'));var moment=require(_0xfdcf('0x3'));var Agent=require('../model/agent');var Telephone=require(_0xfdcf('0x4'));var Trunk=require(_0xfdcf('0x5'));var VoiceQueue=require(_0xfdcf('0x6'));var Trigger=require('../model/trigger');var Template=require(_0xfdcf('0x7'));var Campaign=require(_0xfdcf('0x8'));var VoiceExtension=require(_0xfdcf('0x9'));var ZendeskAccount=require(_0xfdcf('0xa'));var SalesforceAccount=require(_0xfdcf('0xb'));var FreshdeskAccount=require(_0xfdcf('0xc'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xfdcf('0xd'));var DeskAccount=require(_0xfdcf('0xe'));var VtigerAccount=require(_0xfdcf('0xf'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xfdcf('0x10'));var FreshsalesAccount=require(_0xfdcf('0x11'));var FaxAccount=require(_0xfdcf('0x12'));var Realtime=function(){this[_0xfdcf('0x13')]={};this[_0xfdcf('0x14')]={};this[_0xfdcf('0x15')]={};this['voiceQueues']={};this['triggers']={};this['campaigns']={};this[_0xfdcf('0x16')]={};this[_0xfdcf('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this[_0xfdcf('0x18')]={};this[_0xfdcf('0x19')]={};this[_0xfdcf('0x1a')]={};this[_0xfdcf('0x1b')]={};this[_0xfdcf('0x1c')]={};this['salesforceAccounts']={};this[_0xfdcf('0x1d')]={};this['freshdeskAccounts']={};this[_0xfdcf('0x1e')]={};this['deskAccounts']={};this[_0xfdcf('0x1f')]={};this[_0xfdcf('0x20')]={};this[_0xfdcf('0x21')]={};this['freshsalesAccounts']={};this[_0xfdcf('0x22')]={};};function freeIsNotKey(_0x354966,_0x8cb341,_0x4a579f){var _0x246440=_[_0xfdcf('0x23')](_0x354966,function(_0x5af6b6,_0x50640a){return _0x5af6b6[_0x4a579f];});for(var _0x31b31d in _0x8cb341){if(_0x8cb341[_0xfdcf('0x24')](_0x31b31d)){if(!_0x246440[_0x31b31d]){delete _0x8cb341[_0x31b31d];}}}}function freeIsNotKeySip(_0x3217b4,_0x216afa){var _0x5c1553=_['mapKeys'](_0x3217b4,function(_0x58b89b,_0x303601){return util[_0xfdcf('0x25')](_0xfdcf('0x26'),_0x58b89b[_0xfdcf('0x27')]);});for(var _0xd32151 in _0x216afa){if(_0x216afa[_0xfdcf('0x24')](_0xd32151)){if(!_0x5c1553[_0xd32151]){delete _0x216afa[_0xd32151];}}}}function freeIsNotKeyAgent(_0x4260a2,_0x2c954d){var _0x53974a=_[_0xfdcf('0x23')](_0x4260a2,function(_0x2e10ae,_0x436ee9){var _0x321425=_[_0xfdcf('0x28')](_0x2e10ae[_0xfdcf('0x29')])?util[_0xfdcf('0x25')](_0xfdcf('0x26'),_0x2e10ae[_0xfdcf('0x27')]):_0x2e10ae[_0xfdcf('0x29')];return _0x321425;});for(var _0x5f0dbc in _0x2c954d){if(_0x2c954d[_0xfdcf('0x24')](_0x5f0dbc)){if(!_0x53974a[_0x5f0dbc]){delete _0x2c954d[_0x5f0dbc];}}}}function clearVoiceCallReports(_0x15e3e3){_0x15e3e3[_0xfdcf('0x2a')]=0x0;_0x15e3e3[_0xfdcf('0x2b')]=0x0;_0x15e3e3[_0xfdcf('0x2c')]=0x0;_0x15e3e3[_0xfdcf('0x2d')]=0x0;_0x15e3e3[_0xfdcf('0x2e')]=0x0;}function clearCampaigns(_0x38339a){if(!_[_0xfdcf('0x2f')](_0x38339a)){for(var _0x180cfb in _0x38339a){if(_0x38339a[_0xfdcf('0x24')](_0x180cfb)){_0x38339a[_0x180cfb][_0xfdcf('0x30')]=0x0;_0x38339a[_0x180cfb]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x5dddf3){if(!_[_0xfdcf('0x2f')](_0x5dddf3)){for(var _0x27bebb in _0x5dddf3){if(_0x5dddf3[_0xfdcf('0x24')](_0x27bebb)){_0x5dddf3[_0x27bebb]['total']=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x2b')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x31')]=0x0;_0x5dddf3[_0x27bebb]['abandoned']=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x2c')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x2d')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x2e')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x32')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x33')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x34')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x35')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x36')]=0x0;_0x5dddf3[_0x27bebb]['outboundUnknownCallsDay']=0x0;_0x5dddf3[_0x27bebb]['outboundDropCallsDayTimeout']=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x37')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x38')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x39')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x3a')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x3b')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x32')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x3c')]=0x0;_0x5dddf3[_0x27bebb][_0xfdcf('0x3d')]=!![];}}}}Realtime['prototype'][_0xfdcf('0x3e')]=function(_0x417f1c,_0x11fc7c){for(var _0x118ea2 in _0x11fc7c){if(_0x417f1c[_0xfdcf('0x24')](_0x118ea2)){_0x417f1c[_0x118ea2]=_0x11fc7c[_0x118ea2];}}};Realtime[_0xfdcf('0x3f')]['initAgents']=function(){var _0x48bfbe=this;return function(_0x10f7c6){if(_0x10f7c6){freeIsNotKeyAgent(_0x10f7c6,_0x48bfbe[_0xfdcf('0x13')]);for(var _0x310405=0x0,_0x43cd64={},_0x304e15={};_0x310405<_0x10f7c6[_0xfdcf('0x40')];_0x310405+=0x1){_0x43cd64=_0x10f7c6[_0x310405];var _0x35513d=_[_0xfdcf('0x28')](_0x43cd64[_0xfdcf('0x29')])?util[_0xfdcf('0x25')](_0xfdcf('0x26'),_0x43cd64[_0xfdcf('0x27')]):_0x43cd64[_0xfdcf('0x29')];if(_[_0xfdcf('0x41')](_0x48bfbe[_0xfdcf('0x13')][_0x35513d])){_0x48bfbe[_0xfdcf('0x13')][_0x35513d]=new Agent(_0x43cd64);}else{_0x48bfbe[_0xfdcf('0x3e')](_0x48bfbe[_0xfdcf('0x13')][_0x35513d],_0x43cd64);}}}return _0x48bfbe['agents'];};};Realtime[_0xfdcf('0x3f')][_0xfdcf('0x42')]=function(){var _0x5ed055=this;return function(_0x4d0857){if(_0x4d0857){freeIsNotKeySip(_0x4d0857,_0x5ed055[_0xfdcf('0x14')]);for(var _0x2d40eb=0x0,_0x32c263={},_0x3052d6={};_0x2d40eb<_0x4d0857[_0xfdcf('0x40')];_0x2d40eb+=0x1){_0x32c263=_0x4d0857[_0x2d40eb];if(_[_0xfdcf('0x41')](_0x5ed055['telephones'][util['format'](_0xfdcf('0x26'),_0x32c263[_0xfdcf('0x27')])])){_0x5ed055[_0xfdcf('0x14')][util['format'](_0xfdcf('0x26'),_0x32c263[_0xfdcf('0x27')])]=new Telephone(_0x32c263);}else{_0x5ed055[_0xfdcf('0x3e')](_0x5ed055[_0xfdcf('0x14')][util[_0xfdcf('0x25')](_0xfdcf('0x26'),_0x32c263[_0xfdcf('0x27')])],_0x32c263);}}}return _0x5ed055[_0xfdcf('0x14')];};};Realtime['prototype']['initTrunks']=function(){var _0x7d4c90=this;return function(_0x31ab88){if(_0x31ab88){freeIsNotKeySip(_0x31ab88,_0x7d4c90[_0xfdcf('0x15')]);for(var _0x3fe224=0x0,_0x176564={},_0x41f767={};_0x3fe224<_0x31ab88[_0xfdcf('0x40')];_0x3fe224+=0x1){_0x176564=_0x31ab88[_0x3fe224];if(_['isUndefined'](_0x7d4c90[_0xfdcf('0x15')][util[_0xfdcf('0x25')](_0xfdcf('0x26'),_0x176564[_0xfdcf('0x27')])])){_0x7d4c90[_0xfdcf('0x15')][util['format'](_0xfdcf('0x26'),_0x176564['name'])]=new Trunk(_0x176564);}else{_0x7d4c90[_0xfdcf('0x3e')](_0x7d4c90['trunks'][util[_0xfdcf('0x25')]('SIP/%s',_0x176564[_0xfdcf('0x27')])],_0x176564);}}}return _0x7d4c90[_0xfdcf('0x15')];};};Realtime[_0xfdcf('0x3f')][_0xfdcf('0x43')]=function(){var _0x410aa5=this;return function(_0x3db15f){if(_0x3db15f){freeIsNotKey(_0x3db15f,_0x410aa5[_0xfdcf('0x44')],_0xfdcf('0x27'));for(var _0x3eeefc=0x0,_0x27c3ca={},_0x2799e5={};_0x3eeefc<_0x3db15f[_0xfdcf('0x40')];_0x3eeefc+=0x1){_0x27c3ca=_0x3db15f[_0x3eeefc];if(_['isUndefined'](_0x410aa5[_0xfdcf('0x44')][_0x27c3ca[_0xfdcf('0x27')]])){_0x410aa5['voiceQueues'][_0x27c3ca[_0xfdcf('0x27')]]=new VoiceQueue(_0x27c3ca);}else{_0x410aa5[_0xfdcf('0x3e')](_0x410aa5[_0xfdcf('0x44')][_0x27c3ca[_0xfdcf('0x27')]],_0x27c3ca);}}}return _0x410aa5[_0xfdcf('0x44')];};};Realtime[_0xfdcf('0x3f')]['initTriggers']=function(){var _0x2aa04a=this;return function(_0xbede8a){if(_0xbede8a){freeIsNotKey(_0xbede8a,_0x2aa04a['triggers'],'id');for(var _0x46d77a=0x0,_0x2ab31d={},_0x3e7c8c={};_0x46d77a<_0xbede8a[_0xfdcf('0x40')];_0x46d77a+=0x1){_0x2ab31d=_0xbede8a[_0x46d77a];if(_[_0xfdcf('0x41')](_0x2aa04a[_0xfdcf('0x45')][_0x2ab31d['id']])){_0x2aa04a[_0xfdcf('0x45')][_0x2ab31d['id']]=new Trigger(_0x2ab31d);}else{_0x2aa04a[_0xfdcf('0x3e')](_0x2aa04a[_0xfdcf('0x45')][_0x2ab31d['id']],_0x2ab31d);}}}return _0x2aa04a[_0xfdcf('0x45')];};};Realtime[_0xfdcf('0x3f')][_0xfdcf('0x46')]=function(){var _0x8192ef=this;return function(_0x47edb3){if(_0x47edb3){freeIsNotKey(_0x47edb3,_0x8192ef[_0xfdcf('0x16')],'id');for(var _0x4bf7bf=0x0,_0x52060c={},_0x1add8b={};_0x4bf7bf<_0x47edb3[_0xfdcf('0x40')];_0x4bf7bf+=0x1){_0x52060c=_0x47edb3[_0x4bf7bf];if(_[_0xfdcf('0x41')](_0x8192ef[_0xfdcf('0x16')][_0x52060c['id']])){_0x8192ef[_0xfdcf('0x16')][_0x52060c['id']]=new Template(_0x52060c);}else{_0x8192ef[_0xfdcf('0x3e')](_0x8192ef['templates'][_0x52060c['id']],_0x52060c);}}}return _0x8192ef[_0xfdcf('0x16')];};};Realtime['prototype'][_0xfdcf('0x47')]=function(){var _0x1e65a3=this;return function(_0x4c717c){if(_0x4c717c){freeIsNotKey(_0x4c717c,_0x1e65a3['zendeskAccounts'],'id');for(var _0x239b71=0x0,_0x2ba533={},_0x1f1666={};_0x239b71<_0x4c717c[_0xfdcf('0x40')];_0x239b71+=0x1){_0x2ba533=_0x4c717c[_0x239b71];if(_[_0xfdcf('0x41')](_0x1e65a3[_0xfdcf('0x1c')][_0x2ba533['id']])){_0x1e65a3[_0xfdcf('0x1c')][_0x2ba533['id']]=new ZendeskAccount(_0x2ba533);}else{_0x1e65a3[_0xfdcf('0x3e')](_0x1e65a3[_0xfdcf('0x1c')][_0x2ba533['id']],_0x2ba533);}}}return _0x1e65a3['zendeskAccounts'];};};Realtime[_0xfdcf('0x3f')]['initSalesforceAccounts']=function(){var _0x408bd2=this;return function(_0x4a776d){if(_0x4a776d){freeIsNotKey(_0x4a776d,_0x408bd2['salesforceAccounts'],'id');for(var _0x1a53a0=0x0,_0x1ee5f8={},_0x7c2f1a={};_0x1a53a0<_0x4a776d[_0xfdcf('0x40')];_0x1a53a0+=0x1){_0x1ee5f8=_0x4a776d[_0x1a53a0];if(_[_0xfdcf('0x41')](_0x408bd2[_0xfdcf('0x48')][_0x1ee5f8['id']])){_0x408bd2[_0xfdcf('0x48')][_0x1ee5f8['id']]=new SalesforceAccount(_0x1ee5f8);}else{_0x408bd2[_0xfdcf('0x3e')](_0x408bd2[_0xfdcf('0x48')][_0x1ee5f8['id']],_0x1ee5f8);}}}return _0x408bd2[_0xfdcf('0x48')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0xb80b4a=this;return function(_0xe1f936){if(_0xe1f936){freeIsNotKey(_0xe1f936,_0xb80b4a[_0xfdcf('0x49')],'id');for(var _0x4972d5=0x0,_0x463579={},_0x184b83={};_0x4972d5<_0xe1f936['length'];_0x4972d5+=0x1){_0x463579=_0xe1f936[_0x4972d5];if(_[_0xfdcf('0x41')](_0xb80b4a['freshdeskAccounts'][_0x463579['id']])){_0xb80b4a[_0xfdcf('0x49')][_0x463579['id']]=new FreshdeskAccount(_0x463579);}else{_0xb80b4a['mergeFromDatabase'](_0xb80b4a[_0xfdcf('0x49')][_0x463579['id']],_0x463579);}}}return _0xb80b4a[_0xfdcf('0x49')];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x13f15f=this;return function(_0xeba434){if(_0xeba434){freeIsNotKey(_0xeba434,_0x13f15f['zohoAccounts'],'id');for(var _0x12fe44=0x0,_0x4b3d2c={},_0x5ab762={};_0x12fe44<_0xeba434[_0xfdcf('0x40')];_0x12fe44+=0x1){_0x4b3d2c=_0xeba434[_0x12fe44];if(_[_0xfdcf('0x41')](_0x13f15f[_0xfdcf('0x1e')][_0x4b3d2c['id']])){_0x13f15f[_0xfdcf('0x1e')][_0x4b3d2c['id']]=new ZohoAccount(_0x4b3d2c);}else{_0x13f15f[_0xfdcf('0x3e')](_0x13f15f[_0xfdcf('0x1e')][_0x4b3d2c['id']],_0x4b3d2c);}}}return _0x13f15f[_0xfdcf('0x1e')];};};Realtime['prototype'][_0xfdcf('0x4a')]=function(){var _0x1cde1a=this;return function(_0xf11f53){if(_0xf11f53){freeIsNotKey(_0xf11f53,_0x1cde1a['deskAccounts'],'id');for(var _0x2a8155=0x0,_0xef7f02={},_0x1d0307={};_0x2a8155<_0xf11f53[_0xfdcf('0x40')];_0x2a8155+=0x1){_0xef7f02=_0xf11f53[_0x2a8155];if(_[_0xfdcf('0x41')](_0x1cde1a[_0xfdcf('0x4b')][_0xef7f02['id']])){_0x1cde1a['deskAccounts'][_0xef7f02['id']]=new DeskAccount(_0xef7f02);}else{_0x1cde1a['mergeFromDatabase'](_0x1cde1a[_0xfdcf('0x4b')][_0xef7f02['id']],_0xef7f02);}}}return _0x1cde1a[_0xfdcf('0x4b')];};};Realtime[_0xfdcf('0x3f')][_0xfdcf('0x4c')]=function(){var _0x4ff02b=this;return function(_0x1f4a5f){if(_0x1f4a5f){freeIsNotKey(_0x1f4a5f,_0x4ff02b['sugarcrmAccounts'],'id');for(var _0x43c16c=0x0,_0x1a284a={},_0x3e9aac={};_0x43c16c<_0x1f4a5f[_0xfdcf('0x40')];_0x43c16c+=0x1){_0x1a284a=_0x1f4a5f[_0x43c16c];if(_[_0xfdcf('0x41')](_0x4ff02b[_0xfdcf('0x1d')][_0x1a284a['id']])){_0x4ff02b[_0xfdcf('0x1d')][_0x1a284a['id']]=new SugarcrmAccount(_0x1a284a);}else{_0x4ff02b[_0xfdcf('0x3e')](_0x4ff02b[_0xfdcf('0x1d')][_0x1a284a['id']],_0x1a284a);}}}return _0x4ff02b[_0xfdcf('0x1d')];};};Realtime[_0xfdcf('0x3f')][_0xfdcf('0x4d')]=function(){var _0x299470=this;return function(_0x34a2b3){if(_0x34a2b3){freeIsNotKey(_0x34a2b3,_0x299470[_0xfdcf('0x1f')],'id');for(var _0x30a690=0x0,_0x490eaf={},_0x2c1ef0={};_0x30a690<_0x34a2b3[_0xfdcf('0x40')];_0x30a690+=0x1){_0x490eaf=_0x34a2b3[_0x30a690];if(_[_0xfdcf('0x41')](_0x299470[_0xfdcf('0x1f')][_0x490eaf['id']])){_0x299470[_0xfdcf('0x1f')][_0x490eaf['id']]=new VtigerAccount(_0x490eaf);}else{_0x299470[_0xfdcf('0x3e')](_0x299470[_0xfdcf('0x1f')][_0x490eaf['id']],_0x490eaf);}}}return _0x299470[_0xfdcf('0x1f')];};};Realtime['prototype'][_0xfdcf('0x4e')]=function(){var _0x3d2488=this;return function(_0x3c45d2){if(_0x3c45d2){freeIsNotKey(_0x3c45d2,_0x3d2488[_0xfdcf('0x20')],'id');for(var _0x5cf0c0=0x0,_0x2ae4dd={},_0xe3a6bb={};_0x5cf0c0<_0x3c45d2['length'];_0x5cf0c0+=0x1){_0x2ae4dd=_0x3c45d2[_0x5cf0c0];if(_[_0xfdcf('0x41')](_0x3d2488[_0xfdcf('0x20')][_0x2ae4dd['id']])){_0x3d2488['servicenowAccounts'][_0x2ae4dd['id']]=new ServicenowAccount(_0x2ae4dd);}else{_0x3d2488[_0xfdcf('0x3e')](_0x3d2488[_0xfdcf('0x20')][_0x2ae4dd['id']],_0x2ae4dd);}}}return _0x3d2488[_0xfdcf('0x20')];};};Realtime['prototype'][_0xfdcf('0x4f')]=function(){var _0x106a4e=this;return function(_0x5a94db){if(_0x5a94db){freeIsNotKey(_0x5a94db,_0x106a4e[_0xfdcf('0x21')],'id');for(var _0x39a9db=0x0,_0x183c20={},_0x564b8b={};_0x39a9db<_0x5a94db['length'];_0x39a9db+=0x1){_0x183c20=_0x5a94db[_0x39a9db];if(_['isUndefined'](_0x106a4e['dynamics365Accounts'][_0x183c20['id']])){_0x106a4e[_0xfdcf('0x21')][_0x183c20['id']]=new Dynamics365Account(_0x183c20);}else{_0x106a4e[_0xfdcf('0x3e')](_0x106a4e[_0xfdcf('0x21')][_0x183c20['id']],_0x183c20);}}}return _0x106a4e[_0xfdcf('0x21')];};};Realtime[_0xfdcf('0x3f')][_0xfdcf('0x50')]=function(){var _0x2f6d8e=this;return function(_0x1d87c){if(_0x1d87c){freeIsNotKey(_0x1d87c,_0x2f6d8e[_0xfdcf('0x51')],'id');for(var _0x512581=0x0,_0x2f8c35={},_0x113c34={};_0x512581<_0x1d87c[_0xfdcf('0x40')];_0x512581+=0x1){_0x2f8c35=_0x1d87c[_0x512581];if(_[_0xfdcf('0x41')](_0x2f6d8e[_0xfdcf('0x51')][_0x2f8c35['id']])){_0x2f6d8e[_0xfdcf('0x51')][_0x2f8c35['id']]=new FreshsalesAccount(_0x2f8c35);}else{_0x2f6d8e[_0xfdcf('0x3e')](_0x2f6d8e[_0xfdcf('0x51')][_0x2f8c35['id']],_0x2f8c35);}}}return _0x2f6d8e[_0xfdcf('0x51')];};};Realtime[_0xfdcf('0x3f')][_0xfdcf('0x52')]=function(){var _0x3fe94c=this;return function(_0x2cc93e){for(var _0xf0b48c=0x0;_0xf0b48c<_0x2cc93e['length'];_0xf0b48c+=0x1){_[_0xfdcf('0x53')](_0x3fe94c[_0xfdcf('0x44')][_0x2cc93e[_0xf0b48c]['name']],_0x2cc93e[_0xf0b48c]);}return _0x3fe94c['voiceQueues'];};};Realtime[_0xfdcf('0x3f')][_0xfdcf('0x54')]=function(){var _0x37bc60=this;return function(_0x176664){clearVoiceQueues(_0x37bc60[_0xfdcf('0x44')]);if(_0x176664){_0x176664=_[_0xfdcf('0x55')](_0x176664,_0xfdcf('0x56'));for(var _0x1f4cea in _0x176664){if(_0x176664[_0xfdcf('0x24')](_0x1f4cea)){var _0x16c3a8={};for(var _0x2abea8=0x0;_0x2abea8<_0x176664[_0x1f4cea][_0xfdcf('0x40')];_0x2abea8+=0x1){var _0x14d04e=_0x176664[_0x1f4cea][_0x2abea8][_0xfdcf('0x57')];if(_0x37bc60['voiceQueues'][_0x14d04e]){if(_0x176664[_0x1f4cea][_0x2abea8][_0xfdcf('0x58')]){_0x37bc60[_0xfdcf('0x44')][_0x14d04e][_0xfdcf('0x31')]+=0x1;}if(_0x176664[_0x1f4cea][_0x2abea8]['queuecallerabandon']){_0x37bc60[_0xfdcf('0x44')][_0x14d04e][_0xfdcf('0x59')]+=0x1;}_0x37bc60[_0xfdcf('0x44')][_0x14d04e]['sumHoldTime']+=moment(_0x176664[_0x1f4cea][_0x2abea8][_0xfdcf('0x5a')])[_0xfdcf('0x5b')](moment(_0x176664[_0x1f4cea][_0x2abea8][_0xfdcf('0x5c')]),_0xfdcf('0x5d'))||0x0;if(_0x2abea8===_0x176664[_0x1f4cea][_0xfdcf('0x40')]-0x1){_0x37bc60['voiceQueues'][_0x14d04e][_0xfdcf('0x2d')]+=moment(_0x176664[_0x1f4cea][_0x2abea8]['queuecallercompleteAt']||_0x176664[_0x1f4cea][_0x2abea8]['queuecallerabandonAt']||_0x176664[_0x1f4cea][_0x2abea8][_0xfdcf('0x5e')])[_0xfdcf('0x5b')](moment(_0x176664[_0x1f4cea][_0x2abea8][_0xfdcf('0x5c')]),_0xfdcf('0x5d'))||0x0;_0x37bc60[_0xfdcf('0x44')][_0x14d04e]['total']+=0x1;if(_0x176664[_0x1f4cea][_0x2abea8][_0xfdcf('0x5f')]){_0x37bc60[_0xfdcf('0x44')][_0x14d04e][_0xfdcf('0x2b')]+=0x1;_0x37bc60[_0xfdcf('0x44')][_0x14d04e][_0xfdcf('0x2e')]+=moment(_0x176664[_0x1f4cea][_0x2abea8]['queuecallercompleteAt'])[_0xfdcf('0x5b')](moment(_0x176664[_0x1f4cea][_0x2abea8][_0xfdcf('0x5a')]),'seconds')||0x0;}}else{_0x37bc60[_0xfdcf('0x44')][_0x14d04e][_0xfdcf('0x2d')]+=_0x37bc60['voiceQueues'][_0x14d04e]['sumHoldTime']||0x0;}}}}}}return _0x37bc60['voiceQueues'];};};Realtime[_0xfdcf('0x3f')][_0xfdcf('0x60')]=function(){var _0x96e93a=this;return function(_0x1ad8cb){clearVoiceCallReports(_0x96e93a[_0xfdcf('0x17')]);if(_0x1ad8cb){for(var _0x161e0c=0x0;_0x161e0c<_0x1ad8cb['length'];_0x161e0c+=0x1){_0x96e93a['outbound'][_0xfdcf('0x2a')]+=0x1;_0x96e93a[_0xfdcf('0x17')][_0xfdcf('0x2d')]+=_0x1ad8cb[_0x161e0c]['duration'];if(_0x1ad8cb[_0x161e0c]['disposition']===_0xfdcf('0x61')){_0x96e93a[_0xfdcf('0x17')][_0xfdcf('0x2b')]+=0x1;_0x96e93a['outbound']['sumHoldTime']+=_0x1ad8cb[_0x161e0c]['duration']-_0x1ad8cb[_0x161e0c][_0xfdcf('0x62')]||0x0;_0x96e93a['outbound'][_0xfdcf('0x2e')]+=_0x1ad8cb[_0x161e0c][_0xfdcf('0x62')];}}}return _0x96e93a[_0xfdcf('0x17')];};};Realtime[_0xfdcf('0x3f')][_0xfdcf('0x63')]=function(){var _0x2a9f5c=this;return function(_0x59173c){if(_0x59173c){freeIsNotKey(_0x59173c,_0x2a9f5c[_0xfdcf('0x64')],_0xfdcf('0x27'));for(var _0x13d0f4=0x0,_0xf954d6={};_0x13d0f4<_0x59173c[_0xfdcf('0x40')];_0x13d0f4+=0x1){_0xf954d6=_0x59173c[_0x13d0f4];if(_[_0xfdcf('0x41')](_0x2a9f5c[_0xfdcf('0x64')][_0xf954d6[_0xfdcf('0x27')]])){_0x2a9f5c[_0xfdcf('0x64')][_0xf954d6['name']]=new Campaign(_0xf954d6);}else{_0x2a9f5c['mergeFromDatabase'](_0x2a9f5c[_0xfdcf('0x64')][_0xf954d6[_0xfdcf('0x27')]],_0xf954d6);_0x2a9f5c[_0xfdcf('0x64')][_0xf954d6[_0xfdcf('0x27')]][_0xfdcf('0x65')]=_0xf954d6[_0xfdcf('0x66')]?_0xf954d6[_0xfdcf('0x66')]['name']:undefined;}}}return _0x2a9f5c[_0xfdcf('0x64')];};};Realtime[_0xfdcf('0x3f')]['initVoiceExtensions']=function(){var _0x3bd406=this;return function(_0x374f7d){if(_0x374f7d){freeIsNotKey(_0x374f7d,_0x3bd406[_0xfdcf('0x67')],'id');for(var _0x136caa=0x0,_0x47164b={};_0x136caa<_0x374f7d[_0xfdcf('0x40')];_0x136caa+=0x1){_0x47164b=_0x374f7d[_0x136caa];if(_[_0xfdcf('0x41')](_0x3bd406[_0xfdcf('0x67')][_0x47164b['id']])){_0x3bd406[_0xfdcf('0x67')][_0x47164b['id']]=new VoiceExtension(_0x47164b);}else{_0x3bd406[_0xfdcf('0x3e')](_0x3bd406[_0xfdcf('0x67')][_0x47164b['id']],_0x47164b);}}}return _0x3bd406[_0xfdcf('0x67')];};};Realtime[_0xfdcf('0x3f')][_0xfdcf('0x68')]=function(){var _0x5c5645=this;return function(_0x1c5a90){clearCampaigns(_0x5c5645[_0xfdcf('0x64')]);for(var _0x5c2c31=0x0;_0x5c2c31<_0x1c5a90['length'];_0x5c2c31+=0x1){_[_0xfdcf('0x53')](_0x5c5645['campaigns'][_0x1c5a90[_0x5c2c31][_0xfdcf('0x27')]],_0x1c5a90[_0x5c2c31]);}return _0x5c5645['campaigns'];};};Realtime['prototype'][_0xfdcf('0x69')]=function(){var _0x2601ca=this;return function(_0x5a7869){if(_0x5a7869){freeIsNotKey(_0x5a7869,_0x2601ca['faxAccounts'],'id');for(var _0x1f8a67=0x0,_0x536861={},_0x1a830d={};_0x1f8a67<_0x5a7869[_0xfdcf('0x40')];_0x1f8a67+=0x1){_0x536861=_0x5a7869[_0x1f8a67];if(_[_0xfdcf('0x41')](_0x2601ca[_0xfdcf('0x22')][_0x536861['id']])){_0x2601ca['faxAccounts'][_0x536861['id']]=new FaxAccount(_0x536861);}else{_0x2601ca[_0xfdcf('0x3e')](_0x2601ca[_0xfdcf('0x22')][_0x536861['id']],_0x536861);}}}return _0x2601ca[_0xfdcf('0x22')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index c54a087..7f81285 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 _0xc6fa=['voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','assigned','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','outbound','internal','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','originatecalleridnum','destinationchannel','calleridpreview','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','Local','substring','indexOf','mobile','phone','lastIndexOf','blindTransfer','transfererlinkedid','exports','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport'];(function(_0x2f0972,_0x42ddf5){var _0x27aeb7=function(_0x516737){while(--_0x516737){_0x2f0972['push'](_0x2f0972['shift']());}};_0x27aeb7(++_0x42ddf5);}(_0xc6fa,0xab));var _0xac6f=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0xc6fa[_0x3132e8];return _0x43eb8c;};'use strict';var _=require(_0xac6f('0x0'));var moment=require(_0xac6f('0x1'));var util=require(_0xac6f('0x2'));var config=require('../../../config/environment');var ami=require(_0xac6f('0x3'));var RpcVoiceAgentReport=require(_0xac6f('0x4'));var RpcVoiceCallReport=require(_0xac6f('0x5'));var RpcVoiceDialReport=require(_0xac6f('0x6'));var RpcMemberReport=require(_0xac6f('0x7'));var RpcVoiceQueueReport=require(_0xac6f('0x8'));var RpcVoiceRecording=require(_0xac6f('0x9'));var RpcVoiceTransferReport=require(_0xac6f('0xa'));var VoiceQueueReport=require(_0xac6f('0xb'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xac6f('0xc'));var VoiceDialReport=require(_0xac6f('0xd'));var UserReport=require(_0xac6f('0xe'));function Report(_0x4e5594){this[_0xac6f('0xf')]=_0x4e5594;this[_0xac6f('0x10')]=_0x4e5594[_0xac6f('0x10')];this['telephones']=_0x4e5594[_0xac6f('0x11')];}Report['prototype'][_0xac6f('0x12')]=function(_0xc3f20d){var _0x19120d=new VoiceQueueReport(this['realtime']);var _0x35a84d=new VoiceAgentReport(this[_0xac6f('0xf')]);var _0x47d3ca=new VoiceDialReport(this['realtime']);var _0x1f9bde=new VoiceCallReport(this['realtime']);var _0x4e9203=new UserReport(this[_0xac6f('0xf')]);if(config['xdr']&&config[_0xac6f('0x13')][_0xac6f('0x14')]){ami['on']('custom:voiceQueueReport',this[_0xac6f('0x15')][_0xac6f('0x16')](this));ami['on'](_0xac6f('0x17'),this[_0xac6f('0x18')][_0xac6f('0x16')](this));ami['on']('custom:voiceAgentReport',this[_0xac6f('0x19')][_0xac6f('0x16')](this));ami['on'](_0xac6f('0x1a'),this[_0xac6f('0x1b')]['bind'](this));ami['on'](_0xac6f('0x1c'),this['blindTransfer'][_0xac6f('0x16')](this));ami['on'](_0xac6f('0x1d'),this[_0xac6f('0x1e')][_0xac6f('0x16')](this));}};Report[_0xac6f('0x1f')][_0xac6f('0x20')]=function(_0x4a61de){var _0x2f0f79;_0x2f0f79=_[_0xac6f('0x21')](this[_0xac6f('0x10')],function(_0x9b1654){return _0x9b1654[_0xac6f('0x22')]==_0x4a61de||_0x9b1654[_0xac6f('0x23')]==_0x4a61de;});if(_[_0xac6f('0x24')](_0x2f0f79)){var _0x6fc23e=_[_0xac6f('0x21')](this['telephones'],function(_0x1474d2){return _0x1474d2['accountcode']==_0x4a61de||_0x1474d2[_0xac6f('0x23')]==_0x4a61de;});if(_0x6fc23e){_0x2f0f79=_[_0xac6f('0x21')](this[_0xac6f('0x10')],function(_0x212ec3){return _0x212ec3[_0xac6f('0x25')]==util[_0xac6f('0x26')](_0xac6f('0x27'),_0x6fc23e[_0xac6f('0x23')]);});}}return _0x2f0f79;};Report[_0xac6f('0x1f')][_0xac6f('0x15')]=function(_0x5dca01){for(var _0x1bfdae=0x0;_0x1bfdae<_0x5dca01[_0xac6f('0x28')];_0x1bfdae+=0x1){var _0x589136=this[_0xac6f('0x20')](_0x5dca01[_0x1bfdae]['connectedlinenum']);if(_0x589136){_0x5dca01[_0x1bfdae][_0xac6f('0x22')]=_0x589136['accountcode'];_0x5dca01[_0x1bfdae][_0xac6f('0x29')]=!![];_0x5dca01[_0x1bfdae]['lastAssignedTo']=_0x589136[_0xac6f('0x23')];_0x5dca01[_0x1bfdae][_0xac6f('0x25')]=_[_0xac6f('0x24')](_0x589136[_0xac6f('0x25')])?util[_0xac6f('0x26')]('SIP/%s',_0x589136[_0xac6f('0x23')]):_0x589136[_0xac6f('0x25')];if(_0x5dca01[_0x1bfdae]['queuecallercomplete']){_0x5dca01[_0x1bfdae][_0xac6f('0x2a')]=moment()['format'](_0xac6f('0x2b'));}if(_0x5dca01[_0x1bfdae][_0xac6f('0x2c')]){_0x5dca01[_0x1bfdae][_0xac6f('0x2d')]=moment()[_0xac6f('0x26')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xac6f('0x15')](_0x5dca01[_0x1bfdae]);}RpcVoiceQueueReport[_0xac6f('0x2e')](_0x5dca01[_0x1bfdae]);}};function extractCalleridNumber(_0x499297){var _0x404ba4=_0x499297[_0xac6f('0x2f')](/<(.*?)>/);return _0x404ba4?_0x404ba4[0x1]:_0x499297;}Report[_0xac6f('0x1f')][_0xac6f('0x30')]=function(_0x33e57e){for(var _0x4d2abc=0x0;_0x4d2abc','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','getCallType','getAgentByInternal','UserId','membername','create','monitor','monitors','monitorFilename','createdAt','exten','connectedlinename','originatecalleridnum','xcally-motion-dialer','startsWith','Local','substring','indexOf','phone','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xbbdd,0x1f3));var _0xdbbd=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xbbdd[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require(_0xdbbd('0x0'));var moment=require('moment');var util=require(_0xdbbd('0x1'));var config=require(_0xdbbd('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xdbbd('0x3'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xdbbd('0x4'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xdbbd('0x5'));var RpcVoiceRecording=require(_0xdbbd('0x6'));var RpcVoiceTransferReport=require(_0xdbbd('0x7'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xdbbd('0x8'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xdbbd('0x9'));var UserReport=require(_0xdbbd('0xa'));function Report(_0x2887a6){this[_0xdbbd('0xb')]=_0x2887a6;this['agents']=_0x2887a6[_0xdbbd('0xc')];this[_0xdbbd('0xd')]=_0x2887a6[_0xdbbd('0xd')];}Report[_0xdbbd('0xe')][_0xdbbd('0xf')]=function(_0x3d79a9){var _0x125e97=new VoiceQueueReport(this[_0xdbbd('0xb')]);var _0x24d442=new VoiceAgentReport(this['realtime']);var _0x4915be=new VoiceDialReport(this['realtime']);var _0x17d84c=new VoiceCallReport(this[_0xdbbd('0xb')]);var _0x3820ad=new UserReport(this['realtime']);if(config['xdr']&&config['xdr'][_0xdbbd('0x10')]){ami['on'](_0xdbbd('0x11'),this['voiceQueueReport'][_0xdbbd('0x12')](this));ami['on'](_0xdbbd('0x13'),this['voiceCallReport'][_0xdbbd('0x12')](this));ami['on'](_0xdbbd('0x14'),this[_0xdbbd('0x15')][_0xdbbd('0x12')](this));ami['on'](_0xdbbd('0x16'),this[_0xdbbd('0x17')][_0xdbbd('0x12')](this));ami['on']('blindtransfer',this[_0xdbbd('0x18')]['bind'](this));ami['on'](_0xdbbd('0x19'),this['attendedTransfer'][_0xdbbd('0x12')](this));}};Report[_0xdbbd('0xe')][_0xdbbd('0x1a')]=function(_0x2b8df2){var _0x42e7af;_0x42e7af=_[_0xdbbd('0x1b')](this[_0xdbbd('0xc')],function(_0x2c46b9){return _0x2c46b9[_0xdbbd('0x1c')]==_0x2b8df2||_0x2c46b9[_0xdbbd('0x1d')]==_0x2b8df2;});if(_[_0xdbbd('0x1e')](_0x42e7af)){var _0x4694e6=_[_0xdbbd('0x1b')](this['telephones'],function(_0x4830ae){return _0x4830ae[_0xdbbd('0x1c')]==_0x2b8df2||_0x4830ae[_0xdbbd('0x1d')]==_0x2b8df2;});if(_0x4694e6){_0x42e7af=_[_0xdbbd('0x1b')](this[_0xdbbd('0xc')],function(_0x4acdd1){return _0x4acdd1[_0xdbbd('0x1f')]==util[_0xdbbd('0x20')](_0xdbbd('0x21'),_0x4694e6[_0xdbbd('0x1d')]);});}}return _0x42e7af;};Report['prototype']['voiceQueueReport']=function(_0x5f5b79){for(var _0x39356c=0x0;_0x39356c<_0x5f5b79[_0xdbbd('0x22')];_0x39356c+=0x1){var _0x4b74da=this[_0xdbbd('0x1a')](_0x5f5b79[_0x39356c][_0xdbbd('0x23')]);if(_0x4b74da){_0x5f5b79[_0x39356c][_0xdbbd('0x1c')]=_0x4b74da['accountcode'];_0x5f5b79[_0x39356c][_0xdbbd('0x24')]=!![];_0x5f5b79[_0x39356c][_0xdbbd('0x25')]=_0x4b74da[_0xdbbd('0x1d')];_0x5f5b79[_0x39356c][_0xdbbd('0x1f')]=_[_0xdbbd('0x1e')](_0x4b74da[_0xdbbd('0x1f')])?util['format'](_0xdbbd('0x21'),_0x4b74da['name']):_0x4b74da['interface'];if(_0x5f5b79[_0x39356c][_0xdbbd('0x26')]){_0x5f5b79[_0x39356c]['queuecallercompleteAt']=moment()[_0xdbbd('0x20')](_0xdbbd('0x27'));}if(_0x5f5b79[_0x39356c]['queuecallerexit']){_0x5f5b79[_0x39356c][_0xdbbd('0x28')]=moment()[_0xdbbd('0x20')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x5f5b79[_0x39356c]);}RpcVoiceQueueReport['create'](_0x5f5b79[_0x39356c]);}};function extractCalleridNumber(_0x451ee0){var _0xdc3d29=_0x451ee0[_0xdbbd('0x29')](/<(.*?)>/);return _0xdc3d29?_0xdc3d29[0x1]:_0x451ee0;}Report['prototype']['getAgentByInternal']=function(_0x458e74){for(var _0x2dd10b=0x0;_0x2dd10b0x0?_0x33e7a5:0x0;this[_0x6d35('0x44')][_0x275a0a['queue']][_0x6d35('0x5c')]=this[_0x6d35('0x44')][_0x275a0a[_0x6d35('0x6f')]][_0x6d35('0x5c')]>_[_0x6d35('0x74')](_0x275a0a[_0x6d35('0x76')])?_[_0x6d35('0x74')](_0x275a0a[_0x6d35('0x76')]):this['voiceQueues'][_0x275a0a[_0x6d35('0x6f')]][_0x6d35('0x5c')];this['emitVoiceQueueSummary'](this[_0x6d35('0x44')][_0x275a0a[_0x6d35('0x6f')]],_0x6d35('0x18'));}logger[_0x6d35('0x51')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x6d35('0x40')](this[_0x6d35('0x44')][_0x275a0a['queue']],{'showHidden':![],'depth':null}));ami[_0x6d35('0x47')](_0x6d35('0x77'),this[_0x6d35('0x44')][_0x275a0a[_0x6d35('0x6f')]]);}}}catch(_0x2b8ab0){logger[_0x6d35('0x3f')](_0x6d35('0x6e'),util[_0x6d35('0x40')](_0x2b8ab0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6d35('0xe')][_0x6d35('0x1a')]=function(_0x21f3ea){logger[_0x6d35('0x51')](_0x6d35('0x78'),util['inspect'](_0x21f3ea,{'showHidden':![],'depth':null}));this[_0x6d35('0x6c')]=!![];};VoiceQueueReport[_0x6d35('0xe')][_0x6d35('0x79')]=function(_0x455a26){try{if(this[_0x6d35('0x68')](_0x455a26)){logger[_0x6d35('0x51')](_0x6d35('0x7a'),_0x455a26[_0x6d35('0x4b')],util['inspect'](_0x455a26,{'showHidden':![],'depth':null}));if(_[_0x6d35('0x69')](this['queueReports'][_0x455a26[_0x6d35('0x4b')]]))this[_0x6d35('0x12')][_0x455a26['uniqueid']]=[];if(_['isUndefined'](this['channels'][_0x455a26[_0x6d35('0x4b')]]))this[_0x6d35('0x14')][_0x455a26['uniqueid']]={};var _0x23b990=new QueueReport();_0x23b990['name']=_0x455a26[_0x6d35('0x6f')];_0x23b990['type']=this[_0x6d35('0x44')][_0x23b990[_0x6d35('0x4e')]]&&this['voiceQueues'][_0x23b990[_0x6d35('0x4e')]][_0x6d35('0x5e')]?this[_0x6d35('0x44')][_0x23b990[_0x6d35('0x4e')]][_0x6d35('0x5e')]||_0x6d35('0x58'):_0x6d35('0x58');_0x23b990['queue']=_0x455a26[_0x6d35('0x6f')];_0x23b990[_0x6d35('0x7b')]=moment()['format'](_0x6d35('0x7c'));_0x23b990[_0x6d35('0x7d')]=_0x455a26[_0x6d35('0x7d')];_0x23b990['count']=_0x455a26[_0x6d35('0x7e')];_0x23b990[_0x6d35('0x4b')]=_0x455a26[_0x6d35('0x4b')];_0x23b990[_0x6d35('0x7f')]=this[_0x6d35('0x14')][_0x455a26[_0x6d35('0x4b')]][_0x6d35('0x7f')];logger[_0x6d35('0x70')](_0x6d35('0x80'),_0x23b990['name'],_0x23b990['type']);_[_0x6d35('0x81')](_0x23b990,_['pick'](_0x455a26,_[_0x6d35('0x82')](_0x23b990)));this[_0x6d35('0x12')][_0x455a26['uniqueid']][_0x6d35('0x83')](_0x23b990);this[_0x6d35('0x14')][_0x455a26[_0x6d35('0x4b')]]=_0x23b990;this['emitVoiceQueueChannelSave'](_0x23b990,'queuecallerjoin');}}catch(_0x4ceca7){logger[_0x6d35('0x3f')]('[%s][voiceQueueReport][queuecallerjoin]',_0x455a26[_0x6d35('0x4b')],util[_0x6d35('0x40')](_0x4ceca7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6d35('0xe')][_0x6d35('0x1e')]=function(_0x89e421){try{if(this['isNotNull'](_0x89e421)){logger[_0x6d35('0x51')](_0x6d35('0x84'),_0x89e421[_0x6d35('0x4b')],util['inspect'](_0x89e421,{'showHidden':![],'depth':null}));if(this[_0x6d35('0x12')][_0x89e421[_0x6d35('0x4b')]]){var _0x587d0c=_[_0x6d35('0x85')](this[_0x6d35('0x12')][_0x89e421[_0x6d35('0x4b')]]);_0x587d0c[_0x6d35('0x86')]=![];_0x587d0c['queuecallercompleteAt']=null;_0x587d0c['holdtime']=_0x89e421[_0x6d35('0x87')];_0x587d0c['originalposition']=_0x89e421[_0x6d35('0x88')];_0x587d0c[_0x6d35('0x1d')]=!![];_0x587d0c['queuecallerabandonAt']=moment()[_0x6d35('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x587d0c['queuecallerexitreason']=_0x6d35('0x89');_0x587d0c[_0x6d35('0x8a')]=null;logger['info'](_0x6d35('0x8b'),_0x587d0c[_0x6d35('0x4e')],_0x587d0c['type']);this['channels'][_0x89e421[_0x6d35('0x4b')]]=_0x587d0c;this[_0x6d35('0x45')](_0x587d0c,'queuecallerabandon');}}}catch(_0xbf8a25){logger['error'](_0x6d35('0x84'),_0x89e421[_0x6d35('0x4b')],util[_0x6d35('0x40')](_0xbf8a25,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6d35('0xe')][_0x6d35('0x20')]=function(_0x5aa04e){try{if(this[_0x6d35('0x68')](_0x5aa04e)){logger['debug'](_0x6d35('0x8c'),_0x5aa04e[_0x6d35('0x4b')],util['inspect'](_0x5aa04e,{'showHidden':![],'depth':null}));if(this[_0x6d35('0x12')][_0x5aa04e[_0x6d35('0x4b')]]){var _0x27ed37=_[_0x6d35('0x85')](this[_0x6d35('0x12')][_0x5aa04e['uniqueid']]);_0x27ed37[_0x6d35('0x8d')]=moment()[_0x6d35('0x4c')](_0x6d35('0x7c'));_0x27ed37[_0x6d35('0x8e')]=_0x5aa04e['connectedlinenum'];_0x27ed37['connectedlinename']=_0x5aa04e[_0x6d35('0x8f')];logger[_0x6d35('0x70')](_0x6d35('0x90'),_0x27ed37[_0x6d35('0x4e')],_0x27ed37[_0x6d35('0x5e')],_0x5aa04e[_0x6d35('0x8e')],_0x5aa04e[_0x6d35('0x8f')]);this[_0x6d35('0x14')][_0x5aa04e[_0x6d35('0x4b')]]=_0x27ed37;this[_0x6d35('0x48')](_0x27ed37,'queuecallerleave');}}}catch(_0xb7a34d){logger[_0x6d35('0x3f')](_0x6d35('0x8c'),_0x5aa04e[_0x6d35('0x4b')],util[_0x6d35('0x40')](_0xb7a34d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6d35('0xe')][_0x6d35('0x23')]=function(_0x1f4dc3){try{if(this['isNotNull'](_0x1f4dc3)){logger['debug'](_0x6d35('0x91'),_0x1f4dc3[_0x6d35('0x4b')],util[_0x6d35('0x40')](_0x1f4dc3,{'showHidden':![],'depth':null}));if(this[_0x6d35('0x12')][_0x1f4dc3[_0x6d35('0x4b')]]){var _0x2f2127=_[_0x6d35('0x85')](this[_0x6d35('0x12')][_0x1f4dc3[_0x6d35('0x4b')]]);_0x2f2127['queuecallercomplete']=!![];_0x2f2127[_0x6d35('0x53')]=_0x6d35('0x92');logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x2f2127['name'],_0x2f2127[_0x6d35('0x5e')]);}}}catch(_0xe5b6b8){logger['error'](_0x6d35('0x91'),_0x1f4dc3['uniqueid'],util[_0x6d35('0x40')](_0xe5b6b8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x1b889f){try{if(this['isNotNull'](_0x1b889f)){logger[_0x6d35('0x51')](_0x6d35('0x93'),_0x1b889f['uniqueid'],util[_0x6d35('0x40')](_0x1b889f,{'showHidden':![],'depth':null}));if(this[_0x6d35('0x12')][_0x1b889f[_0x6d35('0x4b')]]){var _0x3cbbee=_[_0x6d35('0x85')](this['queueReports'][_0x1b889f[_0x6d35('0x4b')]]);_0x3cbbee[_0x6d35('0x1d')]=![];_0x3cbbee[_0x6d35('0x94')]=null;_0x3cbbee[_0x6d35('0x95')]=!![];_0x3cbbee[_0x6d35('0x8a')]=_0x1b889f[_0x6d35('0x96')];_0x3cbbee['holdtime']=_0x1b889f[_0x6d35('0x87')];_0x3cbbee[_0x6d35('0x86')]=!![];_0x3cbbee['queuecallerexit']=![];_0x3cbbee['queuecallerexitAt']=null;if(!_0x3cbbee[_0x6d35('0x97')]){if(_0x1b889f['reason']=='transfer'){_0x3cbbee[_0x6d35('0x53')]='COMPLETED';logger[_0x6d35('0x70')](_0x6d35('0x98'),_0x3cbbee['name'],_0x3cbbee[_0x6d35('0x5e')]);}else{if(_[_0x6d35('0x99')](_0x1b889f[_0x6d35('0x3c')][_0x6d35('0x9a')](),_0x6d35('0x9b'))){if(this[_0x6d35('0x12')][_0x1b889f['linkedid']]){var _0xa6225a=_[_0x6d35('0x85')](this[_0x6d35('0x12')][_0x1b889f[_0x6d35('0x9c')]]);_0xa6225a[_0x6d35('0x86')]=![];_0xa6225a[_0x6d35('0x9d')]=!![];_0xa6225a['queuecallerexitAt']=moment(_0x3cbbee[_0x6d35('0x7b')])['add'](_0x1b889f[_0x6d35('0x87')],_0x6d35('0x9e'))[_0x6d35('0x4c')](_0x6d35('0x7c'));_0xa6225a[_0x6d35('0x53')]='FORWARDTRANSFER';_0xa6225a[_0x6d35('0x97')]=!![];_0xa6225a[_0x6d35('0x9f')]=_0x6d35('0xa0');_0xa6225a[_0x6d35('0xa1')]=_0x1b889f[_0x6d35('0xa2')];_0xa6225a['transferuniqueid']=_0x1b889f[_0x6d35('0x4b')];logger[_0x6d35('0x70')](_0x6d35('0xa3'),_0xa6225a['name'],_0xa6225a[_0x6d35('0x5e')]);var _0x306e3b=this['queueReports'][_0x1b889f[_0x6d35('0x9c')]];this[_0x6d35('0x12')][_0x1b889f[_0x6d35('0x9c')]]=this[_0x6d35('0x12')][_0x1b889f[_0x6d35('0x4b')]];this['queueReports'][_0x1b889f[_0x6d35('0x4b')]]=_0x306e3b;}}else{_0x3cbbee['queuecallerexitreason']=_0x6d35('0xa4')+_0x1b889f[_0x6d35('0xa5')][_0x6d35('0xa6')]();logger[_0x6d35('0x70')](_0x6d35('0xa7'),_0x3cbbee[_0x6d35('0x4e')],_0x3cbbee[_0x6d35('0x5e')],_0x3cbbee[_0x6d35('0x53')]);}}}this[_0x6d35('0x14')][_0x1b889f['uniqueid']]=_0x3cbbee;this[_0x6d35('0x45')](_0x3cbbee,'agentcomplete');}}}catch(_0x7ce6b8){logger['error'](_0x6d35('0x93'),_0x1b889f[_0x6d35('0x4b')],util[_0x6d35('0x40')](_0x7ce6b8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6d35('0xe')]['syncVarSet']=function(_0xe7c47d){try{if(this['isNotNull'](_0xe7c47d)){logger[_0x6d35('0x51')]('[%s][voiceQueueReport][varset]',_0xe7c47d['uniqueid'],util[_0x6d35('0x40')](_0xe7c47d,{'showHidden':![],'depth':null}));this[_0x6d35('0xa8')](_0xe7c47d['uniqueid'],_[_0x6d35('0x82')](_0xe7c47d['variable'])[0x0],_0xe7c47d[_0x6d35('0xa9')]);if(this[_0x6d35('0x12')][_0xe7c47d['uniqueid']]){var _0x4a0879=_[_0x6d35('0x85')](this['queueReports'][_0xe7c47d['uniqueid']]);if(_0x4a0879){if(this[_0x6d35('0x68')](_0xe7c47d[_0x6d35('0xaa')])&&this[_0x6d35('0x68')](_0xe7c47d[_0x6d35('0xaa')][_0x6d35('0xab')])){switch(_0xe7c47d[_0x6d35('0xa9')]){case _0x6d35('0xac'):_0x4a0879[_0x6d35('0x9d')]=![];_0x4a0879[_0x6d35('0xad')]=null;break;case'TIMEOUT':_0x4a0879[_0x6d35('0xae')]=_0x6d35('0xaf');_0x4a0879[_0x6d35('0x9d')]=!![];_0x4a0879['queuecallerexitAt']=moment()[_0x6d35('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a0879[_0x6d35('0x8d')]=moment()['format'](_0x6d35('0x7c'));logger[_0x6d35('0x51')](_0x6d35('0xb0'),_0xe7c47d[_0x6d35('0x4b')],util['inspect'](_0x4a0879,{'showHidden':![],'depth':null}));ami[_0x6d35('0x47')](_0x6d35('0xb1'),_0x4a0879);break;default:_0x4a0879[_0x6d35('0x9d')]=!![];_0x4a0879[_0x6d35('0xad')]=moment()['format'](_0x6d35('0x7c'));_0x4a0879[_0x6d35('0x8d')]=moment()[_0x6d35('0x4c')](_0x6d35('0x7c'));}_0x4a0879[_0x6d35('0x1d')]=![];_0x4a0879[_0x6d35('0x94')]=null;_0x4a0879[_0x6d35('0x53')]=_0xe7c47d[_0x6d35('0xa9')];this['channels'][_0xe7c47d['uniqueid']]=_0x4a0879;this[_0x6d35('0x45')](_0x4a0879,'varset');}else if(this[_0x6d35('0x68')](_0xe7c47d[_0x6d35('0xaa')])&&this['isNotNull'](_0xe7c47d[_0x6d35('0xaa')][_0x6d35('0xb2')])){if(!_0x4a0879['queuecallerabandon']){_0x4a0879[_0x6d35('0x9d')]=!![];_0x4a0879[_0x6d35('0xad')]=moment()[_0x6d35('0x4c')](_0x6d35('0x7c'));_0x4a0879[_0x6d35('0x53')]=_0x6d35('0xb3');_0x4a0879['queuecallerleaveAt']=moment()['format'](_0x6d35('0x7c'));this[_0x6d35('0x14')][_0xe7c47d[_0x6d35('0x4b')]]=_0x4a0879;}}logger[_0x6d35('0x70')](_0x6d35('0xb4'),_0xe7c47d[_0x6d35('0x4b')],_0x4a0879[_0x6d35('0x4e')],_0x4a0879[_0x6d35('0x5e')],_[_0x6d35('0x82')](_0xe7c47d[_0x6d35('0xaa')])[0x0],_0xe7c47d['value']);_0x4a0879[_0x6d35('0x17')]=this[_0x6d35('0x17')][_0xe7c47d[_0x6d35('0x4b')]];}}}}catch(_0x14889e){logger[_0x6d35('0x3f')](_0x6d35('0xb5'),_0xe7c47d[_0x6d35('0x4b')],util[_0x6d35('0x40')](_0x14889e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6d35('0xe')][_0x6d35('0xa8')]=function(_0x35fbfc,_0x417b6d,_0x5d6127){var _0x193837=[_0x6d35('0xb6'),_0x6d35('0xb7'),_0x6d35('0xb8'),_0x6d35('0xb9'),_0x6d35('0xba'),_0x6d35('0xbb'),_0x6d35('0xbc'),_0x6d35('0xbd'),_0x6d35('0xbe'),'sipuri',_0x6d35('0xbf'),_0x6d35('0xc0'),_0x6d35('0xc1'),_0x6d35('0xc2'),'memberinterface','memberlastcall',_0x6d35('0x96'),_0x6d35('0xc3'),'memberrealtime'];if(!_['isNil'](_0x417b6d)&&!_[_0x6d35('0xc4')](_0x193837,_0x417b6d)){if(_[_0x6d35('0x69')](this[_0x6d35('0x17')][_0x35fbfc])){this[_0x6d35('0x17')][_0x35fbfc]={};}this[_0x6d35('0x17')][_0x35fbfc][_0x417b6d]=_0x5d6127;}};VoiceQueueReport[_0x6d35('0xe')]['syncHangup']=function(_0x84e8da){try{if(this[_0x6d35('0x68')](_0x84e8da)){logger[_0x6d35('0x51')](_0x6d35('0xc5'),_0x84e8da[_0x6d35('0x4b')],util['inspect'](_0x84e8da,{'showHidden':![],'depth':null}));if(this[_0x6d35('0x12')][_0x84e8da[_0x6d35('0x4b')]]){for(var _0x2d914f=0x0,_0x3168fe={};_0x2d914f0x0?_0x535aa7:0x0;this[_0x9ece('0x14')][_0x4ec3b4['queue']][_0x9ece('0x71')]=this[_0x9ece('0x14')][_0x4ec3b4[_0x9ece('0x6b')]][_0x9ece('0x71')]>_[_0x9ece('0x6f')](_0x4ec3b4[_0x9ece('0x70')])?_[_0x9ece('0x6f')](_0x4ec3b4['loggedin']):this['voiceQueues'][_0x4ec3b4[_0x9ece('0x6b')]]['talking'];this[_0x9ece('0x4e')](this[_0x9ece('0x14')][_0x4ec3b4[_0x9ece('0x6b')]],_0x9ece('0x66'));}logger[_0x9ece('0x43')](_0x9ece('0x72'),util['inspect'](this[_0x9ece('0x14')][_0x4ec3b4[_0x9ece('0x6b')]],{'showHidden':![],'depth':null}));ami[_0x9ece('0x41')](_0x9ece('0x73'),this[_0x9ece('0x14')][_0x4ec3b4[_0x9ece('0x6b')]]);}}}catch(_0x194b23){logger[_0x9ece('0x3a')](_0x9ece('0x69'),util[_0x9ece('0x3b')](_0x194b23,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ece('0xc')][_0x9ece('0x18')]=function(_0x2c0bf0){logger[_0x9ece('0x43')](_0x9ece('0x74'),util[_0x9ece('0x3b')](_0x2c0bf0,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x9ece('0xc')][_0x9ece('0x1b')]=function(_0x260b5e){try{if(this[_0x9ece('0x62')](_0x260b5e)){logger[_0x9ece('0x43')](_0x9ece('0x75'),_0x260b5e[_0x9ece('0x45')],util[_0x9ece('0x3b')](_0x260b5e,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x9ece('0x11')][_0x260b5e['uniqueid']]))this['queueReports'][_0x260b5e[_0x9ece('0x45')]]=[];if(_[_0x9ece('0x63')](this['channels'][_0x260b5e[_0x9ece('0x45')]]))this[_0x9ece('0x31')][_0x260b5e[_0x9ece('0x45')]]={};var _0x2ccf98=new QueueReport();_0x2ccf98[_0x9ece('0x50')]=_0x260b5e['queue'];_0x2ccf98[_0x9ece('0x4f')]=this[_0x9ece('0x14')][_0x2ccf98['name']]&&this[_0x9ece('0x14')][_0x2ccf98['name']][_0x9ece('0x4f')]?this[_0x9ece('0x14')][_0x2ccf98['name']][_0x9ece('0x4f')]||_0x9ece('0x76'):_0x9ece('0x76');_0x2ccf98['queue']=_0x260b5e['queue'];_0x2ccf98[_0x9ece('0x77')]=moment()[_0x9ece('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x2ccf98[_0x9ece('0x78')]=_0x260b5e['position'];_0x2ccf98['count']=_0x260b5e[_0x9ece('0x79')];_0x2ccf98['uniqueid']=_0x260b5e[_0x9ece('0x45')];_0x2ccf98['routealias']=this['channels'][_0x260b5e[_0x9ece('0x45')]][_0x9ece('0x7a')];logger[_0x9ece('0x7b')](_0x9ece('0x7c'),_0x2ccf98[_0x9ece('0x50')],_0x2ccf98[_0x9ece('0x4f')]);_[_0x9ece('0x7d')](_0x2ccf98,_['pick'](_0x260b5e,_[_0x9ece('0x7e')](_0x2ccf98)));this['queueReports'][_0x260b5e[_0x9ece('0x45')]]['push'](_0x2ccf98);this['channels'][_0x260b5e['uniqueid']]=_0x2ccf98;this[_0x9ece('0x42')](_0x2ccf98,'queuecallerjoin');}}catch(_0x2c5965){logger[_0x9ece('0x3a')](_0x9ece('0x75'),_0x260b5e[_0x9ece('0x45')],util[_0x9ece('0x3b')](_0x2c5965,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x4fb833){try{if(this[_0x9ece('0x62')](_0x4fb833)){logger[_0x9ece('0x43')]('[%s][voiceQueueReport][queuecallerabandon]',_0x4fb833['uniqueid'],util[_0x9ece('0x3b')](_0x4fb833,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4fb833[_0x9ece('0x45')]]){var _0xa160c2=_[_0x9ece('0x7f')](this[_0x9ece('0x11')][_0x4fb833[_0x9ece('0x45')]]);_0xa160c2['queuecallercomplete']=![];_0xa160c2[_0x9ece('0x80')]=null;_0xa160c2['holdtime']=_0x4fb833[_0x9ece('0x81')];_0xa160c2[_0x9ece('0x82')]=_0x4fb833['originalposition'];_0xa160c2[_0x9ece('0x1c')]=!![];_0xa160c2[_0x9ece('0x83')]=moment()[_0x9ece('0x46')](_0x9ece('0x84'));_0xa160c2[_0x9ece('0x85')]=_0x9ece('0x86');_0xa160c2['lastAssignedTo']=null;logger[_0x9ece('0x7b')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0xa160c2[_0x9ece('0x50')],_0xa160c2[_0x9ece('0x4f')]);this['channels'][_0x4fb833[_0x9ece('0x45')]]=_0xa160c2;this['emitVoiceQueueChannelRemove'](_0xa160c2,_0x9ece('0x1c'));}}}catch(_0x5a7f9c){logger[_0x9ece('0x3a')](_0x9ece('0x87'),_0x4fb833['uniqueid'],util[_0x9ece('0x3b')](_0x5a7f9c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ece('0xc')][_0x9ece('0x1f')]=function(_0x1b721f){try{if(this[_0x9ece('0x62')](_0x1b721f)){logger['debug'](_0x9ece('0x88'),_0x1b721f[_0x9ece('0x45')],util[_0x9ece('0x3b')](_0x1b721f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1b721f['uniqueid']]){var _0x463f8=_[_0x9ece('0x7f')](this['queueReports'][_0x1b721f[_0x9ece('0x45')]]);_0x463f8[_0x9ece('0x89')]=moment()['format'](_0x9ece('0x84'));_0x463f8['connectedlinenum']=_0x1b721f['connectedlinenum'];_0x463f8[_0x9ece('0x8a')]=_0x1b721f[_0x9ece('0x8a')];logger[_0x9ece('0x7b')](_0x9ece('0x8b'),_0x463f8[_0x9ece('0x50')],_0x463f8['type'],_0x1b721f[_0x9ece('0x8c')],_0x1b721f[_0x9ece('0x8a')]);this['channels'][_0x1b721f[_0x9ece('0x45')]]=_0x463f8;this[_0x9ece('0x42')](_0x463f8,_0x9ece('0x1e'));}}}catch(_0x1338fd){logger[_0x9ece('0x3a')](_0x9ece('0x88'),_0x1b721f['uniqueid'],util[_0x9ece('0x3b')](_0x1338fd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ece('0xc')]['syncAgentConnect']=function(_0x3a6bbb){try{if(this[_0x9ece('0x62')](_0x3a6bbb)){logger[_0x9ece('0x43')](_0x9ece('0x8d'),_0x3a6bbb[_0x9ece('0x45')],util['inspect'](_0x3a6bbb,{'showHidden':![],'depth':null}));if(this[_0x9ece('0x11')][_0x3a6bbb['uniqueid']]){var _0x55ba43=_[_0x9ece('0x7f')](this[_0x9ece('0x11')][_0x3a6bbb[_0x9ece('0x45')]]);_0x55ba43[_0x9ece('0x8e')]=!![];_0x55ba43[_0x9ece('0x85')]=_0x9ece('0x8f');logger['info'](_0x9ece('0x90'),_0x55ba43[_0x9ece('0x50')],_0x55ba43[_0x9ece('0x4f')]);}}}catch(_0x28767a){logger[_0x9ece('0x3a')](_0x9ece('0x8d'),_0x3a6bbb[_0x9ece('0x45')],util['inspect'](_0x28767a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9ece('0x20')]=function(_0x440d2b){try{if(this[_0x9ece('0x62')](_0x440d2b)){logger[_0x9ece('0x43')](_0x9ece('0x91'),_0x440d2b[_0x9ece('0x45')],util[_0x9ece('0x3b')](_0x440d2b,{'showHidden':![],'depth':null}));if(this[_0x9ece('0x11')][_0x440d2b[_0x9ece('0x45')]]){var _0x7717df=_[_0x9ece('0x7f')](this[_0x9ece('0x11')][_0x440d2b[_0x9ece('0x45')]]);_0x7717df[_0x9ece('0x1c')]=![];_0x7717df[_0x9ece('0x83')]=null;_0x7717df[_0x9ece('0x92')]=!![];_0x7717df[_0x9ece('0x93')]=_0x440d2b['membername'];_0x7717df[_0x9ece('0x81')]=_0x440d2b[_0x9ece('0x81')];_0x7717df[_0x9ece('0x8e')]=!![];_0x7717df[_0x9ece('0x94')]=![];_0x7717df[_0x9ece('0x95')]=null;if(!_0x7717df['transfer']){if(_0x440d2b[_0x9ece('0x96')]==_0x9ece('0x97')){_0x7717df[_0x9ece('0x85')]=_0x9ece('0x98');logger[_0x9ece('0x7b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x7717df[_0x9ece('0x50')],_0x7717df['type']);}else{if(_[_0x9ece('0x99')](_0x440d2b[_0x9ece('0x36')][_0x9ece('0x9a')](),'local/')){if(this['queueReports'][_0x440d2b[_0x9ece('0x9b')]]){var _0x44d3fe=_['last'](this[_0x9ece('0x11')][_0x440d2b[_0x9ece('0x9b')]]);_0x44d3fe[_0x9ece('0x8e')]=![];_0x44d3fe[_0x9ece('0x94')]=!![];_0x44d3fe['queuecallerexitAt']=moment(_0x7717df[_0x9ece('0x77')])[_0x9ece('0x9c')](_0x440d2b[_0x9ece('0x81')],_0x9ece('0x9d'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x44d3fe[_0x9ece('0x85')]=_0x9ece('0x9e');_0x44d3fe['transfer']=!![];_0x44d3fe[_0x9ece('0x9f')]='FORWARD';_0x44d3fe[_0x9ece('0xa0')]=_0x440d2b[_0x9ece('0xa1')];_0x44d3fe[_0x9ece('0xa2')]=_0x440d2b[_0x9ece('0x45')];logger[_0x9ece('0x7b')](_0x9ece('0xa3'),_0x44d3fe['name'],_0x44d3fe['type']);var _0x1aa21e=this['queueReports'][_0x440d2b['linkedid']];this['queueReports'][_0x440d2b[_0x9ece('0x9b')]]=this[_0x9ece('0x11')][_0x440d2b[_0x9ece('0x45')]];this[_0x9ece('0x11')][_0x440d2b[_0x9ece('0x45')]]=_0x1aa21e;}}else{_0x7717df['queuecallerexitreason']=_0x9ece('0xa4')+_0x440d2b[_0x9ece('0x96')][_0x9ece('0xa5')]();logger['info'](_0x9ece('0xa6'),_0x7717df[_0x9ece('0x50')],_0x7717df[_0x9ece('0x4f')],_0x7717df[_0x9ece('0x85')]);}}}this[_0x9ece('0x31')][_0x440d2b[_0x9ece('0x45')]]=_0x7717df;this[_0x9ece('0x3f')](_0x7717df,_0x9ece('0xa7'));}}}catch(_0x35f800){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x440d2b[_0x9ece('0x45')],util[_0x9ece('0x3b')](_0x35f800,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ece('0xc')]['syncVarSet']=function(_0x156746){try{if(this['isNotNull'](_0x156746)){logger[_0x9ece('0x43')](_0x9ece('0xa8'),_0x156746[_0x9ece('0x45')],util[_0x9ece('0x3b')](_0x156746,{'showHidden':![],'depth':null}));this['addVariable'](_0x156746[_0x9ece('0x45')],_[_0x9ece('0x7e')](_0x156746[_0x9ece('0xa9')])[0x0],_0x156746[_0x9ece('0xaa')]);if(this[_0x9ece('0x11')][_0x156746[_0x9ece('0x45')]]){var _0x117c0c=_[_0x9ece('0x7f')](this['queueReports'][_0x156746['uniqueid']]);if(_0x117c0c){if(this['isNotNull'](_0x156746[_0x9ece('0xa9')])&&this['isNotNull'](_0x156746[_0x9ece('0xa9')][_0x9ece('0xab')])){switch(_0x156746[_0x9ece('0xaa')]){case _0x9ece('0xac'):_0x117c0c['queuecallerexit']=![];_0x117c0c[_0x9ece('0x95')]=null;break;case _0x9ece('0xad'):_0x117c0c[_0x9ece('0xae')]=_0x9ece('0xaf');_0x117c0c['queuecallerexit']=!![];_0x117c0c[_0x9ece('0x95')]=moment()[_0x9ece('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x117c0c[_0x9ece('0x89')]=moment()[_0x9ece('0x46')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x9ece('0x43')](_0x9ece('0xb0'),_0x156746[_0x9ece('0x45')],util['inspect'](_0x117c0c,{'showHidden':![],'depth':null}));ami[_0x9ece('0x41')](_0x9ece('0xb1'),_0x117c0c);break;default:_0x117c0c[_0x9ece('0x94')]=!![];_0x117c0c[_0x9ece('0x95')]=moment()[_0x9ece('0x46')](_0x9ece('0x84'));_0x117c0c[_0x9ece('0x89')]=moment()[_0x9ece('0x46')](_0x9ece('0x84'));}_0x117c0c[_0x9ece('0x1c')]=![];_0x117c0c[_0x9ece('0x83')]=null;_0x117c0c[_0x9ece('0x85')]=_0x156746[_0x9ece('0xaa')];this[_0x9ece('0x31')][_0x156746['uniqueid']]=_0x117c0c;this[_0x9ece('0x3f')](_0x117c0c,_0x9ece('0xb2'));}else if(this[_0x9ece('0x62')](_0x156746['variable'])&&this[_0x9ece('0x62')](_0x156746[_0x9ece('0xa9')][_0x9ece('0xb3')])){if(!_0x117c0c[_0x9ece('0x1c')]){_0x117c0c[_0x9ece('0x94')]=!![];_0x117c0c[_0x9ece('0x95')]=moment()[_0x9ece('0x46')](_0x9ece('0x84'));_0x117c0c[_0x9ece('0x85')]=_0x9ece('0xb4');_0x117c0c[_0x9ece('0x89')]=moment()[_0x9ece('0x46')](_0x9ece('0x84'));this[_0x9ece('0x31')][_0x156746[_0x9ece('0x45')]]=_0x117c0c;}}logger[_0x9ece('0x7b')](_0x9ece('0xb5'),_0x156746['uniqueid'],_0x117c0c['name'],_0x117c0c['type'],_[_0x9ece('0x7e')](_0x156746[_0x9ece('0xa9')])[0x0],_0x156746[_0x9ece('0xaa')]);_0x117c0c['variables']=this[_0x9ece('0x16')][_0x156746[_0x9ece('0x45')]];}}}}catch(_0x3346e8){logger['error'](_0x9ece('0xa8'),_0x156746[_0x9ece('0x45')],util[_0x9ece('0x3b')](_0x3346e8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ece('0xc')][_0x9ece('0xb6')]=function(_0x182891,_0x38f549,_0xdcb973){var _0x485fa2=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x9ece('0xb7'),_0x9ece('0xb8'),'rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid',_0x9ece('0xb9'),_0x9ece('0xba'),_0x9ece('0xbb'),_0x9ece('0xbc'),_0x9ece('0xbd'),_0x9ece('0xbe'),_0x9ece('0xbf'),'membername','memberpenalty',_0x9ece('0xc0')];if(!_['isNil'](_0x38f549)&&!_['includes'](_0x485fa2,_0x38f549)){if(_[_0x9ece('0x63')](this['variables'][_0x182891])){this[_0x9ece('0x16')][_0x182891]={};}this[_0x9ece('0x16')][_0x182891][_0x38f549]=_0xdcb973;}};VoiceQueueReport['prototype'][_0x9ece('0x24')]=function(_0x116434){try{if(this[_0x9ece('0x62')](_0x116434)){logger['debug'](_0x9ece('0xc1'),_0x116434[_0x9ece('0x45')],util[_0x9ece('0x3b')](_0x116434,{'showHidden':![],'depth':null}));if(this[_0x9ece('0x11')][_0x116434[_0x9ece('0x45')]]){for(var _0x1bf658=0x0,_0x4b8134={};_0x1bf658=0x0?moment(_0x3af91a[_0xb4ec('0x19')])[_0xb4ec('0xd')](_0x3af91a['starttime'],_0xb4ec('0xe')):null,'data1':_0xb4ec('0x1a'),'data2':_0x3af91a['accountcode'],'data3':_0x3af91a[_0xb4ec('0x11')],'data4':_0x3af91a[_0xb4ec('0x1b')]||null,'role':_0xb4ec('0x13'),'internal':_0x3af91a[_0xb4ec('0x14')]?_[_0xb4ec('0x15')](_0x3af91a['accountcode']):undefined,'uniqueid':_0x3af91a[_0xb4ec('0x16')]},'log':_0xb4ec('0x7')});}; \ No newline at end of file +var _0xa6d1=['diff','outbound','moment','util','../client','queuecallercompleteAt','CreateMemberReport','voice','lastAssignedTo','isNil','SIP/%s','interface','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','Request','membername','starttime','endtime'];(function(_0x35c79f,_0x478647){var _0x209658=function(_0x112211){while(--_0x112211){_0x35c79f['push'](_0x35c79f['shift']());}};_0x209658(++_0x478647);}(_0xa6d1,0x8e));var _0x1a6d=function(_0x56d879,_0x143071){_0x56d879=_0x56d879-0x0;var _0x3ac07d=_0xa6d1[_0x56d879];return _0x3ac07d;};'use strict';var moment=require(_0x1a6d('0x0'));var _=require('lodash');var util=require(_0x1a6d('0x1'));var client=require(_0x1a6d('0x2'));exports['voiceQueueReport']=function(_0x47dea4){var _0x1dd028=_0x47dea4[_0x1a6d('0x3')]||_0x47dea4['queuecallerexitAt'];return client['Request'](_0x1a6d('0x4'),{'body':{'channel':_0x1a6d('0x5'),'membername':_0x47dea4[_0x1a6d('0x6')],'interface':_[_0x1a6d('0x7')](_0x47dea4['interface'])?util['format'](_0x1a6d('0x8'),_0x47dea4[_0x1a6d('0x6')]):_0x47dea4[_0x1a6d('0x9')],'type':_0x1a6d('0xa'),'enterAt':_0x47dea4[_0x1a6d('0xb')],'exitAt':_0x1dd028,'duration':moment(_0x1dd028)['diff'](_0x47dea4[_0x1a6d('0xb')],_0x1a6d('0xc')),'data1':_0x1a6d('0xd'),'data2':_0x47dea4[_0x1a6d('0xe')],'data3':_0x47dea4[_0x1a6d('0xf')],'data4':null,'data5':_0x47dea4[_0x1a6d('0x10')],'role':_0x1a6d('0x11'),'internal':_0x47dea4[_0x1a6d('0x12')]?_[_0x1a6d('0x13')](_0x47dea4['accountcode']):undefined,'uniqueid':_0x47dea4[_0x1a6d('0x14')]},'log':_0x1a6d('0x4')});};exports[_0x1a6d('0x15')]=function(_0x223d6c){return client[_0x1a6d('0x16')](_0x1a6d('0x4'),{'body':{'channel':'voice','membername':_0x223d6c[_0x1a6d('0x17')],'interface':_0x223d6c[_0x1a6d('0x9')],'type':_0x1a6d('0xa'),'enterAt':_0x223d6c[_0x1a6d('0x18')],'exitAt':_0x223d6c['endtime'],'duration':moment(_0x223d6c[_0x1a6d('0x19')])[_0x1a6d('0x1a')](_0x223d6c[_0x1a6d('0x18')],_0x1a6d('0xc'))>=0x0?moment(_0x223d6c['endtime'])[_0x1a6d('0x1a')](_0x223d6c[_0x1a6d('0x18')],_0x1a6d('0xc')):null,'data1':_0x1a6d('0x1b'),'data2':_0x223d6c[_0x1a6d('0x12')],'data3':_0x223d6c[_0x1a6d('0xf')],'data4':_0x223d6c['dialstring']||null,'role':_0x1a6d('0x11'),'internal':_0x223d6c[_0x1a6d('0x12')]?_[_0x1a6d('0x13')](_0x223d6c[_0x1a6d('0x12')]):undefined,'uniqueid':_0x223d6c[_0x1a6d('0x14')]},'log':_0x1a6d('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 08b9314..867bbdb 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 _0x9d5b=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','getSettings','Request'];(function(_0x1dda19,_0x3483d7){var _0x3cea59=function(_0x44a66b){while(--_0x44a66b){_0x1dda19['push'](_0x1dda19['shift']());}};_0x3cea59(++_0x3483d7);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x10eaa6,_0x5f4f5b){_0x10eaa6=_0x10eaa6-0x0;var _0x8a52d6=_0x9d5b[_0x10eaa6];return _0x8a52d6;};'use strict';var client=require('../client');exports[_0xb9d5('0x0')]=function(){return client[_0xb9d5('0x1')](_0xb9d5('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb9d5('0x3'),_0xb9d5('0x4')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x1541=['GetSettings','getSettings','ShowSetting','previewRecallmeReminderInterval'];(function(_0x57541f,_0xa48e85){var _0x4bfef3=function(_0x24ba05){while(--_0x24ba05){_0x57541f['push'](_0x57541f['shift']());}};_0x4bfef3(++_0xa48e85);}(_0x1541,0xb9));var _0x1154=function(_0x1fb1c1,_0x4ebe69){_0x1fb1c1=_0x1fb1c1-0x0;var _0x1622df=_0x1541[_0x1fb1c1];return _0x1622df;};'use strict';var client=require('../client');exports[_0x1154('0x0')]=function(){return client['Request'](_0x1154('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x1154('0x2')]},'log':_0x1154('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 94c8406..a0a950b 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 _0xe354=['html','GetTemplate'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xe354,0x187));var _0x4e35=function(_0x4a2aed,_0x2a4c3d){_0x4a2aed=_0x4a2aed-0x0;var _0x2e5c36=_0xe354[_0x4a2aed];return _0x2e5c36;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x298132){return function(_0x2877c2){return client['Request'](_0x4e35('0x0'),{'options':{'raw':!![],'attributes':['id','name',_0x4e35('0x1')]},'log':_0x4e35('0x0')});};}; \ No newline at end of file +var _0x3eea=['html','../client','getTemplates','Request','GetTemplate','name'];(function(_0x3d50d7,_0x12c80e){var _0x451a13=function(_0x1e2356){while(--_0x1e2356){_0x3d50d7['push'](_0x3d50d7['shift']());}};_0x451a13(++_0x12c80e);}(_0x3eea,0x1bd));var _0xa3ee=function(_0x4bca73,_0x28d106){_0x4bca73=_0x4bca73-0x0;var _0x4c55e8=_0x3eea[_0x4bca73];return _0x4c55e8;};'use strict';var client=require(_0xa3ee('0x0'));exports[_0xa3ee('0x1')]=function(_0x6d37b6){return function(_0x5d1ac3){return client[_0xa3ee('0x2')](_0xa3ee('0x3'),{'options':{'raw':!![],'attributes':['id',_0xa3ee('0x4'),_0xa3ee('0x5')]},'log':_0xa3ee('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 1cab320..7a766c5 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 _0xbaca=['Condition','AnyConditions','field','operator','Action','Actions','action','data1','data3','data4','data5','data6','data7','../client','Request','GetTrigger','status','AllConditions','value'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xbaca,0x189));var _0xabac=function(_0xfb42e6,_0x5f5d4b){_0xfb42e6=_0xfb42e6-0x0;var _0x27265b=_0xbaca[_0xfb42e6];return _0x27265b;};'use strict';var client=require(_0xabac('0x0'));exports['getTriggers']=function(_0xfc7f5){return function(_0x29f17a){return client[_0xabac('0x1')](_0xabac('0x2'),{'options':{'raw':![],'attributes':['id','name','channel',_0xabac('0x3')],'include':[{'model':'Condition','as':_0xabac('0x4'),'attributes':['id','field','operator',_0xabac('0x5')]},{'model':_0xabac('0x6'),'as':_0xabac('0x7'),'attributes':['id',_0xabac('0x8'),_0xabac('0x9'),_0xabac('0x5')]},{'model':_0xabac('0xa'),'as':_0xabac('0xb'),'attributes':['id',_0xabac('0xc'),_0xabac('0xd'),'data2',_0xabac('0xe'),_0xabac('0xf'),_0xabac('0x10'),_0xabac('0x11'),_0xabac('0x12')]}]},'log':_0xabac('0x2')});};}; \ No newline at end of file +var _0x0f8b=['data1','data2','data3','data4','data5','data6','data7','GetTrigger','../client','Request','name','channel','status','field','operator','AnyConditions','value','Action','Actions','action'];(function(_0x4f9bb,_0x2824c9){var _0x39d593=function(_0xd7a50){while(--_0xd7a50){_0x4f9bb['push'](_0x4f9bb['shift']());}};_0x39d593(++_0x2824c9);}(_0x0f8b,0x148));var _0xb0f8=function(_0x1d4931,_0x2ee209){_0x1d4931=_0x1d4931-0x0;var _0x3c7b63=_0x0f8b[_0x1d4931];return _0x3c7b63;};'use strict';var client=require(_0xb0f8('0x0'));exports['getTriggers']=function(_0x38f820){return function(_0x320ee4){return client[_0xb0f8('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xb0f8('0x2'),_0xb0f8('0x3'),_0xb0f8('0x4')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0xb0f8('0x5'),_0xb0f8('0x6'),'value']},{'model':'Condition','as':_0xb0f8('0x7'),'attributes':['id',_0xb0f8('0x5'),'operator',_0xb0f8('0x8')]},{'model':_0xb0f8('0x9'),'as':_0xb0f8('0xa'),'attributes':['id',_0xb0f8('0xb'),_0xb0f8('0xc'),_0xb0f8('0xd'),_0xb0f8('0xe'),_0xb0f8('0xf'),_0xb0f8('0x10'),_0xb0f8('0x11'),_0xb0f8('0x12')]}]},'log':_0xb0f8('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 130bf67..82c0517 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 _0x430e=['registry','getTrunks','Request','GetTrunk','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x430e,0x105));var _0xe430=function(_0x13fdb3,_0x493557){_0x13fdb3=_0x13fdb3-0x0;var _0x212e46=_0x430e[_0x13fdb3];return _0x212e46;};'use strict';var client=require('../client');exports[_0xe430('0x0')]=function(_0x2984a5){return function(_0x4eaa9b){return client[_0xe430('0x1')](_0xe430('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe430('0x3'),_0xe430('0x4'),'defaultuser']},'log':_0xe430('0x2')});};}; \ No newline at end of file +var _0x8ce3=['getTrunks','Request','GetTrunk','name','registry','defaultuser','../client'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8ce3,0xc3));var _0x38ce=function(_0x5e2a0f,_0x447ab4){_0x5e2a0f=_0x5e2a0f-0x0;var _0x3e8c10=_0x8ce3[_0x5e2a0f];return _0x3e8c10;};'use strict';var client=require(_0x38ce('0x0'));exports[_0x38ce('0x1')]=function(_0x48fa0e){return function(_0x24be90){return client[_0x38ce('0x2')](_0x38ce('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x38ce('0x4'),_0x38ce('0x5'),_0x38ce('0x6')]},'log':_0x38ce('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 5f6b035..31d8c77 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(_0x4f1878,_0x219cf7){var _0x4a6753=function(_0x5bcca6){while(--_0x5bcca6){_0x4f1878['push'](_0x4f1878['shift']());}};_0x4a6753(++_0x219cf7);}(_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(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xe706,0xa3));var _0x6e70=function(_0x13062b,_0x285d7d){_0x13062b=_0x13062b-0x0;var _0x564586=_0xe706[_0x13062b];return _0x564586;};'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 c01c679..605ccae 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 _0x193d=['update','Request','UpdateVoiceAgentReport','../client','create'];(function(_0x307ca8,_0x38cbb6){var _0x5cdcc9=function(_0x16f546){while(--_0x16f546){_0x307ca8['push'](_0x307ca8['shift']());}};_0x5cdcc9(++_0x38cbb6);}(_0x193d,0x76));var _0xd193=function(_0xdbe2de,_0x3bdc5a){_0xdbe2de=_0xdbe2de-0x0;var _0x2facd7=_0x193d[_0xdbe2de];return _0x2facd7;};'use strict';var client=require(_0xd193('0x0'));exports[_0xd193('0x1')]=function(_0x30c0a1){return client['Request']('CreateVoiceAgentReport',{'body':_0x30c0a1,'log':'CreateVoiceAgentReport'});};exports[_0xd193('0x2')]=function(_0x5c4a83,_0x5d7f71,_0x13400c){return client[_0xd193('0x3')](_0xd193('0x4'),{'body':_0x5c4a83,'options':{'where':{'uniqueid':_0x5d7f71,'interface':_0x13400c,'agentcomplete':!![]}},'log':_0xd193('0x4')});}; \ No newline at end of file +var _0x19f7=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x565c9d,_0x1127c9){var _0x5036b9=function(_0x16aaed){while(--_0x16aaed){_0x565c9d['push'](_0x565c9d['shift']());}};_0x5036b9(++_0x1127c9);}(_0x19f7,0x1dc));var _0x719f=function(_0x3a6be7,_0x15221f){_0x3a6be7=_0x3a6be7-0x0;var _0x355772=_0x19f7[_0x3a6be7];return _0x355772;};'use strict';var client=require(_0x719f('0x0'));exports[_0x719f('0x1')]=function(_0x392476){return client[_0x719f('0x2')](_0x719f('0x3'),{'body':_0x392476,'log':'CreateVoiceAgentReport'});};exports[_0x719f('0x4')]=function(_0x4be062,_0x15077c,_0xf8f46e){return client[_0x719f('0x2')](_0x719f('0x5'),{'body':_0x4be062,'options':{'where':{'uniqueid':_0x15077c,'interface':_0xf8f46e,'agentcomplete':!![]}},'log':_0x719f('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index a6b3f5a..aadf8b8 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 _0xe911=['disposition','duration','billableseconds','GetVoiceCallReports','util','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','format','YYYY-MM-DD\x20HH:mm:ss','day','type'];(function(_0xdfe674,_0x32e0d0){var _0x4e97f5=function(_0xb154b6){while(--_0xb154b6){_0xdfe674['push'](_0xdfe674['shift']());}};_0x4e97f5(++_0x32e0d0);}(_0xe911,0x70));var _0x1e91=function(_0x40a0a3,_0x1c63df){_0x40a0a3=_0x40a0a3-0x0;var _0x9e1931=_0xe911[_0x40a0a3];return _0x9e1931;};'use strict';var moment=require('moment');var util=require(_0x1e91('0x0'));var _=require('lodash');var client=require('../client');exports[_0x1e91('0x1')]=function(_0x4e5ee6){return client[_0x1e91('0x2')](_0x1e91('0x3'),{'body':_[_0x1e91('0x4')](_0x4e5ee6,{'source':_0x4e5ee6[_0x1e91('0x5')],'destinationcontext':_0x4e5ee6[_0x1e91('0x6')],'callerid':_0x4e5ee6[_0x1e91('0x7')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x1e91('0x8')]=function(){return function(){return client[_0x1e91('0x2')](_0x1e91('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf']('day')[_0x1e91('0xa')](_0x1e91('0xb')),moment()['endOf'](_0x1e91('0xc'))[_0x1e91('0xa')](_0x1e91('0xb'))]}},'attributes':[_0x1e91('0xd'),_0x1e91('0xe'),_0x1e91('0xf'),_0x1e91('0x10')]},'log':_0x1e91('0x11')});};}; \ No newline at end of file +var _0xaf46=['disposition','moment','../client','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type'];(function(_0x4b111b,_0x40f266){var _0x20f81e=function(_0x16c36e){while(--_0x16c36e){_0x4b111b['push'](_0x4b111b['shift']());}};_0x20f81e(++_0x40f266);}(_0xaf46,0x1dd));var _0x6af4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xaf46[_0x122ef9];return _0x42fba0;};'use strict';var moment=require(_0x6af4('0x0'));var util=require('util');var _=require('lodash');var client=require(_0x6af4('0x1'));exports['create']=function(_0x15ca21){return client[_0x6af4('0x2')](_0x6af4('0x3'),{'body':_[_0x6af4('0x4')](_0x15ca21,{'source':_0x15ca21[_0x6af4('0x5')],'destinationcontext':_0x15ca21['context'],'callerid':_0x15ca21[_0x6af4('0x6')],'amaflags':_0x6af4('0x7')}),'log':_0x6af4('0x3')});};exports[_0x6af4('0x8')]=function(){return function(){return client['Request'](_0x6af4('0x9'),{'options':{'where':{'type':[_0x6af4('0xa')],'createdAt':{'$between':[moment()[_0x6af4('0xb')](_0x6af4('0xc'))[_0x6af4('0xd')](_0x6af4('0xe')),moment()['endOf'](_0x6af4('0xc'))[_0x6af4('0xd')](_0x6af4('0xe'))]}},'attributes':[_0x6af4('0xf'),_0x6af4('0x10'),'duration','billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 70a5652..506f05f 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 _0x788e=['CreateVoiceDialReport','../client','create','Request'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x788e,0x1d1));var _0xe788=function(_0x37347a,_0x45f7c3){_0x37347a=_0x37347a-0x0;var _0x44ab9b=_0x788e[_0x37347a];return _0x44ab9b;};'use strict';var client=require(_0xe788('0x0'));exports[_0xe788('0x1')]=function(_0x2f3f21){return client[_0xe788('0x2')]('CreateVoiceDialReport',{'body':_0x2f3f21,'log':_0xe788('0x3')});}; \ No newline at end of file +var _0x4be4=['CreateVoiceDialReport','../client','create','Request'];(function(_0x585092,_0x44ac6b){var _0x13cd7d=function(_0x4a4fab){while(--_0x4a4fab){_0x585092['push'](_0x585092['shift']());}};_0x13cd7d(++_0x44ac6b);}(_0x4be4,0x1c1));var _0x44be=function(_0x444070,_0x3b35ea){_0x444070=_0x444070-0x0;var _0x44104a=_0x4be4[_0x444070];return _0x44104a;};'use strict';var client=require(_0x44be('0x0'));exports[_0x44be('0x1')]=function(_0x3a014b){return client[_0x44be('0x2')](_0x44be('0x3'),{'body':_0x3a014b,'log':_0x44be('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index dfca2da..2273c4b 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 _0x4a47=['exten','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x594f3f,_0x3c719a){var _0x87783d=function(_0x37a5d0){while(--_0x37a5d0){_0x594f3f['push'](_0x594f3f['shift']());}};_0x87783d(++_0x3c719a);}(_0x4a47,0xb5));var _0x74a4=function(_0x451980,_0x2ad060){_0x451980=_0x451980-0x0;var _0x3a66cf=_0x4a47[_0x451980];return _0x3a66cf;};'use strict';var client=require(_0x74a4('0x0'));exports[_0x74a4('0x1')]=function(){return function(){return client[_0x74a4('0x2')](_0x74a4('0x3'),{'options':{'raw':!![],'attributes':['id',_0x74a4('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x74a4('0x1')});};}; \ No newline at end of file +var _0xdace=['exten','getVoiceExtensions','../client','Request','GetVoiceExtension'];(function(_0x2f7e2a,_0x1de117){var _0x25ba6d=function(_0x3041a3){while(--_0x3041a3){_0x2f7e2a['push'](_0x2f7e2a['shift']());}};_0x25ba6d(++_0x1de117);}(_0xdace,0xc5));var _0xedac=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xdace[_0x28394f];return _0x2618d2;};'use strict';var client=require(_0xedac('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xedac('0x1')](_0xedac('0x2'),{'options':{'raw':!![],'attributes':['id',_0xedac('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xedac('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index f520d0f..1ccc79a 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 _0xb555=['dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','name','callerid','Pause','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix'];(function(_0x204fc1,_0x18363d){var _0x462db4=function(_0x821cdf){while(--_0x821cdf){_0x204fc1['push'](_0x204fc1['shift']());}};_0x462db4(++_0x18363d);}(_0xb555,0xe5));var _0x5b55=function(_0x37102a,_0x46bec6){_0x37102a=_0x37102a-0x0;var _0x39137b=_0xb555[_0x37102a];return _0x39137b;};'use strict';var client=require(_0x5b55('0x0'));exports[_0x5b55('0x1')]=function(){return function(){return client[_0x5b55('0x2')](_0x5b55('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x5b55('0x4'),_0x5b55('0x5'),_0x5b55('0x6'),_0x5b55('0x7'),_0x5b55('0x8'),_0x5b55('0x9'),_0x5b55('0xa'),'dialLimitChannel',_0x5b55('0xb'),_0x5b55('0xc'),_0x5b55('0xd'),_0x5b55('0xe'),_0x5b55('0xf'),_0x5b55('0x10'),_0x5b55('0x11'),_0x5b55('0x12'),_0x5b55('0x13'),'dialQueueTimeout',_0x5b55('0x14'),_0x5b55('0x15'),_0x5b55('0x16'),_0x5b55('0x17'),_0x5b55('0x18'),_0x5b55('0x19'),_0x5b55('0x1a'),_0x5b55('0x1b'),_0x5b55('0x1c'),_0x5b55('0x1d'),_0x5b55('0x1e'),_0x5b55('0x1f'),_0x5b55('0x20'),_0x5b55('0x21'),_0x5b55('0x22'),_0x5b55('0x23'),_0x5b55('0x24'),_0x5b55('0x25'),_0x5b55('0x26'),'dialAMDMaximumNumberOfWords',_0x5b55('0x27'),_0x5b55('0x28'),'timeout',_0x5b55('0x29'),_0x5b55('0x2a'),_0x5b55('0x2b'),'dialAgiAfterHangupAgent',_0x5b55('0x2c'),_0x5b55('0x2d'),_0x5b55('0x7'),_0x5b55('0x2e'),_0x5b55('0x2f'),_0x5b55('0x30'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0x5b55('0x31'),_0x5b55('0x32'),'dialAbandonedMaxRetry',_0x5b55('0x33'),'dialMachineMaxRetry',_0x5b55('0x34'),'dialAgentRejectMaxRetry',_0x5b55('0x35'),_0x5b55('0x36'),_0x5b55('0x37'),_0x5b55('0x38'),'dialPreviewAutoRecallMe',_0x5b55('0x39')],'include':[{'model':'Trunk','as':_0x5b55('0x3a'),'attributes':['id',_0x5b55('0x3b'),_0x5b55('0x3c'),'active']},{'model':_0x5b55('0x3d'),'as':'mandatoryDispositionPause','attributes':['id',_0x5b55('0x3b')]},{'model':_0x5b55('0x3a'),'as':_0x5b55('0x3e'),'attributes':['id',_0x5b55('0x3b'),_0x5b55('0x3c'),'active']},{'model':_0x5b55('0x3f'),'as':_0x5b55('0x3f'),'attributes':['id',_0x5b55('0x3b')],'include':[{'model':_0x5b55('0x3f'),'as':_0x5b55('0x40'),'attributes':['id',_0x5b55('0x3b'),'interval']}]}]},'log':_0x5b55('0x1')});};}; \ No newline at end of file +var _0x7dca=['dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7dca,0x16b));var _0xa7dc=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x7dca[_0x3430aa];return _0x2ac5c;};'use strict';var client=require(_0xa7dc('0x0'));exports[_0xa7dc('0x1')]=function(){return function(){return client[_0xa7dc('0x2')](_0xa7dc('0x3'),{'options':{'raw':![],'attributes':['id',_0xa7dc('0x4'),_0xa7dc('0x5'),_0xa7dc('0x6'),_0xa7dc('0x7'),_0xa7dc('0x8'),'type','dialActive',_0xa7dc('0x9'),_0xa7dc('0xa'),_0xa7dc('0xb'),_0xa7dc('0xc'),_0xa7dc('0xd'),_0xa7dc('0xe'),'dialPredictiveInterval',_0xa7dc('0xf'),_0xa7dc('0x10'),_0xa7dc('0x11'),_0xa7dc('0x12'),'dialQueueTimeout',_0xa7dc('0x13'),_0xa7dc('0x14'),_0xa7dc('0x15'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0xa7dc('0x16'),_0xa7dc('0x17'),_0xa7dc('0x18'),'dialTimezone','dialGlobalInterval','dialPrefix',_0xa7dc('0x19'),'dialAMDActive',_0xa7dc('0x1a'),_0xa7dc('0x1b'),_0xa7dc('0x1c'),'dialAMDTotalAnalysisTime',_0xa7dc('0x1d'),_0xa7dc('0x1e'),_0xa7dc('0x1f'),_0xa7dc('0x20'),_0xa7dc('0x21'),_0xa7dc('0x22'),_0xa7dc('0x23'),_0xa7dc('0x24'),'dialOrderByScheduledAt',_0xa7dc('0x25'),'dialAgiAfterHangupClient',_0xa7dc('0x26'),_0xa7dc('0x8'),'strategy',_0xa7dc('0x27'),_0xa7dc('0x28'),_0xa7dc('0x29'),'dialNoSuchNumberRetryFrequency',_0xa7dc('0x2a'),_0xa7dc('0x2b'),_0xa7dc('0x2c'),_0xa7dc('0x2d'),_0xa7dc('0x2e'),_0xa7dc('0x2f'),_0xa7dc('0x30'),_0xa7dc('0x31'),_0xa7dc('0x32'),_0xa7dc('0x33'),_0xa7dc('0x34'),_0xa7dc('0x35'),_0xa7dc('0x36')],'include':[{'model':'Trunk','as':_0xa7dc('0x37'),'attributes':['id','name',_0xa7dc('0x38'),_0xa7dc('0x39')]},{'model':_0xa7dc('0x3a'),'as':_0xa7dc('0x3b'),'attributes':['id',_0xa7dc('0x4')]},{'model':_0xa7dc('0x37'),'as':_0xa7dc('0x3c'),'attributes':['id',_0xa7dc('0x4'),'callerid',_0xa7dc('0x39')]},{'model':_0xa7dc('0x3d'),'as':'Interval','attributes':['id',_0xa7dc('0x4')],'include':[{'model':_0xa7dc('0x3d'),'as':_0xa7dc('0x3e'),'attributes':['id',_0xa7dc('0x4'),_0xa7dc('0x3f')]}]}]},'log':_0xa7dc('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 28b6a63..a9cb0be 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(_0x13ec0f,_0x57e222){var _0xaa680f=function(_0x10a686){while(--_0x10a686){_0x13ec0f['push'](_0x13ec0f['shift']());}};_0xaa680f(++_0x57e222);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x3164dd,_0x27fa29){var _0x591a0a=function(_0x523053){while(--_0x523053){_0x3164dd['push'](_0x3164dd['shift']());}};_0x591a0a(++_0x27fa29);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 699f4f2..1d62956 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 _0xb57f=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x36bff5,_0x3156cb){var _0x80ade5=function(_0x5eee65){while(--_0x5eee65){_0x36bff5['push'](_0x36bff5['shift']());}};_0x80ade5(++_0x3156cb);}(_0xb57f,0x157));var _0xfb57=function(_0x145f74,_0x346ce8){_0x145f74=_0x145f74-0x0;var _0x13ec90=_0xb57f[_0x145f74];return _0x13ec90;};'use strict';var client=require(_0xfb57('0x0'));exports[_0xfb57('0x1')]=function(_0x11b5ec){return function(){return client[_0xfb57('0x2')](_0xfb57('0x3'),{'options':{'where':{'VoiceQueueId':_0x11b5ec,'paused':!![]},'raw':!![]},'log':_0xfb57('0x1')});};}; \ No newline at end of file +var _0xab5b=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xab5b,0x97));var _0xbab5=function(_0x410e29,_0x49be5b){_0x410e29=_0x410e29-0x0;var _0x1f427d=_0xab5b[_0x410e29];return _0x1f427d;};'use strict';var client=require(_0xbab5('0x0'));exports['getVoiceQueueRtPauses']=function(_0x157345){return function(){return client[_0xbab5('0x1')](_0xbab5('0x2'),{'options':{'where':{'VoiceQueueId':_0x157345,'paused':!![]},'raw':!![]},'log':_0xbab5('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 9deb6d1..ec49b6b 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x567616,_0x2a1cc3){var _0x4f8bbf=function(_0x15bbbe){while(--_0x15bbbe){_0x567616['push'](_0x567616['shift']());}};_0x4f8bbf(++_0x2a1cc3);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x238108,_0x180909){var _0x186962=function(_0x4aa316){while(--_0x4aa316){_0x238108['push'](_0x238108['shift']());}};_0x186962(++_0x180909);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 bc5a632..6a9ebd0 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 _0x1fe0=['CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','attended','../client','blindTransfer','Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','blind'];(function(_0x2e9ba3,_0x49161b){var _0x3c1d8a=function(_0x321ac6){while(--_0x321ac6){_0x2e9ba3['push'](_0x2e9ba3['shift']());}};_0x3c1d8a(++_0x49161b);}(_0x1fe0,0x183));var _0x01fe=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0x1fe0[_0x1c34e7];return _0x378cb1;};'use strict';var client=require(_0x01fe('0x0'));exports['transfers']={};exports[_0x01fe('0x1')]=function(_0x4c28e4){return client[_0x01fe('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x4c28e4[_0x01fe('0x3')],'transfererchannel':_0x4c28e4[_0x01fe('0x4')],'transferercalleridnum':_0x4c28e4[_0x01fe('0x5')],'transferercalleridname':_0x4c28e4[_0x01fe('0x6')],'transfererconnectedlinenum':_0x4c28e4[_0x01fe('0x7')],'transfererconnectedlinename':_0x4c28e4[_0x01fe('0x8')],'transfereraccountcode':_0x4c28e4[_0x01fe('0x9')],'transferercontext':_0x4c28e4[_0x01fe('0xa')],'transfererexten':_0x4c28e4[_0x01fe('0xb')],'transfererlinkedid':_0x4c28e4[_0x01fe('0xc')],'transfereechannel':_0x4c28e4[_0x01fe('0xd')],'transfereecalleridnum':_0x4c28e4[_0x01fe('0xe')],'transfereecalleridname':_0x4c28e4['transfereecalleridname'],'transfereeconnectedlinenum':_0x4c28e4['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x4c28e4[_0x01fe('0xf')],'transfereeaccountcode':_0x4c28e4[_0x01fe('0x10')],'transfereecontext':_0x4c28e4[_0x01fe('0x11')],'transfereeexten':_0x4c28e4[_0x01fe('0x12')],'transfereelinkedid':_0x4c28e4['transfereelinkedid'],'isexternal':_0x4c28e4[_0x01fe('0x13')],'context':_0x4c28e4[_0x01fe('0x14')],'extension':_0x4c28e4[_0x01fe('0x15')],'type':_0x01fe('0x16')},'log':_0x01fe('0x17')});};exports['attendedTransfer']=function(_0x3e9ea6){return client[_0x01fe('0x2')](_0x01fe('0x17'),{'body':{'result':_0x3e9ea6[_0x01fe('0x3')],'transfererchannel':_0x3e9ea6[_0x01fe('0x18')],'transferercalleridnum':_0x3e9ea6['origtransferercalleridnum'],'transferercalleridname':_0x3e9ea6[_0x01fe('0x19')],'transfererconnectedlinenum':_0x3e9ea6[_0x01fe('0x1a')],'transfererconnectedlinename':_0x3e9ea6[_0x01fe('0x1b')],'transfereraccountcode':_0x3e9ea6[_0x01fe('0x1c')],'transferercontext':_0x3e9ea6['secondtransferercontext'],'transfererexten':_0x3e9ea6[_0x01fe('0x1d')],'transfererlinkedid':_0x3e9ea6[_0x01fe('0x1e')],'transfereechannel':_0x3e9ea6[_0x01fe('0x1f')],'transfereecalleridnum':_0x3e9ea6[_0x01fe('0x20')],'transfereecalleridname':_0x3e9ea6[_0x01fe('0x21')],'transfereeconnectedlinenum':_0x3e9ea6[_0x01fe('0x22')],'transfereeconnectedlinename':_0x3e9ea6[_0x01fe('0x23')],'transfereeaccountcode':_0x3e9ea6[_0x01fe('0x24')],'transfereecontext':_0x3e9ea6[_0x01fe('0x25')],'transfereeexten':_0x3e9ea6[_0x01fe('0x26')],'transfereelinkedid':_0x3e9ea6['transfertargetlinkedid'],'isexternal':_0x3e9ea6[_0x01fe('0x13')],'context':_0x3e9ea6[_0x01fe('0x27')],'extension':_0x3e9ea6['origtransfererexten'],'type':_0x01fe('0x28')},'log':_0x01fe('0x17')});}; \ No newline at end of file +var _0xa979=['transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','../client','transfers','blindTransfer','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','extension','blind','CreateVoiceTransferReport','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext'];(function(_0x249c57,_0x568994){var _0x1eab98=function(_0x496642){while(--_0x496642){_0x249c57['push'](_0x249c57['shift']());}};_0x1eab98(++_0x568994);}(_0xa979,0x1b3));var _0x9a97=function(_0x3f6f00,_0xa93192){_0x3f6f00=_0x3f6f00-0x0;var _0x536b3c=_0xa979[_0x3f6f00];return _0x536b3c;};'use strict';var client=require(_0x9a97('0x0'));exports[_0x9a97('0x1')]={};exports[_0x9a97('0x2')]=function(_0x5990ae){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x5990ae[_0x9a97('0x3')],'transfererchannel':_0x5990ae['transfererchannel'],'transferercalleridnum':_0x5990ae[_0x9a97('0x4')],'transferercalleridname':_0x5990ae[_0x9a97('0x5')],'transfererconnectedlinenum':_0x5990ae[_0x9a97('0x6')],'transfererconnectedlinename':_0x5990ae[_0x9a97('0x7')],'transfereraccountcode':_0x5990ae['transfereraccountcode'],'transferercontext':_0x5990ae[_0x9a97('0x8')],'transfererexten':_0x5990ae['transfererexten'],'transfererlinkedid':_0x5990ae[_0x9a97('0x9')],'transfereechannel':_0x5990ae[_0x9a97('0xa')],'transfereecalleridnum':_0x5990ae['transfereecalleridnum'],'transfereecalleridname':_0x5990ae[_0x9a97('0xb')],'transfereeconnectedlinenum':_0x5990ae[_0x9a97('0xc')],'transfereeconnectedlinename':_0x5990ae[_0x9a97('0xd')],'transfereeaccountcode':_0x5990ae[_0x9a97('0xe')],'transfereecontext':_0x5990ae[_0x9a97('0xf')],'transfereeexten':_0x5990ae['transfereeexten'],'transfereelinkedid':_0x5990ae[_0x9a97('0x10')],'isexternal':_0x5990ae[_0x9a97('0x11')],'context':_0x5990ae['context'],'extension':_0x5990ae[_0x9a97('0x12')],'type':_0x9a97('0x13')},'log':_0x9a97('0x14')});};exports['attendedTransfer']=function(_0x1bd095){return client[_0x9a97('0x15')](_0x9a97('0x14'),{'body':{'result':_0x1bd095[_0x9a97('0x3')],'transfererchannel':_0x1bd095[_0x9a97('0x16')],'transferercalleridnum':_0x1bd095[_0x9a97('0x17')],'transferercalleridname':_0x1bd095[_0x9a97('0x18')],'transfererconnectedlinenum':_0x1bd095[_0x9a97('0x19')],'transfererconnectedlinename':_0x1bd095['secondtransfererconnectedlinename'],'transfereraccountcode':_0x1bd095['origtransfereraccountcode'],'transferercontext':_0x1bd095[_0x9a97('0x1a')],'transfererexten':_0x1bd095['secondtransfererexten'],'transfererlinkedid':_0x1bd095['origtransfererlinkedid'],'transfereechannel':_0x1bd095[_0x9a97('0x1b')],'transfereecalleridnum':_0x1bd095['transfertargetcalleridnum'],'transfereecalleridname':_0x1bd095['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1bd095[_0x9a97('0x1c')],'transfereeconnectedlinename':_0x1bd095[_0x9a97('0x1d')],'transfereeaccountcode':_0x1bd095[_0x9a97('0x1e')],'transfereecontext':_0x1bd095[_0x9a97('0x1f')],'transfereeexten':_0x1bd095[_0x9a97('0x20')],'transfereelinkedid':_0x1bd095['transfertargetlinkedid'],'isexternal':_0x1bd095[_0x9a97('0x11')],'context':_0x1bd095['origtransferercontext'],'extension':_0x1bd095['origtransfererexten'],'type':'attended'},'log':_0x9a97('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 9667a5c..df4ea0a 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 _0x8c46=['ami\x20disconnected','pick','command','Command','content','voiceQueues','strategy','answered','available','pTalking','sumDuration','sumHoldTime','total','type','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','length','find','omit','undefined','values','channels','voicechannel','uniqueid','format','%s.%s','MixMonitor','channel','ai(mixmonitorid)','then','monitors','toLowerCase','/var/spool/asterisk/monitor/','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','status','stop','filename','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','Redirect','exten','context','trunks','outboundChannels','campaigns','event','emit','custom:','faxAccounts','send','checkAfterSend','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','validate','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','join','keys','Reload','Action','message','catch'];(function(_0x3fae22,_0x315beb){var _0x11499c=function(_0x31ee12){while(--_0x31ee12){_0x3fae22['push'](_0x3fae22['shift']());}};_0x11499c(++_0x315beb);}(_0x8c46,0x171));var _0x68c4=function(_0x212095,_0x3d442c){_0x212095=_0x212095-0x0;var _0x18a161=_0x8c46[_0x212095];return _0x18a161;};'use strict';var _=require(_0x68c4('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require(_0x68c4('0x1'));var BPromise=require('bluebird');var moment=require('moment');var config=require(_0x68c4('0x2'));var properties=require(_0x68c4('0x3'));var ami=require(_0x68c4('0x4'));exports[_0x68c4('0x5')]=function(_0x287adb,_0x1243c6,_0x40ce21){return new BPromise(function(_0x1516cf,_0x3da9c3){var _0x458a2b={'QueuePause':function(_0x5e57ce){return new Promise(function(_0x1754d7,_0x1d40a3){var _0x2d3a88=util['format'](_0x68c4('0x6'),_0x68c4('0x7'),_0x5e57ce[_0x68c4('0x8')]);if(_0x287adb['timers']&&_0x287adb['timers'][_0x2d3a88]&&_0x287adb[_0x68c4('0x9')][_0x2d3a88][_0x68c4('0xa')]){_0x287adb['timers'][_0x2d3a88]['updateAcw']();}if(_0x287adb[_0x68c4('0xb')][_0x2d3a88]){_0x287adb[_0x68c4('0xb')][_0x2d3a88][_0x68c4('0xc')]({'statePause':_0x5e57ce['pause']?!![]:![]});}_0x1754d7({'code':0xc8,'message':_0x68c4('0xd')});});},'Reload':function(_0x1f5f42){var _0x200623=this;return new Promise(function(_0x56e361,_0x11eb66){if(ami[_0x68c4('0xe')]()==![]){return _0x11eb66(_0x200623[_0x68c4('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x68c4('0x10')][_0x68c4('0x11')],'ami\x20disconnected'][_0x68c4('0x12')]('\x20')));}_0x1f5f42=_['pick'](_0x1f5f42,_[_0x68c4('0x13')](properties['module']));_0x1f5f42['action']=_0x68c4('0x14');return ami[_0x68c4('0x15')](_0x1f5f42)['then'](function(_0x2d6c1b){_0x56e361({'code':0xc8,'message':_0x2d6c1b[_0x68c4('0x16')]});})[_0x68c4('0x17')](function(_0x33c5c5){_0x11eb66(_0x200623[_0x68c4('0xf')](0x1f5,_0x33c5c5[_0x68c4('0x16')]));});});},'Command':function(_0x334e40){var _0x415ef2=this;return new Promise(function(_0x1ee182,_0x3befda){if(ami[_0x68c4('0xe')]()==![]){return _0x3befda(_0x415ef2['error'](0x1f4,[config[_0x68c4('0x10')]['ip'],config['asterisk']['username'],_0x68c4('0x18')][_0x68c4('0x12')]('\x20')));}_0x334e40=_[_0x68c4('0x19')](_0x334e40,_0x68c4('0x1a'));_0x334e40['action']=_0x68c4('0x1b');return ami[_0x68c4('0x15')](_0x334e40)['then'](function(_0x201742){_0x1ee182({'code':0xc8,'message':_0x201742[_0x68c4('0x1c')]});})[_0x68c4('0x17')](function(_0x10278e){_0x3befda(_0x415ef2[_0x68c4('0xf')](0x1f5,_0x10278e[_0x68c4('0x16')]));});});},'VoiceQueues':function(_0x37e9a9){return new Promise(function(_0x505db4,_0x2ff4a5){var _0x55355d=[];for(var _0xf16a78 in _0x287adb[_0x68c4('0x1d')]){if(_0x287adb[_0x68c4('0x1d')]['hasOwnProperty'](_0xf16a78)){var _0x1e14db=_0x287adb[_0x68c4('0x1d')][_0xf16a78];var _0x496f4d={'id':_0x1e14db['id'],'name':_0x1e14db[_0x68c4('0x8')],'strategy':_0x1e14db[_0x68c4('0x1e')],'answered':_0x1e14db[_0x68c4('0x1f')],'available':_0x1e14db[_0x68c4('0x20')],'loggedIn':_0x1e14db['loggedIn'],'pTalking':_0x1e14db[_0x68c4('0x21')],'sumBillable':_0x1e14db['sumBillable'],'sumDuration':_0x1e14db[_0x68c4('0x22')],'sumHoldTime':_0x1e14db[_0x68c4('0x23')]||0x0,'talking':_0x1e14db['talking'],'total':_0x1e14db[_0x68c4('0x24')],'type':_0x1e14db[_0x68c4('0x25')],'unmanaged':_0x1e14db['unmanaged'],'abandoned':_0x1e14db[_0x68c4('0x26')],'waiting':_0x1e14db[_0x68c4('0x27')],'loggedInDb':_0x1e14db[_0x68c4('0x28')]};if(_0x1e14db[_0x68c4('0x25')]===_0x68c4('0x29')){_0x496f4d[_0x68c4('0x2a')]=_0x1e14db[_0x68c4('0x2a')];_0x496f4d[_0x68c4('0x2b')]=_0x1e14db[_0x68c4('0x2b')];_0x496f4d[_0x68c4('0x2c')]=_0x1e14db[_0x68c4('0x2c')];_0x496f4d[_0x68c4('0x2d')]=_0x1e14db[_0x68c4('0x2d')];_0x496f4d[_0x68c4('0x2e')]=_0x1e14db[_0x68c4('0x2e')];_0x496f4d[_0x68c4('0x2f')]=_0x1e14db[_0x68c4('0x2f')];_0x496f4d[_0x68c4('0x30')]=_0x1e14db['temp'];_0x496f4d[_0x68c4('0x31')]=_0x1e14db[_0x68c4('0x31')];_0x496f4d[_0x68c4('0x32')]=_0x1e14db[_0x68c4('0x32')];_0x496f4d[_0x68c4('0x33')]=_0x1e14db['outboundBlacklistCallsDay'];_0x496f4d[_0x68c4('0x34')]=_0x1e14db['outboundBusyCallsDay'];_0x496f4d['outboundCongestionCallsDay']=_0x1e14db['outboundCongestionCallsDay'];_0x496f4d[_0x68c4('0x35')]=_0x1e14db[_0x68c4('0x35')];_0x496f4d[_0x68c4('0x36')]=_0x1e14db[_0x68c4('0x36')];_0x496f4d['outboundDropCallsDayTimeout']=_0x1e14db[_0x68c4('0x37')];_0x496f4d[_0x68c4('0x38')]=_0x1e14db[_0x68c4('0x38')];_0x496f4d['outboundNoSuchCallsDay']=_0x1e14db[_0x68c4('0x39')];_0x496f4d[_0x68c4('0x3a')]=_0x1e14db[_0x68c4('0x3a')];_0x496f4d[_0x68c4('0x3b')]=_0x1e14db[_0x68c4('0x3b')];_0x496f4d[_0x68c4('0x3c')]=_0x1e14db[_0x68c4('0x3c')];_0x496f4d[_0x68c4('0x3d')]=_0x1e14db[_0x68c4('0x3d')];_0x496f4d[_0x68c4('0x3e')]=_0x1e14db['predictiveIntervalAnsweredCalls'];_0x496f4d['predictiveIntervalAvgHoldtime']=_0x1e14db[_0x68c4('0x3f')];_0x496f4d[_0x68c4('0x40')]=_0x1e14db[_0x68c4('0x40')];_0x496f4d[_0x68c4('0x41')]=_0x1e14db[_0x68c4('0x41')];_0x496f4d[_0x68c4('0x42')]=_0x1e14db[_0x68c4('0x42')];_0x496f4d[_0x68c4('0x43')]=_0x1e14db[_0x68c4('0x43')];_0x496f4d[_0x68c4('0x44')]=_0x1e14db[_0x68c4('0x44')];_0x496f4d[_0x68c4('0x45')]=_0x1e14db[_0x68c4('0x45')];_0x496f4d['predictiveIntervalMultiplicativeFactor']=_0x1e14db['predictiveIntervalMultiplicativeFactor'];_0x496f4d[_0x68c4('0x46')]=_0x1e14db[_0x68c4('0x46')];_0x496f4d[_0x68c4('0x47')]=_0x1e14db[_0x68c4('0x47')];_0x496f4d['predictiveIntervalTotalCalls']=_0x1e14db[_0x68c4('0x48')];_0x496f4d[_0x68c4('0x16')]=_0x1e14db['message'];_0x496f4d['originated']=_0x1e14db['originated'];_0x496f4d[_0x68c4('0x49')]=_0x1e14db['erlangCalls'];_0x496f4d[_0x68c4('0x4a')]=_0x1e14db['erlangCallToSecond'];_0x496f4d[_0x68c4('0x4b')]=_0x1e14db[_0x68c4('0x4b')];_0x496f4d[_0x68c4('0x4c')]=_0x1e14db[_0x68c4('0x4c')];_0x496f4d['startPredictive']=_0x1e14db[_0x68c4('0x4d')];_0x496f4d[_0x68c4('0x4e')]=_0x1e14db[_0x68c4('0x4e')];}if(_0x1e14db[_0x68c4('0x4f')]){_0x496f4d['Trunk']={'id':_0x1e14db[_0x68c4('0x4f')]['id'],'name':_0x1e14db[_0x68c4('0x4f')][_0x68c4('0x8')],'active':_0x1e14db[_0x68c4('0x4f')][_0x68c4('0x50')],'callerid':_0x1e14db['Trunk']['callerid']};}if(_0x1e14db['Interval']){_0x496f4d[_0x68c4('0x51')]={'id':_0x1e14db[_0x68c4('0x51')]['id'],'name':_0x1e14db[_0x68c4('0x51')][_0x68c4('0x8')]};}_0x55355d['push'](_0x496f4d);}}_0x505db4({'count':_0x55355d[_0x68c4('0x52')],'rows':_0x55355d});});},'UpdateVoiceQueue':function(_0x2169af){return new Promise(function(_0x3fc17e,_0x4159e7){var _0x25be7a=_[_0x68c4('0x53')](_0x287adb[_0x68c4('0x1d')],{'id':parseInt(_0x2169af['id'])});var _0x5b8209=_[_0x68c4('0x54')](_0x2169af,['id']);if(_0x25be7a){for(var _0x9d03e6 in _0x5b8209){if(typeof _0x5b8209[_0x9d03e6]!==_0x68c4('0x55')&&typeof _0x25be7a[_0x9d03e6]!=='undefined'){_0x25be7a[_0x9d03e6]=_0x5b8209[_0x9d03e6];}}_0x3fc17e(_0x25be7a);}else{_0x4159e7();}});},'VoiceChannels':function(_0x1c5206){return new Promise(function(_0x4e796c,_0x3a5a43){var _0x44e3c9=_[_0x68c4('0x56')](_0x287adb[_0x68c4('0x57')]);_0x4e796c({'count':_0x44e3c9['length'],'rows':_0x44e3c9});});},'VoiceChannelMixMonitor':function(_0x44a068){var _0x47d6b5=this;return new Promise(function(_0x202f59,_0x391143){if(ami['isConnected']()==![]){return _0x391143(_0x47d6b5[_0x68c4('0xf')](0x1f4,[config[_0x68c4('0x10')]['ip'],config[_0x68c4('0x10')][_0x68c4('0x11')],_0x68c4('0x18')][_0x68c4('0x12')]('\x20')));}var _0x519ddb=schema(properties[_0x68c4('0x58')])[_0x68c4('0x1')](_0x44a068);if(_0x519ddb[_0x68c4('0x52')]>0x0){return _0x391143(_0x47d6b5[_0x68c4('0xf')](0x1f4,_['map'](_0x519ddb,_0x68c4('0x16'))[_0x68c4('0x12')](',\x20')));}var _0x1b15c4=_[_0x68c4('0x53')](_0x287adb[_0x68c4('0x57')],{'uniqueid':_0x44a068[_0x68c4('0x59')]});if(_0x1b15c4&&_0x1b15c4['channel']){var _0x102fc=util[_0x68c4('0x5a')](_0x68c4('0x5b'),_0x44a068['filename']||_0x44a068[_0x68c4('0x59')],_0x44a068[_0x68c4('0x5a')]||'wav');return ami['Action']({'action':_0x68c4('0x5c'),'channel':_0x1b15c4[_0x68c4('0x5d')],'file':_0x102fc,'options':_0x68c4('0x5e')})[_0x68c4('0x5f')](function(_0x395f29){var _0x91c18e=_[_0x68c4('0x53')](_0x1b15c4[_0x68c4('0x60')],{'filename':'/var/spool/asterisk/monitor/'+_0x102fc[_0x68c4('0x61')]()});if(_['isNil'](_0x91c18e)){_0x1b15c4['monitors']['push']({'filename':_0x68c4('0x62')+_0x102fc[_0x68c4('0x61')](),'createdAt':moment()[_0x68c4('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x395f29[_0x68c4('0x63')],'status':_0x68c4('0x64')});}else{_0x91c18e['mixmonitorid']=_0x395f29[_0x68c4('0x63')];_0x91c18e['status']=_0x68c4('0x64');}_0x202f59({'code':0xc8,'message':[_0x44a068['uniqueid'],_0x68c4('0x65'),_0x395f29[_0x68c4('0x63')]]['join']('\x20'),'mixmonitorid':_0x395f29[_0x68c4('0x63')]});})[_0x68c4('0x17')](function(_0x57d009){_0x391143(_0x47d6b5[_0x68c4('0xf')](0x1f5,[_0x44a068[_0x68c4('0x59')],_0x57d009['message'][_0x68c4('0x61')]()][_0x68c4('0x12')]('\x20')));});}else{return _0x391143(_0x47d6b5[_0x68c4('0xf')](0x1f5,_0x68c4('0x66')));}});},'VoiceChannelStopMixMonitor':function(_0x2d50c8){var _0x159f8b=this;return new Promise(function(_0x1a2ede,_0x22424b){if(ami[_0x68c4('0xe')]()==![]){return _0x22424b(_0x159f8b['error'](0x1f4,[config[_0x68c4('0x10')]['ip'],config[_0x68c4('0x10')][_0x68c4('0x11')],_0x68c4('0x18')][_0x68c4('0x12')]('\x20')));}var _0x120345=schema(properties[_0x68c4('0x58')])['validate'](_0x2d50c8);if(_0x120345['length']>0x0){return _0x22424b(_0x159f8b[_0x68c4('0xf')](0x1f4,_[_0x68c4('0x67')](_0x120345,'message')[_0x68c4('0x12')](',\x20')));}var _0x91e7b6=_[_0x68c4('0x53')](_0x287adb[_0x68c4('0x57')],{'uniqueid':_0x2d50c8[_0x68c4('0x59')]});if(_0x91e7b6){return BPromise[_0x68c4('0x68')]()['then'](function(){if(_0x91e7b6[_0x68c4('0x5d')]){return ami[_0x68c4('0x15')]({'action':_0x68c4('0x69'),'channel':_0x91e7b6[_0x68c4('0x5d')],'mixmonitorid':_0x2d50c8[_0x68c4('0x63')]})['catch'](function(_0x4bb60c){});}})[_0x68c4('0x5f')](function(){if(_0x91e7b6[_0x68c4('0x6a')]){return ami[_0x68c4('0x15')]({'action':_0x68c4('0x69'),'channel':_0x91e7b6[_0x68c4('0x6a')],'mixmonitorid':_0x2d50c8['mixmonitorid']})[_0x68c4('0x17')](function(_0x43db7f){});}})[_0x68c4('0x5f')](function(_0x231e7f){var _0x3d098a=_[_0x68c4('0x53')](_0x91e7b6[_0x68c4('0x60')],{'mixmonitorid':_0x2d50c8[_0x68c4('0x63')]});if(_0x3d098a){_0x3d098a[_0x68c4('0x6b')]=_0x68c4('0x6c');}})['then'](function(){var _0x418647=util['format'](_0x68c4('0x5b'),_0x2d50c8[_0x68c4('0x6d')]||_0x2d50c8[_0x68c4('0x59')],_0x2d50c8['format']||_0x68c4('0x6e'));var _0x4fa64d=_[_0x68c4('0x53')](_0x91e7b6[_0x68c4('0x60')],{'filename':_0x68c4('0x62')+_0x418647[_0x68c4('0x61')]()});if(_0x4fa64d){_0x4fa64d[_0x68c4('0x6b')]='stop';}})[_0x68c4('0x5f')](function(){_0x1a2ede({'code':0xc8,'message':[_0x2d50c8[_0x68c4('0x59')],_0x68c4('0x6f')][_0x68c4('0x12')]('\x20')});})[_0x68c4('0x17')](function(_0x5811bb){_0x22424b(_0x159f8b[_0x68c4('0xf')](0x1f5,[_0x2d50c8[_0x68c4('0x59')],_0x5811bb[_0x68c4('0x16')]['toLowerCase']()][_0x68c4('0x12')]('\x20')));});}else{return _0x22424b(_0x159f8b[_0x68c4('0xf')](0x1f5,_0x68c4('0x66')));}});},'VoiceQueuesChannels':function(_0x4ab929){return new Promise(function(_0x2defc0,_0x5f019b){var _0x49a162=_[_0x68c4('0x56')](_0x287adb[_0x68c4('0x70')]);_0x2defc0({'count':_0x49a162[_0x68c4('0x52')],'rows':_0x49a162});});},'VoiceQueuesChannel':function(_0x508581){var _0x5b5353=this;return new Promise(function(_0x2395b1,_0x1ead72){var _0x4b0788=schema(properties[_0x68c4('0x71')])[_0x68c4('0x1')](_0x508581);if(_0x4b0788['length']>0x0){return _0x1ead72(_0x5b5353['error'](0x1f4,_[_0x68c4('0x67')](_0x4b0788,_0x68c4('0x16'))[_0x68c4('0x12')](',\x20')));}var _0x1e95ac=_['find'](_0x287adb[_0x68c4('0x70')],{'uniqueid':_0x508581['uniqueid']});if(_0x1e95ac){_0x2395b1(_0x1e95ac);}else{return _0x1ead72(_0x5b5353[_0x68c4('0xf')](0x1f5,_0x68c4('0x66')));}});},'VoiceQueuesChannelHangup':function(_0x2b81d8){var _0x3984d6=this;return new Promise(function(_0x284783,_0x6d38b0){if(ami[_0x68c4('0xe')]()==![]){return _0x6d38b0(_0x3984d6[_0x68c4('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x68c4('0x10')]['username'],_0x68c4('0x18')][_0x68c4('0x12')]('\x20')));}var _0xce0b25=schema(properties[_0x68c4('0x72')])[_0x68c4('0x1')](_0x2b81d8);if(_0xce0b25[_0x68c4('0x52')]>0x0){return _0x6d38b0(_0x3984d6[_0x68c4('0xf')](0x1f4,_[_0x68c4('0x67')](_0xce0b25,_0x68c4('0x16'))[_0x68c4('0x12')](',\x20')));}var _0x3ec119=_[_0x68c4('0x53')](_0x287adb[_0x68c4('0x70')],{'uniqueid':_0x2b81d8[_0x68c4('0x59')]});if(_0x3ec119&&_0x3ec119[_0x68c4('0x5d')]){return ami[_0x68c4('0x15')]({'action':_0x68c4('0x73'),'channel':_0x3ec119[_0x68c4('0x5d')]})[_0x68c4('0x5f')](function(_0x289dd1){_0x284783({'code':0xc8,'message':[_0x2b81d8[_0x68c4('0x59')],_0x289dd1[_0x68c4('0x16')][_0x68c4('0x61')]()][_0x68c4('0x12')]('\x20')});})[_0x68c4('0x17')](function(_0x5c75cd){_0x6d38b0(_0x3984d6[_0x68c4('0xf')](0x1f5,[_0x2b81d8[_0x68c4('0x59')],_0x5c75cd['message'][_0x68c4('0x61')]()][_0x68c4('0x12')]('\x20')));});}else{return _0x6d38b0(_0x3984d6['error'](0x1f5,_0x68c4('0x66')));}});},'VoiceQueuesChannelRedirect':function(_0x1b704d){var _0x42d077=this;return new Promise(function(_0x920b1c,_0x350708){if(ami[_0x68c4('0xe')]()==![]){return _0x350708(_0x42d077[_0x68c4('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x68c4('0x10')][_0x68c4('0x11')],_0x68c4('0x18')][_0x68c4('0x12')]('\x20')));}var _0x2377fc=schema(properties['voicequeuechannelredirect'])['validate'](_0x1b704d);if(_0x2377fc[_0x68c4('0x52')]>0x0){return _0x350708(_0x42d077[_0x68c4('0xf')](0x1f4,_[_0x68c4('0x67')](_0x2377fc,_0x68c4('0x16'))[_0x68c4('0x12')](',\x20')));}var _0x7c1578=_['find'](_0x287adb[_0x68c4('0x70')],{'uniqueid':_0x1b704d[_0x68c4('0x59')]});if(_0x7c1578&&_0x7c1578['channel']){return ami[_0x68c4('0x15')]({'action':_0x68c4('0x74'),'channel':_0x7c1578[_0x68c4('0x5d')],'exten':_0x1b704d[_0x68c4('0x75')],'context':_0x1b704d[_0x68c4('0x76')]||_0x7c1578[_0x68c4('0x76')],'priority':0x1})[_0x68c4('0x5f')](function(_0x10eea2){_0x920b1c({'code':0xc8,'message':[_0x1b704d[_0x68c4('0x59')],_0x10eea2[_0x68c4('0x16')][_0x68c4('0x61')]()][_0x68c4('0x12')]('\x20')});})[_0x68c4('0x17')](function(_0x2c372e){_0x350708(_0x42d077[_0x68c4('0xf')](0x1f5,[_0x1b704d['uniqueid'],_0x2c372e[_0x68c4('0x16')][_0x68c4('0x61')]()][_0x68c4('0x12')]('\x20')));});}else{return _0x350708(_0x42d077['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x16e8b1){return new Promise(function(_0x2ec0af,_0x5a4e83){var _0x2cf842=_[_0x68c4('0x56')](_0x287adb[_0x68c4('0xb')]);_0x2ec0af({'count':_0x2cf842[_0x68c4('0x52')],'rows':_0x2cf842});});},'Telephones':function(_0x59f44a){return new Promise(function(_0x2a5570,_0x3172dd){var _0x281a26=_[_0x68c4('0x56')](_0x287adb['telephones']);_0x2a5570({'count':_0x281a26[_0x68c4('0x52')],'rows':_0x281a26});});},'Trunks':function(_0x1c7475){return new Promise(function(_0x1a1141,_0x18a7d6){var _0x2cbfad=_[_0x68c4('0x56')](_0x287adb[_0x68c4('0x77')]);_0x1a1141({'count':_0x2cbfad[_0x68c4('0x52')],'rows':_0x2cbfad});});},'OutboundChannels':function(_0x5dbe25){return new Promise(function(_0x5cbe63,_0x6c8572){var _0x4f4a29=_[_0x68c4('0x56')](_0x287adb[_0x68c4('0x78')]);_0x5cbe63({'count':_0x4f4a29[_0x68c4('0x52')],'rows':_0x4f4a29});});},'Outbound':function(_0x89532b){return new Promise(function(_0x7e6405,_0x18d162){_0x7e6405(_0x287adb[_0x68c4('0x29')]);});},'Campaigns':function(_0xa7aee4){return new Promise(function(_0x4e44ea,_0x17731b){var _0x13b970=_['values'](_0x287adb[_0x68c4('0x79')]);_0x4e44ea({'count':_0x13b970[_0x68c4('0x52')],'rows':_0x13b970});});},'VoiceQueuesPreview':function(_0x3e7529){var _0x4a208e=this;return new Promise(function(_0x14c66c,_0x25d366){_0x1243c6['run'](_0x3e7529['id'])[_0x68c4('0x5f')](function(_0x2660f5){_0x14c66c({'code':0xc8,'message':_0x2660f5[_0x68c4('0x16')]});})[_0x68c4('0x17')](function(_0x3b626c){_0x25d366(_0x4a208e[_0x68c4('0xf')](0x1f4,_0x3b626c[_0x68c4('0x16')]));});});},'EventManager':function(_0x582c11){var _0x20e9cd=this;return new Promise(function(_0x4f980a,_0x464ff2){if(!_0x582c11[_0x68c4('0x7a')]){return _0x464ff2(_0x20e9cd[_0x68c4('0xf')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x68c4('0x7b')](_0x68c4('0x7c')+_0x582c11['event'],_0x582c11[_0x68c4('0x16')]);_0x4f980a({'code':0xc8,'message':_0x582c11});});},'FaxAccounts':function(_0x443ea0){return new Promise(function(_0x2a33f2,_0x22860f){var _0x6cd79a=_['values'](_0x287adb[_0x68c4('0x7d')]);_0x2a33f2({'count':_0x6cd79a[_0x68c4('0x52')],'rows':_0x6cd79a});});},'SendFax':function(_0x580c01){var _0x27f038=this;return new Promise(function(_0x298a4c,_0x219d9b){_0x40ce21[_0x68c4('0x7e')](_0x580c01)[_0x68c4('0x5f')](function(_0x5a938a){_0x298a4c({'code':0xc8,'message':_0x5a938a[_0x68c4('0x16')]});})[_0x68c4('0x17')](function(_0x1c8c17){_0x219d9b(_0x27f038[_0x68c4('0xf')](0x1f4,_0x1c8c17[_0x68c4('0x16')]));});});},'CheckAfterSend':function(_0x5d2d19){var _0x4d8333=this;return new Promise(function(_0x4ddc78,_0x5c247f){_0x40ce21[_0x68c4('0x7f')](_0x5d2d19)[_0x68c4('0x5f')](function(_0x34e3a2){_0x4ddc78({'code':0xc8,'message':_0x34e3a2[_0x68c4('0x16')]});})[_0x68c4('0x17')](function(_0x1c5275){_0x5c247f(_0x4d8333[_0x68c4('0xf')](0x1f4,_0x1c5275[_0x68c4('0x16')]));});});}};var _0x2f671c=jayson['server'](_0x458a2b)[_0x68c4('0x80')]();_0x2f671c['on'](_0x68c4('0xf'),function(_0x33c4fb){return _0x3da9c3(_0x33c4fb);});_0x2f671c[_0x68c4('0x5')](0x232a,_0x68c4('0x81'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1516cf(_0x68c4('0x82')+0x232a);});});}; \ No newline at end of file +var _0x9b0d=['undefined','values','channels','voicechannel','map','uniqueid','channel','filename','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','rec','mixmonitorid','status','resolve','destinationchannel','StopMixMonitor','wav','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','../../../config/environment','../properties','../ami','listen','format','SIP','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','error','asterisk','username','join','pick','keys','module','action','Reload','Action','message','catch','ami\x20disconnected','Command','then','content','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit'];(function(_0x39d9ac,_0x43000e){var _0x23455d=function(_0x7e4d78){while(--_0x7e4d78){_0x39d9ac['push'](_0x39d9ac['shift']());}};_0x23455d(++_0x43000e);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x369932,_0x2f8723){_0x369932=_0x369932-0x0;var _0x4be879=_0x9b0d[_0x369932];return _0x4be879;};'use strict';var _=require('lodash');var util=require(_0xd9b0('0x0'));var jayson=require(_0xd9b0('0x1'));var schema=require(_0xd9b0('0x2'));var BPromise=require(_0xd9b0('0x3'));var moment=require('moment');var config=require(_0xd9b0('0x4'));var properties=require(_0xd9b0('0x5'));var ami=require(_0xd9b0('0x6'));exports[_0xd9b0('0x7')]=function(_0x4ae1d0,_0x176fd2,_0x21798d){return new BPromise(function(_0x41dad9,_0x31c012){var _0x58bd64={'QueuePause':function(_0x384d09){return new Promise(function(_0x33f402,_0x510adc){var _0x3bb891=util[_0xd9b0('0x8')]('%s/%s',_0xd9b0('0x9'),_0x384d09['name']);if(_0x4ae1d0[_0xd9b0('0xa')]&&_0x4ae1d0['timers'][_0x3bb891]&&_0x4ae1d0[_0xd9b0('0xa')][_0x3bb891][_0xd9b0('0xb')]){_0x4ae1d0[_0xd9b0('0xa')][_0x3bb891][_0xd9b0('0xc')]();}if(_0x4ae1d0[_0xd9b0('0xd')][_0x3bb891]){_0x4ae1d0[_0xd9b0('0xd')][_0x3bb891]['updateStatusRealtime']({'statePause':_0x384d09[_0xd9b0('0xe')]?!![]:![]});}_0x33f402({'code':0xc8,'message':_0xd9b0('0xf')});});},'Reload':function(_0x4e0210){var _0x15737c=this;return new Promise(function(_0x24ce1a,_0xddeb98){if(ami[_0xd9b0('0x10')]()==![]){return _0xddeb98(_0x15737c[_0xd9b0('0x11')](0x1f4,[config[_0xd9b0('0x12')]['ip'],config['asterisk'][_0xd9b0('0x13')],'ami\x20disconnected'][_0xd9b0('0x14')]('\x20')));}_0x4e0210=_[_0xd9b0('0x15')](_0x4e0210,_[_0xd9b0('0x16')](properties[_0xd9b0('0x17')]));_0x4e0210[_0xd9b0('0x18')]=_0xd9b0('0x19');return ami[_0xd9b0('0x1a')](_0x4e0210)['then'](function(_0xf96f36){_0x24ce1a({'code':0xc8,'message':_0xf96f36[_0xd9b0('0x1b')]});})[_0xd9b0('0x1c')](function(_0x1b9b8f){_0xddeb98(_0x15737c[_0xd9b0('0x11')](0x1f5,_0x1b9b8f[_0xd9b0('0x1b')]));});});},'Command':function(_0x3e7df9){var _0x485cdf=this;return new Promise(function(_0x136b4e,_0x4e654a){if(ami[_0xd9b0('0x10')]()==![]){return _0x4e654a(_0x485cdf['error'](0x1f4,[config[_0xd9b0('0x12')]['ip'],config[_0xd9b0('0x12')][_0xd9b0('0x13')],_0xd9b0('0x1d')][_0xd9b0('0x14')]('\x20')));}_0x3e7df9=_[_0xd9b0('0x15')](_0x3e7df9,'command');_0x3e7df9['action']=_0xd9b0('0x1e');return ami['Action'](_0x3e7df9)[_0xd9b0('0x1f')](function(_0x283da7){_0x136b4e({'code':0xc8,'message':_0x283da7[_0xd9b0('0x20')]});})['catch'](function(_0x222229){_0x4e654a(_0x485cdf['error'](0x1f5,_0x222229['message']));});});},'VoiceQueues':function(_0x3c4f3a){return new Promise(function(_0x334657,_0x5569c3){var _0x3d90f0=[];for(var _0x4b9935 in _0x4ae1d0[_0xd9b0('0x21')]){if(_0x4ae1d0[_0xd9b0('0x21')][_0xd9b0('0x22')](_0x4b9935)){var _0xe07b77=_0x4ae1d0[_0xd9b0('0x21')][_0x4b9935];var _0x2c55e7={'id':_0xe07b77['id'],'name':_0xe07b77[_0xd9b0('0x23')],'strategy':_0xe07b77[_0xd9b0('0x24')],'answered':_0xe07b77[_0xd9b0('0x25')],'available':_0xe07b77[_0xd9b0('0x26')],'loggedIn':_0xe07b77[_0xd9b0('0x27')],'pTalking':_0xe07b77[_0xd9b0('0x28')],'sumBillable':_0xe07b77[_0xd9b0('0x29')],'sumDuration':_0xe07b77[_0xd9b0('0x2a')],'sumHoldTime':_0xe07b77[_0xd9b0('0x2b')]||0x0,'talking':_0xe07b77[_0xd9b0('0x2c')],'total':_0xe07b77['total'],'type':_0xe07b77[_0xd9b0('0x2d')],'unmanaged':_0xe07b77['unmanaged'],'abandoned':_0xe07b77[_0xd9b0('0x2e')],'waiting':_0xe07b77[_0xd9b0('0x2f')],'loggedInDb':_0xe07b77['loggedInDb']};if(_0xe07b77[_0xd9b0('0x2d')]===_0xd9b0('0x30')){_0x2c55e7['dialActive']=_0xe07b77[_0xd9b0('0x31')];_0x2c55e7[_0xd9b0('0x32')]=_0xe07b77[_0xd9b0('0x32')];_0x2c55e7[_0xd9b0('0x33')]=_0xe07b77[_0xd9b0('0x33')];_0x2c55e7[_0xd9b0('0x34')]=_0xe07b77[_0xd9b0('0x34')];_0x2c55e7[_0xd9b0('0x35')]=_0xe07b77['dialOriginateTimeout'];_0x2c55e7[_0xd9b0('0x36')]=_0xe07b77[_0xd9b0('0x36')];_0x2c55e7[_0xd9b0('0x37')]=_0xe07b77[_0xd9b0('0x37')];_0x2c55e7['outboundAnswerAgiCallsDay']=_0xe07b77['outboundAnswerAgiCallsDay'];_0x2c55e7[_0xd9b0('0x38')]=_0xe07b77['outboundAnswerCallsDay'];_0x2c55e7[_0xd9b0('0x39')]=_0xe07b77[_0xd9b0('0x39')];_0x2c55e7['outboundBusyCallsDay']=_0xe07b77['outboundBusyCallsDay'];_0x2c55e7[_0xd9b0('0x3a')]=_0xe07b77[_0xd9b0('0x3a')];_0x2c55e7[_0xd9b0('0x3b')]=_0xe07b77[_0xd9b0('0x3b')];_0x2c55e7[_0xd9b0('0x3c')]=_0xe07b77[_0xd9b0('0x3c')];_0x2c55e7[_0xd9b0('0x3d')]=_0xe07b77[_0xd9b0('0x3d')];_0x2c55e7['outboundNoAnswerCallsDay']=_0xe07b77[_0xd9b0('0x3e')];_0x2c55e7[_0xd9b0('0x3f')]=_0xe07b77[_0xd9b0('0x3f')];_0x2c55e7[_0xd9b0('0x40')]=_0xe07b77[_0xd9b0('0x40')];_0x2c55e7[_0xd9b0('0x41')]=_0xe07b77[_0xd9b0('0x41')];_0x2c55e7[_0xd9b0('0x42')]=_0xe07b77[_0xd9b0('0x42')];_0x2c55e7[_0xd9b0('0x43')]=_0xe07b77[_0xd9b0('0x43')];_0x2c55e7[_0xd9b0('0x44')]=_0xe07b77[_0xd9b0('0x44')];_0x2c55e7[_0xd9b0('0x45')]=_0xe07b77[_0xd9b0('0x45')];_0x2c55e7[_0xd9b0('0x46')]=_0xe07b77[_0xd9b0('0x46')];_0x2c55e7[_0xd9b0('0x47')]=_0xe07b77[_0xd9b0('0x47')];_0x2c55e7[_0xd9b0('0x48')]=_0xe07b77['predictiveIntervalDroppedCallsTimeout'];_0x2c55e7['predictiveIntervalErlangCalls']=_0xe07b77[_0xd9b0('0x49')];_0x2c55e7['predictiveIntervalErlangCallsDroppedCalls']=_0xe07b77[_0xd9b0('0x4a')];_0x2c55e7[_0xd9b0('0x4b')]=_0xe07b77[_0xd9b0('0x4b')];_0x2c55e7[_0xd9b0('0x4c')]=_0xe07b77[_0xd9b0('0x4c')];_0x2c55e7[_0xd9b0('0x4d')]=_0xe07b77[_0xd9b0('0x4d')];_0x2c55e7[_0xd9b0('0x4e')]=_0xe07b77[_0xd9b0('0x4e')];_0x2c55e7[_0xd9b0('0x4f')]=_0xe07b77['predictiveIntervalTotalCalls'];_0x2c55e7[_0xd9b0('0x1b')]=_0xe07b77[_0xd9b0('0x1b')];_0x2c55e7['originated']=_0xe07b77[_0xd9b0('0x50')];_0x2c55e7[_0xd9b0('0x51')]=_0xe07b77[_0xd9b0('0x51')];_0x2c55e7['erlangCallToSecond']=_0xe07b77[_0xd9b0('0x52')];_0x2c55e7[_0xd9b0('0x53')]=_0xe07b77[_0xd9b0('0x53')];_0x2c55e7[_0xd9b0('0x54')]=_0xe07b77[_0xd9b0('0x54')];_0x2c55e7[_0xd9b0('0x55')]=_0xe07b77[_0xd9b0('0x55')];_0x2c55e7[_0xd9b0('0x56')]=_0xe07b77[_0xd9b0('0x56')];}if(_0xe07b77[_0xd9b0('0x57')]){_0x2c55e7[_0xd9b0('0x57')]={'id':_0xe07b77[_0xd9b0('0x57')]['id'],'name':_0xe07b77[_0xd9b0('0x57')][_0xd9b0('0x23')],'active':_0xe07b77[_0xd9b0('0x57')][_0xd9b0('0x58')],'callerid':_0xe07b77[_0xd9b0('0x57')][_0xd9b0('0x59')]};}if(_0xe07b77['Interval']){_0x2c55e7[_0xd9b0('0x5a')]={'id':_0xe07b77[_0xd9b0('0x5a')]['id'],'name':_0xe07b77['Interval'][_0xd9b0('0x23')]};}_0x3d90f0[_0xd9b0('0x5b')](_0x2c55e7);}}_0x334657({'count':_0x3d90f0[_0xd9b0('0x5c')],'rows':_0x3d90f0});});},'UpdateVoiceQueue':function(_0x5ca939){return new Promise(function(_0x5b5103,_0xc23e2b){var _0x34b87e=_[_0xd9b0('0x5d')](_0x4ae1d0[_0xd9b0('0x21')],{'id':parseInt(_0x5ca939['id'])});var _0x200a3c=_[_0xd9b0('0x5e')](_0x5ca939,['id']);if(_0x34b87e){for(var _0x3ad653 in _0x200a3c){if(typeof _0x200a3c[_0x3ad653]!=='undefined'&&typeof _0x34b87e[_0x3ad653]!==_0xd9b0('0x5f')){_0x34b87e[_0x3ad653]=_0x200a3c[_0x3ad653];}}_0x5b5103(_0x34b87e);}else{_0xc23e2b();}});},'VoiceChannels':function(_0x521eab){return new Promise(function(_0x16c53e,_0x14ae5c){var _0xd11f53=_[_0xd9b0('0x60')](_0x4ae1d0[_0xd9b0('0x61')]);_0x16c53e({'count':_0xd11f53[_0xd9b0('0x5c')],'rows':_0xd11f53});});},'VoiceChannelMixMonitor':function(_0x2a1456){var _0xab3957=this;return new Promise(function(_0x528fec,_0x1c3288){if(ami[_0xd9b0('0x10')]()==![]){return _0x1c3288(_0xab3957[_0xd9b0('0x11')](0x1f4,[config[_0xd9b0('0x12')]['ip'],config[_0xd9b0('0x12')][_0xd9b0('0x13')],_0xd9b0('0x1d')][_0xd9b0('0x14')]('\x20')));}var _0x41e630=schema(properties[_0xd9b0('0x62')])[_0xd9b0('0x2')](_0x2a1456);if(_0x41e630[_0xd9b0('0x5c')]>0x0){return _0x1c3288(_0xab3957[_0xd9b0('0x11')](0x1f4,_[_0xd9b0('0x63')](_0x41e630,_0xd9b0('0x1b'))[_0xd9b0('0x14')](',\x20')));}var _0x5e4c89=_[_0xd9b0('0x5d')](_0x4ae1d0[_0xd9b0('0x61')],{'uniqueid':_0x2a1456[_0xd9b0('0x64')]});if(_0x5e4c89&&_0x5e4c89[_0xd9b0('0x65')]){var _0x398e4d=util[_0xd9b0('0x8')]('%s.%s',_0x2a1456[_0xd9b0('0x66')]||_0x2a1456[_0xd9b0('0x64')],_0x2a1456['format']||'wav');return ami[_0xd9b0('0x1a')]({'action':'MixMonitor','channel':_0x5e4c89[_0xd9b0('0x65')],'file':_0x398e4d,'options':_0xd9b0('0x67')})[_0xd9b0('0x1f')](function(_0x378728){var _0x18845d=_[_0xd9b0('0x5d')](_0x5e4c89[_0xd9b0('0x68')],{'filename':_0xd9b0('0x69')+_0x398e4d[_0xd9b0('0x6a')]()});if(_[_0xd9b0('0x6b')](_0x18845d)){_0x5e4c89['monitors']['push']({'filename':_0xd9b0('0x69')+_0x398e4d[_0xd9b0('0x6a')](),'createdAt':moment()[_0xd9b0('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x378728['mixmonitorid'],'status':_0xd9b0('0x6c')});}else{_0x18845d[_0xd9b0('0x6d')]=_0x378728[_0xd9b0('0x6d')];_0x18845d[_0xd9b0('0x6e')]=_0xd9b0('0x6c');}_0x528fec({'code':0xc8,'message':[_0x2a1456[_0xd9b0('0x64')],'MixMonitor\x20Success',_0x378728['mixmonitorid']][_0xd9b0('0x14')]('\x20'),'mixmonitorid':_0x378728[_0xd9b0('0x6d')]});})[_0xd9b0('0x1c')](function(_0xb656b5){_0x1c3288(_0xab3957['error'](0x1f5,[_0x2a1456[_0xd9b0('0x64')],_0xb656b5[_0xd9b0('0x1b')][_0xd9b0('0x6a')]()][_0xd9b0('0x14')]('\x20')));});}else{return _0x1c3288(_0xab3957[_0xd9b0('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x4a6817){var _0x475121=this;return new Promise(function(_0x3d95ab,_0x3d1391){if(ami[_0xd9b0('0x10')]()==![]){return _0x3d1391(_0x475121[_0xd9b0('0x11')](0x1f4,[config[_0xd9b0('0x12')]['ip'],config[_0xd9b0('0x12')][_0xd9b0('0x13')],_0xd9b0('0x1d')][_0xd9b0('0x14')]('\x20')));}var _0x15df47=schema(properties[_0xd9b0('0x62')])['validate'](_0x4a6817);if(_0x15df47[_0xd9b0('0x5c')]>0x0){return _0x3d1391(_0x475121[_0xd9b0('0x11')](0x1f4,_[_0xd9b0('0x63')](_0x15df47,_0xd9b0('0x1b'))[_0xd9b0('0x14')](',\x20')));}var _0x28f11d=_[_0xd9b0('0x5d')](_0x4ae1d0[_0xd9b0('0x61')],{'uniqueid':_0x4a6817[_0xd9b0('0x64')]});if(_0x28f11d){return BPromise[_0xd9b0('0x6f')]()[_0xd9b0('0x1f')](function(){if(_0x28f11d[_0xd9b0('0x65')]){return ami[_0xd9b0('0x1a')]({'action':'StopMixMonitor','channel':_0x28f11d[_0xd9b0('0x65')],'mixmonitorid':_0x4a6817[_0xd9b0('0x6d')]})[_0xd9b0('0x1c')](function(_0x10c92e){});}})[_0xd9b0('0x1f')](function(){if(_0x28f11d[_0xd9b0('0x70')]){return ami['Action']({'action':_0xd9b0('0x71'),'channel':_0x28f11d['destinationchannel'],'mixmonitorid':_0x4a6817[_0xd9b0('0x6d')]})['catch'](function(_0x3e4d5f){});}})[_0xd9b0('0x1f')](function(_0x3d9313){var _0xdc4676=_[_0xd9b0('0x5d')](_0x28f11d[_0xd9b0('0x68')],{'mixmonitorid':_0x4a6817['mixmonitorid']});if(_0xdc4676){_0xdc4676[_0xd9b0('0x6e')]='stop';}})[_0xd9b0('0x1f')](function(){var _0x8ab3c6=util[_0xd9b0('0x8')]('%s.%s',_0x4a6817[_0xd9b0('0x66')]||_0x4a6817[_0xd9b0('0x64')],_0x4a6817[_0xd9b0('0x8')]||_0xd9b0('0x72'));var _0x1042aa=_[_0xd9b0('0x5d')](_0x28f11d['monitors'],{'filename':_0xd9b0('0x69')+_0x8ab3c6[_0xd9b0('0x6a')]()});if(_0x1042aa){_0x1042aa['status']=_0xd9b0('0x73');}})[_0xd9b0('0x1f')](function(){_0x3d95ab({'code':0xc8,'message':[_0x4a6817['uniqueid'],_0xd9b0('0x74')][_0xd9b0('0x14')]('\x20')});})['catch'](function(_0x1e3c9e){_0x3d1391(_0x475121['error'](0x1f5,[_0x4a6817[_0xd9b0('0x64')],_0x1e3c9e['message'][_0xd9b0('0x6a')]()][_0xd9b0('0x14')]('\x20')));});}else{return _0x3d1391(_0x475121[_0xd9b0('0x11')](0x1f5,_0xd9b0('0x75')));}});},'VoiceQueuesChannels':function(_0x45500f){return new Promise(function(_0x5a8017,_0x51d944){var _0x366e54=_['values'](_0x4ae1d0[_0xd9b0('0x76')]);_0x5a8017({'count':_0x366e54[_0xd9b0('0x5c')],'rows':_0x366e54});});},'VoiceQueuesChannel':function(_0x10c272){var _0x4a120c=this;return new Promise(function(_0x53e785,_0x1bd17a){var _0x2b6630=schema(properties[_0xd9b0('0x77')])['validate'](_0x10c272);if(_0x2b6630['length']>0x0){return _0x1bd17a(_0x4a120c[_0xd9b0('0x11')](0x1f4,_[_0xd9b0('0x63')](_0x2b6630,_0xd9b0('0x1b'))[_0xd9b0('0x14')](',\x20')));}var _0x59c066=_['find'](_0x4ae1d0[_0xd9b0('0x76')],{'uniqueid':_0x10c272[_0xd9b0('0x64')]});if(_0x59c066){_0x53e785(_0x59c066);}else{return _0x1bd17a(_0x4a120c[_0xd9b0('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x59c3a4){var _0x251f89=this;return new Promise(function(_0xd3aa59,_0x408b38){if(ami['isConnected']()==![]){return _0x408b38(_0x251f89[_0xd9b0('0x11')](0x1f4,[config[_0xd9b0('0x12')]['ip'],config['asterisk'][_0xd9b0('0x13')],'ami\x20disconnected'][_0xd9b0('0x14')]('\x20')));}var _0x1b054c=schema(properties[_0xd9b0('0x78')])['validate'](_0x59c3a4);if(_0x1b054c[_0xd9b0('0x5c')]>0x0){return _0x408b38(_0x251f89['error'](0x1f4,_['map'](_0x1b054c,_0xd9b0('0x1b'))[_0xd9b0('0x14')](',\x20')));}var _0x1df018=_['find'](_0x4ae1d0[_0xd9b0('0x76')],{'uniqueid':_0x59c3a4[_0xd9b0('0x64')]});if(_0x1df018&&_0x1df018[_0xd9b0('0x65')]){return ami[_0xd9b0('0x1a')]({'action':_0xd9b0('0x79'),'channel':_0x1df018[_0xd9b0('0x65')]})[_0xd9b0('0x1f')](function(_0x7ff823){_0xd3aa59({'code':0xc8,'message':[_0x59c3a4[_0xd9b0('0x64')],_0x7ff823['message'][_0xd9b0('0x6a')]()][_0xd9b0('0x14')]('\x20')});})['catch'](function(_0x2bfa0b){_0x408b38(_0x251f89[_0xd9b0('0x11')](0x1f5,[_0x59c3a4['uniqueid'],_0x2bfa0b[_0xd9b0('0x1b')][_0xd9b0('0x6a')]()]['join']('\x20')));});}else{return _0x408b38(_0x251f89['error'](0x1f5,_0xd9b0('0x75')));}});},'VoiceQueuesChannelRedirect':function(_0x231b7b){var _0x2b7552=this;return new Promise(function(_0xff842c,_0x1e7a11){if(ami[_0xd9b0('0x10')]()==![]){return _0x1e7a11(_0x2b7552[_0xd9b0('0x11')](0x1f4,[config[_0xd9b0('0x12')]['ip'],config['asterisk'][_0xd9b0('0x13')],_0xd9b0('0x1d')][_0xd9b0('0x14')]('\x20')));}var _0x143a03=schema(properties[_0xd9b0('0x7a')])[_0xd9b0('0x2')](_0x231b7b);if(_0x143a03[_0xd9b0('0x5c')]>0x0){return _0x1e7a11(_0x2b7552[_0xd9b0('0x11')](0x1f4,_['map'](_0x143a03,_0xd9b0('0x1b'))[_0xd9b0('0x14')](',\x20')));}var _0x3bcc90=_[_0xd9b0('0x5d')](_0x4ae1d0[_0xd9b0('0x76')],{'uniqueid':_0x231b7b[_0xd9b0('0x64')]});if(_0x3bcc90&&_0x3bcc90[_0xd9b0('0x65')]){return ami['Action']({'action':'Redirect','channel':_0x3bcc90[_0xd9b0('0x65')],'exten':_0x231b7b[_0xd9b0('0x7b')],'context':_0x231b7b[_0xd9b0('0x7c')]||_0x3bcc90[_0xd9b0('0x7c')],'priority':0x1})[_0xd9b0('0x1f')](function(_0xf73ef4){_0xff842c({'code':0xc8,'message':[_0x231b7b[_0xd9b0('0x64')],_0xf73ef4[_0xd9b0('0x1b')][_0xd9b0('0x6a')]()][_0xd9b0('0x14')]('\x20')});})[_0xd9b0('0x1c')](function(_0x397fa3){_0x1e7a11(_0x2b7552[_0xd9b0('0x11')](0x1f5,[_0x231b7b[_0xd9b0('0x64')],_0x397fa3['message'][_0xd9b0('0x6a')]()][_0xd9b0('0x14')]('\x20')));});}else{return _0x1e7a11(_0x2b7552[_0xd9b0('0x11')](0x1f5,_0xd9b0('0x75')));}});},'Agents':function(_0x43373c){return new Promise(function(_0x4e4134,_0x594aba){var _0x47dffc=_[_0xd9b0('0x60')](_0x4ae1d0[_0xd9b0('0xd')]);_0x4e4134({'count':_0x47dffc[_0xd9b0('0x5c')],'rows':_0x47dffc});});},'Telephones':function(_0x232f55){return new Promise(function(_0x31dddc,_0x30d1f0){var _0x50ffbc=_[_0xd9b0('0x60')](_0x4ae1d0[_0xd9b0('0x7d')]);_0x31dddc({'count':_0x50ffbc[_0xd9b0('0x5c')],'rows':_0x50ffbc});});},'Trunks':function(_0x3076fd){return new Promise(function(_0x4742f1,_0x597794){var _0x1a2f0f=_['values'](_0x4ae1d0[_0xd9b0('0x7e')]);_0x4742f1({'count':_0x1a2f0f['length'],'rows':_0x1a2f0f});});},'OutboundChannels':function(_0x587929){return new Promise(function(_0x5be056,_0x3217f6){var _0x5b22ce=_[_0xd9b0('0x60')](_0x4ae1d0[_0xd9b0('0x7f')]);_0x5be056({'count':_0x5b22ce[_0xd9b0('0x5c')],'rows':_0x5b22ce});});},'Outbound':function(_0x22382d){return new Promise(function(_0x3e5022,_0x3d48c8){_0x3e5022(_0x4ae1d0[_0xd9b0('0x30')]);});},'Campaigns':function(_0x43506d){return new Promise(function(_0x4debb9,_0x362106){var _0x39425a=_['values'](_0x4ae1d0[_0xd9b0('0x80')]);_0x4debb9({'count':_0x39425a[_0xd9b0('0x5c')],'rows':_0x39425a});});},'VoiceQueuesPreview':function(_0x530923){var _0x55a1bb=this;return new Promise(function(_0x3260b8,_0x276cf2){_0x176fd2[_0xd9b0('0x81')](_0x530923['id'])[_0xd9b0('0x1f')](function(_0x3380d7){_0x3260b8({'code':0xc8,'message':_0x3380d7[_0xd9b0('0x1b')]});})['catch'](function(_0x31ff76){_0x276cf2(_0x55a1bb[_0xd9b0('0x11')](0x1f4,_0x31ff76[_0xd9b0('0x1b')]));});});},'EventManager':function(_0x50bab6){var _0x4c09fa=this;return new Promise(function(_0x549300,_0x5e031a){if(!_0x50bab6[_0xd9b0('0x82')]){return _0x5e031a(_0x4c09fa[_0xd9b0('0x11')](0x1f4,_0xd9b0('0x83')));}ami[_0xd9b0('0x84')](_0xd9b0('0x85')+_0x50bab6['event'],_0x50bab6['message']);_0x549300({'code':0xc8,'message':_0x50bab6});});},'FaxAccounts':function(_0x2abe12){return new Promise(function(_0x4f4963,_0x57f7c7){var _0x1979e3=_['values'](_0x4ae1d0[_0xd9b0('0x86')]);_0x4f4963({'count':_0x1979e3[_0xd9b0('0x5c')],'rows':_0x1979e3});});},'SendFax':function(_0x50de46){var _0x466678=this;return new Promise(function(_0x12f242,_0xda31b5){_0x21798d[_0xd9b0('0x87')](_0x50de46)['then'](function(_0x48d7db){_0x12f242({'code':0xc8,'message':_0x48d7db[_0xd9b0('0x1b')]});})['catch'](function(_0x174cfe){_0xda31b5(_0x466678[_0xd9b0('0x11')](0x1f4,_0x174cfe['message']));});});},'CheckAfterSend':function(_0x4284df){var _0x373860=this;return new Promise(function(_0x3b6fe8,_0x42f686){_0x21798d[_0xd9b0('0x88')](_0x4284df)[_0xd9b0('0x1f')](function(_0x128b87){_0x3b6fe8({'code':0xc8,'message':_0x128b87[_0xd9b0('0x1b')]});})[_0xd9b0('0x1c')](function(_0x1566b6){_0x42f686(_0x373860['error'](0x1f4,_0x1566b6['message']));});});}};var _0x14da6a=jayson[_0xd9b0('0x89')](_0x58bd64)['http']();_0x14da6a['on'](_0xd9b0('0x11'),function(_0x5d781a){return _0x31c012(_0x5d781a);});_0x14da6a[_0xd9b0('0x7')](0x232a,'127.0.0.1',function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x41dad9(_0xd9b0('0x8a')+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 cb828dd..051e5b1 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 _0x2dae=['uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','phone','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','Unknown','destcalleridname','','then','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','action','toLowerCase','lodash','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','$or','map','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x2dae,0xc3));var _0xe2da=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0x2dae[_0x33a694];return _0x41ff01;};'use strict';var _=require(_0xe2da('0x0'));var BPromise=require('bluebird');var Redis=require(_0xe2da('0x1'));var util=require(_0xe2da('0x2'));var config=require(_0xe2da('0x3'));var logger=require(_0xe2da('0x4'))(_0xe2da('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0xe2da('0x6')]=_[_0xe2da('0x7')](config[_0xe2da('0x6')],{'host':_0xe2da('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe2da('0x6')]));function emit(_0x89c70b,_0x34cc98,_0x2efbd8,_0x238da3,_0x1c71ea){logger[_0xe2da('0x9')](_0xe2da('0xa'),_0x89c70b,_0x34cc98['id'],_0x2efbd8,_0x238da3,JSON[_0xe2da('0xb')](_0x1c71ea));io['to'](_0x2efbd8)['emit'](_0x238da3,_0x1c71ea);}exports[_0xe2da('0xc')]=function(_0x3baaa8,_0x104fb3,_0x17086c,_0x3c1309){var _0x44ec3e,_0x1a29b9;var _0x173244={};var _0x5aab71=Number(_0x17086c[_0xe2da('0xd')]);var _0x5200b1=_0x17086c[_0xe2da('0xe')]?Boolean(Number(_0x17086c[_0xe2da('0xe')])):![];var _0x37064e;var _0x411b9f=![];if(!_[_0xe2da('0xf')](_0x17086c[_0xe2da('0x10')])){if(_0x17086c[_0xe2da('0x10')]=='1')_0x411b9f=!![];}if(!_0x411b9f){if(_0x3c1309['xmd-contactid']){_0x173244['id']=_0x3c1309[_0xe2da('0x11')];}}if(!_0x173244['id']){_0x173244['ListId']=_0x5aab71;_0x37064e=_0x17086c['data3']&&_0x17086c[_0xe2da('0x12')]!=='0'?_0x17086c[_0xe2da('0x12')][_0xe2da('0x13')](','):['phone'];_0x173244[_0xe2da('0x14')]=_[_0xe2da('0x15')](_0x37064e,function(_0x2ea60e){var _0x33568f={};_0x33568f[_0x2ea60e]=_0x3c1309['routeId']?_0x3c1309[_0xe2da('0x16')]:_0x3c1309[_0xe2da('0x17')];return _0x33568f;});}var _0x417363=['id',_0xe2da('0x18'),_0xe2da('0x19'),'phone',_0xe2da('0x1a'),_0xe2da('0x1b'),'ListId',_0xe2da('0x1c'),_0xe2da('0x1d'),_0xe2da('0x1e')];var _0x203d36=_[_0xe2da('0x1f')](_0x417363,_0x37064e);BPromise[_0xe2da('0x20')]()['then'](cmContactRpc[_0xe2da('0x21')]({'attributes':_0x203d36,'where':_0x173244}))['then'](function(_0x30efdc){_0x1a29b9=_0x30efdc;if(!_[_0xe2da('0x22')](_0x1a29b9)){if(_0x1a29b9[_0xe2da('0x23')]===0x1){_0x44ec3e=_0x1a29b9[0x0];logger[_0xe2da('0x9')](_0xe2da('0x24'),_0x3c1309[_0xe2da('0x25')],_0x104fb3['id'],_0x44ec3e['id']);}else{logger[_0xe2da('0x9')](_0xe2da('0x26'),_0x3c1309['uniqueid'],_0x104fb3['id'],_[_0xe2da('0x15')](_0x1a29b9,'id')[_0xe2da('0x27')](','));}return;}else{logger[_0xe2da('0x9')](_0xe2da('0x28'),_0x3c1309[_0xe2da('0x25')],_0x104fb3['id']);var _0x230fb8={'ListId':_0x5aab71};var _0x124d93=_0x17086c['data4']&&_0x17086c[_0xe2da('0x29')]!=='0'?_0x17086c[_0xe2da('0x29')]:_0xe2da('0x2a');if(_0x5200b1){logger[_0xe2da('0x9')](_0xe2da('0x2b'),_0x3c1309[_0xe2da('0x25')],_0x104fb3['id']);_0x230fb8[_0x124d93]=_[_0xe2da('0xf')](_0x3c1309[_0xe2da('0x2c')])?_0x3c1309['calleridnum']:_0x3c1309['destcalleridnum'];if(_['isNil'](_0x3c1309[_0xe2da('0x2c')])){_0x230fb8[_0xe2da('0x18')]=_0x3c1309[_0xe2da('0x2d')]&&_0x3c1309[_0xe2da('0x2d')]!==''?_0x3c1309['calleridname']:_0xe2da('0x2e');}else{_0x230fb8[_0xe2da('0x18')]=_0x3c1309[_0xe2da('0x2f')]&&_0x3c1309[_0xe2da('0x2f')]!==_0xe2da('0x30')?_0x3c1309[_0xe2da('0x2f')]:_0xe2da('0x2e');}return BPromise[_0xe2da('0x20')]()[_0xe2da('0x31')](cmContactRpc['createContact'](_0x230fb8))['then'](function(_0x672767){_0x44ec3e=_0x672767;_0x1a29b9[_0xe2da('0x32')](_0x672767);if(_0x44ec3e){logger[_0xe2da('0x9')](_0xe2da('0x33'),_0x3c1309[_0xe2da('0x25')],_0x104fb3['id'],_0x44ec3e['id']);}return;});}else{logger[_0xe2da('0x9')](_0xe2da('0x34'),_0x3c1309[_0xe2da('0x25')],_0x104fb3['id']);_0x230fb8[_0x124d93]=_[_0xe2da('0xf')](_0x3c1309[_0xe2da('0x2c')])?_0x3c1309[_0xe2da('0x17')]:_0x3c1309[_0xe2da('0x16')];if(_[_0xe2da('0xf')](_0x3c1309[_0xe2da('0x2c')])){_0x230fb8[_0xe2da('0x18')]=_0x3c1309[_0xe2da('0x2d')]&&_0x3c1309[_0xe2da('0x2d')]!==_0xe2da('0x30')?_0x3c1309['calleridname']:_0xe2da('0x2e');}else{_0x230fb8[_0xe2da('0x18')]=_0x3c1309[_0xe2da('0x2f')]&&_0x3c1309['destcalleridname']!==_0xe2da('0x30')?_0x3c1309[_0xe2da('0x2f')]:_0xe2da('0x2e');}_0x44ec3e=_0x230fb8;_0x1a29b9['push'](_0x230fb8);return;}}})['then'](function(){if(_0x3baaa8){emit(_0x3c1309[_0xe2da('0x25')],_0x104fb3,util[_0xe2da('0x35')]('user:%s',_0x3baaa8[_0xe2da('0x36')]),util[_0xe2da('0x35')](_0xe2da('0x37'),_0x17086c[_0xe2da('0x38')][_0xe2da('0x39')]()),{'evt':_['merge'](_0x3c1309,{'autoCreate':_0x5200b1}),'contact':_0x44ec3e===undefined?{}:_0x44ec3e,'contacts':_0x1a29b9[_0xe2da('0x23')]===0x0?undefined:_0x1a29b9});}});}; \ No newline at end of file +var _0xda55=['name','trigger:%s','action','merge','length','lodash','bluebird','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','ListId','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','lastName','mobile','fax','scheduledAt','updatedAt','resolve','then','getContacts','isEmpty','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','firstName','calleridname','','Unknown','destcalleridname','[CM][%s][%s]\x20Autocreate\x20disabled','push','format'];(function(_0x1e6cc6,_0x2ceabc){var _0x4109c4=function(_0x16ecc4){while(--_0x16ecc4){_0x1e6cc6['push'](_0x1e6cc6['shift']());}};_0x4109c4(++_0x2ceabc);}(_0xda55,0x6d));var _0x5da5=function(_0x141a2f,_0x58d944){_0x141a2f=_0x141a2f-0x0;var _0x1e84d3=_0xda55[_0x141a2f];return _0x1e84d3;};'use strict';var _=require(_0x5da5('0x0'));var BPromise=require(_0x5da5('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0x5da5('0x2'));var logger=require(_0x5da5('0x3'))(_0x5da5('0x4'));var cmContactRpc=require(_0x5da5('0x5'));config[_0x5da5('0x6')]=_['defaults'](config[_0x5da5('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x5da5('0x7'))(new Redis(config['redis']));function emit(_0x2fd877,_0x267469,_0x71b187,_0x46290d,_0x3debdf){logger[_0x5da5('0x8')](_0x5da5('0x9'),_0x2fd877,_0x267469['id'],_0x71b187,_0x46290d,JSON[_0x5da5('0xa')](_0x3debdf));io['to'](_0x71b187)['emit'](_0x46290d,_0x3debdf);}exports[_0x5da5('0xb')]=function(_0x1f98a7,_0x2731a3,_0x26fbe3,_0x1a047e){var _0x2a361c,_0x33313e;var _0x589c14={};var _0x2f4e4b=Number(_0x26fbe3[_0x5da5('0xc')]);var _0x4f813b=_0x26fbe3[_0x5da5('0xd')]?Boolean(Number(_0x26fbe3[_0x5da5('0xd')])):![];var _0x3ced00;var _0x43d526=![];if(!_[_0x5da5('0xe')](_0x26fbe3[_0x5da5('0xf')])){if(_0x26fbe3['data5']=='1')_0x43d526=!![];}if(!_0x43d526){if(_0x1a047e['xmd-contactid']){_0x589c14['id']=_0x1a047e['xmd-contactid'];}}if(!_0x589c14['id']){_0x589c14[_0x5da5('0x10')]=_0x2f4e4b;_0x3ced00=_0x26fbe3[_0x5da5('0x11')]&&_0x26fbe3[_0x5da5('0x11')]!=='0'?_0x26fbe3[_0x5da5('0x11')][_0x5da5('0x12')](','):[_0x5da5('0x13')];_0x589c14[_0x5da5('0x14')]=_['map'](_0x3ced00,function(_0x124dc5){var _0x290136={};_0x290136[_0x124dc5]=_0x1a047e[_0x5da5('0x15')]?_0x1a047e[_0x5da5('0x16')]:_0x1a047e[_0x5da5('0x17')];return _0x290136;});}var _0x428b07=['id','firstName',_0x5da5('0x18'),_0x5da5('0x13'),_0x5da5('0x19'),_0x5da5('0x1a'),_0x5da5('0x10'),'createdAt',_0x5da5('0x1b'),_0x5da5('0x1c')];var _0x42a3cb=_['union'](_0x428b07,_0x3ced00);BPromise[_0x5da5('0x1d')]()[_0x5da5('0x1e')](cmContactRpc[_0x5da5('0x1f')]({'attributes':_0x42a3cb,'where':_0x589c14}))[_0x5da5('0x1e')](function(_0xec69f2){_0x33313e=_0xec69f2;if(!_[_0x5da5('0x20')](_0x33313e)){if(_0x33313e['length']===0x1){_0x2a361c=_0x33313e[0x0];logger[_0x5da5('0x8')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x1a047e[_0x5da5('0x21')],_0x2731a3['id'],_0x2a361c['id']);}else{logger[_0x5da5('0x8')](_0x5da5('0x22'),_0x1a047e['uniqueid'],_0x2731a3['id'],_[_0x5da5('0x23')](_0x33313e,'id')[_0x5da5('0x24')](','));}return;}else{logger[_0x5da5('0x8')](_0x5da5('0x25'),_0x1a047e['uniqueid'],_0x2731a3['id']);var _0x5b0b43={'ListId':_0x2f4e4b};var _0x50aadc=_0x26fbe3[_0x5da5('0x26')]&&_0x26fbe3['data4']!=='0'?_0x26fbe3['data4']:_0x5da5('0x13');if(_0x4f813b){logger[_0x5da5('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x1a047e[_0x5da5('0x21')],_0x2731a3['id']);_0x5b0b43[_0x50aadc]=_[_0x5da5('0xe')](_0x1a047e['routeId'])?_0x1a047e[_0x5da5('0x17')]:_0x1a047e[_0x5da5('0x16')];if(_[_0x5da5('0xe')](_0x1a047e[_0x5da5('0x15')])){_0x5b0b43[_0x5da5('0x27')]=_0x1a047e['calleridname']&&_0x1a047e[_0x5da5('0x28')]!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x28')]:_0x5da5('0x2a');}else{_0x5b0b43['firstName']=_0x1a047e['destcalleridname']&&_0x1a047e['destcalleridname']!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x2b')]:_0x5da5('0x2a');}return BPromise[_0x5da5('0x1d')]()['then'](cmContactRpc['createContact'](_0x5b0b43))[_0x5da5('0x1e')](function(_0x4afb58){_0x2a361c=_0x4afb58;_0x33313e['push'](_0x4afb58);if(_0x2a361c){logger[_0x5da5('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x1a047e[_0x5da5('0x21')],_0x2731a3['id'],_0x2a361c['id']);}return;});}else{logger[_0x5da5('0x8')](_0x5da5('0x2c'),_0x1a047e[_0x5da5('0x21')],_0x2731a3['id']);_0x5b0b43[_0x50aadc]=_[_0x5da5('0xe')](_0x1a047e[_0x5da5('0x15')])?_0x1a047e[_0x5da5('0x17')]:_0x1a047e[_0x5da5('0x16')];if(_['isNil'](_0x1a047e[_0x5da5('0x15')])){_0x5b0b43['firstName']=_0x1a047e[_0x5da5('0x28')]&&_0x1a047e[_0x5da5('0x28')]!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x28')]:_0x5da5('0x2a');}else{_0x5b0b43[_0x5da5('0x27')]=_0x1a047e[_0x5da5('0x2b')]&&_0x1a047e[_0x5da5('0x2b')]!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x2b')]:_0x5da5('0x2a');}_0x2a361c=_0x5b0b43;_0x33313e[_0x5da5('0x2d')](_0x5b0b43);return;}}})[_0x5da5('0x1e')](function(){if(_0x1f98a7){emit(_0x1a047e['uniqueid'],_0x2731a3,util[_0x5da5('0x2e')]('user:%s',_0x1f98a7[_0x5da5('0x2f')]),util[_0x5da5('0x2e')](_0x5da5('0x30'),_0x26fbe3[_0x5da5('0x31')]['toLowerCase']()),{'evt':_[_0x5da5('0x32')](_0x1a047e,{'autoCreate':_0x4f813b}),'contact':_0x2a361c===undefined?{}:_0x2a361c,'contacts':_0x33313e[_0x5da5('0x33')]===0x0?undefined:_0x33313e});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index fa2e7bd..b19f5c2 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 _0x8b8e=['agent','membername','lastevent','routeId','substatus','offlineMessage','equals','exports','util','url','ioredis','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','emit','info','prototype','clone','undefined','voice','checkTriggers','interface','hasOwnProperty','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','data1','TemplateId','data2','render','html','template\x20not\x20found','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','windowHeight','data6','600','winapp','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','exec','integration','accounts','queue','urlforward','script','parse','query','search','replace','checkTrigger','motionChannel','AllConditions','every','checkConditions','channel','AnyConditions','some','field','account','chat','ChatWebsiteId','value','AccountId','operator','upperFirst','interaction','event'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x8b8e,0x108));var _0xe8b8=function(_0x53828d,_0x3ba036){_0x53828d=_0x53828d-0x0;var _0x284a89=_0x8b8e[_0x53828d];return _0x284a89;};'use strict';var util=require(_0xe8b8('0x0'));var _=require('lodash');var url=require(_0xe8b8('0x1'));var Mustache=require('mustache');var Redis=require(_0xe8b8('0x2'));var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require(_0xe8b8('0x3'));var script=require(_0xe8b8('0x4'));var config=require(_0xe8b8('0x5'));var logger=require(_0xe8b8('0x6'))(_0xe8b8('0x7'));var ami=require(_0xe8b8('0x8'));config[_0xe8b8('0x9')]=_[_0xe8b8('0xa')](config[_0xe8b8('0x9')],{'host':_0xe8b8('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe8b8('0x9')]));var operators={'equals':function(_0x5cd238,_0x2ce648){return _0x5cd238==_0x2ce648;},'not_equals':function(_0x4ea70a,_0x48b59f){return _0x4ea70a!=_0x48b59f;}};var barAndWebActions=[_0xe8b8('0xc'),_0xe8b8('0x1'),'winapp'];function Trigger(_0x54eb14){this[_0xe8b8('0xd')]=_0x54eb14[_0xe8b8('0xd')];this[_0xe8b8('0xe')]=_0x54eb14[_0xe8b8('0xe')];this[_0xe8b8('0xf')]=_0x54eb14[_0xe8b8('0xf')];this[_0xe8b8('0x10')]=_0x54eb14[_0xe8b8('0x10')];this[_0xe8b8('0x11')]=_0x54eb14[_0xe8b8('0x11')];this[_0xe8b8('0x12')]=_0x54eb14[_0xe8b8('0x12')];this[_0xe8b8('0x13')]=_0x54eb14[_0xe8b8('0x13')];this['salesforceAccounts']=_0x54eb14[_0xe8b8('0x14')];this['sugarcrmAccounts']=_0x54eb14[_0xe8b8('0x15')];this[_0xe8b8('0x16')]=_0x54eb14[_0xe8b8('0x16')];this[_0xe8b8('0x17')]=_0x54eb14[_0xe8b8('0x17')];this[_0xe8b8('0x18')]=_0x54eb14[_0xe8b8('0x18')];this[_0xe8b8('0x19')]=_0x54eb14[_0xe8b8('0x19')];this[_0xe8b8('0x1a')]=_0x54eb14['dynamics365Accounts'];this[_0xe8b8('0x1b')]=_0x54eb14[_0xe8b8('0x1b')];this['accounts']={'zendesk':this[_0xe8b8('0x12')],'salesforce':this[_0xe8b8('0x14')],'freshdesk':this[_0xe8b8('0x13')],'sugarcrm':this[_0xe8b8('0x15')],'zoho':this[_0xe8b8('0x16')],'desk':this[_0xe8b8('0x17')],'vtiger':this[_0xe8b8('0x18')],'dynamics365':this[_0xe8b8('0x1a')],'freshsales':this[_0xe8b8('0x1b')],'servicenow':this[_0xe8b8('0x19')]};ami['on'](_0xe8b8('0x1c'),this[_0xe8b8('0x1d')][_0xe8b8('0x1e')](this));ami['on'](_0xe8b8('0x1f'),this[_0xe8b8('0x1d')][_0xe8b8('0x1e')](this));ami['on'](_0xe8b8('0x20'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentcomplete',this[_0xe8b8('0x1d')]['bind'](this));ami['on'](_0xe8b8('0x21'),this['syncCustomEvent'][_0xe8b8('0x1e')](this));ami['on'](_0xe8b8('0x22'),this['syncCustomEvent']['bind'](this));ami['on'](_0xe8b8('0x23'),this[_0xe8b8('0x1d')]['bind'](this));ami['on'](_0xe8b8('0x24'),this[_0xe8b8('0x1d')][_0xe8b8('0x1e')](this));ami['on'](_0xe8b8('0x25'),this[_0xe8b8('0x1d')]['bind'](this));ami['on'](_0xe8b8('0x26'),this['syncCustomEvent'][_0xe8b8('0x1e')](this));ami['on'](_0xe8b8('0x27'),this[_0xe8b8('0x1d')][_0xe8b8('0x1e')](this));ami['on']('custom:timeout',this['syncCustomEvent'][_0xe8b8('0x1e')](this));ami['on'](_0xe8b8('0x28'),this[_0xe8b8('0x29')][_0xe8b8('0x1e')](this));ami['on'](_0xe8b8('0x2a'),this['syncAgentDial'][_0xe8b8('0x1e')](this));ami['on'](_0xe8b8('0x2b'),this[_0xe8b8('0x29')][_0xe8b8('0x1e')](this));ami['on'](_0xe8b8('0x2c'),this[_0xe8b8('0x1d')][_0xe8b8('0x1e')](this));ami['on'](_0xe8b8('0x2d'),this[_0xe8b8('0x1d')][_0xe8b8('0x1e')](this));ami['on'](_0xe8b8('0x2e'),this['syncCustomEvent'][_0xe8b8('0x1e')](this));ami['on'](_0xe8b8('0x2f'),this[_0xe8b8('0x1d')]['bind'](this));ami['on'](_0xe8b8('0x30'),this[_0xe8b8('0x1d')][_0xe8b8('0x1e')](this));ami['on'](_0xe8b8('0x31'),this[_0xe8b8('0x1d')][_0xe8b8('0x1e')](this));ami['on'](_0xe8b8('0x32'),this[_0xe8b8('0x1d')][_0xe8b8('0x1e')](this));ami['on']('custom:offlineMessage',this[_0xe8b8('0x1d')][_0xe8b8('0x1e')](this));}Trigger['prototype'][_0xe8b8('0x33')]=function(_0x1b5b09,_0x332295,_0xf54466){logger[_0xe8b8('0x34')](_0x1b5b09,_0x332295,JSON['stringify'](_0xf54466));io['to'](_0x1b5b09)[_0xe8b8('0x33')](_0x332295,_0xf54466);};Trigger[_0xe8b8('0x35')][_0xe8b8('0x1d')]=function(_0x16f8fa){var _0x15f3f8=_[_0xe8b8('0x36')](_0x16f8fa);if(typeof _0x15f3f8['motionChannel']===_0xe8b8('0x37')){_0x15f3f8['motionChannel']=_0xe8b8('0x38');}this[_0xe8b8('0x39')](_0x15f3f8);};Trigger['prototype']['syncAgentDial']=function(_0x2ba0bf){if(this[_0xe8b8('0xe')][_0x2ba0bf[_0xe8b8('0x3a')]]){this[_0xe8b8('0x1d')](_0x2ba0bf);}};Trigger['prototype'][_0xe8b8('0x39')]=function(_0xa235eb){var _0x3237c4;for(var _0xd1efab in this[_0xe8b8('0xd')]){if(this[_0xe8b8('0xd')][_0xe8b8('0x3b')](_0xd1efab)){if(this[_0xe8b8('0xd')][_0xd1efab]['status']){_0x3237c4=this['checkTrigger'](this[_0xe8b8('0xd')][_0xd1efab],_0xa235eb);if(_0x3237c4){_[_0xe8b8('0x3c')](_0xa235eb,_0xa235eb[_0xe8b8('0x3d')]);for(var _0x5633aa=0x0,_0xb0ed96,_0x3531f1,_0x7a96fd;_0x5633aa0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x4d1166,_0x460d8f){var _0x529c3d=function(_0x4fe749){while(--_0x4fe749){_0x4d1166['push'](_0x4d1166['shift']());}};_0x529c3d(++_0x460d8f);}(_0x3e74,0x175));var _0x43e7=function(_0x1c2840,_0x2ae327){_0x1c2840=_0x1c2840-0x0;var _0xd53a6b=_0x3e74[_0x1c2840];return _0xd53a6b;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 8a080cf..bd85f7c 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 _0x0ddb=['indexOf','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','emit','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','outbound','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','util','./util','md5','ioredis','dynamics365','../../../../config/environment','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','data5','POST','clientId','username','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','validateEmail','email','userEmail','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId','catch','message','toLowerCase','destcalleridnum','/systemusers(','Bearer\x20','4.0','headers','odata-entityid','lastIndexOf','enduserId','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','type','customField','idField','substring'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0x0ddb,0x157));var _0xb0dd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0ddb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb0dd('0x0'));var rp=require('request-promise');var util=require(_0xb0dd('0x1'));var intUtil=require(_0xb0dd('0x2'));var md5=require(_0xb0dd('0x3'));var Redis=require(_0xb0dd('0x4'));var logger=require('../../../../config/logger')(_0xb0dd('0x5'));var config=require(_0xb0dd('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0xb0dd('0x7'),'port':0x18eb});var io=require(_0xb0dd('0x8'))(new Redis(config['redis']));function getAuthToken(_0x1da70b,_0x439ae9,_0xe43079){if(_0x1da70b['modernAuthentication']){_0x1da70b[_0xb0dd('0x9')]=_0x1da70b[_0xb0dd('0xa')][_0xb0dd('0xb')];_0x1da70b[_0xb0dd('0xc')]=_0x1da70b[_0xb0dd('0xa')]['data2'];return Promise['resolve'](_0x1da70b['CloudProvider'][_0xb0dd('0xd')]);}var _0x1b6f05={'method':_0xb0dd('0xe'),'uri':_0x439ae9,'form':{'client_id':_0x1da70b[_0xb0dd('0xf')],'resource':_0x1da70b[_0xb0dd('0x9')],'username':_0x1da70b[_0xb0dd('0x10')],'password':_0x1da70b[_0xb0dd('0x11')],'grant_type':_0xb0dd('0x11'),'client_secret':_0x1da70b[_0xb0dd('0x12')]},'json':!![]};return rp(_0x1b6f05)[_0xb0dd('0x13')](function(_0x14f27b){return _0x14f27b[_0xb0dd('0x14')];})['catch'](function(_0x15e569){logger[_0xb0dd('0x15')]('['+[_0xe43079[_0xb0dd('0x16')]()]+_0xb0dd('0x17'));return _0x15e569['message'];});}function getUser(_0x3683ae,_0x4f84ad,_0x94be10,_0x5892db,_0x27ba39,_0x40cb8a){return new Promise(function(_0x8f6103,_0x58b387){return getAuthToken(_0x4f84ad,_0x5892db,_0x40cb8a)[_0xb0dd('0x13')](function(_0x916a59){var _0x5caaa5={'method':_0xb0dd('0x18'),'uri':_0x27ba39+_0xb0dd('0x19'),'headers':{'Authorization':'Bearer\x20'+_0x916a59,'OData-Version':'4.0'},'json':!![]};return rp(_0x5caaa5);})[_0xb0dd('0x13')](function(_0x3a0f13){var _0x3b1b0f=_0x3a0f13[_0xb0dd('0x1a')];var _0x55e043=![];var _0x3d7192=null;if(!_['isNil'](_0x94be10)){if(intUtil[_0xb0dd('0x1b')](_0x94be10[_0xb0dd('0x1c')])){_0x3683ae[_0xb0dd('0x1d')]=_0x94be10[_0xb0dd('0x1c')];for(_0x3d7192=0x0;_0x3d7192<_0x3b1b0f[_0xb0dd('0x1e')];_0x3d7192++){if(_0x3b1b0f[_0x3d7192][_0xb0dd('0x1f')]===_0x94be10[_0xb0dd('0x1c')]&&!_0x3b1b0f[_0x3d7192]['isdisabled']){_0x55e043=!![];logger[_0xb0dd('0x20')]('['+[_0x40cb8a['toUpperCase']()]+_0xb0dd('0x21')+_0x3b1b0f[_0x3d7192][_0xb0dd('0x22')]+'!');_0x3683ae[_0xb0dd('0x23')]=_0x3b1b0f[_0x3d7192]['systemuserid'];}}}}if(!_0x55e043){logger['info']('['+[_0x40cb8a['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x3683ae['userEmail']=_0x4f84ad['username'];for(_0x3d7192=0x0;_0x3d7192<_0x3b1b0f[_0xb0dd('0x1e')];_0x3d7192++){if(_0x3b1b0f[_0x3d7192][_0xb0dd('0x1f')]===_0x4f84ad[_0xb0dd('0x10')]){_0x3683ae['userId']=_0x3b1b0f[_0x3d7192][_0xb0dd('0x22')];}}}_0x8f6103(_0x3683ae);})[_0xb0dd('0x24')](function(_0x2ea89c){_0x58b387(_0x2ea89c[_0xb0dd('0x25')]);});});}function createEndUser(_0x11adbe,_0x5420dd,_0x3c645c,_0x5f42f7,_0x324f6d,_0x46b65a){return new Promise(function(_0x139337,_0x48dfa5){return getAuthToken(_0x5420dd,_0x3c645c,_0x46b65a)[_0xb0dd('0x13')](function(_0x552aba){var _0x134ef6=_0x46b65a[_0xb0dd('0x26')]()==='outbound'?_0x324f6d[_0xb0dd('0x27')]:_0x324f6d['calleridnum'];var _0x6d508a={'method':'POST','uri':_0x5f42f7+'contacts','body':{'telephone1':_0x134ef6,'fullname':_0x134ef6,'firstname':_0x134ef6,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xb0dd('0x28')+_0x11adbe[_0xb0dd('0x23')]+')'},'headers':{'Authorization':_0xb0dd('0x29')+_0x552aba,'OData-Version':_0xb0dd('0x2a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x6d508a);})[_0xb0dd('0x13')](function(_0x5ee011){var _0x3e422c=_0x5ee011[_0xb0dd('0x2b')][_0xb0dd('0x2c')];var _0x28cada=_0x3e422c['substring'](_0x3e422c[_0xb0dd('0x2d')]('(')+0x1,_0x3e422c[_0xb0dd('0x2d')](')'));_0x11adbe[_0xb0dd('0x2e')]=_0x28cada;_0x139337(_0x11adbe);})['catch'](function(_0x4b0e9d){_0x48dfa5(_0x4b0e9d['message']);});});}function getEndUser(_0x3db9b7,_0x360f75,_0x51adce,_0x76f9a1,_0x120b9d,_0x345c1,_0x502021){var _0x4b7715=_0x345c1[_0xb0dd('0x26')]()==='outbound'?_0x120b9d[_0xb0dd('0x27')]:_0x120b9d[_0xb0dd('0x2f')];return getAuthToken(_0x360f75,_0x51adce,_0x345c1)[_0xb0dd('0x13')](function(_0xb1f02b){var _0x4d98cd={'method':_0xb0dd('0x18'),'uri':_0x76f9a1+_0xb0dd('0x30')+_0x4b7715[_0xb0dd('0x31')]('+','%2b')+'\x27','headers':{'Authorization':_0xb0dd('0x29')+_0xb1f02b,'If-None-Match':null,'OData-Version':_0xb0dd('0x2a')},'json':!![]};return rp(_0x4d98cd);})[_0xb0dd('0x13')](function(_0x1ac0e0){var _0x284ec4=![];if(!_0x1ac0e0)return _0x284ec4;var _0x584c1a=_0x1ac0e0[_0xb0dd('0x1a')];for(var _0x300d4e=0x0;_0x300d4e<_0x584c1a[_0xb0dd('0x1e')];_0x300d4e++){if(_0x584c1a[_0x300d4e][_0xb0dd('0x32')]===_0x4b7715){_0x284ec4=!![];_0x3db9b7['enduserId']=_0x584c1a[_0x300d4e][_0xb0dd('0x33')];}}return _0x284ec4;})[_0xb0dd('0x13')](function(_0x43785d){if(_0x43785d)return _0x3db9b7;if(_0x502021===_0xb0dd('0x34')){logger[_0xb0dd('0x20')]('['+[_0x345c1['toUpperCase']()]+_0xb0dd('0x35'));return _0x3db9b7;}return createEndUser(_0x3db9b7,_0x360f75,_0x51adce,_0x76f9a1,_0x120b9d,_0x345c1)[_0xb0dd('0x13')](function(_0x5eedad){logger['info']('['+[_0x345c1[_0xb0dd('0x16')]()]+_0xb0dd('0x36'),_0x5eedad[_0xb0dd('0x2e')]);return _0x5eedad;});});}function getCustomFields(_0x30c626,_0x1e967f,_0x2d478e){var _0x4a0e96={};if(_0x30c626[_0xb0dd('0x1e')]>0x0){_[_0xb0dd('0x37')](_0x30c626,function(_0x4bd209){if(_['includes']([_0xb0dd('0x38'),'picklist'],_0x4bd209[_0xb0dd('0x39')])&&_0x4bd209['nameField']&&!_0x4bd209[_0xb0dd('0x3a')]){var _0x242832=_0x4bd209[_0xb0dd('0x3b')]['toLowerCase']();var _0x77d1d5=_0x242832[_0xb0dd('0x3c')](0x0,_0x242832[_0xb0dd('0x3d')]('_'));var _0x106039=_0x242832['substring'](_0x242832['indexOf']('_')+0x1);if(_0x77d1d5===_0x2d478e){_0x4a0e96[_0x106039]=_0x4bd209['content'];}}});}return _0x4a0e96;}function getTicket(_0x2f8efe,_0x575e3c,_0x599c9c,_0x170d6b,_0x14fdda,_0x48646a,_0xe4e231){return new Promise(function(_0x5cd3f5,_0x34d8a6){var _0x427a9b;return getAuthToken(_0x575e3c,_0x599c9c,_0xe4e231)[_0xb0dd('0x13')](function(_0x4dbb35){if(_0x48646a[_0xb0dd('0x3e')]===_0xb0dd('0x3f')){_0x427a9b={'method':_0xb0dd('0xe'),'uri':_0x170d6b+_0xb0dd('0x40'),'body':Object[_0xb0dd('0x41')]({},{'title':intUtil[_0xb0dd('0x42')](_0x48646a[_0xb0dd('0x43')],_0x14fdda,'\x20'),'description':intUtil[_0xb0dd('0x42')](_0x48646a[_0xb0dd('0x44')],_0x14fdda,'\x0a'),'customerid_contact@odata.bind':_0x2f8efe['enduserId']?_0xb0dd('0x45')+_0x2f8efe[_0xb0dd('0x2e')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2f8efe[_0xb0dd('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x48646a[_0xb0dd('0x46')],_0x14fdda,_0x48646a[_0xb0dd('0x3e')])),'headers':{'Authorization':_0xb0dd('0x29')+_0x4dbb35,'OData-Version':_0xb0dd('0x2a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x48646a[_0xb0dd('0x3e')]===_0xb0dd('0x47')){var _0x32c06a=_0x2f8efe[_0xb0dd('0x2e')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2f8efe[_0xb0dd('0x23')]+')','participationtypemask':_0x2f8efe[_0xb0dd('0x48')]===_0xb0dd('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0xb0dd('0x45')+_0x2f8efe[_0xb0dd('0x2e')]+')','participationtypemask':_0x2f8efe[_0xb0dd('0x48')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xb0dd('0x28')+_0x2f8efe['userId']+')','participationtypemask':_0x2f8efe[_0xb0dd('0x48')]==='queue'?0x2:0x1}];_0x427a9b={'method':'POST','uri':_0x170d6b+_0xb0dd('0x4a'),'body':Object[_0xb0dd('0x41')]({},{'subject':intUtil[_0xb0dd('0x42')](_0x48646a[_0xb0dd('0x43')],_0x14fdda,'\x20'),'phonenumber':String(_0x14fdda[_0xb0dd('0x2f')]),'description':intUtil['getString'](_0x48646a['Descriptions'],_0x14fdda,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2f8efe[_0xb0dd('0x2e')]?_0xb0dd('0x45')+_0x2f8efe[_0xb0dd('0x2e')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2f8efe['userId']+')','directioncode':_0x2f8efe[_0xb0dd('0x48')]===_0xb0dd('0x49')?![]:!![],'phonecall_activity_parties':_0x32c06a},getCustomFields(_0x48646a[_0xb0dd('0x46')],_0x14fdda,_0x48646a[_0xb0dd('0x3e')])),'headers':{'Authorization':_0xb0dd('0x29')+_0x4dbb35,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x427a9b);})[_0xb0dd('0x13')](function(_0xf67e94){var _0x2859ce=_0xf67e94[_0xb0dd('0x2b')]['odata-entityid'];var _0x1a5a16=_0x2859ce[_0xb0dd('0x3c')](_0x2859ce[_0xb0dd('0x2d')]('(')+0x1,_0x2859ce['lastIndexOf'](')'));_0x2f8efe[_0xb0dd('0x4b')]=_0x1a5a16;_0x5cd3f5(_0x2f8efe);})[_0xb0dd('0x24')](function(_0x5cafa7){_0x34d8a6(_0x5cafa7[_0xb0dd('0x25')]);});});}function emit(_0x30271d,_0x15abd5,_0x12cd16,_0x180877){var _0x40dec7={'uri':util['format'](_0xb0dd('0x4c'),_0x30271d,_0x12cd16,_0x180877)};io['to'](util[_0xb0dd('0x4d')]('user:%s',_0x15abd5))[_0xb0dd('0x4e')]('trigger:browser:url',_0x40dec7);}exports['cs']=function(_0x14fe1b,_0x1ef9e4,_0x208317,_0x5030d2,_0x3cb3d8,_0x4c3abd,_0x3f348e,_0x182fed){var _0x4ece39={};_0x4c3abd[_0xb0dd('0x9')]=_0x4c3abd[_0xb0dd('0x4f')]?intUtil['stripTrailingSlash'](_0x4c3abd[_0xb0dd('0xa')][_0xb0dd('0xb')]):intUtil[_0xb0dd('0x50')](_0x4c3abd['remoteUri']);_0x4c3abd[_0xb0dd('0x51')]=intUtil[_0xb0dd('0x50')](_0x4c3abd[_0xb0dd('0x51')]);_0x4ece39[_0xb0dd('0x48')]=_0x182fed===_0xb0dd('0x49')||_0x182fed===_0xb0dd('0x52')?_0xb0dd('0x49'):_0xb0dd('0x53');var _0x45a626=_0x4c3abd[_0xb0dd('0x4f')]?util[_0xb0dd('0x4d')](_0xb0dd('0x54'),_0x4c3abd['CloudProvider'][_0xb0dd('0xb')]):util[_0xb0dd('0x4d')](_0xb0dd('0x54'),_0x4c3abd[_0xb0dd('0x9')]);var _0x3d1188=util['format'](_0xb0dd('0x55'),_0x4c3abd['tenantId']);var _0x2a98a7=util[_0xb0dd('0x4d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4c3abd[_0xb0dd('0x51')],_0x1ef9e4[_0xb0dd('0x56')],md5(_0x1ef9e4[_0xb0dd('0x56')]));if(_0x3cb3d8&&_0x3cb3d8[_0xb0dd('0x57')]){logger['info'](_0xb0dd('0x58'),_0xb0dd('0x59'));_0x1ef9e4[_0xb0dd('0x5a')]=_0x2a98a7;}else if(_0x3f348e&&_0x3f348e[_0xb0dd('0x5b')]&&_0x3f348e['recordingFormat']!==_0xb0dd('0x5c')){logger['info'](_0xb0dd('0x5d'),_0xb0dd('0x59'));_0x1ef9e4[_0xb0dd('0x5a')]=_0x2a98a7;}else{_0x1ef9e4[_0xb0dd('0x5a')]='';}return getUser(_0x4ece39,_0x4c3abd,_0x5030d2,_0x3d1188,_0x45a626,_0x182fed)['then'](function(_0x4bc66a){logger[_0xb0dd('0x20')]('['+_0x182fed[_0xb0dd('0x16')]()+']\x20The\x20User\x20ID\x20is:',_0x4bc66a[_0xb0dd('0x23')]);logger[_0xb0dd('0x20')]('['+_0x182fed[_0xb0dd('0x16')]()+_0xb0dd('0x5e'),_0x4bc66a[_0xb0dd('0x1d')]);return getEndUser(_0x4bc66a,_0x4c3abd,_0x3d1188,_0x45a626,_0x1ef9e4,_0x182fed,_0x208317[_0xb0dd('0x5f')]);})['then'](function(_0x387973){logger['info']('['+_0x182fed[_0xb0dd('0x16')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x387973['enduserId']);logger[_0xb0dd('0x20')]('['+_0x182fed[_0xb0dd('0x16')]()+_0xb0dd('0x60'),_0x1ef9e4[_0xb0dd('0x2f')]);return getTicket(_0x387973,_0x4c3abd,_0x3d1188,_0x45a626,_0x1ef9e4,_0x208317,_0x182fed);})[_0xb0dd('0x13')](function(_0x520568){logger['info'](util[_0xb0dd('0x4d')]('['+_0x182fed['toUpperCase']()+_0xb0dd('0x61'),_0x208317[_0xb0dd('0x3e')],_0x520568[_0xb0dd('0x4b')]));logger[_0xb0dd('0x20')](util['format']('['+_0x182fed['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x182fed));if(_0x182fed!=='unmanaged'){logger['info']('['+_0x182fed[_0xb0dd('0x16')]()+']',_0xb0dd('0x62'));emit(_0x4c3abd[_0xb0dd('0x9')],_0x5030d2[_0xb0dd('0x63')],_0x208317[_0xb0dd('0x3e')],_0x520568[_0xb0dd('0x4b')]);}})[_0xb0dd('0x24')](function(_0x29e8da){logger[_0xb0dd('0x15')]('['+_0x182fed[_0xb0dd('0x16')]()+_0xb0dd('0x64'),_0x29e8da[_0xb0dd('0x25')]);});}; \ No newline at end of file +var _0xee41=['emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','redis','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','password','then','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','isNil','validateEmail','email','userEmail','length','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','internalemailaddress','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','4.0','headers','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','value','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','string','picklist','customField','substring','indexOf','content','incident','assign','getString','Subjects','/contacts(','/systemusers(','Fields','ticketType','phonecall','callDirection','queue','phonecalls','Descriptions','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s'];(function(_0x2224e7,_0x4b3987){var _0x1294e1=function(_0x373ade){while(--_0x373ade){_0x2224e7['push'](_0x2224e7['shift']());}};_0x1294e1(++_0x4b3987);}(_0xee41,0x7b));var _0x1ee4=function(_0x2715cf,_0x517bb2){_0x2715cf=_0x2715cf-0x0;var _0x1bdcb8=_0xee41[_0x2715cf];return _0x1bdcb8;};'use strict';var _=require(_0x1ee4('0x0'));var rp=require(_0x1ee4('0x1'));var util=require(_0x1ee4('0x2'));var intUtil=require(_0x1ee4('0x3'));var md5=require(_0x1ee4('0x4'));var Redis=require(_0x1ee4('0x5'));var logger=require(_0x1ee4('0x6'))('dynamics365');var config=require('../../../../config/environment');config[_0x1ee4('0x7')]=_['defaults'](config[_0x1ee4('0x7')],{'host':_0x1ee4('0x8'),'port':0x18eb});var io=require(_0x1ee4('0x9'))(new Redis(config[_0x1ee4('0x7')]));function getAuthToken(_0x51ec61,_0x242f2f,_0xf40af7){if(_0x51ec61['modernAuthentication']){_0x51ec61[_0x1ee4('0xa')]=_0x51ec61[_0x1ee4('0xb')][_0x1ee4('0xc')];_0x51ec61[_0x1ee4('0xd')]=_0x51ec61[_0x1ee4('0xb')][_0x1ee4('0xe')];return Promise[_0x1ee4('0xf')](_0x51ec61['CloudProvider'][_0x1ee4('0x10')]);}var _0x1c38f4={'method':_0x1ee4('0x11'),'uri':_0x242f2f,'form':{'client_id':_0x51ec61[_0x1ee4('0x12')],'resource':_0x51ec61[_0x1ee4('0xa')],'username':_0x51ec61['username'],'password':_0x51ec61[_0x1ee4('0x13')],'grant_type':_0x1ee4('0x13'),'client_secret':_0x51ec61['clientSecret']},'json':!![]};return rp(_0x1c38f4)[_0x1ee4('0x14')](function(_0x1e2f9b){return _0x1e2f9b['access_token'];})[_0x1ee4('0x15')](function(_0xd3349f){logger[_0x1ee4('0x16')]('['+[_0xf40af7['toUpperCase']()]+_0x1ee4('0x17'));return _0xd3349f[_0x1ee4('0x18')];});}function getUser(_0x186d9a,_0x96e4fa,_0x28fe3b,_0x41a85a,_0x414f39,_0x4b4dcd){return new Promise(function(_0x42461c,_0x4e380c){return getAuthToken(_0x96e4fa,_0x41a85a,_0x4b4dcd)[_0x1ee4('0x14')](function(_0x40314b){var _0x19e536={'method':_0x1ee4('0x19'),'uri':_0x414f39+_0x1ee4('0x1a'),'headers':{'Authorization':_0x1ee4('0x1b')+_0x40314b,'OData-Version':'4.0'},'json':!![]};return rp(_0x19e536);})['then'](function(_0x1c1385){var _0x4d63af=_0x1c1385['value'];var _0x575f44=![];var _0x2670ad=null;if(!_[_0x1ee4('0x1c')](_0x28fe3b)){if(intUtil[_0x1ee4('0x1d')](_0x28fe3b[_0x1ee4('0x1e')])){_0x186d9a[_0x1ee4('0x1f')]=_0x28fe3b[_0x1ee4('0x1e')];for(_0x2670ad=0x0;_0x2670ad<_0x4d63af[_0x1ee4('0x20')];_0x2670ad++){if(_0x4d63af[_0x2670ad]['internalemailaddress']===_0x28fe3b[_0x1ee4('0x1e')]&&!_0x4d63af[_0x2670ad][_0x1ee4('0x21')]){_0x575f44=!![];logger[_0x1ee4('0x22')]('['+[_0x4b4dcd[_0x1ee4('0x23')]()]+_0x1ee4('0x24')+_0x4d63af[_0x2670ad][_0x1ee4('0x25')]+'!');_0x186d9a[_0x1ee4('0x26')]=_0x4d63af[_0x2670ad][_0x1ee4('0x25')];}}}}if(!_0x575f44){logger[_0x1ee4('0x22')]('['+[_0x4b4dcd['toUpperCase']()]+_0x1ee4('0x27'));_0x186d9a[_0x1ee4('0x1f')]=_0x96e4fa[_0x1ee4('0x28')];for(_0x2670ad=0x0;_0x2670ad<_0x4d63af['length'];_0x2670ad++){if(_0x4d63af[_0x2670ad][_0x1ee4('0x29')]===_0x96e4fa[_0x1ee4('0x28')]){_0x186d9a['userId']=_0x4d63af[_0x2670ad][_0x1ee4('0x25')];}}}_0x42461c(_0x186d9a);})[_0x1ee4('0x15')](function(_0x4e073e){_0x4e380c(_0x4e073e['message']);});});}function createEndUser(_0x4a35f8,_0x53b1cb,_0x5df5f8,_0x5cd228,_0xd6440f,_0x4f2a53){return new Promise(function(_0x3d6557,_0x5ec882){return getAuthToken(_0x53b1cb,_0x5df5f8,_0x4f2a53)['then'](function(_0x4fe024){var _0x2b3c06=_0x4f2a53[_0x1ee4('0x2a')]()===_0x1ee4('0x2b')?_0xd6440f[_0x1ee4('0x2c')]:_0xd6440f[_0x1ee4('0x2d')];var _0x44a39a={'method':_0x1ee4('0x11'),'uri':_0x5cd228+_0x1ee4('0x2e'),'body':{'telephone1':_0x2b3c06,'fullname':_0x2b3c06,'firstname':_0x2b3c06,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x4a35f8[_0x1ee4('0x26')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x4fe024,'OData-Version':_0x1ee4('0x2f')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x44a39a);})['then'](function(_0x4dcebb){var _0x392043=_0x4dcebb[_0x1ee4('0x30')]['odata-entityid'];var _0x4586c1=_0x392043['substring'](_0x392043['lastIndexOf']('(')+0x1,_0x392043[_0x1ee4('0x31')](')'));_0x4a35f8[_0x1ee4('0x32')]=_0x4586c1;_0x3d6557(_0x4a35f8);})[_0x1ee4('0x15')](function(_0x3a713d){_0x5ec882(_0x3a713d[_0x1ee4('0x18')]);});});}function getEndUser(_0x5ca0c1,_0x51b425,_0x5cee9c,_0x3585f7,_0x54449c,_0x37e776,_0x42f3d9){var _0x1487c3=_0x37e776[_0x1ee4('0x2a')]()===_0x1ee4('0x2b')?_0x54449c['destcalleridnum']:_0x54449c[_0x1ee4('0x2d')];return getAuthToken(_0x51b425,_0x5cee9c,_0x37e776)[_0x1ee4('0x14')](function(_0x452d35){var _0x54284a={'method':_0x1ee4('0x19'),'uri':_0x3585f7+_0x1ee4('0x33')+_0x1487c3['replace']('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x452d35,'If-None-Match':null,'OData-Version':_0x1ee4('0x2f')},'json':!![]};return rp(_0x54284a);})['then'](function(_0x24016a){var _0x272be5=![];if(!_0x24016a)return _0x272be5;var _0x3321c8=_0x24016a[_0x1ee4('0x34')];for(var _0x456882=0x0;_0x456882<_0x3321c8[_0x1ee4('0x20')];_0x456882++){if(_0x3321c8[_0x456882][_0x1ee4('0x35')]===_0x1487c3){_0x272be5=!![];_0x5ca0c1[_0x1ee4('0x32')]=_0x3321c8[_0x456882][_0x1ee4('0x36')];}}return _0x272be5;})['then'](function(_0x5aa1b4){if(_0x5aa1b4)return _0x5ca0c1;if(_0x42f3d9===_0x1ee4('0x37')){logger['info']('['+[_0x37e776['toUpperCase']()]+_0x1ee4('0x38'));return _0x5ca0c1;}return createEndUser(_0x5ca0c1,_0x51b425,_0x5cee9c,_0x3585f7,_0x54449c,_0x37e776)[_0x1ee4('0x14')](function(_0x382be7){logger[_0x1ee4('0x22')]('['+[_0x37e776[_0x1ee4('0x23')]()]+_0x1ee4('0x39'),_0x382be7[_0x1ee4('0x32')]);return _0x382be7;});});}function getCustomFields(_0x4eb0cd,_0x3ae346,_0x2b7dbd){var _0x65e1fa={};if(_0x4eb0cd[_0x1ee4('0x20')]>0x0){_['forEach'](_0x4eb0cd,function(_0x3adfd4){if(_[_0x1ee4('0x3a')]([_0x1ee4('0x3b'),_0x1ee4('0x3c')],_0x3adfd4['type'])&&_0x3adfd4['nameField']&&!_0x3adfd4[_0x1ee4('0x3d')]){var _0x52565f=_0x3adfd4['idField'][_0x1ee4('0x2a')]();var _0x452aed=_0x52565f[_0x1ee4('0x3e')](0x0,_0x52565f[_0x1ee4('0x3f')]('_'));var _0x26ef6d=_0x52565f['substring'](_0x52565f['indexOf']('_')+0x1);if(_0x452aed===_0x2b7dbd){_0x65e1fa[_0x26ef6d]=_0x3adfd4[_0x1ee4('0x40')];}}});}return _0x65e1fa;}function getTicket(_0xe5846f,_0x30260e,_0x3dda35,_0x1b2eb4,_0x163fd5,_0x2fc4ed,_0x28b6c6){return new Promise(function(_0x13338a,_0x3b7cb7){var _0x160b7e;return getAuthToken(_0x30260e,_0x3dda35,_0x28b6c6)['then'](function(_0x1d4c03){if(_0x2fc4ed['ticketType']===_0x1ee4('0x41')){_0x160b7e={'method':_0x1ee4('0x11'),'uri':_0x1b2eb4+'incidents','body':Object[_0x1ee4('0x42')]({},{'title':intUtil[_0x1ee4('0x43')](_0x2fc4ed[_0x1ee4('0x44')],_0x163fd5,'\x20'),'description':intUtil[_0x1ee4('0x43')](_0x2fc4ed['Descriptions'],_0x163fd5,'\x0a'),'customerid_contact@odata.bind':_0xe5846f[_0x1ee4('0x32')]?_0x1ee4('0x45')+_0xe5846f['enduserId']+')':undefined,'ownerid@odata.bind':_0x1ee4('0x46')+_0xe5846f[_0x1ee4('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x2fc4ed[_0x1ee4('0x47')],_0x163fd5,_0x2fc4ed[_0x1ee4('0x48')])),'headers':{'Authorization':_0x1ee4('0x1b')+_0x1d4c03,'OData-Version':_0x1ee4('0x2f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2fc4ed['ticketType']===_0x1ee4('0x49')){var _0x50cf3d=_0xe5846f['enduserId']?[{'partyid_systemuser@odata.bind':_0x1ee4('0x46')+_0xe5846f[_0x1ee4('0x26')]+')','participationtypemask':_0xe5846f[_0x1ee4('0x4a')]===_0x1ee4('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':_0x1ee4('0x45')+_0xe5846f['enduserId']+')','participationtypemask':_0xe5846f['callDirection']===_0x1ee4('0x4b')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x1ee4('0x46')+_0xe5846f[_0x1ee4('0x26')]+')','participationtypemask':_0xe5846f[_0x1ee4('0x4a')]===_0x1ee4('0x4b')?0x2:0x1}];_0x160b7e={'method':'POST','uri':_0x1b2eb4+_0x1ee4('0x4c'),'body':Object[_0x1ee4('0x42')]({},{'subject':intUtil[_0x1ee4('0x43')](_0x2fc4ed[_0x1ee4('0x44')],_0x163fd5,'\x20'),'phonenumber':String(_0x163fd5['calleridnum']),'description':intUtil[_0x1ee4('0x43')](_0x2fc4ed[_0x1ee4('0x4d')],_0x163fd5,'\x0a'),'regardingobjectid_contact@odata.bind':_0xe5846f['enduserId']?_0x1ee4('0x45')+_0xe5846f['enduserId']+')':undefined,'ownerid@odata.bind':_0x1ee4('0x46')+_0xe5846f[_0x1ee4('0x26')]+')','directioncode':_0xe5846f['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':_0x50cf3d},getCustomFields(_0x2fc4ed[_0x1ee4('0x47')],_0x163fd5,_0x2fc4ed[_0x1ee4('0x48')])),'headers':{'Authorization':_0x1ee4('0x1b')+_0x1d4c03,'OData-Version':_0x1ee4('0x2f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x160b7e);})[_0x1ee4('0x14')](function(_0x16420c){var _0x4d54a7=_0x16420c[_0x1ee4('0x30')][_0x1ee4('0x4e')];var _0x507696=_0x4d54a7['substring'](_0x4d54a7[_0x1ee4('0x31')]('(')+0x1,_0x4d54a7[_0x1ee4('0x31')](')'));_0xe5846f[_0x1ee4('0x4f')]=_0x507696;_0x13338a(_0xe5846f);})[_0x1ee4('0x15')](function(_0x5b1778){_0x3b7cb7(_0x5b1778[_0x1ee4('0x18')]);});});}function emit(_0x1e490f,_0x51bc59,_0x5ef1e9,_0x3c0ca4){var _0x2bd03b={'uri':util[_0x1ee4('0x50')](_0x1ee4('0x51'),_0x1e490f,_0x5ef1e9,_0x3c0ca4)};io['to'](util['format'](_0x1ee4('0x52'),_0x51bc59))[_0x1ee4('0x53')](_0x1ee4('0x54'),_0x2bd03b);}exports['cs']=function(_0x2da161,_0x572a40,_0x3254be,_0x3c2014,_0xe91c1d,_0x1c1c08,_0x2fd363,_0x21deca){var _0x21c185={};_0x1c1c08['remoteUri']=_0x1c1c08[_0x1ee4('0x55')]?intUtil[_0x1ee4('0x56')](_0x1c1c08['CloudProvider']['data7']):intUtil[_0x1ee4('0x56')](_0x1c1c08[_0x1ee4('0xa')]);_0x1c1c08[_0x1ee4('0x57')]=intUtil[_0x1ee4('0x56')](_0x1c1c08['serverUrl']);_0x21c185[_0x1ee4('0x4a')]=_0x21deca===_0x1ee4('0x4b')||_0x21deca===_0x1ee4('0x58')?_0x1ee4('0x4b'):_0x1ee4('0x2b');var _0x10b541=_0x1c1c08[_0x1ee4('0x55')]?util[_0x1ee4('0x50')](_0x1ee4('0x59'),_0x1c1c08['CloudProvider'][_0x1ee4('0xc')]):util[_0x1ee4('0x50')]('%s/api/data/v9.0/',_0x1c1c08[_0x1ee4('0xa')]);var _0x52821c=util[_0x1ee4('0x50')](_0x1ee4('0x5a'),_0x1c1c08[_0x1ee4('0xd')]);var _0x2faa2a=util[_0x1ee4('0x50')](_0x1ee4('0x5b'),_0x1c1c08[_0x1ee4('0x57')],_0x572a40[_0x1ee4('0x5c')],md5(_0x572a40['uniqueid']));if(_0xe91c1d&&_0xe91c1d['monitor_format']){logger[_0x1ee4('0x22')](_0x1ee4('0x5d'),_0x1ee4('0x5e'));_0x572a40[_0x1ee4('0x5f')]=_0x2faa2a;}else if(_0x2fd363&&_0x2fd363[_0x1ee4('0x60')]&&_0x2fd363['recordingFormat']!=='none'){logger['info'](_0x1ee4('0x61'),_0x1ee4('0x5e'));_0x572a40[_0x1ee4('0x5f')]=_0x2faa2a;}else{_0x572a40[_0x1ee4('0x5f')]='';}return getUser(_0x21c185,_0x1c1c08,_0x3c2014,_0x52821c,_0x10b541,_0x21deca)[_0x1ee4('0x14')](function(_0x5a9d60){logger[_0x1ee4('0x22')]('['+_0x21deca[_0x1ee4('0x23')]()+_0x1ee4('0x62'),_0x5a9d60['userId']);logger['info']('['+_0x21deca[_0x1ee4('0x23')]()+_0x1ee4('0x63'),_0x5a9d60[_0x1ee4('0x1f')]);return getEndUser(_0x5a9d60,_0x1c1c08,_0x52821c,_0x10b541,_0x572a40,_0x21deca,_0x3254be['moduleCreate']);})['then'](function(_0x4115bf){logger['info']('['+_0x21deca['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x4115bf[_0x1ee4('0x32')]);logger[_0x1ee4('0x22')]('['+_0x21deca[_0x1ee4('0x23')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x572a40[_0x1ee4('0x2d')]);return getTicket(_0x4115bf,_0x1c1c08,_0x52821c,_0x10b541,_0x572a40,_0x3254be,_0x21deca);})[_0x1ee4('0x14')](function(_0x30c68){logger[_0x1ee4('0x22')](util[_0x1ee4('0x50')]('['+_0x21deca['toUpperCase']()+_0x1ee4('0x64'),_0x3254be['ticketType'],_0x30c68['ticketId']));logger['info'](util['format']('['+_0x21deca['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x21deca));if(_0x21deca!=='unmanaged'){logger['info']('['+_0x21deca[_0x1ee4('0x23')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1c1c08[_0x1ee4('0xa')],_0x3c2014[_0x1ee4('0x65')],_0x3254be['ticketType'],_0x30c68['ticketId']);}})[_0x1ee4('0x15')](function(_0x481f9e){logger['error']('['+_0x21deca[_0x1ee4('0x23')]()+_0x1ee4('0x66'),_0x481f9e[_0x1ee4('0x18')]);});}; \ 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 31dbb78..0b3876e 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 _0xf970=['The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','[QUEUE]','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','unmanaged','lastevent','toUpperCase','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','GET','map','includes','string','picklist','customField','nameField','toLowerCase','content','toString','type','idField','variable','variableName','push','customVariable','Variable','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization'];(function(_0x1e92f9,_0x286900){var _0x5950ed=function(_0x30941c){while(--_0x30941c){_0x1e92f9['push'](_0x1e92f9['shift']());}};_0x5950ed(++_0x286900);}(_0xf970,0x185));var _0x0f97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf970[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require(_0x0f97('0x0'));var md5=require('md5');var util=require(_0x0f97('0x1'));var Redis=require(_0x0f97('0x2'));var intUtil=require('./util');var config=require(_0x0f97('0x3'));var logger=require(_0x0f97('0x4'))('freshdesk');config[_0x0f97('0x5')]=_['defaults'](config[_0x0f97('0x5')],{'host':_0x0f97('0x6'),'port':0x18eb});var io=require(_0x0f97('0x7'))(new Redis(config[_0x0f97('0x5')]));var headers={'Content-Type':_0x0f97('0x8'),'Accept':'application/json'};function emit(_0x535e42,_0x5cfd46,_0x227cb8){io['to'](_0x535e42)[_0x0f97('0x9')](_0x5cfd46,_0x227cb8);}function getTicket(_0x3c7752,_0x28e25a,_0x21c444,_0x1941a7,_0x13ef41){logger['info'](_0x0f97('0xa'));var _0x2a1389=_['merge']({'responder_id':_0x28e25a['id'],'requester_id':_0x21c444['id'],'name':util[_0x0f97('0xb')](_0x0f97('0xc'),_0x13ef41[_0x0f97('0xd')]),'phone':_0x13ef41[_0x0f97('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x0f97('0xf')](_0x1941a7[_0x0f97('0x10')],_0x13ef41,'\x20'),'description':intUtil[_0x0f97('0xf')](_0x1941a7[_0x0f97('0x11')],_0x13ef41,_0x0f97('0x12')),'tags':getTags(_0x1941a7[_0x0f97('0x13')],_0x0f97('0x14'))},getCustomFields(_0x1941a7['Fields'],_0x13ef41));_0x2a1389[_0x0f97('0x15')]=_[_0x0f97('0x16')](_[_0x0f97('0x17')](_0x2a1389[_0x0f97('0x15')],'id'),'value');return request({'uri':util[_0x0f97('0xb')](_0x0f97('0x18'),_0x3c7752[_0x0f97('0x19')]),'method':_0x0f97('0x1a'),'body':_0x2a1389})[_0x0f97('0x1b')](function(_0x2b8115){logger[_0x0f97('0x1c')](_0x0f97('0x1d'));return _0x2b8115;});}function getUser(_0x3cbdea,_0x566a75){if(intUtil[_0x0f97('0x1e')](_0x566a75)){return request({'uri':util[_0x0f97('0xb')](_0x0f97('0x1f'),_0x3cbdea[_0x0f97('0x19')]),'qs':{'email':_0x566a75}})['then'](function(_0x471625){if(_0x471625[_0x0f97('0x20')]){logger[_0x0f97('0x1c')](_0x0f97('0x21'));return _['find'](_0x471625,function(_0x7cfe41){return _0x7cfe41['contact'][_0x0f97('0x22')]===_0x566a75;});}else{logger[_0x0f97('0x1c')](_0x0f97('0x23'));return request({'uri':util[_0x0f97('0xb')]('%s/api/v2/agents/me',_0x3cbdea[_0x0f97('0x19')])})['then'](function(_0x2c2798){logger[_0x0f97('0x1c')](_0x0f97('0x24'));return _0x2c2798;});}});}else{logger[_0x0f97('0x1c')](_0x0f97('0x25'));return request({'uri':util[_0x0f97('0xb')](_0x0f97('0x26'),_0x3cbdea[_0x0f97('0x19')])})['then'](function(_0x52f26f){logger[_0x0f97('0x1c')]('Admin\x20account\x20selected.');return _0x52f26f;});}}function getEndUser(_0x454871,_0x3ff1f8,_0x5c5176){logger['info'](_0x0f97('0x27'),_0x5c5176);return request({'uri':util[_0x0f97('0xb')](_0x0f97('0x28'),_0x454871[_0x0f97('0x19')]),'qs':{'phone':_0x5c5176}})[_0x0f97('0x1b')](function(_0x36c8c2){if(_0x36c8c2[_0x0f97('0x20')]){logger[_0x0f97('0x1c')](_0x0f97('0x29'));return _[_0x0f97('0x2a')](_0x36c8c2,{'phone':_0x5c5176});}else{logger[_0x0f97('0x1c')](_0x0f97('0x2b'));return request({'uri':util['format'](_0x0f97('0x28'),_0x454871[_0x0f97('0x19')]),'method':'POST','body':{'name':_0x3ff1f8,'phone':_0x5c5176}})[_0x0f97('0x1b')](function(_0xc6872){logger['info'](_0x0f97('0x2c'));return _0xc6872;});}});}function getAuth(_0x28dfd7){return util[_0x0f97('0xb')](_0x0f97('0x2d'),new Buffer(_0x28dfd7[_0x0f97('0x2e')]+':X')['toString'](_0x0f97('0x2f')));}function request(_0x2d5dee){logger[_0x0f97('0x30')](_0x0f97('0x31'),JSON[_0x0f97('0x32')](_0x2d5dee));return rp(_['defaults'](_0x2d5dee,{'method':_0x0f97('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x50a1db,_0x410a4b){var _0x158fef=[];if(_0x50a1db&&_0x50a1db[_0x0f97('0x20')]>0x0){_0x158fef=_[_0x0f97('0x34')](_0x50a1db,_0x410a4b);}return _0x158fef;}function getCustomFields(_0x259320,_0x4dc5b2){var _0x3cb44d=[];var _0x575231={'custom_fields':[]};if(_0x259320[_0x0f97('0x20')]>0x0){_['forEach'](_0x259320,function(_0x4fa4e5){if(_[_0x0f97('0x35')]([_0x0f97('0x36'),_0x0f97('0x37')],_0x4fa4e5['type'])&&_0x4fa4e5['nameField']&&!_0x4fa4e5[_0x0f97('0x38')]){_0x575231[_0x4fa4e5[_0x0f97('0x39')][_0x0f97('0x3a')]()]=_0x4fa4e5[_0x0f97('0x3b')][_0x0f97('0x3c')]();}else if(_['includes']([_0x0f97('0x36'),_0x0f97('0x37')],_0x4fa4e5[_0x0f97('0x3d')])&&_0x4fa4e5[_0x0f97('0x3e')]&&_0x4fa4e5[_0x0f97('0x38')]){_0x575231[_0x0f97('0x15')]['push']({'id':_0x4fa4e5['idField'],'value':_0x4fa4e5[_0x0f97('0x3b')][_0x0f97('0x3c')]()});}else if(_0x4fa4e5[_0x0f97('0x3d')]===_0x0f97('0x3f')&&_0x4fa4e5[_0x0f97('0x40')]&&_0x4fa4e5[_0x0f97('0x3e')]&&_0x4fa4e5[_0x0f97('0x38')]){_0x4dc5b2[_0x4fa4e5['variableName']]&&_0x575231[_0x0f97('0x15')][_0x0f97('0x41')]({'id':_0x4fa4e5['idField'],'value':_0x4dc5b2[_0x4fa4e5[_0x0f97('0x40')]][_0x0f97('0x3c')]()});}else if(_0x4fa4e5['type']===_0x0f97('0x42')&&_0x4fa4e5['Variable']&&_0x4fa4e5[_0x0f97('0x43')]['name']&&_0x4fa4e5['idField']&&_0x4fa4e5[_0x0f97('0x38')]){_0x4dc5b2[_0x4fa4e5['Variable'][_0x0f97('0x14')][_0x0f97('0x3a')]()]&&_0x575231[_0x0f97('0x15')][_0x0f97('0x41')]({'id':_0x4fa4e5[_0x0f97('0x3e')],'value':_0x4dc5b2[_0x4fa4e5[_0x0f97('0x43')][_0x0f97('0x14')]['toLowerCase']()][_0x0f97('0x3c')]()});}});}return _0x575231;}exports['queue']=function(_0x4b2527,_0x339cbd,_0x56e7e2,_0x3dc1e3,_0x1a01b4,_0x4520c6){var _0xc1c9a3,_0x39234d;_0x4520c6[_0x0f97('0x19')]=intUtil['stripTrailingSlash'](_0x4520c6['remoteUri']);_0x4520c6[_0x0f97('0x44')]=intUtil[_0x0f97('0x45')](_0x4520c6[_0x0f97('0x44')]);if(_0x1a01b4&&_0x1a01b4[_0x0f97('0x46')]){logger['info']('[QUEUE]',_0x0f97('0x47'));_0x339cbd['recordingURL']=util['format'](_0x0f97('0x48'),_0x4520c6[_0x0f97('0x44')],_0x339cbd[_0x0f97('0x49')],md5(_0x339cbd['uniqueid']));}else{_0x339cbd[_0x0f97('0x4a')]='';}headers[_0x0f97('0x4b')]=getAuth(_0x4520c6);return getUser(_0x4520c6,_0x3dc1e3['email'])[_0x0f97('0x1b')](function(_0x396957){_0xc1c9a3=_0x396957;logger[_0x0f97('0x1c')](_0x0f97('0x4c'),_0xc1c9a3['id']);return getEndUser(_0x4520c6,_0x339cbd[_0x0f97('0xd')],_0x339cbd[_0x0f97('0xe')]);})[_0x0f97('0x1b')](function(_0x10016c){_0x39234d=_0x10016c;logger[_0x0f97('0x1c')](_0x0f97('0x4d'),_0x39234d['id']);return getTicket(_0x4520c6,_0xc1c9a3,_0x39234d,_0x56e7e2,_0x339cbd);})[_0x0f97('0x1b')](function(_0x1534e5){if(_0x1534e5&&_0x1534e5['id']){logger[_0x0f97('0x1c')](_0x0f97('0x1d'));logger[_0x0f97('0x1c')](_0x0f97('0x4e'),_0x1534e5['id']);logger[_0x0f97('0x1c')]('[QUEUE]',_0x0f97('0x4f'));emit(util[_0x0f97('0xb')](_0x0f97('0x50'),_0x3dc1e3[_0x0f97('0x14')]),_0x0f97('0x51'),{'uri':util[_0x0f97('0xb')]('%s/helpdesk/tickets/%d',_0x4520c6[_0x0f97('0x19')],_0x1534e5['id'])});}})[_0x0f97('0x52')](function(_0x3b433e){logger[_0x0f97('0x53')](_0x0f97('0x54'),JSON['stringify'](_0x3b433e));});};exports[_0x0f97('0x55')]=function(_0x97cb0e,_0x53420b,_0x1dc86f,_0x33f192,_0x37a029,_0x144260,_0x1f229e){var _0x458a80,_0x3b9f20;_0x144260[_0x0f97('0x19')]=intUtil[_0x0f97('0x45')](_0x144260[_0x0f97('0x19')]);_0x144260[_0x0f97('0x44')]=intUtil[_0x0f97('0x45')](_0x144260[_0x0f97('0x44')]);if(_0x1f229e&&_0x1f229e['recordingFormat']&&_0x1f229e[_0x0f97('0x56')]!=='none'){logger[_0x0f97('0x1c')](_0x0f97('0x57'),'Recording\x20is\x20enabled!');_0x53420b['recordingURL']=util[_0x0f97('0xb')](_0x0f97('0x48'),_0x144260['serverUrl'],_0x53420b[_0x0f97('0x49')],md5(_0x53420b[_0x0f97('0x49')]));}headers[_0x0f97('0x4b')]=getAuth(_0x144260);return getUser(_0x144260,_0x33f192[_0x0f97('0x22')])[_0x0f97('0x1b')](function(_0xc3bc1a){_0x458a80=_0xc3bc1a;logger['info'](_0x0f97('0x4c'),_0x458a80['id']);return getEndUser(_0x144260,_0x53420b[_0x0f97('0x58')],_0x53420b[_0x0f97('0x59')]);})[_0x0f97('0x1b')](function(_0x137df4){_0x3b9f20=_0x137df4;logger['info'](_0x0f97('0x4d'),_0x3b9f20['id']);return getTicket(_0x144260,_0x458a80,_0x3b9f20,_0x1dc86f,_0x53420b);})[_0x0f97('0x1b')](function(_0x56c407){if(_0x56c407&&_0x56c407['id']){logger[_0x0f97('0x1c')](_0x0f97('0x1d'));logger[_0x0f97('0x1c')](_0x0f97('0x4e'),_0x56c407['id']);logger[_0x0f97('0x1c')]('[OUTBOUND]',_0x0f97('0x4f'));emit(util[_0x0f97('0xb')](_0x0f97('0x50'),_0x33f192[_0x0f97('0x14')]),_0x0f97('0x51'),{'uri':util[_0x0f97('0xb')]('%s/helpdesk/tickets/%d',_0x144260[_0x0f97('0x19')],_0x56c407['id'])});}})[_0x0f97('0x52')](function(_0x14c9ed){logger['error'](_0x0f97('0x57'),JSON['stringify'](_0x14c9ed));});};exports[_0x0f97('0x5a')]=function(_0x320307,_0xa1d347,_0x53bbfa,_0x302004,_0x14c3f7,_0x4ed016){var _0x910200,_0x1e848c;_0x4ed016[_0x0f97('0x19')]=intUtil[_0x0f97('0x45')](_0x4ed016['remoteUri']);_0x4ed016[_0x0f97('0x44')]=intUtil['stripTrailingSlash'](_0x4ed016[_0x0f97('0x44')]);if(_0x14c3f7&&_0x14c3f7[_0x0f97('0x46')]){logger[_0x0f97('0x1c')]('['+_0xa1d347[_0x0f97('0x5b')][_0x0f97('0x5c')]()+']','Recording\x20is\x20enabled!');_0xa1d347[_0x0f97('0x4a')]=util[_0x0f97('0xb')](_0x0f97('0x48'),_0x4ed016[_0x0f97('0x44')],_0xa1d347[_0x0f97('0x49')],md5(_0xa1d347[_0x0f97('0x49')]));}else{_0xa1d347[_0x0f97('0x4a')]='';}headers[_0x0f97('0x4b')]=getAuth(_0x4ed016);return getUser(_0x4ed016,'')[_0x0f97('0x1b')](function(_0x24a70e){_0x910200=_0x24a70e;logger[_0x0f97('0x1c')](_0x0f97('0x4c'),_0x910200['id']);return getEndUser(_0x4ed016,_0xa1d347['calleridname'],_0xa1d347[_0x0f97('0xe')]);})['then'](function(_0x11f58a){_0x1e848c=_0x11f58a;logger[_0x0f97('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x1e848c['id']);return getTicket(_0x4ed016,_0x910200,_0x1e848c,_0x53bbfa,_0xa1d347);})[_0x0f97('0x1b')](function(_0xa54219){if(_0xa54219){logger['info'](_0x0f97('0x1d'));logger[_0x0f97('0x1c')]('The\x20Ticket\x20ID\x20is:',_0xa54219['id']);}})['catch'](function(_0x2ef3bc){logger[_0x0f97('0x53')]('['+_0xa1d347[_0x0f97('0x5b')][_0x0f97('0x5c')]()+']',JSON[_0x0f97('0x32')](_0x2ef3bc));});}; \ No newline at end of file +var _0x6016=['defaults','redis','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','then','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','info','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','base64','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','content','toString','idField','customField','push','variableName','customVariable','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','uniqueid','Authorization','The\x20User\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','trigger:browser:url','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk'];(function(_0x3c6cb2,_0x29baca){var _0x7127ca=function(_0x339fb0){while(--_0x339fb0){_0x3c6cb2['push'](_0x3c6cb2['shift']());}};_0x7127ca(++_0x29baca);}(_0x6016,0x11a));var _0x6601=function(_0x4bd67a,_0x4f9725){_0x4bd67a=_0x4bd67a-0x0;var _0x2be5fb=_0x6016[_0x4bd67a];return _0x2be5fb;};'use strict';var _=require(_0x6601('0x0'));var rp=require(_0x6601('0x1'));var md5=require(_0x6601('0x2'));var util=require(_0x6601('0x3'));var Redis=require(_0x6601('0x4'));var intUtil=require(_0x6601('0x5'));var config=require(_0x6601('0x6'));var logger=require(_0x6601('0x7'))(_0x6601('0x8'));config['redis']=_[_0x6601('0x9')](config[_0x6601('0xa')],{'host':_0x6601('0xb'),'port':0x18eb});var io=require(_0x6601('0xc'))(new Redis(config[_0x6601('0xa')]));var headers={'Content-Type':'application/json','Accept':_0x6601('0xd')};function emit(_0xf6367f,_0x468408,_0x367552){io['to'](_0xf6367f)[_0x6601('0xe')](_0x468408,_0x367552);}function getTicket(_0x4cc8cb,_0x24792d,_0x2aecde,_0x1cba0e,_0x1811f1){logger['info'](_0x6601('0xf'));var _0x1e7e84=_[_0x6601('0x10')]({'responder_id':_0x24792d['id'],'requester_id':_0x2aecde['id'],'name':util['format'](_0x6601('0x11'),_0x1811f1[_0x6601('0x12')]),'phone':_0x1811f1[_0x6601('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x6601('0x14')](_0x1cba0e[_0x6601('0x15')],_0x1811f1,'\x20'),'description':intUtil[_0x6601('0x14')](_0x1cba0e[_0x6601('0x16')],_0x1811f1,_0x6601('0x17')),'tags':getTags(_0x1cba0e[_0x6601('0x18')],_0x6601('0x19'))},getCustomFields(_0x1cba0e[_0x6601('0x1a')],_0x1811f1));_0x1e7e84[_0x6601('0x1b')]=_[_0x6601('0x1c')](_[_0x6601('0x1d')](_0x1e7e84[_0x6601('0x1b')],'id'),_0x6601('0x1e'));return request({'uri':util[_0x6601('0x1f')](_0x6601('0x20'),_0x4cc8cb[_0x6601('0x21')]),'method':'POST','body':_0x1e7e84})[_0x6601('0x22')](function(_0xb8615d){logger['info']('Ticket\x20created!');return _0xb8615d;});}function getUser(_0x3a721f,_0xfcd603){if(intUtil['validateEmail'](_0xfcd603)){return request({'uri':util[_0x6601('0x1f')](_0x6601('0x23'),_0x3a721f[_0x6601('0x21')]),'qs':{'email':_0xfcd603}})[_0x6601('0x22')](function(_0x4db030){if(_0x4db030[_0x6601('0x24')]){logger['info'](_0x6601('0x25'));return _[_0x6601('0x26')](_0x4db030,function(_0x5aa1fb){return _0x5aa1fb[_0x6601('0x27')][_0x6601('0x28')]===_0xfcd603;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x6601('0x1f')](_0x6601('0x29'),_0x3a721f['remoteUri'])})[_0x6601('0x22')](function(_0x2b1903){logger[_0x6601('0x2a')](_0x6601('0x2b'));return _0x2b1903;});}});}else{logger[_0x6601('0x2a')](_0x6601('0x2c'));return request({'uri':util[_0x6601('0x1f')](_0x6601('0x29'),_0x3a721f[_0x6601('0x21')])})[_0x6601('0x22')](function(_0x25c18e){logger['info']('Admin\x20account\x20selected.');return _0x25c18e;});}}function getEndUser(_0x5b5d04,_0x2ce97d,_0xf5f1db){logger['info'](_0x6601('0x2d'),_0xf5f1db);return request({'uri':util['format'](_0x6601('0x2e'),_0x5b5d04['remoteUri']),'qs':{'phone':_0xf5f1db}})['then'](function(_0x1bf004){if(_0x1bf004[_0x6601('0x24')]){logger[_0x6601('0x2a')](_0x6601('0x2f'));return _[_0x6601('0x26')](_0x1bf004,{'phone':_0xf5f1db});}else{logger['info'](_0x6601('0x30'));return request({'uri':util['format'](_0x6601('0x2e'),_0x5b5d04[_0x6601('0x21')]),'method':'POST','body':{'name':_0x2ce97d,'phone':_0xf5f1db}})['then'](function(_0x130c98){logger[_0x6601('0x2a')]('Enduser\x20created.');return _0x130c98;});}});}function getAuth(_0x392dec){return util[_0x6601('0x1f')]('Basic\x20%s',new Buffer(_0x392dec[_0x6601('0x31')]+':X')['toString'](_0x6601('0x32')));}function request(_0xce99bf){logger['debug'](_0x6601('0x33'),JSON[_0x6601('0x34')](_0xce99bf));return rp(_[_0x6601('0x9')](_0xce99bf,{'method':_0x6601('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x154c12,_0x2f4b38){var _0x79cc2d=[];if(_0x154c12&&_0x154c12['length']>0x0){_0x79cc2d=_[_0x6601('0x36')](_0x154c12,_0x2f4b38);}return _0x79cc2d;}function getCustomFields(_0x10761a,_0x1f548b){var _0x5f17ef=[];var _0x4460b4={'custom_fields':[]};if(_0x10761a[_0x6601('0x24')]>0x0){_[_0x6601('0x37')](_0x10761a,function(_0x37985a){if(_[_0x6601('0x38')]([_0x6601('0x39'),_0x6601('0x3a')],_0x37985a[_0x6601('0x3b')])&&_0x37985a[_0x6601('0x3c')]&&!_0x37985a['customField']){_0x4460b4[_0x37985a[_0x6601('0x3c')]['toLowerCase']()]=_0x37985a[_0x6601('0x3d')][_0x6601('0x3e')]();}else if(_[_0x6601('0x38')](['string',_0x6601('0x3a')],_0x37985a[_0x6601('0x3b')])&&_0x37985a[_0x6601('0x3f')]&&_0x37985a[_0x6601('0x40')]){_0x4460b4[_0x6601('0x1b')][_0x6601('0x41')]({'id':_0x37985a['idField'],'value':_0x37985a['content'][_0x6601('0x3e')]()});}else if(_0x37985a[_0x6601('0x3b')]==='variable'&&_0x37985a[_0x6601('0x42')]&&_0x37985a[_0x6601('0x3f')]&&_0x37985a[_0x6601('0x40')]){_0x1f548b[_0x37985a['variableName']]&&_0x4460b4['custom_fields'][_0x6601('0x41')]({'id':_0x37985a[_0x6601('0x3f')],'value':_0x1f548b[_0x37985a[_0x6601('0x42')]][_0x6601('0x3e')]()});}else if(_0x37985a[_0x6601('0x3b')]===_0x6601('0x43')&&_0x37985a[_0x6601('0x44')]&&_0x37985a[_0x6601('0x44')][_0x6601('0x19')]&&_0x37985a['idField']&&_0x37985a[_0x6601('0x40')]){_0x1f548b[_0x37985a[_0x6601('0x44')][_0x6601('0x19')][_0x6601('0x45')]()]&&_0x4460b4[_0x6601('0x1b')][_0x6601('0x41')]({'id':_0x37985a[_0x6601('0x3f')],'value':_0x1f548b[_0x37985a[_0x6601('0x44')][_0x6601('0x19')][_0x6601('0x45')]()]['toString']()});}});}return _0x4460b4;}exports[_0x6601('0x46')]=function(_0x477dc9,_0x1b2491,_0x149bba,_0x3f93b0,_0x1a95e,_0x145f7c){var _0xb22e5c,_0x3c3f85;_0x145f7c['remoteUri']=intUtil['stripTrailingSlash'](_0x145f7c[_0x6601('0x21')]);_0x145f7c[_0x6601('0x47')]=intUtil[_0x6601('0x48')](_0x145f7c[_0x6601('0x47')]);if(_0x1a95e&&_0x1a95e[_0x6601('0x49')]){logger['info'](_0x6601('0x4a'),'Recording\x20is\x20enabled!');_0x1b2491['recordingURL']=util[_0x6601('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x145f7c[_0x6601('0x47')],_0x1b2491[_0x6601('0x4b')],md5(_0x1b2491[_0x6601('0x4b')]));}else{_0x1b2491['recordingURL']='';}headers[_0x6601('0x4c')]=getAuth(_0x145f7c);return getUser(_0x145f7c,_0x3f93b0['email'])[_0x6601('0x22')](function(_0x2c1511){_0xb22e5c=_0x2c1511;logger[_0x6601('0x2a')](_0x6601('0x4d'),_0xb22e5c['id']);return getEndUser(_0x145f7c,_0x1b2491[_0x6601('0x12')],_0x1b2491['calleridnum']);})['then'](function(_0x293a46){_0x3c3f85=_0x293a46;logger[_0x6601('0x2a')]('The\x20Enduser\x20ID\x20is:',_0x3c3f85['id']);return getTicket(_0x145f7c,_0xb22e5c,_0x3c3f85,_0x149bba,_0x1b2491);})[_0x6601('0x22')](function(_0x3efe38){if(_0x3efe38&&_0x3efe38['id']){logger['info'](_0x6601('0x4e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3efe38['id']);logger[_0x6601('0x2a')]('[QUEUE]',_0x6601('0x4f'));emit(util[_0x6601('0x1f')](_0x6601('0x50'),_0x3f93b0[_0x6601('0x19')]),'trigger:browser:url',{'uri':util[_0x6601('0x1f')](_0x6601('0x51'),_0x145f7c['remoteUri'],_0x3efe38['id'])});}})[_0x6601('0x52')](function(_0x21c34c){logger[_0x6601('0x53')](_0x6601('0x4a'),JSON[_0x6601('0x34')](_0x21c34c));});};exports[_0x6601('0x54')]=function(_0x30add3,_0x14f0b5,_0x883600,_0x310181,_0x25b2fe,_0x1bbe31,_0x5618c4){var _0xd89f06,_0x46a09d;_0x1bbe31[_0x6601('0x21')]=intUtil[_0x6601('0x48')](_0x1bbe31[_0x6601('0x21')]);_0x1bbe31[_0x6601('0x47')]=intUtil['stripTrailingSlash'](_0x1bbe31['serverUrl']);if(_0x5618c4&&_0x5618c4[_0x6601('0x55')]&&_0x5618c4['recordingFormat']!=='none'){logger[_0x6601('0x2a')](_0x6601('0x56'),'Recording\x20is\x20enabled!');_0x14f0b5[_0x6601('0x57')]=util[_0x6601('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1bbe31[_0x6601('0x47')],_0x14f0b5['uniqueid'],md5(_0x14f0b5[_0x6601('0x4b')]));}headers[_0x6601('0x4c')]=getAuth(_0x1bbe31);return getUser(_0x1bbe31,_0x310181['email'])['then'](function(_0x4762ac){_0xd89f06=_0x4762ac;logger[_0x6601('0x2a')](_0x6601('0x4d'),_0xd89f06['id']);return getEndUser(_0x1bbe31,_0x14f0b5[_0x6601('0x58')],_0x14f0b5[_0x6601('0x59')]);})['then'](function(_0x5385d3){_0x46a09d=_0x5385d3;logger[_0x6601('0x2a')](_0x6601('0x5a'),_0x46a09d['id']);return getTicket(_0x1bbe31,_0xd89f06,_0x46a09d,_0x883600,_0x14f0b5);})[_0x6601('0x22')](function(_0x583276){if(_0x583276&&_0x583276['id']){logger['info'](_0x6601('0x4e'));logger[_0x6601('0x2a')](_0x6601('0x5b'),_0x583276['id']);logger['info']('[OUTBOUND]',_0x6601('0x4f'));emit(util['format']('user:%s',_0x310181[_0x6601('0x19')]),_0x6601('0x5c'),{'uri':util[_0x6601('0x1f')](_0x6601('0x51'),_0x1bbe31[_0x6601('0x21')],_0x583276['id'])});}})['catch'](function(_0x490a9a){logger[_0x6601('0x53')](_0x6601('0x56'),JSON[_0x6601('0x34')](_0x490a9a));});};exports[_0x6601('0x5d')]=function(_0x3e5b50,_0x556b4e,_0x21f55e,_0x38f5b7,_0x7ea358,_0xf868a0){var _0x84a65d,_0x59fafd;_0xf868a0[_0x6601('0x21')]=intUtil['stripTrailingSlash'](_0xf868a0[_0x6601('0x21')]);_0xf868a0[_0x6601('0x47')]=intUtil[_0x6601('0x48')](_0xf868a0[_0x6601('0x47')]);if(_0x7ea358&&_0x7ea358[_0x6601('0x49')]){logger[_0x6601('0x2a')]('['+_0x556b4e[_0x6601('0x5e')][_0x6601('0x5f')]()+']','Recording\x20is\x20enabled!');_0x556b4e[_0x6601('0x57')]=util['format'](_0x6601('0x60'),_0xf868a0[_0x6601('0x47')],_0x556b4e['uniqueid'],md5(_0x556b4e[_0x6601('0x4b')]));}else{_0x556b4e[_0x6601('0x57')]='';}headers[_0x6601('0x4c')]=getAuth(_0xf868a0);return getUser(_0xf868a0,'')[_0x6601('0x22')](function(_0x39b80b){_0x84a65d=_0x39b80b;logger[_0x6601('0x2a')](_0x6601('0x4d'),_0x84a65d['id']);return getEndUser(_0xf868a0,_0x556b4e[_0x6601('0x12')],_0x556b4e['calleridnum']);})[_0x6601('0x22')](function(_0x2fdc18){_0x59fafd=_0x2fdc18;logger[_0x6601('0x2a')]('The\x20Enduser\x20ID\x20is:',_0x59fafd['id']);return getTicket(_0xf868a0,_0x84a65d,_0x59fafd,_0x21f55e,_0x556b4e);})[_0x6601('0x22')](function(_0x5082ba){if(_0x5082ba){logger[_0x6601('0x2a')](_0x6601('0x4e'));logger[_0x6601('0x2a')]('The\x20Ticket\x20ID\x20is:',_0x5082ba['id']);}})[_0x6601('0x52')](function(_0x2d24c9){logger[_0x6601('0x53')]('['+_0x556b4e[_0x6601('0x5e')]['toUpperCase']()+']',JSON['stringify'](_0x2d24c9));});}; \ 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 f3f93fb..ef94d22 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 _0x2836=['GET','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','/api/selector/owners','headers','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','length','userId','User\x20found:','Admin\x20selected','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','contactNumber','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','Subjects','getString','Descriptions','Contact','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','username','toLowerCase','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter'];(function(_0x1c6129,_0x3466d6){var _0x4ca692=function(_0x37ddc1){while(--_0x37ddc1){_0x1c6129['push'](_0x1c6129['shift']());}};_0x4ca692(++_0x3466d6);}(_0x2836,0x147));var _0x6283=function(_0x908ad1,_0x6ae5e9){_0x908ad1=_0x908ad1-0x0;var _0x50195c=_0x2836[_0x908ad1];return _0x50195c;};'use strict';var _=require(_0x6283('0x0'));var rp=require(_0x6283('0x1'));var md5=require(_0x6283('0x2'));var util=require(_0x6283('0x3'));var moment=require(_0x6283('0x4'));var Promise=require('bluebird');var Redis=require(_0x6283('0x5'));var intUtil=require(_0x6283('0x6'));var config=require('../../../../config/environment');var logger=require(_0x6283('0x7'))(_0x6283('0x8'));config[_0x6283('0x9')]=_[_0x6283('0xa')](config[_0x6283('0x9')],{'host':_0x6283('0xb'),'port':0x18eb});var io=require(_0x6283('0xc'))(new Redis(config[_0x6283('0x9')]));function getAdminId(_0x2cce56,_0x4f179d,_0x16a849,_0x459a59){return new Promise(function(_0x129476,_0x186836){var _0x6d6ea9=![];var _0x1e8671={'method':_0x6283('0xd'),'uri':_0x459a59+'/api/selector/owners','json':!![]};_0x1e8671['headers']=_0x16a849;logger[_0x6283('0xe')](_0x6283('0xf'));return rp(_0x1e8671)[_0x6283('0x10')](function(_0x2d5ef0){if(_0x2d5ef0){var _0x5efb1b=_0x2d5ef0[_0x6283('0x11')];var _0x237f0a=null;for(_0x237f0a=0x0;_0x237f0a<_0x5efb1b['length'];_0x237f0a++){if(_0x5efb1b[_0x237f0a][_0x6283('0x12')]===_0x2cce56[_0x6283('0x13')]){_0x2cce56[_0x6283('0x14')]=_0x5efb1b[_0x237f0a]['id'];_0x6d6ea9=!![];}}if(_0x6d6ea9){logger[_0x6283('0xe')]('Admin\x20found:',_0x2cce56[_0x6283('0x14')]);_0x129476(_0x2cce56);}else{_0x186836({'statusCode':0x194,'message':_0x6283('0x15')});}}else{_0x186836({'statusCode':0x194,'message':_0x6283('0x15')});}})[_0x6283('0x16')](function(_0x5ca37c){logger[_0x6283('0x17')]('['+[_0x4f179d[_0x6283('0x18')]()]+']',_0x5ca37c[_0x6283('0x19')]);_0x186836(_0x5ca37c);});});}function getUser(_0x493b0b,_0x25c6eb,_0x11d7ef){return function(_0x85637f){return new Promise(function(_0x5cb870,_0x4df9c9){var _0x1a2bd8={'method':_0x6283('0xd'),'uri':_0x11d7ef+_0x6283('0x1a'),'json':!![]};_0x1a2bd8[_0x6283('0x1b')]=_0x25c6eb;logger['info'](_0x6283('0x1c'));return rp(_0x1a2bd8)[_0x6283('0x10')](function(_0x58caea){if(_0x58caea){var _0x1021d7=_0x58caea[_0x6283('0x11')];var _0x40b410=![];var _0x7f356e=null;if(_0x85637f['agentEmail']!==null){logger[_0x6283('0xe')](_0x6283('0x1d'),_0x85637f[_0x6283('0x1e')]);_0x85637f[_0x6283('0x1f')]=_0x85637f[_0x6283('0x1e')];for(_0x7f356e=0x0;_0x7f356e<_0x1021d7[_0x6283('0x20')];_0x7f356e++){if(_0x1021d7[_0x7f356e][_0x6283('0x12')]===_0x85637f[_0x6283('0x1e')]){_0x40b410=!![];_0x85637f[_0x6283('0x21')]=_0x1021d7[_0x7f356e]['id'];logger['info'](_0x6283('0x22'),_0x85637f['userId']);}}}if(!_0x40b410){logger[_0x6283('0xe')](_0x6283('0x23'));_0x85637f[_0x6283('0x1f')]=_0x85637f[_0x6283('0x13')];_0x85637f[_0x6283('0x21')]=_0x85637f['adminId'];_0x40b410=!![];}if(_0x40b410){_0x5cb870(_0x85637f);}else{_0x4df9c9({'statusCode':0x194,'message':_0x6283('0x15')});}}else{_0x4df9c9({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x6283('0x16')](function(_0x3eae6){logger[_0x6283('0x17')]('['+[_0x493b0b[_0x6283('0x18')]()]+']',_0x3eae6[_0x6283('0x19')]);_0x4df9c9(_0x3eae6);});});};}function searchContact(_0x157bef,_0x530dae,_0x241771,_0x3d829e){return new Promise(function(_0x3ad97d,_0x4d6c84){var _0x545049={'method':_0x6283('0xd'),'headers':_0x530dae,'uri':_0x157bef+'/api/lookup?q='+_0x3d829e+_0x6283('0x24')+_0x241771+_0x6283('0x25'),'json':!![]};rp(_0x545049)[_0x6283('0x10')](function(_0x4c1234){var _0x559dbf=_[_0x6283('0x26')](_0x4c1234['contacts'][_0x6283('0x27')],[_0x241771,_0x3d829e]);_0x3ad97d(_0x559dbf);})[_0x6283('0x16')](function(_0x53af92){_0x4d6c84(_0x53af92);});});}function getEndUser(_0x290add,_0x1aebf2,_0x45f75c){return function(_0x4a1ec4){return new Promise(function(_0x36634c,_0x1ac374){logger['info'](util[_0x6283('0x28')](_0x6283('0x29'),_0x4a1ec4['contactNumber']));searchContact(_0x45f75c,_0x1aebf2,'mobile_number',_0x4a1ec4['contactNumber'])['then'](function(_0xd745e){if(_0xd745e){_0x4a1ec4[_0x6283('0x2a')]=_0xd745e['id'];logger[_0x6283('0xe')](_0x6283('0x2b'),_0x4a1ec4[_0x6283('0x2a')]);return _0x36634c(_0x4a1ec4);}searchContact(_0x45f75c,_0x1aebf2,_0x6283('0x2c'),_0x4a1ec4['contactNumber'])[_0x6283('0x10')](function(_0x37e8d9){if(_0x37e8d9){_0x4a1ec4[_0x6283('0x2a')]=_0x37e8d9['id'];logger[_0x6283('0xe')](_0x6283('0x2d'),_0x4a1ec4[_0x6283('0x2a')]);return _0x36634c(_0x4a1ec4);}createEndUser(_0x4a1ec4,_0x290add,_0x1aebf2,_0x45f75c)[_0x6283('0x10')](function(_0x1b5c22){logger[_0x6283('0xe')](_0x6283('0x2e'),_0x1b5c22[_0x6283('0x2a')]);return _0x36634c(_0x1b5c22);});});})[_0x6283('0x16')](function(_0xb06bab){_0x1ac374(_0xb06bab);});});};}function createEndUser(_0x4eb87b,_0x5c5114,_0xc0faad,_0x4aa1fb){return new Promise(function(_0x21affc,_0x5bcb69){var _0x481e27=moment();var _0xe2ccb8={'method':_0x6283('0x2f'),'uri':_0x4aa1fb+'/api/contacts','body':{'contact':{'last_name':_0x4eb87b[_0x6283('0x30')],'work_number':_0x4eb87b[_0x6283('0x30')],'mobile_number':_0x4eb87b['contactNumber'],'owner_id':_0x4eb87b[_0x6283('0x21')],'created_at':_0x481e27[_0x6283('0x28')](_0x6283('0x31'))}},'json':!![]};_0xe2ccb8['headers']=_0xc0faad;logger[_0x6283('0xe')](_0x6283('0x32'));return rp(_0xe2ccb8)[_0x6283('0x10')](function(_0x3887d3){_0x4eb87b[_0x6283('0x2a')]=_0x3887d3[_0x6283('0x33')]['id'];_0x21affc(_0x4eb87b);})[_0x6283('0x16')](function(_0xcc9fae){logger[_0x6283('0x17')]('['+[_0x5c5114[_0x6283('0x18')]()]+']',_0xcc9fae['message']);_0x5bcb69(_0xcc9fae[_0x6283('0x19')]);});});}function getTicket(_0x5f6d2a,_0x4bac91,_0x4fe97b,_0x2713a9,_0x5d64ca){return function(_0x29e092){logger[_0x6283('0xe')](_0x6283('0x34'));return new Promise(function(_0x1938d8,_0x2c8882){var _0x23d544=moment();var _0x45b0dc={'method':_0x6283('0x2f'),'uri':_0x4fe97b+_0x6283('0x35'),'body':{'title':intUtil['getString'](_0x2713a9[_0x6283('0x36')],_0x5d64ca,'\x20'),'description':intUtil[_0x6283('0x37')](_0x2713a9[_0x6283('0x38')],_0x5d64ca,'\x0a'),'owner_id':_0x29e092[_0x6283('0x21')],'creater_id':_0x29e092['adminId'],'targetable_id':_0x29e092[_0x6283('0x2a')],'targetable_type':_0x6283('0x39'),'created_at':_0x23d544[_0x6283('0x28')](_0x6283('0x31')),'due_date':_0x23d544['add'](0x1e,'m')[_0x6283('0x28')](_0x6283('0x31'))},'json':!![]};_0x45b0dc[_0x6283('0x1b')]=_0x4bac91;return rp(_0x45b0dc)[_0x6283('0x10')](function(_0x5c1545){_0x29e092[_0x6283('0x3a')]=_0x5c1545['task']['id'];logger[_0x6283('0xe')]('Task\x20created:',_0x29e092[_0x6283('0x3a')]);_0x1938d8(_0x29e092);})[_0x6283('0x16')](function(_0x48a098){logger['error']('['+[_0x5f6d2a['toUpperCase']()]+']',_0x48a098[_0x6283('0x19')]);_0x2c8882(_0x48a098[_0x6283('0x19')]);});});};}function emit(_0x175b57,_0x3bae03,_0x1a2824){var _0x517340={'uri':_0x175b57+_0x6283('0x3b')+_0x1a2824};io['to'](util[_0x6283('0x28')](_0x6283('0x3c'),_0x3bae03))[_0x6283('0x3d')](_0x6283('0x3e'),_0x517340);}exports['cs']=function(_0x3ddf28,_0x434e71,_0x7bca56,_0x3aca53,_0xa93d52,_0x567e55,_0x4bae91,_0x106adf){var _0x325829={};var _0x53b66c={'Authorization':_0x6283('0x3f')+_0x567e55[_0x6283('0x40')]};_0x567e55[_0x6283('0x41')]=intUtil['stripTrailingSlash'](_0x567e55['remoteUri']);_0x567e55[_0x6283('0x42')]=intUtil['stripTrailingSlash'](_0x567e55[_0x6283('0x42')]);var _0x9b9aa8=_0x567e55[_0x6283('0x41')];_0x325829[_0x6283('0x13')]=_0x567e55[_0x6283('0x43')];_0x325829[_0x6283('0x30')]=_0x106adf[_0x6283('0x44')]()==='outbound'?_0x434e71['destcalleridnum']:_0x434e71[_0x6283('0x45')];_0x325829[_0x6283('0x46')]=_0x106adf===_0x6283('0x47')||_0x106adf===_0x6283('0x48')?_0x6283('0x47'):_0x6283('0x49');if(_0x3aca53){_0x325829['agentEmail']=_0x3aca53[_0x6283('0x12')];}var _0x59d767=util[_0x6283('0x28')](_0x6283('0x4a'),_0x567e55[_0x6283('0x42')],_0x434e71[_0x6283('0x4b')],md5(_0x434e71[_0x6283('0x4b')]));if(_0xa93d52&&_0xa93d52['monitor_format']){logger[_0x6283('0xe')]('[QUEUE]','Recording\x20is\x20enabled!');_0x434e71[_0x6283('0x4c')]=_0x59d767;}else if(_0x4bae91&&_0x4bae91[_0x6283('0x4d')]&&_0x4bae91[_0x6283('0x4d')]!==_0x6283('0x4e')){logger[_0x6283('0xe')](_0x6283('0x4f'),_0x6283('0x50'));_0x434e71[_0x6283('0x4c')]=_0x59d767;}else{_0x434e71['recordingURL']='';}return getAdminId(_0x325829,_0x106adf,_0x53b66c,_0x9b9aa8)[_0x6283('0x10')](getUser(_0x106adf,_0x53b66c,_0x9b9aa8))[_0x6283('0x10')](getEndUser(_0x106adf,_0x53b66c,_0x9b9aa8))[_0x6283('0x10')](getTicket(_0x106adf,_0x53b66c,_0x9b9aa8,_0x7bca56,_0x434e71))[_0x6283('0x10')](function(_0xca8f58){logger[_0x6283('0xe')](util[_0x6283('0x28')](_0x6283('0x51'),_0xca8f58[_0x6283('0x3a')]));if(_0x106adf!==_0x6283('0x48')){logger[_0x6283('0xe')]('['+[_0x106adf['toUpperCase']()]+']',_0x6283('0x52'));emit(_0x9b9aa8,_0x3aca53[_0x6283('0x53')],_0xca8f58['endUserId']);}})[_0x6283('0x16')](function(_0x537804){logger[_0x6283('0x17')]('['+[_0x106adf[_0x6283('0x18')]()]+_0x6283('0x54'),util['inspect'](_0x537804,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x33a0=['[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','GET','/api/selector/owners','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','endUserId','Contact\x20found\x20mobile_number:','contactNumber','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','getString','Subjects','Descriptions','add','ticketId','Task\x20created:','error','/contacts/','trigger:browser:url','apiKey','stripTrailingSlash','remoteUri','serverUrl','destcalleridnum','calleridnum','callDirection','queue','outbound','email','uniqueid','monitor_format'];(function(_0x11e05d,_0x3a4491){var _0x335588=function(_0x35ec3f){while(--_0x35ec3f){_0x11e05d['push'](_0x11e05d['shift']());}};_0x335588(++_0x3a4491);}(_0x33a0,0xa4));var _0x033a=function(_0x324df0,_0x9ebfa7){_0x324df0=_0x324df0-0x0;var _0x18fa5d=_0x33a0[_0x324df0];return _0x18fa5d;};'use strict';var _=require('lodash');var rp=require(_0x033a('0x0'));var md5=require(_0x033a('0x1'));var util=require('util');var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x033a('0x2'));var intUtil=require(_0x033a('0x3'));var config=require(_0x033a('0x4'));var logger=require(_0x033a('0x5'))('freshsales');config['redis']=_[_0x033a('0x6')](config[_0x033a('0x7')],{'host':_0x033a('0x8'),'port':0x18eb});var io=require(_0x033a('0x9'))(new Redis(config['redis']));function getAdminId(_0x55bbde,_0x1d55e9,_0x1f51b0,_0x281518){return new Promise(function(_0xf2abae,_0x2a1bf3){var _0x39d926=![];var _0x7a6421={'method':'GET','uri':_0x281518+'/api/selector/owners','json':!![]};_0x7a6421[_0x033a('0xa')]=_0x1f51b0;logger[_0x033a('0xb')](_0x033a('0xc'));return rp(_0x7a6421)[_0x033a('0xd')](function(_0x3cefee){if(_0x3cefee){var _0x4f8a40=_0x3cefee[_0x033a('0xe')];var _0x2b526e=null;for(_0x2b526e=0x0;_0x2b526e<_0x4f8a40[_0x033a('0xf')];_0x2b526e++){if(_0x4f8a40[_0x2b526e]['email']===_0x55bbde[_0x033a('0x10')]){_0x55bbde[_0x033a('0x11')]=_0x4f8a40[_0x2b526e]['id'];_0x39d926=!![];}}if(_0x39d926){logger[_0x033a('0xb')](_0x033a('0x12'),_0x55bbde[_0x033a('0x11')]);_0xf2abae(_0x55bbde);}else{_0x2a1bf3({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x2a1bf3({'statusCode':0x194,'message':_0x033a('0x13')});}})[_0x033a('0x14')](function(_0x32e0bd){logger['error']('['+[_0x1d55e9[_0x033a('0x15')]()]+']',_0x32e0bd[_0x033a('0x16')]);_0x2a1bf3(_0x32e0bd);});});}function getUser(_0x19b234,_0x23b9bf,_0x2aa2d4){return function(_0x5be317){return new Promise(function(_0x100643,_0x541098){var _0x559b96={'method':_0x033a('0x17'),'uri':_0x2aa2d4+_0x033a('0x18'),'json':!![]};_0x559b96[_0x033a('0xa')]=_0x23b9bf;logger[_0x033a('0xb')]('Getting\x20user\x20list');return rp(_0x559b96)['then'](function(_0x24f11a){if(_0x24f11a){var _0x1925bf=_0x24f11a['users'];var _0x22eb8e=![];var _0x3355a6=null;if(_0x5be317[_0x033a('0x19')]!==null){logger['info'](_0x033a('0x1a'),_0x5be317[_0x033a('0x19')]);_0x5be317['userEmail']=_0x5be317[_0x033a('0x19')];for(_0x3355a6=0x0;_0x3355a6<_0x1925bf[_0x033a('0xf')];_0x3355a6++){if(_0x1925bf[_0x3355a6]['email']===_0x5be317['agentEmail']){_0x22eb8e=!![];_0x5be317[_0x033a('0x1b')]=_0x1925bf[_0x3355a6]['id'];logger['info'](_0x033a('0x1c'),_0x5be317['userId']);}}}if(!_0x22eb8e){logger[_0x033a('0xb')](_0x033a('0x1d'));_0x5be317['userEmail']=_0x5be317[_0x033a('0x10')];_0x5be317[_0x033a('0x1b')]=_0x5be317[_0x033a('0x11')];_0x22eb8e=!![];}if(_0x22eb8e){_0x100643(_0x5be317);}else{_0x541098({'statusCode':0x194,'message':_0x033a('0x13')});}}else{_0x541098({'statusCode':0x194,'message':_0x033a('0x13')});}})['catch'](function(_0x3c98a3){logger['error']('['+[_0x19b234[_0x033a('0x15')]()]+']',_0x3c98a3[_0x033a('0x16')]);_0x541098(_0x3c98a3);});});};}function searchContact(_0x132f2d,_0x5d0d1b,_0xe5be26,_0xe11c01){return new Promise(function(_0xc83130,_0x314b75){var _0x3467c5={'method':_0x033a('0x17'),'headers':_0x5d0d1b,'uri':_0x132f2d+_0x033a('0x1e')+_0xe11c01+_0x033a('0x1f')+_0xe5be26+'&entities=contact','json':!![]};rp(_0x3467c5)[_0x033a('0xd')](function(_0x304066){var _0x1912f4=_[_0x033a('0x20')](_0x304066['contacts'][_0x033a('0x21')],[_0xe5be26,_0xe11c01]);_0xc83130(_0x1912f4);})['catch'](function(_0x2b4d7e){_0x314b75(_0x2b4d7e);});});}function getEndUser(_0x1e8ce7,_0x1639d2,_0x30591d){return function(_0x40c5de){return new Promise(function(_0x4fb032,_0x4512af){logger[_0x033a('0xb')](util[_0x033a('0x22')](_0x033a('0x23'),_0x40c5de['contactNumber']));searchContact(_0x30591d,_0x1639d2,_0x033a('0x24'),_0x40c5de['contactNumber'])[_0x033a('0xd')](function(_0x257123){if(_0x257123){_0x40c5de[_0x033a('0x25')]=_0x257123['id'];logger[_0x033a('0xb')](_0x033a('0x26'),_0x40c5de[_0x033a('0x25')]);return _0x4fb032(_0x40c5de);}searchContact(_0x30591d,_0x1639d2,'work_number',_0x40c5de[_0x033a('0x27')])[_0x033a('0xd')](function(_0x280b06){if(_0x280b06){_0x40c5de[_0x033a('0x25')]=_0x280b06['id'];logger[_0x033a('0xb')](_0x033a('0x28'),_0x40c5de[_0x033a('0x25')]);return _0x4fb032(_0x40c5de);}createEndUser(_0x40c5de,_0x1e8ce7,_0x1639d2,_0x30591d)[_0x033a('0xd')](function(_0x507017){logger['info']('Contact\x20created:',_0x507017['endUserId']);return _0x4fb032(_0x507017);});});})[_0x033a('0x14')](function(_0x2efdeb){_0x4512af(_0x2efdeb);});});};}function createEndUser(_0x3343af,_0x35a92c,_0x4430ac,_0x38a969){return new Promise(function(_0x29bff1,_0x412a1b){var _0x18ad9d=moment();var _0x306dcf={'method':_0x033a('0x29'),'uri':_0x38a969+_0x033a('0x2a'),'body':{'contact':{'last_name':_0x3343af[_0x033a('0x27')],'work_number':_0x3343af[_0x033a('0x27')],'mobile_number':_0x3343af[_0x033a('0x27')],'owner_id':_0x3343af[_0x033a('0x1b')],'created_at':_0x18ad9d[_0x033a('0x22')](_0x033a('0x2b'))}},'json':!![]};_0x306dcf[_0x033a('0xa')]=_0x4430ac;logger['info'](_0x033a('0x2c'));return rp(_0x306dcf)[_0x033a('0xd')](function(_0x5ce939){_0x3343af[_0x033a('0x25')]=_0x5ce939[_0x033a('0x2d')]['id'];_0x29bff1(_0x3343af);})[_0x033a('0x14')](function(_0x1c22d1){logger['error']('['+[_0x35a92c['toUpperCase']()]+']',_0x1c22d1[_0x033a('0x16')]);_0x412a1b(_0x1c22d1[_0x033a('0x16')]);});});}function getTicket(_0x575873,_0x58bbbd,_0x374a42,_0x5a99f6,_0x562200){return function(_0x7f75b3){logger[_0x033a('0xb')]('Creating\x20new\x20task');return new Promise(function(_0x58f71c,_0x506d77){var _0x44c88f=moment();var _0x141a36={'method':_0x033a('0x29'),'uri':_0x374a42+'/api/tasks','body':{'title':intUtil[_0x033a('0x2e')](_0x5a99f6[_0x033a('0x2f')],_0x562200,'\x20'),'description':intUtil['getString'](_0x5a99f6[_0x033a('0x30')],_0x562200,'\x0a'),'owner_id':_0x7f75b3[_0x033a('0x1b')],'creater_id':_0x7f75b3['adminId'],'targetable_id':_0x7f75b3[_0x033a('0x25')],'targetable_type':'Contact','created_at':_0x44c88f[_0x033a('0x22')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x44c88f[_0x033a('0x31')](0x1e,'m')[_0x033a('0x22')](_0x033a('0x2b'))},'json':!![]};_0x141a36[_0x033a('0xa')]=_0x58bbbd;return rp(_0x141a36)[_0x033a('0xd')](function(_0x4469a4){_0x7f75b3[_0x033a('0x32')]=_0x4469a4['task']['id'];logger[_0x033a('0xb')](_0x033a('0x33'),_0x7f75b3[_0x033a('0x32')]);_0x58f71c(_0x7f75b3);})[_0x033a('0x14')](function(_0x2775b6){logger[_0x033a('0x34')]('['+[_0x575873[_0x033a('0x15')]()]+']',_0x2775b6[_0x033a('0x16')]);_0x506d77(_0x2775b6[_0x033a('0x16')]);});});};}function emit(_0x80236e,_0x55fbbf,_0x19b8c9){var _0x56e0c3={'uri':_0x80236e+_0x033a('0x35')+_0x19b8c9};io['to'](util[_0x033a('0x22')]('user:%s',_0x55fbbf))['emit'](_0x033a('0x36'),_0x56e0c3);}exports['cs']=function(_0x36a000,_0x4a68ec,_0x1ee5d9,_0x55d3c8,_0x5c81e6,_0x4fc2c9,_0x2a8151,_0x5abcab){var _0x5eb9c7={};var _0x549812={'Authorization':'Token\x20token='+_0x4fc2c9[_0x033a('0x37')]};_0x4fc2c9['remoteUri']=intUtil[_0x033a('0x38')](_0x4fc2c9[_0x033a('0x39')]);_0x4fc2c9[_0x033a('0x3a')]=intUtil[_0x033a('0x38')](_0x4fc2c9[_0x033a('0x3a')]);var _0x47e258=_0x4fc2c9[_0x033a('0x39')];_0x5eb9c7[_0x033a('0x10')]=_0x4fc2c9['username'];_0x5eb9c7[_0x033a('0x27')]=_0x5abcab['toLowerCase']()==='outbound'?_0x4a68ec[_0x033a('0x3b')]:_0x4a68ec[_0x033a('0x3c')];_0x5eb9c7[_0x033a('0x3d')]=_0x5abcab===_0x033a('0x3e')||_0x5abcab==='unmanaged'?_0x033a('0x3e'):_0x033a('0x3f');if(_0x55d3c8){_0x5eb9c7[_0x033a('0x19')]=_0x55d3c8[_0x033a('0x40')];}var _0xac94cf=util[_0x033a('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4fc2c9[_0x033a('0x3a')],_0x4a68ec['uniqueid'],md5(_0x4a68ec[_0x033a('0x41')]));if(_0x5c81e6&&_0x5c81e6[_0x033a('0x42')]){logger[_0x033a('0xb')](_0x033a('0x43'),'Recording\x20is\x20enabled!');_0x4a68ec[_0x033a('0x44')]=_0xac94cf;}else if(_0x2a8151&&_0x2a8151[_0x033a('0x45')]&&_0x2a8151[_0x033a('0x45')]!==_0x033a('0x46')){logger[_0x033a('0xb')]('[OUTBOUND]',_0x033a('0x47'));_0x4a68ec[_0x033a('0x44')]=_0xac94cf;}else{_0x4a68ec[_0x033a('0x44')]='';}return getAdminId(_0x5eb9c7,_0x5abcab,_0x549812,_0x47e258)[_0x033a('0xd')](getUser(_0x5abcab,_0x549812,_0x47e258))[_0x033a('0xd')](getEndUser(_0x5abcab,_0x549812,_0x47e258))[_0x033a('0xd')](getTicket(_0x5abcab,_0x549812,_0x47e258,_0x1ee5d9,_0x4a68ec))[_0x033a('0xd')](function(_0xf76690){logger[_0x033a('0xb')](util['format'](_0x033a('0x48'),_0xf76690[_0x033a('0x32')]));if(_0x5abcab!==_0x033a('0x49')){logger[_0x033a('0xb')]('['+[_0x5abcab[_0x033a('0x15')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x47e258,_0x55d3c8[_0x033a('0x4a')],_0xf76690[_0x033a('0x25')]);}})[_0x033a('0x14')](function(_0x54251b){logger['error']('['+[_0x5abcab['toUpperCase']()]+_0x033a('0x4b'),util[_0x033a('0x4c')](_0x54251b,{'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 96c0aec..c2a271b 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 _0x6150=['outbound','log','EVENT\x20UNKNOWN','unmanaged','data1','zoho','../../../../config/logger','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow','exec','toLowerCase','data2','Configurations','data3','queue','routeId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6150,0x1df));var _0x0615=function(_0x263211,_0x52e7c3){_0x263211=_0x263211-0x0;var _0x56239c=_0x6150[_0x263211];return _0x56239c;};'use strict';var _=require(_0x0615('0x0'));var util=require(_0x0615('0x1'));var zendesk=require(_0x0615('0x2'));var salesforce=require(_0x0615('0x3'));var sugarcrm=require(_0x0615('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x0615('0x5'));var desk=require(_0x0615('0x6'));var vtiger=require(_0x0615('0x7'));var servicenow=require(_0x0615('0x8'));var dynamics365=require('./dynamics365');var freshsales=require('./freshsales');var integrations=[_0x0615('0x9'),_0x0615('0xa'),_0x0615('0xb'),_0x0615('0xc'),'zoho',_0x0615('0xd'),_0x0615('0xe'),_0x0615('0xf'),_0x0615('0x10'),_0x0615('0x11')];exports[_0x0615('0x12')]=function(_0x55f88f,_0x412e17,_0x4eae60,_0x1b6d15,_0x4a3844,_0x6e03bb){if(_0x4eae60){if(_['includes'](integrations,_0x55f88f['data1'][_0x0615('0x13')]())){try{var _0xf7848=null;var _0x4ac88f='';var _0x286f16=_0x4eae60[_0x55f88f['data1']['toLowerCase']()];if(_0x286f16){var _0x12f063=_0x286f16[_0x55f88f[_0x0615('0x14')]];if(_0x12f063){var _0x3f8fa6=_['find'](_0x12f063[_0x0615('0x15')],{'id':parseInt(_0x55f88f[_0x0615('0x16')],0xa)});if(_0x3f8fa6){if(_0x1b6d15){if(_0x4a3844&&_0x412e17[_0x0615('0x17')]){_0x4ac88f=_0x0615('0x17');}else if(_0x412e17[_0x0615('0x18')]){_0x4ac88f=_0x0615('0x19');}else{console[_0x0615('0x1a')](_0x0615('0x1b'),_0x412e17);}}else{_0x4ac88f=_0x0615('0x1c');}switch(_0x55f88f[_0x0615('0x1d')]['toLowerCase']()){case _0x0615('0x9'):zendesk[_0x4ac88f](_0x55f88f,_0x412e17,_0x3f8fa6,_0x1b6d15,_0x4a3844,_0x12f063,_0x6e03bb);break;case _0x0615('0xa'):salesforce[_0x4ac88f](_0x55f88f,_0x412e17,_0x3f8fa6,_0x1b6d15,_0x4a3844,_0x12f063,_0x6e03bb);break;case'sugarcrm':sugarcrm[_0x4ac88f](_0x55f88f,_0x412e17,_0x3f8fa6,_0x1b6d15,_0x4a3844,_0x12f063,_0x6e03bb);break;case _0x0615('0xc'):freshdesk[_0x4ac88f](_0x55f88f,_0x412e17,_0x3f8fa6,_0x1b6d15,_0x4a3844,_0x12f063,_0x6e03bb);break;case _0x0615('0x1e'):zoho[_0x4ac88f](_0x55f88f,_0x412e17,_0x3f8fa6,_0x1b6d15,_0x4a3844,_0x12f063,_0x6e03bb);break;case'desk':desk[_0x4ac88f](_0x55f88f,_0x412e17,_0x3f8fa6,_0x1b6d15,_0x4a3844,_0x12f063,_0x6e03bb);break;case _0x0615('0xe'):vtiger[_0x4ac88f](_0x55f88f,_0x412e17,_0x3f8fa6,_0x1b6d15,_0x4a3844,_0x12f063,_0x6e03bb);break;case'freshsales':freshsales['cs'](_0x55f88f,_0x412e17,_0x3f8fa6,_0x1b6d15,_0x4a3844,_0x12f063,_0x6e03bb,_0x4ac88f);break;case'servicenow':servicenow['cs'](_0x55f88f,_0x412e17,_0x3f8fa6,_0x1b6d15,_0x4a3844,_0x12f063,_0x6e03bb,_0x4ac88f);break;case _0x0615('0xf'):dynamics365['cs'](_0x55f88f,_0x412e17,_0x3f8fa6,_0x1b6d15,_0x4a3844,_0x12f063,_0x6e03bb,_0x4ac88f);break;default:console[_0x0615('0x1a')]('unknown\x20integration');}}else{_0xf7848=require(_0x0615('0x1f'))(_0x55f88f['data1'][_0x0615('0x13')]());_0xf7848['error'](_0x0615('0x20'),util['format'](_0x0615('0x21'),_0x55f88f[_0x0615('0x1d')]['toLowerCase'](),_0x55f88f[_0x0615('0x16')]));}}else{_0xf7848=require('../../../../config/logger')(_0x55f88f['data1'][_0x0615('0x13')]());_0xf7848['error'](_0x0615('0x20'),util[_0x0615('0x22')](_0x0615('0x23'),_0x55f88f[_0x0615('0x1d')][_0x0615('0x13')](),_0x55f88f[_0x0615('0x14')]));}}else{}}catch(_0x4a1bec){console['error'](_0x4a1bec);}}}}; \ No newline at end of file +var _0x3d65=['Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','freshsales','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','servicenow','exec','includes','toLowerCase','data1','data2','find'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x3d65,0x194));var _0x53d6=function(_0x130615,_0x340b88){_0x130615=_0x130615-0x0;var _0x350edb=_0x3d65[_0x130615];return _0x350edb;};'use strict';var _=require(_0x53d6('0x0'));var util=require(_0x53d6('0x1'));var zendesk=require(_0x53d6('0x2'));var salesforce=require(_0x53d6('0x3'));var sugarcrm=require(_0x53d6('0x4'));var freshdesk=require(_0x53d6('0x5'));var zoho=require(_0x53d6('0x6'));var desk=require(_0x53d6('0x7'));var vtiger=require(_0x53d6('0x8'));var servicenow=require(_0x53d6('0x9'));var dynamics365=require(_0x53d6('0xa'));var freshsales=require(_0x53d6('0xb'));var integrations=[_0x53d6('0xc'),'salesforce',_0x53d6('0xd'),_0x53d6('0xe'),_0x53d6('0xf'),_0x53d6('0x10'),_0x53d6('0x11'),_0x53d6('0x12'),'freshsales',_0x53d6('0x13')];exports[_0x53d6('0x14')]=function(_0x2ebe5f,_0x3a347b,_0x56247f,_0x19c19d,_0x4cbbf8,_0x8d341c){if(_0x56247f){if(_[_0x53d6('0x15')](integrations,_0x2ebe5f['data1'][_0x53d6('0x16')]())){try{var _0x5c2395=null;var _0x3ce325='';var _0x20bb14=_0x56247f[_0x2ebe5f[_0x53d6('0x17')]['toLowerCase']()];if(_0x20bb14){var _0x4f8100=_0x20bb14[_0x2ebe5f[_0x53d6('0x18')]];if(_0x4f8100){var _0x4cd75e=_[_0x53d6('0x19')](_0x4f8100[_0x53d6('0x1a')],{'id':parseInt(_0x2ebe5f[_0x53d6('0x1b')],0xa)});if(_0x4cd75e){if(_0x19c19d){if(_0x4cbbf8&&_0x3a347b['queue']){_0x3ce325=_0x53d6('0x1c');}else if(_0x3a347b[_0x53d6('0x1d')]){_0x3ce325=_0x53d6('0x1e');}else{console[_0x53d6('0x1f')](_0x53d6('0x20'),_0x3a347b);}}else{_0x3ce325=_0x53d6('0x21');}switch(_0x2ebe5f[_0x53d6('0x17')][_0x53d6('0x16')]()){case _0x53d6('0xc'):zendesk[_0x3ce325](_0x2ebe5f,_0x3a347b,_0x4cd75e,_0x19c19d,_0x4cbbf8,_0x4f8100,_0x8d341c);break;case _0x53d6('0x22'):salesforce[_0x3ce325](_0x2ebe5f,_0x3a347b,_0x4cd75e,_0x19c19d,_0x4cbbf8,_0x4f8100,_0x8d341c);break;case _0x53d6('0xd'):sugarcrm[_0x3ce325](_0x2ebe5f,_0x3a347b,_0x4cd75e,_0x19c19d,_0x4cbbf8,_0x4f8100,_0x8d341c);break;case _0x53d6('0xe'):freshdesk[_0x3ce325](_0x2ebe5f,_0x3a347b,_0x4cd75e,_0x19c19d,_0x4cbbf8,_0x4f8100,_0x8d341c);break;case _0x53d6('0xf'):zoho[_0x3ce325](_0x2ebe5f,_0x3a347b,_0x4cd75e,_0x19c19d,_0x4cbbf8,_0x4f8100,_0x8d341c);break;case _0x53d6('0x10'):desk[_0x3ce325](_0x2ebe5f,_0x3a347b,_0x4cd75e,_0x19c19d,_0x4cbbf8,_0x4f8100,_0x8d341c);break;case'vtiger':vtiger[_0x3ce325](_0x2ebe5f,_0x3a347b,_0x4cd75e,_0x19c19d,_0x4cbbf8,_0x4f8100,_0x8d341c);break;case _0x53d6('0x23'):freshsales['cs'](_0x2ebe5f,_0x3a347b,_0x4cd75e,_0x19c19d,_0x4cbbf8,_0x4f8100,_0x8d341c,_0x3ce325);break;case _0x53d6('0x13'):servicenow['cs'](_0x2ebe5f,_0x3a347b,_0x4cd75e,_0x19c19d,_0x4cbbf8,_0x4f8100,_0x8d341c,_0x3ce325);break;case _0x53d6('0x12'):dynamics365['cs'](_0x2ebe5f,_0x3a347b,_0x4cd75e,_0x19c19d,_0x4cbbf8,_0x4f8100,_0x8d341c,_0x3ce325);break;default:console[_0x53d6('0x1f')](_0x53d6('0x24'));}}else{_0x5c2395=require(_0x53d6('0x25'))(_0x2ebe5f['data1'][_0x53d6('0x16')]());_0x5c2395[_0x53d6('0x26')](_0x53d6('0x27'),util[_0x53d6('0x28')](_0x53d6('0x29'),_0x2ebe5f[_0x53d6('0x17')][_0x53d6('0x16')](),_0x2ebe5f[_0x53d6('0x1b')]));}}else{_0x5c2395=require('../../../../config/logger')(_0x2ebe5f[_0x53d6('0x17')]['toLowerCase']());_0x5c2395[_0x53d6('0x26')](_0x53d6('0x27'),util[_0x53d6('0x28')](_0x53d6('0x2a'),_0x2ebe5f[_0x53d6('0x17')][_0x53d6('0x16')](),_0x2ebe5f[_0x53d6('0x18')]));}}else{}}catch(_0x1cb173){console[_0x53d6('0x26')](_0x1cb173);}}}}; \ 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 0e9e1bc..abda3ef 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 _0xacbb=['toUpperCase','lodash','request-promise','bluebird','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','getString','Descriptions','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','ticketType','contact','ContactId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','then','find','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','Contact','length','additionalSearchLead','merge','$or','account_contact_lead','additionalSearchAccount','Account','Lead','execute','first','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','Company','No\x20Company','upperFirst','forEach','string','picklist','idField','content','toString','variable','variableName','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','%s/%s/e','error','catch','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','instanceUrl','unmanaged','monitor_format','lastevent'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xacbb,0x17e));var _0xbacb=function(_0x459b17,_0x1109a5){_0x459b17=_0x459b17-0x0;var _0x1cac77=_0xacbb[_0x459b17];return _0x1cac77;};'use strict';var _=require(_0xbacb('0x0'));var rp=require(_0xbacb('0x1'));var moment=require('moment');var BPromise=require(_0xbacb('0x2'));var md5=require('md5');var jsforce=require(_0xbacb('0x3'));var util=require(_0xbacb('0x4'));var Redis=require(_0xbacb('0x5'));var intUtil=require(_0xbacb('0x6'));var config=require(_0xbacb('0x7'));var logger=require(_0xbacb('0x8'))(_0xbacb('0x9'));config[_0xbacb('0xa')]=_[_0xbacb('0xb')](config[_0xbacb('0xa')],{'host':_0xbacb('0xc'),'port':0x18eb});var io=require(_0xbacb('0xd'))(new Redis(config[_0xbacb('0xa')]));function emit(_0x4ee2f3,_0x336db8,_0xcd9147){io['to'](_0x4ee2f3)[_0xbacb('0xe')](_0x336db8,_0xcd9147);}function getTicket(_0x597db4,_0x1d560d,_0x4ef6cc,_0x3f6f90,_0xfb970b,_0xad30ce,_0x4e68e9,_0xeac0d6){var _0x895103=Object['assign']({},{'OwnerId':_0x1d560d['id'],'Subject':intUtil['getString'](_0x3f6f90['Subjects'],_0xfb970b,'\x20'),'Description':intUtil[_0xbacb('0xf')](_0x3f6f90[_0xbacb('0x10')],_0xfb970b,'\x0a')},getCustomFields(_0xad30ce,_0xfb970b));if(_0x4ef6cc){if(_0x3f6f90['ticketType']===_0xbacb('0x11')){_0x895103[_0xbacb('0x12')]=moment[_0xbacb('0x13')]();_0x895103[_0xbacb('0x14')]=![];_0x895103[_0xbacb('0x15')]=![];if(_0x4ef6cc['endUserType']==='contact'||_0x4ef6cc[_0xbacb('0x16')]===_0xbacb('0x17')){_0x895103[_0xbacb('0x18')]=_0x4ef6cc['id'];}else if(_0x4ef6cc['endUserType']===_0xbacb('0x19')){_0x895103['WhatId']=_0x4ef6cc['id'];}}else if(_0x3f6f90[_0xbacb('0x1a')]==='Case'){if(_0x4ef6cc[_0xbacb('0x16')]===_0xbacb('0x1b')){_0x895103[_0xbacb('0x1c')]=_0x4ef6cc['id'];}else if(_0x4ef6cc[_0xbacb('0x16')]===_0xbacb('0x19')){_0x895103['AccountId']=_0x4ef6cc['id'];}else if(_0x4ef6cc[_0xbacb('0x16')]===_0xbacb('0x17')&&_0x3f6f90[_0xbacb('0x1d')]){_0x895103[_0x3f6f90[_0xbacb('0x1d')]]=_0x4ef6cc['id'];}else{logger['info'](_0xbacb('0x1e'));}}}return _0x4e68e9[_0xbacb('0x1f')](_0x3f6f90['ticketType'])[_0xbacb('0x20')](_0x895103);}function getUser(_0x48914e,_0x232e91,_0x2ff636){if(!_[_0xbacb('0x21')](_0x232e91)&&intUtil[_0xbacb('0x22')](_0x232e91)){var _0x3d8b15={'Email':_0x232e91};var _0x4bb7d5={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2ff636[_0xbacb('0x1f')](_0xbacb('0x23'))['find'](_0x3d8b15,_0x4bb7d5)['execute']()[_0xbacb('0x24')](function(_0x351288){if(_0x351288['length']){var _0x408500=_[_0xbacb('0x25')](_0x351288,function(_0x1aba42){return _0x1aba42[_0xbacb('0x26')]===_0x232e91;});if(_0x408500){logger[_0xbacb('0x27')](_0xbacb('0x28'),_0x232e91);return BPromise[_0xbacb('0x29')]({'id':_0x408500['Id'],'name':_0x408500[_0xbacb('0x2a')]});}}else{logger['info'](_0xbacb('0x2b'),_0x232e91);return _0x2ff636[_0xbacb('0x2c')]()['then'](function(_0x11b47d){return BPromise['resolve']({'id':_0x11b47d[_0xbacb('0x2d')],'name':_0x11b47d['display_name']});});}});}else{logger[_0xbacb('0x27')](_0xbacb('0x2b'),_0x232e91);return _0x2ff636[_0xbacb('0x2c')]()[_0xbacb('0x24')](function(_0x3a8907){return BPromise[_0xbacb('0x29')]({'id':_0x3a8907[_0xbacb('0x2d')],'name':_0x3a8907[_0xbacb('0x2e')]});});}}function getEndUser(_0x175a78,_0xd5e476,_0x3b3a5d,_0x479399,_0x411bd9){var _0x26ce7d={'$or':{'Phone':_0x479399}};var _0x576f20={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xbacb('0x24')](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x479399,_0xd5e476[_0xbacb('0x2f')]);switch(_0xd5e476[_0xbacb('0x2f')]){case _0xbacb('0x30'):var _0x40b2f4=_[_0xbacb('0x31')](_0x26ce7d);if(_0xd5e476[_0xbacb('0x32')]){var _0xca98cb={};_0xca98cb[_0xd5e476[_0xbacb('0x32')]]=_0x479399;_['merge'](_0x40b2f4['$or'],_0xca98cb);}return _0x411bd9[_0xbacb('0x1f')](_0xbacb('0x33'))[_0xbacb('0x25')](_0x40b2f4,_0x576f20)['execute']()[_0xbacb('0x24')](function(_0x2ab42e){if(_0x2ab42e&&_0x2ab42e[_0xbacb('0x34')]){return _0x2ab42e;}else{var _0xdd082b=_[_0xbacb('0x31')](_0x26ce7d);if(_0xd5e476[_0xbacb('0x35')]){var _0x8a3ef7={};_0x8a3ef7[_0xd5e476['additionalSearchLead']]=_0x479399;_[_0xbacb('0x36')](_0xdd082b[_0xbacb('0x37')],_0x8a3ef7);}return _0x411bd9[_0xbacb('0x1f')]('Lead')[_0xbacb('0x25')](_0xdd082b,_0x576f20);}});case _0xbacb('0x38'):var _0x556090=_[_0xbacb('0x31')](_0x26ce7d);if(_0xd5e476[_0xbacb('0x39')]){var _0xca98cb={};_0xca98cb[_0xd5e476[_0xbacb('0x39')]]=_0x479399;_[_0xbacb('0x36')](_0x556090[_0xbacb('0x37')],_0xca98cb);}return _0x411bd9[_0xbacb('0x1f')](_0xbacb('0x3a'))['find'](_0x556090,_0x576f20)['execute']()[_0xbacb('0x24')](function(_0x24b002){if(_0x24b002&&_0x24b002[_0xbacb('0x34')]){return _0x24b002;}else{var _0xb2aac9=_[_0xbacb('0x31')](_0x26ce7d);if(_0xd5e476[_0xbacb('0x32')]){var _0x4e79ba={};_0x4e79ba[_0xd5e476[_0xbacb('0x32')]]=_0x479399;_[_0xbacb('0x36')](_0xb2aac9[_0xbacb('0x37')],_0x4e79ba);}return _0x411bd9[_0xbacb('0x1f')](_0xbacb('0x33'))['find'](_0xb2aac9,_0x576f20)[_0xbacb('0x24')](function(_0xc92343){if(_0xc92343&&_0xc92343[_0xbacb('0x34')]){return _0xc92343;}else{var _0x2dd382=_[_0xbacb('0x31')](_0x26ce7d);if(_0xd5e476[_0xbacb('0x35')]){var _0x490628={};_0x490628[_0xd5e476['additionalSearchLead']]=_0x479399;_['merge'](_0x2dd382[_0xbacb('0x37')],_0x490628);}return _0x411bd9[_0xbacb('0x1f')](_0xbacb('0x3b'))[_0xbacb('0x25')](_0x2dd382,_0x576f20);}});}});case _0xbacb('0x1b'):var _0x40b2f4=_[_0xbacb('0x31')](_0x26ce7d);if(_0xd5e476[_0xbacb('0x32')]){var _0xca98cb={};_0xca98cb[_0xd5e476['additionalSearchContact']]=_0x479399;_[_0xbacb('0x36')](_0x40b2f4[_0xbacb('0x37')],_0xca98cb);}return _0x411bd9['sobject']('Contact')[_0xbacb('0x25')](_0x40b2f4,_0x576f20)[_0xbacb('0x3c')]();case'lead':var _0x1abdd4=_[_0xbacb('0x31')](_0x26ce7d);if(_0xd5e476[_0xbacb('0x35')]){var _0xca98cb={};_0xca98cb[_0xd5e476['additionalSearchLead']]=_0x479399;_[_0xbacb('0x36')](_0x1abdd4[_0xbacb('0x37')],_0xca98cb);}return _0x411bd9[_0xbacb('0x1f')](_0xbacb('0x3b'))[_0xbacb('0x25')](_0x1abdd4,_0x576f20);case _0xbacb('0x19'):var _0x556090=_[_0xbacb('0x31')](_0x26ce7d);if(_0xd5e476['additionalSearchAccount']){var _0xca98cb={};_0xca98cb[_0xd5e476[_0xbacb('0x39')]]=_0x479399;_[_0xbacb('0x36')](_0x556090[_0xbacb('0x37')],_0xca98cb);}return _0x411bd9[_0xbacb('0x1f')](_0xbacb('0x3a'))['find'](_0x556090,_0x576f20);default:return null;}})['then'](function(_0x1be7d4){if(_0x1be7d4&&_0x1be7d4[_0xbacb('0x34')]){var _0x48992e=_[_0xbacb('0x3d')](_0x1be7d4);if(_0x48992e){return BPromise[_0xbacb('0x29')]({'id':_0x48992e['Id'],'name':_0x48992e[_0xbacb('0x2a')],'phone':_0x48992e[_0xbacb('0x3e')],'endUserType':_0x48992e[_0xbacb('0x3f')][_0xbacb('0x40')][_0xbacb('0x41')]()});}}})[_0xbacb('0x24')](function(_0x1ae676){if(_0x1ae676){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x1ae676['endUserType'],_0x479399);return BPromise['resolve'](_0x1ae676);}else{logger[_0xbacb('0x27')](_0xbacb('0x42'),_0x479399);var _0x5d63af={'Phone':_0x479399};if(_0xd5e476[_0xbacb('0x43')]){if(_0xd5e476['moduleCreate']===_0xbacb('0x1b')){logger[_0xbacb('0x27')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x479399,_0xd5e476[_0xbacb('0x43')]);_0x5d63af['LastName']=_0x3b3a5d!==_0xbacb('0x44')?_0x3b3a5d:util['format'](_0xbacb('0x45'),_0x479399);}else if(_0xd5e476['moduleCreate']==='lead'){logger['info'](_0xbacb('0x46'),_0x479399,_0xd5e476['moduleCreate']);_0x5d63af['LastName']=_0x3b3a5d!==''?_0x3b3a5d:util[_0xbacb('0x47')](_0xbacb('0x45'),_0x479399);_0x5d63af[_0xbacb('0x48')]=_0xbacb('0x49');}else if(_0xd5e476[_0xbacb('0x43')]===_0xbacb('0x19')){logger[_0xbacb('0x27')](_0xbacb('0x46'),_0x479399,_0xd5e476[_0xbacb('0x43')]);_0x5d63af[_0xbacb('0x2a')]=_0x3b3a5d!==_0xbacb('0x44')?_0x3b3a5d:util[_0xbacb('0x47')](_0xbacb('0x45'),_0x479399);}else{return null;}}return _0x411bd9[_0xbacb('0x1f')](_[_0xbacb('0x4a')](_0xd5e476['moduleCreate']))[_0xbacb('0x20')](_0x5d63af)[_0xbacb('0x24')](function(_0x12800a){return BPromise['resolve']({'id':_0x12800a['id'],'endUserType':_0xd5e476[_0xbacb('0x43')]});});}});}function getCustomFields(_0x3f58dd,_0x2f2229){var _0x51b5df={};if(_0x3f58dd[_0xbacb('0x34')]>0x0){_[_0xbacb('0x4b')](_0x3f58dd,function(_0x30d2d9){if(_['includes']([_0xbacb('0x4c'),_0xbacb('0x4d')],_0x30d2d9['type'])&&_0x30d2d9['idField']){_0x51b5df[_0x30d2d9[_0xbacb('0x4e')]]=_0x30d2d9[_0xbacb('0x4f')][_0xbacb('0x50')]();}else if(_0x30d2d9[_0xbacb('0x40')]===_0xbacb('0x51')&&_0x30d2d9[_0xbacb('0x52')]&&_0x30d2d9[_0xbacb('0x4e')]){_0x2f2229[_0x30d2d9[_0xbacb('0x52')]]&&(_0x51b5df[_0x30d2d9[_0xbacb('0x4e')]]=_0x2f2229[_0x30d2d9[_0xbacb('0x52')]][_0xbacb('0x50')]());}else if(_0x30d2d9[_0xbacb('0x40')]==='customVariable'&&_0x30d2d9[_0xbacb('0x53')]&&_0x30d2d9[_0xbacb('0x53')][_0xbacb('0x54')]&&_0x30d2d9[_0xbacb('0x4e')]){_0x2f2229[_0x30d2d9[_0xbacb('0x53')][_0xbacb('0x54')][_0xbacb('0x41')]()]&&(_0x51b5df[_0x30d2d9[_0xbacb('0x4e')]]=_0x2f2229[_0x30d2d9[_0xbacb('0x53')][_0xbacb('0x54')]['toLowerCase']()]['toString']());}});}return _0x51b5df;}function getConnection(_0x4989b6){var _0x13192d=_0x4989b6['password'][_0xbacb('0x55')](_0x4989b6[_0xbacb('0x56')]);var _0x567046=new jsforce[(_0xbacb('0x57'))]({'oauth2':{'loginUrl':_0x4989b6[_0xbacb('0x58')]||_0xbacb('0x59'),'clientId':_0x4989b6[_0xbacb('0x5a')],'clientSecret':_0x4989b6[_0xbacb('0x5b')]}});return _0x567046['login'](_0x4989b6[_0xbacb('0x5c')],_0x13192d)['then'](function(){logger[_0xbacb('0x27')](_0xbacb('0x5d'));return _0x567046;});}exports['queue']=function(_0x2846c9,_0x361c1c,_0x2c73af,_0x1209bb,_0x11bea7,_0x118448){var _0xa54c57,_0x431f55,_0xa13e7c,_0x3de29d;_0x118448[_0xbacb('0x5e')]=intUtil[_0xbacb('0x5f')](_0x118448['serverUrl']);_0x118448[_0xbacb('0x58')]=intUtil[_0xbacb('0x5f')](_0x118448[_0xbacb('0x58')]);if(_0x11bea7&&_0x11bea7['monitor_format']){logger[_0xbacb('0x27')](_0xbacb('0x60'),_0xbacb('0x61'));_0x361c1c[_0xbacb('0x62')]=util[_0xbacb('0x47')](_0xbacb('0x63'),_0x118448[_0xbacb('0x5e')],_0x361c1c[_0xbacb('0x64')],md5(_0x361c1c[_0xbacb('0x64')]));}else{_0x361c1c[_0xbacb('0x62')]='';}return getConnection(_0x118448)[_0xbacb('0x24')](function(_0x28b9db){_0x3de29d=_0x28b9db;return getUser(_0x118448,_0x1209bb['email'],_0x3de29d);})[_0xbacb('0x24')](function(_0xe0df9f){_0xa54c57=_0xe0df9f;return getEndUser(_0x118448,_0x2c73af,_0x361c1c['calleridname'],_0x361c1c[_0xbacb('0x65')],_0x3de29d);})['then'](function(_0x2eefb3){_0x431f55=_0x2eefb3;return getTicket(_0x118448,_0xa54c57,_0x431f55,_0x2c73af,_0x361c1c,_0x2c73af[_0xbacb('0x66')],_0x3de29d,_0xbacb('0x67'));})[_0xbacb('0x24')](function(_0x41bbcd){_0xa13e7c=_0x41bbcd;logger[_0xbacb('0x27')](_0xbacb('0x68'),_0xa13e7c['id']);logger['info'](_0xbacb('0x69'),_0xa13e7c['id'],_0x1209bb[_0xbacb('0x54')],_0x118448['type']);switch(_0x118448[_0xbacb('0x40')]){case _0xbacb('0x6a'):emit(util['format'](_0xbacb('0x6b'),_0x1209bb[_0xbacb('0x54')]),_0xbacb('0x6c'),{'recordId':_0xa13e7c['id']});break;case _0xbacb('0x6d'):emit(util['format'](_0xbacb('0x6b'),_0x1209bb['name']),'trigger:browser:url',{'uri':util[_0xbacb('0x47')](_0xbacb('0x6e'),_0x3de29d['instanceUrl'],_0xa13e7c['id'])});break;default:logger[_0xbacb('0x6f')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xbacb('0x70')](function(_0xb29a4d){logger[_0xbacb('0x6f')](_0xbacb('0x60'),_0xb29a4d);});};exports[_0xbacb('0x71')]=function(_0x5ad711,_0x372ea9,_0x222060,_0x4b859b,_0x1d5725,_0x2634f9,_0x532b99){var _0x39f265,_0x1fd272,_0x2a3340,_0x55c808;_0x2634f9[_0xbacb('0x5e')]=intUtil[_0xbacb('0x5f')](_0x2634f9[_0xbacb('0x5e')]);_0x2634f9[_0xbacb('0x58')]=intUtil[_0xbacb('0x5f')](_0x2634f9[_0xbacb('0x58')]);if(_0x532b99&&_0x532b99[_0xbacb('0x72')]&&_0x532b99[_0xbacb('0x72')]!==_0xbacb('0x73')){logger[_0xbacb('0x27')](_0xbacb('0x74'),'Recording\x20is\x20enabled!');_0x372ea9[_0xbacb('0x62')]=util['format'](_0xbacb('0x63'),_0x2634f9[_0xbacb('0x5e')],_0x372ea9[_0xbacb('0x64')],md5(_0x372ea9[_0xbacb('0x64')]));}return getConnection(_0x2634f9)[_0xbacb('0x24')](function(_0x293aa6){_0x55c808=_0x293aa6;return getUser(_0x2634f9,_0x4b859b[_0xbacb('0x75')],_0x55c808);})[_0xbacb('0x24')](function(_0x513d90){_0x39f265=_0x513d90;return getEndUser(_0x2634f9,_0x222060,_0x372ea9[_0xbacb('0x76')],_0x372ea9['destcalleridnum'],_0x55c808);})[_0xbacb('0x24')](function(_0x695cc){_0x1fd272=_0x695cc;return getTicket(_0x2634f9,_0x39f265,_0x1fd272,_0x222060,_0x372ea9,_0x222060[_0xbacb('0x66')],_0x55c808,_0xbacb('0x71'));})[_0xbacb('0x24')](function(_0x34dfdf){_0x2a3340=_0x34dfdf;logger['info'](_0xbacb('0x77'),_0x2a3340['id']);logger[_0xbacb('0x27')](_0xbacb('0x78'),_0x2a3340['id'],_0x4b859b[_0xbacb('0x54')],_0x2634f9[_0xbacb('0x40')]);switch(_0x2634f9[_0xbacb('0x40')]){case _0xbacb('0x6a'):emit(util['format'](_0xbacb('0x6b'),_0x4b859b['name']),_0xbacb('0x6c'),{'recordId':_0x2a3340['id']});break;case _0xbacb('0x6d'):emit(util['format'](_0xbacb('0x6b'),_0x4b859b[_0xbacb('0x54')]),_0xbacb('0x79'),{'uri':util['format'](_0xbacb('0x6e'),_0x55c808[_0xbacb('0x7a')],_0x2a3340['id'])});break;default:logger[_0xbacb('0x6f')]('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xbacb('0x70')](function(_0x572001){logger[_0xbacb('0x6f')](_0xbacb('0x74'),_0x572001);});};exports[_0xbacb('0x7b')]=function(_0x8fae72,_0x313967,_0x220fdf,_0xc4faab,_0x37c9ff,_0x1d40a7){var _0x1f044a,_0x8cd030,_0x3ffbef,_0x3e55af;_0x1d40a7['serverUrl']=intUtil[_0xbacb('0x5f')](_0x1d40a7['serverUrl']);_0x1d40a7[_0xbacb('0x58')]=intUtil[_0xbacb('0x5f')](_0x1d40a7[_0xbacb('0x58')]);if(_0x37c9ff&&_0x37c9ff[_0xbacb('0x7c')]){logger[_0xbacb('0x27')]('['+_0x313967[_0xbacb('0x7d')]['toUpperCase']()+']',_0xbacb('0x61'));_0x313967[_0xbacb('0x62')]=util[_0xbacb('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1d40a7[_0xbacb('0x5e')],_0x313967[_0xbacb('0x64')],md5(_0x313967[_0xbacb('0x64')]));}else{_0x313967[_0xbacb('0x62')]='';}return getConnection(_0x1d40a7)[_0xbacb('0x24')](function(_0x1f94e8){_0x3e55af=_0x1f94e8;if(!_[_0xbacb('0x21')](_0xc4faab)){return getUser(_0x1d40a7,_0xc4faab[_0xbacb('0x54')],_0x3e55af);}else{return getUser(_0x1d40a7,null,_0x3e55af);}})['then'](function(_0x294105){_0x1f044a=_0x294105;return getEndUser(_0x1d40a7,_0x220fdf,_0x313967['calleridname'],_0x313967[_0xbacb('0x65')],_0x3e55af);})[_0xbacb('0x24')](function(_0x52bdae){_0x8cd030=_0x52bdae;return getTicket(_0x1d40a7,_0x1f044a,_0x8cd030,_0x220fdf,_0x313967,_0x220fdf[_0xbacb('0x66')],_0x3e55af);})[_0xbacb('0x24')](function(_0x2b5516){_0x3ffbef=_0x2b5516;logger[_0xbacb('0x27')]('['+_0x313967['lastevent'][_0xbacb('0x7e')]()+']\x20Ticket\x20%s\x20created.',_0x3ffbef['id']);logger[_0xbacb('0x27')]('['+_0x313967[_0xbacb('0x7d')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x1d40a7[_0xbacb('0x40')]);})[_0xbacb('0x70')](function(_0x3de05e){logger[_0xbacb('0x6f')]('['+_0x313967['lastevent'][_0xbacb('0x7e')]()+']',_0x3de05e);});}; \ No newline at end of file +var _0x5615=['queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','assign','Subjects','getString','Descriptions','Task','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ticketType','ContactId','AccountId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','find','execute','Email','Agent\x20%s\x20found.','resolve','Name','identity','then','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','length','additionalSearchLead','merge','Lead','additionalSearchAccount','Account','Contact','first','Phone','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','Company','No\x20Company','upperFirst','create','includes','idField','content','toString','type','variable','variableName','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5615,0x11b));var _0x5561=function(_0xcaaabb,_0x5bf8eb){_0xcaaabb=_0xcaaabb-0x0;var _0x1be3b5=_0x5615[_0xcaaabb];return _0x1be3b5;};'use strict';var _=require(_0x5561('0x0'));var rp=require('request-promise');var moment=require(_0x5561('0x1'));var BPromise=require('bluebird');var md5=require(_0x5561('0x2'));var jsforce=require(_0x5561('0x3'));var util=require(_0x5561('0x4'));var Redis=require(_0x5561('0x5'));var intUtil=require(_0x5561('0x6'));var config=require(_0x5561('0x7'));var logger=require(_0x5561('0x8'))('salesforce');config[_0x5561('0x9')]=_[_0x5561('0xa')](config[_0x5561('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x5561('0xb'))(new Redis(config['redis']));function emit(_0x5daaa7,_0x86e27e,_0x54c140){io['to'](_0x5daaa7)['emit'](_0x86e27e,_0x54c140);}function getTicket(_0x4a0fcc,_0x2bddb4,_0x181ee7,_0x5b9acc,_0x57b4d0,_0xf4cfe3,_0x44de52,_0x478903){var _0x321ab7=Object[_0x5561('0xc')]({},{'OwnerId':_0x2bddb4['id'],'Subject':intUtil['getString'](_0x5b9acc[_0x5561('0xd')],_0x57b4d0,'\x20'),'Description':intUtil[_0x5561('0xe')](_0x5b9acc[_0x5561('0xf')],_0x57b4d0,'\x0a')},getCustomFields(_0xf4cfe3,_0x57b4d0));if(_0x181ee7){if(_0x5b9acc['ticketType']===_0x5561('0x10')){_0x321ab7['ActivityDate']=moment[_0x5561('0x11')]();_0x321ab7['IsReminderSet']=![];_0x321ab7[_0x5561('0x12')]=![];if(_0x181ee7[_0x5561('0x13')]===_0x5561('0x14')||_0x181ee7['endUserType']===_0x5561('0x15')){_0x321ab7[_0x5561('0x16')]=_0x181ee7['id'];}else if(_0x181ee7[_0x5561('0x13')]===_0x5561('0x17')){_0x321ab7[_0x5561('0x18')]=_0x181ee7['id'];}}else if(_0x5b9acc[_0x5561('0x19')]==='Case'){if(_0x181ee7[_0x5561('0x13')]===_0x5561('0x14')){_0x321ab7[_0x5561('0x1a')]=_0x181ee7['id'];}else if(_0x181ee7[_0x5561('0x13')]==='account'){_0x321ab7[_0x5561('0x1b')]=_0x181ee7['id'];}else if(_0x181ee7[_0x5561('0x13')]===_0x5561('0x15')&&_0x5b9acc['leadId']){_0x321ab7[_0x5b9acc['leadId']]=_0x181ee7['id'];}else{logger[_0x5561('0x1c')](_0x5561('0x1d'));}}}return _0x44de52[_0x5561('0x1e')](_0x5b9acc[_0x5561('0x19')])['create'](_0x321ab7);}function getUser(_0x1d3042,_0x4e69bc,_0x54eb09){if(!_[_0x5561('0x1f')](_0x4e69bc)&&intUtil[_0x5561('0x20')](_0x4e69bc)){var _0x5451f3={'Email':_0x4e69bc};var _0x301d00={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x54eb09[_0x5561('0x1e')]('User')[_0x5561('0x21')](_0x5451f3,_0x301d00)[_0x5561('0x22')]()['then'](function(_0x57d37a){if(_0x57d37a['length']){var _0x4b4e21=_[_0x5561('0x21')](_0x57d37a,function(_0x495799){return _0x495799[_0x5561('0x23')]===_0x4e69bc;});if(_0x4b4e21){logger[_0x5561('0x1c')](_0x5561('0x24'),_0x4e69bc);return BPromise[_0x5561('0x25')]({'id':_0x4b4e21['Id'],'name':_0x4b4e21[_0x5561('0x26')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x4e69bc);return _0x54eb09[_0x5561('0x27')]()[_0x5561('0x28')](function(_0x43d08e){return BPromise[_0x5561('0x25')]({'id':_0x43d08e[_0x5561('0x29')],'name':_0x43d08e[_0x5561('0x2a')]});});}});}else{logger[_0x5561('0x1c')](_0x5561('0x2b'),_0x4e69bc);return _0x54eb09['identity']()[_0x5561('0x28')](function(_0x1d9702){return BPromise[_0x5561('0x25')]({'id':_0x1d9702[_0x5561('0x29')],'name':_0x1d9702[_0x5561('0x2a')]});});}}function getEndUser(_0x26dfcc,_0xfd06b2,_0x44ecc5,_0x57dfd2,_0x4f5572){var _0x5b7e70={'$or':{'Phone':_0x57dfd2}};var _0x59a713={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x5561('0x28')](function(){logger[_0x5561('0x1c')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x57dfd2,_0xfd06b2[_0x5561('0x2c')]);switch(_0xfd06b2['moduleSearch']){case _0x5561('0x2d'):var _0x55a83c=_[_0x5561('0x2e')](_0x5b7e70);if(_0xfd06b2['additionalSearchContact']){var _0x24644b={};_0x24644b[_0xfd06b2[_0x5561('0x2f')]]=_0x57dfd2;_['merge'](_0x55a83c[_0x5561('0x30')],_0x24644b);}return _0x4f5572[_0x5561('0x1e')]('Contact')[_0x5561('0x21')](_0x55a83c,_0x59a713)[_0x5561('0x22')]()[_0x5561('0x28')](function(_0x5c20f3){if(_0x5c20f3&&_0x5c20f3[_0x5561('0x31')]){return _0x5c20f3;}else{var _0xabd7af=_[_0x5561('0x2e')](_0x5b7e70);if(_0xfd06b2[_0x5561('0x32')]){var _0x16523b={};_0x16523b[_0xfd06b2[_0x5561('0x32')]]=_0x57dfd2;_[_0x5561('0x33')](_0xabd7af['$or'],_0x16523b);}return _0x4f5572[_0x5561('0x1e')](_0x5561('0x34'))[_0x5561('0x21')](_0xabd7af,_0x59a713);}});case'account_contact_lead':var _0x245570=_[_0x5561('0x2e')](_0x5b7e70);if(_0xfd06b2[_0x5561('0x35')]){var _0x24644b={};_0x24644b[_0xfd06b2[_0x5561('0x35')]]=_0x57dfd2;_[_0x5561('0x33')](_0x245570[_0x5561('0x30')],_0x24644b);}return _0x4f5572[_0x5561('0x1e')](_0x5561('0x36'))[_0x5561('0x21')](_0x245570,_0x59a713)['execute']()[_0x5561('0x28')](function(_0xcd8c4a){if(_0xcd8c4a&&_0xcd8c4a['length']){return _0xcd8c4a;}else{var _0x5b786f=_[_0x5561('0x2e')](_0x5b7e70);if(_0xfd06b2['additionalSearchContact']){var _0x53c2f8={};_0x53c2f8[_0xfd06b2['additionalSearchContact']]=_0x57dfd2;_[_0x5561('0x33')](_0x5b786f[_0x5561('0x30')],_0x53c2f8);}return _0x4f5572[_0x5561('0x1e')](_0x5561('0x37'))[_0x5561('0x21')](_0x5b786f,_0x59a713)['then'](function(_0x437768){if(_0x437768&&_0x437768[_0x5561('0x31')]){return _0x437768;}else{var _0x47fb7b=_[_0x5561('0x2e')](_0x5b7e70);if(_0xfd06b2['additionalSearchLead']){var _0x311b07={};_0x311b07[_0xfd06b2[_0x5561('0x32')]]=_0x57dfd2;_[_0x5561('0x33')](_0x47fb7b[_0x5561('0x30')],_0x311b07);}return _0x4f5572['sobject'](_0x5561('0x34'))[_0x5561('0x21')](_0x47fb7b,_0x59a713);}});}});case'contact':var _0x55a83c=_[_0x5561('0x2e')](_0x5b7e70);if(_0xfd06b2['additionalSearchContact']){var _0x24644b={};_0x24644b[_0xfd06b2[_0x5561('0x2f')]]=_0x57dfd2;_[_0x5561('0x33')](_0x55a83c[_0x5561('0x30')],_0x24644b);}return _0x4f5572[_0x5561('0x1e')](_0x5561('0x37'))[_0x5561('0x21')](_0x55a83c,_0x59a713)[_0x5561('0x22')]();case _0x5561('0x15'):var _0x44f296=_[_0x5561('0x2e')](_0x5b7e70);if(_0xfd06b2[_0x5561('0x32')]){var _0x24644b={};_0x24644b[_0xfd06b2[_0x5561('0x32')]]=_0x57dfd2;_[_0x5561('0x33')](_0x44f296['$or'],_0x24644b);}return _0x4f5572[_0x5561('0x1e')](_0x5561('0x34'))[_0x5561('0x21')](_0x44f296,_0x59a713);case'account':var _0x245570=_[_0x5561('0x2e')](_0x5b7e70);if(_0xfd06b2['additionalSearchAccount']){var _0x24644b={};_0x24644b[_0xfd06b2['additionalSearchAccount']]=_0x57dfd2;_[_0x5561('0x33')](_0x245570['$or'],_0x24644b);}return _0x4f5572[_0x5561('0x1e')](_0x5561('0x36'))[_0x5561('0x21')](_0x245570,_0x59a713);default:return null;}})['then'](function(_0x1406d9){if(_0x1406d9&&_0x1406d9['length']){var _0x5cbe67=_[_0x5561('0x38')](_0x1406d9);if(_0x5cbe67){return BPromise[_0x5561('0x25')]({'id':_0x5cbe67['Id'],'name':_0x5cbe67[_0x5561('0x26')],'phone':_0x5cbe67[_0x5561('0x39')],'endUserType':_0x5cbe67['attributes']['type'][_0x5561('0x3a')]()});}}})[_0x5561('0x28')](function(_0x5d1183){if(_0x5d1183){logger[_0x5561('0x1c')](_0x5561('0x3b'),_0x5d1183[_0x5561('0x13')],_0x57dfd2);return BPromise[_0x5561('0x25')](_0x5d1183);}else{logger['info'](_0x5561('0x3c'),_0x57dfd2);var _0x23f7be={'Phone':_0x57dfd2};if(_0xfd06b2[_0x5561('0x3d')]){if(_0xfd06b2['moduleCreate']===_0x5561('0x14')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x57dfd2,_0xfd06b2[_0x5561('0x3d')]);_0x23f7be['LastName']=_0x44ecc5!==_0x5561('0x3e')?_0x44ecc5:util[_0x5561('0x3f')](_0x5561('0x40'),_0x57dfd2);}else if(_0xfd06b2['moduleCreate']===_0x5561('0x15')){logger[_0x5561('0x1c')](_0x5561('0x41'),_0x57dfd2,_0xfd06b2[_0x5561('0x3d')]);_0x23f7be[_0x5561('0x42')]=_0x44ecc5!==''?_0x44ecc5:util[_0x5561('0x3f')](_0x5561('0x40'),_0x57dfd2);_0x23f7be[_0x5561('0x43')]=_0x5561('0x44');}else if(_0xfd06b2['moduleCreate']===_0x5561('0x17')){logger['info'](_0x5561('0x41'),_0x57dfd2,_0xfd06b2['moduleCreate']);_0x23f7be['Name']=_0x44ecc5!==''?_0x44ecc5:util['format'](_0x5561('0x40'),_0x57dfd2);}else{return null;}}return _0x4f5572[_0x5561('0x1e')](_[_0x5561('0x45')](_0xfd06b2[_0x5561('0x3d')]))[_0x5561('0x46')](_0x23f7be)[_0x5561('0x28')](function(_0x44d54b){return BPromise['resolve']({'id':_0x44d54b['id'],'endUserType':_0xfd06b2[_0x5561('0x3d')]});});}});}function getCustomFields(_0x4344d0,_0x160381){var _0x5d1d78={};if(_0x4344d0[_0x5561('0x31')]>0x0){_['forEach'](_0x4344d0,function(_0xc48671){if(_[_0x5561('0x47')](['string','picklist'],_0xc48671['type'])&&_0xc48671[_0x5561('0x48')]){_0x5d1d78[_0xc48671[_0x5561('0x48')]]=_0xc48671[_0x5561('0x49')][_0x5561('0x4a')]();}else if(_0xc48671[_0x5561('0x4b')]===_0x5561('0x4c')&&_0xc48671[_0x5561('0x4d')]&&_0xc48671[_0x5561('0x48')]){_0x160381[_0xc48671[_0x5561('0x4d')]]&&(_0x5d1d78[_0xc48671[_0x5561('0x48')]]=_0x160381[_0xc48671['variableName']]['toString']());}else if(_0xc48671[_0x5561('0x4b')]==='customVariable'&&_0xc48671[_0x5561('0x4e')]&&_0xc48671[_0x5561('0x4e')][_0x5561('0x4f')]&&_0xc48671[_0x5561('0x48')]){_0x160381[_0xc48671[_0x5561('0x4e')][_0x5561('0x4f')]['toLowerCase']()]&&(_0x5d1d78[_0xc48671['idField']]=_0x160381[_0xc48671[_0x5561('0x4e')][_0x5561('0x4f')][_0x5561('0x3a')]()]['toString']());}});}return _0x5d1d78;}function getConnection(_0x13fa07){var _0x4c6585=_0x13fa07[_0x5561('0x50')][_0x5561('0x51')](_0x13fa07[_0x5561('0x52')]);var _0x3f46a4=new jsforce[(_0x5561('0x53'))]({'oauth2':{'loginUrl':_0x13fa07[_0x5561('0x54')]||_0x5561('0x55'),'clientId':_0x13fa07[_0x5561('0x56')],'clientSecret':_0x13fa07[_0x5561('0x57')]}});return _0x3f46a4['login'](_0x13fa07[_0x5561('0x58')],_0x4c6585)[_0x5561('0x28')](function(){logger[_0x5561('0x1c')]('Connection\x20established.');return _0x3f46a4;});}exports[_0x5561('0x59')]=function(_0x26a240,_0x4ea920,_0x37ef47,_0x2ac65c,_0x4ad6f1,_0x5d6e47){var _0x1c78f4,_0x2e72e7,_0x4d0034,_0xecdb5a;_0x5d6e47[_0x5561('0x5a')]=intUtil[_0x5561('0x5b')](_0x5d6e47[_0x5561('0x5a')]);_0x5d6e47[_0x5561('0x54')]=intUtil['stripTrailingSlash'](_0x5d6e47[_0x5561('0x54')]);if(_0x4ad6f1&&_0x4ad6f1[_0x5561('0x5c')]){logger[_0x5561('0x1c')]('[QUEUE]',_0x5561('0x5d'));_0x4ea920[_0x5561('0x5e')]=util['format'](_0x5561('0x5f'),_0x5d6e47[_0x5561('0x5a')],_0x4ea920[_0x5561('0x60')],md5(_0x4ea920[_0x5561('0x60')]));}else{_0x4ea920[_0x5561('0x5e')]='';}return getConnection(_0x5d6e47)[_0x5561('0x28')](function(_0x1f718b){_0xecdb5a=_0x1f718b;return getUser(_0x5d6e47,_0x2ac65c['email'],_0xecdb5a);})[_0x5561('0x28')](function(_0x4b1c8d){_0x1c78f4=_0x4b1c8d;return getEndUser(_0x5d6e47,_0x37ef47,_0x4ea920[_0x5561('0x61')],_0x4ea920[_0x5561('0x62')],_0xecdb5a);})[_0x5561('0x28')](function(_0x5bf22f){_0x2e72e7=_0x5bf22f;return getTicket(_0x5d6e47,_0x1c78f4,_0x2e72e7,_0x37ef47,_0x4ea920,_0x37ef47['Fields'],_0xecdb5a,_0x5561('0x59'));})['then'](function(_0x417aa2){_0x4d0034=_0x417aa2;logger[_0x5561('0x1c')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x4d0034['id']);logger[_0x5561('0x1c')](_0x5561('0x63'),_0x4d0034['id'],_0x2ac65c['name'],_0x5d6e47[_0x5561('0x4b')]);switch(_0x5d6e47[_0x5561('0x4b')]){case'integrationTab':emit(util[_0x5561('0x3f')](_0x5561('0x64'),_0x2ac65c[_0x5561('0x4f')]),_0x5561('0x65'),{'recordId':_0x4d0034['id']});break;case _0x5561('0x66'):emit(util[_0x5561('0x3f')](_0x5561('0x64'),_0x2ac65c[_0x5561('0x4f')]),'trigger:browser:url',{'uri':util[_0x5561('0x3f')]('%s/%s/e',_0xecdb5a[_0x5561('0x67')],_0x4d0034['id'])});break;default:logger[_0x5561('0x68')](_0x5561('0x69'));}})[_0x5561('0x6a')](function(_0x73f5a9){logger['error']('[QUEUE]',_0x73f5a9);});};exports[_0x5561('0x6b')]=function(_0x117585,_0x27f11a,_0x5e5acc,_0x3c9a54,_0x3b1b02,_0x251de9,_0x47eb92){var _0x5e58aa,_0x715854,_0x1dbdcf,_0x45d064;_0x251de9['serverUrl']=intUtil[_0x5561('0x5b')](_0x251de9[_0x5561('0x5a')]);_0x251de9[_0x5561('0x54')]=intUtil[_0x5561('0x5b')](_0x251de9['remoteUri']);if(_0x47eb92&&_0x47eb92[_0x5561('0x6c')]&&_0x47eb92[_0x5561('0x6c')]!==_0x5561('0x6d')){logger['info'](_0x5561('0x6e'),_0x5561('0x5d'));_0x27f11a[_0x5561('0x5e')]=util[_0x5561('0x3f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x251de9[_0x5561('0x5a')],_0x27f11a[_0x5561('0x60')],md5(_0x27f11a[_0x5561('0x60')]));}return getConnection(_0x251de9)[_0x5561('0x28')](function(_0x111f56){_0x45d064=_0x111f56;return getUser(_0x251de9,_0x3c9a54[_0x5561('0x6f')],_0x45d064);})[_0x5561('0x28')](function(_0x25102d){_0x5e58aa=_0x25102d;return getEndUser(_0x251de9,_0x5e5acc,_0x27f11a[_0x5561('0x70')],_0x27f11a[_0x5561('0x71')],_0x45d064);})[_0x5561('0x28')](function(_0x4e56f9){_0x715854=_0x4e56f9;return getTicket(_0x251de9,_0x5e58aa,_0x715854,_0x5e5acc,_0x27f11a,_0x5e5acc[_0x5561('0x72')],_0x45d064,_0x5561('0x6b'));})[_0x5561('0x28')](function(_0x1111db){_0x1dbdcf=_0x1111db;logger[_0x5561('0x1c')](_0x5561('0x73'),_0x1dbdcf['id']);logger[_0x5561('0x1c')](_0x5561('0x74'),_0x1dbdcf['id'],_0x3c9a54[_0x5561('0x4f')],_0x251de9['type']);switch(_0x251de9['type']){case _0x5561('0x75'):emit(util['format']('user:%s',_0x3c9a54[_0x5561('0x4f')]),_0x5561('0x65'),{'recordId':_0x1dbdcf['id']});break;case _0x5561('0x66'):emit(util['format']('user:%s',_0x3c9a54[_0x5561('0x4f')]),_0x5561('0x76'),{'uri':util['format']('%s/%s/e',_0x45d064[_0x5561('0x67')],_0x1dbdcf['id'])});break;default:logger['error'](_0x5561('0x6e'),_0x5561('0x77'));}})[_0x5561('0x6a')](function(_0x24b9d8){logger[_0x5561('0x68')]('[OUTBOUND]',_0x24b9d8);});};exports[_0x5561('0x78')]=function(_0x44702d,_0x13f1f2,_0x512686,_0x380f03,_0x5a7bf4,_0x2efc95){var _0x52e40b,_0x5e2698,_0x3a20ad,_0x4fde16;_0x2efc95[_0x5561('0x5a')]=intUtil[_0x5561('0x5b')](_0x2efc95[_0x5561('0x5a')]);_0x2efc95[_0x5561('0x54')]=intUtil[_0x5561('0x5b')](_0x2efc95[_0x5561('0x54')]);if(_0x5a7bf4&&_0x5a7bf4[_0x5561('0x5c')]){logger[_0x5561('0x1c')]('['+_0x13f1f2[_0x5561('0x79')][_0x5561('0x7a')]()+']',_0x5561('0x5d'));_0x13f1f2['recordingURL']=util[_0x5561('0x3f')](_0x5561('0x5f'),_0x2efc95[_0x5561('0x5a')],_0x13f1f2[_0x5561('0x60')],md5(_0x13f1f2[_0x5561('0x60')]));}else{_0x13f1f2[_0x5561('0x5e')]='';}return getConnection(_0x2efc95)[_0x5561('0x28')](function(_0x2db136){_0x4fde16=_0x2db136;if(!_[_0x5561('0x1f')](_0x380f03)){return getUser(_0x2efc95,_0x380f03[_0x5561('0x4f')],_0x4fde16);}else{return getUser(_0x2efc95,null,_0x4fde16);}})['then'](function(_0x476f58){_0x52e40b=_0x476f58;return getEndUser(_0x2efc95,_0x512686,_0x13f1f2[_0x5561('0x61')],_0x13f1f2[_0x5561('0x62')],_0x4fde16);})[_0x5561('0x28')](function(_0x19c81e){_0x5e2698=_0x19c81e;return getTicket(_0x2efc95,_0x52e40b,_0x5e2698,_0x512686,_0x13f1f2,_0x512686['Fields'],_0x4fde16);})[_0x5561('0x28')](function(_0x9ba2b8){_0x3a20ad=_0x9ba2b8;logger[_0x5561('0x1c')]('['+_0x13f1f2['lastevent'][_0x5561('0x7a')]()+']\x20Ticket\x20%s\x20created.',_0x3a20ad['id']);logger[_0x5561('0x1c')]('['+_0x13f1f2[_0x5561('0x79')]['toUpperCase']()+_0x5561('0x7b'),_0x2efc95[_0x5561('0x4b')]);})[_0x5561('0x6a')](function(_0x3c41ac){logger[_0x5561('0x68')]('['+_0x13f1f2[_0x5561('0x79')][_0x5561('0x7a')]()+']',_0x3c41ac);});}; \ 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 eb413cf..3a4b386 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 _0xf6b8=['%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','string','nameField','customField','toLowerCase','content','toString','picklist','idField','type','variable','variableName','customVariable','name','Variable',']\x20getTicket\x20input\x20crm','outbound','POST','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','all','push','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue'];(function(_0x18edef,_0x1af64e){var _0x3a4726=function(_0x406468){while(--_0x406468){_0x18edef['push'](_0x18edef['shift']());}};_0x3a4726(++_0x1af64e);}(_0xf6b8,0x93));var _0x8f6b=function(_0x541116,_0x182fbb){_0x541116=_0x541116-0x0;var _0xbe29bb=_0xf6b8[_0x541116];return _0xbe29bb;};'use strict';var _=require('lodash');var Promise=require(_0x8f6b('0x0'));var rp=require(_0x8f6b('0x1'));var util=require(_0x8f6b('0x2'));var md5=require(_0x8f6b('0x3'));var Redis=require(_0x8f6b('0x4'));var intUtil=require(_0x8f6b('0x5'));var config=require(_0x8f6b('0x6'));var logger=require('../../../../config/logger')('servicenow');config[_0x8f6b('0x7')]=_[_0x8f6b('0x8')](config[_0x8f6b('0x7')],{'host':_0x8f6b('0x9'),'port':0x18eb});var io=require(_0x8f6b('0xa'))(new Redis(config['redis']));function getAdminUser(_0x25ea65,_0x5911e5,_0x192a29,_0x372a55,_0x462f2d,_0x1cb315){return new Promise(function(_0x3dc576,_0x25b2b2){var _0x1a1666={'method':'GET','uri':_0x372a55+_0x8f6b('0xb')+'&'+_0x462f2d+'&'+_0x1cb315,'auth':_0x5911e5,'json':!![]};return rp(_0x1a1666)[_0x8f6b('0xc')](function(_0x440cc0){if(_0x440cc0[_0x8f6b('0xd')][_0x8f6b('0xe')]>0x0){_0x192a29[_0x8f6b('0xf')]=_0x440cc0[_0x8f6b('0xd')][0x0][_0x8f6b('0x10')];}logger[_0x8f6b('0x11')]('['+[_0x25ea65['toUpperCase']()]+_0x8f6b('0x12'),_0x192a29);_0x3dc576(_0x192a29);})[_0x8f6b('0x13')](function(_0x31ed52){logger['error']('['+[_0x25ea65[_0x8f6b('0x14')]()]+']',_0x31ed52[_0x8f6b('0x15')]);_0x25b2b2(_0x31ed52[_0x8f6b('0x15')]);});});}function getUser(_0x3f453b,_0x37fd48,_0x40da21,_0x4eab68,_0x542a7a){return function(_0x55bfa9){logger[_0x8f6b('0x11')]('['+[_0x3f453b['toUpperCase']()]+_0x8f6b('0x16'),_0x55bfa9);return new Promise(function(_0x3de223,_0x14fa04){if(intUtil[_0x8f6b('0x17')](_0x55bfa9[_0x8f6b('0x18')])){var _0x5dec15={'method':_0x8f6b('0x19'),'uri':_0x40da21+_0x8f6b('0x1a')+_0x55bfa9['userEmail']+'&'+_0x4eab68+'&'+_0x542a7a,'auth':_0x37fd48,'json':!![]};logger[_0x8f6b('0x11')]('['+[_0x3f453b[_0x8f6b('0x14')]()]+_0x8f6b('0x1b'),_0x5dec15);return rp(_0x5dec15)['then'](function(_0x282361){logger[_0x8f6b('0x11')]('['+[_0x3f453b[_0x8f6b('0x14')]()]+_0x8f6b('0x1c'),_0x282361);if(_0x282361[_0x8f6b('0xd')][_0x8f6b('0xe')]>0x0&&String(_0x282361[_0x8f6b('0xd')][0x0][_0x8f6b('0x1d')])===_0x8f6b('0x1e')){_0x55bfa9['userId']=_0x282361['result'][0x0][_0x8f6b('0x10')];}else{_0x55bfa9[_0x8f6b('0x1f')]=_0x55bfa9[_0x8f6b('0xf')];_0x55bfa9[_0x8f6b('0x18')]=_0x55bfa9[_0x8f6b('0x20')];}logger[_0x8f6b('0x11')]('['+[_0x3f453b[_0x8f6b('0x14')]()]+_0x8f6b('0x21'),_0x55bfa9);_0x3de223(_0x55bfa9);})['catch'](function(_0xccb8c9){logger[_0x8f6b('0x22')]('['+[_0x3f453b[_0x8f6b('0x14')]()]+']',_0xccb8c9[_0x8f6b('0x15')]);_0x14fa04(_0xccb8c9['message']);});}else{logger[_0x8f6b('0x11')]('['+[_0x3f453b[_0x8f6b('0x14')]()]+_0x8f6b('0x23'));_0x55bfa9[_0x8f6b('0x1f')]=_0x55bfa9[_0x8f6b('0xf')];_0x55bfa9[_0x8f6b('0x18')]=_0x55bfa9[_0x8f6b('0x20')];_0x3de223(_0x55bfa9);}});};}function createEndUser(_0x54dd1e,_0x576c5d,_0x4549a5,_0xd37218,_0x3c0150){logger[_0x8f6b('0x11')]('['+[_0x54dd1e[_0x8f6b('0x14')]()]+_0x8f6b('0x24'),_0x4549a5);return new Promise(function(_0x85c3,_0x7cd0ee){var _0x563828={'method':'POST','uri':_0xd37218+_0x8f6b('0x25')+_0x3c0150,'body':{'user_name':_0x4549a5[_0x8f6b('0x26')],'roles':'user','first_name':_0x4549a5[_0x8f6b('0x26')],'active':_0x8f6b('0x1e'),'date_format':'System','phone':_0x4549a5[_0x8f6b('0x26')]},'auth':_0x576c5d,'json':!![]};return rp(_0x563828)['then'](function(_0x5d2546){logger[_0x8f6b('0x11')]('['+[_0x54dd1e[_0x8f6b('0x14')]()]+_0x8f6b('0x27'),_0x5d2546[_0x8f6b('0xd')]);_0x4549a5[_0x8f6b('0x28')]=_0x5d2546[_0x8f6b('0xd')][_0x8f6b('0x10')];_0x85c3(_0x4549a5);})[_0x8f6b('0x13')](function(_0x5595f2){logger[_0x8f6b('0x22')]('['+[_0x54dd1e['toUpperCase']()]+']',_0x5595f2['message']);_0x7cd0ee(_0x5595f2['message']);});});}function getEndUser(_0x47afb5,_0x37914c,_0x148123,_0x271f30,_0x193ca8){return function(_0x543f2a){logger['info']('['+[_0x47afb5[_0x8f6b('0x14')]()]+_0x8f6b('0x29'),_0x543f2a);return new Promise(function(_0x2477ba,_0x2d66b5){var _0x233b1d={'method':_0x8f6b('0x19'),'uri':_0x148123+_0x8f6b('0x2a')+_0x543f2a[_0x8f6b('0x26')]+'&'+_0x271f30+'&'+_0x193ca8,'auth':_0x37914c,'json':!![]};return rp(_0x233b1d)[_0x8f6b('0xc')](function(_0x4eaa73){if(_0x4eaa73[_0x8f6b('0xd')][_0x8f6b('0xe')]>0x0){_0x543f2a[_0x8f6b('0x28')]=_0x4eaa73[_0x8f6b('0xd')][0x0][_0x8f6b('0x10')];logger[_0x8f6b('0x11')]('['+[_0x47afb5[_0x8f6b('0x14')]()]+_0x8f6b('0x2b'),_0x543f2a);_0x2477ba(_0x543f2a);}else{return createEndUser(_0x47afb5,_0x37914c,_0x543f2a,_0x148123,_0x271f30)[_0x8f6b('0xc')](function(_0x4d0739){logger['info']('['+[_0x47afb5[_0x8f6b('0x14')]()]+'],\x20createEndUser\x20crm',_0x4d0739);_0x2477ba(_0x4d0739);});}})[_0x8f6b('0x13')](function(_0x819fc3){logger[_0x8f6b('0x22')]('['+[_0x47afb5[_0x8f6b('0x14')]()]+']',_0x819fc3[_0x8f6b('0x15')]);_0x2d66b5(_0x819fc3[_0x8f6b('0x15')]);});});};}function getCustomFields(_0x2b7f92,_0x1d9f19){var _0x38840e={};if(_0x2b7f92[_0x8f6b('0xe')]>0x0){_[_0x8f6b('0x2c')](_0x2b7f92,function(_0x266219){if(_[_0x8f6b('0x2d')]([_0x8f6b('0x2e'),'picklist'],_0x266219['type'])&&_0x266219[_0x8f6b('0x2f')]&&!_0x266219[_0x8f6b('0x30')]){_0x38840e[_0x266219[_0x8f6b('0x2f')][_0x8f6b('0x31')]()]=_0x266219[_0x8f6b('0x32')][_0x8f6b('0x33')]();}else if(_[_0x8f6b('0x2d')]([_0x8f6b('0x2e'),_0x8f6b('0x34')],_0x266219['type'])&&_0x266219[_0x8f6b('0x35')]&&_0x266219['customField']){_0x38840e[_0x266219[_0x8f6b('0x35')][_0x8f6b('0x31')]()]=_0x266219[_0x8f6b('0x32')]['toString']();}else if(_0x266219[_0x8f6b('0x36')]===_0x8f6b('0x37')&&_0x266219[_0x8f6b('0x38')]&&_0x266219[_0x8f6b('0x35')]&&_0x266219[_0x8f6b('0x30')]){_0x38840e[_0x266219[_0x8f6b('0x35')][_0x8f6b('0x31')]()]=_0x1d9f19[_0x266219['variableName']]['toString']();}else if(_0x266219[_0x8f6b('0x36')]===_0x8f6b('0x39')&&_0x266219['Variable']&&_0x266219['Variable'][_0x8f6b('0x3a')]&&_0x266219[_0x8f6b('0x35')]&&_0x266219[_0x8f6b('0x30')]){_0x38840e[_0x266219[_0x8f6b('0x35')]['toLowerCase']()]=_0x1d9f19[_0x266219[_0x8f6b('0x3b')][_0x8f6b('0x3a')][_0x8f6b('0x31')]()]['toString']();}});}return _0x38840e;}function getTicket(_0x1af9f3,_0xe200dc,_0x379fc6,_0x1dabb4,_0x33211d,_0x20d5fc){return function(_0x3d0df4){logger[_0x8f6b('0x11')]('['+[_0x1af9f3[_0x8f6b('0x14')]()]+_0x8f6b('0x3c'),_0x3d0df4);return new Promise(function(_0x5dfb2d,_0x2a9292){var _0x160655=_0x1af9f3[_0x8f6b('0x31')]()===_0x8f6b('0x3d')?_0x3d0df4[_0x8f6b('0x1f')]:_0x3d0df4[_0x8f6b('0x28')];var _0x319279={'method':_0x8f6b('0x3e'),'uri':_0x379fc6+_0x8f6b('0x3f')+'?'+_0x20d5fc,'body':Object[_0x8f6b('0x40')]({},{'active':'true','caller_id':_0x160655,'assigned_to':_0x3d0df4['userId'],'short_description':intUtil[_0x8f6b('0x41')](_0x1dabb4[_0x8f6b('0x42')],_0x33211d,'\x20'),'description':intUtil[_0x8f6b('0x41')](_0x1dabb4[_0x8f6b('0x43')],_0x33211d,'\x0a')},getCustomFields(_0x1dabb4[_0x8f6b('0x44')],_0x33211d)),'auth':_0xe200dc,'json':!![]};return rp(_0x319279)['then'](function(_0xa5dd5f){logger[_0x8f6b('0x11')]('['+[_0x1af9f3[_0x8f6b('0x14')]()]+_0x8f6b('0x45'),_0xa5dd5f[_0x8f6b('0xd')]);_0x3d0df4[_0x8f6b('0x46')]=_0xa5dd5f[_0x8f6b('0xd')]['sys_id'];_0x3d0df4[_0x8f6b('0x47')]=_0xa5dd5f[_0x8f6b('0xd')]['number'];logger[_0x8f6b('0x11')]('['+[_0x1af9f3['toUpperCase']()]+_0x8f6b('0x48'),_0x3d0df4);_0x5dfb2d(_0x3d0df4);})[_0x8f6b('0x13')](function(_0x41e91b){logger[_0x8f6b('0x22')]('['+[_0x1af9f3['toUpperCase']()]+']',_0x41e91b['message']);_0x2a9292(_0x41e91b[_0x8f6b('0x15')]);});});};}function createRemoteTag(_0x1afd39,_0x1e6d1d,_0x198576,_0x2aa7a3){return new Promise(function(_0x417b63,_0x5a4029){var _0x4c0f29={'method':_0x8f6b('0x3e'),'uri':_0x198576+'label'+'?'+_0x2aa7a3,'body':{'short_description':_0x1afd39,'global':!![],'active':!![],'name':_0x1afd39},'auth':_0x1e6d1d,'json':!![]};return rp(_0x4c0f29)[_0x8f6b('0xc')](function(_0x4008ff){var _0x268a4e=_0x4008ff[_0x8f6b('0xd')][_0x8f6b('0x10')];_0x417b63(_0x268a4e);});});}function getRemoteTag(_0x759eff,_0x1b2bfc,_0x497853,_0x55557f,_0x106808){return new Promise(function(_0xfba426,_0x4ff1f7){var _0x4d2c3e={'method':_0x8f6b('0x19'),'uri':_0x497853+_0x8f6b('0x49')+_0x8f6b('0x4a')+_0x759eff+'&'+_0x55557f,'auth':_0x1b2bfc,'json':!![]};return rp(_0x4d2c3e)['then'](function(_0x3023e8){if(_0x3023e8[_0x8f6b('0xd')][_0x8f6b('0xe')]>0x0){var _0x37c906=_0x3023e8[_0x8f6b('0xd')][0x0][_0x8f6b('0x10')];_0xfba426(_0x37c906);}else{return createRemoteTag(_0x759eff,_0x1b2bfc,_0x497853,_0x55557f)['then'](function(_0x2b2c8b){_0xfba426(_0x2b2c8b);});}});});}function assignTagToIncident(_0x31dc03,_0x90e6a6,_0x235fcb,_0x129a65,_0x590e72){return new Promise(function(_0x494146,_0x57ef35){var _0x31f93c={'method':_0x8f6b('0x3e'),'uri':_0x235fcb+_0x8f6b('0x4b')+'?'+_0x590e72,'body':{'label':_0x31dc03,'table':_0x8f6b('0x3f'),'id_type':_0x8f6b('0x4c'),'table_key':_0x129a65[_0x8f6b('0x46')],'title':_0x8f6b('0x4d')+_0x129a65[_0x8f6b('0x47')],'id_display':_0x129a65[_0x8f6b('0x47')]},'auth':_0x90e6a6,'json':!![]};return rp(_0x31f93c)[_0x8f6b('0xc')](function(_0x133883){_0x494146();})[_0x8f6b('0x13')](function(){_0x494146();});});}function manageTags(_0x3a1c9f,_0x3695b4,_0x389187,_0x5ef4dd,_0x2513fd,_0xa08492,_0x3239d3){return new Promise(function(_0x40a97b,_0xa0595){var _0x53ab64=[];_0x3695b4['forEach'](function(_0x198eef){_0x53ab64['push'](getRemoteTag(_0x198eef,_0x389187,_0x5ef4dd,_0xa08492,_0x3239d3));});return Promise[_0x8f6b('0x4e')](_0x53ab64)['then'](function(_0x7f6224){if(_0x7f6224['length']){logger[_0x8f6b('0x11')]('['+[_0x3a1c9f['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x7f6224);var _0x30abd5=[];_0x7f6224[_0x8f6b('0x2c')](function(_0x1d57a5){_0x30abd5[_0x8f6b('0x4f')](assignTagToIncident(_0x1d57a5,_0x389187,_0x5ef4dd,_0x2513fd,_0xa08492));});return Promise[_0x8f6b('0x4e')](_0x30abd5)['then'](function(){_0x40a97b();})[_0x8f6b('0x13')](function(){_0x40a97b();});}else{_0x40a97b();}});});}function getTags(_0x989a89,_0x2831e7,_0x3f23d9,_0x3023f5,_0x4a43ce,_0x460eca){return function(_0x6f60b5){return new Promise(function(_0x1915f3,_0x1bbb78){var _0x1c6fe4=[];var _0x2ccc57=_0x3023f5[_0x8f6b('0x50')];if(_0x2ccc57&&_0x2ccc57[_0x8f6b('0xe')]>0x0){_0x1c6fe4=_[_0x8f6b('0x51')](_0x2ccc57,'name');}if(_0x1c6fe4[_0x8f6b('0xe')]>0x0){return manageTags(_0x989a89,_0x1c6fe4,_0x2831e7,_0x3f23d9,_0x6f60b5,_0x4a43ce,_0x460eca)[_0x8f6b('0xc')](function(){_0x1915f3(_0x6f60b5);});}else{_0x1915f3(_0x6f60b5);}});};}function emit(_0x2bfc4d,_0x22ea6c,_0x1f0db2){var _0x15f57e=_0x8f6b('0x52')+_0x8f6b('0x53')+_0x8f6b('0x54')+_0x8f6b('0x55');var _0x54b4f6={'uri':_0x2bfc4d+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x1f0db2+_0x15f57e};io['to'](util[_0x8f6b('0x56')](_0x8f6b('0x57'),_0x22ea6c))[_0x8f6b('0x58')](_0x8f6b('0x59'),_0x54b4f6);}exports['cs']=function(_0x151121,_0x323905,_0x1831c9,_0x177d6c,_0x131b9a,_0x5de224,_0x41dca2,_0x139a33){var _0x1a1360={};var _0x27515d={'user':_0x5de224[_0x8f6b('0x5a')],'pass':_0x5de224[_0x8f6b('0x5b')]};var _0x4bf47b=_0x8f6b('0x5c');var _0x4478f0=_0x8f6b('0x5d');_0x5de224[_0x8f6b('0x5e')]=intUtil[_0x8f6b('0x5f')](_0x5de224[_0x8f6b('0x5e')]);_0x5de224[_0x8f6b('0x60')]=intUtil[_0x8f6b('0x5f')](_0x5de224[_0x8f6b('0x60')]);var _0x34e3bc=util['format']('%s/api/now/table/',_0x5de224['remoteUri']);_0x1a1360[_0x8f6b('0x18')]=!_[_0x8f6b('0x61')](_0x177d6c)?_0x177d6c['email']:null;_0x1a1360[_0x8f6b('0x20')]=_0x5de224[_0x8f6b('0x62')];_0x1a1360[_0x8f6b('0x26')]=_0x139a33[_0x8f6b('0x31')]()===_0x8f6b('0x3d')?_0x323905[_0x8f6b('0x63')]:_0x323905[_0x8f6b('0x64')];_0x1a1360[_0x8f6b('0x65')]=_0x139a33===_0x8f6b('0x66')||_0x139a33==='unmanaged'?_0x8f6b('0x66'):_0x8f6b('0x3d');var _0x1acc37=util[_0x8f6b('0x56')](_0x8f6b('0x67'),_0x5de224[_0x8f6b('0x60')],_0x323905[_0x8f6b('0x68')],md5(_0x323905['uniqueid']));if(_0x131b9a&&_0x131b9a[_0x8f6b('0x69')]){logger[_0x8f6b('0x11')]('[QUEUE]',_0x8f6b('0x6a'));_0x323905['recordingURL']=_0x1acc37;}else if(_0x41dca2&&_0x41dca2[_0x8f6b('0x6b')]&&_0x41dca2['recordingFormat']!==_0x8f6b('0x6c')){logger[_0x8f6b('0x11')](_0x8f6b('0x6d'),_0x8f6b('0x6a'));_0x323905[_0x8f6b('0x6e')]=_0x1acc37;}else{_0x323905[_0x8f6b('0x6e')]='';}return getAdminUser(_0x139a33,_0x27515d,_0x1a1360,_0x34e3bc,_0x4478f0,_0x4bf47b)[_0x8f6b('0xc')](getUser(_0x139a33,_0x27515d,_0x34e3bc,_0x4478f0,_0x4bf47b))['then'](getEndUser(_0x139a33,_0x27515d,_0x34e3bc,_0x4478f0,_0x4bf47b))[_0x8f6b('0xc')](getTicket(_0x139a33,_0x27515d,_0x34e3bc,_0x1831c9,_0x323905,_0x4478f0))[_0x8f6b('0xc')](function(_0x587060){logger[_0x8f6b('0x11')](util[_0x8f6b('0x56')]('The\x20ticket\x20ID\x20is:\x20%s',_0x587060['ticketId']));logger['info'](util[_0x8f6b('0x56')](_0x8f6b('0x6f'),_0x139a33));if(_0x139a33!==_0x8f6b('0x70')){logger[_0x8f6b('0x11')]('['+[_0x139a33[_0x8f6b('0x14')]()]+']',_0x8f6b('0x71'));emit(_0x5de224[_0x8f6b('0x5e')],_0x177d6c['name'],_0x587060[_0x8f6b('0x46')]);}})[_0x8f6b('0x13')](function(_0x504391){logger['error']('['+[_0x139a33['toUpperCase']()]+_0x8f6b('0x72'),util[_0x8f6b('0x73')](_0x504391,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x02ac=['],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','idField','content','toString','variableName','customVariable','Variable',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','ticketId','ticketNumber',']\x20getTicket\x20crm','label','label_entry','incident','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','map','name','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','queue','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','then','],\x20getUser\x20entity','sys_id','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','userId','POST','sys_user?','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm'];(function(_0x26260c,_0x3a9df0){var _0x21f487=function(_0x5dd85f){while(--_0x5dd85f){_0x26260c['push'](_0x26260c['shift']());}};_0x21f487(++_0x3a9df0);}(_0x02ac,0x1ed));var _0xc02a=function(_0x3cf8e3,_0x52160f){_0x3cf8e3=_0x3cf8e3-0x0;var _0x384af9=_0x02ac[_0x3cf8e3];return _0x384af9;};'use strict';var _=require(_0xc02a('0x0'));var Promise=require('bluebird');var rp=require(_0xc02a('0x1'));var util=require(_0xc02a('0x2'));var md5=require(_0xc02a('0x3'));var Redis=require(_0xc02a('0x4'));var intUtil=require(_0xc02a('0x5'));var config=require('../../../../config/environment');var logger=require(_0xc02a('0x6'))(_0xc02a('0x7'));config[_0xc02a('0x8')]=_['defaults'](config[_0xc02a('0x8')],{'host':_0xc02a('0x9'),'port':0x18eb});var io=require(_0xc02a('0xa'))(new Redis(config[_0xc02a('0x8')]));function getAdminUser(_0xcff225,_0xa3324d,_0x4ded4f,_0x2c4cb6,_0x2b0ee9,_0x2e6733){return new Promise(function(_0x2bbcf5,_0x16cb5f){var _0x1a2c1d={'method':_0xc02a('0xb'),'uri':_0x2c4cb6+_0xc02a('0xc')+'&'+_0x2b0ee9+'&'+_0x2e6733,'auth':_0xa3324d,'json':!![]};return rp(_0x1a2c1d)['then'](function(_0x3552ad){if(_0x3552ad[_0xc02a('0xd')][_0xc02a('0xe')]>0x0){_0x4ded4f[_0xc02a('0xf')]=_0x3552ad[_0xc02a('0xd')][0x0]['sys_id'];}logger[_0xc02a('0x10')]('['+[_0xcff225[_0xc02a('0x11')]()]+'],\x20getAdminUser\x20crm',_0x4ded4f);_0x2bbcf5(_0x4ded4f);})[_0xc02a('0x12')](function(_0x558c5e){logger[_0xc02a('0x13')]('['+[_0xcff225['toUpperCase']()]+']',_0x558c5e['message']);_0x16cb5f(_0x558c5e[_0xc02a('0x14')]);});});}function getUser(_0x52fc54,_0x3d75d3,_0x2e6aea,_0x28388f,_0x3dba6f){return function(_0x3f9519){logger['info']('['+[_0x52fc54[_0xc02a('0x11')]()]+_0xc02a('0x15'),_0x3f9519);return new Promise(function(_0x16f9df,_0x492c9e){if(intUtil[_0xc02a('0x16')](_0x3f9519[_0xc02a('0x17')])){var _0x92ca03={'method':_0xc02a('0xb'),'uri':_0x2e6aea+'sys_user?sysparm_query=email%3D'+_0x3f9519[_0xc02a('0x17')]+'&'+_0x28388f+'&'+_0x3dba6f,'auth':_0x3d75d3,'json':!![]};logger[_0xc02a('0x10')]('['+[_0x52fc54[_0xc02a('0x11')]()]+'],\x20getUser\x20rp\x20obj',_0x92ca03);return rp(_0x92ca03)[_0xc02a('0x18')](function(_0x1eb943){logger[_0xc02a('0x10')]('['+[_0x52fc54['toUpperCase']()]+_0xc02a('0x19'),_0x1eb943);if(_0x1eb943[_0xc02a('0xd')][_0xc02a('0xe')]>0x0&&String(_0x1eb943[_0xc02a('0xd')][0x0]['active'])==='true'){_0x3f9519['userId']=_0x1eb943[_0xc02a('0xd')][0x0][_0xc02a('0x1a')];}else{_0x3f9519['userId']=_0x3f9519['adminId'];_0x3f9519[_0xc02a('0x17')]=_0x3f9519[_0xc02a('0x1b')];}logger[_0xc02a('0x10')]('['+[_0x52fc54[_0xc02a('0x11')]()]+_0xc02a('0x1c'),_0x3f9519);_0x16f9df(_0x3f9519);})[_0xc02a('0x12')](function(_0x2b1781){logger['error']('['+[_0x52fc54[_0xc02a('0x11')]()]+']',_0x2b1781[_0xc02a('0x14')]);_0x492c9e(_0x2b1781[_0xc02a('0x14')]);});}else{logger[_0xc02a('0x10')]('['+[_0x52fc54['toUpperCase']()]+_0xc02a('0x1d'));_0x3f9519[_0xc02a('0x1e')]=_0x3f9519[_0xc02a('0xf')];_0x3f9519[_0xc02a('0x17')]=_0x3f9519[_0xc02a('0x1b')];_0x16f9df(_0x3f9519);}});};}function createEndUser(_0x24b8bb,_0x398f88,_0x599eaa,_0x3f9e9d,_0x16122d){logger['info']('['+[_0x24b8bb[_0xc02a('0x11')]()]+'],\x20createEndUser\x20input\x20crm',_0x599eaa);return new Promise(function(_0x4b2ac8,_0x7002da){var _0x46948b={'method':_0xc02a('0x1f'),'uri':_0x3f9e9d+_0xc02a('0x20')+_0x16122d,'body':{'user_name':_0x599eaa[_0xc02a('0x21')],'roles':_0xc02a('0x22'),'first_name':_0x599eaa[_0xc02a('0x21')],'active':_0xc02a('0x23'),'date_format':_0xc02a('0x24'),'phone':_0x599eaa[_0xc02a('0x21')]},'auth':_0x398f88,'json':!![]};return rp(_0x46948b)[_0xc02a('0x18')](function(_0x5af655){logger['info']('['+[_0x24b8bb[_0xc02a('0x11')]()]+_0xc02a('0x25'),_0x5af655['result']);_0x599eaa[_0xc02a('0x26')]=_0x5af655[_0xc02a('0xd')]['sys_id'];_0x4b2ac8(_0x599eaa);})[_0xc02a('0x12')](function(_0x164f45){logger[_0xc02a('0x13')]('['+[_0x24b8bb[_0xc02a('0x11')]()]+']',_0x164f45['message']);_0x7002da(_0x164f45[_0xc02a('0x14')]);});});}function getEndUser(_0xb26075,_0x5598b8,_0x2d7277,_0x56170b,_0x5af0cd){return function(_0x49a45b){logger[_0xc02a('0x10')]('['+[_0xb26075[_0xc02a('0x11')]()]+_0xc02a('0x27'),_0x49a45b);return new Promise(function(_0x4056fa,_0x705849){var _0x3135cb={'method':_0xc02a('0xb'),'uri':_0x2d7277+_0xc02a('0x28')+_0x49a45b['endUserNumber']+'&'+_0x56170b+'&'+_0x5af0cd,'auth':_0x5598b8,'json':!![]};return rp(_0x3135cb)['then'](function(_0xaab5ae){if(_0xaab5ae['result'][_0xc02a('0xe')]>0x0){_0x49a45b[_0xc02a('0x26')]=_0xaab5ae[_0xc02a('0xd')][0x0]['sys_id'];logger['info']('['+[_0xb26075[_0xc02a('0x11')]()]+_0xc02a('0x29'),_0x49a45b);_0x4056fa(_0x49a45b);}else{return createEndUser(_0xb26075,_0x5598b8,_0x49a45b,_0x2d7277,_0x56170b)[_0xc02a('0x18')](function(_0x1a4ab3){logger[_0xc02a('0x10')]('['+[_0xb26075['toUpperCase']()]+_0xc02a('0x2a'),_0x1a4ab3);_0x4056fa(_0x1a4ab3);});}})[_0xc02a('0x12')](function(_0x55dcee){logger[_0xc02a('0x13')]('['+[_0xb26075[_0xc02a('0x11')]()]+']',_0x55dcee[_0xc02a('0x14')]);_0x705849(_0x55dcee[_0xc02a('0x14')]);});});};}function getCustomFields(_0x3cdb25,_0x2a3a63){var _0x37ab60={};if(_0x3cdb25[_0xc02a('0xe')]>0x0){_[_0xc02a('0x2b')](_0x3cdb25,function(_0x4f4303){if(_[_0xc02a('0x2c')](['string',_0xc02a('0x2d')],_0x4f4303[_0xc02a('0x2e')])&&_0x4f4303[_0xc02a('0x2f')]&&!_0x4f4303[_0xc02a('0x30')]){_0x37ab60[_0x4f4303[_0xc02a('0x2f')][_0xc02a('0x31')]()]=_0x4f4303['content']['toString']();}else if(_['includes'](['string','picklist'],_0x4f4303[_0xc02a('0x2e')])&&_0x4f4303[_0xc02a('0x32')]&&_0x4f4303[_0xc02a('0x30')]){_0x37ab60[_0x4f4303[_0xc02a('0x32')][_0xc02a('0x31')]()]=_0x4f4303[_0xc02a('0x33')][_0xc02a('0x34')]();}else if(_0x4f4303[_0xc02a('0x2e')]==='variable'&&_0x4f4303[_0xc02a('0x35')]&&_0x4f4303[_0xc02a('0x32')]&&_0x4f4303[_0xc02a('0x30')]){_0x37ab60[_0x4f4303['idField']['toLowerCase']()]=_0x2a3a63[_0x4f4303[_0xc02a('0x35')]][_0xc02a('0x34')]();}else if(_0x4f4303[_0xc02a('0x2e')]===_0xc02a('0x36')&&_0x4f4303['Variable']&&_0x4f4303[_0xc02a('0x37')]['name']&&_0x4f4303[_0xc02a('0x32')]&&_0x4f4303['customField']){_0x37ab60[_0x4f4303['idField'][_0xc02a('0x31')]()]=_0x2a3a63[_0x4f4303[_0xc02a('0x37')]['name']['toLowerCase']()][_0xc02a('0x34')]();}});}return _0x37ab60;}function getTicket(_0x46210f,_0x537d32,_0xd7a0a1,_0xe42327,_0xad1600,_0x26b93b){return function(_0x42b1da){logger[_0xc02a('0x10')]('['+[_0x46210f[_0xc02a('0x11')]()]+_0xc02a('0x38'),_0x42b1da);return new Promise(function(_0x1722ab,_0x4fccd4){var _0x33b639=_0x46210f['toLowerCase']()===_0xc02a('0x39')?_0x42b1da[_0xc02a('0x1e')]:_0x42b1da[_0xc02a('0x26')];var _0x4d4cd1={'method':'POST','uri':_0xd7a0a1+'incident'+'?'+_0x26b93b,'body':Object[_0xc02a('0x3a')]({},{'active':_0xc02a('0x23'),'caller_id':_0x33b639,'assigned_to':_0x42b1da['userId'],'short_description':intUtil[_0xc02a('0x3b')](_0xe42327[_0xc02a('0x3c')],_0xad1600,'\x20'),'description':intUtil['getString'](_0xe42327['Descriptions'],_0xad1600,'\x0a')},getCustomFields(_0xe42327['Fields'],_0xad1600)),'auth':_0x537d32,'json':!![]};return rp(_0x4d4cd1)[_0xc02a('0x18')](function(_0x35bdd2){logger['info']('['+[_0x46210f['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x35bdd2[_0xc02a('0xd')]);_0x42b1da[_0xc02a('0x3d')]=_0x35bdd2[_0xc02a('0xd')]['sys_id'];_0x42b1da[_0xc02a('0x3e')]=_0x35bdd2[_0xc02a('0xd')]['number'];logger[_0xc02a('0x10')]('['+[_0x46210f[_0xc02a('0x11')]()]+_0xc02a('0x3f'),_0x42b1da);_0x1722ab(_0x42b1da);})[_0xc02a('0x12')](function(_0x3c63a2){logger['error']('['+[_0x46210f[_0xc02a('0x11')]()]+']',_0x3c63a2['message']);_0x4fccd4(_0x3c63a2[_0xc02a('0x14')]);});});};}function createRemoteTag(_0x2aec56,_0x3c234c,_0x27e75b,_0x2fdf60){return new Promise(function(_0x48ab01,_0x49669a){var _0x425867={'method':_0xc02a('0x1f'),'uri':_0x27e75b+'label'+'?'+_0x2fdf60,'body':{'short_description':_0x2aec56,'global':!![],'active':!![],'name':_0x2aec56},'auth':_0x3c234c,'json':!![]};return rp(_0x425867)[_0xc02a('0x18')](function(_0x149aad){var _0x222237=_0x149aad[_0xc02a('0xd')][_0xc02a('0x1a')];_0x48ab01(_0x222237);});});}function getRemoteTag(_0x277f55,_0x14b451,_0x5b1722,_0x5139b2,_0x9cba5c){return new Promise(function(_0x150f3e,_0x387bef){var _0x10ec19={'method':_0xc02a('0xb'),'uri':_0x5b1722+_0xc02a('0x40')+'?sysparm_query=name%3D'+_0x277f55+'&'+_0x5139b2,'auth':_0x14b451,'json':!![]};return rp(_0x10ec19)[_0xc02a('0x18')](function(_0x262e9d){if(_0x262e9d[_0xc02a('0xd')]['length']>0x0){var _0x2a1a54=_0x262e9d['result'][0x0]['sys_id'];_0x150f3e(_0x2a1a54);}else{return createRemoteTag(_0x277f55,_0x14b451,_0x5b1722,_0x5139b2)[_0xc02a('0x18')](function(_0x51ac7c){_0x150f3e(_0x51ac7c);});}});});}function assignTagToIncident(_0xfd709,_0x39ac74,_0x73f06d,_0x4f6491,_0x4f4296){return new Promise(function(_0x5e6356,_0x44543c){var _0x512e26={'method':_0xc02a('0x1f'),'uri':_0x73f06d+_0xc02a('0x41')+'?'+_0x4f4296,'body':{'label':_0xfd709,'table':_0xc02a('0x42'),'id_type':'Incident','table_key':_0x4f6491['ticketId'],'title':_0xc02a('0x43')+_0x4f6491[_0xc02a('0x3e')],'id_display':_0x4f6491[_0xc02a('0x3e')]},'auth':_0x39ac74,'json':!![]};return rp(_0x512e26)[_0xc02a('0x18')](function(_0x2bd61f){_0x5e6356();})['catch'](function(){_0x5e6356();});});}function manageTags(_0x34b95,_0x53bec1,_0x278aca,_0x3ed8a3,_0x139016,_0x55ece4,_0x12def1){return new Promise(function(_0x3b5073,_0xf3c86){var _0x23b3f4=[];_0x53bec1[_0xc02a('0x2b')](function(_0x1151bb){_0x23b3f4[_0xc02a('0x44')](getRemoteTag(_0x1151bb,_0x278aca,_0x3ed8a3,_0x55ece4,_0x12def1));});return Promise['all'](_0x23b3f4)[_0xc02a('0x18')](function(_0xefe52c){if(_0xefe52c[_0xc02a('0xe')]){logger['info']('['+[_0x34b95[_0xc02a('0x11')]()]+_0xc02a('0x45'),_0xefe52c);var _0x5a698b=[];_0xefe52c[_0xc02a('0x2b')](function(_0x133d07){_0x5a698b[_0xc02a('0x44')](assignTagToIncident(_0x133d07,_0x278aca,_0x3ed8a3,_0x139016,_0x55ece4));});return Promise[_0xc02a('0x46')](_0x5a698b)[_0xc02a('0x18')](function(){_0x3b5073();})[_0xc02a('0x12')](function(){_0x3b5073();});}else{_0x3b5073();}});});}function getTags(_0x3a70e0,_0x30fe4c,_0x5124cf,_0x47fda8,_0x3c12e0,_0x1644a4){return function(_0xdfbbcf){return new Promise(function(_0x5966aa,_0x3c2135){var _0x199a41=[];var _0x30b55b=_0x47fda8[_0xc02a('0x47')];if(_0x30b55b&&_0x30b55b[_0xc02a('0xe')]>0x0){_0x199a41=_[_0xc02a('0x48')](_0x30b55b,_0xc02a('0x49'));}if(_0x199a41[_0xc02a('0xe')]>0x0){return manageTags(_0x3a70e0,_0x199a41,_0x30fe4c,_0x5124cf,_0xdfbbcf,_0x3c12e0,_0x1644a4)[_0xc02a('0x18')](function(){_0x5966aa(_0xdfbbcf);});}else{_0x5966aa(_0xdfbbcf);}});};}function emit(_0x301fd9,_0x3fdbbe,_0x2bf3dc){var _0x5ec7f3=_0xc02a('0x4a')+_0xc02a('0x4b')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xc02a('0x4c');var _0x1dadc7={'uri':_0x301fd9+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x2bf3dc+_0x5ec7f3};io['to'](util['format'](_0xc02a('0x4d'),_0x3fdbbe))[_0xc02a('0x4e')](_0xc02a('0x4f'),_0x1dadc7);}exports['cs']=function(_0x6d1338,_0x1c3762,_0x1568db,_0x3fa9eb,_0x36f14a,_0x3b0ce5,_0x4a7115,_0x49b529){var _0x4fb35f={};var _0x729074={'user':_0x3b0ce5[_0xc02a('0x50')],'pass':_0x3b0ce5[_0xc02a('0x51')]};var _0x391744=_0xc02a('0x52');var _0x197a00=_0xc02a('0x53');_0x3b0ce5[_0xc02a('0x54')]=intUtil['stripTrailingSlash'](_0x3b0ce5[_0xc02a('0x54')]);_0x3b0ce5[_0xc02a('0x55')]=intUtil['stripTrailingSlash'](_0x3b0ce5[_0xc02a('0x55')]);var _0x558adc=util[_0xc02a('0x56')](_0xc02a('0x57'),_0x3b0ce5[_0xc02a('0x54')]);_0x4fb35f[_0xc02a('0x17')]=!_[_0xc02a('0x58')](_0x3fa9eb)?_0x3fa9eb[_0xc02a('0x59')]:null;_0x4fb35f[_0xc02a('0x1b')]=_0x3b0ce5[_0xc02a('0x59')];_0x4fb35f[_0xc02a('0x21')]=_0x49b529[_0xc02a('0x31')]()==='outbound'?_0x1c3762[_0xc02a('0x5a')]:_0x1c3762[_0xc02a('0x5b')];_0x4fb35f[_0xc02a('0x5c')]=_0x49b529==='queue'||_0x49b529===_0xc02a('0x5d')?_0xc02a('0x5e'):_0xc02a('0x39');var _0x4638df=util[_0xc02a('0x56')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3b0ce5[_0xc02a('0x55')],_0x1c3762[_0xc02a('0x5f')],md5(_0x1c3762[_0xc02a('0x5f')]));if(_0x36f14a&&_0x36f14a[_0xc02a('0x60')]){logger['info']('[QUEUE]',_0xc02a('0x61'));_0x1c3762[_0xc02a('0x62')]=_0x4638df;}else if(_0x4a7115&&_0x4a7115[_0xc02a('0x63')]&&_0x4a7115[_0xc02a('0x63')]!==_0xc02a('0x64')){logger[_0xc02a('0x10')](_0xc02a('0x65'),_0xc02a('0x61'));_0x1c3762[_0xc02a('0x62')]=_0x4638df;}else{_0x1c3762['recordingURL']='';}return getAdminUser(_0x49b529,_0x729074,_0x4fb35f,_0x558adc,_0x197a00,_0x391744)[_0xc02a('0x18')](getUser(_0x49b529,_0x729074,_0x558adc,_0x197a00,_0x391744))[_0xc02a('0x18')](getEndUser(_0x49b529,_0x729074,_0x558adc,_0x197a00,_0x391744))['then'](getTicket(_0x49b529,_0x729074,_0x558adc,_0x1568db,_0x1c3762,_0x197a00))[_0xc02a('0x18')](function(_0x37d6f0){logger[_0xc02a('0x10')](util['format'](_0xc02a('0x66'),_0x37d6f0[_0xc02a('0x3d')]));logger[_0xc02a('0x10')](util[_0xc02a('0x56')](_0xc02a('0x67'),_0x49b529));if(_0x49b529!==_0xc02a('0x5d')){logger[_0xc02a('0x10')]('['+[_0x49b529[_0xc02a('0x11')]()]+']',_0xc02a('0x68'));emit(_0x3b0ce5[_0xc02a('0x54')],_0x3fa9eb[_0xc02a('0x49')],_0x37d6f0[_0xc02a('0x3d')]);}})[_0xc02a('0x12')](function(_0x3f4458){logger[_0xc02a('0x13')]('['+[_0x49b529[_0xc02a('0x11')]()]+_0xc02a('0x69'),util[_0xc02a('0x6a')](_0x3f4458,{'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 c274999..98fbb20 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 _0x874e=['Fields','contacts','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','info','getString','assigned_user_id','created_by','Descriptions','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','name','','first_name','debug','[HTTP]','merge','string','nameField','customField','toLowerCase','content','push','type','variable','custom_fields','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','user:%s','catch','error','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','The\x20Ticket\x20ID\x20is:','users','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[OUTBOUND]','unmanaged','monitor_format','lastevent','toUpperCase'];(function(_0x3325a5,_0x1a57b9){var _0x15c006=function(_0x4ccce9){while(--_0x4ccce9){_0x3325a5['push'](_0x3325a5['shift']());}};_0x15c006(++_0x1a57b9);}(_0x874e,0x75));var _0xe874=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x874e[_0xa8883];return _0x479426;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xe874('0x0'));var md5=require(_0xe874('0x1'));var util=require(_0xe874('0x2'));var Redis=require(_0xe874('0x3'));var intUtil=require(_0xe874('0x4'));var config=require(_0xe874('0x5'));var logger=require(_0xe874('0x6'))('sugarcrm');config[_0xe874('0x7')]=_[_0xe874('0x8')](config[_0xe874('0x7')],{'host':_0xe874('0x9'),'port':0x18eb});var io=require(_0xe874('0xa'))(new Redis(config[_0xe874('0x7')]));var def={'method':_0xe874('0xb'),'json':!![]};function emit(_0x4be725,_0x3cdd41,_0x160fb2){io['to'](_0x4be725)['emit'](_0x3cdd41,_0x160fb2);}function getTicket(_0x4f6b3a,_0x187d1d,_0x519b2c,_0x204b1c,_0x5f5ece,_0x202cb5,_0x35699b,_0x437b08){logger[_0xe874('0xc')]('Creating\x20new\x20ticket...');var _0x1e18b6=new Date();var _0x3f2970=[{'name':'name','value':intUtil[_0xe874('0xd')](_0x204b1c['Subjects'],_0x5f5ece,'\x20')},{'name':_0xe874('0xe'),'value':_0x187d1d['id']},{'name':_0xe874('0xf'),'value':_0x187d1d['id']},{'name':'description','value':intUtil['getString'](_0x204b1c[_0xe874('0x10')],_0x5f5ece,'\x0a')},{'name':'date_start','value':_0x1e18b6['toISOString']()['slice'](0x0,0x13)[_0xe874('0x11')]('T','\x20')},{'name':_0xe874('0x12'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xe874('0x13'),'value':_0x519b2c['id']},{'name':_0xe874('0x14'),'value':_0xe874('0x15')},{'name':_0xe874('0x16'),'value':_0x519b2c['name']},{'name':_0xe874('0x17'),'value':_0x437b08}];if(_0x202cb5[_0xe874('0x18')]){_[_0xe874('0x19')](_0x202cb5,function(_0x219b1e){if(_0x5f5ece[_0x219b1e[_0xe874('0x1a')]]){_0x3f2970['push']({'name':_0x219b1e[_0xe874('0x1b')],'value':_0x5f5ece[_0x219b1e['variableName']]});}});}return request({'form':{'method':_0xe874('0x1c'),'input_type':'JSON','response_type':_0xe874('0x1d'),'rest_data':JSON[_0xe874('0x1e')]({'session':_0x35699b['id'],'module_name':_0xe874('0x1f'),'name_value_list':_0x3f2970})}});}function getAuth(_0x116bea){return util[_0xe874('0x20')]('Basic\x20%s',new Buffer(_0x116bea[_0xe874('0x21')]+':X')[_0xe874('0x22')](_0xe874('0x23')));}function getServerInfo(_0x557b28){return request({'form':{'method':_0xe874('0x24'),'input_type':_0xe874('0x1d'),'response_type':'JSON','rest_data':JSON[_0xe874('0x1e')]({'session':_0x557b28['id']})}});}function getUser(_0x2ca349,_0x518f7c,_0x13c86d){if(!_['isNil'](_0x518f7c)){logger[_0xe874('0xc')](_0xe874('0x25'),_0x518f7c);return request({'form':{'method':_0xe874('0x26'),'input_type':_0xe874('0x1d'),'response_type':_0xe874('0x1d'),'rest_data':JSON['stringify']({'session':_0x13c86d['id'],'module_name':_0xe874('0x27'),'query':util[_0xe874('0x20')](_0xe874('0x28'),_0x518f7c),'order_by':'','offset':'0','select_fields':['id','name',_0xe874('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe874('0x2a')](function(_0x270862){if(_0x270862[_0xe874('0x2b')][_0xe874('0x18')]){var _0xab0888=_[_0xe874('0x2c')](_0x270862[_0xe874('0x2b')],function(_0x3bd4e6){return _0x3bd4e6[_0xe874('0x2d')]['user_name'][_0xe874('0x2e')]===_0x518f7c;});if(_0xab0888){logger[_0xe874('0xc')](_0xe874('0x2f'));return BPromise[_0xe874('0x30')]({'id':_0xab0888[_0xe874('0x2d')]['id'][_0xe874('0x2e')],'name':_0xab0888[_0xe874('0x2d')]['name'][_0xe874('0x2e')]});}}logger[_0xe874('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xe874('0x30')]({'id':_0x13c86d['name_value_list'][_0xe874('0x31')][_0xe874('0x2e')],'name':_0x13c86d['name_value_list'][_0xe874('0x29')][_0xe874('0x2e')]});});}else{logger['info'](_0xe874('0x32'));return BPromise['resolve']({'id':_0x13c86d[_0xe874('0x2d')][_0xe874('0x31')][_0xe874('0x2e')],'name':_0x13c86d['name_value_list'][_0xe874('0x29')][_0xe874('0x2e')]});}}function getEndUser(_0x30ff33,_0x443097,_0xbba5ee,_0x676ad1){logger[_0xe874('0xc')](_0xe874('0x33'),_0xbba5ee);return request({'form':{'method':_0xe874('0x26'),'input_type':_0xe874('0x1d'),'response_type':_0xe874('0x1d'),'rest_data':JSON[_0xe874('0x1e')]({'session':_0x676ad1['id'],'module_name':_0xe874('0x15'),'query':util['format'](_0xe874('0x34'),_0xbba5ee),'order_by':'','offset':'0','select_fields':['id','name',_0xe874('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe874('0x2a')](function(_0x5743b3){if(_0x5743b3[_0xe874('0x2b')][_0xe874('0x18')]){var _0x401633=_[_0xe874('0x2c')](_0x5743b3[_0xe874('0x2b')],function(_0x1e41a0){return _0x1e41a0[_0xe874('0x2d')][_0xe874('0x35')][_0xe874('0x2e')]===_0xbba5ee;});if(_0x401633){logger['info']('Enduser\x20found!');return BPromise[_0xe874('0x30')]({'id':_0x401633[_0xe874('0x2d')]['id']['value'],'name':_0x401633['name_value_list'][_0xe874('0x36')][_0xe874('0x2e')],'phone':_0x401633[_0xe874('0x2d')][_0xe874('0x35')][_0xe874('0x2e')]});}}else{logger[_0xe874('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xe874('0x1c'),'input_type':_0xe874('0x1d'),'response_type':'JSON','rest_data':JSON[_0xe874('0x1e')]({'session':_0x676ad1['id'],'module_name':_0xe874('0x15'),'name_value_list':[{'name':'first_name','value':_0x443097!==_0xe874('0x37')?_0x443097:util[_0xe874('0x20')]('Caller\x20-\x20%s',_0xbba5ee)},{'name':_0xe874('0x35'),'value':_0xbba5ee}]})}})[_0xe874('0x2a')](function(_0x4e94f5){logger[_0xe874('0xc')]('Enduser\x20created.');return BPromise[_0xe874('0x30')]({'id':_0x4e94f5['id'],'name':_0x4e94f5[_0xe874('0x2b')][_0xe874('0x38')][_0xe874('0x2e')],'phone':_0x4e94f5[_0xe874('0x2b')][_0xe874('0x35')][_0xe874('0x2e')]});});}});}function request(_0x271815){logger[_0xe874('0x39')](_0xe874('0x3a'),JSON[_0xe874('0x1e')](_0x271815));return rp(_[_0xe874('0x3b')](def,_0x271815));}function getTags(_0x38b737,_0x15fbe2){var _0x1df84e=[];if(_0x38b737&&_0x38b737[_0xe874('0x18')]>0x0){_0x1df84e=_['map'](_0x38b737,_0x15fbe2);}return _0x1df84e;}function getCustomFields(_0x4e6c03,_0x397307){var _0x106372=[];var _0x653c3b={'custom_fields':[]};if(_0x4e6c03['length']>0x0){_[_0xe874('0x19')](_0x4e6c03,function(_0x30f1c7){if(_0x30f1c7['type']===_0xe874('0x3c')&&_0x30f1c7[_0xe874('0x3d')]&&!_0x30f1c7[_0xe874('0x3e')]){_0x653c3b[_0x30f1c7[_0xe874('0x3d')][_0xe874('0x3f')]()]=_0x30f1c7[_0xe874('0x40')][_0xe874('0x22')]();}else if(_0x30f1c7['type']===_0xe874('0x3c')&&_0x30f1c7[_0xe874('0x1b')]&&_0x30f1c7[_0xe874('0x3e')]){_0x653c3b['custom_fields'][_0xe874('0x41')]({'id':_0x30f1c7[_0xe874('0x1b')],'value':_0x30f1c7[_0xe874('0x40')]['toString']()});}else if(_0x30f1c7[_0xe874('0x42')]===_0xe874('0x43')&&_0x30f1c7['variableName']&&_0x30f1c7['idField']&&_0x30f1c7[_0xe874('0x3e')]){_0x397307[_0x30f1c7['variableName']]&&_0x653c3b[_0xe874('0x44')][_0xe874('0x41')]({'id':_0x30f1c7[_0xe874('0x1b')],'value':_0x397307[_0x30f1c7['variableName']][_0xe874('0x22')]()});}else if(_0x30f1c7['type']===_0xe874('0x45')&&_0x30f1c7[_0xe874('0x46')]&&_0x30f1c7[_0xe874('0x46')]['name']&&_0x30f1c7[_0xe874('0x1b')]&&_0x30f1c7[_0xe874('0x3e')]){_0x397307[_0x30f1c7[_0xe874('0x46')][_0xe874('0x36')]['toLowerCase']()]&&_0x653c3b[_0xe874('0x44')][_0xe874('0x41')]({'id':_0x30f1c7[_0xe874('0x1b')],'value':_0x397307[_0x30f1c7[_0xe874('0x46')][_0xe874('0x36')][_0xe874('0x3f')]()][_0xe874('0x22')]()});}});}return _0x653c3b;}function getConnection(_0xe80a13){return request({'method':_0xe874('0xb'),'form':{'method':_0xe874('0x47'),'input_type':'JSON','response_type':_0xe874('0x1d'),'rest_data':JSON[_0xe874('0x1e')]({'user_auth':{'user_name':_0xe80a13[_0xe874('0x48')],'password':_0xe80a13[_0xe874('0x49')],'encryption':_0xe874('0x4a')},'application':_0xe874('0x4b')})}})[_0xe874('0x2a')](function(_0x28330b){var _0x570153=_0x28330b;if(_0x570153['id']){def[_0xe874('0x4c')]=_0x570153['id'];return BPromise[_0xe874('0x30')](_0x570153);}else{throw new Error(util[_0xe874('0x20')]('Account\x20%d\x20is\x20not\x20valid',_0xe80a13['id']));}});}function setRelationship(_0x1a30d5,_0x47dc43,_0x2f1637,_0x52f4c2){return request({'form':{'method':'set_relationship','input_type':_0xe874('0x1d'),'response_type':_0xe874('0x1d'),'rest_data':JSON['stringify']({'session':_0x1a30d5['id'],'module_name':_0xe874('0x1f'),'module_id':_0x2f1637['id'],'link_field_name':_0x52f4c2,'related_ids':[_0x47dc43['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xe874('0x4d')]=function(_0x4739eb,_0x2f3583,_0x521b92,_0x516203,_0x222021,_0x52c399){var _0x2610a5,_0x4a88e4,_0x4908f6,_0x2a27fb;_0x52c399[_0xe874('0x4e')]=intUtil['stripTrailingSlash'](_0x52c399[_0xe874('0x4e')]);_0x52c399[_0xe874('0x4f')]=intUtil[_0xe874('0x50')](_0x52c399[_0xe874('0x4f')]);def[_0xe874('0x51')]=util[_0xe874('0x20')](_0xe874('0x52'),_0x52c399[_0xe874('0x4e')]);if(_0x222021&&_0x222021['monitor_format']){logger['info']('[QUEUE]',_0xe874('0x53'));_0x2f3583[_0xe874('0x54')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x52c399[_0xe874('0x4f')],_0x2f3583[_0xe874('0x55')],md5(_0x2f3583[_0xe874('0x55')]));}else{_0x2f3583['recordingURL']='';}return getConnection(_0x52c399)['then'](function(_0x2cb666){_0x2a27fb=_0x2cb666;return getUser(_0x52c399,_0x516203[_0xe874('0x36')],_0x2a27fb);})[_0xe874('0x2a')](function(_0x478046){_0x2610a5=_0x478046;logger[_0xe874('0xc')](_0xe874('0x56'),_0x2610a5['id']);return getEndUser(_0x52c399,_0x2f3583[_0xe874('0x57')],_0x2f3583[_0xe874('0x58')],_0x2a27fb);})['then'](function(_0x118a9d){_0x4a88e4=_0x118a9d;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4a88e4['id']);return getTicket(_0x52c399,_0x2610a5,_0x4a88e4,_0x521b92,_0x2f3583,_0x521b92['Fields'],_0x2a27fb,'Inbound');})[_0xe874('0x2a')](function(_0x349641){_0x4908f6=_0x349641;logger[_0xe874('0xc')](_0xe874('0x59'));logger[_0xe874('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4908f6['id']);return setRelationship(_0x2a27fb,_0x2610a5,_0x4908f6,'users');})[_0xe874('0x2a')](function(){return setRelationship(_0x2a27fb,_0x4a88e4,_0x4908f6,'contacts');})['then'](function(){return getServerInfo(_0x2a27fb);})[_0xe874('0x2a')](function(_0x175657){var _0x1411ed=parseInt(_0x175657[_0xe874('0x5a')]['charAt'](0x0));var _0x5bd427=util[_0xe874('0x20')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x52c399[_0xe874('0x4e')],_0x4908f6['id']);if(_0x1411ed>0x6){_0x5bd427=util[_0xe874('0x20')](_0xe874('0x5b'),_0x52c399[_0xe874('0x4e')],_0x4908f6['id']);}logger['info'](_0xe874('0x5c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe874('0x20')](_0xe874('0x5d'),_0x516203['name']),'trigger:browser:url',{'uri':_0x5bd427});})[_0xe874('0x5e')](function(_0x1a2d72){logger[_0xe874('0x5f')](_0xe874('0x5c'),JSON['stringify'](_0x1a2d72));});};exports[_0xe874('0x60')]=function(_0x390c19,_0x3edc15,_0x14be84,_0x3cd27b,_0x2665ee,_0x3a3b88,_0x91e526){var _0x5700de,_0x499db1,_0x5e886a,_0x38ce75;_0x3a3b88[_0xe874('0x4e')]=intUtil['stripTrailingSlash'](_0x3a3b88[_0xe874('0x4e')]);_0x3a3b88[_0xe874('0x4f')]=intUtil['stripTrailingSlash'](_0x3a3b88[_0xe874('0x4f')]);def[_0xe874('0x51')]=util[_0xe874('0x20')]('%s/service/v4_1/rest.php',_0x3a3b88[_0xe874('0x4e')]);if(_0x91e526&&_0x91e526[_0xe874('0x61')]&&_0x91e526['recordingFormat']!==_0xe874('0x62')){logger[_0xe874('0xc')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3edc15[_0xe874('0x54')]=util['format'](_0xe874('0x63'),_0x3a3b88['serverUrl'],_0x3edc15[_0xe874('0x55')],md5(_0x3edc15['uniqueid']));}return getConnection(_0x3a3b88)[_0xe874('0x2a')](function(_0x459237){_0x38ce75=_0x459237;return getUser(_0x3a3b88,_0x3cd27b[_0xe874('0x36')],_0x38ce75);})[_0xe874('0x2a')](function(_0x30a515){_0x5700de=_0x30a515;logger['info'](_0xe874('0x56'),_0x5700de['id']);return getEndUser(_0x3a3b88,_0x3edc15[_0xe874('0x64')],_0x3edc15[_0xe874('0x65')],_0x38ce75);})[_0xe874('0x2a')](function(_0x4c0227){_0x499db1=_0x4c0227;logger[_0xe874('0xc')](_0xe874('0x66'),_0x499db1['id']);return getTicket(_0x3a3b88,_0x5700de,_0x499db1,_0x14be84,_0x3edc15,_0x14be84['Fields'],_0x38ce75,_0xe874('0x67'));})[_0xe874('0x2a')](function(_0x4406fa){_0x5e886a=_0x4406fa;logger[_0xe874('0xc')](_0xe874('0x59'));logger[_0xe874('0xc')](_0xe874('0x68'),_0x5e886a['id']);return setRelationship(_0x38ce75,_0x5700de,_0x5e886a,_0xe874('0x69'));})[_0xe874('0x2a')](function(){return setRelationship(_0x38ce75,_0x499db1,_0x5e886a,'contacts');})[_0xe874('0x2a')](function(){return getServerInfo(_0x38ce75);})[_0xe874('0x2a')](function(_0x21f679){var _0x41a281=parseInt(_0x21f679['version'][_0xe874('0x6a')](0x0));var _0x450c5b=util[_0xe874('0x20')](_0xe874('0x6b'),_0x3a3b88[_0xe874('0x4e')],_0x5e886a['id']);if(_0x41a281>0x6){_0x450c5b=util[_0xe874('0x20')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3a3b88[_0xe874('0x4e')],_0x5e886a['id']);}logger[_0xe874('0xc')](_0xe874('0x6c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe874('0x20')](_0xe874('0x5d'),_0x3cd27b[_0xe874('0x36')]),'trigger:browser:url',{'uri':_0x450c5b});})['catch'](function(_0x597979){logger[_0xe874('0x5f')](_0xe874('0x6c'),JSON[_0xe874('0x1e')](_0x597979));});};exports[_0xe874('0x6d')]=function(_0x42f402,_0x19e138,_0x12a542,_0xf3fe88,_0x2de944,_0x3f4f6d){var _0x38b197,_0x38e24e,_0x289575,_0x584bd3;_0x3f4f6d[_0xe874('0x4e')]=intUtil[_0xe874('0x50')](_0x3f4f6d['remoteUri']);_0x3f4f6d[_0xe874('0x4f')]=intUtil[_0xe874('0x50')](_0x3f4f6d['serverUrl']);def[_0xe874('0x51')]=util[_0xe874('0x20')]('%s/service/v4_1/rest.php',_0x3f4f6d[_0xe874('0x4e')]);if(_0x2de944&&_0x2de944[_0xe874('0x6e')]){logger['info']('['+_0x19e138[_0xe874('0x6f')][_0xe874('0x70')]()+']',_0xe874('0x53'));_0x19e138[_0xe874('0x54')]=util[_0xe874('0x20')](_0xe874('0x63'),_0x3f4f6d['serverUrl'],_0x19e138[_0xe874('0x55')],md5(_0x19e138[_0xe874('0x55')]));}else{_0x19e138[_0xe874('0x54')]='';}return getConnection(_0x3f4f6d)[_0xe874('0x2a')](function(_0x4a2e1b){_0x584bd3=_0x4a2e1b;if(!_['isNil'](_0xf3fe88)){return getUser(_0x3f4f6d,_0xf3fe88[_0xe874('0x36')],_0x584bd3);}else{return getUser(_0x3f4f6d,null,_0x584bd3);}})[_0xe874('0x2a')](function(_0x5073cc){_0x38b197=_0x5073cc;logger[_0xe874('0xc')](_0xe874('0x56'),_0x38b197['id']);return getEndUser(_0x3f4f6d,_0x19e138[_0xe874('0x57')],_0x19e138[_0xe874('0x58')],_0x584bd3);})['then'](function(_0x1d02d6){_0x38e24e=_0x1d02d6;logger['info'](_0xe874('0x66'),_0x38e24e['id']);return getTicket(_0x3f4f6d,_0x38b197,_0x38e24e,_0x12a542,_0x19e138,_0x12a542[_0xe874('0x71')],_0x584bd3,'Inbound');})[_0xe874('0x2a')](function(_0x2828c7){_0x289575=_0x2828c7;logger['info']('Ticket\x20created!');logger[_0xe874('0xc')]('The\x20Ticket\x20ID\x20is:',_0x289575['id']);return setRelationship(_0x584bd3,_0x38b197,_0x289575,_0xe874('0x69'));})['then'](function(){return setRelationship(_0x584bd3,_0x38e24e,_0x289575,_0xe874('0x72'));})[_0xe874('0x2a')](function(){return getServerInfo(_0x584bd3);})[_0xe874('0x5e')](function(_0x5d70ff){logger[_0xe874('0x5f')]('['+_0x19e138[_0xe874('0x6f')]['toUpperCase']()+']',JSON[_0xe874('0x1e')](_0x5d70ff));});}; \ No newline at end of file +var _0x195b=['destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','set_entry','JSON','stringify','Calls','apiKey','toString','get_server_info','isNil','get_entry_list','Employees','user_name','then','entry_list','find','name_value_list','resolve','value','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map','type','nameField','customField','toLowerCase','string','custom_fields','content','idField','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','uri','recordingFormat','none','[OUTBOUND]'];(function(_0x5cc71f,_0x4f6f52){var _0x4e1b52=function(_0x1bea3b){while(--_0x1bea3b){_0x5cc71f['push'](_0x5cc71f['shift']());}};_0x4e1b52(++_0x4f6f52);}(_0x195b,0x81));var _0xb195=function(_0x381675,_0x4b33f5){_0x381675=_0x381675-0x0;var _0x2661d7=_0x195b[_0x381675];return _0x2661d7;};'use strict';var _=require(_0xb195('0x0'));var rp=require(_0xb195('0x1'));var BPromise=require('bluebird');var md5=require(_0xb195('0x2'));var util=require(_0xb195('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xb195('0x4'))(_0xb195('0x5'));config[_0xb195('0x6')]=_[_0xb195('0x7')](config[_0xb195('0x6')],{'host':_0xb195('0x8'),'port':0x18eb});var io=require(_0xb195('0x9'))(new Redis(config[_0xb195('0x6')]));var def={'method':_0xb195('0xa'),'json':!![]};function emit(_0x4a62fb,_0x523feb,_0x350303){io['to'](_0x4a62fb)['emit'](_0x523feb,_0x350303);}function getTicket(_0x3aaca4,_0x4fe33f,_0x3818ba,_0x47230e,_0x21f2f3,_0x50e30a,_0x2de884,_0xaee721){logger[_0xb195('0xb')](_0xb195('0xc'));var _0x3bae0c=new Date();var _0x144bec=[{'name':_0xb195('0xd'),'value':intUtil[_0xb195('0xe')](_0x47230e['Subjects'],_0x21f2f3,'\x20')},{'name':_0xb195('0xf'),'value':_0x4fe33f['id']},{'name':_0xb195('0x10'),'value':_0x4fe33f['id']},{'name':_0xb195('0x11'),'value':intUtil[_0xb195('0xe')](_0x47230e[_0xb195('0x12')],_0x21f2f3,'\x0a')},{'name':_0xb195('0x13'),'value':_0x3bae0c['toISOString']()[_0xb195('0x14')](0x0,0x13)[_0xb195('0x15')]('T','\x20')},{'name':_0xb195('0x16'),'value':'0'},{'name':_0xb195('0x17'),'value':'15'},{'name':_0xb195('0x18'),'value':_0x3818ba['id']},{'name':_0xb195('0x19'),'value':_0xb195('0x1a')},{'name':_0xb195('0x1b'),'value':_0x3818ba['name']},{'name':_0xb195('0x1c'),'value':_0xaee721}];if(_0x50e30a[_0xb195('0x1d')]){_[_0xb195('0x1e')](_0x50e30a,function(_0x53cc37){if(_0x21f2f3[_0x53cc37[_0xb195('0x1f')]]){_0x144bec[_0xb195('0x20')]({'name':_0x53cc37['idField'],'value':_0x21f2f3[_0x53cc37[_0xb195('0x1f')]]});}});}return request({'form':{'method':_0xb195('0x21'),'input_type':_0xb195('0x22'),'response_type':_0xb195('0x22'),'rest_data':JSON[_0xb195('0x23')]({'session':_0x2de884['id'],'module_name':_0xb195('0x24'),'name_value_list':_0x144bec})}});}function getAuth(_0x3c1547){return util['format']('Basic\x20%s',new Buffer(_0x3c1547[_0xb195('0x25')]+':X')[_0xb195('0x26')]('base64'));}function getServerInfo(_0x5b240c){return request({'form':{'method':_0xb195('0x27'),'input_type':_0xb195('0x22'),'response_type':'JSON','rest_data':JSON[_0xb195('0x23')]({'session':_0x5b240c['id']})}});}function getUser(_0xcd4d59,_0x2b4afc,_0x5607f1){if(!_[_0xb195('0x28')](_0x2b4afc)){logger['info']('Getting\x20agent\x20with\x20name',_0x2b4afc);return request({'form':{'method':_0xb195('0x29'),'input_type':_0xb195('0x22'),'response_type':_0xb195('0x22'),'rest_data':JSON['stringify']({'session':_0x5607f1['id'],'module_name':_0xb195('0x2a'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x2b4afc),'order_by':'','offset':'0','select_fields':['id',_0xb195('0xd'),_0xb195('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb195('0x2c')](function(_0x5a6a2e){if(_0x5a6a2e[_0xb195('0x2d')][_0xb195('0x1d')]){var _0x56fb0d=_[_0xb195('0x2e')](_0x5a6a2e['entry_list'],function(_0x561797){return _0x561797[_0xb195('0x2f')][_0xb195('0x2b')]['value']===_0x2b4afc;});if(_0x56fb0d){logger[_0xb195('0xb')]('Agent\x20found!');return BPromise[_0xb195('0x30')]({'id':_0x56fb0d[_0xb195('0x2f')]['id'][_0xb195('0x31')],'name':_0x56fb0d[_0xb195('0x2f')][_0xb195('0xd')][_0xb195('0x31')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xb195('0x30')]({'id':_0x5607f1['name_value_list'][_0xb195('0x32')][_0xb195('0x31')],'name':_0x5607f1[_0xb195('0x2f')][_0xb195('0x2b')]['value']});});}else{logger[_0xb195('0xb')](_0xb195('0x33'));return BPromise[_0xb195('0x30')]({'id':_0x5607f1[_0xb195('0x2f')][_0xb195('0x32')][_0xb195('0x31')],'name':_0x5607f1[_0xb195('0x2f')][_0xb195('0x2b')][_0xb195('0x31')]});}}function getEndUser(_0x16777b,_0x183959,_0x7ff26e,_0x154916){logger[_0xb195('0xb')](_0xb195('0x34'),_0x7ff26e);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xb195('0x23')]({'session':_0x154916['id'],'module_name':_0xb195('0x1a'),'query':util[_0xb195('0x35')](_0xb195('0x36'),_0x7ff26e),'order_by':'','offset':'0','select_fields':['id','name',_0xb195('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb195('0x2c')](function(_0x5c292c){if(_0x5c292c[_0xb195('0x2d')]['length']){var _0x2c6144=_[_0xb195('0x2e')](_0x5c292c['entry_list'],function(_0x303018){return _0x303018[_0xb195('0x2f')]['phone_home'][_0xb195('0x31')]===_0x7ff26e;});if(_0x2c6144){logger[_0xb195('0xb')](_0xb195('0x38'));return BPromise['resolve']({'id':_0x2c6144[_0xb195('0x2f')]['id'][_0xb195('0x31')],'name':_0x2c6144[_0xb195('0x2f')][_0xb195('0xd')]['value'],'phone':_0x2c6144[_0xb195('0x2f')][_0xb195('0x37')][_0xb195('0x31')]});}}else{logger[_0xb195('0xb')](_0xb195('0x39'));return request({'form':{'method':_0xb195('0x21'),'input_type':_0xb195('0x22'),'response_type':_0xb195('0x22'),'rest_data':JSON[_0xb195('0x23')]({'session':_0x154916['id'],'module_name':'Contacts','name_value_list':[{'name':_0xb195('0x3a'),'value':_0x183959!==_0xb195('0x3b')?_0x183959:util[_0xb195('0x35')](_0xb195('0x3c'),_0x7ff26e)},{'name':_0xb195('0x37'),'value':_0x7ff26e}]})}})['then'](function(_0x169776){logger[_0xb195('0xb')](_0xb195('0x3d'));return BPromise[_0xb195('0x30')]({'id':_0x169776['id'],'name':_0x169776[_0xb195('0x2d')][_0xb195('0x3a')][_0xb195('0x31')],'phone':_0x169776['entry_list'][_0xb195('0x37')][_0xb195('0x31')]});});}});}function request(_0x4b520c){logger['debug'](_0xb195('0x3e'),JSON[_0xb195('0x23')](_0x4b520c));return rp(_[_0xb195('0x3f')](def,_0x4b520c));}function getTags(_0x4708c1,_0xc1844e){var _0x1bb685=[];if(_0x4708c1&&_0x4708c1['length']>0x0){_0x1bb685=_[_0xb195('0x40')](_0x4708c1,_0xc1844e);}return _0x1bb685;}function getCustomFields(_0x1dacf4,_0x327273){var _0x581617=[];var _0x22bcc6={'custom_fields':[]};if(_0x1dacf4[_0xb195('0x1d')]>0x0){_[_0xb195('0x1e')](_0x1dacf4,function(_0x474395){if(_0x474395[_0xb195('0x41')]==='string'&&_0x474395[_0xb195('0x42')]&&!_0x474395[_0xb195('0x43')]){_0x22bcc6[_0x474395[_0xb195('0x42')][_0xb195('0x44')]()]=_0x474395['content'][_0xb195('0x26')]();}else if(_0x474395[_0xb195('0x41')]===_0xb195('0x45')&&_0x474395['idField']&&_0x474395['customField']){_0x22bcc6[_0xb195('0x46')][_0xb195('0x20')]({'id':_0x474395['idField'],'value':_0x474395[_0xb195('0x47')][_0xb195('0x26')]()});}else if(_0x474395['type']==='variable'&&_0x474395[_0xb195('0x1f')]&&_0x474395[_0xb195('0x48')]&&_0x474395[_0xb195('0x43')]){_0x327273[_0x474395['variableName']]&&_0x22bcc6[_0xb195('0x46')][_0xb195('0x20')]({'id':_0x474395[_0xb195('0x48')],'value':_0x327273[_0x474395[_0xb195('0x1f')]][_0xb195('0x26')]()});}else if(_0x474395[_0xb195('0x41')]===_0xb195('0x49')&&_0x474395[_0xb195('0x4a')]&&_0x474395['Variable']['name']&&_0x474395['idField']&&_0x474395[_0xb195('0x43')]){_0x327273[_0x474395[_0xb195('0x4a')][_0xb195('0xd')][_0xb195('0x44')]()]&&_0x22bcc6[_0xb195('0x46')][_0xb195('0x20')]({'id':_0x474395[_0xb195('0x48')],'value':_0x327273[_0x474395[_0xb195('0x4a')][_0xb195('0xd')][_0xb195('0x44')]()]['toString']()});}});}return _0x22bcc6;}function getConnection(_0x270d8a){return request({'method':_0xb195('0xa'),'form':{'method':_0xb195('0x4b'),'input_type':_0xb195('0x22'),'response_type':_0xb195('0x22'),'rest_data':JSON[_0xb195('0x23')]({'user_auth':{'user_name':_0x270d8a[_0xb195('0x4c')],'password':_0x270d8a[_0xb195('0x4d')],'encryption':_0xb195('0x4e')},'application':_0xb195('0x4f')})}})[_0xb195('0x2c')](function(_0x5f5cee){var _0xd7b70e=_0x5f5cee;if(_0xd7b70e['id']){def[_0xb195('0x50')]=_0xd7b70e['id'];return BPromise[_0xb195('0x30')](_0xd7b70e);}else{throw new Error(util[_0xb195('0x35')](_0xb195('0x51'),_0x270d8a['id']));}});}function setRelationship(_0x309a3c,_0x2c52f3,_0x2b5e54,_0x24b8b8){return request({'form':{'method':_0xb195('0x52'),'input_type':'JSON','response_type':_0xb195('0x22'),'rest_data':JSON['stringify']({'session':_0x309a3c['id'],'module_name':_0xb195('0x24'),'module_id':_0x2b5e54['id'],'link_field_name':_0x24b8b8,'related_ids':[_0x2c52f3['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xb195('0x53')]=function(_0x238e55,_0x4f1084,_0x1cfd80,_0x5dd5fe,_0x1ee52c,_0x42da6e){var _0x535be7,_0x155dec,_0x56bb6a,_0xf5c4be;_0x42da6e[_0xb195('0x54')]=intUtil[_0xb195('0x55')](_0x42da6e[_0xb195('0x54')]);_0x42da6e['serverUrl']=intUtil['stripTrailingSlash'](_0x42da6e[_0xb195('0x56')]);def['uri']=util[_0xb195('0x35')](_0xb195('0x57'),_0x42da6e[_0xb195('0x54')]);if(_0x1ee52c&&_0x1ee52c['monitor_format']){logger[_0xb195('0xb')](_0xb195('0x58'),_0xb195('0x59'));_0x4f1084[_0xb195('0x5a')]=util[_0xb195('0x35')](_0xb195('0x5b'),_0x42da6e['serverUrl'],_0x4f1084[_0xb195('0x5c')],md5(_0x4f1084[_0xb195('0x5c')]));}else{_0x4f1084[_0xb195('0x5a')]='';}return getConnection(_0x42da6e)['then'](function(_0x4de6b8){_0xf5c4be=_0x4de6b8;return getUser(_0x42da6e,_0x5dd5fe[_0xb195('0xd')],_0xf5c4be);})[_0xb195('0x2c')](function(_0x5216d6){_0x535be7=_0x5216d6;logger['info'](_0xb195('0x5d'),_0x535be7['id']);return getEndUser(_0x42da6e,_0x4f1084[_0xb195('0x5e')],_0x4f1084[_0xb195('0x5f')],_0xf5c4be);})[_0xb195('0x2c')](function(_0x4b8a91){_0x155dec=_0x4b8a91;logger['info']('The\x20Enduser\x20ID\x20is:',_0x155dec['id']);return getTicket(_0x42da6e,_0x535be7,_0x155dec,_0x1cfd80,_0x4f1084,_0x1cfd80[_0xb195('0x60')],_0xf5c4be,_0xb195('0x61'));})['then'](function(_0x2c74ec){_0x56bb6a=_0x2c74ec;logger[_0xb195('0xb')](_0xb195('0x62'));logger[_0xb195('0xb')](_0xb195('0x63'),_0x56bb6a['id']);return setRelationship(_0xf5c4be,_0x535be7,_0x56bb6a,_0xb195('0x64'));})['then'](function(){return setRelationship(_0xf5c4be,_0x155dec,_0x56bb6a,_0xb195('0x65'));})[_0xb195('0x2c')](function(){return getServerInfo(_0xf5c4be);})[_0xb195('0x2c')](function(_0x176b18){var _0x406411=parseInt(_0x176b18[_0xb195('0x66')][_0xb195('0x67')](0x0));var _0x104004=util[_0xb195('0x35')](_0xb195('0x68'),_0x42da6e[_0xb195('0x54')],_0x56bb6a['id']);if(_0x406411>0x6){_0x104004=util[_0xb195('0x35')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x42da6e[_0xb195('0x54')],_0x56bb6a['id']);}logger['info'](_0xb195('0x58'),_0xb195('0x69'));emit(util[_0xb195('0x35')](_0xb195('0x6a'),_0x5dd5fe[_0xb195('0xd')]),_0xb195('0x6b'),{'uri':_0x104004});})[_0xb195('0x6c')](function(_0x3e095d){logger[_0xb195('0x6d')](_0xb195('0x58'),JSON[_0xb195('0x23')](_0x3e095d));});};exports[_0xb195('0x6e')]=function(_0x52755a,_0x1d178b,_0x173280,_0x115edb,_0x589921,_0x480cd7,_0xd6ba16){var _0x2f558f,_0x528cf6,_0x4c24ce,_0x2e633f;_0x480cd7[_0xb195('0x54')]=intUtil[_0xb195('0x55')](_0x480cd7[_0xb195('0x54')]);_0x480cd7[_0xb195('0x56')]=intUtil['stripTrailingSlash'](_0x480cd7[_0xb195('0x56')]);def[_0xb195('0x6f')]=util[_0xb195('0x35')](_0xb195('0x57'),_0x480cd7['remoteUri']);if(_0xd6ba16&&_0xd6ba16[_0xb195('0x70')]&&_0xd6ba16[_0xb195('0x70')]!==_0xb195('0x71')){logger[_0xb195('0xb')](_0xb195('0x72'),_0xb195('0x59'));_0x1d178b[_0xb195('0x5a')]=util[_0xb195('0x35')](_0xb195('0x5b'),_0x480cd7['serverUrl'],_0x1d178b[_0xb195('0x5c')],md5(_0x1d178b[_0xb195('0x5c')]));}return getConnection(_0x480cd7)[_0xb195('0x2c')](function(_0x38eeb4){_0x2e633f=_0x38eeb4;return getUser(_0x480cd7,_0x115edb[_0xb195('0xd')],_0x2e633f);})['then'](function(_0x2e5b64){_0x2f558f=_0x2e5b64;logger[_0xb195('0xb')]('The\x20User\x20ID\x20is:',_0x2f558f['id']);return getEndUser(_0x480cd7,_0x1d178b['destcalleridname'],_0x1d178b[_0xb195('0x73')],_0x2e633f);})[_0xb195('0x2c')](function(_0x50d9a1){_0x528cf6=_0x50d9a1;logger[_0xb195('0xb')](_0xb195('0x74'),_0x528cf6['id']);return getTicket(_0x480cd7,_0x2f558f,_0x528cf6,_0x173280,_0x1d178b,_0x173280[_0xb195('0x60')],_0x2e633f,_0xb195('0x75'));})['then'](function(_0x6caff6){_0x4c24ce=_0x6caff6;logger[_0xb195('0xb')](_0xb195('0x62'));logger[_0xb195('0xb')](_0xb195('0x63'),_0x4c24ce['id']);return setRelationship(_0x2e633f,_0x2f558f,_0x4c24ce,'users');})[_0xb195('0x2c')](function(){return setRelationship(_0x2e633f,_0x528cf6,_0x4c24ce,_0xb195('0x65'));})[_0xb195('0x2c')](function(){return getServerInfo(_0x2e633f);})[_0xb195('0x2c')](function(_0xc806bc){var _0xb2ac41=parseInt(_0xc806bc[_0xb195('0x66')][_0xb195('0x67')](0x0));var _0x25e106=util[_0xb195('0x35')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x480cd7[_0xb195('0x54')],_0x4c24ce['id']);if(_0xb2ac41>0x6){_0x25e106=util[_0xb195('0x35')](_0xb195('0x76'),_0x480cd7['remoteUri'],_0x4c24ce['id']);}logger[_0xb195('0xb')]('[OUTBOUND]',_0xb195('0x69'));emit(util['format'](_0xb195('0x6a'),_0x115edb[_0xb195('0xd')]),_0xb195('0x6b'),{'uri':_0x25e106});})['catch'](function(_0x3c3c98){logger[_0xb195('0x6d')](_0xb195('0x72'),JSON[_0xb195('0x23')](_0x3c3c98));});};exports[_0xb195('0x77')]=function(_0x587667,_0x4ce9c6,_0x31a666,_0xb97fd8,_0x2079f8,_0x940a0b){var _0x292591,_0xf00177,_0x4d502c,_0xabf869;_0x940a0b['remoteUri']=intUtil['stripTrailingSlash'](_0x940a0b[_0xb195('0x54')]);_0x940a0b['serverUrl']=intUtil[_0xb195('0x55')](_0x940a0b['serverUrl']);def[_0xb195('0x6f')]=util[_0xb195('0x35')](_0xb195('0x57'),_0x940a0b[_0xb195('0x54')]);if(_0x2079f8&&_0x2079f8['monitor_format']){logger['info']('['+_0x4ce9c6[_0xb195('0x78')][_0xb195('0x79')]()+']',_0xb195('0x59'));_0x4ce9c6[_0xb195('0x5a')]=util[_0xb195('0x35')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x940a0b[_0xb195('0x56')],_0x4ce9c6[_0xb195('0x5c')],md5(_0x4ce9c6[_0xb195('0x5c')]));}else{_0x4ce9c6[_0xb195('0x5a')]='';}return getConnection(_0x940a0b)[_0xb195('0x2c')](function(_0x36b818){_0xabf869=_0x36b818;if(!_[_0xb195('0x28')](_0xb97fd8)){return getUser(_0x940a0b,_0xb97fd8[_0xb195('0xd')],_0xabf869);}else{return getUser(_0x940a0b,null,_0xabf869);}})[_0xb195('0x2c')](function(_0x40db68){_0x292591=_0x40db68;logger[_0xb195('0xb')](_0xb195('0x5d'),_0x292591['id']);return getEndUser(_0x940a0b,_0x4ce9c6[_0xb195('0x5e')],_0x4ce9c6[_0xb195('0x5f')],_0xabf869);})[_0xb195('0x2c')](function(_0x307d25){_0xf00177=_0x307d25;logger['info'](_0xb195('0x74'),_0xf00177['id']);return getTicket(_0x940a0b,_0x292591,_0xf00177,_0x31a666,_0x4ce9c6,_0x31a666[_0xb195('0x60')],_0xabf869,_0xb195('0x61'));})['then'](function(_0x3fd76c){_0x4d502c=_0x3fd76c;logger[_0xb195('0xb')](_0xb195('0x62'));logger[_0xb195('0xb')](_0xb195('0x63'),_0x4d502c['id']);return setRelationship(_0xabf869,_0x292591,_0x4d502c,_0xb195('0x64'));})[_0xb195('0x2c')](function(){return setRelationship(_0xabf869,_0xf00177,_0x4d502c,_0xb195('0x65'));})[_0xb195('0x2c')](function(){return getServerInfo(_0xabf869);})['catch'](function(_0x4082d4){logger['error']('['+_0x4ce9c6['lastevent'][_0xb195('0x79')]()+']',JSON[_0xb195('0x23')](_0x4082d4));});}; \ 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 7adcaf6..af202c2 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 _0xe58a=['keyType','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','test','lodash','util','getString','sortBy','type','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','string','key','format','%s:\x20%s','keyContent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe58a,0x133));var _0xae58=function(_0x1b3d2f,_0x3ed224){_0x1b3d2f=_0x1b3d2f-0x0;var _0x11db0b=_0xe58a[_0x1b3d2f];return _0x11db0b;};'use strict';var _=require(_0xae58('0x0'));var util=require(_0xae58('0x1'));exports[_0xae58('0x2')]=function(_0x3ee3e5,_0x4f51cc,_0x118ff7){var _0x23b28a=[];if(_0x3ee3e5['length']>0x0){var _0x1f7e82=_[_0xae58('0x3')](_0x3ee3e5,['id']);for(var _0xc714b2=0x0;_0xc714b2<_0x1f7e82['length'];_0xc714b2++){var _0x259b8c=_0x1f7e82[_0xc714b2];if(_0x259b8c[_0xae58('0x4')]==='string'){_0x23b28a[_0xae58('0x5')](_0x259b8c[_0xae58('0x6')]);}else if(_0x259b8c['type']===_0xae58('0x7')&&_0x259b8c[_0xae58('0x8')]){_0x4f51cc[_0x259b8c[_0xae58('0x8')]]&&_0x23b28a[_0xae58('0x5')](_0x4f51cc[_0x259b8c[_0xae58('0x8')]]['toString']());}else if(_0x259b8c[_0xae58('0x4')]===_0xae58('0x9')&&_0x259b8c['Variable']&&_0x259b8c[_0xae58('0xa')]['name']){_0x4f51cc[_0x259b8c[_0xae58('0xa')][_0xae58('0xb')][_0xae58('0xc')]()]&&_0x23b28a[_0xae58('0x5')](_0x4f51cc[_0x259b8c[_0xae58('0xa')][_0xae58('0xb')]['toLowerCase']()]['toString']());}else if(_0x259b8c[_0xae58('0x4')]==='keyValue'){if(_0x259b8c['keyType']===_0xae58('0xd')&&_0x259b8c[_0xae58('0xe')]){_0x23b28a[_0xae58('0x5')](util[_0xae58('0xf')](_0xae58('0x10'),_0x259b8c['key'],_0x259b8c[_0xae58('0x11')]));}else if(_0x259b8c[_0xae58('0x12')]===_0xae58('0x7')&&_0x259b8c[_0xae58('0x8')]&&_0x259b8c[_0xae58('0xe')]){_0x4f51cc[_0x259b8c[_0xae58('0x8')]]&&_0x23b28a['push'](util[_0xae58('0xf')](_0xae58('0x10'),_0x259b8c['key'],_0x4f51cc[_0x259b8c[_0xae58('0x8')]]));}else if(_0x259b8c[_0xae58('0x12')]===_0xae58('0x9')&&_0x259b8c['Variable']&&_0x259b8c['Variable'][_0xae58('0xb')]&&_0x259b8c[_0xae58('0xe')]){_0x4f51cc[_0x259b8c['Variable'][_0xae58('0xb')][_0xae58('0xc')]()]&&_0x23b28a[_0xae58('0x5')](util['format'](_0xae58('0x10'),_0x259b8c[_0xae58('0xe')],_0x4f51cc[_0x259b8c[_0xae58('0xa')][_0xae58('0xb')]['toLowerCase']()]));}}}}return _0x23b28a[_0xae58('0x13')](_0x118ff7);};exports[_0xae58('0x14')]=function(_0x29c81a){var _0x285124=_0x29c81a[_0xae58('0x15')](-0x1);if(_0x285124==='/'){_0x29c81a=_0x29c81a['substring'](0x0,_0x29c81a[_0xae58('0x16')](_0x285124));}return _0x29c81a;};exports[_0xae58('0x17')]=function(_0x34eadc){if(!_['isNil'](_0x34eadc)&&_0x34eadc!==''){var _0x3583a9=/^(([^<>()\[\]\\.,;:\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 _0x3583a9[_0xae58('0x18')](String(_0x34eadc)[_0xae58('0xc')]());}else{return![];}}; \ No newline at end of file +var _0xc3dd=['isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','join','stripTrailingSlash','slice','lastIndexOf','validateEmail'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xc3dd,0x11a));var _0xdc3d=function(_0x25efdf,_0x521462){_0x25efdf=_0x25efdf-0x0;var _0x22c495=_0xc3dd[_0x25efdf];return _0x22c495;};'use strict';var _=require(_0xdc3d('0x0'));var util=require(_0xdc3d('0x1'));exports[_0xdc3d('0x2')]=function(_0x1c9ad9,_0x132e0c,_0x3bf0b4){var _0x61cb6e=[];if(_0x1c9ad9[_0xdc3d('0x3')]>0x0){var _0x4a1e12=_[_0xdc3d('0x4')](_0x1c9ad9,['id']);for(var _0x383d99=0x0;_0x383d99<_0x4a1e12[_0xdc3d('0x3')];_0x383d99++){var _0x5b5403=_0x4a1e12[_0x383d99];if(_0x5b5403[_0xdc3d('0x5')]===_0xdc3d('0x6')){_0x61cb6e[_0xdc3d('0x7')](_0x5b5403[_0xdc3d('0x8')]);}else if(_0x5b5403[_0xdc3d('0x5')]===_0xdc3d('0x9')&&_0x5b5403[_0xdc3d('0xa')]){_0x132e0c[_0x5b5403[_0xdc3d('0xa')]]&&_0x61cb6e[_0xdc3d('0x7')](_0x132e0c[_0x5b5403[_0xdc3d('0xa')]][_0xdc3d('0xb')]());}else if(_0x5b5403[_0xdc3d('0x5')]===_0xdc3d('0xc')&&_0x5b5403[_0xdc3d('0xd')]&&_0x5b5403['Variable'][_0xdc3d('0xe')]){_0x132e0c[_0x5b5403[_0xdc3d('0xd')]['name'][_0xdc3d('0xf')]()]&&_0x61cb6e[_0xdc3d('0x7')](_0x132e0c[_0x5b5403[_0xdc3d('0xd')][_0xdc3d('0xe')][_0xdc3d('0xf')]()]['toString']());}else if(_0x5b5403[_0xdc3d('0x5')]===_0xdc3d('0x10')){if(_0x5b5403[_0xdc3d('0x11')]===_0xdc3d('0x6')&&_0x5b5403[_0xdc3d('0x12')]){_0x61cb6e[_0xdc3d('0x7')](util['format']('%s:\x20%s',_0x5b5403[_0xdc3d('0x12')],_0x5b5403['keyContent']));}else if(_0x5b5403[_0xdc3d('0x11')]===_0xdc3d('0x9')&&_0x5b5403[_0xdc3d('0xa')]&&_0x5b5403['key']){_0x132e0c[_0x5b5403['variableName']]&&_0x61cb6e['push'](util[_0xdc3d('0x13')](_0xdc3d('0x14'),_0x5b5403[_0xdc3d('0x12')],_0x132e0c[_0x5b5403['variableName']]));}else if(_0x5b5403[_0xdc3d('0x11')]===_0xdc3d('0xc')&&_0x5b5403[_0xdc3d('0xd')]&&_0x5b5403[_0xdc3d('0xd')][_0xdc3d('0xe')]&&_0x5b5403[_0xdc3d('0x12')]){_0x132e0c[_0x5b5403[_0xdc3d('0xd')]['name']['toLowerCase']()]&&_0x61cb6e[_0xdc3d('0x7')](util[_0xdc3d('0x13')]('%s:\x20%s',_0x5b5403['key'],_0x132e0c[_0x5b5403[_0xdc3d('0xd')][_0xdc3d('0xe')][_0xdc3d('0xf')]()]));}}}}return _0x61cb6e[_0xdc3d('0x15')](_0x3bf0b4);};exports[_0xdc3d('0x16')]=function(_0x3eea58){var _0x2769a2=_0x3eea58[_0xdc3d('0x17')](-0x1);if(_0x2769a2==='/'){_0x3eea58=_0x3eea58['substring'](0x0,_0x3eea58[_0xdc3d('0x18')](_0x2769a2));}return _0x3eea58;};exports[_0xdc3d('0x19')]=function(_0x15f2a9){if(!_[_0xdc3d('0x1a')](_0x15f2a9)&&_0x15f2a9!==''){var _0x177b47=/^(([^<>()\[\]\\.,;:\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 _0x177b47[_0xdc3d('0x1b')](String(_0x15f2a9)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index ac5e497..c3b05e3 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x14fa6c,_0x4d0dc5){var _0x286e55=function(_0x4e03d0){while(--_0x4e03d0){_0x14fa6c['push'](_0x14fa6c['shift']());}};_0x286e55(++_0x4d0dc5);}(_0xe706,0xa3));var _0x6e70=function(_0x243e12,_0x2d7bc5){_0x243e12=_0x243e12-0x0;var _0x3fddfc=_0xe706[_0x243e12];return _0x3fddfc;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index da6d6a8..dcad491 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 _0x8af8=['../../../../config/logger','zendesk','localhost','socket.io-emitter','redis','emit','application/json','info','format','%s/tickets.json','remoteUri','merge','name','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','password','token','%s/token:%s','toString','base64','debug','[HTTP]','stringify','defaults','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','idField','custom_fields','push','content','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','../../../../config/environment'];(function(_0x3fd445,_0x4281db){var _0x5db205=function(_0x4d294b){while(--_0x4d294b){_0x3fd445['push'](_0x3fd445['shift']());}};_0x5db205(++_0x4281db);}(_0x8af8,0x153));var _0x88af=function(_0x43455d,_0x29444a){_0x43455d=_0x43455d-0x0;var _0x127d79=_0x8af8[_0x43455d];return _0x127d79;};'use strict';var _=require(_0x88af('0x0'));var rp=require('request-promise');var md5=require(_0x88af('0x1'));var util=require(_0x88af('0x2'));var Redis=require(_0x88af('0x3'));var intUtil=require(_0x88af('0x4'));var config=require(_0x88af('0x5'));var logger=require(_0x88af('0x6'))(_0x88af('0x7'));config['redis']=_['defaults'](config['redis'],{'host':_0x88af('0x8'),'port':0x18eb});var io=require(_0x88af('0x9'))(new Redis(config[_0x88af('0xa')]));function emit(_0x15ad85,_0x427927,_0x2d141b){io['to'](_0x15ad85)[_0x88af('0xb')](_0x427927,_0x2d141b);}var headers={'Content-Type':_0x88af('0xc'),'Accept':_0x88af('0xc')};function getTicket(_0x496989,_0x521e37,_0x4096f1,_0x166935,_0x575516){logger[_0x88af('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x88af('0xe')](_0x88af('0xf'),_0x496989[_0x88af('0x10')]),'method':'POST','body':{'ticket':_[_0x88af('0x11')]({'requester_id':_0x4096f1['id'],'submitter_id':_0x521e37?_0x521e37['id']:undefined,'assignee_id':_0x521e37?_0x521e37['id']:undefined,'tags':getTags(_0x166935['Tags'],_0x88af('0x12')),'subject':intUtil['getString'](_0x166935['Subjects'],_0x575516,'\x20'),'description':intUtil[_0x88af('0x13')](_0x166935[_0x88af('0x14')],_0x575516,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x166935[_0x88af('0x14')],_0x575516,'\x0a')}},getCustomFields(_0x166935[_0x88af('0x15')],_0x575516))}})[_0x88af('0x16')](function(_0x232e9f){logger[_0x88af('0xd')](_0x88af('0x17'));return _0x232e9f[_0x88af('0x18')];});}function getUser(_0x5f0b31,_0x1e9e7d){if(intUtil[_0x88af('0x19')](_0x1e9e7d)){logger[_0x88af('0xd')](_0x88af('0x1a'),_0x1e9e7d);return request({'uri':util[_0x88af('0xe')](_0x88af('0x1b'),_0x5f0b31[_0x88af('0x10')]),'qs':{'query':util[_0x88af('0xe')]('type:user\x20role:agent\x20email:%s',_0x1e9e7d)}})['then'](function(_0x10fb65){if(_0x10fb65['count']){logger[_0x88af('0xd')](_0x88af('0x1c'));return _[_0x88af('0x1d')](_0x10fb65['results'],{'email':_0x1e9e7d,'role':'agent'});}else{logger['info'](_0x88af('0x1e'));return request({'uri':util[_0x88af('0xe')]('%s/users/me.json',_0x5f0b31['remoteUri'])})['then'](function(_0x509c68){logger['info'](_0x88af('0x1f'));return _0x509c68[_0x88af('0x20')];});}});}else{logger[_0x88af('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x88af('0xe')](_0x88af('0x21'),_0x5f0b31['remoteUri'])})[_0x88af('0x16')](function(_0xb81a93){logger[_0x88af('0xd')]('Admin\x20account\x20selected.');return _0xb81a93[_0x88af('0x20')];});}}function getEndUser(_0x371e96,_0x2d10ae,_0x374d65){logger[_0x88af('0xd')](_0x88af('0x22'),_0x374d65);return request({'uri':util[_0x88af('0xe')](_0x88af('0x1b'),_0x371e96[_0x88af('0x10')]),'qs':{'query':util[_0x88af('0xe')](_0x88af('0x23'),_0x374d65)}})[_0x88af('0x16')](function(_0x4015e3){var _0x436e3e;if(_0x4015e3[_0x88af('0x24')][_0x88af('0x25')]){_0x4015e3['results']=_[_0x88af('0x26')](_0x4015e3[_0x88af('0x24')],{'suspended':![],'role':_0x88af('0x27')});if(_0x4015e3['results'][_0x88af('0x25')]){_0x436e3e=_[_0x88af('0x28')](_0x4015e3[_0x88af('0x24')]);}}if(_0x436e3e){logger[_0x88af('0xd')](_0x88af('0x29'));return _0x436e3e;}else{logger[_0x88af('0xd')](_0x88af('0x2a'));return request({'uri':util['format'](_0x88af('0x2b'),_0x371e96[_0x88af('0x10')]),'method':_0x88af('0x2c'),'body':{'user':{'role':_0x88af('0x27'),'name':util[_0x88af('0xe')](_0x88af('0x2d'),_0x2d10ae||_0x374d65),'phone':_0x374d65}}})[_0x88af('0x16')](function(_0x4469c9){logger['info'](_0x88af('0x2e'));return _0x4469c9[_0x88af('0x20')];});}});}function getAuth(_0x4e35dc){var _0x41da07;if(_0x4e35dc[_0x88af('0x2f')]==='password'){_0x41da07=util[_0x88af('0xe')](_0x88af('0x30'),_0x4e35dc[_0x88af('0x31')],_0x4e35dc[_0x88af('0x32')]);}else if(_0x4e35dc[_0x88af('0x2f')]===_0x88af('0x33')){_0x41da07=util[_0x88af('0xe')](_0x88af('0x34'),_0x4e35dc[_0x88af('0x31')],_0x4e35dc[_0x88af('0x33')]);}return util[_0x88af('0xe')]('Basic\x20%s',new Buffer(_0x41da07)[_0x88af('0x35')](_0x88af('0x36')));}function request(_0x3e2eac){logger[_0x88af('0x37')](_0x88af('0x38'),JSON[_0x88af('0x39')](_0x3e2eac));return rp(_[_0x88af('0x3a')](_0x3e2eac,{'method':_0x88af('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0xa9cde,_0x348aa4){var _0x478e06=[];if(_0xa9cde&&_0xa9cde[_0x88af('0x25')]>0x0){_0x478e06=_['map'](_0xa9cde,_0x348aa4);}return _0x478e06;}function getCustomFields(_0x3f40d9,_0xd6dcf9){var _0x1f084d=[];var _0x17afe7={'custom_fields':[]};if(_0x3f40d9['length']>0x0){_[_0x88af('0x3c')](_0x3f40d9,function(_0x4e9b14){if(_[_0x88af('0x3d')]([_0x88af('0x3e'),_0x88af('0x3f')],_0x4e9b14[_0x88af('0x40')])&&_0x4e9b14[_0x88af('0x41')]&&!_0x4e9b14[_0x88af('0x42')]){_0x17afe7[_0x4e9b14[_0x88af('0x41')][_0x88af('0x43')]()]=_0x4e9b14['content'][_0x88af('0x35')]();}else if(_[_0x88af('0x3d')]([_0x88af('0x3e'),_0x88af('0x3f')],_0x4e9b14[_0x88af('0x40')])&&_0x4e9b14[_0x88af('0x44')]&&_0x4e9b14[_0x88af('0x42')]){_0x17afe7[_0x88af('0x45')][_0x88af('0x46')]({'id':_0x4e9b14[_0x88af('0x44')],'value':_0x4e9b14[_0x88af('0x47')][_0x88af('0x35')]()});}else if(_0x4e9b14[_0x88af('0x40')]===_0x88af('0x48')&&_0x4e9b14[_0x88af('0x49')]&&_0x4e9b14[_0x88af('0x44')]&&_0x4e9b14[_0x88af('0x42')]){_0xd6dcf9[_0x4e9b14[_0x88af('0x49')]]&&_0x17afe7['custom_fields'][_0x88af('0x46')]({'id':_0x4e9b14[_0x88af('0x44')],'value':_0xd6dcf9[_0x4e9b14[_0x88af('0x49')]][_0x88af('0x35')]()});}else if(_0x4e9b14[_0x88af('0x40')]===_0x88af('0x4a')&&_0x4e9b14[_0x88af('0x4b')]&&_0x4e9b14['Variable'][_0x88af('0x12')]&&_0x4e9b14['idField']&&_0x4e9b14[_0x88af('0x42')]){_0xd6dcf9[_0x4e9b14[_0x88af('0x4b')][_0x88af('0x12')][_0x88af('0x43')]()]&&_0x17afe7['custom_fields'][_0x88af('0x46')]({'id':_0x4e9b14[_0x88af('0x44')],'value':_0xd6dcf9[_0x4e9b14['Variable'][_0x88af('0x12')][_0x88af('0x43')]()]['toString']()});}});}return _0x17afe7;}exports[_0x88af('0x4c')]=function(_0x300277,_0x57b70f,_0x5ea80d,_0x21508a,_0x3ebd5f,_0x24d6c1){var _0x36af6d,_0x5178dd;_0x24d6c1['remoteUri']=intUtil['stripTrailingSlash'](_0x24d6c1[_0x88af('0x10')]);_0x24d6c1[_0x88af('0x4d')]=intUtil[_0x88af('0x4e')](_0x24d6c1[_0x88af('0x4d')]);if(_0x3ebd5f&&_0x3ebd5f['monitor_format']){logger[_0x88af('0xd')](_0x88af('0x4f'),_0x88af('0x50'));_0x57b70f[_0x88af('0x51')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x24d6c1['serverUrl'],_0x57b70f[_0x88af('0x52')],md5(_0x57b70f[_0x88af('0x52')]));}else{_0x57b70f[_0x88af('0x51')]='';}headers['Authorization']=getAuth(_0x24d6c1);return getUser(_0x24d6c1,_0x21508a[_0x88af('0x53')])[_0x88af('0x16')](function(_0x5f42bf){_0x36af6d=_0x5f42bf;logger[_0x88af('0xd')](_0x88af('0x54'),_0x36af6d['id']);return getEndUser(_0x24d6c1,_0x57b70f[_0x88af('0x55')],_0x57b70f[_0x88af('0x56')]);})[_0x88af('0x16')](function(_0x2c3913){_0x5178dd=_0x2c3913;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5178dd['id']);return getTicket(_0x24d6c1,_0x36af6d,_0x5178dd,_0x5ea80d,_0x57b70f);})['then'](function(_0xa1d5e2){if(_0xa1d5e2){logger['info'](_0x88af('0x57'),_0xa1d5e2['id']);switch(_0x24d6c1[_0x88af('0x40')]){case'integrationTab':logger[_0x88af('0xd')](_0x88af('0x4f'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x88af('0xe')](_0x88af('0x58'),_0x24d6c1[_0x88af('0x10')],_0x36af6d['id'],_0xa1d5e2['id']),'method':_0x88af('0x2c')});case _0x88af('0x59'):logger['info'](_0x88af('0x4f'),_0x88af('0x5a'));emit(util['format']('user:%s',_0x21508a[_0x88af('0x12')]),_0x88af('0x5b'),{'uri':util[_0x88af('0xe')](_0x88af('0x5c'),_0x24d6c1[_0x88af('0x10')][_0x88af('0x5d')]('/api/v2',''),_0xa1d5e2['id'])});break;default:logger[_0x88af('0x5e')](_0x88af('0x4f'),_0x88af('0x5f'));}}})['catch'](function(_0x21543b){logger['error'](_0x88af('0x60'),util[_0x88af('0x61')](_0x21543b,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x48a349,_0x1896a2,_0x2f733a,_0x430061,_0x1036d9,_0x5d6d60,_0x323ed3){var _0x32572e,_0x32d1fd;_0x5d6d60[_0x88af('0x10')]=intUtil[_0x88af('0x4e')](_0x5d6d60[_0x88af('0x10')]);_0x5d6d60[_0x88af('0x4d')]=intUtil['stripTrailingSlash'](_0x5d6d60[_0x88af('0x4d')]);if(_0x323ed3&&_0x323ed3[_0x88af('0x62')]&&_0x323ed3[_0x88af('0x62')]!==_0x88af('0x63')){logger[_0x88af('0xd')](_0x88af('0x64'),_0x88af('0x50'));_0x1896a2[_0x88af('0x51')]=util[_0x88af('0xe')](_0x88af('0x65'),_0x5d6d60[_0x88af('0x4d')],_0x1896a2[_0x88af('0x52')],md5(_0x1896a2[_0x88af('0x52')]));}headers['Authorization']=getAuth(_0x5d6d60);return getUser(_0x5d6d60,_0x430061[_0x88af('0x53')])[_0x88af('0x16')](function(_0xc694d5){_0x32572e=_0xc694d5;logger[_0x88af('0xd')](_0x88af('0x54'),_0x32572e['id']);return getEndUser(_0x5d6d60,_0x1896a2[_0x88af('0x66')],_0x1896a2[_0x88af('0x67')]);})[_0x88af('0x16')](function(_0x5d035b){_0x32d1fd=_0x5d035b;logger[_0x88af('0xd')](_0x88af('0x68'),_0x32d1fd['id']);return getTicket(_0x5d6d60,_0x32572e,_0x32d1fd,_0x2f733a,_0x1896a2);})[_0x88af('0x16')](function(_0xe9a50e){if(_0xe9a50e){logger[_0x88af('0xd')](_0x88af('0x57'),_0xe9a50e['id']);switch(_0x5d6d60['type']){case _0x88af('0x69'):logger[_0x88af('0xd')](_0x88af('0x64'),_0x88af('0x6a'));return request({'uri':util[_0x88af('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x5d6d60['remoteUri'],_0x32572e['id'],_0xe9a50e['id']),'method':'POST'});case _0x88af('0x59'):logger[_0x88af('0xd')](_0x88af('0x64'),_0x88af('0x5a'));emit(util[_0x88af('0xe')](_0x88af('0x6b'),_0x430061[_0x88af('0x12')]),_0x88af('0x5b'),{'uri':util[_0x88af('0xe')]('%s/agent/tickets/%s',_0x5d6d60[_0x88af('0x10')][_0x88af('0x5d')](_0x88af('0x6c'),''),_0xe9a50e['id'])});break;default:logger[_0x88af('0x5e')](_0x88af('0x64'),_0x88af('0x5f'));}}})['catch'](function(_0x299b92){logger['error'](_0x88af('0x6d'),util[_0x88af('0x61')](_0x299b92,{'showHidden':!![],'depth':null}));});};exports[_0x88af('0x6e')]=function(_0x5a4183,_0x19b9a3,_0x5f154a,_0xb921d5,_0x419e09,_0x30207f){var _0x521d4d,_0x1e8b7d;_0x30207f[_0x88af('0x10')]=intUtil[_0x88af('0x4e')](_0x30207f['remoteUri']);_0x30207f[_0x88af('0x4d')]=intUtil[_0x88af('0x4e')](_0x30207f['serverUrl']);if(_0x419e09&&_0x419e09[_0x88af('0x6f')]){logger[_0x88af('0xd')]('['+_0x19b9a3[_0x88af('0x70')][_0x88af('0x71')]()+']',_0x88af('0x50'));_0x19b9a3[_0x88af('0x51')]=util[_0x88af('0xe')](_0x88af('0x65'),_0x30207f[_0x88af('0x4d')],_0x19b9a3[_0x88af('0x52')],md5(_0x19b9a3[_0x88af('0x52')]));}else{_0x19b9a3[_0x88af('0x51')]='';}headers['Authorization']=getAuth(_0x30207f);return getUser(_0x30207f)[_0x88af('0x16')](function(_0x584ae){_0x521d4d=_0x584ae;logger[_0x88af('0xd')]('The\x20User\x20ID\x20is:',_0x521d4d['id']);return getEndUser(_0x30207f,_0x19b9a3[_0x88af('0x55')],_0x19b9a3[_0x88af('0x56')]);})[_0x88af('0x16')](function(_0x31f43e){_0x1e8b7d=_0x31f43e;logger['info'](_0x88af('0x68'),_0x1e8b7d['id']);return getTicket(_0x30207f,_0x521d4d,_0x1e8b7d,_0x5f154a,_0x19b9a3);})['then'](function(_0x258215){if(_0x258215){logger['info'](_0x88af('0x57'),_0x258215['id']);}})['catch'](function(_0x28553c){logger[_0x88af('0x5e')]('['+_0x19b9a3[_0x88af('0x70')][_0x88af('0x71')]()+']'+_0x88af('0x72'),util['inspect'](_0x28553c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x951e=['localhost','socket.io-emitter','emit','application/json','format','%s/tickets.json','remoteUri','merge','name','getString','Subjects','Descriptions','info','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20found!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','map','forEach','nameField','customField','toLowerCase','includes','string','picklist','type','idField','custom_fields','content','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','trigger:browser:url','%s/agent/tickets/%s','catch','error','inspect','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','replace','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','calleridnum','lastevent','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x951e,0x68));var _0xe951=function(_0x1aa3c9,_0x36e605){_0x1aa3c9=_0x1aa3c9-0x0;var _0x1be779=_0x951e[_0x1aa3c9];return _0x1be779;};'use strict';var _=require('lodash');var rp=require(_0xe951('0x0'));var md5=require(_0xe951('0x1'));var util=require('util');var Redis=require(_0xe951('0x2'));var intUtil=require('./util');var config=require(_0xe951('0x3'));var logger=require(_0xe951('0x4'))(_0xe951('0x5'));config[_0xe951('0x6')]=_[_0xe951('0x7')](config['redis'],{'host':_0xe951('0x8'),'port':0x18eb});var io=require(_0xe951('0x9'))(new Redis(config[_0xe951('0x6')]));function emit(_0x1a2c5a,_0xe31245,_0x2a5195){io['to'](_0x1a2c5a)[_0xe951('0xa')](_0xe31245,_0x2a5195);}var headers={'Content-Type':'application/json','Accept':_0xe951('0xb')};function getTicket(_0x41d107,_0x833279,_0x5a0a96,_0x217cfe,_0x21a07a){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0xe951('0xc')](_0xe951('0xd'),_0x41d107[_0xe951('0xe')]),'method':'POST','body':{'ticket':_[_0xe951('0xf')]({'requester_id':_0x5a0a96['id'],'submitter_id':_0x833279?_0x833279['id']:undefined,'assignee_id':_0x833279?_0x833279['id']:undefined,'tags':getTags(_0x217cfe['Tags'],_0xe951('0x10')),'subject':intUtil[_0xe951('0x11')](_0x217cfe[_0xe951('0x12')],_0x21a07a,'\x20'),'description':intUtil[_0xe951('0x11')](_0x217cfe[_0xe951('0x13')],_0x21a07a,'\x0a'),'comment':{'public':![],'body':intUtil[_0xe951('0x11')](_0x217cfe['Descriptions'],_0x21a07a,'\x0a')}},getCustomFields(_0x217cfe['Fields'],_0x21a07a))}})['then'](function(_0x16a8c2){logger[_0xe951('0x14')](_0xe951('0x15'));return _0x16a8c2['ticket'];});}function getUser(_0x563630,_0x309b24){if(intUtil[_0xe951('0x16')](_0x309b24)){logger[_0xe951('0x14')](_0xe951('0x17'),_0x309b24);return request({'uri':util[_0xe951('0xc')](_0xe951('0x18'),_0x563630[_0xe951('0xe')]),'qs':{'query':util[_0xe951('0xc')](_0xe951('0x19'),_0x309b24)}})[_0xe951('0x1a')](function(_0x10ab17){if(_0x10ab17[_0xe951('0x1b')]){logger[_0xe951('0x14')](_0xe951('0x1c'));return _[_0xe951('0x1d')](_0x10ab17[_0xe951('0x1e')],{'email':_0x309b24,'role':_0xe951('0x1f')});}else{logger[_0xe951('0x14')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xe951('0xc')](_0xe951('0x20'),_0x563630[_0xe951('0xe')])})['then'](function(_0x6350af){logger[_0xe951('0x14')](_0xe951('0x21'));return _0x6350af[_0xe951('0x22')];});}});}else{logger[_0xe951('0x14')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xe951('0x20'),_0x563630[_0xe951('0xe')])})[_0xe951('0x1a')](function(_0x1ef4d9){logger[_0xe951('0x14')](_0xe951('0x21'));return _0x1ef4d9['user'];});}}function getEndUser(_0x349ae4,_0x39a7ae,_0x140619){logger[_0xe951('0x14')](_0xe951('0x23'),_0x140619);return request({'uri':util[_0xe951('0xc')]('%s/search.json',_0x349ae4[_0xe951('0xe')]),'qs':{'query':util[_0xe951('0xc')](_0xe951('0x24'),_0x140619)}})['then'](function(_0x192838){var _0x4270b2;if(_0x192838[_0xe951('0x1e')]['length']){_0x192838[_0xe951('0x1e')]=_[_0xe951('0x25')](_0x192838[_0xe951('0x1e')],{'suspended':![],'role':_0xe951('0x26')});if(_0x192838[_0xe951('0x1e')][_0xe951('0x27')]){_0x4270b2=_[_0xe951('0x28')](_0x192838[_0xe951('0x1e')]);}}if(_0x4270b2){logger[_0xe951('0x14')](_0xe951('0x29'));return _0x4270b2;}else{logger[_0xe951('0x14')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xe951('0xc')](_0xe951('0x2a'),_0x349ae4[_0xe951('0xe')]),'method':_0xe951('0x2b'),'body':{'user':{'role':_0xe951('0x26'),'name':util[_0xe951('0xc')](_0xe951('0x2c'),_0x39a7ae||_0x140619),'phone':_0x140619}}})[_0xe951('0x1a')](function(_0x3bbdf2){logger[_0xe951('0x14')](_0xe951('0x2d'));return _0x3bbdf2['user'];});}});}function getAuth(_0xbace9a){var _0x2858c4;if(_0xbace9a[_0xe951('0x2e')]===_0xe951('0x2f')){_0x2858c4=util['format'](_0xe951('0x30'),_0xbace9a[_0xe951('0x31')],_0xbace9a[_0xe951('0x2f')]);}else if(_0xbace9a[_0xe951('0x2e')]===_0xe951('0x32')){_0x2858c4=util['format'](_0xe951('0x33'),_0xbace9a[_0xe951('0x31')],_0xbace9a[_0xe951('0x32')]);}return util[_0xe951('0xc')](_0xe951('0x34'),new Buffer(_0x2858c4)[_0xe951('0x35')](_0xe951('0x36')));}function request(_0xa3c1ba){logger[_0xe951('0x37')](_0xe951('0x38'),JSON[_0xe951('0x39')](_0xa3c1ba));return rp(_[_0xe951('0x7')](_0xa3c1ba,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4b504a,_0xc162fe){var _0x4b2e6a=[];if(_0x4b504a&&_0x4b504a['length']>0x0){_0x4b2e6a=_[_0xe951('0x3a')](_0x4b504a,_0xc162fe);}return _0x4b2e6a;}function getCustomFields(_0x347008,_0xf97f7){var _0x26ea4f=[];var _0x49f767={'custom_fields':[]};if(_0x347008[_0xe951('0x27')]>0x0){_[_0xe951('0x3b')](_0x347008,function(_0x701db9){if(_['includes'](['string','picklist'],_0x701db9['type'])&&_0x701db9[_0xe951('0x3c')]&&!_0x701db9[_0xe951('0x3d')]){_0x49f767[_0x701db9[_0xe951('0x3c')][_0xe951('0x3e')]()]=_0x701db9['content'][_0xe951('0x35')]();}else if(_[_0xe951('0x3f')]([_0xe951('0x40'),_0xe951('0x41')],_0x701db9[_0xe951('0x42')])&&_0x701db9[_0xe951('0x43')]&&_0x701db9['customField']){_0x49f767[_0xe951('0x44')]['push']({'id':_0x701db9[_0xe951('0x43')],'value':_0x701db9[_0xe951('0x45')]['toString']()});}else if(_0x701db9[_0xe951('0x42')]===_0xe951('0x46')&&_0x701db9[_0xe951('0x47')]&&_0x701db9[_0xe951('0x43')]&&_0x701db9[_0xe951('0x3d')]){_0xf97f7[_0x701db9[_0xe951('0x47')]]&&_0x49f767['custom_fields'][_0xe951('0x48')]({'id':_0x701db9['idField'],'value':_0xf97f7[_0x701db9['variableName']][_0xe951('0x35')]()});}else if(_0x701db9[_0xe951('0x42')]===_0xe951('0x49')&&_0x701db9[_0xe951('0x4a')]&&_0x701db9[_0xe951('0x4a')]['name']&&_0x701db9[_0xe951('0x43')]&&_0x701db9[_0xe951('0x3d')]){_0xf97f7[_0x701db9[_0xe951('0x4a')][_0xe951('0x10')][_0xe951('0x3e')]()]&&_0x49f767[_0xe951('0x44')]['push']({'id':_0x701db9[_0xe951('0x43')],'value':_0xf97f7[_0x701db9[_0xe951('0x4a')][_0xe951('0x10')][_0xe951('0x3e')]()]['toString']()});}});}return _0x49f767;}exports[_0xe951('0x4b')]=function(_0x24f700,_0xe3716e,_0x2a62f5,_0x4850e8,_0x5584e8,_0x6e9d78){var _0x238a07,_0x212381;_0x6e9d78[_0xe951('0xe')]=intUtil[_0xe951('0x4c')](_0x6e9d78[_0xe951('0xe')]);_0x6e9d78[_0xe951('0x4d')]=intUtil[_0xe951('0x4c')](_0x6e9d78[_0xe951('0x4d')]);if(_0x5584e8&&_0x5584e8[_0xe951('0x4e')]){logger[_0xe951('0x14')](_0xe951('0x4f'),_0xe951('0x50'));_0xe3716e['recordingURL']=util[_0xe951('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x6e9d78[_0xe951('0x4d')],_0xe3716e['uniqueid'],md5(_0xe3716e[_0xe951('0x51')]));}else{_0xe3716e[_0xe951('0x52')]='';}headers['Authorization']=getAuth(_0x6e9d78);return getUser(_0x6e9d78,_0x4850e8[_0xe951('0x53')])[_0xe951('0x1a')](function(_0x26587d){_0x238a07=_0x26587d;logger[_0xe951('0x14')](_0xe951('0x54'),_0x238a07['id']);return getEndUser(_0x6e9d78,_0xe3716e[_0xe951('0x55')],_0xe3716e['calleridnum']);})[_0xe951('0x1a')](function(_0x4cf8e1){_0x212381=_0x4cf8e1;logger[_0xe951('0x14')](_0xe951('0x56'),_0x212381['id']);return getTicket(_0x6e9d78,_0x238a07,_0x212381,_0x2a62f5,_0xe3716e);})[_0xe951('0x1a')](function(_0x2be52c){if(_0x2be52c){logger[_0xe951('0x14')](_0xe951('0x57'),_0x2be52c['id']);switch(_0x6e9d78[_0xe951('0x42')]){case _0xe951('0x58'):logger[_0xe951('0x14')](_0xe951('0x4f'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xe951('0xc')](_0xe951('0x59'),_0x6e9d78[_0xe951('0xe')],_0x238a07['id'],_0x2be52c['id']),'method':'POST'});case'newTab':logger['info'](_0xe951('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe951('0xc')](_0xe951('0x5a'),_0x4850e8['name']),_0xe951('0x5b'),{'uri':util[_0xe951('0xc')](_0xe951('0x5c'),_0x6e9d78[_0xe951('0xe')]['replace']('/api/v2',''),_0x2be52c['id'])});break;default:logger['error']('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xe951('0x5d')](function(_0x5b099e){logger[_0xe951('0x5e')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xe951('0x5f')](_0x5b099e,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x40d48a,_0x41d969,_0x37bc7e,_0x41dd29,_0x253516,_0x2e88fa,_0x5f703){var _0x3f5e66,_0x21c401;_0x2e88fa['remoteUri']=intUtil[_0xe951('0x4c')](_0x2e88fa[_0xe951('0xe')]);_0x2e88fa[_0xe951('0x4d')]=intUtil['stripTrailingSlash'](_0x2e88fa['serverUrl']);if(_0x5f703&&_0x5f703[_0xe951('0x60')]&&_0x5f703[_0xe951('0x60')]!==_0xe951('0x61')){logger[_0xe951('0x14')](_0xe951('0x62'),_0xe951('0x50'));_0x41d969[_0xe951('0x52')]=util[_0xe951('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2e88fa[_0xe951('0x4d')],_0x41d969[_0xe951('0x51')],md5(_0x41d969[_0xe951('0x51')]));}headers['Authorization']=getAuth(_0x2e88fa);return getUser(_0x2e88fa,_0x41dd29[_0xe951('0x53')])['then'](function(_0x4c36a1){_0x3f5e66=_0x4c36a1;logger[_0xe951('0x14')](_0xe951('0x54'),_0x3f5e66['id']);return getEndUser(_0x2e88fa,_0x41d969[_0xe951('0x63')],_0x41d969[_0xe951('0x64')]);})['then'](function(_0x2c94ab){_0x21c401=_0x2c94ab;logger[_0xe951('0x14')](_0xe951('0x56'),_0x21c401['id']);return getTicket(_0x2e88fa,_0x3f5e66,_0x21c401,_0x37bc7e,_0x41d969);})['then'](function(_0x40d94d){if(_0x40d94d){logger['info'](_0xe951('0x57'),_0x40d94d['id']);switch(_0x2e88fa['type']){case'integrationTab':logger['info']('[OUTBOUND]',_0xe951('0x65'));return request({'uri':util[_0xe951('0xc')](_0xe951('0x59'),_0x2e88fa[_0xe951('0xe')],_0x3f5e66['id'],_0x40d94d['id']),'method':_0xe951('0x2b')});case'newTab':logger[_0xe951('0x14')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe951('0xc')](_0xe951('0x5a'),_0x41dd29[_0xe951('0x10')]),_0xe951('0x5b'),{'uri':util[_0xe951('0xc')](_0xe951('0x5c'),_0x2e88fa[_0xe951('0xe')][_0xe951('0x66')](_0xe951('0x67'),''),_0x40d94d['id'])});break;default:logger[_0xe951('0x5e')](_0xe951('0x62'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xe951('0x5d')](function(_0x4fe8ae){logger['error'](_0xe951('0x68'),util['inspect'](_0x4fe8ae,{'showHidden':!![],'depth':null}));});};exports[_0xe951('0x69')]=function(_0x4966e,_0x2a8861,_0x47fba1,_0x45f235,_0x5ce0dc,_0x43cf74){var _0x280d3a,_0x22aa38;_0x43cf74[_0xe951('0xe')]=intUtil['stripTrailingSlash'](_0x43cf74['remoteUri']);_0x43cf74[_0xe951('0x4d')]=intUtil[_0xe951('0x4c')](_0x43cf74[_0xe951('0x4d')]);if(_0x5ce0dc&&_0x5ce0dc[_0xe951('0x4e')]){logger[_0xe951('0x14')]('['+_0x2a8861['lastevent'][_0xe951('0x6a')]()+']',_0xe951('0x50'));_0x2a8861[_0xe951('0x52')]=util[_0xe951('0xc')](_0xe951('0x6b'),_0x43cf74[_0xe951('0x4d')],_0x2a8861[_0xe951('0x51')],md5(_0x2a8861['uniqueid']));}else{_0x2a8861[_0xe951('0x52')]='';}headers[_0xe951('0x6c')]=getAuth(_0x43cf74);return getUser(_0x43cf74)[_0xe951('0x1a')](function(_0x2eb436){_0x280d3a=_0x2eb436;logger[_0xe951('0x14')](_0xe951('0x54'),_0x280d3a['id']);return getEndUser(_0x43cf74,_0x2a8861[_0xe951('0x55')],_0x2a8861[_0xe951('0x6d')]);})[_0xe951('0x1a')](function(_0x447d9d){_0x22aa38=_0x447d9d;logger[_0xe951('0x14')](_0xe951('0x56'),_0x22aa38['id']);return getTicket(_0x43cf74,_0x280d3a,_0x22aa38,_0x47fba1,_0x2a8861);})[_0xe951('0x1a')](function(_0x2cf401){if(_0x2cf401){logger['info'](_0xe951('0x57'),_0x2cf401['id']);}})[_0xe951('0x5d')](function(_0x92b72a){logger['error']('['+_0x2a8861[_0xe951('0x6e')][_0xe951('0x6a')]()+']'+_0xe951('0x6f'),util[_0xe951('0x5f')](_0x92b72a,{'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 daca6f4..585d05d 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 _0xfe3f=['data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','Error:\x20','CREATE\x20ERROR','moduleSearch','uri','contact','Contacts','nothing','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Creating\x20new\x20call...','administrator','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','diff','starttime','lastevent','Call_Result','Called','complete','connect','Answered','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','YYYY-MM-DDTHH:mm:ss','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','code','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','com','destcalleridnum','Outbound','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','toUpperCase','lodash','request-promise','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','stringify','length','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','The\x20failing\x20result\x20is','then'];(function(_0x16dbcd,_0x274516){var _0x34706e=function(_0x43433d){while(--_0x43433d){_0x16dbcd['push'](_0x16dbcd['shift']());}};_0x34706e(++_0x274516);}(_0xfe3f,0x194));var _0xffe3=function(_0x570370,_0x20e3c6){_0x570370=_0x570370-0x0;var _0x4f520e=_0xfe3f[_0x570370];return _0x4f520e;};'use strict';var _=require(_0xffe3('0x0'));var rp=require(_0xffe3('0x1'));var md5=require('md5');var util=require('util');var intUtil=require('./util');var moment=require(_0xffe3('0x2'));var Redis=require(_0xffe3('0x3'));var BPromise=require(_0xffe3('0x4'));var config=require(_0xffe3('0x5'));var logger=require(_0xffe3('0x6'))(_0xffe3('0x7'));config[_0xffe3('0x8')]=_[_0xffe3('0x9')](config[_0xffe3('0x8')],{'host':_0xffe3('0xa'),'port':0x18eb});var io=require(_0xffe3('0xb'))(new Redis(config['redis']));function emit(_0x1da8e9,_0x190163,_0x58d884){io['to'](_0x1da8e9)['emit'](_0x190163,_0x58d884);}function request(_0x5d34fb){logger[_0xffe3('0xc')](_0xffe3('0xd'),JSON[_0xffe3('0xe')](_0x5d34fb));return rp(_0x5d34fb);}function getCustomFields(_0x37e2a2,_0x5c52e2){var _0x569b44={};if(_0x37e2a2[_0xffe3('0xf')]>0x0){_['forEach'](_0x37e2a2,function(_0x4092b9){if(_[_0xffe3('0x10')]([_0xffe3('0x11'),_0xffe3('0x12')],_0x4092b9[_0xffe3('0x13')])&&_0x4092b9[_0xffe3('0x14')]){_0x569b44[_0x4092b9[_0xffe3('0x14')]]=_0x4092b9['content'][_0xffe3('0x15')]();}else if(_0x4092b9[_0xffe3('0x13')]===_0xffe3('0x16')&&_0x4092b9[_0xffe3('0x17')]&&_0x4092b9[_0xffe3('0x14')]&&_0x5c52e2[_0x4092b9[_0xffe3('0x17')]]){_0x569b44[_0x4092b9[_0xffe3('0x14')]]=_0x5c52e2[_0x4092b9[_0xffe3('0x17')]][_0xffe3('0x15')]();}else if(_0x4092b9[_0xffe3('0x13')]===_0xffe3('0x18')&&_0x4092b9[_0xffe3('0x19')]&&_0x4092b9[_0xffe3('0x19')][_0xffe3('0x1a')]&&_0x4092b9[_0xffe3('0x14')]&&_0x5c52e2[_0x4092b9[_0xffe3('0x19')]['name'][_0xffe3('0x1b')]()]){_0x569b44[_0x4092b9[_0xffe3('0x14')]]=_0x5c52e2[_0x4092b9[_0xffe3('0x19')][_0xffe3('0x1a')][_0xffe3('0x1b')]()]['toString']();}});}return _0x569b44;}function getName(_0x27acbf){if(_0x27acbf[_0xffe3('0x1c')]('\x20')>0x0){var _0x4096f6=_0x27acbf[_0xffe3('0x1d')](/ (.+)/);if(_0x4096f6[0x1]){return _0x4096f6;}}return[_0x27acbf,_0x27acbf];}var accountsTokens={};function getAccessToken(_0x13e105){return new Promise(function(_0x259195,_0x3f7acb){if(!_[_0xffe3('0x1e')](accountsTokens[_0x13e105['id']])&&!_[_0xffe3('0x1e')](accountsTokens[_0x13e105['id']][_0xffe3('0x1f')])){if(moment()[_0xffe3('0x20')](accountsTokens[_0x13e105['id']][_0xffe3('0x21')])){_0x259195(accountsTokens[_0x13e105['id']][_0xffe3('0x1f')]);}}var _0xe0e618;switch(_0x13e105[_0xffe3('0x22')]){case'US':_0xe0e618=_0xffe3('0x23');break;case'AU':_0xe0e618=_0xffe3('0x24');break;case'EU':_0xe0e618=_0xffe3('0x25');break;case'IN':_0xe0e618='https://accounts.zoho.in';break;case'CN':_0xe0e618=_0xffe3('0x26');break;default:_0xe0e618='https://accounts.zoho.eu';break;}var _0x27470a={'method':_0xffe3('0x27'),'uri':_0xe0e618+_0xffe3('0x28'),'qs':{'refresh_token':_0x13e105[_0xffe3('0x29')],'client_id':_0x13e105[_0xffe3('0x2a')],'client_secret':_0x13e105[_0xffe3('0x2b')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x27470a)['then'](function(_0x28bb9b){accountsTokens[_0x13e105['id']]={'access_token':_0x28bb9b[_0xffe3('0x1f')],'expires_in':moment()[_0xffe3('0x2c')](_0x28bb9b[_0xffe3('0x21')],_0xffe3('0x2d'))};_0x259195(_0x28bb9b[_0xffe3('0x1f')]);})[_0xffe3('0x2e')](function(_0x41079d){logger[_0xffe3('0x2f')](_0xffe3('0x30'),_0x41079d[_0xffe3('0x31')]);_0x3f7acb(_0x41079d);});});}function getUser(_0x425539,_0x5278f0,_0x1ee280,_0x1c7886){logger[_0xffe3('0x32')](_0xffe3('0x33'));return request({'method':_0xffe3('0x34'),'uri':util[_0xffe3('0x35')](_0xffe3('0x36'),_0x5278f0),'qs':{'type':_0xffe3('0x37')},'headers':{'Authorization':_0xffe3('0x38')+_0x425539},'json':!![]})['then'](function(_0x363e7f){if(_0x363e7f[_0xffe3('0x39')]){var _0x575c14=-0x1;if(_[_0xffe3('0x3a')](_0x363e7f[_0xffe3('0x39')])){if(!_[_0xffe3('0x1e')](_0x1c7886)){_0x575c14=_[_0xffe3('0x3b')](_0x363e7f['users'],function(_0x12c104){return _0x12c104['email']===_0x1c7886;});}if(_0x575c14>=0x0){logger['info'](_0xffe3('0x3c'));}else{logger[_0xffe3('0x32')](_0xffe3('0x3d'));_0x575c14=_['findIndex'](_0x363e7f[_0xffe3('0x39')],function(_0x5972eb){return _0x5972eb[_0xffe3('0x3e')][_0xffe3('0x1a')]==='Administrator';});}return _0x363e7f['users'][_0x575c14];}else{if(_0x363e7f[_0xffe3('0x3f')][_0xffe3('0x3e')][_0xffe3('0x1a')]===_0xffe3('0x40')){logger[_0xffe3('0x32')]('Using\x20the\x20admin\x20account!');user=_0x363e7f[_0xffe3('0x3f')];return user;}else{logger[_0xffe3('0x2f')](_0xffe3('0x41'),JSON[_0xffe3('0xe')](_0x363e7f));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xffe3('0xe')](_0x363e7f));}}}else{logger[_0xffe3('0x2f')](_0xffe3('0x41'),JSON[_0xffe3('0xe')](_0x363e7f));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xffe3('0xe')](_0x363e7f));}})[_0xffe3('0x2e')](function(_0x390e66){console['error'](_0x390e66);});}function getZohoUser(_0x3455c0,_0x23601a){return new BPromise(function(_0x1744e0,_0x2f821b){request(_0x3455c0)[_0xffe3('0x42')](function(_0x181732){var _0x1e31f5=null;if(_0x181732){_0x1e31f5=_0x181732[_0xffe3('0x43')][0x0];_0x1e31f5[_0xffe3('0x44')]=_0x23601a;}_0x1744e0(_0x1e31f5);})['catch'](function(_0x32ab34){_0x2f821b(_0x32ab34);});});}function createEndUser(_0x4536fd,_0x1c5fe3,_0x55b9d3,_0x5f749d,_0x3d87fb,_0x37773d){var _0x55b9d3=getName(_0x55b9d3);return request({'method':_0xffe3('0x27'),'uri':_0xffe3('0x45')+_0x1c5fe3+'/crm/v2/'+_[_0xffe3('0x46')](_0x37773d[_0xffe3('0x47')])+'s','body':{'data':[{'Last_Name':_0x55b9d3[0x1],'First_Name':_0x55b9d3[0x0],'Phone':_0x5f749d,'Owner':{'name':!_[_0xffe3('0x1e')](_0x3d87fb['role'][_0xffe3('0x1a')])?_0x3d87fb[_0xffe3('0x48')][_0xffe3('0x1a')]:!_[_0xffe3('0x1e')](_0x3d87fb['first_name'])?_0x3d87fb[_0xffe3('0x49')]+'\x20'+_0x3d87fb['last_name']:_0x3d87fb[_0xffe3('0x4a')],'id':_0x3d87fb['id']}}]},'headers':{'Authorization':_0xffe3('0x38')+_0x4536fd},'json':!![]})[_0xffe3('0x42')](function(_0x3ff2f7){if(_0x3ff2f7&&_0x3ff2f7['data'][0x0]['code']===_0xffe3('0x4b')){var _0x3a3028=_0x3ff2f7[_0xffe3('0x43')][0x0][_0xffe3('0x4c')];_0x3a3028[_0xffe3('0x44')]=_['startCase'](_0x37773d[_0xffe3('0x47')])+'s';return _0x3a3028;}logger[_0xffe3('0x2f')](_0xffe3('0x41'),JSON[_0xffe3('0xe')](data));throw new Error(_0xffe3('0x4d')+JSON['stringify'](data));})[_0xffe3('0x2e')](function(_0x385860){console['log'](_0xffe3('0x4e'),_0x385860);});}function getEndUser(_0x718dd2,_0x3404e8,_0x5868c5,_0x279ac9,_0x5245e9,_0x361b5d,_0x1bfc02){var _0x268245={'method':_0xffe3('0x34'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x718dd2},'json':!![]};switch(_0x1bfc02[_0xffe3('0x4f')]){case'contact_lead':_0x268245[_0xffe3('0x50')]=_0xffe3('0x45')+_0x3404e8+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x5245e9+'))';return getZohoUser(_0x268245,'Contacts')[_0xffe3('0x42')](function(_0x44e449){if(_0x44e449)return _0x44e449;_0x268245['uri']=_0xffe3('0x45')+_0x3404e8+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x5245e9+'))';return getZohoUser(_0x268245,'Leads')['then'](function(_0x68d299){if(_0x68d299)return _0x68d299;if(_0x1bfc02[_0xffe3('0x47')]!='nothing'){return createEndUser(_0x718dd2,_0x3404e8,_0x279ac9,_0x5245e9,_0x361b5d,_0x1bfc02);}else{return{};}});});break;case _0xffe3('0x51'):_0x268245[_0xffe3('0x50')]=_0xffe3('0x45')+_0x3404e8+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x5245e9+'))';return getZohoUser(_0x268245,_0xffe3('0x52'))[_0xffe3('0x42')](function(_0x570369){if(_0x570369)return _0x570369;if(_0x1bfc02[_0xffe3('0x47')]!=_0xffe3('0x53')){return createEndUser(_0x718dd2,_0x3404e8,_0x279ac9,_0x5245e9,_0x361b5d,_0x1bfc02);}else{return{};}});break;case'lead':_0x268245[_0xffe3('0x50')]=_0xffe3('0x45')+_0x3404e8+_0xffe3('0x54')+_0x5245e9+'))';return getZohoUser(_0x268245,_0xffe3('0x55'))[_0xffe3('0x42')](function(_0x443758){if(_0x443758)return _0x443758;if(_0x1bfc02['moduleCreate']!=_0xffe3('0x53')){return createEndUser(_0x718dd2,_0x3404e8,_0x279ac9,_0x5245e9,_0x361b5d,_0x1bfc02);}else{return{};}});break;}}function getCall(_0x2dd373,_0x41d6ac,_0x2b597a,_0x4713e3,_0x5e1b19,_0x29a9fd,_0x43d088,_0x12390d){logger[_0xffe3('0x32')](_0xffe3('0x56'));var _0x38b0df={};_0x38b0df['Owner']={'name':!_[_0xffe3('0x1e')](_0x4713e3[_0xffe3('0x48')][_0xffe3('0x1a')])&&!_[_0xffe3('0x1e')](_0x4713e3['profile'][_0xffe3('0x1a')])&&_0x4713e3[_0xffe3('0x3e')][_0xffe3('0x1a')]===_0xffe3('0x57')?_0x4713e3[_0xffe3('0x48')][_0xffe3('0x1a')]:!_[_0xffe3('0x1e')](_0x4713e3['first_name'])?_0x4713e3[_0xffe3('0x49')]+'\x20'+_0x4713e3['last_name']:_0x4713e3['last_name'],'id':_0x4713e3['id']};_0x38b0df[_0xffe3('0x58')]=intUtil[_0xffe3('0x59')](_0x29a9fd[_0xffe3('0x5a')],_0x43d088,'\x20');_0x38b0df['Description']=intUtil[_0xffe3('0x59')](_0x29a9fd[_0xffe3('0x5b')],_0x43d088,'\x0a');if(_0x5e1b19[_0xffe3('0x44')]===_0xffe3('0x52')){_0x38b0df[_0xffe3('0x5c')]={'name':!_[_0xffe3('0x1e')](_0x5e1b19['Full_Name'])?_0x5e1b19[_0xffe3('0x5d')]:!_[_0xffe3('0x1e')](_0x5e1b19[_0xffe3('0x5e')])?_0x5e1b19['First_Name']+'\x20'+_0x5e1b19[_0xffe3('0x5f')]:_0x5e1b19[_0xffe3('0x5f')],'id':_0x5e1b19['id']};}if(_0x5e1b19[_0xffe3('0x44')]==='Leads'){_0x38b0df[_0xffe3('0x60')]={'name':!_[_0xffe3('0x1e')](_0x5e1b19[_0xffe3('0x5d')])?_0x5e1b19[_0xffe3('0x5d')]:!_[_0xffe3('0x1e')](_0x5e1b19[_0xffe3('0x5e')])?_0x5e1b19[_0xffe3('0x5e')]+'\x20'+_0x5e1b19[_0xffe3('0x5f')]:_0x5e1b19['Last_Name'],'id':_0x5e1b19['id']};_0x38b0df[_0xffe3('0x61')]=_['startCase'](_0x5e1b19[_0xffe3('0x44')]);}if(_0x43d088[_0xffe3('0x62')]){_0x38b0df[_0xffe3('0x63')]=moment[_0xffe3('0x64')](parseInt(_0x43d088[_0xffe3('0x62')])*0x3e8)[_0xffe3('0x35')](_0xffe3('0x65'));}else if(_0x43d088[_0xffe3('0x66')]&&_0x43d088[_0xffe3('0x67')]){_0x38b0df['Call_Duration']=moment[_0xffe3('0x64')](moment(_0x43d088[_0xffe3('0x67')],'YYYY-MM-DDTHH:mm:ss')[_0xffe3('0x68')](moment(_0x43d088[_0xffe3('0x69')],'YYYY-MM-DDTHH:mm:ss')))[_0xffe3('0x35')](_0xffe3('0x65'));}switch(_0x43d088[_0xffe3('0x6a')]){case'called':_0x38b0df[_0xffe3('0x6b')]=_0xffe3('0x6c');break;case _0xffe3('0x6d'):case _0xffe3('0x6e'):_0x38b0df['Call_Result']=_0xffe3('0x6f');break;case'rejected':_0x38b0df[_0xffe3('0x6b')]=_0xffe3('0x70');break;case _0xffe3('0x71'):_0x38b0df[_0xffe3('0x6b')]=_0xffe3('0x72');break;case _0xffe3('0x73'):_0x38b0df[_0xffe3('0x6b')]=_0xffe3('0x74');default:}_0x38b0df[_0xffe3('0x75')]=(_0x12390d===_0xffe3('0x76')?moment(_0x43d088['starttime'])[_0xffe3('0x35')](_0xffe3('0x77')):moment(_0x43d088[_0xffe3('0x78')])[_0xffe3('0x35')](_0xffe3('0x77')))||moment()['format'](_0xffe3('0x77'));_0x38b0df[_0xffe3('0x79')]=_0x12390d||_0xffe3('0x7a');_0x38b0df=_[_0xffe3('0x7b')](_0x38b0df,getCustomFields(_0x29a9fd['Fields'],_0x43d088));return request({'method':_0xffe3('0x27'),'uri':_0xffe3('0x45')+_0x41d6ac+_0xffe3('0x7c'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2dd373},'body':{'data':[_0x38b0df]},'json':!![]})[_0xffe3('0x42')](function(_0x6704f6){if(_0x6704f6&&_0x6704f6[_0xffe3('0x43')][0x0][_0xffe3('0x7d')]===_0xffe3('0x4b')){logger[_0xffe3('0x32')](_0xffe3('0x7e'));return{'id':_0x6704f6[_0xffe3('0x43')][0x0][_0xffe3('0x4c')]['id']};}})['catch'](function(_0x246766){logger[_0xffe3('0x32')](_0xffe3('0x7f'),_0x246766[_0xffe3('0x31')]);console['log'](_0xffe3('0x7f'),_0x246766);});}exports[_0xffe3('0x80')]=function(_0x1869eb,_0x19c1c7,_0x50e9fd,_0x48180e,_0x5a1fba,_0x204ebe){var _0x48203b,_0x3f3670,_0x2a1b64;_0x204ebe[_0xffe3('0x81')]=intUtil[_0xffe3('0x82')](_0x204ebe['host']);_0x204ebe[_0xffe3('0x83')]=intUtil[_0xffe3('0x82')](_0x204ebe[_0xffe3('0x83')]);if(_0x5a1fba&&_0x5a1fba[_0xffe3('0x84')]){logger[_0xffe3('0x32')](_0xffe3('0x85'),_0xffe3('0x86'));_0x19c1c7[_0xffe3('0x87')]=_0x204ebe['serverUrl']+'/api/voice/recordings/'+_0x19c1c7[_0xffe3('0x88')]+_0xffe3('0x89')+md5(_0x19c1c7['uniqueid']);}else{_0x19c1c7[_0xffe3('0x87')]='';}var _0x37536a=_0x204ebe[_0xffe3('0x81')]===_0xffe3('0x8a')?'eu':'com';return getAccessToken(_0x204ebe)[_0xffe3('0x42')](function(_0xe4c16c){_0x2a1b64=_0xe4c16c;return getUser(_0x2a1b64,_0x37536a,_0x204ebe,_0x48180e[_0xffe3('0x8b')]);})[_0xffe3('0x42')](function(_0x2a422a){_0x48203b=_0x2a422a;logger['info'](_0xffe3('0x8c'),_0x48203b['id']);return getEndUser(_0x2a1b64,_0x37536a,_0x204ebe,_0x19c1c7[_0xffe3('0x8d')],_0x19c1c7[_0xffe3('0x8e')],_0x48203b,_0x50e9fd);})['then'](function(_0x465e97){_0x3f3670=_0x465e97;return getCall(_0x2a1b64,_0x37536a,_0x204ebe,_0x48203b,_0x3f3670,_0x50e9fd,_0x19c1c7,'Inbound');})['then'](function(_0x1a4087){if(_0x1a4087){logger[_0xffe3('0x32')](_0xffe3('0x8f'),_0x1a4087['id']);logger[_0xffe3('0x32')]('[QUEUE]',_0xffe3('0x90'));emit(util['format'](_0xffe3('0x91'),_0x48180e[_0xffe3('0x1a')]),'trigger:browser:url',{'uri':'https://crm.'+_0x204ebe[_0xffe3('0x81')]+'/crm/EntityInfo.do?module=Calls&id='+_0x1a4087['id']});}})['catch'](function(_0x1b9059){logger[_0xffe3('0x2f')](_0xffe3('0x85'),JSON[_0xffe3('0xe')](_0x1b9059));});};exports[_0xffe3('0x76')]=function(_0x43b4ac,_0x427de3,_0x3b7cab,_0x18bde5,_0x3a6cc5,_0x4958e3,_0x52f691){var _0x355e29,_0x56f3ce,_0x2662c8;_0x4958e3[_0xffe3('0x81')]=intUtil['stripTrailingSlash'](_0x4958e3['host']);_0x4958e3[_0xffe3('0x83')]=intUtil['stripTrailingSlash'](_0x4958e3[_0xffe3('0x83')]);if(_0x52f691&&_0x52f691['recordingFormat']&&_0x52f691[_0xffe3('0x92')]!==_0xffe3('0x93')){logger[_0xffe3('0x32')](_0xffe3('0x94'),_0xffe3('0x86'));_0x427de3['recordingURL']=_0x4958e3['serverUrl']+_0xffe3('0x95')+_0x427de3[_0xffe3('0x88')]+_0xffe3('0x89')+md5(_0x427de3[_0xffe3('0x88')]);}var _0x406f4c=_0x4958e3[_0xffe3('0x81')]===_0xffe3('0x8a')?'eu':_0xffe3('0x96');return getAccessToken(_0x4958e3)['then'](function(_0x53ef53){_0x2662c8=_0x53ef53;return getUser(_0x2662c8,_0x406f4c,_0x4958e3,_0x18bde5['email']);})[_0xffe3('0x42')](function(_0x15e137){_0x355e29=_0x15e137;logger['info'](_0xffe3('0x8c'),_0x355e29['id']);return getEndUser(_0x2662c8,_0x406f4c,_0x4958e3,_0x427de3['destcalleridname'],_0x427de3[_0xffe3('0x97')],_0x355e29,_0x3b7cab);})[_0xffe3('0x42')](function(_0x4ed43a){_0x56f3ce=_0x4ed43a;return getCall(_0x2662c8,_0x406f4c,_0x4958e3,_0x355e29,_0x56f3ce,_0x3b7cab,_0x427de3,_0xffe3('0x98'));})['then'](function(_0x4583a7){if(_0x4583a7){logger['info']('The\x20Call\x20ID\x20is:',_0x4583a7['id']);logger[_0xffe3('0x32')](_0xffe3('0x94'),_0xffe3('0x90'));emit(util['format'](_0xffe3('0x91'),_0x18bde5['name']),_0xffe3('0x99'),{'uri':_0xffe3('0x9a')+_0x4958e3[_0xffe3('0x81')]+_0xffe3('0x9b')+_0x4583a7['id']});}})[_0xffe3('0x2e')](function(_0x2df44c){logger[_0xffe3('0x2f')](_0xffe3('0x94'),JSON[_0xffe3('0xe')](_0x2df44c));});};exports['unmanaged']=function(_0x4c16ee,_0x26b414,_0x1ab058,_0x3dcb25,_0x2d2d84,_0x5567a4){var _0x1c4a71,_0x411479,_0x2b34a8;_0x5567a4[_0xffe3('0x81')]=intUtil['stripTrailingSlash'](_0x5567a4[_0xffe3('0x81')]);_0x5567a4[_0xffe3('0x83')]=intUtil[_0xffe3('0x82')](_0x5567a4['serverUrl']);if(_0x2d2d84&&_0x2d2d84['monitor_format']){logger[_0xffe3('0x32')]('['+_0x26b414['lastevent'][_0xffe3('0x9c')]()+']',_0xffe3('0x86'));_0x26b414['recordingURL']=_0x5567a4[_0xffe3('0x83')]+_0xffe3('0x95')+_0x26b414[_0xffe3('0x88')]+_0xffe3('0x89')+md5(_0x26b414['uniqueid']);}else{_0x26b414[_0xffe3('0x87')]='';}var _0x2674ee=_0x5567a4[_0xffe3('0x81')]===_0xffe3('0x8a')?'eu':_0xffe3('0x96');return getAccessToken(_0x5567a4)[_0xffe3('0x42')](function(_0x5bc1b6){_0x2b34a8=_0x5bc1b6;return getUser(_0x2b34a8,_0x2674ee,_0x5567a4);})[_0xffe3('0x42')](function(_0x5c8de0){_0x1c4a71=_0x5c8de0;logger[_0xffe3('0x32')](_0xffe3('0x8c'),_0x1c4a71['id']);return getEndUser(_0x2b34a8,_0x2674ee,_0x5567a4,_0x26b414[_0xffe3('0x8d')],_0x26b414[_0xffe3('0x8e')],_0x1c4a71,_0x1ab058);})[_0xffe3('0x42')](function(_0xe0f766){_0x411479=_0xe0f766;return getCall(_0x2b34a8,_0x2674ee,_0x5567a4,_0x1c4a71,_0x411479,_0x1ab058,_0x26b414,_0xffe3('0x7a'));})[_0xffe3('0x42')](function(_0x138d35){if(_0x138d35){logger[_0xffe3('0x32')](_0xffe3('0x8f'),_0x138d35['id']);}})[_0xffe3('0x2e')](function(_0x820d33){logger['error']('['+_0x26b414[_0xffe3('0x6a')][_0xffe3('0x9c')]()+']',JSON[_0xffe3('0xe')](_0x820d33));});}; \ No newline at end of file +var _0x81a9=['toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','stack','info','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','startCase','Error:\x20','log','CREATE\x20ERROR','moduleSearch','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','called','Call_Result','Called','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','Call_Type','merge','Fields','/crm/v2/Calls','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','The\x20User\x20ID\x20is:','The\x20Call\x20ID\x20is:','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','zoho.eu','destcalleridname','destcalleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','lastevent','toUpperCase','calleridname','calleridnum','Inbound','lodash','md5','util','./util','moment','ioredis','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','includes','string','picklist','idField','content','type','variable','variableName'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x81a9,0x81));var _0x981a=function(_0x2e5e7d,_0x3f50f2){_0x2e5e7d=_0x2e5e7d-0x0;var _0x5eb483=_0x81a9[_0x2e5e7d];return _0x5eb483;};'use strict';var _=require(_0x981a('0x0'));var rp=require('request-promise');var md5=require(_0x981a('0x1'));var util=require(_0x981a('0x2'));var intUtil=require(_0x981a('0x3'));var moment=require(_0x981a('0x4'));var Redis=require(_0x981a('0x5'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x981a('0x6'));config[_0x981a('0x7')]=_['defaults'](config[_0x981a('0x7')],{'host':_0x981a('0x8'),'port':0x18eb});var io=require(_0x981a('0x9'))(new Redis(config[_0x981a('0x7')]));function emit(_0x590889,_0x4e1c3b,_0x42f3ce){io['to'](_0x590889)[_0x981a('0xa')](_0x4e1c3b,_0x42f3ce);}function request(_0x7bf4e1){logger[_0x981a('0xb')](_0x981a('0xc'),JSON[_0x981a('0xd')](_0x7bf4e1));return rp(_0x7bf4e1);}function getCustomFields(_0x41854f,_0x5ab43b){var _0x24a023={};if(_0x41854f['length']>0x0){_['forEach'](_0x41854f,function(_0x12b451){if(_[_0x981a('0xe')]([_0x981a('0xf'),_0x981a('0x10')],_0x12b451['type'])&&_0x12b451['idField']){_0x24a023[_0x12b451[_0x981a('0x11')]]=_0x12b451[_0x981a('0x12')]['toString']();}else if(_0x12b451[_0x981a('0x13')]===_0x981a('0x14')&&_0x12b451[_0x981a('0x15')]&&_0x12b451[_0x981a('0x11')]&&_0x5ab43b[_0x12b451[_0x981a('0x15')]]){_0x24a023[_0x12b451[_0x981a('0x11')]]=_0x5ab43b[_0x12b451['variableName']][_0x981a('0x16')]();}else if(_0x12b451[_0x981a('0x13')]===_0x981a('0x17')&&_0x12b451[_0x981a('0x18')]&&_0x12b451['Variable']['name']&&_0x12b451['idField']&&_0x5ab43b[_0x12b451[_0x981a('0x18')][_0x981a('0x19')]['toLowerCase']()]){_0x24a023[_0x12b451[_0x981a('0x11')]]=_0x5ab43b[_0x12b451[_0x981a('0x18')][_0x981a('0x19')][_0x981a('0x1a')]()]['toString']();}});}return _0x24a023;}function getName(_0x45d49b){if(_0x45d49b[_0x981a('0x1b')]('\x20')>0x0){var _0x39267c=_0x45d49b[_0x981a('0x1c')](/ (.+)/);if(_0x39267c[0x1]){return _0x39267c;}}return[_0x45d49b,_0x45d49b];}var accountsTokens={};function getAccessToken(_0x88474a){return new Promise(function(_0x412d68,_0x269a44){if(!_['isNil'](accountsTokens[_0x88474a['id']])&&!_[_0x981a('0x1d')](accountsTokens[_0x88474a['id']][_0x981a('0x1e')])){if(moment()[_0x981a('0x1f')](accountsTokens[_0x88474a['id']][_0x981a('0x20')])){_0x412d68(accountsTokens[_0x88474a['id']][_0x981a('0x1e')]);}}var _0x1d4e98;switch(_0x88474a['zone']){case'US':_0x1d4e98=_0x981a('0x21');break;case'AU':_0x1d4e98=_0x981a('0x22');break;case'EU':_0x1d4e98='https://accounts.zoho.eu';break;case'IN':_0x1d4e98='https://accounts.zoho.in';break;case'CN':_0x1d4e98=_0x981a('0x23');break;default:_0x1d4e98=_0x981a('0x24');break;}var _0x5b8fcc={'method':_0x981a('0x25'),'uri':_0x1d4e98+_0x981a('0x26'),'qs':{'refresh_token':_0x88474a['refreshToken'],'client_id':_0x88474a[_0x981a('0x27')],'client_secret':_0x88474a[_0x981a('0x28')],'grant_type':_0x981a('0x29')},'json':!![]};return rp(_0x5b8fcc)[_0x981a('0x2a')](function(_0x9d600a){accountsTokens[_0x88474a['id']]={'access_token':_0x9d600a['access_token'],'expires_in':moment()[_0x981a('0x2b')](_0x9d600a[_0x981a('0x20')],_0x981a('0x2c'))};_0x412d68(_0x9d600a[_0x981a('0x1e')]);})[_0x981a('0x2d')](function(_0xa9a924){logger[_0x981a('0x2e')]('Failing\x20creating\x20the\x20access_token',_0xa9a924[_0x981a('0x2f')]);_0x269a44(_0xa9a924);});});}function getUser(_0x1ddc7f,_0x4dba5c,_0x381d11,_0x50f7c4){logger[_0x981a('0x30')]('Search\x20user');return request({'method':_0x981a('0x31'),'uri':util[_0x981a('0x32')]('https://www.zohoapis.%s/crm/v2/users',_0x4dba5c),'qs':{'type':_0x981a('0x33')},'headers':{'Authorization':_0x981a('0x34')+_0x1ddc7f},'json':!![]})[_0x981a('0x2a')](function(_0x3f3531){if(_0x3f3531[_0x981a('0x35')]){var _0x4c0bd1=-0x1;if(_['isArrayLikeObject'](_0x3f3531[_0x981a('0x35')])){if(!_['isNil'](_0x50f7c4)){_0x4c0bd1=_[_0x981a('0x36')](_0x3f3531['users'],function(_0x3fb597){return _0x3fb597[_0x981a('0x37')]===_0x50f7c4;});}if(_0x4c0bd1>=0x0){logger[_0x981a('0x30')](_0x981a('0x38'));}else{logger['info'](_0x981a('0x39'));_0x4c0bd1=_[_0x981a('0x36')](_0x3f3531['users'],function(_0x322d7a){return _0x322d7a[_0x981a('0x3a')]['name']==='Administrator';});}return _0x3f3531[_0x981a('0x35')][_0x4c0bd1];}else{if(_0x3f3531[_0x981a('0x3b')]['profile'][_0x981a('0x19')]==='Administrator'){logger[_0x981a('0x30')](_0x981a('0x39'));user=_0x3f3531[_0x981a('0x3b')];return user;}else{logger[_0x981a('0x2e')](_0x981a('0x3c'),JSON[_0x981a('0xd')](_0x3f3531));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x981a('0xd')](_0x3f3531));}}}else{logger[_0x981a('0x2e')](_0x981a('0x3c'),JSON[_0x981a('0xd')](_0x3f3531));throw new Error(_0x981a('0x3d')+JSON[_0x981a('0xd')](_0x3f3531));}})['catch'](function(_0x23b42a){console[_0x981a('0x2e')](_0x23b42a);});}function getZohoUser(_0x4ce9b1,_0x3edf4d){return new BPromise(function(_0x48d152,_0x441929){request(_0x4ce9b1)[_0x981a('0x2a')](function(_0x531dac){var _0x3436d7=null;if(_0x531dac){_0x3436d7=_0x531dac[_0x981a('0x3e')][0x0];_0x3436d7[_0x981a('0x3f')]=_0x3edf4d;}_0x48d152(_0x3436d7);})[_0x981a('0x2d')](function(_0x3843e4){_0x441929(_0x3843e4);});});}function createEndUser(_0x773778,_0x3c37ae,_0x1e074f,_0x2bd654,_0x4ac161,_0x41119f){var _0x1e074f=getName(_0x1e074f);return request({'method':_0x981a('0x25'),'uri':'https://www.zohoapis.'+_0x3c37ae+_0x981a('0x40')+_['startCase'](_0x41119f[_0x981a('0x41')])+'s','body':{'data':[{'Last_Name':_0x1e074f[0x1],'First_Name':_0x1e074f[0x0],'Phone':_0x2bd654,'Owner':{'name':!_[_0x981a('0x1d')](_0x4ac161[_0x981a('0x42')][_0x981a('0x19')])?_0x4ac161[_0x981a('0x42')][_0x981a('0x19')]:!_[_0x981a('0x1d')](_0x4ac161[_0x981a('0x43')])?_0x4ac161['first_name']+'\x20'+_0x4ac161[_0x981a('0x44')]:_0x4ac161[_0x981a('0x44')],'id':_0x4ac161['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x773778},'json':!![]})[_0x981a('0x2a')](function(_0x19f624){if(_0x19f624&&_0x19f624[_0x981a('0x3e')][0x0][_0x981a('0x45')]===_0x981a('0x46')){var _0x49a0d4=_0x19f624['data'][0x0][_0x981a('0x47')];_0x49a0d4[_0x981a('0x3f')]=_[_0x981a('0x48')](_0x41119f[_0x981a('0x41')])+'s';return _0x49a0d4;}logger[_0x981a('0x2e')](_0x981a('0x3c'),JSON[_0x981a('0xd')](data));throw new Error(_0x981a('0x49')+JSON[_0x981a('0xd')](data));})[_0x981a('0x2d')](function(_0x3384e2){console[_0x981a('0x4a')](_0x981a('0x4b'),_0x3384e2);});}function getEndUser(_0x2c4e33,_0x576111,_0x46dfba,_0x23f671,_0x597f6e,_0xaa1a25,_0x2f41e8){var _0x21e72e={'method':_0x981a('0x31'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2c4e33},'json':!![]};switch(_0x2f41e8[_0x981a('0x4c')]){case'contact_lead':_0x21e72e[_0x981a('0x4d')]=_0x981a('0x4e')+_0x576111+_0x981a('0x4f')+_0x597f6e+'))';return getZohoUser(_0x21e72e,_0x981a('0x50'))[_0x981a('0x2a')](function(_0x52013c){if(_0x52013c)return _0x52013c;_0x21e72e[_0x981a('0x4d')]=_0x981a('0x4e')+_0x576111+_0x981a('0x51')+_0x597f6e+'))';return getZohoUser(_0x21e72e,_0x981a('0x52'))[_0x981a('0x2a')](function(_0x5412d8){if(_0x5412d8)return _0x5412d8;if(_0x2f41e8[_0x981a('0x41')]!=_0x981a('0x53')){return createEndUser(_0x2c4e33,_0x576111,_0x23f671,_0x597f6e,_0xaa1a25,_0x2f41e8);}else{return{};}});});break;case'contact':_0x21e72e[_0x981a('0x4d')]=_0x981a('0x4e')+_0x576111+_0x981a('0x4f')+_0x597f6e+'))';return getZohoUser(_0x21e72e,_0x981a('0x50'))[_0x981a('0x2a')](function(_0x1cb42d){if(_0x1cb42d)return _0x1cb42d;if(_0x2f41e8['moduleCreate']!='nothing'){return createEndUser(_0x2c4e33,_0x576111,_0x23f671,_0x597f6e,_0xaa1a25,_0x2f41e8);}else{return{};}});break;case _0x981a('0x54'):_0x21e72e[_0x981a('0x4d')]='https://www.zohoapis.'+_0x576111+_0x981a('0x51')+_0x597f6e+'))';return getZohoUser(_0x21e72e,_0x981a('0x52'))['then'](function(_0x59a544){if(_0x59a544)return _0x59a544;if(_0x2f41e8[_0x981a('0x41')]!=_0x981a('0x53')){return createEndUser(_0x2c4e33,_0x576111,_0x23f671,_0x597f6e,_0xaa1a25,_0x2f41e8);}else{return{};}});break;}}function getCall(_0x3db6de,_0x1b98b7,_0x44baba,_0x435c93,_0x2a3a9c,_0x5cb085,_0x4840e4,_0x246c72){logger[_0x981a('0x30')](_0x981a('0x55'));var _0x5452cc={};_0x5452cc[_0x981a('0x56')]={'name':!_['isNil'](_0x435c93['role'][_0x981a('0x19')])&&!_[_0x981a('0x1d')](_0x435c93[_0x981a('0x3a')][_0x981a('0x19')])&&_0x435c93[_0x981a('0x3a')][_0x981a('0x19')]===_0x981a('0x57')?_0x435c93[_0x981a('0x42')][_0x981a('0x19')]:!_[_0x981a('0x1d')](_0x435c93['first_name'])?_0x435c93[_0x981a('0x43')]+'\x20'+_0x435c93[_0x981a('0x44')]:_0x435c93[_0x981a('0x44')],'id':_0x435c93['id']};_0x5452cc[_0x981a('0x58')]=intUtil[_0x981a('0x59')](_0x5cb085['Subjects'],_0x4840e4,'\x20');_0x5452cc[_0x981a('0x5a')]=intUtil['getString'](_0x5cb085[_0x981a('0x5b')],_0x4840e4,'\x0a');if(_0x2a3a9c[_0x981a('0x3f')]===_0x981a('0x50')){_0x5452cc[_0x981a('0x5c')]={'name':!_['isNil'](_0x2a3a9c['Full_Name'])?_0x2a3a9c[_0x981a('0x5d')]:!_['isNil'](_0x2a3a9c[_0x981a('0x5e')])?_0x2a3a9c[_0x981a('0x5e')]+'\x20'+_0x2a3a9c[_0x981a('0x5f')]:_0x2a3a9c['Last_Name'],'id':_0x2a3a9c['id']};}if(_0x2a3a9c['enduserType']===_0x981a('0x52')){_0x5452cc['What_Id']={'name':!_['isNil'](_0x2a3a9c[_0x981a('0x5d')])?_0x2a3a9c[_0x981a('0x5d')]:!_[_0x981a('0x1d')](_0x2a3a9c[_0x981a('0x5e')])?_0x2a3a9c[_0x981a('0x5e')]+'\x20'+_0x2a3a9c['Last_Name']:_0x2a3a9c[_0x981a('0x5f')],'id':_0x2a3a9c['id']};_0x5452cc[_0x981a('0x60')]=_[_0x981a('0x48')](_0x2a3a9c[_0x981a('0x3f')]);}if(_0x4840e4[_0x981a('0x61')]){_0x5452cc[_0x981a('0x62')]=moment[_0x981a('0x63')](parseInt(_0x4840e4[_0x981a('0x61')])*0x3e8)[_0x981a('0x32')](_0x981a('0x64'));}else if(_0x4840e4[_0x981a('0x65')]&&_0x4840e4[_0x981a('0x66')]){_0x5452cc[_0x981a('0x62')]=moment[_0x981a('0x63')](moment(_0x4840e4['endtime'],_0x981a('0x67'))[_0x981a('0x68')](moment(_0x4840e4['starttime'],_0x981a('0x67'))))['format'](_0x981a('0x64'));}switch(_0x4840e4['lastevent']){case _0x981a('0x69'):_0x5452cc[_0x981a('0x6a')]=_0x981a('0x6b');break;case'complete':case _0x981a('0x6c'):_0x5452cc[_0x981a('0x6a')]=_0x981a('0x6d');break;case _0x981a('0x6e'):_0x5452cc[_0x981a('0x6a')]=_0x981a('0x6f');break;case _0x981a('0x70'):_0x5452cc[_0x981a('0x6a')]=_0x981a('0x71');break;case _0x981a('0x72'):_0x5452cc[_0x981a('0x6a')]=_0x981a('0x73');default:}_0x5452cc['Call_Start_Time']=(_0x246c72===_0x981a('0x74')?moment(_0x4840e4['starttime'])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x4840e4['agentcalledAt'])[_0x981a('0x32')](_0x981a('0x67')))||moment()[_0x981a('0x32')](_0x981a('0x67'));_0x5452cc[_0x981a('0x75')]=_0x246c72||'Inbound';_0x5452cc=_[_0x981a('0x76')](_0x5452cc,getCustomFields(_0x5cb085[_0x981a('0x77')],_0x4840e4));return request({'method':_0x981a('0x25'),'uri':'https://www.zohoapis.'+_0x1b98b7+_0x981a('0x78'),'headers':{'Authorization':_0x981a('0x34')+_0x3db6de},'body':{'data':[_0x5452cc]},'json':!![]})[_0x981a('0x2a')](function(_0x4fdf84){if(_0x4fdf84&&_0x4fdf84[_0x981a('0x3e')][0x0][_0x981a('0x45')]===_0x981a('0x46')){logger[_0x981a('0x30')]('Call\x20created!');return{'id':_0x4fdf84[_0x981a('0x3e')][0x0]['details']['id']};}})[_0x981a('0x2d')](function(_0x168660){logger[_0x981a('0x30')]('err',_0x168660[_0x981a('0x2f')]);console[_0x981a('0x4a')](_0x981a('0x79'),_0x168660);});}exports[_0x981a('0x7a')]=function(_0x16d97b,_0x1e812a,_0x2905a6,_0x543dd6,_0x1aae40,_0x3e14d9){var _0x3791ca,_0x51bcce,_0x1e9761;_0x3e14d9[_0x981a('0x7b')]=intUtil['stripTrailingSlash'](_0x3e14d9[_0x981a('0x7b')]);_0x3e14d9['serverUrl']=intUtil[_0x981a('0x7c')](_0x3e14d9[_0x981a('0x7d')]);if(_0x1aae40&&_0x1aae40[_0x981a('0x7e')]){logger[_0x981a('0x30')](_0x981a('0x7f'),_0x981a('0x80'));_0x1e812a[_0x981a('0x81')]=_0x3e14d9[_0x981a('0x7d')]+_0x981a('0x82')+_0x1e812a[_0x981a('0x83')]+_0x981a('0x84')+md5(_0x1e812a['uniqueid']);}else{_0x1e812a['recordingURL']='';}var _0x644da1=_0x3e14d9['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x3e14d9)[_0x981a('0x2a')](function(_0xe33a97){_0x1e9761=_0xe33a97;return getUser(_0x1e9761,_0x644da1,_0x3e14d9,_0x543dd6[_0x981a('0x37')]);})[_0x981a('0x2a')](function(_0x22acaa){_0x3791ca=_0x22acaa;logger[_0x981a('0x30')](_0x981a('0x85'),_0x3791ca['id']);return getEndUser(_0x1e9761,_0x644da1,_0x3e14d9,_0x1e812a['calleridname'],_0x1e812a['calleridnum'],_0x3791ca,_0x2905a6);})[_0x981a('0x2a')](function(_0x39c38d){_0x51bcce=_0x39c38d;return getCall(_0x1e9761,_0x644da1,_0x3e14d9,_0x3791ca,_0x51bcce,_0x2905a6,_0x1e812a,'Inbound');})[_0x981a('0x2a')](function(_0x2b306b){if(_0x2b306b){logger[_0x981a('0x30')](_0x981a('0x86'),_0x2b306b['id']);logger[_0x981a('0x30')]('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x981a('0x32')](_0x981a('0x87'),_0x543dd6[_0x981a('0x19')]),'trigger:browser:url',{'uri':_0x981a('0x88')+_0x3e14d9[_0x981a('0x7b')]+_0x981a('0x89')+_0x2b306b['id']});}})[_0x981a('0x2d')](function(_0x320ba8){logger[_0x981a('0x2e')](_0x981a('0x7f'),JSON[_0x981a('0xd')](_0x320ba8));});};exports['outbound']=function(_0x63985b,_0x3d9883,_0x1bc2bb,_0x6e6040,_0x3c64b1,_0x466d11,_0x52d52b){var _0x44dcf2,_0x1a026f,_0xb38241;_0x466d11[_0x981a('0x7b')]=intUtil['stripTrailingSlash'](_0x466d11[_0x981a('0x7b')]);_0x466d11[_0x981a('0x7d')]=intUtil['stripTrailingSlash'](_0x466d11[_0x981a('0x7d')]);if(_0x52d52b&&_0x52d52b[_0x981a('0x8a')]&&_0x52d52b['recordingFormat']!==_0x981a('0x8b')){logger[_0x981a('0x30')](_0x981a('0x8c'),_0x981a('0x80'));_0x3d9883['recordingURL']=_0x466d11['serverUrl']+_0x981a('0x82')+_0x3d9883[_0x981a('0x83')]+_0x981a('0x84')+md5(_0x3d9883[_0x981a('0x83')]);}var _0x33f599=_0x466d11[_0x981a('0x7b')]===_0x981a('0x8d')?'eu':'com';return getAccessToken(_0x466d11)[_0x981a('0x2a')](function(_0x22bfca){_0xb38241=_0x22bfca;return getUser(_0xb38241,_0x33f599,_0x466d11,_0x6e6040[_0x981a('0x37')]);})[_0x981a('0x2a')](function(_0x49d17c){_0x44dcf2=_0x49d17c;logger[_0x981a('0x30')](_0x981a('0x85'),_0x44dcf2['id']);return getEndUser(_0xb38241,_0x33f599,_0x466d11,_0x3d9883[_0x981a('0x8e')],_0x3d9883[_0x981a('0x8f')],_0x44dcf2,_0x1bc2bb);})['then'](function(_0x21069b){_0x1a026f=_0x21069b;return getCall(_0xb38241,_0x33f599,_0x466d11,_0x44dcf2,_0x1a026f,_0x1bc2bb,_0x3d9883,'Outbound');})[_0x981a('0x2a')](function(_0x4704f6){if(_0x4704f6){logger['info'](_0x981a('0x86'),_0x4704f6['id']);logger[_0x981a('0x30')]('[OUTBOUND]',_0x981a('0x90'));emit(util[_0x981a('0x32')](_0x981a('0x87'),_0x6e6040['name']),_0x981a('0x91'),{'uri':_0x981a('0x88')+_0x466d11['host']+_0x981a('0x89')+_0x4704f6['id']});}})['catch'](function(_0x605927){logger[_0x981a('0x2e')](_0x981a('0x8c'),JSON['stringify'](_0x605927));});};exports['unmanaged']=function(_0x4b6871,_0x5d5e59,_0x5a046f,_0x5a267c,_0x1c2942,_0x2abc8f){var _0x31de0e,_0x335ac1,_0x2e6c00;_0x2abc8f[_0x981a('0x7b')]=intUtil[_0x981a('0x7c')](_0x2abc8f['host']);_0x2abc8f[_0x981a('0x7d')]=intUtil[_0x981a('0x7c')](_0x2abc8f[_0x981a('0x7d')]);if(_0x1c2942&&_0x1c2942[_0x981a('0x7e')]){logger[_0x981a('0x30')]('['+_0x5d5e59[_0x981a('0x92')][_0x981a('0x93')]()+']',_0x981a('0x80'));_0x5d5e59[_0x981a('0x81')]=_0x2abc8f[_0x981a('0x7d')]+_0x981a('0x82')+_0x5d5e59['uniqueid']+_0x981a('0x84')+md5(_0x5d5e59[_0x981a('0x83')]);}else{_0x5d5e59[_0x981a('0x81')]='';}var _0x36ef17=_0x2abc8f[_0x981a('0x7b')]===_0x981a('0x8d')?'eu':'com';return getAccessToken(_0x2abc8f)[_0x981a('0x2a')](function(_0x2559fa){_0x2e6c00=_0x2559fa;return getUser(_0x2e6c00,_0x36ef17,_0x2abc8f);})['then'](function(_0x4711d9){_0x31de0e=_0x4711d9;logger[_0x981a('0x30')](_0x981a('0x85'),_0x31de0e['id']);return getEndUser(_0x2e6c00,_0x36ef17,_0x2abc8f,_0x5d5e59[_0x981a('0x94')],_0x5d5e59[_0x981a('0x95')],_0x31de0e,_0x5a046f);})[_0x981a('0x2a')](function(_0x3c3202){_0x335ac1=_0x3c3202;return getCall(_0x2e6c00,_0x36ef17,_0x2abc8f,_0x31de0e,_0x335ac1,_0x5a046f,_0x5d5e59,_0x981a('0x96'));})[_0x981a('0x2a')](function(_0xae79ab){if(_0xae79ab){logger[_0x981a('0x30')](_0x981a('0x86'),_0xae79ab['id']);}})[_0x981a('0x2d')](function(_0x526d1d){logger['error']('['+_0x5d5e59['lastevent'][_0x981a('0x93')]()+']',JSON[_0x981a('0xd')](_0x526d1d));});}; \ 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 2470c8e..767c416 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 _0x8062=['exec','data2','Script','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x8062,0x74));var _0x2806=function(_0x46ddd3,_0x2f4887){_0x46ddd3=_0x46ddd3-0x0;var _0x3f7c8c=_0x8062[_0x46ddd3];return _0x3f7c8c;};'use strict';var util=require(_0x2806('0x0'));var sh=require(_0x2806('0x1'));var Mustache=require('mustache');var logger=require(_0x2806('0x2'))(_0x2806('0x3'));exports[_0x2806('0x4')]=function(_0x3fafd9,_0x3bbc3e){var _0x38a88a=_0x3fafd9['data2']?_0x3fafd9[_0x2806('0x5')]:_0x2806('0x6');var _0xab6da4=_0x3fafd9['data3']?Mustache[_0x2806('0x7')](_0x3fafd9['data3'],_0x3bbc3e):_0x3bbc3e;sh[_0x2806('0x4')](_0xab6da4,function(_0x2c31bb,_0x59ccf5,_0x32f7f7){if(_0x2c31bb!==0x0){logger[_0x2806('0x8')](util[_0x2806('0x9')](_0x2806('0xa'),_0x38a88a,_0xab6da4,_0x2c31bb,_0x32f7f7));}else{logger['info'](util['format'](_0x2806('0xb'),_0x38a88a,_0xab6da4,_0x59ccf5));}});}; \ No newline at end of file +var _0x9891=['data3','error','info','util','mustache','../../../../config/logger','exec','data2','Script'];(function(_0x284664,_0x455bfa){var _0x2e5d22=function(_0x40f40b){while(--_0x40f40b){_0x284664['push'](_0x284664['shift']());}};_0x2e5d22(++_0x455bfa);}(_0x9891,0x18f));var _0x1989=function(_0x254abd,_0x1ab7f0){_0x254abd=_0x254abd-0x0;var _0x31bf1b=_0x9891[_0x254abd];return _0x31bf1b;};'use strict';var util=require(_0x1989('0x0'));var sh=require('shelljs');var Mustache=require(_0x1989('0x1'));var logger=require(_0x1989('0x2'))('trigger');exports[_0x1989('0x3')]=function(_0x2da373,_0x16982a){var _0x554a81=_0x2da373[_0x1989('0x4')]?_0x2da373['data2']:_0x1989('0x5');var _0x3b6824=_0x2da373[_0x1989('0x6')]?Mustache['render'](_0x2da373[_0x1989('0x6')],_0x16982a):_0x16982a;sh[_0x1989('0x3')](_0x3b6824,function(_0x3cff58,_0x211c19,_0x440a9a){if(_0x3cff58!==0x0){logger[_0x1989('0x7')](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x554a81,_0x3b6824,_0x3cff58,_0x440a9a));}else{logger[_0x1989('0x8')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x554a81,_0x3b6824,_0x211c19));}});}; \ 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 b3cc21c..9071eb6 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 _0xaf43=['error','GET','POST','PUT','data7','body','stack','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','request-promise','util','mustache','../../../../config/logger','exec','data1','toUpperCase','render','data2','data5','number','headers','data6'];(function(_0x5e365e,_0x8ed4f1){var _0x1d9deb=function(_0x434d04){while(--_0x434d04){_0x5e365e['push'](_0x5e365e['shift']());}};_0x1d9deb(++_0x8ed4f1);}(_0xaf43,0x89));var _0x3af4=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xaf43[_0x57b54c];return _0x59cc19;};'use strict';var rp=require(_0x3af4('0x0'));var util=require(_0x3af4('0x1'));var _=require('lodash');var Mustache=require(_0x3af4('0x2'));var logger=require(_0x3af4('0x3'))('trigger');exports[_0x3af4('0x4')]=function(_0x39f0af,_0x562996){var _0xde834c,_0x42316d;var _0x441e09={'method':_0x39f0af[_0x3af4('0x5')][_0x3af4('0x6')](),'uri':Mustache[_0x3af4('0x7')](_0x39f0af[_0x3af4('0x8')],_0x562996),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x39f0af[_0x3af4('0x9')])===_0x3af4('0xa')&&parseInt(_0x39f0af['data5'])>=0x1&&parseInt(_0x39f0af[_0x3af4('0x9')])<=0xa?parseInt(_0x39f0af[_0x3af4('0x9')])*0x3e8:0x5*0x3e8};try{_0x441e09[_0x3af4('0xb')]=_0x39f0af[_0x3af4('0xc')]?JSON['parse'](Mustache['render'](_0x39f0af[_0x3af4('0xc')],_0x562996)):{};}catch(_0x5d5ab2){logger[_0x3af4('0xd')](_0x5d5ab2['stack']);}switch(_0x39f0af[_0x3af4('0x5')][_0x3af4('0x6')]()){case _0x3af4('0xe'):case'DELETE':_0xde834c=null;_0x441e09['qs']=_0x562996;break;case _0x3af4('0xf'):case _0x3af4('0x10'):if(_0x39f0af[_0x3af4('0x11')]){try{_0xde834c=JSON['parse'](Mustache[_0x3af4('0x7')](_0x39f0af[_0x3af4('0x11')],_0x562996));_0x441e09[_0x3af4('0x12')]=_0xde834c;}catch(_0xd749b5){logger[_0x3af4('0xd')](_0xd749b5[_0x3af4('0x13')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0xde834c=_0x562996;_0x441e09[_0x3af4('0x12')]=_0xde834c;}break;}logger[_0x3af4('0x14')](util[_0x3af4('0x15')](_0x3af4('0x16'),_0x39f0af['data1'],_0x39f0af[_0x3af4('0x8')],JSON[_0x3af4('0x17')](_0x441e09)));rp(_0x441e09)[_0x3af4('0x18')](function(_0x3b9530){_0xde834c=!_['isNil'](_0xde834c)?_0x3af4('0x19')+_0xde834c:'';_0x42316d=typeof _0x3b9530[_0x3af4('0x12')]==='object'?JSON[_0x3af4('0x17')](_0x3b9530[_0x3af4('0x12')]):_0x3b9530[_0x3af4('0x12')];logger[_0x3af4('0x14')](util[_0x3af4('0x15')](_0x3af4('0x1a'),_0x39f0af[_0x3af4('0x5')],_0x39f0af['data2'],_0x3b9530[_0x3af4('0x1b')],_0x42316d));})[_0x3af4('0x1c')](function(_0x5c2de7){logger[_0x3af4('0xd')](util[_0x3af4('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x39f0af[_0x3af4('0x5')],_0x39f0af[_0x3af4('0x8')],_0x5c2de7[_0x3af4('0x1b')],_0x5c2de7[_0x3af4('0x1d')],_0x5c2de7['message']));});}; \ No newline at end of file +var _0x21b1=['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','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data5','number','headers','parse','data6','error','stack','GET','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','data2','stringify'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0x21b1,0x187));var _0x121b=function(_0x2b066d,_0x3322f5){_0x2b066d=_0x2b066d-0x0;var _0x2ac386=_0x21b1[_0x2b066d];return _0x2ac386;};'use strict';var rp=require(_0x121b('0x0'));var util=require(_0x121b('0x1'));var _=require('lodash');var Mustache=require('mustache');var logger=require(_0x121b('0x2'))(_0x121b('0x3'));exports[_0x121b('0x4')]=function(_0x19244b,_0x29598a){var _0x579c5d,_0x168374;var _0x9b73ce={'method':_0x19244b[_0x121b('0x5')][_0x121b('0x6')](),'uri':Mustache[_0x121b('0x7')](_0x19244b['data2'],_0x29598a),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x19244b[_0x121b('0x8')])===_0x121b('0x9')&&parseInt(_0x19244b[_0x121b('0x8')])>=0x1&&parseInt(_0x19244b[_0x121b('0x8')])<=0xa?parseInt(_0x19244b[_0x121b('0x8')])*0x3e8:0x5*0x3e8};try{_0x9b73ce[_0x121b('0xa')]=_0x19244b['data6']?JSON[_0x121b('0xb')](Mustache[_0x121b('0x7')](_0x19244b[_0x121b('0xc')],_0x29598a)):{};}catch(_0x4f619b){logger[_0x121b('0xd')](_0x4f619b[_0x121b('0xe')]);}switch(_0x19244b['data1'][_0x121b('0x6')]()){case _0x121b('0xf'):case'DELETE':_0x579c5d=null;_0x9b73ce['qs']=_0x29598a;break;case _0x121b('0x10'):case _0x121b('0x11'):if(_0x19244b['data7']){try{_0x579c5d=JSON[_0x121b('0xb')](Mustache[_0x121b('0x7')](_0x19244b[_0x121b('0x12')],_0x29598a));_0x9b73ce['body']=_0x579c5d;}catch(_0x2c7229){logger['error'](_0x2c7229[_0x121b('0xe')]);logger['error'](_0x121b('0x13'));}}else{_0x579c5d=_0x29598a;_0x9b73ce[_0x121b('0x14')]=_0x579c5d;}break;}logger[_0x121b('0x15')](util[_0x121b('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x19244b['data1'],_0x19244b[_0x121b('0x17')],JSON[_0x121b('0x18')](_0x9b73ce)));rp(_0x9b73ce)['then'](function(_0x33ac17){_0x579c5d=!_['isNil'](_0x579c5d)?',\x20request\x20body:\x20'+_0x579c5d:'';_0x168374=typeof _0x33ac17[_0x121b('0x14')]===_0x121b('0x19')?JSON[_0x121b('0x18')](_0x33ac17[_0x121b('0x14')]):_0x33ac17['body'];logger[_0x121b('0x15')](util[_0x121b('0x16')](_0x121b('0x1a'),_0x19244b[_0x121b('0x5')],_0x19244b[_0x121b('0x17')],_0x33ac17[_0x121b('0x1b')],_0x168374));})[_0x121b('0x1c')](function(_0x590688){logger[_0x121b('0xd')](util[_0x121b('0x16')](_0x121b('0x1d'),_0x19244b[_0x121b('0x5')],_0x19244b[_0x121b('0x17')],_0x590688[_0x121b('0x1b')],_0x590688[_0x121b('0x1e')],_0x590688[_0x121b('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 55d04d3..e2075d1 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 _0x3912=['../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','catch','exports','jayson/promise','bluebird'];(function(_0xc62928,_0xc0d407){var _0x25c9d8=function(_0x1b7672){while(--_0x1b7672){_0xc62928['push'](_0xc62928['shift']());}};_0x25c9d8(++_0xc0d407);}(_0x3912,0x139));var _0x2391=function(_0x348d90,_0x3dab1d){_0x348d90=_0x348d90-0x0;var _0x21ce28=_0x3912[_0x348d90];return _0x21ce28;};'use strict';var jayson=require(_0x2391('0x0'));var BPromise=require(_0x2391('0x1'));var logger=require(_0x2391('0x2'))(_0x2391('0x3'));var client=jayson[_0x2391('0x4')][_0x2391('0x5')]({'port':0x2329});client[_0x2391('0x6')]=function(_0x35eb05,_0x4f50ca){return new BPromise(function(_0x122c90,_0x264b22){return client[_0x2391('0x7')](_0x35eb05,_0x4f50ca)[_0x2391('0x8')](function(_0x995f74){logger[_0x2391('0x9')](_0x2391('0xa'),_0x2391('0x3'),_0x35eb05,_0x4f50ca,_0x995f74);if(_0x995f74[_0x2391('0xb')]){logger[_0x2391('0xb')](_0x2391('0xa'),_0x2391('0x3'),_0x35eb05,_0x995f74[_0x2391('0xb')][_0x2391('0xc')],_0x4f50ca);return _0x264b22(_0x995f74['error']['message']);}else{return _0x122c90(_0x995f74['result']);}})[_0x2391('0xd')](function(_0x14872a){logger[_0x2391('0xb')](_0x2391('0xa'),_0x2391('0x3'),_0x35eb05,_0x14872a,_0x4f50ca);return _0x264b22(_0x14872a);});});};module[_0x2391('0xe')]=client; \ No newline at end of file +var _0x85e5=['debug','error','rpc','message','result','catch','exports','bluebird','routing','client','http'];(function(_0x1f5cba,_0x40ed1b){var _0x30a696=function(_0x2814f8){while(--_0x2814f8){_0x1f5cba['push'](_0x1f5cba['shift']());}};_0x30a696(++_0x40ed1b);}(_0x85e5,0x13b));var _0x585e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x85e5[_0x14add3];return _0x4a174f;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x585e('0x0'));var logger=require('../../config/logger')(_0x585e('0x1'));var client=jayson[_0x585e('0x2')][_0x585e('0x3')]({'port':0x2329});client['Request']=function(_0x4cdae4,_0x5f54af){return new BPromise(function(_0x3d25a4,_0x4b2566){return client['request'](_0x4cdae4,_0x5f54af)['then'](function(_0x4c24c2){logger[_0x585e('0x4')]('rpc',_0x585e('0x1'),_0x4cdae4,_0x5f54af,_0x4c24c2);if(_0x4c24c2[_0x585e('0x5')]){logger[_0x585e('0x5')](_0x585e('0x6'),'routing',_0x4cdae4,_0x4c24c2[_0x585e('0x5')]['message'],_0x5f54af);return _0x4b2566(_0x4c24c2['error'][_0x585e('0x7')]);}else{return _0x3d25a4(_0x4c24c2[_0x585e('0x8')]);}})[_0x585e('0x9')](function(_0x1994e7){logger['error'](_0x585e('0x6'),_0x585e('0x1'),_0x4cdae4,_0x1994e7,_0x5f54af);return _0x4b2566(_0x1994e7);});});};module[_0x585e('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 625ce3d..7e2c77b 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 _0x7582=['then','refresh','listen','getSettings','loginMailFrequency','Email\x20service\x20initialization','./lib/email','./rpc/mailAccount','../../config/logger','email','resolve'];(function(_0x2158a8,_0x335f85){var _0x4b1071=function(_0x2b9124){while(--_0x2b9124){_0x2158a8['push'](_0x2158a8['shift']());}};_0x4b1071(++_0x335f85);}(_0x7582,0xd7));var _0x2758=function(_0x15af0f,_0x5454ce){_0x15af0f=_0x15af0f-0x0;var _0x2bd1cb=_0x7582[_0x15af0f];return _0x2bd1cb;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0x2758('0x0'));var mailAccount=require(_0x2758('0x1'));var setting=require('./rpc/setting');var logger=require(_0x2758('0x2'))(_0x2758('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x2758('0x4')]()[_0x2758('0x5')](mailAccount['getMailAccounts']())[_0x2758('0x5')](realtime['initMailAccounts']())[_0x2758('0x5')](function(){email[_0x2758('0x6')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x2758('0x7')](realtime,email)['then'](function(){return initRealtime();})[_0x2758('0x5')](function(){return setting[_0x2758('0x8')]();})['then'](function(_0x54f42b){return setInterval(initRealtime,_0x54f42b[_0x2758('0x9')]*0x3e8);})['catch'](function(_0x5dff51){logger['error'](_0x2758('0xa'),_0x5dff51);});}main(); \ No newline at end of file +var _0x87b3=['refresh','listen','getSettings','loginMailFrequency','Email\x20service\x20initialization','./realtime','./lib/email','resolve','then','getMailAccounts','initMailAccounts'];(function(_0x45dc83,_0x22f371){var _0x4fd1a4=function(_0x329594){while(--_0x329594){_0x45dc83['push'](_0x45dc83['shift']());}};_0x4fd1a4(++_0x22f371);}(_0x87b3,0x144));var _0x387b=function(_0x75b171,_0x4f5de0){_0x75b171=_0x75b171-0x0;var _0x56c696=_0x87b3[_0x75b171];return _0x56c696;};'use strict';var server=require('./server');var Realtime=require(_0x387b('0x0'));var EmailChannel=require(_0x387b('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require('../../config/logger')('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x387b('0x2')]()[_0x387b('0x3')](mailAccount[_0x387b('0x4')]())[_0x387b('0x3')](realtime[_0x387b('0x5')]())[_0x387b('0x3')](function(){email[_0x387b('0x6')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x387b('0x7')](realtime,email)[_0x387b('0x3')](function(){return initRealtime();})[_0x387b('0x3')](function(){return setting[_0x387b('0x8')]();})[_0x387b('0x3')](function(_0x2f8b14){return setInterval(initRealtime,_0x2f8b14[_0x387b('0x9')]*0x3e8);})['catch'](function(_0x5845ee){logger['error'](_0x387b('0xa'),_0x5845ee);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index b4776b0..c87f2b3 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 _0x4e3c=['bluebird','md5','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','key','active','Imap','status','messageStatus','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','imapAccounts','bind','handleImapEmail','handleImapEnd','error','handleImapError','handleImapBox','connected','total','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','verifySmtp','Smtp','verified','verify'];(function(_0x27dce9,_0x10d2f8){var _0x1fec31=function(_0x6e3a9a){while(--_0x6e3a9a){_0x27dce9['push'](_0x27dce9['shift']());}};_0x1fec31(++_0x10d2f8);}(_0x4e3c,0x1a8));var _0xc4e3=function(_0x42276c,_0x141d47){_0x42276c=_0x42276c-0x0;var _0x1b5009=_0x4e3c[_0x42276c];return _0x1b5009;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xc4e3('0x0'));var md5=require(_0xc4e3('0x1'));var Redis=require('ioredis');var config=require(_0xc4e3('0x2'));var logger=require('../../../config/logger')(_0xc4e3('0x3'));config[_0xc4e3('0x4')]=_[_0xc4e3('0x5')](config[_0xc4e3('0x4')],{'host':_0xc4e3('0x6'),'port':0x18eb});var io=require(_0xc4e3('0x7'))(new Redis(config[_0xc4e3('0x4')]));var EmailImap=require(_0xc4e3('0x8'));var EmailSmtp=require(_0xc4e3('0x9'));var mailAccount=require(_0xc4e3('0xa'));var md5Accounts={};function EmailChannel(_0x3ac65a){logger[_0xc4e3('0xb')](_0xc4e3('0xc'));this['mailAccounts']=_0x3ac65a[_0xc4e3('0xd')];this['imapAccounts']={};this[_0xc4e3('0xe')]=new EmailSmtp();}EmailChannel[_0xc4e3('0xf')][_0xc4e3('0x10')]=function(_0xaba0d6){var _0x5c6cb5=this[_0xc4e3('0xd')][_0xaba0d6];var _0x3cd6e5={'id':_0x5c6cb5['id'],'name':_0x5c6cb5['name'],'key':_0x5c6cb5[_0xc4e3('0x11')],'active':_0x5c6cb5[_0xc4e3('0x12')],'Imap':{'status':_0x5c6cb5[_0xc4e3('0x13')][_0xc4e3('0x14')],'messageStatus':_0x5c6cb5[_0xc4e3('0x13')][_0xc4e3('0x15')],'total':_0x5c6cb5['Imap']['total']}};if(_[_0xc4e3('0x16')](md5Accounts[_0xaba0d6])){md5Accounts[_0xaba0d6]={};}var _0x32d175=md5(JSON[_0xc4e3('0x17')](_0x3cd6e5));if(md5Accounts[_0xaba0d6][_0xc4e3('0x1')]!==_0x32d175){md5Accounts[_0xaba0d6][_0xc4e3('0x1')]=_0x32d175;io[_0xc4e3('0x10')](_0xc4e3('0x18'),_0x3cd6e5);}};EmailChannel[_0xc4e3('0xf')][_0xc4e3('0x19')]=function(_0x4d769d){for(var _0x1b214a in _0x4d769d){if(_0x4d769d[_0xc4e3('0x1a')](_0x1b214a)){if(_0x4d769d[_0x1b214a][_0xc4e3('0x13')]&&_0x4d769d[_0x1b214a][_0xc4e3('0x12')]){var _0x297fd5=_0x4d769d[_0x1b214a]['Imap'];if(!_0x297fd5[_0xc4e3('0x1b')]&&_0x4d769d[_0x1b214a]['provider']!=='custom')_0x297fd5[_0xc4e3('0x1b')]=_0x4d769d[_0x1b214a][_0xc4e3('0x1c')];if(!this[_0xc4e3('0x1d')][_0xc4e3('0x1a')](_0x297fd5['id'])){this[_0xc4e3('0x1d')][_0x297fd5['id']]=new EmailImap(_0x297fd5,_0x4d769d[_0x1b214a][_0xc4e3('0x3')]);this[_0xc4e3('0x1d')][_0x297fd5['id']]['on']('box',this['handleImapBox'][_0xc4e3('0x1e')](this,_0x1b214a));this[_0xc4e3('0x1d')][_0x297fd5['id']]['on'](_0xc4e3('0x3'),this[_0xc4e3('0x1f')][_0xc4e3('0x1e')](this,_0x1b214a));this[_0xc4e3('0x1d')][_0x297fd5['id']]['on']('end',this[_0xc4e3('0x20')][_0xc4e3('0x1e')](this,_0x1b214a));this[_0xc4e3('0x1d')][_0x297fd5['id']]['on'](_0xc4e3('0x21'),this[_0xc4e3('0x22')]['bind'](this,_0x1b214a));}}else{if(_['isNil'](this[_0xc4e3('0xd')][_0x1b214a]['Imap'])){this[_0xc4e3('0xd')][_0x1b214a][_0xc4e3('0x13')]={};}this[_0xc4e3('0xd')][_0x1b214a][_0xc4e3('0x13')][_0xc4e3('0x14')]='disabled';this[_0xc4e3('0xd')][_0x1b214a][_0xc4e3('0x13')][_0xc4e3('0x15')]='';this[_0xc4e3('0x10')](_0x1b214a);}}}};EmailChannel['prototype'][_0xc4e3('0x23')]=function(_0x2288ca,_0x4587c1){if(this[_0xc4e3('0xd')][_0x2288ca]){this[_0xc4e3('0xd')][_0x2288ca][_0xc4e3('0x13')][_0xc4e3('0x14')]=_0xc4e3('0x24');this[_0xc4e3('0xd')][_0x2288ca][_0xc4e3('0x13')][_0xc4e3('0x15')]=_0x4587c1['name'];if(_0x4587c1['messages']){this['mailAccounts'][_0x2288ca][_0xc4e3('0x13')][_0xc4e3('0x25')]=_0x4587c1[_0xc4e3('0x26')][_0xc4e3('0x25')];}return this[_0xc4e3('0x10')](_0x2288ca);}};EmailChannel[_0xc4e3('0xf')][_0xc4e3('0x1f')]=function(_0x5d1933,_0x537640){logger[_0xc4e3('0xb')](_0xc4e3('0x27'),_0x537640['firstName'],_0x537640[_0xc4e3('0x28')],_0x537640[_0xc4e3('0x29')],_0x5d1933);if(this[_0xc4e3('0xd')][_0x5d1933]){return mailAccount[_0xc4e3('0x2a')](_0x5d1933,_0x537640)[_0xc4e3('0x2b')](function(_0x30bb49){if(_0x30bb49){logger[_0xc4e3('0xb')](_0xc4e3('0x2c'));}})[_0xc4e3('0x2d')](function(_0xa22d2c){logger[_0xc4e3('0x21')](_0xc4e3('0x2e'),JSON['stringify'](_0xa22d2c));});}};EmailChannel[_0xc4e3('0xf')][_0xc4e3('0x20')]=function(_0x3e15e8){if(this['mailAccounts'][_0x3e15e8]&&this['mailAccounts'][_0x3e15e8]['Imap']){if(this[_0xc4e3('0x1d')][this['mailAccounts'][_0x3e15e8][_0xc4e3('0x13')]['id']]){delete this[_0xc4e3('0x1d')][this[_0xc4e3('0xd')][_0x3e15e8][_0xc4e3('0x13')]['id']];}this[_0xc4e3('0xd')][_0x3e15e8][_0xc4e3('0x13')][_0xc4e3('0x2f')]=moment();this['emit'](_0x3e15e8);}};EmailChannel[_0xc4e3('0xf')][_0xc4e3('0x22')]=function(_0x3921ab,_0x1f0b91){if(this[_0xc4e3('0xd')][_0x3921ab]){this[_0xc4e3('0xd')][_0x3921ab][_0xc4e3('0x13')][_0xc4e3('0x14')]=_0xc4e3('0x21');this[_0xc4e3('0xd')][_0x3921ab][_0xc4e3('0x13')][_0xc4e3('0x15')]=_0x1f0b91;return this[_0xc4e3('0x10')](_0x3921ab);}};EmailChannel[_0xc4e3('0xf')]['sendMail']=function(_0x8c34ac,_0x355c6b){return this[_0xc4e3('0xe')][_0xc4e3('0x30')](_0x8c34ac,_0x355c6b);};EmailChannel[_0xc4e3('0xf')][_0xc4e3('0x31')]=function(_0x42ff7b){var _0x5d9a31=this;if(this[_0xc4e3('0xd')][_0x42ff7b['id']]){if(_['isNil'](this[_0xc4e3('0xd')][_0x42ff7b['id']]['Smtp'])){this[_0xc4e3('0xd')][_0x42ff7b['id']][_0xc4e3('0x32')]={};}this[_0xc4e3('0xd')][_0x42ff7b['id']][_0xc4e3('0x32')][_0xc4e3('0x2f')]=moment();return new BPromise(function(_0x4893ba,_0x26f5d9){return _0x5d9a31[_0xc4e3('0xe')]['verify'](_0x42ff7b)[_0xc4e3('0x2b')](function(_0x27634c){_0x5d9a31[_0xc4e3('0xd')][_0x42ff7b['id']][_0xc4e3('0x32')][_0xc4e3('0x14')]=_0xc4e3('0x33');_0x5d9a31['mailAccounts'][_0x42ff7b['id']][_0xc4e3('0x32')][_0xc4e3('0x15')]='';_0x5d9a31[_0xc4e3('0x10')](_0x42ff7b['id']);_0x4893ba(_0x27634c);})[_0xc4e3('0x2d')](function(_0x403c20){_0x5d9a31[_0xc4e3('0xd')][_0x42ff7b['id']][_0xc4e3('0x32')]['status']=_0xc4e3('0x21');_0x5d9a31[_0xc4e3('0xd')][_0x42ff7b['id']][_0xc4e3('0x32')]['messageStatus']=_0x403c20;_0x5d9a31[_0xc4e3('0x10')](_0x42ff7b['id']);_0x26f5d9(_0x403c20);});});}return this[_0xc4e3('0xe')][_0xc4e3('0x34')](_0x42ff7b);};module['exports']=EmailChannel; \ No newline at end of file +var _0xa6da=['name','key','active','Imap','status','messageStatus','total','isNil','stringify','refresh','hasOwnProperty','service','provider','custom','handleImapEmail','handleImapEnd','bind','error','handleImapError','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','Smtp','then','verified','verify','exports','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit'];(function(_0x4c0c1e,_0x36e0a9){var _0x447c5c=function(_0x5f2936){while(--_0x5f2936){_0x4c0c1e['push'](_0x4c0c1e['shift']());}};_0x447c5c(++_0x36e0a9);}(_0xa6da,0x8e));var _0xaa6d=function(_0x45d25a,_0x2cf82d){_0x45d25a=_0x45d25a-0x0;var _0x3c3381=_0xa6da[_0x45d25a];return _0x3c3381;};'use strict';var _=require(_0xaa6d('0x0'));var moment=require(_0xaa6d('0x1'));var BPromise=require(_0xaa6d('0x2'));var md5=require('md5');var Redis=require(_0xaa6d('0x3'));var config=require(_0xaa6d('0x4'));var logger=require(_0xaa6d('0x5'))(_0xaa6d('0x6'));config[_0xaa6d('0x7')]=_[_0xaa6d('0x8')](config['redis'],{'host':_0xaa6d('0x9'),'port':0x18eb});var io=require(_0xaa6d('0xa'))(new Redis(config[_0xaa6d('0x7')]));var EmailImap=require(_0xaa6d('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xaa6d('0xc'));var md5Accounts={};function EmailChannel(_0x56c48a){logger[_0xaa6d('0xd')](_0xaa6d('0xe'));this[_0xaa6d('0xf')]=_0x56c48a[_0xaa6d('0xf')];this[_0xaa6d('0x10')]={};this[_0xaa6d('0x11')]=new EmailSmtp();}EmailChannel[_0xaa6d('0x12')][_0xaa6d('0x13')]=function(_0x713d84){var _0x5c2a69=this['mailAccounts'][_0x713d84];var _0x596d5a={'id':_0x5c2a69['id'],'name':_0x5c2a69[_0xaa6d('0x14')],'key':_0x5c2a69[_0xaa6d('0x15')],'active':_0x5c2a69[_0xaa6d('0x16')],'Imap':{'status':_0x5c2a69[_0xaa6d('0x17')][_0xaa6d('0x18')],'messageStatus':_0x5c2a69[_0xaa6d('0x17')][_0xaa6d('0x19')],'total':_0x5c2a69[_0xaa6d('0x17')][_0xaa6d('0x1a')]}};if(_[_0xaa6d('0x1b')](md5Accounts[_0x713d84])){md5Accounts[_0x713d84]={};}var _0x3b590e=md5(JSON[_0xaa6d('0x1c')](_0x596d5a));if(md5Accounts[_0x713d84]['md5']!==_0x3b590e){md5Accounts[_0x713d84]['md5']=_0x3b590e;io['emit']('mailAccount:update',_0x596d5a);}};EmailChannel['prototype'][_0xaa6d('0x1d')]=function(_0x3c189c){for(var _0x392db0 in _0x3c189c){if(_0x3c189c[_0xaa6d('0x1e')](_0x392db0)){if(_0x3c189c[_0x392db0][_0xaa6d('0x17')]&&_0x3c189c[_0x392db0]['active']){var _0x596368=_0x3c189c[_0x392db0]['Imap'];if(!_0x596368[_0xaa6d('0x1f')]&&_0x3c189c[_0x392db0][_0xaa6d('0x20')]!==_0xaa6d('0x21'))_0x596368['service']=_0x3c189c[_0x392db0][_0xaa6d('0x20')];if(!this['imapAccounts']['hasOwnProperty'](_0x596368['id'])){this[_0xaa6d('0x10')][_0x596368['id']]=new EmailImap(_0x596368,_0x3c189c[_0x392db0][_0xaa6d('0x6')]);this[_0xaa6d('0x10')][_0x596368['id']]['on']('box',this['handleImapBox']['bind'](this,_0x392db0));this[_0xaa6d('0x10')][_0x596368['id']]['on'](_0xaa6d('0x6'),this[_0xaa6d('0x22')]['bind'](this,_0x392db0));this[_0xaa6d('0x10')][_0x596368['id']]['on']('end',this[_0xaa6d('0x23')][_0xaa6d('0x24')](this,_0x392db0));this[_0xaa6d('0x10')][_0x596368['id']]['on'](_0xaa6d('0x25'),this[_0xaa6d('0x26')]['bind'](this,_0x392db0));}}else{if(_['isNil'](this[_0xaa6d('0xf')][_0x392db0][_0xaa6d('0x17')])){this[_0xaa6d('0xf')][_0x392db0][_0xaa6d('0x17')]={};}this[_0xaa6d('0xf')][_0x392db0][_0xaa6d('0x17')]['status']='disabled';this[_0xaa6d('0xf')][_0x392db0][_0xaa6d('0x17')][_0xaa6d('0x19')]='';this['emit'](_0x392db0);}}}};EmailChannel[_0xaa6d('0x12')][_0xaa6d('0x27')]=function(_0x433a0,_0x34a3a1){if(this[_0xaa6d('0xf')][_0x433a0]){this['mailAccounts'][_0x433a0]['Imap'][_0xaa6d('0x18')]=_0xaa6d('0x28');this[_0xaa6d('0xf')][_0x433a0][_0xaa6d('0x17')][_0xaa6d('0x19')]=_0x34a3a1['name'];if(_0x34a3a1['messages']){this[_0xaa6d('0xf')][_0x433a0][_0xaa6d('0x17')][_0xaa6d('0x1a')]=_0x34a3a1[_0xaa6d('0x29')][_0xaa6d('0x1a')];}return this['emit'](_0x433a0);}};EmailChannel[_0xaa6d('0x12')][_0xaa6d('0x22')]=function(_0x1732b7,_0x5d2b2a){logger[_0xaa6d('0xd')](_0xaa6d('0x2a'),_0x5d2b2a['firstName'],_0x5d2b2a['lastName'],_0x5d2b2a['from'],_0x1732b7);if(this['mailAccounts'][_0x1732b7]){return mailAccount[_0xaa6d('0x2b')](_0x1732b7,_0x5d2b2a)['then'](function(_0x702a0b){if(_0x702a0b){logger[_0xaa6d('0xd')](_0xaa6d('0x2c'));}})[_0xaa6d('0x2d')](function(_0x4cd96e){logger[_0xaa6d('0x25')](_0xaa6d('0x2e'),JSON[_0xaa6d('0x1c')](_0x4cd96e));});}};EmailChannel[_0xaa6d('0x12')][_0xaa6d('0x23')]=function(_0x451cef){if(this['mailAccounts'][_0x451cef]&&this[_0xaa6d('0xf')][_0x451cef][_0xaa6d('0x17')]){if(this[_0xaa6d('0x10')][this[_0xaa6d('0xf')][_0x451cef][_0xaa6d('0x17')]['id']]){delete this[_0xaa6d('0x10')][this['mailAccounts'][_0x451cef][_0xaa6d('0x17')]['id']];}this[_0xaa6d('0xf')][_0x451cef][_0xaa6d('0x17')]['lastSync']=moment();this['emit'](_0x451cef);}};EmailChannel[_0xaa6d('0x12')]['handleImapError']=function(_0x1d1d06,_0xecb2b7){if(this[_0xaa6d('0xf')][_0x1d1d06]){this[_0xaa6d('0xf')][_0x1d1d06][_0xaa6d('0x17')][_0xaa6d('0x18')]=_0xaa6d('0x25');this[_0xaa6d('0xf')][_0x1d1d06]['Imap'][_0xaa6d('0x19')]=_0xecb2b7;return this[_0xaa6d('0x13')](_0x1d1d06);}};EmailChannel[_0xaa6d('0x12')][_0xaa6d('0x2f')]=function(_0x549a8b,_0x3de8d2){return this[_0xaa6d('0x11')][_0xaa6d('0x30')](_0x549a8b,_0x3de8d2);};EmailChannel[_0xaa6d('0x12')]['verifySmtp']=function(_0x27e5c1){var _0x4da10c=this;if(this[_0xaa6d('0xf')][_0x27e5c1['id']]){if(_[_0xaa6d('0x1b')](this[_0xaa6d('0xf')][_0x27e5c1['id']][_0xaa6d('0x31')])){this['mailAccounts'][_0x27e5c1['id']][_0xaa6d('0x31')]={};}this['mailAccounts'][_0x27e5c1['id']][_0xaa6d('0x31')]['lastSync']=moment();return new BPromise(function(_0x5a53c2,_0x37b0de){return _0x4da10c[_0xaa6d('0x11')]['verify'](_0x27e5c1)[_0xaa6d('0x32')](function(_0x221e55){_0x4da10c[_0xaa6d('0xf')][_0x27e5c1['id']][_0xaa6d('0x31')][_0xaa6d('0x18')]=_0xaa6d('0x33');_0x4da10c['mailAccounts'][_0x27e5c1['id']][_0xaa6d('0x31')][_0xaa6d('0x19')]='';_0x4da10c[_0xaa6d('0x13')](_0x27e5c1['id']);_0x5a53c2(_0x221e55);})[_0xaa6d('0x2d')](function(_0x4aa13b){_0x4da10c[_0xaa6d('0xf')][_0x27e5c1['id']][_0xaa6d('0x31')][_0xaa6d('0x18')]=_0xaa6d('0x25');_0x4da10c['mailAccounts'][_0x27e5c1['id']][_0xaa6d('0x31')][_0xaa6d('0x19')]=_0x4aa13b;_0x4da10c[_0xaa6d('0x13')](_0x27e5c1['id']);_0x37b0de(_0x4aa13b);});});}return this[_0xaa6d('0x11')][_0xaa6d('0x34')](_0x27e5c1);};module[_0xaa6d('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 4892eef..b03b926 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 _0x57ca=['handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','handleEnd','stringify','textCode','upperFirst','exports','util','imap','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','bind','end','error','handleError','connect','prototype','connTimeout','authTimeout','user','anonymous@xcally.com','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','handleReady','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','handleReadUnseen','length','message'];(function(_0x700b87,_0xefdcfa){var _0x1aa811=function(_0x331221){while(--_0x331221){_0x700b87['push'](_0x700b87['shift']());}};_0x1aa811(++_0xefdcfa);}(_0x57ca,0x108));var _0xa57c=function(_0x3bfedb,_0x574e2d){_0x3bfedb=_0x3bfedb-0x0;var _0x3fde7f=_0x57ca[_0x3bfedb];return _0x3fde7f;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var Imap=require(_0xa57c('0x1'));var simpleParser=require('mailparser')[_0xa57c('0x2')];var Iconv=require(_0xa57c('0x3'))[_0xa57c('0x4')];var EventEmitter=require(_0xa57c('0x5'))[_0xa57c('0x6')];var utils=require('./utils');var logger=require(_0xa57c('0x7'))(_0xa57c('0x8'));function EmailImap(_0x113dcf,_0x19473f){this[_0xa57c('0x9')]=_0xa57c('0xa');this[_0xa57c('0xb')]=this[_0xa57c('0xc')](_0x113dcf,_0x19473f);this['imap']=new Imap(this[_0xa57c('0xb')]);this['imap'][_0xa57c('0xd')](_0xa57c('0xe'),this['handleReady'][_0xa57c('0xf')](this));this['imap'][_0xa57c('0xd')](_0xa57c('0x10'),this['handleEnd'][_0xa57c('0xf')](this));this['imap']['on'](_0xa57c('0x11'),this[_0xa57c('0x12')][_0xa57c('0xf')](this));this[_0xa57c('0x1')][_0xa57c('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xa57c('0x14')]['getAccount']=function(_0x30d23d,_0x3d5995){var _0x30940d={'connTimeout':_0x30d23d[_0xa57c('0x15')]?_0x30d23d[_0xa57c('0x15')]*0x3e8:0x2710,'authTimeout':_0x30d23d[_0xa57c('0x16')]?_0x30d23d[_0xa57c('0x16')]*0x3e8:0x1388};if(_0x30d23d['service']){_0x30940d[_0xa57c('0x17')]=_0x30d23d[_0xa57c('0x17')];_0x30940d[_0xa57c('0x8')]=_0x3d5995||_0x30d23d['user']||_0xa57c('0x18');if(_0x30d23d['modernAuthentication']){_0x30940d[_0xa57c('0x19')]=utils[_0xa57c('0x1a')](_0x30d23d[_0xa57c('0x1b')][_0xa57c('0x1c')],_0x30d23d[_0xa57c('0x17')]);}else{_0x30940d[_0xa57c('0x1d')]=_0x30d23d[_0xa57c('0x1d')];}}else{if(_0x30d23d[_0xa57c('0x1e')]){_0x30940d['user']=_0x30d23d[_0xa57c('0x17')];_0x30940d['password']=_0x30d23d['password'];}}_0x30940d[_0xa57c('0x1f')]=_0x30d23d[_0xa57c('0x1f')];_0x30940d[_0xa57c('0x20')]=_0x30d23d[_0xa57c('0x20')]||0x3e1;if(_0x30d23d['tls']){_0x30940d[_0xa57c('0x21')]=!![];}else{_0x30940d[_0xa57c('0x21')]=![];_0x30940d[_0xa57c('0x22')]=_0xa57c('0x23');}return _0x30940d;};EmailImap[_0xa57c('0x14')][_0xa57c('0x24')]=function(){this[_0xa57c('0x1')][_0xa57c('0x25')](this[_0xa57c('0x9')],![],this[_0xa57c('0x26')][_0xa57c('0xf')](this));};EmailImap[_0xa57c('0x14')][_0xa57c('0x26')]=function(_0x10a33d,_0x431bec){if(_0x10a33d){this['handleError'](_0x10a33d,!![]);}else{this[_0xa57c('0x27')](_0xa57c('0x28'),_0x431bec);this[_0xa57c('0x29')]();}};EmailImap[_0xa57c('0x14')][_0xa57c('0x2a')]=function(_0x1e8e45){if(_0x1e8e45){this[_0xa57c('0x12')](_0x1e8e45,!![]);}else{this[_0xa57c('0x1')][_0xa57c('0x10')]();}};EmailImap[_0xa57c('0x14')]['readUnseen']=function(){this[_0xa57c('0x1')]['search'](['UNSEEN'],this[_0xa57c('0x2b')][_0xa57c('0xf')](this));};EmailImap['prototype'][_0xa57c('0x2b')]=function(_0x1ef331,_0x3eb9e9){if(_0x1ef331){this['handleError'](_0x1ef331,!![]);}else{if(_0x3eb9e9[_0xa57c('0x2c')]){try{var _0x58d46f=this[_0xa57c('0x1')]['fetch'](_0x3eb9e9,{'bodies':'','markSeen':!![]});_0x58d46f['on'](_0xa57c('0x2d'),this['handleFetchMessage'][_0xa57c('0xf')](this));_0x58d46f['once'](_0xa57c('0x11'),this[_0xa57c('0x2e')][_0xa57c('0xf')](this));_0x58d46f[_0xa57c('0xd')](_0xa57c('0x10'),this[_0xa57c('0x2f')][_0xa57c('0xf')](this));}catch(_0x5aa91e){logger[_0xa57c('0x11')](_0x5aa91e);}}else{this['imap'][_0xa57c('0x30')](!![],this[_0xa57c('0x2a')][_0xa57c('0xf')](this));}}};EmailImap['prototype'][_0xa57c('0x31')]=function(_0x4901a8){_0x4901a8['on'](_0xa57c('0x32'),this['handleMessageBody'][_0xa57c('0xf')](this));_0x4901a8['once'](_0xa57c('0x33'),this[_0xa57c('0x34')]['bind'](this));_0x4901a8[_0xa57c('0xd')]('end',this[_0xa57c('0x35')]['bind'](this));};EmailImap[_0xa57c('0x14')][_0xa57c('0x36')]=function(_0x205ee5){simpleParser(_0x205ee5,{'Iconv':Iconv},this[_0xa57c('0x37')][_0xa57c('0xf')](this));};EmailImap[_0xa57c('0x14')]['handleMessageAttributes']=function(){};EmailImap['prototype'][_0xa57c('0x35')]=function(){};EmailImap[_0xa57c('0x14')][_0xa57c('0x37')]=function(_0x570f6c,_0x12b644){if(_0x570f6c){logger['error'](_0x570f6c);}else{var _0x203228=this;utils[_0xa57c('0x38')](this['account'],_0x12b644,function(_0x558cf7){_0x203228['emit'](_0xa57c('0x8'),_0x558cf7);});}};EmailImap[_0xa57c('0x14')][_0xa57c('0x2f')]=function(){this[_0xa57c('0x1')][_0xa57c('0x30')](!![],this[_0xa57c('0x2a')]['bind'](this));};EmailImap[_0xa57c('0x14')][_0xa57c('0x2e')]=function(_0x5a5490){this['handleError'](_0x5a5490);this[_0xa57c('0x1')][_0xa57c('0x30')](!![],this['handleCloseBox'][_0xa57c('0xf')](this));};EmailImap[_0xa57c('0x14')][_0xa57c('0x39')]=function(){this[_0xa57c('0x27')](_0xa57c('0x10'));};EmailImap[_0xa57c('0x14')]['handleError']=function(_0xa7b441,_0x527c0f){logger['error']('handleError',this['account']['email'],JSON[_0xa57c('0x3a')](_0xa7b441));var _0x32ed25='';if(_0xa7b441){if(_0xa7b441[_0xa57c('0x3b')]){_0x32ed25=_0xa7b441['textCode'];}else{for(var _0x4cd045 in _0xa7b441){if(_0xa7b441['hasOwnProperty'](_0x4cd045)){_0x32ed25+=_[_0xa57c('0x3c')](_0x4cd045)+':\x20'+_0xa7b441[_0x4cd045]+'\x0a';}}}}if(_0x527c0f){this[_0xa57c('0x1')][_0xa57c('0x10')]();}else{this[_0xa57c('0x27')](_0xa57c('0x11'),_0x32ed25);this[_0xa57c('0x27')]('end');}};module[_0xa57c('0x3d')]=EmailImap; \ No newline at end of file +var _0x8e3f=['Iconv','EventEmitter','./utils','email','mailbox','account','getAccount','once','ready','handleReady','bind','end','error','connect','inherits','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','prototype','openBox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','handleEnd','stringify','hasOwnProperty','upperFirst','exports','lodash','util','imap','simpleParser','iconv'];(function(_0x18656b,_0x4c5940){var _0x5219d6=function(_0x1cb466){while(--_0x1cb466){_0x18656b['push'](_0x18656b['shift']());}};_0x5219d6(++_0x4c5940);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var Imap=require(_0xf8e3('0x2'));var simpleParser=require('mailparser')[_0xf8e3('0x3')];var Iconv=require(_0xf8e3('0x4'))[_0xf8e3('0x5')];var EventEmitter=require('events')[_0xf8e3('0x6')];var utils=require(_0xf8e3('0x7'));var logger=require('../../../config/logger')(_0xf8e3('0x8'));function EmailImap(_0xb21f8d,_0x2621c5){this[_0xf8e3('0x9')]='INBOX';this[_0xf8e3('0xa')]=this[_0xf8e3('0xb')](_0xb21f8d,_0x2621c5);this[_0xf8e3('0x2')]=new Imap(this[_0xf8e3('0xa')]);this[_0xf8e3('0x2')][_0xf8e3('0xc')](_0xf8e3('0xd'),this[_0xf8e3('0xe')][_0xf8e3('0xf')](this));this[_0xf8e3('0x2')][_0xf8e3('0xc')](_0xf8e3('0x10'),this['handleEnd'][_0xf8e3('0xf')](this));this[_0xf8e3('0x2')]['on'](_0xf8e3('0x11'),this['handleError'][_0xf8e3('0xf')](this));this[_0xf8e3('0x2')][_0xf8e3('0x12')]();}util[_0xf8e3('0x13')](EmailImap,EventEmitter);EmailImap['prototype'][_0xf8e3('0xb')]=function(_0xa856f5,_0x2fe631){var _0x4af736={'connTimeout':_0xa856f5[_0xf8e3('0x14')]?_0xa856f5['connTimeout']*0x3e8:0x2710,'authTimeout':_0xa856f5[_0xf8e3('0x15')]?_0xa856f5[_0xf8e3('0x15')]*0x3e8:0x1388};if(_0xa856f5[_0xf8e3('0x16')]){_0x4af736['user']=_0xa856f5['user'];_0x4af736[_0xf8e3('0x8')]=_0x2fe631||_0xa856f5[_0xf8e3('0x17')]||_0xf8e3('0x18');if(_0xa856f5[_0xf8e3('0x19')]){_0x4af736[_0xf8e3('0x1a')]=utils[_0xf8e3('0x1b')](_0xa856f5[_0xf8e3('0x1c')][_0xf8e3('0x1d')],_0xa856f5[_0xf8e3('0x17')]);}else{_0x4af736[_0xf8e3('0x1e')]=_0xa856f5['password'];}}else{if(_0xa856f5[_0xf8e3('0x1f')]){_0x4af736[_0xf8e3('0x17')]=_0xa856f5[_0xf8e3('0x17')];_0x4af736[_0xf8e3('0x1e')]=_0xa856f5[_0xf8e3('0x1e')];}}_0x4af736[_0xf8e3('0x20')]=_0xa856f5[_0xf8e3('0x20')];_0x4af736[_0xf8e3('0x21')]=_0xa856f5['port']||0x3e1;if(_0xa856f5[_0xf8e3('0x22')]){_0x4af736[_0xf8e3('0x22')]=!![];}else{_0x4af736[_0xf8e3('0x22')]=![];_0x4af736[_0xf8e3('0x23')]='required';}return _0x4af736;};EmailImap[_0xf8e3('0x24')]['handleReady']=function(){this[_0xf8e3('0x2')][_0xf8e3('0x25')](this[_0xf8e3('0x9')],![],this[_0xf8e3('0x26')][_0xf8e3('0xf')](this));};EmailImap[_0xf8e3('0x24')]['handleOpenBox']=function(_0x1b922f,_0x2fc674){if(_0x1b922f){this[_0xf8e3('0x27')](_0x1b922f,!![]);}else{this[_0xf8e3('0x28')](_0xf8e3('0x29'),_0x2fc674);this[_0xf8e3('0x2a')]();}};EmailImap[_0xf8e3('0x24')][_0xf8e3('0x2b')]=function(_0x56fa8e){if(_0x56fa8e){this[_0xf8e3('0x27')](_0x56fa8e,!![]);}else{this[_0xf8e3('0x2')][_0xf8e3('0x10')]();}};EmailImap[_0xf8e3('0x24')][_0xf8e3('0x2a')]=function(){this[_0xf8e3('0x2')][_0xf8e3('0x2c')]([_0xf8e3('0x2d')],this['handleReadUnseen'][_0xf8e3('0xf')](this));};EmailImap[_0xf8e3('0x24')][_0xf8e3('0x2e')]=function(_0x28b2f2,_0x567153){if(_0x28b2f2){this[_0xf8e3('0x27')](_0x28b2f2,!![]);}else{if(_0x567153[_0xf8e3('0x2f')]){try{var _0x40f64d=this[_0xf8e3('0x2')][_0xf8e3('0x30')](_0x567153,{'bodies':'','markSeen':!![]});_0x40f64d['on'](_0xf8e3('0x31'),this[_0xf8e3('0x32')][_0xf8e3('0xf')](this));_0x40f64d['once'](_0xf8e3('0x11'),this[_0xf8e3('0x33')]['bind'](this));_0x40f64d['once']('end',this[_0xf8e3('0x34')]['bind'](this));}catch(_0x2559ea){logger[_0xf8e3('0x11')](_0x2559ea);}}else{this[_0xf8e3('0x2')][_0xf8e3('0x35')](!![],this['handleCloseBox']['bind'](this));}}};EmailImap[_0xf8e3('0x24')][_0xf8e3('0x32')]=function(_0x42ad88){_0x42ad88['on'](_0xf8e3('0x36'),this[_0xf8e3('0x37')][_0xf8e3('0xf')](this));_0x42ad88['once'](_0xf8e3('0x38'),this['handleMessageAttributes']['bind'](this));_0x42ad88[_0xf8e3('0xc')](_0xf8e3('0x10'),this[_0xf8e3('0x39')][_0xf8e3('0xf')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x41138f){simpleParser(_0x41138f,{'Iconv':Iconv},this[_0xf8e3('0x3a')]['bind'](this));};EmailImap[_0xf8e3('0x24')][_0xf8e3('0x3b')]=function(){};EmailImap[_0xf8e3('0x24')][_0xf8e3('0x39')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x5d307e,_0x22b65e){if(_0x5d307e){logger[_0xf8e3('0x11')](_0x5d307e);}else{var _0x2b9ce6=this;utils[_0xf8e3('0x3c')](this['account'],_0x22b65e,function(_0xee2e34){_0x2b9ce6['emit'](_0xf8e3('0x8'),_0xee2e34);});}};EmailImap[_0xf8e3('0x24')][_0xf8e3('0x34')]=function(){this[_0xf8e3('0x2')][_0xf8e3('0x35')](!![],this[_0xf8e3('0x2b')][_0xf8e3('0xf')](this));};EmailImap[_0xf8e3('0x24')][_0xf8e3('0x33')]=function(_0x5a1501){this[_0xf8e3('0x27')](_0x5a1501);this['imap'][_0xf8e3('0x35')](!![],this[_0xf8e3('0x2b')][_0xf8e3('0xf')](this));};EmailImap[_0xf8e3('0x24')][_0xf8e3('0x3d')]=function(){this[_0xf8e3('0x28')](_0xf8e3('0x10'));};EmailImap[_0xf8e3('0x24')]['handleError']=function(_0x302d03,_0x108b81){logger[_0xf8e3('0x11')](_0xf8e3('0x27'),this[_0xf8e3('0xa')][_0xf8e3('0x8')],JSON[_0xf8e3('0x3e')](_0x302d03));var _0xe2cc91='';if(_0x302d03){if(_0x302d03['textCode']){_0xe2cc91=_0x302d03['textCode'];}else{for(var _0x5cf132 in _0x302d03){if(_0x302d03[_0xf8e3('0x3f')](_0x5cf132)){_0xe2cc91+=_[_0xf8e3('0x40')](_0x5cf132)+':\x20'+_0x302d03[_0x5cf132]+'\x0a';}}}}if(_0x108b81){this['imap'][_0xf8e3('0x10')]();}else{this['emit'](_0xf8e3('0x11'),_0xe2cc91);this[_0xf8e3('0x28')]('end');}};module[_0xf8e3('0x41')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index d964f0f..52fc350 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 _0xb3e7=['sendMail','toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb3e7,0x118));var _0x7b3e=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0xb3e7[_0x2df507];return _0x1f7167;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x7b3e('0x0'));function EmailSmtp(){}EmailSmtp[_0x7b3e('0x1')][_0x7b3e('0x2')]=function(_0x5f4320,_0x597795){return new Promise(function(_0x43c734,_0x1acf19){var _0x4fe4b9=nodemailer[_0x7b3e('0x3')](_0x5f4320);_0x4fe4b9[_0x7b3e('0x4')](_0x7b3e('0x5'),inlineBase64());_0x4fe4b9[_0x7b3e('0x6')](_0x597795,function(_0x4a7cf3,_0x5ce0f4){if(_0x4a7cf3){_0x1acf19(_0x4a7cf3[_0x7b3e('0x7')]());}else{_0x43c734(_0x5ce0f4);}});});};EmailSmtp['prototype'][_0x7b3e('0x8')]=function(_0x2ab5fc){return new Promise(function(_0x57b5a0,_0x45af86){var _0x2b093b=nodemailer[_0x7b3e('0x3')](_0x2ab5fc);_0x2b093b['verify'](function(_0x503f15,_0x53038c){if(_0x503f15){_0x45af86(_0x503f15[_0x7b3e('0x7')]());}else{if(_0x53038c){_0x57b5a0(_0x53038c);}else{_0x45af86(_0x7b3e('0x9'));}}});});};module[_0x7b3e('0xa')]=EmailSmtp; \ No newline at end of file +var _0xac70=['toString','verify','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile'];(function(_0x3ac0e8,_0x3d51c1){var _0x23dcd2=function(_0x14d20e){while(--_0x14d20e){_0x3ac0e8['push'](_0x3ac0e8['shift']());}};_0x23dcd2(++_0x3d51c1);}(_0xac70,0x17d));var _0x0ac7=function(_0x4c73ac,_0x46b73c){_0x4c73ac=_0x4c73ac-0x0;var _0x9839ee=_0xac70[_0x4c73ac];return _0x9839ee;};'use strict';var nodemailer=require(_0x0ac7('0x0'));var inlineBase64=require(_0x0ac7('0x1'));function EmailSmtp(){}EmailSmtp[_0x0ac7('0x2')][_0x0ac7('0x3')]=function(_0x22a164,_0x3b8093){return new Promise(function(_0xcd35e4,_0x5bc958){var _0x25d105=nodemailer[_0x0ac7('0x4')](_0x22a164);_0x25d105['use'](_0x0ac7('0x5'),inlineBase64());_0x25d105['sendMail'](_0x3b8093,function(_0x32cb03,_0x49b21b){if(_0x32cb03){_0x5bc958(_0x32cb03[_0x0ac7('0x6')]());}else{_0xcd35e4(_0x49b21b);}});});};EmailSmtp[_0x0ac7('0x2')][_0x0ac7('0x7')]=function(_0x359206){return new Promise(function(_0x453216,_0x13e01d){var _0x2b4d8c=nodemailer[_0x0ac7('0x4')](_0x359206);_0x2b4d8c[_0x0ac7('0x7')](function(_0x2a5ac1,_0x2c4844){if(_0x2a5ac1){_0x13e01d(_0x2a5ac1[_0x0ac7('0x6')]());}else{if(_0x2c4844){_0x453216(_0x2c4844);}else{_0x13e01d('Not\x20verifired');}}});});};module[_0x0ac7('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 564877d..41f2b1c 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 _0xfadf=['utf-8','toString','lodash','path','util','node-tnef','../../../config/logger','email','head','address','anonymous','generate','@xcally.com','value','name','split','length','slice','join','Anonymous','pop','isEmpty','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20'];(function(_0x40fc07,_0x2627f4){var _0x30bded=function(_0x5b87fa){while(--_0x5b87fa){_0x40fc07['push'](_0x40fc07['shift']());}};_0x30bded(++_0x2627f4);}(_0xfadf,0x9c));var _0xffad=function(_0x189198,_0x26d47a){_0x189198=_0x189198-0x0;var _0x1e681d=_0xfadf[_0x189198];return _0x1e681d;};'use strict';var _=require(_0xffad('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0xffad('0x1'));var util=require(_0xffad('0x2'));var tnef=require(_0xffad('0x3'));var logger=require(_0xffad('0x4'))(_0xffad('0x5'));var config=require('../../../config/environment');function getAddress(_0x5bc50f){var _0x57ffba=_[_0xffad('0x6')](_0x5bc50f['value']);return _0x57ffba&&_0x57ffba[_0xffad('0x7')]?_0x57ffba[_0xffad('0x7')]:_0xffad('0x8')+random[_0xffad('0x9')](0x6)+_0xffad('0xa');}function getFirstName(_0x3534fe){var _0x35219c=_['head'](_0x3534fe[_0xffad('0xb')]);if(_0x35219c&&_0x35219c['name']){if(_0x35219c['name']==_0x35219c['address']){return _0x35219c[_0xffad('0xc')]['substring'](0x0,_0x35219c['name']['indexOf']('@'));}var _0x2ab984=_0x35219c['name'][_0xffad('0xd')](/\s+/);return _0x2ab984[_0xffad('0xe')]>0x1?_0x2ab984[_0xffad('0xf')](0x0,-0x1)[_0xffad('0x10')]('\x20'):_0x35219c[_0xffad('0xc')];}return _0xffad('0x11');}function getLastName(_0x2b9314){var _0x486376=_['head'](_0x2b9314[_0xffad('0xb')]);if(_0x486376&&_0x486376[_0xffad('0xc')]){var _0xb675ea=_0x486376['name'][_0xffad('0xd')](/\s+/);return _0xb675ea[_0xffad('0xe')]>0x1?_0xb675ea[_0xffad('0x12')]():'';}return'';}function getMails(_0x1d5873,_0xd32f81){var _0x3ea107='';for(var _0x515805=0x0;_0x515805<_0xd32f81[_0xffad('0xb')]['length'];_0x515805+=0x1){if(_0xd32f81[_0xffad('0xb')][_0x515805]['address']!==_0x1d5873){if(!_[_0xffad('0x13')](_0x3ea107)){_0x3ea107+=',';}_0x3ea107+=_0xd32f81[_0xffad('0xb')][_0x515805][_0xffad('0xc')]||_0xd32f81[_0xffad('0xb')][_0x515805]['address']||'';_0x3ea107+='\x20<';_0x3ea107+=_0xd32f81[_0xffad('0xb')][_0x515805][_0xffad('0x7')]?_0xd32f81[_0xffad('0xb')][_0x515805][_0xffad('0x7')]:_0xffad('0x8')+random[_0xffad('0x9')](0x6)+'@xcally.com';_0x3ea107+='>';}}return _0x3ea107;}function parseEmail(_0x59d17f,_0x19b8d8,_0x403da2){if(_0x19b8d8[_0xffad('0x14')]){var _0x1241b3=/)<[^<]*)*<\/script>/gi;while(_0x1241b3[_0xffad('0x15')](_0x19b8d8['html'])){_0x19b8d8[_0xffad('0x14')]=_0x19b8d8['html'][_0xffad('0x16')](_0x1241b3,'');}if(_0x19b8d8[_0xffad('0x14')][_0xffad('0x17')](_0xffad('0x18'))){var _0x200222=[];_0x19b8d8[_0xffad('0x19')][_0xffad('0x1a')](_0x42a514=>{_0x200222[_0xffad('0x1b')](_0x42a514[_0xffad('0x1c')]);});var _0x3cc251=/]+>/g;var _0x4d9f01=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x9e6aaa=_0x19b8d8[_0xffad('0x14')][_0xffad('0x16')](_0x4d9f01,'_SRC');var _0x2ed9c2=_0x9e6aaa[_0xffad('0x16')](_0x3cc251,'_IMG');for(let _0x37c536=0x0;_0x37c536<_0x200222[_0xffad('0xe')];_0x37c536++){var _0x36d35f=_0x2ed9c2[_0xffad('0x16')](_0xffad('0x1d'),_0xffad('0x1e')+_0x200222[_0x37c536]+_0xffad('0x1f'));_0x2ed9c2=_0x36d35f;}_0x19b8d8[_0xffad('0x14')]=_0x2ed9c2;}_0x403da2[_0xffad('0x20')]=_0x19b8d8['html'];}else{_0x403da2['body']=_0x19b8d8['textAsHtml'];}if(_0x403da2[_0xffad('0x20')]){_0x403da2['body']=_0x403da2['body'][_0xffad('0x16')](/0x0){var _0xfd77b8=[_0xffad('0x32'),_0xffad('0x33'),_0xffad('0x34')];for(var _0x1a2435=0x0;_0x1a2435<_0x19b8d8['headerLines']['length'];_0x1a2435++){var _0x7429d0=_[_0xffad('0x35')](_0xfd77b8,_0x19b8d8[_0xffad('0x31')][_0x1a2435][_0xffad('0x36')]);if(_0x7429d0>=0x0){_0x403da2[_0xffad('0x37')]=!![];}}}return _0x403da2;}exports[_0xffad('0x38')]=function(_0x54f7db,_0x3aa5dd,_0xa90004){var _0x4eb01e={'from':getAddress(_0x3aa5dd['from']),'firstName':getFirstName(_0x3aa5dd[_0xffad('0x39')]),'lastName':getLastName(_0x3aa5dd[_0xffad('0x39')]),'mapKey':_0xffad('0x5'),'message':{'from':getMails(_0x54f7db['email'],_0x3aa5dd[_0xffad('0x39')]),'to':_0x54f7db[_0xffad('0x5')],'cc':'','subject':_0x3aa5dd['subject']||'','messageId':_0x3aa5dd[_0xffad('0x3a')],'inReplyTo':_0x3aa5dd['inReplyTo'],'sentAt':moment(_0x3aa5dd[_0xffad('0x3b')])[_0xffad('0x29')](_0xffad('0x3c')),'attach':![],'attachments':[]}};if(!_0x3aa5dd[_0xffad('0x14')]&&!_0x3aa5dd[_0xffad('0x3d')]){var _0x161497=_[_0xffad('0x3e')](_0x3aa5dd[_0xffad('0x19')],{'contentType':_0xffad('0x3f')});if(_0x161497[_0xffad('0xe')]){logger[_0xffad('0x40')](util['format'](_0xffad('0x41'),_0x3aa5dd[_0xffad('0x3a')]));tnef[_0xffad('0x42')](_['first'](_0x161497)['content'],function(_0x36017a,_0x129d3d){if(_0x129d3d){_0x3aa5dd[_0xffad('0x14')]=_0x129d3d[_0xffad('0x43')]||_0xffad('0x44');if(_0x129d3d['Attachments']){for(var _0x539fa4=0x0;_0x539fa4<_0x129d3d[_0xffad('0x45')][_0xffad('0xe')];_0x539fa4++){var _0x563a19=_0x129d3d[_0xffad('0x45')][_0x539fa4];_0x4eb01e[_0xffad('0x22')][_0xffad('0x19')][_0xffad('0x1b')]({'filename':_0x563a19[_0xffad('0x46')],'content':Buffer[_0xffad('0x39')](_0x563a19[_0xffad('0x47')])});}}}_0xa90004(parseEmail(_0x54f7db,_0x3aa5dd,_0x4eb01e));});}else{_0x3aa5dd[_0xffad('0x14')]='

Empty\x20message

';_0xa90004(parseEmail(_0x54f7db,_0x3aa5dd,_0x4eb01e));}}else{_0xa90004(parseEmail(_0x54f7db,_0x3aa5dd,_0x4eb01e));}};exports[_0xffad('0x48')]=function(_0x17aa18,_0x4447f1){var _0x1b6d9f=[_0xffad('0x49')+(_0x4447f1||''),_0xffad('0x4a')+_0x17aa18,'',''];return Buffer[_0xffad('0x39')](_0x1b6d9f[_0xffad('0x10')](''),_0xffad('0x4b'))[_0xffad('0x4c')]('base64');}; \ No newline at end of file +var _0x07c9=['indexOf','split','length','slice','Anonymous','isEmpty','@xcally.com','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','originCc','attachments','type','filename','attachment-','format','%s-%s','now','join','server/files/attachments/','writeFileSync','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','content','BodyHTML','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','utf-8','toString','base64','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','value','name'];(function(_0x4147ff,_0x154530){var _0x1e71e6=function(_0x21f992){while(--_0x21f992){_0x4147ff['push'](_0x4147ff['shift']());}};_0x1e71e6(++_0x154530);}(_0x07c9,0x14d));var _0x907c=function(_0x3c6a82,_0x2d7656){_0x3c6a82=_0x3c6a82-0x0;var _0x1fa3fe=_0x07c9[_0x3c6a82];return _0x1fa3fe;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0x907c('0x0'));var fs=require('fs');var path=require(_0x907c('0x1'));var util=require('util');var tnef=require(_0x907c('0x2'));var logger=require(_0x907c('0x3'))(_0x907c('0x4'));var config=require(_0x907c('0x5'));function getAddress(_0x4b3c41){var _0x481586=_[_0x907c('0x6')](_0x4b3c41['value']);return _0x481586&&_0x481586[_0x907c('0x7')]?_0x481586['address']:_0x907c('0x8')+random[_0x907c('0x9')](0x6)+'@xcally.com';}function getFirstName(_0x4478e7){var _0x490837=_[_0x907c('0x6')](_0x4478e7[_0x907c('0xa')]);if(_0x490837&&_0x490837[_0x907c('0xb')]){if(_0x490837[_0x907c('0xb')]==_0x490837[_0x907c('0x7')]){return _0x490837[_0x907c('0xb')]['substring'](0x0,_0x490837[_0x907c('0xb')][_0x907c('0xc')]('@'));}var _0x112df5=_0x490837['name'][_0x907c('0xd')](/\s+/);return _0x112df5[_0x907c('0xe')]>0x1?_0x112df5[_0x907c('0xf')](0x0,-0x1)['join']('\x20'):_0x490837['name'];}return _0x907c('0x10');}function getLastName(_0x464b4d){var _0x3bfe05=_['head'](_0x464b4d[_0x907c('0xa')]);if(_0x3bfe05&&_0x3bfe05[_0x907c('0xb')]){var _0x2b34a4=_0x3bfe05['name'][_0x907c('0xd')](/\s+/);return _0x2b34a4[_0x907c('0xe')]>0x1?_0x2b34a4['pop']():'';}return'';}function getMails(_0x885969,_0x304a03){var _0x1d4e64='';for(var _0x242474=0x0;_0x242474<_0x304a03[_0x907c('0xa')][_0x907c('0xe')];_0x242474+=0x1){if(_0x304a03['value'][_0x242474]['address']!==_0x885969){if(!_[_0x907c('0x11')](_0x1d4e64)){_0x1d4e64+=',';}_0x1d4e64+=_0x304a03[_0x907c('0xa')][_0x242474][_0x907c('0xb')]||_0x304a03[_0x907c('0xa')][_0x242474]['address']||'';_0x1d4e64+='\x20<';_0x1d4e64+=_0x304a03['value'][_0x242474][_0x907c('0x7')]?_0x304a03['value'][_0x242474]['address']:_0x907c('0x8')+random[_0x907c('0x9')](0x6)+_0x907c('0x12');_0x1d4e64+='>';}}return _0x1d4e64;}function parseEmail(_0x279a03,_0x3ba414,_0x5c3ea5){if(_0x3ba414[_0x907c('0x13')]){var _0x5000f6=/)<[^<]*)*<\/script>/gi;while(_0x5000f6[_0x907c('0x14')](_0x3ba414[_0x907c('0x13')])){_0x3ba414[_0x907c('0x13')]=_0x3ba414[_0x907c('0x13')][_0x907c('0x15')](_0x5000f6,'');}if(_0x3ba414[_0x907c('0x13')][_0x907c('0x16')](_0x907c('0x17'))){var _0x12860a=[];_0x3ba414['attachments']['forEach'](_0x53c68d=>{_0x12860a[_0x907c('0x18')](_0x53c68d['filename']);});var _0x5ee457=/]+>/g;var _0x59e64b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5100f9=_0x3ba414[_0x907c('0x13')][_0x907c('0x15')](_0x59e64b,'_SRC');var _0x4c556c=_0x5100f9[_0x907c('0x15')](_0x5ee457,'_IMG');for(let _0x844d17=0x0;_0x844d17<_0x12860a[_0x907c('0xe')];_0x844d17++){var _0x925201=_0x4c556c[_0x907c('0x15')](_0x907c('0x19'),_0x907c('0x1a')+_0x12860a[_0x844d17]+_0x907c('0x1b'));_0x4c556c=_0x925201;}_0x3ba414[_0x907c('0x13')]=_0x4c556c;}_0x5c3ea5[_0x907c('0x1c')]=_0x3ba414[_0x907c('0x13')];}else{_0x5c3ea5[_0x907c('0x1c')]=_0x3ba414[_0x907c('0x1d')];}if(_0x5c3ea5[_0x907c('0x1c')]){_0x5c3ea5[_0x907c('0x1c')]=_0x5c3ea5[_0x907c('0x1c')]['replace'](/0x0){var _0x1b4dc6=[_0x907c('0x2c'),_0x907c('0x2d'),_0x907c('0x2e')];for(var _0x5c4fb5=0x0;_0x5c4fb5<_0x3ba414[_0x907c('0x2b')]['length'];_0x5c4fb5++){var _0x43bdb5=_[_0x907c('0xc')](_0x1b4dc6,_0x3ba414['headerLines'][_0x5c4fb5][_0x907c('0x2f')]);if(_0x43bdb5>=0x0){_0x5c3ea5[_0x907c('0x30')]=!![];}}}return _0x5c3ea5;}exports[_0x907c('0x31')]=function(_0x9dcdba,_0x4fea1f,_0x15e284){var _0x58371c={'from':getAddress(_0x4fea1f[_0x907c('0x32')]),'firstName':getFirstName(_0x4fea1f['from']),'lastName':getLastName(_0x4fea1f['from']),'mapKey':_0x907c('0x4'),'message':{'from':getMails(_0x9dcdba[_0x907c('0x4')],_0x4fea1f[_0x907c('0x32')]),'to':_0x9dcdba[_0x907c('0x4')],'cc':'','subject':_0x4fea1f[_0x907c('0x33')]||'','messageId':_0x4fea1f[_0x907c('0x34')],'inReplyTo':_0x4fea1f[_0x907c('0x35')],'sentAt':moment(_0x4fea1f[_0x907c('0x36')])[_0x907c('0x25')](_0x907c('0x37')),'attach':![],'attachments':[]}};if(!_0x4fea1f[_0x907c('0x13')]&&!_0x4fea1f['textAsHtml']){var _0x835c93=_['filter'](_0x4fea1f['attachments'],{'contentType':_0x907c('0x38')});if(_0x835c93[_0x907c('0xe')]){logger[_0x907c('0x39')](util[_0x907c('0x25')](_0x907c('0x3a'),_0x4fea1f[_0x907c('0x34')]));tnef['parseBuffer'](_['first'](_0x835c93)[_0x907c('0x3b')],function(_0x496080,_0x33f03f){if(_0x33f03f){_0x4fea1f[_0x907c('0x13')]=_0x33f03f[_0x907c('0x3c')]||_0x907c('0x3d');if(_0x33f03f[_0x907c('0x3e')]){for(var _0x31d946=0x0;_0x31d946<_0x33f03f[_0x907c('0x3e')][_0x907c('0xe')];_0x31d946++){var _0x2bdecf=_0x33f03f[_0x907c('0x3e')][_0x31d946];_0x58371c[_0x907c('0x1e')]['attachments'][_0x907c('0x18')]({'filename':_0x2bdecf[_0x907c('0x3f')],'content':Buffer[_0x907c('0x32')](_0x2bdecf[_0x907c('0x40')])});}}}_0x15e284(parseEmail(_0x9dcdba,_0x4fea1f,_0x58371c));});}else{_0x4fea1f[_0x907c('0x13')]=_0x907c('0x3d');_0x15e284(parseEmail(_0x9dcdba,_0x4fea1f,_0x58371c));}}else{_0x15e284(parseEmail(_0x9dcdba,_0x4fea1f,_0x58371c));}};exports[_0x907c('0x41')]=function(_0x4fa965,_0x4b81c6){var _0x57bca6=['user='+(_0x4b81c6||''),'auth=Bearer\x20'+_0x4fa965,'',''];return Buffer[_0x907c('0x32')](_0x57bca6[_0x907c('0x28')](''),_0x907c('0x42'))[_0x907c('0x43')](_0x907c('0x44'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 3f5dce9..690bdcc 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 _0x41fc=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x1ad926,_0x3e1fed){var _0x1b81dc=function(_0x506f83){while(--_0x506f83){_0x1ad926['push'](_0x1ad926['shift']());}};_0x1b81dc(++_0x3e1fed);}(_0x41fc,0x134));var _0xc41f=function(_0x5baa70,_0x1463ff){_0x5baa70=_0x5baa70-0x0;var _0x34fca3=_0x41fc[_0x5baa70];return _0x34fca3;};'use strict';var _=require(_0xc41f('0x0'));function MailAccount(_0x31f80c){this['id']=_0x31f80c['id']||0x0;this['name']=_0x31f80c[_0xc41f('0x1')]||_0xc41f('0x2');this[_0xc41f('0x3')]=_0x31f80c[_0xc41f('0x3')]||_0xc41f('0x4');this[_0xc41f('0x5')]=_0x31f80c[_0xc41f('0x5')]||![];this[_0xc41f('0x6')]=_0x31f80c[_0xc41f('0x6')]||[];this['Smtp']=_0x31f80c[_0xc41f('0x7')]||[];}module[_0xc41f('0x8')]=MailAccount; \ No newline at end of file +var _0x481b=['Smtp','exports','name','key','SERV','active'];(function(_0x101d7d,_0x48fc92){var _0x4f3c11=function(_0x4dac70){while(--_0x4dac70){_0x101d7d['push'](_0x101d7d['shift']());}};_0x4f3c11(++_0x48fc92);}(_0x481b,0x16a));var _0xb481=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x481b[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');function MailAccount(_0x56d3ed){this['id']=_0x56d3ed['id']||0x0;this[_0xb481('0x0')]=_0x56d3ed[_0xb481('0x0')]||'Service';this[_0xb481('0x1')]=_0x56d3ed[_0xb481('0x1')]||_0xb481('0x2');this[_0xb481('0x3')]=_0x56d3ed[_0xb481('0x3')]||![];this['Imap']=_0x56d3ed['Imap']||[];this[_0xb481('0x4')]=_0x56d3ed[_0xb481('0x4')]||[];}module[_0xb481('0x5')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 50b52ce..9b836ab 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 _0x4959=['initMailAccounts','mailAccounts','length','isUndefined','merge','../model/mailAccount','prototype','mergeFromDatabase','hasOwnProperty'];(function(_0x6c6d17,_0x203165){var _0x425f24=function(_0x3fb7df){while(--_0x3fb7df){_0x6c6d17['push'](_0x6c6d17['shift']());}};_0x425f24(++_0x203165);}(_0x4959,0x1c7));var _0x9495=function(_0x2d9fd0,_0x32c85e){_0x2d9fd0=_0x2d9fd0-0x0;var _0xbf3cf2=_0x4959[_0x2d9fd0];return _0xbf3cf2;};'use strict';var _=require('lodash');var MailAccount=require(_0x9495('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x4cae86,_0x1f7885,_0x45f126){var _0x71cf7a=_['mapKeys'](_0x4cae86,function(_0x46df6b,_0x3e573a){return _0x46df6b[_0x45f126];});for(var _0x1ab5fc in _0x1f7885){if(_0x1f7885['hasOwnProperty'](_0x1ab5fc)){if(!_0x71cf7a[_0x1ab5fc]){delete _0x1f7885[_0x1ab5fc];}}}}Realtime[_0x9495('0x1')][_0x9495('0x2')]=function(_0x7af9fd,_0x4813a4){for(var _0x2316bb in _0x4813a4){if(_0x7af9fd[_0x9495('0x3')](_0x2316bb)){_0x7af9fd[_0x2316bb]=_0x4813a4[_0x2316bb];}}};Realtime['prototype'][_0x9495('0x4')]=function(){var _0x5c7e21=this;return function(_0x3734d2){if(_0x3734d2){freeIsNotKey(_0x3734d2,_0x5c7e21[_0x9495('0x5')],'id');for(var _0x376ef2=0x0,_0x273b77={},_0x5716a2={};_0x376ef2<_0x3734d2[_0x9495('0x6')];_0x376ef2+=0x1){_0x273b77=_0x3734d2[_0x376ef2];if(_[_0x9495('0x7')](_0x5c7e21[_0x9495('0x5')][_0x273b77['id']])){_0x5c7e21[_0x9495('0x5')][_0x273b77['id']]=new MailAccount(_0x273b77);}else{_[_0x9495('0x8')](_0x5c7e21[_0x9495('0x5')][_0x273b77['id']],_0x273b77);}}}return _0x5c7e21[_0x9495('0x5')];};};module['exports']=Realtime; \ No newline at end of file +var _0xcf64=['mergeFromDatabase','hasOwnProperty','length','isUndefined','merge','lodash','../model/mailAccount','mailAccounts','mapKeys','prototype'];(function(_0x45dd92,_0x2fd0b8){var _0x57301c=function(_0x4b6ed2){while(--_0x4b6ed2){_0x45dd92['push'](_0x45dd92['shift']());}};_0x57301c(++_0x2fd0b8);}(_0xcf64,0x127));var _0x4cf6=function(_0x6fb24e,_0x4bf202){_0x6fb24e=_0x6fb24e-0x0;var _0x5d4acc=_0xcf64[_0x6fb24e];return _0x5d4acc;};'use strict';var _=require(_0x4cf6('0x0'));var MailAccount=require(_0x4cf6('0x1'));var Realtime=function(){this[_0x4cf6('0x2')]={};};function freeIsNotKey(_0xb7f39d,_0x36d36f,_0xd69951){var _0xfbde0d=_[_0x4cf6('0x3')](_0xb7f39d,function(_0xded689,_0x244646){return _0xded689[_0xd69951];});for(var _0xbaa11d in _0x36d36f){if(_0x36d36f['hasOwnProperty'](_0xbaa11d)){if(!_0xfbde0d[_0xbaa11d]){delete _0x36d36f[_0xbaa11d];}}}}Realtime[_0x4cf6('0x4')][_0x4cf6('0x5')]=function(_0x3ca292,_0x41b721){for(var _0x4e8418 in _0x41b721){if(_0x3ca292[_0x4cf6('0x6')](_0x4e8418)){_0x3ca292[_0x4e8418]=_0x41b721[_0x4e8418];}}};Realtime[_0x4cf6('0x4')]['initMailAccounts']=function(){var _0x1ee8c8=this;return function(_0x4ae3a6){if(_0x4ae3a6){freeIsNotKey(_0x4ae3a6,_0x1ee8c8[_0x4cf6('0x2')],'id');for(var _0x12edad=0x0,_0x53ac23={},_0x446f6a={};_0x12edad<_0x4ae3a6[_0x4cf6('0x7')];_0x12edad+=0x1){_0x53ac23=_0x4ae3a6[_0x12edad];if(_[_0x4cf6('0x8')](_0x1ee8c8[_0x4cf6('0x2')][_0x53ac23['id']])){_0x1ee8c8[_0x4cf6('0x2')][_0x53ac23['id']]=new MailAccount(_0x53ac23);}else{_[_0x4cf6('0x9')](_0x1ee8c8[_0x4cf6('0x2')][_0x53ac23['id']],_0x53ac23);}}}return _0x1ee8c8['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 60a440c..bbabd6e 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 _0x2192=['GetMailAccount','name','provider','active','ListId','TemplateId','MailServerIn','Imap','CloudProvider','service','data5','MailServerOut','Smtp','type','getMailAccount','notify','Request','../client','getMailAccounts'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x2192,0x1a0));var _0x2219=function(_0x100476,_0x47ee74){_0x100476=_0x100476-0x0;var _0x5a6337=_0x2192[_0x100476];return _0x5a6337;};'use strict';var client=require(_0x2219('0x0'));exports[_0x2219('0x1')]=function(){return function(){return client['Request'](_0x2219('0x2'),{'options':{'attributes':['id',_0x2219('0x3'),_0x2219('0x4'),'service','email',_0x2219('0x5'),'key',_0x2219('0x6'),_0x2219('0x7')],'raw':![],'include':[{'model':_0x2219('0x8'),'as':_0x2219('0x9'),'include':[{'model':_0x2219('0xa'),'attributes':['id',_0x2219('0x3'),_0x2219('0xb'),'type',_0x2219('0xc')],'as':_0x2219('0xa')}]},{'model':_0x2219('0xd'),'as':_0x2219('0xe'),'include':[{'model':_0x2219('0xa'),'attributes':['id','name',_0x2219('0xb'),_0x2219('0xf'),_0x2219('0xc')],'as':_0x2219('0xa')}]}]},'log':_0x2219('0x10')});};};exports[_0x2219('0x11')]=function(_0x27b3d5,_0x51a51f){return client[_0x2219('0x12')]('NotifyMailAccount',{'account':{'id':_0x27b3d5},'body':_0x51a51f,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xab72=['service','type','data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','provider','email','active','key','ListId','TemplateId','Imap','CloudProvider','name'];(function(_0x5b2beb,_0x42cfa2){var _0x379a8e=function(_0x2dcab5){while(--_0x2dcab5){_0x5b2beb['push'](_0x5b2beb['shift']());}};_0x379a8e(++_0x42cfa2);}(_0xab72,0x71));var _0x2ab7=function(_0xdf9f20,_0x4c082){_0xdf9f20=_0xdf9f20-0x0;var _0x135b3c=_0xab72[_0xdf9f20];return _0x135b3c;};'use strict';var client=require(_0x2ab7('0x0'));exports[_0x2ab7('0x1')]=function(){return function(){return client[_0x2ab7('0x2')](_0x2ab7('0x3'),{'options':{'attributes':['id','name',_0x2ab7('0x4'),'service',_0x2ab7('0x5'),_0x2ab7('0x6'),_0x2ab7('0x7'),_0x2ab7('0x8'),_0x2ab7('0x9')],'raw':![],'include':[{'model':'MailServerIn','as':_0x2ab7('0xa'),'include':[{'model':_0x2ab7('0xb'),'attributes':['id',_0x2ab7('0xc'),_0x2ab7('0xd'),_0x2ab7('0xe'),_0x2ab7('0xf')],'as':'CloudProvider'}]},{'model':_0x2ab7('0x10'),'as':_0x2ab7('0x11'),'include':[{'model':_0x2ab7('0xb'),'attributes':['id',_0x2ab7('0xc'),_0x2ab7('0xd'),_0x2ab7('0xe'),_0x2ab7('0xf')],'as':_0x2ab7('0xb')}]}]},'log':_0x2ab7('0x12')});};};exports[_0x2ab7('0x13')]=function(_0x46fba4,_0xa3f903){return client[_0x2ab7('0x2')](_0x2ab7('0x14'),{'account':{'id':_0x46fba4},'body':_0xa3f903,'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 ac3b386..bd71de3 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 _0xfddf=['GetSettings','Request','loginMailFrequency'];(function(_0x10bfec,_0x382005){var _0x2d78e2=function(_0x53af3b){while(--_0x53af3b){_0x10bfec['push'](_0x10bfec['shift']());}};_0x2d78e2(++_0x382005);}(_0xfddf,0x196));var _0xffdd=function(_0x17e652,_0x16a06e){_0x17e652=_0x17e652-0x0;var _0x48bcf2=_0xfddf[_0x17e652];return _0x48bcf2;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0xffdd('0x0')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xffdd('0x1')]},'log':_0xffdd('0x2')});}; \ No newline at end of file +var _0x2676=['GetSettings','../client','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x2676,0x163));var _0x6267=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2676[_0x21a9d9];return _0x46adce;};'use strict';var client=require(_0x6267('0x0'));exports[_0x6267('0x1')]=function(){return client[_0x6267('0x2')](_0x6267('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x6267('0x4')]},'log':_0x6267('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 686b45f..0f7d235 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 b8696c9..23efe7a 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 _0x6b50=['websocket','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','../../config/environment','createServer','listen','port','socket.io'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x6b50,0xcb));var _0x06b5=function(_0x394e1e,_0xd62051){_0x394e1e=_0x394e1e-0x0;var _0x304744=_0x6b50[_0x394e1e];return _0x304744;};'use strict';var _=require('lodash');var http=require(_0x06b5('0x0'));var express=require(_0x06b5('0x1'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0x06b5('0x2'));var app=express();var server=http[_0x06b5('0x3')](app);server['timeout']=0xdbba0;if(sticky[_0x06b5('0x4')](server,config[_0x06b5('0x5')])){var socketio=require(_0x06b5('0x6'))(server,{'transports':[_0x06b5('0x7'),'polling']});config[_0x06b5('0x8')]=_[_0x06b5('0x9')](config[_0x06b5('0x8')],{'host':_0x06b5('0xa'),'port':0x18eb});socketio[_0x06b5('0xb')](require(_0x06b5('0xc'))({'pubClient':new Redis(config[_0x06b5('0x8')]),'subClient':new Redis(config[_0x06b5('0x8')])}));require(_0x06b5('0xd'))[_0x06b5('0xe')]();require(_0x06b5('0xf'))[_0x06b5('0xe')](socketio);require(_0x06b5('0x10'))[_0x06b5('0xe')](app);require(_0x06b5('0x11'))['default'](app);}else{server['once']('listening',function(){console[_0x06b5('0x12')](_0x06b5('0x13'),config[_0x06b5('0x5')]);});}exports=module[_0x06b5('0x14')]=app; \ No newline at end of file +var _0x9e7b=['exports','http','express','sticky-session','ioredis','createServer','listen','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','default','../../config/socketio','../../config/express','log','Express\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x183b78,_0x4c2fae){var _0x30750f=function(_0x471836){while(--_0x471836){_0x183b78['push'](_0x183b78['shift']());}};_0x30750f(++_0x4c2fae);}(_0x9e7b,0x112));var _0xb9e7=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x9e7b[_0x49b207];return _0x2dc8fa;};'use strict';var _=require('lodash');var http=require(_0xb9e7('0x0'));var express=require(_0xb9e7('0x1'));var sticky=require(_0xb9e7('0x2'));var Redis=require(_0xb9e7('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0xb9e7('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0xb9e7('0x5')](server,config[_0xb9e7('0x6')])){var socketio=require(_0xb9e7('0x7'))(server,{'transports':[_0xb9e7('0x8'),_0xb9e7('0x9')]});config[_0xb9e7('0xa')]=_[_0xb9e7('0xb')](config['redis'],{'host':_0xb9e7('0xc'),'port':0x18eb});socketio[_0xb9e7('0xd')](require(_0xb9e7('0xe'))({'pubClient':new Redis(config[_0xb9e7('0xa')]),'subClient':new Redis(config[_0xb9e7('0xa')])}));require('../../config/triggers')[_0xb9e7('0xf')]();require(_0xb9e7('0x10'))[_0xb9e7('0xf')](socketio);require(_0xb9e7('0x11'))['default'](app);require('../../routes')[_0xb9e7('0xf')](app);}else{server['once']('listening',function(){console[_0xb9e7('0x12')](_0xb9e7('0x13'),config[_0xb9e7('0x6')]);});}exports=module[_0xb9e7('0x14')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index df74876..2106006 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 _0x8712=['routing','client','http','debug','rpc','error','message','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x288581,_0x580fb5){var _0x1a732b=function(_0x54e136){while(--_0x54e136){_0x288581['push'](_0x288581['shift']());}};_0x1a732b(++_0x580fb5);}(_0x8712,0x14d));var _0x2871=function(_0x3ce2e0,_0x180fc7){_0x3ce2e0=_0x3ce2e0-0x0;var _0x3fa89b=_0x8712[_0x3ce2e0];return _0x3fa89b;};'use strict';var jayson=require(_0x2871('0x0'));var BPromise=require(_0x2871('0x1'));var logger=require(_0x2871('0x2'))(_0x2871('0x3'));var client=jayson[_0x2871('0x4')][_0x2871('0x5')]({'port':0x2329});client['Request']=function(_0x14f598,_0x20d60a){return new BPromise(function(_0x4e612e,_0x1e6f2b){return client['request'](_0x14f598,_0x20d60a)['then'](function(_0x3b3f05){logger[_0x2871('0x6')](_0x2871('0x7'),_0x2871('0x3'),_0x14f598,_0x20d60a,_0x3b3f05);if(_0x3b3f05[_0x2871('0x8')]){logger[_0x2871('0x8')]('rpc',_0x2871('0x3'),_0x14f598,_0x3b3f05[_0x2871('0x8')][_0x2871('0x9')],_0x20d60a);return _0x1e6f2b(_0x3b3f05[_0x2871('0x8')][_0x2871('0x9')]);}else{return _0x4e612e(_0x3b3f05['result']);}})[_0x2871('0xa')](function(_0x116522){logger[_0x2871('0x8')](_0x2871('0x7'),_0x2871('0x3'),_0x14f598,_0x116522,_0x20d60a);return _0x1e6f2b(_0x116522);});});};module[_0x2871('0xb')]=client; \ No newline at end of file +var _0xdd02=['exports','jayson/promise','../../config/logger','routing','http','Request','request','then','debug','rpc','error','message','result'];(function(_0x553caf,_0x2d52f6){var _0x3bea12=function(_0x40bea3){while(--_0x40bea3){_0x553caf['push'](_0x553caf['shift']());}};_0x3bea12(++_0x2d52f6);}(_0xdd02,0xc4));var _0x2dd0=function(_0x182619,_0x11b0fc){_0x182619=_0x182619-0x0;var _0x449c2d=_0xdd02[_0x182619];return _0x449c2d;};'use strict';var jayson=require(_0x2dd0('0x0'));var BPromise=require('bluebird');var logger=require(_0x2dd0('0x1'))(_0x2dd0('0x2'));var client=jayson['client'][_0x2dd0('0x3')]({'port':0x2329});client[_0x2dd0('0x4')]=function(_0x1eab10,_0x5c7537){return new BPromise(function(_0x42305a,_0xee8c33){return client[_0x2dd0('0x5')](_0x1eab10,_0x5c7537)[_0x2dd0('0x6')](function(_0x346656){logger[_0x2dd0('0x7')](_0x2dd0('0x8'),'routing',_0x1eab10,_0x5c7537,_0x346656);if(_0x346656[_0x2dd0('0x9')]){logger[_0x2dd0('0x9')](_0x2dd0('0x8'),'routing',_0x1eab10,_0x346656[_0x2dd0('0x9')][_0x2dd0('0xa')],_0x5c7537);return _0xee8c33(_0x346656[_0x2dd0('0x9')][_0x2dd0('0xa')]);}else{return _0x42305a(_0x346656[_0x2dd0('0xb')]);}})['catch'](function(_0x3c0543){logger[_0x2dd0('0x9')](_0x2dd0('0x8'),_0x2dd0('0x2'),_0x1eab10,_0x3c0543,_0x5c7537);return _0xee8c33(_0x3c0543);});});};module[_0x2dd0('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 74f185a..eafa9df 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 _0xb6ad=['./server','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initWhatsappQueues','listen','catch','log','bluebird'];(function(_0x299466,_0x351a2d){var _0x343bff=function(_0x172418){while(--_0x172418){_0x299466['push'](_0x299466['shift']());}};_0x343bff(++_0x351a2d);}(_0xb6ad,0x7c));var _0xdb6a=function(_0x1f1b36,_0x5c33ce){_0x1f1b36=_0x1f1b36-0x0;var _0x283be1=_0xb6ad[_0x1f1b36];return _0x283be1;};'use strict';var BPromise=require(_0xdb6a('0x0'));var server=require(_0xdb6a('0x1'));var Realtime=require('./realtime');var user=require(_0xdb6a('0x2'));var interval=require(_0xdb6a('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xdb6a('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xdb6a('0x5'));var faxQueue=require(_0xdb6a('0x6'));var whatsappQueue=require(_0xdb6a('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xdb6a('0x8')]()[_0xdb6a('0x9')](user['getAgents']())[_0xdb6a('0x9')](realtime[_0xdb6a('0xa')]())['then'](interval[_0xdb6a('0xb')]())[_0xdb6a('0x9')](realtime[_0xdb6a('0xc')]())[_0xdb6a('0x9')](openchannelQueue[_0xdb6a('0xd')]())['then'](realtime[_0xdb6a('0xe')]())[_0xdb6a('0x9')](chatQueue[_0xdb6a('0xf')]())[_0xdb6a('0x9')](realtime['initChatQueues']())[_0xdb6a('0x9')](smsQueue[_0xdb6a('0x10')]())[_0xdb6a('0x9')](realtime[_0xdb6a('0x11')]())[_0xdb6a('0x9')](mailQueue[_0xdb6a('0x12')]())['then'](realtime[_0xdb6a('0x13')]())[_0xdb6a('0x9')](faxQueue[_0xdb6a('0x14')]())[_0xdb6a('0x9')](realtime['initFaxQueues']())[_0xdb6a('0x9')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0xdb6a('0x15')]())['then'](function(){return realtime;});}function main(){return server[_0xdb6a('0x16')](realtime)[_0xdb6a('0x9')](function(_0x3a5bd7){return initRealtime();})[_0xdb6a('0x9')](function(_0x4b4ffd){return setInterval(initRealtime,0x1388);})[_0xdb6a('0x17')](function(_0x1ecf6d){console[_0xdb6a('0x18')](_0x1ecf6d);});}main(); \ No newline at end of file +var _0x1382=['bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','resolve','then','getAgents','getIntervals','initIntervals','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x1382,0xa0));var _0x2138=function(_0x271eaa,_0x4b427f){_0x271eaa=_0x271eaa-0x0;var _0x1b09b4=_0x1382[_0x271eaa];return _0x1b09b4;};'use strict';var BPromise=require(_0x2138('0x0'));var server=require('./server');var Realtime=require(_0x2138('0x1'));var user=require(_0x2138('0x2'));var interval=require(_0x2138('0x3'));var openchannelQueue=require(_0x2138('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x2138('0x5')]()[_0x2138('0x6')](user[_0x2138('0x7')]())[_0x2138('0x6')](realtime['initAgents']())[_0x2138('0x6')](interval[_0x2138('0x8')]())[_0x2138('0x6')](realtime[_0x2138('0x9')]())[_0x2138('0x6')](openchannelQueue['getOpenchannelQueues']())[_0x2138('0x6')](realtime['initOpenchannelQueues']())[_0x2138('0x6')](chatQueue['getChatQueues']())['then'](realtime[_0x2138('0xa')]())[_0x2138('0x6')](smsQueue[_0x2138('0xb')]())[_0x2138('0x6')](realtime[_0x2138('0xc')]())[_0x2138('0x6')](mailQueue['getMailQueues']())['then'](realtime[_0x2138('0xd')]())[_0x2138('0x6')](faxQueue['getFaxQueues']())[_0x2138('0x6')](realtime[_0x2138('0xe')]())['then'](whatsappQueue[_0x2138('0xf')]())[_0x2138('0x6')](realtime[_0x2138('0x10')]())[_0x2138('0x6')](function(){return realtime;});}function main(){return server[_0x2138('0x11')](realtime)['then'](function(_0x259161){return initRealtime();})[_0x2138('0x6')](function(_0x290b66){return setInterval(initRealtime,0x1388);})[_0x2138('0x12')](function(_0x26aa49){console[_0x2138('0x13')](_0x26aa49);});}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 fd0964d..8b84332 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 _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x3de1f5,_0x2886a5){var _0x2fedf6=function(_0xe88d18){while(--_0xe88d18){_0x3de1f5['push'](_0x3de1f5['shift']());}};_0x2fedf6(++_0x2886a5);}(_0xe14b,0x93));var _0xbe14=function(_0x10cf5d,_0x396a02){_0x10cf5d=_0x10cf5d-0x0;var _0x5b9d4b=_0xe14b[_0x10cf5d];return _0x5b9d4b;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x5ebd54,_0x928763){var _0x5f53f5=function(_0x380b5f){while(--_0x380b5f){_0x5ebd54['push'](_0x5ebd54['shift']());}};_0x5f53f5(++_0x928763);}(_0x326f,0xd1));var _0xf326=function(_0x13b3ea,_0x2a54ac){_0x13b3ea=_0x13b3ea-0x0;var _0x49f6d3=_0x326f[_0x13b3ea];return _0x49f6d3;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 83e8c87..77cd160 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 _0x81ad=['error','message','result','catch','SendMail','bluebird','jayson/promise','client','http','request'];(function(_0x44e63c,_0x506148){var _0x4de6f0=function(_0x3de30b){while(--_0x3de30b){_0x44e63c['push'](_0x44e63c['shift']());}};_0x4de6f0(++_0x506148);}(_0x81ad,0xaf));var _0xd81a=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0x81ad[_0x2601b4];return _0x3e3661;};'use strict';var BPromise=require(_0xd81a('0x0'));var jayson=require(_0xd81a('0x1'));var client=jayson[_0xd81a('0x2')][_0xd81a('0x3')]({'port':0x232b});function request(_0xd25574,_0x2b772a){return new BPromise(function(_0x2a69cc,_0x7b72f0){return client[_0xd81a('0x4')](_0xd25574,_0x2b772a)['then'](function(_0x586f26){if(_0x586f26['error']){return _0x7b72f0(_0x586f26[_0xd81a('0x5')][_0xd81a('0x6')]);}else{return _0x2a69cc(_0x586f26[_0xd81a('0x7')]);}})[_0xd81a('0x8')](function(_0x527b55){return _0x7b72f0(_0x527b55);});});}exports['sendMailMessage']=function(_0x6e15fa,_0x4b0b05){return request(_0xd81a('0x9'),{'account':_0x6e15fa,'message':_0x4b0b05});}; \ No newline at end of file +var _0x6a21=['http','request','error','message','result','catch','sendMailMessage','SendMail','bluebird','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a21,0x76));var _0x16a2=function(_0x3bad90,_0x14744d){_0x3bad90=_0x3bad90-0x0;var _0x15a054=_0x6a21[_0x3bad90];return _0x15a054;};'use strict';var BPromise=require(_0x16a2('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x16a2('0x1')][_0x16a2('0x2')]({'port':0x232b});function request(_0x4c6038,_0x4c40e8){return new BPromise(function(_0x42eaae,_0x37966c){return client[_0x16a2('0x3')](_0x4c6038,_0x4c40e8)['then'](function(_0x51c8fc){if(_0x51c8fc[_0x16a2('0x4')]){return _0x37966c(_0x51c8fc[_0x16a2('0x4')][_0x16a2('0x5')]);}else{return _0x42eaae(_0x51c8fc[_0x16a2('0x6')]);}})[_0x16a2('0x7')](function(_0x374e48){return _0x37966c(_0x374e48);});});}exports[_0x16a2('0x8')]=function(_0x3f0c23,_0x323412){return request(_0x16a2('0x9'),{'account':_0x3f0c23,'message':_0x323412});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 608da7b..232c8f1 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 _0x23a2=['openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','openchannel','fax','sms','whatsapp','length','Status','StatusTime','format','chatStatusTime','mailStatusTime','openchannelStatus','openchannelStatusTime','emit','user:save','exports','lodash','md5','ioredis','../../../config/environment','redis','socket.io-emitter','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelCapacity'];(function(_0xc0f3d0,_0x4cfe98){var _0x1798ba=function(_0xa3446d){while(--_0xa3446d){_0xc0f3d0['push'](_0xc0f3d0['shift']());}};_0x1798ba(++_0x4cfe98);}(_0x23a2,0xcb));var _0x223a=function(_0x1508af,_0x1a2d9d){_0x1508af=_0x1508af-0x0;var _0xfe50d8=_0x23a2[_0x1508af];return _0xfe50d8;};'use strict';var _=require(_0x223a('0x0'));var moment=require('moment');var md5=require(_0x223a('0x1'));var Redis=require(_0x223a('0x2'));var config=require(_0x223a('0x3'));config['redis']=_['defaults'](config[_0x223a('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x223a('0x5'))(new Redis(config[_0x223a('0x4')]));function Agent(_0x23ce93){this['id']=_0x23ce93['id']||0x0;this['name']=_0x23ce93[_0x223a('0x6')]||'';this[_0x223a('0x7')]=_0x23ce93[_0x223a('0x7')]||!![];this[_0x223a('0x8')]=_0x23ce93[_0x223a('0x8')]||![];this[_0x223a('0x9')]=_0x23ce93[_0x223a('0x9')]||![];this['mailPause']=_0x23ce93['mailPause']||![];this[_0x223a('0xa')]=_0x23ce93['faxPause']||![];this['smsPause']=_0x23ce93[_0x223a('0xb')]||![];this[_0x223a('0xc')]=_0x23ce93[_0x223a('0xc')]||![];this[_0x223a('0xd')]=_0x223a('0xe');this['chatStatusTime']=0x0;this[_0x223a('0xf')]=_0x23ce93[_0x223a('0xf')]||0x0;this[_0x223a('0x10')]=0x0;this[_0x223a('0x11')]=_0x223a('0xe');this['mailStatusTime']=0x0;this[_0x223a('0x12')]=_0x23ce93[_0x223a('0x12')]||0x0;this[_0x223a('0x13')]=0x0;this[_0x223a('0x14')]=_0x223a('0xe');this[_0x223a('0x15')]=0x0;this[_0x223a('0x16')]=_0x23ce93['faxCapacity']||0x0;this[_0x223a('0x17')]=0x0;this[_0x223a('0x18')]='unknown';this[_0x223a('0x19')]=0x0;this[_0x223a('0x1a')]=_0x23ce93[_0x223a('0x1a')]||0x0;this[_0x223a('0x1b')]=0x0;this[_0x223a('0x1c')]='unknown';this[_0x223a('0x1d')]=0x0;this['whatsappCapacity']=_0x23ce93[_0x223a('0x1e')]||0x0;this[_0x223a('0x1f')]=0x0;this['openchannelStatus']='unknown';this['openchannelStatusTime']=0x0;this[_0x223a('0x20')]=_0x23ce93[_0x223a('0x20')]||0x0;this[_0x223a('0x21')]=0x0;this[_0x223a('0x22')]=![];this[_0x223a('0x23')]=undefined;this[_0x223a('0x1')]='';this[_0x223a('0x24')]();}Agent[_0x223a('0x25')][_0x223a('0x26')]=function(_0x1ee498){if(this[_0x1ee498+_0x223a('0x27')]>0x0){if(this[_0x1ee498+_0x223a('0x28')]>0x0&&this[_0x1ee498+'CurrentCapacity']>=this[_0x1ee498+_0x223a('0x28')]){return _0x223a('0x29');}else{return _0x223a('0x2a');}}else{return _0x223a('0x2b');}};Agent[_0x223a('0x25')][_0x223a('0x24')]=function(){var _0x1e5e92=['mail','chat',_0x223a('0x2c'),_0x223a('0x2d'),_0x223a('0x2e'),_0x223a('0x2f')];for(var _0x3545e6=0x0;_0x3545e6<_0x1e5e92[_0x223a('0x30')];_0x3545e6+=0x1){var _0x42bbf5=this[_0x223a('0x26')](_0x1e5e92[_0x3545e6]);if(this[_0x1e5e92[_0x3545e6]+_0x223a('0x31')]!==_0x42bbf5){this[_0x1e5e92[_0x3545e6]+_0x223a('0x32')]=_['toNumber'](moment()[_0x223a('0x33')]('x'));}this[_0x1e5e92[_0x3545e6]+_0x223a('0x31')]=_0x42bbf5;}var _0x140114={'id':this['id'],'name':this[_0x223a('0x6')],'online':this[_0x223a('0x7')],'voicePause':this[_0x223a('0x8')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x223a('0xb')],'faxPause':this[_0x223a('0xa')],'openchannelPause':this[_0x223a('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x223a('0x34')],'chatCapacity':this[_0x223a('0xf')],'chatCurrentCapacity':this[_0x223a('0x10')],'mailStatus':this[_0x223a('0x11')],'mailStatusTime':this[_0x223a('0x35')],'mailCapacity':this[_0x223a('0x12')],'mailCurrentCapacity':this[_0x223a('0x13')],'faxStatus':this[_0x223a('0x14')],'faxStatusTime':this[_0x223a('0x15')],'faxCapacity':this[_0x223a('0x16')],'faxCurrentCapacity':this[_0x223a('0x17')],'smsStatus':this[_0x223a('0x18')],'smsStatusTime':this[_0x223a('0x19')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x223a('0x1b')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x223a('0x1d')],'whatsappCapacity':this[_0x223a('0x1e')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x223a('0x36')],'openchannelStatusTime':this[_0x223a('0x37')],'openchannelCapacity':this[_0x223a('0x20')],'openchannelCurrentCapacity':this[_0x223a('0x21')],'busy':this[_0x223a('0x22')],'busyQueue':this[_0x223a('0x23')]};var _0x3b6291=md5(JSON['stringify'](_0x140114));if(this['md5']!==_0x3b6291){this[_0x223a('0x1')]=_0x3b6291;io[_0x223a('0x38')](_0x223a('0x39'),_0x140114);}};module[_0x223a('0x3a')]=Agent; \ No newline at end of file +var _0x19bf=['lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','unknown','chatCapacity','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busyQueue','updateRealtime','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','fax','whatsapp','getChannelStatus','StatusTime','format','mailPause','chatStatus','mailStatus','mailStatusTime','mailCurrentCapacity','whatsappStatus','openchannelCurrentCapacity','busy','stringify','emit','user:save'];(function(_0x1fd9e7,_0x24cdbe){var _0x1781f2=function(_0x2bd0a3){while(--_0x2bd0a3){_0x1fd9e7['push'](_0x1fd9e7['shift']());}};_0x1781f2(++_0x24cdbe);}(_0x19bf,0x18f));var _0xf19b=function(_0x4de62c,_0x2f62){_0x4de62c=_0x4de62c-0x0;var _0x4fcf08=_0x19bf[_0x4de62c];return _0x4fcf08;};'use strict';var _=require(_0xf19b('0x0'));var moment=require(_0xf19b('0x1'));var md5=require(_0xf19b('0x2'));var Redis=require(_0xf19b('0x3'));var config=require(_0xf19b('0x4'));config[_0xf19b('0x5')]=_[_0xf19b('0x6')](config[_0xf19b('0x5')],{'host':_0xf19b('0x7'),'port':0x18eb});var io=require(_0xf19b('0x8'))(new Redis(config[_0xf19b('0x5')]));function Agent(_0x32fa96){this['id']=_0x32fa96['id']||0x0;this[_0xf19b('0x9')]=_0x32fa96['name']||'';this[_0xf19b('0xa')]=_0x32fa96[_0xf19b('0xa')]||!![];this['voicePause']=_0x32fa96[_0xf19b('0xb')]||![];this[_0xf19b('0xc')]=_0x32fa96[_0xf19b('0xc')]||![];this['mailPause']=_0x32fa96['mailPause']||![];this[_0xf19b('0xd')]=_0x32fa96[_0xf19b('0xd')]||![];this['smsPause']=_0x32fa96[_0xf19b('0xe')]||![];this[_0xf19b('0xf')]=_0x32fa96['openchannelPause']||![];this['chatStatus']=_0xf19b('0x10');this['chatStatusTime']=0x0;this[_0xf19b('0x11')]=_0x32fa96[_0xf19b('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']='unknown';this['mailStatusTime']=0x0;this[_0xf19b('0x12')]=_0x32fa96[_0xf19b('0x12')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xf19b('0x13')]=_0xf19b('0x10');this[_0xf19b('0x14')]=0x0;this[_0xf19b('0x15')]=_0x32fa96[_0xf19b('0x15')]||0x0;this[_0xf19b('0x16')]=0x0;this['smsStatus']=_0xf19b('0x10');this[_0xf19b('0x17')]=0x0;this['smsCapacity']=_0x32fa96[_0xf19b('0x18')]||0x0;this[_0xf19b('0x19')]=0x0;this['whatsappStatus']=_0xf19b('0x10');this[_0xf19b('0x1a')]=0x0;this[_0xf19b('0x1b')]=_0x32fa96['whatsappCapacity']||0x0;this[_0xf19b('0x1c')]=0x0;this[_0xf19b('0x1d')]=_0xf19b('0x10');this[_0xf19b('0x1e')]=0x0;this[_0xf19b('0x1f')]=_0x32fa96['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0xf19b('0x20')]=undefined;this[_0xf19b('0x2')]='';this[_0xf19b('0x21')]();}Agent['prototype']['getChannelStatus']=function(_0x120f9e){if(this[_0x120f9e+_0xf19b('0x22')]>0x0){if(this[_0x120f9e+_0xf19b('0x23')]>0x0&&this[_0x120f9e+_0xf19b('0x22')]>=this[_0x120f9e+_0xf19b('0x23')]){return _0xf19b('0x24');}else{return _0xf19b('0x25');}}else{return _0xf19b('0x26');}};Agent['prototype'][_0xf19b('0x21')]=function(){var _0x1793b6=[_0xf19b('0x27'),_0xf19b('0x28'),'openchannel',_0xf19b('0x29'),'sms',_0xf19b('0x2a')];for(var _0x5c16db=0x0;_0x5c16db<_0x1793b6['length'];_0x5c16db+=0x1){var _0x4cefb8=this[_0xf19b('0x2b')](_0x1793b6[_0x5c16db]);if(this[_0x1793b6[_0x5c16db]+'Status']!==_0x4cefb8){this[_0x1793b6[_0x5c16db]+_0xf19b('0x2c')]=_['toNumber'](moment()[_0xf19b('0x2d')]('x'));}this[_0x1793b6[_0x5c16db]+'Status']=_0x4cefb8;}var _0x53992b={'id':this['id'],'name':this[_0xf19b('0x9')],'online':this[_0xf19b('0xa')],'voicePause':this[_0xf19b('0xb')],'chatPause':this[_0xf19b('0xc')],'mailPause':this[_0xf19b('0x2e')],'smsPause':this[_0xf19b('0xe')],'faxPause':this['faxPause'],'openchannelPause':this[_0xf19b('0xf')],'chatStatus':this[_0xf19b('0x2f')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xf19b('0x30')],'mailStatusTime':this[_0xf19b('0x31')],'mailCapacity':this[_0xf19b('0x12')],'mailCurrentCapacity':this[_0xf19b('0x32')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xf19b('0x14')],'faxCapacity':this[_0xf19b('0x15')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xf19b('0x17')],'smsCapacity':this[_0xf19b('0x18')],'smsCurrentCapacity':this[_0xf19b('0x19')],'whatsappStatus':this[_0xf19b('0x33')],'whatsappStatusTime':this[_0xf19b('0x1a')],'whatsappCapacity':this[_0xf19b('0x1b')],'whatsappCurrentCapacity':this[_0xf19b('0x1c')],'openchannelStatus':this[_0xf19b('0x1d')],'openchannelStatusTime':this[_0xf19b('0x1e')],'openchannelCapacity':this[_0xf19b('0x1f')],'openchannelCurrentCapacity':this[_0xf19b('0x34')],'busy':this[_0xf19b('0x35')],'busyQueue':this[_0xf19b('0x20')]};var _0x51f7e0=md5(JSON[_0xf19b('0x36')](_0x53992b));if(this['md5']!==_0x51f7e0){this['md5']=_0x51f7e0;io[_0xf19b('0x37')](_0xf19b('0x38'),_0x53992b);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index ac84cdb..d130800 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 _0x1e99=['updateRouting','updateRealtime','_rr','map','prototype','paused','length','online','loggedIn','chatPause','available','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0x1e99,0xaa));var _0x91e9=function(_0x389967,_0xe8c5ed){_0x389967=_0x389967-0x0;var _0xa24a4a=_0x1e99[_0x389967];return _0xa24a4a;};'use strict';var _=require(_0x91e9('0x0'));var md5=require(_0x91e9('0x1'));var util=require(_0x91e9('0x2'));var Redis=require(_0x91e9('0x3'));var config=require(_0x91e9('0x4'));config[_0x91e9('0x5')]=_[_0x91e9('0x6')](config[_0x91e9('0x5')],{'host':_0x91e9('0x7'),'port':0x18eb});var io=require(_0x91e9('0x8'))(new Redis(config[_0x91e9('0x5')]));function ChatQueue(_0x25d1d8){this['id']=_0x25d1d8['id']||0x0;this[_0x91e9('0x9')]=_0x25d1d8[_0x91e9('0x9')]||'';this['timeout']=_0x25d1d8[_0x91e9('0xa')]||0xa;this['strategy']=_0x25d1d8[_0x91e9('0xb')]||_0x91e9('0xc');this[_0x91e9('0xd')]=_0x25d1d8[_0x91e9('0xd')];this[_0x91e9('0xe')]={};this[_0x91e9('0xf')]=0x0;this[_0x91e9('0x1')]='';this[_0x91e9('0x10')]();this[_0x91e9('0x11')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x4b01b6=this[_0x91e9('0xe')][_0x91e9('0x12')];this[_0x91e9('0xe')]=_[_0x91e9('0x13')](this['Agents'],'id');this[_0x91e9('0xe')][_0x91e9('0x12')]=_0x4b01b6;};ChatQueue[_0x91e9('0x14')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x91e9('0x15')]=0x0;for(var _0x2259c8=0x0;_0x2259c8=0x0?this[_0x91e9('0x1a')]:0x0;var _0x2b54ec={'id':this['id'],'available':this[_0x91e9('0x1a')],'loggedIn':this[_0x91e9('0x18')],'name':this['name'],'paused':this[_0x91e9('0x15')],'waiting':this['waiting']};var _0x24d7a1=md5(JSON['stringify'](_0x2b54ec));if(this[_0x91e9('0x1')]!==_0x24d7a1){this['md5']=_0x24d7a1;io['to'](util['format'](_0x91e9('0x1b'),_0x2b54ec[_0x91e9('0x9')]))[_0x91e9('0x1c')](_0x91e9('0x1d'),_0x2b54ec);}};module[_0x91e9('0x1e')]=ChatQueue; \ No newline at end of file +var _0x3149=['beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','updateRealtime','paused','online','loggedIn','chatPause','available','stringify','format','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy'];(function(_0x3a73cb,_0x334c82){var _0x3aff63=function(_0x3e5791){while(--_0x3e5791){_0x3a73cb['push'](_0x3a73cb['shift']());}};_0x3aff63(++_0x334c82);}(_0x3149,0x162));var _0x9314=function(_0x1d37be,_0x3f11ff){_0x1d37be=_0x1d37be-0x0;var _0x5d194c=_0x3149[_0x1d37be];return _0x5d194c;};'use strict';var _=require(_0x9314('0x0'));var md5=require(_0x9314('0x1'));var util=require('util');var Redis=require(_0x9314('0x2'));var config=require(_0x9314('0x3'));config[_0x9314('0x4')]=_[_0x9314('0x5')](config[_0x9314('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x9314('0x6'))(new Redis(config['redis']));function ChatQueue(_0x426ce3){this['id']=_0x426ce3['id']||0x0;this[_0x9314('0x7')]=_0x426ce3[_0x9314('0x7')]||'';this[_0x9314('0x8')]=_0x426ce3['timeout']||0xa;this[_0x9314('0x9')]=_0x426ce3[_0x9314('0x9')]||_0x9314('0xa');this[_0x9314('0xb')]=_0x426ce3[_0x9314('0xb')];this['mapAgentsId']={};this[_0x9314('0xc')]=0x0;this[_0x9314('0x1')]='';this[_0x9314('0xd')]();this['updateRealtime']();}ChatQueue[_0x9314('0xe')][_0x9314('0xd')]=function(){var _0x574060=this[_0x9314('0xf')][_0x9314('0x10')];this[_0x9314('0xf')]=_['map'](this['Agents'],'id');this[_0x9314('0xf')][_0x9314('0x10')]=_0x574060;};ChatQueue[_0x9314('0xe')][_0x9314('0x11')]=function(){this['loggedIn']=0x0;this[_0x9314('0x12')]=0x0;for(var _0x4e37e0=0x0;_0x4e37e0=0x0?this['available']:0x0;var _0x5142b6={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9314('0x14')],'name':this[_0x9314('0x7')],'paused':this[_0x9314('0x12')],'waiting':this['waiting']};var _0x5cba6f=md5(JSON[_0x9314('0x17')](_0x5142b6));if(this[_0x9314('0x1')]!==_0x5cba6f){this['md5']=_0x5cba6f;io['to'](util[_0x9314('0x18')]('chat:queue:%s',_0x5142b6[_0x9314('0x7')]))[_0x9314('0x19')](_0x9314('0x1a'),_0x5142b6);}};module[_0x9314('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index d870523..dcdad0a 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 _0x171f=['redis','defaults','localhost','name','timeout','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','online','faxPause','paused','available','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x28d1cd,_0x192371){var _0xdcb892=function(_0x145f6e){while(--_0x145f6e){_0x28d1cd['push'](_0x28d1cd['shift']());}};_0xdcb892(++_0x192371);}(_0x171f,0xb8));var _0xf171=function(_0x5a6de2,_0x5c8b10){_0x5a6de2=_0x5a6de2-0x0;var _0x2c0525=_0x171f[_0x5a6de2];return _0x2c0525;};'use strict';var _=require(_0xf171('0x0'));var md5=require(_0xf171('0x1'));var util=require(_0xf171('0x2'));var Redis=require(_0xf171('0x3'));var config=require(_0xf171('0x4'));config[_0xf171('0x5')]=_[_0xf171('0x6')](config[_0xf171('0x5')],{'host':_0xf171('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf171('0x5')]));function FaxQueue(_0x1f37d7){this['id']=_0x1f37d7['id']||0x0;this[_0xf171('0x8')]=_0x1f37d7[_0xf171('0x8')]||'';this[_0xf171('0x9')]=_0x1f37d7[_0xf171('0x9')]||0xa;this['strategy']=_0x1f37d7['strategy']||'beepall';this[_0xf171('0xa')]=_0x1f37d7[_0xf171('0xa')];this[_0xf171('0xb')]={};this[_0xf171('0xc')]=0x0;this[_0xf171('0x1')]='';this[_0xf171('0xd')]();this[_0xf171('0xe')]();}FaxQueue[_0xf171('0xf')]['updateRouting']=function(){var _0xc3324=this[_0xf171('0xb')][_0xf171('0x10')];this[_0xf171('0xb')]=_['map'](this[_0xf171('0xa')],'id');this[_0xf171('0xb')]['_rr']=_0xc3324;};FaxQueue[_0xf171('0xf')][_0xf171('0xe')]=function(){this[_0xf171('0x11')]=0x0;this['paused']=0x0;for(var _0x294824=0x0;_0x294824=0x0?this[_0xf171('0x16')]:0x0;var _0x598aa4={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf171('0x11')],'name':this['name'],'paused':this[_0xf171('0x15')],'waiting':this['waiting']};var _0x1d5832=md5(JSON['stringify'](_0x598aa4));if(this[_0xf171('0x1')]!==_0x1d5832){this[_0xf171('0x1')]=_0x1d5832;io['to'](util['format'](_0xf171('0x17'),_0x598aa4['name']))[_0xf171('0x18')](_0xf171('0x19'),_0x598aa4);}};module[_0xf171('0x1a')]=FaxQueue; \ No newline at end of file +var _0x843b=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','online','available','stringify','format','fax:queue:%s','emit','fax_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x5d6c3e,_0x409a3e){var _0x44ecb7=function(_0x936b6a){while(--_0x936b6a){_0x5d6c3e['push'](_0x5d6c3e['shift']());}};_0x44ecb7(++_0x409a3e);}(_0x843b,0x148));var _0xb843=function(_0x1da39f,_0x5c3e5b){_0x1da39f=_0x1da39f-0x0;var _0x2a464c=_0x843b[_0x1da39f];return _0x2a464c;};'use strict';var _=require(_0xb843('0x0'));var md5=require(_0xb843('0x1'));var util=require('util');var Redis=require(_0xb843('0x2'));var config=require(_0xb843('0x3'));config[_0xb843('0x4')]=_[_0xb843('0x5')](config[_0xb843('0x4')],{'host':_0xb843('0x6'),'port':0x18eb});var io=require(_0xb843('0x7'))(new Redis(config[_0xb843('0x4')]));function FaxQueue(_0x5b9552){this['id']=_0x5b9552['id']||0x0;this[_0xb843('0x8')]=_0x5b9552[_0xb843('0x8')]||'';this[_0xb843('0x9')]=_0x5b9552['timeout']||0xa;this[_0xb843('0xa')]=_0x5b9552[_0xb843('0xa')]||_0xb843('0xb');this[_0xb843('0xc')]=_0x5b9552[_0xb843('0xc')];this[_0xb843('0xd')]={};this[_0xb843('0xe')]=0x0;this[_0xb843('0x1')]='';this[_0xb843('0xf')]();this[_0xb843('0x10')]();}FaxQueue[_0xb843('0x11')]['updateRouting']=function(){var _0x47bc90=this[_0xb843('0xd')][_0xb843('0x12')];this[_0xb843('0xd')]=_['map'](this[_0xb843('0xc')],'id');this['mapAgentsId'][_0xb843('0x12')]=_0x47bc90;};FaxQueue[_0xb843('0x11')][_0xb843('0x10')]=function(){this[_0xb843('0x13')]=0x0;this[_0xb843('0x14')]=0x0;for(var _0x419055=0x0;_0x419055=0x0?this[_0xb843('0x16')]:0x0;var _0x218a12={'id':this['id'],'available':this['available'],'loggedIn':this[_0xb843('0x13')],'name':this[_0xb843('0x8')],'paused':this[_0xb843('0x14')],'waiting':this[_0xb843('0xe')]};var _0x5668cb=md5(JSON[_0xb843('0x17')](_0x218a12));if(this[_0xb843('0x1')]!==_0x5668cb){this['md5']=_0x5668cb;io['to'](util[_0xb843('0x18')](_0xb843('0x19'),_0x218a12[_0xb843('0x8')]))[_0xb843('0x1a')](_0xb843('0x1b'),_0x218a12);}};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 e65c6cb..3ce4f09 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 _0xbaa8=['name','Intervals','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbaa8,0x7e));var _0x8baa=function(_0xa2cd73,_0xb33f91){_0xa2cd73=_0xa2cd73-0x0;var _0x5b1db0=_0xbaa8[_0xa2cd73];return _0x5b1db0;};'use strict';function Interval(_0x44eac0){this['id']=_0x44eac0['id']||0x0;this[_0x8baa('0x0')]=_0x44eac0[_0x8baa('0x0')]||'';this[_0x8baa('0x1')]=_0x44eac0['Intervals']||{};}module[_0x8baa('0x2')]=Interval; \ No newline at end of file +var _0x53ed=['name','Intervals','exports'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x53ed,0x1e0));var _0xd53e=function(_0x4af0cf,_0x4875bf){_0x4af0cf=_0x4af0cf-0x0;var _0x3b95a4=_0x53ed[_0x4af0cf];return _0x3b95a4;};'use strict';function Interval(_0x1a7228){this['id']=_0x1a7228['id']||0x0;this['name']=_0x1a7228[_0xd53e('0x0')]||'';this['Intervals']=_0x1a7228[_0xd53e('0x1')]||{};}module[_0xd53e('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 636fd4e..efb9831 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 _0x3148=['paused','length','online','mailPause','available','stringify','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn'];(function(_0x5b21b2,_0x4fc5e7){var _0x5b8602=function(_0x17ab14){while(--_0x17ab14){_0x5b21b2['push'](_0x5b21b2['shift']());}};_0x5b8602(++_0x4fc5e7);}(_0x3148,0xb0));var _0x8314=function(_0x507af7,_0x5cfb83){_0x507af7=_0x507af7-0x0;var _0x496d57=_0x3148[_0x507af7];return _0x496d57;};'use strict';var _=require(_0x8314('0x0'));var md5=require(_0x8314('0x1'));var util=require(_0x8314('0x2'));var Redis=require(_0x8314('0x3'));var config=require(_0x8314('0x4'));config['redis']=_[_0x8314('0x5')](config[_0x8314('0x6')],{'host':_0x8314('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8314('0x6')]));function MailQueue(_0x15389f){this['id']=_0x15389f['id']||0x0;this[_0x8314('0x8')]=_0x15389f['name']||'';this[_0x8314('0x9')]=_0x15389f['timeout']||0xa;this[_0x8314('0xa')]=_0x15389f[_0x8314('0xa')]||'beepall';this[_0x8314('0xb')]=_0x15389f[_0x8314('0xb')];this['mapAgentsId']={};this[_0x8314('0xc')]=0x0;this['md5']='';this[_0x8314('0xd')]();this[_0x8314('0xe')]();}MailQueue[_0x8314('0xf')][_0x8314('0xd')]=function(){var _0x53d0bb=this[_0x8314('0x10')][_0x8314('0x11')];this[_0x8314('0x10')]=_[_0x8314('0x12')](this[_0x8314('0xb')],'id');this[_0x8314('0x10')][_0x8314('0x11')]=_0x53d0bb;};MailQueue[_0x8314('0xf')]['updateRealtime']=function(){this[_0x8314('0x13')]=0x0;this[_0x8314('0x14')]=0x0;for(var _0x4446a9=0x0;_0x4446a9=0x0?this[_0x8314('0x18')]:0x0;var _0x47c9c3={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x8314('0x8')],'paused':this['paused'],'waiting':this[_0x8314('0xc')]};var _0x381beb=md5(JSON[_0x8314('0x19')](_0x47c9c3));if(this[_0x8314('0x1')]!==_0x381beb){this['md5']=_0x381beb;io['to'](util['format']('mail:queue:%s',_0x47c9c3['name']))[_0x8314('0x1a')]('mail_queue:save',_0x47c9c3);}};module[_0x8314('0x1b')]=MailQueue; \ No newline at end of file +var _0xa1e8=['format','emit','mail_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','prototype','loggedIn','paused','length','mailPause','available','stringify'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa1e8,0xb1));var _0x8a1e=function(_0x40ccfc,_0x42219e){_0x40ccfc=_0x40ccfc-0x0;var _0x165105=_0xa1e8[_0x40ccfc];return _0x165105;};'use strict';var _=require(_0x8a1e('0x0'));var md5=require(_0x8a1e('0x1'));var util=require(_0x8a1e('0x2'));var Redis=require(_0x8a1e('0x3'));var config=require(_0x8a1e('0x4'));config[_0x8a1e('0x5')]=_[_0x8a1e('0x6')](config[_0x8a1e('0x5')],{'host':_0x8a1e('0x7'),'port':0x18eb});var io=require(_0x8a1e('0x8'))(new Redis(config['redis']));function MailQueue(_0x32c21d){this['id']=_0x32c21d['id']||0x0;this[_0x8a1e('0x9')]=_0x32c21d[_0x8a1e('0x9')]||'';this[_0x8a1e('0xa')]=_0x32c21d[_0x8a1e('0xa')]||0xa;this[_0x8a1e('0xb')]=_0x32c21d['strategy']||_0x8a1e('0xc');this[_0x8a1e('0xd')]=_0x32c21d[_0x8a1e('0xd')];this[_0x8a1e('0xe')]={};this[_0x8a1e('0xf')]=0x0;this['md5']='';this['updateRouting']();this[_0x8a1e('0x10')]();}MailQueue['prototype'][_0x8a1e('0x11')]=function(){var _0x5bfd41=this[_0x8a1e('0xe')][_0x8a1e('0x12')];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0x8a1e('0xe')][_0x8a1e('0x12')]=_0x5bfd41;};MailQueue[_0x8a1e('0x13')][_0x8a1e('0x10')]=function(){this[_0x8a1e('0x14')]=0x0;this[_0x8a1e('0x15')]=0x0;for(var _0x2bc985=0x0;_0x2bc985=0x0?this[_0x8a1e('0x18')]:0x0;var _0xf895b8={'id':this['id'],'available':this[_0x8a1e('0x18')],'loggedIn':this[_0x8a1e('0x14')],'name':this[_0x8a1e('0x9')],'paused':this[_0x8a1e('0x15')],'waiting':this[_0x8a1e('0xf')]};var _0x526371=md5(JSON[_0x8a1e('0x19')](_0xf895b8));if(this[_0x8a1e('0x1')]!==_0x526371){this[_0x8a1e('0x1')]=_0x526371;io['to'](util[_0x8a1e('0x1a')]('mail:queue:%s',_0xf895b8[_0x8a1e('0x9')]))[_0x8a1e('0x1b')](_0x8a1e('0x1c'),_0xf895b8);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 01d92b3..853351e 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc4aa[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x5ba92b,_0x38cba9){var _0x2fd135=function(_0xbbcd4b){while(--_0xbbcd4b){_0x5ba92b['push'](_0x5ba92b['shift']());}};_0x2fd135(++_0x38cba9);}(_0x814b,0x1a2));var _0xb814=function(_0x24679e,_0x22d9d7){_0x24679e=_0x24679e-0x0;var _0x291f21=_0x814b[_0x24679e];return _0x291f21;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index a482b52..b5fdbfd 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 _0xcabc=['map','prototype','paused','length','online','smsPause','available','loggedIn','format','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr'];(function(_0x1bfca0,_0x19b167){var _0xa8b88e=function(_0x922b98){while(--_0x922b98){_0x1bfca0['push'](_0x1bfca0['shift']());}};_0xa8b88e(++_0x19b167);}(_0xcabc,0x16a));var _0xccab=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcabc[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var md5=require(_0xccab('0x0'));var util=require(_0xccab('0x1'));var Redis=require(_0xccab('0x2'));var config=require(_0xccab('0x3'));config[_0xccab('0x4')]=_['defaults'](config[_0xccab('0x4')],{'host':_0xccab('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xccab('0x4')]));function SmsQueue(_0x316f83){this['id']=_0x316f83['id']||0x0;this[_0xccab('0x6')]=_0x316f83['name']||'';this[_0xccab('0x7')]=_0x316f83[_0xccab('0x7')]||0xa;this[_0xccab('0x8')]=_0x316f83['strategy']||_0xccab('0x9');this[_0xccab('0xa')]=_0x316f83['Agents'];this[_0xccab('0xb')]={};this[_0xccab('0xc')]=0x0;this[_0xccab('0x0')]='';this[_0xccab('0xd')]();this[_0xccab('0xe')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x17b729=this[_0xccab('0xb')][_0xccab('0xf')];this[_0xccab('0xb')]=_[_0xccab('0x10')](this[_0xccab('0xa')],'id');this[_0xccab('0xb')]['_rr']=_0x17b729;};SmsQueue[_0xccab('0x11')][_0xccab('0xe')]=function(){this['loggedIn']=0x0;this[_0xccab('0x12')]=0x0;for(var _0x4f0643=0x0;_0x4f0643=0x0?this['available']:0x0;var _0x4ba1c2={'id':this['id'],'available':this[_0xccab('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xccab('0x6')],'paused':this[_0xccab('0x12')],'waiting':this[_0xccab('0xc')]};var _0x4ab126=md5(JSON['stringify'](_0x4ba1c2));if(this[_0xccab('0x0')]!==_0x4ab126){this[_0xccab('0x0')]=_0x4ab126;io['to'](util[_0xccab('0x18')]('sms:queue:%s',_0x4ba1c2[_0xccab('0x6')]))['emit'](_0xccab('0x19'),_0x4ba1c2);}};module[_0xccab('0x1a')]=SmsQueue; \ No newline at end of file +var _0x032a=['waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','smsPause','available','format','sms:queue:%s','emit','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId'];(function(_0x2d9c6a,_0x59393d){var _0xf3c918=function(_0x4f3f26){while(--_0x4f3f26){_0x2d9c6a['push'](_0x2d9c6a['shift']());}};_0xf3c918(++_0x59393d);}(_0x032a,0xf0));var _0xa032=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0x032a[_0x2675da];return _0x5e6153;};'use strict';var _=require('lodash');var md5=require(_0xa032('0x0'));var util=require('util');var Redis=require(_0xa032('0x1'));var config=require(_0xa032('0x2'));config[_0xa032('0x3')]=_[_0xa032('0x4')](config[_0xa032('0x3')],{'host':_0xa032('0x5'),'port':0x18eb});var io=require(_0xa032('0x6'))(new Redis(config[_0xa032('0x3')]));function SmsQueue(_0x44fd88){this['id']=_0x44fd88['id']||0x0;this[_0xa032('0x7')]=_0x44fd88[_0xa032('0x7')]||'';this[_0xa032('0x8')]=_0x44fd88['timeout']||0xa;this[_0xa032('0x9')]=_0x44fd88['strategy']||'beepall';this[_0xa032('0xa')]=_0x44fd88['Agents'];this[_0xa032('0xb')]={};this[_0xa032('0xc')]=0x0;this[_0xa032('0x0')]='';this[_0xa032('0xd')]();this[_0xa032('0xe')]();}SmsQueue['prototype'][_0xa032('0xd')]=function(){var _0x144909=this['mapAgentsId'][_0xa032('0xf')];this[_0xa032('0xb')]=_[_0xa032('0x10')](this[_0xa032('0xa')],'id');this[_0xa032('0xb')]['_rr']=_0x144909;};SmsQueue[_0xa032('0x11')][_0xa032('0xe')]=function(){this[_0xa032('0x12')]=0x0;this[_0xa032('0x13')]=0x0;for(var _0x39ff1f=0x0;_0x39ff1f=0x0?this['available']:0x0;var _0xff6817={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa032('0x12')],'name':this[_0xa032('0x7')],'paused':this[_0xa032('0x13')],'waiting':this['waiting']};var _0x196947=md5(JSON['stringify'](_0xff6817));if(this[_0xa032('0x0')]!==_0x196947){this[_0xa032('0x0')]=_0x196947;io['to'](util[_0xa032('0x18')](_0xa032('0x19'),_0xff6817[_0xa032('0x7')]))[_0xa032('0x1a')]('sms_queue:save',_0xff6817);}};module[_0xa032('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 c40b0c9..2b097a1 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 _0xfe21=['whatsapp:queue:%s','emit','whatsapp_queue:save','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','whatsappPause','available','format'];(function(_0x53d71c,_0x1a3859){var _0x555efb=function(_0x32ef67){while(--_0x32ef67){_0x53d71c['push'](_0x53d71c['shift']());}};_0x555efb(++_0x1a3859);}(_0xfe21,0x1bd));var _0x1fe2=function(_0x3fd5e9,_0x1baba4){_0x3fd5e9=_0x3fd5e9-0x0;var _0x408fed=_0xfe21[_0x3fd5e9];return _0x408fed;};'use strict';var _=require('lodash');var md5=require(_0x1fe2('0x0'));var util=require('util');var Redis=require(_0x1fe2('0x1'));var config=require(_0x1fe2('0x2'));config[_0x1fe2('0x3')]=_['defaults'](config[_0x1fe2('0x3')],{'host':_0x1fe2('0x4'),'port':0x18eb});var io=require(_0x1fe2('0x5'))(new Redis(config[_0x1fe2('0x3')]));function WhatsappQueue(_0x49ecde){this['id']=_0x49ecde['id']||0x0;this[_0x1fe2('0x6')]=_0x49ecde[_0x1fe2('0x6')]||'';this[_0x1fe2('0x7')]=_0x49ecde[_0x1fe2('0x7')]||0xa;this['strategy']=_0x49ecde['strategy']||_0x1fe2('0x8');this[_0x1fe2('0x9')]=_0x49ecde[_0x1fe2('0x9')];this[_0x1fe2('0xa')]={};this[_0x1fe2('0xb')]=0x0;this['md5']='';this[_0x1fe2('0xc')]();this[_0x1fe2('0xd')]();}WhatsappQueue[_0x1fe2('0xe')]['updateRouting']=function(){var _0x5d603c=this['mapAgentsId'][_0x1fe2('0xf')];this[_0x1fe2('0xa')]=_['map'](this[_0x1fe2('0x9')],'id');this[_0x1fe2('0xa')]['_rr']=_0x5d603c;};WhatsappQueue['prototype'][_0x1fe2('0xd')]=function(){this[_0x1fe2('0x10')]=0x0;this[_0x1fe2('0x11')]=0x0;for(var _0x1f804e=0x0;_0x1f804e=0x0?this[_0x1fe2('0x15')]:0x0;var _0xfdc504={'id':this['id'],'available':this[_0x1fe2('0x15')],'loggedIn':this[_0x1fe2('0x10')],'name':this[_0x1fe2('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x190e37=md5(JSON['stringify'](_0xfdc504));if(this['md5']!==_0x190e37){this['md5']=_0x190e37;io['to'](util[_0x1fe2('0x16')](_0x1fe2('0x17'),_0xfdc504[_0x1fe2('0x6')]))[_0x1fe2('0x18')](_0x1fe2('0x19'),_0xfdc504);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x92b3=['updateRealtime','prototype','_rr','map','length','online','loggedIn','paused','available','md5','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting'];(function(_0x138cb6,_0x53894f){var _0x583eca=function(_0x47e253){while(--_0x47e253){_0x138cb6['push'](_0x138cb6['shift']());}};_0x583eca(++_0x53894f);}(_0x92b3,0x188));var _0x392b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x92b3[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0x392b('0x0'));var config=require(_0x392b('0x1'));config[_0x392b('0x2')]=_[_0x392b('0x3')](config[_0x392b('0x2')],{'host':_0x392b('0x4'),'port':0x18eb});var io=require(_0x392b('0x5'))(new Redis(config[_0x392b('0x2')]));function WhatsappQueue(_0x469ee5){this['id']=_0x469ee5['id']||0x0;this[_0x392b('0x6')]=_0x469ee5[_0x392b('0x6')]||'';this['timeout']=_0x469ee5[_0x392b('0x7')]||0xa;this['strategy']=_0x469ee5[_0x392b('0x8')]||_0x392b('0x9');this[_0x392b('0xa')]=_0x469ee5['Agents'];this[_0x392b('0xb')]={};this[_0x392b('0xc')]=0x0;this['md5']='';this[_0x392b('0xd')]();this[_0x392b('0xe')]();}WhatsappQueue[_0x392b('0xf')]['updateRouting']=function(){var _0x5c6c94=this[_0x392b('0xb')][_0x392b('0x10')];this['mapAgentsId']=_[_0x392b('0x11')](this[_0x392b('0xa')],'id');this[_0x392b('0xb')][_0x392b('0x10')]=_0x5c6c94;};WhatsappQueue['prototype'][_0x392b('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x1ca30d=0x0;_0x1ca30d=0x0?this[_0x392b('0x16')]:0x0;var _0x28fa59={'id':this['id'],'available':this[_0x392b('0x16')],'loggedIn':this[_0x392b('0x14')],'name':this[_0x392b('0x6')],'paused':this[_0x392b('0x15')],'waiting':this[_0x392b('0xc')]};var _0x1824c3=md5(JSON['stringify'](_0x28fa59));if(this[_0x392b('0x17')]!==_0x1824c3){this[_0x392b('0x17')]=_0x1824c3;io['to'](util[_0x392b('0x18')](_0x392b('0x19'),_0x28fa59[_0x392b('0x6')]))[_0x392b('0x1a')](_0x392b('0x1b'),_0x28fa59);}};module[_0x392b('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 75f57aa..4a86f3a 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x1d1eac,_0x5208b4){var _0x40ad6e=function(_0x469d8c){while(--_0x469d8c){_0x1d1eac['push'](_0x1d1eac['shift']());}};_0x40ad6e(++_0x5208b4);}(_0xb10b,0x12a));var _0xbb10=function(_0x24502f,_0x134350){_0x24502f=_0x24502f-0x0;var _0x402fd9=_0xb10b[_0x24502f];return _0x402fd9;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _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(_0x5c1aa7,_0x5e397e){var _0x49184c=function(_0x242226){while(--_0x242226){_0x5c1aa7['push'](_0x5c1aa7['shift']());}};_0x49184c(++_0x5e397e);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c72ee,_0x5a8bf8){_0x5c72ee=_0x5c72ee-0x0;var _0x231876=_0xb10b[_0x5c72ee];return _0x231876;};'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 6b84e1f..68495a7 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 _0x17da=['../client','update','Request','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x39e8f5,_0xb151a6){var _0x346526=function(_0xc00cf5){while(--_0xc00cf5){_0x39e8f5['push'](_0x39e8f5['shift']());}};_0x346526(++_0xb151a6);}(_0x17da,0xa5));var _0xa17d=function(_0x21b48b,_0x3cc09a){_0x21b48b=_0x21b48b-0x0;var _0x24d2f3=_0x17da[_0x21b48b];return _0x24d2f3;};'use strict';var client=require(_0xa17d('0x0'));exports[_0xa17d('0x1')]=function(_0x288bcd,_0x36039d){return client[_0xa17d('0x2')]('UpdateChatInteraction',{'body':_0x36039d,'options':{'where':{'id':_0x288bcd}},'log':'updateChatInteraction'});};exports['addTags']=function(_0xe52e39,_0x531300){return client['Request'](_0xa17d('0x3'),{'body':_0x531300,'options':{'where':{'id':_0xe52e39}},'log':_0xa17d('0x4')});}; \ No newline at end of file +var _0x5304=['../client','UpdateChatInteraction','addTags','Request'];(function(_0x51cc4e,_0x3ca472){var _0x22b2a4=function(_0x4cd26d){while(--_0x4cd26d){_0x51cc4e['push'](_0x51cc4e['shift']());}};_0x22b2a4(++_0x3ca472);}(_0x5304,0xb4));var _0x4530=function(_0x290694,_0x281935){_0x290694=_0x290694-0x0;var _0x5a0f2e=_0x5304[_0x290694];return _0x5a0f2e;};'use strict';var client=require(_0x4530('0x0'));exports['update']=function(_0x26d9ec,_0xee4efb){return client['Request'](_0x4530('0x1'),{'body':_0xee4efb,'options':{'where':{'id':_0x26d9ec}},'log':'updateChatInteraction'});};exports[_0x4530('0x2')]=function(_0x159226,_0x323dd5){return client[_0x4530('0x3')]('AddTagsToChatInteraction',{'body':_0x323dd5,'options':{'where':{'id':_0x159226}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 24d0b5a..5664976 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 _0x2a90=['CreateChatMessage','../client','create','Request'];(function(_0x35e6cb,_0x5dd511){var _0xb75549=function(_0x17006a){while(--_0x17006a){_0x35e6cb['push'](_0x35e6cb['shift']());}};_0xb75549(++_0x5dd511);}(_0x2a90,0x89));var _0x02a9=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2a90[_0x432682];return _0x463d05;};'use strict';var client=require(_0x02a9('0x0'));exports[_0x02a9('0x1')]=function(_0x199156){return client[_0x02a9('0x2')](_0x02a9('0x3'),{'body':_0x199156,'log':'createChatMessage'});}; \ No newline at end of file +var _0x22b4=['createChatMessage','create','Request'];(function(_0x13846e,_0x4c6eea){var _0x473baa=function(_0x7c792e){while(--_0x7c792e){_0x13846e['push'](_0x13846e['shift']());}};_0x473baa(++_0x4c6eea);}(_0x22b4,0x130));var _0x422b=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x22b4[_0xac151d];return _0x111dba;};'use strict';var client=require('../client');exports[_0x422b('0x0')]=function(_0x1206c1){return client[_0x422b('0x1')]('CreateChatMessage',{'body':_0x1206c1,'log':_0x422b('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 6f75299..f21af5d 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 _0xdcc4=['User','Agents','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','strategy'];(function(_0x23691d,_0x1e05f6){var _0x3eae6f=function(_0x55b577){while(--_0x55b577){_0x23691d['push'](_0x23691d['shift']());}};_0x3eae6f(++_0x1e05f6);}(_0xdcc4,0xea));var _0x4dcc=function(_0x52465d,_0xe48891){_0x52465d=_0x52465d-0x0;var _0x585984=_0xdcc4[_0x52465d];return _0x585984;};'use strict';var client=require(_0x4dcc('0x0'));exports[_0x4dcc('0x1')]=function(){return function(){return client[_0x4dcc('0x2')](_0x4dcc('0x3'),{'options':{'raw':![],'attributes':['id',_0x4dcc('0x4'),'timeout',_0x4dcc('0x5')],'include':[{'model':_0x4dcc('0x6'),'as':_0x4dcc('0x7'),'attributes':['id',_0x4dcc('0x4'),_0x4dcc('0x8'),_0x4dcc('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xb957=['strategy','Agents','online','chatPause','getChatQueues','Request','name','timeout'];(function(_0x1ff299,_0x363bfd){var _0x26600b=function(_0x15e534){while(--_0x15e534){_0x1ff299['push'](_0x1ff299['shift']());}};_0x26600b(++_0x363bfd);}(_0xb957,0x6d));var _0x7b95=function(_0x4ba26e,_0x2442d3){_0x4ba26e=_0x4ba26e-0x0;var _0x7f498b=_0xb957[_0x4ba26e];return _0x7f498b;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0x7b95('0x0')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x7b95('0x1'),_0x7b95('0x2'),_0x7b95('0x3')],'include':[{'model':'User','as':_0x7b95('0x4'),'attributes':['id',_0x7b95('0x1'),_0x7b95('0x5'),_0x7b95('0x6')]}]},'log':_0x7b95('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 423be07..9456b48 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 _0xee53=['update','UpdateChatQueueReport','DESC','Request','CreateChatQueueReport'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xee53,0xa8));var _0x3ee5=function(_0x4f6d08,_0x1b3dd0){_0x4f6d08=_0x4f6d08-0x0;var _0x53a9c6=_0xee53[_0x4f6d08];return _0x53a9c6;};'use strict';var client=require('../client');exports['create']=function(_0x36fad7){return client[_0x3ee5('0x0')](_0x3ee5('0x1'),{'body':_0x36fad7,'log':'CreateChatQueueReport'});};exports[_0x3ee5('0x2')]=function(_0x25de7e,_0x17d29c){return client[_0x3ee5('0x0')](_0x3ee5('0x3'),{'body':_0x17d29c,'options':{'where':{'uniqueid':_0x25de7e},'order':[['id',_0x3ee5('0x4')]],'limit':0x1},'log':_0x3ee5('0x3')});}; \ No newline at end of file +var _0x0cfa=['create','Request','UpdateChatQueueReport','DESC','../client'];(function(_0x19527a,_0x1857f6){var _0x95df0a=function(_0x518ae8){while(--_0x518ae8){_0x19527a['push'](_0x19527a['shift']());}};_0x95df0a(++_0x1857f6);}(_0x0cfa,0x18f));var _0xa0cf=function(_0x50256a,_0x772647){_0x50256a=_0x50256a-0x0;var _0x1f3b27=_0x0cfa[_0x50256a];return _0x1f3b27;};'use strict';var client=require(_0xa0cf('0x0'));exports[_0xa0cf('0x1')]=function(_0x336e19){return client[_0xa0cf('0x2')]('CreateChatQueueReport',{'body':_0x336e19,'log':'CreateChatQueueReport'});};exports['update']=function(_0x37c4e1,_0x5cd2e7){return client[_0xa0cf('0x2')](_0xa0cf('0x3'),{'body':_0x5cd2e7,'options':{'where':{'uniqueid':_0x37c4e1},'order':[['id',_0xa0cf('0x4')]],'limit':0x1},'log':_0xa0cf('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index b752781..320bd34 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(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x7a54,0x106));var _0x47a5=function(_0x1d9f1b,_0x5c304c){_0x1d9f1b=_0x1d9f1b-0x0;var _0x335503=_0x7a54[_0x1d9f1b];return _0x335503;};'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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0x7a54,0x106));var _0x47a5=function(_0x159e73,_0x3b4830){_0x159e73=_0x159e73-0x0;var _0x278e13=_0x7a54[_0x159e73];return _0x278e13;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 4ad8687..17d6856 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 _0x848a=['createFaxMessage','create','Request','CreateFaxMessage'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x848a,0x141));var _0xa848=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0x848a[_0x2af29a];return _0x5ef02f;};'use strict';var client=require('../client');exports[_0xa848('0x0')]=function(_0x4e92a2){return client[_0xa848('0x1')](_0xa848('0x2'),{'body':_0x4e92a2,'log':_0xa848('0x3')});}; \ No newline at end of file +var _0x247b=['create','CreateFaxMessage','createFaxMessage','../client'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x247b,0x18b));var _0xb247=function(_0x192c6f,_0x57cbce){_0x192c6f=_0x192c6f-0x0;var _0x16a14b=_0x247b[_0x192c6f];return _0x16a14b;};'use strict';var client=require(_0xb247('0x0'));exports[_0xb247('0x1')]=function(_0x5c7d7f){return client['Request'](_0xb247('0x2'),{'body':_0x5c7d7f,'log':_0xb247('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 9580a1e..c42e13f 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 _0xca51=['strategy','Agents','online','faxPause','../client','getFaxQueues','name','timeout'];(function(_0x35978e,_0x11e880){var _0x167eb4=function(_0xeb8fd9){while(--_0xeb8fd9){_0x35978e['push'](_0x35978e['shift']());}};_0x167eb4(++_0x11e880);}(_0xca51,0xe4));var _0x1ca5=function(_0x1e71b7,_0x74a443){_0x1e71b7=_0x1e71b7-0x0;var _0x42c3a0=_0xca51[_0x1e71b7];return _0x42c3a0;};'use strict';var client=require(_0x1ca5('0x0'));exports[_0x1ca5('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x1ca5('0x2'),_0x1ca5('0x3'),_0x1ca5('0x4')],'include':[{'model':'User','as':_0x1ca5('0x5'),'attributes':['id','name',_0x1ca5('0x6'),_0x1ca5('0x7')]}]},'log':_0x1ca5('0x1')});};}; \ No newline at end of file +var _0x2f2f=['timeout','strategy','User','Agents','online','faxPause','getFaxQueues','../client','Request','GetFaxQueue','name'];(function(_0x1401e1,_0xabb499){var _0x1aab56=function(_0x1071fd){while(--_0x1071fd){_0x1401e1['push'](_0x1401e1['shift']());}};_0x1aab56(++_0xabb499);}(_0x2f2f,0xc2));var _0xf2f2=function(_0x2e2130,_0x271c6d){_0x2e2130=_0x2e2130-0x0;var _0x27e465=_0x2f2f[_0x2e2130];return _0x27e465;};'use strict';var client=require(_0xf2f2('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xf2f2('0x1')](_0xf2f2('0x2'),{'options':{'raw':![],'attributes':['id',_0xf2f2('0x3'),_0xf2f2('0x4'),_0xf2f2('0x5')],'include':[{'model':_0xf2f2('0x6'),'as':_0xf2f2('0x7'),'attributes':['id',_0xf2f2('0x3'),_0xf2f2('0x8'),_0xf2f2('0x9')]}]},'log':_0xf2f2('0xa')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 54327be..e6fd9fd 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 _0xadb6=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x1326e2,_0x10d7c2){var _0xa25c3b=function(_0x4ee820){while(--_0x4ee820){_0x1326e2['push'](_0x1326e2['shift']());}};_0xa25c3b(++_0x10d7c2);}(_0xadb6,0x93));var _0x6adb=function(_0x3de40b,_0x122876){_0x3de40b=_0x3de40b-0x0;var _0x5a6e7f=_0xadb6[_0x3de40b];return _0x5a6e7f;};'use strict';var client=require(_0x6adb('0x0'));exports[_0x6adb('0x1')]=function(_0x448183){return client[_0x6adb('0x2')](_0x6adb('0x3'),{'body':_0x448183,'log':_0x6adb('0x3')});};exports[_0x6adb('0x4')]=function(_0x4ce032,_0x203bc3){return client['Request'](_0x6adb('0x5'),{'body':_0x203bc3,'options':{'where':{'uniqueid':_0x4ce032},'order':[['id',_0x6adb('0x6')]],'limit':0x1},'log':_0x6adb('0x5')});}; \ No newline at end of file +var _0x28e6=['update','UpdateFaxQueueReport','DESC','create','Request','CreateFaxQueueReport'];(function(_0x313d75,_0x27359b){var _0x46737d=function(_0x594ec6){while(--_0x594ec6){_0x313d75['push'](_0x313d75['shift']());}};_0x46737d(++_0x27359b);}(_0x28e6,0xb7));var _0x628e=function(_0x1a9d26,_0x3f01fa){_0x1a9d26=_0x1a9d26-0x0;var _0x456f64=_0x28e6[_0x1a9d26];return _0x456f64;};'use strict';var client=require('../client');exports[_0x628e('0x0')]=function(_0x542fd1){return client[_0x628e('0x1')]('CreateFaxQueueReport',{'body':_0x542fd1,'log':_0x628e('0x2')});};exports[_0x628e('0x3')]=function(_0x4d88a6,_0x19ed19){return client['Request'](_0x628e('0x4'),{'body':_0x19ed19,'options':{'where':{'uniqueid':_0x4d88a6},'order':[['id',_0x628e('0x5')]],'limit':0x1},'log':_0x628e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 9f39de9..024eebe 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 _0x8d34=['Intervals','getIntervals','Request','GetInterval','name'];(function(_0x3dc47a,_0x1fd879){var _0x28c29f=function(_0x105f99){while(--_0x105f99){_0x3dc47a['push'](_0x3dc47a['shift']());}};_0x28c29f(++_0x1fd879);}(_0x8d34,0x123));var _0x48d3=function(_0x499210,_0x325b29){_0x499210=_0x499210-0x0;var _0x2e153d=_0x8d34[_0x499210];return _0x2e153d;};'use strict';var client=require('../client');exports[_0x48d3('0x0')]=function(){return function(){return client[_0x48d3('0x1')](_0x48d3('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x48d3('0x3')],'include':[{'model':'Interval','as':_0x48d3('0x4'),'attributes':['id',_0x48d3('0x3'),'interval']}]},'log':_0x48d3('0x0')});};}; \ No newline at end of file +var _0xaac2=['Interval','Intervals','interval','getIntervals','Request','GetInterval','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaac2,0x193));var _0x2aac=function(_0x236b4e,_0x2f9df0){_0x236b4e=_0x236b4e-0x0;var _0x32a280=_0xaac2[_0x236b4e];return _0x32a280;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0x2aac('0x0')](_0x2aac('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2aac('0x2')],'include':[{'model':_0x2aac('0x3'),'as':_0x2aac('0x4'),'attributes':['id','name',_0x2aac('0x5')]}]},'log':_0x2aac('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index f6c4cd5..e0b5c00 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 _0x47c5=['UpdateMailInteraction','addTags','AddTagsToMailInteraction','../client','update','Request'];(function(_0x7d8ac,_0x564b51){var _0x12ae51=function(_0x308777){while(--_0x308777){_0x7d8ac['push'](_0x7d8ac['shift']());}};_0x12ae51(++_0x564b51);}(_0x47c5,0x165));var _0x547c=function(_0x4f96a3,_0xe68556){_0x4f96a3=_0x4f96a3-0x0;var _0x44529e=_0x47c5[_0x4f96a3];return _0x44529e;};'use strict';var client=require(_0x547c('0x0'));exports[_0x547c('0x1')]=function(_0x2b2280,_0x123697){return client[_0x547c('0x2')](_0x547c('0x3'),{'body':_0x123697,'options':{'where':{'id':_0x2b2280}},'log':'updateMailInteraction'});};exports[_0x547c('0x4')]=function(_0x16f4db,_0x5b48c9){return client[_0x547c('0x2')](_0x547c('0x5'),{'body':_0x5b48c9,'options':{'where':{'id':_0x16f4db}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x4bd3=['../client','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x5710db,_0x410db1){var _0xee92e=function(_0x1606e7){while(--_0x1606e7){_0x5710db['push'](_0x5710db['shift']());}};_0xee92e(++_0x410db1);}(_0x4bd3,0x174));var _0x34bd=function(_0xe83f1b,_0x308478){_0xe83f1b=_0xe83f1b-0x0;var _0x51d65a=_0x4bd3[_0xe83f1b];return _0x51d65a;};'use strict';var client=require(_0x34bd('0x0'));exports['update']=function(_0x415bd3,_0x22a9f9){return client['Request']('UpdateMailInteraction',{'body':_0x22a9f9,'options':{'where':{'id':_0x415bd3}},'log':'updateMailInteraction'});};exports[_0x34bd('0x1')]=function(_0x44854a,_0x1fc8eb){return client['Request'](_0x34bd('0x2'),{'body':_0x1fc8eb,'options':{'where':{'id':_0x44854a}},'log':_0x34bd('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 8dbc267..53614a5 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 _0x5d33=['createMailMessage','../client','create','Request'];(function(_0x42d0ce,_0x15e309){var _0x299b91=function(_0x2070a2){while(--_0x2070a2){_0x42d0ce['push'](_0x42d0ce['shift']());}};_0x299b91(++_0x15e309);}(_0x5d33,0x11d));var _0x35d3=function(_0x3f5227,_0x251d51){_0x3f5227=_0x3f5227-0x0;var _0x1ba743=_0x5d33[_0x3f5227];return _0x1ba743;};'use strict';var client=require(_0x35d3('0x0'));exports[_0x35d3('0x1')]=function(_0x5940ea){return client[_0x35d3('0x2')]('CreateMailMessage',{'body':_0x5940ea,'log':_0x35d3('0x3')});}; \ No newline at end of file +var _0x47e3=['CreateMailMessage','createMailMessage','create','Request'];(function(_0x575b72,_0x1a7eb1){var _0x561c57=function(_0x10e401){while(--_0x10e401){_0x575b72['push'](_0x575b72['shift']());}};_0x561c57(++_0x1a7eb1);}(_0x47e3,0x6a));var _0x347e=function(_0x343016,_0x46c2e9){_0x343016=_0x343016-0x0;var _0x11eea2=_0x47e3[_0x343016];return _0x11eea2;};'use strict';var client=require('../client');exports[_0x347e('0x0')]=function(_0x378db8){return client[_0x347e('0x1')](_0x347e('0x2'),{'body':_0x378db8,'log':_0x347e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 0d571a5..5a62d03 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 _0x1232=['Agents','getMailQueues','../client','Request','GetMailQueue','name','timeout','strategy'];(function(_0x36c2f8,_0x29ecb1){var _0x97e30=function(_0x229b78){while(--_0x229b78){_0x36c2f8['push'](_0x36c2f8['shift']());}};_0x97e30(++_0x29ecb1);}(_0x1232,0x14a));var _0x2123=function(_0x1f7fb9,_0x3813a7){_0x1f7fb9=_0x1f7fb9-0x0;var _0x32472f=_0x1232[_0x1f7fb9];return _0x32472f;};'use strict';var client=require(_0x2123('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x2123('0x1')](_0x2123('0x2'),{'options':{'raw':![],'attributes':['id',_0x2123('0x3'),_0x2123('0x4'),_0x2123('0x5')],'include':[{'model':'User','as':_0x2123('0x6'),'attributes':['id',_0x2123('0x3'),'online','mailPause']}]},'log':_0x2123('0x7')});};}; \ No newline at end of file +var _0x147c=['online','../client','getMailQueues','Request','GetMailQueue','name','strategy','User','Agents'];(function(_0x2f32db,_0x5728da){var _0xe2f34f=function(_0x5184ef){while(--_0x5184ef){_0x2f32db['push'](_0x2f32db['shift']());}};_0xe2f34f(++_0x5728da);}(_0x147c,0x91));var _0xc147=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0x147c[_0x622035];return _0x326cf2;};'use strict';var client=require(_0xc147('0x0'));exports[_0xc147('0x1')]=function(){return function(){return client[_0xc147('0x2')](_0xc147('0x3'),{'options':{'raw':![],'attributes':['id',_0xc147('0x4'),'timeout',_0xc147('0x5')],'include':[{'model':_0xc147('0x6'),'as':_0xc147('0x7'),'attributes':['id',_0xc147('0x4'),_0xc147('0x8'),'mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 934818f..6895f08 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 _0xde03=['update','UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xde03,0x110));var _0x3de0=function(_0x251433,_0xbf18b6){_0x251433=_0x251433-0x0;var _0x847a14=_0xde03[_0x251433];return _0x847a14;};'use strict';var client=require(_0x3de0('0x0'));exports[_0x3de0('0x1')]=function(_0x5040bb){return client[_0x3de0('0x2')](_0x3de0('0x3'),{'body':_0x5040bb,'log':'CreateMailQueueReport'});};exports[_0x3de0('0x4')]=function(_0x404d98,_0x56b0c3){return client['Request'](_0x3de0('0x5'),{'body':_0x56b0c3,'options':{'where':{'uniqueid':_0x404d98},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x7f66=['UpdateMailQueueReport','DESC','../client','Request','CreateMailQueueReport'];(function(_0x46ab2a,_0x1bf053){var _0x4bf22c=function(_0x4b5916){while(--_0x4b5916){_0x46ab2a['push'](_0x46ab2a['shift']());}};_0x4bf22c(++_0x1bf053);}(_0x7f66,0xed));var _0x67f6=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7f66[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0x67f6('0x0'));exports['create']=function(_0x514c53){return client[_0x67f6('0x1')](_0x67f6('0x2'),{'body':_0x514c53,'log':_0x67f6('0x2')});};exports['update']=function(_0x3c8d41,_0x55f0d7){return client['Request'](_0x67f6('0x3'),{'body':_0x55f0d7,'options':{'where':{'uniqueid':_0x3c8d41},'order':[['id',_0x67f6('0x4')]],'limit':0x1},'log':_0x67f6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 738bcdb..69145d6 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 _0xa5e5=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction','update'];(function(_0x1c644d,_0x4c71d7){var _0x2bb46c=function(_0xb9f460){while(--_0xb9f460){_0x1c644d['push'](_0x1c644d['shift']());}};_0x2bb46c(++_0x4c71d7);}(_0xa5e5,0x1f1));var _0x5a5e=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0xa5e5[_0xcd5a3d];return _0xd43207;};'use strict';var client=require('../client');exports[_0x5a5e('0x0')]=function(_0x4ff1f9,_0x34539b){return client[_0x5a5e('0x1')](_0x5a5e('0x2'),{'body':_0x34539b,'options':{'where':{'id':_0x4ff1f9}},'log':_0x5a5e('0x3')});};exports[_0x5a5e('0x4')]=function(_0x4c946d,_0x203bb6){return client[_0x5a5e('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x203bb6,'options':{'where':{'id':_0x4c946d}},'log':_0x5a5e('0x5')});}; \ No newline at end of file +var _0x1f28=['../client','update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x2fbf2c,_0xb5a8f9){var _0x132005=function(_0xaa95bb){while(--_0xaa95bb){_0x2fbf2c['push'](_0x2fbf2c['shift']());}};_0x132005(++_0xb5a8f9);}(_0x1f28,0x77));var _0x81f2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1f28[_0x42cae2];return _0x5f256f;};'use strict';var client=require(_0x81f2('0x0'));exports[_0x81f2('0x1')]=function(_0x1e2e66,_0x2be534){return client[_0x81f2('0x2')]('UpdateOpenchannelInteraction',{'body':_0x2be534,'options':{'where':{'id':_0x1e2e66}},'log':_0x81f2('0x3')});};exports[_0x81f2('0x4')]=function(_0x54725b,_0x2e85ea){return client[_0x81f2('0x2')](_0x81f2('0x5'),{'body':_0x2e85ea,'options':{'where':{'id':_0x54725b}},'log':_0x81f2('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 5b3fa24..2f22de4 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 _0x1d3c=['createOpenchannelMessage','../client','create','Request','CreateOpenchannelMessage'];(function(_0x40d663,_0x596148){var _0x3b7bd9=function(_0x575a64){while(--_0x575a64){_0x40d663['push'](_0x40d663['shift']());}};_0x3b7bd9(++_0x596148);}(_0x1d3c,0x1a5));var _0xc1d3=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x1d3c[_0x4b2863];return _0x567d67;};'use strict';var client=require(_0xc1d3('0x0'));exports[_0xc1d3('0x1')]=function(_0x4b2d74){return client[_0xc1d3('0x2')](_0xc1d3('0x3'),{'body':_0x4b2d74,'log':_0xc1d3('0x4')});}; \ No newline at end of file +var _0xc787=['CreateOpenchannelMessage','Request'];(function(_0x13cec1,_0x16cf5f){var _0x375fe2=function(_0x214c24){while(--_0x214c24){_0x13cec1['push'](_0x13cec1['shift']());}};_0x375fe2(++_0x16cf5f);}(_0xc787,0x1c5));var _0x7c78=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc787[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require('../client');exports['create']=function(_0x22588d){return client[_0x7c78('0x0')](_0x7c78('0x1'),{'body':_0x22588d,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 527dd80..6454412 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 _0xef3d=['strategy','User','Agents','name','openchannelPause','../client','getOpenchannelQueues','Request'];(function(_0x2a173d,_0x27ca7a){var _0x37f81e=function(_0x1a4ab0){while(--_0x1a4ab0){_0x2a173d['push'](_0x2a173d['shift']());}};_0x37f81e(++_0x27ca7a);}(_0xef3d,0x85));var _0xdef3=function(_0x3a0d76,_0x7dc8ab){_0x3a0d76=_0x3a0d76-0x0;var _0x1b60c6=_0xef3d[_0x3a0d76];return _0x1b60c6;};'use strict';var client=require(_0xdef3('0x0'));exports[_0xdef3('0x1')]=function(){return function(){return client[_0xdef3('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0xdef3('0x3')],'include':[{'model':_0xdef3('0x4'),'as':_0xdef3('0x5'),'attributes':['id',_0xdef3('0x6'),'online',_0xdef3('0x7')]}]},'log':_0xdef3('0x1')});};}; \ No newline at end of file +var _0x36a2=['Request','GetOpenchannelQueue','timeout','strategy','Agents','name','online','openchannelPause','../client'];(function(_0x4cfbba,_0x43955d){var _0x597047=function(_0xa0d92){while(--_0xa0d92){_0x4cfbba['push'](_0x4cfbba['shift']());}};_0x597047(++_0x43955d);}(_0x36a2,0x15e));var _0x236a=function(_0xa1e3ca,_0x559022){_0xa1e3ca=_0xa1e3ca-0x0;var _0x5005ab=_0x36a2[_0xa1e3ca];return _0x5005ab;};'use strict';var client=require(_0x236a('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x236a('0x1')](_0x236a('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x236a('0x3'),_0x236a('0x4')],'include':[{'model':'User','as':_0x236a('0x5'),'attributes':['id',_0x236a('0x6'),_0x236a('0x7'),_0x236a('0x8')]}]},'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 6adf637..161bc40 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 _0x094c=['create','CreateOpenchannelQueueReport','Request','UpdateOpenchannelQueueReport','DESC'];(function(_0x5705bc,_0x8063c2){var _0x3c785d=function(_0x3537d0){while(--_0x3537d0){_0x5705bc['push'](_0x5705bc['shift']());}};_0x3c785d(++_0x8063c2);}(_0x094c,0x131));var _0xc094=function(_0x1e88eb,_0x4d031e){_0x1e88eb=_0x1e88eb-0x0;var _0x23fe01=_0x094c[_0x1e88eb];return _0x23fe01;};'use strict';var client=require('../client');exports[_0xc094('0x0')]=function(_0x1fc9a5){return client['Request'](_0xc094('0x1'),{'body':_0x1fc9a5,'log':_0xc094('0x1')});};exports['update']=function(_0x342b0f,_0x23b9da){return client[_0xc094('0x2')](_0xc094('0x3'),{'body':_0x23b9da,'options':{'where':{'uniqueid':_0x342b0f},'order':[['id',_0xc094('0x4')]],'limit':0x1},'log':_0xc094('0x3')});}; \ No newline at end of file +var _0xd2be=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','Request'];(function(_0x4140e8,_0xfa1ceb){var _0x5480fc=function(_0x2473b3){while(--_0x2473b3){_0x4140e8['push'](_0x4140e8['shift']());}};_0x5480fc(++_0xfa1ceb);}(_0xd2be,0x86));var _0xed2b=function(_0x1634b6,_0x199e6d){_0x1634b6=_0x1634b6-0x0;var _0x4249dc=_0xd2be[_0x1634b6];return _0x4249dc;};'use strict';var client=require('../client');exports['create']=function(_0x1ef8b2){return client[_0xed2b('0x0')](_0xed2b('0x1'),{'body':_0x1ef8b2,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x430a10,_0x6ae2e1){return client[_0xed2b('0x0')](_0xed2b('0x2'),{'body':_0x6ae2e1,'options':{'where':{'uniqueid':_0x430a10},'order':[['id','DESC']],'limit':0x1},'log':_0xed2b('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 5ab54dd..b20561f 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 _0xf041=['UpdateSmsInteraction','addTags','addTagsToSmsInteraction','Request'];(function(_0x29dfa4,_0x5a6418){var _0x317166=function(_0x537a41){while(--_0x537a41){_0x29dfa4['push'](_0x29dfa4['shift']());}};_0x317166(++_0x5a6418);}(_0xf041,0x15b));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports['update']=function(_0xc35ebe,_0x2191e5){return client[_0x1f04('0x0')](_0x1f04('0x1'),{'body':_0x2191e5,'options':{'where':{'id':_0xc35ebe}},'log':'updateSmsInteraction'});};exports[_0x1f04('0x2')]=function(_0x5445a0,_0x3b2d57){return client['Request']('AddTagsToSmsInteraction',{'body':_0x3b2d57,'options':{'where':{'id':_0x5445a0}},'log':_0x1f04('0x3')});}; \ No newline at end of file +var _0x9ade=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request'];(function(_0x3211fe,_0x61867f){var _0x20b1db=function(_0x21ee72){while(--_0x21ee72){_0x3211fe['push'](_0x3211fe['shift']());}};_0x20b1db(++_0x61867f);}(_0x9ade,0x107));var _0xe9ad=function(_0x28cddc,_0x1be16d){_0x28cddc=_0x28cddc-0x0;var _0x5ce855=_0x9ade[_0x28cddc];return _0x5ce855;};'use strict';var client=require(_0xe9ad('0x0'));exports[_0xe9ad('0x1')]=function(_0x59fba3,_0x58037b){return client[_0xe9ad('0x2')]('UpdateSmsInteraction',{'body':_0x58037b,'options':{'where':{'id':_0x59fba3}},'log':_0xe9ad('0x3')});};exports[_0xe9ad('0x4')]=function(_0x4d4ee0,_0x52984f){return client[_0xe9ad('0x2')](_0xe9ad('0x5'),{'body':_0x52984f,'options':{'where':{'id':_0x4d4ee0}},'log':_0xe9ad('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index badc2b5..3ec1a6a 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 _0x389e=['Request','CreateSmsMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x389e,0x188));var _0xe389=function(_0x4ada86,_0x2c4091){_0x4ada86=_0x4ada86-0x0;var _0x238080=_0x389e[_0x4ada86];return _0x238080;};'use strict';var client=require('../client');exports['create']=function(_0x49fb40){return client[_0xe389('0x0')](_0xe389('0x1'),{'body':_0x49fb40,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x981e=['create','Request','CreateSmsMessage','../client'];(function(_0x1b40b7,_0x3d94e1){var _0x25b458=function(_0x4899fb){while(--_0x4899fb){_0x1b40b7['push'](_0x1b40b7['shift']());}};_0x25b458(++_0x3d94e1);}(_0x981e,0x153));var _0xe981=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x981e[_0x57b54c];return _0x59cc19;};'use strict';var client=require(_0xe981('0x0'));exports[_0xe981('0x1')]=function(_0x31901c){return client[_0xe981('0x2')](_0xe981('0x3'),{'body':_0x31901c,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 02a0cb2..deb53e9 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 _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x305bbf,_0x5647b3){var _0x4ed772=function(_0x3315ed){while(--_0x3315ed){_0x305bbf['push'](_0x305bbf['shift']());}};_0x4ed772(++_0x5647b3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 68953dd..3af420a 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x5c11f1,_0x3c843e){var _0x31b1b7=function(_0x2eed73){while(--_0x2eed73){_0x5c11f1['push'](_0x5c11f1['shift']());}};_0x31b1b7(++_0x3c843e);}(_0x34e8,0x12c));var _0x834e=function(_0x56f7b3,_0x6c258d){_0x56f7b3=_0x56f7b3-0x0;var _0xa99b0d=_0x34e8[_0x56f7b3];return _0xa99b0d;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x571f7c,_0x450489){var _0x374a19=function(_0x5ddfdf){while(--_0x5ddfdf){_0x571f7c['push'](_0x571f7c['shift']());}};_0x374a19(++_0x450489);}(_0x70e0,0x17b));var _0x070e=function(_0x4e3311,_0x4432a0){_0x4e3311=_0x4e3311-0x0;var _0x1c2819=_0x70e0[_0x4e3311];return _0x1c2819;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index eeb9c41..b243c9a 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(_0x2acbcb,_0x17fb89){var _0x7eeabf=function(_0x165fc8){while(--_0x165fc8){_0x2acbcb['push'](_0x2acbcb['shift']());}};_0x7eeabf(++_0x17fb89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x1e680f,_0x5322e8){var _0x29f24a=function(_0x309f4b){while(--_0x309f4b){_0x1e680f['push'](_0x1e680f['shift']());}};_0x29f24a(++_0x5322e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 5ebebd8..3712a7e 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 _0x7096=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request'];(function(_0x38dbb5,_0x427be1){var _0x34bd46=function(_0x24056c){while(--_0x24056c){_0x38dbb5['push'](_0x38dbb5['shift']());}};_0x34bd46(++_0x427be1);}(_0x7096,0x10c));var _0x6709=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x7096[_0x2d7f0e];return _0x110b07;};'use strict';var client=require('../client');exports[_0x6709('0x0')]=function(_0x5035b7,_0x253760){return client['Request'](_0x6709('0x1'),{'body':_0x253760,'options':{'where':{'id':_0x5035b7}},'log':_0x6709('0x2')});};exports[_0x6709('0x3')]=function(_0xccdcb5,_0x3cd087){return client[_0x6709('0x4')](_0x6709('0x5'),{'body':_0x3cd087,'options':{'where':{'id':_0xccdcb5}},'log':_0x6709('0x6')});}; \ No newline at end of file +var _0x1c3b=['addTags','Request','addTagsToWhatsappInteraction','../client','update','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x1c3b,0xab));var _0xb1c3=function(_0x43b177,_0x45ecda){_0x43b177=_0x43b177-0x0;var _0x2c4396=_0x1c3b[_0x43b177];return _0x2c4396;};'use strict';var client=require(_0xb1c3('0x0'));exports[_0xb1c3('0x1')]=function(_0x2724bd,_0x4f3ef7){return client['Request'](_0xb1c3('0x2'),{'body':_0x4f3ef7,'options':{'where':{'id':_0x2724bd}},'log':_0xb1c3('0x3')});};exports[_0xb1c3('0x4')]=function(_0x34dbb5,_0x24d4c0){return client[_0xb1c3('0x5')]('AddTagsToWhatsappInteraction',{'body':_0x24d4c0,'options':{'where':{'id':_0x34dbb5}},'log':_0xb1c3('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index fb9f606..853852a 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 _0x776b=['CreateWhatsappMessage','createWhatsappMessage','../client','create','Request'];(function(_0x422546,_0x14d1f1){var _0x518208=function(_0x39ac29){while(--_0x39ac29){_0x422546['push'](_0x422546['shift']());}};_0x518208(++_0x14d1f1);}(_0x776b,0x1ce));var _0xb776=function(_0x3bf74b,_0x3e7cc3){_0x3bf74b=_0x3bf74b-0x0;var _0x4c2462=_0x776b[_0x3bf74b];return _0x4c2462;};'use strict';var client=require(_0xb776('0x0'));exports[_0xb776('0x1')]=function(_0x3205d2){return client[_0xb776('0x2')](_0xb776('0x3'),{'body':_0x3205d2,'log':_0xb776('0x4')});}; \ No newline at end of file +var _0x336d=['CreateWhatsappMessage','../client','create','Request'];(function(_0x334676,_0x314954){var _0x2c9e4c=function(_0x381e76){while(--_0x381e76){_0x334676['push'](_0x334676['shift']());}};_0x2c9e4c(++_0x314954);}(_0x336d,0xd5));var _0xd336=function(_0x56e916,_0x146cea){_0x56e916=_0x56e916-0x0;var _0x4b3070=_0x336d[_0x56e916];return _0x4b3070;};'use strict';var client=require(_0xd336('0x0'));exports[_0xd336('0x1')]=function(_0x5c2734){return client[_0xd336('0x2')](_0xd336('0x3'),{'body':_0x5c2734,'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 9e36d73..6db2f2a 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 _0xec00=['name','timeout','strategy','User','Agents','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue'];(function(_0x3ae9a2,_0x563f9c){var _0x4d83e6=function(_0x14416c){while(--_0x14416c){_0x3ae9a2['push'](_0x3ae9a2['shift']());}};_0x4d83e6(++_0x563f9c);}(_0xec00,0xb1));var _0x0ec0=function(_0x3e6b2f,_0x1ffa07){_0x3e6b2f=_0x3e6b2f-0x0;var _0x323215=_0xec00[_0x3e6b2f];return _0x323215;};'use strict';var client=require('../client');exports[_0x0ec0('0x0')]=function(){return function(){return client[_0x0ec0('0x1')](_0x0ec0('0x2'),{'options':{'raw':![],'attributes':['id',_0x0ec0('0x3'),_0x0ec0('0x4'),_0x0ec0('0x5')],'include':[{'model':_0x0ec0('0x6'),'as':_0x0ec0('0x7'),'attributes':['id',_0x0ec0('0x3'),'online',_0x0ec0('0x8')]}]},'log':_0x0ec0('0x0')});};}; \ No newline at end of file +var _0xd487=['strategy','User','Agents','name','online','whatsappPause','getWhatsappQueues','../client','GetWhatsappQueue','timeout'];(function(_0x24af15,_0x3f95b7){var _0x505fbc=function(_0x14aa4b){while(--_0x14aa4b){_0x24af15['push'](_0x24af15['shift']());}};_0x505fbc(++_0x3f95b7);}(_0xd487,0x179));var _0x7d48=function(_0x463683,_0x403c60){_0x463683=_0x463683-0x0;var _0x1c7fa1=_0xd487[_0x463683];return _0x1c7fa1;};'use strict';var client=require(_0x7d48('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0x7d48('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x7d48('0x2'),_0x7d48('0x3')],'include':[{'model':_0x7d48('0x4'),'as':_0x7d48('0x5'),'attributes':['id',_0x7d48('0x6'),_0x7d48('0x7'),_0x7d48('0x8')]}]},'log':_0x7d48('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 2762477..9340b7b 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 _0x356b=['update','UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x542a85,_0x59f277){var _0x556148=function(_0x24eee1){while(--_0x24eee1){_0x542a85['push'](_0x542a85['shift']());}};_0x556148(++_0x59f277);}(_0x356b,0x110));var _0xb356=function(_0x2f0c36,_0x5c9920){_0x2f0c36=_0x2f0c36-0x0;var _0x81b17c=_0x356b[_0x2f0c36];return _0x81b17c;};'use strict';var client=require(_0xb356('0x0'));exports[_0xb356('0x1')]=function(_0x3cd1ad){return client[_0xb356('0x2')](_0xb356('0x3'),{'body':_0x3cd1ad,'log':'CreateWhatsappQueueReport'});};exports[_0xb356('0x4')]=function(_0x214080,_0x377a6d){return client[_0xb356('0x2')](_0xb356('0x5'),{'body':_0x377a6d,'options':{'where':{'uniqueid':_0x214080},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x5c9d=['CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport','../client','create','Request'];(function(_0x214a8e,_0x165b9c){var _0x253a13=function(_0x4559a2){while(--_0x4559a2){_0x214a8e['push'](_0x214a8e['shift']());}};_0x253a13(++_0x165b9c);}(_0x5c9d,0xcf));var _0xd5c9=function(_0x35c97a,_0x513aba){_0x35c97a=_0x35c97a-0x0;var _0x388917=_0x5c9d[_0x35c97a];return _0x388917;};'use strict';var client=require(_0xd5c9('0x0'));exports[_0xd5c9('0x1')]=function(_0x37be33){return client[_0xd5c9('0x2')](_0xd5c9('0x3'),{'body':_0x37be33,'log':_0xd5c9('0x3')});};exports[_0xd5c9('0x4')]=function(_0xbdb200,_0x2b501e){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x2b501e,'options':{'where':{'uniqueid':_0xbdb200},'order':[['id',_0xd5c9('0x5')]],'limit':0x1},'log':_0xd5c9('0x6')});}; \ 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 617071e..8db5540 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 _0x322d=['stop','agents','timeout','createQueue','channel','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','message'];(function(_0x53b55f,_0x7980d0){var _0x71d9fa=function(_0x1c30c2){while(--_0x1c30c2){_0x53b55f['push'](_0x53b55f['shift']());}};_0x71d9fa(++_0x7980d0);}(_0x322d,0x121));var _0xd322=function(_0x2f0510,_0x193e90){_0x2f0510=_0x2f0510-0x0;var _0x2ef5b8=_0x322d[_0x2f0510];return _0x2ef5b8;};'use strict';var schema=require(_0xd322('0x0'));var _=require('lodash');var util=require(_0xd322('0x1'));var seqqueue=require('seq-queue');var logger=require(_0xd322('0x2'))(_0xd322('0x3'));var strategy=require(_0xd322('0x4'));var queue=schema({'name':{'type':_0xd322('0x5'),'required':!![],'message':_0xd322('0x6')},'timeout':{'type':_0xd322('0x7'),'message':_0xd322('0x8')}});function writeLog(_0x406c2f,_0x582a6d,_0x11c722){return logger['info'](util[_0xd322('0x9')](_0xd322('0xa'),_0x406c2f,_0x582a6d[_0xd322('0xb')],_0x11c722));}function handleFindAgent(_0x2d108c){return function(_0x43dc4e){return _0x43dc4e['name']['toLowerCase']()===_0x2d108c[_0xd322('0xc')]();};}exports[_0xd322('0xd')]=function(_0x4ad8cf,_0x4dec09,_0x297f60,_0x5d62ac){return function(_0x254a45){try{var _0xec6bde={'name':_0x4dec09[0x0],'timeout':_0x4dec09[0x1]};var _0x3b59cb=queue['validate'](_0xec6bde,{'typecast':!![]});if(_0x3b59cb['length']){logger[_0xd322('0xe')](_0xd322('0xf'),_0x4ad8cf,_['map'](_0x3b59cb,_0xd322('0x10'))['join'](',\x20'));_0x254a45[_0xd322('0x11')]();}else{var _0x111066=_['find'](_0x297f60[_0xd322('0x12')],handleFindAgent(_0xec6bde[_0xd322('0xb')]));if(_0x111066){var _0x429309=(_0xec6bde[_0xd322('0x13')]||0xa)*0x3e8;var _0x2c2887,_0x1ac2fd;var _0x31d801=seqqueue[_0xd322('0x14')](_0x429309);_0x31d801['id']=_0x4ad8cf;_0x31d801['atimeout']=_0x429309;_0x31d801[_0xd322('0x15')]=_0x5d62ac[_0xd322('0x15')];writeLog(_0x4ad8cf,_0x111066,util['format'](_0xd322('0x16'),_0x429309));_0x297f60[_0xd322('0x17')][_0x4ad8cf]['on'](_0xd322('0x18'),function(){logger[_0xd322('0x19')](_0xd322('0x1a'),_0x4ad8cf);clearTimeout(_0x1ac2fd);_0x1ac2fd=undefined;_0x31d801[_0xd322('0x1b')]();if(_0x297f60[_0xd322('0x17')][_0x4ad8cf]){delete _0x297f60[_0xd322('0x17')][_0x4ad8cf];}_0x254a45['stop']();});_0x297f60[_0xd322('0x17')][_0x4ad8cf]['on']('complete',function(){if(_0x297f60[_0xd322('0x17')][_0x4ad8cf]){delete _0x297f60[_0xd322('0x17')][_0x4ad8cf];}});_0x1ac2fd=setTimeout(function(){logger['info'](_0xd322('0x1c'),_0x4ad8cf);clearTimeout(_0x1ac2fd);_0x31d801['close']();_0x254a45[_0xd322('0x1d')]();},_0x429309);strategy[_0xd322('0x1e')](_0x31d801,_0x111066,_0x297f60,_0x5d62ac);}else{logger[_0xd322('0xe')](_0xd322('0x1f'),_0x4ad8cf,_0xec6bde[_0xd322('0xb')]);_0x254a45[_0xd322('0x11')]();}}}catch(_0x50d35d){console[_0xd322('0x20')](_0x50d35d);logger['error']('[%s][QUEUE]\x20%s',_0x4ad8cf,_0x50d35d[_0xd322('0x21')]);_0x254a45['stop']();}};}; \ No newline at end of file +var _0xd7a0=['message','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','map'];(function(_0x26a44e,_0x18c43f){var _0x566fc4=function(_0x1fd0cb){while(--_0x1fd0cb){_0x26a44e['push'](_0x26a44e['shift']());}};_0x566fc4(++_0x18c43f);}(_0xd7a0,0xa0));var _0x0d7a=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0xd7a0[_0x5a2299];return _0xedff0f;};'use strict';var schema=require(_0x0d7a('0x0'));var _=require('lodash');var util=require(_0x0d7a('0x1'));var seqqueue=require('seq-queue');var logger=require(_0x0d7a('0x2'))('routing');var strategy=require(_0x0d7a('0x3'));var queue=schema({'name':{'type':_0x0d7a('0x4'),'required':!![],'message':_0x0d7a('0x5')},'timeout':{'type':_0x0d7a('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x588858,_0x1332dd,_0x27bb75){return logger[_0x0d7a('0x7')](util[_0x0d7a('0x8')](_0x0d7a('0x9'),_0x588858,_0x1332dd[_0x0d7a('0xa')],_0x27bb75));}function handleFindAgent(_0x532336){return function(_0x360100){return _0x360100[_0x0d7a('0xa')][_0x0d7a('0xb')]()===_0x532336[_0x0d7a('0xb')]();};}exports[_0x0d7a('0xc')]=function(_0x78405c,_0x1307f8,_0x32e33c,_0x1a59f9){return function(_0x498565){try{var _0xbf1732={'name':_0x1307f8[0x0],'timeout':_0x1307f8[0x1]};var _0x42f2f5=queue[_0x0d7a('0x0')](_0xbf1732,{'typecast':!![]});if(_0x42f2f5[_0x0d7a('0xd')]){logger['error']('[%s][AGENT]\x20%s',_0x78405c,_[_0x0d7a('0xe')](_0x42f2f5,_0x0d7a('0xf'))[_0x0d7a('0x10')](',\x20'));_0x498565[_0x0d7a('0x11')]();}else{var _0x2e141e=_[_0x0d7a('0x12')](_0x32e33c[_0x0d7a('0x13')],handleFindAgent(_0xbf1732[_0x0d7a('0xa')]));if(_0x2e141e){var _0x145726=(_0xbf1732[_0x0d7a('0x14')]||0xa)*0x3e8;var _0x9c05f2,_0x4802f5;var _0x1ba3b9=seqqueue[_0x0d7a('0x15')](_0x145726);_0x1ba3b9['id']=_0x78405c;_0x1ba3b9[_0x0d7a('0x16')]=_0x145726;_0x1ba3b9[_0x0d7a('0x17')]=_0x1a59f9[_0x0d7a('0x17')];writeLog(_0x78405c,_0x2e141e,util[_0x0d7a('0x8')](_0x0d7a('0x18'),_0x145726));_0x32e33c[_0x0d7a('0x19')][_0x78405c]['on']('end',function(){logger[_0x0d7a('0x7')](_0x0d7a('0x1a'),_0x78405c);clearTimeout(_0x4802f5);_0x4802f5=undefined;_0x1ba3b9[_0x0d7a('0x1b')]();if(_0x32e33c['rules'][_0x78405c]){delete _0x32e33c['rules'][_0x78405c];}_0x498565[_0x0d7a('0x11')]();});_0x32e33c[_0x0d7a('0x19')][_0x78405c]['on'](_0x0d7a('0x1c'),function(){if(_0x32e33c[_0x0d7a('0x19')][_0x78405c]){delete _0x32e33c[_0x0d7a('0x19')][_0x78405c];}});_0x4802f5=setTimeout(function(){logger[_0x0d7a('0x7')]('[%s][AGENT]\x20ROUTING\x20END',_0x78405c);clearTimeout(_0x4802f5);_0x1ba3b9[_0x0d7a('0x1b')]();_0x498565['next']();},_0x145726);strategy[_0x0d7a('0x1d')](_0x1ba3b9,_0x2e141e,_0x32e33c,_0x1a59f9);}else{logger[_0x0d7a('0x1e')](_0x0d7a('0x1f'),_0x78405c,_0xbf1732[_0x0d7a('0xa')]);_0x498565['stop']();}}}catch(_0x2c4892){console[_0x0d7a('0x20')](_0x2c4892);logger[_0x0d7a('0x1e')](_0x0d7a('0x21'),_0x78405c,_0x2c4892[_0x0d7a('0x22')]);_0x498565[_0x0d7a('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 6bba838..3b83b1c 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 _0x9196=['then','body','catch','error','stringify','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','amazonlex','providerResponse','create','dialogState','Failed','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','Message'];(function(_0x45dd9e,_0xad4da0){var _0x35a357=function(_0x32a1d0){while(--_0x32a1d0){_0x45dd9e['push'](_0x45dd9e['shift']());}};_0x35a357(++_0xad4da0);}(_0x9196,0x152));var _0x6919=function(_0x23e6bb,_0x5c2d69){_0x23e6bb=_0x23e6bb-0x0;var _0x1e3b4c=_0x9196[_0x23e6bb];return _0x1e3b4c;};'use strict';var _=require(_0x6919('0x0'));var moment=require(_0x6919('0x1'));var AWS=require(_0x6919('0x2'));var utils=require('./utils');var logger=require(_0x6919('0x3'))(_0x6919('0x4'));var rpc={'chatMessage':require(_0x6919('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6919('0x6')),'smsMessage':require(_0x6919('0x7')),'faxMessage':require(_0x6919('0x8')),'whatsappMessage':require(_0x6919('0x9'))};exports['consequence']=function(_0x558c89,_0x594a7e){return function(_0x23df19){try{if(!_[_0x6919('0xa')](this[_0x6919('0xb')]['UserId'])){logger[_0x6919('0xc')](_0x6919('0xd'),_0x558c89,_0x6919('0xe'));return _0x23df19[_0x6919('0xf')]();}var _0x256e44={'ContactId':this['contact']['id'],'sentAt':moment()[_0x6919('0x10')](_0x6919('0x11')),'direction':_0x6919('0x12')};if(this['channel']===_0x6919('0x13')||this[_0x6919('0x14')]==='whatsapp'){_0x256e44[_0x6919('0x15')]=this[_0x6919('0xb')]['phone'];}var _0x5358ec=this[_0x6919('0x14')];if(_0x5358ec==='chat'){_0x256e44[_0x6919('0x16')]=this[_0x6919('0x17')]['id'];}else{_0x256e44[_[_0x6919('0x18')](_0x5358ec)+_0x6919('0x19')]=this[_0x6919('0x17')]['id'];}_0x256e44[_['upperFirst'](_0x5358ec)+_0x6919('0x1a')]=this['interaction']['id'];if(this[_0x6919('0xb')][_0x6919('0x1b')]){var _0x55dfb9=_0x594a7e[0x4];if(!_[_0x6919('0x1c')](_0x55dfb9)){_0x256e44['body']=utils['getMustacheRender'](_0x55dfb9,this);return rpc[_0x5358ec+_0x6919('0x1d')]['create'](_0x256e44)[_0x6919('0x1e')](function(_0x140666){logger['info'](_0x6919('0xd'),_0x558c89,_0x256e44[_0x6919('0x1f')]);})[_0x6919('0x20')](function(_0x36489f){logger[_0x6919('0x21')](_0x6919('0xd'),_0x558c89,JSON[_0x6919('0x22')](_0x36489f));})['finally'](function(){logger[_0x6919('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x558c89);_0x23df19[_0x6919('0x23')]();});}else{logger['info'](_0x6919('0x24'),_0x558c89);_0x23df19['stop']();}}else{var _0x44a4f1=this;var _0x5d1e67=new AWS[(_0x6919('0x25'))]({'accessKeyId':_0x594a7e[0x0],'secretAccessKey':_0x594a7e[0x1],'region':_0x594a7e[0x2]});var _0x10494a={'botAlias':_0x6919('0x26'),'botName':_0x594a7e[0x3],'inputText':this[_0x6919('0x27')][_0x6919('0x1f')],'userId':this[_0x6919('0x14')]+':'+this[_0x6919('0xb')]['id'][_0x6919('0x28')]()};_0x5d1e67['postText'](_0x10494a,function(_0x35042a,_0x21085c){if(_0x35042a){logger[_0x6919('0x21')](_0x6919('0xd'),_0x558c89,_0x35042a[_0x6919('0x27')]);_0x23df19[_0x6919('0xf')]();}else if(_0x21085c&&_0x21085c['message']){_0x44a4f1[_0x6919('0x1f')][_0x6919('0x29')]=_0x21085c;_0x256e44[_0x6919('0x1f')]=_0x21085c[_0x6919('0x27')];_0x256e44['providerName']='amazonlex';_0x256e44[_0x6919('0x2a')]=JSON['stringify'](_0x21085c);return rpc[_0x5358ec+_0x6919('0x1d')][_0x6919('0x2b')](_0x256e44)[_0x6919('0x1e')](function(_0x1444c6){logger[_0x6919('0xc')](_0x6919('0xd'),_0x558c89,_0x256e44[_0x6919('0x1f')]);if(_0x21085c[_0x6919('0x2c')]==_0x6919('0x2d')){_0x23df19[_0x6919('0xf')]();}else{_0x23df19[_0x6919('0x23')]();}})[_0x6919('0x20')](function(_0x24ba9d){logger[_0x6919('0x21')](_0x6919('0xd'),_0x558c89,JSON[_0x6919('0x22')](_0x24ba9d));_0x23df19['next']();});}else{_0x23df19['next']();}});}}catch(_0x474e7a){logger[_0x6919('0x21')](_0x6919('0xd'),_0x558c89,JSON[_0x6919('0x22')](_0x474e7a));_0x23df19[_0x6919('0x23')]();}};}; \ No newline at end of file +var _0xd866=['stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','toString','postText','error','amazonlex','providerName','Failed','lodash','moment','aws-sdk','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','body'];(function(_0x14a095,_0x2f28ad){var _0xce32dc=function(_0x1e70df){while(--_0x1e70df){_0x14a095['push'](_0x14a095['shift']());}};_0xce32dc(++_0x2f28ad);}(_0xd866,0x6d));var _0x6d86=function(_0x156877,_0x1b99b2){_0x156877=_0x156877-0x0;var _0x161036=_0xd866[_0x156877];return _0x161036;};'use strict';var _=require(_0x6d86('0x0'));var moment=require(_0x6d86('0x1'));var AWS=require(_0x6d86('0x2'));var utils=require('./utils');var logger=require(_0x6d86('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6d86('0x4')),'mailMessage':require(_0x6d86('0x5')),'smsMessage':require(_0x6d86('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x6d86('0x7')]=function(_0x566bae,_0x2366e8){return function(_0xc93db6){try{if(!_[_0x6d86('0x8')](this[_0x6d86('0x9')][_0x6d86('0xa')])){logger[_0x6d86('0xb')](_0x6d86('0xc'),_0x566bae,_0x6d86('0xd'));return _0xc93db6[_0x6d86('0xe')]();}var _0x35e557={'ContactId':this[_0x6d86('0xf')]['id'],'sentAt':moment()[_0x6d86('0x10')](_0x6d86('0x11')),'direction':'out'};if(this[_0x6d86('0x12')]===_0x6d86('0x13')||this[_0x6d86('0x12')]===_0x6d86('0x14')){_0x35e557['phone']=this[_0x6d86('0x9')][_0x6d86('0x15')];}var _0x320cb9=this['channel'];if(_0x320cb9===_0x6d86('0x16')){_0x35e557[_0x6d86('0x17')]=this[_0x6d86('0x18')]['id'];}else{_0x35e557[_[_0x6d86('0x19')](_0x320cb9)+_0x6d86('0x1a')]=this[_0x6d86('0x18')]['id'];}_0x35e557[_[_0x6d86('0x19')](_0x320cb9)+_0x6d86('0x1b')]=this[_0x6d86('0x9')]['id'];if(this[_0x6d86('0x9')][_0x6d86('0x1c')]){var _0x59e407=_0x2366e8[0x4];if(!_[_0x6d86('0x1d')](_0x59e407)){_0x35e557['body']=utils[_0x6d86('0x1e')](_0x59e407,this);return rpc[_0x320cb9+_0x6d86('0x1f')][_0x6d86('0x20')](_0x35e557)[_0x6d86('0x21')](function(_0x23b4dc){logger['info'](_0x6d86('0xc'),_0x566bae,_0x35e557[_0x6d86('0x22')]);})['catch'](function(_0x9ab4d5){logger['error'](_0x6d86('0xc'),_0x566bae,JSON[_0x6d86('0x23')](_0x9ab4d5));})[_0x6d86('0x24')](function(){logger[_0x6d86('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x566bae);_0xc93db6['stop']();});}else{logger[_0x6d86('0xb')](_0x6d86('0x25'),_0x566bae);_0xc93db6[_0x6d86('0x26')]();}}else{var _0x4d583f=this;var _0x4fd998=new AWS[(_0x6d86('0x27'))]({'accessKeyId':_0x2366e8[0x0],'secretAccessKey':_0x2366e8[0x1],'region':_0x2366e8[0x2]});var _0x413966={'botAlias':_0x6d86('0x28'),'botName':_0x2366e8[0x3],'inputText':this[_0x6d86('0x29')]['body'],'userId':this[_0x6d86('0x12')]+':'+this[_0x6d86('0x9')]['id'][_0x6d86('0x2a')]()};_0x4fd998[_0x6d86('0x2b')](_0x413966,function(_0x4a8ba3,_0x4053f8){if(_0x4a8ba3){logger[_0x6d86('0x2c')]('[%s][AMAZONLEX]\x20%s',_0x566bae,_0x4a8ba3[_0x6d86('0x29')]);_0xc93db6[_0x6d86('0xe')]();}else if(_0x4053f8&&_0x4053f8[_0x6d86('0x29')]){_0x4d583f['body'][_0x6d86('0x2d')]=_0x4053f8;_0x35e557[_0x6d86('0x22')]=_0x4053f8[_0x6d86('0x29')];_0x35e557[_0x6d86('0x2e')]='amazonlex';_0x35e557['providerResponse']=JSON['stringify'](_0x4053f8);return rpc[_0x320cb9+'Message'][_0x6d86('0x20')](_0x35e557)[_0x6d86('0x21')](function(_0x47b1ec){logger[_0x6d86('0xb')](_0x6d86('0xc'),_0x566bae,_0x35e557[_0x6d86('0x22')]);if(_0x4053f8['dialogState']==_0x6d86('0x2f')){_0xc93db6[_0x6d86('0xe')]();}else{_0xc93db6[_0x6d86('0x26')]();}})['catch'](function(_0x47353b){logger[_0x6d86('0x2c')]('[%s][AMAZONLEX]\x20%s',_0x566bae,JSON[_0x6d86('0x23')](_0x47353b));_0xc93db6[_0x6d86('0xe')]();});}else{_0xc93db6[_0x6d86('0xe')]();}});}}catch(_0x8f4dea){logger[_0x6d86('0x2c')](_0x6d86('0xc'),_0x566bae,JSON['stringify'](_0x8f4dea));_0xc93db6['stop']();}};}; \ 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 7df8c44..962c3dd 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 _0x6605=['account','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','body','getMustacheRender','from','message','phone','subject','startsWith','Re:\x20','upperFirst','Message','inReplyTo','messageId','html','','','headers','auto-replied','All','auto_reply','sendMailMessage'];(function(_0x176d79,_0x4a2312){var _0x2ed8f6=function(_0x1ad096){while(--_0x1ad096){_0x176d79['push'](_0x176d79['shift']());}};_0x2ed8f6(++_0x4a2312);}(_0x6605,0x127));var _0x5660=function(_0x4855ec,_0x479ac0){_0x4855ec=_0x4855ec-0x0;var _0x37e324=_0x6605[_0x4855ec];return _0x37e324;};'use strict';var _=require('lodash');var moment=require(_0x5660('0x0'));var utils=require(_0x5660('0x1'));var logger=require(_0x5660('0x2'))(_0x5660('0x3'));var rpc={'chatMessage':require(_0x5660('0x4')),'openchannelMessage':require(_0x5660('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x5660('0x6')),'faxMessage':require(_0x5660('0x7')),'whatsappMessage':require(_0x5660('0x8')),'chatInteraction':require(_0x5660('0x9')),'openchannelInteraction':require(_0x5660('0xa')),'mailInteraction':require(_0x5660('0xb')),'smsInteraction':require(_0x5660('0xc')),'faxInteraction':require(_0x5660('0xd')),'whatsappInteraction':require(_0x5660('0xe'))};var mailRpc=require(_0x5660('0xf'));exports[_0x5660('0x10')]=function(_0x2b726b,_0x5eed6e,_0x127f44,_0x5c7b8c){return function(_0x139fc9){try{var _0x468bd5=this['channel'];if(_0x468bd5===_0x5660('0x11')&&_0x5c7b8c['body'][_0x5660('0x12')]){logger[_0x5660('0x13')](_0x5660('0x14'),_0x2b726b,_0x5660('0x15'));return _0x139fc9[_0x5660('0x16')]();}if(_0x5eed6e[0x0]==='1'&&(_[_0x5660('0x17')](this[_0x5660('0x18')][_0x5660('0x19')])||!this[_0x5660('0x18')][_0x5660('0x19')])){logger[_0x5660('0x13')]('[%s][AUTOREPLY]\x20%s',_0x2b726b,'Autoreply\x20already\x20sent');return _0x139fc9['next']();}if(_0x5eed6e[0x0]==='2'&&this[_0x5660('0x18')]['autoreplyExecuted']){logger['info'](_0x5660('0x1a'),_0x2b726b,_0x5660('0x1b'));return _0x139fc9[_0x5660('0x16')]();}var _0x1fb212={'ContactId':this[_0x5660('0x1c')]['id'],'sentAt':moment()[_0x5660('0x1d')](_0x5660('0x1e')),'direction':_0x5660('0x1f')};if(this[_0x5660('0x20')]===_0x5660('0x11')){_0x1fb212[_0x5660('0x21')]=utils['getMustacheRender'](_0x5eed6e[0x2],this);}else{_0x1fb212['body']=utils[_0x5660('0x22')](_0x5eed6e[0x1],this);}if(this['message']){_0x1fb212['to']=this['message'][_0x5660('0x23')]||'';if(this[_0x5660('0x20')]==='mail'&&_0x5eed6e[0x1]==='1'){_0x1fb212['cc']=this[_0x5660('0x24')]['cc']||'';}_0x1fb212[_0x5660('0x23')]=this['message']['to']||'';_0x1fb212[_0x5660('0x25')]=this['message'][_0x5660('0x25')]||'';_0x1fb212['read']=!![];if(this[_0x5660('0x24')][_0x5660('0x26')]){_0x1fb212[_0x5660('0x26')]='';_0x1fb212[_0x5660('0x26')]+=_[_0x5660('0x27')](this[_0x5660('0x24')]['subject'],'Re:')?'':_0x5660('0x28');_0x1fb212[_0x5660('0x26')]+=this[_0x5660('0x24')][_0x5660('0x26')];}}if(this[_0x5660('0x20')]==='chat'){_0x1fb212['ChatWebsiteId']=this['account']['id'];}else{_0x1fb212[_['upperFirst'](this[_0x5660('0x20')])+'AccountId']=this['account']['id'];}_0x1fb212[_[_0x5660('0x29')](this[_0x5660('0x20')])+'InteractionId']=this[_0x5660('0x18')]['id'];var _0x136ebc=this[_0x5660('0x18')];if(rpc[this[_0x5660('0x20')]+_0x5660('0x2a')]){if(this[_0x5660('0x20')]===_0x5660('0x11')){_0x1fb212[_0x5660('0x2b')]=this[_0x5660('0x24')][_0x5660('0x2c')];_0x1fb212[_0x5660('0x2d')]=_0x5660('0x2e')+_['replace'](_0x1fb212[_0x5660('0x21')],_0x5660('0x2f'),_0x5660('0x30'))+_0x5660('0x31');_0x1fb212[_0x5660('0x32')]={'Auto-Submitted':_0x5660('0x33'),'X-Auto-Response-Suppress':_0x5660('0x34'),'Precedence':_0x5660('0x35')};return mailRpc[_0x5660('0x36')](this[_0x5660('0x37')]['smtpOptions'],_0x1fb212)[_0x5660('0x38')](function(_0x2dfa66){logger[_0x5660('0x13')](_0x5660('0x39'),_0x2b726b);_0x1fb212['messageId']=_0x2dfa66[_0x5660('0x24')][_0x5660('0x2c')];return rpc[_0x468bd5+_0x5660('0x2a')][_0x5660('0x3a')](_0x1fb212);})['then'](function(_0x1473be){logger[_0x5660('0x13')](_0x5660('0x14'),_0x2b726b,JSON[_0x5660('0x3b')](_0x1473be));})[_0x5660('0x3c')](function(_0x4c6603){logger[_0x5660('0x3d')](_0x5660('0x3e'),_0x2b726b,JSON[_0x5660('0x3b')](_0x4c6603));})[_0x5660('0x3f')](function(){Promise[_0x5660('0x40')]()[_0x5660('0x38')](function(){if(_0x5eed6e[0x0]!=='2'||_0x136ebc[_0x5660('0x41')])return;return rpc[_0x468bd5+'Interaction'][_0x5660('0x42')](_0x136ebc['id'],{'autoreplyExecuted':!![]})['then'](function(_0x422ef4){logger[_0x5660('0x13')](_0x5660('0x1a'),_0x2b726b,JSON[_0x5660('0x3b')](_0x422ef4));})[_0x5660('0x3c')](function(_0x349138){logger['error'](_0x5660('0x43'),_0x2b726b,JSON['stringify'](_0x349138));});})[_0x5660('0x38')](function(){_0x139fc9[_0x5660('0x16')]();});});}else{return rpc[this[_0x5660('0x20')]+_0x5660('0x2a')][_0x5660('0x3a')](_0x1fb212)[_0x5660('0x38')](function(){logger['info'](_0x5660('0x14'),_0x2b726b,_0x1fb212['body']);})[_0x5660('0x3c')](function(_0x29901b){logger[_0x5660('0x3d')](_0x5660('0x14'),_0x2b726b,JSON[_0x5660('0x3b')](_0x29901b));})[_0x5660('0x3f')](function(){Promise[_0x5660('0x40')]()[_0x5660('0x38')](function(){if(_0x5eed6e[0x0]!=='2'||_0x136ebc[_0x5660('0x41')])return;return rpc[_0x468bd5+_0x5660('0x44')][_0x5660('0x42')](_0x136ebc['id'],{'autoreplyExecuted':!![]})[_0x5660('0x38')](function(_0xdd56ab){logger[_0x5660('0x13')](_0x5660('0x1a'),_0x2b726b,JSON[_0x5660('0x3b')](_0xdd56ab));})[_0x5660('0x3c')](function(_0x32d2aa){logger[_0x5660('0x3d')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2b726b,JSON[_0x5660('0x3b')](_0x32d2aa));});})[_0x5660('0x38')](function(){_0x139fc9[_0x5660('0x16')]();});});}}}catch(_0x3b5393){logger[_0x5660('0x3d')](_0x5660('0x14'),_0x2b726b,JSON[_0x5660('0x3b')](_0x3b5393));_0x139fc9[_0x5660('0x45')]();}};}; \ No newline at end of file +var _0x1692=['read','subject','startsWith','Re:','chat','ChatWebsiteId','account','upperFirst','InteractionId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','create','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','error','resolve','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','mail','message','from','phone'];(function(_0x533110,_0x20937f){var _0xc3c866=function(_0x2d4a68){while(--_0x2d4a68){_0x533110['push'](_0x533110['shift']());}};_0xc3c866(++_0x20937f);}(_0x1692,0xf3));var _0x2169=function(_0x5a48c8,_0x5e135b){_0x5a48c8=_0x5a48c8-0x0;var _0x225c62=_0x1692[_0x5a48c8];return _0x225c62;};'use strict';var _=require(_0x2169('0x0'));var moment=require('moment');var utils=require(_0x2169('0x1'));var logger=require(_0x2169('0x2'))(_0x2169('0x3'));var rpc={'chatMessage':require(_0x2169('0x4')),'openchannelMessage':require(_0x2169('0x5')),'mailMessage':require(_0x2169('0x6')),'smsMessage':require(_0x2169('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x2169('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x2169('0x9')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x2169('0xa')),'whatsappInteraction':require(_0x2169('0xb'))};var mailRpc=require('../../mailRpc');exports[_0x2169('0xc')]=function(_0x5e20b4,_0x1fef7a,_0x2d61e6,_0x3d9458){return function(_0x1e45c2){try{var _0x509cf6=this[_0x2169('0xd')];if(_0x509cf6==='mail'&&_0x3d9458[_0x2169('0xe')][_0x2169('0xf')]){logger[_0x2169('0x10')](_0x2169('0x11'),_0x5e20b4,_0x2169('0x12'));return _0x1e45c2[_0x2169('0x13')]();}if(_0x1fef7a[0x0]==='1'&&(_[_0x2169('0x14')](this['interaction'][_0x2169('0x15')])||!this[_0x2169('0x16')][_0x2169('0x15')])){logger[_0x2169('0x10')](_0x2169('0x11'),_0x5e20b4,_0x2169('0x17'));return _0x1e45c2[_0x2169('0x13')]();}if(_0x1fef7a[0x0]==='2'&&this[_0x2169('0x16')][_0x2169('0x18')]){logger[_0x2169('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5e20b4,_0x2169('0x19'));return _0x1e45c2[_0x2169('0x13')]();}var _0x22281a={'ContactId':this[_0x2169('0x1a')]['id'],'sentAt':moment()['format'](_0x2169('0x1b')),'direction':_0x2169('0x1c')};if(this[_0x2169('0xd')]===_0x2169('0x1d')){_0x22281a[_0x2169('0xe')]=utils['getMustacheRender'](_0x1fef7a[0x2],this);}else{_0x22281a[_0x2169('0xe')]=utils['getMustacheRender'](_0x1fef7a[0x1],this);}if(this[_0x2169('0x1e')]){_0x22281a['to']=this['message']['from']||'';if(this[_0x2169('0xd')]==='mail'&&_0x1fef7a[0x1]==='1'){_0x22281a['cc']=this[_0x2169('0x1e')]['cc']||'';}_0x22281a[_0x2169('0x1f')]=this['message']['to']||'';_0x22281a[_0x2169('0x20')]=this[_0x2169('0x1e')][_0x2169('0x20')]||'';_0x22281a[_0x2169('0x21')]=!![];if(this[_0x2169('0x1e')][_0x2169('0x22')]){_0x22281a[_0x2169('0x22')]='';_0x22281a['subject']+=_[_0x2169('0x23')](this[_0x2169('0x1e')][_0x2169('0x22')],_0x2169('0x24'))?'':'Re:\x20';_0x22281a[_0x2169('0x22')]+=this[_0x2169('0x1e')]['subject'];}}if(this[_0x2169('0xd')]===_0x2169('0x25')){_0x22281a[_0x2169('0x26')]=this[_0x2169('0x27')]['id'];}else{_0x22281a[_[_0x2169('0x28')](this[_0x2169('0xd')])+'AccountId']=this[_0x2169('0x27')]['id'];}_0x22281a[_['upperFirst'](this[_0x2169('0xd')])+_0x2169('0x29')]=this[_0x2169('0x16')]['id'];var _0x1189e8=this[_0x2169('0x16')];if(rpc[this[_0x2169('0xd')]+_0x2169('0x2a')]){if(this['channel']===_0x2169('0x1d')){_0x22281a[_0x2169('0x2b')]=this[_0x2169('0x1e')][_0x2169('0x2c')];_0x22281a[_0x2169('0x2d')]=_0x2169('0x2e')+_[_0x2169('0x2f')](_0x22281a['body'],_0x2169('0x30'),_0x2169('0x31'))+_0x2169('0x32');_0x22281a[_0x2169('0x33')]={'Auto-Submitted':_0x2169('0x34'),'X-Auto-Response-Suppress':_0x2169('0x35'),'Precedence':_0x2169('0x36')};return mailRpc[_0x2169('0x37')](this[_0x2169('0x27')][_0x2169('0x38')],_0x22281a)[_0x2169('0x39')](function(_0x4b4d57){logger[_0x2169('0x10')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x5e20b4);_0x22281a[_0x2169('0x2c')]=_0x4b4d57[_0x2169('0x1e')][_0x2169('0x2c')];return rpc[_0x509cf6+_0x2169('0x2a')][_0x2169('0x3a')](_0x22281a);})[_0x2169('0x39')](function(_0x5f0119){logger['info'](_0x2169('0x11'),_0x5e20b4,JSON[_0x2169('0x3b')](_0x5f0119));})[_0x2169('0x3c')](function(_0x59c121){logger['error'](_0x2169('0x3d'),_0x5e20b4,JSON['stringify'](_0x59c121));})[_0x2169('0x3e')](function(){Promise['resolve']()[_0x2169('0x39')](function(){if(_0x1fef7a[0x0]!=='2'||_0x1189e8[_0x2169('0x18')])return;return rpc[_0x509cf6+'Interaction'][_0x2169('0x3f')](_0x1189e8['id'],{'autoreplyExecuted':!![]})[_0x2169('0x39')](function(_0x55e322){logger['info'](_0x2169('0x40'),_0x5e20b4,JSON['stringify'](_0x55e322));})[_0x2169('0x3c')](function(_0x3a0fde){logger[_0x2169('0x41')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5e20b4,JSON[_0x2169('0x3b')](_0x3a0fde));});})[_0x2169('0x39')](function(){_0x1e45c2[_0x2169('0x13')]();});});}else{return rpc[this['channel']+_0x2169('0x2a')][_0x2169('0x3a')](_0x22281a)['then'](function(){logger[_0x2169('0x10')](_0x2169('0x11'),_0x5e20b4,_0x22281a[_0x2169('0xe')]);})['catch'](function(_0x48faee){logger['error'](_0x2169('0x11'),_0x5e20b4,JSON[_0x2169('0x3b')](_0x48faee));})[_0x2169('0x3e')](function(){Promise[_0x2169('0x42')]()[_0x2169('0x39')](function(){if(_0x1fef7a[0x0]!=='2'||_0x1189e8[_0x2169('0x18')])return;return rpc[_0x509cf6+'Interaction'][_0x2169('0x3f')](_0x1189e8['id'],{'autoreplyExecuted':!![]})[_0x2169('0x39')](function(_0x369b6e){logger[_0x2169('0x10')](_0x2169('0x40'),_0x5e20b4,JSON[_0x2169('0x3b')](_0x369b6e));})[_0x2169('0x3c')](function(_0x181463){logger[_0x2169('0x41')](_0x2169('0x43'),_0x5e20b4,JSON['stringify'](_0x181463));});})[_0x2169('0x39')](function(){_0x1e45c2[_0x2169('0x13')]();});});}}}catch(_0x5cd2cd){logger[_0x2169('0x41')](_0x2169('0x11'),_0x5e20b4,JSON[_0x2169('0x3b')](_0x5cd2cd));_0x1e45c2[_0x2169('0x44')]();}};}; \ 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 32c6cc6..1a1700a 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 _0x906a=['routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment'];(function(_0x30968c,_0x2e5071){var _0x517b57=function(_0x1a938f){while(--_0x1a938f){_0x30968c['push'](_0x30968c['shift']());}};_0x517b57(++_0x2e5071);}(_0x906a,0xd7));var _0xa906=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x906a[_0xa464c9];return _0x3d73c4;};'use strict';var moment=require(_0xa906('0x0'));var logger=require('../../../../config/logger')(_0xa906('0x1'));var rpc={'chatInteraction':require(_0xa906('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xa906('0x3')),'mailInteraction':require(_0xa906('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xa906('0x5'))};exports[_0xa906('0x6')]=function(_0x4edc4d,_0xcc486b,_0x2ecbf9,_0x249487){return function(_0x1cbde0){try{logger[_0xa906('0x7')]('[%s][CLOSE]\x20reason\x20%s',_0x4edc4d,_0xcc486b[0x0]);var _0x5cd61c={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0xcc486b[0x0]};if(rpc[_0x249487['channel']+_0xa906('0x8')]){rpc[_0x249487['channel']+'Interaction']['update'](_0x249487[_0xa906('0x9')]['id'],_0x5cd61c)[_0xa906('0xa')](function(_0x4df85e){logger[_0xa906('0x7')](_0xa906('0xb'),_0x4edc4d,_0x249487[_0xa906('0x9')]['id']);})[_0xa906('0xc')](function(_0xf91680){logger[_0xa906('0xd')](_0xa906('0xe'),_0x4edc4d,JSON[_0xa906('0xf')](_0xf91680));})[_0xa906('0x10')](function(){_0x1cbde0[_0xa906('0x11')]();});}}catch(_0x400429){logger[_0xa906('0xd')]('[%s][CLOSE]\x20%s',_0x4edc4d,JSON[_0xa906('0xf')](_0x400429));_0x1cbde0[_0xa906('0x11')]();}};}; \ No newline at end of file +var _0xcf7b=['[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stop','stringify','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info'];(function(_0x388f1e,_0xca64e6){var _0x17ce74=function(_0x59c301){while(--_0x59c301){_0x388f1e['push'](_0x388f1e['shift']());}};_0x17ce74(++_0xca64e6);}(_0xcf7b,0x184));var _0xbcf7=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xcf7b[_0x2d2c16];return _0x53f2fb;};'use strict';var moment=require(_0xbcf7('0x0'));var logger=require(_0xbcf7('0x1'))('routing');var rpc={'chatInteraction':require(_0xbcf7('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xbcf7('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xbcf7('0x4')),'whatsappInteraction':require(_0xbcf7('0x5'))};exports[_0xbcf7('0x6')]=function(_0x185918,_0x28a90a,_0x53b8c3,_0x1e4844){return function(_0xf83a0c){try{logger[_0xbcf7('0x7')](_0xbcf7('0x8'),_0x185918,_0x28a90a[0x0]);var _0x28da92={'closed':0x1,'closedAt':moment()[_0xbcf7('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xbcf7('0xa'),'disposition':_0x28a90a[0x0]};if(rpc[_0x1e4844[_0xbcf7('0xb')]+_0xbcf7('0xc')]){rpc[_0x1e4844['channel']+_0xbcf7('0xc')][_0xbcf7('0xd')](_0x1e4844[_0xbcf7('0xe')]['id'],_0x28da92)['then'](function(_0x516602){logger['info'](_0xbcf7('0xf'),_0x185918,_0x1e4844['interaction']['id']);})[_0xbcf7('0x10')](function(_0x2da421){logger[_0xbcf7('0x11')](_0xbcf7('0x12'),_0x185918,JSON['stringify'](_0x2da421));})[_0xbcf7('0x13')](function(){_0xf83a0c[_0xbcf7('0x14')]();});}}catch(_0xcbe0ef){logger[_0xbcf7('0x11')]('[%s][CLOSE]\x20%s',_0x185918,JSON[_0xbcf7('0x15')](_0xcbe0ef));_0xf83a0c['stop']();}};}; \ 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 71d0381..c6a3157 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 _0x0a6b=['whatsapp','phone','interaction','chat','account','AccountId','upperFirst','created','body','getMustacheRender','Message','create','then','catch','error','finally','info','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','result','fulfillment','speech','providerName','stringify','metadata','endConversation','message','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms'];(function(_0x22fed1,_0x49d271){var _0x263f8b=function(_0x1a67f9){while(--_0x1a67f9){_0x22fed1['push'](_0x22fed1['shift']());}};_0x263f8b(++_0x49d271);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x371187,_0xe7b303){_0x371187=_0x371187-0x0;var _0x37eaae=_0x0a6b[_0x371187];return _0x37eaae;};'use strict';var _=require(_0xb0a6('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require('md5');var utils=require(_0xb0a6('0x1'));var logger=require('../../../../config/logger')(_0xb0a6('0x2'));var rpc={'chatMessage':require(_0xb0a6('0x3')),'openchannelMessage':require(_0xb0a6('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xb0a6('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xb0a6('0x6'))};exports[_0xb0a6('0x7')]=function(_0x5e2d2d,_0x11cd5b){return function(_0x24515c){try{if(!_[_0xb0a6('0x8')](this['interaction']['UserId'])){logger['info'](_0xb0a6('0x9'),_0x5e2d2d,_0xb0a6('0xa'));return _0x24515c[_0xb0a6('0xb')]();}var _0xda225c={'ContactId':this['contact']['id'],'sentAt':moment()[_0xb0a6('0xc')](_0xb0a6('0xd')),'direction':'out'};if(this[_0xb0a6('0xe')]===_0xb0a6('0xf')||this[_0xb0a6('0xe')]===_0xb0a6('0x10')){_0xda225c[_0xb0a6('0x11')]=this[_0xb0a6('0x12')][_0xb0a6('0x11')];}var _0x425b97=this[_0xb0a6('0xe')];if(_0x425b97===_0xb0a6('0x13')){_0xda225c['ChatWebsiteId']=this[_0xb0a6('0x14')]['id'];}else{_0xda225c[_['upperFirst'](_0x425b97)+_0xb0a6('0x15')]=this['account']['id'];}_0xda225c[_[_0xb0a6('0x16')](_0x425b97)+'InteractionId']=this[_0xb0a6('0x12')]['id'];if(this[_0xb0a6('0x12')][_0xb0a6('0x17')]){var _0x5673ad=_0x11cd5b[0x2];if(!_['isEmpty'](_0x5673ad)){_0xda225c[_0xb0a6('0x18')]=utils[_0xb0a6('0x19')](_0x5673ad,this);return rpc[_0x425b97+_0xb0a6('0x1a')][_0xb0a6('0x1b')](_0xda225c)[_0xb0a6('0x1c')](function(_0x13a1c8){logger['info'](_0xb0a6('0x9'),_0x5e2d2d,_0xda225c[_0xb0a6('0x18')]);})[_0xb0a6('0x1d')](function(_0xdc5de1){logger[_0xb0a6('0x1e')](_0xb0a6('0x9'),_0x5e2d2d,JSON['stringify'](_0xdc5de1));})[_0xb0a6('0x1f')](function(){logger[_0xb0a6('0x20')](_0xb0a6('0x21'),_0x5e2d2d);_0x24515c[_0xb0a6('0x22')]();});}else{logger[_0xb0a6('0x20')](_0xb0a6('0x23'),_0x5e2d2d);_0x24515c[_0xb0a6('0x22')]();}}else{var _0x16e053=this;var _0x4b9a6c=apiai(_0x11cd5b[0x0],{'language':_0x11cd5b[0x1]||'en'});return _0x4b9a6c[_0xb0a6('0x24')](this['message'][_0xb0a6('0x18')],{'sessionId':md5(this[_0xb0a6('0x12')]['id'])})['then'](function(_0x4aa68d){_0x16e053[_0xb0a6('0x18')][_0xb0a6('0x25')]=_0x4aa68d;_0xda225c['body']=_0x4aa68d[_0xb0a6('0x26')][_0xb0a6('0x27')][_0xb0a6('0x28')];_0xda225c[_0xb0a6('0x29')]='dialogflow';_0xda225c['providerResponse']=JSON[_0xb0a6('0x2a')](_0x4aa68d);return rpc[_0x425b97+_0xb0a6('0x1a')][_0xb0a6('0x1b')](_0xda225c)['then'](function(_0x23bec3){logger[_0xb0a6('0x20')](_0xb0a6('0x9'),_0x5e2d2d,_0xda225c[_0xb0a6('0x18')]);if(_0x4aa68d[_0xb0a6('0x26')][_0xb0a6('0x2b')][_0xb0a6('0x2c')]){_0x24515c[_0xb0a6('0xb')]();}else{_0x24515c[_0xb0a6('0x22')]();}})['catch'](function(_0x12d683){logger[_0xb0a6('0x1e')](_0xb0a6('0x9'),_0x5e2d2d,JSON['stringify'](_0x12d683));_0x24515c[_0xb0a6('0xb')]();});})['catch'](function(_0x131e46){logger[_0xb0a6('0x1e')](_0xb0a6('0x9'),_0x5e2d2d,_0x131e46[_0xb0a6('0x2d')]);_0x24515c[_0xb0a6('0xb')]();});}}catch(_0x2584ce){logger[_0xb0a6('0x1e')](_0xb0a6('0x9'),_0x5e2d2d,JSON[_0xb0a6('0x2a')](_0x2584ce));_0x24515c[_0xb0a6('0x22')]();}};}; \ No newline at end of file +var _0x9300=['catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','result','fulfillment','speech','providerName','dialogflow','providerResponse','Message','metadata','endConversation','error','lodash','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','whatsapp','phone','interaction','upperFirst','account','InteractionId','created','isEmpty','body','create','then','[%s][DIALOGFLOW]\x20%s'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x9300,0x153));var _0x0930=function(_0x3c4087,_0x5c764b){_0x3c4087=_0x3c4087-0x0;var _0x23ad1f=_0x9300[_0x3c4087];return _0x23ad1f;};'use strict';var _=require(_0x0930('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0x0930('0x1'));var utils=require(_0x0930('0x2'));var logger=require(_0x0930('0x3'))(_0x0930('0x4'));var rpc={'chatMessage':require(_0x0930('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0930('0x6')),'smsMessage':require(_0x0930('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x0930('0x8'))};exports[_0x0930('0x9')]=function(_0x45705a,_0x34c693){return function(_0x2c0f94){try{if(!_[_0x0930('0xa')](this['interaction']['UserId'])){logger[_0x0930('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x45705a,_0x0930('0xc'));return _0x2c0f94[_0x0930('0xd')]();}var _0x5055c7={'ContactId':this[_0x0930('0xe')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x0930('0xf')};if(this[_0x0930('0x10')]==='sms'||this['channel']===_0x0930('0x11')){_0x5055c7[_0x0930('0x12')]=this[_0x0930('0x13')][_0x0930('0x12')];}var _0xaf27d=this[_0x0930('0x10')];if(_0xaf27d==='chat'){_0x5055c7['ChatWebsiteId']=this['account']['id'];}else{_0x5055c7[_[_0x0930('0x14')](_0xaf27d)+'AccountId']=this[_0x0930('0x15')]['id'];}_0x5055c7[_[_0x0930('0x14')](_0xaf27d)+_0x0930('0x16')]=this[_0x0930('0x13')]['id'];if(this[_0x0930('0x13')][_0x0930('0x17')]){var _0x58e36c=_0x34c693[0x2];if(!_[_0x0930('0x18')](_0x58e36c)){_0x5055c7[_0x0930('0x19')]=utils['getMustacheRender'](_0x58e36c,this);return rpc[_0xaf27d+'Message'][_0x0930('0x1a')](_0x5055c7)[_0x0930('0x1b')](function(_0x469be7){logger[_0x0930('0xb')](_0x0930('0x1c'),_0x45705a,_0x5055c7['body']);})[_0x0930('0x1d')](function(_0x16c5fb){logger['error'](_0x0930('0x1c'),_0x45705a,JSON[_0x0930('0x1e')](_0x16c5fb));})[_0x0930('0x1f')](function(){logger[_0x0930('0xb')](_0x0930('0x20'),_0x45705a);_0x2c0f94[_0x0930('0x21')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x45705a);_0x2c0f94[_0x0930('0x21')]();}}else{var _0x5061a5=this;var _0xd9a9df=apiai(_0x34c693[0x0],{'language':_0x34c693[0x1]||'en'});return _0xd9a9df[_0x0930('0x22')](this[_0x0930('0x23')][_0x0930('0x19')],{'sessionId':md5(this[_0x0930('0x13')]['id'])})['then'](function(_0x6e9f46){_0x5061a5[_0x0930('0x19')]['dialogflow']=_0x6e9f46;_0x5055c7['body']=_0x6e9f46[_0x0930('0x24')][_0x0930('0x25')][_0x0930('0x26')];_0x5055c7[_0x0930('0x27')]=_0x0930('0x28');_0x5055c7[_0x0930('0x29')]=JSON['stringify'](_0x6e9f46);return rpc[_0xaf27d+_0x0930('0x2a')][_0x0930('0x1a')](_0x5055c7)[_0x0930('0x1b')](function(_0x100278){logger[_0x0930('0xb')](_0x0930('0x1c'),_0x45705a,_0x5055c7[_0x0930('0x19')]);if(_0x6e9f46[_0x0930('0x24')][_0x0930('0x2b')][_0x0930('0x2c')]){_0x2c0f94['next']();}else{_0x2c0f94[_0x0930('0x21')]();}})['catch'](function(_0x421a95){logger[_0x0930('0x2d')](_0x0930('0x1c'),_0x45705a,JSON['stringify'](_0x421a95));_0x2c0f94[_0x0930('0xd')]();});})['catch'](function(_0x4f3475){logger[_0x0930('0x2d')]('[%s][DIALOGFLOW]\x20%s',_0x45705a,_0x4f3475[_0x0930('0x23')]);_0x2c0f94[_0x0930('0xd')]();});}}catch(_0x69224d){logger[_0x0930('0x2d')](_0x0930('0x1c'),_0x45705a,JSON[_0x0930('0x1e')](_0x69224d));_0x2c0f94['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index d935fb5..1ad9969 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 _0x12cc=['catch','error','stringify','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','upperFirst','AccountId','created','isEmpty','getMustacheRender','then','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','SessionsClient','sessionPath','message','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','boolValue','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','push','fulfillmentText','all','next','dialogflow','md5','moment','bluebird','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/whatsappMessage','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s'];(function(_0x5617a2,_0x36f76a){var _0x2a8abe=function(_0x183c48){while(--_0x183c48){_0x5617a2['push'](_0x5617a2['shift']());}};_0x2a8abe(++_0x36f76a);}(_0x12cc,0xc2));var _0xc12c=function(_0x4ef8a3,_0x22a7bc){_0x4ef8a3=_0x4ef8a3-0x0;var _0x363e9f=_0x12cc[_0x4ef8a3];return _0x363e9f;};'use strict';var _=require('lodash');var dialogflow=require(_0xc12c('0x0'));var md5=require(_0xc12c('0x1'));var moment=require(_0xc12c('0x2'));var Promise=require(_0xc12c('0x3'));var logger=require(_0xc12c('0x4'))('routing');var utils=require('./utils');var rpc={'chatMessage':require(_0xc12c('0x5')),'openchannelMessage':require(_0xc12c('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xc12c('0x7'))};function createMessage(_0x1c0435,_0xe572e1,_0x52017f,_0x488940){return new Promise(function(_0x2f11ba,_0x39f62c){var _0x40e297=_['clone'](_0x52017f);_0x40e297[_0xc12c('0x8')]=_0x488940;return rpc[_0xe572e1+_0xc12c('0x9')][_0xc12c('0xa')](_0x40e297)['then'](function(){logger[_0xc12c('0xb')](_0xc12c('0xc'),_0x1c0435,_0x40e297[_0xc12c('0x8')]);_0x2f11ba();})[_0xc12c('0xd')](function(_0x3944aa){logger[_0xc12c('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x1c0435,JSON[_0xc12c('0xf')](_0x3944aa));_0x39f62c(_0x3944aa);});});}exports[_0xc12c('0x10')]=function(_0x126a25,_0x54aa3e){return function(_0x57bbf4){try{if(!_[_0xc12c('0x11')](this['interaction'][_0xc12c('0x12')])){logger[_0xc12c('0xb')]('[%s][DIALOGFLOWV2]\x20%s',_0x126a25,_0xc12c('0x13'));return _0x57bbf4['next']();}var _0x40c7a1={'ContactId':this[_0xc12c('0x14')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xc12c('0x15')};if(this[_0xc12c('0x16')]==='sms'||this[_0xc12c('0x16')]===_0xc12c('0x17')){_0x40c7a1[_0xc12c('0x18')]=this[_0xc12c('0x19')][_0xc12c('0x18')];}var _0x5ef398=this[_0xc12c('0x16')];if(_0x5ef398===_0xc12c('0x1a')){_0x40c7a1[_0xc12c('0x1b')]=this['account']['id'];}else{_0x40c7a1[_[_0xc12c('0x1c')](_0x5ef398)+_0xc12c('0x1d')]=this['account']['id'];}_0x40c7a1[_['upperFirst'](_0x5ef398)+'InteractionId']=this[_0xc12c('0x19')]['id'];if(this[_0xc12c('0x19')][_0xc12c('0x1e')]){var _0x2c718d=_0x54aa3e[0x4];if(!_[_0xc12c('0x1f')](_0x2c718d)){_0x40c7a1[_0xc12c('0x8')]=utils[_0xc12c('0x20')](_0x2c718d,this);return rpc[_0x5ef398+'Message'][_0xc12c('0xa')](_0x40c7a1)[_0xc12c('0x21')](function(_0x26cef4){logger[_0xc12c('0xb')](_0xc12c('0xc'),_0x126a25,_0x40c7a1[_0xc12c('0x8')]);})[_0xc12c('0xd')](function(_0x3af86d){logger[_0xc12c('0xe')](_0xc12c('0xc'),_0x126a25,JSON[_0xc12c('0xf')](_0x3af86d));})[_0xc12c('0x22')](function(){logger[_0xc12c('0xb')](_0xc12c('0x23'),_0x126a25);_0x57bbf4[_0xc12c('0x24')]();});}else{logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x126a25);_0x57bbf4[_0xc12c('0x24')]();}}else{var _0x1d8c5d=this;var _0x5b2e7e=_0x54aa3e[0x2][_0xc12c('0x25')](/\\n/g,'\x0a');var _0x39a976={'credentials':{'private_key':_0x5b2e7e,'client_email':_0x54aa3e[0x1]}};var _0x45e6eb=new dialogflow[(_0xc12c('0x26'))](_0x39a976);var _0x4e0c48=_0x45e6eb[_0xc12c('0x27')](_0x54aa3e[0x0],md5(_0x1d8c5d[_0xc12c('0x19')]['id']));var _0x1ed467={'session':_0x4e0c48,'queryInput':{'text':{'text':_0x1d8c5d[_0xc12c('0x28')]['body'],'languageCode':_0x54aa3e[0x3]||'en'}}};return _0x45e6eb['detectIntent'](_0x1ed467)['then'](function(_0x31a70e){if(_0x31a70e&&_0x31a70e[_0xc12c('0x29')]){_0x1d8c5d[_0xc12c('0x8')][_0xc12c('0x2a')]=_0x31a70e;var _0x550fc6=_0x31a70e[0x0];var _0x15367a=_0x550fc6[_0xc12c('0x2b')][_0xc12c('0x2c')]&&_0x550fc6[_0xc12c('0x2b')]['diagnosticInfo'][_0xc12c('0x2d')]?_0x550fc6['queryResult'][_0xc12c('0x2c')][_0xc12c('0x2d')][_0xc12c('0x2e')]['boolValue']:![];_0x1d8c5d[_0xc12c('0x8')][_0xc12c('0x2f')]=_0x550fc6[_0xc12c('0x2b')]['action'];_0x1d8c5d[_0xc12c('0x8')][_0xc12c('0x30')]=_0x550fc6['queryResult'][_0xc12c('0x31')];_0x1d8c5d[_0xc12c('0x8')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x550fc6[_0xc12c('0x2b')]['diagnosticInfo']&&_0x550fc6['queryResult'][_0xc12c('0x2c')]['fields']?_0x550fc6[_0xc12c('0x2b')]['diagnosticInfo'][_0xc12c('0x2d')][_0xc12c('0x2e')][_0xc12c('0x32')]:![];_0x1d8c5d[_0xc12c('0x8')][_0xc12c('0x33')]=_0x550fc6[_0xc12c('0x2b')][_0xc12c('0x34')][_0xc12c('0x35')];_0x1d8c5d['body'][_0xc12c('0x36')]=_0x550fc6['queryResult'][_0xc12c('0x34')]['displayName'];_0x1d8c5d['body'][_0xc12c('0x37')]=_0x550fc6[_0xc12c('0x2b')][_0xc12c('0x34')][_0xc12c('0x38')];_0x1d8c5d[_0xc12c('0x8')][_0xc12c('0x39')]=_0x550fc6[_0xc12c('0x2b')][_0xc12c('0x3a')];_0x1d8c5d['body'][_0xc12c('0x3b')]=_0x550fc6['queryResult'][_0xc12c('0x3c')];_0x1d8c5d[_0xc12c('0x8')][_0xc12c('0x3d')]=_0x550fc6[_0xc12c('0x2b')][_0xc12c('0x3e')];_0x40c7a1[_0xc12c('0x3f')]=_0xc12c('0x2a');_0x40c7a1[_0xc12c('0x40')]=JSON['stringify'](_0x31a70e);var _0x5019b6=[];for(var _0x3e713e=0x0;_0x3e713e<_0x31a70e[_0xc12c('0x29')];_0x3e713e++){var _0x318233=_0x31a70e[_0x3e713e];if(_0x318233&&_0x318233[_0xc12c('0x2b')]&&_0x318233[_0xc12c('0x2b')]['fulfillmentText']){_0x5019b6[_0xc12c('0x41')](createMessage(_0x126a25,_0x5ef398,_0x40c7a1,_0x318233['queryResult'][_0xc12c('0x42')]));}}return Promise[_0xc12c('0x43')](_0x5019b6)[_0xc12c('0x21')](function(){if(_0x15367a){_0x57bbf4['next']();}else{_0x57bbf4[_0xc12c('0x24')]();}})[_0xc12c('0xd')](function(_0x26b119){logger['error'](_0xc12c('0xc'),_0x126a25,JSON[_0xc12c('0xf')](_0x26b119));_0x57bbf4[_0xc12c('0x44')]();});}})[_0xc12c('0xd')](function(_0x5aef80){logger[_0xc12c('0xe')](_0xc12c('0xc'),_0x126a25,_0x5aef80[_0xc12c('0x28')]);_0x57bbf4['next']();});}}catch(_0xb2583a){logger['error'](_0xc12c('0xc'),_0x126a25,JSON[_0xc12c('0xf')](_0xb2583a));_0x57bbf4[_0xc12c('0x24')]();}};}; \ No newline at end of file +var _0x6b07=['out','channel','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','[%s][DIALOGFLOWV2]\x20%s','error','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','then','length','dialogflowV2','diagnosticInfo','queryResult','fields','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','boolValue','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','fulfillmentText','push','all','stringify','lodash','dialogflow','md5','moment','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','info','body','catch','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xbe9f9f,_0x3adbd9){var _0x510bde=function(_0x4123ba){while(--_0x4123ba){_0xbe9f9f['push'](_0xbe9f9f['shift']());}};_0x510bde(++_0x3adbd9);}(_0x6b07,0x1a8));var _0x76b0=function(_0xff80bb,_0x2b024b){_0xff80bb=_0xff80bb-0x0;var _0x38c631=_0x6b07[_0xff80bb];return _0x38c631;};'use strict';var _=require(_0x76b0('0x0'));var dialogflow=require(_0x76b0('0x1'));var md5=require(_0x76b0('0x2'));var moment=require(_0x76b0('0x3'));var Promise=require('bluebird');var logger=require(_0x76b0('0x4'))('routing');var utils=require(_0x76b0('0x5'));var rpc={'chatMessage':require(_0x76b0('0x6')),'openchannelMessage':require(_0x76b0('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x76b0('0x8')),'faxMessage':require(_0x76b0('0x9')),'whatsappMessage':require(_0x76b0('0xa'))};function createMessage(_0x46d0a4,_0x1fa0e4,_0x1960d6,_0x9ba751){return new Promise(function(_0xac9eef,_0x2edff4){var _0x56d0d1=_[_0x76b0('0xb')](_0x1960d6);_0x56d0d1['body']=_0x9ba751;return rpc[_0x1fa0e4+_0x76b0('0xc')][_0x76b0('0xd')](_0x56d0d1)['then'](function(){logger[_0x76b0('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x46d0a4,_0x56d0d1[_0x76b0('0xf')]);_0xac9eef();})[_0x76b0('0x10')](function(_0x2d7acc){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x46d0a4,JSON['stringify'](_0x2d7acc));_0x2edff4(_0x2d7acc);});});}exports[_0x76b0('0x11')]=function(_0x2e72da,_0x4f59e9){return function(_0x5c59c7){try{if(!_[_0x76b0('0x12')](this[_0x76b0('0x13')][_0x76b0('0x14')])){logger[_0x76b0('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x2e72da,_0x76b0('0x15'));return _0x5c59c7[_0x76b0('0x16')]();}var _0x22a454={'ContactId':this[_0x76b0('0x17')]['id'],'sentAt':moment()[_0x76b0('0x18')](_0x76b0('0x19')),'direction':_0x76b0('0x1a')};if(this[_0x76b0('0x1b')]==='sms'||this[_0x76b0('0x1b')]==='whatsapp'){_0x22a454[_0x76b0('0x1c')]=this[_0x76b0('0x13')]['phone'];}var _0x22500b=this[_0x76b0('0x1b')];if(_0x22500b==='chat'){_0x22a454[_0x76b0('0x1d')]=this[_0x76b0('0x1e')]['id'];}else{_0x22a454[_[_0x76b0('0x1f')](_0x22500b)+_0x76b0('0x20')]=this[_0x76b0('0x1e')]['id'];}_0x22a454[_['upperFirst'](_0x22500b)+_0x76b0('0x21')]=this[_0x76b0('0x13')]['id'];if(this['interaction'][_0x76b0('0x22')]){var _0x1e0936=_0x4f59e9[0x4];if(!_[_0x76b0('0x23')](_0x1e0936)){_0x22a454[_0x76b0('0xf')]=utils[_0x76b0('0x24')](_0x1e0936,this);return rpc[_0x22500b+'Message'][_0x76b0('0xd')](_0x22a454)['then'](function(_0x1a4329){logger[_0x76b0('0xe')](_0x76b0('0x25'),_0x2e72da,_0x22a454[_0x76b0('0xf')]);})[_0x76b0('0x10')](function(_0x37b506){logger[_0x76b0('0x26')](_0x76b0('0x25'),_0x2e72da,JSON['stringify'](_0x37b506));})[_0x76b0('0x27')](function(){logger[_0x76b0('0xe')](_0x76b0('0x28'),_0x2e72da);_0x5c59c7[_0x76b0('0x29')]();});}else{logger[_0x76b0('0xe')](_0x76b0('0x2a'),_0x2e72da);_0x5c59c7[_0x76b0('0x29')]();}}else{var _0x2775e4=this;var _0x989a77=_0x4f59e9[0x2][_0x76b0('0x2b')](/\\n/g,'\x0a');var _0x5f2478={'credentials':{'private_key':_0x989a77,'client_email':_0x4f59e9[0x1]}};var _0x18dc48=new dialogflow[(_0x76b0('0x2c'))](_0x5f2478);var _0x2aac9d=_0x18dc48[_0x76b0('0x2d')](_0x4f59e9[0x0],md5(_0x2775e4[_0x76b0('0x13')]['id']));var _0x5acb89={'session':_0x2aac9d,'queryInput':{'text':{'text':_0x2775e4[_0x76b0('0x2e')][_0x76b0('0xf')],'languageCode':_0x4f59e9[0x3]||'en'}}};return _0x18dc48[_0x76b0('0x2f')](_0x5acb89)[_0x76b0('0x30')](function(_0x33bdfd){if(_0x33bdfd&&_0x33bdfd[_0x76b0('0x31')]){_0x2775e4[_0x76b0('0xf')][_0x76b0('0x32')]=_0x33bdfd;var _0x1bc59b=_0x33bdfd[0x0];var _0x357a00=_0x1bc59b['queryResult'][_0x76b0('0x33')]&&_0x1bc59b[_0x76b0('0x34')]['diagnosticInfo'][_0x76b0('0x35')]?_0x1bc59b[_0x76b0('0x34')][_0x76b0('0x33')]['fields']['end_conversation']['boolValue']:![];_0x2775e4[_0x76b0('0xf')]['DIALOGFLOWV2_ACTION']=_0x1bc59b['queryResult'][_0x76b0('0x36')];_0x2775e4[_0x76b0('0xf')][_0x76b0('0x37')]=_0x1bc59b['queryResult'][_0x76b0('0x38')];_0x2775e4['body'][_0x76b0('0x39')]=_0x1bc59b[_0x76b0('0x34')][_0x76b0('0x33')]&&_0x1bc59b['queryResult'][_0x76b0('0x33')][_0x76b0('0x35')]?_0x1bc59b[_0x76b0('0x34')][_0x76b0('0x33')][_0x76b0('0x35')][_0x76b0('0x3a')][_0x76b0('0x3b')]:![];_0x2775e4['body']['DIALOGFLOWV2_INTENTNAME']=_0x1bc59b['queryResult']['intent'][_0x76b0('0x3c')];_0x2775e4[_0x76b0('0xf')][_0x76b0('0x3d')]=_0x1bc59b[_0x76b0('0x34')][_0x76b0('0x3e')][_0x76b0('0x3f')];_0x2775e4['body'][_0x76b0('0x40')]=_0x1bc59b['queryResult'][_0x76b0('0x3e')]['isFallback'];_0x2775e4['body'][_0x76b0('0x41')]=_0x1bc59b[_0x76b0('0x34')][_0x76b0('0x42')];_0x2775e4[_0x76b0('0xf')][_0x76b0('0x43')]=_0x1bc59b[_0x76b0('0x34')][_0x76b0('0x44')];_0x2775e4[_0x76b0('0xf')]['DIALOGFLOWV2_SCORE']=_0x1bc59b[_0x76b0('0x34')][_0x76b0('0x45')];_0x22a454[_0x76b0('0x46')]=_0x76b0('0x32');_0x22a454['providerResponse']=JSON['stringify'](_0x33bdfd);var _0x45a95d=[];for(var _0x459700=0x0;_0x459700<_0x33bdfd[_0x76b0('0x31')];_0x459700++){var _0xe8a259=_0x33bdfd[_0x459700];if(_0xe8a259&&_0xe8a259[_0x76b0('0x34')]&&_0xe8a259[_0x76b0('0x34')][_0x76b0('0x47')]){_0x45a95d[_0x76b0('0x48')](createMessage(_0x2e72da,_0x22500b,_0x22a454,_0xe8a259[_0x76b0('0x34')]['fulfillmentText']));}}return Promise[_0x76b0('0x49')](_0x45a95d)['then'](function(){if(_0x357a00){_0x5c59c7[_0x76b0('0x16')]();}else{_0x5c59c7[_0x76b0('0x29')]();}})['catch'](function(_0x7d3f3b){logger['error'](_0x76b0('0x25'),_0x2e72da,JSON[_0x76b0('0x4a')](_0x7d3f3b));_0x5c59c7[_0x76b0('0x16')]();});}})[_0x76b0('0x10')](function(_0x27c0de){logger[_0x76b0('0x26')](_0x76b0('0x25'),_0x2e72da,_0x27c0de[_0x76b0('0x2e')]);_0x5c59c7['next']();});}}catch(_0x599d70){logger[_0x76b0('0x26')]('[%s][DIALOGFLOWV2]\x20%s',_0x2e72da,JSON[_0x76b0('0x4a')](_0x599d70));_0x5c59c7['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 dcf7312..917f68c 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 _0x1dd8=['consequence','fromString','getMustacheRender','replace','error','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number'];(function(_0xe69da0,_0x45a6a8){var _0x386b5e=function(_0x16abf2){while(--_0x16abf2){_0xe69da0['push'](_0xe69da0['shift']());}};_0x386b5e(++_0x45a6a8);}(_0x1dd8,0xa9));var _0x81dd=function(_0x45fbf8,_0x305eac){_0x45fbf8=_0x45fbf8-0x0;var _0x21986c=_0x1dd8[_0x45fbf8];return _0x21986c;};'use strict';var schema=require(_0x81dd('0x0'));var _=require(_0x81dd('0x1'));var htmlToText=require(_0x81dd('0x2'));var utils=require(_0x81dd('0x3'));var logger=require(_0x81dd('0x4'))(_0x81dd('0x5'));var gotoif=schema({'condition':{'type':_0x81dd('0x6'),'required':!![],'message':_0x81dd('0x7')},'priorityTrue':{'type':_0x81dd('0x8'),'message':_0x81dd('0x9')},'priorityFalse':{'type':_0x81dd('0x8'),'message':_0x81dd('0xa')}});exports[_0x81dd('0xb')]=function(_0x2dffc7,_0x106c88){return function(_0x3d6cf2){try{var _0x3f47dd={'condition':htmlToText[_0x81dd('0xc')](utils[_0x81dd('0xd')](_0x106c88[0x0],this),{'wordwrap':![]})[_0x81dd('0xe')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x106c88[0x1],'priorityFalse':_0x106c88[0x2]};var _0x32f21e=gotoif['validate'](_0x3f47dd,{'typecast':!![]});if(_0x32f21e['length']){logger[_0x81dd('0xf')](_0x81dd('0x10'),_0x2dffc7,_[_0x81dd('0x11')](_0x32f21e,_0x81dd('0x12'))['join'](',\x20'));_0x3d6cf2[_0x81dd('0x13')]();}else{try{var _0x29aabc=eval('('+_0x3f47dd[_0x81dd('0x14')]+')');var _0x3ffabb=_0x29aabc?_0x3f47dd[_0x81dd('0x15')]:_0x3f47dd[_0x81dd('0x16')];logger[_0x81dd('0x17')](_0x81dd('0x18'),_0x2dffc7,_0x3f47dd['condition'],_0x29aabc,_0x3ffabb||_0x81dd('0x19'));if(_0x3ffabb){var _0x5d75b9=_[_0x81dd('0x1a')](_0x3d6cf2['rules'](),{'p':_0x3ffabb});if(_0x5d75b9>=0x0){logger[_0x81dd('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2dffc7,_0x3ffabb||_0x81dd('0x19'),_0x5d75b9);_0x3d6cf2[_0x81dd('0x19')](_0x5d75b9);}else{logger[_0x81dd('0x17')](_0x81dd('0x1b'),_0x2dffc7,_0x3ffabb||_0x81dd('0x19'));_0x3d6cf2[_0x81dd('0x13')]();}}else{_0x3d6cf2[_0x81dd('0x19')]();}}catch(_0x175b21){logger[_0x81dd('0xf')](_0x81dd('0x1c'),_0x2dffc7,_0x175b21[_0x81dd('0x12')]);_0x3d6cf2[_0x81dd('0x13')]();}}}catch(_0x1b5ff3){logger[_0x81dd('0xf')](_0x81dd('0x10'),_0x2dffc7,JSON[_0x81dd('0x1d')](_0x1b5ff3));_0x3d6cf2[_0x81dd('0x13')]();}};}; \ No newline at end of file +var _0x58f3=['stringify','validate','html-to-text','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','message','join','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x58f3,0x7e));var _0x358f=function(_0x4e3f32,_0x3caab5){_0x4e3f32=_0x4e3f32-0x0;var _0xf60ed3=_0x58f3[_0x4e3f32];return _0xf60ed3;};'use strict';var schema=require(_0x358f('0x0'));var _=require('lodash');var htmlToText=require(_0x358f('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x358f('0x2'));var gotoif=schema({'condition':{'type':_0x358f('0x3'),'required':!![],'message':_0x358f('0x4')},'priorityTrue':{'type':_0x358f('0x5'),'message':_0x358f('0x6')},'priorityFalse':{'type':_0x358f('0x5'),'message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0xd54aae,_0x4c2d5a){return function(_0x41fd2f){try{var _0x1332b3={'condition':htmlToText[_0x358f('0x7')](utils[_0x358f('0x8')](_0x4c2d5a[0x0],this),{'wordwrap':![]})[_0x358f('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4c2d5a[0x1],'priorityFalse':_0x4c2d5a[0x2]};var _0x386b46=gotoif['validate'](_0x1332b3,{'typecast':!![]});if(_0x386b46[_0x358f('0xa')]){logger[_0x358f('0xb')](_0x358f('0xc'),_0xd54aae,_['map'](_0x386b46,_0x358f('0xd'))[_0x358f('0xe')](',\x20'));_0x41fd2f['stop']();}else{try{var _0x4401bf=eval('('+_0x1332b3['condition']+')');var _0x4cd0f6=_0x4401bf?_0x1332b3[_0x358f('0xf')]:_0x1332b3['priorityFalse'];logger[_0x358f('0x10')](_0x358f('0x11'),_0xd54aae,_0x1332b3['condition'],_0x4401bf,_0x4cd0f6||_0x358f('0x12'));if(_0x4cd0f6){var _0x204521=_[_0x358f('0x13')](_0x41fd2f[_0x358f('0x14')](),{'p':_0x4cd0f6});if(_0x204521>=0x0){logger[_0x358f('0x10')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0xd54aae,_0x4cd0f6||_0x358f('0x12'),_0x204521);_0x41fd2f[_0x358f('0x12')](_0x204521);}else{logger[_0x358f('0x10')](_0x358f('0x15'),_0xd54aae,_0x4cd0f6||_0x358f('0x12'));_0x41fd2f[_0x358f('0x16')]();}}else{_0x41fd2f[_0x358f('0x12')]();}}catch(_0x293a00){logger[_0x358f('0xb')](_0x358f('0x17'),_0xd54aae,_0x293a00['message']);_0x41fd2f[_0x358f('0x16')]();}}}catch(_0x125a7b){logger[_0x358f('0xb')]('[%s][GOTOIF]\x20%s',_0xd54aae,JSON[_0x358f('0x18')](_0x125a7b));_0x41fd2f['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 e4d6b95..0ba9707 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 _0x2a5a=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','[%s][GOTOP]\x20%s','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','../../../../config/logger','routing'];(function(_0x480275,_0x54045c){var _0x1372d4=function(_0x7073a5){while(--_0x7073a5){_0x480275['push'](_0x480275['shift']());}};_0x1372d4(++_0x54045c);}(_0x2a5a,0x8e));var _0xa2a5=function(_0x1301e7,_0xbfc8e7){_0x1301e7=_0x1301e7-0x0;var _0x2dce2b=_0x2a5a[_0x1301e7];return _0x2dce2b;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0xa2a5('0x0'))(_0xa2a5('0x1'));var gotop=schema({'priority':{'type':_0xa2a5('0x2'),'required':!![],'message':_0xa2a5('0x3')}});exports['consequence']=function(_0x588ffb,_0x2bbdb4){return function(_0x48d3d0){try{var _0x470527={'priority':_0x2bbdb4[0x0]};var _0x4e7ffa=gotop['validate'](_0x470527,{'typecast':!![]});if(_0x4e7ffa[_0xa2a5('0x4')]){logger['error'](_0xa2a5('0x5'),_0x588ffb,_['map'](_0x4e7ffa,'message')['join'](',\x20'));_0x48d3d0[_0xa2a5('0x6')]();}else{logger[_0xa2a5('0x7')](_0xa2a5('0x8'),_0x588ffb,_0x470527[_0xa2a5('0x9')]);if(_0x470527[_0xa2a5('0x9')]){var _0x2cc60f=_[_0xa2a5('0xa')](_0x48d3d0['rules'](),{'p':_0x470527[_0xa2a5('0x9')]});if(_0x2cc60f>=0x0){logger[_0xa2a5('0x7')](_0xa2a5('0xb'),_0x588ffb,_0x470527[_0xa2a5('0x9')]||'next',_0x2cc60f);_0x48d3d0[_0xa2a5('0xc')](_0x2cc60f);}else{logger['info'](_0xa2a5('0xd'),_0x588ffb,_0x470527[_0xa2a5('0x9')]||_0xa2a5('0xc'));_0x48d3d0[_0xa2a5('0x6')]();}}else{_0x48d3d0[_0xa2a5('0xc')]();}}}catch(_0x257b2b){logger[_0xa2a5('0xe')]('[%s][GOTOP]\x20%s',_0x588ffb,JSON[_0xa2a5('0xf')](_0x257b2b));_0x48d3d0[_0xa2a5('0x6')]();}};}; \ No newline at end of file +var _0xe465=['message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','map'];(function(_0x10ca4e,_0x39417c){var _0x4b74eb=function(_0x407a8b){while(--_0x407a8b){_0x10ca4e['push'](_0x10ca4e['shift']());}};_0x4b74eb(++_0x39417c);}(_0xe465,0x130));var _0x5e46=function(_0x2135c8,_0x2515d3){_0x2135c8=_0x2135c8-0x0;var _0x37adcb=_0xe465[_0x2135c8];return _0x37adcb;};'use strict';var schema=require('validate');var _=require(_0x5e46('0x0'));var logger=require(_0x5e46('0x1'))(_0x5e46('0x2'));var gotop=schema({'priority':{'type':_0x5e46('0x3'),'required':!![],'message':_0x5e46('0x4')}});exports[_0x5e46('0x5')]=function(_0x56ba4a,_0x47e765){return function(_0xb2d638){try{var _0x4fa717={'priority':_0x47e765[0x0]};var _0x45a7de=gotop[_0x5e46('0x6')](_0x4fa717,{'typecast':!![]});if(_0x45a7de[_0x5e46('0x7')]){logger[_0x5e46('0x8')](_0x5e46('0x9'),_0x56ba4a,_[_0x5e46('0xa')](_0x45a7de,_0x5e46('0xb'))[_0x5e46('0xc')](',\x20'));_0xb2d638[_0x5e46('0xd')]();}else{logger[_0x5e46('0xe')](_0x5e46('0xf'),_0x56ba4a,_0x4fa717[_0x5e46('0x10')]);if(_0x4fa717[_0x5e46('0x10')]){var _0x302259=_['findIndex'](_0xb2d638[_0x5e46('0x11')](),{'p':_0x4fa717[_0x5e46('0x10')]});if(_0x302259>=0x0){logger[_0x5e46('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x56ba4a,_0x4fa717[_0x5e46('0x10')]||_0x5e46('0x12'),_0x302259);_0xb2d638[_0x5e46('0x12')](_0x302259);}else{logger[_0x5e46('0xe')](_0x5e46('0x13'),_0x56ba4a,_0x4fa717[_0x5e46('0x10')]||_0x5e46('0x12'));_0xb2d638[_0x5e46('0xd')]();}}else{_0xb2d638[_0x5e46('0x12')]();}}}catch(_0x2c7eba){logger[_0x5e46('0x8')](_0x5e46('0x9'),_0x56ba4a,JSON[_0x5e46('0x14')](_0x2c7eba));_0xb2d638[_0x5e46('0xd')]();}};}; \ 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 c362961..dbb42ae 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 _0xc4dd=['../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','interaction','Message','then','info','body','next','catch','error','stop','[%s][MESSAGE]\x20%s','lodash','./utils'];(function(_0x364cc3,_0x20fe9b){var _0x141152=function(_0x514ba8){while(--_0x514ba8){_0x364cc3['push'](_0x364cc3['shift']());}};_0x141152(++_0x20fe9b);}(_0xc4dd,0xad));var _0xdc4d=function(_0x1c3b50,_0x3bc478){_0x1c3b50=_0x1c3b50-0x0;var _0x486aa8=_0xc4dd[_0x1c3b50];return _0x486aa8;};'use strict';var _=require(_0xdc4d('0x0'));var utils=require(_0xdc4d('0x1'));var logger=require(_0xdc4d('0x2'))('routing');var rpc={'chatMessage':require(_0xdc4d('0x3')),'openchannelMessage':require(_0xdc4d('0x4')),'mailMessage':require(_0xdc4d('0x5')),'smsMessage':require(_0xdc4d('0x6')),'faxMessage':require(_0xdc4d('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x27d6a9,_0x1696e3){return function(_0x5d4933){try{var _0x3c4ce7={'body':utils[_0xdc4d('0x8')](_0x1696e3[0x0],this),'ContactId':this['contact']['id']};if(this[_0xdc4d('0x9')]===_0xdc4d('0xa')){_0x3c4ce7[_0xdc4d('0xb')]=this[_0xdc4d('0xc')]['id'];}else{_0x3c4ce7[_[_0xdc4d('0xd')](this[_0xdc4d('0x9')])+_0xdc4d('0xe')]=this['account']['id'];}_0x3c4ce7[_[_0xdc4d('0xd')](this[_0xdc4d('0x9')])+'InteractionId']=this[_0xdc4d('0xf')]['id'];if(rpc[this['channel']+_0xdc4d('0x10')]){return rpc[this['channel']+'Message']['create'](_0x3c4ce7)[_0xdc4d('0x11')](function(_0xc63ead){logger[_0xdc4d('0x12')]('[%s][MESSAGE]\x20%s',_0x27d6a9,_0x3c4ce7[_0xdc4d('0x13')]);_0x5d4933[_0xdc4d('0x14')]();})[_0xdc4d('0x15')](function(_0x586e74){logger[_0xdc4d('0x16')]('[%s][MESSAGE]\x20%s',_0x27d6a9,JSON['stringify'](_0x586e74));_0x5d4933[_0xdc4d('0x17')]();});}}catch(_0xff4e3){logger[_0xdc4d('0x16')](_0xdc4d('0x18'),_0x27d6a9,JSON['stringify'](_0xff4e3));_0x5d4933[_0xdc4d('0x17')]();}};}; \ No newline at end of file +var _0xc8f8=['upperFirst','InteractionId','Message','create','info','[%s][MESSAGE]\x20%s','body','error','stop','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account'];(function(_0x21b295,_0x113008){var _0x468b09=function(_0x1e4052){while(--_0x1e4052){_0x21b295['push'](_0x21b295['shift']());}};_0x468b09(++_0x113008);}(_0xc8f8,0x1cc));var _0x8c8f=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xc8f8[_0x45783c];return _0x1161da;};'use strict';var _=require(_0x8c8f('0x0'));var utils=require(_0x8c8f('0x1'));var logger=require(_0x8c8f('0x2'))(_0x8c8f('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x8c8f('0x4')),'mailMessage':require(_0x8c8f('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8c8f('0x6')),'whatsappMessage':require(_0x8c8f('0x7'))};exports[_0x8c8f('0x8')]=function(_0x3ad96c,_0x3bb625){return function(_0x224773){try{var _0x3e6347={'body':utils[_0x8c8f('0x9')](_0x3bb625[0x0],this),'ContactId':this[_0x8c8f('0xa')]['id']};if(this[_0x8c8f('0xb')]===_0x8c8f('0xc')){_0x3e6347[_0x8c8f('0xd')]=this[_0x8c8f('0xe')]['id'];}else{_0x3e6347[_['upperFirst'](this[_0x8c8f('0xb')])+'AccountId']=this['account']['id'];}_0x3e6347[_[_0x8c8f('0xf')](this['channel'])+_0x8c8f('0x10')]=this['interaction']['id'];if(rpc[this['channel']+_0x8c8f('0x11')]){return rpc[this['channel']+'Message'][_0x8c8f('0x12')](_0x3e6347)['then'](function(_0x3cf77d){logger[_0x8c8f('0x13')](_0x8c8f('0x14'),_0x3ad96c,_0x3e6347[_0x8c8f('0x15')]);_0x224773['next']();})['catch'](function(_0x321462){logger[_0x8c8f('0x16')](_0x8c8f('0x14'),_0x3ad96c,JSON['stringify'](_0x321462));_0x224773[_0x8c8f('0x17')]();});}}catch(_0x2613dd){logger['error'](_0x8c8f('0x14'),_0x3ad96c,JSON[_0x8c8f('0x18')](_0x2613dd));_0x224773[_0x8c8f('0x17')]();}};}; \ 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 cc6f4be..693f932 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 _0xaa93=['stop','./utils','../../../../config/logger','routing','info','getMustacheRender','error','stringify'];(function(_0x18bc36,_0x26f234){var _0x182db0=function(_0x7bef20){while(--_0x7bef20){_0x18bc36['push'](_0x18bc36['shift']());}};_0x182db0(++_0x26f234);}(_0xaa93,0xd9));var _0x3aa9=function(_0x18507b,_0x3036b3){_0x18507b=_0x18507b-0x0;var _0xd2753=_0xaa93[_0x18507b];return _0xd2753;};'use strict';var utils=require(_0x3aa9('0x0'));var logger=require(_0x3aa9('0x1'))(_0x3aa9('0x2'));exports['consequence']=function(_0x92cd4e,_0x4790ec){return function(_0x49feff){try{logger[_0x3aa9('0x3')]('[%s][NOOP]\x20%s',_0x92cd4e,utils[_0x3aa9('0x4')](_0x4790ec[0x0],this));_0x49feff['next']();}catch(_0x4c455b){logger[_0x3aa9('0x5')]('[%s][NOOP]\x20%s',_0x92cd4e,JSON[_0x3aa9('0x6')](_0x4c455b));_0x49feff[_0x3aa9('0x7')]();}};}; \ No newline at end of file +var _0x59ee=['../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stop'];(function(_0x40b7f2,_0x4a5040){var _0x55891e=function(_0x315828){while(--_0x315828){_0x40b7f2['push'](_0x40b7f2['shift']());}};_0x55891e(++_0x4a5040);}(_0x59ee,0x1a0));var _0xe59e=function(_0x196c94,_0x58fa96){_0x196c94=_0x196c94-0x0;var _0x4f7e3f=_0x59ee[_0x196c94];return _0x4f7e3f;};'use strict';var utils=require('./utils');var logger=require(_0xe59e('0x0'))('routing');exports[_0xe59e('0x1')]=function(_0x55b025,_0x3d52eb){return function(_0x461e3c){try{logger[_0xe59e('0x2')](_0xe59e('0x3'),_0x55b025,utils[_0xe59e('0x4')](_0x3d52eb[0x0],this));_0x461e3c[_0xe59e('0x5')]();}catch(_0x30d5fd){logger[_0xe59e('0x6')](_0xe59e('0x3'),_0x55b025,JSON['stringify'](_0x30d5fd));_0x461e3c[_0xe59e('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 7faaf70..724c1a3 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 _0x1cab=['find','createQueue','atimeout','qtimeout','rules','end','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','localhost','queue_id','queue','from','joinAt','emit','clone','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','channel','InteractionId','interaction','upperFirst','MessageId','message','chat','AccountId','WebsiteId','account','info','name','QueueReport','create','catch','create\x20queue\x20report','waiting','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop'];(function(_0x2573f8,_0x10e6ac){var _0x45ea40=function(_0x45fdb8){while(--_0x45fdb8){_0x2573f8['push'](_0x2573f8['shift']());}};_0x45ea40(++_0x10e6ac);}(_0x1cab,0x18e));var _0xb1ca=function(_0x56bc96,_0x1239c1){_0x56bc96=_0x56bc96-0x0;var _0x28090f=_0x1cab[_0x56bc96];return _0x28090f;};'use strict';var schema=require(_0xb1ca('0x0'));var _=require(_0xb1ca('0x1'));var util=require(_0xb1ca('0x2'));var seqqueue=require(_0xb1ca('0x3'));var moment=require(_0xb1ca('0x4'));var Redis=require(_0xb1ca('0x5'));var config=require(_0xb1ca('0x6'));var logger=require(_0xb1ca('0x7'))('routing');var strategy=require(_0xb1ca('0x8'));config[_0xb1ca('0x9')]=_[_0xb1ca('0xa')](config[_0xb1ca('0x9')],{'host':_0xb1ca('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb1ca('0x9')]));var attributes=['id',_0xb1ca('0xc'),'account',_0xb1ca('0xd'),_0xb1ca('0xe'),_0xb1ca('0xf')];function emit(_0x4a6c3c,_0x4e99ea,_0x168b08){io['to'](_0x4a6c3c)[_0xb1ca('0x10')](_0x4e99ea,_0x168b08);}function emitChannelQueueInteraction(_0xb67e3e,_0x1be511,_0x2b7808,_0x219f77,_0x4da7ca,_0x636d97,_0x48a203,_0x260209){var _0x406b17=_[_0xb1ca('0x11')](_0x2b7808);_0x406b17[_0xb1ca('0xc')]=_0x260209;_0x406b17[_0xb1ca('0xd')]=_0x1be511;_0x406b17['account']=_0x219f77;_0x406b17['id']=_0x4da7ca;if(_0x636d97){_0x48a203[util['format'](_0xb1ca('0x12'),_0xb67e3e)][_0x4da7ca]=_[_0xb1ca('0x13')](_0x406b17,attributes);}else{delete _0x48a203[util[_0xb1ca('0x14')]('%sQueuesWaitingInteractions',_0xb67e3e)][_0x4da7ca];}emit(util[_0xb1ca('0x14')](_0xb1ca('0x15'),_0xb67e3e,_0x1be511),util['format'](_0xb1ca('0x16'),_0xb67e3e,_0x636d97?'save':_0xb1ca('0x17')),_[_0xb1ca('0x13')](_0x406b17,attributes));}var rpc={'openchannelQueueReport':require(_0xb1ca('0x18')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xb1ca('0x19')),'smsQueueReport':require(_0xb1ca('0x1a')),'faxQueueReport':require(_0xb1ca('0x1b')),'whatsappQueueReport':require(_0xb1ca('0x1c'))};var queue=schema({'name':{'type':_0xb1ca('0x1d'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xb1ca('0x1e'),'message':_0xb1ca('0x1f')}});function startRouting(_0x564389,_0x3ad6ed,_0x4f7602,_0x4e846b){if(_0x564389&&_0x3ad6ed&&_0x4f7602){_0x3ad6ed['waiting']+=0x1;var _0x376757={'uniqueid':_0x564389,'from':_0x4f7602[_0xb1ca('0x20')]?_0x4f7602['body']['from']:'','joinAt':moment()[_0xb1ca('0x14')](_0xb1ca('0x21')),'ContactId':_0x4f7602[_0xb1ca('0x22')]?_0x4f7602[_0xb1ca('0x22')]['id']:null,'ListId':_0x4f7602['list']?_0x4f7602['list']['id']:null};_0x376757[_['upperFirst'](_0x4f7602[_0xb1ca('0x23')])+'QueueId']=_0x3ad6ed['id']||null;_0x376757[_['upperFirst'](_0x4f7602[_0xb1ca('0x23')])+_0xb1ca('0x24')]=_0x4f7602[_0xb1ca('0x25')]?_0x4f7602[_0xb1ca('0x25')]['id']:null;_0x376757[_[_0xb1ca('0x26')](_0x4f7602[_0xb1ca('0x23')])+_0xb1ca('0x27')]=_0x4f7602['message']?_0x4f7602[_0xb1ca('0x28')]['id']:null;_0x376757[_[_0xb1ca('0x26')](_0x4f7602[_0xb1ca('0x23')])+(_0x4f7602[_0xb1ca('0x23')]!==_0xb1ca('0x29')?_0xb1ca('0x2a'):_0xb1ca('0x2b'))]=_0x4f7602[_0xb1ca('0x2c')]?_0x4f7602[_0xb1ca('0x2c')]['id']:null;logger[_0xb1ca('0x2d')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x564389,_0x3ad6ed[_0xb1ca('0x2e')]));emitChannelQueueInteraction(_0x4f7602[_0xb1ca('0x23')],_0x3ad6ed[_0xb1ca('0x2e')],_0x376757,_0x4f7602[_0xb1ca('0x2c')][_0xb1ca('0x2e')],_0x4f7602[_0xb1ca('0x28')]['id'],!![],_0x4e846b,_0x3ad6ed['id']);if(rpc[_0x4f7602[_0xb1ca('0x23')]+_0xb1ca('0x2f')]){return rpc[_0x4f7602['channel']+_0xb1ca('0x2f')][_0xb1ca('0x30')](_0x376757)[_0xb1ca('0x31')](function(_0x1360bb){logger['error'](_0xb1ca('0x32'));});}}}function stopRouting(_0x2da394,_0x26c542,_0xcdadba,_0xecab90){if(_0x2da394&&_0x26c542){_0x26c542[_0xb1ca('0x33')]-=0x1;var _0x7eb719={'leaveAt':moment()[_0xb1ca('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger['info'](util['format'](_0xb1ca('0x34'),_0x2da394,_0x26c542['name']));emitChannelQueueInteraction(_0xcdadba[_0xb1ca('0x23')],_0x26c542[_0xb1ca('0x2e')],_0xcdadba[_0xb1ca('0x20')],_0xcdadba['account']['name'],_0xcdadba[_0xb1ca('0x28')]['id'],![],_0xecab90,_0x26c542['id']);if(rpc[_0xcdadba['channel']+_0xb1ca('0x2f')]){return rpc[_0xcdadba[_0xb1ca('0x23')]+_0xb1ca('0x2f')][_0xb1ca('0x35')](_0x2da394,_0x7eb719)[_0xb1ca('0x31')](function(_0x265d49){logger[_0xb1ca('0x36')](_0xb1ca('0x37'));});}}}function endRouting(_0x2727ab,_0x14afb3,_0x58c609,_0x1fd2ed){if(_0x2727ab&&_0x14afb3){_0x14afb3[_0xb1ca('0x33')]-=0x1;var _0x5dac5d={'leaveAt':moment()[_0xb1ca('0x14')](_0xb1ca('0x21')),'exitAt':moment()[_0xb1ca('0x14')](_0xb1ca('0x21')),'reason':_0xb1ca('0x38')};logger['info'](util[_0xb1ca('0x14')](_0xb1ca('0x39'),_0x2727ab,_0x14afb3[_0xb1ca('0x2e')]));emitChannelQueueInteraction(_0x58c609[_0xb1ca('0x23')],_0x14afb3[_0xb1ca('0x2e')],_0x58c609[_0xb1ca('0x20')],_0x58c609[_0xb1ca('0x2c')][_0xb1ca('0x2e')],_0x58c609[_0xb1ca('0x28')]['id'],![],_0x1fd2ed);if(rpc[_0x58c609[_0xb1ca('0x23')]+_0xb1ca('0x2f')]){return rpc[_0x58c609[_0xb1ca('0x23')]+_0xb1ca('0x2f')]['update'](_0x2727ab,_0x5dac5d)['catch'](function(_0xa26d75){logger[_0xb1ca('0x36')](_0xb1ca('0x37'));});}}}function handleFindQueue(_0x50b434){return function(_0x4f7351){return _0x4f7351[_0xb1ca('0x2e')]['toLowerCase']()===_0x50b434[_0xb1ca('0x3a')]();};}exports[_0xb1ca('0x3b')]=function(_0x37b600,_0x528768,_0x54eb27,_0x77c628){return function(_0x737819){try{var _0x67cb55={'name':_0x528768[0x0],'timeout':_0x528768[0x1]};var _0x138101=queue[_0xb1ca('0x0')](_0x67cb55,{'typecast':!![]});if(_0x138101[_0xb1ca('0x3c')]){logger[_0xb1ca('0x36')](_0xb1ca('0x3d'),_0x37b600,_['map'](_0x138101,_0xb1ca('0x28'))[_0xb1ca('0x3e')](',\x20'));_0x737819[_0xb1ca('0x3f')]();}else{var _0x3b9ba2=_[_0xb1ca('0x40')](_0x54eb27[_0x77c628[_0xb1ca('0x23')]+'Queues'],handleFindQueue(_0x67cb55[_0xb1ca('0x2e')]));if(_0x3b9ba2){startRouting(_0x37b600,_0x3b9ba2,_0x77c628,_0x54eb27);var _0x40435d=(_0x3b9ba2[_0xb1ca('0x38')]||0xa)*0x3e8;var _0x495aff=(_0x67cb55['timeout']||0x14)*0x3e8;var _0x513f74,_0x38cab0;if(_0x40435d>_0x495aff){_0x495aff=_0x40435d;}var _0x40f46a=seqqueue[_0xb1ca('0x41')](_0x40435d);_0x40f46a['id']=_0x37b600;_0x40f46a[_0xb1ca('0x42')]=_0x40435d;_0x40f46a[_0xb1ca('0x43')]=_0x495aff;_0x40f46a[_0xb1ca('0x23')]=_0x77c628[_0xb1ca('0x23')];_0x54eb27[_0xb1ca('0x44')][_0x37b600]['on'](_0xb1ca('0x45'),function(){logger[_0xb1ca('0x2d')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x37b600);stopRouting(_0x37b600,_0x3b9ba2,_0x77c628,_0x54eb27);clearTimeout(_0x513f74);_0x513f74=undefined;_0x40f46a['close'](!![]);if(_0x54eb27[_0xb1ca('0x44')][_0x37b600]){delete _0x54eb27['rules'][_0x37b600];}_0x737819['stop']();});_0x54eb27[_0xb1ca('0x44')][_0x37b600]['on'](_0xb1ca('0x46'),function(){if(_0x54eb27[_0xb1ca('0x44')][_0x37b600]){delete _0x54eb27[_0xb1ca('0x44')][_0x37b600];}});_0x513f74=setTimeout(function(){logger[_0xb1ca('0x2d')](_0xb1ca('0x47'),_0x37b600);endRouting(_0x37b600,_0x3b9ba2,_0x77c628,_0x54eb27);clearTimeout(_0x513f74);_0x40f46a['close'](!![]);_0x737819[_0xb1ca('0x48')]();},_0x495aff);switch(_0x3b9ba2[_0xb1ca('0x49')]){case _0xb1ca('0x4a'):strategy[_0xb1ca('0x4a')](_0x40f46a,_0x3b9ba2,_0x54eb27,_0x77c628);break;default:strategy[_0xb1ca('0x4b')](_0x40f46a,_0x3b9ba2,_0x54eb27,_0x77c628);}}else{logger[_0xb1ca('0x36')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x37b600,_0x67cb55['name']);_0x737819[_0xb1ca('0x3f')]();}}}catch(_0x5a633c){console['log'](_0x5a633c);logger['error'](_0xb1ca('0x3d'),_0x37b600,_0x5a633c[_0xb1ca('0x4c')]);_0x737819[_0xb1ca('0x3f')]();}};}; \ No newline at end of file +var _0x4034=['update\x20queue\x20report','waiting','timeout','info','toLowerCase','consequence','join','find','Queues','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','next','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','ioredis','../../../../config/logger','routing','redis','socket.io-emitter','queue_id','emit','clone','account','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','timeout\x20is\x20a\x20number','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','name','QueueReport','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4034,0x166));var _0x4403=function(_0x2bafde,_0x39326c){_0x2bafde=_0x2bafde-0x0;var _0x5733dc=_0x4034[_0x2bafde];return _0x5733dc;};'use strict';var schema=require('validate');var _=require(_0x4403('0x0'));var util=require(_0x4403('0x1'));var seqqueue=require(_0x4403('0x2'));var moment=require('moment');var Redis=require(_0x4403('0x3'));var config=require('../../../../config/environment');var logger=require(_0x4403('0x4'))(_0x4403('0x5'));var strategy=require('./strategy');config[_0x4403('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x4403('0x7'))(new Redis(config['redis']));var attributes=['id',_0x4403('0x8'),'account','queue','from','joinAt'];function emit(_0xf3b5a9,_0x2b91b5,_0x5f3756){io['to'](_0xf3b5a9)[_0x4403('0x9')](_0x2b91b5,_0x5f3756);}function emitChannelQueueInteraction(_0x253875,_0x4dd55e,_0x2544c5,_0x69de2c,_0x39ebca,_0x52d84d,_0x83b17a,_0x3d9676){var _0x461d33=_[_0x4403('0xa')](_0x2544c5);_0x461d33[_0x4403('0x8')]=_0x3d9676;_0x461d33['queue']=_0x4dd55e;_0x461d33[_0x4403('0xb')]=_0x69de2c;_0x461d33['id']=_0x39ebca;if(_0x52d84d){_0x83b17a[util['format'](_0x4403('0xc'),_0x253875)][_0x39ebca]=_[_0x4403('0xd')](_0x461d33,attributes);}else{delete _0x83b17a[util['format'](_0x4403('0xc'),_0x253875)][_0x39ebca];}emit(util[_0x4403('0xe')](_0x4403('0xf'),_0x253875,_0x4dd55e),util[_0x4403('0xe')](_0x4403('0x10'),_0x253875,_0x52d84d?_0x4403('0x11'):_0x4403('0x12')),_[_0x4403('0xd')](_0x461d33,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x4403('0x13')),'smsQueueReport':require(_0x4403('0x14')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x4403('0x15'))};var queue=schema({'name':{'type':_0x4403('0x16'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x4403('0x17')}});function startRouting(_0x50aa92,_0x354cc4,_0x275d33,_0x428c94){if(_0x50aa92&&_0x354cc4&&_0x275d33){_0x354cc4['waiting']+=0x1;var _0x13c664={'uniqueid':_0x50aa92,'from':_0x275d33[_0x4403('0x18')]?_0x275d33[_0x4403('0x18')][_0x4403('0x19')]:'','joinAt':moment()['format'](_0x4403('0x1a')),'ContactId':_0x275d33[_0x4403('0x1b')]?_0x275d33[_0x4403('0x1b')]['id']:null,'ListId':_0x275d33[_0x4403('0x1c')]?_0x275d33[_0x4403('0x1c')]['id']:null};_0x13c664[_[_0x4403('0x1d')](_0x275d33['channel'])+_0x4403('0x1e')]=_0x354cc4['id']||null;_0x13c664[_[_0x4403('0x1d')](_0x275d33[_0x4403('0x1f')])+_0x4403('0x20')]=_0x275d33[_0x4403('0x21')]?_0x275d33[_0x4403('0x21')]['id']:null;_0x13c664[_['upperFirst'](_0x275d33['channel'])+_0x4403('0x22')]=_0x275d33[_0x4403('0x23')]?_0x275d33[_0x4403('0x23')]['id']:null;_0x13c664[_['upperFirst'](_0x275d33[_0x4403('0x1f')])+(_0x275d33['channel']!=='chat'?'AccountId':'WebsiteId')]=_0x275d33['account']?_0x275d33[_0x4403('0xb')]['id']:null;logger['info'](util['format']('[%s][START:QUEUE][NAME:%s]',_0x50aa92,_0x354cc4[_0x4403('0x24')]));emitChannelQueueInteraction(_0x275d33[_0x4403('0x1f')],_0x354cc4[_0x4403('0x24')],_0x13c664,_0x275d33[_0x4403('0xb')]['name'],_0x275d33[_0x4403('0x23')]['id'],!![],_0x428c94,_0x354cc4['id']);if(rpc[_0x275d33[_0x4403('0x1f')]+_0x4403('0x25')]){return rpc[_0x275d33[_0x4403('0x1f')]+_0x4403('0x25')]['create'](_0x13c664)['catch'](function(_0x121a5c){logger[_0x4403('0x26')](_0x4403('0x27'));});}}}function stopRouting(_0x117422,_0x1fd096,_0x585d31,_0x5ec6a9){if(_0x117422&&_0x1fd096){_0x1fd096['waiting']-=0x1;var _0x2f1ea2={'leaveAt':moment()[_0x4403('0xe')](_0x4403('0x1a')),'acceptAt':moment()[_0x4403('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x4403('0x28')};logger['info'](util[_0x4403('0xe')](_0x4403('0x29'),_0x117422,_0x1fd096[_0x4403('0x24')]));emitChannelQueueInteraction(_0x585d31[_0x4403('0x1f')],_0x1fd096[_0x4403('0x24')],_0x585d31[_0x4403('0x18')],_0x585d31['account'][_0x4403('0x24')],_0x585d31[_0x4403('0x23')]['id'],![],_0x5ec6a9,_0x1fd096['id']);if(rpc[_0x585d31[_0x4403('0x1f')]+_0x4403('0x25')]){return rpc[_0x585d31[_0x4403('0x1f')]+'QueueReport'][_0x4403('0x2a')](_0x117422,_0x2f1ea2)[_0x4403('0x2b')](function(_0x4313d3){logger[_0x4403('0x26')](_0x4403('0x2c'));});}}}function endRouting(_0x1080fb,_0x6da5dd,_0x38d7f8,_0x4e0ddd){if(_0x1080fb&&_0x6da5dd){_0x6da5dd[_0x4403('0x2d')]-=0x1;var _0x5a77e4={'leaveAt':moment()[_0x4403('0xe')](_0x4403('0x1a')),'exitAt':moment()['format'](_0x4403('0x1a')),'reason':_0x4403('0x2e')};logger[_0x4403('0x2f')](util[_0x4403('0xe')]('[%s][END:QUEUE][NAME:%s]',_0x1080fb,_0x6da5dd[_0x4403('0x24')]));emitChannelQueueInteraction(_0x38d7f8['channel'],_0x6da5dd[_0x4403('0x24')],_0x38d7f8['body'],_0x38d7f8[_0x4403('0xb')][_0x4403('0x24')],_0x38d7f8[_0x4403('0x23')]['id'],![],_0x4e0ddd);if(rpc[_0x38d7f8['channel']+_0x4403('0x25')]){return rpc[_0x38d7f8[_0x4403('0x1f')]+_0x4403('0x25')][_0x4403('0x2a')](_0x1080fb,_0x5a77e4)[_0x4403('0x2b')](function(_0x4d5b32){logger[_0x4403('0x26')](_0x4403('0x2c'));});}}}function handleFindQueue(_0x336057){return function(_0x1bcb4c){return _0x1bcb4c[_0x4403('0x24')]['toLowerCase']()===_0x336057[_0x4403('0x30')]();};}exports[_0x4403('0x31')]=function(_0x215434,_0x55485d,_0x574b28,_0x2dc623){return function(_0x168cde){try{var _0x43aa5c={'name':_0x55485d[0x0],'timeout':_0x55485d[0x1]};var _0x4e8bf1=queue['validate'](_0x43aa5c,{'typecast':!![]});if(_0x4e8bf1['length']){logger[_0x4403('0x26')]('[%s][QUEUE]\x20%s',_0x215434,_['map'](_0x4e8bf1,_0x4403('0x23'))[_0x4403('0x32')](',\x20'));_0x168cde['stop']();}else{var _0x4d3b30=_[_0x4403('0x33')](_0x574b28[_0x2dc623[_0x4403('0x1f')]+_0x4403('0x34')],handleFindQueue(_0x43aa5c['name']));if(_0x4d3b30){startRouting(_0x215434,_0x4d3b30,_0x2dc623,_0x574b28);var _0x35aa92=(_0x4d3b30[_0x4403('0x2e')]||0xa)*0x3e8;var _0x2ba45c=(_0x43aa5c[_0x4403('0x2e')]||0x14)*0x3e8;var _0x2410c5,_0x337365;if(_0x35aa92>_0x2ba45c){_0x2ba45c=_0x35aa92;}var _0x5dc63f=seqqueue[_0x4403('0x35')](_0x35aa92);_0x5dc63f['id']=_0x215434;_0x5dc63f['atimeout']=_0x35aa92;_0x5dc63f[_0x4403('0x36')]=_0x2ba45c;_0x5dc63f['channel']=_0x2dc623[_0x4403('0x1f')];_0x574b28[_0x4403('0x37')][_0x215434]['on'](_0x4403('0x38'),function(){logger[_0x4403('0x2f')](_0x4403('0x39'),_0x215434);stopRouting(_0x215434,_0x4d3b30,_0x2dc623,_0x574b28);clearTimeout(_0x2410c5);_0x2410c5=undefined;_0x5dc63f[_0x4403('0x3a')](!![]);if(_0x574b28['rules'][_0x215434]){delete _0x574b28[_0x4403('0x37')][_0x215434];}_0x168cde[_0x4403('0x3b')]();});_0x574b28[_0x4403('0x37')][_0x215434]['on'](_0x4403('0x3c'),function(){if(_0x574b28[_0x4403('0x37')][_0x215434]){delete _0x574b28['rules'][_0x215434];}});_0x2410c5=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x215434);endRouting(_0x215434,_0x4d3b30,_0x2dc623,_0x574b28);clearTimeout(_0x2410c5);_0x5dc63f[_0x4403('0x3a')](!![]);_0x168cde[_0x4403('0x3d')]();},_0x2ba45c);switch(_0x4d3b30['strategy']){case _0x4403('0x3e'):strategy[_0x4403('0x3e')](_0x5dc63f,_0x4d3b30,_0x574b28,_0x2dc623);break;default:strategy['beepall'](_0x5dc63f,_0x4d3b30,_0x574b28,_0x2dc623);}}else{logger[_0x4403('0x26')](_0x4403('0x3f'),_0x215434,_0x43aa5c[_0x4403('0x24')]);_0x168cde['stop']();}}}catch(_0x3dbd11){console[_0x4403('0x40')](_0x3dbd11);logger[_0x4403('0x26')](_0x4403('0x41'),_0x215434,_0x3dbd11[_0x4403('0x42')]);_0x168cde['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index ec84331..3c006b8 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 _0xf00e=['forcedOwnership',':FORCED','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','squeue','agent','realtime','push','handleRun','timeout','bind','drained','handleDrained','handleTimeout','prototype','[%s][AGENT]\x20try\x20with\x20%s','agents','info','isAgentAvailable','channel','busy','notificationId','writeLog','RINGING'];(function(_0x51bbb3,_0x324911){var _0x18bf9c=function(_0x19145a){while(--_0x19145a){_0x51bbb3['push'](_0x51bbb3['shift']());}};_0x18bf9c(++_0x324911);}(_0xf00e,0x1e7));var _0xef00=function(_0x2b33a2,_0x57d7d0){_0x2b33a2=_0x2b33a2-0x0;var _0x357314=_0xf00e[_0x2b33a2];return _0x357314;};'use strict';var _=require(_0xef00('0x0'));var uuid=require(_0xef00('0x1'));var util=require(_0xef00('0x2'));var logger=require(_0xef00('0x3'))(_0xef00('0x4'));var Agent=function(_0x25ec5d,_0x376d66,_0x4e63da,_0x4a6306){this['notificationId']=uuid['v4']();this[_0xef00('0x5')]=_0x25ec5d;this[_0xef00('0x6')]=_0x376d66;this[_0xef00('0x7')]=_0x4e63da;this[_0xef00('0x4')]=_0x4a6306;this[_0xef00('0x5')][_0xef00('0x8')](this[_0xef00('0x9')]['bind'](this),this['handleTimeout']['bind'](this));this['squeue']['on'](_0xef00('0xa'),this['handleTimeout'][_0xef00('0xb')](this));this[_0xef00('0x5')]['on'](_0xef00('0xc'),this[_0xef00('0xd')][_0xef00('0xb')](this));};Agent['prototype']['push']=function(){this['squeue'][_0xef00('0x8')](this[_0xef00('0x9')][_0xef00('0xb')](this),this[_0xef00('0xe')][_0xef00('0xb')](this));};Agent[_0xef00('0xf')][_0xef00('0xd')]=function(){this[_0xef00('0xe')](!![]);};Agent[_0xef00('0xf')][_0xef00('0x9')]=function(_0x556a2f){logger['info'](_0xef00('0x10'),this['squeue']['id'],this[_0xef00('0x6')]['id']);if(_['isNil'](this[_0xef00('0x7')][_0xef00('0x11')][this['agent']['id']])){logger[_0xef00('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xef00('0x5')]['id'],this[_0xef00('0x6')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0xef00('0x13')](this[_0xef00('0x5')]['id'],this[_0xef00('0x7')][_0xef00('0x11')][this[_0xef00('0x6')]['id']],this['squeue'][_0xef00('0x14')],![])){this[_0xef00('0x7')]['agents'][this['agent']['id']][_0xef00('0x15')]=!![];this[_0xef00('0x7')][_0xef00('0x11')][this[_0xef00('0x6')]['id']]['busyQueue']=undefined;util['showNotification'](this[_0xef00('0x16')],this[_0xef00('0x5')]['id'],this[_0xef00('0x7')][_0xef00('0x11')][this['agent']['id']],null,this[_0xef00('0x4')]);util[_0xef00('0x17')](this[_0xef00('0x5')]['id'],this['realtime'][_0xef00('0x11')][this['agent']['id']],_0xef00('0x18')+(this[_0xef00('0x4')][_0xef00('0x19')]?_0xef00('0x1a'):''));}else{logger[_0xef00('0x12')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this['agent']['id']);setTimeout(this[_0xef00('0x8')][_0xef00('0xb')](this),0x3e8);}}};Agent[_0xef00('0xf')][_0xef00('0xe')]=function(_0x4ed3b3){if(_[_0xef00('0x1b')](this[_0xef00('0x7')][_0xef00('0x11')][this['agent']['id']])){return logger[_0xef00('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xef00('0x5')]['id'],this[_0xef00('0x6')]['id']);}else{logger['info'](_0xef00('0x1c'),this['squeue']['id'],this[_0xef00('0x6')]['id']);util[_0xef00('0x1d')](this['notificationId'],this[_0xef00('0x5')]['id'],this[_0xef00('0x7')][_0xef00('0x11')][this[_0xef00('0x6')]['id']],null,this[_0xef00('0x4')]);this[_0xef00('0x7')][_0xef00('0x11')][this['agent']['id']][_0xef00('0x15')]=![];this['realtime'][_0xef00('0x11')][this[_0xef00('0x6')]['id']][_0xef00('0x1e')]=undefined;util[_0xef00('0x17')](this[_0xef00('0x5')]['id'],this['realtime'][_0xef00('0x11')][this[_0xef00('0x6')]['id']],_0x4ed3b3?'STOP':_0xef00('0x1f'));}if(!_0x4ed3b3){setTimeout(this[_0xef00('0x8')][_0xef00('0xb')](this),0x3e8);}};function agent(_0x16e80b,_0x1a1d06,_0x5cc8a9,_0x112b05){return new Agent(_0x16e80b,_0x1a1d06,_0x5cc8a9,_0x112b05);}module['exports']=agent; \ No newline at end of file +var _0x6d9f=['showNotification','writeLog','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','push','handleTimeout','timeout','bind','drained','handleDrained','prototype','handleRun','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','busyQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d9f,0xcf));var _0xf6d9=function(_0x7bd9a7,_0x2e3f2d){_0x7bd9a7=_0x7bd9a7-0x0;var _0x42bbd0=_0x6d9f[_0x7bd9a7];return _0x42bbd0;};'use strict';var _=require('lodash');var uuid=require(_0xf6d9('0x0'));var util=require(_0xf6d9('0x1'));var logger=require(_0xf6d9('0x2'))(_0xf6d9('0x3'));var Agent=function(_0x8742bd,_0x47440f,_0x28a657,_0x502a80){this[_0xf6d9('0x4')]=uuid['v4']();this[_0xf6d9('0x5')]=_0x8742bd;this[_0xf6d9('0x6')]=_0x47440f;this['realtime']=_0x28a657;this['routing']=_0x502a80;this[_0xf6d9('0x5')][_0xf6d9('0x7')](this['handleRun']['bind'](this),this[_0xf6d9('0x8')]['bind'](this));this[_0xf6d9('0x5')]['on'](_0xf6d9('0x9'),this['handleTimeout'][_0xf6d9('0xa')](this));this[_0xf6d9('0x5')]['on'](_0xf6d9('0xb'),this[_0xf6d9('0xc')][_0xf6d9('0xa')](this));};Agent['prototype'][_0xf6d9('0x7')]=function(){this[_0xf6d9('0x5')]['push'](this['handleRun'][_0xf6d9('0xa')](this),this['handleTimeout']['bind'](this));};Agent[_0xf6d9('0xd')]['handleDrained']=function(){this[_0xf6d9('0x8')](!![]);};Agent[_0xf6d9('0xd')][_0xf6d9('0xe')]=function(_0x5b6a76){logger['info'](_0xf6d9('0xf'),this[_0xf6d9('0x5')]['id'],this[_0xf6d9('0x6')]['id']);if(_[_0xf6d9('0x10')](this[_0xf6d9('0x11')][_0xf6d9('0x12')][this['agent']['id']])){logger['info'](_0xf6d9('0x13'),this[_0xf6d9('0x5')]['id'],this[_0xf6d9('0x6')]['id']);setTimeout(this[_0xf6d9('0x7')][_0xf6d9('0xa')](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0xf6d9('0x14')](this['squeue']['id'],this[_0xf6d9('0x11')][_0xf6d9('0x12')][this[_0xf6d9('0x6')]['id']],this[_0xf6d9('0x5')][_0xf6d9('0x15')],![])){this[_0xf6d9('0x11')][_0xf6d9('0x12')][this[_0xf6d9('0x6')]['id']][_0xf6d9('0x16')]=!![];this[_0xf6d9('0x11')][_0xf6d9('0x12')][this[_0xf6d9('0x6')]['id']][_0xf6d9('0x17')]=undefined;util[_0xf6d9('0x18')](this['notificationId'],this[_0xf6d9('0x5')]['id'],this['realtime'][_0xf6d9('0x12')][this['agent']['id']],null,this[_0xf6d9('0x3')]);util[_0xf6d9('0x19')](this[_0xf6d9('0x5')]['id'],this[_0xf6d9('0x11')][_0xf6d9('0x12')][this['agent']['id']],_0xf6d9('0x1a')+(this[_0xf6d9('0x3')][_0xf6d9('0x1b')]?_0xf6d9('0x1c'):''));}else{logger['info'](_0xf6d9('0x1d'),this['squeue']['id'],this[_0xf6d9('0x6')]['id']);setTimeout(this[_0xf6d9('0x7')]['bind'](this),0x3e8);}}};Agent[_0xf6d9('0xd')][_0xf6d9('0x8')]=function(_0x15432f){if(_[_0xf6d9('0x10')](this[_0xf6d9('0x11')][_0xf6d9('0x12')][this['agent']['id']])){return logger['info'](_0xf6d9('0x13'),this['squeue']['id'],this['agent']['id']);}else{logger['info'](_0xf6d9('0x1e'),this[_0xf6d9('0x5')]['id'],this[_0xf6d9('0x6')]['id']);util['hideNotification'](this['notificationId'],this[_0xf6d9('0x5')]['id'],this['realtime'][_0xf6d9('0x12')][this[_0xf6d9('0x6')]['id']],null,this['routing']);this[_0xf6d9('0x11')]['agents'][this[_0xf6d9('0x6')]['id']][_0xf6d9('0x16')]=![];this[_0xf6d9('0x11')][_0xf6d9('0x12')][this['agent']['id']][_0xf6d9('0x17')]=undefined;util['writeLog'](this[_0xf6d9('0x5')]['id'],this[_0xf6d9('0x11')]['agents'][this['agent']['id']],_0x15432f?_0xf6d9('0x1f'):_0xf6d9('0x20'));}if(!_0x15432f){setTimeout(this[_0xf6d9('0x7')][_0xf6d9('0xa')](this),0x3e8);}};function agent(_0xfff4a7,_0x387f55,_0x34fc5a,_0x3edfce){return new Agent(_0xfff4a7,_0x387f55,_0x34fc5a,_0x3edfce);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index b13603d..437e658 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 _0x41f2=['agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','busy','busyQueue','name','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','length','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','queue','realtime','squeue','push','bind','handleTimeout','drained','handleDrained','prototype','handleRun','isNil','Agents'];(function(_0x4b50ca,_0x8341d2){var _0x27758e=function(_0x476e68){while(--_0x476e68){_0x4b50ca['push'](_0x4b50ca['shift']());}};_0x27758e(++_0x8341d2);}(_0x41f2,0x14f));var _0x241f=function(_0x419518,_0xc4edb8){_0x419518=_0x419518-0x0;var _0x52521d=_0x41f2[_0x419518];return _0x52521d;};'use strict';var _=require(_0x241f('0x0'));var uuid=require(_0x241f('0x1'));var util=require('./util');var logger=require(_0x241f('0x2'))(_0x241f('0x3'));var Beepall=function(_0x22d60b,_0x5ddbf,_0x4bf70c,_0x1a7e43){this[_0x241f('0x4')]=uuid['v4']();this['squeue']=_0x22d60b;this[_0x241f('0x5')]=_0x5ddbf;this[_0x241f('0x6')]=_0x4bf70c;this[_0x241f('0x3')]=_0x1a7e43;this[_0x241f('0x7')][_0x241f('0x8')](this['handleRun'][_0x241f('0x9')](this),this[_0x241f('0xa')]['bind'](this));this['squeue']['on']('timeout',this[_0x241f('0xa')]['bind'](this));this[_0x241f('0x7')]['on'](_0x241f('0xb'),this[_0x241f('0xc')]['bind'](this));};Beepall[_0x241f('0xd')]['push']=function(){this[_0x241f('0x7')][_0x241f('0x8')](this[_0x241f('0xe')]['bind'](this),this[_0x241f('0xa')][_0x241f('0x9')](this));};Beepall[_0x241f('0xd')][_0x241f('0xc')]=function(_0x4e06ca){this[_0x241f('0xa')](!![]);};Beepall['prototype'][_0x241f('0xe')]=function(_0x448336){var _0x5f3087=!![];if(!_[_0x241f('0xf')](this[_0x241f('0x5')])&&!_[_0x241f('0xf')](this[_0x241f('0x5')]['Agents'])&&this[_0x241f('0x5')][_0x241f('0x10')]['length']>0x0){for(var _0x24f4b0=0x0,_0x586371;_0x24f4b00x0){for(var _0x3bbf9f=0x0,_0x1caada;_0x3bbf9f0x0&&_0x2f3415[_0xa36371+'CurrentCapacity']>=_0x2f3415[_0xa36371+_0x6709('0x25')]){writeLog(_0x1c5153,_0x2f3415,_0xa36371[_0x6709('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x6709('0x28')]=function(_0x2499a2,_0x50ada6,_0x271098,_0x5b5201,_0x46a325){return sendNotification(!![],_0x2499a2,_0x50ada6,_0x271098,_0x5b5201,_0x46a325);};exports[_0x6709('0x29')]=function(_0x5b6906,_0x137137,_0x4e6989,_0xe066d8,_0x388aee){return sendNotification(![],_0x5b6906,_0x137137,_0x4e6989,_0xe066d8,_0x388aee);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x7ee1=['info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','localhost','format','name','emit','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','user:%s','save'];(function(_0x3e1b44,_0xded3ad){var _0x3e4917=function(_0x1f4527){while(--_0x1f4527){_0x3e1b44['push'](_0x3e1b44['shift']());}};_0x3e4917(++_0xded3ad);}(_0x7ee1,0x8d));var _0x17ee=function(_0x5ec2d0,_0x22eefa){_0x5ec2d0=_0x5ec2d0-0x0;var _0x5ee002=_0x7ee1[_0x5ec2d0];return _0x5ee002;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require('mustache');var Redis=require(_0x17ee('0x1'));var config=require(_0x17ee('0x2'));var logger=require(_0x17ee('0x3'))('routing');config[_0x17ee('0x4')]=_[_0x17ee('0x5')](config[_0x17ee('0x4')],{'host':_0x17ee('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x17ee('0x4')]));function emit(_0x29b9eb,_0x54b4f6,_0x3f61af){io['to'](_0x29b9eb)['emit'](_0x54b4f6,_0x3f61af);}function sendNotification(_0x3d767b,_0xfa5096,_0x2c961f,_0x4af369,_0x4b6374,_0x4d6bb5){io['to'](util[_0x17ee('0x7')]('user:%s',_0x4af369[_0x17ee('0x8')]))[_0x17ee('0x9')](_0x17ee('0xa'),_0x4af369);var _0x3d4f0f=_0x4d6bb5||{};var _0x57fae0=_0x2c961f[_0x17ee('0xb')]('.');var _0x51b5d9={'uniqueid':_0xfa5096,'channel':_0x57fae0[0x0],'id':_0x57fae0[0x1],'title':_0x57fae0[0x0]+_0x17ee('0xc'),'interactionId':_0x57fae0[0x2],'queue':_0x4b6374?_0x4b6374[_0x17ee('0x8')]:null,'sound':_0x3d4f0f[_0x17ee('0xd')][_0x17ee('0xe')],'shake':_0x3d4f0f[_0x17ee('0xd')][_0x17ee('0xf')]};try{if(!_0x3d4f0f[_0x17ee('0x10')]){_0x3d4f0f[_0x17ee('0x10')]={};}if(_0x4b6374){_0x3d4f0f[_0x17ee('0x10')][_0x17ee('0x11')]=_0x4b6374;}else if(_0x3d4f0f[_0x17ee('0x10')]['queue']){delete _0x3d4f0f['body']['queue'];}_0x51b5d9['msg']=utils[_0x17ee('0x12')](_0x3d4f0f[_0x17ee('0xd')][_0x17ee('0x13')],_0x3d4f0f);}catch(_0x2e2287){_0x51b5d9[_0x17ee('0x14')]=_0x17ee('0x15');logger[_0x17ee('0x16')](util['format'](_0x17ee('0x17'),_0xfa5096,_0x2e2287[_0x17ee('0x18')]));}io['to'](util[_0x17ee('0x7')](_0x17ee('0x19'),_0x4af369[_0x17ee('0x8')]))['emit'](util[_0x17ee('0x7')]('notification:%s',_0x3d767b?_0x17ee('0x1a'):'remove'),_0x51b5d9);}function writeLog(_0x1f4956,_0x343f1b,_0x2ee1b6){return logger[_0x17ee('0x1b')](util[_0x17ee('0x7')](_0x17ee('0x1c'),_0x1f4956,_0x343f1b[_0x17ee('0x8')],_0x2ee1b6));}exports[_0x17ee('0x1d')]=function(_0x1425e5,_0x1f3d6d,_0x37fe4e,_0x4d2d91){if(_0x1f3d6d['busy']){writeLog(_0x1425e5,_0x1f3d6d,_0x17ee('0x1e'));return![];}if(!_0x1f3d6d[_0x17ee('0x1f')]){writeLog(_0x1425e5,_0x1f3d6d,_0x17ee('0x20'));return![];}if(_0x1f3d6d[_0x37fe4e+_0x17ee('0x21')]){writeLog(_0x1425e5,_0x1f3d6d,_0x17ee('0x22'));return![];}if(_0x4d2d91&&_0x1f3d6d[_0x17ee('0x23')](_0x37fe4e+_0x17ee('0x24'))&&_0x1f3d6d[_0x17ee('0x23')](_0x37fe4e+_0x17ee('0x25'))){if(_0x1f3d6d[_0x37fe4e+_0x17ee('0x24')]>0x0&&_0x1f3d6d[_0x37fe4e+_0x17ee('0x25')]>=_0x1f3d6d[_0x37fe4e+_0x17ee('0x24')]){writeLog(_0x1425e5,_0x1f3d6d,_0x37fe4e['toUpperCase']()+_0x17ee('0x26'));return![];}}return!![];};exports[_0x17ee('0x27')]=function(_0x11ce7e,_0x258018,_0x125513,_0x51a561,_0x38237c){return sendNotification(!![],_0x11ce7e,_0x258018,_0x125513,_0x51a561,_0x38237c);};exports[_0x17ee('0x28')]=function(_0x295186,_0x4c461b,_0x2220cb,_0x27ab38,_0x56c6ba){return sendNotification(![],_0x295186,_0x4c461b,_0x2220cb,_0x27ab38,_0x56c6ba);};exports[_0x17ee('0x29')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 18aacb0..9cb4aa1 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 _0xdf0a=['trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','validate','shelljs','lodash','./utils','../../../../config/logger','string','length','error','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec'];(function(_0x44e0af,_0x1dfeb1){var _0x545d50=function(_0xd40dc6){while(--_0xd40dc6){_0x44e0af['push'](_0x44e0af['shift']());}};_0x545d50(++_0x1dfeb1);}(_0xdf0a,0x1a9));var _0xadf0=function(_0x411bcb,_0x4803c1){_0x411bcb=_0x411bcb-0x0;var _0x1ed5c8=_0xdf0a[_0x411bcb];return _0x1ed5c8;};'use strict';var schema=require(_0xadf0('0x0'));var sh=require(_0xadf0('0x1'));var _=require(_0xadf0('0x2'));var utils=require(_0xadf0('0x3'));var logger=require(_0xadf0('0x4'))('routing');var system=schema({'command':{'type':_0xadf0('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x183ad1,_0x1c5842){return function(_0x4b2e77){try{var _0x2bb29c={'command':_0x1c5842[0x0]};var _0x41b3f1=system[_0xadf0('0x0')](_0x2bb29c,{'typecast':!![]});if(_0x41b3f1[_0xadf0('0x6')]){logger[_0xadf0('0x7')](_0xadf0('0x8'),_0x183ad1,_[_0xadf0('0x9')](_0x41b3f1,_0xadf0('0xa'))['join'](',\x20'));logger[_0xadf0('0xb')](_0xadf0('0xc'),_0x183ad1);_0x4b2e77[_0xadf0('0xd')]();}else{var _0x238fc9=this;var _0x4ca714=utils[_0xadf0('0xe')](_0x1c5842[0x0],this);logger[_0xadf0('0xb')](_0xadf0('0xf'),_0x183ad1,_0x4ca714);sh[_0xadf0('0x10')](_[_0xadf0('0x11')](_0x4ca714),function(_0x579993,_0x137847){logger[_0xadf0('0xb')](_0xadf0('0x12'),_0x183ad1,_0x579993);if(_0x579993==0x0){var _0x1fcefa=_0x137847[_0xadf0('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xadf0('0x14')](_0x1c5842[0x1])||_[_0xadf0('0x15')](_0x1c5842[0x1])){logger['info'](_0xadf0('0x16'),_0x183ad1);_0x238fc9[_0xadf0('0x17')][_0x1c5842[0x1]]=_0x1fcefa;}else{logger[_0xadf0('0xb')](_0xadf0('0x18'),_0x183ad1,_0x1c5842[0x1],_0x1fcefa);_0x238fc9[_0xadf0('0x17')][_0x1c5842[0x1]]=_0x1fcefa;}}_0x4b2e77[_0xadf0('0xd')]();});}}catch(_0x329420){logger[_0xadf0('0x7')](_0xadf0('0x8'),_0x183ad1,_[_0xadf0('0x19')](_0x329420)?JSON['stringify'](_0x329420):_0x329420);logger[_0xadf0('0xb')](_0xadf0('0xc'),_0x183ad1);_0x4b2e77[_0xadf0('0xd')]();}};}; \ No newline at end of file +var _0xf296=['[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','next','validate','shelljs','./utils','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error'];(function(_0x1eff44,_0x179c36){var _0x4b7d9d=function(_0x3146d1){while(--_0x3146d1){_0x1eff44['push'](_0x1eff44['shift']());}};_0x4b7d9d(++_0x179c36);}(_0xf296,0x94));var _0x6f29=function(_0x3cbe3a,_0x78bfce){_0x3cbe3a=_0x3cbe3a-0x0;var _0x24ffc1=_0xf296[_0x3cbe3a];return _0x24ffc1;};'use strict';var schema=require(_0x6f29('0x0'));var sh=require(_0x6f29('0x1'));var _=require('lodash');var utils=require(_0x6f29('0x2'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0x6f29('0x3'),'required':!![],'message':_0x6f29('0x4')}});exports['consequence']=function(_0x15e80c,_0x209362){return function(_0xd7ee7b){try{var _0x4f0712={'command':_0x209362[0x0]};var _0x1d9c3f=system[_0x6f29('0x0')](_0x4f0712,{'typecast':!![]});if(_0x1d9c3f['length']){logger[_0x6f29('0x5')](_0x6f29('0x6'),_0x15e80c,_[_0x6f29('0x7')](_0x1d9c3f,_0x6f29('0x8'))[_0x6f29('0x9')](',\x20'));logger[_0x6f29('0xa')](_0x6f29('0xb'),_0x15e80c);_0xd7ee7b['next']();}else{var _0x53db5d=this;var _0xbf45fd=utils['getMustacheRender'](_0x209362[0x0],this);logger['info'](_0x6f29('0xc'),_0x15e80c,_0xbf45fd);sh['exec'](_[_0x6f29('0xd')](_0xbf45fd),function(_0xbc9ee6,_0xa8cf8){logger['info'](_0x6f29('0xe'),_0x15e80c,_0xbc9ee6);if(_0xbc9ee6==0x0){var _0x3cec2a=_0xa8cf8[_0x6f29('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0x6f29('0x10')](_0x209362[0x1])||_[_0x6f29('0x11')](_0x209362[0x1])){logger['info'](_0x6f29('0x12'),_0x15e80c);_0x53db5d[_0x6f29('0x13')][_0x209362[0x1]]=_0x3cec2a;}else{logger[_0x6f29('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x15e80c,_0x209362[0x1],_0x3cec2a);_0x53db5d[_0x6f29('0x13')][_0x209362[0x1]]=_0x3cec2a;}}_0xd7ee7b['next']();});}}catch(_0x3959e4){logger[_0x6f29('0x5')](_0x6f29('0x6'),_0x15e80c,_[_0x6f29('0x14')](_0x3959e4)?JSON['stringify'](_0x3959e4):_0x3959e4);logger['info'](_0x6f29('0xb'),_0x15e80c);_0xd7ee7b[_0x6f29('0x15')]();}};}; \ 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 acc3208..14c2570 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 _0xdfa2=['catch','finally','isObject','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','info'];(function(_0x529185,_0x5f5ef5){var _0x541314=function(_0x2c64cf){while(--_0x2c64cf){_0x529185['push'](_0x529185['shift']());}};_0x541314(++_0x5f5ef5);}(_0xdfa2,0x156));var _0x2dfa=function(_0x282be0,_0xb879f0){_0x282be0=_0x282be0-0x0;var _0x11399b=_0xdfa2[_0x282be0];return _0x11399b;};'use strict';var schema=require(_0x2dfa('0x0'));var _=require(_0x2dfa('0x1'));var rpc={'chatInteraction':require(_0x2dfa('0x2')),'openchannelInteraction':require(_0x2dfa('0x3')),'smsInteraction':require(_0x2dfa('0x4')),'mailInteraction':require(_0x2dfa('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x2dfa('0x6'))};var logger=require(_0x2dfa('0x7'))(_0x2dfa('0x8'));var tag=schema({'tag':{'type':_0x2dfa('0x9'),'required':!![],'message':_0x2dfa('0xa')}});exports['consequence']=function(_0x21eeff,_0x469503,_0x4c3825,_0x5751d6){return function(_0x292fe5){try{var _0x59c10d={'tag':_0x469503[0x0]};var _0x287c59=tag[_0x2dfa('0x0')](_0x59c10d,{'typecast':!![]});if(_0x287c59['length']){logger[_0x2dfa('0xb')](_0x2dfa('0xc'),_0x21eeff,_[_0x2dfa('0xd')](_0x287c59,_0x2dfa('0xe'))[_0x2dfa('0xf')](',\x20'));logger['info'](_0x2dfa('0x10'),_0x21eeff);_0x292fe5[_0x2dfa('0x11')]();}else{var _0x5d6630={'ids':[_0x469503[0x0]]};if(rpc[_0x5751d6[_0x2dfa('0x12')]+_0x2dfa('0x13')]){rpc[_0x5751d6['channel']+_0x2dfa('0x13')]['addTags'](_0x5751d6[_0x2dfa('0x14')]['id'],_0x5d6630)['then'](function(_0x225a38){logger[_0x2dfa('0x15')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x21eeff,_0x469503[0x1],_0x5751d6[_0x2dfa('0x12')],_0x5751d6['interaction']['id']);})[_0x2dfa('0x16')](function(_0x1cdf4c){logger[_0x2dfa('0xb')](_0x2dfa('0xc'),_0x21eeff,JSON['stringify'](_0x1cdf4c));logger[_0x2dfa('0x15')](_0x2dfa('0x10'),_0x21eeff);})[_0x2dfa('0x17')](function(){_0x292fe5['next']();});}}}catch(_0x159ae2){logger['error'](_0x2dfa('0xc'),_0x21eeff,_[_0x2dfa('0x18')](_0x159ae2)?JSON[_0x2dfa('0x19')](_0x159ae2):_0x159ae2);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x21eeff);_0x292fe5[_0x2dfa('0x11')]();}};}; \ No newline at end of file +var _0xa7b1=['finally','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','number','consequence','map','message','join','info','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','[%s][TAG]\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa7b1,0x1cd));var _0x1a7b=function(_0x588763,_0x1494b2){_0x588763=_0x588763-0x0;var _0x5cc26a=_0xa7b1[_0x588763];return _0x5cc26a;};'use strict';var schema=require(_0x1a7b('0x0'));var _=require(_0x1a7b('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x1a7b('0x2')),'smsInteraction':require(_0x1a7b('0x3')),'mailInteraction':require(_0x1a7b('0x4')),'faxInteraction':require(_0x1a7b('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x1a7b('0x6'))('routing');var tag=schema({'tag':{'type':_0x1a7b('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x1a7b('0x8')]=function(_0x237406,_0x25fbe6,_0x3b793e,_0x11cf29){return function(_0x155038){try{var _0x3d90ec={'tag':_0x25fbe6[0x0]};var _0x4e118e=tag[_0x1a7b('0x0')](_0x3d90ec,{'typecast':!![]});if(_0x4e118e['length']){logger['error']('[%s][TAG]\x20%s',_0x237406,_[_0x1a7b('0x9')](_0x4e118e,_0x1a7b('0xa'))[_0x1a7b('0xb')](',\x20'));logger[_0x1a7b('0xc')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x237406);_0x155038[_0x1a7b('0xd')]();}else{var _0x358857={'ids':[_0x25fbe6[0x0]]};if(rpc[_0x11cf29[_0x1a7b('0xe')]+_0x1a7b('0xf')]){rpc[_0x11cf29[_0x1a7b('0xe')]+'Interaction'][_0x1a7b('0x10')](_0x11cf29[_0x1a7b('0x11')]['id'],_0x358857)[_0x1a7b('0x12')](function(_0x20d52e){logger[_0x1a7b('0xc')](_0x1a7b('0x13'),_0x237406,_0x25fbe6[0x1],_0x11cf29[_0x1a7b('0xe')],_0x11cf29['interaction']['id']);})[_0x1a7b('0x14')](function(_0x4d63de){logger[_0x1a7b('0x15')](_0x1a7b('0x16'),_0x237406,JSON[_0x1a7b('0x17')](_0x4d63de));logger[_0x1a7b('0xc')](_0x1a7b('0x18'),_0x237406);})[_0x1a7b('0x19')](function(){_0x155038['next']();});}}}catch(_0x50e0e1){logger[_0x1a7b('0x15')](_0x1a7b('0x16'),_0x237406,_[_0x1a7b('0x1a')](_0x50e0e1)?JSON[_0x1a7b('0x17')](_0x50e0e1):_0x50e0e1);logger[_0x1a7b('0xc')](_0x1a7b('0x18'),_0x237406);_0x155038['next']();}};}; \ 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 107d18d..9fa8f1d 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 _0x7901=['parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','login','params','stringify','utf8','POST','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7901,0xb8));var _0x1790=function(_0x27aba4,_0x2b1ded){_0x27aba4=_0x27aba4-0x0;var _0x46020b=_0x7901[_0x27aba4];return _0x46020b;};'use strict';var rp=require(_0x1790('0x0'));var logger=require('../../../../config/logger')(_0x1790('0x1'));var _=require(_0x1790('0x2'));var arr=[];exports[_0x1790('0x3')]=function(_0x2185be,_0x4e1c1b){return function(_0x4bf00d){var _0x479e24=_0x4e1c1b[0xa];var _0x5cadbf=_0x4e1c1b[0xb];var _0x4d40dc=_0x4e1c1b[0xc];var _0x2a7b4a=_0x4e1c1b[0xd];var _0xaf6c1b=_0x4e1c1b[0xe];var _0x20fffb=_0x4e1c1b[0xf][_0x1790('0x4')](/\n/g,_0x1790('0x5'));var _0x45aa5f=_0x4e1c1b[0x10][_0x1790('0x4')](/\n/g,'\x20');if(!arr[_0x1790('0x6')](_0x5cadbf)){arr[_0x1790('0x7')](_0x5cadbf);var _0x2c64a4=_0x4e1c1b[0x3];var _0x2839fa=_0x4e1c1b[0x4];var _0x272858=_0x4e1c1b[0x1];var _0x46fc45=_0x4e1c1b[0x0];var _0x436b04={};_0x436b04[_0x1790('0x8')]=_0x4e1c1b[0x8]+_0x1790('0x9')+_0x4d40dc+'|'+_0x479e24+'|'+_0x2a7b4a+'|'+_0x5cadbf+'|'+_0xaf6c1b;_0x436b04[_0x1790('0xa')]=_0x4e1c1b[0x7]+_0x1790('0x9')+_0x4d40dc+'|'+_0x479e24+'|'+_0x2a7b4a+'|'+_0x5cadbf+'|'+_0xaf6c1b+'|'+_0x20fffb+'|'+_0x45aa5f;_0x436b04[_0x1790('0xb')]=_0x4e1c1b[0x9];var _0xfeffdb={};_0xfeffdb[_0x1790('0xc')]=_0x1790('0xd');_0xfeffdb['method']=_0x1790('0xe');var _0x23996b=[];_0x23996b[_0x1790('0x7')](_0x4e1c1b[0x2]);_0x23996b['push'](_0x4e1c1b[0x5]);_0x23996b[_0x1790('0x7')](_0x4e1c1b[0x6]);_0xfeffdb[_0x1790('0xf')]=_0x23996b;_0xfeffdb['id']=0x1;var _0x4ddfa1=JSON[_0x1790('0x10')](_0xfeffdb);var _0x310954={'encoding':_0x1790('0x11'),'method':_0x1790('0x12'),'timeout':0x2710,'url':_0x2c64a4,'headers':{'Content-Type':'application/json-rpc'},'body':_0x4ddfa1};return rp(_0x310954)[_0x1790('0x13')](function(_0x1691fa){const _0x1a3439=JSON[_0x1790('0x14')](_0x1691fa);if(!_0x1a3439[_0x1790('0x15')]['logged']){throw new Error(_0x1790('0x16'));}var _0x235208=_0x5cadbf;var _0x404959=_0x1790('0x17')+_0x272858+_0x1790('0x18')+_0x46fc45+'&sessionId='+_0x235208+_0x1790('0x19')+JSON[_0x1790('0x10')](_0x436b04);var _0x182d4a=_0x2839fa+'?'+_0x404959;return rp(_0x182d4a);})[_0x1790('0x13')](function(_0x7b6daf){logger[_0x1790('0x1a')](_0x1790('0x1b'),_0x2185be,_0x7b6daf);_0x4bf00d['stop']();})[_0x1790('0x1c')](function(_0x48039f){logger[_0x1790('0x1d')]('[%s][TVOX]\x20%s',_0x2185be,_[_0x1790('0x1e')](_0x48039f)?JSON[_0x1790('0x10')](_0x48039f):_0x48039f);_0x4bf00d[_0x1790('0x1f')]();});}else{logger[_0x1790('0x1a')](_0x1790('0x20'),_0x2185be);_0x4bf00d[_0x1790('0x21')]();}};}; \ No newline at end of file +var _0xb374=['push','urlOnAnswer','?params=','urlOnRing','title','2.0','method','login','params','utf8','POST','application/json-rpc','then','parse','result','logged','channelId=','&serviceId=','&data=','info','stop','catch','error','[%s][TVOX]\x20%s','stringify','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','routing','lodash','consequence','replace','\x20-\x20'];(function(_0x51c91c,_0x98db6c){var _0x3494ea=function(_0x261742){while(--_0x261742){_0x51c91c['push'](_0x51c91c['shift']());}};_0x3494ea(++_0x98db6c);}(_0xb374,0xc0));var _0x4b37=function(_0x3baa82,_0x576f43){_0x3baa82=_0x3baa82-0x0;var _0x18d909=_0xb374[_0x3baa82];return _0x18d909;};'use strict';var rp=require(_0x4b37('0x0'));var logger=require('../../../../config/logger')(_0x4b37('0x1'));var _=require(_0x4b37('0x2'));var arr=[];exports[_0x4b37('0x3')]=function(_0x38ddd2,_0x833770){return function(_0x5c9e6b){var _0x488835=_0x833770[0xa];var _0x51e67e=_0x833770[0xb];var _0x2e0954=_0x833770[0xc];var _0x220dbf=_0x833770[0xd];var _0x13abd9=_0x833770[0xe];var _0x4b53e3=_0x833770[0xf][_0x4b37('0x4')](/\n/g,_0x4b37('0x5'));var _0x3f7f5d=_0x833770[0x10][_0x4b37('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x51e67e)){arr[_0x4b37('0x6')](_0x51e67e);var _0x5d3c8f=_0x833770[0x3];var _0xed9857=_0x833770[0x4];var _0xdcec66=_0x833770[0x1];var _0x4a270f=_0x833770[0x0];var _0x188cc9={};_0x188cc9[_0x4b37('0x7')]=_0x833770[0x8]+_0x4b37('0x8')+_0x2e0954+'|'+_0x488835+'|'+_0x220dbf+'|'+_0x51e67e+'|'+_0x13abd9;_0x188cc9[_0x4b37('0x9')]=_0x833770[0x7]+_0x4b37('0x8')+_0x2e0954+'|'+_0x488835+'|'+_0x220dbf+'|'+_0x51e67e+'|'+_0x13abd9+'|'+_0x4b53e3+'|'+_0x3f7f5d;_0x188cc9[_0x4b37('0xa')]=_0x833770[0x9];var _0x5aaee9={};_0x5aaee9['jsonrpc']=_0x4b37('0xb');_0x5aaee9[_0x4b37('0xc')]=_0x4b37('0xd');var _0x5677eb=[];_0x5677eb['push'](_0x833770[0x2]);_0x5677eb[_0x4b37('0x6')](_0x833770[0x5]);_0x5677eb[_0x4b37('0x6')](_0x833770[0x6]);_0x5aaee9[_0x4b37('0xe')]=_0x5677eb;_0x5aaee9['id']=0x1;var _0x37933a=JSON['stringify'](_0x5aaee9);var _0x3f05fa={'encoding':_0x4b37('0xf'),'method':_0x4b37('0x10'),'timeout':0x2710,'url':_0x5d3c8f,'headers':{'Content-Type':_0x4b37('0x11')},'body':_0x37933a};return rp(_0x3f05fa)[_0x4b37('0x12')](function(_0x17a59e){const _0x2c2469=JSON[_0x4b37('0x13')](_0x17a59e);if(!_0x2c2469[_0x4b37('0x14')][_0x4b37('0x15')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x4afcc5=_0x51e67e;var _0x5d6465=_0x4b37('0x16')+_0xdcec66+_0x4b37('0x17')+_0x4a270f+'&sessionId='+_0x4afcc5+_0x4b37('0x18')+JSON['stringify'](_0x188cc9);var _0x15a0bc=_0xed9857+'?'+_0x5d6465;return rp(_0x15a0bc);})[_0x4b37('0x12')](function(_0x431fe8){logger[_0x4b37('0x19')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x38ddd2,_0x431fe8);_0x5c9e6b[_0x4b37('0x1a')]();})[_0x4b37('0x1b')](function(_0x40049d){logger[_0x4b37('0x1c')](_0x4b37('0x1d'),_0x38ddd2,_['isObject'](_0x40049d)?JSON[_0x4b37('0x1e')](_0x40049d):_0x40049d);_0x5c9e6b[_0x4b37('0x1a')]();});}else{logger[_0x4b37('0x19')](_0x4b37('0x1f'),_0x38ddd2);_0x5c9e6b[_0x4b37('0x20')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index b5bd39f..9a09e18 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x3dd0ad,_0x50643f){var _0x122a02=function(_0x431da3){while(--_0x431da3){_0x3dd0ad['push'](_0x3dd0ad['shift']());}};_0x122a02(++_0x50643f);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x8deb1d,_0x17ec43){var _0x2ad45e=function(_0xc0f286){while(--_0xc0f286){_0x8deb1d['push'](_0x8deb1d['shift']());}};_0x2ad45e(++_0x17ec43);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 858c8dc..aa1bd06 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 _0x3a25=['end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','listen','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','rules','message','interaction','applications','isArray','existsSync','join','app','.js','toLowerCase','autoreply','appdata','mail','push','slice','length','dialogflow','split','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','body','./interval','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','complete','routing\x20is\x20empty','agents','agent','busy','busyQueue','channel','emit'];(function(_0x2b71ac,_0x5aeeb5){var _0xe9c88f=function(_0x12ef1f){while(--_0x12ef1f){_0x2b71ac['push'](_0x2b71ac['shift']());}};_0xe9c88f(++_0x5aeeb5);}(_0x3a25,0x15d));var _0x53a2=function(_0x5497b7,_0x3d9b7b){_0x5497b7=_0x5497b7-0x0;var _0x422098=_0x3a25[_0x5497b7];return _0x422098;};'use strict';var _=require(_0x53a2('0x0'));var util=require(_0x53a2('0x1'));var path=require(_0x53a2('0x2'));var fs=require('fs');var jayson=require(_0x53a2('0x3'));var BPromise=require(_0x53a2('0x4'));var uuid=require(_0x53a2('0x5'));var utils=require(_0x53a2('0x6'));var config=require(_0x53a2('0x7'));var logger=require(_0x53a2('0x8'))(_0x53a2('0x9'));var rpc={'openchannelQueueReport':require(_0x53a2('0xa')),'mailQueueReport':require(_0x53a2('0xb')),'chatQueueReport':require(_0x53a2('0xc')),'smsQueueReport':require(_0x53a2('0xd')),'faxQueueReport':require(_0x53a2('0xe')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x53a2('0xf'));function getId(_0x5dc70e,_0x17aa09,_0x1f4de7){return util[_0x53a2('0x10')](_0x53a2('0x11'),_0x5dc70e,_0x17aa09||0x0,_0x1f4de7||0x0);}function getIntervals(_0x13550a,_0x45f0c4){var _0x42f093=[];if(!_[_0x53a2('0x12')](_0x45f0c4[_0x53a2('0x13')])&&!_[_0x53a2('0x12')](_0x13550a[_0x45f0c4['IntervalId']])&&!_['isNil'](_0x13550a[_0x45f0c4[_0x53a2('0x13')]][_0x53a2('0x14')])){_0x42f093=_['map'](_0x13550a[_0x45f0c4['IntervalId']]['Intervals'],_0x53a2('0x15'));}else if(!_[_0x53a2('0x12')](_0x45f0c4[_0x53a2('0x15')])){_0x42f093=[_0x45f0c4['interval']];}return _0x42f093;}exports['listen']=function(_0x4e2228){_0x4e2228[_0x53a2('0x16')]={};return new BPromise(function(_0x39be1b,_0x411186){var _0xf9b589={'Start':function(_0x4d3a40){var _0x1779ef=this;return new Promise(function(_0x3343d3,_0x4401b7){if(_0x4d3a40){try{var _0x42db86=[];var _0x34c7de=getId(_0x4d3a40['channel'],_0x4d3a40['message']?_0x4d3a40[_0x53a2('0x17')]['id']:0x0,_0x4d3a40[_0x53a2('0x18')]?_0x4d3a40[_0x53a2('0x18')]['id']:0x0);if(_0x4d3a40[_0x53a2('0x19')]&&_[_0x53a2('0x1a')](_0x4d3a40[_0x53a2('0x19')])&&_0x4d3a40['applications']['length']){for(var _0x3446c2=0x0;_0x3446c2<_0x4d3a40[_0x53a2('0x19')]['length'];_0x3446c2+=0x1){var _0x2b7059=_0x4d3a40[_0x53a2('0x19')][_0x3446c2];if(fs[_0x53a2('0x1b')](path[_0x53a2('0x1c')](__dirname,'applications',_0x2b7059[_0x53a2('0x1d')]+_0x53a2('0x1e')))){var _0xd9693c=[];switch(_0x2b7059[_0x53a2('0x1d')][_0x53a2('0x1f')]()){case _0x53a2('0x20'):var _0x236487=_0x2b7059[_0x53a2('0x21')]['split'](',');if(_0x4d3a40['channel']===_0x53a2('0x22')){_0xd9693c[_0x53a2('0x23')](_0x236487[0x0]);_0xd9693c[_0x53a2('0x23')](_0x236487[0x1]);_0xd9693c[_0x53a2('0x23')](_0x236487[_0x53a2('0x24')](0x2,_0x236487[_0x53a2('0x25')])['join'](','));}else{_0xd9693c[_0x53a2('0x23')](_0x236487[0x0]);_0xd9693c[_0x53a2('0x23')](_0x236487[_0x53a2('0x24')](0x1,_0x236487[_0x53a2('0x25')])[_0x53a2('0x1c')](','));}break;case _0x53a2('0x26'):var _0x21325d=_0x2b7059[_0x53a2('0x21')][_0x53a2('0x27')](',');_0xd9693c[_0x53a2('0x23')](_0x21325d[0x0]);_0xd9693c[_0x53a2('0x23')](_0x21325d[0x1]);_0xd9693c[_0x53a2('0x23')](_0x21325d[_0x53a2('0x24')](0x2,_0x21325d[_0x53a2('0x25')])[_0x53a2('0x1c')](','));break;case _0x53a2('0x28'):var _0x437916=_0x2b7059['appdata'][_0x53a2('0x27')](',');_0xd9693c[_0x53a2('0x23')](_0x437916[0x0]);_0xd9693c[_0x53a2('0x23')](_0x437916[0x1]);_0xd9693c[_0x53a2('0x23')](_0x437916[0x2]);_0xd9693c[_0x53a2('0x23')](_0x437916[0x3]);_0xd9693c[_0x53a2('0x23')](_0x437916[_0x53a2('0x24')](0x4,_0x437916[_0x53a2('0x25')])[_0x53a2('0x1c')](','));break;case _0x53a2('0x29'):var _0x21d943=_0x2b7059['appdata'][_0x53a2('0x27')](',');_0xd9693c[_0x53a2('0x23')](_0x21d943[0x0]);_0xd9693c[_0x53a2('0x23')](_0x21d943[0x1]);_0xd9693c[_0x53a2('0x23')](_0x21d943[0x2]);_0xd9693c[_0x53a2('0x23')](_0x21d943[0x3]);_0xd9693c[_0x53a2('0x23')](_0x21d943[_0x53a2('0x24')](0x4,_0x21d943[_0x53a2('0x25')])['join'](','));break;case _0x53a2('0x17'):_0xd9693c[_0x53a2('0x23')](_0x2b7059[_0x53a2('0x21')]);break;case _0x53a2('0x2a'):_0xd9693c['push'](_0x2b7059[_0x53a2('0x2b')]);_0xd9693c[_0x53a2('0x23')](_0x2b7059[_0x53a2('0x21')]);break;case _0x53a2('0x2c'):var _0x218956=utils[_0x53a2('0x2d')](_0x4d3a40['account'][_0x53a2('0x2e')],_0x4d3a40);var _0x14f236=_0x2b7059[_0x53a2('0x21')]['split'](',');_0xd9693c[_0x53a2('0x23')](_0x14f236[0x0]);_0xd9693c['push'](_0x14f236[0x1]);_0xd9693c[_0x53a2('0x23')](_0x14f236[0x2]);_0xd9693c[_0x53a2('0x23')](_0x14f236[0x3]);_0xd9693c[_0x53a2('0x23')](_0x14f236[0x4]);_0xd9693c['push'](_0x14f236[0x5]);_0xd9693c['push'](_0x14f236[0x6]);_0xd9693c[_0x53a2('0x23')](_0x14f236[0x7]);_0xd9693c['push'](_0x14f236[0x8]);_0xd9693c[_0x53a2('0x23')](_0x14f236[0x9]);_0xd9693c[_0x53a2('0x23')](_0x14f236[0xa]);_0xd9693c[_0x53a2('0x23')](_0x4d3a40[_0x53a2('0x18')]['id']);_0xd9693c[_0x53a2('0x23')](_0x4d3a40[_0x53a2('0x17')]['id']);_0xd9693c['push'](_0x2b7059[_0x53a2('0x2f')]);_0xd9693c[_0x53a2('0x23')](_0x4d3a40['interaction']['ContactId']);_0xd9693c[_0x53a2('0x23')](_0x4d3a40['body'][_0x53a2('0x30')]);_0xd9693c[_0x53a2('0x23')](_0x218956);break;default:_0xd9693c=_['isNil'](_0x2b7059[_0x53a2('0x21')])?[]:_0x2b7059[_0x53a2('0x21')][_0x53a2('0x27')](',');}var _0x1aa50d={'id':util[_0x53a2('0x10')]('%s:%s:%s',_0x34c7de,_0x2b7059['id'],_0x2b7059[_0x53a2('0x1d')]),'condition':require(_0x53a2('0x31'))['condition'](_0x34c7de,getIntervals(_0x4e2228[_0x53a2('0x32')],_0x2b7059),_0x4e2228),'consequence':require(_0x53a2('0x33')+_0x2b7059['app'])[_0x53a2('0x34')](_0x34c7de,_0xd9693c,_0x4e2228,_0x4d3a40),'p':_0x2b7059['priority']||0x0};logger[_0x53a2('0x35')](_0x53a2('0x36'),_0x1aa50d['id'],_0x53a2('0x37'),getIntervals(_0x4e2228[_0x53a2('0x32')],_0x2b7059)[_0x53a2('0x1c')](_0x53a2('0x38')));_0x42db86['push'](_0x1aa50d);}else{logger[_0x53a2('0x39')](_0x53a2('0x3a'),path[_0x53a2('0x1c')](__dirname,_0x53a2('0x19'),_0x2b7059[_0x53a2('0x1d')]+_0x53a2('0x1e')));}}_0x4e2228[_0x53a2('0x16')][_0x34c7de]=new RuleEngine(_0x42db86);_0x4e2228[_0x53a2('0x16')][_0x34c7de][_0x53a2('0x3b')](_0x4d3a40,function(_0x1b5fbe){logger[_0x53a2('0x35')](_0x53a2('0x3c'),JSON[_0x53a2('0x3d')](_0x1b5fbe[_0x53a2('0x3e')]));if(_0x4e2228[_0x53a2('0x16')][_0x34c7de]){_0x4e2228[_0x53a2('0x16')][_0x34c7de]['emit'](_0x53a2('0x3f'));}});return _0x3343d3({'code':0xc8,'message':_0x4d3a40});}else{logger[_0x53a2('0x35')]('No\x20applications\x20to\x20execute');return _0x3343d3({'code':0xc8,'message':_0x4d3a40});}}catch(_0x52e69d){logger[_0x53a2('0x39')](_0x52e69d['stack']);return _0x4401b7(_0x1779ef['error'](0x1f4,_0x52e69d));}}return _0x4401b7(_0x53a2('0x40'));});},'AcceptMessage':function(_0x22b324){var _0x37432a=this;return new Promise(function(_0x3001e2,_0x47ff27){if(_0x22b324['agent']&&_0x22b324['agent']['id']){if(_0x4e2228[_0x53a2('0x41')][_0x22b324['agent']['id']]){_0x4e2228['agents'][_0x22b324[_0x53a2('0x42')]['id']][_0x53a2('0x43')]=![];_0x4e2228[_0x53a2('0x41')][_0x22b324[_0x53a2('0x42')]['id']][_0x53a2('0x44')]=undefined;}}if(_0x22b324['message']&&_0x22b324[_0x53a2('0x17')]['id']){try{var _0x5d8f65=getId(_0x22b324[_0x53a2('0x45')],_0x22b324[_0x53a2('0x17')]?_0x22b324['message']['id']:0x0,_0x22b324[_0x53a2('0x18')]?_0x22b324[_0x53a2('0x18')]['id']:0x0);if(_0x4e2228[_0x53a2('0x16')][_0x5d8f65]){_0x4e2228[_0x53a2('0x16')][_0x5d8f65][_0x53a2('0x46')](_0x53a2('0x47'));if(rpc[_0x22b324[_0x53a2('0x45')]+'QueueReport']){rpc[_0x22b324[_0x53a2('0x45')]+_0x53a2('0x48')][_0x53a2('0x49')](_0x5d8f65,{'UserId':_0x22b324['message'][_0x53a2('0x4a')]})[_0x53a2('0x4b')](function(_0x42238f){logger[_0x53a2('0x39')](_0x53a2('0x4c'));});}}return _0x3001e2({'code':0xc8,'message':_0x22b324});}catch(_0x567fce){logger['error'](_0x567fce[_0x53a2('0x4d')]);return _0x47ff27(_0x37432a['error'](0x1f4,_0x567fce));}}logger[_0x53a2('0x39')](_0x53a2('0x4e'));return _0x47ff27(_0x37432a['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0xea7cbd){var _0x382eba=this;return new Promise(function(_0x3b1b43,_0x5eae3e){if(_0xea7cbd['agent']&&_0xea7cbd[_0x53a2('0x42')]['id']){try{if(_0x4e2228[_0x53a2('0x41')][_0xea7cbd[_0x53a2('0x42')]['id']]){_0x4e2228[_0x53a2('0x41')][_0xea7cbd[_0x53a2('0x42')]['id']]['busy']=![];_0x4e2228[_0x53a2('0x41')][_0xea7cbd[_0x53a2('0x42')]['id']][_0x53a2('0x44')]=undefined;}return _0x3b1b43({'code':0xc8,'message':_0xea7cbd});}catch(_0x35ed40){logger[_0x53a2('0x39')](_0x35ed40[_0x53a2('0x4d')]);return _0x5eae3e(_0x382eba[_0x53a2('0x39')](0x1f4,_0x35ed40));}}logger['error'](_0x53a2('0x4e'));return _0x5eae3e(_0x382eba['error'](0x1f4,_0x53a2('0x4e')));});},'AbandonInteraction':function(_0x867db6){var _0x3b91eb=this;return new Promise(function(_0x3fdc94,_0x54a1c4){if(_0x867db6[_0x53a2('0x45')]&&_0x867db6[_0x53a2('0x18')]&&_0x867db6[_0x53a2('0x18')]['id']){try{var _0x2b6ab8=getId(_0x867db6[_0x53a2('0x45')],_0x867db6[_0x53a2('0x17')]?_0x867db6['message']['id']:0x0,_0x867db6[_0x53a2('0x18')]?_0x867db6[_0x53a2('0x18')]['id']:0x0);if(_0x4e2228[_0x53a2('0x16')][_0x2b6ab8]){_0x4e2228[_0x53a2('0x16')][_0x2b6ab8][_0x53a2('0x46')](_0x53a2('0x47'));}return _0x3fdc94({'code':0xc8,'message':_0x867db6});}catch(_0x22f40d){logger['error'](_0x22f40d[_0x53a2('0x4d')]);return _0x54a1c4(_0x3b91eb['error'](0x1f4,_0x22f40d));}}logger[_0x53a2('0x39')](_0x53a2('0x4e'));return _0x54a1c4(_0x3b91eb[_0x53a2('0x39')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x303f04){var _0xd44b05=this;return new Promise(function(_0x560fc1,_0x1be4ee){if(_0x4e2228['agents'][_0x53a2('0x4f')](_0x303f04['id'])){for(var _0x3aed8d in _0x303f04[_0x53a2('0x50')]){if(_0x303f04[_0x53a2('0x50')]['hasOwnProperty'](_0x3aed8d)){if(_0x4e2228[_0x53a2('0x41')][_0x303f04['id']][_0x53a2('0x4f')](_0x3aed8d+_0x53a2('0x51'))){_0x4e2228[_0x53a2('0x41')][_0x303f04['id']][_0x3aed8d+_0x53a2('0x51')]=parseInt(_0x303f04[_0x53a2('0x50')][_0x3aed8d],0xa);}}}_0x4e2228[_0x53a2('0x41')][_0x303f04['id']][_0x53a2('0x52')]();return _0x560fc1({'code':0xc8,'message':_0x4e2228[_0x53a2('0x41')][_0x303f04['id']]});}else{return _0x1be4ee(_0xd44b05[_0x53a2('0x39')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0xdd35f){return new Promise(function(_0x5a76f8,_0x4a4dd9){var _0x3bc128=_[_0x53a2('0x53')](_0x4e2228['agents']);_0x5a76f8({'count':_0x3bc128['length'],'rows':_0x3bc128});});},'ChatQueues':function(_0xc9229e){return new Promise(function(_0x129c73,_0x3ba714){var _0x3e6374=[];for(var _0x5b5309 in _0x4e2228[_0x53a2('0x54')]){if(_0x4e2228['chatQueues'][_0x53a2('0x4f')](_0x5b5309)){var _0x1dad4e=_0x4e2228[_0x53a2('0x54')][_0x5b5309];var _0x52930e={'id':_0x1dad4e['id'],'available':_0x1dad4e[_0x53a2('0x55')],'loggedIn':_0x1dad4e[_0x53a2('0x56')],'name':_0x1dad4e[_0x53a2('0x57')],'paused':_0x1dad4e[_0x53a2('0x58')],'waiting':_0x1dad4e[_0x53a2('0x59')]};_0x3e6374[_0x53a2('0x23')](_0x52930e);}}_0x129c73({'count':_0x3e6374[_0x53a2('0x25')],'rows':_0x3e6374});});},'MailQueues':function(_0x34cd6a){return new Promise(function(_0x825085,_0x18b7c6){var _0x2368d3=[];for(var _0x1c8d3a in _0x4e2228[_0x53a2('0x5a')]){if(_0x4e2228[_0x53a2('0x5a')][_0x53a2('0x4f')](_0x1c8d3a)){var _0x321b2e=_0x4e2228['mailQueues'][_0x1c8d3a];var _0x319a21={'id':_0x321b2e['id'],'available':_0x321b2e['available'],'loggedIn':_0x321b2e[_0x53a2('0x56')],'name':_0x321b2e[_0x53a2('0x57')],'paused':_0x321b2e[_0x53a2('0x58')],'waiting':_0x321b2e[_0x53a2('0x59')]};_0x2368d3[_0x53a2('0x23')](_0x319a21);}}_0x825085({'count':_0x2368d3[_0x53a2('0x25')],'rows':_0x2368d3});});},'OpenchannelQueues':function(_0x10ee58){return new Promise(function(_0x1dd5fd,_0x29c7b2){var _0x27cc5c=[];for(var _0x537e95 in _0x4e2228[_0x53a2('0x5b')]){if(_0x4e2228[_0x53a2('0x5b')][_0x53a2('0x4f')](_0x537e95)){var _0x5a0c99=_0x4e2228[_0x53a2('0x5b')][_0x537e95];var _0x245c5e={'id':_0x5a0c99['id'],'available':_0x5a0c99['available'],'loggedIn':_0x5a0c99['loggedIn'],'name':_0x5a0c99[_0x53a2('0x57')],'paused':_0x5a0c99[_0x53a2('0x58')],'waiting':_0x5a0c99[_0x53a2('0x59')]};_0x27cc5c[_0x53a2('0x23')](_0x245c5e);}}_0x1dd5fd({'count':_0x27cc5c[_0x53a2('0x25')],'rows':_0x27cc5c});});},'SmsQueues':function(_0x4c6734){return new Promise(function(_0x29b4e1,_0x2069ce){var _0x1626f6=[];for(var _0x1589a8 in _0x4e2228[_0x53a2('0x5c')]){if(_0x4e2228[_0x53a2('0x5c')][_0x53a2('0x4f')](_0x1589a8)){var _0x26888a=_0x4e2228[_0x53a2('0x5c')][_0x1589a8];var _0x54aa95={'id':_0x26888a['id'],'available':_0x26888a[_0x53a2('0x55')],'loggedIn':_0x26888a[_0x53a2('0x56')],'name':_0x26888a[_0x53a2('0x57')],'paused':_0x26888a[_0x53a2('0x58')],'waiting':_0x26888a[_0x53a2('0x59')]};_0x1626f6[_0x53a2('0x23')](_0x54aa95);}}_0x29b4e1({'count':_0x1626f6[_0x53a2('0x25')],'rows':_0x1626f6});});},'FaxQueues':function(_0x23dff3){return new Promise(function(_0x2815ab,_0xed760a){var _0x23f04b=[];for(var _0x42fea7 in _0x4e2228[_0x53a2('0x5d')]){if(_0x4e2228[_0x53a2('0x5d')][_0x53a2('0x4f')](_0x42fea7)){var _0x2f3375=_0x4e2228['faxQueues'][_0x42fea7];var _0x4faa54={'id':_0x2f3375['id'],'available':_0x2f3375[_0x53a2('0x55')],'loggedIn':_0x2f3375['loggedIn'],'name':_0x2f3375[_0x53a2('0x57')],'paused':_0x2f3375[_0x53a2('0x58')],'waiting':_0x2f3375['waiting']};_0x23f04b[_0x53a2('0x23')](_0x4faa54);}}_0x2815ab({'count':_0x23f04b[_0x53a2('0x25')],'rows':_0x23f04b});});},'WhatsappQueues':function(_0x4757ef){return new Promise(function(_0x212d94,_0x5d386c){var _0x4ddff8=[];for(var _0x57d8cc in _0x4e2228[_0x53a2('0x5e')]){if(_0x4e2228[_0x53a2('0x5e')][_0x53a2('0x4f')](_0x57d8cc)){var _0x777a51=_0x4e2228[_0x53a2('0x5e')][_0x57d8cc];var _0x40309d={'id':_0x777a51['id'],'available':_0x777a51[_0x53a2('0x55')],'loggedIn':_0x777a51[_0x53a2('0x56')],'name':_0x777a51['name'],'paused':_0x777a51[_0x53a2('0x58')],'waiting':_0x777a51[_0x53a2('0x59')]};_0x4ddff8[_0x53a2('0x23')](_0x40309d);}}_0x212d94({'count':_0x4ddff8[_0x53a2('0x25')],'rows':_0x4ddff8});});},'ChatQueuesWaitingInteractions':function(_0x581764){return new Promise(function(_0x1f7a86,_0x2cf305){var _0xa65858=_['values'](_0x4e2228[_0x53a2('0x5f')]);_0x1f7a86({'count':_0xa65858[_0x53a2('0x25')],'rows':_0xa65858});});},'MailQueuesWaitingInteractions':function(_0x3d288e){return new Promise(function(_0x4783ad,_0x4a0a99){var _0x464157=_[_0x53a2('0x53')](_0x4e2228[_0x53a2('0x60')]);_0x4783ad({'count':_0x464157['length'],'rows':_0x464157});});},'OpenchannelQueuesWaitingInteractions':function(_0x1d4a99){return new Promise(function(_0x395c51,_0x59dae1){var _0x24cb49=_['values'](_0x4e2228[_0x53a2('0x61')]);_0x395c51({'count':_0x24cb49[_0x53a2('0x25')],'rows':_0x24cb49});});},'SmsQueuesWaitingInteractions':function(_0x5de009){return new Promise(function(_0x56b958,_0x4cb2b5){var _0xcdbb78=_['values'](_0x4e2228['smsQueuesWaitingInteractions']);_0x56b958({'count':_0xcdbb78['length'],'rows':_0xcdbb78});});},'FaxQueuesWaitingInteractions':function(_0x1c30bb){return new Promise(function(_0x68a73c,_0x5d675d){var _0x386914=_[_0x53a2('0x53')](_0x4e2228[_0x53a2('0x62')]);_0x68a73c({'count':_0x386914[_0x53a2('0x25')],'rows':_0x386914});});},'WhatsappQueuesWaitingInteractions':function(_0x38a08a){return new Promise(function(_0x5b6679,_0x1ebe6c){var _0x5389bd=_[_0x53a2('0x53')](_0x4e2228[_0x53a2('0x63')]);_0x5b6679({'count':_0x5389bd[_0x53a2('0x25')],'rows':_0x5389bd});});}};var _0xd7d5d8=jayson['server'](_0xf9b589)[_0x53a2('0x64')]();_0xd7d5d8['on'](_0x53a2('0x39'),function(_0x2cc02c){logger[_0x53a2('0x39')](JSON['stringify'](_0x2cc02c));return _0x411186(_0x2cc02c);});_0xd7d5d8[_0x53a2('0x65')](0x232c,_0x53a2('0x66'),function(){console['log'](_0x53a2('0x67'),0x232c);return _0x39be1b(_0x53a2('0x68')+0x232c);});});}; \ No newline at end of file +var _0xfa2f=['on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','info','No\x20applications\x20to\x20execute','agent','agents','busy','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','busyQueue','end','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','available','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','log','path','bluebird','uuid','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','channel','mail','push','slice','dialogflow','amazonlex','tag','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','body','%s:%s:%s','condition','intervals','./applications/','consequence','Push\x20new\x20rule'];(function(_0x53a354,_0x13cf4b){var _0x12b427=function(_0x3c78c0){while(--_0x3c78c0){_0x53a354['push'](_0x53a354['shift']());}};_0x12b427(++_0x13cf4b);}(_0xfa2f,0xe8));var _0xffa2=function(_0x295aa0,_0x9962f5){_0x295aa0=_0x295aa0-0x0;var _0x43ef3e=_0xfa2f[_0x295aa0];return _0x43ef3e;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0xffa2('0x0'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xffa2('0x1'));var uuid=require(_0xffa2('0x2'));var utils=require(_0xffa2('0x3'));var config=require('../../../config/environment');var logger=require(_0xffa2('0x4'))(_0xffa2('0x5'));var rpc={'openchannelQueueReport':require(_0xffa2('0x6')),'mailQueueReport':require(_0xffa2('0x7')),'chatQueueReport':require(_0xffa2('0x8')),'smsQueueReport':require(_0xffa2('0x9')),'faxQueueReport':require(_0xffa2('0xa')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x34cf1b,_0x20a710,_0x201cd9){return util[_0xffa2('0xb')](_0xffa2('0xc'),_0x34cf1b,_0x20a710||0x0,_0x201cd9||0x0);}function getIntervals(_0x238500,_0x1fa2eb){var _0x5cb9c8=[];if(!_[_0xffa2('0xd')](_0x1fa2eb['IntervalId'])&&!_['isNil'](_0x238500[_0x1fa2eb[_0xffa2('0xe')]])&&!_[_0xffa2('0xd')](_0x238500[_0x1fa2eb[_0xffa2('0xe')]][_0xffa2('0xf')])){_0x5cb9c8=_[_0xffa2('0x10')](_0x238500[_0x1fa2eb['IntervalId']][_0xffa2('0xf')],_0xffa2('0x11'));}else if(!_[_0xffa2('0xd')](_0x1fa2eb[_0xffa2('0x11')])){_0x5cb9c8=[_0x1fa2eb['interval']];}return _0x5cb9c8;}exports['listen']=function(_0x32e54e){_0x32e54e[_0xffa2('0x12')]={};return new BPromise(function(_0x3d5f7d,_0x570a23){var _0x2d6803={'Start':function(_0x31a57f){var _0x2c4035=this;return new Promise(function(_0x4019b3,_0x316c7e){if(_0x31a57f){try{var _0x3cc797=[];var _0x892043=getId(_0x31a57f['channel'],_0x31a57f[_0xffa2('0x13')]?_0x31a57f[_0xffa2('0x13')]['id']:0x0,_0x31a57f[_0xffa2('0x14')]?_0x31a57f[_0xffa2('0x14')]['id']:0x0);if(_0x31a57f[_0xffa2('0x15')]&&_[_0xffa2('0x16')](_0x31a57f[_0xffa2('0x15')])&&_0x31a57f[_0xffa2('0x15')][_0xffa2('0x17')]){for(var _0xc10cfb=0x0;_0xc10cfb<_0x31a57f[_0xffa2('0x15')][_0xffa2('0x17')];_0xc10cfb+=0x1){var _0x47b924=_0x31a57f[_0xffa2('0x15')][_0xc10cfb];if(fs[_0xffa2('0x18')](path[_0xffa2('0x19')](__dirname,'applications',_0x47b924[_0xffa2('0x1a')]+'.js'))){var _0x204a0f=[];switch(_0x47b924[_0xffa2('0x1a')][_0xffa2('0x1b')]()){case _0xffa2('0x1c'):var _0x1084d7=_0x47b924[_0xffa2('0x1d')][_0xffa2('0x1e')](',');if(_0x31a57f[_0xffa2('0x1f')]===_0xffa2('0x20')){_0x204a0f[_0xffa2('0x21')](_0x1084d7[0x0]);_0x204a0f['push'](_0x1084d7[0x1]);_0x204a0f[_0xffa2('0x21')](_0x1084d7[_0xffa2('0x22')](0x2,_0x1084d7['length'])[_0xffa2('0x19')](','));}else{_0x204a0f[_0xffa2('0x21')](_0x1084d7[0x0]);_0x204a0f[_0xffa2('0x21')](_0x1084d7[_0xffa2('0x22')](0x1,_0x1084d7[_0xffa2('0x17')])[_0xffa2('0x19')](','));}break;case _0xffa2('0x23'):var _0x361540=_0x47b924['appdata'][_0xffa2('0x1e')](',');_0x204a0f[_0xffa2('0x21')](_0x361540[0x0]);_0x204a0f[_0xffa2('0x21')](_0x361540[0x1]);_0x204a0f['push'](_0x361540[_0xffa2('0x22')](0x2,_0x361540[_0xffa2('0x17')])[_0xffa2('0x19')](','));break;case'dialogflowv2':var _0x335dcf=_0x47b924[_0xffa2('0x1d')][_0xffa2('0x1e')](',');_0x204a0f[_0xffa2('0x21')](_0x335dcf[0x0]);_0x204a0f[_0xffa2('0x21')](_0x335dcf[0x1]);_0x204a0f[_0xffa2('0x21')](_0x335dcf[0x2]);_0x204a0f[_0xffa2('0x21')](_0x335dcf[0x3]);_0x204a0f[_0xffa2('0x21')](_0x335dcf[_0xffa2('0x22')](0x4,_0x335dcf[_0xffa2('0x17')])[_0xffa2('0x19')](','));break;case _0xffa2('0x24'):var _0x208135=_0x47b924[_0xffa2('0x1d')][_0xffa2('0x1e')](',');_0x204a0f['push'](_0x208135[0x0]);_0x204a0f[_0xffa2('0x21')](_0x208135[0x1]);_0x204a0f[_0xffa2('0x21')](_0x208135[0x2]);_0x204a0f['push'](_0x208135[0x3]);_0x204a0f[_0xffa2('0x21')](_0x208135['slice'](0x4,_0x208135[_0xffa2('0x17')])['join'](','));break;case'message':_0x204a0f[_0xffa2('0x21')](_0x47b924['appdata']);break;case _0xffa2('0x25'):_0x204a0f['push'](_0x47b924[_0xffa2('0x26')]);_0x204a0f[_0xffa2('0x21')](_0x47b924[_0xffa2('0x1d')]);break;case _0xffa2('0x27'):var _0x4aa728=utils[_0xffa2('0x28')](_0x31a57f['account'][_0xffa2('0x29')],_0x31a57f);var _0x393875=_0x47b924[_0xffa2('0x1d')]['split'](',');_0x204a0f['push'](_0x393875[0x0]);_0x204a0f[_0xffa2('0x21')](_0x393875[0x1]);_0x204a0f[_0xffa2('0x21')](_0x393875[0x2]);_0x204a0f[_0xffa2('0x21')](_0x393875[0x3]);_0x204a0f['push'](_0x393875[0x4]);_0x204a0f[_0xffa2('0x21')](_0x393875[0x5]);_0x204a0f['push'](_0x393875[0x6]);_0x204a0f[_0xffa2('0x21')](_0x393875[0x7]);_0x204a0f[_0xffa2('0x21')](_0x393875[0x8]);_0x204a0f[_0xffa2('0x21')](_0x393875[0x9]);_0x204a0f[_0xffa2('0x21')](_0x393875[0xa]);_0x204a0f[_0xffa2('0x21')](_0x31a57f[_0xffa2('0x14')]['id']);_0x204a0f[_0xffa2('0x21')](_0x31a57f[_0xffa2('0x13')]['id']);_0x204a0f[_0xffa2('0x21')](_0x47b924[_0xffa2('0x2a')]);_0x204a0f[_0xffa2('0x21')](_0x31a57f[_0xffa2('0x14')]['ContactId']);_0x204a0f[_0xffa2('0x21')](_0x31a57f['body'][_0xffa2('0x2b')]);_0x204a0f[_0xffa2('0x21')](_0x4aa728);break;default:_0x204a0f=_[_0xffa2('0xd')](_0x47b924[_0xffa2('0x1d')])?[]:_0x47b924[_0xffa2('0x1d')]['split'](',');}var _0x2e2d0b={'id':util['format'](_0xffa2('0x2c'),_0x892043,_0x47b924['id'],_0x47b924['app']),'condition':require('./interval')[_0xffa2('0x2d')](_0x892043,getIntervals(_0x32e54e[_0xffa2('0x2e')],_0x47b924),_0x32e54e),'consequence':require(_0xffa2('0x2f')+_0x47b924[_0xffa2('0x1a')])[_0xffa2('0x30')](_0x892043,_0x204a0f,_0x32e54e,_0x31a57f),'p':_0x47b924['priority']||0x0};logger['info'](_0xffa2('0x31'),_0x2e2d0b['id'],_0xffa2('0x32'),getIntervals(_0x32e54e[_0xffa2('0x2e')],_0x47b924)[_0xffa2('0x19')]('\x20|\x20'));_0x3cc797[_0xffa2('0x21')](_0x2e2d0b);}else{logger[_0xffa2('0x33')](_0xffa2('0x34'),path['join'](__dirname,_0xffa2('0x15'),_0x47b924[_0xffa2('0x1a')]+'.js'));}}_0x32e54e[_0xffa2('0x12')][_0x892043]=new RuleEngine(_0x3cc797);_0x32e54e['rules'][_0x892043][_0xffa2('0x35')](_0x31a57f,function(_0x4a42f0){logger['info'](_0xffa2('0x36'),JSON[_0xffa2('0x37')](_0x4a42f0[_0xffa2('0x38')]));if(_0x32e54e[_0xffa2('0x12')][_0x892043]){_0x32e54e['rules'][_0x892043][_0xffa2('0x39')]('complete');}});return _0x4019b3({'code':0xc8,'message':_0x31a57f});}else{logger[_0xffa2('0x3a')](_0xffa2('0x3b'));return _0x4019b3({'code':0xc8,'message':_0x31a57f});}}catch(_0x3aa194){logger[_0xffa2('0x33')](_0x3aa194['stack']);return _0x316c7e(_0x2c4035[_0xffa2('0x33')](0x1f4,_0x3aa194));}}return _0x316c7e('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2f2fcf){var _0x4919cd=this;return new Promise(function(_0x208e94,_0x389c53){if(_0x2f2fcf[_0xffa2('0x3c')]&&_0x2f2fcf[_0xffa2('0x3c')]['id']){if(_0x32e54e[_0xffa2('0x3d')][_0x2f2fcf[_0xffa2('0x3c')]['id']]){_0x32e54e[_0xffa2('0x3d')][_0x2f2fcf[_0xffa2('0x3c')]['id']][_0xffa2('0x3e')]=![];_0x32e54e[_0xffa2('0x3d')][_0x2f2fcf[_0xffa2('0x3c')]['id']]['busyQueue']=undefined;}}if(_0x2f2fcf[_0xffa2('0x13')]&&_0x2f2fcf[_0xffa2('0x13')]['id']){try{var _0x44317b=getId(_0x2f2fcf[_0xffa2('0x1f')],_0x2f2fcf[_0xffa2('0x13')]?_0x2f2fcf[_0xffa2('0x13')]['id']:0x0,_0x2f2fcf[_0xffa2('0x14')]?_0x2f2fcf[_0xffa2('0x14')]['id']:0x0);if(_0x32e54e[_0xffa2('0x12')][_0x44317b]){_0x32e54e[_0xffa2('0x12')][_0x44317b][_0xffa2('0x39')]('end');if(rpc[_0x2f2fcf['channel']+_0xffa2('0x3f')]){rpc[_0x2f2fcf['channel']+'QueueReport'][_0xffa2('0x40')](_0x44317b,{'UserId':_0x2f2fcf['message'][_0xffa2('0x41')]})[_0xffa2('0x42')](function(_0xaf9515){logger['error'](_0xffa2('0x43'));});}}return _0x208e94({'code':0xc8,'message':_0x2f2fcf});}catch(_0x2ef9f5){logger[_0xffa2('0x33')](_0x2ef9f5[_0xffa2('0x44')]);return _0x389c53(_0x4919cd[_0xffa2('0x33')](0x1f4,_0x2ef9f5));}}logger['error'](_0xffa2('0x45'));return _0x389c53(_0x4919cd['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x43b636){var _0x18d3b0=this;return new Promise(function(_0x4cb1f3,_0x508f81){if(_0x43b636[_0xffa2('0x3c')]&&_0x43b636[_0xffa2('0x3c')]['id']){try{if(_0x32e54e[_0xffa2('0x3d')][_0x43b636[_0xffa2('0x3c')]['id']]){_0x32e54e['agents'][_0x43b636[_0xffa2('0x3c')]['id']]['busy']=![];_0x32e54e[_0xffa2('0x3d')][_0x43b636[_0xffa2('0x3c')]['id']][_0xffa2('0x46')]=undefined;}return _0x4cb1f3({'code':0xc8,'message':_0x43b636});}catch(_0x2dfbf7){logger[_0xffa2('0x33')](_0x2dfbf7[_0xffa2('0x44')]);return _0x508f81(_0x18d3b0[_0xffa2('0x33')](0x1f4,_0x2dfbf7));}}logger['error'](_0xffa2('0x45'));return _0x508f81(_0x18d3b0['error'](0x1f4,_0xffa2('0x45')));});},'AbandonInteraction':function(_0xfd6e2d){var _0xd2f63=this;return new Promise(function(_0x280e97,_0x1196b2){if(_0xfd6e2d[_0xffa2('0x1f')]&&_0xfd6e2d[_0xffa2('0x14')]&&_0xfd6e2d[_0xffa2('0x14')]['id']){try{var _0x1dab21=getId(_0xfd6e2d[_0xffa2('0x1f')],_0xfd6e2d[_0xffa2('0x13')]?_0xfd6e2d[_0xffa2('0x13')]['id']:0x0,_0xfd6e2d[_0xffa2('0x14')]?_0xfd6e2d[_0xffa2('0x14')]['id']:0x0);if(_0x32e54e[_0xffa2('0x12')][_0x1dab21]){_0x32e54e[_0xffa2('0x12')][_0x1dab21][_0xffa2('0x39')](_0xffa2('0x47'));}return _0x280e97({'code':0xc8,'message':_0xfd6e2d});}catch(_0x19a580){logger[_0xffa2('0x33')](_0x19a580[_0xffa2('0x44')]);return _0x1196b2(_0xd2f63[_0xffa2('0x33')](0x1f4,_0x19a580));}}logger[_0xffa2('0x33')](_0xffa2('0x45'));return _0x1196b2(_0xd2f63[_0xffa2('0x33')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x1cc54e){var _0x331af5=this;return new Promise(function(_0x44af61,_0x257a48){if(_0x32e54e[_0xffa2('0x3d')][_0xffa2('0x48')](_0x1cc54e['id'])){for(var _0x9bcde0 in _0x1cc54e[_0xffa2('0x49')]){if(_0x1cc54e[_0xffa2('0x49')]['hasOwnProperty'](_0x9bcde0)){if(_0x32e54e[_0xffa2('0x3d')][_0x1cc54e['id']]['hasOwnProperty'](_0x9bcde0+_0xffa2('0x4a'))){_0x32e54e['agents'][_0x1cc54e['id']][_0x9bcde0+_0xffa2('0x4a')]=parseInt(_0x1cc54e[_0xffa2('0x49')][_0x9bcde0],0xa);}}}_0x32e54e['agents'][_0x1cc54e['id']]['updateRealtime']();return _0x44af61({'code':0xc8,'message':_0x32e54e[_0xffa2('0x3d')][_0x1cc54e['id']]});}else{return _0x257a48(_0x331af5[_0xffa2('0x33')](0x1f4,_0xffa2('0x4b')));}});},'Agents':function(_0x41a541){return new Promise(function(_0xc82d4a,_0x3bd611){var _0x34f4d4=_[_0xffa2('0x4c')](_0x32e54e[_0xffa2('0x3d')]);_0xc82d4a({'count':_0x34f4d4[_0xffa2('0x17')],'rows':_0x34f4d4});});},'ChatQueues':function(_0x581952){return new Promise(function(_0x3e2ac5,_0x1a7ddc){var _0x316137=[];for(var _0x26c98a in _0x32e54e['chatQueues']){if(_0x32e54e[_0xffa2('0x4d')]['hasOwnProperty'](_0x26c98a)){var _0x1c15d7=_0x32e54e[_0xffa2('0x4d')][_0x26c98a];var _0x34177d={'id':_0x1c15d7['id'],'available':_0x1c15d7['available'],'loggedIn':_0x1c15d7[_0xffa2('0x4e')],'name':_0x1c15d7[_0xffa2('0x4f')],'paused':_0x1c15d7['paused'],'waiting':_0x1c15d7[_0xffa2('0x50')]};_0x316137[_0xffa2('0x21')](_0x34177d);}}_0x3e2ac5({'count':_0x316137[_0xffa2('0x17')],'rows':_0x316137});});},'MailQueues':function(_0x2e2173){return new Promise(function(_0x51d407,_0xead92d){var _0x3e8093=[];for(var _0x2bb3bb in _0x32e54e[_0xffa2('0x51')]){if(_0x32e54e[_0xffa2('0x51')][_0xffa2('0x48')](_0x2bb3bb)){var _0x58878a=_0x32e54e[_0xffa2('0x51')][_0x2bb3bb];var _0x1088ca={'id':_0x58878a['id'],'available':_0x58878a['available'],'loggedIn':_0x58878a[_0xffa2('0x4e')],'name':_0x58878a['name'],'paused':_0x58878a[_0xffa2('0x52')],'waiting':_0x58878a[_0xffa2('0x50')]};_0x3e8093[_0xffa2('0x21')](_0x1088ca);}}_0x51d407({'count':_0x3e8093['length'],'rows':_0x3e8093});});},'OpenchannelQueues':function(_0x37c87b){return new Promise(function(_0x301349,_0x365748){var _0x72e1b=[];for(var _0x6ad40 in _0x32e54e[_0xffa2('0x53')]){if(_0x32e54e[_0xffa2('0x53')][_0xffa2('0x48')](_0x6ad40)){var _0x28742d=_0x32e54e['openchannelQueues'][_0x6ad40];var _0x4782da={'id':_0x28742d['id'],'available':_0x28742d[_0xffa2('0x54')],'loggedIn':_0x28742d[_0xffa2('0x4e')],'name':_0x28742d[_0xffa2('0x4f')],'paused':_0x28742d[_0xffa2('0x52')],'waiting':_0x28742d[_0xffa2('0x50')]};_0x72e1b[_0xffa2('0x21')](_0x4782da);}}_0x301349({'count':_0x72e1b[_0xffa2('0x17')],'rows':_0x72e1b});});},'SmsQueues':function(_0x1943fe){return new Promise(function(_0x4c7a82,_0x594e99){var _0x4cf954=[];for(var _0x2c6324 in _0x32e54e['smsQueues']){if(_0x32e54e['smsQueues'][_0xffa2('0x48')](_0x2c6324)){var _0x55e12c=_0x32e54e['smsQueues'][_0x2c6324];var _0x30f4cb={'id':_0x55e12c['id'],'available':_0x55e12c[_0xffa2('0x54')],'loggedIn':_0x55e12c[_0xffa2('0x4e')],'name':_0x55e12c[_0xffa2('0x4f')],'paused':_0x55e12c[_0xffa2('0x52')],'waiting':_0x55e12c['waiting']};_0x4cf954['push'](_0x30f4cb);}}_0x4c7a82({'count':_0x4cf954[_0xffa2('0x17')],'rows':_0x4cf954});});},'FaxQueues':function(_0x24b07c){return new Promise(function(_0x123123,_0x735f4c){var _0x3235a0=[];for(var _0x155c15 in _0x32e54e['faxQueues']){if(_0x32e54e[_0xffa2('0x55')]['hasOwnProperty'](_0x155c15)){var _0x4add1f=_0x32e54e['faxQueues'][_0x155c15];var _0x583ad7={'id':_0x4add1f['id'],'available':_0x4add1f['available'],'loggedIn':_0x4add1f[_0xffa2('0x4e')],'name':_0x4add1f[_0xffa2('0x4f')],'paused':_0x4add1f['paused'],'waiting':_0x4add1f[_0xffa2('0x50')]};_0x3235a0['push'](_0x583ad7);}}_0x123123({'count':_0x3235a0['length'],'rows':_0x3235a0});});},'WhatsappQueues':function(_0x268ef9){return new Promise(function(_0x1b5b8d,_0x4a6f84){var _0x4a6b8c=[];for(var _0x2b50d0 in _0x32e54e[_0xffa2('0x56')]){if(_0x32e54e[_0xffa2('0x56')][_0xffa2('0x48')](_0x2b50d0)){var _0x3229bd=_0x32e54e[_0xffa2('0x56')][_0x2b50d0];var _0x54d325={'id':_0x3229bd['id'],'available':_0x3229bd[_0xffa2('0x54')],'loggedIn':_0x3229bd[_0xffa2('0x4e')],'name':_0x3229bd[_0xffa2('0x4f')],'paused':_0x3229bd['paused'],'waiting':_0x3229bd[_0xffa2('0x50')]};_0x4a6b8c[_0xffa2('0x21')](_0x54d325);}}_0x1b5b8d({'count':_0x4a6b8c[_0xffa2('0x17')],'rows':_0x4a6b8c});});},'ChatQueuesWaitingInteractions':function(_0x99a4b5){return new Promise(function(_0x2d6727,_0x48523b){var _0x4a8e2a=_[_0xffa2('0x4c')](_0x32e54e['chatQueuesWaitingInteractions']);_0x2d6727({'count':_0x4a8e2a[_0xffa2('0x17')],'rows':_0x4a8e2a});});},'MailQueuesWaitingInteractions':function(_0x246e27){return new Promise(function(_0x455eec,_0x7602d2){var _0x26b8aa=_[_0xffa2('0x4c')](_0x32e54e[_0xffa2('0x57')]);_0x455eec({'count':_0x26b8aa[_0xffa2('0x17')],'rows':_0x26b8aa});});},'OpenchannelQueuesWaitingInteractions':function(_0x3f63d9){return new Promise(function(_0x1bbf41,_0x31bf03){var _0x3fb872=_[_0xffa2('0x4c')](_0x32e54e['openchannelQueuesWaitingInteractions']);_0x1bbf41({'count':_0x3fb872['length'],'rows':_0x3fb872});});},'SmsQueuesWaitingInteractions':function(_0x35cf52){return new Promise(function(_0x5e7bf9,_0x2d309d){var _0x43a078=_[_0xffa2('0x4c')](_0x32e54e['smsQueuesWaitingInteractions']);_0x5e7bf9({'count':_0x43a078['length'],'rows':_0x43a078});});},'FaxQueuesWaitingInteractions':function(_0x57c212){return new Promise(function(_0x45c8be,_0x561313){var _0x256559=_[_0xffa2('0x4c')](_0x32e54e[_0xffa2('0x58')]);_0x45c8be({'count':_0x256559[_0xffa2('0x17')],'rows':_0x256559});});},'WhatsappQueuesWaitingInteractions':function(_0x6bcfae){return new Promise(function(_0x2fbd0f,_0xe98694){var _0x57d190=_[_0xffa2('0x4c')](_0x32e54e[_0xffa2('0x59')]);_0x2fbd0f({'count':_0x57d190[_0xffa2('0x17')],'rows':_0x57d190});});}};var _0x59312a=jayson[_0xffa2('0x5a')](_0x2d6803)[_0xffa2('0x5b')]();_0x59312a['on']('error',function(_0x53a3f1){logger['error'](JSON[_0xffa2('0x37')](_0x53a3f1));return _0x570a23(_0x53a3f1);});_0x59312a[_0xffa2('0x5c')](0x232c,'127.0.0.1',function(){console[_0xffa2('0x5d')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x3d5f7d('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index d871212..6f50fa8 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 _0x803b=['lodash','../../../config/logger','routing','request','then','error','catch','condition','rules','stop','push','Command','format','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','stack'];(function(_0x24f41e,_0xd46989){var _0x1b6211=function(_0x1b6cb4){while(--_0x1b6cb4){_0x24f41e['push'](_0x24f41e['shift']());}};_0x1b6211(++_0xd46989);}(_0x803b,0xb6));var _0xb803=function(_0x4d6ea0,_0x4b52a5){_0x4d6ea0=_0x4d6ea0-0x0;var _0x1d1c0c=_0x803b[_0x4d6ea0];return _0x1d1c0c;};'use strict';var util=require('util');var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require(_0xb803('0x0'));var logger=require(_0xb803('0x1'))(_0xb803('0x2'));var client=jayson['client']['http']({'port':0x232a});function request(_0x12d399,_0x4b6dae){return new BPromise(function(_0x2b9818,_0x5558b9){return client[_0xb803('0x3')](_0x12d399,_0x4b6dae)[_0xb803('0x4')](function(_0x128866){if(_0x128866[_0xb803('0x5')]){return _0x5558b9(_0x128866[_0xb803('0x5')]['message']);}else{return _0x2b9818(_0x128866['result']);}})[_0xb803('0x6')](function(_0x2e76e6){return _0x5558b9(_0x2e76e6);});});}exports[_0xb803('0x7')]=function(_0x4291ed,_0x4596b3,_0x476dd6){return function(_0x4971c4){if(_0x476dd6['rules']&&!_0x476dd6[_0xb803('0x8')][_0x4291ed]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x4291ed);return _0x4971c4[_0xb803('0x9')]();}var _0x53d2d3=[];for(var _0x336280=0x0;_0x336280<_0x4596b3['length'];_0x336280+=0x1){_0x53d2d3[_0xb803('0xa')](request(_0xb803('0xb'),{'command':util[_0xb803('0xc')](_0xb803('0xd'),_0x4596b3[_0x336280])})[_0xb803('0x4')](function(_0x112767){return _0x112767&&_0x112767[_0xb803('0xe')]&&_0x112767[_0xb803('0xe')][_0xb803('0xf')](_0xb803('0x10'))>=0x0?!![]:![];})['catch'](function(_0xdc6325){logger[_0xb803('0x5')](_0xb803('0x11'),_0x4291ed,_0x4596b3[_0x336280]);}));}BPromise[_0xb803('0x12')](_0x53d2d3)[_0xb803('0x4')](function(_0x2dfc70){var _0x3db257=_[_0xb803('0x13')](_0x2dfc70);logger[_0xb803('0x14')](_0xb803('0x15'),_0x4291ed,_0x4596b3[_0xb803('0x16')](_0xb803('0x17')),_0x3db257);_0x4971c4['when'](_0x3db257);})[_0xb803('0x6')](function(_0xa949b1){console[_0xb803('0x18')](_0xa949b1);logger[_0xb803('0x5')](_0xb803('0x15'),_0x4291ed,_0x4596b3['join'](_0xb803('0x17')),_0xa949b1[_0xb803('0x19')]);_0x4971c4['stop']();});};}; \ No newline at end of file +var _0x5803=['when','stack','util','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','true','error','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20'];(function(_0x4a93bb,_0x495404){var _0x208468=function(_0x1d82b7){while(--_0x1d82b7){_0x4a93bb['push'](_0x4a93bb['shift']());}};_0x208468(++_0x495404);}(_0x5803,0xc2));var _0x3580=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x5803[_0x178e48];return _0x440d7e;};'use strict';var util=require(_0x3580('0x0'));var BPromise=require('bluebird');var jayson=require(_0x3580('0x1'));var _=require(_0x3580('0x2'));var logger=require(_0x3580('0x3'))(_0x3580('0x4'));var client=jayson[_0x3580('0x5')][_0x3580('0x6')]({'port':0x232a});function request(_0x1bfc01,_0x3fb2d2){return new BPromise(function(_0x52f11c,_0x2a59fc){return client[_0x3580('0x7')](_0x1bfc01,_0x3fb2d2)[_0x3580('0x8')](function(_0x124134){if(_0x124134['error']){return _0x2a59fc(_0x124134['error'][_0x3580('0x9')]);}else{return _0x52f11c(_0x124134[_0x3580('0xa')]);}})[_0x3580('0xb')](function(_0x2e5eb7){return _0x2a59fc(_0x2e5eb7);});});}exports[_0x3580('0xc')]=function(_0x172b75,_0x2b298b,_0x365c9d){return function(_0x367310){if(_0x365c9d[_0x3580('0xd')]&&!_0x365c9d[_0x3580('0xd')][_0x172b75]){logger[_0x3580('0xe')](_0x3580('0xf'),_0x172b75);return _0x367310[_0x3580('0x10')]();}var _0x1aecda=[];for(var _0x5d92dc=0x0;_0x5d92dc<_0x2b298b[_0x3580('0x11')];_0x5d92dc+=0x1){_0x1aecda[_0x3580('0x12')](request(_0x3580('0x13'),{'command':util[_0x3580('0x14')](_0x3580('0x15'),_0x2b298b[_0x5d92dc])})[_0x3580('0x8')](function(_0x1ba56c){return _0x1ba56c&&_0x1ba56c[_0x3580('0x9')]&&_0x1ba56c[_0x3580('0x9')]['indexOf'](_0x3580('0x16'))>=0x0?!![]:![];})[_0x3580('0xb')](function(_0x4ab4c4){logger[_0x3580('0x17')](_0x3580('0x18'),_0x172b75,_0x2b298b[_0x5d92dc]);}));}BPromise[_0x3580('0x19')](_0x1aecda)[_0x3580('0x8')](function(_0x58eec9){var _0x247071=_[_0x3580('0x1a')](_0x58eec9);logger[_0x3580('0xe')](_0x3580('0x1b'),_0x172b75,_0x2b298b[_0x3580('0x1c')](_0x3580('0x1d')),_0x247071);_0x367310[_0x3580('0x1e')](_0x247071);})[_0x3580('0xb')](function(_0x4eec1c){console['log'](_0x4eec1c);logger[_0x3580('0x17')](_0x3580('0x1b'),_0x172b75,_0x2b298b[_0x3580('0x1c')]('\x20|\x20'),_0x4eec1c[_0x3580('0x1f')]);_0x367310[_0x3580('0x10')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index ed2ef00..828dfc7 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 _0x5c00=['queuecallerabandon','forIn','includes','agentringnoanswer','now','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswerAt','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','blind','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','transfertype','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','connectedlinenum','queue','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','lastevent','called','connectedlinename','info','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','talktime','push'];(function(_0xa6a23e,_0x8b657a){var _0x210e65=function(_0x58b4b8){while(--_0x58b4b8){_0xa6a23e['push'](_0xa6a23e['shift']());}};_0x210e65(++_0x8b657a);}(_0x5c00,0x17e));var _0x05c0=function(_0x8e4e90,_0x6d7185){_0x8e4e90=_0x8e4e90-0x0;var _0x1d9d2b=_0x5c00[_0x8e4e90];return _0x1d9d2b;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var utils=require(_0x05c0('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4e54ec,_0x1e76da){utils['info'](util[_0x05c0('0x3')](_0x05c0('0x4'),_0x4e54ec[_0x05c0('0x5')],_0x4e54ec[_0x05c0('0x6')],_0x4e54ec['queue'],_0x4e54ec[_0x05c0('0x7')],_0x4e54ec[_0x05c0('0x8')],_0x4e54ec[_0x05c0('0x9')],_0x4e54ec[_0x05c0('0xa')],_0x4e54ec['lastevent']));if(_0x4e54ec[_0x05c0('0xb')]){utils[_0x05c0('0xc')](_0x4e54ec[_0x05c0('0xb')])['then'](function(_0x32a795){if(_0x32a795){_0x4e54ec[_0x05c0('0xd')]=_0x32a795[_0x05c0('0xd')];_0x4e54ec[_0x05c0('0xe')]=_0x4e54ec[_0x05c0('0xf')]?_0x32a795[_0x05c0('0x10')]:![];_0x4e54ec['acwtime']=_0x4e54ec['agentacw']?_0x32a795[_0x05c0('0x11')]:0x0;}utils['request'](_0x05c0('0x12'),_0x4e54ec);});}else{utils[_0x05c0('0x13')](_0x05c0('0x12'),_0x4e54ec);}if(_0x1e76da){delete transfers[_0x4e54ec['uniqueid']];}else{delete agents[_0x4e54ec[_0x05c0('0x14')]];}}exports['agentcalled']=function(_0x16a290){try{utils[_0x05c0('0x15')](util[_0x05c0('0x3')](_0x05c0('0x16'),_0x16a290[_0x05c0('0x5')]),_0x16a290);agents[_0x16a290[_0x05c0('0x14')]]=_0x16a290;agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x17')]=utils['now']();agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x18')]=_0x05c0('0x19');agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0xa')]=null;agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x1a')]=null;utils[_0x05c0('0x1b')](util[_0x05c0('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x16a290[_0x05c0('0x5')],agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x7')],_0x16a290['destuniqueid']));}catch(_0x40d905){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')](_0x05c0('0x16'),_0x16a290[_0x05c0('0x5')]),_0x40d905);}};exports['agentringnoanswer']=function(_0x407c1f){try{if(!_[_0x05c0('0x1d')](agents[_0x407c1f['destuniqueid']])){utils['debug'](util['format'](_0x05c0('0x1e'),_0x407c1f[_0x05c0('0x5')]),_0x407c1f);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x1f'),_0x407c1f[_0x05c0('0x5')],agents[_0x407c1f[_0x05c0('0x14')]]['membername'],_0x407c1f[_0x05c0('0x14')]));agents[_0x407c1f[_0x05c0('0x14')]]['agentringnoanswer']=!![];agents[_0x407c1f['destuniqueid']]['agentringnoanswerAt']=utils['now']();agents[_0x407c1f['destuniqueid']][_0x05c0('0x18')]=_0x05c0('0x20');agents[_0x407c1f['destuniqueid']][_0x05c0('0x21')]=_0x05c0('0x20');agents[_0x407c1f[_0x05c0('0x14')]][_0x05c0('0x22')]=_0x407c1f['ringtime']?parseInt(_0x407c1f[_0x05c0('0x23')])/0x3e8:0x0;agents[_0x407c1f[_0x05c0('0x14')]][_0x05c0('0x24')]=0x0;unanswered[_0x05c0('0x25')](_0x407c1f[_0x05c0('0x14')]);}}catch(_0x5d12e0){utils['error'](util['format'](_0x05c0('0x1e'),_0x407c1f[_0x05c0('0x5')]),_0x5d12e0);}};exports[_0x05c0('0x26')]=function(_0xd6574e){try{_[_0x05c0('0x27')](agents,function(_0x1e00c5,_0x1c4c8f){if(_0x1e00c5[_0x05c0('0x5')]==_0xd6574e[_0x05c0('0x5')]&&!_[_0x05c0('0x28')](unanswered,_0x1e00c5[_0x05c0('0x14')])){utils[_0x05c0('0x15')](util['format']('[%s][agents][queuecallerabandon]',_0xd6574e[_0x05c0('0x5')]),_0xd6574e);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0xd6574e[_0x05c0('0x5')],_0x1e00c5[_0x05c0('0x7')],_0x1e00c5['destuniqueid']));_0x1e00c5[_0x05c0('0x29')]=!![];_0x1e00c5['agentringnoanswerAt']=utils[_0x05c0('0x2a')]();_0x1e00c5[_0x05c0('0x18')]=_0x05c0('0x2b');_0x1e00c5[_0x05c0('0x21')]=_0x05c0('0x2b');_0x1e00c5[_0x05c0('0x22')]=_0xd6574e[_0x05c0('0x22')];_0x1e00c5[_0x05c0('0x24')]=0x0;writeDB(_0x1e00c5);}});}catch(_0x3d8d76){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')](_0x05c0('0x2c'),_0xd6574e[_0x05c0('0x5')]),_0x3d8d76);}};exports[_0x05c0('0x2d')]=function(_0x185d05){try{if(agents[_0x185d05[_0x05c0('0x14')]]){utils[_0x05c0('0x15')](util[_0x05c0('0x3')](_0x05c0('0x2e'),_0x185d05[_0x05c0('0x5')]),_0x185d05);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x2f'),_0x185d05[_0x05c0('0x5')],agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0x7')],_0x185d05[_0x05c0('0x14')]));agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0x30')]=utils[_0x05c0('0x2a')]();agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0xa')]=_0x185d05[_0x05c0('0xa')];agents[_0x185d05['destuniqueid']][_0x05c0('0x1a')]=_0x185d05[_0x05c0('0x1a')];agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0x22')]=_0x185d05['ringtime'];agents[_0x185d05['destuniqueid']][_0x05c0('0x18')]=_0x05c0('0x31');_[_0x05c0('0x27')](agents,function(_0x4ced8e,_0x29dc87){if(_0x4ced8e[_0x05c0('0x14')]!=_0x185d05[_0x05c0('0x14')]&&_0x4ced8e[_0x05c0('0x5')]==_0x185d05['uniqueid']){_0x4ced8e[_0x05c0('0x24')]=0x0;_0x4ced8e[_0x05c0('0x22')]=_0x185d05['ringtime'];_0x4ced8e[_0x05c0('0x29')]=!![];_0x4ced8e[_0x05c0('0x32')]=utils[_0x05c0('0x2a')]();_0x4ced8e[_0x05c0('0x18')]=_0x05c0('0x33');_0x4ced8e[_0x05c0('0x21')]=_0x05c0('0x33');_0x4ced8e['answeredelsewheredestinationuniqueid']=_0x185d05['destuniqueid'];_0x4ced8e[_0x05c0('0x34')]=_0x185d05[_0x05c0('0x7')];writeDB(_0x4ced8e);}});}}catch(_0xaa5d53){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')]('[%s][agents][agentconnect]',_0x185d05[_0x05c0('0x5')]),_0xaa5d53);}};exports[_0x05c0('0xf')]=function(_0x2fdfe8){try{if(!_[_0x05c0('0x1d')](agents[_0x2fdfe8[_0x05c0('0x14')]])){utils[_0x05c0('0x15')](util[_0x05c0('0x3')]('[%s][agents][agentcomplete]',_0x2fdfe8[_0x05c0('0x5')]),_0x2fdfe8);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x35'),_0x2fdfe8[_0x05c0('0x5')],agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x7')],_0x2fdfe8[_0x05c0('0x14')]));agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0xf')]=!![];agents[_0x2fdfe8[_0x05c0('0x14')]]['agentcompleteAt']=utils['now']();agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x24')]=utils[_0x05c0('0x36')](agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x37')],agents[_0x2fdfe8[_0x05c0('0x14')]]['agentconnectAt']);agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x21')]=_0x2fdfe8[_0x05c0('0x21')];agents[_0x2fdfe8[_0x05c0('0x14')]]['lastevent']=_0x05c0('0x38');writeDB(agents[_0x2fdfe8[_0x05c0('0x14')]]);}}catch(_0x3ec0bf){utils[_0x05c0('0x1c')](util['format'](_0x05c0('0x39'),_0x2fdfe8[_0x05c0('0x5')]),_0x3ec0bf);}};exports[_0x05c0('0x3a')]=function(_0x9b521b){try{if(!_['isNil'](agents[_0x9b521b[_0x05c0('0x3b')]])){utils[_0x05c0('0x15')](util['format'](_0x05c0('0x3c'),_0x9b521b['uniqueid']),_0x9b521b);utils['info'](util[_0x05c0('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x9b521b[_0x05c0('0x5')],agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x7')],agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x5')]));agents[_0x9b521b[_0x05c0('0x3b')]]['transfer']=!![];agents[_0x9b521b[_0x05c0('0x3b')]]['transfertype']=_0x05c0('0x3d');agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x3e')]=_0x9b521b[_0x05c0('0x3f')];agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x40')]=agents[_0x9b521b[_0x05c0('0x3b')]]['uniqueid'];}}catch(_0x5215b4){utils['error'](util[_0x05c0('0x3')](_0x05c0('0x3c'),_0x9b521b['uniqueid']),_0x5215b4);}};exports['attendedtransfer']=function(_0xbfb9cb){try{utils[_0x05c0('0x15')](util[_0x05c0('0x3')](_0x05c0('0x41'),_0xbfb9cb[_0x05c0('0x42')]),_0xbfb9cb);if(_0xbfb9cb[_0x05c0('0x42')]==_0xbfb9cb[_0x05c0('0x43')]){if(!_['isNil'](agents[_0xbfb9cb[_0x05c0('0x44')]])){utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x45'),_0xbfb9cb['origtransfereruniqueid'],agents[_0xbfb9cb[_0x05c0('0x44')]]['membername']));agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x46')]=!![];agents[_0xbfb9cb['secondtransfereruniqueid']][_0x05c0('0x47')]='ATTENDED';agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x3e')]=_0xbfb9cb[_0x05c0('0x48')];agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x40')]=_0xbfb9cb[_0x05c0('0x42')];}if(_0xbfb9cb['transfereeuniqueid']&&agents[_0xbfb9cb[_0x05c0('0x49')]]){agents[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x4a')]=0x1;transfers[_0xbfb9cb[_0x05c0('0x49')]]=_[_0x05c0('0x4b')](agents[_0xbfb9cb[_0x05c0('0x49')]]);transfers[_0xbfb9cb['transfereeuniqueid']][_0x05c0('0x9')]=agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x9')];transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x4c')]=agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x4c')];transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x17')]=utils[_0x05c0('0x2a')]();transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x30')]=utils['now']();transfers[_0xbfb9cb['transfereeuniqueid']]['holdtime']=0x0;transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x4a')]=0x2;}}else if(_0xbfb9cb[_0x05c0('0x44')]==_0xbfb9cb['secondtransfererlinkedid']){if(!_[_0x05c0('0x1d')](agents[_0xbfb9cb[_0x05c0('0x42')]])){utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x45'),_0xbfb9cb[_0x05c0('0x42')],agents[_0xbfb9cb[_0x05c0('0x42')]]['membername']));agents[_0xbfb9cb[_0x05c0('0x42')]][_0x05c0('0x46')]=!![];agents[_0xbfb9cb[_0x05c0('0x42')]][_0x05c0('0x47')]='ATTENDED';agents[_0xbfb9cb['origtransfereruniqueid']]['transferexten']=_0xbfb9cb[_0x05c0('0x4d')];agents[_0xbfb9cb[_0x05c0('0x42')]][_0x05c0('0x40')]=_0xbfb9cb[_0x05c0('0x44')];}if(_0xbfb9cb[_0x05c0('0x4e')]&&agents[_0xbfb9cb[_0x05c0('0x4e')]]){agents[_0xbfb9cb[_0x05c0('0x4e')]]['agententerreason']=0x1;transfers[_0xbfb9cb[_0x05c0('0x4e')]]=_[_0x05c0('0x4b')](agents[_0xbfb9cb[_0x05c0('0x4e')]]);transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x9')]=agents[_0xbfb9cb['origtransfereruniqueid']]['calleridnum'];transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x4c')]=agents[_0xbfb9cb['origtransfereruniqueid']][_0x05c0('0x4c')];transfers[_0xbfb9cb['transfertargetuniqueid']]['agentcalledAt']=utils[_0x05c0('0x2a')]();transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x30')]=utils['now']();transfers[_0xbfb9cb['transfertargetuniqueid']][_0x05c0('0x22')]=0x0;transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x4a')]=0x2;}}}catch(_0x5b39cb){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0xbfb9cb['origtransfereruniqueid']),_0x5b39cb);}};exports[_0x05c0('0x4f')]=function(_0x4f43ae){try{utils['debug'](util['format'](_0x05c0('0x50'),_0x4f43ae[_0x05c0('0x5')]),_0x4f43ae);if(agents[_0x4f43ae[_0x05c0('0x5')]]&&agents[_0x4f43ae['uniqueid']][_0x05c0('0x21')]===_0x05c0('0x20')){if(_0x4f43ae['cause']==='21'){agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x21')]=_0x05c0('0x51');agents[_0x4f43ae[_0x05c0('0x5')]]['lastevent']=_0x05c0('0x51');}utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x52'),_0x4f43ae[_0x05c0('0x5')],agents[_0x4f43ae['uniqueid']]['membername'],agents[_0x4f43ae[_0x05c0('0x5')]]['reason'],agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]));writeDB(agents[_0x4f43ae['uniqueid']]);var _0x3135bd=unanswered['indexOf'](_0x4f43ae['uniqueid']);if(_0x3135bd>-0x1){unanswered['splice'](_0x3135bd,0x1);}}if(transfers[_0x4f43ae['uniqueid']]){transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0xf')]=!![];transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x37')]=utils['now']();transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x24')]=utils[_0x05c0('0x36')](transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x37')],transfers[_0x4f43ae['uniqueid']][_0x05c0('0x30')]);transfers[_0x4f43ae['uniqueid']]['reason']=_0x05c0('0x53');transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]=_0x05c0('0x38');utils[_0x05c0('0x1b')](util[_0x05c0('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4f43ae['uniqueid'],transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x7')],transfers[_0x4f43ae[_0x05c0('0x5')]]['reason'],transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]));writeDB(transfers[_0x4f43ae[_0x05c0('0x5')]],!![]);}if(agents[_0x4f43ae[_0x05c0('0x5')]]&&agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x30')]){agents[_0x4f43ae['uniqueid']][_0x05c0('0xf')]=!![];agents[_0x4f43ae[_0x05c0('0x5')]]['agentcompleteAt']=utils[_0x05c0('0x2a')]();agents[_0x4f43ae[_0x05c0('0x5')]]['talktime']=utils[_0x05c0('0x36')](agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x37')],agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x30')]);agents[_0x4f43ae[_0x05c0('0x5')]]['reason']=agents[_0x4f43ae[_0x05c0('0x5')]]['transfer']?_0x05c0('0x46'):_0x05c0('0x53');agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]=_0x05c0('0x38');utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x52'),_0x4f43ae[_0x05c0('0x5')],agents[_0x4f43ae[_0x05c0('0x5')]]['membername'],agents[_0x4f43ae[_0x05c0('0x5')]]['reason'],agents[_0x4f43ae[_0x05c0('0x5')]]['lastevent']));writeDB(agents[_0x4f43ae[_0x05c0('0x5')]]);}}catch(_0x36f82a){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')](_0x05c0('0x50'),_0x4f43ae[_0x05c0('0x5')]),_0x36f82a);}}; \ No newline at end of file +var _0x58a4=['clone','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','now','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','debug','[%s][agents][agentringnoanswer]','agentringnoanswer','agentringnoanswerAt','timeout','reason','holdtime','ringtime','queuecallerabandon','forIn','includes','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','talktime','answered_elsewhere','answeredelsewheredestinationuniqueid','isNil','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','blind','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','transfer','transfertype','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','calleridnum','calleridname','agententerreason','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid'];(function(_0x304c7b,_0xa9dca2){var _0x498eec=function(_0x454b28){while(--_0x454b28){_0x304c7b['push'](_0x304c7b['shift']());}};_0x498eec(++_0xa9dca2);}(_0x58a4,0xbf));var _0x458a=function(_0x1fdf47,_0x1da0d0){_0x1fdf47=_0x1fdf47-0x0;var _0x2f42d3=_0x58a4[_0x1fdf47];return _0x2f42d3;};'use strict';var _=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var utils=require(_0x458a('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1e23ea,_0xd2a36e){utils[_0x458a('0x3')](util[_0x458a('0x4')](_0x458a('0x5'),_0x1e23ea[_0x458a('0x6')],_0x1e23ea[_0x458a('0x7')],_0x1e23ea[_0x458a('0x8')],_0x1e23ea[_0x458a('0x9')],_0x1e23ea[_0x458a('0xa')],_0x1e23ea['calleridnum'],_0x1e23ea['connectedlinenum'],_0x1e23ea[_0x458a('0xb')]));if(_0x1e23ea[_0x458a('0x8')]){utils[_0x458a('0xc')](_0x1e23ea[_0x458a('0x8')])[_0x458a('0xd')](function(_0x55bf10){if(_0x55bf10){_0x1e23ea['type']=_0x55bf10[_0x458a('0xe')];_0x1e23ea[_0x458a('0xf')]=_0x1e23ea[_0x458a('0x10')]?_0x55bf10[_0x458a('0x11')]:![];_0x1e23ea[_0x458a('0x12')]=_0x1e23ea['agentacw']?_0x55bf10[_0x458a('0x13')]:0x0;}utils[_0x458a('0x14')]('CreateVoiceAgentReport',_0x1e23ea);});}else{utils[_0x458a('0x14')](_0x458a('0x15'),_0x1e23ea);}if(_0xd2a36e){delete transfers[_0x1e23ea[_0x458a('0x6')]];}else{delete agents[_0x1e23ea[_0x458a('0x16')]];}}exports[_0x458a('0x17')]=function(_0x5bd09e){try{utils['debug'](util[_0x458a('0x4')]('[%s][agents][agentcalled]',_0x5bd09e[_0x458a('0x6')]),_0x5bd09e);agents[_0x5bd09e[_0x458a('0x16')]]=_0x5bd09e;agents[_0x5bd09e[_0x458a('0x16')]][_0x458a('0x18')]=utils[_0x458a('0x19')]();agents[_0x5bd09e[_0x458a('0x16')]]['lastevent']='called';agents[_0x5bd09e['destuniqueid']][_0x458a('0x1a')]=null;agents[_0x5bd09e[_0x458a('0x16')]][_0x458a('0x1b')]=null;utils['info'](util[_0x458a('0x4')](_0x458a('0x1c'),_0x5bd09e[_0x458a('0x6')],agents[_0x5bd09e[_0x458a('0x16')]][_0x458a('0x9')],_0x5bd09e['destuniqueid']));}catch(_0x4f57e3){utils[_0x458a('0x1d')](util['format'](_0x458a('0x1e'),_0x5bd09e[_0x458a('0x6')]),_0x4f57e3);}};exports['agentringnoanswer']=function(_0x468416){try{if(!_['isNil'](agents[_0x468416[_0x458a('0x16')]])){utils[_0x458a('0x1f')](util['format'](_0x458a('0x20'),_0x468416[_0x458a('0x6')]),_0x468416);utils['info'](util[_0x458a('0x4')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x468416[_0x458a('0x6')],agents[_0x468416['destuniqueid']][_0x458a('0x9')],_0x468416['destuniqueid']));agents[_0x468416[_0x458a('0x16')]][_0x458a('0x21')]=!![];agents[_0x468416[_0x458a('0x16')]][_0x458a('0x22')]=utils[_0x458a('0x19')]();agents[_0x468416[_0x458a('0x16')]][_0x458a('0xb')]=_0x458a('0x23');agents[_0x468416[_0x458a('0x16')]][_0x458a('0x24')]=_0x458a('0x23');agents[_0x468416[_0x458a('0x16')]][_0x458a('0x25')]=_0x468416['ringtime']?parseInt(_0x468416[_0x458a('0x26')])/0x3e8:0x0;agents[_0x468416[_0x458a('0x16')]]['talktime']=0x0;unanswered['push'](_0x468416[_0x458a('0x16')]);}}catch(_0x596fe2){utils[_0x458a('0x1d')](util[_0x458a('0x4')](_0x458a('0x20'),_0x468416['uniqueid']),_0x596fe2);}};exports[_0x458a('0x27')]=function(_0x2531f7){try{_[_0x458a('0x28')](agents,function(_0x562c36,_0x47e20d){if(_0x562c36[_0x458a('0x6')]==_0x2531f7['uniqueid']&&!_[_0x458a('0x29')](unanswered,_0x562c36['destuniqueid'])){utils[_0x458a('0x1f')](util[_0x458a('0x4')]('[%s][agents][queuecallerabandon]',_0x2531f7[_0x458a('0x6')]),_0x2531f7);utils[_0x458a('0x3')](util[_0x458a('0x4')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x2531f7[_0x458a('0x6')],_0x562c36[_0x458a('0x9')],_0x562c36[_0x458a('0x16')]));_0x562c36[_0x458a('0x21')]=!![];_0x562c36[_0x458a('0x22')]=utils['now']();_0x562c36[_0x458a('0xb')]=_0x458a('0x2a');_0x562c36[_0x458a('0x24')]=_0x458a('0x2a');_0x562c36[_0x458a('0x25')]=_0x2531f7[_0x458a('0x25')];_0x562c36['talktime']=0x0;writeDB(_0x562c36);}});}catch(_0x2a6b9c){utils[_0x458a('0x1d')](util[_0x458a('0x4')](_0x458a('0x2b'),_0x2531f7[_0x458a('0x6')]),_0x2a6b9c);}};exports[_0x458a('0x2c')]=function(_0x262ad0){try{if(agents[_0x262ad0[_0x458a('0x16')]]){utils[_0x458a('0x1f')](util['format'](_0x458a('0x2d'),_0x262ad0[_0x458a('0x6')]),_0x262ad0);utils[_0x458a('0x3')](util[_0x458a('0x4')](_0x458a('0x2e'),_0x262ad0[_0x458a('0x6')],agents[_0x262ad0[_0x458a('0x16')]][_0x458a('0x9')],_0x262ad0[_0x458a('0x16')]));agents[_0x262ad0[_0x458a('0x16')]][_0x458a('0x2f')]=utils[_0x458a('0x19')]();agents[_0x262ad0[_0x458a('0x16')]][_0x458a('0x1a')]=_0x262ad0[_0x458a('0x1a')];agents[_0x262ad0['destuniqueid']][_0x458a('0x1b')]=_0x262ad0[_0x458a('0x1b')];agents[_0x262ad0[_0x458a('0x16')]][_0x458a('0x25')]=_0x262ad0[_0x458a('0x26')];agents[_0x262ad0[_0x458a('0x16')]][_0x458a('0xb')]=_0x458a('0x30');_[_0x458a('0x28')](agents,function(_0x44c5ba,_0x20cf10){if(_0x44c5ba['destuniqueid']!=_0x262ad0[_0x458a('0x16')]&&_0x44c5ba[_0x458a('0x6')]==_0x262ad0['uniqueid']){_0x44c5ba[_0x458a('0x31')]=0x0;_0x44c5ba[_0x458a('0x25')]=_0x262ad0[_0x458a('0x26')];_0x44c5ba['agentringnoanswer']=!![];_0x44c5ba[_0x458a('0x22')]=utils[_0x458a('0x19')]();_0x44c5ba[_0x458a('0xb')]=_0x458a('0x32');_0x44c5ba[_0x458a('0x24')]=_0x458a('0x32');_0x44c5ba[_0x458a('0x33')]=_0x262ad0[_0x458a('0x16')];_0x44c5ba['answeredelsewheremembername']=_0x262ad0[_0x458a('0x9')];writeDB(_0x44c5ba);}});}}catch(_0x145e3c){utils[_0x458a('0x1d')](util['format'](_0x458a('0x2d'),_0x262ad0[_0x458a('0x6')]),_0x145e3c);}};exports['agentcomplete']=function(_0x598707){try{if(!_[_0x458a('0x34')](agents[_0x598707[_0x458a('0x16')]])){utils[_0x458a('0x1f')](util[_0x458a('0x4')]('[%s][agents][agentcomplete]',_0x598707['uniqueid']),_0x598707);utils[_0x458a('0x3')](util[_0x458a('0x4')](_0x458a('0x35'),_0x598707[_0x458a('0x6')],agents[_0x598707['destuniqueid']][_0x458a('0x9')],_0x598707[_0x458a('0x16')]));agents[_0x598707['destuniqueid']][_0x458a('0x10')]=!![];agents[_0x598707['destuniqueid']][_0x458a('0x36')]=utils[_0x458a('0x19')]();agents[_0x598707[_0x458a('0x16')]]['talktime']=utils[_0x458a('0x37')](agents[_0x598707[_0x458a('0x16')]][_0x458a('0x36')],agents[_0x598707['destuniqueid']]['agentconnectAt']);agents[_0x598707[_0x458a('0x16')]][_0x458a('0x24')]=_0x598707[_0x458a('0x24')];agents[_0x598707['destuniqueid']]['lastevent']=_0x458a('0x38');writeDB(agents[_0x598707[_0x458a('0x16')]]);}}catch(_0x25bee8){utils[_0x458a('0x1d')](util[_0x458a('0x4')](_0x458a('0x39'),_0x598707[_0x458a('0x6')]),_0x25bee8);}};exports[_0x458a('0x3a')]=function(_0xb22232){try{if(!_[_0x458a('0x34')](agents[_0xb22232[_0x458a('0x3b')]])){utils[_0x458a('0x1f')](util[_0x458a('0x4')](_0x458a('0x3c'),_0xb22232[_0x458a('0x6')]),_0xb22232);utils[_0x458a('0x3')](util['format'](_0x458a('0x3d'),_0xb22232[_0x458a('0x6')],agents[_0xb22232[_0x458a('0x3b')]][_0x458a('0x9')],agents[_0xb22232[_0x458a('0x3b')]]['uniqueid']));agents[_0xb22232['transfereruniqueid']]['transfer']=!![];agents[_0xb22232[_0x458a('0x3b')]]['transfertype']=_0x458a('0x3e');agents[_0xb22232[_0x458a('0x3b')]][_0x458a('0x3f')]=_0xb22232[_0x458a('0x40')];agents[_0xb22232[_0x458a('0x3b')]]['transferuniqueid']=agents[_0xb22232['transfereruniqueid']][_0x458a('0x6')];}}catch(_0x2d8b77){utils[_0x458a('0x1d')](util[_0x458a('0x4')](_0x458a('0x3c'),_0xb22232['uniqueid']),_0x2d8b77);}};exports[_0x458a('0x41')]=function(_0x4eed01){try{utils[_0x458a('0x1f')](util['format'](_0x458a('0x42'),_0x4eed01['origtransfereruniqueid']),_0x4eed01);if(_0x4eed01['origtransfereruniqueid']==_0x4eed01['origtransfererlinkedid']){if(!_[_0x458a('0x34')](agents[_0x4eed01[_0x458a('0x43')]])){utils['info'](util[_0x458a('0x4')](_0x458a('0x44'),_0x4eed01[_0x458a('0x45')],agents[_0x4eed01['secondtransfereruniqueid']][_0x458a('0x9')]));agents[_0x4eed01[_0x458a('0x43')]][_0x458a('0x46')]=!![];agents[_0x4eed01[_0x458a('0x43')]][_0x458a('0x47')]=_0x458a('0x48');agents[_0x4eed01['secondtransfereruniqueid']][_0x458a('0x3f')]=_0x4eed01[_0x458a('0x49')];agents[_0x4eed01[_0x458a('0x43')]][_0x458a('0x4a')]=_0x4eed01[_0x458a('0x45')];}if(_0x4eed01[_0x458a('0x4b')]&&agents[_0x4eed01[_0x458a('0x4b')]]){agents[_0x4eed01[_0x458a('0x4b')]]['agententerreason']=0x1;transfers[_0x4eed01[_0x458a('0x4b')]]=_['clone'](agents[_0x4eed01[_0x458a('0x4b')]]);transfers[_0x4eed01[_0x458a('0x4b')]][_0x458a('0x4c')]=agents[_0x4eed01[_0x458a('0x43')]]['calleridnum'];transfers[_0x4eed01['transfereeuniqueid']][_0x458a('0x4d')]=agents[_0x4eed01[_0x458a('0x43')]][_0x458a('0x4d')];transfers[_0x4eed01[_0x458a('0x4b')]][_0x458a('0x18')]=utils[_0x458a('0x19')]();transfers[_0x4eed01['transfereeuniqueid']][_0x458a('0x2f')]=utils[_0x458a('0x19')]();transfers[_0x4eed01['transfereeuniqueid']][_0x458a('0x25')]=0x0;transfers[_0x4eed01['transfereeuniqueid']][_0x458a('0x4e')]=0x2;}}else if(_0x4eed01[_0x458a('0x43')]==_0x4eed01[_0x458a('0x4f')]){if(!_[_0x458a('0x34')](agents[_0x4eed01[_0x458a('0x45')]])){utils[_0x458a('0x3')](util[_0x458a('0x4')](_0x458a('0x44'),_0x4eed01['origtransfereruniqueid'],agents[_0x4eed01[_0x458a('0x45')]][_0x458a('0x9')]));agents[_0x4eed01['origtransfereruniqueid']][_0x458a('0x46')]=!![];agents[_0x4eed01[_0x458a('0x45')]]['transfertype']=_0x458a('0x48');agents[_0x4eed01[_0x458a('0x45')]]['transferexten']=_0x4eed01[_0x458a('0x50')];agents[_0x4eed01[_0x458a('0x45')]]['transferuniqueid']=_0x4eed01[_0x458a('0x43')];}if(_0x4eed01[_0x458a('0x51')]&&agents[_0x4eed01[_0x458a('0x51')]]){agents[_0x4eed01[_0x458a('0x51')]][_0x458a('0x4e')]=0x1;transfers[_0x4eed01[_0x458a('0x51')]]=_[_0x458a('0x52')](agents[_0x4eed01[_0x458a('0x51')]]);transfers[_0x4eed01['transfertargetuniqueid']][_0x458a('0x4c')]=agents[_0x4eed01[_0x458a('0x45')]][_0x458a('0x4c')];transfers[_0x4eed01[_0x458a('0x51')]][_0x458a('0x4d')]=agents[_0x4eed01[_0x458a('0x45')]][_0x458a('0x4d')];transfers[_0x4eed01[_0x458a('0x51')]][_0x458a('0x18')]=utils[_0x458a('0x19')]();transfers[_0x4eed01['transfertargetuniqueid']][_0x458a('0x2f')]=utils['now']();transfers[_0x4eed01[_0x458a('0x51')]][_0x458a('0x25')]=0x0;transfers[_0x4eed01[_0x458a('0x51')]][_0x458a('0x4e')]=0x2;}}}catch(_0xfb99c8){utils[_0x458a('0x1d')](util[_0x458a('0x4')](_0x458a('0x42'),_0x4eed01[_0x458a('0x45')]),_0xfb99c8);}};exports[_0x458a('0x53')]=function(_0x31074e){try{utils[_0x458a('0x1f')](util[_0x458a('0x4')](_0x458a('0x54'),_0x31074e[_0x458a('0x6')]),_0x31074e);if(agents[_0x31074e[_0x458a('0x6')]]&&agents[_0x31074e['uniqueid']][_0x458a('0x24')]==='timeout'){if(_0x31074e[_0x458a('0x55')]==='21'){agents[_0x31074e[_0x458a('0x6')]]['reason']=_0x458a('0x56');agents[_0x31074e[_0x458a('0x6')]][_0x458a('0xb')]='rejected';}utils[_0x458a('0x3')](util[_0x458a('0x4')](_0x458a('0x57'),_0x31074e[_0x458a('0x6')],agents[_0x31074e[_0x458a('0x6')]][_0x458a('0x9')],agents[_0x31074e['uniqueid']][_0x458a('0x24')],agents[_0x31074e['uniqueid']]['lastevent']));writeDB(agents[_0x31074e[_0x458a('0x6')]]);var _0x36ba6e=unanswered[_0x458a('0x58')](_0x31074e[_0x458a('0x6')]);if(_0x36ba6e>-0x1){unanswered[_0x458a('0x59')](_0x36ba6e,0x1);}}if(transfers[_0x31074e[_0x458a('0x6')]]){transfers[_0x31074e[_0x458a('0x6')]][_0x458a('0x10')]=!![];transfers[_0x31074e[_0x458a('0x6')]][_0x458a('0x36')]=utils[_0x458a('0x19')]();transfers[_0x31074e[_0x458a('0x6')]][_0x458a('0x31')]=utils[_0x458a('0x37')](transfers[_0x31074e['uniqueid']]['agentcompleteAt'],transfers[_0x31074e['uniqueid']][_0x458a('0x2f')]);transfers[_0x31074e['uniqueid']][_0x458a('0x24')]=_0x458a('0x5a');transfers[_0x31074e[_0x458a('0x6')]][_0x458a('0xb')]=_0x458a('0x38');utils[_0x458a('0x3')](util[_0x458a('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x31074e[_0x458a('0x6')],transfers[_0x31074e[_0x458a('0x6')]]['membername'],transfers[_0x31074e[_0x458a('0x6')]]['reason'],transfers[_0x31074e[_0x458a('0x6')]]['lastevent']));writeDB(transfers[_0x31074e[_0x458a('0x6')]],!![]);}if(agents[_0x31074e[_0x458a('0x6')]]&&agents[_0x31074e[_0x458a('0x6')]][_0x458a('0x2f')]){agents[_0x31074e['uniqueid']][_0x458a('0x10')]=!![];agents[_0x31074e[_0x458a('0x6')]][_0x458a('0x36')]=utils[_0x458a('0x19')]();agents[_0x31074e[_0x458a('0x6')]][_0x458a('0x31')]=utils[_0x458a('0x37')](agents[_0x31074e[_0x458a('0x6')]]['agentcompleteAt'],agents[_0x31074e[_0x458a('0x6')]][_0x458a('0x2f')]);agents[_0x31074e[_0x458a('0x6')]][_0x458a('0x24')]=agents[_0x31074e['uniqueid']][_0x458a('0x46')]?_0x458a('0x46'):'agent';agents[_0x31074e[_0x458a('0x6')]][_0x458a('0xb')]=_0x458a('0x38');utils[_0x458a('0x3')](util[_0x458a('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x31074e[_0x458a('0x6')],agents[_0x31074e[_0x458a('0x6')]][_0x458a('0x9')],agents[_0x31074e[_0x458a('0x6')]][_0x458a('0x24')],agents[_0x31074e[_0x458a('0x6')]][_0x458a('0xb')]));writeDB(agents[_0x31074e['uniqueid']]);}}catch(_0x1f9925){utils['error'](util[_0x458a('0x4')](_0x458a('0x54'),_0x31074e[_0x458a('0x6')]),_0x1f9925);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index a4df456..e990f44 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 _0xb58d=['BUSY','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','blinds','recording','debug','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','error','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','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','xmd-queue','xmcs-queue','lastapplication','lastdata','[%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','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','lodash','util','./utils','FAILED','NO\x20ANSWER','ANSWERED'];(function(_0x38ec25,_0x13728f){var _0x4d3243=function(_0x4fbfc2){while(--_0x4fbfc2){_0x38ec25['push'](_0x38ec25['shift']());}};_0x4d3243(++_0x13728f);}(_0xb58d,0x141));var _0xdb58=function(_0xe6d5ab,_0x1eb12a){_0xe6d5ab=_0xe6d5ab-0x0;var _0x236170=_0xb58d[_0xe6d5ab];return _0x236170;};'use strict';var _=require(_0xdb58('0x0'));var util=require(_0xdb58('0x1'));var utils=require(_0xdb58('0x2'));var transfers=require('./transfers.controller');var dispositions=['NO\x20ANSWER',_0xdb58('0x3'),'FAILED',_0xdb58('0x4'),'NO\x20ANSWER',_0xdb58('0x4'),_0xdb58('0x5'),_0xdb58('0x6'),_0xdb58('0x3'),'FAILED',_0xdb58('0x3')];var channels={};function writeDB(_0x540c0a){var _0x52a8f0;if(transfers['blinds'][_0x540c0a['uniqueid']]){_0x52a8f0=_0x540c0a[_0xdb58('0x7')];_0x540c0a[_0xdb58('0x7')]=transfers['blinds'][_0x540c0a[_0xdb58('0x7')]][_0xdb58('0x8')];}utils[_0xdb58('0x9')](util[_0xdb58('0xa')](_0xdb58('0xb'),_0x540c0a[_0xdb58('0x7')],_0x540c0a[_0xdb58('0xc')],_0x540c0a[_0xdb58('0xd')],_0x540c0a[_0xdb58('0xe')],_0x540c0a['interface'],_0x540c0a[_0xdb58('0xf')],_0x540c0a[_0xdb58('0x10')],_0x540c0a[_0xdb58('0x11')]));if(_0x540c0a[_0xdb58('0x12')]){utils[_0xdb58('0x13')](_0x540c0a[_0xdb58('0x12')])[_0xdb58('0x14')](function(_0x42ef06){if(_0x42ef06){_0x540c0a[_0xdb58('0x15')]=_0x42ef06['id'];}utils['request'](_0xdb58('0x16'),_0x540c0a);});}else{utils[_0xdb58('0x17')]('CreateVoiceCallReport',_0x540c0a);}if(channels[_0x540c0a['uniqueid']]){delete channels[_0x540c0a[_0xdb58('0x7')]];}else if(_0x52a8f0&&channels[_0x52a8f0]){if(!transfers[_0xdb58('0x18')][_0x52a8f0][_0xdb58('0x19')])delete transfers[_0xdb58('0x18')][_0x52a8f0];delete channels[_0x52a8f0];}}exports['newchannel']=function(_0x3bc697){try{utils[_0xdb58('0x1a')](util['format'](_0xdb58('0x1b'),_0x3bc697[_0xdb58('0x7')]),_0x3bc697);if(_0x3bc697[_0xdb58('0x7')]==_0x3bc697[_0xdb58('0x1c')]&&_0x3bc697[_0xdb58('0xc')]!='OutgoingSpoolFailed'){utils['info'](util[_0xdb58('0xa')](_0xdb58('0x1d'),_0x3bc697['uniqueid'],_0x3bc697[_0xdb58('0x1e')],_0x3bc697[_0xdb58('0x1f')]));channels[_0x3bc697[_0xdb58('0x7')]]={'uniqueid':_0x3bc697['uniqueid'],'accountcode':_0x3bc697[_0xdb58('0x12')],'source':_0x3bc697[_0xdb58('0xf')],'destination':_0x3bc697['exten'],'destinationcontext':_0x3bc697[_0xdb58('0x1e')],'channel':_0x3bc697[_0xdb58('0xc')],'starttime':utils[_0xdb58('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xdb58('0x4'),'amaflags':_0xdb58('0x21')};}}catch(_0x1707c4){utils['error'](util['format']('[%s][calls][newchannel]',_0x3bc697[_0xdb58('0x7')]),_0x1707c4);}};exports[_0xdb58('0x22')]=function(_0xe5be08){try{utils['debug'](util['format'](_0xdb58('0x23'),_0xe5be08['uniqueid']),_0xe5be08);if(!_[_0xdb58('0x24')](channels[_0xe5be08['uniqueid']])&&_0xe5be08[_0xdb58('0x25')]==0x6){utils['info'](util[_0xdb58('0xa')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0xe5be08[_0xdb58('0x7')],_0xe5be08['context'],_0xe5be08['channel']));if(_[_0xdb58('0x24')](channels[_0xe5be08[_0xdb58('0x7')]][_0xdb58('0x26')])){channels[_0xe5be08[_0xdb58('0x7')]][_0xdb58('0x26')]=utils['now']();}}else if(!_[_0xdb58('0x24')](channels[_0xe5be08[_0xdb58('0x1c')]])&&_0xe5be08[_0xdb58('0x25')]==0x6&&_0xe5be08[_0xdb58('0x1e')]!=_0xdb58('0x27')){utils[_0xdb58('0x9')](util['format'](_0xdb58('0x28'),_0xe5be08['uniqueid'],_0xe5be08['linkedid'],_0xe5be08['context'],_0xe5be08[_0xdb58('0xc')]));channels[_0xe5be08['linkedid']][_0xdb58('0x12')]=_0xe5be08['accountcode'];channels[_0xe5be08['linkedid']][_0xdb58('0x29')]=_0xe5be08[_0xdb58('0xc')];if(_[_0xdb58('0x24')](channels[_0xe5be08[_0xdb58('0x1c')]][_0xdb58('0x2a')])){channels[_0xe5be08[_0xdb58('0x1c')]]['answertime']=utils[_0xdb58('0x20')]();}channels[_0xe5be08[_0xdb58('0x1c')]][_0xdb58('0x2b')]=dispositions[_['toNumber'](_0xe5be08[_0xdb58('0x25')])]||'ANSWERED';}}catch(_0x1c3246){utils[_0xdb58('0x2c')](util[_0xdb58('0xa')](_0xdb58('0x23'),_0xe5be08[_0xdb58('0x7')]),_0x1c3246);}};exports[_0xdb58('0x2d')]=function(_0x3ab7cc){try{if(!_['isNil'](channels[_0x3ab7cc[_0xdb58('0x7')]])){utils[_0xdb58('0x1a')](util[_0xdb58('0xa')](_0xdb58('0x2e'),_0x3ab7cc['uniqueid']),_0x3ab7cc);if(_[_0xdb58('0x24')](channels[_0x3ab7cc[_0xdb58('0x7')]][_0xdb58('0x2f')])){channels[_0x3ab7cc[_0xdb58('0x7')]]['callerid']=_0x3ab7cc[_0xdb58('0x30')]+'\x20<'+_0x3ab7cc[_0xdb58('0xf')]+'>';}utils['info'](util[_0xdb58('0xa')](_0xdb58('0x31'),_0x3ab7cc[_0xdb58('0x7')],channels[_0x3ab7cc[_0xdb58('0x7')]][_0xdb58('0x2f')],_0x3ab7cc[_0xdb58('0x32')]));channels[_0x3ab7cc['uniqueid']][_0xdb58('0x33')]=utils[_0xdb58('0x20')]();channels[_0x3ab7cc[_0xdb58('0x7')]]['duration']=utils[_0xdb58('0x34')](channels[_0x3ab7cc[_0xdb58('0x7')]][_0xdb58('0x33')],channels[_0x3ab7cc[_0xdb58('0x7')]][_0xdb58('0x35')]);channels[_0x3ab7cc[_0xdb58('0x7')]][_0xdb58('0x36')]=channels[_0x3ab7cc[_0xdb58('0x7')]]['answertime']?utils[_0xdb58('0x34')](channels[_0x3ab7cc[_0xdb58('0x7')]][_0xdb58('0x33')],channels[_0x3ab7cc[_0xdb58('0x7')]][_0xdb58('0x2a')]):0x0;writeDB(channels[_0x3ab7cc['uniqueid']]);}}catch(_0x1b7b0f){utils[_0xdb58('0x2c')](util[_0xdb58('0xa')]('[%s][calls][hangup]',_0x3ab7cc['uniqueid']),_0x1b7b0f);}};exports[_0xdb58('0x37')]=function(_0x18d18c){try{if(!_[_0xdb58('0x24')](channels[_0x18d18c[_0xdb58('0x38')]])){utils[_0xdb58('0x1a')](util['format'](_0xdb58('0x39'),_0x18d18c[_0xdb58('0x3a')]),_0x18d18c);if(channels[_0x18d18c['localtwolinkedid']][_0xdb58('0xc')]==_0x18d18c[_0xdb58('0x3b')]){utils['info'](util['format'](_0xdb58('0x3c'),_0x18d18c[_0xdb58('0x3a')],_0x18d18c['localtwolinkedid'],_0x18d18c[_0xdb58('0x3d')]));channels[_0x18d18c[_0xdb58('0x38')]]['destinationchannel']=_0x18d18c['secondtransfererchannel'];channels[_0x18d18c[_0xdb58('0x38')]][_0xdb58('0x3e')]=_0xdb58('0x3f');}else if(channels[_0x18d18c['localtwolinkedid']]['channel']=_0x18d18c[_0xdb58('0x40')]){utils[_0xdb58('0x9')](util[_0xdb58('0xa')](_0xdb58('0x3c'),_0x18d18c[_0xdb58('0x3a')],_0x18d18c['localtwolinkedid'],_0x18d18c[_0xdb58('0x41')]));channels[_0x18d18c[_0xdb58('0x38')]][_0xdb58('0x29')]=_0x18d18c[_0xdb58('0x41')];channels[_0x18d18c[_0xdb58('0x38')]][_0xdb58('0x3e')]=_0xdb58('0x3f');}}}catch(_0x2443a4){utils[_0xdb58('0x2c')](util[_0xdb58('0xa')](_0xdb58('0x39'),_0x18d18c[_0xdb58('0x3a')]),_0x2443a4);}};exports['musiconholdstart']=function(_0x125259){try{if(!_[_0xdb58('0x24')](channels[_0x125259['uniqueid']])){utils['debug'](util[_0xdb58('0xa')](_0xdb58('0x42'),_0x125259[_0xdb58('0x7')]),_0x125259);channels[_0x125259[_0xdb58('0x7')]][_0xdb58('0x43')]=utils['now']();utils[_0xdb58('0x9')](util[_0xdb58('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x125259[_0xdb58('0x7')],channels[_0x125259[_0xdb58('0x7')]][_0xdb58('0x43')]));}}catch(_0x14664b){utils[_0xdb58('0x2c')](util['format']('[%s][calls][musiconholdstart]',_0x125259[_0xdb58('0x7')]),_0x14664b);}};exports[_0xdb58('0x44')]=function(_0x52d67b){try{if(!_[_0xdb58('0x24')](channels[_0x52d67b[_0xdb58('0x7')]])){utils[_0xdb58('0x1a')](util['format'](_0xdb58('0x45'),_0x52d67b[_0xdb58('0x7')]),_0x52d67b);if(!_[_0xdb58('0x24')](channels[_0x52d67b['uniqueid']]['musiconholdstartAt'])){channels[_0x52d67b[_0xdb58('0x7')]]['mohtime']+=utils['diffTime'](utils['now'](),channels[_0x52d67b['uniqueid']][_0xdb58('0x43')]);utils['info'](util['format'](_0xdb58('0x46'),_0x52d67b[_0xdb58('0x7')],channels[_0x52d67b[_0xdb58('0x7')]][_0xdb58('0x47')]));delete channels[_0x52d67b[_0xdb58('0x7')]][_0xdb58('0x43')];}}}catch(_0x46b78c){utils[_0xdb58('0x2c')](util[_0xdb58('0xa')]('[%s][calls][musiconholdstop]',_0x52d67b[_0xdb58('0x7')]),_0x46b78c);}};exports[_0xdb58('0x48')]=function(_0x4e0e00){try{if(!_[_0xdb58('0x24')](channels[_0x4e0e00[_0xdb58('0x7')]])){utils[_0xdb58('0x1a')](util[_0xdb58('0xa')](_0xdb58('0x49'),_0x4e0e00[_0xdb58('0x7')]),_0x4e0e00);if(!_[_0xdb58('0x24')](_0x4e0e00[_0xdb58('0x4a')][_0xdb58('0x4b')])){utils[_0xdb58('0x9')](util[_0xdb58('0xa')](_0xdb58('0x4c'),_0x4e0e00['uniqueid'],_0x4e0e00[_0xdb58('0x4d')]));channels[_0x4e0e00[_0xdb58('0x7')]][_0xdb58('0x4e')]=_0x4e0e00[_0xdb58('0x4d')];}if(!_['isNil'](_0x4e0e00[_0xdb58('0x4a')][_0xdb58('0x4f')])){utils[_0xdb58('0x9')](util[_0xdb58('0xa')](_0xdb58('0x50'),_0x4e0e00['uniqueid'],_0x4e0e00['value']));channels[_0x4e0e00[_0xdb58('0x7')]][_0xdb58('0x51')]=_0x4e0e00[_0xdb58('0x4d')];channels[_0x4e0e00['uniqueid']][_0xdb58('0x2f')]='\x22'+_0x4e0e00[_0xdb58('0x4d')]+_0xdb58('0x52')+_0x4e0e00[_0xdb58('0x4d')]+'>';}if(!_[_0xdb58('0x24')](_0x4e0e00[_0xdb58('0x4a')]['xmd-callerid-preview'])||!_[_0xdb58('0x24')](_0x4e0e00[_0xdb58('0x4a')]['xmd-callerid'])){utils['info'](util[_0xdb58('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4e0e00[_0xdb58('0x7')],!_[_0xdb58('0x24')](_0x4e0e00[_0xdb58('0x4a')]['xmd-callerid-preview'])?'xmd-callerid-preview':_0xdb58('0x53'),_0x4e0e00['value']));channels[_0x4e0e00['uniqueid']]['callerid']=_0x4e0e00[_0xdb58('0x4d')];}if(!_[_0xdb58('0x24')](_0x4e0e00[_0xdb58('0x4a')]['xmd-queue'])||!_[_0xdb58('0x24')](_0x4e0e00[_0xdb58('0x4a')]['xmcs-queue'])){utils['info'](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4e0e00[_0xdb58('0x7')],!_[_0xdb58('0x24')](_0x4e0e00['variable'][_0xdb58('0x54')])?_0xdb58('0x54'):_0xdb58('0x55'),_0x4e0e00[_0xdb58('0x4d')]));channels[_0x4e0e00[_0xdb58('0x7')]][_0xdb58('0x56')]='Queue';channels[_0x4e0e00['uniqueid']][_0xdb58('0x57')]=_0x4e0e00[_0xdb58('0x4d')];channels[_0x4e0e00[_0xdb58('0x7')]][_0xdb58('0xd')]=!![];}if(!_[_0xdb58('0x24')](_0x4e0e00[_0xdb58('0x4a')]['xmd-contactid'])){utils[_0xdb58('0x9')](util['format'](_0xdb58('0x58'),_0x4e0e00[_0xdb58('0x7')],_0x4e0e00[_0xdb58('0x4d')]));channels[_0x4e0e00['uniqueid']][_0xdb58('0x59')]=_0x4e0e00[_0xdb58('0x4d')];}if(!_[_0xdb58('0x24')](_0x4e0e00[_0xdb58('0x4a')][_0xdb58('0x5a')])){utils[_0xdb58('0x9')](util['format'](_0xdb58('0x5b'),_0x4e0e00[_0xdb58('0x7')],_0x4e0e00[_0xdb58('0x4d')]));channels[_0x4e0e00[_0xdb58('0x7')]][_0xdb58('0x5c')]=_0x4e0e00[_0xdb58('0x4d')];}if(!_[_0xdb58('0x24')](_0x4e0e00[_0xdb58('0x4a')]['outboundrouteid'])){utils[_0xdb58('0x9')](util[_0xdb58('0xa')](_0xdb58('0x5d'),_0x4e0e00[_0xdb58('0x7')],_0x4e0e00[_0xdb58('0x4d')]));channels[_0x4e0e00['uniqueid']]['routeid']=_0x4e0e00[_0xdb58('0x4d')];}if(!_[_0xdb58('0x24')](_0x4e0e00[_0xdb58('0x4a')][_0xdb58('0x5e')])){utils['info'](util['format'](_0xdb58('0x5f'),_0x4e0e00['uniqueid'],_0x4e0e00[_0xdb58('0x4d')]));channels[_0x4e0e00[_0xdb58('0x7')]][_0xdb58('0x5e')]=_0x4e0e00[_0xdb58('0x4d')];}}}catch(_0x9fa3ce){utils[_0xdb58('0x2c')](util[_0xdb58('0xa')](_0xdb58('0x49'),_0x4e0e00[_0xdb58('0x7')]),_0x9fa3ce);}};exports['newexten']=function(_0x38e135){try{if(!_[_0xdb58('0x24')](channels[_0x38e135['uniqueid']])){utils[_0xdb58('0x1a')](util[_0xdb58('0xa')](_0xdb58('0x60'),_0x38e135[_0xdb58('0x7')]),_0x38e135);utils[_0xdb58('0x9')](util[_0xdb58('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x38e135[_0xdb58('0x7')],_0x38e135[_0xdb58('0x61')],_0x38e135[_0xdb58('0x62')]));if(_0x38e135[_0xdb58('0x61')][_0xdb58('0x63')]()==_0xdb58('0x64')&&_[_0xdb58('0x65')](_0x38e135[_0xdb58('0x62')][_0xdb58('0x63')](),_0xdb58('0x66'))){var _0x41bca3=_0x38e135[_0xdb58('0x62')][_0xdb58('0x67')]('=');var _0x13eecc=_0x41bca3[0x0][_0xdb58('0x68')](_0x41bca3[0x0][_0xdb58('0x69')]('(')+0x1,_0x41bca3[0x0][_0xdb58('0x69')](')'));var _0x4c9012=_0x41bca3[0x1];channels[_0x38e135[_0xdb58('0x7')]][_0x13eecc]=_0x4c9012;}if(!_[_0xdb58('0x6a')](['hangup',_0xdb58('0x6b'),_0xdb58('0x6c'),'set','gotoif'],_0x38e135[_0xdb58('0x61')][_0xdb58('0x63')]())){channels[_0x38e135[_0xdb58('0x7')]][_0xdb58('0x56')]=_0x38e135['application'];channels[_0x38e135[_0xdb58('0x7')]][_0xdb58('0x57')]=_0x38e135['appdata'];}}}catch(_0x3a2abf){utils['error'](util['format']('[%s][calls][newexten]',_0x38e135[_0xdb58('0x7')]),_0x3a2abf);}}; \ No newline at end of file +var _0xba0d=['[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','toLowerCase','lastIndexOf','includes','noop','gotoif','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','format','linkedid','OutgoingSpoolFailed','context','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','destinationchannel','answertime','channelstate','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][musiconholdstop]','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','variable','xmd-phone'];(function(_0x1800cb,_0xba50f9){var _0x3b5e95=function(_0x556308){while(--_0x556308){_0x1800cb['push'](_0x1800cb['shift']());}};_0x3b5e95(++_0xba50f9);}(_0xba0d,0x8e));var _0xdba0=function(_0x5d0e38,_0x1b004e){_0x5d0e38=_0x5d0e38-0x0;var _0x304512=_0xba0d[_0x5d0e38];return _0x304512;};'use strict';var _=require(_0xdba0('0x0'));var util=require('util');var utils=require(_0xdba0('0x1'));var transfers=require(_0xdba0('0x2'));var dispositions=[_0xdba0('0x3'),'FAILED',_0xdba0('0x4'),'NO\x20ANSWER',_0xdba0('0x3'),_0xdba0('0x3'),_0xdba0('0x5'),_0xdba0('0x6'),'FAILED','FAILED',_0xdba0('0x4')];var channels={};function writeDB(_0x3ab016){var _0x423097;if(transfers[_0xdba0('0x7')][_0x3ab016['uniqueid']]){_0x423097=_0x3ab016[_0xdba0('0x8')];_0x3ab016['uniqueid']=transfers['blinds'][_0x3ab016[_0xdba0('0x8')]]['transfereeuniqueid'];}utils[_0xdba0('0x9')](util['format'](_0xdba0('0xa'),_0x3ab016[_0xdba0('0x8')],_0x3ab016[_0xdba0('0xb')],_0x3ab016[_0xdba0('0xc')],_0x3ab016[_0xdba0('0xd')],_0x3ab016[_0xdba0('0xe')],_0x3ab016[_0xdba0('0xf')],_0x3ab016[_0xdba0('0x10')],_0x3ab016['lastevent']));if(_0x3ab016['accountcode']){utils[_0xdba0('0x11')](_0x3ab016[_0xdba0('0x12')])[_0xdba0('0x13')](function(_0x1c7dbf){if(_0x1c7dbf){_0x3ab016[_0xdba0('0x14')]=_0x1c7dbf['id'];}utils[_0xdba0('0x15')](_0xdba0('0x16'),_0x3ab016);});}else{utils['request'](_0xdba0('0x16'),_0x3ab016);}if(channels[_0x3ab016[_0xdba0('0x8')]]){delete channels[_0x3ab016[_0xdba0('0x8')]];}else if(_0x423097&&channels[_0x423097]){if(!transfers[_0xdba0('0x7')][_0x423097][_0xdba0('0x17')])delete transfers[_0xdba0('0x7')][_0x423097];delete channels[_0x423097];}}exports[_0xdba0('0x18')]=function(_0x243a65){try{utils[_0xdba0('0x19')](util[_0xdba0('0x1a')]('[%s][calls][newchannel]',_0x243a65[_0xdba0('0x8')]),_0x243a65);if(_0x243a65['uniqueid']==_0x243a65[_0xdba0('0x1b')]&&_0x243a65[_0xdba0('0xb')]!=_0xdba0('0x1c')){utils[_0xdba0('0x9')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x243a65[_0xdba0('0x8')],_0x243a65[_0xdba0('0x1d')],_0x243a65['exten']));channels[_0x243a65[_0xdba0('0x8')]]={'uniqueid':_0x243a65[_0xdba0('0x8')],'accountcode':_0x243a65[_0xdba0('0x12')],'source':_0x243a65['calleridnum'],'destination':_0x243a65[_0xdba0('0x1e')],'destinationcontext':_0x243a65[_0xdba0('0x1d')],'channel':_0x243a65[_0xdba0('0xb')],'starttime':utils[_0xdba0('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xdba0('0x3'),'amaflags':_0xdba0('0x20')};}}catch(_0xe4ac33){utils[_0xdba0('0x21')](util[_0xdba0('0x1a')](_0xdba0('0x22'),_0x243a65[_0xdba0('0x8')]),_0xe4ac33);}};exports['newstate']=function(_0xdce58c){try{utils[_0xdba0('0x19')](util['format'](_0xdba0('0x23'),_0xdce58c['uniqueid']),_0xdce58c);if(!_[_0xdba0('0x24')](channels[_0xdce58c[_0xdba0('0x8')]])&&_0xdce58c['channelstate']==0x6){utils['info'](util[_0xdba0('0x1a')](_0xdba0('0x25'),_0xdce58c[_0xdba0('0x8')],_0xdce58c[_0xdba0('0x1d')],_0xdce58c[_0xdba0('0xb')]));if(_[_0xdba0('0x24')](channels[_0xdce58c[_0xdba0('0x8')]]['systemanswertime'])){channels[_0xdce58c['uniqueid']][_0xdba0('0x26')]=utils[_0xdba0('0x1f')]();}}else if(!_[_0xdba0('0x24')](channels[_0xdce58c[_0xdba0('0x1b')]])&&_0xdce58c['channelstate']==0x6&&_0xdce58c['context']!=_0xdba0('0x27')){utils['info'](util[_0xdba0('0x1a')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0xdce58c[_0xdba0('0x8')],_0xdce58c[_0xdba0('0x1b')],_0xdce58c['context'],_0xdce58c[_0xdba0('0xb')]));channels[_0xdce58c[_0xdba0('0x1b')]][_0xdba0('0x12')]=_0xdce58c[_0xdba0('0x12')];channels[_0xdce58c[_0xdba0('0x1b')]][_0xdba0('0x28')]=_0xdce58c[_0xdba0('0xb')];if(_['isNil'](channels[_0xdce58c['linkedid']][_0xdba0('0x29')])){channels[_0xdce58c[_0xdba0('0x1b')]][_0xdba0('0x29')]=utils[_0xdba0('0x1f')]();}channels[_0xdce58c[_0xdba0('0x1b')]]['disposition']=dispositions[_['toNumber'](_0xdce58c[_0xdba0('0x2a')])]||_0xdba0('0x5');}}catch(_0x5eacaf){utils[_0xdba0('0x21')](util['format'](_0xdba0('0x23'),_0xdce58c[_0xdba0('0x8')]),_0x5eacaf);}};exports[_0xdba0('0x2b')]=function(_0x1aa9ff){try{if(!_[_0xdba0('0x24')](channels[_0x1aa9ff[_0xdba0('0x8')]])){utils[_0xdba0('0x19')](util['format'](_0xdba0('0x2c'),_0x1aa9ff['uniqueid']),_0x1aa9ff);if(_['isNil'](channels[_0x1aa9ff[_0xdba0('0x8')]][_0xdba0('0x2d')])){channels[_0x1aa9ff['uniqueid']][_0xdba0('0x2d')]=_0x1aa9ff[_0xdba0('0x2e')]+'\x20<'+_0x1aa9ff['calleridnum']+'>';}utils['info'](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x1aa9ff[_0xdba0('0x8')],channels[_0x1aa9ff['uniqueid']]['callerid'],_0x1aa9ff[_0xdba0('0x2f')]));channels[_0x1aa9ff['uniqueid']][_0xdba0('0x30')]=utils[_0xdba0('0x1f')]();channels[_0x1aa9ff[_0xdba0('0x8')]][_0xdba0('0x31')]=utils[_0xdba0('0x32')](channels[_0x1aa9ff[_0xdba0('0x8')]][_0xdba0('0x30')],channels[_0x1aa9ff[_0xdba0('0x8')]][_0xdba0('0x33')]);channels[_0x1aa9ff[_0xdba0('0x8')]][_0xdba0('0x34')]=channels[_0x1aa9ff[_0xdba0('0x8')]]['answertime']?utils[_0xdba0('0x32')](channels[_0x1aa9ff[_0xdba0('0x8')]]['endtime'],channels[_0x1aa9ff[_0xdba0('0x8')]][_0xdba0('0x29')]):0x0;writeDB(channels[_0x1aa9ff[_0xdba0('0x8')]]);}}catch(_0xf59bad){utils[_0xdba0('0x21')](util[_0xdba0('0x1a')](_0xdba0('0x2c'),_0x1aa9ff[_0xdba0('0x8')]),_0xf59bad);}};exports[_0xdba0('0x35')]=function(_0x41cd39){try{if(!_[_0xdba0('0x24')](channels[_0x41cd39[_0xdba0('0x36')]])){utils[_0xdba0('0x19')](util['format'](_0xdba0('0x37'),_0x41cd39['origtransfereruniqueid']),_0x41cd39);if(channels[_0x41cd39[_0xdba0('0x36')]][_0xdba0('0xb')]==_0x41cd39['transfereechannel']){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x41cd39[_0xdba0('0x38')],_0x41cd39[_0xdba0('0x36')],_0x41cd39['secondtransfererchannel']));channels[_0x41cd39['localtwolinkedid']][_0xdba0('0x28')]=_0x41cd39[_0xdba0('0x39')];channels[_0x41cd39[_0xdba0('0x36')]][_0xdba0('0x3a')]=_0xdba0('0x3b');}else if(channels[_0x41cd39[_0xdba0('0x36')]][_0xdba0('0xb')]=_0x41cd39[_0xdba0('0x3c')]){utils[_0xdba0('0x9')](util[_0xdba0('0x1a')](_0xdba0('0x3d'),_0x41cd39[_0xdba0('0x38')],_0x41cd39[_0xdba0('0x36')],_0x41cd39[_0xdba0('0x3e')]));channels[_0x41cd39[_0xdba0('0x36')]]['destinationchannel']=_0x41cd39[_0xdba0('0x3e')];channels[_0x41cd39[_0xdba0('0x36')]][_0xdba0('0x3a')]='_attended';}}}catch(_0x1cb48e){utils[_0xdba0('0x21')](util[_0xdba0('0x1a')](_0xdba0('0x37'),_0x41cd39['origtransfereruniqueid']),_0x1cb48e);}};exports[_0xdba0('0x3f')]=function(_0x2b15a1){try{if(!_[_0xdba0('0x24')](channels[_0x2b15a1[_0xdba0('0x8')]])){utils[_0xdba0('0x19')](util[_0xdba0('0x1a')](_0xdba0('0x40'),_0x2b15a1[_0xdba0('0x8')]),_0x2b15a1);channels[_0x2b15a1['uniqueid']][_0xdba0('0x41')]=utils[_0xdba0('0x1f')]();utils[_0xdba0('0x9')](util[_0xdba0('0x1a')](_0xdba0('0x42'),_0x2b15a1['uniqueid'],channels[_0x2b15a1['uniqueid']][_0xdba0('0x41')]));}}catch(_0x325335){utils['error'](util[_0xdba0('0x1a')](_0xdba0('0x40'),_0x2b15a1[_0xdba0('0x8')]),_0x325335);}};exports[_0xdba0('0x43')]=function(_0x5d4265){try{if(!_[_0xdba0('0x24')](channels[_0x5d4265[_0xdba0('0x8')]])){utils[_0xdba0('0x19')](util[_0xdba0('0x1a')]('[%s][calls][musiconholdstop]',_0x5d4265['uniqueid']),_0x5d4265);if(!_[_0xdba0('0x24')](channels[_0x5d4265['uniqueid']][_0xdba0('0x41')])){channels[_0x5d4265[_0xdba0('0x8')]]['mohtime']+=utils['diffTime'](utils[_0xdba0('0x1f')](),channels[_0x5d4265[_0xdba0('0x8')]][_0xdba0('0x41')]);utils['info'](util['format'](_0xdba0('0x44'),_0x5d4265['uniqueid'],channels[_0x5d4265[_0xdba0('0x8')]][_0xdba0('0x45')]));delete channels[_0x5d4265[_0xdba0('0x8')]][_0xdba0('0x41')];}}}catch(_0x1a5fda){utils[_0xdba0('0x21')](util['format'](_0xdba0('0x46'),_0x5d4265['uniqueid']),_0x1a5fda);}};exports['varset']=function(_0xafe6a){try{if(!_['isNil'](channels[_0xafe6a['uniqueid']])){utils[_0xdba0('0x19')](util[_0xdba0('0x1a')](_0xdba0('0x47'),_0xafe6a[_0xdba0('0x8')]),_0xafe6a);if(!_[_0xdba0('0x24')](_0xafe6a['variable'][_0xdba0('0x48')])){utils['info'](util[_0xdba0('0x1a')](_0xdba0('0x49'),_0xafe6a[_0xdba0('0x8')],_0xafe6a[_0xdba0('0x4a')]));channels[_0xafe6a[_0xdba0('0x8')]][_0xdba0('0x4b')]=_0xafe6a[_0xdba0('0x4a')];}if(!_[_0xdba0('0x24')](_0xafe6a[_0xdba0('0x4c')][_0xdba0('0x4d')])){utils[_0xdba0('0x9')](util[_0xdba0('0x1a')](_0xdba0('0x4e'),_0xafe6a[_0xdba0('0x8')],_0xafe6a[_0xdba0('0x4a')]));channels[_0xafe6a[_0xdba0('0x8')]][_0xdba0('0x4f')]=_0xafe6a['value'];channels[_0xafe6a[_0xdba0('0x8')]][_0xdba0('0x2d')]='\x22'+_0xafe6a[_0xdba0('0x4a')]+_0xdba0('0x50')+_0xafe6a[_0xdba0('0x4a')]+'>';}if(!_[_0xdba0('0x24')](_0xafe6a[_0xdba0('0x4c')]['xmd-callerid-preview'])||!_['isNil'](_0xafe6a[_0xdba0('0x4c')]['xmd-callerid'])){utils[_0xdba0('0x9')](util[_0xdba0('0x1a')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xafe6a[_0xdba0('0x8')],!_['isNil'](_0xafe6a[_0xdba0('0x4c')][_0xdba0('0x51')])?'xmd-callerid-preview':_0xdba0('0x52'),_0xafe6a['value']));channels[_0xafe6a['uniqueid']][_0xdba0('0x2d')]=_0xafe6a[_0xdba0('0x4a')];}if(!_[_0xdba0('0x24')](_0xafe6a['variable'][_0xdba0('0x53')])||!_[_0xdba0('0x24')](_0xafe6a[_0xdba0('0x4c')][_0xdba0('0x54')])){utils[_0xdba0('0x9')](util[_0xdba0('0x1a')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xafe6a[_0xdba0('0x8')],!_[_0xdba0('0x24')](_0xafe6a['variable']['xmd-queue'])?_0xdba0('0x53'):_0xdba0('0x54'),_0xafe6a['value']));channels[_0xafe6a['uniqueid']]['lastapplication']=_0xdba0('0x55');channels[_0xafe6a[_0xdba0('0x8')]][_0xdba0('0x56')]=_0xafe6a[_0xdba0('0x4a')];channels[_0xafe6a[_0xdba0('0x8')]][_0xdba0('0xc')]=!![];}if(!_[_0xdba0('0x24')](_0xafe6a['variable'][_0xdba0('0x57')])){utils[_0xdba0('0x9')](util['format'](_0xdba0('0x58'),_0xafe6a[_0xdba0('0x8')],_0xafe6a[_0xdba0('0x4a')]));channels[_0xafe6a[_0xdba0('0x8')]][_0xdba0('0x59')]=_0xafe6a['value'];}if(!_['isNil'](_0xafe6a['variable'][_0xdba0('0x5a')])){utils['info'](util[_0xdba0('0x1a')](_0xdba0('0x5b'),_0xafe6a[_0xdba0('0x8')],_0xafe6a['value']));channels[_0xafe6a['uniqueid']][_0xdba0('0x5c')]=_0xafe6a[_0xdba0('0x4a')];}if(!_[_0xdba0('0x24')](_0xafe6a['variable'][_0xdba0('0x5d')])){utils[_0xdba0('0x9')](util[_0xdba0('0x1a')](_0xdba0('0x5e'),_0xafe6a[_0xdba0('0x8')],_0xafe6a[_0xdba0('0x4a')]));channels[_0xafe6a[_0xdba0('0x8')]][_0xdba0('0x5f')]=_0xafe6a[_0xdba0('0x4a')];}if(!_['isNil'](_0xafe6a[_0xdba0('0x4c')][_0xdba0('0x60')])){utils[_0xdba0('0x9')](util[_0xdba0('0x1a')](_0xdba0('0x61'),_0xafe6a[_0xdba0('0x8')],_0xafe6a['value']));channels[_0xafe6a['uniqueid']][_0xdba0('0x60')]=_0xafe6a[_0xdba0('0x4a')];}}}catch(_0x33dc19){utils[_0xdba0('0x21')](util[_0xdba0('0x1a')](_0xdba0('0x47'),_0xafe6a[_0xdba0('0x8')]),_0x33dc19);}};exports[_0xdba0('0x62')]=function(_0x14602d){try{if(!_[_0xdba0('0x24')](channels[_0x14602d['uniqueid']])){utils[_0xdba0('0x19')](util['format'](_0xdba0('0x63'),_0x14602d['uniqueid']),_0x14602d);utils[_0xdba0('0x9')](util[_0xdba0('0x1a')](_0xdba0('0x64'),_0x14602d['uniqueid'],_0x14602d['application'],_0x14602d[_0xdba0('0x65')]));if(_0x14602d[_0xdba0('0x66')]['toLowerCase']()==_0xdba0('0x67')&&_[_0xdba0('0x68')](_0x14602d[_0xdba0('0x65')][_0xdba0('0x69')](),'cdr')){var _0x1f6814=_0x14602d['appdata']['split']('=');var _0x2b6b4c=_0x1f6814[0x0]['substring'](_0x1f6814[0x0][_0xdba0('0x6a')]('(')+0x1,_0x1f6814[0x0][_0xdba0('0x6a')](')'));var _0x58170b=_0x1f6814[0x1];channels[_0x14602d[_0xdba0('0x8')]][_0x2b6b4c]=_0x58170b;}if(!_[_0xdba0('0x6b')]([_0xdba0('0x2b'),_0xdba0('0x6c'),'execif','set',_0xdba0('0x6d')],_0x14602d[_0xdba0('0x66')][_0xdba0('0x69')]())){channels[_0x14602d['uniqueid']]['lastapplication']=_0x14602d[_0xdba0('0x66')];channels[_0x14602d[_0xdba0('0x8')]][_0xdba0('0x56')]=_0x14602d[_0xdba0('0x65')];}}}catch(_0x9bf57){utils[_0xdba0('0x21')](util[_0xdba0('0x1a')](_0xdba0('0x63'),_0x14602d[_0xdba0('0x8')]),_0x9bf57);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index d6c5c32..5343d6a 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 _0xf925=['close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted'];(function(_0x174e6b,_0x124a26){var _0x10ab0e=function(_0x704225){while(--_0x704225){_0x174e6b['push'](_0x174e6b['shift']());}};_0x10ab0e(++_0x124a26);}(_0xf925,0x157));var _0x5f92=function(_0x26394d,_0x547eea){_0x26394d=_0x26394d-0x0;var _0x5c7861=_0xf925[_0x26394d];return _0x5c7861;};'use strict';var utils=require(_0x5f92('0x0'));exports[_0x5f92('0x1')]=function(){utils[_0x5f92('0x2')](_0x5f92('0x3'));};exports[_0x5f92('0x4')]=function(){utils[_0x5f92('0x2')](_0x5f92('0x5'));};exports[_0x5f92('0x6')]=function(){utils[_0x5f92('0x2')]('[core]\x20fullybooted');};exports['error']=function(_0xb95ab7){utils['error']('[core]\x20error',_0xb95ab7);};exports[_0x5f92('0x7')]=function(){utils[_0x5f92('0x2')](_0x5f92('0x8'));};exports[_0x5f92('0x9')]=function(_0x250a98){}; \ No newline at end of file +var _0xbd19=['[core]\x20fullybooted','error','[core]\x20error','managerevent','./utils','connect','info','shutdown'];(function(_0x492c4f,_0x13f4f2){var _0x1dd370=function(_0x50aade){while(--_0x50aade){_0x492c4f['push'](_0x492c4f['shift']());}};_0x1dd370(++_0x13f4f2);}(_0xbd19,0x9c));var _0x9bd1=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xbd19[_0x12f688];return _0x59c3de;};'use strict';var utils=require(_0x9bd1('0x0'));exports[_0x9bd1('0x1')]=function(){utils[_0x9bd1('0x2')]('[core]\x20connected');};exports[_0x9bd1('0x3')]=function(){utils[_0x9bd1('0x2')]('[core]\x20shutdown');};exports['fullybooted']=function(){utils[_0x9bd1('0x2')](_0x9bd1('0x4'));};exports['error']=function(_0x4d677d){utils[_0x9bd1('0x5')](_0x9bd1('0x6'),_0x4d677d);};exports['close']=function(){utils[_0x9bd1('0x2')]('[core]\x20close');};exports[_0x9bd1('0x7')]=function(_0x413cb4){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 49620a3..a8fd279 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 _0x413f=['now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','[%s][dials][dialbegin]','dialend','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','billableseconds','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','calleridnum','connectedlinenum','dialstatus','request','newexten','debug','[%s][dials][newexten]','uniqueid','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','dialbegin','assign'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0x413f,0x115));var _0xf413=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x413f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf413('0x0'));var util=require(_0xf413('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x25b3a9){utils[_0xf413('0x2')](util[_0xf413('0x3')](_0xf413('0x4'),_0x25b3a9['uniqueid'],_0x25b3a9['channel'],_0x25b3a9[_0xf413('0x5')],_0x25b3a9[_0xf413('0x6')],_0x25b3a9[_0xf413('0x7')],_0x25b3a9[_0xf413('0x8')]));utils[_0xf413('0x9')]('CreateVoiceDialReport',_0x25b3a9);delete dials[_0x25b3a9['uniqueid']];}exports[_0xf413('0xa')]=function(_0x3032e4){try{utils[_0xf413('0xb')](util[_0xf413('0x3')](_0xf413('0xc'),_0x3032e4[_0xf413('0xd')]),_0x3032e4);utils[_0xf413('0x2')](util[_0xf413('0x3')](_0xf413('0xe'),_0x3032e4[_0xf413('0xd')],_0x3032e4['application'],_0x3032e4[_0xf413('0xf')]));if(_0x3032e4[_0xf413('0x10')][_0xf413('0x11')]()==_0xf413('0x12')&&_[_0xf413('0x13')](_0x3032e4['appdata'][_0xf413('0x11')](),_0xf413('0x14'))){var _0x306efd=_0x3032e4['appdata'][_0xf413('0x15')]('=');dials[_0x3032e4[_0xf413('0xd')]]={'routeId':_0x306efd[0x1]};}}catch(_0x8df710){utils[_0xf413('0x16')](util[_0xf413('0x3')](_0xf413('0xc'),_0x3032e4[_0xf413('0xd')]),_0x8df710);}};exports[_0xf413('0x17')]=function(_0x422e75){try{utils[_0xf413('0xb')](util[_0xf413('0x3')]('[%s][dials][varset]',_0x422e75[_0xf413('0xd')]),_0x422e75);if(!_[_0xf413('0x18')](_0x422e75['variable'][_0xf413('0x19')])){utils[_0xf413('0x2')](util[_0xf413('0x3')](_0xf413('0x1a'),_0x422e75[_0xf413('0xd')],_0x422e75['value']));dials[_0x422e75[_0xf413('0xd')]]={'routeId':_0x422e75['value']};}}catch(_0x37ee13){utils['error'](util['format']('[%s][dials][varset]',_0x422e75[_0xf413('0xd')]),_0x37ee13);}};exports[_0xf413('0x1b')]=function(_0x409354){try{if(!_[_0xf413('0x18')](dials[_0x409354[_0xf413('0xd')]])){utils[_0xf413('0xb')](util['format']('[%s][dials][dialbegin]',_0x409354[_0xf413('0xd')]),_0x409354);dials[_0x409354[_0xf413('0xd')]]=_[_0xf413('0x1c')](dials[_0x409354[_0xf413('0xd')]],_0x409354);dials[_0x409354[_0xf413('0xd')]]['starttime']=utils[_0xf413('0x1d')]();dials[_0x409354['uniqueid']][_0xf413('0x1e')]='called';utils[_0xf413('0x2')](util[_0xf413('0x3')](_0xf413('0x1f'),_0x409354[_0xf413('0xd')],dials[_0x409354[_0xf413('0xd')]][_0xf413('0x20')]));}}catch(_0x53c87d){utils[_0xf413('0x16')](util[_0xf413('0x3')](_0xf413('0x21'),_0x409354[_0xf413('0xd')]),_0x53c87d);}};exports[_0xf413('0x22')]=function(_0x39b4f7){try{if(!_[_0xf413('0x18')](dials[_0x39b4f7['uniqueid']])){utils['debug'](util[_0xf413('0x3')]('[%s][dials][dialend]',_0x39b4f7['uniqueid']),_0x39b4f7);dials[_0x39b4f7[_0xf413('0xd')]][_0xf413('0x8')]=_0x39b4f7[_0xf413('0x8')];if(_0x39b4f7['dialstatus']==_0xf413('0x23')){dials[_0x39b4f7[_0xf413('0xd')]]=_[_0xf413('0x1c')](dials[_0x39b4f7[_0xf413('0xd')]],_0x39b4f7);dials[_0x39b4f7['uniqueid']][_0xf413('0x24')]=utils['now']();dials[_0x39b4f7[_0xf413('0xd')]]['lastevent']=_0xf413('0x25');utils[_0xf413('0x2')](util[_0xf413('0x3')](_0xf413('0x26'),_0x39b4f7['uniqueid'],_0x39b4f7['dialstatus'],dials[_0x39b4f7[_0xf413('0xd')]][_0xf413('0x24')]));}else{utils[_0xf413('0x2')](util[_0xf413('0x3')](_0xf413('0x27'),_0x39b4f7[_0xf413('0xd')],_0x39b4f7[_0xf413('0x8')]));}}}catch(_0x2ef23c){utils[_0xf413('0x16')](util[_0xf413('0x3')](_0xf413('0x28'),_0x39b4f7['uniqueid']),_0x2ef23c);}};exports[_0xf413('0x29')]=function(_0x202174){try{if(!_['isNil'](dials[_0x202174[_0xf413('0xd')]])){utils[_0xf413('0xb')](util[_0xf413('0x3')](_0xf413('0x2a'),_0x202174[_0xf413('0xd')]),_0x202174);utils[_0xf413('0x2')](util[_0xf413('0x3')](_0xf413('0x2b'),_0x202174[_0xf413('0xd')],_0x202174[_0xf413('0x6')],_0x202174[_0xf413('0x2c')],_0x202174[_0xf413('0x2d')]));dials[_0x202174[_0xf413('0xd')]]=_['assign'](dials[_0x202174[_0xf413('0xd')]],{'endtime':utils[_0xf413('0x1d')](),'lastevent':_0xf413('0x2e')});dials[_0x202174[_0xf413('0xd')]][_0xf413('0x2f')]=utils[_0xf413('0x30')](dials[_0x202174[_0xf413('0xd')]][_0xf413('0x31')],dials[_0x202174[_0xf413('0xd')]][_0xf413('0x20')]);dials[_0x202174[_0xf413('0xd')]]['holdtime']=utils['diffTime'](dials[_0x202174[_0xf413('0xd')]]['answertime']||dials[_0x202174['uniqueid']][_0xf413('0x31')],dials[_0x202174[_0xf413('0xd')]]['starttime']);dials[_0x202174['uniqueid']][_0xf413('0x32')]=dials[_0x202174['uniqueid']][_0xf413('0x24')]?utils['diffTime'](dials[_0x202174[_0xf413('0xd')]][_0xf413('0x31')],dials[_0x202174['uniqueid']][_0xf413('0x24')]):0x0;writeDB(dials[_0x202174[_0xf413('0xd')]]);}}catch(_0x398a5d){utils[_0xf413('0x16')](util[_0xf413('0x3')]('[%s][dials][hangup]',_0x202174['uniqueid']),_0x398a5d);}}; \ No newline at end of file +var _0xb615=['set','split','varset','[%s][dials][varset]','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','duration','diffTime','endtime','holdtime','billableseconds','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata'];(function(_0x4fcc93,_0x5779f9){var _0x5b752a=function(_0x1543c1){while(--_0x1543c1){_0x4fcc93['push'](_0x4fcc93['shift']());}};_0x5b752a(++_0x5779f9);}(_0xb615,0x147));var _0x5b61=function(_0x2d1c84,_0x4147aa){_0x2d1c84=_0x2d1c84-0x0;var _0x16622e=_0xb615[_0x2d1c84];return _0x16622e;};'use strict';var _=require('lodash');var util=require(_0x5b61('0x0'));var utils=require(_0x5b61('0x1'));var dials={};function writeDB(_0x371af9){utils[_0x5b61('0x2')](util[_0x5b61('0x3')](_0x5b61('0x4'),_0x371af9[_0x5b61('0x5')],_0x371af9[_0x5b61('0x6')],_0x371af9[_0x5b61('0x7')],_0x371af9[_0x5b61('0x8')],_0x371af9['connectedlinenum'],_0x371af9['dialstatus']));utils['request'](_0x5b61('0x9'),_0x371af9);delete dials[_0x371af9[_0x5b61('0x5')]];}exports[_0x5b61('0xa')]=function(_0x4a4502){try{utils[_0x5b61('0xb')](util[_0x5b61('0x3')](_0x5b61('0xc'),_0x4a4502[_0x5b61('0x5')]),_0x4a4502);utils[_0x5b61('0x2')](util['format'](_0x5b61('0xd'),_0x4a4502[_0x5b61('0x5')],_0x4a4502[_0x5b61('0xe')],_0x4a4502[_0x5b61('0xf')]));if(_0x4a4502[_0x5b61('0xe')]['toLowerCase']()==_0x5b61('0x10')&&_['startsWith'](_0x4a4502['appdata']['toLowerCase'](),'cdr(routeid)')){var _0x5c8d35=_0x4a4502[_0x5b61('0xf')][_0x5b61('0x11')]('=');dials[_0x4a4502[_0x5b61('0x5')]]={'routeId':_0x5c8d35[0x1]};}}catch(_0x1de8aa){utils['error'](util[_0x5b61('0x3')]('[%s][dials][newexten]',_0x4a4502['uniqueid']),_0x1de8aa);}};exports[_0x5b61('0x12')]=function(_0x5b5669){try{utils['debug'](util[_0x5b61('0x3')](_0x5b61('0x13'),_0x5b5669[_0x5b61('0x5')]),_0x5b5669);if(!_['isNil'](_0x5b5669['variable']['outboundrouteid'])){utils[_0x5b61('0x2')](util[_0x5b61('0x3')](_0x5b61('0x14'),_0x5b5669[_0x5b61('0x5')],_0x5b5669[_0x5b61('0x15')]));dials[_0x5b5669['uniqueid']]={'routeId':_0x5b5669['value']};}}catch(_0x3b10dc){utils[_0x5b61('0x16')](util['format'](_0x5b61('0x13'),_0x5b5669[_0x5b61('0x5')]),_0x3b10dc);}};exports[_0x5b61('0x17')]=function(_0x6988ee){try{if(!_[_0x5b61('0x18')](dials[_0x6988ee[_0x5b61('0x5')]])){utils['debug'](util['format'](_0x5b61('0x19'),_0x6988ee[_0x5b61('0x5')]),_0x6988ee);dials[_0x6988ee[_0x5b61('0x5')]]=_[_0x5b61('0x1a')](dials[_0x6988ee[_0x5b61('0x5')]],_0x6988ee);dials[_0x6988ee[_0x5b61('0x5')]][_0x5b61('0x1b')]=utils[_0x5b61('0x1c')]();dials[_0x6988ee['uniqueid']][_0x5b61('0x1d')]=_0x5b61('0x1e');utils[_0x5b61('0x2')](util['format'](_0x5b61('0x1f'),_0x6988ee[_0x5b61('0x5')],dials[_0x6988ee[_0x5b61('0x5')]][_0x5b61('0x1b')]));}}catch(_0x1f2eef){utils[_0x5b61('0x16')](util[_0x5b61('0x3')](_0x5b61('0x19'),_0x6988ee[_0x5b61('0x5')]),_0x1f2eef);}};exports[_0x5b61('0x20')]=function(_0x2a9d44){try{if(!_[_0x5b61('0x18')](dials[_0x2a9d44[_0x5b61('0x5')]])){utils[_0x5b61('0xb')](util[_0x5b61('0x3')]('[%s][dials][dialend]',_0x2a9d44['uniqueid']),_0x2a9d44);dials[_0x2a9d44['uniqueid']][_0x5b61('0x21')]=_0x2a9d44[_0x5b61('0x21')];if(_0x2a9d44[_0x5b61('0x21')]==_0x5b61('0x22')){dials[_0x2a9d44['uniqueid']]=_[_0x5b61('0x1a')](dials[_0x2a9d44['uniqueid']],_0x2a9d44);dials[_0x2a9d44[_0x5b61('0x5')]][_0x5b61('0x23')]=utils[_0x5b61('0x1c')]();dials[_0x2a9d44[_0x5b61('0x5')]][_0x5b61('0x1d')]=_0x5b61('0x24');utils[_0x5b61('0x2')](util[_0x5b61('0x3')](_0x5b61('0x25'),_0x2a9d44[_0x5b61('0x5')],_0x2a9d44['dialstatus'],dials[_0x2a9d44[_0x5b61('0x5')]][_0x5b61('0x23')]));}else{utils[_0x5b61('0x2')](util[_0x5b61('0x3')](_0x5b61('0x26'),_0x2a9d44['uniqueid'],_0x2a9d44[_0x5b61('0x21')]));}}}catch(_0x194d5f){utils[_0x5b61('0x16')](util[_0x5b61('0x3')](_0x5b61('0x27'),_0x2a9d44[_0x5b61('0x5')]),_0x194d5f);}};exports[_0x5b61('0x28')]=function(_0x1c1476){try{if(!_['isNil'](dials[_0x1c1476[_0x5b61('0x5')]])){utils[_0x5b61('0xb')](util[_0x5b61('0x3')](_0x5b61('0x29'),_0x1c1476[_0x5b61('0x5')]),_0x1c1476);utils[_0x5b61('0x2')](util[_0x5b61('0x3')](_0x5b61('0x2a'),_0x1c1476[_0x5b61('0x5')],_0x1c1476['calleridnum'],_0x1c1476[_0x5b61('0x2b')],_0x1c1476['cause-txt']));dials[_0x1c1476[_0x5b61('0x5')]]=_['assign'](dials[_0x1c1476[_0x5b61('0x5')]],{'endtime':utils[_0x5b61('0x1c')](),'lastevent':'complete'});dials[_0x1c1476[_0x5b61('0x5')]][_0x5b61('0x2c')]=utils[_0x5b61('0x2d')](dials[_0x1c1476[_0x5b61('0x5')]][_0x5b61('0x2e')],dials[_0x1c1476[_0x5b61('0x5')]][_0x5b61('0x1b')]);dials[_0x1c1476[_0x5b61('0x5')]][_0x5b61('0x2f')]=utils['diffTime'](dials[_0x1c1476['uniqueid']][_0x5b61('0x23')]||dials[_0x1c1476[_0x5b61('0x5')]][_0x5b61('0x2e')],dials[_0x1c1476[_0x5b61('0x5')]][_0x5b61('0x1b')]);dials[_0x1c1476[_0x5b61('0x5')]][_0x5b61('0x30')]=dials[_0x1c1476[_0x5b61('0x5')]][_0x5b61('0x23')]?utils[_0x5b61('0x2d')](dials[_0x1c1476['uniqueid']]['endtime'],dials[_0x1c1476['uniqueid']][_0x5b61('0x23')]):0x0;writeDB(dials[_0x1c1476[_0x5b61('0x5')]]);}}catch(_0x1bc0f9){utils[_0x5b61('0x16')](util[_0x5b61('0x3')](_0x5b61('0x29'),_0x1c1476[_0x5b61('0x5')]),_0x1bc0f9);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 811ca48..6875d93 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 _0xfd19=['[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','./utils','util','xdr','disabled','env','production','local','port','asterisk','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','error','close','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xfd19,0x178));var _0x9fd1=function(_0x54bdc1,_0x58f472){_0x54bdc1=_0x54bdc1-0x0;var _0x4e4df8=_0xfd19[_0x54bdc1];return _0x4e4df8;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x9fd1('0x0'));var util=require(_0x9fd1('0x1'));var isXDREnabled=config['xdr']&&config[_0x9fd1('0x2')][_0x9fd1('0x3')]?!config[_0x9fd1('0x2')][_0x9fd1('0x3')]:!![];var isProduction=config[_0x9fd1('0x4')]===_0x9fd1('0x5')||![];var isLocalAsterisk=config[_0x9fd1('0x2')]&&config[_0x9fd1('0x2')][_0x9fd1('0x6')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x9fd1('0x7')],config[_0x9fd1('0x8')]['ip'],config[_0x9fd1('0x8')][_0x9fd1('0x9')],config[_0x9fd1('0x8')][_0x9fd1('0xa')],!![]);ami[_0x9fd1('0xb')]();if(!isXDREnabled){utils[_0x9fd1('0xc')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x9fd1('0xc')](_0x9fd1('0xd'));}else{var agents=require(_0x9fd1('0xe'));var calls=require(_0x9fd1('0xf'));var queues=require(_0x9fd1('0x10'));var recordings=require(_0x9fd1('0x11'));var members=require(_0x9fd1('0x12'));var dials=require('./dials.controller');var transfers=require(_0x9fd1('0x13'));var core=require(_0x9fd1('0x14'));ami['on'](_0x9fd1('0x15'),core['connect']);ami['on'](_0x9fd1('0x16'),core['shutdown']);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0x9fd1('0x17'),core[_0x9fd1('0x17')]);ami['on'](_0x9fd1('0x18'),core['close']);ami['on']('managerevent',core['managerevent']);ami['on'](_0x9fd1('0x19'),function(_0x5bf722){try{utils[_0x9fd1('0x1a')](util[_0x9fd1('0x1b')](_0x9fd1('0x1c'),_0x5bf722[_0x9fd1('0x1d')]),_0x5bf722);members['devicestatechange'](_0x5bf722);}catch(_0x905ec5){utils['error'](util[_0x9fd1('0x1b')](_0x9fd1('0x1c'),_0x5bf722[_0x9fd1('0x1d')]),_0x905ec5);}});ami['on']('agentcalled',function(_0x2699cf){try{utils[_0x9fd1('0x1a')](util['format'](_0x9fd1('0x1e'),_0x2699cf['uniqueid']),_0x2699cf);agents[_0x9fd1('0x1f')](_0x2699cf);}catch(_0x513012){utils['error'](util['format']('[%s][index][agentcalled]',_0x2699cf[_0x9fd1('0x20')]),_0x513012);}});ami['on'](_0x9fd1('0x21'),function(_0x1d0812){try{utils['debug'](util['format']('[%s][index][agentringnoanswer]',_0x1d0812[_0x9fd1('0x20')]),_0x1d0812);agents['agentringnoanswer'](_0x1d0812);}catch(_0x7930c5){utils[_0x9fd1('0x17')](util[_0x9fd1('0x1b')](_0x9fd1('0x22'),_0x1d0812[_0x9fd1('0x20')]),_0x7930c5);}});ami['on']('agentconnect',function(_0x5169d2){try{utils[_0x9fd1('0x1a')](util[_0x9fd1('0x1b')](_0x9fd1('0x23'),_0x5169d2[_0x9fd1('0x20')]),_0x5169d2);agents['agentconnect'](_0x5169d2);queues[_0x9fd1('0x24')](_0x5169d2);}catch(_0x5d0901){utils[_0x9fd1('0x17')](util[_0x9fd1('0x1b')]('[%s][index][agentconnect]',_0x5169d2['uniqueid']),_0x5d0901);}});ami['on'](_0x9fd1('0x25'),function(_0x3f5d76){try{utils[_0x9fd1('0x1a')](util[_0x9fd1('0x1b')](_0x9fd1('0x26'),_0x3f5d76[_0x9fd1('0x20')]),_0x3f5d76);agents[_0x9fd1('0x25')](_0x3f5d76);queues[_0x9fd1('0x25')](_0x3f5d76);members[_0x9fd1('0x25')](_0x3f5d76);}catch(_0x55baf3){utils[_0x9fd1('0x17')](util['format'](_0x9fd1('0x26'),_0x3f5d76['uniqueid']),_0x55baf3);}});ami['on'](_0x9fd1('0x27'),function(_0x25631c){try{utils['debug'](util[_0x9fd1('0x1b')]('[%s][index][queuecallerabandon]',_0x25631c[_0x9fd1('0x20')]),_0x25631c);agents[_0x9fd1('0x27')](_0x25631c);queues['queuecallerabandon'](_0x25631c);}catch(_0x2dea52){utils['error'](util[_0x9fd1('0x1b')](_0x9fd1('0x28'),_0x25631c[_0x9fd1('0x20')]),_0x2dea52);}});ami['on']('queuecallerjoin',function(_0x1144ec){try{utils[_0x9fd1('0x1a')](util[_0x9fd1('0x1b')]('[%s][index][queuecallerjoin]',_0x1144ec[_0x9fd1('0x20')]),_0x1144ec);queues[_0x9fd1('0x29')](_0x1144ec);recordings['queuecallerjoin'](_0x1144ec);}catch(_0x1cbe42){utils[_0x9fd1('0x17')](util['format'](_0x9fd1('0x2a'),_0x1144ec[_0x9fd1('0x20')]),_0x1cbe42);}});ami['on'](_0x9fd1('0x2b'),function(_0x271024){try{utils['debug'](util[_0x9fd1('0x1b')](_0x9fd1('0x2c'),_0x271024[_0x9fd1('0x20')]),_0x271024);queues['queuecallerleave'](_0x271024);}catch(_0xb37af1){utils[_0x9fd1('0x17')](util[_0x9fd1('0x1b')](_0x9fd1('0x2c'),_0x271024[_0x9fd1('0x20')]),_0xb37af1);}});ami['on'](_0x9fd1('0x2d'),function(_0x50a60a){try{utils['debug'](util[_0x9fd1('0x1b')](_0x9fd1('0x2e'),_0x50a60a[_0x9fd1('0x20')]),_0x50a60a);queues[_0x9fd1('0x2d')](_0x50a60a);calls[_0x9fd1('0x2d')](_0x50a60a);}catch(_0x877071){utils[_0x9fd1('0x17')](util[_0x9fd1('0x1b')]('[%s][index][musiconholdstart]',_0x50a60a[_0x9fd1('0x20')]),_0x877071);}});ami['on'](_0x9fd1('0x2f'),function(_0x20c444){try{utils['debug'](util[_0x9fd1('0x1b')](_0x9fd1('0x30'),_0x20c444[_0x9fd1('0x20')]),_0x20c444);queues[_0x9fd1('0x2f')](_0x20c444);calls['musiconholdstop'](_0x20c444);}catch(_0x344caa){utils[_0x9fd1('0x17')](util[_0x9fd1('0x1b')](_0x9fd1('0x30'),_0x20c444[_0x9fd1('0x20')]),_0x344caa);}});ami['on']('newstate',function(_0x373a6b){try{utils['debug'](util[_0x9fd1('0x1b')]('[%s][index][newstate]',_0x373a6b[_0x9fd1('0x20')]),_0x373a6b);calls[_0x9fd1('0x31')](_0x373a6b);recordings[_0x9fd1('0x31')](_0x373a6b);}catch(_0x5db96d){utils['error'](util[_0x9fd1('0x1b')](_0x9fd1('0x32'),_0x373a6b['uniqueid']),_0x5db96d);}});ami['on'](_0x9fd1('0x33'),function(_0x11fd38){try{utils[_0x9fd1('0x1a')](util[_0x9fd1('0x1b')]('[%s][index][hangup]',_0x11fd38[_0x9fd1('0x20')]),_0x11fd38);calls[_0x9fd1('0x33')](_0x11fd38);recordings['hangup'](_0x11fd38);dials[_0x9fd1('0x33')](_0x11fd38);agents[_0x9fd1('0x33')](_0x11fd38);queues[_0x9fd1('0x33')](_0x11fd38);}catch(_0x4a0e25){utils[_0x9fd1('0x17')](util['format'](_0x9fd1('0x34'),_0x11fd38[_0x9fd1('0x20')]),_0x4a0e25);}});ami['on'](_0x9fd1('0x35'),function(_0x1f154f){try{utils['debug'](util[_0x9fd1('0x1b')](_0x9fd1('0x36'),_0x1f154f[_0x9fd1('0x20')]),_0x1f154f);members['cdr'](_0x1f154f);}catch(_0x235520){utils[_0x9fd1('0x17')](util['format'](_0x9fd1('0x36'),_0x1f154f['uniqueid']),_0x235520);}});ami['on']('blindtransfer',function(_0x1d2633){try{utils['debug'](util[_0x9fd1('0x1b')](_0x9fd1('0x37'),_0x1d2633['uniqueid']),_0x1d2633);queues[_0x9fd1('0x38')](_0x1d2633);agents[_0x9fd1('0x38')](_0x1d2633);transfers[_0x9fd1('0x38')](_0x1d2633);recordings[_0x9fd1('0x38')](_0x1d2633);}catch(_0x36bcff){utils['error'](util[_0x9fd1('0x1b')](_0x9fd1('0x37'),_0x1d2633[_0x9fd1('0x20')]),_0x36bcff);}});ami['on'](_0x9fd1('0x39'),function(_0x4c18ed){try{utils[_0x9fd1('0x1a')](util[_0x9fd1('0x1b')](_0x9fd1('0x3a'),_0x4c18ed[_0x9fd1('0x3b')]),_0x4c18ed);queues['attendedtransfer'](_0x4c18ed);transfers['attendedtransfer'](_0x4c18ed);agents['attendedtransfer'](_0x4c18ed);calls[_0x9fd1('0x39')](_0x4c18ed);}catch(_0x2a0022){utils['error'](util[_0x9fd1('0x1b')](_0x9fd1('0x3a'),_0x4c18ed[_0x9fd1('0x3b')]),_0x2a0022);}});ami['on'](_0x9fd1('0x3c'),function(_0x202ce1){try{utils['debug'](util[_0x9fd1('0x1b')]('[%s][index][varset]',_0x202ce1[_0x9fd1('0x20')]),_0x202ce1);queues[_0x9fd1('0x3c')](_0x202ce1);recordings[_0x9fd1('0x3c')](_0x202ce1);calls[_0x9fd1('0x3c')](_0x202ce1);dials[_0x9fd1('0x3c')](_0x202ce1);}catch(_0x570dd4){utils[_0x9fd1('0x17')](util[_0x9fd1('0x1b')]('[%s][index][varset]',_0x202ce1[_0x9fd1('0x20')]),_0x570dd4);}});ami['on'](_0x9fd1('0x3d'),function(_0x5b8d42){try{utils['debug'](util[_0x9fd1('0x1b')](_0x9fd1('0x3e'),_0x5b8d42[_0x9fd1('0x20')]),_0x5b8d42);calls[_0x9fd1('0x3d')](_0x5b8d42);recordings[_0x9fd1('0x3d')](_0x5b8d42);dials[_0x9fd1('0x3d')](_0x5b8d42);}catch(_0x38eeb1){utils[_0x9fd1('0x17')](util['format'](_0x9fd1('0x3e'),_0x5b8d42[_0x9fd1('0x20')]),_0x38eeb1);}});ami['on'](_0x9fd1('0x3f'),function(_0x293948){try{utils[_0x9fd1('0x1a')](util['format'](_0x9fd1('0x40'),_0x293948[_0x9fd1('0x20')]),_0x293948);calls['newchannel'](_0x293948);recordings[_0x9fd1('0x3f')](_0x293948);}catch(_0x1877b0){utils['error'](util[_0x9fd1('0x1b')]('[%s][index][newchannel]',_0x293948[_0x9fd1('0x20')]),_0x1877b0);}});ami['on'](_0x9fd1('0x41'),function(_0x4e6192){try{utils[_0x9fd1('0x1a')](util[_0x9fd1('0x1b')](_0x9fd1('0x42'),_0x4e6192[_0x9fd1('0x20')]),_0x4e6192);dials['dialbegin'](_0x4e6192);}catch(_0x25467a){utils['error'](util[_0x9fd1('0x1b')](_0x9fd1('0x43'),_0x4e6192[_0x9fd1('0x20')]),_0x25467a);}});ami['on'](_0x9fd1('0x44'),function(_0x2fdf77){try{utils[_0x9fd1('0x1a')](util[_0x9fd1('0x1b')](_0x9fd1('0x45'),_0x2fdf77[_0x9fd1('0x20')]),_0x2fdf77);dials[_0x9fd1('0x44')](_0x2fdf77);}catch(_0x5e980b){utils['error'](util['format'](_0x9fd1('0x45'),_0x2fdf77[_0x9fd1('0x20')]),_0x5e980b);}});} \ No newline at end of file +var _0xa396=['password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','xdr','disabled','env','production','local','asterisk','username'];(function(_0x209b31,_0x139fed){var _0x298499=function(_0x3abf08){while(--_0x3abf08){_0x209b31['push'](_0x209b31['shift']());}};_0x298499(++_0x139fed);}(_0xa396,0x82));var _0x6a39=function(_0x4cc45a,_0x427df){_0x4cc45a=_0x4cc45a-0x0;var _0x52953e=_0xa396[_0x4cc45a];return _0x52953e;};var AsteriskManager=require(_0x6a39('0x0'));var config=require(_0x6a39('0x1'));var utils=require('./utils');var util=require(_0x6a39('0x2'));var isXDREnabled=config[_0x6a39('0x3')]&&config[_0x6a39('0x3')][_0x6a39('0x4')]?!config[_0x6a39('0x3')][_0x6a39('0x4')]:!![];var isProduction=config[_0x6a39('0x5')]===_0x6a39('0x6')||![];var isLocalAsterisk=config[_0x6a39('0x3')]&&config[_0x6a39('0x3')][_0x6a39('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x6a39('0x8')]['port'],config[_0x6a39('0x8')]['ip'],config[_0x6a39('0x8')][_0x6a39('0x9')],config['asterisk'][_0x6a39('0xa')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x6a39('0xb')](_0x6a39('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x6a39('0xb')](_0x6a39('0xd'));}else{var agents=require(_0x6a39('0xe'));var calls=require(_0x6a39('0xf'));var queues=require('./queues.controller');var recordings=require(_0x6a39('0x10'));var members=require(_0x6a39('0x11'));var dials=require('./dials.controller');var transfers=require(_0x6a39('0x12'));var core=require(_0x6a39('0x13'));ami['on']('connect',core[_0x6a39('0x14')]);ami['on'](_0x6a39('0x15'),core[_0x6a39('0x15')]);ami['on'](_0x6a39('0x16'),core[_0x6a39('0x16')]);ami['on'](_0x6a39('0x17'),core['error']);ami['on'](_0x6a39('0x18'),core[_0x6a39('0x18')]);ami['on']('managerevent',core[_0x6a39('0x19')]);ami['on'](_0x6a39('0x1a'),function(_0x27c5e8){try{utils[_0x6a39('0x1b')](util[_0x6a39('0x1c')](_0x6a39('0x1d'),_0x27c5e8[_0x6a39('0x1e')]),_0x27c5e8);members[_0x6a39('0x1a')](_0x27c5e8);}catch(_0x17ef58){utils['error'](util[_0x6a39('0x1c')](_0x6a39('0x1d'),_0x27c5e8[_0x6a39('0x1e')]),_0x17ef58);}});ami['on'](_0x6a39('0x1f'),function(_0x1cc04a){try{utils[_0x6a39('0x1b')](util[_0x6a39('0x1c')](_0x6a39('0x20'),_0x1cc04a['uniqueid']),_0x1cc04a);agents['agentcalled'](_0x1cc04a);}catch(_0xed63c7){utils['error'](util[_0x6a39('0x1c')](_0x6a39('0x20'),_0x1cc04a[_0x6a39('0x21')]),_0xed63c7);}});ami['on'](_0x6a39('0x22'),function(_0x2b7412){try{utils[_0x6a39('0x1b')](util[_0x6a39('0x1c')]('[%s][index][agentringnoanswer]',_0x2b7412[_0x6a39('0x21')]),_0x2b7412);agents[_0x6a39('0x22')](_0x2b7412);}catch(_0xcd9c9a){utils[_0x6a39('0x17')](util[_0x6a39('0x1c')](_0x6a39('0x23'),_0x2b7412[_0x6a39('0x21')]),_0xcd9c9a);}});ami['on'](_0x6a39('0x24'),function(_0x58836b){try{utils[_0x6a39('0x1b')](util[_0x6a39('0x1c')](_0x6a39('0x25'),_0x58836b['uniqueid']),_0x58836b);agents[_0x6a39('0x24')](_0x58836b);queues[_0x6a39('0x24')](_0x58836b);}catch(_0x4e81a7){utils[_0x6a39('0x17')](util[_0x6a39('0x1c')](_0x6a39('0x25'),_0x58836b[_0x6a39('0x21')]),_0x4e81a7);}});ami['on']('agentcomplete',function(_0x461141){try{utils[_0x6a39('0x1b')](util[_0x6a39('0x1c')]('[%s][index][agentcomplete]',_0x461141[_0x6a39('0x21')]),_0x461141);agents[_0x6a39('0x26')](_0x461141);queues[_0x6a39('0x26')](_0x461141);members[_0x6a39('0x26')](_0x461141);}catch(_0x49d50f){utils[_0x6a39('0x17')](util['format'](_0x6a39('0x27'),_0x461141[_0x6a39('0x21')]),_0x49d50f);}});ami['on']('queuecallerabandon',function(_0x58dfc9){try{utils[_0x6a39('0x1b')](util[_0x6a39('0x1c')](_0x6a39('0x28'),_0x58dfc9[_0x6a39('0x21')]),_0x58dfc9);agents['queuecallerabandon'](_0x58dfc9);queues[_0x6a39('0x29')](_0x58dfc9);}catch(_0x3e441b){utils[_0x6a39('0x17')](util[_0x6a39('0x1c')](_0x6a39('0x28'),_0x58dfc9['uniqueid']),_0x3e441b);}});ami['on']('queuecallerjoin',function(_0x9b3c25){try{utils['debug'](util[_0x6a39('0x1c')]('[%s][index][queuecallerjoin]',_0x9b3c25[_0x6a39('0x21')]),_0x9b3c25);queues[_0x6a39('0x2a')](_0x9b3c25);recordings['queuecallerjoin'](_0x9b3c25);}catch(_0x39adf5){utils['error'](util[_0x6a39('0x1c')](_0x6a39('0x2b'),_0x9b3c25[_0x6a39('0x21')]),_0x39adf5);}});ami['on'](_0x6a39('0x2c'),function(_0xff1429){try{utils[_0x6a39('0x1b')](util['format']('[%s][index][queuecallerleave]',_0xff1429[_0x6a39('0x21')]),_0xff1429);queues[_0x6a39('0x2c')](_0xff1429);}catch(_0x4cbbc3){utils[_0x6a39('0x17')](util[_0x6a39('0x1c')]('[%s][index][queuecallerleave]',_0xff1429[_0x6a39('0x21')]),_0x4cbbc3);}});ami['on'](_0x6a39('0x2d'),function(_0x1d829b){try{utils[_0x6a39('0x1b')](util['format']('[%s][index][musiconholdstart]',_0x1d829b[_0x6a39('0x21')]),_0x1d829b);queues[_0x6a39('0x2d')](_0x1d829b);calls[_0x6a39('0x2d')](_0x1d829b);}catch(_0x312e7c){utils['error'](util[_0x6a39('0x1c')](_0x6a39('0x2e'),_0x1d829b[_0x6a39('0x21')]),_0x312e7c);}});ami['on'](_0x6a39('0x2f'),function(_0x430ea4){try{utils[_0x6a39('0x1b')](util[_0x6a39('0x1c')](_0x6a39('0x30'),_0x430ea4[_0x6a39('0x21')]),_0x430ea4);queues[_0x6a39('0x2f')](_0x430ea4);calls[_0x6a39('0x2f')](_0x430ea4);}catch(_0x28761a){utils[_0x6a39('0x17')](util[_0x6a39('0x1c')](_0x6a39('0x30'),_0x430ea4[_0x6a39('0x21')]),_0x28761a);}});ami['on'](_0x6a39('0x31'),function(_0x457dcb){try{utils[_0x6a39('0x1b')](util[_0x6a39('0x1c')](_0x6a39('0x32'),_0x457dcb[_0x6a39('0x21')]),_0x457dcb);calls[_0x6a39('0x31')](_0x457dcb);recordings['newstate'](_0x457dcb);}catch(_0xcaf262){utils[_0x6a39('0x17')](util['format'](_0x6a39('0x32'),_0x457dcb[_0x6a39('0x21')]),_0xcaf262);}});ami['on'](_0x6a39('0x33'),function(_0x3961d3){try{utils[_0x6a39('0x1b')](util[_0x6a39('0x1c')](_0x6a39('0x34'),_0x3961d3[_0x6a39('0x21')]),_0x3961d3);calls[_0x6a39('0x33')](_0x3961d3);recordings[_0x6a39('0x33')](_0x3961d3);dials[_0x6a39('0x33')](_0x3961d3);agents[_0x6a39('0x33')](_0x3961d3);queues[_0x6a39('0x33')](_0x3961d3);}catch(_0x46b867){utils[_0x6a39('0x17')](util[_0x6a39('0x1c')](_0x6a39('0x34'),_0x3961d3[_0x6a39('0x21')]),_0x46b867);}});ami['on'](_0x6a39('0x35'),function(_0x1358cc){try{utils[_0x6a39('0x1b')](util[_0x6a39('0x1c')](_0x6a39('0x36'),_0x1358cc['uniqueid']),_0x1358cc);members[_0x6a39('0x35')](_0x1358cc);}catch(_0xacc0d2){utils[_0x6a39('0x17')](util['format'](_0x6a39('0x36'),_0x1358cc['uniqueid']),_0xacc0d2);}});ami['on'](_0x6a39('0x37'),function(_0x12867f){try{utils[_0x6a39('0x1b')](util['format']('[%s][index][blindtransfer]',_0x12867f['uniqueid']),_0x12867f);queues['blindtransfer'](_0x12867f);agents[_0x6a39('0x37')](_0x12867f);transfers[_0x6a39('0x37')](_0x12867f);recordings[_0x6a39('0x37')](_0x12867f);}catch(_0x1772c5){utils[_0x6a39('0x17')](util[_0x6a39('0x1c')](_0x6a39('0x38'),_0x12867f[_0x6a39('0x21')]),_0x1772c5);}});ami['on'](_0x6a39('0x39'),function(_0x44ea45){try{utils[_0x6a39('0x1b')](util[_0x6a39('0x1c')](_0x6a39('0x3a'),_0x44ea45['origtransfereruniqueid']),_0x44ea45);queues['attendedtransfer'](_0x44ea45);transfers['attendedtransfer'](_0x44ea45);agents[_0x6a39('0x39')](_0x44ea45);calls['attendedtransfer'](_0x44ea45);}catch(_0xba4dfb){utils[_0x6a39('0x17')](util['format'](_0x6a39('0x3a'),_0x44ea45[_0x6a39('0x3b')]),_0xba4dfb);}});ami['on'](_0x6a39('0x3c'),function(_0xbc8fc5){try{utils[_0x6a39('0x1b')](util['format'](_0x6a39('0x3d'),_0xbc8fc5[_0x6a39('0x21')]),_0xbc8fc5);queues[_0x6a39('0x3c')](_0xbc8fc5);recordings[_0x6a39('0x3c')](_0xbc8fc5);calls[_0x6a39('0x3c')](_0xbc8fc5);dials[_0x6a39('0x3c')](_0xbc8fc5);}catch(_0x2a54ab){utils['error'](util[_0x6a39('0x1c')]('[%s][index][varset]',_0xbc8fc5[_0x6a39('0x21')]),_0x2a54ab);}});ami['on'](_0x6a39('0x3e'),function(_0x358481){try{utils[_0x6a39('0x1b')](util[_0x6a39('0x1c')]('[%s][index][newexten]',_0x358481[_0x6a39('0x21')]),_0x358481);calls[_0x6a39('0x3e')](_0x358481);recordings['newexten'](_0x358481);dials[_0x6a39('0x3e')](_0x358481);}catch(_0x52f591){utils[_0x6a39('0x17')](util['format'](_0x6a39('0x3f'),_0x358481['uniqueid']),_0x52f591);}});ami['on']('newchannel',function(_0x5eea97){try{utils[_0x6a39('0x1b')](util[_0x6a39('0x1c')]('[%s][index][newchannel]',_0x5eea97['uniqueid']),_0x5eea97);calls[_0x6a39('0x40')](_0x5eea97);recordings[_0x6a39('0x40')](_0x5eea97);}catch(_0x535ad3){utils[_0x6a39('0x17')](util[_0x6a39('0x1c')](_0x6a39('0x41'),_0x5eea97[_0x6a39('0x21')]),_0x535ad3);}});ami['on'](_0x6a39('0x42'),function(_0x1b3806){try{utils[_0x6a39('0x1b')](util['format'](_0x6a39('0x43'),_0x1b3806['uniqueid']),_0x1b3806);dials[_0x6a39('0x42')](_0x1b3806);}catch(_0x482cba){utils[_0x6a39('0x17')](util[_0x6a39('0x1c')]('[%s]dialbegin',_0x1b3806[_0x6a39('0x21')]),_0x482cba);}});ami['on'](_0x6a39('0x44'),function(_0x495190){try{utils['debug'](util[_0x6a39('0x1c')](_0x6a39('0x45'),_0x495190[_0x6a39('0x21')]),_0x495190);dials[_0x6a39('0x44')](_0x495190);}catch(_0x1e0f42){utils['error'](util[_0x6a39('0x1c')]('[%s][index][dialend]',_0x495190['uniqueid']),_0x1e0f42);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 457567e..12a4546 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 _0xbb6b=['state','INUSE','BUSY','voice','now','agent','NOT_INUSE','diffTime','exitAt','enterAt','[%s][members][devicestatechange]','agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','util','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','interface','split','catch','error','format','[%s][members][writeDB]','uniqueid','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s'];(function(_0x8bb4c1,_0x2d6e53){var _0x67a6e1=function(_0x1155e5){while(--_0x1155e5){_0x8bb4c1['push'](_0x8bb4c1['shift']());}};_0x67a6e1(++_0x2d6e53);}(_0xbb6b,0x17e));var _0xbbb6=function(_0x2f050f,_0x5f3b10){_0x2f050f=_0x2f050f-0x0;var _0x26c1df=_0xbb6b[_0x2f050f];return _0x26c1df;};'use strict';var _=require('lodash');var util=require(_0xbbb6('0x0'));var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x2d6406){utils[_0xbbb6('0x1')](util['format'](_0xbbb6('0x2'),_0x2d6406['uniqueid'],_0x2d6406['interface'],_0x2d6406[_0xbbb6('0x3')],_0x2d6406[_0xbbb6('0x4')],_0x2d6406[_0xbbb6('0x5')],_0x2d6406[_0xbbb6('0x6')]));if(_0x2d6406['interface']){utils[_0xbbb6('0x7')](_0x2d6406['interface'])[_0xbbb6('0x8')](function(_0x4745fc){if(_0x4745fc){_0x2d6406[_0xbbb6('0x5')]=_0x4745fc[_0xbbb6('0x9')];_0x2d6406[_0xbbb6('0xa')]=_0x4745fc[_0xbbb6('0xa')];utils[_0xbbb6('0xb')](_0xbbb6('0xc'),_0x2d6406);}else{utils[_0xbbb6('0xd')](_0x2d6406[_0xbbb6('0xe')][_0xbbb6('0xf')]('/')[0x1])[_0xbbb6('0x8')](function(_0x2fc7a4){if(_0x2fc7a4){_0x2d6406[_0xbbb6('0x5')]=_0x2fc7a4[_0xbbb6('0x9')];_0x2d6406[_0xbbb6('0xa')]=_0x2fc7a4[_0xbbb6('0xa')];utils['request'](_0xbbb6('0xc'),_0x2d6406);}});}})[_0xbbb6('0x10')](function(_0x1a2171){utils[_0xbbb6('0x11')](util[_0xbbb6('0x12')](_0xbbb6('0x13'),_0x2d6406[_0xbbb6('0x14')]),_0x1a2171);});}delete members[_0x2d6406[_0xbbb6('0xe')]];}function startsWith(_0x89f666,_0x3b36a5){return _['some'](_0x89f666,function(_0x3eea0b){return _[_0xbbb6('0x15')](_0x3b36a5,_0x3eea0b);});}exports[_0xbbb6('0x16')]=function(_0x5b069e){try{utils[_0xbbb6('0x17')](util['format']('[%s][members][devicestatechange]',members[_0x5b069e[_0xbbb6('0x18')]]?members[_0x5b069e[_0xbbb6('0x18')]][_0xbbb6('0x14')]:_0x5b069e['device']),_0x5b069e);utils[_0xbbb6('0x1')](util[_0xbbb6('0x12')](_0xbbb6('0x19'),members[_0x5b069e[_0xbbb6('0x18')]]?members[_0x5b069e['device']]['uniqueid']:_0x5b069e[_0xbbb6('0x18')],_0x5b069e[_0xbbb6('0x1a')],_0x5b069e['device']));switch(_0x5b069e['state']){case _0xbbb6('0x1b'):case _0xbbb6('0x1c'):if(!startsWith(exclude,_0x5b069e[_0xbbb6('0x18')])){members[_0x5b069e['device']]={'channel':_0xbbb6('0x1d'),'interface':_0x5b069e[_0xbbb6('0x18')],'type':'TALKING','enterAt':utils[_0xbbb6('0x1e')](),'role':_0xbbb6('0x1f')};}break;case _0xbbb6('0x20'):if(!_['isNil'](members[_0x5b069e[_0xbbb6('0x18')]])){members[_0x5b069e['device']]['exitAt']=utils['now']();members[_0x5b069e[_0xbbb6('0x18')]]['duration']=utils[_0xbbb6('0x21')](members[_0x5b069e[_0xbbb6('0x18')]][_0xbbb6('0x22')],members[_0x5b069e[_0xbbb6('0x18')]][_0xbbb6('0x23')]);if(members[_0x5b069e[_0xbbb6('0x18')]]['uniqueid']){writeDB(members[_0x5b069e[_0xbbb6('0x18')]]);}}break;default:break;}}catch(_0x5abd83){utils[_0xbbb6('0x11')](util[_0xbbb6('0x12')](_0xbbb6('0x24'),members[_0x5b069e[_0xbbb6('0x18')]]?members[_0x5b069e[_0xbbb6('0x18')]][_0xbbb6('0x14')]:_0x5b069e['device']),_0x5abd83);}};exports[_0xbbb6('0x25')]=function(_0xff31a4){try{if(!_[_0xbbb6('0x26')](members[_0xff31a4[_0xbbb6('0xe')]])){utils[_0xbbb6('0x17')](util['format'](_0xbbb6('0x27'),_0xff31a4[_0xbbb6('0x14')]),_0xff31a4);utils[_0xbbb6('0x1')](util[_0xbbb6('0x12')](_0xbbb6('0x28'),_0xff31a4[_0xbbb6('0x14')],_0xff31a4[_0xbbb6('0xe')],_0xff31a4[_0xbbb6('0x29')]));members[_0xff31a4[_0xbbb6('0xe')]]=_[_0xbbb6('0x2a')](members[_0xff31a4['interface']],{'data4':_0xff31a4[_0xbbb6('0x29')],'uniqueid':_0xff31a4[_0xbbb6('0x14')]});}}catch(_0x108bcb){utils[_0xbbb6('0x11')](util[_0xbbb6('0x12')]('[%s][members][agentcomplete]',_0xff31a4[_0xbbb6('0x14')]),_0x108bcb);}};exports[_0xbbb6('0x2b')]=function(_0x4bbe05){try{utils[_0xbbb6('0x17')](util[_0xbbb6('0x12')](_0xbbb6('0x2c'),_0x4bbe05[_0xbbb6('0x14')]),_0x4bbe05);if(_0x4bbe05['channel']){var _0x394213=_0x4bbe05['channel']['split']('-')[0x0];if(!_['isNil'](members[_0x394213])){members[_0x394213]=_[_0xbbb6('0x2a')](members[_0x394213],{'data1':members[_0x394213][_0xbbb6('0x2d')]||_0x4bbe05[_0xbbb6('0x6')],'data2':members[_0x394213][_0xbbb6('0x4')]||_0x4bbe05[_0xbbb6('0x2e')],'data3':members[_0x394213]['data3']||_0x4bbe05[_0xbbb6('0x2f')],'uniqueid':members[_0x394213][_0xbbb6('0x14')]||_0x4bbe05[_0xbbb6('0x14')]});utils['info'](util[_0xbbb6('0x12')](_0xbbb6('0x30'),_0x4bbe05[_0xbbb6('0x14')],members[_0x394213]['data1'],members[_0x394213][_0xbbb6('0x4')],members[_0x394213][_0xbbb6('0x31')]));if(members[_0x394213][_0xbbb6('0x22')]){writeDB(members[_0x394213]);}}}if(_0x4bbe05[_0xbbb6('0x32')]){var _0x29f327=_0x4bbe05[_0xbbb6('0x32')][_0xbbb6('0xf')]('-')[0x0];if(!_[_0xbbb6('0x26')](members[_0x29f327])){members[_0x29f327]=_[_0xbbb6('0x2a')](members[_0x29f327],{'data1':members[_0x29f327][_0xbbb6('0x2d')]||_0x4bbe05['type'],'data2':members[_0x29f327]['data2']||_0x4bbe05[_0xbbb6('0x2e')],'data3':members[_0x29f327]['data3']||_0x4bbe05[_0xbbb6('0x2f')],'uniqueid':members[_0x29f327][_0xbbb6('0x14')]||_0x4bbe05[_0xbbb6('0x14')]});utils['info'](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x4bbe05['uniqueid'],members[_0x29f327]['data1'],members[_0x29f327][_0xbbb6('0x4')],members[_0x29f327]['data3']));if(members[_0x29f327]['exitAt']){writeDB(members[_0x29f327]);}}}}catch(_0x7cc19d){utils[_0xbbb6('0x11')](util[_0xbbb6('0x12')]('[%s][members][cdr]',_0x4bbe05[_0xbbb6('0x14')]),_0x7cc19d);}}; \ No newline at end of file +var _0x70d8=['data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','membername','type','getUserByInterface','internal','request','CreateMemberReport','getUserByName','split','then','catch','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','diffTime','error','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','channel','data1','data2','source'];(function(_0x1df0cd,_0x5170a0){var _0x13286d=function(_0x884c08){while(--_0x884c08){_0x1df0cd['push'](_0x1df0cd['shift']());}};_0x13286d(++_0x5170a0);}(_0x70d8,0xa9));var _0x870d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x70d8[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x870d('0x0'));var util=require(_0x870d('0x1'));var utils=require(_0x870d('0x2'));var members={};var exclude=[_0x870d('0x3'),_0x870d('0x4')];function writeDB(_0x13ba75){utils[_0x870d('0x5')](util[_0x870d('0x6')](_0x870d('0x7'),_0x13ba75['uniqueid'],_0x13ba75[_0x870d('0x8')],_0x13ba75['channel'],_0x13ba75['data2'],_0x13ba75[_0x870d('0x9')],_0x13ba75[_0x870d('0xa')]));if(_0x13ba75[_0x870d('0x8')]){utils[_0x870d('0xb')](_0x13ba75['interface'])['then'](function(_0x322f22){if(_0x322f22){_0x13ba75[_0x870d('0x9')]=_0x322f22['name'];_0x13ba75[_0x870d('0xc')]=_0x322f22[_0x870d('0xc')];utils[_0x870d('0xd')](_0x870d('0xe'),_0x13ba75);}else{utils[_0x870d('0xf')](_0x13ba75[_0x870d('0x8')][_0x870d('0x10')]('/')[0x1])[_0x870d('0x11')](function(_0x6b83aa){if(_0x6b83aa){_0x13ba75[_0x870d('0x9')]=_0x6b83aa['name'];_0x13ba75[_0x870d('0xc')]=_0x6b83aa['internal'];utils[_0x870d('0xd')](_0x870d('0xe'),_0x13ba75);}});}})[_0x870d('0x12')](function(_0x34b1ca){utils['error'](util[_0x870d('0x6')](_0x870d('0x13'),_0x13ba75[_0x870d('0x14')]),_0x34b1ca);});}delete members[_0x13ba75[_0x870d('0x8')]];}function startsWith(_0x36a1b4,_0x1869d9){return _[_0x870d('0x15')](_0x36a1b4,function(_0xc7fda){return _[_0x870d('0x16')](_0x1869d9,_0xc7fda);});}exports[_0x870d('0x17')]=function(_0x5ce57f){try{utils[_0x870d('0x18')](util['format'](_0x870d('0x19'),members[_0x5ce57f[_0x870d('0x1a')]]?members[_0x5ce57f[_0x870d('0x1a')]][_0x870d('0x14')]:_0x5ce57f[_0x870d('0x1a')]),_0x5ce57f);utils[_0x870d('0x5')](util[_0x870d('0x6')](_0x870d('0x1b'),members[_0x5ce57f[_0x870d('0x1a')]]?members[_0x5ce57f['device']][_0x870d('0x14')]:_0x5ce57f[_0x870d('0x1a')],_0x5ce57f[_0x870d('0x1c')],_0x5ce57f[_0x870d('0x1a')]));switch(_0x5ce57f[_0x870d('0x1c')]){case _0x870d('0x1d'):case _0x870d('0x1e'):if(!startsWith(exclude,_0x5ce57f[_0x870d('0x1a')])){members[_0x5ce57f[_0x870d('0x1a')]]={'channel':_0x870d('0x1f'),'interface':_0x5ce57f[_0x870d('0x1a')],'type':_0x870d('0x20'),'enterAt':utils[_0x870d('0x21')](),'role':_0x870d('0x22')};}break;case _0x870d('0x23'):if(!_[_0x870d('0x24')](members[_0x5ce57f[_0x870d('0x1a')]])){members[_0x5ce57f[_0x870d('0x1a')]][_0x870d('0x25')]=utils[_0x870d('0x21')]();members[_0x5ce57f['device']]['duration']=utils[_0x870d('0x26')](members[_0x5ce57f[_0x870d('0x1a')]][_0x870d('0x25')],members[_0x5ce57f[_0x870d('0x1a')]]['enterAt']);if(members[_0x5ce57f[_0x870d('0x1a')]]['uniqueid']){writeDB(members[_0x5ce57f[_0x870d('0x1a')]]);}}break;default:break;}}catch(_0x4698b1){utils[_0x870d('0x27')](util['format'](_0x870d('0x19'),members[_0x5ce57f[_0x870d('0x1a')]]?members[_0x5ce57f[_0x870d('0x1a')]][_0x870d('0x14')]:_0x5ce57f[_0x870d('0x1a')]),_0x4698b1);}};exports[_0x870d('0x28')]=function(_0x3e6191){try{if(!_['isNil'](members[_0x3e6191['interface']])){utils[_0x870d('0x18')](util[_0x870d('0x6')](_0x870d('0x29'),_0x3e6191[_0x870d('0x14')]),_0x3e6191);utils[_0x870d('0x5')](util['format'](_0x870d('0x2a'),_0x3e6191[_0x870d('0x14')],_0x3e6191[_0x870d('0x8')],_0x3e6191[_0x870d('0x2b')]));members[_0x3e6191[_0x870d('0x8')]]=_[_0x870d('0x2c')](members[_0x3e6191['interface']],{'data4':_0x3e6191[_0x870d('0x2b')],'uniqueid':_0x3e6191['uniqueid']});}}catch(_0x47b916){utils[_0x870d('0x27')](util['format'](_0x870d('0x29'),_0x3e6191[_0x870d('0x14')]),_0x47b916);}};exports[_0x870d('0x2d')]=function(_0x254c6b){try{utils[_0x870d('0x18')](util[_0x870d('0x6')](_0x870d('0x2e'),_0x254c6b['uniqueid']),_0x254c6b);if(_0x254c6b[_0x870d('0x2f')]){var _0x41b272=_0x254c6b[_0x870d('0x2f')][_0x870d('0x10')]('-')[0x0];if(!_[_0x870d('0x24')](members[_0x41b272])){members[_0x41b272]=_[_0x870d('0x2c')](members[_0x41b272],{'data1':members[_0x41b272][_0x870d('0x30')]||_0x254c6b[_0x870d('0xa')],'data2':members[_0x41b272][_0x870d('0x31')]||_0x254c6b[_0x870d('0x32')],'data3':members[_0x41b272][_0x870d('0x33')]||_0x254c6b[_0x870d('0x34')],'uniqueid':members[_0x41b272]['uniqueid']||_0x254c6b[_0x870d('0x14')]});utils['info'](util[_0x870d('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x254c6b[_0x870d('0x14')],members[_0x41b272][_0x870d('0x30')],members[_0x41b272][_0x870d('0x31')],members[_0x41b272][_0x870d('0x33')]));if(members[_0x41b272][_0x870d('0x25')]){writeDB(members[_0x41b272]);}}}if(_0x254c6b[_0x870d('0x35')]){var _0xd96fa7=_0x254c6b['destinationchannel'][_0x870d('0x10')]('-')[0x0];if(!_['isNil'](members[_0xd96fa7])){members[_0xd96fa7]=_[_0x870d('0x2c')](members[_0xd96fa7],{'data1':members[_0xd96fa7][_0x870d('0x30')]||_0x254c6b[_0x870d('0xa')],'data2':members[_0xd96fa7]['data2']||_0x254c6b['source'],'data3':members[_0xd96fa7][_0x870d('0x33')]||_0x254c6b[_0x870d('0x34')],'uniqueid':members[_0xd96fa7][_0x870d('0x14')]||_0x254c6b['uniqueid']});utils[_0x870d('0x5')](util[_0x870d('0x6')](_0x870d('0x36'),_0x254c6b[_0x870d('0x14')],members[_0xd96fa7][_0x870d('0x30')],members[_0xd96fa7][_0x870d('0x31')],members[_0xd96fa7][_0x870d('0x33')]));if(members[_0xd96fa7]['exitAt']){writeDB(members[_0xd96fa7]);}}}}catch(_0x5140a2){utils[_0x870d('0x27')](util[_0x870d('0x6')]('[%s][members][cdr]',_0x254c6b[_0x870d('0x14')]),_0x5140a2);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 50b0294..755faba 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 _0x24f0=['musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','varset','[%s][queues][varset]','queuestatus','toUpperCase','queuecallerabandonAt','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','error','[%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','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','[%s][queues][agentcomplete]','membername','reason','transfer','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transfertype','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transferuniqueid','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s'];(function(_0x46770b,_0x4cfd1e){var _0x20f7c2=function(_0x319a86){while(--_0x319a86){_0x46770b['push'](_0x46770b['shift']());}};_0x20f7c2(++_0x4cfd1e);}(_0x24f0,0xd1));var _0x024f=function(_0x5f0027,_0x276f5e){_0x5f0027=_0x5f0027-0x0;var _0x4329e8=_0x24f0[_0x5f0027];return _0x4329e8;};'use strict';var _=require(_0x024f('0x0'));var util=require('util');var utils=require(_0x024f('0x1'));var queues={};function writeDB(_0x239538){utils[_0x024f('0x2')](util[_0x024f('0x3')](_0x024f('0x4'),_0x239538[_0x024f('0x5')],_0x239538[_0x024f('0x6')],_0x239538[_0x024f('0x7')],_0x239538[_0x024f('0x8')],_0x239538[_0x024f('0x9')],_0x239538[_0x024f('0xa')],_0x239538['queuecallerexitreason']));if(_0x239538['queue']){utils[_0x024f('0xb')](_0x239538[_0x024f('0x7')])[_0x024f('0xc')](function(_0x57473f){if(_0x57473f){_0x239538[_0x024f('0xd')]=_0x57473f[_0x024f('0xd')];}utils[_0x024f('0xe')](_0x024f('0xf'),_0x239538);});}else{utils['request'](_0x024f('0xf'),_0x239538);}if(_0x239538[_0x024f('0x10')]){delete queues[_0x239538[_0x024f('0x10')]];}else{delete queues[_0x239538[_0x024f('0x5')]];}}exports['queuecallerjoin']=function(_0x14a056){try{utils[_0x024f('0x11')](util[_0x024f('0x3')](_0x024f('0x12'),_0x14a056[_0x024f('0x5')]),_0x14a056);utils['info'](util[_0x024f('0x3')](_0x024f('0x13'),_0x14a056[_0x024f('0x5')],_0x14a056[_0x024f('0x7')],_0x14a056[_0x024f('0x14')]));queues[_0x14a056['uniqueid']]=_['assign'](_0x14a056,{'originalposition':_0x14a056[_0x024f('0x14')],'queuecallerjoinAt':utils[_0x024f('0x15')](),'mohtime':0x0});}catch(_0xa5926b){utils['error'](util[_0x024f('0x3')](_0x024f('0x12'),_0x14a056['uniqueid']),_0xa5926b);}};exports[_0x024f('0x16')]=function(_0x1a29f5){try{if(!_[_0x024f('0x17')](queues[_0x1a29f5[_0x024f('0x5')]])){utils[_0x024f('0x11')](util[_0x024f('0x3')](_0x024f('0x18'),_0x1a29f5[_0x024f('0x5')]),_0x1a29f5);if(queues[_0x1a29f5['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x1a29f5[_0x024f('0x5')]][_0x024f('0x19')]&&!queues[_0x1a29f5['uniqueid']][_0x024f('0x1a')]){queues[_0x1a29f5['uniqueid']][_0x024f('0x1b')]=!![];queues[_0x1a29f5[_0x024f('0x5')]][_0x024f('0x1c')]=utils[_0x024f('0x15')]();queues[_0x1a29f5['uniqueid']][_0x024f('0x1d')]='COMPLETEDBYAGENT';}utils[_0x024f('0x2')](util[_0x024f('0x3')](_0x024f('0x1e'),_0x1a29f5[_0x024f('0x5')],queues[_0x1a29f5[_0x024f('0x5')]][_0x024f('0x1f')],queues[_0x1a29f5['uniqueid']][_0x024f('0x1d')]));writeDB(queues[_0x1a29f5[_0x024f('0x5')]]);}else if(queues[_0x1a29f5[_0x024f('0x5')]][_0x024f('0x10')]){utils[_0x024f('0x2')](util[_0x024f('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x1a29f5[_0x024f('0x5')],queues[_0x1a29f5['uniqueid']]['name'],queues[_0x1a29f5[_0x024f('0x5')]][_0x024f('0x10')]));queues[queues[_0x1a29f5['uniqueid']][_0x024f('0x10')]]=queues[_0x1a29f5[_0x024f('0x5')]];queues[queues[_0x1a29f5[_0x024f('0x5')]][_0x024f('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0x1a29f5[_0x024f('0x5')]];}}}catch(_0x37d8a3){utils['error'](util[_0x024f('0x3')](_0x024f('0x18'),_0x1a29f5['uniqueid']),_0x37d8a3);}};exports[_0x024f('0x20')]=function(_0x23f94e){try{utils[_0x024f('0x11')](util[_0x024f('0x3')](_0x024f('0x21'),_0x23f94e[_0x024f('0x5')]),_0x23f94e);if(!_[_0x024f('0x17')](_0x23f94e['variable'][_0x024f('0x22')])&&_0x23f94e['value'][_0x024f('0x23')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x23f94e[_0x024f('0x5')]])){queues[_0x23f94e[_0x024f('0x5')]][_0x024f('0x19')]=![];queues[_0x23f94e['uniqueid']][_0x024f('0x24')]=null;queues[_0x23f94e[_0x024f('0x5')]][_0x024f('0x1a')]=!![];queues[_0x23f94e[_0x024f('0x5')]][_0x024f('0x25')]=utils[_0x024f('0x15')]();queues[_0x23f94e[_0x024f('0x5')]][_0x024f('0x1d')]=_0x23f94e[_0x024f('0x26')][_0x024f('0x23')]();utils['info'](util[_0x024f('0x3')](_0x024f('0x27'),_0x23f94e[_0x024f('0x5')],queues[_0x23f94e[_0x024f('0x5')]][_0x024f('0x1f')],_0x23f94e[_0x024f('0x26')],queues[_0x23f94e[_0x024f('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x23f94e[_0x024f('0x5')]]);}}else if(!_[_0x024f('0x17')](_0x23f94e[_0x024f('0x28')][_0x024f('0x29')])){if(!_[_0x024f('0x17')](queues[_0x23f94e[_0x024f('0x5')]])&&!queues[_0x23f94e['uniqueid']]['queuecallerabandon']){queues[_0x23f94e['uniqueid']][_0x024f('0x19')]=![];queues[_0x23f94e[_0x024f('0x5')]][_0x024f('0x24')]=null;queues[_0x23f94e[_0x024f('0x5')]][_0x024f('0x1a')]=!![];queues[_0x23f94e['uniqueid']][_0x024f('0x25')]=utils[_0x024f('0x15')]();queues[_0x23f94e[_0x024f('0x5')]]['queuecallerexitreason']='EXITWITHKEY';utils['info'](util[_0x024f('0x3')](_0x024f('0x2a'),_0x23f94e[_0x024f('0x5')],queues[_0x23f94e[_0x024f('0x5')]][_0x024f('0x1f')],_0x23f94e[_0x024f('0x26')],queues[_0x23f94e[_0x024f('0x5')]][_0x024f('0x1d')]));}}}catch(_0x1fb21d){utils[_0x024f('0x2b')](util[_0x024f('0x3')](_0x024f('0x21'),_0x23f94e[_0x024f('0x5')]),_0x1fb21d);}};exports[_0x024f('0x19')]=function(_0x499c7e){try{if(!_['isNil'](queues[_0x499c7e['uniqueid']])){utils[_0x024f('0x11')](util[_0x024f('0x3')](_0x024f('0x2c'),_0x499c7e[_0x024f('0x5')]),_0x499c7e);queues[_0x499c7e[_0x024f('0x5')]][_0x024f('0x1a')]=![];queues[_0x499c7e[_0x024f('0x5')]][_0x024f('0x25')]=null;queues[_0x499c7e[_0x024f('0x5')]][_0x024f('0x19')]=!![];queues[_0x499c7e[_0x024f('0x5')]][_0x024f('0x24')]=utils['now']();queues[_0x499c7e[_0x024f('0x5')]]['queuecallerexitreason']=_0x024f('0x2d');utils['info'](util[_0x024f('0x3')](_0x024f('0x2e'),_0x499c7e[_0x024f('0x5')],queues[_0x499c7e['uniqueid']][_0x024f('0x1f')],queues[_0x499c7e[_0x024f('0x5')]]['queuecallerexitreason']));}}catch(_0x24a60c){utils[_0x024f('0x2b')](util[_0x024f('0x3')](_0x024f('0x2c'),_0x499c7e[_0x024f('0x5')]),_0x24a60c);}};exports[_0x024f('0x2f')]=function(_0x62daf8){try{if(!_[_0x024f('0x17')](queues[_0x62daf8[_0x024f('0x5')]])){utils['debug'](util[_0x024f('0x3')](_0x024f('0x30'),_0x62daf8['uniqueid']),_0x62daf8);utils[_0x024f('0x2')](util['format'](_0x024f('0x31'),_0x62daf8[_0x024f('0x5')],queues[_0x62daf8['uniqueid']][_0x024f('0x1f')],_0x62daf8[_0x024f('0x32')],_0x62daf8[_0x024f('0x33')]));queues[_0x62daf8['uniqueid']][_0x024f('0x2f')]=!![];queues[_0x62daf8[_0x024f('0x5')]][_0x024f('0x34')]=utils[_0x024f('0x15')]();queues[_0x62daf8[_0x024f('0x5')]][_0x024f('0x35')]=utils[_0x024f('0x36')](queues[_0x62daf8[_0x024f('0x5')]][_0x024f('0x34')],queues[_0x62daf8[_0x024f('0x5')]][_0x024f('0x37')]);queues[_0x62daf8['uniqueid']][_0x024f('0x14')]=_0x62daf8[_0x024f('0x14')];queues[_0x62daf8[_0x024f('0x5')]][_0x024f('0x38')]=_0x62daf8[_0x024f('0x38')];queues[_0x62daf8[_0x024f('0x5')]]['connectedlinenum']=_0x62daf8['connectedlinenum'];queues[_0x62daf8[_0x024f('0x5')]][_0x024f('0x33')]=_0x62daf8['connectedlinename'];}}catch(_0x482c29){utils[_0x024f('0x2b')](util[_0x024f('0x3')](_0x024f('0x30'),_0x62daf8[_0x024f('0x5')]),_0x482c29);}};exports[_0x024f('0x39')]=function(_0x181416){try{if(!_[_0x024f('0x17')](queues[_0x181416[_0x024f('0x5')]])){utils[_0x024f('0x11')](util[_0x024f('0x3')](_0x024f('0x3a'),_0x181416['uniqueid']),_0x181416);utils[_0x024f('0x2')](util[_0x024f('0x3')](_0x024f('0x3b'),_0x181416[_0x024f('0x5')],queues[_0x181416[_0x024f('0x5')]][_0x024f('0x1f')],_0x181416['membername'],_0x181416[_0x024f('0x3c')]));queues[_0x181416[_0x024f('0x5')]][_0x024f('0x19')]=![];queues[_0x181416[_0x024f('0x5')]]['queuecallerabandon']=![];queues[_0x181416['uniqueid']][_0x024f('0x24')]=null;queues[_0x181416['uniqueid']]['queuecallerexit']=![];queues[_0x181416[_0x024f('0x5')]][_0x024f('0x1d')]=null;queues[_0x181416['uniqueid']][_0x024f('0x25')]=null;queues[_0x181416[_0x024f('0x5')]][_0x024f('0x3d')]=!![];queues[_0x181416[_0x024f('0x5')]][_0x024f('0xa')]=_0x181416[_0x024f('0x3c')];queues[_0x181416[_0x024f('0x5')]]['lastAssignedTo']=_0x181416['membername'];}}catch(_0x35952b){utils[_0x024f('0x2b')](util[_0x024f('0x3')](_0x024f('0x3a'),_0x181416[_0x024f('0x5')]),_0x35952b);}};exports['agentcomplete']=function(_0x2a5e99){try{if(!_[_0x024f('0x17')](queues[_0x2a5e99[_0x024f('0x5')]])){if(queues[_0x2a5e99[_0x024f('0x5')]][_0x024f('0x34')]){utils[_0x024f('0x11')](util['format'](_0x024f('0x3e'),_0x2a5e99[_0x024f('0x5')]),_0x2a5e99);queues[_0x2a5e99[_0x024f('0x5')]][_0x024f('0x19')]=![];queues[_0x2a5e99[_0x024f('0x5')]][_0x024f('0x19')]=![];queues[_0x2a5e99[_0x024f('0x5')]][_0x024f('0x24')]=null;queues[_0x2a5e99[_0x024f('0x5')]][_0x024f('0x1a')]=![];queues[_0x2a5e99[_0x024f('0x5')]][_0x024f('0x25')]=null;queues[_0x2a5e99['uniqueid']][_0x024f('0x3d')]=!![];queues[_0x2a5e99[_0x024f('0x5')]]['lastAssignedTo']=_0x2a5e99[_0x024f('0x3f')];queues[_0x2a5e99[_0x024f('0x5')]][_0x024f('0x1b')]=!![];queues[_0x2a5e99['uniqueid']][_0x024f('0x1c')]=utils[_0x024f('0x15')]();if(_0x2a5e99[_0x024f('0x40')]==_0x024f('0x41')){if(!queues[_0x2a5e99[_0x024f('0x5')]]['transfer']){queues[_0x2a5e99[_0x024f('0x5')]][_0x024f('0x1d')]='TRANSFER';}}else{queues[_0x2a5e99[_0x024f('0x5')]]['queuecallerexitreason']=_0x024f('0x42')+_0x2a5e99[_0x024f('0x40')][_0x024f('0x23')]();}utils[_0x024f('0x2')](util[_0x024f('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x2a5e99[_0x024f('0x5')],queues[_0x2a5e99['uniqueid']][_0x024f('0x1f')],_0x2a5e99[_0x024f('0x3f')],queues[_0x2a5e99[_0x024f('0x5')]][_0x024f('0x1d')]));writeDB(queues[_0x2a5e99[_0x024f('0x5')]]);}}}catch(_0x2535d6){utils['error'](util['format']('[%s][queues][agentcomplete]',_0x2a5e99[_0x024f('0x5')]),_0x2535d6);}};exports[_0x024f('0x43')]=function(_0x23c317){try{if(!_[_0x024f('0x17')](queues[_0x23c317[_0x024f('0x44')]])){utils[_0x024f('0x11')](util[_0x024f('0x3')](_0x024f('0x45'),_0x23c317[_0x024f('0x5')]),_0x23c317);queues[_0x23c317[_0x024f('0x44')]][_0x024f('0x41')]=!![];queues[_0x23c317[_0x024f('0x44')]]['transfertype']=_0x024f('0x46');queues[_0x23c317[_0x024f('0x44')]][_0x024f('0x47')]=_0x23c317[_0x024f('0x48')];queues[_0x23c317[_0x024f('0x44')]]['transferuniqueid']=_0x23c317[_0x024f('0x44')];queues[_0x23c317[_0x024f('0x44')]][_0x024f('0x1d')]=_0x024f('0x49');utils['info'](util[_0x024f('0x3')](_0x024f('0x4a'),_0x23c317[_0x024f('0x5')],queues[_0x23c317[_0x024f('0x44')]][_0x024f('0x1f')],_0x23c317[_0x024f('0x44')],_0x23c317[_0x024f('0x48')]));}}catch(_0x23364a){utils['error'](util['format'](_0x024f('0x45'),_0x23c317[_0x024f('0x5')]),_0x23364a);}};exports['attendedtransfer']=function(_0x4fac27){try{utils['debug'](util[_0x024f('0x3')]('[%s][queues][attendedtransfer]',_0x4fac27[_0x024f('0x4b')]),_0x4fac27);if(_0x4fac27[_0x024f('0x4b')]==_0x4fac27[_0x024f('0x4c')]){if(!_[_0x024f('0x17')](queues[_0x4fac27[_0x024f('0x4d')]])){utils[_0x024f('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x4fac27[_0x024f('0x4b')],queues[_0x4fac27[_0x024f('0x4d')]][_0x024f('0x1f')],_0x4fac27[_0x024f('0x4e')]));queues[_0x4fac27[_0x024f('0x4d')]][_0x024f('0x41')]=!![];queues[_0x4fac27[_0x024f('0x4d')]][_0x024f('0x4f')]=_0x024f('0x50');queues[_0x4fac27[_0x024f('0x4d')]][_0x024f('0x47')]=_0x4fac27[_0x024f('0x4e')];queues[_0x4fac27[_0x024f('0x4d')]]['transferuniqueid']=_0x4fac27['origtransfereruniqueid'];queues[_0x4fac27[_0x024f('0x4d')]]['queuecallerexitreason']=_0x024f('0x51');}if(!_[_0x024f('0x17')](queues[_0x4fac27[_0x024f('0x4c')]])){if(_0x4fac27[_0x024f('0x52')]&&queues[_0x4fac27[_0x024f('0x52')]]){queues[_0x4fac27[_0x024f('0x52')]][_0x024f('0x53')]=0x1;queues[_0x4fac27[_0x024f('0x44')]]=_[_0x024f('0x54')](queues[_0x4fac27[_0x024f('0x52')]]);queues[_0x4fac27[_0x024f('0x44')]]['transfereduniqueid']=_0x4fac27[_0x024f('0x55')];queues[_0x4fac27[_0x024f('0x44')]][_0x024f('0x53')]=0x2;queues[_0x4fac27[_0x024f('0x44')]][_0x024f('0x9')]=queues[_0x4fac27[_0x024f('0x4d')]][_0x024f('0x9')];queues[_0x4fac27[_0x024f('0x44')]][_0x024f('0x56')]=queues[_0x4fac27[_0x024f('0x4d')]]['calleridname'];queues[_0x4fac27[_0x024f('0x44')]][_0x024f('0x37')]=utils['now']();queues[_0x4fac27[_0x024f('0x44')]][_0x024f('0x34')]=utils['now']();queues[_0x4fac27[_0x024f('0x44')]][_0x024f('0x35')]=0x0;queues[_0x4fac27[_0x024f('0x44')]]['mohtime']=0x0;utils['info'](util[_0x024f('0x3')](_0x024f('0x57'),_0x4fac27[_0x024f('0x4b')],queues[_0x4fac27[_0x024f('0x44')]][_0x024f('0x1f')],queues[_0x4fac27[_0x024f('0x44')]]['calleridnum'],queues[_0x4fac27[_0x024f('0x44')]]['calleridname']));}else{utils[_0x024f('0x2')](util['format'](_0x024f('0x58'),_0x4fac27[_0x024f('0x4b')],queues[_0x4fac27[_0x024f('0x4c')]][_0x024f('0x1f')],_0x4fac27[_0x024f('0x4d')]));queues[_0x4fac27[_0x024f('0x4c')]][_0x024f('0x10')]=_0x4fac27[_0x024f('0x4d')];}}}else if(_0x4fac27[_0x024f('0x59')]==_0x4fac27[_0x024f('0x4d')]){if(!_['isNil'](queues[_0x4fac27['origtransfererlinkedid']])){utils['info'](util['format'](_0x024f('0x5a'),_0x4fac27['origtransfereruniqueid'],queues[_0x4fac27['origtransfererlinkedid']][_0x024f('0x1f')],_0x4fac27[_0x024f('0x59')],_0x4fac27[_0x024f('0x5b')]));queues[_0x4fac27[_0x024f('0x4c')]][_0x024f('0x41')]=!![];queues[_0x4fac27[_0x024f('0x4c')]][_0x024f('0x4f')]=_0x024f('0x50');queues[_0x4fac27[_0x024f('0x4c')]]['transferexten']=_0x4fac27[_0x024f('0x5b')];queues[_0x4fac27[_0x024f('0x4c')]][_0x024f('0x5c')]=_0x4fac27[_0x024f('0x59')];queues[_0x4fac27['origtransfererlinkedid']][_0x024f('0x1d')]=_0x024f('0x51');}if(!_[_0x024f('0x17')](queues[_0x4fac27[_0x024f('0x4d')]])){if(_0x4fac27[_0x024f('0x5d')]&&queues[_0x4fac27['transfertargetlinkedid']]){queues[_0x4fac27[_0x024f('0x5d')]][_0x024f('0x53')]=0x1;queues[_0x4fac27[_0x024f('0x55')]]=_[_0x024f('0x54')](queues[_0x4fac27['transfertargetlinkedid']]);queues[_0x4fac27[_0x024f('0x55')]][_0x024f('0x10')]=_0x4fac27[_0x024f('0x55')];queues[_0x4fac27['transfertargetuniqueid']][_0x024f('0x53')]=0x2;queues[_0x4fac27[_0x024f('0x55')]][_0x024f('0x9')]=queues[_0x4fac27[_0x024f('0x4c')]][_0x024f('0x9')];queues[_0x4fac27[_0x024f('0x55')]][_0x024f('0x56')]=queues[_0x4fac27[_0x024f('0x4c')]]['calleridname'];queues[_0x4fac27[_0x024f('0x55')]]['queuecallerjoinAt']=utils[_0x024f('0x15')]();queues[_0x4fac27[_0x024f('0x55')]][_0x024f('0x34')]=utils[_0x024f('0x15')]();queues[_0x4fac27['transfertargetuniqueid']][_0x024f('0x35')]=0x0;queues[_0x4fac27[_0x024f('0x55')]][_0x024f('0x5e')]=0x0;utils[_0x024f('0x2')](util['format'](_0x024f('0x5f'),_0x4fac27[_0x024f('0x4b')],queues[_0x4fac27[_0x024f('0x55')]]['name'],queues[_0x4fac27['transfertargetuniqueid']][_0x024f('0x10')],queues[_0x4fac27[_0x024f('0x55')]][_0x024f('0x9')],queues[_0x4fac27[_0x024f('0x55')]]['calleridname']));}else{utils[_0x024f('0x2')](util[_0x024f('0x3')](_0x024f('0x58'),_0x4fac27[_0x024f('0x4b')],queues[_0x4fac27[_0x024f('0x4d')]][_0x024f('0x1f')],_0x4fac27[_0x024f('0x4c')]));queues[_0x4fac27[_0x024f('0x4d')]]['transfereduniqueid']=_0x4fac27[_0x024f('0x4c')];}}}}catch(_0x244a2f){utils[_0x024f('0x2b')](util[_0x024f('0x3')]('[%s][queues][attendedtransfer]',_0x4fac27[_0x024f('0x4b')]),_0x244a2f);}};exports[_0x024f('0x60')]=function(_0x3304bf){try{if(!_[_0x024f('0x17')](queues[_0x3304bf[_0x024f('0x5')]])){utils[_0x024f('0x11')](util[_0x024f('0x3')](_0x024f('0x61'),_0x3304bf[_0x024f('0x5')]),_0x3304bf);queues[_0x3304bf[_0x024f('0x5')]][_0x024f('0x62')]=utils[_0x024f('0x15')]();utils[_0x024f('0x2')](util[_0x024f('0x3')](_0x024f('0x63'),_0x3304bf[_0x024f('0x5')],queues[_0x3304bf[_0x024f('0x5')]][_0x024f('0x1f')],queues[_0x3304bf['uniqueid']][_0x024f('0x62')]));}}catch(_0x47d0a2){utils[_0x024f('0x2b')](util[_0x024f('0x3')](_0x024f('0x61'),_0x3304bf['uniqueid']),_0x47d0a2);}};exports[_0x024f('0x64')]=function(_0x5b9875){try{if(!_[_0x024f('0x17')](queues[_0x5b9875['uniqueid']])){if(!_[_0x024f('0x17')](queues[_0x5b9875[_0x024f('0x5')]][_0x024f('0x62')])){utils[_0x024f('0x11')](util[_0x024f('0x3')](_0x024f('0x65'),_0x5b9875[_0x024f('0x5')]),_0x5b9875);queues[_0x5b9875['uniqueid']][_0x024f('0x5e')]+=utils[_0x024f('0x36')](utils[_0x024f('0x15')](),queues[_0x5b9875['uniqueid']][_0x024f('0x62')]);utils[_0x024f('0x2')](util['format'](_0x024f('0x66'),_0x5b9875[_0x024f('0x5')],queues[_0x5b9875[_0x024f('0x5')]]['name'],queues[_0x5b9875[_0x024f('0x5')]][_0x024f('0x5e')]));delete queues[_0x5b9875[_0x024f('0x5')]][_0x024f('0x62')];}}}catch(_0x1a4af7){utils[_0x024f('0x2b')](util[_0x024f('0x3')](_0x024f('0x65'),_0x5b9875[_0x024f('0x5')]),_0x1a4af7);}}; \ No newline at end of file +var _0x21dd=['diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','secondtransfererexten','transfertargetlinkedid','clone','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','[%s][queues][queuecallerjoin]','position','assign','hangup','isNil','debug','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','error','[%s][queues][hangup]','varset','[%s][queues][varset]','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','now','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','queuecallerexit','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x21dd,0x1d3));var _0xd21d=function(_0x399723,_0x26c294){_0x399723=_0x399723-0x0;var _0x6349f5=_0x21dd[_0x399723];return _0x6349f5;};'use strict';var _=require(_0xd21d('0x0'));var util=require('util');var utils=require(_0xd21d('0x1'));var queues={};function writeDB(_0x272e69){utils[_0xd21d('0x2')](util[_0xd21d('0x3')](_0xd21d('0x4'),_0x272e69[_0xd21d('0x5')],_0x272e69[_0xd21d('0x6')],_0x272e69[_0xd21d('0x7')],_0x272e69[_0xd21d('0x8')],_0x272e69[_0xd21d('0x9')],_0x272e69[_0xd21d('0xa')],_0x272e69[_0xd21d('0xb')]));if(_0x272e69[_0xd21d('0x7')]){utils[_0xd21d('0xc')](_0x272e69['queue'])['then'](function(_0x23636f){if(_0x23636f){_0x272e69[_0xd21d('0xd')]=_0x23636f[_0xd21d('0xd')];}utils[_0xd21d('0xe')](_0xd21d('0xf'),_0x272e69);});}else{utils['request'](_0xd21d('0xf'),_0x272e69);}if(_0x272e69[_0xd21d('0x10')]){delete queues[_0x272e69[_0xd21d('0x10')]];}else{delete queues[_0x272e69['uniqueid']];}}exports['queuecallerjoin']=function(_0x32a4a7){try{utils['debug'](util[_0xd21d('0x3')](_0xd21d('0x11'),_0x32a4a7[_0xd21d('0x5')]),_0x32a4a7);utils[_0xd21d('0x2')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x32a4a7['uniqueid'],_0x32a4a7[_0xd21d('0x7')],_0x32a4a7[_0xd21d('0x12')]));queues[_0x32a4a7[_0xd21d('0x5')]]=_[_0xd21d('0x13')](_0x32a4a7,{'originalposition':_0x32a4a7[_0xd21d('0x12')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x16afc8){utils['error'](util[_0xd21d('0x3')]('[%s][queues][queuecallerjoin]',_0x32a4a7[_0xd21d('0x5')]),_0x16afc8);}};exports[_0xd21d('0x14')]=function(_0x5a9da7){try{if(!_[_0xd21d('0x15')](queues[_0x5a9da7[_0xd21d('0x5')]])){utils[_0xd21d('0x16')](util[_0xd21d('0x3')]('[%s][queues][hangup]',_0x5a9da7[_0xd21d('0x5')]),_0x5a9da7);if(queues[_0x5a9da7[_0xd21d('0x5')]][_0xd21d('0x17')]){if(!queues[_0x5a9da7[_0xd21d('0x5')]][_0xd21d('0x18')]&&!queues[_0x5a9da7[_0xd21d('0x5')]]['queuecallerexit']){queues[_0x5a9da7[_0xd21d('0x5')]][_0xd21d('0x19')]=!![];queues[_0x5a9da7['uniqueid']]['queuecallercompleteAt']=utils['now']();queues[_0x5a9da7['uniqueid']][_0xd21d('0xb')]=_0xd21d('0x1a');}utils['info'](util[_0xd21d('0x3')](_0xd21d('0x1b'),_0x5a9da7[_0xd21d('0x5')],queues[_0x5a9da7['uniqueid']]['name'],queues[_0x5a9da7['uniqueid']][_0xd21d('0xb')]));writeDB(queues[_0x5a9da7['uniqueid']]);}else if(queues[_0x5a9da7[_0xd21d('0x5')]][_0xd21d('0x10')]){utils['info'](util[_0xd21d('0x3')](_0xd21d('0x1c'),_0x5a9da7[_0xd21d('0x5')],queues[_0x5a9da7[_0xd21d('0x5')]][_0xd21d('0x1d')],queues[_0x5a9da7[_0xd21d('0x5')]]['transfereduniqueid']));queues[queues[_0x5a9da7['uniqueid']][_0xd21d('0x10')]]=queues[_0x5a9da7[_0xd21d('0x5')]];queues[queues[_0x5a9da7['uniqueid']][_0xd21d('0x10')]][_0xd21d('0x1e')]=0x2;delete queues[_0x5a9da7[_0xd21d('0x5')]];}}}catch(_0x2751cf){utils[_0xd21d('0x1f')](util[_0xd21d('0x3')](_0xd21d('0x20'),_0x5a9da7['uniqueid']),_0x2751cf);}};exports[_0xd21d('0x21')]=function(_0x41c89b){try{utils['debug'](util[_0xd21d('0x3')](_0xd21d('0x22'),_0x41c89b[_0xd21d('0x5')]),_0x41c89b);if(!_[_0xd21d('0x15')](_0x41c89b['variable'][_0xd21d('0x23')])&&_0x41c89b['value'][_0xd21d('0x24')]()!==_0xd21d('0x25')){if(!_[_0xd21d('0x15')](queues[_0x41c89b[_0xd21d('0x5')]])){queues[_0x41c89b[_0xd21d('0x5')]][_0xd21d('0x18')]=![];queues[_0x41c89b[_0xd21d('0x5')]][_0xd21d('0x26')]=null;queues[_0x41c89b[_0xd21d('0x5')]]['queuecallerexit']=!![];queues[_0x41c89b[_0xd21d('0x5')]][_0xd21d('0x27')]=utils[_0xd21d('0x28')]();queues[_0x41c89b[_0xd21d('0x5')]][_0xd21d('0xb')]=_0x41c89b[_0xd21d('0x29')][_0xd21d('0x24')]();utils[_0xd21d('0x2')](util[_0xd21d('0x3')](_0xd21d('0x2a'),_0x41c89b[_0xd21d('0x5')],queues[_0x41c89b[_0xd21d('0x5')]]['name'],_0x41c89b['value'],queues[_0x41c89b[_0xd21d('0x5')]][_0xd21d('0xb')]));writeDB(queues[_0x41c89b['uniqueid']]);}}else if(!_[_0xd21d('0x15')](_0x41c89b[_0xd21d('0x2b')][_0xd21d('0x2c')])){if(!_['isNil'](queues[_0x41c89b[_0xd21d('0x5')]])&&!queues[_0x41c89b[_0xd21d('0x5')]][_0xd21d('0x18')]){queues[_0x41c89b[_0xd21d('0x5')]]['queuecallerabandon']=![];queues[_0x41c89b[_0xd21d('0x5')]]['queuecallerabandonAt']=null;queues[_0x41c89b['uniqueid']][_0xd21d('0x2d')]=!![];queues[_0x41c89b[_0xd21d('0x5')]]['queuecallerexitAt']=utils[_0xd21d('0x28')]();queues[_0x41c89b['uniqueid']][_0xd21d('0xb')]='EXITWITHKEY';utils[_0xd21d('0x2')](util[_0xd21d('0x3')](_0xd21d('0x2e'),_0x41c89b[_0xd21d('0x5')],queues[_0x41c89b[_0xd21d('0x5')]][_0xd21d('0x1d')],_0x41c89b[_0xd21d('0x29')],queues[_0x41c89b[_0xd21d('0x5')]][_0xd21d('0xb')]));}}}catch(_0x142fac){utils[_0xd21d('0x1f')](util[_0xd21d('0x3')]('[%s][queues][varset]',_0x41c89b['uniqueid']),_0x142fac);}};exports[_0xd21d('0x18')]=function(_0x47395d){try{if(!_[_0xd21d('0x15')](queues[_0x47395d[_0xd21d('0x5')]])){utils['debug'](util[_0xd21d('0x3')](_0xd21d('0x2f'),_0x47395d['uniqueid']),_0x47395d);queues[_0x47395d['uniqueid']][_0xd21d('0x2d')]=![];queues[_0x47395d[_0xd21d('0x5')]]['queuecallerexitAt']=null;queues[_0x47395d[_0xd21d('0x5')]][_0xd21d('0x18')]=!![];queues[_0x47395d[_0xd21d('0x5')]][_0xd21d('0x26')]=utils['now']();queues[_0x47395d['uniqueid']][_0xd21d('0xb')]='ABANDONED';utils['info'](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x47395d[_0xd21d('0x5')],queues[_0x47395d[_0xd21d('0x5')]][_0xd21d('0x1d')],queues[_0x47395d[_0xd21d('0x5')]][_0xd21d('0xb')]));}}catch(_0x47329e){utils[_0xd21d('0x1f')](util[_0xd21d('0x3')](_0xd21d('0x2f'),_0x47395d['uniqueid']),_0x47329e);}};exports[_0xd21d('0x30')]=function(_0x2516d9){try{if(!_[_0xd21d('0x15')](queues[_0x2516d9[_0xd21d('0x5')]])){utils[_0xd21d('0x16')](util['format'](_0xd21d('0x31'),_0x2516d9[_0xd21d('0x5')]),_0x2516d9);utils[_0xd21d('0x2')](util[_0xd21d('0x3')](_0xd21d('0x32'),_0x2516d9[_0xd21d('0x5')],queues[_0x2516d9[_0xd21d('0x5')]][_0xd21d('0x1d')],_0x2516d9[_0xd21d('0x33')],_0x2516d9['connectedlinename']));queues[_0x2516d9[_0xd21d('0x5')]][_0xd21d('0x30')]=!![];queues[_0x2516d9['uniqueid']][_0xd21d('0x17')]=utils[_0xd21d('0x28')]();queues[_0x2516d9['uniqueid']][_0xd21d('0x34')]=utils[_0xd21d('0x35')](queues[_0x2516d9['uniqueid']]['queuecallerleaveAt'],queues[_0x2516d9[_0xd21d('0x5')]][_0xd21d('0x36')]);queues[_0x2516d9['uniqueid']][_0xd21d('0x12')]=_0x2516d9[_0xd21d('0x12')];queues[_0x2516d9[_0xd21d('0x5')]][_0xd21d('0x37')]=_0x2516d9['count'];queues[_0x2516d9['uniqueid']]['connectedlinenum']=_0x2516d9[_0xd21d('0x33')];queues[_0x2516d9['uniqueid']]['connectedlinename']=_0x2516d9[_0xd21d('0x38')];}}catch(_0x3d3f87){utils['error'](util[_0xd21d('0x3')](_0xd21d('0x31'),_0x2516d9[_0xd21d('0x5')]),_0x3d3f87);}};exports[_0xd21d('0x39')]=function(_0x3dc204){try{if(!_[_0xd21d('0x15')](queues[_0x3dc204[_0xd21d('0x5')]])){utils[_0xd21d('0x16')](util[_0xd21d('0x3')](_0xd21d('0x3a'),_0x3dc204['uniqueid']),_0x3dc204);utils['info'](util[_0xd21d('0x3')](_0xd21d('0x3b'),_0x3dc204['uniqueid'],queues[_0x3dc204['uniqueid']]['name'],_0x3dc204[_0xd21d('0x3c')],_0x3dc204[_0xd21d('0x3d')]));queues[_0x3dc204[_0xd21d('0x5')]][_0xd21d('0x18')]=![];queues[_0x3dc204[_0xd21d('0x5')]][_0xd21d('0x18')]=![];queues[_0x3dc204[_0xd21d('0x5')]][_0xd21d('0x26')]=null;queues[_0x3dc204[_0xd21d('0x5')]][_0xd21d('0x2d')]=![];queues[_0x3dc204[_0xd21d('0x5')]][_0xd21d('0xb')]=null;queues[_0x3dc204[_0xd21d('0x5')]][_0xd21d('0x27')]=null;queues[_0x3dc204[_0xd21d('0x5')]][_0xd21d('0x3e')]=!![];queues[_0x3dc204[_0xd21d('0x5')]][_0xd21d('0xa')]=_0x3dc204[_0xd21d('0x3d')];queues[_0x3dc204['uniqueid']][_0xd21d('0x8')]=_0x3dc204['membername'];}}catch(_0x276508){utils[_0xd21d('0x1f')](util[_0xd21d('0x3')](_0xd21d('0x3a'),_0x3dc204['uniqueid']),_0x276508);}};exports['agentcomplete']=function(_0x1c476b){try{if(!_[_0xd21d('0x15')](queues[_0x1c476b[_0xd21d('0x5')]])){if(queues[_0x1c476b[_0xd21d('0x5')]][_0xd21d('0x17')]){utils[_0xd21d('0x16')](util[_0xd21d('0x3')](_0xd21d('0x3f'),_0x1c476b[_0xd21d('0x5')]),_0x1c476b);queues[_0x1c476b['uniqueid']][_0xd21d('0x18')]=![];queues[_0x1c476b['uniqueid']][_0xd21d('0x18')]=![];queues[_0x1c476b[_0xd21d('0x5')]][_0xd21d('0x26')]=null;queues[_0x1c476b[_0xd21d('0x5')]][_0xd21d('0x2d')]=![];queues[_0x1c476b[_0xd21d('0x5')]]['queuecallerexitAt']=null;queues[_0x1c476b['uniqueid']][_0xd21d('0x3e')]=!![];queues[_0x1c476b[_0xd21d('0x5')]][_0xd21d('0x8')]=_0x1c476b[_0xd21d('0x3c')];queues[_0x1c476b[_0xd21d('0x5')]][_0xd21d('0x19')]=!![];queues[_0x1c476b[_0xd21d('0x5')]][_0xd21d('0x40')]=utils[_0xd21d('0x28')]();if(_0x1c476b[_0xd21d('0x41')]=='transfer'){if(!queues[_0x1c476b[_0xd21d('0x5')]][_0xd21d('0x42')]){queues[_0x1c476b['uniqueid']]['queuecallerexitreason']=_0xd21d('0x43');}}else{queues[_0x1c476b['uniqueid']][_0xd21d('0xb')]=_0xd21d('0x44')+_0x1c476b[_0xd21d('0x41')][_0xd21d('0x24')]();}utils['info'](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x1c476b[_0xd21d('0x5')],queues[_0x1c476b[_0xd21d('0x5')]][_0xd21d('0x1d')],_0x1c476b[_0xd21d('0x3c')],queues[_0x1c476b[_0xd21d('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x1c476b[_0xd21d('0x5')]]);}}}catch(_0x1d2b23){utils['error'](util[_0xd21d('0x3')]('[%s][queues][agentcomplete]',_0x1c476b[_0xd21d('0x5')]),_0x1d2b23);}};exports['blindtransfer']=function(_0x38c231){try{if(!_[_0xd21d('0x15')](queues[_0x38c231[_0xd21d('0x45')]])){utils[_0xd21d('0x16')](util[_0xd21d('0x3')](_0xd21d('0x46'),_0x38c231[_0xd21d('0x5')]),_0x38c231);queues[_0x38c231['transfereeuniqueid']]['transfer']=!![];queues[_0x38c231[_0xd21d('0x45')]][_0xd21d('0x47')]=_0xd21d('0x48');queues[_0x38c231['transfereeuniqueid']][_0xd21d('0x49')]=_0x38c231[_0xd21d('0x4a')];queues[_0x38c231[_0xd21d('0x45')]][_0xd21d('0x4b')]=_0x38c231['transfereeuniqueid'];queues[_0x38c231[_0xd21d('0x45')]]['queuecallerexitreason']=_0xd21d('0x4c');utils[_0xd21d('0x2')](util[_0xd21d('0x3')](_0xd21d('0x4d'),_0x38c231[_0xd21d('0x5')],queues[_0x38c231[_0xd21d('0x45')]]['name'],_0x38c231['transfereeuniqueid'],_0x38c231[_0xd21d('0x4a')]));}}catch(_0x4ade17){utils[_0xd21d('0x1f')](util[_0xd21d('0x3')](_0xd21d('0x46'),_0x38c231['uniqueid']),_0x4ade17);}};exports[_0xd21d('0x4e')]=function(_0x42eb06){try{utils[_0xd21d('0x16')](util[_0xd21d('0x3')](_0xd21d('0x4f'),_0x42eb06[_0xd21d('0x50')]),_0x42eb06);if(_0x42eb06['origtransfereruniqueid']==_0x42eb06[_0xd21d('0x51')]){if(!_[_0xd21d('0x15')](queues[_0x42eb06[_0xd21d('0x52')]])){utils[_0xd21d('0x2')](util['format'](_0xd21d('0x53'),_0x42eb06[_0xd21d('0x50')],queues[_0x42eb06[_0xd21d('0x52')]][_0xd21d('0x1d')],_0x42eb06[_0xd21d('0x54')]));queues[_0x42eb06[_0xd21d('0x52')]][_0xd21d('0x42')]=!![];queues[_0x42eb06[_0xd21d('0x52')]][_0xd21d('0x47')]='ATTENDED';queues[_0x42eb06[_0xd21d('0x52')]][_0xd21d('0x49')]=_0x42eb06[_0xd21d('0x54')];queues[_0x42eb06[_0xd21d('0x52')]][_0xd21d('0x4b')]=_0x42eb06[_0xd21d('0x50')];queues[_0x42eb06[_0xd21d('0x52')]]['queuecallerexitreason']=_0xd21d('0x55');}if(!_['isNil'](queues[_0x42eb06[_0xd21d('0x51')]])){if(_0x42eb06[_0xd21d('0x56')]&&queues[_0x42eb06[_0xd21d('0x56')]]){queues[_0x42eb06['transfereelinkedid']][_0xd21d('0x1e')]=0x1;queues[_0x42eb06[_0xd21d('0x45')]]=_['clone'](queues[_0x42eb06['transfereelinkedid']]);queues[_0x42eb06[_0xd21d('0x45')]]['transfereduniqueid']=_0x42eb06[_0xd21d('0x57')];queues[_0x42eb06['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x42eb06[_0xd21d('0x45')]][_0xd21d('0x9')]=queues[_0x42eb06[_0xd21d('0x52')]][_0xd21d('0x9')];queues[_0x42eb06[_0xd21d('0x45')]][_0xd21d('0x58')]=queues[_0x42eb06['secondtransfererlinkedid']][_0xd21d('0x58')];queues[_0x42eb06['transfereeuniqueid']][_0xd21d('0x36')]=utils[_0xd21d('0x28')]();queues[_0x42eb06['transfereeuniqueid']][_0xd21d('0x17')]=utils[_0xd21d('0x28')]();queues[_0x42eb06[_0xd21d('0x45')]][_0xd21d('0x34')]=0x0;queues[_0x42eb06['transfereeuniqueid']]['mohtime']=0x0;utils['info'](util[_0xd21d('0x3')](_0xd21d('0x59'),_0x42eb06['origtransfereruniqueid'],queues[_0x42eb06[_0xd21d('0x45')]]['name'],queues[_0x42eb06[_0xd21d('0x45')]][_0xd21d('0x9')],queues[_0x42eb06[_0xd21d('0x45')]][_0xd21d('0x58')]));}else{utils[_0xd21d('0x2')](util[_0xd21d('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x42eb06[_0xd21d('0x50')],queues[_0x42eb06['origtransfererlinkedid']][_0xd21d('0x1d')],_0x42eb06[_0xd21d('0x52')]));queues[_0x42eb06[_0xd21d('0x51')]][_0xd21d('0x10')]=_0x42eb06['secondtransfererlinkedid'];}}}else if(_0x42eb06[_0xd21d('0x5a')]==_0x42eb06[_0xd21d('0x52')]){if(!_[_0xd21d('0x15')](queues[_0x42eb06[_0xd21d('0x51')]])){utils[_0xd21d('0x2')](util[_0xd21d('0x3')](_0xd21d('0x5b'),_0x42eb06[_0xd21d('0x50')],queues[_0x42eb06['origtransfererlinkedid']][_0xd21d('0x1d')],_0x42eb06[_0xd21d('0x5a')],_0x42eb06['secondtransfererexten']));queues[_0x42eb06[_0xd21d('0x51')]]['transfer']=!![];queues[_0x42eb06[_0xd21d('0x51')]][_0xd21d('0x47')]=_0xd21d('0x5c');queues[_0x42eb06['origtransfererlinkedid']][_0xd21d('0x49')]=_0x42eb06[_0xd21d('0x5d')];queues[_0x42eb06['origtransfererlinkedid']][_0xd21d('0x4b')]=_0x42eb06['secondtransfereruniqueid'];queues[_0x42eb06[_0xd21d('0x51')]][_0xd21d('0xb')]='ATTENDEDTRANSFER';}if(!_[_0xd21d('0x15')](queues[_0x42eb06[_0xd21d('0x52')]])){if(_0x42eb06[_0xd21d('0x5e')]&&queues[_0x42eb06[_0xd21d('0x5e')]]){queues[_0x42eb06[_0xd21d('0x5e')]][_0xd21d('0x1e')]=0x1;queues[_0x42eb06['transfertargetuniqueid']]=_[_0xd21d('0x5f')](queues[_0x42eb06[_0xd21d('0x5e')]]);queues[_0x42eb06[_0xd21d('0x57')]][_0xd21d('0x10')]=_0x42eb06[_0xd21d('0x57')];queues[_0x42eb06['transfertargetuniqueid']][_0xd21d('0x1e')]=0x2;queues[_0x42eb06[_0xd21d('0x57')]][_0xd21d('0x9')]=queues[_0x42eb06[_0xd21d('0x51')]][_0xd21d('0x9')];queues[_0x42eb06[_0xd21d('0x57')]]['calleridname']=queues[_0x42eb06[_0xd21d('0x51')]][_0xd21d('0x58')];queues[_0x42eb06[_0xd21d('0x57')]][_0xd21d('0x36')]=utils[_0xd21d('0x28')]();queues[_0x42eb06[_0xd21d('0x57')]]['queuecallerleaveAt']=utils[_0xd21d('0x28')]();queues[_0x42eb06['transfertargetuniqueid']][_0xd21d('0x34')]=0x0;queues[_0x42eb06[_0xd21d('0x57')]][_0xd21d('0x60')]=0x0;utils[_0xd21d('0x2')](util[_0xd21d('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x42eb06[_0xd21d('0x50')],queues[_0x42eb06['transfertargetuniqueid']]['name'],queues[_0x42eb06[_0xd21d('0x57')]][_0xd21d('0x10')],queues[_0x42eb06[_0xd21d('0x57')]][_0xd21d('0x9')],queues[_0x42eb06[_0xd21d('0x57')]][_0xd21d('0x58')]));}else{utils[_0xd21d('0x2')](util[_0xd21d('0x3')](_0xd21d('0x61'),_0x42eb06[_0xd21d('0x50')],queues[_0x42eb06[_0xd21d('0x52')]]['name'],_0x42eb06['origtransfererlinkedid']));queues[_0x42eb06['secondtransfererlinkedid']][_0xd21d('0x10')]=_0x42eb06[_0xd21d('0x51')];}}}}catch(_0x1a7177){utils['error'](util[_0xd21d('0x3')](_0xd21d('0x4f'),_0x42eb06[_0xd21d('0x50')]),_0x1a7177);}};exports[_0xd21d('0x62')]=function(_0xc481d4){try{if(!_['isNil'](queues[_0xc481d4['uniqueid']])){utils['debug'](util[_0xd21d('0x3')](_0xd21d('0x63'),_0xc481d4[_0xd21d('0x5')]),_0xc481d4);queues[_0xc481d4[_0xd21d('0x5')]][_0xd21d('0x64')]=utils[_0xd21d('0x28')]();utils[_0xd21d('0x2')](util[_0xd21d('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0xc481d4['uniqueid'],queues[_0xc481d4[_0xd21d('0x5')]]['name'],queues[_0xc481d4[_0xd21d('0x5')]][_0xd21d('0x64')]));}}catch(_0x37eb8f){utils[_0xd21d('0x1f')](util[_0xd21d('0x3')](_0xd21d('0x63'),_0xc481d4['uniqueid']),_0x37eb8f);}};exports[_0xd21d('0x65')]=function(_0x59eea4){try{if(!_[_0xd21d('0x15')](queues[_0x59eea4[_0xd21d('0x5')]])){if(!_[_0xd21d('0x15')](queues[_0x59eea4[_0xd21d('0x5')]][_0xd21d('0x64')])){utils[_0xd21d('0x16')](util[_0xd21d('0x3')]('[%s][queues][musiconholdstop]',_0x59eea4[_0xd21d('0x5')]),_0x59eea4);queues[_0x59eea4[_0xd21d('0x5')]][_0xd21d('0x60')]+=utils[_0xd21d('0x35')](utils[_0xd21d('0x28')](),queues[_0x59eea4['uniqueid']][_0xd21d('0x64')]);utils[_0xd21d('0x2')](util[_0xd21d('0x3')](_0xd21d('0x66'),_0x59eea4[_0xd21d('0x5')],queues[_0x59eea4['uniqueid']][_0xd21d('0x1d')],queues[_0x59eea4[_0xd21d('0x5')]][_0xd21d('0x60')]));delete queues[_0x59eea4[_0xd21d('0x5')]][_0xd21d('0x64')];}}}catch(_0x4d5b61){utils['error'](util['format'](_0xd21d('0x67'),_0x59eea4[_0xd21d('0x5')]),_0x4d5b61);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index dd605e9..b8ee8fe 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 _0xe4ad=['recording','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','name','UserId','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','value','endsWith','.wav49','replace','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','blindtransfer','[%s][recordings][blindtransfer]','transfereecalleridnum','transfereecalleridname','transfereruniqueid'];(function(_0xb99421,_0xaab133){var _0x4b3ec7=function(_0x591d1a){while(--_0x591d1a){_0xb99421['push'](_0xb99421['shift']());}};_0x4b3ec7(++_0xaab133);}(_0xe4ad,0x8d));var _0xde4a=function(_0x717c52,_0x4ffd52){_0x717c52=_0x717c52-0x0;var _0x2d4678=_0xe4ad[_0x717c52];return _0x2d4678;};'use strict';var _=require(_0xde4a('0x0'));var util=require(_0xde4a('0x1'));var utils=require(_0xde4a('0x2'));var transfers=require(_0xde4a('0x3'));var recordings={};function writeDB(_0x1143a2){var _0x2b2348;utils[_0xde4a('0x4')](util[_0xde4a('0x5')](_0xde4a('0x6'),_0x1143a2['uniqueid']));if(transfers[_0xde4a('0x7')][_0x1143a2['uniqueid']]){_0x2b2348=_0x1143a2[_0xde4a('0x8')];_0x1143a2[_0xde4a('0x8')]=transfers[_0xde4a('0x7')][_0x1143a2[_0xde4a('0x8')]][_0xde4a('0x9')];}if(_0x1143a2[_0xde4a('0xa')]){utils[_0xde4a('0xb')](_0x1143a2[_0xde4a('0xa')])[_0xde4a('0xc')](function(_0x1118bb){if(_0x1118bb){_0x1143a2['membername']=_0x1118bb[_0xde4a('0xd')];_0x1143a2[_0xde4a('0xe')]=_0x1118bb['id'];}utils[_0xde4a('0xf')]('CreateVoiceRecording',_0x1143a2);});}else{utils['request']('CreateVoiceRecording',_0x1143a2);}if(_0x2b2348)delete transfers['blinds'][_0x2b2348];}exports[_0xde4a('0x10')]=function(_0x406196){try{utils[_0xde4a('0x11')](util[_0xde4a('0x5')](_0xde4a('0x12'),_0x406196[_0xde4a('0x8')]),_0x406196);if(_0x406196['uniqueid']==_0x406196[_0xde4a('0x13')]){utils[_0xde4a('0x4')](util[_0xde4a('0x5')](_0xde4a('0x14'),_0x406196['uniqueid'],_0x406196[_0xde4a('0x15')],_0x406196[_0xde4a('0x16')]));recordings[_0x406196[_0xde4a('0x8')]]={'uniqueid':_0x406196[_0xde4a('0x8')],'accountcode':_0x406196[_0xde4a('0xa')],'exten':_0x406196[_0xde4a('0x16')],'context':_0x406196[_0xde4a('0x15')],'channel':_0x406196['channel'],'monitors':[]};}}catch(_0x11e3e6){utils[_0xde4a('0x17')](util['format'](_0xde4a('0x12'),_0x406196[_0xde4a('0x8')]),_0x11e3e6);}};exports[_0xde4a('0x18')]=function(_0x44da13){try{utils[_0xde4a('0x11')](util[_0xde4a('0x5')](_0xde4a('0x19'),_0x44da13[_0xde4a('0x8')]),_0x44da13);if(!_['isNil'](recordings[_0x44da13[_0xde4a('0x8')]])&&_0x44da13[_0xde4a('0x1a')]==0x6){utils['info'](util[_0xde4a('0x5')](_0xde4a('0x1b'),_0x44da13[_0xde4a('0x8')],_0x44da13['context'],_0x44da13[_0xde4a('0x1c')]));}else if(!_[_0xde4a('0x1d')](recordings[_0x44da13[_0xde4a('0x13')]])&&_0x44da13[_0xde4a('0x1a')]==0x6&&_0x44da13[_0xde4a('0x15')]!=_0xde4a('0x1e')){utils[_0xde4a('0x4')](util['format'](_0xde4a('0x1f'),_0x44da13['uniqueid'],_0x44da13['linkedid'],_0x44da13[_0xde4a('0x15')],_0x44da13[_0xde4a('0x1c')]));recordings[_0x44da13[_0xde4a('0x13')]][_0xde4a('0xa')]=_0x44da13[_0xde4a('0xa')];}}catch(_0xafbf9c){utils[_0xde4a('0x17')](util[_0xde4a('0x5')](_0xde4a('0x19'),_0x44da13[_0xde4a('0x8')]),_0xafbf9c);}};exports['varset']=function(_0x4c9b0f){try{if(!_[_0xde4a('0x1d')](_0x4c9b0f[_0xde4a('0x20')])&&!_[_0xde4a('0x1d')](_0x4c9b0f[_0xde4a('0x20')][_0xde4a('0x21')])){utils[_0xde4a('0x11')](util['format'](_0xde4a('0x22'),_0x4c9b0f['uniqueid']),_0x4c9b0f);utils[_0xde4a('0x4')](util[_0xde4a('0x5')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x4c9b0f[_0xde4a('0x8')],_0x4c9b0f['variable'],_0x4c9b0f[_0xde4a('0x23')]));if(_[_0xde4a('0x24')](_0x4c9b0f[_0xde4a('0x23')],_0xde4a('0x25'))){_0x4c9b0f['value']=_0x4c9b0f[_0xde4a('0x23')][_0xde4a('0x26')](_0xde4a('0x25'),'.WAV');}if(recordings[_0x4c9b0f[_0xde4a('0x13')]]){var _0x4bdac1=_['find'](recordings[_0x4c9b0f['linkedid']][_0xde4a('0x27')],{'value':_0x4c9b0f[_0xde4a('0x23')]});if(_[_0xde4a('0x1d')](_0x4bdac1)){recordings[_0x4c9b0f['linkedid']]['monitors'][_0xde4a('0x28')]({'value':_0x4c9b0f[_0xde4a('0x23')]});}}}}catch(_0x201b19){utils[_0xde4a('0x17')](util[_0xde4a('0x5')](_0xde4a('0x22'),_0x4c9b0f[_0xde4a('0x8')]),_0x201b19);}};exports['hangup']=function(_0x3e32e6){try{if(!_[_0xde4a('0x1d')](recordings[_0x3e32e6[_0xde4a('0x8')]])){utils['debug'](util[_0xde4a('0x5')](_0xde4a('0x29'),_0x3e32e6[_0xde4a('0x8')]),_0x3e32e6);utils[_0xde4a('0x4')](util[_0xde4a('0x5')](_0xde4a('0x2a'),_0x3e32e6[_0xde4a('0x8')],_0x3e32e6['calleridnum'],_0x3e32e6['calleridname'],_0x3e32e6['cause-txt']));recordings[_0x3e32e6[_0xde4a('0x8')]][_0xde4a('0x2b')]=_0x3e32e6[_0xde4a('0x2b')];recordings[_0x3e32e6[_0xde4a('0x8')]][_0xde4a('0x2c')]=_0x3e32e6['calleridname'];recordings[_0x3e32e6[_0xde4a('0x8')]]['connectedlinenum']=_0x3e32e6[_0xde4a('0x2d')];recordings[_0x3e32e6['uniqueid']]['connectedlinename']=_0x3e32e6[_0xde4a('0x2e')];if(recordings[_0x3e32e6['uniqueid']][_0xde4a('0x2f')]==_0xde4a('0x30')&&recordings[_0x3e32e6[_0xde4a('0x8')]][_0xde4a('0xa')]){recordings[_0x3e32e6['uniqueid']]['connectedlinenum']=recordings[_0x3e32e6[_0xde4a('0x8')]][_0xde4a('0xa')];recordings[_0x3e32e6[_0xde4a('0x8')]][_0xde4a('0x2e')]='';}recordings[_0x3e32e6[_0xde4a('0x8')]][_0xde4a('0x27')]['forEach'](function(_0x1e72c3){var _0x11f4c0=_[_0xde4a('0x31')](recordings[_0x3e32e6[_0xde4a('0x8')]]);_0x11f4c0['value']=_0x1e72c3[_0xde4a('0x23')];writeDB(_0x11f4c0);});delete recordings[_0x3e32e6['uniqueid']];}}catch(_0x14ba67){utils[_0xde4a('0x17')](util[_0xde4a('0x5')](_0xde4a('0x29'),_0x3e32e6[_0xde4a('0x8')]),_0x14ba67);}};exports['newexten']=function(_0x52cf5f){try{if(!_[_0xde4a('0x1d')](recordings[_0x52cf5f['uniqueid']])){utils[_0xde4a('0x11')](util[_0xde4a('0x5')](_0xde4a('0x32'),_0x52cf5f[_0xde4a('0x8')]),_0x52cf5f);utils[_0xde4a('0x4')](util['format'](_0xde4a('0x33'),_0x52cf5f['uniqueid'],_0x52cf5f[_0xde4a('0x34')],_0x52cf5f[_0xde4a('0x35')]));if(_0x52cf5f[_0xde4a('0x34')][_0xde4a('0x36')]()==_0xde4a('0x37')&&_[_0xde4a('0x38')](_0x52cf5f[_0xde4a('0x35')][_0xde4a('0x36')](),_0xde4a('0x39'))){var _0x32e467=_0x52cf5f[_0xde4a('0x35')][_0xde4a('0x3a')]('=');var _0x541760=_0x32e467[0x0][_0xde4a('0x3b')](_0x32e467[0x0][_0xde4a('0x3c')]('(')+0x1,_0x32e467[0x0][_0xde4a('0x3c')](')'));var _0x567925=_0x32e467[0x1];recordings[_0x52cf5f[_0xde4a('0x8')]][_0x541760]=_0x567925;}}}catch(_0x24c325){utils[_0xde4a('0x17')](util[_0xde4a('0x5')](_0xde4a('0x32'),_0x52cf5f[_0xde4a('0x8')]),_0x24c325);}};exports[_0xde4a('0x3d')]=function(_0x2cbb37){try{if(!_[_0xde4a('0x1d')](recordings[_0x2cbb37[_0xde4a('0x8')]])){utils[_0xde4a('0x11')](util[_0xde4a('0x5')](_0xde4a('0x3e'),_0x2cbb37[_0xde4a('0x8')]),_0x2cbb37);utils[_0xde4a('0x4')](util[_0xde4a('0x5')](_0xde4a('0x3f'),_0x2cbb37[_0xde4a('0x8')],_0x2cbb37['queue']));recordings[_0x2cbb37['uniqueid']]['queue']=_0x2cbb37['queue'];}}catch(_0x20c209){utils['error'](util[_0xde4a('0x5')](_0xde4a('0x3e'),_0x2cbb37['uniqueid']),_0x20c209);}};exports[_0xde4a('0x40')]=function(_0x3cbf81){try{utils[_0xde4a('0x11')](util[_0xde4a('0x5')](_0xde4a('0x41'),_0x3cbf81[_0xde4a('0x8')]),_0x3cbf81);utils[_0xde4a('0x4')](util[_0xde4a('0x5')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x3cbf81[_0xde4a('0x8')],_0x3cbf81['transferercalleridnum'],_0x3cbf81['transferercalleridname'],_0x3cbf81[_0xde4a('0x42')],_0x3cbf81[_0xde4a('0x43')]));if(recordings[_0x3cbf81[_0xde4a('0x44')]]&&transfers[_0xde4a('0x7')][_0x3cbf81[_0xde4a('0x44')]]){transfers[_0xde4a('0x7')][_0x3cbf81[_0xde4a('0x44')]][_0xde4a('0x45')]=!![];}}catch(_0x528844){utils['error'](util[_0xde4a('0x5')]('[%s][recordings][blindtransfer]',_0x3cbf81[_0xde4a('0x8')]),_0x528844);}}; \ No newline at end of file +var _0xf9a2=['.WAV','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','lodash','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','accountcode','getUserByInternal','then','membername','name','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','linkedid','transfer','varset','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','variable','value','endsWith','.wav49','replace'];(function(_0x342d4f,_0x1a11f9){var _0x50db0d=function(_0x41c409){while(--_0x41c409){_0x342d4f['push'](_0x342d4f['shift']());}};_0x50db0d(++_0x1a11f9);}(_0xf9a2,0x10b));var _0x2f9a=function(_0x187972,_0x4e9664){_0x187972=_0x187972-0x0;var _0xc1f4c6=_0xf9a2[_0x187972];return _0xc1f4c6;};'use strict';var _=require(_0x2f9a('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0x2f9a('0x1'));var recordings={};function writeDB(_0x288c35){var _0x3f8fdb;utils[_0x2f9a('0x2')](util[_0x2f9a('0x3')](_0x2f9a('0x4'),_0x288c35[_0x2f9a('0x5')]));if(transfers[_0x2f9a('0x6')][_0x288c35[_0x2f9a('0x5')]]){_0x3f8fdb=_0x288c35[_0x2f9a('0x5')];_0x288c35['uniqueid']=transfers[_0x2f9a('0x6')][_0x288c35[_0x2f9a('0x5')]]['transfereeuniqueid'];}if(_0x288c35[_0x2f9a('0x7')]){utils[_0x2f9a('0x8')](_0x288c35[_0x2f9a('0x7')])[_0x2f9a('0x9')](function(_0x2ca28a){if(_0x2ca28a){_0x288c35[_0x2f9a('0xa')]=_0x2ca28a[_0x2f9a('0xb')];_0x288c35['UserId']=_0x2ca28a['id'];}utils['request'](_0x2f9a('0xc'),_0x288c35);});}else{utils[_0x2f9a('0xd')](_0x2f9a('0xc'),_0x288c35);}if(_0x3f8fdb)delete transfers['blinds'][_0x3f8fdb];}exports[_0x2f9a('0xe')]=function(_0x15d70e){try{utils[_0x2f9a('0xf')](util[_0x2f9a('0x3')]('[%s][recordings][newchannel]',_0x15d70e['uniqueid']),_0x15d70e);if(_0x15d70e[_0x2f9a('0x5')]==_0x15d70e['linkedid']){utils[_0x2f9a('0x2')](util[_0x2f9a('0x3')](_0x2f9a('0x10'),_0x15d70e[_0x2f9a('0x5')],_0x15d70e[_0x2f9a('0x11')],_0x15d70e[_0x2f9a('0x12')]));recordings[_0x15d70e[_0x2f9a('0x5')]]={'uniqueid':_0x15d70e[_0x2f9a('0x5')],'accountcode':_0x15d70e['accountcode'],'exten':_0x15d70e[_0x2f9a('0x12')],'context':_0x15d70e['context'],'channel':_0x15d70e['channel'],'monitors':[]};}}catch(_0x3ea5f1){utils[_0x2f9a('0x13')](util[_0x2f9a('0x3')](_0x2f9a('0x14'),_0x15d70e[_0x2f9a('0x5')]),_0x3ea5f1);}};exports[_0x2f9a('0x15')]=function(_0x2fedf8){try{utils[_0x2f9a('0xf')](util['format'](_0x2f9a('0x16'),_0x2fedf8[_0x2f9a('0x5')]),_0x2fedf8);if(!_[_0x2f9a('0x17')](recordings[_0x2fedf8['uniqueid']])&&_0x2fedf8[_0x2f9a('0x18')]==0x6){utils[_0x2f9a('0x2')](util[_0x2f9a('0x3')](_0x2f9a('0x19'),_0x2fedf8[_0x2f9a('0x5')],_0x2fedf8[_0x2f9a('0x11')],_0x2fedf8[_0x2f9a('0x1a')]));}else if(!_[_0x2f9a('0x17')](recordings[_0x2fedf8[_0x2f9a('0x1b')]])&&_0x2fedf8[_0x2f9a('0x18')]==0x6&&_0x2fedf8[_0x2f9a('0x11')]!=_0x2f9a('0x1c')){utils['info'](util[_0x2f9a('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2fedf8[_0x2f9a('0x5')],_0x2fedf8[_0x2f9a('0x1b')],_0x2fedf8['context'],_0x2fedf8[_0x2f9a('0x1a')]));recordings[_0x2fedf8[_0x2f9a('0x1b')]][_0x2f9a('0x7')]=_0x2fedf8[_0x2f9a('0x7')];}}catch(_0xfb26e6){utils['error'](util[_0x2f9a('0x3')](_0x2f9a('0x16'),_0x2fedf8['uniqueid']),_0xfb26e6);}};exports[_0x2f9a('0x1d')]=function(_0x2490dc){try{if(!_['isNil'](_0x2490dc['variable'])&&!_[_0x2f9a('0x17')](_0x2490dc['variable'][_0x2f9a('0x1e')])){utils['debug'](util['format']('[%s][recordings][varset]',_0x2490dc['uniqueid']),_0x2490dc);utils[_0x2f9a('0x2')](util[_0x2f9a('0x3')](_0x2f9a('0x1f'),_0x2490dc[_0x2f9a('0x5')],_0x2490dc[_0x2f9a('0x20')],_0x2490dc[_0x2f9a('0x21')]));if(_[_0x2f9a('0x22')](_0x2490dc[_0x2f9a('0x21')],_0x2f9a('0x23'))){_0x2490dc['value']=_0x2490dc[_0x2f9a('0x21')][_0x2f9a('0x24')]('.wav49',_0x2f9a('0x25'));}if(recordings[_0x2490dc[_0x2f9a('0x1b')]]){var _0x27e37d=_['find'](recordings[_0x2490dc[_0x2f9a('0x1b')]][_0x2f9a('0x26')],{'value':_0x2490dc[_0x2f9a('0x21')]});if(_[_0x2f9a('0x17')](_0x27e37d)){recordings[_0x2490dc[_0x2f9a('0x1b')]]['monitors'][_0x2f9a('0x27')]({'value':_0x2490dc[_0x2f9a('0x21')]});}}}}catch(_0x3136fb){utils[_0x2f9a('0x13')](util[_0x2f9a('0x3')](_0x2f9a('0x28'),_0x2490dc[_0x2f9a('0x5')]),_0x3136fb);}};exports[_0x2f9a('0x29')]=function(_0x69ac1a){try{if(!_[_0x2f9a('0x17')](recordings[_0x69ac1a[_0x2f9a('0x5')]])){utils['debug'](util[_0x2f9a('0x3')]('[%s][recordings][hangup]',_0x69ac1a[_0x2f9a('0x5')]),_0x69ac1a);utils[_0x2f9a('0x2')](util['format'](_0x2f9a('0x2a'),_0x69ac1a[_0x2f9a('0x5')],_0x69ac1a[_0x2f9a('0x2b')],_0x69ac1a[_0x2f9a('0x2c')],_0x69ac1a[_0x2f9a('0x2d')]));recordings[_0x69ac1a['uniqueid']][_0x2f9a('0x2b')]=_0x69ac1a[_0x2f9a('0x2b')];recordings[_0x69ac1a[_0x2f9a('0x5')]][_0x2f9a('0x2c')]=_0x69ac1a['calleridname'];recordings[_0x69ac1a['uniqueid']]['connectedlinenum']=_0x69ac1a[_0x2f9a('0x2e')];recordings[_0x69ac1a['uniqueid']][_0x2f9a('0x2f')]=_0x69ac1a[_0x2f9a('0x2f')];if(recordings[_0x69ac1a['uniqueid']][_0x2f9a('0x30')]==_0x2f9a('0x31')&&recordings[_0x69ac1a[_0x2f9a('0x5')]][_0x2f9a('0x7')]){recordings[_0x69ac1a[_0x2f9a('0x5')]][_0x2f9a('0x2e')]=recordings[_0x69ac1a['uniqueid']][_0x2f9a('0x7')];recordings[_0x69ac1a[_0x2f9a('0x5')]][_0x2f9a('0x2f')]='';}recordings[_0x69ac1a[_0x2f9a('0x5')]]['monitors'][_0x2f9a('0x32')](function(_0x100bae){var _0x4f1dc4=_['clone'](recordings[_0x69ac1a['uniqueid']]);_0x4f1dc4[_0x2f9a('0x21')]=_0x100bae[_0x2f9a('0x21')];writeDB(_0x4f1dc4);});delete recordings[_0x69ac1a[_0x2f9a('0x5')]];}}catch(_0x5586ea){utils[_0x2f9a('0x13')](util['format']('[%s][recordings][hangup]',_0x69ac1a['uniqueid']),_0x5586ea);}};exports[_0x2f9a('0x33')]=function(_0x4fd822){try{if(!_[_0x2f9a('0x17')](recordings[_0x4fd822['uniqueid']])){utils[_0x2f9a('0xf')](util[_0x2f9a('0x3')](_0x2f9a('0x34'),_0x4fd822[_0x2f9a('0x5')]),_0x4fd822);utils['info'](util[_0x2f9a('0x3')](_0x2f9a('0x35'),_0x4fd822['uniqueid'],_0x4fd822[_0x2f9a('0x36')],_0x4fd822[_0x2f9a('0x37')]));if(_0x4fd822[_0x2f9a('0x36')][_0x2f9a('0x38')]()==_0x2f9a('0x39')&&_[_0x2f9a('0x3a')](_0x4fd822['appdata']['toLowerCase'](),_0x2f9a('0x3b'))){var _0x12c02b=_0x4fd822[_0x2f9a('0x37')][_0x2f9a('0x3c')]('=');var _0x37c5b9=_0x12c02b[0x0][_0x2f9a('0x3d')](_0x12c02b[0x0][_0x2f9a('0x3e')]('(')+0x1,_0x12c02b[0x0]['lastIndexOf'](')'));var _0x2daaf3=_0x12c02b[0x1];recordings[_0x4fd822[_0x2f9a('0x5')]][_0x37c5b9]=_0x2daaf3;}}}catch(_0x7b6ea3){utils['error'](util[_0x2f9a('0x3')](_0x2f9a('0x34'),_0x4fd822[_0x2f9a('0x5')]),_0x7b6ea3);}};exports[_0x2f9a('0x3f')]=function(_0xd85178){try{if(!_[_0x2f9a('0x17')](recordings[_0xd85178[_0x2f9a('0x5')]])){utils[_0x2f9a('0xf')](util[_0x2f9a('0x3')](_0x2f9a('0x40'),_0xd85178['uniqueid']),_0xd85178);utils[_0x2f9a('0x2')](util[_0x2f9a('0x3')](_0x2f9a('0x41'),_0xd85178[_0x2f9a('0x5')],_0xd85178[_0x2f9a('0x42')]));recordings[_0xd85178[_0x2f9a('0x5')]][_0x2f9a('0x42')]=_0xd85178['queue'];}}catch(_0x2e9707){utils[_0x2f9a('0x13')](util[_0x2f9a('0x3')](_0x2f9a('0x40'),_0xd85178[_0x2f9a('0x5')]),_0x2e9707);}};exports[_0x2f9a('0x43')]=function(_0x444b13){try{utils[_0x2f9a('0xf')](util[_0x2f9a('0x3')]('[%s][recordings][blindtransfer]',_0x444b13['uniqueid']),_0x444b13);utils['info'](util[_0x2f9a('0x3')](_0x2f9a('0x44'),_0x444b13['uniqueid'],_0x444b13[_0x2f9a('0x45')],_0x444b13[_0x2f9a('0x46')],_0x444b13[_0x2f9a('0x47')],_0x444b13[_0x2f9a('0x48')]));if(recordings[_0x444b13[_0x2f9a('0x49')]]&&transfers[_0x2f9a('0x6')][_0x444b13['transfereruniqueid']]){transfers['blinds'][_0x444b13[_0x2f9a('0x49')]][_0x2f9a('0x4a')]=!![];}}catch(_0x1bf7b6){utils[_0x2f9a('0x13')](util[_0x2f9a('0x3')](_0x2f9a('0x4b'),_0x444b13[_0x2f9a('0x5')]),_0x1bf7b6);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 2900b73..ac58e40 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 _0xbeac=['origtransferercalleridnum','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','lodash','util','./utils','info','format','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x2ef6ff,_0x4db2bf){var _0x17880a=function(_0x25ef03){while(--_0x25ef03){_0x2ef6ff['push'](_0x2ef6ff['shift']());}};_0x17880a(++_0x4db2bf);}(_0xbeac,0x183));var _0xcbea=function(_0x4e240c,_0x5691c4){_0x4e240c=_0x4e240c-0x0;var _0x5b1f46=_0xbeac[_0x4e240c];return _0x5b1f46;};'use strict';var _=require(_0xcbea('0x0'));var util=require(_0xcbea('0x1'));var utils=require(_0xcbea('0x2'));function writeDB(_0x3d5f84){utils[_0xcbea('0x3')](util[_0xcbea('0x4')]('[%s][transfers][writeDB]\x20type:%s',_0x3d5f84[_0xcbea('0x5')]===_0xcbea('0x6')?_0x3d5f84[_0xcbea('0x7')]:_0x3d5f84[_0xcbea('0x8')],_0x3d5f84['type']));utils[_0xcbea('0x9')](_0xcbea('0xa'),_0x3d5f84);}exports[_0xcbea('0xb')]={};exports[_0xcbea('0xc')]=function(_0x497248){try{utils[_0xcbea('0xd')](util[_0xcbea('0x4')]('[%s][transfers][blindtransfer]',_0x497248[_0xcbea('0x8')]),_0x497248);utils[_0xcbea('0x3')](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x497248[_0xcbea('0x8')],_0x497248[_0xcbea('0xe')],_0x497248[_0xcbea('0xf')],_0x497248['transfereecalleridnum'],_0x497248[_0xcbea('0x10')]));_0x497248[_0xcbea('0x5')]=_0xcbea('0x11');exports['blinds'][_0x497248[_0xcbea('0x12')]]=_0x497248;writeDB(_0x497248);}catch(_0x295599){utils[_0xcbea('0x13')](util['format'](_0xcbea('0x14'),_0x497248['uniqueid']),_0x295599);}};exports[_0xcbea('0x15')]=function(_0x3b1b0a){try{utils[_0xcbea('0xd')](util[_0xcbea('0x4')]('[%s][transfers][attendedtransfer]',_0x3b1b0a[_0xcbea('0x7')]),_0x3b1b0a);utils[_0xcbea('0x3')](util[_0xcbea('0x4')](_0xcbea('0x16'),_0x3b1b0a[_0xcbea('0x7')],_0x3b1b0a[_0xcbea('0x17')],_0x3b1b0a['origtransferercalleridname'],_0x3b1b0a['transfertargetcalleridnum'],_0x3b1b0a['transfertargetcalleridname']));_0x3b1b0a=_[_0xcbea('0x18')](_0x3b1b0a,{'transfererchannel':_0x3b1b0a[_0xcbea('0x19')],'transferercalleridnum':_0x3b1b0a[_0xcbea('0x17')],'transferercalleridname':_0x3b1b0a[_0xcbea('0x1a')],'transfererconnectedlinenum':_0x3b1b0a[_0xcbea('0x1b')],'transfererconnectedlinename':_0x3b1b0a[_0xcbea('0x1c')],'transfereraccountcode':_0x3b1b0a['origtransfereraccountcode'],'transferercontext':_0x3b1b0a[_0xcbea('0x1d')],'transfererexten':_0x3b1b0a[_0xcbea('0x1e')],'transfererlinkedid':_0x3b1b0a[_0xcbea('0x1f')],'context':_0x3b1b0a[_0xcbea('0x20')],'extension':_0x3b1b0a['origtransfererexten'],'type':_0xcbea('0x6')});if(_[_0xcbea('0x21')](_0x3b1b0a['transfereechannel'])){_0x3b1b0a=_[_0xcbea('0x18')](_0x3b1b0a,{'transfereechannel':_0x3b1b0a['transfertargetchannel'],'transfereecalleridnum':_0x3b1b0a[_0xcbea('0x22')],'transfereecalleridname':_0x3b1b0a[_0xcbea('0x23')],'transfereeconnectedlinenum':_0x3b1b0a[_0xcbea('0x24')],'transfereeconnectedlinename':_0x3b1b0a[_0xcbea('0x25')],'transfereeaccountcode':_0x3b1b0a[_0xcbea('0x26')],'transfereecontext':_0x3b1b0a[_0xcbea('0x27')],'transfereeexten':_0x3b1b0a['transfertargetexten'],'transfereelinkedid':_0x3b1b0a[_0xcbea('0x28')]});}writeDB(_0x3b1b0a);}catch(_0xc62560){utils[_0xcbea('0x13')](util['format']('[%s][transfers][attendedtransfer]',_0x3b1b0a[_0xcbea('0x7')]),_0xc62560);}}; \ No newline at end of file +var _0xf0eb=['transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','type','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum'];(function(_0x1ff01c,_0x50601f){var _0x3b6c8e=function(_0x43f4a5){while(--_0x43f4a5){_0x1ff01c['push'](_0x1ff01c['shift']());}};_0x3b6c8e(++_0x50601f);}(_0xf0eb,0x7b));var _0xbf0e=function(_0x27c24e,_0x5db1c7){_0x27c24e=_0x27c24e-0x0;var _0x39004a=_0xf0eb[_0x27c24e];return _0x39004a;};'use strict';var _=require(_0xbf0e('0x0'));var util=require(_0xbf0e('0x1'));var utils=require(_0xbf0e('0x2'));function writeDB(_0x2fde95){utils[_0xbf0e('0x3')](util[_0xbf0e('0x4')]('[%s][transfers][writeDB]\x20type:%s',_0x2fde95[_0xbf0e('0x5')]==='attended'?_0x2fde95[_0xbf0e('0x6')]:_0x2fde95['uniqueid'],_0x2fde95[_0xbf0e('0x5')]));utils[_0xbf0e('0x7')](_0xbf0e('0x8'),_0x2fde95);}exports[_0xbf0e('0x9')]={};exports[_0xbf0e('0xa')]=function(_0x56f0f9){try{utils[_0xbf0e('0xb')](util['format'](_0xbf0e('0xc'),_0x56f0f9[_0xbf0e('0xd')]),_0x56f0f9);utils[_0xbf0e('0x3')](util[_0xbf0e('0x4')](_0xbf0e('0xe'),_0x56f0f9[_0xbf0e('0xd')],_0x56f0f9[_0xbf0e('0xf')],_0x56f0f9[_0xbf0e('0x10')],_0x56f0f9[_0xbf0e('0x11')],_0x56f0f9[_0xbf0e('0x12')]));_0x56f0f9[_0xbf0e('0x5')]=_0xbf0e('0x13');exports['blinds'][_0x56f0f9[_0xbf0e('0x14')]]=_0x56f0f9;writeDB(_0x56f0f9);}catch(_0x34ec83){utils[_0xbf0e('0x15')](util[_0xbf0e('0x4')](_0xbf0e('0xc'),_0x56f0f9[_0xbf0e('0xd')]),_0x34ec83);}};exports[_0xbf0e('0x16')]=function(_0x2ea922){try{utils['debug'](util[_0xbf0e('0x4')](_0xbf0e('0x17'),_0x2ea922[_0xbf0e('0x6')]),_0x2ea922);utils['info'](util[_0xbf0e('0x4')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2ea922[_0xbf0e('0x6')],_0x2ea922['origtransferercalleridnum'],_0x2ea922[_0xbf0e('0x18')],_0x2ea922[_0xbf0e('0x19')],_0x2ea922[_0xbf0e('0x1a')]));_0x2ea922=_[_0xbf0e('0x1b')](_0x2ea922,{'transfererchannel':_0x2ea922[_0xbf0e('0x1c')],'transferercalleridnum':_0x2ea922[_0xbf0e('0x1d')],'transferercalleridname':_0x2ea922[_0xbf0e('0x18')],'transfererconnectedlinenum':_0x2ea922['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2ea922[_0xbf0e('0x1e')],'transfereraccountcode':_0x2ea922[_0xbf0e('0x1f')],'transferercontext':_0x2ea922[_0xbf0e('0x20')],'transfererexten':_0x2ea922[_0xbf0e('0x21')],'transfererlinkedid':_0x2ea922[_0xbf0e('0x22')],'context':_0x2ea922[_0xbf0e('0x23')],'extension':_0x2ea922[_0xbf0e('0x24')],'type':_0xbf0e('0x25')});if(_[_0xbf0e('0x26')](_0x2ea922[_0xbf0e('0x27')])){_0x2ea922=_[_0xbf0e('0x1b')](_0x2ea922,{'transfereechannel':_0x2ea922[_0xbf0e('0x28')],'transfereecalleridnum':_0x2ea922[_0xbf0e('0x19')],'transfereecalleridname':_0x2ea922[_0xbf0e('0x1a')],'transfereeconnectedlinenum':_0x2ea922[_0xbf0e('0x29')],'transfereeconnectedlinename':_0x2ea922[_0xbf0e('0x2a')],'transfereeaccountcode':_0x2ea922[_0xbf0e('0x2b')],'transfereecontext':_0x2ea922[_0xbf0e('0x2c')],'transfereeexten':_0x2ea922[_0xbf0e('0x2d')],'transfereelinkedid':_0x2ea922[_0xbf0e('0x2e')]});}writeDB(_0x2ea922);}catch(_0x230e6a){utils[_0xbf0e('0x15')](util['format']('[%s][transfers][attendedtransfer]',_0x2ea922[_0xbf0e('0x6')]),_0x230e6a);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index b8a1acb..897c1c6 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 _0xf9fb=['acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','sumTime','now','format','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','../../config/logger','xdr','info','debug','error','inspect','request','then','[utils][request]\x20name:%s','catch','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue'];(function(_0x123eb8,_0x861f20){var _0x3cbb46=function(_0x4e2b92){while(--_0x4e2b92){_0x123eb8['push'](_0x123eb8['shift']());}};_0x3cbb46(++_0x861f20);}(_0xf9fb,0x177));var _0xbf9f=function(_0x11a261,_0x2587cc){_0x11a261=_0x11a261-0x0;var _0x4b998b=_0xf9fb[_0x11a261];return _0x4b998b;};'use strict';var BPromise=require(_0xbf9f('0x0'));var jayson=require(_0xbf9f('0x1'));var moment=require(_0xbf9f('0x2'));var util=require(_0xbf9f('0x3'));var client=jayson[_0xbf9f('0x4')]['http']({'port':0x2329});var logger=require(_0xbf9f('0x5'))(_0xbf9f('0x6'));exports[_0xbf9f('0x7')]=function(_0x293cfa,_0x621ab){logger[_0xbf9f('0x7')](_0x293cfa,_0x621ab?util['inspect'](_0x621ab,{'showHidden':![],'depth':null}):'');};exports[_0xbf9f('0x8')]=function(_0x5a2877,_0x54fedc){logger['debug'](_0x5a2877,_0x54fedc?util['inspect'](_0x54fedc,{'showHidden':![],'depth':null}):'');};exports[_0xbf9f('0x9')]=function(_0xd85f44,_0x5f2b4a){logger[_0xbf9f('0x9')](_0xd85f44,_0x5f2b4a?util[_0xbf9f('0xa')](_0x5f2b4a,{'showHidden':![],'depth':null}):'');};exports[_0xbf9f('0xb')]=function(_0x59b4fd,_0x470fac){return client[_0xbf9f('0xb')](_0x59b4fd,{'body':_0x470fac})[_0xbf9f('0xc')](function(_0x5ea8cd){logger[_0xbf9f('0x8')](_0xbf9f('0xd'),_0x59b4fd,_0x5ea8cd?util['inspect'](_0x5ea8cd,{'showHidden':![],'depth':null}):'');})[_0xbf9f('0xe')](function(_0x52efb8){logger[_0xbf9f('0x9')](_0xbf9f('0xd'),_0x59b4fd,_0x52efb8?util[_0xbf9f('0xa')](_0x52efb8,{'showHidden':![],'depth':null}):'');});};function getUser(_0x42e650){return client[_0xbf9f('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xbf9f('0xf'),_0xbf9f('0x10'),_0xbf9f('0x11')],'where':_0x42e650,'limit':0x1}})[_0xbf9f('0xc')](function(_0x24f9bc){logger[_0xbf9f('0x8')](_0xbf9f('0x12'),JSON[_0xbf9f('0x13')](_0x42e650),_0x24f9bc?util[_0xbf9f('0xa')](_0x24f9bc,{'showHidden':![],'depth':null}):'');return _0x24f9bc[_0xbf9f('0x14')]['length']?_0x24f9bc['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x39b256){return new BPromise(function(_0x49f5d3,_0x2c06a5){if(_0x39b256){return getUser({'internal':_0x39b256})['then'](function(_0x1f2920){logger[_0xbf9f('0x7')](_0xbf9f('0x15'),_0x39b256,_0x1f2920?_0xbf9f('0x16'):_0xbf9f('0x17'));return _0x49f5d3(_0x1f2920);})[_0xbf9f('0xe')](function(_0x40852a){logger[_0xbf9f('0x9')]('[utils][getUserByInternal]',_0x40852a?util[_0xbf9f('0xa')](_0x40852a,{'showHidden':![],'depth':null}):'');return _0x49f5d3(null);});}return _0x49f5d3(null);});};exports['getUserByInterface']=function(_0x274ea6){return new BPromise(function(_0x72ccdb,_0x3dc016){if(_0x274ea6){return getUser({'interface':_0x274ea6})['then'](function(_0x3d001f){logger['info'](_0xbf9f('0x18'),_0x274ea6,_0x3d001f?'found':'notfound');return _0x72ccdb(_0x3d001f);})['catch'](function(_0x1caf6a){logger[_0xbf9f('0x9')](_0xbf9f('0x19'),_0x1caf6a?util[_0xbf9f('0xa')](_0x1caf6a,{'showHidden':![],'depth':null}):'');return _0x72ccdb(null);});}return _0x72ccdb(null);});};exports['getUserByName']=function(_0x2f6fb0){return new BPromise(function(_0x19451c,_0x336786){if(_0x2f6fb0){return getUser({'name':_0x2f6fb0})[_0xbf9f('0xc')](function(_0x489584){logger[_0xbf9f('0x7')](_0xbf9f('0x1a'),_0x2f6fb0,_0x489584?_0xbf9f('0x16'):_0xbf9f('0x17'));return _0x19451c(_0x489584);})[_0xbf9f('0xe')](function(_0x4f4a84){logger[_0xbf9f('0x9')](_0xbf9f('0x1b'),_0x4f4a84?util[_0xbf9f('0xa')](_0x4f4a84,{'showHidden':![],'depth':null}):'');return _0x19451c(null);});}return _0x19451c(null);});};exports[_0xbf9f('0x1c')]=function(_0x3e152e){return new BPromise(function(_0x5bdd12,_0x1b2839){if(_0x3e152e){return client[_0xbf9f('0xb')](_0xbf9f('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xbf9f('0x10'),'type',_0xbf9f('0x1e'),'acwTimeout'],'where':{'name':_0x3e152e},'limit':0x1}})[_0xbf9f('0xc')](function(_0xdd8bbf){logger[_0xbf9f('0x8')](_0xbf9f('0x1f'),_0x3e152e,_0xdd8bbf?util['inspect'](_0xdd8bbf,{'showHidden':![],'depth':null}):'');logger['info'](_0xbf9f('0x20'),_0x3e152e,_0xdd8bbf?_0xbf9f('0x16'):_0xbf9f('0x17'));return _0x5bdd12(_0xdd8bbf['result'][_0xbf9f('0x21')]?_0xdd8bbf[_0xbf9f('0x14')][0x0]:null);})[_0xbf9f('0xe')](function(_0x240a30){logger[_0xbf9f('0x9')](_0xbf9f('0x22'),_0x240a30?util[_0xbf9f('0xa')](_0x240a30,{'showHidden':![],'depth':null}):'');return _0x5bdd12(null);});}return _0x5bdd12(null);});};exports['addTime']=function(_0x30ca72,_0x2c49f7){return moment(_0x30ca72)['add'](_0x2c49f7,_0xbf9f('0x23'))['format'](_0xbf9f('0x24'));};exports[_0xbf9f('0x25')]=function(_0x518478,_0x1ffe38){return moment(_0x518478)[_0xbf9f('0x26')](_0x1ffe38,_0xbf9f('0x23'))['format'](_0xbf9f('0x24'));};exports['diffTime']=function(_0xca5ebd,_0x5a6cbe){return moment(_0xca5ebd)[_0xbf9f('0x27')](moment(_0x5a6cbe),'seconds');};exports[_0xbf9f('0x28')]=function(_0x22761c,_0x53e257){return parseInt(_0x22761c,0xa)+parseInt(_0x53e257,0xa);};exports[_0xbf9f('0x29')]=function(){return moment()[_0xbf9f('0x2a')](_0xbf9f('0x24'));};exports[_0xbf9f('0x2b')]=function(_0x30ddc5,_0x3dd940){if(_0x3dd940){return moment(_0x30ddc5)[_0xbf9f('0x2b')](_0x3dd940);}return!![];};exports[_0xbf9f('0x2c')]=function(_0xf7da64,_0x4ffacf){if(_0x4ffacf){return moment(_0xf7da64)[_0xbf9f('0x2c')](_0x4ffacf);}else if(_0xf7da64){return!![];}return![];}; \ No newline at end of file +var _0x6931=['isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','name','stringify','result','[utils][getUserByInternal]\x20internal:%s\x20%s','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','acw','[utils][getVoiceQueueByName]\x20name:%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','diff','sumTime','now'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6931,0x1a9));var _0x1693=function(_0x585dc3,_0x6112aa){_0x585dc3=_0x585dc3-0x0;var _0x113940=_0x6931[_0x585dc3];return _0x113940;};'use strict';var BPromise=require(_0x1693('0x0'));var jayson=require(_0x1693('0x1'));var moment=require(_0x1693('0x2'));var util=require(_0x1693('0x3'));var client=jayson[_0x1693('0x4')][_0x1693('0x5')]({'port':0x2329});var logger=require(_0x1693('0x6'))(_0x1693('0x7'));exports['info']=function(_0x19ff1c,_0x2ca960){logger[_0x1693('0x8')](_0x19ff1c,_0x2ca960?util[_0x1693('0x9')](_0x2ca960,{'showHidden':![],'depth':null}):'');};exports[_0x1693('0xa')]=function(_0x5de567,_0x3ab149){logger[_0x1693('0xa')](_0x5de567,_0x3ab149?util[_0x1693('0x9')](_0x3ab149,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0xc66466,_0x2dfab9){logger[_0x1693('0xb')](_0xc66466,_0x2dfab9?util[_0x1693('0x9')](_0x2dfab9,{'showHidden':![],'depth':null}):'');};exports[_0x1693('0xc')]=function(_0x181184,_0x26ba4b){return client[_0x1693('0xc')](_0x181184,{'body':_0x26ba4b})[_0x1693('0xd')](function(_0x362403){logger[_0x1693('0xa')]('[utils][request]\x20name:%s',_0x181184,_0x362403?util[_0x1693('0x9')](_0x362403,{'showHidden':![],'depth':null}):'');})[_0x1693('0xe')](function(_0x280986){logger[_0x1693('0xb')](_0x1693('0xf'),_0x181184,_0x280986?util[_0x1693('0x9')](_0x280986,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4744ed){return client['request'](_0x1693('0x10'),{'options':{'raw':!![],'attributes':['id','internal',_0x1693('0x11'),'interface'],'where':_0x4744ed,'limit':0x1}})[_0x1693('0xd')](function(_0x380cf5){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0x1693('0x12')](_0x4744ed),_0x380cf5?util['inspect'](_0x380cf5,{'showHidden':![],'depth':null}):'');return _0x380cf5['result']['length']?_0x380cf5[_0x1693('0x13')][0x0]:null;});}exports['getUserByInternal']=function(_0x49e7fb){return new BPromise(function(_0x2a3bc2,_0x1a270b){if(_0x49e7fb){return getUser({'internal':_0x49e7fb})[_0x1693('0xd')](function(_0xdd00ed){logger[_0x1693('0x8')](_0x1693('0x14'),_0x49e7fb,_0xdd00ed?'found':'notfound');return _0x2a3bc2(_0xdd00ed);})[_0x1693('0xe')](function(_0x3d1559){logger['error'](_0x1693('0x15'),_0x3d1559?util[_0x1693('0x9')](_0x3d1559,{'showHidden':![],'depth':null}):'');return _0x2a3bc2(null);});}return _0x2a3bc2(null);});};exports[_0x1693('0x16')]=function(_0xd2ff89){return new BPromise(function(_0x2e0ada,_0x4f0f17){if(_0xd2ff89){return getUser({'interface':_0xd2ff89})[_0x1693('0xd')](function(_0x433db6){logger[_0x1693('0x8')](_0x1693('0x17'),_0xd2ff89,_0x433db6?_0x1693('0x18'):_0x1693('0x19'));return _0x2e0ada(_0x433db6);})['catch'](function(_0x45ceea){logger['error'](_0x1693('0x1a'),_0x45ceea?util[_0x1693('0x9')](_0x45ceea,{'showHidden':![],'depth':null}):'');return _0x2e0ada(null);});}return _0x2e0ada(null);});};exports[_0x1693('0x1b')]=function(_0x56bc00){return new BPromise(function(_0x108ba9,_0x341a72){if(_0x56bc00){return getUser({'name':_0x56bc00})[_0x1693('0xd')](function(_0x4142e7){logger[_0x1693('0x8')](_0x1693('0x1c'),_0x56bc00,_0x4142e7?_0x1693('0x18'):'notfound');return _0x108ba9(_0x4142e7);})[_0x1693('0xe')](function(_0x4ef8eb){logger[_0x1693('0xb')]('[utils][getUserByName]',_0x4ef8eb?util[_0x1693('0x9')](_0x4ef8eb,{'showHidden':![],'depth':null}):'');return _0x108ba9(null);});}return _0x108ba9(null);});};exports[_0x1693('0x1d')]=function(_0x437eb9){return new BPromise(function(_0x148438,_0x5888d7){if(_0x437eb9){return client[_0x1693('0xc')](_0x1693('0x1e'),{'options':{'raw':!![],'attributes':['id','name','type',_0x1693('0x1f'),'acwTimeout'],'where':{'name':_0x437eb9},'limit':0x1}})['then'](function(_0x5ce409){logger[_0x1693('0xa')](_0x1693('0x20'),_0x437eb9,_0x5ce409?util['inspect'](_0x5ce409,{'showHidden':![],'depth':null}):'');logger[_0x1693('0x8')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x437eb9,_0x5ce409?_0x1693('0x18'):'notfound');return _0x148438(_0x5ce409[_0x1693('0x13')][_0x1693('0x21')]?_0x5ce409[_0x1693('0x13')][0x0]:null);})['catch'](function(_0x2c4805){logger[_0x1693('0xb')](_0x1693('0x22'),_0x2c4805?util[_0x1693('0x9')](_0x2c4805,{'showHidden':![],'depth':null}):'');return _0x148438(null);});}return _0x148438(null);});};exports[_0x1693('0x23')]=function(_0x30ee2b,_0x26c86f){return moment(_0x30ee2b)[_0x1693('0x24')](_0x26c86f,_0x1693('0x25'))[_0x1693('0x26')](_0x1693('0x27'));};exports[_0x1693('0x28')]=function(_0x4c4c65,_0x2e46d9){return moment(_0x4c4c65)['subtract'](_0x2e46d9,_0x1693('0x25'))[_0x1693('0x26')](_0x1693('0x27'));};exports[_0x1693('0x29')]=function(_0x240c97,_0x44bda8){return moment(_0x240c97)[_0x1693('0x2a')](moment(_0x44bda8),_0x1693('0x25'));};exports[_0x1693('0x2b')]=function(_0x528709,_0x163731){return parseInt(_0x528709,0xa)+parseInt(_0x163731,0xa);};exports[_0x1693('0x2c')]=function(){return moment()[_0x1693('0x26')](_0x1693('0x27'));};exports[_0x1693('0x2d')]=function(_0x3b37a1,_0x3a49cf){if(_0x3a49cf){return moment(_0x3b37a1)[_0x1693('0x2d')](_0x3a49cf);}return!![];};exports[_0x1693('0x2e')]=function(_0x179665,_0x58bf2a){if(_0x58bf2a){return moment(_0x179665)['isBefore'](_0x58bf2a);}else if(_0x179665){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 3865424..15c0997 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15f8=['api','auth','set','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','method','headers','x-forwarded-for','connection','inspect','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','format','statusCode','responseTime','other','agent_name','url','setupLoggers','fs-extra','lodash','path','util','fileLogger','./safe-template','safeTemplate','join','log','xcally','role','name','then','user','no-user','timestamp','catch','error'];(function(_0x3e7691,_0xb42f02){var _0x3ec82b=function(_0x54f16f){while(--_0x54f16f){_0x3e7691['push'](_0x3e7691['shift']());}};_0x3ec82b(++_0xb42f02);}(_0x15f8,0xc0));var _0x815f=function(_0x295b70,_0x442203){_0x295b70=_0x295b70-0x0;var _0x28dd6d=_0x15f8[_0x295b70];return _0x28dd6d;};var fs=require(_0x815f('0x0'));var _=require(_0x815f('0x1'));var ewinston=require('express-winston');var path=require(_0x815f('0x2'));var util=require(_0x815f('0x3'));var fileLogger=require('./loggers')[_0x815f('0x4')];var safeTemplate=require(_0x815f('0x5'))[_0x815f('0x6')];var maskSensitiveData=require('./mask-sensitive-data')['maskSensitiveData'];function ClientSideLogger(){function _0x3da44a(_0x39df28){var _0xbc04f9=path[_0x815f('0x7')]('/var',_0x815f('0x8'),_0x815f('0x9'));var _0x2d191b=path[_0x815f('0x7')]('client',_0x39df28[_0x815f('0xa')]+'-'+_0x39df28[_0x815f('0xb')]);return fs['ensureDir'](path[_0x815f('0x7')](_0xbc04f9,_0x2d191b))[_0x815f('0xc')](function(){var _0x385652=fileLogger('client',path[_0x815f('0x7')](_0xbc04f9,_0x2d191b));return _0x385652;})['catch'](function(_0x4e223b){throw _0x4e223b;});}this['log']=function(_0x2a073a,_0x7595ce,_0x6d96f3,_0x52da97){return _0x3da44a(_0x2a073a[_0x815f('0xd')])['then'](function(_0x3936b5){var _0x4b2333=_0x3936b5[_0x7595ce];return _0x4b2333;})['then'](function(_0x3ee532){var _0x4bcbfd=_0x2a073a[_0x815f('0xd')]?_0x2a073a[_0x815f('0xd')]['id']:_0x815f('0xe');var _0x430e17=_0x52da97['data'];var _0xe2b23=_0x52da97[_0x815f('0xf')];var _0x41b8f4=new Date(Number(_0xe2b23));return _0x3ee532(_0x4bcbfd,_0x41b8f4,_0x6d96f3,_0x430e17);})[_0x815f('0x10')](function(_0xb8d389){fileLogger('client')[_0x815f('0x11')](_0xb8d389);});};}function setupLoggers(_0x588862){return new Promise(function(_0x42605c){var _0x68706b=new ClientSideLogger();var _0x57ea37=fileLogger(_0x815f('0x12'));var _0x520082=fileLogger(_0x815f('0x13'));_0x588862[_0x815f('0x14')]('client-side-logger',_0x68706b);_0x588862['use'](ewinston['logger']({'winstonInstance':_0x57ea37,'meta':![],'statusLevels':!![],'msg':function(_0x4663f5,_0xabda3c){var _0x35b2be=_0x815f('0x15');if(!_[_0x815f('0x16')](_0x4663f5[_0x815f('0x17')])){_0x35b2be+=_0x815f('0x18');var _0x37c6dd=_0x4663f5['body'];maskSensitiveData(_0x37c6dd);}return safeTemplate(util['format'](_0x35b2be,_0x4663f5[_0x815f('0x19')],_0x4663f5[_0x815f('0x1a')]['x-forwarded-for']?_0x4663f5[_0x815f('0x1a')][_0x815f('0x1b')]:_0x4663f5[_0x815f('0x1c')]['remoteAddress']||_0x4663f5['ip'],_0x4663f5['url'],_0xabda3c['statusCode'],_0xabda3c['responseTime'],_0x4663f5['user']?_0x4663f5[_0x815f('0xd')]['id']:null,_0x4663f5['user']?_0x4663f5['user']['name']:null,_0x4663f5[_0x815f('0xd')]?_0x4663f5[_0x815f('0xd')][_0x815f('0xa')]:null,_0x37c6dd?util[_0x815f('0x1d')](_0x37c6dd,![],null):''));}}));_0x588862[_0x815f('0x1e')](ewinston[_0x815f('0x1f')]({'winstonInstance':_0x520082,'meta':![],'statusLevels':!![],'msg':function(_0x792c1b,_0x5240e4){var _0x118f11=_0x815f('0x20');if(_0x792c1b[_0x815f('0x17')]&&_0x792c1b[_0x815f('0x17')][_0x815f('0x21')]&&_0x792c1b['body'][_0x815f('0x22')]){_0x118f11='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x815f('0x23')](_0x118f11,_0x792c1b[_0x815f('0x19')],_0x792c1b[_0x815f('0x1a')][_0x815f('0x1b')]?_0x792c1b['headers'][_0x815f('0x1b')]:_0x792c1b[_0x815f('0x1c')]['remoteAddress']||_0x792c1b['ip'],_0x792c1b['url'],_0x5240e4[_0x815f('0x24')],_0x5240e4[_0x815f('0x25')],_0x792c1b[_0x815f('0xd')]?_0x792c1b[_0x815f('0xd')]['id']:null,_0x792c1b['user']?_0x792c1b['user']['name']:null,_0x792c1b[_0x815f('0xd')]?_0x792c1b['user']['role']:null,_0x792c1b[_0x815f('0x17')]&&_0x792c1b['body'][_0x815f('0x21')]?_0x792c1b['body']['device']:_0x815f('0x26'),_0x792c1b[_0x815f('0x17')]&&_0x792c1b['body'][_0x815f('0x22')]?_0x792c1b[_0x815f('0x17')]['agent_id']:'',_0x792c1b[_0x815f('0x17')]&&_0x792c1b['body'][_0x815f('0x27')]?_0x792c1b['body'][_0x815f('0x27')]:'');},'ignoreRoute':function(_0xf21a22){var _0xd8d569=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xd8d569['test'](_0xf21a22[_0x815f('0x28')]);}}));return _0x42605c();});}exports[_0x815f('0x29')]=setupLoggers; \ No newline at end of file +var _0xf332=['url','statusCode','device','agent_name','test','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./mask-sensitive-data','maskSensitiveData','/var','log','join','ensureDir','then','client','catch','user','no-user','data','timestamp','error','api','auth','client-side-logger','logger','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','connection','remoteAddress','responseTime','name','role','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf332,0x92));var _0x2f33=function(_0x3f318d,_0x11039d){_0x3f318d=_0x3f318d-0x0;var _0x29bf89=_0xf332[_0x3f318d];return _0x29bf89;};var fs=require(_0x2f33('0x0'));var _=require(_0x2f33('0x1'));var ewinston=require(_0x2f33('0x2'));var path=require(_0x2f33('0x3'));var util=require(_0x2f33('0x4'));var fileLogger=require(_0x2f33('0x5'))[_0x2f33('0x6')];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require(_0x2f33('0x7'))[_0x2f33('0x8')];function ClientSideLogger(){function _0x518c77(_0xfd6f87){var _0x328511=path['join'](_0x2f33('0x9'),_0x2f33('0xa'),'xcally');var _0x4f54b0=path[_0x2f33('0xb')]('client',_0xfd6f87['role']+'-'+_0xfd6f87['name']);return fs[_0x2f33('0xc')](path[_0x2f33('0xb')](_0x328511,_0x4f54b0))[_0x2f33('0xd')](function(){var _0x568687=fileLogger(_0x2f33('0xe'),path[_0x2f33('0xb')](_0x328511,_0x4f54b0));return _0x568687;})[_0x2f33('0xf')](function(_0x1e49b0){throw _0x1e49b0;});}this['log']=function(_0x4f0af7,_0x54a5d3,_0x5e85be,_0x405066){return _0x518c77(_0x4f0af7['user'])['then'](function(_0x1c74eb){var _0x145040=_0x1c74eb[_0x54a5d3];return _0x145040;})['then'](function(_0x556fda){var _0x4ae191=_0x4f0af7[_0x2f33('0x10')]?_0x4f0af7[_0x2f33('0x10')]['id']:_0x2f33('0x11');var _0x38d2d7=_0x405066[_0x2f33('0x12')];var _0x316799=_0x405066[_0x2f33('0x13')];var _0x111dda=new Date(Number(_0x316799));return _0x556fda(_0x4ae191,_0x111dda,_0x5e85be,_0x38d2d7);})[_0x2f33('0xf')](function(_0x1ff83a){fileLogger(_0x2f33('0xe'))[_0x2f33('0x14')](_0x1ff83a);});};}function setupLoggers(_0x140a1c){return new Promise(function(_0xfaa4bf){var _0x12abff=new ClientSideLogger();var _0x5f1ac2=fileLogger(_0x2f33('0x15'));var _0x4d152a=fileLogger(_0x2f33('0x16'));_0x140a1c['set'](_0x2f33('0x17'),_0x12abff);_0x140a1c['use'](ewinston[_0x2f33('0x18')]({'winstonInstance':_0x5f1ac2,'meta':![],'statusLevels':!![],'msg':function(_0x1fbab2,_0x16352a){var _0x5b609e='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x2f33('0x19')](_0x1fbab2[_0x2f33('0x1a')])){_0x5b609e+=_0x2f33('0x1b');var _0x4327d7=_0x1fbab2[_0x2f33('0x1a')];maskSensitiveData(_0x4327d7);}return safeTemplate(util[_0x2f33('0x1c')](_0x5b609e,_0x1fbab2['method'],_0x1fbab2[_0x2f33('0x1d')][_0x2f33('0x1e')]?_0x1fbab2[_0x2f33('0x1d')][_0x2f33('0x1e')]:_0x1fbab2[_0x2f33('0x1f')][_0x2f33('0x20')]||_0x1fbab2['ip'],_0x1fbab2['url'],_0x16352a['statusCode'],_0x16352a[_0x2f33('0x21')],_0x1fbab2[_0x2f33('0x10')]?_0x1fbab2['user']['id']:null,_0x1fbab2[_0x2f33('0x10')]?_0x1fbab2[_0x2f33('0x10')][_0x2f33('0x22')]:null,_0x1fbab2[_0x2f33('0x10')]?_0x1fbab2[_0x2f33('0x10')][_0x2f33('0x23')]:null,_0x4327d7?util[_0x2f33('0x24')](_0x4327d7,![],null):''));}}));_0x140a1c[_0x2f33('0x25')](ewinston['logger']({'winstonInstance':_0x4d152a,'meta':![],'statusLevels':!![],'msg':function(_0x4eed0a,_0x3d6af3){var _0x234637=_0x2f33('0x26');if(_0x4eed0a[_0x2f33('0x1a')]&&_0x4eed0a[_0x2f33('0x1a')]['device']&&_0x4eed0a[_0x2f33('0x1a')][_0x2f33('0x27')]){_0x234637=_0x2f33('0x28');}return util[_0x2f33('0x1c')](_0x234637,_0x4eed0a[_0x2f33('0x29')],_0x4eed0a['headers'][_0x2f33('0x1e')]?_0x4eed0a[_0x2f33('0x1d')][_0x2f33('0x1e')]:_0x4eed0a[_0x2f33('0x1f')][_0x2f33('0x20')]||_0x4eed0a['ip'],_0x4eed0a[_0x2f33('0x2a')],_0x3d6af3[_0x2f33('0x2b')],_0x3d6af3[_0x2f33('0x21')],_0x4eed0a[_0x2f33('0x10')]?_0x4eed0a[_0x2f33('0x10')]['id']:null,_0x4eed0a['user']?_0x4eed0a[_0x2f33('0x10')][_0x2f33('0x22')]:null,_0x4eed0a['user']?_0x4eed0a['user'][_0x2f33('0x23')]:null,_0x4eed0a[_0x2f33('0x1a')]&&_0x4eed0a['body']['device']?_0x4eed0a[_0x2f33('0x1a')][_0x2f33('0x2c')]:'other',_0x4eed0a['body']&&_0x4eed0a[_0x2f33('0x1a')][_0x2f33('0x27')]?_0x4eed0a[_0x2f33('0x1a')][_0x2f33('0x27')]:'',_0x4eed0a[_0x2f33('0x1a')]&&_0x4eed0a[_0x2f33('0x1a')]['agent_name']?_0x4eed0a[_0x2f33('0x1a')][_0x2f33('0x2d')]:'');},'ignoreRoute':function(_0x3b1819){var _0x24057e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x24057e[_0x2f33('0x2e')](_0x3b1819[_0x2f33('0x2a')]);}}));return _0xfaa4bf();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 9720bb9..31958c2 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6468=['bold\x20yellow','white','bold\x20white','bold\x20green','gray','addColors','join','%s-%s.log','message','{{{','replace','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','warn','%s-%s','error','File','Console','consoleLogger','winston','../config/environment','debugLevel','toLowerCase','redBG\x20white','red'];(function(_0x471273,_0x1587f1){var _0x56c63e=function(_0x4464f0){while(--_0x4464f0){_0x471273['push'](_0x471273['shift']());}};_0x56c63e(++_0x1587f1);}(_0x6468,0xf6));var _0x8646=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x6468[_0x4dbaad];return _0x226c72;};'use strict';var path=require('path');var util=require('util');var moment=require('moment');var winston=require(_0x8646('0x0'));var config=require(_0x8646('0x1'));var debugLevel=config[_0x8646('0x2')]?config[_0x8646('0x2')][_0x8646('0x3')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x8646('0x4'),'error':_0x8646('0x5'),'warn':_0x8646('0x6'),'info':_0x8646('0x7'),'print':_0x8646('0x8'),'success':_0x8646('0x9'),'http':_0x8646('0xa'),'verbose':'bold\x20magenta','debug':'bold\x20blue','silly':'bold\x20cyan'};winston[_0x8646('0xb')](XC_LOG_COLORS);function getLogFileName(_0x933fb7,_0xdba4b6,_0x1e9df6){var _0xf4fb85=_0x933fb7||'/var/log/xcally';return path[_0x8646('0xc')](_0xf4fb85,util['format'](_0x8646('0xd'),_0xdba4b6,_0x1e9df6));}function formatter(_0x2f97e6,_0x5eb568){_0x5eb568[_0x8646('0xe')]=_0x5eb568[_0x8646('0xe')]['replace'](/@@{/g,_0x8646('0xf'))[_0x8646('0x10')](/}@@/g,_0x8646('0x11'))[_0x8646('0x10')](/@{/g,'{{')[_0x8646('0x10')](/}@/g,'}}');return util[_0x8646('0x12')](_0x8646('0x13'),moment()[_0x8646('0x12')](_0x8646('0x14')),_0x5eb568[_0x8646('0x15')][_0x8646('0x16')](),_0x2f97e6,_0x5eb568[_0x8646('0xe')]);}function fileFormat(_0x159233,_0x1ff08c){_0x1ff08c[_0x8646('0xe')]=_0x1ff08c[_0x8646('0xe')][_0x8646('0x10')](/@@{/g,'{{{')[_0x8646('0x10')](/}@@/g,_0x8646('0x11'))[_0x8646('0x10')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x56d204=_0x1ff08c[_0x8646('0x17')]&&Object[_0x8646('0x18')](_0x1ff08c['meta'])[_0x8646('0x19')]?'\x0a\x09'+JSON[_0x8646('0x1a')](_0x1ff08c[_0x8646('0x17')]):'';return util[_0x8646('0x12')](_0x8646('0x1b'),moment()[_0x8646('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),_0x1ff08c['level'][_0x8646('0x16')](),_0x159233,_0x1ff08c[_0x8646('0xe')],_0x56d204);}function consoleLogger(){var _0x181a0b=new winston[(_0x8646('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x8646('0x1d'))]['Console']({'level':_0x8646('0x1e'),'json':![],'formatter':function(_0x589030){return formatter('',_0x589030);}})]});return _0x181a0b;}function fileLogger(_0x32bdd2,_0x1af6ba){var _0x1a9356=new winston[(_0x8646('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['File']({'name':util[_0x8646('0x12')](_0x8646('0x1f'),_0x32bdd2,_0x8646('0x20')),'filename':getLogFileName(_0x1af6ba,_0x32bdd2,_0x8646('0x20')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4b1612){return fileFormat(_0x32bdd2,_0x4b1612);}}),new winston[(_0x8646('0x1d'))][(_0x8646('0x21'))]({'name':util['format'](_0x8646('0x1f'),_0x32bdd2,debugLevel),'filename':getLogFileName(_0x1af6ba,_0x32bdd2,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x521738){return fileFormat(_0x32bdd2,_0x521738);}}),new winston[(_0x8646('0x1d'))][(_0x8646('0x22'))]({'level':'warn','json':![],'formatter':function(_0xbf938b){return fileFormat(_0x32bdd2,_0xbf938b);}})]});return _0x1a9356;}exports[_0x8646('0x23')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x35bc=['warn','File','%s-%s','error','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','info','bold\x20yellow','white','gray','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','join','%s-%s.log','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','meta','keys','length','stringify','Logger','transports','Console'];(function(_0x5ce075,_0x20b649){var _0x595e7d=function(_0x4384dc){while(--_0x4384dc){_0x5ce075['push'](_0x5ce075['shift']());}};_0x595e7d(++_0x20b649);}(_0x35bc,0x1f4));var _0xc35b=function(_0x310c0a,_0x4ec103){_0x310c0a=_0x310c0a-0x0;var _0x599109=_0x35bc[_0x310c0a];return _0x599109;};'use strict';var path=require(_0xc35b('0x0'));var util=require(_0xc35b('0x1'));var moment=require(_0xc35b('0x2'));var winston=require(_0xc35b('0x3'));var config=require(_0xc35b('0x4'));var debugLevel=config['debugLevel']?config[_0xc35b('0x5')]['toLowerCase']():_0xc35b('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':'red','warn':_0xc35b('0x7'),'info':_0xc35b('0x8'),'print':'bold\x20white','success':'bold\x20green','http':_0xc35b('0x9'),'verbose':_0xc35b('0xa'),'debug':'bold\x20blue','silly':_0xc35b('0xb')};winston[_0xc35b('0xc')](XC_LOG_COLORS);function getLogFileName(_0x237785,_0x30d1c7,_0xd19bf7){var _0x24d7b1=_0x237785||_0xc35b('0xd');return path[_0xc35b('0xe')](_0x24d7b1,util['format'](_0xc35b('0xf'),_0x30d1c7,_0xd19bf7));}function formatter(_0x4d9b7a,_0x545985){_0x545985['message']=_0x545985['message'][_0xc35b('0x10')](/@@{/g,_0xc35b('0x11'))['replace'](/}@@/g,_0xc35b('0x12'))[_0xc35b('0x10')](/@{/g,'{{')[_0xc35b('0x10')](/}@/g,'}}');return util[_0xc35b('0x13')](_0xc35b('0x14'),moment()[_0xc35b('0x13')](_0xc35b('0x15')),_0x545985[_0xc35b('0x16')][_0xc35b('0x17')](),_0x4d9b7a,_0x545985[_0xc35b('0x18')]);}function fileFormat(_0x3391bd,_0x8074c5){_0x8074c5[_0xc35b('0x18')]=_0x8074c5[_0xc35b('0x18')][_0xc35b('0x10')](/@@{/g,_0xc35b('0x11'))[_0xc35b('0x10')](/}@@/g,_0xc35b('0x12'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x237009=_0x8074c5[_0xc35b('0x19')]&&Object[_0xc35b('0x1a')](_0x8074c5[_0xc35b('0x19')])[_0xc35b('0x1b')]?'\x0a\x09'+JSON[_0xc35b('0x1c')](_0x8074c5[_0xc35b('0x19')]):'';return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()['format'](_0xc35b('0x15')),_0x8074c5[_0xc35b('0x16')]['toUpperCase'](),_0x3391bd,_0x8074c5[_0xc35b('0x18')],_0x237009);}function consoleLogger(){var _0x49dda3=new winston[(_0xc35b('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc35b('0x1e'))][(_0xc35b('0x1f'))]({'level':_0xc35b('0x20'),'json':![],'formatter':function(_0xe0ef53){return formatter('',_0xe0ef53);}})]});return _0x49dda3;}function fileLogger(_0x1faa8d,_0x2e5a06){var _0x1ba66f=new winston[(_0xc35b('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc35b('0x1e'))][(_0xc35b('0x21'))]({'name':util[_0xc35b('0x13')](_0xc35b('0x22'),_0x1faa8d,_0xc35b('0x23')),'filename':getLogFileName(_0x2e5a06,_0x1faa8d,_0xc35b('0x23')),'level':_0xc35b('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xc86395){return fileFormat(_0x1faa8d,_0xc86395);}}),new winston[(_0xc35b('0x1e'))]['File']({'name':util[_0xc35b('0x13')](_0xc35b('0x22'),_0x1faa8d,debugLevel),'filename':getLogFileName(_0x2e5a06,_0x1faa8d,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x12c15f){return fileFormat(_0x1faa8d,_0x12c15f);}}),new winston[(_0xc35b('0x1e'))][(_0xc35b('0x1f'))]({'level':_0xc35b('0x20'),'json':![],'formatter':function(_0x4d461e){return fileFormat(_0x1faa8d,_0x4d461e);}})]});return _0x1ba66f;}exports[_0xc35b('0x24')]=consoleLogger;exports[_0xc35b('0x25')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 8dcead5..9cde4e8 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x1967,0x173));var _0x7196=function(_0x23ea73,_0xc51ae0){_0x23ea73=_0x23ea73-0x0;var _0x54f054=_0x1967[_0x23ea73];return _0x54f054;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x5f2f=['tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','membername','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','lodash','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','clientSecret','securityToken','code'];(function(_0x989d47,_0x2cc724){var _0x3d781d=function(_0x2447e7){while(--_0x2447e7){_0x989d47['push'](_0x989d47['shift']());}};_0x3d781d(++_0x2cc724);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3becd6,_0x9aef7e){_0x3becd6=_0x3becd6-0x0;var _0x2a45b3=_0x5f2f[_0x3becd6];return _0x2a45b3;};var _=require(_0xf5f2('0x0'));var sensitiveFields=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3'),_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'phone','mobile',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'accessKey',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'accessToken',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'consumerSecret',_0xf5f2('0x14'),'calleridname','calleridnum',_0xf5f2('0x15'),_0xf5f2('0x16'),'clientEmail',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'accountSid',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21')];function maskSensitiveData(_0x4d97fc){const _0xafe430=/(?!^)[\s\S](?!$)/g;if(_[_0xf5f2('0x22')](_0x4d97fc)){for(const _0x17d656 in _0x4d97fc){if(_[_0xf5f2('0x23')](_0x4d97fc[_0x17d656])){for(let _0x23e23a=0x0;_0x23e23a<_0x4d97fc[_0x17d656][_0xf5f2('0x24')];_0x23e23a++){maskSensitiveData(_0x4d97fc[_0x17d656][_0x23e23a]);}}else if(_[_0xf5f2('0x22')](_0x4d97fc[_0x17d656])){maskSensitiveData(_0x4d97fc[_0x17d656]);}else if(_[_0xf5f2('0x25')](_0x4d97fc[_0x17d656])){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](/{{{/g,_0xf5f2('0x27'))[_0xf5f2('0x26')](/}}}/g,_0xf5f2('0x28'))[_0xf5f2('0x26')](/{{/g,'@{')[_0xf5f2('0x26')](/}}/g,'}@');if(_[_0xf5f2('0x29')](sensitiveFields,_0x17d656)){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](_0xafe430,'*');}}}}}module[_0xf5f2('0x2a')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index b65e384..04edf1c 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['reduce','safeTemplate','lodash','{\x20{\x20','string','isArray','map'];(function(_0x47d1c6,_0x2c8a12){var _0x352e99=function(_0x34a92e){while(--_0x34a92e){_0x47d1c6['push'](_0x47d1c6['shift']());}};_0x352e99(++_0x2c8a12);}(_0xb7e7,0x121));var _0x7b7e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xb7e7[_0x38a7ac];return _0x53061a;};var _=require(_0x7b7e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x545d7d){return _0x545d7d==='{{'?_0x7b7e('0x1'):'\x20}\x20}';}function safeTemplate(_0x1b7cc7){var _0x54a37f=_0x1b7cc7;if(typeof _0x1b7cc7===_0x7b7e('0x2')){_0x54a37f=_0x1b7cc7['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x7b7e('0x3')](_0x1b7cc7)){_0x54a37f=_0x1b7cc7[_0x7b7e('0x4')](function(_0x1d9384){return safeTemplate(_0x1d9384);});}else if(_['isPlainObject'](_0x1b7cc7)){_0x54a37f=Object['keys'](_0x1b7cc7)[_0x7b7e('0x5')](function(_0x372bde,_0x7f87e0){_0x372bde[_0x7f87e0]=safeTemplate(_0x1b7cc7[_0x7f87e0]);return _0x372bde;},{});}return _0x54a37f;}module['exports'][_0x7b7e('0x6')]=safeTemplate; \ No newline at end of file +var _0x5c3c=['\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','reduce','safeTemplate','lodash','{\x20{\x20'];(function(_0x59aa28,_0x492a54){var _0x275b8e=function(_0x476de8){while(--_0x476de8){_0x59aa28['push'](_0x59aa28['shift']());}};_0x275b8e(++_0x492a54);}(_0x5c3c,0x132));var _0xc5c3=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x5c3c[_0xf71120];return _0xbe2fd3;};var _=require(_0xc5c3('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x40ad71){return _0x40ad71==='{{'?_0xc5c3('0x1'):_0xc5c3('0x2');}function safeTemplate(_0x4b9233){var _0x400726=_0x4b9233;if(typeof _0x4b9233===_0xc5c3('0x3')){_0x400726=_0x4b9233[_0xc5c3('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xc5c3('0x5')](_0x4b9233)){_0x400726=_0x4b9233[_0xc5c3('0x6')](function(_0x36525d){return safeTemplate(_0x36525d);});}else if(_[_0xc5c3('0x7')](_0x4b9233)){_0x400726=Object[_0xc5c3('0x8')](_0x4b9233)[_0xc5c3('0x9')](function(_0x5a392b,_0x4b8404){_0x5a392b[_0x4b8404]=safeTemplate(_0x4b9233[_0x4b8404]);return _0x5a392b;},{});}return _0x400726;}module['exports'][_0xc5c3('0xa')]=safeTemplate; \ No newline at end of file